diff --git a/.vscode/settings.json b/.vscode/settings.json index 263023c330c..0a50fa67ad2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,5 +8,98 @@ "editor.wordBasedSuggestions": true, "editor.snippetSuggestions": "top" }, - "python.formatting.provider": "black" + "python.formatting.provider": "black", + "files.associations": { + "optional": "cpp", + "algorithm": "cpp", + "any": "cpp", + "array": "cpp", + "atomic": "cpp", + "bit": "cpp", + "bitset": "cpp", + "cctype": "cpp", + "charconv": "cpp", + "chrono": "cpp", + "cinttypes": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "codecvt": "cpp", + "compare": "cpp", + "concepts": "cpp", + "condition_variable": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "deque": "cpp", + "exception": "cpp", + "filesystem": "cpp", + "format": "cpp", + "forward_list": "cpp", + "fstream": "cpp", + "functional": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "ios": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "iterator": "cpp", + "limits": "cpp", + "list": "cpp", + "locale": "cpp", + "map": "cpp", + "memory": "cpp", + "mutex": "cpp", + "new": "cpp", + "numeric": "cpp", + "ostream": "cpp", + "queue": "cpp", + "random": "cpp", + "ranges": "cpp", + "ratio": "cpp", + "regex": "cpp", + "set": "cpp", + "shared_mutex": "cpp", + "span": "cpp", + "sstream": "cpp", + "stack": "cpp", + "stdexcept": "cpp", + "stop_token": "cpp", + "streambuf": "cpp", + "string": "cpp", + "system_error": "cpp", + "thread": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "typeinfo": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "utility": "cpp", + "valarray": "cpp", + "variant": "cpp", + "vector": "cpp", + "xfacet": "cpp", + "xhash": "cpp", + "xiosbase": "cpp", + "xlocale": "cpp", + "xlocbuf": "cpp", + "xlocinfo": "cpp", + "xlocmes": "cpp", + "xlocmon": "cpp", + "xlocnum": "cpp", + "xloctime": "cpp", + "xmemory": "cpp", + "xstddef": "cpp", + "xstring": "cpp", + "xtr1common": "cpp", + "xtree": "cpp", + "xutility": "cpp" + } } diff --git a/common/goos/PrettyPrinter2.cpp b/common/goos/PrettyPrinter2.cpp index 94387073b54..8d61b4ba146 100644 --- a/common/goos/PrettyPrinter2.cpp +++ b/common/goos/PrettyPrinter2.cpp @@ -288,7 +288,11 @@ void break_list(Node* node) { node->sub_elt_indent += name.size(); } else if (name == "defmethod") { // things with 4 things in the top line: (defmethod - node->top_line_count = 4; + // or just 3 things in the top line: (defmethod + node->top_line_count = 3; + if (node->child_nodes.size() >= 4 && node->child_nodes[2].kind == Node::Kind::ATOM) { + node->top_line_count = 4; + } } else if (name == "until" || name == "while" || name == "dotimes" || name == "countdown" || name == "when" || name == "behavior" || name == "lambda" || name == "defpart" || name == "define") { diff --git a/common/type_system/Type.cpp b/common/type_system/Type.cpp index f6c383a8ad9..71091a31bc5 100644 --- a/common/type_system/Type.cpp +++ b/common/type_system/Type.cpp @@ -421,10 +421,12 @@ int Type::get_num_methods() const { * Add a method defined specifically for this type. */ const MethodInfo& Type::add_method(const MethodInfo& info) { - for (auto it = m_methods.rbegin(); it != m_methods.rend(); it++) { - if (!it->overrides_parent && !it->only_overrides_docstring) { - ASSERT(it->id + 1 == info.id); - break; + if (!info.overrides_parent) { + for (auto it = m_methods.rbegin(); it != m_methods.rend(); it++) { + if (!it->overrides_parent && !it->only_overrides_docstring) { + ASSERT(it->id + 1 == info.id); + break; + } } } diff --git a/common/type_system/Type.h b/common/type_system/Type.h index 07bacd8f2e1..85276400799 100644 --- a/common/type_system/Type.h +++ b/common/type_system/Type.h @@ -32,6 +32,7 @@ struct MethodInfo { bool overrides_parent = false; bool only_overrides_docstring = false; std::optional docstring; + std::optional overlay_name; bool operator==(const MethodInfo& other) const; bool operator!=(const MethodInfo& other) const { return !((*this) == other); } diff --git a/common/type_system/TypeSystem.cpp b/common/type_system/TypeSystem.cpp index 942ad9a6649..12cd6bc550c 100644 --- a/common/type_system/TypeSystem.cpp +++ b/common/type_system/TypeSystem.cpp @@ -516,14 +516,13 @@ int TypeSystem::get_load_size_allow_partial_def(const TypeSpec& ts) const { } MethodInfo TypeSystem::override_method(Type* type, - const std::string& /*type_name*/, - const int method_id, + const std::string& method_name, const std::optional& docstring) { // Lookup the method from the parent type MethodInfo existing_info; - bool exists = try_lookup_method(type->get_parent(), method_id, &existing_info); + bool exists = try_lookup_method(type->get_parent(), method_name, &existing_info); if (!exists) { - throw_typesystem_error("Trying to use override a method that has no parent declaration"); + throw_typesystem_error("Trying to override a method that has no parent declaration"); } // use the existing ID. return type->add_method({existing_info.id, existing_info.name, existing_info.type, @@ -554,8 +553,7 @@ MethodInfo TypeSystem::declare_method(Type* type, const std::optional& docstring, bool no_virtual, const TypeSpec& ts, - bool override_type, - int id) { + bool override_type) { if (method_name == "new") { if (override_type) { throw_typesystem_error("Cannot use :replace option with a new method."); @@ -569,7 +567,7 @@ MethodInfo TypeSystem::declare_method(Type* type, if (override_type) { if (!got_existing) { - if (id != -1 && try_lookup_method(type->get_parent(), id, &existing_info)) { + if (try_lookup_method(type->get_parent(), method_name, &existing_info)) { } else { throw_typesystem_error( "Cannot use :replace on method {} of {} because this method was not previously " @@ -616,6 +614,34 @@ MethodInfo TypeSystem::declare_method(Type* type, } } +/*! + * Adds a new method that is overlayed on top of a different, existing method. + * This should be used basically never (happens once in Jak 1). + */ +MethodInfo TypeSystem::overlay_method(Type* type, + const std::string& method_name, + const std::string& method_overlay_name, + const std::optional& docstring, + const TypeSpec& ts) { + // look up the method + MethodInfo existing_info; + bool got_existing = try_lookup_method(type, method_overlay_name, &existing_info); + + if (!got_existing) { + if (try_lookup_method(type->get_parent(), method_overlay_name, &existing_info)) { + } else { + throw_typesystem_error( + "Cannot use :overlay-at on method {} of {} because this method was not previously " + "declared in a parent.", + method_overlay_name, type->get_name()); + } + } + + // use the existing ID. + return type->add_method({existing_info.id, method_name, ts, type->get_name(), false, true, false, + docstring, std::make_optional(method_overlay_name)}); +} + MethodInfo TypeSystem::define_method(const std::string& type_name, const std::string& method_name, const TypeSpec& ts, @@ -1885,30 +1911,36 @@ std::string TypeSystem::generate_deftype_footer(const Type* type) const { } } - if (type->heap_base()) { + if (type->heap_base() && + type->heap_base() != + ((type->get_size_in_memory() - get_type_of_type("process")->size() + 0xf) & + ~0xf)) { + // don't print if auto heap-base does the job result.append(fmt::format(" :heap-base #x{:x}\n", type->heap_base())); } auto method_count = get_next_method_id(type); - result.append(fmt::format(" :method-count-assert {}\n", get_next_method_id(type))); - result.append(fmt::format(" :size-assert #x{:x}\n", type->get_size_in_memory())); + // result.append(fmt::format(" :method-count-assert {}\n", get_next_method_id(type))); + // result.append(fmt::format(" :size-assert #x{:x}\n", type->get_size_in_memory())); TypeFlags flags; flags.heap_base = type->heap_base(); flags.size = type->get_size_in_memory(); flags.pad = 0; flags.methods = method_count; - result.append(fmt::format(" :flag-assert #x{:x}\n ", flags.flag)); + // result.append(fmt::format(" :flag-assert #x{:x}\n", flags.flag)); if (!type->gen_inspect()) { - result.append(":no-inspect\n "); + result.append(" :no-inspect\n "); } std::string methods_string; + std::string state_methods_string; + std::string states_string; // New Method auto new_info = type->get_new_method_defined_for_type(); if (new_info) { - methods_string.append("(new ("); + methods_string.append(" (new ("); for (size_t i = 0; i < new_info->type.arg_count() - 1; i++) { methods_string.append(new_info->type.get_arg(i).print()); if (i != new_info->type.arg_count() - 2) { @@ -1916,24 +1948,41 @@ std::string TypeSystem::generate_deftype_footer(const Type* type) const { } } methods_string.append( - fmt::format(") {} ", new_info->type.get_arg(new_info->type.arg_count() - 1).print(), 0)); + fmt::format(") {}", new_info->type.get_arg(new_info->type.arg_count() - 1).print(), 0)); auto behavior = new_info->type.try_get_tag("behavior"); if (behavior) { - methods_string.append(fmt::format(":behavior {} ", *behavior)); + methods_string.append(fmt::format(" :behavior {}", *behavior)); } - methods_string.append("0)\n "); + methods_string.append(")\n"); } // Rest of methods + bool done_with_state_methods = false; // TODO fix this... this depends on the order of m_methods for (auto& info : type->get_methods_defined_for_type()) { + if (!done_with_state_methods && info.type.base_type() == "state" && !info.overrides_parent) { + if (info.type.arg_count() > 1) { + state_methods_string.append(fmt::format(" ({}", info.name)); + for (size_t i = 0; i < info.type.arg_count() - 1; ++i) { + state_methods_string.push_back(' '); + state_methods_string.append(info.type.get_arg(i).print()); + } + state_methods_string.append(")\n"); + } else { + state_methods_string.append(fmt::format(" {}\n", info.name)); + } + continue; + } else { + done_with_state_methods = true; + } + // check if we only override the docstring if (info.only_overrides_docstring) { continue; } - methods_string.append(fmt::format("({} (", info.name)); + methods_string.append(fmt::format(" ({} (", info.name)); for (size_t i = 0; i < info.type.arg_count() - 1; i++) { methods_string.append(info.type.get_arg(i).print()); if (i != info.type.arg_count() - 2) { @@ -1941,35 +1990,32 @@ std::string TypeSystem::generate_deftype_footer(const Type* type) const { } } methods_string.append( - fmt::format(") {} ", info.type.get_arg(info.type.arg_count() - 1).print())); - - if (info.no_virtual) { - methods_string.append(":no-virtual "); - } - - if (info.overrides_parent) { - methods_string.append(":replace "); - } + fmt::format(") {}", info.type.get_arg(info.type.arg_count() - 1).print())); auto behavior = info.type.try_get_tag("behavior"); if (behavior) { - methods_string.append(fmt::format(":behavior {} ", *behavior)); + methods_string.append(fmt::format(" :behavior {}", *behavior)); } if (info.type.base_type() == "state") { - methods_string.append(":state "); + methods_string.append(" :state"); } - methods_string.append(fmt::format("{})\n ", info.id)); - } + if (info.no_virtual) { + methods_string.append(" :no-virtual"); + } - if (!methods_string.empty()) { - result.append("(:methods\n "); - result.append(methods_string); - result.append(")\n "); + if (info.overrides_parent) { + if (info.overlay_name.has_value()) { + methods_string.append(fmt::format(" :overlay-at {}", *info.overlay_name)); + } else { + methods_string.append(" :replace"); + } + } + + methods_string.append(fmt::format(")\n", info.id)); } - std::string states_string; for (auto& info : type->get_states_declared_for_type()) { if (info.second.arg_count() > 1) { states_string.append(fmt::format(" ({}", info.first)); @@ -1983,16 +2029,157 @@ std::string TypeSystem::generate_deftype_footer(const Type* type) const { } } + if (!state_methods_string.empty()) { + result.append(" (:state-methods\n"); + result.append(state_methods_string); + result.append(" )\n"); + } + + if (!methods_string.empty()) { + result.append(" (:methods\n"); + result.append(methods_string); + result.append(" )\n"); + } + if (!states_string.empty()) { - result.append("(:states\n"); + result.append(" (:states\n"); result.append(states_string); - result.append(" )\n "); + result.append(" )\n"); } - result.append(")\n"); + result.append(" )\n"); return result; } +std::optional find_best_field_in_structure(const TypeSystem& ts, + const StructureType* st, + int offset, + const Field& requesting_field, + bool want_fixed, + int start_field, + int end_field = -1) { + // performs best field lookup within a structure, at an offset. + const Field* best_val = nullptr; + const Field* best_exact = nullptr; + const Field* best_struct = nullptr; + std::pair best_val_arr = {nullptr, -1}; + std::pair best_exact_arr = {nullptr, -1}; + std::pair best_struct_arr = {nullptr, -1}; + std::optional best_struct_field_deref; + const Field* best = nullptr; + if (end_field == -1) { + end_field = st->fields().size(); + } + for (size_t i = start_field; i < end_field; ++i) { + const auto& field = st->fields().at(i); + auto type = ts.lookup_type(field.type()); + if (field.is_dynamic() || field.offset() > offset || field.user_placed() != want_fixed) { + continue; + } + if (!field.is_array()) { + if (!field.is_inline() && field.offset() + type->get_load_size() > offset) { + if (field.offset() == offset) { + // not array, not inline - can fit in register, only check exact offset. + if (!best_val || + type->get_load_size() == ts.lookup_type(requesting_field.type())->get_load_size()) { + best_val = &field; + } + } + } else if (field.is_inline() && field.offset() + type->get_size_in_memory() > offset) { + if (field.type() == requesting_field.type() && field.offset() == offset) { + // not array, inlined and exact same as this field, just overlay directly on top + best_exact = &field; + } else { + auto f_type = dynamic_cast(type); + if (f_type) { + // struct that encompasses this field + // simply search that structure for the field we want, offset by the field's offset + auto best_field_in_struct = find_best_field_in_structure( + ts, f_type, offset - field.offset(), requesting_field, want_fixed, 0); + if (best_field_in_struct) { + best_struct_field_deref = best_field_in_struct; + best_struct = &field; + } + } + } + } + } else { + int rel_offset = offset - field.offset(); + // array case (and array encompasses what we want) + int array_idx = rel_offset / type->get_size_in_memory(); + if (!field.is_inline() && + field.offset() + field.array_size() * type->get_load_size() > offset) { + if (rel_offset % type->get_load_size() == 0) { + // found exact match for array index + if (!best_val_arr.first || + type->get_load_size() == ts.lookup_type(requesting_field.type())->get_load_size()) { + best_val_arr.first = &field; + best_val_arr.second = rel_offset / type->get_load_size(); + } + } + } else if (field.is_inline() && + field.offset() + field.array_size() * type->get_size_in_memory() > offset) { + if (field.type() == requesting_field.type() && + rel_offset % type->get_size_in_memory() == 0) { + // same type + best_exact_arr.first = &field; + best_exact_arr.second = array_idx; + } else if (requesting_field.is_array() && rel_offset % type->get_size_in_memory() == 0 && + array_idx == 0) { + // starts at the same offset as another array. just use the field with nothing extra + best_exact = &field; + } else { + auto f_type = dynamic_cast(type); + if (f_type && field.offset() + f_type->get_size_in_memory() > offset) { + // struct that encompasses this field + // simply search that structure for the field we want, offset by the field's offset + auto best_field_in_struct = + find_best_field_in_structure(ts, f_type, rel_offset % type->get_size_in_memory(), + requesting_field, want_fixed, 0); + if (best_field_in_struct) { + best_struct_field_deref = best_field_in_struct; + best_struct_arr.first = &field; + best_struct_arr.second = array_idx; + } + } + } + } + } + } + + int best_array_idx = -1; + if (best_exact) { + best = best_exact; + } else if (best_exact_arr.first) { + best = best_exact_arr.first; + best_array_idx = best_exact_arr.second; + } else if (best_val) { + best = best_val; + } else if (best_val_arr.first) { + best = best_val_arr.first; + best_array_idx = best_val_arr.second; + } else if (best_struct) { + best = best_struct; + } else if (best_struct_arr.first) { + best = best_struct_arr.first; + best_array_idx = best_struct_arr.second; + } + if (best) { + auto ret = + best_array_idx == -1 ? best->name() : fmt::format("{} {}", best->name(), best_array_idx); + if (best == best_struct || best == best_struct_arr.first) { + return ret + " " + *best_struct_field_deref; + } else { + return ret; + } + } else if (!want_fixed) { + // try again but with a user-placed offset + return find_best_field_in_structure(ts, st, offset, requesting_field, true, start_field, + end_field); + } + return {}; +} + std::string TypeSystem::generate_deftype_for_structure(const StructureType* st) const { std::string result; result += fmt::format("(deftype {} ({})\n", st->get_name(), st->get_parent()); @@ -2004,10 +2191,10 @@ std::string TypeSystem::generate_deftype_for_structure(const StructureType* st) int longest_field_name = 0; int longest_type_name = 0; int longest_mods = 0; + int longest_mods_with_user_placed = 0; const std::string inline_string = ":inline"; const std::string dynamic_string = ":dynamic"; - bool has_offset_assert = false; // calculate longest strings needed, for basic linting @@ -2021,33 +2208,33 @@ std::string TypeSystem::generate_deftype_for_structure(const StructureType* st) // normal fields for (size_t i = st->first_unique_field_idx(); i < st->fields().size(); i++) { const auto& field = st->fields().at(i); - longest_field_name = std::max(longest_field_name, int(field.name().size())); - longest_type_name = std::max(longest_type_name, int(field.type().print().size())); int mods = 0; // mods are array size, :inline, :dynamic if (field.is_array() && !field.is_dynamic()) { + mods++; mods += std::to_string(field.array_size()).size(); } if (field.is_inline()) { - if (mods) { - mods++; // space - } + mods++; // space mods += inline_string.size(); } if (field.is_dynamic()) { - if (mods) { - mods++; // space - } + mods++; // space mods += dynamic_string.size(); } - if (!field.user_placed()) { - has_offset_assert = true; + longest_field_name = std::max(longest_field_name, int(field.name().size())); + if (mods > 0 || field.user_placed()) { + // this is only relevant for fields that have mods + longest_type_name = std::max(longest_type_name, int(field.type().print().size())); } longest_mods = std::max(longest_mods, mods); + if (field.user_placed()) { + longest_mods_with_user_placed = std::max(longest_mods_with_user_placed, mods); + } } // now actually write out the fields @@ -2057,10 +2244,9 @@ std::string TypeSystem::generate_deftype_for_structure(const StructureType* st) const auto& field = st->fields().at(i); result += "("; result += field.name(); - result.append(1 + (longest_field_name - int(field.name().size())), ' '); + result.append(2 + (longest_field_name - int(field.name().size())), ' '); result += field.type().print(); result.append(1 + (longest_type_name - int(field.type().print().size())), ' '); - result.append(1 + longest_mods, ' '); result.append(":override)\n "); } @@ -2069,40 +2255,51 @@ std::string TypeSystem::generate_deftype_for_structure(const StructureType* st) const auto& field = st->fields().at(i); result += "("; result += field.name(); - result.append(1 + (longest_field_name - int(field.name().size())), ' '); + result.append(2 + (longest_field_name - int(field.name().size())), ' '); result += field.type().print(); - result.append(1 + (longest_type_name - int(field.type().print().size())), ' '); std::string mods; if (field.is_array() && !field.is_dynamic()) { - mods += std::to_string(field.array_size()); mods += " "; + mods += std::to_string(field.array_size()); } if (field.is_inline()) { - mods += inline_string; mods += " "; + mods += inline_string; } if (field.is_dynamic()) { - mods += dynamic_string; mods += " "; + mods += dynamic_string; } + if (!mods.empty()) { + result.append(1 + longest_type_name - int(field.type().print().size()), ' '); + } result.append(mods); - result.append(longest_mods - int(mods.size() - 1), ' '); - if (!field.user_placed()) { - result.append(":offset-assert "); - } else { - if (has_offset_assert) { - result.append(":offset "); + if (field.user_placed()) { + result.append(longest_mods_with_user_placed - int(mods.size()), ' '); + if (mods.empty()) { + result.append(1 + longest_type_name - int(field.type().print().size()), ' '); + } + // find best field for :overlay-at + // we find the first field that does not come after the current one + // and either use it, or check if one of its fields (recursively) is appropriate + // we also check for array offsets. we ALSO do bounds-checking! + // non-fixed offset fields get priority! dynamic fields are IGNORED. + // if all else fails, print as fixed offset. + auto best_match = find_best_field_in_structure(*this, st, field.offset(), field, false, 0, i); + if (!best_match) { + result.append(fmt::format(" :offset {:3d}", field.offset())); + } else if (best_match->find(' ') == std::string::npos) { + result.append(fmt::format(" :overlay-at {}", *best_match)); } else { - result.append(":offset "); + result.append(fmt::format(" :overlay-at (-> {})", *best_match)); } } - result.append(fmt::format("{:3d}", field.offset())); result.append(")\n "); } diff --git a/common/type_system/TypeSystem.h b/common/type_system/TypeSystem.h index d2db7c70a92..9ba40f3b1f2 100644 --- a/common/type_system/TypeSystem.h +++ b/common/type_system/TypeSystem.h @@ -161,8 +161,7 @@ class TypeSystem { int get_load_size_allow_partial_def(const TypeSpec& ts) const; MethodInfo override_method(Type* type, - const std::string& type_name, - const int method_id, + const std::string& method_name, const std::optional& docstring); MethodInfo declare_method(const std::string& type_name, const std::string& method_name, @@ -175,8 +174,12 @@ class TypeSystem { const std::optional& docstring, bool no_virtual, const TypeSpec& ts, - bool override_type, - int id = -1); + bool override_type); + MethodInfo overlay_method(Type* type, + const std::string& method_name, + const std::string& method_overlay_name, + const std::optional& docstring, + const TypeSpec& ts); MethodInfo define_method(const std::string& type_name, const std::string& method_name, const TypeSpec& ts, diff --git a/common/type_system/deftype.cpp b/common/type_system/deftype.cpp index fb230097c9f..0c7b648e7bf 100644 --- a/common/type_system/deftype.cpp +++ b/common/type_system/deftype.cpp @@ -136,14 +136,65 @@ void add_field( throw std::runtime_error(fmt::format("Field {} not found to override", name)); } } else if (opt_name == ":overlay-at") { - auto field_name = symbol_string(car(rest)); + const auto& param = car(rest); + rest = cdr(rest); Field overlay_field; - if (!structure->lookup_field(field_name, &overlay_field)) { - throw std::runtime_error( - fmt::format("Field {} not found to overlay for {}", field_name, name)); + if (param.is_symbol()) { + auto field_name = symbol_string(param); + if (!structure->lookup_field(field_name, &overlay_field)) { + throw std::runtime_error( + fmt::format("Field {} not found to overlay for {}", field_name, name)); + } + offset_override = overlay_field.offset(); + } else if (param.is_pair() && car(¶m).is_symbol("->")) { + auto name_it = cdr(¶m); + if (name_it->is_empty_list()) { + throw std::runtime_error( + fmt::format("Field list for overlay-at in {} was empty", name)); + } + auto type_to_use = structure; + offset_override = 0; + while (!name_it->is_empty_list()) { + const auto& deref_field = car(name_it); + if (deref_field.is_int()) { + auto ref_array_field = !type_to_use && !overlay_field.is_inline() + ? ts->lookup_type_allow_partial_def(overlay_field.type()) + : nullptr; + if (ref_array_field) { + // we can have an array of references (non-inline) to a forward-declared type + offset_override += ref_array_field->get_load_size() * deref_field.as_int(); + } else { + auto type_to_deref = type_to_use && overlay_field.is_inline() + ? TypeSpec("inline-array") + : TypeSpec("pointer"); + type_to_deref.add_arg(overlay_field.type()); + auto deref_info = ts->get_deref_info(type_to_deref); + if (!deref_info.can_deref) { + throw std::runtime_error( + fmt::format("Array could not be dereferenced for overlay-at in {}", name)); + } + // overlay_field.type() = deref_info.result_type; + offset_override += deref_info.stride * deref_field.as_int(); + } + } else { + if (!type_to_use) { + throw std::runtime_error( + fmt::format("Field {} not inside a structure for overlay-at in {}", + overlay_field.name(), name)); + } + auto field_name = symbol_string(car(name_it)); + if (!type_to_use->lookup_field(field_name, &overlay_field)) { + throw std::runtime_error( + fmt::format("Field {} not found to overlay for {}", field_name, name)); + } + type_to_use = dynamic_cast(ts->lookup_type(overlay_field.type())); + offset_override += overlay_field.offset(); + } + name_it = cdr(name_it); + } + } else { + throw std::runtime_error(fmt::format("Unknown parameter for overlay-at in {}", name)); } - offset_override = overlay_field.offset(); - rest = cdr(rest); } else if (opt_name == ":score") { score = get_float(car(rest)); rest = cdr(rest); @@ -276,14 +327,20 @@ void declare_method(Type* type, // - this effectively does a :replace without having to re-define the name and signature and // keep that in-sync std::string method_name; + std::string method_overlay_name; TypeSpec function_typespec("function"); std::optional docstring; goos::Object args; goos::Object return_type; bool no_virtual = false; bool replace_method = false; + bool overlay_method = false; bool overriding_doc = false; + // name + method_name = symbol_string(car(obj)); + obj = cdr(obj); + if (!obj->is_empty_list() && car(obj).is_symbol(":override-doc")) { obj = cdr(obj); if (car(obj).is_string()) { @@ -296,10 +353,6 @@ void declare_method(Type* type, } if (!overriding_doc) { - // name - method_name = symbol_string(car(obj)); - obj = cdr(obj); - // docstring if (obj->is_pair() && car(obj).is_string()) { docstring = str_util::trim_newline_indents(car(obj).as_string()->data); @@ -325,13 +378,9 @@ void declare_method(Type* type, } else if (keyword == ":replace") { replace_method = true; } else if (keyword == ":state") { - auto behavior_tag = function_typespec.try_get_tag("behavior"); function_typespec = TypeSpec("state"); - if (behavior_tag) { - function_typespec.add_new_tag("behavior", behavior_tag.value()); - } // parse state docstrings if available - if (car(cdr(obj)).is_list()) { + if (!cdr(obj)->is_empty_list() && car(cdr(obj)).is_list()) { obj = cdr(obj); auto docstring_list = &car(obj); auto elem = docstring_list; @@ -362,6 +411,13 @@ void declare_method(Type* type, throw std::runtime_error("Bad usage of :behavior in a method declaration"); } function_typespec.add_new_tag("behavior", symbol_string(obj->as_pair()->car)); + } else if (keyword == ":overlay-at") { + obj = cdr(obj); + if (!car(obj).is_symbol()) { + throw std::runtime_error("Invalid parameter to method overlay-at"); + } + method_overlay_name = symbol_string(car(obj)); + overlay_method = true; } obj = cdr(obj); } @@ -373,36 +429,62 @@ void declare_method(Type* type, function_typespec.add_arg(parse_typespec(type_system, return_type)); } - // determine the method id, it should be the last in the list - int id = -1; - if (!obj->is_empty_list() && car(obj).is_int()) { - auto& id_obj = car(obj); - id = get_int(id_obj); - obj = cdr(obj); + if (!obj->is_empty_list()) { + throw std::runtime_error(fmt::format("found unknown data in a method declaration:\n{}\n\n{}", + obj->print(), _obj.print())); } - if (!obj->is_empty_list()) { - throw std::runtime_error("found symbols after the `id` in a method defintion: " + - def.print()); + if (overlay_method && (no_virtual || replace_method)) { + throw std::runtime_error( + fmt::format("method {} in type {} has invalid combination of keywords", method_name, + type->get_name())); } MethodInfo info; if (overriding_doc) { - info = type_system->override_method(type, method_name, id, docstring); + info = type_system->override_method(type, method_name, docstring); + } else if (overlay_method) { + info = type_system->overlay_method(type, method_name, method_overlay_name, docstring, + function_typespec); } else { info = type_system->declare_method(type, method_name, docstring, no_virtual, - function_typespec, replace_method, id); + function_typespec, replace_method); } + }); +} - // check the method assert - if (id != -1) { - // method id assert! - if (id != info.id) { - lg::print("WARNING - ID assert failed on method {} of type {} (wanted {} got {})\n", - method_name.c_str(), type->get_name().c_str(), id, info.id); - throw std::runtime_error("Method ID assert failed"); +void declare_state_methods(Type* type, + TypeSystem* type_system, + const goos::Object& def, + StructureDefResult& struct_def) { + for_each_in_list(def, [&](const goos::Object& _obj) { + auto obj = &_obj; + // either state-name or (state-name args...) or (state-name "docstring" args...) + std::string method_name; + TypeSpec function_typespec("state"); + std::optional docstring; + + if (obj->is_symbol()) { + method_name = obj->as_symbol().name_ptr; + } else if (obj->is_list()) { + if (!car(obj).is_symbol()) { + throw std::runtime_error( + fmt::format("{} is not a valid name for a state-method", obj->print())); + } + method_name = car(obj).as_symbol().name_ptr; + auto& args = *cdr(obj); + if (car(obj).is_string()) { + // docstring first + docstring = car(obj).as_string()->data; + obj = cdr(obj); } + for_each_in_list(args, [&](const goos::Object& o) { + function_typespec.add_arg(parse_typespec(type_system, o)); + }); } + function_typespec.add_arg(TypeSpec("_type_")); + + type_system->declare_method(type, method_name, docstring, false, function_typespec, false); }); } @@ -492,6 +574,8 @@ StructureDefResult parse_structure_def( declare_method(type, ts, *opt_list, result); } else if (list_name == ":states") { declare_state(type, ts, *opt_list, result); + } else if (list_name == ":state-methods") { + declare_state_methods(type, ts, *opt_list, result); } else { throw std::runtime_error("Invalid option list in field specification: " + car(rest).print()); diff --git a/decompiler/analysis/analyze_inspect_method.cpp b/decompiler/analysis/analyze_inspect_method.cpp index 9ec704a6b16..cee0cb2c27c 100644 --- a/decompiler/analysis/analyze_inspect_method.cpp +++ b/decompiler/analysis/analyze_inspect_method.cpp @@ -1643,31 +1643,59 @@ std::string TypeInspectorResult::print_as_deftype( } if (type_method_count > 9) { - result.append("(:methods\n "); + std::string methods_list; + std::string state_methods_list; + MethodInfo old_new_method; if (old_game_type && old_game_type->get_my_new_method(&old_new_method)) { - result.append(old_method_string(old_new_method)); - result.append("\n "); + methods_list.append(" "); + methods_list.append(old_method_string(old_new_method)); + methods_list.push_back('\n'); } + bool done_with_state_methods = false; for (int i = parent_method_count; i < type_method_count; i++) { - // If the method is actually a state, skip it! + bool print_as_state_method = false; if (method_states.count(i) != 0) { - result.append(fmt::format("({} () _type_ :state {})", method_states.at(i), i)); + if (!done_with_state_methods) { + print_as_state_method = true; + state_methods_list.append(fmt::format(" {}", method_states.at(i))); + } else { + methods_list.append( + fmt::format(" ({} () _type_ :state) ;; {}", method_states.at(i), i)); + } } else { - result.append(fmt::format("({}-method-{} () none {})", type_name, i, i)); + done_with_state_methods = true; + methods_list.append(fmt::format(" ({}-method-{} () none) ;; {}", type_name, i, i)); } if (old_game_type) { MethodInfo info; if (old_game_type->get_my_method(i, &info)) { - result += old_method_string(info); + if (print_as_state_method) { + state_methods_list += old_method_string(info); + } else { + methods_list += old_method_string(info); + } } } - result.append("\n "); + if (print_as_state_method) { + state_methods_list.push_back('\n'); + } else { + methods_list.push_back('\n'); + } + } + if (!state_methods_list.empty()) { + result.append("(:state-methods\n"); + result.append(state_methods_list); + result.append(" )\n "); + } + if (!methods_list.empty()) { + result.append("(:methods"); + result.append(methods_list); + result.append(" )\n "); } - result.append(")\n "); } - // Print out states if we have em + // Print out (normal) states if we have em // - Could probably assume the process name comes first and associate it with the right type // but that may or may not be risky so, edit the types yourself... if (method_states.size() > 0) { diff --git a/decompiler/analysis/final_output.cpp b/decompiler/analysis/final_output.cpp index 80c7f949168..1abcf75c063 100644 --- a/decompiler/analysis/final_output.cpp +++ b/decompiler/analysis/final_output.cpp @@ -178,7 +178,9 @@ std::string final_defun_out(const Function& func, auto method_info = dts.ts.lookup_method(func.guessed_name.type_name, func.guessed_name.method_id); top.push_back(pretty_print::to_symbol(method_info.name)); - top.push_back(pretty_print::to_symbol(func.guessed_name.type_name)); + if (method_info.name == "new") { + top.push_back(pretty_print::to_symbol(func.guessed_name.type_name)); + } top.push_back(arguments); auto top_form = pretty_print::build_list(top); diff --git a/decompiler/config/jak1/all-types.gc b/decompiler/config/jak1/all-types.gc index 635d8777127..63064f418d8 100644 --- a/decompiler/config/jak1/all-types.gc +++ b/decompiler/config/jak1/all-types.gc @@ -32,7 +32,8 @@ ;; children of inline-array-class should define their own data which overlays this one. (_data uint8 :score -50 :dynamic :offset 16) ) - (:methods (new (symbol type int) _type_ 0)) + (:methods (new (symbol type int) _type_) ;; 0 + ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 @@ -1701,12 +1702,12 @@ (self process-tree :offset-assert 28) ) (:methods - (new (symbol type basic) _type_ 0) - (activate (_type_ process-tree basic pointer) process-tree 9) - (deactivate (_type_) none 10) - (init-from-entity! (_type_ entity-actor) none 11) - (run-logic? (_type_) symbol 12) - (process-tree-method-13 () none 13) + (new (symbol type basic) _type_) ;; 0 + (activate (_type_ process-tree basic pointer) process-tree) ;; 9 + (deactivate (_type_) none) ;; 10 + (init-from-entity! (_type_ entity-actor) none) ;; 11 + (run-logic? (_type_) symbol) ;; 12 + (process-tree-method-13 () none) ;; 13 ) :size-assert #x20 :method-count-assert 14 @@ -1754,9 +1755,9 @@ (stack-size int32 :offset-assert 36) ) (:methods - (stack-size-set! (_type_ int) none 9) - (thread-suspend (_type_) none 10) - (thread-resume (_type_) none 11) + (stack-size-set! (_type_ int) none) ;; 9 + (thread-suspend (_type_) none) ;; 10 + (thread-resume (_type_) none) ;; 11 ) :method-count-assert 12 :size-assert #x28 @@ -1773,9 +1774,9 @@ (stack uint8 :dynamic :offset-assert 128) ) (:methods - (new (symbol type process symbol int pointer) _type_ 0) - (thread-suspend (_type_) none 10) - (thread-resume (_type_) none 11) + (new (symbol type process symbol int pointer) _type_) ;; 0 + (thread-suspend (_type_) none) ;; 10 + (thread-resume (_type_) none) ;; 11 ) :method-count-assert 12 :size-assert #x80 @@ -1787,9 +1788,9 @@ ;; nothing new! ) (:methods - (new (symbol type int int basic) _type_ 0) - (get-process (_type_ type int) process 14) - (return-process ( _type_ process) none 15) + (new (symbol type int int basic) _type_) ;; 0 + (get-process (_type_ type int) process) ;; 14 + (return-process ( _type_ process) none) ;; 15 ) :size-assert #x20 :method-count-assert 16 @@ -1822,18 +1823,18 @@ (process-list dead-pool-heap-rec :inline :dynamic :offset-assert 104) ) (:methods - (new (symbol type basic int int) _type_ 0) - (compact (dead-pool-heap int) none 16) - (shrink-heap (dead-pool-heap process) dead-pool-heap 17) - (churn (dead-pool-heap int) none 18) - (memory-used (dead-pool-heap) int 19) - (memory-total (dead-pool-heap) int 20) - (gap-size (dead-pool-heap dead-pool-heap-rec) int 21) - (gap-location (dead-pool-heap dead-pool-heap-rec) pointer 22) - (find-gap (dead-pool-heap dead-pool-heap-rec) dead-pool-heap-rec 23) - (find-gap-by-size (dead-pool-heap int) dead-pool-heap-rec 24) - (memory-free (dead-pool-heap) int 25) - (compact-time (dead-pool-heap) uint 26) + (new (symbol type basic int int) _type_) ;; 0 + (compact (dead-pool-heap int) none) ;; 16 + (shrink-heap (dead-pool-heap process) dead-pool-heap) ;; 17 + (churn (dead-pool-heap int) none) ;; 18 + (memory-used (dead-pool-heap) int) ;; 19 + (memory-total (dead-pool-heap) int) ;; 20 + (gap-size (dead-pool-heap dead-pool-heap-rec) int) ;; 21 + (gap-location (dead-pool-heap dead-pool-heap-rec) pointer) ;; 22 + (find-gap (dead-pool-heap dead-pool-heap-rec) dead-pool-heap-rec) ;; 23 + (find-gap-by-size (dead-pool-heap int) dead-pool-heap-rec) ;; 24 + (memory-free (dead-pool-heap) int) ;; 25 + (compact-time (dead-pool-heap) uint) ;; 26 ) :method-count-assert 27 :size-assert #x68 @@ -1850,7 +1851,7 @@ ;;(rreg uint128 8 :offset-assert 48) ) (:methods - (new (symbol type symbol function (pointer uint64)) object 0) + (new (symbol type symbol function (pointer uint64)) object) ;; 0 ) :method-count-assert 9 :size-assert #xb0 @@ -1889,7 +1890,7 @@ (function object) function (function object) - (function process int symbol event-message-block object)) _type_ 0) + (function process int symbol event-message-block object)) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x24 @@ -1947,7 +1948,7 @@ (stack uint8 :dynamic :offset-assert 112) ) (:methods - (new (symbol type basic int) _type_ 0) + (new (symbol type basic int) _type_) ;; 0 ) (:states dead-state @@ -2283,11 +2284,11 @@ :size-assert #xd :flag-assert #xd0000000d (:methods - (new (symbol type int) _type_ 0) - (get-bit (_type_ int) symbol 9) - (clear-bit (_type_ int) int 10) - (set-bit (_type_ int) int 11) - (clear-all! (_type_) _type_ 12) + (new (symbol type int) _type_) ;; 0 + (get-bit (_type_ int) symbol) ;; 9 + (clear-bit (_type_ int) int) ;; 10 + (set-bit (_type_ int) int) ;; 11 + (clear-all! (_type_) _type_) ;; 12 ) ) @@ -2546,8 +2547,8 @@ :size-assert #x28 :flag-assert #xb00000028 (:methods - (debug-draw (_type_ vector4w) none 9) - (ray-capsule-intersect (_type_ vector vector) float 10) + (debug-draw (_type_ vector4w) none) ;; 9 + (ray-capsule-intersect (_type_ vector vector) float) ;; 10 ) ) @@ -2561,8 +2562,8 @@ :size-assert #x28 :flag-assert #xb00000028 (:methods - (debug-draw (_type_ vector4w) none 9) - (ray-flat-cyl-intersect (_type_ vector vector) float 10) + (debug-draw (_type_ vector4w) none) ;; 9 + (ray-flat-cyl-intersect (_type_ vector vector) float) ;; 10 ) ) @@ -2649,13 +2650,13 @@ :size-assert #x20 :flag-assert #x1000000020 (:methods - (add-spheres! (_type_ (inline-array sphere) int) int 9) - (add-point! (_type_ vector3s) int 10) - (set-from-point-offset! (_type_ vector3s vector3s) int 11) - (set-from-point-offset-pad! (_type_ vector3s vector3s float) int 12) - (set-from-sphere! (_type_ sphere) int 13) - (set-from-spheres! (_type_ (inline-array sphere) int) int 14) - (add-box! (_type_ bounding-box) int 15) + (add-spheres! (_type_ (inline-array sphere) int) int) ;; 9 + (add-point! (_type_ vector3s) int) ;; 10 + (set-from-point-offset! (_type_ vector3s vector3s) int) ;; 11 + (set-from-point-offset-pad! (_type_ vector3s vector3s float) int) ;; 12 + (set-from-sphere! (_type_ sphere) int) ;; 13 + (set-from-spheres! (_type_ (inline-array sphere) int) int) ;; 14 + (add-box! (_type_ bounding-box) int) ;; 15 ) ) @@ -2695,7 +2696,7 @@ :size-assert #x40 :flag-assert #xa00000040 (:methods - (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none 9) + (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none) ;; 9 ) ) @@ -2796,7 +2797,7 @@ (scale vector :inline :offset-assert 48) ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x40 @@ -2835,8 +2836,8 @@ :size-assert #x30 :flag-assert #xb00000030 (:methods - (debug-draw! (_type_) none 9) - (point-past-plane? (_type_ vector) symbol 10) + (debug-draw! (_type_) none) ;; 9 + (point-past-plane? (_type_ vector) symbol) ;; 10 ) ) @@ -2879,25 +2880,25 @@ :size-assert #x8c :flag-assert #x1c0000008c (:methods - (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion 9) - (set-heading-vec! (_type_ vector) quaternion 10) - (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion 11) - (point-toward-point! (_type_ vector) quaternion 12) - (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion 13) - (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion 14) - (set-roll-to-grav! (_type_ float) quaternion 15) - (set-roll-to-grav-2! (_type_ float) quaternion 16) - (rotate-toward-orientation! (_type_ quaternion float float) quaternion 17) - (set-quaternion! (_type_ quaternion) quaternion 18) - (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion 19) - (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion 20) - (rot->dir-targ! (_type_) quaternion 21) - (y-angle (_type_) float 22) - (global-y-angle-to-point (_type_ vector) float 23) - (relative-y-angle-to-point (_type_ vector) float 24) - (roll-relative-to-gravity (_type_) float 25) - (set-and-limit-velocity (_type_ int vector float) trsqv 26) - (get-quaternion (_type_) quaternion 27) + (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion) ;; 9 + (set-heading-vec! (_type_ vector) quaternion) ;; 10 + (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion) ;; 11 + (point-toward-point! (_type_ vector) quaternion) ;; 12 + (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion) ;; 13 + (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion) ;; 14 + (set-roll-to-grav! (_type_ float) quaternion) ;; 15 + (set-roll-to-grav-2! (_type_ float) quaternion) ;; 16 + (rotate-toward-orientation! (_type_ quaternion float float) quaternion) ;; 17 + (set-quaternion! (_type_ quaternion) quaternion) ;; 18 + (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion) ;; 19 + (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion) ;; 20 + (rot->dir-targ! (_type_) quaternion) ;; 21 + (y-angle (_type_) float) ;; 22 + (global-y-angle-to-point (_type_ vector) float) ;; 23 + (relative-y-angle-to-point (_type_ vector) float) ;; 24 + (roll-relative-to-gravity (_type_) float) ;; 25 + (set-and-limit-velocity (_type_ int vector float) trsqv) ;; 26 + (get-quaternion (_type_) quaternion) ;; 27 ) ) @@ -3219,7 +3220,7 @@ (deftype sound-id (uint32) () (:methods - (unused-9 () none 9) + (unused-9 () none) ;; 9 ) :flag-assert #xa00000004 ) @@ -3584,12 +3585,12 @@ :size-assert #x6c :flag-assert #xe0000006c (:methods - (new (symbol type basic vector) _type_ 0) - (update! (_type_) int 9) - (change-sound! (_type_ sound-name) int 10) - (update-trans! (_type_ vector) int 11) - (update-vol! (_type_ int) int 12) - (stop! (_type_) int 13) + (new (symbol type basic vector) _type_) ;; 0 + (update! (_type_) int) ;; 9 + (change-sound! (_type_ sound-name) int) ;; 10 + (update-trans! (_type_ vector) int) ;; 11 + (update-vol! (_type_ int) int) ;; 12 + (stop! (_type_) int) ;; 13 ) ) @@ -3679,11 +3680,11 @@ :flag-assert #xe00004010 (:methods (new (symbol type) _type_) - (get-last-frame-time-stamp (_type_) uint 9) - (reset (_type_) _type_ 10) - (add-frame (_type_ symbol rgba) profile-frame 11) - (add-end-frame (_type_ symbol rgba) profile-frame 12) - (draw (_type_ dma-buffer int) float 13) + (get-last-frame-time-stamp (_type_) uint) ;; 9 + (reset (_type_) _type_) ;; 10 + (add-frame (_type_ symbol rgba) profile-frame) ;; 11 + (add-end-frame (_type_ symbol rgba) profile-frame) ;; 12 + (draw (_type_ dma-buffer int) float) ;; 13 ) ) @@ -4194,7 +4195,7 @@ (data-buffer uint8 :dynamic :offset 16) ) (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x18 @@ -4301,7 +4302,7 @@ (change-time time-frame :offset-assert 128) ) (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x88 @@ -4313,7 +4314,8 @@ (cpads cpad-info 4 :offset-assert 8) ;; guess, modified from 2->4 for PC 4-pad support ) (:methods - (new (symbol type) _type_ 0)) + (new (symbol type) _type_) ;; 0 + ) :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 @@ -4936,7 +4938,7 @@ (args uint64 1 :offset-assert 32) ) (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x28 @@ -4952,7 +4954,7 @@ (color rgba 4 :offset-assert 24) ) (:methods - (new (symbol type int int int int rgba) _type_ 0) + (new (symbol type int int int int rgba) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x28 @@ -5032,7 +5034,7 @@ (run-time int64 :offset 56) ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x40 @@ -5092,8 +5094,8 @@ :size-assert #x39c :flag-assert #xa0000039c (:methods - (new (symbol type int int int int int) _type_ 0) - (set-time-ratios (_type_ float) float 9) + (new (symbol type int int int int int) _type_) ;; 0 + (set-time-ratios (_type_ float) float) ;; 9 ) ) @@ -5242,10 +5244,10 @@ ) :flag-assert #xb00000010 (:methods - (new (symbol type int level) _type_ 0) + (new (symbol type int level) _type_) ;; 0 ;; these methods dont exist for this type - (load-to-heap-by-name (_type_ string symbol kheap int) art-group 9) - (set-loaded-art (_type_ art-group) art-group 10) + (load-to-heap-by-name (_type_ string symbol kheap int) art-group) ;; 9 + (set-loaded-art (_type_ art-group) art-group) ;; 10 ) ) @@ -5255,7 +5257,7 @@ ) :flag-assert #xb00000010 (:methods - (new (symbol type int level) _type_ 0) + (new (symbol type int level) _type_) ;; 0 ) ) @@ -5282,14 +5284,14 @@ :size-assert #x68 :flag-assert #x1000000068 (:methods - (new (symbol type int) _type_ 0) - (set-pending-file (_type_ string int handle float) int 9) - (update (_type_) int 10) - (inactive? (_type_) symbol 11) - (file-status (_type_ string int) symbol 12) - (link-file (_type_ art-group) art-group 13) - (unlink-file (_type_ art-group) int 14) - (unlock! (_type_) symbol 15) + (new (symbol type int) _type_) ;; 0 + (set-pending-file (_type_ string int handle float) int) ;; 9 + (update (_type_) int) ;; 10 + (inactive? (_type_) symbol) ;; 11 + (file-status (_type_ string int) symbol) ;; 12 + (link-file (_type_ art-group) art-group) ;; 13 + (unlink-file (_type_ art-group) int) ;; 14 + (unlock! (_type_) symbol) ;; 15 ) ) @@ -5324,15 +5326,15 @@ :size-assert #x118 :flag-assert #x1100000118 (:methods - (new (symbol type) _type_ 0) - (update (_type_ symbol) int 9) - (clear-rec (_type_) int 10) - (spool-push (_type_ string int process float) int 11) - (file-status (_type_ string int) symbol 12) - (reserve-alloc (_type_) kheap 13) - (reserve-free (_type_ kheap) int 14) - (none-reserved? (_type_) symbol 15) - (try-preload-stream (_type_ string int process float) int 16) + (new (symbol type) _type_) ;; 0 + (update (_type_ symbol) int) ;; 9 + (clear-rec (_type_) int) ;; 10 + (spool-push (_type_ string int process float) int) ;; 11 + (file-status (_type_ string int) symbol) ;; 12 + (reserve-alloc (_type_) kheap) ;; 13 + (reserve-free (_type_ kheap) int) ;; 14 + (none-reserved? (_type_) symbol) ;; 15 + (try-preload-stream (_type_ string int process float) int) ;; 16 ) ) @@ -5371,10 +5373,9 @@ (allocate-func (function texture-pool texture-page kheap int texture-page) :offset-assert 12) (font-palette int32 :offset-assert 16) ;; vram word idx - ;; these were reordered - (segment-near texture-pool-segment :inline :offset-assert 20) - (segment-common texture-pool-segment :inline :offset-assert 28) - (segment texture-pool-segment 4 :inline :offset 20) + (segment texture-pool-segment 4 :inline :offset-assert 20) + (segment-near texture-pool-segment :inline :offset 20) + (segment-common texture-pool-segment :inline :offset 28) (common-page texture-page 32 :offset-assert 52) (common-page-mask int32 :offset-assert 180) @@ -5384,21 +5385,21 @@ :size-assert #x2b0 :flag-assert #x17000002b0 (:methods - (new (symbol type) _type_ 0) - (initialize! (_type_) _type_ 9) - (print-usage (_type_) _type_ 10) - (setup-font-texture! (_type_) none 11) - (allocate-defaults! (_type_) none 12) - (login-level-textures (_type_ level int (pointer texture-id)) none 13) ;; loading level... - (add-tex-to-dma! (_type_ level int) none 14) ;; very mysterious arg types. - (allocate-vram-words! (_type_ int) int 15) - (allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment 16) - (unused-17 () none 17) - (unused-18 () none 18) - (unused-19 () none 19) - (unload! (_type_ texture-page) int 20) - (upload-one-common! (_type_ level) symbol 21) - (lookup-boot-common-id (_type_ int) int 22) + (new (symbol type) _type_) ;; 0 + (initialize! (_type_) _type_) ;; 9 + (print-usage (_type_) _type_) ;; 10 + (setup-font-texture! (_type_) none) ;; 11 + (allocate-defaults! (_type_) none) ;; 12 + (login-level-textures (_type_ level int (pointer texture-id)) none) ;; 13 ;; loading level... + (add-tex-to-dma! (_type_ level int) none) ;; 14 ;; very mysterious arg types. + (allocate-vram-words! (_type_ int) int) ;; 15 + (allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment) ;; 16 + (unused-17 () none) ;; 17 + (unused-18 () none) ;; 18 + (unused-19 () none) ;; 19 + (unload! (_type_ texture-page) int) ;; 20 + (upload-one-common! (_type_ level) symbol) ;; 21 + (lookup-boot-common-id (_type_ int) int) ;; 22 ) ) @@ -5451,13 +5452,13 @@ :size-assert #x80 :flag-assert #xf00000080 (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (remove-from-heap (_type_ kheap) _type_ 9) - (get-leftover-block-count (_type_ int int) int 10) - (unused-11 () none 11) - (relocate-dests! (_type_ int int) none 12) - (add-to-dma-buffer (_type_ dma-buffer int) int 13) - (upload-now! (_type_ int) none 14) + (relocate (_type_ kheap (pointer uint8)) none :replace) ;; 7 + (remove-from-heap (_type_ kheap) _type_) ;; 9 + (get-leftover-block-count (_type_ int int) int) ;; 10 + (unused-11 () none) ;; 11 + (relocate-dests! (_type_ int int) none) ;; 12 + (add-to-dma-buffer (_type_ dma-buffer int) int) ;; 13 + (upload-now! (_type_ int) none) ;; 14 ) ) @@ -5493,8 +5494,8 @@ (entries texture-page-dir-entry 1 :inline) ) (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (unlink-textures-in-heap! (_type_ kheap) int 9) + (relocate (_type_ kheap (pointer uint8)) none :replace) ;; 7 + (unlink-textures-in-heap! (_type_ kheap) int) ;; 9 ) :flag-assert #xa00000014 ) @@ -5700,26 +5701,26 @@ :size-assert #xa30 :flag-assert #x1d00000a30 (:methods - (deactivate (_type_) _type_ 9) - (is-object-visible? (_type_ int) symbol 10) - (add-irq-to-tex-buckets! (_type_) none 11) - (unload! (_type_) _type_ 12) - (bsp-name (_type_) symbol 13) - (compute-memory-usage (_type_ object) memory-usage-block 14) - (point-in-boxes? (_type_ vector) symbol 15) - (update-vis! (_type_ level-vis-info uint uint) symbol 16) - (load-continue (_type_) _type_ 17) - (load-begin (_type_) _type_ 18) - (login-begin (_type_) _type_ 19) - (vis-load (_type_) uint 20) - (unused-21 (_type_) none 21) - (birth (_type_) _type_ 22) - (level-status-set! (_type_ symbol) _type_ 23) - (load-required-packages (_type_) _type_ 24) - (init-vis (_type_) int 25) - (vis-clear (_type_) int 26) - (debug-print-splitbox (_type_ vector string) none 27) - (art-group-get-by-name (_type_ string) art-group 28) + (deactivate (_type_) _type_) ;; 9 + (is-object-visible? (_type_ int) symbol) ;; 10 + (add-irq-to-tex-buckets! (_type_) none) ;; 11 + (unload! (_type_) _type_) ;; 12 + (bsp-name (_type_) symbol) ;; 13 + (compute-memory-usage (_type_ object) memory-usage-block) ;; 14 + (point-in-boxes? (_type_ vector) symbol) ;; 15 + (update-vis! (_type_ level-vis-info uint uint) symbol) ;; 16 + (load-continue (_type_) _type_) ;; 17 + (load-begin (_type_) _type_) ;; 18 + (login-begin (_type_) _type_) ;; 19 + (vis-load (_type_) uint) ;; 20 + (unused-21 (_type_) none) ;; 21 + (birth (_type_) _type_) ;; 22 + (level-status-set! (_type_ symbol) _type_) ;; 23 + (load-required-packages (_type_) _type_) ;; 24 + (init-vis (_type_) int) ;; 25 + (vis-clear (_type_) int) ;; 26 + (debug-print-splitbox (_type_ vector string) none) ;; 27 + (art-group-get-by-name (_type_ string) art-group) ;; 28 ) ) @@ -5750,24 +5751,24 @@ :size-assert #x1ef4 :flag-assert #x1b00001ef4 (:methods - (level-get (_type_ symbol) level 9) - (level-get-with-status (_type_ symbol) level 10) - (level-get-for-use (_type_ symbol symbol) level 11) - (activate-levels! (_type_) int 12) - (debug-print-entities (_type_ symbol type) none 13) - (debug-draw-actors (_type_ symbol) none 14) - (actors-update (_type_) object 15) - (level-update (_type_) int 16) - (level-get-target-inside (_type_) level 17) - (alloc-levels! (_type_ symbol) int 18) - (load-commands-set! (_type_ pair) pair 19) - (art-group-get-by-name (_type_ string) art-group 20) - (load-command-get-index (_type_ symbol int) pair 21) - (update-vis-volumes (_type_) none 22) - (update-vis-volumes-from-nav-mesh (_type_) none 23) - (print-volume-sizes (_type_) none 24) - (level-status (_type_ symbol) symbol 25) - (level-get-most-disposable (_type_) level 26) + (level-get (_type_ symbol) level) ;; 9 + (level-get-with-status (_type_ symbol) level) ;; 10 + (level-get-for-use (_type_ symbol symbol) level) ;; 11 + (activate-levels! (_type_) int) ;; 12 + (debug-print-entities (_type_ symbol type) none) ;; 13 + (debug-draw-actors (_type_ symbol) none) ;; 14 + (actors-update (_type_) object) ;; 15 + (level-update (_type_) int) ;; 16 + (level-get-target-inside (_type_) level) ;; 17 + (alloc-levels! (_type_ symbol) int) ;; 18 + (load-commands-set! (_type_ pair) pair) ;; 19 + (art-group-get-by-name (_type_ string) art-group) ;; 20 + (load-command-get-index (_type_ symbol int) pair) ;; 21 + (update-vis-volumes (_type_) none) ;; 22 + (update-vis-volumes-from-nav-mesh (_type_) none) ;; 23 + (print-volume-sizes (_type_) none) ;; 24 + (level-status (_type_ symbol) symbol) ;; 25 + (level-get-most-disposable (_type_) level) ;; 26 ) ) @@ -5870,7 +5871,7 @@ (fov-correction-factor float :offset-assert 1056) ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x424 @@ -6011,18 +6012,18 @@ :size-assert #x58 :flag-assert #x1400000058 (:methods - (new (symbol type matrix int int float font-color font-flags) _type_ 0) - (set-mat! (font-context matrix) font-context 9) - (set-origin! (font-context int int) font-context 10) - (set-depth! (font-context int) font-context 11) - (set-w! (font-context float) font-context 12) - (set-width! (font-context int) font-context 13) - (set-height! (font-context int) font-context 14) - (set-projection! (font-context float) font-context 15) - (set-color! (font-context font-color) font-context 16) - (set-flags! (font-context font-flags) font-context 17) - (set-start-line! (font-context uint) font-context 18) - (set-scale! (font-context float) font-context 19) + (new (symbol type matrix int int float font-color font-flags) _type_) ;; 0 + (set-mat! (font-context matrix) font-context) ;; 9 + (set-origin! (font-context int int) font-context) ;; 10 + (set-depth! (font-context int) font-context) ;; 11 + (set-w! (font-context float) font-context) ;; 12 + (set-width! (font-context int) font-context) ;; 13 + (set-height! (font-context int) font-context) ;; 14 + (set-projection! (font-context float) font-context) ;; 15 + (set-color! (font-context font-color) font-context) ;; 16 + (set-flags! (font-context font-flags) font-context) ;; 17 + (set-start-line! (font-context uint) font-context) ;; 18 + (set-scale! (font-context float) font-context) ;; 19 ) ) @@ -6178,12 +6179,12 @@ :flag-assert #xe00000020 ;; field param1 is a basic loaded with a signed load field param2 is a basic loaded with a signed load field param3 is a basic loaded with a signed load (:methods - (print (connection) _type_ 2) - (get-engine (connection) engine 9) - (get-process (connection) process 10) - (belongs-to-engine? (connection engine) symbol 11) - (belongs-to-process? (connection process) symbol 12) - (move-to-dead (connection) connection 13) + (print (connection) _type_) ;; 2 + (get-engine (connection) engine) ;; 9 + (get-process (connection) process) ;; 10 + (belongs-to-engine? (connection engine) symbol) ;; 11 + (belongs-to-process? (connection process) symbol) ;; 12 + (move-to-dead (connection) connection) ;; 13 ) ) @@ -6204,22 +6205,22 @@ :size-assert #x80 :flag-assert #x1800000080 (:methods - (new (symbol type basic int) _type_ 0) - (inspect-all-connections (engine) engine 9) - (apply-to-connections (engine (function connectable none)) int 10) - (apply-to-connections-reverse (engine (function connectable none)) int 11) - (execute-connections (engine object) int 12) - (execute-connections-and-move-to-dead (engine object) int 13) - (execute-connections-if-needed (engine object) int 14) - (add-connection (engine process object object object object) connection 15) - (remove-from-process (engine process) int 16) - (remove-matching (engine (function connection engine symbol)) int 17) - (remove-all (engine) int 18) - (remove-by-param1 (engine object) int 19) - (remove-by-param2 (engine int) int 20) - (get-first-connectable (engine) connectable 21) - (get-last-connectable (engine) connectable 22) - (unknown-1 (engine (pointer uint32)) uint 23) + (new (symbol type basic int) _type_) ;; 0 + (inspect-all-connections (engine) engine) ;; 9 + (apply-to-connections (engine (function connectable none)) int) ;; 10 + (apply-to-connections-reverse (engine (function connectable none)) int) ;; 11 + (execute-connections (engine object) int) ;; 12 + (execute-connections-and-move-to-dead (engine object) int) ;; 13 + (execute-connections-if-needed (engine object) int) ;; 14 + (add-connection (engine process object object object object) connection) ;; 15 + (remove-from-process (engine process) int) ;; 16 + (remove-matching (engine (function connection engine symbol)) int) ;; 17 + (remove-all (engine) int) ;; 18 + (remove-by-param1 (engine object) int) ;; 19 + (remove-by-param2 (engine int) int) ;; 20 + (get-first-connectable (engine) connectable) ;; 21 + (get-last-connectable (engine) connectable) ;; 22 + (unknown-1 (engine (pointer uint32)) uint) ;; 23 ) ) @@ -6256,7 +6257,7 @@ :size-assert #x10 :flag-assert #xa00000010 (:methods - (lookup-text! (_type_ text-id symbol) string 9) + (lookup-text! (_type_ text-id symbol) string) ;; 9 ) ) @@ -6331,7 +6332,7 @@ :size-assert #xc4 :flag-assert #xa000000c4 (:methods - (update-from-engine (_type_ engine) setting-data 9) + (update-from-engine (_type_ engine) setting-data) ;; 9 ) ) @@ -6345,12 +6346,12 @@ :size-assert #x278 :flag-assert #xe00000278 (:methods - (new (symbol type int) _type_ 0) - (add-setting (_type_ process symbol object object object) none 9) - (set-setting (_type_ process symbol object object object) none 10) - (remove-setting (_type_ process symbol) none 11) - (apply-settings (_type_) setting-data 12) - (update (_type_) setting-data 13) + (new (symbol type int) _type_) ;; 0 + (add-setting (_type_ process symbol object object object) none) ;; 9 + (set-setting (_type_ process symbol object object object) none) ;; 10 + (remove-setting (_type_ process symbol) none) ;; 11 + (apply-settings (_type_) setting-data) ;; 12 + (update (_type_) setting-data) ;; 13 ) ) @@ -6434,9 +6435,9 @@ :size-assert #x6e0 :flag-assert #xc000006e0 (:methods - (reset! (_type_) _type_ 9) - (calculate-total (_type_) int 10) - (print-mem-usage (_type_ level object) none 11) + (reset! (_type_) _type_) ;; 9 + (calculate-total (_type_) int) ;; 10 + (print-mem-usage (_type_ level object) none) ;; 11 ) ) @@ -6541,7 +6542,7 @@ :size-assert #xc :flag-assert #xa0000000c (:methods - (draw (_type_) none 9) + (draw (_type_) none) ;; 9 ) ) @@ -6711,8 +6712,8 @@ :flag-assert #xa00000020 ;; field param1 is a basic loaded with a signed load field param2 is a basic loaded with a signed load (:methods - (new (symbol type basic) _type_ 0) - (reset-and-assign-geo! (_type_ basic) _type_ 9) + (new (symbol type basic) _type_) ;; 0 + (reset-and-assign-geo! (_type_ basic) _type_) ;; 9 ) ) @@ -6745,15 +6746,15 @@ :size-assert #x20 :flag-assert #x1200000020 (:methods - (login (_type_) _type_ 9) ;; probably login or init. - (draw (_type_ _type_ display-frame) none 10) - (collide-with-box (_type_ int collide-list) none 11) - (collide-y-probe (_type_ int collide-list) none 12) - (collide-ray (_type_ int collide-list) none 13) - (collect-stats (_type_) none 14) - (debug-draw (_type_ drawable display-frame) none 15) - (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 16) - (collect-ambients (_type_ sphere int ambient-list) none 17) + (login (_type_) _type_) ;; 9 ;; probably login or init. + (draw (_type_ _type_ display-frame) none) ;; 10 + (collide-with-box (_type_ int collide-list) none) ;; 11 + (collide-y-probe (_type_ int collide-list) none) ;; 12 + (collide-ray (_type_ int collide-list) none) ;; 13 + (collect-stats (_type_) none) ;; 14 + (debug-draw (_type_ drawable display-frame) none) ;; 15 + (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8)) ;; 16 + (collect-ambients (_type_ sphere int ambient-list) none) ;; 17 ) ) @@ -6834,9 +6835,6 @@ :size-assert #x44 :flag-assert #x1200000044 ;; too many basic blocks - (:methods - - ) ) (deftype draw-node-dma (structure) @@ -6913,7 +6911,7 @@ :size-assert #x20 :flag-assert #x1300000020 (:methods - (execute-ambient (_type_ vector) none 18) + (execute-ambient (_type_ vector) none) ;; 18 ) ) @@ -6945,8 +6943,8 @@ :flag-assert #x10004000a8 ;; inherited inspect of process (:methods - (print-text (_type_) none 14) - (appeared-for-long-enough? (_type_) symbol 15) + (print-text (_type_) none) ;; 14 + (appeared-for-long-enough? (_type_) symbol) ;; 15 ) (:states (level-hint-sidekick string) @@ -7947,7 +7945,7 @@ (default-vu-lights vu-lights :inline :offset-assert 1136) ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x4e0 @@ -8089,7 +8087,7 @@ (some-byte uint8 :offset 1939) ;; cant cast on update-mood-lavatube ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x794 @@ -8122,8 +8120,8 @@ :size-assert #x110 :flag-assert #xb00000110 (:methods - (reset! (_type_) symbol 9) - (set-fade! (_type_ int float float vector) object 10) ; returns float or error string + (reset! (_type_) symbol) ;; 9 + (set-fade! (_type_ int float float vector) object) ;; 10 ; returns float or error string ) ) @@ -8271,7 +8269,7 @@ :size-assert #x80 :flag-assert #x900000080 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ;; 0 ) ) @@ -8332,10 +8330,10 @@ :size-assert #x14 :flag-assert #xd00000014 (:methods - (login (_type_) _type_ 9) - (lookup-art (_type_ string type) joint 10) ;; can also be art-joint-anim - (lookup-idx-of-art (_type_ string type) int 11) - (needs-link? (_type_) symbol 12) + (login (_type_) _type_) ;; 9 + (lookup-art (_type_ string type) joint) ;; 10 ;; can also be art-joint-anim + (lookup-idx-of-art (_type_ string type) int) ;; 11 + (needs-link? (_type_) symbol) ;; 12 ) ) @@ -8379,9 +8377,9 @@ :size-assert #x20 :flag-assert #xf00000020 (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (link-art! (_type_) art-group 13) - (unlink-art! (_type_) int 14) + (relocate (_type_ kheap (pointer uint8)) none :replace) ;; 7 + (link-art! (_type_) art-group) ;; 13 + (unlink-art! (_type_) int) ;; 14 ) ) @@ -8442,7 +8440,7 @@ :size-assert #x21 :flag-assert #xa00000021 (:methods - (setup-lods! (_type_ skeleton-group art-group entity) _type_ 9) + (setup-lods! (_type_ skeleton-group art-group entity) _type_) ;; 9 ) ) @@ -8521,10 +8519,10 @@ :size-assert #xbc :flag-assert #xc000000bc (:methods - (new (symbol type process art-joint-geo) _type_ 0) - (get-skeleton-origin (_type_) vector 9) - (lod-set! (_type_ int) none 10) - (lods-assign! (_type_ lod-set) none 11) + (new (symbol type process art-joint-geo) _type_) ;; 0 + (get-skeleton-origin (_type_) vector) ;; 9 + (lod-set! (_type_ int) none) ;; 10 + (lods-assign! (_type_ lod-set) none) ;; 11 ) ) @@ -8635,7 +8633,7 @@ :size-assert #x18 :flag-assert #xa00000018 (:methods - (login-adgifs (_type_) none 9) + (login-adgifs (_type_) none) ;; 9 ) ) @@ -8782,7 +8780,7 @@ :size-assert #x20 :flag-assert #xa00000020 (:methods - (login-adgifs (_type_) none 9) + (login-adgifs (_type_) none) ;; 9 ) ) @@ -8790,10 +8788,10 @@ ((eye-slot int8 :offset-assert 0) (shader-offset int8 :offset-assert 1) (shader-count int8 :offset-assert 2) - (iris-shader adgif-shader :inline :offset-assert 16) - (pupil-shader adgif-shader :inline :offset-assert 96) - (lid-shader adgif-shader :inline :offset-assert 176) - (shader adgif-shader 3 :inline :offset 16) ;; moved + (shader adgif-shader 3 :inline :score -100 :offset-assert 16) ;; moved + (iris-shader adgif-shader :inline :offset 16) + (pupil-shader adgif-shader :inline :offset 96) + (lid-shader adgif-shader :inline :offset 176) ) :method-count-assert 9 :size-assert #x100 @@ -8934,7 +8932,7 @@ (query ripple-merc-query :offset-assert 36) ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x28 @@ -9458,14 +9456,14 @@ :size-assert #x60 :flag-assert #x1000000060 (:methods - (new (symbol type float float float float float) _type_ 0) - (clear-offset-bit (shadow-control) int 9) - (set-offset-bit (shadow-control) int 10) - (set-top-plane-offset (shadow-control float) int 11) - (set-bottom-plane-offset (shadow-control float) int 12) - (unused-13 (_type_) none 13) - (update-direction-from-time-of-day (_type_) none 14) - (collide-to-find-planes (_type_ vector float float float) none 15) + (new (symbol type float float float float float) _type_) ;; 0 + (clear-offset-bit (shadow-control) int) ;; 9 + (set-offset-bit (shadow-control) int) ;; 10 + (set-top-plane-offset (shadow-control float) int) ;; 11 + (set-bottom-plane-offset (shadow-control float) int) ;; 12 + (unused-13 (_type_) none) ;; 13 + (update-direction-from-time-of-day (_type_) none) ;; 14 + (collide-to-find-planes (_type_ vector float float float) none) ;; 15 ) ) @@ -9721,19 +9719,19 @@ :size-assert #x82c :flag-assert #x150000082c (:methods - (new (symbol type) _type_ 0) - (reset! (_type_) _type_ 9) - (update! (_type_) int 10) - (want-levels (_type_ symbol symbol) int 11) - (want-display-level (_type_ symbol symbol) int 12) - (want-vis (_type_ symbol) int 13) - (want-force-vis (_type_ symbol symbol) int 14) - (execute-command (_type_ pair) none 15) - (execute-commands-up-to (_type_ float) int 16) - (backup-load-state-and-set-cmds (_type_ pair) int 17) - (restore-load-state-and-cleanup (_type_) int 18) - (restore-load-state (_type_) int 19) - (set-force-inside! (_type_ symbol symbol) none 20) + (new (symbol type) _type_) ;; 0 + (reset! (_type_) _type_) ;; 9 + (update! (_type_) int) ;; 10 + (want-levels (_type_ symbol symbol) int) ;; 11 + (want-display-level (_type_ symbol symbol) int) ;; 12 + (want-vis (_type_ symbol) int) ;; 13 + (want-force-vis (_type_ symbol symbol) int) ;; 14 + (execute-command (_type_ pair) none) ;; 15 + (execute-commands-up-to (_type_ float) int) ;; 16 + (backup-load-state-and-set-cmds (_type_ pair) int) ;; 17 + (restore-load-state-and-cleanup (_type_) int) ;; 18 + (restore-load-state (_type_) int) ;; 19 + (set-force-inside! (_type_ symbol symbol) none) ;; 20 ) ) @@ -9773,7 +9771,7 @@ :size-assert #x7c :flag-assert #xa0000007c (:methods - (debug-draw! (_type_) none 9) + (debug-draw! (_type_) none) ;; 9 ) ) @@ -9854,26 +9852,26 @@ :flag-assert #x1d00000144 ;; field dummy is a basic loaded with a signed load (:methods - (initialize! (_type_ symbol game-save string) _type_ 9) - (adjust (_type_ symbol float handle) float 10) - (task-complete? (_type_ game-task) symbol 11) - (lookup-entity-perm-by-aid (_type_ actor-id) entity-perm 12) - (get-entity-task-perm (_type_ game-task) entity-perm 13) - (copy-perms-from-level! (_type_ level) none 14) - (copy-perms-to-level! (_type_ level) none 15) - (debug-print (_type_ symbol) _type_ 16) - (get-or-create-continue! (_type_) continue-point 17) - (get-continue-by-name (_type_ string) continue-point 18) - (set-continue! (_type_ basic) continue-point 19) - (buzzer-count (_type_ game-task) int 20) - (seen-text? (_type_ text-id) symbol 21) - (mark-text-as-seen (_type_ text-id) none 22) - (got-buzzer? (_type_ game-task int) symbol 23) - (save-game! (_type_ game-save string) none 24) - (load-game! (_type_ game-save) game-save 25) - (clear-text-seen! (_type_ text-id) none 26) - (get-death-count (_type_ symbol) int 27) - (get-health-percent-lost (_type_ symbol) float 28) + (initialize! (_type_ symbol game-save string) _type_) ;; 9 + (adjust (_type_ symbol float handle) float) ;; 10 + (task-complete? (_type_ game-task) symbol) ;; 11 + (lookup-entity-perm-by-aid (_type_ actor-id) entity-perm) ;; 12 + (get-entity-task-perm (_type_ game-task) entity-perm) ;; 13 + (copy-perms-from-level! (_type_ level) none) ;; 14 + (copy-perms-to-level! (_type_ level) none) ;; 15 + (debug-print (_type_ symbol) _type_) ;; 16 + (get-or-create-continue! (_type_) continue-point) ;; 17 + (get-continue-by-name (_type_ string) continue-point) ;; 18 + (set-continue! (_type_ basic) continue-point) ;; 19 + (buzzer-count (_type_ game-task) int) ;; 20 + (seen-text? (_type_ text-id) symbol) ;; 21 + (mark-text-as-seen (_type_ text-id) none) ;; 22 + (got-buzzer? (_type_ game-task int) symbol) ;; 23 + (save-game! (_type_ game-save string) none) ;; 24 + (load-game! (_type_ game-save) game-save) ;; 25 + (clear-text-seen! (_type_ text-id) none) ;; 26 + (get-death-count (_type_ symbol) int) ;; 27 + (get-health-percent-lost (_type_ symbol) float) ;; 28 ) ) @@ -10026,7 +10024,7 @@ :size-assert #x10 :flag-assert #xa00000010 (:methods - (login (_type_) none 9) + (login (_type_) none) ;; 9 ) ) @@ -10079,7 +10077,7 @@ :size-assert #x30 :flag-assert #xa00000030 (:methods - (debug-print-frames (_type_) _type_ 9) + (debug-print-frames (_type_) _type_) ;; 9 ) ) @@ -10124,9 +10122,9 @@ :size-assert #xc0 :flag-assert #xb000000c0 (:methods - (new (symbol type int) _type_ 0) - (current-cycle-distance (_type_) float 9) - (debug-print-channels (_type_ symbol) int 10) + (new (symbol type int) _type_) ;; 0 + (current-cycle-distance (_type_) float) ;; 9 + (debug-print-channels (_type_ symbol) int) ;; 10 ) ) @@ -10346,20 +10344,20 @@ :flag-assert #x1600000020 ;; field extra is a basic loaded with a signed load (:methods - (new (symbol type int int) _type_ 0) - (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual 9) - (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual 10) - (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual 11) - (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual 12) - (get-tag-index-data (_type_ int) pointer 13) - (get-tag-data (_type_ res-tag) pointer 14) - (allocate-data-memory-for-tag! (_type_ res-tag) res-tag 15) - (sort! (_type_) _type_ 16) - (add-data! (_type_ res-tag pointer) res-lump 17) - (add-32bit-data! (_type_ res-tag object) res-lump 18) - (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual 19) - (make-property-data (_type_ float res-tag-pair pointer) pointer 20) - (get-curve-data! (_type_ curve symbol symbol float) symbol 21) + (new (symbol type int int) _type_) ;; 0 + (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual) ;; 9 + (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual) ;; 10 + (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual) ;; 11 + (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual) ;; 12 + (get-tag-index-data (_type_ int) pointer) ;; 13 + (get-tag-data (_type_ res-tag) pointer) ;; 14 + (allocate-data-memory-for-tag! (_type_ res-tag) res-tag) ;; 15 + (sort! (_type_) _type_) ;; 16 + (add-data! (_type_ res-tag pointer) res-lump) ;; 17 + (add-32bit-data! (_type_ res-tag object) res-lump) ;; 18 + (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual) ;; 19 + (make-property-data (_type_ float res-tag-pair pointer) pointer) ;; 20 + (get-curve-data! (_type_ curve symbol symbol float) symbol) ;; 21 ) ) @@ -10686,10 +10684,10 @@ :size-assert #x28 :flag-assert #xc00000028 (:methods - (new (symbol type process-drawable pickup-type float) _type_ 0) - (drop-pickup (_type_ symbol process-tree fact-info int) (pointer process) 9) - (reset! (_type_ symbol) none 10) - (pickup-collectable! (_type_ pickup-type float handle) float 11) + (new (symbol type process-drawable pickup-type float) _type_) ;; 0 + (drop-pickup (_type_ symbol process-tree fact-info int) (pointer process)) ;; 9 + (reset! (_type_ symbol) none) ;; 10 + (pickup-collectable! (_type_ pickup-type float handle) float) ;; 11 ) ) @@ -10716,7 +10714,7 @@ :size-assert #x90 :flag-assert #xc00000090 (:methods - (new (symbol type process-drawable pickup-type float) _type_ 0) + (new (symbol type process-drawable pickup-type float) _type_) ;; 0 ) ) @@ -10733,7 +10731,7 @@ :size-assert #x44 :flag-assert #xc00000044 (:methods - (new (symbol type process-drawable pickup-type float) _type_ 0) + (new (symbol type process-drawable pickup-type float) _type_) ;; 0 ) ) @@ -10793,12 +10791,12 @@ :size-assert #x134 :flag-assert #xe00000134 (:methods - (new (symbol type process) _type_ :behavior process-drawable 0) - (compute-alignment! (_type_) transformq 9) - (align! (_type_ align-opts float float float) trsqv 10) - (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv 11) ;; 3rd arg is unused - (first-transform (_type_) transform 12) - (snd-transform (_type_) transform 13) + (new (symbol type process-drawable) _type_) ;; 0 + (compute-alignment! (_type_) transformq) ;; 9 + (align! (_type_ align-opts float float float) trsqv) ;; 10 + (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv) ;; 11 ;; 3rd arg is unused + (first-transform (_type_) transform) ;; 12 + (snd-transform (_type_) transform) ;; 13 ) ) @@ -10843,7 +10841,7 @@ (declare-type actor-link-info basic) (declare-type sparticle-launch-control basic) (declare-type water-control basic) -(declare-type collide-shape basic) +(declare-type collide-shape trsqv) (declare-type nav-control basic) (deftype process-drawable (process) ((root trsqv :offset-assert 112) @@ -10868,12 +10866,12 @@ :flag-assert #x14004000b0 ;; inherited inspect of process (:methods - (initialize-skeleton (_type_ skeleton-group pair) none 14) - (initialize-skeleton-by-name (_type_ string object) _type_ 15) - (apply-alignment (_type_ align-opts transformq vector) collide-shape 16) - (do-joint-math! (_type_) none 17) - (cleanup-for-death (_type_) none 18) - (evaluate-joint-control (_type_) none 19) + (initialize-skeleton (_type_ skeleton-group pair) none) ;; 14 + (initialize-skeleton-by-name (_type_ string object) _type_) ;; 15 + (apply-alignment (_type_ align-opts transformq vector) collide-shape) ;; 16 + (do-joint-math! (_type_) none) ;; 17 + (cleanup-for-death (_type_) none) ;; 18 + (evaluate-joint-control (_type_) none) ;; 19 ) (:states (process-drawable-art-error string) @@ -10888,49 +10886,49 @@ :flag-assert #x3f004000b0 ;; not enough basic ops (:methods - (process-drawable-reserved-method-20 () none 20) - (process-drawable-reserved-method-21 () none 21) - (process-drawable-reserved-method-22 () none 22) - (process-drawable-reserved-method-23 () none 23) - (process-drawable-reserved-method-24 () none 24) - (process-drawable-reserved-method-25 () none 25) - (process-drawable-reserved-method-26 () none 26) - (process-drawable-reserved-method-27 () none 27) - (process-drawable-reserved-method-28 () none 28) - (process-drawable-reserved-method-29 () none 29) - (process-drawable-reserved-method-30 () none 30) - (process-drawable-reserved-method-31 () none 31) - (process-drawable-reserved-method-32 () none 32) - (process-drawable-reserved-method-33 () none 33) - (process-drawable-reserved-method-34 () none 34) - (process-drawable-reserved-method-35 () none 35) - (process-drawable-reserved-method-36 () none 36) - (process-drawable-reserved-method-37 () none 37) - (process-drawable-reserved-method-38 () none 38) - (process-drawable-reserved-method-39 () none 39) - (process-drawable-reserved-method-40 () none 40) - (process-drawable-reserved-method-41 () none 41) - (process-drawable-reserved-method-42 () none 42) - (process-drawable-reserved-method-43 () none 43) - (process-drawable-reserved-method-44 () none 44) - (process-drawable-reserved-method-45 () none 45) - (process-drawable-reserved-method-46 () none 46) - (process-drawable-reserved-method-47 () none 47) - (process-drawable-reserved-method-48 () none 48) - (process-drawable-reserved-method-49 () none 49) - (process-drawable-reserved-method-50 () none 50) - (process-drawable-reserved-method-51 () none 51) - (process-drawable-reserved-method-52 () none 52) - (process-drawable-reserved-method-53 () none 53) - (process-drawable-reserved-method-54 () none 54) - (process-drawable-reserved-method-55 () none 55) - (process-drawable-reserved-method-56 () none 56) - (process-drawable-reserved-method-57 () none 57) - (process-drawable-reserved-method-58 () none 58) - (process-drawable-reserved-method-59 () none 59) - (process-drawable-reserved-method-60 () none 60) - (process-drawable-reserved-method-61 () none 61) - (process-drawable-reserved-method-62 () none 62) + (process-drawable-reserved-method-20 () none) ;; 20 + (process-drawable-reserved-method-21 () none) ;; 21 + (process-drawable-reserved-method-22 () none) ;; 22 + (process-drawable-reserved-method-23 () none) ;; 23 + (process-drawable-reserved-method-24 () none) ;; 24 + (process-drawable-reserved-method-25 () none) ;; 25 + (process-drawable-reserved-method-26 () none) ;; 26 + (process-drawable-reserved-method-27 () none) ;; 27 + (process-drawable-reserved-method-28 () none) ;; 28 + (process-drawable-reserved-method-29 () none) ;; 29 + (process-drawable-reserved-method-30 () none) ;; 30 + (process-drawable-reserved-method-31 () none) ;; 31 + (process-drawable-reserved-method-32 () none) ;; 32 + (process-drawable-reserved-method-33 () none) ;; 33 + (process-drawable-reserved-method-34 () none) ;; 34 + (process-drawable-reserved-method-35 () none) ;; 35 + (process-drawable-reserved-method-36 () none) ;; 36 + (process-drawable-reserved-method-37 () none) ;; 37 + (process-drawable-reserved-method-38 () none) ;; 38 + (process-drawable-reserved-method-39 () none) ;; 39 + (process-drawable-reserved-method-40 () none) ;; 40 + (process-drawable-reserved-method-41 () none) ;; 41 + (process-drawable-reserved-method-42 () none) ;; 42 + (process-drawable-reserved-method-43 () none) ;; 43 + (process-drawable-reserved-method-44 () none) ;; 44 + (process-drawable-reserved-method-45 () none) ;; 45 + (process-drawable-reserved-method-46 () none) ;; 46 + (process-drawable-reserved-method-47 () none) ;; 47 + (process-drawable-reserved-method-48 () none) ;; 48 + (process-drawable-reserved-method-49 () none) ;; 49 + (process-drawable-reserved-method-50 () none) ;; 50 + (process-drawable-reserved-method-51 () none) ;; 51 + (process-drawable-reserved-method-52 () none) ;; 52 + (process-drawable-reserved-method-53 () none) ;; 53 + (process-drawable-reserved-method-54 () none) ;; 54 + (process-drawable-reserved-method-55 () none) ;; 55 + (process-drawable-reserved-method-56 () none) ;; 56 + (process-drawable-reserved-method-57 () none) ;; 57 + (process-drawable-reserved-method-58 () none) ;; 58 + (process-drawable-reserved-method-59 () none) ;; 59 + (process-drawable-reserved-method-60 () none) ;; 60 + (process-drawable-reserved-method-61 () none) ;; 61 + (process-drawable-reserved-method-62 () none) ;; 62 ) ) @@ -10974,7 +10972,7 @@ :size-assert #x68 :flag-assert #xa00000068 (:methods - (combine! (_type_ attack-info) none 9) + (combine! (_type_ attack-info) none) ;; 9 ) ) @@ -11039,7 +11037,7 @@ :size-assert #xd0 :flag-assert #x15006000d0 (:methods - (is-visible? (_type_) symbol 20) + (is-visible? (_type_) symbol) ;; 20 ) (:states part-spawner-active) @@ -11094,15 +11092,15 @@ :size-assert #xe0 :flag-assert #xf007000e0 (:methods - (eval (_type_ pair) process 14) + (eval (_type_ pair) process) ;; 14 ) (:states camera-tracker-process) ) -(declare-type collide-shape-moving basic) +(declare-type collide-shape-moving collide-shape) (deftype touch-tracker (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (duration time-frame :offset-assert 176) (target handle :offset-assert 184) (event symbol :offset-assert 192) @@ -11147,8 +11145,8 @@ :size-assert #x1c :flag-assert #xb0000001c (:methods - (init! (_type_ string int int int symbol string) none 9) - (get-response (_type_) symbol 10) + (init! (_type_ string int int int symbol string) none) ;; 9 + (get-response (_type_) symbol) ;; 10 ) ) @@ -11179,7 +11177,7 @@ :size-assert #x70 :flag-assert #xf00000070 (:methods - (die () _type_ :state 14) + (die () _type_ :state) ;; 14 ) ) @@ -11216,16 +11214,16 @@ :size-assert #xdc :flag-assert #x1e007000dc (:methods - (pov-camera-abort () _type_ :state 20) - (pov-camera-done-playing () _type_ :state 21) - (pov-camera-playing () _type_ :state 22) - (pov-camera-start-playing () _type_ :state 23) - (pov-camera-startup () _type_ :state 24) - (check-for-abort (_type_) symbol 25) - (target-grabbed? (_type_) symbol 26) - (pre-startup-callback (_type_) none 27) - (target-released? () symbol 28) - (set-stack-size! (_type_) none 29) + (pov-camera-abort () _type_ :state) ;; 20 + (pov-camera-done-playing () _type_ :state) ;; 21 + (pov-camera-playing () _type_ :state) ;; 22 + (pov-camera-start-playing () _type_ :state) ;; 23 + (pov-camera-startup () _type_ :state) ;; 24 + (check-for-abort (_type_) symbol) ;; 25 + (target-grabbed? (_type_) symbol) ;; 26 + (pre-startup-callback (_type_) none) ;; 27 + (target-released? (_type_) symbol) ;; 28 + (set-stack-size! (_type_) none) ;; 29 ) ) @@ -11246,15 +11244,15 @@ :size-assert #x8 :flag-assert #x1200000008 (:methods - (get-current-value (_type_ float) float 9) - (get-current-phase-no-mod (_type_) float 10) - (get-current-phase (_type_) float 11) - (get-current-value-with-mirror (_type_ float) float 12) - (get-current-phase-with-mirror (_type_) float 13) - (setup-params! (_type_ uint float float float) none 14) - (load-params! (_type_ process uint float float float) symbol 15) - (sync-now! (_type_ float) float 16) - (get-phase-offset (_type_) float 17) + (get-current-value (_type_ float) float) ;; 9 + (get-current-phase-no-mod (_type_) float) ;; 10 + (get-current-phase (_type_) float) ;; 11 + (get-current-value-with-mirror (_type_ float) float) ;; 12 + (get-current-phase-with-mirror (_type_) float) ;; 13 + (setup-params! (_type_ uint float float float) none) ;; 14 + (load-params! (_type_ process uint float float float) symbol) ;; 15 + (sync-now! (_type_ float) float) ;; 16 + (get-phase-offset (_type_) float) ;; 17 ) ) @@ -11294,8 +11292,8 @@ :size-assert #x1c :flag-assert #xb0000001c (:methods - (set-params! (_type_ int int float) float 9) - (update! (_type_ ) float 10) + (set-params! (_type_ int int float) float) ;; 9 + (update! (_type_ ) float) ;; 10 ) ) @@ -11312,8 +11310,8 @@ :size-assert #x18 :flag-assert #xb00000018 (:methods - (set-params! (_type_ float float float float) float 9) - (update! (_type_ float) float 10) + (set-params! (_type_ float float float float) float) ;; 9 + (update! (_type_ float) float) ;; 10 ) ) @@ -11329,10 +11327,10 @@ :size-assert #x28 :flag-assert #xd00000028 (:methods - (set-params! (_type_ float float float float float float float) float 9) - (update! (_type_ float) float 10) - (at-min? (_type_) symbol 11) ;; bool - (at-max? (_type_) symbol 12) ;; bool + (set-params! (_type_ float float float float float float float) float) ;; 9 + (update! (_type_ float) float) ;; 10 + (at-min? (_type_) symbol) ;; 11 ;; bool + (at-max? (_type_) symbol) ;; 12 ;; bool ) ) @@ -11349,10 +11347,10 @@ :size-assert #x30 :flag-assert #xd00000030 (:methods - (set-params! (_type_ int int float float) vector 9) - (update-now! (_type_) vector 10) - (update-with-delay! (_type_) vector 11) - (update-with-delay-or-reset! (_type_) vector 12) + (set-params! (_type_ int int float float) vector) ;; 9 + (update-now! (_type_) vector) ;; 10 + (update-with-delay! (_type_) vector) ;; 11 + (update-with-delay-or-reset! (_type_) vector) ;; 12 ) ) @@ -11368,8 +11366,8 @@ :size-assert #x3c :flag-assert #xb0000003c (:methods - (set-params! (_type_ vector float float float) vector 9) - (update! (_type_ vector) vector 10) + (set-params! (_type_ vector float float float) vector) ;; 9 + (update! (_type_ vector) vector) ;; 10 ) ) @@ -11396,12 +11394,12 @@ :size-assert #x20 :flag-assert #xf00000020 (:methods - (set-zero! (_type_) _type_ 9) - (update! (_type_) float 10) - (get-no-update (_type_) float 11) - (activate! (_type_ float int int float float) _type_ 12) - (nonzero-amplitude? (_type_) symbol 13) - (die-on-next-update! (_type_) _type_ 14) + (set-zero! (_type_) _type_) ;; 9 + (update! (_type_) float) ;; 10 + (get-no-update (_type_) float) ;; 11 + (activate! (_type_ float int int float float) _type_) ;; 12 + (nonzero-amplitude? (_type_) symbol) ;; 13 + (die-on-next-update! (_type_) _type_) ;; 14 ) ) @@ -11422,13 +11420,13 @@ :size-assert #x28 :flag-assert #x1000000028 (:methods - (eval-position! (_type_ float vector) vector 9) - (eval-velocity! (_type_ float vector) vector 10) - (setup-from-to-duration! (_type_ vector vector float float) none 11) - (setup-from-to-xz-vel! (_type_ vector vector float float) none 12) - (setup-from-to-y-vel! (_type_ vector vector float float) none 13) - (setup-from-to-height! (_type_ vector vector float float) none 14) - (debug-draw! (_type_) none 15) + (eval-position! (_type_ float vector) vector) ;; 9 + (eval-velocity! (_type_ float vector) vector) ;; 10 + (setup-from-to-duration! (_type_ vector vector float float) none) ;; 11 + (setup-from-to-xz-vel! (_type_ vector vector float float) none) ;; 12 + (setup-from-to-y-vel! (_type_ vector vector float float) none) ;; 13 + (setup-from-to-height! (_type_ vector vector float float) none) ;; 14 + (debug-draw! (_type_) none) ;; 15 ) ) @@ -11507,14 +11505,14 @@ :size-assert #x90 :flag-assert #x1000000090 (:methods - (new (symbol type joint-mod-handler-mode process-drawable int) _type_ 0) - (set-mode! (_type_ joint-mod-handler-mode) _type_ 9) - (set-target! (_type_ vector) none 10) - (look-at-enemy! (_type_ vector symbol process) none 11) - (reset-blend! (_type_) _type_ 12) - (set-twist! (_type_ float float float) vector 13) - (set-trs! (_type_ vector quaternion vector) none 14) - (shut-down! (_type_) none 15) + (new (symbol type joint-mod-handler-mode process-drawable int) _type_) ;; 0 + (set-mode! (_type_ joint-mod-handler-mode) _type_) ;; 9 + (set-target! (_type_ vector) none) ;; 10 + (look-at-enemy! (_type_ vector symbol process) none) ;; 11 + (reset-blend! (_type_) _type_) ;; 12 + (set-twist! (_type_ float float float) vector) ;; 13 + (set-trs! (_type_ vector quaternion vector) none) ;; 14 + (shut-down! (_type_) none) ;; 15 ) ) @@ -11667,13 +11665,13 @@ :size-assert #x28 :flag-assert #x1000000028 (:methods - (debug-draw-tris (_type_ process-drawable int) none 9) - (overlap-test (_type_ collide-mesh-cache-tri vector) symbol 10) - (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 11) ;; spat - (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 12) ;; sopt - (populate-cache! (_type_ collide-mesh-cache-tri matrix) none 13) - (collide-mesh-math-1 (_type_ object object) none 14) - (collide-mesh-math-2 (_type_ object object object) none 15) + (debug-draw-tris (_type_ process-drawable int) none) ;; 9 + (overlap-test (_type_ collide-mesh-cache-tri vector) symbol) ;; 10 + (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) ;; 11 ;; spat + (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) ;; 12 ;; sopt + (populate-cache! (_type_ collide-mesh-cache-tri matrix) none) ;; 13 + (collide-mesh-math-1 (_type_ object object) none) ;; 14 + (collide-mesh-math-2 (_type_ object object object) none) ;; 15 ) ) @@ -11687,9 +11685,9 @@ :size-assert #xa020 :flag-assert #xc0000a020 (:methods - (allocate! (_type_ int) int 9) - (is-id? (_type_ int) symbol 10) - (next-id! (_type_) uint 11) + (allocate! (_type_ int) int) ;; 9 + (is-id? (_type_ int) symbol) ;; 10 + (next-id! (_type_) uint) ;; 11 ) ) @@ -11728,7 +11726,7 @@ :size-assert #x20 :flag-assert #xa00000020 (:methods - (set-rider! (_type_ handle) symbol 9) + (set-rider! (_type_ handle) symbol) ;; 9 ) ) @@ -11741,9 +11739,9 @@ :size-assert #x30 :flag-assert #xb00000030 (:methods - (new (symbol type int) _type_ 0) - (add-rider! (_type_ process-drawable) collide-sticky-rider 9) - (reset! (_type_) int 10) + (new (symbol type int) _type_) ;; 0 + (add-rider! (_type_ process-drawable) collide-sticky-rider) ;; 9 + (reset! (_type_) int) ;; 10 ) ) @@ -11770,7 +11768,7 @@ :size-assert #x8c :flag-assert #xa0000008c (:methods - (init! (_type_ vector) symbol 9) + (init! (_type_ vector) symbol) ;; 9 ) ) @@ -11785,7 +11783,7 @@ :size-assert #x64 :flag-assert #xa00000064 (:methods - (reset! (_type_) none 9) + (reset! (_type_) none) ;; 9 ) ) @@ -11944,26 +11942,26 @@ :size-assert #x48 :flag-assert #x1c00000048 (:methods - (new (symbol type collide-shape uint int) _type_ 0) - (move-by-vector! (_type_ vector) none 9) - (find-prim-by-id (_type_ uint) collide-shape-prim 10) - (debug-draw-world-sphere (_type_) symbol 11) - (add-fg-prim-using-box (_type_ collide-cache) none 12) - (add-fg-prim-using-line-sphere (_type_ collide-cache) none 13) - (add-fg-prim-using-y-probe (_type_ collide-cache) none 14) - (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 15) - (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 16) - (unused-17 () none 17) - (collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none 18) - (collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none 19) - (add-to-bounding-box (_type_ collide-kind) symbol 20) - (num-mesh (_type_ collide-shape-prim) int 21) - (on-platform-test (_type_ collide-shape-prim collide-overlap-result float) none 22) - (should-push-away-test (_type_ collide-shape-prim collide-overlap-result) none 23) - (should-push-away-reverse-test (_type_ collide-shape-prim-group collide-overlap-result) none 24) - (update-transforms! (_type_ process-drawable) symbol 25) - (set-collide-as! (_type_ collide-kind) none 26) - (set-collide-with! (_type_ collide-kind) none 27) + (new (symbol type collide-shape uint int) _type_) ;; 0 + (move-by-vector! (_type_ vector) none) ;; 9 + (find-prim-by-id (_type_ uint) collide-shape-prim) ;; 10 + (debug-draw-world-sphere (_type_) symbol) ;; 11 + (add-fg-prim-using-box (_type_ collide-cache) none) ;; 12 + (add-fg-prim-using-line-sphere (_type_ collide-cache) none) ;; 13 + (add-fg-prim-using-y-probe (_type_ collide-cache) none) ;; 14 + (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol) ;; 15 + (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol) ;; 16 + (unused-17 () none) ;; 17 + (collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none) ;; 18 + (collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none) ;; 19 + (add-to-bounding-box (_type_ collide-kind) symbol) ;; 20 + (num-mesh (_type_ collide-shape-prim) int) ;; 21 + (on-platform-test (_type_ collide-shape-prim collide-overlap-result float) none) ;; 22 + (should-push-away-test (_type_ collide-shape-prim collide-overlap-result) none) ;; 23 + (should-push-away-reverse-test (_type_ collide-shape-prim-group collide-overlap-result) none) ;; 24 + (update-transforms! (_type_ process-drawable) symbol) ;; 25 + (set-collide-as! (_type_ collide-kind) none) ;; 26 + (set-collide-with! (_type_ collide-kind) none) ;; 27 ) ) @@ -11974,7 +11972,7 @@ :size-assert #x4c :flag-assert #x1c0000004c (:methods - (new (symbol type collide-shape uint) _type_ 0) + (new (symbol type collide-shape uint) _type_) ;; 0 ) ) @@ -11988,8 +11986,8 @@ :size-assert #x5c :flag-assert #x1d0000005c (:methods - (new (symbol type collide-shape uint uint) _type_ 0) - (change-mesh (_type_ int) none 28) + (new (symbol type collide-shape uint uint) _type_) ;; 0 + (change-mesh (_type_ int) none) ;; 28 ) ) @@ -12004,9 +12002,9 @@ :size-assert #x54 :flag-assert #x1e00000054 (:methods - (new (symbol type collide-shape uint int) _type_ 0) - (append-prim (_type_ collide-shape-prim) none 28) - (add-to-non-empty-bounding-box (_type_ collide-kind) none 29) + (new (symbol type collide-shape uint int) _type_) ;; 0 + (append-prim (_type_ collide-shape-prim) none) ;; 28 + (add-to-non-empty-bounding-box (_type_ collide-kind) none) ;; 29 ) ) @@ -12044,34 +12042,34 @@ :flag-assert #x38000000b8 (:methods (new (symbol type process-drawable collide-list-enum) _type_) - (move-by-vector! (_type_ vector) none 28) - (alloc-riders (_type_ int) none 29) - (move-to-point! (_type_ vector) none 30) ;; ret - symbol | float (CSPG::9) - (debug-draw (_type_) none 31) - (fill-cache-for-shape! (_type_ float collide-kind) none 32) - (fill-cache-integrate-and-collide! (_type_ vector collide-kind) none 33) - (find-prim-by-id (_type_ uint) collide-shape-prim 34) - (detect-riders! (_type_) symbol 35) - (build-bounding-box-for-shape (_type_ bounding-box float collide-kind) symbol 36) - (integrate-and-collide! (_type_ vector) none 37) - (find-collision-meshes (_type_) symbol 38) - (on-platform (_type_ collide-shape collide-overlap-result) symbol 39) - (find-overlapping-shapes (_type_ overlaps-others-params) symbol 40) ;; check if blocked?? - (calc-shove-up (_type_ attack-info float) vector 41) - (should-push-away (_type_ collide-shape collide-overlap-result) symbol 42) - (pull-rider! (_type_ pull-rider-info) none 43) - (pull-riders! (_type_) symbol 44) - (do-push-aways! (_type_) symbol 45) - (set-root-prim! (_type_ collide-shape-prim) collide-shape-prim 46) - (update-transforms! (_type_) symbol 47) - (clear-collide-with-as (_type_) none 48) - (restore-collide-with-as (_type_) none 49) - (backup-collide-with-as (_type_) none 50) - (set-root-prim-collide-with! (_type_ collide-kind) none 51) - (set-root-prim-collide-as! (_type_ collide-kind) none 52) - (set-collide-kinds (_type_ int collide-kind collide-kind) none 53) - (set-collide-offense (_type_ int collide-offense) none 54) - (send-shove-back (_type_ process touching-shapes-entry float float float) none 55) + (move-by-vector! (_type_ vector) none) ;; 28 + (alloc-riders (_type_ int) none) ;; 29 + (move-to-point! (_type_ vector) none) ;; 30 ;; ret - symbol | float (CSPG::9) + (debug-draw (_type_) none) ;; 31 + (fill-cache-for-shape! (_type_ float collide-kind) none) ;; 32 + (fill-cache-integrate-and-collide! (_type_ vector collide-kind) none) ;; 33 + (find-prim-by-id (_type_ uint) collide-shape-prim) ;; 34 + (detect-riders! (_type_) symbol) ;; 35 + (build-bounding-box-for-shape (_type_ bounding-box float collide-kind) symbol) ;; 36 + (integrate-and-collide! (_type_ vector) none) ;; 37 + (find-collision-meshes (_type_) symbol) ;; 38 + (on-platform (_type_ collide-shape collide-overlap-result) symbol) ;; 39 + (find-overlapping-shapes (_type_ overlaps-others-params) symbol) ;; 40 ;; check if blocked?? + (calc-shove-up (_type_ attack-info float) vector) ;; 41 + (should-push-away (_type_ collide-shape collide-overlap-result) symbol) ;; 42 + (pull-rider! (_type_ pull-rider-info) none) ;; 43 + (pull-riders! (_type_) symbol) ;; 44 + (do-push-aways! (_type_) symbol) ;; 45 + (set-root-prim! (_type_ collide-shape-prim) collide-shape-prim) ;; 46 + (update-transforms! (_type_) symbol) ;; 47 + (clear-collide-with-as (_type_) none) ;; 48 + (restore-collide-with-as (_type_) none) ;; 49 + (backup-collide-with-as (_type_) none) ;; 50 + (set-root-prim-collide-with! (_type_ collide-kind) none) ;; 51 + (set-root-prim-collide-as! (_type_ collide-kind) none) ;; 52 + (set-collide-kinds (_type_ int collide-kind collide-kind) none) ;; 53 + (set-collide-offense (_type_ int collide-offense) none) ;; 54 + (send-shove-back (_type_ process touching-shapes-entry float float float) none) ;; 55 ) ) @@ -12178,15 +12176,15 @@ :size-assert #x1bc :flag-assert #x41000001bc (:methods - (set-and-handle-pat! (_type_ pat-surface) none 56) - (integrate-no-collide! (_type_ vector) none 57) - (collide-shape-moving-method-58 (_type_ vector) symbol 58) - (integrate-for-enemy-with-move-to-ground! (_type_ vector collide-kind float symbol symbol symbol) none 59) - (move-to-ground (_type_ float float symbol collide-kind) symbol 60) - (move-to-ground-point! (_type_ vector vector vector) none 61) - (compute-acc-due-to-gravity (_type_ vector float) vector 62) - (step-collison! (_type_ vector vector float) float 63) - (move-to-tri! (_type_ collide-tri-result vector) none 64) + (set-and-handle-pat! (_type_ pat-surface) none) ;; 56 + (integrate-no-collide! (_type_ vector) none) ;; 57 + (collide-shape-moving-method-58 (_type_ vector) symbol) ;; 58 + (integrate-for-enemy-with-move-to-ground! (_type_ vector collide-kind float symbol symbol symbol) none) ;; 59 + (move-to-ground (_type_ float float symbol collide-kind) symbol) ;; 60 + (move-to-ground-point! (_type_ vector vector vector) none) ;; 61 + (compute-acc-due-to-gravity (_type_ vector float) vector) ;; 62 + (step-collison! (_type_ vector vector float) float) ;; 63 + (move-to-tri! (_type_ collide-tri-result vector) none) ;; 64 ) ) @@ -12224,7 +12222,7 @@ :size-assert #x78 :flag-assert #xa00000078 (:methods - (update! (_type_ collide-shape-moving vector vector vector) _type_ 9) + (update! (_type_ collide-shape-moving vector vector vector) _type_) ;; 9 ) ) @@ -12431,10 +12429,10 @@ :size-assert #xe4 :flag-assert #xd000000e4 (:methods - (get-touched-prim (_type_ trsqv touching-shapes-entry) collide-shape-prim 9) - (touching-prims-entry-method-10 () none 10) - (get-middle-of-bsphere-overlap (_type_ vector) vector 11) - (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result 12) + (get-touched-prim (_type_ trsqv touching-shapes-entry) collide-shape-prim) ;; 9 + (touching-prims-entry-method-10 () none) ;; 10 + (get-middle-of-bsphere-overlap (_type_ vector) vector) ;; 11 + (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result) ;; 12 ) ) @@ -12446,11 +12444,11 @@ :size-assert #x3c10 :flag-assert #xd00003c10 (:methods - (new (symbol type) _type_ 0) - (alloc-node (_type_) touching-prims-entry 9) - (get-free-node-count (_type_) int 10) - (init-list! (_type_) none 11) - (free-node (_type_ touching-prims-entry) touching-prims-entry 12) + (new (symbol type) _type_) ;; 0 + (alloc-node (_type_) touching-prims-entry) ;; 9 + (get-free-node-count (_type_) int) ;; 10 + (init-list! (_type_) none) ;; 11 + (free-node (_type_ touching-prims-entry) touching-prims-entry) ;; 12 ) ) @@ -12465,15 +12463,15 @@ :size-assert #x10 :flag-assert #x1200000010 (:methods - (touching-shapes-entry-method-9 (_type_) none 9) - (get-touched-shape (_type_ collide-shape) collide-shape 10) - (touching-shapes-entry-method-11 () none 11) - (prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry 12) ; this one! - (prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry 13) - (touching-shapes-entry-method-14 () none 14) - (free-touching-prims-list (_type_) symbol 15) - (get-head (_type_) touching-prims-entry 16) - (get-next (_type_ touching-prims-entry) touching-prims-entry 17) + (touching-shapes-entry-method-9 (_type_) none) ;; 9 + (get-touched-shape (_type_ collide-shape) collide-shape) ;; 10 + (touching-shapes-entry-method-11 () none) ;; 11 + (prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry) ;; 12 ; this one! + (prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry) ;; 13 + (touching-shapes-entry-method-14 () none) ;; 14 + (free-touching-prims-list (_type_) symbol) ;; 15 + (get-head (_type_) touching-prims-entry) ;; 16 + (get-next (_type_ touching-prims-entry) touching-prims-entry) ;; 17 ) ) @@ -12486,13 +12484,13 @@ :size-assert #x208 :flag-assert #xf00000208 (:methods - (new (symbol type) _type_ 0) - (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none 9) - (touching-list-method-10 () none 10) - (update-from-step-size (_type_ float) none 11) - (send-events-for-touching-shapes (_type_) none 12) - (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry 13) - (free-all-prim-nodes (_type_) none 14) + (new (symbol type) _type_) ;; 0 + (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none) ;; 9 + (touching-list-method-10 () none) ;; 10 + (update-from-step-size (_type_ float) none) ;; 11 + (send-events-for-touching-shapes (_type_) none) ;; 12 + (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry) ;; 13 + (free-all-prim-nodes (_type_) none) ;; 14 ) ) @@ -12528,8 +12526,8 @@ :size-assert #x144 :flag-assert #xb00000144 (:methods - (edge-grab-info-method-9 (_type_) symbol 9) - (debug-draw (_type_) symbol 10) + (edge-grab-info-method-9 (_type_) symbol) ;; 9 + (debug-draw (_type_) symbol) ;; 10 ) ) @@ -12579,8 +12577,8 @@ :size-assert #x810 :flag-assert #xb00000810 (:methods - (debug-draw (_type_) object 9) - (add-to-list! (_type_ collide-edge-hold-item) none 10) + (debug-draw (_type_) object) ;; 9 + (add-to-list! (_type_ collide-edge-hold-item) none) ;; 10 ) ) @@ -12618,17 +12616,17 @@ :size-assert #x2690 :flag-assert #x1400002690 (:methods - (search-for-edges (_type_ collide-edge-hold-list) symbol 9) - (debug-draw-edges (_type_) object 10) - (debug-draw-tris (_type_) none 11) - (debug-draw-sphere (_type_) symbol 12) - (compute-center-point! (_type_ collide-edge-edge vector) float 13) - (collide-edge-work-method-14 (_type_ vector vector int) float 14) - (find-grabbable-edges! (_type_) none 15) - (find-grabbable-tris! (_type_) none 16) - (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol 17) - (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol 18) - (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol 19) + (search-for-edges (_type_ collide-edge-hold-list) symbol) ;; 9 + (debug-draw-edges (_type_) object) ;; 10 + (debug-draw-tris (_type_) none) ;; 11 + (debug-draw-sphere (_type_) symbol) ;; 12 + (compute-center-point! (_type_ collide-edge-edge vector) float) ;; 13 + (collide-edge-work-method-14 (_type_ vector vector int) float) ;; 14 + (find-grabbable-edges! (_type_) none) ;; 15 + (find-grabbable-tris! (_type_) none) ;; 16 + (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol) ;; 17 + (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol) ;; 18 + (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol) ;; 19 ) ) @@ -12684,12 +12682,12 @@ :flag-assert #xf00000024 (:methods (new (symbol type process-drawable) _type_) - (effect-control-method-9 (_type_) none 9) - (effect-control-method-10 (_type_ symbol float int) object 10) - (effect-control-method-11 (_type_ symbol float int basic pat-surface) none 11) - (effect-control-method-12 (_type_ symbol float int basic sound-name) int 12) - (set-channel-offset! (_type_ int) none 13) - (effect-control-method-14 (_type_ float float float) none 14) + (effect-control-method-9 (_type_) none) ;; 9 + (effect-control-method-10 (_type_ symbol float int) object) ;; 10 + (effect-control-method-11 (_type_ symbol float int basic pat-surface) none) ;; 11 + (effect-control-method-12 (_type_ symbol float int basic sound-name) int) ;; 12 + (set-channel-offset! (_type_ int) none) ;; 13 + (effect-control-method-14 (_type_ float float float) none) ;; 14 ) ) @@ -12760,7 +12758,7 @@ ;; - Types (deftype projectile (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (base-trans vector :inline :offset-assert 176) (target vector :inline :offset-assert 192) (target-base vector :inline :offset-assert 208) @@ -12790,15 +12788,15 @@ :flag-assert #x1d0130019c ;; inherited inspect of process-drawable (:methods - (projectile-die () _type_ :state 20) ;; state - sound related? - (projectile-dissipate () _type_ :state 21) ;; state - (projectile-impact () _type_ :state 22) ;; state - (projectile-moving () _type_ :state 23) ;; state - (projectile-method-24 (_type_) none 24) - (projectile-method-25 (_type_) none 25) - (projectile-method-26 (_type_) none 26) - (projectile-method-27 (_type_) none 27) - (projectile-method-28 (_type_) none 28) + (projectile-die () _type_ :state) ;; 20 ;; state - sound related? + (projectile-dissipate () _type_ :state) ;; 21 ;; state + (projectile-impact () _type_ :state) ;; 22 ;; state + (projectile-moving () _type_ :state) ;; 23 ;; state + (projectile-method-24 (_type_) none) ;; 24 + (projectile-method-25 (_type_) none) ;; 25 + (projectile-method-26 (_type_) none) ;; 26 + (projectile-method-27 (_type_) none) ;; 27 + (projectile-method-28 (_type_) none) ;; 28 ) ) @@ -12841,7 +12839,7 @@ (deftype target (process-drawable) ((self-override target :score 100 :offset 28) (control control-info :score 100 :offset 112) - (fact-info-target fact-info-target :score 100 :offset 144) + (fact fact-info-target :override) (skel2 basic :offset-assert 176) (racer racer-info :offset-assert 180) (game game-info :offset-assert 184) @@ -12873,7 +12871,7 @@ :size-assert #x250 ;;#x248 :flag-assert #x1501e00250 ;;#x1501e00248 (:methods - (find-edge-grabs! (_type_ collide-cache) object 20) ;; none or #f + (find-edge-grabs! (_type_ collide-cache) object) ;; 20 ;; none or #f ) (:states (target-jump float float surface) @@ -13091,11 +13089,11 @@ :size-assert #x34 :flag-assert #xe00000034 (:methods - (perf-stat-method-9 (_type_) none 9) - (print-to-stream (_type_ string basic) none 10) - (reset! (_type_) none 11) - (read! (_type_) none 12) - (update-wait-stats (_type_ uint uint uint) none 13) + (perf-stat-method-9 (_type_) none) ;; 9 + (print-to-stream (_type_ string basic) none) ;; 10 + (reset! (_type_) none) ;; 11 + (read! (_type_) none) ;; 12 + (update-wait-stats (_type_ uint uint uint) none) ;; 13 ) ) @@ -13172,9 +13170,9 @@ :size-assert #x190 :flag-assert #x1400000190 (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (birth (_type_) none 18) - (deactivate-entities (_type_) none 19) + (relocate (_type_ kheap (pointer uint8)) none :replace) ;; 7 + (birth (_type_) none) ;; 18 + (deactivate-entities (_type_) none) ;; 19 ) ) @@ -13274,8 +13272,8 @@ :size-assert #xc60 :flag-assert #xb00000c60 (:methods - (collide-puss-work-method-9 (_type_ object object) symbol 9) - (collide-puss-work-method-10 (_type_ object object) symbol 10) + (collide-puss-work-method-9 (_type_ object object) symbol) ;; 9 + (collide-puss-work-method-10 (_type_ object object) symbol) ;; 10 ) ) @@ -13323,8 +13321,8 @@ :size-assert #x30 :flag-assert #xb00000030 (:methods - (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float 9) - (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float 10) + (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float) ;; 9 + (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float) ;; 10 ) ) @@ -13345,30 +13343,30 @@ :size-assert #x8670 :flag-assert #x2100008670 (:methods - (debug-draw (_type_) none 9) - (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float 10) - (fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol 11) - (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float 12) - (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none 13) - (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none 14) - (fill-using-spheres (_type_ collide-using-spheres-params) none 15) - (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none 16) - (initialize (_type_) none 17) - (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float 18) - (probe-using-spheres (_type_ collide-using-spheres-params) symbol 19) - (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20) - (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21) ;; second functiom is method 28 - (fill-from-foreground-using-box (_type_) none 22) - (fill-from-foreground-using-line-sphere (_type_) none 23) - (fill-from-foreground-using-y-probe (_type_) none 24) - (fill-from-water (_type_ water-control) none 25) ;; or whatever is from 152 in the process passed to 16 - (load-mesh-from-spad-in-box (_type_ collide-frag-mesh) none 26) - (collide-cache-method-27 (_type_) none 27) - (collide-cache-method-28 (_type_) none 28) - (collide-cache-method-29 (_type_ collide-frag-mesh) none 29) - (puyp-mesh (_type_ collide-puyp-work collide-cache-prim) none 30) - (puyp-sphere (_type_ collide-puyp-work collide-cache-prim) vector 31) - (unpack-background-collide-mesh (_type_ object object object) none 32) ;; helper for fill from background. + (debug-draw (_type_) none) ;; 9 + (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float) ;; 10 + (fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol) ;; 11 + (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float) ;; 12 + (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none) ;; 13 + (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none) ;; 14 + (fill-using-spheres (_type_ collide-using-spheres-params) none) ;; 15 + (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none) ;; 16 + (initialize (_type_) none) ;; 17 + (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float) ;; 18 + (probe-using-spheres (_type_ collide-using-spheres-params) symbol) ;; 19 + (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float) ;; 20 + (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none) ;; 21 ;; second functiom is method 28 + (fill-from-foreground-using-box (_type_) none) ;; 22 + (fill-from-foreground-using-line-sphere (_type_) none) ;; 23 + (fill-from-foreground-using-y-probe (_type_) none) ;; 24 + (fill-from-water (_type_ water-control) none) ;; 25 ;; or whatever is from 152 in the process passed to 16 + (load-mesh-from-spad-in-box (_type_ collide-frag-mesh) none) ;; 26 + (collide-cache-method-27 (_type_) none) ;; 27 + (collide-cache-method-28 (_type_) none) ;; 28 + (collide-cache-method-29 (_type_ collide-frag-mesh) none) ;; 29 + (puyp-mesh (_type_ collide-puyp-work collide-cache-prim) none) ;; 30 + (puyp-sphere (_type_ collide-puyp-work collide-cache-prim) vector) ;; 31 + (unpack-background-collide-mesh (_type_ object object object) none) ;; 32 ;; helper for fill from background. ) ) @@ -14374,7 +14372,7 @@ :size-assert #x10 :flag-assert #xa00000010 (:methods - (update-perm! (_type_ symbol entity-perm-status) _type_ 9) + (update-perm! (_type_ symbol entity-perm-status) _type_) ;; 9 ) ) @@ -14395,7 +14393,7 @@ :size-assert #x40 :flag-assert #xa00000040 (:methods - (birth? (_type_ vector) symbol 9) + (birth? (_type_ vector) symbol) ;; 9 ) ) @@ -14423,11 +14421,11 @@ :flag-assert #x1b00000034 ;; unrecognized get op: (set! t9 find-parent-method) parent was res-lump (:methods - (birth! (_type_) _type_ 22) - (kill! (_type_) _type_ 23) - (add-to-level! (_type_ level-group level actor-id) none 24) - (remove-from-level! (_type_ level-group) _type_ 25) - (get-level (_type_) level 26) + (birth! (_type_) _type_) ;; 22 + (kill! (_type_) _type_) ;; 23 + (add-to-level! (_type_ level-group level actor-id) none) ;; 24 + (remove-from-level! (_type_ level-group) _type_) ;; 25 + (get-level (_type_) level) ;; 26 ) ) @@ -14438,8 +14436,6 @@ :method-count-assert 27 :size-assert #x50 :flag-assert #x1b00000050 - (:methods - ) ) (deftype entity-ambient-data (structure) @@ -14474,8 +14470,8 @@ :size-assert #x34 :flag-assert #x1d00000034 (:methods - (draw-debug (_type_) none 27) - (birth-ambient! (_type_) none 28) + (draw-debug (_type_) none) ;; 27 + (birth-ambient! (_type_) none) ;; 28 ) ) @@ -14494,10 +14490,10 @@ :flag-assert #x1f00000050 ;; unrecognized get op: (set! t9 find-parent-method) parent was entity (:methods - (next-actor (_type_) entity-actor 27) - (prev-actor (_type_) entity-actor 28) - (debug-print (_type_ symbol type) none 29) - (set-or-clear-status! (_type_ entity-perm-status symbol) none 30) + (next-actor (_type_) entity-actor) ;; 27 + (prev-actor (_type_) entity-actor) ;; 28 + (debug-print (_type_ symbol type) none) ;; 29 + (set-or-clear-status! (_type_ entity-perm-status symbol) none) ;; 30 ) ) @@ -14579,7 +14575,7 @@ (data uint128 1 :offset-assert 96) ) (:methods - (new (symbol type int int) _type_ 0) + (new (symbol type int int) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x70 @@ -14620,7 +14616,7 @@ (data uint128 1 :offset-assert 32) ) (:methods - (new (symbol type int int) _type_ 0) + (new (symbol type int int) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x30 @@ -14935,7 +14931,7 @@ :size-assert #x30 :flag-assert #xa00000030 (:methods - (create-launch-control (_type_ process) sparticle-launch-control 9) + (create-launch-control (_type_ process) sparticle-launch-control) ;; 9 ) ) @@ -14954,11 +14950,11 @@ :size-assert #x40 :flag-assert #xe00000040 (:methods - (initialize (_type_ sparticle-launch-group process) none 9) - (is-visible? (_type_ vector) symbol 10) - (spawn (_type_ vector) object 11) - (kill-and-free-particles (_type_) none 12) - (kill-particles (_type_) none 13) + (initialize (_type_ sparticle-launch-group process) none) ;; 9 + (is-visible? (_type_ vector) symbol) ;; 10 + (spawn (_type_ vector) object) ;; 11 + (kill-and-free-particles (_type_) none) ;; 12 + (kill-particles (_type_) none) ;; 13 ) ) @@ -15063,7 +15059,7 @@ :size-assert #x34 :flag-assert #x900000034 (:methods - (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_ 0) + (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_) ;; 0 ) ) @@ -15090,24 +15086,24 @@ :size-assert #x10 :flag-assert #x1a00000010 (:methods - (new (symbol type process) _type_ 0) - (get-matching-actor-type-mask (_type_ type) int 9) - (actor-count-before (_type_) int 10) - (link-to-next-and-prev-actor (_type_) entity-actor 11) - (get-next (_type_) entity-actor 12) - (get-prev (_type_) entity-actor 13) - (get-next-process (_type_) process 14) - (get-prev-process (_type_) process 15) - (apply-function-forward (_type_ (function entity-actor object object) object) int 16) - (apply-function-reverse (_type_ (function entity-actor object object) object) int 17) - (apply-all (_type_ (function entity-actor object object) object) int 18) - (send-to-all (_type_ symbol) none 19) - (send-to-all-after (_type_ symbol) object 20) - (send-to-all-before (_type_ symbol) object 21) - (send-to-next-and-prev (_type_ symbol) none 22) - (send-to-next (_type_ symbol) none 23) - (send-to-prev (_type_ symbol) none 24) - (actor-count (_type_) int 25) + (new (symbol type process) _type_) ;; 0 + (get-matching-actor-type-mask (_type_ type) int) ;; 9 + (actor-count-before (_type_) int) ;; 10 + (link-to-next-and-prev-actor (_type_) entity-actor) ;; 11 + (get-next (_type_) entity-actor) ;; 12 + (get-prev (_type_) entity-actor) ;; 13 + (get-next-process (_type_) process) ;; 14 + (get-prev-process (_type_) process) ;; 15 + (apply-function-forward (_type_ (function entity-actor object object) object) int) ;; 16 + (apply-function-reverse (_type_ (function entity-actor object object) object) int) ;; 17 + (apply-all (_type_ (function entity-actor object object) object) int) ;; 18 + (send-to-all (_type_ symbol) none) ;; 19 + (send-to-all-after (_type_ symbol) object) ;; 20 + (send-to-all-before (_type_ symbol) object) ;; 21 + (send-to-next-and-prev (_type_ symbol) none) ;; 22 + (send-to-next (_type_ symbol) none) ;; 23 + (send-to-prev (_type_ symbol) none) ;; 24 + (actor-count (_type_) int) ;; 25 ) ) @@ -15194,8 +15190,8 @@ :size-assert #x30 :flag-assert #xb00000030 (:methods - (cam-index-method-9 (_type_ symbol entity vector curve) symbol 9) - (cam-index-method-10 (_type_ vector) float 10) ; inlined vector-dot issue? + (cam-index-method-9 (_type_ symbol entity vector curve) symbol) ;; 9 + (cam-index-method-10 (_type_ vector) float) ;; 10 ; inlined vector-dot issue? ) ) @@ -15240,21 +15236,21 @@ :size-assert #x664 :flag-assert #x1800000664 (:methods - (tracking-spline-method-9 (_type_) none 9) - (tracking-spline-method-10 (_type_ vector) none 10) - (print-nth-point (_type_ int) none 11) - (tracking-spline-method-12 (_type_) none 12) - (tracking-spline-method-13 (_type_ int) none 13) - (tracking-spline-method-14 (_type_ tracking-spline-sampler) none 14) - (tracking-spline-method-15 (_type_) none 15) - (tracking-spline-method-16 (_type_ float) none 16) - (tracking-spline-method-17 (_type_ vector float float symbol) int 17) ; - return value is actually none but they do a manual `return` - (tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector 18) - (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector 19) - (tracking-spline-method-20 (_type_ vector int) none 20) - (tracking-spline-method-21 (_type_ vector float float) vector 21) - (tracking-spline-method-22 (_type_ float) none 22) - (tracking-spline-method-23 (_type_) none 23) + (tracking-spline-method-9 (_type_) none) ;; 9 + (tracking-spline-method-10 (_type_ vector) none) ;; 10 + (print-nth-point (_type_ int) none) ;; 11 + (tracking-spline-method-12 (_type_) none) ;; 12 + (tracking-spline-method-13 (_type_ int) none) ;; 13 + (tracking-spline-method-14 (_type_ tracking-spline-sampler) none) ;; 14 + (tracking-spline-method-15 (_type_) none) ;; 15 + (tracking-spline-method-16 (_type_ float) none) ;; 16 + (tracking-spline-method-17 (_type_ vector float float symbol) int) ;; 17 ; - return value is actually none but they do a manual `return` + (tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector) ;; 18 + (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector) ;; 19 + (tracking-spline-method-20 (_type_ vector int) none) ;; 20 + (tracking-spline-method-21 (_type_ vector float float) vector) ;; 21 + (tracking-spline-method-22 (_type_ float) none) ;; 22 + (tracking-spline-method-23 (_type_) none) ;; 23 ) ) @@ -15271,10 +15267,10 @@ :size-assert #x18 :flag-assert #xd00000018 (:methods - (init-cam-float-seeker (_type_ float float float float) none 9) - (copy-cam-float-seeker (_type_ _type_) none 10) - (update! (_type_ float) none 11) - (jump-to-target! (_type_ float) float 12) + (init-cam-float-seeker (_type_ float float float float) none) ;; 9 + (copy-cam-float-seeker (_type_ _type_) none) ;; 10 + (update! (_type_ float) none) ;; 11 + (jump-to-target! (_type_ float) float) ;; 12 ) ) @@ -15290,8 +15286,8 @@ :size-assert #x3c :flag-assert #xb0000003c (:methods - (init! (_type_ vector float float float) none 9) - (update! (_type_ vector) none 10) + (init! (_type_ vector float float float) none) ;; 9 + (update! (_type_ vector) none) ;; 10 ) ) @@ -15580,8 +15576,8 @@ :size-assert #x8 :flag-assert #xb00000008 (:methods - (set-pos (_type_ string uint uint) int 9) - (print-pos (_type_) int 10) + (set-pos (_type_ string uint uint) int) ;; 9 + (print-pos (_type_) int) ;; 10 ) ) @@ -15656,19 +15652,19 @@ :flag-assert #x1b00b00118 ;; inherited inspect of process (:methods - (hidden? (_type_) symbol 14) - (draw-hud (_type_) none 15) - (tally-value (_type_ int int) none 16) - (draw-icons (_type_) none 17) - (draw-particles (_type_) none 18) - (hud-update (_type_) none 19) - (init-particles! (_type_ int) none 20) - (get-icon-pos-x (_type_) int 21) - (get-icon-pos-y (_type_) int 22) - (hud-method-23 (_type_) none 23) ;; unused - (set-pos-and-scale (_type_ symbol symbol) none 24) - (get-icon-scale-x (_type_) float 25) - (get-icon-scale-y (_type_) float 26) + (hidden? (_type_) symbol) ;; 14 + (draw-hud (_type_) none) ;; 15 + (tally-value (_type_ int int) none) ;; 16 + (draw-icons (_type_) none) ;; 17 + (draw-particles (_type_) none) ;; 18 + (hud-update (_type_) none) ;; 19 + (init-particles! (_type_ int) none) ;; 20 + (get-icon-pos-x (_type_) int) ;; 21 + (get-icon-pos-y (_type_) int) ;; 22 + (hud-method-23 (_type_) none) ;; 23 ;; unused + (set-pos-and-scale (_type_ symbol symbol) none) ;; 24 + (get-icon-scale-x (_type_) float) ;; 25 + (get-icon-scale-y (_type_) float) ;; 26 ) (:states hud-arriving @@ -15950,51 +15946,51 @@ :heap-base #x270 :flag-assert #x3b027002dc (:methods - (progress-method-14 (_type_) none 14) ;; unused - (progress-method-15 (_type_) none 15) ;; unused - (progress-method-16 (_type_) none 16) ;; unused - (draw-progress (_type_) none 17) - (progress-method-18 () none 18) ;; unused - (visible? (_type_) symbol 19) - (hidden? (_type_) symbol 20) - (adjust-sprites (_type_) none 21) - (adjust-icons (_type_) none 22) - (adjust-ratios (_type_ symbol symbol) none 23) - (draw-fuel-cell-screen (_type_ int) none 24) - (draw-money-screen (_type_ int) none 25) - (draw-buzzer-screen (_type_ int) none 26) - (draw-notice-screen (_type_) none 27) - (draw-options (_type_ int int float) none 28) - (respond-common (_type_) none 29) - (respond-progress (_type_) none 30) - (respond-memcard (_type_) none 31) - (can-go-back? (_type_) symbol 32) - (initialize-icons (_type_) none 33) - (initialize-particles (_type_) none 34) - (draw-memcard-storage-error (_type_ font-context) none 35) - (draw-memcard-data-exists (_type_ font-context) none 36) - (draw-memcard-no-data (_type_ font-context) none 37) - (draw-memcard-accessing (_type_ font-context) none 38) - (draw-memcard-insert (_type_ font-context) none 39) - (draw-memcard-file-select (_type_ font-context) none 40) - (draw-memcard-auto-save-error (_type_ font-context) none 41) - (draw-memcard-removed (_type_ font-context) none 42) - (draw-memcard-error (_type_ font-context) none 43) - (progress-method-44 (_type_) none 44) ;; unused - (push! (_type_) none 45) - (pop! (_type_) none 46) - (progress-method-47 (_type_) none 47) ;; unused - (enter! (_type_ progress-screen int) none 48) - (draw-memcard-format (_type_ font-context) none 49) - (draw-auto-save (_type_ font-context) none 50) - (set-transition-progress! (_type_ int) none 51) - (set-transition-speed! (_type_) none 52) - (set-memcard-screen (_type_ progress-screen) progress-screen 53) - (draw-pal-change-to-60hz (_type_ font-context) none 54) - (draw-pal-now-60hz (_type_ font-context) none 55) - (draw-no-disc (_type_ font-context) none 56) - (draw-bad-disc (_type_ font-context) none 57) - (draw-quit (_type_ font-context) none 58) + (progress-method-14 (_type_) none) ;; 14 ;; unused + (progress-method-15 (_type_) none) ;; 15 ;; unused + (progress-method-16 (_type_) none) ;; 16 ;; unused + (draw-progress (_type_) none) ;; 17 + (progress-method-18 () none) ;; 18 ;; unused + (visible? (_type_) symbol) ;; 19 + (hidden? (_type_) symbol) ;; 20 + (adjust-sprites (_type_) none) ;; 21 + (adjust-icons (_type_) none) ;; 22 + (adjust-ratios (_type_ symbol symbol) none) ;; 23 + (draw-fuel-cell-screen (_type_ int) none) ;; 24 + (draw-money-screen (_type_ int) none) ;; 25 + (draw-buzzer-screen (_type_ int) none) ;; 26 + (draw-notice-screen (_type_) none) ;; 27 + (draw-options (_type_ int int float) none) ;; 28 + (respond-common (_type_) none) ;; 29 + (respond-progress (_type_) none) ;; 30 + (respond-memcard (_type_) none) ;; 31 + (can-go-back? (_type_) symbol) ;; 32 + (initialize-icons (_type_) none) ;; 33 + (initialize-particles (_type_) none) ;; 34 + (draw-memcard-storage-error (_type_ font-context) none) ;; 35 + (draw-memcard-data-exists (_type_ font-context) none) ;; 36 + (draw-memcard-no-data (_type_ font-context) none) ;; 37 + (draw-memcard-accessing (_type_ font-context) none) ;; 38 + (draw-memcard-insert (_type_ font-context) none) ;; 39 + (draw-memcard-file-select (_type_ font-context) none) ;; 40 + (draw-memcard-auto-save-error (_type_ font-context) none) ;; 41 + (draw-memcard-removed (_type_ font-context) none) ;; 42 + (draw-memcard-error (_type_ font-context) none) ;; 43 + (progress-method-44 (_type_) none) ;; 44 ;; unused + (push! (_type_) none) ;; 45 + (pop! (_type_) none) ;; 46 + (progress-method-47 (_type_) none) ;; 47 ;; unused + (enter! (_type_ progress-screen int) none) ;; 48 + (draw-memcard-format (_type_ font-context) none) ;; 49 + (draw-auto-save (_type_ font-context) none) ;; 50 + (set-transition-progress! (_type_ int) none) ;; 51 + (set-transition-speed! (_type_) none) ;; 52 + (set-memcard-screen (_type_ progress-screen) progress-screen) ;; 53 + (draw-pal-change-to-60hz (_type_ font-context) none) ;; 54 + (draw-pal-now-60hz (_type_ font-context) none) ;; 55 + (draw-no-disc (_type_ font-context) none) ;; 56 + (draw-bad-disc (_type_ font-context) none) ;; 57 + (draw-quit (_type_ font-context) none) ;; 58 ) (:states progress-normal @@ -16031,7 +16027,7 @@ :size-assert #x20 :flag-assert #x900000020 (:methods - (new (symbol type uint uint) rpc-buffer 0) + (new (symbol type uint uint) rpc-buffer) ;; 0 ) ) @@ -16045,13 +16041,13 @@ :size-assert #x18 :flag-assert #xf00000018 (:methods - (new (symbol type uint uint int) rpc-buffer-pair 0) - (call (rpc-buffer-pair uint pointer uint) int 9) - (add-element (rpc-buffer-pair) pointer 10) - (decrement-elt-used (rpc-buffer-pair) int 11) - (sync (rpc-buffer-pair symbol) int 12) - (check-busy (rpc-buffer-pair) symbol 13) - (pop-last-received (rpc-buffer-pair) pointer 14) + (new (symbol type uint uint int) rpc-buffer-pair) ;; 0 + (call (rpc-buffer-pair uint pointer uint) int) ;; 9 + (add-element (rpc-buffer-pair) pointer) ;; 10 + (decrement-elt-used (rpc-buffer-pair) int) ;; 11 + (sync (rpc-buffer-pair symbol) int) ;; 12 + (check-busy (rpc-buffer-pair) symbol) ;; 13 + (pop-last-received (rpc-buffer-pair) pointer) ;; 14 ) ) @@ -16082,18 +16078,18 @@ :flag-assert #x1500000024 (:methods (new (symbol type process symbol float) _type_) - (debug-draw (_type_) none 9) - (eval-path-curve-div! (_type_ vector float symbol) vector 10) - (get-random-point (_type_ vector) vector 11) - (path-control-method-12 (_type_ vector float) vector 12) - (eval-path-curve! (_type_ vector float symbol) vector 13) - (path-control-method-14 (_type_ vector float) vector 14) - (length-as-float (_type_) float 15) - (path-distance (_type_) float 16) - (get-num-verts (_type_) int 17) - (should-display? (_type_) symbol 18) - (path-control-method-19 (_type_) float 19) - (path-control-method-20 (_type_) float 20) + (debug-draw (_type_) none) ;; 9 + (eval-path-curve-div! (_type_ vector float symbol) vector) ;; 10 + (get-random-point (_type_ vector) vector) ;; 11 + (path-control-method-12 (_type_ vector float) vector) ;; 12 + (eval-path-curve! (_type_ vector float symbol) vector) ;; 13 + (path-control-method-14 (_type_ vector float) vector) ;; 14 + (length-as-float (_type_) float) ;; 15 + (path-distance (_type_) float) ;; 16 + (get-num-verts (_type_) int) ;; 17 + (should-display? (_type_) symbol) ;; 18 + (path-control-method-19 (_type_) float) ;; 19 + (path-control-method-20 (_type_) float) ;; 20 ) ) @@ -16255,41 +16251,41 @@ :size-assert #xcc :flag-assert #x1e000000cc (:methods - (tri-centroid-world (_type_ nav-poly vector) vector 9) ;; finds the centroid of the given triangle, in the "world" coordinate system. - (tri-centroid-local (_type_ nav-poly vector) vector 10) ;; finds the centroid of the given triangle, in the local nav-mesh coordinate system. - (get-adj-poly (_type_ nav-poly nav-poly symbol) nav-poly 11) - (setup-portal (_type_ nav-poly nav-poly nav-route-portal) object 12) ;; sets up a portal between two polys. - (initialize-mesh! (_type_) none 13) - (move-along-nav-ray! (_type_ nav-ray) none 14) ;; think this updates the current position in a nav-ray, and updates which triangle you're in. + (tri-centroid-world (_type_ nav-poly vector) vector) ;; 9 ;; finds the centroid of the given triangle, in the "world" coordinate system. + (tri-centroid-local (_type_ nav-poly vector) vector) ;; 10 ;; finds the centroid of the given triangle, in the local nav-mesh coordinate system. + (get-adj-poly (_type_ nav-poly nav-poly symbol) nav-poly) ;; 11 + (setup-portal (_type_ nav-poly nav-poly nav-route-portal) object) ;; 12 ;; sets up a portal between two polys. + (initialize-mesh! (_type_) none) ;; 13 + (move-along-nav-ray! (_type_ nav-ray) none) ;; 14 ;; think this updates the current position in a nav-ray, and updates which triangle you're in. ;; this takes in a point/direction/distance, and see what would happen if you tried to move this way. ;; it returns the distance you can go before one of these happens: ;; - you reach the destination ;; - you hit a nav mesh boundary/gap ;; - you cross 15 triangles. - (try-move-along-ray (_type_ nav-poly vector vector float) meters 15) - (nav-mesh-method-16 (_type_ vector nav-poly vector symbol float clip-travel-vector-to-mesh-return-info) none 16) - (update-route-table (_type_) none 17) ;; (initialization related) - (nav-mesh-method-18 (_type_ int vector int (pointer int8) int) none 18) ;; something to do with routes. - (compute-bounding-box (_type_ vector vector) none 19) - (debug-draw-poly (_type_ nav-poly rgba) none 20) ;; TODO - is rgba a vector4w? - (point-in-poly? (_type_ nav-poly vector) symbol 21) ;; is the point inside of the triangle? - (find-opposite-vertices (_type_ nav-poly nav-poly) uint 22) ;; given two triangles that share an edge, get the indices of the two vertices that aren't part of the edge. - (nav-mesh-method-23 (_type_ nav-poly vector vector vector nav-route-portal) vector 23) - (closest-point-on-boundary (_type_ nav-poly vector vector) vector 24) ;; find the closest point on the perimeter of the triangle. - (project-point-into-tri-3d (_type_ nav-poly vector vector) none 25) ;; will move a 3D point in space to the surface of this nav-poly + (try-move-along-ray (_type_ nav-poly vector vector float) meters) ;; 15 + (nav-mesh-method-16 (_type_ vector nav-poly vector symbol float clip-travel-vector-to-mesh-return-info) none) ;; 16 + (update-route-table (_type_) none) ;; 17 ;; (initialization related) + (nav-mesh-method-18 (_type_ int vector int (pointer int8) int) none) ;; 18 ;; something to do with routes. + (compute-bounding-box (_type_ vector vector) none) ;; 19 + (debug-draw-poly (_type_ nav-poly rgba) none) ;; 20 ;; TODO - is rgba a vector4w? + (point-in-poly? (_type_ nav-poly vector) symbol) ;; 21 ;; is the point inside of the triangle? + (find-opposite-vertices (_type_ nav-poly nav-poly) uint) ;; 22 ;; given two triangles that share an edge, get the indices of the two vertices that aren't part of the edge. + (nav-mesh-method-23 (_type_ nav-poly vector vector vector nav-route-portal) vector) ;; 23 + (closest-point-on-boundary (_type_ nav-poly vector vector) vector) ;; 24 ;; find the closest point on the perimeter of the triangle. + (project-point-into-tri-3d (_type_ nav-poly vector vector) none) ;; 25 ;; will move a 3D point in space to the surface of this nav-poly ;; Looking from the top down, is the point inside the nav-poly? ;; - if the point is inside the triangle, returns that point. ;; - if the point is outside the triangle, move it to the closest point (will be on the edge) - (project-point-into-tri-2d (_type_ nav-poly vector vector) vector 26) + (project-point-into-tri-2d (_type_ nav-poly vector vector) vector) ;; 26 ;; finds which triangle the given point is in. ;; also has some caching stuff so if you look up the same point multiple times, it won't redo the work. ;; I _think_ this is only an approximate check that may return #f even if you are inside. ;; But, if it returns a poly, it will be right. - (find-poly-fast (_type_ vector meters) nav-poly 27) - (find-poly (_type_ vector meters (pointer nav-control-flags)) nav-poly 28) ;; The accurate version of find-poly (tries find-poly-fast first) + (find-poly-fast (_type_ vector meters) nav-poly) ;; 27 + (find-poly (_type_ vector meters (pointer nav-control-flags)) nav-poly) ;; 28 ;; The accurate version of find-poly (tries find-poly-fast first) ;; checks to see if the triangle is in the mesh or not. ;; not sure why it's separate from 27 (and such a different implementation). there might be some details I'm missing here. - (is-in-mesh? (_type_ vector float meters) symbol 29) + (is-in-mesh? (_type_ vector float meters) symbol) ;; 29 ) ) @@ -16345,33 +16341,33 @@ :flag-assert #x24000000e0 (:methods (new (symbol type collide-shape int float) _type_) - (debug-draw (_type_) none 9) - (point-in-bounds? (_type_ vector) symbol 10) - (nav-control-method-11 (_type_ vector) vector 11) - (nav-control-method-12 (_type_ nav-gap-info) symbol 12) - (nav-control-method-13 (_type_ vector vector) vector 13) ;; see - puffer::20 | second vector may be clip-travel-vector-to-mesh-return-info though - (set-current-poly! (_type_ nav-poly) none 14) - (set-target-pos! (_type_ vector) none 15) - (nav-control-method-16 (_type_ vector) nav-poly 16) ; see - nav-enemy-test-point-in-nav-mesh? - (project-onto-nav-mesh (_type_ vector vector) vector 17) ;; moves point to nav-mesh. - (find-poly (_type_ vector) nav-poly 18) - (nav-control-method-19 (_type_ vector collide-shape-moving vector float) none 19) ;; csm not trsqv? ret not vector? - (project-point-into-tri-3d (_type_ nav-poly vector vector) vector 20) - (nav-control-method-21 (_type_ vector) nav-poly 21) - (nav-control-method-22 (_type_ vector float) symbol 22) - (nav-control-method-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23) ;; TODO - unconfirmed maybe (nav-control-method-23 (_type_ vector matrix) float 23) - (nav-control-method-24 (_type_ float clip-travel-vector-to-mesh-return-info) none 24) - (is-in-mesh? (_type_ vector float) symbol 25) ; see - nav-enemy-test-point-near-nav-mesh? - (nav-control-method-26 (_type_) none 26) ;; stub - (nav-control-method-27 (_type_) none 27) - (nav-control-method-28 (_type_ collide-kind) none 28) - (should-display? (_type_) symbol 29) - (nav-control-method-30 (_type_ vector vector vector) sphere 30) ;; TODO - last arg? - it has a float as the first arg, vector is a total guess - (intersect-ray-line-segment? (_type_ vector vector vector vector) symbol 31) - (nav-control-method-32 (_type_ vector vector vector vector float) symbol 32) - (nav-control-method-33 (_type_ vector vector vector vector float) symbol 33) - (nav-control-method-34 () none 34) - (nav-control-method-35 (_type_ vector vector vector vector float) none 35) + (debug-draw (_type_) none) ;; 9 + (point-in-bounds? (_type_ vector) symbol) ;; 10 + (nav-control-method-11 (_type_ vector) vector) ;; 11 + (nav-control-method-12 (_type_ nav-gap-info) symbol) ;; 12 + (nav-control-method-13 (_type_ vector vector) vector) ;; 13 ;; see - puffer::20 | second vector may be clip-travel-vector-to-mesh-return-info though + (set-current-poly! (_type_ nav-poly) none) ;; 14 + (set-target-pos! (_type_ vector) none) ;; 15 + (nav-control-method-16 (_type_ vector) nav-poly) ;; 16 ; see - nav-enemy-test-point-in-nav-mesh? + (project-onto-nav-mesh (_type_ vector vector) vector) ;; 17 ;; moves point to nav-mesh. + (find-poly (_type_ vector) nav-poly) ;; 18 + (nav-control-method-19 (_type_ vector collide-shape-moving vector float) none) ;; 19 ;; csm not trsqv? ret not vector? + (project-point-into-tri-3d (_type_ nav-poly vector vector) vector) ;; 20 + (nav-control-method-21 (_type_ vector) nav-poly) ;; 21 + (nav-control-method-22 (_type_ vector float) symbol) ;; 22 + (nav-control-method-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float) ;; 23 ;; TODO - unconfirmed maybe (nav-control-method-23 (_type_ vector matrix) float) ;; 23 + (nav-control-method-24 (_type_ float clip-travel-vector-to-mesh-return-info) none) ;; 24 + (is-in-mesh? (_type_ vector float) symbol) ;; 25 ; see - nav-enemy-test-point-near-nav-mesh? + (nav-control-method-26 (_type_) none) ;; 26 ;; stub + (nav-control-method-27 (_type_) none) ;; 27 + (nav-control-method-28 (_type_ collide-kind) none) ;; 28 + (should-display? (_type_) symbol) ;; 29 + (nav-control-method-30 (_type_ vector vector vector) sphere) ;; 30 ;; TODO - last arg? - it has a float as the first arg, vector is a total guess + (intersect-ray-line-segment? (_type_ vector vector vector vector) symbol) ;; 31 + (nav-control-method-32 (_type_ vector vector vector vector float) symbol) ;; 32 + (nav-control-method-33 (_type_ vector vector vector vector float) symbol) ;; 33 + (nav-control-method-34 () none) ;; 34 + (nav-control-method-35 (_type_ vector vector vector vector float) none) ;; 35 ) ) @@ -16865,7 +16861,7 @@ (data sprite-vec-data-2d 1 :offset-assert 12) ;; likely 4-bytes each ) (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x10 @@ -16880,7 +16876,7 @@ ;(xy-array UNKNOWN 8 :offset-assert 0) ;(st-array UNKNOWN 4 :offset-assert 128) ;(xyz-array UNKNOWN 4 :offset-assert 192) - (hmge-scale vector :inline :offset 256) + (hmge-scale vector :inline :offset-assert 256) (consts vector :inline :offset-assert 272 :score -100.) (pfog0 float :offset 272) (deg-to-rad float :offset 276) @@ -18203,13 +18199,13 @@ :size-assert #x18 :flag-assert #x1000000018 (:methods - (get-task (_type_) game-task 9) - (get-status (_type_) task-status 10) - (task-available? (_type_ task-control) symbol 11) - (closed? (_type_) symbol 12) - (closed-by-default? (_type_) symbol 13) - (close-task! (_type_) int 14) - (open-task! (_type_) int 15) + (get-task (_type_) game-task) ;; 9 + (get-status (_type_) task-status) ;; 10 + (task-available? (_type_ task-control) symbol) ;; 11 + (closed? (_type_) symbol) ;; 12 + (closed-by-default? (_type_) symbol) ;; 13 + (close-task! (_type_) int) ;; 14 + (open-task! (_type_) int) ;; 15 ) ) @@ -18221,16 +18217,16 @@ :size-assert #xc :flag-assert #x130000000c (:methods - (current-task (_type_) game-task 9) - (current-status (_type_) task-status 10) - (close-current! (_type_) game-task 11) - (close-status! (_type_ task-status) game-task 12) - (first-any (_type_ symbol) game-task 13) - (reset! (_type_ symbol symbol) int 14) - (closed? (_type_ game-task task-status) symbol 15) - (get-reminder (_type_ int) int 16) - (save-reminder (_type_ int int) int 17) ;; TODO - i believe this is none - (exists? (_type_ game-task task-status) symbol 18) + (current-task (_type_) game-task) ;; 9 + (current-status (_type_) task-status) ;; 10 + (close-current! (_type_) game-task) ;; 11 + (close-status! (_type_ task-status) game-task) ;; 12 + (first-any (_type_ symbol) game-task) ;; 13 + (reset! (_type_ symbol symbol) int) ;; 14 + (closed? (_type_ game-task task-status) symbol) ;; 15 + (get-reminder (_type_ int) int) ;; 16 + (save-reminder (_type_ int int) int) ;; 17 ;; TODO - i believe this is none + (exists? (_type_ game-task task-status) symbol) ;; 18 ) ) @@ -18244,14 +18240,14 @@ :flag-assert #xc00000010 :pack-me (:methods - (ambient-control-method-9 (_type_) none 9) - (ambient-control-method-10 (_type_ vector time-frame float process-drawable) vector 10) - (play-ambient (_type_ string symbol vector) symbol 11) + (ambient-control-method-9 (_type_) none) ;; 9 + (ambient-control-method-10 (_type_ vector time-frame float process-drawable) vector) ;; 10 + (play-ambient (_type_ string symbol vector) symbol) ;; 11 ) ) (deftype process-taskable (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (tasks task-control :offset-assert 176) (query gui-query :inline :offset-assert 180) (old-target-pos transformq :inline :offset-assert 208) @@ -18283,39 +18279,39 @@ :size-assert #x17c :flag-assert #x350110017c (:methods - (release () _type_ :state 20) - (give-cell () _type_ :state 21) ;; state - (lose () _type_ :state 22) - (enter-playing () _type_ :state 23) ;; state - (play-accept () _type_ :state 24) ;; state - (play-reject () _type_ :state 25) - (query () _type_ :state 26) ;; state - (play-anim () _type_ :state 27) ;; state - (hidden () _type_ :state 28) ;; state - (be-clone (handle) _type_ :state 29) - (idle () _type_ :state 30) ;; state - (get-art-elem (_type_) art-element 31) - (play-anim! (_type_ symbol) basic 32) ;; ret - spool-anim | .. - (process-taskable-method-33 (_type_) none 33) - (get-accept-anim (_type_ symbol) spool-anim 34) - (push-accept-anim (_type_) none 35) - (get-reject-anim (_type_ symbol) spool-anim 36) ;; ret - spool-anim | .. - (push-reject-anim (_type_) none 37) - (process-taskable-method-38 (_type_) none 38) - (should-display? (_type_) symbol 39) - (process-taskable-method-40 (_type_ object skeleton-group int int vector int) none 40) - (initialize-collision (_type_ int vector) none 41) - (process-taskable-method-42 (_type_) none 42) - (process-taskable-method-43 (_type_) symbol 43) - (play-reminder (_type_) symbol 44) - (process-taskable-method-45 (_type_) symbol 45) - (process-taskable-method-46 (_type_) none 46) - (target-above-threshold? (_type_) symbol 47) - (draw-npc-shadow (_type_) none 48) - (hidden-other () _type_ :state 49) - (process-taskable-method-50 (_type_) symbol 50) - (close-anim-file! (_type_) symbol 51) - (process-taskable-method-52 (_type_) none 52) + (release () _type_ :state) ;; 20 + (give-cell () _type_ :state) ;; 21 ;; state + (lose () _type_ :state) ;; 22 + (enter-playing () _type_ :state) ;; 23 ;; state + (play-accept () _type_ :state) ;; 24 ;; state + (play-reject () _type_ :state) ;; 25 + (query () _type_ :state) ;; 26 ;; state + (play-anim () _type_ :state) ;; 27 ;; state + (hidden () _type_ :state) ;; 28 ;; state + (be-clone (handle) _type_ :state) ;; 29 + (idle () _type_ :state) ;; 30 ;; state + (get-art-elem (_type_) art-element) ;; 31 + (play-anim! (_type_ symbol) basic) ;; 32 ;; ret - spool-anim | .. + (process-taskable-method-33 (_type_) none) ;; 33 + (get-accept-anim (_type_ symbol) spool-anim) ;; 34 + (push-accept-anim (_type_) none) ;; 35 + (get-reject-anim (_type_ symbol) spool-anim) ;; 36 ;; ret - spool-anim | .. + (push-reject-anim (_type_) none) ;; 37 + (process-taskable-method-38 (_type_) none) ;; 38 + (should-display? (_type_) symbol) ;; 39 + (process-taskable-method-40 (_type_ object skeleton-group int int vector int) none) ;; 40 + (initialize-collision (_type_ int vector) none) ;; 41 + (process-taskable-method-42 (_type_) none) ;; 42 + (process-taskable-method-43 (_type_) symbol) ;; 43 + (play-reminder (_type_) symbol) ;; 44 + (process-taskable-method-45 (_type_) symbol) ;; 45 + (process-taskable-method-46 (_type_) none) ;; 46 + (target-above-threshold? (_type_) symbol) ;; 47 + (draw-npc-shadow (_type_) none) ;; 48 + (hidden-other () _type_ :state) ;; 49 + (process-taskable-method-50 (_type_) symbol) ;; 50 + (close-anim-file! (_type_) symbol) ;; 51 + (process-taskable-method-52 (_type_) none) ;; 52 ) ) @@ -18452,10 +18448,10 @@ :size-assert #x50 :flag-assert #xc00000050 (:methods - (new (symbol type int) _type_ 0) - (save-to-file (_type_ string) _type_ 9) - (load-from-file! (_type_ string) _type_ 10) - (debug-print (_type_ symbol) _type_ 11) + (new (symbol type int) _type_) ;; 0 + (save-to-file (_type_ string) _type_) ;; 9 + (load-from-file! (_type_ string) _type_) ;; 10 + (debug-print (_type_ symbol) _type_) ;; 11 ) ) @@ -18478,15 +18474,15 @@ :flag-assert #x17016001cc ;; inherited inspect of process (:methods - (get-heap () _type_ :state 14) - (get-card () _type_ :state 15) - (format-card () _type_ :state 16) - (create-file () _type_ :state 17) - (save () _type_ :state 18) - (restore () _type_ :state 19) - (error (mc-status-code) _type_ :state 20) - (done () _type_ :state 21) - (unformat-card () _type_ :state 22) + (get-heap () _type_ :state) ;; 14 + (get-card () _type_ :state) ;; 15 + (format-card () _type_ :state) ;; 16 + (create-file () _type_ :state) ;; 17 + (save () _type_ :state) ;; 18 + (restore () _type_ :state) ;; 19 + (error (mc-status-code) _type_ :state) ;; 20 + (done () _type_ :state) ;; 21 + (unformat-card () _type_ :state) ;; 22 ) ) @@ -19144,7 +19140,7 @@ (data2 lbvtx :dynamic :inline :offset 64) ) (:methods - (new (symbol type int symbol symbol) _type_ 0) + (new (symbol type int symbol symbol) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x50 @@ -19655,15 +19651,15 @@ :size-assert #x11c :flag-assert #x110000011c (:methods - (new (symbol type process int float float float) _type_ 0) - (water-control-method-9 (_type_) none 9) - (water-control-method-10 (_type_) none 10) - (start-bobbing! (_type_ float int int) none 11) - (distance-from-surface (_type_) float 12) - (create-splash (_type_ float vector int vector) none 13) - (display-water-marks? (_type_) symbol 14) - (water-control-method-15 (_type_) none 15) - (water-control-method-16 (_type_) none 16) + (new (symbol type process int float float float) _type_) ;; 0 + (water-control-method-9 (_type_) none) ;; 9 + (water-control-method-10 (_type_) none) ;; 10 + (start-bobbing! (_type_ float int int) none) ;; 11 + (distance-from-surface (_type_) float) ;; 12 + (create-splash (_type_ float vector int vector) none) ;; 13 + (display-water-marks? (_type_) symbol) ;; 14 + (water-control-method-15 (_type_) none) ;; 15 + (water-control-method-16 (_type_) none) ;; 16 ) ) @@ -19682,16 +19678,16 @@ :flag-assert #x1e007000d4 ;; inherited inspect of process-drawable (:methods - (water-vol-idle () _type_ :state 20) - (water-vol-startup () _type_ :state 21) - (water-vol-method-22 (_type_) none 22) ;; can also return an obs? - (reset-root! (_type_) none 23) - (set-stack-size! (_type_) none 24) - (water-vol-method-25 (_type_) none 25) - (update! (_type_) none 26) - (on-exit-water (_type_) none 27) - (get-ripple-height (_type_ vector) float 28) - (init! (_type_) none 29) + (water-vol-idle () _type_ :state) ;; 20 + (water-vol-startup () _type_ :state) ;; 21 + (water-vol-method-22 (_type_) none) ;; 22 ;; can also return an obs? + (reset-root! (_type_) none) ;; 23 + (set-stack-size! (_type_) none) ;; 24 + (water-vol-method-25 (_type_) none) ;; 25 + (update! (_type_) none) ;; 26 + (on-exit-water (_type_) none) ;; 27 + (get-ripple-height (_type_ vector) float) ;; 28 + (init! (_type_) none) ;; 29 ) ) @@ -20088,9 +20084,9 @@ :size-assert #x18 :flag-assert #xc00000018 (:methods - (init-vol! (_type_ symbol vector-array vector-array) symbol 9) - (debug-draw (_type_) none 10) - (point-in-vol? (_type_ vector float) symbol 11) + (init-vol! (_type_ symbol vector-array vector-array) symbol) ;; 9 + (debug-draw (_type_) none) ;; 10 + (point-in-vol? (_type_ vector float) symbol) ;; 11 ) ) @@ -20145,10 +20141,10 @@ :size-assert #x61c :flag-assert #xc0000061c (:methods - (new (symbol type process-drawable) _type_ 0) - (init! (_type_) symbol 9) - (point-in-vol? (_type_ vector) symbol 10) - (vol-control-method-11 (_type_) symbol 11) + (new (symbol type process-drawable) _type_) ;; 0 + (init! (_type_) symbol) ;; 9 + (point-in-vol? (_type_ vector) symbol) ;; 10 + (vol-control-method-11 (_type_) symbol) ;; 11 ) ) @@ -20700,7 +20696,7 @@ ) (deftype launcher (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (spring-height meters :offset-assert 176) (camera state :offset-assert 180) (active-distance float :offset-assert 184) @@ -21021,9 +21017,9 @@ :heap-base #x80 :flag-assert #x17008000e8 (:methods - (enter () _type_ :state 20) - (idle () _type_ :state 21) - (exit () _type_ :state 22) + (enter () _type_ :state) ;; 20 + (idle () _type_ :state) ;; 21 + (exit () _type_ :state) ;; 22 ) ) @@ -21184,7 +21180,8 @@ :size-assert #x40 :flag-assert #x900000040 (:methods - (new (symbol type) _type_ 0)) + (new (symbol type) _type_) ;; 0 + ) ) (deftype debug-menu-node (basic) @@ -21210,7 +21207,8 @@ :size-assert #x28 :flag-assert #x900000028 (:methods - (new (symbol type debug-menu-context string) _type_ 0)) + (new (symbol type debug-menu-context string) _type_) ;; 0 + ) ) (deftype debug-menu-item (debug-menu-node) @@ -21228,7 +21226,8 @@ :size-assert #x1c :flag-assert #x90000001c (:methods - (new (symbol type string debug-menu) _type_ 0)) + (new (symbol type string debug-menu) _type_) ;; 0 + ) ) (defenum debug-menu-msg @@ -21247,7 +21246,8 @@ :size-assert #x1d :flag-assert #x90000001d (:methods - (new (symbol type string object (function object object)) _type_ 0)) + (new (symbol type string object (function object object)) _type_) ;; 0 + ) ) (deftype debug-menu-item-flag (debug-menu-item) @@ -21258,7 +21258,8 @@ :size-assert #x20 :flag-assert #x900000020 (:methods - (new (symbol type string object (function object debug-menu-msg object)) _type_ 0)) + (new (symbol type string object (function object debug-menu-msg object)) _type_) ;; 0 + ) ) @@ -21294,7 +21295,8 @@ :size-assert #x64 :flag-assert #x900000064 (:methods - (new (symbol type string int int) _type_ 0)) + (new (symbol type string int int) _type_) ;; 0 + ) ) ;; - Functions @@ -21775,7 +21777,7 @@ ) (deftype collectable (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (pickup-type pickup-type :offset-assert 176) (pickup-amount float :offset-assert 180) (notify-parent basic :offset-assert 184) @@ -21797,8 +21799,8 @@ :size-assert #x13c :flag-assert #x1600d0013c (:methods - (initialize (_type_) _type_ 20) - (initialize-params (_type_ time-frame float) none 21) + (initialize (_type_) _type_) ;; 20 + (initialize-params (_type_ time-frame float) none) ;; 21 ) ) @@ -21820,15 +21822,15 @@ :size-assert #x194 :flag-assert #x1f01300194 (:methods - (wait () _type_ :state 22) ;; state - (pickup (object handle) _type_ :state 23) ;; state - (die () _type_ :state 24) ;; state - (jump () _type_ :state 25) - (notice-blue (handle) _type_ :state 26) ;; state - (initialize-effect (_type_ pickup-type) none 27) - (initialize-eco (_type_ entity-actor pickup-type float) object 28) - (animate (_type_) none 29) - (blocked () _type_ :state 30) + (wait () _type_ :state) ;; 22 ;; state + (pickup (object handle) _type_ :state) ;; 23 ;; state + (die () _type_ :state) ;; 24 ;; state + (jump () _type_ :state) ;; 25 + (notice-blue (handle) _type_ :state) ;; 26 ;; state + (initialize-effect (_type_ pickup-type) none) ;; 27 + (initialize-eco (_type_ entity-actor pickup-type float) object) ;; 28 + (animate (_type_) none) ;; 29 + (blocked () _type_ :state) ;; 30 ) ) @@ -21912,7 +21914,7 @@ (declare-type vent process-drawable) (deftype ecovalve (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (offset vector :inline :offset-assert 176) (offset-target vector :inline :offset-assert 192) (block-func (function vent symbol) :offset-assert 208) @@ -21926,7 +21928,7 @@ ) (deftype vent (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (show-particles symbol :offset-assert 176) (collect-effect sparticle-launch-group :offset-assert 180) (collect-effect2 sparticle-launch-group :offset-assert 184) @@ -21940,7 +21942,7 @@ :size-assert #xd8 :flag-assert #x15007000d8 (:methods - (initialize (_type_ entity-actor pickup-type) none 20) + (initialize (_type_ entity-actor pickup-type) none) ;; 20 ) (:states vent-blocked @@ -22112,7 +22114,7 @@ ) (deftype crate (process-drawable) - ((root-override collide-shape-moving :score 20 :offset 112) + ((root collide-shape-moving :override) (smush smush-control :inline :offset-assert 176) (base vector :inline :offset-assert 208) (look symbol :offset-assert 224) @@ -22128,16 +22130,16 @@ :flag-assert #x1e00900100 ;; inherited inspect of process-drawable (:methods - (wait () _type_ :state 20) ;; state - (die (symbol int) _type_ :state 21) - (special-contents-die () _type_ :state 22) - (bounce-on () _type_ :state 23) ;; state - (notice-blue (handle) _type_ :state 24) - (params-init (_type_ entity) none 25) - (art-init (_type_) crate 26) - (params-set! (_type_ symbol symbol) none 27) - (check-dead (_type_) none 28) - (smush-update! (_type_) none 29) + (wait () _type_ :state) ;; 20 ;; state + (die (symbol int) _type_ :state) ;; 21 + (special-contents-die () _type_ :state) ;; 22 + (bounce-on () _type_ :state) ;; 23 ;; state + (notice-blue (handle) _type_ :state) ;; 24 + (params-init (_type_ entity) none) ;; 25 + (art-init (_type_) crate) ;; 26 + (params-set! (_type_ symbol symbol) none) ;; 27 + (check-dead (_type_) none) ;; 28 + (smush-update! (_type_) none) ;; 29 ) ) @@ -22879,7 +22881,7 @@ :size-assert #x90 :flag-assert #x900000090 (:methods - (new (symbol type int string basic) _type_ 0) + (new (symbol type int string basic) _type_) ;; 0 ) ) @@ -22894,7 +22896,7 @@ :size-assert #x78 :flag-assert #x900000078 (:methods - (new (symbol type int string) _type_ 0) + (new (symbol type int string) _type_) ;; 0 ) ) @@ -22912,7 +22914,7 @@ :size-assert #x2c :flag-assert #x90000002c (:methods - (new (symbol type int string) _type_ 0) + (new (symbol type int string) _type_) ;; 0 ) ) @@ -23157,20 +23159,20 @@ :size-assert #x1a8 :flag-assert #x17000001a8 (:methods - (rigid-body-method-9 (_type_ float float float float) none 9) - (rigid-body-method-10 (_type_ float) none 10) - (clear-force-torque! (_type_) none 11) - (clear-momentum! (_type_) none 12) - (rigid-body-method-13 (_type_ vector vector) none 13) - (rigid-body-method-14 (_type_ vector vector) none 14) - (rigid-body-method-15 (_type_ vector) none 15) - (rigid-body-method-16 (_type_ vector vector float) none 16) - (rigid-body-method-17 (_type_ vector vector) vector 17) - (rigid-body-method-18 (_type_ vector) vector 18) - (print-stats (_type_) none 19) - (rigid-body-method-20 (_type_) none 20) - (rigid-body-method-21 (_type_) none 21) - (rigid-body-method-22 (_type_ vector quaternion float float) none 22) + (rigid-body-method-9 (_type_ float float float float) none) ;; 9 + (rigid-body-method-10 (_type_ float) none) ;; 10 + (clear-force-torque! (_type_) none) ;; 11 + (clear-momentum! (_type_) none) ;; 12 + (rigid-body-method-13 (_type_ vector vector) none) ;; 13 + (rigid-body-method-14 (_type_ vector vector) none) ;; 14 + (rigid-body-method-15 (_type_ vector) none) ;; 15 + (rigid-body-method-16 (_type_ vector vector float) none) ;; 16 + (rigid-body-method-17 (_type_ vector vector) vector) ;; 17 + (rigid-body-method-18 (_type_ vector) vector) ;; 18 + (print-stats (_type_) none) ;; 19 + (rigid-body-method-20 (_type_) none) ;; 20 + (rigid-body-method-21 (_type_) none) ;; 21 + (rigid-body-method-22 (_type_ vector quaternion float float) none) ;; 22 ) ) @@ -23364,21 +23366,21 @@ :flag-assert #x23027002d4 ;; inherited inspect of process-drawable (:methods - (rigid-body-platform-idle () _type_ :state 20) - (rigid-body-platform-float () _type_ :state 21) - (rigid-body-platform-method-22 (_type_ vector float) float 22) - (rigid-body-platform-method-23 (_type_ float) none 23) - (rigid-body-platform-method-24 (_type_ rigid-body-control-point float) none 24) - (rigid-body-platform-method-25 (_type_) none 25) - (rigid-body-platform-method-26 (_type_) none 26) - (rigid-body-platform-method-27 (_type_ vector) none 27) - (rigid-body-platform-method-28 (_type_) none 28) - (rigid-body-platform-method-29 (_type_ rigid-body-platform-constants) none 29) - (rigid-body-platform-method-30 (_type_) none 30) - (rigid-body-platform-method-31 (_type_) none 31) - (rigid-body-platform-method-32 (_type_) sound-id 32) - (rigid-body-platform-method-33 (_type_) object 33) - (rigid-body-platform-method-34 (_type_) none 34) + (rigid-body-platform-idle () _type_ :state) ;; 20 + (rigid-body-platform-float () _type_ :state) ;; 21 + (rigid-body-platform-method-22 (_type_ vector float) float) ;; 22 + (rigid-body-platform-method-23 (_type_ float) none) ;; 23 + (rigid-body-platform-method-24 (_type_ rigid-body-control-point float) none) ;; 24 + (rigid-body-platform-method-25 (_type_) none) ;; 25 + (rigid-body-platform-method-26 (_type_) none) ;; 26 + (rigid-body-platform-method-27 (_type_ vector) none) ;; 27 + (rigid-body-platform-method-28 (_type_) none) ;; 28 + (rigid-body-platform-method-29 (_type_ rigid-body-platform-constants) none) ;; 29 + (rigid-body-platform-method-30 (_type_) none) ;; 30 + (rigid-body-platform-method-31 (_type_) none) ;; 31 + (rigid-body-platform-method-32 (_type_) sound-id) ;; 32 + (rigid-body-platform-method-33 (_type_) object) ;; 33 + (rigid-body-platform-method-34 (_type_) none) ;; 34 ) ) @@ -23530,62 +23532,62 @@ :size-assert #x190 :flag-assert #x4c01200190 (:methods - (nav-enemy-attack () _type_ :state 20) - (nav-enemy-chase () _type_ :state 21) - (nav-enemy-flee () _type_ :state 22) - (nav-enemy-die () _type_ :state 23) - (nav-enemy-fuel-cell () _type_ :state 24) - (nav-enemy-give-up () _type_ :state 25) - (nav-enemy-jump () _type_ :state 26) - (nav-enemy-jump-land () _type_ :state 27) - (nav-enemy-idle () _type_ :state 28) - (nav-enemy-notice () _type_ :state 29) - (nav-enemy-patrol () _type_ :state 30) - (nav-enemy-stare () _type_ :state 31) - (nav-enemy-stop-chase () _type_ :state 32) - (nav-enemy-victory () _type_ :state 33) - (nav-enemy-method-34 (_type_) none 34) - (nav-enemy-wait-for-cue () _type_ :state 35) - (nav-enemy-jump-to-point () _type_ :state 36) - (nav-enemy-method-37 (_type_) none 37) - (nav-enemy-method-38 (_type_) none 38) - (common-post (_type_) none 39) - (nav-enemy-method-40 (_type_) none 40) - (nav-enemy-method-41 (_type_) none 41) - (new-patrol-point! (_type_) int 42) - (attack-handler (_type_ process event-message-block) object 43) - (touch-handler (_type_ process event-message-block) object 44) - (init-defaults! (_type_ nav-enemy-info) none 45) - (target-in-range? (_type_ float) basic 46) - (initialize-collision (_type_) none 47) - (nav-enemy-method-48 (_type_) none 48) ;; object past to method 60 -- see citb-bunny - (init-jm! (_type_ nav-enemy-info) float 49) - (nav-enemy-method-50 (_type_ vector) symbol 50) - (nav-enemy-method-51 (_type_) none 51) ;; ret - float | symbol - (nav-enemy-method-52 (_type_ vector) symbol 52) ;; ret - symbol | vector - (nav-enemy-method-53 (_type_) symbol 53) ;; ret - symbol | none - (nav-enemy-method-54 (_type_ vector) symbol 54) - (nav-enemy-method-55 (_type_) symbol 55) - (set-jump-height-factor! (_type_ int) none 56) - (nav-enemy-method-57 (_type_) none 57) - (nav-enemy-method-58 (_type_) none 58) - (nav-enemy-method-59 (_type_) none 59) - (nav-enemy-method-60 (_type_ symbol) symbol 60) - (snow-bunny-attack () _type_ :state 61) - (snow-bunny-chase-hop () _type_ :state 62) - (snow-bunny-defend () _type_ :state 63) - (nav-enemy-method-64 () _type_ :state 64) - (snow-bunny-lunge () _type_ :state 65) - (snow-bunny-nav-resume () _type_ :state 66) - (snow-bunny-patrol-hop () _type_ :state 67) - (snow-bunny-patrol-idle () _type_ :state 68) - (nav-enemy-method-69 () _type_ :state 69) - (snow-bunny-retreat-hop () _type_ :state 70) - (snow-bunny-tune-spheres () _type_ :state 71) - (nav-enemy-touch-handler (_type_ process event-message-block) object 72) - (nav-enemy-attack-handler (_type_ process event-message-block) object 73) - (nav-enemy-jump-blocked () _type_ :state 74) - (nav-enemy-method-75 () _type_ :state 75) + (nav-enemy-attack () _type_ :state) ;; 20 + (nav-enemy-chase () _type_ :state) ;; 21 + (nav-enemy-flee () _type_ :state) ;; 22 + (nav-enemy-die () _type_ :state) ;; 23 + (nav-enemy-fuel-cell () _type_ :state) ;; 24 + (nav-enemy-give-up () _type_ :state) ;; 25 + (nav-enemy-jump () _type_ :state) ;; 26 + (nav-enemy-jump-land () _type_ :state) ;; 27 + (nav-enemy-idle () _type_ :state) ;; 28 + (nav-enemy-notice () _type_ :state) ;; 29 + (nav-enemy-patrol () _type_ :state) ;; 30 + (nav-enemy-stare () _type_ :state) ;; 31 + (nav-enemy-stop-chase () _type_ :state) ;; 32 + (nav-enemy-victory () _type_ :state) ;; 33 + (nav-enemy-method-34 (_type_) none) ;; 34 + (nav-enemy-wait-for-cue () _type_ :state) ;; 35 + (nav-enemy-jump-to-point () _type_ :state) ;; 36 + (nav-enemy-method-37 (_type_) none) ;; 37 + (nav-enemy-method-38 (_type_) none) ;; 38 + (common-post (_type_) none) ;; 39 + (nav-enemy-method-40 (_type_) none) ;; 40 + (nav-enemy-method-41 (_type_) none) ;; 41 + (new-patrol-point! (_type_) int) ;; 42 + (attack-handler (_type_ process event-message-block) object) ;; 43 + (touch-handler (_type_ process event-message-block) object) ;; 44 + (init-defaults! (_type_ nav-enemy-info) none) ;; 45 + (target-in-range? (_type_ float) basic) ;; 46 + (initialize-collision (_type_) none) ;; 47 + (nav-enemy-method-48 (_type_) none) ;; 48 ;; object past to method 60 -- see citb-bunny + (init-jm! (_type_ nav-enemy-info) float) ;; 49 + (nav-enemy-method-50 (_type_ vector) symbol) ;; 50 + (nav-enemy-method-51 (_type_) none) ;; 51 ;; ret - float | symbol + (nav-enemy-method-52 (_type_ vector) symbol) ;; 52 ;; ret - symbol | vector + (nav-enemy-method-53 (_type_) symbol) ;; 53 ;; ret - symbol | none + (nav-enemy-method-54 (_type_ vector) symbol) ;; 54 + (nav-enemy-method-55 (_type_) symbol) ;; 55 + (set-jump-height-factor! (_type_ int) none) ;; 56 + (nav-enemy-method-57 (_type_) none) ;; 57 + (nav-enemy-method-58 (_type_) none) ;; 58 + (nav-enemy-method-59 (_type_) none) ;; 59 + (nav-enemy-method-60 (_type_ symbol) symbol) ;; 60 + (snow-bunny-attack () _type_ :state) ;; 61 + (snow-bunny-chase-hop () _type_ :state) ;; 62 + (snow-bunny-defend () _type_ :state) ;; 63 + (nav-enemy-method-64 () _type_ :state) ;; 64 + (snow-bunny-lunge () _type_ :state) ;; 65 + (snow-bunny-nav-resume () _type_ :state) ;; 66 + (snow-bunny-patrol-hop () _type_ :state) ;; 67 + (snow-bunny-patrol-idle () _type_ :state) ;; 68 + (nav-enemy-method-69 () _type_ :state) ;; 69 + (snow-bunny-retreat-hop () _type_ :state) ;; 70 + (snow-bunny-tune-spheres () _type_ :state) ;; 71 + (nav-enemy-touch-handler (_type_ process event-message-block) object) ;; 72 + (nav-enemy-attack-handler (_type_ process event-message-block) object) ;; 73 + (nav-enemy-jump-blocked () _type_ :state) ;; 74 + (nav-enemy-method-75 () _type_ :state) ;; 75 ) ) @@ -23661,7 +23663,7 @@ ;; - Types (deftype baseplat (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (smush smush-control :inline :offset-assert 176) (basetrans vector :inline :offset-assert 208) (bouncing symbol :offset-assert 224) @@ -23672,13 +23674,13 @@ :flag-assert #x1b008000e4 ;; inherited inspect of process-drawable (:methods - (baseplat-method-20 (_type_) none 20) - (baseplat-method-21 (_type_) none 21) - (baseplat-method-22 (_type_) none 22) - (get-unlit-skel (_type_) skeleton-group 23) - (baseplat-method-24 (_type_) none 24) - (baseplat-method-25 (_type_) sparticle-launch-group 25) - (baseplat-method-26 (_type_) none 26) + (baseplat-method-20 (_type_) none) ;; 20 + (baseplat-method-21 (_type_) none) ;; 21 + (baseplat-method-22 (_type_) none) ;; 22 + (get-unlit-skel (_type_) skeleton-group) ;; 23 + (baseplat-method-24 (_type_) none) ;; 24 + (baseplat-method-25 (_type_) sparticle-launch-group) ;; 25 + (baseplat-method-26 (_type_) none) ;; 26 ) ) @@ -23720,7 +23722,7 @@ ) (deftype eco-door (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (speed float :offset-assert 176) (open-distance float :offset-assert 180) (close-distance float :offset-assert 184) @@ -23739,13 +23741,13 @@ :flag-assert #x1b00a00104 ;; inherited inspect of process-drawable (:methods - (door-closed () _type_ :state 20) - (door-opening () _type_ :state 21) - (door-open () _type_ :state 22) - (door-closing () _type_ :state 23) - (eco-door-method-24 (_type_) none 24) - (eco-door-method-25 (_type_) none 25) - (eco-door-method-26 (_type_) none 26) + (door-closed () _type_ :state) ;; 20 + (door-opening () _type_ :state) ;; 21 + (door-open () _type_ :state) ;; 22 + (door-closing () _type_ :state) ;; 23 + (eco-door-method-24 (_type_) none) ;; 24 + (eco-door-method-25 (_type_) none) ;; 25 + (eco-door-method-26 (_type_) none) ;; 26 ) ) @@ -23767,7 +23769,7 @@ ;; - Types (deftype basebutton (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (down? symbol :offset-assert 176) (spawned-by-other? symbol :offset-assert 180) (move-to? symbol :offset-assert 184) @@ -23788,18 +23790,18 @@ :flag-assert #x2000900100 ;; inherited inspect of process-drawable (:methods - (basebutton-down-idle () _type_ :state 20) ;; state - (basebutton-going-down () _type_ :state 21) ;; state - (basebutton-going-up () _type_ :state 22) - (basebutton-startup () _type_ :state 23) - (basebutton-up-idle () _type_ :state 24) ;; state - (reset! (_type_) float 25) - (basebutton-method-26 (_type_) none 26) - (basebutton-method-27 (_type_) collide-shape-moving 27) - (arm-trigger-event! (_type_) symbol 28) - (basebutton-method-29 (_type_ symbol entity) none 29) - (move-to-vec-or-quat! (_type_ vector quaternion) quaternion 30) ;; args are optional - (press! (_type_ symbol) int 31) + (basebutton-down-idle () _type_ :state) ;; 20 ;; state + (basebutton-going-down () _type_ :state) ;; 21 ;; state + (basebutton-going-up () _type_ :state) ;; 22 + (basebutton-startup () _type_ :state) ;; 23 + (basebutton-up-idle () _type_ :state) ;; 24 ;; state + (reset! (_type_) float) ;; 25 + (basebutton-method-26 (_type_) none) ;; 26 + (basebutton-method-27 (_type_) collide-shape-moving) ;; 27 + (arm-trigger-event! (_type_) symbol) ;; 28 + (basebutton-method-29 (_type_ symbol entity) none) ;; 29 + (move-to-vec-or-quat! (_type_ vector quaternion) quaternion) ;; 30 ;; args are optional + (press! (_type_ symbol) int) ;; 31 ) ) @@ -23814,10 +23816,10 @@ :heap-base #x50 :flag-assert #x18005000c0 (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (use (int level) _type_ :state 22) - (hidden () _type_ :state 23) + (idle () _type_ :state) ;; 20 + (active () _type_ :state) ;; 21 + (use (int level) _type_ :state) ;; 22 + (hidden () _type_ :state) ;; 23 ) ) @@ -23852,8 +23854,8 @@ :size-assert #x3c :flag-assert #xb0000003c (:methods - (reset! (_type_ process-drawable float float) none 9) - (tippy-method-10 (_type_ process-drawable vector) symbol 10) + (reset! (_type_ process-drawable float float) none) ;; 9 + (tippy-method-10 (_type_ process-drawable vector) symbol) ;; 10 ) ) @@ -23880,7 +23882,7 @@ (away-from-rand-transv-y-hi float :offset 60) ) (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x40 @@ -23927,7 +23929,8 @@ :size-assert #x10 :flag-assert #x900000010 (:methods - (new (symbol type joint-exploder-static-params) _type_ 0)) + (new (symbol type joint-exploder-static-params) _type_) ;; 0 + ) ) (deftype joint-exploder-list (structure) @@ -23957,15 +23960,15 @@ :heap-base #x1a0 :flag-assert #x1d01a00210 (:methods - (joint-exploder-method-20 (_type_ joint-exploder-list int) int 20) - (joint-exploder-method-21 (_type_ joint-exploder-list joint-exploder-joint) none 21) - (joint-exploder-method-22 (_type_ joint-exploder-list) symbol 22) - (joint-exploder-method-23 (_type_) symbol 23) - (joint-exploder-method-24 (_type_ joint-exploder-list int) int 24) - (joint-exploder-method-25 (_type_ joint-exploder-list) symbol 25) - (joint-exploder-method-26 (_type_ joint-exploder-list int) int 26) - (joint-exploder-method-27 (_type_ joint-exploder-list int) joint-exploder-list 27) - (joint-exploder-method-28 (_type_ joint-exploder-list) none 28) + (joint-exploder-method-20 (_type_ joint-exploder-list int) int) ;; 20 + (joint-exploder-method-21 (_type_ joint-exploder-list joint-exploder-joint) none) ;; 21 + (joint-exploder-method-22 (_type_ joint-exploder-list) symbol) ;; 22 + (joint-exploder-method-23 (_type_) symbol) ;; 23 + (joint-exploder-method-24 (_type_ joint-exploder-list int) int) ;; 24 + (joint-exploder-method-25 (_type_ joint-exploder-list) symbol) ;; 25 + (joint-exploder-method-26 (_type_ joint-exploder-list int) int) ;; 26 + (joint-exploder-method-27 (_type_ joint-exploder-list int) joint-exploder-list) ;; 27 + (joint-exploder-method-28 (_type_ joint-exploder-list) none) ;; 28 ) (:states joint-exploder-shatter) @@ -24075,8 +24078,8 @@ :flag-assert #x1d045004c0 ;; inherited inspect of baseplat (:methods - (pos-logic (_type_ symbol) symbol 27) - (calculate-pos (_type_ symbol) none 28) + (pos-logic (_type_ symbol) symbol) ;; 27 + (calculate-pos (_type_ symbol) none) ;; 28 ) (:states (orb-cache-top-complete symbol) @@ -24109,12 +24112,12 @@ :flag-assert #x2100a00108 ;; inherited inspect of baseplat (:methods - (get-lit-skel (_type_) skeleton-group 27) - (plat-method-28 () none 28) - (wad () _type_ :state 29) - (plat-startup (plat) _type_ :state 30) ;; state - (plat-idle () _type_ :state 31) ;; state - (plat-path-active (plat) _type_ :state 32) ;; state + (get-lit-skel (_type_) skeleton-group) ;; 27 + (plat-method-28 () none) ;; 28 + (wad () _type_ :state) ;; 29 + (plat-startup (plat) _type_ :state) ;; 30 ;; state + (plat-idle () _type_ :state) ;; 31 ;; state + (plat-path-active (plat) _type_ :state) ;; 32 ;; state ) ) @@ -24134,7 +24137,7 @@ ;; - Types (deftype plat-button (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (go-back-if-lost-player? symbol :offset-assert 176) (grab-player? symbol :offset-assert 180) (should-grab-player? symbol :offset-assert 184) @@ -24151,19 +24154,19 @@ :flag-assert #x21008000f0 ;; inherited inspect of process-drawable (:methods - (plat-button-at-end () _type_ :state 20) ;; state - (plat-button-idle () _type_ :state 21) - (plat-button-pressed () _type_ :state 22) - (plat-button-move-downward () _type_ :state 23) - (plat-button-move-upward () _type_ :state 24) - (plat-button-teleport-to-other-end () _type_ :state 25) - (can-activate? (_type_) symbol 26) - (plat-button-method-27 (_type_) none 27) - (plat-button-method-28 (_type_) collide-shape-moving 28) - (can-target-move? (_type_) none 29) - (should-teleport? (_type_) symbol 30) - (plat-button-method-31 (_type_) none 31) ;; TODO - need to know super::14 - (plat-button-method-32 (_type_) none 32) + (plat-button-at-end () _type_ :state) ;; 20 ;; state + (plat-button-idle () _type_ :state) ;; 21 + (plat-button-pressed () _type_ :state) ;; 22 + (plat-button-move-downward () _type_ :state) ;; 23 + (plat-button-move-upward () _type_ :state) ;; 24 + (plat-button-teleport-to-other-end () _type_ :state) ;; 25 + (can-activate? (_type_) symbol) ;; 26 + (plat-button-method-27 (_type_) none) ;; 27 + (plat-button-method-28 (_type_) collide-shape-moving) ;; 28 + (can-target-move? (_type_) none) ;; 29 + (should-teleport? (_type_) symbol) ;; 30 + (plat-button-method-31 (_type_) none) ;; 31 ;; TODO - need to know super::14 + (plat-button-method-32 (_type_) none) ;; 32 ) ) @@ -24199,7 +24202,7 @@ :heap-base #x100 :flag-assert #x2101000165 (:methods - (notice-blue (handle) _type_ :replace :state 29) + (notice-blue (handle) _type_ :overlay-at wad :state) ;; 29 ) ) @@ -24255,7 +24258,7 @@ ) (deftype ropebridge (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (subtype uint64 :offset-assert 176) (subtype-name string :offset-assert 184) (agitated-time-stamp time-frame :offset-assert 192) @@ -24275,15 +24278,15 @@ :heap-base #x7d0 :flag-assert #x1d07d00840 (:methods - (set-vel-from-impact (_type_ uint vector int float) none 20) - (set-vel-from-riders (_type_) none 21) ;; physics2 - (set-vel-from-rider (_type_ uint vector int) none 22) - (clear-spring-forces (_type_) none 23) ;; physics1 - (debug-draw (_type_) none 24) - (set-to-rest-state (_type_) none 25) - (add-collision-meshes (_type_) none 26) - (do-integration (_type_) none 27) ;; physics3 - (ropebridge-method-28 (_type_) none 28) + (set-vel-from-impact (_type_ uint vector int float) none) ;; 20 + (set-vel-from-riders (_type_) none) ;; 21 ;; physics2 + (set-vel-from-rider (_type_ uint vector int) none) ;; 22 + (clear-spring-forces (_type_) none) ;; 23 ;; physics1 + (debug-draw (_type_) none) ;; 24 + (set-to-rest-state (_type_) none) ;; 25 + (add-collision-meshes (_type_) none) ;; 26 + (do-integration (_type_) none) ;; 27 ;; physics3 + (ropebridge-method-28 (_type_) none) ;; 28 ) (:states ropebridge-idle) @@ -24326,9 +24329,9 @@ :size-assert #x20 :flag-assert #xc00000020 (:methods - (sleep (_type_ time-frame) none 9) - (reached-delay? (_type_ time-frame) symbol 10) - (completed? (_type_) symbol 11) + (sleep (_type_ time-frame) none) ;; 9 + (reached-delay? (_type_ time-frame) symbol) ;; 10 + (completed? (_type_) symbol) ;; 11 ) ) @@ -24353,7 +24356,7 @@ ) (deftype mistycannon-missile (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (muzzle-time float :offset-assert 176) (tumble-quat quaternion :inline :offset-assert 192) (blast-radius float :offset-assert 208) @@ -24367,7 +24370,7 @@ :heap-base #x80 :flag-assert #x15008000e8 (:methods - (spawn-part (_type_) none 20) + (spawn-part (_type_) none) ;; 20 ) (:states mistycannon-missile-idle @@ -24389,9 +24392,9 @@ ) (deftype mistycannon (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (rotate angle-tracker :inline :offset-assert 176) - (fact-info-override fact-info-enemy :score 100 :offset 144) + (fact fact-info-enemy :override) (tilt angle-tracker :inline :offset-assert 192) (front-wheel float :offset-assert 208) (rear-wheel float :offset-assert 212) @@ -24415,10 +24418,10 @@ :heap-base #x110 :flag-assert #x1801100174 (:methods - (rotate! (_type_ float) none 20) - (tilt! (_type_ float) none 21) - (mistycannon-method-22 (_type_ float float float) none 22) ;; can return a #f is postbindinfo-ok is false - (mistycannon-method-23 (_type_) none 23) + (rotate! (_type_ float) none) ;; 20 + (tilt! (_type_ float) none) ;; 21 + (mistycannon-method-22 (_type_ float float float) none) ;; 22 ;; can return a #f is postbindinfo-ok is false + (mistycannon-method-23 (_type_) none) ;; 23 ) (:states mistycannon-idle @@ -24573,10 +24576,10 @@ :size-assert #x20 :flag-assert #xd00000020 (:methods - (reset! (_type_ float float float) none 9) - (inc-xy-vel! (_type_ float float) none 10) - (move! (_type_) none 11) - (wobbler-method-12 (_type_ quaternion) none 12) + (reset! (_type_ float float float) none) ;; 9 + (inc-xy-vel! (_type_ float float) none) ;; 10 + (move! (_type_) none) ;; 11 + (wobbler-method-12 (_type_ quaternion) none) ;; 12 ) ) @@ -24616,11 +24619,11 @@ :size-assert #x28 :flag-assert #xd00000028 (:methods - (new (symbol type int int float float float float) _type_ 0) - (twister-method-9 (_type_ int int float) none 9) - (set-target! (_type_ float) none 10) - (twister-method-11 (_type_) none 11) - (twister-method-12 (_type_ process-drawable) none 12) + (new (symbol type int int float float float float) _type_) ;; 0 + (twister-method-9 (_type_ int int float) none) ;; 9 + (set-target! (_type_ float) none) ;; 10 + (twister-method-11 (_type_) none) ;; 11 + (twister-method-12 (_type_ process-drawable) none) ;; 12 ) ) @@ -24634,7 +24637,7 @@ ;; - Types (deftype windmill-one (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (sound-id sound-id :offset-assert 176) ) :method-count-assert 20 @@ -24646,7 +24649,7 @@ ) (deftype grottopole (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (speed meters :offset-assert 176) (distance meters :offset-assert 180) (position int32 :offset-assert 184) @@ -24664,7 +24667,7 @@ ) (deftype ecoventrock (process-drawable) - ((root-override collide-shape :score 100 :offset 112)) + ((root collide-shape :override)) :method-count-assert 20 :size-assert #xb0 :heap-base #x40 @@ -24675,7 +24678,7 @@ ) (deftype flying-rock (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) ;; a guess + ((root collide-shape-moving :override) ;; a guess (tumble quaternion :inline :offset-assert 176) ) :method-count-assert 20 @@ -24688,7 +24691,7 @@ ) (deftype bladeassm (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (angle float :offset-assert 176) ) :method-count-assert 20 @@ -24700,7 +24703,7 @@ ) (deftype flutflutegg (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (fall-dist meters :offset-assert 176) (start vector :inline :offset-assert 192) (dir vector :inline :offset-assert 208) @@ -24717,7 +24720,7 @@ :heap-base #xa0 :flag-assert #x1500a00110 (:methods - (flutflutegg-method-20 (_type_ float float float) none 20) + (flutflutegg-method-20 (_type_ float float float) none) ;; 20 ) (:states (flutflutegg-break symbol) @@ -24727,7 +24730,7 @@ ) (deftype harvester (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (alt-actor entity-actor :offset-assert 176) ) :method-count-assert 20 @@ -24891,7 +24894,7 @@ ) (deftype pelican (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (query gui-query :inline :offset-assert 176) (fuel-cell handle :offset-assert 208) (cam-tracker handle :offset-assert 216) @@ -24954,7 +24957,7 @@ ;; - Types (deftype lurkerworm (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (twister twister :offset-assert 176) (head-tilt float :offset-assert 180) (strike-count int32 :offset-assert 184) @@ -24968,8 +24971,8 @@ :flag-assert #x16006000c8 ;; inherited inspect of process-drawable (:methods - (lurkerworm-method-20 (_type_) none 20) - (particle-effect (_type_) none 21) + (lurkerworm-method-20 (_type_) none) ;; 20 + (particle-effect (_type_) none) ;; 21 ) (:states lurkerworm-idle @@ -25055,7 +25058,7 @@ ;; - Types (deftype beach-rock (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (trigger basic :offset-assert 176) (movie-start time-frame :offset-assert 184) (part-falling sparticle-launch-control :offset-assert 192) @@ -25067,10 +25070,10 @@ :size-assert #xcc :flag-assert #x18006000cc (:methods - (idle () _type_ :state 20) ;; state - (loading () _type_ :state 21) ;; state - (falling () _type_ :state 22) ;; state - (fallen () _type_ :state 23) ;; state + (idle () _type_ :state) ;; 20 ;; state + (loading () _type_ :state) ;; 21 ;; state + (falling () _type_ :state) ;; 22 ;; state + (fallen () _type_ :state) ;; 23 ;; state ) ) @@ -25097,7 +25100,7 @@ (declare-type seagullflock process) (deftype seagull (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (index int32 :offset-assert 176) (flock (pointer seagullflock) :offset-assert 180) (heading float :offset-assert 184) @@ -25117,14 +25120,14 @@ :size-assert #xe8 :flag-assert #x1c008000e8 (:methods - (move-vertically! (_type_ symbol) none 20) - (adjust-heading-around-point-slow! (_type_ float) none 21) - (seagull-method-22 (_type_) none 22) - (adjust-heading-around-point! (_type_ float) none 23) - (seagull-method-24 (_type_) none 24) - (seagull-method-25 (_type_ float) none 25) - (seagull-method-26 (_type_) symbol 26) - (seagull-method-27 (_type_) none 27) + (move-vertically! (_type_ symbol) none) ;; 20 + (adjust-heading-around-point-slow! (_type_ float) none) ;; 21 + (seagull-method-22 (_type_) none) ;; 22 + (adjust-heading-around-point! (_type_ float) none) ;; 23 + (seagull-method-24 (_type_) none) ;; 24 + (seagull-method-25 (_type_ float) none) ;; 25 + (seagull-method-26 (_type_) symbol) ;; 26 + (seagull-method-27 (_type_) none) ;; 27 ) (:states (seagull-idle) @@ -25157,9 +25160,9 @@ :heap-base #x180 :flag-assert #x11018001f0 (:methods - (spawn-bird (_type_ vector) (pointer process) 14) - (play-hint (_type_ int) none 15) - (seagullflock-method-16 (_type_ seagull) float 16) + (spawn-bird (_type_ vector) (pointer process)) ;; 14 + (play-hint (_type_ int) none) ;; 15 + (seagullflock-method-16 (_type_ seagull) float) ;; 16 ) (:states (seagullflock-idle) @@ -25227,7 +25230,7 @@ :heap-base #xa0 :flag-assert #x2100a00108 (:methods - (pressable? (_type_) symbol 32) + (pressable? (_type_) symbol) ;; 32 ) ) @@ -25242,7 +25245,7 @@ :heap-base #x20 :flag-assert #xf00200088 (:methods - (idle () _type_ :state 14) + (idle () _type_ :state) ;; 14 ) ) @@ -25347,15 +25350,15 @@ :flag-assert #x1d0210027c ;; inherited inspect of process-drawable (:methods - (battlecontroller-method-20 () none 20) - (battlecontroller-idle () _type_ :state 21) - (battlecontroller-play-intro-camera () _type_ :state 22) - (battlecontroller-method-23 () none 23) - (battlecontroller-active () _type_ :state 24) - (battlecontroller-method-25 () none 25) - (battlecontroller-die () _type_ :state 26) - (battlecontroller-method-27 (_type_) none 27) ;; has pairs - (cleanup-if-finished! (_type_) none 28) + (battlecontroller-method-20 () none) ;; 20 + (battlecontroller-idle () _type_ :state) ;; 21 + (battlecontroller-play-intro-camera () _type_ :state) ;; 22 + (battlecontroller-method-23 () none) ;; 23 + (battlecontroller-active () _type_ :state) ;; 24 + (battlecontroller-method-25 () none) ;; 25 + (battlecontroller-die () _type_ :state) ;; 26 + (battlecontroller-method-27 (_type_) none) ;; 27 ;; has pairs + (cleanup-if-finished! (_type_) none) ;; 28 ) ) @@ -25424,14 +25427,14 @@ :heap-base #x70 :flag-assert #x17007000dc (:methods - (init-root! (_type_) none 20) - (setup-new-process! (_type_) none 21) - (idle () _type_ :state 22) + (init-root! (_type_) none) ;; 20 + (setup-new-process! (_type_) none) ;; 21 + (idle () _type_ :state) ;; 22 ) ) (deftype citb-arm (citb-arm-section) - ((root-override collide-shape-moving :score 100 :offset 112)) + ((root collide-shape-moving :override)) :method-count-assert 23 :size-assert #xdc :heap-base #x70 @@ -25495,7 +25498,7 @@ ) (deftype citb-disc (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (sync sync-info :inline :offset-assert 176) (rot-scale float :offset-assert 184) ) @@ -25504,8 +25507,8 @@ :heap-base #x50 :flag-assert #x16005000bc (:methods - (init! (_type_) none 20) - (citb-disc-method-21 (_type_) none 21) + (init! (_type_) none) ;; 20 + (citb-disc-method-21 (_type_) none) ;; 21 ) (:states citb-disc-idle) @@ -25569,7 +25572,7 @@ ) (deftype citb-robotboss (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (shield-on symbol :offset-assert 176) ) :method-count-assert 20 @@ -25614,7 +25617,7 @@ ) (deftype citb-generator (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (normal-look lod-set :inline :offset-assert 176) (broken-look lod-set :inline :offset-assert 212) (mushroom-pos vector :inline :offset-assert 256) @@ -25629,8 +25632,8 @@ :heap-base #xc0 :flag-assert #x1600c00124 (:methods - (init! (_type_) none 20) - (citb-generator-method-21 (_type_) none 21) + (init! (_type_) none) ;; 20 + (citb-generator-method-21 (_type_) none) ;; 21 ) (:states citb-generator-broken @@ -25702,7 +25705,7 @@ ;; - Types (deftype citb-base-plat (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (idle-distance float :offset-assert 176) ) :method-count-assert 25 @@ -25711,11 +25714,11 @@ :flag-assert #x19005000b4 ;; inherited inspect of process-drawable (:methods - (citb-base-plat-idle () _type_ :state 20) ;; state - (citb-base-plat-method-21 (_type_) none 21) - (citb-base-plat-method-22 (_type_) none 22) - (citb-base-plat-active () _type_ :state 23) ;; state - (citb-base-plat-method-24 (_type_) none 24) + (citb-base-plat-idle () _type_ :state) ;; 20 ;; state + (citb-base-plat-method-21 (_type_) none) ;; 21 + (citb-base-plat-method-22 (_type_) none) ;; 22 + (citb-base-plat-active () _type_ :state) ;; 23 ;; state + (citb-base-plat-method-24 (_type_) none) ;; 24 ) ) @@ -25789,7 +25792,7 @@ ) (deftype citb-firehose (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (idle-distance float :offset-assert 176) (sync sync-info :inline :offset-assert 180) (last-sync float :offset-assert 188) @@ -25849,7 +25852,7 @@ (declare-type citb-sage process-taskable) (deftype citb-sagecage (process-drawable) ((parent-override (pointer citb-sage) :score 100 :offset 12) - (root-override collide-shape-moving :score 100 :offset 112) + (root collide-shape-moving :override) (bar-array vector 12 :inline :score 100 :offset-assert 176) (angle-offset float :offset-assert 368) (bars-on symbol :offset-assert 372) @@ -25860,8 +25863,8 @@ :heap-base #x110 :flag-assert #x160110017c (:methods - (citb-sagecage-method-20 (_type_) none 20) - (citb-sagecage-method-21 (_type_) none 21) + (citb-sagecage-method-20 (_type_) none) ;; 20 + (citb-sagecage-method-21 (_type_) none) ;; 21 ) (:states citb-sagecage-idle) @@ -25982,12 +25985,12 @@ :heap-base #x190 :flag-assert #x4d01900200 (:methods - (snow-bunny-method-51 (_type_ vector vector) symbol :replace 51) - (snow-bunny-method-52 (_type_) symbol :replace 52) - (snow-bunny-method-54 (_type_) symbol :replace 54) - (snow-bunny-method-57 (_type_) symbol :replace 57) - (snow-bunny-method-60 (_type_) none :replace 60) - (snow-bunny-method-76 (_type_ symbol) none 76) + (nav-enemy-method-51 (_type_ vector vector) symbol :replace) ;; 51 + (nav-enemy-method-52 (_type_) symbol :replace) ;; 52 + (nav-enemy-method-54 (_type_) symbol :replace) ;; 54 + (nav-enemy-method-57 (_type_) symbol :replace) ;; 57 + (nav-enemy-method-60 (_type_) none :replace) ;; 60 + (snow-bunny-method-76 (_type_ symbol) none) ;; 76 ) ) @@ -26031,7 +26034,8 @@ :heap-base #x190 :flag-assert #x4d01900200 (:methods - (citb-bunny-method-48 (_type_ object) none :replace 48)) ;; object past to method 60 + (nav-enemy-method-48 (_type_ object) none :replace) ;; 48 ;; object passed to method 60 + ) ) ;; - Unknowns @@ -26049,7 +26053,7 @@ ;; - Types (deftype drop-plat (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (spin-axis vector :inline :offset-assert 176) (spin-angle float :offset-assert 192) (spin-speed float :offset-assert 196) @@ -26063,8 +26067,8 @@ :heap-base #x80 :flag-assert #x16008000e1 (:methods - (drop-plat-method-20 (_type_) none 20) - (drop-plat-method-21 (_type_) none 21) + (drop-plat-method-20 (_type_) none) ;; 20 + (drop-plat-method-21 (_type_) none) ;; 21 ) (:states drop-plat-spawn @@ -26153,7 +26157,7 @@ ;; - Types (deftype cavecrystal (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (is-master? symbol :offset-assert 176) (crystal-id int32 :offset-assert 180) (glow-u float :offset-assert 184) @@ -26175,8 +26179,8 @@ :heap-base #xd0 :flag-assert #x1600d00140 (:methods - (update-connected-crystals! (_type_) none 20) - (compute-glow (_type_) float 21) + (update-connected-crystals! (_type_) none) ;; 20 + (compute-glow (_type_) float) ;; 21 ) (:states cavecrystal-active @@ -26219,7 +26223,7 @@ :heap-base #x10 :flag-assert #xf00100080 (:methods - (idle (int time-frame symbol) _type_ :state 14) + (idle (int time-frame symbol) _type_ :state) ;; 14 ) ) @@ -26257,7 +26261,7 @@ ) (deftype robotboss (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) ;; custom + ((root collide-shape-moving :override) ;; custom (alts entity-actor 13 :offset-assert 176) (desired-loc vector :inline :offset-assert 240) (old-loc vector :inline :offset-assert 256) @@ -26293,7 +26297,7 @@ :size-assert #x1d0 :flag-assert #x15016001d0 (:methods - (ease-loc-t (_type_) float 20) + (ease-loc-t (_type_) float) ;; 20 ) (:states robotboss-blue-wait @@ -26341,7 +26345,7 @@ ;; - Types (deftype light-eco-child (process-drawable) - ((root-override collide-shape :score 20 :offset 112) + ((root collide-shape :override) (angle-bit int32 :offset-assert 176) (ground-y float :offset-assert 180) (falling-start-time time-frame :offset-assert 184) @@ -26356,7 +26360,7 @@ :flag-assert #x1500b00118 ;; inherited inspect of process-drawable (:methods - (common-trans (_type_) none 20) + (common-trans (_type_) none) ;; 20 ) (:states light-eco-child-grabbed @@ -26380,8 +26384,8 @@ :heap-base #x70 :flag-assert #x16007000d8 (:methods - (spawn-child-eco (_type_) symbol 20) - (common-trans (_type_) none 21) + (spawn-child-eco (_type_) symbol) ;; 20 + (common-trans (_type_) none) ;; 21 ) (:states light-eco-mother-discipate @@ -26423,10 +26427,10 @@ :size-assert #x28 :flag-assert #xd00000028 (:methods - (torus-method-9 (_type_ vector) none 9) - (torus-method-10 (_type_ collide-prim-core vector) symbol 10) - (torus-method-11 (_type_ vector) symbol 11) - (torus-method-12 (_type_ vector) vector 12) + (torus-method-9 (_type_ vector) none) ;; 9 + (torus-method-10 (_type_ collide-prim-core vector) symbol) ;; 10 + (torus-method-11 (_type_ vector) symbol) ;; 11 + (torus-method-12 (_type_ vector) vector) ;; 12 ) ) @@ -26439,7 +26443,7 @@ ) (deftype arcing-shot (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (y-vel float :offset-assert 176) (grav float :offset-assert 180) (from vector :inline :offset-assert 192) @@ -26571,8 +26575,8 @@ :heap-base #x50 :flag-assert #x16005000b4 (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) + (idle () _type_ :state) ;; 20 + (hidden () _type_ :state) ;; 21 ) ) @@ -26620,7 +26624,8 @@ :heap-base #x170 :flag-assert #x4c017001d8 (:methods - (green-eco-lurker-method-51 (_type_ vector) symbol :replace 51)) + (nav-enemy-method-51 (_type_ vector) symbol :replace) ;; 51 + ) (:states green-eco-lurker-appear green-eco-lurker-appear-land @@ -26732,9 +26737,9 @@ :flag-assert #x17004000b0 ;; not enough basic ops (:methods - (idle () _type_ :state 20) ;; state - (final-door-method-21 (_type_) none 21) - (open (symbol) _type_ :state 22) + (idle () _type_ :state) ;; 20 ;; state + (final-door-method-21 (_type_) none) ;; 21 + (open (symbol) _type_ :state) ;; 22 ) ) @@ -26755,7 +26760,7 @@ ) (deftype powercellalt (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (jump-pos vector :inline :offset-assert 176) (base vector :inline :offset-assert 192) (index int32 :offset-assert 208) @@ -26765,9 +26770,9 @@ :heap-base #x70 :flag-assert #x17007000d4 (:methods - (powercellalt-method-20 () none 20) - (jump () _type_ :state 21) - (idle () _type_ :state 22) + (powercellalt-method-20 () none) ;; 20 + (jump () _type_ :state) ;; 21 + (idle () _type_ :state) ;; 22 ) ) @@ -26895,7 +26900,7 @@ ;; - Types (deftype eggtop (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (cam-tracker handle :offset-assert 176) (sound-id sound-id :offset-assert 184) ) @@ -26931,7 +26936,7 @@ ;; - Types (deftype plat-flip (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (path-pos float :offset-assert 176) (before-turn-down-time float :offset-assert 180) (turn-down-time float :offset-assert 184) @@ -26995,7 +27000,7 @@ (declare-type plant-boss process-drawable) (deftype plant-boss-arm (process-drawable) ((parent-override (pointer plant-boss) :score 100 :offset 12) - (root-override collide-shape :score 100 :offset 112) + (root collide-shape :override) (side int32 :offset-assert 176) ) :method-count-assert 20 @@ -27018,7 +27023,7 @@ ) (deftype plant-boss-leaf (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (side int32 :offset-assert 176) (state-object symbol :offset-assert 180) (state-time-frame time-frame :offset-assert 184) @@ -27038,7 +27043,7 @@ ) (deftype plant-boss (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (neck joint-mod :offset-assert 176) (body joint-mod :offset-assert 180) (leaf (pointer plant-boss-leaf) 2 :offset-assert 184) @@ -27207,7 +27212,7 @@ ) (deftype junglesnake (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (state-time2 time-frame :offset-assert 176) ;; changed (hit-player symbol :offset 184) (is-lethal? symbol :offset-assert 188) @@ -27226,11 +27231,11 @@ :heap-base #x220 :flag-assert #x190220028c (:methods - (junglesnake-method-20 (_type_) symbol 20) - (junglesnake-method-21 (_type_) symbol 21) - (junglesnake-method-22 (_type_ float) symbol 22) - (junglesnake-method-23 (_type_) none 23) - (junglesnake-method-24 (_type_) none 24) + (junglesnake-method-20 (_type_) symbol) ;; 20 + (junglesnake-method-21 (_type_) symbol) ;; 21 + (junglesnake-method-22 (_type_ float) symbol) ;; 22 + (junglesnake-method-23 (_type_) none) ;; 23 + (junglesnake-method-24 (_type_) none) ;; 24 ) (:states junglesnake-sleeping @@ -27261,7 +27266,7 @@ ;; - Types (deftype darkvine (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (speed float :offset-assert 176) (tip-index int8 :offset-assert 180) (dangerous symbol :offset-assert 184) @@ -27306,13 +27311,13 @@ ) (deftype logtrap (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112)) + ((root collide-shape-moving :override)) :method-count-assert 21 :size-assert #xb0 :heap-base #x40 :flag-assert #x15004000b0 (:methods - (idle () _type_ :state 20) + (idle () _type_ :state) ;; 20 ) ) @@ -27327,7 +27332,7 @@ ) (deftype lurkerm-tall-sail (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (speed float :offset-assert 176) (alt-actor entity-actor :offset-assert 180) ) @@ -27340,7 +27345,7 @@ ) (deftype lurkerm-short-sail (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (speed float :offset-assert 176) (alt-actor entity-actor :offset-assert 180) ) @@ -27353,7 +27358,7 @@ ) (deftype lurkerm-piston (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (sync sync-info :inline :offset-assert 176) (base vector :inline :offset-assert 192) (height vector :inline :offset-assert 208) @@ -27396,7 +27401,7 @@ ) (deftype precurbridge (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (smush smush-control :inline :offset-assert 176) (base vector :inline :offset-assert 208) (activation-point vector :inline :offset-assert 224) @@ -27413,7 +27418,7 @@ ) (deftype maindoor (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (thresh vector :inline :offset-assert 176) ) :method-count-assert 20 @@ -27435,7 +27440,7 @@ ;; I think unused! (deftype jngpusher (process-drawable) - ((root-override trsqv :offset 112) + ((root trsqv :override) (sync sync-info :inline :offset-assert 176) (back-prim collide-shape-prim :offset-assert 184) ) @@ -27483,7 +27488,7 @@ (declare-type reflector process-drawable) (deftype periscope (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (y-offset meters :offset-assert 176) (y-offset-grips meters :offset-assert 180) (height meters :offset-assert 184) @@ -27524,7 +27529,7 @@ (deftype reflector (process-drawable) ((parent-override (pointer periscope) :score 100 :offset 12) - (root-override collide-shape :score 100 :offset 112)) + (root collide-shape :override)) :method-count-assert 20 :size-assert #xb0 :heap-base #x40 @@ -27549,7 +27554,7 @@ ) (deftype reflector-mirror (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (beam-end vector :inline :offset-assert 176) ) :method-count-assert 20 @@ -27745,7 +27750,7 @@ ;; - Types (deftype launcherdoor (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (notify-player-passed-thru? symbol :offset-assert 176) (thresh-y float :offset-assert 180) (open-speed float :offset-assert 184) @@ -27944,7 +27949,7 @@ (deftype racer (process-drawable) ((parent-override (pointer target) :score 100 :offset 12) - (root-override collide-shape-moving :score 100 :offset 112) + (root collide-shape-moving :override) (extra-trans vector :inline :offset-assert 176) (condition int32 :offset-assert 192) (cell handle :offset-assert 200) @@ -27959,10 +27964,10 @@ :heap-base #x70 :flag-assert #x18007000e0 (:methods - (wait-for-start () _type_ :state 20) - (idle () _type_ :state 21) - (pickup ((state collectable)) _type_ :state 22) - (wait-for-return () _type_ :state 23) + (wait-for-start () _type_ :state) ;; 20 + (idle () _type_ :state) ;; 21 + (pickup ((state collectable)) _type_ :state) ;; 22 + (wait-for-return () _type_ :state) ;; 23 ) ) @@ -28064,7 +28069,7 @@ (deftype flutflut (process-drawable) ((parent-override (pointer target) :score 100 :offset 12) - (root-override collide-shape-moving :score 100 :offset 112) + (root collide-shape-moving :override) (extra-trans vector :inline :offset-assert 176) (condition int32 :offset-assert 192) (auto-get-off symbol :offset-assert 196) @@ -28081,10 +28086,10 @@ :flag-assert #x18007000e0 ;; inherited inspect of process-drawable (:methods - (wait-for-start () _type_ :state 20) - (idle () _type_ :state 21) - (pickup ((state flutflut)) _type_ :state 22) - (wait-for-return () _type_ :state 23) + (wait-for-start () _type_ :state) ;; 20 + (idle () _type_ :state) ;; 21 + (pickup ((state flutflut)) _type_ :state) ;; 22 + (wait-for-return () _type_ :state) ;; 23 ) ) @@ -28282,8 +28287,8 @@ ) (deftype yakow (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) - (fact-override fact-info-enemy :score 100 :offset 144) + ((root collide-shape-moving :override) + (fact fact-info-enemy :override) (player-attack-id int32 :offset-assert 176) (walk-run-blend float :offset-assert 180) (walk-turn-blend float :offset-assert 184) @@ -28502,7 +28507,7 @@ :heap-base #x40 :flag-assert #x15004000b0 (:methods - (idle () _type_ :state 20) + (idle () _type_ :state) ;; 20 ) ) @@ -28513,7 +28518,7 @@ :heap-base #x40 :flag-assert #x15004000b0 (:methods - (idle () _type_ :state 20) + (idle () _type_ :state) ;; 20 ) ) @@ -28532,7 +28537,7 @@ :heap-base #x40 :flag-assert #x15004000b0 (:methods - (idle () _type_ :state 20) + (idle () _type_ :state) ;; 20 ) ) @@ -28597,11 +28602,11 @@ :size-assert #xa4 :flag-assert #xe000000a4 (:methods - (get-point-count (_type_) int 9) - (nth-point (_type_ int vector) vector 10) - (distance-to-next-point (_type_ int vector) vector 11) - (add-point! (_type_ float float float float) none 12) - (debug-draw (_type_) symbol 13) + (get-point-count (_type_) int) ;; 9 + (nth-point (_type_ int vector) vector) ;; 10 + (distance-to-next-point (_type_ int vector) vector) ;; 11 + (add-point! (_type_ float float float float) none) ;; 12 + (debug-draw (_type_) symbol) ;; 13 ) ) @@ -28628,14 +28633,14 @@ :size-assert #x8c :flag-assert #x110000008c (:methods - (init! (_type_ vehicle-path (pointer float) (pointer float) int float) none 9) - (vehicle-controller-method-10 (_type_ vector float int) none 10) - (vehicle-controller-method-11 (_type_) none 11) - (vehicle-controller-method-12 (_type_ int vector) none 12) - (move-to-next-point (_type_ vector) none 13) - (vehicle-controller-method-14 (_type_ vector vector) none 14) - (vehicle-controller-method-15 (_type_ collide-shape-moving) none 15) - (vehicle-controller-method-16 (_type_) none 16) + (init! (_type_ vehicle-path (pointer float) (pointer float) int float) none) ;; 9 + (vehicle-controller-method-10 (_type_ vector float int) none) ;; 10 + (vehicle-controller-method-11 (_type_) none) ;; 11 + (vehicle-controller-method-12 (_type_ int vector) none) ;; 12 + (move-to-next-point (_type_ vector) none) ;; 13 + (vehicle-controller-method-14 (_type_ vector vector) none) ;; 14 + (vehicle-controller-method-15 (_type_ collide-shape-moving) none) ;; 15 + (vehicle-controller-method-16 (_type_) none) ;; 16 ) ) @@ -28798,7 +28803,7 @@ :heap-base #x20 :flag-assert #xf00200088 (:methods - (idle () _type_ :state 14) + (idle () _type_ :state) ;; 14 ) ) @@ -28820,7 +28825,7 @@ ) (deftype scarecrow-a (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (incomming-attack-id uint64 :offset-assert 176) (intersection vector :inline :offset-assert 192) ) @@ -28829,13 +28834,13 @@ :heap-base #x60 :flag-assert #x16006000d0 (:methods - (idle () _type_ :state 20) - (hit (float vector symbol) _type_ :state 21) + (idle () _type_ :state) ;; 20 + (hit (float vector symbol) _type_ :state) ;; 21 ) ) (deftype scarecrow-b (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (incomming-attack-id uint64 :offset-assert 176) (intersection vector :inline :offset-assert 192) ) @@ -28844,8 +28849,8 @@ :heap-base #x60 :flag-assert #x16006000d0 (:methods - (idle () _type_ :state 20) - (hit (float vector symbol) _type_ :state 21) + (idle () _type_ :state) ;; 20 + (hit (float vector symbol) _type_ :state) ;; 21 ) ) @@ -28917,7 +28922,7 @@ ) (deftype mis-bone-bridge (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (particle-group sparticle-launch-group :offset-assert 176) (player-attack-id int32 :offset-assert 180) (fall-anim-index int32 :offset-assert 184) @@ -28935,14 +28940,14 @@ ) (deftype breakaway (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112)) + ((root collide-shape-moving :override)) :method-count-assert 22 :size-assert #xb0 :heap-base #x40 :flag-assert #x16004000b0 (:methods - (init! (_type_ res-lump int) none 20) - (go-idle (_type_) none 21) + (init! (_type_ res-lump int) none) ;; 20 + (go-idle (_type_) none) ;; 21 ) (:states breakaway-idle @@ -29091,7 +29096,7 @@ ) (deftype keg-conveyor-paddle (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (object-on-paddle (pointer bouncing-float) :offset-assert 176) (sync sync-info :inline :offset-assert 180) ) @@ -29104,7 +29109,7 @@ ) (deftype keg (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (sync-offset float :offset-assert 176) (keg-behavior int8 :offset-assert 180) (path-position vector :inline :offset-assert 192) @@ -29174,7 +29179,7 @@ ;; - Types (deftype muse (nav-enemy) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (current-path-index float :offset-assert 400) (prev-path-index float :offset-assert 404) (dest-path-index float :offset-assert 408) @@ -29263,7 +29268,7 @@ ;; - Types (deftype quicksandlurker-missile (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) ) :method-count-assert 20 :size-assert #xb0 @@ -29285,7 +29290,7 @@ ) (deftype quicksandlurker (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (original-position vector :inline :offset-assert 176) (y-offset float :offset-assert 192) (theta-angle float :offset-assert 196) @@ -29422,14 +29427,14 @@ (deftype balloonlurker-pilot (process-drawable) ((parent-override (pointer balloonlurker) :score 100 :offset 12) - (root-override collide-shape-moving :score 100 :offset 112)) + (root collide-shape-moving :override)) :method-count-assert 22 :size-assert #xb0 :heap-base #x40 :flag-assert #x16004000b0 (:methods - (balloonlurker-pilot-method-20 (_type_) none 20) - (balloonlurker-pilot-method-21 (_type_) none 21) + (balloonlurker-pilot-method-20 (_type_) none) ;; 20 + (balloonlurker-pilot-method-21 (_type_) none) ;; 21 ) (:states balloonlurker-pilot-idle @@ -29659,7 +29664,7 @@ ) (deftype fireboulder (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (tracker handle :offset-assert 176) ;; part-tracker (task uint8 :offset-assert 184) ) @@ -29692,7 +29697,7 @@ :heap-base #x60 :flag-assert #x15006000c8 (:methods - (skip-reminder? (_type_) symbol 20) + (skip-reminder? (_type_) symbol) ;; 20 ) (:states exit-chamber-dummy-wait-to-appear @@ -29866,8 +29871,8 @@ :size-assert #x14 :flag-assert #xb00000014 (:methods - (init! (_type_ int int float) none 9) - (update-timer! (_type_) none 10) + (init! (_type_ int int float) none) ;; 9 + (update-timer! (_type_) none) ;; 10 ) ) @@ -29884,8 +29889,8 @@ :size-assert #x18 :flag-assert #xb00000018 (:methods - (init! (_type_ float float float float) none 9) - (swamp-rope-oscillator-method-10 (_type_ float) none 10) + (init! (_type_ float float float float) none) ;; 9 + (swamp-rope-oscillator-method-10 (_type_ float) none) ;; 10 ) ) @@ -29901,8 +29906,8 @@ :size-assert #x30 :flag-assert #xb00000030 (:methods - (init! (_type_ int int float float) none 9) - (update-timer! (_type_) none 10) + (init! (_type_ int int float float) none) ;; 9 + (update-timer! (_type_) none) ;; 10 ) ) @@ -29919,13 +29924,13 @@ :size-assert #x3c :flag-assert #xb0000003c (:methods - (init! (_type_ vector float float float) none 9) - (swamp-blimp-oscillator-method-10 (_type_ vector) none 10) + (init! (_type_ vector float float float) none) ;; 9 + (swamp-blimp-oscillator-method-10 (_type_ vector) none) ;; 10 ) ) (deftype swamp-tetherrock (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (tension float :offset-assert 176) (tension-pt vector :inline :offset-assert 192) (blimp entity-actor :offset-assert 208) @@ -29944,7 +29949,7 @@ ) (deftype precursor-arm (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (y-init float :offset-assert 176) (y-offset float :offset-assert 180) (rot-speed float :offset-assert 184) @@ -29985,7 +29990,7 @@ :heap-base #xb0 :flag-assert #x1500b00120 (:methods - (swamp-rope-method-20 (_type_) basic 20) ;; ret - entity-actor | symbol + (swamp-rope-method-20 (_type_) basic) ;; 20 ;; ret - entity-actor | symbol ) (:states swamp-rope-idle-rock @@ -29995,7 +30000,7 @@ ) (deftype swamp-blimp (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (the-ropes handle 5 :offset-assert 176) (arm-timer int32 :offset-assert 216) (trans-at-init vector :inline :offset-assert 224) @@ -30166,7 +30171,7 @@ ;; - Types (deftype swamp-spike (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (sync sync-info :inline :offset-assert 176) (open-gate symbol :offset-assert 184) (dangerous symbol :offset-assert 188) @@ -30176,7 +30181,7 @@ :heap-base #x50 :flag-assert #x15005000c0 (:methods - (init! (_type_) symbol 20) + (init! (_type_) symbol) ;; 20 ) (:states swamp-spike-idle) @@ -30194,7 +30199,7 @@ ) (deftype balance-plat (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (y-travel float :offset-assert 176) (y-init float :offset-assert 180) (y-offset float :offset-assert 184) @@ -30211,7 +30216,7 @@ ) (deftype swamp-rock (process-drawable) - ((root-override basic :offset 112)) + ((root collide-shape-moving :override)) :method-count-assert 20 :size-assert #xb0 :heap-base #x40 @@ -30288,15 +30293,15 @@ :size-assert #x30 :flag-assert #xa00000030 (:methods - (swamp-bat-idle-path-method-9 (_type_ vector float) vector 9) + (swamp-bat-idle-path-method-9 (_type_ vector float) vector) ;; 9 ) ) (declare-type swamp-bat-slave process-drawable) (deftype swamp-bat (process-drawable) ((child-process (pointer swamp-bat-slave) :score 100 :offset 20) - (root-override collide-shape :score 100 :offset 112) - (fact-override fact-info-enemy :score 100 :offset 144) + (root collide-shape :override) + (fact fact-info-enemy :override) (path-origin vector :inline :offset-assert 176) (idle-position-angle float 8 :offset-assert 192) (path-select-plane plane 2 :inline :offset-assert 224) @@ -30316,7 +30321,7 @@ (deftype swamp-bat-slave (process-drawable) ((parent-process (pointer swamp-bat) :score 100 :offset 12) - (root-override collide-shape-moving :score 100 :offset 112) + (root collide-shape-moving :override) (sync sync-info :inline :offset-assert 176) (idle-anim-speed float :offset-assert 184) (strafe-envelope float :offset-assert 188) @@ -30333,7 +30338,7 @@ :heap-base #xb0 :flag-assert #x1500b00118 (:methods - (swamp-bat-slave-method-20 (_type_) float 20) + (swamp-bat-slave-method-20 (_type_) float) ;; 20 ) (:states swamp-bat-slave-idle @@ -30419,7 +30424,7 @@ (declare-type swamp-rat-nest-dummy process-drawable) (deftype swamp-rat-nest (process-drawable) ((child-process (pointer swamp-rat-nest-dummy) :score 100 :offset 20) - (fact-override fact-info-enemy :score 100 :offset 144) + (fact fact-info-enemy :override) (dummy (pointer swamp-rat-nest-dummy) :offset-assert 176) (damaged symbol :offset-assert 180) (dummy-type int8 :offset-assert 184) @@ -30445,7 +30450,7 @@ (deftype swamp-rat-nest-dummy (process-drawable) ((parent-process (pointer swamp-rat-nest) :score 100 :offset 12) - (root-override collide-shape :score 100 :offset 112) + (root collide-shape :override) (top-sphere sphere :inline :offset-assert 176) (death-part sparticle-launch-group :offset-assert 192) (spawn-joint-array int8 6 :offset-assert 196) @@ -30457,8 +30462,8 @@ :heap-base #x60 :flag-assert #x16006000cc (:methods - (swamp-rat-nest-dummy-method-20 (_type_) none 20) - (swamp-rat-nest-dummy-method-21 (_type_) int 21) + (swamp-rat-nest-dummy-method-20 (_type_) none) ;; 20 + (swamp-rat-nest-dummy-method-21 (_type_) int) ;; 21 ) (:states swamp-rat-nest-dummy-idle @@ -30532,13 +30537,14 @@ :method-count-assert 9 :size-assert #x3a :flag-assert #x90000003a - (:methods (new (symbol type kermit int function int int) _type_ 0)) + (:methods (new (symbol type kermit int function int int) _type_) ;; 0 + ) ) (deftype kermit-pulse (process-drawable) ((parent-override (pointer kermit) :score 100 :offset 12) (self-override kermit-pulse :score 100 :offset 28) - (root-override collide-shape-moving :score 100 :offset 112) + (root collide-shape-moving :override) (sound-id sound-id :offset-assert 176) ) :method-count-assert 20 @@ -30734,12 +30740,12 @@ :size-assert #x170 :flag-assert #xf00000170 (:methods - (cavecrystal-light-control-method-9 (_type_ int float process-drawable) none 9) - (cavecrystal-light-control-method-10 (_type_ vector) float 10) - (inc-intensities! (_type_) none 11) - (cavecrystal-light-control-method-12 (_type_) none 12) - (create-connection! (_type_ process-drawable res-lump (function object object object object object) int float) connection 13) ;; TODO - process-drawable is often a cavecrystal - (execute-connections (_type_) int 14) + (cavecrystal-light-control-method-9 (_type_ int float process-drawable) none) ;; 9 + (cavecrystal-light-control-method-10 (_type_ vector) float) ;; 10 + (inc-intensities! (_type_) none) ;; 11 + (cavecrystal-light-control-method-12 (_type_) none) ;; 12 + (create-connection! (_type_ process-drawable res-lump (function object object object object object) int float) connection) ;; 13 ;; TODO - process-drawable is often a cavecrystal + (execute-connections (_type_) int) ;; 14 ) ) @@ -30778,7 +30784,7 @@ ) (deftype cavecrusher (process-drawable) - ((root-override collide-shape :score 100 :offset 112)) + ((root collide-shape :override)) :method-count-assert 20 :size-assert #xb0 :heap-base #x40 @@ -30788,7 +30794,7 @@ ) (deftype cavetrapdoor (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (delay-before-wiggle int32 :offset-assert 176) ) :method-count-assert 22 @@ -30796,13 +30802,13 @@ :heap-base #x50 :flag-assert #x16005000b4 (:methods - (idle () _type_ :state 20) - (trigger () _type_ :state 21) + (idle () _type_ :state) ;; 20 + (trigger () _type_ :state) ;; 21 ) ) (deftype caveflamepots (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (shove-up float :offset-assert 176) (cycle-speed int32 :offset-assert 180) (cycle-pause int32 :offset-assert 184) @@ -30820,7 +30826,7 @@ ) (deftype cavespatula (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (sync sync-info :inline :offset-assert 176) ) :method-count-assert 20 @@ -30832,7 +30838,7 @@ ) (deftype cavespatulatwo (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (sync sync-info :inline :offset-assert 176) ) :method-count-assert 20 @@ -30844,7 +30850,7 @@ ) (deftype caveelevator (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (elev-mode uint64 :offset-assert 176) (elev-type int32 :offset-assert 184) (prev-frame-num float :offset-assert 188) @@ -30860,8 +30866,8 @@ :heap-base #xe0 :flag-assert #x1600e00150 (:methods - (caveelevator-method-20 (_type_) none 20) - (caveelevator-method-21 (_type_) float 21) + (caveelevator-method-20 (_type_) none) ;; 20 + (caveelevator-method-21 (_type_) float) ;; 21 ) (:states caveelevator-cycle-active @@ -30957,7 +30963,7 @@ ;; - Types (deftype dark-crystal (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (crystal-num int32 :offset-assert 176) (underwater? symbol :offset-assert 180) (explode-danger-radius float :offset-assert 184) @@ -30971,8 +30977,8 @@ :heap-base #x90 :flag-assert #x1600900100 (:methods - (dark-crystal-method-20 (_type_) none 20) - (dark-crystal-method-21 (_type_) symbol 21) + (dark-crystal-method-20 (_type_) none) ;; 20 + (dark-crystal-method-21 (_type_) symbol) ;; 21 ) (:states dark-crystal-spawn-fuel-cell @@ -31011,8 +31017,8 @@ :size-assert #x28 :flag-assert #xb00000028 (:methods - (init! (_type_ symbol symbol symbol symbol int int symbol) none 9) - (set-delay! (_type_ time-frame) none 10) + (init! (_type_ symbol symbol symbol symbol int int symbol) none) ;; 9 + (set-delay! (_type_ time-frame) none) ;; 10 ) ) @@ -31117,7 +31123,7 @@ ) (deftype mother-spider (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (mode uint64 :offset-assert 176) (damage int32 :offset-assert 184) (baby-count int32 :offset-assert 188) @@ -31166,18 +31172,18 @@ :heap-base #x180 :flag-assert #x20018001f0 (:methods - (mother-spider-method-20 (_type_ vector vector) symbol 20) - (mother-spider-method-21 (_type_ vector float symbol) symbol 21) - (mother-spider-method-22 (_type_ matrix vector) float 22) - (mother-spider-method-23 (_type_) none 23) - (shadow-handler (_type_) number 24) - (letgo-player? (_type_) symbol 25) - (grab-player? (_type_) symbol 26) - (mother-spider-method-27 (_type_) none 27) - (mother-spider-method-28 (_type_) none 28) - (mother-spider-method-29 (_type_ symbol symbol) none 29) - (spawn-child (_type_ vector vector symbol) int 30) - (is-player-stuck? (_type_) symbol 31) + (mother-spider-method-20 (_type_ vector vector) symbol) ;; 20 + (mother-spider-method-21 (_type_ vector float symbol) symbol) ;; 21 + (mother-spider-method-22 (_type_ matrix vector) float) ;; 22 + (mother-spider-method-23 (_type_) none) ;; 23 + (shadow-handler (_type_) number) ;; 24 + (letgo-player? (_type_) symbol) ;; 25 + (grab-player? (_type_) symbol) ;; 26 + (mother-spider-method-27 (_type_) none) ;; 27 + (mother-spider-method-28 (_type_) none) ;; 28 + (mother-spider-method-29 (_type_ symbol symbol) none) ;; 29 + (spawn-child (_type_ vector vector symbol) int) ;; 30 + (is-player-stuck? (_type_) symbol) ;; 31 ) (:states (mother-spider-die-wait-for-children) @@ -31205,7 +31211,7 @@ (deftype mother-spider-egg (process-drawable) ((parent-override (pointer mother-spider) :score 100 :offset 12) - (root-override collide-shape-moving :score 100 :offset 112) + (root collide-shape-moving :override) (anim-speed float :offset-assert 176) (part2 sparticle-launch-control :offset-assert 180) (falling-start-time time-frame :offset-assert 184) @@ -31220,8 +31226,8 @@ :heap-base #xe0 :flag-assert #x1600e00150 (:methods - (mother-spider-egg-method-20 (_type_) none 20) - (draw-egg-shadow (_type_ vector symbol) symbol 21) + (mother-spider-egg-method-20 (_type_) none) ;; 20 + (draw-egg-shadow (_type_ vector symbol) symbol) ;; 21 ) (:states (mother-spider-egg-falling) @@ -31305,7 +31311,7 @@ :heap-base #x70 :flag-assert #x15007000e0 (:methods - (falling () _type_ :state 20) + (falling () _type_ :state) ;; 20 ) ) @@ -31348,7 +31354,7 @@ ) (deftype gnawer (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (hit-points int32 :offset-assert 176) (gnawer-id int32 :offset-assert 180) (total-money int32 :offset-assert 184) @@ -31372,17 +31378,17 @@ :heap-base #x560 :flag-assert #x1f056005d0 (:methods - (gnawer-method-20 (_type_ int) matrix 20) - (gnawer-method-21 (_type_ int bounding-box symbol float) float 21) - (gnawer-method-22 (_type_ float) symbol 22) - (gnawer-method-23 (_type_) none 23) - (gnawer-method-24 (_type_) none 24) - (gnawer-method-25 (_type_) symbol 25) - (gnawer-method-26 (_type_) none 26) - (gnawer-method-27 (_type_) none 27) - (gnawer-method-28 (_type_ int int) symbol 28) - (gnawer-method-29 (_type_ int vector vector) float 29) - (gnawer-method-30 (_type_ process-drawable) uint 30) + (gnawer-method-20 (_type_ int) matrix) ;; 20 + (gnawer-method-21 (_type_ int bounding-box symbol float) float) ;; 21 + (gnawer-method-22 (_type_ float) symbol) ;; 22 + (gnawer-method-23 (_type_) none) ;; 23 + (gnawer-method-24 (_type_) none) ;; 24 + (gnawer-method-25 (_type_) symbol) ;; 25 + (gnawer-method-26 (_type_) none) ;; 26 + (gnawer-method-27 (_type_) none) ;; 27 + (gnawer-method-28 (_type_ int int) symbol) ;; 28 + (gnawer-method-29 (_type_ int vector vector) float) ;; 29 + (gnawer-method-30 (_type_ process-drawable) uint) ;; 30 ) (:states gnawer-put-items-at-dest @@ -31447,14 +31453,14 @@ :heap-base #xc0 :flag-assert #x1c00c00128 (:methods - (driller-lurker-method-20 (_type_ symbol target) symbol 20) - (driller-lurker-method-21 (_type_) none 21) - (driller-lurker-method-22 (_type_) none 22) - (driller-lurker-method-23 (_type_) float 23) - (driller-lurker-method-24 (_type_) symbol 24) - (driller-lurker-method-25 (_type_) symbol 25) - (driller-lurker-method-26 (_type_) symbol 26) - (driller-lurker-method-27 (_type_) object 27) + (driller-lurker-method-20 (_type_ symbol target) symbol) ;; 20 + (driller-lurker-method-21 (_type_) none) ;; 21 + (driller-lurker-method-22 (_type_) none) ;; 22 + (driller-lurker-method-23 (_type_) float) ;; 23 + (driller-lurker-method-24 (_type_) symbol) ;; 24 + (driller-lurker-method-25 (_type_) symbol) ;; 25 + (driller-lurker-method-26 (_type_) symbol) ;; 26 + (driller-lurker-method-27 (_type_) object) ;; 27 ) (:states driller-lurker-idle-drilling @@ -31544,8 +31550,8 @@ :heap-base #x80 :flag-assert #x16008000f0 (:methods - (slide-control-watch () _type_ :state 20) - (slide-control-ride () _type_ :state 21) + (slide-control-watch () _type_ :state) ;; 20 + (slide-control-ride () _type_ :state) ;; 21 ) ) @@ -31629,7 +31635,7 @@ ;; - Types (deftype shover (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (shove-up float :offset-assert 176) ) :method-count-assert 20 @@ -31671,7 +31677,7 @@ :heap-base #xc0 :flag-assert #x1c00c00130 (:methods - (square-platform-method-27 (_type_ symbol) none 27) + (square-platform-method-27 (_type_ symbol) none) ;; 27 ) (:states square-platform-lowered @@ -31722,7 +31728,7 @@ ;; - Types (deftype sun-iris-door (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (timeout float :offset-assert 176) (proximity? symbol :offset-assert 180) (directional-proximity? symbol :offset-assert 184) @@ -31739,8 +31745,8 @@ :heap-base #x90 :flag-assert #x1600900100 (:methods - (should-close? (_type_) symbol 20) - (should-open? (_type_) symbol 21) + (should-close? (_type_) symbol) ;; 20 + (should-open? (_type_) symbol) ;; 21 ) (:states (sun-iris-door-open) @@ -31776,7 +31782,7 @@ :heap-base #x50 :flag-assert #x15005000b4 (:methods - (orbit-plat-bottom-method-20 (_type_ vector vector) none 20) + (orbit-plat-bottom-method-20 (_type_ vector vector) none) ;; 20 ) (:states orbit-plat-bottom-idle) @@ -31796,8 +31802,8 @@ :heap-base #xb0 :flag-assert #x1d00b00118 (:methods - (orbit-plat-method-27 (_type_) symbol 27) - (orbit-plat-method-28 (_type_) symbol 28) + (orbit-plat-method-27 (_type_) symbol) ;; 27 + (orbit-plat-method-28 (_type_) symbol) ;; 28 ) (:states orbit-plat-wait-for-other @@ -31852,7 +31858,7 @@ :heap-base #x80 :flag-assert #x1c008000f0 (:methods - (wedge-plat-method-27 (_type_) symbol 27) + (wedge-plat-method-27 (_type_) symbol) ;; 27 ) (:states wedge-plat-idle @@ -31885,7 +31891,7 @@ ;; - Types (deftype wall-plat (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (use-sync? symbol :offset-assert 176) (extended-amount float :offset-assert 180) (in-trans vector :inline :offset-assert 192) @@ -31960,7 +31966,7 @@ :heap-base #x90 :flag-assert #x1500900100 (:methods - (plat-state-set? (_type_ uint) symbol 20) + (plat-state-set? (_type_ uint) symbol) ;; 20 ) (:states qbert-plat-master-wait-for-door @@ -31998,7 +32004,7 @@ ) (deftype steam-cap (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (do-burst? symbol :offset-assert 176) (do-falling-sound? symbol :offset-assert 180) (do-landing-sound? symbol :offset-assert 184) @@ -32016,8 +32022,8 @@ :heap-base #xf0 :flag-assert #x1600f00160 (:methods - (steam-cap-method-20 (_type_) none 20) - (steam-cap-method-21 (_type_) quaternion 21) + (steam-cap-method-20 (_type_) none) ;; 20 + (steam-cap-method-21 (_type_) quaternion) ;; 21 ) (:states (steam-cap-idle)) @@ -32049,7 +32055,7 @@ :heap-base #x80 :flag-assert #x15008000f0 (:methods - (blue-eco-charger-orb-method-20 (_type_ float) vector 20) + (blue-eco-charger-orb-method-20 (_type_ float) vector) ;; 20 ) (:states blue-eco-charger-orb-idle @@ -32057,7 +32063,7 @@ ) (deftype blue-eco-charger (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (charger-id int32 :offset-assert 176) (open-level float :offset-assert 180) (master entity-actor :offset-assert 184) @@ -32067,8 +32073,8 @@ :heap-base #x50 :flag-assert #x16005000bc (:methods - (blue-eco-charger-method-20 (_type_) object 20) - (blue-eco-charger-method-21 (_type_ symbol) object 21) + (blue-eco-charger-method-20 (_type_) object) ;; 20 + (blue-eco-charger-method-21 (_type_ symbol) object) ;; 21 ) (:states blue-eco-charger-idle @@ -32091,7 +32097,7 @@ (declare-type exit-chamber-button basebutton) (deftype exit-chamber (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (chargers-active uint32 :offset-assert 176) (move-player? symbol :offset-assert 180) (move-fcell? symbol :offset-assert 184) @@ -32108,11 +32114,11 @@ :heap-base #x90 :flag-assert #x1900900100 (:methods - (exit-chamber-method-20 (_type_ float) float 20) - (exit-chamber-method-21 (_type_ exit-chamber-items) vector 21) - (exit-chamber-method-22 (_type_) none 22) - (exit-chamber-method-23 (_type_ symbol) object 23) - (exit-chamber-method-24 (_type_ float) none 24) + (exit-chamber-method-20 (_type_ float) float) ;; 20 + (exit-chamber-method-21 (_type_ exit-chamber-items) vector) ;; 21 + (exit-chamber-method-22 (_type_) none) ;; 22 + (exit-chamber-method-23 (_type_ symbol) object) ;; 23 + (exit-chamber-method-24 (_type_ float) none) ;; 24 ) (:states exit-chamber-charger-puzzle @@ -32194,7 +32200,7 @@ :heap-base #xd0 :flag-assert #x1f00d00140 (:methods - (draw-ripple (_type_) symbol 30) + (draw-ripple (_type_) symbol) ;; 30 ) ) @@ -32212,7 +32218,7 @@ ;; - Types (deftype whirlpool (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (spin-ry float :offset-assert 176) (spin-speed-idle float :offset-assert 180) (spin-speed-delta float :offset-assert 184) @@ -32223,7 +32229,7 @@ :heap-base #x60 :flag-assert #x15006000cc (:methods - (whirlpool-method-20 (_type_ float) cshape-moving-flags 20) + (whirlpool-method-20 (_type_ float) cshape-moving-flags) ;; 20 ) (:states (whirlpool-idle)) @@ -32282,9 +32288,9 @@ :heap-base #x230 :flag-assert #x17023002a0 (:methods - (sunken-pipegame-method-20 (_type_) uint 20) - (sunken-pipegame-method-21 (_type_ symbol) symbol 21) - (sunken-pipegame-method-22 (_type_ symbol) none 22) + (sunken-pipegame-method-20 (_type_) uint) ;; 20 + (sunken-pipegame-method-21 (_type_ symbol) symbol) ;; 21 + (sunken-pipegame-method-22 (_type_ symbol) none) ;; 22 ) (:states sunken-pipegame-start-up @@ -32320,8 +32326,8 @@ ) (deftype bully (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) - (fact-override fact-info-enemy :score 100 :offset 144) + ((root collide-shape-moving :override) + (fact fact-info-enemy :override) (hit-player? symbol :offset-assert 176) (bounced? symbol :offset-assert 180) (bounce-volume int32 :offset-assert 184) @@ -32341,7 +32347,7 @@ :heap-base #x90 :flag-assert #x15009000f4 (:methods - (bully-method-20 (_type_) float 20) + (bully-method-20 (_type_) float) ;; 20 ) (:states (bully-idle symbol) @@ -32397,8 +32403,8 @@ (buddy-handle handle :offset-assert 416) ; double-lurker-top ) (:methods - (initialize-collision (_type_) collide-shape-moving :replace 47) - (double-lurker-method-53 (_type_ vector) symbol :replace 53) + (initialize-collision (_type_) collide-shape-moving :replace) ;; 47 + (double-lurker-method-53 (_type_ vector) symbol :overlay-at nav-enemy-method-53) ;; 53 ) :method-count-assert 76 :size-assert #x1a8 @@ -32438,7 +32444,7 @@ ;; - Types (deftype helix-slide-door (process-drawable) - ((root-override collide-shape :score 100 :offset 112)) + ((root collide-shape :override)) :method-count-assert 20 :size-assert #xb0 :heap-base #x40 @@ -32450,7 +32456,7 @@ ) (deftype helix-button (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (my-water entity-actor :offset-assert 176) (my-door entity-actor :offset-assert 180) (fcell-handle handle :offset-assert 184) @@ -32490,8 +32496,8 @@ :heap-base #x60 :flag-assert #x16006000c8 (:methods - (helix-water-method-20 (_type_) none 20) - (helix-water-method-21 (_type_) object 21) + (helix-water-method-20 (_type_) none) ;; 20 + (helix-water-method-21 (_type_) object) ;; 21 ) (:states helix-water-idle @@ -32516,8 +32522,8 @@ ;; - Types (deftype puffer (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) - (fact-info-override fact-info-enemy :score 100 :offset 144) + ((root collide-shape-moving :override) + (fact fact-info-enemy :override) (path-index int32 :offset-assert 176) (facing-ry float :offset-assert 180) (travel-ry float :offset-assert 184) @@ -32551,18 +32557,18 @@ :heap-base #x130 :flag-assert #x2001300198 (:methods - (puffer-method-20 (_type_ vector) none 20) - (puffer-method-21 (_type_) none 21) - (puffer-method-22 (_type_) symbol 22) - (puffer-method-23 (_type_ symbol) symbol 23) - (puffer-method-24 (_type_ vector) symbol 24) - (puffer-method-25 (_type_ float) symbol 25) - (puffer-method-26 (_type_) none 26) - (puffer-method-27 (_type_) none 27) - (puffer-method-28 (_type_) none 28) - (flip-look! (_type_ symbol) none 29) - (puffer-method-30 (_type_) vector 30) - (puffer-method-31 (_type_) vector 31) + (puffer-method-20 (_type_ vector) none) ;; 20 + (puffer-method-21 (_type_) none) ;; 21 + (puffer-method-22 (_type_) symbol) ;; 22 + (puffer-method-23 (_type_ symbol) symbol) ;; 23 + (puffer-method-24 (_type_ vector) symbol) ;; 24 + (puffer-method-25 (_type_ float) symbol) ;; 25 + (puffer-method-26 (_type_) none) ;; 26 + (puffer-method-27 (_type_) none) ;; 27 + (puffer-method-28 (_type_) none) ;; 28 + (flip-look! (_type_ symbol) none) ;; 29 + (puffer-method-30 (_type_) vector) ;; 30 + (puffer-method-31 (_type_) vector) ;; 31 ) (:states puffer-idle @@ -32624,14 +32630,14 @@ :heap-base #xd0 :flag-assert #x1c00d00140 (:methods - (sunkenfisha-method-20 (_type_) float 20) - (sunkenfisha-method-21 (_type_ vector float vector) vector 21) - (sunkenfisha-method-22 (_type_) none 22) - (sunkenfisha-method-23 (_type_) quaternion 23) - (sunkenfisha-method-24 (_type_) vector 24) - (sunkenfisha-method-25 (_type_) none 25) - (sunkenfisha-method-26 (_type_) float 26) - (sunkenfisha-method-27 (_type_) float 27) + (sunkenfisha-method-20 (_type_) float) ;; 20 + (sunkenfisha-method-21 (_type_ vector float vector) vector) ;; 21 + (sunkenfisha-method-22 (_type_) none) ;; 22 + (sunkenfisha-method-23 (_type_) quaternion) ;; 23 + (sunkenfisha-method-24 (_type_) vector) ;; 24 + (sunkenfisha-method-25 (_type_) none) ;; 25 + (sunkenfisha-method-26 (_type_) float) ;; 26 + (sunkenfisha-method-27 (_type_) float) ;; 27 ) (:states sunkenfisha-idle) @@ -32657,7 +32663,7 @@ ;; - Types (deftype rolling-part (part-spawner) - ((root-override basic :offset 112)) + () :method-count-assert 21 :size-assert #xd0 :heap-base #x60 @@ -32672,7 +32678,7 @@ ) (deftype pusher-base (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (max-frame float :offset-assert 176) ) :method-count-assert 20 @@ -32721,7 +32727,7 @@ ) (deftype happy-plant (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (alt-actor entity-actor :offset-assert 176) ) :method-count-assert 20 @@ -32757,7 +32763,7 @@ ) (deftype gorge (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (coord matrix :inline :offset-assert 176) (radius float :offset-assert 240) (thickness float :offset-assert 244) @@ -32970,7 +32976,7 @@ ;; - Types (deftype robber (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (curve-position float :offset-assert 176) (speed float :offset-assert 180) (facing vector :inline :offset-assert 192) @@ -33068,7 +33074,7 @@ ;; - Types (deftype balloon (process-drawable) - ((root-override collide-shape :score 100 :offset 112)) + ((root collide-shape :override)) :method-count-assert 20 :size-assert #xb0 :heap-base #x40 @@ -33079,7 +33085,7 @@ ) (deftype spike (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (num-alts int32 :offset-assert 176) ) :method-count-assert 20 @@ -33093,14 +33099,14 @@ ) (deftype crate-darkeco-cluster (process-drawable) - ((root-override collide-shape :score 100 :offset 112)) + ((root collide-shape :override)) :method-count-assert 22 :size-assert #xb0 :heap-base #x40 :flag-assert #x16004000b0 (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (idle () _type_ :state) ;; 20 + (die () _type_ :state) ;; 21 ) ) @@ -33137,7 +33143,7 @@ (deftype ogreboss-super-boulder (process-drawable) ((parent-override (pointer process-drawable) :score 100 :offset 12) - (root-override collide-shape-moving :score 100 :offset 112) + (root collide-shape-moving :override) (orig-pos vector :inline :offset-assert 176) (src-pos vector :inline :offset-assert 192) (spin-axis vector :inline :offset-assert 208) @@ -33166,7 +33172,7 @@ (deftype ogreboss-bounce-boulder (process-drawable) ((parent-override (pointer ogreboss-super-boulder) :score 100 :offset 12) - (root-override collide-shape-moving :score 100 :offset 112) + (root collide-shape-moving :override) (src-pos vector :inline :offset-assert 176) (side-dir vector :inline :offset-assert 192) (side-pos float :offset-assert 208) @@ -33183,7 +33189,7 @@ (deftype ogreboss-missile (process-drawable) ((parent-override (pointer process-drawable) :score 100 :offset 12) - (root-override collide-shape-moving :score 100 :offset 112) + (root collide-shape-moving :override) (trajectory trajectory :inline :offset-assert 176) (src-pos vector :inline :offset-assert 224) (dest-pos vector :inline :offset-assert 240) @@ -33216,7 +33222,7 @@ ) (deftype ogreboss (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (old-player-transform transformq :inline :offset-assert 176) (level float :offset-assert 224) (difficulty float :offset-assert 228) @@ -33320,14 +33326,14 @@ ;; - Types (deftype tntbarrel (process-drawable) - ((root-override collide-shape :score 100 :offset 112)) + ((root collide-shape :override)) :method-count-assert 22 :size-assert #xb0 :heap-base #x40 :flag-assert #x16004000b0 (:methods - (idle () _type_ :state 20) - (die (symbol) _type_ :state 21) + (idle () _type_ :state) ;; 20 + (die (symbol) _type_ :state) ;; 21 ) ) @@ -33418,7 +33424,7 @@ ) (deftype ogre-bridge (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (joint-mod-array joint-mod 8 :offset-assert 176) (dead-joint-count int8 :offset-assert 208) ) @@ -33434,7 +33440,7 @@ ) (deftype ogre-bridgeend (process-drawable) - ((root-override collide-shape :score 100 :offset 112)) + ((root collide-shape :override)) :method-count-assert 20 :size-assert #xb0 :heap-base #x40 @@ -33454,7 +33460,7 @@ ) (deftype shortcut-boulder (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (broken-look lod-set :inline :offset-assert 176) ) :method-count-assert 20 @@ -33540,7 +33546,7 @@ :heap-base #xc0 :flag-assert #x1500c00130 (:methods - (flying-lurker-method-20 (_type_) none 20) + (flying-lurker-method-20 (_type_) none) ;; 20 ) (:states flying-lurker-die @@ -33604,7 +33610,7 @@ ) (deftype gondola (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (anim spool-anim :offset-assert 176) (old-target-pos transformq :inline :offset-assert 192) ) @@ -33613,9 +33619,9 @@ :heap-base #x80 :flag-assert #x17008000f0 (:methods - (idle (symbol) _type_ :state 20) - (ride-up () _type_ :state 21) - (ride-down () _type_ :state 22) + (idle (symbol) _type_ :state) ;; 20 + (ride-up () _type_ :state) ;; 21 + (ride-down () _type_ :state) ;; 22 ) ) @@ -33626,8 +33632,8 @@ :heap-base #x40 :flag-assert #x16004000b0 (:methods - (idle () _type_ :state 20) - (active (handle symbol) _type_ :state 21) + (idle () _type_ :state) ;; 20 + (active (handle symbol) _type_ :state) ;; 21 ) ) @@ -33638,7 +33644,7 @@ :heap-base #x40 :flag-assert #x15004000b0 (:methods - (idle () _type_ :state 20) + (idle () _type_ :state) ;; 20 ) ) @@ -33663,7 +33669,7 @@ ;; - Types (deftype minecartsteel (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (index int32 :offset-assert 176) (anim spool-anim :offset-assert 180) (sync sync-info :inline :offset-assert 184) @@ -33673,7 +33679,7 @@ :heap-base #x50 :flag-assert #x15005000c0 (:methods - (idle () _type_ :state 20) + (idle () _type_ :state) ;; 20 )) ;; - Functions @@ -33717,7 +33723,7 @@ :heap-base #x40 :flag-assert #x15004000b0 (:methods - (idle () _type_ :state 20) + (idle () _type_ :state) ;; 20 ) ) @@ -33789,7 +33795,7 @@ ;; - Types (deftype cave-trap (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (spider-count int32 :offset-assert 176) (alt-actors (array entity-actor) :offset-assert 180) (spawn-delay time-frame :offset-assert 184) @@ -33801,7 +33807,7 @@ :heap-base #x70 :flag-assert #x15007000e0 (:methods - (cave-trap-method-20 (_type_) symbol 20) + (cave-trap-method-20 (_type_) symbol) ;; 20 ) (:states cave-trap-idle @@ -33851,7 +33857,7 @@ ;; - Types (deftype spider-egg (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (notify-actor entity-actor :offset-assert 176) (broken-look lod-set :inline :offset-assert 180) ) @@ -33951,8 +33957,8 @@ :heap-base #x180 :flag-assert #x4c018001f0 (:methods - (ice-cube-method-51 (_type_ vector vector) symbol :replace 51) - (ice-cube-method-53 (_type_ vector vector) symbol :replace 53) + (ice-cube-method-51 (_type_ vector vector) symbol :overlay-at nav-enemy-method-51) ;; 51 + (ice-cube-method-53 (_type_ vector vector) symbol :overlay-at nav-enemy-method-53) ;; 53 ) (:states ice-cube-face-player @@ -34016,7 +34022,7 @@ ) (deftype snow-ball-roller (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (which-path int32 :offset-assert 176) (path-u float :offset-assert 180) (path-speed float :offset-assert 184) @@ -34037,9 +34043,9 @@ :heap-base #xe0 :flag-assert #x1700e00150 (:methods - (follow-path (_type_) none 20) - (play-landing-sound (_type_ float) sound-id 21) - (snow-ball-roller-method-22 (_type_ process-drawable) none 22) + (follow-path (_type_) none) ;; 20 + (play-landing-sound (_type_ float) sound-id) ;; 21 + (snow-ball-roller-method-22 (_type_ process-drawable) none) ;; 22 ) (:states snow-ball-roller-idle) @@ -34058,8 +34064,8 @@ :heap-base #x20 :flag-assert #x100020008c (:methods - (snow-ball-method-14 (_type_ (inline-array snow-ball-junction) float int) symbol 14) - (snow-ball-method-15 (_type_ (inline-array snow-ball-junction) int) symbol 15) + (snow-ball-method-14 (_type_ (inline-array snow-ball-junction) float int) symbol) ;; 14 + (snow-ball-method-15 (_type_ (inline-array snow-ball-junction) int) symbol) ;; 15 ) (:states snow-ball-idle) @@ -34097,7 +34103,7 @@ ) (deftype snow-eggtop (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (spawn-trans vector :inline :offset-assert 176) (play-sound? symbol :offset-assert 192) ) @@ -34112,7 +34118,7 @@ ) (deftype snowpusher (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (max-frame float :offset-assert 176) (open-sound sound-name :offset-assert 192) (close-sound sound-name :offset-assert 208) @@ -34139,7 +34145,7 @@ ) (deftype snow-fort-gate (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (part2 sparticle-launch-control :offset-assert 176) (part3 sparticle-launch-control :offset-assert 180) (open-trans vector :inline :offset-assert 192) @@ -34162,7 +34168,7 @@ :heap-base #x40 :flag-assert #x15004000b0 (:methods - (snow-gears-method-20 (_type_) none 20) + (snow-gears-method-20 (_type_) none) ;; 20 ) (:states snow-gears-idle @@ -34172,7 +34178,7 @@ ) (deftype snow-switch (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (pressed? symbol :offset-assert 176) (fcell-handle handle :offset-assert 184) (orig-trans vector :inline :offset-assert 192) @@ -34188,7 +34194,7 @@ ) (deftype snow-log (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (master entity-actor :offset-assert 176) ) :method-count-assert 20 @@ -34203,7 +34209,7 @@ ) (deftype snow-log-button (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (log entity-actor :offset-assert 176) (orig-trans vector :inline :offset-assert 192) ) @@ -34271,7 +34277,7 @@ ) (deftype snow-button (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (wiggled? symbol :offset-assert 176) (trying-for-fuel-cell? symbol :offset-assert 180) ;; PAL patch here (timeout time-frame :offset-assert 184) @@ -34341,8 +34347,8 @@ :heap-base #x60 :flag-assert #x16006000c8 (:methods - (snow-bumper-method-20 (_type_) none 20) - (shove-player (_type_ process-drawable) none 21) + (snow-bumper-method-20 (_type_) none) ;; 20 + (shove-player (_type_ process-drawable) none) ;; 21 ) (:states snow-bumper-spawn-fuel-cell @@ -34366,7 +34372,7 @@ ;; - Types (deftype ram (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (ram-id int32 :offset-assert 176) (give-fuel-cell? symbol :offset-assert 180) (give-fuel-cell-anim spool-anim :offset-assert 184) @@ -34379,9 +34385,9 @@ :heap-base #x70 :flag-assert #x17007000e0 (:methods - (ram-method-20 (_type_) object 20) - (ram-method-21 (_type_) object 21) - (ram-method-22 (_type_) symbol 22) + (ram-method-20 (_type_) object) ;; 20 + (ram-method-21 (_type_) object) ;; 21 + (ram-method-22 (_type_) symbol) ;; 22 ) (:states ram-fun-idle @@ -34439,9 +34445,9 @@ :heap-base #x190 :flag-assert #x4c019001f4 (:methods - (ram-boss-method-51 (_type_ vector) symbol :replace 51) - (ram-boss-method-52 (_type_) symbol :replace 52) - (ram-boss-method-57 (_type_ float) float :replace 57) + (ram-boss-method-51 (_type_ vector) symbol :overlay-at nav-enemy-method-51) ;; 51 + (ram-boss-method-52 (_type_) symbol :overlay-at nav-enemy-method-52) ;; 52 + (ram-boss-method-57 (_type_ float) float :overlay-at nav-enemy-method-57) ;; 57 ) (:states ram-boss-tracking @@ -34540,8 +34546,8 @@ :heap-base #x60 :flag-assert #x16006000c8 (:methods - (yeti-method-20 (_type_ vector vector) symbol 20) - (aggro? (_type_ vector) symbol 21) + (yeti-method-20 (_type_ vector vector) symbol) ;; 20 + (aggro? (_type_ vector) symbol) ;; 21 ) (:states yeti-resuming-start @@ -34607,7 +34613,7 @@ ) (deftype darkecobarrel-base (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (speed float :offset-assert 176) (sync time-frame :offset-assert 184) ) @@ -34669,19 +34675,19 @@ ) (deftype chainmine (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112)) + ((root collide-shape-moving :override)) :method-count-assert 22 :size-assert #xb0 :heap-base #x40 :flag-assert #x16004000b0 (:methods - (die () _type_ :state 20) - (idle () _type_ :state 21) + (die () _type_ :state) ;; 20 + (idle () _type_ :state) ;; 21 ) ) (deftype lavaballoon (process-drawable) - ((root-override collide-shape :score 100 :offset 112) + ((root collide-shape :override) (move-per-tick float :offset-assert 176) ) :method-count-assert 22 @@ -34689,8 +34695,8 @@ :heap-base #x50 :flag-assert #x16005000b4 (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (idle () _type_ :state) ;; 20 + (die () _type_ :state) ;; 21 ) ) @@ -34746,7 +34752,7 @@ ;; - Types (deftype energydoor (process-drawable) - ((root-override collide-shape-moving :score 100 :offset 112) + ((root collide-shape-moving :override) (alt-actor entity-actor :offset-assert 176) ) :method-count-assert 20 @@ -34798,7 +34804,7 @@ (deftype energyarm (process-drawable) ((parent-overide (pointer energyhub) :score 100 :offset 12) (self-override energyarm :score 100 :offset 28) - (root-override collide-shape-moving :score 100 :offset 112) + (root collide-shape-moving :override) (offset vector :inline :offset-assert 176) (y-rotation float :offset-assert 192) (y-chatter-rotation bouncing-float :inline :offset-assert 196) @@ -34822,7 +34828,7 @@ (deftype energyball (process-drawable) ((parent-overide (pointer energyarm) :score 100 :offset 12) - (root-override collide-shape-moving :score 100 :offset 112)) + (root collide-shape-moving :override)) :method-count-assert 20 :size-assert #xb0 :heap-base #x40 @@ -34832,7 +34838,7 @@ ) (deftype energylava (process-drawable) - ((root-override basic :offset 112)) + () :method-count-assert 20 :size-assert #xb0 :heap-base #x40 @@ -34927,10 +34933,10 @@ :size-assert #xf0 :flag-assert #x18008000f0 (:methods - (idle () _type_ :state 20) - (startup () _type_ :state 21) - (hidden () _type_ :state 22) - (ndi () _type_ :state 23) + (idle () _type_ :state) ;; 20 + (startup () _type_ :state) ;; 21 + (hidden () _type_ :state) ;; 22 + (ndi () _type_ :state) ;; 23 ) ) @@ -34943,7 +34949,7 @@ :size-assert #xb4 :flag-assert #x15005000b4 (:methods - (idle () _type_ :state 20) + (idle () _type_ :state) ;; 20 ) ) @@ -34996,7 +35002,7 @@ ;; cavegeyserrock (deftype cavegeyserrock (process-drawable) - ((root-override collide-shape-moving :score 30 :offset 112) + ((root collide-shape-moving :override) (do-burst? symbol :offset-assert 176) (do-falling-sound? symbol :offset-assert 180) (do-landing-sound? symbol :offset-assert 184) @@ -35014,8 +35020,8 @@ :heap-base #xe0 ;; inherited inpspect of process-drawable (:methods - (cavegeyserrock-method-20 (_type_) none 20) - (cavegeyserrock-method-21 (_type_) none 21) + (cavegeyserrock-method-20 (_type_) none) ;; 20 + (cavegeyserrock-method-21 (_type_) none) ;; 21 ) (:states cavegeyserrock-idle diff --git a/decompiler/config/jak1/ntsc_v1/inputs.jsonc b/decompiler/config/jak1/ntsc_v1/inputs.jsonc index fb67422669e..afe79b72f63 100644 --- a/decompiler/config/jak1/ntsc_v1/inputs.jsonc +++ b/decompiler/config/jak1/ntsc_v1/inputs.jsonc @@ -9,9 +9,7 @@ // you want to run on the entire game. "dgo_names": [ "CGO/KERNEL.CGO", - "CGO/ENGINE.CGO", "CGO/GAME.CGO", - "CGO/ART.CGO", "DGO/BEA.DGO", "DGO/CIT.DGO", "CGO/COMMON.CGO", diff --git a/decompiler/config/jak1/ntsc_v1/var_names.jsonc b/decompiler/config/jak1/ntsc_v1/var_names.jsonc index c024c3408bf..8dc85e2b22b 100644 --- a/decompiler/config/jak1/ntsc_v1/var_names.jsonc +++ b/decompiler/config/jak1/ntsc_v1/var_names.jsonc @@ -1,145 +1,249 @@ { "identity": { - "args": ["this"] + "args": [ + "this" + ] }, - "1/": { - "args": ["x"] + "args": [ + "x" + ] }, - "+": { - "args": ["x", "y"] + "args": [ + "x", + "y" + ] }, - "-": { - "args": ["x", "y"] + "args": [ + "x", + "y" + ] }, - "*": { - "args": ["x", "y"] + "args": [ + "x", + "y" + ] }, - "/": { - "args": ["x", "y"] + "args": [ + "x", + "y" + ] }, - "ash": { - "args": ["value", "shift-amount"] + "args": [ + "value", + "shift-amount" + ] }, - "mod": { - "args": ["x", "y"] + "args": [ + "x", + "y" + ] }, - "rem": { - "args": ["x", "y"] + "args": [ + "x", + "y" + ] }, - "abs": { - "args": ["x"] + "args": [ + "x" + ] }, - "min": { - "args": ["x", "y"] + "args": [ + "x", + "y" + ] }, - "max": { - "args": ["x", "y"] + "args": [ + "x", + "y" + ] }, - "logior": { - "args": ["x", "y"] + "args": [ + "x", + "y" + ] }, - "logand": { - "args": ["x", "y"] + "args": [ + "x", + "y" + ] }, - "lognor": { - "args": ["x", "y"] + "args": [ + "x", + "y" + ] }, - "logxor": { - "args": ["x", "y"] + "args": [ + "x", + "y" + ] }, - "lognot": { - "args": ["x"] + "args": [ + "x" + ] }, - "basic-type?": { - "args": ["this", "parent-type"], - "vars": { "v1-0": "obj-type", "a0-1": "end-type" } + "args": [ + "this", + "parent-type" + ], + "vars": { + "v1-0": "obj-type", + "a0-1": "end-type" + } }, - "type-type?": { - "args": ["child-type", "parent-type"], - "vars": { "v1-0": "end-type" } + "args": [ + "child-type", + "parent-type" + ], + "vars": { + "v1-0": "end-type" + } }, - "find-parent-method": { - "args": ["child-type", "method-id"], + "args": [ + "child-type", + "method-id" + ], "vars": { "v0-0": "current-method", "v1-2": "original-method", "v1-5": "unused1" } }, - "ref": { - "args": ["lst", "index"], - "vars": { "v1-0": "count" } + "args": [ + "lst", + "index" + ], + "vars": { + "v1-0": "count" + } }, - "(method 4 pair)": { - "vars": { "v0-0": "result", "v1-1": "iter" } + "vars": { + "v0-0": "result", + "v1-1": "iter" + } }, - "last": { - "args": ["lst"], - "vars": { "v0-0": "iter" } + "args": [ + "lst" + ], + "vars": { + "v0-0": "iter" + } }, "member": { - "args": ["this", "lst"], - "vars": { "v1-0": "iter" } + "args": [ + "this", + "lst" + ], + "vars": { + "v1-0": "iter" + } }, "nmember": { - "args": ["this", "lst"] + "args": [ + "this", + "lst" + ] }, "assoc": { - "args": ["item", "alist"], - "vars": { "v1-0": "iter" } + "args": [ + "item", + "alist" + ], + "vars": { + "v1-0": "iter" + } }, "assoce": { - "args": ["item", "alist"], - "vars": { "v1-0": "iter" } + "args": [ + "item", + "alist" + ], + "vars": { + "v1-0": "iter" + } }, "nassoc": { - "args": ["item-name", "alist"], - "vars": { "a1-1": "key" } + "args": [ + "item-name", + "alist" + ], + "vars": { + "a1-1": "key" + } }, "nassoce": { - "args": ["item-name", "alist"], - "vars": { "s4-0": "key" } + "args": [ + "item-name", + "alist" + ], + "vars": { + "s4-0": "key" + } }, "append!": { - "args": ["front", "back"], - "vars": { "v1-1": "iter" } + "args": [ + "front", + "back" + ], + "vars": { + "v1-1": "iter" + } }, "delete!": { - "args": ["item", "lst"], - "vars": { "a2-0": "iter", "v1-1": "iter-prev" } + "args": [ + "item", + "lst" + ], + "vars": { + "a2-0": "iter", + "v1-1": "iter-prev" + } }, "delete-car!": { - "args": ["item", "lst"], - "vars": { "a2-0": "iter", "v1-2": "iter-prev" } + "args": [ + "item", + "lst" + ], + "vars": { + "a2-0": "iter", + "v1-2": "iter-prev" + } }, "insert-cons!": { - "args": ["kv", "alist"], - "vars": { "a3-0": "updated-list" } + "args": [ + "kv", + "alist" + ], + "vars": { + "a3-0": "updated-list" + } }, "sort": { - "args": ["lst", "compare-func"], + "args": [ + "lst", + "compare-func" + ], "vars": { "s4-0": "unsorted-count", "s3-0": "iter", @@ -149,32 +253,65 @@ } }, "(method 0 inline-array-class)": { - "args": ["allocation", "type-to-make", "size"], - "vars": { "v0-0": "this" } + "args": [ + "allocation", + "type-to-make", + "size" + ], + "vars": { + "v0-0": "this" + } }, "(method 0 array)": { - "args": ["allocation", "type-to-make", "content-type", "len"], - "vars": { "v0-1": "this" } + "args": [ + "allocation", + "type-to-make", + "content-type", + "len" + ], + "vars": { + "v0-1": "this" + } }, - "(method 2 array)": { - "vars": { "v1-1": "content-type-sym" } + "vars": { + "v1-1": "content-type-sym" + } }, - "(method 3 array)": { - "vars": { "v1-1": "content-type-sym" } + "vars": { + "v1-1": "content-type-sym" + } }, - "mem-copy!": { - "args": ["dst", "src", "size"], - "vars": { "v0-0": "result", "v1-0": "i" } + "args": [ + "dst", + "src", + "size" + ], + "vars": { + "v0-0": "result", + "v1-0": "i" + } }, "qmem-copy<-!": { - "args": ["dst", "src", "size"], - "vars": { "v0-0": "result", "v1-1": "qwc", "a2-1": "value" } + "args": [ + "dst", + "src", + "size" + ], + "vars": { + "v0-0": "result", + "v1-1": "qwc", + "a2-1": "value" + } }, "qmem-copy->!": { - "args": ["dst", "src", "size"], + "args": [ + "dst", + "src", + "size" + ], "vars": { "v0-0": "result", "v1-1": "qwc", @@ -184,178 +321,350 @@ } }, "mem-set32!": { - "args": ["dst", "size", "value"], - "vars": { "v0-0": "result", "v1-0": "i" } + "args": [ + "dst", + "size", + "value" + ], + "vars": { + "v0-0": "result", + "v1-0": "i" + } }, "mem-or!": { - "args": ["dst", "src", "size"], - "vars": { "v0-0": "result", "v1-0": "i" } + "args": [ + "dst", + "src", + "size" + ], + "vars": { + "v0-0": "result", + "v1-0": "i" + } }, "fact": { - "args": ["x"] + "args": [ + "x" + ] }, "mem-print": { - "args": ["data", "word-count"], - "vars": { "s4-0": "current-qword" } + "args": [ + "data", + "word-count" + ], + "vars": { + "s4-0": "current-qword" + } }, "print-tree-bitmask": { - "args": ["bits", "count"], - "vars": { "s4-0": "i" } + "args": [ + "bits", + "count" + ], + "vars": { + "s4-0": "i" + } }, "valid?": { - "args": ["this", "expected-type", "name", "allow-false", "print-dest"], - "vars": { "v1-1": "in-goal-mem" } + "args": [ + "this", + "expected-type", + "name", + "allow-false", + "print-dest" + ], + "vars": { + "v1-1": "in-goal-mem" + } }, - - // GKERNEL - "(method 0 cpu-thread)": { - "vars": { "v0-0": ["this", "cpu-thread"] } + "vars": { + "v0-0": [ + "this", + "cpu-thread" + ] + } }, - "inspect-process-heap": { - "vars": { "s5-0": ["this", "pointer"] } + "vars": { + "s5-0": [ + "this", + "pointer" + ] + } }, - "(method 23 dead-pool-heap)": { - "args": ["this", "rec"] + "args": [ + "this", + "rec" + ] }, - "(method 0 dead-pool-heap)": { - "vars": { "v0-0": ["this", "dead-pool-heap"] } + "vars": { + "v0-0": [ + "this", + "dead-pool-heap" + ] + } }, - "seek": { - "args": ["x", "target", "diff"], - "vars": { "f2-0": "err" } + "args": [ + "x", + "target", + "diff" + ], + "vars": { + "f2-0": "err" + } }, - "lerp": { - "args": ["minimum", "maximum", "amount"] + "args": [ + "minimum", + "maximum", + "amount" + ] }, - "lerp-scale": { - "args": ["min-out", "max-out", "in", "min-in", "max-in"], - "vars": { "f0-1": "scale" } + "args": [ + "min-out", + "max-out", + "in", + "min-in", + "max-in" + ], + "vars": { + "f0-1": "scale" + } }, - "lerp-clamp": { - "args": ["minimum", "maximum", "amount"] + "args": [ + "minimum", + "maximum", + "amount" + ] }, - "rand-vu-int-range": { - "args": ["first", "second"], - "vars": { "f0-4": "float-in-range" } + "args": [ + "first", + "second" + ], + "vars": { + "f0-4": "float-in-range" + } }, - "(method 0 bit-array)": { - "args": ["allocation", "type-to-make", "length"], - "vars": { "v0-0": "this" } + "args": [ + "allocation", + "type-to-make", + "length" + ], + "vars": { + "v0-0": "this" + } }, - "(method 12 bit-array)": { - "vars": { "v1-2": "idx" } + "vars": { + "v1-2": "idx" + } }, - "box-vector-enside?": { - "args": ["box", "pt"] + "args": [ + "box", + "pt" + ] }, - "box-vector-inside?": { - "args": ["box", "pt"] + "args": [ + "box", + "pt" + ] }, - "string=": { - "args": ["str-a", "str-b"], - "vars": { "a2-0": "a-ptr", "v1-0": "b-ptr" } + "args": [ + "str-a", + "str-b" + ], + "vars": { + "a2-0": "a-ptr", + "v1-0": "b-ptr" + } }, - "string-charp=": { - "args": ["str", "charp"], - "vars": { "v1-0": "str-ptr" } + "args": [ + "str", + "charp" + ], + "vars": { + "v1-0": "str-ptr" + } }, - "copyn-string<-charp": { - "args": ["str", "charp", "len"], - "vars": { "a3-0": "i", "v1-0": "str-ptr" } + "args": [ + "str", + "charp", + "len" + ], + "vars": { + "a3-0": "i", + "v1-0": "str-ptr" + } }, - "string<-charp": { - "args": ["str", "charp"], - "vars": { "v1-0": "str-ptr" } + "args": [ + "str", + "charp" + ], + "vars": { + "v1-0": "str-ptr" + } }, - "charp<-string": { - "args": ["charp", "str"], - "vars": { "v1-0": "str-ptr" } + "args": [ + "charp", + "str" + ], + "vars": { + "v1-0": "str-ptr" + } }, - "copy-charp<-charp": { - "args": ["dst", "src"] + "args": [ + "dst", + "src" + ] }, - "cat-string<-string": { - "args": ["a", "b"], - "vars": { "v1-0": "a-ptr", "a1-1": "b-ptr" } + "args": [ + "a", + "b" + ], + "vars": { + "v1-0": "a-ptr", + "a1-1": "b-ptr" + } }, - "catn-string<-charp": { - "args": ["a", "b", "len"], - "vars": { "v1-0": "a-ptr", "a3-2": "i" } + "args": [ + "a", + "b", + "len" + ], + "vars": { + "v1-0": "a-ptr", + "a3-2": "i" + } }, - "cat-string<-string_to_charp": { - "args": ["a", "b", "end-ptr"], - "vars": { "v1-0": "b-ptr", "v0-0": "a-ptr" } + "args": [ + "a", + "b", + "end-ptr" + ], + "vars": { + "v1-0": "b-ptr", + "v0-0": "a-ptr" + } }, - "append-character-to-string": { - "args": ["str", "char"], - "vars": { "v1-0": "str-ptr" } + "args": [ + "str", + "char" + ], + "vars": { + "v1-0": "str-ptr" + } }, - "charp-basename": { - "args": ["charp"], - "vars": { "v1-0": "ptr" } + "args": [ + "charp" + ], + "vars": { + "v1-0": "ptr" + } }, - "string?": { - "args": ["a", "b"], - "vars": { "s4-1": "len", "v1-4": "i" } + "args": [ + "a", + "b" + ], + "vars": { + "s4-1": "len", + "v1-4": "i" + } }, "string<=?": { - "args": ["a", "b"], - "vars": { "s4-1": "len", "v1-4": "i" } + "args": [ + "a", + "b" + ], + "vars": { + "s4-1": "len", + "v1-4": "i" + } }, "string>=?": { - "args": ["a", "b"], - "vars": { "s4-1": "len", "v1-4": "i" } + "args": [ + "a", + "b" + ], + "vars": { + "s4-1": "len", + "v1-4": "i" + } }, "string-cat-to-last-char": { - "args": ["base-str", "append-str", "char"], - "vars": { "s4-0": "end-of-append", "v1-0": "location-of-char" } + "args": [ + "base-str", + "append-str", + "char" + ], + "vars": { + "s4-0": "end-of-append", + "v1-0": "location-of-char" + } }, "string-suck-up!": { - "args": ["str", "location"], - "vars": { "v1-2": "str-ptr" } + "args": [ + "str", + "location" + ], + "vars": { + "v1-2": "str-ptr" + } }, "string-strip-trailing-whitespace!": { - "args": ["str"], - "vars": { "v1-6": "ptr" } + "args": [ + "str" + ], + "vars": { + "v1-6": "ptr" + } }, - "string-get-arg!!": { - "args": ["a-str", "arg"], - "vars": { "s4-0": "arg-word-start", "s4-1": "arg-end", "v1-3": "arg-start" } + "args": [ + "a-str", + "arg" + ], + "vars": { + "s4-0": "arg-word-start", + "s4-1": "arg-end", + "v1-3": "arg-start" + } }, - "string->int": { - "args": ["str"], + "args": [ + "str" + ], "vars": { "a0-1": "str-ptr", "v0-0": "result", @@ -364,11 +673,14 @@ "v1-0": "negate" } }, - "string-get-flag!!": { - "args": ["result", "in", "first-flag", "second-flag"] + "args": [ + "result", + "in", + "first-flag", + "second-flag" + ] }, - "(method 0 state)": { "args": [ "allocation", @@ -380,135 +692,240 @@ "exit", "event" ], - "vars": { "v0-0": "this" } + "vars": { + "v0-0": "this" + } }, - "previous-brother": { - "args": ["proc"], - "vars": { "v1-0": "parent", "v1-2": "child" } + "args": [ + "proc" + ], + "vars": { + "v1-0": "parent", + "v1-2": "child" + } }, - - // Matrix "matrix-identity": { - "args": ["mat"], - "vars": { "f0-0": "one" } + "args": [ + "mat" + ], + "vars": { + "f0-0": "one" + } }, - "matrix+!": { - "args": ["dst", "src1", "src2"], - "vars": { "v1-0": "i" } + "args": [ + "dst", + "src1", + "src2" + ], + "vars": { + "v1-0": "i" + } }, - "matrix-!": { - "args": ["dst", "src1", "src2"], - "vars": { "v1-0": "i" } + "args": [ + "dst", + "src1", + "src2" + ], + "vars": { + "v1-0": "i" + } }, - "matrix*!": { - "args": ["dst", "src1", "src2"] + "args": [ + "dst", + "src1", + "src2" + ] }, - "matrixp*!": { - "args": ["dst", "src1", "src2"], - "vars": { "s5-0": "temp-mat" } + "args": [ + "dst", + "src1", + "src2" + ], + "vars": { + "s5-0": "temp-mat" + } }, - "vector-matrix*!": { - "args": ["dst", "vec", "mat"] + "args": [ + "dst", + "vec", + "mat" + ] }, - "vector-rotate*!": { - "args": ["dst", "vec", "mat"] + "args": [ + "dst", + "vec", + "mat" + ] }, - "vector3s-matrix*!": { - "args": ["dst", "vec", "mat"], - "vars": { "s5-0": "temp-vec3" } + "args": [ + "dst", + "vec", + "mat" + ], + "vars": { + "s5-0": "temp-vec3" + } }, - "vector3s-rotate*!": { - "args": ["dst", "vec", "mat"], - "vars": { "s5-0": "temp-vec3" } + "args": [ + "dst", + "vec", + "mat" + ], + "vars": { + "s5-0": "temp-vec3" + } }, - "matrix-transpose!": { - "args": ["dst", "src"] + "args": [ + "dst", + "src" + ] }, - "matrix-inverse-of-rot-trans!": { - "args": ["dst", "src"] + "args": [ + "dst", + "src" + ] }, - "matrix-4x4-inverse!": { - "args": ["dst", "src"] + "args": [ + "dst", + "src" + ] }, - "matrix-translate!": { - "args": ["dst", "trans"] + "args": [ + "dst", + "trans" + ] }, - "matrix-translate+!": { - "args": ["dst", "src", "trans"] + "args": [ + "dst", + "src", + "trans" + ] }, - "matrix-scale!": { - "args": ["dst", "scale"] + "args": [ + "dst", + "scale" + ] }, - "scale-matrix!": { - "args": ["dst", "scale", "src"] + "args": [ + "dst", + "scale", + "src" + ] }, - "matrix-inv-scale!": { - "args": ["dst", "scale"] + "args": [ + "dst", + "scale" + ] }, - "column-scale-matrix!": { - "args": ["dst", "scale", "src"] + "args": [ + "dst", + "scale", + "src" + ] }, - "matrix-rotate-x!": { - "args": ["dst", "rot-deg"], - "vars": { "f30-0": "rot-sin", "f0-0": "rot-cos" } + "args": [ + "dst", + "rot-deg" + ], + "vars": { + "f30-0": "rot-sin", + "f0-0": "rot-cos" + } }, - "matrix-rotate-y!": { - "args": ["dst", "rot-deg"], - "vars": { "f30-0": "rot-sin", "f0-0": "rot-cos" } + "args": [ + "dst", + "rot-deg" + ], + "vars": { + "f30-0": "rot-sin", + "f0-0": "rot-cos" + } }, - "matrix-rotate-z!": { - "args": ["dst", "rot-deg"], - "vars": { "f30-0": "rot-sin", "f0-0": "rot-cos" } + "args": [ + "dst", + "rot-deg" + ], + "vars": { + "f30-0": "rot-sin", + "f0-0": "rot-cos" + } }, - "matrix-rotate-zyx!": { - "args": ["dst", "rot-xyz-deg"], - "vars": { "gp-0": "temp-mat", "s5-0": "rot-mat" } + "args": [ + "dst", + "rot-xyz-deg" + ], + "vars": { + "gp-0": "temp-mat", + "s5-0": "rot-mat" + } }, - "matrix-rotate-xyz!": { - "args": ["dst", "rot-xyz-deg"], - "vars": { "gp-0": "temp-mat", "s5-0": "rot-mat" } + "args": [ + "dst", + "rot-xyz-deg" + ], + "vars": { + "gp-0": "temp-mat", + "s5-0": "rot-mat" + } }, - "matrix-rotate-zxy!": { - "args": ["dst", "rot-xyz-deg"], - "vars": { "gp-0": "temp-mat", "s5-0": "rot-mat" } + "args": [ + "dst", + "rot-xyz-deg" + ], + "vars": { + "gp-0": "temp-mat", + "s5-0": "rot-mat" + } }, - "matrix-rotate-yxz!": { - "args": ["dst", "rot-xyz-deg"], - "vars": { "gp-0": "temp-mat", "s5-0": "rot-mat" } + "args": [ + "dst", + "rot-xyz-deg" + ], + "vars": { + "gp-0": "temp-mat", + "s5-0": "rot-mat" + } }, - "matrix-rotate-yzx!": { - "args": ["dst", "rot-xyz-deg"], - "vars": { "gp-0": "temp-mat", "s5-0": "rot-mat" } + "args": [ + "dst", + "rot-xyz-deg" + ], + "vars": { + "gp-0": "temp-mat", + "s5-0": "rot-mat" + } }, - "matrix-rotate-yxy!": { - "args": ["dst", "rots-deg"], + "args": [ + "dst", + "rots-deg" + ], "vars": { "a2-0": "sincos-input", "s5-0": "sin-vec", @@ -521,94 +938,152 @@ "f4-0": "sin-z" } }, - "matrix-rotate-yx!": { - "args": ["dst", "rot-y-deg", "rot-x-deg"] + "args": [ + "dst", + "rot-y-deg", + "rot-x-deg" + ] }, - "matrix-axis-angle!": { - "args": ["dst", "axis", "angle-deg"] + "args": [ + "dst", + "axis", + "angle-deg" + ] }, - "matrix-lerp!": { - "args": ["dst", "src1", "src2", "alpha"] + "args": [ + "dst", + "src1", + "src2", + "alpha" + ] }, - "matrix-3x3-determinant": { - "args": ["mat"] + "args": [ + "mat" + ] }, - "matrix-3x3-inverse!": { - "args": ["dst", "src"] + "args": [ + "dst", + "src" + ] }, - "matrix-3x3-inverse-transpose!": { - "args": ["dst", "src"] + "args": [ + "dst", + "src" + ] }, - "matrix3-inverse-transpose!": { - "args": ["dst", "src"] + "args": [ + "dst", + "src" + ] }, - "matrix-4x4-determinant": { - "args": ["dst", "src"] + "args": [ + "dst", + "src" + ] }, - "matrix-4x4-inverse-transpose!": { - "args": ["dst", "src"] + "args": [ + "dst", + "src" + ] }, - "matrix-y-angle": { - "args": ["mat"], - "vars": { "v1-0": "z-row" } + "args": [ + "mat" + ], + "vars": { + "v1-0": "z-row" + } }, - "(method 0 trs)": { - "vars": { "gp-0": "this" } + "vars": { + "gp-0": "this" + } }, - "transform-matrix-calc!": { - "args": ["tf", "dst-mat"] + "args": [ + "tf", + "dst-mat" + ] }, - "transform-matrix-parent-calc!": { - "args": ["tf", "dst-mat", "inv-scale"] + "args": [ + "tf", + "dst-mat", + "inv-scale" + ] }, - "trs-matrix-calc!": { - "args": ["tf", "dst-mat"] + "args": [ + "tf", + "dst-mat" + ] }, - "quaternion-axis-angle!": { - "args": ["quat", "x", "y", "z", "angle"] + "args": [ + "quat", + "x", + "y", + "z", + "angle" + ] }, - "quaternion-vector-angle!": { - "args": ["quat", "axis", "angle"] + "args": [ + "quat", + "axis", + "angle" + ] }, - "vector-flatten!": { - "args": ["dst", "src", "plane-normal"] + "args": [ + "dst", + "src", + "plane-normal" + ] }, - "vector-reflect!": { - "args": ["dst", "src", "plane-normal"] + "args": [ + "dst", + "src", + "plane-normal" + ] }, - "vector-reflect-flat!": { - "args": ["dst", "src", "plane-normal"] + "args": [ + "dst", + "src", + "plane-normal" + ] }, - "vector-reflect-true-flat!": { - "args": ["dst", "src", "plane-normal"] + "args": [ + "dst", + "src", + "plane-normal" + ] }, - "vector-reflect-flat-above!": { - "args": ["dst", "src", "plane-normal"] + "args": [ + "dst", + "src", + "plane-normal" + ] }, - "deg-seek": { - "args": ["in", "target", "max-diff"], + "args": [ + "in", + "target", + "max-diff" + ], "vars": { "v1-1": "in-int", "a0-2": "target-int", @@ -617,53 +1092,109 @@ "a3-0": "abs-diff" } }, - "deg-seek-smooth": { - "args": ["in", "target", "max-diff", "amount"], - "vars": { "f0-1": "step" } + "args": [ + "in", + "target", + "max-diff", + "amount" + ], + "vars": { + "f0-1": "step" + } }, - "deg-lerp-clamp": { - "args": ["min-val", "max-val", "in"] + "args": [ + "min-val", + "max-val", + "in" + ] }, - "sinerp-clamp": { - "args": ["minimum", "maximum", "amount"] + "args": [ + "minimum", + "maximum", + "amount" + ] }, - "coserp-clamp": { - "args": ["minimum", "maximum", "amount"] + "args": [ + "minimum", + "maximum", + "amount" + ] }, "coserp": { - "args": ["minimum", "maximum", "amount"] + "args": [ + "minimum", + "maximum", + "amount" + ] }, - "coserp180-clamp": { - "args": ["minimum", "maximum", "amount"] + "args": [ + "minimum", + "maximum", + "amount" + ] }, "coserp180": { - "args": ["minimum", "maximum", "amount"] + "args": [ + "minimum", + "maximum", + "amount" + ] }, "ease-in-out": { - "args": ["total", "progress"] + "args": [ + "total", + "progress" + ] }, "dma-send-to-spr": { - "args": ["sadr", "madr", "qwc", "sync"] + "args": [ + "sadr", + "madr", + "qwc", + "sync" + ] }, "dma-send-to-spr-no-flush": { - "args": ["sadr", "madr", "qwc", "sync"] + "args": [ + "sadr", + "madr", + "qwc", + "sync" + ] }, "dma-send-from-spr": { - "args": ["madr", "sadr", "qwc", "sync"] + "args": [ + "madr", + "sadr", + "qwc", + "sync" + ] }, "dma-send-from-spr-no-flush": { - "args": ["madr", "sadr", "qwc", "sync"] + "args": [ + "madr", + "sadr", + "qwc", + "sync" + ] }, "dump-vu1-range": { - "args": ["start", "total-count"] + "args": [ + "start", + "total-count" + ] }, "ultimate-memcpy": { - "args": ["dst", "src", "size-bytes"], + "args": [ + "dst", + "src", + "size-bytes" + ], "vars": { "s2-0": "qwc-remaining", "s1-0": "qwc-transferred-now", @@ -671,57 +1202,100 @@ "s3-0": "spr-from-bank" } }, - "dma-buffer-add-vu-function": { - "args": ["dma-buf", "vu-func"], + "args": [ + "dma-buf", + "vu-func" + ], "vars": { "t1-1": "dma-buf-2", "v1-0": "func-ptr", "a3-0": "qlen", "a1-1": "origin", "t0-1": "qwc-now", - "t2-0": ["buf-ptr", "dma-packet"] + "t2-0": [ + "buf-ptr", + "dma-packet" + ] } }, - "dma-buffer-add-buckets": { - "args": ["dma-buf", "count"], - "vars": { "a2-0": "i", "v1-0": ["current-bucket", "dma-bucket"] } + "args": [ + "dma-buf", + "count" + ], + "vars": { + "a2-0": "i", + "v1-0": [ + "current-bucket", + "dma-bucket" + ] + } }, - "dma-buffer-patch-buckets": { - "args": ["bucket", "count"], - "vars": { "v1-1": "i" } + "args": [ + "bucket", + "count" + ], + "vars": { + "v1-1": "i" + } }, - "dma-bucket-insert-tag": { - "args": ["base", "idx", "tag-start", "tag-end"], - "vars": { "v1-1": "bucket" } + "args": [ + "base", + "idx", + "tag-start", + "tag-end" + ], + "vars": { + "v1-1": "bucket" + } }, - "disasm-vif-details": { - "args": ["stream", "data", "kind", "count"], - "vars": { "s4-0": "count2", "s3-0": "data-ptr", "s2-0": "i" } + "args": [ + "stream", + "data", + "kind", + "count" + ], + "vars": { + "s4-0": "count2", + "s3-0": "data-ptr", + "s2-0": "i" + } }, - "disasm-vif-tag": { - "args": ["data", "words", "stream", "details"], + "args": [ + "data", + "words", + "stream", + "details" + ], "vars": { "gp-0": "byte-idx", "v1-0": "cmd-template-idx", "a0-12": "print-kind", "s1-0": "first-tag", "s0-0": "packet-size", - "t1-1": ["stcycl-imm", "vif-stcycl-imm"], + "t1-1": [ + "stcycl-imm", + "vif-stcycl-imm" + ], "sv-16": "cmd", "sv-32": "data-ptr", "sv-48": "data-idx", "sv-64": "unpack-imm" } }, - "disasm-dma-list": { - "args": ["data", "mode", "verbose", "stream", "expected-size"], + "args": [ + "data", + "mode", + "verbose", + "stream", + "expected-size" + ], "vars": { "sv-16": "addr", "sv-32": "data-2", @@ -739,29 +1313,43 @@ "s5-0": "total-tags" } }, - "cpad-invalid!": { - "args": ["pad"] + "args": [ + "pad" + ] }, - "(method 0 cpad-info)": { - "args": ["alloction", "type-to-make", "idx"], - "vars": { "s5-0": "this" } + "args": [ + "alloction", + "type-to-make", + "idx" + ], + "vars": { + "s5-0": "this" + } }, - "analog-input": { - "args": ["in", "offset", "center-val", "max-val", "out-range"], + "args": [ + "in", + "offset", + "center-val", + "max-val", + "out-range" + ], "vars": { "f1-1": "offset-in", "f0-3": "magnitude", "v1-0": "max-magnitude" } }, - "cpad-set-buzz!": { - "args": ["pad", "buzz-idx", "buzz-amount", "duration"] + "args": [ + "pad", + "buzz-idx", + "buzz-amount", + "duration" + ] }, - "service-cpads": { "vars": { "gp-0": "pad-list", @@ -771,63 +1359,115 @@ "v1-29": "current-button0" } }, - "buzz-stop!": { - "args": ["idx"] + "args": [ + "idx" + ] }, - "default-buffer-init": { - "args": ["buff"], + "args": [ + "buff" + ], "vars": { "v1-0": "buff-ptr", "v1-1": "buff-ptr2", "v1-3": "buff-ptr3", "v1-4": "buff-ptr4", - "a1-4": ["packet", "dma-gif-packet"], - "a1-6": ["gif-tag", "gs-gif-tag"], - "a1-8": ["data", "(pointer uint64)"], - "a0-1": ["ret-packet", "dma-packet"], + "a1-4": [ + "packet", + "dma-gif-packet" + ], + "a1-6": [ + "gif-tag", + "gs-gif-tag" + ], + "a1-8": [ + "data", + "(pointer uint64)" + ], + "a0-1": [ + "ret-packet", + "dma-packet" + ], "v1-2": "buff-ptr5" } }, - "add-reg-gif-packet": { - "args": ["packet", "reg-idx", "reg-val"], - "vars": { "v1-0": "tag" } + "args": [ + "packet", + "reg-idx", + "reg-val" + ], + "vars": { + "v1-0": "tag" + } }, - "(method 9 font-context)": { - "args": ["this", "mat"] + "args": [ + "this", + "mat" + ] }, "(method 10 font-context)": { - "args": ["this", "x", "y"] + "args": [ + "this", + "x", + "y" + ] }, "(method 11 font-context)": { - "args": ["this", "z"] + "args": [ + "this", + "z" + ] }, "(method 12 font-context)": { - "args": ["this", "w"] + "args": [ + "this", + "w" + ] }, "(method 13 font-context)": { - "args": ["this", "width"] + "args": [ + "this", + "width" + ] }, "(method 14 font-context)": { - "args": ["this", "height"] + "args": [ + "this", + "height" + ] }, "(method 15 font-context)": { - "args": ["this", "proj"] + "args": [ + "this", + "proj" + ] }, "(method 16 font-context)": { - "args": ["this", "color"] + "args": [ + "this", + "color" + ] }, "(method 17 font-context)": { - "args": ["this", "flags"] + "args": [ + "this", + "flags" + ] }, "(method 18 font-context)": { - "args": ["this", "start-line"] + "args": [ + "this", + "start-line" + ] }, "(method 19 font-context)": { - "args": ["this", "scale"] + "args": [ + "this", + "scale" + ] }, "(method 0 font-context)": { "args": [ @@ -840,16 +1480,24 @@ "color", "flags" ], - "vars": { "v0-0": "this" } + "vars": { + "v0-0": "this" + } }, "font-set-tex0": { - "args": ["ptr-tex0", "tex", "tex-addr", "psm", "clut-addr"] + "args": [ + "ptr-tex0", + "tex", + "tex-addr", + "psm", + "clut-addr" + ] }, - "(method 0 display-frame)": { - "vars": { "gp-0": "this" } + "vars": { + "gp-0": "this" + } }, - "(method 0 draw-context)": { "args": [ "allocation", @@ -859,20 +1507,37 @@ "width", "height", "color-0" - ] + ], + "vars": { + "v0-0": "this" + } }, - "(method 0 display)": { - "args": ["allocation", "type-to-make", "psm", "w", "h", "ztest", "zpsm"], - "vars": { "gp-0": "this" } + "args": [ + "allocation", + "type-to-make", + "psm", + "w", + "h", + "ztest", + "zpsm" + ], + "vars": { + "gp-0": "this" + } }, - "(method 0 ripple-control)": { - "vars": { "v0-0": "this" } + "vars": { + "v0-0": "this" + } }, - "vector-seek-2d-xz-smooth!": { - "args": ["vec", "target", "max-step", "alpha"], + "args": [ + "vec", + "target", + "max-step", + "alpha" + ], "vars": { "f0-1": "x-diff", "f2-1": "z-diff", @@ -881,9 +1546,13 @@ "f2-4": "step-len" } }, - "vector-seek-2d-yz-smooth!": { - "args": ["vec", "target", "max-step", "alpha"], + "args": [ + "vec", + "target", + "max-step", + "alpha" + ], "vars": { "f0-1": "y-diff", "f2-1": "z-diff", @@ -893,9 +1562,13 @@ "f2-6": "step-scale" } }, - "vector-seek-3d-smooth!": { - "args": ["vec", "target", "max-step", "alpha"], + "args": [ + "vec", + "target", + "max-step", + "alpha" + ], "vars": { "f0-1": "x-diff", "f1-2": "y-diff", @@ -907,119 +1580,237 @@ "f3-7": "step-scale" } }, - "seek-with-smooth": { - "args": ["value", "target", "max-step", "alpha", "deadband"], - "vars": { "f0-1": "diff", "f0-2": "step", "f1-4": "min-step" } + "args": [ + "value", + "target", + "max-step", + "alpha", + "deadband" + ], + "vars": { + "f0-1": "diff", + "f0-2": "step", + "f1-4": "min-step" + } }, - "vector-v+!": { - "args": ["result", "position", "velocity"] + "args": [ + "result", + "position", + "velocity" + ] }, - "vector-v*float+!": { - "args": ["result", "position", "velocity", "velocity-scale"] + "args": [ + "result", + "position", + "velocity", + "velocity-scale" + ] }, - "vector-v++!": { - "args": ["position", "velocity"] + "args": [ + "position", + "velocity" + ] }, - "vector-v*float!": { - "args": ["delta-p", "velocity", "scale"] + "args": [ + "delta-p", + "velocity", + "scale" + ] }, - "vector-v*float++!": { - "args": ["position", "velocity", "scale"] + "args": [ + "position", + "velocity", + "scale" + ] }, - "vector-lerp!": { - "args": ["out", "a", "b", "alpha"] + "args": [ + "out", + "a", + "b", + "alpha" + ] }, - "vector-lerp-clamp!": { - "args": ["out", "a", "b", "alpha"] + "args": [ + "out", + "a", + "b", + "alpha" + ] }, - "vector4-lerp!": { - "args": ["out", "a", "b", "alpha"] + "args": [ + "out", + "a", + "b", + "alpha" + ] }, - "vector4-lerp-clamp!": { - "args": ["out", "a", "b", "alpha"] + "args": [ + "out", + "a", + "b", + "alpha" + ] }, - "vector-deg-lerp-clamp!": { - "args": ["out", "min-val", "max-val", "in"] + "args": [ + "out", + "min-val", + "max-val", + "in" + ] }, - "make-file-name": { - "args": ["kind", "name", "art-group-version"] + "args": [ + "kind", + "name", + "art-group-version" + ] }, - "make-vfile-name": { - "args": ["kind", "name"] + "args": [ + "kind", + "name" + ] }, - "file-info-correct-version?": { - "args": ["info", "kind", "version-override"], - "vars": { "s5-0": "expected-version", "s4-0": "kind-name" } + "args": [ + "info", + "kind", + "version-override" + ], + "vars": { + "s5-0": "expected-version", + "s4-0": "kind-name" + } }, - "(method 0 load-dir)": { - "args": ["allocation", "type-to-make", "length", "unk"], - "vars": { "s4-0": "this" } + "args": [ + "allocation", + "type-to-make", + "length", + "unk" + ], + "vars": { + "s4-0": "this" + } }, - "(method 0 load-dir-art-group)": { - "args": ["allocation", "type-to-make", "length", "unk"], - "vars": { "v0-0": "this" } + "args": [ + "allocation", + "type-to-make", + "length", + "unk" + ], + "vars": { + "v0-0": "this" + } }, - "(method 0 external-art-buffer)": { - "args": ["allocation", "type-to-make", "idx"], - "vars": { "v0-0": "this" } + "args": [ + "allocation", + "type-to-make", + "idx" + ], + "vars": { + "v0-0": "this" + } }, - "(method 0 external-art-control)": { - "vars": { "gp-0": "this", "s4-0": "buff-idx", "v1-9": "rec-idx" } + "vars": { + "gp-0": "this", + "s4-0": "buff-idx", + "v1-9": "rec-idx" + } }, - "(method 9 display)": { - "args": ["this", "slowdown"], - "vars": { "gp-0": "this", "s5-0": "ratio" } + "args": [ + "this", + "slowdown" + ], + "vars": { + "gp-0": "this", + "s5-0": "ratio" + } }, - "set-draw-env-offset": { - "args": ["env", "x", "y"] + "args": [ + "env", + "x", + "y" + ] }, - "set-display-env": { - "args": ["env", "psm", "width", "height", "dx", "dy", "fbp"] + "args": [ + "env", + "psm", + "width", + "height", + "dx", + "dy", + "fbp" + ] }, - "set-draw-env": { - "args": ["env", "psm", "width", "height", "ztest", "zpsm", "fbp"] + "args": [ + "env", + "psm", + "width", + "height", + "ztest", + "zpsm", + "fbp" + ] }, - "set-display": { - "args": ["disp", "psm", "w", "h", "ztest", "zpsm"] + "args": [ + "disp", + "psm", + "w", + "h", + "ztest", + "zpsm" + ] }, - "set-display2": { - "args": ["disp", "psm", "w", "h", "ztest", "zpsm"] + "args": [ + "disp", + "psm", + "w", + "h", + "ztest", + "zpsm" + ] }, - "(method 11 profile-bar)": { - "args": ["this", "name", "color"], - "vars": { "s5-0": "new-frame" } + "args": [ + "this", + "name", + "color" + ], + "vars": { + "s5-0": "new-frame" + } }, - "(method 12 profile-bar)": { - "args": ["this", "name", "color"], - "vars": { "v0-0": "new-frame" } + "args": [ + "this", + "name", + "color" + ], + "vars": { + "v0-0": "new-frame" + } }, - "gs-set-default-store-image": { "args": [ "packet", @@ -1032,9 +1823,10 @@ "rrh" ] }, - "store-image": { - "args": ["oddeven"], + "args": [ + "oddeven" + ], "vars": { "s4-0": "buff0", "s1-0": "buff1", @@ -1048,34 +1840,33 @@ "sv-48": "y-idx-2" } }, - - "(method 0 draw-context)": { - "args": [ - "allocation", - "type-to-make", - "org-x", - "org-y", - "width", - "height", - "color-0" - ], - "vars": { "v0-0": "this" } - }, - "draw-context-set-xy": { - "args": ["ctxt", "x", "y"] + "args": [ + "ctxt", + "x", + "y" + ] }, - "texture-qwc": { - "args": ["w", "h", "tex-format"] + "args": [ + "w", + "h", + "tex-format" + ] }, - "gs-find-block": { - "args": ["bx", "by", "tex-format"] + "args": [ + "bx", + "by", + "tex-format" + ] }, - "gs-largest-block": { - "args": ["tex-width", "tex-height", "tex-format"], + "args": [ + "tex-width", + "tex-height", + "tex-format" + ], "vars": { "s5-0": "block-width", "v1-0": "block-height", @@ -1088,9 +1879,12 @@ "s4-1": "max-block" } }, - "gs-blocks-used": { - "args": ["tex-width", "tex-height", "tex-format"], + "args": [ + "tex-width", + "tex-height", + "tex-format" + ], "vars": { "s4-0": "page-width", "v1-0": "page-height", @@ -1100,52 +1894,93 @@ "s1-0": "height-blocks" } }, - "dma-buffer-add-ref-texture": { - "args": ["buf", "data", "tex-w", "tex-h", "tex-format"], + "args": [ + "buf", + "data", + "tex-w", + "tex-h", + "tex-format" + ], "vars": { "s5-0": "data-ptr", "v1-0": "qwc", "a0-4": "qwc-this-time", "a1-3": "eop", - "a3-1": ["setup-dma", "dma-packet"], - "a3-3": ["setup-dif", "gs-gif-tag"], - "a2-4": ["data-dma", "dma-packet"] + "a3-1": [ + "setup-dma", + "dma-packet" + ], + "a3-3": [ + "setup-dif", + "gs-gif-tag" + ], + "a2-4": [ + "data-dma", + "dma-packet" + ] } }, - "(method 15 texture-pool)": { - "args": ["this", "word-count"] + "args": [ + "this", + "word-count" + ] }, - "(method 22 texture-pool)": { - "args": ["this", "tpage-id"] + "args": [ + "this", + "tpage-id" + ] }, - "(method 10 texture-page)": { - "args": ["this", "segment-count", "additional-size"] + "args": [ + "this", + "segment-count", + "additional-size" + ] }, - "(method 16 texture-pool)": { - "args": ["this", "segment", "size"] + "args": [ + "this", + "segment", + "size" + ] }, - "(method 9 texture-page)": { - "args": ["this", "seg"] + "args": [ + "this", + "seg" + ] }, - "texture-page-default-allocate": { - "args": ["pool", "page", "seg", "tpage-id"], - "vars": { "s3-0": "seg-id" } + "args": [ + "pool", + "page", + "seg", + "tpage-id" + ], + "vars": { + "s3-0": "seg-id" + } }, - "texture-page-common-allocate": { - "args": ["pool", "page", "seg", "tpage-id"], - "vars": { "s4-0": "seg-id" } + "args": [ + "pool", + "page", + "seg", + "tpage-id" + ], + "vars": { + "s4-0": "seg-id" + } }, - "(method 12 texture-page)": { - "args": ["this", "new-dest", "seg-id"], + "args": [ + "this", + "new-dest", + "seg-id" + ], "vars": { "a3-4": "dst-block", "t0-1": "tex-id", @@ -1154,24 +1989,45 @@ "t3-4": "mip-id" } }, - "texture-page-common-boot-allocate": { - "args": ["pool", "page", "heap", "tpage-id"], - "vars": { "s2-0": "tex-id" } + "args": [ + "pool", + "page", + "heap", + "tpage-id" + ], + "vars": { + "s2-0": "tex-id" + } }, - "upload-vram-data": { - "args": ["buf", "dest", "tex-data", "tex-h"], + "args": [ + "buf", + "dest", + "tex-data", + "tex-h" + ], "vars": { "a3-2": "height-this-time", - "a0-1": ["dma", "dma-packet"], - "a0-3": ["gif", "gs-gif-tag"], + "a0-1": [ + "dma", + "dma-packet" + ], + "a0-3": [ + "gif", + "gs-gif-tag" + ], "a0-5": "gs-data" } }, - "upload-vram-pages": { - "args": ["pool", "segment", "page", "mode", "bucket-idx"], + "args": [ + "pool", + "segment", + "page", + "mode", + "bucket-idx" + ], "vars": { "s3-0": "dma-buf", "sv-16": "tex-data", @@ -1184,15 +2040,28 @@ "sv-40": "first-chunk-idx-to-upload", "gp-0": "total-upload-size", "s4-0": "dma-start", - "a0-26": ["dma", "dma-packet"], - "a0-28": ["gif", "gs-gif-tag"], + "a0-26": [ + "dma", + "dma-packet" + ], + "a0-28": [ + "gif", + "gs-gif-tag" + ], "a0-30": "gif-data", - "v1-50": ["dma-end", "dma-packet"] + "v1-50": [ + "dma-end", + "dma-packet" + ] } }, - "update-vram-pages": { - "args": ["pool", "pool-segment", "page", "mode"], + "args": [ + "pool", + "pool-segment", + "page", + "mode" + ], "vars": { "t1-0": "dest-block", "t2-0": "sz", @@ -1203,9 +2072,14 @@ "a3-8": "vram-chunk" } }, - "upload-vram-pages-pris": { - "args": ["pool", "segment", "page", "bucket-idx", "allow-cache-mask"], + "args": [ + "pool", + "segment", + "page", + "bucket-idx", + "allow-cache-mask" + ], "vars": { "s3-0": "dma-buf", "sv-16": "tex-data", @@ -1218,14 +2092,27 @@ "sv-52": "current-dest-chunk", "sv-56": "need-tex", "gp-0": "total-upload-size", - "a0-21": ["dma", "dma-packet"], - "a0-23": ["gif", "gs-gif-tag"], - "v1-55": ["dma-end", "dma-packet"] + "a0-21": [ + "dma", + "dma-packet" + ], + "a0-23": [ + "gif", + "gs-gif-tag" + ], + "v1-55": [ + "dma-end", + "dma-packet" + ] } }, - "texture-page-near-allocate-0": { - "args": ["pool", "page", "heap", "mode"], + "args": [ + "pool", + "page", + "heap", + "mode" + ], "vars": { "s3-0": "common-dest", "s2-0": "page-seg-idx", @@ -1234,9 +2121,13 @@ "a0-8": "seg-2-data" } }, - "texture-page-near-allocate-1": { - "args": ["pool", "page", "heap", "mode"], + "args": [ + "pool", + "page", + "heap", + "mode" + ], "vars": { "s4-0": "seg2-size", "a1-1": "seg2-dest", @@ -1244,17 +2135,23 @@ "s1-0": "page-seg-idx" } }, - "texture-page-level-allocate": { - "args": ["pool", "page", "heap", "mode"], + "args": [ + "pool", + "page", + "heap", + "mode" + ], "vars": { "s2-0": "common-id", "v1-6": "level-idx" } }, - "texture-page-dir-inspect": { - "args": ["dir", "mode"], + "args": [ + "dir", + "mode" + ], "vars": { "v1-0": "pool", "s4-0": "level-idx", @@ -1265,9 +2162,12 @@ "s1-0": "entry-list-length" } }, - "texture-page-size-check": { - "args": ["pool", "level", "hide-prints"], + "args": [ + "pool", + "level", + "hide-prints" + ], "vars": { "gp-0": "oversize", "s3-0": "tfrag-page", @@ -1278,9 +2178,13 @@ "v1-9": "water-page" } }, - "(method 13 texture-pool)": { - "args": ["this", "level", "max-page-kind", "id-array"], + "args": [ + "this", + "level", + "max-page-kind", + "id-array" + ], "vars": { "v1-0": "page-idx", "v1-5": "tfrag-dir-entry", @@ -1291,9 +2195,12 @@ "a2-7": "overflow-bits" } }, - "(method 14 texture-pool)": { - "args": ["this", "level", "tex-page-kind"], + "args": [ + "this", + "level", + "tex-page-kind" + ], "vars": { "s3-0": "tfrag-page", "s2-0": "tfrag-bucket", @@ -1313,9 +2220,12 @@ "a3-6": "water-bucket" } }, - "(method 13 texture-page)": { - "args": ["this", "dma-buff", "mode"], + "args": [ + "this", + "dma-buff", + "mode" + ], "vars": { "sv-16": "total-size", "v1-7": "start-segment", @@ -1323,23 +2233,39 @@ "s4-0": "current-dest", "s3-0": "current-data", "a3-1": "chunks-now", - "a0-1": ["pkt", "dma-packet"], - "a0-3": ["gs-tag", "gs-gif-tag"], + "a0-1": [ + "pkt", + "dma-packet" + ], + "a0-3": [ + "gs-tag", + "gs-gif-tag" + ], "a0-5": "gs-reg-data" } }, - "texture-relocate": { - "args": ["dma-buff", "tex", "dest-loc", "dest-fmt", "clut-dst"], + "args": [ + "dma-buff", + "tex", + "dest-loc", + "dest-fmt", + "clut-dst" + ], "vars": { "v1-0": "mip-level", "t1-1": "mip-w", "t2-3": "mip-h", - "t4-0": ["dma-pkt", "dma-packet"], - "t4-2": ["gs-pkt", "gs-gif-tag"] + "t4-0": [ + "dma-pkt", + "dma-packet" + ], + "t4-2": [ + "gs-pkt", + "gs-gif-tag" + ] } }, - "(method 11 texture-pool)": { "vars": { "s3-0": "font-clut", @@ -1361,15 +2287,16 @@ "s0-3": "font-tx-2-fmt" } }, - "link-texture-by-id": { "vars": { "s4-0": "dir-entry" } }, - "(method 9 texture-page-dir)": { - "args": ["this", "heap"], + "args": [ + "this", + "heap" + ], "vars": { "v1-0": "mem-start", "a1-1": "mem-end", @@ -1380,11 +2307,13 @@ "t0-3": "tex-count", "t1-4": "tex-idx", "t2-0": "link-slot", - "t3-2": ["shader", "adgif-shader"], + "t3-2": [ + "shader", + "adgif-shader" + ], "t4-1": "dist-past-end" } }, - "display-loop": { "vars": { "s3-0": "debug-buf", @@ -1392,58 +2321,88 @@ "s5-2": "debug-txt-buf" } }, - "adgif-shader-login": { "args": "shader", "vars": { "s5-0": "tex" } }, - "adgif-shader-login-fast": { - "args": ["shader"], + "args": [ + "shader" + ], "vars": { "v1-4": "tex-id", "a0-9": "dir-entry", "s5-0": "tex" } }, - "texture-page-login": { - "args": ["id", "alloc-func", "heap"], + "args": [ + "id", + "alloc-func", + "heap" + ], "vars": { "s5-0": "dir-entry", "s4-0": "old-alloc-func", "s3-0": "file-name" } }, - "(method 9 __assert-info-private-struct)": { - "args": ["this", "filename", "line-num", "column-num"] + "args": [ + "this", + "filename", + "line-num", + "column-num" + ] }, - "__assert": { - "args": ["exp", "msg"] + "args": [ + "exp", + "msg" + ] }, - "__assert-min-max-range-float": { - "args": ["exp", "minimum", "maximum", "msg-exp", "msg-min", "msg-max"] + "args": [ + "exp", + "minimum", + "maximum", + "msg-exp", + "msg-min", + "msg-max" + ] }, - "__assert-min-max-range-int": { - "args": ["exp", "minimum", "maximum", "msg-exp", "msg-min", "msg-max"] + "args": [ + "exp", + "minimum", + "maximum", + "msg-exp", + "msg-min", + "msg-max" + ] }, - "__assert-zero-lim-range-int": { - "args": ["exp", "maximum", "msg-exp", "msg-max"] + "args": [ + "exp", + "maximum", + "msg-exp", + "msg-max" + ] }, - "fog-corrector-setup": { - "args": ["corrector", "math-cam"] + "args": [ + "corrector", + "math-cam" + ] }, - "update-math-camera": { - "args": ["math-cam", "video-mode", "aspect"], + "args": [ + "math-cam", + "video-mode", + "aspect" + ], "vars": { "f0-4": "temp1", "v1-1": "elim1", @@ -1463,7 +2422,7 @@ "f0-10": "near-corner-dist-sqr", "f2-8": "unused-thing-2", "f1-8": "near-z", - "f0-12": "temp4", + "f0-12": "fog-contsant-3", "a0-6": "elim4", "f1-12": "dx-rat-2", "f0-14": "d-temp-2", @@ -1484,7 +2443,6 @@ "v0-2": "cam-mat", "f2-16": "fog-constant-1", "f3-23": "fog-constant-2", - "f0-12": "fog-contsant-3", "f0-24": "fog-at-near-plane", "f1-22": "fog-factor-2", "f4-35": "cam-fov-mult", @@ -1509,18 +2467,23 @@ "a0-15": "vis-gif-1-again-again" } }, - "move-target-from-pad": { - "args": ["trans", "pad-idx"], + "args": [ + "trans", + "pad-idx" + ], "vars": { "s4-0": "local-trans", "a0-5": "inv-cam-rot", "s3-0": "cam-rot-mat" } }, - "(method 13 profile-bar)": { - "args": ["this", "buf", "bar-pos"], + "args": [ + "this", + "buf", + "bar-pos" + ], "vars": { "v1-1": "height", "a1-4": "block-idx", @@ -1529,53 +2492,93 @@ "v1-3": "end-time", "s4-0": "worst-time-cache", "a3-1": "screen-y", - "t2-0": ["direct-tag", "dma-packet"], - "t2-2": ["start-gif-tag", "gs-gif-tag"], + "t2-0": [ + "direct-tag", + "dma-packet" + ], + "t2-2": [ + "start-gif-tag", + "gs-gif-tag" + ], "t1-4": "block" } }, - "draw-sprite2d-xy": { - "args": ["buf", "x", "y", "w", "h", "color"], + "args": [ + "buf", + "x", + "y", + "w", + "h", + "color" + ], "vars": { "t2-1": "context", "a0-3": "draw-x", "a1-9": "draw-y", "t1-2": "draw-w", "t0-2": "draw-h", - "a3-2": ["dma", "dma-packet"], - "a3-4": ["gif", "gs-gif-tag"], - "v1-10": ["end-dma", "dma-packet"], + "a3-2": [ + "dma", + "dma-packet" + ], + "a3-4": [ + "gif", + "gs-gif-tag" + ], + "v1-10": [ + "end-dma", + "dma-packet" + ], "a0-13": "total-qwc", "a3-6": "gif-buf" } }, - "draw-quad2d": { - "args": ["buf", "context"], + "args": [ + "buf", + "context" + ], "vars": { "a2-1": "draw-x", "a3-7": "draw-y", "t3-0": "draw-w", "t2-0": "draw-h", "v1-8": "end-dma", - "t1-0": ["dma", "dma-packet"], - "t1-2": ["gif", "gs-gif-tag"], + "t1-0": [ + "dma", + "dma-packet" + ], + "t1-2": [ + "gif", + "gs-gif-tag" + ], "t1-4": "gif-buf", "a1-11": "total-qwc" } }, - "set-display-gs-state": { - "args": ["dma-buf", "fbp", "scx", "scy", "fb-msk", "psm"], + "args": [ + "dma-buf", + "fbp", + "scx", + "scy", + "fb-msk", + "psm" + ], "vars": { - "t3-0": ["dma", "dma-packet"], - "t3-2": ["gif", "gs-gif-tag"], + "t3-0": [ + "dma", + "dma-packet" + ], + "t3-2": [ + "gif", + "gs-gif-tag" + ], "t3-4": "gif-buf", "t2-0": "fbw" } }, - "set-display-gs-state-offset": { "args": [ "dma-buf", @@ -1589,90 +2592,202 @@ ], "vars": { "t4-0": "fbw", - "t5-0": ["dma", "dma-packet"], - "t5-2": ["gif", "gs-gif-tag"], - "t5-4": ["gif-data", "(pointer uint64)"] + "t5-0": [ + "dma", + "dma-packet" + ], + "t5-2": [ + "gif", + "gs-gif-tag" + ], + "t5-4": [ + "gif-data", + "(pointer uint64)" + ] } }, - "reset-display-gs-state": { - "args": ["disp", "dma-buf", "oddeven"], + "args": [ + "disp", + "dma-buf", + "oddeven" + ], "vars": { "a3-0": "onscreen", "v1-0": "hoff", "a2-6": "fbp", - "t0-0": ["dma", "dma-packet"], - "t0-2": ["gif", "gs-gif-tag"], - "a3-3": ["gif-data", "(pointer uint64)"] + "t0-0": [ + "dma", + "dma-packet" + ], + "t0-2": [ + "gif", + "gs-gif-tag" + ], + "a3-3": [ + "gif-data", + "(pointer uint64)" + ] } }, - "(method 0 engine)": { - "args": ["allocation", "type-to-make", "name", "length"], - "vars": { "v0-0": "this", "v1-11": "idx-to-link", "a0-1": "end-idx" } + "args": [ + "allocation", + "type-to-make", + "name", + "length" + ], + "vars": { + "v0-0": "this", + "v1-11": "idx-to-link", + "a0-1": "end-idx" + } }, - "(method 10 engine)": { - "args": ["this", "f"], - "vars": { "a0-1": "current", "s4-0": "next" } + "args": [ + "this", + "f" + ], + "vars": { + "a0-1": "current", + "s4-0": "next" + } }, - "(method 11 engine)": { - "args": ["this", "f"], - "vars": { "s4-0": "iter" } + "args": [ + "this", + "f" + ], + "vars": { + "s4-0": "iter" + } }, - "(method 12 engine)": { - "vars": { "s4-0": ["ct", "connection"] } + "vars": { + "s4-0": [ + "ct", + "connection" + ] + } }, - "(method 13 engine)": { - "vars": { "s4-0": ["ct", "connection"], "v1-2": "result" } + "vars": { + "s4-0": [ + "ct", + "connection" + ], + "v1-2": "result" + } }, - "(method 19 engine)": { - "args": ["this", "p1-value"], - "vars": { "a0-1": "current", "s4-0": "next" } + "args": [ + "this", + "p1-value" + ], + "vars": { + "a0-1": "current", + "s4-0": "next" + } }, - "(method 20 engine)": { - "args": ["this", "p2-value"], - "vars": { "a0-1": "current", "s4-0": "next" } + "args": [ + "this", + "p2-value" + ], + "vars": { + "a0-1": "current", + "s4-0": "next" + } }, - "connection-process-apply": { - "args": ["proc", "func"], - "vars": { "s5-0": "iter" } + "args": [ + "proc", + "func" + ], + "vars": { + "s5-0": "iter" + } }, - "(method 15 engine)": { - "args": ["this", "proc", "func", "p1", "p2", "p3"], - "vars": { "v1-0": "con" } + "args": [ + "this", + "proc", + "func", + "p1", + "p2", + "p3" + ], + "vars": { + "v1-0": "con" + } }, - "surface-interp!": { - "args": ["dst", "src0", "src1", "amount"] + "args": [ + "dst", + "src0", + "src1", + "amount" + ] }, - "surface-mult!": { - "args": ["dst", "src0", "src1"] + "args": [ + "dst", + "src0", + "src1" + ] }, - "(method 0 collide-shape-prim)": { - "args": ["allocation", "type-to-make", "cshape", "prim-id", "size-bytes"] + "args": [ + "allocation", + "type-to-make", + "cshape", + "prim-id", + "size-bytes" + ] }, - "(method 0 collide-shape-prim-sphere)": { - "args": ["allocation", "type-to-make", "cshape", "prim-id"], - "vars": { "v0-0": ["this", "collide-shape-prim-sphere"] } + "args": [ + "allocation", + "type-to-make", + "cshape", + "prim-id" + ], + "vars": { + "v0-0": [ + "this", + "collide-shape-prim-sphere" + ] + } }, "(method 0 collide-shape-prim-mesh)": { - "args": ["allocation", "type-to-make", "cshape", "mesh-id", "prim-id"], - "vars": { "v0-0": ["this", "collide-shape-prim-mesh"] } + "args": [ + "allocation", + "type-to-make", + "cshape", + "mesh-id", + "prim-id" + ], + "vars": { + "v0-0": [ + "this", + "collide-shape-prim-mesh" + ] + } }, "(method 0 collide-shape-prim-group)": { - "args": ["allocation", "type-to-make", "cshape", "elt-count", "prim-id"], - "vars": { "v0-0": ["this", "collide-shape-prim-group"] } + "args": [ + "allocation", + "type-to-make", + "cshape", + "elt-count", + "prim-id" + ], + "vars": { + "v0-0": [ + "this", + "collide-shape-prim-group" + ] + } }, "(method 0 collide-shape)": { "args": [ @@ -1682,42 +2797,86 @@ "collide-list-kind", "prim-id" ], - "vars": { "s5-0": "this" } + "vars": { + "s5-0": "this" + } }, "(method 0 collide-sticky-rider-group)": { - "vars": { "v0-0": "this" } + "vars": { + "v0-0": "this" + } }, "(method 11 touching-prims-entry-pool)": { - "vars": { "a1-0": "current", "v1-0": "prev", "a2-0": "next" } + "vars": { + "a1-0": "current", + "v1-0": "prev", + "a2-0": "next" + } }, "(method 0 touching-list)": { - "vars": { "v0-0": ["this", "touching-list"] } + "vars": { + "v0-0": [ + "this", + "touching-list" + ] + } }, - "cspace-by-name-no-fail": { - "vars": { "v0-0": ["result", "cspace"] } + "vars": { + "v0-0": [ + "result", + "cspace" + ] + } }, - "num-func-loop!": { - "args": ["chan", "inc"], - "vars": { "f0-1": "duration", "f1-2": "after-inc", "f0-3": "wrapped" } + "args": [ + "chan", + "inc" + ], + "vars": { + "f0-1": "duration", + "f1-2": "after-inc", + "f0-3": "wrapped" + } }, - "shrubbery-login-post-texture": { - "args": ["this"], + "args": [ + "this" + ], "vars": { "v1-1": "shader-count", - "a1-1": ["dst", "qword"], - "a2-5": ["tex-dst", "qword"], - "a3-0": ["src", "qword"], - "a2-6": ["text-dst2", "qword"], - "a3-1": ["src-2", "qword"], - "a3-2": ["src-3", "qword"] + "a1-1": [ + "dst", + "qword" + ], + "a2-5": [ + "tex-dst", + "qword" + ], + "a3-0": [ + "src", + "qword" + ], + "a2-6": [ + "text-dst2", + "qword" + ], + "a3-1": [ + "src-2", + "qword" + ], + "a3-2": [ + "src-3", + "qword" + ] } }, - "(method 20 actor-link-info)": { - "args": ["this", "message"], + "args": [ + "this", + "message" + ], "vars": { "s4-0": "iter", "s5-0": "result", @@ -1725,23 +2884,29 @@ "a1-1": "msg-block" } }, - - // LEVEL "lookup-level-info": { - "args": ["name"], + "args": [ + "name" + ], "vars": { - "a1-1": ["info", "level-load-info"], + "a1-1": [ + "info", + "level-load-info" + ], "v1-0": "rest", "a1-0": "current-sym" } }, - "(method 21 level-group)": { - "args": ["this", "name", "cmd-idx"], - "vars": { "v1-1": "cmd-lst" } + "args": [ + "this", + "name", + "cmd-idx" + ], + "vars": { + "v1-1": "cmd-lst" + } }, - - // SHADOW-CPU-H "(method 0 shadow-control)": { "args": [ "allocation", @@ -1752,16 +2917,28 @@ "center", "fade" ], - "vars": { "v0-0": "this" } + "vars": { + "v0-0": "this" + } }, - - // RES "(method 0 res-lump)": { - "args": ["allocation", "type-to-make", "data-count", "data-size"], - "vars": { "v0-0": "this" } + "args": [ + "allocation", + "type-to-make", + "data-count", + "data-size" + ], + "vars": { + "v0-0": "this" + } }, "(method 20 res-lump)": { - "args": ["this", "time", "result", "buf"], + "args": [ + "this", + "time", + "result", + "buf" + ], "vars": { "t0-2": "tag-lo", "t1-2": "tag-hi", @@ -1772,18 +2949,49 @@ } }, "(method 3 res-lump)": { - "vars": { "s5-0": "i" } + "vars": { + "s5-0": "i" + } }, "(method 9 res-lump)": { - "args": ["this", "name", "mode", "time", "default", "tag-addr", "buf-addr"], - "vars": { "s3-0": "tag-pair" } + "args": [ + "this", + "name", + "mode", + "time", + "default", + "tag-addr", + "buf-addr" + ], + "vars": { + "s3-0": "tag-pair" + } }, "(method 10 res-lump)": { - "args": ["this", "name", "mode", "time", "default", "tag-addr", "buf-addr"], - "vars": { "s3-0": "tag-pair", "v1-4": "tag" } + "args": [ + "this", + "name", + "mode", + "time", + "default", + "tag-addr", + "buf-addr" + ], + "vars": { + "s3-0": "tag-pair", + "v1-4": "tag" + } }, "(method 11 res-lump)": { - "args": ["this", "name", "mode", "time", "default", "tag-addr", "buf-addr"], + "args": [ + "this", + "name", + "mode", + "time", + "default", + "tag-addr", + "buf-addr" + ], "vars": { "a2-1": "tag-pair", "s1-0": "tag", @@ -1792,7 +3000,15 @@ } }, "(method 12 res-lump)": { - "args": ["this", "name", "mode", "time", "default", "tag-addr", "buf-addr"], + "args": [ + "this", + "name", + "mode", + "time", + "default", + "tag-addr", + "buf-addr" + ], "vars": { "a2-1": "tag-pair", "s1-0": "tag", @@ -1813,22 +3029,27 @@ }, "(method 15 res-lump)": { "vars": { - "s5-0": ["tag-pair", "res-tag-pair"], + "s5-0": [ + "tag-pair", + "res-tag-pair" + ], "s2-0": "existing-tag", "s3-0": "data-size", "v1-25": "resource-mem" } }, - "(method 17 res-lump)": { "vars": { "a0-2": "new-tag", "s4-0": "tag-mem" } }, - "(method 8 res-lump)": { - "args": ["this", "block", "flags"], + "args": [ + "this", + "block", + "flags" + ], "vars": { "s3-0": "mem-use-id", "s2-0": "mem-use-name", @@ -1837,10 +3058,10 @@ "s0-0": "tag-data" } }, - - // FACT-H "(method 0 fact-info-target)": { - "vars": { "gp-0": "this" } + "vars": { + "gp-0": "this" + } }, "(method 0 fact-info-enemy)": { "vars": { @@ -1848,103 +3069,189 @@ "s5-0": "entity" } }, - "(method 0 fact-info)": { - "args": ["allocation", "type-to-make", "proc", "pkup-type", "pkup-amount"], + "args": [ + "allocation", + "type-to-make", + "proc", + "pkup-type", + "pkup-amount" + ], "vars": { - "gp-0": ["this", "fact-info"], + "gp-0": [ + "this", + "fact-info" + ], "s5-0": "ent", "sv-16": "tag" } }, - "(method 0 align-control)": { - "vars": { "v0-0": ["this", "align-control"] } + "vars": { + "v0-0": [ + "this", + "align-control" + ] + } }, - "str-load": { - "args": ["name", "chunk-id", "address", "len"], - "vars": { "s2-0": ["cmd", "load-chunk-msg"] } + "args": [ + "name", + "chunk-id", + "address", + "len" + ], + "vars": { + "s2-0": [ + "cmd", + "load-chunk-msg" + ] + } }, - "str-load-status": { - "args": ["length-out"], - "vars": { "v1-7": "response" } + "args": [ + "length-out" + ], + "vars": { + "v1-7": "response" + } }, - "str-play-async": { - "args": ["name", "addr"], - "vars": { "s4-0": "cmd" } + "args": [ + "name", + "addr" + ], + "vars": { + "s4-0": "cmd" + } }, - "str-play-stop": { - "args": ["name"], - "vars": { "s5-0": "cmd" } + "args": [ + "name" + ], + "vars": { + "s5-0": "cmd" + } }, - "str-play-queue": { - "args": ["name"], - "vars": { "s5-0": "cmd" } + "args": [ + "name" + ], + "vars": { + "s5-0": "cmd" + } }, - "str-ambient-play": { - "args": ["name"], - "vars": { "s5-0": "cmd" } + "args": [ + "name" + ], + "vars": { + "s5-0": "cmd" + } }, - "str-ambient-stop": { - "args": ["name"], - "vars": { "s5-0": "cmd" } + "args": [ + "name" + ], + "vars": { + "s5-0": "cmd" + } }, - "string->sound-name": { - "args": ["str"], + "args": [ + "str" + ], "vars": { "v1-0": "snd-name", - "a1-0": ["out-ptr", "(pointer uint8)"], + "a1-0": [ + "out-ptr", + "(pointer uint8)" + ], "a2-0": "in-ptr" } }, "dgo-load-begin": { - "args": ["name", "buffer1", "buffer2", "current-heap"], - "vars": { "s2-0": "cmd" } + "args": [ + "name", + "buffer1", + "buffer2", + "current-heap" + ], + "vars": { + "s2-0": "cmd" + } }, - "dgo-load-get-next": { - "args": ["last-object"], - "vars": { "gp-0": ["load-location", "pointer"], "v1-5": "response" } + "args": [ + "last-object" + ], + "vars": { + "gp-0": [ + "load-location", + "pointer" + ], + "v1-5": "response" + } }, - "dgo-load-continue": { - "args": ["current-heap"], - "vars": { "gp-0": "cmd" } + "args": [ + "current-heap" + ], + "vars": { + "gp-0": "cmd" + } }, "dgo-load-cancel": { - "vars": { "a2-0": "cmd" } + "vars": { + "a2-0": "cmd" + } }, - "find-temp-buffer": { - "args": ["size"], - "vars": { "gp-0": "qwc" } + "args": [ + "size" + ], + "vars": { + "gp-0": "qwc" + } }, - "dgo-load-link": { - "args": ["obj-file", "heap", "print-login", "last-object"], - "vars": { "s4-0": "obj-data" } + "args": [ + "obj-file", + "heap", + "print-login", + "last-object" + ], + "vars": { + "s4-0": "obj-data" + } }, - "ramdisk-load": { - "args": ["file-id", "offset", "length", "buffer"], - "vars": { "v1-1": "cmd" } + "args": [ + "file-id", + "offset", + "length", + "buffer" + ], + "vars": { + "v1-1": "cmd" + } }, - "show-mc-info": { - "args": ["dma-buf"], - "vars": { "s5-0": "info", "s4-0": "slot-idx" } + "args": [ + "dma-buf" + ], + "vars": { + "s5-0": "info", + "s4-0": "slot-idx" + } }, - "(method 19 res-lump)": { - "args": ["this", "name-sym", "mode", "time"], + "args": [ + "this", + "name-sym", + "mode", + "time" + ], "vars": { "t2-4": "type-chars", "t3-1": "max-search", @@ -1959,78 +3266,150 @@ "t1-0": "most-recent-invalid-time-idx" } }, - "entity-actor-count": { - "args": ["res", "name"], + "args": [ + "res", + "name" + ], "vars": { "sv-16": "tag" } }, - "(method 0 joint-mod)": { - "args": ["allocation", "type-to-make", "mode", "proc", "joint-idx"], + "args": [ + "allocation", + "type-to-make", + "mode", + "proc", + "joint-idx" + ], "vars": { "gp-0": "this", "v1-7": "twist-max" } }, - "joint-mod-debug-draw": { - "args": ["mod"] + "args": [ + "mod" + ] }, - "(method 9 joint-mod)": { - "args": ["this", "handler-mode"], - "vars": { "v1-0": "joint", "a0-1": "mode" } + "args": [ + "this", + "handler-mode" + ], + "vars": { + "v1-0": "joint", + "a0-1": "mode" + } }, - "(method 10 joint-mod)": { - "args": ["this", "target-trans"], - "vars": { "f0-0": "distance" } + "args": [ + "this", + "target-trans" + ], + "vars": { + "f0-0": "distance" + } + }, + "(method 13 joint-mod)": { + "args": [ + "this", + "x", + "y", + "z" + ] + }, + "(method 14 joint-mod)": { + "args": [ + "this", + "trans", + "rot", + "scale" + ] }, - - "(method 13 joint-mod)": { "args": ["this", "x", "y", "z"] }, - "(method 14 joint-mod)": { "args": ["this", "trans", "rot", "scale"] }, "(method 11 joint-mod)": { - "args": ["this", "target-trans", "option", "proc"], + "args": [ + "this", + "target-trans", + "option", + "proc" + ], "vars": { "s1-0": "proc-drawable", - "s3-1": ["enemy-facts", "fact-info-enemy"], + "s3-1": [ + "enemy-facts", + "fact-info-enemy" + ], "f30-0": "dist" } }, - - "joint-mod-look-at-handler": { "args": ["csp", "xform", "mat"] }, + "joint-mod-look-at-handler": { + "args": [ + "csp", + "xform", + "mat" + ] + }, "(method 9 collide-history)": { - "args": ["this", "cshape", "xs", "transv", "transv-out"] + "args": [ + "this", + "cshape", + "xs", + "transv", + "transv-out" + ] }, - "add-debug-sphere-from-table": { - "vars": { "s1-0": ["points", "(inline-array vector)"] } + "vars": { + "s1-0": [ + "points", + "(inline-array vector)" + ] + } }, - "entity-actor-lookup": { - "args": ["lump", "name", "idx"] + "args": [ + "lump", + "name", + "idx" + ] }, - "(method 0 actor-link-info)": { - "args": ["allocation", "type-to-make", "proc"], - "vars": { "s5-0": "this", "a0-1": "ent" } + "args": [ + "allocation", + "type-to-make", + "proc" + ], + "vars": { + "s5-0": "this", + "a0-1": "ent" + } }, - "(method 25 actor-link-info)": { - "vars": { "s5-0": "actor", "gp-0": "count" } + "vars": { + "s5-0": "actor", + "gp-0": "count" + } }, - "(method 9 actor-link-info)": { - "args": ["this", "matching-type"], - "vars": { "s3-0": "actor", "s5-0": "mask", "s4-0": "current-bit" } + "args": [ + "this", + "matching-type" + ], + "vars": { + "s3-0": "actor", + "s5-0": "mask", + "s4-0": "current-bit" + } }, - "(method 10 actor-link-info)": { - "vars": { "s5-0": "this-actor", "s4-0": "actor", "gp-0": "count" } + "vars": { + "s5-0": "this-actor", + "s4-0": "actor", + "gp-0": "count" + } }, - "alt-actor-list-subtask-incomplete-count": { "vars": { "s4-0": "alt-actor-count", @@ -2038,123 +3417,289 @@ "s3-0": "alt-actor-idx" } }, - "check-irx-version": { - "vars": { "gp-0": ["cmd", "sound-rpc-get-irx-version"] } + "vars": { + "gp-0": [ + "cmd", + "sound-rpc-get-irx-version" + ] + } }, "sound-bank-load": { - "vars": { "v1-1": ["cmd", "sound-rpc-load-bank"] } + "vars": { + "v1-1": [ + "cmd", + "sound-rpc-load-bank" + ] + } }, "sound-bank-unload": { - "vars": { "v1-1": ["cmd", "sound-rpc-unload-bank"] } + "vars": { + "v1-1": [ + "cmd", + "sound-rpc-unload-bank" + ] + } }, "sound-music-load": { - "vars": { "v1-1": ["cmd", "sound-rpc-load-music"] } + "vars": { + "v1-1": [ + "cmd", + "sound-rpc-load-music" + ] + } }, "sound-music-unload": { - "vars": { "v1-1": ["cmd", "sound-rpc-unload-music"] } + "vars": { + "v1-1": [ + "cmd", + "sound-rpc-unload-music" + ] + } }, "sound-reload-info": { - "vars": { "v1-1": ["cmd", "sound-rpc-reload-info"] } + "vars": { + "v1-1": [ + "cmd", + "sound-rpc-reload-info" + ] + } }, "set-language": { - "vars": { "v1-1": ["cmd", "sound-rpc-set-language"] } + "vars": { + "v1-1": [ + "cmd", + "sound-rpc-set-language" + ] + } }, "list-sounds": { - "vars": { "v1-1": ["cmd", "sound-rpc-list-sounds"] } + "vars": { + "v1-1": [ + "cmd", + "sound-rpc-list-sounds" + ] + } }, "sound-set-volume": { - "vars": { "v1-0": ["cmd", "sound-rpc-set-master-volume"] } + "vars": { + "v1-0": [ + "cmd", + "sound-rpc-set-master-volume" + ] + } }, "sound-set-reverb": { - "vars": { "v1-0": ["cmd", "sound-rpc-set-reverb"] } + "vars": { + "v1-0": [ + "cmd", + "sound-rpc-set-reverb" + ] + } }, "sound-set-ear-trans": { - "vars": { "gp-0": ["cmd", "sound-rpc-set-ear-trans"] } + "vars": { + "gp-0": [ + "cmd", + "sound-rpc-set-ear-trans" + ] + } }, "sound-play-by-name": { - "args": ["name", "id", "vol", "pitch", "bend", "group", "trans"], + "args": [ + "name", + "id", + "vol", + "pitch", + "bend", + "group", + "trans" + ], "vars": { - "s5-0": ["cmd", "sound-rpc-play"], - "s3-1": ["proc", "process-drawable"], + "s5-0": [ + "cmd", + "sound-rpc-play" + ], + "s3-1": [ + "proc", + "process-drawable" + ], "s4-0": "sound-trans" } }, "sound-play-by-spec": { - "args": ["spec", "id", "trans"], + "args": [ + "spec", + "id", + "trans" + ], "vars": { - "s5-0": ["cmd", "sound-rpc-play"], - "s3-1": ["proc", "process-drawable"] + "s5-0": [ + "cmd", + "sound-rpc-play" + ], + "s3-1": [ + "proc", + "process-drawable" + ] } }, "sound-pause": { - "vars": { "v1-0": ["cmd", "sound-rpc-pause-sound"] } + "vars": { + "v1-0": [ + "cmd", + "sound-rpc-pause-sound" + ] + } }, "sound-stop": { - "vars": { "v1-0": ["cmd", "sound-rpc-stop-sound"] } + "vars": { + "v1-0": [ + "cmd", + "sound-rpc-stop-sound" + ] + } }, "sound-continue": { - "vars": { "v1-0": ["cmd", "sound-rpc-continue-sound"] } + "vars": { + "v1-0": [ + "cmd", + "sound-rpc-continue-sound" + ] + } }, "sound-group-pause": { - "vars": { "v1-0": ["cmd", "sound-rpc-pause-group"] } + "vars": { + "v1-0": [ + "cmd", + "sound-rpc-pause-group" + ] + } }, "sound-group-stop": { - "vars": { "v1-0": ["cmd", "sound-rpc-stop-group"] } + "vars": { + "v1-0": [ + "cmd", + "sound-rpc-stop-group" + ] + } }, "sound-group-continue": { - "vars": { "v1-0": ["cmd", "sound-rpc-continue-group"] } + "vars": { + "v1-0": [ + "cmd", + "sound-rpc-continue-group" + ] + } }, "sound-set-falloff-curve": { - "vars": { "v1-0": ["cmd", "sound-rpc-set-falloff-curve"] } + "vars": { + "v1-0": [ + "cmd", + "sound-rpc-set-falloff-curve" + ] + } }, "sound-set-sound-falloff": { - "vars": { "v1-0": ["cmd", "sound-rpc-set-sound-falloff"] } + "vars": { + "v1-0": [ + "cmd", + "sound-rpc-set-sound-falloff" + ] + } }, "sound-set-flava": { - "vars": { "v1-0": ["cmd", "sound-rpc-set-flava"] } + "vars": { + "v1-0": [ + "cmd", + "sound-rpc-set-flava" + ] + } }, "(method 0 ambient-sound)": { - "vars": { "s5-1": ["this", "ambient-sound"], "v1-2": "bc" } + "vars": { + "s5-1": [ + "this", + "ambient-sound" + ], + "v1-2": "bc" + } }, "(method 9 ambient-sound)": { - "vars": { "s5-1": "spec", "s4-2": "spec-volume" } + "vars": { + "s5-1": "spec", + "s4-2": "spec-volume" + } }, "(method 11 ambient-sound)": { - "vars": { "gp-0": ["cmd", "sound-rpc-set-param"] } + "vars": { + "gp-0": [ + "cmd", + "sound-rpc-set-param" + ] + } }, "(method 12 ambient-sound)": { - "vars": { "v1-2": ["cmd", "sound-rpc-set-param"] } + "vars": { + "v1-2": [ + "cmd", + "sound-rpc-set-param" + ] + } }, "sound-buffer-dump": { - "vars": { "s3-0": ["cmd", "sound-rpc-play"] } + "vars": { + "s3-0": [ + "cmd", + "sound-rpc-play" + ] + } }, - "(method 0 path-control)": { - "args": ["allocation", "type-to-make", "proc", "name", "time"], + "args": [ + "allocation", + "type-to-make", + "proc", + "name", + "time" + ], "vars": { - "gp-0": ["this", "path-control"], + "gp-0": [ + "this", + "path-control" + ], "s3-1": "ent", "v1-7": "lookup-entity", "sv-16": "tag", "v1-9": "data" } }, - "(method 0 curve-control)": { - "args": ["allocation", "type-to-make", "proc", "name", "time"], - "vars": { "gp-0": "this", "s3-1": "ent", "v1-3": "lookup-entity" } + "args": [ + "allocation", + "type-to-make", + "proc", + "name", + "time" + ], + "vars": { + "gp-0": "this", + "s3-1": "ent", + "v1-3": "lookup-entity" + } }, - "nav-mesh-connect": { - "args": ["proc", "trans", "nav-cont"], + "args": [ + "proc", + "trans", + "nav-cont" + ], "vars": { "s2-0": "ent", "v0-0": "lookup-entity", "s3-0": "entity-nav-mesh" } }, - "(method 0 nav-control)": { "args": [ "allocation", @@ -2163,130 +3708,257 @@ "sphere-count", "nearest-y-threshold-default" ], - "vars": { "s5-0": ["this", "nav-control"], "a0-3": "ent" } + "vars": { + "s5-0": [ + "this", + "nav-control" + ], + "a0-3": "ent" + } }, - "add-debug-point": { - "args": ["enable-draw", "bucket", "pt"], - "vars": { - "a0-6": ["a0-6", "(pointer uint64)"], - "a0-7": ["a0-7", "dma-packet"], - "a3-0": ["a3-0", "dma-packet"], - "a3-2": ["a3-2", "gs-gif-tag"], - "a3-4": ["a3-4", "vector4w-2"], - "a3-6": ["a3-6", "vector4w-2"], - "a3-8": ["a3-8", "vector4w-2"], - "a1-30": ["a1-30", "vector4w-2"], + "args": [ + "enable-draw", + "bucket", + "pt" + ], + "vars": { + "a0-6": [ + "a0-6", + "(pointer uint64)" + ], + "a0-7": [ + "a0-7", + "dma-packet" + ], + "a3-0": [ + "a3-0", + "dma-packet" + ], + "a3-2": [ + "a3-2", + "gs-gif-tag" + ], + "a3-4": [ + "a3-4", + "vector4w-2" + ], + "a3-6": [ + "a3-6", + "vector4w-2" + ], + "a3-8": [ + "a3-8", + "vector4w-2" + ], + "a1-30": [ + "a1-30", + "vector4w-2" + ], "v1-7": "buf" } }, "internal-draw-debug-line": { "vars": { - "s2-0": ["s2-0", "rgba"], - "s5-0": ["s5-0", "rgba"], - "a3-1": ["a3-1", "dma-packet"], - "a3-3": ["a3-3", "gs-gif-tag"], - "a1-43": ["a1-43", "(inline-array vector4w-2)"], - "a0-31": ["a0-31", "(pointer uint64)"], - "a0-32": ["a0-32", "dma-packet"] + "s2-0": [ + "s2-0", + "rgba" + ], + "s5-0": [ + "s5-0", + "rgba" + ], + "a3-1": [ + "a3-1", + "dma-packet" + ], + "a3-3": [ + "a3-3", + "gs-gif-tag" + ], + "a1-43": [ + "a1-43", + "(inline-array vector4w-2)" + ], + "a0-31": [ + "a0-31", + "(pointer uint64)" + ], + "a0-32": [ + "a0-32", + "dma-packet" + ] } }, "add-debug-flat-triangle": { "vars": { - "a3-1": ["a3-1", "dma-packet"], - "a3-3": ["a3-3", "gs-gif-tag"], - "a3-5": ["a3-5", "(inline-array vector4w-3)"], - "a0-9": ["a0-9", "(pointer uint64)"], - "a0-10": ["a0-10", "dma-packet"] + "a3-1": [ + "a3-1", + "dma-packet" + ], + "a3-3": [ + "a3-3", + "gs-gif-tag" + ], + "a3-5": [ + "a3-5", + "(inline-array vector4w-3)" + ], + "a0-9": [ + "a0-9", + "(pointer uint64)" + ], + "a0-10": [ + "a0-10", + "dma-packet" + ] } }, "add-debug-line2d": { "vars": { - "a2-3": ["a2-3", "dma-packet"], - "a2-5": ["a2-5", "gs-gif-tag"], - "a2-7": ["a2-7", "(inline-array vector4w)"], - "a2-9": ["a2-9", "(inline-array vector4w)"], - "a0-20": ["a0-20", "(pointer uint64)"], - "v1-10": ["v1-10", "dma-packet"] + "a2-3": [ + "a2-3", + "dma-packet" + ], + "a2-5": [ + "a2-5", + "gs-gif-tag" + ], + "a2-7": [ + "a2-7", + "(inline-array vector4w)" + ], + "a2-9": [ + "a2-9", + "(inline-array vector4w)" + ], + "a0-20": [ + "a0-20", + "(pointer uint64)" + ], + "v1-10": [ + "v1-10", + "dma-packet" + ] } }, "debug-percent-bar": { "vars": { - "v1-5": ["v1-5", "dma-packet"] + "v1-5": [ + "v1-5", + "dma-packet" + ] } }, "debug-pad-display": { "vars": { - "v1-12": ["v1-12", "dma-packet"] + "v1-12": [ + "v1-12", + "dma-packet" + ] } }, "internal-draw-debug-text-3d": { "vars": { - "v1-11": ["v1-11", "dma-packet"] + "v1-11": [ + "v1-11", + "dma-packet" + ] } }, - "generic-init-buffers": { "vars": { - "v1-8": ["packet", "dma-packet"], - "gp-0": ["gp-0", "gs-zbuf"], - "s5-0": ["s5-0", "gs-zbuf"] + "v1-8": [ + "packet", + "dma-packet" + ], + "gp-0": [ + "gp-0", + "gs-zbuf" + ], + "s5-0": [ + "s5-0", + "gs-zbuf" + ] } }, - "level-update-after-load": { - "args": ["loaded-level", "level-login-state"], + "args": [ + "loaded-level", + "level-login-state" + ], "vars": { "s3-0": "level-drawable-trees", "s5-0": "initial-timer", "v1-4": "current-timer", "v1-5": "elapsed-timer", "s2-0": "current-login-pos", - "s2-1": ["current-drawable", "drawable-tree"], + "s2-1": [ + "current-drawable", + "drawable-tree" + ], "s1-0": "idx-in-drawable" } }, - "(method 9 setting-data)": { "vars": { - "s3-0": ["conn", "connection"] + "s3-0": [ + "conn", + "connection" + ] } }, - "(method 12 level)": { "vars": { - "s5-3": ["s5-3", "pair"] + "s5-3": [ + "s5-3", + "pair" + ] } }, - "update-sound-banks": { "vars": { - "t0-0": ["t0-0", "symbol"] + "t0-0": [ + "t0-0", + "symbol" + ] } }, - "(method 16 level-group)": { "vars": { - "s1-0": ["s1-0", "continue-point"] + "s1-0": [ + "s1-0", + "continue-point" + ] } }, - "(method 20 level)": { "vars": { - "s3-0": ["s3-0", "ramdisk-rpc-fill"] + "s3-0": [ + "s3-0", + "ramdisk-rpc-fill" + ] } }, - "(method 9 game-info)": { - "args": ["this", "cause", "save-to-load", "continue-point-override"], + "args": [ + "this", + "cause", + "save-to-load", + "continue-point-override" + ], "vars": { "v1-0": "selected-cause", "s4-1": "lev-info" } }, - "(method 10 game-info)": { - "args": ["this", "item", "amount", "source"], + "args": [ + "this", + "item", + "amount", + "source" + ], "vars": { "v1-10": "proc", "s4-1": "level-idx", @@ -2297,9 +3969,11 @@ "s5-2": "buzz-bits" } }, - "(method 14 game-info)": { - "args": ["this", "lev"], + "args": [ + "this", + "lev" + ], "vars": { "s5-0": "perms", "s4-0": "lev-entities", @@ -2308,9 +3982,11 @@ "v1-8": "info-entity-perm" } }, - "(method 15 game-info)": { - "args": ["this", "lev"], + "args": [ + "this", + "lev" + ], "vars": { "s5-0": "lev-entities", "s4-0": "lev-entity-idx", @@ -2318,62 +3994,85 @@ "v1-7": "info-entity-perm" } }, - "(method 25 game-info)": { - "args": ["this", "save"], + "args": [ + "this", + "save" + ], "vars": { - "v1-0": ["save-data", "game-save-tag"], - "s4-0": ["data", "game-save-tag"], + "v1-0": [ + "save-data", + "game-save-tag" + ], + "s4-0": [ + "data", + "game-save-tag" + ], "v1-9": "old-base-frame", "v1-10": "frame-counter-diff" } }, - "(method 10 game-save)": { - "args": ["this", "filename"], + "args": [ + "this", + "filename" + ], "vars": { "s5-0": "stream", "s3-0": "in-size", "s4-0": "my-size" } }, - "(method 11 game-save)": { - "args": ["this", "detail"], + "args": [ + "this", + "detail" + ], "vars": { - "s4-0": ["tag", "game-save-tag"], + "s4-0": [ + "tag", + "game-save-tag" + ], "s3-0": "tag-idx", "s2-1": "prog-lev-idx", "a2-13": "lev-name" } }, - "debug-menu-func-decode": { "vars": { - "v0-0": ["ret-val", "symbol"] + "v0-0": [ + "ret-val", + "symbol" + ] } }, - "letterbox": { "vars": { "s5-0": "dma-buf", - "v1-5": ["pkt", "dma-packet"] + "v1-5": [ + "pkt", + "dma-packet" + ] } }, - "blackout": { "vars": { "s5-0": "dma-buf", "gp-0": "sprite-dma-data", - "v1-4": ["pkt", "dma-packet"] + "v1-4": [ + "pkt", + "dma-packet" + ] } }, - "set-master-mode": { - "args": ["new-mode"], - "vars": { "v1-3": "mode" } + "args": [ + "new-mode" + ], + "vars": { + "v1-3": "mode" + } }, - "main-cheats": { "vars": { "v1-13": "cheatmode-state", @@ -2382,15 +4081,21 @@ "v1-394": "cheat-pal-state", "s5-9": "dma-buff", "gp-9": "dma-start", - "v1-533": ["dma-pkt", "dma-packet"], + "v1-533": [ + "dma-pkt", + "dma-packet" + ], "gp-10": "timeout", "v1-548": "inactive-timeout", "gp-11": "game-end-proc" } }, - "load-game-text-info": { - "args": ["txt-name", "curr-text", "heap"], + "args": [ + "txt-name", + "curr-text", + "heap" + ], "vars": { "sv-16": "heap-sym-heap", "sv-24": "lang", @@ -2398,7 +4103,6 @@ "sv-40": "heap-free" } }, - "(method 13 art-group)": { "vars": { "s3-0": "art-elt", @@ -2407,7 +4111,6 @@ "s2-0": "success" } }, - "(method 14 art-group)": { "vars": { "s3-0": "art-elt", @@ -2416,7 +4119,6 @@ "s3-1": "success" } }, - "(method 16 process-drawable)": { "vars": { "s3-0": "body-T-world", @@ -2425,9 +4127,11 @@ "a1-5": "vel-rt-body" } }, - "(method 11 cam-float-seeker)": { - "args": ["this", "offset"], + "args": [ + "this", + "offset" + ], "vars": { "f1-2": "pos-error", "f0-5": "partial-velocity-limit", @@ -2437,9 +4141,13 @@ "f0-10": "dpos" } }, - "(method 9 trsqv)": { - "args": ["this", "dir", "vel", "frame-count"], + "args": [ + "this", + "dir", + "vel", + "frame-count" + ], "vars": { "f0-0": "yaw-error", "f1-2": "yaw-limit", @@ -2448,11 +4156,14 @@ "f0-2": "old-diff" } }, - "(method 13 trsqv)": { - "args": ["this", "yaw", "vel", "frame-count"] + "args": [ + "this", + "yaw", + "vel", + "frame-count" + ] }, - "(method 16 trsqv)": { "vars": { "s5-0": "quat", @@ -2462,7 +4173,6 @@ "a0-4": "dir-x" } }, - "(method 25 trsqv)": { "vars": { "s5-0": "quat", @@ -2473,30 +4183,46 @@ "f0-1": "grav-dot" } }, - "(method 17 trsqv)": { - "args": ["this", "target", "y-rate", "z-rate"], + "args": [ + "this", + "target", + "y-rate", + "z-rate" + ], "vars": { "gp-0": "quat", "s5-0": "temp-quat" } }, - "raw-ray-sphere-intersect": { "vars": { - "v0-0": ["result", "float"], - "v1-0": ["v1-0", "float"] + "v0-0": [ + "result", + "float" + ], + "v1-0": [ + "v1-0", + "float" + ] } }, - "ray-sphere-intersect": { - "args": ["ray-origin", "ray-dir", "sph-origin", "radius"] + "args": [ + "ray-origin", + "ray-dir", + "sph-origin", + "radius" + ] }, - "ray-circle-intersect": { - "args": ["ray-origin", "ray-dir", "circle-origin", "radius"] + "args": [ + "ray-origin", + "ray-dir", + "circle-origin", + "radius" + ] }, - "ray-cylinder-intersect": { "args": [ "ray-origin", @@ -2507,9 +4233,12 @@ "cyl-len" ] }, - "(method 10 cylinder)": { - "args": ["this", "probe-origin", "probe-dir"], + "args": [ + "this", + "probe-origin", + "probe-dir" + ], "vars": { "f30-0": "result", "f0-5": "u-origin-sph", @@ -2517,9 +4246,12 @@ "f0-8": "u-end-sphere" } }, - "(method 10 cylinder-flat)": { - "args": ["this", "probe-origin", "probe-dir"], + "args": [ + "this", + "probe-origin", + "probe-dir" + ], "vars": { "f30-0": "result", "f0-5": "u-origin-circle", @@ -2527,7 +4259,6 @@ "f0-8": "u-end-circle" } }, - "ray-arbitrary-circle-intersect": { "args": [ "probe-origin", @@ -2537,15 +4268,20 @@ "radius" ] }, - "print-tr-stat": { - "args": ["stat", "name", "dest"] + "args": [ + "stat", + "name", + "dest" + ] }, - "update-subdivide-settings!": { - "args": ["settings", "math-cam", "idx"] + "args": [ + "settings", + "math-cam", + "idx" + ] }, - "start-perf-stat-collection": { "vars": { "v1-2": "frame-idx", @@ -2554,7 +4290,6 @@ "a0-7": "stat-idx" } }, - "ja-play-spooled-anim": { "vars": { "sv-16": "spool-part", @@ -2562,97 +4297,154 @@ "sv-64": "spool-sound" } }, - "(method 3 anim-tester)": { "vars": { - "s5-0": ["s5-0", "anim-test-obj"], - "s4-0": ["s4-0", "anim-test-sequence"], - "s3-0": ["s3-0", "anim-test-seq-item"] + "s5-0": [ + "s5-0", + "anim-test-obj" + ], + "s4-0": [ + "s4-0", + "anim-test-sequence" + ], + "s3-0": [ + "s3-0", + "anim-test-seq-item" + ] } }, - "anim-test-obj-item-valid?": { "vars": { - "s5-0": ["s5-0", "anim-test-sequence"] + "s5-0": [ + "s5-0", + "anim-test-sequence" + ] } }, - "anim-test-obj-remove-invalid": { "vars": { - //"s5-0": ["s5-0", "anim-test-sequence"], - "v1-31": ["v1-31", "anim-test-sequence"], - "s3-0": ["s3-0", "anim-test-seq-item"], - "s2-0": ["s2-0", "anim-test-seq-item"] + "v1-31": [ + "v1-31", + "anim-test-sequence" + ], + "s3-0": [ + "s3-0", + "anim-test-seq-item" + ], + "s2-0": [ + "s2-0", + "anim-test-seq-item" + ] } }, - "anim-tester-reset": { "vars": { - "v1-1": ["v1-1", "anim-test-obj"] + "v1-1": [ + "v1-1", + "anim-test-obj" + ] } }, - "anim-tester-save-object-seqs": { "vars": { - "s4-2": ["s4-2", "anim-test-seq-item"] + "s4-2": [ + "s4-2", + "anim-test-seq-item" + ] } }, - "sprite-setup-header": { - "args": ["hdr", "num-sprites"] + "args": [ + "hdr", + "num-sprites" + ] }, - "(method 0 sprite-aux-list)": { - "args": ["allocation", "type-to-make", "size"] + "args": [ + "allocation", + "type-to-make", + "size" + ] }, - "sprite-setup-frame-data": { - "args": ["data", "tbp-offset"] + "args": [ + "data", + "tbp-offset" + ] }, - "(method 0 sprite-array-2d)": { - "args": ["allocation", "type-to-make", "group-0-size", "group-1-size"], + "args": [ + "allocation", + "type-to-make", + "group-0-size", + "group-1-size" + ], "vars": { "v1-0": "sprite-count", "s4-0": "vec-data-size", "a2-3": "adgif-data-size" } }, - "(method 0 sprite-array-3d)": { - "args": ["allocation", "type-to-make", "group-0-size", "group-1-size"], + "args": [ + "allocation", + "type-to-make", + "group-0-size", + "group-1-size" + ], "vars": { "v1-0": "sprite-count", "s4-0": "vec-data-size", "a2-3": "adgif-data-size" } }, - "sprite-set-3d-quaternion": { - "args": ["data", "quat"] + "args": [ + "data", + "quat" + ] }, "sprite-get-3d-quaternion": { - "args": ["data", "quat"] + "args": [ + "data", + "quat" + ] }, "sprite-add-matrix-data": { - "args": ["dma-buff", "matrix-mode"], + "args": [ + "dma-buff", + "matrix-mode" + ], "vars": { "v1-0": "count", - "a2-1": ["pkt1", "dma-packet"], - "a1-2": ["mtx", "matrix"], - "a2-9": ["pkt2", "dma-packet"], + "a2-1": [ + "pkt1", + "dma-packet" + ], + "a1-2": [ + "mtx", + "matrix" + ], + "a2-9": [ + "pkt2", + "dma-packet" + ], "a1-11": "mtx2", "a1-20": "hvdf-idx" } }, - "sprite-add-frame-data": { - "args": ["dma-buff", "tbp-offset"], + "args": [ + "dma-buff", + "tbp-offset" + ], "vars": { - "a0-1": ["pkt", "dma-packet"] + "a0-1": [ + "pkt", + "dma-packet" + ] } }, - "sprite-add-2d-chunk": { "args": [ "sprites", @@ -2662,123 +4454,217 @@ "mscal-addr" ], "vars": { - "a0-1": ["pkt1", "dma-packet"], + "a0-1": [ + "pkt1", + "dma-packet" + ], "s1-0": "qwc-pkt1", "a1-7": "qwc-pkt2", - "a0-5": ["pkt2", "dma-packet"], + "a0-5": [ + "pkt2", + "dma-packet" + ], "a1-11": "qwc-pkt3", - "a0-7": ["pkt3", "dma-packet"], - "v1-7": ["pkt4", "dma-packet"] + "a0-7": [ + "pkt3", + "dma-packet" + ], + "v1-7": [ + "pkt4", + "dma-packet" + ] } }, - "sprite-add-2d-all": { - "args": ["sprites", "dma-buff", "group-idx"], + "args": [ + "sprites", + "dma-buff", + "group-idx" + ], "vars": { "s4-0": "current-sprite-idx", "s2-0": "remaining-sprites", "s3-0": "mscal-addr" } }, - "sprite-add-3d-chunk": { - "args": ["sprites", "start-sprite-idx", "num-sprites", "dma-buff"], + "args": [ + "sprites", + "start-sprite-idx", + "num-sprites", + "dma-buff" + ], "vars": { - "a0-1": ["pkt1", "dma-packet"], + "a0-1": [ + "pkt1", + "dma-packet" + ], "s2-0": "qwc-pkt1", "a1-7": "qwc-pkt2", - "a0-5": ["pkt2", "dma-packet"], + "a0-5": [ + "pkt2", + "dma-packet" + ], "a1-11": "qwc-pkt3", - "a0-7": ["pkt3", "dma-packet"], - "v1-7": ["pkt4", "dma-packet"] + "a0-7": [ + "pkt3", + "dma-packet" + ], + "v1-7": [ + "pkt4", + "dma-packet" + ] } }, - "sprite-add-3d-all": { - "args": ["sprites", "dma-buff", "group-idx"], + "args": [ + "sprites", + "dma-buff", + "group-idx" + ], "vars": { "s4-0": "current-sprite-idx", "s3-0": "remaining-sprites" } }, - "sprite-add-shadow-chunk": { - "args": ["shadow-buff", "start-idx", "num-sprites", "dma-buff"], + "args": [ + "shadow-buff", + "start-idx", + "num-sprites", + "dma-buff" + ], "vars": { "s2-0": "qwc-pkt1", - "a0-1": ["pkt1", "dma-packet"], + "a0-1": [ + "pkt1", + "dma-packet" + ], "a1-7": "qwc-pkt2", - "a0-5": ["pkt2", "dma-packet"], + "a0-5": [ + "pkt2", + "dma-packet" + ], "v1-5": "sprite-idx", "a0-7": "dma-vec-data", "a1-14": "in-vec-data", "a1-15": "qwc-pkt3", - "a0-11": ["pkt3", "dma-packet"], + "a0-11": [ + "pkt3", + "dma-packet" + ], "s2-1": "si", "s1-0": "dma-adgif-data", "s0-0": "in-adgif-data", - "v1-21": ["pkt4", "dma-packet"] + "v1-21": [ + "pkt4", + "dma-packet" + ] } }, - "sprite-add-shadow-all": { - "args": ["shadow-buff", "dma-buff"], + "args": [ + "shadow-buff", + "dma-buff" + ], "vars": { "s4-0": "current-shadow", "s3-0": "remaining-shadows" } }, - "sprite-draw": { "args": "disp", "vars": { "gp-0": "dma-mem-begin", "s4-0": "dma-buff", "s5-0": "dma-bucket-begin", - "a0-9": ["pkt1", "dma-packet"], - "a0-11": ["giftag", "gs-gif-tag"], - "a0-17": ["pkt2", "dma-packet"], - "a0-19": ["pkt3", "dma-packet"], - "a0-26": ["pkt4", "dma-packet"], - "v1-26": ["pkt5", "dma-packet"], + "a0-9": [ + "pkt1", + "dma-packet" + ], + "a0-11": [ + "giftag", + "gs-gif-tag" + ], + "a0-17": [ + "pkt2", + "dma-packet" + ], + "a0-19": [ + "pkt3", + "dma-packet" + ], + "a0-26": [ + "pkt4", + "dma-packet" + ], + "v1-26": [ + "pkt5", + "dma-packet" + ], "v1-31": "mem-use" } }, - "mem-usage-bsp-tree": { - "args": ["header", "node", "mem-use", "flags"] + "args": [ + "header", + "node", + "mem-use", + "flags" + ] }, - "(method 8 bsp-header)": { - "args": ["this", "mem-use", "flags"] + "args": [ + "this", + "mem-use", + "flags" + ] }, - "(method 10 bsp-header)": { - "args": ["this", "other-draw", "disp-frame"], + "args": [ + "this", + "other-draw", + "disp-frame" + ], "vars": { "s4-0": "lev", "a2-3": "vis-list-qwc", "v1-15": "vis-list-qwc2", - "a0-9": ["vis-list-spad", "(pointer uint128)"], - "a1-5": ["vis-list-lev", "(pointer uint128)"], + "a0-9": [ + "vis-list-spad", + "(pointer uint128)" + ], + "a1-5": [ + "vis-list-lev", + "(pointer uint128)" + ], "a2-4": "current-qw" } }, - "bsp-camera-asm": { - "args": ["bsp-hdr", "camera-pos"], + "args": [ + "bsp-hdr", + "camera-pos" + ], "vars": { - "v1-0": ["next-node", "bsp-node"], + "v1-0": [ + "next-node", + "bsp-node" + ], "a1-1": "real-node" } }, - "level-remap-texture": { - "args": ["tex-id"], + "args": [ + "tex-id" + ], "vars": { "v1-1": "bsp-hdr", "a3-0": "table-size", - "v1-2": ["table-data-start", "(pointer uint64)"], + "v1-2": [ + "table-data-start", + "(pointer uint64)" + ], "t0-0": "table-data-ptr", "a1-1": "mask1", "a2-1": "masked-tex-id", @@ -2787,56 +4673,85 @@ "t1-1": "diff" } }, - "debug-menu-make-from-template": { "vars": { - "s5-1": ["s5-1", "string"] + "s5-1": [ + "s5-1", + "string" + ] } }, - "debug-menu-item-var-render": { "vars": { - "v1-14": ["v1-14", "dma-packet"] + "v1-14": [ + "v1-14", + "dma-packet" + ] } }, - "generic-add-constants": { "vars": { - "a0-1": ["a0-1", "dma-packet"] + "a0-1": [ + "a0-1", + "dma-packet" + ] } }, - "generic-init-buf": { "vars": { - "a0-2": ["a0-2", "dma-packet"], - "a0-4": ["a0-4", "gs-gif-tag"], - "a0-9": ["a0-9", "dma-packet"], - "v1-7": ["v1-7", "(pointer int32)"] + "a0-2": [ + "a0-2", + "dma-packet" + ], + "a0-4": [ + "a0-4", + "gs-gif-tag" + ], + "a0-9": [ + "a0-9", + "dma-packet" + ], + "v1-7": [ + "v1-7", + "(pointer int32)" + ] } }, - "(anon-function 1 cam-combiner)": { "vars": { - "pp": ["pp", "process"] + "pp": [ + "pp", + "process" + ] } }, - "(anon-function 2 cam-combiner)": { "vars": { - "a0-3": ["vec", "(pointer vector)"] + "a0-3": [ + "vec", + "(pointer vector)" + ] } }, - "(method 14 sync-info)": { - "args": ["this", "period", "phase"], + "args": [ + "this", + "period", + "phase" + ], "vars": { "f0-1": "period-float", "f1-1": "value" } }, - "(method 14 sync-info-eased)": { - "args": ["this", "period", "phase", "out-param", "in-param"], + "args": [ + "this", + "period", + "phase", + "out-param", + "in-param" + ], "vars": { "f0-9": "total-easing-phase", "f1-11": "total-normal-phase", @@ -2845,11 +4760,15 @@ "f3-4": "y-end" } }, - "(method 14 sync-info-paused)": { - "args": ["this", "period", "phase", "out-param", "in-param"] + "args": [ + "this", + "period", + "phase", + "out-param", + "in-param" + ] }, - "(method 15 sync-info)": { "args": [ "this", @@ -2860,7 +4779,6 @@ "default-in" ] }, - "(method 15 sync-info-eased)": { "args": [ "this", @@ -2871,7 +4789,6 @@ "default-in" ] }, - "(method 15 sync-info-paused)": { "args": [ "this", @@ -2882,7 +4799,6 @@ "default-in" ] }, - "(method 10 sync-info)": { "vars": { "v1-0": "period", @@ -2890,9 +4806,11 @@ "f1-2": "current-time" } }, - "(method 16 sync-info)": { - "args": ["this", "user-time-offset"], + "args": [ + "this", + "user-time-offset" + ], "vars": { "a2-0": "period", "f0-1": "period-float", @@ -2903,7 +4821,6 @@ "f0-3": "combined-offset-wrapped" } }, - "(method 11 sync-info)": { "vars": { "v1-0": "period", @@ -2911,7 +4828,6 @@ "f1-2": "current-time" } }, - "(method 11 sync-info-paused)": { "vars": { "v1-0": "period", @@ -2920,18 +4836,21 @@ "f2-2": "current-time" } }, - "(method 9 sync-info)": { - "args": ["this", "max-val"], + "args": [ + "this", + "max-val" + ], "vars": { "v1-0": "period", "f0-1": "period-float", "f1-2": "current-time" } }, - "(method 13 sync-info)": { - "args": ["this"], + "args": [ + "this" + ], "vars": { "v1-0": "period", "f1-0": "period-float", @@ -2940,9 +4859,10 @@ "f0-2": "phase-out-of-2" } }, - "(method 13 sync-info-eased)": { - "args": ["this"], + "args": [ + "this" + ], "vars": { "v1-0": "period", "f1-0": "period-float", @@ -2954,9 +4874,11 @@ "f0-7": "eased-phase" } }, - "(method 12 sync-info)": { - "args": ["this", "max-out-val"], + "args": [ + "this", + "max-out-val" + ], "vars": { "v1-0": "period", "f1-0": "period-float", @@ -2965,27 +4887,44 @@ "f0-2": "current-val" } }, - "(method 12 sync-info-eased)": { - "args": ["this", "max-out-val"] + "args": [ + "this", + "max-out-val" + ] }, "(method 12 sync-info-paused)": { - "args": ["this", "max-out-val"] + "args": [ + "this", + "max-out-val" + ] }, - "(method 9 delayed-rand-float)": { - "args": ["this", "min-tim", "max-time", "max-times-two"] + "args": [ + "this", + "min-tim", + "max-time", + "max-times-two" + ] }, - "(method 10 oscillating-float)": { - "args": ["this", "target-offset"], - "vars": { "f0-3": "acc" } + "args": [ + "this", + "target-offset" + ], + "vars": { + "f0-3": "acc" + } }, - "(method 9 oscillating-float)": { - "args": ["this", "init-val", "accel", "max-vel", "damping"] + "args": [ + "this", + "init-val", + "accel", + "max-vel", + "damping" + ] }, - "(method 9 bouncing-float)": { "args": [ "this", @@ -2998,42 +4937,80 @@ "damping" ] }, - "(method 9 delayed-rand-vector)": { - "args": ["this", "min-time", "max-time", "xz-range", "y-range"] + "args": [ + "this", + "min-time", + "max-time", + "xz-range", + "y-range" + ] }, - "(method 9 oscillating-vector)": { - "args": ["this", "init-val", "accel", "max-vel", "damping"] + "args": [ + "this", + "init-val", + "accel", + "max-vel", + "damping" + ] }, - "(method 10 oscillating-vector)": { - "args": ["this", "target-offset"], - "vars": { "f0-2": "vel" } + "args": [ + "this", + "target-offset" + ], + "vars": { + "f0-2": "vel" + } }, - "(method 9 trajectory)": { - "args": ["this", "time", "result"] + "args": [ + "this", + "time", + "result" + ] }, - "(method 10 trajectory)": { - "args": ["this", "time", "result"] + "args": [ + "this", + "time", + "result" + ] }, - "(method 11 trajectory)": { - "args": ["this", "from", "to", "duration", "grav"], - "vars": { "f0-3": "xz-vel" } + "args": [ + "this", + "from", + "to", + "duration", + "grav" + ], + "vars": { + "f0-3": "xz-vel" + } }, - "(method 12 trajectory)": { - "args": ["this", "from", "to", "xz-vel", "grav"], - "vars": { "f0-1": "duration" } + "args": [ + "this", + "from", + "to", + "xz-vel", + "grav" + ], + "vars": { + "f0-1": "duration" + } }, - "(method 13 trajectory)": { - "args": ["this", "from", "to", "y-vel", "grav"] + "args": [ + "this", + "from", + "to", + "y-vel", + "grav" + ] }, - "(method 15 trajectory)": { "vars": { "s5-0": "prev-pos", @@ -3042,30 +5019,45 @@ "f0-1": "t-eval" } }, - "set-font-color-alpha": { - "args": ["idx", "alpha"] + "args": [ + "idx", + "alpha" + ] }, - "print-game-text-scaled": { - "args": ["str", "scale", "font-ctxt", "alpha"] + "args": [ + "str", + "scale", + "font-ctxt", + "alpha" + ] }, - "print-game-text": { - "args": ["str", "font-ctxt", "opaque", "alpha", "line-height"] + "args": [ + "str", + "font-ctxt", + "opaque", + "alpha", + "line-height" + ] }, - "display-frame-start": { - "args": ["disp", "new-frame-idx", "odd-even"], + "args": [ + "disp", + "new-frame-idx", + "odd-even" + ], "vars": { "f30-0": "time-ratio", "s3-0": "scaled-seconds", "s3-1": "new-frame" } }, - "display-frame-finish": { - "args": ["disp"], + "args": [ + "disp" + ], "vars": { "s4-0": "this-frame", "s5-0": "this-calc-buf", @@ -3079,9 +5071,10 @@ "s3-1": "global-end" } }, - "display-sync": { - "args": ["disp"], + "args": [ + "disp" + ], "vars": { "s4-0": "frame-idx", "s5-0": "syncv-result", @@ -3089,9 +5082,11 @@ "a1-4": "next-frame" } }, - "draw-string": { - "args": ["str-in", "context"], + "args": [ + "str-in", + "context" + ], "vars": { "v1-5": "fw", "a1-1": "dma-out", @@ -3127,13 +5122,21 @@ "r0-3": "r0" } }, - "add-debug-outline-triangle": { - "args": ["enable", "bucket", "p0", "p1", "p2", "color"] + "args": [ + "enable", + "bucket", + "p0", + "p1", + "p2", + "color" + ] }, - "unpack-comp-rle": { - "args": ["out", "in"], + "args": [ + "out", + "in" + ], "vars": { "v1-2": "current-input", "a2-0": "repeated-value", @@ -3141,9 +5144,11 @@ "a2-1": "src-val" } }, - "(method 16 level)": { - "args": ["this", "vis-info"], + "args": [ + "this", + "vis-info" + ], "vars": { "a0-1": "cam-leaf-idx", "v1-1": "curr-vis-str", @@ -3162,7 +5167,6 @@ "v0-1": "result" } }, - "(method 9 merc-fragment)": { "vars": { "s5-0": "fp-data", @@ -3174,7 +5178,6 @@ "a0-36": "seg" } }, - "(method 9 merc-effect)": { "vars": { "v1-0": "data", @@ -3183,13 +5186,22 @@ "s3-0": "frag-idx", "s2-0": "ctrl-size", "s1-0": "geo-size", - "s4-0": ["geo", "merc-fragment"], - "s5-0": ["ctrl", "merc-fragment-control"] + "s4-0": [ + "geo", + "merc-fragment" + ], + "s5-0": [ + "ctrl", + "merc-fragment-control" + ] } }, - "merc-vu1-add-vu-function": { - "args": ["dma", "func", "flush-mode"], + "args": [ + "dma", + "func", + "flush-mode" + ], "vars": { "v1-0": "func-data", "a3-0": "qwc", @@ -3197,20 +5209,24 @@ "t0-1": "qwc-this-time" } }, - "(method 8 merc-ctrl)": { "vars": { "s4-0": "ctrl-mem", "s3-0": "effect-idx", - "s2-0": ["fctrl", "merc-fragment-control"], + "s2-0": [ + "fctrl", + "merc-fragment-control" + ], "s1-0": "frag-idx", "v1-35": "effect-mem", "a0-15": "effect-idx2", - "a1-9": ["bctrl", "merc-blend-ctrl"], + "a1-9": [ + "bctrl", + "merc-blend-ctrl" + ], "a2-1": "blend-frag-idx" } }, - "(method 9 merc-ctrl)": { "vars": { "v1-3": "seg", @@ -3221,31 +5237,45 @@ "a2-6": "copy-idx" } }, - "merc-vu1-init-buffer": { - "args": ["dma-bucket", "test"], + "args": [ + "dma-bucket", + "test" + ], "vars": { "gp-0": "bucket", "s4-0": "dma-buf" } }, - "(method 9 screen-filter)": { "vars": { - "v1-4": ["v1-4", "dma-packet"], + "v1-4": [ + "v1-4", + "dma-packet" + ], "s5-0": "buf" } }, - "(method 11 fact-info-target)": { - "args": ["this", "kind", "amount", "source-handle"], - "vars": { "f0-29": "buzz-count", "f30-0": "eco-lev" } + "args": [ + "this", + "kind", + "amount", + "source-handle" + ], + "vars": { + "f0-29": "buzz-count", + "f30-0": "eco-lev" + } }, - "auto-save-init-by-other": { - "args": ["desired-mode", "notify-proc", "card-idx", "file-idx"] + "args": [ + "desired-mode", + "notify-proc", + "card-idx", + "file-idx" + ] }, - "debug-menu-item-var-make-int": { "args": [ "item", @@ -3257,7 +5287,6 @@ "hex" ] }, - "debug-menu-item-var-make-float": { "args": [ "item", @@ -3269,25 +5298,36 @@ "precision" ] }, - "(method 0 debug-menu-item-var)": { - "args": ["allocation", "type-to-make", "name", "id", "max-width"] + "args": [ + "allocation", + "type-to-make", + "name", + "id", + "max-width" + ] }, - "debug-menu-context-grab-joypad": { - "args": ["menu", "callback-arg", "callback-func"] + "args": [ + "ctxt", + "callback-arg", + "callback-func" + ] }, - "debug-menu-context-default-selection": { - "args": ["ctxt", "keep-current"], + "args": [ + "ctxt", + "keep-current" + ], "vars": { "s5-0": "menu", "s4-0": "currently-active" } }, - "debug-menu-rebuild": { - "args": ["menu"], + "args": [ + "menu" + ], "vars": { "s4-0": "max-width", "s5-0": "entry-count", @@ -3295,56 +5335,85 @@ "a0-1": "current-item" } }, - "debug-menu-context-set-root-menu": { - "args": ["context", "menu"], + "args": [ + "context", + "menu" + ], "vars": { "s4-0": "active" } }, - "debug-menu-append-item": { - "args": ["menu", "item"], + "args": [ + "menu", + "item" + ], "vars": { "gp-0": "context", "s4-0": "was-active" } }, - "(anon-function 82 default-menu)": { - "vars": { "s4-0": ["s4-0", "texture-id"] } + "vars": { + "s4-0": [ + "s4-0", + "texture-id" + ] + } }, - "process-status-bits": { - "vars": { "s3-0": ["proc-draw", "process-drawable"] } + "vars": { + "s3-0": [ + "proc-draw", + "process-drawable" + ] + } }, - "(method 29 entity-actor)": { - "args": ["this", "mode", "expected-type"] + "args": [ + "this", + "mode", + "expected-type" + ] }, - "(method 13 level-group)": { - "args": ["this", "mode", "expected-type"] + "args": [ + "this", + "mode", + "expected-type" + ] }, - "(method 24 entity)": { - "args": ["this", "lev-group", "lev", "aid"], + "args": [ + "this", + "lev-group", + "lev", + "aid" + ], "vars": { "v1-4": "level-link", "t0-5": "other-prev", "t1-1": "other-front" } }, - "update-actor-vis-box": { - "args": ["proc", "min-pt", "max-pt"], - "vars": { "v1-4": "world-bounds-origin", "f0-0": "radius" } + "args": [ + "proc", + "min-pt", + "max-pt" + ], + "vars": { + "v1-4": "world-bounds-origin", + "f0-0": "radius" + } }, - "init-entity": { - "args": ["proc", "ent"] + "args": [ + "proc", + "ent" + ] }, - "(method 22 entity-actor)": { "vars": { "s5-0": "entity-type", @@ -3352,7 +5421,6 @@ "s4-0": "entity-process" } }, - "(method 18 bsp-header)": { "vars": { "a2-0": "actor-count", @@ -3366,34 +5434,44 @@ "s4-2": "cams" } }, - "(code falling beach-rock)": { "vars": { - "gp-2": ["gp-2", "handle"], - "s5-1": ["s5-1", "handle"] + "gp-2": [ + "gp-2", + "handle" + ], + "s5-1": [ + "s5-1", + "handle" + ] } }, - "draw-percent-bar": { "vars": { - "v1-3": ["v1-3", "dma-packet"] + "v1-3": [ + "v1-3", + "dma-packet" + ] } }, - "(dummy-17 progress)": { "vars": { - "v1-20": ["v1-20", "dma-packet"], - "v1-81": ["v1-81", "dma-packet"] + "v1-20": [ + "v1-20", + "dma-packet" + ], + "v1-81": [ + "v1-81", + "dma-packet" + ] } }, - "make-current-level-available-to-progress": { "vars": { "a0-0": "cur-lev", "v1-7": "lev-idx" } }, - "make-levels-with-tasks-available-to-progress": { "vars": { "gp-0": "i", @@ -3401,22 +5479,32 @@ "s5-0": "tasks" } }, - "get-next-task-up": { - "args": ["cur-task-idx", "lev-idx"] + "args": [ + "cur-task-idx", + "lev-idx" + ] }, "get-next-task-down": { - "args": ["cur-task-idx", "lev-idx"] + "args": [ + "cur-task-idx", + "lev-idx" + ] }, "get-next-level-up": { - "args": ["lev-idx"] + "args": [ + "lev-idx" + ] }, "get-next-level-down": { - "args": ["lev-idx"] + "args": [ + "lev-idx" + ] }, - "calculate-completion": { - "args": ["the-progress"], + "args": [ + "the-progress" + ], "vars": { "sv-40": "total-cells", "sv-48": "total-buzzers", @@ -3426,318 +5514,459 @@ "sv-32": "current-orbs" } }, - "(method 48 progress)": { - "args": ["this", "screen", "option"] + "args": [ + "this", + "screen", + "option" + ] }, - "activate-progress": { - "args": ["creator", "screen"] + "args": [ + "creator", + "screen" + ] }, - "(method 23 progress)": { - "args": ["this", "aspect", "video-mode"] + "args": [ + "this", + "aspect", + "video-mode" + ] }, - "(method 35 progress)": { "vars": { - "s4-0": ["s4-0", "text-id"] + "s4-0": [ + "s4-0", + "text-id" + ] } }, - "(method 43 progress)": { "vars": { - "s4-0": ["s4-0", "text-id"] + "s4-0": [ + "s4-0", + "text-id" + ] } }, - "(method 38 progress)": { "vars": { - "a1-1": ["a1-1", "text-id"] + "a1-1": [ + "a1-1", + "text-id" + ] } }, - "(post progress-debug)": { "vars": { - "v1-7": ["v1-7", "dma-packet"], - "v1-16": ["v1-16", "dma-packet"], - "v1-25": ["v1-25", "dma-packet"], - "v1-34": ["v1-34", "dma-packet"] + "v1-7": [ + "v1-7", + "dma-packet" + ], + "v1-16": [ + "v1-16", + "dma-packet" + ], + "v1-25": [ + "v1-25", + "dma-packet" + ], + "v1-34": [ + "v1-34", + "dma-packet" + ] } }, - "voicebox-track": { "vars": { "a0-1": "target" } }, - "citb-drop-plat-drop-children": { "vars": { - "v1-4": ["v1-4", "handle"] + "v1-4": [ + "v1-4", + "handle" + ] } }, - "master-track-target": { "vars": { - "v0-1": ["v0-1", "symbol"], - "v1-14": ["v1-14", "handle"] + "v0-1": [ + "v0-1", + "symbol" + ], + "v1-14": [ + "v1-14", + "handle" + ] } }, - "cam-los-spline-collide": { "vars": { - "s3-0": ["s3-0", "(inline-array collide-cache-tri)"] + "s3-0": [ + "s3-0", + "(inline-array collide-cache-tri)" + ] } }, - "cam-draw-collide-cache": { "vars": { - "gp-0": ["gp-0", "(inline-array collide-cache-tri)"] + "gp-0": [ + "gp-0", + "(inline-array collide-cache-tri)" + ] } }, - "cam-los-collide": { "vars": { - "s1-1": ["s1-1", "(inline-array collide-cache-tri)"] + "s1-1": [ + "s1-1", + "(inline-array collide-cache-tri)" + ] } }, - "(code plunger-lurker-plunge)": { "vars": { - "gp-1": ["gp-1", "handle"], - "s5-0": ["s5-0", "othercam"] + "gp-1": [ + "gp-1", + "handle" + ], + "s5-0": [ + "s5-0", + "othercam" + ] } }, - "flying-lurker-play-intro": { "vars": { - "gp-1": ["gp-1", "handle"] + "gp-1": [ + "gp-1", + "handle" + ] } }, - "(code flying-lurker-start)": { "vars": { - "v1-9": ["v1-9", "float"] + "v1-9": [ + "v1-9", + "float" + ] } }, - "(code flying-lurker-fly)": { "vars": { - "v1-42": ["v1-42", "float"] + "v1-42": [ + "v1-42", + "float" + ] } }, - "(method 14 level-group)": { "vars": { - "s0-1": ["s0-1", "(pointer int32)"], - "s1-1": ["s1-1", "process-drawable"], - "v0-10": ["v0-10", "symbol"] + "s0-1": [ + "s0-1", + "(pointer int32)" + ], + "s1-1": [ + "s1-1", + "process-drawable" + ], + "v0-10": [ + "v0-10", + "symbol" + ] } }, - "level-hint-displayed?": { "vars": { - "a0-1": ["a0-1", "level-hint"] + "a0-1": [ + "a0-1", + "level-hint" + ] } }, - "level-hint-init-by-other": { "vars": { - "a0-6": ["a0-6", "string"] + "a0-6": [ + "a0-6", + "string" + ] } }, - "(method 27 entity-ambient)": { "vars": { - "s5-0": ["s5-0", "symbol"] + "s5-0": [ + "s5-0", + "symbol" + ] } }, - "upload-vis-bits": { "vars": { "v1-2": "qwc", - "a0-1": ["lev-vis-bits", "(pointer uint128)"], - "a1-1": ["all-vis", "(pointer uint128)"], - "a2-2": ["spad-vis", "(pointer uint128)"] + "a0-1": [ + "lev-vis-bits", + "(pointer uint128)" + ], + "a1-1": [ + "all-vis", + "(pointer uint128)" + ], + "a2-2": [ + "spad-vis", + "(pointer uint128)" + ] } }, - "(event be-clone process-taskable)": { "vars": { - "v0-0": ["v0-0", "shadow-geo"] + "v0-0": [ + "v0-0", + "shadow-geo" + ] } }, - "(event idle process-taskable)": { "vars": { - "v0-0": ["v0-0", "symbol"] + "v0-0": [ + "v0-0", + "symbol" + ] } }, - "(method 9 load-dir-art-group)": { - "args": ["this", "art-name", "do-reload", "heap", "version"] + "args": [ + "this", + "art-name", + "do-reload", + "heap", + "version" + ] }, - "(method 15 hud-money)": { "vars": { - "v1-8": ["v1-8", "dma-packet"] + "v1-8": [ + "v1-8", + "dma-packet" + ] } }, - "(method 15 hud-money-all)": { "vars": { - "v1-32": ["v1-32", "dma-packet"] + "v1-32": [ + "v1-32", + "dma-packet" + ] } }, - "(trans fisher-done)": { "vars": { - "v1-13": ["v1-13", "dma-packet"] + "v1-13": [ + "v1-13", + "dma-packet" + ] } }, - "anim-tester-get-playing-item": { "vars": { - "v0-0": ["v0-0", "anim-test-seq-item"] + "v0-0": [ + "v0-0", + "anim-test-seq-item" + ] } }, - "light-eco-mother-default-event-handler": { "vars": { - "v0-0": ["v0-0", "int"] + "v0-0": [ + "v0-0", + "int" + ] } }, - "(code robotboss-white-eco-movie)": { "vars": { - "gp-1": ["gp-1", "handle"] + "gp-1": [ + "gp-1", + "handle" + ] } }, - "cam-collision-record-draw": { "vars": { - "s5-0": ["s5-0", "cam-collision-record"] + "s5-0": [ + "s5-0", + "cam-collision-record" + ] } }, - "cam-collision-record-save": { "vars": { - "v1-5": ["v1-5", "cam-collision-record"] + "v1-5": [ + "v1-5", + "cam-collision-record" + ] } }, - "cam-layout-save-cam-trans": { "vars": { - "s5-1": ["s5-1", "vector"], - "s2-1": ["s2-1", "vector"] + "s5-1": [ + "s5-1", + "vector" + ], + "s2-1": [ + "s2-1", + "vector" + ] } }, - "(method 15 level)": { "vars": { - "v1-5": ["v1-5", "(inline-array box8s)"] + "v1-5": [ + "v1-5", + "(inline-array box8s)" + ] } }, - "(method 14 process-drawable)": { "vars": { - "a2-10": ["a2-10", "int"] + "a2-10": [ + "a2-10", + "int" + ] } }, - "joint-control-reset!": { "vars": { - "v1-2": ["v1-2", "joint-control-channel"] + "v1-2": [ + "v1-2", + "joint-control-channel" + ] } }, - "matrix-from-control!": { "vars": { - "v1-10": ["v1-10", "matrix"] + "v1-10": [ + "v1-10", + "matrix" + ] } }, - "(event citb-robotboss-idle)": { "vars": { - "v0-3": ["v0-3", "symbol"] + "v0-3": [ + "v0-3", + "symbol" + ] } }, - "(code pov-camera-playing maincavecam)": { "vars": { - "gp-1": ["gp-1", "handle"] + "gp-1": [ + "gp-1", + "handle" + ] } }, - - // this shouldn't be required "(event darkecobarrel-mover-move)": { "vars": { - "v0-0": ["v0-0", "object"] + "v0-0": [ + "v0-0", + "object" + ] } }, - - // this shouldn't be required "(event cam-master-active)": { "vars": { - "v0-0": ["v0-0", "object"] + "v0-0": [ + "v0-0", + "object" + ] } }, - "(code pickup fuel-cell)": { "vars": { - "v1-34": ["v1-34", "(inline-array vector)"] + "v1-34": [ + "v1-34", + "(inline-array vector)" + ] } }, - "(method 11 eco)": { "vars": { - "v1-2": ["v1-2", "pickup-type"] + "v1-2": [ + "v1-2", + "pickup-type" + ] } }, - "(method 9 fact-info)": { "vars": { - "s3-0": ["s3-0", "pickup-type"] + "s3-0": [ + "s3-0", + "pickup-type" + ] } }, - "(event pickup eco-collectable)": { "vars": { - "v0-1": ["v0-1", "symbol"] + "v0-1": [ + "v0-1", + "symbol" + ] } }, - "cloud-track": { "vars": { - "s1-1": ["s1-1", "handle"], - "s2-1": ["s2-1", "handle"] + "s1-1": [ + "s1-1", + "handle" + ], + "s2-1": [ + "s2-1", + "handle" + ] } }, - "(method 63 collide-shape-moving)": { "vars": { - "s0-0": ["s0-0", "collide-cache-prim"] + "s0-0": [ + "s0-0", + "collide-cache-prim" + ] } }, - "target-powerup-effect": { "vars": { - "a0-74": ["a0-74", "vector"] + "a0-74": [ + "a0-74", + "vector" + ] } }, - "(code target-yellow-blast)": { "vars": { - "gp-0": ["gp-0", "handle"] + "gp-0": [ + "gp-0", + "handle" + ] } }, - "dma-add-process-drawable": { "vars": { - "a0-20": ["a0-20", "terrain-context"], - "s4-0": ["s4-0", "vector"], - "v1-42": ["v1-42", "vector"], + "a0-20": [ + "a0-20", + "terrain-context" + ], + "s4-0": [ + "s4-0", + "vector" + ], + "v1-42": [ + "v1-42", + "vector" + ], "s3-1": "lod-to-use", "f30-1": "cam-dist", "s3-0": "tod", @@ -3753,312 +5982,604 @@ "f30-0": "cur-interp" } }, - "flatten-joint-control-to-spr": { "vars": { - "a1-0": ["a1-0", "(inline-array vector)"], - "a1-1": ["a1-1", "(inline-array vector)"], - "a1-2": ["a1-2", "(inline-array vector)"], + "a1-0": [ + "a1-0", + "(inline-array vector)" + ], + "a1-1": [ + "a1-1", + "(inline-array vector)" + ], + "a1-2": [ + "a1-2", + "(inline-array vector)" + ], "s5-0": "nb-channels", "s4-0": "upl-idx", "s3-0": "ch" } }, - "(event puffer-die)": { "vars": { - "v0-0": ["v0-0", "uint"] + "v0-0": [ + "v0-0", + "uint" + ] } }, - "bones-init": { "vars": { - "a2-1": ["a2-1", "bone-memory"], - "v1-2": ["v1-2", "bone-memory"] + "a2-1": [ + "a2-1", + "bone-memory" + ], + "v1-2": [ + "v1-2", + "bone-memory" + ] } }, - "draw-bones-mtx-calc": { "vars": { - "t2-0": ["t2-0", "bone-memory"] + "t2-0": [ + "t2-0", + "bone-memory" + ] } }, - "bones-mtx-calc-execute": { "vars": { - "a1-9": ["a1-9", "(inline-array vector)"], - "v1-18": ["v1-18", "(inline-array matrix)"] + "a1-9": [ + "a1-9", + "(inline-array vector)" + ], + "v1-18": [ + "v1-18", + "(inline-array matrix)" + ] } }, - "texscroll-make-request": { "vars": { - "a1-1": ["a1-1", "mei-texture-scroll"] + "a1-1": [ + "a1-1", + "mei-texture-scroll" + ] } }, - "texscroll-execute": { "vars": { - "t1-0": ["t1-0", "merc-fragment"], - "a1-2": ["a1-2", "mei-texture-scroll"], - "t1-3": ["t1-3", "(pointer int8)"], - "a2-1": ["a2-1", "merc-fragment-control"] + "t1-0": [ + "t1-0", + "merc-fragment" + ], + "a1-2": [ + "a1-2", + "mei-texture-scroll" + ], + "t1-3": [ + "t1-3", + "(pointer int8)" + ], + "a2-1": [ + "a2-1", + "merc-fragment-control" + ] } }, - "draw-bones": { "vars": { - "a2-6": ["a2-6", "bone-regs"], - "t4-0": ["t4-0", "bone-memory"], - "v1-36": ["v1-36", "mei-texture-scroll"], - "v1-6": ["v1-6", "vu-lights"] + "a2-6": [ + "a2-6", + "bone-regs" + ], + "t4-0": [ + "t4-0", + "bone-memory" + ], + "v1-36": [ + "v1-36", + "mei-texture-scroll" + ], + "v1-6": [ + "v1-6", + "vu-lights" + ] } }, - "draw-bones-hud": { "vars": { - "t0-1": ["t0-1", "bone-regs"], - "t6-0": ["t6-0", "bone-memory"], - "t2-10": ["t2-10", "vu-lights"] + "t0-1": [ + "t0-1", + "bone-regs" + ], + "t6-0": [ + "t6-0", + "bone-memory" + ], + "t2-10": [ + "t2-10", + "vu-lights" + ] } }, - "(code manipy-idle)": { "vars": { - "v1-29": ["v1-29", "(pointer process)"] + "v1-29": [ + "v1-29", + "(pointer process)" + ] } }, - "(code target-death)": { "vars": { - "s5-8": ["s5-8", "handle"] + "s5-8": [ + "s5-8", + "handle" + ] } }, - "(method 23 exit-chamber)": { "vars": { - "v1-39": ["v1-39", "handle"] + "v1-39": [ + "v1-39", + "handle" + ] } }, - "beachcam-spawn": { "vars": { - "gp-1": ["gp-1", "handle"], - "v1-12": ["v1-12", "handle"], - "v1-15": ["v1-15", "handle"], - "s5-2": ["s5-2", "handle"] + "gp-1": [ + "gp-1", + "handle" + ], + "v1-12": [ + "v1-12", + "handle" + ], + "v1-15": [ + "v1-15", + "handle" + ], + "s5-2": [ + "s5-2", + "handle" + ] } }, - "(code pelican-spit)": { "vars": { - "gp-1": ["gp-1", "handle"], - "s4-0": ["s4-0", "handle"] + "gp-1": [ + "gp-1", + "handle" + ], + "s4-0": [ + "s4-0", + "handle" + ] } }, - "(code race-ring-active)": { "vars": { - "gp-2": ["gp-2", "handle"], - "v1-65": ["v1-65", "handle"], - "s5-2": ["s5-2", "handle"] + "gp-2": [ + "gp-2", + "handle" + ], + "v1-65": [ + "v1-65", + "handle" + ], + "s5-2": [ + "s5-2", + "handle" + ] } }, - "(code pov-camera-playing snowcam)": { "vars": { - "gp-2": ["gp-2", "handle"] + "gp-2": [ + "gp-2", + "handle" + ] } }, - "(code target-demo)": { "vars": { - "v1-12": ["v1-12", "handle"], - "v1-24": ["v1-24", "handle"], - "v1-32": ["v1-32", "handle"], - "v1-38": ["v1-38", "handle"], - "v1-44": ["v1-44", "handle"], - "v1-50": ["v1-50", "handle"], - "v1-56": ["v1-56", "handle"], - "v1-62": ["v1-62", "handle"], - "v1-70": ["v1-70", "handle"], - "v1-76": ["v1-76", "handle"], - "v1-82": ["v1-82", "handle"], - "v1-88": ["v1-88", "handle"], - "v1-94": ["v1-94", "handle"], - "v1-100": ["v1-100", "handle"], - "v1-106": ["v1-106", "handle"], - "v1-112": ["v1-112", "handle"], - "v1-18": ["v1-18", "handle"] - } - }, - + "v1-12": [ + "v1-12", + "handle" + ], + "v1-24": [ + "v1-24", + "handle" + ], + "v1-32": [ + "v1-32", + "handle" + ], + "v1-38": [ + "v1-38", + "handle" + ], + "v1-44": [ + "v1-44", + "handle" + ], + "v1-50": [ + "v1-50", + "handle" + ], + "v1-56": [ + "v1-56", + "handle" + ], + "v1-62": [ + "v1-62", + "handle" + ], + "v1-70": [ + "v1-70", + "handle" + ], + "v1-76": [ + "v1-76", + "handle" + ], + "v1-82": [ + "v1-82", + "handle" + ], + "v1-88": [ + "v1-88", + "handle" + ], + "v1-94": [ + "v1-94", + "handle" + ], + "v1-100": [ + "v1-100", + "handle" + ], + "v1-106": [ + "v1-106", + "handle" + ], + "v1-112": [ + "v1-112", + "handle" + ], + "v1-18": [ + "v1-18", + "handle" + ] + } + }, "(method 32 sequenceA-village1)": { "vars": { - "v1-27": ["v1-27", "handle"], - "v1-34": ["v1-34", "handle"] + "v1-27": [ + "v1-27", + "handle" + ], + "v1-34": [ + "v1-34", + "handle" + ] } }, - "(exit play-anim sequenceA-village1)": { "vars": { - "v1-4": ["v1-4", "handle"], - "v1-10": ["v1-10", "handle"] + "v1-4": [ + "v1-4", + "handle" + ], + "v1-10": [ + "v1-10", + "handle" + ] } }, - "(event play-anim sequenceA-village1)": { "vars": { - "v1-12": ["v1-12", "handle"], - "v1-19": ["v1-19", "handle"], - "v1-26": ["v1-26", "handle"] + "v1-12": [ + "v1-12", + "handle" + ], + "v1-19": [ + "v1-19", + "handle" + ], + "v1-26": [ + "v1-26", + "handle" + ] } }, - "mistycam-spawn": { "vars": { - "v1-12": ["v1-12", "handle"], - "v1-15": ["v1-15", "handle"], - "s5-2": ["s5-2", "handle"] + "v1-12": [ + "v1-12", + "handle" + ], + "v1-15": [ + "v1-15", + "handle" + ], + "s5-2": [ + "s5-2", + "handle" + ] } }, - "(code happy-plant-opening)": { "vars": { - "gp-2": ["gp-2", "handle"], - "v1-40": ["v1-40", "handle"], - "s5-3": ["s5-3", "handle"] + "gp-2": [ + "gp-2", + "handle" + ], + "v1-40": [ + "v1-40", + "handle" + ], + "s5-3": [ + "s5-3", + "handle" + ] } }, - "(code target-title)": { "vars": { - "gp-0": ["gp-0", "handle"] + "gp-0": [ + "gp-0", + "handle" + ] } }, - "(code hud-collecting)": { "vars": { - "v1-0": ["v1-0", "handle"] + "v1-0": [ + "v1-0", + "handle" + ] } }, - "(method 13 touching-list)": { "vars": { - "v0-0": ["v0-0", "touching-shapes-entry"] + "v0-0": [ + "v0-0", + "touching-shapes-entry" + ] } }, - "(method 11 touching-list)": { "vars": { - "s5-0": ["s5-0", "touching-shapes-entry"] + "s5-0": [ + "s5-0", + "touching-shapes-entry" + ] } }, - "recursive-inside-poly": { "vars": { - "a1-2": ["a1-2", "nav-node"] + "a1-2": [ + "a1-2", + "nav-node" + ] } }, - "vu-point-triangle-intersection?": { "vars": { - "v1-0": ["v1-0", "int"], - "a0-1": ["a0-1", "int"], - "a1-1": ["a1-1", "int"] + "v1-0": [ + "v1-0", + "int" + ], + "a0-1": [ + "a0-1", + "int" + ], + "a1-1": [ + "a1-1", + "int" + ] } }, - "point-inside-poly?": { "vars": { - "v1-6": ["v1-6", "int"], - "a0-3": ["a0-3", "int"], - "a1-6": ["a1-6", "int"] + "v1-6": [ + "v1-6", + "int" + ], + "a0-3": [ + "a0-3", + "int" + ], + "a1-6": [ + "a1-6", + "int" + ] } }, - "(method 29 nav-mesh)": { "vars": { - "v1-10": ["v1-10", "int"] + "v1-10": [ + "v1-10", + "int" + ] } }, - "(method 15 snow-ball)": { "vars": { - "v1-0": ["v1-0", "(pointer snow-ball-roller)"], - "a3-1": ["a3-1", "(inline-array snow-ball-junction)"] + "v1-0": [ + "v1-0", + "(pointer snow-ball-roller)" + ], + "a3-1": [ + "a3-1", + "(inline-array snow-ball-junction)" + ] } }, - "curve-evaluate!": { "vars": { - "t2-1": ["t2-1", "(pointer float)"], - "v1-5": ["v1-5", "(pointer float)"] + "t2-1": [ + "t2-1", + "(pointer float)" + ], + "v1-5": [ + "v1-5", + "(pointer float)" + ] } }, - "update-mood-flames": { "vars": { - "s5-0": ["s5-0", "flames-state"] + "s5-0": [ + "s5-0", + "flames-state" + ] } }, - "update-mood-lava": { "vars": { - "s4-0": ["s4-0", "lava-state"] + "s4-0": [ + "s4-0", + "lava-state" + ] } }, - "update-mood-snow": { "vars": { - "s5-1": ["s5-1", "snow-states"] + "s5-1": [ + "s5-1", + "snow-states" + ] } }, - "update-mood-village3": { "vars": { - "s0-2": ["s0-2", "village3-states"] + "s0-2": [ + "s0-2", + "village3-states" + ] } }, - "update-mood-ogre": { "vars": { - "s4-1": ["s4-1", "ogre-states"] + "s4-1": [ + "s4-1", + "ogre-states" + ] } }, - "update-mood-finalboss": { "vars": { - "s4-0": ["s4-0", "finalboss-states"] + "s4-0": [ + "s4-0", + "finalboss-states" + ] } }, - "(method 11 med-res-level)": { "vars": { - "s4-0": ["s4-0", "(pointer sparticle-launch-group)"] + "s4-0": [ + "s4-0", + "(pointer sparticle-launch-group)" + ] } }, - "render-ocean-far": { "vars": { - "s5-0": ["vertices", "(inline-array ocean-vertex)"] + "s5-0": [ + "vertices", + "(inline-array ocean-vertex)" + ] } }, - "(method 12 touching-list)": { "vars": { - "gp-0": ["entry", "touching-shapes-entry"], + "gp-0": [ + "entry", + "touching-shapes-entry" + ], "s5-0": "i", "s4-0": "c1", "s3-0": "c2" } }, - "(code ogreboss-stage1)": { "vars": { - "s5-0": ["boulder-pickup", "pickup-type"] + "s5-0": [ + "boulder-pickup", + "pickup-type" + ] + } + }, + "aaaaaaaaaaaaaaaaaaaaaaa": {}, + "debug-menu-context-render": { + "vars": { + "s4-0": "x-pos", + "s5-0": "stack-idx", + "s3-0": "menu", + "a3-0": "selection" + } + }, + "debug-menu-item-render": { + "args": [ + "item", + "x", + "y", + "submenus", + "selected" + ] + }, + "sprite-distorter-generate-tables": { + "vars": { + "gp-0": "tables", + "s3-0": "entry-index", + "s5-0": "ientry-index", + "s4-0": "iterations", + "f28-0": "cam-aspx", + "f30-0": "cam-aspy", + "s2-0": "i" + } + }, + "(method 10 rpc-buffer-pair)": { + "vars": { + "v0-2": "result", + "v1-0": "current-buffer" + } + }, + "(method 14 rpc-buffer-pair)": { + "vars": { + "v0-0": "result" + } + }, + "(method 9 rpc-buffer-pair)": { + "args": [ + "obj", + "fno", + "recv-buff", + "recv-size" + ], + "vars": { + "s2-0": "active-buffer", + "s1-0": "current-buffer" } }, - - "aaaaaaaaaaaaaaaaaaaaaaa": {} -} + "(method 12 rpc-buffer-pair)": { + "vars": { + "s5-0": "active-buffer" + }, + "args": [ + "obj", + "print-stall-warning" + ] + }, + "(method 13 rpc-buffer-pair)": { + "vars": { + "gp-0": "active-buffer" + } + } +} \ No newline at end of file diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 2d9313daddb..d614fa7b334 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -170,7 +170,8 @@ (_data uint8 :score -50 :dynamic :offset 16) ) (:methods - (new (symbol type int) _type_ 0)) + (new (symbol type int) _type_) ;; 0 + ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 @@ -297,9 +298,9 @@ (self process-tree :offset-assert 32) ) (:methods - (new (symbol type string) _type_ 0) - (activate (_type_ process-tree basic pointer) process-tree 9) - (deactivate (_type_) none 10) + (new (symbol type string) _type_) ;; 0 + (activate (_type_ process-tree basic pointer) process-tree) ;; 9 + (deactivate (_type_) none) ;; 10 (init-from-entity! "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: @@ -307,9 +308,9 @@ - collision information - loading the skeleton group / bones - sounds" - (_type_ entity-actor) none 11) - (run-logic? (_type_) symbol 12) - (process-tree-method-13 () none 13) + (_type_ entity-actor) none) ;; 11 + (run-logic? (_type_) symbol) ;; 12 + (process-tree-method-13 () none) ;; 13 ) :size-assert #x24 :method-count-assert 14 @@ -362,13 +363,13 @@ :size-assert #x5c :flag-assert #xf0000005c (:methods - (new (symbol type int) _type_ 0) - (update-rates! (_type_ float) float 9) - (advance-by! (_type_ float) clock 10) - (tick! (_type_) clock 11) - (save! (_type_ (pointer uint64)) int 12) - (load! (_type_ (pointer uint64)) int 13) - (reset! (_type_) none 14) + (new (symbol type int) _type_) ;; 0 + (update-rates! (_type_ float) float) ;; 9 + (advance-by! (_type_ float) clock) ;; 10 + (tick! (_type_) clock) ;; 11 + (save! (_type_ (pointer uint64)) int) ;; 12 + (load! (_type_ (pointer uint64)) int) ;; 13 + (reset! (_type_) none) ;; 14 ) ) @@ -388,9 +389,9 @@ :size-assert #x28 :flag-assert #xc00000028 (:methods - (stack-size-set! (_type_ int) none 9) - (thread-suspend (_type_) none 10) - (thread-resume (_type_) none 11) + (stack-size-set! (_type_ int) none) ;; 9 + (thread-suspend (_type_) none) ;; 10 + (thread-resume (_type_) none) ;; 11 ) ) @@ -409,7 +410,7 @@ :size-assert #x80 :flag-assert #xc00000080 (:methods - (new (symbol type process symbol int pointer) _type_ 0) + (new (symbol type process symbol int pointer) _type_) ;; 0 ) ) @@ -422,9 +423,9 @@ :flag-assert #x1000000024 ;; Failed to read fields. (:methods - (new (symbol type int int string) _type_ 0) - (get-process (_type_ type int) process 14) - (return-process (_type_ process) none 15) + (new (symbol type int int string) _type_) ;; 0 + (get-process (_type_ type int) process) ;; 14 + (return-process (_type_ process) none) ;; 15 ) ) @@ -460,19 +461,19 @@ :flag-assert #x1c00000068 ;; Failed to read fields. (:methods - (new (symbol type string int int) _type_ 0) - (init (_type_ symbol int) none 16) - (compact (dead-pool-heap int) none 17) - (shrink-heap (dead-pool-heap process) dead-pool-heap 18) - (churn (dead-pool-heap int) none 19) - (memory-used (_type_) int 20) - (memory-total (_type_) int 21) - (memory-free (dead-pool-heap) int 22) - (compact-time (dead-pool-heap) uint 23) - (gap-size (dead-pool-heap dead-pool-heap-rec) int 24) - (gap-location (dead-pool-heap dead-pool-heap-rec) pointer 25) - (find-gap (dead-pool-heap dead-pool-heap-rec) dead-pool-heap-rec 26) - (find-gap-by-size (dead-pool-heap int) dead-pool-heap-rec 27) + (new (symbol type string int int) _type_) ;; 0 + (init (_type_ symbol int) none) ;; 16 + (compact (dead-pool-heap int) none) ;; 17 + (shrink-heap (dead-pool-heap process) dead-pool-heap) ;; 18 + (churn (dead-pool-heap int) none) ;; 19 + (memory-used (_type_) int) ;; 20 + (memory-total (_type_) int) ;; 21 + (memory-free (dead-pool-heap) int) ;; 22 + (compact-time (dead-pool-heap) uint) ;; 23 + (gap-size (dead-pool-heap dead-pool-heap-rec) int) ;; 24 + (gap-location (dead-pool-heap dead-pool-heap-rec) pointer) ;; 25 + (find-gap (dead-pool-heap dead-pool-heap-rec) dead-pool-heap-rec) ;; 26 + (find-gap-by-size (dead-pool-heap int) dead-pool-heap-rec) ;; 27 ) ) @@ -500,7 +501,7 @@ :size-assert #xb0 :flag-assert #x9000000b0 (:methods - (new (symbol type symbol function (pointer uint64)) object 0) + (new (symbol type symbol function (pointer uint64)) object) ;; 0 ) ) @@ -536,7 +537,7 @@ (function object) function (function object) - (function process int symbol event-message-block object)) _type_ 0) + (function process int symbol event-message-block object)) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x24 @@ -567,7 +568,7 @@ :size-assert #x10 :flag-assert #xa00000010 (:methods - (send-all! (_type_) none 9) + (send-all! (_type_) none) ;; 9 ) ) @@ -596,7 +597,7 @@ (stack uint8 :dynamic :offset-assert 128 :score -1) ) (:methods - (new (symbol type string int) _type_ 0) + (new (symbol type string int) _type_) ;; 0 ) (:states dead-state @@ -612,7 +613,9 @@ (error symbol :offset-assert 12) (data string :dynamic :offset-assert 16) ;; are these actually symbols, or are they strings (in the GOAL code they are treated as strings atleast) ) - (:methods (new (symbol type uint) _type_ 0)) + (:methods + (new (symbol type uint) _type_) ;; 0 + ) :method-count-assert 9 :size-assert #x10 ) @@ -929,11 +932,11 @@ :size-assert #xd :flag-assert #xd0000000d (:methods - (new (symbol type int) _type_ 0) - (get-bit (_type_ int) symbol 9) - (clear-bit (_type_ int) int 10) - (set-bit (_type_ int) int 11) - (clear-all! (_type_) _type_ 12) + (new (symbol type int) _type_) ;; 0 + (get-bit (_type_ int) symbol) ;; 9 + (clear-bit (_type_ int) int) ;; 10 + (set-bit (_type_ int) int) ;; 11 + (clear-all! (_type_) _type_) ;; 12 ) ) @@ -1258,8 +1261,8 @@ :size-assert #x28 :flag-assert #xb00000028 (:methods - (debug-draw (_type_ vector4w) none 9) - (ray-capsule-intersect (_type_ vector vector) float 10) + (debug-draw (_type_ vector4w) none) ;; 9 + (ray-capsule-intersect (_type_ vector vector) float) ;; 10 ) ) @@ -1273,8 +1276,8 @@ :size-assert #x28 :flag-assert #xb00000028 (:methods - (debug-draw (_type_ vector4w) none 9) - (ray-flat-cyl-intersect (_type_ vector vector) float 10) + (debug-draw (_type_ vector4w) none) ;; 9 + (ray-flat-cyl-intersect (_type_ vector vector) float) ;; 10 ) ) @@ -1358,18 +1361,18 @@ :size-assert #x20 :flag-assert #x1500000020 (:methods - (add-spheres! (_type_ (inline-array sphere) int) int 9) - (add-box! (_type_ bounding-box) int 10) - (add-point! (_type_ vector) none 11) - (intersects-line-segment? (_type_ vector vector) symbol 12) - (set-from-point-offset! (_type_ vector vector) none 13) - (set-from-point-offset-pad! (_type_ vector vector float) int 14) - (set-to-point! (_type_ vector) none 15) - (set-from-sphere! (_type_ sphere) none 16) - (set-from-spheres! (_type_ (inline-array sphere) int) int 17) - (get-bounding-sphere (_type_ vector) vector 18) - (inside-xyz? (bounding-box vector) symbol 19) - (inside-xz? (bounding-box vector) symbol 20) + (add-spheres! (_type_ (inline-array sphere) int) int) ;; 9 + (add-box! (_type_ bounding-box) int) ;; 10 + (add-point! (_type_ vector) none) ;; 11 + (intersects-line-segment? (_type_ vector vector) symbol) ;; 12 + (set-from-point-offset! (_type_ vector vector) none) ;; 13 + (set-from-point-offset-pad! (_type_ vector vector float) int) ;; 14 + (set-to-point! (_type_ vector) none) ;; 15 + (set-from-sphere! (_type_ sphere) none) ;; 16 + (set-from-spheres! (_type_ (inline-array sphere) int) int) ;; 17 + (get-bounding-sphere (_type_ vector) vector) ;; 18 + (inside-xyz? (bounding-box vector) symbol) ;; 19 + (inside-xz? (bounding-box vector) symbol) ;; 20 ) ) @@ -1420,7 +1423,7 @@ :size-assert #x40 :flag-assert #xa00000040 (:methods - (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none 9) + (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none) ;; 9 ) ) @@ -1500,7 +1503,7 @@ (scale vector :inline :offset-assert 48) ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x40 @@ -1534,8 +1537,8 @@ :size-assert #x30 :flag-assert #xb00000030 (:methods - (debug-draw (_type_) int 9) - (point-past-plane? (_type_ vector) symbol 10) + (debug-draw (_type_) int) ;; 9 + (point-past-plane? (_type_ vector) symbol) ;; 10 ) ) @@ -1579,27 +1582,27 @@ :size-assert #x8c :flag-assert #x1c0000008c (:methods - (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion 9) - (set-heading-vec! (_type_ vector) quaternion 10) - (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion 11) - (point-toward-point! (_type_ vector) quaternion 12) - (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion 13) - (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion 14) - (set-roll-to-grav! (_type_ float) quaternion 15) - (set-roll-to-grav-2! (_type_ float) quaternion 16) - (rotate-toward-orientation! (_type_ quaternion float float int int float) quaternion 17) - (set-quaternion! (_type_ quaternion) quaternion 18) - (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion 19) - (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion 20) - (rot->dir-targ! (_type_) quaternion 21) - (y-angle (_type_) float 22) - (global-y-angle-to-point (_type_ vector) float 23) - (relative-y-angle-to-point (_type_ vector) float 24) - (roll-relative-to-gravity (_type_) float 25) + (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion) ;; 9 + (set-heading-vec! (_type_ vector) quaternion) ;; 10 + (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion) ;; 11 + (point-toward-point! (_type_ vector) quaternion) ;; 12 + (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion) ;; 13 + (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion) ;; 14 + (set-roll-to-grav! (_type_ float) quaternion) ;; 15 + (set-roll-to-grav-2! (_type_ float) quaternion) ;; 16 + (rotate-toward-orientation! (_type_ quaternion float float int int float) quaternion) ;; 17 + (set-quaternion! (_type_ quaternion) quaternion) ;; 18 + (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion) ;; 19 + (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion) ;; 20 + (rot->dir-targ! (_type_) quaternion) ;; 21 + (y-angle (_type_) float) ;; 22 + (global-y-angle-to-point (_type_ vector) float) ;; 23 + (relative-y-angle-to-point (_type_ vector) float) ;; 24 + (roll-relative-to-gravity (_type_) float) ;; 25 (set-and-limit-velocity "TODO - arg1 is an bitfield of some sort" - (_type_ int vector float) trsqv :behavior process 26) - (get-quaternion (_type_) quaternion 27) + (_type_ int vector float) trsqv :behavior process) ;; 26 + (get-quaternion (_type_) quaternion) ;; 27 ) ) @@ -1951,7 +1954,7 @@ (deftype sound-id (uint32) () (:methods - (unused-9 () none 9) + (unused-9 () none) ;; 9 ) :flag-assert #xa00000004 ) @@ -2255,14 +2258,14 @@ :size-assert #x6c :flag-assert #x100000006c (:methods - (new (symbol type basic vector) _type_ 0) - (update! (_type_) int 9) - (change-sound! (_type_ sound-name) int 10) - (update-trans! (_type_ vector) int 11) - (update-vol! (_type_ float) int 12) - (update-pitch-mod! (_type_ float) none 13) - (set-falloff-far! (_type_ float) none 14) - (stop! (_type_) int 15) + (new (symbol type basic vector) _type_) ;; 0 + (update! (_type_) int) ;; 9 + (change-sound! (_type_ sound-name) int) ;; 10 + (update-trans! (_type_ vector) int) ;; 11 + (update-vol! (_type_ float) int) ;; 12 + (update-pitch-mod! (_type_ float) none) ;; 13 + (set-falloff-far! (_type_ float) none) ;; 14 + (stop! (_type_) int) ;; 15 ) ) @@ -3242,10 +3245,10 @@ :size-assert #x2030 :flag-assert #xd00002030 (:methods - (get-total-time (_type_) int 9) - (start-frame! (_type_) none 10) - (start-segment! (_type_ symbol rgba) none 11) - (end-segment! (_type_) none 12) + (get-total-time (_type_) int) ;; 9 + (start-frame! (_type_) none) ;; 10 + (start-segment! (_type_ symbol rgba) none) ;; 11 + (end-segment! (_type_) none) ;; 12 ) ) @@ -3258,9 +3261,9 @@ :size-assert #x8 :flag-assert #xc00000008 (:methods - (setup-categories! (_type_) none 9) - (draw-bars! (_type_ dma-buffer int) none 10) - (draw-text! (_type_) none 11) + (setup-categories! (_type_) none) ;; 9 + (draw-bars! (_type_ dma-buffer int) none) ;; 10 + (draw-text! (_type_) none) ;; 11 ) ) @@ -3385,7 +3388,7 @@ (data-buffer uint8 :dynamic :offset 16) ;; added ) (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x18 @@ -3536,8 +3539,8 @@ :size-assert #x90 :flag-assert #xa00000090 (:methods - (new (symbol type int) _type_ 0) - (adjust-to-screen-flip (_type_) int 9) + (new (symbol type int) _type_) ;; 0 + (adjust-to-screen-flip (_type_) int) ;; 9 ) ) @@ -3546,7 +3549,7 @@ (cpads cpad-info 2 :offset-assert 8) ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x10 @@ -3576,7 +3579,7 @@ (speedy float :offset 108) ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x70 @@ -4339,7 +4342,7 @@ (args uint64 1 :offset-assert 32) ) (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x28 @@ -4355,7 +4358,7 @@ (color rgba 4 :offset-assert 24) ) (:methods - (new (symbol type int int int int rgba) _type_ 0) + (new (symbol type int int int int rgba) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x28 @@ -4447,7 +4450,7 @@ (run-time int64 :offset-assert 64) ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x48 @@ -4488,8 +4491,8 @@ :size-assert #x9c :flag-assert #xa0000009c (:methods - (new (symbol type int int int int int) _type_ 0) - (set-time-ratios (_type_ float) float 9) + (new (symbol type int int int int int) _type_) ;; 0 + (set-time-ratios (_type_ float) float) ;; 9 ) ) @@ -4734,9 +4737,9 @@ :flag-assert #xb00000010 ;; Failed to read fields. (:methods - (new (symbol type int level) _type_ 0) - (load-to-heap-by-name (_type_ string symbol kheap int) art-group 9) - (set-loaded-art (_type_ art-group) art-group 10) + (new (symbol type int level) _type_) ;; 0 + (load-to-heap-by-name (_type_ string symbol kheap int) art-group) ;; 9 + (set-loaded-art (_type_ art-group) art-group) ;; 10 ) ) @@ -4745,7 +4748,7 @@ ) :flag-assert #xb00000010 (:methods - (new (symbol type int level) _type_ 0) + (new (symbol type int level) _type_) ;; 0 ) ) @@ -4775,14 +4778,14 @@ :size-assert #x68 :flag-assert #x1000000068 (:methods - (new (symbol type int function symbol) _type_ 0) - (set-pending-file (_type_ string int handle float) int 9) - (update (_type_) int 10) - (inactive? (_type_) symbol 11) - (file-status (_type_ string int) symbol 12) - (link-file (_type_ art-group) art-group 13) - (unlink-file (_type_ art-group) int 14) - (unlock! (_type_) int 15) + (new (symbol type int function symbol) _type_) ;; 0 + (set-pending-file (_type_ string int handle float) int) ;; 9 + (update (_type_) int) ;; 10 + (inactive? (_type_) symbol) ;; 11 + (file-status (_type_ string int) symbol) ;; 12 + (link-file (_type_ art-group) art-group) ;; 13 + (unlink-file (_type_ art-group) int) ;; 14 + (unlock! (_type_) int) ;; 15 ) ) @@ -4818,14 +4821,14 @@ :size-assert #xd0 :flag-assert #x10000000d0 (:methods - (new (symbol type) _type_ 0) - (update (_type_ symbol) int 9) - (clear-rec (_type_) int 10) - (spool-push (_type_ string int process float) int 11) - (file-status (_type_ string int) symbol 12) - (reserve-alloc (_type_) kheap 13) - (reserve-free (_type_ kheap) int 14) - (none-reserved? (_type_) symbol 15) + (new (symbol type) _type_) ;; 0 + (update (_type_ symbol) int) ;; 9 + (clear-rec (_type_) int) ;; 10 + (spool-push (_type_ string int process float) int) ;; 11 + (file-status (_type_ string int) symbol) ;; 12 + (reserve-alloc (_type_) kheap) ;; 13 + (reserve-free (_type_ kheap) int) ;; 14 + (none-reserved? (_type_) symbol) ;; 15 ) ) @@ -4900,24 +4903,24 @@ :size-assert #x2d0 :flag-assert #x1a000002d0 (:methods - (new (symbol type) _type_ 0) - (initialize! (_type_) _type_ 9) - (print-usage (_type_) _type_ 10) - (setup-font-texture (_type_) none 11) - (allocate-defaults (_type_) none 12) - (login-level-textures (_type_ level int (pointer texture-id)) none 13) - (add-level-tpage-dma (_type_ level tpage-category bucket-id) none 14) - (allocate-vram-words! (_type_ int) int 15) - (allocate-segment (_type_ texture-pool-segment int) texture-pool-segment 16) - (unload-page (_type_ texture-page) none 17) - (get-common-page-slot-by-id (_type_ int) int 18) - (update-warp-and-hud (_type_) none 19) - (update-sprites (_type_) none 20) - (mark-hud-warp-sprite-dirty (_type_) none 21) - (lay-out-sprite-tex (_type_) none 22) - (lay-out-hud-tex (_type_) none 23) - (lay-out-warp-tex (_type_) none 24) - (clear-ids (_type_) none 25) + (new (symbol type) _type_) ;; 0 + (initialize! (_type_) _type_) ;; 9 + (print-usage (_type_) _type_) ;; 10 + (setup-font-texture (_type_) none) ;; 11 + (allocate-defaults (_type_) none) ;; 12 + (login-level-textures (_type_ level int (pointer texture-id)) none) ;; 13 + (add-level-tpage-dma (_type_ level tpage-category bucket-id) none) ;; 14 + (allocate-vram-words! (_type_ int) int) ;; 15 + (allocate-segment (_type_ texture-pool-segment int) texture-pool-segment) ;; 16 + (unload-page (_type_ texture-page) none) ;; 17 + (get-common-page-slot-by-id (_type_ int) int) ;; 18 + (update-warp-and-hud (_type_) none) ;; 19 + (update-sprites (_type_) none) ;; 20 + (mark-hud-warp-sprite-dirty (_type_) none) ;; 21 + (lay-out-sprite-tex (_type_) none) ;; 22 + (lay-out-hud-tex (_type_) none) ;; 23 + (lay-out-warp-tex (_type_) none) ;; 24 + (clear-ids (_type_) none) ;; 25 ) ) @@ -5006,12 +5009,12 @@ :size-assert #x80 :flag-assert #xe00000080 (:methods - (relocate (_type_ kheap (pointer uint8)) texture-page :replace 7) - (remove-data-from-heap (_type_ kheap) _type_ 9) - (get-leftover-block-count (_type_ int int) int 10) - (relocate-dests! (_type_ int int) none 11) - (add-to-dma-buffer (_type_ dma-buffer tex-upload-mode) int 12) - (upload-now! (_type_ tex-upload-mode) none 13) + (relocate (_type_ kheap (pointer uint8)) texture-page :replace) ;; 7 + (remove-data-from-heap (_type_ kheap) _type_) ;; 9 + (get-leftover-block-count (_type_ int int) int) ;; 10 + (relocate-dests! (_type_ int int) none) ;; 11 + (add-to-dma-buffer (_type_ dma-buffer tex-upload-mode) int) ;; 12 + (upload-now! (_type_ tex-upload-mode) none) ;; 13 ) ) @@ -5127,8 +5130,8 @@ (entries texture-page-dir-entry 1 :inline) ) (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (unlink-shaders-in-heap (_type_ kheap) int 9) + (relocate (_type_ kheap (pointer uint8)) none :replace) ;; 7 + (unlink-shaders-in-heap (_type_ kheap) int) ;; 9 ) :flag-assert #xa00000014 ) @@ -5204,8 +5207,8 @@ :size-assert #x130 :flag-assert #xb00000130 (:methods - (initialize-texture! (_type_) _type_ 9) - (clear-texture! (_type_) _type_ 10) + (initialize-texture! (_type_) _type_) ;; 9 + (clear-texture! (_type_) _type_) ;; 10 ) ) @@ -5231,8 +5234,8 @@ :size-assert #x58 :flag-assert #xb00000058 (:methods - (init-textures! (_type_) _type_ 9) - (clear-textures! (_type_) _type_ 10) + (init-textures! (_type_) _type_) ;; 9 + (clear-textures! (_type_) _type_) ;; 10 ) ) @@ -5243,8 +5246,8 @@ :size-assert #x10 :flag-assert #xb00000010 (:methods - (init! (_type_) _type_ 9) - (clear! (_type_) _type_ 10) + (init! (_type_) _type_) ;; 9 + (clear! (_type_) _type_) ;; 10 ) ) @@ -5680,34 +5683,34 @@ (init-weather! ;; TODO - local-vars mess up docstring placement ;; "A bunch of setup around moods and weather depending on a variety of conditions" - (_type_) none :behavior process 9) + (_type_) none :behavior process) ;; 9 (update-mood-weather! "Set the `target-interp` and `speed-interp` for the clouds and fog If `*-speed` is 0.0, use the `*-target` args to set `current-interp` See [[mood-weather]]" - (_type_ float float float float) none 10) + (_type_ float float float float) none) ;; 10 (update-mood-range! "Set the minimum and maximum ranges of clouds and fog See [[mood-range]]" - (_type_ float float float float) none 11) + (_type_ float float float float) none) ;; 11 (set-time-for-random-weather! "Set the `time-until-random`'s cloud and fog values See [[mood-weather]]" - (_type_ float float) none 12) - (apply-mood-clouds-and-fog (_type_ mood-control-work) none 13) - (apply-mood-color (_type_ mood-control-work) none 14) - (apply-mood-channels (_type_ mood-control-work) none 15) - (adjust-num-clouds! (_type_ mood-control-work) none 16) + (_type_ float float) none) ;; 12 + (apply-mood-clouds-and-fog (_type_ mood-control-work) none) ;; 13 + (apply-mood-color (_type_ mood-control-work) none) ;; 14 + (apply-mood-channels (_type_ mood-control-work) none) ;; 15 + (adjust-num-clouds! (_type_ mood-control-work) none) ;; 16 (gen-lightning-and-thunder! ;; TODO - docstrings with behaviors! ;; "Generates the lightning and thunder to play, kicks off the associated sounds" - (_type_) number 17) + (_type_) number) ;; 17 (play-or-stop-lightning! "Handles playing/stopping of the lightning sound - Plays the lightning sound if we are not loading and `lightning-id` is zero - Stops the lightning sound first if `lightning-id` is non-zero Returns the current value of `lightning-id`" - (_type_ sound-spec vector) sound-id 18) + (_type_ sound-spec vector) sound-id) ;; 18 ) ) @@ -6031,11 +6034,11 @@ :flag-assert #x1e0000146c ;; Failed to read fields. (:methods - (deactivate (_type_) _type_ 9) - (is-object-visible? (_type_ int) symbol 10) - (level-method-11 () none 11) ;; (add-irq-to-tex-buckets! (_type_) none 11) - (unload! (_type_) _type_ 12) - (bsp-name (_type_) symbol 13) + (deactivate (_type_) _type_) ;; 9 + (is-object-visible? (_type_ int) symbol) ;; 10 + (level-method-11 () none) ;; 11 ;; (add-irq-to-tex-buckets! (_type_) none) ;; 11 + (unload! (_type_) _type_) ;; 12 + (bsp-name (_type_) symbol) ;; 13 (compute-memory-usage! "Calculates the memory usage of the level, returns and stores the [[memory-usage-block]] in `mem-usage-block` as well as the total size in `mem-usage` @@ -6043,22 +6046,22 @@ @param force? - Will re-compute the usage if set to [[#t]], even if `mem-usage` has been set to a non-zero value @returns The [[memory-usage-block]] representing the footprint of the level @see [[memory-usage-block::10]]" - (_type_ symbol) memory-usage-block 14) - (inside-boxes-check (_type_ vector) symbol 15) - (update-vis! (_type_ level-vis-info uint (pointer uint8)) symbol 16) - (load-continue (_type_) _type_ 17) - (load-begin (_type_) _type_ 18) - (login-begin (_type_) _type_ 19) - (debug-print-region-splitbox (_type_ vector object) none 20) ;; (vis-load (_type_) uint 20) - (get-art-group-by-name (_type_ string) art-group 21) ;; (unused-21 (_type_) none 21) - (level-method-22 (_type_ symbol) int 22) ;; (birth (_type_) _type_ 22) - (lookup-text (_type_ text-id symbol) string 23) ;; (level-status-set! (_type_ symbol) _type_ 23) - (level-method-24 () none 24) - (birth (_type_) _type_ 25) ;; (init-vis (_type_) int 25) - (level-status-update! (_type_ symbol) _type_ 26) - (load-required-packages (_type_) _type_ 27) ;; (debug-print-splitbox (_type_ vector string) none 27) - (init-vis-from-bsp (_type_) none 28) - (vis-clear (_type_) none 29) + (_type_ symbol) memory-usage-block) ;; 14 + (inside-boxes-check (_type_ vector) symbol) ;; 15 + (update-vis! (_type_ level-vis-info uint (pointer uint8)) symbol) ;; 16 + (load-continue (_type_) _type_) ;; 17 + (load-begin (_type_) _type_) ;; 18 + (login-begin (_type_) _type_) ;; 19 + (debug-print-region-splitbox (_type_ vector object) none) ;; 20 ;; (vis-load (_type_) uint) ;; 20 + (get-art-group-by-name (_type_ string) art-group) ;; 21 ;; (unused-21 (_type_) none) ;; 21 + (level-method-22 (_type_ symbol) int) ;; 22 ;; (birth (_type_) _type_) ;; 22 + (lookup-text (_type_ text-id symbol) string) ;; 23 ;; (level-status-set! (_type_ symbol) _type_) ;; 23 + (level-method-24 () none) ;; 24 + (birth (_type_) _type_) ;; 25 ;; (init-vis (_type_) int) ;; 25 + (level-status-update! (_type_ symbol) _type_) ;; 26 + (load-required-packages (_type_) _type_) ;; 27 ;; (debug-print-splitbox (_type_ vector string) none) ;; 27 + (init-vis-from-bsp (_type_) none) ;; 28 + (vis-clear (_type_) none) ;; 29 ) ) @@ -6108,28 +6111,28 @@ :flag-assert #x1f00009014 ;; Failed to read fields. (:methods - (level-get (_type_ symbol) level 9) - (level-get-with-status (_type_ symbol) level 10) - (get-level-by-heap-ptr-and-status (_type_ pointer symbol) level 11) ;; - (level-get-for-use (_type_ symbol symbol) level 12) - (activate-levels! (_type_) int 13) - (debug-print-entities (_type_ symbol type) none 14) - (debug-draw-actors (_type_ symbol) none 15) - (assign-draw-indices (_type_) none 16) - (actors-update (_type_) none 17) - (update-nav-meshes-method "Clashes with a function name" (_type_) none 18) - (level-update (_type_) none 19) - (level-get-target-inside (_type_) level 20) - (alloc-levels-if-needed (_type_ symbol) none 21) - (load-commands-set! (_type_ pair) none 22) - (art-group-get-by-name (_type_ string (pointer uint32)) art-group 23) - (alt-load-command-get-index (_type_ symbol int) pair 24) - (update-vis-volumes (_type_) none 25) - (update-vis-volumes-from-nav-mesh (_type_) none 26) - (print-volume-sizes (_type_) none 27) - (level-status (_type_ symbol) symbol 28) - (load-in-progress? (_type_) symbol 29) - (level-get-most-disposable (_type_) level 30) + (level-get (_type_ symbol) level) ;; 9 + (level-get-with-status (_type_ symbol) level) ;; 10 + (get-level-by-heap-ptr-and-status (_type_ pointer symbol) level) ;; 11 ;; + (level-get-for-use (_type_ symbol symbol) level) ;; 12 + (activate-levels! (_type_) int) ;; 13 + (debug-print-entities (_type_ symbol type) none) ;; 14 + (debug-draw-actors (_type_ symbol) none) ;; 15 + (assign-draw-indices (_type_) none) ;; 16 + (actors-update (_type_) none) ;; 17 + (update-nav-meshes-method "Clashes with a function name" (_type_) none) ;; 18 + (level-update (_type_) none) ;; 19 + (level-get-target-inside (_type_) level) ;; 20 + (alloc-levels-if-needed (_type_ symbol) none) ;; 21 + (load-commands-set! (_type_ pair) none) ;; 22 + (art-group-get-by-name (_type_ string (pointer uint32)) art-group) ;; 23 + (alt-load-command-get-index (_type_ symbol int) pair) ;; 24 + (update-vis-volumes (_type_) none) ;; 25 + (update-vis-volumes-from-nav-mesh (_type_) none) ;; 26 + (print-volume-sizes (_type_) none) ;; 27 + (level-status (_type_ symbol) symbol) ;; 28 + (load-in-progress? (_type_) symbol) ;; 29 + (level-get-most-disposable (_type_) level) ;; 30 ) ) @@ -6275,7 +6278,9 @@ (mirror-normal vector :inline :offset-assert 1568) (fov-correction-factor float :offset-assert 1584) ) - (:methods (new (symbol type) _type_ 0)) + (:methods + (new (symbol type) _type_) ;; 0 + ) :method-count-assert 9 :size-assert #x634 :flag-assert #x900000634 @@ -6404,19 +6409,19 @@ :size-assert #x54 :flag-assert #x1500000054 (:methods - (new (symbol type matrix int int float font-color font-flags) _type_ 0) - (set-mat! (font-context matrix) font-context 9) - (set-origin! (font-context int int) font-context 10) - (set-depth! (font-context int) font-context 11) - (set-w! (font-context float) font-context 12) - (set-width! (font-context int) font-context 13) - (set-height! (font-context int) font-context 14) - (set-projection! (font-context float) font-context 15) - (set-color! (font-context font-color) font-context 16) - (set-flags! (font-context font-flags) font-context 17) - (set-start-line! (font-context uint) font-context 18) - (set-scale! (font-context float) font-context 19) - (set-alpha! (font-context float) font-context 20) + (new (symbol type matrix int int float font-color font-flags) _type_) ;; 0 + (set-mat! (font-context matrix) font-context) ;; 9 + (set-origin! (font-context int int) font-context) ;; 10 + (set-depth! (font-context int) font-context) ;; 11 + (set-w! (font-context float) font-context) ;; 12 + (set-width! (font-context int) font-context) ;; 13 + (set-height! (font-context int) font-context) ;; 14 + (set-projection! (font-context float) font-context) ;; 15 + (set-color! (font-context font-color) font-context) ;; 16 + (set-flags! (font-context font-flags) font-context) ;; 17 + (set-start-line! (font-context uint) font-context) ;; 18 + (set-scale! (font-context float) font-context) ;; 19 + (set-alpha! (font-context float) font-context) ;; 20 ) ) @@ -6580,11 +6585,11 @@ :flag-assert #xe00000020 ;; field param1 uses ~A with a signed load field param2 uses ~A with a signed load field param3 uses ~A with a signed load (:methods - (get-engine (connection) engine 9) - (get-process (connection) process 10) - (belongs-to-engine? (connection engine) symbol 11) - (belongs-to-process? (connection process) symbol 12) - (move-to-dead (connection) connection 13) + (get-engine (connection) engine) ;; 9 + (get-process (connection) process) ;; 10 + (belongs-to-engine? (connection engine) symbol) ;; 11 + (belongs-to-process? (connection process) symbol) ;; 12 + (move-to-dead (connection) connection) ;; 13 ) ) @@ -6608,24 +6613,24 @@ :flag-assert #x1a00000060 ;; Failed to read fields. (:methods - (new (symbol type symbol int type) _type_ 0) - (inspect-all-connections (engine) engine 9) - (apply-to-connections (engine (function connectable none)) int 10) - (apply-to-connections-reverse (engine (function connectable none)) int 11) - (execute-connections (engine object) int 12) - (execute-connections-and-move-to-dead (engine object) int 13) - (execute-connections-if-needed (engine object) int 14) - (add-connection (engine process object object object object) connection 15) - (remove-from-process (engine process) int 16) - (remove-matching (engine (function connection engine symbol)) int 17) - (remove-all (engine) int 18) - (remove-by-param0 (engine object) int 19) - (remove-by-param1 (engine int) int 20) - (remove-by-param2 (engine int) int 21) - (get-first-connectable (engine) connectable 22) - (get-last-connectable (engine) connectable 23) - (get-next-connectable (_type_ connectable) connectable 24) - (get-prev-connectable (_type_ connectable) connectable 25) + (new (symbol type symbol int type) _type_) ;; 0 + (inspect-all-connections (engine) engine) ;; 9 + (apply-to-connections (engine (function connectable none)) int) ;; 10 + (apply-to-connections-reverse (engine (function connectable none)) int) ;; 11 + (execute-connections (engine object) int) ;; 12 + (execute-connections-and-move-to-dead (engine object) int) ;; 13 + (execute-connections-if-needed (engine object) int) ;; 14 + (add-connection (engine process object object object object) connection) ;; 15 + (remove-from-process (engine process) int) ;; 16 + (remove-matching (engine (function connection engine symbol)) int) ;; 17 + (remove-all (engine) int) ;; 18 + (remove-by-param0 (engine object) int) ;; 19 + (remove-by-param1 (engine int) int) ;; 20 + (remove-by-param2 (engine int) int) ;; 21 + (get-first-connectable (engine) connectable) ;; 22 + (get-last-connectable (engine) connectable) ;; 23 + (get-next-connectable (_type_ connectable) connectable) ;; 24 + (get-prev-connectable (_type_ connectable) connectable) ;; 25 ) ) @@ -6660,13 +6665,13 @@ :size-assert #x20 :flag-assert #xf00000020 (:methods - (new (symbol type symbol int type) _type_ 0) - (schedule-callback (_type_ object time-frame) connection-pers 9) - (kill-callback (_type_ connection-pers) none 10) - (kill-by-key (_type_ object) none 11) - (kill-matching (_type_ (function engine-pers connection-pers object object symbol) object object) none 12) - (update-callback (_type_) none 13) - (run-pending-updates! (_type_ time-frame) none 14) + (new (symbol type symbol int type) _type_) ;; 0 + (schedule-callback (_type_ object time-frame) connection-pers) ;; 9 + (kill-callback (_type_ connection-pers) none) ;; 10 + (kill-by-key (_type_ object) none) ;; 11 + (kill-matching (_type_ (function engine-pers connection-pers object object symbol) object object) none) ;; 12 + (update-callback (_type_) none) ;; 13 + (run-pending-updates! (_type_ time-frame) none) ;; 14 ) ) @@ -7453,7 +7458,7 @@ :size-assert #x10 :flag-assert #xa00000010 (:methods - (lookup-text! (_type_ text-id symbol) string 9) + (lookup-text! (_type_ text-id symbol) string) ;; 9 ) ) @@ -7533,9 +7538,9 @@ :size-assert #x12 :flag-assert #xc00000012 (:methods - (get-dist-score (_type_ vector) uint 9) - (debug-draw (_type_ int) none 10) - (get-position "Unpack the position to a vector" (_type_ vector) vector 11) + (get-dist-score (_type_ vector) uint) ;; 9 + (debug-draw (_type_ int) none) ;; 10 + (get-position "Unpack the position to a vector" (_type_ vector) vector) ;; 11 ) ) @@ -7570,7 +7575,7 @@ :size-assert #x8 :flag-assert #xa00000008 (:methods - (debug-draw (_type_ trail-graph int) none 9) + (debug-draw (_type_ trail-graph int) none) ;; 9 ) ) @@ -7655,26 +7660,26 @@ :size-assert #x130 :flag-assert #x1d00000130 (:methods - (trail-graph-method-9 (_type_ int) none 9) - (trail-graph-method-10 (_type_ int) none 10) - (trail-graph-method-11 (_type_ int int) trail-node 11) - (debug-draw (_type_) none 12) - (debug-draw-cell (_type_ int) none 13) - (debug-draw-path (_type_ int (pointer uint16) vector vector rgba float) symbol 14) - (do-path (_type_ vector vector) int 15) - (trail-graph-method-16 () none 16) - (get-node-location-by-id "Get the location of the node with the given ID" (_type_ uint vector) vector 17) - (get-path-to-root "Get the path from goal to root, following parent-id" (_type_ (pointer uint16) int (pointer int32) (pointer float)) int 18) - (trail-graph-method-19 (_type_ int int) symbol 19) - (try-initialize "Init and verify that constants are good." (_type_) symbol 20) - (update-node-flags-for-conn "Set arg1, clear arg2" (_type_ int trail-node-flag trail-node-flag) none 21) - (trail-graph-method-22 (_type_ int) none 22) - (reset-search-state "Reset the search/goal." (_type_) none 23) - (get-next-to-explore (_type_) int 24) - (trail-graph-method-25 (_type_ trail-conn-search int int) none 25) - (do-search! (_type_ vector vector trail-cached-search-info) none 26) - (do-some-work (_type_) int 27) - (run-until-done-or-timeout (_type_ int) none 28) + (trail-graph-method-9 (_type_ int) none) ;; 9 + (trail-graph-method-10 (_type_ int) none) ;; 10 + (trail-graph-method-11 (_type_ int int) trail-node) ;; 11 + (debug-draw (_type_) none) ;; 12 + (debug-draw-cell (_type_ int) none) ;; 13 + (debug-draw-path (_type_ int (pointer uint16) vector vector rgba float) symbol) ;; 14 + (do-path (_type_ vector vector) int) ;; 15 + (trail-graph-method-16 () none) ;; 16 + (get-node-location-by-id "Get the location of the node with the given ID" (_type_ uint vector) vector) ;; 17 + (get-path-to-root "Get the path from goal to root, following parent-id" (_type_ (pointer uint16) int (pointer int32) (pointer float)) int) ;; 18 + (trail-graph-method-19 (_type_ int int) symbol) ;; 19 + (try-initialize "Init and verify that constants are good." (_type_) symbol) ;; 20 + (update-node-flags-for-conn "Set arg1, clear arg2" (_type_ int trail-node-flag trail-node-flag) none) ;; 21 + (trail-graph-method-22 (_type_ int) none) ;; 22 + (reset-search-state "Reset the search/goal." (_type_) none) ;; 23 + (get-next-to-explore (_type_) int) ;; 24 + (trail-graph-method-25 (_type_ trail-conn-search int int) none) ;; 25 + (do-search! (_type_ vector vector trail-cached-search-info) none) ;; 26 + (do-some-work (_type_) int) ;; 27 + (run-until-done-or-timeout (_type_ int) none) ;; 28 ) ) @@ -7821,8 +7826,6 @@ :method-count-assert 15 :size-assert #x20 :flag-assert #xf00000020 - (:methods - ) ) (deftype minimap-trail (structure) @@ -7839,8 +7842,8 @@ :size-assert #xd0 :flag-assert #xb000000d0 (:methods - (get-distance-with-path "Assuming we go from a to b, using this path in the middle, how long is it?" (_type_ vector vector) float 9) - (reset (_type_) none 10) + (get-distance-with-path "Assuming we go from a to b, using this path in the middle, how long is it?" (_type_ vector vector) float) ;; 9 + (reset (_type_) none) ;; 10 ) ) @@ -7891,26 +7894,26 @@ :size-assert #x648 :flag-assert #x1c00000648 (:methods - (debug-draw (_type_) none 9) - (get-trail-for-connection "Get a trail for connection. If arg1 is set, allow allocating a new one." (_type_ connection-minimap symbol) minimap-trail 10) + (debug-draw (_type_) none) ;; 9 + (get-trail-for-connection "Get a trail for connection. If arg1 is set, allow allocating a new one." (_type_ connection-minimap symbol) minimap-trail) ;; 10 (get-icon-draw-pos "Follow the path from the start until it reaches the border of the map, then get this position." - (_type_ connection-minimap minimap-trail vector float vector) symbol 11) - (add-icon! "Add an icon to the map!" (_type_ process uint int vector int) connection-minimap 12) ;; int can be #f / vector can be a symbol or entity-actor - (free-trail-by-connection "Free the trail associated with this connection." (_type_ connection-minimap) none 13) - (update-trails "Main function to do trail search per-frame" (_type_) none 14) - (draw-1 (_type_ dma-buffer vector4w symbol) none 15) ;; hud sprite 1 draw - (draw-connection (_type_ minimap-draw-work connection-minimap) none 16) - (draw-frustum-1 (_type_ minimap-draw-work connection-minimap) none 17) - (draw-frustum-2 (_type_ minimap-draw-work connection-minimap) none 18) - (sub-draw-1-2 (_type_ minimap-draw-work) none 19) - (update! (_type_) symbol 20) - (sub-draw-1-1 (_type_ minimap-draw-work) none 21) - (set-color (_type_ vector) none 22) - (draw-racer-2 (_type_ minimap-draw-work connection-minimap) none 23) ;; not done - (draw-sprite2 (_type_ dma-buffer vector4w symbol) none 24) ;; hud sprite 2 draw - (set-race-texture (_type_ texture float level) none 25) - (draw-racer-1 (_type_ minimap-draw-work connection-minimap float float float) none 26) - (set-race-corner (_type_ float float) none 27) + (_type_ connection-minimap minimap-trail vector float vector) symbol) ;; 11 + (add-icon! "Add an icon to the map!" (_type_ process uint int vector int) connection-minimap) ;; 12 ;; int can be #f / vector can be a symbol or entity-actor + (free-trail-by-connection "Free the trail associated with this connection." (_type_ connection-minimap) none) ;; 13 + (update-trails "Main function to do trail search per-frame" (_type_) none) ;; 14 + (draw-1 (_type_ dma-buffer vector4w symbol) none) ;; 15 ;; hud sprite 1 draw + (draw-connection (_type_ minimap-draw-work connection-minimap) none) ;; 16 + (draw-frustum-1 (_type_ minimap-draw-work connection-minimap) none) ;; 17 + (draw-frustum-2 (_type_ minimap-draw-work connection-minimap) none) ;; 18 + (sub-draw-1-2 (_type_ minimap-draw-work) none) ;; 19 + (update! (_type_) symbol) ;; 20 + (sub-draw-1-1 (_type_ minimap-draw-work) none) ;; 21 + (set-color (_type_ vector) none) ;; 22 + (draw-racer-2 (_type_ minimap-draw-work connection-minimap) none) ;; 23 ;; not done + (draw-sprite2 (_type_ dma-buffer vector4w symbol) none) ;; 24 ;; hud sprite 2 draw + (set-race-texture (_type_ texture float level) none) ;; 25 + (draw-racer-1 (_type_ minimap-draw-work connection-minimap float float float) none) ;; 26 + (set-race-corner (_type_ float float) none) ;; 27 ) ) @@ -8042,26 +8045,26 @@ :size-assert #x1b4 :flag-assert #x1c000001b4 (:methods - (new (symbol type) _type_ 0) - (initialize (_type_) none 9) ;; some sort of init? - (update (_type_) none 10) - (draw (_type_ int int int int) int 11) - (handle-cpad-inputs (_type_) int 12) - (compress-all (_type_) int 13) - (enable-drawing (_type_) none 14) - (disable-drawing (_type_) int 15) - (dump-to-file (_type_) file-stream 16) - (set-pos! (_type_ vector) int 17) - (decompress-current-masks! (_type_) int 18) - (compress-current-masks! (_type_) int 19) - (set-enable-from-position! (_type_) int 20) - (maybe-fill-for-position (_type_ int int) int 21) - (texture-upload-dma (_type_ dma-buffer (pointer uint32) int int int gs-psm) none 22) - (mask-image-from-bit-mask (_type_) none 23) - (draw-non-city-map (_type_ dma-buffer) none 24) - (draw-city-map (_type_ dma-buffer) none 25) - (sprite-dma (_type_ dma-buffer int int int int) none 26) - (draw-from-minimap (_type_ dma-buffer connection-minimap) int 27) + (new (symbol type) _type_) ;; 0 + (initialize (_type_) none) ;; 9 ;; some sort of init? + (update (_type_) none) ;; 10 + (draw (_type_ int int int int) int) ;; 11 + (handle-cpad-inputs (_type_) int) ;; 12 + (compress-all (_type_) int) ;; 13 + (enable-drawing (_type_) none) ;; 14 + (disable-drawing (_type_) int) ;; 15 + (dump-to-file (_type_) file-stream) ;; 16 + (set-pos! (_type_ vector) int) ;; 17 + (decompress-current-masks! (_type_) int) ;; 18 + (compress-current-masks! (_type_) int) ;; 19 + (set-enable-from-position! (_type_) int) ;; 20 + (maybe-fill-for-position (_type_ int int) int) ;; 21 + (texture-upload-dma (_type_ dma-buffer (pointer uint32) int int int gs-psm) none) ;; 22 + (mask-image-from-bit-mask (_type_) none) ;; 23 + (draw-non-city-map (_type_ dma-buffer) none) ;; 24 + (draw-city-map (_type_ dma-buffer) none) ;; 25 + (sprite-dma (_type_ dma-buffer int int int int) none) ;; 26 + (draw-from-minimap (_type_ dma-buffer connection-minimap) int) ;; 27 ) ) @@ -8217,8 +8220,8 @@ :size-assert #x210 :flag-assert #xb00000210 (:methods - (user-setting-data-method-9 (_type_ engine engine-pers engine) user-setting-data 9) - (user-setting-data-method-10 "set-defaults! perhaps?" (_type_ object symbol float uint) user-setting-data 10) + (user-setting-data-method-9 (_type_ engine engine-pers engine) user-setting-data) ;; 9 + (user-setting-data-method-10 "set-defaults! perhaps?" (_type_ object symbol float uint) user-setting-data) ;; 10 ) ) @@ -8334,8 +8337,8 @@ :size-assert #x30c :flag-assert #xb0000030c (:methods - (cam-setting-data-method-9 (_type_ engine engine-pers engine) _type_ 9) - (cam-setting-data-method-10 (_type_ object (pointer process) float int) _type_ 10) + (cam-setting-data-method-9 (_type_ engine engine-pers engine) _type_) ;; 9 + (cam-setting-data-method-10 (_type_ object (pointer process) float int) _type_) ;; 10 ) ) @@ -8360,21 +8363,21 @@ :size-assert #xfb0 :flag-assert #x1300000fb0 (:methods - (new (symbol type int) _type_ 0) - (add-setting "Originally called `setting-set` see (anon-function 48 script)" (_type_ process symbol object object object) none 9) - (persist-with-delay "Originally called `setting-pers` see (anon-function 46 script)" (_type_ symbol time-frame symbol symbol float int) none 10) - (set-setting (_type_ process symbol object object object) none 11) - (remove-setting (_type_ process symbol) none 12) - (kill-persister "Calls [[engine-pers::kill-matching]]" (_type_ engine-pers object) none 13) - (setting-control-method-14 (_type_ object) connectable 14) + (new (symbol type int) _type_) ;; 0 + (add-setting "Originally called `setting-set` see (anon-function 48 script)" (_type_ process symbol object object object) none) ;; 9 + (persist-with-delay "Originally called `setting-pers` see (anon-function 46 script)" (_type_ symbol time-frame symbol symbol float int) none) ;; 10 + (set-setting (_type_ process symbol object object object) none) ;; 11 + (remove-setting (_type_ process symbol) none) ;; 12 + (kill-persister "Calls [[engine-pers::kill-matching]]" (_type_ engine-pers object) none) ;; 13 + (setting-control-method-14 (_type_ object) connectable) ;; 14 (remove-setting-by-arg0 "Calls [[engine::remove-by-param0]] on `engine-hi`" - (_type_ object) none 15) + (_type_ object) none) ;; 15 (set-setting-by-param "Same as [[setting-control::set-setting]] but will [[engine::remove-by-param0]] using the symbol provided" - (_type_ symbol object object object) connection 16) - (apply-settings (_type_) user-setting-data 17) - (update (_type_) user-setting-data 18) + (_type_ symbol object object object) connection) ;; 16 + (apply-settings (_type_) user-setting-data) ;; 17 + (update (_type_) user-setting-data) ;; 18 ) ) @@ -8504,11 +8507,11 @@ (:methods (reset! "Sets `length` to 0 as well as resets all fields except `name` in the associated [[memory-usage-info]]" - (_type_) _type_ 9) + (_type_) _type_) ;; 9 (calculate-total "@returns The total sum of all [[memory-usage-info]] `total`s" - (_type_) int 10) - (print-mem-usage (_type_ level object) _type_ 11) + (_type_) int) ;; 10 + (print-mem-usage (_type_ level object) _type_) ;; 11 ) ) @@ -8563,7 +8566,7 @@ :flag-assert #xa00000014 ;; Failed to read fields. (:methods - (texture-page-dir-method-9 () none 9) ;; (unlink-textures-in-heap! (_type_ kheap) int 9) + (texture-page-dir-method-9 () none) ;; 9 ;; (unlink-textures-in-heap! (_type_ kheap) int) ;; 9 ) ) |# @@ -8646,9 +8649,9 @@ :size-assert #x50 :flag-assert #xc00000050 (:methods - (draw (_type_) none 9) - (setup (_type_ vector vector float bucket-id) none 10) - (disable (_type_) none 11) + (draw (_type_) none) ;; 9 + (setup (_type_ vector vector float bucket-id) none) ;; 10 + (disable (_type_) none) ;; 11 ) ) @@ -8739,7 +8742,7 @@ :size-assert #x44 :flag-assert #xa00000044 (:methods - (col-rend-method-9 (_type_) none 9) + (col-rend-method-9 (_type_) none) ;; 9 ) ) @@ -9050,8 +9053,8 @@ :flag-assert #xa00000020 ;; field param1 uses ~A with a signed load field param2 uses ~A with a signed load (:methods - (new (symbol type drawable) _type_ 0) - (reset-and-assign-geo! (_type_ drawable) _type_ 9) + (new (symbol type drawable) _type_) ;; 0 + (reset-and-assign-geo! (_type_ drawable) _type_) ;; 9 ) ) @@ -9080,20 +9083,20 @@ :size-assert #x20 :flag-assert #x1100000020 (:methods - (login (_type_) _type_ 9) - (draw (_type_ _type_ display-frame) none 10) - (fill-collide-list-from-box (_type_ int collide-list collide-query) int 11) - (fill-collide-list-from-line-sphere (_type_ int collide-list collide-query) int 12) - (collect-stats (_type_) none 13) - (debug-draw (_type_ drawable display-frame) none 14) - (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 15) + (login (_type_) _type_) ;; 9 + (draw (_type_ _type_ display-frame) none) ;; 10 + (fill-collide-list-from-box (_type_ int collide-list collide-query) int) ;; 11 + (fill-collide-list-from-line-sphere (_type_ int collide-list collide-query) int) ;; 12 + (collect-stats (_type_) none) ;; 13 + (debug-draw (_type_ drawable display-frame) none) ;; 14 + (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8)) ;; 15 (collect-regions "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @param! region-list Stores the overlapping regions and a count for how many were found @returns none" - (_type_ sphere int region-prim-list) none 16) + (_type_ sphere int region-prim-list) none) ;; 16 ) ) @@ -9105,8 +9108,6 @@ :method-count-assert 17 :size-assert #x24 :flag-assert #x1100000024 - (:methods - ) ) @@ -9123,7 +9124,7 @@ :size-assert #x20 :flag-assert #x1100000020 (:methods - (new "Create a new [[drawable-group]] which can hold the provided number of [[drawable]]s" (symbol type int) _type_ 0) + (new "Create a new [[drawable-group]] which can hold the provided number of [[drawable]]s" (symbol type int) _type_) ;; 0 ;; TODO - child docstrings ;; collect-stats "For each [[drawable]] that is visible (see [[vis-cull]]) and within the defined `bsphere` (see [[sphere-cull]]), call the respective [[drawable::13]]" ;; debug-draw "For each [[drawable]] that is visible (see [[vis-cull]]) and within the defined `bsphere` (see [[sphere-cull]]), call the respective [[drawable::14]]" @@ -9145,8 +9146,6 @@ :size-assert #x20 :flag-assert #x1100000020 ;; NOTE - all methods (except for `length`) are stubs - (:methods - ) ) @@ -9164,8 +9163,6 @@ :size-assert #x20 :flag-assert #x1100000020 ;; field distance is a float printed as hex? - (:methods - ) ) @@ -9177,8 +9174,6 @@ :size-assert #x44 :flag-assert #x1100000044 ;; Failed to read fields. - (:methods - ) ) @@ -9225,8 +9220,6 @@ :method-count-assert 17 :size-assert #x20 :flag-assert #x1100000020 - (:methods - ) ) @@ -9257,7 +9250,7 @@ :size-assert #x10 :flag-assert #xa00000010 (:methods - (region-method-9 (_type_ vector) symbol 9) + (region-method-9 (_type_ vector) symbol) ;; 9 ) ) @@ -9278,11 +9271,11 @@ :size-assert #x20 :flag-assert #x1400000020 (:methods - (debug-draw-region (_type_ int) none 17) - (track-region "TODO" (_type_ region-prim-area) symbol 18) + (debug-draw-region (_type_ int) none) ;; 17 + (track-region "TODO" (_type_ region-prim-area) symbol) ;; 18 (within-area? "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" - (_type_ region-prim-area) symbol 19) + (_type_ region-prim-area) symbol) ;; 19 ) ) @@ -9293,8 +9286,8 @@ :size-assert #x20 :flag-assert #x1300000020 (:methods - (drawable-tree-region-prim-method-17 (_type_ vector) symbol 17) - (debug-print (_type_ vector object) none 18) + (drawable-tree-region-prim-method-17 (_type_ vector) symbol) ;; 17 + (debug-print (_type_ vector object) none) ;; 18 ) ) @@ -9311,8 +9304,6 @@ :method-count-assert 20 :size-assert #x20 :flag-assert #x1400000020 - (:methods - ) ) (deftype region-face-data (structure) @@ -9332,8 +9323,6 @@ :method-count-assert 20 :size-assert #x20 :flag-assert #x1400000020 - (:methods - ) ) (deftype region-face-array (inline-array-class) @@ -9413,10 +9402,10 @@ :size-assert #x29 :flag-assert #xd00000029 (:methods - (try-creating-new-suppression-box "Try getting new suppression box, return if it succeeded. ID is stored in the params." (_type_) symbol 9) - (create-or-update-suppression-box "If the params are already associated with a box, update. Otherwise, attempt to create a new one." (_type_) symbol 10) - (has-valid-id? (_type_) none 11) - (kill-suppression-box "Kill a suppression box, and inform the traffic manager by setting duration to 0." (_type_) none 12) + (try-creating-new-suppression-box "Try getting new suppression box, return if it succeeded. ID is stored in the params." (_type_) symbol) ;; 9 + (create-or-update-suppression-box "If the params are already associated with a box, update. Otherwise, attempt to create a new one." (_type_) symbol) ;; 10 + (has-valid-id? (_type_) none) ;; 11 + (kill-suppression-box "Kill a suppression box, and inform the traffic manager by setting duration to 0." (_type_) none) ;; 12 ) ) @@ -10255,11 +10244,11 @@ ) :flag-assert #xe0000004c (:methods - (close! (_type_ symbol) int 9) - (open! (_type_ symbol) int 10) - (open? (_type_) symbol 11) - (copy-hooks! (_type_ game-task-node-info) game-task-node-info 12) - (eval-add (_type_) int 13) + (close! (_type_ symbol) int) ;; 9 + (open! (_type_ symbol) int) ;; 10 + (open? (_type_) symbol) ;; 11 + (copy-hooks! (_type_ game-task-node-info) game-task-node-info) ;; 12 + (eval-add (_type_) int) ;; 13 ) ) @@ -10285,8 +10274,8 @@ ) :flag-assert #xa00000010 (:methods - (new (symbol type game-task-actor) _type_ 0) - (get-current-task-event (_type_) game-task-event 9) + (new (symbol type game-task-actor) _type_) ;; 0 + (get-current-task-event (_type_) game-task-event) ;; 9 ) ) @@ -10325,16 +10314,18 @@ (intro-time time-frame :offset-assert 1408) ) :flag-assert #x1705100588 + (:state-methods + wait + active + complete + fail + retry + ) (:methods - (wait () _type_ :state 14) - (active () _type_ :state 15) - (complete () _type_ :state 16) - (fail () _type_ :state 17) - (retry () _type_ :state 18) - (initialize! (_type_) int 19) - (kill-all-children (_type_) int 20) ;; if only. - (check-time (_type_) int 21) - (task-manager-method-22 (_type_) symbol 22) + (initialize! (_type_) int) ;; 19 + (kill-all-children (_type_) int) ;; 20 ;; if only. + (check-time (_type_) int) ;; 21 + (task-manager-method-22 (_type_) symbol) ;; 22 ) ) @@ -10346,9 +10337,9 @@ ) :flag-assert #xc00000010 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) + (dummy-9 () none) ;; 9 + (dummy-10 () none) ;; 10 + (dummy-11 () none) ;; 11 ) ) @@ -10824,34 +10815,34 @@ :size-assert #x2760 :flag-assert #x2500002760 (:methods - (init-sun-data! "Sets the sun related upload data - the sun, halo and aurora" (_type_ int float float float) none 9) - (init-orbit-settings! (_type_ int float float float float float float) none 10) - (update-colors-for-time (_type_ float) none 11) - (update-time-and-speed (_type_ float float) none 12) - (draw (_type_) none 13) - (update-matrix (_type_ matrix) none 14) - (update-template-colors (_type_) none 15) - (init-regs-for-large-polygon-draw (_type_) none 16) - (init-regs-for-sky-asm (_type_) none 17) - (cloud-vtx-light-update (_type_ vector vector cloud-lights vector vector) none 18) - (cloud-vtx-tex-update (_type_ vector vector vector cloud-lights) none 19) - (adjust-cloud-lighting (_type_) none 20) - (cloud-vtx1-to-sky (_type_ sky-vertex cloud-vertex) none 21) - (cloud-vtx2-to-sky (_type_ sky-vertex cloud-vertex) none 22) - (draw-clouds (_type_ dma-buffer) none 23) - (apply-haze-light (_type_ vector vector haze-lights) none 24) - (adjust-haze-lighting (_type_) none 25) - (haze-vtx-to-sky (_type_ sky-vertex sky-vertex haze-vertex) none 26) - (draw-haze (_type_ dma-buffer) none 27) - (sun-dma (_type_ dma-buffer) none 28) - (green-sun-dma (_type_ dma-buffer) none 29) - (moon-dma (_type_ dma-buffer) none 30) - (setup-stars (_type_ matrix sky-upload-data) none 31) - (stars-transform-asm (_type_) none 32) - (stars-dma (_type_ dma-buffer) none 33) - (draw-roof (_type_ dma-buffer) none 34) - (draw-base (_type_ dma-buffer) none 35) - (draw-fog (_type_ dma-buffer) none 36) + (init-sun-data! "Sets the sun related upload data - the sun, halo and aurora" (_type_ int float float float) none) ;; 9 + (init-orbit-settings! (_type_ int float float float float float float) none) ;; 10 + (update-colors-for-time (_type_ float) none) ;; 11 + (update-time-and-speed (_type_ float float) none) ;; 12 + (draw (_type_) none) ;; 13 + (update-matrix (_type_ matrix) none) ;; 14 + (update-template-colors (_type_) none) ;; 15 + (init-regs-for-large-polygon-draw (_type_) none) ;; 16 + (init-regs-for-sky-asm (_type_) none) ;; 17 + (cloud-vtx-light-update (_type_ vector vector cloud-lights vector vector) none) ;; 18 + (cloud-vtx-tex-update (_type_ vector vector vector cloud-lights) none) ;; 19 + (adjust-cloud-lighting (_type_) none) ;; 20 + (cloud-vtx1-to-sky (_type_ sky-vertex cloud-vertex) none) ;; 21 + (cloud-vtx2-to-sky (_type_ sky-vertex cloud-vertex) none) ;; 22 + (draw-clouds (_type_ dma-buffer) none) ;; 23 + (apply-haze-light (_type_ vector vector haze-lights) none) ;; 24 + (adjust-haze-lighting (_type_) none) ;; 25 + (haze-vtx-to-sky (_type_ sky-vertex sky-vertex haze-vertex) none) ;; 26 + (draw-haze (_type_ dma-buffer) none) ;; 27 + (sun-dma (_type_ dma-buffer) none) ;; 28 + (green-sun-dma (_type_ dma-buffer) none) ;; 29 + (moon-dma (_type_ dma-buffer) none) ;; 30 + (setup-stars (_type_ matrix sky-upload-data) none) ;; 31 + (stars-transform-asm (_type_) none) ;; 32 + (stars-dma (_type_ dma-buffer) none) ;; 33 + (draw-roof (_type_ dma-buffer) none) ;; 34 + (draw-base (_type_ dma-buffer) none) ;; 35 + (draw-fog (_type_ dma-buffer) none) ;; 36 ) ) @@ -11227,8 +11218,8 @@ :size-assert #x38 :flag-assert #xb00000038 (:methods - (set-height! (_type_ float) none 9) - (get-base-height (_type_) float 10) + (set-height! (_type_ float) none) ;; 9 + (get-base-height (_type_) float) ;; 10 ) ) @@ -11332,89 +11323,89 @@ :size-assert #x206c :flag-assert #x5c0000206c (:methods - (get-height (_type_ vector symbol) float 11) - (draw! (_type_) none 12) - (update-map (_type_) none 13) - (interp-wave (_type_ ocean-wave-info uint float) none 14) - (ocean-method-15 (_type_ matrix matrix) none 15) - (generate-verts (_type_ ocean-vert-array ocean-height-array) none 16) - (add-colors! (_type_ vector ocean-vertex) none 17) - (ocean-method-18 "Unused" (_type_ (pointer ocean-colors) (pointer ocean-colors)) none 18) ;; args are guesses + (get-height (_type_ vector symbol) float) ;; 11 + (draw! (_type_) none) ;; 12 + (update-map (_type_) none) ;; 13 + (interp-wave (_type_ ocean-wave-info uint float) none) ;; 14 + (ocean-method-15 (_type_ matrix matrix) none) ;; 15 + (generate-verts (_type_ ocean-vert-array ocean-height-array) none) ;; 16 + (add-colors! (_type_ vector ocean-vertex) none) ;; 17 + (ocean-method-18 "Unused" (_type_ (pointer ocean-colors) (pointer ocean-colors)) none) ;; 18 ;; args are guesses (init-buffer! "Initialize [[ocean]] DMA buffer." - (_type_ dma-buffer) none 19) - (end-buffer! (_type_ dma-buffer) none 20) - (set-corners! (_type_ float float) float 21) - (ocean-near-add-call (_type_ dma-buffer int) none 22) ;; start ocean-near - (ocean-near-add-call-flush (_type_ dma-buffer int) none 23) - (ocean-near-setup-constants (_type_ ocean-near-constants) none 24) - (ocean-near-add-constants (_type_ dma-buffer) none 25) - (ocean-near-add-heights (_type_ dma-buffer) none 26) - (ocean-near-add-matrices (_type_ dma-buffer vector) none 27) - (ocean-near-add-upload (_type_ dma-buffer uint uint) none 28) - (draw-ocean-near (_type_ dma-buffer) none 29) ;; end ocean-near - (ocean-trans-camera-masks-bit? (_type_ uint uint) symbol 30) ;; start ocean-transition - (ocean-trans-mask-ptrs-bit? (_type_ int int) symbol 31) - (ocean-trans-mask-ptrs-set! (_type_ uint uint) symbol 32) - (ocean-trans-add-upload-table (_type_ dma-buffer uint uint int int symbol) none 33) - (ocean-trans-add-upload-strip (_type_ dma-buffer uint uint int int int) none 34) - (ocean-transition-check (_type_ ocean-trans-mask int int vector) none 35) - (ocean-make-trans-camera-masks (_type_ uint uint uint uint) none 36) - (ocean-trans-add-upload (_type_ dma-buffer uint uint) none 37) - (draw-ocean-transition-seams (_type_ dma-buffer) none 38) - (ocean-trans-add-constants (_type_ dma-buffer) none 39) - (draw-ocean-transition (_type_ dma-buffer) none 40) ;; end ocean-transition - (ocean-mid-add-call (_type_ dma-buffer int) none 41) ;; start ocean-mid - (ocean-mid-add-call-flush (_type_ dma-buffer uint) none 42) - (ocean-matrix*! (_type_ matrix matrix matrix) matrix 43) - (ocean-vector-matrix*! (_type_ vector vector matrix) vector 44) - (ocean-mid-add-matrices (_type_ dma-buffer vector) none 45) - (ocean-mid-check (_type_ pointer int int vector) symbol 46) - (ocean-mid-setup-constants (_type_ ocean-mid-constants) none 47) - (ocean-mid-add-constants (_type_ dma-buffer) none 48) - (ocean-mid-camera-masks-bit? (_type_ uint uint) symbol 49) - (ocean-mid-mask-ptrs-bit? (_type_ uint uint) symbol 50) - (ocean-mid-camera-masks-set! (_type_ uint uint) symbol 51) - (ocean-mid-add-upload (_type_ dma-buffer int int int int float) none 52) - (ocean-mid-add-upload-table (_type_ dma-buffer uint uint (pointer float) int symbol) none 53) - (ocean-mid-add-upload-top (_type_ dma-buffer uint uint) none 54) - (ocean-mid-add-upload-middle (_type_ dma-buffer uint uint) none 55) - (ocean-mid-add-upload-bottom (_type_ dma-buffer uint uint) none 56) - (ocean-seams-add-constants (_type_ dma-buffer) none 57) - (draw-ocean-mid-seams (_type_ dma-buffer) none 58) - (draw-ocean-mid (_type_ dma-buffer) none 59) ;; end ocean-mid - (ocean-method-60 (_type_ dma-buffer) none 60) ;; start ocean-far - (ocean-method-61 (_type_ dma-buffer) none 61) - (ocean-method-62 (_type_ dma-buffer) none 62) - (ocean-method-63 (_type_ dma-buffer) none 63) - (ocean-method-64 (_type_ dma-buffer) none 64) - (ocean-method-65 (_type_ dma-buffer) none 65) - (ocean-method-66 (_type_ dma-buffer) none 66) - (ocean-method-67 (_type_ dma-buffer) none 67) - (render-ocean-far (_type_ dma-buffer int) none 68) - (draw-ocean-far (_type_ dma-buffer) none 69) ;; end ocean-far - (ocean-texture-setup-constants (_type_ ocean-texture-constants) none 70) ;; start ocean-texture - (ocean-texture-add-constants (_type_ dma-buffer) none 71) - (ocean-texture-add-envmap (_type_ dma-buffer) none 72) - (ocean-texture-add-verts (_type_ dma-buffer int) none 73) - (ocean-texture-add-verts-last (_type_ dma-buffer int int) none 74) - (ocean-texture-add-call-start (_type_ dma-buffer) none 75) - (ocean-texture-add-call-rest (_type_ dma-buffer) none 76) - (ocean-texture-add-call-done (_type_ dma-buffer) none 77) - (draw-ocean-texture (_type_ dma-buffer int) none 78) - (ocean-method-79 (_type_ dma-buffer) none 79) - (ocean-method-80 (_type_ (pointer rgba)) none 80) - (ocean-method-81 (_type_ dma-buffer) int 81) - (draw-envmap-debug (_type_ dma-buffer) none 82) - (ocean-method-83 (_type_ dma-buffer float) none 83) - (ocean-method-84 (_type_ dma-buffer sky-upload-data vector4w float) none 84) - (ocean-method-85 (_type_ dma-buffer) none 85) - (ocean-method-86 (_type_ vector vector vector vector) none 86) - (ocean-method-87 (_type_ vector vector vector) none 87) - (ocean-method-88 (_type_ dma-buffer) none 88) - (ocean-method-89 (_type_ dma-buffer) none 89) ;; end ocean-texture - (rgba-to-vector! "Pack an [[rgba]]'s bytes into a vector." (_type_ vector (pointer rgba)) none 90) - (do-tex-scroll! (_type_) none 91) + (_type_ dma-buffer) none) ;; 19 + (end-buffer! (_type_ dma-buffer) none) ;; 20 + (set-corners! (_type_ float float) float) ;; 21 + (ocean-near-add-call (_type_ dma-buffer int) none) ;; 22 ;; start ocean-near + (ocean-near-add-call-flush (_type_ dma-buffer int) none) ;; 23 + (ocean-near-setup-constants (_type_ ocean-near-constants) none) ;; 24 + (ocean-near-add-constants (_type_ dma-buffer) none) ;; 25 + (ocean-near-add-heights (_type_ dma-buffer) none) ;; 26 + (ocean-near-add-matrices (_type_ dma-buffer vector) none) ;; 27 + (ocean-near-add-upload (_type_ dma-buffer uint uint) none) ;; 28 + (draw-ocean-near (_type_ dma-buffer) none) ;; 29 ;; end ocean-near + (ocean-trans-camera-masks-bit? (_type_ uint uint) symbol) ;; 30 ;; start ocean-transition + (ocean-trans-mask-ptrs-bit? (_type_ int int) symbol) ;; 31 + (ocean-trans-mask-ptrs-set! (_type_ uint uint) symbol) ;; 32 + (ocean-trans-add-upload-table (_type_ dma-buffer uint uint int int symbol) none) ;; 33 + (ocean-trans-add-upload-strip (_type_ dma-buffer uint uint int int int) none) ;; 34 + (ocean-transition-check (_type_ ocean-trans-mask int int vector) none) ;; 35 + (ocean-make-trans-camera-masks (_type_ uint uint uint uint) none) ;; 36 + (ocean-trans-add-upload (_type_ dma-buffer uint uint) none) ;; 37 + (draw-ocean-transition-seams (_type_ dma-buffer) none) ;; 38 + (ocean-trans-add-constants (_type_ dma-buffer) none) ;; 39 + (draw-ocean-transition (_type_ dma-buffer) none) ;; 40 ;; end ocean-transition + (ocean-mid-add-call (_type_ dma-buffer int) none) ;; 41 ;; start ocean-mid + (ocean-mid-add-call-flush (_type_ dma-buffer uint) none) ;; 42 + (ocean-matrix*! (_type_ matrix matrix matrix) matrix) ;; 43 + (ocean-vector-matrix*! (_type_ vector vector matrix) vector) ;; 44 + (ocean-mid-add-matrices (_type_ dma-buffer vector) none) ;; 45 + (ocean-mid-check (_type_ pointer int int vector) symbol) ;; 46 + (ocean-mid-setup-constants (_type_ ocean-mid-constants) none) ;; 47 + (ocean-mid-add-constants (_type_ dma-buffer) none) ;; 48 + (ocean-mid-camera-masks-bit? (_type_ uint uint) symbol) ;; 49 + (ocean-mid-mask-ptrs-bit? (_type_ uint uint) symbol) ;; 50 + (ocean-mid-camera-masks-set! (_type_ uint uint) symbol) ;; 51 + (ocean-mid-add-upload (_type_ dma-buffer int int int int float) none) ;; 52 + (ocean-mid-add-upload-table (_type_ dma-buffer uint uint (pointer float) int symbol) none) ;; 53 + (ocean-mid-add-upload-top (_type_ dma-buffer uint uint) none) ;; 54 + (ocean-mid-add-upload-middle (_type_ dma-buffer uint uint) none) ;; 55 + (ocean-mid-add-upload-bottom (_type_ dma-buffer uint uint) none) ;; 56 + (ocean-seams-add-constants (_type_ dma-buffer) none) ;; 57 + (draw-ocean-mid-seams (_type_ dma-buffer) none) ;; 58 + (draw-ocean-mid (_type_ dma-buffer) none) ;; 59 ;; end ocean-mid + (ocean-method-60 (_type_ dma-buffer) none) ;; 60 ;; start ocean-far + (ocean-method-61 (_type_ dma-buffer) none) ;; 61 + (ocean-method-62 (_type_ dma-buffer) none) ;; 62 + (ocean-method-63 (_type_ dma-buffer) none) ;; 63 + (ocean-method-64 (_type_ dma-buffer) none) ;; 64 + (ocean-method-65 (_type_ dma-buffer) none) ;; 65 + (ocean-method-66 (_type_ dma-buffer) none) ;; 66 + (ocean-method-67 (_type_ dma-buffer) none) ;; 67 + (render-ocean-far (_type_ dma-buffer int) none) ;; 68 + (draw-ocean-far (_type_ dma-buffer) none) ;; 69 ;; end ocean-far + (ocean-texture-setup-constants (_type_ ocean-texture-constants) none) ;; 70 ;; start ocean-texture + (ocean-texture-add-constants (_type_ dma-buffer) none) ;; 71 + (ocean-texture-add-envmap (_type_ dma-buffer) none) ;; 72 + (ocean-texture-add-verts (_type_ dma-buffer int) none) ;; 73 + (ocean-texture-add-verts-last (_type_ dma-buffer int int) none) ;; 74 + (ocean-texture-add-call-start (_type_ dma-buffer) none) ;; 75 + (ocean-texture-add-call-rest (_type_ dma-buffer) none) ;; 76 + (ocean-texture-add-call-done (_type_ dma-buffer) none) ;; 77 + (draw-ocean-texture (_type_ dma-buffer int) none) ;; 78 + (ocean-method-79 (_type_ dma-buffer) none) ;; 79 + (ocean-method-80 (_type_ (pointer rgba)) none) ;; 80 + (ocean-method-81 (_type_ dma-buffer) int) ;; 81 + (draw-envmap-debug (_type_ dma-buffer) none) ;; 82 + (ocean-method-83 (_type_ dma-buffer float) none) ;; 83 + (ocean-method-84 (_type_ dma-buffer sky-upload-data vector4w float) none) ;; 84 + (ocean-method-85 (_type_ dma-buffer) none) ;; 85 + (ocean-method-86 (_type_ vector vector vector vector) none) ;; 86 + (ocean-method-87 (_type_ vector vector vector) none) ;; 87 + (ocean-method-88 (_type_ dma-buffer) none) ;; 88 + (ocean-method-89 (_type_ dma-buffer) none) ;; 89 ;; end ocean-texture + (rgba-to-vector! "Pack an [[rgba]]'s bytes into a vector." (_type_ vector (pointer rgba)) none) ;; 90 + (do-tex-scroll! (_type_) none) ;; 91 ) ) @@ -11484,8 +11475,8 @@ :size-assert #x110 :flag-assert #xb00000110 (:methods - (reset! (_type_) none 9) - (set-fade! (_type_ int float float vector) object 10) + (reset! (_type_) none) ;; 9 + (set-fade! (_type_ int float float vector) object) ;; 10 ) ) @@ -11630,7 +11621,7 @@ (data transformq :dynamic :inline :offset-assert 128) ;; guessed by decompiler ) (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x80 @@ -11694,10 +11685,10 @@ :size-assert #x14 :flag-assert #xd00000014 (:methods - (login (_type_) _type_ 9) - (get-art-by-name-method (_type_ string type) basic 10) - (get-art-idx-by-name-method (_type_ string type) int 11) - (needs-link? (_type_) symbol 12) + (login (_type_) _type_) ;; 9 + (get-art-by-name-method (_type_ string type) basic) ;; 10 + (get-art-idx-by-name-method (_type_ string type) int) ;; 11 + (needs-link? (_type_) symbol) ;; 12 ) ) @@ -11730,8 +11721,6 @@ :size-assert #x30 :flag-assert #xd00000030 ;; field blend-shape-anim uses ~A with a signed load - (:methods - ) ) (deftype art-group (art) @@ -11743,9 +11732,9 @@ :flag-assert #xf00000020 ;; Failed to read fields. (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (link-art! (_type_) art-group 13) - (unlink-art! (_type_) int 14) + (relocate (_type_ kheap (pointer uint8)) none :replace) ;; 7 + (link-art! (_type_) art-group) ;; 13 + (unlink-art! (_type_) int) ;; 14 ) ) @@ -11782,12 +11771,12 @@ :flag-assert #xe00000430 ;; Failed to read fields. (:methods - (new (symbol type int) _type_ 0) - (decompress (_type_ art-joint-anim) art-joint-anim 9) - (update-time-stamp (_type_ art-joint-anim) art-joint-anim 10) - (unload-from-slot (_type_ int) art-joint-anim 11) - (used-bytes-for-slot (_type_ int) int 12) - (unload-from-level (_type_ level) none 13) + (new (symbol type int) _type_) ;; 0 + (decompress (_type_ art-joint-anim) art-joint-anim) ;; 9 + (update-time-stamp (_type_ art-joint-anim) art-joint-anim) ;; 10 + (unload-from-slot (_type_ int) art-joint-anim) ;; 11 + (used-bytes-for-slot (_type_ int) int) ;; 12 + (unload-from-level (_type_ level) none) ;; 13 ) ) @@ -11814,7 +11803,7 @@ :size-assert #x74 :flag-assert #x1000000074 (:methods - (add-to-loading-level (_type_) skeleton-group 15) + (add-to-loading-level (_type_) skeleton-group) ;; 15 ) ) @@ -11837,7 +11826,7 @@ :size-assert #x31 :flag-assert #xa00000031 (:methods - (setup-lods! (_type_ skeleton-group art-group entity) _type_ 9) + (setup-lods! (_type_ skeleton-group art-group entity) _type_) ;; 9 ) ) @@ -11929,13 +11918,13 @@ :flag-assert #xf000000d8 ;; Failed to read fields. (:methods - (new (symbol type process symbol) _type_ 0) - (get-skeleton-origin (_type_) vector 9) - (lod-set! (_type_ int) none 10) - (lods-assign! (_type_ lod-set) none 11) - (setup-masks "TODO - use the enum types" (_type_ int int) none 12) - (setup-cspace-and-add (_type_ art-joint-geo symbol) cspace-array 13) - (do-joint-math (_type_ cspace-array joint-control) none 14) + (new (symbol type process symbol) _type_) ;; 0 + (get-skeleton-origin (_type_) vector) ;; 9 + (lod-set! (_type_ int) none) ;; 10 + (lods-assign! (_type_ lod-set) none) ;; 11 + (setup-masks "TODO - use the enum types" (_type_ int int) none) ;; 12 + (setup-cspace-and-add (_type_ art-joint-geo symbol) cspace-array) ;; 13 + (do-joint-math (_type_ cspace-array joint-control) none) ;; 14 ) ) @@ -12070,7 +12059,7 @@ :size-assert #x18 :flag-assert #xa00000018 (:methods - (login-adgifs (_type_) merc-fragment 9) + (login-adgifs (_type_) merc-fragment) ;; 9 ) ) @@ -12224,7 +12213,7 @@ :size-assert #x20 :flag-assert #xa00000020 (:methods - (login-adgifs (_type_) none 9) + (login-adgifs (_type_) none) ;; 9 ) ) @@ -12341,8 +12330,6 @@ :method-count-assert 13 :size-assert #xa0 :flag-assert #xd000000a0 - (:methods - ) ) (deftype merc-vu1-low-mem (structure) @@ -12410,7 +12397,7 @@ (query ripple-merc-query :offset-assert 36) ;; guessed by decompiler ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x28 @@ -12917,13 +12904,13 @@ :size-assert #x60 :flag-assert #xf00000060 (:methods - (new (symbol type float float float shadow-flags float) _type_ 0) - (clear-offset-bit (shadow-control) int 9) - (set-offset-bit (shadow-control) int 10) - (set-top-plane-offset (shadow-control float) int 11) - (set-bottom-plane-offset (shadow-control float) int 12) - (shadow-control-method-13 (_type_ vector float float float) none 13) ;; (unused-13 (_type_) none 13) - (shadow-control-method-14 (_type_ vector vector float float float) none 14) ;; (update-direction-from-time-of-day (_type_) none 14) + (new (symbol type float float float shadow-flags float) _type_) ;; 0 + (clear-offset-bit (shadow-control) int) ;; 9 + (set-offset-bit (shadow-control) int) ;; 10 + (set-top-plane-offset (shadow-control float) int) ;; 11 + (set-bottom-plane-offset (shadow-control float) int) ;; 12 + (shadow-control-method-13 (_type_ vector float float float) none) ;; 13 ;; (unused-13 (_type_) none) ;; 13 + (shadow-control-method-14 (_type_ vector vector float float float) none) ;; 14 ;; (update-direction-from-time-of-day (_type_) none) ;; 14 ) ) @@ -13069,8 +13056,6 @@ :method-count-assert 13 :size-assert #x50 :flag-assert #xd00000050 - (:methods - ) ) (deftype shadow-geo (art-element) @@ -13083,8 +13068,6 @@ :method-count-assert 13 :size-assert #x2c :flag-assert #xd0000002c - (:methods - ) ) (define-extern *shadow-globals* shadow-globals) @@ -13264,7 +13247,7 @@ :size-assert #x10 :flag-assert #xa00000010 (:methods - (get-rank (_type_ float) int 9) + (get-rank (_type_ float) int) ;; 9 ) ) @@ -13294,20 +13277,20 @@ :flag-assert #x1600000878 ;; Failed to read fields. (:methods - (new (symbol type) _type_ 0) - (reset! (_type_) _type_ 9) - (update! (_type_) int 10) - (want-levels (_type_ (pointer symbol)) int 11) - (want-sound-banks (_type_ (pointer symbol)) none 12) - (want-display-level (_type_ symbol symbol) int 13) - (want-vis-level (_type_ symbol) none 14) - (want-force-vis (_type_ symbol symbol) int 15) - (want-force-inside (_type_ symbol symbol) none 16) - (execute-commands-up-to (_type_ float) none 17) - (backup-load-state-and-set-cmds (_type_ pair) int 18) - (restore-load-state-and-cleanup (_type_) int 19) - (restore-load-state (_type_) int 20) - (add-borrow-levels (_type_) none 21) + (new (symbol type) _type_) ;; 0 + (reset! (_type_) _type_) ;; 9 + (update! (_type_) int) ;; 10 + (want-levels (_type_ (pointer symbol)) int) ;; 11 + (want-sound-banks (_type_ (pointer symbol)) none) ;; 12 + (want-display-level (_type_ symbol symbol) int) ;; 13 + (want-vis-level (_type_ symbol) none) ;; 14 + (want-force-vis (_type_ symbol symbol) int) ;; 15 + (want-force-inside (_type_ symbol symbol) none) ;; 16 + (execute-commands-up-to (_type_ float) none) ;; 17 + (backup-load-state-and-set-cmds (_type_ pair) int) ;; 18 + (restore-load-state-and-cleanup (_type_) int) ;; 19 + (restore-load-state (_type_) int) ;; 20 + (add-borrow-levels (_type_) none) ;; 21 ) ) @@ -13358,9 +13341,9 @@ :flag-assert #xc000000d8 ;; Failed to read fields. (:methods - (debug-draw (_type_) int 9) - (continue-point-method-10 (_type_ load-state) continue-point 10) - (move-camera! (_type_) none 11) + (debug-draw (_type_) int) ;; 9 + (continue-point-method-10 (_type_ load-state) continue-point) ;; 10 + (move-camera! (_type_) none) ;; 11 ) ) @@ -13518,28 +13501,28 @@ :size-assert #x25c :flag-assert #x1f0000025c (:methods - (initialize! (_type_ symbol game-save string) _type_ 9) - (give (_type_ symbol float handle) float 10) - (task-complete? (_type_ game-task) symbol 11) - (subtask-index-by-name (_type_ string) int 12) - (set-subtask-hook! (_type_ game-task-node int function) function 13) - (actor-perm (_type_ actor-id) entity-perm 14) - (task-perm-by-index (_type_ int) entity-perm 15) - (copy-perms-from-level! (_type_ level) int 16) - (copy-perms-to-level! (_type_ level) int 17) - (debug-inspect (_type_ symbol) _type_ 18) - (get-current-continue-forced (_type_) continue-point 19) - (get-continue-by-name (_type_ string) continue-point 20) - (set-continue! (_type_ basic symbol) continue-point 21) - (game-info-method-22 (_type_) int 22) - (save-game (_type_ game-save string) game-save 23) - (load-game (_type_ game-save) game-save 24) - (you-suck-stage (_type_ symbol) int 25) - (you-suck-scale (_type_ object) float 26) - (get-next-attack-id (_type_) uint 27) - (game-info-method-28 (_type_ game-score float) int 28) - (get-game-score-ref (_type_ int) (pointer float) 29) - (calculate-percentage (_type_) float 30) + (initialize! (_type_ symbol game-save string) _type_) ;; 9 + (give (_type_ symbol float handle) float) ;; 10 + (task-complete? (_type_ game-task) symbol) ;; 11 + (subtask-index-by-name (_type_ string) int) ;; 12 + (set-subtask-hook! (_type_ game-task-node int function) function) ;; 13 + (actor-perm (_type_ actor-id) entity-perm) ;; 14 + (task-perm-by-index (_type_ int) entity-perm) ;; 15 + (copy-perms-from-level! (_type_ level) int) ;; 16 + (copy-perms-to-level! (_type_ level) int) ;; 17 + (debug-inspect (_type_ symbol) _type_) ;; 18 + (get-current-continue-forced (_type_) continue-point) ;; 19 + (get-continue-by-name (_type_ string) continue-point) ;; 20 + (set-continue! (_type_ basic symbol) continue-point) ;; 21 + (game-info-method-22 (_type_) int) ;; 22 + (save-game (_type_ game-save string) game-save) ;; 23 + (load-game (_type_ game-save) game-save) ;; 24 + (you-suck-stage (_type_ symbol) int) ;; 25 + (you-suck-scale (_type_ object) float) ;; 26 + (get-next-attack-id (_type_) uint) ;; 27 + (game-info-method-28 (_type_ game-score float) int) ;; 28 + (get-game-score-ref (_type_ int) (pointer float)) ;; 29 + (calculate-percentage (_type_) float) ;; 30 ) ) @@ -13660,8 +13643,6 @@ :size-assert #x30 :flag-assert #xe00000030 ;; Failed to read fields. - (:methods - ) ) @@ -13680,23 +13661,23 @@ :flag-assert #x1900000cd0 ;; Failed to read fields. (:methods - (new (symbol type int) _type_ 0) - (add-process (_type_ process gui-channel gui-action string float time-frame) sound-id 9) - (remove-process (_type_ process gui-channel) none 10) - (stop-str (_type_ gui-connection) int 11) - (gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id 12) - (update (_type_ symbol) int 13) - (lookup-gui-connection-id (_type_ string gui-channel gui-action) sound-id 14) - (lookup-gui-connection (_type_ process gui-channel string sound-id) gui-connection 15) - (set-action! (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int 16) - (get-status (_type_ sound-id) gui-status 17) - (gui-control-method-18 (_type_ gui-channel) symbol 18) - (handle-command-list (_type_ gui-channel gui-connection) symbol 19) - (set-falloff! (_type_ sound-id symbol int int int) gui-connection 20) - (gui-control-method-21 (_type_ gui-connection vector) int 21) - (gui-control-method-22 (_type_ gui-connection process symbol) none 22) - (handle-command (_type_ gui-channel gui-channel symbol gui-connection) symbol 23) - (channel-id-set! (_type_ gui-connection sound-id) int 24) + (new (symbol type int) _type_) ;; 0 + (add-process (_type_ process gui-channel gui-action string float time-frame) sound-id) ;; 9 + (remove-process (_type_ process gui-channel) none) ;; 10 + (stop-str (_type_ gui-connection) int) ;; 11 + (gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id) ;; 12 + (update (_type_ symbol) int) ;; 13 + (lookup-gui-connection-id (_type_ string gui-channel gui-action) sound-id) ;; 14 + (lookup-gui-connection (_type_ process gui-channel string sound-id) gui-connection) ;; 15 + (set-action! (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int) ;; 16 + (get-status (_type_ sound-id) gui-status) ;; 17 + (gui-control-method-18 (_type_ gui-channel) symbol) ;; 18 + (handle-command-list (_type_ gui-channel gui-connection) symbol) ;; 19 + (set-falloff! (_type_ sound-id symbol int int int) gui-connection) ;; 20 + (gui-control-method-21 (_type_ gui-connection vector) int) ;; 21 + (gui-control-method-22 (_type_ gui-connection process symbol) none) ;; 22 + (handle-command (_type_ gui-channel gui-channel symbol gui-connection) symbol) ;; 23 + (channel-id-set! (_type_ gui-connection sound-id) int) ;; 24 ) ) @@ -13721,14 +13702,14 @@ :size-assert #x18 :flag-assert #xe00000018 (:methods - (talker-speech-class-method-9 (_type_) symbol 9) + (talker-speech-class-method-9 (_type_) symbol) ;; 9 (play-communicator-speech! "Plays the provided [[talker-speech-class]] @TODO - understand the array from [[game-info]] better" - (_type_) none 10) - (talker-speech-class-method-11 (_type_) none 11) - (talker-speech-class-method-12 (_type_ int) none 12) - (talker-speech-class-method-13 (_type_ int) none 13) + (_type_) none) ;; 10 + (talker-speech-class-method-11 (_type_) none) ;; 11 + (talker-speech-class-method-12 (_type_ int) none) ;; 12 + (talker-speech-class-method-13 (_type_ int) none) ;; 13 ) ) @@ -13749,11 +13730,13 @@ :method-count-assert 18 :size-assert #xd4 :flag-assert #x12006000d4 + (:state-methods + idle + active + exit + ) (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (exit () _type_ :state 16) - (talker-method-17 (_type_) none 17) + (talker-method-17 (_type_) none) ;; 17 ) ) @@ -13887,11 +13870,11 @@ :size-assert #x64 :flag-assert #xe00000064 (:methods - (speech-channel-method-9 (_type_ process-drawable speech-type) none 9) - (speech-channel-method-10 (_type_ handle) none 10) - (speech-channel-method-11 (_type_) none 11) - (speech-channel-method-12 (_type_) none 12) - (speech-channel-method-13 (_type_) none 13) + (speech-channel-method-9 (_type_ process-drawable speech-type) none) ;; 9 + (speech-channel-method-10 (_type_ handle) none) ;; 10 + (speech-channel-method-11 (_type_) none) ;; 11 + (speech-channel-method-12 (_type_) none) ;; 12 + (speech-channel-method-13 (_type_) none) ;; 13 ) ) @@ -13904,14 +13887,14 @@ :size-assert #x1c4 :flag-assert #x11000001c4 (:methods - (speech-control-method-9 (_type_) none 9) - (speech-table-set! (_type_ speech-type speech-type-info) none 10) - (speech-control-method-11 (_type_) none 11) - (speech-control-method-12 (_type_ process-drawable speech-type) none 12) - (speech-control-method-13 (_type_ handle) none 13) - (speech-control-method-14 (_type_) none 14) - (speech-control-method-15 (_type_ process-drawable) none 15) - (speech-control-method-16 (_type_) none 16) + (speech-control-method-9 (_type_) none) ;; 9 + (speech-table-set! (_type_ speech-type speech-type-info) none) ;; 10 + (speech-control-method-11 (_type_) none) ;; 11 + (speech-control-method-12 (_type_ process-drawable speech-type) none) ;; 12 + (speech-control-method-13 (_type_ handle) none) ;; 13 + (speech-control-method-14 (_type_) none) ;; 14 + (speech-control-method-15 (_type_ process-drawable) none) ;; 15 + (speech-control-method-16 (_type_) none) ;; 16 ) ) @@ -14031,8 +14014,6 @@ :method-count-assert 17 :size-assert #x94 :flag-assert #x1100000094 - (:methods - ) ) (deftype prototype-array-shrub-info (basic) @@ -14143,7 +14124,7 @@ :size-assert #x10 :flag-assert #xa00000010 (:methods - (login (_type_) none 9) + (login (_type_) none) ;; 9 ) ) @@ -14172,8 +14153,6 @@ :method-count-assert 17 :size-assert #x40 :flag-assert #x1100000040 - (:methods - ) ) @@ -14245,11 +14224,11 @@ :size-assert #x68 :flag-assert #xd00000068 (:methods - (new (symbol type process-drawable) _type_ 0) - (reset (_type_) none 9) - (update (_type_) none 10) - (get-channel (_type_ int) joint-control-channel 11) - (push-anim-to-targ (_type_ art-joint-anim float int int float float symbol) none 12) + (new (symbol type process-drawable) _type_) ;; 0 + (reset (_type_) none) ;; 9 + (update (_type_) none) ;; 10 + (get-channel (_type_ int) joint-control-channel) ;; 11 + (push-anim-to-targ (_type_ art-joint-anim float int int float float symbol) none) ;; 12 ) ) @@ -14293,10 +14272,10 @@ :flag-assert #xc00000040 ;; Failed to read fields. (:methods - (new (symbol type int) _type_ 0) - (current-cycle-distance (_type_) float 9) - (update-anim-data (_type_) none 10) - (debug-print-channels (_type_ symbol) int 11) + (new (symbol type int) _type_) ;; 0 + (current-cycle-distance (_type_) float) ;; 9 + (update-anim-data (_type_) none) ;; 10 + (debug-print-channels (_type_ symbol) int) ;; 11 ) ) @@ -14705,11 +14684,11 @@ :flag-assert #xe000000a4 (:methods (new (symbol type lightning-spec process float) _type_) - (change-mode (_type_ lightning-mode) lightning-mode 9) - (get-mode (_type_) lightning-mode 10) - (set-point! (_type_ int vector) none 11) - (set-first-meet-point (_type_ vector) none 12) - (set-last-meet-point (_type_ vector) none 13) + (change-mode (_type_ lightning-mode) lightning-mode) ;; 9 + (get-mode (_type_) lightning-mode) ;; 10 + (set-point! (_type_ int vector) none) ;; 11 + (set-first-meet-point (_type_ vector) none) ;; 12 + (set-last-meet-point (_type_ vector) none) ;; 13 ) ) @@ -14778,20 +14757,20 @@ :flag-assert #x1600000020 ;; field extra uses ~A with a signed load (:methods - (new (symbol type int int) _type_ 0) - (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual 9) - (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual 10) - (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual 11) - (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual 12) - (get-tag-index-data (_type_ int) pointer 13) - (get-tag-data (_type_ res-tag) pointer 14) - (allocate-data-memory-for-tag! (_type_ res-tag) res-tag 15) - (sort! (_type_) _type_ 16) - (add-data! (_type_ res-tag pointer) res-lump 17) - (add-32bit-data! (_type_ res-tag object) res-lump 18) - (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual 19) - (make-property-data (_type_ float res-tag-pair pointer) pointer 20) - (get-curve-data! (_type_ curve symbol symbol float) symbol 21) + (new (symbol type int int) _type_) ;; 0 + (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual) ;; 9 + (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual) ;; 10 + (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual) ;; 11 + (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual) ;; 12 + (get-tag-index-data (_type_ int) pointer) ;; 13 + (get-tag-data (_type_ res-tag) pointer) ;; 14 + (allocate-data-memory-for-tag! (_type_ res-tag) res-tag) ;; 15 + (sort! (_type_) _type_) ;; 16 + (add-data! (_type_ res-tag pointer) res-lump) ;; 17 + (add-32bit-data! (_type_ res-tag object) res-lump) ;; 18 + (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual) ;; 19 + (make-property-data (_type_ float res-tag-pair pointer) pointer) ;; 20 + (get-curve-data! (_type_ curve symbol symbol float) symbol) ;; 21 ) ) @@ -14836,7 +14815,7 @@ :size-assert #x38 :flag-assert #xa00000038 (:methods - (set-gravity-length (_type_ float) none 9) + (set-gravity-length (_type_ float) none) ;; 9 ) ) @@ -15189,10 +15168,10 @@ :flag-assert #xc00000028 ;; Failed to read fields. (:methods - (new (symbol type process pickup-type float) _type_ 0) - (drop-pickup (_type_ symbol process-tree fact-info int) (pointer process) 9) - (reset! (_type_ symbol) none 10) - (pickup-collectable! (_type_ pickup-type float handle) float 11) + (new (symbol type process pickup-type float) _type_) ;; 0 + (drop-pickup (_type_ symbol process-tree fact-info int) (pointer process)) ;; 9 + (reset! (_type_ symbol) none) ;; 10 + (pickup-collectable! (_type_ pickup-type float handle) float) ;; 11 ) ) @@ -15239,8 +15218,8 @@ :flag-assert #xd00000110 ;; Failed to read fields. (:methods - (new (symbol type process-drawable pickup-type float) _type_ 0) - (get-gun-ammo (_type_) float 12) + (new (symbol type process-drawable pickup-type float) _type_) ;; 0 + (get-gun-ammo (_type_) float) ;; 12 ) ) @@ -15295,8 +15274,8 @@ :size-assert #x53 :flag-assert #xd00000053 (:methods - (new (symbol type process (pointer float) pickup-type float) _type_ 0) - (clear-mask-bits (_type_ int) none 12) + (new (symbol type process (pointer float) pickup-type float) _type_) ;; 0 + (clear-mask-bits (_type_ int) none) ;; 12 ) ) @@ -15307,7 +15286,7 @@ :flag-assert #xc0000002c ;; Failed to read fields. (:methods - (new (symbol type process pickup-type float) _type_ 0) + (new (symbol type process pickup-type float) _type_) ;; 0 ) ) @@ -15373,22 +15352,22 @@ :size-assert #x134 :flag-assert #xe00000134 (:methods - (new (symbol type process) _type_ 0) - (compute-alignment! (_type_) transformq 9) + (new (symbol type process) _type_) ;; 0 + (compute-alignment! (_type_) transformq) ;; 9 (align! "As long as [[align-flags::0]] is not set call [[process-drawable::16]] on the process being controlled using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> @returns the `root` of the [[process-drawable]] after the method returns @see [[process-drawable::16]]" - (_type_ align-opts float float float) trsqv 10) - (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv :behavior process 11) + (_type_ align-opts float float float) trsqv) ;; 10 + (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv :behavior process) ;; 11 (first-transform "@returns The first of the two [[transforms]] held by the object" - (_type_) transform 12) + (_type_) transform) ;; 12 (second-transform "@returns The second of the two [[transforms]] held by the object" - (_type_) transform 13) + (_type_) transform) ;; 13 ) ) @@ -15543,12 +15522,12 @@ :size-assert #xc8 :flag-assert #x14005000c8 (:methods - (initialize-skeleton (_type_ skeleton-group pair) draw-control 14) - (initialize-skeleton-by-name (_type_ string) draw-control 15) - (apply-alignment (_type_ align-opts transformq vector) trsqv 16) - (cleanup-for-death (_type_) none 17) - (relocate-nav (_type_ int) none 18) - (evaluate-joint-control (_type_) none 19) + (initialize-skeleton (_type_ skeleton-group pair) draw-control) ;; 14 + (initialize-skeleton-by-name (_type_ string) draw-control) ;; 15 + (apply-alignment (_type_ align-opts transformq vector) trsqv) ;; 16 + (cleanup-for-death (_type_) none) ;; 17 + (relocate-nav (_type_ int) none) ;; 18 + (evaluate-joint-control (_type_) none) ;; 19 ) (:states (process-drawable-art-error string) @@ -15561,164 +15540,164 @@ :size-assert #xc8 :flag-assert #xb2005000c8 (:methods - (process-drawable-reserved-method-20 () none 20) ;; (dummy-20 () none 20) - (process-drawable-reserved-method-21 () none 21) ;; (dummy-21 () none 21) - (process-drawable-reserved-method-22 () none 22) ;; (dummy-22 () none 22) - (process-drawable-reserved-method-23 () none 23) ;; (dummy-23 () none 23) - (process-drawable-reserved-method-24 () none 24) ;; (dummy-24 () none 24) - (process-drawable-reserved-method-25 () none 25) ;; (dummy-25 () none 25) - (process-drawable-reserved-method-26 () none 26) ;; (dummy-26 () none 26) - (process-drawable-reserved-method-27 () none 27) ;; (dummy-27 () none 27) - (process-drawable-reserved-method-28 () none 28) ;; (dummy-28 () none 28) - (process-drawable-reserved-method-29 () none 29) ;; (dummy-29 () none 29) - (process-drawable-reserved-method-30 () none 30) ;; (dummy-30 () none 30) - (process-drawable-reserved-method-31 () none 31) ;; (dummy-31 () none 31) - (process-drawable-reserved-method-32 () none 32) ;; (dummy-32 () none 32) - (process-drawable-reserved-method-33 () none 33) ;; (dummy-33 () none 33) - (process-drawable-reserved-method-34 () none 34) ;; (dummy-34 () none 34) - (process-drawable-reserved-method-35 () none 35) ;; (dummy-35 () none 35) - (process-drawable-reserved-method-36 () none 36) ;; (dummy-36 () none 36) - (process-drawable-reserved-method-37 () none 37) ;; (dummy-37 () none 37) - (process-drawable-reserved-method-38 () none 38) ;; (dummy-38 () none 38) - (process-drawable-reserved-method-39 () none 39) ;; (dummy-39 () none 39) - (process-drawable-reserved-method-40 () none 40) ;; (dummy-40 () none 40) - (process-drawable-reserved-method-41 () none 41) ;; (dummy-41 () none 41) - (process-drawable-reserved-method-42 () none 42) ;; (dummy-42 () none 42) - (process-drawable-reserved-method-43 () none 43) ;; (dummy-43 () none 43) - (process-drawable-reserved-method-44 () none 44) ;; (dummy-44 () none 44) - (process-drawable-reserved-method-45 () none 45) ;; (dummy-45 () none 45) - (process-drawable-reserved-method-46 () none 46) ;; (dummy-46 () none 46) - (process-drawable-reserved-method-47 () none 47) ;; (dummy-47 () none 47) - (process-drawable-reserved-method-48 () none 48) ;; (dummy-48 () none 48) - (process-drawable-reserved-method-49 () none 49) ;; (dummy-49 () none 49) - (process-drawable-reserved-method-50 () none 50) ;; (dummy-50 () none 50) - (process-drawable-reserved-method-51 () none 51) ;; (dummy-51 () none 51) - (process-drawable-reserved-method-52 () none 52) ;; (dummy-52 () none 52) - (process-drawable-reserved-method-53 () none 53) ;; (dummy-53 () none 53) - (process-drawable-reserved-method-54 () none 54) ;; (dummy-54 () none 54) - (process-drawable-reserved-method-55 () none 55) ;; (dummy-55 () none 55) - (process-drawable-reserved-method-56 () none 56) ;; (dummy-56 () none 56) - (process-drawable-reserved-method-57 () none 57) ;; (dummy-57 () none 57) - (process-drawable-reserved-method-58 () none 58) ;; (dummy-58 () none 58) - (process-drawable-reserved-method-59 () none 59) ;; (dummy-59 () none 59) - (process-drawable-reserved-method-60 () none 60) ;; (dummy-60 () none 60) - (process-drawable-reserved-method-61 () none 61) ;; (dummy-61 () none 61) - (process-drawable-reserved-method-62 () none 62) ;; (dummy-62 () none 62) - (process-drawable-reserved-method-63 () none 63) - (process-drawable-reserved-method-64 () none 64) - (process-drawable-reserved-method-65 () none 65) - (process-drawable-reserved-method-66 () none 66) - (process-drawable-reserved-method-67 () none 67) - (process-drawable-reserved-method-68 () none 68) - (process-drawable-reserved-method-69 () none 69) - (process-drawable-reserved-method-70 () none 70) - (process-drawable-reserved-method-71 () none 71) - (process-drawable-reserved-method-72 () none 72) - (process-drawable-reserved-method-73 () none 73) - (process-drawable-reserved-method-74 () none 74) - (process-drawable-reserved-method-75 () none 75) - (process-drawable-reserved-method-76 () none 76) - (process-drawable-reserved-method-77 () none 77) - (process-drawable-reserved-method-78 () none 78) - (process-drawable-reserved-method-79 () none 79) - (process-drawable-reserved-method-80 () none 80) - (process-drawable-reserved-method-81 () none 81) - (process-drawable-reserved-method-82 () none 82) - (process-drawable-reserved-method-83 () none 83) - (process-drawable-reserved-method-84 () none 84) - (process-drawable-reserved-method-85 () none 85) - (process-drawable-reserved-method-86 () none 86) - (process-drawable-reserved-method-87 () none 87) - (process-drawable-reserved-method-88 () none 88) - (process-drawable-reserved-method-89 () none 89) - (process-drawable-reserved-method-90 () none 90) - (process-drawable-reserved-method-91 () none 91) - (process-drawable-reserved-method-92 () none 92) - (process-drawable-reserved-method-93 () none 93) - (process-drawable-reserved-method-94 () none 94) - (process-drawable-reserved-method-95 () none 95) - (process-drawable-reserved-method-96 () none 96) - (process-drawable-reserved-method-97 () none 97) - (process-drawable-reserved-method-98 () none 98) - (process-drawable-reserved-method-99 () none 99) - (process-drawable-reserved-method-100 () none 100) - (process-drawable-reserved-method-101 () none 101) - (process-drawable-reserved-method-102 () none 102) - (process-drawable-reserved-method-103 () none 103) - (process-drawable-reserved-method-104 () none 104) - (process-drawable-reserved-method-105 () none 105) - (process-drawable-reserved-method-106 () none 106) - (process-drawable-reserved-method-107 () none 107) - (process-drawable-reserved-method-108 () none 108) - (process-drawable-reserved-method-109 () none 109) - (process-drawable-reserved-method-110 () none 110) - (process-drawable-reserved-method-111 () none 111) - (process-drawable-reserved-method-112 () none 112) - (process-drawable-reserved-method-113 () none 113) - (process-drawable-reserved-method-114 () none 114) - (process-drawable-reserved-method-115 () none 115) - (process-drawable-reserved-method-116 () none 116) - (process-drawable-reserved-method-117 () none 117) - (process-drawable-reserved-method-118 () none 118) - (process-drawable-reserved-method-119 () none 119) - (process-drawable-reserved-method-120 () none 120) - (process-drawable-reserved-method-121 () none 121) - (process-drawable-reserved-method-122 () none 122) - (process-drawable-reserved-method-123 () none 123) - (process-drawable-reserved-method-124 () none 124) - (process-drawable-reserved-method-125 () none 125) - (process-drawable-reserved-method-126 () none 126) - (process-drawable-reserved-method-127 () none 127) - (process-drawable-reserved-method-128 () none 128) - (process-drawable-reserved-method-129 () none 129) - (process-drawable-reserved-method-130 () none 130) - (process-drawable-reserved-method-131 () none 131) - (process-drawable-reserved-method-132 () none 132) - (process-drawable-reserved-method-133 () none 133) - (process-drawable-reserved-method-134 () none 134) - (process-drawable-reserved-method-135 () none 135) - (process-drawable-reserved-method-136 () none 136) - (process-drawable-reserved-method-137 () none 137) - (process-drawable-reserved-method-138 () none 138) - (process-drawable-reserved-method-139 () none 139) - (process-drawable-reserved-method-140 () none 140) - (process-drawable-reserved-method-141 () none 141) - (process-drawable-reserved-method-142 () none 142) - (process-drawable-reserved-method-143 () none 143) - (process-drawable-reserved-method-144 () none 144) - (process-drawable-reserved-method-145 () none 145) - (process-drawable-reserved-method-146 () none 146) - (process-drawable-reserved-method-147 () none 147) - (process-drawable-reserved-method-148 () none 148) - (process-drawable-reserved-method-149 () none 149) - (process-drawable-reserved-method-150 () none 150) - (process-drawable-reserved-method-151 () none 151) - (process-drawable-reserved-method-152 () none 152) - (process-drawable-reserved-method-153 () none 153) - (process-drawable-reserved-method-154 () none 154) - (process-drawable-reserved-method-155 () none 155) - (process-drawable-reserved-method-156 () none 156) - (process-drawable-reserved-method-157 () none 157) - (process-drawable-reserved-method-158 () none 158) - (process-drawable-reserved-method-159 () none 159) - (process-drawable-reserved-method-160 () none 160) - (process-drawable-reserved-method-161 () none 161) - (process-drawable-reserved-method-162 () none 162) - (process-drawable-reserved-method-163 () none 163) - (process-drawable-reserved-method-164 () none 164) - (process-drawable-reserved-method-165 () none 165) - (process-drawable-reserved-method-166 () none 166) - (process-drawable-reserved-method-167 () none 167) - (process-drawable-reserved-method-168 () none 168) - (process-drawable-reserved-method-169 () none 169) - (process-drawable-reserved-method-170 () none 170) - (process-drawable-reserved-method-171 () none 171) - (process-drawable-reserved-method-172 () none 172) - (process-drawable-reserved-method-173 () none 173) - (process-drawable-reserved-method-174 () none 174) - (process-drawable-reserved-method-175 () none 175) - (process-drawable-reserved-method-176 () none 176) - (process-drawable-reserved-method-177 () none 177) + (process-drawable-reserved-method-20 () none) ;; 20 ;; (dummy-20 () none) ;; 20 + (process-drawable-reserved-method-21 () none) ;; 21 ;; (dummy-21 () none) ;; 21 + (process-drawable-reserved-method-22 () none) ;; 22 ;; (dummy-22 () none) ;; 22 + (process-drawable-reserved-method-23 () none) ;; 23 ;; (dummy-23 () none) ;; 23 + (process-drawable-reserved-method-24 () none) ;; 24 ;; (dummy-24 () none) ;; 24 + (process-drawable-reserved-method-25 () none) ;; 25 ;; (dummy-25 () none) ;; 25 + (process-drawable-reserved-method-26 () none) ;; 26 ;; (dummy-26 () none) ;; 26 + (process-drawable-reserved-method-27 () none) ;; 27 ;; (dummy-27 () none) ;; 27 + (process-drawable-reserved-method-28 () none) ;; 28 ;; (dummy-28 () none) ;; 28 + (process-drawable-reserved-method-29 () none) ;; 29 ;; (dummy-29 () none) ;; 29 + (process-drawable-reserved-method-30 () none) ;; 30 ;; (dummy-30 () none) ;; 30 + (process-drawable-reserved-method-31 () none) ;; 31 ;; (dummy-31 () none) ;; 31 + (process-drawable-reserved-method-32 () none) ;; 32 ;; (dummy-32 () none) ;; 32 + (process-drawable-reserved-method-33 () none) ;; 33 ;; (dummy-33 () none) ;; 33 + (process-drawable-reserved-method-34 () none) ;; 34 ;; (dummy-34 () none) ;; 34 + (process-drawable-reserved-method-35 () none) ;; 35 ;; (dummy-35 () none) ;; 35 + (process-drawable-reserved-method-36 () none) ;; 36 ;; (dummy-36 () none) ;; 36 + (process-drawable-reserved-method-37 () none) ;; 37 ;; (dummy-37 () none) ;; 37 + (process-drawable-reserved-method-38 () none) ;; 38 ;; (dummy-38 () none) ;; 38 + (process-drawable-reserved-method-39 () none) ;; 39 ;; (dummy-39 () none) ;; 39 + (process-drawable-reserved-method-40 () none) ;; 40 ;; (dummy-40 () none) ;; 40 + (process-drawable-reserved-method-41 () none) ;; 41 ;; (dummy-41 () none) ;; 41 + (process-drawable-reserved-method-42 () none) ;; 42 ;; (dummy-42 () none) ;; 42 + (process-drawable-reserved-method-43 () none) ;; 43 ;; (dummy-43 () none) ;; 43 + (process-drawable-reserved-method-44 () none) ;; 44 ;; (dummy-44 () none) ;; 44 + (process-drawable-reserved-method-45 () none) ;; 45 ;; (dummy-45 () none) ;; 45 + (process-drawable-reserved-method-46 () none) ;; 46 ;; (dummy-46 () none) ;; 46 + (process-drawable-reserved-method-47 () none) ;; 47 ;; (dummy-47 () none) ;; 47 + (process-drawable-reserved-method-48 () none) ;; 48 ;; (dummy-48 () none) ;; 48 + (process-drawable-reserved-method-49 () none) ;; 49 ;; (dummy-49 () none) ;; 49 + (process-drawable-reserved-method-50 () none) ;; 50 ;; (dummy-50 () none) ;; 50 + (process-drawable-reserved-method-51 () none) ;; 51 ;; (dummy-51 () none) ;; 51 + (process-drawable-reserved-method-52 () none) ;; 52 ;; (dummy-52 () none) ;; 52 + (process-drawable-reserved-method-53 () none) ;; 53 ;; (dummy-53 () none) ;; 53 + (process-drawable-reserved-method-54 () none) ;; 54 ;; (dummy-54 () none) ;; 54 + (process-drawable-reserved-method-55 () none) ;; 55 ;; (dummy-55 () none) ;; 55 + (process-drawable-reserved-method-56 () none) ;; 56 ;; (dummy-56 () none) ;; 56 + (process-drawable-reserved-method-57 () none) ;; 57 ;; (dummy-57 () none) ;; 57 + (process-drawable-reserved-method-58 () none) ;; 58 ;; (dummy-58 () none) ;; 58 + (process-drawable-reserved-method-59 () none) ;; 59 ;; (dummy-59 () none) ;; 59 + (process-drawable-reserved-method-60 () none) ;; 60 ;; (dummy-60 () none) ;; 60 + (process-drawable-reserved-method-61 () none) ;; 61 ;; (dummy-61 () none) ;; 61 + (process-drawable-reserved-method-62 () none) ;; 62 ;; (dummy-62 () none) ;; 62 + (process-drawable-reserved-method-63 () none) ;; 63 + (process-drawable-reserved-method-64 () none) ;; 64 + (process-drawable-reserved-method-65 () none) ;; 65 + (process-drawable-reserved-method-66 () none) ;; 66 + (process-drawable-reserved-method-67 () none) ;; 67 + (process-drawable-reserved-method-68 () none) ;; 68 + (process-drawable-reserved-method-69 () none) ;; 69 + (process-drawable-reserved-method-70 () none) ;; 70 + (process-drawable-reserved-method-71 () none) ;; 71 + (process-drawable-reserved-method-72 () none) ;; 72 + (process-drawable-reserved-method-73 () none) ;; 73 + (process-drawable-reserved-method-74 () none) ;; 74 + (process-drawable-reserved-method-75 () none) ;; 75 + (process-drawable-reserved-method-76 () none) ;; 76 + (process-drawable-reserved-method-77 () none) ;; 77 + (process-drawable-reserved-method-78 () none) ;; 78 + (process-drawable-reserved-method-79 () none) ;; 79 + (process-drawable-reserved-method-80 () none) ;; 80 + (process-drawable-reserved-method-81 () none) ;; 81 + (process-drawable-reserved-method-82 () none) ;; 82 + (process-drawable-reserved-method-83 () none) ;; 83 + (process-drawable-reserved-method-84 () none) ;; 84 + (process-drawable-reserved-method-85 () none) ;; 85 + (process-drawable-reserved-method-86 () none) ;; 86 + (process-drawable-reserved-method-87 () none) ;; 87 + (process-drawable-reserved-method-88 () none) ;; 88 + (process-drawable-reserved-method-89 () none) ;; 89 + (process-drawable-reserved-method-90 () none) ;; 90 + (process-drawable-reserved-method-91 () none) ;; 91 + (process-drawable-reserved-method-92 () none) ;; 92 + (process-drawable-reserved-method-93 () none) ;; 93 + (process-drawable-reserved-method-94 () none) ;; 94 + (process-drawable-reserved-method-95 () none) ;; 95 + (process-drawable-reserved-method-96 () none) ;; 96 + (process-drawable-reserved-method-97 () none) ;; 97 + (process-drawable-reserved-method-98 () none) ;; 98 + (process-drawable-reserved-method-99 () none) ;; 99 + (process-drawable-reserved-method-100 () none) ;; 100 + (process-drawable-reserved-method-101 () none) ;; 101 + (process-drawable-reserved-method-102 () none) ;; 102 + (process-drawable-reserved-method-103 () none) ;; 103 + (process-drawable-reserved-method-104 () none) ;; 104 + (process-drawable-reserved-method-105 () none) ;; 105 + (process-drawable-reserved-method-106 () none) ;; 106 + (process-drawable-reserved-method-107 () none) ;; 107 + (process-drawable-reserved-method-108 () none) ;; 108 + (process-drawable-reserved-method-109 () none) ;; 109 + (process-drawable-reserved-method-110 () none) ;; 110 + (process-drawable-reserved-method-111 () none) ;; 111 + (process-drawable-reserved-method-112 () none) ;; 112 + (process-drawable-reserved-method-113 () none) ;; 113 + (process-drawable-reserved-method-114 () none) ;; 114 + (process-drawable-reserved-method-115 () none) ;; 115 + (process-drawable-reserved-method-116 () none) ;; 116 + (process-drawable-reserved-method-117 () none) ;; 117 + (process-drawable-reserved-method-118 () none) ;; 118 + (process-drawable-reserved-method-119 () none) ;; 119 + (process-drawable-reserved-method-120 () none) ;; 120 + (process-drawable-reserved-method-121 () none) ;; 121 + (process-drawable-reserved-method-122 () none) ;; 122 + (process-drawable-reserved-method-123 () none) ;; 123 + (process-drawable-reserved-method-124 () none) ;; 124 + (process-drawable-reserved-method-125 () none) ;; 125 + (process-drawable-reserved-method-126 () none) ;; 126 + (process-drawable-reserved-method-127 () none) ;; 127 + (process-drawable-reserved-method-128 () none) ;; 128 + (process-drawable-reserved-method-129 () none) ;; 129 + (process-drawable-reserved-method-130 () none) ;; 130 + (process-drawable-reserved-method-131 () none) ;; 131 + (process-drawable-reserved-method-132 () none) ;; 132 + (process-drawable-reserved-method-133 () none) ;; 133 + (process-drawable-reserved-method-134 () none) ;; 134 + (process-drawable-reserved-method-135 () none) ;; 135 + (process-drawable-reserved-method-136 () none) ;; 136 + (process-drawable-reserved-method-137 () none) ;; 137 + (process-drawable-reserved-method-138 () none) ;; 138 + (process-drawable-reserved-method-139 () none) ;; 139 + (process-drawable-reserved-method-140 () none) ;; 140 + (process-drawable-reserved-method-141 () none) ;; 141 + (process-drawable-reserved-method-142 () none) ;; 142 + (process-drawable-reserved-method-143 () none) ;; 143 + (process-drawable-reserved-method-144 () none) ;; 144 + (process-drawable-reserved-method-145 () none) ;; 145 + (process-drawable-reserved-method-146 () none) ;; 146 + (process-drawable-reserved-method-147 () none) ;; 147 + (process-drawable-reserved-method-148 () none) ;; 148 + (process-drawable-reserved-method-149 () none) ;; 149 + (process-drawable-reserved-method-150 () none) ;; 150 + (process-drawable-reserved-method-151 () none) ;; 151 + (process-drawable-reserved-method-152 () none) ;; 152 + (process-drawable-reserved-method-153 () none) ;; 153 + (process-drawable-reserved-method-154 () none) ;; 154 + (process-drawable-reserved-method-155 () none) ;; 155 + (process-drawable-reserved-method-156 () none) ;; 156 + (process-drawable-reserved-method-157 () none) ;; 157 + (process-drawable-reserved-method-158 () none) ;; 158 + (process-drawable-reserved-method-159 () none) ;; 159 + (process-drawable-reserved-method-160 () none) ;; 160 + (process-drawable-reserved-method-161 () none) ;; 161 + (process-drawable-reserved-method-162 () none) ;; 162 + (process-drawable-reserved-method-163 () none) ;; 163 + (process-drawable-reserved-method-164 () none) ;; 164 + (process-drawable-reserved-method-165 () none) ;; 165 + (process-drawable-reserved-method-166 () none) ;; 166 + (process-drawable-reserved-method-167 () none) ;; 167 + (process-drawable-reserved-method-168 () none) ;; 168 + (process-drawable-reserved-method-169 () none) ;; 169 + (process-drawable-reserved-method-170 () none) ;; 170 + (process-drawable-reserved-method-171 () none) ;; 171 + (process-drawable-reserved-method-172 () none) ;; 172 + (process-drawable-reserved-method-173 () none) ;; 173 + (process-drawable-reserved-method-174 () none) ;; 174 + (process-drawable-reserved-method-175 () none) ;; 175 + (process-drawable-reserved-method-176 () none) ;; 176 + (process-drawable-reserved-method-177 () none) ;; 177 ) ) @@ -15794,9 +15773,9 @@ :flag-assert #xc000000a0 ;; Failed to read fields. (:methods - (attack-info-method-9 (_type_ attack-info process-drawable process-drawable) none 9) - (compute-intersect-info (_type_ object process-drawable process touching-shapes-entry) attack-info 10) - (combine! (_type_ attack-info process-drawable) attack-info 11) + (attack-info-method-9 (_type_ attack-info process-drawable process-drawable) none) ;; 9 + (compute-intersect-info (_type_ object process-drawable process touching-shapes-entry) attack-info) ;; 10 + (combine! (_type_ attack-info process-drawable) attack-info) ;; 11 ) ) @@ -15827,7 +15806,7 @@ :size-assert #xc :flag-assert #xa0000000c (:methods - (script-form-method-9 () none 9) + (script-form-method-9 () none) ;; 9 ) ) @@ -15847,10 +15826,10 @@ :size-assert #xa0 :flag-assert #xc000000a0 (:methods - (new (symbol type object process vector) _type_ 0) - (eval! (_type_ pair) object 9) - (script-context-method-10 (_type_ object pair) object 10) - (script-context-method-11 (_type_ pair pair symbol) symbol 11) + (new (symbol type object process vector) _type_) ;; 0 + (eval! (_type_ pair) object) ;; 9 + (script-context-method-10 (_type_ object pair) object) ;; 10 + (script-context-method-11 (_type_ pair pair symbol) symbol) ;; 11 ) ) @@ -15883,7 +15862,7 @@ :size-assert #x50 :flag-assert #xa00000050 (:methods - (scene-actor-method-9 (_type_ scene-player) (pointer process) 9) + (scene-actor-method-9 (_type_ scene-player) (pointer process)) ;; 9 ) ) @@ -15922,8 +15901,8 @@ :size-assert #x8e :flag-assert #x110000008e (:methods - (scene-method-15 (_type_ spool-anim) none 15) - (scene-method-16 (_type_) _type_ 16) + (scene-method-15 (_type_ spool-anim) none) ;; 15 + (scene-method-16 (_type_) _type_) ;; 16 ) ) @@ -15955,13 +15934,15 @@ :method-count-assert 26 :size-assert #x178 :flag-assert #x1a01000178 + (:state-methods + (wait symbol) + release + play-anim + ) (:methods - (wait (symbol) _type_ :state 20) - (release () _type_ :state 21) - (play-anim () _type_ :state 22) - (scene-player-method-23 (_type_ string symbol) none 23) - (scene-player-method-24 "TODO - arg1 can be string/scene" (_type_ basic symbol) scene 24) - (scene-player-method-25 (_type_ float) none 25) + (scene-player-method-23 (_type_ string symbol) none) ;; 23 + (scene-player-method-24 "TODO - arg1 can be string/scene" (_type_ basic symbol) scene) ;; 24 + (scene-player-method-25 (_type_ float) none) ;; 25 ) ) @@ -16002,13 +15983,13 @@ :size-assert #x10 :flag-assert #x1000000010 (:methods - (get-current-phase-no-mod "Get the current value, with no fancy modifications." (_type_) float 9) - (get-phase-offset "Get the offset, as a fraction of period" (_type_) float 10) - (get-norm! "Get the current value, from 0 to 1." (_type_ int) float 11) - (get-scaled-val! "Multiples result of `get-norm!` by the provided float" (_type_ float int) float 12) - (initialize! "Set up a sync-info from params." (_type_ sync-info-params) none 13) - (get-timeframe-offset! "Get the difference between the given time-frame and when this sync-info is at 0." (_type_ time-frame) time-frame 14) - (sync-now! "Adjust our offset so our current phase is the given phase." (_type_ float) none 15) ;; (load-params! (_type_ process uint float float float) symbol 15) + (get-current-phase-no-mod "Get the current value, with no fancy modifications." (_type_) float) ;; 9 + (get-phase-offset "Get the offset, as a fraction of period" (_type_) float) ;; 10 + (get-norm! "Get the current value, from 0 to 1." (_type_ int) float) ;; 11 + (get-scaled-val! "Multiples result of `get-norm!` by the provided float" (_type_ float int) float) ;; 12 + (initialize! "Set up a sync-info from params." (_type_ sync-info-params) none) ;; 13 + (get-timeframe-offset! "Get the difference between the given time-frame and when this sync-info is at 0." (_type_ time-frame) time-frame) ;; 14 + (sync-now! "Adjust our offset so our current phase is the given phase." (_type_ float) none) ;; 15 ;; (load-params! (_type_ process uint float float float) symbol) ;; 15 ) ) @@ -16018,8 +15999,6 @@ :method-count-assert 16 :size-assert #x10 :flag-assert #x1000000010 - (:methods - ) ) (deftype sync-eased (sync-info) @@ -16035,8 +16014,6 @@ :method-count-assert 16 :size-assert #x2c :flag-assert #x100000002c - (:methods - ) ) (deftype sync-paused (sync-info) @@ -16046,8 +16023,6 @@ :method-count-assert 16 :size-assert #x18 :flag-assert #x1000000018 - (:methods - ) ) (deftype delayed-rand-float (structure) @@ -16063,10 +16038,10 @@ :size-assert #x1c :flag-assert #xd0000001c (:methods - (set-params! (_type_ int int float) float 9) - (reset! (_type_) float 10) - (update! (_type_) float 11) - (update-and-clear! (_type_) none 12) + (set-params! (_type_ int int float) float) ;; 9 + (reset! (_type_) float) ;; 10 + (update! (_type_) float) ;; 11 + (update-and-clear! (_type_) none) ;; 12 ) ) @@ -16083,8 +16058,8 @@ :size-assert #x18 :flag-assert #xb00000018 (:methods - (set-params! (_type_ float float float float) float 9) - (update! (_type_ float) float 10) + (set-params! (_type_ float float float float) float) ;; 9 + (update! (_type_ float) float) ;; 10 ) ) @@ -16100,10 +16075,10 @@ :size-assert #x28 :flag-assert #xd00000028 (:methods - (set-params! (_type_ float float float float float float float) float 9) - (update! (_type_ float) float 10) - (at-min? (_type_) symbol 11) - (at-max? (_type_) symbol 12) + (set-params! (_type_ float float float float float float float) float) ;; 9 + (update! (_type_ float) float) ;; 10 + (at-min? (_type_) symbol) ;; 11 + (at-max? (_type_) symbol) ;; 12 ) ) @@ -16120,10 +16095,10 @@ :size-assert #x30 :flag-assert #xd00000030 (:methods - (set-params! (_type_ int int float float) vector 9) - (update-now! (_type_) vector 10) - (update-with-delay! (_type_) vector 11) - (update-with-delay-or-reset! (_type_) vector 12) + (set-params! (_type_ int int float float) vector) ;; 9 + (update-now! (_type_) vector) ;; 10 + (update-with-delay! (_type_) vector) ;; 11 + (update-with-delay-or-reset! (_type_) vector) ;; 12 ) ) @@ -16139,8 +16114,8 @@ :size-assert #x3c :flag-assert #xb0000003c (:methods - (set-params! (_type_ vector float float float) vector 9) - (update! (_type_ vector) vector 10) + (set-params! (_type_ vector float float float) vector) ;; 9 + (update! (_type_ vector) vector) ;; 10 ) ) @@ -16170,17 +16145,19 @@ :method-count-assert 30 :size-assert #xf4 :flag-assert #x1e008000f4 + (:state-methods + pov-camera-abort + pov-camera-done-playing + pov-camera-playing + pov-camera-start-playing + pov-camera-startup + ) (:methods - (pov-camera-abort () _type_ :state 20) ;; (pov-camera-abort () _type_ :state 20) - (pov-camera-done-playing () _type_ :state 21) ;; (pov-camera-done-playing () _type_ :state 21) - (pov-camera-playing () _type_ :state 22) ;; (pov-camera-playing () _type_ :state 22) - (pov-camera-start-playing () _type_ :state 23) ;; (pov-camera-start-playing () _type_ :state 23) - (pov-camera-startup () _type_ :state 24) ;; (pov-camera-startup () _type_ :state 24) - (abort? (_type_) symbol :behavior pov-camera 25) - (target-grabbed? (_type_) symbol 26) - (pov-camera-method-27 () none 27) ;; (pre-startup-callback (_type_) none 27) - (pov-camera-method-28 () none 28) ;; (target-released? () symbol 28) - (target-released? (_type_) symbol 29) ;; (set-stack-size! (_type_) none 29) + (abort? (_type_) symbol :behavior pov-camera) ;; 25 + (target-grabbed? (_type_) symbol) ;; 26 + (pov-camera-method-27 () none) ;; 27 ;; (pre-startup-callback (_type_) none) ;; 27 + (pov-camera-method-28 () none) ;; 28 ;; (target-released? () symbol) ;; 28 + (target-released? (_type_) symbol) ;; 29 ;; (set-stack-size! (_type_) none) ;; 29 ) ) @@ -16203,12 +16180,12 @@ :size-assert #x20 :flag-assert #xf00000020 (:methods - (set-zero! (_type_) _type_ 9) - (update! (_type_) float 10) - (get-no-update (_type_) float 11) - (activate! (_type_ float int int float float clock) _type_ 12) - (nonzero-amplitude? (_type_) symbol 13) - (die-on-next-update! (_type_) _type_ 14) + (set-zero! (_type_) _type_) ;; 9 + (update! (_type_) float) ;; 10 + (get-no-update (_type_) float) ;; 11 + (activate! (_type_ float int int float float clock) _type_) ;; 12 + (nonzero-amplitude? (_type_) symbol) ;; 13 + (die-on-next-update! (_type_) _type_) ;; 14 ) ) @@ -16355,14 +16332,14 @@ :flag-assert #x10000000b8 ;; Failed to read fields. (:methods - (new (symbol type joint-mod-mode process-drawable int) _type_ 0) - (mode-set! (_type_ joint-mod-mode) none 9) - (target-set! (_type_ vector) none 10) - (look-at! (_type_ vector symbol process) none :behavior process 11) - (reset-blend! (_type_) _type_ 12) - (twist-set! (_type_ float float float) vector 13) - (trs-set! (_type_ vector quaternion vector) none 14) - (shut-down (_type_) none 15) + (new (symbol type joint-mod-mode process-drawable int) _type_) ;; 0 + (mode-set! (_type_ joint-mod-mode) none) ;; 9 + (target-set! (_type_ vector) none) ;; 10 + (look-at! (_type_ vector symbol process) none :behavior process) ;; 11 + (reset-blend! (_type_) _type_) ;; 12 + (twist-set! (_type_ float float float) vector) ;; 13 + (trs-set! (_type_ vector quaternion vector) none) ;; 14 + (shut-down (_type_) none) ;; 15 ) ) @@ -16529,8 +16506,8 @@ :flag-assert #xb000000e8 (:methods (new (symbol type process-drawable int float) _type_) - (handle-copy! (_type_ vector) none 9) - (enable-set! (_type_ symbol) none 10) + (handle-copy! (_type_ vector) none) ;; 9 + (enable-set! (_type_ symbol) none) ;; 10 ) ) @@ -16590,13 +16567,13 @@ :size-assert #x28 :flag-assert #x1000000028 (:methods - (debug-draw-tris (_type_ process-drawable int) none 9) - (overlap-test (_type_ collide-mesh-cache-tri vector) symbol 10) - (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 11) - (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 12) - (unpack-mesh-to-cache! (_type_ (inline-array collide-mesh-cache-tri) matrix) none 13) - (collide-mesh-math-1 (_type_ object object) none 14) - (collide-mesh-math-2 (_type_ object object object) none 15) + (debug-draw-tris (_type_ process-drawable int) none) ;; 9 + (overlap-test (_type_ collide-mesh-cache-tri vector) symbol) ;; 10 + (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) ;; 11 + (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) ;; 12 + (unpack-mesh-to-cache! (_type_ (inline-array collide-mesh-cache-tri) matrix) none) ;; 13 + (collide-mesh-math-1 (_type_ object object) none) ;; 14 + (collide-mesh-math-2 (_type_ object object object) none) ;; 15 ) ) @@ -16631,10 +16608,10 @@ :size-assert #xbb90 :flag-assert #xd0000bb90 (:methods - (populate-for-prim-mesh (_type_ collide-shape-prim-mesh) collide-mesh-cache-entry 9) - (is-id? (_type_ int) symbol 10) - (next-id! (_type_) uint 11) - (allocate! (_type_ int) collide-mesh-cache-entry 12) + (populate-for-prim-mesh (_type_ collide-shape-prim-mesh) collide-mesh-cache-entry) ;; 9 + (is-id? (_type_ int) symbol) ;; 10 + (next-id! (_type_) uint) ;; 11 + (allocate! (_type_ int) collide-mesh-cache-entry) ;; 12 ) ) @@ -16692,8 +16669,8 @@ :size-assert #x290 :flag-assert #xb00000290 (:methods - (add-rider (_type_ handle) collide-rider 9) - (prepare (_type_) none 10) + (add-rider (_type_ handle) collide-rider) ;; 9 + (prepare (_type_) none) ;; 10 ) ) @@ -16797,18 +16774,18 @@ :flag-assert #x1400000050 ;; Failed to read fields. (:methods - (new (symbol type collide-shape uint int) _type_ 0) - (debug-draw (_type_) none 9) - (add-fg-prim-using-box (_type_ collide-cache) none 10) - (add-fg-prim-using-line-sphere (_type_ collide-cache object) none 11) - (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 12) - (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 13) - (collide-shape-prim-method-14 () none 14) - (collide-with-collide-cache-prim-mesh (_type_ collide-query collide-cache-prim) none 15) - (collide-with-collide-cache-prim-sphere (_type_ collide-query collide-cache-prim) none 16) - (on-platform-test (_type_ collide-shape-prim collide-query float) none 17) - (should-push-away-test (_type_ collide-shape-prim collide-query) none 18) - (should-push-away-a-group-test (_type_ collide-shape-prim-group collide-query) none 19) + (new (symbol type collide-shape uint int) _type_) ;; 0 + (debug-draw (_type_) none) ;; 9 + (add-fg-prim-using-box (_type_ collide-cache) none) ;; 10 + (add-fg-prim-using-line-sphere (_type_ collide-cache object) none) ;; 11 + (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol) ;; 12 + (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol) ;; 13 + (collide-shape-prim-method-14 () none) ;; 14 + (collide-with-collide-cache-prim-mesh (_type_ collide-query collide-cache-prim) none) ;; 15 + (collide-with-collide-cache-prim-sphere (_type_ collide-query collide-cache-prim) none) ;; 16 + (on-platform-test (_type_ collide-shape-prim collide-query float) none) ;; 17 + (should-push-away-test (_type_ collide-shape-prim collide-query) none) ;; 18 + (should-push-away-a-group-test (_type_ collide-shape-prim-group collide-query) none) ;; 19 ) ) @@ -16822,7 +16799,7 @@ :flag-assert #x1400000050 ;; Failed to read fields. (:methods - (new (symbol type collide-shape uint) _type_ 0) + (new (symbol type collide-shape uint) _type_) ;; 0 ) ) @@ -16838,7 +16815,7 @@ :flag-assert #x1400000050 ;; Failed to read fields. (:methods - (new (symbol type collide-shape uint uint) _type_ 0) + (new (symbol type collide-shape uint uint) _type_) ;; 0 ) ) @@ -16852,7 +16829,7 @@ :flag-assert #x1400000050 ;; Failed to read fields. (:methods - (new (symbol type collide-shape uint int) _type_ 0) + (new (symbol type collide-shape uint int) _type_) ;; 0 ) ) @@ -16899,38 +16876,38 @@ :flag-assert #x37000000c8 ;; Failed to read fields. (:methods - (new (symbol type process-drawable collide-list-enum) _type_ 0) - (move-by-vector! (_type_ vector) none 28) - (move-to-point! (_type_ vector) none 29) - (debug-draw (_type_) none 30) - (fill-cache-for-shape (_type_ float collide-query) none 31) - (fill-cache-integrate-and-collide (_type_ vector collide-query meters) none 32) - (find-prim-by-id (_type_ uint) collide-shape-prim 33) - (find-prim-by-id-logtest (_type_ uint) collide-shape-prim 34) - (detect-riders! (_type_) symbol 35) - (build-bounding-box-for-shape (_type_ bounding-box float collide-spec) symbol 36) - (integrate-and-collide! (_type_ vector) none 37) - (find-collision-meshes (_type_) none 38) - (on-platform (_type_ collide-shape collide-query) symbol 39) - (find-overlapping-shapes (_type_ overlaps-others-params) symbol 40) - (shove-to-closest-point-on-path (_type_ attack-info float) vector 41) - (should-push-away (_type_ collide-shape collide-query) symbol 42) - (pull-rider! (_type_ pull-rider-info) none 43) - (pull-riders! (_type_) symbol 44) - (do-push-aways (_type_) collide-spec 45) - (update-transforms (_type_) none 46) - (set-collide-with! (_type_ collide-spec) none 47) - (set-collide-as! (_type_ collide-spec) none 48) - (modify-collide-as! (_type_ int collide-spec collide-spec) none 49) - (send-shoves (_type_ process touching-shapes-entry float float float) symbol 50) + (new (symbol type process-drawable collide-list-enum) _type_) ;; 0 + (move-by-vector! (_type_ vector) none) ;; 28 + (move-to-point! (_type_ vector) none) ;; 29 + (debug-draw (_type_) none) ;; 30 + (fill-cache-for-shape (_type_ float collide-query) none) ;; 31 + (fill-cache-integrate-and-collide (_type_ vector collide-query meters) none) ;; 32 + (find-prim-by-id (_type_ uint) collide-shape-prim) ;; 33 + (find-prim-by-id-logtest (_type_ uint) collide-shape-prim) ;; 34 + (detect-riders! (_type_) symbol) ;; 35 + (build-bounding-box-for-shape (_type_ bounding-box float collide-spec) symbol) ;; 36 + (integrate-and-collide! (_type_ vector) none) ;; 37 + (find-collision-meshes (_type_) none) ;; 38 + (on-platform (_type_ collide-shape collide-query) symbol) ;; 39 + (find-overlapping-shapes (_type_ overlaps-others-params) symbol) ;; 40 + (shove-to-closest-point-on-path (_type_ attack-info float) vector) ;; 41 + (should-push-away (_type_ collide-shape collide-query) symbol) ;; 42 + (pull-rider! (_type_ pull-rider-info) none) ;; 43 + (pull-riders! (_type_) symbol) ;; 44 + (do-push-aways (_type_) collide-spec) ;; 45 + (update-transforms (_type_) none) ;; 46 + (set-collide-with! (_type_ collide-spec) none) ;; 47 + (set-collide-as! (_type_ collide-spec) none) ;; 48 + (modify-collide-as! (_type_ int collide-spec collide-spec) none) ;; 49 + (send-shoves (_type_ process touching-shapes-entry float float float) symbol) ;; 50 (above-ground? "@returns if we are above ground or not" - (_type_ collide-query vector collide-spec float float float) symbol 51) + (_type_ collide-query vector collide-spec float float float) symbol) ;; 51 (water-info-init! "Initialize a [[water-info]] with the currently loaded regions." - (_type_ water-info collide-action) water-info 52) - (iterate-prims (_type_ (function collide-shape-prim none)) none 53) - (pusher-init (_type_) none 54) + (_type_ water-info collide-action) water-info) ;; 52 + (iterate-prims (_type_ (function collide-shape-prim none)) none) ;; 53 + (pusher-init (_type_) none) ;; 54 ) ) @@ -17090,20 +17067,20 @@ :size-assert #x1dc :flag-assert #x44000001dc (:methods - (new (symbol type process-drawable collide-list-enum) _type_ 0) - (find-ground (_type_ collide-query collide-spec float float float) symbol 55) - (react-to-pat! (_type_ pat-surface) cshape-reaction-flags 56) - (integrate-no-collide! (_type_ vector) none 57) - (integrate-for-enemy-no-mtg (_type_ vector overlaps-others-params) symbol 58) - (move-above-ground (_type_ vector move-above-ground-params) none 59) - (move-to-ground (_type_ float float symbol collide-spec) none 60) - (move-to-ground-point (_type_ vector vector vector) none 61) - (compute-acc-due-to-gravity (_type_ vector float) vector 62) - (collide-shape-moving-method-63 (_type_ rigid-body float) none 63) - (try-snap-to-surface (_type_ vector float float float) symbol 64) - (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol 65) - (step-collison! (_type_ vector vector float int) float 66) - (collide-with-all-collide-cache-prims (_type_ matrix collide-query) none 67) + (new (symbol type process-drawable collide-list-enum) _type_) ;; 0 + (find-ground (_type_ collide-query collide-spec float float float) symbol) ;; 55 + (react-to-pat! (_type_ pat-surface) cshape-reaction-flags) ;; 56 + (integrate-no-collide! (_type_ vector) none) ;; 57 + (integrate-for-enemy-no-mtg (_type_ vector overlaps-others-params) symbol) ;; 58 + (move-above-ground (_type_ vector move-above-ground-params) none) ;; 59 + (move-to-ground (_type_ float float symbol collide-spec) none) ;; 60 + (move-to-ground-point (_type_ vector vector vector) none) ;; 61 + (compute-acc-due-to-gravity (_type_ vector float) vector) ;; 62 + (collide-shape-moving-method-63 (_type_ rigid-body float) none) ;; 63 + (try-snap-to-surface (_type_ vector float float float) symbol) ;; 64 + (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol) ;; 65 + (step-collison! (_type_ vector vector float int) float) ;; 66 + (collide-with-all-collide-cache-prims (_type_ matrix collide-query) none) ;; 67 ) ) @@ -17149,8 +17126,8 @@ (options manipy-options :offset-assert 368) ) :flag-assert #x1501000174 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -17166,9 +17143,11 @@ :method-count-assert 16 :size-assert #xb0 :flag-assert #x10003000b0 + (:state-methods + active + ) (:methods - (active () _type_ :state 14) - (is-in-view? (_type_) symbol 15) + (is-in-view? (_type_) symbol) ;; 15 ) ) @@ -17193,9 +17172,11 @@ :size-assert #x168 :flag-assert #x1000f00168 ;; field userdata uses ~A with a 64-bit load + (:state-methods + active + ) (:methods - (active () _type_ :state 14) - (notify-parent-of-death (_type_) none 15) + (notify-parent-of-death (_type_) none) ;; 15 ) ) @@ -17222,10 +17203,12 @@ :size-assert #x130 :flag-assert #x1100b00130 ;; field userdata uses ~A with a 64-bit load + (:state-methods + active + ) (:methods - (active () _type_ :state 14) - (notify-parent-of-death (_type_) none 15) - (update (_type_) none 16) + (notify-parent-of-death (_type_) none) ;; 15 + (update (_type_) none) ;; 16 ) ) @@ -17241,8 +17224,8 @@ :method-count-assert 21 :size-assert #xe8 :flag-assert #x15007000e8 - (:methods - (active () _type_ :state 20) + (:state-methods + active ) ) @@ -17258,10 +17241,12 @@ :method-count-assert 23 :size-assert #x11c :flag-assert #x1700a0011c + (:state-methods + idle + (active handle) + ) (:methods - (idle () _type_ :state 20) - (active (handle) _type_ :state 21) - (move-along-path (_type_) none 22) + (move-along-path (_type_) none) ;; 22 ) ) @@ -17278,8 +17263,8 @@ :size-assert #x1c :flag-assert #xb0000001c (:methods - (gui-query-method-9 () none 9) ;; (init! (_type_ string int int int symbol string) none 9) - (gui-query-method-10 () none 10) ;; (get-response (_type_) symbol 10) + (gui-query-method-9 () none) ;; 9 ;; (init! (_type_ string int int int symbol string) none) ;; 9 + (gui-query-method-10 () none) ;; 10 ;; (get-response (_type_) symbol) ;; 10 ) ) @@ -17314,10 +17299,12 @@ :method-count-assert 23 :size-assert #xdc :flag-assert #x17006000dc + (:state-methods + explode + ) (:methods - (explode () _type_ :state 20) - (setup-explosion-collision (_type_) none 21) - (explosion-method-22 (_type_) none 22) + (setup-explosion-collision (_type_) none) ;; 21 + (explosion-method-22 (_type_) none) ;; 22 ) ) @@ -17340,8 +17327,8 @@ :size-assert #x80 :flag-assert #xf00000080 ;; Failed to read fields. - (:methods - (die () _type_ :state 14) + (:state-methods + die ) ) @@ -17360,15 +17347,15 @@ :size-assert #x28 :flag-assert #x1200000028 (:methods - (compute-trans-at-time (_type_ float vector) vector 9) - (compute-transv-at-time (_type_ float vector) vector 10) - (compute-time-until-apex (_type_) float 11) - (setup-from-to-duration! (_type_ vector vector float float) none 12) - (setup-from-to-xz-vel! (_type_ vector vector float float) none 13) - (setup-from-to-y-vel! (_type_ vector vector float float) none 14) - (setup-from-to-height! (_type_ vector vector float float) none 15) - (setup-from-to-duration-and-height! (_type_ vector vector float float) none 16) - (debug-draw (_type_) none 17) + (compute-trans-at-time (_type_ float vector) vector) ;; 9 + (compute-transv-at-time (_type_ float vector) vector) ;; 10 + (compute-time-until-apex (_type_) float) ;; 11 + (setup-from-to-duration! (_type_ vector vector float float) none) ;; 12 + (setup-from-to-xz-vel! (_type_ vector vector float float) none) ;; 13 + (setup-from-to-y-vel! (_type_ vector vector float float) none) ;; 14 + (setup-from-to-height! (_type_ vector vector float float) none) ;; 15 + (setup-from-to-duration-and-height! (_type_ vector vector float float) none) ;; 16 + (debug-draw (_type_) none) ;; 17 ) ) @@ -17386,10 +17373,10 @@ :size-assert #x50 :flag-assert #xc00000050 (:methods - (new (symbol type process-drawable int float collide-spec) _type_ 0) - (initialize (_type_ process-drawable int float collide-spec) impact-control :behavior process 9) - (update-from-cspace (_type_) none 10) - (impact-control-method-11 (_type_ collide-query process pat-surface) float 11) + (new (symbol type process-drawable int float collide-spec) _type_) ;; 0 + (initialize (_type_ process-drawable int float collide-spec) impact-control :behavior process) ;; 9 + (update-from-cspace (_type_) none) ;; 10 + (impact-control-method-11 (_type_ collide-query process pat-surface) float) ;; 11 ) ) @@ -17399,10 +17386,10 @@ :size-assert #x20 :flag-assert #xc00000020 (:methods - (new (symbol type vector vector) _type_ 0) - (initialize (_type_ vector vector) point-tracker 9) - (point-tracker-method-10 (_type_ vector vector vector float) vector 10) - (point-tracker-method-11 (_type_ vector vector vector float) vector 11) + (new (symbol type vector vector) _type_) ;; 0 + (initialize (_type_ vector vector) point-tracker) ;; 9 + (point-tracker-method-10 (_type_ vector vector vector float) vector) ;; 10 + (point-tracker-method-11 (_type_ vector vector vector float) vector) ;; 11 ) ) @@ -17414,8 +17401,8 @@ :size-assert #x30 :flag-assert #xe00000030 (:methods - (combo-tracker-method-12 (_type_ vector vector process time-frame) combo-tracker 12) - (combo-tracker-method-13 (_type_ handle vector float vector float) basic 13) + (combo-tracker-method-12 (_type_ vector vector process time-frame) combo-tracker) ;; 12 + (combo-tracker-method-13 (_type_ handle vector float vector float) basic) ;; 13 ) ) @@ -17454,11 +17441,11 @@ :size-assert #x40 :flag-assert #xe00000040 (:methods - (cubic-curve-method-9 (_type_ vector vector vector vector) none 9) - (cubic-curve-method-10 (_type_ vector float) vector 10) - (cubic-curve-method-11 (_type_ vector float) vector 11) - (cubic-curve-method-12 (_type_ vector float) vector 12) - (debug-draw-curve (_type_) none 13) + (cubic-curve-method-9 (_type_ vector vector vector vector) none) ;; 9 + (cubic-curve-method-10 (_type_ vector float) vector) ;; 10 + (cubic-curve-method-11 (_type_ vector float) vector) ;; 11 + (cubic-curve-method-12 (_type_ vector float) vector) ;; 12 + (debug-draw-curve (_type_) none) ;; 13 ) ) @@ -17852,9 +17839,9 @@ :size-assert #xe8 :flag-assert #xc000000e8 (:methods - (get-middle-of-bsphere-overlap (_type_ vector) vector 9) - (get-touched-prim (_type_ collide-shape touching-shapes-entry) collide-shape-prim 10) - (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result 11) + (get-middle-of-bsphere-overlap (_type_ vector) vector) ;; 9 + (get-touched-prim (_type_ collide-shape touching-shapes-entry) collide-shape-prim) ;; 10 + (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result) ;; 11 ) ) @@ -17866,11 +17853,11 @@ :size-assert #x3c10 :flag-assert #xd00003c10 (:methods - (new (symbol type) _type_ 0) - (alloc-node (_type_) touching-prims-entry 9) - (get-free-node-count (_type_) int 10) - (init-list! (_type_) none 11) - (free-node (_type_ touching-prims-entry) touching-prims-entry 12) + (new (symbol type) _type_) ;; 0 + (alloc-node (_type_) touching-prims-entry) ;; 9 + (get-free-node-count (_type_) int) ;; 10 + (init-list! (_type_) none) ;; 11 + (free-node (_type_ touching-prims-entry) touching-prims-entry) ;; 12 ) ) @@ -17887,12 +17874,12 @@ :size-assert #x20 :flag-assert #xf00000020 (:methods - (get-head (_type_) touching-prims-entry 9) - (get-next (_type_ touching-shapes-entry) touching-prims-entry 10) - (get-touched-shape (_type_ collide-shape) collide-shape 11) - (prims-touching? (_type_ collide-shape uint) touching-prims-entry 12) - (prims-touching-action? (_type_ collide-shape collide-action collide-action) basic 13) - (free-touching-prims-list (_type_) none 14) + (get-head (_type_) touching-prims-entry) ;; 9 + (get-next (_type_ touching-shapes-entry) touching-prims-entry) ;; 10 + (get-touched-shape (_type_ collide-shape) collide-shape) ;; 11 + (prims-touching? (_type_ collide-shape uint) touching-prims-entry) ;; 12 + (prims-touching-action? (_type_ collide-shape collide-action collide-action) basic) ;; 13 + (free-touching-prims-list (_type_) none) ;; 14 ) ) @@ -17905,12 +17892,12 @@ :size-assert #x408 :flag-assert #xe00000408 (:methods - (new (symbol type) _type_ 0) - (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none 9) - (free-nodes (_type_) none 10) - (update-from-step-size (_type_ float) none 11) - (send-events-for-touching-shapes (_type_) none 12) - (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry 13) + (new (symbol type) _type_) ;; 0 + (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none) ;; 9 + (free-nodes (_type_) none) ;; 10 + (update-from-step-size (_type_ float) none) ;; 11 + (send-events-for-touching-shapes (_type_) none) ;; 12 + (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry) ;; 13 ) ) @@ -17957,8 +17944,8 @@ :size-assert #x1e4 :flag-assert #xb000001e4 (:methods - (edge-grab-info-method-9 (_type_) symbol 9) ;; (dummy-9 (_type_) symbol 9) - (debug-draw (_type_) none 10) + (edge-grab-info-method-9 (_type_) symbol) ;; 9 ;; (dummy-9 (_type_) symbol) ;; 9 + (debug-draw (_type_) none) ;; 10 ) ) @@ -17985,7 +17972,7 @@ :size-assert #x30 :flag-assert #xa00000030 (:methods - (no-collision-at-edge (_type_ collide-edge-work edge-grab-info) symbol 9) + (no-collision-at-edge (_type_ collide-edge-work edge-grab-info) symbol) ;; 9 ) ) @@ -18013,8 +18000,8 @@ :size-assert #x810 :flag-assert #xb00000810 (:methods - (debug-draw (_type_) object 9) - (add-to-list! (_type_ collide-edge-hold-item) none 10) + (debug-draw (_type_) object) ;; 9 + (add-to-list! (_type_ collide-edge-hold-item) none) ;; 10 ) ) @@ -18074,18 +18061,18 @@ :size-assert #x26c0 :flag-assert #x15000026c0 (:methods - (search-for-edges (_type_ collide-edge-hold-list) none 9) - (debug-draw-edges (_type_) object 10) - (debug-draw-tris (_type_) none 11) - (debug-draw-sphere (_type_) none 12) - (find-adjacent-edge (_type_ collide-edge-hold-item edge-grab-info) none 13) - (compute-center-point! (_type_ collide-edge-edge vector) float 14) ;; (dummy-14 (_type_ vector vector int) float 14) - (get-best-hand-point (_type_ vector vector int) float 15) - (find-grabbable-edges (_type_) none 16) - (find-grabbable-tris (_type_) none 17) ;; (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol 17) - (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol 18) - (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol 19) - (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol 20) + (search-for-edges (_type_ collide-edge-hold-list) none) ;; 9 + (debug-draw-edges (_type_) object) ;; 10 + (debug-draw-tris (_type_) none) ;; 11 + (debug-draw-sphere (_type_) none) ;; 12 + (find-adjacent-edge (_type_ collide-edge-hold-item edge-grab-info) none) ;; 13 + (compute-center-point! (_type_ collide-edge-edge vector) float) ;; 14 ;; (dummy-14 (_type_ vector vector int) float) ;; 14 + (get-best-hand-point (_type_ vector vector int) float) ;; 15 + (find-grabbable-edges (_type_) none) ;; 16 + (find-grabbable-tris (_type_) none) ;; 17 ;; (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol) ;; 17 + (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol) ;; 18 + (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol) ;; 19 + (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol) ;; 20 ) ) @@ -18163,13 +18150,13 @@ (:methods (get-trans "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (_type_ int) vector 20) - (get-quat (_type_ int) quaternion 21) - (get-transv (_type_) vector 22) - (time-to-apex-or-ground (_type_ int) int 23) - (get-water-height (_type_) meters 24) - (get-notice-time (_type_) time-frame 25) - (get-inv-mass (_type_) float 26) + (_type_ int) vector) ;; 20 + (get-quat (_type_ int) quaternion) ;; 21 + (get-transv (_type_) vector) ;; 22 + (time-to-apex-or-ground (_type_ int) int) ;; 23 + (get-water-height (_type_) meters) ;; 24 + (get-notice-time (_type_) time-frame) ;; 25 + (get-inv-mass (_type_) float) ;; 26 ) ) @@ -18197,23 +18184,25 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 + (:state-methods + hide + idle + (active game-task-event) + (play-game game-task-event) + ) (:methods - (hide () _type_ :state 27) ;; (play-anim () _type_ :state 27) - (idle () _type_ :state 28) ;; (hidden () _type_ :state 28) - (active (game-task-event) _type_ :state 29) ;; (be-clone (handle) _type_ :state 29) - (play-game (game-task-event) _type_ :state 30) ;; (idle () _type_ :state 30) - (process-taskable-method-31 (_type_) none 31) ;; (get-art-elem (_type_) art-element 31) - (process-taskable-method-32 (_type_) none 32) ;; (play-anim! (_type_ symbol) basic 32) + (process-taskable-method-31 (_type_) none) ;; 31 ;; (get-art-elem (_type_) art-element) ;; 31 + (process-taskable-method-32 (_type_) none) ;; 32 ;; (play-anim! (_type_ symbol) basic) ;; 32 (init-art! "@see [[initialize-skeleton]]" - (_type_) none 33) ;; (dummy-33 (_type_) none 33) - (process-taskable-method-34 (_type_) symbol 34) ;; (get-accept-anim (_type_ symbol) spool-anim 34) + (_type_) none) ;; 33 ;; (dummy-33 (_type_) none) ;; 33 + (process-taskable-method-34 (_type_) symbol) ;; 34 ;; (get-accept-anim (_type_ symbol) spool-anim) ;; 34 (get-art-elem "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (_type_) art-element 35) ;; TODO - is it always an art-joint-anim? - (process-taskable-method-36 (_type_) none 36) ;; (get-reject-anim (_type_ symbol) spool-anim 36) - (process-taskable-method-37 (_type_) none 37) ;; (push-reject-anim (_type_) none 37) + (_type_) art-element) ;; 35 ;; TODO - is it always an art-joint-anim? + (process-taskable-method-36 (_type_) none) ;; 36 ;; (get-reject-anim (_type_ symbol) spool-anim) ;; 36 + (process-taskable-method-37 (_type_) none) ;; 37 ;; (push-reject-anim (_type_) none) ;; 37 ) ) @@ -18233,10 +18222,10 @@ :size-assert #xc :flag-assert #xd0000000c (:methods - (clear-focused (_type_) none 9) - (collide-check? (_type_ process-focusable) object 10) - (reset-to-collide-spec (_type_ collide-spec) none 11) - (try-update-focus (_type_ process-focusable) symbol 12) + (clear-focused (_type_) none) ;; 9 + (collide-check? (_type_ process-focusable) object) ;; 10 + (reset-to-collide-spec (_type_ collide-spec) none) ;; 11 + (try-update-focus (_type_ process-focusable) symbol) ;; 12 ) ) @@ -18303,13 +18292,13 @@ :size-assert #x24 :flag-assert #xf00000024 (:methods - (new (symbol type process-drawable) _type_ 0) - (update-effects (_type_) none 9) - (do-effect (_type_ symbol float int) none 10) - (do-effect-for-surface (_type_ symbol float int basic pat-surface) none 11) - (play-effect-sound (_type_ symbol float int basic sound-name) int 12) - (set-channel-offset! (_type_ int) none 13) - (play-effects-from-res-lump (_type_ float float float) none 14) + (new (symbol type process-drawable) _type_) ;; 0 + (update-effects (_type_) none) ;; 9 + (do-effect (_type_ symbol float int) none) ;; 10 + (do-effect-for-surface (_type_ symbol float int basic pat-surface) none) ;; 11 + (play-effect-sound (_type_ symbol float int basic sound-name) int) ;; 12 + (set-channel-offset! (_type_ int) none) ;; 13 + (play-effects-from-res-lump (_type_ float float float) none) ;; 14 ) ) @@ -18348,8 +18337,6 @@ :method-count-assert 17 :size-assert #x20 :flag-assert #x1100000020 - (:methods - ) ) (deftype drawable-inline-array-collide-fragment (drawable-inline-array) @@ -18359,8 +18346,6 @@ :method-count-assert 17 :size-assert #x44 :flag-assert #x1100000044 - (:methods - ) ) (deftype drawable-tree-collide-fragment (drawable-tree) @@ -18449,8 +18434,6 @@ :method-count-assert 17 :size-assert #x70 :flag-assert #x1100000070 - (:methods - ) ) (deftype collide-hash-fragment-array (array) @@ -18478,8 +18461,6 @@ :method-count-assert 17 :size-assert #x60 :flag-assert #x1100000060 - (:methods - ) ) (define-extern *collide-list-boxes* object) @@ -18532,15 +18513,15 @@ :size-assert #x570 :flag-assert #x1200000570 (:methods - (initialize-chain-joints (_type_) symbol 9) - (turn-off (_type_ time-frame) none :behavior process 10) - (update (_type_ process-drawable) none :behavior process 11) - (gravity-update (_type_ process-drawable) none 12) - (apply-gravity (_type_ vector int process-drawable) none :behavior process 13) - (chain-physics-method-14 (_type_ vector int) none 14) - (clamp-length (_type_ vector vector object process-drawable) vector 15) - (chain-physics-method-16 (_type_ int) float 16) - (chain-physics-method-17 (_type_ vector int) none 17) + (initialize-chain-joints (_type_) symbol) ;; 9 + (turn-off (_type_ time-frame) none :behavior process) ;; 10 + (update (_type_ process-drawable) none :behavior process) ;; 11 + (gravity-update (_type_ process-drawable) none) ;; 12 + (apply-gravity (_type_ vector int process-drawable) none :behavior process) ;; 13 + (chain-physics-method-14 (_type_ vector int) none) ;; 14 + (clamp-length (_type_ vector vector object process-drawable) vector) ;; 15 + (chain-physics-method-16 (_type_ int) float) ;; 16 + (chain-physics-method-17 (_type_ vector int) none) ;; 17 ) ) @@ -18599,52 +18580,54 @@ :method-count-assert 40 :size-assert #x1d8 :flag-assert #x28016001d8 + (:state-methods + die + dissipate + impact + moving + ) (:methods - (die () _type_ :state 20) - (dissipate () _type_ :state 21) - (impact () _type_ :state 22) - (moving () _type_ :state 23) (draw-laser-sight "TODO - confirm If applicable, draw the laser sight particles" - (_type_) none 24) + (_type_) none) ;; 24 (spawn-impact-particles "Spawns associated particles with the projectile if applicable" - (_type_) none 25) - (spawn-shell-particles "TODO - confirm" (_type_) none 26) - (unknown-particles "TODO - confirm" (_type_) none 27) - (play-impact-sound (_type_ projectile-options) none 28) + (_type_) none) ;; 25 + (spawn-shell-particles "TODO - confirm" (_type_) none) ;; 26 + (unknown-particles "TODO - confirm" (_type_) none) ;; 27 + (play-impact-sound (_type_ projectile-options) none) ;; 28 (stop-sound! "Stops the current `sound-id` if set, re-init the `sound-id` after being stopped" - (_type_) none 29) + (_type_) none) ;; 29 (init-proj-collision! "Init the [[projectile]]'s [[collide-shape]]" - (_type_) none 30) + (_type_) none) ;; 30 (init-proj-settings! "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (_type_) none 31) - (go-moving! (_type_) none 32) - (go-sitting! (_type_) none 33) + (_type_) none) ;; 31 + (go-moving! (_type_) none) ;; 32 + (go-sitting! (_type_) none) ;; 33 (kill-projectile! "Transition to the [[projectile::impact]] state, always return [[#t]]" - (_type_) symbol 34) + (_type_) symbol) ;; 34 (event-handler! "Multiplex the projectile's event processing, called by [[projectile-event-handler]]" - (_type_ process int symbol event-message-block) object 35) + (_type_ process int symbol event-message-block) object) ;; 35 (handle-proj-hit! "When a projectile hits something, first deal damage via [[projectile::37]] and increment the projectiles hit count. If we've met or exceeded the projectiles maximum allowed hits, switch to the [[projectile::impact]] state" - (_type_ process event-message-block) object 36) + (_type_ process event-message-block) object) ;; 36 (deal-damage! "Constructs an [[attack-info]] according to the projectile's `options`" - (_type_ process event-message-block) symbol 37) + (_type_ process event-message-block) symbol) ;; 37 (made-impact? "TODO - queries the collision cache, return true/false" - (_type_) symbol 38) + (_type_) symbol) ;; 38 (play-impact-sound! "Plays impact sound" - (_type_) none :behavior projectile 39) + (_type_) none :behavior projectile) ;; 39 ) ) @@ -18673,9 +18656,11 @@ :method-count-assert 42 :size-assert #x1f0 :flag-assert #x2a017001f0 + (:state-methods + sitting + ) (:methods - (sitting () _type_ :state 40) - (noop "Does nothing" (_type_) none 41) + (noop "Does nothing" (_type_) none) ;; 41 ) ) @@ -18790,8 +18775,8 @@ :flag-assert #x1d084008b8 ;; field mode-param2 uses ~A with a 64-bit load field mode-param3 uses ~A with a 64-bit load (:methods - (do-edge-grabs (_type_ collide-cache collide-edge-spec) none 27) - (init-target (_type_ continue-point symbol) none :behavior target 28) + (do-edge-grabs (_type_ collide-cache collide-edge-spec) none) ;; 27 + (init-target (_type_ continue-point symbol) none :behavior target) ;; 28 ) (:states (target-attack-air symbol) @@ -18965,8 +18950,6 @@ :method-count-assert 20 :size-assert #x124 :flag-assert #x1400b00124 - (:methods - ) (:states sidekick-clone) ) @@ -19021,11 +19004,11 @@ :flag-assert #xe00000034 :pack-me (:methods - (perf-stat-method-9 () none 9) ;; (dummy-9 (_type_) none 9) - (print-to-stream (_type_ string basic) none 10) - (reset! (_type_) none 11) - (read! (_type_) none 12) - (update-wait-stats (_type_ uint uint uint) none 13) + (perf-stat-method-9 () none) ;; 9 ;; (dummy-9 (_type_) none) ;; 9 + (print-to-stream (_type_ string basic) none) ;; 10 + (reset! (_type_) none) ;; 11 + (read! (_type_) none) ;; 12 + (update-wait-stats (_type_ uint uint uint) none) ;; 13 ) ) @@ -19227,8 +19210,8 @@ :flag-assert #x1300000190 ;; Failed to read fields. (:methods - (birth (_type_) none 17) - (deactivate-entities (_type_) none 18) + (birth (_type_) none) ;; 17 + (deactivate-entities (_type_) none) ;; 18 ) ) @@ -19280,8 +19263,8 @@ :size-assert #xc60 :flag-assert #xb00000c60 (:methods - (collide-puss-work-method-9 () none 9) ;; (dummy-9 (_type_ object object) symbol 9) - (collide-puss-work-method-10 () none 10) ;; (dummy-10 (_type_ object object) symbol 10) + (collide-puss-work-method-9 () none) ;; 9 ;; (dummy-9 (_type_ object object) symbol) ;; 9 + (collide-puss-work-method-10 () none) ;; 10 ;; (dummy-10 (_type_ object object) symbol) ;; 10 ) ) @@ -19317,8 +19300,8 @@ :size-assert #x30 :flag-assert #xb00000030 (:methods - (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float 9) - (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float 10) + (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float) ;; 9 + (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float) ;; 10 ) ) @@ -19344,23 +19327,23 @@ :size-assert #x8670 :flag-assert #x1a00008670 (:methods - (debug-draw (_type_) none 9) - (fill-and-probe-using-line-sphere (_type_ collide-query) float 10) - (fill-and-probe-using-spheres (_type_ collide-query) symbol 11) - (fill-using-bounding-box (_type_ collide-query) none 12) ;; (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float 12) - (fill-using-line-sphere (_type_ collide-query) none 13) ;; (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none 13) - (fill-using-spheres (_type_ collide-query) none 14) - (reset (_type_) none 15) - (probe-using-line-sphere (_type_ collide-query) float 16) ;; (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none 16) - (probe-using-spheres (_type_ collide-query) symbol 17) ;; (initialize (_type_) none 17) - (fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none 18) ;; (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float 18) - (fill-from-fg-boxes (_type_) none 19) ;; (probe-using-spheres (_type_ collide-using-spheres-params) symbol 19) - (fill-from-fg-line-sphere (_type_ collide-query) none 20) ;; (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20) - (fill-from-water (_type_ water-control) none 21) ;; (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21) - (collide-cache-method-22 () none 22) ;; (fill-from-foreground-using-box (_type_) none 22) - (collide-cache-method-23 () none 23) ;; (fill-from-foreground-using-line-sphere (_type_) none 23) - (collide-cache-method-24 () none 24) ;; (fill-from-foreground-using-y-probe (_type_) none 24) - (collide-cache-method-25 () none 25) ;; (fill-from-water (_type_ water-control) none 25) + (debug-draw (_type_) none) ;; 9 + (fill-and-probe-using-line-sphere (_type_ collide-query) float) ;; 10 + (fill-and-probe-using-spheres (_type_ collide-query) symbol) ;; 11 + (fill-using-bounding-box (_type_ collide-query) none) ;; 12 ;; (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float) ;; 12 + (fill-using-line-sphere (_type_ collide-query) none) ;; 13 ;; (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none) ;; 13 + (fill-using-spheres (_type_ collide-query) none) ;; 14 + (reset (_type_) none) ;; 15 + (probe-using-line-sphere (_type_ collide-query) float) ;; 16 ;; (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none) ;; 16 + (probe-using-spheres (_type_ collide-query) symbol) ;; 17 ;; (initialize (_type_) none) ;; 17 + (fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none) ;; 18 ;; (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float) ;; 18 + (fill-from-fg-boxes (_type_) none) ;; 19 ;; (probe-using-spheres (_type_ collide-using-spheres-params) symbol) ;; 19 + (fill-from-fg-line-sphere (_type_ collide-query) none) ;; 20 ;; (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float) ;; 20 + (fill-from-water (_type_ water-control) none) ;; 21 ;; (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none) ;; 21 + (collide-cache-method-22 () none) ;; 22 ;; (fill-from-foreground-using-box (_type_) none) ;; 22 + (collide-cache-method-23 () none) ;; 23 ;; (fill-from-foreground-using-line-sphere (_type_) none) ;; 23 + (collide-cache-method-24 () none) ;; 24 ;; (fill-from-foreground-using-y-probe (_type_) none) ;; 24 + (collide-cache-method-25 () none) ;; 25 ;; (fill-from-water (_type_ water-control) none) ;; 25 ) ) @@ -19482,8 +19465,6 @@ :method-count-assert 17 :size-assert #x70 :flag-assert #x1100000070 - (:methods - ) ) (deftype shrub-view-data (structure) @@ -19528,8 +19509,6 @@ :method-count-assert 17 :size-assert #x20 :flag-assert #x1100000020 - (:methods - ) ) (deftype instance-shrubbery (instance) @@ -19540,8 +19519,6 @@ :method-count-assert 17 :size-assert #x50 :flag-assert #x1100000050 - (:methods - ) ) (deftype drawable-inline-array-instance-shrub (drawable-inline-array) @@ -19573,8 +19550,6 @@ :method-count-assert 17 :size-assert #x20 :flag-assert #x1100000020 - (:methods - ) ) @@ -19586,8 +19561,6 @@ :size-assert #x44 :flag-assert #x1100000044 ;; Failed to read fields. - (:methods - ) ) (deftype prototype-trans-shrubbery (prototype-shrubbery) @@ -19749,8 +19722,6 @@ :method-count-assert 17 :size-assert #x40 :flag-assert #x1100000040 - (:methods - ) ) (deftype instance-tie (instance) @@ -19762,8 +19733,6 @@ :method-count-assert 17 :size-assert #x40 :flag-assert #x1100000040 - (:methods - ) ) (deftype drawable-inline-array-instance-tie (drawable-inline-array) @@ -19774,8 +19743,6 @@ :size-assert #x64 :flag-assert #x1100000064 ;; Failed to read fields. - (:methods - ) ) (deftype drawable-tree-instance-tie (drawable-tree) @@ -19785,8 +19752,6 @@ :size-assert #x20 :flag-assert #x1100000020 ;; Failed to read fields. - (:methods - ) ) (deftype prototype-tie (drawable-inline-array) @@ -19797,8 +19762,6 @@ :size-assert #x64 :flag-assert #x1100000064 ;; Failed to read fields. - (:methods - ) ) @@ -20110,8 +20073,6 @@ :method-count-assert 17 :size-assert #x40 :flag-assert #x1100000040 - (:methods - ) ) (deftype drawable-inline-array-tfrag (drawable-inline-array) @@ -20121,8 +20082,6 @@ :size-assert #x64 :flag-assert #x1100000064 ;; Failed to read fields. - (:methods - ) ) (deftype drawable-inline-array-tfrag-trans (drawable-inline-array-tfrag) @@ -20455,28 +20414,28 @@ @param region-sphere Defines the region in question @returns nothing" - (_type_ drawable-region-sphere) none 9) + (_type_ drawable-region-sphere) none) ;; 9 (track-exited-region! "Enumerates through the objects `region-exit-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-exit-prim-list` and increment `region-exit-count` @param region-sphere Defines the region in question @returns nothing" - (_type_ drawable-region-sphere) none 10) + (_type_ drawable-region-sphere) none) ;; 10 (track-inside-region! "Enumerates through the objects `region-inside-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-inside-prim-list` and increment `region-inside-count` @param region-sphere Defines the region in question @returns nothing" - (_type_ drawable-region-sphere) none 11) + (_type_ drawable-region-sphere) none) ;; 11 (track-start-region! "Enumerates through the objects `region-start-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and increment `region-start-count` @param region-sphere Defines the region in question @returns nothing" - (_type_ drawable-region-sphere) none 12) + (_type_ drawable-region-sphere) none) ;; 12 ) ) @@ -20553,7 +20512,7 @@ :size-assert #x10 :flag-assert #xa00000010 (:methods - (update (_type_ symbol entity-perm-status) _type_ 9) + (update (_type_ symbol entity-perm-status) _type_) ;; 9 ) ) @@ -20578,7 +20537,7 @@ :flag-assert #xa00000040 ;; Failed to read fields. (:methods - (birth? (_type_ vector) symbol 9) + (birth? (_type_ vector) symbol) ;; 9 ) ) @@ -20608,11 +20567,11 @@ :flag-assert #x1b00000034 ;; Failed to read fields. (:methods - (birth! (_type_) _type_ 22) - (kill! (_type_) _type_ 23) - (add-to-level! (_type_ level-group level actor-id) none 24) - (remove-from-level! (_type_ level-group) _type_ 25) - (get-level (_type_) level 26) + (birth! (_type_) _type_) ;; 22 + (kill! (_type_) _type_) ;; 23 + (add-to-level! (_type_ level-group level actor-id) none) ;; 24 + (remove-from-level! (_type_ level-group) _type_) ;; 25 + (get-level (_type_) level) ;; 26 ) ) @@ -20628,8 +20587,8 @@ :size-assert #x38 :flag-assert #x1d00000038 (:methods - (initialize-nav-mesh! "Initialize the nav-mesh in this entity." (_type_) none 27) - (debug-draw (_type_) none 28) + (initialize-nav-mesh! "Initialize the nav-mesh in this entity." (_type_) none) ;; 27 + (debug-draw (_type_) none) ;; 28 ) ) @@ -20639,8 +20598,8 @@ ) :flag-assert #x1d00000038 (:methods - (entity-race-mesh-method-27 () none 27) - (entity-race-mesh-method-28 () none 28) + (entity-race-mesh-method-27 () none) ;; 27 + (entity-race-mesh-method-28 () none) ;; 28 ) ) @@ -20658,12 +20617,12 @@ :flag-assert #x2100000050 ;; Failed to read fields. (:methods - (next-actor (_type_) entity-actor 27) - (prev-actor (_type_) entity-actor 28) - (debug-print (_type_ symbol type) none 29) - (toggle-status (_type_ entity-perm-status symbol) none 30) - (get-simple-travel-vector (_type_ vector vector vector object float) nav-mesh 31) - (project-point-to-nav-mesh (_type_ vector vector nav-poly float) nav-poly 32) + (next-actor (_type_) entity-actor) ;; 27 + (prev-actor (_type_) entity-actor) ;; 28 + (debug-print (_type_ symbol type) none) ;; 29 + (toggle-status (_type_ entity-perm-status symbol) none) ;; 30 + (get-simple-travel-vector (_type_ vector vector vector object float) nav-mesh) ;; 31 + (project-point-to-nav-mesh (_type_ vector vector nav-poly float) nav-poly) ;; 32 ) ) @@ -20752,7 +20711,7 @@ (data uint128 1 :offset-assert 96) ;; guessed by decompiler ) (:methods - (new (symbol type int int) _type_ 0) + (new (symbol type int int) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x70 @@ -20793,7 +20752,7 @@ (data uint128 1 :offset-assert 32) ;; guessed by decompiler ) (:methods - (new (symbol type int int) _type_ 0) + (new (symbol type int int) _type_) ;; 0 ) :method-count-assert 9 :size-assert #x30 @@ -20823,7 +20782,7 @@ :size-assert #x40 :flag-assert #xa00000040 (:methods - (set-trans (_type_ vector) none 9) + (set-trans (_type_ vector) none) ;; 9 ) ) @@ -20836,9 +20795,9 @@ :size-assert #x8 :flag-assert #xc00000008 (:methods - (add! (_type_ sprite-glow-data) none 9) - (draw-all-sprites! (_type_ dma-buffer) none 10) - (clear! (_type_) none 11) + (add! (_type_ sprite-glow-data) none) ;; 9 + (draw-all-sprites! (_type_ dma-buffer) none) ;; 10 + (clear! (_type_) none) ;; 11 ) ) @@ -21094,8 +21053,8 @@ (:methods (get-field-spec-by-id "Returns the [[sp-field-init-spec]] that has the matching [[sp-field-id]]" - (_type_ sp-field-id) sp-field-init-spec 9) - (setup-user-array (_type_ string) none 10) + (_type_ sp-field-id) sp-field-init-spec) ;; 9 + (setup-user-array (_type_ string) none) ;; 10 ) ) @@ -21158,7 +21117,7 @@ :size-assert #x40 :flag-assert #xa00000040 (:methods - (create-launch-control (_type_ process) sparticle-launch-control 9) ;; + (create-launch-control (_type_ process) sparticle-launch-control) ;; 9 ;; ) ) @@ -21180,13 +21139,13 @@ :size-assert #x70 :flag-assert #x1000000070 (:methods - (initialize (_type_ sparticle-launch-group process) none 9) - (is-visible? (_type_ vector) symbol 10) - (spawn (_type_ vector) none 11) ;; TODO - CFG ;; (spawn (_type_ vector) object 11) - (spawn-with-matrix (_type_ matrix) none 12) - (spawn-with-cspace (_type_ cspace) none 13) - (kill-and-free-particles (_type_) none 14) - (kill-particles (_type_) none 15) + (initialize (_type_ sparticle-launch-group process) none) ;; 9 + (is-visible? (_type_ vector) symbol) ;; 10 + (spawn (_type_ vector) none) ;; 11 ;; TODO - CFG ;; (spawn (_type_ vector) object) ;; 11 + (spawn-with-matrix (_type_ matrix) none) ;; 12 + (spawn-with-cspace (_type_ cspace) none) ;; 13 + (kill-and-free-particles (_type_) none) ;; 14 + (kill-particles (_type_) none) ;; 15 ) ) @@ -21312,7 +21271,8 @@ :size-assert #x34 :flag-assert #x900000034 (:methods - (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_ 0)) + (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_) ;; 0 + ) ) (define-extern *sp-60-hz* symbol) @@ -21330,24 +21290,24 @@ :size-assert #x10 :flag-assert #x1a00000010 (:methods - (new (symbol type process symbol) _type_ 0) - (get-matching-actor-type-mask (_type_ type) int 9) - (actor-count-before (_type_) int 10) - (link-to-next-and-prev-actor (_type_) actor-link-info 11) - (get-next (_type_) entity-actor 12) - (get-prev (_type_) entity-actor 13) - (get-next-process (_type_) process 14) - (get-prev-process (_type_) process 15) - (apply-function-forward (_type_ (function entity-actor object object) object) int 16) - (apply-function-reverse (_type_ (function entity-actor object object) object) int 17) - (apply-all (_type_ (function entity-actor object object) object) int 18) - (send-to-all (_type_ symbol) none 19) - (send-to-all-after (_type_ symbol) object 20) - (send-to-all-before (_type_ symbol) object 21) - (send-to-next-and-prev (_type_ symbol) none 22) - (send-to-next (_type_ symbol) none 23) - (send-to-prev (_type_ symbol) none 24) - (actor-count (_type_) int 25) + (new (symbol type process symbol) _type_) ;; 0 + (get-matching-actor-type-mask (_type_ type) int) ;; 9 + (actor-count-before (_type_) int) ;; 10 + (link-to-next-and-prev-actor (_type_) actor-link-info) ;; 11 + (get-next (_type_) entity-actor) ;; 12 + (get-prev (_type_) entity-actor) ;; 13 + (get-next-process (_type_) process) ;; 14 + (get-prev-process (_type_) process) ;; 15 + (apply-function-forward (_type_ (function entity-actor object object) object) int) ;; 16 + (apply-function-reverse (_type_ (function entity-actor object object) object) int) ;; 17 + (apply-all (_type_ (function entity-actor object object) object) int) ;; 18 + (send-to-all (_type_ symbol) none) ;; 19 + (send-to-all-after (_type_ symbol) object) ;; 20 + (send-to-all-before (_type_ symbol) object) ;; 21 + (send-to-next-and-prev (_type_ symbol) none) ;; 22 + (send-to-next (_type_ symbol) none) ;; 23 + (send-to-prev (_type_ symbol) none) ;; 24 + (actor-count (_type_) int) ;; 25 ) ) @@ -21390,8 +21350,8 @@ :size-assert #x30 :flag-assert #xb00000030 (:methods - (cam-index-method-9 (_type_ symbol entity vector curve) symbol 9) - (cam-index-method-10 (_type_ vector) float 10) + (cam-index-method-9 (_type_ symbol entity vector curve) symbol) ;; 9 + (cam-index-method-10 (_type_ vector) float) ;; 10 ) ) @@ -21436,21 +21396,21 @@ :size-assert #x664 :flag-assert #x1800000664 (:methods - (tracking-spline-method-9 (_type_) none 9) - (tracking-spline-method-10 (_type_ vector) none 10) - (debug-point-info (_type_ int) none 11) - (debug-all-points (_type_) none 12) - (tracking-spline-method-13 (_type_ int) none 13) - (tracking-spline-method-14 (_type_ tracking-spline-sampler) none 14) - (tracking-spline-method-15 (_type_) none 15) - (tracking-spline-method-16 (_type_ float) none 16) - (tracking-spline-method-17 (_type_ vector float float symbol) int 17) - (tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector 18) - (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector 19) - (tracking-spline-method-20 (_type_ vector int) none 20) - (tracking-spline-method-21 (_type_ vector float float float) vector 21) - (tracking-spline-method-22 (_type_ float) symbol 22) ;; TODO - probably wrong! - (debug-draw-spline (_type_) none 23) + (tracking-spline-method-9 (_type_) none) ;; 9 + (tracking-spline-method-10 (_type_ vector) none) ;; 10 + (debug-point-info (_type_ int) none) ;; 11 + (debug-all-points (_type_) none) ;; 12 + (tracking-spline-method-13 (_type_ int) none) ;; 13 + (tracking-spline-method-14 (_type_ tracking-spline-sampler) none) ;; 14 + (tracking-spline-method-15 (_type_) none) ;; 15 + (tracking-spline-method-16 (_type_ float) none) ;; 16 + (tracking-spline-method-17 (_type_ vector float float symbol) int) ;; 17 + (tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector) ;; 18 + (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector) ;; 19 + (tracking-spline-method-20 (_type_ vector int) none) ;; 20 + (tracking-spline-method-21 (_type_ vector float float float) vector) ;; 21 + (tracking-spline-method-22 (_type_ float) symbol) ;; 22 ;; TODO - probably wrong! + (debug-draw-spline (_type_) none) ;; 23 ) ) @@ -21467,10 +21427,10 @@ :size-assert #x18 :flag-assert #xd00000018 (:methods - (init (_type_ float float float float) none 9) - (copy-to (_type_ _type_) none 10) - (update! (_type_ float) none 11) - (jump-to-target! (_type_ float) float 12) + (init (_type_ float float float float) none) ;; 9 + (copy-to (_type_ _type_) none) ;; 10 + (update! (_type_ float) none) ;; 11 + (jump-to-target! (_type_ float) float) ;; 12 ) ) @@ -21486,8 +21446,8 @@ :size-assert #x3c :flag-assert #xb0000003c (:methods - (init (_type_ vector float float float) none 9) - (update! (_type_ vector) none 10) + (init (_type_ vector float float float) none) ;; 9 + (update! (_type_ vector) none) ;; 10 ) ) @@ -21671,9 +21631,9 @@ :size-assert #x924 :flag-assert #x1108b00924 (:methods - (camera-master-method-14 (_type_ vector) vector 14) - (camera-master-method-15 (_type_ vector) vector 15) - (camera-master-method-16 (_type_ symbol) int 16) + (camera-master-method-14 (_type_ vector) vector) ;; 14 + (camera-master-method-15 (_type_ vector) vector) ;; 15 + (camera-master-method-16 (_type_ symbol) int) ;; 16 ) (:states cam-master-active) @@ -21765,8 +21725,8 @@ :size-assert #x34 :flag-assert #xb00000034 (:methods - (draw (_type_ dma-buffer level) none 9) - (hud-sprite-method-10 (_type_ dma-buffer level int int int int) object 10) + (draw (_type_ dma-buffer level) none) ;; 9 + (hud-sprite-method-10 (_type_ dma-buffer level int int int int) object) ;; 10 ) ) @@ -21779,13 +21739,13 @@ :size-assert #x20 :flag-assert #x1000000020 (:methods - (draw-box-prim-only (_type_ dma-buffer) none 9) - (draw-box-alpha-1 (_type_ dma-buffer) none 10) - (draw-box-alpha-2 (_type_ dma-buffer) none 11) - (draw-box-alpha-3 (_type_ dma-buffer) none 12) - (draw-scan-and-line (_type_ dma-buffer float) int 13) - (setup-scissor (_type_ dma-buffer) none 14) - (restore-scissor (_type_ dma-buffer) none 15) + (draw-box-prim-only (_type_ dma-buffer) none) ;; 9 + (draw-box-alpha-1 (_type_ dma-buffer) none) ;; 10 + (draw-box-alpha-2 (_type_ dma-buffer) none) ;; 11 + (draw-box-alpha-3 (_type_ dma-buffer) none) ;; 12 + (draw-scan-and-line (_type_ dma-buffer float) int) ;; 13 + (setup-scissor (_type_ dma-buffer) none) ;; 14 + (restore-scissor (_type_ dma-buffer) none) ;; 15 ) ) @@ -21837,19 +21797,19 @@ :size-assert #xba4 :flag-assert #x1b0b300ba4 (:methods - (hidden? (_type_) symbol 14) ;; (hidden? (_type_) symbol 14) - (draw (_type_) none 15) ;; (draw-hud (_type_) none 15) - (update-values (_type_) none 16) ;; (tally-value (_type_ int int) none 16) - (init-callback (_type_) none 17) ;; (draw-icons (_type_) none 17) - (event-callback (_type_ process int symbol event-message-block) symbol 18) ;; (draw-particles (_type_) none 18) - (hud-method-19 (_type_) none 19) ;; (hud-update (_type_) none 19) - (hud-method-20 (_type_) none 20) ;; (init-particles! (_type_ int) none 20) - (hud-method-21 (_type_) none 21) ;; (get-icon-pos-x (_type_) int 21) - (hud-method-22 (_type_) none 22) ;; (get-icon-pos-y (_type_) int 22) - (hud-method-23 (_type_) none 23) ;; (dummy-23 (_type_) none 23) - (check-ready-and-maybe-show "Is this element ready to be shown? If arg0 is set, show it now." (_type_ symbol) symbol 24) - (update-value-callback (_type_ int int) none 25) ;; (get-icon-scale-x (_type_) float 25) - (alloc-string-if-needed (_type_ int) none 26) ;; (get-icon-scale-y (_type_) float 26) + (hidden? (_type_) symbol) ;; 14 ;; (hidden? (_type_) symbol) ;; 14 + (draw (_type_) none) ;; 15 ;; (draw-hud (_type_) none) ;; 15 + (update-values (_type_) none) ;; 16 ;; (tally-value (_type_ int int) none) ;; 16 + (init-callback (_type_) none) ;; 17 ;; (draw-icons (_type_) none) ;; 17 + (event-callback (_type_ process int symbol event-message-block) symbol) ;; 18 ;; (draw-particles (_type_) none) ;; 18 + (hud-method-19 (_type_) none) ;; 19 ;; (hud-update (_type_) none) ;; 19 + (hud-method-20 (_type_) none) ;; 20 ;; (init-particles! (_type_ int) none) ;; 20 + (hud-method-21 (_type_) none) ;; 21 ;; (get-icon-pos-x (_type_) int) ;; 21 + (hud-method-22 (_type_) none) ;; 22 ;; (get-icon-pos-y (_type_) int) ;; 22 + (hud-method-23 (_type_) none) ;; 23 ;; (dummy-23 (_type_) none) ;; 23 + (check-ready-and-maybe-show "Is this element ready to be shown? If arg0 is set, show it now." (_type_ symbol) symbol) ;; 24 + (update-value-callback (_type_ int int) none) ;; 25 ;; (get-icon-scale-x (_type_) float) ;; 25 + (alloc-string-if-needed (_type_ int) none) ;; 26 ;; (get-icon-scale-y (_type_) float) ;; 26 ) (:states hud-arriving @@ -21870,8 +21830,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-cargo (hud) @@ -21879,8 +21837,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-citizen (hud) @@ -21888,8 +21844,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-cpanel (hud) @@ -21897,8 +21851,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-dig-clasp (hud) @@ -21906,8 +21858,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-gun (hud) @@ -21915,8 +21865,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-health (hud) @@ -21924,8 +21872,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-dark-eco-symbol (hud) @@ -21933,8 +21879,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-helldog (hud) @@ -21942,8 +21886,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-lurker (hud) @@ -21951,8 +21893,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-map (hud) @@ -21960,8 +21900,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-moneybag (hud) @@ -21969,8 +21907,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-pegasus (hud) @@ -21978,8 +21914,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-plasmite (hud) @@ -21987,8 +21921,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-dig-button (hud) @@ -21996,8 +21928,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-predator (hud) @@ -22005,8 +21935,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-heatmeter (hud) @@ -22014,8 +21942,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-progress (hud) @@ -22023,8 +21949,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-rocketsensor (hud) @@ -22032,8 +21956,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-ruffians (hud) @@ -22041,8 +21963,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-score (hud) @@ -22050,8 +21970,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-sig (hud) @@ -22059,8 +21977,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-skill (hud) @@ -22068,8 +21984,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-skullgem (hud) @@ -22077,8 +21991,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-timer (hud) @@ -22086,8 +21998,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-turret (hud) @@ -22095,8 +22005,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-squid (hud) @@ -22104,8 +22012,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-gunturret (hud) @@ -22113,8 +22019,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-gruntegg (hud) @@ -22122,8 +22026,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-crimsonhover (hud) @@ -22131,8 +22033,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-metalkor (hud) @@ -22140,8 +22040,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-big-score (hud) @@ -22149,8 +22047,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-goal (hud) @@ -22158,8 +22054,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-miss (hud) @@ -22167,8 +22061,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-race-timer (hud) @@ -22176,8 +22068,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-race-lap-counter (hud) @@ -22185,8 +22075,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-race-turbo-counter (hud) @@ -22194,8 +22082,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-race-position (hud) @@ -22203,8 +22089,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-race-map (hud) @@ -22212,8 +22096,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-samos-old (hud) @@ -22221,8 +22103,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-samos-young (hud) @@ -22230,8 +22110,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-lurker-button (hud) @@ -22239,8 +22117,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-widow (hud) @@ -22248,8 +22124,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-race-final-stats (hud) @@ -22257,8 +22131,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-mech-air-tank (hud) @@ -22266,8 +22138,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-homing-beacon (hud) @@ -22275,8 +22145,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-dark-eco-pickup (hud) @@ -22284,8 +22152,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) (deftype hud-green-eco-pickup (hud) @@ -22293,8 +22159,6 @@ :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 - (:methods - ) ) @@ -22335,20 +22199,22 @@ :method-count-assert 33 :size-assert #x164 :flag-assert #x2100f00164 + (:state-methods + come-in + idle + go-away + gone + ) (:methods - (come-in () _type_ :state 20) - (idle () _type_ :state 21) - (go-away () _type_ :state 22) - (gone () _type_ :state 23) - (init-defaults "Initialize default menu settings." (_type_) object 24) - (respond-to-cpad (_type_) none 25) - (gone? (_type_) object 26) - (can-go-back? (_type_) symbol 27) - (get-state-check-card (_type_ symbol) symbol 28) - (push-state (_type_) int 29) - (pop-state (_type_) int 30) - (set-next-state "Set the next menu state specified by arg0 at the index specified by arg1." (_type_ symbol int) int 31) - (set-menu-options "Set the menu options for the menu state specified by arg0." (_type_ symbol) int 32) + (init-defaults "Initialize default menu settings." (_type_) object) ;; 24 + (respond-to-cpad (_type_) none) ;; 25 + (gone? (_type_) object) ;; 26 + (can-go-back? (_type_) symbol) ;; 27 + (get-state-check-card (_type_ symbol) symbol) ;; 28 + (push-state (_type_) int) ;; 29 + (pop-state (_type_) int) ;; 30 + (set-next-state "Set the next menu state specified by arg0 at the index specified by arg1." (_type_ symbol int) int) ;; 31 + (set-menu-options "Set the menu options for the menu state specified by arg0." (_type_ symbol) int) ;; 32 ) ) @@ -22367,9 +22233,9 @@ :size-assert #x30 :flag-assert #xc00000030 (:methods - (respond-progress "Handle progress menu navigation logic." (_type_ progress symbol) int :behavior progress 9) - (draw-option (_type_ progress font-context int symbol) none 10) - (menu-option-method-11 () none 11) + (respond-progress "Handle progress menu navigation logic." (_type_ progress symbol) int :behavior progress) ;; 9 + (draw-option (_type_ progress font-context int symbol) none) ;; 10 + (menu-option-method-11 () none) ;; 11 ) ) @@ -22379,8 +22245,6 @@ :method-count-assert 12 :size-assert #x34 :flag-assert #xc00000034 - (:methods - ) ) (deftype menu-yes-no-option (menu-option) @@ -22389,8 +22253,6 @@ :method-count-assert 12 :size-assert #x34 :flag-assert #xc00000034 - (:methods - ) ) (deftype menu-language-option (menu-option) @@ -22402,8 +22264,6 @@ :method-count-assert 12 :size-assert #x44 :flag-assert #xc00000044 - (:methods - ) ) (deftype menu-quit-option (menu-option) @@ -22411,8 +22271,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-slider-option (menu-option) @@ -22422,8 +22280,6 @@ :method-count-assert 12 :size-assert #x180 :flag-assert #xc00000180 - (:methods - ) ) (deftype menu-sub-menu-option (menu-option) @@ -22433,8 +22289,6 @@ :method-count-assert 12 :size-assert #x60 :flag-assert #xc00000060 - (:methods - ) ) (deftype menu-sub-menu-sound-option (menu-option) @@ -22443,8 +22297,6 @@ :method-count-assert 12 :size-assert #x34 :flag-assert #xc00000034 - (:methods - ) ) (deftype menu-stereo-mode-sound-option (menu-option) @@ -22452,8 +22304,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-sub-menu-graphic-option (menu-option) @@ -22462,8 +22312,6 @@ :method-count-assert 12 :size-assert #x34 :flag-assert #xc00000034 - (:methods - ) ) (deftype menu-unlocked-menu-option (menu-sub-menu-option) @@ -22471,8 +22319,6 @@ :method-count-assert 12 :size-assert #x60 :flag-assert #xc00000060 - (:methods - ) ) (deftype menu-main-menu-option (menu-option) @@ -22481,8 +22327,6 @@ :method-count-assert 12 :size-assert #x34 :flag-assert #xc00000034 - (:methods - ) ) (deftype menu-memcard-slot-option (menu-option) @@ -22492,8 +22336,6 @@ :method-count-assert 12 :size-assert #x190 :flag-assert #xc00000190 - (:methods - ) ) (deftype menu-loading-option (menu-option) @@ -22501,8 +22343,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-insufficient-space-option (menu-option) @@ -22511,8 +22351,6 @@ :method-count-assert 12 :size-assert #x38 :flag-assert #xc00000038 - (:methods - ) ) (deftype menu-secrets-insufficient-space-option (menu-option) @@ -22520,8 +22358,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-insert-card-option (menu-option) @@ -22529,8 +22365,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-error-loading-option (menu-option) @@ -22538,8 +22372,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-error-auto-saving-option (menu-option) @@ -22547,8 +22379,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-card-removed-option (menu-option) @@ -22556,8 +22386,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-error-disc-removed-option (menu-option) @@ -22565,8 +22393,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-error-reading-option (menu-option) @@ -22574,8 +22400,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-icon-info-option (menu-option) @@ -22584,8 +22408,6 @@ :method-count-assert 12 :size-assert #xb0 :flag-assert #xc000000b0 - (:methods - ) ) (deftype menu-format-card-option (menu-option) @@ -22593,8 +22415,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-already-exists-option (menu-option) @@ -22602,8 +22422,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-create-game-option (menu-option) @@ -22611,8 +22429,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-video-mode-warning-option (menu-option) @@ -22620,8 +22436,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-video-mode-ok-option (menu-option) @@ -22629,8 +22443,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-progressive-mode-warning-option (menu-option) @@ -22638,8 +22450,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-progressive-mode-ok-option (menu-option) @@ -22647,8 +22457,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype menu-select-start-option (menu-option) @@ -22659,8 +22467,6 @@ :method-count-assert 12 :size-assert #x40 :flag-assert #xc00000040 - (:methods - ) ) (deftype menu-select-scene-option (menu-option) @@ -22670,8 +22476,6 @@ :method-count-assert 12 :size-assert #x40 :flag-assert #xc00000040 - (:methods - ) ) (deftype menu-bigmap-option (menu-option) @@ -22679,8 +22483,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype paged-menu-option (menu-option) @@ -22692,8 +22494,6 @@ :method-count-assert 12 :size-assert #x40 :flag-assert #xc00000040 - (:methods - ) ) (deftype menu-missions-option (paged-menu-option) @@ -22703,8 +22503,6 @@ :method-count-assert 12 :size-assert #x50 :flag-assert #xc00000050 - (:methods - ) ) (deftype menu-highscores-option (paged-menu-option) @@ -22714,8 +22512,6 @@ :method-count-assert 12 :size-assert #xd0 :flag-assert #xc000000d0 - (:methods - ) ) (deftype secret-item-option (menu-option) @@ -22727,8 +22523,6 @@ :method-count-assert 12 :size-assert #x3e :flag-assert #xc0000003e - (:methods - ) ) (deftype menu-secret-option (menu-option) @@ -22743,8 +22537,6 @@ :method-count-assert 12 :size-assert #xd0 :flag-assert #xc000000d0 - (:methods - ) ) ;; ohhhh man i wish OpenGOAL had generics -- would be awesome if you could create a menu-option-list @@ -22773,8 +22565,6 @@ :method-count-assert 12 :size-assert #x40 :flag-assert #xc00000040 - (:methods - ) ) (deftype menu-restart-mission-qr-option (menu-qr-option) @@ -22783,8 +22573,6 @@ :method-count-assert 12 :size-assert #x44 :flag-assert #xc00000044 - (:methods - ) ) (deftype menu-quit-qr-option (menu-qr-option) @@ -22793,8 +22581,6 @@ :method-count-assert 12 :size-assert #x44 :flag-assert #xc00000044 - (:methods - ) ) (deftype menu-sub-menu-qr-option (menu-qr-option) @@ -22803,8 +22589,6 @@ :method-count-assert 12 :size-assert #x44 :flag-assert #xc00000044 - (:methods - ) ) (deftype menu-graphic-option (menu-option) @@ -22814,8 +22598,6 @@ :method-count-assert 12 :size-assert #x40 :flag-assert #xc00000040 - (:methods - ) ) (deftype menu-on-off-progressive-scan-graphic-option (menu-graphic-option) @@ -22823,8 +22605,6 @@ :method-count-assert 12 :size-assert #x40 :flag-assert #xc00000040 - (:methods - ) ) (deftype menu-aspect-ratio-option (menu-graphic-option) @@ -22832,8 +22612,6 @@ :method-count-assert 12 :size-assert #x40 :flag-assert #xc00000040 - (:methods - ) ) (deftype menu-center-screen-graphic-option (menu-graphic-option) @@ -22842,8 +22620,6 @@ :method-count-assert 12 :size-assert #x44 :flag-assert #xc00000044 - (:methods - ) ) (deftype menu-video-mode-option (menu-graphic-option) @@ -22851,8 +22627,6 @@ :method-count-assert 12 :size-assert #x40 :flag-assert #xc00000040 - (:methods - ) ) (deftype menu-game-option (menu-option) @@ -22862,8 +22636,6 @@ :method-count-assert 12 :size-assert #x40 :flag-assert #xc00000040 - (:methods - ) ) (deftype menu-on-off-game-vibrations-option (menu-game-option) @@ -22871,8 +22643,6 @@ :method-count-assert 12 :size-assert #x40 :flag-assert #xc00000040 - (:methods - ) ) (deftype menu-on-off-game-subtitles-option (menu-game-option) @@ -22880,8 +22650,6 @@ :method-count-assert 12 :size-assert #x40 :flag-assert #xc00000040 - (:methods - ) ) (deftype menu-sub-menu-game-option (menu-game-option) @@ -22890,8 +22658,6 @@ :method-count-assert 12 :size-assert #x44 :flag-assert #xc00000044 - (:methods - ) ) (deftype menu-language-game-option (menu-game-option) @@ -22903,8 +22669,6 @@ :method-count-assert 12 :size-assert #x54 :flag-assert #xc00000054 - (:methods - ) ) (deftype menu-subtitle-language-game-option (menu-game-option) @@ -22916,8 +22680,6 @@ :method-count-assert 12 :size-assert #x54 :flag-assert #xc00000054 - (:methods - ) ) @@ -22940,7 +22702,7 @@ :size-assert #x20 :flag-assert #x900000020 (:methods - (new (symbol type uint uint) rpc-buffer 0) + (new (symbol type uint uint) rpc-buffer) ;; 0 ) ) @@ -22954,13 +22716,13 @@ :size-assert #x18 :flag-assert #xf00000018 (:methods - (new (symbol type uint uint int) rpc-buffer-pair 0) - (call (rpc-buffer-pair uint pointer uint) int 9) - (add-element (rpc-buffer-pair) pointer 10) - (decrement-elt-used (rpc-buffer-pair) int 11) - (sync (rpc-buffer-pair symbol) int 12) - (check-busy (rpc-buffer-pair) symbol 13) - (pop-last-received (rpc-buffer-pair) pointer 14) + (new (symbol type uint uint int) rpc-buffer-pair) ;; 0 + (call (rpc-buffer-pair uint pointer uint) int) ;; 9 + (add-element (rpc-buffer-pair) pointer) ;; 10 + (decrement-elt-used (rpc-buffer-pair) int) ;; 11 + (sync (rpc-buffer-pair symbol) int) ;; 12 + (check-busy (rpc-buffer-pair) symbol) ;; 13 + (pop-last-received (rpc-buffer-pair) pointer) ;; 14 ) ) @@ -22993,8 +22755,8 @@ :size-assert #x24 :flag-assert #x1b00000024 (:methods - (new (symbol type process symbol float entity symbol) _type_ 0) - (debug-draw (_type_) none 9) + (new (symbol type process symbol float entity symbol) _type_) ;; 0 + (debug-draw (_type_) none) ;; 9 (get-point-in-path! "Depending on the value of `idx`, the result can be quite different: - if `idx` is less than `0.0` - return the first vertex in the path @@ -23007,35 +22769,35 @@ @param idx Either the vertex index or also partially the interpolant in a LERP @param search-type The only recognized value is `exact` @returns Either a distinct vertex along the path, or some fractional point between two vertices" - (_type_ vector float symbol) vector 10) + (_type_ vector float symbol) vector) ;; 10 (get-random-point "Attempts to retrieve a random point along the path, returns the [[*null-vector*]] if no vertices are defined" - (_type_ vector) vector :behavior process 11) + (_type_ vector) vector :behavior process) ;; 11 (displacement-between-two-points-copy! "Calls [[path-control::26]] with the provided args @see [[path-control::26]]" - (_type_ vector float float) vector 12) + (_type_ vector float float) vector) ;; 12 (displacement-between-two-points-normalized! "Calls [[path-control::26], with the provided `idx` @param! ret The [[vector]] the result is stored within @param idx The vertex index @returns The resulting displacement vector, normalized @see [[path-control::26]]" - (_type_ vector float) vector 13) + (_type_ vector float) vector) ;; 13 (get-point-at-percent-along-path! "@param! ret The [[vector]] that is used to hold the return value @param percent The percentage along the path @param search-type The only recognized value is `exact` @returns the point closest to some arbitrary percentage along the path @see [[path-control::10]]" - (_type_ vector float symbol) vector 14) + (_type_ vector float symbol) vector) ;; 14 (displacement-between-points-at-percent-scaled! "Calls [[path-control::12], with the `idx` at a given percent along the path @param ret The [[vector]] that is used to hold the return value @param percent The percentage along the path to find the first index @param mag Multiplied by the number of points in the path and scales the resulting vector @returns The displacement between the last two points of the path scaled to the magnitude equal to the number of points in the path" - (_type_ vector float float) vector 15) + (_type_ vector float float) vector) ;; 15 (displacement-between-points-at-percent-normalized! "Calls [[path-control::13], with the `idx` at a given percent along the path @param! ret The [[vector]] the result is stored within @@ -23043,26 +22805,26 @@ @returns The resulting displacement vector, normalized @see [[path-control::13]] @see [[path-control::14]]" - (_type_ vector float) vector 16) - (get-num-segments (_type_) float 17) + (_type_ vector float) vector) ;; 16 + (get-num-segments (_type_) float) ;; 17 (total-distance "Calcuate the total path length by summing the distance between each adjacent [[curve]] vertex" - (_type_) float 18) - (get-num-verts (_type_) int 19) - (path-distance-equal-spacing (_type_ float) float 20) - (average-segment-length (_type_ float) float 21) + (_type_) float) ;; 18 + (get-num-verts (_type_) int) ;; 19 + (path-distance-equal-spacing (_type_ float) float) ;; 20 + (average-segment-length (_type_ float) float) ;; 21 (get-furthest-point-on-path "@param point The point to calculate distance from @returns the `vertex-idx.interpolant` value to the point on the path furthest away from the `point` @see [[path-control::10]]" - (_type_ vector) float 22) + (_type_ vector) float) ;; 22 (get-path-percentage-at-furthest-point "@param point The point to calculate distance from @returns the percentage of path completion from the point on the path furthest away from the `point` @see [[path-control::14]]" - (_type_ vector) float 23) - (path-control-method-24 "TODO" (_type_ vector) vector 24) - (should-display-marks? (_type_) symbol 25) + (_type_ vector) float) ;; 23 + (path-control-method-24 "TODO" (_type_ vector) vector) ;; 24 + (should-display-marks? (_type_) symbol) ;; 25 (displacement-between-two-points! "Return value can differ quite a bit: - If [[path-control-flag::4]] is set OR there are less than 2 vertices OR `idx` is less than `0.0` - return [[*null-vector*]] @@ -23074,7 +22836,7 @@ @param idx The vertex index @param mag The magnitude to scale the resulting displacement vector by @returns The displacement [[vector]] between two points in the path, the last 2, or the [[*null-vector*]]" - (_type_ vector float float) vector 26) + (_type_ vector float float) vector) ;; 26 ) ) @@ -23085,13 +22847,13 @@ :size-assert #x24 :flag-assert #x1b00000024 (:methods - (new (symbol type process symbol float) _type_ 0) - (:override-doc "Calls [[path-control::26]] with the `idx` at a given percent along the path @see [[path-control::26]]" 12) - (:override-doc "@see [[curve-control::12]]" 13) - (:override-doc + (new (symbol type process symbol float) _type_) ;; 0 + (displacement-between-two-points-copy! :override-doc "Calls [[path-control::26]] with the `idx` at a given percent along the path @see [[path-control::26]]") ;; 12 + (displacement-between-two-points-normalized! :override-doc "@see [[curve-control::12]]") ;; 13 + (total-distance :override-doc "Will lazily calculate and set the [[curve]]'s `length` @returns total path length of the [[curve]] - @see [[curve-length]]" 18) + @see [[curve-length]]") ) ) @@ -23300,44 +23062,44 @@ :size-assert #x70 :flag-assert #x2f00000070 (:methods - (debug-draw (_type_) none 9) - (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly 10) - (poly-centroid (_type_ nav-poly vector) vector 11) - (poly-centroid-local (_type_ nav-poly vector) vector 12) - (lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly 13) - (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex) 14) - (initialize-mesh! (_type_) none 15) - (move-along-nav-ray! (_type_ nav-ray) none 16) - (try-move-along-ray (_type_ nav-poly vector vector float) meters 17) - (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 18) - (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none 19) - (set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none 20) - (find-adjacent-bounds-one (_type_ vector nav-poly int int) none 21) - (compute-bounding-box-from-vertices (_type_ vector vector) none 22) - (init-from-entity "Initialize this mesh from an entity." (_type_ entity-nav-mesh) none 23) - (handle-birth "Handle the parent nav-mesh-entity birth." (_type_) none 24) - (handle-kill "Handle the parent nav-mesh-entity kill." (_type_) none 25) - (update-navigation (_type_) none 26) - (new-nav-control (_type_ process-drawable) nav-control 27) - (remove-nav-control (_type_ nav-control) none 28) - (add-process-drawable-to-navmesh (_type_ process-drawable symbol) none 29) - (remove-process-drawable (_type_ process-drawable) none 30) - (change-to (_type_ process-drawable) none 31) - (link-by-id "arg1 is a [[nav-mesh-link]] `id`" (_type_ uint) symbol 32) - (unlink-by-id "arg1 is a [[nav-mesh-link]] `id`" (_type_ uint) symbol 33) - (nav-mesh-method-34 (_type_ vector vector float) float 34) - (nav-mesh-method-35 (_type_ vector vector float) float 35) - (debug-draw-poly (_type_ nav-poly rgba) none 36) - (point-in-poly? (_type_ nav-poly vector) symbol 37) - (nav-mesh-method-38 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector 38) - (closest-point-on-boundary (_type_ nav-poly vector vector) none 39) - (project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none 40) - (project-point-into-poly-2d (_type_ nav-poly vector vector) none 41) - (find-poly-containing-point-local (_type_ nav-find-poly-parms) nav-poly 42) - (find-nearest-poly-to-point-local (_type_ nav-find-poly-parms) nav-find-poly-parms 43) - (is-in-mesh-local? (_type_ vector float float) symbol 44) - (link-to-other-mesh (_type_ nav-mesh-link) symbol 45) - (unlink-mesh (_type_ nav-mesh-link) none 46) + (debug-draw (_type_) none) ;; 9 + (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly) ;; 10 + (poly-centroid (_type_ nav-poly vector) vector) ;; 11 + (poly-centroid-local (_type_ nav-poly vector) vector) ;; 12 + (lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly) ;; 13 + (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex)) ;; 14 + (initialize-mesh! (_type_) none) ;; 15 + (move-along-nav-ray! (_type_ nav-ray) none) ;; 16 + (try-move-along-ray (_type_ nav-poly vector vector float) meters) ;; 17 + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) ;; 18 + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) ;; 19 + (set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none) ;; 20 + (find-adjacent-bounds-one (_type_ vector nav-poly int int) none) ;; 21 + (compute-bounding-box-from-vertices (_type_ vector vector) none) ;; 22 + (init-from-entity "Initialize this mesh from an entity." (_type_ entity-nav-mesh) none) ;; 23 + (handle-birth "Handle the parent nav-mesh-entity birth." (_type_) none) ;; 24 + (handle-kill "Handle the parent nav-mesh-entity kill." (_type_) none) ;; 25 + (update-navigation (_type_) none) ;; 26 + (new-nav-control (_type_ process-drawable) nav-control) ;; 27 + (remove-nav-control (_type_ nav-control) none) ;; 28 + (add-process-drawable-to-navmesh (_type_ process-drawable symbol) none) ;; 29 + (remove-process-drawable (_type_ process-drawable) none) ;; 30 + (change-to (_type_ process-drawable) none) ;; 31 + (link-by-id "arg1 is a [[nav-mesh-link]] `id`" (_type_ uint) symbol) ;; 32 + (unlink-by-id "arg1 is a [[nav-mesh-link]] `id`" (_type_ uint) symbol) ;; 33 + (nav-mesh-method-34 (_type_ vector vector float) float) ;; 34 + (nav-mesh-method-35 (_type_ vector vector float) float) ;; 35 + (debug-draw-poly (_type_ nav-poly rgba) none) ;; 36 + (point-in-poly? (_type_ nav-poly vector) symbol) ;; 37 + (nav-mesh-method-38 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector) ;; 38 + (closest-point-on-boundary (_type_ nav-poly vector vector) none) ;; 39 + (project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none) ;; 40 + (project-point-into-poly-2d (_type_ nav-poly vector vector) none) ;; 41 + (find-poly-containing-point-local (_type_ nav-find-poly-parms) nav-poly) ;; 42 + (find-nearest-poly-to-point-local (_type_ nav-find-poly-parms) nav-find-poly-parms) ;; 43 + (is-in-mesh-local? (_type_ vector float float) symbol) ;; 44 + (link-to-other-mesh (_type_ nav-mesh-link) symbol) ;; 45 + (unlink-mesh (_type_ nav-mesh-link) none) ;; 46 ) ) @@ -23442,60 +23204,60 @@ :flag-assert #x37000000b0 ;; Failed to read fields. (:methods - (debug-draw (_type_) none 9) - (nav-state-method-10 (_type_) none 10) - (plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol 11) - (get-velocity (_type_ vector) vector 12) - (get-travel (_type_ vector) vector 13) - (get-heading (_type_ vector) vector 14) - (get-target-post (_type_ vector) vector 15) + (debug-draw (_type_) none) ;; 9 + (nav-state-method-10 (_type_) none) ;; 10 + (plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol) ;; 11 + (get-velocity (_type_ vector) vector) ;; 12 + (get-travel (_type_ vector) vector) ;; 13 + (get-heading (_type_ vector) vector) ;; 14 + (get-target-post (_type_ vector) vector) ;; 15 (get-speed "@returns `speed`" - (_type_) meters 16) + (_type_) meters) ;; 16 (get-rotation-rate "@returns `rotation-rate`" - (_type_) float 17) - (try-projecting-to-current-poly (_type_ vector object vector) symbol 18) + (_type_) float) ;; 17 + (try-projecting-to-current-poly (_type_ vector object vector) symbol) ;; 18 (get-current-poly "@returns `current-poly`" - (_type_) nav-poly 19) + (_type_) nav-poly) ;; 19 (copy-nav-state! "Copies the [[nav-state]] the given pointer points to into the current object" - (_type_ (pointer nav-state)) none 20) - (nav-state-method-21 () none 21) - (nav-state-method-22 () none 22) - (nav-state-method-23 () none 23) - (turn-and-navigate-to-destination (_type_) none 24) - (navigate-using-route-portals-wrapper (_type_) none 25) - (navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none 26) - (navigate-within-poly-wrapper (_type_) none 27) - (compute-travel-speed (_type_) none 28) - (nav-state-method-29 (_type_) none 29) - (nav-state-method-30 (_type_) none 30) - (navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none 31) - (update-travel-dir-from-spheres (_type_) none 32) - (compute-speed-simple (_type_) none 33) - (navigate-v1! (_type_) none 34) - (reset-target! (_type_) none 35) - (add-offset-to-target! (_type_ vector) none 36) - (navigate-v2! (_type_) none 37) - (set-current-poly! (_type_ nav-poly) none 38) - (nav-state-method-39 (_type_) symbol 39) - (do-navigation-to-destination (_type_ vector) none 40) - (clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol 41) - (set-target-post! (_type_ vector) none 42) - (set-travel! (_type_ vector) none 43) - (set-velocity! (_type_ vector) none 44) - (set-heading! (_type_ vector) none 45) - (set-speed! (_type_ meters) none 46) - (reset! (_type_ nav-control) none 47) - (nav-state-method-48 () none 48) - (navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none 49) - (nav-state-method-50 (_type_) none 50) - (navigate-using-route-portals (_type_) none 51) - (navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none 52) - (navigate-within-poly (_type_) none 53) - (clamp-travel-vector (_type_) none 54) + (_type_ (pointer nav-state)) none) ;; 20 + (nav-state-method-21 () none) ;; 21 + (nav-state-method-22 () none) ;; 22 + (nav-state-method-23 () none) ;; 23 + (turn-and-navigate-to-destination (_type_) none) ;; 24 + (navigate-using-route-portals-wrapper (_type_) none) ;; 25 + (navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none) ;; 26 + (navigate-within-poly-wrapper (_type_) none) ;; 27 + (compute-travel-speed (_type_) none) ;; 28 + (nav-state-method-29 (_type_) none) ;; 29 + (nav-state-method-30 (_type_) none) ;; 30 + (navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none) ;; 31 + (update-travel-dir-from-spheres (_type_) none) ;; 32 + (compute-speed-simple (_type_) none) ;; 33 + (navigate-v1! (_type_) none) ;; 34 + (reset-target! (_type_) none) ;; 35 + (add-offset-to-target! (_type_ vector) none) ;; 36 + (navigate-v2! (_type_) none) ;; 37 + (set-current-poly! (_type_ nav-poly) none) ;; 38 + (nav-state-method-39 (_type_) symbol) ;; 39 + (do-navigation-to-destination (_type_ vector) none) ;; 40 + (clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol) ;; 41 + (set-target-post! (_type_ vector) none) ;; 42 + (set-travel! (_type_ vector) none) ;; 43 + (set-velocity! (_type_ vector) none) ;; 44 + (set-heading! (_type_ vector) none) ;; 45 + (set-speed! (_type_ meters) none) ;; 46 + (reset! (_type_ nav-control) none) ;; 47 + (nav-state-method-48 () none) ;; 48 + (navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none) ;; 49 + (nav-state-method-50 (_type_) none) ;; 50 + (navigate-using-route-portals (_type_) none) ;; 51 + (navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none) ;; 52 + (navigate-within-poly (_type_) none) ;; 53 + (clamp-travel-vector (_type_) none) ;; 54 ) ) @@ -23542,47 +23304,47 @@ :flag-assert #x2f00000120 ;; Failed to read fields. (:methods - ;; (new (symbol type collide-shape int float) _type_ 0) - (debug-draw (_type_) none 9) + ;; (new (symbol type collide-shape int float) _type_) ;; 0 + (debug-draw (_type_) none) ;; 9 (point-in-bsphere? "Is the given point ([[vector]]) outside of the [[nav-mesh]]'s `bounds` [[sphere]] radius" - (_type_ vector) symbol 10) - (find-poly-containing-point-1 "Find nav-poly containing this point." (_type_ vector) nav-poly 11) - (cloest-point-on-mesh (_type_ vector vector nav-poly) nav-poly 12) - (find-nearest-poly-to-point "Find the nav-poly closest to this point in the nav-mesh." (_type_ vector) nav-poly 13) - (project-point-onto-plane-of-poly "Move a point to the be on the plane containing the given nav-poly. Return the normal too" (_type_ nav-poly vector vector vector) none 14) - (find-poly-containing-point-2 "Find nav-poly containing this point - same as 1" (_type_ vector) nav-poly 15) - (is-above-poly-max-height? "Is the point in a poly, and lower than a max height?" (_type_ vector float) symbol 16) - (is-in-mesh? "Is this point in the mesh?" (_type_ vector float) symbol 17) - (avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol 18) - (avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol 19) - (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 20) - (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none 21) - (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float 22) - (set-spheres-from-nav-ids "Set up spheres from sphere ids previously found by find-sphere-ids-from-sphere-hash" (_type_) none 23) - (add-root-sphere-to-hash! "Add our root sphere to the hash (if enabled with output-sphere-hash flag) at the given location." (_type_ vector int) symbol 24) - (get-max-rotation-rate (_type_) float 25) - (get-sphere-mask (_type_) uint 26) - (get-target-speed (_type_) meters 27) - (enable-extra-sphere! "Sets a flag indicating that this nav-control has an extra-nav-sphere." (_type_) none 28) - (disable-extra-sphere! "Clears a flag indicating that this nav-control has an extra-nav-sphere." (_type_) none 29) - (copy-extra-nav-sphere! "Copies the given [[sphere]] into `extra-nav-sphere`" (_type_ sphere) none 30) - (set-extra-nav-sphere-xyz! "Set the `extra-nav-sphere` with the data in the given [[sphere]]" (_type_ sphere) none 31) - (set-extra-nav-sphere-radius! "Set's `extra-nav-sphere`'s radius" (_type_ float) none 32) - (set-nearest-y-thres! "Set `nearest-y-threshold`" (_type_ float) none 33) - (set-nav-cull-radius! "Set `nav-cull-radius`" (_type_ meters) none 34) - (set-speed-scale! "Set `speed-scale`" (_type_ float) none 35) - (set-target-speed! "Set `target-speed`" (_type_ meters) none 36) - (set-acceleration! "Set `acceleration`" (_type_ meters) none 37) - (set-turning-acceleration! "Set `turning-acceleration`" (_type_ meters) none 38) - (set-max-rotation-rate! "Set `max-rotation-rate`" (_type_ float) none 39) - (set-sphere-mask! "TODO - probably an enum - Set `sphere-mask`" (_type_ uint) none 40) - (remove! "Remove this nav-control from the nav-mesh it belongs to." (_type_) none 41) - (init! "Initializes the [[nav-control]], setting `shape` with the provided [[collide-shape]]" (_type_ collide-shape) none 42) - (display-marks? "Returns if navigation related marks should be displayed" (_type_) symbol 43) - (nav-control-method-44 () none 44) - (find-first-sphere-intersecting-ray "Find the first sphere that this ray intersects" (_type_ vector vector vector) sphere 45) - (find-sphere-ids-from-sphere-hash "Use sphere-hash to look up navigation sphere IDs and save them." (_type_ symbol) none 46) + (_type_ vector) symbol) ;; 10 + (find-poly-containing-point-1 "Find nav-poly containing this point." (_type_ vector) nav-poly) ;; 11 + (cloest-point-on-mesh (_type_ vector vector nav-poly) nav-poly) ;; 12 + (find-nearest-poly-to-point "Find the nav-poly closest to this point in the nav-mesh." (_type_ vector) nav-poly) ;; 13 + (project-point-onto-plane-of-poly "Move a point to the be on the plane containing the given nav-poly. Return the normal too" (_type_ nav-poly vector vector vector) none) ;; 14 + (find-poly-containing-point-2 "Find nav-poly containing this point - same as 1" (_type_ vector) nav-poly) ;; 15 + (is-above-poly-max-height? "Is the point in a poly, and lower than a max height?" (_type_ vector float) symbol) ;; 16 + (is-in-mesh? "Is this point in the mesh?" (_type_ vector float) symbol) ;; 17 + (avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol) ;; 18 + (avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol) ;; 19 + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) ;; 20 + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) ;; 21 + (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float) ;; 22 + (set-spheres-from-nav-ids "Set up spheres from sphere ids previously found by find-sphere-ids-from-sphere-hash" (_type_) none) ;; 23 + (add-root-sphere-to-hash! "Add our root sphere to the hash (if enabled with output-sphere-hash flag) at the given location." (_type_ vector int) symbol) ;; 24 + (get-max-rotation-rate (_type_) float) ;; 25 + (get-sphere-mask (_type_) uint) ;; 26 + (get-target-speed (_type_) meters) ;; 27 + (enable-extra-sphere! "Sets a flag indicating that this nav-control has an extra-nav-sphere." (_type_) none) ;; 28 + (disable-extra-sphere! "Clears a flag indicating that this nav-control has an extra-nav-sphere." (_type_) none) ;; 29 + (copy-extra-nav-sphere! "Copies the given [[sphere]] into `extra-nav-sphere`" (_type_ sphere) none) ;; 30 + (set-extra-nav-sphere-xyz! "Set the `extra-nav-sphere` with the data in the given [[sphere]]" (_type_ sphere) none) ;; 31 + (set-extra-nav-sphere-radius! "Set's `extra-nav-sphere`'s radius" (_type_ float) none) ;; 32 + (set-nearest-y-thres! "Set `nearest-y-threshold`" (_type_ float) none) ;; 33 + (set-nav-cull-radius! "Set `nav-cull-radius`" (_type_ meters) none) ;; 34 + (set-speed-scale! "Set `speed-scale`" (_type_ float) none) ;; 35 + (set-target-speed! "Set `target-speed`" (_type_ meters) none) ;; 36 + (set-acceleration! "Set `acceleration`" (_type_ meters) none) ;; 37 + (set-turning-acceleration! "Set `turning-acceleration`" (_type_ meters) none) ;; 38 + (set-max-rotation-rate! "Set `max-rotation-rate`" (_type_ float) none) ;; 39 + (set-sphere-mask! "TODO - probably an enum - Set `sphere-mask`" (_type_ uint) none) ;; 40 + (remove! "Remove this nav-control from the nav-mesh it belongs to." (_type_) none) ;; 41 + (init! "Initializes the [[nav-control]], setting `shape` with the provided [[collide-shape]]" (_type_ collide-shape) none) ;; 42 + (display-marks? "Returns if navigation related marks should be displayed" (_type_) symbol) ;; 43 + (nav-control-method-44 () none) ;; 44 + (find-first-sphere-intersecting-ray "Find the first sphere that this ray intersects" (_type_ vector vector vector) sphere) ;; 45 + (find-sphere-ids-from-sphere-hash "Use sphere-hash to look up navigation sphere IDs and save them." (_type_ symbol) none) ;; 46 ) ) @@ -23630,25 +23392,25 @@ :size-assert #x58 :flag-assert #x1900000058 (:methods - (new (symbol type int) _type_ 0) ;; TODO see top-level of nav-mesh, doesn't seem to be 2 ints? - (update-grid-for-objects-in-box (_type_ int vector vector) none 9) - (clear-bucket-array (_type_) none 10) - (setup-search-box (_type_ int vector vector vector) none 11) - (search-for-point (_type_ vector) (pointer uint8) 12) - (search-for-sphere (_type_ vector float) (pointer uint8) 13) - (draw "Draws the grid-hash" (_type_ rgba) none 14) + (new (symbol type int) _type_) ;; 0 ;; TODO see top-level of nav-mesh, doesn't seem to be 2 ints? + (update-grid-for-objects-in-box (_type_ int vector vector) none) ;; 9 + (clear-bucket-array (_type_) none) ;; 10 + (setup-search-box (_type_ int vector vector vector) none) ;; 11 + (search-for-point (_type_ vector) (pointer uint8)) ;; 12 + (search-for-sphere (_type_ vector float) (pointer uint8)) ;; 13 + (draw "Draws the grid-hash" (_type_ rgba) none) ;; 14 (dump-grid-info "Prints out info about the grid-hash, also draws via [[grid-hash::draw-grid]] if `debug-draw` is `#t`" - (_type_) none 15) - (verify-bits-in-bucket (_type_ grid-hash-box grid-hash-box) none 16) - (box-of-everything (_type_ object grid-hash-box) none 17) - (grid-hash-method-18 (_type_ grid-hash-box int) none 18) - (grid-hash-method-19 (_type_ grid-hash-box int) none 19) - (do-search! (_type_ grid-hash-box (pointer uint8)) none 20) - (set-up-box (_type_ grid-hash-box vector vector) none 21) - (sphere-to-grid-box (_type_ grid-hash-box sphere) none 22) - (line-sphere-to-grid-box (_type_ grid-hash-box vector vector float) none 23) - (update-grid (_type_) none 24) + (_type_) none) ;; 15 + (verify-bits-in-bucket (_type_ grid-hash-box grid-hash-box) none) ;; 16 + (box-of-everything (_type_ object grid-hash-box) none) ;; 17 + (grid-hash-method-18 (_type_ grid-hash-box int) none) ;; 18 + (grid-hash-method-19 (_type_ grid-hash-box int) none) ;; 19 + (do-search! (_type_ grid-hash-box (pointer uint8)) none) ;; 20 + (set-up-box (_type_ grid-hash-box vector vector) none) ;; 21 + (sphere-to-grid-box (_type_ grid-hash-box sphere) none) ;; 22 + (line-sphere-to-grid-box (_type_ grid-hash-box vector vector float) none) ;; 23 + (update-grid (_type_) none) ;; 24 ) ) @@ -23676,16 +23438,16 @@ :size-assert #x68 :flag-assert #x2200000068 (:methods - (new (symbol type int int) _type_ 0) - (clear-objects! (_type_) none 25) - (add-a-sphere (_type_ vector) int 26) - (add-a-sphere-with-flag (_type_ vector int) int 27) - (update-from-spheres (_type_) none 28) - (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none 29) - (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none 30) - (add-sphere-with-mask-and-id (_type_ vector int int) symbol 31) - (sphere-hash-method-32 (_type_ vector vector float int) symbol 32) - (remove-by-id (_type_ sphere int) none 33) + (new (symbol type int int) _type_) ;; 0 + (clear-objects! (_type_) none) ;; 25 + (add-a-sphere (_type_ vector) int) ;; 26 + (add-a-sphere-with-flag (_type_ vector int) int) ;; 27 + (update-from-spheres (_type_) none) ;; 28 + (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none) ;; 29 + (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none) ;; 30 + (add-sphere-with-mask-and-id (_type_ vector int int) symbol) ;; 31 + (sphere-hash-method-32 (_type_ vector vector float int) symbol) ;; 32 + (remove-by-id (_type_ sphere int) none) ;; 33 ) ) @@ -23706,14 +23468,14 @@ :size-assert #x74 :flag-assert #x2900000074 (:methods - (new (symbol type int int) _type_ 0) - (add-an-object (_type_ vector hash-object-info) int 34) - (fill-actor-list-for-box (_type_ bounding-box (pointer collide-shape) int) int 35) - (fill-actor-list-for-sphere (_type_ sphere (pointer collide-shape) int) int 36) - (fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int 37) - (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int 38) - (spatial-hash-method-39 (_type_ object hash-object-info) int 39) - (validate-objects (_type_) none 40) + (new (symbol type int int) _type_) ;; 0 + (add-an-object (_type_ vector hash-object-info) int) ;; 34 + (fill-actor-list-for-box (_type_ bounding-box (pointer collide-shape) int) int) ;; 35 + (fill-actor-list-for-sphere (_type_ sphere (pointer collide-shape) int) int) ;; 36 + (fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int) ;; 37 + (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int) ;; 38 + (spatial-hash-method-39 (_type_ object hash-object-info) int) ;; 39 + (validate-objects (_type_) none) ;; 40 ) ) @@ -23870,8 +23632,6 @@ :method-count-assert 15 :size-assert #x20 :flag-assert #xf00000020 - (:methods - ) ) (defenum stream-status @@ -24214,7 +23974,7 @@ (data sprite-aux-elem :dynamic :inline :offset-assert 12) ) (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ;; 0 ) :method-count-assert 9 :size-assert #xc @@ -24601,19 +24361,19 @@ :size-assert #x28 :flag-assert #xc00000028 (:methods - (new (symbol type uint) _type_ 0) + (new (symbol type uint) _type_) ;; 0 (frame-counter-delta "Returns the difference between [[*display*]]'s `base-clock.frame-counter` and the elt's `timestamp`" - (_type_ history-elt) time-frame 9) + (_type_ history-elt) time-frame) ;; 9 (update-entries! "Iterate through each [[history-elt]] in [[*history*]] - If we hit the end set `done?` to true - If the `timestamp` on the elt, minus the current framecounter exceeds `max-age`, we are also done, return #f - However if we find an elt who's `owner` matches the iterator's, break out early returning that `elt`" - (_type_) history-elt 10) + (_type_) history-elt) ;; 10 (get-age "Get the age of a history element" - (_type_ history-elt) float 11) + (_type_ history-elt) float) ;; 11 ) ) @@ -24626,20 +24386,20 @@ :size-assert #x10 :flag-assert #xb00000010 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ;; 0 (clear-record-tags! "First grab the latest [[history-elt]] at `alloc-index` 1. update it's `channel`, `record-id` and `owner` from the provided args 2. - if it's `record-tag` is zero -- return it - otherwise, iterate through all `elts` until one is found that does not match it's `timestamp` - if not `0` out the `record-tag` for that elt and continue iteration" - (_type_ history-channel uint uint) history-elt 9) + (_type_ history-channel uint uint) history-elt) ;; 9 (clear-history-entries! "Iterates through each [[history-elt]] in the `elt` dynamic array For each entry: - clear `timestamp` - clear `record-tag`" - (_type_) none 10) + (_type_) none) ;; 10 ) ) @@ -24762,8 +24522,6 @@ :size-assert #xa0 :flag-assert #xd000000a0 ;; Failed to read fields. - (:methods - ) ) |# @@ -25852,7 +25610,7 @@ :size-assert #x4c :flag-assert #x90000004c (:methods - (new (symbol type art-joint-anim (function process-drawable symbol)) _type_ 0) + (new (symbol type art-joint-anim (function process-drawable symbol)) _type_) ;; 0 ) ) @@ -26019,10 +25777,10 @@ :size-assert #x50 :flag-assert #xc00000050 (:methods - (new (symbol type int) _type_ 0) - (save-to-file (_type_ string) _type_ 9) - (load-from-file (_type_ string) _type_ 10) - (debug-inspect (_type_ symbol) _type_ 11) + (new (symbol type int) _type_) ;; 0 + (save-to-file (_type_ string) _type_) ;; 9 + (load-from-file (_type_ string) _type_) ;; 10 + (debug-inspect (_type_ symbol) _type_) ;; 11 ) ) @@ -26043,16 +25801,16 @@ :method-count-assert 23 :size-assert #x214 :flag-assert #x1701a00214 - (:methods - (get-heap () _type_ :state 14) ;; (get-heap () _type_ :state 14) - (get-card () _type_ :state 15) ;; (get-card () _type_ :state 15) - (format-card () _type_ :state 16) ;; (format-card () _type_ :state 16) - (unformat-card () _type_ :state 17) ;; (create-file () _type_ :state 17) - (create-file () _type_ :state 18) ;; (save () _type_ :state 18) - (save () _type_ :state 19) ;; (restore () _type_ :state 19) - (restore () _type_ :state 20) ;; (error (mc-status-code) _type_ :state 20) - (error (mc-status-code) _type_ :state 21) ;; (done () _type_ :state 21) - (done () _type_ :state 22) ;; (unformat-card () _type_ :state 22) + (:state-methods + get-heap + get-card + format-card + unformat-card + create-file + save + restore + (error mc-status-code) + done ) ) @@ -27550,7 +27308,7 @@ :size-assert #x8 :flag-assert #xa00000008 (:methods - (add-actor-cshape (_type_ collide-shape) none 9) + (add-actor-cshape (_type_ collide-shape) none) ;; 9 ) ) @@ -27564,7 +27322,7 @@ :size-assert #x60 :flag-assert #xa00000060 (:methods - (hash-actors (_type_) none 9) + (hash-actors (_type_) none) ;; 9 ) ) @@ -27633,11 +27391,11 @@ :size-assert #x40 :flag-assert #xd00000040 (:methods - (new (symbol type process-drawable res-lump) _type_ 0) - (draw-path (_type_) none 9) - (setup (_type_) none 10) - (push-process (_type_ process-focusable) none 11) - (find-and-push-things (_type_) none 12) + (new (symbol type process-drawable res-lump) _type_) ;; 0 + (draw-path (_type_) none) ;; 9 + (setup (_type_) none) ;; 10 + (push-process (_type_ process-focusable) none) ;; 11 + (find-and-push-things (_type_) none) ;; 12 ) ) @@ -27744,15 +27502,15 @@ :size-assert #x128 :flag-assert #x1100000128 (:methods - (new (symbol type process int float float float) _type_ 0) - (water-control-method-9 (_type_) none 9) - (water-control-method-10 (_type_) none 10) - (start-bobbing! (_type_ float int int) none 11) - (distance-from-surface (_type_) float 12) - (spawn-ripples (_type_ float vector int vector symbol) none 13) - (display-water-marks? (_type_) symbol 14) - (enter-water (_type_) none 15) - (water-control-method-16 (_type_) none 16) + (new (symbol type process int float float float) _type_) ;; 0 + (water-control-method-9 (_type_) none) ;; 9 + (water-control-method-10 (_type_) none) ;; 10 + (start-bobbing! (_type_ float int int) none) ;; 11 + (distance-from-surface (_type_) float) ;; 12 + (spawn-ripples (_type_ float vector int vector symbol) none) ;; 13 + (display-water-marks? (_type_) symbol) ;; 14 + (enter-water (_type_) none) ;; 15 + (water-control-method-16 (_type_) none) ;; 16 ) ) @@ -27761,8 +27519,6 @@ :method-count-assert 15 :size-assert #x80 :flag-assert #xf00000080 - (:methods - ) ) @@ -28039,11 +27795,11 @@ :size-assert #x18 :flag-assert #xc00000018 (:methods - (plane-volume-method-9 (_type_ symbol vector-array vector-array) plane-volume 9) - (debug-draw (_type_) none 10) + (plane-volume-method-9 (_type_ symbol vector-array vector-array) plane-volume) ;; 9 + (debug-draw (_type_) none) ;; 10 (point-in-vol? "TODO - Checks if the given [[vector]] point is inside the volume defined by 6 [[plane]]s by atleast the padding value provided" - (_type_ vector float) symbol 11) + (_type_ vector float) symbol) ;; 11 ) ) @@ -28070,12 +27826,12 @@ :size-assert #x61c :flag-assert #xc0000061c (:methods - (new (symbol type process-drawable) _type_ 0) - (debug-draw (_type_) none 9) - (vol-control-method-10 (_type_ plane) symbol 10) + (new (symbol type process-drawable) _type_) ;; 0 + (debug-draw (_type_) none) ;; 9 + (vol-control-method-10 (_type_ plane) symbol) ;; 10 (should-display? "Returns true/false if the volume's marks should be displayed" - (_type_) symbol 11) + (_type_) symbol) ;; 11 ) ) @@ -28536,8 +28292,8 @@ :method-count-assert 21 :size-assert #x136 :flag-assert #x1500c00136 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -28576,8 +28332,6 @@ :size-assert #x80 :flag-assert #xf00000080 ;; Failed to read fields. - (:methods - ) ) (declare-type camera-start basic) @@ -28588,8 +28342,6 @@ :size-assert #x80 :flag-assert #xf00000080 ;; Failed to read fields. - (:methods - ) ) (deftype med-res-level (process-drawable) @@ -28600,8 +28352,8 @@ :method-count-assert 21 :size-assert #xd4 :flag-assert #x15006000d4 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -28617,10 +28369,10 @@ :method-count-assert 23 :size-assert #xf4 :flag-assert #x17008000f4 - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (deactivated () _type_ :state 22) + (:state-methods + idle + active + deactivated ) ) @@ -28725,18 +28477,18 @@ :size-assert #xb0 :flag-assert #x11000000b0 (:methods - (new (symbol type process-drawable int vector vector float) _type_ 0) - (carry-info-method-9 (_type_) none 9) + (new (symbol type process-drawable int vector vector float) _type_) ;; 0 + (carry-info-method-9 (_type_) none) ;; 9 (distance-from-destination "Returns the distance from the current `point` and the provided [[carry-info]]'s `point`. Returns `-1.0` if it exceeds the maximum allowed" - (_type_ carry-info) float 10) - (drag! (_type_ carry-info) none 11) - (drop-impl! (_type_ carry-info) none 12) - (carry-info-method-13 (_type_) symbol :behavior process-drawable 13) - (carry! (_type_ carry-info vector vector) none 14) - (drop! (_type_ carry-info) none 15) - (translate! (_type_) symbol :behavior process-drawable 16) + (_type_ carry-info) float) ;; 10 + (drag! (_type_ carry-info) none) ;; 11 + (drop-impl! (_type_ carry-info) none) ;; 12 + (carry-info-method-13 (_type_) symbol :behavior process-drawable) ;; 13 + (carry! (_type_ carry-info vector vector) none) ;; 14 + (drop! (_type_ carry-info) none) ;; 15 + (translate! (_type_) symbol :behavior process-drawable) ;; 16 ) ) @@ -28804,11 +28556,11 @@ :method-count-assert 24 :size-assert #x100 :flag-assert #x1800800100 - (:methods - (idle () _type_ :state 20) - (use (symbol) _type_ :state 21) - (hidden () _type_ :state 22) - (die () _type_ :state 23) + (:state-methods + idle + (use symbol) + hidden + die ) ) @@ -28910,7 +28662,7 @@ :size-assert #x2c0 :flag-assert #xa000002c0 (:methods - (gun-info-method-9 (_type_) (inline-array vector) 9) + (gun-info-method-9 (_type_) (inline-array vector)) ;; 9 ) ) @@ -28956,10 +28708,10 @@ :method-count-assert 23 :size-assert #xd8 :flag-assert #x17006000d8 - (:methods - (idle (symbol) _type_ :state 20) - (use () _type_ :state 21) - (hidden () _type_ :state 22) + (:state-methods + (idle symbol) + use + hidden ) ) @@ -29116,8 +28868,8 @@ :size-assert #xd48 :flag-assert #xb00000d48 (:methods - (add-to-trick-list "Add specified trick and point amount to trick list." (_type_ board-tricks float) none 9) - (flush-trick-list "Flush trick list and give out points." (_type_) none 10) + (add-to-trick-list "Add specified trick and point amount to trick list." (_type_ board-tricks float) none) ;; 9 + (flush-trick-list "Flush trick list and give out points." (_type_) none) ;; 10 ) ) @@ -29166,7 +28918,7 @@ :size-assert #x50 :flag-assert #xa00000050 (:methods - (update-clock! (_type_ int) none :behavior target 9) + (update-clock! (_type_ int) none :behavior target) ;; 9 ) ) @@ -29435,8 +29187,6 @@ :method-count-assert 14 :size-assert #xa94 :flag-assert #xe0a200a94 - (:methods - ) ) (deftype remote (process-drawable) @@ -29452,13 +29202,15 @@ :method-count-assert 26 :size-assert #x11c :flag-assert #x1a00a0011c + (:state-methods + enter + idle + exit + ) (:methods - (enter () _type_ :state 20) - (idle () _type_ :state 21) - (exit () _type_ :state 22) - (init (_type_) none 23) - (get-track-pt-and-scale (_type_ vector) float 24) - (post-common (_type_) none 25) + (init (_type_) none) ;; 23 + (get-track-pt-and-scale (_type_ vector) float) ;; 24 + (post-common (_type_) none) ;; 25 ) ) @@ -29468,8 +29220,6 @@ :method-count-assert 26 :size-assert #x128 :flag-assert #x1a00b00128 - (:methods - ) ) (deftype judge (remote) @@ -29481,9 +29231,11 @@ :method-count-assert 28 :size-assert #x139 :flag-assert #x1c00c00139 + (:state-methods + wait + ) (:methods - (wait () _type_ :state 26) - (setup-collision (_type_) none 27) + (setup-collision (_type_) none) ;; 27 ) ) @@ -29604,12 +29356,14 @@ :method-count-assert 25 :size-assert #x128 :flag-assert #x1900b00128 + (:state-methods + idle + die + leave + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (leave () _type_ :state 22) - (task-arrow-method-23 "Some weird debugging code left here, but checks for collisions on the arrow" (_type_ vector) none 23) - (draw-arrow (_type_) none :behavior task-arrow 24) + (task-arrow-method-23 "Some weird debugging code left here, but checks for collisions on the arrow" (_type_ vector) none) ;; 23 + (draw-arrow (_type_) none :behavior task-arrow) ;; 24 ) ) @@ -29793,8 +29547,6 @@ :method-count-assert 42 :size-assert #x1f0 :flag-assert #x2a017001f0 - (:methods - ) ) (deftype gun-mag-yellow (projectile-bounce) @@ -29802,8 +29554,6 @@ :method-count-assert 42 :size-assert #x1f0 :flag-assert #x2a017001f0 - (:methods - ) ) (deftype gun-mag-red (projectile-bounce) @@ -29811,8 +29561,6 @@ :method-count-assert 42 :size-assert #x1f0 :flag-assert #x2a017001f0 - (:methods - ) ) (deftype gun-mag-blue (projectile-bounce) @@ -29820,8 +29568,6 @@ :method-count-assert 42 :size-assert #x1f0 :flag-assert #x2a017001f0 - (:methods - ) ) (deftype gun-mag-dark (projectile-bounce) @@ -29829,8 +29575,6 @@ :method-count-assert 42 :size-assert #x1f0 :flag-assert #x2a017001f0 - (:methods - ) ) (deftype beam-info (structure) @@ -29860,8 +29604,6 @@ :method-count-assert 40 :size-assert #x210 :flag-assert #x2801900210 - (:methods - ) ) (define-extern target-gun-fire-blue (function (pointer process) :behavior target)) @@ -29880,8 +29622,6 @@ :method-count-assert 40 :size-assert #x200 :flag-assert #x2801800200 - (:methods - ) ) (define-extern target-gun-fire-yellow (function (pointer process) :behavior target)) @@ -29906,19 +29646,21 @@ :method-count-assert 30 :size-assert #x240 :flag-assert #x1e01c00240 + (:state-methods + blocked + debug-idle + idle + ) (:methods - (blocked () _type_ :state 20) - (debug-idle () _type_ :state 21) - (idle () _type_ :state 22) (init-probes! "Create all 19 probe vectors" - (_type_ collide-shape) none 23) - (gun-red-shot-method-24 (_type_) symbol 24) - (noop "Does nothing" (_type_) none 25) - (gun-red-shot-method-26 (_type_) none 26) - (gun-red-shot-method-27 (_type_) none 27) - (gun-red-shot-method-28 (_type_ vector) sound-id 28) - (fire! (_type_ process-drawable int) object :behavior gun-red-shot 29) + (_type_ collide-shape) none) ;; 23 + (gun-red-shot-method-24 (_type_) symbol) ;; 24 + (noop "Does nothing" (_type_) none) ;; 25 + (gun-red-shot-method-26 (_type_) none) ;; 26 + (gun-red-shot-method-27 (_type_) none) ;; 27 + (gun-red-shot-method-28 (_type_ vector) sound-id) ;; 28 + (fire! (_type_ process-drawable int) object :behavior gun-red-shot) ;; 29 ) ) @@ -29947,9 +29689,9 @@ :method-count-assert 42 :size-assert #x2b4 :flag-assert #x2a024002b4 - (:methods - (startup () _type_ :state 40) - (fizzle () _type_ :state 41) + (:state-methods + startup + fizzle ) ) @@ -30107,7 +29849,8 @@ :size-assert #x44 :flag-assert #x900000044 (:methods - (new (symbol type) _type_ 0)) + (new (symbol type) _type_) ;; 0 + ) ) (deftype debug-menu-node (basic) @@ -30133,7 +29876,8 @@ :size-assert #x28 :flag-assert #x900000028 (:methods - (new (symbol type debug-menu-context string) _type_ 0)) + (new (symbol type debug-menu-context string) _type_) ;; 0 + ) ) (deftype debug-menu-item (debug-menu-node) @@ -30151,7 +29895,8 @@ :size-assert #x1c :flag-assert #x90000001c (:methods - (new (symbol type string debug-menu) _type_ 0)) + (new (symbol type string debug-menu) _type_) ;; 0 + ) ) (deftype debug-menu-item-function (debug-menu-item) @@ -30162,7 +29907,8 @@ :size-assert #x1d :flag-assert #x90000001d (:methods - (new (symbol type string object (function object object)) _type_ 0)) + (new (symbol type string object (function object object)) _type_) ;; 0 + ) ) ;; +++debug-h:debug-menu-msg @@ -30183,7 +29929,8 @@ :size-assert #x20 :flag-assert #x900000020 (:methods - (new (symbol type string object (function object debug-menu-msg object)) _type_ 0)) + (new (symbol type string object (function object debug-menu-msg object)) _type_) ;; 0 + ) ) (deftype debug-menu-item-var (debug-menu-item) @@ -30218,7 +29965,8 @@ :size-assert #x64 :flag-assert #x900000064 (:methods - (new (symbol type string int int) _type_ 0)) + (new (symbol type string int int) _type_) ;; 0 + ) ) ;; +++debug-h:debug-menu-dest @@ -30576,19 +30324,19 @@ :size-assert #x60 :flag-assert #x1600000060 (:methods - (inc-spr-addr! "Adds the given integer to `spr-addr` and returns it" (_type_ uint) uint 9) - (lay-out-spad-memory (_type_ nav-mesh) none 10) - (set-up-mem-work (_type_) none 11) - (add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none 12) - (add-all-spheres (_type_) none 13) - (do-sphere-lookups (_type_) none 14) - (update-nav-controls-pipelined-in-spr (_type_) none 15) - (update-nav-controls-in-spr (_type_) none 16) - (upload-nav-to-spr (_type_ nav-engine-spr-buffer) none 17) - (download-nav-from-spr (_type_ nav-engine-spr-buffer) none 18) - (do-callbacks (_type_ nav-engine-spr-buffer) none 19) - (reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none 20) - (reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none 21) + (inc-spr-addr! "Adds the given integer to `spr-addr` and returns it" (_type_ uint) uint) ;; 9 + (lay-out-spad-memory (_type_ nav-mesh) none) ;; 10 + (set-up-mem-work (_type_) none) ;; 11 + (add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none) ;; 12 + (add-all-spheres (_type_) none) ;; 13 + (do-sphere-lookups (_type_) none) ;; 14 + (update-nav-controls-pipelined-in-spr (_type_) none) ;; 15 + (update-nav-controls-in-spr (_type_) none) ;; 16 + (upload-nav-to-spr (_type_ nav-engine-spr-buffer) none) ;; 17 + (download-nav-from-spr (_type_ nav-engine-spr-buffer) none) ;; 18 + (do-callbacks (_type_ nav-engine-spr-buffer) none) ;; 19 + (reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none) ;; 20 + (reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none) ;; 21 ) ) @@ -30739,23 +30487,25 @@ (movie-pos-index int32 :offset-assert 400) ) :flag-assert #x2401200194 ;; L802 + (:state-methods + blocked + wait + deploy + (suck handle) + jump + fade + (pickup symbol handle) + die + (notice-blue handle) + ) (:methods - (blocked () _type_ :state 20) - (wait () _type_ :state 21) - (deploy () _type_ :state 22) - (suck (handle) _type_ :state 23) - (jump () _type_ :state 24) - (fade () _type_ :state 25) - (pickup (symbol handle) _type_ :state 26) - (die () _type_ :state 27) - (notice-blue (handle) _type_ :state 28) - (init-common (_type_ entity-actor pickup-type float) none 29) ;; seen it. - (initialize-effects (_type_ pickup-type) none 30) - (go-to-initial-state (_type_) none 31) - (initialize-options (_type_ int float fact-info) collectable 32) - (initialize-allocations (_type_) none 33) - (common-post (_type_) none 34) - (do-pickup (_type_ handle) none 35) + (init-common (_type_ entity-actor pickup-type float) none) ;; 29 ;; seen it. + (initialize-effects (_type_ pickup-type) none) ;; 30 + (go-to-initial-state (_type_) none) ;; 31 + (initialize-options (_type_ int float fact-info) collectable) ;; 32 + (initialize-allocations (_type_) none) ;; 33 + (common-post (_type_) none) ;; 34 + (do-pickup (_type_ handle) none) ;; 35 ) ) @@ -30914,10 +30664,10 @@ :size-assert #x10 :flag-assert #xd00000010 (:methods - (reset? (_type_) symbol 9) - (get-proc (_type_) fail-mission 10) - (start! (_type_ fail-mission-params) symbol 11) - (reset! (_type_) object 12) + (reset? (_type_) symbol) ;; 9 + (get-proc (_type_) fail-mission) ;; 10 + (start! (_type_ fail-mission-params) symbol) ;; 11 + (reset! (_type_) object) ;; 12 ) ) @@ -30937,10 +30687,12 @@ :method-count-assert 17 :size-assert #xac :flag-assert #x11003000ac + (:state-methods + idle + resetting + ) (:methods - (idle () _type_ :state 14) - (resetting () _type_ :state 15) - (print-text (_type_) float 16) + (print-text (_type_) float) ;; 16 ) ) @@ -31041,21 +30793,23 @@ :method-count-assert 41 :size-assert #x120 :flag-assert #x2900a00120 + (:state-methods + hide + idle + (die symbol int) + special-contents-die + bounce-on + (notice-blue handle) + carry + fall + ) (:methods - (hide () _type_ :state 27) - (idle () _type_ :state 28) - (die (symbol int) _type_ :state 29) - (special-contents-die () _type_ :state 30) - (bounce-on () _type_ :state 31) - (notice-blue (handle) _type_ :state 32) - (carry () _type_ :state 33) - (fall () _type_ :state 34) - (crate-init! "Initialize the [[crate]] with the specified [[entity-actor]]." (_type_ entity-actor) none 35) - (skel-init! "Initialize the [[crate]]'s skeleton and other parameters based on the crate type." (_type_) none 36) - (params-set! "Set [[crate]] params based on the arguments." (_type_ symbol symbol) none 37) - (crate-method-38 (_type_) none 38) - (smush-update! (_type_) none 39) - (crate-method-40 (_type_) symbol :behavior crate 40) + (crate-init! "Initialize the [[crate]] with the specified [[entity-actor]]." (_type_ entity-actor) none) ;; 35 + (skel-init! "Initialize the [[crate]]'s skeleton and other parameters based on the crate type." (_type_) none) ;; 36 + (params-set! "Set [[crate]] params based on the arguments." (_type_ symbol symbol) none) ;; 37 + (crate-method-38 (_type_) none) ;; 38 + (smush-update! (_type_) none) ;; 39 + (crate-method-40 (_type_) symbol :behavior crate) ;; 40 ) ) @@ -31065,8 +30819,6 @@ :method-count-assert 41 :size-assert #x124 :flag-assert #x2900b00124 - (:methods - ) ) (define-extern *CRATE-bank* crate-bank) @@ -31250,8 +31002,8 @@ :method-count-assert 21 :size-assert #xd4 :flag-assert #x15006000d4 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -31929,11 +31681,11 @@ :size-assert #x30 :flag-assert #xd00000030 (:methods - (new (symbol type) _type_ 0) ;; added to avoid re-definition errors (even though nothing was being re-defined) - (editable-region-method-9 (_type_ editable-array int int) symbol 9) - (editable-region-method-10 (_type_ int) symbol 10) - (editable-region-method-11 (_type_ vector int) none 11) - (editable-region-method-12 (_type_) editable-filter 12) + (new (symbol type) _type_) ;; 0 ;; added to avoid re-definition errors (even though nothing was being re-defined) + (editable-region-method-9 (_type_ editable-array int int) symbol) ;; 9 + (editable-region-method-10 (_type_ int) symbol) ;; 10 + (editable-region-method-11 (_type_ vector int) none) ;; 11 + (editable-region-method-12 (_type_) editable-filter) ;; 12 ) ) @@ -31971,27 +31723,27 @@ (:methods (get-color "Returns the [[rgba]] that corresponds to the type of [[editable]] TODO - document the colors" - (_type_ int) rgba 9) - (editable-method-10 (_type_) none 10) - (editable-method-11 (_type_ vector) symbol 11) - (select-editable! (_type_ symbol) none 12) - (edit-get-distance "Returns the distance from the camera to the [[editable]], or -1.0" (_type_ vector) float 13) - (edit-get-trans "Returns the `trans` [[vector]] or [[*null-vector*]]" (_type_) vector 14) - (editable-method-15 (_type_ vector int) none 15) - (edit-coord! (_type_ vector editable-flag) none 16) - (editable-method-17 (_type_ vector) none 17) - (editable-method-18 (_type_ vector matrix) none 18) - (editable-method-19 (_type_ vector) none 19) - (editable-method-20 (_type_ vector vector vector vector) none 20) - (editable-method-21 (_type_ editable-region) none 21) - (editable-method-22 (_type_ editable-array int int) symbol 22) - (editable-method-23 (_type_) symbol 23) - (editable-method-24 (_type_) none 24) - (editable-method-25 (_type_ editable-array) none 25) - (editable-method-26 (_type_ editable editable-array) none 26) - (editable-method-27 (_type_ editable-array) editable 27) - (editable-method-28 (_type_ editable-filter) none 28) - (editable-method-29 (_type_ editable-filter) symbol 29) + (_type_ int) rgba) ;; 9 + (editable-method-10 (_type_) none) ;; 10 + (editable-method-11 (_type_ vector) symbol) ;; 11 + (select-editable! (_type_ symbol) none) ;; 12 + (edit-get-distance "Returns the distance from the camera to the [[editable]], or -1.0" (_type_ vector) float) ;; 13 + (edit-get-trans "Returns the `trans` [[vector]] or [[*null-vector*]]" (_type_) vector) ;; 14 + (editable-method-15 (_type_ vector int) none) ;; 15 + (edit-coord! (_type_ vector editable-flag) none) ;; 16 + (editable-method-17 (_type_ vector) none) ;; 17 + (editable-method-18 (_type_ vector matrix) none) ;; 18 + (editable-method-19 (_type_ vector) none) ;; 19 + (editable-method-20 (_type_ vector vector vector vector) none) ;; 20 + (editable-method-21 (_type_ editable-region) none) ;; 21 + (editable-method-22 (_type_ editable-array int int) symbol) ;; 22 + (editable-method-23 (_type_) symbol) ;; 23 + (editable-method-24 (_type_) none) ;; 24 + (editable-method-25 (_type_ editable-array) none) ;; 25 + (editable-method-26 (_type_ editable editable-array) none) ;; 26 + (editable-method-27 (_type_ editable-array) editable) ;; 27 + (editable-method-28 (_type_ editable-filter) none) ;; 28 + (editable-method-29 (_type_ editable-filter) symbol) ;; 29 ) ) @@ -32025,16 +31777,16 @@ :size-assert #x7c :flag-assert #x120000007c (:methods - (new (symbol type int) _type_ 0) - (editable-array-method-9 (_type_ editable-command mouse-info) symbol :behavior editable-player 9) - (editable-array-method-10 (_type_ vector int) editable 10) - (editable-array-method-11 (_type_) int 11) - (editable-array-method-12 (_type_ editable-array) none 12) - (editable-array-method-13 (_type_ editable-command editable-command string) none 13) - (editable-array-method-14 (_type_ (function editable editable-region symbol) editable-region) (array editable) 14) - (editable-array-method-15 (_type_ editable) none 15) - (editable-array-method-16 (_type_) none 16) - (editable-array-method-17 (_type_ vector vector) vector 17) + (new (symbol type int) _type_) ;; 0 + (editable-array-method-9 (_type_ editable-command mouse-info) symbol :behavior editable-player) ;; 9 + (editable-array-method-10 (_type_ vector int) editable) ;; 10 + (editable-array-method-11 (_type_) int) ;; 11 + (editable-array-method-12 (_type_ editable-array) none) ;; 12 + (editable-array-method-13 (_type_ editable-command editable-command string) none) ;; 13 + (editable-array-method-14 (_type_ (function editable editable-region symbol) editable-region) (array editable)) ;; 14 + (editable-array-method-15 (_type_ editable) none) ;; 15 + (editable-array-method-16 (_type_) none) ;; 16 + (editable-array-method-17 (_type_ vector vector) vector) ;; 17 ) ) @@ -32047,7 +31799,8 @@ :size-assert #x30 :flag-assert #x1e00000030 (:methods - (new (symbol type vector editable-region) _type_ 0)) + (new (symbol type vector editable-region) _type_) ;; 0 + ) ) (deftype editable-sphere (editable-point) @@ -32056,7 +31809,8 @@ :size-assert #x30 :flag-assert #x1e00000030 (:methods - (new (symbol type vector float editable-region) _type_ 0))) + (new (symbol type vector float editable-region) _type_) ;; 0 + )) (deftype editable-sample (editable-point) () @@ -32076,7 +31830,8 @@ :size-assert #x5c :flag-assert #x1e0000005c (:methods - (new (symbol type vector float editable-region) _type_ 0))) + (new (symbol type vector float editable-region) _type_) ;; 0 + )) (deftype editable-entity (editable-point) () @@ -32095,9 +31850,9 @@ :size-assert #x58 :flag-assert #x2000000058 (:methods - (new (symbol type editable-region) _type_ 0) - (editable-face-method-30 (_type_ (inline-array vector)) int 30) - (editable-face-method-31 (_type_ vector) vector 31) + (new (symbol type editable-region) _type_) ;; 0 + (editable-face-method-30 (_type_ (inline-array vector)) int) ;; 30 + (editable-face-method-31 (_type_ vector) vector) ;; 31 ) ) @@ -32111,9 +31866,9 @@ :size-assert #x28 :flag-assert #x2000000028 (:methods - (new (symbol type editable-region) _type_ 0) - (editable-plane-method-30 (_type_ (inline-array vector)) int 30) - (editable-plane-method-31 (_type_ vector) vector 31) + (new (symbol type editable-region) _type_) ;; 0 + (editable-plane-method-30 (_type_ (inline-array vector)) int) ;; 30 + (editable-plane-method-31 (_type_ vector) vector) ;; 31 ) ) @@ -32131,9 +31886,11 @@ :method-count-assert 22 :size-assert #x108 :flag-assert #x1600900108 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (editable-player-method-21 (_type_) none 21) + (editable-player-method-21 (_type_) none) ;; 21 ) ) @@ -32239,10 +31996,10 @@ (:methods (exec-sql! "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" - (_type_) symbol 9) + (_type_) symbol) ;; 9 (temp-edge-size "Returns the number of [[mysql-nav-edge]] stored in the `temp-edge-list`" - (_type_) int 10) + (_type_) int) ;; 10 ) ) @@ -32325,7 +32082,8 @@ (:methods (exec-sql! "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" - (_type_) symbol 9)) + (_type_) symbol) ;; 9 + ) ) (deftype mysql-nav-edge-array (inline-array-class) @@ -32350,7 +32108,8 @@ (:methods (exec-sql! "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" - (_type_) symbol 9)) + (_type_) symbol) ;; 9 + ) ) (deftype mysql-nav-visnode-array (inline-array-class) @@ -32386,44 +32145,44 @@ :size-assert #x41c :flag-assert #x150000041c (:methods - (new (symbol type string) _type_ 0) + (new (symbol type string) _type_) ;; 0 (init-from-sql! "Query the database and initialize the [[mysql-nav-graph]] and all it's related components" - (_type_ string string) symbol 9) - (exec-sql! (_type_) symbol 10) + (_type_ string string) symbol) ;; 9 + (exec-sql! (_type_) symbol) ;; 10 (indexof-nav-node "Iterate through the `node-array` and return the index for the first [[mysql-nav-node]] whom's `nav_node_id` matches the provided id returns `-1` if none is found" - (_type_ int) int 11) + (_type_ int) int) ;; 11 (indexof-nav-edge "Iterate through the `edge-array` and return the index for the first [[mysql-nav-edge]] whom's `nav_edge_id` matches the provided id returns `-1` if none is found" - (_type_ int) int 12) + (_type_ int) int) ;; 12 (alloc-new-node! "Allocates a new `[[mysql-nav-node]]`, if `node-array`'s `length` exceeds `3000` return `-1` otherwise, return the new size of the array" - (_type_) int 13) + (_type_) int) ;; 13 (alloc-new-edge! "Allocates a new `[[mysql-nav-edge]]`, if `edge-array`'s `length` exceeds `5000` return `-1` otherwise, return the new size of the array" - (_type_) int 14) + (_type_) int) ;; 14 (indexof-visnode "Returns the index in the `visnode-array` whom's [[mysql-nav-visnode]] has the provided `runtime-edge-id` and `runtime-node-id` if none exist, return `-1`" - (_type_ int int) int 15) + (_type_ int int) int) ;; 15 (alloc-new-visnode! "Potentially allocates a new `[[mysql-nav-visnode]]`: - if `visnode-array`'s `length` exceeds `3000` return `-1` - otherwise, if the node already exists, TODO - if the node does not already exist, create it!" - (_type_ int int) int 16) + (_type_ int int) int) ;; 16 (mysql-nav-graph-method-17 - (_type_) none 17) + (_type_) none) ;; 17 (lookup-level-info2 "TODO - this was originally called `lookup-level-info` but it clashes with the function defined in `level`" - (_type_ mysql-nav-node symbol) mysql-nav-graph-level-info 18) - (mysql-nav-graph-method-19 (_type_) none 19) - (mysql-nav-graph-method-20 (_type_) none 20) + (_type_ mysql-nav-node symbol) mysql-nav-graph-level-info) ;; 18 + (mysql-nav-graph-method-19 (_type_) none) ;; 19 + (mysql-nav-graph-method-20 (_type_) none) ;; 20 ) ) @@ -32483,57 +32242,59 @@ :method-count-assert 64 :size-assert #x1ac :flag-assert #x40013001ac - (:methods - (move-node () _type_ :state 14) - (move-plane () _type_ :state 15) - (create () _type_ :state 16) - (edit-edge () _type_ :state 17) - (create-edge () _type_ :state 18) - (adjust-plane () _type_ :state 19) - (adjust-it () _type_ :state 20) - (adjust-minimap () _type_ :state 21) - (adjust-node-angle () _type_ :state 22) - (adjust-node-radius () _type_ :state 23) - (adjust-edge-visibility () _type_ :state 24) - (adjust-edge-width () _type_ :state 25) - (adjust-edge-density () _type_ :state 26) - (draw-closest-minimap () _type_ :state 27) - (nav-graph-editor-method-28 (_type_) none 28) - (nav-graph-editor-method-29 (_type_ string string string) none 29) - (nav-graph-editor-method-30 (_type_ int) symbol 30) - (nav-graph-editor-method-31 (_type_ int) symbol 31) - (nav-graph-editor-method-32 (_type_ symbol int) none 32) - (nav-graph-editor-method-33 (_type_ int) none 33) - (nav-graph-editor-method-34 (_type_) object 34) - (nav-graph-editor-method-35 (_type_) none 35) - (nav-graph-editor-method-36 (_type_) none 36) - (nav-graph-editor-method-37 (_type_) none 37) - (nav-graph-editor-method-38 (_type_) none 38) - (nav-graph-editor-method-39 (_type_) none 39) - (nav-graph-editor-method-40 (_type_) none 40) - (nav-graph-editor-method-41 (_type_) none 41) - (nav-graph-editor-method-42 (_type_) symbol 42) - (nav-graph-editor-method-43 (_type_) none 43) - (nav-graph-editor-method-44 (_type_) symbol 44) - (nav-graph-editor-method-45 (_type_) none 45) - (nav-graph-editor-method-46 (_type_) pad-buttons 46) - (nav-graph-editor-method-47 (_type_) none 47) - (nav-graph-editor-method-48 "TODO - enum / com-type" (_type_ uint) nav-graph-command 48) - (nav-graph-editor-method-49 (_type_) nav-graph-command 49) - (nav-graph-editor-method-50 (_type_) none 50) - (nav-graph-editor-method-51 (_type_) none 51) - (nav-graph-editor-method-52 (_type_) uint 52) - (nav-graph-editor-method-53 (_type_ int int) none 53) - (nav-graph-editor-method-54 (_type_ int) none 54) - (nav-graph-editor-method-55 (_type_ int) none 55) - (nav-graph-editor-method-56 (_type_ int) none 56) - (nav-graph-editor-method-57 (_type_ int int) int 57) - (nav-graph-editor-method-58 (_type_) symbol 58) - (nav-graph-editor-method-59 (_type_) pad-buttons 59) - (nav-graph-editor-method-60 (_type_) none 60) - (nav-graph-editor-method-61 (_type_) none 61) - (nav-graph-editor-method-62 (_type_ symbol symbol) none 62) - (nav-graph-editor-method-63 (_type_) none 63) + (:state-methods + move-node + move-plane + create + edit-edge + create-edge + adjust-plane + adjust-it + adjust-minimap + adjust-node-angle + adjust-node-radius + adjust-edge-visibility + adjust-edge-width + adjust-edge-density + draw-closest-minimap + ) + (:methods + (nav-graph-editor-method-28 (_type_) none) ;; 28 + (nav-graph-editor-method-29 (_type_ string string string) none) ;; 29 + (nav-graph-editor-method-30 (_type_ int) symbol) ;; 30 + (nav-graph-editor-method-31 (_type_ int) symbol) ;; 31 + (nav-graph-editor-method-32 (_type_ symbol int) none) ;; 32 + (nav-graph-editor-method-33 (_type_ int) none) ;; 33 + (nav-graph-editor-method-34 (_type_) object) ;; 34 + (nav-graph-editor-method-35 (_type_) none) ;; 35 + (nav-graph-editor-method-36 (_type_) none) ;; 36 + (nav-graph-editor-method-37 (_type_) none) ;; 37 + (nav-graph-editor-method-38 (_type_) none) ;; 38 + (nav-graph-editor-method-39 (_type_) none) ;; 39 + (nav-graph-editor-method-40 (_type_) none) ;; 40 + (nav-graph-editor-method-41 (_type_) none) ;; 41 + (nav-graph-editor-method-42 (_type_) symbol) ;; 42 + (nav-graph-editor-method-43 (_type_) none) ;; 43 + (nav-graph-editor-method-44 (_type_) symbol) ;; 44 + (nav-graph-editor-method-45 (_type_) none) ;; 45 + (nav-graph-editor-method-46 (_type_) pad-buttons) ;; 46 + (nav-graph-editor-method-47 (_type_) none) ;; 47 + (nav-graph-editor-method-48 "TODO - enum / com-type" (_type_ uint) nav-graph-command) ;; 48 + (nav-graph-editor-method-49 (_type_) nav-graph-command) ;; 49 + (nav-graph-editor-method-50 (_type_) none) ;; 50 + (nav-graph-editor-method-51 (_type_) none) ;; 51 + (nav-graph-editor-method-52 (_type_) uint) ;; 52 + (nav-graph-editor-method-53 (_type_ int int) none) ;; 53 + (nav-graph-editor-method-54 (_type_ int) none) ;; 54 + (nav-graph-editor-method-55 (_type_ int) none) ;; 55 + (nav-graph-editor-method-56 (_type_ int) none) ;; 56 + (nav-graph-editor-method-57 (_type_ int int) int) ;; 57 + (nav-graph-editor-method-58 (_type_) symbol) ;; 58 + (nav-graph-editor-method-59 (_type_) pad-buttons) ;; 59 + (nav-graph-editor-method-60 (_type_) none) ;; 60 + (nav-graph-editor-method-61 (_type_) none) ;; 61 + (nav-graph-editor-method-62 (_type_ symbol symbol) none) ;; 62 + (nav-graph-editor-method-63 (_type_) none) ;; 63 ) ) @@ -32725,11 +32486,11 @@ :size-assert #x94 :flag-assert #xe00000094 (:methods - (los-control-method-9 (_type_ process-focusable vector float) none :behavior process 9) - (check-los? (_type_ time-frame) symbol :behavior process 10) - (skip-check-los? (_type_ int) symbol :behavior process 11) - (set-dst-proc! (_type_ handle) none 12) - (new-source! (_type_ process time-frame collide-spec) none 13) + (los-control-method-9 (_type_ process-focusable vector float) none :behavior process) ;; 9 + (check-los? (_type_ time-frame) symbol :behavior process) ;; 10 + (skip-check-los? (_type_ int) symbol :behavior process) ;; 11 + (set-dst-proc! (_type_ handle) none) ;; 12 + (new-source! (_type_ process time-frame collide-spec) none) ;; 13 ) ) @@ -32783,15 +32544,17 @@ :size-assert #x174 :flag-assert #x1c01000174 ;; field level-name uses ~A with a signed load field open-test uses ~A with a signed load + (:state-methods + (open symbol) + (close symbol) + ) (:methods - (open (symbol) _type_ :state 20) - (close (symbol) _type_ :state 21) - (init-airlock! (_type_) _type_ 22) - (want-cross-airlock? (_type_) symbol :behavior com-airlock 23) - (destination-loaded? (_type_ symbol) symbol 24) - (check-crossing-distance (_type_ vector symbol) float :behavior com-airlock 25) - (rotate-gear! (_type_ float) degrees :behavior com-airlock 26) - (play-city-voice-sound (_type_ symbol) none :behavior com-airlock 27) ;; TODO - really weird usage of a string array / sound-array? + (init-airlock! (_type_) _type_) ;; 22 + (want-cross-airlock? (_type_) symbol :behavior com-airlock) ;; 23 + (destination-loaded? (_type_ symbol) symbol) ;; 24 + (check-crossing-distance (_type_ vector symbol) float :behavior com-airlock) ;; 25 + (rotate-gear! (_type_ float) degrees :behavior com-airlock) ;; 26 + (play-city-voice-sound (_type_ symbol) none :behavior com-airlock) ;; 27 ;; TODO - really weird usage of a string array / sound-array? ) ) @@ -32800,8 +32563,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype com-airlock-inner (com-airlock) @@ -32809,8 +32570,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype fort-entry-gate (com-airlock) @@ -32818,8 +32577,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype hip-door-a (com-airlock) @@ -32827,8 +32584,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype tomb-mar-door (com-airlock) @@ -32836,8 +32591,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype cas-front-door (com-airlock-outer) @@ -32845,8 +32598,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype pal-throne-door (com-airlock) @@ -32854,8 +32605,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype vin-door-ctyinda (com-airlock) @@ -32863,8 +32612,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype under-door (com-airlock) @@ -32872,8 +32619,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype oracle-door (com-airlock) @@ -32881,8 +32626,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) @@ -32907,18 +32650,20 @@ :method-count-assert 29 :size-assert #x100 :flag-assert #x1d00800100 + (:state-methods + water-anim-state-20 + idle + ) (:methods - (water-anim-method-20 "Nonexistent?" () none 20) - (idle () _type_ :state 21) (move-to-point! "Set a [[water-anim]]'s `trans` as specified by the [[vector]] and update `water-height`." - (_type_ vector) int 22) - (get-ripple-height (_type_ vector) float 23) - (init-water! "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (_type_) none 24) - (reset-root! "Reset a [[water-anim]]'s `root`." (_type_) trsqv 25) - (water-anim-init! "Initialize a [[water-anim]]." (_type_) none 26) - (water-anim-method-27 "Empty." (_type_) none 27) - (offset! "Offset a [[water-anim]]'s `trans` and `quat` by the lump data in `entity`." (_type_) none 28) + (_type_ vector) int) ;; 22 + (get-ripple-height (_type_ vector) float) ;; 23 + (init-water! "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (_type_) none) ;; 24 + (reset-root! "Reset a [[water-anim]]'s `root`." (_type_) trsqv) ;; 25 + (water-anim-init! "Initialize a [[water-anim]]." (_type_) none) ;; 26 + (water-anim-method-27 "Empty." (_type_) none) ;; 27 + (offset! "Offset a [[water-anim]]'s `trans` and `quat` by the lump data in `entity`." (_type_) none) ;; 28 ) ) @@ -32945,11 +32690,13 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) (init! "TODO - but sets up the plane given 2 vectors and a height" - (_type_ (inline-array vector) float) none 21) + (_type_ (inline-array vector) float) none) ;; 21 ) ) @@ -32991,8 +32738,8 @@ :size-assert #x10 :flag-assert #xb00000010 (:methods - (idle-control-method-9 (_type_ (pointer idle-control-frame)) none 9) - (idle-control-method-10 (_type_ process-drawable) none :behavior process-drawable 10) + (idle-control-method-9 (_type_ (pointer idle-control-frame)) none) ;; 9 + (idle-control-method-10 (_type_ process-drawable) none :behavior process-drawable) ;; 10 ) ) @@ -33006,8 +32753,6 @@ :method-count-assert 29 :size-assert #x100 :flag-assert #x1d00800100 - (:methods - ) ) (define-extern *ripple-for-dark-eco-pool* ripple-wave-set) @@ -33088,8 +32833,8 @@ :size-assert #x20 :flag-assert #xe00000020 (:methods - (try-update-focus (_type_ process-focusable enemy) symbol :replace 12) - (enemy-focus-method-13 (_type_ process-focusable enemy-aware) symbol 13) + (try-update-focus (_type_ process-focusable enemy) symbol :replace) ;; 12 + (enemy-focus-method-13 (_type_ process-focusable enemy-aware) symbol) ;; 13 ) ) @@ -33180,7 +32925,7 @@ :size-assert #x180 :flag-assert #xa00000180 (:methods - (copy-enemy-info! "Copies the given [[enemy-info]] into the current [[enemy-info]]" (_type_ _type_) none 9) + (copy-enemy-info! "Copies the given [[enemy-info]] into the current [[enemy-info]]" (_type_ _type_) none) ;; 9 ) ) @@ -33301,190 +33046,192 @@ :method-count-assert 137 :size-assert #x214 :flag-assert #x8901a00214 - (:methods - (dormant () _type_ :state 27) ;; TODO - these dont produce a nice decomp warning when missing - (dormant-aware () _type_ :state 28) - (hit () _type_ :state 29) - (knocked () _type_ :state 30) - (idle () _type_ :state 31) ;; TODO - these dont produce a nice decomp warning when missing - (active () _type_ :state 32) - (notice () _type_ :state 33) - (flee () _type_ :state 34) - (stare () _type_ :state 35) - (hostile () _type_ :state 36) - (victory () _type_ :state 37) - (die () _type_ :state 38) - (die-falling () _type_ :state 39) - (die-fast () _type_ :state 40) - (directed () _type_ :state 41) - (jump () _type_ :state 42) - (jump-blocked () _type_ :state 43) - (ambush () _type_ :state 44) - (view-anims () _type_ :state 45) - (enemy-method-46 "@abstract" (_type_ int) none 46) - (enemy-method-47 (_type_ vector) float 47) - (take-damage-from-attack (_type_ process event-message-block) int 48) - (enemy-method-49 (_type_) time-frame :behavior enemy 49) - (enemy-method-50 (_type_ vector) vector 50) - (enemy-method-51 (_type_) float 51) - (enemy-method-52 (_type_ vector) none 52) + (:state-methods + dormant + dormant-aware + hit + knocked + idle + active + notice + flee + stare + hostile + victory + die + die-falling + die-fast + directed + jump + jump-blocked + ambush + view-anims + ) + (:methods + (enemy-method-46 "@abstract" (_type_ int) none) ;; 46 + (enemy-method-47 (_type_ vector) float) ;; 47 + (take-damage-from-attack (_type_ process event-message-block) int) ;; 48 + (enemy-method-49 (_type_) time-frame :behavior enemy) ;; 49 + (enemy-method-50 (_type_ vector) vector) ;; 50 + (enemy-method-51 (_type_) float) ;; 51 + (enemy-method-52 (_type_ vector) none) ;; 52 (enemy-method-53 "TODO" - (_type_ process-focusable) symbol 53) - (enemy-method-54 (_type_) enemy-flag 54) + (_type_ process-focusable) symbol) ;; 53 + (enemy-method-54 (_type_) enemy-flag) ;; 54 (track-target! "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (_type_) none 55) + (_type_) none) ;; 55 (damage-amount-from-attack "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" - (_type_ process event-message-block) int 56) + (_type_ process event-message-block) int) ;; 56 (update-target-awareness! "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! @TODO - flesh out docs @returns the value that sets `aware`" - (_type_ process-focusable enemy-best-focus) enemy-aware 57) - (enemy-method-58 (_type_ process event-message-block) symbol 58) + (_type_ process-focusable enemy-best-focus) enemy-aware) ;; 57 + (enemy-method-58 (_type_ process event-message-block) symbol) ;; 58 (get-penetrate-info "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" - (_type_) penetrate 59) + (_type_) penetrate) ;; 59 (coin-flip? "@returns The result of a 50/50 RNG roll" - (_type_) symbol 60) - (enemy-method-61 (_type_ int) int :behavior enemy 61) - (enemy-method-62 (_type_) none 62) - (enemy-method-63 (_type_ process-focusable enemy-aware) symbol 63) - (enemy-method-64 (_type_) none 64) - (enemy-method-65 (_type_) none 65) - (go-ambush (_type_) object 66) - (go-stare (_type_) object 67) - (go-stare2 (_type_) object 68) - (go-directed (_type_) object 69) - (go-hostile (_type_) object 70) - (go-flee (_type_) object 71) + (_type_) symbol) ;; 60 + (enemy-method-61 (_type_ int) int :behavior enemy) ;; 61 + (enemy-method-62 (_type_) none) ;; 62 + (enemy-method-63 (_type_ process-focusable enemy-aware) symbol) ;; 63 + (enemy-method-64 (_type_) none) ;; 64 + (enemy-method-65 (_type_) none) ;; 65 + (go-ambush (_type_) object) ;; 66 + (go-stare (_type_) object) ;; 67 + (go-stare2 (_type_) object) ;; 68 + (go-directed (_type_) object) ;; 69 + (go-hostile (_type_) object) ;; 70 + (go-flee (_type_) object) ;; 71 (react-to-focus "@TODO - flesh out docs" - (_type_) object 72) + (_type_) object) ;; 72 (kill-prefer-falling "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - (_type_) object 73) + (_type_) object) ;; 73 (general-event-handler "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" - (_type_ process int symbol event-message-block) object 74) - (enemy-method-75 (_type_ process event-message-block) object 75) - (enemy-method-76 (_type_ process event-message-block) symbol 76) - (enemy-method-77 (_type_ (pointer float)) symbol 77) - (enemy-method-78 (_type_ (pointer float)) symbol 78) - (enemy-method-79 (_type_ int enemy-knocked-info) symbol 79) - (enemy-method-80 (_type_ enemy-knocked-info) symbol 80) - (enemy-method-81 (_type_) symbol 81) - (enemy-method-82 "@abstract" (_type_ enemy-jump-info) symbol 82) - (enemy-method-83 (_type_ enemy-jump-info) none 83) - (enemy-method-84 (_type_ enemy-jump-info) none 84) - (enemy-method-85 (_type_) float 85) - (enemy-method-86 (_type_) symbol 86) - (enemy-method-87 (_type_ enemy-jump-info) symbol 87) - (enemy-method-88 (_type_ enemy-jump-info) symbol 88) - (enemy-method-89 (_type_ enemy-jump-info) symbol 89) - (enemy-method-90 (_type_ int enemy-jump-info) symbol 90) - (enemy-method-91 (_type_ int enemy-jump-info) none 91) + (_type_ process int symbol event-message-block) object) ;; 74 + (enemy-method-75 (_type_ process event-message-block) object) ;; 75 + (enemy-method-76 (_type_ process event-message-block) symbol) ;; 76 + (enemy-method-77 (_type_ (pointer float)) symbol) ;; 77 + (enemy-method-78 (_type_ (pointer float)) symbol) ;; 78 + (enemy-method-79 (_type_ int enemy-knocked-info) symbol) ;; 79 + (enemy-method-80 (_type_ enemy-knocked-info) symbol) ;; 80 + (enemy-method-81 (_type_) symbol) ;; 81 + (enemy-method-82 "@abstract" (_type_ enemy-jump-info) symbol) ;; 82 + (enemy-method-83 (_type_ enemy-jump-info) none) ;; 83 + (enemy-method-84 (_type_ enemy-jump-info) none) ;; 84 + (enemy-method-85 (_type_) float) ;; 85 + (enemy-method-86 (_type_) symbol) ;; 86 + (enemy-method-87 (_type_ enemy-jump-info) symbol) ;; 87 + (enemy-method-88 (_type_ enemy-jump-info) symbol) ;; 88 + (enemy-method-89 (_type_ enemy-jump-info) symbol) ;; 89 + (enemy-method-90 (_type_ int enemy-jump-info) symbol) ;; 90 + (enemy-method-91 (_type_ int enemy-jump-info) none) ;; 91 (enemy-method-92 "TODO - nav-poly is a guess @abstract" - (_type_ int nav-poly) none 92) - (enemy-method-93 (_type_) none 93) - (enemy-method-94 (_type_ vector float) symbol 94) - (enemy-method-95 (_type_ vector float) symbol 95) - (enemy-method-96 (_type_ float symbol) symbol 96) - (enemy-method-97 (_type_) process 97) + (_type_ int nav-poly) none) ;; 92 + (enemy-method-93 (_type_) none) ;; 93 + (enemy-method-94 (_type_ vector float) symbol) ;; 94 + (enemy-method-95 (_type_ vector float) symbol) ;; 95 + (enemy-method-96 (_type_ float symbol) symbol) ;; 96 + (enemy-method-97 (_type_) process) ;; 97 (in-aggro-range? "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @param proc The process used to distance check @returns true/false" - (_type_ process-focusable vector) symbol 98) - (enemy-method-99 (_type_ process-focusable) symbol 99) - (enemy-method-100 (_type_) symbol 100) - (enemy-method-101 (_type_) none 101) - (enemy-method-102 (_type_) symbol 102) - (enemy-method-103 (_type_) collide-spec 103) - (enemy-method-104 (_type_ process touching-shapes-entry uint) symbol :behavior process 104) - (enemy-method-105 (_type_ process) enemy-flag 105) - (enemy-method-106 (_type_ process object int attack-info) none :behavior enemy 106) + (_type_ process-focusable vector) symbol) ;; 98 + (enemy-method-99 (_type_ process-focusable) symbol) ;; 99 + (enemy-method-100 (_type_) symbol) ;; 100 + (enemy-method-101 (_type_) none) ;; 101 + (enemy-method-102 (_type_) symbol) ;; 102 + (enemy-method-103 (_type_) collide-spec) ;; 103 + (enemy-method-104 (_type_ process touching-shapes-entry uint) symbol :behavior process) ;; 104 + (enemy-method-105 (_type_ process) enemy-flag) ;; 105 + (enemy-method-106 (_type_ process object int attack-info) none :behavior enemy) ;; 106 (get-enemy-target "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" - (_type_) process-focusable 107) - (enemy-method-108 (_type_ enemy event-message-block) int 108) + (_type_) process-focusable) ;; 107 + (enemy-method-108 (_type_ enemy event-message-block) int) ;; 108 (look-at-target! "Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available @param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details" - (_type_ enemy-flag) none 109) + (_type_ enemy-flag) none) ;; 109 (stop-looking-at-target! "Will unset [[enemy-flag::death-start]] and [[enemy-flag::lock-focus]] and call [[joint-mod::shut-down]] if applicable" - (_type_) none 110) - (enemy-method-111 (_type_) none :behavior enemy 111) + (_type_) none) ;; 110 + (enemy-method-111 (_type_) none :behavior enemy) ;; 111 (set-enemy-info! "In addition to setting the `enemy-info`, also init the `neck-joint` if applicable from it @param info Set `enemy-info` accordingly" - (_type_ enemy-info) none 112) + (_type_ enemy-info) none) ;; 112 (init-enemy-behaviour-and-stats! "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" - (_type_ enemy-info) none 113) + (_type_ enemy-info) none) ;; 113 (init-enemy-collision! "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (_type_) none 114) + (_type_) none) ;; 114 (init-enemy! "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (_type_) none 115) - (go-idle (_type_) none 116) + (_type_) none) ;; 115 + (go-idle (_type_) none) ;; 116 (get-rand-float "@returns the result of calling [[rand-vu]]" - (_type_) float 117) + (_type_) float) ;; 117 (get-rand-float-range "@param low The lower bound of the range (inclusive) @param high The upper bound of the range (exclusive) @returns A random float in the specified range" - (_type_ float float) float 118) + (_type_ float float) float) ;; 118 (get-rand-int "@param high The upper bound of the range (exclusive) @returns a random integer in the range 0 to `high` @see [[rand-vu]]" - (_type_ int) int 119) - (enemy-method-120 "TODO" (_type_ int int) int 120) + (_type_ int) int) ;; 119 + (enemy-method-120 "TODO" (_type_ int int) int) ;; 120 (get-rand-int-range "@param low The lower bound of the range (inclusive) @param high The upper bound of the range (exclusive) @returns A random integer in the specified range" - (_type_ int int) int 121) + (_type_ int int) int) ;; 121 (rng-hit? "TODO - not the best name @param chance The value to compare ([[>=]]) with the result from [[rand-vu]]. @returns If `chance` is greater than the random draw" - (_type_ float) symbol 122) - (enemy-method-123 "TODO" (_type_ float) symbol 123) - (enemy-method-124 "TODO" (_type_) collide-spec 124) - (enemy-method-125 (_type_ collide-query collide-spec float float float) pat-surface 125) + (_type_ float) symbol) ;; 122 + (enemy-method-123 "TODO" (_type_ float) symbol) ;; 123 + (enemy-method-124 "TODO" (_type_) collide-spec) ;; 124 + (enemy-method-125 (_type_ collide-query collide-spec float float float) pat-surface) ;; 125 (enemy-above-ground? "@returns if the enemy is above the ground or not @see [[above-ground?]]" - (_type_ collide-query vector collide-spec float float float) symbol 126) - (enemy-method-127 (_type_ float float symbol collide-spec) symbol 127) - (enemy-method-128 (_type_ vector move-above-ground-params) none 128) - (enemy-method-129 (_type_) none 129) - (enemy-method-130 (_type_ float) symbol 130) - (enemy-method-131 (_type_ int) uint 131) + (_type_ collide-query vector collide-spec float float float) symbol) ;; 126 + (enemy-method-127 (_type_ float float symbol collide-spec) symbol) ;; 127 + (enemy-method-128 (_type_ vector move-above-ground-params) none) ;; 128 + (enemy-method-129 (_type_) none) ;; 129 + (enemy-method-130 (_type_ float) symbol) ;; 130 + (enemy-method-131 (_type_ int) uint) ;; 131 (dispose! "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (_type_) none 132) - (enemy-method-133 (_type_) symbol 133) - (enemy-method-134 (_type_ process attack-info) process-focusable 134) - (enemy-method-135 (_type_ int) sound-id 135) - (enemy-method-136 (_type_) enemy-flag 136) + (_type_) none) ;; 132 + (enemy-method-133 (_type_) symbol) ;; 133 + (enemy-method-134 (_type_ process attack-info) process-focusable) ;; 134 + (enemy-method-135 (_type_ int) sound-id) ;; 135 + (enemy-method-136 (_type_) enemy-flag) ;; 136 ) ) @@ -33534,7 +33281,7 @@ (:methods (copy-nav-enemy-info! "Copies the provided [[nav-enemy-info]] into the current object" - (_type_ nav-enemy-info) none 10) + (_type_ nav-enemy-info) none) ;; 10 ) ) @@ -33550,55 +33297,57 @@ :method-count-assert 178 :size-assert #x25c :flag-assert #xb201e0025c + (:state-methods + taunt + pacing + circling + stop-chase + debug-control + ) (:methods (set-enemy-info! "In addition to setting the `enemy-info`, also init the `neck-joint` if applicable from it @param info Set `enemy-info` accordingly" - (_type_ nav-enemy-info) none :replace 112) + (_type_ nav-enemy-info) none :replace) ;; 112 (init-enemy-behaviour-and-stats! "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" - (_type_ nav-enemy-info) none :replace 113) - (taunt () _type_ :state 137) - (pacing () _type_ :state 138) - (circling () _type_ :state 139) - (stop-chase () _type_ :state 140) - (debug-control () _type_ :state 141) - (nav-enemy-method-142 (_type_ nav-control) none 142) - (nav-enemy-method-143 (_type_ nav-control) none 143) - (nav-enemy-method-144 (_type_) time-frame :behavior nav-enemy 144) - (nav-enemy-method-145 (_type_ nav-control) none 145) - (nav-enemy-method-146 (_type_ nav-control) none 146) - (nav-enemy-method-147 (_type_ nav-control) none 147) - (nav-enemy-method-148 (_type_ nav-control) none 148) - (nav-enemy-method-149 (_type_ nav-control) none 149) - (nav-enemy-method-150 (_type_ nav-control) none 150) - (nav-enemy-method-151 (_type_ nav-control) none 151) - (nav-enemy-method-152 (_type_ nav-control) none 152) - (nav-enemy-method-153 (_type_ nav-control) none 153) - (nav-enemy-method-154 (_type_ nav-control) none 154) - (nav-enemy-method-155 (_type_) none 155) - (nav-enemy-method-156 (_type_) none 156) - (nav-enemy-method-157 (_type_ vector) nav-poly 157) - (nav-enemy-method-158 (_type_ vector) object 158) - (nav-enemy-method-159 (_type_ vector) symbol 159) - (nav-enemy-method-160 (_type_) none 160) - (nav-enemy-method-161 (_type_) none 161) - (nav-enemy-method-162 (_type_) none 162) - (nav-enemy-method-163 (_type_) symbol 163) - (nav-enemy-method-164 (_type_) none 164) - (nav-enemy-method-165 (_type_) none 165) - (nav-enemy-method-166 (_type_) none 166) - (nav-enemy-method-167 (_type_) none 167) - (nav-enemy-method-168 (_type_) float 168) - (nav-enemy-method-169 (_type_ float symbol) float 169) - (nav-enemy-method-170 (_type_) none 170) - (nav-enemy-method-171 (_type_) none 171) - (nav-enemy-method-172 (_type_) none 172) - (nav-enemy-method-173 (_type_) none 173) - (nav-enemy-method-174 (_type_) symbol 174) - (nav-enemy-method-175 (_type_) symbol 175) - (nav-enemy-method-176 (_type_) none :behavior nav-enemy 176) - (nav-enemy-method-177 (_type_) none 177) + (_type_ nav-enemy-info) none :replace) ;; 113 + (nav-enemy-method-142 (_type_ nav-control) none) ;; 142 + (nav-enemy-method-143 (_type_ nav-control) none) ;; 143 + (nav-enemy-method-144 (_type_) time-frame :behavior nav-enemy) ;; 144 + (nav-enemy-method-145 (_type_ nav-control) none) ;; 145 + (nav-enemy-method-146 (_type_ nav-control) none) ;; 146 + (nav-enemy-method-147 (_type_ nav-control) none) ;; 147 + (nav-enemy-method-148 (_type_ nav-control) none) ;; 148 + (nav-enemy-method-149 (_type_ nav-control) none) ;; 149 + (nav-enemy-method-150 (_type_ nav-control) none) ;; 150 + (nav-enemy-method-151 (_type_ nav-control) none) ;; 151 + (nav-enemy-method-152 (_type_ nav-control) none) ;; 152 + (nav-enemy-method-153 (_type_ nav-control) none) ;; 153 + (nav-enemy-method-154 (_type_ nav-control) none) ;; 154 + (nav-enemy-method-155 (_type_) none) ;; 155 + (nav-enemy-method-156 (_type_) none) ;; 156 + (nav-enemy-method-157 (_type_ vector) nav-poly) ;; 157 + (nav-enemy-method-158 (_type_ vector) object) ;; 158 + (nav-enemy-method-159 (_type_ vector) symbol) ;; 159 + (nav-enemy-method-160 (_type_) none) ;; 160 + (nav-enemy-method-161 (_type_) none) ;; 161 + (nav-enemy-method-162 (_type_) none) ;; 162 + (nav-enemy-method-163 (_type_) symbol) ;; 163 + (nav-enemy-method-164 (_type_) none) ;; 164 + (nav-enemy-method-165 (_type_) none) ;; 165 + (nav-enemy-method-166 (_type_) none) ;; 166 + (nav-enemy-method-167 (_type_) none) ;; 167 + (nav-enemy-method-168 (_type_) float) ;; 168 + (nav-enemy-method-169 (_type_ float symbol) float) ;; 169 + (nav-enemy-method-170 (_type_) none) ;; 170 + (nav-enemy-method-171 (_type_) none) ;; 171 + (nav-enemy-method-172 (_type_) none) ;; 172 + (nav-enemy-method-173 (_type_) none) ;; 173 + (nav-enemy-method-174 (_type_) symbol) ;; 174 + (nav-enemy-method-175 (_type_) symbol) ;; 175 + (nav-enemy-method-176 (_type_) none :behavior nav-enemy) ;; 176 + (nav-enemy-method-177 (_type_) none) ;; 177 ) ) @@ -33634,7 +33383,7 @@ :size-assert #xbc :flag-assert #xa000000bc (:methods - (rigid-body-info-method-9 (_type_) none 9) + (rigid-body-info-method-9 (_type_) none) ;; 9 ) ) @@ -33725,29 +33474,29 @@ :size-assert #x120 :flag-assert #x2000000120 (:methods - (rigid-body-method-9 (_type_ collide-shape-moving float) none 9) - (rigid-body-method-10 (_type_) none 10) - (rigid-body-method-11 (_type_ collide-shape-moving) none 11) - (rigid-body-method-12 (_type_ float) none 12) - (rigid-body-method-13 (_type_) none 13) - (rigid-body-method-14 (_type_ float) none 14) - (rigid-body-method-15 (_type_ collide-shape-moving float) none 15) - (clear-force-torque! (_type_) none 16) - (clear-momentum! (_type_) none 17) - (rigid-body-method-18 (_type_ vector vector) none 18) - (rigid-body-method-19 (_type_ vector vector) none 19) - (rigid-body-method-20 (_type_ vector) none 20) - (rigid-body-method-21 (_type_ vector vector float) none 21) - (rigid-body-method-22 (_type_ vector vector) vector 22) - (rigid-body-method-23 (_type_ vector) vector 23) - (rigid-body-method-24 (_type_) none 24) - (rigid-body-method-25 (_type_ rigid-body-info vector quaternion function) none 25) - (rigid-body-method-26 (_type_ vector quaternion) none 26) ;; TODO: stack - (print-physics (_type_ object) none 27) ;; probably a better name for this - (print-force-torque (_type_ object) none 28) - (print-position-rotation (_type_ object) none 29) - (print-momentum (_type_ object) none 30) - (print-velocity (_type_ object) none 31) + (rigid-body-method-9 (_type_ collide-shape-moving float) none) ;; 9 + (rigid-body-method-10 (_type_) none) ;; 10 + (rigid-body-method-11 (_type_ collide-shape-moving) none) ;; 11 + (rigid-body-method-12 (_type_ float) none) ;; 12 + (rigid-body-method-13 (_type_) none) ;; 13 + (rigid-body-method-14 (_type_ float) none) ;; 14 + (rigid-body-method-15 (_type_ collide-shape-moving float) none) ;; 15 + (clear-force-torque! (_type_) none) ;; 16 + (clear-momentum! (_type_) none) ;; 17 + (rigid-body-method-18 (_type_ vector vector) none) ;; 18 + (rigid-body-method-19 (_type_ vector vector) none) ;; 19 + (rigid-body-method-20 (_type_ vector) none) ;; 20 + (rigid-body-method-21 (_type_ vector vector float) none) ;; 21 + (rigid-body-method-22 (_type_ vector vector) vector) ;; 22 + (rigid-body-method-23 (_type_ vector) vector) ;; 23 + (rigid-body-method-24 (_type_) none) ;; 24 + (rigid-body-method-25 (_type_ rigid-body-info vector quaternion function) none) ;; 25 + (rigid-body-method-26 (_type_ vector quaternion) none) ;; 26 ;; TODO: stack + (print-physics (_type_ object) none) ;; 27 ;; probably a better name for this + (print-force-torque (_type_ object) none) ;; 28 + (print-position-rotation (_type_ object) none) ;; 29 + (print-momentum (_type_ object) none) ;; 30 + (print-velocity (_type_ object) none) ;; 31 ) ) @@ -33759,24 +33508,24 @@ :size-assert #x130 :flag-assert #x1a00000130 (:methods - (new (symbol type process) _type_ 0) - (rigid-body-control-method-9 (_type_ collide-shape-moving float) none 9) - (rigid-body-control-method-10 (_type_ rigid-body-object float float) object 10) - (rigid-body-control-method-11 (_type_ collide-shape-moving) none 11) - (rigid-body-control-method-12 (_type_ float) none 12) - (rigid-body-control-method-13 (_type_) none 13) - (rigid-body-control-method-14 (_type_ float) none 14) - (clear-force-torque! (_type_) none 15) - (clear-momentum! (_type_) none 16) - (rigid-body-control-method-17 (_type_ vector vector) none 17) - (rigid-body-control-method-18 (_type_ vector vector) none 18) - (rigid-body-control-method-19 (_type_ vector) none 19) - (rigid-body-control-method-20 (_type_ vector vector float) none 20) - (rigid-body-control-method-21 (_type_ vector vector) vector 21) - (rigid-body-control-method-22 (_type_ vector) vector 22) - (rigid-body-control-method-23 (_type_) none 23) - (rigid-body-control-method-24 (_type_ rigid-body-info vector quaternion basic) none 24) - (rigid-body-control-method-25 (_type_ vector quaternion) none 25) + (new (symbol type process) _type_) ;; 0 + (rigid-body-control-method-9 (_type_ collide-shape-moving float) none) ;; 9 + (rigid-body-control-method-10 (_type_ rigid-body-object float float) object) ;; 10 + (rigid-body-control-method-11 (_type_ collide-shape-moving) none) ;; 11 + (rigid-body-control-method-12 (_type_ float) none) ;; 12 + (rigid-body-control-method-13 (_type_) none) ;; 13 + (rigid-body-control-method-14 (_type_ float) none) ;; 14 + (clear-force-torque! (_type_) none) ;; 15 + (clear-momentum! (_type_) none) ;; 16 + (rigid-body-control-method-17 (_type_ vector vector) none) ;; 17 + (rigid-body-control-method-18 (_type_ vector vector) none) ;; 18 + (rigid-body-control-method-19 (_type_ vector) none) ;; 19 + (rigid-body-control-method-20 (_type_ vector vector float) none) ;; 20 + (rigid-body-control-method-21 (_type_ vector vector) vector) ;; 21 + (rigid-body-control-method-22 (_type_ vector) vector) ;; 22 + (rigid-body-control-method-23 (_type_) none) ;; 23 + (rigid-body-control-method-24 (_type_ rigid-body-info vector quaternion basic) none) ;; 24 + (rigid-body-control-method-25 (_type_ vector quaternion) none) ;; 25 ) ) @@ -33845,33 +33594,35 @@ :method-count-assert 53 :size-assert #x110 :flag-assert #x3500900110 - (:methods - (idle () _type_ :state 27) - (active () _type_ :state 28) - (rigid-body-object-method-29 (_type_ float) none 29) - (rigid-body-object-method-30 (_type_) none 30) - (alloc-and-init-rigid-body-control (_type_ rigid-body-object-constants) none 31) - (allocate-and-init-cshape (_type_) none 32) - (init-skel-and-rigid-body (_type_) none 33) - (rigid-body-object-method-34 (_type_) none 34) - (rigid-body-object-method-35 (_type_) none 35) - (do-engine-sounds (_type_) none 36) - (rigid-body-object-method-37 (_type_) none 37) - (rigid-body-object-method-38 (_type_) none 38) - (rigid-body-object-method-39 (_type_) none 39) - (rigid-body-object-method-40 (_type_) none 40) - (rigid-body-object-method-41 (_type_) none 41) - (rigid-body-object-method-42 (_type_) none :behavior rigid-body-object 42) - (rigid-body-object-method-43 (_type_) none 43) - (apply-damage (_type_ float rigid-body-impact) none 44) - (rigid-body-object-method-45 (_type_ rigid-body-impact) none 45) - (rigid-body-object-method-46 (_type_ process-drawable int symbol event-message-block) object :behavior rigid-body-object 46) - (rigid-body-object-method-47 (_type_ process-drawable attack-info touching-shapes-entry penetrate) symbol 47) - (rigid-body-object-method-48 (_type_ process-focusable touching-shapes-entry) symbol 48) - (rigid-body-object-method-49 (_type_ rigid-body-impact touching-shapes-entry) none 49) - (rigid-body-object-method-50 (_type_ float) none 50) - (rigid-body-object-method-51 (_type_) none 51) - (rigid-body-object-method-52 (_type_) none 52) + (:state-methods + idle + active + ) + (:methods + (rigid-body-object-method-29 (_type_ float) none) ;; 29 + (rigid-body-object-method-30 (_type_) none) ;; 30 + (alloc-and-init-rigid-body-control (_type_ rigid-body-object-constants) none) ;; 31 + (allocate-and-init-cshape (_type_) none) ;; 32 + (init-skel-and-rigid-body (_type_) none) ;; 33 + (rigid-body-object-method-34 (_type_) none) ;; 34 + (rigid-body-object-method-35 (_type_) none) ;; 35 + (do-engine-sounds (_type_) none) ;; 36 + (rigid-body-object-method-37 (_type_) none) ;; 37 + (rigid-body-object-method-38 (_type_) none) ;; 38 + (rigid-body-object-method-39 (_type_) none) ;; 39 + (rigid-body-object-method-40 (_type_) none) ;; 40 + (rigid-body-object-method-41 (_type_) none) ;; 41 + (rigid-body-object-method-42 (_type_) none :behavior rigid-body-object) ;; 42 + (rigid-body-object-method-43 (_type_) none) ;; 43 + (apply-damage (_type_ float rigid-body-impact) none) ;; 44 + (rigid-body-object-method-45 (_type_ rigid-body-impact) none) ;; 45 + (rigid-body-object-method-46 (_type_ process-drawable int symbol event-message-block) object :behavior rigid-body-object) ;; 46 + (rigid-body-object-method-47 (_type_ process-drawable attack-info touching-shapes-entry penetrate) symbol) ;; 47 + (rigid-body-object-method-48 (_type_ process-focusable touching-shapes-entry) symbol) ;; 48 + (rigid-body-object-method-49 (_type_ rigid-body-impact touching-shapes-entry) none) ;; 49 + (rigid-body-object-method-50 (_type_ float) none) ;; 50 + (rigid-body-object-method-51 (_type_) none) ;; 51 + (rigid-body-object-method-52 (_type_) none) ;; 52 ) ) @@ -33883,14 +33634,14 @@ :size-assert #x408 :flag-assert #x1100000408 (:methods - (rigid-body-queue-method-9 (_type_) none 9) - (rigid-body-queue-method-10 (_type_) none 10) - (rigid-body-queue-method-11 (_type_ rigid-body-object) none 11) - (rigid-body-queue-method-12 (_type_ int int) none 12) - (rigid-body-queue-method-13 (_type_ int rigid-body-object) none 13) - (rigid-body-queue-method-14 (_type_ int) none 14) - (rigid-body-queue-method-15 (_type_ rigid-body-object) none 15) - (validate (_type_) symbol 16) + (rigid-body-queue-method-9 (_type_) none) ;; 9 + (rigid-body-queue-method-10 (_type_) none) ;; 10 + (rigid-body-queue-method-11 (_type_ rigid-body-object) none) ;; 11 + (rigid-body-queue-method-12 (_type_ int int) none) ;; 12 + (rigid-body-queue-method-13 (_type_ int rigid-body-object) none) ;; 13 + (rigid-body-queue-method-14 (_type_ int) none) ;; 14 + (rigid-body-queue-method-15 (_type_ rigid-body-object) none) ;; 15 + (validate (_type_) symbol) ;; 16 ) ) @@ -33948,26 +33699,26 @@ (:methods (execute-effects "Executes various ancillary tasks with the platform, such as spawning particles or playing the associated sound" - (_type_) none 27) + (_type_) none) ;; 27 (stop-bouncing! "Sets `bouncing` to false and resets related settings to their defaults" - (_type_) none 28) + (_type_) none) ;; 28 (start-bouncing! "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" - (_type_) none :behavior base-plat 29) + (_type_) none :behavior base-plat) ;; 29 (get-art-group "@returns The associated [[art-group]]" - (_type_) art-group 30) + (_type_) art-group) ;; 30 (init-plat-collision! "TODO - collision stuff for setting up the platform" - (_type_) none 31) - (base-plat-method-32 (_type_) none 32) + (_type_) none) ;; 31 + (base-plat-method-32 (_type_) none) ;; 32 (init-plat! "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." - (_type_) none 33) + (_type_) none) ;; 33 ) ) @@ -34001,19 +33752,21 @@ :method-count-assert 27 :size-assert #x124 :flag-assert #x1b00b00124 + (:state-methods + door-closed + door-opening + door-open + door-closing + ) (:methods - (door-closed () _type_ :state 20) - (door-opening () _type_ :state 21) - (door-open () _type_ :state 22) - (door-closing () _type_ :state 23) (lock-according-to-task! "If the associated subtask is completed, lock the door if [[eco-door-flags:0]] is set otherwise, lock it if [[eco-door-flags:0]] is set" - (_type_) none 24) - (eco-door-method-25 (_type_) none 25) ;; (TODO-RENAME-25 (_type_) none 25) + (_type_) none) ;; 24 + (eco-door-method-25 (_type_) none) ;; 25 ;; (TODO-RENAME-25 (_type_) none) ;; 25 (stub "@unused - Stub with no overrides" - (_type_) none 26) + (_type_) none) ;; 26 ) ) @@ -34052,15 +33805,17 @@ :method-count-assert 37 :size-assert #x144 :flag-assert #x2500d00144 + (:state-methods + plat-idle + plat-path-active + ) (:methods - (plat-idle () _type_ :state 34) - (plat-path-active () _type_ :state 35) (plat-path-sync "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @see [[sync-eased]]" - (_type_) object 36) + (_type_) object) ;; 36 ) ) @@ -34074,9 +33829,9 @@ :method-count-assert 36 :size-assert #x140 :flag-assert #x2400c00140 - (:methods - (idle () _type_ :state 34) - (fall (symbol) _type_ :state 35) + (:state-methods + idle + (fall symbol) ) ) @@ -34115,28 +33870,30 @@ :method-count-assert 39 :size-assert #x120 :flag-assert #x2700a00120 + (:state-methods + down-idle + going-down + going-up + up-idle + ) (:methods - (down-idle () _type_ :state 27) ;; (TODO-RENAME-27 (_type_) collide-shape-moving 27) - (going-down () _type_ :state 28) ;; (arm-trigger-event! (_type_) symbol 28) - (going-up () _type_ :state 29) ;; (TODO-RENAME-29 (_type_ symbol entity) none 29) - (up-idle () _type_ :state 30) ;; (move-to-vec-or-quat! (_type_ vector quaternion) quaternion 30) - (reset! (_type_) none 31) ;; (press! (_type_ symbol) int 31) + (reset! (_type_) none) ;; 31 ;; (press! (_type_ symbol) int) ;; 31 (idle-state-transition "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" - (_type_) object 32) - (basebutton-method-33 "TODO - joint stuff" (_type_) none 33) - (basebutton-method-34 "TODO - collision stuff" (_type_) none 34) + (_type_) object) ;; 32 + (basebutton-method-33 "TODO - joint stuff" (_type_) none) ;; 33 + (basebutton-method-34 "TODO - collision stuff" (_type_) none) ;; 34 (prepare-trigger-event! "Sets `event-going-down` to `'trigger`" - (_type_) none 35) + (_type_) none) ;; 35 (send-event! "Prepares an [[event-message-block]] using the provided type to send an event to: - the `notify-actor` - every [[entity-actor]] in the `actor-group` array @see [[entity-actor]]" - (_type_ symbol) none :behavior basebutton 36) - (move-to! (_type_ vector quaternion) none 37) - (press! (_type_ symbol) entity-perm-status 38) + (_type_ symbol) none :behavior basebutton) ;; 36 + (move-to! (_type_ vector quaternion) none) ;; 37 + (press! (_type_ symbol) entity-perm-status) ;; 38 ) ) @@ -34154,12 +33911,14 @@ :method-count-assert 25 :size-assert #xd4 :flag-assert #x19006000d4 + (:state-methods + idle + fire + smush + ) (:methods - (idle () _type_ :state 20) - (fire () _type_ :state 21) - (smush () _type_ :state 22) - (init-skeleton! (_type_) none 23) - (bouncer-method-24 "TODO - collision stuff" (_type_) none 24) + (init-skeleton! (_type_) none) ;; 23 + (bouncer-method-24 "TODO - collision stuff" (_type_) none) ;; 24 ) ) @@ -34198,30 +33957,32 @@ :method-count-assert 28 :size-assert #x100 :flag-assert #x1c00800100 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) (conveyor-method-21 "TODO - quite dense, has to do with the conveyor sections and the path they are associated with" - (_type_) float 21) + (_type_) float) ;; 21 (get-art-group "@returns The respective [[art-group]] for the [[conveyor]]" - (_type_) art-group 22) + (_type_) art-group) ;; 22 (reset-root! "Re-initializes the `root` [[trsqv]]" - (_type_) none 23) + (_type_) none) ;; 23 (init! "Initializes defaults for things like the `speed` and `belt-radius`" - (_type_) none 24) + (_type_) none) ;; 24 (set-and-get-ambient-sound! "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" - (_type_) ambient-sound 25) + (_type_) ambient-sound) ;; 25 (conveyor-method-26 "TODO - conveyor section related, perhaps related to moving the process along the belt?" - (_type_ process-focusable) symbol :behavior conveyor 26) + (_type_ process-focusable) symbol :behavior conveyor) ;; 26 (conveyor-method-27 "TODO - collision related, has some dead code as well (previous iteration?)" - (_type_) symbol 27) + (_type_) symbol) ;; 27 ) ) @@ -34230,8 +33991,6 @@ :method-count-assert 28 :size-assert #x100 :flag-assert #x1c00800100 - (:methods - ) ) (deftype lgconveyor (conveyor) @@ -34239,8 +33998,6 @@ :method-count-assert 28 :size-assert #x100 :flag-assert #x1c00800100 - (:methods - ) ) @@ -34336,21 +34093,23 @@ :method-count-assert 49 :size-assert #x170 :flag-assert #x3100f00170 + (:state-methods + dormant + waiting + running + arrived + ) (:methods - (dormant () _type_ :state 34) - (waiting () _type_ :state 35) - (running () _type_ :state 36) - (arrived () _type_ :state 37) - (elevator-method-38 (_type_) none 38) + (elevator-method-38 (_type_) none) ;; 38 (calc-dist-between-points! "Calculates the distance between two points in the elevator's path. @param path-point-x The index of the first point in the distance calculation, and where `next-pos` and `dist` are stored in the `path-seq` array @param path-point-y The second point in the distance calculation" - (_type_ int int) none 39) + (_type_ int int) none) ;; 39 (activate-elevator "Puts the elevator initially into the correct state. This is typically based upon game completion" - (_type_) object 40) + (_type_) object) ;; 40 (init-defaults! "Initializes default settings related to the [[elevator]]: - `elevator-xz-threshold` @@ -34358,26 +34117,26 @@ - `elevator-start-pos` - `elevator-move-rate` - `elevator-flags`" - (_type_) none 41) + (_type_) none) ;; 41 (set-ambient-sound! "Sets the elevator's [[ambient-sound]] up" - (_type_) none 42) + (_type_) none) ;; 42 (move-between-points "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (_type_ vector float float) symbol 43) - (elevator-method-44 (_type_) symbol 44) + (_type_ vector float float) symbol) ;; 43 + (elevator-method-44 (_type_) symbol) ;; 44 (commited-to-ride? "@returns if the target is considered within the elevator area enough to begin descending/ascending" - (_type_) symbol 45) + (_type_) symbol) ;; 45 (move-to-next-point! "If the [[*target*]] is in a valid state and there is a point to transition to in the elevator's path do so. @see [[elevator::47]]" - (_type_) none 46) + (_type_) none) ;; 46 (find-closest-point-in-path! "Finds and sets the provided [[path-step]]'s `next-pos` field to the vertex index in the path which is closest to the provided [[vector]] @@ -34387,8 +34146,8 @@ @param arg2 TODO @param arg3 TODO @returns [[#t]] if a point in the path was found" - (_type_ vector (pointer float) symbol symbol) symbol 47) - (elevator-method-48 "TODO - collision related" (_type_) none 48) + (_type_ vector (pointer float) symbol symbol) symbol) ;; 47 + (elevator-method-48 "TODO - collision related" (_type_) none) ;; 48 ) ) @@ -34456,8 +34215,8 @@ :method-count-assert 15 :size-assert #x84 :flag-assert #xf00100084 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) @@ -34521,10 +34280,10 @@ :size-assert #x174 :flag-assert #x3901000174 (:methods - (rigid-body-platform-method-53 (_type_ vector) float 53) - (rigid-body-platform-method-54 (_type_ rigid-body-control-point) none 54) - (rigid-body-platform-method-55 (_type_) none 55) - (rigid-body-platform-method-56 (_type_ vector) none 56) + (rigid-body-platform-method-53 (_type_ vector) float) ;; 53 + (rigid-body-platform-method-54 (_type_ rigid-body-control-point) none) ;; 54 + (rigid-body-platform-method-55 (_type_) none) ;; 55 + (rigid-body-platform-method-56 (_type_ vector) none) ;; 56 ) ) @@ -34557,7 +34316,7 @@ :size-assert #x58 :flag-assert #x900000058 (:methods - (new (symbol type uint) _type_ 0) + (new (symbol type uint) _type_) ;; 0 ) ) @@ -34599,13 +34358,15 @@ ((num-joints int32 :offset-assert 4) (joint joint-exploder-joint :inline :dynamic :offset-assert 16) ;; guessed by decompiler ) - (:methods - (new (symbol type joint-exploder-static-params) _type_ 0)) + (:methods + (new (symbol type joint-exploder-static-params) _type_) ;; 0 + ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 (:methods - (new (symbol type joint-exploder-static-params) _type_ 0)) + (new (symbol type joint-exploder-static-params) _type_) ;; 0 + ) ) (deftype joint-exploder-list (structure) @@ -34634,16 +34395,16 @@ :size-assert #x240 :flag-assert #x1e01c00240 (:methods - (add-joint-to-list (_type_ joint-exploder-list int) int 20) ;; (TODO-RENAME-20 (_type_ joint-exploder-list int) int 20) - (update-bbox-for-joint (_type_ joint-exploder-list joint-exploder-joint) none 21) ;; (TODO-RENAME-21 (_type_ joint-exploder-list joint-exploder-joint) none 21) - (do-collision-response (_type_ joint-exploder-list) none 22) ;; (TODO-RENAME-22 (_type_ joint-exploder-list) symbol 22) - (init-joint-list (_type_) none 23) ;; (TODO-RENAME-23 (_type_) symbol 23) - (remove-from-list-and-reset (_type_ joint-exploder-list int) int 24) ;; (TODO-RENAME-24 (_type_ joint-exploder-list int) int 24) - (final-adjust (_type_ joint-exploder-list int) int 25) ;; (TODO-RENAME-25 (_type_ joint-exploder-list) symbol 25) - (integrate-and-kill (_type_ joint-exploder-list) none 26) ;; (TODO-RENAME-26 (_type_ joint-exploder-list int) int 26) - (remove-joint-from-list (_type_ joint-exploder-list int) int 27) ;; (TODO-RENAME-27 (_type_ joint-exploder-list int) joint-exploder-list 27) - (adjust-bbox-for-limits-along-axis (_type_ joint-exploder-list int) joint-exploder-list 28) ;; (TODO-RENAME-28 (_type_ joint-exploder-list) none 28) - (adjust-bbox-for-limits (_type_ joint-exploder-list) none 29) + (add-joint-to-list (_type_ joint-exploder-list int) int) ;; 20 ;; (TODO-RENAME-20 (_type_ joint-exploder-list int) int) ;; 20 + (update-bbox-for-joint (_type_ joint-exploder-list joint-exploder-joint) none) ;; 21 ;; (TODO-RENAME-21 (_type_ joint-exploder-list joint-exploder-joint) none) ;; 21 + (do-collision-response (_type_ joint-exploder-list) none) ;; 22 ;; (TODO-RENAME-22 (_type_ joint-exploder-list) symbol) ;; 22 + (init-joint-list (_type_) none) ;; 23 ;; (TODO-RENAME-23 (_type_) symbol) ;; 23 + (remove-from-list-and-reset (_type_ joint-exploder-list int) int) ;; 24 ;; (TODO-RENAME-24 (_type_ joint-exploder-list int) int) ;; 24 + (final-adjust (_type_ joint-exploder-list int) int) ;; 25 ;; (TODO-RENAME-25 (_type_ joint-exploder-list) symbol) ;; 25 + (integrate-and-kill (_type_ joint-exploder-list) none) ;; 26 ;; (TODO-RENAME-26 (_type_ joint-exploder-list int) int) ;; 26 + (remove-joint-from-list (_type_ joint-exploder-list int) int) ;; 27 ;; (TODO-RENAME-27 (_type_ joint-exploder-list int) joint-exploder-list) ;; 27 + (adjust-bbox-for-limits-along-axis (_type_ joint-exploder-list int) joint-exploder-list) ;; 28 ;; (TODO-RENAME-28 (_type_ joint-exploder-list) none) ;; 28 + (adjust-bbox-for-limits (_type_ joint-exploder-list) none) ;; 29 ) (:states joint-exploder-shatter) @@ -34662,8 +34423,8 @@ :method-count-assert 28 :size-assert #xd0 :flag-assert #x1c005000d0 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) @@ -34683,9 +34444,9 @@ :method-count-assert 22 :size-assert #xd0 :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) + (:state-methods + idle + active ) ) @@ -34711,8 +34472,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype metalkor-highres (process-drawable) @@ -34720,8 +34479,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -34730,8 +34489,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype keira-npc (process-taskable) @@ -34739,8 +34496,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype krew-npc (process-taskable) @@ -34748,8 +34503,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype kid-npc (process-taskable) @@ -34757,8 +34510,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype crocadog-npc (process-taskable) @@ -34766,8 +34517,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype torn-npc (process-taskable) @@ -34775,8 +34524,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype youngsamos-npc (process-taskable) @@ -34784,8 +34531,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype samos-npc (process-taskable) @@ -34793,8 +34538,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype onin-npc (process-taskable) @@ -34802,8 +34545,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype pecker-npc (process-taskable) @@ -34811,8 +34552,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype brutter-npc (process-taskable) @@ -34820,8 +34559,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype ashelin-npc (process-taskable) @@ -34829,8 +34566,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype daxter-npc (process-taskable) @@ -34838,8 +34573,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (define-extern intro-play @@ -34865,8 +34598,8 @@ :method-count-assert 15 :size-assert #x84 :flag-assert #xf00100084 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) @@ -34904,13 +34637,15 @@ :method-count-assert 26 :size-assert #x100 :flag-assert #x1a00800100 + (:state-methods + idle + (use continue-point) + hidden + ) (:methods - (idle () _type_ :state 20) - (use (continue-point) _type_ :state 21) - (hidden () _type_ :state 22) - (init-skel-and-collide (_type_) none 23) - (setup-fields (_type_) none 24) - (handle-notice (_type_) continue-point 25) + (init-skel-and-collide (_type_) none) ;; 23 + (setup-fields (_type_) none) ;; 24 + (handle-notice (_type_) continue-point) ;; 25 ) ) @@ -34945,8 +34680,6 @@ :method-count-assert 40 :size-assert #x1f0 :flag-assert #x28017001f0 - (:methods - ) ) (deftype vehicle-grenade (projectile-bounce) @@ -34955,8 +34688,6 @@ :method-count-assert 42 :size-assert #x1f4 :flag-assert #x2a018001f4 - (:methods - ) ) (deftype guard-lazer-shot (projectile) @@ -34964,8 +34695,6 @@ :method-count-assert 40 :size-assert #x1d8 :flag-assert #x28016001d8 - (:methods - ) ) (define-extern guard-shot-move (function guard-shot none)) @@ -34981,8 +34710,6 @@ :method-count-assert 40 :size-assert #x1f0 :flag-assert #x28017001f0 - (:methods - ) ) (deftype metalhead-grenade-shot (projectile) @@ -34992,8 +34719,6 @@ :method-count-assert 40 :size-assert #x1f4 :flag-assert #x28018001f4 - (:methods - ) ) (define-extern metalhead-shot-move (function metalhead-shot none)) @@ -35063,17 +34788,19 @@ :method-count-assert 186 :size-assert #x2b4 :flag-assert #xba024002b4 + (:state-methods + attack + falling-ambush + jumping-ambush + jumping-ambush-cont + wait-for-focus + spin-attack + ) (:methods - (attack () _type_ :state 178) - (falling-ambush () _type_ :state 179) - (jumping-ambush () _type_ :state 180) - (jumping-ambush-cont () _type_ :state 181) - (wait-for-focus () _type_ :state 182) - (spin-attack () _type_ :state 183) - (grunt-method-184 (_type_ float) process-focusable 184) + (grunt-method-184 (_type_ float) process-focusable) ;; 184 (get-enemy-info "@returns the [[nav-enemy-info]] associated with this type of grunt" - (_type_) nav-enemy-info 185) + (_type_) nav-enemy-info) ;; 185 ) ) @@ -35100,13 +34827,15 @@ :method-count-assert 184 :size-assert #x2b8 :flag-assert #xb8024002b8 + (:state-methods + attack + ambush-jumping + ) (:methods - (attack () _type_ :state 178) - (ambush-jumping () _type_ :state 179) - (flitter-method-180 (_type_) none 180) - (flitter-method-181 (_type_) none 181) - (flitter-method-182 (_type_ process-focusable) symbol 182) - (flitter-method-183 (_type_) float 183) + (flitter-method-180 (_type_) none) ;; 180 + (flitter-method-181 (_type_) none) ;; 181 + (flitter-method-182 (_type_ process-focusable) symbol) ;; 182 + (flitter-method-183 (_type_) float) ;; 183 ) ) @@ -35236,40 +34965,42 @@ :size-assert #x110 :flag-assert #x3500900110 ;; field on-notice uses ~A with a signed load field on-hostile uses ~A with a signed load field on-beaten uses ~A with a signed load - (:methods - (idle () _type_ :state 20) - (battle-method-21 () none 21) - (notice () _type_ :state 22) - (hostile () _type_ :state 23) - (beaten () _type_ :state 24) - (spawner-blocked? (_type_ battle-spawner) symbol 25) - (spawner-blocked-by-collide? (_type_ battle-spawner) symbol 26) - (draw-battle-marks (_type_) none 27) - (initialize-enemy-lists (_type_) none 28) - (initialize-spawner-breeds (_type_ battle-spawner entity-actor) none 29) - (get-spawner-for-enemy (_type_ process) battle-spawner 30) - (initialize-ally (_type_ battle-ally entity-actor) none 31) - (initialize-spawner (_type_ battle-spawner entity-actor) none 32) - (initialize-battle (_type_) none 33) - (init-go (_type_) int 34) - (get-spawn-delay (_type_) int 35) - (get-best-spawner (_type_) battle-spawner 36) - (spawner-free? (_type_ battle-spawner) symbol 37) - (spawn-from-breed (_type_ battle-breed enemy-init-by-other-params) handle 38) - (spawn-from-spawner (_type_ battle-spawner symbol) none 39) - (spawn-initial-creatures (_type_) none 40) - (get-random-breed (_type_ battle-spawner) battle-breed 41) - (spawner-hit (_type_ battle-spawner process) symbol 42) - (spawner-try-jump (_type_ battle-spawner enemy) symbol 43) - (spawner-do-jump (_type_ battle-spawner) int 44) - (spawner-hittable? (_type_ battle-spawner) symbol 45) - (spawner-in-intro? (_type_ battle-spawner) symbol 46) - (set-battle-music (_type_) none 47) - (unset-battle-music (_type_) none 48) - (update-allies-list (_type_) int :behavior battle 49) - (beaten? (_type_) symbol 50) - (spawner-active? (_type_ battle-spawner symbol) symbol :behavior battle 51) - (spawner-active-count (_type_) int 52) + (:state-methods + idle + battle-state-21 + notice + hostile + beaten + ) + (:methods + (spawner-blocked? (_type_ battle-spawner) symbol) ;; 25 + (spawner-blocked-by-collide? (_type_ battle-spawner) symbol) ;; 26 + (draw-battle-marks (_type_) none) ;; 27 + (initialize-enemy-lists (_type_) none) ;; 28 + (initialize-spawner-breeds (_type_ battle-spawner entity-actor) none) ;; 29 + (get-spawner-for-enemy (_type_ process) battle-spawner) ;; 30 + (initialize-ally (_type_ battle-ally entity-actor) none) ;; 31 + (initialize-spawner (_type_ battle-spawner entity-actor) none) ;; 32 + (initialize-battle (_type_) none) ;; 33 + (init-go (_type_) int) ;; 34 + (get-spawn-delay (_type_) int) ;; 35 + (get-best-spawner (_type_) battle-spawner) ;; 36 + (spawner-free? (_type_ battle-spawner) symbol) ;; 37 + (spawn-from-breed (_type_ battle-breed enemy-init-by-other-params) handle) ;; 38 + (spawn-from-spawner (_type_ battle-spawner symbol) none) ;; 39 + (spawn-initial-creatures (_type_) none) ;; 40 + (get-random-breed (_type_ battle-spawner) battle-breed) ;; 41 + (spawner-hit (_type_ battle-spawner process) symbol) ;; 42 + (spawner-try-jump (_type_ battle-spawner enemy) symbol) ;; 43 + (spawner-do-jump (_type_ battle-spawner) int) ;; 44 + (spawner-hittable? (_type_ battle-spawner) symbol) ;; 45 + (spawner-in-intro? (_type_ battle-spawner) symbol) ;; 46 + (set-battle-music (_type_) none) ;; 47 + (unset-battle-music (_type_) none) ;; 48 + (update-allies-list (_type_) int :behavior battle) ;; 49 + (beaten? (_type_) symbol) ;; 50 + (spawner-active? (_type_ battle-spawner symbol) symbol :behavior battle) ;; 51 + (spawner-active-count (_type_) int) ;; 52 ) ) @@ -35333,34 +35064,36 @@ :method-count-assert 30 :size-assert #x200 :flag-assert #x1e01800200 + (:state-methods + idle + active + shutdown + ) (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (shutdown () _type_ :state 22) (get-params "@returns [[*default-elec-gate-params*]] by default" - (_type_) elec-gate-params 23) - (elec-gate-method-24 (_type_) none 24) + (_type_) elec-gate-params) ;; 23 + (elec-gate-method-24 (_type_) none) ;; 24 (set-palette! "Sets the [[elec-gate]]'s `palette-id` appropriately" - (_type_) none 25) + (_type_) none) ;; 25 (set-state! "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed make the gate `idle`. Otherwise, the gate will be `active`." - (_type_) none 26) + (_type_) none) ;; 26 (spawn-particles "TODO - Calls [[sparticle-launch-control::11]] on `part-spawner-left` and `part-spawner-right` if they are defined" - (_type_ sparticle-launch-control) none 27) + (_type_ sparticle-launch-control) none) ;; 27 (set-elec-scale-if-close! "If [[target]]'s position is within `80` [[meters]], set the scale to the value provided - @see [[elec-gate::29]]" (_type_ float) none 28) + @see [[elec-gate::29]]" (_type_ float) none) ;; 28 (set-elec-scale! "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" - (_type_ float) none 29) + (_type_ float) none) ;; 29 ) ) @@ -35370,8 +35103,6 @@ :method-count-assert 30 :size-assert #x204 :flag-assert #x1e01900204 - (:methods - ) ) (deftype drill-elec-gate (elec-gate) @@ -35380,7 +35111,7 @@ :method-count-assert 30 :size-assert #x204 :flag-assert #x1e01900204 - (:methods)) + ) (deftype caspad-elec-gate (elec-gate) () @@ -35402,7 +35133,7 @@ :method-count-assert 30 :size-assert #x204 :flag-assert #x1e01900204 - (:methods)) + ) (define-extern *default-elec-gate-params* elec-gate-params) (define-extern elec-gate-post (function none :behavior elec-gate)) @@ -35417,8 +35148,8 @@ :method-count-assert 40 :size-assert #x120 :flag-assert #x2800a00120 - (:methods - (pop-up () _type_ :state 39) + (:state-methods + pop-up ) ) @@ -35452,10 +35183,12 @@ :method-count-assert 17 :size-assert #xf0 :flag-assert #x11007000f0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (spawn-parts (_type_) none 15) - (update-mode (_type_) none 16) + (spawn-parts (_type_) none) ;; 15 + (update-mode (_type_) none) ;; 16 ) ) @@ -35491,8 +35224,6 @@ :method-count-assert 40 :size-assert #x1f0 :flag-assert #x28017001f0 - (:methods - ) ) (defenum spyder-flags @@ -35528,15 +35259,17 @@ :method-count-assert 186 :size-assert #x3b0 :flag-assert #xba033003b0 + (:state-methods + attack + backup + ) (:methods - (attack () _type_ :state 178) - (backup () _type_ :state 179) - (spyder-method-180 (_type_) none 180) - (spyder-method-181 (_type_) none 181) - (spyder-method-182 (_type_) none 182) - (spyder-method-183 (_type_ matrix float) none 183) ;; arg0 guess - (spyder-method-184 (_type_ vector) none 184) - (spyder-method-185 (_type_) none 185) + (spyder-method-180 (_type_) none) ;; 180 + (spyder-method-181 (_type_) none) ;; 181 + (spyder-method-182 (_type_) none) ;; 182 + (spyder-method-183 (_type_ matrix float) none) ;; 183 ;; arg0 guess + (spyder-method-184 (_type_ vector) none) ;; 184 + (spyder-method-185 (_type_) none) ;; 185 ) ) @@ -35642,34 +35375,37 @@ :method-count-assert 205 :size-assert #x3b0 :flag-assert #xcd033003b0 - (:methods - (gun-shoot () _type_ :state 178) - (attack () _type_ :state 179) - (get-up-front () _type_ :state 180) - (get-up-back () _type_ :state 181) - (close-attack () _type_ :state 182) - (grenade-attack () _type_ :state 183) - (exit-transport () _type_ :state 184) - (blast-hostile () _type_ :state 185) - (grenade-hostile () _type_ :state 186) - (tazer-hostile () _type_ :state 187) - (roll-right () _type_ :state 188) - (roll-left () _type_ :state 189) - (arrest () _type_ :state 190) - (crimson-guard-level-method-191 (_type_) (pointer process) 191) - (crimson-guard-level-method-192 (_type_) none 192) - (crimson-guard-level-method-193 (_type_) symbol 193) - (crimson-guard-level-method-194 (_type_) symbol 194) - (crimson-guard-level-method-195 (_type_ vector vector vector) int 195) - (crimson-guard-level-method-196 (_type_ vector) none 196) - (crimson-guard-level-method-197 (_type_) quaternion 197) - (crimson-guard-level-method-198 (_type_) none 198) - (crimson-guard-level-method-199 (_type_ vector vector vector float) symbol 199) - (crimson-guard-level-method-200 (_type_) float 200) - (crimson-guard-level-method-201 (_type_ float) none 201) - (crimson-guard-level-method-202 (_type_ vector) float 202) - (crimson-guard-level-method-203 "TODO - probably a flag" (_type_ int) none 203) - (crimson-guard-level-method-204 (_type_) none 204))) + (:state-methods + gun-shoot + attack + get-up-front + get-up-back + close-attack + grenade-attack + exit-transport + blast-hostile + grenade-hostile + tazer-hostile + roll-right + roll-left + arrest + ) + (:methods + (crimson-guard-level-method-191 (_type_) (pointer process)) ;; 191 + (crimson-guard-level-method-192 (_type_) none) ;; 192 + (crimson-guard-level-method-193 (_type_) symbol) ;; 193 + (crimson-guard-level-method-194 (_type_) symbol) ;; 194 + (crimson-guard-level-method-195 (_type_ vector vector vector) int) ;; 195 + (crimson-guard-level-method-196 (_type_ vector) none) ;; 196 + (crimson-guard-level-method-197 (_type_) quaternion) ;; 197 + (crimson-guard-level-method-198 (_type_) none) ;; 198 + (crimson-guard-level-method-199 (_type_ vector vector vector float) symbol) ;; 199 + (crimson-guard-level-method-200 (_type_) float) ;; 200 + (crimson-guard-level-method-201 (_type_ float) none) ;; 201 + (crimson-guard-level-method-202 (_type_ vector) float) ;; 202 + (crimson-guard-level-method-203 "TODO - probably a flag" (_type_ int) none) ;; 203 + (crimson-guard-level-method-204 (_type_) none) ;; 204 + )) (deftype crimson-guard-level-params (structure) ((pos vector :inline :offset-assert 0) @@ -35735,12 +35471,14 @@ :method-count-assert 25 :size-assert #xe0 :flag-assert #x19006000e0 + (:state-methods + dormant + active + notice + die + ) (:methods - (dormant () _type_ :state 20) - (active () _type_ :state 21) - (notice () _type_ :state 22) - (die () _type_ :state 23) - (guard-conversation-method-24 (_type_) symbol 24) + (guard-conversation-method-24 (_type_) symbol) ;; 24 ) ) @@ -35768,15 +35506,17 @@ :method-count-assert 35 :size-assert #x150 :flag-assert #x2300d00150 + (:state-methods + come-down + idle + leave + die-fast + ) (:methods - (come-down () _type_ :state 27) - (idle () _type_ :state 28) - (leave () _type_ :state 29) - (die-fast () _type_ :state 30) - (transport-level-method-31 (_type_) none 31) - (transport-level-method-32 (_type_) none 32) - (transport-level-method-33 (_type_) uint 33) - (transport-level-method-34 (_type_) none 34) + (transport-level-method-31 (_type_) none) ;; 31 + (transport-level-method-32 (_type_) none) ;; 32 + (transport-level-method-33 (_type_) uint) ;; 33 + (transport-level-method-34 (_type_) none) ;; 34 ) ) @@ -35841,21 +35581,21 @@ :size-assert #x438 :flag-assert #x1500000438 (:methods - (new (symbol type object entity float vector float handle) _type_ 0) - (set-anchor-proc (_type_ handle) int 9) + (new (symbol type object entity float vector float handle) _type_) ;; 0 + (set-anchor-proc (_type_ handle) int) ;; 9 ;; TODO This calls vector-rotate-y as its main function, check what it's rotating to rename - (hover-formation-control-method-10 (_type_ vector vector float) symbol 10) - (hover-formation-control-method-11 (_type_) int 11) + (hover-formation-control-method-10 (_type_ vector vector float) symbol) ;; 10 + (hover-formation-control-method-11 (_type_) int) ;; 11 ;; TODO Check what the formation types are to see what this is really looking for - (is-formation-type-in-range (_type_) symbol 12) - (hover-formation-control-method-13 (_type_ vector) vector 13) - (hover-formation-control-method-14 (_type_) none 14) - (hover-formation-control-method-15 (_type_ vector vector) vector 15) - (hover-formation-control-method-16 (_type_) object 16) - (hover-formation-control-method-17 (_type_ process) int 17) - (hover-formation-control-method-18 (_type_ process) int 18) - (try-update-formation-type (_type_ formation-type) int 19) - (hover-formation-control-method-20 (_type_ object object) none 20) ;; NOT DEFINED ANYWHERE! + (is-formation-type-in-range (_type_) symbol) ;; 12 + (hover-formation-control-method-13 (_type_ vector) vector) ;; 13 + (hover-formation-control-method-14 (_type_) none) ;; 14 + (hover-formation-control-method-15 (_type_ vector vector) vector) ;; 15 + (hover-formation-control-method-16 (_type_) object) ;; 16 + (hover-formation-control-method-17 (_type_ process) int) ;; 17 + (hover-formation-control-method-18 (_type_ process) int) ;; 18 + (try-update-formation-type (_type_ formation-type) int) ;; 19 + (hover-formation-control-method-20 (_type_ object object) none) ;; 20 ;; NOT DEFINED ANYWHERE! ) ) @@ -35867,9 +35607,11 @@ :method-count-assert 16 :size-assert #x90 :flag-assert #x1000100090 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (hover-formation-method-15 (_type_ vector vector) int 15) + (hover-formation-method-15 (_type_ vector vector) int) ;; 15 ) ) @@ -35964,7 +35706,7 @@ :size-assert #x60 :flag-assert #xa00000060 (:methods - (hover-nav-path-segment-method-9 (_type_ float) none 9) + (hover-nav-path-segment-method-9 (_type_ float) none) ;; 9 ) ) @@ -35978,7 +35720,7 @@ :size-assert #x10 :flag-assert #xa00000010 (:methods - (hover-nav-path-info-method-9 (_type_) none 9) + (hover-nav-path-info-method-9 (_type_) none) ;; 9 ) ) @@ -36007,31 +35749,31 @@ :size-assert #x7c :flag-assert #x210000007c (:methods - (new (symbol type) _type_ 0) - (nav-network-method-9 (_type_) none 9) - (nav-network-method-10 (_type_ level (array nav-network-info)) none 10) - (nav-network-method-11 (_type_) none 11) - (nav-network-method-12 (_type_) none 12) - (nav-network-method-13 (_type_ int nav-network-path-node) none 13) - (nav-network-method-14 (_type_ int nav-network-path-node) object 14) - (nav-network-method-15 (_type_ nav-network-path-node) object 15) - (nav-network-method-16 (_type_ nav-network-path-node) none 16) - (nav-network-method-17 (_type_) nav-network-path-node 17) - (nav-network-method-18 (_type_ nav-network-path-node) none 18) - (nav-network-method-19 (_type_ nav-network-path-node) none 19) - (nav-network-method-20 (_type_ nav-network-path-node vector) none 20) - (nav-network-method-21 (_type_ object int int) none 21) - (nav-network-method-22 (_type_ hover-nav-path-info vector vector int int) hover-nav-path-segment 22) - (nav-network-method-23 (_type_ hover-nav-path-info) none 23) - (nav-network-method-24 (_type_ hover-nav-path-info int int int) symbol 24) - (nav-network-method-25 (_type_ process collide-prim-core) none 25) - (nav-network-method-26 (_type_ vector process vector vector float) vector 26) - (nav-network-method-27 (_type_) none 27) - (nav-network-method-28 (_type_) none 28) - (nav-network-method-29 (_type_) symbol 29) - (get-network (_type_) (array nav-network-info) 30) - (nav-network-method-31 (_type_ bounding-box) none 31) - (nav-network-method-32 (_type_ string) none 32) + (new (symbol type) _type_) ;; 0 + (nav-network-method-9 (_type_) none) ;; 9 + (nav-network-method-10 (_type_ level (array nav-network-info)) none) ;; 10 + (nav-network-method-11 (_type_) none) ;; 11 + (nav-network-method-12 (_type_) none) ;; 12 + (nav-network-method-13 (_type_ int nav-network-path-node) none) ;; 13 + (nav-network-method-14 (_type_ int nav-network-path-node) object) ;; 14 + (nav-network-method-15 (_type_ nav-network-path-node) object) ;; 15 + (nav-network-method-16 (_type_ nav-network-path-node) none) ;; 16 + (nav-network-method-17 (_type_) nav-network-path-node) ;; 17 + (nav-network-method-18 (_type_ nav-network-path-node) none) ;; 18 + (nav-network-method-19 (_type_ nav-network-path-node) none) ;; 19 + (nav-network-method-20 (_type_ nav-network-path-node vector) none) ;; 20 + (nav-network-method-21 (_type_ object int int) none) ;; 21 + (nav-network-method-22 (_type_ hover-nav-path-info vector vector int int) hover-nav-path-segment) ;; 22 + (nav-network-method-23 (_type_ hover-nav-path-info) none) ;; 23 + (nav-network-method-24 (_type_ hover-nav-path-info int int int) symbol) ;; 24 + (nav-network-method-25 (_type_ process collide-prim-core) none) ;; 25 + (nav-network-method-26 (_type_ vector process vector vector float) vector) ;; 26 + (nav-network-method-27 (_type_) none) ;; 27 + (nav-network-method-28 (_type_) none) ;; 28 + (nav-network-method-29 (_type_) symbol) ;; 29 + (get-network (_type_) (array nav-network-info)) ;; 30 + (nav-network-method-31 (_type_ bounding-box) none) ;; 31 + (nav-network-method-32 (_type_ string) none) ;; 32 ) ) @@ -36091,30 +35833,30 @@ :size-assert #xd8 :flag-assert #x20000000d8 (:methods - (new (symbol type process collide-shape-moving hover-nav-params) _type_ 0) - (hover-nav-control-method-9 (_type_) none 9) - (hover-nav-control-method-10 (_type_ vector vector vector) none 10) - (hover-nav-control-method-11 (_type_ vector) none 11) - (hover-nav-control-method-12 (_type_) none 12) - (hover-nav-control-method-13 (_type_) none 13) - (hover-nav-control-method-14 (_type_ float float) none 14) - (hover-nav-control-method-15 (_type_ vector) none 15) - (hover-nav-control-method-16 (_type_ vector) vector 16) - (hover-nav-control-method-17 (_type_) collide-prim-core 17) - (hover-nav-control-method-18 (_type_ path-control int int) none 18) - (hover-nav-control-method-19 (_type_ (inline-array vector) int) none 19) - (hover-nav-control-method-20 (_type_) none 20) - (hover-nav-control-method-21 (_type_) none 21) - (hover-nav-control-method-22 (_type_) hover-nav-path-segment 22) - (hover-nav-control-method-23 (_type_) object 23) - (hover-nav-control-method-24 (_type_) none 24) - (hover-nav-control-method-25 (_type_) none 25) - (hover-nav-control-method-26 (_type_ vector vector float) symbol 26) - (hover-nav-control-method-27 (_type_ vector vector) int 27) - (hover-nav-control-method-28 (_type_ vector vector) none 28) - (hover-nav-control-method-29 (_type_ vector) none 29) - (hover-nav-control-method-30 (_type_) float 30) - (hover-nav-control-method-31 (_type_) float 31) + (new (symbol type process collide-shape-moving hover-nav-params) _type_) ;; 0 + (hover-nav-control-method-9 (_type_) none) ;; 9 + (hover-nav-control-method-10 (_type_ vector vector vector) none) ;; 10 + (hover-nav-control-method-11 (_type_ vector) none) ;; 11 + (hover-nav-control-method-12 (_type_) none) ;; 12 + (hover-nav-control-method-13 (_type_) none) ;; 13 + (hover-nav-control-method-14 (_type_ float float) none) ;; 14 + (hover-nav-control-method-15 (_type_ vector) none) ;; 15 + (hover-nav-control-method-16 (_type_ vector) vector) ;; 16 + (hover-nav-control-method-17 (_type_) collide-prim-core) ;; 17 + (hover-nav-control-method-18 (_type_ path-control int int) none) ;; 18 + (hover-nav-control-method-19 (_type_ (inline-array vector) int) none) ;; 19 + (hover-nav-control-method-20 (_type_) none) ;; 20 + (hover-nav-control-method-21 (_type_) none) ;; 21 + (hover-nav-control-method-22 (_type_) hover-nav-path-segment) ;; 22 + (hover-nav-control-method-23 (_type_) object) ;; 23 + (hover-nav-control-method-24 (_type_) none) ;; 24 + (hover-nav-control-method-25 (_type_) none) ;; 25 + (hover-nav-control-method-26 (_type_ vector vector float) symbol) ;; 26 + (hover-nav-control-method-27 (_type_ vector vector) int) ;; 27 + (hover-nav-control-method-28 (_type_ vector vector) none) ;; 28 + (hover-nav-control-method-29 (_type_ vector) none) ;; 29 + (hover-nav-control-method-30 (_type_) float) ;; 30 + (hover-nav-control-method-31 (_type_) float) ;; 31 ) ) @@ -36173,26 +35915,28 @@ :method-count-assert 156 :size-assert #x310 :flag-assert #x9c02900310 + (:state-methods + knocked-recover + flying-death + flying-death-explode + ) (:methods - (knocked-recover () _type_ :state 137) - (flying-death () _type_ :state 138) - (flying-death-explode () _type_ :state 139) - (hover-enemy-method-140 (_type_ symbol) none 140) - (hover-enemy-method-141 (_type_ float) none 141) - (hover-enemy-method-142 (_type_) none 142) - (hover-enemy-method-143 (_type_ int float) none 143) - (hover-enemy-method-144 (_type_) none 144) - (hover-enemy-method-145 (_type_ int float int int) none 145) - (hover-enemy-method-146 (_type_) none 146) - (hover-enemy-method-147 (_type_) none 147) - (hover-enemy-method-148 (_type_) none 148) - (hover-enemy-method-149 (_type_) none 149) - (hover-enemy-method-150 (_type_) enemy-info 150) - (hover-enemy-method-151 (_type_) hover-enemy-info 151) - (hover-enemy-method-152 (_type_) hover-nav-params 152) - (hover-enemy-method-153 (_type_) none 153) - (hover-enemy-method-154 (_type_) none 154) - (hover-enemy-method-155 (_type_) none 155) + (hover-enemy-method-140 (_type_ symbol) none) ;; 140 + (hover-enemy-method-141 (_type_ float) none) ;; 141 + (hover-enemy-method-142 (_type_) none) ;; 142 + (hover-enemy-method-143 (_type_ int float) none) ;; 143 + (hover-enemy-method-144 (_type_) none) ;; 144 + (hover-enemy-method-145 (_type_ int float int int) none) ;; 145 + (hover-enemy-method-146 (_type_) none) ;; 146 + (hover-enemy-method-147 (_type_) none) ;; 147 + (hover-enemy-method-148 (_type_) none) ;; 148 + (hover-enemy-method-149 (_type_) none) ;; 149 + (hover-enemy-method-150 (_type_) enemy-info) ;; 150 + (hover-enemy-method-151 (_type_) hover-enemy-info) ;; 151 + (hover-enemy-method-152 (_type_) hover-nav-params) ;; 152 + (hover-enemy-method-153 (_type_) none) ;; 153 + (hover-enemy-method-154 (_type_) none) ;; 154 + (hover-enemy-method-155 (_type_) none) ;; 155 ) ) @@ -36217,8 +35961,8 @@ :method-count-assert 15 :size-assert #x84 :flag-assert #xf00100084 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) @@ -36260,17 +36004,19 @@ :method-count-assert 166 :size-assert #x388 :flag-assert #xa603100388 + (:state-methods + shoot-bridge-wait + shoot-bridge-intro + shoot-bridge-hold + shoot-bridge-hostile + shoot-bridge-attack + shoot-bridge-outro + attack + die-now + die-explode + ) (:methods - (shoot-bridge-wait () _type_ :state 156) - (shoot-bridge-intro () _type_ :state 157) - (shoot-bridge-hold () _type_ :state 158) - (shoot-bridge-hostile () _type_ :state 159) - (shoot-bridge-attack () _type_ :state 160) - (shoot-bridge-outro () _type_ :state 161) - (attack () _type_ :state 162) - (die-now () _type_ :state 163) - (die-explode () _type_ :state 164) - (spawn-wasp-shot (_type_ projectile-init-by-other-params int float float) none 165) + (spawn-wasp-shot (_type_ projectile-init-by-other-params int float float) none) ;; 165 ) ) @@ -36307,12 +36053,14 @@ :method-count-assert 19 :size-assert #xa8 :flag-assert #x13003000a8 + (:state-methods + idle + spawning + die + ) (:methods - (idle () _type_ :state 14) - (spawning () _type_ :state 15) - (die () _type_ :state 16) - (hover-enemy-manager-init! "Initialize this [[hover-enemy-manager]]." (_type_ (array hover-enemy-battle-command)) none 17) - (spawn-enemy (_type_ uint) none 18) + (hover-enemy-manager-init! "Initialize this [[hover-enemy-manager]]." (_type_ (array hover-enemy-battle-command)) none) ;; 17 + (spawn-enemy (_type_ uint) none) ;; 18 ) ) @@ -36355,7 +36103,7 @@ :size-assert #x20 :flag-assert #x900000020 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ;; 0 ) ) @@ -36369,9 +36117,9 @@ :size-assert #x1c :flag-assert #xb0000001c (:methods - (new (symbol type) _type_ 0) - (hover-nav-bsp-node-method-9 (_type_) none 9) - (hover-nav-bsp-node-method-10 (_type_ int) none 10) + (new (symbol type) _type_) ;; 0 + (hover-nav-bsp-node-method-9 (_type_) none) ;; 9 + (hover-nav-bsp-node-method-10 (_type_ int) none) ;; 10 ) ) @@ -36406,8 +36154,6 @@ :method-count-assert 40 :size-assert #x1f0 :flag-assert #x28017001f0 - (:methods - ) ) (define-extern *wasp-exploder-params* joint-exploder-static-params) @@ -36423,8 +36169,6 @@ :method-count-assert 40 :size-assert #x1f0 :flag-assert #x28017001f0 - (:methods - ) ) (deftype crimson-guard-hover (hover-enemy) @@ -36453,14 +36197,16 @@ :method-count-assert 163 :size-assert #x400 :flag-assert #xa303800400 + (:state-methods + ambush-fly + ambush-attack + kick-attack + attack + die-now + ) (:methods - (ambush-fly () _type_ :state 156) - (ambush-attack () _type_ :state 157) - (kick-attack () _type_ :state 158) - (attack () _type_ :state 159) - (die-now () _type_ :state 160) - (shoot (_type_ vector projectile-init-by-other-params int int float) none 161) - (crimson-guard-hover-method-162 (_type_ process-focusable) symbol 162) + (shoot (_type_ vector projectile-init-by-other-params int int float) none) ;; 161 + (crimson-guard-hover-method-162 (_type_ process-focusable) symbol) ;; 162 ) ) @@ -36476,8 +36222,6 @@ :method-count-assert 16 :size-assert #x90 :flag-assert #x1000100090 - (:methods - ) ) (deftype flamer (nav-enemy) @@ -36510,21 +36254,23 @@ :method-count-assert 192 :size-assert #x400 :flag-assert #xc003800400 + (:state-methods + attack + wait-for-formation + exit-ambush + exit-ambush-path + ) (:methods - (attack () _type_ :state 178) - (wait-for-formation () _type_ :state 179) - (exit-ambush () _type_ :state 180) - (exit-ambush-path () _type_ :state 181) - (flamer-method-182 (_type_ vector process-focusable) none 182) - (flamer-method-183 (_type_) symbol 183) - (flamer-method-184 (_type_) none 184) - (flamer-method-185 (_type_) none 185) - (flamer-method-186 (_type_ float) vector 186) - (flamer-method-187 (_type_) none 187) - (flamer-method-188 (_type_ int float int int) none 188) - (flamer-method-189 (_type_) none 189) - (flamer-method-190 (_type_) none 190) - (flamer-method-191 (_type_) none 191) + (flamer-method-182 (_type_ vector process-focusable) none) ;; 182 + (flamer-method-183 (_type_) symbol) ;; 183 + (flamer-method-184 (_type_) none) ;; 184 + (flamer-method-185 (_type_) none) ;; 185 + (flamer-method-186 (_type_ float) vector) ;; 186 + (flamer-method-187 (_type_) none) ;; 187 + (flamer-method-188 (_type_ int float int int) none) ;; 188 + (flamer-method-189 (_type_) none) ;; 189 + (flamer-method-190 (_type_) none) ;; 190 + (flamer-method-191 (_type_) none) ;; 191 ) ) @@ -36559,8 +36305,6 @@ :method-count-assert 19 :size-assert #xb0 :flag-assert #x13003000b0 - (:methods - ) ) (deftype forest-youngsamos (process-focusable) @@ -36578,11 +36322,11 @@ :method-count-assert 31 :size-assert #x124 :flag-assert #x1f00b00124 - (:methods - (idle () _type_ :state 27) - (hit () _type_ :state 28) - (die () _type_ :state 29) - (dormant () _type_ :state 30) + (:state-methods + idle + hit + die + dormant ) ) @@ -36640,21 +36384,21 @@ (:methods (run-logic? "Calls [[process-tree::12]] if we are considered in-range of the [[pegasus]], otherwise returns [[#t]]" - (_type_) symbol :replace 12) + (_type_) symbol :replace) ;; 12 (damage-amount-from-attack "Only attacks from the jetboard will deal max damage (6), but by default it will return `1`. This is why the scouts are technically killable by other means @returns the amount of damage taken from an attack. Also updates the `targetted-timer`. @see [[*pegasus-enemy-info*]]" - (_type_ process event-message-block) int :replace 56) + (_type_ process event-message-block) int :replace) ;; 56 (update-target-awareness! "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targetted for more than 5 [[seconds]] @returns the value from [[enemy::57]], otherwise [[enemy-aware::4]]" - (_type_ process-focusable enemy-best-focus) enemy-aware :replace 57) + (_type_ process-focusable enemy-best-focus) enemy-aware :replace) ;; 57 (track-how-long-aimed-at! "Updates `targetted-timer` with the `frame-counter` while Jak is aiming at the [[pegasus]]" - (_type_) none 137) + (_type_) none) ;; 137 ) (:states pegasus-debug @@ -36762,20 +36506,22 @@ :method-count-assert 28 :size-assert #x11a :flag-assert #x1c00a0011a + (:state-methods + hunt + peck + fly + land + on-branch + die + ) (:methods - (hunt () _type_ :state 20) - (peck () _type_ :state 21) - (fly () _type_ :state 22) - (land () _type_ :state 23) - (on-branch () _type_ :state 24) - (die () _type_ :state 25) (spooked? "@returns a [[symbol]] indicating if Jak is considered close enough to the wren to spook it. If so, it transitions from [[wren::peck]] to [[wren::hunt]]" - (_type_) symbol 26) + (_type_) symbol) ;; 26 (debug-draw-path "Draws the associated [[curve-control]]s associated with this wren" - (_type_) symbol 27) + (_type_) symbol) ;; 27 ) ) @@ -36800,8 +36546,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -36826,8 +36572,8 @@ :method-count-assert 21 :size-assert #x550 :flag-assert #x1504d00550 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -36907,8 +36653,6 @@ :method-count-assert 40 :size-assert #x1f0 :flag-assert #x28017001f0 - (:methods - ) ) (deftype predator (nav-enemy) @@ -36929,18 +36673,20 @@ :method-count-assert 189 :size-assert #x360 :flag-assert #xbd02e00360 + (:state-methods + close-attack + fire + hide + hidden + ) (:methods - (close-attack () _type_ :state 178) - (fire () _type_ :state 179) - (hide () _type_ :state 180) - (hidden () _type_ :state 181) - (set-dangerous! (_type_ symbol) symbol 182) - (predator-method-183 (_type_) none 183) - (predator-method-184 (_type_ int float) none 184) - (predator-method-185 (_type_) none 185) - (predator-method-186 (_type_) none 186) - (predator-method-187 (_type_) symbol 187) - (predator-method-188 (_type_ vector vector vector) none 188) + (set-dangerous! (_type_ symbol) symbol) ;; 182 + (predator-method-183 (_type_) none) ;; 183 + (predator-method-184 (_type_ int float) none) ;; 184 + (predator-method-185 (_type_) none) ;; 185 + (predator-method-186 (_type_) none) ;; 186 + (predator-method-187 (_type_) symbol) ;; 187 + (predator-method-188 (_type_ vector vector vector) none) ;; 188 ) ) @@ -36955,10 +36701,12 @@ :size-assert #x198 :flag-assert #x1101200198 ;; Failed to read fields. + (:state-methods + idle + closed + ) (:methods - (idle () _type_ :state 14) - (closed () _type_ :state 15) - (predator-manager-method-16 (_type_) none 16) + (predator-manager-method-16 (_type_) none) ;; 16 ) ) @@ -36998,8 +36746,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype hide-light (process-drawable) @@ -37007,8 +36753,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -37051,11 +36797,13 @@ :method-count-assert 24 :size-assert #xd0 :flag-assert #x18005000d0 + (:state-methods + broken + break-it + idle + ) (:methods - (broken () _type_ :state 20) - (break-it () _type_ :state 21) - (idle () _type_ :state 22) - (dig-clasp-method-23 (_type_ vector) vector 23) + (dig-clasp-method-23 (_type_ vector) vector) ;; 23 ) ) @@ -37089,12 +36837,14 @@ :method-count-assert 25 :size-assert #x361 :flag-assert #x1902f00361 + (:state-methods + broken + idle + ) (:methods - (broken () _type_ :state 20) - (idle () _type_ :state 21) - (dig-tether-method-22 (_type_) none 22) - (dig-tether-method-23 (_type_) none 23) - (dig-tether-method-24 (_type_) none 24) + (dig-tether-method-22 (_type_) none) ;; 22 + (dig-tether-method-23 (_type_) none) ;; 23 + (dig-tether-method-24 (_type_) none) ;; 24 ) ) @@ -37132,12 +36882,14 @@ :method-count-assert 25 :size-assert #x4ec :flag-assert #x19047004ec + (:state-methods + idle + hidden + ) (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) - (dig-digger-method-22 (_type_ int) entity 22) - (dig-digger-method-23 (_type_) none 23) - (dig-digger-method-24 (_type_) none 24) + (dig-digger-method-22 (_type_ int) entity) ;; 22 + (dig-digger-method-23 (_type_) none) ;; 23 + (dig-digger-method-24 (_type_) none) ;; 24 ) ) @@ -37165,8 +36917,6 @@ :method-count-assert 57 :size-assert #x1bc :flag-assert #x39014001bc - (:methods - ) ) (deftype dig-log-button-info (basic) @@ -37189,10 +36939,12 @@ :method-count-assert 23 :size-assert #xe0 :flag-assert #x17006000e0 + (:state-methods + idle + moving + ) (:methods - (idle () _type_ :state 20) - (moving () _type_ :state 21) - (dig-log-method-22 (_type_ symbol) symbol 22) + (dig-log-method-22 (_type_ symbol) symbol) ;; 22 ) ) @@ -37202,10 +36954,10 @@ :method-count-assert 23 :size-assert #xcc :flag-assert #x17005000cc - (:methods - (idle-up () _type_ :state 20) - (going-down () _type_ :state 21) - (idle-down () _type_ :state 22) + (:state-methods + idle-up + going-down + idle-down ) ) @@ -37226,8 +36978,6 @@ :method-count-assert 28 :size-assert #x100 :flag-assert #x1c00800100 - (:methods - ) ) (deftype dig-bomb-crate-cylinder (rigid-body-object) @@ -37238,8 +36988,8 @@ :method-count-assert 54 :size-assert #x120 :flag-assert #x3600a00120 - (:methods - (die () _type_ :state 53) + (:state-methods + die ) ) @@ -37259,10 +37009,12 @@ :method-count-assert 30 :size-assert #xcc :flag-assert #x1e005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (dig-bomb-crate-method-29 (_type_ vector) none 29) + (dig-bomb-crate-method-29 (_type_ vector) none) ;; 29 ) ) @@ -37271,8 +37023,6 @@ :method-count-assert 25 :size-assert #xd4 :flag-assert #x19006000d4 - (:methods - ) ) (define-extern *dig-bomb-crate-cylinder-constants* rigid-body-object-constants) @@ -37293,8 +37043,8 @@ :method-count-assert 28 :size-assert #xd8 :flag-assert #x1c006000d8 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) @@ -37314,8 +37064,8 @@ :method-count-assert 21 :size-assert #x110 :flag-assert #x1500900110 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -37326,8 +37076,6 @@ :method-count-assert 42 :size-assert #x1f8 :flag-assert #x2a018001f8 - (:methods - ) ) (deftype dig-spikey-sphere-door (process-drawable) @@ -37337,9 +37085,9 @@ :method-count-assert 22 :size-assert #xdc :flag-assert #x16006000dc - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) + (:state-methods + idle + active ) ) @@ -37363,8 +37111,8 @@ :method-count-assert 21 :size-assert #x178 :flag-assert #x1501000178 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -37377,9 +37125,11 @@ :method-count-assert 22 :size-assert #xd4 :flag-assert #x16006000d4 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (dig-balloon-lurker-trapeze-method-21 (_type_) none 21) + (dig-balloon-lurker-trapeze-method-21 (_type_) none) ;; 21 ) ) @@ -37390,8 +37140,8 @@ :method-count-assert 21 :size-assert #xd0 :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -37404,8 +37154,6 @@ :method-count-assert 57 :size-assert #x1a0 :flag-assert #x39012001a0 - (:methods - ) ) (deftype dig-wall-bouncer (bouncer) @@ -37413,8 +37161,6 @@ :method-count-assert 25 :size-assert #xd4 :flag-assert #x19006000d4 - (:methods - ) ) (deftype dig-stomp-block (rigid-body-object) @@ -37424,9 +37170,9 @@ :method-count-assert 55 :size-assert #x118 :flag-assert #x3700a00118 - (:methods - (waiting () _type_ :state 53) - (hit () _type_ :state 54) + (:state-methods + waiting + hit ) ) @@ -37437,8 +37183,8 @@ :method-count-assert 21 :size-assert #xdc :flag-assert #x15006000dc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -37447,8 +37193,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -37471,9 +37217,9 @@ :method-count-assert 180 :size-assert #x25c :flag-assert #xb401e0025c - (:methods - (attack () _type_ :state 178) - (attack-stop () _type_ :state 179) + (:state-methods + attack + attack-stop ) ) @@ -37482,8 +37228,6 @@ :method-count-assert 180 :size-assert #x25c :flag-assert #xb401e0025c - (:methods - ) ) (define-extern *tomb-baby-spider-nav-enemy-info* nav-enemy-info) @@ -37529,13 +37273,15 @@ :method-count-assert 184 :size-assert #x308 :flag-assert #xb802900308 + (:state-methods + attack + backup + spin-kick + ) (:methods - (attack () _type_ :state 178) - (backup () _type_ :state 179) - (spin-kick () _type_ :state 180) - (grenadier-method-181 (_type_) none 181) - (grenadier-method-182 (_type_ vector) none 182) - (grenadier-method-183 (_type_) none 183) + (grenadier-method-181 (_type_) none) ;; 181 + (grenadier-method-182 (_type_ vector) none) ;; 182 + (grenadier-method-183 (_type_) none) ;; 183 ) ) @@ -37582,12 +37328,14 @@ :method-count-assert 183 :size-assert #x29c :flag-assert #xb70220029c + (:state-methods + attack + ) (:methods - (attack () _type_ :state 178) - (metalmonk-method-179 (_type_ vector) none 179) - (metalmonk-method-180 (_type_ symbol) none 180) - (metalmonk-method-181 (_type_ float float) none 181) - (metalmonk-method-182 (_type_ float float) none 182) + (metalmonk-method-179 (_type_ vector) none) ;; 179 + (metalmonk-method-180 (_type_ symbol) none) ;; 180 + (metalmonk-method-181 (_type_ float float) none) ;; 181 + (metalmonk-method-182 (_type_ float float) none) ;; 182 ) ) @@ -37666,9 +37414,9 @@ :method-count-assert 22 :size-assert #x110 :flag-assert #x1600900110 - (:methods - (slide-control-watch () _type_ :state 20) ;; (slide-control-watch () _type_ :state 20) - (slide-control-ride () _type_ :state 21) ;; (slide-control-ride () _type_ :state 21) + (:state-methods + slide-control-watch + slide-control-ride ) ) @@ -37695,9 +37443,9 @@ :method-count-assert 22 :size-assert #xcc :flag-assert #x16005000cc - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) @@ -37706,8 +37454,6 @@ :method-count-assert 29 :size-assert #x100 :flag-assert #x1d00800100 - (:methods - ) ) (define-extern *fort-trap-door-exploder-params* joint-exploder-static-params) @@ -37739,8 +37485,6 @@ :method-count-assert 40 :size-assert #x200 :flag-assert #x2801800200 - (:methods - ) ) @@ -37754,8 +37498,6 @@ :method-count-assert 27 :size-assert #xba8 :flag-assert #x1b0b300ba8 - (:methods - ) ) (deftype hud-drill-turret-health (hud-turret-health) @@ -37763,8 +37505,6 @@ :method-count-assert 27 :size-assert #xba8 :flag-assert #x1b0b300ba8 - (:methods - ) ) (deftype hud-port-turret-health (hud-turret-health) @@ -37772,8 +37512,6 @@ :method-count-assert 27 :size-assert #xba8 :flag-assert #x1b0b300ba8 - (:methods - ) ) (declare-type base-turret process-focusable) @@ -37866,29 +37604,31 @@ :method-count-assert 49 :size-assert #x234 :flag-assert #x3101c00234 - (:methods - (idle () _type_ :state 27) - (setup () _type_ :state 28) - (active () _type_ :state 29) - (shutdown () _type_ :state 30) - (dormant () _type_ :state 31) - (die () _type_ :state 32) - (turret-init! (_type_ entity-actor matrix) none 33) - (base-turret-method-34 (_type_ process) none 34) - (base-turret-method-35 (_type_) none 35) - (base-turret-method-36 (_type_) none 36) - (base-turret-method-37 (_type_) none 37) - (base-turret-method-38 (_type_) none 38) - (base-turret-method-39 (_type_ turret-path-event) none 39) - (base-turret-method-40 (_type_) none 40) - (base-turret-method-41 (_type_ vector) symbol 41) - (base-turret-method-42 (_type_ vector vector float) float 42) - (base-turret-method-43 (_type_) none 43) - (base-turret-method-44 (_type_ vector vector) none 44) - (base-turret-method-45 (_type_ object symbol) none 45) - (base-turret-method-46 (_type_ process) process 46) - (base-turret-method-47 (_type_) none 47) - (turret-event-handler (_type_ process int symbol event-message-block) object 48) + (:state-methods + idle + setup + active + shutdown + dormant + die + ) + (:methods + (turret-init! (_type_ entity-actor matrix) none) ;; 33 + (base-turret-method-34 (_type_ process) none) ;; 34 + (base-turret-method-35 (_type_) none) ;; 35 + (base-turret-method-36 (_type_) none) ;; 36 + (base-turret-method-37 (_type_) none) ;; 37 + (base-turret-method-38 (_type_) none) ;; 38 + (base-turret-method-39 (_type_ turret-path-event) none) ;; 39 + (base-turret-method-40 (_type_) none) ;; 40 + (base-turret-method-41 (_type_ vector) symbol) ;; 41 + (base-turret-method-42 (_type_ vector vector float) float) ;; 42 + (base-turret-method-43 (_type_) none) ;; 43 + (base-turret-method-44 (_type_ vector vector) none) ;; 44 + (base-turret-method-45 (_type_ object symbol) none) ;; 45 + (base-turret-method-46 (_type_ process) process) ;; 46 + (base-turret-method-47 (_type_) none) ;; 47 + (turret-event-handler (_type_ process int symbol event-message-block) object) ;; 48 ) ) @@ -37920,8 +37660,6 @@ :method-count-assert 49 :size-assert #x278 :flag-assert #x3102000278 - (:methods - ) ) (define-extern *drill-turret-10-battle* (array hover-enemy-battle-command)) @@ -37941,8 +37679,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype drill-lift (elevator) @@ -37952,7 +37688,7 @@ :size-assert #x174 :flag-assert #x3201000174 (:methods - (set-collide-spec! (_type_ symbol) none 49) + (set-collide-spec! (_type_ symbol) none) ;; 49 ) ) @@ -37961,8 +37697,6 @@ :method-count-assert 28 :size-assert #x100 :flag-assert #x1c00800100 - (:methods - ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -38007,13 +37741,15 @@ :method-count-assert 20 :size-assert #xd0 :flag-assert #x14005000d0 + (:state-methods + idle + active + hostile + failed + victory + ) (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (hostile () _type_ :state 16) - (failed () _type_ :state 17) - (victory () _type_ :state 18) - (spawn-hud-panel "Spawn the hud panel for the drill-mech mission." (_type_ symbol) none 19) + (spawn-hud-panel "Spawn the hud panel for the drill-mech mission." (_type_ symbol) none) ;; 19 ) ) @@ -38031,9 +37767,9 @@ :method-count-assert 36 :size-assert #x120 :flag-assert #x2400a00120 - (:methods - (idle () _type_ :state 34) - (falling () _type_ :state 35) + (:state-methods + idle + falling ) ) @@ -38044,9 +37780,11 @@ :method-count-assert 22 :size-assert #xf4 :flag-assert #x16008000f4 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (set-extent! (_type_ vector) none 21) + (set-extent! (_type_ vector) none) ;; 21 ) ) @@ -38057,8 +37795,6 @@ :method-count-assert 49 :size-assert #x178 :flag-assert #x3101000178 - (:methods - ) ) (deftype drill-mech-elevator (drill-elevator) @@ -38067,8 +37803,6 @@ :method-count-assert 49 :size-assert #x17c :flag-assert #x310100017c - (:methods - ) ) (deftype fire-floor (process-drawable) @@ -38090,9 +37824,11 @@ :method-count-assert 22 :size-assert #x190 :flag-assert #x1601100190 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (set-part "Set the particle launch controls for the on/off states." (_type_) none 21) + (set-part "Set the particle launch controls for the on/off states." (_type_) none) ;; 21 ) ) @@ -38101,8 +37837,6 @@ :method-count-assert 22 :size-assert #x190 :flag-assert #x1601100190 - (:methods - ) ) (deftype drill-switch (basebutton) @@ -38113,8 +37847,8 @@ :size-assert #x128 :flag-assert #x2900b00128 (:methods - (drill-switch-method-39 (_type_) none 39) - (set-switch-color "Set the switch color based on its state." (_type_ symbol) none 40) + (drill-switch-method-39 (_type_) none) ;; 39 + (set-switch-color "Set the switch color based on its state." (_type_ symbol) none) ;; 40 ) ) @@ -38128,8 +37862,8 @@ :method-count-assert 21 :size-assert #xdc :flag-assert #x15006000dc - (:methods - (drill-laser-idle () _type_ :state 20) + (:state-methods + drill-laser-idle ) ) @@ -38153,13 +37887,15 @@ :method-count-assert 33 :size-assert #xe8 :flag-assert #x21007000e8 + (:state-methods + idle + (hit symbol) + ) (:methods - (idle () _type_ :state 27) - (hit (symbol) _type_ :state 28) - (init-collision! "Define the collision for the panel." (_type_) none 29) - (init-panel "Init some parameters for the panel." (_type_) none 30) - (spawn-shock-part "Spawn shock particles." (_type_) none 31) - (spawn-explode-part "Spawn explosion particles." (_type_) none 32) + (init-collision! "Define the collision for the panel." (_type_) none) ;; 29 + (init-panel "Init some parameters for the panel." (_type_) none) ;; 30 + (spawn-shock-part "Spawn shock particles." (_type_) none) ;; 31 + (spawn-explode-part "Spawn explosion particles." (_type_) none) ;; 32 ) ) @@ -38168,8 +37904,6 @@ :method-count-assert 33 :size-assert #xe8 :flag-assert #x21007000e8 - (:methods - ) ) (deftype drill-control-panel-b (drill-control-panel-a) @@ -38177,8 +37911,6 @@ :method-count-assert 33 :size-assert #xe8 :flag-assert #x21007000e8 - (:methods - ) ) (define-extern spawn-drill-panel-explode (function drill-control-panel none)) @@ -38193,15 +37925,17 @@ :method-count-assert 40 :size-assert #x110 :flag-assert #x2800900110 + (:state-methods + down + up + swing-down + swing-up + ) (:methods - (down () _type_ :state 34) - (up () _type_ :state 35) - (swing-down () _type_ :state 36) - (swing-up () _type_ :state 37) - (get-skel (_type_) art-group 38) + (get-skel (_type_) art-group) ;; 38 (set-flipped-state "Set the state of the platform based on the completion of the drill-mech task." - (_type_) none 39) + (_type_) none) ;; 39 ) ) @@ -38213,10 +37947,10 @@ :method-count-assert 23 :size-assert #xd0 :flag-assert #x17005000d0 - (:methods - (idle () _type_ :state 20) - (hit () _type_ :state 21) - (fall (symbol) _type_ :state 22) + (:state-methods + idle + hit + (fall symbol) ) ) @@ -38225,9 +37959,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) + (:state-methods + idle + open ) ) @@ -38243,8 +37977,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -38256,12 +37990,14 @@ :method-count-assert 25 :size-assert #xd0 :flag-assert #x19005000d0 + (:state-methods + idle + die + die-fast + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (die-fast () _type_ :state 22) - (skel-init! "Initialize the skeleton and animations for this object." (_type_) none 23) - (init-collision! "Define the collision for this object." (_type_) none 24) + (skel-init! "Initialize the skeleton and animations for this object." (_type_) none) ;; 23 + (init-collision! "Define the collision for this object." (_type_) none) ;; 24 ) ) @@ -38294,9 +38030,9 @@ :method-count-assert 22 :size-assert #xd0 :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (die (symbol) _type_ :state 21) + (:state-methods + idle + (die symbol) ) ) @@ -38305,8 +38041,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -38318,7 +38054,7 @@ :size-assert #x120 :flag-assert #x2800a00120 (:methods - (:override-doc "Set the state of the platform." 39) + (set-flipped-state :override-doc "Set the state of the platform.") ;; 39 ) ) @@ -38337,9 +38073,9 @@ :method-count-assert 29 :size-assert #xd8 :flag-assert #x1d006000d8 - (:methods - (idle () _type_ :state 27) - (hit (symbol) _type_ :state 28) + (:state-methods + idle + (hit symbol) ) ) @@ -38351,9 +38087,9 @@ :method-count-assert 29 :size-assert #xd8 :flag-assert #x1d006000d8 - (:methods - (idle () _type_ :state 27) - (hit (symbol) _type_ :state 28) + (:state-methods + idle + (hit symbol) ) ) @@ -38379,10 +38115,12 @@ :method-count-assert 23 :size-assert #x108 :flag-assert #x1700900108 + (:state-methods + idle + hidden + ) (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) - (drill-barons-ship-method-22 (_type_) none 22) + (drill-barons-ship-method-22 (_type_) none) ;; 22 ) ) @@ -38391,8 +38129,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -38427,12 +38165,14 @@ :method-count-assert 25 :size-assert #xfc :flag-assert #x19008000fc + (:state-methods + idle + attack + dead + going-down + ) (:methods - (idle () _type_ :state 20) - (attack () _type_ :state 21) - (dead () _type_ :state 22) - (going-down () _type_ :state 23) - (drill-barons-ship-turret-method-24 (_type_) none 24) + (drill-barons-ship-turret-method-24 (_type_) none) ;; 24 ) ) @@ -38441,8 +38181,6 @@ :method-count-assert 40 :size-assert #x1f0 :flag-assert #x28017001f0 - (:methods - ) ) (define-extern *ship-turrets-first-pass* (array int32)) @@ -38468,8 +38206,6 @@ :method-count-assert 40 :size-assert #x1f0 :flag-assert #x28017001f0 - (:methods - ) ) (deftype centurion (nav-enemy) @@ -38489,12 +38225,14 @@ :method-count-assert 183 :size-assert #x350 :flag-assert #xb702d00350 + (:state-methods + attack + fire + ) (:methods - (attack () _type_ :state 178) - (fire () _type_ :state 179) - (centurion-method-180 (_type_) none 180) - (centurion-method-181 (_type_ vector) int 181) - (centurion-method-182 (_type_ vector) symbol 182) + (centurion-method-180 (_type_) none) ;; 180 + (centurion-method-181 (_type_ vector) int) ;; 181 + (centurion-method-182 (_type_ vector) symbol) ;; 182 ) ) @@ -38571,13 +38309,15 @@ :method-count-assert 184 :size-assert #x2b0 :flag-assert #xb8023002b0 + (:state-methods + anticipate-attack + attack + ) (:methods - (anticipate-attack () _type_ :state 178) - (attack () _type_ :state 179) - (ginsu-method-180 (_type_) none 180) - (ginsu-method-181 (_type_ vector) vector 181) - (ginsu-method-182 (_type_) none 182) - (ginsu-method-183 (_type_ symbol) none 183) + (ginsu-method-180 (_type_) none) ;; 180 + (ginsu-method-181 (_type_ vector) vector) ;; 181 + (ginsu-method-182 (_type_) none) ;; 182 + (ginsu-method-183 (_type_ symbol) none) ;; 183 ) ) @@ -38613,8 +38353,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) @@ -38664,8 +38402,8 @@ :method-count-assert 41 :size-assert #x124 :flag-assert #x2900b00124 - (:methods - (waiting () _type_ :state 40) + (:state-methods + waiting ) ) @@ -38675,9 +38413,9 @@ :method-count-assert 22 :size-assert #xcc :flag-assert #x16005000cc - (:methods - (red () _type_ :state 20) - (green () _type_ :state 21) + (:state-methods + red + green ) ) @@ -38690,9 +38428,11 @@ :method-count-assert 32 :size-assert #x210 :flag-assert #x2001900210 + (:state-methods + pre-shutdown + ) (:methods - (pre-shutdown () _type_ :state 30) - (elec-lock-gate-method-31 (_type_ symbol) symbol 31) + (elec-lock-gate-method-31 (_type_ symbol) symbol) ;; 31 ) ) @@ -38733,12 +38473,14 @@ :method-count-assert 183 :size-assert #x300 :flag-assert #xb702800300 + (:state-methods + attack + stop-run + run-away + charge + ) (:methods - (attack () _type_ :state 178) - (stop-run () _type_ :state 179) - (run-away () _type_ :state 180) - (charge () _type_ :state 181) - (rhino-method-182 (_type_ process event-message-block) symbol 182) + (rhino-method-182 (_type_ process event-message-block) symbol) ;; 182 ) ) @@ -38756,11 +38498,13 @@ :method-count-assert 31 :size-assert #xd5 :flag-assert #x1f006000d5 + (:state-methods + unbroken + hit + broken + ) (:methods - (unbroken () _type_ :state 27) - (hit () _type_ :state 28) - (broken () _type_ :state 29) - (rhino-wall-method-30 (_type_) none 30) + (rhino-wall-method-30 (_type_) none) ;; 30 ) ) @@ -38812,15 +38556,18 @@ :method-count-assert 28 :size-assert #x44c ;; 1100 :flag-assert #x1c03d0044c + (:state-methods + idle + idle-done + animate + fall + restart + ) (:methods - (idle () _type_ :state 20) - (idle-done () _type_ :state 21) - (animate () _type_ :state 22) - (fall () _type_ :state 23) - (restart () _type_ :state 24) - (mtn-dice-method-25 (_type_ int) none 25) - (mtn-dice-method-26 (_type_ process-focusable touching-shapes-entry) touching-prims-entry 26) - (mtn-dice-method-27 (_type_ collide-shape process-focusable touching-shapes-entry) none 27)) + (mtn-dice-method-25 (_type_ int) none) ;; 25 + (mtn-dice-method-26 (_type_ process-focusable touching-shapes-entry) touching-prims-entry) ;; 26 + (mtn-dice-method-27 (_type_ collide-shape process-focusable touching-shapes-entry) none) ;; 27 + ) ) (deftype mtn-dice-info (structure) @@ -38846,9 +38593,10 @@ :method-count-assert 36 :size-assert #x140 ;; 320 :flag-assert #x2400c00140 - (:methods - (idle () _type_ :state 34) - (active () _type_ :state 35)) + (:state-methods + idle + active + ) ) (deftype mtn-plat-eject (process-drawable) @@ -38858,10 +38606,13 @@ :method-count-assert 23 :size-assert #xe0 ;; 224 :flag-assert #x17006000e0 + (:state-methods + wait + eject + ) (:methods - (wait () _type_ :state 20) - (eject () _type_ :state 21) - (mtn-plat-eject-method-22 (_type_) none 22)) + (mtn-plat-eject-method-22 (_type_) none) ;; 22 + ) ) (deftype mtn-plat-long (base-plat) @@ -38871,8 +38622,9 @@ :method-count-assert 35 :size-assert #x120 ;; 288 :flag-assert #x2300a00120 - (:methods - (idle () _type_ :state 34)) + (:state-methods + idle + ) ) (deftype mtn-gate (process-drawable) @@ -38880,11 +38632,13 @@ :method-count-assert 22 :size-assert #xc8 ;; 200 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21)) + (:state-methods + idle + open + ) ) + (deftype mtn-aval-rocks (process-drawable) ( (art-name symbol :offset-assert 200) @@ -38896,11 +38650,13 @@ :method-count-assert 22 :size-assert #xdc ;; 220 :flag-assert #x16006000dc - (:methods - (fall () _type_ :state 20) - (idle () _type_ :state 21)) + (:state-methods + fall + idle + ) ) + (deftype mtn-aval-rocks-shadow (process-drawable) ( (parent-ptr (pointer mtn-aval-rocks) :offset 16 :score 100) @@ -38910,10 +38666,12 @@ :method-count-assert 21 :size-assert #xd8 ;; 216 :flag-assert #x15006000d8 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) + (defenum mtn-plat-flags :bitfield #t :type uint16 @@ -38934,11 +38692,14 @@ :method-count-assert 38 :size-assert #x128 ;; 296 :flag-assert #x2600b00128 + (:state-methods + waiting + running + waiting-for-no-player + ) (:methods - (waiting () _type_ :state 34) - (running () _type_ :state 35) - (waiting-for-no-player () _type_ :state 36) - (mtn-plat-return-method-37 (_type_) none 37)) + (mtn-plat-return-method-37 (_type_) none) ;; 37 + ) ) (deftype mtn-plat-gap (mtn-plat-return) @@ -38955,23 +38716,27 @@ :method-count-assert 24 :size-assert #xcc ;; 204 :flag-assert #x18005000cc - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) - (waiting () _type_ :state 22) - (pressed (symbol) _type_ :state 23)) + (:state-methods + idle + open + waiting + (pressed symbol) + ) ) + (deftype mtn-gear-device (process-drawable) () :method-count-assert 22 :size-assert #xc8 ;; 200 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (idle-collapsed () _type_ :state 21)) + (:state-methods + idle + idle-collapsed + ) ) + (deftype water-anim-mountain (water-anim) () :method-count-assert 29 @@ -38984,10 +38749,12 @@ :method-count-assert 39 :size-assert #x128 ;; 296 :flag-assert #x2700b00128 - (:methods - (rising () _type_ :state 38)) + (:state-methods + rising + ) ) + (define-extern *dice-back-way-num* int) (define-extern *dice-back-way* (array vector)) (define-extern *dice-position-array* (array vector)) @@ -39016,9 +38783,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (open () _type_ :state 20) - (close () _type_ :state 21) + (:state-methods + open + close ) ) @@ -39038,8 +38805,6 @@ :method-count-assert 37 :size-assert #x184 :flag-assert #x2501100184 - (:methods - ) ) @@ -39054,9 +38819,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (done (symbol) _type_ :state 21) + (:state-methods + idle + (done symbol) ) ) @@ -39076,8 +38841,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -39086,8 +38851,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -39096,9 +38861,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (idle-no-beam () _type_ :state 21) + (:state-methods + idle + idle-no-beam ) ) @@ -39107,8 +38872,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -39161,8 +38926,8 @@ :size-assert #x2e0 :flag-assert #xb4026002e0 (:methods - (hopper-method-178 (_type_) symbol 178) - (hopper-method-179 (_type_) none 179) + (hopper-method-178 (_type_) symbol) ;; 178 + (hopper-method-179 (_type_) none) ;; 179 ) ) @@ -39232,10 +38997,12 @@ :method-count-assert 23 :size-assert #x138 :flag-assert #x1700c00138 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (intro-flamer-method-22 (_type_) path-control 22) + (intro-flamer-method-22 (_type_) path-control) ;; 22 ) ) @@ -39247,10 +39014,10 @@ :method-count-assert 17 :size-assert #xf0 :flag-assert #x11007000f0 - (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (die () _type_ :state 16) + (:state-methods + idle + active + die ) ) @@ -39259,8 +39026,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -39338,9 +39105,9 @@ :size-assert #x30 :flag-assert #xc00000030 (:methods - (reset-task! (_type_) none 9) - (ai-task-method-10 (_type_ bot) none 10) - (ai-task-method-11 (_type_ bot) none 11) + (reset-task! (_type_) none) ;; 9 + (ai-task-method-10 (_type_ bot) none) ;; 10 + (ai-task-method-11 (_type_ bot) none) ;; 11 ) ) @@ -39354,9 +39121,9 @@ :size-assert #x14 :flag-assert #xc00000014 (:methods - (assign-ids! "Assign unique IDs to the [[ai-task-pool]] and its `anchor`s `next`" (_type_ type) ai-task 9) - (set-next-task! "Set the next task in the [[ai-task-pool]] to the specified [[ai-task]]." (_type_ ai-task) none 10) - (ai-task-pool-method-11 (_type_) ai-task 11) + (assign-ids! "Assign unique IDs to the [[ai-task-pool]] and its `anchor`s `next`" (_type_ type) ai-task) ;; 9 + (set-next-task! "Set the next task in the [[ai-task-pool]] to the specified [[ai-task]]." (_type_ ai-task) none) ;; 10 + (ai-task-pool-method-11 (_type_) ai-task) ;; 11 ) ) @@ -39369,16 +39136,16 @@ :size-assert #xc :flag-assert #x120000000c (:methods - (new (symbol type ai-task-pool) _type_ 0) - (ai-task-control-method-9 (_type_) none 9) - (ai-task-control-method-10 (_type_ bot) none 10) - (get-task-by-type (_type_ type bot) ai-task 11) - (ai-task-control-method-12 (_type_ bot) symbol 12) - (ai-task-control-method-13 (_type_ ai-task bot) ai-task 13) - (ai-task-control-method-14 (_type_ ai-task bot) none 14) - (init-task! "Initialize a task of the given type in the [[ai-task-control]]'s pool." (_type_ type bot) ai-task 15) - (set-next-task-for-pool! (_type_ ai-task) none 16) - (set-next-task! "Set `next` of this [[ai-task-control]]'s `anchor` to the given [[ai-task]]." (_type_ ai-task) none 17) + (new (symbol type ai-task-pool) _type_) ;; 0 + (ai-task-control-method-9 (_type_) none) ;; 9 + (ai-task-control-method-10 (_type_ bot) none) ;; 10 + (get-task-by-type (_type_ type bot) ai-task) ;; 11 + (ai-task-control-method-12 (_type_ bot) symbol) ;; 12 + (ai-task-control-method-13 (_type_ ai-task bot) ai-task) ;; 13 + (ai-task-control-method-14 (_type_ ai-task bot) none) ;; 14 + (init-task! "Initialize a task of the given type in the [[ai-task-control]]'s pool." (_type_ type bot) ai-task) ;; 15 + (set-next-task-for-pool! (_type_ ai-task) none) ;; 16 + (set-next-task! "Set `next` of this [[ai-task-control]]'s `anchor` to the given [[ai-task]]." (_type_ ai-task) none) ;; 17 ) ) @@ -39642,57 +39409,59 @@ :method-count-assert 225 :size-assert #x3e0 :flag-assert #xe1036003e0 - (:methods - (failed () _type_ :state 178) - (hidden () _type_ :state 179) - (clear-poi-and-focus! "Clear our point of interest and focus handles." (_type_) none 180) - (bot-method-181 (_type_ vector vector vector vector vector float) none 181) - (turn-to-target (_type_ bot-turn-info process-focusable float) none 182) - (alive? (_type_) symbol 183) - (bot-debug-draw-spot-id (_type_) none 184) - (bot-debug-draw-sphere (_type_ vector rgba) none 185) - (bot-debug-draw-spot-sphere (_type_ int (pointer uint) int) none 186) - (reset-attacker! (_type_) none 187) - (scene-release? (_type_) symbol 188) - (select-focus! "Find enemies around our `notice-enemy-dist` and choose a target." (_type_) process 189) - (bot-method-190 (_type_) symbol 190) - (bot-method-191 (_type_) none 191) - (bot-method-192 (_type_) none 192) - (bot-method-193 (_type_) symbol 193) - (outside-spot-radius? "Are we outside of the given [[bot-spot]] radius?" (_type_ bot-spot vector symbol) symbol 194) - (attacked-by-player? "Were we attacked by the player?" (_type_ process-focusable) symbol 195) - (bot-method-196 (_type_) none 196) - (fail-mission! (_type_) none 197) - (set-cam-height! (_type_ vector) meters 198) - (cam-move-to-bot (_type_) none 199) - (fail-falling (_type_) none 200) - (set-next-focus! (_type_ enemy enemy-best-focus) none 201) - (choose-spot "Choose the closest [[bot-spot]] that is not blocked by the player." (_type_ int (pointer uint)) int 202) - (play-attacked-speech (_type_) none 203) - (play-too-far-warn-speech (_type_) symbol 204) - (scene-play "Spawn a [[scene-player]] process for the given scene." (_type_ string symbol) symbol 205) - (play-speech (_type_ int) none 206) - (play-death-sound "Play one of our death sounds." (_type_ string) none 207) - (bot-method-208 (_type_) symbol 208) - (channel-active? "Is the given [[gui-channel]] active?" (_type_ uint) symbol 209) - (init! "Set defaults for various fields." (_type_) none 210) - (clear-speech-flags! "Clear the `playing` flag for all of our speeches." (_type_) none 211) - (reset-warn-time! (_type_) none 212) - (go-to-waypoint! "Start moving to the given [[bot-waypoint]]." (_type_ int symbol) object 213) - (bot-method-214 (_type_) symbol 214) - (skip-waypoint (_type_) none 215) - (bot-method-216 (_type_) none 216) - (speech-ended? "Is the given speech active?" (_type_ int) symbol 217) - (speech-playing? "Is the given speech playing?" (_type_ int) symbol 218) - (player-blocking-spot? (_type_ bot-spot) symbol 219) - (stop-speech (_type_ uint symbol) none 220) - (bot-method-221 (_type_) quaternion 221) - (bot-method-222 (_type_ vector) none 222) - (bot-method-223 (_type_ symbol) none 223) + (:state-methods + failed + hidden + ) + (:methods + (clear-poi-and-focus! "Clear our point of interest and focus handles." (_type_) none) ;; 180 + (bot-method-181 (_type_ vector vector vector vector vector float) none) ;; 181 + (turn-to-target (_type_ bot-turn-info process-focusable float) none) ;; 182 + (alive? (_type_) symbol) ;; 183 + (bot-debug-draw-spot-id (_type_) none) ;; 184 + (bot-debug-draw-sphere (_type_ vector rgba) none) ;; 185 + (bot-debug-draw-spot-sphere (_type_ int (pointer uint) int) none) ;; 186 + (reset-attacker! (_type_) none) ;; 187 + (scene-release? (_type_) symbol) ;; 188 + (select-focus! "Find enemies around our `notice-enemy-dist` and choose a target." (_type_) process) ;; 189 + (bot-method-190 (_type_) symbol) ;; 190 + (bot-method-191 (_type_) none) ;; 191 + (bot-method-192 (_type_) none) ;; 192 + (bot-method-193 (_type_) symbol) ;; 193 + (outside-spot-radius? "Are we outside of the given [[bot-spot]] radius?" (_type_ bot-spot vector symbol) symbol) ;; 194 + (attacked-by-player? "Were we attacked by the player?" (_type_ process-focusable) symbol) ;; 195 + (bot-method-196 (_type_) none) ;; 196 + (fail-mission! (_type_) none) ;; 197 + (set-cam-height! (_type_ vector) meters) ;; 198 + (cam-move-to-bot (_type_) none) ;; 199 + (fail-falling (_type_) none) ;; 200 + (set-next-focus! (_type_ enemy enemy-best-focus) none) ;; 201 + (choose-spot "Choose the closest [[bot-spot]] that is not blocked by the player." (_type_ int (pointer uint)) int) ;; 202 + (play-attacked-speech (_type_) none) ;; 203 + (play-too-far-warn-speech (_type_) symbol) ;; 204 + (scene-play "Spawn a [[scene-player]] process for the given scene." (_type_ string symbol) symbol) ;; 205 + (play-speech (_type_ int) none) ;; 206 + (play-death-sound "Play one of our death sounds." (_type_ string) none) ;; 207 + (bot-method-208 (_type_) symbol) ;; 208 + (channel-active? "Is the given [[gui-channel]] active?" (_type_ uint) symbol) ;; 209 + (init! "Set defaults for various fields." (_type_) none) ;; 210 + (clear-speech-flags! "Clear the `playing` flag for all of our speeches." (_type_) none) ;; 211 + (reset-warn-time! (_type_) none) ;; 212 + (go-to-waypoint! "Start moving to the given [[bot-waypoint]]." (_type_ int symbol) object) ;; 213 + (bot-method-214 (_type_) symbol) ;; 214 + (skip-waypoint (_type_) none) ;; 215 + (bot-method-216 (_type_) none) ;; 216 + (speech-ended? "Is the given speech active?" (_type_ int) symbol) ;; 217 + (speech-playing? "Is the given speech playing?" (_type_ int) symbol) ;; 218 + (player-blocking-spot? (_type_ bot-spot) symbol) ;; 219 + (stop-speech (_type_ uint symbol) none) ;; 220 + (bot-method-221 (_type_) quaternion) ;; 221 + (bot-method-222 (_type_ vector) none) ;; 222 + (bot-method-223 (_type_ symbol) none) ;; 223 (bot-check-too-far "Call the current [[bot-waypoint]]'s `check-too-far` function if available, otherwise use the default `course` one. If the player is too far, play a warning speech." - (_type_) symbol 224) + (_type_) symbol) ;; 224 ) ) @@ -39706,8 +39475,8 @@ :size-assert #xc :flag-assert #xb0000000c (:methods - (bot-speech-list-method-9 (_type_ bot (inline-array bot-speech-info) speech-flags) int 9) - (reset-index (_type_ symbol) none 10) + (bot-speech-list-method-9 (_type_ bot (inline-array bot-speech-info) speech-flags) int) ;; 9 + (reset-index (_type_ symbol) none) ;; 10 ) ) @@ -39718,8 +39487,6 @@ :method-count-assert 11 :size-assert #x20 :flag-assert #xb00000020 - (:methods - ) ) (deftype bot-course-table (basic) @@ -39777,12 +39544,12 @@ :size-assert #x18 :flag-assert #xf00000018 (:methods - (sig-plasma-method-9 (_type_) none 9) - (sig-plasma-method-10 (_type_) symbol 10) - (sig-plasma-method-11 (_type_ symbol) none 11) - (sig-plasma-method-12 (_type_) none 12) - (sig-plasma-method-13 (_type_) symbol 13) - (sig-plasma-method-14 (_type_ process-focusable) none 14) + (sig-plasma-method-9 (_type_) none) ;; 9 + (sig-plasma-method-10 (_type_) symbol) ;; 10 + (sig-plasma-method-11 (_type_ symbol) none) ;; 11 + (sig-plasma-method-12 (_type_) none) ;; 12 + (sig-plasma-method-13 (_type_) symbol) ;; 13 + (sig-plasma-method-14 (_type_ process-focusable) none) ;; 14 ) ) @@ -39829,41 +39596,43 @@ :method-count-assert 259 :size-assert #x430 :flag-assert #x10303b00430 - (:methods - (whip () _type_ :state 225) - (blast () _type_ :state 226) - (chase () _type_ :state 227) - (chase-attack () _type_ :state 228) - (traveling () _type_ :state 229) - (traveling-blocked () _type_ :state 230) - (waiting-far () _type_ :state 231) - (waiting-close () _type_ :state 232) - (waiting-turn () _type_ :state 233) - (waiting-crouched () _type_ :state 234) - (charge-plasma () _type_ :state 235) - (gun-jam () _type_ :state 236) - (repair-gun () _type_ :state 237) - (clean-gun () _type_ :state 238) - (sig-path-run () _type_ :state 239) - (sig-path-jump () _type_ :state 240) - (sig-path-jump-land () _type_ :state 241) - (sig-path-shoot-jump () _type_ :state 242) - (sig-path-shoot-jump-land () _type_ :state 243) - (sig-path-idle () _type_ :state 244) - (sig-method-245 (_type_) symbol 245) - (sig-method-246 (_type_) symbol 246) - (fire-gun "Increase gun fired counter and spawn projectile." (_type_ vector) (pointer process) 247) - (sig-method-248 (_type_ sig-path-sample) none 248) - (sig-method-249 (_type_ sig-path) none 249) - (sig-method-250 (_type_) symbol 250) - (sig-method-251 (_type_) symbol 251) - (sig-method-252 (_type_) symbol 252) - (sig-method-253 (_type_) none 253) - (sig-method-254 (_type_) symbol 254) - (sig-method-255 (_type_) symbol 255) - (sig-method-256 (_type_) none 256) - (sig-method-257 (_type_) symbol 257) - (sig-method-258 (_type_) none 258) + (:state-methods + whip + blast + chase + chase-attack + traveling + traveling-blocked + waiting-far + waiting-close + waiting-turn + waiting-crouched + charge-plasma + gun-jam + repair-gun + clean-gun + sig-path-run + sig-path-jump + sig-path-jump-land + sig-path-shoot-jump + sig-path-shoot-jump-land + sig-path-idle + ) + (:methods + (sig-method-245 (_type_) symbol) ;; 245 + (sig-method-246 (_type_) symbol) ;; 246 + (fire-gun "Increase gun fired counter and spawn projectile." (_type_ vector) (pointer process)) ;; 247 + (sig-method-248 (_type_ sig-path-sample) none) ;; 248 + (sig-method-249 (_type_ sig-path) none) ;; 249 + (sig-method-250 (_type_) symbol) ;; 250 + (sig-method-251 (_type_) symbol) ;; 251 + (sig-method-252 (_type_) symbol) ;; 252 + (sig-method-253 (_type_) none) ;; 253 + (sig-method-254 (_type_) symbol) ;; 254 + (sig-method-255 (_type_) symbol) ;; 255 + (sig-method-256 (_type_) none) ;; 256 + (sig-method-257 (_type_) symbol) ;; 257 + (sig-method-258 (_type_) none) ;; 258 ) ) @@ -39876,8 +39645,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype sigt-choose-piston (ai-task) @@ -39891,9 +39658,9 @@ :size-assert #x30 :flag-assert #xf00000030 (:methods - (sigt-choose-piston-method-12 (_type_ sig) symbol 12) - (sigt-choose-piston-method-13 (_type_ sig) none 13) - (sigt-choose-piston-method-14 (_type_ sig int) symbol 14) + (sigt-choose-piston-method-12 (_type_ sig) symbol) ;; 12 + (sigt-choose-piston-method-13 (_type_ sig) none) ;; 13 + (sigt-choose-piston-method-14 (_type_ sig int) symbol) ;; 14 ) ) @@ -39907,7 +39674,7 @@ :size-assert #x30 :flag-assert #xd00000030 (:methods - (sigt-riding-piston-method-12 (_type_ sig) symbol 12) + (sigt-riding-piston-method-12 (_type_ sig) symbol) ;; 12 ) ) @@ -39921,8 +39688,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype sigt-fight-focus (ai-task) @@ -39930,8 +39695,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype sigt-repair-gun (ai-task) @@ -39939,8 +39702,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) @@ -39960,8 +39721,6 @@ :method-count-assert 40 :size-assert #x200 :flag-assert #x2801800200 - (:methods - ) ) (define-extern sig-shot-move (function sig-shot none)) @@ -40028,33 +39787,35 @@ :method-count-assert 251 :size-assert #x410 :flag-assert #xfb03900410 - (:methods - (back-spring () _type_ :state 225) - (cartwheel-left () _type_ :state 226) - (tumble-right () _type_ :state 227) - (chase () _type_ :state 228) - (traveling () _type_ :state 229) - (traveling-blocked () _type_ :state 230) - (waiting-idle () _type_ :state 231) - (standing-idle () _type_ :state 232) - (standing-turn () _type_ :state 233) - (standing-blast () _type_ :state 234) - (ashelin-method-235 (_type_ symbol) symbol 235) - (ashelin-method-236 (_type_ vector float float float float) symbol 236) - (fire-projectile (_type_ vector) none 237) - (ashelin-method-238 (_type_ symbol symbol) symbol 238) - (ashelin-method-239 (_type_) none 239) - (ashelin-method-240 (_type_ int) none 240) - (ashelin-method-241 (_type_) int 241) - (ashelin-method-242 (_type_) int 242) - (ashelin-method-243 (_type_ float) int 243) - (ashelin-method-244 (_type_) none 244) - (ashelin-method-245 (_type_) none 245) - (ashelin-method-246 (_type_) int 246) - (ashelin-method-247 (_type_) symbol 247) - (ashelin-method-248 (_type_) symbol 248) - (ashelin-method-249 (_type_) none 249) - (ashelin-method-250 (_type_ symbol) none 250) + (:state-methods + back-spring + cartwheel-left + tumble-right + chase + traveling + traveling-blocked + waiting-idle + standing-idle + standing-turn + standing-blast + ) + (:methods + (ashelin-method-235 (_type_ symbol) symbol) ;; 235 + (ashelin-method-236 (_type_ vector float float float float) symbol) ;; 236 + (fire-projectile (_type_ vector) none) ;; 237 + (ashelin-method-238 (_type_ symbol symbol) symbol) ;; 238 + (ashelin-method-239 (_type_) none) ;; 239 + (ashelin-method-240 (_type_ int) none) ;; 240 + (ashelin-method-241 (_type_) int) ;; 241 + (ashelin-method-242 (_type_) int) ;; 242 + (ashelin-method-243 (_type_ float) int) ;; 243 + (ashelin-method-244 (_type_) none) ;; 244 + (ashelin-method-245 (_type_) none) ;; 245 + (ashelin-method-246 (_type_) int) ;; 246 + (ashelin-method-247 (_type_) symbol) ;; 247 + (ashelin-method-248 (_type_) symbol) ;; 248 + (ashelin-method-249 (_type_) none) ;; 249 + (ashelin-method-250 (_type_ symbol) none) ;; 250 ) ) @@ -40067,8 +39828,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) (deftype asht-fight-focus (ai-task) @@ -40076,8 +39835,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -40096,8 +39853,6 @@ :method-count-assert 40 :size-assert #x200 :flag-assert #x2801800200 - (:methods - ) ) (define-extern ashelin-shot-move (function ashelin-shot none)) @@ -40146,7 +39901,7 @@ :size-assert #x430 :flag-assert #x10403b00430 (:methods - (sig-atoll-method-259 (_type_) symbol 259) + (sig-atoll-method-259 (_type_) symbol) ;; 259 ) ) @@ -40180,7 +39935,7 @@ :size-assert #x418 :flag-assert #xfc03a00418 (:methods - (set-frontline-dist! (_type_) none 251) + (set-frontline-dist! (_type_) none) ;; 251 ) ) @@ -40197,9 +39952,9 @@ :method-count-assert 29 :size-assert #xd4 :flag-assert #x1d006000d4 - (:methods - (dormant () _type_ :state 27) - (idle () _type_ :state 28) + (:state-methods + dormant + idle ) ) @@ -40221,8 +39976,6 @@ :method-count-assert 186 :size-assert #x3b8 :flag-assert #xba034003b8 - (:methods - ) ) (define-extern *sniper-nav-enemy-info* nav-enemy-info) @@ -40259,8 +40012,8 @@ :size-assert #x20 :flag-assert #xa00000020 (:methods - (new (symbol type process-drawable int) _type_ 0) - (amphibian-joint-mod-method-9 (_type_) none 9) + (new (symbol type process-drawable int) _type_) ;; 0 + (amphibian-joint-mod-method-9 (_type_) none) ;; 9 ) ) @@ -40316,17 +40069,19 @@ :method-count-assert 188 :size-assert #x288 :flag-assert #xbc02100288 + (:state-methods + attack-forward + attack-forward-lunge + attack-forward-end + attack-spin + stare-idle + tongue-attack + ) (:methods - (attack-forward () _type_ :state 178) - (attack-forward-lunge () _type_ :state 179) - (attack-forward-end () _type_ :state 180) - (attack-spin () _type_ :state 181) - (stare-idle () _type_ :state 182) - (tongue-attack () _type_ :state 183) - (amphibian-method-184 (_type_ vector vector) vector 184) - (amphibian-method-185 (_type_ amphibian-tongue-attack-info) none 185) - (amphibian-method-186 (_type_ vector vector) symbol 186) - (amphibian-method-187 (_type_) none 187) + (amphibian-method-184 (_type_ vector vector) vector) ;; 184 + (amphibian-method-185 (_type_ amphibian-tongue-attack-info) none) ;; 185 + (amphibian-method-186 (_type_ vector vector) symbol) ;; 186 + (amphibian-method-187 (_type_) none) ;; 187 ) ) @@ -40345,8 +40100,6 @@ :method-count-assert 40 :size-assert #x1f8 :flag-assert #x28018001f8 - (:methods - ) ) (deftype juicer-anim-info (structure) @@ -40396,14 +40149,16 @@ :method-count-assert 185 :size-assert #x350 :flag-assert #xb902d00350 + (:state-methods + ambush-cont + attack + ) (:methods - (ambush-cont () _type_ :state 178) - (attack () _type_ :state 179) - (juicer-method-180 (_type_) none 180) - (fire-projectile (_type_ process-focusable uint) none 181) - (juicer-method-182 (_type_) none 182) - (juicer-method-183 (_type_) none 183) - (juicer-method-184 (_type_ symbol) none 184) + (juicer-method-180 (_type_) none) ;; 180 + (fire-projectile (_type_ process-focusable uint) none) ;; 181 + (juicer-method-182 (_type_) none) ;; 182 + (juicer-method-183 (_type_) none) ;; 183 + (juicer-method-184 (_type_ symbol) none) ;; 184 ) ) @@ -40432,7 +40187,7 @@ :size-assert #x38 :flag-assert #xa00000038 (:methods - (shaker-method-9 (_type_) none 9) + (shaker-method-9 (_type_) none) ;; 9 ) ) @@ -40443,11 +40198,13 @@ :method-count-assert 31 :size-assert #x214 :flag-assert #x1f01a00214 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-marrow-method-29 (_type_) none 29) - (farm-marrow-method-30 (_type_) none 30) + (farm-marrow-method-29 (_type_) none) ;; 29 + (farm-marrow-method-30 (_type_) none) ;; 30 ) ) @@ -40458,11 +40215,13 @@ :method-count-assert 31 :size-assert #x154 :flag-assert #x1f00e00154 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-beetree-method-29 (_type_) none 29) - (farm-beetree-method-30 (_type_) none 30) + (farm-beetree-method-29 (_type_) none) ;; 29 + (farm-beetree-method-30 (_type_) none) ;; 30 ) ) @@ -40473,11 +40232,13 @@ :method-count-assert 31 :size-assert #x154 :flag-assert #x1f00e00154 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-cabbage-method-29 (_type_) none 29) - (farm-cabbage-method-30 (_type_) none 30) + (farm-cabbage-method-29 (_type_) none) ;; 29 + (farm-cabbage-method-30 (_type_) none) ;; 30 ) ) @@ -40488,11 +40249,13 @@ :method-count-assert 31 :size-assert #x114 :flag-assert #x1f00a00114 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-small-cabbage-method-29 (_type_) none 29) - (farm-small-cabbage-method-30 (_type_) none 30) + (farm-small-cabbage-method-29 (_type_) none) ;; 29 + (farm-small-cabbage-method-30 (_type_) none) ;; 30 ) ) @@ -40503,11 +40266,13 @@ :method-count-assert 31 :size-assert #x1d4 :flag-assert #x1f016001d4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-chilirots-method-29 (_type_) none 29) - (farm-chilirots-method-30 (_type_) none 30) + (farm-chilirots-method-29 (_type_) none) ;; 29 + (farm-chilirots-method-30 (_type_) none) ;; 30 ) ) @@ -40516,10 +40281,12 @@ :method-count-assert 30 :size-assert #xcc :flag-assert #x1e005000cc + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (farm-sprinkler-barrels-method-28 (_type_) none 28) - (farm-sprinkler-barrels-method-29 (_type_) none 29) + (farm-sprinkler-barrels-method-28 (_type_) none) ;; 28 + (farm-sprinkler-barrels-method-29 (_type_) none) ;; 29 ) ) @@ -40584,8 +40351,8 @@ :method-count-assert 179 :size-assert #x264 :flag-assert #xb301f00264 - (:methods - (kicked () _type_ :state 178) + (:state-methods + kicked ) ) @@ -40607,8 +40374,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -40634,10 +40401,12 @@ :method-count-assert 181 :size-assert #x290 :flag-assert #xb502100290 + (:state-methods + spawning + ) (:methods - (spawning () _type_ :state 178) - (krew-boss-clone-method-179 (_type_ vector) none 179) - (krew-boss-clone-method-180 (_type_) none 180) + (krew-boss-clone-method-179 (_type_ vector) none) ;; 179 + (krew-boss-clone-method-180 (_type_) none) ;; 180 ) ) @@ -40665,9 +40434,9 @@ :method-count-assert 180 :size-assert #x2fc :flag-assert #xb4028002fc - (:methods - (hidden () _type_ :state 178) - (play-intro () _type_ :state 179) + (:state-methods + hidden + play-intro ) ) @@ -40766,9 +40535,9 @@ :method-count-assert 22 :size-assert #x198 ;; 408 :flag-assert #x1601200198 - (:methods - (idle () _type_ :state 20) - (opened () _type_ :state 21) + (:state-methods + idle + opened ) ) @@ -40779,8 +40548,8 @@ :method-count-assert 21 :size-assert #x198 :flag-assert #x1501200198 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -40796,10 +40565,12 @@ :method-count-assert 23 :size-assert #xf0 :flag-assert #x17007000f0 + (:state-methods + idle + final-position + ) (:methods - (idle () _type_ :state 20) - (final-position () _type_ :state 21) - (strip-game-crate-method-22 (_type_ vector quaternion) none 22) + (strip-game-crate-method-22 (_type_ vector quaternion) none) ;; 22 ) ) @@ -40813,10 +40584,10 @@ :method-count-assert 23 :size-assert #xf4 :flag-assert #x17008000f4 - (:methods - (idle () _type_ :state 20) - (swinging () _type_ :state 21) - (final-position () _type_ :state 22) + (:state-methods + idle + swinging + final-position ) ) @@ -40828,9 +40599,9 @@ :method-count-assert 22 :size-assert #x198 :flag-assert #x1601200198 - (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) + (:state-methods + idle + hidden ) ) @@ -40841,11 +40612,13 @@ :method-count-assert 24 :size-assert #xe4 :flag-assert #x18007000e4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (grunt-egg-method-22 (_type_) none 22) - (grunt-egg-method-23 (_type_) vector4w-2 23) ;; TODO - the script type + (grunt-egg-method-22 (_type_) none) ;; 22 + (grunt-egg-method-23 (_type_) vector4w-2) ;; 23 ;; TODO - the script type ) ) @@ -40854,8 +40627,6 @@ :method-count-assert 24 :size-assert #xe4 :flag-assert #x18007000e4 - (:methods - ) ) (deftype grunt-egg-b (grunt-egg) @@ -40863,8 +40634,6 @@ :method-count-assert 24 :size-assert #xe4 :flag-assert #x18007000e4 - (:methods - ) ) (deftype grunt-egg-c (grunt-egg) @@ -40872,8 +40641,6 @@ :method-count-assert 24 :size-assert #xe4 :flag-assert #x18007000e4 - (:methods - ) ) (deftype grunt-egg-d (grunt-egg) @@ -40881,8 +40648,6 @@ :method-count-assert 24 :size-assert #xe4 :flag-assert #x18007000e4 - (:methods - ) ) (define-extern check-drop-level-strip-crate-drop-userdata-nosplat (function sparticle-system sparticle-cpuinfo matrix none)) @@ -40907,8 +40672,8 @@ :method-count-assert 21 :size-assert #xfc :flag-assert #x15008000fc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -40921,8 +40686,6 @@ :method-count-assert 21 :size-assert #x11c :flag-assert #x1500a0011c - (:methods - ) ) (deftype pitspikes (strip-hazard) @@ -40931,8 +40694,6 @@ :method-count-assert 21 :size-assert #x100 :flag-assert #x1500800100 - (:methods - ) ) (deftype curtainsaw (strip-hazard) @@ -40940,8 +40701,6 @@ :method-count-assert 21 :size-assert #xfc :flag-assert #x15008000fc - (:methods - ) ) (deftype grenade-point (process-drawable) @@ -40961,9 +40720,9 @@ :method-count-assert 22 :size-assert #xfc :flag-assert #x16008000fc - (:methods - (idle () _type_ :state 20) - (die (symbol) _type_ :state 21) + (:state-methods + idle + (die symbol) ) ) @@ -40976,8 +40735,8 @@ :size-assert #x200 :flag-assert #x2a01800200 (:methods - (grenade-method-40 (_type_) none 40) - (grenade-method-41 (_type_) none 41) + (grenade-method-40 (_type_) none) ;; 40 + (grenade-method-41 (_type_) none) ;; 41 ) ) @@ -40987,8 +40746,6 @@ :method-count-assert 21 :size-assert #x100 :flag-assert #x1500800100 - (:methods - ) ) (define-extern strip-handler (function process int symbol event-message-block object :behavior strip-hazard)) @@ -41014,10 +40771,12 @@ :method-count-assert 23 :size-assert #xd9 :flag-assert #x17006000d9 + (:state-methods + die-fast + moving + ) (:methods - (die-fast () _type_ :state 20) - (moving () _type_ :state 21) - (strip-chain-crate-slave-method-22 (_type_) none 22) + (strip-chain-crate-slave-method-22 (_type_) none) ;; 22 ) ) @@ -41032,9 +40791,11 @@ :method-count-assert 22 :size-assert #xf8 :flag-assert #x16008000f8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (strip-chain-crate-method-21 (_type_) none 21) + (strip-chain-crate-method-21 (_type_) none) ;; 21 ) ) @@ -41050,8 +40811,6 @@ :method-count-assert 40 :size-assert #x1f0 :flag-assert #x28017001f0 - (:methods - ) ) (defenum gun-buoy-flags @@ -41091,13 +40850,15 @@ :method-count-assert 184 :size-assert #x2f2 :flag-assert #xb8028002f2 + (:state-methods + attack + exit-ambush + warning + stare-down + open-guns + ) (:methods - (attack () _type_ :state 178) - (exit-ambush () _type_ :state 179) - (warning () _type_ :state 180) - (stare-down () _type_ :state 181) - (open-guns () _type_ :state 182) - (gun-buoy-method-183 (_type_ process-focusable) none 183) + (gun-buoy-method-183 (_type_ process-focusable) none) ;; 183 ) ) @@ -41145,11 +40906,11 @@ :method-count-assert 31 :size-assert #x134 :flag-assert #x1f00c00134 - (:methods - (idle () _type_ :state 27) - (dormant-down () _type_ :state 28) - (dormant-up () _type_ :state 29) - (running () _type_ :state 30) + (:state-methods + idle + dormant-down + dormant-up + running ) ) @@ -41162,9 +40923,9 @@ :method-count-assert 22 :size-assert #xd8 :flag-assert #x16006000d8 - (:methods - (idle () _type_ :state 20) - (risen () _type_ :state 21) + (:state-methods + idle + risen ) ) @@ -41175,10 +40936,10 @@ :method-count-assert 23 :size-assert #xd0 :flag-assert #x17005000d0 - (:methods - (idle-up () _type_ :state 20) - (going-down () _type_ :state 21) - (idle-down () _type_ :state 22) + (:state-methods + idle-up + going-down + idle-down ) ) @@ -41194,8 +40955,8 @@ :method-count-assert 21 :size-assert #x110 :flag-assert #x1500900110 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -41212,8 +40973,8 @@ :method-count-assert 21 :size-assert #x180 :flag-assert #x1501000180 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -41225,8 +40986,8 @@ :method-count-assert 21 :size-assert #x100 :flag-assert #x1500800100 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -41235,8 +40996,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -41245,8 +41006,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -41255,9 +41016,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (die-fast () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + die-fast + idle ) ) @@ -41266,8 +41027,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -41310,15 +41071,15 @@ :size-assert #x2c0 :flag-assert #xb7024002c0 (:methods - (fodder-method-178 (_type_) none 178) + (fodder-method-178 (_type_) none) ;; 178 (look-at-position! "Adjusts the eyes to look at particular position, or the focused target @param position If this is provided, it will be used with [[joint-mod::target-set!]] to adjust the eyes, otherwise the `focus` position is used @return TODO - unsure what the return value is, but it seems to make the eyes more lazy" - (_type_ vector) float 179) - (fodder-method-180 "@TODO no idea, never seems to do anything because the actor-group-count is always 0" (_type_) symbol 180) - (fodder-method-181 (_type_ symbol) none 181) - (fodder-method-182 (_type_) float 182) + (_type_ vector) float) ;; 179 + (fodder-method-180 "@TODO no idea, never seems to do anything because the actor-group-count is always 0" (_type_) symbol) ;; 180 + (fodder-method-181 (_type_ symbol) none) ;; 181 + (fodder-method-182 (_type_) float) ;; 182 ) ) @@ -41338,8 +41099,8 @@ :size-assert #x400 :flag-assert #xe303800400 (:methods - (hal-method-225 (_type_) symbol 225) - (hal-method-226 (_type_) symbol 226) + (hal-method-225 (_type_) symbol) ;; 225 + (hal-method-226 (_type_) symbol) ;; 226 ) ) @@ -41352,8 +41113,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) @@ -41392,28 +41151,30 @@ :method-count-assert 246 :size-assert #x3f0 :flag-assert #xf6037003f0 - (:methods - (kick () _type_ :state 225) - (blast () _type_ :state 226) - (alert-idle () _type_ :state 227) - (alert-turn () _type_ :state 228) - (traveling () _type_ :state 229) - (traveling-blocked () _type_ :state 230) - (waiting-idle () _type_ :state 231) - (waiting-turn () _type_ :state 232) - (scared-idle () _type_ :state 233) - (scared-turn () _type_ :state 234) - (plant-bomb () _type_ :state 235) - (bomb-recoil () _type_ :state 236) - (ruffian-method-237 (_type_) symbol 237) - (ruffian-method-238 (_type_) symbol 238) - (fire-gun (_type_ vector) none 239) - (ruffian-method-240 (_type_) none 240) - (ruffian-method-241 (_type_) none 241) - (ruffian-method-242 (_type_) none 242) - (ruffian-method-243 (_type_) symbol 243) - (ruffian-method-244 (_type_) none 244) - (ruffian-method-245 (_type_) none 245) + (:state-methods + kick + blast + alert-idle + alert-turn + traveling + traveling-blocked + waiting-idle + waiting-turn + scared-idle + scared-turn + plant-bomb + bomb-recoil + ) + (:methods + (ruffian-method-237 (_type_) symbol) ;; 237 + (ruffian-method-238 (_type_) symbol) ;; 238 + (fire-gun (_type_ vector) none) ;; 239 + (ruffian-method-240 (_type_) none) ;; 240 + (ruffian-method-241 (_type_) none) ;; 241 + (ruffian-method-242 (_type_) none) ;; 242 + (ruffian-method-243 (_type_) symbol) ;; 243 + (ruffian-method-244 (_type_) none) ;; 244 + (ruffian-method-245 (_type_) none) ;; 245 ) ) @@ -41439,8 +41200,8 @@ :size-assert #x30 :flag-assert #xe00000030 (:methods - (ruft-choose-jump-method-12 (_type_ ruffian) symbol 12) - (ruft-choose-jump-method-13 (_type_ ruffian) int 13) + (ruft-choose-jump-method-12 (_type_ ruffian) symbol) ;; 12 + (ruft-choose-jump-method-13 (_type_ ruffian) int) ;; 13 ) ) @@ -41505,8 +41266,6 @@ :method-count-assert 40 :size-assert #x200 :flag-assert #x2801800200 - (:methods - ) ) (define-extern jinx-shot-move (function jinx-shot none)) @@ -41524,9 +41283,9 @@ :method-count-assert 29 :size-assert #xdc :flag-assert #x1d006000dc - (:methods - (idle () _type_ :state 27) - (explode () _type_ :state 28) + (:state-methods + idle + explode ) ) @@ -41576,8 +41335,6 @@ :method-count-assert 246 :size-assert #x400 :flag-assert #xf603800400 - (:methods - ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -41658,7 +41415,7 @@ (:methods (update-sound! "Updates the sound of the [[sew-blade]] based on if it's under or above the water" - (_type_) none 20) + (_type_) none) ;; 20 ) ) @@ -41668,8 +41425,8 @@ :method-count-assert 22 :size-assert #x110 :flag-assert #x1600900110 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) @@ -41681,8 +41438,8 @@ :method-count-assert 22 :size-assert #x104 :flag-assert #x1600900104 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) @@ -41691,8 +41448,8 @@ :method-count-assert 22 :size-assert #xf8 :flag-assert #x16008000f8 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) @@ -41701,8 +41458,8 @@ :method-count-assert 22 :size-assert #xf8 :flag-assert #x16008000f8 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) @@ -41714,8 +41471,8 @@ :method-count-assert 22 :size-assert #x100 :flag-assert #x1600800100 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) @@ -41728,16 +41485,18 @@ :method-count-assert 24 :size-assert #xd4 :flag-assert #x18006000d4 + (:state-methods + idle + pressed + ) (:methods - (idle () _type_ :state 20) - (pressed () _type_ :state 21) (init-switch-collision! "Initializes the collision on the switch" - (_type_) none 22) + (_type_) none) ;; 22 (broadcast-to-actors "Broadcast event to all associated [[entity]]s via the `actor-group`s @param `event-type` the symbol to broadcast" - (_type_ symbol) none 23) + (_type_ symbol) none) ;; 23 ) ) @@ -41750,17 +41509,19 @@ :method-count-assert 17 :size-assert #x90 :flag-assert #x1100100090 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) (press! "Turns the lights on (or off) @param switched-on? Should the sewer lights be turned on or off? @param should-turret-flash? Should the turret have it's `flash` set as well" - (_type_ symbol symbol) float 15) + (_type_ symbol symbol) float) ;; 15 (sew-light-control-method-16 "@unused @TODO - not done yet, no callers?" - (_type_ object vector float) symbol 16) + (_type_ object vector float) symbol) ;; 16 ) ) @@ -41792,7 +41553,7 @@ (configure-collision "Appropriately sets the collision on the elevator @param collide-with-jak? If set, the elevator will collide with Jak" - (_type_ symbol) none 49) + (_type_ symbol) none) ;; 49 ) ) @@ -41808,9 +41569,9 @@ :method-count-assert 22 :size-assert #xe0 :flag-assert #x16006000e0 - (:methods - (idle () _type_ :state 20) - (turn () _type_ :state 21) + (:state-methods + idle + turn ) ) @@ -41819,8 +41580,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -41829,8 +41590,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -41842,9 +41603,9 @@ :method-count-assert 22 :size-assert #xcc :flag-assert #x16005000cc - (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) + (:state-methods + idle + hidden ) ) @@ -41853,8 +41614,6 @@ :method-count-assert 36 :size-assert #x140 :flag-assert #x2400c00140 - (:methods - ) ) (deftype sew-mine (process-drawable) @@ -41865,12 +41624,14 @@ :method-count-assert 23 :size-assert #xd0 :flag-assert #x17005000d0 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) (init-mine! "Initializes the mine's particles and sets `last-time` to `0`" - (_type_) none 22) + (_type_) none) ;; 22 ) ) @@ -41879,8 +41640,6 @@ :method-count-assert 23 :size-assert #xd0 :flag-assert #x17005000d0 - (:methods - ) ) (deftype sew-mine-b (sew-mine) @@ -41892,8 +41651,6 @@ :method-count-assert 23 :size-assert #xfc :flag-assert #x17008000fc - (:methods - ) ) (deftype sew-wall (process-focusable) @@ -41907,12 +41664,14 @@ :method-count-assert 30 :size-assert #xe4 :flag-assert #x1e007000e4 + (:state-methods + idle + (hit symbol) + ) (:methods - (idle () _type_ :state 27) - (hit (symbol) _type_ :state 28) (attack-target! "If the target is close enough to the wall, hit it!" - (_type_) none 29) + (_type_) none) ;; 29 ) ) @@ -41921,8 +41680,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -41935,9 +41694,9 @@ :method-count-assert 188 :size-assert #x2c4 :flag-assert #xbc025002c4 - (:methods - (waiting () _type_ :state 186) - (scare () _type_ :state 187) + (:state-methods + waiting + scare ) ) @@ -41984,27 +41743,29 @@ :method-count-assert 198 :size-assert #x33c :flag-assert #xc602c0033c - (:methods - (ambush-land () _type_ :state 178) - (idle-sentry () _type_ :state 179) - (active-wall () _type_ :state 180) - (notice-wall () _type_ :state 181) - (hostile-sentry () _type_ :state 182) - (fire () _type_ :state 183) - (attack () _type_ :state 184) - (hosehead-method-185 (_type_) none 185) - (hosehead-method-186 (_type_) none 186) - (hosehead-method-187 (_type_ vector) none 187) - (hosehead-method-188 (_type_) none 188) - (hosehead-method-189 (_type_) none 189) - (hosehead-method-190 (_type_) symbol 190) - (hosehead-method-191 (_type_ vector vector) none 191) - (hosehead-method-192 (_type_ vector) symbol 192) - (hosehead-method-193 (_type_) none 193) - (hosehead-method-194 (_type_) none 194) - (hosehead-method-195 (_type_) symbol 195) - (hosehead-method-196 (_type_) none 196) - (hosehead-method-197 (_type_) none 197) + (:state-methods + ambush-land + idle-sentry + active-wall + notice-wall + hostile-sentry + fire + attack + ) + (:methods + (hosehead-method-185 (_type_) none) ;; 185 + (hosehead-method-186 (_type_) none) ;; 186 + (hosehead-method-187 (_type_ vector) none) ;; 187 + (hosehead-method-188 (_type_) none) ;; 188 + (hosehead-method-189 (_type_) none) ;; 189 + (hosehead-method-190 (_type_) symbol) ;; 190 + (hosehead-method-191 (_type_ vector vector) none) ;; 191 + (hosehead-method-192 (_type_ vector) symbol) ;; 192 + (hosehead-method-193 (_type_) none) ;; 193 + (hosehead-method-194 (_type_) none) ;; 194 + (hosehead-method-195 (_type_) symbol) ;; 195 + (hosehead-method-196 (_type_) none) ;; 196 + (hosehead-method-197 (_type_) none) ;; 197 ) ) @@ -42082,12 +41843,14 @@ :method-count-assert 25 :size-assert #xe0 :flag-assert #x19006000e0 + (:state-methods + die-fast + idle + walk + ) (:methods - (die-fast () _type_ :state 20) - (idle () _type_ :state 21) - (walk () _type_ :state 22) - (debug-draw (_type_) none 23) - (print-def (_type_) none 24) + (debug-draw (_type_) none) ;; 23 + (print-def (_type_) none) ;; 24 ) ) @@ -42112,19 +41875,21 @@ :method-count-assert 182 :size-assert #x298 :flag-assert #xb602200298 + (:state-methods + attack-forward + ) (:methods - (attack-forward () _type_ :state 178) (adjust-depth! "Changes the height based on the ocean depth @see [[get-height]]" - (_type_) float 179) + (_type_) float) ;; 179 (update-facing! "Updates the `new-facing` vector" - (_type_ vector) vector 180) + (_type_ vector) vector) ;; 180 (encircle-target! "Core movement for the [[gator]], circles the target, charges at the target, etc @params TODO - not sure, they all dont seem to do very much and this method is a mess" - (_type_ float float symbol) time-frame 181) + (_type_ float float symbol) time-frame) ;; 181 ) ) @@ -42154,11 +41919,11 @@ :size-assert #x420 :flag-assert #xe803a00420 (:methods - (hal-sewer-method-227 (_type_) symbol 227) - (hal-sewer-method-228 (_type_) none 228) - (hal-sewer-method-229 (_type_) symbol 229) - (hal-sewer-method-230 (_type_ process-focusable process-focusable) symbol 230) - (hal-sewer-method-231 (_type_ int) symbol 231) + (hal-sewer-method-227 (_type_) symbol) ;; 227 + (hal-sewer-method-228 (_type_) none) ;; 228 + (hal-sewer-method-229 (_type_) symbol) ;; 229 + (hal-sewer-method-230 (_type_ process-focusable process-focusable) symbol) ;; 230 + (hal-sewer-method-231 (_type_ int) symbol) ;; 231 ) ) @@ -42267,18 +42032,18 @@ (aim-turret! "Calculates the angle and tilt for the turret to either aim at the target, or it's default direction @param aim-at-target? Whether or not the turret should aim at the target, will ignore the target if #f" - (_type_ symbol) none 137) + (_type_ symbol) none) ;; 137 (update-collision! "Updates the collision for the turret based on it's aiming direction" - (_type_) none 138) + (_type_) none) ;; 138 (set-aim-at-default! "Aims the turret at it's default direction. Sets `aim-pos` accordingly" - (_type_) none 139) + (_type_) none) ;; 139 (fire-turret! "Actually fires the turret, sets `flash-state` to [[#t]] @param fire-sound? Whether to play the fire sound effect or not" - (_type_ symbol) none 140) - (init-turret-params! (_type_) none 141) + (_type_ symbol) none) ;; 140 + (init-turret-params! (_type_) none) ;; 141 ) ) @@ -42290,7 +42055,7 @@ (:methods (fire-turret! "@overrides Calls [[sew-gunturret::140]] but also customizes the turret flash via [[set-palcab-turret-flash!]]" - (_type_ symbol) float :replace 140) + (_type_ symbol) float :replace) ;; 140 ) ) @@ -42385,15 +42150,18 @@ :method-count-assert 35 :size-assert #x254 ;; 596 :flag-assert #x2301e00254 + (:state-methods + idle + ready + fire + die + ) (:methods - (idle () _type_ :state 27) - (ready () _type_ :state 28) - (fire () _type_ :state 29) - (die () _type_ :state 30) - (fort-robotank-turret-method-31 (_type_ vector vector) none 31) - (fort-robotank-turret-method-32 (_type_ (inline-array vector)) (pointer process) 32) - (fort-robotank-turret-method-33 (_type_) none 33) - (fort-robotank-turret-method-34 (_type_ vector float) symbol 34)) + (fort-robotank-turret-method-31 (_type_ vector vector) none) ;; 31 + (fort-robotank-turret-method-32 (_type_ (inline-array vector)) (pointer process)) ;; 32 + (fort-robotank-turret-method-33 (_type_) none) ;; 33 + (fort-robotank-turret-method-34 (_type_ vector float) symbol) ;; 34 + ) ) (deftype fort-robotank-reticle (process-drawable) @@ -42408,11 +42176,13 @@ :method-count-assert 22 :size-assert #x104 ;; 260 :flag-assert #x1600900104 - (:methods - (idle () _type_ :state 20) - (lock () _type_ :state 21)) + (:state-methods + idle + lock + ) ) + (deftype fort-roboscreen (process-drawable) ( (anim-frame float :offset-assert 200) @@ -42423,12 +42193,15 @@ :method-count-assert 25 :size-assert #xd8 ;; 216 :flag-assert #x19006000d8 + (:state-methods + idle + active + deactive + die + ) (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (deactive () _type_ :state 22) - (die() _type_ :state 23) - (fort-roboscreen-method-24 (_type_) none 24)) + (fort-roboscreen-method-24 (_type_) none) ;; 24 + ) ) (deftype fort-robotank-shot (guard-shot) @@ -42574,15 +42347,18 @@ :method-count-assert 28 :size-assert #x274 ;; 628 :flag-assert #x1c02000274 + (:state-methods + idle + turning + moving + pause + die + ) (:methods - (idle () _type_ :state 20) - (turning () _type_ :state 21) - (moving () _type_ :state 22) - (pause () _type_ :state 23) - (die () _type_ :state 24) - (fort-robotank-method-25 (_type_) event-message-block 25) - (fort-robotank-method-26 (_type_ int float float) symbol 26) - (fort-robotank-method-27 (_type_) none 27)) + (fort-robotank-method-25 (_type_) event-message-block) ;; 25 + (fort-robotank-method-26 (_type_ int float float) symbol) ;; 26 + (fort-robotank-method-27 (_type_) none) ;; 27 + ) ) (define-extern *fort-robotank-1-segment-table* (inline-array fort-robotank-segment)) @@ -42613,9 +42389,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) @@ -42627,9 +42403,9 @@ :method-count-assert 22 :size-assert #x154 :flag-assert #x1600e00154 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) @@ -42648,12 +42424,12 @@ :method-count-assert 25 :size-assert #x118 :flag-assert #x1900a00118 - (:methods - (idle () _type_ :state 20) - (targets-active () _type_ :state 21) - (missile-countdown () _type_ :state 22) - (die () _type_ :state 23) - (dormant () _type_ :state 24) + (:state-methods + idle + targets-active + missile-countdown + die + dormant ) ) @@ -42690,8 +42466,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -42729,8 +42505,8 @@ :method-count-assert 21 :size-assert #xd0 :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -42748,8 +42524,8 @@ :method-count-assert 21 :size-assert #xd0 :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -42758,8 +42534,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -42768,8 +42544,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -42792,22 +42568,24 @@ :method-count-assert 240 :size-assert #x400 :flag-assert #xf003800400 + (:state-methods + traveling + traveling-blocked + waiting-idle + waiting-turn + move-to-vehicle + board-vehicle + ride-vehicle + exit-vehicle + knocked-off-vehicle + arrested + ) (:methods - (traveling () _type_ :state 225) - (traveling-blocked () _type_ :state 226) - (waiting-idle () _type_ :state 227) - (waiting-turn () _type_ :state 228) - (move-to-vehicle () _type_ :state 229) - (board-vehicle () _type_ :state 230) - (ride-vehicle () _type_ :state 231) - (exit-vehicle () _type_ :state 232) - (knocked-off-vehicle () _type_ :state 233) - (arrested () _type_ :state 234) - (want-exit-vehicle? (_type_ vector) symbol 235) - (check-arrest (_type_) none 236) - (go-waiting-turn (_type_) none 237) - (check-vehicle-exit (_type_) none 238) - (play-walk-anim (_type_) none 239) + (want-exit-vehicle? (_type_ vector) symbol) ;; 235 + (check-arrest (_type_) none) ;; 236 + (go-waiting-turn (_type_) none) ;; 237 + (check-vehicle-exit (_type_) none) ;; 238 + (play-walk-anim (_type_) none) ;; 239 ) ) @@ -42838,21 +42616,23 @@ :method-count-assert 239 :size-assert #x410 :flag-assert #xef03900410 + (:state-methods + traveling + traveling-blocked + waiting-idle + waiting-turn + move-to-vehicle + board-vehicle + ride-vehicle + exit-vehicle + knocked-off-vehicle + ) (:methods - (traveling () _type_ :state 225) - (traveling-blocked () _type_ :state 226) - (waiting-idle () _type_ :state 227) - (waiting-turn () _type_ :state 228) - (move-to-vehicle () _type_ :state 229) - (board-vehicle () _type_ :state 230) - (ride-vehicle () _type_ :state 231) - (exit-vehicle () _type_ :state 232) - (knocked-off-vehicle () _type_ :state 233) - (want-exit-vehicle? (_type_ vector) symbol 234) - (go-idle-or-move (_type_) none 235) - (go-waiting-turn (_type_) none 236) - (check-vehicle-exit (_type_) none 237) - (play-walk-anim (_type_) none 238) + (want-exit-vehicle? (_type_ vector) symbol) ;; 234 + (go-idle-or-move (_type_) none) ;; 235 + (go-waiting-turn (_type_) none) ;; 236 + (check-vehicle-exit (_type_) none) ;; 237 + (play-walk-anim (_type_) none) ;; 238 ) ) @@ -42896,16 +42676,16 @@ :size-assert #x450 :flag-assert #xed03d00450 (:methods - (hal-escort-method-227 (_type_) symbol 227) - (hal-escort-method-228 (_type_) symbol 228) - (try-enter-vehicle "Returns seat index" (_type_) int 229) - (hal-escort-method-230 (_type_) symbol 230) - (init-traffic-params! (_type_ symbol) none 231) - (hal-escort-method-232 (_type_) none 232) - (set-traffic-danger! (_type_) none 233) - (hal-escort-method-234 (_type_ nav-mesh) process 234) - (hal-escort-method-235 (_type_) none 235) - (vehicle-destroyed? (_type_) symbol 236) + (hal-escort-method-227 (_type_) symbol) ;; 227 + (hal-escort-method-228 (_type_) symbol) ;; 228 + (try-enter-vehicle "Returns seat index" (_type_) int) ;; 229 + (hal-escort-method-230 (_type_) symbol) ;; 230 + (init-traffic-params! (_type_ symbol) none) ;; 231 + (hal-escort-method-232 (_type_) none) ;; 232 + (set-traffic-danger! (_type_) none) ;; 233 + (hal-escort-method-234 (_type_ nav-mesh) process) ;; 234 + (hal-escort-method-235 (_type_) none) ;; 235 + (vehicle-destroyed? (_type_) symbol) ;; 236 ) ) @@ -42971,10 +42751,10 @@ :method-count-assert 22 :size-assert #xdc :flag-assert #x16006000dc - (:methods - (up () _type_ :state 20) - (down () _type_ :state 21) - ) + (:state-methods + up + down + ) ) (deftype nest-piston (process-drawable) @@ -42984,10 +42764,10 @@ :method-count-assert 22 :size-assert #xd0 :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (up () _type_ :state 21) - ) + (:state-methods + idle + up + ) ) @@ -43031,24 +42811,26 @@ :method-count-assert 195 :size-assert #x2d0 :flag-assert #xc3025002d0 + (:state-methods + crawl + attack0 + attack1 + ambush-crawling + ambush-jumping + mantis-state-183 + roll-right + roll-left + hop-away + ) (:methods - (crawl () _type_ :state 178) - (attack0 () _type_ :state 179) - (attack1 () _type_ :state 180) - (ambush-crawling () _type_ :state 181) - (ambush-jumping () _type_ :state 182) - (mantis-method-183 () none 183) - (roll-right () _type_ :state 184) - (roll-left () _type_ :state 185) - (hop-away () _type_ :state 186) - (mantis-method-187 (_type_) none 187) - (mantis-method-188 (_type_) none 188) - (mantis-method-189 (_type_ vector vector) symbol 189) - (mantis-method-190 (_type_ vector vector) none 190) - (mantis-method-191 (_type_ vector vector) int 191) - (mantis-method-192 (_type_ vector vector) none 192) - (mantis-method-193 (_type_ vector) none 193) - (mantis-method-194 (_type_) symbol 194) + (mantis-method-187 (_type_) none) ;; 187 + (mantis-method-188 (_type_) none) ;; 188 + (mantis-method-189 (_type_ vector vector) symbol) ;; 189 + (mantis-method-190 (_type_ vector vector) none) ;; 190 + (mantis-method-191 (_type_ vector vector) int) ;; 191 + (mantis-method-192 (_type_ vector vector) none) ;; 192 + (mantis-method-193 (_type_ vector) none) ;; 193 + (mantis-method-194 (_type_) symbol) ;; 194 ) ) @@ -43092,15 +42874,17 @@ :method-count-assert 186 :size-assert #x3f0 :flag-assert #xba037003f0 + (:state-methods + waiting + wait-to-walk + walking + walking-attack + turning + ) (:methods - (waiting () _type_ :state 178) - (wait-to-walk () _type_ :state 179) - (walking () _type_ :state 180) - (walking-attack () _type_ :state 181) - (turning () _type_ :state 182) - (mammoth-method-183 (_type_) none 183) - (mammoth-method-184 (_type_) none 184) - (mammoth-method-185 (_type_ vector int) none 185) + (mammoth-method-183 (_type_) none) ;; 183 + (mammoth-method-184 (_type_) none) ;; 184 + (mammoth-method-185 (_type_ vector int) none) ;; 185 ) ) @@ -43137,8 +42921,6 @@ :method-count-assert 40 :size-assert #x1f0 :flag-assert #x28017001f0 - (:methods - ) ) (deftype flying-spider (nav-enemy) @@ -43152,12 +42934,14 @@ :method-count-assert 183 :size-assert #x294 :flag-assert #xb702200294 + (:state-methods + ambush-falling + attack + attack-fire + turn-to-focus + ) (:methods - (ambush-falling () _type_ :state 178) - (attack () _type_ :state 179) - (attack-fire () _type_ :state 180) - (turn-to-focus () _type_ :state 181) - (flying-spider-method-182 (_type_ vector) none 182) + (flying-spider-method-182 (_type_ vector) none) ;; 182 ) ) @@ -43186,8 +42970,8 @@ :method-count-assert 21 :size-assert #xdc :flag-assert #x15006000dc - (:methods - (zap () _type_ :state 20) + (:state-methods + zap ) ) @@ -43231,8 +43015,8 @@ :method-count-assert 21 :size-assert #x18c :flag-assert #x150110018c - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -43244,8 +43028,8 @@ :method-count-assert 15 :size-assert #xd2 :flag-assert #xf006000d2 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) @@ -43254,8 +43038,6 @@ :method-count-assert 15 :size-assert #xd2 :flag-assert #xf006000d2 - (:methods - ) ) (deftype wasp-gem-tracker (gem-tracker) @@ -43263,8 +43045,6 @@ :method-count-assert 15 :size-assert #xd2 :flag-assert #xf006000d2 - (:methods - ) ) (deftype rift-occlude (process-drawable) @@ -43273,8 +43053,8 @@ :method-count-assert 21 :size-assert #xe0 :flag-assert #x15006000e0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -43284,8 +43064,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -43295,8 +43075,8 @@ :method-count-assert 21 :size-assert #xd0 :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -43305,8 +43085,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -43315,8 +43095,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -43346,8 +43126,6 @@ :method-count-assert 40 :size-assert #x200 :flag-assert #x2801800200 - (:methods - ) ) (deftype metalkor-flitter (flitter) @@ -43355,8 +43133,6 @@ :method-count-assert 184 :size-assert #x2b8 :flag-assert #xb8024002b8 - (:methods - ) ) (deftype metalkor-wasp (wasp) @@ -43364,8 +43140,6 @@ :method-count-assert 166 :size-assert #x388 :flag-assert #xa603100388 - (:methods - ) ) (deftype metalkor-spinner-chain-physics (chain-physics) @@ -43375,8 +43149,6 @@ :method-count-assert 18 :size-assert #x578 :flag-assert #x1200000578 - (:methods - ) ) (deftype metalkor-spinner (process-drawable) @@ -43388,10 +43160,10 @@ :method-count-assert 23 :size-assert #xe8 :flag-assert #x17007000e8 - (:methods - (break-it () _type_ :state 20) - (idle () _type_ :state 21) - (shoot-out () _type_ :state 22) + (:state-methods + break-it + idle + shoot-out ) ) @@ -43403,11 +43175,11 @@ :method-count-assert 31 :size-assert #xe9 :flag-assert #x1f007000e9 - (:methods - (egg-pop () _type_ :state 27) - (fall () _type_ :state 28) - (hatch () _type_ :state 29) - (idle () _type_ :state 30) + (:state-methods + egg-pop + fall + hatch + idle ) ) @@ -43417,8 +43189,8 @@ :method-count-assert 21 :size-assert #xcc :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -43442,8 +43214,8 @@ :method-count-assert 28 :size-assert #x2a0 :flag-assert #x1c022002a0 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) @@ -43459,8 +43231,6 @@ :method-count-assert 18 :size-assert #x5e8 :flag-assert #x12000005e8 - (:methods - ) ) (deftype metalkor-lowtorso (process-focusable) @@ -43478,8 +43248,8 @@ :method-count-assert 28 :size-assert #x154 :flag-assert #x1c00e00154 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) @@ -43553,23 +43323,23 @@ :method-count-assert 43 :size-assert #x35c :flag-assert #x2b02e0035c - (:methods - (beaten (symbol) _type_ :state 27) - (explode () _type_ :state 28) - (fly-to-ring () _type_ :state 29) - (last-gasp () _type_ :state 30) - (overload-recover () _type_ :state 31) - (fall-down () _type_ :state 32) - (tail-attack () _type_ :state 33) - (foot-attack () _type_ :state 34) - (get-close () _type_ :state 35) - (standing-shot () _type_ :state 36) - (chase-target () _type_ :state 37) - (play-drop-movie () _type_ :state 38) - (start-second-stage () _type_ :state 39) - (hang-shoot-n-launch () _type_ :state 40) - (hidden () _type_ :state 41) - (test () _type_ :state 42) + (:state-methods + (beaten symbol) + explode + fly-to-ring + last-gasp + overload-recover + fall-down + tail-attack + foot-attack + get-close + standing-shot + chase-target + play-drop-movie + start-second-stage + hang-shoot-n-launch + hidden + test ) ) @@ -43643,8 +43413,6 @@ :method-count-assert 16 :size-assert #x90 :flag-assert #x1000100090 - (:methods - ) ) (deftype rift-ring-ingame (process-drawable) @@ -43656,8 +43424,8 @@ :method-count-assert 21 :size-assert #xf0 :flag-assert #x15007000f0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -43666,9 +43434,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) @@ -43677,8 +43445,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -43705,8 +43473,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -43715,8 +43483,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -43856,14 +43624,16 @@ :method-count-assert 185 :size-assert #x59c :flag-assert #xb90520059c + (:state-methods + explode + ) (:methods - (explode () _type_ :state 178) - (bombbot-method-179 (_type_) none 179) - (bombbot-method-180 (_type_) none 180) - (bombbot-method-181 (_type_ vector) none 181) - (bombbot-method-182 (_type_) none 182) - (bombbot-method-183 (_type_) none 183) - (bombbot-method-184 (_type_) none 184) + (bombbot-method-179 (_type_) none) ;; 179 + (bombbot-method-180 (_type_) none) ;; 180 + (bombbot-method-181 (_type_ vector) none) ;; 181 + (bombbot-method-182 (_type_) none) ;; 182 + (bombbot-method-183 (_type_) none) ;; 183 + (bombbot-method-184 (_type_) none) ;; 184 ) ) @@ -43930,8 +43700,8 @@ :method-count-assert 15 :size-assert #x154 :flag-assert #xf00e00154 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) @@ -43990,8 +43760,6 @@ :method-count-assert 21 :size-assert #xd4 :flag-assert #x15006000d4 - (:methods - ) ) (deftype pal-prong (process-drawable) @@ -44001,10 +43769,10 @@ :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 - (:methods - (idle () _type_ :state 20) - (break-it () _type_ :state 21) - (broken () _type_ :state 22) + (:state-methods + idle + break-it + broken ) ) @@ -44061,10 +43829,10 @@ :method-count-assert 23 :size-assert #xdc :flag-assert #x17006000dc - (:methods - (idle () _type_ :state 20) - (play-hint () _type_ :state 21) - (die () _type_ :state 22) + (:state-methods + idle + play-hint + die ) ) @@ -44078,11 +43846,13 @@ :method-count-assert 24 :size-assert #xe0 :flag-assert #x18006000e0 + (:state-methods + idle + breaking + ) (:methods - (idle () _type_ :state 20) - (breaking () _type_ :state 21) - (fort-fence-method-22 (_type_) none 22) - (fort-fence-method-23 (_type_) none 23) + (fort-fence-method-22 (_type_) none) ;; 22 + (fort-fence-method-23 (_type_) none) ;; 23 ) ) @@ -44118,13 +43888,15 @@ :method-count-assert 143 :size-assert #x2d4 :flag-assert #x8f026002d4 + (:state-methods + attack + sweep + ) (:methods - (attack () _type_ :state 137) - (sweep () _type_ :state 138) - (fort-turret-method-139 (_type_) none 139) - (fort-turret-method-140 (_type_ float float) quaternion 140) - (fort-turret-method-141 (_type_) vector 141) - (fort-turret-method-142 (_type_ symbol int) symbol 142) + (fort-turret-method-139 (_type_) none) ;; 139 + (fort-turret-method-140 (_type_ float float) quaternion) ;; 140 + (fort-turret-method-141 (_type_) vector) ;; 141 + (fort-turret-method-142 (_type_ symbol int) symbol) ;; 142 ) ) @@ -44156,9 +43928,9 @@ :method-count-assert 22 :size-assert #xe0 :flag-assert #x16006000e0 - (:methods - (idle () _type_ :state 20) - (active (time-frame uint) _type_ :state 21) + (:state-methods + idle + (active time-frame uint) ) ) @@ -44186,17 +43958,19 @@ :method-count-assert 30 :size-assert #x174 :flag-assert #x1e01000174 + (:state-methods + hide + wait-for-start + (active symbol) + (attack int) + lose + win + ) (:methods - (hide () _type_ :state 20) - (wait-for-start () _type_ :state 21) - (active (symbol int) _type_ :state 22) - (attack (int) _type_ :state 23) - (lose () _type_ :state 24) - (win () _type_ :state 25) - (whack-a-metal-method-26 (_type_) integer 26) - (whack-a-metal-method-27 (_type_) none 27) - (whack-a-metal-method-28 (_type_) none 28) - (whack-a-metal-method-29 (_type_ int int) int 29) + (whack-a-metal-method-26 (_type_) integer) ;; 26 + (whack-a-metal-method-27 (_type_) none) ;; 27 + (whack-a-metal-method-28 (_type_) none) ;; 28 + (whack-a-metal-method-29 (_type_ int int) int) ;; 29 ) ) @@ -44224,18 +43998,21 @@ :method-count-assert 189 :size-assert #x2a4 ;; 676 :flag-assert #xbd023002a4 + (:state-methods + roboguard-level-state-178 + roboguard-level-state-179 + roll-enter + roll-hostile + roll-to-walk + idle-dizzy + explode + ) (:methods - (roboguard-level-method-178 (_type_) none 178) - (roboguard-level-method-179 (_type_) none 179) - (roll-enter () _type_ :state 180) - (roll-hostile () _type_ :state 181) - (roll-to-walk () _type_ :state 182) - (idle-dizzy () _type_ :state 183) - (explode () _type_ :state 184) - (roboguard-level-method-185 (_type_ symbol) none 185) - (roboguard-level-method-186 (_type_) none 186) - (roboguard-level-method-187 (_type_) none 187) - (roboguard-level-method-188 (_type_) none 188)) + (roboguard-level-method-185 (_type_ symbol) none) ;; 185 + (roboguard-level-method-186 (_type_) none) ;; 186 + (roboguard-level-method-187 (_type_) none) ;; 187 + (roboguard-level-method-188 (_type_) none) ;; 188 + ) ) (define-extern *roboguard-level-exploder-params* joint-exploder-static-params) @@ -44289,10 +44066,12 @@ :method-count-assert 28 :size-assert #x138 ;; 312 :flag-assert #x1c00c00138 - (:methods - (idle () _type_ :state 27)) + (:state-methods + idle + ) ) + (deftype cas-electric-fence (process-focusable) ((next-spawn-time time-frame :offset-assert 208) (stop symbol :offset-assert 216) @@ -44300,18 +44079,21 @@ :method-count-assert 29 :size-assert #xdc ;; 220 :flag-assert #x1d006000dc - (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28)) + (:state-methods + idle + die + ) ) + (deftype cas-button (basebutton) () :method-count-assert 40 :size-assert #x120 ;; 288 :flag-assert #x2800a00120 (:methods - (cas-button-method-39 (_type_) none 39)) + (cas-button-method-39 (_type_) none) ;; 39 + ) ) (deftype cas-elevator (elevator) @@ -44321,7 +44103,8 @@ :size-assert #x174 ;; 372 :flag-assert #x3201000174 (:methods - (cas-elevator-method-49 (_type_) none 49)) + (cas-elevator-method-49 (_type_) none) ;; 49 + ) ) (deftype cas-rot-bridge (process-drawable) @@ -44337,10 +44120,12 @@ :method-count-assert 21 :size-assert #xe4 ;; 228 :flag-assert #x15007000e4 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) + (deftype cas-switch (process-drawable) ( (actor-group (pointer actor-group) :offset-assert 200) @@ -44357,10 +44142,12 @@ :method-count-assert 21 :size-assert #xf0 ;; 240 :flag-assert #x15007000f0 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) + (deftype cas-trapdoor (process-drawable) ( (root collide-shape :override) @@ -44368,22 +44155,26 @@ :method-count-assert 22 :size-assert #xc8 ;; 200 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21)) + (:state-methods + idle + die + ) ) + (deftype cas-chain-plat (process-focusable) () :method-count-assert 30 :size-assert #xcc ;; 204 :flag-assert #x1e005000cc - (:methods - (idle () _type_ :state 27) - (drop () _type_ :state 28) - (down () _type_ :state 29)) + (:state-methods + idle + drop + down + ) ) + (deftype cas-rot-blade (process-drawable) ( (sync sync-eased :inline :offset-assert 200) @@ -44394,8 +44185,9 @@ :method-count-assert 21 :size-assert #x100 ;; 256 :flag-assert #x1500800100 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) (deftype cas-flag-a (process-drawable) @@ -44403,8 +44195,9 @@ :method-count-assert 21 :size-assert #xc8 ;; 200 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) (deftype cas-flag-b (process-drawable) @@ -44412,8 +44205,9 @@ :method-count-assert 21 :size-assert #xc8 ;; 200 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) (deftype cas-robot-door (process-drawable) @@ -44434,10 +44228,11 @@ :method-count-assert 23 :size-assert #x100 ;; 256 :flag-assert #x1700800100 - (:methods - (idle () _type_ :state 20) - (spawning () _type_ :state 21) - (castle-wait-end () _type_ :state 22)) + (:state-methods + idle + spawning + castle-wait-end + ) ) (deftype lightning-ball (process-drawable) @@ -44448,8 +44243,9 @@ :method-count-assert 21 :size-assert #xd0 ;; 208 :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) (define-extern *cas-conveyor-room-id* int) @@ -44515,8 +44311,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -44525,8 +44321,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -44535,8 +44331,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -44545,8 +44341,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -44555,8 +44351,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (define-extern consite-bomb-elevator-hinges-init-by-other (function consite-bomb-elevator entity-actor none :behavior consite-bomb-elevator-hinges)) @@ -44599,8 +44393,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -44611,8 +44405,8 @@ :method-count-assert 21 :size-assert #xcc :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -44623,8 +44417,8 @@ :method-count-assert 21 :size-assert #xcc :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -44661,9 +44455,9 @@ :method-count-assert 22 :size-assert #x174 :flag-assert #x1601000174 - (:methods - (chase (spool-anim) _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + (chase spool-anim) + idle ) ) @@ -44674,9 +44468,11 @@ :method-count-assert 22 :size-assert #xcc :flag-assert #x16005000cc + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (spider-eyes-method-21 (_type_) none 21) + (spider-eyes-method-21 (_type_) none) ;; 21 ) ) @@ -44705,8 +44501,8 @@ :method-count-assert 21 :size-assert #x108 :flag-assert #x1500900108 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -44715,8 +44511,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -44727,8 +44523,8 @@ :method-count-assert 21 :size-assert #xd0 :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -44737,8 +44533,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -44768,11 +44564,13 @@ :method-count-assert 24 :size-assert #x3e0 :flag-assert #x18036003e0 + (:state-methods + test + idle + ) (:methods - (test () _type_ :state 20) - (idle () _type_ :state 21) - (joint-setup (_type_) none 22) - (squid-tentacle-method-23 (_type_) none 23) + (joint-setup (_type_) none) ;; 22 + (squid-tentacle-method-23 (_type_) none) ;; 23 ) ) @@ -44879,34 +44677,36 @@ :method-count-assert 54 :size-assert #x508 :flag-assert #x3604900508 - (:methods - (test () _type_ :state 27) - (beaten () _type_ :state 28) - (wait-around-corner () _type_ :state 29) - (wait-beside-building () _type_ :state 30) - (flee () _type_ :state 31) - (pre-flee () _type_ :state 32) - (recharge () _type_ :state 33) - (fly-to-post () _type_ :state 34) - (headbut () _type_ :state 35) - (fire-whirlwind () _type_ :state 36) - (fire-grenades () _type_ :state 37) - (fire () _type_ :state 38) - (fly-to-shoot-spot () _type_ :state 39) - (idle () _type_ :state 40) - (hidden () _type_ :state 41) - (squid-method-42 (_type_ vector) vector 42) - (squid-method-43 (_type_ vector float float) none 43) - (squid-method-44 (_type_ vector vector) symbol 44) - (move-to-spot (_type_ vector symbol) none 45) - (set-traj-towards-vec "Set up the [[trajectory]] towards `dest`." (_type_ vector vector vector) none 46) - (float-sin-clamp (_type_ float) float 47) - (squid-method-48 (_type_) float 48) - (setup-part-engine (_type_ symbol) none 49) - (squid-post (_type_) none 50) - (spawn-whirlwind (_type_) (pointer squid-whirlwind) 51) - (spawn-grenade (_type_ int squid-grenade-holder float) none 52) - (squid-method-53 (_type_ int) none 53) + (:state-methods + test + beaten + wait-around-corner + wait-beside-building + flee + pre-flee + recharge + fly-to-post + headbut + fire-whirlwind + fire-grenades + fire + fly-to-shoot-spot + idle + hidden + ) + (:methods + (squid-method-42 (_type_ vector) vector) ;; 42 + (squid-method-43 (_type_ vector float float) none) ;; 43 + (squid-method-44 (_type_ vector vector) symbol) ;; 44 + (move-to-spot (_type_ vector symbol) none) ;; 45 + (set-traj-towards-vec "Set up the [[trajectory]] towards `dest`." (_type_ vector vector vector) none) ;; 46 + (float-sin-clamp (_type_ float) float) ;; 47 + (squid-method-48 (_type_) float) ;; 48 + (setup-part-engine (_type_ symbol) none) ;; 49 + (squid-post (_type_) none) ;; 50 + (spawn-whirlwind (_type_) (pointer squid-whirlwind)) ;; 51 + (spawn-grenade (_type_ int squid-grenade-holder float) none) ;; 52 + (squid-method-53 (_type_ int) none) ;; 53 ) ) @@ -44984,17 +44784,19 @@ :method-count-assert 24 :size-assert #xe8 :flag-assert #x18007000e8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) (init-spike-joints! "Initializes the skeleton and joints for the spike" - (_type_) none 21) + (_type_) none) ;; 21 (init-spike-collision! "Initializes the collision for the particular spike" - (_type_) collide-shape-moving 22) + (_type_) collide-shape-moving) ;; 22 (init-periodic-animation! "Initialzes the periodic animation of the spikes (exit and re-entry)" - (_type_) symbol 23) + (_type_) symbol) ;; 23 ) ) @@ -45027,8 +44829,8 @@ :method-count-assert 21 :size-assert #x110 :flag-assert #x1500900110 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -45044,10 +44846,10 @@ :method-count-assert 23 :size-assert #x1f0 :flag-assert #x17017001f0 - (:methods - (idle () _type_ :state 20) - (running () _type_ :state 21) - (die () _type_ :state 22) + (:state-methods + idle + running + die ) ) @@ -45063,9 +44865,11 @@ :method-count-assert 16 :size-assert #xc8 :flag-assert #x10005000c8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (fort-elec-belt-method-15 (_type_) none 15) + (fort-elec-belt-method-15 (_type_) none) ;; 15 ) ) @@ -45074,8 +44878,6 @@ :method-count-assert 28 :size-assert #x100 :flag-assert #x1c00800100 - (:methods - ) ) (define-extern fort-elec-belt-inst-init-by-other (function quaternion float float lightning-spec uint none :behavior fort-elec-belt-inst)) @@ -45096,8 +44898,8 @@ :method-count-assert 179 :size-assert #x284 :flag-assert #xb302100284 - (:methods - (attack () _type_ :state 178) + (:state-methods + attack ) ) @@ -45131,9 +44933,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (fall () _type_ :state 21) + (:state-methods + idle + fall ) ) @@ -45142,8 +44944,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype pal-grind-ring-center (process-focusable) @@ -45153,10 +44953,12 @@ :method-count-assert 30 :size-assert #xd4 :flag-assert #x1e006000d4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (pal-grind-ring-center-method-29 (_type_) none 29) + (pal-grind-ring-center-method-29 (_type_) none) ;; 29 ) ) @@ -45167,10 +44969,12 @@ :method-count-assert 30 :size-assert #xd4 :flag-assert #x1e006000d4 + (:state-methods + idle + fall + ) (:methods - (idle () _type_ :state 27) - (fall () _type_ :state 28) - (pal-grind-ring-method-29 (_type_) none 29) + (pal-grind-ring-method-29 (_type_) none) ;; 29 ) ) @@ -45179,11 +44983,13 @@ :method-count-assert 31 :size-assert #xcc :flag-assert #x1f005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (pal-ent-glass-method-29 (_type_) none 29) - (pal-ent-glass-method-30 (_type_) none 30) + (pal-ent-glass-method-29 (_type_) none) ;; 29 + (pal-ent-glass-method-30 (_type_) none) ;; 30 ) ) @@ -45192,8 +44998,6 @@ :method-count-assert 40 :size-assert #x1f0 :flag-assert #x28017001f0 - (:methods - ) ) (deftype palent-turret (process-focusable) @@ -45202,9 +45006,11 @@ :method-count-assert 29 :size-assert #xd8 :flag-assert #x1d006000d8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (palent-turret-method-28 (_type_) none 28) + (palent-turret-method-28 (_type_) none) ;; 28 ) ) @@ -45213,11 +45019,13 @@ :method-count-assert 31 :size-assert #xcc :flag-assert #x1f005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (pal-breakable-window-method-29 (_type_) none 29) - (pal-breakable-window-method-30 (_type_) none 30) + (pal-breakable-window-method-29 (_type_) none) ;; 29 + (pal-breakable-window-method-30 (_type_) none) ;; 30 ) ) @@ -45250,11 +45058,11 @@ :size-assert #x15c :flag-assert #x1200e0015c ;; Failed to read fields. - (:methods - (startup () _type_ :state 14) - (wait () _type_ :state 15) - (idle () _type_ :state 16) - (scrap-book (int) _type_ :state 17) + (:state-methods + startup + wait + idle + (scrap-book int) ) ) @@ -45292,12 +45100,14 @@ :method-count-assert 25 :size-assert #x108 :flag-assert #x1900900108 + (:state-methods + wait-for-start + idle + (pickup (state mech)) + wait-for-return + ) (:methods - (wait-for-start () _type_ :state 20) - (idle () _type_ :state 21) - (pickup ((state mech)) _type_ :state 22) - (wait-for-return () _type_ :state 23) - (mech-method-24 (_type_) none 24) + (mech-method-24 (_type_) none) ;; 24 ) ) @@ -45306,9 +45116,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) + (:state-methods + idle + active ) ) @@ -45382,8 +45192,8 @@ :size-assert #x490 :flag-assert #xb00000490 (:methods - (grunt-mech-info-method-9 (_type_ int process symbol) symbol 9) - (grunt-mech-info-method-10 (_type_) none 10) + (grunt-mech-info-method-9 (_type_ int process symbol) symbol) ;; 9 + (grunt-mech-info-method-10 (_type_) none) ;; 10 ) ) @@ -45394,17 +45204,19 @@ :method-count-assert 196 :size-assert #x2d0 :flag-assert #xc4025002d0 + (:state-methods + mech-lunge + mech-hold + mech-dismount + mech-post-circling + mech-pre-circling + ) (:methods - (mech-lunge () _type_ :state 186) - (mech-hold () _type_ :state 187) - (mech-dismount () _type_ :state 188) - (mech-post-circling () _type_ :state 189) - (mech-pre-circling () _type_ :state 190) - (grunt-mech-method-191 (_type_) none 191) - (grunt-mech-method-192 (_type_) symbol 192) - (grunt-mech-method-193 (_type_) int 193) - (grunt-mech-method-194 (_type_) none 194) - (grunt-mech-method-195 (_type_ vector vector vector) symbol 195) + (grunt-mech-method-191 (_type_) none) ;; 191 + (grunt-mech-method-192 (_type_) symbol) ;; 192 + (grunt-mech-method-193 (_type_) int) ;; 193 + (grunt-mech-method-194 (_type_) none) ;; 194 + (grunt-mech-method-195 (_type_ vector vector vector) symbol) ;; 195 ) ) @@ -45463,8 +45275,8 @@ :method-count-assert 21 :size-assert #x234 :flag-assert #x1501c00234 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -45479,8 +45291,8 @@ :method-count-assert 21 :size-assert #x100 :flag-assert #x1500800100 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -45489,8 +45301,6 @@ :method-count-assert 40 :size-assert #x1f0 :flag-assert #x28017001f0 - (:methods - ) ) (deftype pal-rot-gun (process-drawable) @@ -45506,11 +45316,13 @@ :method-count-assert 24 :size-assert #x100 :flag-assert #x1800800100 + (:state-methods + idle + spin + spin-down + ) (:methods - (idle () _type_ :state 20) - (spin () _type_ :state 21) - (spin-down () _type_ :state 22) - (pal-rot-gun-method-23 (_type_ matrix) none 23) + (pal-rot-gun-method-23 (_type_ matrix) none) ;; 23 ) ) @@ -45519,8 +45331,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -45530,10 +45342,10 @@ :method-count-assert 23 :size-assert #xcc :flag-assert #x17005000cc - (:methods - (idle () _type_ :state 20) - (fall () _type_ :state 21) - (fallen () _type_ :state 22) + (:state-methods + idle + fall + fallen ) ) @@ -45549,8 +45361,8 @@ :method-count-assert 21 :size-assert #xf4 :flag-assert #x15008000f4 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -45567,11 +45379,13 @@ :method-count-assert 24 :size-assert #xd8 :flag-assert #x18006000d8 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (seal-of-mar-method-22 (_type_) none 22) - (seal-of-mar-method-23 (_type_) none 23) + (seal-of-mar-method-22 (_type_) none) ;; 22 + (seal-of-mar-method-23 (_type_) none) ;; 23 ) ) @@ -45616,8 +45430,8 @@ :method-count-assert 38 :size-assert #x154 :flag-assert #x2600e00154 - (:methods - (plat-anim-active () _type_ :state 37) + (:state-methods + plat-anim-active ) ) @@ -45628,9 +45442,9 @@ :method-count-assert 22 :size-assert #xd0 :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (pause () _type_ :state 21) + (:state-methods + idle + pause ) ) @@ -45685,9 +45499,9 @@ :method-count-assert 22 :size-assert #xe8 :flag-assert #x16007000e8 - (:methods - (idle () _type_ :state 20) - (fall () _type_ :state 21) + (:state-methods + idle + fall ) ) @@ -45717,15 +45531,17 @@ :method-count-assert 28 :size-assert #x148 :flag-assert #x1c00d00148 + (:state-methods + hide + wait-for-start + (active symbol) + (lose symbol) + win + ) (:methods - (hide () _type_ :state 20) - (wait-for-start () _type_ :state 21) - (active (symbol) _type_ :state 22) - (lose (symbol) _type_ :state 23) - (win () _type_ :state 24) - (onin-game-method-25 (_type_) none 25) - (onin-game-method-26 (_type_) none 26) - (onin-game-method-27 "TODO - bubble type" (_type_ int) none 27) + (onin-game-method-25 (_type_) none) ;; 25 + (onin-game-method-26 (_type_) none) ;; 26 + (onin-game-method-27 "TODO - bubble type" (_type_ int) none) ;; 27 ) ) @@ -45804,8 +45620,9 @@ :method-count-assert 21 :size-assert #xc8 ;; 200 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) (deftype gar-curtain (process-drawable) @@ -45813,8 +45630,9 @@ :method-count-assert 21 :size-assert #xc8 ;; 200 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) (deftype rift-rider (rigid-body-object) @@ -45835,12 +45653,13 @@ :method-count-assert 58 :size-assert #x17c ;; 380 :flag-assert #x3a0100017c - (:methods - (defend-stadium-move () _type_ :state 53) - (defend-stadium-die () _type_ :state 54) - (defend-stadium-explode () _type_ :state 55) - (defend-stadium-land () _type_ :state 56) - (defend-stadium-complete () _type_ :state 57)) + (:state-methods + defend-stadium-move + defend-stadium-die + defend-stadium-explode + defend-stadium-land + defend-stadium-complete + ) (:states defend-stadium-wait) ) @@ -45859,8 +45678,9 @@ :method-count-assert 21 :size-assert #xc8 ;; 200 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) (deftype gar-door (com-airlock) @@ -45905,16 +45725,18 @@ :method-count-assert 36 :size-assert #x174 ;; 372 :flag-assert #x2401000174 + (:state-methods + idle + raise-rift-rider + move-rift-rider + hit + die + ) (:methods - (idle () _type_ :state 27) - (raise-rift-rider () _type_ :state 28) - (move-rift-rider () _type_ :state 29) - (hit () _type_ :state 30) - (die () _type_ :state 31) - (init! (_type_) none 32) - (get-position (_type_) symbol 33) - (spawn-lightning (_type_) none 34) - (kill-lightning (_type_) none 35) + (init! (_type_) none) ;; 32 + (get-position (_type_) symbol) ;; 33 + (spawn-lightning (_type_) none) ;; 34 + (kill-lightning (_type_) none) ;; 35 ) ) @@ -45935,11 +45757,14 @@ :method-count-assert 24 :size-assert #xf8 ;; 248 :flag-assert #x18008000f8 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (stadium-barrier-method-22 (_type_) none 22) - (stadium-barrier-method-23 (_type_) none 23)) + (stadium-barrier-method-22 (_type_) none) ;; 22 + (stadium-barrier-method-23 (_type_) none) ;; 23 + ) ) (deftype stad-force-field (process-focusable) @@ -45953,10 +45778,13 @@ :method-count-assert 30 :size-assert #xf8 ;; 248 :flag-assert #x1e008000f8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (stad-force-field-method-28 (_type_) none 28) - (stad-force-field-method-29 (_type_ touching-shapes-entry) int 29)) + (stad-force-field-method-28 (_type_) none) ;; 28 + (stad-force-field-method-29 (_type_ touching-shapes-entry) int) ;; 29 + ) ) (deftype stad-c-force-field (stad-force-field) @@ -45978,8 +45806,9 @@ :method-count-assert 21 :size-assert #xc8 ;; 200 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) (deftype stad-brutter (process-drawable) @@ -45987,8 +45816,9 @@ :method-count-assert 21 :size-assert #xc8 ;; 200 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) (deftype brutter-balloon (process-drawable) @@ -45996,8 +45826,9 @@ :method-count-assert 21 :size-assert #xc8 ;; 200 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) (define-extern ripple-for-water-anim-stadium ripple-wave-set) @@ -46028,8 +45859,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) |# @@ -46057,9 +45886,9 @@ :method-count-assert 29 :size-assert #x110 :flag-assert #x1d00900110 - (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) + (:state-methods + idle + die ) ) @@ -46137,8 +45966,8 @@ :method-count-assert 21 :size-assert #xd8 :flag-assert #x15006000d8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -46149,8 +45978,8 @@ :method-count-assert 21 :size-assert #xd0 :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -46161,10 +45990,12 @@ :method-count-assert 23 :size-assert #xe0 :flag-assert #x17006000e0 + (:state-methods + dormant + idle + ) (:methods - (dormant () _type_ :state 20) - (idle () _type_ :state 21) - (fort-plat-shuttle-method-22 (_type_) symbol 22) + (fort-plat-shuttle-method-22 (_type_) symbol) ;; 22 ) ) @@ -46232,24 +46063,26 @@ :method-count-assert 31 :size-assert #x100 :flag-assert #x1f00800100 + (:state-methods + wait-for-pickup + wait-for-pickup-training + wait-for-board + wait + jump + duck-jump + boost-jump + grind + spin + flip + trick + game + idle + idle-training + ) (:methods - (wait-for-pickup () _type_ :state 14) - (wait-for-pickup-training () _type_ :state 15) - (wait-for-board () _type_ :state 16) - (wait () _type_ :state 17) - (jump () _type_ :state 18) - (duck-jump () _type_ :state 19) - (boost-jump () _type_ :state 20) - (grind () _type_ :state 21) - (spin () _type_ :state 22) - (flip () _type_ :state 23) - (trick () _type_ :state 24) - (game () _type_ :state 25) - (idle () _type_ :state 26) - (idle-training () _type_ :state 27) - (render-text (_type_ text-id) float 28) - (hoverboard-training-manager-method-29 (_type_) none 29) - (hoverboard-training-manager-method-30 (_type_) none 30) + (render-text (_type_ text-id) float) ;; 28 + (hoverboard-training-manager-method-29 (_type_) none) ;; 29 + (hoverboard-training-manager-method-30 (_type_) none) ;; 30 ) ) @@ -46259,9 +46092,11 @@ :method-count-assert 29 :size-assert #xd0 :flag-assert #x1d005000d0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (skate-training-ramp-method-28 (_type_) collide-shape-moving 28) + (skate-training-ramp-method-28 (_type_) collide-shape-moving) ;; 28 ) ) @@ -46271,10 +46106,12 @@ :method-count-assert 30 :size-assert #xd0 :flag-assert #x1e005000d0 + (:state-methods + idle + open + ) (:methods - (idle () _type_ :state 27) - (open () _type_ :state 28) - (skate-gate-method-29 (_type_) collide-shape-moving 29) + (skate-gate-method-29 (_type_) collide-shape-moving) ;; 29 ) ) @@ -46292,9 +46129,11 @@ :method-count-assert 29 :size-assert #xd4 :flag-assert #x1d006000d4 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (skatea-floating-ring-method-28 (_type_) none 28) + (skatea-floating-ring-method-28 (_type_) none) ;; 28 ) ) @@ -46341,8 +46180,6 @@ :method-count-assert 37 :size-assert #x164 :flag-assert #x2500f00164 - (:methods - ) ) (deftype tomb-stair-block-spikes (process-drawable) @@ -46351,8 +46188,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -46379,12 +46216,12 @@ :method-count-assert 25 :size-assert #x15c :flag-assert #x1900e0015c - (:methods - (wait-for-pools () _type_ :state 20) - (idle () _type_ :state 21) - (moving () _type_ :state 22) - (sink () _type_ :state 23) - (sunk () _type_ :state 24) + (:state-methods + wait-for-pools + idle + moving + sink + sunk ) ) @@ -46393,8 +46230,6 @@ :method-count-assert 25 :size-assert #xd4 :flag-assert #x19006000d4 - (:methods - ) ) (deftype tomb-plat-pillar (plat) @@ -46402,8 +46237,6 @@ :method-count-assert 37 :size-assert #x144 :flag-assert #x2500d00144 - (:methods - ) ) (deftype tomb-elevator (elevator) @@ -46413,8 +46246,6 @@ :method-count-assert 49 :size-assert #x184 :flag-assert #x3101100184 - (:methods - ) ) (deftype tomb-boss-door (com-airlock) @@ -46422,8 +46253,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype water-anim-tomb (water-anim) @@ -46431,8 +46260,6 @@ :method-count-assert 29 :size-assert #x100 :flag-assert #x1d00800100 - (:methods - ) ) (deftype tomb-wing-door (com-airlock) @@ -46440,8 +46267,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype tomb-boulder-door (process-drawable) @@ -46450,9 +46275,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (open () _type_ :state 20) - (close () _type_ :state 21) + (:state-methods + open + close ) ) @@ -46475,12 +46300,12 @@ :method-count-assert 39 :size-assert #x134 :flag-assert #x2700c00134 - (:methods - (hidden () _type_ :state 34) - (run-intro () _type_ :state 35) - (waiting () _type_ :state 36) - (running () _type_ :state 37) - (waiting-for-no-player () _type_ :state 38) + (:state-methods + hidden + run-intro + waiting + running + waiting-for-no-player ) ) @@ -46493,10 +46318,10 @@ :method-count-assert 23 :size-assert #xdc :flag-assert #x17006000dc - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (doors-open () _type_ :state 22) + (:state-methods + idle + active + doors-open ) ) @@ -46519,9 +46344,9 @@ :method-count-assert 22 :size-assert #xd0 :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (open (time-frame) _type_ :state 21) + (:state-methods + idle + (open time-frame) ) ) @@ -46536,9 +46361,9 @@ :method-count-assert 22 :size-assert #x128 :flag-assert #x1600b00128 - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) + (:state-methods + idle + open ) ) @@ -46547,8 +46372,6 @@ :method-count-assert 39 :size-assert #x120 :flag-assert #x2700a00120 - (:methods - ) ) (deftype tomb-beetle-button (tomb-button) @@ -46560,7 +46383,7 @@ :size-assert #x130 :flag-assert #x2800b00130 (:methods - (tomb-beetle-button-method-39 (_type_) none 39) + (tomb-beetle-button-method-39 (_type_) none) ;; 39 ) ) @@ -46592,15 +46415,17 @@ :method-count-assert 42 :size-assert #x164 :flag-assert #x2a00f00164 + (:state-methods + idle + ready + ridden + temporary + dangerous + wobble-die + die + ) (:methods - (idle () _type_ :state 34) - (ready () _type_ :state 35) - (ridden () _type_ :state 36) - (temporary () _type_ :state 37) - (dangerous () _type_ :state 38) - (wobble-die () _type_ :state 39) - (die () _type_ :state 40) - (set-blink-timers! (_type_) none 41) + (set-blink-timers! (_type_) none) ;; 41 ) ) @@ -46617,12 +46442,14 @@ :method-count-assert 25 :size-assert #xee :flag-assert #x19007000ee + (:state-methods + dormant + appear + show-sequence + idle + ) (:methods - (dormant () _type_ :state 20) - (appear () _type_ :state 21) - (show-sequence () _type_ :state 22) - (idle () _type_ :state 23) - (tomb-plat-simon-method-24 (_type_ int) none 24) + (tomb-plat-simon-method-24 (_type_ int) none) ;; 24 ) ) @@ -46636,12 +46463,12 @@ :flag-assert #x19006000d4 ;; field on-notice uses ~A with a signed load ;; field on-activate uses ~A with a signed load - (:methods - (idle () _type_ :state 20) - (open (symbol) _type_ :state 21) - (waiting () _type_ :state 22) - (pressed (symbol) _type_ :state 23) - (unpress () _type_ :state 24) + (:state-methods + idle + (open symbol) + waiting + (pressed symbol) + unpress ) ) @@ -46670,11 +46497,11 @@ :method-count-assert 24 :size-assert #x110 :flag-assert #x1800900110 - (:methods - (get-pattern () _type_ :state 20) - (idle () _type_ :state 21) - (vibrate () _type_ :state 22) - (die (symbol) _type_ :state 23) + (:state-methods + get-pattern + idle + vibrate + (die symbol) ) ) @@ -46694,12 +46521,14 @@ :method-count-assert 25 :size-assert #x148 :flag-assert #x1900d00148 + (:state-methods + idle + running + ) (:methods - (idle () _type_ :state 20) - (running () _type_ :state 21) - (tomb-water-trap-method-22 (_type_) none 22) - (tomb-water-trap-method-23 (_type_ vector vector) none 23) - (tomb-water-trap-method-24 (_type_ vector vector int) none 24) + (tomb-water-trap-method-22 (_type_) none) ;; 22 + (tomb-water-trap-method-23 (_type_ vector vector) none) ;; 23 + (tomb-water-trap-method-24 (_type_ vector vector int) none) ;; 24 ) ) @@ -46710,10 +46539,10 @@ :method-count-assert 23 :size-assert #xd8 :flag-assert #x17006000d8 - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) - (close () _type_ :state 22) + (:state-methods + idle + open + close ) ) @@ -46759,15 +46588,17 @@ :method-count-assert 186 :size-assert #x310 :flag-assert #xba02900310 + (:state-methods + tomb-beetle-state-178 + explode + fly-away + go-to-door + key + land + stand + ) (:methods - (tomb-beetle-method-178 (_type_) none 178) - (explode () _type_ :state 179) - (fly-away () _type_ :state 180) - (go-to-door () _type_ :state 181) - (key () _type_ :state 182) - (land () _type_ :state 183) - (stand () _type_ :state 184) - (tomb-beetle-method-185 (_type_) none 185) + (tomb-beetle-method-185 (_type_) none) ;; 185 ) ) @@ -46799,10 +46630,10 @@ :size-assert #x1c :flag-assert #xd0000001c (:methods - (widow-float-seeker-method-9 (_type_ float float float float float) none 9) - (widow-float-seeker-method-10 (_type_ (pointer float)) none 10) - (widow-float-seeker-method-11 (_type_ float) none 11) - (widow-float-seeker-method-12 (_type_ float) none 12) + (widow-float-seeker-method-9 (_type_ float float float float float) none) ;; 9 + (widow-float-seeker-method-10 (_type_ (pointer float)) none) ;; 10 + (widow-float-seeker-method-11 (_type_ float) none) ;; 11 + (widow-float-seeker-method-12 (_type_ float) none) ;; 12 ) ) @@ -46818,8 +46649,8 @@ :size-assert #x30 :flag-assert #xb00000030 (:methods - (init (_type_ int int float float) none 9) - (widow-rand-vector-method-10 (_type_) none 10) + (init (_type_ int int float float) none) ;; 9 + (widow-rand-vector-method-10 (_type_) none) ;; 10 ) ) @@ -46835,8 +46666,8 @@ :size-assert #x3c :flag-assert #xb0000003c (:methods - (widow-oscillator-method-9 (_type_ vector float float float) none 9) - (widow-oscillator-method-10 (_type_ vector) none 10) + (widow-oscillator-method-9 (_type_ vector float float float) none) ;; 9 + (widow-oscillator-method-10 (_type_ vector) none) ;; 10 ) ) @@ -46845,8 +46676,6 @@ :method-count-assert 40 :size-assert #x1f0 :flag-assert #x28017001f0 - (:methods - ) ) (deftype widow (process-drawable) @@ -46925,34 +46754,36 @@ :method-count-assert 47 :size-assert #x3f0 :flag-assert #x2f037003f0 - (:methods - (beaten () _type_ :state 20) - (kaboom () _type_ :state 21) - (hover-low-stage-3 () _type_ :state 22) - (hover-shooting-stage-3 () _type_ :state 23) - (hover-launch-bombs-stage-3 () _type_ :state 24) - (hover-big-blast-stage-3 () _type_ :state 25) - (hover-rise-stage-3 () _type_ :state 26) - (hover-jump-down-stage-3 () _type_ :state 27) - (big-reaction-stage-2 () _type_ :state 28) - (watch-bombs-stage-2 () _type_ :state 29) - (launch-bombs-stage-2 () _type_ :state 30) - (back-to-perch-stage-2 () _type_ :state 31) - (hover-low-stage-2 () _type_ :state 32) - (hover-shooting-stage-2 () _type_ :state 33) - (hover-rise-stage-2 () _type_ :state 34) - (hover-seek-under-stage-2 () _type_ :state 35) - (hover-jump-down-stage-2 () _type_ :state 36) - (launch-droids-stage-2 () _type_ :state 37) - (big-reaction-stage-1 () _type_ :state 38) - (watch-bombs-stage-1 () _type_ :state 39) - (launch-bombs-stage-1 () _type_ :state 40) - (watch-droids-stage-1 () _type_ :state 41) - (launch-droids-stage-1 () _type_ :state 42) - (hidden () _type_ :state 43) - (widow-method-44 (_type_ vector vector) symbol 44) - (widow-method-45 (_type_ vector vector vector) none 45) - (widow-method-46 (_type_ vector int) none 46) + (:state-methods + beaten + kaboom + hover-low-stage-3 + hover-shooting-stage-3 + hover-launch-bombs-stage-3 + hover-big-blast-stage-3 + hover-rise-stage-3 + hover-jump-down-stage-3 + big-reaction-stage-2 + watch-bombs-stage-2 + launch-bombs-stage-2 + back-to-perch-stage-2 + hover-low-stage-2 + hover-shooting-stage-2 + hover-rise-stage-2 + hover-seek-under-stage-2 + hover-jump-down-stage-2 + launch-droids-stage-2 + big-reaction-stage-1 + watch-bombs-stage-1 + launch-bombs-stage-1 + watch-droids-stage-1 + launch-droids-stage-1 + hidden + ) + (:methods + (widow-method-44 (_type_ vector vector) symbol) ;; 44 + (widow-method-45 (_type_ vector vector vector) none) ;; 45 + (widow-method-46 (_type_ vector int) none) ;; 46 ) ) @@ -46966,9 +46797,11 @@ :method-count-assert 22 :size-assert #xe8 :flag-assert #x16007000e8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (baron-pod-method-21 (_type_ symbol) none 21) + (baron-pod-method-21 (_type_ symbol) none) ;; 21 ) ) @@ -46977,8 +46810,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -47005,10 +46838,12 @@ :method-count-assert 23 :size-assert #xcc :flag-assert #x17005000cc + (:state-methods + shatter + idle + ) (:methods - (shatter () _type_ :state 20) - (idle () _type_ :state 21) - (tomb-boss-catwalk-method-22 (_type_ vector int) none 22) + (tomb-boss-catwalk-method-22 (_type_ vector int) none) ;; 22 ) ) @@ -47017,8 +46852,6 @@ :method-count-assert 23 :size-assert #xcc :flag-assert #x17005000cc - (:methods - ) ) (deftype widow-bomb (process-focusable) @@ -47043,15 +46876,17 @@ :method-count-assert 35 :size-assert #x1b8 :flag-assert #x23014001b8 + (:state-methods + freefall + back-atcha + explode + smoke + idle + ) (:methods - (freefall () _type_ :state 27) - (back-atcha () _type_ :state 28) - (explode () _type_ :state 29) - (smoke () _type_ :state 30) - (idle () _type_ :state 31) - (widow-bomb-method-32 (_type_) none 32) - (widow-bomb-method-33 (_type_) none 33) - (widow-bomb-method-34 (_type_) none 34) + (widow-bomb-method-32 (_type_) none) ;; 32 + (widow-bomb-method-33 (_type_) none) ;; 33 + (widow-bomb-method-34 (_type_) none) ;; 34 ) ) @@ -47061,8 +46896,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -47075,10 +46910,10 @@ :method-count-assert 23 :size-assert #xd8 :flag-assert #x17006000d8 - (:methods - (idle () _type_ :state 20) - (break-it () _type_ :state 21) - (broken () _type_ :state 22) + (:state-methods + idle + break-it + broken ) ) @@ -47088,10 +46923,10 @@ :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 - (:methods - (idle () _type_ :state 20) - (break-it () _type_ :state 21) - (broken () _type_ :state 22) + (:state-methods + idle + break-it + broken ) ) @@ -47120,9 +46955,9 @@ :method-count-assert 22 :size-assert #xf4 :flag-assert #x16008000f4 - (:methods - (die () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + die + idle ) ) @@ -47132,9 +46967,9 @@ :method-count-assert 22 :size-assert #x258 :flag-assert #x1601e00258 - (:methods - (idle () _type_ :state 20) - (wait () _type_ :state 21) + (:state-methods + idle + wait ) ) @@ -47178,10 +47013,10 @@ :method-count-assert 181 :size-assert #x25c :flag-assert #xb501e0025c - (:methods - (attack (vector) _type_ :state 178) - (attack-recover () _type_ :state 179) - (turn () _type_ :state 180) + (:state-methods + (attack vector) + attack-recover + turn ) ) @@ -47208,7 +47043,7 @@ :size-assert #x19c :flag-assert #x320120019c (:methods - (com-elevator-method-49 (_type_ symbol) none 49) + (com-elevator-method-49 (_type_ symbol) none) ;; 49 ) ) @@ -47219,8 +47054,6 @@ :method-count-assert 50 :size-assert #x1a0 :flag-assert #x32012001a0 - (:methods - ) ) @@ -47253,11 +47086,13 @@ :method-count-assert 24 :size-assert #x128 :flag-assert #x1800b00128 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (race-ring-method-22 (_type_) none 22) - (race-ring-method-23 (_type_) none 23) + (race-ring-method-22 (_type_) none) ;; 22 + (race-ring-method-23 (_type_) none) ;; 23 ) ) @@ -47281,11 +47116,13 @@ :method-count-assert 24 :size-assert #xd4 :flag-assert #x18006000d4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (bush-collect-method-22 (_type_) none 22) - (bush-collect-method-23 (_type_) none 23) + (bush-collect-method-22 (_type_) none) ;; 22 + (bush-collect-method-23 (_type_) none) ;; 23 ) ) @@ -47298,7 +47135,7 @@ :size-assert #x1c :flag-assert #xa0000001c (:methods - (burning-bush-collection-info-method-9 (_type_ object) none 9) + (burning-bush-collection-info-method-9 (_type_ object) none) ;; 9 ) ) @@ -47350,11 +47187,13 @@ :method-count-assert 24 :size-assert #xd4 :flag-assert #x18006000d4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (krew-package-method-22 (_type_) none 22) - (krew-package-method-23 (_type_) none 23) + (krew-package-method-22 (_type_) none) ;; 22 + (krew-package-method-23 (_type_) none) ;; 23 ) ) @@ -47405,11 +47244,13 @@ :method-count-assert 24 :size-assert #x120 :flag-assert #x1800a00120 + (:state-methods + idle + die + fall + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (fall () _type_ :state 22) - (ctyport-mine-method-23 (_type_) none 23) + (ctyport-mine-method-23 (_type_) none) ;; 23 ) ) @@ -47419,8 +47260,8 @@ :method-count-assert 21 :size-assert #xcc :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -47432,11 +47273,13 @@ :method-count-assert 31 :size-assert #xd8 :flag-assert #x1f006000d8 + (:state-methods + idle + focus-camera + die + ) (:methods - (idle () _type_ :state 27) - (focus-camera () _type_ :state 28) - (die () _type_ :state 29) - (ctyport-cargo-method-30 (_type_) none 30) + (ctyport-cargo-method-30 (_type_) none) ;; 30 ) ) @@ -47563,27 +47406,29 @@ :method-count-assert 33 :size-assert #x168 :flag-assert #x2100f00168 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) (init-dummy-collison! "Initializes the collision related stuff for the dummy" - (_type_) none 28) + (_type_) none) ;; 28 (path-playing? "Core functionality for playing back the dummy's path. Does things like: - calculates the score in case the dummy is hit based on the time elapsed - moves around the dummy - plays sounds accordingly @returns if the dummy's current path is still in progress" - (_type_) symbol 29) + (_type_) symbol) ;; 29 (path-time-elapsed "@returns Calculates the combined total time across all control frames in the path" - (_type_) float 30) + (_type_) float) ;; 30 (init-tpath-info! "Given a [[tpath-info]] use it to initialize the dummy with any relevant data or flags" - (_type_ tpath-info) none 31) + (_type_ tpath-info) none) ;; 31 (break-dummy "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (_type_) none 32) + (_type_) none) ;; 32 ) ) @@ -47687,8 +47532,8 @@ :method-count-assert 21 :size-assert #xcc :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -47730,26 +47575,28 @@ :method-count-assert 33 :size-assert #x314 :flag-assert #x2102a00314 - (:methods - (wait () _type_ :state 14) - (course () _type_ :state 15) - (end-course () _type_ :state 16) - (red-training-intro () _type_ :state 17) - (red-training () _type_ :state 18) - (red-yellow-training () _type_ :state 19) - (yellow-training-intro () _type_ :state 20) - (training-manager-method-21 (_type_ handle) entity 21) - (training-manager-method-22 (_type_ symbol) symbol 22) - (training-manager-method-23 (_type_ (array gungame-crate)) symbol 23) - (training-manager-method-24 (_type_) symbol 24) - (training-manager-method-25 (_type_) symbol 25) - (training-manager-method-26 (_type_) int 26) - (training-manager-method-27 (_type_ (array tpath-info)) symbol 27) - (training-manager-method-28 (_type_) none 28) - (training-manager-method-29 (_type_ vector) vector 29) - (render-text (_type_ text-id) float 30) - (training-manager-method-31 (_type_) none 31) - (training-manager-method-32 (_type_) none 32) + (:state-methods + wait + course + end-course + red-training-intro + red-training + red-yellow-training + yellow-training-intro + ) + (:methods + (training-manager-method-21 (_type_ handle) entity) ;; 21 + (training-manager-method-22 (_type_ symbol) symbol) ;; 22 + (training-manager-method-23 (_type_ (array gungame-crate)) symbol) ;; 23 + (training-manager-method-24 (_type_) symbol) ;; 24 + (training-manager-method-25 (_type_) symbol) ;; 25 + (training-manager-method-26 (_type_) int) ;; 26 + (training-manager-method-27 (_type_ (array tpath-info)) symbol) ;; 27 + (training-manager-method-28 (_type_) none) ;; 28 + (training-manager-method-29 (_type_ vector) vector) ;; 29 + (render-text (_type_ text-id) float) ;; 30 + (training-manager-method-31 (_type_) none) ;; 31 + (training-manager-method-32 (_type_) none) ;; 32 ) (:states yellow-training) @@ -47767,12 +47614,14 @@ :method-count-assert 25 :size-assert #xe4 :flag-assert #x19007000e4 + (:state-methods + idle + open + close + ) (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) - (close () _type_ :state 22) - (gungame-door-method-23 (_type_) symbol 23) - (gungame-door-method-24 (_type_) symbol 24) + (gungame-door-method-23 (_type_) symbol) ;; 23 + (gungame-door-method-24 (_type_) symbol) ;; 24 ) ) @@ -47799,8 +47648,6 @@ :method-count-assert 29 :size-assert #x100 :flag-assert #x1d00800100 - (:methods - ) ) (deftype mincan-lighthouse-lens (process-drawable) @@ -47808,9 +47655,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (erect () _type_ :state 21) + (:state-methods + idle + erect ) ) @@ -47819,9 +47666,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (erect () _type_ :state 21) + (:state-methods + idle + erect ) ) @@ -47830,9 +47677,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (closed () _type_ :state 20) - (open () _type_ :state 21) + (:state-methods + closed + open ) ) @@ -47841,8 +47688,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -47887,8 +47734,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (define-extern check-drop-level-vinroom-piss-drop-userdata (function sparticle-system sparticle-cpuinfo matrix none)) @@ -47907,9 +47752,9 @@ :method-count-assert 22 :size-assert #x100 :flag-assert #x1600800100 - (:methods - (idle () _type_ :state 20) - (dormant () _type_ :state 21) + (:state-methods + idle + dormant ) ) @@ -47918,8 +47763,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) @@ -47960,9 +47803,12 @@ :method-count-assert 22 :size-assert #x108 ;; 264 :flag-assert #x1600900108 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (city-neon-praxis-method-21 (_type_) none 21)) + (city-neon-praxis-method-21 (_type_) none) ;; 21 + ) ) (define-extern *praxis* (array object)) @@ -47991,8 +47837,6 @@ :method-count-assert 29 :size-assert #x100 :flag-assert #x1d00800100 - (:methods - ) ) (deftype palace-door (com-airlock) @@ -48000,8 +47844,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype ctypal-broke-wall (process-drawable) @@ -48010,9 +47852,9 @@ :method-count-assert 22 :size-assert #xcc :flag-assert #x16005000cc - (:methods - (idle () _type_ :state 20) - (done () _type_ :state 21) + (:state-methods + idle + done ) ) @@ -48021,8 +47863,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -48105,31 +47947,33 @@ :method-count-assert 51 :size-assert #x120 :flag-assert #x3300a00120 - (:methods - (waiting () _type_ :state 27) - (rise-up () _type_ :state 28) - (follow () _type_ :state 29) - (idle () _type_ :state 30) - (active () _type_ :state 31) - (flip () _type_ :state 32) - (rock () _type_ :state 33) - (sink-partially () _type_ :state 34) - (sunk-partially () _type_ :state 35) - (victory () _type_ :state 36) - (beaten () _type_ :state 37) - (fall () _type_ :state 38) - (explode () _type_ :state 39) - (die-fast () _type_ :state 40) - (under-block-method-41 (_type_ symbol) none 41) - (under-block-method-42 (_type_) none 42) - (under-block-method-43 (_type_ int int) symbol 43) - (under-block-method-44 (_type_) symbol 44) - (under-block-method-45 (_type_) none 45) - (under-block-method-46 (_type_ int int) none 46) - (under-block-method-47 (_type_ int int) int 47) - (under-block-method-48 (_type_ int int) symbol 48) - (under-block-method-49 (_type_ int int) symbol 49) - (under-block-method-50 (_type_) none 50) + (:state-methods + waiting + rise-up + follow + idle + active + flip + rock + sink-partially + sunk-partially + victory + beaten + fall + explode + die-fast + ) + (:methods + (under-block-method-41 (_type_ symbol) none) ;; 41 + (under-block-method-42 (_type_) none) ;; 42 + (under-block-method-43 (_type_ int int) symbol) ;; 43 + (under-block-method-44 (_type_) symbol) ;; 44 + (under-block-method-45 (_type_) none) ;; 45 + (under-block-method-46 (_type_ int int) none) ;; 46 + (under-block-method-47 (_type_ int int) int) ;; 47 + (under-block-method-48 (_type_ int int) symbol) ;; 48 + (under-block-method-49 (_type_ int int) symbol) ;; 49 + (under-block-method-50 (_type_) none) ;; 50 ) ) @@ -48141,16 +47985,18 @@ :method-count-assert 29 :size-assert #xd4 :flag-assert #x1d006000d4 + (:state-methods + idle + victory-locked + victory + beaten + ) (:methods - (idle () _type_ :state 20) - (victory-locked () _type_ :state 21) - (victory () _type_ :state 22) - (beaten () _type_ :state 23) - (under-shoot-block-method-24 (_type_ int int) none 24) - (under-shoot-block-method-25 (_type_ int int float int) none 25) - (under-shoot-block-method-26 (_type_) none 26) - (under-shoot-block-method-27 (_type_ symbol) none 27) - (under-shoot-block-method-28 (_type_) int 28) + (under-shoot-block-method-24 (_type_ int int) none) ;; 24 + (under-shoot-block-method-25 (_type_ int int float int) none) ;; 25 + (under-shoot-block-method-26 (_type_) none) ;; 26 + (under-shoot-block-method-27 (_type_ symbol) none) ;; 27 + (under-shoot-block-method-28 (_type_) int) ;; 28 ) ) @@ -48171,10 +48017,12 @@ :method-count-assert 23 :size-assert #xcc :flag-assert #x17005000cc + (:state-methods + idle + die-fast + ) (:methods - (idle () _type_ :state 20) - (die-fast () _type_ :state 21) - (under-warp-method-22 (_type_) none 22) + (under-warp-method-22 (_type_) none) ;; 22 ) ) @@ -48195,17 +48043,19 @@ :method-count-assert 24 :size-assert #xc8 :flag-assert #x18005000c8 + (:state-methods + idle + big-room-player-under + big-room-player-plat + underb-master-state-17 + big-room-player-above + big-room-player-falling + big-room-player-exiting + big-room-player-done + ) (:methods - (idle () _type_ :state 14) - (big-room-player-under () _type_ :state 15) - (big-room-player-plat () _type_ :state 16) - (underb-master-method-17 () none 17) ;; doesn't actually exist? - (big-room-player-above () _type_ :state 18) - (big-room-player-falling () _type_ :state 19) - (big-room-player-exiting () _type_ :state 20) - (big-room-player-done () _type_ :state 21) - (under-warp-check "Used to check whether the underwater warp effect should be drawn." (_type_) symbol 22) - (spawn-air-tank-hud "Spawns or hides the air tank HUD bar." (_type_ symbol) none 23) + (under-warp-check "Used to check whether the underwater warp effect should be drawn." (_type_) symbol) ;; 22 + (spawn-air-tank-hud "Spawns or hides the air tank HUD bar." (_type_ symbol) none) ;; 23 ) ) @@ -48234,11 +48084,11 @@ :method-count-assert 24 :size-assert #x108 :flag-assert #x1800900108 - (:methods - (startup () _type_ :state 20) - (active () _type_ :state 21) - (filling () _type_ :state 22) - (draining () _type_ :state 23) + (:state-methods + startup + active + filling + draining ) ) @@ -48247,8 +48097,6 @@ :method-count-assert 29 :size-assert #x100 :flag-assert #x1d00800100 - (:methods - ) ) (define-extern under-warp-init-by-other (function vector quaternion entity-actor none :behavior under-warp)) @@ -48273,9 +48121,9 @@ :method-count-assert 22 :size-assert #xd8 :flag-assert #x16006000d8 - (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) + (:state-methods + idle + hidden ) ) @@ -48293,13 +48141,13 @@ :method-count-assert 26 :size-assert #xf4 :flag-assert #x1a008000f4 - (:methods - (idle-up () _type_ :state 20) - (wait-up () _type_ :state 21) - (going-down () _type_ :state 22) - (idle-down () _type_ :state 23) - (wait-down () _type_ :state 24) - (going-up () _type_ :state 25) + (:state-methods + idle-up + wait-up + going-down + idle-down + wait-down + going-up ) ) @@ -48310,9 +48158,9 @@ :method-count-assert 22 :size-assert #xd0 :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (opened () _type_ :state 21) + (:state-methods + idle + opened ) ) @@ -48321,8 +48169,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -48335,9 +48183,9 @@ :method-count-assert 59 :size-assert #x1b4 :flag-assert #x3b014001b4 - (:methods - (waiting () _type_ :state 57) - (running () _type_ :state 58) + (:state-methods + waiting + running ) ) @@ -48346,8 +48194,6 @@ :method-count-assert 18 :size-assert #x570 :flag-assert #x1200000570 - (:methods - ) ) (deftype under-mine (process-drawable) @@ -48360,9 +48206,9 @@ :method-count-assert 22 :size-assert #xd8 :flag-assert #x16006000d8 - (:methods - (explode () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + explode + idle ) ) @@ -48373,7 +48219,7 @@ :size-assert #x174 :flag-assert #x3201000174 (:methods - (under-lift-method-49 (_type_ symbol) none 49) + (under-lift-method-49 (_type_ symbol) none) ;; 49 ) ) @@ -48385,9 +48231,9 @@ :method-count-assert 29 :size-assert #xd8 :flag-assert #x1d006000d8 - (:methods - (hit (symbol) _type_ :state 27) - (idle () _type_ :state 28) + (:state-methods + (hit symbol) + idle ) ) @@ -48396,8 +48242,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -48406,8 +48252,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -48416,8 +48262,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -48426,8 +48272,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -48461,9 +48307,9 @@ :size-assert #x190 :flag-assert #x2701100190 ;; field draw-test-script uses ~A with a signed load - (:methods - (die-falling () _type_ :state 37) - (dormant () _type_ :state 38) + (:state-methods + die-falling + dormant ) ) @@ -48473,10 +48319,10 @@ :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (die-fast () _type_ :state 22) + (:state-methods + idle + die + die-fast ) ) @@ -48485,9 +48331,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) @@ -48498,10 +48344,10 @@ :method-count-assert 23 :size-assert #xc9 :flag-assert #x17005000c9 - (:methods - (idle () _type_ :state 20) - (broken () _type_ :state 21) - (die () _type_ :state 22) + (:state-methods + idle + broken + die ) ) @@ -48510,10 +48356,10 @@ :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 - (:methods - (idle-closed () _type_ :state 20) - (open () _type_ :state 21) - (idle-open () _type_ :state 22) + (:state-methods + idle-closed + open + idle-open ) ) @@ -48525,8 +48371,8 @@ :method-count-assert 35 :size-assert #x160 :flag-assert #x2300e00160 - (:methods - (idle () _type_ :state 34) + (:state-methods + idle ) ) @@ -48540,8 +48386,8 @@ :method-count-assert 21 :size-assert #x108 :flag-assert #x1500900108 - (:methods - (active () _type_ :state 20) + (:state-methods + active ) ) @@ -48555,10 +48401,10 @@ :method-count-assert 23 :size-assert #xe0 :flag-assert #x17006000e0 - (:methods - (block-puzzle () _type_ :state 20) - (block-puzzle-fade () _type_ :state 21) - (intro-shooting () _type_ :state 22) + (:state-methods + block-puzzle + block-puzzle-fade + intro-shooting ) ) @@ -48592,8 +48438,8 @@ :method-count-assert 21 :size-assert #xe0 :flag-assert #x15006000e0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -48603,8 +48449,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -48624,10 +48470,12 @@ :size-assert #x150 :flag-assert #x1700d00150 ;; field draw-test-script uses ~A with a signed load + (:state-methods + dormant + idle + ) (:methods - (dormant () _type_ :state 20) - (idle () _type_ :state 21) - (under-laser-method-22 (_type_) none 22) + (under-laser-method-22 (_type_) none) ;; 22 ) ) @@ -48647,7 +48495,7 @@ :size-assert #x2e0 :flag-assert #xbb026002e0 (:methods - (pipe-grunt-method-186 (_type_) vector 186) + (pipe-grunt-method-186 (_type_) vector) ;; 186 ) ) @@ -48661,8 +48509,6 @@ :method-count-assert 16 :size-assert #x90 :flag-assert #x1000100090 - (:methods - ) ) (deftype jellyfish-chain-physics (chain-physics) @@ -48670,8 +48516,6 @@ :method-count-assert 18 :size-assert #x570 :flag-assert #x1200000570 - (:methods - ) ) (deftype jellyfish (hover-enemy) @@ -48701,16 +48545,18 @@ :method-count-assert 165 :size-assert #x494 :flag-assert #xa504200494 + (:state-methods + jellyfish-state-156 + threaten + charge-attack + grab-mech + die-now + ) (:methods - (jellyfish-method-156 () none 156) - (threaten () _type_ :state 157) - (charge-attack () _type_ :state 158) - (grab-mech () _type_ :state 159) - (die-now () _type_ :state 160) - (jellyfish-method-161 (_type_ vector float) vector 161) - (jellyfish-method-162 (_type_) symbol 162) - (jellyfish-method-163 (_type_ process-focusable) symbol 163) - (jellyfish-method-164 (_type_ process-focusable) symbol 164) + (jellyfish-method-161 (_type_ vector float) vector) ;; 161 + (jellyfish-method-162 (_type_) symbol) ;; 162 + (jellyfish-method-163 (_type_ process-focusable) symbol) ;; 163 + (jellyfish-method-164 (_type_ process-focusable) symbol) ;; 164 ) ) @@ -48785,18 +48631,20 @@ :method-count-assert 189 :size-assert #x3e0 :flag-assert #xbd036003e0 + (:state-methods + attack + attack-failed + hidden + grab-cam + thru-grating + ) (:methods - (attack () _type_ :state 178) - (attack-failed () _type_ :state 179) - (hidden () _type_ :state 180) - (grab-cam () _type_ :state 181) - (thru-grating () _type_ :state 182) - (centipede-method-183 (_type_) none 183) - (set-chan1-effects (_type_) none 184) - (target-close? "Is the target close enough to attack?" (_type_) symbol 185) - (centipede-method-186 (_type_) none 186) - (centipede-method-187 (_type_) none 187) - (centipede-method-188 (_type_) none 188) + (centipede-method-183 (_type_) none) ;; 183 + (set-chan1-effects (_type_) none) ;; 184 + (target-close? "Is the target close enough to attack?" (_type_) symbol) ;; 185 + (centipede-method-186 (_type_) none) ;; 186 + (centipede-method-187 (_type_) none) ;; 187 + (centipede-method-188 (_type_) none) ;; 188 ) ) @@ -48838,13 +48686,15 @@ :method-count-assert 265 :size-assert #x460 :flag-assert #x10903e00460 + (:state-methods + intro-shooting + ) (:methods - (intro-shooting () _type_ :state 259) - (sig-under-method-260 (_type_) symbol 260) - (sig-under-method-261 (_type_ vector vector symbol) symbol 261) - (sig-under-method-262 (_type_ symbol) symbol 262) - (sig-under-method-263 (_type_) none 263) - (sig-under-method-264 (_type_) symbol 264) + (sig-under-method-260 (_type_) symbol) ;; 260 + (sig-under-method-261 (_type_ vector vector symbol) symbol) ;; 261 + (sig-under-method-262 (_type_ symbol) symbol) ;; 262 + (sig-under-method-263 (_type_) none) ;; 263 + (sig-under-method-264 (_type_) symbol) ;; 264 ) ) @@ -48906,22 +48756,24 @@ :method-count-assert 29 :size-assert #xd0 :flag-assert #x1d005000d0 + (:state-methods + idle + recording + fail-full + finished + save + fail-save + ) (:methods - (idle () _type_ :state 14) - (recording () _type_ :state 15) - (fail-full () _type_ :state 16) - (finished () _type_ :state 17) - (save () _type_ :state 18) - (fail-save () _type_ :state 19) - (sig-recorder-method-20 (_type_ int) none 20) - (sig-recorder-method-21 (_type_ vector vector) symbol 21) - (sig-recorder-method-22 (_type_) none 22) - (sig-recorder-method-23 (_type_) none 23) - (sig-recorder-method-24 (_type_) none 24) - (sig-recorder-method-25 (_type_ sigrec-sample) none 25) - (sig-recorder-method-26 (_type_ sigrec-sample sigrec-sample sigrec-sample float time-frame) none 26) - (sig-recorder-method-27 (_type_) symbol 27) - (sig-recorder-method-28 (_type_) none 28) + (sig-recorder-method-20 (_type_ int) none) ;; 20 + (sig-recorder-method-21 (_type_ vector vector) symbol) ;; 21 + (sig-recorder-method-22 (_type_) none) ;; 22 + (sig-recorder-method-23 (_type_) none) ;; 23 + (sig-recorder-method-24 (_type_) none) ;; 24 + (sig-recorder-method-25 (_type_ sigrec-sample) none) ;; 25 + (sig-recorder-method-26 (_type_ sigrec-sample sigrec-sample sigrec-sample float time-frame) none) ;; 26 + (sig-recorder-method-27 (_type_) symbol) ;; 27 + (sig-recorder-method-28 (_type_) none) ;; 28 ) ) @@ -48955,9 +48807,12 @@ :method-count-assert 22 :size-assert #xfc :flag-assert #x16008000fc + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (hiphog-exterior-marquee-method-21 (_type_) none 21)) + (hiphog-exterior-marquee-method-21 (_type_) none) ;; 21 + ) ) (deftype farthy (process-drawable) @@ -48965,8 +48820,9 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) (define-extern check-drop-level-ctyport-drop-userdata (function sparticle-system sparticle-cpuinfo matrix none)) @@ -48988,7 +48844,7 @@ (configure-collision "Appropriately sets the collision on the elevator @param collide-with-jak? If set, the elevator will collide with Jak" - (_type_ symbol) none 49) + (_type_ symbol) none) ;; 49 ) ) @@ -49067,30 +48923,30 @@ :size-assert #x10 :flag-assert #x1500000010 (:methods - (set-default-density-speed-and-width (_type_) none 9) - (debug-print (_type_ object int) none 10) + (set-default-density-speed-and-width (_type_) none) ;; 9 + (debug-print (_type_ object int) none) ;; 10 (get-density "TODO @returns `density * 0.0078125` - is this some kind of trick?" - (_type_) float 11) + (_type_) float) ;; 11 (get-speed-limit "TODO @returns `speed-limit * 1024.0`" - (_type_) float 12) + (_type_) float) ;; 12 (get-width "TODO @returns `width * 256.0`" - (_type_) float 13) - (user-limit-reached? (_type_) symbol 14) + (_type_) float) ;; 13 + (user-limit-reached? (_type_) symbol) ;; 14 (dest-node-id-at-max? "@returns if `dest-node`'s `id` is equal to `#FFFF` @see [[nav-node]]" - (_type_) symbol 15) - (set-density (_type_ float) none 16) - (set-speed-limit (_type_ float) none 17) - (set-width (_type_ float) none 18) - (set-src-node (_type_ nav-node) none 19) - (set-dst-node (_type_ nav-node) none 20) + (_type_) symbol) ;; 15 + (set-density (_type_ float) none) ;; 16 + (set-speed-limit (_type_ float) none) ;; 17 + (set-width (_type_ float) none) ;; 18 + (set-src-node (_type_ nav-node) none) ;; 19 + (set-dst-node (_type_ nav-node) none) ;; 20 ) ) @@ -49126,29 +48982,29 @@ :size-assert #x20 :flag-assert #x1600000020 (:methods - (debug-draw (_type_) none 9) - (debug-print (_type_ symbol string) none 10) - (remove-branch-by-idx (_type_ int) none 11) - (init-from-pt-and-heading (_type_ vector vector) none 12) - (set-pos-xyz (_type_ vector) none 13) - (set-angle-from-heading (_type_ vector) none 14) - (set-id-and-link-branches-back (_type_ uint) none 15) - (set-radius (_type_ float) none 16) - (set-angle (_type_ float) none 17) + (debug-draw (_type_) none) ;; 9 + (debug-print (_type_ symbol string) none) ;; 10 + (remove-branch-by-idx (_type_ int) none) ;; 11 + (init-from-pt-and-heading (_type_ vector vector) none) ;; 12 + (set-pos-xyz (_type_ vector) none) ;; 13 + (set-angle-from-heading (_type_ vector) none) ;; 14 + (set-id-and-link-branches-back (_type_ uint) none) ;; 15 + (set-radius (_type_ float) none) ;; 16 + (set-angle (_type_ float) none) ;; 17 (get-position "@param! ret The [[vector]] that is modified to hold the result @returns the `position` [[vector]] with a `w` component of `1.0`" - (_type_ vector) vector 18) + (_type_ vector) vector) ;; 18 (calc-sine-and-cosine! "Computes the sine and cosine of the `angle`. @param! ret The result @returns Nothing, the result will be in `ret`" - (_type_ vector) vector 19) - (get-angle (_type_) float 20) + (_type_ vector) vector) ;; 19 + (get-angle (_type_) float) ;; 20 (get-radius "TODO @returns `radius * 1024.0" - (_type_) float 21) + (_type_) float) ;; 21 ) ) @@ -49183,48 +49039,48 @@ :size-assert #x3c :flag-assert #x2d0000003c (:methods - (new (symbol type int int int uint) _type_ 0) - (debug-draw-nodes (_type_) none 9) - (nav-graph-method-10 (_type_ vector int) none 10) - (nav-graph-method-11 (_type_) none 11) - (nav-graph-method-12 (_type_) none 12) - (nav-graph-method-13 (_type_ int int) none 13) - (nav-graph-method-14 (_type_ int int) none 14) - (debug-reset (_type_) none 15) - (debug-add-node (_type_ int) nav-node 16) - (debug-link-node-to-graph (_type_ nav-node) none 17) - (debug-reset-branch-array "kinda dangerous" (_type_ nav-node int) none 18) - (nav-graph-method-19 (_type_ int int int int int int) none 19) - (nav-graph-method-20 (_type_ int int) none 20) - (move-selected-to-height-map-height (_type_) none 21) - (select-nodes-in-range (_type_ int int) none 22) - (deselect-nodes-in-range (_type_ int int) none 23) - (toggle-select-nodes-in-range (_type_ int int) none 24) - (select-nodes-in-level (_type_ symbol symbol) none 25) - (select-nodes-by-nav-mesh-id (_type_ int symbol) none 26) - (select-nodes-by-flags (_type_ nav-node-flag-byte nav-node-flag-byte symbol) none 27) - (print-selected-nodes (_type_) none 28) - (assign-selected-nodes-to-level (_type_ symbol) none 29) - (assign-selected-nodes-to-nav-mesh (_type_ uint) none 30) - (set-radius-of-selected-nodes (_type_ float) none 31) - (set-speed-limit-of-selected (_type_ float) none 32) - (set-density-of-selected (_type_ float) none 33) - (set-width-of-selected (_type_ float) none 34) - (or-flags-of-selected-nodes (_type_ nav-node-flag-byte) none 35) - (and-flags-of-selected-nodes (_type_ nav-node-flag-byte) none 36) - (offset-pos-of-selected (_type_ vector) none 37) - (nav-graph-method-38 (_type_) none 38) - (nav-graph-method-39 (_type_) none 39) - (nav-graph-method-40 (_type_ int) int 40) + (new (symbol type int int int uint) _type_) ;; 0 + (debug-draw-nodes (_type_) none) ;; 9 + (nav-graph-method-10 (_type_ vector int) none) ;; 10 + (nav-graph-method-11 (_type_) none) ;; 11 + (nav-graph-method-12 (_type_) none) ;; 12 + (nav-graph-method-13 (_type_ int int) none) ;; 13 + (nav-graph-method-14 (_type_ int int) none) ;; 14 + (debug-reset (_type_) none) ;; 15 + (debug-add-node (_type_ int) nav-node) ;; 16 + (debug-link-node-to-graph (_type_ nav-node) none) ;; 17 + (debug-reset-branch-array "kinda dangerous" (_type_ nav-node int) none) ;; 18 + (nav-graph-method-19 (_type_ int int int int int int) none) ;; 19 + (nav-graph-method-20 (_type_ int int) none) ;; 20 + (move-selected-to-height-map-height (_type_) none) ;; 21 + (select-nodes-in-range (_type_ int int) none) ;; 22 + (deselect-nodes-in-range (_type_ int int) none) ;; 23 + (toggle-select-nodes-in-range (_type_ int int) none) ;; 24 + (select-nodes-in-level (_type_ symbol symbol) none) ;; 25 + (select-nodes-by-nav-mesh-id (_type_ int symbol) none) ;; 26 + (select-nodes-by-flags (_type_ nav-node-flag-byte nav-node-flag-byte symbol) none) ;; 27 + (print-selected-nodes (_type_) none) ;; 28 + (assign-selected-nodes-to-level (_type_ symbol) none) ;; 29 + (assign-selected-nodes-to-nav-mesh (_type_ uint) none) ;; 30 + (set-radius-of-selected-nodes (_type_ float) none) ;; 31 + (set-speed-limit-of-selected (_type_ float) none) ;; 32 + (set-density-of-selected (_type_ float) none) ;; 33 + (set-width-of-selected (_type_ float) none) ;; 34 + (or-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) ;; 35 + (and-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) ;; 36 + (offset-pos-of-selected (_type_ vector) none) ;; 37 + (nav-graph-method-38 (_type_) none) ;; 38 + (nav-graph-method-39 (_type_) none) ;; 39 + (nav-graph-method-40 (_type_ int) int) ;; 40 (node-at-idx "Get the `nav-node` at a given position. @param idx The position in the `node-array` to return @returns the [[nav-node]] if it can be found, otherwise return [[#f]]" - (_type_ int) nav-node 41) + (_type_ int) nav-node) ;; 41 (patch-nodes "Patch nodes. Node pointers are stored as indices into arrays to be allocated on the level heap - and patched at runtime after loading." (_type_) none 42) - (copy-to-mysql-graph (_type_ mysql-nav-graph string) none 43) - (from-editor (_type_ mysql-nav-graph symbol) none 44) + and patched at runtime after loading." (_type_) none) ;; 42 + (copy-to-mysql-graph (_type_ mysql-nav-graph string) none) ;; 43 + (from-editor (_type_ mysql-nav-graph symbol) none) ;; 44 ) ) @@ -49277,8 +49133,8 @@ :size-assert #x20 :flag-assert #xb00000020 (:methods - (reset-segment-counts (_type_) none 9) - (debug-draw (_type_) none 10) + (reset-segment-counts (_type_) none) ;; 9 + (debug-draw (_type_) none) ;; 10 ) ) @@ -49328,11 +49184,11 @@ :size-assert #x40 :flag-assert #xe00000040 (:methods - (setup-grid-from-bounding-box "Set up a grid which fills the given bounding box" (_type_ (pointer bounding-box) int int) none 9) - (lookup-cell-for-point "Get the grid cell containing the point (or closest, if outside the grid)" (_type_ vis-grid-pos vector) none 10) - (lookup-box-for-sphere "Get the box of cells containing the given sphere" (_type_ vis-grid-box vector) none 11) - (debug-draw-grid (_type_ rgba) none 12) - (debug-draw-cell (_type_ vis-grid-pos rgba) none 13) ;; vis-grid-pos is a total guess + (setup-grid-from-bounding-box "Set up a grid which fills the given bounding box" (_type_ (pointer bounding-box) int int) none) ;; 9 + (lookup-cell-for-point "Get the grid cell containing the point (or closest, if outside the grid)" (_type_ vis-grid-pos vector) none) ;; 10 + (lookup-box-for-sphere "Get the box of cells containing the given sphere" (_type_ vis-grid-box vector) none) ;; 11 + (debug-draw-grid (_type_ rgba) none) ;; 12 + (debug-draw-cell (_type_ vis-grid-pos rgba) none) ;; 13 ;; vis-grid-pos is a total guess ) ) @@ -49352,16 +49208,16 @@ :size-assert #x8c :flag-assert #x130000008c (:methods - (city-level-info-method-9 (_type_) symbol 9) - (init-vis-ray (_type_ vis-ray vector vector) none 10) - (city-level-info-method-11 (_type_ vis-ray) none 11) - (city-level-info-method-12 (_type_ vector nav-branch vector) vector 12) - (lookup-cell-by-position (_type_ vector) vis-cell 13) - (get-first-cell-in-box (_type_ vis-grid-box) vis-cell 14) - (sphere-in-grid? (_type_ vector int) symbol 15) - (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none 16) - (update-suppressions-from-traffic-engine (_type_ traffic-engine) none 17) - (city-level-info-method-18 (_type_) none 18) + (city-level-info-method-9 (_type_) symbol) ;; 9 + (init-vis-ray (_type_ vis-ray vector vector) none) ;; 10 + (city-level-info-method-11 (_type_ vis-ray) none) ;; 11 + (city-level-info-method-12 (_type_ vector nav-branch vector) vector) ;; 12 + (lookup-cell-by-position (_type_ vector) vis-cell) ;; 13 + (get-first-cell-in-box (_type_ vis-grid-box) vis-cell) ;; 14 + (sphere-in-grid? (_type_ vector int) symbol) ;; 15 + (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) ;; 16 + (update-suppressions-from-traffic-engine (_type_ traffic-engine) none) ;; 17 + (city-level-info-method-18 (_type_) none) ;; 18 ) ) @@ -49377,12 +49233,12 @@ :size-assert #x820 :flag-assert #xf00000820 (:methods - (reset (_type_) none 9) - (add-active-cell (_type_ vis-cell) none 10) - (remove-active-cell (_type_ int) none 11) - (add-newly-active-cell (_type_ vis-cell) none 12) - (per-frame-cell-update (_type_) none 13) - (debug-draw (_type_) none 14) + (reset (_type_) none) ;; 9 + (add-active-cell (_type_ vis-cell) none) ;; 10 + (remove-active-cell (_type_ int) none) ;; 11 + (add-newly-active-cell (_type_ vis-cell) none) ;; 12 + (per-frame-cell-update (_type_) none) ;; 13 + (debug-draw (_type_) none) ;; 14 ) ) @@ -49513,7 +49369,7 @@ :size-assert #x3d8 :flag-assert #xa000003d8 (:methods - (reset (_type_) none 9) + (reset (_type_) none) ;; 9 ) ) @@ -49571,12 +49427,12 @@ :size-assert #x230 :flag-assert #xe00000230 (:methods - (reset-boxes "Clears some flags, mark all boxes as disabled." (_type_) none 9) ;; clear flags 0, 1 on self and boxes. + (reset-boxes "Clears some flags, mark all boxes as disabled." (_type_) none) ;; 9 ;; clear flags 0, 1 on self and boxes. (add-new-supression-box "Create a suppression box for these params. - The param object is updated with the ID of the box and can be later used with update-box-from-params." (_type_ traffic-suppression-params) none 10) - (remove-box-by-id "Remove a box that was previously added, by its ID." (_type_ int) none 11) - (update-box-from-params "Update a box that was previously added" (_type_ traffic-suppression-params) none 12) - (debug-draw (_type_) none 13) + The param object is updated with the ID of the box and can be later used with update-box-from-params." (_type_ traffic-suppression-params) none) ;; 10 + (remove-box-by-id "Remove a box that was previously added, by its ID." (_type_ int) none) ;; 11 + (update-box-from-params "Update a box that was previously added" (_type_ traffic-suppression-params) none) ;; 12 + (debug-draw (_type_) none) ;; 13 ) ) @@ -49595,25 +49451,25 @@ :size-assert #x47e :flag-assert #x1b0000047e (:methods - (traffic-tracker-method-9 (_type_) none 9) - (traffic-tracker-method-10 (_type_) none 10) - (traffic-tracker-method-11 (_type_) none 11) - (add-active-process "Add a process as active." (_type_ traffic-type handle) none 12) - (remove-active-process "Remove a process from the tracking list." (_type_ int) handle 13) - (add-reserved-process "Add a process to the reserve list for a type. This process is allocated, but not yet activated." (_type_ traffic-type handle) none 14) - (get-from-inactive-by-type "Get any handle from the inactive list of this type, and remove it from the list." (_type_ traffic-type) handle 15) - (get-from-inactive-by-handle "Remove the given handle from the inactive list of the given type." (_type_ traffic-type handle) handle 16) + (traffic-tracker-method-9 (_type_) none) ;; 9 + (traffic-tracker-method-10 (_type_) none) ;; 10 + (traffic-tracker-method-11 (_type_) none) ;; 11 + (add-active-process "Add a process as active." (_type_ traffic-type handle) none) ;; 12 + (remove-active-process "Remove a process from the tracking list." (_type_ int) handle) ;; 13 + (add-reserved-process "Add a process to the reserve list for a type. This process is allocated, but not yet activated." (_type_ traffic-type handle) none) ;; 14 + (get-from-inactive-by-type "Get any handle from the inactive list of this type, and remove it from the list." (_type_ traffic-type) handle) ;; 15 + (get-from-inactive-by-handle "Remove the given handle from the inactive list of the given type." (_type_ traffic-type handle) handle) ;; 16 (deactivate-object "Send a traffic-off event (or traffic-off-force) to deactivate an object, specified by index in active object array. - Process is recycled and moved to reserved, if it deactivates." (_type_ int symbol) none 17) - (set-process-to-killed "Move from active to killed. Separate from reserve." (_type_ process) none 18) - (deactivate-all "Deactivate all processes that are tracked" (_type_ symbol) none 19) - (deactivate-all-of-type "Deactivate all processes of given type" (_type_ traffic-type symbol) none 20) - (activate-from-params "Get a reserved process, and activate with the given params." (_type_ traffic-object-spawn-params) none 21) - (activate-by-type "If possible, activate a process of the given type." (_type_ traffic-type nav-segment float) none 22) - (activate-by-handle "Activate, using the handle in the params." (_type_ traffic-object-spawn-params) none 23) - (reset (_type_ uint traffic-engine) none 24) - (for-all-active-processes "Call the given function on all active processes." (_type_ (function process-focusable traffic-object-type-info none)) none 25) - (for-all-active-processes-of-type "Call the given function on all active processes matching the given type." (_type_ traffic-type (function process-focusable traffic-object-type-info none)) none 26) + Process is recycled and moved to reserved, if it deactivates." (_type_ int symbol) none) ;; 17 + (set-process-to-killed "Move from active to killed. Separate from reserve." (_type_ process) none) ;; 18 + (deactivate-all "Deactivate all processes that are tracked" (_type_ symbol) none) ;; 19 + (deactivate-all-of-type "Deactivate all processes of given type" (_type_ traffic-type symbol) none) ;; 20 + (activate-from-params "Get a reserved process, and activate with the given params." (_type_ traffic-object-spawn-params) none) ;; 21 + (activate-by-type "If possible, activate a process of the given type." (_type_ traffic-type nav-segment float) none) ;; 22 + (activate-by-handle "Activate, using the handle in the params." (_type_ traffic-object-spawn-params) none) ;; 23 + (reset (_type_ uint traffic-engine) none) ;; 24 + (for-all-active-processes "Call the given function on all active processes." (_type_ (function process-focusable traffic-object-type-info none)) none) ;; 25 + (for-all-active-processes-of-type "Call the given function on all active processes matching the given type." (_type_ traffic-type (function process-focusable traffic-object-type-info none)) none) ;; 26 ) ) @@ -49646,72 +49502,72 @@ (:methods ;; NOTE - most of these names were taken from the symbols for the event-handler that calls them ;; they may be wrong or misleading as a result, but they are a decent placeholder _for now_ - (new (symbol type) _type_ 0) - (update-traffic (_type_) none 9) - (reset-and-init-from-manager "Reset the traffic engine" (_type_ process) none 10) - (stop-alarm-sound (_type_) none 11) - (debug-unused (_type_) none 12) - (add-object (_type_ traffic-type process) none 13) - (sphere-in-loaded-city-infos? (_type_ vector int) symbol 14) - (activate-one-citizen (_type_ nav-segment float) none 15) - (activate-one-vehicle (_type_ nav-segment float) none 16) - (can-dest-be-used? (_type_ nav-branch) symbol 17) - (child-killed "handle killing a child process" (_type_ process) none 18) - (deactivate-all-from-level (_type_ symbol) none 19) - (find-best-segment (_type_ vector vector int) nav-segment 20) - (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none 21) - (add-danger "Add a danger sphere and suppression box." (_type_ traffic-danger-info) none 22) - (guard-count (_type_) int 23) - (set-target-level (_type_ float) none 24) - (set-guard-target-level (_type_ float) none 25) - (deactivate-all (_type_) none 26) - (deactivate-by-type (_type_ traffic-type) none 27) - (maybe-increase-guard-aim-count (_type_) symbol 28) - (restore-default-settings (_type_) none 29) - (increase-alert-level (_type_ int target) none 30) - (decrease-alert-level (_type_ int) none 31) - (set-alert-level (_type_ int) none 32) - (set-max-alert-level (_type_ int) none 33) - (set-alert-duration (_type_ time-frame) none 34) - (get-alert-level (_type_) int 35) - (get-target "@returns [[*target*]]" (_type_) target 36) - (set-object-target-level (_type_ int float) none 37) - (set-object-target-count (_type_ int int) none 38) - (set-object-reserve-count (_type_ int uint) none 39) - (get-object-reserve-count (_type_ int) int 40) - (get-object-remaining-count (_type_ int) int 41) - (activate-object (_type_ traffic-object-spawn-params) none 42) - (activate-by-handle (_type_ traffic-object-spawn-params) none 43) - (set-parking-spot-prob (_type_ int float) none 44) - (get-random-parking-spot-type (_type_) traffic-type 45) - (new-suppression-box (_type_ traffic-suppression-params) none 46) - (remove-suppression-box (_type_ traffic-suppression-params) none 47) - (update-suppression-box (_type_ traffic-suppression-params) none 48) - (traffic-engine-method-49 (_type_ vector int traffic-target-status) traffic-target-status 49) - (find-closest-to-with-collide-lists "Iterate through collide lists, find the closest thing to the given process." (_type_ process-drawable collide-spec) process-focusable 50) - (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none 51) - (send-alert-events (_type_) none 52) - (end-pursuit-by-type (_type_ traffic-type) none 53) - (get-traffic-guard-type-settings "TODO - guard-type should be an enum" (_type_ int) traffic-guard-type-settings 54) - (get-guard-type-for-traffic-obj "TODO - guard-type should be an enum" (_type_ int) uint 55) - (get-traffic-guard-change-to-type "TODO - guard-type should be an enum" (_type_ int) uint 56) - (set-guard-target-count-range (_type_ int int int) none 57) - (set-object-auto-activate (_type_ int object) none 58) - (debug-check-proc-in-tracker (_type_ process int) none 59) - (kill-traffic-sphere "Kill everything in the sphere with a traffic-off-force." (_type_ sphere) none 60) - (level-link "Call after loading a level to patch the data in the bsp" (_type_ level) none 61) - (level-unlink "Call after removing a level. Kills processes and unlinks nav" (_type_ level) none 62) - (traffic-engine-method-63 (_type_) none 63) - (traffic-engine-method-64 (_type_) none 64) - (handle-new-vis-cell (_type_ vis-cell) none 65) - (update-sync-from-frame-counter (_type_) none 66) - (update-guards (_type_) none 67) - (update-traffic-amount "kills inactive traffic and spawns more if needed." (_type_) none 68) - (update-danger "see what's dangerous and make people avoid it." (_type_) none 69) - (update-danger-from-target "make people run away from jak when he is dangerous." (_type_) none 70) - (update-alert-state (_type_) none 71) - (update-suppressor (_type_) none 72) - (recompute-supressions (_type_) none 73) + (new (symbol type) _type_) ;; 0 + (update-traffic (_type_) none) ;; 9 + (reset-and-init-from-manager "Reset the traffic engine" (_type_ process) none) ;; 10 + (stop-alarm-sound (_type_) none) ;; 11 + (debug-unused (_type_) none) ;; 12 + (add-object (_type_ traffic-type process) none) ;; 13 + (sphere-in-loaded-city-infos? (_type_ vector int) symbol) ;; 14 + (activate-one-citizen (_type_ nav-segment float) none) ;; 15 + (activate-one-vehicle (_type_ nav-segment float) none) ;; 16 + (can-dest-be-used? (_type_ nav-branch) symbol) ;; 17 + (child-killed "handle killing a child process" (_type_ process) none) ;; 18 + (deactivate-all-from-level (_type_ symbol) none) ;; 19 + (find-best-segment (_type_ vector vector int) nav-segment) ;; 20 + (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) ;; 21 + (add-danger "Add a danger sphere and suppression box." (_type_ traffic-danger-info) none) ;; 22 + (guard-count (_type_) int) ;; 23 + (set-target-level (_type_ float) none) ;; 24 + (set-guard-target-level (_type_ float) none) ;; 25 + (deactivate-all (_type_) none) ;; 26 + (deactivate-by-type (_type_ traffic-type) none) ;; 27 + (maybe-increase-guard-aim-count (_type_) symbol) ;; 28 + (restore-default-settings (_type_) none) ;; 29 + (increase-alert-level (_type_ int target) none) ;; 30 + (decrease-alert-level (_type_ int) none) ;; 31 + (set-alert-level (_type_ int) none) ;; 32 + (set-max-alert-level (_type_ int) none) ;; 33 + (set-alert-duration (_type_ time-frame) none) ;; 34 + (get-alert-level (_type_) int) ;; 35 + (get-target "@returns [[*target*]]" (_type_) target) ;; 36 + (set-object-target-level (_type_ int float) none) ;; 37 + (set-object-target-count (_type_ int int) none) ;; 38 + (set-object-reserve-count (_type_ int uint) none) ;; 39 + (get-object-reserve-count (_type_ int) int) ;; 40 + (get-object-remaining-count (_type_ int) int) ;; 41 + (activate-object (_type_ traffic-object-spawn-params) none) ;; 42 + (activate-by-handle (_type_ traffic-object-spawn-params) none) ;; 43 + (set-parking-spot-prob (_type_ int float) none) ;; 44 + (get-random-parking-spot-type (_type_) traffic-type) ;; 45 + (new-suppression-box (_type_ traffic-suppression-params) none) ;; 46 + (remove-suppression-box (_type_ traffic-suppression-params) none) ;; 47 + (update-suppression-box (_type_ traffic-suppression-params) none) ;; 48 + (traffic-engine-method-49 (_type_ vector int traffic-target-status) traffic-target-status) ;; 49 + (find-closest-to-with-collide-lists "Iterate through collide lists, find the closest thing to the given process." (_type_ process-drawable collide-spec) process-focusable) ;; 50 + (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none) ;; 51 + (send-alert-events (_type_) none) ;; 52 + (end-pursuit-by-type (_type_ traffic-type) none) ;; 53 + (get-traffic-guard-type-settings "TODO - guard-type should be an enum" (_type_ int) traffic-guard-type-settings) ;; 54 + (get-guard-type-for-traffic-obj "TODO - guard-type should be an enum" (_type_ int) uint) ;; 55 + (get-traffic-guard-change-to-type "TODO - guard-type should be an enum" (_type_ int) uint) ;; 56 + (set-guard-target-count-range (_type_ int int int) none) ;; 57 + (set-object-auto-activate (_type_ int object) none) ;; 58 + (debug-check-proc-in-tracker (_type_ process int) none) ;; 59 + (kill-traffic-sphere "Kill everything in the sphere with a traffic-off-force." (_type_ sphere) none) ;; 60 + (level-link "Call after loading a level to patch the data in the bsp" (_type_ level) none) ;; 61 + (level-unlink "Call after removing a level. Kills processes and unlinks nav" (_type_ level) none) ;; 62 + (traffic-engine-method-63 (_type_) none) ;; 63 + (traffic-engine-method-64 (_type_) none) ;; 64 + (handle-new-vis-cell (_type_ vis-cell) none) ;; 65 + (update-sync-from-frame-counter (_type_) none) ;; 66 + (update-guards (_type_) none) ;; 67 + (update-traffic-amount "kills inactive traffic and spawns more if needed." (_type_) none) ;; 68 + (update-danger "see what's dangerous and make people avoid it." (_type_) none) ;; 69 + (update-danger-from-target "make people run away from jak when he is dangerous." (_type_) none) ;; 70 + (update-alert-state (_type_) none) ;; 71 + (update-suppressor (_type_) none) ;; 72 + (recompute-supressions (_type_) none) ;; 73 ) ) @@ -49903,8 +49759,8 @@ :size-assert #x60c :flag-assert #xb0000060c (:methods - (rigid-body-vehicle-constants-method-9 (_type_) none 9) - (rigid-body-vehicle-constants-method-10 () none 10) + (rigid-body-vehicle-constants-method-9 (_type_) none) ;; 9 + (rigid-body-vehicle-constants-method-10 (_type_) none) ;; 10 ) ) @@ -49950,19 +49806,19 @@ :size-assert #x90 :flag-assert #x1600000090 (:methods - (vehicle-controller-method-9 (_type_) none 9) ;; (init! (_type_ vehicle-path (pointer float) (pointer float) int float) none 9) - (vehicle-controller-method-10 (_type_ traffic-tracker) none 10) ;; (TODO-RENAME-10 (_type_ vector float int) none 10) - (vehicle-controller-method-11 (_type_) none 11) ;; (dummy-11 (_type_) none 11) - (vehicle-controller-method-12 (_type_ rigid-body-vehicle-constants vector float int float) none :behavior vehicle 12) ;; (TODO-RENAME-12 (_type_ int vector) none 12) - (vehicle-controller-method-13 (_type_ nav-branch vector) none 13) ;; (move-to-next-point (_type_ vector) none 13) - (vehicle-controller-method-14 (_type_ vehicle) nav-branch 14) ;; (TODO-RENAME-14 (_type_ vector vector) none 14) - (vehicle-controller-method-15 (_type_) nav-branch 15) ;; (dummy-15 (_type_ collide-shape-moving) none 15) - (vehicle-controller-method-16 (_type_ vector vector) none 16) ;; (dummy-16 (_type_) none 16) - (draw-debug-info (_type_) none 17) - (vehicle-controller-method-18 (_type_ vector vector vehicle float) none 18) - (vehicle-controller-method-19 (_type_ vector object vector vector) none 19) - (vehicle-controller-method-20 (_type_ object float) none 20) - (vehicle-controller-method-21 (_type_) none 21) + (vehicle-controller-method-9 (_type_) none) ;; 9 ;; (init! (_type_ vehicle-path (pointer float) (pointer float) int float) none) ;; 9 + (vehicle-controller-method-10 (_type_ traffic-tracker) none) ;; 10 ;; (TODO-RENAME-10 (_type_ vector float int) none) ;; 10 + (vehicle-controller-method-11 (_type_) none) ;; 11 ;; (dummy-11 (_type_) none) ;; 11 + (vehicle-controller-method-12 (_type_ rigid-body-vehicle-constants vector float int float) none :behavior vehicle) ;; 12 ;; (TODO-RENAME-12 (_type_ int vector) none) ;; 12 + (vehicle-controller-method-13 (_type_ nav-branch vector) none) ;; 13 ;; (move-to-next-point (_type_ vector) none) ;; 13 + (vehicle-controller-method-14 (_type_ vehicle) nav-branch) ;; 14 ;; (TODO-RENAME-14 (_type_ vector vector) none) ;; 14 + (vehicle-controller-method-15 (_type_) nav-branch) ;; 15 ;; (dummy-15 (_type_ collide-shape-moving) none) ;; 15 + (vehicle-controller-method-16 (_type_ vector vector) none) ;; 16 ;; (dummy-16 (_type_) none) ;; 16 + (draw-debug-info (_type_) none) ;; 17 + (vehicle-controller-method-18 (_type_ vector vector vehicle float) none) ;; 18 + (vehicle-controller-method-19 (_type_ vector object vector vector) none) ;; 19 + (vehicle-controller-method-20 (_type_ object float) none) ;; 20 + (vehicle-controller-method-21 (_type_) none) ;; 21 ) ) @@ -50068,99 +49924,101 @@ :method-count-assert 144 :size-assert #x370 :flag-assert #x9002f00370 - (:methods - (alloc-and-init-rigid-body-control (_type_ rigid-body-vehicle-constants) none :replace 31) - (inactive () _type_ :state 53) - (waiting () _type_ :state 54) - (vehicle-method-55 () _type_ :state 55) - (vehicle-method-56 () _type_ :state 56) - (player-control () _type_ :state 57) - (crash () _type_ :state 58) - (explode () _type_ :state 59) - (die () _type_ :state 60) - (measure-control-parameters () _type_ :state 61) - (vehicle-method-62 (_type_ float) none 62) - (vehicle-method-63 (_type_ float) none 63) - (vehicle-method-64 () none 64) - (start-jump (_type_) none 65) - (vehicle-method-66 (_type_) none 66) - (get-seat-count (_type_) int 67) - (compute-seat-position (_type_ vector int) none 68) - (get-rider-in-seat (_type_ int) process 69) - (vehicle-method-70 (_type_) process 70) - (put-rider-in-seat (_type_ int process-focusable) none 71) - (vehicle-method-72 (_type_) uint 72) - (get-best-seat-for-vehicle (_type_ vector int int) int 73) - (remove-rider (_type_ process) none 74) - (vehicle-method-75 (_type_) float 75) - (vehicle-method-76 (_type_ int uint) none 76) - (vehicle-method-77 (_type_) none 77) - (vehicle-method-78 (_type_ int) none 78) - (vehicle-method-79 (_type_) none 79) - (vehicle-method-80 (_type_) none 80) - (vehicle-method-81 (_type_) none 81) - (vehicle-method-82 (_type_) none 82) - (vehicle-method-83 (_type_) none 83) - (draw-thruster (_type_ vector vector float float) none 84) - (draw-thrusters (_type_) none 85) - (update-joint-mods (_type_) none 86) - (vehicle-method-87 (_type_) none 87) - (vehicle-method-88 (_type_) none 88) - (vehicle-method-89 (_type_) none 89) - (vehicle-method-90 (_type_) none 90) - (vehicle-method-91 (_type_) none 91) - (vehicle-method-92 (_type_) none 92) - (vehicle-method-93 (_type_) none 93) - (vehicle-method-94 (_type_) none 94) - (vehicle-method-95 (_type_ vector) none 95) - (vehicle-method-96 (_type_) none 96) - (vehicle-method-97 (_type_) none 97) - (vehicle-method-98 (_type_ float) none 98) - (vehicle-method-99 (_type_ float) none 99) - (vehicle-method-100 (_type_ float vehicle-physics-work) none 100) - (vehicle-method-101 (_type_) none 101) - (vehicle-method-102 (_type_) none 102) - (vehicle-method-103 (_type_) none 103) - (vehicle-method-104 (_type_) none 104) - (vehicle-method-105 (_type_) symbol 105) - (vehicle-method-106 (_type_) none 106) - (vehicle-method-107 (_type_) none 107) - (vehicle-method-108 (_type_) none 108) - (vehicle-method-109 (_type_) none 109) - (vehicle-method-110 (_type_) none 110) - (vehicle-method-111 (_type_ object target) none 111) - (decrease-traffic-alert-level (_type_ int) int 112) - (vehicle-method-113 (_type_) none 113) - (vehicle-method-114 (_type_) none 114) - (vehicle-method-115 (_type_ vector) none 115) - (vehicle-method-116 (_type_ (pointer vehicle-controls)) none 116) - (vehicle-method-117 (_type_ vector int int) none 117) - (vehicle-method-118 (_type_ int) none 118) - (vehicle-method-119 (_type_) none 119) - (vehicle-method-120 (_type_) none 120) - (vehicle-method-121 (_type_) none 121) - (vehicle-method-122 (_type_) none 122) - (vehicle-method-123 (_type_) none 123) - (vehicle-method-124 (_type_) none 124) - (vehicle-method-125 (_type_ float) none 125) - (vehicle-method-126 (_type_ float) none 126) - (vehicle-method-127 (_type_) none 127) - (vehicle-method-128 (_type_) none 128) - (vehicle-method-129 (_type_) none 129) - (vehicle-method-130 (_type_ traffic-object-spawn-params) none 130) - (vehicle-method-131 (_type_) none 131) - (vehicle-method-132 (_type_) none 132) - (check-player-get-on (_type_) none 133) - (vehicle-method-134 "Stubbed" (_type_ process) none 134) - (vehicle-method-135 (_type_ traffic-object-spawn-params) none 135) - (vehicle-method-136 (_type_ traffic-object-spawn-params) none 136) - (vehicle-method-137 (_type_ traffic-object-spawn-params) none 137) - (vehicle-method-138 (_type_) none 138) - (vehicle-method-139 (_type_) none 139) - (vehicle-method-140 (_type_) none 140) - (vehicle-method-141 (_type_) none 141) - (vehicle-method-142 (_type_) none 142) - (vehicle-method-143 (_type_) none 143) + (:state-methods + inactive + waiting + vehicle-state-55 + vehicle-state-56 + player-control + crash + explode + die + measure-control-parameters + ) + (:methods + (alloc-and-init-rigid-body-control (_type_ rigid-body-vehicle-constants) none :replace) ;; 31 + (vehicle-method-62 (_type_ float) none) ;; 62 + (vehicle-method-63 (_type_ float) none) ;; 63 + (vehicle-method-64 () none) ;; 64 + (start-jump (_type_) none) ;; 65 + (vehicle-method-66 (_type_) none) ;; 66 + (get-seat-count (_type_) int) ;; 67 + (compute-seat-position (_type_ vector int) none) ;; 68 + (get-rider-in-seat (_type_ int) process) ;; 69 + (vehicle-method-70 (_type_) process) ;; 70 + (put-rider-in-seat (_type_ int process-focusable) none) ;; 71 + (vehicle-method-72 (_type_) uint) ;; 72 + (get-best-seat-for-vehicle (_type_ vector int int) int) ;; 73 + (remove-rider (_type_ process) none) ;; 74 + (vehicle-method-75 (_type_) float) ;; 75 + (vehicle-method-76 (_type_ int uint) none) ;; 76 + (vehicle-method-77 (_type_) none) ;; 77 + (vehicle-method-78 (_type_ int) none) ;; 78 + (vehicle-method-79 (_type_) none) ;; 79 + (vehicle-method-80 (_type_) none) ;; 80 + (vehicle-method-81 (_type_) none) ;; 81 + (vehicle-method-82 (_type_) none) ;; 82 + (vehicle-method-83 (_type_) none) ;; 83 + (draw-thruster (_type_ vector vector float float) none) ;; 84 + (draw-thrusters (_type_) none) ;; 85 + (update-joint-mods (_type_) none) ;; 86 + (vehicle-method-87 (_type_) none) ;; 87 + (vehicle-method-88 (_type_) none) ;; 88 + (vehicle-method-89 (_type_) none) ;; 89 + (vehicle-method-90 (_type_) none) ;; 90 + (vehicle-method-91 (_type_) none) ;; 91 + (vehicle-method-92 (_type_) none) ;; 92 + (vehicle-method-93 (_type_) none) ;; 93 + (vehicle-method-94 (_type_) none) ;; 94 + (vehicle-method-95 (_type_ vector) none) ;; 95 + (vehicle-method-96 (_type_) none) ;; 96 + (vehicle-method-97 (_type_) none) ;; 97 + (vehicle-method-98 (_type_ float) none) ;; 98 + (vehicle-method-99 (_type_ float) none) ;; 99 + (vehicle-method-100 (_type_ float vehicle-physics-work) none) ;; 100 + (vehicle-method-101 (_type_) none) ;; 101 + (vehicle-method-102 (_type_) none) ;; 102 + (vehicle-method-103 (_type_) none) ;; 103 + (vehicle-method-104 (_type_) none) ;; 104 + (vehicle-method-105 (_type_) symbol) ;; 105 + (vehicle-method-106 (_type_) none) ;; 106 + (vehicle-method-107 (_type_) none) ;; 107 + (vehicle-method-108 (_type_) none) ;; 108 + (vehicle-method-109 (_type_) none) ;; 109 + (vehicle-method-110 (_type_) none) ;; 110 + (vehicle-method-111 (_type_ object target) none) ;; 111 + (decrease-traffic-alert-level (_type_ int) int) ;; 112 + (vehicle-method-113 (_type_) none) ;; 113 + (vehicle-method-114 (_type_) none) ;; 114 + (vehicle-method-115 (_type_ vector) none) ;; 115 + (vehicle-method-116 (_type_ (pointer vehicle-controls)) none) ;; 116 + (vehicle-method-117 (_type_ vector int int) none) ;; 117 + (vehicle-method-118 (_type_ int) none) ;; 118 + (vehicle-method-119 (_type_) none) ;; 119 + (vehicle-method-120 (_type_) none) ;; 120 + (vehicle-method-121 (_type_) none) ;; 121 + (vehicle-method-122 (_type_) none) ;; 122 + (vehicle-method-123 (_type_) none) ;; 123 + (vehicle-method-124 (_type_) none) ;; 124 + (vehicle-method-125 (_type_ float) none) ;; 125 + (vehicle-method-126 (_type_ float) none) ;; 126 + (vehicle-method-127 (_type_) none) ;; 127 + (vehicle-method-128 (_type_) none) ;; 128 + (vehicle-method-129 (_type_) none) ;; 129 + (vehicle-method-130 (_type_ traffic-object-spawn-params) none) ;; 130 + (vehicle-method-131 (_type_) none) ;; 131 + (vehicle-method-132 (_type_) none) ;; 132 + (check-player-get-on (_type_) none) ;; 133 + (vehicle-method-134 "Stubbed" (_type_ process) none) ;; 134 + (vehicle-method-135 (_type_ traffic-object-spawn-params) none) ;; 135 + (vehicle-method-136 (_type_ traffic-object-spawn-params) none) ;; 136 + (vehicle-method-137 (_type_ traffic-object-spawn-params) none) ;; 137 + (vehicle-method-138 (_type_) none) ;; 138 + (vehicle-method-139 (_type_) none) ;; 139 + (vehicle-method-140 (_type_) none) ;; 140 + (vehicle-method-141 (_type_) none) ;; 141 + (vehicle-method-142 (_type_) none) ;; 142 + (vehicle-method-143 (_type_) none) ;; 143 ) ) @@ -50223,30 +50081,32 @@ :method-count-assert 201 :size-assert #x3c4 :flag-assert #xc9035003c4 + (:state-methods + wait + inactive + in-ditch + ) (:methods - (wait () _type_ :state 178) - (inactive () _type_ :state 179) - (in-ditch () _type_ :state 180) - (citizen-init! "Initialize [[citizen]] defaults." (_type_) none 181) - (citizen-nav-init! "Initialize nav related fields." (_type_) none 182) - (go-inactive (_type_) none 183) - (find-segment (_type_ vector vector) nav-segment 184) - (nav-segment-callback (_type_ vector traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none 185) - (citizen-method-186 (_type_ nav-segment) none 186) - (citizen-method-187 (_type_) symbol 187) - (citizen-method-188 (_type_ vector) none 188) - (calc-danger-vec (_type_ vector vector) none 189) - (citizen-method-190 (_type_ vector) none 190) - (gen-clear-path (_type_) nav-segment 191) - (citizen-method-192 (_type_) none 192) - (throw-off-vehicle (_type_) none 193) - (gen-new-dir (_type_ vector float) nav-segment 194) - (citizen-method-195 (_type_ vector) symbol 195) - (get-run-anim (_type_) int 196) - (trigger-alert (_type_ int target) none 197) - (decrease-alert (_type_ object) none 198) - (set-behavior! (_type_ traffic-object-spawn-params) none 199) - (citizen-method-200 (_type_) none 200) + (citizen-init! "Initialize [[citizen]] defaults." (_type_) none) ;; 181 + (citizen-nav-init! "Initialize nav related fields." (_type_) none) ;; 182 + (go-inactive (_type_) none) ;; 183 + (find-segment (_type_ vector vector) nav-segment) ;; 184 + (nav-segment-callback (_type_ vector traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) ;; 185 + (citizen-method-186 (_type_ nav-segment) none) ;; 186 + (citizen-method-187 (_type_) symbol) ;; 187 + (citizen-method-188 (_type_ vector) none) ;; 188 + (calc-danger-vec (_type_ vector vector) none) ;; 189 + (citizen-method-190 (_type_ vector) none) ;; 190 + (gen-clear-path (_type_) nav-segment) ;; 191 + (citizen-method-192 (_type_) none) ;; 192 + (throw-off-vehicle (_type_) none) ;; 193 + (gen-new-dir (_type_ vector float) nav-segment) ;; 194 + (citizen-method-195 (_type_ vector) symbol) ;; 195 + (get-run-anim (_type_) int) ;; 196 + (trigger-alert (_type_ int target) none) ;; 197 + (decrease-alert (_type_ object) none) ;; 198 + (set-behavior! (_type_ traffic-object-spawn-params) none) ;; 199 + (citizen-method-200 (_type_) none) ;; 200 ) ) @@ -50275,12 +50135,12 @@ :size-assert #x20 :flag-assert #xf00000020 (:methods - (get-height-at-point (_type_ vector) float 9) - (debug-draw-mesh (_type_ vector) none 10) - (debug-print (_type_) none 11) - (debug-draw-at-point (_type_ vector) none 12) - (debug-draw (_type_ vector) none 13) - (debug-add-offset "Add an offset to the given point, likely for debugging purposes." (_type_ vector int) none 14) + (get-height-at-point (_type_ vector) float) ;; 9 + (debug-draw-mesh (_type_ vector) none) ;; 10 + (debug-print (_type_) none) ;; 11 + (debug-draw-at-point (_type_ vector) none) ;; 12 + (debug-draw (_type_ vector) none) ;; 13 + (debug-add-offset "Add an offset to the given point, likely for debugging purposes." (_type_ vector int) none) ;; 14 ) ) @@ -50304,7 +50164,7 @@ :size-assert #x18 :flag-assert #xa00000018 (:methods - (city-race-ring-info-method-9 (_type_ symbol) none 9) + (city-race-ring-info-method-9 (_type_ symbol) none) ;; 9 ) ) @@ -50325,7 +50185,7 @@ :size-assert #x8 :flag-assert #xa00000008 (:methods - (city-ambush-info-method-9 (_type_ traffic-object-spawn-params) none 9) + (city-ambush-info-method-9 (_type_ traffic-object-spawn-params) none) ;; 9 ) ) @@ -50363,16 +50223,18 @@ :method-count-assert 36 :size-assert #xdd :flag-assert #x24006000dd + (:state-methods + inactive + active + taunt + got-passed + ) (:methods - (inactive () _type_ :state 27) - (active () _type_ :state 28) - (taunt () _type_ :state 29) - (got-passed () _type_ :state 30) - (initialize-collision (_type_) none 31) - (vehicle-rider-method-32 (_type_ traffic-object-spawn-params) none 32) - (vehicle-rider-method-33 (_type_) none 33) - (vehicle-rider-method-34 (_type_) none 34) - (vehicle-rider-method-35 (_type_) none 35) + (initialize-collision (_type_) none) ;; 31 + (vehicle-rider-method-32 (_type_ traffic-object-spawn-params) none) ;; 32 + (vehicle-rider-method-33 (_type_) none) ;; 33 + (vehicle-rider-method-34 (_type_) none) ;; 34 + (vehicle-rider-method-35 (_type_) none) ;; 35 ) ) @@ -50381,8 +50243,6 @@ :method-count-assert 36 :size-assert #xdd :flag-assert #x24006000dd - (:methods - ) ) (deftype crimson-guard-rider (vehicle-rider) @@ -50390,8 +50250,6 @@ :method-count-assert 36 :size-assert #xdd :flag-assert #x24006000dd - (:methods - ) ) (define-extern vehicle-rider-event-handler (function process int symbol event-message-block object :behavior vehicle-rider)) @@ -50475,9 +50333,9 @@ :size-assert #x48 :flag-assert #xc00000048 (:methods - (vehicle-hud-requests-method-9 (_type_) none 9) - (vehicle-hud-requests-method-10 (_type_) vehicle-hud-request 10) - (vehicle-hud-requests-method-11 (_type_) vehicle-hud-request 11) + (vehicle-hud-requests-method-9 (_type_) none) ;; 9 + (vehicle-hud-requests-method-10 (_type_) vehicle-hud-request) ;; 10 + (vehicle-hud-requests-method-11 (_type_) vehicle-hud-request) ;; 11 ) ) @@ -50489,7 +50347,7 @@ :size-assert #x90 :flag-assert #xa00000090 (:methods - (vehicle-hud-chooser-method-9 (_type_ handle float) symbol 9) + (vehicle-hud-chooser-method-9 (_type_ handle float) symbol) ;; 9 ) ) @@ -50650,15 +50508,15 @@ :size-assert #x50 :flag-assert #x1200000050 (:methods - (turret-control-method-9 (_type_ vehicle vector vector) none 9) - (turret-control-method-10 (_type_ vehicle) none 10) - (turret-control-method-11 (_type_ object object vector) none 11) - (update-joint-mod (_type_ joint-mod-rotate-local) none 12) - (turret-control-method-13 (_type_) none 13) - (turret-control-method-14 (_type_) none 14) - (set-info (_type_ turret-control-info) none 15) - (turret-control-method-16 (_type_ float float) none 16) - (turret-control-method-17 (_type_ vehicle) none 17) + (turret-control-method-9 (_type_ vehicle vector vector) none) ;; 9 + (turret-control-method-10 (_type_ vehicle) none) ;; 10 + (turret-control-method-11 (_type_ object object vector) none) ;; 11 + (update-joint-mod (_type_ joint-mod-rotate-local) none) ;; 12 + (turret-control-method-13 (_type_) none) ;; 13 + (turret-control-method-14 (_type_) none) ;; 14 + (set-info (_type_ turret-control-info) none) ;; 15 + (turret-control-method-16 (_type_ float float) none) ;; 16 + (turret-control-method-17 (_type_ vehicle) none) ;; 17 ) ) @@ -50698,22 +50556,24 @@ :method-count-assert 159 :size-assert #x434 :flag-assert #x9f03c00434 + (:state-methods + hostile + stop-and-shoot + slow-pursuit + vehicle-guard-state-147 + vehicle-guard-state-148 + waiting-ambush + ) (:methods - (hostile () _type_ :state 144) - (stop-and-shoot () _type_ :state 145) - (slow-pursuit () _type_ :state 146) - (vehicle-guard-method-147 () none 147) - (vehicle-guard-method-148 () none 148) - (waiting-ambush () _type_ :state 149) - (vehicle-guard-method-150 (_type_) none 150) - (vehicle-guard-method-151 (_type_ vehicle-guard-target-data) none 151) - (vehicle-guard-method-152 (_type_ vehicle-guard-target-data) none 152) - (vehicle-guard-method-153 (_type_ target) none 153) - (vehicle-guard-method-154 (_type_) none 154) - (vehicle-guard-method-155 (_type_ vector vector) none 155) - (vehicle-guard-method-156 (_type_) none 156) - (vehicle-guard-method-157 (_type_ vehicle-guard-target-data) symbol 157) - (vehicle-guard-method-158 (_type_) none 158) + (vehicle-guard-method-150 (_type_) none) ;; 150 + (vehicle-guard-method-151 (_type_ vehicle-guard-target-data) none) ;; 151 + (vehicle-guard-method-152 (_type_ vehicle-guard-target-data) none) ;; 152 + (vehicle-guard-method-153 (_type_ target) none) ;; 153 + (vehicle-guard-method-154 (_type_) none) ;; 154 + (vehicle-guard-method-155 (_type_ vector vector) none) ;; 155 + (vehicle-guard-method-156 (_type_) none) ;; 156 + (vehicle-guard-method-157 (_type_ vehicle-guard-target-data) symbol) ;; 157 + (vehicle-guard-method-158 (_type_) none) ;; 158 ) ) @@ -50735,11 +50595,13 @@ :method-count-assert 31 :size-assert #x128 :flag-assert #x1f00b00128 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (vehicle-turret-method-28 (_type_) none 28) - (vehicle-turret-method-29 (_type_) none 29) - (vehicle-turret-method-30 (_type_) none 30) + (vehicle-turret-method-28 (_type_) none) ;; 28 + (vehicle-turret-method-29 (_type_) none) ;; 29 + (vehicle-turret-method-30 (_type_) none) ;; 30 ) ) @@ -50773,16 +50635,18 @@ :method-count-assert 36 :size-assert #x108 :flag-assert #x2400900108 + (:state-methods + come-down + idle + leave + die-fast + ) (:methods - (come-down () _type_ :state 27) - (idle () _type_ :state 28) - (leave () _type_ :state 29) - (die-fast () _type_ :state 30) - (transport-method-31 (_type_) none 31) - (transport-method-32 (_type_) none 32) - (transport-method-33 (_type_) none 33) - (transport-method-34 (_type_ process) none 34) - (transport-method-35 (_type_) none 35) + (transport-method-31 (_type_) none) ;; 31 + (transport-method-32 (_type_) none) ;; 32 + (transport-method-33 (_type_) none) ;; 33 + (transport-method-34 (_type_ process) none) ;; 34 + (transport-method-35 (_type_) none) ;; 35 ) ) @@ -50906,7 +50770,7 @@ :size-assert #xaa :flag-assert #xa000000aa (:methods - (initialize-mesh (_type_) none 9) + (initialize-mesh (_type_) none) ;; 9 ) ) @@ -50936,11 +50800,11 @@ :size-assert #x70 :flag-assert #xe00000070 (:methods - (update-lap-distance (_type_ race-state) none 9) - (begin-lap (_type_ race-state) none 10) - (end-lap (_type_ race-state) none 11) - (print-laps (_type_ race-state string) none 12) - (init-racer! (_type_ process-drawable) none 13) + (update-lap-distance (_type_ race-state) none) ;; 9 + (begin-lap (_type_ race-state) none) ;; 10 + (end-lap (_type_ race-state) none) ;; 11 + (print-laps (_type_ race-state string) none) ;; 12 + (init-racer! (_type_ process-drawable) none) ;; 13 ) ) @@ -50986,16 +50850,16 @@ :size-assert #x510 :flag-assert #x1300000510 (:methods - (init-racers! (_type_ process-drawable) none 9) - (begin-race (_type_) none 10) - (update (_type_) none 11) - (update-rankings (_type_) none 12) - (debug-print-rankings (_type_) none 13) - (update-racers (_type_) none 14) - (spawn-race-signal (_type_) none 15) - (initialize (_type_ process race-info) none 16) - (set-speech-tables! (_type_) none 17) - (setup-race (_type_) none 18) + (init-racers! (_type_ process-drawable) none) ;; 9 + (begin-race (_type_) none) ;; 10 + (update (_type_) none) ;; 11 + (update-rankings (_type_) none) ;; 12 + (debug-print-rankings (_type_) none) ;; 13 + (update-racers (_type_) none) ;; 14 + (spawn-race-signal (_type_) none) ;; 15 + (initialize (_type_ process race-info) none) ;; 16 + (set-speech-tables! (_type_) none) ;; 17 + (setup-race (_type_) none) ;; 18 ) ) @@ -51009,21 +50873,23 @@ :method-count-assert 28 :size-assert #xa0 :flag-assert #x1c002000a0 + (:state-methods + idle + active + fail + win + lose + die + ) (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (fail () _type_ :state 16) - (win () _type_ :state 17) - (lose () _type_ :state 18) - (die () _type_ :state 19) - (update (_type_) int 20) - (initialize-state (_type_) none 21) - (race-manager-method-22 (_type_) none 22) - (initialize-race-state (_type_) none 23) - (draw-message-continue (_type_) none 24) - (draw-message-retry (_type_) none 25) - (save-score (_type_ float) none 26) - (stop-speech (_type_) none 27) + (update (_type_) int) ;; 20 + (initialize-state (_type_) none) ;; 21 + (race-manager-method-22 (_type_) none) ;; 22 + (initialize-race-state (_type_) none) ;; 23 + (draw-message-continue (_type_) none) ;; 24 + (draw-message-retry (_type_) none) ;; 25 + (save-score (_type_ float) none) ;; 26 + (stop-speech (_type_) none) ;; 27 ) ) @@ -51113,10 +50979,10 @@ :size-assert #xc :flag-assert #xd0000000c (:methods - (draw-path-debug (_type_ rgba rgba) none 9) - (race-path-method-10 (_type_ vector float float) none 10) - (race-path-method-11 (_type_ race-path-sample vector float) none 11) - (race-path-method-12 (_type_ vector float float) float 12) + (draw-path-debug (_type_ rgba rgba) none) ;; 9 + (race-path-method-10 (_type_ vector float float) none) ;; 10 + (race-path-method-11 (_type_ race-path-sample vector float) none) ;; 11 + (race-path-method-12 (_type_ vector float float) float) ;; 12 ) ) @@ -51191,17 +51057,17 @@ :size-assert #x1c :flag-assert #x140000001c (:methods - (debug-draw-path (_type_ int int rgba rgba) none 9) - (debug-draw-path-from-history (_type_ int int) symbol 10) - (debug-draw-slice (_type_ int) none 11) - (debug-draw-edges (_type_) none 12) - (race-mesh-method-13 (_type_ race-mesh-slice-query) none 13) - (race-mesh-method-14 (_type_ race-mesh-slice-query) none 14) - (race-mesh-method-15 (_type_ int race-mesh-slice-query) none 15) - (race-mesh-method-16 (_type_ race-mesh-slice-query) none 16) - (race-mesh-method-17 (_type_ race-mesh-slice-query) symbol 17) - (race-mesh-method-18 (_type_ race-mesh-hash-search int int race-mesh-slice-query) none 18) - (race-mesh-method-19 (_type_ int race-mesh-slice-query) symbol 19) + (debug-draw-path (_type_ int int rgba rgba) none) ;; 9 + (debug-draw-path-from-history (_type_ int int) symbol) ;; 10 + (debug-draw-slice (_type_ int) none) ;; 11 + (debug-draw-edges (_type_) none) ;; 12 + (race-mesh-method-13 (_type_ race-mesh-slice-query) none) ;; 13 + (race-mesh-method-14 (_type_ race-mesh-slice-query) none) ;; 14 + (race-mesh-method-15 (_type_ int race-mesh-slice-query) none) ;; 15 + (race-mesh-method-16 (_type_ race-mesh-slice-query) none) ;; 16 + (race-mesh-method-17 (_type_ race-mesh-slice-query) symbol) ;; 17 + (race-mesh-method-18 (_type_ race-mesh-hash-search int int race-mesh-slice-query) none) ;; 18 + (race-mesh-method-19 (_type_ int race-mesh-slice-query) symbol) ;; 19 ) ) @@ -51219,8 +51085,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -51236,17 +51102,19 @@ :method-count-assert 30 :size-assert #x140 :flag-assert #x1e00c00140 + (:state-methods + spawn-banner + idle + count-3 + count-2 + count-1 + count-go + die + test + ) (:methods - (spawn-banner () _type_ :state 20) - (idle () _type_ :state 21) - (count-3 () _type_ :state 22) - (count-2 () _type_ :state 23) - (count-1 () _type_ :state 24) - (count-go () _type_ :state 25) - (die () _type_ :state 26) - (test () _type_ :state 27) - (race-signal-method-28 (_type_) none 28) - (race-signal-method-29 (_type_) none 29) + (race-signal-method-28 (_type_) none) ;; 28 + (race-signal-method-29 (_type_) none) ;; 29 ) ) @@ -51256,8 +51124,6 @@ :method-count-assert 36 :size-assert #xde :flag-assert #x24006000de - (:methods - ) ) (deftype errol-rider (stadium-racer) @@ -51265,8 +51131,6 @@ :method-count-assert 36 :size-assert #xde :flag-assert #x24006000de - (:methods - ) ) (deftype turbo-pickup (process-drawable) @@ -51276,10 +51140,12 @@ :method-count-assert 23 :size-assert #xcc :flag-assert #x17005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (find-ground (_type_) symbol 22) + (find-ground (_type_) symbol) ;; 22 ) ) @@ -51311,10 +51177,10 @@ :size-assert #x60 :flag-assert #xd00000060 (:methods - (race-control-method-9 (_type_ int vector) none 9) - (race-control-method-10 (_type_ race-state racer-state) none 10) - (race-control-method-11 (_type_ float) none 11) - (race-control-method-12 (_type_ vector) none 12) + (race-control-method-9 (_type_ int vector) none) ;; 9 + (race-control-method-10 (_type_ race-state racer-state) none) ;; 10 + (race-control-method-11 (_type_ float) none) ;; 11 + (race-control-method-12 (_type_ vector) none) ;; 12 ) ) @@ -51331,19 +51197,21 @@ :method-count-assert 156 :size-assert #x3f8 :flag-assert #x9c038003f8 + (:state-methods + waiting-race + waiting-for-start + racing + race-finished + ) (:methods - (waiting-race () _type_ :state 144) - (waiting-for-start () _type_ :state 145) - (racing () _type_ :state 146) - (race-finished () _type_ :state 147) - (vehicle-racer-method-148 (_type_ race-path race-mesh-slice) none 148) - (vehicle-racer-method-149 (_type_) none 149) - (select-path-randomly-from-mask (_type_ uint) none 150) - (vehicle-racer-method-151 (_type_) none 151) - (vehicle-racer-method-152 (_type_) none 152) - (physics-post (_type_) none 153) - (vehicle-racer-method-154 (_type_) none 154) - (vehicle-racer-method-155 (_type_) none 155) + (vehicle-racer-method-148 (_type_ race-path race-mesh-slice) none) ;; 148 + (vehicle-racer-method-149 (_type_) none) ;; 149 + (select-path-randomly-from-mask (_type_ uint) none) ;; 150 + (vehicle-racer-method-151 (_type_) none) ;; 151 + (vehicle-racer-method-152 (_type_) none) ;; 152 + (physics-post (_type_) none) ;; 153 + (vehicle-racer-method-154 (_type_) none) ;; 154 + (vehicle-racer-method-155 (_type_) none) ;; 155 ) ) @@ -51423,24 +51291,26 @@ :method-count-assert 31 :size-assert #x100 :flag-assert #x1f00800100 + (:state-methods + die-fast + idle + active + recording + fail-full + finished + save + fail-save + ) (:methods - (die-fast () _type_ :state 14) - (idle () _type_ :state 15) - (active () _type_ :state 16) - (recording () _type_ :state 17) - (fail-full () _type_ :state 18) - (finished () _type_ :state 19) - (save () _type_ :state 20) - (fail-save () _type_ :state 21) - (pilot-recorder-method-22 () none 22) - (pilot-recorder-method-23 () none 23) - (pilot-recorder-method-24 () none 24) - (pilot-recorder-method-25 () none 25) - (pilot-recorder-method-26 () none 26) - (pilot-recorder-method-27 () none 27) - (pilot-recorder-method-28 () none 28) - (pilot-recorder-method-29 () none 29) - (pilot-recorder-method-30 () none 30) + (pilot-recorder-method-22 () none) ;; 22 + (pilot-recorder-method-23 () none) ;; 23 + (pilot-recorder-method-24 () none) ;; 24 + (pilot-recorder-method-25 () none) ;; 25 + (pilot-recorder-method-26 () none) ;; 26 + (pilot-recorder-method-27 () none) ;; 27 + (pilot-recorder-method-28 () none) ;; 28 + (pilot-recorder-method-29 () none) ;; 29 + (pilot-recorder-method-30 () none) ;; 30 ) ) @@ -51462,10 +51332,12 @@ :method-count-assert 23 :size-assert #xd0 :flag-assert #x17005000d0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (stdmb-race-hatch-method-21 (_type_) none 21) - (stdmb-race-hatch-method-22 (_type_) none 22) + (stdmb-race-hatch-method-21 (_type_) none) ;; 21 + (stdmb-race-hatch-method-22 (_type_) none) ;; 22 ) ) @@ -51474,8 +51346,6 @@ :method-count-assert 23 :size-assert #xd0 :flag-assert #x17005000d0 - (:methods - ) ) (define-extern stdmb-race-hatch-init-by-other (function vector quaternion none :behavior stdmb-race-hatch)) @@ -51489,8 +51359,6 @@ :method-count-assert 144 :size-assert #x370 :flag-assert #x9002f00370 - (:methods - ) ) (deftype bikea (bike-base) @@ -51505,8 +51373,6 @@ :method-count-assert 144 :size-assert #x38c :flag-assert #x900310038c - (:methods - ) ) (deftype bikeb (bike-base) @@ -51522,8 +51388,6 @@ :method-count-assert 144 :size-assert #x390 :flag-assert #x9003100390 - (:methods - ) ) (deftype bikec (bike-base) @@ -51542,8 +51406,6 @@ :method-count-assert 144 :size-assert #x39c :flag-assert #x900320039c - (:methods - ) ) (deftype guard-bike (vehicle-guard) @@ -51552,8 +51414,6 @@ :method-count-assert 159 :size-assert #x438 :flag-assert #x9f03c00438 - (:methods - ) ) (define-extern *bike-explosion-info* vehicle-explosion-info) @@ -51573,8 +51433,6 @@ :method-count-assert 144 :size-assert #x372 :flag-assert #x9003000372 - (:methods - ) ) (deftype cara (car-base) @@ -51591,8 +51449,6 @@ :method-count-assert 144 :size-assert #x398 :flag-assert #x9003200398 - (:methods - ) ) (deftype carb (car-base) @@ -51606,8 +51462,6 @@ :method-count-assert 144 :size-assert #x38c :flag-assert #x900310038c - (:methods - ) ) (deftype carc (car-base) @@ -51622,8 +51476,6 @@ :method-count-assert 144 :size-assert #x390 :flag-assert #x9003100390 - (:methods - ) ) (deftype hellcat (vehicle-guard) @@ -51632,8 +51484,6 @@ :method-count-assert 159 :size-assert #x438 :flag-assert #x9f03c00438 - (:methods - ) ) (define-extern *car-explosion-info* vehicle-explosion-info) @@ -51653,8 +51503,6 @@ :method-count-assert 159 :size-assert #x43c :flag-assert #x9f03c0043c - (:methods - ) ) (define-extern *helldog-constants* rigid-body-vehicle-constants) @@ -51670,8 +51518,6 @@ :method-count-assert 144 :size-assert #x39c :flag-assert #x900320039c - (:methods - ) ) (deftype evan-test-bike (bikea) @@ -51679,8 +51525,6 @@ :method-count-assert 144 :size-assert #x38c :flag-assert #x900310038c - (:methods - ) ) (define-extern *test-bike-constants* rigid-body-vehicle-constants) @@ -51695,8 +51539,6 @@ :method-count-assert 144 :size-assert #x398 :flag-assert #x9003200398 - (:methods - ) ) (define-extern *test-car-constants* rigid-body-vehicle-constants) @@ -51791,24 +51633,26 @@ :method-count-assert 218 :size-assert #x424 :flag-assert #xda03b00424 + (:state-methods + avoid-danger + clear-path + on-ground + dive + get-up-front + get-up-back + cower-ground + wait-for-ride + move-to-vehicle + board-vehicle + ride + exit-vehicle + wait-at-dest + ) (:methods - (avoid-danger () _type_ :state 201) - (clear-path () _type_ :state 202) - (on-ground () _type_ :state 203) - (dive () _type_ :state 204) - (get-up-front () _type_ :state 205) - (get-up-back () _type_ :state 206) - (cower-ground () _type_ :state 207) - (wait-for-ride () _type_ :state 208) - (move-to-vehicle () _type_ :state 209) - (board-vehicle () _type_ :state 210) - (ride () _type_ :state 211) - (exit-vehicle () _type_ :state 212) - (wait-at-dest () _type_ :state 213) - (civilian-method-214 (_type_ nav-branch int vector float) float 214) - (civilian-method-215 (_type_ vector) none 215) - (go-dive (_type_) none 216) - (civilian-method-217 (_type_ vector) symbol 217) + (civilian-method-214 (_type_ nav-branch int vector float) float) ;; 214 + (civilian-method-215 (_type_ vector) none) ;; 215 + (go-dive (_type_) none) ;; 216 + (civilian-method-217 (_type_ vector) symbol) ;; 217 ) ) @@ -51862,10 +51706,10 @@ :method-count-assert 221 :size-assert #x474 :flag-assert #xdd04000474 - (:methods - (go-at-end () _type_ :state 218) - (go-at-pipe () _type_ :state 219) - (wait-at-end () _type_ :state 220) + (:state-methods + go-at-end + go-at-pipe + wait-at-end ) ) @@ -52006,33 +51850,35 @@ :method-count-assert 227 :size-assert #x568 ;; 1384 :flag-assert #xe304f00568 - (:methods - (get-up-front () _type_ :state 201) - (get-up-back () _type_ :state 202) - (search () _type_ :state 203) - (attack () _type_ :state 204) - (arrest () _type_ :state 205) - (gun-shoot () _type_ :state 206) - (exit-transport () _type_ :state 207) - (waiting-ambush () _type_ :state 208) - (close-attack () _type_ :state 209) - (knocked-off-vehicle () _type_ :state 210) - (roll-right () _type_ :state 211) - (roll-left () _type_ :state 212) - (close-attack-active () _type_ :state 213) - (crimson-guard-method-214 (_type_) none 214) - (crimson-guard-method-215 (_type_) symbol 215) - (crimson-guard-method-216 (_type_) symbol 216) - (crimson-guard-method-217 (_type_ vector vector vector) int 217) - (crimson-guard-method-218 (_type_ vector) none 218) - (crimson-guard-method-219 (_type_) none 219) - (crimson-guard-method-220 (_type_) none 220) - (crimson-guard-method-221 (_type_) none 221) - (crimson-guard-method-222 (_type_) none 222) - (crimson-guard-method-223 (_type_ float) none 223) - (crimson-guard-method-224 (_type_ vector) float 224) - (crimson-guard-method-225 (_type_ uint symbol) none 225) - (crimson-guard-method-226 (_type_) none 226) + (:state-methods + get-up-front + get-up-back + search + attack + arrest + gun-shoot + exit-transport + waiting-ambush + close-attack + knocked-off-vehicle + roll-right + roll-left + close-attack-active + ) + (:methods + (crimson-guard-method-214 (_type_) none) ;; 214 + (crimson-guard-method-215 (_type_) symbol) ;; 215 + (crimson-guard-method-216 (_type_) symbol) ;; 216 + (crimson-guard-method-217 (_type_ vector vector vector) int) ;; 217 + (crimson-guard-method-218 (_type_ vector) none) ;; 218 + (crimson-guard-method-219 (_type_) none) ;; 219 + (crimson-guard-method-220 (_type_) none) ;; 220 + (crimson-guard-method-221 (_type_) none) ;; 221 + (crimson-guard-method-222 (_type_) none) ;; 222 + (crimson-guard-method-223 (_type_ float) none) ;; 223 + (crimson-guard-method-224 (_type_ vector) float) ;; 224 + (crimson-guard-method-225 (_type_ uint symbol) none) ;; 225 + (crimson-guard-method-226 (_type_) none) ;; 226 ) ) @@ -52051,8 +51897,8 @@ :method-count-assert 219 :size-assert #x424 :flag-assert #xdb03b00424 - (:methods - (knocked-off-vehicle () _type_ :state 218) + (:state-methods + knocked-off-vehicle ) ) @@ -52068,8 +51914,6 @@ :method-count-assert 218 :size-assert #x424 :flag-assert #xda03b00424 - (:methods - ) ) (define-extern *citizen-fat-global-info* civilian-global-info) @@ -52084,8 +51928,6 @@ :method-count-assert 218 :size-assert #x424 :flag-assert #xda03b00424 - (:methods - ) ) (define-extern *citizen-chick-global-info* civilian-global-info) @@ -52103,8 +51945,8 @@ :size-assert #x3d4 :flag-assert #xcb036003d4 (:methods - (traffic-danger-init! (_type_) none 201) - (citizen-enemy-method-202 (_type_) none 202) + (traffic-danger-init! (_type_) none) ;; 201 + (citizen-enemy-method-202 (_type_) none) ;; 202 ) ) @@ -52125,8 +51967,6 @@ :method-count-assert 219 :size-assert #x448 :flag-assert #xdb03d00448 - (:methods - ) ) (deftype city-shuttle-info (structure) @@ -52179,13 +52019,15 @@ :method-count-assert 209 :size-assert #x4e0 ;; 1248 :flag-assert #xd1046004e0 + (:state-methods + fire + close-attack + ) (:methods - (fire () _type_ :state 203) - (close-attack () _type_ :state 204) - (metalhead-predator-method-205 (_type_ symbol) none 205) - (metalhead-predator-method-206 (_type_ int float) none 206) - (metalhead-predator-method-207 (_type_ vector vector vector) symbol 207) - (metalhead-predator-method-208 (_type_) none 208) + (metalhead-predator-method-205 (_type_ symbol) none) ;; 205 + (metalhead-predator-method-206 (_type_ int float) none) ;; 206 + (metalhead-predator-method-207 (_type_ vector vector vector) symbol) ;; 207 + (metalhead-predator-method-208 (_type_) none) ;; 208 ) ) @@ -52216,16 +52058,18 @@ :method-count-assert 212 :size-assert #x430 :flag-assert #xd403b00430 + (:state-methods + attack + falling-ambush + jumping-ambush + jumping-ambush-cont + wait-for-focus + spin-attack + ) (:methods - (attack () _type_ :state 203) - (falling-ambush () _type_ :state 204) - (jumping-ambush () _type_ :state 205) - (jumping-ambush-cont () _type_ :state 206) - (wait-for-focus () _type_ :state 207) - (spin-attack () _type_ :state 208) - (metalhead-grunt-method-209 (_type_ float) process-focusable 209) - (get-nav-info (_type_) nav-enemy-info 210) - (metalhead-grunt-method-211 (_type_) none 211) + (metalhead-grunt-method-209 (_type_ float) process-focusable) ;; 209 + (get-nav-info (_type_) nav-enemy-info) ;; 210 + (metalhead-grunt-method-211 (_type_) none) ;; 211 ) ) @@ -52250,14 +52094,16 @@ :method-count-assert 210 :size-assert #x434 :flag-assert #xd203c00434 + (:state-methods + attack + ambush-jumping + ) (:methods - (attack () _type_ :state 203) - (ambush-jumping () _type_ :state 204) - (metalhead-flitter-method-205 (_type_) none 205) - (metalhead-flitter-method-206 (_type_) none 206) - (metalhead-flitter-method-207 (_type_ process-focusable) symbol 207) - (metalhead-flitter-method-208 (_type_ symbol) none 208) - (metalhead-flitter-method-209 (_type_) float 209) + (metalhead-flitter-method-205 (_type_) none) ;; 205 + (metalhead-flitter-method-206 (_type_) none) ;; 206 + (metalhead-flitter-method-207 (_type_ process-focusable) symbol) ;; 207 + (metalhead-flitter-method-208 (_type_ symbol) none) ;; 208 + (metalhead-flitter-method-209 (_type_) float) ;; 209 ) ) @@ -52335,15 +52181,17 @@ :method-count-assert 22 :size-assert #xf8 :flag-assert #x16008000f8 + (:state-methods + idle + active + ) (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (update (_type_) none 16) - (spawn-all (_type_) none 17) - (kill-excess-once (_type_) none 18) - (kill-all-inactive (_type_) none 19) - (reset-and-init (_type_) none 20) - (init-params (_type_) none 21) + (update (_type_) none) ;; 16 + (spawn-all (_type_) none) ;; 17 + (kill-excess-once (_type_) none) ;; 18 + (kill-all-inactive (_type_) none) ;; 19 + (reset-and-init (_type_) none) ;; 20 + (init-params (_type_) none) ;; 21 ) ) @@ -52387,8 +52235,6 @@ :method-count-assert 36 :size-assert #xe4 :flag-assert #x24007000e4 - (:methods - ) ) (deftype vehicle-city-racer (vehicle-racer) @@ -52396,8 +52242,6 @@ :method-count-assert 156 :size-assert #x3f8 :flag-assert #x9c038003f8 - (:methods - ) ) (deftype race-bike-a (vehicle-city-racer) @@ -52405,8 +52249,6 @@ :method-count-assert 156 :size-assert #x3f8 :flag-assert #x9c038003f8 - (:methods - ) ) (deftype race-bike-b (vehicle-city-racer) @@ -52414,8 +52256,6 @@ :method-count-assert 156 :size-assert #x3f8 :flag-assert #x9c038003f8 - (:methods - ) ) ;; is this actually here? @@ -52424,8 +52264,6 @@ :method-count-assert 156 :size-assert #x3f8 :flag-assert #x9c038003f8 - (:methods - ) ) (deftype turbo-ring (process-drawable) @@ -52443,12 +52281,14 @@ :method-count-assert 25 :size-assert #x150 :flag-assert #x1900d00150 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (turbo-ring-method-22 (_type_) none 22) - (turbo-ring-method-23 (_type_) none 23) - (turbo-ring-method-24 (_type_) none 24) + (turbo-ring-method-22 (_type_) none) ;; 22 + (turbo-ring-method-23 (_type_) none) ;; 23 + (turbo-ring-method-24 (_type_) none) ;; 24 ) ) @@ -52470,8 +52310,6 @@ :method-count-assert 156 :size-assert #x3fc :flag-assert #x9c038003fc - (:methods - ) ) (deftype race-bike-d (vehicle-race-bike) @@ -52479,8 +52317,6 @@ :method-count-assert 156 :size-assert #x3fc :flag-assert #x9c038003fc - (:methods - ) ) (deftype race-bike-e (vehicle-race-bike) @@ -52488,8 +52324,6 @@ :method-count-assert 156 :size-assert #x3fc :flag-assert #x9c038003fc - (:methods - ) ) (define-extern *race-bike-d-constants* rigid-body-vehicle-constants) @@ -52546,12 +52380,14 @@ :method-count-assert 25 :size-assert #x11c :flag-assert #x1900a0011c + (:state-methods + idle-open + idle-close + ) (:methods - (idle-open () _type_ :state 20) - (idle-close () _type_ :state 21) - (security-wall-method-22 (_type_ path-control float) vector 22) - (security-wall-method-23 (_type_) none 23) - (security-wall-method-24 (_type_) none 24) + (security-wall-method-22 (_type_ path-control float) vector) ;; 22 + (security-wall-method-23 (_type_) none) ;; 23 + (security-wall-method-24 (_type_) none) ;; 24 ) ) @@ -52568,10 +52404,12 @@ :method-count-assert 30 :size-assert #x130 :flag-assert #x1e00b00130 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (fruit-stand-method-28 (_type_) none 28) - (fruit-stand-method-29 (_type_) none 29) + (fruit-stand-method-28 (_type_) none) ;; 28 + (fruit-stand-method-29 (_type_) none) ;; 29 ) ) @@ -52602,16 +52440,19 @@ :method-count-assert 36 :size-assert #x11c ;; 284 :flag-assert #x2400a0011c + (:state-methods + idle + hostile + explode + wait-for-pushing + pushed + ) (:methods - (idle () _type_ :state 27) - (hostile () _type_ :state 28) - (explode () _type_ :state 29) - (wait-for-pushing () _type_ :state 30) - (pushed () _type_ :state 31) - (cty-guard-turret-method-32 (_type_) none 32) - (cty-guard-turret-method-33 (_type_) none 33) - (cty-guard-turret-method-34 (_type_) none 34) - (cty-guard-turret-method-35 (_type_) quaternion 35)) + (cty-guard-turret-method-32 (_type_) none) ;; 32 + (cty-guard-turret-method-33 (_type_) none) ;; 33 + (cty-guard-turret-method-34 (_type_) none) ;; 34 + (cty-guard-turret-method-35 (_type_) quaternion) ;; 35 + ) ) (deftype parking-spot (process-drawable) @@ -52624,12 +52465,15 @@ :method-count-assert 25 :size-assert #xf0 ;; 240 :flag-assert #x19007000f0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (parking-spot-method-21 (_type_) none 21) - (parking-spot-method-22 (_type_) none 22) - (parking-spot-method-23 (_type_ uint) none 23) - (parking-spot-method-24 (_type_) none 24)) + (parking-spot-method-21 (_type_) none) ;; 21 + (parking-spot-method-22 (_type_) none) ;; 22 + (parking-spot-method-23 (_type_ uint) none) ;; 23 + (parking-spot-method-24 (_type_) none) ;; 24 + ) ) (deftype propa (process-focusable) @@ -52644,12 +52488,15 @@ :method-count-assert 32 :size-assert #xec ;; 236 :flag-assert #x20007000ec + (:state-methods + idle + broken + ) (:methods - (idle () _type_ :state 27) - (broken () _type_ :state 28) - (propa-method-29 (_type_) none 29) - (propa-method-30 (_type_) none 30) - (propa-method-31 (_type_ vector) none 31)) + (propa-method-29 (_type_) none) ;; 29 + (propa-method-30 (_type_) none) ;; 30 + (propa-method-31 (_type_ vector) none) ;; 31 + ) ) (deftype baron-statue (process-drawable) @@ -52657,8 +52504,9 @@ :method-count-assert 21 :size-assert #xc8 ;; 200 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) (deftype burning-bush (process-focusable) @@ -52672,13 +52520,16 @@ :method-count-assert 33 :size-assert #xe0 ;; 224 :flag-assert #x21006000e0 + (:state-methods + idle + talking + menu + ) (:methods - (idle () _type_ :state 27) - (talking () _type_ :state 28) - (menu () _type_ :state 29) - (burning-bush-method-30 (_type_) none 30) - (burning-bush-method-31 (_type_) none 31) - (burning-bush-method-32 (_type_) object 32)) + (burning-bush-method-30 (_type_) none) ;; 30 + (burning-bush-method-31 (_type_) none) ;; 31 + (burning-bush-method-32 (_type_) object) ;; 32 + ) ) (deftype barons-ship-lores (process-drawable) @@ -52691,8 +52542,9 @@ :method-count-assert 21 :size-assert #x10c ;; 268 :flag-assert #x150090010c - (:methods - (idle () _type_ :state 20)) + (:state-methods + idle + ) ) (deftype lurker-pipe-lid (process-focusable) @@ -52703,11 +52555,14 @@ :method-count-assert 31 :size-assert #xd4 ;; 212 :flag-assert #x1f006000d4 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (lurker-pipe-lid-method-28 (_type_) none 28) - (lurker-pipe-lid-method-29 (_type_) none 29) - (lurker-pipe-lid-method-30 (_type_) none 30)) + (lurker-pipe-lid-method-28 (_type_) none) ;; 28 + (lurker-pipe-lid-method-29 (_type_) none) ;; 29 + (lurker-pipe-lid-method-30 (_type_) none) ;; 30 + ) ) (deftype ctyn-lamp (process-focusable) @@ -52715,11 +52570,14 @@ :method-count-assert 31 :size-assert #xcc ;; 204 :flag-assert #x1f005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (ctyn-lamp-method-29 (_type_) none 29) - (ctyn-lamp-method-30 (_type_) none 30)) + (ctyn-lamp-method-29 (_type_) none) ;; 29 + (ctyn-lamp-method-30 (_type_) none) ;; 30 + ) ) (define-extern *fruit-check-ground-counter* int) @@ -52778,9 +52636,11 @@ :method-count-assert 16 :size-assert #x94 :flag-assert #x1000200094 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (boat-manager-method-15 (_type_) none 15) + (boat-manager-method-15 (_type_) none) ;; 15 ) ) @@ -52794,11 +52654,11 @@ :size-assert #x380 :flag-assert #x9503000380 (:methods - (boat-base-method-144 (_type_ nav-control) none 144) - (boat-base-method-145 (_type_ nav-control) none 145) - (boat-base-method-146 (_type_ nav-control) none 146) - (boat-base-method-147 (_type_ nav-control) none 147) - (boat-base-method-148 (_type_ nav-control) none 148) + (boat-base-method-144 (_type_ nav-control) none) ;; 144 + (boat-base-method-145 (_type_ nav-control) none) ;; 145 + (boat-base-method-146 (_type_ nav-control) none) ;; 146 + (boat-base-method-147 (_type_ nav-control) none) ;; 147 + (boat-base-method-148 (_type_ nav-control) none) ;; 148 ) ) @@ -52809,8 +52669,6 @@ :method-count-assert 149 :size-assert #x388 :flag-assert #x9503100388 - (:methods - ) ) (define-extern *barge-constants* rigid-body-vehicle-constants) @@ -52853,17 +52711,19 @@ :method-count-assert 235 :size-assert #x3f8 :flag-assert #xeb038003f8 + (:state-methods + traveling + traveling-blocked + waiting-with-kor + waiting-idle + waiting-turn + scared-idle + arrested + ) (:methods - (traveling () _type_ :state 225) - (traveling-blocked () _type_ :state 226) - (waiting-with-kor () _type_ :state 227) - (waiting-idle () _type_ :state 228) - (waiting-turn () _type_ :state 229) - (scared-idle () _type_ :state 230) - (arrested () _type_ :state 231) - (kid-method-232 (_type_) none 232) - (kid-method-233 (_type_) none 233) - (kid-method-234 (_type_) none 234) + (kid-method-232 (_type_) none) ;; 232 + (kid-method-233 (_type_) none) ;; 233 + (kid-method-234 (_type_) none) ;; 234 ) ) @@ -52876,8 +52736,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -52892,17 +52750,19 @@ :method-count-assert 235 :size-assert #x3f8 :flag-assert #xeb038003f8 + (:state-methods + traveling + traveling-blocked + waiting-with-kid + waiting-idle + waiting-turn + scared-idle + arrested + ) (:methods - (traveling () _type_ :state 225) - (traveling-blocked () _type_ :state 226) - (waiting-with-kid () _type_ :state 227) - (waiting-idle () _type_ :state 228) - (waiting-turn () _type_ :state 229) - (scared-idle () _type_ :state 230) - (arrested () _type_ :state 231) - (kor-method-232 (_type_) none 232) - (kor-method-233 (_type_) none 233) - (kor-method-234 (_type_) none 234) + (kor-method-232 (_type_) none) ;; 232 + (kor-method-233 (_type_) none) ;; 233 + (kor-method-234 (_type_) none) ;; 234 ) ) @@ -52915,8 +52775,6 @@ :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 - (:methods - ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -52941,8 +52799,8 @@ :size-assert #x490 :flag-assert #xe504100490 (:methods - (hal-help-kid-method-227 (_type_) none 227) - (hal-help-kid-method-228 (_type_ vector) none 228) + (hal-help-kid-method-227 (_type_) none) ;; 227 + (hal-help-kid-method-228 (_type_ vector) none) ;; 228 ) ) @@ -53025,8 +52883,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -53038,8 +52896,8 @@ :method-count-assert 21 :size-assert #xcc :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -53066,12 +52924,12 @@ :method-count-assert 25 :size-assert #x124 :flag-assert #x1900b00124 - (:methods - (idle () _type_ :state 20) - (carry () _type_ :state 21) - (drag () _type_ :state 22) - (fall () _type_ :state 23) - (wait () _type_ :state 24) + (:state-methods + idle + carry + drag + fall + wait ) ) @@ -53080,8 +52938,6 @@ :method-count-assert 25 :size-assert #x124 :flag-assert #x1900b00124 - (:methods - ) ) (deftype pushblock (mechblock) @@ -53089,8 +52945,6 @@ :method-count-assert 25 :size-assert #x124 :flag-assert #x1900b00124 - (:methods - ) ) @@ -53150,11 +53004,13 @@ :method-count-assert 31 :size-assert #xd8 :flag-assert #x1f006000d8 + (:state-methods + unbroken + hit + broken + ) (:methods - (unbroken () _type_ :state 27) - (hit () _type_ :state 28) - (broken () _type_ :state 29) - (ruins-breakable-wall-method-30 (_type_ symbol) none 30) + (ruins-breakable-wall-method-30 (_type_ symbol) none) ;; 30 ) ) @@ -53178,11 +53034,11 @@ :method-count-assert 24 :size-assert #xe4 :flag-assert #x18007000e4 - (:methods - (idle () _type_ :state 20) - (bump () _type_ :state 21) - (hit () _type_ :state 22) - (fall (symbol) _type_ :state 23) + (:state-methods + idle + bump + hit + (fall symbol) ) ) @@ -53197,8 +53053,6 @@ :method-count-assert 57 :size-assert #x190 :flag-assert #x3901100190 - (:methods - ) ) (deftype beam (process-drawable) @@ -53206,9 +53060,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (collapse () _type_ :state 21) + (:state-methods + idle + collapse ) ) @@ -53217,8 +53071,6 @@ :method-count-assert 36 :size-assert #x140 :flag-assert #x2400c00140 - (:methods - ) ) (deftype ruins-drop-plat (drop-plat) @@ -53226,8 +53078,6 @@ :method-count-assert 36 :size-assert #x140 :flag-assert #x2400c00140 - (:methods - ) ) (define-extern *ruins-sinking-platform-constants* rigid-body-platform-constants) @@ -53271,16 +53121,18 @@ :method-count-assert 187 :size-assert #x3a4 :flag-assert #xbb033003a4 + (:state-methods + attack + spin-attack + hop + hop-turn + cool-down + reload + ) (:methods - (attack () _type_ :state 178) - (spin-attack () _type_ :state 179) - (hop () _type_ :state 180) - (hop-turn () _type_ :state 181) - (cool-down () _type_ :state 182) - (reload () _type_ :state 183) - (rapid-gunner-method-184 (_type_ float) symbol 184) - (rapid-gunner-method-185 (_type_ vector float) none 185) - (rapid-gunner-method-186 (_type_ int float int int) none 186) + (rapid-gunner-method-184 (_type_ float) symbol) ;; 184 + (rapid-gunner-method-185 (_type_ vector float) none) ;; 185 + (rapid-gunner-method-186 (_type_ int float int int) none) ;; 186 ) ) @@ -53289,8 +53141,6 @@ :method-count-assert 187 :size-assert #x3a4 :flag-assert #xbb033003a4 - (:methods - ) ) (define-extern *rapid-gunner-nav-enemy-info* nav-enemy-info) @@ -53307,13 +53157,15 @@ :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) (find-ground "TODO - understand the collision query stuff more @returns whether or not the [[self]] is above the ground" - (_type_) symbol 22) + (_type_) symbol) ;; 22 ) ) @@ -53345,8 +53197,6 @@ :method-count-assert 185 :size-assert #x354 :flag-assert #xb902e00354 - (:methods - ) ) (deftype tanker-container (process-drawable) @@ -53354,10 +53204,12 @@ :method-count-assert 23 :size-assert #xc8 :flag-assert #x17005000c8 + (:state-methods + dormant + idle + ) (:methods - (dormant () _type_ :state 20) - (idle () _type_ :state 21) - (tanker-container-method-22 (_type_) none 22) + (tanker-container-method-22 (_type_) none) ;; 22 ) ) @@ -53366,9 +53218,9 @@ :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (dormant () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + dormant + idle ) ) @@ -53382,9 +53234,9 @@ :method-count-assert 22 :size-assert #xf0 :flag-assert #x16007000f0 - (:methods - (active () _type_ :state 20) - (die-fast () _type_ :state 21) + (:state-methods + active + die-fast ) ) @@ -53406,7 +53258,7 @@ :size-assert #x439 :flag-assert #xfc03c00439 (:methods - (suppress-traffic (_type_) none 251) + (suppress-traffic (_type_) none) ;; 251 ) ) @@ -53421,8 +53273,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -53431,8 +53283,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -53441,8 +53293,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -53451,8 +53303,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -53461,8 +53313,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -53471,8 +53323,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -53481,8 +53333,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -53491,8 +53343,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -53551,8 +53403,6 @@ :method-count-assert 28 :size-assert #x174 :flag-assert #x1c01000174 - (:methods - ) ) (deftype hip-whack-a-metal (process-taskable) @@ -53560,8 +53410,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (deftype hip-mirror (process-drawable) @@ -53569,8 +53417,8 @@ :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -53579,8 +53427,6 @@ :method-count-assert 38 :size-assert #x120 :flag-assert #x2600a00120 - (:methods - ) ) (define-extern hiphog-activate (function vector)) @@ -53592,4 +53438,4 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define-extern *default-envmap-shader* adgif-shader) -(define-extern *generic-envmap-texture* texture) +(define-extern *generic-envmap-texture* texture) \ No newline at end of file diff --git a/decompiler/util/DecompilerTypeSystem.cpp b/decompiler/util/DecompilerTypeSystem.cpp index bb836f13a18..7272ef21f6a 100644 --- a/decompiler/util/DecompilerTypeSystem.cpp +++ b/decompiler/util/DecompilerTypeSystem.cpp @@ -110,7 +110,7 @@ void DecompilerTypeSystem::parse_type_defs(const std::vector& file_ } catch (std::exception& e) { auto info = m_reader.db.get_info_for(o); lg::error("{} when parsing decompiler type file:{}", e.what(), info); - throw e; + throw; } }); } diff --git a/goal_src/goal-lib.gc b/goal_src/goal-lib.gc index 50312a71248..12be289f59b 100644 --- a/goal_src/goal-lib.gc +++ b/goal_src/goal-lib.gc @@ -21,7 +21,7 @@ "Make Debug Asm Only: make + print disassembly (asm-only mode) for a file" (if (null? path) `(asm-file ,file :color :write :disassemble :disasm-code-only) - `(asm-file ,file :color :write :disassemble :disasm-code-only ,(first path)) + `(asm-file ,file :color :write :disassemble ,(first path) :disasm-code-only) ) ) @@ -292,6 +292,22 @@ ) ) +(defmacro defun-debug-recursive (name return-type bindings &rest body) + `(begin + (define-extern ,name + (function ,@(apply (lambda (x) + (if (pair? x) + (second x) + 'object) + ) + bindings) + ,return-type)) + (if *debug-segment* + (defun-debug ,name ,bindings ,@body) + (define :no-typecheck #t ,name nothing)) + ) + ) + (defmacro define-once (name value) "define once. Does not set the symbol if it already has a value. It must have been at least forward-declared first!" `(begin diff --git a/goal_src/jak1/engine/anim/aligner-h.gc b/goal_src/jak1/engine/anim/aligner-h.gc index 9ff3c6e5056..4f89115c611 100644 --- a/goal_src/jak1/engine/anim/aligner-h.gc +++ b/goal_src/jak1/engine/anim/aligner-h.gc @@ -32,39 +32,35 @@ ;; DECOMP BEGINS (deftype align-control (basic) - ((flags align-flags :offset-assert 4) - (process process-drawable :offset-assert 8) - (frame-group art-joint-anim :offset-assert 12) - (frame-num float :offset-assert 16) - (matrix matrix 2 :inline :offset-assert 32) - (transform transform 2 :inline :offset-assert 160) - (delta transformq :inline :offset-assert 256) - (last-speed meters :offset-assert 304) - (align transformq :inline :offset 160) + ((flags align-flags) + (process process-drawable) + (frame-group art-joint-anim) + (frame-num float) + (matrix matrix 2 :inline) + (transform transform 2 :inline) + (delta transformq :inline) + (last-speed meters) + (align transformq :inline :overlay-at (-> transform 0 trans x)) ) - :method-count-assert 14 - :size-assert #x134 - :flag-assert #xe00000134 (:methods - (new (symbol type process) _type_ :behavior process-drawable 0) - (compute-alignment! (_type_) transformq 9) - (align! (_type_ align-opts float float float) trsqv 10) - (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv 11) ;; 3rd arg is unused - (first-transform (_type_) transform 12) - (snd-transform (_type_) transform 13) + (new (symbol type process-drawable) _type_) + (compute-alignment! (_type_) transformq) + (align! (_type_ align-opts float float float) trsqv) + (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv) + (first-transform (_type_) transform) + (snd-transform (_type_) transform) ) ) -(defmethod new align-control ((allocation symbol) (type-to-make type) (proc process)) +(defmethod new align-control ((allocation symbol) (type-to-make type) (proc process-drawable)) "Create a new align-control." - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (when (zero? obj) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (when (zero? this) (go process-drawable-art-error "memory") (return (the align-control 0)) ) - - (set! (-> obj process) (the-as process-drawable proc)) - obj + (set! (-> this process) proc) + this ) ) diff --git a/goal_src/jak1/engine/anim/aligner.gc b/goal_src/jak1/engine/anim/aligner.gc index 61930734a77..1f214b2bd64 100644 --- a/goal_src/jak1/engine/anim/aligner.gc +++ b/goal_src/jak1/engine/anim/aligner.gc @@ -9,7 +9,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod compute-alignment! align-control ((this align-control)) +(defmethod compute-alignment! ((this align-control)) (local-vars (a0-9 symbol) (s7-0 none) (ra-0 int)) (with-pp (let ((s5-0 (-> this process skel active-channels))) @@ -115,15 +115,15 @@ ) ) -(defmethod first-transform align-control ((this align-control)) +(defmethod first-transform ((this align-control)) (the-as transform (-> this transform)) ) -(defmethod snd-transform align-control ((this align-control)) +(defmethod snd-transform ((this align-control)) (-> this transform 1) ) -(defmethod align! align-control ((this align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float)) +(defmethod align! ((this align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float)) (when (not (logtest? (-> this flags) (align-flags disabled))) (let* ((a0-1 (-> this process)) (t9-0 (method-of-object a0-1 apply-alignment)) @@ -140,7 +140,7 @@ (-> this process root) ) -(defmethod set-and-limit-velocity trsqv ((this trsqv) (arg0 int) (arg1 vector) (arg2 float)) +(defmethod set-and-limit-velocity ((this trsqv) (arg0 int) (arg1 vector) (arg2 float)) (let ((gp-0 (-> this transv))) (when (logtest? arg0 4) (set! (-> gp-0 x) (-> arg1 x)) @@ -153,7 +153,7 @@ this ) -(defmethod align-vel-and-quat-only! align-control ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) +(defmethod align-vel-and-quat-only! ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) (when (not (logtest? (-> this flags) (align-flags disabled))) (let ((s5-0 (-> this delta))) (let ((s3-0 (-> this process root transv))) diff --git a/goal_src/jak1/engine/anim/joint-exploder.gc b/goal_src/jak1/engine/anim/joint-exploder.gc index 70b7ece9de5..1c2876843af 100644 --- a/goal_src/jak1/engine/anim/joint-exploder.gc +++ b/goal_src/jak1/engine/anim/joint-exploder.gc @@ -8,112 +8,90 @@ ;; DECOMP BEGINS (deftype joint-exploder-tuning (structure) - ((explosion uint64 :offset-assert 0) - (duration time-frame :offset-assert 8) - (gravity float :offset-assert 16) - (rot-speed float :offset-assert 20) - (fountain-rand-transv-lo vector :inline :offset-assert 32) - (fountain-rand-transv-hi vector :inline :offset-assert 48) - (away-from-focal-pt vector :inline :offset 32) - (away-from-rand-transv-xz-lo float :offset 48) - (away-from-rand-transv-xz-hi float :offset 52) - (away-from-rand-transv-y-lo float :offset 56) - (away-from-rand-transv-y-hi float :offset 60) + ((explosion uint64) + (duration time-frame) + (gravity float) + (rot-speed float) + (fountain-rand-transv-lo vector :inline) + (fountain-rand-transv-hi vector :inline) + (away-from-focal-pt vector :inline :overlay-at fountain-rand-transv-lo) + (away-from-rand-transv-xz-lo float :overlay-at (-> fountain-rand-transv-hi x)) + (away-from-rand-transv-xz-hi float :overlay-at (-> fountain-rand-transv-hi y)) + (away-from-rand-transv-y-lo float :overlay-at (-> fountain-rand-transv-hi z)) + (away-from-rand-transv-y-hi float :overlay-at (-> fountain-rand-transv-hi w)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) (deftype joint-exploder-static-joint-params (structure) - ((joint-index int16 :offset-assert 0) - (parent-joint-index int16 :offset-assert 2) + ((joint-index int16) + (parent-joint-index int16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype joint-exploder-static-params (basic) - ((joints (array joint-exploder-static-joint-params) :offset-assert 4) + ((joints (array joint-exploder-static-joint-params)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype joint-exploder-joint (structure) - ((next int16 :offset-assert 0) - (prev int16 :offset-assert 2) - (joint-index int16 :offset-assert 4) - (rspeed float :offset-assert 8) - (mat matrix :inline :offset-assert 16) - (rmat matrix :inline :offset-assert 80) - (transv vector :inline :offset-assert 144) - (prev-pos vector :inline :offset-assert 160) + ((next int16) + (prev int16) + (joint-index int16) + (rspeed float) + (mat matrix :inline) + (rmat matrix :inline) + (transv vector :inline) + (prev-pos vector :inline) ) - :method-count-assert 9 - :size-assert #xb0 - :flag-assert #x9000000b0 ) (deftype joint-exploder-joints (basic) - ((num-joints int32 :offset-assert 4) - (joint joint-exploder-joint :inline :dynamic :offset 16) + ((num-joints int32) + (joint joint-exploder-joint :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type joint-exploder-static-params) _type_ 0) + (new (symbol type joint-exploder-static-params) _type_) ) ) (deftype joint-exploder-list (structure) - ((head int32 :offset-assert 0) - (pre-moved? symbol :offset-assert 4) - (bbox-valid? symbol :offset-assert 8) - (bbox bounding-box :inline :offset-assert 16) + ((head int32) + (pre-moved? symbol) + (bbox-valid? symbol) + (bbox bounding-box :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype joint-exploder (process-drawable) - ((parent-override (pointer process-drawable) :offset 12) - (die-if-below-y float :offset-assert 176) - (die-if-beyond-xz-dist-sqrd float :offset-assert 180) - (joints joint-exploder-joints :offset-assert 184) - (static-params joint-exploder-static-params :offset-assert 188) - (anim art-joint-anim :offset-assert 192) - (scale-vector vector :inline :offset-assert 208) - (tuning joint-exploder-tuning :inline :offset-assert 224) - (lists joint-exploder-list 5 :inline :offset-assert 288) + ((parent-override (pointer process-drawable) :overlay-at parent) + (die-if-below-y float) + (die-if-beyond-xz-dist-sqrd float) + (joints joint-exploder-joints) + (static-params joint-exploder-static-params) + (anim art-joint-anim) + (scale-vector vector :inline) + (tuning joint-exploder-tuning :inline) + (lists joint-exploder-list 5 :inline) ) - :heap-base #x1a0 - :method-count-assert 29 - :size-assert #x210 - :flag-assert #x1d01a00210 (:methods - (joint-exploder-method-20 (_type_ joint-exploder-list int) int 20) - (joint-exploder-method-21 (_type_ joint-exploder-list joint-exploder-joint) none 21) - (joint-exploder-method-22 (_type_ joint-exploder-list) symbol 22) - (joint-exploder-method-23 (_type_) symbol 23) - (joint-exploder-method-24 (_type_ joint-exploder-list int) int 24) - (joint-exploder-method-25 (_type_ joint-exploder-list) symbol 25) - (joint-exploder-method-26 (_type_ joint-exploder-list int) int 26) - (joint-exploder-method-27 (_type_ joint-exploder-list int) joint-exploder-list 27) - (joint-exploder-method-28 (_type_ joint-exploder-list) none 28) + (joint-exploder-method-20 (_type_ joint-exploder-list int) int) + (joint-exploder-method-21 (_type_ joint-exploder-list joint-exploder-joint) none) + (joint-exploder-method-22 (_type_ joint-exploder-list) symbol) + (joint-exploder-method-23 (_type_) symbol) + (joint-exploder-method-24 (_type_ joint-exploder-list int) int) + (joint-exploder-method-25 (_type_ joint-exploder-list) symbol) + (joint-exploder-method-26 (_type_ joint-exploder-list int) int) + (joint-exploder-method-27 (_type_ joint-exploder-list int) joint-exploder-list) + (joint-exploder-method-28 (_type_ joint-exploder-list) none) ) (:states joint-exploder-shatter @@ -121,7 +99,7 @@ ) -(defmethod asize-of joint-exploder-joints ((this joint-exploder-joints)) +(defmethod asize-of ((this joint-exploder-joints)) (the-as int (+ (-> this type size) (* 176 (-> this num-joints)))) ) @@ -157,7 +135,7 @@ (none) ) -(defmethod joint-exploder-method-24 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod joint-exploder-method-24 ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (let ((v0-0 (joint-exploder-method-26 this arg0 arg1))) (let* ((v1-1 (-> this joints)) (v1-2 (-> v1-1 joint arg1)) @@ -171,7 +149,7 @@ ) ) -(defmethod joint-exploder-method-26 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod joint-exploder-method-26 ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (let* ((v1-0 (-> this joints)) (a2-1 (-> v1-0 joint arg1)) (a0-4 (-> a2-1 prev)) @@ -202,7 +180,7 @@ ) ) -(defmethod joint-exploder-method-20 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod joint-exploder-method-20 ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (let* ((v1-0 (-> this joints)) (a3-0 (-> v1-0 joint arg1)) (a0-4 (-> arg0 head)) @@ -217,7 +195,7 @@ ) ) -(defmethod joint-exploder-method-21 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) +(defmethod joint-exploder-method-21 ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) (let ((a1-1 (-> arg1 mat vector 3))) (cond ((-> arg0 bbox-valid?) @@ -234,7 +212,7 @@ (none) ) -(defmethod joint-exploder-method-27 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod joint-exploder-method-27 ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (local-vars (sv-16 int) (sv-32 int) (sv-48 int)) (let ((s4-0 (the-as joint-exploder-list #f))) (let ((v1-0 1)) @@ -331,7 +309,7 @@ ) ) -(defmethod joint-exploder-method-28 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) +(defmethod joint-exploder-method-28 ((this joint-exploder) (arg0 joint-exploder-list)) (when (and (-> arg0 bbox-valid?) (>= (-> arg0 head) 0)) (cond ((< 20480.0 (- (-> arg0 bbox max x) (-> arg0 bbox min x))) @@ -363,7 +341,7 @@ (none) ) -(defmethod joint-exploder-method-25 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) +(defmethod joint-exploder-method-25 ((this joint-exploder) (arg0 joint-exploder-list)) (set! (-> arg0 bbox-valid?) #f) (set! (-> arg0 pre-moved?) #t) (let ((s4-0 (-> this joints)) @@ -406,7 +384,7 @@ #f ) -(defmethod joint-exploder-method-22 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) +(defmethod joint-exploder-method-22 ((this joint-exploder) (arg0 joint-exploder-list)) (fill-using-bounding-box *collide-cache* (-> arg0 bbox) @@ -526,7 +504,7 @@ :post ja-post ) -(defmethod joint-exploder-method-23 joint-exploder ((this joint-exploder)) +(defmethod joint-exploder-method-23 ((this joint-exploder)) (let ((gp-0 (-> this joints))) (dotimes (s4-0 (-> gp-0 num-joints)) (let ((v1-2 (-> this static-params joints s4-0)) @@ -622,7 +600,7 @@ ) ) -(defmethod relocate joint-exploder ((this joint-exploder) (arg0 int)) +(defmethod relocate ((this joint-exploder) (arg0 int)) (if (nonzero? (-> this joints)) (&+! (-> this joints) arg0) ) diff --git a/goal_src/jak1/engine/anim/joint-h.gc b/goal_src/jak1/engine/anim/joint-h.gc index 9010f4c31d4..39974bdbaef 100644 --- a/goal_src/jak1/engine/anim/joint-h.gc +++ b/goal_src/jak1/engine/anim/joint-h.gc @@ -35,107 +35,87 @@ ;; A single joint control channel. It can control some number of joints through a single animation. ;; Multiple channels are blended together to create smooth transitions between animations. (deftype joint-control-channel (structure) - ((parent joint-control :offset-assert 0) - (command symbol :offset-assert 4) - (frame-interp float :offset-assert 8) - (frame-group art-joint-anim :offset-assert 12) - (frame-num float :offset-assert 16) - (num-func (function joint-control-channel float float float) :offset-assert 20) - (param float 2 :offset-assert 24) - (group-sub-index int16 :offset-assert 32) - (group-size int16 :offset-assert 34) - (dist meters :offset-assert 36) - (eval-time uint32 :offset-assert 40) - (inspector-amount float :offset-assert 44) + ((parent joint-control) + (command symbol) + (frame-interp float) + (frame-group art-joint-anim) + (frame-num float) + (num-func (function joint-control-channel float float float)) + (param float 2) + (group-sub-index int16) + (group-size int16) + (dist meters) + (eval-time uint32) + (inspector-amount float) ) - :method-count-assert 10 - :size-assert #x30 - :flag-assert #xa00000030 (:methods - (debug-print-frames (_type_) _type_ 9) + (debug-print-frames (_type_) _type_) ) ) -;; A collection of joint-control-channels. + (deftype joint-control (basic) - ((status janim-status :offset-assert 4) - (allocated-length int16 :offset-assert 6) - (root-channel (inline-array joint-control-channel) :offset 16) - (blend-index int32 :offset-assert 20) - (active-channels int32 :offset-assert 24) - (generate-frame-function (function (inline-array vector) int process-drawable int) :offset-assert 28) - (prebind-function (function pointer int process-drawable none) :offset-assert 32) - (postbind-function (function process-drawable none) :offset-assert 36) - (effect effect-control :offset-assert 40) - (channel joint-control-channel 3 :inline :offset-assert 48) - (frame-group0 art-joint-anim :offset 60) - (frame-num0 float :offset 64) - (frame-interp0 float :offset 56) - (frame-group1 art-joint-anim :offset 108) - (frame-num1 float :offset 112) - (frame-interp1 float :offset 104) - (frame-group2 art-joint-anim :offset 156) - (frame-num2 float :offset 160) - (frame-interp2 float :offset 152) + ((status janim-status) + (allocated-length int16) + (root-channel (inline-array joint-control-channel) :offset 16) + (blend-index int32) + (active-channels int32) + (generate-frame-function (function (inline-array vector) int process-drawable int)) + (prebind-function (function pointer int process-drawable none)) + (postbind-function (function process-drawable none)) + (effect effect-control) + (channel joint-control-channel 3 :inline) + (frame-group0 art-joint-anim :overlay-at (-> channel 0 frame-group)) + (frame-num0 float :overlay-at (-> channel 0 frame-num)) + (frame-interp0 float :overlay-at (-> channel 0 frame-interp)) + (frame-group1 art-joint-anim :offset 108) + (frame-num1 float :offset 112) + (frame-interp1 float :offset 104) + (frame-group2 art-joint-anim :offset 156) + (frame-num2 float :offset 160) + (frame-interp2 float :offset 152) ) - :method-count-assert 11 - :size-assert #xc0 - :flag-assert #xb000000c0 (:methods - (new (symbol type int) _type_ 0) - (current-cycle-distance (_type_) float 9) - (debug-print-channels (_type_ symbol) int 10) + (new (symbol type int) _type_) + (current-cycle-distance (_type_) float) + (debug-print-channels (_type_ symbol) int) ) ) -;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; joint anim decompress -;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; these types are used to decompress joint animations. (deftype matrix-stack (structure) - ((top matrix :offset-assert 0) - (data matrix 24 :inline :offset-assert 16) + ((top matrix) + (data matrix 24 :inline) ) - :method-count-assert 9 - :size-assert #x610 - :flag-assert #x900000610 ) (deftype channel-upload-info (structure) - ((fixed joint-anim-compressed-fixed :offset-assert 0) - (fixed-qwc int32 :offset-assert 4) - (frame joint-anim-compressed-frame :offset-assert 8) - (frame-qwc int32 :offset-assert 12) - (amount float :offset-assert 16) - (interp float :offset-assert 20) + ((fixed joint-anim-compressed-fixed) + (fixed-qwc int32) + (frame joint-anim-compressed-frame) + (frame-qwc int32) + (amount float) + (interp float) ) :pack-me - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype joint-work (structure) - ((temp-mtx matrix :inline :offset-assert 0) - (joint-stack matrix-stack :inline :offset-assert 64) - (fix-jmp-table (function none) 16 :offset-assert 1616) - (frm-jmp-table (function none) 16 :offset-assert 1680) - (pair-jmp-table (function none) 16 :offset-assert 1744) - (uploads channel-upload-info 24 :inline :offset-assert 1808) - (num-uploads int32 :offset-assert 2384) - (mtx-acc matrix 2 :inline :offset-assert 2400) - (tq-acc transformq 100 :inline :offset-assert 2528) - (jacp-hdr joint-anim-compressed-hdr :inline :offset-assert 7328) - (fixed-data joint-anim-compressed-fixed :inline :offset-assert 7392) - (frame-data joint-anim-compressed-frame 2 :inline :offset-assert 9600) - (flatten-array float 576 :offset 2400) - (flattened vector 24 :inline :offset 2400) + ((temp-mtx matrix :inline) + (joint-stack matrix-stack :inline) + (fix-jmp-table (function none) 16) + (frm-jmp-table (function none) 16) + (pair-jmp-table (function none) 16) + (uploads channel-upload-info 24 :inline) + (num-uploads int32) + (mtx-acc matrix 2 :inline) + (tq-acc transformq 100 :inline) + (jacp-hdr joint-anim-compressed-hdr :inline) + (fixed-data joint-anim-compressed-fixed :inline) + (frame-data joint-anim-compressed-frame 2 :inline) + (flatten-array float 576 :overlay-at mtx-acc) + (flattened vector 24 :inline :overlay-at mtx-acc) ) - :method-count-assert 9 - :size-assert #x3640 - :flag-assert #x900003640 ) diff --git a/goal_src/jak1/engine/anim/joint-mod-h.gc b/goal_src/jak1/engine/anim/joint-mod-h.gc index 70958740b1f..d3428a971a2 100644 --- a/goal_src/jak1/engine/anim/joint-mod-h.gc +++ b/goal_src/jak1/engine/anim/joint-mod-h.gc @@ -34,38 +34,35 @@ ;; Although the mode is a bitfield, it appears that multiple kinds of mods cannot be ;; activated at the same time. (deftype joint-mod (basic) - ((mode joint-mod-handler-mode :offset-assert 4) - (process process-drawable :offset-assert 8) - (joint cspace :offset-assert 12) - (target vector :inline :offset-assert 16) - (twist vector :inline :offset-assert 32) - (twist-max vector :inline :offset-assert 48) - (trans vector :inline :offset-assert 64) - (quat quaternion :inline :offset-assert 80) - (scale vector :inline :offset-assert 96) - (notice-time time-frame :offset-assert 112) - (flex-blend float :offset-assert 120) - (blend float :offset-assert 124) - (max-dist meters :offset-assert 128) - (ignore-angle degrees :offset-assert 132) - (up uint8 :offset-assert 136) - (nose uint8 :offset-assert 137) - (ear uint8 :offset-assert 138) - (shutting-down? symbol :offset-assert 140) - (parented-scale? symbol :offset 128) + ((mode joint-mod-handler-mode) + (process process-drawable) + (joint cspace) + (target vector :inline) + (twist vector :inline) + (twist-max vector :inline) + (trans vector :inline) + (quat quaternion :inline) + (scale vector :inline) + (notice-time time-frame) + (flex-blend float) + (blend float) + (max-dist meters) + (ignore-angle degrees) + (up uint8) + (nose uint8) + (ear uint8) + (shutting-down? symbol) + (parented-scale? symbol :overlay-at max-dist) ) - :method-count-assert 16 - :size-assert #x90 - :flag-assert #x1000000090 (:methods - (new (symbol type joint-mod-handler-mode process-drawable int) _type_ 0) - (set-mode! (_type_ joint-mod-handler-mode) _type_ 9) - (set-target! (_type_ vector) none 10) - (look-at-enemy! (_type_ vector symbol process) none 11) - (reset-blend! (_type_) _type_ 12) - (set-twist! (_type_ float float float) vector 13) - (set-trs! (_type_ vector quaternion vector) none 14) - (shut-down! (_type_) none 15) + (new (symbol type joint-mod-handler-mode process-drawable int) _type_) + (set-mode! (_type_ joint-mod-handler-mode) _type_) + (set-target! (_type_ vector) none) + (look-at-enemy! (_type_ vector symbol process) none) + (reset-blend! (_type_) _type_) + (set-twist! (_type_ float float float) vector) + (set-trs! (_type_ vector quaternion vector) none) + (shut-down! (_type_) none) ) ) @@ -78,27 +75,32 @@ (none) ) -(defmethod new joint-mod ((allocation symbol) (type-to-make type) (mode joint-mod-handler-mode) (proc process-drawable) (joint-idx int)) +(defmethod new joint-mod ((allocation symbol) + (type-to-make type) + (mode joint-mod-handler-mode) + (proc process-drawable) + (joint-idx int) + ) "Construct a new joint-mod. It will work on the given process-drawable's joint." - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj process) proc) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this process) proc) ;; grab the joint from our node-list. - (set! (-> obj joint) (-> (-> proc node-list) data joint-idx)) - (set-mode! obj mode) + (set! (-> this joint) (-> proc node-list data joint-idx)) + (set-mode! this mode) ;; set defaults. - (set-vector! (-> obj twist-max) 8192.0 11832.889 0.0 1.0) - (set! (-> obj up) (the-as uint 1)) - (set! (-> obj nose) (the-as uint 2)) - (set! (-> obj ear) (the-as uint 0)) - (set! (-> obj max-dist) 122880.0) - (set! (-> obj ignore-angle) 65536.0) - (set! (-> obj flex-blend) 1.0) - (set! (-> obj shutting-down?) #f) - obj + (set-vector! (-> this twist-max) 8192.0 11832.889 0.0 1.0) + (set! (-> this up) (the-as uint 1)) + (set! (-> this nose) (the-as uint 2)) + (set! (-> this ear) (the-as uint 0)) + (set! (-> this max-dist) 122880.0) + (set! (-> this ignore-angle) 65536.0) + (set! (-> this flex-blend) 1.0) + (set! (-> this shutting-down?) #f) + this ) ) -(defmethod set-mode! joint-mod ((this joint-mod) (handler-mode joint-mod-handler-mode)) +(defmethod set-mode! ((this joint-mod) (handler-mode joint-mod-handler-mode)) "Set up the joint-mod for the given mode. You can only pick one mode at a time." (set! (-> this mode) handler-mode) (let ((joint (-> this joint))) @@ -156,20 +158,20 @@ this ) -(defmethod reset-blend! joint-mod ((this joint-mod)) +(defmethod reset-blend! ((this joint-mod)) "Reset the blend to 0." (set! (-> this blend) 0.0) this ) -(defmethod shut-down! joint-mod ((this joint-mod)) +(defmethod shut-down! ((this joint-mod)) "Shut down and set the blend to zero." (set! (-> this shutting-down?) #t) (set! (-> this blend) 0.0) (none) ) -(defmethod set-twist! joint-mod ((this joint-mod) (x float) (y float) (z float)) +(defmethod set-twist! ((this joint-mod) (x float) (y float) (z float)) "Set the twist. You can use #f to not change the current value." (if x (set! (-> this twist x) x) @@ -183,7 +185,7 @@ (-> this twist) ) -(defmethod set-trs! joint-mod ((this joint-mod) (trans vector) (rot quaternion) (scale vector)) +(defmethod set-trs! ((this joint-mod) (trans vector) (rot quaternion) (scale vector)) (if trans (set! (-> this trans quad) (-> trans quad)) ) @@ -197,7 +199,7 @@ (none) ) -(defmethod set-target! joint-mod ((this joint-mod) (target-trans vector)) +(defmethod set-target! ((this joint-mod) (target-trans vector)) "Set the joint-mod to look-at if we aren't in a mode, and look at the given target-trans." ;; set mode, if we aren't in one. (if (= (-> this mode) (joint-mod-handler-mode reset)) @@ -218,20 +220,17 @@ ;; this type is for storing what we tried to look at last. (deftype try-to-look-at-info (basic) - ((who handle :offset-assert 8) - (horz float :offset-assert 16) - (vert float :offset-assert 20) + ((who handle) + (horz float) + (vert float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; this is the last thing we tried to look at. ;; There's only one global instance of this, likely used by Jak looking at enemies. (define last-try-to-look-at-data (new 'global 'try-to-look-at-info)) -(defmethod look-at-enemy! joint-mod ((this joint-mod) (target-trans vector) (option symbol) (proc process)) +(defmethod look-at-enemy! ((this joint-mod) (target-trans vector) (option symbol) (proc process)) "Set up animation for Jak looking at an enemy. If option is 'attacking, remember when this happened. Will only override an existing look-at if this one is closer, or option is 'force." @@ -578,17 +577,14 @@ ;; These joint-mod types contain a bit of extra state required for special types of joint-mods (deftype joint-mod-wheel (basic) - ((last-position vector :inline :offset-assert 16) - (angle float :offset-assert 32) - (process process-drawable :offset-assert 36) - (wheel-radius float :offset-assert 40) - (wheel-axis int8 :offset-assert 44) + ((last-position vector :inline) + (angle float) + (process process-drawable) + (wheel-radius float) + (wheel-axis int8) ) - :method-count-assert 9 - :size-assert #x2d - :flag-assert #x90000002d (:methods - (new (symbol type process-drawable int float int) _type_ 0) + (new (symbol type process-drawable int float int) _type_) ) ) @@ -636,17 +632,14 @@ ) (deftype joint-mod-set-local (basic) - ((transform transformq :inline :offset-assert 16) - (set-rotation symbol :offset-assert 64) - (set-scale symbol :offset-assert 68) - (set-translation symbol :offset-assert 72) - (enable symbol :offset-assert 76) + ((transform transformq :inline) + (set-rotation symbol) + (set-scale symbol) + (set-translation symbol) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 (:methods - (new (symbol type process-drawable int symbol symbol symbol) _type_ 0) + (new (symbol type process-drawable int symbol symbol symbol) _type_) ) ) @@ -699,15 +692,12 @@ ) (deftype joint-mod-set-world (basic) - ((transform transformq :inline :offset-assert 16) - (node-index int32 :offset-assert 64) - (enable basic :offset-assert 68) + ((transform transformq :inline) + (node-index int32) + (enable basic) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 (:methods - (new (symbol type process-drawable int basic) _type_ 0) + (new (symbol type process-drawable int basic) _type_) ) ) @@ -738,17 +728,14 @@ ) (deftype joint-mod-blend-local (basic) - ((transform transformq :inline :offset-assert 16) - (blend-transform transformq :inline :offset-assert 64) - (node-index int32 :offset-assert 112) - (blend float :offset-assert 116) - (enable basic :offset-assert 120) + ((transform transformq :inline) + (blend-transform transformq :inline) + (node-index int32) + (blend float) + (enable basic) ) - :method-count-assert 9 - :size-assert #x7c - :flag-assert #x90000007c (:methods - (new (symbol type process-drawable int basic) _type_ 0) + (new (symbol type process-drawable int basic) _type_) ) ) @@ -792,16 +779,13 @@ ) (deftype joint-mod-spinner (basic) - ((spin-axis vector :inline :offset-assert 16) - (angle float :offset-assert 32) - (spin-rate float :offset-assert 36) - (enable basic :offset-assert 40) + ((spin-axis vector :inline) + (angle float) + (spin-rate float) + (enable basic) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c (:methods - (new (symbol type process-drawable int vector float) _type_ 0) + (new (symbol type process-drawable int vector float) _type_) ) ) diff --git a/goal_src/jak1/engine/anim/joint.gc b/goal_src/jak1/engine/anim/joint.gc index 15c14b7695b..f22939e728b 100644 --- a/goal_src/jak1/engine/anim/joint.gc +++ b/goal_src/jak1/engine/anim/joint.gc @@ -14,12 +14,12 @@ ;; Basic Methods for joint/joint-control ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod print joint ((this joint)) +(defmethod print ((this joint)) (format #t "#<~A ~S ~D @ #x~X>" (-> this type) (-> this name) (-> this number) this) this ) -(defmethod mem-usage joint ((this joint) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this joint) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 66 (-> arg0 length))) (set! (-> arg0 data 65 name) "joint") (+! (-> arg0 data 65 count) 1) @@ -30,12 +30,12 @@ this ) -(defmethod print joint-anim ((this joint-anim)) +(defmethod print ((this joint-anim)) (format #t "#<~A ~S ~D [~D] @ #x~X>" (-> this type) (-> this name) (-> this number) (-> this length) this) this ) -(defmethod length joint-anim ((this joint-anim)) +(defmethod length ((this joint-anim)) (-> this length) ) @@ -47,7 +47,7 @@ this ) -(defmethod asize-of joint-anim-matrix ((this joint-anim-matrix)) +(defmethod asize-of ((this joint-anim-matrix)) (the-as int (+ (-> joint-anim-matrix size) (* (-> this length) 64))) ) @@ -57,16 +57,16 @@ (format #t "~Tnumber: ~D~%" (-> this number)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) (dotimes (s5-0 (-> this length)) - (format #t "~T [~D] ~`transformq`P~%" s5-0 (-> this data s5-0)) - ) + (format #t "~T [~D] ~`transformq`P~%" s5-0 (-> this data s5-0)) + ) this ) -(defmethod asize-of joint-anim-transformq ((this joint-anim-transformq)) +(defmethod asize-of ((this joint-anim-transformq)) (the-as int (+ (-> joint-anim-transformq size) (* 48 (-> this length)))) ) -(defmethod asize-of joint-anim-drawable ((this joint-anim-drawable)) +(defmethod asize-of ((this joint-anim-drawable)) (the-as int (+ (-> joint-anim-drawable size) (* (-> this length) 4))) ) @@ -94,7 +94,7 @@ arg0 ) -(defmethod mem-usage joint-anim-drawable ((this joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 77 (-> arg0 length))) (set! (-> arg0 data 76 name) "joint-anim-drawable") (+! (-> arg0 data 76 count) 1) @@ -135,17 +135,19 @@ arg0 ) -(defmethod print joint-control-channel ((this joint-control-channel)) - (format #t "#" - (-> this command) - (-> this frame-group) - (-> this frame-num) - this - ) +(defmethod print ((this joint-control-channel)) + (format + #t + "#" + (-> this command) + (-> this frame-group) + (-> this frame-num) + this + ) this ) -(defmethod asize-of joint-control ((this joint-control)) +(defmethod asize-of ((this joint-control)) (the-as int (+ (-> this type size) (* 48 (-> this allocated-length)))) ) @@ -167,7 +169,7 @@ ) ) -(defmethod debug-print-frames joint-control-channel ((this joint-control-channel)) +(defmethod debug-print-frames ((this joint-control-channel)) "Print the current frame of each joint on this channel. Note: this only appears to work for uncompressed joint animations." (let ((s5-0 (-> this frame-group)) @@ -181,7 +183,7 @@ this ) -(defmethod debug-print-channels joint-control ((this joint-control) (arg0 symbol)) +(defmethod debug-print-channels ((this joint-control) (arg0 symbol)) "Print each active channel to the given stream." (dotimes (s4-0 (-> this active-channels)) (let* ((v1-6 (if (and (-> this channel s4-0 frame-group) (nonzero? (-> this channel s4-0 frame-group))) @@ -236,30 +238,30 @@ ;; art-mesh-anim: not used ;; art-joint-anim: used for animations. Provides joint-anim-compressed and eye-anim. -(defmethod needs-link? art ((this art)) +(defmethod needs-link? ((this art)) #f ) -(defmethod lookup-art art ((this art) (arg0 string) (arg1 type)) +(defmethod lookup-art ((this art) (arg0 string) (arg1 type)) "Look-up an art with the given name and type." (the-as joint #f) ) -(defmethod lookup-idx-of-art art ((this art) (arg0 string) (arg1 type)) +(defmethod lookup-idx-of-art ((this art) (arg0 string) (arg1 type)) "Look up the index of an art with the given name and type." (the-as int #f) ) -(defmethod print art ((this art)) +(defmethod print ((this art)) (format #t "#<~A ~S :length ~D @ #x~X>" (-> this type) (-> this name) (-> this length) this) this ) -(defmethod length art ((this art)) +(defmethod length ((this art)) (-> this length) ) -(defmethod login art ((this art)) +(defmethod login ((this art)) ;; not sure why we have to do this, but if the res-lump isn't properly set up to point to the tags ;; do it manually. (if (and (-> this extra) (zero? (-> this extra tag))) @@ -268,7 +270,7 @@ this ) -(defmethod mem-usage art-mesh-anim ((this art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 72 (-> arg0 length))) (set! (-> arg0 data 71 name) "art-mesh-anim") (+! (-> arg0 data 71 count) 1) @@ -285,12 +287,7 @@ this ) -(defmethod asize-of art-joint-anim ((this art-joint-anim)) - (the-as int (+ (-> art size) (* (-> this length) 4))) - ) - - -(defmethod mem-usage art-joint-anim ((this art-joint-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-joint-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 75 (-> arg0 length))) (set! (-> arg0 data 74 name) "art-joint-anim") (+! (-> arg0 data 74 count) 1) @@ -323,7 +320,10 @@ this ) -;; definition for method 3 of type art-group +(defmethod asize-of ((this art-joint-anim)) + (the-as int (+ (-> art size) (* (-> this length) 4))) + ) + (defmethod inspect art-group ((this art-group)) "Print the arts in an art-group" (format #t "[~8x] ~A~%" this (-> this type)) @@ -333,15 +333,16 @@ (format #t "~Textra: ~A~%" (-> this extra)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) (dotimes (s5-0 (-> this length)) - (if (-> this data s5-0) - (format #t "~T [~D] ~A (~D bytes)~%"s5-0 (-> this data s5-0) (mem-size (-> this data s5-0) #f 0)) - (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> this data s5-0) 0) + (if (-> this data s5-0) + (format #t "~T [~D] ~A (~D bytes)~%"s5-0 (-> this data s5-0) (mem-size (-> this data s5-0) #f 0)) + (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> this data s5-0) 0) + ) ) - ) this ) -(defmethod needs-link? art-group ((this art-group)) + +(defmethod needs-link? ((this art-group)) "Does this art-group need to be added to the level's art group? Some animations are streamed in, and need to be linked/unlinked to the level's list of art groups." (the-as symbol (and (-> this length) @@ -351,7 +352,7 @@ ) ) -(defmethod lookup-art art-group ((this art-group) (arg0 string) (arg1 type)) +(defmethod lookup-art ((this art-group) (arg0 string) (arg1 type)) "Get the art with the given name and type. Set type to false if you don't care." (the-as joint @@ -361,15 +362,13 @@ (dotimes (s2-0 (-> this length)) (if (and (-> this data s2-0) ;; entry is populated (= (-> this data s2-0 type) arg1) ;; type is right - (or (name= arg0 (-> this data s2-0 name)) ;; name is right. - (string-charp= arg0 (&-> (-> this data s2-0 name) data s3-0)) ;; also seek past ag name, and try again. - ) + (or (name= arg0 (-> this data s2-0 name)) (string-charp= arg0 (&-> (-> this data s2-0 name) data s3-0))) ;; name is right. also seek past ag name, and try again. ) (return (the-as joint (-> this data s2-0))) ) ) ) - (the-as art #f) + (the-as art-element #f) ) (else ;; no type (also no weird after ag name check) @@ -378,24 +377,23 @@ (return (the-as joint (-> this data s4-1))) ) ) - (the-as art #f) + (the-as art-element #f) ) ) ) ) -(defmethod lookup-idx-of-art art-group ((this art-group) (arg0 string) (arg1 type)) +(defmethod lookup-idx-of-art ((this art-group) (arg0 string) (arg1 type)) "Get the index of the art with the given name and type. Set type to false if you don't care. Will return #f if the art is not found." (cond (arg1 (let ((s3-0 (+ (length (-> this name)) 1))) (dotimes (s2-0 (-> this length)) - (if (and - (-> this data s2-0) - (= (-> this data s2-0 type) arg1) - (or (name= arg0 (-> this data s2-0 name)) (string-charp= arg0 (&-> (-> this data s2-0 name) data s3-0))) - ) + (if (and (-> this data s2-0) + (= (-> this data s2-0 type) arg1) + (or (name= arg0 (-> this data s2-0 name)) (string-charp= arg0 (&-> (-> this data s2-0 name) data s3-0))) + ) (return s2-0) ) ) @@ -413,7 +411,7 @@ ) ) -(defmethod login art-group ((this art-group)) +(defmethod login ((this art-group)) "Log in all the arts in a group." (dotimes (s5-0 (-> this length)) (if (-> this data s5-0) @@ -423,7 +421,7 @@ this ) -(defmethod mem-usage art-group ((this art-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 71 (-> arg0 length))) (set! (-> arg0 data 70 name) "art-group") (+! (-> arg0 data 70 count) 1) @@ -442,44 +440,44 @@ this ) -(defmethod relocate art-group ((this art-group) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate ((this art-group) (arg0 kheap) (arg1 (pointer uint8))) "Handle a loaded art-group." (let ((s4-0 (clear *temp-string*))) (string<-charp s4-0 arg1) (set! this (cond - ((not this) - (format 0 "ERROR: art-group ~A is not a valid file.~%" s4-0) - (the-as art-group #f) - ) - ((not (type-type? (-> this type) art-group)) - (format 0 "ERROR: art-group ~A is not a art-group.~%" s4-0) - (the-as art-group #f) - ) - ((not (file-info-correct-version? (-> this info) (file-kind art-group) 0)) - (the-as art-group #f) - ) - (else - (let ((s5-1 (-> *level* loading-level))) - (if (or (not s5-1) (= (-> s5-1 name) 'default)) - (login this) ;; not part of level load, just normal login. - ) - (if s5-1 - (set-loaded-art (-> s5-1 art-group) this) ;; part of level load, add to level's ag, but don't log in yet. - ) - ) - this + ((not this) + (format 0 "ERROR: art-group ~A is not a valid file.~%" s4-0) + (the-as art-group #f) ) - ) + ((not (type-type? (-> this type) art-group)) + (format 0 "ERROR: art-group ~A is not a art-group.~%" s4-0) + (the-as art-group #f) + ) + ((not (file-info-correct-version? (-> this info) (file-kind art-group) 0)) + (the-as art-group #f) + ) + (else + (let ((s5-1 (-> *level* loading-level))) + (if (or (not s5-1) (= (-> s5-1 name) 'default)) + (login this) ;; not part of level load, just normal login. + ) + (if s5-1 + (set-loaded-art (-> s5-1 art-group) this) ;; part of level load, add to level's ag, but don't log in yet. + ) + ) + this + ) + ) ) ) (none) ) -(defmethod asize-of art-mesh-geo ((this art-mesh-geo)) +(defmethod asize-of ((this art-mesh-geo)) (the-as int (+ (-> art size) (* (-> this length) 4))) ) -(defmethod mem-usage art-mesh-geo ((this art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 73 (-> arg0 length))) (set! (-> arg0 data 72 name) "art-mesh-geo") (+! (-> arg0 data 72 count) 1) @@ -496,18 +494,18 @@ this ) -(defmethod login art-joint-anim ((this art-joint-anim)) +(defmethod login ((this art-joint-anim)) (if (and (-> this extra) (zero? (-> this extra tag))) (set! (-> this extra tag) (&+ (the-as (pointer res-tag) (-> this extra)) 28)) ) this ) -(defmethod asize-of art-joint-geo ((this art-joint-geo)) +(defmethod asize-of ((this art-joint-geo)) (the-as int (+ (-> art size) (* (-> this length) 4))) ) -(defmethod lookup-art art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) +(defmethod lookup-art ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 (dotimes (s3-0 (-> this length)) @@ -528,7 +526,7 @@ ) ) -(defmethod lookup-idx-of-art art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) +(defmethod lookup-idx-of-art ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 (dotimes (s3-0 (-> this length)) @@ -549,7 +547,7 @@ ) ) -(defmethod mem-usage art-joint-geo ((this art-joint-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-joint-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 74 (-> arg0 length))) (set! (-> arg0 data 73 name) "art-joint-geo") (+! (-> arg0 data 73 count) 1) @@ -573,7 +571,7 @@ (defun joint-control-channel-eval ((arg0 joint-control-channel)) "Run the joint control num-func callback, remember the current time" ((-> arg0 num-func) arg0 (-> arg0 param 0) (-> arg0 param 1)) - (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) + (set! (-> arg0 eval-time) (the-as uint (current-time))) (none) ) @@ -581,7 +579,7 @@ "Set the joint control num-func, and evaluate it." (set! (-> arg0 num-func) arg1) (arg1 arg0 (-> arg0 param 0) (-> arg0 param 1)) - (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) + (set! (-> arg0 eval-time) (the-as uint (current-time))) (none) ) @@ -596,7 +594,7 @@ (set! (-> arg0 frame-group) arg1) ) (arg2 arg0 (-> arg0 param 0) (-> arg0 param 1)) - (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) + (set! (-> arg0 eval-time) (the-as uint (current-time))) ) ) 0 @@ -623,12 +621,13 @@ (set! (-> arg0 active-channels) (-> arg1 active-channels)) ;; figure out which slot the source is, and remember that we're a copy. (set! (-> arg0 root-channel) - (the-as (inline-array joint-control-channel) - (-> arg0 - channel - (/ (&- (the-as pointer (-> arg1 root-channel)) (the-as uint (the-as pointer (-> arg1 channel)))) 48) - ) - ) + (the-as + (inline-array joint-control-channel) + (-> arg0 + channel + (/ (&- (the-as pointer (-> arg1 root-channel)) (the-as uint (the-as pointer (-> arg1 channel)))) 48) + ) + ) ) ;; copy channels (mem-copy! @@ -644,6 +643,7 @@ arg0 ) +;; ERROR: Failed load: (set! v1-29 (l.wu (+ a0-9 -4))) at op 75 (defun joint-control-remap! ((arg0 joint-control) (arg1 art-group) (arg2 art-group) (arg3 pair) (arg4 int) (arg5 string)) (local-vars (sv-16 int) @@ -653,7 +653,7 @@ (sv-48 joint-control-channel) (sv-52 object) (sv-56 int) - (sv-64 art-joint-anim) + (sv-64 joint) (sv-80 string) ) (set! sv-16 (+ (length (-> arg2 name)) 1)) @@ -685,10 +685,10 @@ ) ) ) - (set! sv-64 (the-as art-joint-anim (lookup-art arg1 *temp-string* art-joint-anim))) + (set! sv-64 (lookup-art arg1 *temp-string* art-joint-anim)) (cond (sv-64 - (set! (-> sv-48 frame-group) sv-64) + (set! (-> sv-48 frame-group) (the-as art-joint-anim sv-64)) ) (else (set! (-> sv-48 frame-group) (the-as art-joint-anim (-> arg1 data sv-40))) @@ -884,7 +884,7 @@ (v0-0 (the-as object (-> arg0 data arg2 data))) ) (cond - ((zero? (logand (-> arg0 fixed hdr matrix-bits) 1)) + ((not (logtest? (-> arg0 fixed hdr matrix-bits) 1)) (set! v1-1 (cond ((zero? arg1) (return (the-as matrix v1-1)) @@ -903,7 +903,7 @@ (set! v0-0 (-> (the-as (inline-array vector) v0-0) 4)) ) ) - (if (zero? (logand (-> arg0 fixed hdr matrix-bits) 2)) + (if (not (logtest? (-> arg0 fixed hdr matrix-bits) 2)) (return (the-as matrix v1-1)) ) (the-as matrix v0-0) @@ -960,7 +960,7 @@ ) (else (let ((a2-3 (matrix-from-control-channel! - (the-as matrix (+ 16 (the-as int (scratchpad-object terrain-context)))) + (the-as matrix (-> (scratchpad-object terrain-context) work)) arg2 (the-as joint-control-channel arg1) ) @@ -1029,7 +1029,7 @@ (the-as matrix (-> arg0 data)) ) -(defmethod reset-and-assign-geo! cspace ((this cspace) (arg0 basic)) +(defmethod reset-and-assign-geo! ((this cspace) (arg0 basic)) (set! (-> this parent) #f) (set! (-> this joint) #f) (set! (-> this geo) arg0) @@ -1103,7 +1103,7 @@ (defun cspace<-matrix-no-push-joint! ((arg0 cspace) (arg1 joint-control)) (let ((v1-2 (matrix-from-control! - (the-as matrix-stack (+ 80 (the-as int (scratchpad-object terrain-context)))) + (-> (scratchpad-object terrain-context) work foreground joint-work joint-stack) (-> arg0 joint) arg1 'no-push @@ -1461,7 +1461,3 @@ (calc-animation-from-spr arg0 arg1) 0 ) - - - - diff --git a/goal_src/jak1/engine/anim/mspace-h.gc b/goal_src/jak1/engine/anim/mspace-h.gc index f54203df1a0..11db00e899e 100644 --- a/goal_src/jak1/engine/anim/mspace-h.gc +++ b/goal_src/jak1/engine/anim/mspace-h.gc @@ -20,50 +20,41 @@ ;; First, the joint. This type just describes how the skeleton is connected and the bind pose. (deftype joint (basic) - ((name string :offset-assert 4) ;; the joint's name (neckA, neckB, Rtoes, etc) - (number int32 :offset-assert 8) ;; the joint's number in the cspace-array - (parent joint :offset-assert 12) ;; the parent joint (ex, Lshould has parent of chest) - (bind-pose matrix :inline :offset-assert 16) ;; the bind pose, as a matrix. + ((name string) + (number int32) + (parent joint) + (bind-pose matrix :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; I believe this stores offsets, in bytes, of where there are stored ;; (possibly in the scratchpad) (deftype bone-cache (structure) - ((bone-matrix uint32 :offset-assert 0) - (parent-matrix uint32 :offset-assert 4) - (dummy uint32 :offset-assert 8) - (frame uint32 :offset-assert 12) + ((bone-matrix uint32) + (parent-matrix uint32) + (dummy uint32) + (frame uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; The "bone" stores the final positions of the bodies. ;; This is a world space transform. (deftype bone (structure) - ((transform matrix :inline :offset-assert 0) - (position vector :inline :offset 48) ;; overlays the matrix - (scale vector :inline :offset-assert 64) - (cache bone-cache :inline :offset-assert 80) + ((transform matrix :inline) + (position vector :inline :overlay-at (-> transform vector 3)) + (scale vector :inline) + (cache bone-cache :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; Like a real skeleton, this is a collection of bones for a single character. (deftype skeleton (inline-array-class) - ((bones bone :inline :dynamic)) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 + ((bones bone :inline :dynamic) + ) ) -(set! (-> skeleton heap-base) 96) + + +(set! (-> skeleton heap-base) (the-as uint 96)) ;; The "cspace" seems to be a system for linking bones and joints. ;; The tree structure matches the tree of joints. @@ -78,35 +69,31 @@ ;; node 4 is the first real joint (for jak, it's upper body). (deftype cspace (structure) - ((parent cspace :offset-assert 0) ;; the parent body - (joint joint :offset-assert 4) ;; the joint which moves us - (joint-num int16 :offset-assert 8) ;; seems to be 0 always?? - (geo basic :offset-assert 12) ;; seems to be #f always - (bone bone :offset-assert 16) ;; points to our bone. - (param0 function :offset-assert 20) ;; function to run to update. - (param1 basic :offset-assert 24) ;; parameter - (param2 basic :offset-assert 28) ;; parameter + ((parent cspace) + (joint joint) + (joint-num int16) + (geo basic) + (bone bone) + (param0 function) + (param1 basic) + (param2 basic) ) - :method-count-assert 10 - :size-assert #x20 - :flag-assert #xa00000020 (:methods - (new (symbol type basic) _type_ 0) - (reset-and-assign-geo! (_type_ basic) _type_ 9) + (new (symbol type basic) _type_) + (reset-and-assign-geo! (_type_ basic) _type_) ) ) -;; All the cspaces for a character. + (deftype cspace-array (inline-array-class) - ((data cspace :inline :dynamic :offset-assert 16) + ((data cspace :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) -(set! (-> cspace-array heap-base) 32) -(defmethod print cspace ((this cspace)) + +(set! (-> cspace-array heap-base) (the-as uint 32)) + +(defmethod print ((this cspace)) (format #t "#" diff --git a/goal_src/jak1/engine/camera/cam-layout.gc b/goal_src/jak1/engine/camera/cam-layout.gc index 2059a574aa3..cf5f3b15403 100644 --- a/goal_src/jak1/engine/camera/cam-layout.gc +++ b/goal_src/jak1/engine/camera/cam-layout.gc @@ -13,16 +13,13 @@ (define *camera-layout-blink* #f) (deftype cam-layout-bank (basic) - ((spline-t float :offset-assert 4) - (spline-step float :offset-assert 8) - (intro-t float :offset-assert 12) - (intro-step float :offset-assert 16) - (debug-t float :offset-assert 20) - (debug-step float :offset-assert 24) + ((spline-t float) + (spline-step float) + (intro-t float) + (intro-step float) + (debug-t float) + (debug-step float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) @@ -40,72 +37,54 @@ (deftype clm-basic (basic) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype clm-item-action (structure) - ((button uint64 :offset-assert 0) - (options uint64 :offset-assert 8) - (func symbol :offset-assert 16) - (parm0 int32 :offset 20) - (parm0-basic basic :offset 20) - (parm1-basic basic :offset 24) - (parm1 symbol :offset 24) + ((button uint64) + (options uint64) + (func symbol) + (parm0 int32 :offset 20) + (parm0-basic basic :overlay-at parm0) + (parm1-basic basic :offset 24) + (parm1 symbol :overlay-at parm1-basic) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype clm-item (clm-basic) - ((description string :offset-assert 4) - (button-symbol symbol :offset-assert 8) - (action clm-item-action :inline :offset-assert 16) + ((description string) + (button-symbol symbol) + (action clm-item-action :inline) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) (deftype clm-list-item (basic) - ((description string :offset-assert 4) - (track-val symbol :offset-assert 8) - (val-func symbol :offset-assert 12) - (val-parm0 int32 :offset 16) - (val-parm0-basic basic :offset 16) - (val-parm1-basic basic :offset 20) - (val-parm1 symbol :offset 20) - (actions (array clm-item-action) :offset-assert 24) + ((description string) + (track-val symbol) + (val-func symbol) + (val-parm0 int32 :offset 16) + (val-parm0-basic basic :overlay-at val-parm0) + (val-parm1-basic basic :offset 20) + (val-parm1 symbol :overlay-at val-parm1-basic) + (actions (array clm-item-action)) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype clm-list (clm-basic) - ((tracker symbol :offset-assert 4) - (cur-list-item int32 :offset-assert 8) - (items (array clm-list-item) :offset-assert 12) + ((tracker symbol) + (cur-list-item int32) + (items (array clm-list-item)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype clm (basic) - ((title string :offset-assert 4) - (items (array clm-basic) :offset-assert 8) + ((title string) + (items (array clm-basic)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -118,11 +97,8 @@ (define *volume-normal* (new 'debug 'vector-array 600)) (deftype volume-descriptor-array (inline-array-class) - ((data plane-volume :inline :dynamic :offset 16) + ((data plane-volume :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -133,19 +109,16 @@ (define *volume-descriptor* (the-as vol-control (new 'debug 'volume-descriptor-array 100))) (deftype cam-layout (process) - ((cam-entity entity-camera :offset-assert 112) - (num-entities int32 :offset-assert 116) - (cur-entity int32 :offset-assert 120) - (num-volumes int32 :offset-assert 124) - (cur-volume int32 :offset-assert 128) - (first-pvol int32 :offset-assert 132) - (first-cutoutvol int32 :offset-assert 136) - (res-key float :offset-assert 140) + ((cam-entity entity-camera) + (num-entities int32) + (cur-entity int32) + (num-volumes int32) + (cur-volume int32) + (first-pvol int32) + (first-cutoutvol int32) + (res-key float) ) :heap-base #x200 - :method-count-assert 14 - :size-assert #x90 - :flag-assert #xe02000090 (:states cam-layout-active ) @@ -437,16 +410,13 @@ ) (deftype interp-test-info (structure) - ((from vector :inline :offset-assert 0) - (to vector :inline :offset-assert 16) - (origin vector :inline :offset-assert 32) - (color vector4w :offset-assert 48) - (axis vector :offset-assert 52) - (disp string :offset-assert 56) + ((from vector :inline) + (to vector :inline) + (origin vector :inline) + (color vector4w) + (axis vector) + (disp string) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) @@ -2206,13 +2176,10 @@ ) (deftype clmf-cam-flag-toggle-info (structure) - ((key float :offset-assert 0) - (force-on int32 :offset-assert 4) - (force-off int32 :offset-assert 8) + ((key float) + (force-on int32) + (force-off int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) diff --git a/goal_src/jak1/engine/camera/cam-master.gc b/goal_src/jak1/engine/camera/cam-master.gc index bfc44d015ca..ad36bf8c7cc 100644 --- a/goal_src/jak1/engine/camera/cam-master.gc +++ b/goal_src/jak1/engine/camera/cam-master.gc @@ -13,18 +13,15 @@ ;; DECOMP BEGINS (deftype camera-master-bank (basic) - ((onscreen-head-height meters :offset-assert 4) - (onscreen-foot-height meters :offset-assert 8) - (target-height meters :offset-assert 12) - (up-move-to-pitch-ratio-in-air float :offset-assert 16) - (down-move-to-pitch-ratio-in-air float :offset-assert 20) - (up-move-to-pitch-on-ground float :offset-assert 24) - (down-move-to-pitch-on-ground float :offset-assert 28) - (pitch-off-blend float :offset-assert 32) + ((onscreen-head-height meters) + (onscreen-foot-height meters) + (target-height meters) + (up-move-to-pitch-ratio-in-air float) + (down-move-to-pitch-ratio-in-air float) + (up-move-to-pitch-on-ground float) + (down-move-to-pitch-on-ground float) + (pitch-off-blend float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) @@ -1598,12 +1595,8 @@ ) (deftype list-keeper (process) - ((dummy float :offset-assert 112) + ((dummy float) ) - :heap-base #x10 - :method-count-assert 14 - :size-assert #x74 - :flag-assert #xe00100074 ) diff --git a/goal_src/jak1/engine/camera/cam-states-dbg.gc b/goal_src/jak1/engine/camera/cam-states-dbg.gc index c4e85eaa13b..4731506a719 100644 --- a/goal_src/jak1/engine/camera/cam-states-dbg.gc +++ b/goal_src/jak1/engine/camera/cam-states-dbg.gc @@ -8,12 +8,9 @@ ;; DECOMP BEGINS (deftype cam-point-watch-bank (basic) - ((speed float :offset-assert 4) - (rot-speed degrees :offset-assert 8) + ((speed float) + (rot-speed degrees) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -87,12 +84,9 @@ ) (deftype cam-free-bank (basic) - ((speed float :offset-assert 4) - (rot-speed degrees :offset-assert 8) + ((speed float) + (rot-speed degrees) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -339,14 +333,11 @@ ) (deftype camera-free-floating-move-info (structure) - ((rv vector :inline :offset-assert 0) - (tv vector :inline :offset-assert 16) - (up vector :inline :offset-assert 32) - (tm matrix :inline :offset-assert 48) + ((rv vector :inline) + (tv vector :inline) + (up vector :inline) + (tm matrix :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) @@ -424,27 +415,21 @@ ) (deftype camera-orbit-info (structure) - ((radius float :offset-assert 0) - (rot float :offset-assert 4) - (target-off vector :inline :offset-assert 16) - (orbit-off vector :inline :offset-assert 32) - (radius-lerp float :offset-assert 48) + ((radius float) + (rot float) + (target-off vector :inline) + (orbit-off vector :inline) + (radius-lerp float) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) (deftype CAM_ORBIT-bank (basic) - ((RADIUS_MAX float :offset-assert 4) - (RADIUS_MIN float :offset-assert 8) - (TARGET_OFF_ADJUST float :offset-assert 12) - (ORBIT_OFF_ADJUST float :offset-assert 16) + ((RADIUS_MAX float) + (RADIUS_MIN float) + (TARGET_OFF_ADJUST float) + (ORBIT_OFF_ADJUST float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) diff --git a/goal_src/jak1/engine/camera/cam-states.gc b/goal_src/jak1/engine/camera/cam-states.gc index ea6b455d70f..24db45f1fd3 100644 --- a/goal_src/jak1/engine/camera/cam-states.gc +++ b/goal_src/jak1/engine/camera/cam-states.gc @@ -376,14 +376,11 @@ ) (deftype cam-eye-bank (basic) - ((rot-speed float :offset-assert 4) - (max-degrees float :offset-assert 8) - (max-fov float :offset-assert 12) - (min-fov float :offset-assert 16) + ((rot-speed float) + (max-degrees float) + (max-fov float) + (min-fov float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -547,12 +544,9 @@ ) (deftype cam-billy-bank (basic) - ((rot-speed float :offset-assert 4) - (tilt-degrees float :offset-assert 8) + ((rot-speed float) + (tilt-degrees float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -1168,12 +1162,9 @@ ) (deftype cam-string-bank (basic) - ((los-coll-rad meters :offset-assert 4) - (los-coll-rad2 meters :offset-assert 8) + ((los-coll-rad meters) + (los-coll-rad2 meters) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -1268,30 +1259,24 @@ ) (deftype los-dist (structure) - ((par-dist float :offset-assert 0) - (lat-dist float :offset-assert 4) - (vert-dist float :offset-assert 8) + ((par-dist float) + (lat-dist float) + (vert-dist float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype collide-los-dist-info (structure) - ((min-par float :offset-assert 0) - (max-par float :offset-assert 4) - (min-lat float :offset-assert 8) - (max-lat float :offset-assert 12) - (min-vp float :offset-assert 16) - (max-vp float :offset-assert 20) - (min-vn float :offset-assert 24) - (max-vn float :offset-assert 28) - (count int32 :offset-assert 32) + ((min-par float) + (max-par float) + (min-lat float) + (max-lat float) + (min-vp float) + (max-vp float) + (min-vn float) + (max-vn float) + (count int32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) @@ -1395,15 +1380,12 @@ ) (deftype collide-los-result (structure) - ((lateral vector :inline :offset-assert 0) - (cw collide-los-dist-info :inline :offset-assert 16) - (ccw collide-los-dist-info :inline :offset-assert 64) - (straddle collide-los-dist-info :inline :offset-assert 112) - (lateral-valid symbol :offset-assert 148) + ((lateral vector :inline) + (cw collide-los-dist-info :inline) + (ccw collide-los-dist-info :inline) + (straddle collide-los-dist-info :inline) + (lateral-valid symbol) ) - :method-count-assert 9 - :size-assert #x98 - :flag-assert #x900000098 ) @@ -2906,14 +2888,11 @@ ) (deftype cam-stick-bank (basic) - ((max-z meters :offset-assert 4) - (min-z meters :offset-assert 8) - (max-y meters :offset-assert 12) - (min-y meters :offset-assert 16) + ((max-z meters) + (min-z meters) + (max-y meters) + (min-y meters) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -3132,14 +3111,11 @@ ) (deftype cam-bike-bank (basic) - ((max-z meters :offset-assert 4) - (min-z meters :offset-assert 8) - (max-y meters :offset-assert 12) - (min-y meters :offset-assert 16) + ((max-z meters) + (min-z meters) + (max-y meters) + (min-y meters) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) diff --git a/goal_src/jak1/engine/camera/camera-h.gc b/goal_src/jak1/engine/camera/camera-h.gc index ca764680d6e..7b9a3e095c9 100644 --- a/goal_src/jak1/engine/camera/camera-h.gc +++ b/goal_src/jak1/engine/camera/camera-h.gc @@ -64,20 +64,17 @@ ;; DECOMP BEGINS (deftype camera-bank (basic) - ((collide-move-rad float :offset-assert 4) - (joypad uint32 :offset-assert 8) - (min-detectable-velocity float :offset-assert 12) - (attack-timeout time-frame :offset-assert 16) - (default-string-max-y meters :offset-assert 24) - (default-string-min-y meters :offset-assert 28) - (default-string-max-z meters :offset-assert 32) - (default-string-min-z meters :offset-assert 36) - (default-string-push-z meters :offset-assert 40) - (default-tilt-adjust degrees :offset-assert 44) + ((collide-move-rad float) + (joypad uint32) + (min-detectable-velocity float) + (attack-timeout time-frame) + (default-string-max-y meters) + (default-string-min-y meters) + (default-string-max-z meters) + (default-string-min-z meters) + (default-string-push-z meters) + (default-tilt-adjust degrees) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) @@ -95,103 +92,88 @@ ) (deftype cam-index (structure) - ((flags cam-index-options :offset-assert 0) - (vec vector 2 :inline :offset 16) + ((flags cam-index-options) + (vec vector 2 :inline :offset 16) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (cam-index-method-9 (_type_ symbol entity vector curve) symbol 9) - (cam-index-method-10 (_type_ vector) float 10) + (cam-index-method-9 (_type_ symbol entity vector curve) symbol) + (cam-index-method-10 (_type_ vector) float) ) ) (deftype tracking-point (structure) - ((position vector :inline :offset-assert 0) - (direction vector :inline :offset-assert 16) - (tp-length float :offset-assert 32) - (next int32 :offset-assert 36) - (incarnation int32 :offset-assert 40) + ((position vector :inline) + (direction vector :inline) + (tp-length float) + (next int32) + (incarnation int32) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) (deftype tracking-spline-sampler (structure) - ((cur-pt int32 :offset-assert 0) - (partial-pt float :offset-assert 4) + ((cur-pt int32) + (partial-pt float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype tracking-spline (structure) - ((point tracking-point 32 :inline :offset-assert 0) - (summed-len float :offset-assert 1536) - (free-point int32 :offset-assert 1540) - (used-point int32 :offset-assert 1544) - (partial-point float :offset-assert 1548) - (end-point int32 :offset-assert 1552) - (next-to-last-point int32 :offset-assert 1556) - (max-move float :offset-assert 1560) - (sample-len float :offset-assert 1564) - (used-count int32 :offset-assert 1568) - (old-position vector :inline :offset-assert 1584) - (debug-old-position vector :inline :offset-assert 1600) - (debug-out-position vector :inline :offset-assert 1616) - (debug-last-point int32 :offset-assert 1632) + ((point tracking-point 32 :inline) + (summed-len float) + (free-point int32) + (used-point int32) + (partial-point float) + (end-point int32) + (next-to-last-point int32) + (max-move float) + (sample-len float) + (used-count int32) + (old-position vector :inline) + (debug-old-position vector :inline) + (debug-out-position vector :inline) + (debug-last-point int32) ) - :method-count-assert 24 - :size-assert #x664 - :flag-assert #x1800000664 (:methods - (tracking-spline-method-9 (_type_) none 9) - (tracking-spline-method-10 (_type_ vector) none 10) - (print-nth-point (_type_ int) none 11) - (tracking-spline-method-12 (_type_) none 12) - (tracking-spline-method-13 (_type_ int) none 13) - (tracking-spline-method-14 (_type_ tracking-spline-sampler) none 14) - (tracking-spline-method-15 (_type_) none 15) - (tracking-spline-method-16 (_type_ float) none 16) - (tracking-spline-method-17 (_type_ vector float float symbol) int 17) - (tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector 18) - (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector 19) - (tracking-spline-method-20 (_type_ vector int) none 20) - (tracking-spline-method-21 (_type_ vector float float) vector 21) - (tracking-spline-method-22 (_type_ float) none 22) - (tracking-spline-method-23 (_type_) none 23) + (tracking-spline-method-9 (_type_) none) + (tracking-spline-method-10 (_type_ vector) none) + (print-nth-point (_type_ int) none) + (tracking-spline-method-12 (_type_) none) + (tracking-spline-method-13 (_type_ int) none) + (tracking-spline-method-14 (_type_ tracking-spline-sampler) none) + (tracking-spline-method-15 (_type_) none) + (tracking-spline-method-16 (_type_ float) none) + (tracking-spline-method-17 (_type_ vector float float symbol) int) + (tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector) + (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector) + (tracking-spline-method-20 (_type_ vector int) none) + (tracking-spline-method-21 (_type_ vector float float) vector) + (tracking-spline-method-22 (_type_ float) none) + (tracking-spline-method-23 (_type_) none) ) ) (deftype cam-float-seeker (structure) - ((target float :offset-assert 0) - (value float :offset-assert 4) - (vel float :offset-assert 8) - (accel float :offset-assert 12) - (max-vel float :offset-assert 16) - (max-partial float :offset-assert 20) + ((target float) + (value float) + (vel float) + (accel float) + (max-vel float) + (max-partial float) ) :pack-me - :method-count-assert 13 - :size-assert #x18 - :flag-assert #xd00000018 (:methods - (init-cam-float-seeker (_type_ float float float float) none 9) - (copy-cam-float-seeker (_type_ _type_) none 10) - (update! (_type_ float) none 11) - (jump-to-target! (_type_ float) float 12) + (init-cam-float-seeker (_type_ float float float float) none) + (copy-cam-float-seeker (_type_ _type_) none) + (update! (_type_ float) none) + (jump-to-target! (_type_ float) float) ) ) -(defmethod init-cam-float-seeker cam-float-seeker ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init-cam-float-seeker ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (set! (-> this target) arg0) (set! (-> this value) arg0) (set! (-> this vel) 0.0) @@ -202,7 +184,7 @@ (none) ) -(defmethod copy-cam-float-seeker cam-float-seeker ((this cam-float-seeker) (arg0 cam-float-seeker)) +(defmethod copy-cam-float-seeker ((this cam-float-seeker) (arg0 cam-float-seeker)) (set! (-> this target) (-> arg0 target)) (set! (-> this value) (-> arg0 value)) (set! (-> this vel) (-> arg0 vel)) @@ -213,7 +195,7 @@ (none) ) -(defmethod update! cam-float-seeker ((this cam-float-seeker) (offset float)) +(defmethod update! ((this cam-float-seeker) (offset float)) 0.0 0.0 (let* ((pos-error (- (+ (-> this target) offset) (-> this value))) @@ -237,30 +219,27 @@ (none) ) -(defmethod jump-to-target! cam-float-seeker ((this cam-float-seeker) (arg0 float)) +(defmethod jump-to-target! ((this cam-float-seeker) (arg0 float)) (set! (-> this value) (+ (-> this target) arg0)) (set! (-> this vel) 0.0) ) (deftype cam-vector-seeker (structure) - ((target vector :inline :offset-assert 0) - (value vector :inline :offset-assert 16) - (vel vector :inline :offset-assert 32) - (accel float :offset-assert 48) - (max-vel float :offset-assert 52) - (max-partial float :offset-assert 56) + ((target vector :inline) + (value vector :inline) + (vel vector :inline) + (accel float) + (max-vel float) + (max-partial float) ) - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (init! (_type_ vector float float float) none 9) - (update! (_type_ vector) none 10) + (init! (_type_ vector float float float) none) + (update! (_type_ vector) none) ) ) -(defmethod init! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init! ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 (set! (-> this target quad) (-> arg0 quad)) @@ -279,7 +258,7 @@ (none) ) -(defmethod update! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector)) +(defmethod update! ((this cam-vector-seeker) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) 0.0 (cond @@ -310,41 +289,34 @@ ) (deftype cam-rotation-tracker (structure) - ((inv-mat matrix :inline :offset-assert 0) - (no-follow basic :offset-assert 64) - (follow-pt vector :inline :offset-assert 80) - (follow-off vector :inline :offset-assert 96) - (follow-blend float :offset-assert 112) - (tilt-adjust cam-float-seeker :inline :offset-assert 116) - (use-point-of-interest basic :offset-assert 140) - (point-of-interest vector :inline :offset-assert 144) - (point-of-interest-blend cam-float-seeker :inline :offset-assert 160) - (underwater-blend cam-float-seeker :inline :offset-assert 184) + ((inv-mat matrix :inline) + (no-follow basic) + (follow-pt vector :inline) + (follow-off vector :inline) + (follow-blend float) + (tilt-adjust cam-float-seeker :inline) + (use-point-of-interest basic) + (point-of-interest vector :inline) + (point-of-interest-blend cam-float-seeker :inline) + (underwater-blend cam-float-seeker :inline) ) - :method-count-assert 9 - :size-assert #xd0 - :flag-assert #x9000000d0 ) (deftype camera-combiner (process) - ((trans vector :inline :offset-assert 112) - (inv-camera-rot matrix :inline :offset-assert 128) - (fov float :offset-assert 192) - (interp-val float :offset-assert 196) - (interp-step float :offset-assert 200) - (dist-from-src float :offset-assert 204) - (dist-from-dest float :offset-assert 208) - (flip-control-axis vector :inline :offset-assert 224) - (velocity vector :inline :offset-assert 240) - (tracking-status uint64 :offset-assert 256) - (tracking-options int32 :offset-assert 264) - (tracking cam-rotation-tracker :inline :offset-assert 272) + ((trans vector :inline) + (inv-camera-rot matrix :inline) + (fov float) + (interp-val float) + (interp-step float) + (dist-from-src float) + (dist-from-dest float) + (flip-control-axis vector :inline) + (velocity vector :inline) + (tracking-status uint64) + (tracking-options int32) + (tracking cam-rotation-tracker :inline) ) - :heap-base #x170 - :method-count-assert 14 - :size-assert #x1e0 - :flag-assert #xe017001e0 (:states cam-combiner-active ) @@ -352,62 +324,58 @@ (deftype camera-slave (process) - ((trans vector :inline :offset-assert 112) - (fov float :offset-assert 128) - (fov0 float :offset-assert 132) - (fov1 float :offset-assert 136) - (fov-index cam-index :inline :offset-assert 144) - (tracking cam-rotation-tracker :inline :offset-assert 192) - (view-off-param float :offset-assert 400) - (unknown-symbol symbol :offset 412) - (view-off vector :inline :offset-assert 416) - (min-z-override float :offset-assert 432) - (view-flat vector :inline :offset-assert 448) - (string-vel-dir uint32 :offset-assert 464) - (string-trans vector :inline :offset-assert 480) - (position-spline tracking-spline :inline :offset-assert 496) - (pivot-pt vector :inline :offset-assert 2144) - (pivot-rad float :offset-assert 2160) - (circular-follow vector :inline :offset-assert 2176) - (max-angle-offset float :offset-assert 2192) - (max-angle-curr float :offset-assert 2196) - (options uint32 :offset-assert 2200) - (cam-entity entity :offset-assert 2204) - (velocity vector :inline :offset-assert 2208) - (desired-pos vector :inline :offset-assert 2224) - (time-dist-too-far uint32 :offset-assert 2240) - (los-state slave-los-state :offset-assert 2244) - (good-point vector :inline :offset-assert 2256) - (los-tgt-spline-pt int32 :offset-assert 2272) - (los-tgt-spline-pt-incarnation int32 :offset-assert 2276) - (los-last-pos vector :inline :offset-assert 2288) - (intro-curve curve :inline :offset-assert 2304) - (intro-offset vector :inline :offset-assert 2336) - (intro-t float :offset-assert 2352) - (intro-t-step float :offset-assert 2356) - (outro-exit-value float :offset-assert 2360) - (spline-exists basic :offset-assert 2364) - (spline-curve curve :inline :offset-assert 2368) - (spline-offset vector :inline :offset-assert 2400) - (index cam-index :inline :offset-assert 2416) - (saved-pt vector :inline :offset-assert 2464) - (spline-tt float :offset-assert 2480) - (spline-follow-dist float :offset-assert 2484) - (change-event-from (pointer process-drawable) :offset-assert 2488) - (enter-has-run symbol :offset-assert 2492) - (blend-from-type uint64 :offset-assert 2496) - (blend-to-type uint64 :offset-assert 2504) - (have-phony-joystick basic :offset-assert 2512) - (phony-joystick-x float :offset-assert 2516) - (phony-joystick-y float :offset-assert 2520) - (string-min-val vector :inline :offset-assert 2528) - (string-max-val vector :inline :offset-assert 2544) - (string-val-locked basic :offset-assert 2560) + ((trans vector :inline) + (fov float) + (fov0 float) + (fov1 float) + (fov-index cam-index :inline) + (tracking cam-rotation-tracker :inline) + (view-off-param float) + (unknown-symbol symbol :offset 412) + (view-off vector :inline) + (min-z-override float) + (view-flat vector :inline) + (string-vel-dir uint32) + (string-trans vector :inline) + (position-spline tracking-spline :inline) + (pivot-pt vector :inline) + (pivot-rad float) + (circular-follow vector :inline) + (max-angle-offset float) + (max-angle-curr float) + (options uint32) + (cam-entity entity) + (velocity vector :inline) + (desired-pos vector :inline) + (time-dist-too-far uint32) + (los-state slave-los-state) + (good-point vector :inline) + (los-tgt-spline-pt int32) + (los-tgt-spline-pt-incarnation int32) + (los-last-pos vector :inline) + (intro-curve curve :inline) + (intro-offset vector :inline) + (intro-t float) + (intro-t-step float) + (outro-exit-value float) + (spline-exists basic) + (spline-curve curve :inline) + (spline-offset vector :inline) + (index cam-index :inline) + (saved-pt vector :inline) + (spline-tt float) + (spline-follow-dist float) + (change-event-from (pointer process-drawable)) + (enter-has-run symbol) + (blend-from-type uint64) + (blend-to-type uint64) + (have-phony-joystick basic) + (phony-joystick-x float) + (phony-joystick-y float) + (string-min-val vector :inline) + (string-max-val vector :inline) + (string-val-locked basic) ) - :heap-base #x9a0 - :method-count-assert 14 - :size-assert #xa04 - :flag-assert #xe09a00a04 (:states *camera-base-mode* cam-bike @@ -440,64 +408,60 @@ (deftype camera-master (process) - ((master-options uint32 :offset-assert 112) - (num-slaves int32 :offset-assert 116) - (slave (pointer camera-slave) 2 :offset-assert 120) - (slave-options uint32 :offset-assert 128) - (view-off-param-save float :offset-assert 132) - (changer uint32 :offset-assert 136) - (cam-entity entity :offset-assert 140) - (stringMinLength float :offset-assert 144) - (stringMaxLength float :offset-assert 148) - (stringMinHeight float :offset-assert 152) - (stringMaxHeight float :offset-assert 156) - (string-min cam-vector-seeker :inline :offset-assert 160) - (string-max cam-vector-seeker :inline :offset-assert 224) - (string-push-z float :offset-assert 284) - (stringCliffHeight float :offset-assert 288) - (no-intro uint32 :offset-assert 292) - (force-blend uint32 :offset-assert 296) - (force-blend-time uint32 :offset-assert 300) - (local-down vector :inline :offset-assert 304) - (drawable-target handle :offset-assert 320) - (which-bone int32 :offset-assert 328) - (pov-handle handle :offset-assert 336) - (pov-bone int32 :offset-assert 344) - (being-attacked symbol :offset-assert 348) - (attack-start time-frame :offset-assert 352) - (on-ground symbol :offset-assert 360) - (under-water int32 :offset-assert 364) - (on-pole symbol :offset-assert 368) - (tgt-rot-mat matrix :inline :offset-assert 384) - (tgt-face-mat matrix :inline :offset-assert 448) - (tpos-old vector :inline :offset-assert 512) - (tpos-curr vector :inline :offset-assert 528) - (target-height float :offset-assert 544) - (tpos-old-adj vector :inline :offset-assert 560) - (tpos-curr-adj vector :inline :offset-assert 576) - (tpos-tgt vector :inline :offset-assert 592) - (upspeed float :offset-assert 608) - (pitch-off vector :inline :offset-assert 624) - (foot-offset float :offset-assert 640) - (head-offset float :offset-assert 644) - (target-spline tracking-spline :inline :offset-assert 656) - (ease-from vector :inline :offset-assert 2304) - (ease-t float :offset-assert 2320) - (ease-step float :offset-assert 2324) - (ease-to vector :inline :offset-assert 2336) - (outro-curve curve :inline :offset-assert 2352) - (outro-t float :offset-assert 2372) - (outro-t-step float :offset-assert 2376) - (outro-exit-value float :offset-assert 2380) - (water-drip-time time-frame :offset-assert 2384) - (water-drip sparticle-launch-control :offset-assert 2392) - (water-drip-mult float :offset-assert 2396) - (water-drip-speed float :offset-assert 2400) + ((master-options uint32) + (num-slaves int32) + (slave (pointer camera-slave) 2) + (slave-options uint32) + (view-off-param-save float) + (changer uint32) + (cam-entity entity) + (stringMinLength float) + (stringMaxLength float) + (stringMinHeight float) + (stringMaxHeight float) + (string-min cam-vector-seeker :inline) + (string-max cam-vector-seeker :inline) + (string-push-z float) + (stringCliffHeight float) + (no-intro uint32) + (force-blend uint32) + (force-blend-time uint32) + (local-down vector :inline) + (drawable-target handle) + (which-bone int32) + (pov-handle handle) + (pov-bone int32) + (being-attacked symbol) + (attack-start time-frame) + (on-ground symbol) + (under-water int32) + (on-pole symbol) + (tgt-rot-mat matrix :inline) + (tgt-face-mat matrix :inline) + (tpos-old vector :inline) + (tpos-curr vector :inline) + (target-height float) + (tpos-old-adj vector :inline) + (tpos-curr-adj vector :inline) + (tpos-tgt vector :inline) + (upspeed float) + (pitch-off vector :inline) + (foot-offset float) + (head-offset float) + (target-spline tracking-spline :inline) + (ease-from vector :inline) + (ease-t float) + (ease-step float) + (ease-to vector :inline) + (outro-curve curve :inline) + (outro-t float) + (outro-t-step float) + (outro-exit-value float) + (water-drip-time time-frame) + (water-drip sparticle-launch-control) + (water-drip-mult float) + (water-drip-speed float) ) - :heap-base #x900 - :method-count-assert 14 - :size-assert #x964 - :flag-assert #xe09000964 (:states cam-master-active list-keeper-active diff --git a/goal_src/jak1/engine/camera/camera.gc b/goal_src/jak1/engine/camera/camera.gc index 4719a7f740b..690bf34f131 100644 --- a/goal_src/jak1/engine/camera/camera.gc +++ b/goal_src/jak1/engine/camera/camera.gc @@ -343,7 +343,7 @@ ) ) -(defmethod cam-index-method-9 cam-index ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) +(defmethod cam-index-method-9 ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) (local-vars (sv-32 (function _varargs_ object))) (format (clear *cam-res-string*) "~S-flags" arg0) (set! (-> this flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *res-key-string*)))) @@ -419,7 +419,7 @@ #t ) -(defmethod cam-index-method-10 cam-index ((this cam-index) (arg0 vector)) +(defmethod cam-index-method-10 ((this cam-index) (arg0 vector)) (let ((s5-0 (new-stack-vector0))) 0.0 (vector-! s5-0 arg0 (the-as vector (-> this vec))) @@ -438,7 +438,7 @@ ) ) -(defmethod tracking-spline-method-10 tracking-spline ((this tracking-spline) (arg0 vector)) +(defmethod tracking-spline-method-10 ((this tracking-spline) (arg0 vector)) (set! (-> this point 0 position quad) (-> arg0 quad)) (set! (-> this point 0 next) -134250495) (set! (-> this summed-len) 0.0) @@ -462,7 +462,7 @@ (none) ) -(defmethod tracking-spline-method-13 tracking-spline ((this tracking-spline) (arg0 int)) +(defmethod tracking-spline-method-13 ((this tracking-spline) (arg0 int)) (let ((v1-3 (-> this point arg0 next))) (cond ((= v1-3 -134250495) @@ -495,7 +495,7 @@ (none) ) -(defmethod tracking-spline-method-14 tracking-spline ((this tracking-spline) (arg0 tracking-spline-sampler)) +(defmethod tracking-spline-method-14 ((this tracking-spline) (arg0 tracking-spline-sampler)) (let ((v1-0 (-> this used-point))) (set! (-> this partial-point) (-> arg0 partial-pt)) (when (= (-> this next-to-last-point) v1-0) @@ -534,7 +534,7 @@ (none) ) -(defmethod tracking-spline-method-15 tracking-spline ((this tracking-spline)) +(defmethod tracking-spline-method-15 ((this tracking-spline)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'tracking-point))) (set! (-> s5-0 cur-pt) (-> this used-point)) @@ -580,7 +580,7 @@ (none) ) -(defmethod tracking-spline-method-16 tracking-spline ((this tracking-spline) (arg0 float)) +(defmethod tracking-spline-method-16 ((this tracking-spline) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 cur-pt) (-> this used-point)) @@ -618,7 +618,7 @@ (none) ) -(defmethod tracking-spline-method-17 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) +(defmethod tracking-spline-method-17 ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) (let ((s3-0 (-> this free-point)) (s2-0 (-> this end-point)) ) @@ -659,7 +659,7 @@ 0 ) -(defmethod tracking-spline-method-18 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-18 ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (local-vars (f0-4 float)) (when (not arg2) (set! arg2 (new 'stack-no-clear 'tracking-spline-sampler)) @@ -701,13 +701,13 @@ (the-as vector #f) ) -(defmethod tracking-spline-method-19 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-19 ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (vector-reset! arg1) (tracking-spline-method-18 this arg0 arg1 arg2) arg1 ) -(defmethod tracking-spline-method-20 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 int)) +(defmethod tracking-spline-method-20 ((this tracking-spline) (arg0 vector) (arg1 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-! s3-0 @@ -795,7 +795,7 @@ (none) ) -(defmethod tracking-spline-method-21 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod tracking-spline-method-21 ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float)) (let ((v1-0 (-> this used-point)) (f0-0 (-> this partial-point)) ) @@ -843,7 +843,7 @@ arg0 ) -(defmethod tracking-spline-method-22 tracking-spline ((this tracking-spline) (arg0 float)) +(defmethod tracking-spline-method-22 ((this tracking-spline) (arg0 float)) (when (< arg0 (-> this summed-len)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) @@ -858,7 +858,7 @@ (none) ) -(defmethod tracking-spline-method-9 tracking-spline ((this tracking-spline)) +(defmethod tracking-spline-method-9 ((this tracking-spline)) (let ((v1-0 (-> this used-point)) (s4-0 0) (s5-0 0) diff --git a/goal_src/jak1/engine/camera/pov-camera-h.gc b/goal_src/jak1/engine/camera/pov-camera-h.gc index faedaaed5f7..ae355597c35 100644 --- a/goal_src/jak1/engine/camera/pov-camera-h.gc +++ b/goal_src/jak1/engine/camera/pov-camera-h.gc @@ -22,30 +22,28 @@ ;; for example, the introduction to orbs in geyser, or the camera that shows you where the steps to fire canyon ;; are. (deftype pov-camera (process-drawable) - ((cspace-array cspace-array :offset 112) - (flags pov-camera-flag :offset-assert 176) - (debounce-start-time time-frame :offset-assert 184) - (notify-handle handle :offset-assert 192) - (anim-name string :offset-assert 200) - (command-list pair :offset-assert 204) - (mask-to-clear process-mask :offset-assert 208) - (music-volume-movie float :offset-assert 212) - (sfx-volume-movie float :offset-assert 216) + ((cspace-array cspace-array :overlay-at root) + (flags pov-camera-flag) + (debounce-start-time time-frame) + (notify-handle handle) + (anim-name string) + (command-list pair) + (mask-to-clear process-mask) + (music-volume-movie float) + (sfx-volume-movie float) ) - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc + (:state-methods + pov-camera-abort + pov-camera-done-playing + pov-camera-playing + pov-camera-start-playing + pov-camera-startup + ) (:methods - (pov-camera-abort () _type_ :state 20) - (pov-camera-done-playing () _type_ :state 21) - (pov-camera-playing () _type_ :state 22) - (pov-camera-start-playing () _type_ :state 23) - (pov-camera-startup () _type_ :state 24) - (check-for-abort (_type_) symbol 25) - (target-grabbed? (_type_) symbol 26) - (pre-startup-callback (_type_) none 27) - (target-released? () symbol 28) - (set-stack-size! (_type_) none 29) + (check-for-abort (_type_) symbol) + (target-grabbed? (_type_) symbol) + (pre-startup-callback (_type_) none) + (target-released? (_type_) symbol) + (set-stack-size! (_type_) none) ) ) diff --git a/goal_src/jak1/engine/camera/pov-camera.gc b/goal_src/jak1/engine/camera/pov-camera.gc index 03c35b1b1c6..f9a26a3d10f 100644 --- a/goal_src/jak1/engine/camera/pov-camera.gc +++ b/goal_src/jak1/engine/camera/pov-camera.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod check-for-abort pov-camera ((this pov-camera)) +(defmethod check-for-abort ((this pov-camera)) (when (or (and (time-elapsed? (-> this debounce-start-time) (seconds 0.2)) (cpad-pressed? 0 triangle)) (logtest? (-> this flags) (pov-camera-flag allow-abort)) ) @@ -20,11 +20,11 @@ ) ) -(defmethod target-grabbed? pov-camera ((this pov-camera)) +(defmethod target-grabbed? ((this pov-camera)) (or (not *target*) (process-grab? *target*)) ) -(defmethod target-released? pov-camera () +(defmethod target-released? ((this pov-camera)) (or (not *target*) (process-release? *target*)) ) @@ -148,7 +148,7 @@ (defstate pov-camera-done-playing (pov-camera) :virtual #t :code (behavior () - (while (begin self (not ((method-of-object self target-released?)))) + (while (not (target-released? self)) (suspend) ) (send-event (handle->process (-> self notify-handle)) 'notify 'die) @@ -159,12 +159,12 @@ ) ) -(defmethod pre-startup-callback pov-camera ((this pov-camera)) +(defmethod pre-startup-callback ((this pov-camera)) 0 (none) ) -(defmethod set-stack-size! pov-camera ((this pov-camera)) +(defmethod set-stack-size! ((this pov-camera)) (none) ) diff --git a/goal_src/jak1/engine/collide/collide-cache-h.gc b/goal_src/jak1/engine/collide/collide-cache-h.gc index be72f16a676..9062ddbd61e 100644 --- a/goal_src/jak1/engine/collide/collide-cache-h.gc +++ b/goal_src/jak1/engine/collide/collide-cache-h.gc @@ -16,56 +16,44 @@ ;;;;;;;;;;;;;;;;;;;;;;; (deftype collide-using-spheres-params (structure) - ((spheres (inline-array sphere) :offset-assert 0) - (num-spheres uint32 :offset-assert 4) - (collide-with collide-kind :offset-assert 8) - (proc process-drawable :offset-assert 16) - (ignore-pat pat-surface :offset-assert 20) - (solid-only basic :offset-assert 24) + ((spheres (inline-array sphere)) + (num-spheres uint32) + (collide-with collide-kind) + (proc process-drawable) + (ignore-pat pat-surface) + (solid-only basic) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; primitive using sphere-sphere (deftype collide-puss-sphere (structure) - ((bsphere sphere :inline :offset-assert 0) - (bbox4w bounding-box4w :inline :offset-assert 16) + ((bsphere sphere :inline) + (bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype collide-puss-work (structure) - ((closest-pt vector :inline :offset-assert 0) - (tri-normal vector :inline :offset-assert 16) - (tri-bbox4w bounding-box4w :inline :offset-assert 32) - (spheres-bbox4w bounding-box4w :inline :offset-assert 64) - (spheres collide-puss-sphere 64 :inline :offset-assert 96) + ((closest-pt vector :inline) + (tri-normal vector :inline) + (tri-bbox4w bounding-box4w :inline) + (spheres-bbox4w bounding-box4w :inline) + (spheres collide-puss-sphere 64 :inline) ) - :method-count-assert 11 - :size-assert #xc60 - :flag-assert #xb00000c60 (:methods - (collide-puss-work-method-9 (_type_ object object) symbol 9) - (collide-puss-work-method-10 (_type_ object object) symbol 10) + (collide-puss-work-method-9 (_type_ object object) symbol) + (collide-puss-work-method-10 (_type_ object object) symbol) ) ) ;; primitive using y probe (deftype collide-puyp-work (structure) - ((best-u float :offset-assert 0) - (ignore-pat pat-surface :offset-assert 4) - (tri-out collide-tri-result :offset-assert 8) - (start-pos vector :inline :offset-assert 16) - (move-dist vector :inline :offset-assert 32) + ((best-u float) + (ignore-pat pat-surface) + (tri-out collide-tri-result) + (start-pos vector :inline) + (move-dist vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;;;;;;;;;;;;;;;;;;;;;;; @@ -75,116 +63,98 @@ ;; The triangles stored in the cache. ;; This is a common return type of collision queries. (deftype collide-cache-tri (structure) - ((vertex vector 3 :inline :offset-assert 0) ;; actual locations - (extra-quad uint128 :offset 48) - (pat pat-surface :offset 48) ;; metadata about the surface of this tri - (prim-index uint16 :offset 52) ;; in the collide-cache-prim list - (user16 uint16 :offset 54) - (user32 uint32 2 :offset 56) + ((vertex vector 3 :inline) ;; actual locations + (extra-quad uint128 :offset 48) + (pat pat-surface :overlay-at extra-quad) ; metadata about the surface of this tri + (prim-index uint16 :offset 52) ; in the collide-cache-prim list + (user16 uint16 :offset 54) + (user32 uint32 2 :offset 56) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; The primitives stored in the cache. ;; The "core" is extracted from the normal collide-shape-prim and placed inline here. (deftype collide-cache-prim (structure) - ((prim-core collide-prim-core :inline :offset-assert 0) - (extra-quad uint128 :offset-assert 32) - (ccache collide-cache :offset 32) - (prim collide-shape-prim :offset 36) - (first-tri uint16 :offset 40) - (num-tris uint16 :offset 42) - (unused uint8 4 :offset 44) - (world-sphere vector :inline :offset 0) - (collide-as collide-kind :offset 16) - (action collide-action :offset 24) - (offense collide-offense :offset 28) - (prim-type int8 :offset 29) + ((prim-core collide-prim-core :inline) + (extra-quad uint128) + (ccache collide-cache :overlay-at extra-quad) + (prim collide-shape-prim :offset 36) + (first-tri uint16 :offset 40) + (num-tris uint16 :offset 42) + (unused uint8 4 :offset 44) + (world-sphere vector :inline :overlay-at (-> prim-core world-sphere)) + (collide-as collide-kind :overlay-at (-> prim-core collide-as)) + (action collide-action :overlay-at (-> prim-core action)) + (offense collide-offense :overlay-at (-> prim-core offense)) + (prim-type int8 :overlay-at (-> prim-core prim-type)) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float 9) - (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float 10) + (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float) + (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float) ) ) ;; The actual cache! (deftype collide-cache (basic) - ((num-tris int32 :offset-assert 4) - (num-prims int32 :offset-assert 8) - (num-prims-u uint32 :offset 8) - (ignore-mask pat-surface :offset-assert 12) - (proc process-drawable :offset-assert 16) ;; types: target - (collide-box bounding-box :inline :offset-assert 32) - (collide-box4w bounding-box4w :inline :offset-assert 64) - (collide-with collide-kind :offset-assert 96) - (prims collide-cache-prim 100 :inline :offset-assert 112) - (tris collide-cache-tri 461 :inline :offset-assert 4912) + ((num-tris int32) + (num-prims int32) + (num-prims-u uint32 :overlay-at num-prims) + (ignore-mask pat-surface) + (proc process-drawable) + (collide-box bounding-box :inline) + (collide-box4w bounding-box4w :inline) + (collide-with collide-kind) + (prims collide-cache-prim 100 :inline) + (tris collide-cache-tri 461 :inline) ) - :method-count-assert 33 - :size-assert #x8670 - :flag-assert #x2100008670 (:methods - (debug-draw (_type_) none 9) - (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float 10) - (fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol 11) - (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float 12) - (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none 13) - (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none 14) - (fill-using-spheres (_type_ collide-using-spheres-params) none 15) - (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none 16) - (initialize (_type_) none 17) - (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float 18) - (probe-using-spheres (_type_ collide-using-spheres-params) symbol 19) - (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20) - (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21) ;; second functiom is method 28 - (fill-from-foreground-using-box (_type_) none 22) - (fill-from-foreground-using-line-sphere (_type_) none 23) - (fill-from-foreground-using-y-probe (_type_) none 24) - (fill-from-water (_type_ water-control) none 25) ;; or whatever is from 152 in the process passed to 16 - (load-mesh-from-spad-in-box (_type_ collide-frag-mesh) none 26) - (collide-cache-method-27 (_type_) none 27) - (collide-cache-method-28 (_type_) none 28) - (collide-cache-method-29 (_type_ collide-frag-mesh) none 29) - (puyp-mesh (_type_ collide-puyp-work collide-cache-prim) none 30) - (puyp-sphere (_type_ collide-puyp-work collide-cache-prim) vector 31) - (unpack-background-collide-mesh (_type_ object object object) none 32) ;; helper for fill from background. + (debug-draw (_type_) none) + (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float) + (fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol) + (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float) + (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none) + (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none) + (fill-using-spheres (_type_ collide-using-spheres-params) none) + (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none) + (initialize (_type_) none) + (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float) + (probe-using-spheres (_type_ collide-using-spheres-params) symbol) + (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float) + (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none) + (fill-from-foreground-using-box (_type_) none) + (fill-from-foreground-using-line-sphere (_type_) none) + (fill-from-foreground-using-y-probe (_type_) none) + (fill-from-water (_type_ water-control) none) + (load-mesh-from-spad-in-box (_type_ collide-frag-mesh) none) + (collide-cache-method-27 (_type_) none) + (collide-cache-method-28 (_type_) none) + (collide-cache-method-29 (_type_ collide-frag-mesh) none) + (puyp-mesh (_type_ collide-puyp-work collide-cache-prim) none) + (puyp-sphere (_type_ collide-puyp-work collide-cache-prim) vector) + (unpack-background-collide-mesh (_type_ object object object) none) ) ) (deftype collide-list-item (structure) - ((mesh collide-frag-mesh :offset-assert 0) - (inst basic :offset-assert 4) + ((mesh collide-frag-mesh) + (inst basic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype collide-list (structure) - ((num-items int32 :offset-assert 0) - (items collide-list-item 256 :inline :offset-assert 16) + ((num-items int32) + (items collide-list-item 256 :inline) ) - :method-count-assert 9 - :size-assert #x1010 - :flag-assert #x900001010 ) (deftype collide-work (structure) - ((collide-sphere-neg-r sphere :inline :offset-assert 0) - (collide-box4w bounding-box4w :inline :offset-assert 16) - (inv-mat matrix :inline :offset-assert 48) + ((collide-sphere-neg-r sphere :inline) + (collide-box4w bounding-box4w :inline) + (inv-mat matrix :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) diff --git a/goal_src/jak1/engine/collide/collide-edge-grab-h.gc b/goal_src/jak1/engine/collide/collide-edge-grab-h.gc index 041da28c90f..7946310dd59 100644 --- a/goal_src/jak1/engine/collide/collide-edge-grab-h.gc +++ b/goal_src/jak1/engine/collide/collide-edge-grab-h.gc @@ -16,80 +16,65 @@ ;; DECOMP BEGINS (deftype edge-grab-info (structure) - ((world-vertex vector 6 :inline :offset-assert 0) - (local-vertex vector 6 :inline :offset-assert 96) - (actor-cshape-prim-offset int32 :offset-assert 192) - (actor-handle handle :offset-assert 200) - (hanging-matrix matrix :inline :offset-assert 208) - (edge-vertex vector 2 :inline :offset 0) - (center-hold vector :inline :offset 32) - (tri-vertex vector 3 :inline :offset 48) - (left-hand-hold vector :inline :offset-assert 272) - (right-hand-hold vector :inline :offset-assert 288) - (center-hold-old vector :inline :offset-assert 304) - (edge-tri-pat uint32 :offset-assert 320) + ((world-vertex vector 6 :inline) + (local-vertex vector 6 :inline) + (actor-cshape-prim-offset int32) + (actor-handle handle) + (hanging-matrix matrix :inline) + (edge-vertex vector 2 :inline :overlay-at (-> world-vertex 0)) + (center-hold vector :inline :overlay-at (-> world-vertex 2)) + (tri-vertex vector 3 :inline :overlay-at (-> world-vertex 3)) + (left-hand-hold vector :inline) + (right-hand-hold vector :inline) + (center-hold-old vector :inline) + (edge-tri-pat uint32) ) - :method-count-assert 11 - :size-assert #x144 - :flag-assert #xb00000144 (:methods - (edge-grab-info-method-9 (_type_) symbol 9) - (debug-draw (_type_) symbol 10) + (edge-grab-info-method-9 (_type_) symbol) + (debug-draw (_type_) symbol) ) ) ;; og:preserve-this (declare-type collide-cache-tri structure) (deftype collide-edge-tri (structure) - ((ctri collide-cache-tri :offset-assert 0) - (normal vector :inline :offset-assert 16) + ((ctri collide-cache-tri) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype collide-edge-edge (structure) - ((ignore basic :offset-assert 0) - (etri collide-edge-tri :offset-assert 4) - (vertex-ptr (inline-array vector) 2 :offset-assert 8) - (outward vector :inline :offset-assert 16) - (edge-vec-norm vector :inline :offset-assert 32) + ((ignore basic) + (etri collide-edge-tri) + (vertex-ptr (inline-array vector) 2) + (outward vector :inline) + (edge-vec-norm vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype collide-edge-hold-item (structure) - ((next collide-edge-hold-item :offset-assert 0) - (rating float :offset-assert 4) - (split int8 :offset-assert 8) - (edge collide-edge-edge :offset-assert 12) - (center-pt vector :inline :offset-assert 16) - (outward-pt vector :inline :offset-assert 32) + ((next collide-edge-hold-item) + (rating float) + (split int8) + (edge collide-edge-edge) + (center-pt vector :inline) + (outward-pt vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype collide-edge-hold-list (structure) - ((num-allocs uint32 :offset-assert 0) - (num-attempts uint32 :offset-assert 4) - (head collide-edge-hold-item :offset-assert 8) - (items collide-edge-hold-item 32 :inline :offset-assert 16) - (attempts qword 32 :inline :offset-assert 1552) + ((num-allocs uint32) + (num-attempts uint32) + (head collide-edge-hold-item) + (items collide-edge-hold-item 32 :inline) + (attempts qword 32 :inline) ) - :method-count-assert 11 - :size-assert #x810 - :flag-assert #xb00000810 (:methods - (debug-draw (_type_) object 9) - (add-to-list! (_type_ collide-edge-hold-item) none 10) + (debug-draw (_type_) object) + (add-to-list! (_type_ collide-edge-hold-item) none) ) ) @@ -97,48 +82,45 @@ (declare-type collide-cache basic) (declare-type collide-shape basic) (deftype collide-edge-work (structure) - ((ccache collide-cache :offset-assert 0) - (cshape collide-shape :offset-assert 4) - (num-verts uint32 :offset-assert 8) - (num-edges uint32 :offset-assert 12) - (num-tris uint32 :offset-assert 16) - (cache-fill-box bounding-box :inline :offset-assert 32) - (within-reach-box bounding-box :inline :offset-assert 64) - (within-reach-box4w bounding-box4w :inline :offset-assert 96) - (search-pt vector :inline :offset-assert 128) - (search-dir-vec vector :inline :offset-assert 144) - (max-dist-sqrd-to-outward-pt float :offset-assert 160) - (max-dir-cosa-delta float :offset-assert 164) - (split-dists float 2 :offset-assert 168) - (outward-offset vector :inline :offset-assert 176) - (local-cache-fill-box bounding-box :inline :offset-assert 192) - (local-within-reach-box bounding-box :inline :offset-assert 224) - (local-player-spheres sphere 12 :inline :offset-assert 256) - (world-player-spheres sphere 12 :inline :offset-assert 448) - (local-player-hanging-spheres sphere 6 :inline :offset 256) - (world-player-hanging-spheres sphere 6 :inline :offset 448) - (local-player-leap-up-spheres sphere 6 :inline :offset 352) - (world-player-leap-up-spheres sphere 6 :inline :offset 544) - (verts vector 64 :inline :offset-assert 640) - (edges collide-edge-edge 96 :inline :offset-assert 1664) - (tris collide-edge-tri 48 :inline :offset-assert 6272) - (hold-list collide-edge-hold-list :inline :offset-assert 7808) + ((ccache collide-cache) + (cshape collide-shape) + (num-verts uint32) + (num-edges uint32) + (num-tris uint32) + (cache-fill-box bounding-box :inline) + (within-reach-box bounding-box :inline) + (within-reach-box4w bounding-box4w :inline) + (search-pt vector :inline) + (search-dir-vec vector :inline) + (max-dist-sqrd-to-outward-pt float) + (max-dir-cosa-delta float) + (split-dists float 2) + (outward-offset vector :inline) + (local-cache-fill-box bounding-box :inline) + (local-within-reach-box bounding-box :inline) + (local-player-spheres sphere 12 :inline) + (world-player-spheres sphere 12 :inline) + (local-player-hanging-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 0)) + (world-player-hanging-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 0)) + (local-player-leap-up-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 6)) + (world-player-leap-up-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 6)) + (verts vector 64 :inline) + (edges collide-edge-edge 96 :inline) + (tris collide-edge-tri 48 :inline) + (hold-list collide-edge-hold-list :inline) ) - :method-count-assert 20 - :size-assert #x2690 - :flag-assert #x1400002690 (:methods - (search-for-edges (_type_ collide-edge-hold-list) symbol 9) - (debug-draw-edges (_type_) object 10) - (debug-draw-tris (_type_) none 11) - (debug-draw-sphere (_type_) symbol 12) - (compute-center-point! (_type_ collide-edge-edge vector) float 13) - (collide-edge-work-method-14 (_type_ vector vector int) float 14) - (find-grabbable-edges! (_type_) none 15) - (find-grabbable-tris! (_type_) none 16) - (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol 17) - (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol 18) - (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol 19) + (search-for-edges (_type_ collide-edge-hold-list) symbol) + (debug-draw-edges (_type_) object) + (debug-draw-tris (_type_) none) + (debug-draw-sphere (_type_) symbol) + (compute-center-point! (_type_ collide-edge-edge vector) float) + (collide-edge-work-method-14 (_type_ vector vector int) float) + (find-grabbable-edges! (_type_) none) + (find-grabbable-tris! (_type_) none) + (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol) + (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol) + (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol) ) ) diff --git a/goal_src/jak1/engine/collide/collide-edge-grab.gc b/goal_src/jak1/engine/collide/collide-edge-grab.gc index 2d484ab8d08..468f60ecf00 100644 --- a/goal_src/jak1/engine/collide/collide-edge-grab.gc +++ b/goal_src/jak1/engine/collide/collide-edge-grab.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod find-edge-grabs! target ((this target) (arg0 collide-cache)) +(defmethod find-edge-grabs! ((this target) (arg0 collide-cache)) "Main edge grabbing method. Will populate *edge-grab-info* and send *target* an 'edge-grab event if successful." (rlet ((vf1 :class vf) @@ -90,7 +90,7 @@ ) ) -(defmethod search-for-edges collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-list)) +(defmethod search-for-edges ((this collide-edge-work) (arg0 collide-edge-hold-list)) "Iterate through edges, adding them to the collide-edge-hold-list, if they are good" ;; reset edge list. (set! (-> arg0 num-allocs) (the-as uint 0)) @@ -125,20 +125,17 @@ (defmethod-mips2c "(method 10 collide-edge-hold-list)" 10 collide-edge-hold-list) (deftype pbhp-stack-vars (structure) - ((edge collide-edge-edge :offset-assert 0) - (allocated basic :offset-assert 4) - (neg-hold-pt vector :inline :offset-assert 16) - (split-vec vector :inline :offset-assert 32) + ((edge collide-edge-edge) + (allocated basic) + (neg-hold-pt vector :inline) + (split-vec vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (defmethod-mips2c "(method 18 collide-edge-work)" 18 collide-edge-work) -(defmethod check-grab-for-collisions collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) +(defmethod check-grab-for-collisions ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) (local-vars (sv-144 (function vector vector vector float vector)) (sv-160 vector) (sv-176 vector)) (let* ((s3-0 (-> arg0 edge)) (s1-0 (-> s3-0 etri ctri)) @@ -231,7 +228,7 @@ #t ) -(defmethod edge-grab-info-method-9 edge-grab-info ((this edge-grab-info)) +(defmethod edge-grab-info-method-9 ((this edge-grab-info)) (local-vars (v0-0 symbol) (v1-14 int)) (rlet ((acc :class vf) (Q :class vf) @@ -366,7 +363,7 @@ (defmethod-mips2c "(method 16 collide-edge-work)" 16 collide-edge-work) (defmethod-mips2c "(method 15 collide-edge-work)" 15 collide-edge-work) -(defmethod collide-edge-work-method-14 collide-edge-work ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod collide-edge-work-method-14 ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) (let ((f30-0 -1.0)) (let ((s2-0 (new 'stack-no-clear 'vector))) (dotimes (s1-0 (the-as int (-> this num-edges))) @@ -482,7 +479,7 @@ ) ) -(defmethod compute-center-point! collide-edge-work ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) +(defmethod compute-center-point! ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) (local-vars (v0-0 float) (v1-1 float) (v1-2 float) (v1-3 float)) (rlet ((Q :class vf) (vf0 :class vf) @@ -550,7 +547,7 @@ ) -(defmethod debug-draw edge-grab-info ((this edge-grab-info)) +(defmethod debug-draw ((this edge-grab-info)) (add-debug-line #t (bucket-id debug-no-zbuf) @@ -603,7 +600,7 @@ ) ) -(defmethod debug-draw-edges collide-edge-work ((this collide-edge-work)) +(defmethod debug-draw-edges ((this collide-edge-work)) (let ((gp-0 0)) (dotimes (s4-0 (the-as int (-> this num-edges))) (let* ((s3-0 (-> this edges s4-0)) @@ -652,7 +649,7 @@ ) ) -(defmethod debug-draw-sphere collide-edge-work ((this collide-edge-work)) +(defmethod debug-draw-sphere ((this collide-edge-work)) (dotimes (s5-0 (the-as int (-> this num-verts))) (let ((a2-0 (-> this verts s5-0))) (add-debug-sphere #t (bucket-id debug-no-zbuf) a2-0 819.2 (new 'static 'rgba :r #xff :g #xff :a #x80)) @@ -661,7 +658,7 @@ #f ) -(defmethod debug-draw collide-edge-hold-list ((this collide-edge-hold-list)) +(defmethod debug-draw ((this collide-edge-hold-list)) (let ((s4-0 (-> this head)) (s5-0 0) ) @@ -713,7 +710,7 @@ (format *stdcon* "hold list has ~D attempt(s)~%" (-> this num-attempts)) ) -(defmethod debug-draw-tris collide-edge-work ((this collide-edge-work)) +(defmethod debug-draw-tris ((this collide-edge-work)) (dotimes (s5-0 (the-as int (-> this num-tris))) (let* ((v1-3 (-> this tris s5-0 ctri)) (t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-3 pat mode) color) a 64)) diff --git a/goal_src/jak1/engine/collide/collide-frag-h.gc b/goal_src/jak1/engine/collide/collide-frag-h.gc index 2efcc56913e..e598a06efb3 100644 --- a/goal_src/jak1/engine/collide/collide-frag-h.gc +++ b/goal_src/jak1/engine/collide/collide-frag-h.gc @@ -22,47 +22,37 @@ (deftype collide-frag-vertex (vector) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype collide-frag-mesh (basic) - ((packed-data uint32 :offset-assert 4) - (pat-array uint32 :offset-assert 8) - (strip-data-len uint16 :offset-assert 12) - (poly-count uint16 :offset-assert 14) - (base-trans vector :inline :offset-assert 16) - (vertex-count uint8 :offset 28) - (vertex-data-qwc uint8 :offset 29) - (total-qwc uint8 :offset 30) - (unused uint8 :offset 31) + ((packed-data uint32) + (pat-array uint32) + (strip-data-len uint16) + (poly-count uint16) + (base-trans vector :inline) + (vertex-count uint8 :overlay-at (-> base-trans w)) + (vertex-data-qwc uint8 :offset 29) + (total-qwc uint8 :offset 30) + (unused uint8 :offset 31) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype collide-fragment (drawable) - ((mesh collide-frag-mesh :offset 8) + ((mesh collide-frag-mesh :offset 8) ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 ) + (deftype drawable-inline-array-collide-fragment (drawable-inline-array) - ((data collide-fragment 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 64) + ((data collide-fragment 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x44 - :flag-assert #x1200000044 ) + (deftype drawable-tree-collide-fragment (drawable-tree) - ((data-override drawable-inline-array :offset 32)) - :method-count-assert #x12 - :size-assert #x24 - :flag-assert #x1200000024 - ) \ No newline at end of file + ((data-override drawable-inline-array :overlay-at (-> data 0)) + ) + ) diff --git a/goal_src/jak1/engine/collide/collide-frag.gc b/goal_src/jak1/engine/collide/collide-frag.gc index 651f9b7a23f..185cd312895 100644 --- a/goal_src/jak1/engine/collide/collide-frag.gc +++ b/goal_src/jak1/engine/collide/collide-frag.gc @@ -5,15 +5,15 @@ ;; name in dgo: collide-frag ;; dgos: GAME, ENGINE -;; DECOMP BEGINS - ;; This file contains the drawable-tree implementation for collide-fragment -(defmethod login drawable-tree-collide-fragment ((this drawable-tree-collide-fragment)) +;; DECOMP BEGINS + +(defmethod login ((this drawable-tree-collide-fragment)) this ) -(defmethod draw drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) "Note: this doesn't do anything (sadly)" (when *display-render-collision* (dotimes (s4-0 (-> this length)) @@ -24,30 +24,30 @@ (none) ) -(defmethod unpack-vis drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) -(defmethod collide-with-box drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) "Collide everything in the tree with a box. Length arg doesn't matter here." (collide-with-box (-> this data-override) (-> this length) arg1) 0 (none) ) -(defmethod collide-y-probe drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-y-probe (-> this data-override) (-> this length) arg1) 0 (none) ) -(defmethod collide-ray drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-ray (-> this data-override) (-> this length) arg1) 0 (none) ) -(defmethod mem-usage collide-fragment ((this collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-fragment) (arg0 memory-usage-block) (arg1 int)) (let ((s5-0 (if (logtest? arg1 1) 53 50 @@ -79,11 +79,11 @@ ) ) -(defmethod login drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment)) +(defmethod login ((this drawable-inline-array-collide-fragment)) this ) -(defmethod draw collide-fragment ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) +(defmethod draw ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) ;; if we wanted to draw collide-fragment's we'd do it here. ; (when (< (-> this bsphere w) (meters 22.)) ; (format 0 "sp: ~m : ~D~%" (-> this bsphere w) (-> this mesh poly-count)) @@ -98,13 +98,14 @@ ; ;(add-debug-sphere #t (bucket-id debug) (-> this bsphere) (-> this bsphere w) (new 'static 'rgba :r #x80 :a #x80)) ; ) ;; (add-debug-point #t (bucket-id debug) (-> this bsphere)) + 0 (none) ) -(defmethod draw drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) - (arg0 drawable-inline-array-collide-fragment) - (arg1 display-frame) - ) +(defmethod draw ((this drawable-inline-array-collide-fragment) + (arg0 drawable-inline-array-collide-fragment) + (arg1 display-frame) + ) (dotimes (s4-0 (-> this length)) (let ((s3-0 (-> this data s4-0))) (if (sphere-cull (-> s3-0 bsphere)) @@ -116,25 +117,25 @@ (none) ) -(defmethod collide-with-box drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-with-box (the-as collide-fragment (-> this data)) (-> this length) arg1) 0 (none) ) -(defmethod collide-y-probe drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-y-probe (the-as collide-fragment (-> this data)) (-> this length) arg1) 0 (none) ) -(defmethod collide-ray drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-ray (the-as collide-fragment (-> this data)) (-> this length) arg1) 0 (none) ) -(defmethod mem-usage drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) diff --git a/goal_src/jak1/engine/collide/collide-mesh-h.gc b/goal_src/jak1/engine/collide/collide-mesh-h.gc index 11f7b81bfc6..2ce76f04d8c 100644 --- a/goal_src/jak1/engine/collide/collide-mesh-h.gc +++ b/goal_src/jak1/engine/collide/collide-mesh-h.gc @@ -17,14 +17,11 @@ ;; The triangle involved in collision ;; Note: this is reused for the background collision system. (deftype collide-tri-result (structure) - ((vertex vector 3 :inline :offset-assert 0) - (intersect vector :inline :offset-assert 48) - (normal vector :inline :offset-assert 64) - (pat pat-surface :offset-assert 80) + ((vertex vector 3 :inline) + (intersect vector :inline) + (normal vector :inline) + (pat pat-surface) ) - :method-count-assert 9 - :size-assert #x54 - :flag-assert #x900000054 ) ;;;;;;;;;;;;;;;;;;;; @@ -35,14 +32,11 @@ ;; The vertex indices index into the collide-mesh vertex-data array. ;; Due to using uint8's you only get 256 vertices. (deftype collide-mesh-tri (structure) - ((vertex-index uint8 3 :offset-assert 0) - (unused uint8 :offset-assert 3) - (pat pat-surface :offset-assert 4) + ((vertex-index uint8 3) + (unused uint8) + (pat pat-surface) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; og:preserve-this @@ -50,23 +44,20 @@ ;; A collision mesh. Note that's it's bound to a specific joint. (deftype collide-mesh (basic) - ((joint-id int32 :offset-assert 4) - (num-tris uint32 :offset-assert 8) - (num-verts uint32 :offset-assert 12) - (vertex-data (inline-array vector) :offset-assert 16) - (tris collide-mesh-tri 1 :inline :offset 32) + ((joint-id int32) + (num-tris uint32) + (num-verts uint32) + (vertex-data (inline-array vector)) + (tris collide-mesh-tri 1 :inline :offset 32) ) - :method-count-assert 16 - :size-assert #x28 - :flag-assert #x1000000028 (:methods - (debug-draw-tris (_type_ process-drawable int) none 9) - (overlap-test (_type_ collide-mesh-cache-tri vector) symbol 10) - (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 11) ;; spat - (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 12) ;; sopt - (populate-cache! (_type_ collide-mesh-cache-tri matrix) none 13) - (collide-mesh-math-1 (_type_ object object) none 14) - (collide-mesh-math-2 (_type_ object object object) none 15) + (debug-draw-tris (_type_ process-drawable int) none) + (overlap-test (_type_ collide-mesh-cache-tri vector) symbol) + (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (populate-cache! (_type_ collide-mesh-cache-tri matrix) none) + (collide-mesh-math-1 (_type_ object object) none) + (collide-mesh-math-2 (_type_ object object object) none) ) ) @@ -84,18 +75,15 @@ (defconstant COLLIDE_MESH_CACHE_SIZE #xa000) (deftype collide-mesh-cache (basic) - ((used-size uint32 :offset-assert 4) - (max-size uint32 :offset-assert 8) - (id uint64 :offset-assert 16) - (data uint8 40960 :offset 32) + ((used-size uint32) + (max-size uint32) + (id uint64) + (data uint8 40960 :offset 32) ) - :method-count-assert 12 - :size-assert #xa020 - :flag-assert #xc0000a020 (:methods - (allocate! (_type_ int) int 9) - (is-id? (_type_ int) symbol 10) - (next-id! (_type_) uint 11) + (allocate! (_type_ int) int) + (is-id? (_type_ int) symbol) + (next-id! (_type_) uint) ) ) @@ -121,21 +109,18 @@ ) ) -(defmethod is-id? collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) +(defmethod is-id? ((this collide-mesh-cache) (arg0 int)) "Is this our id?" (= (-> this id) arg0) ) ;; possibly this is stored in the data of the collide-mesh-cache (deftype collide-mesh-cache-tri (structure) - ((vertex vector 3 :inline :offset-assert 0) - (normal vector :inline :offset-assert 48) - (bbox4w bounding-box4w :inline :offset-assert 64) - (pat pat-surface :offset 60) + ((vertex vector 3 :inline) + (normal vector :inline) + (bbox4w bounding-box4w :inline) + (pat pat-surface :overlay-at (-> normal w)) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; only allocate if we don't have an existing one. diff --git a/goal_src/jak1/engine/collide/collide-mesh.gc b/goal_src/jak1/engine/collide/collide-mesh.gc index 72d3fca71ff..f18ac8318c9 100644 --- a/goal_src/jak1/engine/collide/collide-mesh.gc +++ b/goal_src/jak1/engine/collide/collide-mesh.gc @@ -7,12 +7,12 @@ ;; DECOMP BEGINS -(defmethod asize-of collide-mesh ((this collide-mesh)) +(defmethod asize-of ((this collide-mesh)) "Compute the size in memory of a collide-mesh. Somehow this only counts num-tris and not verts." (the-as int (+ (-> collide-mesh size) (* (+ (-> this num-tris) -1) 8))) ) -(defmethod mem-usage collide-mesh ((this collide-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-mesh) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a collide-mesh." (set! (-> arg0 length) (max 79 (-> arg0 length))) (set! (-> arg0 data 78 name) "collide-mesh") @@ -31,7 +31,7 @@ (the-as collide-mesh 0) ) -(defmethod debug-draw-tris collide-mesh ((this collide-mesh) (arg0 process-drawable) (arg1 int)) +(defmethod debug-draw-tris ((this collide-mesh) (arg0 process-drawable) (arg1 int)) "Draw a collide-mesh." (rlet ((acc :class vf) (vf0 :class vf) @@ -87,32 +87,28 @@ ) (deftype sopt-work (structure) - ((intersect vector :inline :offset-assert 0) - (sphere-bbox4w bounding-box4w :inline :offset-assert 16) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) -(defmethod-mips2c "(method 12 collide-mesh)" 12 collide-mesh) +(defmethod-mips2c "(method 12 collide-mesh)" 12 collide-mesh) (deftype spat-work (structure) - ((intersect vector :inline :offset-assert 0) - (sphere-bbox4w bounding-box4w :inline :offset-assert 16) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (defmethod-mips2c "(method 11 collide-mesh)" 11 collide-mesh) (defmethod-mips2c "(method 14 collide-mesh)" 14 collide-mesh) + (defmethod-mips2c "(method 15 collide-mesh)" 15 collide-mesh) -(defmethod allocate! collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) +(defmethod allocate! ((this collide-mesh-cache) (arg0 int)) (local-vars (a1-2 int) (a2-2 int)) (let* ((v1-0 (+ arg0 15)) (a1-1 (-> this used-size)) @@ -146,7 +142,7 @@ ) ) -(defmethod populate-cache! collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 matrix)) +(defmethod populate-cache! ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 matrix)) (local-vars (t0-2 uint)) (rlet ((acc :class vf) (Q :class vf) @@ -314,8 +310,14 @@ ) ) +(deftype oot-work (structure) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) + ) + ) + -(defmethod overlap-test collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) +(defmethod overlap-test ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) (local-vars (zero uint128) (v1-0 uint128) diff --git a/goal_src/jak1/engine/collide/collide-probe.gc b/goal_src/jak1/engine/collide/collide-probe.gc index 789a7ffdfbe..17e29bfc3c3 100644 --- a/goal_src/jak1/engine/collide/collide-probe.gc +++ b/goal_src/jak1/engine/collide/collide-probe.gc @@ -136,20 +136,15 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftype collide-probe-stack-elem (structure) - ((child uint32 :offset-assert 0) - (count uint32 :offset-assert 4) + ((child uint32) + (count uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype collide-probe-stack (structure) - ((data collide-probe-stack-elem 1024 :inline :offset-assert 0) + ((data collide-probe-stack-elem 1024 :inline) ) - :method-count-assert 9 - :size-assert #x4000 - :flag-assert #x900004000 ) ;;(define *collide-probe-stack* (the-as pointer (+ 4192 #x70000000))) diff --git a/goal_src/jak1/engine/collide/collide-shape-h.gc b/goal_src/jak1/engine/collide/collide-shape-h.gc index adaaaece2a8..c0717b32421 100644 --- a/goal_src/jak1/engine/collide/collide-shape-h.gc +++ b/goal_src/jak1/engine/collide/collide-shape-h.gc @@ -95,20 +95,18 @@ (deftype collide-sticky-rider (structure) - ((rider-handle handle :offset-assert 0) - (sticky-prim collide-shape-prim :offset-assert 8) - (prim-ry float :offset-assert 12) - (rider-local-pos vector :inline :offset-assert 16) + ((rider-handle handle) + (sticky-prim collide-shape-prim) + (prim-ry float) + (rider-local-pos vector :inline) ) - :method-count-assert 10 - :size-assert #x20 - :flag-assert #xa00000020 (:methods - (set-rider! (_type_ handle) symbol 9) + (set-rider! (_type_ handle) symbol) ) ) -(defmethod set-rider! collide-sticky-rider ((this collide-sticky-rider) (arg0 handle)) + +(defmethod set-rider! ((this collide-sticky-rider) (arg0 handle)) "Set the rider and clear the primitive." (set! (-> this rider-handle) arg0) (set! (-> this sticky-prim) #f) @@ -118,21 +116,19 @@ ;; A collection of collide-sticky-riders ;; dynamic type. There's one collide-sticky-rider per rider. (deftype collide-sticky-rider-group (basic) - ((num-riders int32 :offset-assert 4) - (allocated-riders int32 :offset-assert 8) - (rider collide-sticky-rider 1 :inline :offset-assert 16) + ((num-riders int32) + (allocated-riders int32) + (rider collide-sticky-rider 1 :inline) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (new (symbol type int) _type_ 0) - (add-rider! (_type_ process-drawable) collide-sticky-rider 9) - (reset! (_type_) int 10) + (new (symbol type int) _type_) + (add-rider! (_type_ process-drawable) collide-sticky-rider) + (reset! (_type_) int) ) ) -(defmethod reset! collide-sticky-rider-group ((this collide-sticky-rider-group)) + +(defmethod reset! ((this collide-sticky-rider-group)) "Reset all active riders" (set! (-> this num-riders) 0) 0 @@ -141,14 +137,11 @@ ;; The rider will be pulled along by the object. ;; This includes possibly rotating the rider (if the platform spins, it spins Jak too). (deftype pull-rider-info (structure) - ((rider collide-sticky-rider :offset-assert 0) - (rider-cshape collide-shape-moving :offset-assert 4) - (rider-delta-ry float :offset-assert 8) - (rider-dest vector :inline :offset-assert 16) + ((rider collide-sticky-rider) + (rider-cshape collide-shape-moving) + (rider-delta-ry float) + (rider-dest vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) @@ -160,38 +153,32 @@ ;; this computes a "move-vec" and "u". If you move along "move-vec" by "u", you will move out of collsion. ;; It also tells you which primitives are colliding. (deftype collide-shape-intersect (basic) - ((move-vec vector :inline :offset-assert 16) - (best-u float :offset-assert 32) - (best-tri collide-tri-result :inline :offset-assert 48) - (best-from-prim collide-shape-prim :offset-assert 132) - (best-to-prim collide-shape-prim :offset-assert 136) + ((move-vec vector :inline) + (best-u float) + (best-tri collide-tri-result :inline) + (best-from-prim collide-shape-prim) + (best-to-prim collide-shape-prim) ) - :method-count-assert 10 - :size-assert #x8c - :flag-assert #xa0000008c (:methods - (init! (_type_ vector) symbol 9) + (init! (_type_ vector) symbol) ) ) ;; Collision with just overlap distance, no vector. (deftype collide-overlap-result (structure) - ((best-dist float :offset-assert 0) - (best-from-prim collide-shape-prim :offset-assert 4) - (best-to-prim collide-shape-prim :offset-assert 8) - (best-from-tri collide-tri-result :inline :offset-assert 16) + ((best-dist float) + (best-from-prim collide-shape-prim) + (best-to-prim collide-shape-prim) + (best-from-tri collide-tri-result :inline) ) - :method-count-assert 10 - :size-assert #x64 - :flag-assert #xa00000064 (:methods - (reset! (_type_) none 9) + (reset! (_type_) none) ) ) -(defmethod reset! collide-overlap-result ((this collide-overlap-result)) - "Reset the result." +(defmethod reset! ((this collide-overlap-result)) + "Reset the result." (set! (-> this best-dist) 0.0) (set! (-> this best-from-prim) #f) (set! (-> this best-to-prim) #f) @@ -206,12 +193,9 @@ ;; but this isn't well understood yet (deftype overlaps-others-params (structure) - ((options uint32 :offset-assert 0) - (tlist touching-list :offset-assert 4) + ((options uint32) + (tlist touching-list) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; The engine system is used to link collision checks with processes. @@ -344,17 +328,14 @@ ;; this is a 32-byte chunk of data that can be pulled out an put in collide caches ;; it stores the transformed world sphere and the collision settings (deftype collide-prim-core (structure) - ((world-sphere vector :inline :offset-assert 0) - (collide-as collide-kind :offset-assert 16) ;; what are we (enemy, etc) - (action collide-action :offset-assert 24) ;; what happens if we collide (physics) - (offense collide-offense :offset-assert 28) ;; how hard do we have to hit it? (touch, attack...) - (prim-type int8 :offset-assert 29) ;; what type of primtive do we belong to? - (extra uint8 2 :offset-assert 30) - (quad uint128 2 :offset 0) + ((world-sphere vector :inline) + (collide-as collide-kind) + (action collide-action) + (offense collide-offense) + (prim-type int8) + (extra uint8 2) + (quad uint128 2 :overlay-at (-> world-sphere quad)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (declare-type collide-shape basic) @@ -364,45 +345,40 @@ ;; the base class for collision shapes. (deftype collide-shape-prim (basic) - ((cshape collide-shape :offset-assert 4) ;; our parent collide-shape - (prim-id uint32 :offset-assert 8) ;; ? - (transform-index int8 :offset-assert 12) ;; ? - (prim-core collide-prim-core :inline :offset-assert 16) ;; core data - (local-sphere vector :inline :offset-assert 48) ;; sphere, pre transform - (collide-with collide-kind :offset-assert 64) ;; things we can collide with - - ;; overlays of core. - (world-sphere vector :inline :offset 16) - (collide-as collide-kind :offset 32) - (action collide-action :offset 40) - (offense collide-offense :offset 44) - (prim-type int8 :offset 45) - (radius meters :offset 60) + ((cshape collide-shape) + (prim-id uint32) + (transform-index int8) + (prim-core collide-prim-core :inline) + (local-sphere vector :inline) + (collide-with collide-kind) + (world-sphere vector :inline :overlay-at (-> prim-core world-sphere)) + (collide-as collide-kind :overlay-at (-> prim-core collide-as)) + (action collide-action :overlay-at (-> prim-core action)) + (offense collide-offense :overlay-at (-> prim-core offense)) + (prim-type int8 :overlay-at (-> prim-core prim-type)) + (radius meters :overlay-at (-> local-sphere w)) ) - :method-count-assert 28 - :size-assert #x48 - :flag-assert #x1c00000048 (:methods - (new (symbol type collide-shape uint int) _type_ 0) - (move-by-vector! (_type_ vector) none 9) - (find-prim-by-id (_type_ uint) collide-shape-prim 10) - (debug-draw-world-sphere (_type_) symbol 11) - (add-fg-prim-using-box (_type_ collide-cache) none 12) - (add-fg-prim-using-line-sphere (_type_ collide-cache) none 13) - (add-fg-prim-using-y-probe (_type_ collide-cache) none 14) - (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 15) - (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 16) - (unused-17 () none 17) - (collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none 18) - (collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none 19) - (add-to-bounding-box (_type_ collide-kind) symbol 20) - (num-mesh (_type_ collide-shape-prim) int 21) - (on-platform-test (_type_ collide-shape-prim collide-overlap-result float) none 22) - (should-push-away-test (_type_ collide-shape-prim collide-overlap-result) none 23) - (should-push-away-reverse-test (_type_ collide-shape-prim-group collide-overlap-result) none 24) - (update-transforms! (_type_ process-drawable) symbol 25) - (set-collide-as! (_type_ collide-kind) none 26) - (set-collide-with! (_type_ collide-kind) none 27) + (new (symbol type collide-shape uint int) _type_) + (move-by-vector! (_type_ vector) none) + (find-prim-by-id (_type_ uint) collide-shape-prim) + (debug-draw-world-sphere (_type_) symbol) + (add-fg-prim-using-box (_type_ collide-cache) none) + (add-fg-prim-using-line-sphere (_type_ collide-cache) none) + (add-fg-prim-using-y-probe (_type_ collide-cache) none) + (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol) + (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol) + (unused-17 () none) + (collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none) + (collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none) + (add-to-bounding-box (_type_ collide-kind) symbol) + (num-mesh (_type_ collide-shape-prim) int) + (on-platform-test (_type_ collide-shape-prim collide-overlap-result float) none) + (should-push-away-test (_type_ collide-shape-prim collide-overlap-result) none) + (should-push-away-reverse-test (_type_ collide-shape-prim-group collide-overlap-result) none) + (update-transforms! (_type_ process-drawable) symbol) + (set-collide-as! (_type_ collide-kind) none) + (set-collide-with! (_type_ collide-kind) none) ) ) @@ -418,13 +394,10 @@ ;; the pat is stored directly here. ;; I believe the "local sphere" is used as the sphere. (deftype collide-shape-prim-sphere (collide-shape-prim) - ((pat pat-surface :offset-assert 72) + ((pat pat-surface) ) - :method-count-assert 28 - :size-assert #x4c - :flag-assert #x1c0000004c (:methods - (new (symbol type collide-shape uint) _type_ 0) + (new (symbol type collide-shape uint) _type_) ) ) @@ -433,35 +406,29 @@ ;; These meshes interact with a cache automatically (a specific collide-shape-prim-mesh cache, not the ;; more general collide-cache) (deftype collide-shape-prim-mesh (collide-shape-prim) - ((mesh collide-mesh :offset-assert 72) - (mesh-id int32 :offset-assert 76) - (mesh-cache-id uint64 :offset-assert 80) - (mesh-cache-tris (inline-array collide-mesh-cache-tri) :offset-assert 88) + ((mesh collide-mesh) + (mesh-id int32) + (mesh-cache-id uint64) + (mesh-cache-tris (inline-array collide-mesh-cache-tri)) ) - :method-count-assert 29 - :size-assert #x5c - :flag-assert #x1d0000005c (:methods - (new (symbol type collide-shape uint uint) _type_ 0) - (change-mesh (_type_ int) none 28) + (new (symbol type collide-shape uint uint) _type_) + (change-mesh (_type_ int) none) ) ) ;; A group of collide-shape-prim's (deftype collide-shape-prim-group (collide-shape-prim) - ((num-prims int32 :offset-assert 72) - (num-prims-u uint32 :offset 72) - (allocated-prims int32 :offset-assert 76) - (prim collide-shape-prim 1 :offset-assert 80) - (prims collide-shape-prim :dynamic :offset 80) ;; added + ((num-prims int32) + (num-prims-u uint32 :overlay-at num-prims) + (allocated-prims int32) + (prim collide-shape-prim 1) + (prims collide-shape-prim :dynamic :overlay-at (-> prim 0)) ) - :method-count-assert 30 - :size-assert #x54 - :flag-assert #x1e00000054 (:methods - (new (symbol type collide-shape uint int) _type_ 0) - (append-prim (_type_ collide-shape-prim) none 28) - (add-to-non-empty-bounding-box (_type_ collide-kind) none 29) + (new (symbol type collide-shape uint int) _type_) + (append-prim (_type_ collide-shape-prim) none) + (add-to-non-empty-bounding-box (_type_ collide-kind) none) ) ) @@ -472,7 +439,7 @@ ;; This is sort of the "parent" of all collide prims for a process-drawable. ;; Each process-drawable (pd) should have one collide-shape, which is often the root. ;; It represents: -;; - the location of the thing in hte world +;; - the location of the thing in the world ;; - settings abouts collision/navigation ;; - riders @@ -494,51 +461,48 @@ ;; we're a child of trsqv, so we store a full transform + derivative. (deftype collide-shape (trsqv) - ((process process-drawable :offset-assert 140) - (max-iteration-count uint8 :offset-assert 144) - (nav-flags nav-flags :offset-assert 145) - (pad-byte uint8 2 :offset-assert 146) - (pat-ignore-mask pat-surface :offset-assert 148) - (event-self symbol :offset-assert 152) - (event-other symbol :offset-assert 156) - (root-prim collide-shape-prim :offset-assert 160) - (riders collide-sticky-rider-group :offset-assert 164) - (backup-collide-as collide-kind :offset-assert 168) - (backup-collide-with collide-kind :offset-assert 176) + ((process process-drawable) + (max-iteration-count uint8) + (nav-flags nav-flags) + (pad-byte uint8 2) + (pat-ignore-mask pat-surface) + (event-self symbol) + (event-other symbol) + (root-prim collide-shape-prim) + (riders collide-sticky-rider-group) + (backup-collide-as collide-kind) + (backup-collide-with collide-kind) ) - :method-count-assert 56 - :size-assert #xb8 - :flag-assert #x38000000b8 (:methods - (new (symbol type process-drawable collide-list-enum) _type_ 0) - (move-by-vector! (_type_ vector) none 28) - (alloc-riders (_type_ int) none 29) - (move-to-point! (_type_ vector) none 30) ;; ret - symbol | float (CSPG::9) - (debug-draw (_type_) none 31) - (fill-cache-for-shape! (_type_ float collide-kind) none 32) - (fill-cache-integrate-and-collide! (_type_ vector collide-kind) none 33) - (find-prim-by-id (_type_ uint) collide-shape-prim 34) - (detect-riders! (_type_) symbol 35) - (build-bounding-box-for-shape (_type_ bounding-box float collide-kind) symbol 36) - (integrate-and-collide! (_type_ vector) none 37) - (find-collision-meshes (_type_) symbol 38) - (on-platform (_type_ collide-shape collide-overlap-result) symbol 39) - (find-overlapping-shapes (_type_ overlaps-others-params) symbol 40) ;; check if blocked?? - (calc-shove-up (_type_ attack-info float) vector 41) - (should-push-away (_type_ collide-shape collide-overlap-result) symbol 42) - (pull-rider! (_type_ pull-rider-info) none 43) - (pull-riders! (_type_) symbol 44) - (do-push-aways! (_type_) symbol 45) - (set-root-prim! (_type_ collide-shape-prim) collide-shape-prim 46) - (update-transforms! (_type_) symbol 47) - (clear-collide-with-as (_type_) none 48) - (restore-collide-with-as (_type_) none 49) - (backup-collide-with-as (_type_) none 50) - (set-root-prim-collide-with! (_type_ collide-kind) none 51) - (set-root-prim-collide-as! (_type_ collide-kind) none 52) - (set-collide-kinds (_type_ int collide-kind collide-kind) none 53) - (set-collide-offense (_type_ int collide-offense) none 54) - (send-shove-back (_type_ process touching-shapes-entry float float float) none 55) + (new (symbol type process-drawable collide-list-enum) _type_) + (move-by-vector! (_type_ vector) none) + (alloc-riders (_type_ int) none) + (move-to-point! (_type_ vector) none) + (debug-draw (_type_) none) + (fill-cache-for-shape! (_type_ float collide-kind) none) + (fill-cache-integrate-and-collide! (_type_ vector collide-kind) none) + (find-prim-by-id (_type_ uint) collide-shape-prim) + (detect-riders! (_type_) symbol) + (build-bounding-box-for-shape (_type_ bounding-box float collide-kind) symbol) + (integrate-and-collide! (_type_ vector) none) + (find-collision-meshes (_type_) symbol) + (on-platform (_type_ collide-shape collide-overlap-result) symbol) + (find-overlapping-shapes (_type_ overlaps-others-params) symbol) + (calc-shove-up (_type_ attack-info float) vector) + (should-push-away (_type_ collide-shape collide-overlap-result) symbol) + (pull-rider! (_type_ pull-rider-info) none) + (pull-riders! (_type_) symbol) + (do-push-aways! (_type_) symbol) + (set-root-prim! (_type_ collide-shape-prim) collide-shape-prim) + (update-transforms! (_type_) symbol) + (clear-collide-with-as (_type_) none) + (restore-collide-with-as (_type_) none) + (backup-collide-with-as (_type_) none) + (set-root-prim-collide-with! (_type_ collide-kind) none) + (set-root-prim-collide-as! (_type_ collide-kind) none) + (set-collide-kinds (_type_ int collide-kind collide-kind) none) + (set-collide-offense (_type_ int collide-offense) none) + (send-shove-back (_type_ process touching-shapes-entry float float float) none) ) ) @@ -616,45 +580,42 @@ ;; A collide-shape for independently moving objects (deftype collide-shape-moving (collide-shape) - ((rider-time time-frame :offset-assert 184) - (rider-last-move vector :inline :offset-assert 192) - (trans-old vector 3 :inline :offset-assert 208) - (poly-pat pat-surface :offset-assert 256) - (cur-pat pat-surface :offset-assert 260) - (ground-pat pat-surface :offset-assert 264) - (status cshape-moving-flags :offset-assert 272) - (old-status cshape-moving-flags :offset-assert 280) - (prev-status cshape-moving-flags :offset-assert 288) - (reaction-flag cshape-reaction-flags :offset-assert 296) - (reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags) :offset-assert 300) - (no-reaction (function collide-shape-moving collide-shape-intersect vector vector none) :offset-assert 304) - (local-normal vector :inline :offset-assert 320) - (surface-normal vector :inline :offset-assert 336) - (poly-normal vector :inline :offset-assert 352) - (ground-poly-normal vector :inline :offset-assert 368) - (ground-touch-point vector :inline :offset-assert 384) - (shadow-pos vector :inline :offset-assert 400) - (ground-impact-vel meters :offset-assert 416) - (surface-angle float :offset-assert 420) - (poly-angle float :offset-assert 424) - (touch-angle float :offset-assert 428) - (coverage float :offset-assert 432) - (dynam dynamics :offset-assert 436) - (surf surface :offset-assert 440) + ((rider-time time-frame) + (rider-last-move vector :inline) + (trans-old vector 3 :inline) + (poly-pat pat-surface) + (cur-pat pat-surface) + (ground-pat pat-surface) + (status cshape-moving-flags) + (old-status cshape-moving-flags) + (prev-status cshape-moving-flags) + (reaction-flag cshape-reaction-flags) + (reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags)) + (no-reaction (function collide-shape-moving collide-shape-intersect vector vector none)) + (local-normal vector :inline) + (surface-normal vector :inline) + (poly-normal vector :inline) + (ground-poly-normal vector :inline) + (ground-touch-point vector :inline) + (shadow-pos vector :inline) + (ground-impact-vel meters) + (surface-angle float) + (poly-angle float) + (touch-angle float) + (coverage float) + (dynam dynamics) + (surf surface) ) - :method-count-assert 65 - :size-assert #x1bc - :flag-assert #x41000001bc (:methods - (set-and-handle-pat! (_type_ pat-surface) none 56) - (integrate-no-collide! (_type_ vector) none 57) - (collide-shape-moving-method-58 (_type_ vector) symbol 58) - (integrate-for-enemy-with-move-to-ground! (_type_ vector collide-kind float symbol symbol symbol) none 59) - (move-to-ground (_type_ float float symbol collide-kind) symbol 60) - (move-to-ground-point! (_type_ vector vector vector) none 61) - (compute-acc-due-to-gravity (_type_ vector float) vector 62) - (step-collison! (_type_ vector vector float) float 63) - (move-to-tri! (_type_ collide-tri-result vector) none 64) + (set-and-handle-pat! (_type_ pat-surface) none) + (integrate-no-collide! (_type_ vector) none) + (collide-shape-moving-method-58 (_type_ vector) symbol) + (integrate-for-enemy-with-move-to-ground! (_type_ vector collide-kind float symbol symbol symbol) none) + (move-to-ground (_type_ float float symbol collide-kind) symbol) + (move-to-ground-point! (_type_ vector vector vector) none) + (compute-acc-due-to-gravity (_type_ vector float) vector) + (step-collison! (_type_ vector vector float) float) + (move-to-tri! (_type_ collide-tri-result vector) none) ) ) @@ -663,24 +624,19 @@ ;;;;;;;;;;;;;;;;;;;; (defmethod new collide-shape-prim ((allocation symbol) (type-to-make type) (cshape collide-shape) (prim-id uint) (size-bytes int)) - "Allocate a new collide-shape-prim. It is expected that children of collide-shape-prim override this. - NOTE: uses the size-bytes as the TOTAL size of the structure." - - (let ((this (object-new allocation type-to-make size-bytes))) - (set! (-> this cshape) (the-as collide-shape cshape)) - ;; sphere/mesh? - (set! (-> this prim-id) prim-id) - (set! (-> this prim-core action) (collide-action)) - (set! (-> this prim-core collide-as) (collide-kind)) - (set! (-> this collide-with) (collide-kind)) - (set! (-> this transform-index) -2) - (set! (-> this prim-core offense) (collide-offense no-offense)) - (set! (-> this prim-core prim-type) -2) - this + (let ((v0-0 (object-new allocation type-to-make size-bytes))) + (set! (-> v0-0 cshape) cshape) + (set! (-> v0-0 prim-id) prim-id) + (set! (-> v0-0 prim-core action) (collide-action)) + (set! (-> v0-0 prim-core collide-as) (collide-kind)) + (set! (-> v0-0 collide-with) (collide-kind)) + (set! (-> v0-0 transform-index) -2) + (set! (-> v0-0 prim-core offense) (collide-offense no-offense)) + (set! (-> v0-0 prim-core prim-type) -2) + v0-0 ) ) - (defmethod new collide-shape-prim-sphere ((allocation symbol) (type-to-make type) (cshape collide-shape) (prim-id uint)) "Allocate a new sphere primitive" @@ -696,10 +652,10 @@ (let ((this (the collide-shape-prim-mesh ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id (size-of collide-shape-prim-mesh))))) (set! (-> this mesh) #f) - (set! (-> this mesh-id) (the int mesh-id)) - (set! (-> this mesh-cache-id) 0) + (set! (-> this mesh-id) (the-as int mesh-id)) + (set! (-> this mesh-cache-id) (the-as uint 0)) (set! (-> this prim-core prim-type) 1) - this + (the-as collide-shape-prim-mesh this) ) ) @@ -719,12 +675,12 @@ ) ) -(defmethod length collide-shape-prim-group ((this collide-shape-prim-group)) +(defmethod length ((this collide-shape-prim-group)) "How many primitives are used?" (-> this num-prims) ) -(defmethod asize-of collide-shape-prim-group ((this collide-shape-prim-group)) +(defmethod asize-of ((this collide-shape-prim-group)) "How big is this in memory?" (the-as int (+ (-> this type size) (* (+ (-> this allocated-prims) -1) 4))) ) @@ -741,13 +697,12 @@ (set! (-> this riders) #f) (set! (-> this root-prim) #f) - ;; add a special ignore mask for the camera vs other things. (case (-> proc type symbol) (('camera) - (set! (-> this pat-ignore-mask) (new 'static 'pat-surface :skip #x2 :nocamera #x1)) + (set! (-> this pat-ignore-mask) (new 'static 'pat-surface :nocamera #x1)) ) (else - (set! (-> this pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> this pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) ) ) ;; reset transformation to the origin. @@ -770,7 +725,8 @@ (add-connection *collide-player-list* proc #f this #f #f)) (else - (format 0 "Unsupported collide-list-enum in collide-shape constructor!~%")) + (format 0 "Unsupported collide-list-enum in collide-shape constructor!~%") + ) ) this ) @@ -786,50 +742,38 @@ ) ) -(defmethod length collide-sticky-rider-group ((this collide-sticky-rider-group)) +(defmethod length ((this collide-sticky-rider-group)) (-> this num-riders) ) -(defmethod asize-of collide-sticky-rider-group ((this collide-sticky-rider-group)) +(defmethod asize-of ((this collide-sticky-rider-group)) (the-as int (+ (-> this type size) (* (+ (-> this allocated-riders) -1) 32))) ) -;;;;;;;;;;;;;;;;;;;; -;; Fake Meshes -;;;;;;;;;;;;;;;;;;;; - -;; These aren't real meshes, but are returned when you collide with the background or water. -;; Background and water collision work differently, but this allows these systems to pretend to be -;; part of the old collision system. - -(define *collide-shape-prim-backgnd* - (new 'static 'collide-shape-prim-mesh - :cshape #f - :prim-core - (new 'static 'collide-prim-core - :world-sphere (new 'static 'vector :w 204800000.0) - :collide-as (collide-kind background) - :action (collide-action solid) - :offense (collide-offense indestructible) - :prim-type 2 - ) - :local-sphere (new 'static 'vector :w 204800000.0) - :mesh #f - ) +(define *collide-shape-prim-backgnd* (new 'static 'collide-shape-prim-mesh + :cshape #f + :prim-core (new 'static 'collide-prim-core + :world-sphere (new 'static 'vector :w 204800000.0) + :collide-as (collide-kind background) + :action (collide-action solid) + :offense (collide-offense indestructible) + :prim-type 2 + ) + :local-sphere (new 'static 'vector :w 204800000.0) + :mesh #f + ) ) -(define *collide-shape-prim-water* - (new 'static 'collide-shape-prim-mesh - :cshape #f - :prim-core - (new 'static 'collide-prim-core - :world-sphere (new 'static 'vector :w 204800000.0) - :collide-as (collide-kind water) - :action (collide-action solid) - :offense (collide-offense indestructible) - :prim-type 2 - ) - :local-sphere (new 'static 'vector :w 204800000.0) - :mesh #f - ) +(define *collide-shape-prim-water* (new 'static 'collide-shape-prim-mesh + :cshape #f + :prim-core (new 'static 'collide-prim-core + :world-sphere (new 'static 'vector :w 204800000.0) + :collide-as (collide-kind water) + :action (collide-action solid) + :offense (collide-offense indestructible) + :prim-type 2 + ) + :local-sphere (new 'static 'vector :w 204800000.0) + :mesh #f + ) ) diff --git a/goal_src/jak1/engine/collide/collide-shape-rider.gc b/goal_src/jak1/engine/collide/collide-shape-rider.gc index 1d53e16b0c2..6cf91303b8c 100644 --- a/goal_src/jak1/engine/collide/collide-shape-rider.gc +++ b/goal_src/jak1/engine/collide/collide-shape-rider.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod on-platform collide-shape ((this collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result)) +(defmethod on-platform ((this collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result)) "Are we on the platform? Returns #t/#f and also sets an overlap result." (let ((v1-0 arg1)) (set! (-> v1-0 best-dist) 0.0) @@ -39,12 +39,12 @@ ) -(defmethod on-platform-test collide-shape-prim ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) +(defmethod on-platform-test ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) (format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%") (none) ) -(defmethod on-platform-test collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) +(defmethod on-platform-test ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) "Check if we're on the platform for a prim group." (let ((s3-0 (-> arg0 prim-core collide-as))) (dotimes (s2-0 (-> this num-prims)) @@ -73,7 +73,7 @@ (none) ) -(defmethod on-platform-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) +(defmethod on-platform-test ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) "check if we're on the platform for a mesh." (case (-> arg0 type) ;; mesh to group @@ -153,7 +153,7 @@ (none) ) -(defmethod add-rider! collide-sticky-rider-group ((this collide-sticky-rider-group) (arg0 process-drawable)) +(defmethod add-rider! ((this collide-sticky-rider-group) (arg0 process-drawable)) "Add a rider to this platform." (let ((gp-0 (the-as collide-sticky-rider #f))) (cond @@ -173,7 +173,7 @@ ) ) -(defmethod detect-riders! collide-shape ((this collide-shape)) +(defmethod detect-riders! ((this collide-shape)) "See who is riding us." (let ((s5-0 (-> this riders))) (when s5-0 @@ -373,7 +373,7 @@ ) ) -(defmethod pull-riders! collide-shape ((this collide-shape)) +(defmethod pull-riders! ((this collide-shape)) "Move our riders." (let ((s5-0 (-> this riders))) (when s5-0 @@ -408,7 +408,7 @@ ) ) -(defmethod pull-rider! collide-shape ((this collide-shape) (arg0 pull-rider-info)) +(defmethod pull-rider! ((this collide-shape) (arg0 pull-rider-info)) "Move a rider." (local-vars (at-0 int) (sv-160 (function collide-shape-moving float collide-kind none))) (rlet ((vf0 :class vf) @@ -483,7 +483,7 @@ ) ) -(defmethod alloc-riders collide-shape ((this collide-shape) (arg0 int)) +(defmethod alloc-riders ((this collide-shape) (arg0 int)) (if (-> this riders) (format 0 "ERROR: colide-shape::alloc-riders is being called multiple times!~%") (set! (-> this riders) (new 'process 'collide-sticky-rider-group arg0)) diff --git a/goal_src/jak1/engine/collide/collide-target-h.gc b/goal_src/jak1/engine/collide/collide-target-h.gc index 78166697397..6c33fa0d31e 100644 --- a/goal_src/jak1/engine/collide/collide-target-h.gc +++ b/goal_src/jak1/engine/collide/collide-target-h.gc @@ -10,195 +10,189 @@ ;; We believe that target's control-info may contain an array of these. ;; Each collide-history is a record of a single collision event. (deftype collide-history (structure) - ((intersect vector :inline :offset-assert 0) - (trans vector :inline :offset-assert 16) - (transv vector :inline :offset-assert 32) - (transv-out vector :inline :offset-assert 48) - (local-normal vector :inline :offset-assert 64) - (surface-normal vector :inline :offset-assert 80) - (time time-frame :offset-assert 96) - (status cshape-moving-flags :offset-assert 104) - (pat pat-surface :offset-assert 112) - (reaction-flag cshape-reaction-flags :offset-assert 116) + ((intersect vector :inline) + (trans vector :inline) + (transv vector :inline) + (transv-out vector :inline) + (local-normal vector :inline) + (surface-normal vector :inline) + (time time-frame) + (status cshape-moving-flags) + (pat pat-surface) + (reaction-flag cshape-reaction-flags) ) - :method-count-assert 10 - :size-assert #x78 - :flag-assert #xa00000078 (:methods - (update! (_type_ collide-shape-moving vector vector vector) _type_ 9) + (update! (_type_ collide-shape-moving vector vector vector) _type_) ) ) ;; This is the collide shape for target (Jak). ;; It is complicated. (deftype control-info (collide-shape-moving) - ((unknown-vector00 vector :inline :offset 448) - (unknown-vector01 vector :inline :offset 464) - (unknown-vector02 vector :inline :offset 480) - (unknown-quaternion00 quaternion :inline :offset 496) - (unknown-quaternion01 quaternion :inline :offset 512) - (unknown-float00 float :offset 528) - (unknown-float01 float :offset 532) - (unknown-float02 float :offset 536) - (unknown-vector10 vector :inline :offset 544) - (unknown-vector11 vector :inline :offset 560) - (unknown-vector12 vector :inline :offset 576) - (unknown-vector13 vector :inline :offset 592) - (unknown-vector14 vector :inline :offset 608) - (unknown-vector15 vector :inline :offset 624) - (unknown-vector16 vector :inline :offset 640) - (unknown-dynamics00 dynamics :offset 656) - (unknown-surface00 surface :offset 660) - (unknown-surface01 surface :offset 664) - (unknown-cpad-info00 cpad-info :offset 668) - (unknown-float10 float :offset 672) - (unknown-float11 float :offset 676) - (unknown-float12 float :offset 680) - (unknown-float13 float :offset 684) - (unknown-vector20 vector :inline :offset 688) - (unknown-vector21 vector :inline :offset 704) - (unknown-vector22 vector :inline :offset 720) - (unknown-vector23 vector :inline :offset 736) - (unknown-vector-array00 vector 7 :inline :offset 752) - (unknown-vector30 vector :inline :offset 880) - (unknown-vector31 vector :inline :offset 896) - (unknown-float20 float :offset 912) - (unknown-float21 float :offset 916) - (unknown-dword00 uint64 :offset 920) - (unknown-matrix00 matrix :inline :offset 928) - (unknown-matrix01 matrix :inline :offset 992) - (unknown-matrix02 matrix :inline :offset 1056) - (unknown-qword00 uint128 :offset 1136) - (unknown-float30 float :offset 1140) - (unknown-vector40 vector :inline :offset 1152) - (unknown-float40 float :offset 1172) - (unknown-float41 float :offset 1176) - (unknown-int00 int32 :offset 1180) - (unknown-float50 float :offset 1168) - (unknown-vector50 vector :inline :offset 1184) - (unknown-vector51 vector :inline :offset 1200) - (unknown-vector52 vector :inline :offset 1216) - (unknown-vector53 vector :inline :offset 1232) - (last-known-safe-ground vector :inline :offset 1248) - (unknown-vector55 vector :inline :offset 1264) - (unknown-dword10 time-frame :offset 1280) - (unknown-dword11 time-frame :offset 1288) - (unknown-float60 float :offset 1300) - (unknown-float61 float :offset 1304) - (unknown-float62 float :offset 1308) - (unknown-float63 float :offset 1312) - (unknown-float64 float :offset 1316) - (unknown-dword20 time-frame :offset 1320) - (unknown-dword21 time-frame :offset 1328) - (unknown-dword-coverage int64 :offset 1336) - (unknown-float-coverage-0 float :offset 1344) - (unknown-float-coverage-1 float :offset 1348) - (unknown-float-coverage-2 float :offset 1352) - (unknown-u32-coverage-0 uint32 :offset 1356) - (unknown-vector-coverage-0 vector :inline :offset 1376) - (unknown-vector-coverage-1 vector :inline :offset 1392) - (unknown-vector-coverage-2 vector :inline :offset 1440) - (unknown-vector-coverage-3 vector :inline :offset 1472) - (unknown-vector60 vector :inline :offset 1456) - (unknown-vector61 vector :inline :offset 1504) - (unknown-float70 float :offset 1520) - (unknown-float71 float :offset 1524) - (unknown-vector70 vector :inline :offset 1536) - (unknown-vector71 vector :inline :offset 1552) - (unknown-vector72 vector :inline :offset 1568) - (unknown-vector73 vector :inline :offset 1584) - (unknown-handle00 handle :offset 1600) - (unknown-sphere-array00 collide-shape-prim-sphere 3 :offset 1608) - (unknown-sphere00 collide-shape-prim-sphere :offset 1632) - (unknown-sphere01 collide-shape-prim-sphere :offset 1636) - (unknown-sphere02 collide-shape-prim-sphere :offset 1640) - (unknown-int50 int32 :offset 1656) - (unknown-dword30 time-frame :offset 1664) - (unknown-dword31 time-frame :offset 1672) - (unknown-dword32 time-frame :offset 1680) - (unknown-dword33 time-frame :offset 1688) - (unknown-dword34 time-frame :offset 1696) - (unknown-dword35 time-frame :offset 1704) - (unknown-dword36 time-frame :offset 1712) - (unknown-float80 float :offset 1724) - (unknown-float81 float :offset 1728) - (unknown-float82 float :offset 1732) - (unknown-vector80 vector :inline :offset 1744) - (unknown-cspace00 cspace :inline :offset 1760) - (unknown-vector90 vector :inline :offset 1776) - (unknown-vector91 vector :inline :offset 1792) - (unknown-vector92 vector :inline :offset 1824) - (unknown-cspace10 cspace :inline :offset 1808) - (unknown-symbol00 symbol :offset 1840) - (unknown-float90 float :offset 1844) - (unknown-float91 float :offset 1848) - (unknown-vector-array10 vector 16 :inline :offset 1856) - (unknown-float100 float :offset 2112) - (unknown-int10 int32 :offset 2116) - (unknown-float110 float :offset 2120) - (unknown-vector100 vector :inline :offset 2128) - (unknown-vector101 vector :inline :offset 2144) - (unknown-dword40 time-frame :offset 2160) - (unknown-dword41 time-frame :offset 2168) - (unknown-handle10 handle :offset 2176) - (unknown-uint20 uint32 :offset 2184) - (unknown-spoolanim00 spool-anim :offset 2184) - (unknown-int20 int32 :offset 2184) - (unknown-symbol20 symbol :offset 2184) - (unknown-float120 float :offset 2184) - (unknown-int21 int32 :offset 2188) - (unknown-uint30 uint32 :offset 2188) - (unknown-float121 float :offset 2188) - (unknown-uint31 uint32 :offset 2192) - (unknown-int37 int32 :offset 2192) - (unknown-float122 float :offset 2196) - (unknown-float123 float :offset 2200) - (unknown-float124 float :offset 2204) - (unknown-vector102 vector :inline :offset 2224) - (unknown-vector103 vector :inline :offset 2240) - (unknown-quaternion02 quaternion :inline :offset 2256) - (unknown-quaternion03 quaternion :inline :offset 2272) - (unknown-smush00 smush-control :inline :offset 2288) - (unknown-vector110 vector :inline :offset 2320) - (unknown-vector111 vector :inline :offset 2336) - (unknown-symbol30 symbol :offset 2384) - (unknown-int31 uint32 :offset 2384) - (unknown-dword50 int64 :offset 2392) - (unknown-dword51 int64 :offset 2400) - (unknown-pointer00 pointer :offset 2416) - (unknown-symbol40 symbol :offset 2428) - (unknown-dword60 int64 :offset 2432) - (unknown-dword61 int64 :offset 2440) - (unknown-dword62 int64 :offset 2448) - (unknown-dword63 int64 :offset 2456) - (unknown-halfword00 int16 :offset 2488) - (history-length int16 :offset 2490) - (history-data collide-history 128 :inline :offset-assert 2496) - (unknown-float140 float :offset 18944) - (unknown-dword70 time-frame :offset 18952) - (unknown-int40 int32 :offset 18880) - (unknown-dword80 time-frame :offset 18888) - (unknown-dword81 time-frame :offset 18896) - (unknown-float130 float :offset 18904) - (unknown-float131 float :offset 18908) - (unknown-dword82 time-frame :offset 18912) - (unknown-vector120 vector :inline :offset 18928) - (unknown-float150 float :offset 18944) - (unknown-vector121 vector :inline :offset 18960) - (wall-pat pat-surface :offset 18976) - (unknown-soundid00 sound-id :offset 18980) - (unknown-float141 float :offset 18984) - (unknown-soundid01 sound-id :offset 18988) - (unknown-int34 int32 :offset 18992) - (unknown-int35 int32 :offset 18996) - (unknown-int36 int32 :offset 19000) + ((unknown-vector00 vector :inline :offset 448) + (unknown-vector01 vector :inline :offset 464) + (unknown-vector02 vector :inline :offset 480) + (unknown-quaternion00 quaternion :inline :offset 496) + (unknown-quaternion01 quaternion :inline :offset 512) + (unknown-float00 float :offset 528) + (unknown-float01 float :offset 532) + (unknown-float02 float :offset 536) + (unknown-vector10 vector :inline :offset 544) + (unknown-vector11 vector :inline :offset 560) + (unknown-vector12 vector :inline :offset 576) + (unknown-vector13 vector :inline :offset 592) + (unknown-vector14 vector :inline :offset 608) + (unknown-vector15 vector :inline :offset 624) + (unknown-vector16 vector :inline :offset 640) + (unknown-dynamics00 dynamics :offset 656) + (unknown-surface00 surface :offset 660) + (unknown-surface01 surface :offset 664) + (unknown-cpad-info00 cpad-info :offset 668) + (unknown-float10 float :offset 672) + (unknown-float11 float :offset 676) + (unknown-float12 float :offset 680) + (unknown-float13 float :offset 684) + (unknown-vector20 vector :inline :offset 688) + (unknown-vector21 vector :inline :offset 704) + (unknown-vector22 vector :inline :offset 720) + (unknown-vector23 vector :inline :offset 736) + (unknown-vector-array00 vector 7 :inline :offset 752) + (unknown-vector30 vector :inline :offset 880) + (unknown-vector31 vector :inline :offset 896) + (unknown-float20 float :offset 912) + (unknown-float21 float :offset 916) + (unknown-dword00 uint64 :offset 920) + (unknown-matrix00 matrix :inline :offset 928) + (unknown-matrix01 matrix :inline :offset 992) + (unknown-matrix02 matrix :inline :offset 1056) + (unknown-qword00 uint128 :offset 1136) + (unknown-float30 float :offset 1140) + (unknown-vector40 vector :inline :offset 1152) + (unknown-float40 float :offset 1172) + (unknown-float41 float :offset 1176) + (unknown-int00 int32 :offset 1180) + (unknown-float50 float :offset 1168) + (unknown-vector50 vector :inline :offset 1184) + (unknown-vector51 vector :inline :offset 1200) + (unknown-vector52 vector :inline :offset 1216) + (unknown-vector53 vector :inline :offset 1232) + (last-known-safe-ground vector :inline :offset 1248) + (unknown-vector55 vector :inline :offset 1264) + (unknown-dword10 time-frame :offset 1280) + (unknown-dword11 time-frame :offset 1288) + (unknown-float60 float :offset 1300) + (unknown-float61 float :offset 1304) + (unknown-float62 float :offset 1308) + (unknown-float63 float :offset 1312) + (unknown-float64 float :offset 1316) + (unknown-dword20 time-frame :offset 1320) + (unknown-dword21 time-frame :offset 1328) + (unknown-dword-coverage int64 :offset 1336) + (unknown-float-coverage-0 float :offset 1344) + (unknown-float-coverage-1 float :offset 1348) + (unknown-float-coverage-2 float :offset 1352) + (unknown-u32-coverage-0 uint32 :offset 1356) + (unknown-vector-coverage-0 vector :inline :offset 1376) + (unknown-vector-coverage-1 vector :inline :offset 1392) + (unknown-vector-coverage-2 vector :inline :offset 1440) + (unknown-vector-coverage-3 vector :inline :offset 1472) + (unknown-vector60 vector :inline :offset 1456) + (unknown-vector61 vector :inline :offset 1504) + (unknown-float70 float :offset 1520) + (unknown-float71 float :offset 1524) + (unknown-vector70 vector :inline :offset 1536) + (unknown-vector71 vector :inline :offset 1552) + (unknown-vector72 vector :inline :offset 1568) + (unknown-vector73 vector :inline :offset 1584) + (unknown-handle00 handle :offset 1600) + (unknown-sphere-array00 collide-shape-prim-sphere 3 :offset 1608) + (unknown-sphere00 collide-shape-prim-sphere :offset 1632) + (unknown-sphere01 collide-shape-prim-sphere :offset 1636) + (unknown-sphere02 collide-shape-prim-sphere :offset 1640) + (unknown-int50 int32 :offset 1656) + (unknown-dword30 time-frame :offset 1664) + (unknown-dword31 time-frame :offset 1672) + (unknown-dword32 time-frame :offset 1680) + (unknown-dword33 time-frame :offset 1688) + (unknown-dword34 time-frame :offset 1696) + (unknown-dword35 time-frame :offset 1704) + (unknown-dword36 time-frame :offset 1712) + (unknown-float80 float :offset 1724) + (unknown-float81 float :offset 1728) + (unknown-float82 float :offset 1732) + (unknown-vector80 vector :inline :offset 1744) + (unknown-cspace00 cspace :inline :offset 1760) + (unknown-vector90 vector :inline :offset 1776) + (unknown-vector91 vector :inline :offset 1792) + (unknown-vector92 vector :inline :offset 1824) + (unknown-cspace10 cspace :inline :offset 1808) + (unknown-symbol00 symbol :offset 1840) + (unknown-float90 float :offset 1844) + (unknown-float91 float :offset 1848) + (unknown-vector-array10 vector 16 :inline :offset 1856) + (unknown-float100 float :offset 2112) + (unknown-int10 int32 :offset 2116) + (unknown-float110 float :offset 2120) + (unknown-vector100 vector :inline :offset 2128) + (unknown-vector101 vector :inline :offset 2144) + (unknown-dword40 time-frame :offset 2160) + (unknown-dword41 time-frame :offset 2168) + (unknown-handle10 handle :offset 2176) + (unknown-uint20 uint32 :offset 2184) + (unknown-spoolanim00 spool-anim :overlay-at unknown-uint20) + (unknown-int20 int32 :overlay-at unknown-spoolanim00) + (unknown-symbol20 symbol :overlay-at unknown-int20) + (unknown-float120 float :overlay-at unknown-symbol20) + (unknown-int21 int32 :offset 2188) + (unknown-uint30 uint32 :overlay-at unknown-int21) + (unknown-float121 float :overlay-at unknown-uint30) + (unknown-uint31 uint32 :offset 2192) + (unknown-int37 int32 :overlay-at unknown-uint31) + (unknown-float122 float :offset 2196) + (unknown-float123 float :offset 2200) + (unknown-float124 float :offset 2204) + (unknown-vector102 vector :inline :offset 2224) + (unknown-vector103 vector :inline :offset 2240) + (unknown-quaternion02 quaternion :inline :offset 2256) + (unknown-quaternion03 quaternion :inline :offset 2272) + (unknown-smush00 smush-control :inline :offset 2288) + (unknown-vector110 vector :inline :offset 2320) + (unknown-vector111 vector :inline :offset 2336) + (unknown-symbol30 symbol :offset 2384) + (unknown-int31 uint32 :overlay-at unknown-symbol30) + (unknown-dword50 int64 :offset 2392) + (unknown-dword51 int64 :offset 2400) + (unknown-pointer00 pointer :offset 2416) + (unknown-symbol40 symbol :offset 2428) + (unknown-dword60 int64 :offset 2432) + (unknown-dword61 int64 :offset 2440) + (unknown-dword62 int64 :offset 2448) + (unknown-dword63 int64 :offset 2456) + (unknown-halfword00 int16 :offset 2488) + (history-length int16 :offset 2490) + (history-data collide-history 128 :inline) + (unknown-float140 float :offset 18944) + (unknown-dword70 time-frame :offset 18952) + (unknown-int40 int32 :offset 18880) + (unknown-dword80 time-frame :offset 18888) + (unknown-dword81 time-frame :offset 18896) + (unknown-float130 float :offset 18904) + (unknown-float131 float :offset 18908) + (unknown-dword82 time-frame :offset 18912) + (unknown-vector120 vector :inline :offset 18928) + (unknown-float150 float :overlay-at unknown-float140) + (unknown-vector121 vector :inline :offset 18960) + (wall-pat pat-surface :offset 18976) + (unknown-soundid00 sound-id :offset 18980) + (unknown-float141 float :offset 18984) + (unknown-soundid01 sound-id :offset 18988) + (unknown-int34 int32 :offset 18992) + (unknown-int35 int32 :offset 18996) + (unknown-int36 int32 :offset 19000) ) - :method-count-assert 65 - :size-assert #x4a3c - :flag-assert #x4100004a3c ) -(defmethod update! collide-history ((this collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector)) +(defmethod update! ((this collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector)) "Update the collide-history element." (set! (-> this intersect quad) (-> xs quad)) (set! (-> this transv quad) (-> transv quad)) diff --git a/goal_src/jak1/engine/collide/collide-touch-h.gc b/goal_src/jak1/engine/collide/collide-touch-h.gc index c4022189828..b2f5159c144 100644 --- a/goal_src/jak1/engine/collide/collide-touch-h.gc +++ b/goal_src/jak1/engine/collide/collide-touch-h.gc @@ -20,54 +20,47 @@ ;; A record of a primitive which is touching another, possibly including the triangle that is involved. (deftype touching-prim (structure) - ((cprim collide-shape-prim :offset-assert 0) - (has-tri? symbol :offset-assert 4) - (tri collide-tri-result :inline :offset-assert 16) + ((cprim collide-shape-prim) + (has-tri? symbol) + (tri collide-tri-result :inline) ) - :method-count-assert 9 - :size-assert #x64 - :flag-assert #x900000064 ) + ;; A record of two primitives which are touching. (deftype touching-prims-entry (structure) - ((next touching-prims-entry :offset-assert 0) - (prev touching-prims-entry :offset-assert 4) - (allocated? symbol :offset-assert 8) - (u float :offset-assert 12) - (prim1 touching-prim :inline :offset-assert 16) - (prim2 touching-prim :inline :offset-assert 128) + ((next touching-prims-entry) + (prev touching-prims-entry) + (allocated? symbol) + (u float) + (prim1 touching-prim :inline) + (prim2 touching-prim :inline) ) - :method-count-assert 13 - :size-assert #xe4 - :flag-assert #xd000000e4 (:methods - (get-touched-prim (_type_ trsqv touching-shapes-entry) collide-shape-prim 9) - (touching-prims-entry-method-10 () none 10) - (get-middle-of-bsphere-overlap (_type_ vector) vector 11) - (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result 12) + (get-touched-prim (_type_ trsqv touching-shapes-entry) collide-shape-prim) + (touching-prims-entry-method-10 () none) + (get-middle-of-bsphere-overlap (_type_ vector) vector) + (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result) ) ) + ;; A pool of up to 64 touching primitives. There is a linked list of freed entries. (deftype touching-prims-entry-pool (structure) - ((head touching-prims-entry :offset-assert 0) - (nodes touching-prims-entry 64 :inline :offset-assert 16) + ((head touching-prims-entry) + (nodes touching-prims-entry 64 :inline) ) - :method-count-assert 13 - :size-assert #x3c10 - :flag-assert #xd00003c10 (:methods - (new (symbol type) _type_ 0) - (alloc-node (_type_) touching-prims-entry 9) - (get-free-node-count (_type_) int 10) - (init-list! (_type_) none 11) - (free-node (_type_ touching-prims-entry) touching-prims-entry 12) + (new (symbol type) _type_) + (alloc-node (_type_) touching-prims-entry) + (get-free-node-count (_type_) int) + (init-list! (_type_) none) + (free-node (_type_ touching-prims-entry) touching-prims-entry) ) ) -(defmethod init-list! touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod init-list! ((this touching-prims-entry-pool)) "Initialize all entries to be not allocated and in a linked list." (let ((prev (the-as touching-prims-entry #f))) (let ((current (the-as touching-prims-entry (-> this nodes)))) @@ -104,48 +97,43 @@ ) ) + ;; two collide shapes which are touching. ;; This stores a list of primitive pairs which are touching. (deftype touching-shapes-entry (structure) - ((cshape1 collide-shape :offset-assert 0) - (cshape2 collide-shape :offset-assert 4) - (resolve-u int8 :offset-assert 8) - (head touching-prims-entry :offset-assert 12) + ((cshape1 collide-shape) + (cshape2 collide-shape) + (resolve-u int8) + (head touching-prims-entry) ) :allow-misaligned - :method-count-assert 18 - :size-assert #x10 - :flag-assert #x1200000010 (:methods - (touching-shapes-entry-method-9 (_type_) none 9) - (get-touched-shape (_type_ collide-shape) collide-shape 10) - (touching-shapes-entry-method-11 () none 11) - (prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry 12) - (prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry 13) - (touching-shapes-entry-method-14 () none 14) - (free-touching-prims-list (_type_) symbol 15) - (get-head (_type_) touching-prims-entry 16) - (get-next (_type_ touching-prims-entry) touching-prims-entry 17) + (touching-shapes-entry-method-9 (_type_) none) + (get-touched-shape (_type_ collide-shape) collide-shape) + (touching-shapes-entry-method-11 () none) + (prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry) + (prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry) + (touching-shapes-entry-method-14 () none) + (free-touching-prims-list (_type_) symbol) + (get-head (_type_) touching-prims-entry) + (get-next (_type_ touching-prims-entry) touching-prims-entry) ) ) ;; A list of (up to) TOUCHING_LIST_LENGTH pairs of colliding shapes (deftype touching-list (structure) - ((num-touching-shapes int32 :offset-assert 0) - (resolve-u int8 :offset-assert 4) - (touching-shapes touching-shapes-entry TOUCHING_LIST_LENGTH :inline :offset-assert 8) + ((num-touching-shapes int32) + (resolve-u int8) + (touching-shapes touching-shapes-entry TOUCHING_LIST_LENGTH :inline) ) - :method-count-assert 15 - :size-assert #x208 - :flag-assert #xf00000208 (:methods - (new (symbol type) _type_ 0) - (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none 9) - (touching-list-method-10 () none 10) - (update-from-step-size (_type_ float) none 11) - (send-events-for-touching-shapes (_type_) none 12) - (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry 13) - (free-all-prim-nodes (_type_) none 14) + (new (symbol type) _type_) + (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none) + (touching-list-method-10 () none) + (update-from-step-size (_type_ float) none) + (send-events-for-touching-shapes (_type_) none) + (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry) + (free-all-prim-nodes (_type_) none) ) ) @@ -165,11 +153,11 @@ ) ) -(defmethod get-head touching-shapes-entry ((this touching-shapes-entry)) +(defmethod get-head ((this touching-shapes-entry)) (-> this head) ) -(defmethod get-next touching-shapes-entry ((this touching-shapes-entry) (arg0 touching-prims-entry)) +(defmethod get-next ((this touching-shapes-entry) (arg0 touching-prims-entry)) (-> arg0 next) ) diff --git a/goal_src/jak1/engine/collide/collide-touch.gc b/goal_src/jak1/engine/collide/collide-touch.gc index 3e91d2fbbbd..158eefbd6c5 100644 --- a/goal_src/jak1/engine/collide/collide-touch.gc +++ b/goal_src/jak1/engine/collide/collide-touch.gc @@ -24,7 +24,7 @@ ;; there's a global shared pool of entries that you can alloc and free from. -(defmethod get-free-node-count touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod get-free-node-count ((this touching-prims-entry-pool)) "Get the number of nodes that are not in use." (let ((v0-0 0)) (let ((v1-0 (-> this head))) @@ -40,7 +40,7 @@ ) ) -(defmethod alloc-node touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod alloc-node ((this touching-prims-entry-pool)) "Allocate a node. Will return #f if there are none left." (let ((gp-0 (-> this head))) (cond @@ -63,7 +63,7 @@ ) ) -(defmethod free-node touching-prims-entry-pool ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) +(defmethod free-node ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) "Free a node allocated with alloc-node" (when (-> arg0 allocated?) (set! (-> arg0 allocated?) #f) @@ -85,7 +85,7 @@ ;; a single shape entry represents a pair of shapes that collide. ;; There can be multiple colliding primitives. -(defmethod free-touching-prims-list touching-shapes-entry ((this touching-shapes-entry)) +(defmethod free-touching-prims-list ((this touching-shapes-entry)) "Return all nodes used by this touching-shapes-entry to the touching-prims-entry-pool" (when (-> this cshape1) (set! (-> this cshape1) #f) @@ -112,7 +112,7 @@ ;; A touching list is a list up to TOUCHING_LIST_LENGTH pairs of colliding collide-shapes. -(defmethod free-all-prim-nodes touching-list ((this touching-list)) +(defmethod free-all-prim-nodes ((this touching-list)) "Free all prim nodes used by all touching shapes in this touching-list." (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) (countdown (s4-0 (-> this num-touching-shapes)) @@ -127,7 +127,7 @@ ) -(defmethod get-shapes-entry touching-list ((this touching-list) (arg0 collide-shape) (arg1 collide-shape)) +(defmethod get-shapes-entry ((this touching-list) (arg0 collide-shape) (arg1 collide-shape)) "Get a touching-shapes-entry for the two shapes. If one exists, it will be returned. Otherwise a new one will be made." (let ((v0-0 (the-as touching-shapes-entry (-> this touching-shapes)))) ;; the candidate (let ((v1-0 (the-as touching-shapes-entry #f))) ;; a good one @@ -184,12 +184,9 @@ ) (deftype add-prims-touching-work (structure) - ((tri1 collide-tri-result :offset-assert 0) - (tri2 collide-tri-result :offset-assert 4) + ((tri1 collide-tri-result) + (tri2 collide-tri-result) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -211,7 +208,7 @@ -(defmethod add-touching-prims touching-list ((this touching-list) +(defmethod add-touching-prims ((this touching-list) (arg0 collide-shape-prim) (arg1 collide-shape-prim) (arg2 float) @@ -346,7 +343,7 @@ (none) ) -(defmethod update-from-step-size touching-list ((this touching-list) (arg0 float)) +(defmethod update-from-step-size ((this touching-list) (arg0 float)) "Given that we actually will take a step size of arg0, remove things we won't actually hit." ;; only if we have some un-updated potential collision (when (nonzero? (-> this resolve-u)) @@ -424,7 +421,7 @@ (none) ) -(defmethod send-events-for-touching-shapes touching-list ((this touching-list)) +(defmethod send-events-for-touching-shapes ((this touching-list)) "Send all events for touching shapes. Note that the order of event sending is basically random. (this could explain lava walks's unreliable behavior)" @@ -575,7 +572,7 @@ (the-as touching-prims-entry #f) ) -(defmethod get-touched-shape touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape)) +(defmethod get-touched-shape ((this touching-shapes-entry) (arg0 collide-shape)) "Get the other shape in a pair of shapes." (cond ((= (-> this cshape1) arg0) @@ -588,7 +585,7 @@ (the-as collide-shape #f) ) -(defmethod get-touched-prim touching-prims-entry ((this touching-prims-entry) (arg0 trsqv) (arg1 touching-shapes-entry)) +(defmethod get-touched-prim ((this touching-prims-entry) (arg0 trsqv) (arg1 touching-shapes-entry)) "Get the primitive belonging to the collide shape that is touching." (cond ((= (-> arg1 cshape1) arg0) @@ -601,7 +598,7 @@ (the-as collide-shape-prim #f) ) -(defmethod get-touched-tri touching-prims-entry ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) +(defmethod get-touched-tri ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) "Get the triangle belonging to the the collide shape that is touching (if it has one, otherwise #f)" (let ((v0-0 (the-as collide-tri-result #f))) (cond @@ -624,7 +621,7 @@ ) ) -(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((this touching-prims-entry) (arg0 vector)) +(defmethod get-middle-of-bsphere-overlap ((this touching-prims-entry) (arg0 vector)) "This is a bit weird... But assuming the the bounding spheres overlap, draw a line between their centers, consider the line segment that is inside of both spheres, and get the midpoint of that." diff --git a/goal_src/jak1/engine/collide/pat-h.gc b/goal_src/jak1/engine/collide/pat-h.gc index 858070ec8a3..a0acccee62a 100644 --- a/goal_src/jak1/engine/collide/pat-h.gc +++ b/goal_src/jak1/engine/collide/pat-h.gc @@ -56,22 +56,17 @@ ;; It packs all data into a 32-bit pat-surface type. (deftype pat-surface (uint32) - ((skip uint8 :offset 0 :size 3) ;; overlay the "no" fields later on - (mode pat-mode :offset 3 :size 3) ;; ground/wall/obstacle for collision system - (material pat-material :offset 6 :size 6) ;; material for effects (sound, particles, surfaces...) - (camera uint8 :offset 12 :size 2) ;; 2 bits for camera (used later) - (event pat-event :offset 14 :size 6) ;; what happens if we hit this? - (noentity uint8 :offset 0 :size 1) ;; collisions for actors/jak/etc ignore this - (nocamera uint8 :offset 1 :size 1) ;; collisions for camera ignore this - (noedge uint8 :offset 2 :size 1) ;; seems unused? maybe no edge grab? - (nolineofsight uint8 :offset 12 :size 1) ;; camera don't worry about this object blocking line-of-sight to jak. - ;; 13 belongs to "camera", but seems unsed. - ;; 14 is unused? - (unknown-bit uint8 :offset 15 :size 1) ;; maybe death plane? + ((skip uint8 :offset 0 :size 3) + (mode pat-mode :offset 3 :size 3) + (material pat-material :offset 6 :size 6) + (camera uint8 :offset 12 :size 2) + (event pat-event :offset 14 :size 6) + (noentity uint8 :offset 0 :size 1) + (nocamera uint8 :offset 1 :size 1) + (noedge uint8 :offset 2 :size 1) + (nolineofsight uint8 :offset 12 :size 1) + (unknown-bit uint8 :offset 15 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (defun-debug pat-material->string ((pat pat-surface)) @@ -88,40 +83,38 @@ ;; for debug drawing pat's by mode. (deftype pat-mode-info (structure) - ((name string :offset-assert 0) - (wall-angle float :offset-assert 4) - (color rgba :offset-assert 8) - (hilite-color rgba :offset-assert 12) + ((name string) + (wall-angle float) + (color rgba) + (hilite-color rgba) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (define *pat-mode-info* (new 'static 'inline-array pat-mode-info 4 - (new 'static 'pat-mode-info - :name "ground" - :wall-angle 0.2 - :color (new 'static 'rgba :r #x7f :a #x40) - :hilite-color (new 'static 'rgba :r #xff :a #x80) - ) - (new 'static 'pat-mode-info - :name "wall" - :wall-angle 2.0 - :color (new 'static 'rgba :b #x7f :a #x40) - :hilite-color (new 'static 'rgba :b #xff :a #x80) - ) - (new 'static 'pat-mode-info - :name "obstacle" - :wall-angle 0.82 - :color (new 'static 'rgba :r #x7f :b #x7f :a #x40) - :hilite-color (new 'static 'rgba :r #xff :b #xff :a #x80) + (new 'static 'pat-mode-info + :name "ground" + :wall-angle 0.2 + :color (new 'static 'rgba :r #x7f :a #x40) + :hilite-color (new 'static 'rgba :r #xff :a #x80) + ) + (new 'static 'pat-mode-info + :name "wall" + :wall-angle 2.0 + :color (new 'static 'rgba :b #x7f :a #x40) + :hilite-color (new 'static 'rgba :b #xff :a #x80) + ) + (new 'static 'pat-mode-info + :name "obstacle" + :wall-angle 0.82 + :color (new 'static 'rgba :r #x7f :b #x7f :a #x40) + :hilite-color (new 'static 'rgba :r #xff :b #xff :a #x80) + ) + (new 'static 'pat-mode-info + :name "pole" + :wall-angle 2.0 + :color (new 'static 'rgba :r #x7f :g #x7f :a #x40) + :hilite-color (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + ) ) - (new 'static 'pat-mode-info - :name "pole" - :wall-angle 2.0 - :color (new 'static 'rgba :r #x7f :g #x7f :a #x40) - :hilite-color (new 'static 'rgba :r #xff :g #xff :a #x80) - ) - ) - ) diff --git a/goal_src/jak1/engine/collide/surface-h.gc b/goal_src/jak1/engine/collide/surface-h.gc index b27325ef13c..f55bb8d69c9 100644 --- a/goal_src/jak1/engine/collide/surface-h.gc +++ b/goal_src/jak1/engine/collide/surface-h.gc @@ -51,43 +51,39 @@ ;; Note that "surface" can apply to weird things, like riding the zoomer or swimming as well. (deftype surface (basic) - ((name symbol :offset-assert 4) - (turnv float :offset-assert 8) - (turnvv float :offset-assert 12) - (tiltv float :offset-assert 16) - (tiltvv float :offset-assert 20) - (transv-max float :offset-assert 24) - (target-speed float :offset-assert 28) - (seek0 float :offset-assert 32) - (seek90 float :offset-assert 36) - (seek180 float :offset-assert 40) - (fric float :offset-assert 44) - (nonlin-fric-dist float :offset-assert 48) - (slip-factor float :offset-assert 52) - (slide-factor float :offset-assert 56) - (slope-up-factor float :offset-assert 60) - (slope-down-factor float :offset-assert 64) - (slope-slip-angle float :offset-assert 68) - (impact-fric float :offset-assert 72) - (bend-factor float :offset-assert 76) - (bend-speed float :offset-assert 80) - (alignv float :offset-assert 84) - (slope-up-traction float :offset-assert 88) - (align-speed float :offset-assert 92) - (active-hook (function none) :offset 128) - (touch-hook (function none) :offset-assert 132) - (impact-hook function :offset-assert 136) - (mult-hook (function surface surface surface int none) :offset-assert 140) - ;; dataw went here - (mode symbol :offset-assert 144) - (flags surface-flags :offset-assert 148) - (data float 30 :offset 8) - (hook function 4 :offset 128) - (dataw uint32 2 :offset 144) + ((name symbol) + (turnv float) + (turnvv float) + (tiltv float) + (tiltvv float) + (transv-max float) + (target-speed float) + (seek0 float) + (seek90 float) + (seek180 float) + (fric float) + (nonlin-fric-dist float) + (slip-factor float) + (slide-factor float) + (slope-up-factor float) + (slope-down-factor float) + (slope-slip-angle float) + (impact-fric float) + (bend-factor float) + (bend-speed float) + (alignv float) + (slope-up-traction float) + (align-speed float) + (active-hook (function none) :offset 128) + (touch-hook (function none)) + (impact-hook function) + (mult-hook (function surface surface surface int none)) + (mode symbol) + (flags surface-flags) + (data float 30 :overlay-at turnv) + (hook function 4 :overlay-at active-hook) + (dataw uint32 2 :overlay-at mode) ) - :method-count-assert 9 - :size-assert #x98 - :flag-assert #x900000098 ) ;; these calc-terminal functions are unused. @@ -107,7 +103,7 @@ ) ) -(defmethod print surface ((this surface)) +(defmethod print ((this surface)) ;; seems this format string is wrong. (format #t diff --git a/goal_src/jak1/engine/common-obs/babak.gc b/goal_src/jak1/engine/common-obs/babak.gc index ad2ea9c3860..fbd3476ee72 100644 --- a/goal_src/jak1/engine/common-obs/babak.gc +++ b/goal_src/jak1/engine/common-obs/babak.gc @@ -9,10 +9,6 @@ (deftype babak (nav-enemy) () - :heap-base #x120 - :method-count-assert 76 - :size-assert #x190 - :flag-assert #x4c01200190 (:states babak-run-to-cannon ) @@ -239,7 +235,7 @@ ) ) -(defmethod initialize-collision babak ((this babak)) +(defmethod initialize-collision ((this babak)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -286,7 +282,7 @@ (none) ) -(defmethod nav-enemy-method-48 babak ((this babak)) +(defmethod nav-enemy-method-48 ((this babak)) (initialize-skeleton this *babak-sg* '()) (init-defaults! this *babak-nav-enemy-info*) (set! (-> this neck up) (the-as uint 0)) @@ -296,7 +292,7 @@ (none) ) -(defmethod nav-enemy-method-59 babak ((this babak)) +(defmethod nav-enemy-method-59 ((this babak)) (cond ((and (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (logtest? (-> this enemy-info options) (fact-options has-power-cell)) diff --git a/goal_src/jak1/engine/common-obs/basebutton.gc b/goal_src/jak1/engine/common-obs/basebutton.gc index 8b2d3bd4324..8a7f27c1e83 100644 --- a/goal_src/jak1/engine/common-obs/basebutton.gc +++ b/goal_src/jak1/engine/common-obs/basebutton.gc @@ -9,38 +9,36 @@ ;; DECOMP BEGINS (deftype basebutton (process-drawable) - ((root-override collide-shape-moving :offset 112) - (down? symbol :offset-assert 176) - (spawned-by-other? symbol :offset-assert 180) - (move-to? symbol :offset-assert 184) - (notify-actor entity-actor :offset-assert 188) - (timeout float :offset-assert 192) - (button-id int32 :offset-assert 196) - (event-going-down symbol :offset-assert 200) - (event-down symbol :offset-assert 204) - (event-going-up symbol :offset-assert 208) - (event-up symbol :offset-assert 212) - (anim-speed float :offset-assert 216) - (move-to-pos vector :inline :offset-assert 224) - (move-to-quat quaternion :inline :offset-assert 240) + ((root collide-shape-moving :override) + (down? symbol) + (spawned-by-other? symbol) + (move-to? symbol) + (notify-actor entity-actor) + (timeout float) + (button-id int32) + (event-going-down symbol) + (event-down symbol) + (event-going-up symbol) + (event-up symbol) + (anim-speed float) + (move-to-pos vector :inline) + (move-to-quat quaternion :inline) ) - :heap-base #x90 - :method-count-assert 32 - :size-assert #x100 - :flag-assert #x2000900100 + (:state-methods + basebutton-down-idle + basebutton-going-down + basebutton-going-up + basebutton-startup + basebutton-up-idle + ) (:methods - (basebutton-down-idle () _type_ :state 20) - (basebutton-going-down () _type_ :state 21) - (basebutton-going-up () _type_ :state 22) - (basebutton-startup () _type_ :state 23) - (basebutton-up-idle () _type_ :state 24) - (reset! (_type_) float 25) - (basebutton-method-26 (_type_) none 26) - (basebutton-method-27 (_type_) collide-shape-moving 27) - (arm-trigger-event! (_type_) symbol 28) - (basebutton-method-29 (_type_ symbol entity) none 29) - (move-to-vec-or-quat! (_type_ vector quaternion) quaternion 30) - (press! (_type_ symbol) int 31) + (reset! (_type_) float) + (basebutton-method-26 (_type_) none) + (basebutton-method-27 (_type_) collide-shape-moving) + (arm-trigger-event! (_type_) symbol) + (basebutton-method-29 (_type_ symbol entity) none) + (move-to-vec-or-quat! (_type_ vector quaternion) quaternion) + (press! (_type_ symbol) int) ) ) @@ -50,15 +48,15 @@ :bounds (static-spherem 0 0 0 3) ) -(defmethod move-to-vec-or-quat! basebutton ((this basebutton) (arg0 vector) (arg1 quaternion)) +(defmethod move-to-vec-or-quat! ((this basebutton) (arg0 vector) (arg1 quaternion)) (set! (-> this move-to?) #t) (if arg0 (set! (-> this move-to-pos quad) (-> arg0 quad)) - (set! (-> this move-to-pos quad) (-> this root-override trans quad)) + (set! (-> this move-to-pos quad) (-> this root trans quad)) ) (if arg1 (quaternion-copy! (-> this move-to-quat) arg1) - (quaternion-copy! (-> this move-to-quat) (-> this root-override quat)) + (quaternion-copy! (-> this move-to-quat) (-> this root quat)) ) ) @@ -106,8 +104,8 @@ :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) - (set! (-> self root-override trans quad) (-> self move-to-pos quad)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (rider-post) ) ) @@ -142,8 +140,8 @@ :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) - (set! (-> self root-override trans quad) (-> self move-to-pos quad)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) ) (rider-post) ) @@ -189,8 +187,8 @@ :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) - (set! (-> self root-override trans quad) (-> self move-to-pos quad)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (rider-post) ) ) @@ -225,14 +223,14 @@ :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) - (set! (-> self root-override trans quad) (-> self move-to-pos quad)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) ) (rider-post) ) ) -(defmethod press! basebutton ((this basebutton) (arg0 symbol)) +(defmethod press! ((this basebutton) (arg0 symbol)) (set! (-> this down?) arg0) (cond (arg0 @@ -248,7 +246,7 @@ ) ) -(defmethod basebutton-method-29 basebutton ((this basebutton) (arg0 symbol) (arg1 entity)) +(defmethod basebutton-method-29 ((this basebutton) (arg0 symbol) (arg1 entity)) (with-pp (when arg0 (cond @@ -278,7 +276,7 @@ ) ) -(defmethod reset! basebutton ((this basebutton)) +(defmethod reset! ((this basebutton)) (set! (-> this down?) #f) (set! (-> this spawned-by-other?) #t) (set! (-> this move-to?) #f) @@ -291,14 +289,14 @@ (set! (-> this anim-speed) 1.0) ) -(defmethod arm-trigger-event! basebutton ((this basebutton)) +(defmethod arm-trigger-event! ((this basebutton)) (let ((v0-0 'trigger)) (set! (-> this event-going-down) v0-0) v0-0 ) ) -(defmethod basebutton-method-26 basebutton ((this basebutton)) +(defmethod basebutton-method-26 ((this basebutton)) (initialize-skeleton this *generic-button-sg* '()) (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) @@ -327,12 +325,12 @@ ) ) (set! (-> this anim-speed) 2.0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (ja-post) (none) ) -(defmethod basebutton-method-27 basebutton ((this basebutton)) +(defmethod basebutton-method-27 ((this basebutton)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -367,12 +365,12 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) -(defmethod init-from-entity! basebutton ((this basebutton) (arg0 entity-actor)) +(defmethod init-from-entity! ((this basebutton) (arg0 entity-actor)) (reset! this) (set! (-> this spawned-by-other?) #f) (set! (-> this button-id) -1) @@ -398,7 +396,7 @@ (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> this timeout) (res-lump-float arg0 'timeout)) (if (not (-> this spawned-by-other?)) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) ) (arm-trigger-event! this) (basebutton-method-26 this) @@ -417,9 +415,9 @@ (set! (-> self entity) arg0) ) (basebutton-method-27 self) - (set! (-> self root-override trans quad) (-> arg1 quad)) - (quaternion-copy! (-> self root-override quat) arg2) - (set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0) + (set! (-> self root trans quad) (-> arg1 quad)) + (quaternion-copy! (-> self root quat) arg2) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (arm-trigger-event! self) (basebutton-method-26 self) (go-virtual basebutton-startup) @@ -436,20 +434,16 @@ ) (deftype warp-gate (process-drawable) - ((level symbol :offset-assert 176) - (level-slot int32 :offset-assert 180) - (min-slot int32 :offset-assert 184) - (max-slot int32 :offset-assert 188) + ((level symbol) + (level-slot int32) + (min-slot int32) + (max-slot int32) ) - :heap-base #x50 - :method-count-assert 24 - :size-assert #xc0 - :flag-assert #x18005000c0 - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (use (int level) _type_ :state 22) - (hidden () _type_ :state 23) + (:state-methods + idle + active + (use int level) + hidden ) ) diff --git a/goal_src/jak1/engine/common-obs/baseplat.gc b/goal_src/jak1/engine/common-obs/baseplat.gc index 097b50763fc..2747402ac24 100644 --- a/goal_src/jak1/engine/common-obs/baseplat.gc +++ b/goal_src/jak1/engine/common-obs/baseplat.gc @@ -45,36 +45,32 @@ ;; DECOMP BEGINS (deftype baseplat (process-drawable) - ((root-override collide-shape-moving :offset 112) - (smush smush-control :inline :offset-assert 176) - (basetrans vector :inline :offset-assert 208) - (bouncing symbol :offset-assert 224) + ((root collide-shape-moving :override) + (smush smush-control :inline) + (basetrans vector :inline) + (bouncing symbol) ) - :heap-base #x80 - :method-count-assert 27 - :size-assert #xe4 - :flag-assert #x1b008000e4 (:methods - (baseplat-method-20 (_type_) none 20) - (baseplat-method-21 (_type_) none 21) - (baseplat-method-22 (_type_) none 22) - (get-unlit-skel (_type_) skeleton-group 23) - (baseplat-method-24 (_type_) none 24) - (baseplat-method-25 (_type_) sparticle-launch-group 25) - (baseplat-method-26 (_type_) none 26) + (baseplat-method-20 (_type_) none) + (baseplat-method-21 (_type_) none) + (baseplat-method-22 (_type_) none) + (get-unlit-skel (_type_) skeleton-group) + (baseplat-method-24 (_type_) none) + (baseplat-method-25 (_type_) sparticle-launch-group) + (baseplat-method-26 (_type_) none) ) ) -(defmethod baseplat-method-21 baseplat ((this baseplat)) +(defmethod baseplat-method-21 ((this baseplat)) (logior! (-> this skel status) (janim-status inited)) - (set! (-> this basetrans quad) (-> this root-override trans quad)) + (set! (-> this basetrans quad) (-> this root trans quad)) (set! (-> this bouncing) #f) 0 (none) ) -(defmethod baseplat-method-22 baseplat ((this baseplat)) +(defmethod baseplat-method-22 ((this baseplat)) (activate! (-> this smush) -1.0 60 150 1.0 1.0) (set! (-> this bouncing) #t) (logclear! (-> this mask) (process-mask sleep)) @@ -108,14 +104,14 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self basetrans quad)) (+! (-> gp-0 y) (* 819.2 (update! (-> self smush)))) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) (if (not (!= (-> self smush amp) 0.0)) (set! (-> self bouncing) #f) ) ) (else - (move-to-point! (-> self root-override) (-> self basetrans)) + (move-to-point! (-> self root) (-> self basetrans)) ) ) (none) @@ -127,13 +123,13 @@ (none) ) -(defmethod baseplat-method-25 baseplat ((this baseplat)) +(defmethod baseplat-method-25 ((this baseplat)) (the-as sparticle-launch-group 0) ) -(defmethod baseplat-method-20 baseplat ((this baseplat)) +(defmethod baseplat-method-20 ((this baseplat)) (if (nonzero? (-> this part)) - (spawn (-> this part) (-> this root-override trans)) + (spawn (-> this part) (-> this root trans)) ) (none) ) @@ -147,31 +143,29 @@ ) (deftype eco-door (process-drawable) - ((root-override collide-shape :offset 112) - (speed float :offset-assert 176) - (open-distance float :offset-assert 180) - (close-distance float :offset-assert 184) - (out-dir vector :inline :offset-assert 192) - (open-sound sound-name :offset-assert 208) - (close-sound sound-name :offset-assert 224) - (state-actor entity-actor :offset-assert 240) - (flags eco-door-flags :offset-assert 244) - (locked symbol :offset-assert 248) - (auto-close symbol :offset-assert 252) - (one-way symbol :offset-assert 256) + ((root collide-shape :override) + (speed float) + (open-distance float) + (close-distance float) + (out-dir vector :inline) + (open-sound sound-name) + (close-sound sound-name) + (state-actor entity-actor) + (flags eco-door-flags) + (locked symbol) + (auto-close symbol) + (one-way symbol) ) - :heap-base #xa0 - :method-count-assert 27 - :size-assert #x104 - :flag-assert #x1b00a00104 + (:state-methods + door-closed + door-opening + door-open + door-closing + ) (:methods - (door-closed () _type_ :state 20) - (door-opening () _type_ :state 21) - (door-open () _type_ :state 22) - (door-closing () _type_ :state 23) - (eco-door-method-24 (_type_) none 24) - (eco-door-method-25 (_type_) none 25) - (eco-door-method-26 (_type_) none 26) + (eco-door-method-24 (_type_) none) + (eco-door-method-25 (_type_) none) + (eco-door-method-26 (_type_) none) ) ) @@ -203,12 +197,11 @@ eco-door-event-handler :code (behavior () (ja :num-func num-func-identity :frame-num 0.0) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (ja-post) (loop - (when (and *target* (>= (-> self open-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (when (and *target* + (>= (-> self open-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (eco-door-method-26 self) (if (and (not (-> self locked)) @@ -237,10 +230,10 @@ eco-door-event-handler ) ) (if gp-0 - (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root trans))) ) (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (until (ja-done? 0) (ja :num! (seek! max (-> self speed))) (if (and gp-0 (rand-vu-percent? 0.5)) @@ -260,20 +253,19 @@ eco-door-event-handler :code (behavior () (set-time! (-> self state-time)) (process-entity-status! self (entity-perm-status complete) #t) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja :num-func num-func-identity :frame-num max) (logior! (-> self draw status) (draw-status hidden)) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (ja-post) (loop (let ((f30-0 (vector4-dot (-> self out-dir) (target-pos 0))) (f28-0 (vector4-dot (-> self out-dir) (camera-pos))) ) (when (and (-> self auto-close) - (or (not *target*) (< (-> self close-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (or (not *target*) + (< (-> self close-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) ) (if (and (>= (* f30-0 f28-0) 0.0) (< 16384.0 (fabs f28-0))) @@ -290,12 +282,12 @@ eco-door-event-handler :virtual #t :event eco-door-event-handler :code (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (logclear! (-> self draw status) (draw-status hidden)) (let ((gp-0 (new 'stack 'overlaps-others-params))) (set! (-> gp-0 options) (the-as uint 1)) (set! (-> gp-0 tlist) #f) - (while (find-overlapping-shapes (-> self root-override) gp-0) + (while (find-overlapping-shapes (-> self root) gp-0) (suspend) ) ) @@ -312,7 +304,7 @@ eco-door-event-handler :post transform-post ) -(defmethod eco-door-method-26 eco-door ((this eco-door)) +(defmethod eco-door-method-26 ((this eco-door)) (when (-> this state-actor) (if (logtest? (-> this state-actor extra perm status) (entity-perm-status complete)) (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf01))) @@ -323,7 +315,7 @@ eco-door-event-handler (none) ) -(defmethod eco-door-method-24 eco-door ((this eco-door)) +(defmethod eco-door-method-24 ((this eco-door)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -336,22 +328,22 @@ eco-door-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod eco-door-method-25 eco-door ((this eco-door)) +(defmethod eco-door-method-25 ((this eco-door)) 0 (none) ) -(defmethod init-from-entity! eco-door ((this eco-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-door) (arg0 entity-actor)) (eco-door-method-24 this) (process-drawable-from-entity! this arg0) (let ((f0-0 (res-lump-float (-> this entity) 'scale :default 1.0))) - (set-vector! (-> this root-override scale) f0-0 f0-0 f0-0 1.0) + (set-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0) ) (set! (-> this open-distance) 32768.0) (set! (-> this close-distance) 49152.0) @@ -367,9 +359,9 @@ eco-door-event-handler (eco-door-method-26 this) (set! (-> this auto-close) (logtest? (-> this flags) (eco-door-flags auto-close))) (set! (-> this one-way) (logtest? (-> this flags) (eco-door-flags one-way))) - (vector-z-quaternion! (-> this out-dir) (-> this root-override quat)) - (set! (-> this out-dir w) (- (vector-dot (-> this out-dir) (-> this root-override trans)))) - (update-transforms! (-> this root-override)) + (vector-z-quaternion! (-> this out-dir) (-> this root quat)) + (set! (-> this out-dir w) (- (vector-dot (-> this out-dir) (-> this root trans)))) + (update-transforms! (-> this root)) (eco-door-method-25 this) (if (and (not (-> this auto-close)) (-> this entity) diff --git a/goal_src/jak1/engine/common-obs/collectables.gc b/goal_src/jak1/engine/common-obs/collectables.gc index 3803f4917d2..adaa264f072 100644 --- a/goal_src/jak1/engine/common-obs/collectables.gc +++ b/goal_src/jak1/engine/common-obs/collectables.gc @@ -25,49 +25,45 @@ (define *eco-pill-count* 0) (deftype collectable (process-drawable) - ((root-override collide-shape-moving :offset 112) - (pickup-type pickup-type :offset-assert 176) - (pickup-amount float :offset-assert 180) - (notify-parent basic :offset-assert 184) - (old-base vector :inline :offset-assert 192) - (base vector :inline :offset-assert 208) - (extra-trans vector :inline :offset-assert 224) - (jump-pos vector :inline :offset-assert 240) - (flags collectable-flags :offset-assert 256) - (birth-time time-frame :offset-assert 264) - (collect-timeout time-frame :offset-assert 272) - (fadeout-timeout time-frame :offset-assert 280) - (bob-offset int64 :offset-assert 288) - (bob-amount float :offset-assert 296) - (pickup-handle handle :offset-assert 304) - (actor-pause symbol :offset-assert 312) + ((root collide-shape-moving :override) + (pickup-type pickup-type) + (pickup-amount float) + (notify-parent basic) + (old-base vector :inline) + (base vector :inline) + (extra-trans vector :inline) + (jump-pos vector :inline) + (flags collectable-flags) + (birth-time time-frame) + (collect-timeout time-frame) + (fadeout-timeout time-frame) + (bob-offset int64) + (bob-amount float) + (pickup-handle handle) + (actor-pause symbol) ) - :heap-base #xd0 - :method-count-assert 22 - :size-assert #x13c - :flag-assert #x1600d0013c (:methods - (initialize (_type_) _type_ 20) - (initialize-params (_type_ time-frame float) none 21) + (initialize (_type_) _type_) + (initialize-params (_type_ time-frame float) none) ) ) -(defmethod initialize-params collectable ((this collectable) (arg0 time-frame) (arg1 float)) +(defmethod initialize-params ((this collectable) (arg0 time-frame) (arg1 float)) (logclear! (-> this mask) (process-mask crate enemy platform ambient)) (logior! (-> this mask) (process-mask collectable)) (set! (-> this flags) (collectable-flags can-collect ignore-blue)) (set! (-> this bob-amount) arg1) - (set! (-> this bob-offset) (+ (the-as int (-> this root-override trans x)) - (the-as int (-> this root-override trans y)) - (the-as int (-> this root-override trans z)) + (set! (-> this bob-offset) (+ (the-as int (-> this root trans x)) + (the-as int (-> this root trans y)) + (the-as int (-> this root trans z)) ) ) (cond - ((or (= (vector-length (-> this root-override transv)) 0.0) + ((or (= (vector-length (-> this root transv)) 0.0) (logtest? (-> this fact options) (fact-options instant-collect)) ) - (vector-reset! (-> this root-override transv)) + (vector-reset! (-> this root transv)) ) (else (logior! (-> this flags) (collectable-flags trans)) @@ -82,8 +78,8 @@ ) (set! (-> this collect-timeout) (seconds 0.33)) (set-time! (-> this birth-time)) - (set! (-> this base quad) (-> this root-override trans quad)) - (set! (-> this old-base quad) (-> this root-override trans quad)) + (set! (-> this base quad) (-> this root trans quad)) + (set! (-> this old-base quad) (-> this root trans quad)) (set! (-> this pickup-handle) (the-as handle #f)) (case (-> this fact pickup-type) (((pickup-type eco-pill) (pickup-type eco-green) (pickup-type money) (pickup-type eco-blue)) @@ -91,45 +87,41 @@ ) ) (if (logtest? (-> this fact options) (fact-options large)) - (set! (-> this root-override root-prim local-sphere w) - (* 2.5 (-> this root-override root-prim local-sphere w)) - ) + (set! (-> this root root-prim local-sphere w) (* 2.5 (-> this root root-prim local-sphere w))) ) (none) ) (deftype eco-collectable (collectable) - ((eco-effect sparticle-launch-group :offset-assert 316) - (collect-effect sparticle-launch-group :offset-assert 320) - (collect-effect2 sparticle-launch-group :offset-assert 324) - (collect-effect-time time-frame :offset-assert 328) - (respawn-delay time-frame :offset-assert 336) - (sound-name sound-spec :offset-assert 344) - (target handle :offset-assert 352) - (suck-time time-frame :offset-assert 360) - (suck-y-offset float :offset-assert 368) - (speed vector :inline :offset-assert 384) - (movie-pos-index int32 :offset-assert 400) + ((eco-effect sparticle-launch-group) + (collect-effect sparticle-launch-group) + (collect-effect2 sparticle-launch-group) + (collect-effect-time time-frame) + (respawn-delay time-frame) + (sound-name sound-spec) + (target handle) + (suck-time time-frame) + (suck-y-offset float) + (speed vector :inline) + (movie-pos-index int32) ) - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 + (:state-methods + wait + (pickup object handle) + die + jump + (notice-blue handle) + ) (:methods - (wait () _type_ :state 22) - (pickup (object handle) _type_ :state 23) - (die () _type_ :state 24) - (jump () _type_ :state 25) - (notice-blue (handle) _type_ :state 26) - (initialize-effect (_type_ pickup-type) none 27) - (initialize-eco (_type_ entity-actor pickup-type float) object 28) - (animate (_type_) none 29) - (blocked () _type_ :state 30) + (initialize-effect (_type_ pickup-type) none) + (initialize-eco (_type_ entity-actor pickup-type float) object) + (animate (_type_) none) + (blocked () _type_ :state) ) ) -(defmethod initialize eco-collectable ((this eco-collectable)) +(defmethod initialize ((this eco-collectable)) (stack-size-set! (-> this main-thread) 192) ;; og:preserve-this hack increased from 128 (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #t) @@ -148,7 +140,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) (if (logtest? (fact-options respawn) (-> this fact options)) @@ -157,7 +149,7 @@ this ) -(defmethod initialize-effect eco-collectable ((this eco-collectable) (arg0 pickup-type)) +(defmethod initialize-effect ((this eco-collectable) (arg0 pickup-type)) (set! (-> this fact pickup-type) arg0) (case (-> this fact pickup-type) (((pickup-type eco-blue) (pickup-type eco-red) (pickup-type eco-green) (pickup-type eco-yellow)) @@ -202,7 +194,7 @@ ) (set! (-> this part) (create-launch-control (-> this eco-effect) this)) (if (-> this sound-name) - (set! (-> this sound) (new 'process 'ambient-sound (-> this sound-name) (-> this root-override trans))) + (set! (-> this sound) (new 'process 'ambient-sound (-> this sound-name) (-> this root trans))) ) (none) ) @@ -218,8 +210,8 @@ (set! (-> self fact pickup-amount) f30-0) ) (set! (-> self fact options) (-> arg2 options)) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set! (-> self root-override transv quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root transv quad) (-> arg1 quad)) (initialize-effect self (-> self fact pickup-type)) (set! (-> self notify-parent) #f) (case (-> self fact pickup-type) @@ -238,7 +230,7 @@ (initialize-params self (seconds 15) (the-as float 1024.0)) ) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (set! (-> self event-hook) (-> (method-of-object self wait) event)) (if (logtest? (fact-options eco-blocked) (-> self fact options)) (go-virtual blocked) @@ -247,21 +239,21 @@ (none) ) -(defmethod initialize-eco eco-collectable ((this eco-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) +(defmethod initialize-eco ((this eco-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) (set! (-> this pickup-amount) arg2) (set! (-> this pickup-type) arg1) (initialize this) - (set! (-> this root-override trans quad) (-> arg0 extra trans quad)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) (initialize-effect this (-> this fact pickup-type)) (initialize-params this 0 (the-as float 1024.0)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (if (logtest? (fact-options eco-blocked) (-> this fact options)) (go (method-of-object this blocked)) ) (go (method-of-object this wait)) ) -(defmethod animate eco-collectable ((this eco-collectable)) +(defmethod animate ((this eco-collectable)) 0 (none) ) @@ -298,7 +290,7 @@ ) ) (when v1-3 - (let ((a0-5 (-> self root-override root-prim prim-core)) + (let ((a0-5 (-> self root root-prim prim-core)) (a1-2 (-> (the-as collide-shape v1-3) root-prim prim-core)) ) (if (< (vector-vector-distance (the-as vector a0-5) (the-as vector a1-2)) (-> *FACT-bank* suck-suck-dist)) @@ -327,7 +319,7 @@ ) ) (when v1-6 - (let ((s2-0 (-> self root-override root-prim prim-core)) + (let ((s2-0 (-> self root root-prim prim-core)) (gp-2 (-> v1-6 root-prim prim-core)) ) (if (and arg1 (rand-vu-percent? (the-as float 0.25))) @@ -371,7 +363,7 @@ (go-virtual wait) ) (arg1 - (add-blue-shake (-> self root-override trans) (the-as vector s2-0) (the-as vector gp-2)) + (add-blue-shake (-> self root trans) (the-as vector s2-0) (the-as vector gp-2)) ) ) ) @@ -404,7 +396,7 @@ (set! (-> self base y) (-> self jump-pos y)) (setup-from-to-duration! gp-1 - (-> self root-override trans) + (-> self root trans) (-> self jump-pos) (the-as float 300.0) (the-as float -2.2755556) @@ -412,7 +404,7 @@ (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 1)) (let ((f0-2 (the float (- (current-time) (-> self state-time))))) - (eval-position! gp-1 f0-2 (-> self root-override trans)) + (eval-position! gp-1 f0-2 (-> self root trans)) ) (transform-post) (animate self) @@ -422,10 +414,10 @@ ) ) ) - (set! (-> self root-override trans quad) (-> self jump-pos quad)) - (set! (-> self base quad) (-> self root-override trans quad)) - (vector-reset! (-> self root-override transv)) - (update-transforms! (-> self root-override)) + (set! (-> self root trans quad) (-> self jump-pos quad)) + (set! (-> self base quad) (-> self root trans quad)) + (vector-reset! (-> self root transv)) + (update-transforms! (-> self root)) (logclear! (-> self flags) (collectable-flags trans)) (logior! (-> self flags) (collectable-flags can-collect)) (if (-> self actor-pause) @@ -462,8 +454,8 @@ ) ) ((= message 'trans) - (set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad)) - (update-transforms! (-> self root-override)) + (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) + (update-transforms! (-> self root)) (ja-post) ) ((= message 'jump) @@ -474,7 +466,7 @@ ((= message 'pickup) (when (!= (-> self next-state name) 'pickup) (if (and (> argc 0) (-> block param 0)) - (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (the-as handle #f)) @@ -526,24 +518,24 @@ (cond ((logtest? (-> self flags) (collectable-flags trans)) (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) (the-as float 0.0)) + (-> self root transv) + (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) (the-as float 0.0)) ) - (integrate-no-collide! (-> self root-override) (-> self root-override transv)) - (when (and (>= 0.0 (-> self root-override transv y)) (>= (-> self base y) (-> self root-override trans y))) - (set! (-> self root-override trans y) (-> self base y)) + (integrate-no-collide! (-> self root) (-> self root transv)) + (when (and (>= 0.0 (-> self root transv y)) (>= (-> self base y) (-> self root trans y))) + (set! (-> self root trans y) (-> self base y)) (cond - ((< (-> self root-override transv y) -8192.0) - (set! (-> self root-override transv y) (* -0.5 (-> self root-override transv y))) + ((< (-> self root transv y) -8192.0) + (set! (-> self root transv y) (* -0.5 (-> self root transv y))) ) (else - (vector-reset! (-> self root-override transv)) + (vector-reset! (-> self root transv)) (logclear! (-> self flags) (collectable-flags trans)) (logior! (-> self flags) (collectable-flags can-collect)) (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) - (set! (-> self base quad) (-> self root-override trans quad)) + (set! (-> self base quad) (-> self root trans quad)) (if (and (logtest? (-> self fact options) (fact-options can-collect)) (not (logtest? (-> self flags) (collectable-flags ignore-blue))) ) @@ -563,12 +555,12 @@ (set! (-> self trans-hook) #f) ) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) ) :code (behavior () (loop (let ((gp-0 (-> self part)) - (s5-0 (-> self root-override root-prim prim-core)) + (s5-0 (-> self root root-prim prim-core)) ) (when (and (logtest? (-> self flags) (collectable-flags fade)) (time-elapsed? (-> self birth-time) (-> self fadeout-timeout)) @@ -644,14 +636,14 @@ ) :code (behavior ((arg0 handle)) (loop - (set! (-> self root-override trans quad) (-> self base quad)) + (set! (-> self root trans quad) (-> self base quad)) (add-blue-motion #t #f #t #f) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (if (nonzero? (-> self draw)) (ja-post) ) (let ((a0-5 (-> self part)) - (a1-1 (-> self root-override root-prim prim-core)) + (a1-1 (-> self root root-prim prim-core)) ) (if (nonzero? a0-5) (spawn a0-5 (the-as vector a1-1)) @@ -727,7 +719,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) ) :code (behavior ((arg0 object) (arg1 handle)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (if (not (or (= (-> self fact pickup-type) (pickup-type eco-pill)) (logtest? (-> self fact options) (fact-options powerup)) ) @@ -778,7 +770,7 @@ part-tracker-track-target #f #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to gp-6 ) ) @@ -820,7 +812,7 @@ ) (process->handle self) #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to self ) ) @@ -840,16 +832,12 @@ (deftype eco (eco-collectable) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) -(defmethod animate eco ((this eco)) +(defmethod animate ((this eco)) (let ((a0-1 (-> this part)) - (a1-0 (-> this root-override root-prim prim-core)) + (a1-0 (-> this root root-prim prim-core)) ) (spawn a0-1 (the-as vector a1-0)) ) @@ -903,66 +891,50 @@ ) ) (set! (-> self base quad) (-> self old-base quad)) - (set! (-> self root-override trans quad) (-> self base quad)) - (restore-collide-with-as (-> self root-override)) + (set! (-> self root trans quad) (-> self base quad)) + (restore-collide-with-as (-> self root)) (go-virtual wait) ) ) (deftype eco-yellow (eco) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) -(defmethod init-from-entity! eco-yellow ((this eco-yellow) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) (none) ) (deftype eco-red (eco) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) -(defmethod init-from-entity! eco-red ((this eco-red) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-red) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) (none) ) (deftype eco-blue (eco) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) -(defmethod init-from-entity! eco-blue ((this eco-blue) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) (none) ) (deftype health (eco-collectable) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) -(defmethod animate health ((this health)) +(defmethod animate ((this health)) (let ((a0-1 (-> this part)) - (a1-0 (-> this root-override root-prim prim-core)) + (a1-0 (-> this root root-prim prim-core)) ) (spawn a0-1 (the-as vector a1-0)) ) @@ -973,23 +945,19 @@ (none) ) -(defmethod init-from-entity! health ((this health) (arg0 entity-actor)) +(defmethod init-from-entity! ((this health) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-green) (-> *FACT-bank* health-single-inc)) (none) ) (deftype eco-pill (eco-collectable) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) -(defmethod animate eco-pill ((this eco-pill)) +(defmethod animate ((this eco-pill)) (let ((a0-1 (-> this part)) - (a1-0 (-> this root-override root-prim prim-core)) + (a1-0 (-> this root root-prim prim-core)) ) (spawn a0-1 (the-as vector a1-0)) ) @@ -1000,18 +968,18 @@ (none) ) -(defmethod init-from-entity! eco-pill ((this eco-pill) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-pill) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-pill) (-> *FACT-bank* health-small-inc)) (none) ) -(defmethod deactivate eco-pill ((this eco-pill)) +(defmethod deactivate ((this eco-pill)) (set! *eco-pill-count* (+ *eco-pill-count* -1)) ((method-of-type eco-collectable deactivate) this) (none) ) -(defmethod initialize eco-pill ((this eco-pill)) +(defmethod initialize ((this eco-pill)) (set! *eco-pill-count* (+ *eco-pill-count* 1)) (stack-size-set! (-> this main-thread) 192) ;; og:preserve-this hack increased from 128 (logior! (-> this mask) (process-mask actor-pause)) @@ -1031,7 +999,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) this @@ -1051,19 +1019,15 @@ (deftype money (eco-collectable) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) -(defmethod run-logic? money ((this money)) +(defmethod run-logic? ((this money)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status was-drawn)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root-override pause-adjust-distance)) - (vector-vector-distance (-> this root-override trans) (math-camera-pos)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) ) (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) @@ -1072,7 +1036,7 @@ ) ) -(defmethod deactivate money ((this money)) +(defmethod deactivate ((this money)) (when (= (-> this next-state name) 'pickup) (if (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status dead)))) (format #t "money ~A was killed in pickup~%") @@ -1087,14 +1051,10 @@ :virtual #t :code (behavior () (loop - (quaternion-rotate-y! - (-> self root-override quat) - (-> self root-override quat) - (* 40049.777 (seconds-per-frame)) - ) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 40049.777 (seconds-per-frame))) (let ((f30-0 (-> self bob-amount))) (when (< 0.0 f30-0) - (set! (-> self root-override trans y) + (set! (-> self root trans y) (+ (-> self base y) (-> self suck-y-offset) (* f30-0 @@ -1102,14 +1062,14 @@ ) ) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) ) ) (ja-post) ;; og:preserve-this added particle! (with-pc (if (-> *pc-settings* money-starburst?) - (spawn (-> self part) (-> self root-override root-prim world-sphere)))) + (spawn (-> self part) (-> self root root-prim world-sphere)))) (suspend) ) ) @@ -1119,16 +1079,12 @@ :virtual #t :code (behavior ((arg0 handle)) (loop - (quaternion-rotate-y! - (-> self root-override quat) - (-> self root-override quat) - (* 91022.22 (seconds-per-frame)) - ) - (set! (-> self root-override trans quad) (-> self base quad)) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 91022.22 (seconds-per-frame))) + (set! (-> self root trans quad) (-> self base quad)) (add-blue-motion #t #t #t #f) (let ((f30-0 (-> self bob-amount))) (if (< 0.0 f30-0) - (set! (-> self root-override trans y) + (set! (-> self root trans y) (+ (-> self base y) (-> self suck-y-offset) (* f30-0 @@ -1142,7 +1098,7 @@ ;; og:preserve-this added particle! (with-pc (if (-> *pc-settings* money-starburst?) - (spawn (-> self part) (-> self root-override root-prim world-sphere)))) + (spawn (-> self part) (-> self root root-prim world-sphere)))) (suspend) ) ) @@ -1156,13 +1112,13 @@ (kill-and-free-particles (-> self part)) ) (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (process-entity-status! self (entity-perm-status dead) #t) (convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* money)))) ) ) -(defmethod initialize money ((this money)) +(defmethod initialize ((this money)) (stack-size-set! (-> this main-thread) 192) ;; og:preserve-this hack increased from 128 (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1178,7 +1134,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #t) @@ -1197,7 +1153,7 @@ ) (initialize-skeleton this *money-sg* '()) (if (-> this entity) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) ) (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) @@ -1206,11 +1162,11 @@ this ) -(defmethod init-from-entity! money ((this money) (arg0 entity-actor)) +(defmethod init-from-entity! ((this money) (arg0 entity-actor)) (initialize this) (process-drawable-from-entity! this (-> this entity)) (initialize-params this 0 (the-as float 1024.0)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go (method-of-object this wait)) (none) ) @@ -1228,12 +1184,12 @@ ) (set! (-> self fact options) (-> arg2 options)) (set! (-> self notify-parent) #t) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-identity! (-> self root-override quat)) - (vector-identity! (-> self root-override scale)) - (set! (-> self root-override transv quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self root transv quad) (-> arg1 quad)) (initialize-params self (seconds 15) (the-as float 1024.0)) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (set! (-> self event-hook) (-> (method-of-object self wait) event)) (go-virtual wait) (none) @@ -1247,13 +1203,13 @@ (set! (-> self fact pickup-type) (the-as pickup-type arg2)) (set! (-> self fact pickup-amount) arg3) (set! (-> self notify-parent) #t) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-identity! (-> self root-override quat)) - (vector-identity! (-> self root-override scale)) - (set! (-> self root-override transv quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self root transv quad) (-> arg1 quad)) (initialize-params self (seconds 15) (the-as float 0.0)) (logior! (-> self flags) (collectable-flags ignore-blue)) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (set! (-> self event-hook) (-> (method-of-object self wait) event)) (go-virtual wait) (none) @@ -1262,13 +1218,9 @@ (define *fuel-cell-tune-pos* (new 'static 'vector :w 1000000000.0)) (deftype fuel-cell (eco-collectable) - ((victory-anim spool-anim :offset-assert 404) - (state-object symbol :offset-assert 408) + ((victory-anim spool-anim) + (state-object symbol) ) - :heap-base #x130 - :method-count-assert 31 - :size-assert #x19c - :flag-assert #x1f0130019c (:states (fuel-cell-clone-anim handle) (fuel-cell-spline-slider handle float float) @@ -1362,14 +1314,14 @@ ) ) (else - (let* ((gp-1 (-> self root-override)) + (let* ((gp-1 (-> self root)) (v1-20 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) gp-1 ) ) (gp-2 (if v1-20 (-> v1-20 root-prim prim-core) - (-> self root-override trans) + (-> self root trans) ) ) ) @@ -1412,14 +1364,14 @@ ) (cond ((= message 'trans) - (set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad)) - (set! (-> self base quad) (-> self root-override trans quad)) - (update-transforms! (-> self root-override)) + (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self base quad) (-> self root trans quad)) + (update-transforms! (-> self root)) ) ((= message 'pickup) (when (!= (-> self next-state name) 'pickup) (if (and (> argc 0) (-> block param 0)) - (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (process->handle *target*)) @@ -1427,8 +1379,8 @@ ) ((= message 'collide-shape) (if (-> block param 0) - (restore-collide-with-as (-> self root-override)) - (clear-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) + (clear-collide-with-as (-> self root)) ) ) ((= message 'movie-pos) @@ -1463,7 +1415,7 @@ (seek f28-0 (the-as float 0.0) (* 3072.0 (seconds-per-frame))) ) ) - (set! (-> self root-override trans y) (+ (-> self base y) (* 2867.2 (sin f28-0)))) + (set! (-> self root trans y) (+ (-> self base y) (* 2867.2 (sin f28-0)))) (let ((f30-1 (lerp-scale (the-as float 0.6) (the-as float 0.5) f30-0 (the-as float 8192.0) (-> *FACT-bank* suck-suck-dist)) ) @@ -1549,7 +1501,7 @@ :code (behavior ((arg0 object) (arg1 handle)) (local-vars (sv-96 res-tag)) (sound-play "pu-powercell") - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) (process-entity-status! self (entity-perm-status dead) #t) @@ -1588,25 +1540,19 @@ ) (cond ((and *debug-segment* (< (-> *fuel-cell-tune-pos* w) 1000000000.0)) - (move-to-point! (-> self root-override) *fuel-cell-tune-pos*) - (set-yaw-angle-clear-roll-pitch! (-> self root-override) (-> *fuel-cell-tune-pos* w)) + (move-to-point! (-> self root) *fuel-cell-tune-pos*) + (set-yaw-angle-clear-roll-pitch! (-> self root) (-> *fuel-cell-tune-pos* w)) ) ((= (-> self movie-pos-index) -1) ) (gp-1 - (move-to-point! (-> self root-override) gp-1) - (set-yaw-angle-clear-roll-pitch! (-> self root-override) (-> gp-1 w)) + (move-to-point! (-> self root) gp-1) + (set-yaw-angle-clear-roll-pitch! (-> self root) (-> gp-1 w)) ) (else - (move-to-point! (-> self root-override) (-> *target* control trans)) - (set-yaw-angle-clear-roll-pitch! (-> self root-override) (y-angle (-> *target* control))) - (move-to-ground - (-> self root-override) - (the-as float 40960.0) - (the-as float 40960.0) - #f - (collide-kind background) - ) + (move-to-point! (-> self root) (-> *target* control trans)) + (set-yaw-angle-clear-roll-pitch! (-> self root) (y-angle (-> *target* control))) + (move-to-ground (-> self root) (the-as float 40960.0) (the-as float 40960.0) #f (collide-kind background)) ) ) ) @@ -1900,12 +1846,12 @@ :post (behavior () (transform-post) (if (-> self state-object) - (spawn (-> self part) (the-as vector (-> self root-override root-prim prim-core))) + (spawn (-> self part) (the-as vector (-> self root root-prim prim-core))) ) ) ) -(defmethod initialize fuel-cell ((this fuel-cell)) +(defmethod initialize ((this fuel-cell)) (stack-size-set! (-> this main-thread) 512) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1922,29 +1868,29 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #t) (set! (-> this notify-parent) #f) (set! (-> this fact) (new 'process 'fact-info this (pickup-type fuel-cell) (the-as float 0.0))) (initialize-skeleton this *fuel-cell-sg* '()) - (set! (-> this base quad) (-> this root-override trans quad)) - (set! (-> this old-base quad) (-> this root-override trans quad)) + (set! (-> this base quad) (-> this root trans quad)) + (set! (-> this old-base quad) (-> this root trans quad)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 63) this)) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "powercell-idle" :fo-max 40) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "powercell-idle" :fo-max 40) (-> this root trans)) ) (set! (-> this victory-anim) (fuel-cell-pick-anim this)) this ) -(defmethod init-from-entity! fuel-cell ((this fuel-cell) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fuel-cell) (arg0 entity-actor)) (initialize this) (process-drawable-from-entity! this (-> this entity)) (initialize-params this 0 (the-as float 1024.0)) (logclear! (-> this fact options) (fact-options can-collect)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go (method-of-object this wait)) (none) ) @@ -1962,13 +1908,13 @@ ) (set! (-> self fact options) (-> arg2 options)) (set! (-> self notify-parent) #t) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-identity! (-> self root-override quat)) - (vector-identity! (-> self root-override scale)) - (set! (-> self root-override transv quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self root transv quad) (-> arg1 quad)) (initialize-params self 0 (the-as float 1024.0)) (logclear! (-> self fact options) (fact-options can-collect)) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (let ((gp-1 (res-lump-struct (-> self entity) 'movie-pos structure :time (the-as float -1000000000.0)))) (cond ((and *debug-segment* (< (-> *fuel-cell-tune-pos* w) 1000000000.0)) @@ -2000,20 +1946,20 @@ (('pickup) (when (!= (-> self next-state name) 'pickup) (if (and (> argc 0) (-> block param 0)) - (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (the-as handle #f)) ) ) (('trans) - (set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad)) - (set! (-> self base quad) (-> self root-override trans quad)) - (update-transforms! (-> self root-override)) + (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self base quad) (-> self root trans quad)) + (update-transforms! (-> self root)) ) (('stop-cloning 'notify) - (set! (-> self root-override trans quad) (-> self draw origin quad)) - (set! (-> self base quad) (-> self root-override trans quad)) + (set! (-> self root trans quad) (-> self draw origin quad)) + (set! (-> self base quad) (-> self root trans quad)) (ja-channel-set! 1) (ja :group! fuel-cell-idle-ja) (logclear! (-> self draw status) (draw-status hidden)) @@ -2035,7 +1981,7 @@ (deactivate self) ) :post (behavior () - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (animate self) ) ) @@ -2059,26 +2005,18 @@ ) (deftype buzzer (eco-collectable) - ((victory-anim spool-anim :offset-assert 404) + ((victory-anim spool-anim) ) - :heap-base #x130 - :method-count-assert 31 - :size-assert #x198 - :flag-assert #x1f01300198 ) -(defmethod animate buzzer ((this buzzer)) - (quaternion-rotate-y! - (-> this root-override quat) - (-> this root-override quat) - (* 40049.777 (seconds-per-frame)) - ) +(defmethod animate ((this buzzer)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 param 0) 1.0) (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((f0-3 (y-angle (-> this root-override)))) + (let ((f0-3 (y-angle (-> this root)))) (set! (-> *part-id-table* 239 init-specs 4 initial-valuef) (+ 16384.0 f0-3)) (set! (-> *part-id-table* 240 init-specs 4 initial-valuef) (+ 16384.0 f0-3)) ) @@ -2086,7 +2024,7 @@ (if (nonzero? (-> this sound)) (update! (-> this sound)) ) - (if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0)) + (if (and *target* (>= (-> *target* fact buzzer) 6.0)) (spool-push *art-control* (-> this victory-anim name) 0 this (the-as float -99.0)) ) 0 @@ -2150,12 +2088,12 @@ ) ) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) (when (not arg0) - (let ((v1-18 (manipy-spawn (-> self root-override trans) #f *buzzer-sg* #f :to *entity-pool*))) + (let ((v1-18 (manipy-spawn (-> self root trans) #f *buzzer-sg* #f :to *entity-pool*))) (send-event (ppointer->process v1-18) 'become-hud-object (ppointer->process (-> *hud-parts* buzzers))) ) ) @@ -2174,21 +2112,20 @@ ) (logior! (-> self fact options) (fact-options instant-collect skip-jump-anim)) ) - (let ((v1-47 - (birth-pickup-at-point - (vector+! (new 'stack-no-clear 'vector) (-> self root-override trans) (new 'static 'vector :y 4096.0 :w 1.0)) - (pickup-type fuel-cell) - (the float s5-2) - #f - self - (-> self fact) - ) - ) + (let ((v1-47 (birth-pickup-at-point + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 4096.0 :w 1.0)) + (pickup-type fuel-cell) + (the float s5-2) + #f + self + (-> self fact) + ) + ) ) (when v1-47 (send-event (ppointer->process v1-47) 'movie-pos (-> self movie-pos-index)) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (while (-> self child) (suspend) @@ -2218,7 +2155,7 @@ ) ) -(defmethod initialize buzzer ((this buzzer)) +(defmethod initialize ((this buzzer)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -2233,7 +2170,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #t) @@ -2242,19 +2179,19 @@ (initialize-skeleton this *buzzer-sg* '()) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 65) this)) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "buzzer" :fo-max 40) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "buzzer" :fo-max 40) (-> this root trans)) ) (set! (-> this victory-anim) (fuel-cell-pick-anim this)) this ) -(defmethod init-from-entity! buzzer ((this buzzer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this buzzer) (arg0 entity-actor)) (initialize this) (process-drawable-from-entity! this (-> this entity)) (initialize-params this 0 (the-as float 1024.0)) (set! (-> this collect-timeout) (seconds 2)) - (update-transforms! (-> this root-override)) - (update-trans! (-> this sound) (-> this root-override trans)) + (update-transforms! (-> this root)) + (update-trans! (-> this sound) (-> this root trans)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go (method-of-object this wait)) (go (method-of-object this pickup) #t (the-as handle #f)) @@ -2275,19 +2212,19 @@ ) (set! (-> self fact options) (-> arg2 options)) (set! (-> self notify-parent) #t) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-identity! (-> self root-override quat)) - (vector-identity! (-> self root-override scale)) - (set! (-> self root-override transv quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self root transv quad) (-> arg1 quad)) (initialize-params self 0 (the-as float 1024.0)) - (update-transforms! (-> self root-override)) - (update-trans! (-> self sound) (-> self root-override trans)) + (update-transforms! (-> self root)) + (update-trans! (-> self sound) (-> self root trans)) (set! (-> self event-hook) (-> (method-of-object self wait) event)) (go-virtual wait) (none) ) -(defmethod init-from-entity! eco ((this eco) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco) (arg0 entity-actor)) (let ((v1-2 (res-lump-value (-> this entity) 'eco-info pickup-type :time (the-as float -1000000000.0)))) (set! (-> this type) (cond ((= v1-2 (pickup-type eco-blue)) @@ -2523,7 +2460,7 @@ sv-192 ) -(defmethod drop-pickup fact-info ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) +(defmethod drop-pickup ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) (let ((s3-0 (-> this pickup-type)) (f30-0 (-> this pickup-amount)) ) @@ -2533,17 +2470,11 @@ (set! s3-0 (pickup-type eco-pill)) (set! f30-0 (cond - ((and (= s1-0 1) - *target* - (and (>= 1.0 (-> *target* fact-info-target health)) (rand-vu-percent? (the-as float 0.1))) - ) + ((and (= s1-0 1) *target* (and (>= 1.0 (-> *target* fact health)) (rand-vu-percent? (the-as float 0.1)))) (set! s3-0 (pickup-type eco-green)) 1.0 ) - ((and (< 1 s1-0) - *target* - (and (>= 2.0 (-> *target* fact-info-target health)) (rand-vu-percent? (the-as float 0.05))) - ) + ((and (< 1 s1-0) *target* (and (>= 2.0 (-> *target* fact health)) (rand-vu-percent? (the-as float 0.05)))) (set! s3-0 (pickup-type eco-green)) 1.0 ) @@ -2592,15 +2523,11 @@ ) (deftype ecovalve (process-drawable) - ((root-override collide-shape-moving :offset 112) - (offset vector :inline :offset-assert 176) - (offset-target vector :inline :offset-assert 192) - (block-func (function vent symbol) :offset-assert 208) + ((root collide-shape-moving :override) + (offset vector :inline) + (offset-target vector :inline) + (block-func (function vent symbol)) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd4 - :flag-assert #x14007000d4 (:states ecovalve-idle ) @@ -2624,11 +2551,11 @@ ) (when (!= (-> self offset-target y) (-> self offset y)) (vector-seek! (-> self offset) (-> self offset-target) (* 4096.0 (seconds-per-frame))) - (move-to-point! (-> self root-override) (vector+! - (new 'stack-no-clear 'vector) - (-> (the-as process-drawable (-> self parent 0)) root trans) - (-> self offset) - ) + (move-to-point! (-> self root) (vector+! + (new 'stack-no-clear 'vector) + (-> (the-as process-drawable (-> self parent 0)) root trans) + (-> self offset) + ) ) (transform-post) ) @@ -2656,45 +2583,41 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) ) (set! (-> self block-func) arg0) - (set! (-> self root-override trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) + (set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) (set-vector! (-> self offset-target) 0.0 -2252.8 0.0 1.0) (if (not ((-> self block-func) (the-as vent (ppointer->process (-> self parent))))) (set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0) ) (set! (-> self offset quad) (-> self offset-target quad)) (initialize-skeleton self *ecovalve-sg* '()) - (move-to-point! (-> self root-override) (vector+! - (new 'stack-no-clear 'vector) - (-> (the-as process-drawable (-> self parent 0)) root trans) - (-> self offset) - ) + (move-to-point! (-> self root) (vector+! + (new 'stack-no-clear 'vector) + (-> (the-as process-drawable (-> self parent 0)) root trans) + (-> self offset) + ) ) (go ecovalve-idle) (none) ) (deftype vent (process-drawable) - ((root-override collide-shape :offset 112) - (show-particles symbol :offset-assert 176) - (collect-effect sparticle-launch-group :offset-assert 180) - (collect-effect2 sparticle-launch-group :offset-assert 184) - (collect-effect-time time-frame :offset-assert 192) - (blocker entity-actor :offset-assert 200) - (block-func (function vent symbol) :offset-assert 204) - (pickup-handle handle :offset-assert 208) + ((root collide-shape :override) + (show-particles symbol) + (collect-effect sparticle-launch-group) + (collect-effect2 sparticle-launch-group) + (collect-effect-time time-frame) + (blocker entity-actor) + (block-func (function vent symbol)) + (pickup-handle handle) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15007000d8 (:methods - (initialize (_type_ entity-actor pickup-type) none 20) + (initialize (_type_ entity-actor pickup-type) none) ) (:states vent-blocked @@ -2704,7 +2627,7 @@ ) -(defmethod initialize vent ((this vent) (arg0 entity-actor) (arg1 pickup-type)) +(defmethod initialize ((this vent) (arg0 entity-actor) (arg1 pickup-type)) (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask actor-pause)) (let ((s3-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) @@ -2716,11 +2639,11 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> this root-override) s3-0) + (set! (-> this root) s3-0) ) - (set! (-> this root-override trans quad) (-> arg0 extra trans quad)) - (update-transforms! (-> this root-override)) - (set! (-> this root-override pause-adjust-distance) 409600.0) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (update-transforms! (-> this root)) + (set! (-> this root pause-adjust-distance) 409600.0) (set! (-> this fact) (new 'process 'fact-info this arg1 (-> *FACT-bank* eco-full-inc))) (set! (-> this block-func) (the-as (function vent symbol) true-func)) (case (-> this fact pickup-type) @@ -2728,25 +2651,25 @@ (set! (-> this part) (create-launch-control (-> *part-group-id-table* 44) this)) (set! (-> this collect-effect) (-> *part-group-id-table* 67)) (set! (-> this collect-effect2) (-> *part-group-id-table* 43)) - (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-blue (-> this root-override trans))) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-blue (-> this root trans))) ) (((pickup-type eco-red)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 50) this)) (set! (-> this collect-effect) (-> *part-group-id-table* 69)) (set! (-> this collect-effect2) (-> *part-group-id-table* 49)) - (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-red (-> this root-override trans))) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-red (-> this root trans))) ) (((pickup-type eco-green)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 62) this)) (set! (-> this collect-effect) (-> *part-group-id-table* 66)) (set! (-> this collect-effect2) (-> *part-group-id-table* 61)) - (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-green (-> this root-override trans))) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-green (-> this root trans))) ) (((pickup-type eco-yellow)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 52) this)) (set! (-> this collect-effect) (-> *part-group-id-table* 68)) (set! (-> this collect-effect2) (-> *part-group-id-table* 57)) - (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-yellow (-> this root-override trans))) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-yellow (-> this root trans))) ) ) (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) @@ -2822,7 +2745,7 @@ :code (behavior () (loop (let ((a0-0 (-> self part)) - (a1-0 (-> self root-override trans)) + (a1-0 (-> self root trans)) (gp-0 (-> self sound)) ) (if (and (nonzero? a0-0) (-> self show-particles)) @@ -2893,7 +2816,7 @@ part-tracker-move-to-target #f #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to self ) ) @@ -2908,56 +2831,40 @@ (deftype ventyellow (vent) () - :heap-base #x70 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15007000d8 ) -(defmethod init-from-entity! ventyellow ((this ventyellow) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ventyellow) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-yellow)) (none) ) (deftype ventred (vent) () - :heap-base #x70 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15007000d8 ) -(defmethod init-from-entity! ventred ((this ventred) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ventred) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-red)) (none) ) (deftype ventblue (vent) () - :heap-base #x70 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15007000d8 ) -(defmethod init-from-entity! ventblue ((this ventblue) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ventblue) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-blue)) (none) ) (deftype ecovent (vent) () - :heap-base #x70 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15007000d8 ) -(defmethod init-from-entity! ecovent ((this ecovent) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ecovent) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-blue)) (none) ) diff --git a/goal_src/jak1/engine/common-obs/crates.gc b/goal_src/jak1/engine/common-obs/crates.gc index f3af150ae70..9e271df140c 100644 --- a/goal_src/jak1/engine/common-obs/crates.gc +++ b/goal_src/jak1/engine/common-obs/crates.gc @@ -50,13 +50,10 @@ ) (deftype crate-bank (basic) - ((COLLIDE_YOFF float :offset-assert 4) - (COLLIDE_RADIUS float :offset-assert 8) - (DARKECO_EXPLODE_RADIUS float :offset-assert 12) + ((COLLIDE_YOFF float) + (COLLIDE_RADIUS float) + (DARKECO_EXPLODE_RADIUS float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -65,31 +62,29 @@ ) (deftype crate (process-drawable) - ((root-override collide-shape-moving :offset 112) - (smush smush-control :inline :offset-assert 176) - (base vector :inline :offset-assert 208) - (look symbol :offset-assert 224) - (defense symbol :offset-assert 228) - (incomming-attack-id uint64 :offset-assert 232) - (target handle :offset-assert 240) - (child-count int32 :offset-assert 248) - (victory-anim spool-anim :offset-assert 252) + ((root collide-shape-moving :override) + (smush smush-control :inline) + (base vector :inline) + (look symbol) + (defense symbol) + (incomming-attack-id uint64) + (target handle) + (child-count int32) + (victory-anim spool-anim) ) - :heap-base #x90 - :method-count-assert 30 - :size-assert #x100 - :flag-assert #x1e00900100 + (:state-methods + wait + (die symbol int) + special-contents-die + bounce-on + (notice-blue handle) + ) (:methods - (wait () _type_ :state 20) - (die (symbol int) _type_ :state 21) - (special-contents-die () _type_ :state 22) - (bounce-on () _type_ :state 23) - (notice-blue (handle) _type_ :state 24) - (params-init (_type_ entity) none 25) - (art-init (_type_) crate 26) - (params-set! (_type_ symbol symbol) none 27) - (check-dead (_type_) none 28) - (smush-update! (_type_) none 29) + (params-init (_type_ entity) none) + (art-init (_type_) crate) + (params-set! (_type_ symbol symbol) none) + (check-dead (_type_) none) + (smush-update! (_type_) none) ) ) @@ -494,7 +489,7 @@ (go-virtual die #f (the-as int s5-0)) ) (else - (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root-override trans y) (-> self base y))) + (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root trans y) (-> self base y))) (if (not (and (!= *kernel-boot-message* 'play) (= (-> *setting-control* current language) (language-enum japanese))) ) (level-hint-spawn (text-id training-ironcrate) "sagevb36" (the-as entity #f) *entity-pool* (game-task none)) @@ -548,7 +543,7 @@ (go-virtual die #f (the-as int s5-0)) ) (else - (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root-override trans y) (-> self base y))) + (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root trans y) (-> self base y))) (level-hint-spawn (text-id sidekick-hint-crate-steel) "sksp0006" @@ -630,7 +625,7 @@ ) ) (('bonk) - (when (= (-> self root-override trans y) (-> self base y)) + (when (= (-> self root trans y) (-> self base y)) (activate! (-> self smush) -0.1 75 150 1.0 1.0) (go-virtual bounce-on) ) @@ -644,7 +639,7 @@ (('eco-blue) (if (not (or (= (-> self defense) 'darkeco) (or (= (-> self next-state name) 'notice-blue) (= (-> self next-state name) 'die)) - (!= (-> self root-override trans y) (-> self base y)) + (!= (-> self root trans y) (-> self base y)) ) ) (go-virtual notice-blue (process->handle arg0)) @@ -658,7 +653,7 @@ :event crate-standard-event-handler :code (behavior () (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (logior! (-> self mask) (process-mask sleep)) (loop (suspend) @@ -712,7 +707,7 @@ ) ) (when v1-6 - (let* ((gp-2 (-> self root-override root-prim prim-core)) + (let* ((gp-2 (-> self root root-prim prim-core)) (a1-3 (-> (the-as collide-shape v1-6) root-prim prim-core)) (f30-0 (vector-vector-distance (the-as vector gp-2) (the-as vector a1-3))) ) @@ -789,14 +784,14 @@ :trans (behavior () (case (-> self type) ((crate-buzzer) - (if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0)) + (if (and *target* (>= (-> *target* fact buzzer) 6.0)) (spool-push *art-control* (-> self victory-anim name) 0 self -99.0) ) ) ) ) :code (behavior ((arg0 symbol) (arg1 int)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) @@ -831,16 +826,13 @@ ) (case (-> self defense) (('darkeco) - (let ((f0-0 - (lerp-scale 1.0 0.0 (vector-vector-distance (-> self root-override trans) (target-pos 0)) 8192.0 40960.0) - ) - ) + (let ((f0-0 (lerp-scale 1.0 0.0 (vector-vector-distance (-> self root trans) (target-pos 0)) 8192.0 40960.0))) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 f0-0)) (seconds 0.3)) ) (process-spawn touch-tracker :init touch-tracker-init - (-> self root-override trans) + (-> self root trans) (-> *CRATE-bank* DARKECO_EXPLODE_RADIUS) 30 :to self @@ -857,7 +849,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) ) @@ -870,7 +862,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) ) @@ -883,7 +875,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) ) @@ -958,7 +950,7 @@ ) ) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (logior! (-> self draw status) (draw-status hidden)) (drop-pickup (-> self fact) #t self (the-as fact-info #f) 0) (set! (-> self child-count) (+ (process-count self) -1)) @@ -979,7 +971,7 @@ (defbehavior crate-init-by-other crate ((arg0 entity) (arg1 vector) (arg2 symbol)) (params-init self arg0) - (set! (-> self root-override trans quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg1 quad)) (set! (-> self look) arg2) (set! (-> self defense) arg2) (art-init self) @@ -987,14 +979,14 @@ (none) ) -(defmethod init-from-entity! crate ((this crate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this crate) (arg0 entity-actor)) (params-init this arg0) (art-init this) (check-dead this) (none) ) -(defmethod params-init crate ((this crate) (arg0 entity)) +(defmethod params-init ((this crate) (arg0 entity)) (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask crate)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -1015,7 +1007,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (set! (-> this fact) (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) @@ -1065,14 +1057,14 @@ (none) ) -(defmethod art-init crate ((this crate)) +(defmethod art-init ((this crate)) (case (-> this look) (('iron) - (set! (-> this root-override root-prim prim-core offense) (collide-offense normal-attack)) + (set! (-> this root root-prim prim-core offense) (collide-offense normal-attack)) (initialize-skeleton this *crate-iron-sg* '()) ) (('steel) - (set! (-> this root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> this root root-prim prim-core offense) (collide-offense indestructible)) (initialize-skeleton this *crate-steel-sg* '()) ) (('darkeco) @@ -1104,25 +1096,25 @@ ) (cond ((logtest? (fact-options indestructible) (-> this fact options)) - (set! (-> this root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> this root root-prim prim-core offense) (collide-offense indestructible)) ) ((logtest? (-> this fact options) (fact-options strong-attack)) - (set! (-> this root-override root-prim prim-core offense) (collide-offense strong-attack)) + (set! (-> this root root-prim prim-core offense) (collide-offense strong-attack)) ) ((logtest? (-> this fact options) (fact-options normal-attack)) - (set! (-> this root-override root-prim prim-core offense) (collide-offense normal-attack)) + (set! (-> this root root-prim prim-core offense) (collide-offense normal-attack)) ) ((logtest? (-> this fact options) (fact-options touch)) - (set! (-> this root-override root-prim prim-core offense) (collide-offense touch)) + (set! (-> this root root-prim prim-core offense) (collide-offense touch)) ) ) - (set! (-> this base quad) (-> this root-override trans quad)) + (set! (-> this base quad) (-> this root trans quad)) (crate-post) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) this ) -(defmethod params-set! crate ((this crate) (arg0 symbol) (arg1 symbol)) +(defmethod params-set! ((this crate) (arg0 symbol) (arg1 symbol)) (if arg0 (set! (-> this look) arg0) ) @@ -1132,7 +1124,7 @@ (none) ) -(defmethod check-dead crate ((this crate)) +(defmethod check-dead ((this crate)) (if (>= (-> this entity extra perm user-int8 0) 1) (go (method-of-object this die) #t 0) ) @@ -1142,11 +1134,11 @@ (none) ) -(defmethod smush-update! crate ((this crate)) +(defmethod smush-update! ((this crate)) (let ((f0-0 (update! (-> this smush)))) - (set! (-> this root-override scale x) (+ 1.0 (* -0.5 f0-0))) - (set! (-> this root-override scale y) (+ 1.0 f0-0)) - (set! (-> this root-override scale z) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale y) (+ 1.0 f0-0)) + (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0))) ) 0 (none) @@ -1154,14 +1146,10 @@ (deftype barrel (crate) () - :heap-base #x90 - :method-count-assert 30 - :size-assert #x100 - :flag-assert #x1e00900100 ) -(defmethod params-init barrel ((this barrel) (arg0 entity)) +(defmethod params-init ((this barrel) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) (t9-0 this arg0) ) @@ -1171,14 +1159,10 @@ (deftype bucket (crate) () - :heap-base #x90 - :method-count-assert 30 - :size-assert #x100 - :flag-assert #x1e00900100 ) -(defmethod params-init bucket ((this bucket) (arg0 entity)) +(defmethod params-init ((this bucket) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) (t9-0 this arg0) ) @@ -1220,24 +1204,16 @@ (deftype crate-buzzer (crate) () - :heap-base #x90 - :method-count-assert 30 - :size-assert #x100 - :flag-assert #x1e00900100 ) -(defmethod art-init crate-buzzer ((this crate-buzzer)) +(defmethod art-init ((this crate-buzzer)) (let ((t9-0 (method-of-type crate art-init))) (t9-0 this) ) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 74) this)) - (set! (-> this sound) (new - 'process - 'ambient-sound - (static-sound-spec "buzzer" :pitch-mod -762 :fo-max 40) - (-> this root-override trans) - ) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "buzzer" :pitch-mod -762 :fo-max 40) (-> this root trans)) ) (set! (-> this victory-anim) (fuel-cell-pick-anim this)) (the-as crate this) @@ -1246,27 +1222,25 @@ (defstate wait (crate-buzzer) :virtual #t :trans (behavior () - (when (and (and *target* - (>= 327680.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (when (and (and *target* (>= 327680.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (time-elapsed? (-> self state-time) (seconds 1.5)) (rand-vu-percent? 0.03) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (activate! (-> self smush) 0.2 90 150 1.0 1.0) (logclear! (-> self mask) (process-mask sleep-code)) ) (if (nonzero? (-> self sound)) (update! (-> self sound)) ) - (if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0)) + (if (and *target* (>= (-> *target* fact buzzer) 6.0)) (spool-push *art-control* (-> self victory-anim name) 0 self -99.0) ) ) :code (behavior () (set-time! (-> self state-time)) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (loop (set-time! (-> self state-time)) (ja-post) @@ -1276,9 +1250,9 @@ (sound-play "crate-jump") (while (or (!= (-> self smush amp) 0.0) (!= f30-0 0.0)) (+! f30-0 (* -245760.0 (seconds-per-frame))) - (+! (-> self root-override trans y) (* f30-0 (seconds-per-frame))) - (when (< (-> self root-override trans y) (-> self base y)) - (set! (-> self root-override trans y) (-> self base y)) + (+! (-> self root trans y) (* f30-0 (seconds-per-frame))) + (when (< (-> self root trans y) (-> self base y)) + (set! (-> self root trans y) (-> self base y)) (set! f30-0 (* -0.5 f30-0)) (if (< (fabs f30-0) 16384.0) (set! f30-0 0.0) @@ -1289,7 +1263,7 @@ (suspend) ) ) - (set! (-> self root-override trans y) (-> self base y)) + (set! (-> self root trans y) (-> self base y)) ) ) :post #f @@ -1299,7 +1273,7 @@ :virtual #t :code (behavior () (while (!= (-> self smush amp) 0.0) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (suspend) ) (go-virtual wait) @@ -1307,16 +1281,12 @@ ) (deftype pickup-spawner (crate) - ((blocker entity-actor :offset-assert 256) + ((blocker entity-actor) ) - :heap-base #xa0 - :method-count-assert 30 - :size-assert #x104 - :flag-assert #x1e00a00104 ) -(defmethod params-init pickup-spawner ((this pickup-spawner) (arg0 entity)) +(defmethod params-init ((this pickup-spawner) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) (t9-0 this arg0) ) @@ -1328,7 +1298,7 @@ (none) ) -(defmethod check-dead pickup-spawner ((this pickup-spawner)) +(defmethod check-dead ((this pickup-spawner)) (go (method-of-object this wait)) 0 (none) diff --git a/goal_src/jak1/engine/common-obs/dark-eco-pool.gc b/goal_src/jak1/engine/common-obs/dark-eco-pool.gc index cf03c77497e..6a6c5be0627 100644 --- a/goal_src/jak1/engine/common-obs/dark-eco-pool.gc +++ b/goal_src/jak1/engine/common-obs/dark-eco-pool.gc @@ -9,10 +9,6 @@ (deftype dark-eco-pool (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) @@ -84,7 +80,7 @@ ) ) -(defmethod water-vol-method-25 dark-eco-pool ((this dark-eco-pool)) +(defmethod water-vol-method-25 ((this dark-eco-pool)) (let ((t9-0 (method-of-type water-anim water-vol-method-25))) (t9-0 this) ) @@ -108,7 +104,7 @@ (none) ) -(defmethod water-vol-method-22 dark-eco-pool ((this dark-eco-pool)) +(defmethod water-vol-method-22 ((this dark-eco-pool)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/goal_src/jak1/engine/common-obs/generic-obs-h.gc b/goal_src/jak1/engine/common-obs/generic-obs-h.gc index c65aee57b0c..67e8486ce09 100644 --- a/goal_src/jak1/engine/common-obs/generic-obs-h.gc +++ b/goal_src/jak1/engine/common-obs/generic-obs-h.gc @@ -16,7 +16,8 @@ (define-extern birth-pickup-at-point (function vector pickup-type float symbol process-tree fact-info (pointer process) :behavior process)) -(declare-type collide-shape-moving basic) +(declare-type collide-shape trsqv) +(declare-type collide-shape-moving collide-shape) (declare-type sparticle-launch-group basic) (declare-type part-tracker process) (declare-type collide-prim-core structure) @@ -36,44 +37,36 @@ ;; A manipy is a way to draw and move something. More complicated objects that want to draw multiple ;; things may create a child manipy and then send it commands. (deftype manipy (process-drawable) - ((new-trans-hook (function none) :offset-assert 176) - (cur-trans-hook (function none) :offset-assert 180) - (cur-event-hook (function none) :offset-assert 184) - (new-joint-anim art-joint-anim :offset-assert 188) - (new-joint-anim-blend uint64 :offset-assert 192) - (anim-mode symbol :offset-assert 200) - (cur-grab-handle handle :offset-assert 208) - (cur-target-handle handle :offset-assert 216) - (old-grab-pos vector :inline :offset-assert 224) - (joint joint-mod 4 :offset-assert 240) - (new-post-hook (function none) :offset-assert 256) - (cur-post-hook (function none) :offset-assert 260) - (clone-copy-trans symbol :offset-assert 264) - (shadow-backup basic :offset-assert 268) - (draw? symbol :offset-assert 272) + ((new-trans-hook (function none)) + (cur-trans-hook (function none)) + (cur-event-hook (function none)) + (new-joint-anim art-joint-anim) + (new-joint-anim-blend uint64) + (anim-mode symbol) + (cur-grab-handle handle) + (cur-target-handle handle) + (old-grab-pos vector :inline) + (joint joint-mod 4) + (new-post-hook (function none)) + (cur-post-hook (function none)) + (clone-copy-trans symbol) + (shadow-backup basic) + (draw? symbol) ) - :heap-base #xb0 - :method-count-assert 20 - :size-assert #x114 - :flag-assert #x1400b00114 (:states manipy-idle ) ) -;; A part-spawner simply spawns particles. + (deftype part-spawner (process-drawable) - ((mode (pointer sparticle-launch-group) :offset-assert 176) - (enable symbol :offset-assert 180) - (radius meters :offset-assert 184) - (world-sphere sphere :inline :offset-assert 192) + ((mode (pointer sparticle-launch-group)) + (enable symbol) + (radius meters) + (world-sphere sphere :inline) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 (:methods - (is-visible? (_type_) symbol 20) + (is-visible? (_type_) symbol) ) (:states part-spawner-active @@ -83,24 +76,20 @@ ;; a part-tracker will spawn particles, then linger for a bit, and then finally die. ;; a more complicated object can use this to manage particles that do something interesting (like follow you) (deftype part-tracker (process) - ((root trsqv :offset-assert 112) - (part sparticle-launch-control :offset-assert 116) - (target handle :offset-assert 120) - (callback (function part-tracker vector) :offset-assert 128) - (linger-callback (function part-tracker vector) :offset-assert 132) - (duration time-frame :offset-assert 136) - (linger-duration time-frame :offset-assert 144) - (start-time time-frame :offset-assert 152) - (offset vector :inline :offset-assert 160) - (userdata uint64 :offset-assert 176) - (user-time time-frame 2 :offset-assert 184) - (user-vector vector 2 :inline :offset-assert 208) - (user-handle uint32 2 :offset-assert 240) + ((root trsqv) + (part sparticle-launch-control) + (target handle) + (callback (function part-tracker vector)) + (linger-callback (function part-tracker vector)) + (duration time-frame) + (linger-duration time-frame) + (start-time time-frame) + (offset vector :inline) + (userdata uint64) + (user-time time-frame 2) + (user-vector vector 2 :inline) + (user-handle uint32 2) ) - :heap-base #x90 - :method-count-assert 14 - :size-assert #xf8 - :flag-assert #xe009000f8 (:states part-tracker-process ) @@ -108,32 +97,28 @@ ;; a camera-tracker can control the camera. (deftype camera-tracker (process) - ((grab-target handle :offset 120) - (grab-event symbol :offset-assert 128) - (release-event symbol :offset-assert 132) - (old-global-mask process-mask :offset-assert 136) - (old-self-mask process-mask :offset-assert 140) - (old-parent-mask process-mask :offset-assert 144) - (look-at-target handle :offset-assert 152) - (pov-target handle :offset-assert 160) - (work-process handle :offset-assert 168) - (anim-process handle :offset-assert 176) - (start-time time-frame :offset-assert 184) - (callback basic :offset-assert 192) - (userdata basic :offset-assert 196) - (message basic :offset-assert 200) - (border-value basic :offset-assert 204) - (mask-to-clear process-mask :offset-assert 208) - (script pair :offset-assert 212) - (script-line pair :offset-assert 216) - (script-func (function none) :offset-assert 220) + ((grab-target handle :offset 120) + (grab-event symbol) + (release-event symbol) + (old-global-mask process-mask) + (old-self-mask process-mask) + (old-parent-mask process-mask) + (look-at-target handle) + (pov-target handle) + (work-process handle) + (anim-process handle) + (start-time time-frame) + (callback basic) + (userdata basic) + (message basic) + (border-value basic) + (mask-to-clear process-mask) + (script pair) + (script-line pair) + (script-func (function none)) ) - :heap-base #x70 - :method-count-assert 15 - :size-assert #xe0 - :flag-assert #xf007000e0 (:methods - (eval (_type_ pair) process 14) + (eval (_type_ pair) process) ) (:states camera-tracker-process @@ -142,18 +127,14 @@ ;; a touch tracker waits to be touched, then calls some callback function. (deftype touch-tracker (process-drawable) - ((root-override collide-shape-moving :offset 112) - (duration time-frame :offset-assert 176) - (target handle :offset-assert 184) - (event symbol :offset-assert 192) - (run-function (function object) :offset-assert 196) - (callback (function touch-tracker none) :offset-assert 200) - (event-mode basic :offset-assert 204) + ((root collide-shape-moving :override) + (duration time-frame) + (target handle) + (event symbol) + (run-function (function object)) + (callback (function touch-tracker none)) + (event-mode basic) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14006000d0 (:states touch-tracker-idle ) @@ -161,15 +142,11 @@ ;; the classic pole (deftype swingpole (process) - ((root trsq :offset-assert 112) - (dir vector :inline :offset-assert 128) - (range meters :offset-assert 144) - (edge-length meters :offset-assert 148) + ((root trsq) + (dir vector :inline) + (range meters) + (edge-length meters) ) - :heap-base #x30 - :method-count-assert 14 - :size-assert #x98 - :flag-assert #xe00300098 (:states swingpole-active swingpole-stance @@ -178,42 +155,35 @@ ;; do you want to fish? (deftype gui-query (structure) - ((x-position int32 :offset-assert 0) - (y-position int32 :offset-assert 4) - (message string :offset-assert 8) - (decision symbol :offset-assert 12) - (only-allow-cancel symbol :offset-assert 16) - (no-msg string :offset-assert 20) - (message-space int32 :offset-assert 24) + ((x-position int32) + (y-position int32) + (message string) + (decision symbol) + (only-allow-cancel symbol) + (no-msg string) + (message-space int32) ) :pack-me - :method-count-assert 11 - :size-assert #x1c - :flag-assert #xb0000001c (:methods - (init! (_type_ string int int int symbol string) none 9) - (get-response (_type_) symbol 10) + (init! (_type_ string int int int symbol string) none) + (get-response (_type_) symbol) ) ) ;; control the camera from something else (an animation) (deftype othercam (process) - ((hand handle :offset-assert 112) - (old-global-mask process-mask :offset-assert 120) - (mask-to-clear process-mask :offset-assert 124) - (cam-joint-index int32 :offset-assert 128) - (old-pos vector :inline :offset-assert 144) - (old-mat-z vector :inline :offset-assert 160) - (had-valid-frame basic :offset-assert 176) - (border-value basic :offset-assert 180) - (die? symbol :offset-assert 184) - (survive-anim-end? symbol :offset-assert 188) - (spooling? symbol :offset-assert 192) + ((hand handle) + (old-global-mask process-mask) + (mask-to-clear process-mask) + (cam-joint-index int32) + (old-pos vector :inline) + (old-mat-z vector :inline) + (had-valid-frame basic) + (border-value basic) + (die? symbol) + (survive-anim-end? symbol) + (spooling? symbol) ) - :heap-base #x60 - :method-count-assert 14 - :size-assert #xc4 - :flag-assert #xe006000c4 (:states othercam-running ) @@ -223,10 +193,7 @@ ;; don't draw it! I guess used to disable things during development. (deftype process-hidden (process) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 - (:methods - (die () _type_ :state 14) + (:state-methods + die ) ) diff --git a/goal_src/jak1/engine/common-obs/generic-obs.gc b/goal_src/jak1/engine/common-obs/generic-obs.gc index ef2e3181ed9..81276b50c48 100644 --- a/goal_src/jak1/engine/common-obs/generic-obs.gc +++ b/goal_src/jak1/engine/common-obs/generic-obs.gc @@ -138,7 +138,7 @@ ) ) -(defmethod init-from-entity! swingpole ((this swingpole) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swingpole) (arg0 entity-actor)) "Copy defaults from the entity." (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask actor-pause)) @@ -160,7 +160,7 @@ :code nothing ) -(defmethod init-from-entity! process-hidden ((this process-hidden) (arg0 entity-actor)) +(defmethod init-from-entity! ((this process-hidden) (arg0 entity-actor)) "Copy defaults from the entity." (process-entity-status! this (entity-perm-status dead) #t) (go (method-of-object this die)) @@ -169,17 +169,11 @@ (deftype target-start (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) (deftype camera-start (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) @@ -542,7 +536,7 @@ (none) ) -(defmethod deactivate part-tracker ((this part-tracker)) +(defmethod deactivate ((this part-tracker)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) @@ -900,7 +894,7 @@ ) ;; ERROR: Failed load: (set! v1-42 (l.wu (+ a0-22 -4))) at op 159 -(defmethod eval camera-tracker ((this camera-tracker) (arg0 pair)) +(defmethod eval ((this camera-tracker) (arg0 pair)) (with-pp (let ((gp-0 (the-as object #f))) (cond @@ -1180,14 +1174,10 @@ ) (deftype med-res-level (process-drawable) - ((level symbol :offset-assert 176) - (part-mode basic :offset-assert 180) - (index int32 :offset-assert 184) + ((level symbol) + (part-mode basic) + (index int32) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states med-res-level-idle ) @@ -1253,7 +1243,7 @@ (define *lev-string* (new 'global 'string 64 (the-as string #f))) -(defmethod init-from-entity! med-res-level ((this med-res-level) (arg0 entity-actor)) +(defmethod init-from-entity! ((this med-res-level) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (stack-size-set! (-> this main-thread) 128) "#f" @@ -1317,7 +1307,7 @@ (none) ) -(defmethod is-visible? part-spawner ((this part-spawner)) +(defmethod is-visible? ((this part-spawner)) (sphere<-vector+r! (-> this world-sphere) (-> this root trans) (-> this radius)) (sphere-in-view-frustum? (-> this world-sphere)) ) @@ -1356,7 +1346,7 @@ ) ) -(defmethod init-from-entity! part-spawner ((this part-spawner) (arg0 entity-actor)) +(defmethod init-from-entity! ((this part-spawner) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask ambient)) @@ -1418,18 +1408,14 @@ ) (deftype launcher (process-drawable) - ((root-override collide-shape :offset 112) - (spring-height meters :offset-assert 176) - (camera state :offset-assert 180) - (active-distance float :offset-assert 184) - (seek-time time-frame :offset-assert 192) - (dest vector :inline :offset-assert 208) - (sound-id sound-id :offset-assert 224) + ((root collide-shape :override) + (spring-height meters) + (camera state) + (active-distance float) + (seek-time time-frame) + (dest vector :inline) + (sound-id sound-id) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xe4 - :flag-assert #x14008000e4 (:states launcher-active launcher-deactivated @@ -1865,15 +1851,14 @@ (go launcher-deactivated) ) (('trans) - (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) - (update-transforms! (-> self root-override)) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) + (update-transforms! (-> self root)) ) ) ) :trans (behavior () - (when (and *target* (>= (-> self active-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (when (and *target* + (>= (-> self active-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (cond ((send-event *target* 'query 'powerup (pickup-type eco-blue)) @@ -1887,7 +1872,7 @@ ) ) ) - (if (and (and *target* (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and (and *target* (>= 32768.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (level-hint-spawn @@ -1914,8 +1899,8 @@ (go launcher-deactivated) ) ((= message 'trans) - (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) - (update-transforms! (-> self root-override)) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) + (update-transforms! (-> self root)) ) ) ) @@ -1931,18 +1916,17 @@ ) ) :trans (behavior () - (if (or (or (not *target*) (< (-> self active-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (or (or (not *target*) + (< (-> self active-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (go launcher-idle) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (sound-play "launch-idle" :id (-> self sound-id)) - (if (and (and *target* (>= (+ 2867.2 (-> self root-override root-prim prim-core world-sphere w)) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + (if (and (and *target* (>= (+ 2867.2 (-> self root root-prim prim-core world-sphere w)) + (vector-vector-distance (-> self root trans) (-> *target* control trans)) ) ) (not (time-elapsed? (-> self state-time) (seconds 0.5))) @@ -1960,7 +1944,7 @@ :code anim-loop ) -(defmethod init-from-entity! launcher ((this launcher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this launcher) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -1971,10 +1955,10 @@ ) (set! (-> s4-0 nav-radius) 13926.4) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this active-distance) 409600.0) (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 163840.0)) (let ((s4-1 (res-lump-value arg0 'mode uint128))) @@ -2016,7 +2000,7 @@ ) ) (set! (-> this sound-id) (new-sound-id)) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (go launcher-idle) (none) ) @@ -2032,12 +2016,12 @@ ) (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) (backup-collide-with-as s2-0) - (set! (-> self root-override) s2-0) + (set! (-> self root) s2-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0) - (set-vector! (-> self root-override quat) 0.0 0.0 0.0 1.0) - (update-transforms! (-> self root-override)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (set-vector! (-> self root quat) 0.0 0.0 0.0 1.0) + (update-transforms! (-> self root)) (set! (-> self spring-height) arg1) (set! (-> self active-distance) arg3) (let ((v1-23 (-> self entity extra level name))) @@ -2191,9 +2175,7 @@ ) ) (if a0-6 - (set! (-> self root-override trans quad) - (-> (the-as collide-shape a0-6) root-prim prim-core world-sphere quad) - ) + (set! (-> self root trans quad) (-> (the-as collide-shape a0-6) root-prim prim-core world-sphere quad)) ) ) ) @@ -2201,15 +2183,15 @@ (if (-> self callback) ((-> self callback) self) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (let ((a1-3 (new 'stack-no-clear 'touching-shapes-entry))) (set! (-> a1-3 cshape1) (the-as collide-shape 2)) (set! (-> a1-3 cshape2) (the-as collide-shape *touching-list*)) - (find-overlapping-shapes (-> self root-override) (the-as overlaps-others-params a1-3)) + (find-overlapping-shapes (-> self root) (the-as overlaps-others-params a1-3)) ) (suspend) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (suspend) 0 ) @@ -2232,9 +2214,9 @@ (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) (set! (-> s4-0 event-self) 'touched) - (set! (-> self root-override) s4-0) + (set! (-> self root) s4-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (set! (-> self duration) arg2) (set! (-> self target) (the-as handle #f)) (set! (-> self event) #f) diff --git a/goal_src/jak1/engine/common-obs/nav-enemy-h.gc b/goal_src/jak1/engine/common-obs/nav-enemy-h.gc index ded981210c5..07b5845757c 100644 --- a/goal_src/jak1/engine/common-obs/nav-enemy-h.gc +++ b/goal_src/jak1/engine/common-obs/nav-enemy-h.gc @@ -51,152 +51,147 @@ ;; DECOMP BEGINS (deftype nav-enemy-info (basic) - ((idle-anim int32 :offset-assert 4) - (walk-anim int32 :offset-assert 8) - (turn-anim int32 :offset-assert 12) - (notice-anim int32 :offset-assert 16) - (run-anim int32 :offset-assert 20) - (jump-anim int32 :offset-assert 24) - (jump-land-anim int32 :offset-assert 28) - (victory-anim int32 :offset-assert 32) - (taunt-anim int32 :offset-assert 36) - (die-anim int32 :offset-assert 40) - (neck-joint int32 :offset-assert 44) - (player-look-at-joint int32 :offset-assert 48) - (run-travel-speed meters :offset-assert 52) - (run-rotate-speed degrees :offset-assert 56) - (run-acceleration meters :offset-assert 60) - (run-turn-time seconds :offset-assert 64) - (walk-travel-speed meters :offset-assert 72) - (walk-rotate-speed degrees :offset-assert 76) - (walk-acceleration meters :offset-assert 80) - (walk-turn-time seconds :offset-assert 88) - (attack-shove-back meters :offset-assert 96) - (attack-shove-up meters :offset-assert 100) - (shadow-size meters :offset-assert 104) - (notice-nav-radius meters :offset-assert 108) - (nav-nearest-y-threshold meters :offset-assert 112) - (notice-distance meters :offset-assert 116) - (proximity-notice-distance meters :offset-assert 120) - (stop-chase-distance meters :offset-assert 124) - (frustration-distance meters :offset-assert 128) - (frustration-time time-frame :offset-assert 136) - (die-anim-hold-frame float :offset-assert 144) - (jump-anim-start-frame float :offset-assert 148) - (jump-land-anim-end-frame float :offset-assert 152) - (jump-height-min meters :offset-assert 156) - (jump-height-factor float :offset-assert 160) - (jump-start-anim-speed float :offset-assert 164) - (shadow-max-y meters :offset-assert 168) - (shadow-min-y meters :offset-assert 172) - (shadow-locus-dist meters :offset-assert 176) - (use-align symbol :offset-assert 180) - (draw-shadow symbol :offset-assert 184) - (move-to-ground symbol :offset-assert 188) - (hover-if-no-ground symbol :offset-assert 192) - (use-momentum symbol :offset-assert 196) - (use-flee symbol :offset-assert 200) - (use-proximity-notice symbol :offset-assert 204) - (use-jump-blocked symbol :offset-assert 208) - (use-jump-patrol symbol :offset-assert 212) - (gnd-collide-with collide-kind :offset-assert 216) - (debug-draw-neck symbol :offset-assert 224) - (debug-draw-jump symbol :offset-assert 228) + ((idle-anim int32) + (walk-anim int32) + (turn-anim int32) + (notice-anim int32) + (run-anim int32) + (jump-anim int32) + (jump-land-anim int32) + (victory-anim int32) + (taunt-anim int32) + (die-anim int32) + (neck-joint int32) + (player-look-at-joint int32) + (run-travel-speed meters) + (run-rotate-speed degrees) + (run-acceleration meters) + (run-turn-time seconds) + (walk-travel-speed meters) + (walk-rotate-speed degrees) + (walk-acceleration meters) + (walk-turn-time seconds) + (attack-shove-back meters) + (attack-shove-up meters) + (shadow-size meters) + (notice-nav-radius meters) + (nav-nearest-y-threshold meters) + (notice-distance meters) + (proximity-notice-distance meters) + (stop-chase-distance meters) + (frustration-distance meters) + (frustration-time time-frame) + (die-anim-hold-frame float) + (jump-anim-start-frame float) + (jump-land-anim-end-frame float) + (jump-height-min meters) + (jump-height-factor float) + (jump-start-anim-speed float) + (shadow-max-y meters) + (shadow-min-y meters) + (shadow-locus-dist meters) + (use-align symbol) + (draw-shadow symbol) + (move-to-ground symbol) + (hover-if-no-ground symbol) + (use-momentum symbol) + (use-flee symbol) + (use-proximity-notice symbol) + (use-jump-blocked symbol) + (use-jump-patrol symbol) + (gnd-collide-with collide-kind) + (debug-draw-neck symbol) + (debug-draw-jump symbol) ) - :method-count-assert 9 - :size-assert #xe8 - :flag-assert #x9000000e8 ) (deftype nav-enemy (process-drawable) - ((collide-info collide-shape-moving :offset 112) - (enemy-info fact-info-enemy :offset 144) - (hit-from-dir vector :inline :offset-assert 176) - (event-param-point vector :inline :offset-assert 192) - (frustration-point vector :inline :offset-assert 208) - (jump-dest vector :inline :offset-assert 224) - (jump-trajectory trajectory :inline :offset-assert 240) - (jump-time time-frame :offset-assert 280) - (nav-info nav-enemy-info :offset-assert 288) - (target-speed float :offset-assert 292) - (momentum-speed float :offset-assert 296) - (acceleration float :offset-assert 300) - (rotate-speed float :offset-assert 304) - (turn-time time-frame :offset-assert 312) - (frustration-time time-frame :offset-assert 320) - (speed-scale float :offset-assert 328) - (neck joint-mod :offset-assert 332) - (reaction-time time-frame :offset-assert 336) - (notice-time time-frame :offset-assert 344) - (state-timeout time-frame :offset-assert 352) - (free-time time-frame :offset-assert 360) - (touch-time time-frame :offset-assert 368) - (nav-enemy-flags nav-enemy-flags :offset-assert 376) - (incomming-attack-id handle :offset-assert 384) - (jump-return-state (state process) :offset-assert 392) - (rand-gen random-generator :offset-assert 396) + ((collide-info collide-shape-moving :overlay-at root) + (enemy-info fact-info-enemy :overlay-at fact) + (hit-from-dir vector :inline) + (event-param-point vector :inline) + (frustration-point vector :inline) + (jump-dest vector :inline) + (jump-trajectory trajectory :inline) + (jump-time time-frame) + (nav-info nav-enemy-info) + (target-speed float) + (momentum-speed float) + (acceleration float) + (rotate-speed float) + (turn-time time-frame) + (frustration-time time-frame) + (speed-scale float) + (neck joint-mod) + (reaction-time time-frame) + (notice-time time-frame) + (state-timeout time-frame) + (free-time time-frame) + (touch-time time-frame) + (nav-enemy-flags nav-enemy-flags) + (incomming-attack-id handle) + (jump-return-state (state process)) + (rand-gen random-generator) ) - :heap-base #x120 - :method-count-assert 76 - :size-assert #x190 - :flag-assert #x4c01200190 + (:state-methods + nav-enemy-attack + nav-enemy-chase + nav-enemy-flee + nav-enemy-die + nav-enemy-fuel-cell + nav-enemy-give-up + nav-enemy-jump + nav-enemy-jump-land + nav-enemy-idle + nav-enemy-notice + nav-enemy-patrol + nav-enemy-stare + nav-enemy-stop-chase + nav-enemy-victory + ) (:methods - (nav-enemy-attack () _type_ :state 20) - (nav-enemy-chase () _type_ :state 21) - (nav-enemy-flee () _type_ :state 22) - (nav-enemy-die () _type_ :state 23) - (nav-enemy-fuel-cell () _type_ :state 24) - (nav-enemy-give-up () _type_ :state 25) - (nav-enemy-jump () _type_ :state 26) - (nav-enemy-jump-land () _type_ :state 27) - (nav-enemy-idle () _type_ :state 28) - (nav-enemy-notice () _type_ :state 29) - (nav-enemy-patrol () _type_ :state 30) - (nav-enemy-stare () _type_ :state 31) - (nav-enemy-stop-chase () _type_ :state 32) - (nav-enemy-victory () _type_ :state 33) - (nav-enemy-method-34 (_type_) none 34) - (nav-enemy-wait-for-cue () _type_ :state 35) - (nav-enemy-jump-to-point () _type_ :state 36) - (nav-enemy-method-37 (_type_) none 37) - (nav-enemy-method-38 (_type_) none 38) - (common-post (_type_) none 39) - (nav-enemy-method-40 (_type_) none 40) - (nav-enemy-method-41 (_type_) none 41) - (new-patrol-point! (_type_) int 42) - (attack-handler (_type_ process event-message-block) object 43) - (touch-handler (_type_ process event-message-block) object 44) - (init-defaults! (_type_ nav-enemy-info) none 45) - (target-in-range? (_type_ float) basic 46) - (initialize-collision (_type_) none 47) - (nav-enemy-method-48 (_type_) none 48) - (init-jm! (_type_ nav-enemy-info) float 49) - (nav-enemy-method-50 (_type_ vector) symbol 50) - (nav-enemy-method-51 (_type_) none 51) - (nav-enemy-method-52 (_type_ vector) symbol 52) - (nav-enemy-method-53 (_type_) symbol 53) - (nav-enemy-method-54 (_type_ vector) symbol 54) - (nav-enemy-method-55 (_type_) symbol 55) - (set-jump-height-factor! (_type_ int) none 56) - (nav-enemy-method-57 (_type_) none 57) - (nav-enemy-method-58 (_type_) none 58) - (nav-enemy-method-59 (_type_) none 59) - (nav-enemy-method-60 (_type_ symbol) symbol 60) - (snow-bunny-attack () _type_ :state 61) - (snow-bunny-chase-hop () _type_ :state 62) - (snow-bunny-defend () _type_ :state 63) - (nav-enemy-method-64 () _type_ :state 64) - (snow-bunny-lunge () _type_ :state 65) - (snow-bunny-nav-resume () _type_ :state 66) - (snow-bunny-patrol-hop () _type_ :state 67) - (snow-bunny-patrol-idle () _type_ :state 68) - (nav-enemy-method-69 () _type_ :state 69) - (snow-bunny-retreat-hop () _type_ :state 70) - (snow-bunny-tune-spheres () _type_ :state 71) - (nav-enemy-touch-handler (_type_ process event-message-block) object 72) - (nav-enemy-attack-handler (_type_ process event-message-block) object 73) - (nav-enemy-jump-blocked () _type_ :state 74) - (nav-enemy-method-75 () _type_ :state 75) + (nav-enemy-method-34 (_type_) none) + (nav-enemy-wait-for-cue () _type_ :state) + (nav-enemy-jump-to-point () _type_ :state) + (nav-enemy-method-37 (_type_) none) + (nav-enemy-method-38 (_type_) none) + (common-post (_type_) none) + (nav-enemy-method-40 (_type_) none) + (nav-enemy-method-41 (_type_) none) + (new-patrol-point! (_type_) int) + (attack-handler (_type_ process event-message-block) object) + (touch-handler (_type_ process event-message-block) object) + (init-defaults! (_type_ nav-enemy-info) none) + (target-in-range? (_type_ float) basic) + (initialize-collision (_type_) none) + (nav-enemy-method-48 (_type_) none) + (init-jm! (_type_ nav-enemy-info) float) + (nav-enemy-method-50 (_type_ vector) symbol) + (nav-enemy-method-51 (_type_) none) + (nav-enemy-method-52 (_type_ vector) symbol) + (nav-enemy-method-53 (_type_) symbol) + (nav-enemy-method-54 (_type_ vector) symbol) + (nav-enemy-method-55 (_type_) symbol) + (set-jump-height-factor! (_type_ int) none) + (nav-enemy-method-57 (_type_) none) + (nav-enemy-method-58 (_type_) none) + (nav-enemy-method-59 (_type_) none) + (nav-enemy-method-60 (_type_ symbol) symbol) + (snow-bunny-attack () _type_ :state) + (snow-bunny-chase-hop () _type_ :state) + (snow-bunny-defend () _type_ :state) + (nav-enemy-method-64 () _type_ :state) + (snow-bunny-lunge () _type_ :state) + (snow-bunny-nav-resume () _type_ :state) + (snow-bunny-patrol-hop () _type_ :state) + (snow-bunny-patrol-idle () _type_ :state) + (nav-enemy-method-69 () _type_ :state) + (snow-bunny-retreat-hop () _type_ :state) + (snow-bunny-tune-spheres () _type_ :state) + (nav-enemy-touch-handler (_type_ process event-message-block) object) + (nav-enemy-attack-handler (_type_ process event-message-block) object) + (nav-enemy-jump-blocked () _type_ :state) + (nav-enemy-method-75 () _type_ :state) ) ) diff --git a/goal_src/jak1/engine/common-obs/nav-enemy.gc b/goal_src/jak1/engine/common-obs/nav-enemy.gc index 17e584aef6e..2aa8f39aa28 100644 --- a/goal_src/jak1/engine/common-obs/nav-enemy.gc +++ b/goal_src/jak1/engine/common-obs/nav-enemy.gc @@ -37,13 +37,13 @@ ) ) -(defmethod eval-position! trajectory ((this trajectory) (time float) (result vector)) +(defmethod eval-position! ((this trajectory) (time float) (result vector)) (vector+float*! result (-> this initial-position) (-> this initial-velocity) time) (+! (-> result y) (* 0.5 time time (-> this gravity))) result ) -(defmethod relocate nav-enemy ((this nav-enemy) (arg0 int)) +(defmethod relocate ((this nav-enemy) (arg0 int)) (if (nonzero? (-> this neck)) (set! (-> this neck) (the-as joint-mod (+ (the-as int (-> this neck)) arg0))) ) @@ -53,7 +53,7 @@ (call-parent-method this arg0) ) -(defmethod new-patrol-point! nav-enemy ((this nav-enemy)) +(defmethod new-patrol-point! ((this nav-enemy)) (local-vars (v1-11 symbol)) (if (<= (-> this path curve num-cverts) 0) (go process-drawable-art-error "no path") @@ -73,7 +73,7 @@ 0 ) -(defmethod common-post nav-enemy ((this nav-enemy)) +(defmethod common-post ((this nav-enemy)) (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf8)) (or (not *target*) (and (not (logtest? (-> *target* state-flags) @@ -113,7 +113,7 @@ (none) ) -(defmethod touch-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this nav-enemy) (arg0 process) (arg1 event-message-block)) (if (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) @@ -125,7 +125,7 @@ ) ) -(defmethod nav-enemy-touch-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod nav-enemy-touch-handler ((this nav-enemy) (arg0 process) (arg1 event-message-block)) (if (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) @@ -137,14 +137,14 @@ ) ) -(defmethod nav-enemy-attack-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod nav-enemy-attack-handler ((this nav-enemy) (arg0 process) (arg1 event-message-block)) (send-event arg0 'get-attack-count 1) (logclear! (-> this mask) (process-mask actor-pause attackable)) (go (method-of-object this nav-enemy-die)) 'die ) -(defmethod attack-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this nav-enemy) (arg0 process) (arg1 event-message-block)) (cond ((logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf5)) (send-event arg0 'get-attack-count 1) @@ -262,13 +262,13 @@ nav-enemy-default-event-handler (none) ) -(defmethod nav-enemy-method-40 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-40 ((this nav-enemy)) (nav-control-method-11 (-> this nav) (-> this nav target-pos)) 0 (none) ) -(defmethod nav-enemy-method-41 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-41 ((this nav-enemy)) (cond ((-> this nav-info use-align) (align-vel-and-quat-only! @@ -318,7 +318,7 @@ nav-enemy-default-event-handler (none) ) -(defmethod nav-enemy-method-37 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-37 ((this nav-enemy)) (when (logtest? (-> this nav-enemy-flags) (nav-enemy-flags enable-travel)) (if (or (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf7)) (logtest? (nav-control-flags navcf19) (-> this nav flags)) @@ -341,7 +341,7 @@ nav-enemy-default-event-handler (none) ) -(defmethod nav-enemy-method-38 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-38 ((this nav-enemy)) (if (-> this nav-info move-to-ground) (integrate-for-enemy-with-move-to-ground! (-> this collide-info) @@ -499,7 +499,7 @@ nav-enemy-default-event-handler ) ) -(defmethod target-in-range? nav-enemy ((this nav-enemy) (arg0 float)) +(defmethod target-in-range? ((this nav-enemy) (arg0 float)) (and *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) @@ -726,7 +726,7 @@ nav-enemy-default-event-handler (none) ) -(defmethod run-logic? nav-enemy ((this nav-enemy)) +(defmethod run-logic? ((this nav-enemy)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (and (>= (+ (-> *ACTOR-bank* pause-dist) (-> this collide-info pause-adjust-distance)) @@ -1635,7 +1635,7 @@ nav-enemy-default-event-handler ) ) -(defmethod init-defaults! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) +(defmethod init-defaults! ((this nav-enemy) (arg0 nav-enemy-info)) (set! (-> this rand-gen) (new 'process 'random-generator)) (set! (-> this rand-gen seed) (the-as uint #x666edd1e)) (set! (-> this mask) (the-as process-mask (logior (process-mask enemy) (-> this mask)))) @@ -1671,7 +1671,7 @@ nav-enemy-default-event-handler (none) ) -(defmethod init-jm! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) +(defmethod init-jm! ((this nav-enemy) (arg0 nav-enemy-info)) (set! (-> this nav-info) arg0) (set! (-> this rotate-speed) (-> this nav-info walk-rotate-speed)) (set! (-> this turn-time) (-> this nav-info walk-turn-time)) @@ -1707,23 +1707,23 @@ nav-enemy-default-event-handler (none) ) -(defmethod initialize-collision nav-enemy ((this nav-enemy)) +(defmethod initialize-collision ((this nav-enemy)) 0 (none) ) -(defmethod nav-enemy-method-48 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-48 ((this nav-enemy)) 0 (none) ) -(defmethod nav-enemy-method-59 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-59 ((this nav-enemy)) (go (method-of-object this nav-enemy-idle)) 0 (none) ) -(defmethod init-from-entity! nav-enemy ((this nav-enemy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nav-enemy) (arg0 entity-actor)) (initialize-collision this) (process-drawable-from-entity! this arg0) (nav-enemy-method-48 this) @@ -1732,7 +1732,7 @@ nav-enemy-default-event-handler (none) ) -(defmethod nav-enemy-method-50 nav-enemy ((this nav-enemy) (arg0 vector)) +(defmethod nav-enemy-method-50 ((this nav-enemy) (arg0 vector)) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> this collide-info trans quad)) (set! (-> this collide-info trans quad) (-> arg0 quad)) diff --git a/goal_src/jak1/engine/common-obs/orb-cache.gc b/goal_src/jak1/engine/common-obs/orb-cache.gc index 798c580c5d1..74ba7f726eb 100644 --- a/goal_src/jak1/engine/common-obs/orb-cache.gc +++ b/goal_src/jak1/engine/common-obs/orb-cache.gc @@ -8,23 +8,19 @@ ;; DECOMP BEGINS (deftype orb-cache-top (baseplat) - ((active-distance float :offset-assert 228) - (inactive-distance float :offset-assert 232) - (money-list handle 60 :offset-assert 240) - (money-pos-list float 60 :offset-assert 720) - (money-pos-actual float 60 :offset-assert 960) - (platform-pos float :offset-assert 1200) - (root-pos float :offset-assert 1204) - (money int32 :offset-assert 1208) - (activated symbol :offset-assert 1212) + ((active-distance float) + (inactive-distance float) + (money-list handle 60) + (money-pos-list float 60) + (money-pos-actual float 60) + (platform-pos float) + (root-pos float) + (money int32) + (activated symbol) ) - :heap-base #x450 - :method-count-assert 29 - :size-assert #x4c0 - :flag-assert #x1d045004c0 (:methods - (pos-logic (_type_ symbol) symbol 27) - (calculate-pos (_type_ symbol) none 28) + (pos-logic (_type_ symbol) symbol) + (calculate-pos (_type_ symbol) none) ) (:states (orb-cache-top-activate symbol) @@ -56,7 +52,7 @@ ) ) :trans (behavior () - (if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (level-hint-spawn @@ -86,7 +82,7 @@ ) ) -(defmethod baseplat-method-22 orb-cache-top ((this orb-cache-top)) +(defmethod baseplat-method-22 ((this orb-cache-top)) (if (< 4096.0 (- (-> this basetrans y) (-> this root-pos))) (activate! (-> this smush) -1.0 60 150 1.0 1.0) (activate! (-> this smush) -0.5 60 150 1.0 1.0) @@ -97,7 +93,7 @@ (none) ) -(defmethod calculate-pos orb-cache-top ((this orb-cache-top) (arg0 symbol)) +(defmethod calculate-pos ((this orb-cache-top) (arg0 symbol)) (let ((f0-0 0.0)) (when arg0 (set! f0-0 (+ 10240.0 (* 6144.0 (the float (+ (-> this money) -1))))) @@ -117,7 +113,7 @@ (none) ) -(defmethod pos-logic orb-cache-top ((this orb-cache-top) (arg0 symbol)) +(defmethod pos-logic ((this orb-cache-top) (arg0 symbol)) (dotimes (s4-0 (-> this money)) (when (not (handle->process (-> this money-list s4-0))) (dotimes (v1-6 (-> this money)) @@ -147,7 +143,7 @@ (set! s3-0 #t) ) (when (and (< f30-0 15155.2) - (and *target* (>= 16384.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans)))) + (and *target* (>= 16384.0 (vector-vector-distance (-> this root trans) (-> *target* control trans)))) (< (-> (target-pos 0) y) (-> this basetrans y)) ) (set! f30-0 (if (< 14131.2 f28-0) @@ -212,18 +208,16 @@ ) (loop (calculate-pos self #t) - (while (not (or (not *target*) (< (-> self inactive-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) + (while (not (or (not *target*) + (< (-> self inactive-distance) (vector-vector-xz-distance (-> self root trans) (-> *target* control trans))) ) ) (pos-logic self #t) (suspend) ) (calculate-pos self #f) - (while (and (not (and (and *target* (>= (-> self active-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) + (while (and (not (and (and *target* + (>= (-> self active-distance) (vector-vector-xz-distance (-> self root trans) (-> *target* control trans))) ) (let ((a1-11 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-11 from) self) @@ -239,9 +233,8 @@ ) (suspend) ) - (if (not (and (and *target* (>= (-> self active-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (not (and (and *target* + (>= (-> self active-distance) (vector-vector-xz-distance (-> self root trans) (-> *target* control trans))) ) (let ((a1-14 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-14 from) self) @@ -275,7 +268,7 @@ :post plat-post ) -(defmethod init-from-entity! orb-cache-top ((this orb-cache-top) (arg0 entity-actor)) +(defmethod init-from-entity! ((this orb-cache-top) (arg0 entity-actor)) (let ((a0-1 (-> this entity))) (if (when a0-1 (let ((a0-2 (-> a0-1 extra perm task))) @@ -305,13 +298,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton this *orb-cache-top-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (baseplat-method-21 this) (set! (-> this money) (res-lump-value (-> this entity) 'orb-cache-count int :default (the-as uint128 20))) (set! (-> this active-distance) 61440.0) diff --git a/goal_src/jak1/engine/common-obs/plat-button.gc b/goal_src/jak1/engine/common-obs/plat-button.gc index 4b48c416ae7..cc6898a15c1 100644 --- a/goal_src/jak1/engine/common-obs/plat-button.gc +++ b/goal_src/jak1/engine/common-obs/plat-button.gc @@ -8,35 +8,33 @@ ;; DECOMP BEGINS (deftype plat-button (process-drawable) - ((root-override collide-shape-moving :offset 112) - (go-back-if-lost-player? symbol :offset-assert 176) - (grab-player? symbol :offset-assert 180) - (should-grab-player? symbol :offset-assert 184) - (path-pos float :offset-assert 188) - (bidirectional? symbol :offset-assert 192) - (allow-auto-kill symbol :offset-assert 196) - (sound-id sound-id :offset-assert 200) - (trans-off vector :inline :offset-assert 208) - (spawn-pos vector :inline :offset-assert 224) + ((root collide-shape-moving :override) + (go-back-if-lost-player? symbol) + (grab-player? symbol) + (should-grab-player? symbol) + (path-pos float) + (bidirectional? symbol) + (allow-auto-kill symbol) + (sound-id sound-id) + (trans-off vector :inline) + (spawn-pos vector :inline) ) - :heap-base #x80 - :method-count-assert 33 - :size-assert #xf0 - :flag-assert #x21008000f0 + (:state-methods + plat-button-at-end + plat-button-idle + plat-button-pressed + plat-button-move-downward + plat-button-move-upward + plat-button-teleport-to-other-end + ) (:methods - (plat-button-at-end () _type_ :state 20) - (plat-button-idle () _type_ :state 21) - (plat-button-pressed () _type_ :state 22) - (plat-button-move-downward () _type_ :state 23) - (plat-button-move-upward () _type_ :state 24) - (plat-button-teleport-to-other-end () _type_ :state 25) - (can-activate? (_type_) symbol 26) - (plat-button-method-27 (_type_) none 27) - (plat-button-method-28 (_type_) collide-shape-moving 28) - (can-target-move? (_type_) none 29) - (should-teleport? (_type_) symbol 30) - (plat-button-method-31 (_type_) none 31) - (plat-button-method-32 (_type_) none 32) + (can-activate? (_type_) symbol) + (plat-button-method-27 (_type_) none) + (plat-button-method-28 (_type_) collide-shape-moving) + (can-target-move? (_type_) none) + (should-teleport? (_type_) symbol) + (plat-button-method-31 (_type_) none) + (plat-button-method-32 (_type_) none) ) ) @@ -46,11 +44,11 @@ :bounds (static-spherem 0 -1 0 6.6) ) -(defmethod should-teleport? plat-button ((this plat-button)) +(defmethod should-teleport? ((this plat-button)) #f ) -(defmethod can-activate? plat-button ((this plat-button)) +(defmethod can-activate? ((this plat-button)) (or (= (-> this path-pos) 0.0) (and (-> this bidirectional?) (= (-> this path-pos) 1.0))) ) @@ -62,7 +60,7 @@ (when (can-activate? self) (if (and ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) (or (not (-> self should-grab-player?)) (set! (-> self grab-player?) (process-grab? *target*))) @@ -117,7 +115,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> self path) gp-0 f0-0 'interp) (vector+! gp-0 gp-0 (-> self trans-off)) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) ) (ja-post) @@ -201,18 +199,18 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> self path) gp-0 f0-4 'interp) (vector+! gp-0 gp-0 (-> self trans-off)) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) ) (sound-play "elev-loop" :id (-> self sound-id)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (-> self sound-id)) - (let ((a1-6 (-> self root-override trans))) + (let ((a1-6 (-> self root trans))) (let ((s5-0 self)) (when (= a1-6 #t) - (if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> s5-0 root-override))) - (set! a1-6 (-> s5-0 root-override trans)) + (if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> s5-0 root))) + (set! a1-6 (-> s5-0 root trans)) (set! a1-6 (the-as vector #f)) ) ) @@ -271,18 +269,18 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> self path) gp-0 f0-4 'interp) (vector+! gp-0 gp-0 (-> self trans-off)) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) ) (sound-play "elev-loop" :id (-> self sound-id)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (-> self sound-id)) - (let ((a1-6 (-> self root-override trans))) + (let ((a1-6 (-> self root trans))) (let ((s5-0 self)) (when (= a1-6 #t) - (if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> s5-0 root-override))) - (set! a1-6 (-> s5-0 root-override trans)) + (if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> s5-0 root))) + (set! a1-6 (-> s5-0 root trans)) (set! a1-6 (the-as vector #f)) ) ) @@ -309,9 +307,7 @@ (sound-stop (-> self sound-id)) (sound-play "elev-land") (loop - (if (or (not *target*) - (< 268435460.0 (vector-vector-xz-distance-squared (-> self root-override trans) (target-pos 0))) - ) + (if (or (not *target*) (< 268435460.0 (vector-vector-xz-distance-squared (-> self root trans) (target-pos 0)))) (go-virtual plat-button-idle) ) (suspend) @@ -319,7 +315,7 @@ ) ) -(defmethod plat-button-method-28 plat-button ((this plat-button)) +(defmethod plat-button-method-28 ((this plat-button)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -355,17 +351,17 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) -(defmethod can-target-move? plat-button ((this plat-button)) +(defmethod can-target-move? ((this plat-button)) 0 (none) ) -(defmethod plat-button-method-27 plat-button ((this plat-button)) +(defmethod plat-button-method-27 ((this plat-button)) (ja-channel-set! 1) (cond ((can-activate? this) @@ -392,23 +388,23 @@ ) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (none) ) -(defmethod plat-button-method-31 plat-button ((this plat-button)) +(defmethod plat-button-method-31 ((this plat-button)) (initialize-skeleton this *plat-button-sg* '()) 0 (none) ) -(defmethod plat-button-method-32 plat-button ((this plat-button)) +(defmethod plat-button-method-32 ((this plat-button)) (go (method-of-object this plat-button-idle)) 0 (none) ) -(defmethod init-from-entity! plat-button ((this plat-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this plat-button) (arg0 entity-actor)) (set! (-> this go-back-if-lost-player?) #f) (set! (-> this grab-player?) #f) (set! (-> this should-grab-player?) #f) @@ -431,11 +427,11 @@ (logclear! (-> this mask) (process-mask actor-pause)) (plat-button-method-31 this) (logior! (-> this skel status) (janim-status inited)) - (set! (-> this spawn-pos quad) (-> this root-override trans quad)) + (set! (-> this spawn-pos quad) (-> this root trans quad)) (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (set! (-> this path-pos) 0.0) - (let ((s5-1 (-> this root-override trans))) + (let ((s5-1 (-> this root trans))) (eval-path-curve! (-> this path) s5-1 (-> this path-pos) 'interp) (vector+! s5-1 s5-1 (-> this trans-off)) ) diff --git a/goal_src/jak1/engine/common-obs/plat-eco.gc b/goal_src/jak1/engine/common-obs/plat-eco.gc index ae86644456a..c70b97f5ebf 100644 --- a/goal_src/jak1/engine/common-obs/plat-eco.gc +++ b/goal_src/jak1/engine/common-obs/plat-eco.gc @@ -8,20 +8,16 @@ ;; DECOMP BEGINS (deftype plat-eco (plat) - ((notice-dist float :offset-assert 264) - (sync-offset-dest float :offset-assert 268) - (sync-offset-faux float :offset-assert 272) - (sync-linear-val float :offset-assert 276) - (target handle :offset-assert 280) - (unlit-look lod-set :inline :offset-assert 288) - (lit-look lod-set :inline :offset-assert 324) + ((notice-dist float) + (sync-offset-dest float) + (sync-offset-faux float) + (sync-linear-val float) + (target handle) + (unlit-look lod-set :inline) + (lit-look lod-set :inline) ) - :heap-base #x100 - :method-count-assert 33 - :size-assert #x165 - :flag-assert #x2101000165 (:methods - (notice-blue (handle) _type_ :replace :state 29) + (notice-blue (handle) _type_ :state :overlay-at wad) ) ) @@ -59,7 +55,7 @@ ) :trans (behavior () (when (and (and *target* - (>= (-> self notice-dist) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + (>= (-> self notice-dist) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) @@ -67,14 +63,14 @@ (go-virtual plat-path-active (the-as plat #f)) ) (if (and *target* - (>= (-> self notice-dist) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + (>= (-> self notice-dist) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (level-hint-spawn (text-id misty-eco-plat) "sksp0073" (the-as entity #f) *entity-pool* (game-task none)) ) ) :code (behavior () (ja-post) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (anim-loop) ) :post ja-post @@ -85,7 +81,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('wake) - (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root trans))) (go-virtual plat-path-active (the-as plat #f)) ) (('ridden 'edge-grabbed) @@ -128,7 +124,7 @@ ) ) (when v1-6 - (let* ((s5-0 (-> self root-override root-prim prim-core)) + (let* ((s5-0 (-> self root root-prim prim-core)) (a1-3 (-> (the-as collide-shape v1-6) root-prim prim-core)) (f30-0 (vector-vector-distance (the-as vector s5-0) (the-as vector a1-3))) ) @@ -214,7 +210,7 @@ ) ) -(defmethod baseplat-method-24 plat-eco ((this plat-eco)) +(defmethod baseplat-method-24 ((this plat-eco)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -233,21 +229,21 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod get-unlit-skel plat-eco ((this plat-eco)) +(defmethod get-unlit-skel ((this plat-eco)) *plat-eco-unlit-sg* ) -(defmethod get-lit-skel plat-eco ((this plat-eco)) +(defmethod get-lit-skel ((this plat-eco)) *plat-eco-lit-sg* ) -(defmethod init-from-entity! plat-eco ((this plat-eco) (arg0 entity-actor)) +(defmethod init-from-entity! ((this plat-eco) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (set! (-> this notice-dist) (res-lump-float arg0 'notice-dist :default -1.0)) (set! (-> this link) (new 'process 'actor-link-info this)) @@ -261,7 +257,7 @@ (setup-lods! (-> this lit-look) s5-1 (-> this draw art-group) (-> this entity)) ) (logclear! (-> this mask) (process-mask actor-pause)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 107) this)) (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) @@ -274,7 +270,7 @@ (sync-now! (-> this sync) (-> this sync-linear-val)) (set! (-> this sync-offset-faux) (-> this sync offset)) (set! (-> this path-pos) (get-current-phase-with-mirror (-> this sync))) - (eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp) + (eval-path-curve! (-> this path) (-> this root trans) (-> this path-pos) 'interp) (set! (-> this sound-id) (new-sound-id)) (baseplat-method-26 this) (baseplat-method-21 this) diff --git a/goal_src/jak1/engine/common-obs/plat.gc b/goal_src/jak1/engine/common-obs/plat.gc index b841675b420..972087ee7e7 100644 --- a/goal_src/jak1/engine/common-obs/plat.gc +++ b/goal_src/jak1/engine/common-obs/plat.gc @@ -55,21 +55,17 @@ ) (deftype plat (baseplat) - ((path-pos float :offset-assert 228) - (sync sync-info-eased :inline :offset-assert 232) - (sound-id sound-id :offset-assert 260) + ((path-pos float) + (sync sync-info-eased :inline) + (sound-id sound-id) ) - :heap-base #xa0 - :method-count-assert 33 - :size-assert #x108 - :flag-assert #x2100a00108 (:methods - (get-lit-skel (_type_) skeleton-group 27) - (plat-method-28 () none 28) - (wad () _type_ :state 29) - (plat-startup (plat) _type_ :state 30) - (plat-idle () _type_ :state 31) - (plat-path-active (plat) _type_ :state 32) + (get-lit-skel (_type_) skeleton-group) + (plat-method-28 () none) + (wad () _type_ :state) + (plat-startup (plat) _type_ :state) + (plat-idle () _type_ :state) + (plat-path-active (plat) _type_ :state) ) ) @@ -89,7 +85,7 @@ :bounds (static-spherem 0 -0.5 0 3.2) ) -(defmethod get-unlit-skel plat ((this plat)) +(defmethod get-unlit-skel ((this plat)) (cond ((= (-> (if (-> this entity) (-> this entity extra level) @@ -126,7 +122,7 @@ ) ) -(defmethod baseplat-method-24 plat ((this plat)) +(defmethod baseplat-method-24 ((this plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -145,18 +141,18 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod baseplat-method-26 plat ((this plat)) +(defmethod baseplat-method-26 ((this plat)) 0 (none) ) -(defmethod baseplat-method-25 plat ((this plat)) +(defmethod baseplat-method-25 ((this plat)) (the-as sparticle-launch-group (when (!= (-> (if (-> this entity) (-> this entity extra level) (-> *level* level-default) @@ -230,8 +226,8 @@ ) ) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) + (if (< (vector-vector-distance (-> self root trans) (ear-trans)) 81920.0) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root trans))) ) (plat-trans) ) @@ -239,13 +235,13 @@ :post plat-post ) -(defmethod init-from-entity! plat ((this plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this plat) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (baseplat-method-24 this) (process-drawable-from-entity! this arg0) (initialize-skeleton this (get-unlit-skel this) '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (baseplat-method-21 this) (baseplat-method-25 this) (load-params! (-> this sync) this (the-as uint 0) 0.0 0.15 0.15) @@ -269,7 +265,7 @@ (get-current-phase-with-mirror (-> this sync)) ) ) - (eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp) + (eval-path-curve! (-> this path) (-> this root trans) (-> this path-pos) 'interp) (let ((a0-18 this)) (baseplat-method-26 a0-18) (go (method-of-object this plat-startup) a0-18) @@ -277,7 +273,7 @@ ) (else (set! (-> this path-pos) 0.0) - (eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp) + (eval-path-curve! (-> this path) (-> this root trans) (-> this path-pos) 'interp) (let ((a0-20 this)) (baseplat-method-26 a0-20) (go (method-of-object this plat-startup) a0-20) diff --git a/goal_src/jak1/engine/common-obs/process-taskable.gc b/goal_src/jak1/engine/common-obs/process-taskable.gc index 292f19be6c2..c858eabb14b 100644 --- a/goal_src/jak1/engine/common-obs/process-taskable.gc +++ b/goal_src/jak1/engine/common-obs/process-taskable.gc @@ -18,7 +18,7 @@ ;; DECOMP BEGINS -(defmethod process-taskable-method-52 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-52 ((this process-taskable)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) @@ -32,7 +32,7 @@ (none) ) -(defmethod init! gui-query ((this gui-query) (arg0 string) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol) (arg5 string)) +(defmethod init! ((this gui-query) (arg0 string) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol) (arg5 string)) (set! (-> this x-position) arg1) (set! (-> this y-position) arg2) (set! (-> this message-space) arg3) @@ -44,7 +44,7 @@ (none) ) -(defmethod get-response gui-query ((this gui-query)) +(defmethod get-response ((this gui-query)) (kill-current-level-hint '() '(sidekick voicebox stinger) 'exit) (level-hint-surpress!) (hide-hud) @@ -146,18 +146,15 @@ (-> this decision) ) -(defmethod relocate process-taskable ((this process-taskable) (arg0 int)) +(defmethod relocate ((this process-taskable) (arg0 int)) (the-as process-taskable ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod process-taskable-method-46 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-46 ((this process-taskable)) (when (nonzero? (-> this sound-flava)) - (let ((s5-1 (vector-! - (new 'stack-no-clear 'vector) - (target-pos 0) - (the-as vector (-> this root-override root-prim prim-core)) - ) - ) + (let ((s5-1 + (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (the-as vector (-> this root root-prim prim-core))) + ) ) (set! (-> s5-1 y) (* 4.0 (-> s5-1 y))) (cond @@ -176,12 +173,9 @@ ) ) (when (-> this music) - (let ((s5-3 (vector-! - (new 'stack-no-clear 'vector) - (target-pos 0) - (the-as vector (-> this root-override root-prim prim-core)) - ) - ) + (let ((s5-3 + (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (the-as vector (-> this root root-prim prim-core))) + ) ) (set! (-> s5-3 y) (* 4.0 (-> s5-3 y))) (cond @@ -202,18 +196,18 @@ (none) ) -(defmethod get-art-elem process-taskable ((this process-taskable)) +(defmethod get-art-elem ((this process-taskable)) (the-as art-element (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) ) ) ) -(defmethod play-anim! process-taskable ((this process-taskable) (arg0 symbol)) +(defmethod play-anim! ((this process-taskable) (arg0 symbol)) (the-as basic #f) ) -(defmethod process-taskable-method-33 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-33 ((this process-taskable)) (let ((s5-0 (play-anim! this #f))) (if (type-type? (-> s5-0 type) spool-anim) (spool-push *art-control* (-> (the-as spool-anim s5-0) name) 0 this -99.0) @@ -223,7 +217,7 @@ (none) ) -(defmethod close-anim-file! process-taskable ((this process-taskable)) +(defmethod close-anim-file! ((this process-taskable)) (let* ((gp-0 (play-anim! this #f)) (v1-2 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) spool-anim)) gp-0 @@ -236,11 +230,11 @@ ) ) -(defmethod get-accept-anim process-taskable ((this process-taskable) (arg0 symbol)) +(defmethod get-accept-anim ((this process-taskable) (arg0 symbol)) (the-as spool-anim #f) ) -(defmethod push-accept-anim process-taskable ((this process-taskable)) +(defmethod push-accept-anim ((this process-taskable)) (let ((s5-0 (get-accept-anim this #f))) (if (type-type? (-> s5-0 type) spool-anim) (spool-push *art-control* (-> s5-0 name) 0 this -99.0) @@ -250,11 +244,11 @@ (none) ) -(defmethod get-reject-anim process-taskable ((this process-taskable) (arg0 symbol)) +(defmethod get-reject-anim ((this process-taskable) (arg0 symbol)) (the-as spool-anim #f) ) -(defmethod push-reject-anim process-taskable ((this process-taskable)) +(defmethod push-reject-anim ((this process-taskable)) (let ((s5-0 (get-reject-anim this #f))) (if (type-type? (-> s5-0 type) spool-anim) (spool-push *art-control* (-> s5-0 name) 0 this -99.0) @@ -264,7 +258,7 @@ (none) ) -(defmethod process-taskable-method-38 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-38 ((this process-taskable)) (if (nonzero? (-> this cell-for-task)) (go (method-of-object this give-cell)) ) @@ -344,9 +338,7 @@ ) :trans (behavior () (if (and (time-elapsed? (-> self state-time) (seconds 5)) - (or (not *target*) - (< 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (or (not *target*) (< 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) ) (go-virtual idle) ) @@ -628,7 +620,7 @@ (none) ) -(defmethod should-display? process-taskable ((this process-taskable)) +(defmethod should-display? ((this process-taskable)) #t ) @@ -655,7 +647,7 @@ ) 0 (process-taskable-clean-up-after-talking) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-channel-set! 0) (the-as int (ja-post)) ) @@ -668,7 +660,7 @@ (else (ja-channel-set! 1) (ja :group! (get-art-elem self)) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (process-entity-status! self (entity-perm-status bit-3) #t) (let ((v1-7 (-> self draw shadow-ctrl))) (logclear! (-> v1-7 settings flags) (shadow-flags disable-draw)) @@ -698,13 +690,11 @@ ) ;; WARN: disable def twice: 4. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod process-taskable-method-50 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-50 ((this process-taskable)) (if *target* - (or (not *target*) - (< 245760.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans))) - ) + (or (not *target*) (< 245760.0 (vector-vector-distance (-> this root trans) (-> *target* control trans)))) (< 60397978000.0 - (vector-vector-distance-squared (the-as vector (-> this root-override root-prim prim-core)) (camera-pos)) + (vector-vector-distance-squared (the-as vector (-> this root root-prim prim-core)) (camera-pos)) ) ) ) @@ -784,7 +774,7 @@ (logior! (-> self mask) (process-mask actor-pause)) (let ((v1-6 (-> self entity extra trans))) (if v1-6 - (set! (-> self root-override trans quad) (-> v1-6 quad)) + (set! (-> self root trans quad) (-> v1-6 quad)) ) ) (ja-channel-set! 0) @@ -800,7 +790,7 @@ ) ) -(defmethod target-above-threshold? process-taskable ((this process-taskable)) +(defmethod target-above-threshold? ((this process-taskable)) #t ) @@ -822,15 +812,10 @@ ) ) (('touch) - (the-as symbol (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> block param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) + (the-as + symbol + (send-shove-back (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) + ) ) (('clone) (the-as symbol (go-virtual be-clone (the-as handle (-> block param 0)))) @@ -887,11 +872,9 @@ (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) - (< (-> (target-pos 0) y) (+ 8192.0 (-> self root-override root-prim prim-core world-sphere y))) + (< (-> (target-pos 0) y) (+ 8192.0 (-> self root root-prim prim-core world-sphere y))) ;; og:preserve-this - (less-than-hack (vector-vector-distance (target-pos 0) (the-as vector (-> self root-override root-prim prim-core))) - 32768.0 - ) + (less-than-hack (vector-vector-distance (target-pos 0) (the-as vector (-> self root root-prim prim-core))) 32768.0) (= (-> *level* loading-level) (-> *level* level-default)) (not (movie?)) (not (level-hint-displayed?)) @@ -972,7 +955,7 @@ ) ) -(defmethod initialize-collision process-taskable ((this process-taskable) (arg0 int) (arg1 vector)) +(defmethod initialize-collision ((this process-taskable) (arg0 int) (arg1 vector)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) @@ -985,13 +968,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod process-taskable-method-40 process-taskable ((this process-taskable) (arg0 object) (arg1 skeleton-group) (arg2 int) (arg3 int) (arg4 vector) (arg5 int)) +(defmethod process-taskable-method-40 ((this process-taskable) (arg0 object) (arg1 skeleton-group) (arg2 int) (arg3 int) (arg4 vector) (arg5 int)) (stack-size-set! (-> this main-thread) 512) (initialize-collision this arg2 arg4) (process-drawable-from-entity! this (the-as entity-actor arg0)) @@ -1001,7 +984,7 @@ ;; og:preserve-this (#when PC_PORT (set! (-> this skel postbind-function) process-drawable-joint-callback-pc)) - (set! (-> this root-override pause-adjust-distance) -122880.0) + (set! (-> this root pause-adjust-distance) -122880.0) (set! (-> this fuel-cell-anim) (fuel-cell-pick-anim this)) (set! (-> this draw origin-joint-index) (the-as uint arg2)) (set! (-> this draw shadow-joint-index) (the-as uint arg2)) @@ -1029,7 +1012,7 @@ (none) ) -(defmethod process-taskable-method-42 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-42 ((this process-taskable)) (cond ((not (should-display? this)) (go (method-of-object this hidden)) @@ -1044,17 +1027,17 @@ (none) ) -(defmethod process-taskable-method-43 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-43 ((this process-taskable)) (the-as symbol 0) ) -(defmethod ambient-control-method-9 ambient-control ((this ambient-control)) +(defmethod ambient-control-method-9 ((this ambient-control)) (set! (-> this last-ambient-time) (-> *display* game-frame-counter)) 0 (none) ) -(defmethod ambient-control-method-10 ambient-control ((this ambient-control) (arg0 vector) (arg1 time-frame) (arg2 float) (arg3 process-drawable)) +(defmethod ambient-control-method-10 ((this ambient-control) (arg0 vector) (arg1 time-frame) (arg2 float) (arg3 process-drawable)) (when (< (- (-> *display* game-frame-counter) (-> this last-ambient-time)) arg1) (set! arg0 (the-as vector #f)) (goto cfg-6) @@ -1068,7 +1051,7 @@ arg0 ) -(defmethod play-ambient ambient-control ((this ambient-control) (arg0 string) (arg1 symbol) (arg2 vector)) +(defmethod play-ambient ((this ambient-control) (arg0 string) (arg1 symbol) (arg2 vector)) (when (and (not (string= arg0 (-> this last-ambient))) (or arg1 (can-hint-be-played? (text-id one) (the-as entity #f) (the-as string #f))) (= (-> *level* loading-level) (-> *level* level-default)) @@ -1174,7 +1157,7 @@ (format #t "ERROR: othercam parent invalid~%") (deactivate self) ) - (set! (-> *camera-other-root* quad) (-> (the-as process-taskable s2-0) root-override trans quad)) + (set! (-> *camera-other-root* quad) (-> (the-as process-taskable s2-0) root trans quad)) (let ((s4-0 (-> (the-as process-taskable s2-0) node-list data (-> self cam-joint-index) bone transform)) (s3-0 (-> (the-as process-taskable s2-0) node-list data (-> self cam-joint-index) bone scale)) (gp-0 (new 'stack-no-clear 'vector)) @@ -1254,7 +1237,7 @@ (none) ) -(defmethod draw-npc-shadow process-taskable ((this process-taskable)) +(defmethod draw-npc-shadow ((this process-taskable)) (let ((gp-0 (-> this draw shadow-ctrl))) (cond ((and (-> this draw shadow) diff --git a/goal_src/jak1/engine/common-obs/rigid-body-h.gc b/goal_src/jak1/engine/common-obs/rigid-body-h.gc index 8ca7e5d5ee9..ef78ebe61c3 100644 --- a/goal_src/jak1/engine/common-obs/rigid-body-h.gc +++ b/goal_src/jak1/engine/common-obs/rigid-body-h.gc @@ -8,54 +8,48 @@ ;; DECOMP BEGINS (deftype rigid-body (structure) - ((mass float :offset-assert 0) - (inv-mass float :offset-assert 4) - (lin-momentum-damping-factor float :offset-assert 8) - (ang-momentum-damping-factor float :offset-assert 12) - (inertial-tensor matrix :inline :offset-assert 16) - (inv-inertial-tensor matrix :inline :offset-assert 80) - (cm-offset-joint vector :inline :offset-assert 144) - (position vector :inline :offset-assert 160) - (rotation quaternion :inline :offset-assert 176) - (lin-momentum vector :inline :offset-assert 192) - (ang-momentum vector :inline :offset-assert 208) - (lin-velocity vector :inline :offset-assert 224) - (ang-velocity vector :inline :offset-assert 240) - (inv-i-world matrix :inline :offset-assert 256) - (matrix matrix :inline :offset-assert 320) - (force vector :inline :offset-assert 384) - (torque vector :inline :offset-assert 400) - (max-ang-momentum float :offset-assert 416) - (max-ang-velocity float :offset-assert 420) + ((mass float) + (inv-mass float) + (lin-momentum-damping-factor float) + (ang-momentum-damping-factor float) + (inertial-tensor matrix :inline) + (inv-inertial-tensor matrix :inline) + (cm-offset-joint vector :inline) + (position vector :inline) + (rotation quaternion :inline) + (lin-momentum vector :inline) + (ang-momentum vector :inline) + (lin-velocity vector :inline) + (ang-velocity vector :inline) + (inv-i-world matrix :inline) + (matrix matrix :inline) + (force vector :inline) + (torque vector :inline) + (max-ang-momentum float) + (max-ang-velocity float) ) - :method-count-assert 23 - :size-assert #x1a8 - :flag-assert #x17000001a8 (:methods - (rigid-body-method-9 (_type_ float float float float) none 9) - (rigid-body-method-10 (_type_ float) none 10) - (clear-force-torque! (_type_) none 11) - (clear-momentum! (_type_) none 12) - (rigid-body-method-13 (_type_ vector vector) none 13) - (rigid-body-method-14 (_type_ vector vector) none 14) - (rigid-body-method-15 (_type_ vector) none 15) - (rigid-body-method-16 (_type_ vector vector float) none 16) - (rigid-body-method-17 (_type_ vector vector) vector 17) - (rigid-body-method-18 (_type_ vector) vector 18) - (print-stats (_type_) none 19) - (rigid-body-method-20 (_type_) none 20) - (rigid-body-method-21 (_type_) none 21) - (rigid-body-method-22 (_type_ vector quaternion float float) none 22) + (rigid-body-method-9 (_type_ float float float float) none) + (rigid-body-method-10 (_type_ float) none) + (clear-force-torque! (_type_) none) + (clear-momentum! (_type_) none) + (rigid-body-method-13 (_type_ vector vector) none) + (rigid-body-method-14 (_type_ vector vector) none) + (rigid-body-method-15 (_type_ vector) none) + (rigid-body-method-16 (_type_ vector vector float) none) + (rigid-body-method-17 (_type_ vector vector) vector) + (rigid-body-method-18 (_type_ vector) vector) + (print-stats (_type_) none) + (rigid-body-method-20 (_type_) none) + (rigid-body-method-21 (_type_) none) + (rigid-body-method-22 (_type_ vector quaternion float float) none) ) ) (deftype rigid-body-control-point (structure) - ((local-pos vector :inline :offset-assert 0) - (world-pos vector :inline :offset-assert 16) - (velocity vector :inline :offset-assert 32) + ((local-pos vector :inline) + (world-pos vector :inline) + (velocity vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) diff --git a/goal_src/jak1/engine/common-obs/rigid-body.gc b/goal_src/jak1/engine/common-obs/rigid-body.gc index 6e79103e785..d182b2ec110 100644 --- a/goal_src/jak1/engine/common-obs/rigid-body.gc +++ b/goal_src/jak1/engine/common-obs/rigid-body.gc @@ -8,28 +8,28 @@ ;; DECOMP BEGINS -(defmethod clear-force-torque! rigid-body ((this rigid-body)) +(defmethod clear-force-torque! ((this rigid-body)) (set! (-> this force quad) (-> *null-vector* quad)) (set! (-> this torque quad) (-> *null-vector* quad)) 0 (none) ) -(defmethod clear-momentum! rigid-body ((this rigid-body)) +(defmethod clear-momentum! ((this rigid-body)) (set! (-> this lin-momentum quad) (-> *null-vector* quad)) (set! (-> this ang-momentum quad) (-> *null-vector* quad)) 0 (none) ) -(defmethod rigid-body-method-21 rigid-body ((this rigid-body)) +(defmethod rigid-body-method-21 ((this rigid-body)) (quaternion->matrix (-> this matrix) (-> this rotation)) (rigid-body-method-18 this (-> this matrix vector 3)) 0 (none) ) -(defmethod rigid-body-method-22 rigid-body ((this rigid-body) (arg0 vector) (arg1 quaternion) (arg2 float) (arg3 float)) +(defmethod rigid-body-method-22 ((this rigid-body) (arg0 vector) (arg1 quaternion) (arg2 float) (arg3 float)) (clear-force-torque! this) (clear-momentum! this) (vector+! (-> this position) arg0 (-> this cm-offset-joint)) @@ -50,7 +50,7 @@ (none) ) -(defmethod rigid-body-method-9 rigid-body ((this rigid-body) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) +(defmethod rigid-body-method-9 ((this rigid-body) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (set! (-> this mass) arg0) (let ((f0-1 arg0)) (set! (-> this inv-mass) (/ 1.0 f0-1)) @@ -93,7 +93,7 @@ (none) ) -(defmethod rigid-body-method-17 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-17 ((this rigid-body) (arg0 vector) (arg1 vector)) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position)))) (vector-cross! arg1 (-> this ang-velocity) v1-1) ) @@ -120,7 +120,7 @@ arg0 ) -(defmethod rigid-body-method-10 rigid-body ((this rigid-body) (arg0 float)) +(defmethod rigid-body-method-10 ((this rigid-body) (arg0 float)) (vector+*! (-> this lin-momentum) (-> this lin-momentum) (-> this force) arg0) (vector+*! (-> this ang-momentum) (-> this ang-momentum) (-> this torque) arg0) (vector-float*! (-> this lin-momentum) (-> this lin-momentum) (-> this lin-momentum-damping-factor)) @@ -147,7 +147,7 @@ (none) ) -(defmethod rigid-body-method-13 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-13 ((this rigid-body) (arg0 vector) (arg1 vector)) (vector+! (-> this force) (-> this force) arg1) (let* ((v1-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position))) (a1-2 (vector-cross! (new 'stack-no-clear 'vector) v1-2 arg1)) @@ -158,7 +158,7 @@ (none) ) -(defmethod rigid-body-method-16 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod rigid-body-method-16 ((this rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) (vector+! (-> this force) (-> this force) arg1) (let* ((a0-3 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position))) (s4-1 (vector-cross! (new 'stack-no-clear 'vector) a0-3 arg1)) @@ -174,7 +174,7 @@ (none) ) -(defmethod rigid-body-method-14 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-14 ((this rigid-body) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -187,13 +187,13 @@ (none) ) -(defmethod rigid-body-method-15 rigid-body ((this rigid-body) (arg0 vector)) +(defmethod rigid-body-method-15 ((this rigid-body) (arg0 vector)) (vector+! (-> this force) (-> this force) arg0) 0 (none) ) -(defmethod rigid-body-method-18 rigid-body ((this rigid-body) (arg0 vector)) +(defmethod rigid-body-method-18 ((this rigid-body) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-rotate*! gp-0 (-> this cm-offset-joint) (-> this matrix)) (vector-! arg0 (-> this position) gp-0) @@ -201,7 +201,7 @@ arg0 ) -(defmethod print-stats rigid-body ((this rigid-body)) +(defmethod print-stats ((this rigid-body)) (format #t " force ~M ~M ~M" (-> this force x) (-> this force y) (-> this force z)) (format #t " torque ~f ~f ~f~%" (-> this torque x) (-> this torque y) (-> this torque z)) (format #t " position ~M ~M ~M" (-> this position x) (-> this position y) (-> this position z)) @@ -221,7 +221,7 @@ (none) ) -(defmethod rigid-body-method-20 rigid-body ((this rigid-body)) +(defmethod rigid-body-method-20 ((this rigid-body)) (format #t " force ~M ~M ~M" (-> this force x) (-> this force y) (-> this force z)) (format #t " torque ~f ~f ~f~%" (-> this torque x) (-> this torque y) (-> this torque z)) 0 @@ -229,91 +229,83 @@ ) (deftype rigid-body-platform-constants (structure) - ((drag-factor float :offset-assert 0) - (buoyancy-factor float :offset-assert 4) - (max-buoyancy-depth meters :offset-assert 8) - (gravity-factor float :offset-assert 12) - (gravity meters :offset-assert 16) - (player-weight meters :offset-assert 20) - (player-bonk-factor float :offset-assert 24) - (player-dive-factor float :offset-assert 28) - (player-force-distance meters :offset-assert 32) - (player-force-clamp meters :offset-assert 36) - (player-force-timeout time-frame :offset-assert 40) - (explosion-force meters :offset-assert 48) - (linear-damping float :offset-assert 52) - (angular-damping float :offset-assert 56) - (control-point-count int32 :offset-assert 60) - (mass float :offset-assert 64) - (inertial-tensor-x meters :offset-assert 68) - (inertial-tensor-y meters :offset-assert 72) - (inertial-tensor-z meters :offset-assert 76) - (cm-joint-x meters :offset-assert 80) - (cm-joint-y meters :offset-assert 84) - (cm-joint-z meters :offset-assert 88) - (idle-distance meters :offset-assert 92) - (platform symbol :offset-assert 96) - (sound-name string :offset-assert 100) + ((drag-factor float) + (buoyancy-factor float) + (max-buoyancy-depth meters) + (gravity-factor float) + (gravity meters) + (player-weight meters) + (player-bonk-factor float) + (player-dive-factor float) + (player-force-distance meters) + (player-force-clamp meters) + (player-force-timeout time-frame) + (explosion-force meters) + (linear-damping float) + (angular-damping float) + (control-point-count int32) + (mass float) + (inertial-tensor-x meters) + (inertial-tensor-y meters) + (inertial-tensor-z meters) + (cm-joint-x meters) + (cm-joint-y meters) + (cm-joint-z meters) + (idle-distance meters) + (platform symbol) + (sound-name string) ) - :method-count-assert 9 - :size-assert #x68 - :flag-assert #x900000068 ) (deftype rigid-body-control-point-inline-array (inline-array-class) - ((data rigid-body-control-point :inline :dynamic :offset 16) + ((data rigid-body-control-point :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> rigid-body-control-point-inline-array heap-base) (the-as uint 48)) (deftype rigid-body-platform (process-drawable) - ((root-overlay collide-shape-moving :offset 112) - (info rigid-body-platform-constants :offset-assert 176) - (rbody rigid-body :inline :offset-assert 192) - (control-point-array rigid-body-control-point-inline-array :offset-assert 616) - (player-velocity vector :inline :offset-assert 624) - (player-velocity-prev vector :inline :offset-assert 640) - (player-force-position vector :inline :offset-assert 656) - (player-force vector :inline :offset-assert 672) - (sim-time-remaining float :offset-assert 688) - (float-height-offset float :offset-assert 692) - (player-attack-id int32 :offset-assert 696) - (player-bonk-timeout time-frame :offset-assert 704) - (water-anim water-anim :offset-assert 712) - (player-contact basic :offset-assert 716) - (player-impulse collide-shape-prim-mesh :offset-assert 720) + ((root-overlay collide-shape-moving :overlay-at root) + (info rigid-body-platform-constants) + (rbody rigid-body :inline) + (control-point-array rigid-body-control-point-inline-array) + (player-velocity vector :inline) + (player-velocity-prev vector :inline) + (player-force-position vector :inline) + (player-force vector :inline) + (sim-time-remaining float) + (float-height-offset float) + (player-attack-id int32) + (player-bonk-timeout time-frame) + (water-anim water-anim) + (player-contact basic) + (player-impulse collide-shape-prim-mesh) ) - :heap-base #x270 - :method-count-assert 35 - :size-assert #x2d4 - :flag-assert #x23027002d4 + (:state-methods + rigid-body-platform-idle + rigid-body-platform-float + ) (:methods - (rigid-body-platform-idle () _type_ :state 20) - (rigid-body-platform-float () _type_ :state 21) - (rigid-body-platform-method-22 (_type_ vector float) float 22) - (rigid-body-platform-method-23 (_type_ float) none 23) - (rigid-body-platform-method-24 (_type_ rigid-body-control-point float) none 24) - (rigid-body-platform-method-25 (_type_) none 25) - (rigid-body-platform-method-26 (_type_) none 26) - (rigid-body-platform-method-27 (_type_ vector) none 27) - (rigid-body-platform-method-28 (_type_) none 28) - (rigid-body-platform-method-29 (_type_ rigid-body-platform-constants) none 29) - (rigid-body-platform-method-30 (_type_) none 30) - (rigid-body-platform-method-31 (_type_) none 31) - (rigid-body-platform-method-32 (_type_) sound-id 32) - (rigid-body-platform-method-33 (_type_) object 33) - (rigid-body-platform-method-34 (_type_) none 34) - ) - ) - - -(defmethod relocate rigid-body-platform ((this rigid-body-platform) (arg0 int)) + (rigid-body-platform-method-22 (_type_ vector float) float) + (rigid-body-platform-method-23 (_type_ float) none) + (rigid-body-platform-method-24 (_type_ rigid-body-control-point float) none) + (rigid-body-platform-method-25 (_type_) none) + (rigid-body-platform-method-26 (_type_) none) + (rigid-body-platform-method-27 (_type_ vector) none) + (rigid-body-platform-method-28 (_type_) none) + (rigid-body-platform-method-29 (_type_ rigid-body-platform-constants) none) + (rigid-body-platform-method-30 (_type_) none) + (rigid-body-platform-method-31 (_type_) none) + (rigid-body-platform-method-32 (_type_) sound-id) + (rigid-body-platform-method-33 (_type_) object) + (rigid-body-platform-method-34 (_type_) none) + ) + ) + + +(defmethod relocate ((this rigid-body-platform) (arg0 int)) (if (nonzero? (-> this control-point-array)) (set! (-> this control-point-array) (the-as rigid-body-control-point-inline-array (+ (the-as int (-> this control-point-array)) arg0)) @@ -322,7 +314,7 @@ (call-parent-method this arg0) ) -(defmethod rigid-body-platform-method-22 rigid-body-platform ((this rigid-body-platform) (arg0 vector) (arg1 float)) +(defmethod rigid-body-platform-method-22 ((this rigid-body-platform) (arg0 vector) (arg1 float)) (let ((v1-0 (-> this water-anim))) 0.0 (+ (the-as float (cond @@ -349,7 +341,7 @@ ) ) -(defmethod rigid-body-platform-method-24 rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-control-point) (arg1 float)) +(defmethod rigid-body-platform-method-24 ((this rigid-body-platform) (arg0 rigid-body-control-point) (arg1 float)) (set! (-> arg0 world-pos w) (rigid-body-platform-method-22 this (-> arg0 world-pos) arg1)) (let* ((s4-0 (new 'stack-no-clear 'vector)) (f0-2 (- (-> arg0 world-pos w) (-> arg0 world-pos y))) @@ -373,7 +365,7 @@ (none) ) -(defmethod rigid-body-platform-method-25 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-25 ((this rigid-body-platform)) (when (or (-> this player-impulse) (-> this player-contact)) (set! (-> this player-impulse) #f) (rigid-body-method-16 @@ -387,7 +379,7 @@ (none) ) -(defmethod rigid-body-platform-method-26 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-26 ((this rigid-body-platform)) (let ((a1-0 (new 'stack-no-clear 'vector))) (vector-float*! a1-0 @@ -400,7 +392,7 @@ (none) ) -(defmethod rigid-body-platform-method-27 rigid-body-platform ((this rigid-body-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-27 ((this rigid-body-platform) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 arg0 (-> this rbody position)) (set! (-> gp-0 y) 0.0) @@ -417,7 +409,7 @@ (none) ) -(defmethod rigid-body-platform-method-23 rigid-body-platform ((this rigid-body-platform) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this rigid-body-platform) (arg0 float)) (let ((s4-0 (-> this rbody matrix))) (dotimes (s3-0 (-> this info control-point-count)) (let ((s2-0 (-> this control-point-array data s3-0))) @@ -433,7 +425,7 @@ (none) ) -(defmethod rigid-body-platform-method-28 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-28 ((this rigid-body-platform)) (if (-> this info platform) (detect-riders! (-> this root-overlay)) ) @@ -446,7 +438,7 @@ (* 0.0033333334 (the float (- (current-time) (-> *display* old-base-frame-counter)))) ) (let ((f30-0 (* DISPLAY_FPS_RATIO 0.016666668)) ;; og:preserve-this changed for high fps - (f28-0 (* 0.0033333334 (the float (logand #xffffff (-> *display* base-frame-counter))))) + (f28-0 (* 0.0033333334 (the float (logand #xffffff (current-time))))) ) (while (>= (-> this sim-time-remaining) (* 0.5 f30-0)) (clear-force-torque! (-> this rbody)) @@ -643,7 +635,7 @@ :post rigid-body-platform-post ) -(defmethod rigid-body-platform-method-29 rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-platform-constants)) +(defmethod rigid-body-platform-method-29 ((this rigid-body-platform) (arg0 rigid-body-platform-constants)) (set! (-> this info) arg0) (set! (-> this control-point-array) (new 'process 'rigid-body-control-point-inline-array (-> this info control-point-count)) @@ -682,7 +674,7 @@ (none) ) -(defmethod rigid-body-platform-method-30 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-30 ((this rigid-body-platform)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -733,13 +725,13 @@ ) ) -(defmethod rigid-body-platform-method-34 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-34 ((this rigid-body-platform)) (go (method-of-object this rigid-body-platform-idle)) 0 (none) ) -(defmethod rigid-body-platform-method-31 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-31 ((this rigid-body-platform)) (set! (-> this float-height-offset) 0.0) (rigid-body-platform-method-29 this *rigid-body-platform-constants*) (let ((s5-0 (-> this info control-point-count))) @@ -758,7 +750,7 @@ (none) ) -(defmethod init-from-entity! rigid-body-platform ((this rigid-body-platform) (arg0 entity-actor)) +(defmethod init-from-entity! ((this rigid-body-platform) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (rigid-body-platform-method-30 this) (process-drawable-from-entity! this arg0) diff --git a/goal_src/jak1/engine/common-obs/ropebridge.gc b/goal_src/jak1/engine/common-obs/ropebridge.gc index ed2de80819a..0a7d2451f2a 100644 --- a/goal_src/jak1/engine/common-obs/ropebridge.gc +++ b/goal_src/jak1/engine/common-obs/ropebridge.gc @@ -8,29 +8,26 @@ ;; DECOMP BEGINS (deftype ropebridge-tuning (structure) - ((num-springs int32 :offset-assert 0) - (num-spring-points int32 :offset-assert 4) - (col-mesh-indexes (pointer uint8) :offset-assert 8) - (view-frustum-radius float :offset-assert 12) - (root-prim-radius float :offset-assert 16) - (desired-spring-len float :offset-assert 20) - (gravity float :offset-assert 24) - (spring-coefficient float :offset-assert 28) - (spring-mass float :offset-assert 32) - (friction float :offset-assert 36) - (max-influence-dist float :offset-assert 40) - (rider-max-gravity float :offset-assert 44) - (max-bonk-influence-dist float :offset-assert 48) - (rider-bonk-force float :offset-assert 52) - (rider-bonk-min float :offset-assert 56) - (rider-bonk-max float :offset-assert 60) - (normal-board-len float :offset-assert 64) - (bridge-end-to-end-len float :offset-assert 68) - (rest-state symbol :offset-assert 72) + ((num-springs int32) + (num-spring-points int32) + (col-mesh-indexes (pointer uint8)) + (view-frustum-radius float) + (root-prim-radius float) + (desired-spring-len float) + (gravity float) + (spring-coefficient float) + (spring-mass float) + (friction float) + (max-influence-dist float) + (rider-max-gravity float) + (max-bonk-influence-dist float) + (rider-bonk-force float) + (rider-bonk-min float) + (rider-bonk-max float) + (normal-board-len float) + (bridge-end-to-end-len float) + (rest-state symbol) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) @@ -458,47 +455,40 @@ ) (deftype ropebridge-spring-point (structure) - ((local-pos vector :inline :offset-assert 0) - (vel vector :inline :offset-assert 16) - (extra-force vector :inline :offset-assert 32) + ((local-pos vector :inline) + (vel vector :inline) + (extra-force vector :inline) ) :pack-me - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype ropebridge (process-drawable) - ((root-override collide-shape :offset 112) - (subtype uint64 :offset-assert 176) - (subtype-name string :offset-assert 184) - (agitated-time-stamp time-frame :offset-assert 192) - (bonk-time-stamp time-frame :offset-assert 200) - (attack-flop-time-stamp time-frame :offset-assert 208) - (player-attack-id uint64 :offset-assert 216) - (sleep-dist float :offset-assert 224) - (do-physics? basic :offset-assert 228) - (tuning ropebridge-tuning :offset-assert 232) - (world-matrix matrix :inline :offset-assert 240) - (inv-world-matrix matrix :inline :offset-assert 304) - (extra-trans vector :inline :offset-assert 368) - (spring-point ropebridge-spring-point 36 :inline :offset-assert 384) + ((root collide-shape :override) + (subtype uint64) + (subtype-name string) + (agitated-time-stamp time-frame) + (bonk-time-stamp time-frame) + (attack-flop-time-stamp time-frame) + (player-attack-id uint64) + (sleep-dist float) + (do-physics? basic) + (tuning ropebridge-tuning) + (world-matrix matrix :inline) + (inv-world-matrix matrix :inline) + (extra-trans vector :inline) + (spring-point ropebridge-spring-point 36 :inline) ) - :heap-base #x7d0 - :method-count-assert 29 - :size-assert #x840 - :flag-assert #x1d07d00840 (:methods - (set-vel-from-impact (_type_ uint vector int float) none 20) - (set-vel-from-riders (_type_) none 21) - (set-vel-from-rider (_type_ uint vector int) none 22) - (clear-spring-forces (_type_) none 23) - (debug-draw (_type_) none 24) - (set-to-rest-state (_type_) none 25) - (add-collision-meshes (_type_) none 26) - (do-integration (_type_) none 27) - (ropebridge-method-28 (_type_) none 28) + (set-vel-from-impact (_type_ uint vector int float) none) + (set-vel-from-riders (_type_) none) + (set-vel-from-rider (_type_ uint vector int) none) + (clear-spring-forces (_type_) none) + (debug-draw (_type_) none) + (set-to-rest-state (_type_) none) + (add-collision-meshes (_type_) none) + (do-integration (_type_) none) + (ropebridge-method-28 (_type_) none) ) (:states ropebridge-idle @@ -573,7 +563,7 @@ ) (gp-0 (the-as object (-> block param 0))) (a0-7 (-> (the-as touching-shapes-entry gp-0) head)) - (s4-0 (-> self root-override)) + (s4-0 (-> self root)) (s5-0 (get-touched-prim a0-7 s4-0 (the-as touching-shapes-entry gp-0))) (v1-33 ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s4-0)) (gp-1 (new 'stack-no-clear 'vector)) @@ -594,7 +584,7 @@ :code (behavior () (loop (suspend) - (detect-riders! (-> self root-override)) + (detect-riders! (-> self root)) (when (-> self do-physics?) (clear-spring-forces self) (set-vel-from-riders self) @@ -618,7 +608,7 @@ ) :post (behavior () (ja-post) - (let ((gp-0 (-> self root-override))) + (let ((gp-0 (-> self root))) (update-transforms! gp-0) (when (-> self do-physics?) (pull-riders! gp-0) @@ -630,7 +620,7 @@ ) ;; WARN: Function (method 20 ropebridge) has a return type of none, but the expression builder found a return statement. -(defmethod set-vel-from-impact ropebridge ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int) (arg3 float)) +(defmethod set-vel-from-impact ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int) (arg3 float)) (loop (let ((f0-2 (fabs (- (-> arg1 z) (-> this spring-point (the-as int arg0) local-pos z))))) (if (< (-> this tuning max-bonk-influence-dist) f0-2) @@ -653,7 +643,7 @@ (none) ) -(defmethod clear-spring-forces ropebridge ((this ropebridge)) +(defmethod clear-spring-forces ((this ropebridge)) (let ((v1-0 (the-as ropebridge-spring-point (-> this spring-point)))) (countdown (a0-2 (-> this tuning num-spring-points)) (set! (-> v1-0 extra-force quad) (the-as uint128 0)) @@ -665,8 +655,8 @@ (none) ) -(defmethod set-vel-from-riders ropebridge ((this ropebridge)) - (let ((v1-1 (-> this root-override riders))) +(defmethod set-vel-from-riders ((this ropebridge)) + (let ((v1-1 (-> this root riders))) (when v1-1 (let ((s5-0 (the-as collide-sticky-rider (-> v1-1 rider)))) (countdown (s4-0 (-> v1-1 num-riders)) @@ -697,7 +687,7 @@ ) ;; WARN: Function (method 22 ropebridge) has a return type of none, but the expression builder found a return statement. -(defmethod set-vel-from-rider ropebridge ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int)) +(defmethod set-vel-from-rider ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int)) (loop (let ((f0-0 (vector-vector-distance arg1 (the-as vector (-> this spring-point (the-as int arg0)))))) (if (< (-> this tuning max-influence-dist) f0-0) @@ -718,7 +708,7 @@ (none) ) -(defmethod do-integration ropebridge ((this ropebridge)) +(defmethod do-integration ((this ropebridge)) (local-vars (a2-1 float) (a3-0 float)) (rlet ((Q :class vf) (vf0 :class vf) @@ -841,7 +831,7 @@ ) ) -(defmethod debug-draw ropebridge ((this ropebridge)) +(defmethod debug-draw ((this ropebridge)) (let ((gp-0 (-> this node-list data 0 bone transform)) (s5-0 (the-as ropebridge-spring-point (-> this spring-point))) (s4-0 (new 'stack-no-clear 'vector)) @@ -855,7 +845,7 @@ (none) ) -(defmethod set-to-rest-state ropebridge ((this ropebridge)) +(defmethod set-to-rest-state ((this ropebridge)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -940,8 +930,8 @@ (none) ) -(defmethod add-collision-meshes ropebridge ((this ropebridge)) - (let* ((s5-0 (-> this root-override)) +(defmethod add-collision-meshes ((this ropebridge)) + (let* ((s5-0 (-> this root)) (s3-0 (-> this tuning)) (s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint (-> s3-0 num-springs)) 0)) ) @@ -970,22 +960,22 @@ (none) ) -(defmethod run-logic? ropebridge ((this ropebridge)) +(defmethod run-logic? ((this ropebridge)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (not (time-elapsed? (-> this agitated-time-stamp) (seconds 5))) - (or (>= (-> this sleep-dist) (vector-vector-distance (-> this root-override trans) (math-camera-pos))) + (or (>= (-> this sleep-dist) (vector-vector-distance (-> this root trans) (math-camera-pos))) (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) -(defmethod ropebridge-method-28 ropebridge ((this ropebridge)) +(defmethod ropebridge-method-28 ((this ropebridge)) 0 (none) ) -(defmethod init-from-entity! ropebridge ((this ropebridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ropebridge) (arg0 entity-actor)) (let ((s4-0 (res-lump-struct (-> this entity) 'art-name structure))) (if (not s4-0) (set! s4-0 "ropebridge-32") @@ -1027,7 +1017,7 @@ (set-vector! (-> this extra-trans) 0.0 0.0 (- (* 0.5 (-> this tuning bridge-end-to-end-len))) 1.0) (set! (-> this do-physics?) #t) (let ((a0-13 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) - (set! (-> this root-override) a0-13) + (set! (-> this root) a0-13) (alloc-riders a0-13 3) ) (add-collision-meshes this) @@ -1044,7 +1034,7 @@ (set! (-> this skel postbind-function) ropebridge-joint-callback) (matrix<-transformq+trans! (-> this world-matrix) - (the-as transformq (-> this root-override trans)) + (the-as transformq (-> this root trans)) (-> this extra-trans) ) (matrix-4x4-inverse! (-> this inv-world-matrix) (-> this world-matrix)) diff --git a/goal_src/jak1/engine/common-obs/sharkey.gc b/goal_src/jak1/engine/common-obs/sharkey.gc index d703c928b33..4cc4a83ec2b 100644 --- a/goal_src/jak1/engine/common-obs/sharkey.gc +++ b/goal_src/jak1/engine/common-obs/sharkey.gc @@ -33,26 +33,22 @@ ) (deftype sharkey (nav-enemy) - ((dir vector :inline :offset-assert 400) - (spawn-point vector :inline :offset-assert 416) - (scale float :offset-assert 432) - (anim-speed float :offset-assert 436) - (y-max meters :offset-assert 440) - (y-min meters :offset-assert 444) - (attack-time float :offset-assert 448) - (player-water-time time-frame :offset-assert 456) - (player-in-water basic :offset-assert 464) - (last-y float :offset-assert 468) - (spawn-distance meters :offset-assert 472) - (chase-speed meters :offset-assert 476) - (y-speed meters :offset-assert 480) - (sound-id sound-id :offset-assert 484) - (enable-patrol basic :offset-assert 488) + ((dir vector :inline) + (spawn-point vector :inline) + (scale float) + (anim-speed float) + (y-max meters) + (y-min meters) + (attack-time float) + (player-water-time time-frame) + (player-in-water basic) + (last-y float) + (spawn-distance meters) + (chase-speed meters) + (y-speed meters) + (sound-id sound-id) + (enable-patrol basic) ) - :heap-base #x180 - :method-count-assert 76 - :size-assert #x1ec - :flag-assert #x4c018001ec ) @@ -61,17 +57,17 @@ :bounds (static-spherem 0 0 0 6) ) -(defmethod touch-handler sharkey ((this sharkey) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this sharkey) (arg0 process) (arg1 event-message-block)) #t ) -(defmethod attack-handler sharkey ((this sharkey) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this sharkey) (arg0 process) (arg1 event-message-block)) #t ) nav-enemy-default-event-handler -(defmethod run-logic? sharkey ((this sharkey)) +(defmethod run-logic? ((this sharkey)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> this collide-info pause-adjust-distance)) (vector-vector-distance (-> this collide-info trans) (math-camera-pos)) @@ -82,7 +78,7 @@ nav-enemy-default-event-handler ) ) -(defmethod nav-enemy-method-40 sharkey ((this sharkey)) +(defmethod nav-enemy-method-40 ((this sharkey)) (nav-control-method-11 (-> this nav) (-> this nav target-pos)) (let* ((f0-0 (vector-vector-xz-distance (-> this collide-info trans) (-> this nav target-pos))) (f30-0 (/ (- (fmin (-> this y-max) (-> this nav target-pos y)) (-> this collide-info trans y)) f0-0)) @@ -93,7 +89,7 @@ nav-enemy-default-event-handler (none) ) -(defmethod nav-enemy-method-37 sharkey ((this sharkey)) +(defmethod nav-enemy-method-37 ((this sharkey)) (let ((s5-0 (new 'stack-no-clear 'vector))) (when (< 8192.0 (vector-length (-> this nav travel))) (vector-normalize-copy! s5-0 (-> this nav travel) 1.0) @@ -106,7 +102,7 @@ nav-enemy-default-event-handler (none) ) -(defmethod nav-enemy-method-41 sharkey ((this sharkey)) +(defmethod nav-enemy-method-41 ((this sharkey)) (let* ((f0-1 (- (-> this target-speed) (-> this momentum-speed))) (f1-3 (fmin (* (-> this acceleration) (seconds-per-frame)) (fabs f0-1))) ) @@ -127,7 +123,7 @@ nav-enemy-default-event-handler (none) ) -(defmethod common-post sharkey ((this sharkey)) +(defmethod common-post ((this sharkey)) (let ((f30-0 (-> this water height)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -600,7 +596,7 @@ nav-enemy-default-event-handler ) ) -(defmethod init-from-entity! sharkey ((this sharkey) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sharkey) (arg0 entity-actor)) (set! (-> this scale) (res-lump-float arg0 'scale :default 1.0)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) diff --git a/goal_src/jak1/engine/common-obs/ticky.gc b/goal_src/jak1/engine/common-obs/ticky.gc index 6610b5ae363..ebe21566b5b 100644 --- a/goal_src/jak1/engine/common-obs/ticky.gc +++ b/goal_src/jak1/engine/common-obs/ticky.gc @@ -8,23 +8,20 @@ ;; DECOMP BEGINS (deftype ticky (structure) - ((delay-til-ramp time-frame :offset-assert 0) - (delay-til-timeout time-frame :offset-assert 8) - (starting-time time-frame :offset-assert 16) - (last-tick-time time-frame :offset-assert 24) + ((delay-til-ramp time-frame) + (delay-til-timeout time-frame) + (starting-time time-frame) + (last-tick-time time-frame) ) - :method-count-assert 12 - :size-assert #x20 - :flag-assert #xc00000020 (:methods - (sleep (_type_ time-frame) none 9) - (reached-delay? (_type_ time-frame) symbol 10) - (completed? (_type_) symbol 11) + (sleep (_type_ time-frame) none) + (reached-delay? (_type_ time-frame) symbol) + (completed? (_type_) symbol) ) ) -(defmethod sleep ticky ((this ticky) (arg0 time-frame)) +(defmethod sleep ((this ticky) (arg0 time-frame)) (set-time! (-> this starting-time)) (set! (-> this delay-til-timeout) arg0) (set! (-> this delay-til-ramp) (max 0 (+ arg0 (seconds -4)))) @@ -33,7 +30,7 @@ (none) ) -(defmethod completed? ticky ((this ticky)) +(defmethod completed? ((this ticky)) (let ((gp-0 #f)) (let ((v1-2 (- (current-time) (-> this starting-time)))) (cond @@ -60,6 +57,6 @@ ) ) -(defmethod reached-delay? ticky ((this ticky) (arg0 time-frame)) +(defmethod reached-delay? ((this ticky) (arg0 time-frame)) (time-elapsed? (-> this starting-time) arg0) ) diff --git a/goal_src/jak1/engine/common-obs/tippy.gc b/goal_src/jak1/engine/common-obs/tippy.gc index 3ed26297b59..6d926cd621d 100644 --- a/goal_src/jak1/engine/common-obs/tippy.gc +++ b/goal_src/jak1/engine/common-obs/tippy.gc @@ -8,24 +8,21 @@ ;; DECOMP BEGINS (deftype tippy (structure) - ((axis vector :inline :offset-assert 0) - (angle float :offset-assert 16) - (orig quaternion :inline :offset-assert 32) - (dist-ratio float :offset-assert 48) - (damping float :offset-assert 52) - (1-damping float :offset-assert 56) + ((axis vector :inline) + (angle float) + (orig quaternion :inline) + (dist-ratio float) + (damping float) + (1-damping float) ) - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (reset! (_type_ process-drawable float float) none 9) - (tippy-method-10 (_type_ process-drawable vector) symbol 10) + (reset! (_type_ process-drawable float float) none) + (tippy-method-10 (_type_ process-drawable vector) symbol) ) ) -(defmethod reset! tippy ((this tippy) (arg0 process-drawable) (arg1 float) (arg2 float)) +(defmethod reset! ((this tippy) (arg0 process-drawable) (arg1 float) (arg2 float)) (set-vector! (-> this axis) 0.0 0.0 0.0 1.0) (set! (-> this angle) 0.0) (quaternion-copy! (-> this orig) (-> arg0 root quat)) @@ -36,7 +33,7 @@ (none) ) -(defmethod tippy-method-10 tippy ((this tippy) (arg0 process-drawable) (arg1 vector)) +(defmethod tippy-method-10 ((this tippy) (arg0 process-drawable) (arg1 vector)) (let ((s4-0 #t)) (cond (arg1 diff --git a/goal_src/jak1/engine/common-obs/voicebox.gc b/goal_src/jak1/engine/common-obs/voicebox.gc index d0ba79978b7..c73ea89c2c8 100644 --- a/goal_src/jak1/engine/common-obs/voicebox.gc +++ b/goal_src/jak1/engine/common-obs/voicebox.gc @@ -9,10 +9,6 @@ (deftype camera-voicebox (camera-slave) () - :heap-base #x9a0 - :method-count-assert 14 - :size-assert #xa04 - :flag-assert #xe09a00a04 (:states cam-voicebox ) @@ -20,21 +16,17 @@ (deftype voicebox (process-drawable) - ((parent-override (pointer camera-voicebox) :offset 12) - (base-trans vector :inline :offset-assert 176) - (seeker cam-float-seeker :inline :offset-assert 192) - (blend float :offset-assert 216) - (twist float :offset-assert 220) - (hint handle :offset-assert 224) + ((parent-override (pointer camera-voicebox) :overlay-at parent) + (base-trans vector :inline) + (seeker cam-float-seeker :inline) + (blend float) + (twist float) + (hint handle) ) - :heap-base #x80 - :method-count-assert 23 - :size-assert #xe8 - :flag-assert #x17008000e8 - (:methods - (enter () _type_ :state 20) - (idle () _type_ :state 21) - (exit () _type_ :state 22) + (:state-methods + enter + idle + exit ) ) diff --git a/goal_src/jak1/engine/common-obs/water-anim.gc b/goal_src/jak1/engine/common-obs/water-anim.gc index 19d8a0e3b25..bc2b494273f 100644 --- a/goal_src/jak1/engine/common-obs/water-anim.gc +++ b/goal_src/jak1/engine/common-obs/water-anim.gc @@ -8,14 +8,10 @@ ;; DECOMP BEGINS (deftype water-anim (water-vol) - ((ppointer-water-anim (pointer water-anim) :offset 24) - (look int32 :offset-assert 212) - (play-ambient-sound? symbol :offset-assert 216) + ((ppointer-water-anim (pointer water-anim) :overlay-at ppointer) + (look int32) + (play-ambient-sound? symbol) ) - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) @@ -260,13 +256,10 @@ ) (deftype water-anim-look (structure) - ((skel-group symbol :offset-assert 0) - (anim int32 :offset-assert 4) - (ambient-sound-spec sound-spec :offset-assert 8) + ((skel-group symbol) + (anim int32) + (ambient-sound-spec sound-spec) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -511,15 +504,15 @@ ) ) -(defmethod get-ripple-height water-anim ((this water-anim) (arg0 vector)) +(defmethod get-ripple-height ((this water-anim) (arg0 vector)) (ripple-find-height this 0 arg0) ) -(defmethod set-stack-size! water-anim ((this water-anim)) +(defmethod set-stack-size! ((this water-anim)) (none) ) -(defmethod water-vol-method-25 water-anim ((this water-anim)) +(defmethod water-vol-method-25 ((this water-anim)) (local-vars (sv-16 res-tag)) (set! (-> this play-ambient-sound?) #t) (set! (-> this look) (res-lump-value (-> this entity) 'look int :default (the-as uint128 -1))) @@ -539,7 +532,7 @@ (none) ) -(defmethod water-vol-method-22 water-anim ((this water-anim)) +(defmethod water-vol-method-22 ((this water-anim)) (let ((s5-0 (-> this look))) (if (or (< s5-0 0) (>= s5-0 (-> *water-anim-look* length))) (go process-drawable-art-error "skel group") diff --git a/goal_src/jak1/engine/common-obs/water-h.gc b/goal_src/jak1/engine/common-obs/water-h.gc index d7be1b5077e..5de090a3eb7 100644 --- a/goal_src/jak1/engine/common-obs/water-h.gc +++ b/goal_src/jak1/engine/common-obs/water-h.gc @@ -45,59 +45,56 @@ ;; DECOMP BEGINS (deftype water-control (basic) - ((flags water-flags :offset-assert 4) - (process process-drawable :offset-assert 8) - (joint-index int32 :offset-assert 12) - (top-y-offset float :offset-assert 16) - (ripple-size meters :offset-assert 20) - (enter-water-time time-frame :offset-assert 24) - (wade-time time-frame :offset-assert 32) - (on-water-time time-frame :offset-assert 40) - (enter-swim-time time-frame :offset-assert 48) - (swim-time time-frame :offset-assert 56) - (base-height meters :offset-assert 64) - (wade-height meters :offset-assert 68) - (swim-height meters :offset-assert 72) - (surface-height meters :offset-assert 76) - (bottom-height meters :offset-assert 80) - (height meters :offset-assert 84) - (height-offset float 4 :offset-assert 88) - (real-ocean-offset meters :offset 88) - (ocean-offset meters :offset 92) - (bob-offset meters :offset 96) - (align-offset meters :offset 100) - (swim-depth meters :offset-assert 104) - (bob smush-control :inline :offset-assert 112) - (volume handle :offset-assert 144) - (bottom vector 2 :inline :offset-assert 160) - (top vector 2 :inline :offset-assert 192) - (enter-water-pos vector :inline :offset-assert 224) - (drip-old-pos vector :inline :offset-assert 240) - (drip-joint-index int32 :offset-assert 256) - (drip-wetness float :offset-assert 260) - (drip-time time-frame :offset-assert 264) - (drip-speed float :offset-assert 272) - (drip-height meters :offset-assert 276) - (drip-mult float :offset-assert 280) + ((flags water-flags) + (process process-drawable) + (joint-index int32) + (top-y-offset float) + (ripple-size meters) + (enter-water-time time-frame) + (wade-time time-frame) + (on-water-time time-frame) + (enter-swim-time time-frame) + (swim-time time-frame) + (base-height meters) + (wade-height meters) + (swim-height meters) + (surface-height meters) + (bottom-height meters) + (height meters) + (height-offset float 4) + (real-ocean-offset meters :overlay-at (-> height-offset 0)) + (ocean-offset meters :overlay-at (-> height-offset 1)) + (bob-offset meters :overlay-at (-> height-offset 2)) + (align-offset meters :overlay-at (-> height-offset 3)) + (swim-depth meters) + (bob smush-control :inline) + (volume handle) + (bottom vector 2 :inline) + (top vector 2 :inline) + (enter-water-pos vector :inline) + (drip-old-pos vector :inline) + (drip-joint-index int32) + (drip-wetness float) + (drip-time time-frame) + (drip-speed float) + (drip-height meters) + (drip-mult float) ) - :method-count-assert 17 - :size-assert #x11c - :flag-assert #x110000011c (:methods - (new (symbol type process int float float float) _type_ 0) - (water-control-method-9 (_type_) none 9) - (water-control-method-10 (_type_) none 10) - (start-bobbing! (_type_ float int int) none 11) - (distance-from-surface (_type_) float 12) - (create-splash (_type_ float vector int vector) none 13) - (display-water-marks? (_type_) symbol 14) - (water-control-method-15 (_type_) none 15) - (water-control-method-16 (_type_) none 16) + (new (symbol type process int float float float) _type_) + (water-control-method-9 (_type_) none) + (water-control-method-10 (_type_) none) + (start-bobbing! (_type_ float int int) none) + (distance-from-surface (_type_) float) + (create-splash (_type_ float vector int vector) none) + (display-water-marks? (_type_) symbol) + (water-control-method-15 (_type_) none) + (water-control-method-16 (_type_) none) ) ) -(defmethod display-water-marks? water-control ((this water-control)) +(defmethod display-water-marks? ((this water-control)) (and *display-water-marks* (logtest? (-> this flags) (water-flags wt00))) ) @@ -116,33 +113,31 @@ ) ) -(defmethod distance-from-surface water-control ((this water-control)) +(defmethod distance-from-surface ((this water-control)) (- (-> this top 0 y) (-> this height)) ) (deftype water-vol (process-drawable) - ((water-height meters :offset-assert 176) - (wade-height meters :offset-assert 180) - (swim-height meters :offset-assert 184) - (bottom-height meters :offset-assert 188) - (attack-event symbol :offset-assert 192) - (target handle :offset-assert 200) - (flags water-flags :offset-assert 208) + ((water-height meters) + (wade-height meters) + (swim-height meters) + (bottom-height meters) + (attack-event symbol) + (target handle) + (flags water-flags) ) - :heap-base #x70 - :method-count-assert 30 - :size-assert #xd4 - :flag-assert #x1e007000d4 + (:state-methods + water-vol-idle + water-vol-startup + ) (:methods - (water-vol-idle () _type_ :state 20) - (water-vol-startup () _type_ :state 21) - (water-vol-method-22 (_type_) none 22) - (reset-root! (_type_) none 23) - (set-stack-size! (_type_) none 24) - (water-vol-method-25 (_type_) none 25) - (update! (_type_) none 26) - (on-exit-water (_type_) none 27) - (get-ripple-height (_type_ vector) float 28) - (init! (_type_) none 29) + (water-vol-method-22 (_type_) none) + (reset-root! (_type_) none) + (set-stack-size! (_type_) none) + (water-vol-method-25 (_type_) none) + (update! (_type_) none) + (on-exit-water (_type_) none) + (get-ripple-height (_type_ vector) float) + (init! (_type_) none) ) ) diff --git a/goal_src/jak1/engine/common-obs/water.gc b/goal_src/jak1/engine/common-obs/water.gc index 5744ef54ba1..ac34e4a7b83 100644 --- a/goal_src/jak1/engine/common-obs/water.gc +++ b/goal_src/jak1/engine/common-obs/water.gc @@ -616,12 +616,12 @@ ) ) -(defmethod water-control-method-9 water-control ((this water-control)) +(defmethod water-control-method-9 ((this water-control)) 0 (none) ) -(defmethod water-control-method-10 water-control ((this water-control)) +(defmethod water-control-method-10 ((this water-control)) (with-pp (let ((s5-0 (-> this flags))) (cond @@ -967,7 +967,7 @@ ) ) -(defmethod start-bobbing! water-control ((this water-control) (arg0 float) (arg1 int) (arg2 int)) +(defmethod start-bobbing! ((this water-control) (arg0 float) (arg1 int) (arg2 int)) (activate! (-> this bob) (- arg0) arg1 arg2 0.9 1.0) 0 (none) @@ -1064,7 +1064,7 @@ (none) ) -(defmethod water-control-method-15 water-control ((this water-control)) +(defmethod water-control-method-15 ((this water-control)) (with-pp (logior! (-> this flags) (water-flags wt09)) (logclear! (-> this flags) (water-flags wt16)) @@ -1094,7 +1094,7 @@ ) ) -(defmethod water-control-method-16 water-control ((this water-control)) +(defmethod water-control-method-16 ((this water-control)) (logclear! (-> this flags) (water-flags wt09)) (set-zero! (-> this bob)) (if (logtest? (water-flags wt17) (-> this flags)) @@ -1123,7 +1123,7 @@ (none) ) -(defmethod create-splash water-control ((this water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector)) +(defmethod create-splash ((this water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector)) (when (and (logtest? (-> this flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> this flags))) (let ((a1-3 (vector+float*! (new 'stack-no-clear 'vector) arg1 arg3 0.05))) (set! (-> a1-3 y) (-> this surface-height)) @@ -1134,7 +1134,7 @@ (none) ) -(defmethod on-exit-water water-vol ((this water-vol)) +(defmethod on-exit-water ((this water-vol)) (when (handle->process (-> this target)) (let ((v1-7 (-> (the-as target (-> this target process 0)) water))) (logclear! (-> v1-7 flags) (water-flags wt01 wt02 wt03 wt08 wt17 wt18 wt19 wt20 wt21 wt23 wt24 wt25 wt26)) @@ -1157,7 +1157,7 @@ (none) ) -(defmethod update! water-vol ((this water-vol)) +(defmethod update! ((this water-vol)) (cond ((handle->process (-> this target)) (cond @@ -1248,22 +1248,22 @@ :code anim-loop ) -(defmethod set-stack-size! water-vol ((this water-vol)) +(defmethod set-stack-size! ((this water-vol)) (stack-size-set! (-> this main-thread) 128) (none) ) -(defmethod reset-root! water-vol ((this water-vol)) +(defmethod reset-root! ((this water-vol)) (set! (-> this root) (new 'process 'trsqv)) (none) ) -(defmethod water-vol-method-25 water-vol ((this water-vol)) +(defmethod water-vol-method-25 ((this water-vol)) 0 (none) ) -(defmethod init! water-vol ((this water-vol)) +(defmethod init! ((this water-vol)) (local-vars (sv-16 res-tag)) (set! (-> this attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) (-> this entity) @@ -1323,7 +1323,7 @@ (none) ) -(defmethod water-vol-method-22 water-vol ((this water-vol)) +(defmethod water-vol-method-22 ((this water-vol)) 0 (none) ) @@ -1339,7 +1339,7 @@ (none) ) -(defmethod init-from-entity! water-vol ((this water-vol) (arg0 entity-actor)) +(defmethod init-from-entity! ((this water-vol) (arg0 entity-actor)) (set-stack-size! this) (reset-root! this) (init! this) diff --git a/goal_src/jak1/engine/data/art-h.gc b/goal_src/jak1/engine/data/art-h.gc index 0740d70b839..bbfb096e4bb 100644 --- a/goal_src/jak1/engine/data/art-h.gc +++ b/goal_src/jak1/engine/data/art-h.gc @@ -14,129 +14,98 @@ ;; base type for all joint animations ;; note that this refers to an animation for a single joint. (deftype joint-anim (basic) - ((name string :offset-assert 4) - (number int16 :offset-assert 8) - (length int16 :offset-assert 10) + ((name string) + (number int16) + (length int16) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; unused? joint-anims (deftype joint-anim-matrix (joint-anim) - ((data matrix :inline :dynamic :offset 16) + ((data matrix :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype joint-anim-transformq (joint-anim) - ((data transformq :inline :dynamic :offset 16) + ((data transformq :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype joint-anim-drawable (joint-anim) - ((data drawable :dynamic :offset-assert 12) ;; guess + ((data drawable :dynamic) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; joint-anim-compressed is the only type of joint-anim actually used. ;; the actual data isn't in here, this is just some metadata ;; again, this refers to a single joint (deftype joint-anim-compressed (joint-anim) - ((data uint32 :dynamic :offset-assert 12) ;; seems to always just be 1 zero. + ((data uint32 :dynamic) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; a single "frame" in an animation, consists of matrices for each joint. ;; unlike the previous types, this is for all of the joints involved in an animation. (deftype joint-anim-frame (structure) - ((matrices matrix 2 :inline :offset-assert 0) ;; everybody has at least 2 matrices - (data matrix :inline :dynamic :offset-assert 128) ;; rest are dynamically sized. + ((matrices matrix 2 :inline) + (data matrix :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) + (defmethod new joint-anim-frame ((allocation symbol) (type-to-make type) (arg0 int)) "Create a new joint-anim-frame with enough room for arg0 matrices" (let ((v1-1 (max 0 (+ arg0 -2)))) - (the-as joint-anim-frame - (new-dynamic-structure - allocation - type-to-make - (the-as int (+ (-> type-to-make size) (the-as uint (* 48 v1-1))))) - ) + (the-as + joint-anim-frame + (new-dynamic-structure allocation type-to-make (the-as int (+ (-> type-to-make size) (* 48 v1-1)))) + ) ) ) ;; compression header - has info used by decompression algorithm (deftype joint-anim-compressed-hdr (structure) - ((control-bits uint32 14 :offset-assert 0) - (num-joints uint32 :offset-assert 56) - (matrix-bits uint32 :offset-assert 60) + ((control-bits uint32 14) + (num-joints uint32) + (matrix-bits uint32) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; this has the data needed to initialize the decompressor - I believe this ;; contains the starting poisition of the joints. (deftype joint-anim-compressed-fixed (structure) - ((hdr joint-anim-compressed-hdr :inline :offset-assert 0) - (offset-64 uint32 :offset-assert 64) - (offset-32 uint32 :offset-assert 68) - (offset-16 uint32 :offset-assert 72) - (reserved uint32 :offset-assert 76) - (data vector 133 :inline :offset-assert 80) ;; length here can be shorter! + ((hdr joint-anim-compressed-hdr :inline) + (offset-64 uint32) + (offset-32 uint32) + (offset-16 uint32) + (reserved uint32) + (data vector 133 :inline) ) - :method-count-assert 9 - :size-assert #x8a0 - :flag-assert #x9000008a0 ) ;; these are the actual compressed data frames. ;; dynamically sized, depends on the number of joints and the decompression. (deftype joint-anim-compressed-frame (structure) - ((offset-64 uint32 :offset-assert 0) - (offset-32 uint32 :offset-assert 4) - (offset-16 uint32 :offset-assert 8) - (reserved uint32 :offset-assert 12) - (data vector 133 :inline :offset-assert 16) ;; guess + ((offset-64 uint32) + (offset-32 uint32) + (offset-16 uint32) + (reserved uint32) + (data vector 133 :inline) ) - :method-count-assert 9 - :size-assert #x860 - :flag-assert #x900000860 ) ;; table of frames (deftype joint-anim-compressed-control (structure) - ((num-frames uint32 :offset-assert 0) - (fixed-qwc uint32 :offset-assert 4) - (frame-qwc uint32 :offset-assert 8) - (fixed joint-anim-compressed-fixed :offset-assert 12) - (data joint-anim-compressed-frame 1 :offset-assert 16) ;; guess + ((num-frames uint32) + (fixed-qwc uint32) + (frame-qwc uint32) + (fixed joint-anim-compressed-fixed) + (data joint-anim-compressed-frame 1) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -147,118 +116,88 @@ ;; it can be either a container of arts (art-group) or a single art (art-element) (declare-type res-lump basic) (deftype art (basic) - ((name string :offset 8) - (length int32 :offset-assert 12) - (extra res-lump :offset-assert 16) + ((name string :offset 8) + (length int32) + (extra res-lump) ) - :method-count-assert 13 - :size-assert #x14 - :flag-assert #xd00000014 (:methods - (login (_type_) _type_ 9) - (lookup-art (_type_ string type) joint 10) ;; art or joint. - (lookup-idx-of-art (_type_ string type) int 11) - (needs-link? (_type_) symbol 12) + (login (_type_) _type_) + (lookup-art (_type_ string type) joint) + (lookup-idx-of-art (_type_ string type) int) + (needs-link? (_type_) symbol) ) ) ;; parent class of all single art things. (deftype art-element (art) - ((pad uint8 12)) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 + ((pad uint8 12) + ) ) ;; unused. all animations use joints/skeletons. (deftype art-mesh-anim (art-element) - ((data basic :dynamic :offset-assert 32)) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 + ((data basic :dynamic) + ) ) ;; joint animation. (declare-type merc-eye-anim-block structure) (deftype art-joint-anim (art-element) - ;; figured out manually from custom inspect. - ((eye-anim-data merc-eye-anim-block :offset 4) ;; guessed on the name here, it's not in the inspect. - (speed float :offset 20) - (artist-base float :offset 24) - (artist-step float :offset 28) - (master-art-group-name string :offset 32) - (master-art-group-index int32 :offset 36) - - ;; facial animation - (blerc-data (pointer uint8) :offset 40) ;; todo, this is probably something else - - ;; compressed animation data - (frames joint-anim-compressed-control :offset 44) - - ;; per-joint info for each joint in the animation. - (data joint-anim-compressed :dynamic) + ((eye-anim-data merc-eye-anim-block :offset 4) + (speed float :overlay-at (-> pad 0)) + (artist-base float :overlay-at (-> pad 4)) + (artist-step float :overlay-at (-> pad 8)) + (master-art-group-name string :offset 32) + (master-art-group-index int32 :offset 36) + (blerc-data (pointer uint8) :offset 40) + (frames joint-anim-compressed-control :offset 44) + (data joint-anim-compressed :dynamic) ) - :method-count-assert 13 - :size-assert #x30 - :flag-assert #xd00000030 ) ;; a collection of arts. ;; this is often stored as a -ag file in static level data. (deftype art-group (art) - ((info file-info :offset 4) - (data art-element :dynamic :offset 32) + ((info file-info :offset 4) + (data art-element :dynamic :offset 32) ) - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 (:methods - ;; linker will call this one when it's loaded - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (link-art! (_type_) art-group 13) - (unlink-art! (_type_) int 14) + (relocate (_type_ kheap (pointer uint8)) none :replace) + (link-art! (_type_) art-group) + (unlink-art! (_type_) int) ) ) ;; unused (deftype art-mesh-geo (art-element) - ((data basic :dynamic :offset-assert 32) + ((data basic :dynamic) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) ;; unused (deftype art-joint-geo (art-element) - ((data joint :dynamic :offset-assert 32) + ((data joint :dynamic) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) ;; the "skeleton group" is defined in code and tells the engine ;; how to actually use the art from the level data for this object. (deftype skeleton-group (basic) - ((art-group-name string :offset-assert 4) - (jgeo int32 :offset-assert 8) - (janim int32 :offset-assert 12) - (bounds vector :inline :offset-assert 16) - (radius meters :offset 28) - (mgeo int16 4 :offset-assert 32) - (max-lod int32 :offset-assert 40) - (lod-dist float 4 :offset-assert 44) - (longest-edge meters :offset-assert 60) - (texture-level int8 :offset-assert 64) - (version int8 :offset-assert 65) - (shadow int8 :offset-assert 66) - (sort int8 :offset-assert 67) - (_pad uint8 4 :offset-assert 68) + ((art-group-name string) + (jgeo int32) + (janim int32) + (bounds vector :inline) + (radius meters :overlay-at (-> bounds w)) + (mgeo int16 4) + (max-lod int32) + (lod-dist float 4) + (longest-edge meters) + (texture-level int8) + (version int8) + (shadow int8) + (sort int8) + (_pad uint8 4) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -271,27 +210,21 @@ ;; a merc level of detail (deftype lod-group (structure) - ((geo merc-ctrl :offset-assert 0) ;; the actual geometry to draw - (dist meters :offset-assert 4) ;; the distance from camera for this lod + ((geo merc-ctrl) + (dist meters) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the 4 levels of detail. the max-lod is the index of the highest lod that's actually used. ;; it is the lowest detail. (deftype lod-set (structure) - ((lod lod-group 4 :inline :offset-assert 0) - (max-lod int8 :offset-assert 32) + ((lod lod-group 4 :inline) + (max-lod int8) ) :pack-me - :method-count-assert 10 - :size-assert #x21 - :flag-assert #xa00000021 (:methods - (setup-lods! (_type_ skeleton-group art-group entity) _type_ 9) + (setup-lods! (_type_ skeleton-group art-group entity) _type_) ) ) @@ -330,59 +263,56 @@ ;; the actual draw-control - this is just a collection of references to all info ;; needed to do drawing. (deftype draw-control (basic) - ((status draw-status :offset-assert 4) - (matrix-type uint8 :offset-assert 5) - (data-format uint8 :offset-assert 6) - (global-effect draw-effect :offset-assert 7) - (art-group art-group :offset-assert 8) - (jgeo art-joint-geo :offset-assert 12) - (mgeo merc-ctrl :offset-assert 16) - (dma-add-func (function process-drawable draw-control symbol object none) :offset-assert 20) - (skeleton skeleton :offset-assert 24) ;; or cspace-array or shadow-control - (lod-set lod-set :inline :offset-assert 28) - (lod lod-group 4 :inline :offset 28) - (max-lod int8 :offset 60) - (force-lod int8 :offset-assert 61) - (cur-lod int8 :offset-assert 62) - (desired-lod int8 :offset-assert 63) - (ripple ripple-control :offset-assert 64) - (longest-edge meters :offset-assert 68) - (longest-edge? uint32 :offset 68) - (light-index uint8 :offset-assert 72) - (dummy uint8 2 :offset-assert 73) - (death-draw-overlap uint8 :offset-assert 75) - (death-timer uint8 :offset-assert 76) - (death-timer-org uint8 :offset-assert 77) - (death-vertex-skip uint16 :offset-assert 78) - (death-effect uint32 :offset-assert 80) - (sink-group dma-foreground-sink-group :offset-assert 84) ;; dma-foreground-sink-group? - (process process :offset-assert 88) - (shadow shadow-geo :offset-assert 92) - (shadow-ctrl shadow-control :offset-assert 96) - (origin vector :inline :offset-assert 112) - (bounds vector :inline :offset-assert 128) - (radius meters :offset 140) - (color-mult rgbaf :inline :offset-assert 144) - (color-emissive rgbaf :inline :offset-assert 160) - (secondary-interp float :offset-assert 176) - (current-secondary-interp float :offset-assert 180) - (shadow-mask uint8 :offset-assert 184) - (level-index uint8 :offset-assert 185) - (origin-joint-index uint8 :offset-assert 186) - (shadow-joint-index uint8 :offset-assert 187) + ((status draw-status) + (matrix-type uint8) + (data-format uint8) + (global-effect draw-effect) + (art-group art-group) + (jgeo art-joint-geo) + (mgeo merc-ctrl) + (dma-add-func (function process-drawable draw-control symbol object none)) + (skeleton skeleton) + (lod-set lod-set :inline) + (lod lod-group 4 :inline :overlay-at (-> lod-set lod 0)) + (max-lod int8 :overlay-at (-> lod-set max-lod)) + (force-lod int8) + (cur-lod int8) + (desired-lod int8) + (ripple ripple-control) + (longest-edge meters) + (longest-edge? uint32 :overlay-at longest-edge) + (light-index uint8) + (dummy uint8 2) + (death-draw-overlap uint8) + (death-timer uint8) + (death-timer-org uint8) + (death-vertex-skip uint16) + (death-effect uint32) + (sink-group dma-foreground-sink-group) + (process process) + (shadow shadow-geo) + (shadow-ctrl shadow-control) + (origin vector :inline) + (bounds vector :inline) + (radius meters :overlay-at (-> bounds w)) + (color-mult rgbaf :inline) + (color-emissive rgbaf :inline) + (secondary-interp float) + (current-secondary-interp float) + (shadow-mask uint8) + (level-index uint8) + (origin-joint-index uint8) + (shadow-joint-index uint8) ) - :method-count-assert 12 - :size-assert #xbc - :flag-assert #xc000000bc (:methods - (new (symbol type process art-joint-geo) _type_ 0) - (get-skeleton-origin (_type_) vector 9) - (lod-set! (_type_ int) none 10) - (lods-assign! (_type_ lod-set) none 11) + (new (symbol type process art-joint-geo) _type_) + (get-skeleton-origin (_type_) vector) + (lod-set! (_type_ int) none) + (lods-assign! (_type_ lod-set) none) ) ) -(defmethod get-skeleton-origin draw-control ((this draw-control)) +(defmethod get-skeleton-origin ((this draw-control)) "Get the origin of the skeleton. Must have up-to-date bones." (-> this skeleton bones 0 position) ) diff --git a/goal_src/jak1/engine/debug/anim-tester.gc b/goal_src/jak1/engine/debug/anim-tester.gc index f6b96768f06..8efe7761daf 100644 --- a/goal_src/jak1/engine/debug/anim-tester.gc +++ b/goal_src/jak1/engine/debug/anim-tester.gc @@ -33,61 +33,52 @@ (declare-file (debug)) (deftype list-control (structure) - ((listfunc (function int list-control symbol) :offset-assert 0) - (list-owner uint32 :offset-assert 4) - (top int32 :offset-assert 8) - (left int32 :offset-assert 12) - (list glst-list :offset-assert 16) - (the-node glst-node :offset-assert 20) - (top-index int32 :offset-assert 24) - (the-index int32 :offset-assert 28) - (the-disp-line int32 :offset-assert 32) - (highlight-index int32 :offset-assert 36) - (current-index int32 :offset-assert 40) - (numlines int32 :offset-assert 44) - (lines-to-disp int32 :offset-assert 48) - (charswide int32 :offset-assert 52) - (highlight-disp-line int32 :offset-assert 56) - (field-id int32 :offset-assert 60) - (xpos int32 :offset-assert 64) - (ypos int32 :offset-assert 68) - (user-info int32 :offset-assert 72) - (user-info-u uint32 :offset 72) - (return-int int32 :offset-assert 76) + ((listfunc (function int list-control symbol)) + (list-owner uint32) + (top int32) + (left int32) + (list glst-list) + (the-node glst-node) + (top-index int32) + (the-index int32) + (the-disp-line int32) + (highlight-index int32) + (current-index int32) + (numlines int32) + (lines-to-disp int32) + (charswide int32) + (highlight-disp-line int32) + (field-id int32) + (xpos int32) + (ypos int32) + (user-info int32) + (user-info-u uint32 :overlay-at user-info) + (return-int int32) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype list-field (structure) - ((left int32 :offset-assert 0) - (width int32 :offset-assert 4) + ((left int32) + (width int32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype DISP_LIST-bank (basic) - ((TV_SPACING int32 :offset-assert 4) - (BORDER_WIDTH int32 :offset-assert 8) - (BORDER_HEIGHT int32 :offset-assert 12) - (MAX_LINES int32 :offset-assert 16) - (CHAR_WIDTH int32 :offset-assert 20) - (INC_DELAY int32 :offset-assert 24) - (BORDER_LINES int32 :offset-assert 28) - (CXOFF int32 :offset-assert 32) - (CYOFF int32 :offset-assert 36) - (BXOFF int32 :offset-assert 40) - (BYOFF int32 :offset-assert 44) + ((TV_SPACING int32) + (BORDER_WIDTH int32) + (BORDER_HEIGHT int32) + (MAX_LINES int32) + (CHAR_WIDTH int32) + (INC_DELAY int32) + (BORDER_LINES int32) + (CXOFF int32) + (CYOFF int32) + (BXOFF int32) + (BYOFF int32) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) @@ -357,26 +348,23 @@ ) (deftype anim-tester-bank (basic) - ((ANIM_SPEED float :offset-assert 4) - (BLEND float :offset-assert 8) - (OBJECT_LIST_X int32 :offset-assert 12) - (OBJECT_LIST_Y int32 :offset-assert 16) - (OBJECT_LIST_MIN_WIDTH int32 :offset-assert 20) - (ANIM_LIST_X int32 :offset-assert 24) - (ANIM_LIST_Y int32 :offset-assert 28) - (ANIM_LIST_MIN_WIDTH int32 :offset-assert 32) - (PICK_LIST_X int32 :offset-assert 36) - (PICK_LIST_Y int32 :offset-assert 40) - (PICK_LIST_MIN_WIDTH int32 :offset-assert 44) - (EDIT_LIST_X int32 :offset-assert 48) - (EDIT_LIST_Y int32 :offset-assert 52) - (EDIT_STATS_X int32 :offset-assert 56) - (EDIT_LIST_MIN_WIDTH int32 :offset-assert 60) - (EDIT_PICK_X int32 :offset-assert 64) + ((ANIM_SPEED float) + (BLEND float) + (OBJECT_LIST_X int32) + (OBJECT_LIST_Y int32) + (OBJECT_LIST_MIN_WIDTH int32) + (ANIM_LIST_X int32) + (ANIM_LIST_Y int32) + (ANIM_LIST_MIN_WIDTH int32) + (PICK_LIST_X int32) + (PICK_LIST_Y int32) + (PICK_LIST_MIN_WIDTH int32) + (EDIT_LIST_X int32) + (EDIT_LIST_Y int32) + (EDIT_STATS_X int32) + (EDIT_LIST_MIN_WIDTH int32) + (EDIT_PICK_X int32) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) @@ -401,26 +389,22 @@ ) (deftype anim-tester (process-drawable) - ((flags anim-tester-flags :offset-assert 176) - (obj-list glst-list :inline :offset-assert 180) - (current-obj string :offset-assert 196) - (speed int32 :offset-assert 200) - (list-con list-control :inline :offset-assert 204) - (pick-con list-control :inline :offset-assert 284) - (item-field int64 :offset-assert 368) - (inc-delay int32 :offset-assert 376) - (inc-timer int32 :offset-assert 380) - (edit-mode int32 :offset-assert 384) - (old-mode int32 :offset-assert 388) - (anim-speed float :offset-assert 392) - (anim-gspeed float :offset-assert 396) - (anim-first float :offset-assert 400) - (anim-last float :offset-assert 404) + ((flags anim-tester-flags) + (obj-list glst-list :inline) + (current-obj string) + (speed int32) + (list-con list-control :inline) + (pick-con list-control :inline) + (item-field int64) + (inc-delay int32) + (inc-timer int32) + (edit-mode int32) + (old-mode int32) + (anim-speed float) + (anim-gspeed float) + (anim-first float) + (anim-last float) ) - :heap-base #x130 - :method-count-assert 20 - :size-assert #x198 - :flag-assert #x1401300198 (:states anim-tester-process ) @@ -445,23 +429,20 @@ (define-perm *anim-tester* (pointer anim-tester) #f) (deftype anim-test-obj (glst-named-node) - ((obj-art-group art-group :offset-assert 12) - (seq-list glst-list :inline :offset-assert 16) - (flags int32 :offset-assert 32) - (mesh-geo merc-ctrl :offset-assert 36) - (joint-geo art-joint-geo :offset-assert 40) - (list-con list-control :inline :offset-assert 44) - (parent uint32 :offset-assert 124) - (anim-index int32 :offset-assert 128) - (anim-hindex int32 :offset-assert 132) - (seq-index int32 :offset-assert 136) - (seq-hindex int32 :offset-assert 140) + ((obj-art-group art-group) + (seq-list glst-list :inline) + (flags int32) + (mesh-geo merc-ctrl) + (joint-geo art-joint-geo) + (list-con list-control :inline) + (parent uint32) + (anim-index int32) + (anim-hindex int32) + (seq-index int32) + (seq-hindex int32) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 (:methods - (new (symbol type int string basic) _type_ 0) + (new (symbol type int string basic) _type_) ) ) @@ -499,17 +480,14 @@ ) (deftype anim-test-sequence (glst-named-node) - ((item-list glst-list :inline :offset-assert 12) - (playing-item int32 :offset-assert 28) - (flags int32 :offset-assert 32) - (list-con list-control :inline :offset-assert 36) - (parent anim-test-obj :offset-assert 116) + ((item-list glst-list :inline) + (playing-item int32) + (flags int32) + (list-con list-control :inline) + (parent anim-test-obj) ) - :method-count-assert 9 - :size-assert #x78 - :flag-assert #x900000078 (:methods - (new (symbol type int string) _type_ 0) + (new (symbol type int string) _type_) ) ) @@ -538,20 +516,17 @@ ) (deftype anim-test-seq-item (glst-named-node) - ((speed int32 :offset-assert 12) - (blend int32 :offset-assert 16) - (first-frame float :offset-assert 20) - (last-frame float :offset-assert 24) - (num-frames float :offset-assert 28) - (artist-base float :offset-assert 32) - (flags int32 :offset-assert 36) - (parent anim-test-sequence :offset-assert 40) + ((speed int32) + (blend int32) + (first-frame float) + (last-frame float) + (num-frames float) + (artist-base float) + (flags int32) + (parent anim-test-sequence) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c (:methods - (new (symbol type int string) _type_ 0) + (new (symbol type int string) _type_) ) ) diff --git a/goal_src/jak1/engine/debug/assert-h.gc b/goal_src/jak1/engine/debug/assert-h.gc index 83a2a13c9b4..5c6caab7952 100644 --- a/goal_src/jak1/engine/debug/assert-h.gc +++ b/goal_src/jak1/engine/debug/assert-h.gc @@ -8,30 +8,27 @@ ;; DECOMP BEGINS (deftype __assert-info-private-struct (structure) - ((filename string :offset-assert 0) - (line-num uint16 :offset-assert 4) - (column-num uint16 :offset-assert 6) + ((filename string) + (line-num uint16) + (column-num uint16) ) - :method-count-assert 11 - :size-assert #x8 - :flag-assert #xb00000008 (:methods - (set-pos (_type_ string uint uint) int 9) - (print-pos (_type_) int 10) + (set-pos (_type_ string uint uint) int) + (print-pos (_type_) int) ) ) -(defmethod set-pos __assert-info-private-struct ((this __assert-info-private-struct) (filename string) (line-num uint) (column-num uint)) + +(defmethod set-pos ((this __assert-info-private-struct) (filename string) (line-num uint) (column-num uint)) (set! (-> this filename) filename) (set! (-> this line-num) line-num) (set! (-> this column-num) column-num) 0 ) -(defmethod print-pos __assert-info-private-struct ((this __assert-info-private-struct)) +(defmethod print-pos ((this __assert-info-private-struct)) (format #t "file ~S.gc, line ~D, col ~D.~%" (-> this filename) (-> this line-num) (-> this column-num)) 0 ) (define *__private-assert-info* (new 'static '__assert-info-private-struct)) - diff --git a/goal_src/jak1/engine/debug/debug-h.gc b/goal_src/jak1/engine/debug/debug-h.gc index f968ed24bdd..db3b0b7b6b1 100644 --- a/goal_src/jak1/engine/debug/debug-h.gc +++ b/goal_src/jak1/engine/debug/debug-h.gc @@ -19,36 +19,26 @@ ;; circular buffer of positions to draw. (deftype pos-history (structure) - ((points (inline-array vector) :offset-assert 0) - (num-points int32 :offset-assert 4) - (h-first int32 :offset-assert 8) - (h-last int32 :offset-assert 12) + ((points (inline-array vector)) + (num-points int32) + (h-first int32) + (h-last int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; unused vertex type? (deftype debug-vertex (structure) - ((trans vector4w :inline :offset-assert 0) - (normal vector3h :inline :offset-assert 16) - (st vector2h :inline :offset-assert 22) - (color uint32 :offset-assert 28) + ((trans vector4w :inline) + (normal vector3h :inline) + (st vector2h :inline) + (color uint32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; buffer of debug vertices (unused?) (deftype debug-vertex-stats (basic) - ((length int32 :offset-assert 4) - (pos-count int32 :offset-assert 8) - (vertex debug-vertex 600 :inline :offset-assert 16) + ((length int32) + (pos-count int32) + (vertex debug-vertex 600 :inline) ) - :method-count-assert 9 - :size-assert #x4b10 - :flag-assert #x900004b10 ) - diff --git a/goal_src/jak1/engine/debug/debug-sphere.gc b/goal_src/jak1/engine/debug/debug-sphere.gc index 782217940d3..c9f8ddaa929 100644 --- a/goal_src/jak1/engine/debug/debug-sphere.gc +++ b/goal_src/jak1/engine/debug/debug-sphere.gc @@ -12,13 +12,11 @@ ;; DECOMP BEGINS (deftype debug-sphere-table (basic) - ((point vector 300 :inline :offset-assert 16) + ((point vector 300 :inline) ) - :method-count-assert 9 - :size-assert #x12d0 - :flag-assert #x9000012d0 ) + (defun make-debug-sphere-table ((arg0 debug-sphere-table)) (local-vars (sv-80 int)) (let ((s5-0 (new-stack-vector0)) @@ -88,10 +86,11 @@ (.svf (&-> s4-0 quad) vf3) (.svf (&-> s3-0 quad) vf4) (.svf (&-> s2-0 quad) vf5) - (add-debug-line #t arg0 s4-0 s3-0 arg3 #f (the rgba -1)) - (add-debug-line #t arg0 s4-0 s2-0 arg3 #f (the rgba -1)) + (add-debug-line #t arg0 s4-0 s3-0 arg3 #f (the-as rgba -1)) + (add-debug-line #t arg0 s4-0 s2-0 arg3 #f (the-as rgba -1)) ) ) + 0 (none) ) ) diff --git a/goal_src/jak1/engine/debug/debug.gc b/goal_src/jak1/engine/debug/debug.gc index 34e90b3a63d..5b6c72f6302 100644 --- a/goal_src/jak1/engine/debug/debug.gc +++ b/goal_src/jak1/engine/debug/debug.gc @@ -307,41 +307,33 @@ (when *debug-segment* - (deftype debug-line (structure) - ((flags int32 :offset-assert 0) - (bucket bucket-id :offset-assert 4) - (v1 vector :inline :offset-assert 16) - (v2 vector :inline :offset-assert 32) - (color rgba :offset-assert 48) - (mode symbol :offset-assert 52) - (color2 rgba :offset-assert 56) + ((flags int32) + (bucket bucket-id) + (v1 vector :inline) + (v2 vector :inline) + (color rgba) + (mode symbol) + (color2 rgba) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) + (deftype debug-text-3d (structure) - ((flags int32 :offset-assert 0) - (bucket bucket-id :offset-assert 4) - (pos vector :inline :offset-assert 16) - (color font-color :offset-assert 32) - (offset vector2h :inline :offset-assert 40) - (str string :offset-assert 44) + ((flags int32) + (bucket bucket-id) + (pos vector :inline) + (color font-color) + (offset vector2h :inline) + (str string) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype debug-tracking-thang (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) + ((length int32) + (allocated-length int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; allocate debug draw buffers diff --git a/goal_src/jak1/engine/debug/memory-usage-h.gc b/goal_src/jak1/engine/debug/memory-usage-h.gc index b587416ef06..4ebb91d7def 100644 --- a/goal_src/jak1/engine/debug/memory-usage-h.gc +++ b/goal_src/jak1/engine/debug/memory-usage-h.gc @@ -20,29 +20,23 @@ ;; Information for a single category. (deftype memory-usage-info (structure) - ((name string :offset-assert 0) - (count int32 :offset-assert 4) ;; meaning depends on category. For textures, it's the number of textures, for example. - (used int32 :offset-assert 8) ;; how much memory is in use (not counting padding) - (total int32 :offset-assert 12) ;; actual total memory used, including padding to 16-bytes, etc. + ((name string) + (count int32) + (used int32) + (total int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; Memory info for all categories (deftype memory-usage-block (basic) - ((work-bsp basic :offset-assert 4) - (length int32 :offset-assert 8) - (data memory-usage-info 109 :inline :offset-assert 16) + ((work-bsp basic) + (length int32) + (data memory-usage-info 109 :inline) ) - :method-count-assert 12 - :size-assert #x6e0 - :flag-assert #xc000006e0 (:methods - (reset! (_type_) _type_ 9) - (calculate-total (_type_) int 10) - (print-mem-usage (_type_ level object) none 11) + (reset! (_type_) _type_) + (calculate-total (_type_) int) + (print-mem-usage (_type_ level object) none) ) ) diff --git a/goal_src/jak1/engine/debug/memory-usage.gc b/goal_src/jak1/engine/debug/memory-usage.gc index 17ac10a9667..2b88f001d02 100644 --- a/goal_src/jak1/engine/debug/memory-usage.gc +++ b/goal_src/jak1/engine/debug/memory-usage.gc @@ -11,7 +11,7 @@ (declare-file (debug)) -(defmethod inspect memory-usage-block ((this memory-usage-block)) +(defmethod inspect ((this memory-usage-block)) "Print the memory-usage by category. This is a large print." (format #t "-------------------------------------------------------------~%") (format #t " # name count bytes used aligned bytes~%") @@ -38,7 +38,7 @@ this ) -(defmethod mem-usage object ((this object) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this object) (arg0 memory-usage-block) (arg1 int)) "Most general mem-usage message. Just prints a warning, in case you expect this to do something." (if this (format #t "WARNING: mem-usage called on object, probably not what was wanted for ~A~%" this) @@ -46,7 +46,7 @@ this ) -(defmethod calculate-total memory-usage-block ((this memory-usage-block)) +(defmethod calculate-total ((this memory-usage-block)) "Compute the total memory usage of everything in the block." (let ((v0-0 0)) (dotimes (v1-0 (-> this length)) @@ -56,7 +56,7 @@ ) ) -(defmethod reset! memory-usage-block ((this memory-usage-block)) +(defmethod reset! ((this memory-usage-block)) "Reset all memory stats to 0." (set! (-> this length) 0) (dotimes (v1-0 109) @@ -78,8 +78,8 @@ ) ) -(defmethod compute-memory-usage level ((this level) (arg0 object)) - "Compute the memory usage of a level. Arg0 will force a recalculation." +(defmethod compute-memory-usage ((this level) (arg0 object)) + "Compute the memory usage of a level. arg0 will force a recalculation." (if (zero? (-> this mem-usage-block)) (set! (-> this mem-usage-block) (new 'debug 'memory-usage-block)) ) @@ -91,7 +91,7 @@ (-> this mem-usage-block) ) -(defmethod mem-usage process-tree ((this process-tree) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this process-tree) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a process tree." (let ((v1-0 87)) (let* ((a0-1 *dead-pool-list*) @@ -306,8 +306,7 @@ ;; the max dma ever (excluding debug) (define *max-dma* 0) - -(defmethod print-mem-usage memory-usage-block ((this memory-usage-block) (arg0 level) (arg1 object)) +(defmethod print-mem-usage ((this memory-usage-block) (arg0 level) (arg1 object)) "Print memory usage. Uses a foramt that will fit on screen." ;; print header (same in normal and compact mode) diff --git a/goal_src/jak1/engine/debug/menu.gc b/goal_src/jak1/engine/debug/menu.gc index f4de8ad6fbb..64b690594f6 100644 --- a/goal_src/jak1/engine/debug/menu.gc +++ b/goal_src/jak1/engine/debug/menu.gc @@ -28,35 +28,35 @@ ;; This stores a stack of open menus in sel-menu. ;; The 0th index is the selection in the root-menu. (deftype debug-menu-context (basic) - ((is-active symbol :offset-assert 4) ;; should we draw? - (sel-length int32 :offset-assert 8) ;; depth of open menus - (sel-menu debug-menu 8 :offset-assert 12) ;; at each level, what is selected? - (root-menu debug-menu :offset-assert 44) ;; the top level menu - (joypad-func (function basic none) :offset-assert 48) ;; if not, #f, callback for getting joystick inputs - (joypad-item basic :offset-assert 52) ;; object passed as arg to joypad-func - (font font-context :offset-assert 56) ;; font rendering settings - (is-hidden symbol :offset-assert 60) ;; set to #t to temporarily hide. + ((is-active symbol) ;; should we draw? + (sel-length int32) ;; depth of open menus + (sel-menu debug-menu 8) ;; at each level, what is selected? + (root-menu debug-menu) ;; the top level menu + (joypad-func (function basic none)) ;; if not, #f, callback for getting joystick inputs + (joypad-item basic) ;; object passed as arg to joypad-func + (font font-context) ;; font rendering settings + (is-hidden symbol) ;; set to #t to temporarily hide. ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) + (defmethod new debug-menu-context ((allocation symbol) (type-to-make type)) "Create a new debug-menu-context" (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> gp-0 is-active) #f) - (set! (-> gp-0 is-hidden) #f) - (set! (-> gp-0 sel-length) 0) - (set! (-> gp-0 root-menu) #f) - (set! (-> gp-0 joypad-func) #f) - (set! (-> gp-0 joypad-item) #f) - (set! (-> gp-0 font) (new 'debug 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning pc-hack))) - gp-0 - ) + (set! (-> gp-0 is-active) #f) + (set! (-> gp-0 is-hidden) #f) + (set! (-> gp-0 sel-length) 0) + (set! (-> gp-0 root-menu) #f) + (set! (-> gp-0 joypad-func) #f) + (set! (-> gp-0 joypad-item) #f) + (set! (-> gp-0 font) + (new 'debug 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning pc-hack)) + ) + gp-0 + ) ) @@ -67,41 +67,38 @@ ;; Updating every item on every frame would be slow, so you can set a nonzero value in refresh-delay ;; to only run the refresh every refresh-delay frames. (deftype debug-menu-node (basic) - ((name string :offset-assert 4) ;; if it's an item, this is its name. - (parent debug-menu :offset-assert 8) ;; note: can actually be an item in rare cases - (refresh-delay int32 :offset-assert 12) ;; how many frames to wait before updating - (refresh-ctr int32 :offset-assert 16) ;; how many frames since we updated. + ((name string) + (parent debug-menu) + (refresh-delay int32) + (refresh-ctr int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) -(defmethod print debug-menu-node ((obj debug-menu-node)) - (format #t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj) - obj + +(defmethod print ((this debug-menu-node)) + (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) + this ) ;; Parent type for a menu (list of things) (deftype debug-menu (debug-menu-node) - ((context debug-menu-context :offset-assert 20) - (selected-item debug-menu-item :offset-assert 24) - (pix-width int32 :offset-assert 28) ;; background draw size - (pix-height int32 :offset-assert 32) - (items pair :offset-assert 36) ;; children. + ((context debug-menu-context) + (selected-item debug-menu-item) + (pix-width int32) + (pix-height int32) + (items pair) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 (:methods - (new (symbol type debug-menu-context string) _type_ 0) + (new (symbol type debug-menu-context string) _type_) ) ) -(defmethod new debug-menu ((allocation symbol) (type-to-make type) (ctxt debug-menu-context) (name string)) + +(defmethod new debug-menu ((allocation symbol) (type-to-make type) (arg0 debug-menu-context) (name string)) "Create a new debug-menu" + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> v0-0 context) ctxt) + (set! (-> v0-0 context) arg0) (set! (-> v0-0 name) name) (set! (-> v0-0 parent) #f) (set! (-> v0-0 selected-item) #f) @@ -112,29 +109,25 @@ ;; Parent type for an item (an individual, selectable entry within a menu) (deftype debug-menu-item (debug-menu-node) - ((id int32 :offset-assert 20) + ((id int32) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) -;; An item that opens a submenu. + (deftype debug-menu-item-submenu (debug-menu-item) - ((submenu debug-menu :offset-assert 24) + ((submenu debug-menu) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c (:methods - (new (symbol type string debug-menu) _type_ 0) + (new (symbol type string debug-menu) _type_) ) ) -(defmethod new debug-menu-item-submenu ((allocation symbol) (type-to-make type) (name string) (menu debug-menu)) + +(defmethod new debug-menu-item-submenu ((allocation symbol) (type-to-make type) (arg0 string) (menu debug-menu)) "Create an item that opens the given menu." + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> v0-0 name) name) + (set! (-> v0-0 name) arg0) (set! (-> v0-0 parent) #f) (set! (-> v0-0 refresh-delay) 0) (set! (-> v0-0 refresh-ctr) (-> v0-0 refresh-delay)) @@ -149,7 +142,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;; ;; Items ;;;;;;;;;;;;;;;;;;;;;;;; - (defenum debug-menu-msg :type int32 (activate 1) @@ -160,92 +152,88 @@ ;; An item that calls a function when you select it. (deftype debug-menu-item-function (debug-menu-item) - ((activate-func (function object object) :offset-assert 24) - (hilite-timer int8 :offset-assert 28) ;; how much longer to stay highlighted for. + ((activate-func (function object object)) + (hilite-timer int8) ;; how much longer to stay highlighted for. ) - :method-count-assert 9 - :size-assert #x1d - :flag-assert #x90000001d (:methods - (new (symbol type string object (function object object)) _type_ 0) + (new (symbol type string object (function object object)) _type_) ) ) -(defmethod new debug-menu-item-function ((allocation symbol) (type-to-make type) (name string) id (func (function object object))) + +(defmethod new debug-menu-item-function ((allocation symbol) (type-to-make type) (arg0 string) (arg1 object) (arg2 (function object object))) "Create an item for a function." - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj name) name) - (set! (-> obj parent) #f) - (set! (-> obj refresh-delay) 0) - (set! (-> obj refresh-ctr) (-> obj refresh-delay)) - (set! (-> obj id) (the-as int id)) - (set! (-> obj activate-func) func) - (set! (-> obj hilite-timer) 0) - obj + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 name) arg0) + (set! (-> v0-0 parent) #f) + (set! (-> v0-0 refresh-delay) 0) + (set! (-> v0-0 refresh-ctr) (-> v0-0 refresh-delay)) + (set! (-> v0-0 id) (the-as int arg1)) + (set! (-> v0-0 activate-func) arg2) + (set! (-> v0-0 hilite-timer) 0) + v0-0 ) ) ;; An item with on/off state. (deftype debug-menu-item-flag (debug-menu-item) - ((activate-func (function object debug-menu-msg object) :offset-assert 24) - (is-on object :offset-assert 28) + ((activate-func (function object debug-menu-msg object)) + (is-on object) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 (:methods - (new (symbol type string object (function object debug-menu-msg object)) _type_ 0) + (new (symbol type string object (function object debug-menu-msg object)) _type_) ) ) -(defmethod new debug-menu-item-flag ((allocation symbol) (type-to-make type) (name string) id (func (function object debug-menu-msg object))) - "Create a new item for a flag. By default, the refresh-delay is set to 23." + +(defmethod new debug-menu-item-flag ((allocation symbol) + (type-to-make type) + (arg0 string) + (arg1 object) + (arg2 (function object debug-menu-msg object)) + ) (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> v0-0 name) name) - (set! (-> v0-0 parent) #f) - (set! (-> v0-0 refresh-delay) (#if PC_PORT 1 23)) - (set! (-> v0-0 refresh-ctr) (-> v0-0 refresh-delay)) - (set! (-> v0-0 id) (the-as int id)) - (set! (-> v0-0 activate-func) func) - (set! (-> v0-0 is-on) #f) - v0-0 - ) + (set! (-> v0-0 name) arg0) + (set! (-> v0-0 parent) #f) + (set! (-> v0-0 refresh-delay) 23) + (set! (-> v0-0 refresh-ctr) (-> v0-0 refresh-delay)) + (set! (-> v0-0 id) (the-as int arg1)) + (set! (-> v0-0 activate-func) arg2) + (set! (-> v0-0 is-on) (the-as object #f)) + v0-0 + ) ) -;; An item that modifies a variable (deftype debug-menu-item-var (debug-menu-item) - ((display-str string :offset-assert 24) ;; the value as a string, to draw - (grabbed-joypad-p symbol :offset-assert 28) - (float-p symbol :offset-assert 32) ;; treat as float - (range-p symbol :offset-assert 36) - (show-len int32 :offset-assert 40) - (inc-delay int32 :offset-assert 44) - (inc-delay-ctr int32 :offset-assert 48) - (step-delay-ctr int32 :offset-assert 52) - (inc-dir int32 :offset-assert 56) - (fval float :offset-assert 60) - (fundo-val float :offset-assert 64) - (frange-min float :offset-assert 68) - (frange-max float :offset-assert 72) - (fstart-inc float :offset-assert 76) - (fstep float :offset-assert 80) - (fprecision int32 :offset-assert 84) - (factivate-func (function int debug-menu-msg float float float) :offset-assert 88) - (ival int32 :offset 60) - (iundo-val int32 :offset 64) - (irange-min int32 :offset 68) - (irange-max int32 :offset 72) - (istart-inc int32 :offset 76) - (istep int32 :offset 80) - (ihex-p symbol :offset-assert 92) ;; treat as hex - (iactivate-func (function int debug-menu-msg int int int) :offset 88) - (ifloat-p symbol :offset-assert 96) ;; treat as fixed point. + ((display-str string) + (grabbed-joypad-p symbol) + (float-p symbol) + (range-p symbol) + (show-len int32) + (inc-delay int32) + (inc-delay-ctr int32) + (step-delay-ctr int32) + (inc-dir int32) + (fval float) + (fundo-val float) + (frange-min float) + (frange-max float) + (fstart-inc float) + (fstep float) + (fprecision int32) + (factivate-func (function int debug-menu-msg float float float)) + (ival int32 :overlay-at fval) + (iundo-val int32 :overlay-at fundo-val) + (irange-min int32 :overlay-at frange-min) + (irange-max int32 :overlay-at frange-max) + (istart-inc int32 :overlay-at fstart-inc) + (istep int32 :overlay-at fstep) + (ihex-p symbol) + (iactivate-func (function int debug-menu-msg int int int) :overlay-at factivate-func) + (ifloat-p symbol) ) - :method-count-assert 9 - :size-assert #x64 - :flag-assert #x900000064 (:methods - (new (symbol type string int int) _type_ 0) + (new (symbol type string int int) _type_) ) ) @@ -279,9 +267,7 @@ ) ((-> arg0 ifloat-p) (cond - ((and (< (the-as int (-> arg0 fval)) 0) - (< -100 (the-as int (-> arg0 fval))) - ) + ((and (< (the-as int (-> arg0 fval)) 0) (< -100 (the-as int (-> arg0 fval)))) (let ((v1-8 (abs (the-as int (-> arg0 fval))))) (format (clear (-> arg0 display-str)) "-0.~1d" (/ (mod v1-8 100) 10)) ) @@ -300,15 +286,14 @@ arg0 ) -(defun debug-menu-item-var-make-int - ((item debug-menu-item-var) - (callback (function int debug-menu-msg int int int)) ;; args are id, msg, value?, value? - (inc int) - (has-range symbol) - (range-min int) - (range-max int) - (hex symbol) - ) +(defun debug-menu-item-var-make-int ((item debug-menu-item-var) + (callback (function int debug-menu-msg int int int)) + (inc int) + (has-range symbol) + (range-min int) + (range-max int) + (hex symbol) + ) "Set up the given item as an integer variable" (set! (-> item float-p) #f) (set! (-> item range-p) has-range) @@ -319,30 +304,30 @@ (set! (-> item ihex-p) hex) (set! (-> item iactivate-func) callback) (cond - (has-range - (set! (-> item ival) range-min) - ) - (else - (set! (-> item ival) 0) + (has-range + (set! (-> item fval) (the-as float range-min)) + ) + (else + (set! (-> item fval) (the-as float 0)) + 0 + ) ) - ) ;; initialize with the callback. (if callback - (set! (-> item ival) (callback (-> item id) (debug-menu-msg update) (-> item ival) (-> item ival))) - ) + (set! (-> item ival) (callback (-> item id) (debug-menu-msg update) (-> item ival) (-> item ival))) + ) (debug-menu-item-var-update-display-str item) item ) -(defun debug-menu-item-var-make-float - ((item debug-menu-item-var) - (callback (function int debug-menu-msg float float float)) - (inc float) - (has-range symbol) - (range-min float) - (range-max float) - (precision int) - ) +(defun debug-menu-item-var-make-float ((item debug-menu-item-var) + (callback (function int debug-menu-msg float float float)) + (inc float) + (has-range symbol) + (range-min float) + (range-max float) + (precision int) + ) "Set up the given item as a float variable" (set! (-> item float-p) #t) (set! (-> item range-p) has-range) @@ -353,16 +338,16 @@ (set! (-> item fprecision) precision) (set! (-> item factivate-func) callback) (if has-range - (set! (-> item fval) range-min) - (set! (-> item fval) 0.0) - ) + (set! (-> item fval) range-min) + (set! (-> item fval) 0.0) + ) ;; note: the return value of the callback is treated as an integer and int->float converted. This is a bug in the original code. (if callback - (set! (-> item fval) - (the float (the-as int (callback (-> item id) (debug-menu-msg update) (-> item fval) (-> item fval)))) - ) - ) + (set! (-> item fval) + (the float (callback (-> item id) (debug-menu-msg update) (-> item fval) (-> item fval))) + ) + ) (debug-menu-item-var-update-display-str item) item ) @@ -400,15 +385,15 @@ (defun debug-menu-context-grab-joypad ((ctxt debug-menu-context) (callback-arg basic) (callback-func (function basic none))) "Set up this context to be controlled from a joypad. If we are already, return #f, otherwise return #t" (cond - ((-> ctxt joypad-func) - #f - ) - (else - (set! (-> ctxt joypad-func) callback-func) - (set! (-> ctxt joypad-item) callback-arg) - #t + ((-> ctxt joypad-func) + #f + ) + (else + (set! (-> ctxt joypad-func) callback-func) + (set! (-> ctxt joypad-item) callback-arg) + #t + ) ) - ) ) (defun debug-menu-context-release-joypad ((ctxt debug-menu-context)) @@ -428,11 +413,11 @@ 0 (cond ((= (-> arg0 type) debug-menu-item-submenu) - (+ (the int (get-string-length (-> arg0 name) (-> arg1 context font))) 16) - ) + (+ (the int (get-string-length (-> arg0 name) (-> arg1 context font))) 16) + ) ((= (-> arg0 type) debug-menu-item-var) - (the int (get-string-length (-> (the-as debug-menu-item-var arg0) display-str) (-> arg1 context font))) - ) + (the int (get-string-length (-> (the-as debug-menu-item-var arg0) display-str) (-> arg1 context font))) + ) (else (+ (the int (get-string-length (-> arg0 name) (-> arg1 context font))) 6) ) @@ -457,9 +442,7 @@ (set! (-> ctxt sel-length) 1) (set! (-> ctxt sel-menu 0) menu) ;; select the first thing within the root menu - (set! (-> menu selected-item) - (the-as debug-menu-item (car (-> menu items))) - ) + (set! (-> menu selected-item) (the-as debug-menu-item (car (-> menu items)))) ;; if we were active, activate again. (if currently-active (debug-menu-context-send-msg ctxt (debug-menu-msg activate) (debug-menu-dest activation)) @@ -558,18 +541,17 @@ (defun debug-menu-func-decode ((arg0 object)) "Get a function. The input can be a symbol or a function. Otherwise it will give you the nothing function." (let ((v1-1 (rtype-of arg0))) - (the-as function - (cond - ((or (= v1-1 symbol) (= v1-1 type)) - (-> (the-as symbol arg0) value) - ) - ((= v1-1 function) - arg0 - ) - (else - nothing - ) - ) + (the-as function (cond + ((or (= v1-1 symbol) (= v1-1 type)) + (the-as symbol (-> (the-as symbol arg0) value)) + ) + ((= v1-1 function) + (the-as symbol arg0) + ) + (else + (the-as symbol nothing) + ) + ) ) ) ) @@ -581,167 +563,197 @@ - flag - flag entry - function - function entry - var, int-var, int-var-gat1, hex-var, float-var, flat-fixed-var" - (local-vars - (s5-0 debug-menu-node) - (sv-16 object) - (sv-32 int) - (sv-48 float) - (sv-64 float) - (sv-80 float) - (sv-96 float) - ) + (local-vars (s5-0 basic) (sv-16 object) (sv-32 int) (sv-48 float) (sv-64 float) (sv-80 float) (sv-96 float)) (when (or (not arg1) (null? arg1)) - (set! s5-0 (the-as debug-menu-node #f)) - (goto cfg-41) - ) + (set! s5-0 #f) + (goto cfg-41) + ) (let ((s4-0 (car arg1)) - (s5-1 (the-as string (cadr arg1))) + (s5-1 (the-as string (car (cdr arg1)))) ) - (cond - ((= s4-0 'menu) - (let ((s4-1 (new 'debug 'debug-menu arg0 s5-1))) - (set! s5-0 (new 'debug 'debug-menu-item-submenu s5-1 s4-1)) - (let* ((gp-1 (cddr arg1)) - (a1-3 (car gp-1)) + (cond + ((= s4-0 'menu) + (let ((s4-1 (new 'debug 'debug-menu arg0 s5-1))) + (set! s5-0 (new 'debug 'debug-menu-item-submenu s5-1 s4-1)) + (let* ((gp-1 (cdr (cdr arg1))) + (a1-3 (car gp-1)) + ) + (while (not (null? gp-1)) + (let ((a1-4 (debug-menu-make-from-template arg0 (the-as pair a1-3)))) + (if a1-4 + (debug-menu-append-item s4-1 a1-4) + ) + ) + (set! gp-1 (cdr gp-1)) + (set! a1-3 (car gp-1)) ) - (while (not (null? gp-1)) - (let ((a1-4 (debug-menu-make-from-template arg0 (the-as pair a1-3)))) - (if a1-4 - (debug-menu-append-item s4-1 (the-as debug-menu-item a1-4)) - ) + ) ) - (set! gp-1 (cdr gp-1)) - (set! a1-3 (car gp-1)) - ) ) - ) - ) - ((= s4-0 'main-menu) - (set! s5-0 (new 'debug 'debug-menu arg0 s5-1)) - (let* ((gp-2 (cddr arg1)) - (a1-6 (car gp-2)) - ) - (while (not (null? gp-2)) - (let ((a1-7 (debug-menu-make-from-template arg0 (the-as pair a1-6)))) - (if a1-7 - (debug-menu-append-item (the-as debug-menu s5-0) (the-as debug-menu-item a1-7)) + ((= s4-0 'main-menu) + (set! s5-0 (new 'debug 'debug-menu arg0 s5-1)) + (let* ((gp-2 (cdr (cdr arg1))) + (a1-6 (car gp-2)) + ) + (while (not (null? gp-2)) + (let ((a1-7 (debug-menu-make-from-template arg0 (the-as pair a1-6)))) + (if a1-7 + (debug-menu-append-item (the-as debug-menu s5-0) a1-7) + ) + ) + (set! gp-2 (cdr gp-2)) + (set! a1-6 (car gp-2)) + ) ) - ) - (set! gp-2 (cdr gp-2)) - (set! a1-6 (car gp-2)) + (debug-menu-context-set-root-menu arg0 (the-as debug-menu s5-0)) ) - ) - (debug-menu-context-set-root-menu arg0 (the-as debug-menu s5-0)) - ) - (else - (set! s5-0 (cond - ((= s4-0 'flag) - (new 'debug 'debug-menu-item-flag - s5-1 - (the-as int (caddr arg1)) - (the (function int debug-menu-msg object) (debug-menu-func-decode (cadddr arg1))) + (else + (set! s5-0 + (cond + ((= s4-0 'flag) + (new + 'debug + 'debug-menu-item-flag + s5-1 + (car (cdr (cdr arg1))) + (the-as (function object debug-menu-msg object) (debug-menu-func-decode (car (cdr (cdr (cdr arg1)))))) + ) + ) + ((or (= s4-0 0) (= s4-0 'function)) + (new + 'debug + 'debug-menu-item-function + s5-1 + (car (cdr (cdr arg1))) + (the-as (function object object) (debug-menu-func-decode (car (cdr (cdr (cdr arg1)))))) + ) + ) + ((= s4-0 'var) + (new + 'debug + 'debug-menu-item-var + s5-1 + (the-as int (car (cdr (cdr arg1)))) + (the-as int (car (cdr (cdr (cdr arg1))))) + ) + ) + ((or (= s4-0 'int-var) (= s4-0 'int-var-gat1) (= s4-0 'hex-var)) + (set! s5-0 + (new 'debug 'debug-menu-item-var s5-1 (the-as int (car (cdr (cdr arg1)))) (the-as int (ref arg1 4))) ) - ) - ((or (= s4-0 0) (= s4-0 'function)) - (new 'debug 'debug-menu-item-function - s5-1 - (the-as int (caddr arg1)) - (the (function int object) (debug-menu-func-decode (cadddr arg1))) + (let ((s3-4 debug-menu-item-var-make-int) + (s2-3 (the-as debug-menu-item-var s5-0)) + (s1-3 (debug-menu-func-decode (car (cdr (cdr (cdr arg1)))))) + (s0-1 (/ (the-as int (ref arg1 5)) 8)) ) - ) - ((= s4-0 'var) - (new 'debug 'debug-menu-item-var s5-1 (the-as int (caddr arg1)) (the-as int (cadddr arg1))) - ) - ((or (= s4-0 'int-var) - (= s4-0 'int-var-gat1) - (= s4-0 'hex-var) - ) - (set! s5-0 (new 'debug 'debug-menu-item-var s5-1 (the-as int (caddr arg1)) (the-as int (ref arg1 4)))) - (debug-menu-item-var-make-int - (the-as debug-menu-item-var s5-0) - (the-as (function int debug-menu-msg int int int) (debug-menu-func-decode (cadddr arg1))) - (/ (the-as int (ref arg1 5)) 8) - (the-as symbol (ref arg1 6)) - (/ (the-as int (ref arg1 7)) 8) - (/ (the-as int (ref arg1 8)) 8) - (= s4-0 'hex-var) - ) - ;; changed... i have no idea what they were trying to do here - (set! (-> (the-as debug-menu-item-var s5-0) ifloat-p) (= s4-0 'int-var-gat1));;#t) - s5-0 - ) - ((= s4-0 'float-var) - (set! s5-0 (new 'debug 'debug-menu-item-var s5-1 (the-as int (caddr arg1)) (the-as int (ref arg1 4)))) - (debug-menu-item-var-make-float - (the-as debug-menu-item-var s5-0) - (the-as (function int debug-menu-msg float float float) (debug-menu-func-decode (cadddr arg1))) - (the float (/ (the-as int (ref arg1 5)) 8)) - (the-as symbol (ref arg1 6)) - (the float (/ (the-as int (ref arg1 7)) 8)) - (the float (/ (the-as int (ref arg1 8)) 8)) - (/ (the-as int (ref arg1 9)) 8) - ) - s5-0 - ) - ((= s4-0 'float-fixed-var) - (set! s5-0 (new 'debug 'debug-menu-item-var s5-1 (the-as int (caddr arg1)) (the-as int (ref arg1 4)))) - (debug-menu-item-var-make-float - (the-as debug-menu-item-var s5-0) - (the-as (function int debug-menu-msg float float float) (debug-menu-func-decode (cadddr arg1))) - (* 0.001 (the float (/ (the-as int (ref arg1 5)) 8))) - (the-as symbol (ref arg1 6)) - (* 0.001 (the float (/ (the-as int (ref arg1 7)) 8))) - (* 0.001 (the float (/ (the-as int (ref arg1 8)) 8))) - (/ (the-as int (ref arg1 9)) 8) - ) - s5-0 - ) - (else - (the-as debug-menu-node #f) - ) + (set! sv-16 (ref arg1 6)) + (set! sv-32 (/ (the-as int (ref arg1 7)) 8)) + (let ((t1-0 (/ (the-as int (ref arg1 8)) 8)) + (t2-0 (= s4-0 'hex-var)) + ) + (s3-4 s2-3 (the-as (function int debug-menu-msg int int int) s1-3) s0-1 (the-as symbol sv-16) sv-32 t1-0 t2-0) + ) + ) + ;; changed... i have no idea what they were trying to do here + (set! (-> (the-as debug-menu-item-var s5-0) ifloat-p) (= s4-0 'int-var-gat1));;#t) + s5-0 + ) + ((= s4-0 'float-var) + (set! s5-0 + (new 'debug 'debug-menu-item-var s5-1 (the-as int (car (cdr (cdr arg1)))) (the-as int (ref arg1 4))) + ) + (let ((s4-5 debug-menu-item-var-make-float) + (s3-6 (the-as debug-menu-item-var s5-0)) + (s2-5 (debug-menu-func-decode (car (cdr (cdr (cdr arg1)))))) + (s1-5 (the float (/ (the-as int (ref arg1 5)) 8))) + (s0-2 (ref arg1 6)) + ) + (set! sv-48 (the float (/ (the-as int (ref arg1 7)) 8))) + (set! sv-64 (the float (/ (the-as int (ref arg1 8)) 8))) + (let ((t2-1 (/ (the-as int (ref arg1 9)) 8))) + (s4-5 + s3-6 + (the-as (function int debug-menu-msg float float float) s2-5) + s1-5 + (the-as symbol s0-2) + sv-48 + sv-64 + t2-1 + ) + ) + ) + s5-0 + ) + ((= s4-0 'float-fixed-var) + (set! s5-0 + (new 'debug 'debug-menu-item-var s5-1 (the-as int (car (cdr (cdr arg1)))) (the-as int (ref arg1 4))) + ) + (let ((s4-7 debug-menu-item-var-make-float) + (s3-8 (the-as debug-menu-item-var s5-0)) + (s2-7 (debug-menu-func-decode (car (cdr (cdr (cdr arg1)))))) + (s1-7 (* 0.001 (the float (/ (the-as int (ref arg1 5)) 8)))) + (s0-3 (ref arg1 6)) + ) + (set! sv-80 (* 0.001 (the float (/ (the-as int (ref arg1 7)) 8)))) + (set! sv-96 (* 0.001 (the float (/ (the-as int (ref arg1 8)) 8)))) + (let ((t2-2 (/ (the-as int (ref arg1 9)) 8))) + (s4-7 + s3-8 + (the-as (function int debug-menu-msg float float float) s2-7) + s1-7 + (the-as symbol s0-3) + sv-80 + sv-96 + t2-2 + ) + ) + ) + s5-0 ) + (else + #f + ) + ) + ) + ) ) - ) ) - ) (label cfg-41) - s5-0 + (the-as debug-menu-node s5-0) ) (defun debug-menu-find-from-template ((arg0 debug-menu-context) (arg1 pair)) "Find a debug-menu that was added by a template. This could be used to modify it after, for example to add in options that might not be known at compile-time." (let ((s4-0 (the-as object (-> arg0 root-menu)))) - (while (begin (label cfg-17) - (and s4-0 (type-type? (-> (the-as debug-menu-node s4-0) type) debug-menu) - (not (null? arg1)) - ) - ) - (let ((s3-0 (-> (the-as debug-menu s4-0) items)) - (s4-1 (the-as string (car arg1))) + (while (begin + (label cfg-17) + (and s4-0 (type-type? (-> (the-as debug-menu-node s4-0) type) debug-menu) (not (null? arg1))) + ) + (let ((s3-0 (-> (the-as debug-menu s4-0) items)) + (s4-1 (car arg1)) + ) + (set! arg1 (cdr arg1)) + (let ((s5-0 (car s3-0))) + (while (not (null? s3-0)) + (when (string= (the-as string s4-1) (-> (the-as debug-menu-item s5-0) name)) + (if (type-type? (rtype-of s5-0) debug-menu-item-submenu) + (set! s4-0 (-> (the-as debug-menu-item-submenu s5-0) submenu)) + (set! s4-0 s5-0) + ) + (goto cfg-17) + ) + (set! s3-0 (cdr s3-0)) + (set! s5-0 (car s3-0)) + ) ) - (set! arg1 (cdr arg1)) - (let ((s5-0 (car s3-0))) - (while (not (null? s3-0)) - (when - (string= s4-1 (-> (the-as debug-menu-item s5-0) name)) - (if (type-type? (rtype-of s5-0) debug-menu-item-submenu) - (set! s4-0 (-> (the-as debug-menu-item-submenu s5-0) submenu)) - (set! s4-0 s5-0) - ) - (goto cfg-17) ) - (set! s3-0 (cdr s3-0)) - (set! s5-0 (car s3-0)) - ) + (set! s4-0 #f) + (goto cfg-24) ) - ) - (set! s4-0 #f) - (goto cfg-24) + (label cfg-24) + (the-as debug-menu s4-0) ) - (label cfg-24) - (the-as debug-menu s4-0) - ) ) ;;;;;;;;;;;;;;;;;;;;;;;; @@ -884,32 +896,31 @@ ;; do a refresh, if it's time. (when (> (-> item refresh-delay) 0) - (+! (-> item refresh-ctr) -1) - (when (<= (-> item refresh-ctr) 0) - (set! (-> item refresh-ctr) (-> item refresh-delay)) - (debug-menu-item-send-msg item (debug-menu-msg update)) + (+! (-> item refresh-ctr) -1) + (when (<= (-> item refresh-ctr) 0) + (set! (-> item refresh-ctr) (-> item refresh-delay)) + (debug-menu-item-send-msg item (debug-menu-msg update)) + ) ) - ) ;; call the appropriate render function. (cond - ((= (-> item type) debug-menu-item-submenu) - (debug-menu-item-submenu-render (the-as debug-menu-item-submenu item) x y submenus selected) - ) - ((= (-> item type) debug-menu-item-function) - (debug-menu-item-function-render (the-as debug-menu-item-function item) x y submenus selected) - ) - ((= (-> item type) debug-menu-item-flag) - (debug-menu-item-flag-render - (the-as debug-menu-item-flag item) x y submenus selected) - ) - ((= (-> item type) debug-menu-item-var) - (debug-menu-item-var-render (the-as debug-menu-item-var item) x y submenus selected) - ) - (else - (format 0 "ERROR: Found unknown item type!~%") + ((= (-> item type) debug-menu-item-submenu) + (debug-menu-item-submenu-render (the-as debug-menu-item-submenu item) x y submenus selected) + ) + ((= (-> item type) debug-menu-item-function) + (debug-menu-item-function-render (the-as debug-menu-item-function item) x y submenus selected) + ) + ((= (-> item type) debug-menu-item-flag) + (debug-menu-item-flag-render (the-as debug-menu-item-flag item) x y submenus selected) + ) + ((= (-> item type) debug-menu-item-var) + (debug-menu-item-var-render (the-as debug-menu-item-var item) x y submenus selected) + ) + (else + (format 0 "ERROR: Found unknown item type!~%") + ) ) - ) item ) @@ -1006,47 +1017,43 @@ ;; search for the currently selected thing. (let ((s5-0 (-> arg0 sel-menu (+ (-> arg0 sel-length) -1)))) - (let ((a2-0 (-> s5-0 selected-item)) - (a0-1 '()) ;; thing before selection - (v1-4 '()) ;; current selection + (let ((a2-0 (-> s5-0 selected-item)) + (a0-1 '()) ;; thing before selection + (v1-4 '()) ;; current selection + ) + (let ((a3-0 (-> s5-0 items))) + (while (not (null? a3-0)) + (when (= (car a3-0) a2-0) + (set! v1-4 a3-0) + (goto cfg-7) + ) + (set! a0-1 a3-0) + (set! a3-0 (cdr a3-0)) + ) + ) + (label cfg-7) + (when (null? v1-4) + (format 0 "ERROR: Couldn't find selected item in menu.~%") + (set! arg0 arg0) + (goto cfg-19) + ) + (cond + ((>= arg1 0) + (if (null? (cdr v1-4)) + (set! v1-6 (car (-> s5-0 items))) + (set! v1-6 (car (cdr v1-4))) + ) + ) + ((null? a0-1) + (set! v1-6 (car (last (-> s5-0 items)))) ) - (let ((a3-0 (-> s5-0 items))) - (while (not (null? a3-0)) - (if (= (car a3-0) a2-0) - (begin - (set! v1-4 a3-0) - (goto cfg-7) + (else + (set! v1-6 (car a0-1)) + ) ) - ) - (set! a0-1 a3-0) - (set! a3-0 (cdr a3-0)) ) - ) - (label cfg-7) - (if (null? v1-4) - (begin - (format 0 "ERROR: Couldn't find selected item in menu.~%") - (set! arg0 arg0) - (goto cfg-19) - ) - ) - (cond - ((>= arg1 0) - (if (null? (cdr v1-4)) - (set! v1-6 (car (-> s5-0 items))) ;; wrap - (set! v1-6 (car (cdr v1-4))) ;; get next - ) - ) - ((null? a0-1) - (set! v1-6 (car (last (-> s5-0 items)))) ;; wrap backward - ) - (else - (set! v1-6 (car a0-1)) ;; get prev. - ) - ) + (set! (-> s5-0 selected-item) (the-as debug-menu-item v1-6)) ) - (set! (-> s5-0 selected-item) (the-as debug-menu-item v1-6)) - ) (label cfg-19) arg0 ) @@ -1057,79 +1064,77 @@ (a0-1 0) (v1-4 -1) ) - (let ((a2-1 (-> a2-0 items))) - (while (not (null? a2-1)) - (if (= (car a2-1) a1-1) - (set! v1-4 a0-1) - ) - (set! a2-1 (cdr a2-1)) - (+! a0-1 1) - ) - ) - (if (= v1-4 -1) - (begin - (format 0 "ERROR: Couldn't find selected item in menu.~%") - (set! arg0 arg0) - (goto cfg-25) - ) - ) - (cond - ((>= arg1 0) - (cond - ((= v1-4 (+ a0-1 -1)) - (set! arg1 1) - ) - ((>= (+ v1-4 arg1) a0-1) - (set! arg1 (+ (- -1 v1-4) a0-1)) - ) + (let ((a2-1 (-> a2-0 items))) + (while (not (null? a2-1)) + (if (= (car a2-1) a1-1) + (set! v1-4 a0-1) + ) + (set! a2-1 (cdr a2-1)) + (+! a0-1 1) + ) ) - (dotimes (s4-0 arg1) - (debug-menu-context-select-next-or-prev-item arg0 1) + (when (= v1-4 -1) + (format 0 "ERROR: Couldn't find selected item in menu.~%") + (set! arg0 arg0) + (goto cfg-25) ) - ) - (else - (cond - ((zero? v1-4) - (set! arg1 -1) - ) - ((< (+ v1-4 arg1) 0) - (set! arg1 (- v1-4)) + (cond + ((>= arg1 0) + (cond + ((= v1-4 (+ a0-1 -1)) + (set! arg1 1) + ) + ((>= (+ v1-4 arg1) a0-1) + (set! arg1 (+ (- -1 v1-4) a0-1)) + ) + ) + (dotimes (s4-0 arg1) + (debug-menu-context-select-next-or-prev-item arg0 1) + ) ) + (else + (cond + ((zero? v1-4) + (set! arg1 -1) + ) + ((< (+ v1-4 arg1) 0) + (set! arg1 (- v1-4)) + ) + ) + (dotimes (s4-1 (- arg1)) + (debug-menu-context-select-next-or-prev-item arg0 -1) + ) + ) ) - (dotimes (s4-1 (- arg1)) - (debug-menu-context-select-next-or-prev-item arg0 -1) - ) - ) ) - ) (label cfg-25) arg0 ) (defun debug-menu-context-open-submenu ((arg0 debug-menu-context) (arg1 debug-menu)) (let ((v1-0 (-> arg0 sel-length))) - (when (>= v1-0 8) - (format 0 "ERROR: Trying to exceed maximum menu depth!") - (return arg1) - ) - (when (null? (-> arg1 items)) - (format 0 "ERROR: Submenu has no items!") - (return arg1) - ) - (set! (-> arg0 sel-menu v1-0) arg1) - (if (not (-> arg1 selected-item)) - (set! (-> arg1 selected-item) (the-as debug-menu-item (-> arg1 items car))) + (when (>= v1-0 8) + (format 0 "ERROR: Trying to exceed maximum menu depth!") + (return arg1) + ) + (when (null? (-> arg1 items)) + (format 0 "ERROR: Submenu has no items!") + (return arg1) + ) + (set! (-> arg0 sel-menu v1-0) arg1) + (if (not (-> arg1 selected-item)) + (set! (-> arg1 selected-item) (the-as debug-menu-item (-> arg1 items car))) + ) + (set! (-> arg0 sel-length) (+ v1-0 1)) ) - (set! (-> arg0 sel-length) (+ v1-0 1)) - ) (debug-menu-context-send-msg arg0 (debug-menu-msg activate) (debug-menu-dest current-selection)) ) (defun debug-menu-context-close-submenu ((arg0 debug-menu-context)) (debug-menu-context-send-msg arg0 (debug-menu-msg deactivate) (debug-menu-dest current-selection)) (if (< 1 (-> arg0 sel-length)) - (+! (-> arg0 sel-length) -1) - ) + (+! (-> arg0 sel-length) -1) + ) arg0 ) @@ -1151,30 +1156,29 @@ (defun debug-menu-item-function-msg ((arg0 debug-menu-item-function) (arg1 debug-menu-msg)) (cond - ((= arg1 (debug-menu-msg press)) - ;; on press, call the function! - (cond - ((-> arg0 activate-func) - (if ((-> arg0 activate-func) (-> arg0 id)) - (set! (-> arg0 hilite-timer) 6) - (set! (-> arg0 hilite-timer) -6) + ((= arg1 (debug-menu-msg press)) + ;; on press, call the function! + (cond + ((-> arg0 activate-func) + (if ((-> arg0 activate-func) (-> arg0 id)) + (set! (-> arg0 hilite-timer) 6) + (set! (-> arg0 hilite-timer) -6) + ) + ) + (else + (set! (-> arg0 hilite-timer) -6) + ) ) - ) - (else - (set! (-> arg0 hilite-timer) -6) - ) + ) + ((= arg1 (debug-menu-msg deactivate)) + ;; on deactivate, clear hilite. + (set! (-> arg0 hilite-timer) 0) + 0 ) ) - ((= arg1 (debug-menu-msg deactivate)) - ;; on deactivate, clear hilite. - (set! (-> arg0 hilite-timer) 0) - 0 - ) - ) arg0 ) - (defun debug-menu-item-flag-msg ((arg0 debug-menu-item-flag) (arg1 debug-menu-msg)) (cond ((= arg1 (debug-menu-msg press)) @@ -1184,11 +1188,7 @@ ) ;; also update all open menus. (let ((a0-2 (-> arg0 parent context))) - (debug-menu-context-send-msg - a0-2 - (debug-menu-msg update) - (debug-menu-dest open-menus) - ) + (debug-menu-context-send-msg a0-2 (debug-menu-msg update) (debug-menu-dest open-menus)) ) ) ((or (= arg1 (debug-menu-msg update)) (= arg1 (debug-menu-msg activate))) @@ -1210,181 +1210,211 @@ (defun debug-menu-item-var-joypad-handler ((arg0 debug-menu-item-var)) "Handle joypad inputs for a variable" (cond - ((not (cpad-hold? 0 x)) - (let ((a0-1 (-> arg0 parent context))) - (debug-menu-context-release-joypad a0-1) - ) - (set! (-> arg0 grabbed-joypad-p) #f) - (when (cpad-pressed? 0 circle) - (cond - ((-> arg0 float-p) - (if (-> arg0 factivate-func) - (set! (-> arg0 fval) ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg press) (-> arg0 fundo-val) (-> arg0 fval))) - ) + ((not (cpad-hold? 0 x)) + (let ((a0-1 (-> arg0 parent context))) + (debug-menu-context-release-joypad a0-1) ) - (else - (if (-> arg0 iactivate-func) - (set! (-> arg0 ival) ((-> arg0 iactivate-func) (-> arg0 id) (debug-menu-msg press) (-> arg0 iundo-val) (-> arg0 ival))) - ) + (set! (-> arg0 grabbed-joypad-p) #f) + (when (cpad-pressed? 0 circle) + (cond + ((-> arg0 float-p) + (if (-> arg0 factivate-func) + (set! (-> arg0 fval) + ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg press) (-> arg0 fundo-val) (-> arg0 fval)) + ) + ) + ) + (else + (if (-> arg0 factivate-func) + (set! (-> arg0 fval) (the-as float ((the-as (function int int int int int) (-> arg0 factivate-func)) + (-> arg0 id) + 4 + (the-as int (-> arg0 fundo-val)) + (the-as int (-> arg0 fval)) + ) + ) + ) + ) + ) + ) + (debug-menu-item-var-update-display-str arg0) ) - ) - (debug-menu-item-var-update-display-str arg0) - ) - (let ((a0-5 (-> arg0 parent context))) - (debug-menu-context-send-msg a0-5 (debug-menu-msg update) (debug-menu-dest open-menus)) - ) - ) - ((or (cpad-hold? 0 right) - (cpad-hold? 0 left) - (cpad-hold? 0 down) - (cpad-hold? 0 up) - ) - (let ((v1-39 (cond - ((cpad-hold? 0 right) 10) - ((cpad-hold? 0 up) 1) - ((cpad-hold? 0 down) -1) - (else -10) - ))) - (when (!= v1-39 (-> arg0 inc-dir)) - (set! (-> arg0 inc-dir) v1-39) - (set! (-> arg0 inc-delay) 15) - (set! (-> arg0 inc-delay-ctr) 0) - (set! (-> arg0 step-delay-ctr) 30) - (set! (-> arg0 fstep) (-> arg0 fstart-inc)) - (set! (-> arg0 fstep) (-> arg0 fstart-inc)) - ) - ) - (cond - ((<= (-> arg0 inc-delay-ctr) 0) - (if (> (-> arg0 inc-delay) 0) - (+! (-> arg0 inc-delay) -1) + (let ((a0-5 (-> arg0 parent context))) + (debug-menu-context-send-msg a0-5 (debug-menu-msg update) (debug-menu-dest open-menus)) ) - (when (zero? (-> arg0 inc-delay)) - (cond - ((<= (-> arg0 step-delay-ctr) 0) + ) + ((or (cpad-hold? 0 right) (cpad-hold? 0 left) (cpad-hold? 0 down) (cpad-hold? 0 up)) + (let ((v1-39 (cond + ((cpad-hold? 0 right) + 10 + ) + ((cpad-hold? 0 up) + 1 + ) + ((cpad-hold? 0 down) + -1 + ) + (else + -10 + ) + ) + ) + ) + (when (!= v1-39 (-> arg0 inc-dir)) + (set! (-> arg0 inc-dir) v1-39) + (set! (-> arg0 inc-delay) 15) + (set! (-> arg0 inc-delay-ctr) 0) (set! (-> arg0 step-delay-ctr) 30) - (cond - ((-> arg0 float-p) - (if (< (-> arg0 fstep) 10000000.0) - (set! (-> arg0 fstep) (* 2.0 (-> arg0 fstep))) + (set! (-> arg0 fstep) (-> arg0 fstart-inc)) + (set! (-> arg0 fstep) (-> arg0 fstart-inc)) + ) + ) + (cond + ((<= (-> arg0 inc-delay-ctr) 0) + (if (> (-> arg0 inc-delay) 0) + (+! (-> arg0 inc-delay) -1) ) + (when (zero? (-> arg0 inc-delay)) + (cond + ((<= (-> arg0 step-delay-ctr) 0) + (set! (-> arg0 step-delay-ctr) 30) + (cond + ((-> arg0 float-p) + (if (< (-> arg0 fstep) 10000000.0) + (set! (-> arg0 fstep) (* 2.0 (-> arg0 fstep))) + ) + ) + (else + (if (< (the-as int (-> arg0 fstep)) #x989680) + (set! (-> arg0 fstep) (the-as float (* (the-as int (-> arg0 fstep)) 2))) + ) + ) + ) + ) + (else + (+! (-> arg0 step-delay-ctr) -1) + ) + ) + ) + (set! (-> arg0 inc-delay-ctr) (-> arg0 inc-delay)) + (cond + ((-> arg0 float-p) + (when (-> arg0 factivate-func) + (let ((f0-8 (+ (-> arg0 fval) (* (the float (-> arg0 inc-dir)) (-> arg0 fstep))))) + (if (-> arg0 range-p) + (set! f0-8 (fmin (fmax f0-8 (-> arg0 frange-min)) (-> arg0 frange-max))) + ) + (set! (-> arg0 fval) ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg press) f0-8 (-> arg0 fval))) + ) + ) ) (else - (if (< (-> arg0 istep) 10000000) - (set! (-> arg0 istep) (* 2 (-> arg0 istep))) + (when (-> arg0 factivate-func) + (let ((a2-4 (+ (the-as int (-> arg0 fval)) (* (-> arg0 inc-dir) (the-as int (-> arg0 fstep)))))) + (if (-> arg0 range-p) + (set! a2-4 (min (max a2-4 (the-as int (-> arg0 frange-min))) (the-as int (-> arg0 frange-max)))) + ) + (set! (-> arg0 fval) (the-as float ((the-as (function int int int int int) (-> arg0 factivate-func)) + (-> arg0 id) + 4 + a2-4 + (the-as int (-> arg0 fval)) + ) + ) + ) + ) + ) ) - ) ) - ) - (else - (+! (-> arg0 step-delay-ctr) -1) - ) - ) - ) - (set! (-> arg0 inc-delay-ctr) (-> arg0 inc-delay)) - (cond - ((-> arg0 float-p) - (when (-> arg0 factivate-func) - (let ((f0-8 (+ (-> arg0 fval) (* (the float (-> arg0 inc-dir)) (-> arg0 fstep))))) - (if (-> arg0 range-p) - (set! - f0-8 - (fmin (fmax f0-8 (-> arg0 frange-min)) (-> arg0 frange-max)) - ) - ) - (set! (-> arg0 fval) ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg press) f0-8 (-> arg0 fval))) + (debug-menu-item-var-update-display-str arg0) + (let ((a0-20 (-> arg0 parent context))) + (debug-menu-context-send-msg a0-20 (debug-menu-msg update) (debug-menu-dest current-selection)) ) - ) ) (else - (when (-> arg0 iactivate-func) - (let ((a2-4 (+ (-> arg0 ival) (* (-> arg0 inc-dir) (-> arg0 istep))))) - (if (-> arg0 range-p) - (set! a2-4 (min (max a2-4 (-> arg0 irange-min)) (-> arg0 irange-max))) - ) - (set! (-> arg0 ival) ((-> arg0 iactivate-func) (-> arg0 id) (debug-menu-msg press) a2-4 (-> arg0 ival))) - ) + (+! (-> arg0 inc-delay-ctr) -1) ) - ) ) - (debug-menu-item-var-update-display-str arg0) - (let ((a0-20 (-> arg0 parent context))) - (debug-menu-context-send-msg a0-20 (debug-menu-msg update) (debug-menu-dest current-selection)) - ) - ) - (else - (+! (-> arg0 inc-delay-ctr) -1) - ) ) + (else + (set! (-> arg0 inc-dir) 0) + 0 + ) ) - (else - (set! (-> arg0 inc-dir) 0) - ) - ) arg0 ) (defun debug-menu-item-var-msg ((arg0 debug-menu-item-var) (arg1 debug-menu-msg)) (cond - ((= arg1 (debug-menu-msg deactivate)) - (when (-> arg0 grabbed-joypad-p) - (let ((a0-1 (-> arg0 parent context))) - (debug-menu-context-release-joypad a0-1) - ) - (set! (-> arg0 grabbed-joypad-p) #f) - ) - ) - ((= arg1 (debug-menu-msg press)) - (when (not (-> arg0 grabbed-joypad-p)) - (let ((a0-2 (-> arg0 parent context))) - (when (debug-menu-context-grab-joypad a0-2 arg0 (the (function basic none) debug-menu-item-var-joypad-handler)) - (set! (-> arg0 grabbed-joypad-p) #t) - (set! (-> arg0 fundo-val) (-> arg0 fval)) - (set! (-> arg0 fundo-val) (-> arg0 fval)) - (set! (-> arg0 inc-dir) 0) + ((= arg1 (debug-menu-msg deactivate)) + (when (-> arg0 grabbed-joypad-p) + (let ((a0-1 (-> arg0 parent context))) + (debug-menu-context-release-joypad a0-1) + ) + (set! (-> arg0 grabbed-joypad-p) #f) ) - ) ) - ) - ((or (= arg1 (debug-menu-msg update)) (= arg1 (debug-menu-msg activate))) - (cond - ((-> arg0 float-p) - (if (-> arg0 factivate-func) - (set! (-> arg0 fval) ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg update) (-> arg0 fval) (-> arg0 fval))) + ((= arg1 (debug-menu-msg press)) + (when (not (-> arg0 grabbed-joypad-p)) + (let ((a0-2 (-> arg0 parent context))) + (when (debug-menu-context-grab-joypad a0-2 arg0 (the-as (function basic none) debug-menu-item-var-joypad-handler)) + (set! (-> arg0 grabbed-joypad-p) #t) + (set! (-> arg0 fundo-val) (-> arg0 fval)) + (set! (-> arg0 fundo-val) (-> arg0 fval)) + (set! (-> arg0 inc-dir) 0) + 0 + ) + ) ) - ) - (else - (if (-> arg0 iactivate-func) - (set! (-> arg0 ival) ((-> arg0 iactivate-func) (-> arg0 id) (debug-menu-msg update) (-> arg0 ival) (-> arg0 ival))) + ) + ((or (= arg1 (debug-menu-msg update)) (= arg1 (debug-menu-msg activate))) + (cond + ((-> arg0 float-p) + (if (-> arg0 factivate-func) + (set! (-> arg0 fval) + ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg update) (-> arg0 fval) (-> arg0 fval)) + ) + ) + ) + (else + (if (-> arg0 factivate-func) + (set! (-> arg0 fval) (the-as float ((the-as (function int int int int int) (-> arg0 factivate-func)) + (-> arg0 id) + 3 + (the-as int (-> arg0 fval)) + (the-as int (-> arg0 fval)) + ) + ) + ) + ) + ) ) - ) + (debug-menu-item-var-update-display-str arg0) + (set! (-> arg0 refresh-ctr) (-> arg0 refresh-delay)) ) - (debug-menu-item-var-update-display-str arg0) - (set! (-> arg0 refresh-ctr) (-> arg0 refresh-delay)) ) - ) arg0 ) (defun debug-menu-item-send-msg ((arg0 debug-menu-item) (arg1 debug-menu-msg)) "Call the appropriate message handler for the given item." (cond - ((= (-> arg0 type) debug-menu-item-submenu) - (debug-menu-item-submenu-msg (the-as debug-menu-item-submenu arg0) arg1) - ) - ((= (-> arg0 type) debug-menu-item-function) - (debug-menu-item-function-msg (the-as debug-menu-item-function arg0) arg1) - ) - ((= (-> arg0 type) debug-menu-item-flag) - (debug-menu-item-flag-msg (the-as debug-menu-item-flag arg0) arg1) - ) - ((= (-> arg0 type) debug-menu-item-var) - (debug-menu-item-var-msg (the-as debug-menu-item-var arg0) arg1) - ) - (else - (format 0 "ERROR: Found unknown item type!~%") + ((= (-> arg0 type) debug-menu-item-submenu) + (debug-menu-item-submenu-msg (the-as debug-menu-item-submenu arg0) arg1) + ) + ((= (-> arg0 type) debug-menu-item-function) + (debug-menu-item-function-msg (the-as debug-menu-item-function arg0) arg1) + ) + ((= (-> arg0 type) debug-menu-item-flag) + (debug-menu-item-flag-msg (the-as debug-menu-item-flag arg0) arg1) + ) + ((= (-> arg0 type) debug-menu-item-var) + (debug-menu-item-var-msg (the-as debug-menu-item-var arg0) arg1) + ) + (else + (format 0 "ERROR: Found unknown item type!~%") + ) ) - ) arg0 ) @@ -1393,96 +1423,100 @@ (let* ((s3-0 (-> arg0 items)) (s2-0 (car s3-0)) ) - (while (not (null? s3-0)) - (debug-menu-item-send-msg (the-as debug-menu-item s2-0) arg1) - (if (and arg2 (= (-> (the-as debug-menu-item s2-0) type) debug-menu-item-submenu)) - (debug-menu-send-msg (-> (the-as debug-menu-item-submenu s2-0) submenu) arg1 #t) - ) - (set! s3-0 (cdr s3-0)) - (set! s2-0 (car s3-0)) + (while (not (null? s3-0)) + (debug-menu-item-send-msg (the-as debug-menu-item s2-0) arg1) + (if (and arg2 (= (-> (the-as debug-menu-item s2-0) type) debug-menu-item-submenu)) + (debug-menu-send-msg (-> (the-as debug-menu-item-submenu s2-0) submenu) arg1 #t) + ) + (set! s3-0 (cdr s3-0)) + (set! s2-0 (car s3-0)) + ) ) - ) arg0 ) (defun debug-menu-context-send-msg ((arg0 debug-menu-context) (arg1 debug-menu-msg) (arg2 debug-menu-dest)) "Send the arg1 message to the given place." (cond - ((= arg2 (debug-menu-dest root)) - ;; sent to root, recursively. This will hit the whole menu. - (debug-menu-send-msg (-> arg0 root-menu) arg1 #t) - ) - ((= arg2 (debug-menu-dest open-menus)) - ;; only send to open things - (when (-> arg0 is-active) ;; only if context is open - (dotimes (s4-0 (-> arg0 sel-length)) ;; go through stack - (let ((a0-2 (-> arg0 sel-menu s4-0))) - ;; send, not recursive - (debug-menu-send-msg a0-2 arg1 #f) - ) - ) + ((= arg2 (debug-menu-dest root)) + ;; sent to root, recursively. This will hit the whole menu. + (debug-menu-send-msg (-> arg0 root-menu) arg1 #t) ) - ) - ((= arg2 (debug-menu-dest current-selection)) - (when (-> arg0 is-active) ;; context open - (if (nonzero? (-> arg0 sel-length)) ;; something in the stack - (debug-menu-send-msg (-> arg0 sel-menu (+ (-> arg0 sel-length) -1)) arg1 #f) ;; send to that. - ) + ((= arg2 (debug-menu-dest open-menus)) + ;; only send to open things + (when (-> arg0 is-active) ;; only if context is open + (dotimes (s4-0 (-> arg0 sel-length)) ;; go through stack + (let ((a0-2 (-> arg0 sel-menu s4-0))) + ;; send, not recursive + (debug-menu-send-msg a0-2 arg1 #f) + ) + ) + ) ) - ) - ((= arg2 (debug-menu-dest activation)) - ;; this is a special case for when we want to activate or deactivate something. - (cond - ((= arg1 (debug-menu-msg activate)) - (when (not (-> arg0 is-active)) - (set! (-> arg0 is-active) #t) - (debug-menu-context-send-msg arg0 (debug-menu-msg activate) (debug-menu-dest open-menus)) + ((= arg2 (debug-menu-dest current-selection)) + (when (-> arg0 is-active) ;; context open + (if (nonzero? (-> arg0 sel-length)) ;; something in the stack + (debug-menu-send-msg (-> arg0 sel-menu (+ (-> arg0 sel-length) -1)) arg1 #f) ;; send to that. + ) ) - ) - ((= arg1 (debug-menu-msg deactivate)) - (when (-> arg0 is-active) - (debug-menu-context-send-msg arg0 (debug-menu-msg deactivate) (debug-menu-dest open-menus)) - (set! (-> arg0 is-active) #f) + ) + ((= arg2 (debug-menu-dest activation)) + ;; this is a special case for when we want to activate or deactivate something. + (cond + ((= arg1 (debug-menu-msg activate)) + (when (not (-> arg0 is-active)) + (set! (-> arg0 is-active) #t) + (debug-menu-context-send-msg arg0 (debug-menu-msg activate) (debug-menu-dest open-menus)) + ) + ) + ((= arg1 (debug-menu-msg deactivate)) + (when (-> arg0 is-active) + (debug-menu-context-send-msg arg0 (debug-menu-msg deactivate) (debug-menu-dest open-menus)) + (set! (-> arg0 is-active) #f) + ) + ) ) - ) ) ) - ) arg0 ) (defun debug-menu-context-activate-selection ((arg0 debug-menu-context)) "Press on the selected thing. Note that we named this enum press, not activate." (let ((a0-1 (-> arg0 sel-menu (+ (-> arg0 sel-length) -1) selected-item))) - (debug-menu-item-send-msg a0-1 (debug-menu-msg press)) - ) + (debug-menu-item-send-msg a0-1 (debug-menu-msg press)) + ) arg0 ) (defun debug-menus-default-joypad-func ((arg0 debug-menu-context)) "Control the menu from the joystick" (cond - ((cpad-pressed? 0 square) - (if (< 1 (-> arg0 sel-length)) - (debug-menu-context-close-submenu arg0) - ) - ) - ((cpad-pressed? 0 x) - (debug-menu-context-activate-selection arg0) - ) - ((cpad-pressed? 0 up) - (debug-menu-context-select-new-item arg0 -1) - ) - ((cpad-pressed? 0 down) - (debug-menu-context-select-new-item arg0 1) - ) - ((cpad-pressed? 0 left) - (debug-menu-context-select-new-item arg0 -5) - ) - ((cpad-pressed? 0 right) - (debug-menu-context-select-new-item arg0 5) + ((cpad-pressed? 0 square) + (cond + ((< 1 (-> arg0 sel-length)) + (debug-menu-context-close-submenu arg0) + ) + (else + ) + ) + ) + ((cpad-pressed? 0 x) + (debug-menu-context-activate-selection arg0) + ) + ((cpad-pressed? 0 up) + (debug-menu-context-select-new-item arg0 -1) + ) + ((cpad-pressed? 0 down) + (debug-menu-context-select-new-item arg0 1) + ) + ((cpad-pressed? 0 left) + (debug-menu-context-select-new-item arg0 -5) + ) + ((cpad-pressed? 0 right) + (debug-menu-context-select-new-item arg0 5) + ) ) - ) arg0 ) diff --git a/goal_src/jak1/engine/debug/part-tester.gc b/goal_src/jak1/engine/debug/part-tester.gc index 75472f5bb01..7b195680ef8 100644 --- a/goal_src/jak1/engine/debug/part-tester.gc +++ b/goal_src/jak1/engine/debug/part-tester.gc @@ -17,20 +17,17 @@ (defpartgroup group-part-tester :id 105 :bounds (static-bspherem 0 0 0 1) :parts ((sp-item 56) (sp-item 57))) (deftype part-tester (process) - ((root trsqv :offset-assert 112) - (part sparticle-launch-control :offset-assert 116) - (old-group sparticle-launch-group :offset-assert 120) + ((root trsqv) + (part sparticle-launch-control) + (old-group sparticle-launch-group) ) :heap-base #x100 - :method-count-assert 14 - :size-assert #x7c - :flag-assert #xe0100007c ) (define-extern *part-tester* part-tester) (define *part-tester-name* (the-as string #f)) -(defmethod deactivate part-tester ((this part-tester)) +(defmethod deactivate ((this part-tester)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) diff --git a/goal_src/jak1/engine/debug/stats-h.gc b/goal_src/jak1/engine/debug/stats-h.gc index f0b81a51e42..0dd519a2e30 100644 --- a/goal_src/jak1/engine/debug/stats-h.gc +++ b/goal_src/jak1/engine/debug/stats-h.gc @@ -8,71 +8,59 @@ ;; DECOMP BEGINS (deftype tr-stat (structure) - ((groups uint16 :offset-assert 0) - (fragments uint16 :offset-assert 2) - (tris uint32 :offset-assert 4) - (dverts uint32 :offset-assert 8) - (instances uint16 :offset-assert 12) - (pad uint16 :offset-assert 14) + ((groups uint16) + (fragments uint16) + (tris uint32) + (dverts uint32) + (instances uint16) + (pad uint16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype merc-global-stats (structure) - ((merc tr-stat :inline :offset-assert 0) - (mercneric tr-stat :inline :offset-assert 16) + ((merc tr-stat :inline) + (mercneric tr-stat :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype perf-stat (structure) - ((frame-number uint32 :offset-assert 0) - (count uint32 :offset-assert 4) - (cycles uint32 :offset-assert 8) - (instructions uint32 :offset-assert 12) - (icache uint32 :offset-assert 16) - (dcache uint32 :offset-assert 20) - (select uint32 :offset-assert 24) - (ctrl uint32 :offset-assert 28) - (accum0 uint32 :offset-assert 32) - (accum1 uint32 :offset-assert 36) - (to-vu0-waits uint32 :offset-assert 40) - (to-spr-waits uint32 :offset-assert 44) - (from-spr-waits uint32 :offset-assert 48) + ((frame-number uint32) + (count uint32) + (cycles uint32) + (instructions uint32) + (icache uint32) + (dcache uint32) + (select uint32) + (ctrl uint32) + (accum0 uint32) + (accum1 uint32) + (to-vu0-waits uint32) + (to-spr-waits uint32) + (from-spr-waits uint32) ) :pack-me - :method-count-assert 14 - :size-assert #x34 - :flag-assert #xe00000034 (:methods - (perf-stat-method-9 (_type_) none 9) - (print-to-stream (_type_ string basic) none 10) - (reset! (_type_) none 11) - (read! (_type_) none 12) - (update-wait-stats (_type_ uint uint uint) none 13) + (perf-stat-method-9 (_type_) none) + (print-to-stream (_type_ string basic) none) + (reset! (_type_) none) + (read! (_type_) none) + (update-wait-stats (_type_ uint uint uint) none) ) ) (deftype perf-stat-array (inline-array-class) - ((data perf-stat :inline :dynamic :offset-assert 16) + ((data perf-stat :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> perf-stat-array heap-base) (the-as uint 52)) (define *pc-perf-stat-counter* (the-as uint 0)) -(defmethod reset! perf-stat ((this perf-stat)) +(defmethod reset! ((this perf-stat)) "Perfomance counters are partially implemented, they just count cycles." (+! (-> this count) 1) (when (nonzero? (-> this ctrl)) @@ -81,12 +69,12 @@ #| (let ((v1-0 (-> this ctrl))) (+! (-> this count) 1) - (b! (zero? v1-0) cfg-2) - (.mtc0 Perf r0-0) + (b! (zero? v1-0) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) (.sync.l) (.sync.p) - (.mtpc pcr0 r0-0) - (.mtpc pcr1 r0-0) + (.mtpc pcr0 0) + (.mtpc pcr1 0) (.sync.l) (.sync.p) (.mtc0 Perf v1-0) @@ -95,10 +83,11 @@ (.sync.p) (label cfg-2) |# + 0 (none) ) -(defmethod read! perf-stat ((this perf-stat)) +(defmethod read! ((this perf-stat)) "Perfomance counters are partially implemented, they just count cycles." (when (nonzero? (-> this ctrl)) (+! (-> this accum0) (- (get-cpu-clock) *pc-perf-stat-counter*)) @@ -106,8 +95,9 @@ ) #| - (b! (zero? (-> this ctrl)) cfg-2) - (.mtc0 Perf r0-0) + (local-vars (v1-1 int) (v1-3 int)) + (b! (zero? (-> this ctrl)) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) (.sync.l) (.sync.p) (.mfpc v1-1 pcr0) @@ -116,10 +106,11 @@ (+! (-> this accum1) v1-3) (label cfg-2) |# + 0 (none) ) -(defmethod update-wait-stats perf-stat ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) +(defmethod update-wait-stats ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) (when (nonzero? (-> this ctrl)) (+! (-> this to-vu0-waits) arg0) (+! (-> this to-spr-waits) arg1) diff --git a/goal_src/jak1/engine/debug/viewer.gc b/goal_src/jak1/engine/debug/viewer.gc index 9c3f0995ea6..86e8b3dc2f1 100644 --- a/goal_src/jak1/engine/debug/viewer.gc +++ b/goal_src/jak1/engine/debug/viewer.gc @@ -14,17 +14,14 @@ ) (deftype viewer (process-drawable) - ((janim art-joint-anim :offset-assert 176) + ((janim art-joint-anim) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states viewer-process ) ) + (define-extern *viewer* viewer) (defstate viewer-process (viewer) @@ -172,7 +169,7 @@ ) ) -(defmethod init-from-entity! viewer ((this viewer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this viewer) (arg0 entity-actor)) (set! *viewer* this) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) diff --git a/goal_src/jak1/engine/dma/dma-buffer.gc b/goal_src/jak1/engine/dma/dma-buffer.gc index 3210ea30eb0..d6cdc619c74 100644 --- a/goal_src/jak1/engine/dma/dma-buffer.gc +++ b/goal_src/jak1/engine/dma/dma-buffer.gc @@ -31,38 +31,30 @@ ;; Most DMA stuff goes directly to the VIF, so this is the ;; most common. (deftype dma-packet (structure) - ((dma dma-tag :offset-assert 0) - (vif0 vif-tag :offset-assert 8) - (vif1 vif-tag :offset-assert 12) ;; doesn't have to be a vif tag. - (quad uint128 :offset 0) + ((dma dma-tag) + (vif0 vif-tag) + (vif1 vif-tag) + (quad uint128 :overlay-at dma) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; seems to be unused? Also, it seems to be broken. Do not use this. (deftype dma-packet-array (inline-array-class) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) -(set! (-> dma-packet-array heap-base) 16) + + +(set! (-> dma-packet-array heap-base) (the-as uint 16)) ;; For doing a dma -> vif -> gif (path 2) transfer. (deftype dma-gif-packet (structure) - ((dma-vif dma-packet :inline :offset-assert 0) - (gif uint64 2 :offset-assert 16) ;; guess + ((dma-vif dma-packet :inline) + (gif uint64 2) ;; these two were added to make it easier. - (gif0 uint64 :offset 16) - (gif1 uint64 :offset 24) - - (quad uint128 2 :offset 0) + (gif0 uint64 :overlay-at (-> gif 0)) + (gif1 uint64 :overlay-at (-> gif 1)) + (quad uint128 2 :overlay-at (-> dma-vif dma)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; dma-buffer is a dynamically sized container for storing DMA data. @@ -70,62 +62,55 @@ ;; I added a data-buffer field that overlaps with data to get at the array of ;; bytes more easily. (deftype dma-buffer (basic) - ((allocated-length int32 :offset-assert 4) ;; number of bytes. - (base pointer :offset-assert 8) ;; first unused memory. - (end pointer :offset-assert 12) ;; ?? unused ?? - (data uint64 1 :offset-assert 16) ;; start of memory. - (data-buffer uint8 :dynamic :offset 16) ;; the actual dynamic array backing it. + ((allocated-length int32) ;; number of bytes. + (base pointer) ;; first unused memory. + (end pointer) ;; ?? unused ?? + (data uint64 1) ;; start of memory. + (data-buffer uint8 :dynamic :overlay-at (-> data 0)) ;; the actual dynamic array backing it. ) (:methods - (new (symbol type int) _type_ 0) - ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 + (new (symbol type int) _type_) + ) ) + (defmethod new dma-buffer ((allocation symbol) (type-to-make type) (arg0 int)) "Create a new dma-buffer with enough room to store arg0 bytes. Note that this does not set the end field." - (let ((v0-0 (object-new allocation type-to-make - (+ (+ arg0 -4) (the-as int (-> type-to-make size))) - ) - ) - ) + (let ((v0-0 (object-new allocation type-to-make (+ arg0 -4 (-> type-to-make size))))) (set! (-> v0-0 base) (-> v0-0 data)) (set! (-> v0-0 allocated-length) arg0) v0-0 ) ) -(defun dma-buffer-inplace-new ((this dma-buffer) (size int)) +(defun dma-buffer-inplace-new ((arg0 dma-buffer) (arg1 int)) "Create a dma-buffer in-place. Does not set the type of the dma-buffer object." - (set! (-> this base) (-> this data)) - (set! (-> this allocated-length) size) - this + (set! (-> arg0 base) (-> arg0 data)) + (set! (-> arg0 allocated-length) arg1) + arg0 ) -(defmethod length dma-buffer ((this dma-buffer)) +(defmethod length ((this dma-buffer)) "Get the amount of data the buffer can hold, in bytes." (-> this allocated-length) ) -(defmethod asize-of dma-buffer ((this dma-buffer)) +(defmethod asize-of ((this dma-buffer)) "Get the size in memory of the object" - (+ (+ (-> this allocated-length) -4) (the-as int (-> dma-buffer size))) + (+ (-> this allocated-length) -4 (-> dma-buffer size)) ) (defun dma-buffer-length ((arg0 dma-buffer)) "Get length used in quadwords, rounded down" - (shr (+ (&- (-> arg0 base) (-> arg0 data)) 15) 4) + (shr (+ (&- (-> arg0 base) (the-as uint (-> arg0 data))) 15) 4) ) (defun dma-buffer-free ((arg0 dma-buffer)) "Get the number of free quadwords, rounded down, between base and end pointers." - (shr (+ (&- (-> arg0 end) (-> arg0 base)) 15) 4) + (shr (+ (&- (-> arg0 end) (the-as uint (-> arg0 base))) 15) 4) ) - (defmacro dma-buffer-add-base-type (buf pkt dma-type &rest body) "Base macro for adding stuff to a dma-buffer. Don't use this directly!" @@ -157,7 +142,6 @@ ) ) - (defmacro dma-buffer-add-cnt-vif2 (buf qwc vif0 vif1) "Add a dma-packet to a dma-buffer. The packet is made up of a 'cnt' DMAtag (transfer qwc qwords of data after the tag and continue from after that point) @@ -256,9 +240,9 @@ (new 'static 'vif-tag :cmd (vif-cmd mpg) :num (shl qwc-now 1) :imm origin) ) ;; increment by qwc-now quadwords. - (&+! func-ptr (shl qwc-now 4)) + (&+! func-ptr (* qwc-now 16)) (set! qlen (- qlen qwc-now)) - (+! origin (shl qwc-now 1)) + (+! origin (* qwc-now 2)) ) ) ) @@ -268,29 +252,20 @@ (defun dma-buffer-send ((chan dma-bank) (buf dma-buffer)) "Send the DMA buffer! DOES NOT TRANSFER TAG, you probably want dma-buffer-send-chain instead." - (when (< (-> buf allocated-length) - (&- (-> buf base) (-> buf data)) - ) + (when (< (-> buf allocated-length) (&- (-> buf base) (-> buf data))) ;; oops. we overflowed the DMA buffer. die. (segfault) ) - (dma-send chan - (the-as uint (-> buf data)) - (the-as uint (dma-buffer-length buf)) - ) + (dma-send chan (the-as uint (-> buf data)) (the-as uint (dma-buffer-length buf))) ) (defun dma-buffer-send-chain ((chan dma-bank-source) (buf dma-buffer)) "Send the DMA buffer! Sends the tags" - (when (< (-> buf allocated-length) - (&- (-> buf base) (-> buf data)) - ) + (when (< (-> buf allocated-length) (&- (-> buf base) (-> buf data))) ;; oops. we overflowed the DMA buffer. die. (segfault) ) - (dma-send-chain chan - (the-as uint (-> buf data)) - ) + (dma-send-chain chan (the-as uint (-> buf data))) ) (defmacro dma-buffer-add-gs-set-flusha (buf &rest reg-list) diff --git a/goal_src/jak1/engine/dma/dma-disasm.gc b/goal_src/jak1/engine/dma/dma-disasm.gc index fcaf2da2a63..2d5d571de34 100644 --- a/goal_src/jak1/engine/dma/dma-disasm.gc +++ b/goal_src/jak1/engine/dma/dma-disasm.gc @@ -13,16 +13,13 @@ (declare-file (debug)) (deftype vif-disasm-element (structure) - ((mask uint32 :offset-assert 0) - (tag vif-cmd-32 :offset-assert 4) - (val uint32 :offset-assert 8) - (print uint32 :offset-assert 12) - (string1 string :offset-assert 16) - (string2 string :offset-assert 20) + ((mask uint32) + (tag vif-cmd-32) + (val uint32) + (print uint32) + (string1 string) + (string2 string) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (define *vif-disasm-table* diff --git a/goal_src/jak1/engine/dma/dma-h.gc b/goal_src/jak1/engine/dma/dma-h.gc index 2d540738f41..bb17e55238d 100644 --- a/goal_src/jak1/engine/dma/dma-h.gc +++ b/goal_src/jak1/engine/dma/dma-h.gc @@ -37,9 +37,6 @@ (str uint8 :offset 8 :size 1) ;; start! (tag uint16 :offset 16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (defmethod inspect dma-chcr ((obj dma-chcr)) @@ -60,18 +57,12 @@ (madr uint32 :offset 16) ;; memory address (qwc uint32 :offset 32) ;; quadword count ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; DMA register layout for channels supporting source-chain (deftype dma-bank-source (dma-bank) ((tadr uint32 :offset 48) ;; tag address ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; The DMA source chain supports a two-entry "call stack" of tags. @@ -80,9 +71,6 @@ ((as0 uint32 :offset 64) ;; pushed tag register (as1 uint32 :offset 80) ;; pushed tag register ) - :method-count-assert 9 - :size-assert #x54 - :flag-assert #x900000054 ) ;; The toSPR and fromSPR DMA channels require a second address in the scratchpad. @@ -90,9 +78,6 @@ (deftype dma-bank-spr (dma-bank-source) ((sadr uint32 :offset 128) ;; spad address. ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) ;; These addresses are the location of DMA banks for each channel. @@ -120,15 +105,11 @@ (std uint8 :offset 6 :size 2) (rcyc uint8 :offset 8 :size 3) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; D_ENABLEW, D_ENABLER? (deftype dma-enable (uint32) ((cpnd uint8 :offset 16 :size 1)) - :flag-assert #x900000004 ) ;; D_SQWC @@ -136,7 +117,6 @@ ((sqwc uint8 :offset 0 :size 8) (tqwc uint8 :offset 16 :size 8) ) - :flag-assert #x900000004 ) ;; Shared DMA control registers. @@ -151,29 +131,22 @@ (enabler uint32 :offset 5408) (enablew uint32 :offset 5520) ) - :method-count-assert 9 - :size-assert #x1594 - :flag-assert #x900001594 ) (defconstant DMA_CONTROL_BANK (the dma-bank-control (get-vm-ptr #x1000e000))) ;; Seems to be unused. The vu-function type is used instead. (deftype vu-code-block (basic) - ((name basic :offset-assert 4) - (code uint32 :offset-assert 8) - (size int32 :offset-assert 12) - (dest-address uint32 :offset-assert 16) + ((name basic) + (code uint32) + (size int32) + (dest-address uint32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; ?? not sure what this is. (deftype vu-stat (uint64) () - :flag-assert #x900000008 ) @@ -201,9 +174,6 @@ (addr uint32 :offset 32 :size 31) ;; address (31 bits) (spr uint8 :offset 63 :size 1) ;; spr or not flag. ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -312,14 +282,11 @@ ;; the addr field of their tag should point to the next bucket. ;; This is not a PS2 hardware thing (deftype dma-bucket (structure) - ((tag dma-tag :offset-assert 0) ;; the DMA tag to transfer the bucket's data - (last (pointer dma-tag) :offset-assert 8) ;; the last tag of this bucket. - (dummy uint32 :offset-assert 12) ;; empty space. - (next uint32 :offset 4) ;; this overlaps with the addr bit-field of the dma-tag + ((tag dma-tag :offset-assert 0) ;; the DMA tag to transfer the bucket's data + (last (pointer dma-tag)) ;; the last tag of this bucket. + (dummy uint32) ;; empty space. + (next uint32 :offset 4) ;; this overlaps with the addr bit-field of the dma-tag ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; guess - VIF_MASK register? @@ -341,7 +308,6 @@ (m14 uint8 :offset 28 :size 2) (m15 uint8 :offset 30 :size 2) ) - :flag-assert #x900000004 ) ;; the IMM field of a VIF STCYCL instruction @@ -349,7 +315,6 @@ ((cl uint8 :offset 0 :size 8) (wl uint8 :offset 8 :size 8) ) - :flag-assert #x900000002 ) ;; the IMM field of a VIF UNPACK instruction @@ -358,7 +323,6 @@ (usn uint8 :offset 14 :size 1) (flg uint8 :offset 15 :size 1) ) - :flag-assert #x900000002 ) @@ -422,9 +386,6 @@ (irq uint8 :offset 31 :size 1) (msk uint8 :offset 28 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (defmethod inspect vif-tag ((obj vif-tag)) diff --git a/goal_src/jak1/engine/draw/draw-node-h.gc b/goal_src/jak1/engine/draw/draw-node-h.gc index aece3287c4a..bca2b7e4ee2 100644 --- a/goal_src/jak1/engine/draw/draw-node-h.gc +++ b/goal_src/jak1/engine/draw/draw-node-h.gc @@ -19,39 +19,25 @@ ;; may occur at any depth, and nothing has visibility ids. (deftype draw-node (drawable) - ((child-count uint8 :offset 6) ;; if our child requires a count - (flags uint8 :offset 7) ;; is our children leaf or draw-node? - (child drawable :offset 8) ;; can be draw-node or any other drawable - (distance float :offset 12) ;; used in shrub... + ((child-count uint8 :offset 6) + (flags uint8 :offset 7) + (child drawable :offset 8) + (distance float :offset 12) ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 - ;; field distance is a float printed as hex? ) ;; for non-shrub uses of draw-node, this is used to store all the draw-nodes at a given depth. (deftype drawable-inline-array-node (drawable-inline-array) - ((data draw-node 1 :inline) - (pad uint32) + ((data draw-node 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x44 - :flag-assert #x1200000044 - ;; too many basic blocks - (:methods - - ) ) ;; the types of these fields are a guess for now. ;; used for draw-node-cull function (deftype draw-node-dma (structure) - ((banka draw-node 32 :inline :offset-assert 0) - (bankb draw-node 32 :inline :offset-assert 1024) + ((banka draw-node 32 :inline) + (bankb draw-node 32 :inline) ) - :method-count-assert 9 - :size-assert #x800 - :flag-assert #x900000800 ) diff --git a/goal_src/jak1/engine/draw/draw-node.gc b/goal_src/jak1/engine/draw/draw-node.gc index 6a3cf144724..646f713e4fb 100644 --- a/goal_src/jak1/engine/draw/draw-node.gc +++ b/goal_src/jak1/engine/draw/draw-node.gc @@ -19,7 +19,7 @@ ;; For an unknown reason, the input to the collision query (the box we're colliding with) is not. ;; It's stored in *collide-work* -(defmethod collide-with-box draw-node ((this draw-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this draw-node) (arg0 int) (arg1 collide-list)) "Find collisions with the box in the current collision query, add results to collide-list." ;; loop over ourself and our brothers @@ -34,7 +34,7 @@ (none) ) -(defmethod collide-y-probe draw-node ((this draw-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this draw-node) (arg0 int) (arg1 collide-list)) (dotimes (s3-0 arg0) (if (collide-cache-using-y-probe-test (-> this bsphere)) (collide-y-probe (-> this child) (the-as int (-> this child-count)) arg1) @@ -45,17 +45,18 @@ (none) ) -(defmethod collide-ray draw-node ((this draw-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this draw-node) (arg0 int) (arg1 collide-list)) (dotimes (s3-0 arg0) (if (collide-cache-using-line-sphere-test (-> this bsphere)) (collide-ray (-> this child) (the-as int (-> this child-count)) arg1) ) (&+! this 32) ) + 0 (none) ) -(defmethod collect-ambients draw-node ((this draw-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients ((this draw-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (dotimes (s2-0 arg1) (if (spheres-overlap? arg0 (the-as sphere (-> this bsphere))) (collect-ambients (-> this child) arg0 (the-as int (-> this child-count)) arg2) @@ -80,12 +81,12 @@ (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) (dotimes (s5-0 (-> this length)) - (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) - ) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) + ) this ) -(defmethod mem-usage drawable-inline-array-node ((this drawable-inline-array-node) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-node) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a drawable-inline-array-node. Only counts the nodes, doesn't count the node children." (set! (-> arg0 length) (max 62 (-> arg0 length))) (set! (-> arg0 data 61 name) "draw-node") @@ -97,30 +98,31 @@ this ) -(defmethod asize-of drawable-inline-array-node ((this drawable-inline-array-node)) +(defmethod asize-of ((this drawable-inline-array-node)) (the-as int (+ (-> drawable-inline-array-node size) (* (+ (-> this length) -1) 32))) ) -(defmethod collide-with-box drawable-inline-array-node ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) ;; call on the first in the array, then it will loop through all the brothers. - (collide-with-box (-> this data 0) (-> this length) arg1) + (collide-with-box (the-as drawable (-> this data)) (-> this length) arg1) 0 (none) ) -(defmethod collide-y-probe drawable-inline-array-node ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) - (collide-y-probe (-> this data 0) (-> this length) arg1) +(defmethod collide-y-probe ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) + (collide-y-probe (the-as drawable (-> this data)) (-> this length) arg1) 0 (none) ) -(defmethod collide-ray drawable-inline-array-node ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) - (collide-ray (-> this data 0) (-> this length) arg1) +(defmethod collide-ray ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) + (collide-ray (the-as drawable (-> this data)) (-> this length) arg1) + 0 (none) ) -(defmethod collect-ambients drawable-inline-array-node ((this drawable-inline-array-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) - (collect-ambients (-> this data 0) arg0 (-> this length) arg2) +(defmethod collect-ambients ((this drawable-inline-array-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) + (collect-ambients (the-as drawable (-> this data)) arg0 (-> this length) arg2) 0 (none) ) diff --git a/goal_src/jak1/engine/draw/drawable-actor-h.gc b/goal_src/jak1/engine/draw/drawable-actor-h.gc index 13aaada0454..2239cdcdb33 100644 --- a/goal_src/jak1/engine/draw/drawable-actor-h.gc +++ b/goal_src/jak1/engine/draw/drawable-actor-h.gc @@ -14,28 +14,23 @@ ;; the actual drawable is just a reference to the actor itself. (deftype drawable-actor (drawable) - ((actor entity-actor :offset 8) + ((actor entity-actor :offset 8) ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 ) ;; the tree of drawable-actors (deftype drawable-tree-actor (drawable-tree) () - :flag-assert #x1200000024 ) -;; array of drawable-actor. (deftype drawable-inline-array-actor (drawable-inline-array) - ((data drawable-actor 1 :inline) - (pad uint8 4)) - :flag-assert #x1200000044 + ((data drawable-actor 1 :inline) + (pad uint8 4) + ) ) - -(defmethod draw drawable-tree-actor ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) "Do nothing, actor data is not drawn." + 0 (none) ) diff --git a/goal_src/jak1/engine/draw/drawable-ambient-h.gc b/goal_src/jak1/engine/draw/drawable-ambient-h.gc index 035a556cf56..a2f7a028814 100644 --- a/goal_src/jak1/engine/draw/drawable-ambient-h.gc +++ b/goal_src/jak1/engine/draw/drawable-ambient-h.gc @@ -15,36 +15,31 @@ ;; each ambient also has a simple drawable that just contains a reference to the entity. ;; this is basically only used to collect the currently active ambients. (deftype drawable-ambient (drawable) - ((ambient entity-ambient :offset 8) + ((ambient entity-ambient :offset 8) ) - :method-count-assert 19 - :size-assert #x20 - :flag-assert #x1300000020 (:methods - (execute-ambient (_type_ vector) none 18) + (execute-ambient (_type_ vector) none) ) ) ;; a drawable-tree of all the ambients in a level. (deftype drawable-tree-ambient (drawable-tree) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) (deftype drawable-inline-array-ambient (drawable-inline-array) - ((data drawable-ambient 1 :inline) - (pad uint32)) - :flag-assert #x1200000044 + ((data drawable-ambient 1 :inline) + (pad uint32) + ) ) -(defmethod draw drawable-tree-ambient ((this drawable-tree-ambient) (arg0 drawable-tree-ambient) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-ambient) (arg0 drawable-tree-ambient) (arg1 display-frame)) "Do nothing - ambients are not drawn." + 0 (none) ) -(defmethod unpack-vis drawable-tree-ambient ((this drawable-tree-ambient) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree-ambient) (arg0 (pointer int8)) (arg1 (pointer int8))) "Do nothing - ambients do not use vis." arg1 ) @@ -55,23 +50,19 @@ ;; - daxter audio (sidekick) ;; - voicebox audio (also called sidekick in some places...) (deftype level-hint (process) - ((text-id-to-display text-id :offset-assert 112) - (sound-to-play string :offset-assert 116) - (trans vector :offset-assert 120) - (sound-id sound-id :offset-assert 124) - (mode symbol :offset-assert 128) - (total-time time-frame :offset-assert 136) - (total-off-time time-frame :offset-assert 144) - (last-time time-frame :offset-assert 152) - (voicebox handle :offset-assert 160) + ((text-id-to-display text-id) + (sound-to-play string) + (trans vector) + (sound-id sound-id) + (mode symbol) + (total-time time-frame) + (total-off-time time-frame) + (last-time time-frame) + (voicebox handle) ) - :heap-base #x40 - :method-count-assert 16 - :size-assert #xa8 - :flag-assert #x10004000a8 (:methods - (print-text (_type_) none 14) - (appeared-for-long-enough? (_type_) symbol 15) + (print-text (_type_) none) + (appeared-for-long-enough? (_type_) symbol) ) (:states (level-hint-ambient-sound string) @@ -84,12 +75,9 @@ ;; a list of ambients that are currently active. (deftype ambient-list (structure) - ((num-items int32 :offset-assert 0) - (items drawable-ambient 2048 :offset-assert 4) + ((num-items int32) + (items drawable-ambient 2048) ) - :method-count-assert 9 - :size-assert #x2004 - :flag-assert #x900002004 ) diff --git a/goal_src/jak1/engine/draw/drawable-group-h.gc b/goal_src/jak1/engine/draw/drawable-group-h.gc index 607c5df27b9..d090b2bd86d 100644 --- a/goal_src/jak1/engine/draw/drawable-group-h.gc +++ b/goal_src/jak1/engine/draw/drawable-group-h.gc @@ -13,14 +13,15 @@ ;; note that in general you shouldn't assume that calling "draw" on a group will actually call "draw" on all the members - ;; different children classes may specialize these methods. (same goes for all the methods) +;; decomp begins + (deftype drawable-group (drawable) - ((length int16 :offset 6) - (data drawable 1 :offset-assert 32) ;; note that you get 1 drawable in the type, the rest run off the end. + ((length int16 :offset 6) + (data drawable 1) ;; note that you get 1 drawable in the type, the rest run off the end. ) (:methods (new (symbol type int) _type_) ) - :flag-assert #x1200000024 ) ;; unused diff --git a/goal_src/jak1/engine/draw/drawable-group.gc b/goal_src/jak1/engine/draw/drawable-group.gc index 29931ce370f..609ba0c298e 100644 --- a/goal_src/jak1/engine/draw/drawable-group.gc +++ b/goal_src/jak1/engine/draw/drawable-group.gc @@ -9,11 +9,7 @@ (defmethod new drawable-group ((allocation symbol) (type-to-make type) (arg0 int)) "Allocate a drawable-group with enough room for arg0 drawables" - (let ((v0-0 (object-new allocation type-to-make - (the-as int (+ (-> type-to-make size) (* (+ arg0 -1) 4))) - ) - ) - ) + (let ((v0-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (+ arg0 -1) 4)))))) (set! (-> v0-0 length) arg0) v0-0 ) @@ -30,7 +26,7 @@ this ) -(defmethod print drawable-group ((this drawable-group)) +(defmethod print ((this drawable-group)) (format #t "#<~A @ #x~X [~D]" (-> this type) this (-> this length)) (dotimes (s5-0 (-> this length)) (format #t " ~A" (-> this data s5-0)) @@ -39,15 +35,15 @@ this ) -(defmethod length drawable-group ((this drawable-group)) +(defmethod length ((this drawable-group)) (-> this length) ) -(defmethod asize-of drawable-group ((this drawable-group)) +(defmethod asize-of ((this drawable-group)) (the-as int (+ (-> drawable-group size) (* (+ (-> this length) -1) 4))) ) -(defmethod mem-usage drawable-group ((this drawable-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) "drawable-group") (+! (-> arg0 data 0 count) 1) @@ -61,18 +57,18 @@ this ) -(defmethod login drawable-group ((this drawable-group)) +(defmethod login ((this drawable-group)) (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) ) this ) -(defmethod draw drawable-group ((this drawable-group) (arg0 drawable-group) (arg1 display-frame)) +(defmethod draw ((this drawable-group) (arg0 drawable-group) (arg1 display-frame)) (when (vis-cull (-> this id)) (when (sphere-cull (-> this bsphere)) (dotimes (s3-0 (-> this length)) - (draw (-> this data s3-0) (-> (the-as drawable-group arg0) data s3-0) arg1) + (draw (-> this data s3-0) (-> arg0 data s3-0) arg1) ) ) ) @@ -80,7 +76,7 @@ (none) ) -(defmethod collect-stats drawable-group ((this drawable-group)) +(defmethod collect-stats ((this drawable-group)) (when (vis-cull (-> this id)) (when (sphere-cull (-> this bsphere)) (dotimes (s5-0 (-> this length)) @@ -92,16 +88,11 @@ (none) ) - -(defmethod debug-draw drawable-group ((this drawable-group) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-group) (arg0 drawable) (arg1 display-frame)) (when (vis-cull (-> this id)) (when (sphere-cull (-> this bsphere)) (dotimes (s3-0 (-> this length)) - (debug-draw - (-> this data s3-0) - (-> (the-as drawable-group arg0) data s3-0) - arg1 - ) + (debug-draw (-> this data s3-0) (-> (the-as drawable-group arg0) data s3-0) arg1) ) ) ) @@ -109,9 +100,9 @@ (none) ) -(defmethod unpack-vis drawable-group ((this drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) - (dotimes (s4-0 (-> this length) arg1) +(defmethod unpack-vis ((this drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) + (dotimes (s4-0 (-> this length)) (set! arg1 (unpack-vis (-> this data s4-0) arg0 arg1)) ) arg1 - ) \ No newline at end of file + ) diff --git a/goal_src/jak1/engine/draw/drawable-h.gc b/goal_src/jak1/engine/draw/drawable-h.gc index b28c4ef8c12..a55d8195bc1 100644 --- a/goal_src/jak1/engine/draw/drawable-h.gc +++ b/goal_src/jak1/engine/draw/drawable-h.gc @@ -20,40 +20,30 @@ ;; DECOMP BEGINS (deftype drawable (basic) - ((id int16 :offset-assert 4) ;; ID number for visibility (not always used) - (bsphere vector :inline :offset-assert 16) ;; bounding sphere + ((id int16) ;; ID number for visibility (not always used) + (bsphere vector :inline) ;; bounding sphere ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 (:methods ;; initialize the drawable after it has been loaded. - (login (_type_) _type_ 9) + (login (_type_) _type_) ;; do some sort of drawing... this really does different things for different types. - (draw (_type_ _type_ display-frame) none 10) - + (draw (_type_ _type_ display-frame) none) ;; add collision meshes to the given collide list if they intersect the bounding box in *collide-work* ;; the integer argument can be used to call this method on an inline-array of drawables (only some support this) ;; this avoids the dynamic dispatch on each element of the array. - (collide-with-box (_type_ int collide-list) none 11) - + (collide-with-box (_type_ int collide-list) none) ;; similar to above, but only add if the collision mesh intersects with a "y probe" - (collide-y-probe (_type_ int collide-list) none 12) - + (collide-y-probe (_type_ int collide-list) none) ;; similar to above, but only add if the collision mesh intersects a ray of spheres. - (collide-ray (_type_ int collide-list) none 13) - + (collide-ray (_type_ int collide-list) none) ;; different for different types, but generally collects debug statistics like numbers of triangles - (collect-stats (_type_) none 14) - + (collect-stats (_type_) none) ;; different for different types, but usually does nothing. - (debug-draw (_type_ drawable display-frame) none 15) - + (debug-draw (_type_ drawable display-frame) none) ;; given VIS data (uncompressed), compute the visiblity bit string. - (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 16) - + (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8)) ;; find "ambients" inside the given sphere and add to list. - (collect-ambients (_type_ sphere int ambient-list) none 17) + (collect-ambients (_type_ sphere int ambient-list) none) ) ) @@ -61,11 +51,8 @@ ;; A drawable that simply draws a sphere and an error message at the origin of the bounding sphere. (deftype drawable-error (drawable) - ((name string :offset-assert 32) + ((name string) ) - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) (declare-type process-drawable process) diff --git a/goal_src/jak1/engine/draw/drawable-inline-array-h.gc b/goal_src/jak1/engine/draw/drawable-inline-array-h.gc index e2ab57c6fbf..51b743e8ef5 100644 --- a/goal_src/jak1/engine/draw/drawable-inline-array-h.gc +++ b/goal_src/jak1/engine/draw/drawable-inline-array-h.gc @@ -15,9 +15,6 @@ ;; DECOMP BEGINS (deftype drawable-inline-array (drawable) - ((length int16 :offset 6) + ((length int16 :offset 6) ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 ) diff --git a/goal_src/jak1/engine/draw/drawable-inline-array.gc b/goal_src/jak1/engine/draw/drawable-inline-array.gc index 09b27ed57e4..a85fa016229 100644 --- a/goal_src/jak1/engine/draw/drawable-inline-array.gc +++ b/goal_src/jak1/engine/draw/drawable-inline-array.gc @@ -9,24 +9,25 @@ ;; DECOMP BEGINS -(defmethod length drawable-inline-array ((this drawable-inline-array)) +(defmethod length ((this drawable-inline-array)) (-> this length) ) -(defmethod login drawable-inline-array ((this drawable-inline-array)) +(defmethod login ((this drawable-inline-array)) this ) -(defmethod draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) +(defmethod draw ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) + 0 (none) ) -(defmethod collect-stats drawable-inline-array ((this drawable-inline-array)) +(defmethod collect-stats ((this drawable-inline-array)) 0 (none) ) -(defmethod debug-draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame)) 0 (none) ) diff --git a/goal_src/jak1/engine/draw/drawable-tree-h.gc b/goal_src/jak1/engine/draw/drawable-tree-h.gc index c34bc487eda..dc175b66117 100644 --- a/goal_src/jak1/engine/draw/drawable-tree-h.gc +++ b/goal_src/jak1/engine/draw/drawable-tree-h.gc @@ -11,12 +11,11 @@ ;; for example, there might be a drawable-tree for all the tfrags, one for all the ties, etc. (deftype drawable-tree (drawable-group) () - :flag-assert #x1200000024 ) ;; a drawable-tree-array contains all the drawable-trees in a level. ;; usually there aren't too many drawable trees (~5-15) (deftype drawable-tree-array (drawable-group) - ((trees drawable-tree 1 :offset 32)) - :flag-assert #x1200000024 + ((trees drawable-tree 1 :overlay-at (-> data 0)) + ) ) diff --git a/goal_src/jak1/engine/draw/drawable-tree.gc b/goal_src/jak1/engine/draw/drawable-tree.gc index 87c5930c935..df4f1c02059 100644 --- a/goal_src/jak1/engine/draw/drawable-tree.gc +++ b/goal_src/jak1/engine/draw/drawable-tree.gc @@ -13,38 +13,40 @@ ;; DECOMP BEGINS -(defmethod draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) "Draw a drawable tree array. If the current level is set to special or special-vis, the draw is skipped." (let ((v1-1 (-> (scratchpad-object terrain-context) bsp lev-index))) (case (-> *level* level v1-1 display?) - (('special 'special-vis #f) - ) - (else - (dotimes (s3-0 (-> this length)) - (draw (-> this trees s3-0) (-> arg0 trees s3-0) arg1) - ) - ) + (('special 'special-vis #f) + ) + (else + (dotimes (s3-0 (-> this length)) + (draw (-> this trees s3-0) (-> arg0 trees s3-0) arg1) ) + ) + ) ) 0 (none) ) -(defmethod collect-stats drawable-tree-array ((this drawable-tree-array)) +(defmethod collect-stats ((this drawable-tree-array)) (dotimes (s5-0 (-> this length)) (collect-stats (-> this trees s5-0)) ) + 0 (none) ) -(defmethod debug-draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-array) (arg0 drawable) (arg1 display-frame)) (dotimes (s3-0 (-> this length)) (debug-draw (-> this trees s3-0) (-> (the-as drawable-tree-array arg0) trees s3-0) arg1) ) + 0 (none) ) -(defmethod unpack-vis drawable-tree ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) "Copy our visibility data from arg1 to arg0, unpacking it." (local-vars (t5-1 int)) diff --git a/goal_src/jak1/engine/draw/drawable.gc b/goal_src/jak1/engine/draw/drawable.gc index 57a603fc108..b3a38c5e73d 100644 --- a/goal_src/jak1/engine/draw/drawable.gc +++ b/goal_src/jak1/engine/draw/drawable.gc @@ -149,51 +149,51 @@ (none) ) -(defmethod login drawable ((this drawable)) +(defmethod login ((this drawable)) this ) -(defmethod draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod draw ((this drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) -(defmethod collide-with-box drawable ((this drawable) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) -(defmethod collide-y-probe drawable ((this drawable) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) -(defmethod collide-ray drawable ((this drawable) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) -(defmethod collect-ambients drawable ((this drawable) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients ((this drawable) (arg0 sphere) (arg1 int) (arg2 ambient-list)) 0 (none) ) -(defmethod collect-stats drawable ((this drawable)) +(defmethod collect-stats ((this drawable)) 0 (none) ) -(defmethod debug-draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) -(defmethod draw drawable-error ((this drawable-error) (arg0 drawable-error) (arg1 display-frame)) +(defmethod draw ((this drawable-error) (arg0 drawable-error) (arg1 display-frame)) (error-sphere arg0 (-> arg0 name)) (none) ) -(defmethod unpack-vis drawable ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) diff --git a/goal_src/jak1/engine/engine/connect.gc b/goal_src/jak1/engine/engine/connect.gc index 9c66c3a7da4..a0d28f0e71c 100644 --- a/goal_src/jak1/engine/engine/connect.gc +++ b/goal_src/jak1/engine/engine/connect.gc @@ -38,14 +38,11 @@ ;; These terminate on both ends with #f. (deftype connectable (structure) - ((next0 connectable :offset-assert 0) - (prev0 connectable :offset-assert 4) - (next1 connectable :offset-assert 8) - (prev1 connectable :offset-assert 12) + ((next0 connectable) + (prev0 connectable) + (next1 connectable) + (prev1 connectable) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -60,27 +57,22 @@ (declare-type engine basic) (deftype connection (connectable) - ((param0 basic :offset-assert 16) ;; often (function object object object object object) - (param1 int32 :offset-assert 20) - (param2 int32 :offset-assert 24) - (param3 int32 :offset-assert 28) - (quad uint128 2 :offset 0) + ((param0 basic) + (param1 int32) + (param2 int32) + (param3 int32) + (quad uint128 2 :overlay-at next0) ) - :method-count-assert 14 - :size-assert #x20 - :flag-assert #xe00000020 - ;; the params are loaded with a signed load, which is kinda weird... (:methods - (print (connection) _type_ 2) - (get-engine (connection) engine 9) - (get-process (connection) process 10) - (belongs-to-engine? (connection engine) symbol 11) - (belongs-to-process? (connection process) symbol 12) - (move-to-dead (connection) connection 13) + (get-engine (connection) engine) + (get-process (connection) process) + (belongs-to-engine? (connection engine) symbol) + (belongs-to-process? (connection process) symbol) + (move-to-dead (connection) connection) ) ) -(defmethod inspect connection ((this connection)) +(defmethod inspect ((this connection)) (format #t "[~8x] ~A~%" this 'connection) (format #t "~Tnext0: ~`connectable`P~%" (-> this next0)) (format #t "~Tprev0: ~`connectable`P~%" (-> this prev0)) @@ -102,50 +94,49 @@ ;; you can iterate over the connections, or run them. ;; the engine is dynamically sized based on how many connections it can store. + + (deftype engine (basic) - ((name basic :offset-assert 4) - (length int16 :offset-assert 8) ;; in use elts of the data array - (allocated-length int16 :offset-assert 10) ;; size of the data array - (engine-time time-frame :offset-assert 16) ;; frame that we last executed + ((name basic) + (length int16) + (allocated-length int16) + (engine-time time-frame) ;; frame that we last executed ;; terminating nodes for the next0/prev0 linked lists - (alive-list connectable :inline :offset-assert 32) - (alive-list-end connectable :inline :offset-assert 48) - (dead-list connectable :inline :offset-assert 64) - (dead-list-end connectable :inline :offset-assert 80) + (alive-list connectable :inline) + (alive-list-end connectable :inline) + (dead-list connectable :inline) + (dead-list-end connectable :inline) ;; storage for nodes. this is dynamically sized. - (data connection 1 :inline :offset-assert 96) + (data connection 1 :inline) ) - :method-count-assert 24 - :size-assert #x80 - :flag-assert #x1800000080 (:methods - (new (symbol type basic int) _type_ 0) - (inspect-all-connections (engine) engine 9) - (apply-to-connections (engine (function connectable none)) int 10) - (apply-to-connections-reverse (engine (function connectable none)) int 11) - (execute-connections (engine object) int 12) - (execute-connections-and-move-to-dead (engine object) int 13) - (execute-connections-if-needed (engine object) int 14) - (add-connection (engine process object object object object) connection 15) - (remove-from-process (engine process) int 16) - (remove-matching (engine (function connection engine symbol)) int 17) - (remove-all (engine) int 18) - (remove-by-param1 (engine object) int 19) - (remove-by-param2 (engine int) int 20) - (get-first-connectable (engine) connectable 21) - (get-last-connectable (engine) connectable 22) - (unknown-1 (engine (pointer uint32)) uint 23) + (new (symbol type basic int) _type_) + (inspect-all-connections (engine) engine) + (apply-to-connections (engine (function connectable none)) int) + (apply-to-connections-reverse (engine (function connectable none)) int) + (execute-connections (engine object) int) + (execute-connections-and-move-to-dead (engine object) int) + (execute-connections-if-needed (engine object) int) + (add-connection (engine process object object object object) connection) + (remove-from-process (engine process) int) + (remove-matching (engine (function connection engine symbol)) int) + (remove-all (engine) int) + (remove-by-param1 (engine object) int) + (remove-by-param2 (engine int) int) + (get-first-connectable (engine) connectable) + (get-last-connectable (engine) connectable) + (unknown-1 (engine (pointer uint32)) uint) ) ) -(defmethod belongs-to-process? connection ((this connection) (arg0 process)) +(defmethod belongs-to-process? ((this connection) (arg0 process)) "Does this connection belong to the given process?" (= arg0 ((method-of-type connection get-process) this)) ) -(defmethod print connection ((this connection)) +(defmethod print ((this connection)) "Print a connection and its parameters" (format #t "#" (-> this param0) @@ -157,7 +148,7 @@ this ) -(defmethod get-engine connection ((this connection)) +(defmethod get-engine ((this connection)) "Get the engine for this connection. This must be used on a live connection." ;; back up, until we get to the node that's inline on the engine. @@ -170,7 +161,7 @@ (the-as engine (&+ this -28)) ) -(defmethod get-process connection ((this connection)) +(defmethod get-process ((this connection)) "Get the process for this connection" ;; same trick as get-engine, but backs up using prev1 until we hit the process. @@ -183,7 +174,7 @@ (the-as process (&+ this -92)) ) -(defmethod belongs-to-engine? connection ((this connection) (arg0 engine)) +(defmethod belongs-to-engine? ((this connection) (arg0 engine)) "Check to see if this connection is located in the data section of the engine. This works on dead or alive connections." ;; we can be clever and just see if it has the right address. @@ -192,19 +183,19 @@ ) ) -(defmethod get-first-connectable engine ((this engine)) +(defmethod get-first-connectable ((this engine)) "Get the first connectable on the alive list. This should be a valid connection." (-> this alive-list next0) ) -(defmethod get-last-connectable engine ((this engine)) +(defmethod get-last-connectable ((this engine)) "Get the last connectable on the alive list. I think the returned connectable is invalid." (-> this alive-list-end) ) -(defmethod unknown-1 engine ((this engine) (arg0 (pointer uint32))) +(defmethod unknown-1 ((this engine) (arg0 (pointer uint32))) "Not clear what this does. Possibly get next." (the-as uint32 (-> arg0 0)) ) @@ -268,13 +259,13 @@ this ) -(defmethod print engine ((this engine)) +(defmethod print ((this engine)) "Print an engine and its name" (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) this ) -(defmethod inspect engine ((this engine)) +(defmethod inspect ((this engine)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tengine-time: ~D~%" (-> this engine-time)) @@ -308,19 +299,19 @@ this ) -(defmethod length engine ((this engine)) +(defmethod length ((this engine)) "Get the in-use length of an engine" (-> this length) ) -(defmethod asize-of engine ((this engine)) +(defmethod asize-of ((this engine)) "Get the size in memory of an engine" (the-as int (+ (-> engine size) (the-as uint (shl (+ (-> this allocated-length) -1) 5))) ) ) -(defmethod apply-to-connections engine ((this engine) (f (function connectable none))) +(defmethod apply-to-connections ((this engine) (f (function connectable none))) "Apply f to all connections for the engine. It's okay to have f remove the connection." (let* ((current (-> this alive-list next0)) ;; need to get this _before_ running f, in case we remove. @@ -335,7 +326,7 @@ 0 ) -(defmethod apply-to-connections-reverse engine ((this engine) (f (function connectable none))) +(defmethod apply-to-connections-reverse ((this engine) (f (function connectable none))) "Apply f to all connections, reverse order. Do not use f to remove yourself from the list." (let ((iter (-> this alive-list-end prev0))) @@ -347,7 +338,7 @@ 0 ) -(defmethod execute-connections engine ((this engine) (arg0 object)) +(defmethod execute-connections ((this engine) (arg0 object)) "Run the engine!" ;; remember when @@ -364,7 +355,7 @@ 0 ) -(defmethod execute-connections-and-move-to-dead engine ((this engine) (arg0 object)) +(defmethod execute-connections-and-move-to-dead ((this engine) (arg0 object)) "Run the engine! If any objects return 'dead, then remove them" (set! (-> this engine-time) (-> *display* real-frame-counter)) (let ((ct (the-as connection (-> this alive-list-end prev0)))) @@ -383,7 +374,7 @@ 0 ) -(defmethod execute-connections-if-needed engine ((this engine) (arg0 object)) +(defmethod execute-connections-if-needed ((this engine) (arg0 object)) "Execute connections, but only if it hasn't been done on this frame." (when (!= (-> *display* real-frame-counter) (-> this engine-time)) (execute-connections this arg0) @@ -405,7 +396,7 @@ ) (when *debug-segment* - (defmethod inspect-all-connections engine ((this engine)) + (defmethod inspect-all-connections ((this engine)) "inspect all of the connections." (apply-to-connections this (the (function connection none) (method-of-type connection inspect))) @@ -458,7 +449,7 @@ ) -(defmethod move-to-dead connection ((this connection)) +(defmethod move-to-dead ((this connection)) "Move this connection from the alive list to the dead list" (local-vars (v1-1 engine)) ;; get our engine @@ -496,7 +487,7 @@ (set! v0-1 0) ) -(defmethod remove-from-process engine ((this engine) (proc process)) +(defmethod remove-from-process ((this engine) (proc process)) "Remove all connections from process for this engine" (local-vars (iter connection)) (when proc @@ -512,7 +503,7 @@ ) 0) -(defmethod remove-matching engine ((this engine) (arg0 (function connection engine symbol))) +(defmethod remove-matching ((this engine) (arg0 (function connection engine symbol))) "call the given function on each connection and the engine. if it returns truthy, move to dead that connection." (local-vars @@ -531,7 +522,7 @@ ) 0) -(defmethod remove-all engine ((this engine)) +(defmethod remove-all ((this engine)) "Remove all connections from an engine" (local-vars (a0-1 connectable) @@ -547,7 +538,7 @@ ) 0) -(defmethod remove-by-param1 engine ((this engine) (p1-value object)) +(defmethod remove-by-param1 ((this engine) (p1-value object)) "Remove all connections with param1 matching arg0" (let* ((current (-> this alive-list next0)) (next (-> current next0)) @@ -563,7 +554,7 @@ 0 ) -(defmethod remove-by-param2 engine ((this engine) (p2-value int)) +(defmethod remove-by-param2 ((this engine) (p2-value int)) "Remove all connections with param2 matching p2-value" (let* ((current (-> this alive-list next0)) (next (-> current next0)) diff --git a/goal_src/jak1/engine/entity/actor-link-h.gc b/goal_src/jak1/engine/entity/actor-link-h.gc index 12bab7ff811..266b6d06386 100644 --- a/goal_src/jak1/engine/entity/actor-link-h.gc +++ b/goal_src/jak1/engine/entity/actor-link-h.gc @@ -62,32 +62,29 @@ ;; These are allocated on the process heap of the entity's process. (deftype actor-link-info (basic) - ((process process :offset-assert 4) ;; process for this entity - (next entity-actor :offset-assert 8) ;; next entity in the list - (prev entity-actor :offset-assert 12) ;; prev entity in the list + ((process process) + (next entity-actor) + (prev entity-actor) ) - :method-count-assert 26 - :size-assert #x10 - :flag-assert #x1a00000010 (:methods - (new (symbol type process) _type_ 0) - (get-matching-actor-type-mask (_type_ type) int 9) - (actor-count-before (_type_) int 10) - (link-to-next-and-prev-actor (_type_) entity-actor 11) - (get-next (_type_) entity-actor 12) - (get-prev (_type_) entity-actor 13) - (get-next-process (_type_) process 14) - (get-prev-process (_type_) process 15) - (apply-function-forward (_type_ (function entity-actor object object) object) int 16) - (apply-function-reverse (_type_ (function entity-actor object object) object) int 17) - (apply-all (_type_ (function entity-actor object object) object) int 18) - (send-to-all (_type_ symbol) none 19) - (send-to-all-after (_type_ symbol) object 20) - (send-to-all-before (_type_ symbol) object 21) - (send-to-next-and-prev (_type_ symbol) none 22) - (send-to-next (_type_ symbol) none 23) - (send-to-prev (_type_ symbol) none 24) - (actor-count (_type_) int 25) + (new (symbol type process) _type_) + (get-matching-actor-type-mask (_type_ type) int) + (actor-count-before (_type_) int) + (link-to-next-and-prev-actor (_type_) entity-actor) + (get-next (_type_) entity-actor) + (get-prev (_type_) entity-actor) + (get-next-process (_type_) process) + (get-prev-process (_type_) process) + (apply-function-forward (_type_ (function entity-actor object object) object) int) + (apply-function-reverse (_type_ (function entity-actor object object) object) int) + (apply-all (_type_ (function entity-actor object object) object) int) + (send-to-all (_type_ symbol) none) + (send-to-all-after (_type_ symbol) object) + (send-to-all-before (_type_ symbol) object) + (send-to-next-and-prev (_type_ symbol) none) + (send-to-next (_type_ symbol) none) + (send-to-prev (_type_ symbol) none) + (actor-count (_type_) int) ) ) @@ -95,14 +92,14 @@ ;; Link Setup ;;;;;;;;;;;;;;;; -(defmethod next-actor entity-actor ((this entity-actor)) +(defmethod next-actor ((this entity-actor)) "Utility function to look up the next actor in the list, assuming we don't have actor-link-info yet." (declare (inline)) ;; look up reference to next-actor - this is slow. (entity-actor-lookup this 'next-actor 0) ) -(defmethod prev-actor entity-actor ((this entity-actor)) +(defmethod prev-actor ((this entity-actor)) "Look up previous actor in the list" (declare (inline)) (entity-actor-lookup this 'prev-actor 0) @@ -126,26 +123,26 @@ ;;;;;;;;;;;;;;;;;;;; ;; These methods can now be used to get next/prev more efficiently, without having to do a res lookup. -(defmethod get-next actor-link-info ((this actor-link-info)) +(defmethod get-next ((this actor-link-info)) (-> this next) ) -(defmethod get-prev actor-link-info ((this actor-link-info)) +(defmethod get-prev ((this actor-link-info)) (-> this prev) ) -(defmethod get-next-process actor-link-info ((this actor-link-info)) +(defmethod get-next-process ((this actor-link-info)) "Get the process for the next, if it exists." ;; we can't easily get to the actor-link-info of the next, so we have to grab it from entity-links. (the-as process (and (-> this next) (-> this next extra process))) ) -(defmethod get-prev-process actor-link-info ((this actor-link-info)) +(defmethod get-prev-process ((this actor-link-info)) "Get the process for the prev, if it exists" (the-as process (and (-> this prev) (-> this prev extra process))) ) -(defmethod link-to-next-and-prev-actor actor-link-info ((this actor-link-info)) +(defmethod link-to-next-and-prev-actor ((this actor-link-info)) "Redo the linking in the constructor by looking up the next/prev actor." (set! (-> this next) (next-actor (-> this process entity))) (set! (-> this prev) (prev-actor (-> this process entity))) @@ -183,7 +180,7 @@ 0 ) -(defmethod apply-all actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) +(defmethod apply-all ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) "Apply to all entities. Starts at the back and hits everyone, including this object." ;; start at us (next may give us #f here, so can't do that.) (let ((s4-0 (-> this process entity))) @@ -204,7 +201,7 @@ 0 ) -(defmethod send-to-all-after actor-link-info ((this actor-link-info) (message symbol)) +(defmethod send-to-all-after ((this actor-link-info) (message symbol)) "Send an event to all processes after this link with no parameters." (let ((iter (-> this next)) @@ -221,7 +218,7 @@ ) ) -(defmethod send-to-all-before actor-link-info ((this actor-link-info) (message symbol)) +(defmethod send-to-all-before ((this actor-link-info) (message symbol)) "Send an event to all processes before this link with no parameters." (let ((iter (-> this prev)) @@ -238,7 +235,7 @@ ) ) -(defmethod send-to-next actor-link-info ((this actor-link-info) (message symbol)) +(defmethod send-to-next ((this actor-link-info) (message symbol)) "Send event arg0 to the next actor's process" (let ((a0-1 (-> this next))) @@ -256,7 +253,7 @@ (none) ) -(defmethod send-to-prev actor-link-info ((this actor-link-info) (message symbol)) +(defmethod send-to-prev ((this actor-link-info) (message symbol)) "Send event arg1 to the next actor's process." (let ((a0-1 (-> this prev))) @@ -271,7 +268,7 @@ (none) ) -(defmethod send-to-next-and-prev actor-link-info ((this actor-link-info) (msg symbol)) +(defmethod send-to-next-and-prev ((this actor-link-info) (msg symbol)) "Send an event to both next and prev with no params." (send-to-next this msg) @@ -279,13 +276,13 @@ (none) ) -(defmethod send-to-all actor-link-info ((this actor-link-info) (msg symbol)) +(defmethod send-to-all ((this actor-link-info) (msg symbol)) (send-to-all-after this msg) (send-to-all-before this msg) (none) ) -(defmethod actor-count actor-link-info ((this actor-link-info)) +(defmethod actor-count ((this actor-link-info)) "Count the number of actors in the entire list" (let ((actor (-> this process entity)) (count 0) @@ -303,7 +300,7 @@ ) ) -(defmethod get-matching-actor-type-mask actor-link-info ((this actor-link-info) (matching-type type)) +(defmethod get-matching-actor-type-mask ((this actor-link-info) (matching-type type)) "Iterate through _all_ actors that are part of this actor list. If the nth actor is type matching-type, then set the nth bit of the result." (let ((actor (the-as entity-actor (-> this process entity))) @@ -332,7 +329,7 @@ ) ) -(defmethod actor-count-before actor-link-info ((this actor-link-info)) +(defmethod actor-count-before ((this actor-link-info)) "Get the number of actors _before_ this actor in the list." (let* ((this-actor (-> this process entity)) (actor this-actor) diff --git a/goal_src/jak1/engine/entity/ambient.gc b/goal_src/jak1/engine/entity/ambient.gc index bad301131ec..daf32a0149d 100644 --- a/goal_src/jak1/engine/entity/ambient.gc +++ b/goal_src/jak1/engine/entity/ambient.gc @@ -10,7 +10,7 @@ ;; DECOMP BEGINS -(defmethod mem-usage drawable-ambient ((this drawable-ambient) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-ambient) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 50 (-> arg0 length))) (set! (-> arg0 data 49 name) "ambient") (+! (-> arg0 data 49 count) 1) @@ -22,7 +22,7 @@ (the-as drawable-ambient 0) ) -(defmethod mem-usage drawable-inline-array-ambient ((this drawable-inline-array-ambient) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-ambient) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -362,7 +362,7 @@ (none) ) -(defmethod print-text level-hint ((this level-hint)) +(defmethod print-text ((this level-hint)) (when (!= *common-text* #f) (let ((s5-0 (new 'stack 'font-context *font-default-matrix* 56 160 0.0 (font-color default) (font-flags shadow kerning)) @@ -382,7 +382,7 @@ (none) ) -(defmethod appeared-for-long-enough? level-hint ((this level-hint)) +(defmethod appeared-for-long-enough? ((this level-hint)) (and (!= (-> this next-state name) 'level-hint-sidekick) (< (seconds 5) (-> this total-time))) ) @@ -971,7 +971,7 @@ (none) ) -(defmethod collect-ambients drawable-ambient ((this drawable-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients ((this drawable-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (dotimes (s2-0 arg1) (when (spheres-overlap? arg0 (the-as sphere (-> this bsphere))) (set! (-> arg2 items (-> arg2 num-items)) this) @@ -983,19 +983,19 @@ (none) ) -(defmethod collect-ambients drawable-inline-array-ambient ((this drawable-inline-array-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients ((this drawable-inline-array-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (collect-ambients (the-as drawable-ambient (-> this data)) arg0 (-> this length) arg2) 0 (none) ) -(defmethod collect-ambients drawable-tree-ambient ((this drawable-tree-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients ((this drawable-tree-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (collect-ambients (-> this data 0) arg0 (-> this length) arg2) 0 (none) ) -(defmethod birth-ambient! entity-ambient ((this entity-ambient)) +(defmethod birth-ambient! ((this entity-ambient)) (set! (-> this ambient-data quad) (the-as uint128 0)) (set! (-> this ambient-data function) ambient-type-error) (case (res-lump-struct this 'type structure) @@ -1091,7 +1091,7 @@ (define *execute-ambients* #t) -(defmethod execute-ambient drawable-ambient ((this drawable-ambient) (arg0 vector)) +(defmethod execute-ambient ((this drawable-ambient) (arg0 vector)) ((-> this ambient ambient-data function) this arg0) 0 (none) @@ -1099,7 +1099,7 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. -(defmethod draw-debug entity-ambient ((this entity-ambient)) +(defmethod draw-debug ((this entity-ambient)) (local-vars (sv-16 uint128)) (let ((gp-0 (-> this trans)) (s5-0 (res-lump-struct this 'type symbol)) diff --git a/goal_src/jak1/engine/entity/entity-h.gc b/goal_src/jak1/engine/entity/entity-h.gc index d27fc694431..f473e0b49ad 100644 --- a/goal_src/jak1/engine/entity/entity-h.gc +++ b/goal_src/jak1/engine/entity/entity-h.gc @@ -24,170 +24,137 @@ (define *generate-actor-vis-output* #f) (deftype entity-perm (structure) - ((user-object object 2 :offset-assert 0) - (user-uint64 uint64 :offset 0) - (user-float float 2 :offset 0) - (user-int32 int32 2 :offset 0) - (user-uint32 uint32 2 :offset 0) - (user-int16 int16 4 :offset 0) - (user-uint16 uint16 4 :offset 0) - (user-int8 int8 8 :offset 0) - (user-uint8 uint8 8 :offset 0) - (status entity-perm-status :offset-assert 8) - (dummy uint8 1 :offset-assert 10) - (task game-task :offset-assert 11) - (aid actor-id :offset-assert 12) - (quad uint128 :offset 0) + ((user-object object 2) + (user-uint64 uint64 :overlay-at (-> user-object 0)) + (user-float float 2 :overlay-at (-> user-object 0)) + (user-int32 int32 2 :overlay-at (-> user-object 0)) + (user-uint32 uint32 2 :overlay-at (-> user-object 0)) + (user-int16 int16 4 :overlay-at (-> user-object 0)) + (user-uint16 uint16 4 :overlay-at (-> user-object 0)) + (user-int8 int8 8 :overlay-at (-> user-object 0)) + (user-uint8 uint8 8 :overlay-at (-> user-object 0)) + (status entity-perm-status) + (dummy uint8 1) + (task game-task) + (aid actor-id) + (quad uint128 :overlay-at (-> user-object 0)) ) :pack-me - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (update-perm! (_type_ symbol entity-perm-status) _type_ 9) + (update-perm! (_type_ symbol entity-perm-status) _type_) ) ) (deftype entity-links (structure) - ((prev-link entity-links :offset-assert 0) - (next-link entity-links :offset-assert 4) - (entity entity :offset-assert 8) - (process process :offset-assert 12) - (level level :offset-assert 16) - (vis-id int32 :offset-assert 20) - (trans vector :inline :offset-assert 32) - (perm entity-perm :inline :offset-assert 48) - (status uint16 :offset 56) - (aid actor-id :offset 60) - (task game-task :offset 59) + ((prev-link entity-links) + (next-link entity-links) + (entity entity) + (process process) + (level level) + (vis-id int32) + (trans vector :inline) + (perm entity-perm :inline) + (status uint16 :overlay-at (-> perm status)) + (aid actor-id :overlay-at (-> perm aid)) + (task game-task :overlay-at (-> perm task)) ) - :method-count-assert 10 - :size-assert #x40 - :flag-assert #xa00000040 (:methods - (birth? (_type_ vector) symbol 9) + (birth? (_type_ vector) symbol) ) ) (deftype entity-perm-array (inline-array-class) - ((data entity-perm :inline :dynamic :offset-assert 16) + ((data entity-perm :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> entity-perm-array heap-base) (the-as uint 16)) (deftype entity-links-array (inline-array-class) - ((data entity-links :inline :dynamic :offset-assert 16) + ((data entity-links :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> entity-links-array heap-base) (the-as uint 64)) (deftype entity (res-lump) - ((trans vector :inline :offset-assert 32) - (aid uint32 :offset-assert 48) + ((trans vector :inline) + (aid uint32) ) - :method-count-assert 27 - :size-assert #x34 - :flag-assert #x1b00000034 (:methods - (birth! (_type_) _type_ 22) - (kill! (_type_) _type_ 23) - (add-to-level! (_type_ level-group level actor-id) none 24) - (remove-from-level! (_type_ level-group) _type_ 25) - (get-level (_type_) level 26) + (birth! (_type_) _type_) + (kill! (_type_) _type_) + (add-to-level! (_type_ level-group level actor-id) none) + (remove-from-level! (_type_ level-group) _type_) + (get-level (_type_) level) ) ) (deftype entity-camera (entity) - ((connect connectable :inline :offset-assert 64) + ((connect connectable :inline) ) - :method-count-assert 27 - :size-assert #x50 - :flag-assert #x1b00000050 ) (deftype entity-ambient-data (structure) - ((user-object object 3 :offset-assert 0) - (function (function drawable-ambient vector none) :offset-assert 12) - (quad uint128 :offset 0) - (user-uint64 uint64 1 :offset 0) - (user-float float 3 :offset 0) - (user-int32 int32 3 :offset 0) - (user-uint32 uint32 3 :offset 0) - (user-int16 int16 6 :offset 0) - (user-uint16 uint16 6 :offset 0) - (user-int8 int8 12 :offset 0) - (user-uint8 uint8 12 :offset 0) + ((user-object object 3) + (function (function drawable-ambient vector none)) + (quad uint128 :overlay-at (-> user-object 0)) + (user-uint64 uint64 1 :overlay-at (-> user-object 0)) + (user-float float 3 :overlay-at (-> user-object 0)) + (user-int32 int32 3 :overlay-at (-> user-object 0)) + (user-uint32 uint32 3 :overlay-at (-> user-object 0)) + (user-int16 int16 6 :overlay-at (-> user-object 0)) + (user-uint16 uint16 6 :overlay-at (-> user-object 0)) + (user-int8 int8 12 :overlay-at (-> user-object 0)) + (user-uint8 uint8 12 :overlay-at (-> user-object 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype entity-ambient-data-array (inline-array-class) - ((data entity-ambient-data :inline :dynamic :offset-assert 16) + ((data entity-ambient-data :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> entity-ambient-data-array heap-base) (the-as uint 16)) (deftype entity-ambient (entity) - ((ambient-data entity-ambient-data :score 50 :offset 24) ;; added! + ((ambient-data entity-ambient-data :overlay-at extra) ) - :method-count-assert 29 - :size-assert #x34 - :flag-assert #x1d00000034 (:methods - (draw-debug (_type_) none 27) - (birth-ambient! (_type_) none 28) + (draw-debug (_type_) none) + (birth-ambient! (_type_) none) ) ) (deftype entity-actor (entity) - ((nav-mesh nav-mesh :offset-assert 52) - (etype type :offset-assert 56) - (task game-task :offset-assert 60) - (vis-id uint16 :offset-assert 62) - (vis-id-signed int16 :offset 62) ;; added - (quat quaternion :inline :offset-assert 64) + ((nav-mesh nav-mesh) + (etype type) + (task game-task) + (vis-id uint16) + (vis-id-signed int16 :overlay-at vis-id) + (quat quaternion :inline) ) - :method-count-assert 31 - :size-assert #x50 - :flag-assert #x1f00000050 (:methods - (next-actor (_type_) entity-actor 27) - (prev-actor (_type_) entity-actor 28) - (debug-print (_type_ symbol type) none 29) - (set-or-clear-status! (_type_ entity-perm-status symbol) none 30) + (next-actor (_type_) entity-actor) + (prev-actor (_type_) entity-actor) + (debug-print (_type_ symbol type) none) + (set-or-clear-status! (_type_ entity-perm-status symbol) none) ) ) (deftype entity-info (basic) - ((ptype type :offset-assert 4) - (package basic :offset-assert 8) - (art-group pair :offset-assert 12) - (pool basic :offset-assert 16) - (heap-size int32 :offset-assert 20) + ((ptype type) + (package basic) + (art-group pair) + (pool basic) + (heap-size int32) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; NOTE - this is a strange pattern...this symbol isn't defined until a later file 'navigate' @@ -198,19 +165,11 @@ ) (deftype actor-bank (basic) - ((pause-dist float :offset-assert 4) - (birth-dist float :offset-assert 8) - (birth-max int32 :offset-assert 12) + ((pause-dist float) + (birth-dist float) + (birth-max int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) -(define *ACTOR-bank* - (new 'static 'actor-bank - :pause-dist (meters 50) ;; actor activity range? - :birth-dist (meters 220) ;; draw distance or something? - :birth-max 10 ;; maximum actor births per frame? (it is known they dont all happen at once) - ) - ) + +(define *ACTOR-bank* (new 'static 'actor-bank :pause-dist (meters 50) :birth-dist (meters 220) :birth-max 10)) diff --git a/goal_src/jak1/engine/entity/entity.gc b/goal_src/jak1/engine/entity/entity.gc index 916f74d2dd1..ecbecaca77b 100644 --- a/goal_src/jak1/engine/entity/entity.gc +++ b/goal_src/jak1/engine/entity/entity.gc @@ -20,7 +20,7 @@ ;; entity basic methods ;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod mem-usage drawable-actor ((this drawable-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-actor) (arg0 memory-usage-block) (arg1 int)) "Update memory use for a drawable-actor" (set! (-> arg0 length) (max 44 (-> arg0 length))) (set! (-> arg0 data 43 name) "entity") @@ -35,7 +35,7 @@ (the-as drawable-actor 0) ) -(defmethod mem-usage drawable-inline-array-actor ((this drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) "update memory use for a group of drawable actors." (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) @@ -50,12 +50,12 @@ (the-as drawable-inline-array-actor 0) ) -(defmethod print entity-links ((this entity-links)) +(defmethod print ((this entity-links)) (format #t "#" (-> this process) this) this ) -(defmethod print entity-perm ((this entity-perm)) +(defmethod print ((this entity-perm)) (format #t "#" (-> this aid) (-> this task) @@ -66,19 +66,19 @@ this ) -(defmethod birth! entity ((this entity)) +(defmethod birth! ((this entity)) "children of entity should override this." (format #t "birth ~A~%" this) this ) -(defmethod kill! entity ((this entity)) +(defmethod kill! ((this entity)) "children of entity should override this." (format #t "kill ~A~%" this) this ) -(defmethod print entity ((this entity)) +(defmethod print ((this entity)) "print an entity, with its name from the res." (format #t "#<~A :name ~S @ #x~X>" (-> this type) (res-lump-struct this 'name structure) this) this @@ -89,7 +89,7 @@ ;; entity finding ;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod get-level entity ((this entity)) +(defmethod get-level ((this entity)) "Get the level that the entity belongs to." ;; loop over levels @@ -388,7 +388,7 @@ (none) ) -(defmethod print process ((this process)) +(defmethod print ((this process)) "Fancier print for process that can also print status of process drawables." (format #t "#<~A ~S ~A :state ~S :flags " (-> this type) (-> this name) (-> this status) (if (-> this state) (-> this state name) @@ -407,7 +407,7 @@ -(defmethod debug-print entity-actor ((this entity-actor) (mode symbol) (expected-type type)) +(defmethod debug-print ((this entity-actor) (mode symbol) (expected-type type)) "Debug print info about an entity-actor. This is designed to generate rows for the table printed by method debug-print-entities of level-group." (let ((s4-0 (-> this etype))) @@ -476,7 +476,7 @@ (none) ) -(defmethod debug-print-entities level-group ((this level-group) (mode symbol) (expected-type type)) +(defmethod debug-print-entities ((this level-group) (mode symbol) (expected-type type)) "Print a table of entities. If expected-type is #f, print all. Otherwise, print only entities of the given type. Modes: 'art-group: print art groups instead. @@ -516,7 +516,7 @@ ;; entity setup ;;;;;;;;;;;;;;;;;; -(defmethod add-to-level! entity ((this entity) (lev-group level-group) (lev level) (aid actor-id)) +(defmethod add-to-level! ((this entity) (lev-group level-group) (lev level) (aid actor-id)) "Add us to a level." ;; grab the first free link @@ -569,7 +569,7 @@ (none) ) -(defmethod remove-from-level! entity ((this entity) (arg0 level-group)) +(defmethod remove-from-level! ((this entity) (arg0 level-group)) "Remove us from the level." (let ((v1-0 (-> this extra))) (cond @@ -616,7 +616,7 @@ (none) ) -(defmethod update-vis-volumes level-group ((this level-group)) +(defmethod update-vis-volumes ((this level-group)) (local-vars (v1-10 symbol) (sv-16 process) @@ -680,7 +680,7 @@ (none) ) -(defmethod update-vis-volumes-from-nav-mesh level-group ((this level-group)) +(defmethod update-vis-volumes-from-nav-mesh ((this level-group)) "Update the visvol to fit the entire nav-mesh. Does this for all actors in bsps. Probably only used for debugging." (local-vars (sv-16 entity) (sv-32 entity)) @@ -749,7 +749,7 @@ -(defmethod print-volume-sizes level-group ((this level-group)) +(defmethod print-volume-sizes ((this level-group)) "Loop through all entities and print their visibility. Excludes crate, fuel-cell and springbox." (local-vars (sv-16 type) (sv-32 (function _varargs_ object)) (sv-48 symbol) (sv-64 string) (sv-80 entity)) @@ -824,7 +824,7 @@ ;; The Debug Draw Method ;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod debug-draw-actors level-group ((this level-group) (arg0 symbol)) +(defmethod debug-draw-actors ((this level-group) (arg0 symbol)) (local-vars (sv-48 (function symbol bucket-id string vector font-color vector2h symbol)) (sv-64 symbol) @@ -1191,12 +1191,12 @@ ;; Camera Birthing ;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod birth! entity-camera ((this entity-camera)) +(defmethod birth! ((this entity-camera)) (add-connection *camera-engine* *camera* nothing this #f #f) this ) -(defmethod kill! entity-camera ((this entity-camera)) +(defmethod kill! ((this entity-camera)) (remove-by-param1 *camera-engine* this) this ) @@ -1241,7 +1241,7 @@ `(or ,@(apply (lambda (x) `(begin (define-extern ,x type) (type-type? (-> this etype) ,x))) types)) ) -(defmethod birth! entity-actor ((this entity-actor)) +(defmethod birth! ((this entity-actor)) "Create a process for this entity and start it." ;; temp @@ -1301,7 +1301,7 @@ (none) ) -(defmethod kill! entity-actor ((this entity-actor)) +(defmethod kill! ((this entity-actor)) "Kill an actor." (let ((a0-1 (-> this extra process))) (if a0-1 @@ -1312,7 +1312,7 @@ this ) -(defmethod birth bsp-header ((this bsp-header)) +(defmethod birth ((this bsp-header)) "Birth everything in the level." ;; (local-vars (v1-71 int) (s5-0 int)) ;; (.mfc0 s5-0 Count) @@ -1408,7 +1408,7 @@ ) -(defmethod deactivate-entities bsp-header ((this bsp-header)) +(defmethod deactivate-entities ((this bsp-header)) (let ((s5-0 (-> this actors))) (when (nonzero? s5-0) (dotimes (s4-0 (-> s5-0 length)) @@ -1502,7 +1502,7 @@ (none) ) -(defmethod update-perm! entity-perm ((this entity-perm) (arg0 symbol) (arg1 entity-perm-status)) +(defmethod update-perm! ((this entity-perm) (arg0 symbol) (arg1 entity-perm-status)) (cond ((= arg0 'game) (logclear! (-> this status) arg1) @@ -1610,7 +1610,7 @@ (none) ) -(defmethod run-logic? process-drawable ((this process-drawable)) +(defmethod run-logic? ((this process-drawable)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) (vector-vector-distance (-> this root trans) (math-camera-pos)) @@ -1621,13 +1621,13 @@ ) ) -(defmethod birth? entity-links ((this entity-links) (arg0 vector)) +(defmethod birth? ((this entity-links) (arg0 vector)) (and (not (logtest? (-> this perm status) (entity-perm-status bit-0 dead))) (< (vector-vector-distance (-> this trans) arg0) (-> *ACTOR-bank* birth-dist)) ) ) -(defmethod actors-update level-group ((this level-group)) +(defmethod actors-update ((this level-group)) (local-vars (sv-16 vector) (sv-24 int) (sv-32 entity-links) (sv-48 int) (sv-64 string) (sv-80 int)) (when *compact-actors* (if (and (= *compact-actors* 'debug) (= (-> *nk-dead-pool* alive-list prev) (-> *nk-dead-pool* first-gap))) @@ -1852,7 +1852,7 @@ (none) ) -(defmethod set-or-clear-status! entity-actor ((this entity-actor) (arg0 entity-perm-status) (arg1 symbol)) +(defmethod set-or-clear-status! ((this entity-actor) (arg0 entity-perm-status) (arg1 symbol)) (let ((v1-0 (-> this extra))) (if arg1 (logior! (-> v1-0 perm status) arg0) diff --git a/goal_src/jak1/engine/entity/relocate.gc b/goal_src/jak1/engine/entity/relocate.gc index d44f1843818..761677c170b 100644 --- a/goal_src/jak1/engine/entity/relocate.gc +++ b/goal_src/jak1/engine/entity/relocate.gc @@ -9,7 +9,7 @@ ;; DECOMP BEGINS -(defmethod relocate process ((this process) (arg0 int)) +(defmethod relocate ((this process) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -96,12 +96,12 @@ (&+ this arg0) ) -(defmethod relocate cpu-thread ((this cpu-thread) (arg0 int)) +(defmethod relocate ((this cpu-thread) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate process-drawable ((this process-drawable) (arg0 int)) +(defmethod relocate ((this process-drawable) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -152,7 +152,7 @@ (the-as process-drawable ((method-of-type process relocate) this arg0)) ) -(defmethod relocate collide-shape ((this collide-shape) (arg0 int)) +(defmethod relocate ((this collide-shape) (arg0 int)) (&+! (-> this process) arg0) (&+! (-> this root-prim) arg0) (if (-> this riders) @@ -161,14 +161,14 @@ this ) -(defmethod relocate collide-shape-moving ((this collide-shape-moving) (arg0 int)) +(defmethod relocate ((this collide-shape-moving) (arg0 int)) (if (-> this dynam) (&+! (-> this dynam) arg0) ) (the-as collide-shape-moving ((method-of-type collide-shape relocate) this arg0)) ) -(defmethod relocate collide-sticky-rider-group ((this collide-sticky-rider-group) (arg0 int)) +(defmethod relocate ((this collide-sticky-rider-group) (arg0 int)) (countdown (v1-0 (-> this num-riders)) (let ((a2-2 (-> this rider v1-0))) (if (-> a2-2 sticky-prim) @@ -179,12 +179,12 @@ this ) -(defmethod relocate collide-shape-prim ((this collide-shape-prim) (arg0 int)) +(defmethod relocate ((this collide-shape-prim) (arg0 int)) (&+! (-> this cshape) arg0) this ) -(defmethod relocate collide-shape-prim-group ((this collide-shape-prim-group) (arg0 int)) +(defmethod relocate ((this collide-shape-prim-group) (arg0 int)) (&+! (-> this cshape) arg0) (countdown (v1-2 (-> this num-prims)) (&+! (-> this prims v1-2) arg0) @@ -192,12 +192,12 @@ this ) -(defmethod relocate fact-info ((this fact-info) (arg0 int)) +(defmethod relocate ((this fact-info) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate draw-control ((this draw-control) (arg0 int)) +(defmethod relocate ((this draw-control) (arg0 int)) (&+! (-> this skeleton) arg0) (&+! (-> this process) arg0) (when (-> this ripple) @@ -216,7 +216,7 @@ this ) -(defmethod relocate joint-control ((this joint-control) (arg0 int)) +(defmethod relocate ((this joint-control) (arg0 int)) (if (-> this effect) (&+! (-> this effect) arg0) ) @@ -227,7 +227,7 @@ this ) -(defmethod relocate cspace-array ((this cspace-array) (arg0 int)) +(defmethod relocate ((this cspace-array) (arg0 int)) (countdown (v1-0 (-> this length)) (let ((a2-2 (-> this data v1-0))) (if (-> a2-2 parent) @@ -253,54 +253,54 @@ this ) -(defmethod relocate nav-control ((this nav-control) (arg0 int)) +(defmethod relocate ((this nav-control) (arg0 int)) (&+! (-> this process) arg0) (&+! (-> this shape) arg0) this ) -(defmethod relocate path-control ((this path-control) (arg0 int)) +(defmethod relocate ((this path-control) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate vol-control ((this vol-control) (arg0 int)) +(defmethod relocate ((this vol-control) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate water-control ((this water-control) (arg0 int)) +(defmethod relocate ((this water-control) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate actor-link-info ((this actor-link-info) (arg0 int)) +(defmethod relocate ((this actor-link-info) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate align-control ((this align-control) (arg0 int)) +(defmethod relocate ((this align-control) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate joint-mod ((this joint-mod) (arg0 int)) +(defmethod relocate ((this joint-mod) (arg0 int)) (&+! (-> this process) arg0) (&+! (-> this joint) arg0) this ) -(defmethod relocate joint-mod-wheel ((this joint-mod-wheel) (arg0 int)) +(defmethod relocate ((this joint-mod-wheel) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate effect-control ((this effect-control) (arg0 int)) +(defmethod relocate ((this effect-control) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate sparticle-launch-control ((this sparticle-launch-control) (arg0 int)) +(defmethod relocate ((this sparticle-launch-control) (arg0 int)) (&+! (-> this proc) arg0) (countdown (v1-2 (-> this length)) (let* ((a0-3 (-> this data v1-2)) @@ -331,14 +331,14 @@ this ) -(defmethod relocate camera-master ((this camera-master) (arg0 int)) +(defmethod relocate ((this camera-master) (arg0 int)) (if (nonzero? (-> this water-drip)) (&+! (-> this water-drip) arg0) ) (the-as camera-master ((method-of-type process relocate) this arg0)) ) -(defmethod relocate time-of-day-proc ((this time-of-day-proc) (arg0 int)) +(defmethod relocate ((this time-of-day-proc) (arg0 int)) (if (nonzero? (-> this stars)) (&+! (-> this stars) arg0) ) @@ -354,14 +354,14 @@ (the-as time-of-day-proc ((method-of-type process relocate) this arg0)) ) -(defmethod relocate swingpole ((this swingpole) (arg0 int)) +(defmethod relocate ((this swingpole) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) (the-as swingpole ((method-of-type process relocate) this arg0)) ) -(defmethod relocate part-tracker ((this part-tracker) (arg0 int)) +(defmethod relocate ((this part-tracker) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) @@ -371,7 +371,7 @@ (the-as part-tracker ((method-of-type process relocate) this arg0)) ) -(defmethod relocate manipy ((this manipy) (arg0 int)) +(defmethod relocate ((this manipy) (arg0 int)) (if (nonzero? (-> this joint 0)) (&+! (-> this joint 0) arg0) ) diff --git a/goal_src/jak1/engine/entity/res-h.gc b/goal_src/jak1/engine/entity/res-h.gc index 3567a2b361d..55dce89d2bb 100644 --- a/goal_src/jak1/engine/entity/res-h.gc +++ b/goal_src/jak1/engine/entity/res-h.gc @@ -11,14 +11,13 @@ ;; the res-tag describes some data (deftype res-tag (uint128) - ((name symbol :offset 0) ;; name used for lookups - (key-frame float :offset 32) ;; if it has a time value associated with it - (elt-type type :offset 64) ;; the type of the data stored - (data-offset uint16 :offset 96) ;; offset to our data within our lump - (elt-count uint32 :offset 112 :size 15) ;; if we're an array - (inlined? uint8 :offset 127 :size 1) ;; if our data is an inline array or not. + ((name symbol :offset 0) ;; name used for lookups + (key-frame float :offset 32) ;; if it has a time value associated with it + (elt-type type :offset 64) ;; the type of the data stored + (data-offset uint16 :offset 96) ;; offset to our data within our lump + (elt-count uint32 :offset 112 :size 15) ;; if we're an array + (inlined? uint8 :offset 127 :size 1) ;; if our data is an inline array or not. ) - :flag-assert #x900000010 ) ;; the indices of two res tags. If the specific key-frame time is in between two @@ -34,34 +33,29 @@ ;; a res-lump is a collection of res-tags and the associated data. ;; it's used as the base type for entities where the res stores various parameters. (deftype res-lump (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (data-base pointer :offset-assert 12) - (data-top pointer :offset-assert 16) - (data-size int32 :offset-assert 20) - (extra entity-links :offset-assert 24) - (tag (pointer res-tag) :offset-assert 28) + ((length int32) + (allocated-length int32) + (data-base pointer) + (data-top pointer) + (data-size int32) + (extra entity-links) + (tag (pointer res-tag)) ) - - :method-count-assert 22 - :size-assert #x20 - :flag-assert #x1600000020 - ;; field extra is a basic loaded with a signed load (:methods - (new (symbol type int int) _type_ 0) - (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual 9) - (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual 10) - (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual 11) - (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual 12) - (get-tag-index-data (_type_ int) pointer 13) - (get-tag-data (_type_ res-tag) pointer 14) - (allocate-data-memory-for-tag! (_type_ res-tag) res-tag 15) - (sort! (_type_) _type_ 16) - (add-data! (_type_ res-tag pointer) res-lump 17) - (add-32bit-data! (_type_ res-tag object) res-lump 18) - (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual 19) - (make-property-data (_type_ float res-tag-pair pointer) pointer 20) - (get-curve-data! (_type_ curve symbol symbol float) symbol 21) + (new (symbol type int int) _type_) + (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual) + (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual) + (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual) + (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual) + (get-tag-index-data (_type_ int) pointer) + (get-tag-data (_type_ res-tag) pointer) + (allocate-data-memory-for-tag! (_type_ res-tag) res-tag) + (sort! (_type_) _type_) + (add-data! (_type_ res-tag pointer) res-lump) + (add-32bit-data! (_type_ res-tag object) res-lump) + (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual) + (make-property-data (_type_ float res-tag-pair pointer) pointer) + (get-curve-data! (_type_ curve symbol symbol float) symbol) ) ) diff --git a/goal_src/jak1/engine/entity/res.gc b/goal_src/jak1/engine/entity/res.gc index 63e5e28fdae..978797137aa 100644 --- a/goal_src/jak1/engine/entity/res.gc +++ b/goal_src/jak1/engine/entity/res.gc @@ -38,7 +38,7 @@ This is updated from the entity system used in Crash 2, which had most of these ;; DECOMP BEGINS -(defmethod print res-tag ((this res-tag)) +(defmethod print ((this res-tag)) "print a res-tag." (if (res-ref? this) @@ -61,7 +61,7 @@ This is updated from the entity system used in Crash 2, which had most of these this ) -(defmethod length res-tag ((this res-tag)) +(defmethod length ((this res-tag)) "get the length in bytes of this tag's resource." (the int @@ -74,7 +74,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod get-tag-index-data res-lump ((this res-lump) (n int)) +(defmethod get-tag-index-data ((this res-lump) (n int)) "get the data address of the n'th tag." (declare (inline)) @@ -82,7 +82,7 @@ This is updated from the entity system used in Crash 2, which had most of these (-> this tag n data-offset)) ) -(defmethod get-tag-data res-lump ((this res-lump) (tag res-tag)) +(defmethod get-tag-data ((this res-lump) (tag res-tag)) "get the data address of the specified tag." (declare (inline)) @@ -105,13 +105,13 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod length res-lump ((this res-lump)) +(defmethod length ((this res-lump)) "get the amount of resources in a res-lump." (-> this length) ) -(defmethod asize-of res-lump ((this res-lump)) +(defmethod asize-of ((this res-lump)) "get the allocated size of a res-lump." (the int (+ (-> this type psize) ;; psize is used here, but size is used in the allocation? @@ -119,7 +119,7 @@ This is updated from the entity system used in Crash 2, which had most of these (-> this data-size))) ) -(defmethod inspect res-lump ((this res-lump)) +(defmethod inspect ((this res-lump)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Textra: ~A~%" (-> this extra)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -144,7 +144,7 @@ This is updated from the entity system used in Crash 2, which had most of these this ) -(defmethod lookup-tag-idx res-lump ((this res-lump) (name-sym symbol) (mode symbol) (time float)) +(defmethod lookup-tag-idx ((this res-lump) (name-sym symbol) (mode symbol) (time float)) "Look up the index of the tag containing with the given name and timestamp. Correct lookups return a res-tag-pair, which contains one tag index in the lower 32 bits and one in the upper 32 bits. Depending on the mode, they may be the same, or they may be two tags that you should interpolate @@ -332,7 +332,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod make-property-data res-lump ((this res-lump) (time float) (tag-pair res-tag-pair) (buf pointer)) +(defmethod make-property-data ((this res-lump) (time float) (tag-pair res-tag-pair) (buf pointer)) "Returns (a pointer to) the value data of a property with the tag-pair. If tag-pair does not represent an exact point in the timeline, then the data is interpolated based on time with the result written into buf. buf must have enough space to copy all of the data. @@ -417,7 +417,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod get-property-data res-lump ((this res-lump) (name symbol) (mode symbol) (time float) (default pointer) (tag-addr (pointer res-tag)) (buf-addr pointer)) +(defmethod get-property-data ((this res-lump) (name symbol) (mode symbol) (time float) (default pointer) (tag-addr (pointer res-tag)) (buf-addr pointer)) "Returns an address to a given property's data at a specific time stamp, or default on error. name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp. default is the default result returned in the case of an error. @@ -442,7 +442,7 @@ This is updated from the entity system used in Crash 2, which had most of these -(defmethod get-property-struct res-lump ((this res-lump) (name symbol) (mode symbol) (time float) (default structure) (tag-addr (pointer res-tag)) (buf-addr pointer)) +(defmethod get-property-struct ((this res-lump) (name symbol) (mode symbol) (time float) (default structure) (tag-addr (pointer res-tag)) (buf-addr pointer)) "Returns a given struct property's value at a specific time stamp, or default on error. name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp. default is the default result returned in the case of an error. @@ -473,7 +473,7 @@ This is updated from the entity system used in Crash 2, which had most of these -(defmethod get-property-value res-lump ((this res-lump) (name symbol) (mode symbol) (time float) (default uint128) (tag-addr (pointer res-tag)) (buf-addr pointer)) +(defmethod get-property-value ((this res-lump) (name symbol) (mode symbol) (time float) (default uint128) (tag-addr (pointer res-tag)) (buf-addr pointer)) "Returns a given value property's value at a specific time stamp, or default on error. name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp. default is the default result returned in the case of an error. @@ -525,7 +525,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) -(defmethod get-property-value-float res-lump ((this res-lump) (name symbol) (mode symbol) (time float) (default float) (tag-addr (pointer res-tag)) (buf-addr pointer)) +(defmethod get-property-value-float ((this res-lump) (name symbol) (mode symbol) (time float) (default float) (tag-addr (pointer res-tag)) (buf-addr pointer)) "same as get-property-value but float type is checked first?" (let ((tag-pair (lookup-tag-idx this name mode time))) @@ -574,7 +574,7 @@ This is updated from the entity system used in Crash 2, which had most of these default ) -(defmethod sort! res-lump ((this res-lump)) +(defmethod sort! ((this res-lump)) "Sort all tags based on name, then key-frame." (let ((tags-sorted -1)) @@ -605,7 +605,7 @@ This is updated from the entity system used in Crash 2, which had most of these this ) -(defmethod allocate-data-memory-for-tag! res-lump ((this res-lump) (arg0 res-tag)) +(defmethod allocate-data-memory-for-tag! ((this res-lump) (arg0 res-tag)) "Find space for the data described by arg0 in `this`. Returns a tag with data-offset set correctly for this res-lump. If the lump already contains memory for the given tag, and it is big enough, @@ -700,7 +700,7 @@ This is updated from the entity system used in Crash 2, which had most of these arg0 ) -(defmethod add-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 pointer)) +(defmethod add-data! ((this res-lump) (arg0 res-tag) (arg1 pointer)) "Given a tag and a pointer to its data, copy it to this res-lump. This doesn't seem to do the right thing if the given tag is a non-inline tag with > 1 element." @@ -732,7 +732,7 @@ This is updated from the entity system used in Crash 2, which had most of these this ) -(defmethod add-32bit-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 object)) +(defmethod add-32bit-data! ((this res-lump) (arg0 res-tag) (arg1 object)) "Add a single 32-bit value using add-data." (set! (-> arg0 inlined?) 1) (add-data! this arg0 (& arg1)) ;; note, only 32-bits are spilled to the stack here. @@ -747,7 +747,7 @@ This is updated from the entity system used in Crash 2, which had most of these |# ) -(defmethod get-curve-data! res-lump ((this res-lump) (curve-target curve) (points-name symbol) (knots-name symbol) (time float)) +(defmethod get-curve-data! ((this res-lump) (curve-target curve) (points-name symbol) (knots-name symbol) (time float)) "Read curve data and write it to curve-target. Return #t if both control points and knots data was succesfully read, #f otherwise." (let ((result #f)) @@ -785,7 +785,7 @@ This is updated from the entity system used in Crash 2, which had most of these (define-extern part-group-pointer? (function pointer symbol)) (declare-type nav-mesh basic) (declare-type collide-mesh basic) -(defmethod mem-usage res-lump ((this res-lump) (block memory-usage-block) (flags int)) +(defmethod mem-usage ((this res-lump) (block memory-usage-block) (flags int)) "Get the memory usage of this lump and its data" (local-vars (sv-16 int)) diff --git a/goal_src/jak1/engine/game/effect-control-h.gc b/goal_src/jak1/engine/game/effect-control-h.gc index 9a29363e1b9..b259eb6a7ba 100644 --- a/goal_src/jak1/engine/game/effect-control-h.gc +++ b/goal_src/jak1/engine/game/effect-control-h.gc @@ -10,26 +10,23 @@ ;; DECOMP BEGINS (deftype effect-control (basic) - ((process process-drawable :offset-assert 4) - (flags uint32 :offset-assert 8) - (last-frame-group art-joint-anim :offset-assert 12) - (last-frame-num float :offset-assert 16) - (channel-offset int32 :offset-assert 20) - (res res-lump :offset-assert 24) - (name (pointer res-tag) :offset-assert 28) - (param uint32 :offset-assert 32) + ((process process-drawable) + (flags uint32) + (last-frame-group art-joint-anim) + (last-frame-num float) + (channel-offset int32) + (res res-lump) + (name (pointer res-tag)) + (param uint32) ) - :method-count-assert 15 - :size-assert #x24 - :flag-assert #xf00000024 (:methods - (new (symbol type process-drawable) _type_ 0) - (effect-control-method-9 (_type_) none 9) - (effect-control-method-10 (_type_ symbol float int) object 10) - (effect-control-method-11 (_type_ symbol float int basic pat-surface) none 11) - (effect-control-method-12 (_type_ symbol float int basic sound-name) int 12) - (set-channel-offset! (_type_ int) none 13) - (effect-control-method-14 (_type_ float float float) none 14) + (new (symbol type process-drawable) _type_) + (effect-control-method-9 (_type_) none) + (effect-control-method-10 (_type_ symbol float int) object) + (effect-control-method-11 (_type_ symbol float int basic pat-surface) none) + (effect-control-method-12 (_type_ symbol float int basic sound-name) int) + (set-channel-offset! (_type_ int) none) + (effect-control-method-14 (_type_ float float float) none) ) ) @@ -49,7 +46,7 @@ ) ) -(defmethod set-channel-offset! effect-control ((this effect-control) (arg0 int)) +(defmethod set-channel-offset! ((this effect-control) (arg0 int)) (set! (-> this channel-offset) arg0) 0 (none) diff --git a/goal_src/jak1/engine/game/effect-control.gc b/goal_src/jak1/engine/game/effect-control.gc index 371d4c4a66c..fbbd96e1805 100644 --- a/goal_src/jak1/engine/game/effect-control.gc +++ b/goal_src/jak1/engine/game/effect-control.gc @@ -12,72 +12,7 @@ (define *debug-effect-control* #f) (defun sound-name-with-material ((arg0 symbol) (arg1 pat-surface) (arg2 string)) - (let ((gp-0 format) - (a0-2 (clear *temp-string*)) - (a1-1 "~S-~S~S") - (v1-1 (-> arg1 material)) - ) - (gp-0 - a0-2 - a1-1 - arg0 - (cond - ((= v1-1 (pat-material sand)) - "sand" - ) - ((= v1-1 (pat-material wood)) - "wood" - ) - ((= v1-1 (pat-material crwood)) - "crwood" - ) - ((or (= v1-1 (pat-material tube)) (= v1-1 (pat-material pcmetal))) - "pcmetal" - ) - ((or (= v1-1 (pat-material metal)) (= v1-1 (pat-material rotate))) - "metal" - ) - ((= v1-1 (pat-material snow)) - "snow" - ) - ((= v1-1 (pat-material deepsnow)) - "dpsnow" - ) - ((= v1-1 (pat-material gravel)) - "gravel" - ) - ((= v1-1 (pat-material dirt)) - "dirt" - ) - ((= v1-1 (pat-material stone)) - "stone" - ) - ((= v1-1 (pat-material waterbottom)) - "water" - ) - ((= v1-1 (pat-material tar)) - "tar" - ) - ((= v1-1 (pat-material straw)) - "straw" - ) - ((= v1-1 (pat-material ice)) - "ice" - ) - ((= v1-1 (pat-material swamp)) - "swamp" - ) - ((= v1-1 (pat-material neutral)) - "neutral" - ) - (else - "grass" - ) - ) - arg2 - ) - ) - (string->sound-name *temp-string*) + (string->sound-name (string-format "~S-~S~S" arg0 (enum->string pat-material (-> arg1 material)) arg2)) ) (defun effect-param->sound-spec ((arg0 sound-spec) (arg1 (pointer float)) (arg2 int)) @@ -129,7 +64,7 @@ arg0 ) -(defmethod effect-control-method-9 effect-control ((this effect-control)) +(defmethod effect-control-method-9 ((this effect-control)) (let* ((a0-1 (-> this process skel)) (v1-3 (if (< (-> this channel-offset) (-> a0-1 active-channels)) (-> a0-1 root-channel (-> this channel-offset)) @@ -230,7 +165,7 @@ (none) ) -(defmethod effect-control-method-14 effect-control ((this effect-control) (arg0 float) (arg1 float) (arg2 float)) +(defmethod effect-control-method-14 ((this effect-control) (arg0 float) (arg1 float) (arg2 float)) ;; note: this check was added. I believe in the original game name could be false, and then the ;; effect-name check below would fail. This did not cause a crash on original hardware because ;; misaligned 16-byte loads silently align. This causes a crash in opengoal, so we skip it manually. @@ -261,7 +196,7 @@ (none) ) -(defmethod effect-control-method-10 effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) +(defmethod effect-control-method-10 ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) (local-vars (sv-160 int) (sv-176 symbol) @@ -423,10 +358,10 @@ arg1 s5-0 ) - (launch-particles :rate 1.0 - (the-as sparticle-launcher s3-0) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) - ) + (launch-particles + (the-as sparticle-launcher s3-0) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) + ) ) ((= (-> (the-as basic s3-0) type) sparticle-launch-group) (if *debug-effect-control* @@ -531,7 +466,7 @@ 0 ) -(defmethod effect-control-method-11 effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) +(defmethod effect-control-method-11 ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) (local-vars (sv-48 (function sparticle-system sparticle-launcher vector sparticle-launch-state sparticle-launch-control float none) @@ -1050,7 +985,7 @@ (none) ) -(defmethod effect-control-method-12 effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) +(defmethod effect-control-method-12 ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) (local-vars (sv-112 res-tag) (sv-128 sound-name) (sv-144 basic) (sv-160 (function vector vector float))) (set! sv-144 arg3) (let ((s0-0 arg4) diff --git a/goal_src/jak1/engine/game/fact-h.gc b/goal_src/jak1/engine/game/fact-h.gc index dd442fe41a7..f3e5fc71e3c 100644 --- a/goal_src/jak1/engine/game/fact-h.gc +++ b/goal_src/jak1/engine/game/fact-h.gc @@ -11,44 +11,42 @@ ;; All game code should reference *FACT-bank* to determine these parameters (deftype fact-bank (basic) - ((eco-level-max float :offset-assert 4) - (eco-single-inc float :offset-assert 8) - (eco-full-inc float :offset-assert 12) - (eco-single-timeout seconds :offset-assert 16) - (eco-full-timeout seconds :offset-assert 24) - (dummy seconds :offset-assert 32) - (health-max-default float :offset-assert 40) - (health-single-inc float :offset-assert 44) - (eco-pill-max-default float :offset-assert 48) - (health-small-inc float :offset-assert 52) - (buzzer-max-default float :offset-assert 56) - (buzzer-single-inc float :offset-assert 60) - (suck-bounce-dist meters :offset-assert 64) - (suck-suck-dist meters :offset-assert 68) - (default-pill-inc float :offset-assert 72) + ((eco-level-max float) + (eco-single-inc float) + (eco-full-inc float) + (eco-single-timeout seconds) + (eco-full-timeout seconds) + (dummy seconds) + (health-max-default float) + (health-single-inc float) + (eco-pill-max-default float) + (health-small-inc float) + (buzzer-max-default float) + (buzzer-single-inc float) + (suck-bounce-dist meters) + (suck-suck-dist meters) + (default-pill-inc float) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) + (define *FACT-bank* (new 'static 'fact-bank - :eco-level-max 2.0 - :eco-single-inc 1.0 - :eco-full-inc 5.0 - :eco-single-timeout (seconds 5) - :eco-full-timeout (seconds 20) - :dummy (seconds 15) - :health-max-default 3.0 - :health-single-inc 1.0 - :eco-pill-max-default 50.0 - :health-small-inc 1.0 - :buzzer-max-default 7.0 - :buzzer-single-inc 1.0 - :suck-bounce-dist (meters 18) - :suck-suck-dist (meters 7.5) - ) - ) + :eco-level-max 2.0 + :eco-single-inc 1.0 + :eco-full-inc 5.0 + :eco-single-timeout (seconds 5) + :eco-full-timeout (seconds 20) + :dummy (seconds 15) + :health-max-default 3.0 + :health-single-inc 1.0 + :eco-pill-max-default 50.0 + :health-small-inc 1.0 + :buzzer-max-default 7.0 + :buzzer-single-inc 1.0 + :suck-bounce-dist (meters 18) + :suck-suck-dist (meters 7.5) + ) + ) (defenum pickup-type :type int32 @@ -100,65 +98,58 @@ ;; amounts or timings ;; The fact-info class stores data that is common to all fact-infos. (deftype fact-info (basic) - ((process process-drawable :offset-assert 4) ;; the process that this info is for - (pickup-type pickup-type :offset-assert 8) - (pickup-amount float :offset-assert 12) ;; eco increment on pickup - (pickup-spawn-amount float :offset-assert 16) - (options fact-options :offset-assert 24) - (fade-time time-frame :offset-assert 32) + ((process process-drawable) + (pickup-type pickup-type) + (pickup-amount float) + (pickup-spawn-amount float) + (options fact-options) + (fade-time time-frame) ) - :method-count-assert 12 - :size-assert #x28 - :flag-assert #xc00000028 (:methods - (new (symbol type process-drawable pickup-type float) _type_ 0) - (drop-pickup (_type_ symbol process-tree fact-info int) (pointer process) 9) - (reset! (_type_ symbol) none 10) - (pickup-collectable! (_type_ pickup-type float handle) float 11) + (new (symbol type process-drawable pickup-type float) _type_) + (drop-pickup (_type_ symbol process-tree fact-info int) (pointer process)) + (reset! (_type_ symbol) none) + (pickup-collectable! (_type_ pickup-type float handle) float) ) ) + (deftype fact-info-target (fact-info) - ((eco-type pickup-type :offset-assert 40) - (eco-level float :offset-assert 44) - (eco-pickup-time time-frame :offset-assert 48) - (eco-timeout seconds :offset-assert 56) - (health float :offset-assert 64) - (health-max float :offset-assert 68) - (buzzer float :offset-assert 72) - (buzzer-max float :offset-assert 76) - (eco-pill float :offset-assert 80) - (eco-pill-max float :offset-assert 84) - (health-pickup-time time-frame :offset-assert 88) - (eco-source handle :offset-assert 96) - (eco-source-time time-frame :offset-assert 104) - (money-pickup-time time-frame :offset-assert 112) - (buzzer-pickup-time time-frame :offset-assert 120) - (fuel-cell-pickup-time time-frame :offset-assert 128) - (eco-pill-pickup-time time-frame :offset-assert 136) + ((eco-type pickup-type) + (eco-level float) + (eco-pickup-time time-frame) + (eco-timeout seconds) + (health float) + (health-max float) + (buzzer float) + (buzzer-max float) + (eco-pill float) + (eco-pill-max float) + (health-pickup-time time-frame) + (eco-source handle) + (eco-source-time time-frame) + (money-pickup-time time-frame) + (buzzer-pickup-time time-frame) + (fuel-cell-pickup-time time-frame) + (eco-pill-pickup-time time-frame) ) - :method-count-assert 12 - :size-assert #x90 - :flag-assert #xc00000090 (:methods - (new (symbol type process-drawable pickup-type float) _type_ 0) + (new (symbol type process-drawable pickup-type float) _type_) ) ) + (deftype fact-info-enemy (fact-info) - ((speed float :offset-assert 40) - (idle-distance meters :offset-assert 44) - (notice-top meters :offset-assert 48) - (notice-bottom meters :offset-assert 52) - (cam-horz meters :offset-assert 56) - (cam-vert meters :offset-assert 60) - (cam-notice-dist meters :offset-assert 64) + ((speed float) + (idle-distance meters) + (notice-top meters) + (notice-bottom meters) + (cam-horz meters) + (cam-vert meters) + (cam-notice-dist meters) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 (:methods - (new (symbol type process-drawable pickup-type float) _type_ 0) + (new (symbol type process-drawable pickup-type float) _type_) ) ) @@ -182,6 +173,7 @@ ;; remember who we belong to (set! (-> this process) proc) + (set! tag (new 'static 'res-tag)) ;; eco may override the pickup type and amount, so try to get this. (let ((v1-6 (res-lump-data ent 'eco-info (pointer int32) :tag-ptr (& tag) :time 0.0))) @@ -222,7 +214,7 @@ ) ) -(defmethod pickup-collectable! fact-info ((this fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) +(defmethod pickup-collectable! ((this fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) 0.0 ) diff --git a/goal_src/jak1/engine/game/game-h.gc b/goal_src/jak1/engine/game/game-h.gc index 12249573c9c..a59e24f74cc 100644 --- a/goal_src/jak1/engine/game/game-h.gc +++ b/goal_src/jak1/engine/game/game-h.gc @@ -36,8 +36,6 @@ (atki13) ) -;; DECOMP BEGINS - ;; These flags are a bit of a hack and are mostly only meaningful on *target* ;; except for "fade-out-particles" which is meaninful for eco only. (defenum state-flags @@ -89,62 +87,58 @@ (deftype process-drawable (process) ;; The "root" is the location of the process-drawable. ;; It may be a more specific type, and often contains the collision geometry. - ((root trsqv :offset-assert 112) - + ((root trsqv) ;; The node-list is a list of all the joints and bones, and how ;; joints update bones. - (node-list cspace-array :offset-assert 116) + + (node-list cspace-array) ;; the draw-control contains references to all data required for drawing - (draw draw-control :offset-assert 120) + (draw draw-control) ;; The skel is a joint-control which combines animations to control joints - (skel joint-control :offset-assert 124) + (skel joint-control) ;; The nav-control allows enemies to navigate on a nav mesh. - (nav nav-control :offset-assert 128) + (nav nav-control) ;; alignment of animation to our position - (align align-control :offset-assert 132) + (align align-control) ;; our path (like if we are a platform or enemy that moves along a fixed path) - (path path-control :offset-assert 136) + (path path-control) ;; associated volumes (for water) - (vol vol-control :offset-assert 140) + (vol vol-control) ;; our settings - (fact fact-info :offset-assert 144) + (fact fact-info) ;; reference to our entity - (link actor-link-info :offset-assert 148) + (link actor-link-info) ;; our particles - (part sparticle-launch-control :offset-assert 152) + (part sparticle-launch-control) ;; state related to entering and being in water - (water water-control :offset-assert 156) + (water water-control) ;; any sound that we're playing - (sound ambient-sound :offset-assert 160) + (sound ambient-sound) ;; seems to only be used in target? - (state-flags state-flags :offset-assert 164) + (state-flags state-flags) ;; the time when we last did something. Used for different things in different objects - (state-time time-frame :offset-assert 168) + (state-time time-frame) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:methods - (initialize-skeleton (_type_ skeleton-group pair) none 14) - (initialize-skeleton-by-name (_type_ string object) _type_ 15) - (apply-alignment (_type_ align-opts transformq vector) collide-shape 16) - (do-joint-math! (_type_) none 17) - (cleanup-for-death (_type_) none 18) - (evaluate-joint-control (_type_) none 19) + (initialize-skeleton (_type_ skeleton-group pair) none) + (initialize-skeleton-by-name (_type_ string object) _type_) + (apply-alignment (_type_ align-opts transformq vector) collide-shape) + (do-joint-math! (_type_) none) + (cleanup-for-death (_type_) none) + (evaluate-joint-control (_type_) none) ) (:states (process-drawable-art-error string) @@ -156,80 +150,73 @@ ;; methods to a type? (deftype process-drawable-reserved (process-drawable) () - :heap-base #x40 - :method-count-assert 63 - :size-assert #xb0 - :flag-assert #x3f004000b0 (:methods - (process-drawable-reserved-method-20 () none 20) - (process-drawable-reserved-method-21 () none 21) - (process-drawable-reserved-method-22 () none 22) - (process-drawable-reserved-method-23 () none 23) - (process-drawable-reserved-method-24 () none 24) - (process-drawable-reserved-method-25 () none 25) - (process-drawable-reserved-method-26 () none 26) - (process-drawable-reserved-method-27 () none 27) - (process-drawable-reserved-method-28 () none 28) - (process-drawable-reserved-method-29 () none 29) - (process-drawable-reserved-method-30 () none 30) - (process-drawable-reserved-method-31 () none 31) - (process-drawable-reserved-method-32 () none 32) - (process-drawable-reserved-method-33 () none 33) - (process-drawable-reserved-method-34 () none 34) - (process-drawable-reserved-method-35 () none 35) - (process-drawable-reserved-method-36 () none 36) - (process-drawable-reserved-method-37 () none 37) - (process-drawable-reserved-method-38 () none 38) - (process-drawable-reserved-method-39 () none 39) - (process-drawable-reserved-method-40 () none 40) - (process-drawable-reserved-method-41 () none 41) - (process-drawable-reserved-method-42 () none 42) - (process-drawable-reserved-method-43 () none 43) - (process-drawable-reserved-method-44 () none 44) - (process-drawable-reserved-method-45 () none 45) - (process-drawable-reserved-method-46 () none 46) - (process-drawable-reserved-method-47 () none 47) - (process-drawable-reserved-method-48 () none 48) - (process-drawable-reserved-method-49 () none 49) - (process-drawable-reserved-method-50 () none 50) - (process-drawable-reserved-method-51 () none 51) - (process-drawable-reserved-method-52 () none 52) - (process-drawable-reserved-method-53 () none 53) - (process-drawable-reserved-method-54 () none 54) - (process-drawable-reserved-method-55 () none 55) - (process-drawable-reserved-method-56 () none 56) - (process-drawable-reserved-method-57 () none 57) - (process-drawable-reserved-method-58 () none 58) - (process-drawable-reserved-method-59 () none 59) - (process-drawable-reserved-method-60 () none 60) - (process-drawable-reserved-method-61 () none 61) - (process-drawable-reserved-method-62 () none 62) + (process-drawable-reserved-method-20 () none) + (process-drawable-reserved-method-21 () none) + (process-drawable-reserved-method-22 () none) + (process-drawable-reserved-method-23 () none) + (process-drawable-reserved-method-24 () none) + (process-drawable-reserved-method-25 () none) + (process-drawable-reserved-method-26 () none) + (process-drawable-reserved-method-27 () none) + (process-drawable-reserved-method-28 () none) + (process-drawable-reserved-method-29 () none) + (process-drawable-reserved-method-30 () none) + (process-drawable-reserved-method-31 () none) + (process-drawable-reserved-method-32 () none) + (process-drawable-reserved-method-33 () none) + (process-drawable-reserved-method-34 () none) + (process-drawable-reserved-method-35 () none) + (process-drawable-reserved-method-36 () none) + (process-drawable-reserved-method-37 () none) + (process-drawable-reserved-method-38 () none) + (process-drawable-reserved-method-39 () none) + (process-drawable-reserved-method-40 () none) + (process-drawable-reserved-method-41 () none) + (process-drawable-reserved-method-42 () none) + (process-drawable-reserved-method-43 () none) + (process-drawable-reserved-method-44 () none) + (process-drawable-reserved-method-45 () none) + (process-drawable-reserved-method-46 () none) + (process-drawable-reserved-method-47 () none) + (process-drawable-reserved-method-48 () none) + (process-drawable-reserved-method-49 () none) + (process-drawable-reserved-method-50 () none) + (process-drawable-reserved-method-51 () none) + (process-drawable-reserved-method-52 () none) + (process-drawable-reserved-method-53 () none) + (process-drawable-reserved-method-54 () none) + (process-drawable-reserved-method-55 () none) + (process-drawable-reserved-method-56 () none) + (process-drawable-reserved-method-57 () none) + (process-drawable-reserved-method-58 () none) + (process-drawable-reserved-method-59 () none) + (process-drawable-reserved-method-60 () none) + (process-drawable-reserved-method-61 () none) + (process-drawable-reserved-method-62 () none) ) ) ;; The attack-info is generated by attackers and sent to target. (deftype attack-info (structure) - ((trans vector :inline :offset-assert 0) - (vector vector :inline :offset-assert 16) - (intersection vector :inline :offset-assert 32) - (attacker handle :offset-assert 48) - (invinc-time time-frame :offset-assert 56) - (mask attack-mask :offset-assert 64) - (mode symbol :offset-assert 68) - (shove-back meters :offset-assert 72) - (shove-up meters :offset-assert 76) - (speed meters :offset-assert 80) - (dist meters :offset-assert 84) - (control float :offset-assert 88) - (angle symbol :offset-assert 92) - (rotate-to degrees :offset-assert 96) - (prev-state state :offset-assert 100) + ((trans vector :inline) + (vector vector :inline) + (intersection vector :inline) + (attacker handle) + (invinc-time time-frame) + (mask attack-mask) + (mode symbol) + (shove-back meters) + (shove-up meters) + (speed meters) + (dist meters) + (control float) + (angle symbol) + (rotate-to degrees) + (prev-state state) ) - :method-count-assert 10 - :size-assert #x68 - :flag-assert #xa00000068 (:methods - (combine! (_type_ attack-info) none 9) + (combine! (_type_ attack-info) none) ) ) @@ -237,11 +224,8 @@ (define *global-attack-id* 0) (deftype ground-tween-info (structure) - ((chan uint8 3 :offset-assert 0) - (blend float 3 :offset-assert 4) - (group uint32 5 :offset-assert 16) + ((chan uint8 3) + (blend float 3) + (group uint32 5) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) diff --git a/goal_src/jak1/engine/game/game-info-h.gc b/goal_src/jak1/engine/game/game-info-h.gc index d463ae0d16a..fc493a69fd3 100644 --- a/goal_src/jak1/engine/game/game-info-h.gc +++ b/goal_src/jak1/engine/game/game-info-h.gc @@ -14,30 +14,27 @@ ;; Game parameters. (deftype game-bank (basic) - ((life-max-default float :offset-assert 4) ;; yes this life system works, but does nothing - (life-start-default float :offset-assert 8) - (life-single-inc float :offset-assert 12) - (money-task-inc float :offset-assert 16) - (money-oracle-inc float :offset-assert 20) + ((life-max-default float) ;; yes this life system works, but does nothing + (life-start-default float) + (life-single-inc float) + (money-task-inc float) + (money-oracle-inc float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) + (define *GAME-bank* (new 'static 'game-bank - :life-max-default 99.0 - :life-start-default 5.0 - :life-single-inc 1.0 - :money-task-inc 90.0 - :money-oracle-inc 120.0 - ) - ) + :life-max-default 99.0 + :life-start-default 5.0 + :life-single-inc 1.0 + :money-task-inc 90.0 + :money-oracle-inc 120.0 + ) + ) ;; aid (deftype actor-id (uint32) () - :flag-assert #x900000004 ) ;;;;;;;;;;;;;;; @@ -49,43 +46,37 @@ ;; the possible load state for a level. (deftype level-buffer-state (structure) - ((name symbol :offset-assert 0) ;; level name - (display? symbol :offset-assert 4) ;; should it be drawn? - (force-vis? symbol :offset-assert 8) ;; force everything to be visible. - (force-inside? symbol :offset-assert 12) ;; force player to be considered inside. + ((name symbol) + (display? symbol) + (force-vis? symbol) + (force-inside? symbol) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; This includes more state than just "loading" - it also has a list of commands to execute and ;; other random state. (deftype load-state (basic) - ((want level-buffer-state 2 :inline :offset-assert 4) ;; the two levels we want loaded - (vis-nick symbol :offset-assert 36) ;; the vis file we have loaded - (command-list pair :offset-assert 40) ;; list of additional commands - (object-name symbol 256 :offset-assert 44) ;; state of various in-game objects - (object-status basic 256 :offset-assert 1068) + ((want level-buffer-state 2 :inline) + (vis-nick symbol) + (command-list pair) + (object-name symbol 256) + (object-status basic 256) ) - :method-count-assert 21 - :size-assert #x82c - :flag-assert #x150000082c (:methods - (new (symbol type) _type_ 0) - (reset! (_type_) _type_ 9) - (update! (_type_) int 10) - (want-levels (_type_ symbol symbol) int 11) - (want-display-level (_type_ symbol symbol) int 12) - (want-vis (_type_ symbol) int 13) - (want-force-vis (_type_ symbol symbol) int 14) - (execute-command (_type_ pair) none 15) - (execute-commands-up-to (_type_ float) int 16) - (backup-load-state-and-set-cmds (_type_ pair) int 17) - (restore-load-state-and-cleanup (_type_) int 18) - (restore-load-state (_type_) int 19) - (set-force-inside! (_type_ symbol symbol) none 20) + (new (symbol type) _type_) + (reset! (_type_) _type_) + (update! (_type_) int) + (want-levels (_type_ symbol symbol) int) + (want-display-level (_type_ symbol symbol) int) + (want-vis (_type_ symbol) int) + (want-force-vis (_type_ symbol symbol) int) + (execute-command (_type_ pair) none) + (execute-commands-up-to (_type_ float) int) + (backup-load-state-and-set-cmds (_type_ pair) int) + (restore-load-state-and-cleanup (_type_) int) + (restore-load-state (_type_) int) + (set-force-inside! (_type_ symbol symbol) none) ) ) @@ -121,25 +112,22 @@ ;; static data for a continue point (deftype continue-point (basic) - ((name string :offset-assert 4) - (level symbol :offset-assert 8) - (flags continue-flags :offset-assert 12) - (trans vector :inline :offset-assert 16) - (quat quaternion :inline :offset-assert 32) - (camera-trans vector :inline :offset-assert 48) - (camera-rot float 9 :offset-assert 64) - (load-commands pair :offset-assert 100) - (vis-nick symbol :offset-assert 104) - (lev0 symbol :offset-assert 108) - (disp0 symbol :offset-assert 112) - (lev1 symbol :offset-assert 116) - (disp1 symbol :offset-assert 120) + ((name string) + (level symbol) + (flags continue-flags) + (trans vector :inline) + (quat quaternion :inline) + (camera-trans vector :inline) + (camera-rot float 9) + (load-commands pair) + (vis-nick symbol) + (lev0 symbol) + (disp0 symbol) + (lev1 symbol) + (disp1 symbol) ) - :method-count-assert 10 - :size-assert #x7c - :flag-assert #xa0000007c (:methods - (debug-draw! (_type_) none 9) + (debug-draw! (_type_) none) ) ) @@ -150,76 +138,73 @@ ;; this information can be saved/loaded from a game save. ;; also, it must be manually synchronized with entity permanent state in the levels (deftype game-info (basic) - ((mode symbol :offset-assert 4) ;; can be play/debug - (save-name basic :offset-assert 8) - (life float :offset-assert 12) - (life-max float :offset-assert 16) - (money float :offset-assert 20) - (money-total float :offset-assert 24) - (money-per-level uint8 32 :offset-assert 28) - (deaths-per-level uint8 32 :offset-assert 60) - (buzzer-total float :offset-assert 92) - (fuel float :offset-assert 96) - (perm-list entity-perm-array :offset-assert 100) ;; permament storage for entities - (task-perm-list entity-perm-array :offset-assert 104) ;; permanent storage for task entities - (current-continue continue-point :offset-assert 108) - (text-ids-seen bit-array :offset-assert 112) - (level-opened uint8 32 :offset-assert 116) - (hint-control (array level-hint-control) :offset-assert 148) - (task-hint-control (array task-hint-control-group) :offset-assert 152) - (total-deaths int32 :offset-assert 156) - (continue-deaths int32 :offset-assert 160) - (fuel-cell-deaths int32 :offset-assert 164) - (game-start-time time-frame :offset-assert 168) - (continue-time time-frame :offset-assert 176) - (death-time time-frame :offset-assert 184) - (hit-time time-frame :offset-assert 192) - (fuel-cell-pickup-time time-frame :offset-assert 200) - (fuel-cell-time (array time-frame) :offset-assert 208) - (enter-level-time (array time-frame) :offset-assert 212) - (in-level-time (array time-frame) :offset-assert 216) - (blackout-time time-frame :offset-assert 224) - (letterbox-time time-frame :offset-assert 232) ;; time to turn off letterboxing, base-frame - (hint-play-time time-frame :offset-assert 240) - (display-text-time time-frame :offset-assert 248) - (display-text-handle handle :offset-assert 256) - (death-movie-tick int32 :offset-assert 264) - (want-auto-save symbol :offset-assert 268) - (auto-save-proc handle :offset-assert 272) - (auto-save-status mc-status-code :offset-assert 280) - (auto-save-card int32 :offset-assert 284) - (auto-save-which int32 :offset-assert 288) - (pov-camera-handle handle :offset-assert 296) - (other-camera-handle handle :offset-assert 304) - (death-pos vector-array :offset-assert 312) - (dummy basic :offset-assert 316) - (auto-save-count int32 :offset-assert 320) + ((mode symbol) + (save-name basic) + (life float) + (life-max float) + (money float) + (money-total float) + (money-per-level uint8 32) + (deaths-per-level uint8 32) + (buzzer-total float) + (fuel float) + (perm-list entity-perm-array) + (task-perm-list entity-perm-array) + (current-continue continue-point) + (text-ids-seen bit-array) + (level-opened uint8 32) + (hint-control (array level-hint-control)) + (task-hint-control (array task-hint-control-group)) + (total-deaths int32) + (continue-deaths int32) + (fuel-cell-deaths int32) + (game-start-time time-frame) + (continue-time time-frame) + (death-time time-frame) + (hit-time time-frame) + (fuel-cell-pickup-time time-frame) + (fuel-cell-time (array time-frame)) + (enter-level-time (array time-frame)) + (in-level-time (array time-frame)) + (blackout-time time-frame) + (letterbox-time time-frame) + (hint-play-time time-frame) + (display-text-time time-frame) + (display-text-handle handle) + (death-movie-tick int32) + (want-auto-save symbol) + (auto-save-proc handle) + (auto-save-status mc-status-code) + (auto-save-card int32) + (auto-save-which int32) + (pov-camera-handle handle) + (other-camera-handle handle) + (death-pos vector-array) + (dummy basic) + (auto-save-count int32) ) - :method-count-assert 29 - :size-assert #x144 - :flag-assert #x1d00000144 (:methods - (initialize! (_type_ symbol game-save string) _type_ 9) - (adjust (_type_ symbol float handle) float 10) - (task-complete? (_type_ game-task) symbol 11) - (lookup-entity-perm-by-aid (_type_ actor-id) entity-perm 12) - (get-entity-task-perm (_type_ game-task) entity-perm 13) - (copy-perms-from-level! (_type_ level) none 14) - (copy-perms-to-level! (_type_ level) none 15) - (debug-print (_type_ symbol) _type_ 16) - (get-or-create-continue! (_type_) continue-point 17) - (get-continue-by-name (_type_ string) continue-point 18) - (set-continue! (_type_ basic) continue-point 19) - (buzzer-count (_type_ game-task) int 20) - (seen-text? (_type_ text-id) symbol 21) - (mark-text-as-seen (_type_ text-id) none 22) - (got-buzzer? (_type_ game-task int) symbol 23) - (save-game! (_type_ game-save string) none 24) - (load-game! (_type_ game-save) game-save 25) - (clear-text-seen! (_type_ text-id) none 26) - (get-death-count (_type_ symbol) int 27) - (get-health-percent-lost (_type_ symbol) float 28) - ) + (initialize! (_type_ symbol game-save string) _type_) + (adjust (_type_ symbol float handle) float) + (task-complete? (_type_ game-task) symbol) + (lookup-entity-perm-by-aid (_type_ actor-id) entity-perm) + (get-entity-task-perm (_type_ game-task) entity-perm) + (copy-perms-from-level! (_type_ level) none) + (copy-perms-to-level! (_type_ level) none) + (debug-print (_type_ symbol) _type_) + (get-or-create-continue! (_type_) continue-point) + (get-continue-by-name (_type_ string) continue-point) + (set-continue! (_type_ basic) continue-point) + (buzzer-count (_type_ game-task) int) + (seen-text? (_type_ text-id) symbol) + (mark-text-as-seen (_type_ text-id) none) + (got-buzzer? (_type_ game-task int) symbol) + (save-game! (_type_ game-save string) none) + (load-game! (_type_ game-save) game-save) + (clear-text-seen! (_type_ text-id) none) + (get-death-count (_type_ symbol) int) + (get-health-percent-lost (_type_ symbol) float) + ) ) (define-extern *game-info* game-info) diff --git a/goal_src/jak1/engine/game/game-info.gc b/goal_src/jak1/engine/game/game-info.gc index 97c9861cbbe..6013690bb6c 100644 --- a/goal_src/jak1/engine/game/game-info.gc +++ b/goal_src/jak1/engine/game/game-info.gc @@ -18,7 +18,7 @@ ;; This border-plane seems to be unused. This is separate from load boundaries. -(defmethod debug-draw! border-plane ((this border-plane)) +(defmethod debug-draw! ((this border-plane)) "Debug draw a border plane with a vector and text." (let* ((v1-0 (-> this action)) ;; pick color based on action @@ -37,13 +37,13 @@ (none) ) -(defmethod point-past-plane? border-plane ((this border-plane) (arg0 vector)) +(defmethod point-past-plane? ((this border-plane) (arg0 vector)) "Which side of the plane is the given point on? #t = on the plane, or on the side the normal points toward." (>= (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) (-> this normal)) 0.0) ) -(defmethod task-complete? game-info ((this game-info) (arg0 game-task)) +(defmethod task-complete? ((this game-info) (arg0 game-task)) "Likely closed, or in the process of closing" (logtest? (-> this task-perm-list data arg0 status) (entity-perm-status real-complete)) ) @@ -64,7 +64,7 @@ ) ) -(defmethod get-or-create-continue! game-info ((this game-info)) +(defmethod get-or-create-continue! ((this game-info)) "Attempt to get a continue point, if it doesn't exist set the default-continue to a location in front of the camera." (cond @@ -88,7 +88,7 @@ ) ) -(defmethod get-continue-by-name game-info ((this game-info) (arg0 string)) +(defmethod get-continue-by-name ((this game-info) (arg0 string)) "Look up a continue point by string name" (let ((s5-0 *level-load-list*)) ;; loop over levels @@ -111,7 +111,7 @@ (the-as continue-point #f) ) -(defmethod set-continue! game-info ((this game-info) (arg0 basic)) +(defmethod set-continue! ((this game-info) (arg0 basic)) "Set the current continue point to to arg0. arg0 can be: '() or #f, in which case it does nothing. @@ -159,12 +159,12 @@ (-> this current-continue) ) -(defmethod get-entity-task-perm game-info ((this game-info) (arg0 game-task)) +(defmethod get-entity-task-perm ((this game-info) (arg0 game-task)) "Get the permanent storage for a game-task" (-> this task-perm-list data arg0) ) -(defmethod initialize! game-info ((this game-info) (cause symbol) (save-to-load game-save) (continue-point-override string)) +(defmethod initialize! ((this game-info) (cause symbol) (save-to-load game-save) (continue-point-override string)) "Initialize the game-info. The cause can be 'dead if you die, or 'game to reset everything. If save-to-load is not #f will load data from that. @@ -328,7 +328,7 @@ ) -(defmethod adjust game-info ((this game-info) (item symbol) (amount float) (source handle)) +(defmethod adjust ((this game-info) (item symbol) (amount float) (source handle)) "Adjust the number of items by amount." (case item (('life) @@ -439,13 +439,13 @@ ) ) -(defmethod got-buzzer? game-info ((this game-info) (arg0 game-task) (arg1 int)) +(defmethod got-buzzer? ((this game-info) (arg0 game-task) (arg1 int)) "Do we have the arg1-th buzzer for the given buzzer task?" ;; buzzers mis-use their reminder bits as a bitfield of which ones have been collected (logtest? (get-reminder (get-task-control arg0) 0) (ash 1 arg1)) ) -(defmethod buzzer-count game-info ((this game-info) (arg0 game-task)) +(defmethod buzzer-count ((this game-info) (arg0 game-task)) "How many buzzers do we have for this task?" (let ((v1-1 (get-reminder (get-task-control arg0) 0)) ;; buzzer bitmask (v0-2 0) ;; count @@ -459,14 +459,14 @@ ) ) -(defmethod seen-text? game-info ((this game-info) (arg0 text-id)) +(defmethod seen-text? ((this game-info) (arg0 text-id)) "Have we already displayed this text? This is used to display level names on only the first enter. It seems like hints could also display text on screen at one point in time." (get-bit (-> this text-ids-seen) (the-as int arg0)) ) -(defmethod mark-text-as-seen game-info ((this game-info) (arg0 text-id)) +(defmethod mark-text-as-seen ((this game-info) (arg0 text-id)) "Mark the game text as seen. This only works if the text id < 4096, and ignores otherwise" (if (and (< (the-as uint arg0) (the-as uint 4095)) (> (the-as uint arg0) 0)) (set-bit (-> this text-ids-seen) (the-as int arg0)) @@ -475,14 +475,14 @@ (none) ) -(defmethod clear-text-seen! game-info ((this game-info) (arg0 text-id)) +(defmethod clear-text-seen! ((this game-info) (arg0 text-id)) "Mark text as unseen. MUST be a valid text id" (clear-bit (-> this text-ids-seen) (the-as int arg0)) 0 (none) ) -(defmethod reset! fact-info-target ((this fact-info-target) (arg0 symbol)) +(defmethod reset! ((this fact-info-target) (arg0 symbol)) "Reset the facts for a given thing" (when (or (not arg0) (= arg0 'eco)) (set! (-> this eco-timeout) 0) @@ -507,7 +507,7 @@ (declare-type vent process-drawable) -(defmethod pickup-collectable! fact-info-target ((this fact-info-target) (kind pickup-type) (amount float) (source-handle handle)) +(defmethod pickup-collectable! ((this fact-info-target) (kind pickup-type) (amount float) (source-handle handle)) "Pickup a thing!" (case kind (((pickup-type eco-green)) @@ -783,7 +783,7 @@ ) ) -(defmethod lookup-entity-perm-by-aid game-info ((this game-info) (aid actor-id)) +(defmethod lookup-entity-perm-by-aid ((this game-info) (aid actor-id)) (let ((v1-0 (-> this perm-list))) (countdown (a0-1 (-> v1-0 length)) (if (= aid (-> v1-0 data a0-1 aid)) @@ -794,7 +794,7 @@ (the-as entity-perm #f) ) -(defmethod copy-perms-from-level! game-info ((this game-info) (lev level)) +(defmethod copy-perms-from-level! ((this game-info) (lev level)) "Iterate through entities in the level and copy their perms into game-info" (let ((perms (-> this perm-list)) ;; our perms (lev-entities (-> lev bsp level entity)) ;; entities in the level @@ -827,7 +827,7 @@ (none) ) -(defmethod copy-perms-to-level! game-info ((this game-info) (lev level)) +(defmethod copy-perms-to-level! ((this game-info) (lev level)) "Does the opposite of the previous, copies perms from game-info to level entities" (let ((lev-entities (-> lev bsp level entity))) (dotimes (lev-entity-idx (-> lev-entities length)) @@ -851,13 +851,13 @@ (none) ) -(defmethod print continue-point ((this continue-point)) +(defmethod print ((this continue-point)) (format #t "#<~A ~S @ #x~X>" (-> this type) (-> this name) this) this ) -(defmethod debug-draw! continue-point ((this continue-point)) +(defmethod debug-draw! ((this continue-point)) "Draw a continue point." (add-debug-x #t (bucket-id debug-no-zbuf) (-> this trans) (new 'static 'rgba :r #xff :a #x80)) (add-debug-text-3d @@ -929,7 +929,7 @@ (enum->string game-task arg0) ) -(defmethod debug-print game-info ((this game-info) (arg0 symbol)) +(defmethod debug-print ((this game-info) (arg0 symbol)) (inspect this) (when (or (not arg0) (= arg0 'game-task)) (format #t "~Tgame-task:~%") @@ -998,7 +998,7 @@ (set! (-> gp-0 other-camera-handle) (the-as handle #f)) ) -(defmethod get-death-count game-info ((this game-info) (arg0 symbol)) +(defmethod get-death-count ((this game-info) (arg0 symbol)) (let ((v1-13 (if (and arg0 *target* (>= (-> *level-task-data-remap* length) (-> *target* current-level info index))) (the-as @@ -1014,6 +1014,6 @@ ) ) -(defmethod get-health-percent-lost game-info ((this game-info) (arg0 symbol)) +(defmethod get-health-percent-lost ((this game-info) (arg0 symbol)) (* 0.25 (the float (get-death-count this #f))) ) diff --git a/goal_src/jak1/engine/game/game-save.gc b/goal_src/jak1/engine/game/game-save.gc index 22355db0f72..b5bd8de16de 100644 --- a/goal_src/jak1/engine/game/game-save.gc +++ b/goal_src/jak1/engine/game/game-save.gc @@ -104,25 +104,22 @@ ;; the count/size fields determine how big it is. (deftype game-save-tag (structure) - ((user-object object 2 :offset-assert 0) - (user-uint64 uint64 :offset 0) - (user-float0 float :offset 0) - (user-float float 2 :offset 0) - (user-int32 int32 2 :offset 0) - (user-uint32 uint32 2 :offset 0) - (user-int16 int16 4 :offset 0) - (user-uint16 uint16 4 :offset 0) - (user-int8 int8 8 :offset 0) - (user-int80 int8 :offset 0) - (user-int81 int8 :offset 1) - (user-uint8 uint8 8 :offset 0) - (elt-count int32 :offset-assert 8) - (elt-size uint16 :offset-assert 12) - (elt-type game-save-elt :offset-assert 14) + ((user-object object 2) + (user-uint64 uint64 :overlay-at (-> user-object 0)) + (user-float0 float :overlay-at (-> user-object 0)) + (user-float float 2 :overlay-at (-> user-object 0)) + (user-int32 int32 2 :overlay-at (-> user-object 0)) + (user-uint32 uint32 2 :overlay-at (-> user-object 0)) + (user-int16 int16 4 :overlay-at (-> user-object 0)) + (user-uint16 uint16 4 :overlay-at (-> user-object 0)) + (user-int8 int8 8 :overlay-at (-> user-object 0)) + (user-int80 int8 :overlay-at (-> user-object 0)) + (user-int81 int8 :overlay-at (-> user-int8 1)) + (user-uint8 uint8 8 :overlay-at (-> user-object 0)) + (elt-count int32) + (elt-size uint16) + (elt-type game-save-elt) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; A game-save is a dynamic type that contains the full save. @@ -130,37 +127,34 @@ ;; the common metadata is used to display info about a save, without needing to ;; fully unpack the data stored in the tags. (deftype game-save (basic) - ((version int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (length int32 :offset-assert 12) - (info-int32 int32 16 :offset-assert 16) - (info-int8 int8 64 :offset 16) - (level-index int32 :offset 16) - (fuel-cell-count float :offset 20) - (money-count float :offset 24) - (buzzer-count float :offset 28) - (completion-percentage float :offset 32) - (minute uint8 :offset 36) - (hour uint8 :offset 37) - (week uint8 :offset 38) - (day uint8 :offset 39) - (month uint8 :offset 40) - (year uint8 :offset 41) - (new-game int32 :offset 44) - (tag game-save-tag :inline :dynamic :offset-assert 80) + ((version int32) + (allocated-length int32) + (length int32) + (info-int32 int32 16) + (info-int8 int8 64 :overlay-at (-> info-int32 0)) + (level-index int32 :overlay-at (-> info-int32 0)) + (fuel-cell-count float :overlay-at (-> info-int32 1)) + (money-count float :overlay-at (-> info-int32 2)) + (buzzer-count float :overlay-at (-> info-int32 3)) + (completion-percentage float :overlay-at (-> info-int32 4)) + (minute uint8 :overlay-at (-> info-int32 5)) + (hour uint8 :overlay-at (-> info-int8 21)) + (week uint8 :overlay-at (-> info-int8 22)) + (day uint8 :overlay-at (-> info-int8 23)) + (month uint8 :overlay-at (-> info-int32 6)) + (year uint8 :overlay-at (-> info-int8 25)) + (new-game int32 :overlay-at (-> info-int32 7)) + (tag game-save-tag :inline :dynamic) ) - :method-count-assert 12 - :size-assert #x50 - :flag-assert #xc00000050 (:methods - (new (symbol type int) _type_ 0) - (save-to-file (_type_ string) _type_ 9) - (load-from-file! (_type_ string) _type_ 10) - (debug-print (_type_ symbol) _type_ 11) + (new (symbol type int) _type_) + (save-to-file (_type_ string) _type_) + (load-from-file! (_type_ string) _type_) + (debug-print (_type_ symbol) _type_) ) ) -(defmethod asize-of game-save ((this game-save)) +(defmethod asize-of ((this game-save)) "Get the size in memory of the save" (the-as int (+ (-> game-save size) (the-as uint (-> this allocated-length)))) ) @@ -187,7 +181,7 @@ ) ) -(defmethod debug-print game-save ((this game-save) (detail symbol)) +(defmethod debug-print ((this game-save) (detail symbol)) "Print a save to #t" (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tversion: ~D~%" (-> this version)) @@ -338,11 +332,11 @@ this ) -(defmethod inspect game-save ((this game-save)) +(defmethod inspect ((this game-save)) (debug-print this #f) ) -(defmethod save-game! game-info ((this game-info) (arg0 game-save) (arg1 string)) +(defmethod save-game! ((this game-info) (arg0 game-save) (arg1 string)) "Update the game-save to have the info from the current game state" ;; some stuff lives in the levels and needs to be copied into game-info. @@ -805,7 +799,7 @@ (none) ) -(defmethod load-game! game-info ((this game-info) (save game-save)) +(defmethod load-game! ((this game-info) (save game-save)) "Copy save data from a game-save to a game-info" (let ((save-data (the-as game-save-tag (-> save tag)))) ;; loop over all tags @@ -1075,7 +1069,7 @@ save ) -(defmethod save-to-file game-save ((this game-save) (arg0 string)) +(defmethod save-to-file ((this game-save) (arg0 string)) "Write a game save to a file for debugging" (let ((s5-0 (new 'stack 'file-stream arg0 'write))) (file-stream-write s5-0 @@ -1087,7 +1081,7 @@ this ) -(defmethod load-from-file! game-save ((this game-save) (filename string)) +(defmethod load-from-file! ((this game-save) (filename string)) "Load a game save from a file for debugging" (let ((stream (new 'stack 'file-stream filename 'read))) (let ((in-size (file-stream-length stream)) @@ -1162,36 +1156,32 @@ (define *auto-save-info* (new 'global 'mc-slot-info)) (deftype auto-save (process) - ((card int32 :offset-assert 112) - (slot int32 :offset-assert 116) - (which int32 :offset-assert 120) - (buffer kheap :offset-assert 124) - (mode basic :offset-assert 128) - (result mc-status-code :offset-assert 132) - (save game-save :offset-assert 136) - (info mc-slot-info :inline :offset-assert 140) - (notify handle :offset-assert 440) - (state-time time-frame :offset-assert 448) - (part sparticle-launch-control :offset-assert 456) + ((card int32) + (slot int32) + (which int32) + (buffer kheap) + (mode basic) + (result mc-status-code) + (save game-save) + (info mc-slot-info :inline) + (notify handle) + (state-time time-frame) + (part sparticle-launch-control) ) - :heap-base #x160 - :method-count-assert 23 - :size-assert #x1cc - :flag-assert #x17016001cc - (:methods - (get-heap () _type_ :state 14) - (get-card () _type_ :state 15) - (format-card () _type_ :state 16) - (create-file () _type_ :state 17) - (save () _type_ :state 18) - (restore () _type_ :state 19) - (error (mc-status-code) _type_ :state 20) - (done () _type_ :state 21) - (unformat-card () _type_ :state 22) + (:state-methods + get-heap + get-card + format-card + create-file + save + restore + (error mc-status-code) + done + unformat-card ) ) -(defmethod deactivate auto-save ((this auto-save)) +(defmethod deactivate ((this auto-save)) "Deactivate the auto-save process." ;; kill the particles (if (nonzero? (-> this part)) @@ -1202,7 +1192,7 @@ (none) ) -(defmethod relocate auto-save ((this auto-save) (arg0 int)) +(defmethod relocate ((this auto-save) (arg0 int)) "Relocate an auto-save process by arg0 bytes." ;; update our reference particle launch control, which is allocated on our process heap diff --git a/goal_src/jak1/engine/game/main-h.gc b/goal_src/jak1/engine/game/main-h.gc index 37b2c6605b5..2904e239855 100644 --- a/goal_src/jak1/engine/game/main-h.gc +++ b/goal_src/jak1/engine/game/main-h.gc @@ -132,26 +132,20 @@ ;; unused. (deftype frame-stats (structure) - ((field-time time-frame 2 :offset-assert 0) - (field int32 :offset-assert 16) + ((field-time time-frame 2) + (field int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (define *frame-stats* (new 'static 'frame-stats)) ;; full screen "filter" (just a giant quad over the whole screen) (deftype screen-filter (basic) - ((draw? basic :offset-assert 4) - (color rgba :offset-assert 8) + ((draw? basic) + (color rgba) ) - :method-count-assert 10 - :size-assert #xc - :flag-assert #xa0000000c (:methods - (draw (_type_) none 9) + (draw (_type_) none) ) ) diff --git a/goal_src/jak1/engine/game/main.gc b/goal_src/jak1/engine/game/main.gc index 0af80dbc0e7..7f91a3dd208 100644 --- a/goal_src/jak1/engine/game/main.gc +++ b/goal_src/jak1/engine/game/main.gc @@ -345,7 +345,7 @@ ) ) -(defmethod draw screen-filter ((this screen-filter)) +(defmethod draw ((this screen-filter)) (with-dma-buffer-add-bucket ((buf (-> (current-frame) global-buf)) (bucket-id debug-no-zbuf)) (draw-sprite2d-xy buf -256 (- (-> *video-parms* screen-hy)) 512 (-> *video-parms* screen-sy) (-> this color)) ) diff --git a/goal_src/jak1/engine/game/powerups.gc b/goal_src/jak1/engine/game/powerups.gc index 1eb10f55a85..20777e275c8 100644 --- a/goal_src/jak1/engine/game/powerups.gc +++ b/goal_src/jak1/engine/game/powerups.gc @@ -585,18 +585,18 @@ (set! (-> a0-33 settings shadow-dir y) (-> v1-67 y)) (set! (-> a0-33 settings shadow-dir z) (-> v1-67 z)) ) - (when (and (!= (-> self fact-info-target eco-level) 0.0) - (>= (- (-> *display* game-frame-counter) (-> self fact-info-target eco-pickup-time)) - (the-as time-frame (-> self fact-info-target eco-timeout)) + (when (and (!= (-> self fact eco-level) 0.0) + (>= (- (-> *display* game-frame-counter) (-> self fact eco-pickup-time)) + (the-as time-frame (-> self fact eco-timeout)) ) ) - (set! (-> self fact-info-target eco-level) 0.0) - (set! (-> self fact-info-target eco-timeout) 0) + (set! (-> self fact eco-level) 0.0) + (set! (-> self fact eco-timeout) 0) (logclear! (-> self state-flags) (state-flags invuln-powerup)) (send-event self 'reset-collide) (stop! (-> self sound)) ) - (when (and (< 0.0 (-> self fact-info-target eco-level)) + (when (and (< 0.0 (-> self fact eco-level)) (not (logtest? (-> self state-flags) (state-flags first-person-mode))) (not (logtest? (-> self draw status) (draw-status hidden no-anim))) (not (movie?)) @@ -604,8 +604,8 @@ (lerp-scale 0.0 1.0 - (the float (- (-> self fact-info-target eco-timeout) - (the-as uint (- (-> *display* game-frame-counter) (-> self fact-info-target eco-pickup-time))) + (the float (- (-> self fact eco-timeout) + (the-as uint (- (-> *display* game-frame-counter) (-> self fact eco-pickup-time))) ) ) 0.0 @@ -613,7 +613,7 @@ ) ) ) - (case (-> self fact-info-target eco-type) + (case (-> self fact eco-type) (((pickup-type eco-yellow)) (change-sound! (-> self sound) (static-sound-name "yel-eco-jak")) (let ((s4-0 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) diff --git a/goal_src/jak1/engine/game/projectiles-h.gc b/goal_src/jak1/engine/game/projectiles-h.gc index 31f339d4093..b41e4cd9552 100644 --- a/goal_src/jak1/engine/game/projectiles-h.gc +++ b/goal_src/jak1/engine/game/projectiles-h.gc @@ -11,65 +11,55 @@ ;; DECOMP BEGINS (deftype projectile (process-drawable) - ((root-override collide-shape-moving :offset 112) - (base-trans vector :inline :offset-assert 176) - (target vector :inline :offset-assert 192) - (target-base vector :inline :offset-assert 208) - (parent-base vector :inline :offset-assert 224) - (parent-quat vector :inline :offset-assert 240) - (base-vector vector :inline :offset-assert 256) - (timeout time-frame :offset-assert 272) - (options uint64 :offset-assert 280) - (last-target handle :offset-assert 288) - (notify-handle handle :offset-assert 296) - (max-speed float :offset-assert 304) - (max-turn float :offset-assert 308) - (old-dist float 16 :offset-assert 312) - (old-dist-count int32 :offset-assert 376) - (hits int32 :offset-assert 380) - (max-hits int32 :offset-assert 384) - (tween float :offset-assert 388) - (attack-mode symbol :offset-assert 392) - (update-velocity (function projectile none) :offset-assert 396) - (counter int32 :offset-assert 400) - (target-count int32 :offset-assert 404) - (sound-id sound-id :offset-assert 408) + ((root collide-shape-moving :override) + (base-trans vector :inline) + (target vector :inline) + (target-base vector :inline) + (parent-base vector :inline) + (parent-quat vector :inline) + (base-vector vector :inline) + (timeout time-frame) + (options uint64) + (last-target handle) + (notify-handle handle) + (max-speed float) + (max-turn float) + (old-dist float 16) + (old-dist-count int32) + (hits int32) + (max-hits int32) + (tween float) + (attack-mode symbol) + (update-velocity (function projectile none)) + (counter int32) + (target-count int32) + (sound-id sound-id) ) - :heap-base #x130 - :method-count-assert 29 - :size-assert #x19c - :flag-assert #x1d0130019c + (:state-methods + projectile-die + projectile-dissipate + projectile-impact + projectile-moving + ) (:methods - (projectile-die () _type_ :state 20) - (projectile-dissipate () _type_ :state 21) - (projectile-impact () _type_ :state 22) - (projectile-moving () _type_ :state 23) - (projectile-method-24 (_type_) none 24) - (projectile-method-25 (_type_) none 25) - (projectile-method-26 (_type_) none 26) - (projectile-method-27 (_type_) none 27) - (projectile-method-28 (_type_) none 28) + (projectile-method-24 (_type_) none) + (projectile-method-25 (_type_) none) + (projectile-method-26 (_type_) none) + (projectile-method-27 (_type_) none) + (projectile-method-28 (_type_) none) ) ) (deftype projectile-yellow (projectile) - ((mode int32 :offset-assert 412) - (angle float :offset-assert 416) + ((mode int32) + (angle float) ) - :heap-base #x140 - :method-count-assert 29 - :size-assert #x1a4 - :flag-assert #x1d014001a4 ) (deftype projectile-blue (projectile) - ((mode int32 :offset-assert 412) - (joint-num int32 :offset-assert 416) + ((mode int32) + (joint-num int32) ) - :heap-base #x140 - :method-count-assert 29 - :size-assert #x1a4 - :flag-assert #x1d014001a4 ) diff --git a/goal_src/jak1/engine/game/projectiles.gc b/goal_src/jak1/engine/game/projectiles.gc index 677fb58031d..26a6d347f83 100644 --- a/goal_src/jak1/engine/game/projectiles.gc +++ b/goal_src/jak1/engine/game/projectiles.gc @@ -9,21 +9,18 @@ ;; DECOMP BEGINS (deftype search-info (structure) - ((point vector :inline :offset-assert 0) - (best-point vector :inline :offset-assert 16) - (match-handle handle :offset-assert 32) - (match projectile :offset-assert 40) - (best float :offset-assert 44) - (radius float :offset-assert 48) - (rating uint32 :offset-assert 52) - (require uint32 :offset-assert 56) - (mask uint32 :offset-assert 60) - (rot-base vector :inline :offset-assert 64) - (rot-range float :offset-assert 80) + ((point vector :inline) + (best-point vector :inline) + (match-handle handle) + (match projectile) + (best float) + (radius float) + (rating uint32) + (require uint32) + (mask uint32) + (rot-base vector :inline) + (rot-range float) ) - :method-count-assert 9 - :size-assert #x54 - :flag-assert #x900000054 ) @@ -56,7 +53,7 @@ ) ) (when s5-0 - (let* ((s3-0 (-> s5-0 root-override)) + (let* ((s3-0 (-> s5-0 root)) (s4-1 (if (and (nonzero? s3-0) (type-type? (-> s3-0 type) collide-shape)) s3-0 ) @@ -587,13 +584,13 @@ :init-specs ((:fade-r -0.53333336) (:fade-g -0.53333336) (:fade-b -1.0666667) (:fade-a -0.53333336)) ) -(defmethod projectile-method-24 projectile ((this projectile)) - (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) +(defmethod projectile-method-24 ((this projectile)) + (spawn (-> this part) (the-as vector (-> this root root-prim prim-core))) 0 (none) ) -(defmethod projectile-method-28 projectile ((this projectile)) +(defmethod projectile-method-28 ((this projectile)) 0 (none) ) @@ -657,7 +654,7 @@ ((-> self update-velocity) self) (when (logtest? (-> self options) 2) (seek! (-> self tween) 1.0 (* 0.5 (seconds-per-frame))) - (let ((f0-6 (vector-vector-distance (-> self root-override trans) (-> self target)))) + (let ((f0-6 (vector-vector-distance (-> self root trans) (-> self target)))) (cond ((< f0-6 20480.0) (seek! (-> self tween) 1.0 (* 3.0 (seconds-per-frame))) @@ -669,14 +666,10 @@ ) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> self root-override trans quad)) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (-> self root-override root-prim collide-with) - ) + (set! (-> s3-0 quad) (-> self root trans quad)) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (-> self root root-prim collide-with)) (set! (-> self old-dist (-> self old-dist-count)) - (* 0.0625 (vector-vector-distance s3-0 (-> self root-override trans))) + (* 0.0625 (vector-vector-distance s3-0 (-> self root trans))) ) ) (set! (-> self old-dist-count) (logand (+ (-> self old-dist-count) 1) 15)) @@ -685,9 +678,7 @@ (+! f0-16 (-> self old-dist v1-35)) ) ;; og:preserve-this changed for high fps. This fixes projectile collision issues - (if (or (and (logtest? (-> self root-override status) (cshape-moving-flags twall)) (< f0-16 (* (-> *display* time-adjust-ratio) 2048.0))) - (< f0-16 (* (-> *display* time-adjust-ratio) 204.8)) - ) + (if (or (and (logtest? (-> self root status) (cshape-moving-flags twall)) (< f0-16 (* (-> *display* time-adjust-ratio) 2048.0))) (< f0-16 (* (-> *display* time-adjust-ratio) 2048.0))) (set! gp-0 #t) ) ) @@ -703,13 +694,13 @@ ) (defun projectile-update-velocity-space-wars ((arg0 projectile)) - (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target) (-> arg0 root-override trans)))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target) (-> arg0 root trans)))) (let ((s4-0 (new 'stack-no-clear 'vector)) - (s3-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) - (f30-0 (vector-length (-> arg0 root-override transv))) + (s3-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root transv) 1.0)) + (f30-0 (vector-length (-> arg0 root transv))) ) - (if (logtest? (-> arg0 root-override status) (cshape-moving-flags tsurf)) - (vector-flatten! s5-1 s5-1 (-> arg0 root-override local-normal)) + (if (logtest? (-> arg0 root status) (cshape-moving-flags tsurf)) + (vector-flatten! s5-1 s5-1 (-> arg0 root local-normal)) ) (vector-normalize-copy! s4-0 s5-1 1.0) (if (and (or (not (handle->process (-> arg0 last-target))) @@ -719,20 +710,17 @@ ) (go (method-of-object arg0 projectile-dissipate)) ) - (vector-deg-slerp (-> arg0 root-override transv) s3-0 s4-0 (-> arg0 tween)) - (vector-normalize! (-> arg0 root-override transv) f30-0) + (vector-deg-slerp (-> arg0 root transv) s3-0 s4-0 (-> arg0 tween)) + (vector-normalize! (-> arg0 root transv) f30-0) ) - (vector+! (-> arg0 root-override transv) (-> arg0 root-override transv) s5-1) - ) - (vector-v++! - (-> arg0 root-override transv) - (compute-acc-due-to-gravity (-> arg0 root-override) (new-stack-vector0) 0.0) + (vector+! (-> arg0 root transv) (-> arg0 root transv) s5-1) ) - (if (< (-> arg0 max-speed) (vector-length (-> arg0 root-override transv))) - (vector-normalize! (-> arg0 root-override transv) (-> arg0 max-speed)) + (vector-v++! (-> arg0 root transv) (compute-acc-due-to-gravity (-> arg0 root) (new-stack-vector0) 0.0)) + (if (< (-> arg0 max-speed) (vector-length (-> arg0 root transv))) + (vector-normalize! (-> arg0 root transv) (-> arg0 max-speed)) ) (if (logtest? (-> arg0 options) 1) - (set! (-> arg0 root-override transv y) -40960.0) + (set! (-> arg0 root transv y) -40960.0) ) 0 (none) @@ -749,7 +737,7 @@ #f #f #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to *entity-pool* ) (if (nonzero? (-> self sound-id)) @@ -772,7 +760,7 @@ #f #f #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to *entity-pool* ) (if (nonzero? (-> self sound-id)) @@ -784,12 +772,12 @@ ) ) -(defmethod projectile-method-27 projectile ((this projectile)) +(defmethod projectile-method-27 ((this projectile)) 0 (none) ) -(defmethod projectile-method-26 projectile ((this projectile)) +(defmethod projectile-method-26 ((this projectile)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) @@ -808,13 +796,13 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod projectile-method-25 projectile ((this projectile)) +(defmethod projectile-method-25 ((this projectile)) (go (method-of-object this projectile-moving)) 0 (none) @@ -832,7 +820,7 @@ ) ) -(defmethod deactivate projectile ((this projectile)) +(defmethod deactivate ((this projectile)) (if (nonzero? (-> this sound-id)) (sound-stop (-> this sound-id)) ) @@ -856,21 +844,21 @@ (set! (-> self old-dist v1-4) 4095996000.0) ) (projectile-method-26 self) - (set! (-> self root-override dynam gravity y) 1228800.0) - (set! (-> self root-override dynam gravity-length) 1228800.0) - (set! (-> self root-override dynam gravity-max) 1228800.0) - (set! (-> self root-override trans quad) (-> arg1 quad)) + (set! (-> self root dynam gravity y) 1228800.0) + (set! (-> self root dynam gravity-length) 1228800.0) + (set! (-> self root dynam gravity-max) 1228800.0) + (set! (-> self root trans quad) (-> arg1 quad)) (set! (-> self base-trans quad) (-> arg1 quad)) (set! (-> self parent-base quad) (-> arg1 quad)) - (quaternion-copy! (-> self root-override quat) (-> (the-as process-drawable (-> self parent 0)) root quat)) + (quaternion-copy! (-> self root quat) (-> (the-as process-drawable (-> self parent 0)) root quat)) (quaternion-copy! (the-as quaternion (-> self parent-quat)) (-> (the-as process-drawable (-> self parent 0)) root quat) ) - (vector-identity! (-> self root-override scale)) - (set! (-> self root-override transv quad) (-> arg2 quad)) + (vector-identity! (-> self root scale)) + (set! (-> self root transv quad) (-> arg2 quad)) (vector-normalize-copy! (-> self base-vector) arg2 1.0) - (vector+float*! (-> self target) (-> self root-override trans) (-> self root-override transv) 2.0) + (vector+float*! (-> self target) (-> self root trans) (-> self root transv) 2.0) (set! (-> self target-base quad) (-> self target quad)) (projectile-method-27 self) (projectile-method-24 self) @@ -878,7 +866,7 @@ (let ((a1-8 (new 'stack-no-clear 'collide-edge-hold-list))) (set! (-> a1-8 num-allocs) (the-as uint 1)) (set! (-> a1-8 num-attempts) (the-as uint *touching-list*)) - (find-overlapping-shapes (-> self root-override) (the-as overlaps-others-params a1-8)) + (find-overlapping-shapes (-> self root) (the-as overlaps-others-params a1-8)) ) ) (set! (-> self event-hook) (-> (method-of-object self projectile-moving) event)) @@ -886,21 +874,21 @@ (none) ) -(defmethod projectile-method-27 projectile-yellow ((this projectile-yellow)) +(defmethod projectile-method-27 ((this projectile-yellow)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (set! (-> this attack-mode) 'eco-yellow) (set! (-> this mode) 1) - (set! (-> this max-speed) (vector-length (-> this root-override transv))) + (set! (-> this max-speed) (vector-length (-> this root transv))) (set! (-> this update-velocity) projectile-update-velocity-space-wars) - (set! (-> this angle) (vector-y-angle (-> this root-override transv))) + (set! (-> this angle) (vector-y-angle (-> this root transv))) (set! (-> this tween) 0.05) (logior! (-> this options) 2) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root-override trans quad)) - (+! (-> this root-override trans y) -5324.8) - (vector+float*! (-> this target) (-> this root-override trans) (-> this root-override transv) 2.0) + (set! (-> s5-0 quad) (-> this root trans quad)) + (+! (-> this root trans y) -5324.8) + (vector+float*! (-> this target) (-> this root trans) (-> this root transv) 2.0) (set! (-> this target-base quad) (-> this target quad)) - (let ((f30-0 (the float (sar (shl (the int (y-angle (-> this root-override))) 48) 48)))) + (let ((f30-0 (the float (sar (shl (the int (y-angle (-> this root))) 48) 48)))) (set! (-> this mask) (the-as process-mask (logior (process-mask projectile) (-> this mask)))) (if (logtest? (-> this options) 16) (set! (-> this max-hits) 1) @@ -930,22 +918,22 @@ 10240.0 ) ) - (logior! (-> this root-override root-prim collide-with) (collide-kind water)) + (logior! (-> this root root-prim collide-with) (collide-kind water)) ) (('ogre) (when (not (logtest? (-> this options) 128)) (set! (-> this water) (new 'process 'water-control this 0 0.0 8192.0 2048.0)) (set! (-> this water flags) (water-flags wt01 wt04 wt07)) (set! (-> this water height) 129024.0) - (logior! (-> this root-override root-prim collide-with) (collide-kind water)) + (logior! (-> this root root-prim collide-with) (collide-kind water)) ) ) (('finalboss) - (+! (-> this root-override trans y) 4096.0) + (+! (-> this root trans y) 4096.0) (set! (-> this water) (new 'process 'water-control this 0 0.0 8192.0 2048.0)) (set! (-> this water flags) (water-flags wt01 wt04 wt07)) (set! (-> this water height) 1977958.4) - (logior! (-> this root-override root-prim collide-with) (collide-kind water)) + (logior! (-> this root root-prim collide-with) (collide-kind water)) ) ) ) @@ -953,29 +941,29 @@ (none) ) -(defmethod projectile-method-26 projectile-yellow ((this projectile-yellow)) +(defmethod projectile-method-26 ((this projectile-yellow)) (let ((t9-0 (method-of-type projectile projectile-method-26))) (t9-0 this) ) - (logior! (-> this root-override root-prim collide-with) (collide-kind mother-spider)) + (logior! (-> this root root-prim collide-with) (collide-kind mother-spider)) (none) ) -(defmethod projectile-method-24 projectile-yellow ((this projectile-yellow)) +(defmethod projectile-method-24 ((this projectile-yellow)) (with-pp (find-ground-and-draw-shadow - (-> this root-override trans) - (-> this root-override shadow-pos) + (-> this root trans) + (-> this root shadow-pos) 8192.0 (collide-kind background) (the-as process-drawable #f) 12288.0 81920.0 ) - (if (< (-> this root-override trans y) (-> this root-override shadow-pos y)) - (set! (-> this root-override trans y) (+ 1228.8 (-> this root-override shadow-pos y))) + (if (< (-> this root trans y) (-> this root shadow-pos y)) + (set! (-> this root trans y) (+ 1228.8 (-> this root shadow-pos y))) ) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> *part-id-table* 353 init-specs 16 initial-valuef) (the-as float 30)) (set! (-> *part-id-table* 353 init-specs 16 random-rangef) (the-as float 300)) (cond @@ -986,17 +974,17 @@ (set! (-> *part-id-table* 353 init-specs 16 random-rangef) (the-as float 0)) 0 ) - (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) + (spawn (-> this part) (the-as vector (-> this root root-prim prim-core))) ) ) (else - (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) + (spawn (-> this part) (the-as vector (-> this root root-prim prim-core))) ) ) (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) (set! (-> s5-0 id) (-> this sound-id)) - (let ((a1-3 (-> this root-override trans))) + (let ((a1-3 (-> this root trans))) (let ((gp-1 pp)) (when (= a1-3 #t) (if (and gp-1 (type-type? (-> gp-1 type) process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root))) @@ -1015,7 +1003,7 @@ ) ) -(defmethod projectile-method-28 projectile-yellow ((this projectile-yellow)) +(defmethod projectile-method-28 ((this projectile-yellow)) (cond ((or (not (handle->process (-> this last-target))) (zero? (-> (the-as target (handle->process (-> this last-target))) control root-prim prim-core collide-as)) @@ -1066,7 +1054,7 @@ ) (set! (-> this last-target) (process->handle s5-0)) (when s5-0 - (set! (-> this target quad) (-> s5-0 root-override root-prim prim-core world-sphere quad)) + (set! (-> this target quad) (-> s5-0 root root-prim prim-core world-sphere quad)) (if (= (-> s5-0 type symbol) 'mother-spider) (logand! (-> this options) -2) ) @@ -1082,8 +1070,8 @@ (let ((a1-8 (handle->process (-> this last-target)))) (set! (-> this target quad) (-> (the-as target a1-8) control root-prim prim-core world-sphere quad)) ) - (if (and (< (vector-vector-xz-distance (-> this root-override trans) (-> this target)) 20480.0) - (< 24576.0 (fabs (- (-> this target y) (-> this root-override trans y)))) + (if (and (< (vector-vector-xz-distance (-> this root trans) (-> this target)) 20480.0) + (< 24576.0 (fabs (- (-> this target y) (-> this root trans y)))) ) (set! (-> this last-target) (the-as handle #f)) ) @@ -1094,18 +1082,18 @@ (none) ) -(defmethod projectile-method-27 projectile-blue ((this projectile-blue)) +(defmethod projectile-method-27 ((this projectile-blue)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (sound-play "blue-eco-on") (set! (-> this mode) 2) (set! (-> this max-speed) (-> *TARGET-bank* yellow-projectile-speed)) (set! (-> this update-velocity) projectile-update-velocity-space-wars) - (+! (-> this root-override trans y) -5324.8) - (vector+float*! (-> this target) (-> this root-override trans) (-> this root-override transv) 2.0) + (+! (-> this root trans y) -5324.8) + (vector+float*! (-> this target) (-> this root trans) (-> this root transv) 2.0) (set! (-> this target-base quad) (-> this target quad)) (set! (-> this mask) (the-as process-mask (logior (process-mask ambient) (-> this mask)))) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 42) this)) - (set! (-> this root-override root-prim collide-with) (collide-kind background)) + (set! (-> this root root-prim collide-with) (collide-kind background)) (let* ((s5-1 (handle->process (-> this last-target))) (v1-20 (if (and (nonzero? s5-1) (type-type? (-> s5-1 type) process-drawable)) s5-1 @@ -1120,7 +1108,7 @@ (none) ) -(defmethod projectile-method-26 projectile-blue ((this projectile-blue)) +(defmethod projectile-method-26 ((this projectile-blue)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) @@ -1139,7 +1127,7 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1194,7 +1182,7 @@ ) ) -(defmethod projectile-method-28 projectile-blue ((this projectile-blue)) +(defmethod projectile-method-28 ((this projectile-blue)) (let* ((s5-0 (handle->process (-> this last-target))) (v1-4 (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) process-drawable)) s5-0 @@ -1205,16 +1193,16 @@ (vector<-cspace! (-> this target) (-> (the-as process-drawable v1-4) node-list data (-> this joint-num))) ) ) - (if (< (vector-vector-distance (-> this target) (-> this root-override trans)) 4096.0) + (if (< (vector-vector-distance (-> this target) (-> this root trans)) 4096.0) (go (method-of-object this projectile-impact)) ) 0 (none) ) -(defmethod projectile-method-24 projectile-blue ((this projectile-blue)) +(defmethod projectile-method-24 ((this projectile-blue)) (if (rand-vu-percent? 0.75) - (eco-blue-glow (the-as vector (-> this root-override root-prim prim-core))) + (eco-blue-glow (the-as vector (-> this root root-prim prim-core))) ) 0 (none) diff --git a/goal_src/jak1/engine/game/settings-h.gc b/goal_src/jak1/engine/game/settings-h.gc index 36c1d7e94c6..5bb88502a53 100644 --- a/goal_src/jak1/engine/game/settings-h.gc +++ b/goal_src/jak1/engine/game/settings-h.gc @@ -15,96 +15,50 @@ ;; The full setting state. (deftype setting-data (structure) - ((border-mode symbol :offset-assert 0) - (sfx-volume float :offset-assert 4) - (music-volume float :offset-assert 8) - (dialog-volume float :offset-assert 12) - (process-mask process-mask :offset-assert 16) - (common-page int32 :offset-assert 20) - (language language-enum :offset-assert 24) - (screenx int32 :offset-assert 32) - (screeny int32 :offset-assert 36) - (vibration symbol :offset-assert 40) - (play-hints symbol :offset-assert 44) - (movie (pointer process) :offset-assert 48) - (talking (pointer process) :offset-assert 52) - (spooling (pointer process) :offset-assert 56) - (hint (pointer process) :offset-assert 60) - (ambient (pointer process) :offset-assert 64) - (video-mode symbol :offset-assert 68) - (aspect-ratio symbol :offset-assert 72) - (sound-flava uint8 :offset-assert 76) - (auto-save symbol :offset-assert 80) - (music-volume-movie float :offset-assert 84) - (sfx-volume-movie float :offset-assert 88) - (music symbol :offset-assert 92) - (bg-r float :offset-assert 96) - (bg-g float :offset-assert 100) - (bg-b float :offset-assert 104) - (bg-a float :offset-assert 108) - (bg-a-speed float :offset-assert 112) - (bg-a-force float :offset-assert 116) - (allow-progress symbol :offset-assert 120) - (allow-pause symbol :offset-assert 124) - (sound-flava-priority float :offset-assert 128) - (ocean-off symbol :offset-assert 132) - (allow-look-around symbol :offset-assert 136) - (ambient-volume float :offset-assert 140) - (ambient-volume-movie float :offset-assert 144) - (dialog-volume-hint float :offset-assert 148) - (dummy uint32 11 :offset-assert 152) + ((border-mode symbol) + (sfx-volume float) + (music-volume float) + (dialog-volume float) + (process-mask process-mask) + (common-page int32) + (language language-enum) + (screenx int32) + (screeny int32) + (vibration symbol) + (play-hints symbol) + (movie (pointer process)) + (talking (pointer process)) + (spooling (pointer process)) + (hint (pointer process)) + (ambient (pointer process)) + (video-mode symbol) + (aspect-ratio symbol) + (sound-flava uint8) + (auto-save symbol) + (music-volume-movie float) + (sfx-volume-movie float) + (music symbol) + (bg-r float) + (bg-g float) + (bg-b float) + (bg-a float) + (bg-a-speed float) + (bg-a-force float) + (allow-progress symbol) + (allow-pause symbol) + (sound-flava-priority float) + (ocean-off symbol) + (allow-look-around symbol) + (ambient-volume float) + (ambient-volume-movie float) + (dialog-volume-hint float) + (dummy uint32 11) ) - :method-count-assert 10 - :size-assert #xc4 - :flag-assert #xa000000c4 (:methods - (update-from-engine (_type_ engine) setting-data 9) + (update-from-engine (_type_ engine) setting-data) ) ) -(defmethod inspect setting-data ((this setting-data)) - (format #t "[~8x] ~A~%" this 'setting-data) - (format #t "~Tborder-mode: ~A~%" (-> this border-mode)) - (format #t "~Tsfx-volume: ~f~%" (-> this sfx-volume)) - (format #t "~Tmusic-volume: ~f~%" (-> this music-volume)) - (format #t "~Tdialog-volume: ~f~%" (-> this dialog-volume)) - (format #t "~Tprocess-mask: ~D~%" (-> this process-mask)) - (format #t "~Tcommon-page: ~D~%" (-> this common-page)) - (format #t "~Tlanguage: ~D~%" (-> this language)) - (format #t "~Tscreenx: ~D~%" (-> this screenx)) - (format #t "~Tscreeny: ~D~%" (-> this screeny)) - (format #t "~Tvibration: ~A~%" (-> this vibration)) - (format #t "~Tplay-hints: ~A~%" (-> this play-hints)) - (format #t "~Tmovie: ~A~%" (ppointer->process (-> this movie))) - (format #t "~Ttalking: ~A~%" (ppointer->process (-> this talking))) - (format #t "~Tspooling: ~A~%" (ppointer->process (-> this spooling))) - (format #t "~Thint: ~A~%" (ppointer->process (-> this hint))) - (format #t "~Tambient: ~A~%" (ppointer->process (-> this ambient))) - (format #t "~Tvideo-mode: ~A~%" (-> this video-mode)) - (format #t "~Taspect-ratio: ~A~%" (-> this aspect-ratio)) - (format #t "~Tsound-flava: ~D~%" (-> this sound-flava)) - (format #t "~Tauto-save: ~A~%" (-> this auto-save)) - (format #t "~Tmusic-volume-movie: ~f~%" (-> this music-volume-movie)) - (format #t "~Tsfx-volume-movie: ~f~%" (-> this sfx-volume-movie)) - (format #t "~Tmusic: ~A~%" (-> this music)) - (format #t "~Tbg-r: ~f~%" (-> this bg-r)) - (format #t "~Tbg-g: ~f~%" (-> this bg-g)) - (format #t "~Tbg-b: ~f~%" (-> this bg-b)) - (format #t "~Tbg-a: ~f~%" (-> this bg-a)) - (format #t "~Tbg-a-speed: ~f~%" (-> this bg-a-speed)) - (format #t "~Tbg-a-force: ~f~%" (-> this bg-a-force)) - (format #t "~Tallow-progress: ~A~%" (-> this allow-progress)) - (format #t "~Tallow-pause: ~A~%" (-> this allow-pause)) - (format #t "~Tsound-flava-priority: ~f~%" (-> this sound-flava-priority)) - (format #t "~Tocean-off: ~A~%" (-> this ocean-off)) - (format #t "~Tallow-look-around: ~A~%" (-> this allow-look-around)) - (format #t "~Tambient-volume: ~f~%" (-> this ambient-volume)) - (format #t "~Tambient-volume-movie: ~f~%" (-> this ambient-volume-movie)) - (format #t "~Tdialog-volume-hint: ~f~%" (-> this dialog-volume-hint)) - (format #t "~Tdummy[11] @ #x~X~%" (-> this dummy)) - this - ) - ;; There are three copies of setting data: ;; - default - if nothing is requesting a setting to be set, you end up with this value. ;; - target - the default settings, plus the changes from all processes @@ -113,21 +67,18 @@ ;; The setting-control manages the current/target/default system. ;; The setting requests are managed by the engine. (deftype setting-control (basic) - ((current setting-data :inline :offset-assert 16) - (target setting-data :inline :offset-assert 224) - (default setting-data :inline :offset-assert 432) - (engine engine :offset-assert 628) + ((current setting-data :inline) + (target setting-data :inline) + (default setting-data :inline) + (engine engine) ) - :method-count-assert 14 - :size-assert #x278 - :flag-assert #xe00000278 (:methods - (new (symbol type int) _type_ 0) - (add-setting (_type_ process symbol object object object) none 9) - (set-setting (_type_ process symbol object object object) none 10) - (remove-setting (_type_ process symbol) none 11) - (apply-settings (_type_) setting-data 12) - (update (_type_) setting-data 13) + (new (symbol type int) _type_) + (add-setting (_type_ process symbol object object object) none) + (set-setting (_type_ process symbol object object object) none) + (remove-setting (_type_ process symbol) none) + (apply-settings (_type_) setting-data) + (update (_type_) setting-data) ) ) @@ -220,18 +171,15 @@ ;; used for memory card time information (deftype scf-time (structure) - ((stat uint8 :offset-assert 0) - (second uint8 :offset-assert 1) - (minute uint8 :offset-assert 2) - (hour uint8 :offset-assert 3) - (week uint8 :offset-assert 4) - (day uint8 :offset-assert 5) - (month uint8 :offset-assert 6) - (year uint8 :offset-assert 7) + ((stat uint8) + (second uint8) + (minute uint8) + (hour uint8) + (week uint8) + (day uint8) + (month uint8) + (year uint8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (define-extern *setting-control* setting-control) \ No newline at end of file diff --git a/goal_src/jak1/engine/game/settings.gc b/goal_src/jak1/engine/game/settings.gc index a239c2a7ca3..29074625d65 100644 --- a/goal_src/jak1/engine/game/settings.gc +++ b/goal_src/jak1/engine/game/settings.gc @@ -11,7 +11,7 @@ ;; DECOMP BEGINS -(defmethod update-from-engine setting-data ((this setting-data) (arg0 engine)) +(defmethod update-from-engine ((this setting-data) (arg0 engine)) "this goes through the list of desired setting changes in the engine/connection list and updates the setting-data" (let ((conn (the-as connection (-> arg0 alive-list-end))) @@ -45,7 +45,7 @@ ) ) (('sfx-volume) - (when (or (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask progress))) + (when (or (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask progress))) (= (get-process conn) (ppointer->process *progress-process*)) ) (case (the-as symbol (-> conn param1)) @@ -203,14 +203,14 @@ this ) -(defmethod add-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) +(defmethod add-setting ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) "add a setting for the process." (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 (none) ) -(defmethod set-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) +(defmethod set-setting ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) "(re-)sets a setting for the process." (remove-setting this arg0 arg1) (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) @@ -218,7 +218,7 @@ (none) ) -(defmethod remove-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol)) +(defmethod remove-setting ((this setting-control) (arg0 process) (arg1 symbol)) "remove a setting from the specified process. if arg1 = #t then remove ALL settings for that process" (when arg0 @@ -239,8 +239,7 @@ (none) ) - -(defmethod apply-settings setting-control ((this setting-control)) +(defmethod apply-settings ((this setting-control)) "Update the current settings. This only updates settings that are 'safe' to do multiple times per frame." (let ((gp-0 (-> this current))) (let ((s5-0 (-> this target))) @@ -278,8 +277,7 @@ ) ) - -(defmethod update setting-control ((this setting-control)) +(defmethod update ((this setting-control)) "Do a per-frame update of all settings" ;; compute all settings (apply-settings this) @@ -290,19 +288,19 @@ ;; the volume change is done slowly (when *sound-player-enable* (when (!= (-> gp-0 sfx-volume) (-> s5-1 sfx-volume)) - (seek! (-> gp-0 sfx-volume) (-> s5-1 sfx-volume) (* 100.0 (-> *display* seconds-per-frame))) + (seek! (-> gp-0 sfx-volume) (-> s5-1 sfx-volume) (* 100.0 (seconds-per-frame))) (sound-set-volume (sound-group sfx) (-> gp-0 sfx-volume)) ) (when (!= (-> gp-0 music-volume) (-> s5-1 music-volume)) - (seek! (-> gp-0 music-volume) (-> s5-1 music-volume) (* 100.0 (-> *display* seconds-per-frame))) + (seek! (-> gp-0 music-volume) (-> s5-1 music-volume) (* 100.0 (seconds-per-frame))) (sound-set-volume (sound-group music) (-> gp-0 music-volume)) ) (when (!= (-> gp-0 dialog-volume) (-> s5-1 dialog-volume)) - (seek! (-> gp-0 dialog-volume) (-> s5-1 dialog-volume) (* 100.0 (-> *display* seconds-per-frame))) + (seek! (-> gp-0 dialog-volume) (-> s5-1 dialog-volume) (* 100.0 (seconds-per-frame))) (sound-set-volume (sound-group dialog) (-> gp-0 dialog-volume)) ) (when (!= (-> gp-0 ambient-volume) (-> s5-1 ambient-volume)) - (seek! (-> gp-0 ambient-volume) (-> s5-1 ambient-volume) (* 100.0 (-> *display* seconds-per-frame))) + (seek! (-> gp-0 ambient-volume) (-> s5-1 ambient-volume) (* 100.0 (seconds-per-frame))) (sound-set-volume (sound-group ambient) (-> gp-0 ambient-volume)) ) ) @@ -329,11 +327,7 @@ ;; try to load music (when (and (!= (-> s5-1 music) (-> gp-0 music)) - (and (< 0.0 (-> *setting-control* current music-volume)) - (zero? (rpc-busy? 1)) - *sound-bank-1* - *sound-bank-2* - ) + (and (< 0.0 (-> *setting-control* current music-volume)) (zero? (rpc-busy? 1)) *sound-bank-1* *sound-bank-2*) ) (cond ((-> s5-1 music) @@ -384,7 +378,7 @@ (set! (-> gp-0 bg-r) (-> s5-1 bg-r)) (set! (-> gp-0 bg-g) (-> s5-1 bg-g)) (set! (-> gp-0 bg-b) (-> s5-1 bg-b)) - (seek! (-> gp-0 bg-a) (-> s5-1 bg-a) (* (-> s5-1 bg-a-speed) (-> *display* seconds-per-frame))) + (seek! (-> gp-0 bg-a) (-> s5-1 bg-a) (* (-> s5-1 bg-a-speed) (seconds-per-frame))) ) (let ((v1-60 (-> *display* frames (-> *display* on-screen) display)) (f0-39 (-> gp-0 bg-a)) diff --git a/goal_src/jak1/engine/game/task/hint-control-h.gc b/goal_src/jak1/engine/game/task/hint-control-h.gc index 28e0abf05df..2c1bc596f3a 100644 --- a/goal_src/jak1/engine/game/task/hint-control-h.gc +++ b/goal_src/jak1/engine/game/task/hint-control-h.gc @@ -34,34 +34,26 @@ ;; information about an in-level hint. These aren't tied to a specific object or task. (deftype level-hint-control (structure) - ((delay-before-playing time-frame :offset-assert 0) - (id text-id :offset-assert 8) - (num-attempts-before-playing int8 :offset-assert 12) - (num-success-before-killing int8 :offset-assert 13) - (num-attempts int8 :offset-assert 14) - (num-success int8 :offset-assert 15) - (start-time time-frame :offset-assert 16) - (last-time-called time-frame :offset-assert 24) + ((delay-before-playing time-frame) + (id text-id) + (num-attempts-before-playing int8) + (num-success-before-killing int8) + (num-attempts int8) + (num-success int8) + (start-time time-frame) + (last-time-called time-frame) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; a "task hint" is explicitly tied to an in-game task. (deftype task-hint-control (structure) - ((task game-task :offset-assert 0) - (delay time-frame :offset-assert 8) + ((task game-task) + (delay time-frame) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype task-hint-control-group (structure) - ((tasks (array task-hint-control) :offset-assert 0) + ((tasks (array task-hint-control)) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 - ) \ No newline at end of file + ) diff --git a/goal_src/jak1/engine/game/task/task-control-h.gc b/goal_src/jak1/engine/game/task/task-control-h.gc index b77068914bb..d7df66eaba4 100644 --- a/goal_src/jak1/engine/game/task/task-control-h.gc +++ b/goal_src/jak1/engine/game/task/task-control-h.gc @@ -50,131 +50,120 @@ ;; DECOMP BEGINS (deftype task-cstage (structure) - ((game-task game-task :offset-assert 0) - (status task-status :offset-assert 8) - (flags task-flags :offset-assert 16) - (condition (function task-control symbol) :offset-assert 20) + ((game-task game-task) + (status task-status) + (flags task-flags) + (condition (function task-control symbol)) ) - :method-count-assert 16 - :size-assert #x18 - :flag-assert #x1000000018 (:methods - (get-task (_type_) game-task 9) - (get-status (_type_) task-status 10) - (task-available? (_type_ task-control) symbol 11) - (closed? (_type_) symbol 12) - (closed-by-default? (_type_) symbol 13) - (close-task! (_type_) int 14) - (open-task! (_type_) int 15) + (get-task (_type_) game-task) + (get-status (_type_) task-status) + (task-available? (_type_ task-control) symbol) + (closed? (_type_) symbol) + (closed-by-default? (_type_) symbol) + (close-task! (_type_) int) + (open-task! (_type_) int) ) ) (deftype task-control (basic) - ((current-stage int16 :offset-assert 4) - (stage (array task-cstage) :offset-assert 8) + ((current-stage int16) + (stage (array task-cstage)) ) - :method-count-assert 19 - :size-assert #xc - :flag-assert #x130000000c (:methods - (current-task (_type_) game-task 9) - (current-status (_type_) task-status 10) - (close-current! (_type_) game-task 11) - (close-status! (_type_ task-status) game-task 12) - (first-any (_type_ symbol) game-task 13) - (reset! (_type_ symbol symbol) int 14) - (closed? (_type_ game-task task-status) symbol 15) - (get-reminder (_type_ int) int 16) - (save-reminder (_type_ int int) int 17) - (exists? (_type_ game-task task-status) symbol 18) + (current-task (_type_) game-task) + (current-status (_type_) task-status) + (close-current! (_type_) game-task) + (close-status! (_type_ task-status) game-task) + (first-any (_type_ symbol) game-task) + (reset! (_type_ symbol symbol) int) + (closed? (_type_ game-task task-status) symbol) + (get-reminder (_type_ int) int) + (save-reminder (_type_ int int) int) + (exists? (_type_ game-task task-status) symbol) ) ) (deftype ambient-control (structure) - ((last-ambient-time time-frame :offset-assert 0) - (last-ambient string :offset-assert 8) - (last-ambient-id sound-id :offset-assert 12) + ((last-ambient-time time-frame) + (last-ambient string) + (last-ambient-id sound-id) ) :pack-me - :method-count-assert 12 - :size-assert #x10 - :flag-assert #xc00000010 (:methods - (ambient-control-method-9 (_type_) none 9) - (ambient-control-method-10 (_type_ vector time-frame float process-drawable) vector 10) - (play-ambient (_type_ string symbol vector) symbol 11) + (ambient-control-method-9 (_type_) none) + (ambient-control-method-10 (_type_ vector time-frame float process-drawable) vector) + (play-ambient (_type_ string symbol vector) symbol) ) ) (deftype process-taskable (process-drawable) - ((root-override collide-shape :offset 112) - (tasks task-control :offset-assert 176) - (query gui-query :inline :offset-assert 180) - (old-target-pos transformq :inline :offset-assert 208) - (cell-for-task game-task :offset-assert 256) - (cell-x handle :offset-assert 264) - (cam-joint-index int32 :offset-assert 272) - (skippable symbol :offset-assert 276) - (blend-on-exit art-joint-anim :offset-assert 280) - (camera handle :offset-assert 288) - (will-talk symbol :offset-assert 296) - (talk-message text-id :offset-assert 300) - (last-talk time-frame :offset-assert 304) - (bounce-away symbol :offset-assert 312) - (ambient ambient-control :inline :offset-assert 320) - (center-joint-index int32 :offset-assert 336) - (draw-bounds-y-offset float :offset-assert 340) - (neck-joint-index int32 :offset-assert 344) - (fuel-cell-anim spool-anim :offset-assert 348) - (sound-flava music-flava :offset-assert 352) - (have-flava symbol :offset-assert 356) - (music symbol :offset-assert 360) - (have-music symbol :offset-assert 364) - (been-kicked symbol :offset-assert 368) - (cur-trans-hook (function none) :offset-assert 372) - (shadow-backup shadow-geo :offset-assert 376) + ((root collide-shape :override) + (tasks task-control) + (query gui-query :inline) + (old-target-pos transformq :inline) + (cell-for-task game-task) + (cell-x handle) + (cam-joint-index int32) + (skippable symbol) + (blend-on-exit art-joint-anim) + (camera handle) + (will-talk symbol) + (talk-message text-id) + (last-talk time-frame) + (bounce-away symbol) + (ambient ambient-control :inline) + (center-joint-index int32) + (draw-bounds-y-offset float) + (neck-joint-index int32) + (fuel-cell-anim spool-anim) + (sound-flava music-flava) + (have-flava symbol) + (music symbol) + (have-music symbol) + (been-kicked symbol) + (cur-trans-hook (function none)) + (shadow-backup shadow-geo) ) - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c + (:state-methods + release + give-cell + lose + enter-playing + play-accept + play-reject + query + play-anim + hidden + (be-clone handle) + idle + ) (:methods - (release () _type_ :state 20) - (give-cell () _type_ :state 21) - (lose () _type_ :state 22) - (enter-playing () _type_ :state 23) - (play-accept () _type_ :state 24) - (play-reject () _type_ :state 25) - (query () _type_ :state 26) - (play-anim () _type_ :state 27) - (hidden () _type_ :state 28) - (be-clone (handle) _type_ :state 29) - (idle () _type_ :state 30) - (get-art-elem (_type_) art-element 31) - (play-anim! (_type_ symbol) basic 32) - (process-taskable-method-33 (_type_) none 33) - (get-accept-anim (_type_ symbol) spool-anim 34) - (push-accept-anim (_type_) none 35) - (get-reject-anim (_type_ symbol) spool-anim 36) - (push-reject-anim (_type_) none 37) - (process-taskable-method-38 (_type_) none 38) - (should-display? (_type_) symbol 39) - (process-taskable-method-40 (_type_ object skeleton-group int int vector int) none 40) - (initialize-collision (_type_ int vector) none 41) - (process-taskable-method-42 (_type_) none 42) - (process-taskable-method-43 (_type_) symbol 43) - (play-reminder (_type_) symbol 44) - (process-taskable-method-45 (_type_) symbol 45) - (process-taskable-method-46 (_type_) none 46) - (target-above-threshold? (_type_) symbol 47) - (draw-npc-shadow (_type_) none 48) - (hidden-other () _type_ :state 49) - (process-taskable-method-50 (_type_) symbol 50) - (close-anim-file! (_type_) symbol 51) - (process-taskable-method-52 (_type_) none 52) + (get-art-elem (_type_) art-element) + (play-anim! (_type_ symbol) basic) + (process-taskable-method-33 (_type_) none) + (get-accept-anim (_type_ symbol) spool-anim) + (push-accept-anim (_type_) none) + (get-reject-anim (_type_ symbol) spool-anim) + (push-reject-anim (_type_) none) + (process-taskable-method-38 (_type_) none) + (should-display? (_type_) symbol) + (process-taskable-method-40 (_type_ object skeleton-group int int vector int) none) + (initialize-collision (_type_ int vector) none) + (process-taskable-method-42 (_type_) none) + (process-taskable-method-43 (_type_) symbol) + (play-reminder (_type_) symbol) + (process-taskable-method-45 (_type_) symbol) + (process-taskable-method-46 (_type_) none) + (target-above-threshold? (_type_) symbol) + (draw-npc-shadow (_type_) none) + (hidden-other () _type_ :state) + (process-taskable-method-50 (_type_) symbol) + (close-anim-file! (_type_) symbol) + (process-taskable-method-52 (_type_) none) ) ) diff --git a/goal_src/jak1/engine/game/task/task-control.gc b/goal_src/jak1/engine/game/task/task-control.gc index b1390006d1e..f6ffe08eae0 100644 --- a/goal_src/jak1/engine/game/task/task-control.gc +++ b/goal_src/jak1/engine/game/task/task-control.gc @@ -11,31 +11,31 @@ (enum->string task-status arg0) ) -(defmethod get-task task-cstage ((this task-cstage)) +(defmethod get-task ((this task-cstage)) "Get the game task for this cstage" (-> this game-task) ) -(defmethod get-status task-cstage ((this task-cstage)) +(defmethod get-status ((this task-cstage)) "Get the status for this cstage" (-> this status) ) -(defmethod closed? task-cstage ((this task-cstage)) +(defmethod closed? ((this task-cstage)) "Is the closed flag set?" (declare (inline)) (logtest? (-> this flags) (task-flags closed)) ) -(defmethod closed-by-default? task-cstage ((this task-cstage)) +(defmethod closed-by-default? ((this task-cstage)) "Is the closed-by-default flag set?" (declare (inline)) (logtest? (-> this flags) (task-flags closed-by-default)) ) -(defmethod task-available? task-cstage ((this task-cstage) (arg0 task-control)) +(defmethod task-available? ((this task-cstage) (arg0 task-control)) "Is this task available to be the current task?" (cond ((closed? this) @@ -63,7 +63,7 @@ ) ) -(defmethod close-task! task-cstage ((this task-cstage)) +(defmethod close-task! ((this task-cstage)) "Close this task!" (if (= (-> this game-task) (game-task none)) ;; invalid task. @@ -88,21 +88,18 @@ 0 ) -(defmethod open-task! task-cstage ((this task-cstage)) +(defmethod open-task! ((this task-cstage)) "Clear the closed flag." (logclear! (-> this flags) (task-flags closed)) 0 ) ;; a task-control containing no cstages -(define *null-task-control* (new 'static 'task-control - :current-stage -1 - :stage - (new 'static 'boxed-array :type task-cstage :length 0 :allocated-length 0) - ) - ) +(define *null-task-control* + (new 'static 'task-control :current-stage -1 :stage (new 'static 'boxed-array :type task-cstage)) + ) -(defmethod current-task task-control ((this task-control)) +(defmethod current-task ((this task-control)) "Get the current task that is being played. If unknown returns the none task" (cond ((= this *null-task-control*) @@ -120,7 +117,7 @@ ) ) -(defmethod current-status task-control ((this task-control)) +(defmethod current-status ((this task-control)) "Get the status of the cstage that is being played. Will return invalid if not possible" (cond @@ -137,7 +134,7 @@ ) ) -(defmethod close-current! task-control ((this task-control)) +(defmethod close-current! ((this task-control)) (cond ((= this *null-task-control*) (format 0 "ERROR: close-current! received self of *null-task-control*~%~%") @@ -153,7 +150,7 @@ (first-any this #t) ) -(defmethod close-status! task-control ((this task-control) (arg0 task-status)) +(defmethod close-status! ((this task-control) (arg0 task-status)) "Close the cstage that: - is associated with the task for the current cstage - is for the given status @@ -176,7 +173,7 @@ (game-task none) ) -(defmethod first-any task-control ((this task-control) (arg0 symbol)) +(defmethod first-any ((this task-control) (arg0 symbol)) "Iterate through tasks, finding an unclosed one to mark as current If arg0 is #t, warn on receiving null-task-control" @@ -201,7 +198,7 @@ (game-task none) ) -(defmethod reset! task-control ((this task-control) (reset-mode symbol) (arg1 symbol)) +(defmethod reset! ((this task-control) (reset-mode symbol) (arg1 symbol)) "Reset a task control. arg1 to warn on null, reset-mode 'game for a game reset" (when (= this *null-task-control*) @@ -227,7 +224,7 @@ ) -(defmethod closed? task-control ((this task-control) (arg0 game-task) (arg1 task-status)) +(defmethod closed? ((this task-control) (arg0 game-task) (arg1 task-status)) "Is the given task/status cstage closed?" (when (= this *null-task-control*) @@ -249,7 +246,7 @@ #t ) -(defmethod exists? task-control ((this task-control) (arg0 game-task) (arg1 task-status)) +(defmethod exists? ((this task-control) (arg0 game-task) (arg1 task-status)) "Is there a cstage for the given task and status?" (when (= this *null-task-control*) (format 0 "ERROR: exists? received self of *null-task-control*~%~%") @@ -263,7 +260,7 @@ #f ) -(defmethod get-reminder task-control ((this task-control) (arg0 int)) +(defmethod get-reminder ((this task-control) (arg0 int)) "Get the arg0th reminder. " (when (= this *null-task-control*) (format 0 "ERROR: get-reminder received self of *null-task-control*~%~%") @@ -274,7 +271,7 @@ ) ) -(defmethod save-reminder task-control ((this task-control) (arg0 int) (arg1 int)) +(defmethod save-reminder ((this task-control) (arg0 int) (arg1 int)) "Set the arg1th reminder to arg0" (when (= this *null-task-control*) (format 0 "ERROR: save-reminder received self of *null-task-control*~%~%") diff --git a/goal_src/jak1/engine/geometry/bounding-box-h.gc b/goal_src/jak1/engine/geometry/bounding-box-h.gc index 13d9b01e47a..47e2f76b969 100644 --- a/goal_src/jak1/engine/geometry/bounding-box-h.gc +++ b/goal_src/jak1/engine/geometry/bounding-box-h.gc @@ -14,40 +14,31 @@ ;; max is the corner with highest x,y,z values. ;; the w value should be 1 in both min and max. (deftype bounding-box (structure) - ((min vector :inline :offset-assert 0) - (max vector :inline :offset-assert 16) + ((min vector :inline) + (max vector :inline) ) - :method-count-assert 16 - :size-assert #x20 - :flag-assert #x1000000020 (:methods - (add-spheres! (_type_ (inline-array sphere) int) int 9) - (add-point! (_type_ vector3s) int 10) - (set-from-point-offset! (_type_ vector3s vector3s) int 11) - (set-from-point-offset-pad! (_type_ vector3s vector3s float) int 12) - (set-from-sphere! (_type_ sphere) int 13) - (set-from-spheres! (_type_ (inline-array sphere) int) int 14) - (add-box! (_type_ bounding-box) int 15) - ) + (add-spheres! (_type_ (inline-array sphere) int) int) + (add-point! (_type_ vector3s) int) + (set-from-point-offset! (_type_ vector3s vector3s) int) + (set-from-point-offset-pad! (_type_ vector3s vector3s float) int) + (set-from-sphere! (_type_ sphere) int) + (set-from-spheres! (_type_ (inline-array sphere) int) int) + (add-box! (_type_ bounding-box) int) + ) ) ;; integer (word) bounding box. (deftype bounding-box4w (structure) - ((min vector4w :inline :offset-assert 0) - (max vector4w :inline :offset-assert 16) + ((min vector4w :inline) + (max vector4w :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; bounding both that has both a box and box4w. ;; these are used in the collision system where it is useful to have both float/int versions. (deftype bounding-box-both (structure) - ((box bounding-box :inline :offset-assert 0) - (box4w bounding-box4w :inline :offset-assert 32) + ((box bounding-box :inline) + (box4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) diff --git a/goal_src/jak1/engine/geometry/bounding-box.gc b/goal_src/jak1/engine/geometry/bounding-box.gc index 22611de003c..cff6a25a75a 100644 --- a/goal_src/jak1/engine/geometry/bounding-box.gc +++ b/goal_src/jak1/engine/geometry/bounding-box.gc @@ -9,29 +9,27 @@ (defun box-vector-enside? ((box bounding-box) (pt vector)) "Is the point in the box? On the edge doesn't count" - (and - (< (-> box min data 0) (-> pt data 0)) - (< (-> box min data 1) (-> pt data 1)) - (< (-> box min data 2) (-> pt data 2)) - (< (-> pt data 0) (-> box max data 0)) - (< (-> pt data 1) (-> box max data 1)) - (< (-> pt data 2) (-> box max data 2)) - ) + (and (< (-> box min x) (-> pt x)) + (< (-> box min y) (-> pt y)) + (< (-> box min z) (-> pt z)) + (< (-> pt x) (-> box max x)) + (< (-> pt y) (-> box max y)) + (< (-> pt z) (-> box max z)) + ) ) (defun box-vector-inside? ((box bounding-box) (pt vector)) "Is the point in the box? On the edge counts." - (and - (>= (-> pt data 0) (-> box min data 0)) - (>= (-> pt data 1) (-> box min data 1)) - (>= (-> pt data 2) (-> box min data 2)) - (>= (-> box max data 0) (-> pt data 0)) - (>= (-> box max data 1) (-> pt data 1)) - (>= (-> box max data 2) (-> pt data 2)) - ) + (and (>= (-> pt x) (-> box min x)) + (>= (-> pt y) (-> box min y)) + (>= (-> pt z) (-> box min z)) + (>= (-> box max x) (-> pt x)) + (>= (-> box max y) (-> pt y)) + (>= (-> box max z) (-> pt z)) + ) ) -(defmethod set-from-point-offset! bounding-box ((this bounding-box) (arg0 vector3s) (arg1 vector3s)) +(defmethod set-from-point-offset! ((this bounding-box) (arg0 vector3s) (arg1 vector3s)) "Set box to smallest containing the points arg0, (arg0 + arg1)" (rlet ((vf0 :class vf) (vf1 :class vf) @@ -40,57 +38,57 @@ (vf4 :class vf) (vf5 :class vf) ) - (init-vf0-vector) - (.lvf vf3 arg1) - (.lvf vf4 arg0) - (.add.vf vf5 vf4 vf3) - (.min.vf vf1 vf4 vf5) - (.max.vf vf2 vf4 vf5) - (.mov.vf vf1 vf0 :mask #b1000) - (.mov.vf vf2 vf0 :mask #b1000) - (.svf this vf1) - (.svf this vf2 :offset 16) - 0 - ) + (init-vf0-vector) + (.lvf vf3 arg1) + (.lvf vf4 arg0) + (.add.vf vf5 vf4 vf3) + (.min.vf vf1 vf4 vf5) + (.max.vf vf2 vf4 vf5) + (.mov.vf vf1 vf0 :mask #b1000) + (.mov.vf vf2 vf0 :mask #b1000) + (.svf (&-> this min quad) vf1) + (.svf (&-> this max quad) vf2) + 0 + ) ) -(defmethod add-point! bounding-box ((this bounding-box) (arg0 vector3s)) +(defmethod add-point! ((this bounding-box) (arg0 vector3s)) "Expand the box if needed to contain the given point" (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) - (.lvf vf1 this) - (.lvf vf2 this :offset 16) - (.lvf vf3 arg0) - (.min.vf vf1 vf1 vf3) - (.max.vf vf2 vf2 vf3) - (.svf this vf1) - (.svf this vf2 :offset 16) - 0 - ) + (.lvf vf1 (&-> this min quad)) + (.lvf vf2 (&-> this max quad)) + (.lvf vf3 arg0) + (.min.vf vf1 vf1 vf3) + (.max.vf vf2 vf2 vf3) + (.svf (&-> this min quad) vf1) + (.svf (&-> this max quad) vf2) + 0 + ) ) -(defmethod add-box! bounding-box ((this bounding-box) (arg0 bounding-box)) +(defmethod add-box! ((this bounding-box) (arg0 bounding-box)) "Expand the box if needed to contain the given box" (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) ) - (.lvf vf1 this) - (.lvf vf2 this :offset 16) - (.lvf vf3 arg0) - (.lvf vf4 arg0 :offset 16) - (.min.vf vf1 vf1 vf3) - (.max.vf vf2 vf2 vf4) - (.svf this vf1) - (.svf this vf2 :offset 16) - 0 - ) + (.lvf vf1 (&-> this min quad)) + (.lvf vf2 (&-> this max quad)) + (.lvf vf3 (&-> arg0 min quad)) + (.lvf vf4 (&-> arg0 max quad)) + (.min.vf vf1 vf1 vf3) + (.max.vf vf2 vf2 vf4) + (.svf (&-> this min quad) vf1) + (.svf (&-> this max quad) vf2) + 0 + ) ) -(defmethod set-from-point-offset-pad! bounding-box ((this bounding-box) (arg0 vector3s) (arg1 vector3s) (arg2 float)) +(defmethod set-from-point-offset-pad! ((this bounding-box) (arg0 vector3s) (arg1 vector3s) (arg2 float)) "Set the box size to contain pt, pt + offset, with some padding" (rlet ((vf0 :class vf) (vf1 :class vf) @@ -100,24 +98,24 @@ (vf5 :class vf) (vf6 :class vf) ) - (init-vf0-vector) - (.lvf vf4 arg1) - (.lvf vf5 arg0) - (.mov vf1 arg2) - (.add.vf vf6 vf5 vf4) - (.min.vf vf2 vf5 vf6) - (.max.vf vf3 vf5 vf6) - (.add.x.vf vf3 vf3 vf1 :mask #b111) - (.sub.x.vf vf2 vf2 vf1 :mask #b111) - (.mov.vf vf2 vf0 :mask #b1000) - (.mov.vf vf3 vf0 :mask #b1000) - (.svf this vf2) - (.svf this vf3 :offset 16) - 0 - ) + (init-vf0-vector) + (.lvf vf4 arg1) + (.lvf vf5 arg0) + (.mov vf1 arg2) + (.add.vf vf6 vf5 vf4) + (.min.vf vf2 vf5 vf6) + (.max.vf vf3 vf5 vf6) + (.add.x.vf vf3 vf3 vf1 :mask #b111) + (.sub.x.vf vf2 vf2 vf1 :mask #b111) + (.mov.vf vf2 vf0 :mask #b1000) + (.mov.vf vf3 vf0 :mask #b1000) + (.svf (&-> this min quad) vf2) + (.svf (&-> this max quad) vf3) + 0 + ) ) -(defmethod set-from-sphere! bounding-box ((this bounding-box) (arg0 sphere)) +(defmethod set-from-sphere! ((this bounding-box) (arg0 sphere)) "Set the box size to contain the given sphere" (rlet ((vf0 :class vf) (vf1 :class vf) diff --git a/goal_src/jak1/engine/geometry/cylinder.gc b/goal_src/jak1/engine/geometry/cylinder.gc index 03053612ddf..246ca2feead 100644 --- a/goal_src/jak1/engine/geometry/cylinder.gc +++ b/goal_src/jak1/engine/geometry/cylinder.gc @@ -9,32 +9,25 @@ ;; DECOMP BEGINS -(defmethod ray-capsule-intersect cylinder ((this cylinder) (probe-origin vector) (probe-dir vector)) +(defmethod ray-capsule-intersect ((this cylinder) (probe-origin vector) (probe-dir vector)) "Intersect a ray with a capsule." (let ((t2-0 (new 'stack-no-clear 'vector)) (end-pt (new 'stack-no-clear 'vector)) ) ;; first intersect with the cylinder part. (let ((result (ray-cylinder-intersect - probe-origin - probe-dir - (-> this origin) - (-> this axis) - (-> this radius) - (-> this length) - t2-0 - ) - ) + probe-origin + probe-dir + (-> this origin) + (-> this axis) + (-> this radius) + (-> this length) + t2-0 + ) + ) ) ;; next, intersect with the sphere at the origin. - (let ((u-origin-sph (ray-sphere-intersect - probe-origin - probe-dir - (-> this origin) - (-> this radius) - ) - ) - ) + (let ((u-origin-sph (ray-sphere-intersect probe-origin probe-dir (-> this origin) (-> this radius)))) ;; if that was closer, we went through both the sphere and the wall, and we want the sphere. (if (and (>= u-origin-sph 0.0) (or (< result 0.0) (< u-origin-sph result))) (set! result u-origin-sph) @@ -56,36 +49,33 @@ ;; This is used to hold vertices for debug-drawing cylinders. (deftype cylinder-verts (structure) - ((vert vector 24 :inline :offset-assert 0) + ((vert vector 24 :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) -(defmethod debug-draw cylinder ((this cylinder) (arg0 vector4w)) +(defmethod debug-draw ((this cylinder) (arg0 vector4w)) "Debug draw a cylinder. This is slow and ugly" (local-vars - (sv-896 matrix) - (sv-912 int) - (sv-928 (function vector vector vector float vector)) - (sv-944 vector) - (sv-960 vector) - (sv-976 vector) - (sv-992 (function vector vector vector float vector)) - (sv-1008 vector) - (sv-1024 vector) - (sv-1040 vector) - (sv-1056 (function vector vector vector float vector)) - (sv-1072 vector) - (sv-1088 vector) - (sv-1104 vector) - (sv-1120 (function vector vector vector float vector)) - (sv-1136 vector) - (sv-1152 vector) - (sv-1168 vector) - ) + (sv-896 matrix) + (sv-912 int) + (sv-928 (function vector vector vector float vector)) + (sv-944 vector) + (sv-960 vector) + (sv-976 vector) + (sv-992 (function vector vector vector float vector)) + (sv-1008 vector) + (sv-1024 vector) + (sv-1040 vector) + (sv-1056 (function vector vector vector float vector)) + (sv-1072 vector) + (sv-1088 vector) + (sv-1104 vector) + (sv-1120 (function vector vector vector float vector)) + (sv-1136 vector) + (sv-1152 vector) + (sv-1168 vector) + ) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) @@ -118,12 +108,7 @@ (set! sv-912 0) (while (< sv-912 8) (vector+! (-> s5-0 vert (+ sv-912 8)) (-> this origin) s1-0) - (vector+float*! - (-> s5-0 vert (+ sv-912 8)) - (-> s5-0 vert (+ sv-912 8)) - s0-0 - (the float sv-912) - ) + (vector+float*! (-> s5-0 vert (+ sv-912 8)) (-> s5-0 vert (+ sv-912 8)) s0-0 (the float sv-912)) (set! sv-912 (+ sv-912 1)) ) (dotimes (s0-1 8) @@ -138,8 +123,7 @@ (set! sv-1008 (-> s5-0 vert s0-1)) (set! sv-1024 (-> s5-0 vert s0-1)) (set! sv-1040 (-> this axis)) - (let - ((a3-2 (* (- (-> this radius)) (sin (* 2048.0 (the float (- 7 s0-1))))))) + (let ((a3-2 (* (- (-> this radius)) (sin (* 2048.0 (the float (- 7 s0-1))))))) (sv-992 sv-1008 sv-1024 sv-1040 a3-2) ) (set! sv-1056 vector+float*!) @@ -153,11 +137,7 @@ (set! sv-1136 (-> s5-0 vert (+ s0-1 16))) (set! sv-1152 (-> s5-0 vert (+ s0-1 16))) (set! sv-1168 (-> this axis)) - (let ((a3-4 (+ (-> this length) - (* (-> this radius) (sin (* 2048.0 (the float s0-1)))) - ) - ) - ) + (let ((a3-4 (+ (-> this length) (* (-> this radius) (sin (* 2048.0 (the float s0-1))))))) (sv-1120 sv-1136 sv-1152 sv-1168 a3-4) ) ) @@ -198,13 +178,13 @@ f0-2 ) (else - -100000000.0 - ) + -100000000.0 + ) ) ) ) -(defmethod ray-flat-cyl-intersect cylinder-flat ((this cylinder-flat) (probe-origin vector) (probe-dir vector)) +(defmethod ray-flat-cyl-intersect ((this cylinder-flat) (probe-origin vector) (probe-dir vector)) "Intersect with a real cylinder." (let ((gp-0 (new 'stack-no-clear 'vector)) (end-pt (new 'stack-no-clear 'vector)) @@ -213,24 +193,19 @@ 0.0 ;; walls (let ((result (ray-cylinder-intersect - probe-origin - probe-dir - (-> this origin) - (-> this axis) - (-> this radius) - (-> this length) - gp-0 - ) - ) + probe-origin + probe-dir + (-> this origin) + (-> this axis) + (-> this radius) + (-> this length) + gp-0 + ) + ) ) ;; one end cap - (let ((u-origin-circle (ray-arbitrary-circle-intersect - probe-origin - probe-dir - (-> this origin) - (-> this axis) - (-> this radius) - ) + (let ((u-origin-circle + (ray-arbitrary-circle-intersect probe-origin probe-dir (-> this origin) (-> this axis) (-> this radius)) ) ) (when (and (>= u-origin-circle 0.0) (or (< result 0.0) (< u-origin-circle result))) @@ -240,14 +215,7 @@ ) ;; get other end cap (vector+float*! end-pt (-> this origin) (-> this axis) (-> this length)) - (let ((u-end-circle (ray-arbitrary-circle-intersect - probe-origin - probe-dir - end-pt - (-> this axis) - (-> this radius) - ) - ) + (let ((u-end-circle (ray-arbitrary-circle-intersect probe-origin probe-dir end-pt (-> this axis) (-> this radius))) ) (when (and (>= u-end-circle 0.0) (or (< result 0.0) (< u-end-circle result))) (set! result u-end-circle) @@ -261,79 +229,66 @@ ;; debug draw for cylinder flat. (deftype cylinder-flat-verts (structure) - ((vert vector 10 :inline :offset-assert 0) + ((vert vector 10 :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) -(defmethod debug-draw cylinder-flat ((this cylinder-flat) (arg0 vector4w)) +(defmethod debug-draw ((this cylinder-flat) (arg0 vector4w)) (local-vars (sv-448 vector) (sv-464 int)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) ) - (init-vf0-vector) - (let ((s1-0 (new 'stack-no-clear 'vector)) - (s0-0 (new 'stack-no-clear 'vector)) - ) - (if (< 0.999 (fabs (-> this axis y))) - (vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0)) - (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) - ) - (vector-normalize! s1-0 (-> this radius)) - (vector-float*! s0-0 (-> this axis) (* 0.14285715 (-> this length))) - (let ((s5-0 (new 'stack-no-clear 'cylinder-flat-verts)) - (s4-0 (new 'stack-no-clear 'cylinder-flat-verts)) - (s3-0 (new 'stack-no-clear 'matrix)) + (init-vf0-vector) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack-no-clear 'vector)) + ) + (if (< 0.999 (fabs (-> this axis y))) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0)) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) + ) + (vector-normalize! s1-0 (-> this radius)) + (vector-float*! s0-0 (-> this axis) (* 0.14285715 (-> this length))) + (let ((s5-0 (new 'stack-no-clear 'cylinder-flat-verts)) + (s4-0 (new 'stack-no-clear 'cylinder-flat-verts)) + (s3-0 (new 'stack-no-clear 'matrix)) + ) + (matrix-axis-angle! s3-0 (-> this axis) 4096.0) + (set! sv-448 (new 'stack-no-clear 'vector)) + (vector-matrix*! sv-448 (-> this origin) s3-0) + (let ((v1-5 (-> s3-0 vector 3))) + (.lvf vf4 (&-> (-> this origin) quad)) + (.lvf vf5 (&-> sv-448 quad)) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-5 quad) vf6) + ) + (set! sv-464 0) + (while (< sv-464 8) + (vector+! (-> s5-0 vert (+ sv-464 1)) (-> this origin) s1-0) + (vector+float*! (-> s5-0 vert (+ sv-464 1)) (-> s5-0 vert (+ sv-464 1)) s0-0 (the float sv-464)) + (set! sv-464 (+ sv-464 1)) + ) + (set! (-> s5-0 vert 0 quad) (-> this origin quad)) + (vector+float*! (-> s5-0 vert 9) (-> this origin) (-> this axis) (-> this length)) + (dotimes (s2-1 16) + (dotimes (s1-1 10) + (vector-matrix*! (-> s4-0 vert s1-1) (-> s5-0 vert s1-1) s3-0) + (camera-line (-> s5-0 vert s1-1) (-> s4-0 vert s1-1) arg0) + (if (nonzero? s1-1) + (camera-line (-> s5-0 vert s1-1) (-> s5-0 vert (+ s1-1 -1)) arg0) + ) + ) + (let ((v1-43 s5-0)) + (set! s5-0 s4-0) + (set! s4-0 v1-43) + ) ) - (matrix-axis-angle! s3-0 (-> this axis) 4096.0) - (set! sv-448 (new 'stack-no-clear 'vector)) - (vector-matrix*! sv-448 (-> this origin) s3-0) - (let ((v1-5 (-> s3-0 vector 3))) - (.lvf vf4 (&-> (-> this origin) quad)) - (.lvf vf5 (&-> sv-448 quad)) - (.mov.vf vf6 vf0 :mask #b1000) - (.sub.vf vf6 vf4 vf5 :mask #b111) - (.svf (&-> v1-5 quad) vf6) - ) - (set! sv-464 0) - (while (< sv-464 8) - (vector+! (-> s5-0 vert (+ sv-464 1)) (-> this origin) s1-0) - (vector+float*! - (-> s5-0 vert (+ sv-464 1)) - (-> s5-0 vert (+ sv-464 1)) - s0-0 - (the float sv-464) - ) - (set! sv-464 (+ sv-464 1)) - ) - (set! (-> s5-0 vert 0 quad) (-> this origin quad)) - (vector+float*! - (-> s5-0 vert 9) - (-> this origin) - (-> this axis) - (-> this length) - ) - (dotimes (s2-1 16) - (dotimes (s1-1 10) - (vector-matrix*! (-> s4-0 vert s1-1) (-> s5-0 vert s1-1) s3-0) - (camera-line (-> s5-0 vert s1-1) (-> s4-0 vert s1-1) arg0) - (if (nonzero? s1-1) - (camera-line (-> s5-0 vert s1-1) (-> s5-0 vert (+ s1-1 -1)) arg0) ) - ) - (let ((v1-43 s5-0)) - (set! s5-0 s4-0) - (set! s4-0 v1-43) - ) ) - ) + 0 + (none) ) - 0 - (none) - ) - ) \ No newline at end of file + ) diff --git a/goal_src/jak1/engine/geometry/geometry-h.gc b/goal_src/jak1/engine/geometry/geometry-h.gc index 9f34b416f28..172d54219ea 100644 --- a/goal_src/jak1/engine/geometry/geometry-h.gc +++ b/goal_src/jak1/engine/geometry/geometry-h.gc @@ -13,30 +13,24 @@ ;; A 3 dimensional polynomial spline with arbitrarily placed knot points ;; It's used for camera paths and similar and can be generated by offline tools. (deftype curve (structure) - ((cverts (inline-array vector) :offset-assert 0) - (num-cverts int32 :offset-assert 4) - (knots (pointer float) :offset-assert 8) - (num-knots int32 :offset-assert 12) - (length float :offset-assert 16) + ((cverts (inline-array vector)) + (num-cverts int32) + (knots (pointer float)) + (num-knots int32) + (length float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; unused plane type that would likely trigger some action on crossing. (deftype border-plane (basic) - ((name symbol :offset-assert 4) - (action basic :offset-assert 8) - (slot int8 :offset-assert 12) - (trans vector :inline :offset-assert 16) - (normal vector :inline :offset-assert 32) + ((name symbol) + (action basic) + (slot int8) + (trans vector :inline) + (normal vector :inline) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (debug-draw! (_type_) none 9) - (point-past-plane? (_type_ vector) symbol 10) + (debug-draw! (_type_) none) + (point-past-plane? (_type_ vector) symbol) ) - ) \ No newline at end of file + ) diff --git a/goal_src/jak1/engine/geometry/path-h.gc b/goal_src/jak1/engine/geometry/path-h.gc index 197b854eb79..5344e0e6b96 100644 --- a/goal_src/jak1/engine/geometry/path-h.gc +++ b/goal_src/jak1/engine/geometry/path-h.gc @@ -19,44 +19,39 @@ ;; A path-control is a curve that can be loaded from res-lump/entities. (deftype path-control (basic) - ((flags path-control-flag :offset-assert 4) - (name symbol :offset-assert 8) - (process process-drawable :offset-assert 12) - (curve curve :inline :offset-assert 16) - (num-cverts int32 :offset 20) - (cverts (inline-array vector) :offset 16) + ((flags path-control-flag) + (name symbol) + (process process-drawable) + (curve curve :inline) + (num-cverts int32 :overlay-at (-> curve num-cverts)) + (cverts (inline-array vector) :overlay-at (-> curve cverts)) ) - :method-count-assert 21 - :size-assert #x24 - :flag-assert #x1500000024 (:methods - (new (symbol type process symbol float) _type_ 0) - (debug-draw (_type_) none 9) - (eval-path-curve-div! (_type_ vector float symbol) vector 10) - (get-random-point (_type_ vector) vector 11) - (path-control-method-12 (_type_ vector float) vector 12) - (eval-path-curve! (_type_ vector float symbol) vector 13) - (path-control-method-14 (_type_ vector float) vector 14) - (length-as-float (_type_) float 15) - (path-distance (_type_) float 16) - (get-num-verts (_type_) int 17) - (should-display? (_type_) symbol 18) - (path-control-method-19 (_type_) float 19) - (path-control-method-20 (_type_) float 20) + (new (symbol type process symbol float) _type_) + (debug-draw (_type_) none) + (eval-path-curve-div! (_type_ vector float symbol) vector) + (get-random-point (_type_ vector) vector) + (path-control-method-12 (_type_ vector float) vector) + (eval-path-curve! (_type_ vector float symbol) vector) + (path-control-method-14 (_type_ vector float) vector) + (length-as-float (_type_) float) + (path-distance (_type_) float) + (get-num-verts (_type_) int) + (should-display? (_type_) symbol) + (path-control-method-19 (_type_) float) + (path-control-method-20 (_type_) float) ) ) ;; A curve-control is very similar, but also gets knots. (deftype curve-control (path-control) () - :method-count-assert 21 - :size-assert #x24 - :flag-assert #x1500000024 (:methods - (new (symbol type process symbol float) _type_ 0) + (new (symbol type process symbol float) _type_) ) ) + (defmethod new path-control ((allocation symbol) (type-to-make type) (proc process) (name symbol) (time float)) (local-vars (tag res-tag)) (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) @@ -85,16 +80,17 @@ (let ((data (res-lump-data ent name pointer :tag-ptr (& tag) :time time))) (cond (data - ;; success, we got some data - (set! (-> this cverts) (the-as (inline-array vector) data)) - (set! (-> this curve num-cverts) (the-as int (-> tag elt-count))) - ) + ;; success, we got some data + (set! (-> this cverts) (the-as (inline-array vector) data)) + (set! (-> this curve num-cverts) (the-as int (-> tag elt-count))) + ) (else - ;; did not find the data. Set flags and zero stuff - (logior! (-> this flags) (path-control-flag not-found)) - (set! (-> this cverts) (the-as (inline-array vector) #f)) - (set! (-> this curve num-cverts) 0) - ) + ;; did not find the data. Set flags and zero stuff + (logior! (-> this flags) (path-control-flag not-found)) + (set! (-> this cverts) (the-as (inline-array vector) #f)) + (set! (-> this curve num-cverts) 0) + 0 + ) ) ) ) @@ -103,19 +99,17 @@ ) ) -(defmethod should-display? path-control ((this path-control)) +(defmethod should-display? ((this path-control)) "Should we display path marks?" - (and *display-path-marks* - (logtest? (-> this flags) (path-control-flag display)) - ) + (and *display-path-marks* (logtest? (-> this flags) (path-control-flag display))) ) -(defmethod length-as-float path-control ((this path-control)) +(defmethod length-as-float ((this path-control)) "Get the number of edges as a float" (the float (+ (-> this curve num-cverts) -1)) ) -(defmethod get-num-verts path-control ((this path-control)) +(defmethod get-num-verts ((this path-control)) "Get the number of vertices" (-> this curve num-cverts) ) @@ -131,12 +125,12 @@ 'path-k ;; for knots? ) (else - ;; appends a -k to the symbol name. - (let ((s2-1 string->symbol)) - (format (clear *temp-string*) "~A-k" name) - (s2-1 *temp-string*) - ) - ) + ;; appends a -k to the symbol name. + (let ((s2-1 string->symbol)) + (format (clear *temp-string*) "~A-k" name) + (s2-1 *temp-string*) + ) + ) ) ) ) @@ -152,12 +146,12 @@ (set! (-> this type) path-control) ) (else - ;; couldn't get anything, mark as bad. - (logior! (-> this flags) (path-control-flag not-found)) - (set! (-> this flags) (logior (-> this flags) (path-control-flag not-found))) - (set! (-> this curve cverts) (the-as (inline-array vector) #f)) - (set! (-> this curve num-cverts) 0) - ) + ;; couldn't get anything, mark as bad. + (logior! (-> this flags) (path-control-flag not-found)) + (set! (-> this cverts) (the-as (inline-array vector) #f)) + (set! (-> this curve num-cverts) 0) + 0 + ) ) ) ) diff --git a/goal_src/jak1/engine/geometry/path.gc b/goal_src/jak1/engine/geometry/path.gc index 726ecaaed58..41f14281870 100644 --- a/goal_src/jak1/engine/geometry/path.gc +++ b/goal_src/jak1/engine/geometry/path.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod debug-draw path-control ((this path-control)) +(defmethod debug-draw ((this path-control)) (cond ((logtest? (-> this flags) (path-control-flag not-found)) (when (and (type-type? (-> this process type) process-drawable) *display-entity-errors*) @@ -63,7 +63,7 @@ (none) ) -(defmethod path-distance path-control ((this path-control)) +(defmethod path-distance ((this path-control)) (let ((f30-0 0.0)) (dotimes (s5-0 (+ (-> this curve num-cverts) -1)) (+! f30-0 (vector-vector-distance (-> this cverts s5-0) (-> this cverts (+ s5-0 1)))) @@ -72,7 +72,7 @@ ) ) -(defmethod path-distance curve-control ((this curve-control)) +(defmethod path-distance ((this curve-control)) (let ((f0-0 (-> this curve length))) (when (= f0-0 0.0) (set! f0-0 (curve-length (the-as curve (&-> this cverts)))) @@ -82,7 +82,7 @@ ) ) -(defmethod eval-path-curve-div! path-control ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod eval-path-curve-div! ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) (let ((a1-1 (-> this curve num-cverts)) (f0-3 (the float (the int arg1))) ) @@ -104,7 +104,7 @@ arg0 ) -(defmethod get-random-point path-control ((this path-control) (arg0 vector)) +(defmethod get-random-point ((this path-control) (arg0 vector)) (with-pp (cond ((> (-> this curve num-cverts) 0) @@ -128,11 +128,11 @@ ) ) -(defmethod eval-path-curve! path-control ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod eval-path-curve! ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) (eval-path-curve-div! this arg0 (* arg1 (the float (+ (-> this curve num-cverts) -1))) arg2) ) -(defmethod eval-path-curve! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod eval-path-curve! ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) (the-as vector (if (logtest? (-> this flags) (path-control-flag not-found)) 0.0 (curve-evaluate! @@ -147,7 +147,7 @@ ) ) -(defmethod eval-path-curve-div! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod eval-path-curve-div! ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) (the-as vector (if (logtest? (-> this flags) (path-control-flag not-found)) 0.0 (curve-evaluate! @@ -162,7 +162,7 @@ ) ) -(defmethod path-control-method-12 path-control ((this path-control) (arg0 vector) (arg1 float)) +(defmethod path-control-method-12 ((this path-control) (arg0 vector) (arg1 float)) (when (not (logtest? (-> this flags) (path-control-flag not-found))) (let ((v1-3 (-> this curve num-cverts)) (f0-3 (the float (the int arg1))) @@ -184,11 +184,11 @@ (vector-normalize! arg0 1.0) ) -(defmethod path-control-method-14 path-control ((this path-control) (arg0 vector) (arg1 float)) +(defmethod path-control-method-14 ((this path-control) (arg0 vector) (arg1 float)) (path-control-method-12 this arg0 (* arg1 (the float (+ (-> this curve num-cverts) -1)))) ) -(defmethod path-control-method-14 curve-control ((this curve-control) (arg0 vector) (arg1 float)) +(defmethod path-control-method-14 ((this curve-control) (arg0 vector) (arg1 float)) (when (not (logtest? (-> this flags) (path-control-flag not-found))) (let ((s4-0 (new 'stack-no-clear 'vector))) (curve-evaluate! @@ -228,11 +228,11 @@ (vector-normalize! arg0 1.0) ) -(defmethod path-control-method-12 curve-control ((this curve-control) (arg0 vector) (arg1 float)) +(defmethod path-control-method-12 ((this curve-control) (arg0 vector) (arg1 float)) (path-control-method-14 this arg0 (/ arg1 (the float (+ (-> this curve num-cverts) -1)))) ) -(defmethod path-control-method-19 path-control ((this path-control)) +(defmethod path-control-method-19 ((this path-control)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) @@ -262,11 +262,11 @@ ) ) -(defmethod path-control-method-20 path-control ((this path-control)) +(defmethod path-control-method-20 ((this path-control)) (/ (path-control-method-19 this) (the float (+ (-> this curve num-cverts) -1))) ) -(defmethod debug-draw curve-control ((this curve-control)) +(defmethod debug-draw ((this curve-control)) (cond ((logtest? (-> this flags) (path-control-flag not-found)) (when (and (type-type? (-> this process type) process-drawable) *display-entity-errors*) diff --git a/goal_src/jak1/engine/geometry/vol-h.gc b/goal_src/jak1/engine/geometry/vol-h.gc index 3cb5181456d..72010dc217d 100644 --- a/goal_src/jak1/engine/geometry/vol-h.gc +++ b/goal_src/jak1/engine/geometry/vol-h.gc @@ -8,44 +8,38 @@ ;; DECOMP BEGINS (deftype plane-volume (structure) - ((volume-type symbol :offset-assert 0) - (point-count int16 :offset-assert 4) - (normal-count int16 :offset-assert 6) - (first-point (pointer vector) :offset-assert 8) - (first-normal (pointer vector) :offset-assert 12) - (num-planes int32 :offset-assert 16) - (plane (inline-array plane) :offset-assert 20) + ((volume-type symbol) + (point-count int16) + (normal-count int16) + (first-point (pointer vector)) + (first-normal (pointer vector)) + (num-planes int32) + (plane (inline-array plane)) ) :pack-me - :method-count-assert 12 - :size-assert #x18 - :flag-assert #xc00000018 (:methods - (init-vol! (_type_ symbol vector-array vector-array) symbol 9) - (debug-draw (_type_) none 10) - (point-in-vol? (_type_ vector float) symbol 11) + (init-vol! (_type_ symbol vector-array vector-array) symbol) + (debug-draw (_type_) none) + (point-in-vol? (_type_ vector float) symbol) ) ) (deftype vol-control (basic) - ((flags uint32 :offset-assert 4) - (process process-drawable :offset-assert 8) - (pos-vol-count int32 :offset-assert 12) - (pos-vol plane-volume 32 :inline :offset-assert 16) - (neg-vol-count int32 :offset-assert 784) - (neg-vol plane-volume 32 :inline :offset-assert 788) - (debug-point vector-array :offset-assert 1556) - (debug-normal vector-array :offset-assert 1560) + ((flags uint32) + (process process-drawable) + (pos-vol-count int32) + (pos-vol plane-volume 32 :inline) + (neg-vol-count int32) + (neg-vol plane-volume 32 :inline) + (debug-point vector-array) + (debug-normal vector-array) ) - :method-count-assert 12 - :size-assert #x61c - :flag-assert #xc0000061c (:methods - (new (symbol type process-drawable) _type_ 0) - (init! (_type_) symbol 9) - (point-in-vol? (_type_ vector) symbol 10) - (vol-control-method-11 (_type_) symbol 11) + (new (symbol type process-drawable) _type_) + (init! (_type_) symbol) + (point-in-vol? (_type_ vector) symbol) + (vol-control-method-11 (_type_) symbol) ) ) @@ -107,6 +101,6 @@ ) ) -(defmethod vol-control-method-11 vol-control ((this vol-control)) +(defmethod vol-control-method-11 ((this vol-control)) (and *display-vol-marks* (logtest? (-> this flags) 1)) ) diff --git a/goal_src/jak1/engine/geometry/vol.gc b/goal_src/jak1/engine/geometry/vol.gc index 5225f7161f2..840f49a470f 100644 --- a/goal_src/jak1/engine/geometry/vol.gc +++ b/goal_src/jak1/engine/geometry/vol.gc @@ -18,7 +18,7 @@ ) ) -(defmethod init-vol! plane-volume ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) +(defmethod init-vol! ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) (local-vars (sv-144 vector) (sv-148 float) @@ -159,7 +159,7 @@ #f ) -(defmethod debug-draw plane-volume ((this plane-volume)) +(defmethod debug-draw ((this plane-volume)) (let* ((v1-0 (-> this volume-type)) (s5-0 (cond ((= v1-0 'vol) @@ -192,7 +192,7 @@ (none) ) -(defmethod point-in-vol? plane-volume ((this plane-volume) (arg0 vector) (arg1 float)) +(defmethod point-in-vol? ((this plane-volume) (arg0 vector) (arg1 float)) (dotimes (v1-0 (-> this num-planes)) (if (< arg1 (- (vector-dot arg0 (the-as vector (-> this plane v1-0))) (the-as float (-> this plane v1-0 w)))) (return #f) @@ -201,7 +201,7 @@ #t ) -(defmethod init! vol-control ((this vol-control)) +(defmethod init! ((this vol-control)) (with-pp (let ((a0-1 this)) (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) 1)) (logtest? (-> this flags) 2)) @@ -241,7 +241,7 @@ ) ) -(defmethod point-in-vol? vol-control ((this vol-control) (arg0 vector)) +(defmethod point-in-vol? ((this vol-control) (arg0 vector)) (dotimes (s4-0 (-> this neg-vol-count)) (if (point-in-vol? (-> this neg-vol s4-0) arg0 0.0) (return #f) diff --git a/goal_src/jak1/engine/gfx/background/background-h.gc b/goal_src/jak1/engine/gfx/background/background-h.gc index 4da287dab14..59e49ecaed3 100644 --- a/goal_src/jak1/engine/gfx/background/background-h.gc +++ b/goal_src/jak1/engine/gfx/background/background-h.gc @@ -8,37 +8,34 @@ ;; DECOMP BEGINS (deftype background-work (basic) - ((tfrag-tree-count int32 :offset-assert 4) - (tfrag-trees drawable-tree-tfrag 8 :offset-assert 8) - (tfrag-levels level 8 :offset-assert 40) - (trans-tfrag-tree-count int32 :offset-assert 72) - (trans-tfrag-trees drawable-tree-trans-tfrag 8 :offset-assert 76) - (trans-tfrag-levels level 8 :offset-assert 108) - (dirt-tfrag-tree-count int32 :offset-assert 140) - (dirt-tfrag-trees drawable-tree-dirt-tfrag 8 :offset-assert 144) - (dirt-tfrag-levels level 8 :offset-assert 176) - (ice-tfrag-tree-count int32 :offset-assert 208) - (ice-tfrag-trees drawable-tree-ice-tfrag 8 :offset-assert 212) - (ice-tfrag-levels level 8 :offset-assert 244) - (lowres-tfrag-tree-count int32 :offset-assert 276) - (lowres-tfrag-trees drawable-tree-lowres-tfrag 8 :offset-assert 280) - (lowres-tfrag-levels level 8 :offset-assert 312) - (lowres-trans-tfrag-tree-count int32 :offset-assert 344) - (lowres-trans-tfrag-trees drawable-tree-trans-tfrag 8 :offset-assert 348) - (lowres-trans-tfrag-levels level 8 :offset-assert 380) - (shrub-tree-count int32 :offset-assert 412) - (shrub-trees drawable-tree-instance-shrub 8 :offset-assert 416) - (shrub-levels level 8 :offset-assert 448) - (tie-tree-count int32 :offset-assert 480) - (tie-trees drawable-tree-instance-tie 8 :offset-assert 484) - (tie-levels level 8 :offset-assert 516) - (tie-generic basic 8 :offset-assert 548) - (wait-to-vu0 uint32 :offset-assert 580) + ((tfrag-tree-count int32) + (tfrag-trees drawable-tree-tfrag 8) + (tfrag-levels level 8) + (trans-tfrag-tree-count int32) + (trans-tfrag-trees drawable-tree-trans-tfrag 8) + (trans-tfrag-levels level 8) + (dirt-tfrag-tree-count int32) + (dirt-tfrag-trees drawable-tree-dirt-tfrag 8) + (dirt-tfrag-levels level 8) + (ice-tfrag-tree-count int32) + (ice-tfrag-trees drawable-tree-ice-tfrag 8) + (ice-tfrag-levels level 8) + (lowres-tfrag-tree-count int32) + (lowres-tfrag-trees drawable-tree-lowres-tfrag 8) + (lowres-tfrag-levels level 8) + (lowres-trans-tfrag-tree-count int32) + (lowres-trans-tfrag-trees drawable-tree-trans-tfrag 8) + (lowres-trans-tfrag-levels level 8) + (shrub-tree-count int32) + (shrub-trees drawable-tree-instance-shrub 8) + (shrub-levels level 8) + (tie-tree-count int32) + (tie-trees drawable-tree-instance-tie 8) + (tie-levels level 8) + (tie-generic basic 8) + (wait-to-vu0 uint32) ) - :method-count-assert 9 - :size-assert #x248 - :flag-assert #x900000248 ) -(define-extern add-pc-tfrag3-data (function dma-buffer level pointer)) \ No newline at end of file +(define-extern add-pc-tfrag3-data (function dma-buffer level pointer)) diff --git a/goal_src/jak1/engine/gfx/background/prototype-h.gc b/goal_src/jak1/engine/gfx/background/prototype-h.gc index 5ff46608148..72118e8534a 100644 --- a/goal_src/jak1/engine/gfx/background/prototype-h.gc +++ b/goal_src/jak1/engine/gfx/background/prototype-h.gc @@ -15,35 +15,32 @@ ;; a geom, based on distance from the camera (or other settings) and will add itself to the list ;; for that geom. (deftype prototype-bucket (basic) - ((name string :offset-assert 4) - (flags uint32 :offset-assert 8) - (in-level uint16 :offset-assert 12) - (utextures uint16 :offset-assert 14) - (geometry drawable 4 :offset-assert 16) ;; the 4 levels of detail - (dists vector :inline :offset-assert 32) ;; lod settings - (rdists vector :inline :offset-assert 48) ;; lod settings - (next uint32 4 :offset-assert 64) ;; linked list of instances of each geom. - (count uint16 4 :offset-assert 80) ;; number of each instance with each geom. + ((name string) + (flags uint32) + (in-level uint16) + (utextures uint16) + (geometry drawable 4) ;; the 4 levels of detail + (dists vector :inline) ;; lod settings + (rdists vector :inline) ;; lod settings + (next uint32 4) ;; linked list of instances of each geom. + (count uint16 4) ;; number of each instance with each geom. ;; overlays - (near-plane meters :offset 32) - (near-stiff meters :offset 36) - (mid-plane meters :offset 40) - (far-plane meters :offset 44) - (rlength-near float :offset 48) - (rlength-stiff float :offset 52) - (rlength-mid float :offset 56) - (stiffness float :offset 60) - (next-clear uint128 :offset 64) - (next-clear-1 int32 :offset 64) - (next-clear-2 int32 :offset 68) - (next-clear-3 int32 :offset 72) - (next-clear-4 int32 :offset 76) - (count-clear uint64 :offset 80) + (near-plane meters :overlay-at (-> dists x)) + (near-stiff meters :overlay-at (-> dists y)) + (mid-plane meters :overlay-at (-> dists z)) + (far-plane meters :overlay-at (-> dists w)) + (rlength-near float :overlay-at (-> rdists x)) + (rlength-stiff float :overlay-at (-> rdists y)) + (rlength-mid float :overlay-at (-> rdists z)) + (stiffness float :overlay-at (-> rdists w)) + (next-clear uint128 :overlay-at (-> next 0)) + (next-clear-1 int32 :overlay-at (-> next 0)) + (next-clear-2 int32 :overlay-at (-> next 1)) + (next-clear-3 int32 :overlay-at (-> next 2)) + (next-clear-4 int32 :overlay-at (-> next 3)) + (count-clear uint64 :overlay-at (-> count 0)) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) ;;;;;;;;;;;;;;; @@ -52,35 +49,26 @@ ;; specialization for shrub. We keep the end of the linked list too. (deftype prototype-bucket-shrub (prototype-bucket) - ((mod-count uint16 4 :offset-assert 88) - (last dma-packet 4 :offset-assert 96) - (count-clear-qword uint128 :offset 80) - (last-clear uint128 :offset 96) + ((mod-count uint16 4) + (last dma-packet 4) + (count-clear-qword uint128 :overlay-at (-> count 0)) + (last-clear uint128 :overlay-at (-> last 0)) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; array of all the prototypes in a shrub tree. (deftype prototype-inline-array-shrub (drawable) - ((length int16 :offset 6) - (data prototype-bucket-shrub 1 :inline :offset 32) - (_pad uint32 :offset-assert 144) + ((length int16 :offset 6) + (data prototype-bucket-shrub 1 :inline :offset 32) + (_pad uint32) ) - :method-count-assert 18 - :size-assert #x94 - :flag-assert #x1200000094 ) ;; shrub prototypes, plus a pointer to the level's wind data. (deftype prototype-array-shrub-info (basic) - ((prototype-inline-array-shrub prototype-inline-array-shrub :offset-assert 4) - (wind-vectors uint32 :offset-assert 8) + ((prototype-inline-array-shrub prototype-inline-array-shrub) + (wind-vectors uint32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;;;;;;;;;;;;;;; @@ -96,48 +84,39 @@ (declare-type prototype-tie drawable) ;; prototype for a TIE (deftype prototype-bucket-tie (prototype-bucket) - ((generic-count uint16 4 :offset-assert 88) - (generic-next uint32 4 :offset-assert 96) - (frag-count uint8 4 :offset-assert 112) - (index-start uint8 4 :offset-assert 116) - (base-qw uint16 4 :offset-assert 120) - (envmap-rfade float :offset-assert 128) - (envmap-fade-far float :offset-assert 132) - (envmap-shader adgif-shader :offset-assert 136) - (collide-frag drawable-inline-array-collide-fragment :offset-assert 140) - (tie-colors time-of-day-palette :offset-assert 144) - (data uint32 :dynamic :offset-assert 148) - (color-index-qwc uint32 :dynamic :offset-assert 148) - (generic-next-clear uint128 :offset 96) - (generic-count-clear uint128 :offset 80) - (geometry-override prototype-tie 4 :offset 16 :score 1) + ((generic-count uint16 4) + (generic-next uint32 4) + (frag-count uint8 4) + (index-start uint8 4) + (base-qw uint16 4) + (envmap-rfade float) + (envmap-fade-far float) + (envmap-shader adgif-shader) + (collide-frag drawable-inline-array-collide-fragment) + (tie-colors time-of-day-palette) + (data uint32 :dynamic) + (color-index-qwc uint32 :dynamic) + (generic-next-clear uint128 :overlay-at (-> generic-next 0)) + (generic-count-clear uint128 :overlay-at (-> count 0)) + (geometry-override prototype-tie 4 :overlay-at (-> geometry 0)) ) - :method-count-assert 9 - :size-assert #x94 - :flag-assert #x900000094 ) ;; all tie prototypes in a tie tree. (note, not inline like shrub) (deftype prototype-array-tie (array) - ((array-data prototype-bucket-tie :dynamic :offset 16) + ((array-data prototype-bucket-tie :dynamic :offset 16) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (login (_type_) none 9) + (login (_type_) none) ) ) ;; all tie prototypes and pointer to level's wind data. ;; in practice, they are shared with all tie/shrub trees in the level (deftype proxy-prototype-array-tie (basic) - ((prototype-array-tie prototype-array-tie :offset-assert 4) - (wind-vectors uint32 :offset-assert 8) + ((prototype-array-tie prototype-array-tie) + (wind-vectors uint32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;;;;;;;;;;;; @@ -147,13 +126,10 @@ ;; note: more specific instances are available in tie/shrub files. (deftype instance (drawable) - ((bucket-index uint16 :offset 6) ;; which bucket (index in arrays) - (error (pointer drawable-error) :offset 8) ;; if we have an error. - (origin matrix4h :inline :offset-assert 32) ;; our location (packed format) - (unknown-vector vector :inline :offset 32) ;; todo, this might not be right. - (wind-index uint16 :offset 62) ;; used by wind calculation. + ((bucket-index uint16 :offset 6) + (error (pointer drawable-error) :offset 8) + (origin matrix4h :inline) + (unknown-vector vector :inline :overlay-at (-> origin data 0)) + (wind-index uint16 :overlay-at (-> origin data 15)) ) - :method-count-assert 18 - :size-assert #x40 - :flag-assert #x1200000040 ) diff --git a/goal_src/jak1/engine/gfx/background/prototype.gc b/goal_src/jak1/engine/gfx/background/prototype.gc index 9bf2c4d0831..be81fb58118 100644 --- a/goal_src/jak1/engine/gfx/background/prototype.gc +++ b/goal_src/jak1/engine/gfx/background/prototype.gc @@ -9,7 +9,7 @@ ;; DECOMP BEGINS -(defmethod login prototype-array-tie ((this prototype-array-tie)) +(defmethod login ((this prototype-array-tie)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this array-data s5-0))) (dotimes (s3-0 4) @@ -37,7 +37,7 @@ (none) ) -(defmethod login prototype-inline-array-shrub ((this prototype-inline-array-shrub)) +(defmethod login ((this prototype-inline-array-shrub)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this data s5-0))) (dotimes (s3-0 4) @@ -52,7 +52,7 @@ this ) -(defmethod mem-usage prototype-array-tie ((this prototype-array-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-array-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -66,7 +66,7 @@ this ) -(defmethod mem-usage prototype-bucket-tie ((this prototype-bucket-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-bucket-tie) (arg0 memory-usage-block) (arg1 int)) (dotimes (s3-0 4) (let ((a0-1 (-> this geometry s3-0))) (if (nonzero? a0-1) @@ -77,7 +77,7 @@ (set! (-> arg0 length) (max 81 (-> arg0 length))) (set! (-> arg0 data 80 name) "string") (+! (-> arg0 data 80 count) 1) - (let ((v1-13 ((method-of-type string asize-of) (the-as string (-> this name))))) + (let ((v1-13 (asize-of (-> this name)))) (+! (-> arg0 data 80 used) v1-13) (+! (-> arg0 data 80 total) (logand -16 (+ v1-13 15))) ) @@ -96,7 +96,7 @@ this ) -(defmethod mem-usage prototype-inline-array-shrub ((this prototype-inline-array-shrub) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-inline-array-shrub) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -110,7 +110,7 @@ this ) -(defmethod mem-usage prototype-bucket-shrub ((this prototype-bucket-shrub) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-bucket-shrub) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 25 (-> arg0 length))) (set! (-> arg0 data 24 name) "prototype-bucket-shrub") (+! (-> arg0 data 24 count) 1) @@ -128,7 +128,7 @@ (set! (-> arg0 length) (max 81 (-> arg0 length))) (set! (-> arg0 data 80 name) "string") (+! (-> arg0 data 80 count) 1) - (let ((v1-22 ((method-of-type string asize-of) (the-as string (-> this name))))) + (let ((v1-22 (asize-of (-> this name)))) (+! (-> arg0 data 80 used) v1-22) (+! (-> arg0 data 80 total) (logand -16 (+ v1-22 15))) ) diff --git a/goal_src/jak1/engine/gfx/background/subdivide-h.gc b/goal_src/jak1/engine/gfx/background/subdivide-h.gc index 24328ecdf3d..c6fe7c506c1 100644 --- a/goal_src/jak1/engine/gfx/background/subdivide-h.gc +++ b/goal_src/jak1/engine/gfx/background/subdivide-h.gc @@ -8,189 +8,159 @@ ;; DECOMP BEGINS (deftype subdivide-settings (basic) - ((dist float 5 :offset-assert 4) - (meters float 5 :offset-assert 24) - (close float 4 :offset-assert 44) - (far float 4 :offset-assert 60) + ((dist float 5) + (meters float 5) + (close float 4) + (far float 4) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c (:methods - (new (symbol type meters meters) _type_ 0) + (new (symbol type meters meters) _type_) ) ) + (defmethod new subdivide-settings ((allocation symbol) (type-to-make type) (arg0 meters) (arg1 meters)) (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (dotimes (v1-2 3) - (set! (-> v0-0 close v1-2) arg0) - (set! (-> v0-0 far v1-2) arg1) + (dotimes (v1-2 3) + (set! (-> v0-0 close v1-2) arg0) + (set! (-> v0-0 far v1-2) arg1) + ) + v0-0 ) - v0-0 - ) ) (deftype subdivide-dists (structure) - ((data uint32 32 :offset 0) - (vector vector 8 :inline :offset 0) - (k0s uint128 4 :offset 0) - (k1s uint128 4 :offset 64) + ((data uint32 32 :offset 0) + (vector vector 8 :inline :overlay-at (-> data 0)) + (k0s uint128 4 :overlay-at vector) + (k1s uint128 4 :overlay-at (-> data 16)) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) + (deftype gs-packed-rgba (structure) - ((data int32 4 :offset-assert 0) - (red int32 :offset 0) - (green int32 :offset 4) - (blue int32 :offset 8) - (alpha int32 :offset 12) + ((data int32 4) + (red int32 :overlay-at (-> data 0)) + (green int32 :overlay-at (-> data 1)) + (blue int32 :overlay-at (-> data 2)) + (alpha int32 :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype gs-packed-xyzw (structure) - ((data int32 4 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) - (z int32 :offset 8) - (w int32 :offset 12) - (quad uint128 :offset 0) + ((data int32 4) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) + (z int32 :overlay-at (-> data 2)) + (w int32 :overlay-at (-> data 3)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype gs-packed-stq (structure) - ((data float 4 :offset-assert 0) - (tex-s float :offset 0) - (tex-t float :offset 4) - (tex-q float :offset 8) - (quad uint128 :offset 0) + ((data float 4) + (tex-s float :overlay-at (-> data 0)) + (tex-t float :overlay-at (-> data 1)) + (tex-q float :overlay-at (-> data 2)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype gs-packed-gt (structure) - ((stq gs-packed-stq :inline :offset-assert 0) - (rgba gs-packed-rgba :inline :offset-assert 16) - (xyzw gs-packed-xyzw :inline :offset-assert 32) + ((stq gs-packed-stq :inline) + (rgba gs-packed-rgba :inline) + (xyzw gs-packed-xyzw :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype gs-packed-gt4 (structure) - ((data gs-packed-gt 4 :inline :offset-assert 0) + ((data gs-packed-gt 4 :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) + (deftype terrain-bsp (structure) - ((lev-index int32 :offset-assert 0) - (mood basic :offset-assert 4) + ((lev-index int32) + (mood basic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype terrain-stats (structure) - ((pris tr-stat :inline :offset-assert 0) - (tie-generic tr-stat :inline :offset-assert 16) - (tie tr-stat :inline :offset-assert 32) - (tie-near tr-stat :inline :offset-assert 48) - (shrub-near tr-stat :inline :offset-assert 64) - (shrub tr-stat :inline :offset-assert 80) - (tfrag-near tr-stat :inline :offset-assert 96) - (tfrag tr-stat :inline :offset-assert 112) - (billboard tr-stat :inline :offset-assert 128) - (trans-tfrag tr-stat :inline :offset-assert 144) - (trans-tfrag-near tr-stat :inline :offset-assert 160) - (trans-pris tr-stat :inline :offset-assert 176) - (trans-shrub tr-stat :inline :offset-assert 192) - (ocean-mid tr-stat :inline :offset-assert 208) - (ocean-near tr-stat :inline :offset-assert 224) - (total tr-stat :inline :offset-assert 240) + ((pris tr-stat :inline) + (tie-generic tr-stat :inline) + (tie tr-stat :inline) + (tie-near tr-stat :inline) + (shrub-near tr-stat :inline) + (shrub tr-stat :inline) + (tfrag-near tr-stat :inline) + (tfrag tr-stat :inline) + (billboard tr-stat :inline) + (trans-tfrag tr-stat :inline) + (trans-tfrag-near tr-stat :inline) + (trans-pris tr-stat :inline) + (trans-shrub tr-stat :inline) + (ocean-mid tr-stat :inline) + (ocean-near tr-stat :inline) + (total tr-stat :inline) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) + (deftype dma-area (structure) - ((draw-node-dma draw-node-dma :inline :offset 0) - (tfrag-dma tfrag-dma :inline :offset 0) - (instance-shrub-dma instance-shrub-dma :inline :offset 0) - (instance-tie-dma instance-tie-dma :inline :offset 0) - (prototype-tie-dma prototype-tie-dma :inline :offset 0) - (time-of-day-dma time-of-day-dma :inline :offset 0) - (decomp-work decomp-work :inline :offset 0) - (ocean-vertex ocean-vertex 4 :inline :offset 0) + ((draw-node-dma draw-node-dma :inline :offset 0) + (tfrag-dma tfrag-dma :inline :offset 0) + (instance-shrub-dma instance-shrub-dma :inline :offset 0) + (instance-tie-dma instance-tie-dma :inline :offset 0) + (prototype-tie-dma prototype-tie-dma :inline :offset 0) + (time-of-day-dma time-of-day-dma :inline :offset 0) + (decomp-work decomp-work :inline :offset 0) + (ocean-vertex ocean-vertex 4 :inline :offset 0) ) - :method-count-assert 9 - :size-assert #x38a0 - :flag-assert #x9000038a0 ) + (deftype background-area (structure) - ((dma-area dma-area :inline :offset-assert 0) - (vis-list uint8 2048 :offset-assert 14496) + ((dma-area dma-area :inline) + (vis-list uint8 2048) ) - :method-count-assert 9 - :size-assert #x40a0 - :flag-assert #x9000040a0 ) + (deftype foreground-area (structure) - ((joint-work joint-work :inline :offset-assert 0) - (generic-work generic-work :inline :offset 0) - (bone-mem bone-memory :inline :offset 0) - (shadow-work shadow-work :inline :offset 0) + ((joint-work joint-work :inline) + (generic-work generic-work :inline :overlay-at (-> joint-work temp-mtx data 0)) + (bone-mem bone-memory :inline :overlay-at (-> joint-work temp-mtx data 0)) + (shadow-work shadow-work :inline :overlay-at (-> joint-work temp-mtx data 0)) ) - :method-count-assert 9 - :size-assert #x3fd0 - :flag-assert #x900003fd0 ) + (deftype ambient-area (structure) - ((ambient-list ambient-list :inline :offset-assert 0) + ((ambient-list ambient-list :inline) ) - :method-count-assert 9 - :size-assert #x2004 - :flag-assert #x900002004 ) + (deftype work-area (structure) - ((background background-area :inline :offset-assert 0) - (foreground foreground-area :inline :offset 0) - (ambient ambient-area :inline :offset 0) + ((background background-area :inline) + (foreground foreground-area :inline :offset 0) + (ambient ambient-area :inline :offset 0) ) - :method-count-assert 9 - :size-assert #x40a0 - :flag-assert #x9000040a0 ) + (deftype terrain-context (structure) - ((bsp terrain-bsp :inline :offset-assert 0) - (work work-area :inline :offset-assert 16) + ((bsp terrain-bsp :inline) + (work work-area :inline) ) - :method-count-assert 9 - :size-assert #x40b0 - :flag-assert #x9000040b0 ) + (define *terrain-stats* (new 'global 'terrain-stats)) (define *collide-stats* (new 'global 'collide-stats)) diff --git a/goal_src/jak1/engine/gfx/background/subdivide.gc b/goal_src/jak1/engine/gfx/background/subdivide.gc index 7e299792119..8a012bffe56 100644 --- a/goal_src/jak1/engine/gfx/background/subdivide.gc +++ b/goal_src/jak1/engine/gfx/background/subdivide.gc @@ -30,18 +30,9 @@ (defun-debug print-tr-stat ((stat tr-stat) (name string) (dest string)) "Print the statistics for stat to dest and to the screen. Also add them to the total stats" (clear dest) - (when (nonzero? (+ (+ (+ (+ (-> stat groups) (-> stat fragments)) (-> stat tris)) (-> stat dverts)) (-> stat instances))) - (format dest "~0k~4d ~5d ~6d ~6d" - (-> stat groups) - (-> stat fragments) - (-> stat tris) - (-> stat dverts) - ) - (format dest "~0k ~7f ~5d ~s" - (/ (* 2.0 (the float (-> stat tris))) (the float (- (-> stat dverts) (-> stat tris)))) - (-> stat instances) - name - ) + (when (nonzero? (+ (-> stat groups) (-> stat fragments) (-> stat tris) (-> stat dverts) (-> stat instances))) + (format dest "~0k~4d ~5d ~6d ~6d" (-> stat groups) (-> stat fragments) (-> stat tris) (-> stat dverts)) + (format dest "~0k ~7f ~5d ~s" (/ (* 2.0 (the float (-> stat tris))) (the float (- (-> stat dverts) (-> stat tris)))) (-> stat instances) name) ;; print to the screen (format *stdcon* "~S~%" dest) ;; update total @@ -59,22 +50,23 @@ ;; make our own profile thing. (if *debug-segment* - (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) - 'draw - (new 'static 'rgba :r #x40 :b #x40 :a #x80) - ) + (add-frame + (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'draw + (new 'static 'rgba :r #x40 :b #x40 :a #x80) + ) ) - - ;; print level memory stats (dotimes (gp-0 (-> *level* length)) (let ((s5-0 (-> *level* level gp-0))) (when (= (-> s5-0 status) 'active) (compute-memory-usage s5-0 #f) - (format *stdcon* "~0k~D ~A ~,,2fK + textures~%" - (-> s5-0 index) - (-> s5-0 name) - (* 0.0009765625 (the float (-> s5-0 mem-usage))) - ) + (format + *stdcon* + "~0k~D ~A ~,,2fK + textures~%" + (-> s5-0 index) + (-> s5-0 name) + (* 0.0009765625 (the float (-> s5-0 mem-usage))) + ) ) ) ) @@ -121,10 +113,10 @@ (clear-tr-stat (-> *terrain-stats* total)) (if *debug-segment* (add-frame - (-> *display* frames (-> *display* on-screen) frame profile-bar 0) - 'draw - (new 'static 'rgba :b #xff :a #x80) - ) + (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'draw + (new 'static 'rgba :b #xff :a #x80) + ) ) 0 (none) @@ -152,7 +144,7 @@ (none) ) -(define *subdivide-settings* (new 'global 'subdivide-settings (meters 30.0) (meters 70.0))) +(define *subdivide-settings* (new 'global 'subdivide-settings (meters 30) (meters 70))) (defun set-tfrag-dists! ((arg0 tfrag-dists)) (let ((f2-0 (-> *subdivide-settings* dist 0)) @@ -186,21 +178,19 @@ ;; oops, this runs even when not debugging and ends up on global. (define *perf-stats* (new 'debug 'perf-stat-array 17)) -(defmethod print-to-stream perf-stat ((this perf-stat) (arg0 string) (arg1 basic)) +(defmethod print-to-stream ((this perf-stat) (arg0 string) (arg1 basic)) "Print performance info to a stream. But the stream is ignored and it is printed to the screen." - (format *stdcon* "~3d ~8d ~8d ~6d ~6d" - (-> this count) - (-> this cycles) - (-> this instructions) - 0 ;; (-> this icache) removed, doesn't work on pc - 0 ;; (-> this dcache) removed, doesn't work on pc - ) - (format *stdcon* " ~2d ~2d ~2d" - (-> this to-vu0-waits) - (-> this to-spr-waits) - (-> this from-spr-waits) - ) + (format + *stdcon* + "~3d ~8d ~8d ~6d ~6d" + (-> this count) + (-> this cycles) + (-> this instructions) + (-> this icache) + (-> this dcache) + ) + (format *stdcon* " ~2d ~2d ~2d" (-> this to-vu0-waits) (-> this to-spr-waits) (-> this from-spr-waits)) (format *stdcon* " ~s~%" arg0) (none) ) @@ -231,7 +221,7 @@ ;; Set up for the GOMI STATS HACK (define GSH_ENABLE #f) -(define GSH_BUCKET (the-as bucket-id 3)) +(define GSH_BUCKET (bucket-id sky-draw)) (define GSH_WHICH_STAT 1) (define GSH_MAX_DISPLAY (the-as basic #f)) (define GSH_TIME 64) @@ -245,22 +235,14 @@ (when GSH_ENABLE (let ((bucket GSH_BUCKET)) (let ((which-stat GSH_WHICH_STAT)) - (set! gp-0 (the-as uint (+ (* bucket 2) (the-as uint which-stat)))) + (set! gp-0 (+ (* (the-as uint bucket) 2) which-stat)) ) (when GSH_MAX_DISPLAY (let ((stat-idx (logand (-> *perf-stats* data 0 frame-number) (+ GSH_TIME -1)))) - (set! (-> *gomi-stats-hack* stat-idx cycles) - (-> *perf-stats* data (the-as int bucket) cycles) - ) - (set! (-> *gomi-stats-hack* stat-idx instructions) - (-> *perf-stats* data (the-as int bucket) instructions) - ) - (set! (-> *gomi-stats-hack* stat-idx icache) - (-> *perf-stats* data (the-as int bucket) icache) - ) - (set! (-> *gomi-stats-hack* stat-idx dcache) - (-> *perf-stats* data (the-as int bucket) dcache) - ) + (set! (-> *gomi-stats-hack* stat-idx cycles) (-> *perf-stats* data (the-as int bucket) cycles)) + (set! (-> *gomi-stats-hack* stat-idx instructions) (-> *perf-stats* data (the-as int bucket) instructions)) + (set! (-> *gomi-stats-hack* stat-idx icache) (-> *perf-stats* data (the-as int bucket) icache)) + (set! (-> *gomi-stats-hack* stat-idx dcache) (-> *perf-stats* data (the-as int bucket) dcache)) (when (zero? stat-idx) (set! (-> *gomi-stats-hack* GSH_TIME cycles) (the-as uint 0)) (set! (-> *gomi-stats-hack* GSH_TIME instructions) (the-as uint 0)) @@ -268,25 +250,17 @@ (set! (-> *gomi-stats-hack* GSH_TIME dcache) (the-as uint 0)) (dotimes (v1-22 GSH_TIME) (if (< (-> *gomi-stats-hack* GSH_TIME cycles) (-> *gomi-stats-hack* v1-22 cycles)) - (set! (-> *gomi-stats-hack* GSH_TIME cycles) - (-> *gomi-stats-hack* v1-22 cycles) - ) - ) + (set! (-> *gomi-stats-hack* GSH_TIME cycles) (-> *gomi-stats-hack* v1-22 cycles)) + ) (if (< (-> *gomi-stats-hack* GSH_TIME instructions) (-> *gomi-stats-hack* v1-22 instructions)) - (set! (-> *gomi-stats-hack* GSH_TIME instructions) - (-> *gomi-stats-hack* v1-22 instructions) - ) - ) + (set! (-> *gomi-stats-hack* GSH_TIME instructions) (-> *gomi-stats-hack* v1-22 instructions)) + ) (if (< (-> *gomi-stats-hack* GSH_TIME icache) (-> *gomi-stats-hack* v1-22 icache)) - (set! (-> *gomi-stats-hack* GSH_TIME icache) - (-> *gomi-stats-hack* v1-22 icache) - ) - ) + (set! (-> *gomi-stats-hack* GSH_TIME icache) (-> *gomi-stats-hack* v1-22 icache)) + ) (if (< (-> *gomi-stats-hack* GSH_TIME dcache) (-> *gomi-stats-hack* v1-22 dcache)) - (set! (-> *gomi-stats-hack* GSH_TIME dcache) - (-> *gomi-stats-hack* v1-22 dcache) - ) - ) + (set! (-> *gomi-stats-hack* GSH_TIME dcache) (-> *gomi-stats-hack* v1-22 dcache)) + ) ) ) ) @@ -303,27 +277,27 @@ 0 ) (else - (let ((a1-63 (logand gp-0 1)) - (a0-64 (the-as uint #x80004010)) + (let ((a1-63 (logand gp-0 1)) + (a0-64 (the-as uint #x80004010)) + ) + (cond + ((zero? a1-63) + (set! a0-64 (the-as uint (+ #x60020 a0-64))) + ) + ((= a1-63 1) + (set! a0-64 (the-as uint (+ #x300c0 a0-64))) ) - (cond - ((zero? a1-63) - (set! a0-64 (the-as uint (+ #x60020 (the-as int a0-64)))) - ) - ((= a1-63 1) - (set! a0-64 (the-as uint (+ #x300c0 (the-as int a0-64)))) ) - ) - (set! (-> *perf-stats* data v1-27 select) a1-63) - (set! (-> *perf-stats* data v1-27 ctrl) a0-64) - ) - (set! (-> *perf-stats* data v1-27 accum0) (the-as uint 0)) - (set! (-> *perf-stats* data v1-27 accum1) (the-as uint 0)) - (set! (-> *perf-stats* data v1-27 to-vu0-waits) (the-as uint 0)) - (set! (-> *perf-stats* data v1-27 to-spr-waits) (the-as uint 0)) - (set! (-> *perf-stats* data v1-27 from-spr-waits) (the-as uint 0)) - 0 - ) + (set! (-> *perf-stats* data v1-27 select) a1-63) + (set! (-> *perf-stats* data v1-27 ctrl) a0-64) + ) + (set! (-> *perf-stats* data v1-27 accum0) (the-as uint 0)) + (set! (-> *perf-stats* data v1-27 accum1) (the-as uint 0)) + (set! (-> *perf-stats* data v1-27 to-vu0-waits) (the-as uint 0)) + (set! (-> *perf-stats* data v1-27 to-spr-waits) (the-as uint 0)) + (set! (-> *perf-stats* data v1-27 from-spr-waits) (the-as uint 0)) + 0 + ) ) ) ) @@ -332,15 +306,15 @@ (a0-76 (-> v1-31 0 ctrl)) ) (+! (-> v1-31 0 count) 1) - (b! (zero? a0-76) cfg-28) + (b! (zero? a0-76) cfg-28 :delay (nop!)) (set! *pc-perf-stat-counter* (get-cpu-clock)) ;; patched #| - (.mtc0 Perf r0-0) + (.mtc0 Perf 0) (.sync.l) (.sync.p) - (.mtpc pcr0 r0-0) - (.mtpc pcr1 r0-0) + (.mtpc pcr0 0) + (.mtpc pcr1 0) (.sync.l) (.sync.p) (.mtc0 Perf a0-76) @@ -355,7 +329,7 @@ ) (defun-debug end-perf-stat-collection () - (local-vars (r0-0 none) (a0-1 int) (a0-3 int)) + (local-vars (a0-1 int) (a0-3 int)) (let ((v1-1 (-> *perf-stats* data))) (b! (zero? (-> v1-1 0 ctrl)) cfg-2) ;;(.mtc0 Perf r0-0) @@ -400,10 +374,10 @@ (dotimes (gp-0 17) (if (nonzero? (-> *perf-stats* data gp-0 count)) (print-to-stream - (-> *perf-stats* data gp-0) - (perf-stat-bucket->string (the-as perf-stat-bucket gp-0)) - *stdcon* - ) + (-> *perf-stats* data gp-0) + (perf-stat-bucket->string (the-as perf-stat-bucket gp-0)) + *stdcon* + ) ) ) 0 diff --git a/goal_src/jak1/engine/gfx/background/wind-h.gc b/goal_src/jak1/engine/gfx/background/wind-h.gc index 4916acdbdb0..cfdb40a9def 100644 --- a/goal_src/jak1/engine/gfx/background/wind-h.gc +++ b/goal_src/jak1/engine/gfx/background/wind-h.gc @@ -11,15 +11,12 @@ ;; DECOMP BEGINS (deftype wind-vector (structure) - ((wind-pos vector2w :inline :offset-assert 0) - (wind-vel vector2w :inline :offset-assert 8) + ((wind-pos vector2w :inline) + (wind-vel vector2w :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) - (define *wind-scales* (new 'static 'boxed-array :type uint8 :length 32 + (define *wind-scales* (new 'static 'boxed-array :type uint8 #x2 #x5 #x2 #x3 #x2 #x2 #x3 #x10 #xa #x2 #x4 #x2 @@ -32,15 +29,12 @@ ) (deftype wind-work (basic) - ((wind-array vector 64 :inline :offset-assert 16) - (wind-normal vector :inline :offset-assert 1040) - (wind-temp vector :inline :offset-assert 1056) - (wind-force float 64 :offset-assert 1072) - (wind-time uint32 :offset-assert 1328) + ((wind-array vector 64 :inline) + (wind-normal vector :inline) + (wind-temp vector :inline) + (wind-force float 64) + (wind-time uint32) ) - :method-count-assert 9 - :size-assert #x534 - :flag-assert #x900000534 ) ; This was likely originally defined inside `wind-h` @@ -48,10 +42,5 @@ (define-extern *wind-work* wind-work) (defun wind-get-hashed-index ((arg0 vector)) - (logand (+ (the int (-> arg0 data 0)) - (the int (-> arg0 data 2)) - (the-as int (-> *wind-work* wind-time)) - ) - #x3f - ) + (logand (+ (the int (-> arg0 x)) (the int (-> arg0 z)) (-> *wind-work* wind-time)) 63) ) diff --git a/goal_src/jak1/engine/gfx/depth-cue-h.gc b/goal_src/jak1/engine/gfx/depth-cue-h.gc index bace7871138..c7748f61440 100644 --- a/goal_src/jak1/engine/gfx/depth-cue-h.gc +++ b/goal_src/jak1/engine/gfx/depth-cue-h.gc @@ -8,28 +8,23 @@ ;; DECOMP BEGINS (deftype depth-cue-data (structure) - ((data vector :inline :offset-assert 0) - (sharpness float :offset 0) - (alpha float :offset 4) - (distance float :offset 8) - (w float :offset 12) + ((data vector :inline) + (sharpness float :overlay-at (-> data x)) + (alpha float :overlay-at (-> data y)) + (distance float :overlay-at (-> data z)) + (w float :overlay-at (-> data w)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype depth-cue-work (structure) - ((texture-strip-tmpl dma-gif-packet :inline :offset-assert 0) - (temp-strip-tmpl dma-gif-packet :inline :offset-assert 32) - (stencil-tmpl dma-gif-packet :inline :offset-assert 64) - (clear-color vector4w :inline :offset-assert 96) - (set-color vector4w :inline :offset-assert 112) - (draw-color vector4w :inline :offset-assert 128) - (depth depth-cue-data :offset-assert 144) - (front depth-cue-data :offset-assert 148) + ((texture-strip-tmpl dma-gif-packet :inline) + (temp-strip-tmpl dma-gif-packet :inline) + (stencil-tmpl dma-gif-packet :inline) + (clear-color vector4w :inline) + (set-color vector4w :inline) + (draw-color vector4w :inline) + (depth depth-cue-data) + (front depth-cue-data) ) - :method-count-assert 9 - :size-assert #x98 - :flag-assert #x900000098 ) diff --git a/goal_src/jak1/engine/gfx/font-h.gc b/goal_src/jak1/engine/gfx/font-h.gc index 7b03989d946..ed24198e501 100644 --- a/goal_src/jak1/engine/gfx/font-h.gc +++ b/goal_src/jak1/engine/gfx/font-h.gc @@ -62,78 +62,70 @@ ) (deftype char-verts (structure) - ((pos vector 4 :inline :offset-assert 0) - (color vector 4 :inline :offset-assert 64) - (tex-st vector 4 :inline :offset-assert 128) + ((pos vector 4 :inline) + (color vector 4 :inline) + (tex-st vector 4 :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) + (deftype char-color (structure) - ((color rgba 4 :offset-assert 0) + ((color rgba 4) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) -(define *font-default-matrix* (new 'static 'matrix - :data (new 'static 'array float 16 - 1.0 0.0 0.0 0.0 - 0.0 1.0 0.0 0.0 - 0.0 0.0 1.0 0.0 - -256.0 0.0 0.0 1.0 - ) - ) - ) + +(define *font-default-matrix* (new 'static 'matrix :vector (new 'static 'inline-array vector 4 + (new 'static 'vector :x 1.0) + (new 'static 'vector :y 1.0) + (new 'static 'vector :z 1.0) + (new 'static 'vector :x -256.0 :w 1.0) + ) + ) + ) ;; font settings that can be passed to draw-string (deftype font-context (basic) - ((origin vector :inline :offset-assert 16) - (strip-gif vector :inline :offset-assert 32) - (width float :offset-assert 48) - (height float :offset-assert 52) - (projection float :offset-assert 56) - (context-vec vector :inline :offset 48) ;; added - (color font-color :offset-assert 64) - (color-s32 int32 :offset 64) ;; added for asm - (flags font-flags :offset-assert 72) - (flags-signed int32 :offset 72) ;; added for asm - (mat matrix :offset-assert 76) - (start-line uint32 :offset-assert 80) - (scale float :offset-assert 84) + ((origin vector :inline) + (strip-gif vector :inline) + (width float) + (height float) + (projection float) + (context-vec vector :inline :overlay-at width) + (color font-color) + (color-s32 int32 :overlay-at color) + (flags font-flags) + (flags-signed int32 :overlay-at flags) + (mat matrix) + (start-line uint32) + (scale float) ) - :method-count-assert 20 - :size-assert #x58 - :flag-assert #x1400000058 (:methods - (new (symbol type matrix int int float font-color font-flags) _type_ 0) - (set-mat! (font-context matrix) font-context 9) - (set-origin! (font-context int int) font-context 10) - (set-depth! (font-context int) font-context 11) - (set-w! (font-context float) font-context 12) - (set-width! (font-context int) font-context 13) - (set-height! (font-context int) font-context 14) - (set-projection! (font-context float) font-context 15) - (set-color! (font-context font-color) font-context 16) - (set-flags! (font-context font-flags) font-context 17) - (set-start-line! (font-context uint) font-context 18) - (set-scale! (font-context float) font-context 19) + (new (symbol type matrix int int float font-color font-flags) _type_) + (set-mat! (font-context matrix) font-context) + (set-origin! (font-context int int) font-context) + (set-depth! (font-context int) font-context) + (set-w! (font-context float) font-context) + (set-width! (font-context int) font-context) + (set-height! (font-context int) font-context) + (set-projection! (font-context float) font-context) + (set-color! (font-context font-color) font-context) + (set-flags! (font-context font-flags) font-context) + (set-start-line! (font-context uint) font-context) + (set-scale! (font-context float) font-context) ) ) ;; I don't believe these methods are called, so they might be inlined -(defmethod set-mat! font-context ((this font-context) (mat matrix)) +(defmethod set-mat! ((this font-context) (mat matrix)) (declare (inline)) (set! (-> this mat) mat) this ) -(defmethod set-origin! font-context ((this font-context) (x int) (y int)) +(defmethod set-origin! ((this font-context) (x int) (y int)) (declare (inline)) (set! (-> this origin x) (the float x)) @@ -141,161 +133,161 @@ this ) -(defmethod set-depth! font-context ((this font-context) (z int)) +(defmethod set-depth! ((this font-context) (z int)) (declare (inline)) (set! (-> this origin z) (the float z)) this ) -(defmethod set-w! font-context ((this font-context) (w float)) +(defmethod set-w! ((this font-context) (w float)) (declare (inline)) (set! (-> this origin w) w) this ) -(defmethod set-width! font-context ((this font-context) (width int)) +(defmethod set-width! ((this font-context) (width int)) (declare (inline)) (set! (-> this width) (the float width)) this ) -(defmethod set-height! font-context ((this font-context) (height int)) +(defmethod set-height! ((this font-context) (height int)) (declare (inline)) (set! (-> this height) (the float height)) this ) -(defmethod set-projection! font-context ((this font-context) (proj float)) +(defmethod set-projection! ((this font-context) (proj float)) (declare (inline)) (set! (-> this projection) proj) this ) -(defmethod set-color! font-context ((this font-context) (color font-color)) +(defmethod set-color! ((this font-context) (color font-color)) (declare (inline)) (set! (-> this color) color) this ) -(defmethod set-flags! font-context ((this font-context) (flags font-flags)) +(defmethod set-flags! ((this font-context) (flags font-flags)) (declare (inline)) (set! (-> this flags) flags) this ) -(defmethod set-start-line! font-context ((this font-context) (start-line uint)) +(defmethod set-start-line! ((this font-context) (start-line uint)) (declare (inline)) (set! (-> this start-line) start-line) this ) -(defmethod set-scale! font-context ((this font-context) (scale float)) +(defmethod set-scale! ((this font-context) (scale float)) (declare (inline)) (set! (-> this scale) scale) this ) -(defmethod new font-context ((allocation symbol) (type-to-make type) (mat matrix) (x int) (y int) (z float) (color font-color) (flags font-flags)) - (let - ((this - (object-new allocation type-to-make (the-as int (-> type-to-make size))) - ) - ) - (set! (-> this mat) mat) - (let ((v1-3 this)) - (set! (-> v1-3 origin x) (the float x)) - (set! (-> v1-3 origin y) (the float y)) - ) - (cond - ((= z 0.0) - (let ((v1-4 this)) - (set! (-> v1-4 origin z) (-> *math-camera* isometric vector 3 z)) - ;;(format #t "fc: ~F~%" (-> v1-4 origin z)) - ) - ) - (else - (let ((v1-5 this)) - (set! (-> v1-5 origin z) z) - ) - ) - ) - (let ((v1-6 this)) - (set! (-> v1-6 origin w) 1.0) - ) - (let ((v1-7 this)) - (set! (-> v1-7 width) (the float 512)) - ) - (let ((v1-8 this)) - (set! (-> v1-8 height) (the float 256)) +(defmethod new font-context ((allocation symbol) + (type-to-make type) + (mat matrix) + (x int) + (y int) + (z float) + (color font-color) + (flags font-flags) + ) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this mat) mat) + (let ((v1-3 this)) + (set! (-> v1-3 origin x) (the float x)) + (set! (-> v1-3 origin y) (the float y)) + ) + (cond + ((= z 0.0) + (let ((v1-4 this)) + (set! (-> v1-4 origin z) (-> *math-camera* isometric vector 3 z)) + ) + ) + (else + (let ((v1-5 this)) + (set! (-> v1-5 origin z) z) + ) + ) + ) + (let ((v1-6 this)) + (set! (-> v1-6 origin w) 1.0) + ) + (let ((v1-7 this)) + (set! (-> v1-7 width) (the float 512)) + ) + (let ((v1-8 this)) + (set! (-> v1-8 height) (the float 256)) + ) + (let ((v1-9 this)) + (set! (-> v1-9 projection) 1.0) + ) + (set! (-> this color) color) + (set! (-> this flags) flags) + (let ((a0-4 this)) + (set! (-> a0-4 start-line) (the-as uint 0)) + ) + (let ((v1-13 this)) + (set! (-> v1-13 scale) 1.0) + ) + this ) - (let ((v1-9 this)) - (set! (-> v1-9 projection) 1.0) - ) - (set! (-> this color) color) - (set! (-> this flags) flags) - (let ((a0-4 this)) - (set! (-> a0-4 start-line) (the-as uint 0)) - ) - (let ((v1-13 this)) - (set! (-> v1-13 scale) 1.0) - ) - this - ) ) ;; Data used by the font-renderer. (deftype font-work (structure) - ((font-tmpl dma-gif-packet :inline :offset-assert 0) - (char-tmpl dma-gif-packet :inline :offset-assert 32) - (tex1-tmpl uint64 2 :offset-assert 64) - (small-font-lo-tmpl uint64 2 :offset-assert 80) - (small-font-lo-tmpl-qw uint128 :offset 80) - (small-font-hi-tmpl uint64 2 :offset-assert 96) - (small-font-hi-tmpl-qw uint128 :offset 96) - (large-font-lo-tmpl uint64 2 :offset-assert 112) - (large-font-lo-tmpl-qw uint128 :offset 112) - (large-font-hi-tmpl uint64 2 :offset-assert 128) - (large-font-hi-tmpl-qw uint128 :offset 128) - (size1-small vector :inline :offset-assert 144) - (size2-small vector :inline :offset-assert 160) - (size3-small vector :inline :offset-assert 176) - (size1-large vector :inline :offset-assert 192) - (size2-large vector :inline :offset-assert 208) - (size3-large vector :inline :offset-assert 224) - (size-st1 vector :inline :offset-assert 240) - (size-st2 vector :inline :offset-assert 256) - (size-st3 vector :inline :offset-assert 272) - (save vector :inline :offset-assert 288) - (save-color vector 4 :inline :offset-assert 304) - (current-verts char-verts :inline :offset-assert 368) - (src-verts char-verts :inline :offset-assert 560) - (dest-verts char-verts :inline :offset-assert 752) - (justify vector 64 :inline :offset-assert 944) - (color-shadow vector4w :inline :offset-assert 1968) - (color-table char-color 64 :inline :offset-assert 1984) - (last-color font-color :offset-assert 3008) - (last-color-32 int32 :offset 3008) - (save-last-color font-color :offset-assert 3016) - (save-last-color-32 int32 :offset 3016) ;; added - (buf basic :offset-assert 3024) - (str-ptr uint32 :offset-assert 3028) - (str-ptr-signed (pointer uint8) :offset 3028) ;; added - (flags font-flags :offset-assert 3032) - (flags-signed int32 :offset 3032) ;; added - (reg-save uint32 5 :offset-assert 3036) + ((font-tmpl dma-gif-packet :inline) + (char-tmpl dma-gif-packet :inline) + (tex1-tmpl uint64 2) + (small-font-lo-tmpl uint64 2) + (small-font-lo-tmpl-qw uint128 :overlay-at (-> small-font-lo-tmpl 0)) + (small-font-hi-tmpl uint64 2) + (small-font-hi-tmpl-qw uint128 :overlay-at (-> small-font-hi-tmpl 0)) + (large-font-lo-tmpl uint64 2) + (large-font-lo-tmpl-qw uint128 :overlay-at (-> large-font-lo-tmpl 0)) + (large-font-hi-tmpl uint64 2) + (large-font-hi-tmpl-qw uint128 :overlay-at (-> large-font-hi-tmpl 0)) + (size1-small vector :inline) + (size2-small vector :inline) + (size3-small vector :inline) + (size1-large vector :inline) + (size2-large vector :inline) + (size3-large vector :inline) + (size-st1 vector :inline) + (size-st2 vector :inline) + (size-st3 vector :inline) + (save vector :inline) + (save-color vector 4 :inline) + (current-verts char-verts :inline) + (src-verts char-verts :inline) + (dest-verts char-verts :inline) + (justify vector 64 :inline) + (color-shadow vector4w :inline) + (color-table char-color 64 :inline) + (last-color font-color) + (last-color-32 int32 :overlay-at last-color) + (save-last-color font-color) + (save-last-color-32 int32 :overlay-at save-last-color) + (buf basic) + (str-ptr uint32) + (str-ptr-signed (pointer uint8) :overlay-at str-ptr) + (flags font-flags) + (flags-signed int32 :overlay-at flags) + (reg-save uint32 5) ) - :method-count-assert 9 - :size-assert #xbf0 - :flag-assert #x900000bf0 ) @@ -777,18 +769,17 @@ ) (defun font-set-tex0 ((ptr-tex0 (pointer gs-tex0)) (tex texture) (tex-addr uint) (psm uint) (clut-addr uint)) - "Write the TEX0 parameters for a font" - - (set! (-> ptr-tex0) (new 'static 'gs-tex0 - :tcc #x1 - :cld #x1 - :cbp clut-addr - :th (log2 (-> tex h)) - :tw (log2 (-> tex w)) - :tbw (-> tex width 0) - :tbp0 (sar tex-addr 6) - :psm psm - )) + (set! (-> ptr-tex0 0) (new 'static 'gs-tex0 + :tcc #x1 + :cld #x1 + :cbp clut-addr + :th (log2 (-> tex h)) + :tw (log2 (-> tex w)) + :tbw (-> tex width 0) + :tbp0 (/ (the-as int tex-addr) 64) + :psm psm + ) + ) (none) ) diff --git a/goal_src/jak1/engine/gfx/foreground/bones-h.gc b/goal_src/jak1/engine/gfx/foreground/bones-h.gc index 3edaa30efa9..d5d03793fc4 100644 --- a/goal_src/jak1/engine/gfx/foreground/bones-h.gc +++ b/goal_src/jak1/engine/gfx/foreground/bones-h.gc @@ -12,75 +12,62 @@ ;; DECOMP BEGINS (deftype bone-buffer (structure) - ((joint joint-anim-compressed-hdr 16 :inline :offset-assert 0) - (bone bone 16 :inline :offset-assert 1024) - (_pad uint8 2048 :offset-assert 2560) + ((joint joint-anim-compressed-hdr 16 :inline) + (bone bone 16 :inline) + (_pad uint8 2048) ) - :method-count-assert 9 - :size-assert #x1200 - :flag-assert #x900001200 ) + (deftype bone-layout (structure) - ((joint joint 2 :offset-assert 0) - (bone bone 2 :offset-assert 8) - (data uint16 8 :offset 0) - (output uint32 2 :offset-assert 16) - (cache uint32 2 :offset-assert 24) + ((joint joint 2) + (bone bone 2) + (data uint16 8 :overlay-at (-> joint 0)) + (output uint32 2) + (cache uint32 2) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype bone-regs (structure) - ((joint-ptr (inline-array joint) :offset-assert 0) - (bone-ptr (inline-array bone) :offset-assert 4) - (num-bones uint32 :offset-assert 8) + ((joint-ptr (inline-array joint)) + (bone-ptr (inline-array bone)) + (num-bones uint32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) + (deftype bone-work (structure) - ((layout bone-layout :inline :offset-assert 0) - (bounds sphere :inline :offset-assert 32) - (lights vu-lights :inline :offset-assert 48) - (distance vector :inline :offset-assert 160) - (next-tag dma-packet :inline :offset-assert 176) - (dma-buf dma-buffer :offset-assert 192) - (sink-group dma-foreground-sink-group :offset-assert 196) - (next-pris dma-packet :offset-assert 200) - (next-merc dma-packet :offset-assert 204) - (wait-count uint32 :offset-assert 208) - (in-count uint32 :offset-assert 212) - (sp-size uint32 :offset-assert 216) - (sp-bufnum uint32 :offset-assert 220) - (regs bone-regs :inline :offset-assert 224) + ((layout bone-layout :inline) + (bounds sphere :inline) + (lights vu-lights :inline) + (distance vector :inline) + (next-tag dma-packet :inline) + (dma-buf dma-buffer) + (sink-group dma-foreground-sink-group) + (next-pris dma-packet) + (next-merc dma-packet) + (wait-count uint32) + (in-count uint32) + (sp-size uint32) + (sp-bufnum uint32) + (regs bone-regs :inline) ) - :method-count-assert 9 - :size-assert #xec - :flag-assert #x9000000ec ) + (deftype bone-debug (structure) - ((time-ctr uint32 :offset-assert 0) - (timing uint32 360 :offset-assert 4) + ((time-ctr uint32) + (timing uint32 360) ) - :method-count-assert 9 - :size-assert #x5a4 - :flag-assert #x9000005a4 ) + (deftype bone-memory (structure) - ((work bone-work :inline :offset-assert 0) - (buffer bone-buffer 2 :inline :offset-assert 240) - (dma-list dma-packet :inline :offset 240) + ((work bone-work :inline) + (buffer bone-buffer 2 :inline) + (dma-list dma-packet :inline :overlay-at (-> buffer 0 joint 0 control-bits 0)) ) - :method-count-assert 9 - :size-assert #x24f0 - :flag-assert #x9000024f0 ) (defun invalidate-cache-line ((arg0 pointer)) @@ -97,37 +84,30 @@ ) (deftype merc-globals (structure) - ((first uint32 :offset-assert 0) - (next (pointer uint32) :offset-assert 4) - (sink generic-dma-foreground-sink :offset-assert 8) + ((first uint32) + (next (pointer uint32)) + (sink generic-dma-foreground-sink) ) :allow-misaligned - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) + (deftype merc-global-array (structure) - ((count uint32 :offset-assert 0) - (globals merc-globals 8 :inline :offset-assert 4) + ((count uint32) + (globals merc-globals 8 :inline) ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) + (define *merc-globals* (the-as merc-globals #f)) (deftype shadow-dma-packet (structure) - ((tag generic-merc-tag :inline :offset-assert 0) - (settings shadow-settings :inline :offset-assert 16) - (geo-ref dma-packet :inline :offset-assert 96) - (mtx-ref dma-packet :inline :offset-assert 112) - (end-tag dma-packet :inline :offset-assert 128) + ((tag generic-merc-tag :inline) + (settings shadow-settings :inline) + (geo-ref dma-packet :inline) + (mtx-ref dma-packet :inline) + (end-tag dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) (define-extern vu-lights<-light-group! (function vu-lights light-group none)) diff --git a/goal_src/jak1/engine/gfx/foreground/eye-h.gc b/goal_src/jak1/engine/gfx/foreground/eye-h.gc index 91c8138a141..d3301bd5f24 100644 --- a/goal_src/jak1/engine/gfx/foreground/eye-h.gc +++ b/goal_src/jak1/engine/gfx/foreground/eye-h.gc @@ -12,53 +12,41 @@ ;; DECOMP BEGINS (deftype eye (structure) - ((data vector 2 :inline :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (lid float :offset 8) - (iris-scale float :offset 16) - (pupil-scale float :offset 20) - (lid-scale float :offset 24) + ((data vector 2 :inline) + (x float :overlay-at (-> data 0 x)) + (y float :overlay-at (-> data 0 y)) + (lid float :overlay-at (-> data 0 z)) + (iris-scale float :offset 16) + (pupil-scale float :offset 20) + (lid-scale float :offset 24) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype eye-control (structure) - ((process handle :offset-assert 0) - (random-time uint16 :offset-assert 8) - (level uint16 :offset-assert 10) - (blink float :offset-assert 12) - (shaders (inline-array adgif-shader) :offset-assert 16) - (left eye :inline :offset-assert 32) - (right eye :inline :offset-assert 64) + ((process handle) + (random-time uint16) + (level uint16) + (blink float) + (shaders (inline-array adgif-shader)) + (left eye :inline) + (right eye :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) (deftype eye-control-array (basic) - ((data eye-control 11 :inline :offset-assert 16) + ((data eye-control 11 :inline) ) - :method-count-assert 9 - :size-assert #x430 - :flag-assert #x900000430 ) (deftype eye-work (structure) - ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) - (sprite-tmpl2 dma-gif-packet :inline :offset-assert 32) - (adgif-tmpl dma-gif-packet :inline :offset-assert 64) - (blink-table float 10 :offset-assert 96) + ((sprite-tmpl dma-gif-packet :inline) + (sprite-tmpl2 dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (blink-table float 10) ) - :method-count-assert 9 - :size-assert #x88 - :flag-assert #x900000088 ) diff --git a/goal_src/jak1/engine/gfx/foreground/ripple.gc b/goal_src/jak1/engine/gfx/foreground/ripple.gc index 63ba0ec14b6..5e0a3fd696a 100644 --- a/goal_src/jak1/engine/gfx/foreground/ripple.gc +++ b/goal_src/jak1/engine/gfx/foreground/ripple.gc @@ -11,24 +11,20 @@ ;; DECOMP BEGINS (deftype ripple-request (structure) - ((waveform ripple-wave :offset-assert 0) - (effect merc-effect :offset-assert 4) + ((waveform ripple-wave) + (effect merc-effect) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype ripple-globals (structure) - ((count int32 :offset-assert 0) - (requests ripple-request 16 :inline :offset-assert 4) + ((count int32) + (requests ripple-request 16 :inline) ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) + (define *ripple-globals* (new 'global 'ripple-globals)) (defun ripple-make-request ((arg0 ripple-wave) (arg1 merc-effect)) @@ -45,35 +41,34 @@ (when (zero? a3-0) (set! (-> a2-1 v1-1 effect) arg1) (set! (-> a2-1 v1-1 waveform) arg0) - (set! (-> *ripple-globals* count) (+ (-> *ripple-globals* count) 1)) + (+! (-> *ripple-globals* count) 1) ) ) ) + 0 (none) ) (defun ripple-update-waveform-offs ((arg0 ripple-wave-set)) - (let ((f0-1 (the float (- (-> *display* integral-frame-counter) (the int (-> arg0 frame-save)))))) + (let ((f0-1 (the float (- (-> *display* integral-frame-counter) (the-as int (-> arg0 frame-save)))))) (when (!= f0-1 0.0) (dotimes (v1-4 (-> arg0 count)) (let ((a1-4 (-> arg0 wave v1-4))) - (set! (-> a1-4 offs) (+ (-> a1-4 offs) (* f0-1 (-> a1-4 delta)))) + (+! (-> a1-4 offs) (* f0-1 (-> a1-4 delta))) (set! (-> a1-4 offs) (the float (logand (the int (-> a1-4 offs)) #xffff))) ) ) - (set! (-> arg0 frame-save) (the uint (-> *display* integral-frame-counter))) + (set! (-> arg0 frame-save) (the-as uint (-> *display* integral-frame-counter))) ) ) + 0 (none) ) -;; definition for function ripple-execute-init (def-mips2c ripple-execute-init (function none)) -;; definition for function ripple-create-wave-table (def-mips2c ripple-create-wave-table (function ripple-wave-set int)) -;; definition for function ripple-apply-wave-table (def-mips2c ripple-apply-wave-table (function merc-effect symbol)) (defun ripple-execute () @@ -102,12 +97,12 @@ ) ) (set! (-> *ripple-globals* count) 0) + 0 ) (none) ) -;; definition for function ripple-matrix-scale -;; ERROR: function was not converted to expressions. Cannot decompile. +(def-mips2c ripple-matrix-scale function) (defun-debug ripple-add-debug-sphere ((arg0 process-drawable) (arg1 vector) (arg2 float) (arg3 float)) (let ((f30-0 (- (quaternion-y-angle (-> arg0 root quat)))) @@ -122,13 +117,7 @@ ) (set! (-> s5-0 w) 0.0) (vector+! s5-0 s5-0 (-> arg0 root trans)) - (add-debug-sphere - #t - (bucket-id debug) - s5-0 - 2048.0 - (new 'static 'rgba :r #xff :g #xff :a #x80) - ) + (add-debug-sphere #t (bucket-id debug) s5-0 2048.0 (new 'static 'rgba :r #xff :g #xff :a #x80)) ) (none) ) @@ -137,10 +126,7 @@ (let ((f30-0 0.0)) (dotimes (s3-0 (-> arg0 count)) (let* ((v1-3 (-> arg0 wave s3-0)) - (f0-2 (+ (+ (-> v1-3 offs) (* arg1 (-> v1-3 xmul))) - (* arg2 (-> v1-3 zmul)) - ) - ) + (f0-2 (+ (-> v1-3 offs) (* arg1 (-> v1-3 xmul)) (* arg2 (-> v1-3 zmul)))) ) (+! f30-0 (* (-> v1-3 scale) (cos f0-2))) ) @@ -149,64 +135,57 @@ ) ) -;; definition for function ripple-find-height (defun ripple-find-height ((arg0 process-drawable) (arg1 int) (arg2 vector)) (local-vars (sv-16 float) (sv-32 float)) (let* ((f30-0 (-> arg0 root trans y)) (v1-1 (-> arg0 draw)) (a1-5 (-> v1-1 lod-set lod (-> v1-1 cur-lod) geo effect)) ) - (if (or (zero? (logand (-> a1-5 0 effect-bits) 4)) (not (-> v1-1 ripple))) - (return f30-0) - ) - (let* ((a1-6 (-> a1-5 0 extra-info)) - (s4-0 - (the-as - mei-ripple - (+ (the-as uint a1-6) (the-as uint (* (-> a1-6 ripple-offset) 16))) - ) + (if (or (not (logtest? (-> a1-5 0 effect-bits) 4)) (not (-> v1-1 ripple))) + (return f30-0) + ) + (let* ((a1-6 (-> a1-5 0 extra-info)) + (s4-0 (the-as mei-ripple (+ (the-as uint a1-6) (* (-> a1-6 ripple-offset) 16)))) + (gp-0 (-> v1-1 ripple)) + (s5-0 (-> gp-0 waveform)) ) - (gp-0 (-> v1-1 ripple)) - (s5-0 (-> gp-0 waveform)) + (if (not (-> gp-0 waveform)) + (return f30-0) ) - (if (not (-> gp-0 waveform)) - (return f30-0) - ) - (if (not (-> s5-0 converted)) - (return f30-0) - ) - (let* ((f28-0 (- (-> arg2 x) (-> arg0 root trans x))) - (f26-0 (- (-> arg2 z) (-> arg0 root trans z))) - (f22-0 (+ (quaternion-y-angle (-> arg0 root quat)) (-> s4-0 angle))) - (f24-0 (cos f22-0)) - (f1-3 (sin f22-0)) - (f0-4 (- (* f28-0 f24-0) (* f26-0 f1-3))) - (f1-5 (+ (* f26-0 f24-0) (* f28-0 f1-3))) - (f2-3 (/ 1.0 (-> s4-0 grid-size))) - (f28-1 (* f2-3 (- f0-4 (-> s4-0 x-base)))) - (f26-1 (* f2-3 (- f1-5 (-> s4-0 z-base)))) - ) - (ripple-update-waveform-offs s5-0) - (let* ((f22-1 (the float (the int f28-1))) - (f24-1 (the float (the int f26-1))) - (f20-0 (ripple-slow-add-sine-waves s5-0 f22-1 f24-1)) + (if (not (-> s5-0 converted)) + (return f30-0) + ) + (let* ((f28-0 (- (-> arg2 x) (-> arg0 root trans x))) + (f26-0 (- (-> arg2 z) (-> arg0 root trans z))) + (f22-0 (+ (quaternion-y-angle (-> arg0 root quat)) (-> s4-0 angle))) + (f24-0 (cos f22-0)) + (f1-3 (sin f22-0)) + (f0-4 (- (* f28-0 f24-0) (* f26-0 f1-3))) + (f1-5 (+ (* f26-0 f24-0) (* f28-0 f1-3))) + (f2-3 (/ 1.0 (-> s4-0 grid-size))) + (f28-1 (* f2-3 (- f0-4 (-> s4-0 x-base)))) + (f26-1 (* f2-3 (- f1-5 (-> s4-0 z-base)))) + ) + (ripple-update-waveform-offs s5-0) + (let* ((f22-1 (the float (the int f28-1))) + (f24-1 (the float (the int f26-1))) + (f20-0 (ripple-slow-add-sine-waves s5-0 f22-1 f24-1)) + ) + (set! sv-16 (ripple-slow-add-sine-waves s5-0 (+ 1.0 f22-1) f24-1)) + (set! sv-32 (ripple-slow-add-sine-waves s5-0 f22-1 (+ 1.0 f24-1))) + (let* ((f1-6 (ripple-slow-add-sine-waves s5-0 (+ 1.0 f22-1) (+ 1.0 f24-1))) + (f0-22 (+ f20-0 (* (- f28-1 f22-1) (- sv-16 f20-0)))) + (f1-9 (+ sv-32 (* (- f28-1 f22-1) (- f1-6 sv-32)))) + (f1-12 (+ f0-22 (* (- f26-1 f24-1) (- f1-9 f0-22)))) + (f0-23 (-> gp-0 faded-scale)) + ) + (if (< f0-23 0.0) + (set! f0-23 (-> gp-0 global-scale)) + ) + (+ f30-0 (* 0.0078125 f1-12 f0-23)) ) - (set! sv-16 (ripple-slow-add-sine-waves s5-0 (+ 1.0 f22-1) f24-1)) - (set! sv-32 (ripple-slow-add-sine-waves s5-0 f22-1 (+ 1.0 f24-1))) - (let* - ((f1-6 (ripple-slow-add-sine-waves s5-0 (+ 1.0 f22-1) (+ 1.0 f24-1))) - (f0-22 (+ f20-0 (* (- f28-1 f22-1) (- sv-16 f20-0)))) - (f1-9 (+ sv-32 (* (- f28-1 f22-1) (- f1-6 sv-32)))) - (f1-12 (+ f0-22 (* (- f26-1 f24-1) (- f1-9 f0-22)))) - (f0-23 (-> gp-0 faded-scale)) - ) - (if (< f0-23 0.0) - (set! f0-23 (-> gp-0 global-scale)) + ) ) - (+ f30-0 (* (* 0.0078125 f1-12) f0-23)) - ) ) - ) ) - ) ) diff --git a/goal_src/jak1/engine/gfx/generic/generic-h.gc b/goal_src/jak1/engine/gfx/generic/generic-h.gc index 1e7a5c2316e..532ab305677 100644 --- a/goal_src/jak1/engine/gfx/generic/generic-h.gc +++ b/goal_src/jak1/engine/gfx/generic/generic-h.gc @@ -30,246 +30,208 @@ ;; gsf, what does it stand for? (deftype gsf-vertex (structure) - ((data uint32 8 :offset-assert 0) - (byte uint8 32 :offset 0) - (quad uint128 2 :offset 0) - (vt qword :inline :offset 0) - (pos vector3s :inline :offset 0) - (tex vector2uh :inline :offset 12) - (nrm vector3s :inline :offset 16) - (nc qword :inline :offset 16) - (clr vector4ub :inline :offset 28) - (dtex vector2uh :inline :offset 16) - (dclr vector4ub :inline :offset 20) + ((data uint32 8) + (byte uint8 32 :overlay-at (-> data 0)) + (quad uint128 2 :overlay-at (-> data 0)) + (vt qword :inline :overlay-at (-> data 0)) + (pos vector3s :inline :overlay-at (-> data 0)) + (tex vector2uh :inline :overlay-at (-> data 3)) + (nrm vector3s :inline :overlay-at (-> data 4)) + (nc qword :inline :overlay-at (-> data 4)) + (clr vector4ub :inline :overlay-at (-> data 7)) + (dtex vector2uh :inline :overlay-at (-> data 4)) + (dclr vector4ub :inline :overlay-at (-> data 5)) ) :pack-me - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) -;; dynamically sized array of gsf-verts + (deftype gsf-vertex-array (structure) - ((vtx gsf-vertex :dynamic :offset-assert 0) + ((vtx gsf-vertex :dynamic) ) - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) (deftype gsf-fx-vertex (structure) - ((clr vector4ub :inline :offset-assert 0) - (tex vector2uh :inline :offset-assert 4) + ((clr vector4ub :inline) + (tex vector2uh :inline) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype gsf-fx-vertex-array (structure) - ((data gsf-fx-vertex :dynamic :offset-assert 0) + ((data gsf-fx-vertex :dynamic) ) - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) + (deftype gsf-header (structure) - ((num-strips uint8 :offset-assert 0) - (expanded uint8 :offset-assert 1) - (num-dps uint16 :offset-assert 2) - (num-vtxs uint16 :offset-assert 4) - (strip-table uint8 10 :offset-assert 6) + ((num-strips uint8) + (expanded uint8) + (num-dps uint16) + (num-vtxs uint16) + (strip-table uint8 10) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype gsf-ik (structure) - ((index uint8 :offset-assert 0) - (no-kick uint8 :offset-assert 1) + ((index uint8) + (no-kick uint8) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) + (deftype gsf-info (structure) - ((ptr-iks uint32 :offset-assert 0) - (ptr-verts uint32 :offset-assert 4) - (ptr-fx uint32 :offset-assert 8) - (dummy2 uint32 :offset-assert 12) + ((ptr-iks uint32) + (ptr-verts uint32) + (ptr-fx uint32) + (dummy2 uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype gsf-buffer (structure) - ((data uint8 8192 :offset-assert 0) - (info gsf-info :inline :offset 0) - (header gsf-header :inline :offset 16) - (work-area uint8 :dynamic :offset 32) + ((data uint8 8192) + (info gsf-info :inline :overlay-at (-> data 0)) + (header gsf-header :inline :overlay-at (-> data 16)) + (work-area uint8 :dynamic :overlay-at (-> data 32)) ) - :method-count-assert 9 - :size-assert #x2000 - :flag-assert #x900002000 ) + (deftype generic-frag (structure) - ((start-pos uint16 :offset-assert 0) - (end-pos uint16 :offset-assert 2) + ((start-pos uint16) + (end-pos uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) + (deftype generic-strip (structure) - ((pos uint16 :offset-assert 0) - (len uint16 :offset-assert 2) + ((pos uint16) + (len uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) + (deftype generic-envmap-saves (structure) - ((index-mask vector4w :inline :offset-assert 0) - (verts uint128 12 :offset-assert 16) - (kicks uint128 4 :offset-assert 208) + ((index-mask vector4w :inline) + (verts uint128 12) + (kicks uint128 4) ) - :method-count-assert 9 - :size-assert #x110 - :flag-assert #x900000110 ) + (deftype generic-interp-job (structure) - ((job-type uint16 :offset-assert 0) - (num uint16 :offset-assert 2) - (first uint16 :offset-assert 4) - (pad uint16 :offset-assert 6) - (ptr-data uint32 :offset-assert 8) - (morph-z uint16 :offset-assert 12) - (morph-w uint16 :offset-assert 14) + ((job-type uint16) + (num uint16) + (first uint16) + (pad uint16) + (ptr-data uint32) + (morph-z uint16) + (morph-w uint16) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype generic-saves (structure) - ((ptr-dma uint32 :offset-assert 0) - (ptr-vtxs uint32 :offset-assert 4) - (ptr-clrs uint32 :offset-assert 8) - (ptr-texs uint32 :offset-assert 12) - (ptr-env-clrs uint32 :offset-assert 16) - (ptr-env-texs uint32 :offset-assert 20) - (cur-outbuf uint32 :offset-assert 24) - (ptr-fx-buf uint32 :offset-assert 28) - (xor-outbufs uint32 :offset-assert 32) - (num-dps uint32 :offset-assert 36) - (qwc uint32 :offset-assert 40) - (gsf-buf gsf-buffer :offset-assert 44) - (ptr-shaders uint32 :offset-assert 48) - (ptr-env-shader uint32 :offset-assert 52) - (is-envmap uint32 :offset-assert 56) - (basep uint32 :offset-assert 60) - (ptr-interp-job generic-interp-job :offset-assert 64) - (gifbuf-adr uint32 :offset-assert 68) - (inbuf-adr uint32 :offset-assert 72) - (fade-val uint32 :offset-assert 76) - (time-of-day-color rgba :offset-assert 80) - (to-vu0-waits uint32 :offset-assert 84) - (to-spr-waits uint32 :offset-assert 88) - (from-spr-waits uint32 :offset-assert 92) - (envmap generic-envmap-saves :inline :offset-assert 96) + ((ptr-dma uint32) + (ptr-vtxs uint32) + (ptr-clrs uint32) + (ptr-texs uint32) + (ptr-env-clrs uint32) + (ptr-env-texs uint32) + (cur-outbuf uint32) + (ptr-fx-buf uint32) + (xor-outbufs uint32) + (num-dps uint32) + (qwc uint32) + (gsf-buf gsf-buffer) + (ptr-shaders uint32) + (ptr-env-shader uint32) + (is-envmap uint32) + (basep uint32) + (ptr-interp-job generic-interp-job) + (gifbuf-adr uint32) + (inbuf-adr uint32) + (fade-val uint32) + (time-of-day-color rgba) + (to-vu0-waits uint32) + (to-spr-waits uint32) + (from-spr-waits uint32) + (envmap generic-envmap-saves :inline) ) - :method-count-assert 9 - :size-assert #x170 - :flag-assert #x900000170 ) + (deftype generic-gif-tag (structure) - ((data uint32 4 :offset-assert 0) - (qword qword :inline :offset 0) - (fan-prim uint32 :offset 0) - (str-prim uint32 :offset 4) - (regs uint32 :offset 8) - (num-strips uint32 :offset 12) + ((data uint32 4) + (qword qword :inline :overlay-at (-> data 0)) + (fan-prim uint32 :overlay-at (-> data 0)) + (str-prim uint32 :overlay-at (-> data 1)) + (regs uint32 :overlay-at (-> data 2)) + (num-strips uint32 :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype ad-cmd (structure) - ((word uint32 4 :offset-assert 0) - (quad uint128 :offset 0) - (data uint64 :offset 0) - (cmds uint64 :offset 8) - (cmd gs-reg :offset 8) - (x uint32 :offset 0) - (y uint32 :offset 4) - (z uint32 :offset 8) - (w uint32 :offset 12) + ((word uint32 4) + (quad uint128 :overlay-at (-> word 0)) + (data uint64 :overlay-at (-> word 0)) + (cmds uint64 :overlay-at (-> word 2)) + (cmd gs-reg :overlay-at (-> word 2)) + (x uint32 :overlay-at (-> word 0)) + (y uint32 :overlay-at (-> word 1)) + (z uint32 :overlay-at (-> word 2)) + (w uint32 :overlay-at (-> word 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype generic-envmap-consts (structure) - ((consts vector :inline :offset-assert 0) - (strgif generic-gif-tag :inline :offset-assert 16) - (colors vector4w :inline :offset-assert 32) - (shader adgif-shader :inline :offset-assert 48) + ((consts vector :inline) + (strgif generic-gif-tag :inline) + (colors vector4w :inline) + (shader adgif-shader :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) + (deftype generic-consts (structure) - ((dma-header dma-packet :inline :offset-assert 0) - (vif-header uint32 4 :offset-assert 16) - (dma-ref-vtxs dma-packet :inline :offset-assert 32) - (dma-cnt-call dma-packet :inline :offset-assert 48) - (matrix matrix :inline :offset-assert 64) - (base-strgif generic-gif-tag :inline :offset-assert 128) - (alpha-opaque ad-cmd :inline :offset-assert 144) - (alpha-translucent ad-cmd :inline :offset-assert 160) - (ztest-normal ad-cmd :inline :offset-assert 176) - (ztest-opaque ad-cmd :inline :offset-assert 192) - (adcmd-offsets uint8 16 :offset-assert 208) - (adcmds ad-cmd 4 :offset 144) - (stcycle-tag uint32 :offset-assert 224) - (unpack-vtx-tag uint32 :offset-assert 228) - (unpack-clr-tag uint32 :offset-assert 232) - (unpack-tex-tag uint32 :offset-assert 236) - (mscal-tag uint32 :offset-assert 240) - (flush-tag uint32 :offset-assert 244) - (reset-cycle-tag uint32 :offset-assert 248) - (dummy0 uint32 :offset-assert 252) - (dma-tag-cnt uint64 :offset-assert 256) - (envmap generic-envmap-consts :inline :offset-assert 272) - (light-consts vector :inline :offset-assert 400) - (texture-offset uint16 8 :offset-assert 416) + ((dma-header dma-packet :inline) + (vif-header uint32 4) + (dma-ref-vtxs dma-packet :inline) + (dma-cnt-call dma-packet :inline) + (matrix matrix :inline) + (base-strgif generic-gif-tag :inline) + (alpha-opaque ad-cmd :inline) + (alpha-translucent ad-cmd :inline) + (ztest-normal ad-cmd :inline) + (ztest-opaque ad-cmd :inline) + (adcmd-offsets uint8 16) + (adcmds ad-cmd 4 :overlay-at alpha-opaque) + (stcycle-tag uint32) + (unpack-vtx-tag uint32) + (unpack-clr-tag uint32) + (unpack-tex-tag uint32) + (mscal-tag uint32) + (flush-tag uint32) + (reset-cycle-tag uint32) + (dummy0 uint32) + (dma-tag-cnt uint64) + (envmap generic-envmap-consts :inline) + (light-consts vector :inline) + (texture-offset uint16 8) ) - :method-count-assert 9 - :size-assert #x1b0 - :flag-assert #x9000001b0 ) + (deftype generic-storage (structure) - ((data uint128 16 :offset-assert 0) + ((data uint128 16) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) -(define *gsf-buffer* (the gsf-buffer (kmalloc global #x2400 (kmalloc-flags align-64) "malloc"))) + +(define *gsf-buffer* (the-as gsf-buffer (kmalloc global 9216 (kmalloc-flags align-64) "malloc"))) diff --git a/goal_src/jak1/engine/gfx/generic/generic-merc.gc b/goal_src/jak1/engine/gfx/generic/generic-merc.gc index 31b3c35bbc9..a022f26cd03 100644 --- a/goal_src/jak1/engine/gfx/generic/generic-merc.gc +++ b/goal_src/jak1/engine/gfx/generic/generic-merc.gc @@ -10,23 +10,13 @@ (define mercneric-vu0-block (new 'static 'vu-function :length #x0 :origin #x0 :qlength #x0)) (deftype invinitdata (structure) - ((count uint8 :offset-assert 0) - (init-data uint8 :offset-assert 1) - (init-addr uint16 :offset-assert 2) + ((count uint8) + (init-data uint8) + (init-addr uint16) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) -(defmethod inspect invinitdata ((this invinitdata)) - (format #t "[~8x] ~A~%" this 'invinitdata) - (format #t "~Tcount: ~D~%" (-> this count)) - (format #t "~Tinit-data: ~D~%" (-> this init-data)) - (format #t "~Tinit-addr: ~D~%" (-> this init-addr)) - this - ) (define *inv-init-table* (new 'static 'inline-array invinitdata 8 (new 'static 'invinitdata :count #x48 :init-addr #x1) @@ -65,7 +55,6 @@ "Run the EE part of the generic renderer for all generic merc stuff. This will build DMA data in the format for generic." (local-vars (a0-26 int) (a0-28 int)) - ;; (format 0 "[GMERC] starting generic-merc-execute-all with ~d to execute~%" (-> *merc-global-array* count)) (when (nonzero? (-> *merc-global-array* count)) (let ((gp-0 (-> *display* frames (-> *display* on-screen) frame global-buf base))) @@ -116,7 +105,6 @@ (let* ((s1-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) (s2-0 (-> s1-0 base)) ) - ;; (format 0 "[GMERC] running ~D~%" s4-0) (generic-work-init s3-0) (set! (-> (scratchpad-object terrain-context) work foreground generic-work saves basep) (the-as uint (-> s1-0 base)) @@ -199,6 +187,5 @@ ) ) ) - ;; (format 0 "[GMERC] made it to the end of generic-merc-execute-all.~%") (none) ) diff --git a/goal_src/jak1/engine/gfx/generic/generic-vu1-h.gc b/goal_src/jak1/engine/gfx/generic/generic-vu1-h.gc index 3c208a8d254..e6643edb1f8 100644 --- a/goal_src/jak1/engine/gfx/generic/generic-vu1-h.gc +++ b/goal_src/jak1/engine/gfx/generic/generic-vu1-h.gc @@ -9,44 +9,35 @@ ;; "pris" refers to foreground drawing, with normals. (deftype pris-mtx (structure) - ((data float 32 :offset 0) - (vector vector 8 :inline :offset 0) - (t-mtx matrix :inline :offset 0) ;; transformation matrix (including perspective) - (n-mtx matrix3 :inline :offset 64) ;; rotation matrix for the normals - (scale vector :inline :offset 112) ;; not sure this is used... merc doesn't do it this way. + ((data float 32 :offset 0) + (vector vector 8 :inline :overlay-at (-> data 0)) + (t-mtx matrix :inline :overlay-at (-> data 0)) + (n-mtx matrix3 :inline :overlay-at (-> data 16)) + (scale vector :inline :overlay-at (-> vector 7)) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; ?? (deftype generic-pris-mtx-save (structure) - ((loc-mtx pris-mtx :inline :offset-assert 0) - (par-mtx pris-mtx :inline :offset-assert 128) - (dif-mtx pris-mtx :inline :offset-assert 256) + ((loc-mtx pris-mtx :inline) + (par-mtx pris-mtx :inline) + (dif-mtx pris-mtx :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;; VU1 constants for the generic renderer. (deftype generic-constants (structure) - ((fog vector :inline :offset-assert 0) - (adgif gs-gif-tag :inline :offset-assert 16) ;; was qword - (giftag gs-gif-tag :inline :offset-assert 32) ;; was qword - (hvdf-offset vector :inline :offset-assert 48) - (hmge-scale vector :inline :offset-assert 64) - (invh-scale vector :inline :offset-assert 80) - (guard vector :inline :offset-assert 96) - (adnop qword :inline :offset-assert 112) - (flush qword :inline :offset-assert 128) - (stores qword :inline :offset-assert 144) + ((fog vector :inline) + (adgif gs-gif-tag :inline) + (giftag gs-gif-tag :inline) + (hvdf-offset vector :inline) + (hmge-scale vector :inline) + (invh-scale vector :inline) + (guard vector :inline) + (adnop qword :inline) + (flush qword :inline) + (stores qword :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) (defun-extern generic-init-buf dma-buffer int gs-zbuf none) diff --git a/goal_src/jak1/engine/gfx/generic/generic-work-h.gc b/goal_src/jak1/engine/gfx/generic/generic-work-h.gc index dd009f28e38..b9154ad1378 100644 --- a/goal_src/jak1/engine/gfx/generic/generic-work-h.gc +++ b/goal_src/jak1/engine/gfx/generic/generic-work-h.gc @@ -10,93 +10,77 @@ ;; DECOMP BEGINS (deftype generic-input-buffer (structure) - ((merc generic-merc-work :inline :offset 0) - (tie generic-tie-work :inline :offset 0) - (data uint128 472 :offset 0) + ((merc generic-merc-work :inline :offset 0) + (tie generic-tie-work :inline :offset 0) + (data uint128 472 :offset 0) ) - :method-count-assert 9 - :size-assert #x1d80 - :flag-assert #x900001d80 ) + (deftype generic-debug (structure) - ((locks uint32 4 :offset-assert 0) - (timer uint32 32 :offset-assert 16) - (count uint32 32 :offset-assert 144) - (vps uint32 32 :offset-assert 272) - (buffer int32 :offset-assert 400) - (start-addr int32 :offset-assert 404) - (lock int32 :offset-assert 408) + ((locks uint32 4) + (timer uint32 32) + (count uint32 32) + (vps uint32 32) + (buffer int32) + (start-addr int32) + (lock int32) ) - :method-count-assert 9 - :size-assert #x19c - :flag-assert #x90000019c ) + (deftype generic-vu1-header (structure) - ((matrix matrix :inline :offset-assert 0) - (strgif generic-gif-tag :inline :offset-assert 64) - (adnop1 ad-cmd :inline :offset-assert 80) - (adnop2 ad-cmd :inline :offset-assert 96) - (adcmds ad-cmd 2 :inline :offset 80) - (dps uint16 :offset 92) - (kickoff uint16 :offset 108) - (strips uint16 :offset 76) + ((matrix matrix :inline) + (strgif generic-gif-tag :inline) + (adnop1 ad-cmd :inline) + (adnop2 ad-cmd :inline) + (adcmds ad-cmd 2 :inline :overlay-at adnop1) + (dps uint16 :overlay-at (-> adnop1 word 3)) + (kickoff uint16 :overlay-at (-> adnop2 word 3)) + (strips uint16 :overlay-at (-> strgif data 3)) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) + (deftype generic-vu1-texbuf (structure) - ((header generic-vu1-header :inline :offset-assert 0) - (shader uint32 :dynamic :offset-assert 112) + ((header generic-vu1-header :inline) + (shader uint32 :dynamic) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) + (deftype generic-texbuf (structure) - ((tag dma-packet :inline :offset-assert 0) - (header generic-vu1-header :inline :offset-assert 16) - (shader uint32 :dynamic :offset-assert 128) + ((tag dma-packet :inline) + (header generic-vu1-header :inline) + (shader uint32 :dynamic) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) + (deftype generic-effect-work (structure) - ((consts generic-consts :inline :offset-assert 0) - (storage generic-storage :inline :offset-assert 432) - (storage2 generic-storage :inline :offset-assert 688) - (lights vu-lights :inline :offset-assert 944) + ((consts generic-consts :inline) + (storage generic-storage :inline) + (storage2 generic-storage :inline) + (lights vu-lights :inline) ) - :method-count-assert 9 - :size-assert #x420 - :flag-assert #x900000420 ) + (deftype generic-effect-buffer (structure) - ((outbuf-0 uint8 3552 :offset-assert 0) - (work generic-effect-work :inline :offset-assert 3552) - (outbuf-1 uint8 3552 :offset-assert 4608) + ((outbuf-0 uint8 3552) + (work generic-effect-work :inline) + (outbuf-1 uint8 3552) ) - :method-count-assert 9 - :size-assert #x1fe0 - :flag-assert #x900001fe0 ) + (deftype generic-work (structure) - ((saves generic-saves :inline :offset-assert 0) - (storage generic-storage :inline :offset-assert 368) - (in-buf generic-input-buffer :inline :offset-assert 624) - (fx-buf generic-effect-buffer :inline :offset-assert 8176) + ((saves generic-saves :inline) + (storage generic-storage :inline) + (in-buf generic-input-buffer :inline) + (fx-buf generic-effect-buffer :inline) ) - :method-count-assert 9 - :size-assert #x3fd0 - :flag-assert #x900003fd0 ) -(define *generic-debug* (new 'global 'generic-debug)) \ No newline at end of file + +(define *generic-debug* (new 'global 'generic-debug)) diff --git a/goal_src/jak1/engine/gfx/hw/display-h.gc b/goal_src/jak1/engine/gfx/hw/display-h.gc index 6e5cace6b09..338e2a87e2d 100644 --- a/goal_src/jak1/engine/gfx/hw/display-h.gc +++ b/goal_src/jak1/engine/gfx/hw/display-h.gc @@ -18,16 +18,13 @@ ;; put-display-env, which is implemented in the kernel and is a wrapper ;; around a Sony function. (deftype display-env (structure) - ((pmode gs-pmode :offset-assert 0) - (smode2 gs-smode2 :offset-assert 8) - (dspfb gs-display-fb :offset-assert 16) - (display gs-display :offset-assert 24) - (bgcolor gs-bgcolor :offset-assert 32) + ((pmode gs-pmode) + (smode2 gs-smode2) + (dspfb gs-display-fb) + (display gs-display) + (bgcolor gs-bgcolor) ) :pack-me - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; draw-env stores the GS settings for drawing to somewhere in VRAM. @@ -35,26 +32,23 @@ ;; this is identical to the Sony sceGsDrawEnv1/2 structs ;; Internally, this is register + address GIF data. (deftype draw-env (structure) - ((frame1 gs-frame :offset-assert 0) - (frame1addr gs-reg64 :offset-assert 8) - (zbuf1 gs-zbuf :offset-assert 16) - (zbuf1addr gs-reg64 :offset-assert 24) - (xyoffset1 gs-xy-offset :offset-assert 32) - (xyoffset1addr gs-reg64 :offset-assert 40) - (scissor1 gs-scissor :offset-assert 48) - (scissor1addr gs-reg64 :offset-assert 56) - (prmodecont gs-prmode-cont :offset-assert 64) - (prmodecontaddr gs-reg64 :offset-assert 72) - (colclamp gs-color-clamp :offset-assert 80) - (colclampaddr gs-reg64 :offset-assert 88) - (dthe gs-dthe :offset-assert 96) - (dtheaddr gs-reg64 :offset-assert 104) - (test1 gs-test :offset-assert 112) - (test1addr gs-reg64 :offset-assert 120) + ((frame1 gs-frame) + (frame1addr gs-reg64) + (zbuf1 gs-zbuf) + (zbuf1addr gs-reg64) + (xyoffset1 gs-xy-offset) + (xyoffset1addr gs-reg64) + (scissor1 gs-scissor) + (scissor1addr gs-reg64) + (prmodecont gs-prmode-cont) + (prmodecontaddr gs-reg64) + (colclamp gs-color-clamp) + (colclampaddr gs-reg64) + (dthe gs-dthe) + (dtheaddr gs-reg64) + (test1 gs-test) + (test1addr gs-reg64) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) (defun put-draw-env ((packet (pointer gif-tag))) @@ -75,23 +69,21 @@ ;; Per frame data that is used by the renderers. (deftype display-frame (basic) - ((calc-buf dma-buffer :offset 8) - (vu1-buf dma-buffer :offset 8) - (debug-buf dma-buffer :offset 36) - (global-buf dma-buffer :offset 40) - (bucket-group (inline-array dma-bucket) :offset 44) - (buffer dma-buffer 11 :offset 4) - (profile-bar profile-bar 2 :offset 48) - (run-time int64 :offset 56) + ((calc-buf dma-buffer :offset 8) + (vu1-buf dma-buffer :overlay-at calc-buf) + (debug-buf dma-buffer :offset 36) + (global-buf dma-buffer :offset 40) + (bucket-group (inline-array dma-bucket) :offset 44) + (buffer dma-buffer 11 :offset 4) + (profile-bar profile-bar 2 :offset 48) + (run-time int64 :offset 56) ) (:methods - (new (symbol type) _type_ 0) - ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 + (new (symbol type) _type_) + ) ) + (defmethod new display-frame ((allocation symbol) (type-to-make type)) "Allocate a new display frame" (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) @@ -109,77 +101,70 @@ ;; unused? (deftype virtual-frame (structure) - ((display display-env :offset-assert 0) - (display-last display-env :offset-assert 4) - (gif pointer :offset-assert 8) - (draw draw-env :offset-assert 12) - (frame display-frame :offset-assert 16) + ((display display-env) + (display-last display-env) + (gif pointer) + (draw draw-env) + (frame display-frame) ) - :allow-misaligned - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; This tracks all of the display stuff in a single global (deftype display (basic) ;; first, 3x environments. Not sure why we need 3. - ((display-env0 display-env :inline :offset-assert 8) - (display-env1 display-env :inline :offset-assert 48) - (display-env2 display-env :inline :offset-assert 88) + ((display-env0 display-env :inline) + (display-env1 display-env :inline) + (display-env2 display-env :inline) ;; the gif-tag + draw is a gif-packet to setting the draw-env. ;; the draw-env is actually just a+d data. - (gif-tag0 gs-gif-tag :inline :offset-assert 128) - (draw0 draw-env :inline :offset-assert 144) - (gif-tag1 gs-gif-tag :inline :offset-assert 272) - (draw1 draw-env :inline :offset-assert 288) - (gif-tag2 gs-gif-tag :inline :offset-assert 416) - (draw2 draw-env :inline :offset-assert 432) + (gif-tag0 gs-gif-tag :inline) + (draw0 draw-env :inline) + (gif-tag1 gs-gif-tag :inline) + (draw1 draw-env :inline) + (gif-tag2 gs-gif-tag :inline) + (draw2 draw-env :inline) ;; frame indices - (on-screen int32 :offset-assert 560) - (last-screen int32 :offset-assert 564) + (on-screen int32) + (last-screen int32) ;; not sure why we have 6, it seems like only the first 2 actually ;; have valid display-frames in them. - (frames virtual-frame 6 :inline :offset-assert 568) - (bg-clear-color rgba 4 :offset-assert 760) - ;; counters (why are there so many???) - (real-frame-counter time-frame :offset-assert 776) - (base-frame-counter time-frame :offset-assert 784) - (game-frame-counter time-frame :offset-assert 792) - (integral-frame-counter time-frame :offset-assert 800) - (real-integral-frame-counter time-frame :offset-assert 808) - (actual-frame-counter time-frame :offset-assert 816) - (real-actual-frame-counter time-frame :offset-assert 824) - (part-frame-counter time-frame :offset-assert 832) + (frames virtual-frame 6 :inline) + (bg-clear-color rgba 4) + ;; counters + (real-frame-counter time-frame) + (base-frame-counter time-frame) + (game-frame-counter time-frame) + (integral-frame-counter time-frame) + (real-integral-frame-counter time-frame) + (actual-frame-counter time-frame) + (real-actual-frame-counter time-frame) + (part-frame-counter time-frame) ;; the "old" counters are the values from the previous tick. ;; the counters above may jump during a load. - (old-real-frame-counter time-frame :offset-assert 840) - (old-base-frame-counter time-frame :offset-assert 848) - (old-game-frame-counter time-frame :offset-assert 856) - (old-integral-frame-counter time-frame :offset-assert 864) - (old-real-integral-frame-counter time-frame :offset-assert 872) - (old-actual-frame-counter time-frame :offset-assert 880) - (old-real-actual-frame-counter time-frame :offset-assert 888) - (old-part-frame-counter time-frame :offset-assert 896) + (old-real-frame-counter time-frame) + (old-base-frame-counter time-frame) + (old-game-frame-counter time-frame) + (old-integral-frame-counter time-frame) + (old-real-integral-frame-counter time-frame) + (old-actual-frame-counter time-frame) + (old-real-actual-frame-counter time-frame) + (old-part-frame-counter time-frame) ;; timing stats for how fast the engine is currently running. - (time-ratio float :offset-assert 904) ;; engine speed, 1.0 = full speed - (seconds-per-frame float :offset-assert 908) ;; 1/fps - (frames-per-second float :offset-assert 912) ;; fps - (time-factor float :offset-assert 916) ;; 6 on PAL, 5 on NTSC, "ticks" / frame - (time-adjust-ratio float :offset-assert 920) ;; 1 on NTSC full speed, 1.2 PAL full speed. + (time-ratio float) ;; engine speed, 1.0 = full speed + (seconds-per-frame float) ;; 1/fps + (frames-per-second float) ;; fps + (time-factor float) ;; 6 on PAL, 5 on NTSC, "ticks" / frame + (time-adjust-ratio float) ;; 1 on NTSC full speed, 1.2 PAL full speed. ) - :method-count-assert 10 - :size-assert #x39c - :flag-assert #xa0000039c (:methods - (new (symbol type int int int int int) _type_ 0) - (set-time-ratios (_type_ float) float 9) - ) + (new (symbol type int int int int int) _type_) + (set-time-ratios (_type_ float) float) + ) ) (define-extern *display* display) @@ -203,12 +188,12 @@ (set! (-> this frames 3 display-last) (-> this display-env2)) (set! (-> this frames 4 display-last) (-> this display-env0)) (set! (-> this frames 5 display-last) (-> this display-env1)) - (set! (-> this frames 0 gif) (&-> this gif-tag0 qword)) - (set! (-> this frames 1 gif) (&-> this gif-tag1 qword)) - (set! (-> this frames 2 gif) (&-> this gif-tag2 qword)) - (set! (-> this frames 3 gif) (&-> this gif-tag0 qword)) - (set! (-> this frames 4 gif) (&-> this gif-tag1 qword)) - (set! (-> this frames 5 gif) (&-> this gif-tag2 qword)) + (set! (-> this frames 0 gif) (the-as pointer (-> this gif-tag0))) + (set! (-> this frames 1 gif) (the-as pointer (-> this gif-tag1))) + (set! (-> this frames 2 gif) (the-as pointer (-> this gif-tag2))) + (set! (-> this frames 3 gif) (the-as pointer (-> this gif-tag0))) + (set! (-> this frames 4 gif) (the-as pointer (-> this gif-tag1))) + (set! (-> this frames 5 gif) (the-as pointer (-> this gif-tag2))) (set! (-> this frames 0 draw) (-> this draw0)) (set! (-> this frames 1 draw) (-> this draw1)) (set! (-> this frames 2 draw) (-> this draw2)) @@ -224,10 +209,10 @@ ;; do this again. just in case. (default-buffer-init *default-regs-buffer*) ;; set the default gray color. - (set! (-> this bg-clear-color 0) (static-rgba #x80 #x80 #x80 #x80)) - (set! (-> this bg-clear-color 1) (static-rgba #x80 #x80 #x80 #x80)) - (set! (-> this bg-clear-color 2) (static-rgba #x80 #x80 #x80 #x80)) - (set! (-> this bg-clear-color 3) (static-rgba #x80 #x80 #x80 #x80)) + (set! (-> this bg-clear-color 0) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + (set! (-> this bg-clear-color 1) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + (set! (-> this bg-clear-color 2) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + (set! (-> this bg-clear-color 3) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) this ) ) @@ -271,3 +256,4 @@ (defmacro get-screen-y (frac) `(the int (* ,frac 224))) +(define *post-draw-hook* (the-as (function dma-buffer none) nothing)) diff --git a/goal_src/jak1/engine/gfx/hw/display.gc b/goal_src/jak1/engine/gfx/hw/display.gc index a869585ace1..36ed4cfdb7b 100644 --- a/goal_src/jak1/engine/gfx/hw/display.gc +++ b/goal_src/jak1/engine/gfx/hw/display.gc @@ -33,8 +33,7 @@ (-> *display* integral-frame-counter) ) - -(defmethod set-time-ratios display ((this display) (slowdown float)) +(defmethod set-time-ratios ((this display) (slowdown float)) "Set the time ratios for the current game speed. For example, set slowdown = 1.0 if the game is running at full speed or slowdown = 2.0 if the game is running at half speed." @@ -96,25 +95,20 @@ ;; these will eventually be consumed by a sony function. I think it just sets GS registers. ;; set these to the mode that makes the GS actually work. Basically every game uses exactly this. - (set! (-> env pmode) - (new 'static 'gs-pmode :en1 #x1 :mmod #x1 :slbg #x1 :alp #xff) - ) + (set! (-> env pmode) (new 'static 'gs-pmode :en1 #x1 :mmod #x1 :slbg #x1 :alp #xff)) (set! (-> env smode2) (new 'static 'gs-smode2 :int #x1 :ffmd #x1)) ;; set up the framebuffer. - (set! (-> env dspfb) - (new 'static 'gs-display-fb :psm psm :fbw (sar width 6) :fbp fbp) - ) + (set! (-> env dspfb) (new 'static 'gs-display-fb :psm psm :fbw (/ width 64) :fbp fbp)) ;; set up the display area (obscure PS2 video output junk) - (set! (-> env display) - (new 'static 'gs-display - :dw #x9ff - :dy (+ dy 50) - :dx (+ (* dx (/ 2560 width)) 652) - :dh (+ (shl height 1) -1) - :magh (+ (/ (+ width 2559) width) -1) - ) + (set! (-> env display) (new 'static 'gs-display + :dw #x9ff + :dy (+ dy 50) + :dx (+ (* dx (/ 2560 width)) 652) + :dh (+ (* height 2) -1) + :magh (+ (/ (+ width 2559) width) -1) + ) ) ;; I think bgcolor = 0 is required. @@ -129,31 +123,24 @@ ;; frame buffer: (set! (-> env frame1addr) (gs-reg64 frame-1)) - (set! (-> env frame1) - (new 'static 'gs-frame :fbw (sar width 6) :psm (logand psm 15) :fbp fbp) - ) + (set! (-> env frame1) (new 'static 'gs-frame :fbw (/ width 64) :psm (logand psm 15) :fbp fbp)) ;; dithering is enabled/disabled based on the texture format. ;; it's not allowed in psmct32 and psmct24 so I assume it's always off. (set! (-> env dtheaddr) (gs-reg64 dthe)) (cond - ((zero? (logand psm 2)) + ((not (logtest? psm 2)) (set! (-> env dthe) (new 'static 'gs-dthe)) + 0 ) (else - (set! (-> env dthe) (new 'static 'gs-dthe :dthe #x1)) - ) + (set! (-> env dthe) (new 'static 'gs-dthe :dthe #x1)) + ) ) ;; z buffer: (set! (-> env zbuf1addr) (gs-reg64 zbuf-1)) - (set! (-> env zbuf1) - (new 'static 'gs-zbuf - :zbp #x1c0 - :psm (logand zpsm 15) - :zmsk (if (zero? ztest) 1 0) - ) - ) + (set! (-> env zbuf1) (new 'static 'gs-zbuf :zbp #x1c0 :psm (logand zpsm 15) :zmsk (if (zero? ztest) 1 0))) ;; pixel test. you only get to pick the ztst field. (set! (-> env test1addr) (gs-reg64 test-1)) @@ -162,8 +149,8 @@ (set! (-> env test1) (new 'static 'gs-test)) ) (else - (set! (-> env test1) (new 'static 'gs-test :zte #x1 :ztst ztest)) - ) + (set! (-> env test1) (new 'static 'gs-test :zte #x1 :ztst ztest)) + ) ) ;; offset to window coordinate system (WCS) @@ -178,9 +165,7 @@ ;; scissor to the given width/height (in WCS pixels) (set! (-> env scissor1addr) (gs-reg64 scissor-1)) ;; the lower bound is set to 0: the origin of the WCS which is the xyoffset - (set! (-> env scissor1) - (new 'static 'gs-scissor :scax1 (+ width -1) :scay1 (+ height -1)) - ) + (set! (-> env scissor1) (new 'static 'gs-scissor :scax1 (+ width -1) :scay1 (+ height -1))) ;; use the prim register for primitive settings, not prmode. (set! (-> env prmodecontaddr) (gs-reg64 prmodecont)) @@ -201,16 +186,9 @@ " (set! (-> env xyoffset1) (new 'static 'gs-xy-offset - :ofx (shl (- x - (shr (+ (-> env scissor1 scax1) 1) 1) ;; half the width. - ) - 4) ;; 12.4 - :ofy (+ (shl (- y - (shr (+ (-> env scissor1 scay1) 1) 1)) ;; half the height. - 4) ;; convert to 12.4 - (if (zero? arg3) 0 8) ;; and add a half-pixel offset. - ) - ) + :ofx (* (- x (the-as int (shr (+ (-> env scissor1 scax1) 1) 1))) 16) + :ofy (+ (* (- y (the-as int (shr (+ (-> env scissor1 scay1) 1) 1))) 16) (if (zero? arg3) 0 8)) + ) ) env ) @@ -319,35 +297,35 @@ ;; PROFILE BAR ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod add-frame profile-bar ((this profile-bar) (name symbol) (color rgba)) +(defmethod add-frame ((this profile-bar) (name symbol) (color rgba)) "Add a block to the profile bar. Looks at the timer to determine the current time." - (if *debug-segment* - (let ((new-frame (-> this data (-> this profile-frame-count)))) - (set! (-> this profile-frame-count) (+ (-> this profile-frame-count) 1)) - (set! (-> new-frame name) name) - (set! (-> new-frame time-stamp) (timer-count (the-as timer-bank #x10000800))) - (set! (-> new-frame color) color) - new-frame - ) + (when *debug-segment* + (let ((new-frame (-> this data (-> this profile-frame-count)))) + (+! (-> this profile-frame-count) 1) + (set! (-> new-frame name) name) + (set! (-> new-frame time-stamp) (timer-count (the-as timer-bank #x10000800))) + (set! (-> new-frame color) color) + new-frame ) + ) ) -(defmethod reset profile-bar ((this profile-bar)) +(defmethod reset ((this profile-bar)) "Clear all blocks from the profile bar. Adds the start block" (set! (-> this profile-frame-count) 0) (add-frame this 'start (new 'static 'rgba :r #x40 :b #x40 :a #x80)) this ) -(defmethod add-end-frame profile-bar ((this profile-bar) (name symbol) (color rgba)) +(defmethod add-end-frame ((this profile-bar) (name symbol) (color rgba)) "Finish the frame." (let ((new-frame (-> this data (-> this profile-frame-count)))) - (set! (-> this profile-frame-count) (+ (-> this profile-frame-count) 1)) - (set! (-> new-frame name) name) - (set! (-> new-frame time-stamp) (the-as uint *ticks-per-frame*)) - (set! (-> new-frame color) color) - new-frame - ) + (+! (-> this profile-frame-count) 1) + (set! (-> new-frame name) name) + (set! (-> new-frame time-stamp) (the-as uint *ticks-per-frame*)) + (set! (-> new-frame color) color) + new-frame + ) ) ;; location and size @@ -359,7 +337,7 @@ ;; ticks or percent? (define *profile-ticks* #f) -(defmethod draw profile-bar ((this profile-bar) (buf dma-buffer) (bar-pos int)) +(defmethod draw ((this profile-bar) (buf dma-buffer) (bar-pos int)) "Draw the bar! The bar pos shouldn't be changed." ;; recompute y stuff based on the current relative-y-scale. @@ -542,13 +520,13 @@ (defun screen-gradient ((arg0 dma-buffer) (arg1 rgba) (arg2 rgba) (arg3 rgba) (arg4 rgba)) "Fill the screen with a sprite with the given colors." - (let ((a1-2 (new 'stack 'draw-context 0 0 512 224 (the-as rgba 0)))) - (set! (-> a1-2 color 0) arg1) - (set! (-> a1-2 color 1) arg2) - (set! (-> a1-2 color 2) arg3) - (set! (-> a1-2 color 3) arg4) - (draw-quad2d arg0 a1-2) - ) + (let ((a1-2 (new 'stack 'draw-context 0 0 512 224 (new 'static 'rgba)))) + (set! (-> a1-2 color 0) arg1) + (set! (-> a1-2 color 1) arg2) + (set! (-> a1-2 color 2) arg3) + (set! (-> a1-2 color 3) arg4) + (draw-quad2d arg0 a1-2) + ) (none) ) diff --git a/goal_src/jak1/engine/gfx/hw/gs.gc b/goal_src/jak1/engine/gfx/hw/gs.gc index 5d072fad86e..972ebbaf6f8 100644 --- a/goal_src/jak1/engine/gfx/hw/gs.gc +++ b/goal_src/jak1/engine/gfx/hw/gs.gc @@ -9,28 +9,47 @@ ;; These are used when creating GS packets to be sent to the GIF ;; or for directly interfacing with the memory-mapped GS control registers. +(defconstant GIF_REGS_ALL_AD + (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) + ) + ;; DECOMP BEGINS ;; the GS's PMODE register makes various settings for the PCRTC. (deftype gs-pmode (uint64) - ((en1 uint8 :offset 0 :size 1) - (en2 uint8 :offset 1 :size 1) - (crtmd uint8 :offset 2 :size 3) - (mmod uint8 :offset 5 :size 1) - (amod uint8 :offset 6 :size 1) - (slbg uint8 :offset 7 :size 1) - (alp uint8 :offset 8 :size 8) + ((en1 uint8 :offset 0 :size 1) + (en2 uint8 :offset 1 :size 1) + (crtmd uint8 :offset 2 :size 3) + (mmod uint8 :offset 5 :size 1) + (amod uint8 :offset 6 :size 1) + (slbg uint8 :offset 7 :size 1) + (alp uint8 :offset 8 :size 8) ) - :flag-assert #x900000008 ) ;; the GS's SMODE2 register makes settings related to PCRTC video synchronization. (deftype gs-smode2 (uint64) - ((int uint8 :offset 0 :size 1) - (ffmd uint8 :offset 1 :size 1) - (dpms uint8 :offset 2 :size 2) + ((int uint8 :offset 0 :size 1) + (ffmd uint8 :offset 1 :size 1) + (dpms uint8 :offset 2 :size 2) ) - :flag-assert #x900000008 ) ;; texture formats @@ -55,47 +74,37 @@ (defun psm-size ((arg0 gs-psm)) "Convert texture format to some type of size." (cond - ((= arg0 (gs-psm mt8)) - 64 - ) - ((= arg0 (gs-psm mt4)) - 32 - ) - ((or - (= arg0 (gs-psm ct16)) - (= arg0 (gs-psm ct16s)) - (= arg0 (gs-psm mz16)) - (= arg0 (gs-psm mz16s)) + ((= arg0 (gs-psm mt8)) + 64 ) - 128 - ) - (else - 256 + ((= arg0 (gs-psm mt4)) + 32 + ) + ((or (= arg0 (gs-psm ct16)) (= arg0 (gs-psm ct16s)) (= arg0 (gs-psm mz16)) (= arg0 (gs-psm mz16s))) + 128 + ) + (else + 256 + ) ) - ) ) (defun psm-page-height ((arg0 gs-psm)) "Convert texture format to some type of page height" (cond - ((= arg0 (gs-psm mt8)) - 64 - ) - ((= arg0 (gs-psm mt4)) - 128 - ) - ((or - (= arg0 (gs-psm ct16)) - (= arg0 (gs-psm ct16s)) - (= arg0 (gs-psm mz16)) - (= arg0 (gs-psm mz16s)) + ((= arg0 (gs-psm mt8)) + 64 ) - 64 - ) - (else - 32 + ((= arg0 (gs-psm mt4)) + 128 + ) + ((or (= arg0 (gs-psm ct16)) (= arg0 (gs-psm ct16s)) (= arg0 (gs-psm mz16)) (= arg0 (gs-psm mz16s))) + 64 + ) + (else + 32 + ) ) - ) ) (defun psm->string ((arg0 gs-psm)) @@ -171,37 +180,34 @@ ;; Rectangular Area Read Output Circuit n for the PCRTC. ;; write-only (deftype gs-display-fb (uint64) - ((fbp uint16 :offset 0 :size 9) - (fbw uint8 :offset 9 :size 6) - (psm gs-psm :offset 15 :size 5) - (dbx uint16 :offset 32 :size 11) - (dby uint16 :offset 43 :size 11) + ((fbp uint16 :offset 0 :size 9) + (fbw uint8 :offset 9 :size 6) + (psm gs-psm :offset 15 :size 5) + (dbx uint16 :offset 32 :size 11) + (dby uint16 :offset 43 :size 11) ) - :flag-assert #x900000008 ) ;; the GS's DISPLAY registers make settings for the display position on the screen regarding ;; information on Rectangular Area Read Output Circuit n for the PCRTC. ;; write-only (deftype gs-display (uint64) - ((dx uint16 :offset 0 :size 12) - (dy uint16 :offset 12 :size 11) - (magh uint8 :offset 23 :size 4) - (magv uint8 :offset 27 :size 2) - (dw uint16 :offset 32 :size 12) - (dh uint16 :offset 44 :size 11) + ((dx uint16 :offset 0 :size 12) + (dy uint16 :offset 12 :size 11) + (magh uint8 :offset 23 :size 4) + (magv uint8 :offset 27 :size 2) + (dw uint16 :offset 32 :size 12) + (dh uint16 :offset 44 :size 11) ) - :flag-assert #x900000008 ) ;; the GS's BGCOLOR register sets the background color of the PCRTC with RGB value. ;; write-only (deftype gs-bgcolor (uint64) - ((r uint8 :offset 0) - (g uint8 :offset 8) - (b uint8 :offset 16) + ((r uint8 :offset 0 :size 8) + (g uint8 :offset 8 :size 8) + (b uint8 :offset 16 :size 8) ) - :flag-assert #x900000008 ) ;; the GS's CSR register sets and obtains various GS statuses. @@ -209,97 +215,95 @@ ;; or written to. ;; bits 5 and 6 (0x20 and 0x40) should be zero (deftype gs-csr (uint64) - ((signal uint8 :offset 0 :size 1) - (finish uint8 :offset 1 :size 1) - (hsint uint8 :offset 2 :size 1) - (vsint uint8 :offset 3 :size 1) - (edwint uint8 :offset 4 :size 1) - (flush uint8 :offset 8 :size 1) - (reset uint8 :offset 9 :size 1) - (nfield uint8 :offset 12 :size 1) - (field uint8 :offset 13 :size 1) - (fifo uint8 :offset 14 :size 2) - (rev uint8 :offset 16 :size 8) - (id uint8 :offset 24 :size 8) - ) - :flag-assert #x900000008 + ((signal uint8 :offset 0 :size 1) + (finish uint8 :offset 1 :size 1) + (hsint uint8 :offset 2 :size 1) + (vsint uint8 :offset 3 :size 1) + (edwint uint8 :offset 4 :size 1) + (flush uint8 :offset 8 :size 1) + (reset uint8 :offset 9 :size 1) + (nfield uint8 :offset 12 :size 1) + (field uint8 :offset 13 :size 1) + (fifo uint8 :offset 14 :size 2) + (rev uint8 :offset 16 :size 8) + (id uint8 :offset 24 :size 8) + ) ) ;; memory layout of the GS's privileged registers (mapped to EE memory) ;; it is missing the SIGLBLID/LABELID register at 4224 (useless anyway?) (deftype gs-bank (structure) - ((pmode gs-pmode :offset-assert 0) - (smode2 gs-smode2 :offset 32) - (dspfb1 gs-display-fb :offset 112) - (display1 gs-display :offset 128) - (dspfb2 gs-display-fb :offset 144) - (display2 gs-display :offset 160) - (extbuf uint64 :offset 176) - (extdata uint64 :offset 192) - (extwrite uint64 :offset 208) - (bgcolor gs-bgcolor :offset 224) - (csr gs-csr :offset 4096) - (imr uint64 :offset 4112) - (busdir uint64 :offset 4160) + ((pmode gs-pmode) + (smode2 gs-smode2 :offset 32) + (dspfb1 gs-display-fb :offset 112) + (display1 gs-display :offset 128) + (dspfb2 gs-display-fb :offset 144) + (display2 gs-display :offset 160) + (extbuf uint64 :offset 176) + (extdata uint64 :offset 192) + (extwrite uint64 :offset 208) + (bgcolor gs-bgcolor :offset 224) + (csr gs-csr :offset 4096) + (imr uint64 :offset 4112) + (busdir uint64 :offset 4160) ) - :method-count-assert 9 - :size-assert #x1048 - :flag-assert #x900001048 ) + ;; the GS's FRAME registers store various settings related to the frame buffer. (deftype gs-frame (uint64) - ((fbp uint16 :offset 0 :size 9) - (fbw uint8 :offset 16 :size 6) - (psm gs-psm :offset 24 :size 6) - (fbmsk uint32 :offset 32 :size 32) + ((fbp uint16 :offset 0 :size 9) + (fbw uint8 :offset 16 :size 6) + (psm gs-psm :offset 24 :size 6) + (fbmsk uint32 :offset 32 :size 32) ) - :flag-assert #x900000008 ) ;; the GS's ZBUF registers make various settings regarding Z buffer. (deftype gs-zbuf (uint64) - ((zbp uint16 :offset 0 :size 9) - (psm gs-psm :offset 24 :size 4) - (zmsk uint8 :offset 32 :size 1) + ((zbp uint16 :offset 0 :size 9) + (psm gs-psm :offset 24 :size 4) + (zmsk uint8 :offset 32 :size 1) ) - :flag-assert #x900000008 ) + ;; the GS's XYOFFSET registers set the offset value for converting from the primitive coordinate ;; system to the window coordinate system. (deftype gs-xy-offset (uint64) - ((ofx uint16 :offset 0 :size 16) - (ofy uint16 :offset 32 :size 16) + ((ofx uint16 :offset 0 :size 16) + (ofy uint16 :offset 32 :size 16) ) - :flag-assert #x900000008 ) + ;; the GS's SCISSOR registers specify the scissoring area. The coordinate values for ;; the upper-left/lower-right points of the enabled drawing area are specified by the window ;; coordinate system. (deftype gs-scissor (uint64) - ((scax0 uint16 :offset 0 :size 11) - (scax1 uint16 :offset 16 :size 11) - (scay0 uint16 :offset 32 :size 11) - (scay1 uint16 :offset 48 :size 11) + ((scax0 uint16 :offset 0 :size 11) + (scax1 uint16 :offset 16 :size 11) + (scay0 uint16 :offset 32 :size 11) + (scay1 uint16 :offset 48 :size 11) ) - :flag-assert #x900000008 ) + ;; the GS's PRMODECONT register sets whether to use primitive attributes (IIP, TME, FGE, ABE, ;; AA1, FST, CTXT, FIX) specified by the PRMODE register or the PRIM register. (deftype gs-prmode-cont (uint64) - ((ac uint8 :offset 0 :size 1)) - :flag-assert #x900000008 + ((ac uint8 :offset 0 :size 1) + ) ) + ;; the GS's COLCLAMP register stores settings as to whether clamping for the RGB value of the ;; pixel is performed. (deftype gs-color-clamp (uint64) - ((clamp uint8 :offset 0 :size 1)) - :flag-assert #x900000008 + ((clamp uint8 :offset 0 :size 1) + ) ) + ;; the GS's DTHE register stores settings for dithering (performed/not performed). (deftype gs-dthe (uint64) - ((dthe uint8 :offset 0 :size 1)) - :flag-assert #x900000008 + ((dthe uint8 :offset 0 :size 1) + ) ) (defenum gs-atest @@ -322,16 +326,15 @@ ) ;; the GS's TEST register performs settings related to the pixel test. (deftype gs-test (uint64) - ((ate uint8 :offset 0 :size 1) ;; alpha test enable - (atst gs-atest :offset 1 :size 3) ;; alpha test method - (aref uint8 :offset 4 :size 8) ;; alpha val reference - (afail uint8 :offset 12 :size 2) ;; processing method on alpha test fail - (date uint8 :offset 14 :size 1) ;; dest alpha test enable - (datm uint8 :offset 15 :size 1) ;; dest alpha test mode - (zte uint8 :offset 16 :size 1) ;; depth test enable - (ztst gs-ztest :offset 17 :size 2) ;; depth test method + ((ate uint8 :offset 0 :size 1) + (atst gs-atest :offset 1 :size 3) + (aref uint8 :offset 4 :size 8) + (afail uint8 :offset 12 :size 2) + (date uint8 :offset 14 :size 1) + (datm uint8 :offset 15 :size 1) + (zte uint8 :offset 16 :size 1) + (ztst gs-ztest :offset 17 :size 2) ) - :flag-assert #x900000008 ) (defenum gs-prim-type @@ -347,171 +350,172 @@ ;; the GS's PRIM register specifies the types of drawing primitives and various attributes, and ;; initializes the contents of the vertex queue. (deftype gs-prim (uint64) - ((prim gs-prim-type :offset 0 :size 3) - (iip uint8 :offset 3 :size 1) - (tme uint8 :offset 4 :size 1) - (fge uint8 :offset 5 :size 1) - (abe uint8 :offset 6 :size 1) - (aa1 uint8 :offset 7 :size 1) - (fst uint8 :offset 8 :size 1) - (ctxt uint8 :offset 9 :size 1) - (fix uint8 :offset 10 :size 1) - ) - :flag-assert #x900000008 + ((prim gs-prim-type :offset 0 :size 3) + (iip uint8 :offset 3 :size 1) + (tme uint8 :offset 4 :size 1) + (fge uint8 :offset 5 :size 1) + (abe uint8 :offset 6 :size 1) + (aa1 uint8 :offset 7 :size 1) + (fst uint8 :offset 8 :size 1) + (ctxt uint8 :offset 9 :size 1) + (fix uint8 :offset 10 :size 1) + ) ) + ;; the GS's RGBAQ register sets the RGBA value of the vertex and the Q value of the normalized ;; texture coordinates. (deftype gs-rgbaq (uint64) - ((r uint8 :offset 0 :size 8) - (g uint8 :offset 8 :size 8) - (b uint8 :offset 16 :size 8) - (a uint8 :offset 24 :size 8) ;; 0x80 --> 1.0 - (q float :offset 32 :size 32) ;; affects some LOD behavior apparently? + ((r uint8 :offset 0 :size 8) + (g uint8 :offset 8 :size 8) + (b uint8 :offset 16 :size 8) + (a uint8 :offset 24 :size 8) + (q float :offset 32 :size 32) ) - :flag-assert #x900000008 ) + ;; GS XYZ registers (deftype gs-xyz (uint64) - ((x uint16 :offset 0 :size 16) ;; Q4 fixed point - (y uint16 :offset 16 :size 16) ;; Q4 fixed point - (z uint32 :offset 32 :size 32) + ((x uint16 :offset 0 :size 16) + (y uint16 :offset 16 :size 16) + (z uint32 :offset 32 :size 32) ) - :flag-assert #x900000008 ) + ;; the GS's UV register specifies the texel coordinate (UV) values of the vertex. (deftype gs-uv (uint64) - ((u uint16 :offset 0 :size 14) ;; Q4 fixed point - (v uint16 :offset 16 :size 14) ;; Q4 fixed point + ((u uint16 :offset 0 :size 14) + (v uint16 :offset 16 :size 14) ) - :flag-assert #x900000008 ) + ;; the GS's ST register sets the S and T values of the vertex texture coordinates. ;; The value Q is specified by the RGBAQ register. (deftype gs-st (uint64) - ((s float :offset 0 :size 32) - (t float :offset 32 :size 32) + ((s float :offset 0 :size 32) + (t float :offset 32 :size 32) ) - :flag-assert #x900000008 ) + ;; GS XYZF registers (deftype gs-xyzf (uint64) - ((x uint16 :offset 0 :size 16) ;; Q4 fixed point - (y uint16 :offset 16 :size 16) ;; Q4 fixed point - (z uint32 :offset 32 :size 24) - (f uint8 :offset 56 :size 8) ;; fog coeff + ((x uint16 :offset 0 :size 16) + (y uint16 :offset 16 :size 16) + (z uint32 :offset 32 :size 24) + (f uint8 :offset 56 :size 8) ) - :flag-assert #x900000008 ) + ;; the GS's TRXPOS register specifies the position and scanning direction of the rectangular area ;; in each buffer where buffer transmission is performed. (deftype gs-trxpos (uint64) - ((ssax uint16 :offset 0 :size 11) - (ssay uint16 :offset 16 :size 11) - (dsax uint16 :offset 32 :size 11) - (dsay uint16 :offset 48 :size 11) - (dir uint8 :offset 59 :size 2) + ((ssax uint16 :offset 0 :size 11) + (ssay uint16 :offset 16 :size 11) + (dsax uint16 :offset 32 :size 11) + (dsay uint16 :offset 48 :size 11) + (dir uint8 :offset 59 :size 2) ) - :flag-assert #x900000008 ) + ;; the GS's TRXREG register specifies the size of the rectangular area, where the transmission ;; between buffers is implemented, in units of pixels. ;; The pixel mode must be the one set by the BITBLTBUF register. (deftype gs-trxreg (uint64) - ((rrw uint16 :offset 0 :size 12) - (rrh uint16 :offset 32 :size 12) + ((rrw uint16 :offset 0 :size 12) + (rrh uint16 :offset 32 :size 12) ) - :flag-assert #x900000008 ) + ;; the GS's TRXDIR register specifies the transmission direction in the transmission between ;; buffers, and activates transmission. ;; Appropriate settings must be made by the BITBLTBUF/TRXPOS/TRXREG before activating ;; the transmission. (deftype gs-trxdir (uint64) - ((xdir uint8 :offset 0 :size 2)) - :flag-assert #x900000008 + ((xdir uint8 :offset 0 :size 2) + ) ) + ;; the GS's BITBLTBUF register stores buffer-related settings for transmission source and ;; destination during transmission between buffers. (deftype gs-bitbltbuf (uint64) - ((sbp uint16 :offset 0 :size 14) - (sbw uint8 :offset 16 :size 6) - (spsm uint8 :offset 24 :size 6) - (dbp uint16 :offset 32 :size 14) - (dbw uint8 :offset 48 :size 6) - (dpsm uint8 :offset 56 :size 6) + ((sbp uint16 :offset 0 :size 14) + (sbw uint8 :offset 16 :size 6) + (spsm uint8 :offset 24 :size 6) + (dbp uint16 :offset 32 :size 14) + (dbw uint8 :offset 48 :size 6) + (dpsm uint8 :offset 56 :size 6) ) - :flag-assert #x900000008 ) + ;; the GS's TEX0 registers set various kinds of information regarding the textures to be used. (deftype gs-tex0 (uint64) - ((tbp0 uint16 :offset 0 :size 14) - (tbw uint8 :offset 14 :size 6) - (psm uint8 :offset 20 :size 6) - (tw uint8 :offset 26 :size 4) - (th uint8 :offset 30 :size 4) - (tcc uint8 :offset 34 :size 1) - (tfx uint8 :offset 35 :size 2) - (cbp uint16 :offset 37 :size 14) - (cpsm uint8 :offset 51 :size 4) - (csm uint8 :offset 55 :size 1) - (csa uint8 :offset 56 :size 5) - (cld uint8 :offset 61 :size 3) - ) - :flag-assert #x900000008 + ((tbp0 uint16 :offset 0 :size 14) + (tbw uint8 :offset 14 :size 6) + (psm uint8 :offset 20 :size 6) + (tw uint8 :offset 26 :size 4) + (th uint8 :offset 30 :size 4) + (tcc uint8 :offset 34 :size 1) + (tfx uint8 :offset 35 :size 2) + (cbp uint16 :offset 37 :size 14) + (cpsm uint8 :offset 51 :size 4) + (csm uint8 :offset 55 :size 1) + (csa uint8 :offset 56 :size 5) + (cld uint8 :offset 61 :size 3) + ) ) + ;; the GS's TEX1 registers set information on the sampling method of the textures. (deftype gs-tex1 (uint64) - ((lcm uint8 :offset 0 :size 1) - (mxl uint8 :offset 2 :size 3) - (mmag uint8 :offset 5 :size 1) - (mmin uint8 :offset 6 :size 3) - (mtba uint8 :offset 9 :size 1) - (l uint8 :offset 19 :size 2) - (k int16 :offset 32 :size 12) + ((lcm uint8 :offset 0 :size 1) + (mxl uint8 :offset 2 :size 3) + (mmag uint8 :offset 5 :size 1) + (mmin uint8 :offset 6 :size 3) + (mtba uint8 :offset 9 :size 1) + (l uint8 :offset 19 :size 2) + (k int16 :offset 32 :size 12) ) - :flag-assert #x900000008 ) + ;; the GS's TEXA register sets the Alpha value to be referred to when the Alpha value of the ;; texture is not an 8-bit value. (deftype gs-texa (uint64) - ((ta0 uint8 :offset 0 :size 8) - (aem uint8 :offset 15 :size 1) - (ta1 uint8 :offset 32 :size 8) + ((ta0 uint8 :offset 0 :size 8) + (aem uint8 :offset 15 :size 1) + (ta1 uint8 :offset 32 :size 8) ) - :flag-assert #x900000008 ) + ;; the GS's TEXCLUT register specifies the CLUT position in the buffer when the CLUT storage mode ;; is CSM=1 (CSM2 mode). (deftype gs-texclut (uint64) - ((cbw uint8 :offset 0 :size 6) - (cou uint8 :offset 6 :size 6) - (cov uint16 :offset 12 :size 10) + ((cbw uint8 :offset 0 :size 6) + (cou uint8 :offset 6 :size 6) + (cov uint16 :offset 12 :size 10) ) - :flag-assert #x900000008 ) + ;; the GS's MIPTBP registers set the buffer pointer and buffer width of textures when performing ;; MIPMAP. ;; MIPTBP1 sets levels 1 to 3, MIPTBP2 sets levels 4 to 6. (deftype gs-miptbp (uint64) - ((tbp1 uint16 :offset 0 :size 14) - (tbw1 uint8 :offset 14 :size 6) - (tbp2 uint16 :offset 20 :size 14) - (tbw2 uint8 :offset 34 :size 6) - (tbp3 uint16 :offset 40 :size 14) - (tbw3 uint8 :offset 54 :size 6) + ((tbp1 uint16 :offset 0 :size 14) + (tbw1 uint8 :offset 14 :size 6) + (tbp2 uint16 :offset 20 :size 14) + (tbw2 uint8 :offset 34 :size 6) + (tbp3 uint16 :offset 40 :size 14) + (tbw3 uint8 :offset 54 :size 6) ) - :flag-assert #x900000008 ) + ;; the GS's ALPHA registers define the blend function of alpha blending (deftype gs-alpha (uint64) - ((a uint8 :offset 0 :size 2) - (b uint8 :offset 2 :size 2) - (c uint8 :offset 4 :size 2) - (d uint8 :offset 6 :size 2) - (fix uint8 :offset 32 :size 8) + ((a uint8 :offset 0 :size 2) + (b uint8 :offset 2 :size 2) + (c uint8 :offset 4 :size 2) + (d uint8 :offset 6 :size 2) + (fix uint8 :offset 32 :size 8) ) - :flag-assert #x900000008 ) + ;; the GS's CLAMP registers set the texture's wrap mode (repeating or clamping) for both S and T. (defenum gs-tex-wrap-mode :type uint8 @@ -521,97 +525,96 @@ (region-repeat 3) ) + (deftype gs-clamp (uint64) - ((wms gs-tex-wrap-mode :offset 0 :size 2) - (wmt gs-tex-wrap-mode :offset 2 :size 2) - (minu uint16 :offset 4 :size 10) - (maxu uint16 :offset 14 :size 10) - (minv uint16 :offset 24 :size 10) - (maxv uint16 :offset 34 :size 10) + ((wms gs-tex-wrap-mode :offset 0 :size 2) + (wmt gs-tex-wrap-mode :offset 2 :size 2) + (minu uint16 :offset 4 :size 10) + (maxu uint16 :offset 14 :size 10) + (minv uint16 :offset 24 :size 10) + (maxv uint16 :offset 34 :size 10) ) - :flag-assert #x900000008 ) (deftype gs-fog (uint64) - ((f uint8 :offset 56 :size 8)) - :flag-assert #x900000008 + ((f uint8 :offset 56 :size 8) + ) ) + (deftype gs-fogcol (uint64) - ((fcr uint8 :offset 0 :size 8) - (fcg uint8 :offset 8 :size 8) - (fcb uint8 :offset 16 :size 8) + ((fcr uint8 :offset 0 :size 8) + (fcg uint8 :offset 8 :size 8) + (fcb uint8 :offset 16 :size 8) ) - :flag-assert #x900000008 ) + (deftype gif-ctrl (uint32) - ((rst uint8 :offset 0 :size 1) - (pse uint8 :offset 3 :size 1) + ((rst uint8 :offset 0 :size 1) + (pse uint8 :offset 3 :size 1) ) - :flag-assert #x900000004 ) + (deftype gif-mode (uint32) - ((m3r uint8 :offset 0 :size 1) - (imt uint8 :offset 2 :size 1) + ((m3r uint8 :offset 0 :size 1) + (imt uint8 :offset 2 :size 1) ) - :flag-assert #x900000004 ) + (deftype gif-stat (uint32) - ((m3r uint8 :offset 0 :size 1) - (m3p uint8 :offset 1 :size 1) - (imt uint8 :offset 2 :size 1) - (pse uint8 :offset 3 :size 1) - (ip3 uint8 :offset 5 :size 1) - (p3q uint8 :offset 6 :size 1) - (p2q uint8 :offset 7 :size 1) - (p1q uint8 :offset 8 :size 1) - (oph uint8 :offset 9 :size 1) - (apath uint8 :offset 10 :size 2) - (dir uint8 :offset 12 :size 1) - (fqc uint8 :offset 24 :size 5) + ((m3r uint8 :offset 0 :size 1) + (m3p uint8 :offset 1 :size 1) + (imt uint8 :offset 2 :size 1) + (pse uint8 :offset 3 :size 1) + (ip3 uint8 :offset 5 :size 1) + (p3q uint8 :offset 6 :size 1) + (p2q uint8 :offset 7 :size 1) + (p1q uint8 :offset 8 :size 1) + (oph uint8 :offset 9 :size 1) + (apath uint8 :offset 10 :size 2) + (dir uint8 :offset 12 :size 1) + (fqc uint8 :offset 24 :size 5) ) - :flag-assert #x900000004 ) + (deftype gif-cnt (uint32) - ((loopcnt uint16 :offset 0 :size 15) - (regcnt uint8 :offset 16 :size 4) - (vuaddr uint16 :offset 20 :size 10) + ((loopcnt uint16 :offset 0 :size 15) + (regcnt uint8 :offset 16 :size 4) + (vuaddr uint16 :offset 20 :size 10) ) - :flag-assert #x900000004 ) + (deftype gif-p3cnt (uint32) - ((p3cnt uint16 :offset 0 :size 15)) - :flag-assert #x900000004 + ((p3cnt uint16 :offset 0 :size 15) + ) ) + (deftype gif-p3tag (uint32) - ((loopcnt uint16 :offset 0 :size 15) - (eop uint8 :offset 15 :size 1) + ((loopcnt uint16 :offset 0 :size 15) + (eop uint8 :offset 15 :size 1) ) - :flag-assert #x900000004 ) (deftype gif-bank (structure) - ((ctrl gif-ctrl :offset 0) - (mode gif-mode :offset 16) - (stat gif-stat :offset 32) - (tag0 uint32 :offset 64) - (tag1 uint32 :offset 80) - (tag2 uint32 :offset 96) - (tag3 uint32 :offset 112) - (cnt gif-cnt :offset 128) - (p3cnt gif-p3cnt :offset 144) - (p3tag gif-p3tag :offset 160) + ((ctrl gif-ctrl :offset 0) + (mode gif-mode :offset 16) + (stat gif-stat :offset 32) + (tag0 uint32 :offset 64) + (tag1 uint32 :offset 80) + (tag2 uint32 :offset 96) + (tag3 uint32 :offset 112) + (cnt gif-cnt :offset 128) + (p3cnt gif-p3cnt :offset 144) + (p3tag gif-p3tag :offset 160) ) - :method-count-assert 9 - :size-assert #xa4 - :flag-assert #x9000000a4 ) + (deftype gif-tag-prim (uint32) () - :flag-assert #x900000004 ) + (deftype gif-tag-count (uint32) () :flag-assert #x900000004 @@ -645,14 +648,14 @@ ) (deftype gif-tag64 (uint64) - ((nloop uint16 :offset 0 :size 15) - (eop uint8 :offset 15 :size 1) - (id uint16 :offset 32 :size 14) - (pre uint8 :offset 46 :size 1) - (prim gs-prim :offset 47 :size 11) - (flg gif-flag :offset 58 :size 2) - (nreg uint8 :offset 60 :size 4)) - :flag-assert #x900000008 + ((nloop uint16 :offset 0 :size 15) + (eop uint8 :offset 15 :size 1) + (id uint16 :offset 32 :size 14) + (pre uint8 :offset 46 :size 1) + (prim gs-prim :offset 47 :size 11) + (flg gif-flag :offset 58 :size 2) + (nreg uint8 :offset 60 :size 4) + ) ) (deftype gif-tag (uint128) @@ -845,24 +848,20 @@ ;; now you have a reglist gs packet. (deftype gif-packet (basic) - ((reg-count int32 :offset-assert 4) - (gif-tag gs-gif-tag :inline :offset-assert 16) - (gif-tag0 uint128 :offset 16) - (args uint64 1 :offset-assert 32) ;; there's one here already. + ((reg-count int32) + (gif-tag gs-gif-tag :inline) + (gif-tag0 uint128 :overlay-at (-> gif-tag qword)) + (args uint64 1) ) (:methods - (new (symbol type int) _type_ 0) - ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 + (new (symbol type int) _type_) + ) ) + (defmethod new gif-packet ((allocation symbol) (type-to-make type) (arg0 int)) "Make a new gif packet with enough room for arg0 64-bit args" - (object-new allocation type-to-make - (the-as int (+ (-> type-to-make size) (shl (+ arg0 -1) 3))) - ) + (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (+ arg0 -1) 8)))) ) (defun open-gif-packet ((arg0 gif-packet)) @@ -876,55 +875,36 @@ "Add a register to the packet" (let ((tag (-> packet gif-tag))) ;; shift the register index into the right slot - (logior! - (-> tag regs) - (the-as uint (ash reg-idx (* (-> packet reg-count) 4))) - ) + (logior! (-> tag regs) (ash reg-idx (* (-> packet reg-count) 4))) ) ;; set register value and increment count. (set! (-> packet args (-> packet reg-count)) (the-as uint reg-val)) - (set! (-> packet reg-count) (+ (-> packet reg-count) 1)) + (+! (-> packet reg-count) 1) (none) ) -(defun close-gif-packet ((arg0 gif-packet) (eop int)) - "Finish adding registers." +(defun close-gif-packet ((arg0 gif-packet) (arg1 int)) (set! (-> arg0 gif-tag tag) - (new 'static 'gif-tag64 - :nloop #x1 - :flg (gif-flag reg-list) - :eop eop - :nreg (-> arg0 reg-count) - ) + (new 'static 'gif-tag64 :nloop #x1 :flg (gif-flag reg-list) :eop arg1 :nreg (-> arg0 reg-count)) ) arg0 ) - (deftype draw-context (basic) - ((orgx int32 :offset-assert 4) - (orgy int32 :offset-assert 8) - (orgz int32 :offset-assert 12) - (width int32 :offset-assert 16) - (height int32 :offset-assert 20) - (color rgba 4 :offset-assert 24) + ((orgx int32) + (orgy int32) + (orgz int32) + (width int32) + (height int32) + (color rgba 4) ) (:methods - (new (symbol type int int int int rgba) _type_ 0) - ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 - ) - -(defmethod new draw-context ((allocation symbol) - (type-to-make type) - (org-x int) - (org-y int) - (width int) - (height int) - (color-0 rgba) - ) + (new (symbol type int int int int rgba) _type_) + ) + ) + + +(defmethod new draw-context ((allocation symbol) (type-to-make type) (org-x int) (org-y int) (width int) (height int) (color-0 rgba)) "Allocate and initialize a draw-context" (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (let ((v1-3 (the int (* (the float org-y) (-> *video-parms* relative-y-scale)))) @@ -941,11 +921,11 @@ ) ) -(defun draw-context-set-xy ((arg0 draw-context) (x int) (y int)) +(defun draw-context-set-xy ((ctxt draw-context) (x int) (y int)) "Set the origin of the draw context, scaling by relative-y-scale as needed." - (local-vars (v0-0 int)) - (set! v0-0 (the int (* (the float y) (-> *video-parms* relative-y-scale)))) - (set! (-> arg0 orgx) x) - (set! (-> arg0 orgy) v0-0) + (let ((v0-0 (the int (* (the float y) (-> *video-parms* relative-y-scale))))) + (set! (-> ctxt orgx) x) + (set! (-> ctxt orgy) v0-0) + ) (none) ) diff --git a/goal_src/jak1/engine/gfx/hw/video-h.gc b/goal_src/jak1/engine/gfx/hw/video-h.gc index 249b0f11e6d..3d2cc525f5f 100644 --- a/goal_src/jak1/engine/gfx/hw/video-h.gc +++ b/goal_src/jak1/engine/gfx/hw/video-h.gc @@ -15,26 +15,23 @@ ;; DECOMP BEGINS (deftype video-parms (structure) - ((set-video-mode basic :offset-assert 0) - (reset-video-mode basic :offset-assert 4) - (screen-sy int32 :offset-assert 8) ;; height of framebuffer (1/2 of output resolution) - (screen-hy int32 :offset-assert 12) ;; half of fb height (1/4 of output resolution) - (screen-miny int32 :offset-assert 16) ;; min y in WCS (pixels), centered around 2048 (1/2) - (screen-maxy int32 :offset-assert 20) ;; max y in WCS (pixels) - (screen-masky int32 :offset-assert 24) ;; mask of bits that actually change in height (sy -1) - (display-dx int32 :offset-assert 28) ;; offset for displaying framebuffer - (display-dy int32 :offset-assert 32) - (screen-pages-high int32 :offset-assert 36) ;; GS pages - (_pad int64) - (relative-x-scale float :offset-assert 48) ;; x scale for 4x3 / 16x9 - (relative-y-scale float :offset-assert 52) ;; y scale for NTSC/PAL - (_pad2 int64) - (relative-x-scale-reciprical float :offset-assert 64) ;; reciprocal of the above scales - (relative-y-scale-reciprical float :offset-assert 68) + ((set-video-mode basic) + (reset-video-mode basic) + (screen-sy int32) + (screen-hy int32) + (screen-miny int32) + (screen-maxy int32) + (screen-masky int32) + (display-dx int32) + (display-dy int32) + (screen-pages-high int32) + (_pad int64) + (relative-x-scale float) + (relative-y-scale float) + (_pad2 int64) + (relative-x-scale-reciprical float) + (relative-y-scale-reciprical float) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) ;; default to NTSC diff --git a/goal_src/jak1/engine/gfx/lights-h.gc b/goal_src/jak1/engine/gfx/lights-h.gc index 0f8bb03a0df..ea6a7c9e5bd 100644 --- a/goal_src/jak1/engine/gfx/lights-h.gc +++ b/goal_src/jak1/engine/gfx/lights-h.gc @@ -15,114 +15,77 @@ ;; Note that the data is transposed to be faster for use in the VU code. ;; the w components are unused for lighting information - you can put whatever you want in them... (deftype vu-lights (structure) - ((direction vector 3 :inline :offset-assert 0) - (color vector 3 :inline :offset-assert 48) - (ambient vector :inline :offset-assert 96) + ((direction vector 3 :inline) + (color vector 3 :inline) + (ambient vector :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; a single directional light. (deftype light (structure) - ((direction vector :inline :offset-assert 0) - (color rgbaf :inline :offset-assert 16) - (levels vector :inline :offset-assert 32) - (level float :offset 32) - (sort-level float :offset 36) + ((direction vector :inline) + (color rgbaf :inline) + (levels vector :inline) + (level float :overlay-at (-> levels x)) + (sort-level float :overlay-at (-> levels y)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; unused? (deftype light-ellipse (structure) - ((matrix matrix :inline :offset-assert 0) - (color rgbaf :inline :offset-assert 64) - (name basic :offset 12) - (decay-start float :offset 28) - (ambient-point-ratio float :offset 44) - (level float :offset 60) - (func-symbol basic :offset 76) - (func basic :offset 76) + ((matrix matrix :inline) + (color rgbaf :inline) + (name basic :overlay-at (-> matrix data 3)) + (decay-start float :overlay-at (-> matrix data 7)) + (ambient-point-ratio float :overlay-at (-> matrix data 11)) + (level float :overlay-at (-> matrix data 15)) + (func-symbol basic :overlay-at (-> color a)) + (func basic :overlay-at (-> color a)) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; This likely doesn't work correctly in both GOAL and OpenGOAL ;; unused? (deftype light-array (array) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; unused? (deftype light-volume (basic) - ((light-array light-array :offset-assert 4) + ((light-array light-array) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; unused? (deftype light-volume-sphere (light-volume) - ((bsphere sphere :inline :offset-assert 16) + ((bsphere sphere :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; unused? (deftype light-volume-planes (light-volume) - ((planes vertical-planes :offset-assert 8) + ((planes vertical-planes) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; unused? (deftype light-volume-array (array) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) -(defmethod print light ((this light)) - "Print a directional light." - (format #t "# this levels data 0) - (-> this direction data 0) - (-> this direction data 1) - (-> this direction data 2) - ) - (format #t "~F ~F ~F @ #x~X>" - (-> this color data 0) - (-> this color data 1) - (-> this color data 2) - this - ) + +(defmethod print ((this light)) + (format #t "# this levels x) (-> this direction x) (-> this direction y) (-> this direction z)) + (format #t "~F ~F ~F @ #x~X>" (-> this color x) (-> this color y) (-> this color z) this) this ) ;; the primary light type, used before conversion to vu-lights. (deftype light-group (structure) - ((dir0 light :inline :offset-assert 0) - (dir1 light :inline :offset-assert 48) - (dir2 light :inline :offset-assert 96) - (ambi light :inline :offset-assert 144) - (lights light 4 :inline :offset 0) + ((dir0 light :inline) + (dir1 light :inline) + (dir2 light :inline) + (ambi light :inline) + (lights light 4 :inline :overlay-at dir0) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) diff --git a/goal_src/jak1/engine/gfx/math-camera-h.gc b/goal_src/jak1/engine/gfx/math-camera-h.gc index 78b75904e71..a8c59ce41ff 100644 --- a/goal_src/jak1/engine/gfx/math-camera-h.gc +++ b/goal_src/jak1/engine/gfx/math-camera-h.gc @@ -16,103 +16,93 @@ ;; DECOMP BEGINS (deftype vis-gif-tag (structure) - ((fog0 uint32 :offset-assert 0) - (strip uint32 :offset-assert 4) - (regs uint32 :offset-assert 8) - (fan uint32 :offset-assert 12) + ((fog0 uint32) + (strip uint32) + (regs uint32) + (fan uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype cull-info (structure) - ((x-fact float :offset-assert 0) - (y-fact float :offset-assert 4) - (z-fact float :offset-assert 8) - (cam-radius float :offset-assert 12) - (cam-x float :offset-assert 16) - (cam-y float :offset-assert 20) - (xz-dir-ax float :offset-assert 24) - (xz-dir-az float :offset-assert 28) - (xz-dir-bx float :offset-assert 32) - (xz-dir-bz float :offset-assert 36) - (xz-cross-ab float :offset-assert 40) - (yz-dir-ay float :offset-assert 44) - (yz-dir-az float :offset-assert 48) - (yz-dir-by float :offset-assert 52) - (yz-dir-bz float :offset-assert 56) - (yz-cross-ab float :offset-assert 60) + ((x-fact float) + (y-fact float) + (z-fact float) + (cam-radius float) + (cam-x float) + (cam-y float) + (xz-dir-ax float) + (xz-dir-az float) + (xz-dir-bx float) + (xz-dir-bz float) + (xz-cross-ab float) + (yz-dir-ay float) + (yz-dir-az float) + (yz-dir-by float) + (yz-dir-bz float) + (yz-cross-ab float) ) :pack-me - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) -(deftype math-camera (basic) - ((d meters :offset-assert 4) ;; camera near plane - (f meters :offset-assert 8) ;; camera far plane - (fov degrees :offset-assert 12) ;; field of view angle - ;; view frustum - (x-ratio float :offset-assert 16) - (y-ratio float :offset-assert 20) - (x-pix float :offset-assert 24) - (x-clip float :offset-assert 28) - (x-clip-ratio-in float :offset-assert 32) - (x-clip-ratio-over float :offset-assert 36) - (y-pix float :offset-assert 40) - (y-clip float :offset-assert 44) - (y-clip-ratio-in float :offset-assert 48) - (y-clip-ratio-over float :offset-assert 52) - (cull-info cull-info :inline :offset-assert 56) - (fog-start meters :offset-assert 120) - (fog-end meters :offset-assert 124) - (fog-max float :offset-assert 128) - (fog-min float :offset-assert 132) - (reset int32 :offset-assert 136) - (smooth-step float :offset-assert 140) - (smooth-t float :offset-assert 144) - (perspective matrix :inline :offset-assert 160) - (isometric matrix :inline :offset-assert 224) - (sprite-2d matrix :inline :offset-assert 288) - (sprite-2d-hvdf vector :inline :offset-assert 352) - (camera-rot matrix :inline :offset-assert 368) - (inv-camera-rot matrix :inline :offset-assert 432) - (inv-camera-rot-smooth matrix :inline :offset-assert 496) - (inv-camera-rot-smooth-from quaternion :inline :offset-assert 560) +(deftype math-camera (basic) + ((d meters) + (f meters) + (fov degrees) + (x-ratio float) + (y-ratio float) + (x-pix float) + (x-clip float) + (x-clip-ratio-in float) + (x-clip-ratio-over float) + (y-pix float) + (y-clip float) + (y-clip-ratio-in float) + (y-clip-ratio-over float) + (cull-info cull-info :inline) + (fog-start meters) + (fog-end meters) + (fog-max float) + (fog-min float) + (reset int32) + (smooth-step float) + (smooth-t float) + (perspective matrix :inline) + (isometric matrix :inline) + (sprite-2d matrix :inline) + (sprite-2d-hvdf vector :inline) + (camera-rot matrix :inline) + (inv-camera-rot matrix :inline) + (inv-camera-rot-smooth matrix :inline) + (inv-camera-rot-smooth-from quaternion :inline) ;; this camera-temp is the main matrix used for renderers. ;; the camera code will set this. ;; it's designed so the renderers can do a single matrix-vector multiply ;; and then get fog, clipping, and final vertex position from the result. - (camera-temp matrix :inline :offset-assert 576) - (prev-camera-temp matrix :inline :offset-assert 640) - (hmge-scale vector :inline :offset-assert 704) - (inv-hmge-scale vector :inline :offset-assert 720) - (hvdf-off vector :inline :offset-assert 736) - (guard vector :inline :offset-assert 752) - (vis-gifs vis-gif-tag 4 :inline :offset-assert 768) - (vis-gifs-quads uint128 4 :offset 768) ;; added - (giftex vis-gif-tag :offset 768) - (gifgr vis-gif-tag :offset 784) - (giftex-trans vis-gif-tag :offset 800) - (gifgr-trans vis-gif-tag :offset 816) - (pfog0 float :offset-assert 832) - (pfog1 float :offset-assert 836) - (trans vector :inline :offset-assert 848) - (plane plane 4 :inline :offset-assert 864) - (guard-plane plane 4 :inline :offset-assert 928) - (shrub-mat matrix :inline :offset-assert 992) - (fov-correction-factor float :offset-assert 1056) + (camera-temp matrix :inline) + (prev-camera-temp matrix :inline) + (hmge-scale vector :inline) + (inv-hmge-scale vector :inline) + (hvdf-off vector :inline) + (guard vector :inline) + (vis-gifs vis-gif-tag 4 :inline) + (vis-gifs-quads uint128 4 :overlay-at vis-gifs) + (giftex vis-gif-tag :overlay-at (-> vis-gifs 0)) + (gifgr vis-gif-tag :overlay-at (-> vis-gifs 1)) + (giftex-trans vis-gif-tag :overlay-at (-> vis-gifs 2)) + (gifgr-trans vis-gif-tag :overlay-at (-> vis-gifs 3)) + (pfog0 float) + (pfog1 float) + (trans vector :inline) + (plane plane 4 :inline) + (guard-plane plane 4 :inline) + (shrub-mat matrix :inline) + (fov-correction-factor float) ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) - :method-count-assert 9 - :size-assert #x424 - :flag-assert #x900000424 ) diff --git a/goal_src/jak1/engine/gfx/math-camera.gc b/goal_src/jak1/engine/gfx/math-camera.gc index 3d0df43ed54..96b4e7d04e0 100644 --- a/goal_src/jak1/engine/gfx/math-camera.gc +++ b/goal_src/jak1/engine/gfx/math-camera.gc @@ -36,14 +36,12 @@ ;; The fog-corrector stores a fog-end fog-start value that is corrected for the field of view. ;; the actual correction factor is computed in cam-update.gc (deftype fog-corrector (structure) - ((fog-end float :offset-assert 0) - (fog-start float :offset-assert 4) + ((fog-end float) + (fog-start float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (defun fog-corrector-setup ((corrector fog-corrector) (math-cam math-camera)) "Set the fog corrector based on the supplied math-camera" (set! (-> corrector fog-end) (* (-> math-cam fog-end) (-> math-cam fov-correction-factor))) @@ -95,11 +93,13 @@ (y-rat (-> math-cam y-ratio)) (cull-info (-> math-cam cull-info)) ) - (let ((unused-x-thing (/ (+ 1.0 (* 4.0 x-rat x-rat)) (+ 1.0 (* x-rat x-rat)))))) - (let ((y-thing (/ (+ 1.0 (* (* 4.0 y-rat) y-rat)) (+ 1.0 (* y-rat y-rat))))) + (let ((x-thing (/ (+ 1.0 (* 4.0 x-rat x-rat)) (+ 1.0 (* x-rat x-rat)))) + (y-thing (/ (+ 1.0 (* 4.0 y-rat y-rat)) (+ 1.0 (* y-rat y-rat))))) (set! (-> cull-info x-fact) (/ (+ 1.0 (* 4.0 x-rat x-rat)) (* x-rat (sqrtf (+ 1.0 (* 16.0 x-rat x-rat)))))) (set! (-> cull-info y-fact) (/ (+ 1.0 (* 4.0 y-rat y-rat)) (* y-rat (sqrtf (+ 1.0 (* 16.0 y-rat y-rat)))))) - (set! (-> cull-info z-fact) (sqrtf (+ (* (+ -4.0 y-thing) (+ -4.0 y-thing) y-rat y-rat) (* (+ -1.0 y-thing) (+ -1.0 y-thing))))) + (set! (-> cull-info z-fact) + (sqrtf (+ (* (+ -4.0 y-thing) (+ -4.0 y-thing) y-rat y-rat) (* (+ -1.0 y-thing) (+ -1.0 y-thing)))) + ) ) ;; radius of sphere containing camera origin and intersection of near plane and frustum @@ -125,10 +125,7 @@ (set! (-> cull-info xz-dir-bx) (* dx-rat-times-4 inverse-x-len-2)) (set! (-> cull-info xz-dir-bz) (* d-temp-3 inverse-x-len-2)) ) - (set! - (-> cull-info xz-cross-ab) - (- (* dx-rat-2 d-temp-3) (* d-temp-2 dx-rat-times-4)) - ) + (set! (-> cull-info xz-cross-ab) (- (* dx-rat-2 d-temp-3) (* d-temp-2 dx-rat-times-4))) ) (let* ((dy-rat (* (-> math-cam d) (-> math-cam y-ratio))) @@ -144,10 +141,7 @@ (set! (-> cull-info yz-dir-by) (* dy-rat-times-4 inverse-y-len-2)) (set! (-> cull-info yz-dir-bz) (* d-temp-5 inverse-y-len-2)) ) - (set! - (-> cull-info yz-cross-ab) - (- (* dy-rat d-temp-5) (* d-temp-4 dy-rat-times-4)) - ) + (set! (-> cull-info yz-cross-ab) (- (* dy-rat d-temp-5) (* d-temp-4 dy-rat-times-4))) ) ) @@ -197,17 +191,12 @@ ;; hvdf = horizontal, vertical, depth, fog offsets to be applied after transform. (let ((hvdf-x 2048.0) (hvdf-y 2048.0) - (hvdf-w - (/ (- (* (-> *math-camera-fog-correction* fog-end) (-> math-cam fog-max)) - (* (-> *math-camera-fog-correction* fog-start) - (-> math-cam fog-min) - ) - ) - (- (-> *math-camera-fog-correction* fog-end) - (-> *math-camera-fog-correction* fog-start) - ) - ) - ) + (hvdf-w (/ (- (* (-> *math-camera-fog-correction* fog-end) (-> math-cam fog-max)) + (* (-> *math-camera-fog-correction* fog-start) (-> math-cam fog-min)) + ) + (- (-> *math-camera-fog-correction* fog-end) (-> *math-camera-fog-correction* fog-start)) + ) + ) ) (let ((hvdf-z (* 0.5 (+ max-depth min-depth)))) (set! (-> math-cam hmge-scale x) (/ 1.0 (-> math-cam x-clip))) @@ -275,40 +264,37 @@ ;; sets up some giftags, but they are totally wrong. ;; they use 32-bit variables to store 64-bit parts of the tag. - (let ((v1-17 0))) - (let ((v1-20 (make-u128 0 (shl #x301ec000 32))))) - (let ((v1-23 (make-u128 0 (shl #x303ec000 32))))) + 0 + (make-u128 0 (shl #x301ec000 32)) + (make-u128 0 (shl #x303ec000 32)) (let ((pfog (-> math-cam pfog0))) - (let ((vis-gif-0 (-> math-cam vis-gifs))) - (set! (-> vis-gif-0 0 fog0) (the-as uint pfog)) - (set! (-> vis-gif-0 0 strip) (the-as uint #x301e4000)) - (set! (-> vis-gif-0 0 regs) (the-as uint 1042)) - (set! (-> vis-gif-0 0 fan) (the-as uint #x301ec000)) - ) - (let ((vis-gif-1 (&-> math-cam gifgr))) - (set! (-> vis-gif-1 0) (the-as vis-gif-tag pfog)) - (set! - (-> vis-gif-1 1) - (the-as vis-gif-tag (make-u128 0 (shl #x20164000 32))) - ) - (set! (-> vis-gif-1 2) (the-as vis-gif-tag 65)) - (set! (-> vis-gif-1 3) (the-as vis-gif-tag #x301ec000)) - ) - (let ((vis-gif-1-again (-> math-cam vis-gifs))) - (set! (-> vis-gif-1-again 0 fog0) (the-as uint pfog)) - (set! (-> vis-gif-1-again 0 strip) (the-as uint #x303e4000)) - (set! (-> vis-gif-1-again 0 regs) (the-as uint 1042)) - (set! (-> vis-gif-1-again 0 fan) (the-as uint #x303ec000)) - ) - (let ((vis-gif-1-again-again (-> math-cam vis-gifs))) - (set! (-> vis-gif-1-again-again 0 fog0) (the-as uint pfog)) - (set! (-> vis-gif-1-again-again 0 strip) (the-as uint #x303e4000)) - (set! (-> vis-gif-1-again-again 0 regs) (the-as uint 1042)) - (set! (-> vis-gif-1-again-again 0 fan) (the-as uint #x303ec000)) + (let ((vis-gif-0 (-> math-cam vis-gifs))) + (set! (-> vis-gif-0 0 fog0) (the-as uint pfog)) + (set! (-> vis-gif-0 0 strip) (the-as uint #x301e4000)) + (set! (-> vis-gif-0 0 regs) (the-as uint 1042)) + (set! (-> vis-gif-0 0 fan) (the-as uint #x301ec000)) + ) + (let ((vis-gif-1 (&-> math-cam gifgr))) + (set! (-> vis-gif-1 0) (the-as vis-gif-tag pfog)) + (set! (-> vis-gif-1 1) (the-as vis-gif-tag (make-u128 0 (shl #x20164000 32)))) + (set! (-> vis-gif-1 2) (the-as vis-gif-tag 65)) + (set! (-> vis-gif-1 3) (the-as vis-gif-tag #x301ec000)) + ) + (let ((vis-gif-1-again (-> math-cam vis-gifs))) + (set! (-> vis-gif-1-again 0 fog0) (the-as uint pfog)) + (set! (-> vis-gif-1-again 0 strip) (the-as uint #x303e4000)) + (set! (-> vis-gif-1-again 0 regs) (the-as uint 1042)) + (set! (-> vis-gif-1-again 0 fan) (the-as uint #x303ec000)) + ) + (let ((vis-gif-1-again-again (-> math-cam vis-gifs))) + (set! (-> vis-gif-1-again-again 0 fog0) (the-as uint pfog)) + (set! (-> vis-gif-1-again-again 0 strip) (the-as uint #x303e4000)) + (set! (-> vis-gif-1-again-again 0 regs) (the-as uint 1042)) + (set! (-> vis-gif-1-again-again 0 fan) (the-as uint #x303ec000)) + ) ) - ) - ;; update sprite stuff. + ;; update sprite distort vectors (if (nonzero? sprite-distorter-generate-tables) (sprite-distorter-generate-tables) ) @@ -361,36 +347,34 @@ ;; local-trans is the translation in the camera frame. (let ((local-trans (new-stack-vector0))) ;; circle/square move camera relative x (left and right) - (set! (-> local-trans x) - (cond - ((logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons circle)) - -80.0 - ) - ((logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons square)) - 80.0 - ) - (else - 0.0 - ) - ) + (set! (-> local-trans x) (cond + ((cpad-hold? pad-idx circle) + -80.0 + ) + ((cpad-hold? pad-idx square) + 80.0 + ) + (else + 0.0 + ) + ) ) ;; no way to move camera relative y (up/down) (set! (-> local-trans y) 0.0) ;; in and out movement - (set! (-> local-trans z) - (cond - ((logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons down)) - -80.0 - ) - ((logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons up)) - 80.0 - ) - (else - 0.0 - ) - ) + (set! (-> local-trans z) (cond + ((cpad-hold? pad-idx down) + -80.0 + ) + ((cpad-hold? pad-idx up) + 80.0 + ) + (else + 0.0 + ) + ) ) (set! (-> local-trans w) 1.0) @@ -413,25 +397,25 @@ (set! (-> trans trans w) 1.0) ;; global translation - (if (logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons r1)) - (set! (-> trans trans y) (+ 80.0 (-> trans trans y))) + (if (cpad-hold? pad-idx r1) + (+! (-> trans trans y) 80.0) ) - (if (logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons r2)) - (set! (-> trans trans y) (+ -80.0 (-> trans trans y))) + (if (cpad-hold? pad-idx r2) + (+! (-> trans trans y) -80.0) ) ;; rotation (don't allow camera roll) - (if (logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons x)) - (set! (-> trans rot x) (+ 546.13336 (-> trans rot x))) + (if (cpad-hold? pad-idx x) + (+! (-> trans rot x) 546.13336) ) - (if (logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons triangle)) - (set! (-> trans rot x) (+ -546.13336 (-> trans rot x))) + (if (cpad-hold? pad-idx triangle) + (+! (-> trans rot x) -546.13336) ) - (if (logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons left)) - (set! (-> trans rot y) (+ 546.13336 (-> trans rot y))) + (if (cpad-hold? pad-idx left) + (+! (-> trans rot y) 546.13336) ) - (if (logtest? (-> *cpad-list* cpads pad-idx button0-abs 0) (pad-buttons right)) - (set! (-> trans rot y) (+ -546.13336 (-> trans rot y))) + (if (cpad-hold? pad-idx right) + (+! (-> trans rot y) -546.13336) ) trans ) @@ -454,8 +438,7 @@ (vf31 :class vf) ) (init-vf0-vector) - (let ((v1-0 0)) - ) + 0 (.lvf vf24 (&-> *math-camera* camera-temp vector 0 quad)) (.lvf vf25 (&-> *math-camera* camera-temp vector 1 quad)) (.lvf vf26 (&-> *math-camera* camera-temp vector 2 quad)) diff --git a/goal_src/jak1/engine/gfx/merc/generic-merc-h.gc b/goal_src/jak1/engine/gfx/merc/generic-merc-h.gc index 0345258c99e..27c8d7dcc02 100644 --- a/goal_src/jak1/engine/gfx/merc/generic-merc-h.gc +++ b/goal_src/jak1/engine/gfx/merc/generic-merc-h.gc @@ -11,122 +11,103 @@ ;; DECOMP BEGINS (deftype merc-matrix (structure) - ((quad uint128 8 :offset-assert 0) - (vector vector 8 :inline :offset 0) - (tag uint64 :offset 0) + ((quad uint128 8) + (vector vector 8 :inline :overlay-at (-> quad 0)) + (tag uint64 :overlay-at (-> quad 0)) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) + (deftype generic-merc-tag (dma-packet) - ((next-ptr uint32 :offset 12) - (size uint32 :offset 8) + ((next-ptr uint32 :overlay-at vif1) + (size uint32 :overlay-at vif0) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype generic-merc-ctrl (structure) - ((tag generic-merc-tag :inline :offset-assert 0) - (lights vu-lights :inline :offset-assert 16) - (header merc-ctrl-header :inline :offset-assert 128) - (effect merc-effect :inline :offset-assert 208) + ((tag generic-merc-tag :inline) + (lights vu-lights :inline) + (header merc-ctrl-header :inline) + (effect merc-effect :inline) ) - :method-count-assert 9 - :size-assert #xf0 - :flag-assert #x9000000f0 ) + (deftype generic-merc-ctrl-with-sfx (generic-merc-ctrl) - ((sfx-data uint128 11 :offset-assert 240) + ((sfx-data uint128 11) ) - :method-count-assert 9 - :size-assert #x1a0 - :flag-assert #x9000001a0 ) + (deftype generic-merc-input (structure) - ((geo-tag generic-merc-tag :inline :offset-assert 0) - (geo-block uint8 1296 :offset-assert 16) - (byte-header merc-byte-header :inline :offset 16) - (matrix merc-matrix 9 :inline :offset-assert 1312) - (control generic-merc-ctrl-with-sfx :inline :offset-assert 2464) - (end-tag generic-merc-tag :inline :offset-assert 2880) - (shader adgif-shader :inline :offset-assert 2896) + ((geo-tag generic-merc-tag :inline) + (geo-block uint8 1296) + (byte-header merc-byte-header :inline :overlay-at (-> geo-block 0)) + (matrix merc-matrix 9 :inline) + (control generic-merc-ctrl-with-sfx :inline) + (end-tag generic-merc-tag :inline) + (shader adgif-shader :inline) ) - :method-count-assert 9 - :size-assert #xba0 - :flag-assert #x900000ba0 ) + (deftype generic-merc-output (structure) - ((info gsf-info :inline :offset-assert 0) - (header gsf-header :inline :offset-assert 16) - (index-kick-table uint16 80 :offset-assert 32) - (index-table uint8 160 :offset 32) - (inverse-table uint8 256 :offset-assert 192) - (vertex-table gsf-vertex 72 :inline :offset-assert 448) + ((info gsf-info :inline) + (header gsf-header :inline) + (index-kick-table uint16 80) + (index-table uint8 160 :overlay-at (-> index-kick-table 0)) + (inverse-table uint8 256) + (vertex-table gsf-vertex 72 :inline) ) - :method-count-assert 9 - :size-assert #xac0 - :flag-assert #x900000ac0 ) + (deftype generic-merc-dcache (structure) - ((output-a generic-merc-output :inline :offset-assert 0) - (output-b generic-merc-output :inline :offset-assert 2752) - (inv-table-1 uint8 544 :offset-assert 5504) - (inv-table-7 uint8 544 :offset-assert 6048) - (inv-safety uint8 16 :offset-assert 6592) - (effect-data uint8 1584 :offset-assert 6608) + ((output-a generic-merc-output :inline) + (output-b generic-merc-output :inline) + (inv-table-1 uint8 544) + (inv-table-7 uint8 544) + (inv-safety uint8 16) + (effect-data uint8 1584) ) - :method-count-assert 9 - :size-assert #x2000 - :flag-assert #x900002000 ) + (deftype gm-shadow (structure) - ((perspective matrix :inline :offset-assert 0) - (isometric matrix :inline :offset-assert 64) - (inv-camera-rot matrix :inline :offset-assert 128) - (envmap-shader adgif-shader :inline :offset-assert 192) - (current-chain uint32 :offset-assert 272) - (next-chain uint32 :offset-assert 276) - (buf-index uint32 :offset-assert 280) - (fragment-count uint32 :offset-assert 284) - (write-limit pointer :offset-assert 288) - (indexed-input-base generic-merc-input :offset-assert 292) - (other-input-base generic-merc-input :offset-assert 296) - (indexed-output-base generic-merc-output :offset-assert 300) - (other-output-base generic-merc-output :offset-assert 304) - (p-input uint32 :offset-assert 308) - (gsf-buf generic-merc-dcache :offset-assert 312) - (p-fheader merc-fp-header :offset-assert 316) - (mercneric-convert basic :offset-assert 320) - (generic-prepare-dma-single basic :offset-assert 324) - (generic-prepare-dma-double basic :offset-assert 328) - (generic-light-proc basic :offset-assert 332) - (generic-envmap-proc basic :offset-assert 336) - (high-speed-reject basic :offset-assert 340) - (hsr-xmult vector :inline :offset-assert 352) - (hsr-ymult vector :inline :offset-assert 368) + ((perspective matrix :inline) + (isometric matrix :inline) + (inv-camera-rot matrix :inline) + (envmap-shader adgif-shader :inline) + (current-chain uint32) + (next-chain uint32) + (buf-index uint32) + (fragment-count uint32) + (write-limit pointer) + (indexed-input-base generic-merc-input) + (other-input-base generic-merc-input) + (indexed-output-base generic-merc-output) + (other-output-base generic-merc-output) + (p-input uint32) + (gsf-buf generic-merc-dcache) + (p-fheader merc-fp-header) + (mercneric-convert basic) + (generic-prepare-dma-single basic) + (generic-prepare-dma-double basic) + (generic-light-proc basic) + (generic-envmap-proc basic) + (high-speed-reject basic) + (hsr-xmult vector :inline) + (hsr-ymult vector :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) + (deftype generic-merc-work (structure) - ((input-a generic-merc-input :inline :offset-assert 0) - (input-b generic-merc-input :inline :offset-assert 2976) - (ctrl generic-merc-ctrl-with-sfx :inline :offset-assert 5952) - (shadow gm-shadow :inline :offset-assert 6368) - (stack uint128 16 :offset-assert 6752) + ((input-a generic-merc-input :inline) + (input-b generic-merc-input :inline) + (ctrl generic-merc-ctrl-with-sfx :inline) + (shadow gm-shadow :inline) + (stack uint128 16) ) - :method-count-assert 9 - :size-assert #x1b60 - :flag-assert #x900001b60 ) diff --git a/goal_src/jak1/engine/gfx/merc/merc-death.gc b/goal_src/jak1/engine/gfx/merc/merc-death.gc index aa7a1816d6f..2bedf3fe6b3 100644 --- a/goal_src/jak1/engine/gfx/merc/merc-death.gc +++ b/goal_src/jak1/engine/gfx/merc/merc-death.gc @@ -10,15 +10,12 @@ (define *merc-death-globals* (new 'global 'vector)) (deftype death-info (basic) - ((vertex-skip uint16 :offset-assert 4) - (timer uint8 :offset-assert 6) - (overlap uint8 :offset-assert 7) - (effect uint32 :offset-assert 8) - (sound symbol :offset-assert 12) + ((vertex-skip uint16) + (timer uint8) + (overlap uint8) + (effect uint32) + (sound symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) diff --git a/goal_src/jak1/engine/gfx/merc/merc-h.gc b/goal_src/jak1/engine/gfx/merc/merc-h.gc index 360b4d8e38f..5a5fa6eaf10 100644 --- a/goal_src/jak1/engine/gfx/merc/merc-h.gc +++ b/goal_src/jak1/engine/gfx/merc/merc-h.gc @@ -14,15 +14,12 @@ ;; The "ripple" system can apply a ripple effect (for waves or similar) to merc data. ;; This defines which vertices should be rippled. (deftype ripple-merc-query (inline-array-class) - ((start-vertex int32 :offset-assert 16) - (vertex-skip int32 :offset-assert 20) - (vertex-count int32 :offset-assert 24) - (current-loc int32 :offset-assert 28) - (data vector :inline :dynamic :offset-assert 32) + ((start-vertex int32) + (vertex-skip int32) + (vertex-count int32) + (current-loc int32) + (data vector :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (set! (-> ripple-merc-query heap-base) 16) @@ -33,38 +30,30 @@ ;; fragment in the same merc "effect". (deftype merc-byte-header (structure) ;; these offsets are after unpacking/upload to VU. - ((srcdest-off uint8 :offset-assert 0) ;; location of srcdst table for vertex copying - (rgba-off uint8 :offset-assert 1) ;; location of rgba data - (lump-off uint8 :offset-assert 2) ;; location of "lump" packed vertex data - (fp-off uint8 :offset-assert 3) ;; location of "fp" data (adgif shader, some floats) - - (mat1-cnt uint8 :offset-assert 4) ;; number of vertices influenced by one bone - (mat2-cnt uint8 :offset-assert 5) ;; two bone - (mat3-cnt uint8 :offset-assert 6) ;; three bone - - (samecopy-cnt uint8 :offset-assert 7) ;; number of vertices to copy from this fragment - (crosscopy-cnt uint8 :offset-assert 8) ;; copy vertices from previous fragment count - (strip-len uint8 :offset-assert 9) ;; how long is the initial strip before a shader (may be 0, if starts with shader) - (mm-quadword-fp-off uint8 :offset-assert 10) ;; main memory offset of fp data - (mm-quadword-size uint8 :offset-assert 11) ;; main memory size of whole fragment - (perc-off uint8 :offset-assert 12) ;; bone weight table offset - (mat-slot uint8 10 :offset-assert 13) ;; which matrices to upload where for this fragment + ((srcdest-off uint8) ;; location of srcdst table for vertex copying + (rgba-off uint8) ;; location of rgba data + (lump-off uint8) ;; location of "lump" packed vertex data + (fp-off uint8) ;; location of "fp" data (adgif shader, some floats) + (mat1-cnt uint8) ;; number of vertices influenced by one bone + (mat2-cnt uint8) ;; two bone + (mat3-cnt uint8) ;; three bone + (samecopy-cnt uint8) ;; number of vertices to copy from this fragment + (crosscopy-cnt uint8) ;; copy vertices from previous fragment count + (strip-len uint8) ;; how long is the initial strip before a shader (may be 0, if starts with shader) + (mm-quadword-fp-off uint8) ;; main memory offset of fp data + (mm-quadword-size uint8) ;; main memory size of whole fragment + (perc-off uint8) ;; bone weight table offset + (mat-slot uint8 10) ;; which matrices to upload where for this fragment ) - :method-count-assert 9 - :size-assert #x17 - :flag-assert #x900000017 ) ;; merc VU fragment: contains the header and data. (deftype merc-fragment (structure) - ((header merc-byte-header :inline :offset-assert 0) - (rest uint8 1 :offset-assert 23) + ((header merc-byte-header :inline) + (rest uint8 1) ) - :method-count-assert 10 - :size-assert #x18 - :flag-assert #xa00000018 (:methods - (login-adgifs (_type_) none 9) + (login-adgifs (_type_) none) ) ) @@ -72,40 +61,35 @@ ;; the meaning of flags is situation dependent in the renderer, see extract_merc.cpp ;; for the details. (deftype merc-vtx (structure) - ((mat-0 uint8 :offset-assert 0) ;; matrix number for first bone (and flags) - (mat-1 uint8 :offset-assert 1) ;; matrix number for second bone (and flags) - (nrm-x uint8 :offset-assert 2) ;; x component of normal - (pos-x uint8 :offset-assert 3) ;; x component of position - (dst-0 uint8 :offset-assert 4) ;; location to place vertex (and flags) - (dst-1 uint8 :offset-assert 5) ;; location to place vertex 2 (and flags) - (nrm-y uint8 :offset-assert 6) ;; normal - (pos-y uint8 :offset-assert 7) ;; pos - (tex-s uint8 :offset-assert 8) ;; texture coordinate - (tex-t uint8 :offset-assert 9) - (nrm-z uint8 :offset-assert 10) - (pos-z uint8 :offset-assert 11) + ((mat-0 uint8) ;; matrix number for first bone (and flags) + (mat-1 uint8) ;; matrix number for second bone (and flags) + (nrm-x uint8) ;; x component of normal + (pos-x uint8) ;; x component of position + (dst-0 uint8) ;; location to place vertex (and flags) + (dst-1 uint8) ;; location to place vertex 2 (and flags) + (nrm-y uint8) ;; normal + (pos-y uint8) ;; pos + (tex-s uint8) ;; texture coordinate + (tex-t uint8) + (nrm-z uint8) + (pos-z uint8) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; header for fp data within a fragment. Is included in fp data. ;; adgifs come right after the header (deftype merc-fp-header (structure) - ((x-add float :offset-assert 0) - (y-add float :offset-assert 4) - (z-add float :offset-assert 8) - (shader-cnt uint8 :offset-assert 12) ;; number of adgifs - (kick-info-offset uint8 :offset-assert 13) - (kick-info-step uint8 :offset-assert 14) - (hword-cnt uint8 :offset-assert 15) + ((x-add float) + (y-add float) + (z-add float) + (shader-cnt uint8) + (kick-info-offset uint8) + (kick-info-step uint8) + (hword-cnt uint8) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (defun merc-fragment-fp-data ((arg0 merc-fragment)) "Get the floating-point data of a merc-fragment" (the merc-fp-header (&+ arg0 (the-as uint (shl (-> arg0 header mm-quadword-fp-off) 4)))) @@ -113,124 +97,98 @@ ;; a description of a matrix upload to merc (deftype merc-mat-dest (structure) - ((matrix-number uint8 :offset-assert 0) ;; the matrix in the skeleton - (matrix-dest uint8 :offset-assert 1) ;; the slot in the shader (only a small number available) + ((matrix-number uint8) ;; the matrix in the skeleton + (matrix-dest uint8) ;; the slot in the shader (only a small number available) ) :pack-me - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; some info about a merc fragment that will stay on the EE. ;; the merc-effect contains a ref to one of these ;; this is all the information needed to generate merc upload dma (counts/sizes) (deftype merc-fragment-control (structure) - ((unsigned-four-count uint8 :offset-assert 0) - (lump-four-count uint8 :offset-assert 1) - (fp-qwc uint8 :offset-assert 2) - (mat-xfer-count uint8 :offset-assert 3) - (mat-dest-data merc-mat-dest :inline :dynamic :offset-assert 4) + ((unsigned-four-count uint8) + (lump-four-count uint8) + (fp-qwc uint8) + (mat-xfer-count uint8) + (mat-dest-data merc-mat-dest :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; packed blend shape data -(deftype merc-blend-data (structure) ;; was unknown! - ((int8-data int8 :dynamic :offset-assert 0) +(deftype merc-blend-data (structure) + ((int8-data int8 :dynamic) ) ) ;; info needed to set up blend shapes (deftype merc-blend-ctrl (structure) - ((blend-vtx-count uint8 :offset-assert 0) - (nonzero-index-count uint8 :offset-assert 1) - (bt-index uint8 :dynamic :offset-assert 2) + ((blend-vtx-count uint8) + (nonzero-index-count uint8) + (bt-index uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; info for environment map "extra" (deftype mei-envmap-tint (structure) - ((fade0 float :offset-assert 0) ;; start fade - (fade1 float :offset-assert 4) ;; end fade - (tint uint32 :offset-assert 8) ;; envmap color - (dummy int32 :offset-assert 12) + ((fade0 float) + (fade1 float) + (tint uint32) + (dummy int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; info for texture scrolling "extra" (deftype mei-texture-scroll (structure) - ((max-dist float :offset-assert 0) - (st-int-scale uint8 :offset-assert 4) - (time-factor uint8 :offset-assert 5) - (scroll-dir uint8 :offset-assert 6) - (cached-time uint8 :offset-assert 7) - (time-delta uint8 :offset-assert 8) - (dummy uint8 7 :offset-assert 9) + ((max-dist float) + (st-int-scale uint8) + (time-factor uint8) + (scroll-dir uint8) + (cached-time uint8) + (time-delta uint8) + (dummy uint8 7) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; info for ripple effect "extra" (deftype mei-ripple (structure) - ((x-base float :offset-assert 0) - (z-base float :offset-assert 4) - (grid-size float :offset-assert 8) - (angle float :offset-assert 12) + ((x-base float) + (z-base float) + (grid-size float) + (angle float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; locations of the "extra"s. (deftype merc-extra-info (structure) - ((envmap-tint-offset uint8 :offset-assert 0) - (shader-offset uint8 :offset-assert 1) - (texture-scroll-offset uint8 :offset-assert 2) - (ripple-offset uint8 :offset-assert 3) - (dummy uint8 12 :offset-assert 4) + ((envmap-tint-offset uint8) + (shader-offset uint8) + (texture-scroll-offset uint8) + (ripple-offset uint8) + (dummy uint8 12) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; a collection of fragments that must be sent all together. ;; and their extra effects. (deftype merc-effect (structure) - ((frag-geo merc-fragment :offset-assert 0) - (frag-ctrl merc-fragment-control :offset-assert 4) - (blend-data merc-blend-data :offset-assert 8) - (blend-ctrl merc-blend-ctrl :offset-assert 12) - (dummy0 uint8 :offset-assert 16) - (effect-bits uint8 :offset-assert 17) - (frag-count uint16 :offset-assert 18) - (blend-frag-count uint16 :offset-assert 20) - (tri-count uint16 :offset-assert 22) - (dvert-count uint16 :offset-assert 24) - (dummy1 uint8 :offset-assert 26) - (envmap-usage uint8 :offset-assert 27) - (extra-info merc-extra-info :offset-assert 28) - - ;; added - (data uint64 4 :offset 0) + ((frag-geo merc-fragment) + (frag-ctrl merc-fragment-control) + (blend-data merc-blend-data) + (blend-ctrl merc-blend-ctrl) + (dummy0 uint8) + (effect-bits uint8) + (frag-count uint16) + (blend-frag-count uint16) + (tri-count uint16) + (dvert-count uint16) + (dummy1 uint8) + (envmap-usage uint8) + (extra-info merc-extra-info) + (data uint64 4 :overlay-at frag-geo) ) - :method-count-assert 10 - :size-assert #x20 - :flag-assert #xa00000020 (:methods - (login-adgifs (_type_) none 9) + (login-adgifs (_type_) none) ) ) @@ -239,168 +197,143 @@ ;; The pupil/iris can be scaled (independtenly) ;; the eyelid goes up and down (deftype merc-eye-ctrl (structure) - ((eye-slot int8 :offset-assert 0) ;; slot in anim data - (shader-offset int8 :offset-assert 1) ;; offset in merc data - (shader-count int8 :offset-assert 2) - ;; copies of the shader. - (iris-shader adgif-shader :inline :offset-assert 16) - (pupil-shader adgif-shader :inline :offset-assert 96) - (lid-shader adgif-shader :inline :offset-assert 176) - (shader adgif-shader 3 :inline :offset 16) ;; moved + ((eye-slot int8) + (shader-offset int8) + (shader-count int8) + (shader adgif-shader 3 :inline) + (iris-shader adgif-shader :inline :overlay-at (-> shader 0)) + (pupil-shader adgif-shader :inline :overlay-at (-> shader 1)) + (lid-shader adgif-shader :inline :overlay-at (-> shader 2)) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; single frame for eye animation (deftype merc-eye-anim-frame (structure) - ((pupil-trans-x int8 :offset-assert 0) - (pupil-trans-y int8 :offset-assert 1) - (blink int8 :offset-assert 2) - (iris-scale int8 :offset 4) - (pupil-scale int8 :offset-assert 5) - (lid-scale int8 :offset-assert 6) - (dword uint64 :offset 0) + ((pupil-trans-x int8) + (pupil-trans-y int8) + (blink int8) + (iris-scale int8 :offset 4) + (pupil-scale int8) + (lid-scale int8) + (dword uint64 :overlay-at pupil-trans-x) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; just an array of eye anim frames. (deftype merc-eye-anim-block (structure) - ((max-frame int16 :offset-assert 0) - (data merc-eye-anim-frame :inline :dynamic :offset 8) + ((max-frame int16) + (data merc-eye-anim-frame :inline :dynamic :offset 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; metadata for merc art for a single model ;; mostly just stats and parameters used in dma/rendering. (deftype merc-ctrl-header (structure) - ((xyz-scale float :offset-assert 0) - (st-magic uint32 :offset-assert 4) - (st-out-a uint32 :offset-assert 8) - (st-out-b uint32 :offset-assert 12) - (st-vif-add uint32 :offset-assert 16) - (st-int-off uint16 :offset-assert 20) - (st-int-scale uint16 :offset-assert 22) - (effect-count uint32 :offset-assert 24) - (blend-target-count uint32 :offset-assert 28) - (fragment-count uint16 :offset-assert 32) - (tri-count uint16 :offset-assert 34) - (matrix-count uint8 :offset-assert 36) - (shader-count uint8 :offset-assert 37) - (transform-vertex-count uint16 :offset-assert 38) - (dvert-count uint16 :offset-assert 40) - (one-mat-count uint16 :offset-assert 42) - (two-mat-count uint16 :offset-assert 44) - (two-mat-reuse-count uint16 :offset-assert 46) - (three-mat-count uint16 :offset-assert 48) - (three-mat-reuse-count uint16 :offset-assert 50) - (shader-upload-count uint8 :offset-assert 52) - (matrix-upload-count uint8 :offset-assert 53) - (same-copy-count uint16 :offset-assert 54) - (cross-copy-count uint16 :offset-assert 56) - (num-verts uint16 :offset-assert 58) - (longest-edge float :offset-assert 60) - (eye-ctrl merc-eye-ctrl :offset-assert 64) - (masks uint32 3 :offset-assert 68) - (dummy-bytes uint8 48 :offset 32) - (envmap-tint uint32 :offset 32) - (query basic :offset 36) - (needs-clip uint8 :offset 40) - (use-isometric uint8 :offset 41) - (use-attached-shader uint8 :offset 42) - (display-triangles uint8 :offset 43) - (death-vertex-skip uint16 :offset 44) - (death-start-vertex uint16 :offset 46) - (death-effect uint32 :offset 48) - (use-translucent uint8 :offset 52) - (display-this-fragment uint8 :offset 53) + ((xyz-scale float) + (st-magic uint32) + (st-out-a uint32) + (st-out-b uint32) + (st-vif-add uint32) + (st-int-off uint16) + (st-int-scale uint16) + (effect-count uint32) + (blend-target-count uint32) + (fragment-count uint16) + (tri-count uint16) + (matrix-count uint8) + (shader-count uint8) + (transform-vertex-count uint16) + (dvert-count uint16) + (one-mat-count uint16) + (two-mat-count uint16) + (two-mat-reuse-count uint16) + (three-mat-count uint16) + (three-mat-reuse-count uint16) + (shader-upload-count uint8) + (matrix-upload-count uint8) + (same-copy-count uint16) + (cross-copy-count uint16) + (num-verts uint16) + (longest-edge float) + (eye-ctrl merc-eye-ctrl) + (masks uint32 3) + (dummy-bytes uint8 48 :overlay-at fragment-count) + (envmap-tint uint32 :overlay-at fragment-count) + (query basic :overlay-at matrix-count) + (needs-clip uint8 :overlay-at dvert-count) + (use-isometric uint8 :overlay-at (-> dummy-bytes 9)) + (use-attached-shader uint8 :overlay-at one-mat-count) + (display-triangles uint8 :overlay-at (-> dummy-bytes 11)) + (death-vertex-skip uint16 :overlay-at two-mat-count) + (death-start-vertex uint16 :overlay-at two-mat-reuse-count) + (death-effect uint32 :overlay-at three-mat-count) + (use-translucent uint8 :overlay-at shader-upload-count) + (display-this-fragment uint8 :overlay-at matrix-upload-count) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 - ;; field xyz-scale is a float printed as hex? ) ;; the actual merc art object: a header and list of effects (deftype merc-ctrl (art-element) - ((num-joints int32 :offset 20) - (header merc-ctrl-header :inline :offset-assert 32) - (effect merc-effect :inline :dynamic :offset-assert 112) + ((num-joints int32 :overlay-at (-> pad 0)) + (header merc-ctrl-header :inline) + (effect merc-effect :inline :dynamic) ) - :method-count-assert 13 - :size-assert #x70 - :flag-assert #xd00000070 ) ;; low memory upload to vu1 for merc (which merc later writes over) (deftype merc-vu1-low-mem (structure) - ((tri-strip-gif gs-gif-tag :inline :offset-assert 0) ;; was qword - (ad-gif gs-gif-tag :inline :offset-assert 16) ;; was qword - (hvdf-offset vector :inline :offset-assert 32) - (perspective uint128 4 :offset-assert 48) - (fog vector :inline :offset-assert 112) + ((tri-strip-gif gs-gif-tag :inline) + (ad-gif gs-gif-tag :inline) + (hvdf-offset vector :inline) + (perspective uint128 4) + (fog vector :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) + (deftype ripple-wave (structure) - ((scale float :offset-assert 0) - (offs float :offset-assert 4) - (xdiv int16 :offset-assert 8) - (zdiv int16 :offset-assert 10) - (speed float :offset-assert 12) - (xmul float :offset-assert 16) - (zmul float :offset-assert 20) - (delta float :offset-assert 24) + ((scale float) + (offs float) + (xdiv int16) + (zdiv int16) + (speed float) + (xmul float) + (zmul float) + (delta float) ) :pack-me - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) + (deftype ripple-wave-set (basic) - ((count int32 :offset-assert 4) - (converted basic :offset-assert 8) - (frame-save uint32 :offset-assert 12) - (normal-scale float :offset-assert 16) - (wave ripple-wave 4 :inline :offset-assert 20) + ((count int32) + (converted basic) + (frame-save uint32) + (normal-scale float) + (wave ripple-wave 4 :inline) ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) + (deftype ripple-control (basic) - ((global-scale float :offset-assert 4) - (last-frame-scale float :offset-assert 8) - (close-fade-dist float :offset-assert 12) - (far-fade-dist float :offset-assert 16) - (faded-scale float :offset-assert 20) - (individual-normal-scale float :offset-assert 24) - (waveform ripple-wave-set :offset-assert 28) - (send-query symbol :offset-assert 32) ;; bool - (query ripple-merc-query :offset-assert 36) + ((global-scale float) + (last-frame-scale float) + (close-fade-dist float) + (far-fade-dist float) + (faded-scale float) + (individual-normal-scale float) + (waveform ripple-wave-set) + (send-query symbol) + (query ripple-merc-query) ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) + (defmethod new ripple-control ((allocation symbol) (type-to-make type)) (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (set! (-> this global-scale) 0.0) diff --git a/goal_src/jak1/engine/gfx/merc/merc.gc b/goal_src/jak1/engine/gfx/merc/merc.gc index 11b51bcc30d..d74194b477d 100644 --- a/goal_src/jak1/engine/gfx/merc/merc.gc +++ b/goal_src/jak1/engine/gfx/merc/merc.gc @@ -19,24 +19,24 @@ ;; contains the header for the currently logging-in thing. (define *merc-ctrl-header* (the-as merc-ctrl-header #f)) -(defmethod asize-of merc-fragment ((this merc-fragment)) +(defmethod asize-of ((this merc-fragment)) "Get the size in memory of a merc-fragment" (the-as int (* (-> this header mm-quadword-size) 16)) ) -(defmethod login-adgifs merc-fragment ((this merc-fragment)) +(defmethod login-adgifs ((this merc-fragment)) "Set up a merc-fragment. Does adgifs and eye stuff" (let* ((fp-data (merc-fragment-fp-data this)) (eye-ctrl (if (nonzero? (-> *merc-ctrl-header* eye-ctrl)) - (-> *merc-ctrl-header* eye-ctrl) - (the-as merc-eye-ctrl #f) - ) - ) + (-> *merc-ctrl-header* eye-ctrl) + (the-as merc-eye-ctrl #f) + ) + ) (shader (the-as adgif-shader (&+ fp-data 16))) ) (dotimes (s2-0 (the-as int (-> fp-data shader-cnt))) (cond - ((and eye-ctrl (= (logand -256 (-> shader texture-id)) #x1cf06f00)) + ((and eye-ctrl (= (logand (the-as texture-id -256) (-> shader texture-id)) #x1cf06f00)) ;; eye slot 0 (adgif-shader-login shader) (let ((eye-tex-block (get-eye-block (-> eye-ctrl eye-slot) 0))) @@ -49,15 +49,10 @@ (set! (-> shader tex0 psm) 0) (set! (-> shader tex1 mxl) 0) (set! (-> shader clamp) - (new 'static 'gs-clamp - :wms (gs-tex-wrap-mode clamp) - :wmt (gs-tex-wrap-mode clamp) - :maxu #x1f - :maxv #x1f - ) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp) :maxu #x1f :maxv #x1f) ) ) - ((and eye-ctrl (= (logand -256 (-> shader texture-id)) #x1cf07000)) + ((and eye-ctrl (= (logand (the-as texture-id -256) (-> shader texture-id)) #x1cf07000)) ;; eye slot 1 (adgif-shader-login shader) (let ((eye-tex-block-2 (get-eye-block (-> eye-ctrl eye-slot) 1))) @@ -70,12 +65,7 @@ (set! (-> shader tex0 psm) 0) (set! (-> shader tex1 mxl) 0) (set! (-> shader clamp) - (new 'static 'gs-clamp - :wms (gs-tex-wrap-mode clamp) - :wmt (gs-tex-wrap-mode clamp) - :maxu #x1f - :maxv #x1f - ) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp) :maxu #x1f :maxv #x1f) ) ) (else @@ -95,7 +85,7 @@ (none) ) -(defmethod asize-of merc-fragment-control ((this merc-fragment-control)) +(defmethod asize-of ((this merc-fragment-control)) (the-as int (+ (* (-> this mat-xfer-count) 2) 4)) ) @@ -114,21 +104,14 @@ this ) -(defmethod login-adgifs merc-effect ((this merc-effect)) +(defmethod login-adgifs ((this merc-effect)) "Login everything for this merc-effect." ;; login adgifs, if we have them. (let ((data (-> this extra-info))) (when (nonzero? data) (when (nonzero? (-> data shader-offset)) - (let ((tex (adgif-shader-login - (the-as - adgif-shader - (+ (the-as uint data) (* (-> data shader-offset) 16)) - ) - ) - ) - ) + (let ((tex (adgif-shader-login (the-as adgif-shader (+ (the-as uint data) (* (-> data shader-offset) 16)))))) (when tex (dotimes (seg 3) (logior! (-> *merc-ctrl-header* masks seg) (-> tex masks seg)) @@ -170,7 +153,7 @@ this ) -(defmethod mem-usage merc-ctrl ((this merc-ctrl) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this merc-ctrl) (arg0 memory-usage-block) (arg1 int)) "Compute memory usage stats for a merc-ctrl" ;; do extra @@ -206,11 +189,10 @@ (dotimes (effect-idx2 (the-as int (-> this header effect-count))) (when (nonzero? (-> this effect effect-idx2 blend-frag-count)) (let ((bctrl (-> this effect effect-idx2 blend-ctrl))) - (dotimes (blend-frag-idx (the-as int (-> this effect effect-idx2 blend-frag-count)) ) - (let ((v1-36 (+ effect-mem - (* (+ (-> bctrl nonzero-index-count) 1) - (the-as uint (logand (+ (* (the-as uint 6) (-> bctrl blend-vtx-count)) 15) #xfff0)) - ) + (dotimes (blend-frag-idx (the-as int (-> this effect effect-idx2 blend-frag-count))) + (let ((v1-36 (+ effect-mem (* (+ (-> bctrl nonzero-index-count) 1) + (the-as uint (logand (+ (* (the-as uint 6) (-> bctrl blend-vtx-count)) 15) #xfff0)) + ) ) ) ) @@ -245,7 +227,7 @@ this ) -(defmethod login merc-ctrl ((this merc-ctrl)) +(defmethod login ((this merc-ctrl)) "Log in a merc-ctrl." ;; so we can find it @@ -287,7 +269,7 @@ ;; login eye. (cond - ((zero? (logand -65536 (the-as int (-> this header eye-ctrl)))) + ((not (logtest? -65536 (the-as int (-> this header eye-ctrl)))) ;; no idea what this is for. (set! (-> this header eye-ctrl) (the-as merc-eye-ctrl 0)) 0 @@ -358,9 +340,9 @@ (dotimes (gp-0 3) ;; levels (let ((s5-0 (-> *level* level gp-0 art-group))) (when (nonzero? s5-0) - (dotimes (s4-0 (-> s5-0 art-group-array length)) ;; art-groups + (dotimes (s4-0 (-> s5-0 art-group-array length)) (let ((s3-0 (-> s5-0 art-group-array s4-0))) - (dotimes (s2-0 (-> s3-0 length)) ;; arts + (dotimes (s2-0 (-> s3-0 length)) (let* ((s1-0 (-> s3-0 data s2-0)) (a0-3 (if (and (nonzero? s1-0) (type-type? (-> s1-0 type) merc-ctrl)) s1-0 @@ -390,19 +372,13 @@ (let ((s3-0 (-> s5-0 art-group-array s4-0))) (dotimes (s2-0 (-> s3-0 length)) (let* ((s1-0 (-> s3-0 data s2-0)) - (v1-10 - (if (and (nonzero? s1-0) (type-type? (-> s1-0 type) merc-ctrl)) - s1-0 - ) - ) + (v1-10 (if (and (nonzero? s1-0) (type-type? (-> s1-0 type) merc-ctrl)) + s1-0 + ) + ) ) (if v1-10 - (format - #t - "~30s: ~f~%" - (-> (the-as merc-ctrl v1-10) name) - (-> (the-as merc-ctrl v1-10) header longest-edge) - ) + (format #t "~30s: ~f~%" (-> (the-as merc-ctrl v1-10) name) (-> (the-as merc-ctrl v1-10) header longest-edge)) ) ) ) @@ -422,22 +398,12 @@ (dst (-> func origin)) ) (while (> qwc 0) - (let ((qwc-this-time (min 127 qwc))) ;; only 127 at a time + (let ((qwc-this-time (min 127 qwc))) (set! (-> dma dma) - (new 'static 'dma-tag - :id (dma-tag-id ref) - :qwc qwc-this-time - :addr (the-as int func-data) - ) - ) - (set! (-> dma vif0) (new 'static 'vif-tag :cmd (if (zero? flush-mode) (vif-cmd flushe) (vif-cmd flusha)))) - (set! (-> dma vif1) - (new 'static 'vif-tag - :cmd (vif-cmd mpg) - :num (* qwc-this-time 2) - :imm dst - ) + (new 'static 'dma-tag :id (dma-tag-id ref) :qwc qwc-this-time :addr (the-as int func-data)) ) + (set! (-> dma vif0) (new 'static 'vif-tag :cmd (if (zero? flush-mode) 16 19))) + (set! (-> dma vif1) (new 'static 'vif-tag :cmd (vif-cmd mpg) :num (* qwc-this-time 2) :imm dst)) (&+! dma 16) (&+! func-data (* qwc-this-time 16)) (set! qwc (- qwc qwc-this-time)) @@ -466,36 +432,23 @@ ;; template: (let ((s5-0 (the-as merc-vu1-low-mem (&+ (the-as dma-gif-packet gp-0) 32)))) (set! (-> s5-0 tri-strip-gif tag) - (new 'static 'gif-tag64 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1) - :nreg #x3 - ) - ) + (new 'static 'gif-tag64 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) (set! (-> s5-0 tri-strip-gif regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id st) - :regs1 (gif-reg-id rgbaq) - :regs2 (gif-reg-id xyzf2) - ) - ) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) ;; what is this, they snuck something in here... - (set! (-> s5-0 tri-strip-gif word 3) - (shr (make-u128 0 (shl #x303e4000 32)) 32) - ) + (set! (-> s5-0 tri-strip-gif word 3) (shr (make-u128 0 (shl #x303e4000 32)) 32)) (set! (-> s5-0 ad-gif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) (set! (-> s5-0 ad-gif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) (set! (-> s5-0 hvdf-offset quad) (-> *math-camera* hvdf-off quad)) - (quad-copy! (-> s5-0 perspective) (the-as pointer (-> *math-camera* perspective)) 4) - (set-vector! - (-> s5-0 fog) - (-> *math-camera* pfog0) - (-> *math-camera* fog-min) - (-> *math-camera* fog-max) - 0.0 - ) + (set-vector! (-> s5-0 fog) (-> *math-camera* pfog0) (-> *math-camera* fog-min) (-> *math-camera* fog-max) 0.0) ) ;; end. (let ((v1-20 (-> (the-as (inline-array dma-packet) gp-0) 10))) @@ -507,7 +460,6 @@ ) ) - (defun merc-vu1-init-buffer ((dma-bucket bucket-id) (test gs-test) (arg2 int)) "Setup merc DMA buffer." @@ -525,43 +477,22 @@ ) ;; set the beginning to be the merc init stuff. (set! (-> dma-buf base) - (the-as pointer (merc-vu1-initialize-chain (the-as dma-gif-packet (-> dma-buf base)))) - ) + (the-as pointer (merc-vu1-initialize-chain (the-as dma-gif-packet (-> dma-buf base)))) + ) ;; some other merc setup for the GS. (let* ((v1-8 dma-buf) (a0-6 (the-as object (-> v1-8 base))) ) (set! (-> (the-as dma-packet a0-6) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))) (set! (-> (the-as dma-packet a0-6) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet a0-6) vif1) - (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1) - ) + (set! (-> (the-as dma-packet a0-6) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)) (set! (-> v1-8 base) (&+ (the-as pointer a0-6) 16)) ) (let* ((v1-9 dma-buf) (a0-8 (the-as object (-> v1-9 base))) ) (set! (-> (the-as gs-gif-tag a0-8) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-8) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) - ) + (set! (-> (the-as gs-gif-tag a0-8) regs) GIF_REGS_ALL_AD) (set! (-> v1-9 base) (&+ (the-as pointer a0-8) 16)) ) (let* ((v1-10 dma-buf) @@ -574,9 +505,7 @@ ;; terminate as normal (let ((v1-11 (the-as object (-> dma-buf base)))) - (set! (-> (the-as dma-packet v1-11) dma) - (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> bucket next)) - ) + (set! (-> (the-as dma-packet v1-11) dma) (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> bucket next))) (set! (-> (the-as dma-packet v1-11) vif0) (new 'static 'vif-tag)) (set! (-> (the-as dma-packet v1-11) vif1) (new 'static 'vif-tag)) (set! (-> dma-buf base) (&+ (the-as pointer v1-11) 16)) @@ -597,91 +526,91 @@ (merc-vu1-init-buffer (bucket-id merc-tfrag-tex0) (new 'static 'gs-test - :ate #x1 - :atst (gs-atest greater-equal) - :aref #x26 - :zte #x1 - :ztst (gs-ztest greater-equal) - ) + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) 0 ) (merc-vu1-init-buffer (bucket-id merc-pris0) (new 'static 'gs-test - :ate #x1 - :atst (gs-atest greater-equal) - :aref #x26 - :zte #x1 - :ztst (gs-ztest greater-equal) - ) + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) 0 ) (merc-vu1-init-buffer (bucket-id merc-tfrag-tex1) (new 'static 'gs-test - :ate #x1 - :atst (gs-atest greater-equal) - :aref #x26 - :zte #x1 - :ztst (gs-ztest greater-equal) - ) + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) 0 ) (merc-vu1-init-buffer (bucket-id merc-pris1) (new 'static 'gs-test - :ate #x1 - :atst (gs-atest greater-equal) - :aref #x26 - :zte #x1 - :ztst (gs-ztest greater-equal) - ) + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) 0 ) (merc-vu1-init-buffer (bucket-id merc-alpha-tex) (new 'static 'gs-test - :ate #x1 - :atst (gs-atest greater-equal) - :aref #x26 - :zte #x1 - :ztst (gs-ztest greater-equal) - ) + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) 0 ) (merc-vu1-init-buffer (bucket-id merc-pris-common) (new 'static 'gs-test - :ate #x1 - :atst (gs-atest greater-equal) - :aref #x26 - :zte #x1 - :ztst (gs-ztest greater-equal) - ) + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) 0 ) (merc-vu1-init-buffer (bucket-id merc-water0) (new 'static 'gs-test - :ate #x1 - :atst (gs-atest greater-equal) - :aref #x80 - :afail #x1 - :zte #x1 - :ztst (gs-ztest greater-equal) - ) + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x80 + :afail #x1 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) 0 ) (merc-vu1-init-buffer (bucket-id merc-water1) (new 'static 'gs-test - :ate #x1 - :atst (gs-atest greater-equal) - :aref #x80 - :afail #x1 - :zte #x1 - :ztst (gs-ztest greater-equal) - ) + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x80 + :afail #x1 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) 0 ) ) diff --git a/goal_src/jak1/engine/gfx/mood/mood-h.gc b/goal_src/jak1/engine/gfx/mood/mood-h.gc index 24f68c2820f..3d8b87f0cf0 100644 --- a/goal_src/jak1/engine/gfx/mood/mood-h.gc +++ b/goal_src/jak1/engine/gfx/mood/mood-h.gc @@ -13,98 +13,75 @@ ;; set of fog parameters (deftype mood-fog (structure) - ((fog-color vector :inline :offset-assert 0) - (fog-dists vector :inline :offset-assert 16) - (fog-start meters :offset 16) - (fog-end meters :offset 20) - (fog-max float :offset 24) - (fog-min float :offset 28) - (erase-color vector :inline :offset-assert 32) + ((fog-color vector :inline) + (fog-dists vector :inline) + (fog-start meters :overlay-at (-> fog-dists x)) + (fog-end meters :overlay-at (-> fog-dists y)) + (fog-max float :overlay-at (-> fog-dists z)) + (fog-min float :overlay-at (-> fog-dists w)) + (erase-color vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; a fog pattern for each of the 8 moods (deftype mood-fog-table (structure) - ((data mood-fog 8 :inline :offset-assert 0) + ((data mood-fog 8 :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;; a set of light parameters (deftype mood-lights (structure) - ((direction vector :inline :offset-assert 0) - (lgt-color vector :inline :offset-assert 16) - (prt-color vector :inline :offset-assert 32) - (amb-color vector :inline :offset-assert 48) - (shadow vector :inline :offset-assert 64) + ((direction vector :inline) + (lgt-color vector :inline) + (prt-color vector :inline) + (amb-color vector :inline) + (shadow vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; a light parameter for each of the 8 moods (deftype mood-lights-table (structure) - ((data mood-lights 8 :inline :offset-assert 0) + ((data mood-lights 8 :inline) ) - :method-count-assert 9 - :size-assert #x280 - :flag-assert #x900000280 ) ;; settings for the sun (deftype mood-sun (structure) - ((sun-color vector :inline :offset-assert 0) - (env-color vector :inline :offset-assert 16) + ((sun-color vector :inline) + (env-color vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; sun settings for each of the 8 moods (deftype mood-sun-table (structure) - ((data mood-sun 8 :inline :offset-assert 0) + ((data mood-sun 8 :inline) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; all the current mood settings (deftype mood-context (basic) - ((mood-fog-table mood-fog-table :offset-assert 4) - (mood-lights-table mood-lights-table :offset-assert 8) - (mood-sun-table mood-sun-table :offset-assert 12) - (fog-interp sky-color-day :offset-assert 16) - (palette-interp sky-color-day :offset-assert 20) - (sky-texture-interp sky-color-day :offset-assert 24) - (current-fog mood-fog :inline :offset-assert 32) - (current-sun mood-sun :inline :offset-assert 80) - (current-prt-color vector :inline :offset-assert 112) - (current-shadow vector :inline :offset-assert 128) - (current-shadow-color vector :inline :offset-assert 144) - (light-group light-group 8 :inline :offset-assert 160) - ;; these "times" are the time-of-day weights. the w is the weight, the rest is just 1. - (times vector 8 :inline :offset-assert 1696) - (sky-times float 8 :offset-assert 1824) - ;; times as integers. For use in rendering code. - (itimes vector4w 4 :inline :offset-assert 1856) - (state uint8 16 :offset-assert 1920) - (num-stars float :offset-assert 1936) - (some-byte uint8 :offset 1939) + ((mood-fog-table mood-fog-table) + (mood-lights-table mood-lights-table) + (mood-sun-table mood-sun-table) + (fog-interp sky-color-day) + (palette-interp sky-color-day) + (sky-texture-interp sky-color-day) + (current-fog mood-fog :inline) + (current-sun mood-sun :inline) + (current-prt-color vector :inline) + (current-shadow vector :inline) + (current-shadow-color vector :inline) + (light-group light-group 8 :inline) + (times vector 8 :inline) + (sky-times float 8) + (itimes vector4w 4 :inline) + (state uint8 16) + (num-stars float) + (some-byte uint8 :offset 1939) ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) - :method-count-assert 9 - :size-assert #x794 - :flag-assert #x900000794 ) diff --git a/goal_src/jak1/engine/gfx/mood/mood.gc b/goal_src/jak1/engine/gfx/mood/mood.gc index c9f0a7dae1c..e60018bd15f 100644 --- a/goal_src/jak1/engine/gfx/mood/mood.gc +++ b/goal_src/jak1/engine/gfx/mood/mood.gc @@ -448,14 +448,11 @@ ) (deftype flames-state (structure) - ((index uint8 :offset-assert 0) - (time uint8 :offset-assert 1) - (length uint8 :offset-assert 2) - (height uint8 :offset-assert 3) + ((index uint8) + (time uint8) + (length uint8) + (height uint8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -568,12 +565,9 @@ (define *thunder-count* 0) (deftype lightning-state (structure) - ((val uint8 :offset-assert 0) + ((val uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x1 - :flag-assert #x900000001 ) @@ -751,22 +745,16 @@ ) (deftype light-time-state (structure) - ((time uint8 :offset-assert 0) + ((time uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x1 - :flag-assert #x900000001 ) (deftype light-state (structure) - ((fade uint8 :offset-assert 0) + ((fade uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x1 - :flag-assert #x900000001 ) @@ -818,14 +806,11 @@ ) (deftype lava-state (structure) - ((scale float 4 :offset-assert 0) - (time uint8 :offset-assert 16) - (last-index uint8 :offset-assert 17) + ((scale float 4) + (time uint8) + (last-index uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x12 - :flag-assert #x900000012 ) @@ -892,15 +877,12 @@ ) (deftype misty-states (structure) - ((flames flames-state :inline :offset-assert 0) - (light0 light-state :inline :offset-assert 4) - (light1 light-state :inline :offset-assert 5) - (time0 light-time-state :inline :offset-assert 6) - (time1 light-time-state :inline :offset-assert 7) + ((flames flames-state :inline) + (light0 light-state :inline) + (light1 light-state :inline) + (time0 light-time-state :inline) + (time1 light-time-state :inline) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -952,12 +934,9 @@ ) (deftype swamp-village2-states (structure) - ((flames flames-state :inline :offset-assert 0) - (lightning lightning-state :inline :offset-assert 4) + ((flames flames-state :inline) + (lightning lightning-state :inline) ) - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) @@ -1098,11 +1077,8 @@ ) (deftype village1-states (structure) - ((flames flames-state :inline :offset-assert 0) + ((flames flames-state :inline) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -1235,13 +1211,10 @@ ) (deftype jungle-states (structure) - ((light light-state :inline :offset-assert 0) - (time light-time-state :inline :offset-assert 1) - (one-shot uint8 :offset-assert 2) + ((light light-state :inline) + (time light-time-state :inline) + (one-shot uint8) ) - :method-count-assert 9 - :size-assert #x3 - :flag-assert #x900000003 ) @@ -1467,12 +1440,9 @@ ) (deftype sunken-states (structure) - ((light light-state :inline :offset-assert 0) - (time light-time-state :inline :offset-assert 1) + ((light light-state :inline) + (time light-time-state :inline) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) @@ -1565,16 +1535,13 @@ ) (deftype rolling-states (structure) - ((light0 light-state :inline :offset-assert 0) - (light1 light-state :inline :offset-assert 1) - (light2 light-state :inline :offset-assert 2) - (light3 light-state :inline :offset-assert 3) - (time light-time-state :inline :offset-assert 4) - (lightning lightning-state :inline :offset-assert 5) + ((light0 light-state :inline) + (light1 light-state :inline) + (light2 light-state :inline) + (light3 light-state :inline) + (time light-time-state :inline) + (lightning lightning-state :inline) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) @@ -1733,11 +1700,8 @@ ) (deftype firecanyon-states (structure) - ((lava lava-state :inline :offset-assert 0) + ((lava lava-state :inline) ) - :method-count-assert 9 - :size-assert #x12 - :flag-assert #x900000012 ) @@ -1755,12 +1719,9 @@ ) (deftype training-states (structure) - ((light light-state :inline :offset-assert 0) - (time light-time-state :inline :offset-assert 1) + ((light light-state :inline) + (time light-time-state :inline) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) @@ -1781,11 +1742,8 @@ ) (deftype maincave-states (structure) - ((flames flames-state :inline :offset-assert 0) + ((flames flames-state :inline) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -1889,11 +1847,8 @@ ) (deftype robocave-states (structure) - ((flames flames-state :inline :offset-assert 0) + ((flames flames-state :inline) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -1910,15 +1865,12 @@ ) (deftype snow-states (structure) - ((flames flames-state :inline :offset-assert 0) - (light light-state :inline :offset-assert 4) - (time light-time-state :inline :offset-assert 5) - (one-shot uint8 :offset-assert 6) - (interp float :offset-assert 8) + ((flames flames-state :inline) + (light light-state :inline) + (time light-time-state :inline) + (one-shot uint8) + (interp float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -1984,15 +1936,12 @@ ) (deftype village3-states (structure) - ((flames flames-state :inline :offset-assert 0) - (scale float :offset-assert 4) - (lava lava-state :inline :offset-assert 8) - (lava-time float :offset-assert 28) - (time uint8 :offset-assert 32) + ((flames flames-state :inline) + (scale float) + (lava lava-state :inline) + (lava-time float) + (time uint8) ) - :method-count-assert 9 - :size-assert #x21 - :flag-assert #x900000021 ) @@ -2196,13 +2145,10 @@ ) (deftype lavatube-states (structure) - ((lava lava-state :inline :offset-assert 0) - (light light-state :inline :offset-assert 18) - (time light-time-state :inline :offset-assert 19) + ((lava lava-state :inline) + (light light-state :inline) + (time light-time-state :inline) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -2226,14 +2172,11 @@ ) (deftype ogre-states (structure) - ((lava lava-state :inline :offset-assert 0) - (lightning lightning-state :inline :offset-assert 18) - (lava-time float :offset-assert 20) - (lava-fade float :offset-assert 24) + ((lava lava-state :inline) + (lightning lightning-state :inline) + (lava-time float) + (lava-fade float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) @@ -2419,12 +2362,9 @@ ) (deftype finalboss-states (structure) - ((start-time time-frame :offset-assert 0) - (secret-time time-frame :offset-assert 8) + ((start-time time-frame) + (secret-time time-frame) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -2598,16 +2538,13 @@ ) (deftype citadel-states (structure) - ((flames flames-state :inline :offset-assert 0) - (light light-state :inline :offset-assert 4) - (time light-time-state :inline :offset-assert 5) - (flicker-off uint8 :offset-assert 6) - (flicker-on uint8 :offset-assert 7) - (shield-fade float :offset-assert 8) + ((flames flames-state :inline) + (light light-state :inline) + (time light-time-state :inline) + (flicker-off uint8) + (flicker-on uint8) + (shield-fade float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) diff --git a/goal_src/jak1/engine/gfx/mood/time-of-day-h.gc b/goal_src/jak1/engine/gfx/mood/time-of-day-h.gc index 60ac78df76b..75629fc2870 100644 --- a/goal_src/jak1/engine/gfx/mood/time-of-day-h.gc +++ b/goal_src/jak1/engine/gfx/mood/time-of-day-h.gc @@ -19,25 +19,19 @@ ;; control time of day palette from outside the time of day system ;; (for example, the cave crystals and deadly water in LPC) (deftype palette-fade-control (structure) - ((trans vector :inline :offset-assert 0) - (fade float :offset-assert 16) - (actor-dist float :offset-assert 20) + ((trans vector :inline) + (fade float) + (actor-dist float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; group of 8 palette fade controls (deftype palette-fade-controls (basic) - ((control palette-fade-control 8 :inline :offset-assert 16) + ((control palette-fade-control 8 :inline) ) - :method-count-assert 11 - :size-assert #x110 - :flag-assert #xb00000110 (:methods - (reset! (_type_) symbol 9) - (set-fade! (_type_ int float float vector) object 10) + (reset! (_type_) symbol) + (set-fade! (_type_ int float float vector) object) ) ) @@ -47,29 +41,25 @@ ;; the time-of-day system runs a single process that just ticks time forward and controls ;; star/sun/moon/green-sun particle launch. (deftype time-of-day-proc (process) - ((year int32 :offset-assert 112) - (month int32 :offset-assert 116) - (week int32 :offset-assert 120) - (day int32 :offset-assert 124) - (hour int32 :offset-assert 128) - (minute int32 :offset-assert 132) - (second int32 :offset-assert 136) - (frame int32 :offset-assert 140) - (time-of-day float :offset-assert 144) - (time-ratio float :offset-assert 148) - (star-count int32 :offset-assert 152) - (stars sparticle-launch-control :offset-assert 156) - (sun-count int32 :offset-assert 160) - (sun sparticle-launch-control :offset-assert 164) - (green-sun-count int32 :offset-assert 168) - (green-sun sparticle-launch-control :offset-assert 172) - (moon-count int32 :offset-assert 176) - (moon sparticle-launch-control :offset-assert 180) + ((year int32) + (month int32) + (week int32) + (day int32) + (hour int32) + (minute int32) + (second int32) + (frame int32) + (time-of-day float) + (time-ratio float) + (star-count int32) + (stars sparticle-launch-control) + (sun-count int32) + (sun sparticle-launch-control) + (green-sun-count int32) + (green-sun sparticle-launch-control) + (moon-count int32) + (moon sparticle-launch-control) ) - :heap-base #x50 - :method-count-assert 14 - :size-assert #xb8 - :flag-assert #xe005000b8 (:states time-of-day-tick ) @@ -78,55 +68,46 @@ ;; a color palette that can be interpolated based on the time of day. ;; tie/tfrag/shrub all use these. (deftype time-of-day-palette (basic) - ((width int32 :offset-assert 4) - (height int32 :offset-assert 8) - (pad int32 :offset-assert 12) - (data int32 1 :offset-assert 16) + ((width int32) + (height int32) + (pad int32) + (data int32 1) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; all time of day state. (deftype time-of-day-context (basic) - ((active-count uint32 :offset-assert 4) - (interp float :offset-assert 8) - (current-interp float :offset-assert 12) - (moods mood-context 2 :offset-assert 16) - (current-fog mood-fog :inline :offset-assert 32) - (current-sun mood-sun :inline :offset-assert 80) - (current-prt-color vector :inline :offset-assert 112) - (current-shadow vector :inline :offset-assert 128) - (current-shadow-color vector :inline :offset-assert 144) - (light-group light-group 9 :inline :offset-assert 160) - (title-light-group light-group :inline :offset-assert 1888) - (time float :offset-assert 2080) - (target-interp float :offset-assert 2084) - (erase-color rgba :offset-assert 2088) - (num-stars float :offset-assert 2092) - (light-masks-0 uint8 2 :offset-assert 2096) - (light-masks-1 uint8 2 :offset-assert 2098) - (light-interp float 2 :offset-assert 2100) - (sky symbol :offset-assert 2108) - (sun-fade float :offset-assert 2112) - (title-updated symbol :offset-assert 2116) + ((active-count uint32) + (interp float) + (current-interp float) + (moods mood-context 2) + (current-fog mood-fog :inline) + (current-sun mood-sun :inline) + (current-prt-color vector :inline) + (current-shadow vector :inline) + (current-shadow-color vector :inline) + (light-group light-group 9 :inline) + (title-light-group light-group :inline) + (time float) + (target-interp float) + (erase-color rgba) + (num-stars float) + (light-masks-0 uint8 2) + (light-masks-1 uint8 2) + (light-interp float 2) + (sky symbol) + (sun-fade float) + (title-updated symbol) ) - :method-count-assert 9 - :size-assert #x848 - :flag-assert #x900000848 ) ;; dma memory layout for time of day palette interpolation (deftype time-of-day-dma (structure) - ((outa uint32 256 :offset-assert 0) - (outb uint32 256 :offset-assert 1024) - (banka uint32 256 :offset-assert 2048) - (bankb uint32 256 :offset-assert 3072) + ((outa uint32 256) + (outb uint32 256) + (banka uint32 256) + (bankb uint32 256) ) - :method-count-assert 9 - :size-assert #x1000 - :flag-assert #x900001000 ) ;; weird, either 8 (running) or 4 (not running) diff --git a/goal_src/jak1/engine/gfx/mood/time-of-day.gc b/goal_src/jak1/engine/gfx/mood/time-of-day.gc index a25a57df8c1..74159229eab 100644 --- a/goal_src/jak1/engine/gfx/mood/time-of-day.gc +++ b/goal_src/jak1/engine/gfx/mood/time-of-day.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod asize-of time-of-day-palette ((this time-of-day-palette)) +(defmethod asize-of ((this time-of-day-palette)) "Compute the size in memory of a time-of-day-palette" (the-as int (+ (-> this type size) (* (* (-> this height) (-> this width)) 4))) ) @@ -27,9 +27,9 @@ ;; spawn or kill stars, if needed. (cond ;; should have stars in the sky - ((and (or (>= (-> self hour) 19) (>= 5 (-> self hour))) ;; night time - (and (< 45.0 (-> *time-of-day-context* num-stars)) (-> *time-of-day-context* sky)) ;; sky + stars desired - ) + ((and (or (>= (-> self hour) 19) (>= 5 (-> self hour))) + (and (< 45.0 (-> *time-of-day-context* num-stars)) (-> *time-of-day-context* sky)) + ) ;; sky + stars desired ;; see if we need more (when (and *dproc* (< (-> self star-count) (the int (-> *time-of-day-context* num-stars)))) @@ -102,10 +102,8 @@ ;; State for just ticking time forward. (defstate time-of-day-tick (time-of-day-proc) - :code - (behavior () - (while #t - ;; tick! + :code (behavior () + (loop (+! (-> self frame) (the int (* (-> self time-ratio) (-> *display* time-adjust-ratio)))) ;; now update time... @@ -158,7 +156,6 @@ ) ) ) - ;; set the time of day float. This is in hours (0-24) (let* ((f0-4 (the float (-> self frame))) (f0-6 (+ (* 0.0033333334 f0-4) (the float (-> self second)))) @@ -170,7 +167,6 @@ ) (suspend) ) - (none) ) :post time-of-day-update ) @@ -254,8 +250,8 @@ ; ;; TODO ; (none) ; ) -(def-mips2c time-of-day-interp-colors-scratch (function (pointer rgba) time-of-day-palette mood-context none)) +(def-mips2c time-of-day-interp-colors-scratch (function (pointer rgba) time-of-day-palette mood-context none)) (defun init-time-of-day-context ((arg0 time-of-day-context)) "Set up the title-light-group." @@ -265,7 +261,8 @@ (set! (-> arg0 title-light-group dir0 levels x) 1.0) (set! (-> arg0 title-light-group dir1 levels x) 1.0) (set! (-> arg0 title-light-group ambi levels x) 1.0) - (none)) + (none) + ) (defun update-time-of-day ((arg0 time-of-day-context)) "Update the time of day context" @@ -278,6 +275,7 @@ (set! (-> *target* draw light-index) (the-as uint 0)) (when (-> *target* sidekick) (set! (-> *target* sidekick 0 draw light-index) (the-as uint 0)) + 0 ) ) @@ -298,7 +296,6 @@ (set! (-> s4-0 0) 0.0) (set! (-> s4-0 1) 0.0) 0.0 - (let ((s5-0 0) (f30-0 (-> arg0 current-interp)) ) @@ -339,7 +336,7 @@ 0.0 ) ((= f0-6 4095996000.0) - ;; first level is no good, just use second. + ;; first level is no good, just use second 1.0 ) ((= f0-6 f1-0) @@ -352,13 +349,13 @@ (= (-> *level* level0 name) 'village2) (= (-> *level* level1 name) 'sunken) ) - 0.0 ;; picks 0 = village2 + 0.0 ;; picks 0 = village2 ) ((and (< 0.0 (-> *math-camera* trans y)) (= (-> *level* level0 name) 'sunken) (= (-> *level* level1 name) 'village2) ) - 1.0 ;; picks 1 = village 2 + 1.0 ;; picks 1 = village2 ) (else ;; interplate between them. @@ -436,7 +433,11 @@ (set! (-> arg0 current-shadow quad) (-> arg0 moods 0 current-shadow quad)) (set! (-> arg0 current-shadow-color quad) (-> arg0 moods 0 current-shadow-color quad)) (dotimes (s4-1 8) - (quad-copy! (the-as pointer (-> arg0 light-group s4-1)) (the-as pointer (-> arg0 moods 0 light-group s4-1)) 12) + (quad-copy! + (the-as pointer (-> arg0 light-group s4-1)) + (the-as pointer (-> arg0 moods 0 light-group s4-1)) + 12 + ) ) (set! (-> arg0 num-stars) (-> arg0 moods 0 num-stars)) (set! (-> arg0 sun-fade) (-> *level* level0 info sun-fade)) @@ -454,7 +455,11 @@ (set! (-> arg0 current-shadow quad) (-> arg0 moods 1 current-shadow quad)) (set! (-> arg0 current-shadow-color quad) (-> arg0 moods 1 current-shadow-color quad)) (dotimes (s4-2 8) - (quad-copy! (the-as pointer (-> arg0 light-group s4-2)) (the-as pointer (-> arg0 moods 1 light-group s4-2)) 12) + (quad-copy! + (the-as pointer (-> arg0 light-group s4-2)) + (the-as pointer (-> arg0 moods 1 light-group s4-2)) + 12 + ) ) (set! (-> arg0 num-stars) (-> arg0 moods 1 num-stars)) (set! (-> arg0 sun-fade) (-> *level* level1 info sun-fade)) @@ -470,16 +475,36 @@ (vector4-lerp! (-> s5-1 fog-dists) (-> s4-3 fog-dists) (-> s3-1 fog-dists) f30-0) (vector4-lerp! (-> s5-1 erase-color) (-> s4-3 erase-color) (-> s3-1 erase-color) f30-0) ) - (vector4-lerp! (-> arg0 current-prt-color) (-> arg0 moods 0 current-prt-color) (-> arg0 moods 1 current-prt-color) f30-0) + (vector4-lerp! + (-> arg0 current-prt-color) + (-> arg0 moods 0 current-prt-color) + (-> arg0 moods 1 current-prt-color) + f30-0 + ) (vector4-lerp! (the-as vector (-> arg0 current-sun)) (the-as vector (-> arg0 moods 0 current-sun)) (the-as vector (-> arg0 moods 1 current-sun)) f30-0 ) - (vector4-lerp! (-> arg0 current-sun env-color) (-> arg0 moods 0 current-sun env-color) (-> arg0 moods 1 current-sun env-color) f30-0) - (vector4-lerp! (-> arg0 current-shadow) (-> arg0 moods 0 current-shadow) (-> arg0 moods 1 current-shadow) f30-0) - (vector4-lerp! (-> arg0 current-shadow-color) (-> arg0 moods 0 current-shadow-color) (-> arg0 moods 1 current-shadow-color) f30-0) + (vector4-lerp! + (-> arg0 current-sun env-color) + (-> arg0 moods 0 current-sun env-color) + (-> arg0 moods 1 current-sun env-color) + f30-0 + ) + (vector4-lerp! + (-> arg0 current-shadow) + (-> arg0 moods 0 current-shadow) + (-> arg0 moods 1 current-shadow) + f30-0 + ) + (vector4-lerp! + (-> arg0 current-shadow-color) + (-> arg0 moods 0 current-shadow-color) + (-> arg0 moods 1 current-shadow-color) + f30-0 + ) (dotimes (s4-4 8) (dotimes (s3-2 3) (let ((s2-1 (+ (+ (* 48 s3-2) 156 (* 192 s4-4)) (the-as int arg0)))) @@ -502,13 +527,15 @@ (vector4-lerp! (the-as vector (+ s3-3 32)) (the-as vector (+ s2-2 32)) (the-as vector (+ s1-1 32)) f30-0) ) ) - (set! (-> arg0 num-stars) (+ (-> arg0 moods 0 num-stars) (* (- (-> arg0 moods 1 num-stars) (-> arg0 moods 0 num-stars)) f30-0))) + (set! (-> arg0 num-stars) + (+ (-> arg0 moods 0 num-stars) (* (- (-> arg0 moods 1 num-stars) (-> arg0 moods 0 num-stars)) f30-0)) + ) (let ((f0-20 (-> *level* level0 info sun-fade))) (set! (-> arg0 sun-fade) (+ f0-20 (* f30-0 (- (-> *level* level1 info sun-fade) f0-20)))) ) ) ) - + ;; setup sky stuff (dotimes (s4-5 2) (make-sky-textures arg0 s4-5) @@ -532,7 +559,6 @@ (set! (-> arg0 current-sun env-color y) (* 0.5019608 (-> arg0 current-sun env-color y))) (set! (-> arg0 current-sun env-color z) (* 0.5019608 (-> arg0 current-sun env-color z))) (set! (-> arg0 current-sun env-color w) (* 0.5019608 (-> arg0 current-sun env-color w))) - (let ((v1-179 (-> arg0 current-fog))) (set! *fog-color* (new 'static 'rgba :r (the int (-> v1-179 fog-color x)) @@ -543,19 +569,13 @@ ) (let ((v1-184 (-> arg0 current-fog erase-color))) (set! (-> arg0 erase-color) - (new 'static 'rgba - :a #x80 - :b (the int (-> v1-184 z)) - :g (the int (-> v1-184 y)) - :r (the int (-> v1-184 x)) - ) + (new 'static 'rgba :a #x80 :b (the int (-> v1-184 z)) :g (the int (-> v1-184 y)) :r (the int (-> v1-184 x))) ) ) (set! (-> *math-camera* fog-start) (-> arg0 current-fog fog-dists x)) (set! (-> *math-camera* fog-end) (-> arg0 current-fog fog-dists y)) (set! (-> *math-camera* fog-max) (-> arg0 current-fog fog-dists z)) (set! (-> *math-camera* fog-min) (-> arg0 current-fog fog-dists w)) - ;; interp target lights. (note: added check here.) (let* ((v1-195 (if *target* (-> *target* draw light-index) 0)) (f30-1 (-> arg0 target-interp)) @@ -616,13 +636,12 @@ (vector-normalize! (-> arg0 current-shadow) 1.0) ) ) - (reset! *palette-fade-controls*) 0 (none) ) -(defmethod set-fade! palette-fade-controls ((this palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) +(defmethod set-fade! ((this palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) (cond ((and (>= arg0 0) (< arg0 8)) (let ((v1-3 (-> this control arg0))) @@ -631,10 +650,7 @@ (set! (-> v1-3 trans quad) (-> arg3 quad)) ) (set! (-> v1-3 fade) (fmax 0.0 (fmin 1.993 arg1))) - (let ((f0-3 arg2)) - (set! (-> v1-3 actor-dist) f0-3) - f0-3 - ) + (set! (-> v1-3 actor-dist) arg2) ) ) ) @@ -644,16 +660,16 @@ ) ) -(defmethod reset! palette-fade-controls ((this palette-fade-controls)) +(defmethod reset! ((this palette-fade-controls)) (countdown (v1-0 8) - (let ((a1-2 (-> this control v1-0))) - (set! (-> a1-2 fade) 0.0) - (set! (-> a1-2 actor-dist) 4096000000.0) + (let ((a1-2 (-> this control v1-0))) + (set! (-> a1-2 fade) 0.0) + (set! (-> a1-2 actor-dist) 4096000000.0) + ) ) - ) #f ) ;; start the time of day process!! -(start-time-of-day) \ No newline at end of file +(start-time-of-day) diff --git a/goal_src/jak1/engine/gfx/ocean/ocean-h.gc b/goal_src/jak1/engine/gfx/ocean/ocean-h.gc index 00ecb8ce692..aae532856f4 100644 --- a/goal_src/jak1/engine/gfx/ocean/ocean-h.gc +++ b/goal_src/jak1/engine/gfx/ocean/ocean-h.gc @@ -21,219 +21,179 @@ ;; DECOMP BEGINS (deftype ocean-corner (structure) - ((bsphere sphere :inline :offset-assert 0) - (start-corner vector :inline :offset-assert 16) - (y-scales vector :inline :offset-assert 32) - (alphas vector :inline :offset-assert 48) - (colors uint32 4 :offset-assert 64) + ((bsphere sphere :inline) + (start-corner vector :inline) + (y-scales vector :inline) + (alphas vector :inline) + (colors uint32 4) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) + (deftype ocean-wave-info (structure) - ((frequency float :offset-assert 0) - (amplitude float :offset-assert 4) - (wave-speed float :offset-assert 8) - (angle float :offset-assert 12) - (kx float :offset-assert 16) - (ky float :offset-assert 20) - (w float :offset-assert 24) - (flags int32 :offset-assert 28) + ((frequency float) + (amplitude float) + (wave-speed float) + (angle float) + (kx float) + (ky float) + (w float) + (flags int32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype ocean-vertex (structure) - ((pos vector :inline :offset-assert 0) - (stq vector :inline :offset-assert 16) - (col vector :inline :offset-assert 32) + ((pos vector :inline) + (stq vector :inline) + (col vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype ocean-spheres (structure) - ((spheres sphere 36 :inline :offset-assert 0) + ((spheres sphere 36 :inline) ) - :method-count-assert 9 - :size-assert #x240 - :flag-assert #x900000240 ) + (deftype ocean-colors (structure) - ((colors rgba 2548 :offset-assert 0) + ((colors rgba 2548) ) - :method-count-assert 9 - :size-assert #x27d0 - :flag-assert #x9000027d0 ) + (deftype ocean-mid-mask (structure) - ((mask uint8 8 :offset-assert 0) - (dword uint64 :offset 0) + ((mask uint8 8) + (dword uint64 :overlay-at (-> mask 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype ocean-mid-indices (basic) - ((data uint16 36 :offset-assert 4) + ((data uint16 36) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) + (deftype ocean-mid-masks (basic) - ((data (inline-array ocean-mid-mask) :offset-assert 4) + ((data (inline-array ocean-mid-mask)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype ocean-trans-mask (structure) - ((mask uint8 4 :offset-assert 0) - (word uint64 :offset 0) + ((mask uint8 4) + (word uint64 :overlay-at (-> mask 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype ocean-trans-index (structure) - ((parent int16 :offset-assert 0) - (child int16 :offset-assert 2) + ((parent int16) + (child int16) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) + (deftype ocean-trans-indices (basic) - ((data ocean-trans-index 2304 :inline :offset-assert 4) + ((data ocean-trans-index 2304 :inline) ) - :method-count-assert 9 - :size-assert #x2404 - :flag-assert #x900002404 ) + (deftype ocean-near-index (structure) - ((data uint16 16 :offset-assert 0) + ((data uint16 16) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype ocean-near-indices (basic) - ((data (inline-array ocean-near-index) :offset-assert 4) + ((data (inline-array ocean-near-index)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype ocean-near-colors (structure) - ((color0 vector :inline :offset-assert 0) - (color1 vector :inline :offset-assert 16) - (color2 vector :inline :offset-assert 32) - (color3 vector :inline :offset-assert 48) + ((color0 vector :inline) + (color1 vector :inline) + (color2 vector :inline) + (color3 vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) + (deftype ocean-map (basic) - ((start-corner vector :inline :offset-assert 16) - (far-color vector :inline :offset-assert 32) - (ocean-spheres ocean-spheres :offset-assert 48) - (ocean-colors ocean-colors :offset-assert 52) - (ocean-mid-indices ocean-mid-indices :offset-assert 56) - (ocean-trans-indices ocean-trans-indices :offset-assert 60) - (ocean-near-indices ocean-near-indices :offset-assert 64) - (ocean-mid-masks ocean-mid-masks :offset-assert 68) + ((start-corner vector :inline) + (far-color vector :inline) + (ocean-spheres ocean-spheres) + (ocean-colors ocean-colors) + (ocean-mid-indices ocean-mid-indices) + (ocean-trans-indices ocean-trans-indices) + (ocean-near-indices ocean-near-indices) + (ocean-mid-masks ocean-mid-masks) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) + (deftype ocean-trans-strip (structure) - ((verts uint128 10 :offset-assert 0) + ((verts uint128 10) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) + (deftype ocean-trans-strip-array (structure) - ((data ocean-trans-strip 4 :inline :offset-assert 0) + ((data ocean-trans-strip 4 :inline) ) - :method-count-assert 9 - :size-assert #x280 - :flag-assert #x900000280 ) + (deftype ocean-wave-data (structure) - ((data uint8 1024 :offset-assert 0) + ((data uint8 1024) ) - :method-count-assert 9 - :size-assert #x400 - :flag-assert #x900000400 ) + (deftype ocean-wave-frames (structure) - ((frame ocean-wave-data 64 :inline :offset-assert 0) + ((frame ocean-wave-data 64 :inline) ) - :method-count-assert 9 - :size-assert #x10000 - ;:flag-assert #x900010000 ) + (deftype ocean-work (basic) - ((deltas vector :inline :offset-assert 16) - (map-min vector :inline :offset-assert 32) - (map-max vector :inline :offset-assert 48) - (interp vector :inline :offset-assert 64) - (corner-array ocean-corner 25 :inline :offset-assert 80) - (corner-count int32 :offset-assert 2080) - (temp-vecs vector 4 :inline :offset-assert 2096) - (mid-mask-ptrs (pointer int64) 36 :offset-assert 2160) - (mid-camera-masks uint64 36 :offset-assert 2304) - (trans-mask-ptrs (pointer int32) 64 :offset-assert 2592) - (trans-camera-masks ocean-trans-mask 16 :inline :offset-assert 2848) - (trans-temp-masks ocean-trans-mask 16 :inline :offset-assert 2976) - (near-mask-indices uint16 16 :offset-assert 3104) - (mid-minx uint8 :offset-assert 3136) - (mid-maxx uint8 :offset-assert 3137) - (mid-minz uint8 :offset-assert 3138) - (mid-maxz uint8 :offset-assert 3139) - (near-minx uint8 :offset-assert 3140) - (near-maxx uint8 :offset-assert 3141) - (near-minz uint8 :offset-assert 3142) - (near-maxz uint8 :offset-assert 3143) - (temp-minx uint8 :offset-assert 3144) - (temp-maxx uint8 :offset-assert 3145) - (temp-minz uint8 :offset-assert 3146) - (temp-maxz uint8 :offset-assert 3147) - ) - :method-count-assert 9 - :size-assert #xc4c - :flag-assert #x900000c4c + ((deltas vector :inline) + (map-min vector :inline) + (map-max vector :inline) + (interp vector :inline) + (corner-array ocean-corner 25 :inline) + (corner-count int32) + (temp-vecs vector 4 :inline) + (mid-mask-ptrs (pointer int64) 36) + (mid-camera-masks uint64 36) + (trans-mask-ptrs (pointer int32) 64) + (trans-camera-masks ocean-trans-mask 16 :inline) + (trans-temp-masks ocean-trans-mask 16 :inline) + (near-mask-indices uint16 16) + (mid-minx uint8) + (mid-maxx uint8) + (mid-minz uint8) + (mid-maxz uint8) + (near-minx uint8) + (near-maxx uint8) + (near-minz uint8) + (near-maxz uint8) + (temp-minx uint8) + (temp-maxx uint8) + (temp-minz uint8) + (temp-maxz uint8) + ) ) + (define *ocean-work* (new 'static 'ocean-work)) (define *ocean-facing* 0) (define *ocean-off* #f) @@ -243,188 +203,162 @@ (define *ocean-verts* (the-as (inline-array vector) #f)) (deftype ocean-vu0-work (structure) - ((scales vector :inline :offset-assert 0) - (mask-hi vector4w :inline :offset-assert 16) - (mask-lo vector4w :inline :offset-assert 32) - (lights vu-lights :inline :offset-assert 48) - (wait-to-vu0 uint32 :offset-assert 160) + ((scales vector :inline) + (mask-hi vector4w :inline) + (mask-lo vector4w :inline) + (lights vu-lights :inline) + (wait-to-vu0 uint32) ) - :method-count-assert 9 - :size-assert #xa4 - :flag-assert #x9000000a4 ) + (deftype ocean-texture-constants (structure) - ((giftag gs-gif-tag :inline :offset-assert 0) - (buffers vector4w :inline :offset-assert 16) - (dests vector4w :inline :offset-assert 32) - (start vector :inline :offset-assert 48) - (offsets vector :inline :offset-assert 64) - (constants vector :inline :offset-assert 80) - (cam-nrm vector :inline :offset-assert 96) + ((giftag gs-gif-tag :inline) + (buffers vector4w :inline) + (dests vector4w :inline) + (start vector :inline) + (offsets vector :inline) + (constants vector :inline) + (cam-nrm vector :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) + (deftype ocean-texture-work (structure) - ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) - (sprite-tmpl2 dma-gif-packet :inline :offset-assert 32) - (adgif-tmpl dma-gif-packet :inline :offset-assert 64) + ((sprite-tmpl dma-gif-packet :inline) + (sprite-tmpl2 dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) + (deftype ocean-mid-vertex (structure) - ((stq vector :inline :offset-assert 0) - (col vector :inline :offset-assert 16) - (pos vector :inline :offset-assert 32) + ((stq vector :inline) + (col vector :inline) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype ocean-mid-constants (structure) - ((hmge-scale vector :inline :offset-assert 0) - (inv-hmge-scale vector :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (fog vector :inline :offset-assert 48) - (constants vector :inline :offset-assert 64) - (constants2 vector :inline :offset-assert 80) - (drw-fan gs-gif-tag :inline :offset-assert 96) ;; was qword - (env-fan gs-gif-tag :inline :offset-assert 112) ;; was qword - (drw-adgif gs-gif-tag :inline :offset-assert 128);; was qword - (drw-texture adgif-shader :inline :offset-assert 144) - (drw-strip-0 gs-gif-tag :inline :offset-assert 224) ;; was qword - (drw-strip-1 gs-gif-tag :inline :offset-assert 240) ;; was qword - (env-adgif gs-gif-tag :inline :offset-assert 256) ;; was qword - (env-texture adgif-shader :inline :offset-assert 272) - (env-strip gs-gif-tag :inline :offset-assert 352) ;; was qword - (env-color vector :inline :offset-assert 368) - (index-table vector4w 8 :inline :offset-assert 384) - (pos0 vector :inline :offset-assert 512) - (pos1 vector :inline :offset-assert 528) - (pos2 vector :inline :offset-assert 544) - (pos3 vector :inline :offset-assert 560) - ) - :method-count-assert 9 - :size-assert #x240 - :flag-assert #x900000240 + ((hmge-scale vector :inline) + (inv-hmge-scale vector :inline) + (hvdf-offset vector :inline) + (fog vector :inline) + (constants vector :inline) + (constants2 vector :inline) + (drw-fan gs-gif-tag :inline) + (env-fan gs-gif-tag :inline) + (drw-adgif gs-gif-tag :inline) + (drw-texture adgif-shader :inline) + (drw-strip-0 gs-gif-tag :inline) + (drw-strip-1 gs-gif-tag :inline) + (env-adgif gs-gif-tag :inline) + (env-texture adgif-shader :inline) + (env-strip gs-gif-tag :inline) + (env-color vector :inline) + (index-table vector4w 8 :inline) + (pos0 vector :inline) + (pos1 vector :inline) + (pos2 vector :inline) + (pos3 vector :inline) + ) ) + (deftype ocean-mid-upload (structure) - ((rot matrix :inline :offset-assert 0) - (matrix matrix :inline :offset-assert 64) - (colors uint128 108 :offset-assert 128) - (masks uint128 2 :offset-assert 1856) + ((rot matrix :inline) + (matrix matrix :inline) + (colors uint128 108) + (masks uint128 2) ) - :method-count-assert 9 - :size-assert #x760 - :flag-assert #x900000760 ) + (deftype ocean-mid-upload2 (structure) - ((rot matrix :inline :offset-assert 0) - (matrix matrix :inline :offset-assert 64) - (count vector4w :inline :offset-assert 128) - (tex0 vector :inline :offset-assert 144) - (tex1 vector :inline :offset-assert 160) - (tex2 vector :inline :offset-assert 176) - (tex3 vector :inline :offset-assert 192) - (clr0 vector :inline :offset-assert 208) - (clr1 vector :inline :offset-assert 224) - (clr2 vector :inline :offset-assert 240) - (clr3 vector :inline :offset-assert 256) - (verts uint128 18 :offset-assert 272) - ) - :method-count-assert 9 - :size-assert #x230 - :flag-assert #x900000230 + ((rot matrix :inline) + (matrix matrix :inline) + (count vector4w :inline) + (tex0 vector :inline) + (tex1 vector :inline) + (tex2 vector :inline) + (tex3 vector :inline) + (clr0 vector :inline) + (clr1 vector :inline) + (clr2 vector :inline) + (clr3 vector :inline) + (verts uint128 18) + ) ) + (deftype ocean-mid-work (structure) - ((env0 vector :inline :offset-assert 0) - (env1 vector :inline :offset-assert 16) - (env2 vector :inline :offset-assert 32) - (hmg0 vector :inline :offset-assert 48) - (hmg1 vector :inline :offset-assert 64) - (hmg2 vector :inline :offset-assert 80) - (indices uint128 16 :offset-assert 96) + ((env0 vector :inline) + (env1 vector :inline) + (env2 vector :inline) + (hmg0 vector :inline) + (hmg1 vector :inline) + (hmg2 vector :inline) + (indices uint128 16) ) - :method-count-assert 9 - :size-assert #x160 - :flag-assert #x900000160 ) + (deftype ocean-near-constants (structure) - ((hmge-scale vector :inline :offset-assert 0) - (inv-hmge-scale vector :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (fog vector :inline :offset-assert 48) - (constants vector :inline :offset-assert 64) - (constants2 vector :inline :offset-assert 80) - (constants3 vector :inline :offset-assert 96) - (constants4 vector :inline :offset-assert 112) - (drw-fan gs-gif-tag :inline :offset-assert 128) ;; was qword - (drw2-fan gs-gif-tag :inline :offset-assert 144) ;; was qword - (env-fan gs-gif-tag :inline :offset-assert 160) ;; was qword - (drw-adgif gs-gif-tag :inline :offset-assert 176) ;; was qword - (drw-texture adgif-shader :inline :offset-assert 192) - (drw-strip gs-gif-tag :inline :offset-assert 272) ;; was qword - (env-adgif gs-gif-tag :inline :offset-assert 288) ;; was qword - (env-texture adgif-shader :inline :offset-assert 304) ;; was qword - (env-strip gs-gif-tag :inline :offset-assert 384) - (env-color vector :inline :offset-assert 400) - (drw2-adgif gs-gif-tag :inline :offset-assert 416) - (drw2-tex0 qword :inline :offset-assert 432) - (drw2-frame qword :inline :offset-assert 448) - (drw2-strip gs-gif-tag :inline :offset-assert 464) - (drw3-adgif gs-gif-tag :inline :offset-assert 480) - (drw3-frame qword :inline :offset-assert 496) - (index-table vector4w 4 :inline :offset-assert 512) - ) - :method-count-assert 9 - :size-assert #x240 - :flag-assert #x900000240 + ((hmge-scale vector :inline) + (inv-hmge-scale vector :inline) + (hvdf-offset vector :inline) + (fog vector :inline) + (constants vector :inline) + (constants2 vector :inline) + (constants3 vector :inline) + (constants4 vector :inline) + (drw-fan gs-gif-tag :inline) + (drw2-fan gs-gif-tag :inline) + (env-fan gs-gif-tag :inline) + (drw-adgif gs-gif-tag :inline) + (drw-texture adgif-shader :inline) + (drw-strip gs-gif-tag :inline) + (env-adgif gs-gif-tag :inline) + (env-texture adgif-shader :inline) + (env-strip gs-gif-tag :inline) + (env-color vector :inline) + (drw2-adgif gs-gif-tag :inline) + (drw2-tex0 qword :inline) + (drw2-frame qword :inline) + (drw2-strip gs-gif-tag :inline) + (drw3-adgif gs-gif-tag :inline) + (drw3-frame qword :inline) + (index-table vector4w 4 :inline) + ) ) + (deftype ocean-near-upload (structure) - ((rot matrix :inline :offset-assert 0) - (matrix matrix :inline :offset-assert 64) - (masks uint128 2 :offset-assert 128) - (start-height vector4w :inline :offset-assert 160) - (start-st vector :inline :offset-assert 176) - (near-colors ocean-near-colors :inline :offset-assert 192) + ((rot matrix :inline) + (matrix matrix :inline) + (masks uint128 2) + (start-height vector4w :inline) + (start-st vector :inline) + (near-colors ocean-near-colors :inline) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) (deftype ocean-near-vertex (structure) - ((stq vector :inline :offset-assert 0) - (clr vector :inline :offset-assert 16) - (pos vector :inline :offset-assert 32) + ((stq vector :inline) + (clr vector :inline) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype ocean-near-work (structure) - ((verts-ptr vector :inline :offset-assert 0) - (indices uint128 16 :offset-assert 16) + ((verts-ptr vector :inline) + (indices uint128 16) ) - :method-count-assert 9 - :size-assert #x110 - :flag-assert #x900000110 ) (define-extern *ocean-trans-corner-table* (inline-array vector4w-2)) (define-extern ocean-interp-wave (function ocean-wave-info uint none)) -(define-extern ocean-generate-verts (function (inline-array vector) ocean-wave-info none)) \ No newline at end of file +(define-extern ocean-generate-verts (function (inline-array vector) ocean-wave-info none)) diff --git a/goal_src/jak1/engine/gfx/shadow/shadow-cpu-h.gc b/goal_src/jak1/engine/gfx/shadow/shadow-cpu-h.gc index 0a3ae212694..8fbbf38515e 100644 --- a/goal_src/jak1/engine/gfx/shadow/shadow-cpu-h.gc +++ b/goal_src/jak1/engine/gfx/shadow/shadow-cpu-h.gc @@ -24,38 +24,32 @@ ;; settings computed by the user, consumed by the shadow renderer (deftype shadow-settings (structure) - ((center vector :inline :offset-assert 0) ;; unused? - (flags shadow-flags :offset 12) ;; used to disable, most other flags do nothing? - (shadow-dir vector :inline :offset-assert 16) - (dist-to-locus float :offset 28) - (bot-plane plane :inline :offset-assert 32) ;; volume clip plane - (top-plane plane :inline :offset-assert 48) - (fade-dist float :offset-assert 64) ;; if past this, stop drawing shadow - (fade-start float :offset-assert 68) ;; distance where fadeout starts - (dummy-2 int32 :offset-assert 72) - (dummy-3 int32 :offset-assert 76) - (fade-vec vector :inline :offset 64) ;; added + ((center vector :inline) ;; unused? + (flags shadow-flags :overlay-at (-> center w)) ;; used to disable, most other flags do nothing? + (shadow-dir vector :inline) + (dist-to-locus float :overlay-at (-> shadow-dir w)) + (bot-plane plane :inline) ;; volume clip plane + (top-plane plane :inline) + (fade-dist float) ;; if past this, stop drawing shadow + (fade-start float) ;; distance where fadeout starts + (dummy-2 int32) + (dummy-3 int32) + (fade-vec vector :inline :overlay-at fade-dist) ;; added ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype shadow-control (basic) - ((settings shadow-settings :inline :offset-assert 16) + ((settings shadow-settings :inline) ) - :method-count-assert 16 - :size-assert #x60 - :flag-assert #x1000000060 (:methods - (new (symbol type float float float float float) _type_ 0) - (clear-offset-bit (shadow-control) int 9) - (set-offset-bit (shadow-control) int 10) - (set-top-plane-offset (shadow-control float) int 11) - (set-bottom-plane-offset (shadow-control float) int 12) - (unused-13 (_type_) none 13) - (update-direction-from-time-of-day (_type_) none 14) - (collide-to-find-planes (_type_ vector float float float) none 15) + (new (symbol type float float float float float) _type_) + (clear-offset-bit (shadow-control) int) + (set-offset-bit (shadow-control) int) + (set-top-plane-offset (shadow-control float) int) + (set-bottom-plane-offset (shadow-control float) int) + (unused-13 (_type_) none) + (update-direction-from-time-of-day (_type_) none) + (collide-to-find-planes (_type_ vector float float float) none) ) ) @@ -89,50 +83,38 @@ ) (deftype shadow-data (structure) - ((texoffset vector :inline :offset-assert 0) - (texscale vector :inline :offset-assert 16) - (clrs vector 2 :inline :offset-assert 32) - (dma-unpack-template dma-packet :inline :offset-assert 64) - (dma-cnt dma-tag :offset-assert 80) - (vif-nop vif-tag :offset-assert 88) - (vif-unpack-v4-8 vif-tag :offset-assert 92) - (pdc basic :offset-assert 96) - (dist float :offset-assert 100) - (oddeven uint8 :offset-assert 104) - (waits uint32 :offset-assert 108) + ((texoffset vector :inline) + (texscale vector :inline) + (clrs vector 2 :inline) + (dma-unpack-template dma-packet :inline) + (dma-cnt dma-tag) + (vif-nop vif-tag) + (vif-unpack-v4-8 vif-tag) + (pdc basic) + (dist float) + (oddeven uint8) + (waits uint32) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) (deftype shadow-work (structure) - ((shadow-data shadow-data :inline :offset-assert 0) - (inbuf uint128 600 :offset-assert 112) + ((shadow-data shadow-data :inline) + (inbuf uint128 600) ) - :method-count-assert 9 - :size-assert #x25f0 - :flag-assert #x9000025f0 ) (deftype shadow-run (structure) - ((first dma-packet :offset-assert 0) - (next (pointer dma-packet) :offset-assert 4) + ((first dma-packet) + (next (pointer dma-packet)) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype shadow-queue (structure) - ((num-runs uint32 :offset-assert 0) - (cur-run uint32 :offset-assert 4) - (run shadow-run 15 :inline :offset-assert 8) + ((num-runs uint32) + (cur-run uint32) + (run shadow-run 15 :inline) ) - :method-count-assert 9 - :size-assert #xf8 - :flag-assert #x9000000f8 ) (defun shadow-queue-append ((arg0 shadow-queue)) @@ -148,23 +130,17 @@ (define *shadow-queue* (new 'global 'shadow-queue)) (deftype shadow-vertex (structure) - ((x float :offset-assert 0) - (y float :offset-assert 4) - (z float :offset-assert 8) - (weight float :offset-assert 12) + ((x float) + (y float) + (z float) + (weight float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype shadow-matrix-ref (structure) - ((joint-0 uint8 :offset-assert 0) - (joint-1 uint8 :offset-assert 1) + ((joint-0 uint8) + (joint-1 uint8) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; og:preserve-this @@ -187,56 +163,44 @@ |# (deftype shadow-tri (structure) - ((ind-0 uint8 :offset-assert 0) - (ind-1 uint8 :offset-assert 1) - (ind-2 uint8 :offset-assert 2) - (faces uint8 :offset-assert 3) + ((ind-0 uint8) + (ind-1 uint8) + (ind-2 uint8) + (faces uint8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype shadow-edge (structure) - ((ind-0 uint8 :offset-assert 0) - (ind-1 uint8 :offset-assert 1) - (tri-0 uint8 :offset-assert 2) - (tri-1 uint8 :offset-assert 3) + ((ind-0 uint8) + (ind-1 uint8) + (tri-0 uint8) + (tri-1 uint8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype shadow-header (structure) - ((qwc-data uint32 :offset-assert 0) - (num-joints uint32 :offset-assert 4) - (num-verts uint16 :offset-assert 8) - (num-twos uint16 :offset-assert 10) - (num-single-tris uint16 :offset-assert 12) - (num-single-edges uint16 :offset-assert 14) - (num-double-tris uint16 :offset-assert 16) - (num-double-edges uint16 :offset-assert 18) - (ofs-verts uint32 :offset-assert 20) - (ofs-refs uint32 :offset-assert 24) - (ofs-single-tris uint32 :offset-assert 28) - (ofs-single-edges uint32 :offset-assert 32) - (ofs-double-tris uint32 :offset-assert 36) - (ofs-double-edges uint32 :offset-assert 40) + ((qwc-data uint32) + (num-joints uint32) + (num-verts uint16) + (num-twos uint16) + (num-single-tris uint16) + (num-single-edges uint16) + (num-double-tris uint16) + (num-double-edges uint16) + (ofs-verts uint32) + (ofs-refs uint32) + (ofs-single-tris uint32) + (ofs-single-edges uint32) + (ofs-double-tris uint32) + (ofs-double-edges uint32) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) (deftype shadow-geo (art-element) - ((total-size uint32 :offset-assert 32) - (header shadow-header :inline :offset 32) - (rest uint64 :dynamic :offset-assert 80) + ((total-size uint32) + (header shadow-header :inline :overlay-at total-size) + (rest uint64 :dynamic) ) - :method-count-assert 13 - :size-assert #x50 - :flag-assert #xd00000050 ) (defmethod new shadow-control ((allocation symbol) (type-to-make type) (bottom-offset float) (top-offset float) (dir float) (center float) (fade float)) diff --git a/goal_src/jak1/engine/gfx/shadow/shadow-h.gc b/goal_src/jak1/engine/gfx/shadow/shadow-h.gc index 4e9652e3534..2067fc74fed 100644 --- a/goal_src/jak1/engine/gfx/shadow/shadow-h.gc +++ b/goal_src/jak1/engine/gfx/shadow/shadow-h.gc @@ -8,34 +8,28 @@ ;; DECOMP BEGINS (deftype fake-shadow (structure) - ((px float :offset-assert 0) - (py float :offset-assert 4) - (pz float :offset-assert 8) - (scale float :offset-assert 12) - (qx float :offset-assert 16) - (qy float :offset-assert 20) - (qz float :offset-assert 24) - (flags int32 :offset-assert 28) + ((px float) + (py float) + (pz float) + (scale float) + (qx float) + (qy float) + (qz float) + (flags int32) ) :pack-me - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype fake-shadow-buffer (basic) - ((num-shadows int32 :offset-assert 4) - (data fake-shadow 32 :inline :offset-assert 8) + ((num-shadows int32) + (data fake-shadow 32 :inline) ) - :method-count-assert 9 - :size-assert #x408 - :flag-assert #x900000408 ) + (define *fake-shadow-buffer-1* (new 'global 'fake-shadow-buffer)) (define *fake-shadow-buffer-2* (new 'global 'fake-shadow-buffer)) (define *fake-shadow-buffer* *fake-shadow-buffer-1*) - (define-extern swap-fake-shadow-buffers (function none)) - -(define-extern find-ground-and-draw-shadow (function vector vector float collide-kind process-drawable float float none)) \ No newline at end of file +(define-extern find-ground-and-draw-shadow (function vector vector float collide-kind process-drawable float float none)) diff --git a/goal_src/jak1/engine/gfx/shadow/shadow-vu1.gc b/goal_src/jak1/engine/gfx/shadow/shadow-vu1.gc index cd9d109c8fa..b60b6d4cec8 100644 --- a/goal_src/jak1/engine/gfx/shadow/shadow-vu1.gc +++ b/goal_src/jak1/engine/gfx/shadow/shadow-vu1.gc @@ -8,125 +8,81 @@ ;; DECOMP BEGINS (deftype shadow-vu1-constants (structure) - ((hmgescale vector :inline :offset-assert 0) - (invhscale vector :inline :offset-assert 16) - (texoffset vector :inline :offset-assert 32) - (texscale vector :inline :offset-assert 48) - (hvdfoff vector :inline :offset-assert 64) - (fog vector :inline :offset-assert 80) - (clrs vector 2 :inline :offset-assert 96) - (adgif gs-gif-tag :inline :offset-assert 128) - (texflush ad-cmd :inline :offset-assert 144) - (flush ad-cmd :inline :offset-assert 160) - (trigif gs-gif-tag :inline :offset-assert 176) - (quadgif gs-gif-tag :inline :offset-assert 192) + ((hmgescale vector :inline) + (invhscale vector :inline) + (texoffset vector :inline) + (texscale vector :inline) + (hvdfoff vector :inline) + (fog vector :inline) + (clrs vector 2 :inline) + (adgif gs-gif-tag :inline) + (texflush ad-cmd :inline) + (flush ad-cmd :inline) + (trigif gs-gif-tag :inline) + (quadgif gs-gif-tag :inline) ) - :method-count-assert 9 - :size-assert #xd0 - :flag-assert #x9000000d0 ) -(defmethod inspect shadow-vu1-constants ((this shadow-vu1-constants)) - (format #t "[~8x] ~A~%" this 'shadow-vu1-constants) - (format #t "~Thmgescale: #~%" (-> this hmgescale)) - (format #t "~Tinvhscale: #~%" (-> this invhscale)) - (format #t "~Ttexoffset: #~%" (-> this texoffset)) - (format #t "~Ttexscale: #~%" (-> this texscale)) - (format #t "~Thvdfoff: #~%" (-> this hvdfoff)) - (format #t "~Tfog: #~%" (-> this fog)) - (format #t "~Tclrs[2] @ #x~X~%" (-> this clrs)) - (format #t "~Tadgif: #~%" (-> this adgif)) - (format #t "~Ttexflush: #~%" (-> this texflush)) - (format #t "~Tflush: #~%" (-> this flush)) - (format #t "~Ttrigif: #~%" (-> this trigif)) - (format #t "~Tquadgif: #~%" (-> this quadgif)) - this - ) (deftype shadow-vu1-gifbuf-template (structure) - ((adgif gs-gif-tag :inline :offset-assert 0) - (ad ad-cmd :inline :offset-assert 16) - (flush ad-cmd :inline :offset-assert 32) - (trigif gs-gif-tag :inline :offset-assert 48) - (quadgif gs-gif-tag :inline :offset-assert 64) + ((adgif gs-gif-tag :inline) + (ad ad-cmd :inline) + (flush ad-cmd :inline) + (trigif gs-gif-tag :inline) + (quadgif gs-gif-tag :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) -(defmethod inspect shadow-vu1-gifbuf-template ((this shadow-vu1-gifbuf-template)) - (format #t "[~8x] ~A~%" this 'shadow-vu1-gifbuf-template) - (format #t "~Tadgif: #~%" (-> this adgif)) - (format #t "~Tad: #~%" (-> this ad)) - (format #t "~Tflush: #~%" (-> this flush)) - (format #t "~Ttrigif: #~%" (-> this trigif)) - (format #t "~Tquadgif: #~%" (-> this quadgif)) - this - ) -(define - *shadow-vu1-tri-template* - (new 'static 'shadow-vu1-gifbuf-template - :adgif - (new 'static 'gs-gif-tag - :tag - (new 'static 'gif-tag64 :nloop #x1 :nreg #x1) - :regs - (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)) - ) - :ad - (new 'static 'ad-cmd :word (new 'static 'array uint32 4 #x0 #x0 #x3f #x0)) - :flush - (new 'static 'ad-cmd :word (new 'static 'array uint32 4 #x0 #x3f800000 #x1 #x0)) - :trigif - (new 'static 'gs-gif-tag - :tag - (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :tme #x1) - :nreg #x7 - ) - :regs - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id st) - :regs2 (gif-reg-id xyzf2) - :regs3 (gif-reg-id st) - :regs4 (gif-reg-id xyzf2) - :regs5 (gif-reg-id st) - :regs6 (gif-reg-id xyzf2) - ) - ) - :quadgif - (new 'static 'gs-gif-tag - :tag - (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :tme #x1) - :nreg #x9 - ) - :regs - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id st) - :regs2 (gif-reg-id xyzf2) - :regs3 (gif-reg-id st) - :regs4 (gif-reg-id xyzf2) - :regs5 (gif-reg-id st) - :regs6 (gif-reg-id xyzf2) - :regs7 (gif-reg-id st) - :regs8 (gif-reg-id xyzf2) +(define *shadow-vu1-tri-template* (new 'static 'shadow-vu1-gifbuf-template + :adgif (new 'static 'gs-gif-tag + :tag (new 'static 'gif-tag64 :nloop #x1 :nreg #x1) + :regs (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)) + ) + :ad (new 'static 'ad-cmd :cmd (gs-reg texflush)) + :flush (new 'static 'ad-cmd :data #x3f80000000000000 :cmd (gs-reg rgbaq)) + :trigif (new 'static 'gs-gif-tag + :tag (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :tme #x1) + :nreg #x7 + ) + :regs (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id st) + :regs2 (gif-reg-id xyzf2) + :regs3 (gif-reg-id st) + :regs4 (gif-reg-id xyzf2) + :regs5 (gif-reg-id st) + :regs6 (gif-reg-id xyzf2) + ) + ) + :quadgif (new 'static 'gs-gif-tag + :tag (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :tme #x1) + :nreg #x9 + ) + :regs (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id st) + :regs2 (gif-reg-id xyzf2) + :regs3 (gif-reg-id st) + :regs4 (gif-reg-id xyzf2) + :regs5 (gif-reg-id st) + :regs6 (gif-reg-id xyzf2) + :regs7 (gif-reg-id st) + :regs8 (gif-reg-id xyzf2) + ) + ) + ) ) - ) - ) - ) -(define shadow-vu1-block (new 'static 'vu-function :length #x0 :qlength #x0)) +(define shadow-vu1-block (new 'static 'vu-function #| :length #x2e4 :qlength #x172|#)) (defun shadow-vu1-add-constants ((arg0 dma-buffer)) (let* ((a2-0 13) diff --git a/goal_src/jak1/engine/gfx/shrub/shrubbery-h.gc b/goal_src/jak1/engine/gfx/shrub/shrubbery-h.gc index 8b87c5a05c8..52bb6706e46 100644 --- a/goal_src/jak1/engine/gfx/shrub/shrubbery-h.gc +++ b/goal_src/jak1/engine/gfx/shrub/shrubbery-h.gc @@ -8,140 +8,108 @@ ;; DECOMP BEGINS (deftype billboard (drawable) - ((flat adgif-shader :inline :offset-assert 32) + ((flat adgif-shader :inline) ) - :method-count-assert 18 - :size-assert #x70 - :flag-assert #x1200000070 ) + (deftype shrub-view-data (structure) - ((data uint128 3 :offset-assert 0) - (texture-giftag gs-gif-tag :inline :offset 0) ;; was qword - (consts vector :inline :offset 16) - (fog-clamp vector :inline :offset 32) - (tex-start-ptr int32 :offset 16) - (gifbufsum float :offset 16) - (mtx-buf-ptr int32 :offset 20) - (exp23 float :offset 20) - (fog-0 float :offset 24) - (fog-1 float :offset 28) - (fog-min float :offset 32) - (fog-max float :offset 36) + ((data uint128 3) + (texture-giftag gs-gif-tag :inline :overlay-at (-> data 0)) + (consts vector :inline :overlay-at (-> data 1)) + (fog-clamp vector :inline :overlay-at (-> data 2)) + (tex-start-ptr int32 :overlay-at (-> data 1)) + (gifbufsum float :overlay-at (-> data 1)) + (mtx-buf-ptr int32 :overlay-at (-> consts y)) + (exp23 float :overlay-at mtx-buf-ptr) + (fog-0 float :overlay-at (-> consts z)) + (fog-1 float :overlay-at (-> consts w)) + (fog-min float :overlay-at (-> data 2)) + (fog-max float :overlay-at (-> fog-clamp y)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype shrubbery (drawable) - ((textures (inline-array adgif-shader) :offset 4) - (header qword :offset 8) - (obj-qwc uint8 :offset 12) - (vtx-qwc uint8 :offset 13) - (col-qwc uint8 :offset 14) - (stq-qwc uint8 :offset 15) - (obj uint32 :offset 16) - (vtx uint32 :offset 20) - (col uint32 :offset 24) - (stq uint32 :offset 28) + ((textures (inline-array adgif-shader) :overlay-at id) + (header qword :offset 8) + (obj-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (obj uint32 :overlay-at (-> bsphere x)) + (vtx uint32 :overlay-at (-> bsphere y)) + (col uint32 :overlay-at (-> bsphere z)) + (stq uint32 :overlay-at (-> bsphere w)) ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 ) + (deftype instance-shrubbery (instance) - ((color-indices uint32 :offset 8) ;; added - (flat-normal vector :inline :offset-assert 64) - (flat-hwidth float :offset 76) - (color uint32 :offset 8) + ((color-indices uint32 :overlay-at error) + (flat-normal vector :inline) + (flat-hwidth float :overlay-at (-> flat-normal w)) + (color uint32 :overlay-at color-indices) ) - :method-count-assert 18 - :size-assert #x50 - :flag-assert #x1200000050 ) + (deftype drawable-inline-array-instance-shrub (drawable-inline-array) - ((data instance-shrubbery 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 112) + ((data instance-shrubbery 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x74 - :flag-assert #x1200000074 ) (deftype drawable-tree-instance-shrub (drawable-tree) - ((info prototype-array-shrub-info :offset 8) - (colors-added time-of-day-palette :offset 12) ;; added + ((info prototype-array-shrub-info :offset 8) + (colors-added time-of-day-palette :offset 12) ) - :method-count-assert #x12 - :size-assert #x24 - :flag-assert #x1200000024 ) (deftype generic-shrub-fragment (drawable) - ((textures (inline-array adgif-shader) :offset 4) - (vtx-cnt uint32 :offset 8) - (cnt-qwc uint8 :offset 12) - (vtx-qwc uint8 :offset 13) - (col-qwc uint8 :offset 14) - (stq-qwc uint8 :offset 15) - (cnt uint32 :offset 16) - (vtx uint32 :offset 20) - (col uint32 :offset 24) - (stq uint32 :offset 28) + ((textures (inline-array adgif-shader) :overlay-at id) + (vtx-cnt uint32 :offset 8) + (cnt-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (cnt uint32 :overlay-at (-> bsphere x)) + (vtx uint32 :overlay-at (-> bsphere y)) + (col uint32 :overlay-at (-> bsphere z)) + (stq uint32 :overlay-at (-> bsphere w)) ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 ) + (deftype prototype-shrubbery (drawable-inline-array) - ((data shrubbery 1 :inline :offset-assert 32) - (pad uint32) + ((data shrubbery 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x44 - :flag-assert #x1200000044 ) (deftype prototype-trans-shrubbery (prototype-shrubbery) () - :method-count-assert 18 - :size-assert #x44 - :flag-assert #x1200000044 ) (deftype prototype-generic-shrub (drawable-group) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) (deftype shrubbery-matrix (structure) - ((mat matrix :inline :offset-assert 0) - (color qword :inline :offset-assert 64) + ((mat matrix :inline) + (color qword :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) + (defun shrubbery-login-post-texture ((this shrubbery)) "Copies adgif shader crap to somewhere" ;; total number of adgif shaders for this shrubbery object. (let* ((shader-count (-> this header data 0)) ;; one destination to place the data. - (dst (the-as qword - (+ (the-as uint (-> this header)) - (the-as uint (* (+ (-> this header data 1) 1) 16)) - ) - ) - ) + (dst (the-as qword (+ (the-as uint (-> this header)) (* (+ (-> this header data 1) 1) 16)))) ;; the second destination to place the data - (tex-dst (the-as qword (+ (the-as int dst) (the-as int (* shader-count 64))))) + (tex-dst (the-as qword (+ (the-as int dst) (* shader-count 64)))) ;; the input data (adgif shaders, each is 0x50 bytes, or 5 quads) (src (the-as qword (-> this textures))) ) @@ -154,9 +122,9 @@ (src-2 (the-as qword (&+ (the-as pointer src) 16))) ) ;; copy second quadword, but only the first three words - (set! (-> dst data 0) (-> src-2 data 0)) - (set! (-> dst data 1) (-> src-2 data 1)) - (set! (-> dst data 2) (-> src-2 data 2)) + (set! (-> dst vector4w x) (the-as int (-> src-2 data 0))) + (set! (-> dst vector4w y) (the-as int (-> src-2 data 1))) + (set! (-> dst vector4w z) (the-as int (-> src-2 data 2))) ;; advance dst and src (set! dst (the-as qword (+ (the-as int dst) 16))) (let ((src-3 (the-as qword (&+ (the-as pointer src-2) 16)))) @@ -168,9 +136,9 @@ ) ;; more texture data (isn't this reading off of the end of the source?) (set! (-> text-dst2 quad) (-> src-3 quad)) - (set! tex-dst (the-as qword (+ (the-as int text-dst2) 16))) ;; advance to next source + (set! tex-dst (the-as qword (+ (the-as int text-dst2) 16))) (set! src (the-as qword (&+ (the-as pointer src-3) 80))) ) ) @@ -182,102 +150,90 @@ (define *shrub-state* 0) (deftype shrub-near-packet (structure) - ((matrix-tmpl dma-packet :inline :offset-assert 0) - (header-tmpl dma-packet :inline :offset-assert 16) - (stq-tmpl dma-packet :inline :offset-assert 32) - (color-tmpl dma-packet :inline :offset-assert 48) - (vertex-tmpl dma-packet :inline :offset-assert 64) - (mscal-tmpl dma-packet :inline :offset-assert 80) - (init-tmpl dma-packet :inline :offset-assert 96) - (init-data uint32 8 :offset-assert 112) + ((matrix-tmpl dma-packet :inline) + (header-tmpl dma-packet :inline) + (stq-tmpl dma-packet :inline) + (color-tmpl dma-packet :inline) + (vertex-tmpl dma-packet :inline) + (mscal-tmpl dma-packet :inline) + (init-tmpl dma-packet :inline) + (init-data uint32 8) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) -(deftype instance-shrub-work (structure) - ((dummy qword 3 :inline :offset-assert 0) - (chaina qword 8 :inline :offset-assert 48) - (chainb qword 8 :inline :offset-assert 176) - (colors rgba 1024 :offset-assert 304) - (matrix-tmpl qword 20 :inline :offset-assert 4400) - (count-tmpl vector4w 20 :inline :offset-assert 4720) - (mscalf-tmpl dma-packet :inline :offset-assert 5040) - (mscalf-ret-tmpl dma-packet :inline :offset-assert 5056) - (adgif-tmpl dma-gif-packet :inline :offset-assert 5072) - (billboard-tmpl dma-gif-packet :inline :offset-assert 5104) - (billboard-const vector :inline :offset-assert 5136) - (shrub-near-packets shrub-near-packet 6 :inline :offset-assert 5152) - (dma-ref dma-packet :inline :offset-assert 6016) - (dma-end dma-packet :inline :offset-assert 6032) - (wind-const vector :inline :offset-assert 6048) - (constants vector :inline :offset-assert 6064) - (color-constant vector4w :inline :offset-assert 6080) - (hmge-d vector :inline :offset-assert 6096) - (hvdf-offset vector :inline :offset-assert 6112) - (wind-force vector :inline :offset-assert 6128) - (color vector :inline :offset-assert 6144) - (bb-color vector :inline :offset-assert 6160) - (min-dist vector :inline :offset-assert 6176) - (temp-vec vector :inline :offset-assert 6192) - (guard-plane plane 4 :inline :offset-assert 6208) - (plane plane 4 :inline :offset-assert 6272) - (last uint32 4 :offset-assert 6336) - (next uint32 4 :offset-assert 6352) - (count uint16 4 :offset-assert 6368) - (mod-count uint16 4 :offset-assert 6376) - (wind-vectors uint32 :offset-assert 6384) - (instance-ptr uint32 :offset-assert 6388) - (chain-ptr uint32 :offset-assert 6392) - (chain-ptr-next uint32 :offset-assert 6396) - (stack-ptr uint32 :offset-assert 6400) - (bucket-ptr uint32 :offset-assert 6404) - (src-ptr uint32 :offset-assert 6408) - (to-spr uint32 :offset-assert 6412) - (from-spr uint32 :offset-assert 6416) - (shrub-count uint32 :offset-assert 6420) - ;;(stack-ptr uint32 :offset-assert 6400) ;; this field appears twice? - (node uint32 6 :offset 6428) - (length uint32 6 :offset-assert 6452) - (prototypes uint32 :offset-assert 6476) - ;;(bucket-ptr uint32 :offset-assert 6404) appears twice - (start-bank uint8 20 :offset 6484) - (buffer-index uint32 :offset-assert 6504) - (current-spr uint32 :offset-assert 6508) - (current-mem uint32 :offset-assert 6512) - (current-shrub-near-packet uint32 :offset-assert 6516) - ;;(to-spr uint32 :offset-assert 6412) - (dma-buffer basic :offset 6524) - (near-last uint32 :offset-assert 6528) - (near-next uint32 :offset-assert 6532) - (near-count uint32 :offset-assert 6536) - (last-shrubs uint32 :offset-assert 6540) - (chains uint32 :offset-assert 6544) - (flags uint32 :offset-assert 6548) - (paused basic :offset-assert 6552) - (node-count uint32 :offset-assert 6556) - (inst-count uint32 :offset-assert 6560) - (wait-from-spr uint32 :offset-assert 6564) - (wait-to-spr uint32 :offset-assert 6568) +(deftype instance-shrub-work (structure) + ((dummy qword 3 :inline) + (chaina qword 8 :inline) + (chainb qword 8 :inline) + (colors rgba 1024) + (matrix-tmpl qword 20 :inline) + (count-tmpl vector4w 20 :inline) + (mscalf-tmpl dma-packet :inline) + (mscalf-ret-tmpl dma-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (billboard-tmpl dma-gif-packet :inline) + (billboard-const vector :inline) + (shrub-near-packets shrub-near-packet 6 :inline) + (dma-ref dma-packet :inline) + (dma-end dma-packet :inline) + (wind-const vector :inline) + (constants vector :inline) + (color-constant vector4w :inline) + (hmge-d vector :inline) + (hvdf-offset vector :inline) + (wind-force vector :inline) + (color vector :inline) + (bb-color vector :inline) + (min-dist vector :inline) + (temp-vec vector :inline) + (guard-plane plane 4 :inline) + (plane plane 4 :inline) + (last uint32 4) + (next uint32 4) + (count uint16 4) + (mod-count uint16 4) + (wind-vectors uint32) + (instance-ptr uint32) + (chain-ptr uint32) + (chain-ptr-next uint32) + (stack-ptr uint32) + (bucket-ptr uint32) + (src-ptr uint32) + (to-spr uint32) + (from-spr uint32) + (shrub-count uint32) + (node uint32 6 :offset 6428) + (length uint32 6) + (prototypes uint32) + (start-bank uint8 20 :offset 6484) + (buffer-index uint32) + (current-spr uint32) + (current-mem uint32) + (current-shrub-near-packet uint32) + (dma-buffer basic :offset 6524) + (near-last uint32) + (near-next uint32) + (near-count uint32) + (last-shrubs uint32) + (chains uint32) + (flags uint32) + (paused basic) + (node-count uint32) + (inst-count uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) ) - :method-count-assert 9 - :size-assert #x19ac - :flag-assert #x9000019ac ) + (deftype instance-shrub-dma (structure) - ((instancea uint128 325 :offset-assert 0) - (instanceb uint128 325 :offset-assert 5200) - (outa uint128 128 :offset-assert 10400) - (outb uint128 128 :offset-assert 12448) + ((instancea uint128 325) + (instanceb uint128 325) + (outa uint128 128) + (outb uint128 128) ) - :method-count-assert 9 - :size-assert #x38a0 - :flag-assert #x9000038a0 ) (define-extern *instance-shrub-work* instance-shrub-work) - -(define-extern draw-drawable-tree-instance-shrub (function drawable-tree-instance-shrub level none)) \ No newline at end of file +(define-extern draw-drawable-tree-instance-shrub (function drawable-tree-instance-shrub level none)) diff --git a/goal_src/jak1/engine/gfx/sky/sky-h.gc b/goal_src/jak1/engine/gfx/sky/sky-h.gc index a91dee38ee0..2578765bd3e 100644 --- a/goal_src/jak1/engine/gfx/sky/sky-h.gc +++ b/goal_src/jak1/engine/gfx/sky/sky-h.gc @@ -13,23 +13,18 @@ ;; represents the skies that are used during a single hour. ;; there can be 1 or 2 skies used. (deftype sky-color-hour (structure) - ((snapshot1 int32 :offset-assert 0) ;; the sky index at the start - (snapshot2 int32 :offset-assert 4) ;; the sky index at the end - (morph-start float :offset-assert 8) ;; blend between the two at the start of the hour - (morph-end float :offset-assert 12) ;; blend between the two at the end of the hour + ((snapshot1 int32) + (snapshot2 int32) + (morph-start float) + (morph-end float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + ;; a sky-color-hour for each hour of the day. (deftype sky-color-day (structure) - ((hour sky-color-hour 24 :inline :offset-assert 0) + ((hour sky-color-hour 24 :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -42,90 +37,77 @@ ;; these stores points on a squashed circle (xy only) (deftype sky-circle-data (structure) - ((data vector 17 :inline :offset-assert 0) + ((data vector 17 :inline) ) - :method-count-assert 9 - :size-assert #x110 - :flag-assert #x900000110 ) + ;; sun particle tracks this (deftype sky-sun-data (structure) - ((data uint128 4 :offset-assert 0) - (pos vector :inline :offset 0) - (r-sun float :offset 16) - (r-halo float :offset 20) - (r-aurora float :offset 24) - (c-sun-start rgba :offset 32) - (c-sun-end rgba :offset 48) - (c-halo-start rgba :offset 36) - (c-halo-end rgba :offset 52) - (c-aurora-start rgba :offset 40) - (c-aurora-end rgba :offset 56) + ((data uint128 4) + (pos vector :inline :overlay-at (-> data 0)) + (r-sun float :overlay-at (-> data 1)) + (r-halo float :offset 20) + (r-aurora float :offset 24) + (c-sun-start rgba :overlay-at (-> data 2)) + (c-sun-end rgba :overlay-at (-> data 3)) + (c-halo-start rgba :offset 36) + (c-halo-end rgba :offset 52) + (c-aurora-start rgba :offset 40) + (c-aurora-end rgba :offset 56) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) + ;; moon particle tracks this (deftype sky-moon-data (structure) - ((data uint128 2 :offset-assert 0) - (pos vector :inline :offset 0) - (scale vector :inline :offset 16) + ((data uint128 2) + (pos vector :inline :overlay-at (-> data 0)) + (scale vector :inline :overlay-at (-> data 1)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + ;; parameters for the sun/moon motion. (deftype sky-orbit (structure) - ((high-noon float :offset-assert 0) - (tilt float :offset-assert 4) - (rise float :offset-assert 8) - (dist float :offset-assert 12) - (min-halo float :offset-assert 16) - (max-halo float :offset-assert 20) + ((high-noon float) + (tilt float) + (rise float) + (dist float) + (min-halo float) + (max-halo float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) + ;; sky data to send to old sky renderer. (deftype sky-upload-data (basic) - ((circle sky-circle-data :inline :offset-assert 16) - (sun sky-sun-data 2 :inline :offset-assert 288) - (moon sky-moon-data :inline :offset-assert 416) - (data uint128 27 :offset 16) + ((circle sky-circle-data :inline) + (sun sky-sun-data 2 :inline) + (moon sky-moon-data :inline) + (data uint128 27 :overlay-at (-> circle data)) ) - :method-count-assert 9 - :size-assert #x1c0 - :flag-assert #x9000001c0 ) + ;; all sky data. This has a copy of sky-upload-data that's used by the new sky renderer. (deftype sky-parms (basic) - ((orbit sky-orbit 3 :inline :offset-assert 4) - (upload-data sky-upload-data :inline :offset-assert 112) - (sun-lights light-group :inline :offset-assert 560) - (moon-lights light-group :inline :offset-assert 752) - (default-lights light-group :inline :offset-assert 944) - (default-vu-lights vu-lights :inline :offset-assert 1136) + ((orbit sky-orbit 3 :inline) + (upload-data sky-upload-data :inline) + (sun-lights light-group :inline) + (moon-lights light-group :inline) + (default-lights light-group :inline) + (default-vu-lights vu-lights :inline) ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) - :method-count-assert 9 - :size-assert #x4e0 - :flag-assert #x9000004e0 ) + (defmethod new sky-parms ((allocation symbol) (type-to-make type)) "allocate a new sky-parms" - (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (set! (-> v0-0 upload-data type) sky-upload-data) v0-0 @@ -140,9 +122,9 @@ ;; generate some points on a circle for the sky renderer. (dotimes (gp-0 17) (let ((f30-0 (+ MINUS_PI (* 0.39269906 (the float (logand gp-0 15)))))) - (set! (-> *sky-upload-data* circle data gp-0 x) (* 2.2 (sin-rad f30-0))) - (set! (-> *sky-upload-data* circle data gp-0 y) (cos-rad f30-0)) - ) + (set! (-> *sky-upload-data* circle data gp-0 x) (* 2.2 (sin-rad f30-0))) + (set! (-> *sky-upload-data* circle data gp-0 y) (cos-rad f30-0)) + ) (set! (-> *sky-upload-data* circle data gp-0 z) 0.0) (set! (-> *sky-upload-data* circle data gp-0 w) 0.0) ) @@ -152,42 +134,35 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftype sky-tng-data (basic) - ((giftag-base gs-gif-tag :inline :offset-assert 16);; changed - (giftag-roof gs-gif-tag :inline :offset-assert 32) - (giftag-ocean gs-gif-tag :inline :offset-assert 48) - (fog vector :inline :offset-assert 64) - (sky uint32 8 :offset-assert 80) - (time float :offset-assert 112) - (off-s-0 uint16 :offset-assert 116) - (off-t-0 uint16 :offset-assert 118) - (off-s-1 uint16 :offset-assert 120) - (off-t-1 uint16 :offset-assert 122) + ((giftag-base gs-gif-tag :inline) + (giftag-roof gs-gif-tag :inline) + (giftag-ocean gs-gif-tag :inline) + (fog vector :inline) + (sky uint32 8) + (time float) + (off-s-0 uint16) + (off-t-0 uint16) + (off-s-1 uint16) + (off-t-1 uint16) ) - :method-count-assert 9 - :size-assert #x7c - :flag-assert #x90000007c ) + (deftype sky-work (structure) - ((adgif-tmpl dma-gif-packet :inline :offset-assert 0) - (draw-tmpl dma-gif-packet :inline :offset-assert 32) - (blend-tmpl dma-gif-packet :inline :offset-assert 64) - (sky-data qword 5 :inline :offset-assert 96) - (cloud-data qword 5 :inline :offset-assert 176) + ((adgif-tmpl dma-gif-packet :inline) + (draw-tmpl dma-gif-packet :inline) + (blend-tmpl dma-gif-packet :inline) + (sky-data qword 5 :inline) + (cloud-data qword 5 :inline) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) + (deftype sky-vertex (structure) - ((pos vector :inline :offset-assert 0) - (stq vector :inline :offset-assert 16) - (col vector :inline :offset-assert 32) + ((pos vector :inline) + (stq vector :inline) + (col vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) @@ -195,9 +170,7 @@ ;; it has done this, and if the sky/cloud textures should be used. (define *sky-drawn* #f) (define *cloud-drawn* #f) - - (declare-type time-of-day-context basic) (define-extern update-sky-tng-data (function float none)) (define-extern make-sky-textures (function time-of-day-context int none)) -(define-extern sky-base-polygons (inline-array sky-vertex)) \ No newline at end of file +(define-extern sky-base-polygons (inline-array sky-vertex)) diff --git a/goal_src/jak1/engine/gfx/sky/sky-tng.gc b/goal_src/jak1/engine/gfx/sky/sky-tng.gc index d0a31942478..e576ae12203 100644 --- a/goal_src/jak1/engine/gfx/sky/sky-tng.gc +++ b/goal_src/jak1/engine/gfx/sky/sky-tng.gc @@ -10,123 +10,110 @@ (define *sky-work* (new 'static 'sky-work ;; usual 5x a+d - :adgif-tmpl (new 'static 'dma-gif-packet - :dma-vif (new 'static 'dma-packet - :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) - ) - :gif0 (new 'static 'gif-tag64 :nloop #x5 :eop #x1 :nreg #x1) - :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)) - ) + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 :nloop #x5 :eop #x1 :nreg #x1) + :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)) + ) ;; sprite with texture - :draw-tmpl (new 'static 'dma-gif-packet - :dma-vif (new 'static 'dma-packet - :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) - ) - :gif0 (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :fst #x1) - :nreg #x5 - ) - :gif1 (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id uv) - :regs2 (gif-reg-id xyzf2) - :regs3 (gif-reg-id uv) - :regs4 (gif-reg-id xyzf2) - ) - - ) + :draw-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :fst #x1) + :nreg #x5 + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id uv) + :regs2 (gif-reg-id xyzf2) + :regs3 (gif-reg-id uv) + :regs4 (gif-reg-id xyzf2) + ) + ) ;; sprite with texture and abe (alpha blend enable) - :blend-tmpl (new 'static 'dma-gif-packet - :dma-vif (new 'static 'dma-packet - :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) - ) - :gif0 (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1) - :nreg #x5 - ) - :gif1 (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id uv) - :regs2 (gif-reg-id xyzf2) - :regs3 (gif-reg-id uv) - :regs4 (gif-reg-id xyzf2) - ) - ) - :sky-data (new 'static 'inline-array qword 5 - (new 'static 'qword :data (new 'static 'array uint32 4 #x0 #x0 #x0 #x80)) - (new 'static 'qword) - (new 'static 'qword :data (new 'static 'array uint32 4 #x0 #x0 #xffffff #x0)) - (new 'static 'qword :data (new 'static 'array uint32 4 #x200 #x200 #x0 #x0)) - (new 'static 'qword :data (new 'static 'array uint32 4 #x200 #x200 #xffffff #x0)) - ) - :cloud-data (new 'static 'inline-array qword 5 - (new 'static 'qword :data (new 'static 'array uint32 4 #x0 #x0 #x0 #x80)) - (new 'static 'qword) - (new 'static 'qword :data (new 'static 'array uint32 4 #x0 #x200 #xffffff #x0)) - (new 'static 'qword :data (new 'static 'array uint32 4 #x400 #x400 #x0 #x0)) - (new 'static 'qword :data (new 'static 'array uint32 4 #x400 #x600 #xffffff #x0)) - ) - ) + :blend-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1) + :nreg #x5 + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id uv) + :regs2 (gif-reg-id xyzf2) + :regs3 (gif-reg-id uv) + :regs4 (gif-reg-id xyzf2) + ) + ) + :sky-data (new 'static 'inline-array qword 5 + (new 'static 'qword :data (new 'static 'array uint32 4 #x0 #x0 #x0 #x80)) + (new 'static 'qword) + (new 'static 'qword :data (new 'static 'array uint32 4 #x0 #x0 #xffffff #x0)) + (new 'static 'qword :data (new 'static 'array uint32 4 #x200 #x200 #x0 #x0)) + (new 'static 'qword :data (new 'static 'array uint32 4 #x200 #x200 #xffffff #x0)) + ) + :cloud-data (new 'static 'inline-array qword 5 + (new 'static 'qword :data (new 'static 'array uint32 4 #x0 #x0 #x0 #x80)) + (new 'static 'qword) + (new 'static 'qword :data (new 'static 'array uint32 4 #x0 #x200 #xffffff #x0)) + (new 'static 'qword :data (new 'static 'array uint32 4 #x400 #x400 #x0 #x0)) + (new 'static 'qword :data (new 'static 'array uint32 4 #x400 #x600 #xffffff #x0)) + ) + ) ) (defun init-sky-tng-data ((arg0 sky-tng-data)) "Set up giftags and constants in a sky-tng data" (set! (-> arg0 giftag-base tag) (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan)) - :nreg #x3 - ) + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan)) + :nreg #x3 + ) ) (set! (-> arg0 giftag-base regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id st) - :regs1 (gif-reg-id rgbaq) - :regs2 (gif-reg-id xyzf2) - ) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) ) (set! (-> arg0 giftag-roof tag) (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) - :nreg #x3 - ) + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) ) (set! (-> arg0 giftag-roof regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id st) - :regs1 (gif-reg-id rgbaq) - :regs2 (gif-reg-id xyzf2) - ) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) ) (set! (-> arg0 giftag-ocean tag) (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1) - :nreg #x3 - ) + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) ) (set! (-> arg0 giftag-ocean regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id st) - :regs1 (gif-reg-id rgbaq) - :regs2 (gif-reg-id xyzf2) - ) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) ) (set! (-> arg0 time) 0.0) (set! (-> arg0 off-s-0) (the-as uint 0)) @@ -140,28 +127,14 @@ ;; create our sky data (define *sky-tng-data* (new 'global 'sky-tng-data)) + (init-sky-tng-data *sky-tng-data*) -(defmethod inspect sky-vertex ((this sky-vertex)) +(defmethod inspect ((this sky-vertex)) (format #t "sky-vertex [~X]:~%" this) - (format #t "~TPos: [~F ~F ~F ~F]~%" - (-> this pos x) - (-> this pos y) - (-> this pos z) - (-> this pos w) - ) - (format #t "~TSTQ: [~F ~F ~F ~F]~%" - (-> this stq x) - (-> this stq y) - (-> this stq z) - (-> this stq w) - ) - (format #t "~TCol: [~F ~F ~F ~F]~%" - (-> this col x) - (-> this col y) - (-> this col z) - (-> this col w) - ) + (format #t "~TPos: [~F ~F ~F ~F]~%" (-> this pos x) (-> this pos y) (-> this pos z) (-> this pos w)) + (format #t "~TSTQ: [~F ~F ~F ~F]~%" (-> this stq x) (-> this stq y) (-> this stq z) (-> this stq w)) + (format #t "~TCol: [~F ~F ~F ~F]~%" (-> this col x) (-> this col y) (-> this col z) (-> this col w)) this ) @@ -178,17 +151,16 @@ (+! (-> v1-0 off-t-1) (* 42.0 DISPLAY_FPS_RATIO)) ) (else - (+! (-> v1-0 off-s-0) 16) - (+! (-> v1-0 off-t-0) 32) - (+! (-> v1-0 off-s-1) -21) - (+! (-> v1-0 off-t-1) 42) - ) - ) + (+! (-> v1-0 off-s-0) 16) + (+! (-> v1-0 off-t-0) 32) + (+! (-> v1-0 off-s-1) -21) + (+! (-> v1-0 off-t-1) 42) + )) (set! (-> v1-0 time) arg0) - ) + ) 0 (none) -) + ) #| (defun init-sky-regs () @@ -254,7 +226,6 @@ (def-mips2c set-sky-vf27 (function object none)) (def-mips2c set-sky-vf23-value (function int none)) - #| (defun set-tex-offset ((arg0 int) (arg1 int)) (with-vf (vf24) :rw 'write @@ -285,7 +256,6 @@ (def-mips2c render-sky-quad (function int dma-buffer none)) (def-mips2c render-sky-tri (function (inline-array sky-vertex) dma-buffer none)) - ; there's also a sky-duplicate-polys but it's never used. (defun close-sky-buffer ((arg0 dma-buffer)) @@ -293,7 +263,7 @@ (let ((v1-0 #x8000) (v0-0 (-> arg0 base)) ) - (set! (-> (the-as (pointer uint128) v0-0)) (the uint128 0)) + (set! (-> (the-as (pointer int128) v0-0)) (the int128 0)) (nop!) (set! (-> (the-as (pointer int32) v0-0)) v1-0) (let ((v0-1 (&+ v0-0 16))) @@ -305,388 +275,345 @@ (none) ) -(define - sky-base-polygons - (new 'static 'inline-array sky-vertex 12 - (new 'static 'sky-vertex - :pos (new 'static 'vector :z -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :x 40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :y -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :x 40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :z 40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :y -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :z 40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :x -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :y -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :x -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :z -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :y -40960000.0) - :col - (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) - ) - ) - ) +(define sky-base-polygons (new 'static 'inline-array sky-vertex 12 + (new 'static 'sky-vertex + :pos (new 'static 'vector :z -40960000.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :x 40960000.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :y -40960000.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :x 40960000.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :z 40960000.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :y -40960000.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :z 40960000.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :x -40960000.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :y -40960000.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :x -40960000.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :z -40960000.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :y -40960000.0) + :col (new 'static 'vector :x 3.0 :y 18.0 :z 113.0 :w 128.0) + ) + ) + ) -(define - sky-roof-polygons - (new 'static 'inline-array sky-vertex 12 - (new 'static 'sky-vertex - :pos (new 'static 'vector :z -40960000.0) - :stq (new 'static 'vector :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :x 40960000.0) - :stq (new 'static 'vector :x 1.0 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :y 10240000.0) - :stq - (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :x 40960000.0) - :stq (new 'static 'vector :x 1.0 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :z 40960000.0) - :stq - (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :y 10240000.0) - :stq - (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :z 40960000.0) - :stq - (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :x -40960000.0) - :stq (new 'static 'vector :y 1.0 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :y 10240000.0) - :stq - (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :x -40960000.0) - :stq (new 'static 'vector :y 1.0 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :z -40960000.0) - :stq (new 'static 'vector :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) - ) - (new 'static 'sky-vertex - :pos (new 'static 'vector :y 10240000.0) - :stq - (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) - :col - (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) - ) - ) - ) +(define sky-roof-polygons (new 'static 'inline-array sky-vertex 12 + (new 'static 'sky-vertex + :pos (new 'static 'vector :z -40960000.0) + :stq (new 'static 'vector :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :x 40960000.0) + :stq (new 'static 'vector :x 1.0 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :y 10240000.0) + :stq (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :x 40960000.0) + :stq (new 'static 'vector :x 1.0 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :z 40960000.0) + :stq (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :y 10240000.0) + :stq (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :z 40960000.0) + :stq (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :x -40960000.0) + :stq (new 'static 'vector :y 1.0 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :y 10240000.0) + :stq (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :x -40960000.0) + :stq (new 'static 'vector :y 1.0 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :z -40960000.0) + :stq (new 'static 'vector :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + (new 'static 'sky-vertex + :pos (new 'static 'vector :y 10240000.0) + :stq (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) + :col (new 'static 'vector :x 128.0 :y 128.0 :z 128.0 :w 128.0) + ) + ) + ) -(define - sky-cloud-polygons - (new 'static 'inline-array sky-vertex 72 - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - (new 'static 'sky-vertex) - ) - ) +(define sky-cloud-polygons (new 'static 'inline-array sky-vertex 72 + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + (new 'static 'sky-vertex) + ) + ) -(define - sky-cloud-polygon-indices - (new 'static 'array uint8 48 - #x0 #x1 #x9 #x8 - #x1 #x2 #xa #x9 - #x2 #x3 #xb #xa - #x3 #x0 #x8 #xb - #x8 #x9 #x5 #x4 - #x9 #xa #x6 #x5 - #xa #xb #x7 #x6 - #xb #x8 #x4 #x7 - #x4 #x5 #x6 #x7 - #x0 #x0 #x0 #x0 - #x0 #x0 #x0 #x0 - #x0 #x0 #x0 #x0 - ) - ) +(define sky-cloud-polygon-indices (new 'static 'array uint8 48 + #x0 #x1 #x9 #x8 + #x1 #x2 #xa #x9 + #x2 #x3 #xb #xa + #x3 #x0 #x8 #xb + #x8 #x9 #x5 #x4 + #x9 #xa #x6 #x5 + #xa #xb #x7 #x6 + #xb #x8 #x4 #x7 + #x4 #x5 #x6 #x7 + #x0 #x0 #x0 #x0 + #x0 #x0 #x0 #x0 + #x0 #x0 #x0 #x0 + ) + ) (defun sky-tng-setup-cloud-layer ((arg0 float) (arg1 float) (arg2 vector) (arg3 (inline-array sky-vertex))) (let ((f28-0 (sqrtf (- 1.0 (* arg0 arg0)))) (f26-0 (sqrtf (- 1.0 (* arg1 arg1)))) (s5-0 (new 'stack-no-clear 'inline-array 'sky-vertex 12)) ) - (dotimes (s1-0 12) - ((method-of-type sky-vertex new) (the-as symbol (-> s5-0 s1-0)) sky-vertex) - ) - (let ((f30-0 0.5)) - (let ((f9-0 -22.0) - (f10-0 22.0) - (f11-0 -22.0) - (f8-0 22.0) - (f6-0 -4.0) - (f7-0 5.0) - (f12-0 -5.0) - (f13-0 4.0) - (f1-4 -2.0) - (f2-2 2.0) - (f4-0 -2.0) - (f0-4 2.0) - ) - 0.0 - 1.0 - -1.0 - 0.0 - (let* ((f3-5 (/ (- f1-4 f9-0) (- f10-0 f9-0))) - (f5-2 (/ (- f2-2 f9-0) (- f10-0 f9-0))) - (f15-1 (/ (- f4-0 f11-0) (- f8-0 f11-0))) - (f14-3 (/ (- f0-4 f11-0) (- f8-0 f11-0))) - (f3-7 (+ f6-0 (* f3-5 (- f7-0 f6-0)))) - (f5-4 (+ f6-0 (* f5-2 (- f7-0 f6-0)))) - ) - (+ f12-0 (* f15-1 (- f13-0 f12-0))) - (+ f12-0 (* f14-3 (- f13-0 f12-0))) - (let ((v1-5 (-> s5-0 0))) - (set! (-> v1-5 pos x) f9-0) - (set! (-> v1-5 pos y) 0.0) - (set! (-> v1-5 pos z) f11-0) - (set! (-> v1-5 pos w) 0.0) - ) - (let ((v1-6 (-> s5-0 1))) - (set! (-> v1-6 pos x) f10-0) - (set! (-> v1-6 pos y) 0.0) - (set! (-> v1-6 pos z) f11-0) - (set! (-> v1-6 pos w) 0.0) - ) - (let ((v1-7 (-> s5-0 2))) - (set! (-> v1-7 pos x) f10-0) - (set! (-> v1-7 pos y) 0.0) - (set! (-> v1-7 pos z) f8-0) - (set! (-> v1-7 pos w) 0.0) - ) - (let ((v1-8 (-> s5-0 3))) - (set! (-> v1-8 pos x) f9-0) - (set! (-> v1-8 pos y) 0.0) - (set! (-> v1-8 pos z) f8-0) - (set! (-> v1-8 pos w) 0.0) - ) - (set-vector! (-> s5-0 0 stq) f6-0 f6-0 1.0 1.0) - (set-vector! (-> s5-0 1 stq) f7-0 f6-0 1.0 1.0) - (set-vector! (-> s5-0 2 stq) f7-0 f7-0 1.0 1.0) - (set-vector! (-> s5-0 3 stq) f6-0 f7-0 1.0 1.0) - (let ((v1-13 (-> s5-0 4))) - (set! (-> v1-13 pos x) f1-4) - (set! (-> v1-13 pos y) 1.0) - (set! (-> v1-13 pos z) f4-0) - (set! (-> v1-13 pos w) 0.0) - ) - (let ((v1-14 (-> s5-0 5))) - (set! (-> v1-14 pos x) f2-2) - (set! (-> v1-14 pos y) 1.0) - (set! (-> v1-14 pos z) f4-0) - (set! (-> v1-14 pos w) 0.0) - ) - (let ((v1-15 (-> s5-0 6))) - (set! (-> v1-15 pos x) f2-2) - (set! (-> v1-15 pos y) 1.0) - (set! (-> v1-15 pos z) f0-4) - (set! (-> v1-15 pos w) 0.0) - ) - (let ((v1-16 (-> s5-0 7))) - (set! (-> v1-16 pos x) f1-4) - (set! (-> v1-16 pos y) 1.0) - (set! (-> v1-16 pos z) f0-4) - (set! (-> v1-16 pos w) 0.0) - ) - (set-vector! (-> s5-0 4 stq) f3-7 f3-7 1.0 1.0) - (set-vector! (-> s5-0 5 stq) f5-4 f3-7 1.0 1.0) - (set-vector! (-> s5-0 6 stq) f5-4 f5-4 1.0 1.0) - (set-vector! (-> s5-0 7 stq) f3-7 f5-4 1.0 1.0) - ) - ) - (dotimes (v1-21 4) - (let ((f0-14 (-> s5-0 v1-21 pos x)) - (f1-6 (-> s5-0 v1-21 pos z)) - ) - (set! (-> s5-0 v1-21 pos x) (+ (* f0-14 f26-0) (* f1-6 arg1))) - (set! (-> s5-0 v1-21 pos z) (- (* f1-6 f26-0) (* f0-14 arg1))) + (dotimes (s1-0 12) + ((method-of-type sky-vertex new) (the-as symbol (-> s5-0 s1-0)) sky-vertex) ) - (set! (-> s5-0 v1-21 col quad) (-> arg2 quad)) - (set! (-> s5-0 v1-21 col w) 0.0) - ) - (dotimes (v1-24 4) - (let ((f0-18 (-> s5-0 (+ v1-24 4) pos x)) - (f1-8 (-> s5-0 (+ v1-24 4) pos z)) - ) - (set! (-> s5-0 (+ v1-24 4) pos x) (+ (* f0-18 f28-0) (* f1-8 arg0))) - (set! (-> s5-0 (+ v1-24 4) pos z) (- (* f1-8 f28-0) (* f0-18 arg0))) - ) - (set! (-> s5-0 (+ v1-24 4) col quad) (-> arg2 quad)) - ) - (dotimes (s3-1 4) - (vector4-lerp! - (the-as vector (-> s5-0 (+ s3-1 8))) - (the-as vector (-> s5-0 s3-1)) - (the-as vector (-> s5-0 (+ s3-1 4))) - f30-0 + (let ((f30-0 0.5)) + (let ((f9-0 -22.0) + (f10-0 22.0) + (f11-0 -22.0) + (f8-0 22.0) + (f6-0 -4.0) + (f7-0 5.0) + (f12-0 -5.0) + (f13-0 4.0) + (f1-4 -2.0) + (f2-2 2.0) + (f4-0 -2.0) + (f0-4 2.0) + ) + 0.0 + 1.0 + -1.0 + 0.0 + (let* ((f3-5 (/ (- f1-4 f9-0) (- f10-0 f9-0))) + (f5-2 (/ (- f2-2 f9-0) (- f10-0 f9-0))) + (f15-1 (/ (- f4-0 f11-0) (- f8-0 f11-0))) + (f14-3 (/ (- f0-4 f11-0) (- f8-0 f11-0))) + (f3-7 (+ f6-0 (* f3-5 (- f7-0 f6-0)))) + (f5-4 (+ f6-0 (* f5-2 (- f7-0 f6-0)))) + ) + (+ f12-0 (* f15-1 (- f13-0 f12-0))) + (+ f12-0 (* f14-3 (- f13-0 f12-0))) + (let ((v1-5 (-> s5-0 0))) + (set! (-> v1-5 pos x) f9-0) + (set! (-> v1-5 pos y) 0.0) + (set! (-> v1-5 pos z) f11-0) + (set! (-> v1-5 pos w) 0.0) + ) + (let ((v1-6 (-> s5-0 1))) + (set! (-> v1-6 pos x) f10-0) + (set! (-> v1-6 pos y) 0.0) + (set! (-> v1-6 pos z) f11-0) + (set! (-> v1-6 pos w) 0.0) + ) + (let ((v1-7 (-> s5-0 2))) + (set! (-> v1-7 pos x) f10-0) + (set! (-> v1-7 pos y) 0.0) + (set! (-> v1-7 pos z) f8-0) + (set! (-> v1-7 pos w) 0.0) + ) + (let ((v1-8 (-> s5-0 3))) + (set! (-> v1-8 pos x) f9-0) + (set! (-> v1-8 pos y) 0.0) + (set! (-> v1-8 pos z) f8-0) + (set! (-> v1-8 pos w) 0.0) + ) + (set-vector! (-> s5-0 0 stq) f6-0 f6-0 1.0 1.0) + (set-vector! (-> s5-0 1 stq) f7-0 f6-0 1.0 1.0) + (set-vector! (-> s5-0 2 stq) f7-0 f7-0 1.0 1.0) + (set-vector! (-> s5-0 3 stq) f6-0 f7-0 1.0 1.0) + (let ((v1-13 (-> s5-0 4))) + (set! (-> v1-13 pos x) f1-4) + (set! (-> v1-13 pos y) 1.0) + (set! (-> v1-13 pos z) f4-0) + (set! (-> v1-13 pos w) 0.0) + ) + (let ((v1-14 (-> s5-0 5))) + (set! (-> v1-14 pos x) f2-2) + (set! (-> v1-14 pos y) 1.0) + (set! (-> v1-14 pos z) f4-0) + (set! (-> v1-14 pos w) 0.0) + ) + (let ((v1-15 (-> s5-0 6))) + (set! (-> v1-15 pos x) f2-2) + (set! (-> v1-15 pos y) 1.0) + (set! (-> v1-15 pos z) f0-4) + (set! (-> v1-15 pos w) 0.0) + ) + (let ((v1-16 (-> s5-0 7))) + (set! (-> v1-16 pos x) f1-4) + (set! (-> v1-16 pos y) 1.0) + (set! (-> v1-16 pos z) f0-4) + (set! (-> v1-16 pos w) 0.0) + ) + (set-vector! (-> s5-0 4 stq) f3-7 f3-7 1.0 1.0) + (set-vector! (-> s5-0 5 stq) f5-4 f3-7 1.0 1.0) + (set-vector! (-> s5-0 6 stq) f5-4 f5-4 1.0 1.0) + (set-vector! (-> s5-0 7 stq) f3-7 f5-4 1.0 1.0) + ) + ) + (dotimes (v1-21 4) + (let ((f0-14 (-> s5-0 v1-21 pos x)) + (f1-6 (-> s5-0 v1-21 pos z)) + ) + (set! (-> s5-0 v1-21 pos x) (+ (* f0-14 f26-0) (* f1-6 arg1))) + (set! (-> s5-0 v1-21 pos z) (- (* f1-6 f26-0) (* f0-14 arg1))) + ) + (set! (-> s5-0 v1-21 col quad) (-> arg2 quad)) + (set! (-> s5-0 v1-21 col w) 0.0) + ) + (dotimes (v1-24 4) + (let ((f0-18 (-> s5-0 (+ v1-24 4) pos x)) + (f1-8 (-> s5-0 (+ v1-24 4) pos z)) + ) + (set! (-> s5-0 (+ v1-24 4) pos x) (+ (* f0-18 f28-0) (* f1-8 arg0))) + (set! (-> s5-0 (+ v1-24 4) pos z) (- (* f1-8 f28-0) (* f0-18 arg0))) + ) + (set! (-> s5-0 (+ v1-24 4) col quad) (-> arg2 quad)) + ) + (dotimes (s3-1 4) + (vector4-lerp! + (the-as vector (-> s5-0 (+ s3-1 8))) + (the-as vector (-> s5-0 s3-1)) + (the-as vector (-> s5-0 (+ s3-1 4))) + f30-0 + ) + (vector4-lerp! (-> s5-0 (+ s3-1 8) stq) (-> s5-0 s3-1 stq) (-> s5-0 (+ s3-1 4) stq) f30-0) + (set! (-> s5-0 (+ s3-1 8) col quad) (-> arg2 quad)) + ) ) - (vector4-lerp! - (-> s5-0 (+ s3-1 8) stq) - (-> s5-0 s3-1 stq) - (-> s5-0 (+ s3-1 4) stq) - f30-0 + (dotimes (v1-51 36) + (let ((a0-47 (-> sky-cloud-polygon-indices v1-51))) + (set! (-> arg3 v1-51 pos quad) (-> s5-0 a0-47 pos quad)) + (set! (-> arg3 v1-51 stq quad) (-> s5-0 a0-47 stq quad)) + (set! (-> arg3 v1-51 col quad) (-> s5-0 a0-47 col quad)) + ) ) - (set! (-> s5-0 (+ s3-1 8) col quad) (-> arg2 quad)) - ) ) - (dotimes (v1-51 36) - (let ((a0-47 (-> sky-cloud-polygon-indices v1-51))) - (set! (-> arg3 v1-51 pos quad) (-> s5-0 a0-47 pos quad)) - (set! (-> arg3 v1-51 stq quad) (-> s5-0 a0-47 stq quad)) - (set! (-> arg3 v1-51 col quad) (-> s5-0 a0-47 col quad)) - ) - ) - ) 0 (none) ) @@ -695,14 +622,9 @@ (let ((a2-0 (new 'static 'vector :x 20.0 :y 20.0 :z 20.0 :w 128.0)) (gp-0 (new 'static 'vector :x 20.0 :y 20.0 :z 30.0 :w 128.0)) ) - (sky-tng-setup-cloud-layer 0.0 0.0 a2-0 sky-cloud-polygons) - (sky-tng-setup-cloud-layer - 0.05584 - 0.01396 - gp-0 - (the-as (inline-array sky-vertex) (-> sky-cloud-polygons 36)) + (sky-tng-setup-cloud-layer 0.0 0.0 a2-0 sky-cloud-polygons) + (sky-tng-setup-cloud-layer 0.05584 0.01396 gp-0 (the-as (inline-array sky-vertex) (-> sky-cloud-polygons 36))) ) - ) 0 (none) ) @@ -714,615 +636,350 @@ (rlet ((vf23 :class vf) (vf27 :class vf) ) - (if *debug-segment* - (add-frame - (-> *display* frames (-> *display* on-screen) frame profile-bar 0) - 'draw - (new 'static 'rgba :r #x40 :b #x40 :a #x80) - ) - ) - (let - ((gp-0 (-> *display* frames (-> *display* on-screen) frame global-buf base)) - ) - (let* - ((s4-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (s5-0 (-> s4-0 base)) - ) - (let* ((v1-14 s4-0) - (a0-11 (the-as object (-> v1-14 base))) + (if *debug-segment* + (add-frame + (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'draw + (new 'static 'rgba :r #x40 :b #x40 :a #x80) + ) + ) + (let ((gp-0 (-> *display* frames (-> *display* on-screen) frame global-buf base))) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) + (s5-0 (-> s4-0 base)) + ) + (let* ((v1-14 s4-0) + (a0-11 (the-as object (-> v1-14 base))) + ) + (set! (-> (the-as dma-packet a0-11) dma) (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-11) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-11) vif1) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-14 base) (&+ (the-as pointer a0-11) 16)) + ) + (let* ((v1-15 s4-0) + (a0-13 (the-as object (-> v1-15 base))) + ) + (set! (-> (the-as gs-gif-tag a0-13) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x3)) + (set! (-> (the-as gs-gif-tag a0-13) regs) GIF_REGS_ALL_AD) + (set! (-> v1-15 base) (&+ (the-as pointer a0-13) 16)) + ) + (let* ((v1-16 s4-0) + (a0-15 (-> v1-16 base)) + ) + (set! (-> (the-as (pointer gs-zbuf) a0-15) 0) (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24))) + (set! (-> (the-as (pointer gs-reg64) a0-15) 1) (gs-reg64 zbuf-1)) + (set! (-> (the-as (pointer gs-test) a0-15) 2) + (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) a0-15) 3) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) a0-15) 4) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-15) 5) (gs-reg64 alpha-1)) + (set! (-> v1-16 base) (&+ a0-15 48)) + ) + (init-sky-regs) + ;;(.lvf vf27 (&-> *sky-tng-data* giftag-roof qword)) + (set-sky-vf27 (&-> *sky-tng-data* giftag-roof qword)) + (when *sky-drawn* + (let* ((v1-20 s4-0) + (a0-17 (the-as object (-> v1-20 base))) + ) + (set! (-> (the-as dma-packet a0-17) dma) (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-17) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-17) vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-20 base) (&+ (the-as pointer a0-17) 16)) ) - (set! - (-> (the-as dma-packet a0-11) dma) - (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)) - ) - (set! (-> (the-as dma-packet a0-11) vif0) (new 'static 'vif-tag)) - (set! - (-> (the-as dma-packet a0-11) vif1) - (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1) - ) - (set! (-> v1-14 base) (&+ (the-as pointer a0-11) 16)) - ) - (let* ((v1-15 s4-0) - (a0-13 (the-as object (-> v1-15 base))) + (let* ((v1-21 s4-0) + (a0-19 (the-as object (-> v1-21 base))) + ) + (set! (-> (the-as gs-gif-tag a0-19) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x4)) + (set! (-> (the-as gs-gif-tag a0-19) regs) GIF_REGS_ALL_AD) + (set! (-> v1-21 base) (&+ (the-as pointer a0-19) 16)) ) - (set! - (-> (the-as gs-gif-tag a0-13) tag) - (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x3) - ) - (set! - (-> (the-as gs-gif-tag a0-13) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) - ) - (set! (-> v1-15 base) (&+ (the-as pointer a0-13) 16)) - ) - (let* ((v1-16 s4-0) - (a0-15 (-> v1-16 base)) + (let* ((s3-0 s4-0) + (s2-0 (-> s3-0 base)) + ) + (set! (-> (the-as (pointer gs-tex0) s2-0) 0) + (new 'static 'gs-tex0 :tbw #x1 :th (log2 32) :tw (log2 32) :tbp0 *sky-base-block*) + ) + (set! (-> (the-as (pointer gs-reg64) s2-0) 1) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s2-0) 2) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s2-0) 3) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s2-0) 4) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (set! (-> (the-as (pointer gs-reg64) s2-0) 5) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer uint64) s2-0) 6) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s2-0) 7) (gs-reg64 texflush)) + (set! (-> s3-0 base) (&+ s2-0 64)) ) - (set! - (-> (the-as (pointer gs-zbuf) a0-15) 0) - (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24)) - ) - (set! (-> (the-as (pointer gs-reg64) a0-15) 1) (gs-reg64 zbuf-1)) - (set! - (-> (the-as (pointer gs-test) a0-15) 2) - (new 'static 'gs-test - :ate #x1 - :atst (gs-atest always) - :zte #x1 - :ztst (gs-ztest always) - ) - ) - (set! (-> (the-as (pointer gs-reg64) a0-15) 3) (gs-reg64 test-1)) - (set! (-> (the-as (pointer gs-alpha) a0-15) 4) (new 'static 'gs-alpha :b #x1 :d #x1)) - (set! (-> (the-as (pointer gs-reg64) a0-15) 5) (gs-reg64 alpha-1)) - (set! (-> v1-16 base) (&+ a0-15 48)) - ) - (init-sky-regs) - ;;(.lvf vf27 (&-> *sky-tng-data* giftag-roof qword)) - (set-sky-vf27 (&-> *sky-tng-data* giftag-roof qword)) - (when *sky-drawn* - (let* ((v1-20 s4-0) - (a0-17 (the-as object (-> v1-20 base))) - ) - (set! - (-> (the-as dma-packet a0-17) dma) - (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id cnt)) - ) - (set! (-> (the-as dma-packet a0-17) vif0) (new 'static 'vif-tag)) - (set! - (-> (the-as dma-packet a0-17) vif1) - (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd direct) :msk #x1) - ) - (set! (-> v1-20 base) (&+ (the-as pointer a0-17) 16)) - ) - (let* ((v1-21 s4-0) - (a0-19 (the-as object (-> v1-21 base))) - ) - (set! - (-> (the-as gs-gif-tag a0-19) tag) - (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x4) - ) - (set! - (-> (the-as gs-gif-tag a0-19) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) - ) - (set! (-> v1-21 base) (&+ (the-as pointer a0-19) 16)) - ) - (let* ((s3-0 s4-0) - (s2-0 (-> s3-0 base)) - ) - (set! - (-> (the-as (pointer gs-tex0) s2-0) 0) - (new 'static 'gs-tex0 - :tbw #x1 - :th (log2 32) - :tw (log2 32) - :tbp0 *sky-base-block* - ) - ) - (set! (-> (the-as (pointer gs-reg64) s2-0) 1) (gs-reg64 tex0-1)) - (set! - (-> (the-as (pointer gs-tex1) s2-0) 2) - (new 'static 'gs-tex1 :mmag #x1 :mmin #x1) - ) - (set! (-> (the-as (pointer gs-reg64) s2-0) 3) (gs-reg64 tex1-1)) - (set! - (-> (the-as (pointer gs-clamp) s2-0) 4) - (new 'static 'gs-clamp - :wms (gs-tex-wrap-mode clamp) - :wmt (gs-tex-wrap-mode clamp) - ) - ) - (set! (-> (the-as (pointer gs-reg64) s2-0) 5) (gs-reg64 clamp-1)) - (set! (-> (the-as (pointer uint64) s2-0) 6) (the-as uint 0)) - (set! (-> (the-as (pointer gs-reg64) s2-0) 7) (gs-reg64 texflush)) - (set! (-> s3-0 base) (&+ s2-0 64)) - ) - (let ((s3-1 (the-as object (-> s4-0 base)))) - (&+! (-> s4-0 base) 16) - (render-sky-tri - (the-as (inline-array sky-vertex) (-> sky-roof-polygons 0)) - s4-0 - ) - (render-sky-tri - (the-as (inline-array sky-vertex) (-> sky-roof-polygons 3)) - s4-0 - ) - (render-sky-tri - (the-as (inline-array sky-vertex) (-> sky-roof-polygons 6)) - s4-0 - ) - (render-sky-tri - (the-as (inline-array sky-vertex) (-> sky-roof-polygons 9)) - s4-0 - ) - (close-sky-buffer s4-0) - (let ((v1-46 (/ (+ (- -16 (the-as int s3-1)) (the int (-> s4-0 base))) 16))) - (set! - (-> (the-as dma-packet s3-1) dma) - (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc v1-46) - ) - (set! (-> (the-as dma-packet s3-1) vif0) (new 'static 'vif-tag)) - (set! - (-> (the-as dma-packet s3-1) vif1) - (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1 :imm v1-46) - ) - ) - ) - ) - (when *cloud-drawn* - (let* ((v1-52 s4-0) - (a0-32 (the-as object (-> v1-52 base))) - ) - (set! - (-> (the-as dma-packet a0-32) dma) - (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) - ) - (set! (-> (the-as dma-packet a0-32) vif0) (new 'static 'vif-tag)) - (set! - (-> (the-as dma-packet a0-32) vif1) - (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) - ) - (set! (-> v1-52 base) (&+ (the-as pointer a0-32) 16)) - ) - (let* ((v1-53 s4-0) - (a0-34 (the-as object (-> v1-53 base))) - ) - (set! - (-> (the-as gs-gif-tag a0-34) tag) - (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x5) - ) - (set! - (-> (the-as gs-gif-tag a0-34) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) - ) - (set! (-> v1-53 base) (&+ (the-as pointer a0-34) 16)) - ) - (let* ((s3-2 s4-0) - (s2-1 (-> s3-2 base)) - ) - (set! - (-> (the-as (pointer gs-alpha) s2-1) 0) - (new 'static 'gs-alpha :b #x2 :d #x1) - ) - (set! (-> (the-as (pointer gs-reg64) s2-1) 1) (gs-reg64 alpha-1)) - (set! - (-> (the-as (pointer gs-tex0) s2-1) 2) - (new 'static 'gs-tex0 - :tbw #x1 - :th (log2 64) - :tw (log2 64) - :tbp0 (+ *sky-base-block* 32) - ) - ) - (set! (-> (the-as (pointer gs-reg64) s2-1) 3) (gs-reg64 tex0-1)) - (set! - (-> (the-as (pointer gs-tex1) s2-1) 4) - (new 'static 'gs-tex1 :mmag #x1 :mmin #x1) - ) - (set! (-> (the-as (pointer gs-reg64) s2-1) 5) (gs-reg64 tex1-1)) - (set! (-> (the-as (pointer gs-clamp) s2-1) 6) (new 'static 'gs-clamp)) - (set! (-> (the-as (pointer gs-reg64) s2-1) 7) (gs-reg64 clamp-1)) - (set! (-> (the-as (pointer int64) s2-1) 8) 0) - (set! (-> (the-as (pointer gs-reg64) s2-1) 9) (gs-reg64 texflush)) - (set! (-> s3-2 base) (&+ s2-1 80)) - ) - (let ((s3-3 (the-as object (-> s4-0 base)))) - (&+! (-> s4-0 base) 16) - (init-sky-regs) - (let ((s2-2 (the-as object (-> sky-cloud-polygons 0)))) - (set-tex-offset - (the-as int (-> *sky-tng-data* off-s-0)) - (the-as int (-> *sky-tng-data* off-t-0)) - ) - ;; first cloud layer - (dotimes (s1-4 9) - (render-sky-quad (the-as int s2-2) s4-0) - (set! s2-2 (-> (the-as (inline-array sky-vertex) s2-2) 4)) - ) - (set-tex-offset - (the-as int (-> *sky-tng-data* off-s-1)) - (the-as int (-> *sky-tng-data* off-t-1)) - ) - ;; second cloud layer - (dotimes (s1-5 9) - (render-sky-quad (the-as int s2-2) s4-0) - (set! s2-2 (-> (the-as (inline-array sky-vertex) s2-2) 4)) - ) - ) - ;;(.lvf vf27 (&-> *sky-tng-data* giftag-base qword)) - ;; these draw stuff below the horizon - (set-sky-vf27 (&-> *sky-tng-data* giftag-base qword)) - (set-sky-vf23-value #x43800000) - ; (let ((v1-83 #x43800000)) - ; (.mov vf23 v1-83) - ; ) - ; (.mov v1-84 vf23) - ; not sure what this is, but it draws on the - (render-sky-tri - (the-as (inline-array sky-vertex) (-> sky-base-polygons 0)) - s4-0 - ) - (render-sky-tri - (the-as (inline-array sky-vertex) (-> sky-base-polygons 3)) - s4-0 - ) - (render-sky-tri - (the-as (inline-array sky-vertex) (-> sky-base-polygons 6)) - s4-0 - ) - (render-sky-tri - (the-as (inline-array sky-vertex) (-> sky-base-polygons 9)) - s4-0 - ) - (close-sky-buffer s4-0) - (let ((v1-92 (/ (+ (- -16 (the-as int s3-3)) (the int (-> s4-0 base))) 16))) - (set! - (-> (the-as dma-packet s3-3) dma) - (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc v1-92) - ) - (set! (-> (the-as dma-packet s3-3) vif0) (new 'static 'vif-tag)) - (set! - (-> (the-as dma-packet s3-3) vif1) - (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1 :imm v1-92) - ) + (let ((s3-1 (the-as object (-> s4-0 base)))) + (&+! (-> s4-0 base) 16) + (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-roof-polygons 0)) s4-0) + (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-roof-polygons 3)) s4-0) + (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-roof-polygons 6)) s4-0) + (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-roof-polygons 9)) s4-0) + (close-sky-buffer s4-0) + (let ((v1-46 (/ (the-as int (+ (- -16 (the-as int s3-1)) (the-as int (-> s4-0 base)))) 16))) + (set! (-> (the-as dma-packet s3-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc v1-46)) + (set! (-> (the-as dma-packet s3-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet s3-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1 :imm v1-46)) + ) + ) + ) + (when *cloud-drawn* + (let* ((v1-52 s4-0) + (a0-32 (the-as object (-> v1-52 base))) + ) + (set! (-> (the-as dma-packet a0-32) dma) (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-32) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-32) vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-52 base) (&+ (the-as pointer a0-32) 16)) + ) + (let* ((v1-53 s4-0) + (a0-34 (the-as object (-> v1-53 base))) + ) + (set! (-> (the-as gs-gif-tag a0-34) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x5)) + (set! (-> (the-as gs-gif-tag a0-34) regs) GIF_REGS_ALL_AD) + (set! (-> v1-53 base) (&+ (the-as pointer a0-34) 16)) + ) + (let* ((s3-2 s4-0) + (s2-1 (-> s3-2 base)) + ) + (set! (-> (the-as (pointer gs-alpha) s2-1) 0) (new 'static 'gs-alpha :b #x2 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s2-1) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s2-1) 2) + (new 'static 'gs-tex0 :tbw #x1 :th (log2 64) :tw (log2 64) :tbp0 (+ *sky-base-block* 32)) + ) + (set! (-> (the-as (pointer gs-reg64) s2-1) 3) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s2-1) 4) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s2-1) 5) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s2-1) 6) (new 'static 'gs-clamp)) + (set! (-> (the-as (pointer gs-reg64) s2-1) 7) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer int64) s2-1) 8) 0) + (set! (-> (the-as (pointer gs-reg64) s2-1) 9) (gs-reg64 texflush)) + (set! (-> s3-2 base) (&+ s2-1 80)) + ) + (let ((s3-3 (the-as object (-> s4-0 base)))) + (&+! (-> s4-0 base) 16) + (init-sky-regs) + (let ((s2-2 (the-as object (-> sky-cloud-polygons 0)))) + (set-tex-offset (the-as int (-> *sky-tng-data* off-s-0)) (the-as int (-> *sky-tng-data* off-t-0))) + ;; first cloud layer + (dotimes (s1-4 9) + (render-sky-quad (the-as int s2-2) s4-0) + (set! s2-2 (-> (the-as (inline-array sky-vertex) s2-2) 4)) + ) + (set-tex-offset (the-as int (-> *sky-tng-data* off-s-1)) (the-as int (-> *sky-tng-data* off-t-1))) + ;; second cloud layer + (dotimes (s1-5 9) + (render-sky-quad (the-as int s2-2) s4-0) + (set! s2-2 (-> (the-as (inline-array sky-vertex) s2-2) 4)) + ) + ) + ;;(.lvf vf27 (&-> *sky-tng-data* giftag-base qword)) + ;; these draw stuff below the horizon + (set-sky-vf27 (&-> *sky-tng-data* giftag-base qword)) + (set-sky-vf23-value #x43800000) + ; (let ((v1-83 #x43800000)) + ; (.mov vf23 v1-83) + ; ) + ; (.mov v1-84 vf23) + ; not sure what this is, but it draws on the + (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 0)) s4-0) + (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 3)) s4-0) + (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 6)) s4-0) + (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 9)) s4-0) + (close-sky-buffer s4-0) + (let ((v1-92 (/ (the-as int (+ (- -16 (the-as int s3-3)) (the-as int (-> s4-0 base)))) 16))) + (set! (-> (the-as dma-packet s3-3) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc v1-92)) + (set! (-> (the-as dma-packet s3-3) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet s3-3) vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1 :imm v1-92)) + ) + ) + ) + (let ((a3-0 (-> s4-0 base))) + (let ((v1-96 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-96) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-96) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-96) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-96) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) frame bucket-group) + (bucket-id sky-draw) + s5-0 + (the-as (pointer dma-tag) a3-0) + ) + ) ) - ) - ) - (let ((a3-0 (-> s4-0 base))) - (let ((v1-96 (the-as object (-> s4-0 base)))) - (set! - (-> (the-as dma-packet v1-96) dma) - (new 'static 'dma-tag :id (dma-tag-id next)) + (let ((v1-101 *dma-mem-usage*)) + (when (nonzero? v1-101) + (set! (-> v1-101 length) (max 86 (-> v1-101 length))) + (set! (-> v1-101 data 85 name) "sky") + (+! (-> v1-101 data 85 count) 1) + (+! (-> v1-101 data 85 used) + (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint gp-0)) + ) + (set! (-> v1-101 data 85 total) (-> v1-101 data 85 used)) + ) ) - (set! (-> (the-as dma-packet v1-96) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-96) vif1) (new 'static 'vif-tag)) - (set! (-> s4-0 base) (&+ (the-as pointer v1-96) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (bucket-id sky-draw) - s5-0 - (the-as (pointer dma-tag) a3-0) - ) ) - ) - (let ((v1-101 *dma-mem-usage*)) - (when (nonzero? v1-101) - (set! (-> v1-101 length) (max 86 (-> v1-101 length))) - (set! (-> v1-101 data 85 name) "sky") - (+! (-> v1-101 data 85 count) 1) - (+! - (-> v1-101 data 85 used) - (&- - (-> *display* frames (-> *display* on-screen) frame global-buf base) - (the-as uint gp-0) + (if *debug-segment* + (add-frame + (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'draw + (new 'static 'rgba :r #xff :b #xff :a #x80) + ) ) - ) - (set! (-> v1-101 data 85 total) (-> v1-101 data 85 used)) - ) - ) + 0 + (none) ) - (if *debug-segment* - (add-frame - (-> *display* frames (-> *display* on-screen) frame profile-bar 0) - 'draw - (new 'static 'rgba :r #xff :b #xff :a #x80) - ) - ) - 0 - (none) - ) ) -;; definition for function copy-sky-texture -;; INFO: Return type mismatch pointer vs none. -;; Used lq/sq (defun copy-sky-texture ((arg0 dma-buffer) (arg1 adgif-shader) (arg2 float)) (let ((s5-0 (-> arg0 base))) - (let ((v1-0 (the int (+ 0.5 (* 128.0 arg2)))) - (a0-2 (-> *sky-work* sky-data)) - ) - (set! (-> a0-2 0 vector4w x) v1-0) - (set! (-> a0-2 0 vector4w y) v1-0) - (set! (-> a0-2 0 vector4w z) v1-0) - (set! (-> a0-2 0 vector4w w) 128) - ) - (set! - (-> (the-as (pointer uint128) s5-0) 0) - (-> *sky-work* adgif-tmpl dma-vif quad) - ) - (set! - (-> (the-as (pointer uint128) s5-0) 1) - (-> *sky-work* adgif-tmpl quad 1) - ) - (let ((s4-0 (the-as object (&-> (the-as (pointer uint128) s5-0) 2)))) - (quad-copy! (the-as (pointer uint128) s4-0) (the-as pointer arg1) 5) - (set! - (-> (the-as adgif-shader s4-0) clamp) - (new 'static 'gs-clamp - :wms (gs-tex-wrap-mode clamp) - :wmt (gs-tex-wrap-mode clamp) - ) - ) - (set! (-> (the-as adgif-shader s4-0) alpha) (new 'static 'gs-alpha :b #x2 :c #x2 :d #x1 :fix #x80)) - ) - (cond - (*sky-drawn* - (set! - (-> (the-as (pointer uint128) s5-0) 7) - (-> *sky-work* blend-tmpl dma-vif quad) - ) - (set! - (-> (the-as (pointer uint128) s5-0) 8) - (-> *sky-work* blend-tmpl quad 1) + (let ((v1-0 (the int (+ 0.5 (* 128.0 arg2)))) + (a0-2 (-> *sky-work* sky-data)) + ) + (set! (-> a0-2 0 vector4w x) v1-0) + (set! (-> a0-2 0 vector4w y) v1-0) + (set! (-> a0-2 0 vector4w z) v1-0) + (set! (-> a0-2 0 vector4w w) 128) ) - ) - (else - (set! - (-> (the-as (pointer uint128) s5-0) 7) - (-> *sky-work* draw-tmpl dma-vif quad) + (set! (-> (the-as (pointer uint128) s5-0) 0) (-> *sky-work* adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s5-0) 1) (-> *sky-work* adgif-tmpl quad 1)) + (let ((s4-0 (the-as object (&-> (the-as (pointer uint128) s5-0) 2)))) + (quad-copy! (the-as (pointer uint128) s4-0) (the-as pointer arg1) 5) + (set! (-> (the-as adgif-shader s4-0) clamp) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (set! (-> (the-as adgif-shader s4-0) alpha) (new 'static 'gs-alpha :b #x2 :c #x2 :d #x1 :fix #x80)) ) - (set! - (-> (the-as (pointer uint128) s5-0) 8) - (-> *sky-work* draw-tmpl quad 1) + (cond + (*sky-drawn* + (set! (-> (the-as (pointer uint128) s5-0) 7) (-> *sky-work* blend-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s5-0) 8) (-> *sky-work* blend-tmpl quad 1)) + ) + (else + (set! (-> (the-as (pointer uint128) s5-0) 7) (-> *sky-work* draw-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s5-0) 8) (-> *sky-work* draw-tmpl quad 1)) + (set! *sky-drawn* #t) + ) ) - (set! *sky-drawn* #t) - ) + (quad-copy! (&+ s5-0 144) (the-as pointer (-> *sky-work* sky-data)) 5) + (set! (-> arg0 base) (&+ s5-0 224)) ) - (quad-copy! (&+ s5-0 144) (the-as pointer (-> *sky-work* sky-data)) 5) - (set! (-> arg0 base) (&+ s5-0 224)) - ) (none) ) -;; definition for function copy-cloud-texture -;; INFO: Return type mismatch pointer vs none. -;; Used lq/sq (defun copy-cloud-texture ((arg0 dma-buffer) (arg1 adgif-shader) (arg2 float)) (let ((s5-0 (-> arg0 base))) - (let ((v1-0 (the int (+ 0.5 (* 128.0 arg2)))) - (a0-2 (-> *sky-work* cloud-data)) - ) - (set! (-> a0-2 0 vector4w x) v1-0) - (set! (-> a0-2 0 vector4w y) v1-0) - (set! (-> a0-2 0 vector4w z) v1-0) - (set! (-> a0-2 0 vector4w w) 128) - ) - (set! - (-> (the-as (pointer uint128) s5-0) 0) - (-> *sky-work* adgif-tmpl dma-vif quad) - ) - (set! - (-> (the-as (pointer uint128) s5-0) 1) - (-> *sky-work* adgif-tmpl quad 1) - ) - (let ((s4-0 (the-as object (&-> (the-as (pointer uint128) s5-0) 2)))) - (quad-copy! (the-as (pointer uint128) s4-0) (the-as pointer arg1) 5) - (set! - (-> (the-as adgif-shader s4-0) clamp) - (new 'static 'gs-clamp - :wms (gs-tex-wrap-mode clamp) - :wmt (gs-tex-wrap-mode clamp) - ) - ) - (set! (-> (the-as adgif-shader s4-0) alpha) (new 'static 'gs-alpha :b #x2 :c #x2 :d #x1 :fix #x80)) - ) - (cond - (*cloud-drawn* - (set! - (-> (the-as (pointer uint128) s5-0) 7) - (-> *sky-work* blend-tmpl dma-vif quad) - ) - (set! - (-> (the-as (pointer uint128) s5-0) 8) - (-> *sky-work* blend-tmpl quad 1) + (let ((v1-0 (the int (+ 0.5 (* 128.0 arg2)))) + (a0-2 (-> *sky-work* cloud-data)) + ) + (set! (-> a0-2 0 vector4w x) v1-0) + (set! (-> a0-2 0 vector4w y) v1-0) + (set! (-> a0-2 0 vector4w z) v1-0) + (set! (-> a0-2 0 vector4w w) 128) ) - ) - (else - (set! - (-> (the-as (pointer uint128) s5-0) 7) - (-> *sky-work* draw-tmpl dma-vif quad) + (set! (-> (the-as (pointer uint128) s5-0) 0) (-> *sky-work* adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s5-0) 1) (-> *sky-work* adgif-tmpl quad 1)) + (let ((s4-0 (the-as object (&-> (the-as (pointer uint128) s5-0) 2)))) + (quad-copy! (the-as (pointer uint128) s4-0) (the-as pointer arg1) 5) + (set! (-> (the-as adgif-shader s4-0) clamp) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (set! (-> (the-as adgif-shader s4-0) alpha) (new 'static 'gs-alpha :b #x2 :c #x2 :d #x1 :fix #x80)) ) - (set! - (-> (the-as (pointer uint128) s5-0) 8) - (-> *sky-work* draw-tmpl quad 1) + (cond + (*cloud-drawn* + (set! (-> (the-as (pointer uint128) s5-0) 7) (-> *sky-work* blend-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s5-0) 8) (-> *sky-work* blend-tmpl quad 1)) + ) + (else + (set! (-> (the-as (pointer uint128) s5-0) 7) (-> *sky-work* draw-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s5-0) 8) (-> *sky-work* draw-tmpl quad 1)) + (set! *cloud-drawn* #t) + ) ) - (set! *cloud-drawn* #t) - ) + (quad-copy! (&+ s5-0 144) (the-as pointer (-> *sky-work* cloud-data)) 5) + (set! (-> arg0 base) (&+ s5-0 224)) ) - (quad-copy! (&+ s5-0 144) (the-as pointer (-> *sky-work* cloud-data)) 5) - (set! (-> arg0 base) (&+ s5-0 224)) - ) (none) ) -;; definition for function make-sky-textures -;; INFO: Return type mismatch int vs none. (defun make-sky-textures ((arg0 time-of-day-context) (arg1 int)) - (when - (and - (= (-> *level* level arg1 status) 'active) - (-> *level* level arg1 info sky) - ) - (let ((f30-0 (-> arg0 current-interp))) - (if (zero? arg1) - (set! f30-0 (- 1.0 f30-0)) - ) - (if (= (-> arg0 active-count) 1) - (set! f30-0 1.0) - ) - (when (!= f30-0 0.0) - (let ((gp-0 (if (zero? arg1) - 32 - 39 - ) - ) - (s1-0 (-> *level* level arg1 bsp adgifs)) - ) - (when (nonzero? s1-0) - (let* - ((s2-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) - (s3-0 (-> s2-0 base)) - ) - (set-display-gs-state s2-0 *sky-base-page* 64 96 0 0) - (dotimes (s0-0 8) - (let ((f0-3 (* (-> arg0 moods arg1 sky-times s0-0) f30-0))) - (if (!= f0-3 0.0) - (copy-sky-texture s2-0 (-> s1-0 data s0-0) f0-3) - ) - ) - ) - (copy-cloud-texture s2-0 (-> s1-0 data 8) f30-0) - (let* ((v1-31 s2-0) - (a0-19 (the-as object (-> v1-31 base))) - ) - (set! - (-> (the-as dma-packet a0-19) dma) - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)) - ) - (set! (-> (the-as dma-packet a0-19) vif0) (new 'static 'vif-tag)) - (set! - (-> (the-as dma-packet a0-19) vif1) - (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1) - ) - (set! (-> v1-31 base) (&+ (the-as pointer a0-19) 16)) - ) - (let* ((v1-32 s2-0) - (a0-21 (the-as object (-> v1-32 base))) - ) - (set! - (-> (the-as gs-gif-tag a0-21) tag) - (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1) + (when (and (= (-> *level* level arg1 status) 'active) (-> *level* level arg1 info sky)) + (let ((f30-0 (-> arg0 current-interp))) + (if (zero? arg1) + (set! f30-0 (- 1.0 f30-0)) ) - (set! - (-> (the-as gs-gif-tag a0-21) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (if (= (-> arg0 active-count) 1) + (set! f30-0 1.0) ) - (set! (-> v1-32 base) (&+ (the-as pointer a0-21) 16)) - ) - (let* ((v1-33 s2-0) - (a0-23 (-> v1-33 base)) - ) - (set! - (-> (the-as (pointer gs-alpha) a0-23) 0) - (new 'static 'gs-alpha :b #x1 :d #x1) - ) - (set! (-> (the-as (pointer gs-reg64) a0-23) 1) (gs-reg64 alpha-1)) - (set! (-> v1-33 base) (&+ a0-23 16)) - ) - (reset-display-gs-state *display* s2-0 *oddeven*) - (let ((a3-1 (-> s2-0 base))) - (let ((v1-34 (the-as object (-> s2-0 base)))) - (set! - (-> (the-as dma-packet v1-34) dma) - (new 'static 'dma-tag :id (dma-tag-id next)) - ) - (set! (-> (the-as dma-packet v1-34) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-34) vif1) (new 'static 'vif-tag)) - (set! (-> s2-0 base) (&+ (the-as pointer v1-34) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id gp-0) - s3-0 - (the-as (pointer dma-tag) a3-1) + (when (!= f30-0 0.0) + (let ((gp-0 (if (zero? arg1) + 32 + 39 + ) + ) + (s1-0 (-> *level* level arg1 bsp adgifs)) + ) + (when (nonzero? s1-0) + (let* ((s2-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) + (s3-0 (-> s2-0 base)) + ) + (set-display-gs-state s2-0 *sky-base-page* 64 96 0 0) + (dotimes (s0-0 8) + (let ((f0-3 (* (-> arg0 moods arg1 sky-times s0-0) f30-0))) + (if (!= f0-3 0.0) + (copy-sky-texture s2-0 (-> s1-0 data s0-0) f0-3) + ) + ) + ) + (copy-cloud-texture s2-0 (-> s1-0 data 8) f30-0) + (let* ((v1-31 s2-0) + (a0-19 (the-as object (-> v1-31 base))) + ) + (set! (-> (the-as dma-packet a0-19) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-19) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-19) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-31 base) (&+ (the-as pointer a0-19) 16)) + ) + (let* ((v1-32 s2-0) + (a0-21 (the-as object (-> v1-32 base))) + ) + (set! (-> (the-as gs-gif-tag a0-21) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> (the-as gs-gif-tag a0-21) regs) GIF_REGS_ALL_AD) + (set! (-> v1-32 base) (&+ (the-as pointer a0-21) 16)) + ) + (let* ((v1-33 s2-0) + (a0-23 (-> v1-33 base)) + ) + (set! (-> (the-as (pointer gs-alpha) a0-23) 0) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-23) 1) (gs-reg64 alpha-1)) + (set! (-> v1-33 base) (&+ a0-23 16)) + ) + (reset-display-gs-state *display* s2-0 *oddeven*) + (let ((a3-1 (-> s2-0 base))) + (let ((v1-34 (the-as object (-> s2-0 base)))) + (set! (-> (the-as dma-packet v1-34) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-34) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-34) vif1) (new 'static 'vif-tag)) + (set! (-> s2-0 base) (&+ (the-as pointer v1-34) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) frame bucket-group) + (the-as bucket-id gp-0) + s3-0 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) ) - ) ) - ) ) - ) ) - ) 0 (none) ) diff --git a/goal_src/jak1/engine/gfx/sky/sky.gc b/goal_src/jak1/engine/gfx/sky/sky.gc index 93323027ebd..9be44270e9b 100644 --- a/goal_src/jak1/engine/gfx/sky/sky.gc +++ b/goal_src/jak1/engine/gfx/sky/sky.gc @@ -32,10 +32,9 @@ ) ) ) - (set! - (-> arg0 upload-data sun arg1 r-aurora) - (+ (* (-> s4-0 min-halo) (- 1.0 f0-14)) (* (-> s4-0 max-halo) f0-14)) - ) + (set! (-> arg0 upload-data sun arg1 r-aurora) + (+ (* (-> s4-0 min-halo) (- 1.0 f0-14)) (* (-> s4-0 max-halo) f0-14)) + ) ) ) (none) @@ -74,47 +73,44 @@ (defun sky-make-light ((arg0 sky-parms) (arg1 light) (arg2 int) (arg3 rgba)) (let* ((v1-2 (-> arg0 orbit arg2)) (a0-1 (if (= arg2 2) - (-> arg0 upload-data moon) - (-> arg0 upload-data sun arg2) - ) - ) + (-> arg0 upload-data moon) + (-> arg0 upload-data sun arg2) + ) + ) (f0-0 0.003921569) (f1-1 (/ 1.0 (-> v1-2 dist))) (v1-3 arg1) ) - (set! (-> v1-3 direction x) (* (-> (the-as sky-sun-data a0-1) pos x) f1-1)) - (set! (-> v1-3 direction y) (* (-> (the-as sky-sun-data a0-1) pos y) f1-1)) - (set! (-> v1-3 direction z) (* (-> (the-as sky-sun-data a0-1) pos z) f1-1)) - (set! (-> v1-3 color x) (* (the float (-> arg3 r)) f0-0)) - (set! (-> v1-3 color y) (* (the float (-> arg3 g)) f0-0)) - (set! (-> v1-3 color z) (* (the float (-> arg3 b)) f0-0)) - (set! (-> v1-3 color w) 1.0) - (set! (-> v1-3 levels x) 1.0) - ) + (set! (-> v1-3 direction x) (* (-> (the-as sky-sun-data a0-1) pos x) f1-1)) + (set! (-> v1-3 direction y) (* (-> (the-as sky-sun-data a0-1) pos y) f1-1)) + (set! (-> v1-3 direction z) (* (-> (the-as sky-sun-data a0-1) pos z) f1-1)) + (set! (-> v1-3 color x) (* (the float (-> arg3 r)) f0-0)) + (set! (-> v1-3 color y) (* (the float (-> arg3 g)) f0-0)) + (set! (-> v1-3 color z) (* (the float (-> arg3 b)) f0-0)) + (set! (-> v1-3 color w) 1.0) + (set! (-> v1-3 levels x) 1.0) + ) (none) ) (deftype sky-frame-data (structure) - ((data uint128 18 :offset-assert 0) - (world-homo-matrix matrix :inline :offset 0) - (hmge-scale vector :inline :offset 64) - (hvdf-offset vector :inline :offset 80) - (consts vector :inline :offset 96) - (pfog0 float :offset 96) - (radius float :offset 100) - (nokick float :offset 108) - (strip-giftag qword :inline :offset 112) - (col-adgif qword :inline :offset 128) - (save uint128 5 :offset 144) - (sun-fan-giftag qword :inline :offset 224) - (sun-strip-giftag qword :inline :offset 240) - (sun-alpha qword :inline :offset 256) - (sun-alpha-giftag qword :inline :offset 272) + ((data uint128 18) + (world-homo-matrix matrix :inline :overlay-at (-> data 0)) + (hmge-scale vector :inline :overlay-at (-> data 4)) + (hvdf-offset vector :inline :overlay-at (-> data 5)) + (consts vector :inline :overlay-at (-> data 6)) + (pfog0 float :overlay-at (-> data 6)) + (radius float :overlay-at (-> consts y)) + (nokick float :overlay-at (-> consts w)) + (strip-giftag qword :inline :overlay-at (-> data 7)) + (col-adgif qword :inline :overlay-at (-> data 8)) + (save uint128 5 :overlay-at (-> data 9)) + (sun-fan-giftag qword :inline :overlay-at (-> data 14)) + (sun-strip-giftag qword :inline :overlay-at (-> data 15)) + (sun-alpha qword :inline :overlay-at (-> data 16)) + (sun-alpha-giftag qword :inline :overlay-at (-> data 17)) ) - :method-count-assert 9 - :size-assert #x120 - :flag-assert #x900000120 ) ;; skipping old sky stuff (for now) @@ -142,4 +138,4 @@ (sky-set-orbit *sky-parms* 0 12.5 -15.0 0.0 9950.0 300.0 300.0) (sky-set-orbit *sky-parms* 1 4.0 0.0 60.0 9950.0 120.0 120.0) -(sky-set-orbit *sky-parms* 2 0.0 0.0 -10.0 9950.0 0.0 0.0) \ No newline at end of file +(sky-set-orbit *sky-parms* 2 0.0 0.0 -10.0 9950.0 0.0 0.0) diff --git a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-h.gc b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-h.gc index 40adb496c15..df9801cd478 100644 --- a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-h.gc +++ b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-h.gc @@ -44,73 +44,64 @@ ) (deftype sparticle-cpuinfo (structure) - ((sprite sprite-vec-data-2d :offset-assert 0) - (adgif adgif-shader :offset-assert 4) - (radius float :offset-assert 8) - (omega float :offset-assert 12) - (vel-sxvel vector :inline :offset-assert 16) - (rot-syvel vector :inline :offset-assert 32) - (fade rgbaf :inline :offset-assert 48) - (acc vector :inline :offset-assert 64) - (rotvel3d quaternion :inline :offset-assert 80) - (vel vector3s :inline :offset 16) - (accel vector3s :inline :offset 64) - (scalevelx float :offset 28) - (scalevely float :offset 44) - (friction float :offset-assert 96) - (timer int32 :offset-assert 100) - (flags sp-cpuinfo-flag :offset-assert 104) - (user-int32 int32 :offset-assert 108) - (user-uint32 uint32 :offset 108) - (user-float float :score 100 :offset 108) - (user-pntr uint32 :offset 108) - (user-sprite sprite-vec-data-2d :offset 108) - (func basic :offset-assert 112) - (next-time uint32 :offset-assert 116) - (next-launcher basic :offset-assert 120) - (cache-alpha float :offset-assert 124) - (valid symbol :offset-assert 128) - (key sparticle-launch-control :offset-assert 132) - (binding sparticle-launch-state :offset-assert 136) - (data uint32 1 :offset 12) - (dataf float 1 :offset 12) - (datac uint8 1 :offset 12) + ((sprite sprite-vec-data-2d) + (adgif adgif-shader) + (radius float) + (omega float) + (vel-sxvel vector :inline) + (rot-syvel vector :inline) + (fade rgbaf :inline) + (acc vector :inline) + (rotvel3d quaternion :inline) + (vel vector3s :inline :overlay-at (-> vel-sxvel x)) + (accel vector3s :inline :overlay-at (-> acc x)) + (scalevelx float :overlay-at (-> vel-sxvel w)) + (scalevely float :overlay-at (-> rot-syvel w)) + (friction float) + (timer int32) + (flags sp-cpuinfo-flag) + (user-int32 int32) + (user-uint32 uint32 :overlay-at user-int32) + (user-float float :overlay-at user-int32) + (user-pntr uint32 :overlay-at user-int32) + (user-sprite sprite-vec-data-2d :overlay-at user-int32) + (func basic) + (next-time uint32) + (next-launcher basic) + (cache-alpha float) + (valid symbol) + (key sparticle-launch-control) + (binding sparticle-launch-state) + (data uint32 1 :overlay-at omega) + (dataf float 1 :overlay-at omega) + (datac uint8 1 :overlay-at omega) ) - :method-count-assert 9 - :size-assert #x8c - :flag-assert #x90000008c - ;; field key is a basic loaded with a signed load ) (deftype sparticle-launchinfo (structure) - ((launchrot vector :inline :offset-assert 0) - (conerot vector :inline :offset-assert 16) - (coneradius float :offset-assert 32) - (rotate-y float :offset-assert 36) - (data uint8 1 :offset 0) + ((launchrot vector :inline) + (conerot vector :inline) + (coneradius float) + (rotate-y float) + (data uint8 1 :overlay-at (-> launchrot x)) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) + (deftype sparticle-system (basic) - ((blocks int32 2 :offset-assert 4) - (length int32 2 :offset-assert 12) - (num-alloc int32 2 :offset-assert 20) - (is-3d basic :offset-assert 28) - (flags uint32 :offset-assert 32) - (alloc-table (pointer uint64) :offset-assert 36) - (cpuinfo-table (inline-array sparticle-cpuinfo) :offset-assert 40) - (vecdata-table pointer :offset-assert 44) - (adgifdata-table (inline-array adgif-shader) :offset-assert 48) + ((blocks int32 2) + (length int32 2) + (num-alloc int32 2) + (is-3d basic) + (flags uint32) + (alloc-table (pointer uint64)) + (cpuinfo-table (inline-array sparticle-cpuinfo)) + (vecdata-table pointer) + (adgifdata-table (inline-array adgif-shader)) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 (:methods - (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_ 0) + (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_) ) ) diff --git a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h.gc b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h.gc index efe8778eb90..cb422f555df 100644 --- a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h.gc +++ b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h.gc @@ -132,40 +132,43 @@ (launcher 6) ;; launcher from id ) +(defenum sp-group-flag + :bitfield #t + :type uint16 + (use-local-clock 0) + (always-draw 1) + (screen-space 2) + (unknown-bit-01 3) ;; beach-part + ) + ;; DECOMP BEGINS ;; This describes the initial value and some more info for a single field ;; Note that there are overlays here and some values only make sense in some ;; cases. (deftype sp-field-init-spec (structure) - ((field sp-field-id :offset-assert 0) - (flags sp-flag :offset-assert 2) - (initial-valuef float :offset-assert 4) - (random-rangef float :offset-assert 8) - (random-multf float :offset-assert 12) - (initial-value int32 :offset 4) - (random-range int32 :offset 8) - (random-mult int32 :offset 12) - (func symbol :offset 4) - (tex texture-id :offset 4) - (pntr pointer :offset 4) - (sym symbol :offset 4) - (sound sound-spec :offset 4) + ((field sp-field-id) + (flags sp-flag) + (initial-valuef float) + (random-rangef float) + (random-multf float) + (initial-value int32 :overlay-at initial-valuef) + (random-range int32 :overlay-at random-rangef) + (random-mult int32 :overlay-at random-multf) + (func symbol :overlay-at initial-valuef) + (tex texture-id :overlay-at initial-valuef) + (pntr pointer :overlay-at initial-valuef) + (sym symbol :overlay-at initial-valuef) + (sound sound-spec :overlay-at initial-valuef) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype sparticle-launcher (basic) - ((birthaccum float :offset-assert 4) - (soundaccum float :offset-assert 8) - (init-specs (inline-array sp-field-init-spec) :offset-assert 12) + ((birthaccum float) + (soundaccum float) + (init-specs (inline-array sp-field-init-spec)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (defenum sp-group-item-flag @@ -179,19 +182,16 @@ ) (deftype sparticle-group-item (structure) - ((launcher uint32 :offset-assert 0) - (fade-after meters :offset-assert 4) - (falloff-to meters :offset-assert 8) - (flags sp-group-item-flag :offset-assert 12) - (period uint16 :offset-assert 14) - (length uint16 :offset-assert 16) - (offset uint16 :offset-assert 18) - (hour-mask uint32 :offset-assert 20) - (binding uint32 :offset-assert 24) + ((launcher uint32) + (fade-after meters) + (falloff-to meters) + (flags sp-group-item-flag) + (period uint16) + (length uint16) + (offset uint16) + (hour-mask uint32) + (binding uint32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (defmacro sp-item (launcher @@ -228,73 +228,56 @@ (declare-type sparticle-cpuinfo structure) (deftype sparticle-launch-state (structure) - ((group-item sparticle-group-item :offset-assert 0) - (flags sp-launch-state-flags :offset-assert 4) - (randomize uint16 :offset-assert 6) - (origin vector :offset-assert 8) - (sprite3d sprite-vec-data-3d :offset-assert 12) - (sprite sparticle-cpuinfo :offset-assert 16) - (offset uint32 :offset-assert 20) - (accum float :offset-assert 24) - (spawn-time uint32 :offset-assert 28) - (swarm basic :offset 20) - (seed uint32 :offset 24) - (time uint32 :offset 28) - (spec basic :offset 16) - (id uint32 :offset 12) + ((group-item sparticle-group-item) + (flags sp-launch-state-flags) + (randomize uint16) + (origin vector) + (sprite3d sprite-vec-data-3d) + (sprite sparticle-cpuinfo) + (offset uint32) + (accum float) + (spawn-time uint32) + (swarm basic :overlay-at offset) + (seed uint32 :overlay-at accum) + (time uint32 :overlay-at spawn-time) + (spec basic :overlay-at sprite) + (id uint32 :overlay-at sprite3d) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) -(defenum sp-group-flag - :bitfield #t - :type uint16 - (use-local-clock 0) - (always-draw 1) - (screen-space 2) - (unknown-bit-01 3) ;; beach-part - ) (deftype sparticle-launch-group (basic) - ((length int16 :offset-assert 4) - (duration uint16 :offset-assert 6) - (linger-duration uint16 :offset-assert 8) - (flags sp-group-flag :offset-assert 10) - (name string :offset-assert 12) - (launcher (inline-array sparticle-group-item) :offset-assert 16) - (bounds sphere :inline :offset-assert 32) + ((length int16) + (duration uint16) + (linger-duration uint16) + (flags sp-group-flag) + (name string) + (launcher (inline-array sparticle-group-item)) + (bounds sphere :inline) ) - :method-count-assert 10 - :size-assert #x30 - :flag-assert #xa00000030 (:methods - (create-launch-control (_type_ process) sparticle-launch-control 9) + (create-launch-control (_type_ process) sparticle-launch-control) ) ) (deftype sparticle-launch-control (inline-array-class) - ((group sparticle-launch-group :offset-assert 16) - (proc process :offset-assert 20) - (local-clock int32 :offset-assert 24) - (fade float :offset-assert 28) - (matrix int32 :offset-assert 32) - (last-spawn-frame int32 :offset-assert 36) - (last-spawn-time int32 :offset-assert 40) - (center vector :inline :offset-assert 48) - (data sparticle-launch-state :inline :dynamic :offset-assert 64) + ((group sparticle-launch-group) + (proc process) + (local-clock int32) + (fade float) + (matrix int32) + (last-spawn-frame int32) + (last-spawn-time int32) + (center vector :inline) + (data sparticle-launch-state :inline :dynamic) ) - :method-count-assert 14 - :size-assert #x40 - :flag-assert #xe00000040 (:methods - (initialize (_type_ sparticle-launch-group process) none 9) - (is-visible? (_type_ vector) symbol 10) - (spawn (_type_ vector) object 11) - (kill-and-free-particles (_type_) none 12) - (kill-particles (_type_) none 13) + (initialize (_type_ sparticle-launch-group process) none) + (is-visible? (_type_ vector) symbol) + (spawn (_type_ vector) object) + (kill-and-free-particles (_type_) none) + (kill-particles (_type_) none) ) ) @@ -496,4 +479,4 @@ (new 'static 'sp-field-init-spec :field (sp-field-id spt-end)) ))) ) - ) \ No newline at end of file + ) diff --git a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher.gc b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher.gc index b382acee0b5..aaed590733b 100644 --- a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher.gc +++ b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher.gc @@ -18,23 +18,20 @@ (define *particle-300hz-timer* 0) (deftype sparticle-birthinfo (structure) - ((sprite uint32 :offset-assert 0) - (anim int32 :offset-assert 4) - (anim-speed float :offset-assert 8) - (birth-func basic :offset-assert 12) - (joint-ppoint int32 :offset-assert 16) - (num-to-birth float :offset-assert 20) - (sound basic :offset-assert 24) - (dataf float 1 :offset 0) - (data uint32 1 :offset 0) + ((sprite uint32) + (anim int32) + (anim-speed float) + (birth-func basic) + (joint-ppoint int32) + (num-to-birth float) + (sound basic) + (dataf float 1 :overlay-at sprite) + (data uint32 1 :overlay-at sprite) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) -(defmethod inspect sparticle-launcher ((this sparticle-launcher)) +(defmethod inspect ((this sparticle-launcher)) "Print out a sparticle-laucher, including its fields" (format #t "~X: sparticle-launcher~%" this) (let ((s5-0 0)) @@ -207,23 +204,17 @@ ;(defconstant SPARTICLE_QUEUE_SIZE 80)) (deftype sp-queued-launch-particles (structure) - ((sp-system sparticle-system :offset-assert 0) - (sp-launcher sparticle-launcher :offset-assert 4) - (pos vector :inline :offset-assert 16) + ((sp-system sparticle-system) + (sp-launcher sparticle-launcher) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; og:preserve-this constant (deftype sp-launch-queue (basic) - ((in-use int32 :offset-assert 4) - (queue sp-queued-launch-particles SPARTICLE_QUEUE_SIZE :inline :offset-assert 16) + ((in-use int32) + (queue sp-queued-launch-particles SPARTICLE_QUEUE_SIZE :inline) ) - :method-count-assert 9 - :size-assert #x410 - :flag-assert #x900000410 ) @@ -271,15 +262,12 @@ ;; this is where we'll store the actual adgifs (deftype particle-adgif-cache (basic) - ((used int32 :offset-assert 4) - (last uint16 :offset-assert 8) - (lastgif adgif-shader :offset-assert 12) - (tidhash uint16 80 :offset-assert 16) - (spadgif adgif-shader 80 :inline :offset-assert 176) + ((used int32) + (last uint16) + (lastgif adgif-shader) + (tidhash uint16 80) + (spadgif adgif-shader 80 :inline) ) - :method-count-assert 9 - :size-assert #x19b0 - :flag-assert #x9000019b0 ) @@ -812,7 +800,7 @@ ;; the launch-controls are always associated with a process. this allows the memory to be reclaimed once the ;; particles are despawned. -(defmethod initialize sparticle-launch-control ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) +(defmethod initialize ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) "start a particle effect." (let ((s5-0 0)) ;; init @@ -871,7 +859,7 @@ (none) ) -(defmethod create-launch-control sparticle-launch-group ((this sparticle-launch-group) (arg0 process)) +(defmethod create-launch-control ((this sparticle-launch-group) (arg0 process)) "create a launch-control to hold the state of the particles. stored on the process heap." (let ((gp-0 (the-as sparticle-launch-control (new 'process 'sparticle-launch-control (-> this length))))) (when (zero? gp-0) @@ -883,7 +871,7 @@ ) ) -(defmethod kill-and-free-particles sparticle-launch-control ((this sparticle-launch-control)) +(defmethod kill-and-free-particles ((this sparticle-launch-control)) "kill all the particles" ;; clear the flag. @@ -905,14 +893,14 @@ (none) ) -(defmethod kill-particles sparticle-launch-control ((this sparticle-launch-control)) +(defmethod kill-particles ((this sparticle-launch-control)) "kill the particles, but don't clear flags or free hvdfs." (kill-all-particles-with-key this) 0 (none) ) -(defmethod is-visible? sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) +(defmethod is-visible? ((this sparticle-launch-control) (arg0 vector)) "Is the effect visible?. arg0 is the offset of the effect" (let* ((v1-0 (-> this group)) (f0-0 (-> v1-0 bounds w)) @@ -960,7 +948,7 @@ ) -(defmethod spawn sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) +(defmethod spawn ((this sparticle-launch-control) (arg0 vector)) (set! (-> this center quad) (-> arg0 quad)) ;; og:preserve-this diff --git a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle.gc b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle.gc index 826d47b163b..e1b9b84c333 100644 --- a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle.gc +++ b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle.gc @@ -10,11 +10,7 @@ ;; DECOMP BEGINS -;;;;;;;;;;;;;;;;;;;;;;; -;; basic methods -;;;;;;;;;;;;;;;;;;;;;;; - -(defmethod print sparticle-cpuinfo ((this sparticle-cpuinfo)) +(defmethod print ((this sparticle-cpuinfo)) (format #t "~%") (dotimes (s5-0 16) (format #t "~D:~F~%" s5-0 (the-as float (-> this data s5-0))) @@ -24,7 +20,6 @@ ) (defun sp-particle-copy! ((arg0 sparticle-cpuinfo) (arg1 sparticle-cpuinfo)) - "copy some of the particle state." (let ((v1-1 (-> arg1 sprite x-y-z-sx quad))) (set! (-> arg0 sprite x-y-z-sx quad) v1-1) ) @@ -49,15 +44,14 @@ (none) ) -(defmethod new sparticle-system - ((allocation symbol) - (type-to-make type) - (arg0 int) - (arg1 int) - (arg2 symbol) - (arg3 pointer) - (arg4 (inline-array adgif-shader)) - ) +(defmethod new sparticle-system ((allocation symbol) + (type-to-make type) + (arg0 int) + (arg1 int) + (arg2 symbol) + (arg3 pointer) + (arg4 (inline-array adgif-shader)) + ) "allocate a particle system. arg0: number of group0's arg1: number of group1's @@ -104,10 +98,7 @@ ;; and to adgif (set! (-> gp-0 cpuinfo-table s4-1 adgif) (-> gp-0 adgifdata-table s4-1)) ;; default init adgifs. - (adgif-shader<-texture-simple! - (-> gp-0 adgifdata-table s4-1) - (the-as texture #f) - ) + (adgif-shader<-texture-simple! (-> gp-0 adgifdata-table s4-1) (the-as texture #f)) (set! (-> gp-0 adgifdata-table s4-1 alpha) (new 'static 'gs-alpha :b #x2 :d #x1)) ) ) @@ -123,12 +114,12 @@ ;; note: these constants must match the sizes of the sprite arrays. (define *sp-particle-system-2d* - (new 'global 'sparticle-system 1920 128 #f (-> *sprite-array-2d* vec-data) (-> *sprite-array-2d* adgif-data)) - ) + (new 'global 'sparticle-system 1920 128 #f (-> *sprite-array-2d* vec-data) (-> *sprite-array-2d* adgif-data)) + ) (define *sp-particle-system-3d* - (new 'global 'sparticle-system 256 0 #t (-> *sprite-array-3d* vec-data) (-> *sprite-array-3d* adgif-data)) - ) + (new 'global 'sparticle-system 256 0 #t (-> *sprite-array-3d* vec-data) (-> *sprite-array-3d* adgif-data)) + ) ;;;;;;;;;;;;;;;;;;;; ;; alloc and block @@ -182,23 +173,21 @@ ;; clear flags on our launch state. (if (and (-> arg2 binding) (nonzero? (-> arg2 binding))) - (logclear! (-> arg2 binding flags) - (sp-launch-state-flags launcher-active particles-active) - ) + (logclear! (-> arg2 binding flags) (sp-launch-state-flags launcher-active particles-active)) ) ;; clear the bit indicating that we're alive. (let ((v1-6 (/ arg1 64)) (t0-4 (logand arg1 63)) ) - (logior! (-> arg0 alloc-table v1-6) (ash 1 t0-4)) - ) + (logior! (-> arg0 alloc-table v1-6) (ash 1 t0-4)) + ) ;; decrease alloc count for the appropriate group (if (< arg1 (-> arg0 length 0)) - (+! (-> arg0 num-alloc 0) -1) - (+! (-> arg0 num-alloc 1) -1) - ) + (+! (-> arg0 num-alloc 0) -1) + (+! (-> arg0 num-alloc 1) -1) + ) (set! (-> arg2 valid) #f) (set! (-> arg3 a) 0.0) 0 @@ -293,11 +282,7 @@ ) (let ((s3-0 (new 'stack-no-clear 'matrix))) (set-vector! a1-1 (* f22-0 f28-1) 0.0 (* f22-0 f26-0) f0-5) - (quaternion*! - (-> arg1 rotvel3d) - (the-as quaternion a1-1) - (-> arg1 rotvel3d) - ) + (quaternion*! (-> arg1 rotvel3d) (the-as quaternion a1-1) (-> arg1 rotvel3d)) (quaternion-normalize! (-> arg1 rotvel3d)) (set-vector! s4-0 (* f26-0 f30-0) 0.0 (* f28-1 f30-0) 1.0) (quaternion->matrix s3-0 (-> arg1 rotvel3d)) @@ -320,15 +305,9 @@ ;; particle update ;;;;;;;;;;;;;;;;;;;;; -;; TODO sp-process-block-2d -;; TODO sp-process-block-3d -(define-extern sp-process-block-3d (function sparticle-system int int int int symbol none)) -(set! sp-process-block-3d (the (function sparticle-system int int int int symbol none) - (__pc-get-mips2c "sp-process-block-3d"))) -(define-extern sp-process-block-2d (function sparticle-system int int int int symbol none)) -(set! sp-process-block-2d (the (function sparticle-system int int int int symbol none) - (__pc-get-mips2c "sp-process-block-2d"))) +(def-mips2c sp-process-block-2d (function sparticle-system int int int int symbol none)) +(def-mips2c sp-process-block-3d (function sparticle-system int int int int symbol none)) (defun sp-copy-to-spr ((arg0 int) (arg1 pointer) (arg2 int)) ;; modified to use fake spad @@ -426,7 +405,10 @@ (define-perm *particles-flag* symbol #t) -(defun forall-particles-with-key-runner ((arg0 sparticle-launch-control) (arg1 (function sparticle-system sparticle-cpuinfo none)) (arg2 sparticle-system)) +(defun forall-particles-with-key-runner ((arg0 sparticle-launch-control) + (arg1 (function sparticle-system sparticle-cpuinfo none)) + (arg2 sparticle-system) + ) "call the given function on all particles with the given key (arg0)" (local-vars (sv-16 int)) (let ((s3-0 (the-as object (-> arg2 cpuinfo-table 0))) @@ -460,14 +442,18 @@ (none) ) -(defun forall-particles-with-key ((arg0 sparticle-launch-control) (arg1 (function sparticle-system sparticle-cpuinfo none)) (arg2 symbol) (arg3 symbol)) +(defun forall-particles-with-key ((arg0 sparticle-launch-control) + (arg1 (function sparticle-system sparticle-cpuinfo none)) + (arg2 symbol) + (arg3 symbol) + ) "call the given function on all particles with the given key. arg2 is 2d, arg3 is 3d." (if arg2 - (forall-particles-with-key-runner arg0 arg1 *sp-particle-system-2d*) - ) + (forall-particles-with-key-runner arg0 arg1 *sp-particle-system-2d*) + ) (if arg3 - (forall-particles-with-key-runner arg0 arg1 *sp-particle-system-3d*) - ) + (forall-particles-with-key-runner arg0 arg1 *sp-particle-system-3d*) + ) 0 (none) ) @@ -479,9 +465,7 @@ (set! (-> arg1 func) (the-as basic 0)) ;; don't let the callback run and save the timer (when (and (-> arg1 binding) (nonzero? (-> arg1 binding))) ;; kill the launcher too. - (logclear! (-> arg1 binding flags) - (sp-launch-state-flags launcher-active particles-active) - ) + (logclear! (-> arg1 binding flags) (sp-launch-state-flags launcher-active particles-active)) ;; and forget it, I guess it could be unloaded (set! (-> arg1 binding) #f) ) @@ -539,7 +523,6 @@ (none) ) - (defun forall-particles-runner ((arg0 (function sparticle-system sparticle-cpuinfo pointer none)) (arg1 sparticle-system)) "run function on all particles in the system." (let ((s4-0 (the-as object (-> arg1 cpuinfo-table 0))) @@ -588,13 +571,14 @@ (defun kill-all-particles-in-level ((arg0 level)) "kill all particles belonging to the given level." - (forall-particles (if (zero? (-> arg0 index)) - sparticle-kill-it-level0 - sparticle-kill-it-level1 - ) - #t - #t - ) + (forall-particles + (if (zero? (-> arg0 index)) + sparticle-kill-it-level0 + sparticle-kill-it-level1 + ) + #t + #t + ) 0 ) @@ -618,73 +602,71 @@ "main particle system update." (local-vars (v1-29 int) (gp-0 int)) (when *particles-flag* - 0 - 0 - ;;(.mfc0 gp-0 Count) - (set! *sp-launcher-lock* #t) - ;; start a profile frame. - (if *debug-segment* - (add-frame - (-> *display* frames (-> *display* on-screen) frame profile-bar 0) - 'draw - (new 'static 'rgba :r #x40 :b #x40 :a #x80) - ) - ) + 0 + 0 + ;;(.mfc0 gp-0 Count) + (set! *sp-launcher-lock* #t) + ;; start a profile frame. + (if *debug-segment* + (add-frame + (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'draw + (new 'static 'rgba :r #x40 :b #x40 :a #x80) + ) + ) - ;; update timer - (let ((v1-14 (logand (the-as int (-> *sp-frame-time* x)) 255))) - (set! *particle-300hz-timer* (+ *particle-300hz-timer* v1-14)) - (cond - (*sp-60-hz* - ;; this is such a hack, but we can never get 6 or 12 in 50hz mode - (when (or (= v1-14 6) (= v1-14 12)) - (set! *sp-60-hz* #f) - (all-particles-60-to-50) - ) - ) - (else - ;; also a hack - (when (or (= v1-14 5) (= v1-14 10)) - (set! *sp-60-hz* #t) - (all-particles-50-to-60) - ) - ) - ) - ) + ;; update timer + (let ((v1-14 (logand (the-as int (-> *sp-frame-time* x)) 255))) + (set! *particle-300hz-timer* (+ *particle-300hz-timer* v1-14)) + (cond + (*sp-60-hz* + (when (or (= v1-14 6) (= v1-14 12)) + (set! *sp-60-hz* #f) + (all-particles-60-to-50) + ) + ) + (else + (when (or (= v1-14 5) (= v1-14 10)) + (set! *sp-60-hz* #t) + (all-particles-50-to-60) + ) + ) + ) + ) - ;; process the particles - ;; og:preserve-this made this not run when paused, since aux sprites wont get added. - (unless (paused?) + ;; process the particles + ;; og:preserve-this made this not run when paused, since aux sprites wont get added. + (unless (paused?) (clear-sprite-aux-list)) - (sp-process-particle-system *sp-particle-system-2d* 0 *sprite-array-2d*) - (sp-process-particle-system *sp-particle-system-2d* 1 *sprite-array-2d*) - (sp-process-particle-system *sp-particle-system-3d* 0 (the-as sprite-array-2d *sprite-array-3d*)) - (if *debug-segment* - (add-frame - (-> *display* frames (-> *display* on-screen) frame profile-bar 0) - 'draw - (new 'static 'rgba :r #x80 :g #x80 :b #xff :a #x80) - ) - ) - (set! *sp-launcher-lock* #f) - - ;; launch queued particles - (sp-clear-queue) - ;;(.mfc0 v1-29 Count) - (let ((a2-5 (- v1-29 gp-0))) - (if *display-sprite-info* - (format - *stdcon* - "Particle time = ~D cycles for ~D 2D [~D warp] and ~D HUD and ~D 3D~%" - 1234 ;;a2-5 - (-> *sp-particle-system-2d* num-alloc 0) - (-> *sprite-aux-list* entry) - (-> *sp-particle-system-2d* num-alloc 1) - (-> *sp-particle-system-3d* num-alloc 0) + (sp-process-particle-system *sp-particle-system-2d* 0 *sprite-array-2d*) + (sp-process-particle-system *sp-particle-system-2d* 1 *sprite-array-2d*) + (sp-process-particle-system *sp-particle-system-3d* 0 (the-as sprite-array-2d *sprite-array-3d*)) + (if *debug-segment* + (add-frame + (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'draw + (new 'static 'rgba :r #x80 :g #x80 :b #xff :a #x80) + ) + ) + (set! *sp-launcher-lock* #f) + + ;; launch queued particles + (sp-clear-queue) + ;;(.mfc0 v1-29 Count) + (let ((a2-5 (- v1-29 gp-0))) + (if *display-sprite-info* + (format + *stdcon* + "Particle time = ~D cycles for ~D 2D [~D warp] and ~D HUD and ~D 3D~%" + a2-5 + (-> *sp-particle-system-2d* num-alloc 0) + (-> *sprite-aux-list* entry) + (-> *sp-particle-system-2d* num-alloc 1) + (-> *sp-particle-system-3d* num-alloc 0) + ) + ) ) - ) ) - ) 0 (none) ) diff --git a/goal_src/jak1/engine/gfx/sprite/sprite-distort.gc b/goal_src/jak1/engine/gfx/sprite/sprite-distort.gc index ae644b7a995..2a72a9af93b 100644 --- a/goal_src/jak1/engine/gfx/sprite/sprite-distort.gc +++ b/goal_src/jak1/engine/gfx/sprite/sprite-distort.gc @@ -12,18 +12,16 @@ ;; Scratch information used by the sprite-distorter. (deftype sprite-distorter-sine-tables (basic) - ((aspx float :offset-assert 4) - (aspy float :offset-assert 8) - (entry vector 128 :inline :offset-assert 16) - (ientry qword 9 :inline :offset-assert 2064) - (giftag gs-gif-tag :inline :offset-assert 2208) - (color qword :inline :offset-assert 2224) + ((aspx float) + (aspy float) + (entry vector 128 :inline) + (ientry qword 9 :inline) + (giftag gs-gif-tag :inline) + (color qword :inline) ) - :method-count-assert 9 - :size-assert #x8c0 - :flag-assert #x9000008c0 ) + (define *sprite-distorter-sine-tables* (new 'global 'sprite-distorter-sine-tables)) (defun sprite-distorter-generate-tables () @@ -47,21 +45,17 @@ ;; set entries (dotimes (i iterations) (let ((f26-0 (* 65536.0 (/ (the float i) (the float iterations))))) - (set-vector! - (-> tables entry entry-index) - (* (sin f26-0) cam-aspx) - (* (cos f26-0) cam-aspy) - 0.0 - 0.0 - ) - (set-vector! - (-> tables entry (+ entry-index 1)) - (* (* 0.001953125 cam-aspx) (sin f26-0)) - (* (* 0.00390625 cam-aspy) (cos f26-0)) - 0.0 - 0.0 + (set-vector! (-> tables entry entry-index) (* (sin f26-0) cam-aspx) (* (cos f26-0) cam-aspy) 0.0 0.0) + (let ((s3-1 (+ entry-index 1))) + (set-vector! + (-> tables entry s3-1) + (* 0.001953125 cam-aspx (sin f26-0)) + (* 0.00390625 cam-aspy (cos f26-0)) + 0.0 + 0.0 + ) + (set! entry-index (+ s3-1 1)) ) - (+! entry-index 2) ) ) (+! iterations 1) @@ -75,34 +69,32 @@ ) ) ;; set up giftag - (set! (-> tables giftag tag) - (new 'static 'gif-tag64 - :nloop 1 - :eop 1 - :pre 1 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :tme 1) - :nreg 15 - ) + (set! (-> tables giftag tag) (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :tme #x1) + :nreg #xf + ) ) ;; set up registers - (set! (-> tables giftag regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id st) - :regs1 (gif-reg-id rgbaq) - :regs2 (gif-reg-id xyzf2) - :regs3 (gif-reg-id st) - :regs4 (gif-reg-id rgbaq) - :regs5 (gif-reg-id xyzf2) - :regs6 (gif-reg-id st) - :regs7 (gif-reg-id rgbaq) - :regs8 (gif-reg-id xyzf2) - :regs9 (gif-reg-id st) - :regs10 (gif-reg-id rgbaq) - :regs11 (gif-reg-id xyzf2) - :regs12 (gif-reg-id st) - :regs13 (gif-reg-id rgbaq) - :regs14 (gif-reg-id xyzf2) - ) + (set! (-> tables giftag regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id st) + :regs1 (gif-reg-id rgbaq) + :regs2 (gif-reg-id xyzf2) + :regs3 (gif-reg-id st) + :regs4 (gif-reg-id rgbaq) + :regs5 (gif-reg-id xyzf2) + :regs6 (gif-reg-id st) + :regs7 (gif-reg-id rgbaq) + :regs8 (gif-reg-id xyzf2) + :regs9 (gif-reg-id st) + :regs10 (gif-reg-id rgbaq) + :regs11 (gif-reg-id xyzf2) + :regs12 (gif-reg-id st) + :regs13 (gif-reg-id rgbaq) + :regs14 (gif-reg-id xyzf2) + ) ) ;; set color (set! (-> tables color vector4w x) 128) @@ -220,12 +212,12 @@ (.lvf vf9 (&-> *math-camera* sprite-2d-hvdf quad)) ) (else - (.lvf vf3 (&-> *math-camera* camera-temp vector 0 quad)) - (.lvf vf4 (&-> *math-camera* camera-temp vector 1 quad)) - (.lvf vf5 (&-> *math-camera* camera-temp vector 2 quad)) - (.lvf vf6 (&-> *math-camera* camera-temp vector 3 quad)) - (.lvf vf9 (&-> *math-camera* hvdf-off quad)) - ) + (.lvf vf3 (&-> *math-camera* camera-temp vector 0 quad)) + (.lvf vf4 (&-> *math-camera* camera-temp vector 1 quad)) + (.lvf vf5 (&-> *math-camera* camera-temp vector 2 quad)) + (.lvf vf6 (&-> *math-camera* camera-temp vector 3 quad)) + (.lvf vf9 (&-> *math-camera* hvdf-off quad)) + ) ) (.lvf vf1 (&-> sv-16 x-y-z-sx quad)) (.lvf vf2 (&-> sv-16 color quad)) @@ -249,11 +241,7 @@ (set! (-> (the-as vector a0-1) w) 255.0) (set! (-> (the-as (pointer float) sv-32)) (* 0.001953125 (+ -1792.0 (-> (the-as vector a0-1) x)))) (set! (-> (the-as vector sv-32) y) - (* 0.00390625 - (+ (+ -2048.0 (the float (-> *video-parms* screen-hy))) - (-> (the-as vector a0-1) y) - ) - ) + (* 0.00390625 (+ -2048.0 (the float (-> *video-parms* screen-hy)) (-> (the-as vector a0-1) y))) ) ) (set! (-> (the-as vector sv-32) z) 1.0) @@ -290,19 +278,11 @@ (let* ((a0-8 arg0) (a1-3 (the-as object (-> a0-8 base))) ) - (set! - (-> (the-as dma-packet a1-3) dma) - (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc (* 3 s4-0)) - ) + (set! (-> (the-as dma-packet a1-3) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc (* 3 s4-0))) (set! (-> (the-as dma-packet a1-3) vif0) (new 'static 'vif-tag)) - (set! - (-> (the-as dma-packet a1-3) vif1) - (new 'static 'vif-tag - :cmd (vif-cmd unpack-v4-32) - :imm (shr (shl (+ (* 3 s5-0) 512) 54) 54) - :num (* 3 s4-0) + (set! (-> (the-as dma-packet a1-3) vif1) + (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :imm (shr (shl (+ (* 3 s5-0) 512) 54) 54) :num (* 3 s4-0)) ) - ) (set! (-> a0-8 base) (&+ (the-as pointer a1-3) 16)) ) (set! (-> arg0 base) v1-62) diff --git a/goal_src/jak1/engine/gfx/sprite/sprite-h.gc b/goal_src/jak1/engine/gfx/sprite/sprite-h.gc index c8ffa903649..bcfdb930789 100644 --- a/goal_src/jak1/engine/gfx/sprite/sprite-h.gc +++ b/goal_src/jak1/engine/gfx/sprite/sprite-h.gc @@ -10,87 +10,78 @@ ;; DECOMP BEGINS (deftype sprite-vec-data-2d (structure) - ((x-y-z-sx vector :inline :offset-assert 0) - (flag-rot-sy vector :inline :offset-assert 16) - (r-g-b-a vector :inline :offset-assert 32) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (sx float :offset 12) - (sy float :offset 28) - (rot float :offset 24) - (flag int32 :offset 16) - (matrix int32 :offset 20) - (warp-turns int32 :offset 16) - (r float :offset 32) - (g float :offset 36) - (b float :offset 40) - (a float :offset 44) - (trans vector3s :inline :offset 0) - (color rgbaf :inline :offset 32) - (data uint128 1 :offset 0) - (data64 uint64 6 :offset 0) + ((x-y-z-sx vector :inline) + (flag-rot-sy vector :inline) + (r-g-b-a vector :inline) + (x float :overlay-at (-> x-y-z-sx x)) + (y float :overlay-at (-> x-y-z-sx y)) + (z float :overlay-at (-> x-y-z-sx z)) + (sx float :overlay-at (-> x-y-z-sx w)) + (sy float :overlay-at (-> flag-rot-sy w)) + (rot float :overlay-at (-> flag-rot-sy z)) + (flag int32 :overlay-at (-> flag-rot-sy x)) + (matrix int32 :overlay-at (-> flag-rot-sy y)) + (warp-turns int32 :overlay-at (-> flag-rot-sy x)) + (r float :overlay-at (-> r-g-b-a x)) + (g float :overlay-at (-> r-g-b-a y)) + (b float :overlay-at (-> r-g-b-a z)) + (a float :overlay-at (-> r-g-b-a w)) + (trans vector3s :inline :overlay-at (-> x-y-z-sx x)) + (color rgbaf :inline :overlay-at (-> r-g-b-a x)) + (data uint128 1 :overlay-at (-> x-y-z-sx quad)) + (data64 uint64 6 :overlay-at (-> x-y-z-sx x)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype sprite-array-2d (basic) - ((num-sprites int32 2 :offset-assert 4) - (num-valid int32 2 :offset-assert 12) - (vec-data pointer :offset-assert 20) - (adgif-data (inline-array adgif-shader) :offset-assert 24) - (pad uint128 4 :offset-assert 32) - (data uint128 1 :offset-assert 96) + ((num-sprites int32 2) + (num-valid int32 2) + (vec-data pointer) + (adgif-data (inline-array adgif-shader)) + (pad uint128 4) + (data uint128 1) ) (:methods - (new (symbol type int int) _type_ 0) - ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 + (new (symbol type int int) _type_) + ) ) + (deftype sprite-vec-data-3d (structure) - ((x-y-z-sx vector :inline :offset-assert 0) - (qx-qy-qz-sy vector :inline :offset-assert 16) - (r-g-b-a vector :inline :offset-assert 32) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (sx float :offset 12) - (sy float :offset 28) - (qx float :offset 16) - (qy float :offset 20) - (qz float :offset 24) - (r float :offset 32) - (g float :offset 36) - (b float :offset 40) - (a float :offset 44) - (trans vector3s :inline :offset 0) - (rot vector3s :inline :offset 16) - (color rgbaf :inline :offset 32) - (data uint128 1 :offset 0) + ((x-y-z-sx vector :inline) + (qx-qy-qz-sy vector :inline) + (r-g-b-a vector :inline) + (x float :overlay-at (-> x-y-z-sx x)) + (y float :overlay-at (-> x-y-z-sx y)) + (z float :overlay-at (-> x-y-z-sx z)) + (sx float :overlay-at (-> x-y-z-sx w)) + (sy float :overlay-at (-> qx-qy-qz-sy w)) + (qx float :overlay-at (-> qx-qy-qz-sy x)) + (qy float :overlay-at (-> qx-qy-qz-sy y)) + (qz float :overlay-at (-> qx-qy-qz-sy z)) + (r float :overlay-at (-> r-g-b-a x)) + (g float :overlay-at (-> r-g-b-a y)) + (b float :overlay-at (-> r-g-b-a z)) + (a float :overlay-at (-> r-g-b-a w)) + (trans vector3s :inline :overlay-at (-> x-y-z-sx x)) + (rot vector3s :inline :overlay-at (-> qx-qy-qz-sy x)) + (color rgbaf :inline :overlay-at (-> r-g-b-a x)) + (data uint128 1 :overlay-at (-> x-y-z-sx quad)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype sprite-array-3d (basic) - ((num-sprites int32 2 :offset-assert 4) - (num-valid int32 2 :offset-assert 12) - (vec-data pointer :offset-assert 20) - (adgif-data (inline-array adgif-shader) :offset-assert 24) - (data uint128 1 :offset-assert 32) + ((num-sprites int32 2) + (num-valid int32 2) + (vec-data pointer) + (adgif-data (inline-array adgif-shader)) + (data uint128 1) ) (:methods - (new (symbol type int int) _type_ 0) - ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 + (new (symbol type int int) _type_) + ) ) (define-extern sprite-init-distorter (function dma-buffer uint none)) (define-extern sprite-draw-distorters (function dma-buffer none)) diff --git a/goal_src/jak1/engine/gfx/sprite/sprite.gc b/goal_src/jak1/engine/gfx/sprite/sprite.gc index 1b3a9b49301..2770872e4c2 100644 --- a/goal_src/jak1/engine/gfx/sprite/sprite.gc +++ b/goal_src/jak1/engine/gfx/sprite/sprite.gc @@ -18,12 +18,9 @@ ;; This is the first quadword of the data sent to VU1. ;; It contains the number of sprites that should be drawn. (deftype sprite-header (structure) - ((header qword 1 :inline :offset-assert 0) - (num-sprites int32 :offset 0) + ((header qword 1 :inline) + (num-sprites int32 :overlay-at (-> header 0 data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (defun sprite-setup-header ((hdr sprite-header) (num-sprites int)) @@ -39,21 +36,15 @@ ;; the meaning of this is unknown. ;; the first one in the list is special and the remaining 75 can be allocated/freed. (deftype sprite-hvdf-data (structure) - ((data qword 76 :inline :offset-assert 0) + ((data qword 76 :inline) ) - :method-count-assert 9 - :size-assert #x4c0 - :flag-assert #x9000004c0 ) ;; Each byte indicates if the corresponding entry in ;; sprite-hvdf-data is allocated or not. (deftype sprite-hvdf-control (structure) - ((alloc int8 76 :offset-assert 0) + ((alloc int8 76) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) (define *sprite-hvdf-data* (new 'global 'sprite-hvdf-data)) @@ -75,15 +66,12 @@ ;; pushes stuff onto it. (deftype sprite-aux-list (basic) - ((num-entries int32 :offset-assert 4) ;; capacity - (entry int32 :offset-assert 8) ;; current entry - (data sprite-vec-data-2d 1 :offset-assert 12) ;; "dynamic" array. + ((num-entries int32) ;; capacity + (entry int32) ;; current entry + (data sprite-vec-data-2d 1) ;; "dynamic" array. ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) @@ -104,7 +92,7 @@ ) ) -(defmethod inspect sprite-aux-list ((this sprite-aux-list)) +(defmethod inspect ((this sprite-aux-list)) (format #t "[~X] sprite-aux-list:~%" this) (format #t "~Tnum-entries: ~D~%" (-> this num-entries)) (format #t "~Tentry: ~D~%" (-> this entry)) @@ -136,39 +124,36 @@ ;; The sprite-frame-data is data transferred to VU1 and remains there for all chunks of sprites. (deftype sprite-frame-data (structure) - ((cdata vector 16 :inline :offset-assert 0) - (hmge-scale vector :inline :offset 256) ;; math camera value - (consts vector :inline :offset-assert 272) - (pfog0 float :offset 272) ;; math camera value - (deg-to-rad float :offset 276) ;; 2*pi / 65,536 - (min-scale float :offset 280) - (inv-area float :offset 284) - (adgif-giftag gs-gif-tag :inline :offset-assert 288) ;; sets adgif shader values - (sprite-2d-giftag gs-gif-tag :inline :offset-assert 304) ;; draws 2d sprites - (sprite-2d-giftag-2 gs-gif-tag :inline :offset-assert 320) ;; 2d with different settings - (sincos-01 vector :inline :offset-assert 336) - (sincos-23 vector :inline :offset-assert 352) - (sincos-45 vector :inline :offset-assert 368) - (sincos-67 vector :inline :offset-assert 384) - (sincos-89 vector :inline :offset-assert 400) - (basis-x vector :inline :offset-assert 416) - (basis-y vector :inline :offset-assert 432) - (sprite-3d-giftag gs-gif-tag :inline :offset-assert 448) ;; draws 3d sprites - (screen-shader adgif-shader :inline :offset-assert 464) - (clipped-giftag gs-gif-tag :inline :offset-assert 544) - (inv-hmge-scale vector :inline :offset-assert 560) ;; math camera value - (stq-offset vector :inline :offset-assert 576) - (stq-scale vector :inline :offset-assert 592) - (rgba-plain qword :inline :offset-assert 608) - (warp-giftag gs-gif-tag :inline :offset-assert 624) - (fog-clamp vector :inline :offset-assert 640) - (fog-min float :offset 640) - (fog-max float :offset 644) - (max-scale float :offset 648) + ((cdata vector 16 :inline) + (hmge-scale vector :inline) + (consts vector :inline) + (pfog0 float :overlay-at (-> consts x)) + (deg-to-rad float :overlay-at (-> consts y)) + (min-scale float :overlay-at (-> consts z)) + (inv-area float :overlay-at (-> consts w)) + (adgif-giftag gs-gif-tag :inline) + (sprite-2d-giftag gs-gif-tag :inline) + (sprite-2d-giftag-2 gs-gif-tag :inline) + (sincos-01 vector :inline) + (sincos-23 vector :inline) + (sincos-45 vector :inline) + (sincos-67 vector :inline) + (sincos-89 vector :inline) + (basis-x vector :inline) + (basis-y vector :inline) + (sprite-3d-giftag gs-gif-tag :inline) + (screen-shader adgif-shader :inline) + (clipped-giftag gs-gif-tag :inline) + (inv-hmge-scale vector :inline) + (stq-offset vector :inline) + (stq-scale vector :inline) + (rgba-plain qword :inline) + (warp-giftag gs-gif-tag :inline) + (fog-clamp vector :inline) + (fog-min float :overlay-at (-> fog-clamp x)) + (fog-max float :overlay-at (-> fog-clamp y)) + (max-scale float :overlay-at (-> fog-clamp z)) ) - :method-count-assert 9 - :size-assert #x290 - :flag-assert #x900000290 ) (defun sprite-setup-frame-data ((data sprite-frame-data) (tbp-offset int)) diff --git a/goal_src/jak1/engine/gfx/texture/texture-h.gc b/goal_src/jak1/engine/gfx/texture/texture-h.gc index 4c40d0d8188..b46d4b7c433 100644 --- a/goal_src/jak1/engine/gfx/texture/texture-h.gc +++ b/goal_src/jak1/engine/gfx/texture/texture-h.gc @@ -37,12 +37,9 @@ ;; Any individual texture can be uniquely identified with a texture-id. (deftype texture-id (uint32) - ((index uint16 :offset 8 :size 12) ;; index of texture in its tpage - (page uint16 :offset 20 :size 12) ;; tpage number + ((index uint16 :offset 8 :size 12) + (page uint16 :offset 20 :size 12) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -52,13 +49,10 @@ ;; A texture-pool-segment is a chunk of VRAM used to store textures (deftype texture-pool-segment (structure) - ((dest uint32 :offset-assert 0) ;; VRAM address (4-byte VRAM words) - (size uint32 :offset-assert 4) ;; size in 4-byte VRAM words + ((dest uint32) + (size uint32) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (declare-type texture-page basic) @@ -66,48 +60,44 @@ ;; There is a single texture-pool which manages storing textures in VRAM (deftype texture-pool (basic) - ((top int32 :offset-assert 4) ;; seems be 0 always, start of VRAM managed by pool - (cur int32 :offset-assert 8) ;; highest address in use by the pool + ((top int32) ;; seems be 0 always, start of VRAM managed by pool + (cur int32) ;; highest address in use by the pool ;; the allocate function is used to add a texture-page to the pool. - (allocate-func (function texture-pool texture-page kheap int texture-page) :offset-assert 12) + (allocate-func (function texture-pool texture-page kheap int texture-page)) ;; the location of the color look-up table for font texture (vram word idx) - (font-palette int32 :offset-assert 16) + (font-palette int32) - ;; these were reordered ;; we have 4 segments, but only the near and common are used. - (segment-near texture-pool-segment :inline :offset-assert 20) - (segment-common texture-pool-segment :inline :offset-assert 28) - (segment texture-pool-segment 4 :inline :offset 20) + (segment texture-pool-segment 4 :inline) + (segment-near texture-pool-segment :inline :overlay-at (-> segment 0)) + (segment-common texture-pool-segment :inline :overlay-at (-> segment 1)) ;; tpages that are not part of level textures are stored here. - (common-page texture-page 32 :offset-assert 52) + (common-page texture-page 32) ;; ?? - (common-page-mask int32 :offset-assert 180) + (common-page-mask int32) ;; for each pool page, stores the id of the tpage which is currently loaded in VRAM. - (ids uint32 126 :offset-assert 184) + (ids uint32 126) ) - :method-count-assert 23 - :size-assert #x2b0 - :flag-assert #x17000002b0 (:methods - (new (symbol type) _type_ 0) - (initialize! (_type_) _type_ 9) - (print-usage (_type_) _type_ 10) - (setup-font-texture! (_type_) none 11) - (allocate-defaults! (_type_) none 12) - (login-level-textures (_type_ level int (pointer texture-id)) none 13) - (add-tex-to-dma! (_type_ level int) none 14) - (allocate-vram-words! (_type_ int) int 15) - (allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment 16) - (unused-17 () none 17) - (unused-18 () none 18) - (unused-19 () none 19) - (unload! (_type_ texture-page) int 20) - (upload-one-common! (_type_ level) symbol 21) - (lookup-boot-common-id (_type_ int) int 22) - ) + (new (symbol type) _type_) + (initialize! (_type_) _type_) + (print-usage (_type_) _type_) + (setup-font-texture! (_type_) none) + (allocate-defaults! (_type_) none) + (login-level-textures (_type_ level int (pointer texture-id)) none) + (add-tex-to-dma! (_type_ level int) none) + (allocate-vram-words! (_type_ int) int) + (allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment) + (unused-17 () none) + (unused-18 () none) + (unused-19 () none) + (unload! (_type_ texture-page) int) + (upload-one-common! (_type_ level) symbol) + (lookup-boot-common-id (_type_ int) int) + ) ) @@ -120,74 +110,67 @@ ;; This refers to data stored elsewhere, either in the data of a tpage or VRAM. ;; After a tpage has been allocated, the dest will be the VRAM address of the texture. (deftype texture (basic) - ((w int16 :offset-assert 4) - (wu uint16 :offset 4) ;; inline asm read this as u16 - (h int16 :offset-assert 6) - (hu uint16 :offset 6) - (num-mips uint8 :offset-assert 8) ;; number of mipmap levels - (tex1-control uint8 :offset-assert 9) ;; ? - (psm gs-psm :offset-assert 10) ;; texture format - (mip-shift uint8 :offset-assert 11) - (clutpsm uint16 :offset-assert 12) ;; color look-up table format - (dest uint16 7 :offset-assert 14) ;; per mip VRAM address - (clutdest uint16 :offset-assert 28) ;; color look-up table location. - (width uint8 7 :offset-assert 30) ;; per mip - (name string :offset-assert 40) - (size uint32 :offset-assert 44) - (uv-dist float :offset-assert 48) - (masks uint32 3 :offset-assert 52) + ((w int16) + (wu uint16 :overlay-at w) + (h int16) + (hu uint16 :overlay-at h) + (num-mips uint8) + (tex1-control uint8) + (psm gs-psm) + (mip-shift uint8) + (clutpsm uint16) + (dest uint16 7) + (clutdest uint16) + (width uint8 7) + (name string) + (size uint32) + (uv-dist float) + (masks uint32 3) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; tpages themselves are divided into segments. ;; some renderers may know ahead of time that they don't need all segments ;; and can skip uploading unused texture data. (deftype texture-page-segment (structure) - ((block-data pointer :offset-assert 0) ;; location in EE memory of texture data. - (size uint32 :offset-assert 4) ;; ?? units - (dest uint32 :offset-assert 8) ;; VRAM destination where it will be loaded to. + ((block-data pointer) + (size uint32) + (dest uint32) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) + (defun texture-mip->segment ((arg0 int) (arg1 int)) "Convert a mip level to the segment that it is stored in." - (if (>= 2 arg1) (+ (- -1 arg0) arg1) (max 0 (- 2 arg0))) + (if (>= 2 arg1) + (+ (- -1 arg0) arg1) + (max 0 (- 2 arg0)) + ) ) ;; The actual texture-page header ;; After the dynamic array of texture is the actual texture data. ;; This may be thrown away if the texture is permanently in VRAM. (deftype texture-page (basic) - ((info file-info :offset-assert 4) - (name basic :offset-assert 8) - (id uint32 :offset-assert 12) - (length int32 :offset-assert 16) ;; number of textures. - (mip0-size uint32 :offset-assert 20) - (size uint32 :offset-assert 24) ;; VRAM words - (segment texture-page-segment 3 :inline :offset-assert 28) - (pad uint32 16 :offset-assert 64) - - ;; array of texture descriptions. - (data texture :dynamic :offset-assert 128) + ((info file-info) + (name basic) + (id uint32) + (length int32) + (mip0-size uint32) + (size uint32) + (segment texture-page-segment 3 :inline) + (pad uint32 16) + (data texture :dynamic) ) - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (remove-from-heap (_type_ kheap) _type_ 9) - (get-leftover-block-count (_type_ int int) int 10) - (unused-11 () none 11) - (relocate-dests! (_type_ int int) none 12) - (add-to-dma-buffer (_type_ dma-buffer int) int 13) - (upload-now! (_type_ int) none 14) + (relocate (_type_ kheap (pointer uint8)) none :replace) + (remove-from-heap (_type_ kheap) _type_) + (get-leftover-block-count (_type_ int int) int) + (unused-11 () none) + (relocate-dests! (_type_ int int) none) + (add-to-dma-buffer (_type_ dma-buffer int) int) + (upload-now! (_type_ int) none) ) ) @@ -205,47 +188,38 @@ ;; the A+D format only uses bits 0-72, this fits in 72-96. The use of 96-128 is unknown ;; the shader value must be multiplied by 16 first. (deftype shader-ptr (uint32) - ((shader uint32 :offset 8 :size 24)) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 + ((shader uint32 :offset 8 :size 24) + ) ) ;; This is a dynamic array of shader-ptrs ;; There will be one array per texture-page, and this array will have one entry per texture. ;; These arrays will be allocated by the texture system and stored in level heaps. (deftype texture-link (structure) - ((next shader-ptr 1 :offset-assert 0) + ((next shader-ptr 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; Each texture-page will have a texture-page-dir-entry for it (deftype texture-page-dir-entry (structure) - ((length int16 :offset-assert 0) ;; number of textures - (status uint16 :offset-assert 2) ;; ?? - (page texture-page :offset-assert 4) ;; the actual texture page - (link texture-link :offset-assert 8) ;; the array of texture-links, per texture. #f if unallocated + ((length int16) + (status uint16) + (page texture-page) + (link texture-link) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; There is a single texture-page-dir with a slot for each texture-page. ;; It's stored on the DVD and loaded with the engine. (deftype texture-page-dir (basic) - ((length int32) - (entries texture-page-dir-entry 1 :inline) + ((length int32) + (entries texture-page-dir-entry 1 :inline) ) (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (unlink-textures-in-heap! (_type_ kheap) int 9) - ) - :flag-assert #xa00000014 + (relocate (_type_ kheap (pointer uint8)) none :replace) + (unlink-textures-in-heap! (_type_ kheap) int) + ) ) @@ -258,16 +232,13 @@ ;; The texture system will set this up, then the level system will do this when there's time. (deftype texture-relocate-later (basic) - ((memcpy symbol :offset-assert 4) ;; set to #t when there's a pending copy - (dest uint32 :offset-assert 8) ;; destination address - (source uint32 :offset-assert 12) ;; source address - (move uint32 :offset-assert 16) ;; size to move - (entry texture-page-dir-entry :offset-assert 20) ;; the entry for the page we're moving - (page texture-page :offset-assert 24) ;; the page header. + ((memcpy symbol) + (dest uint32) + (source uint32) + (move uint32) + (entry texture-page-dir-entry) + (page texture-page) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) @@ -294,50 +265,45 @@ ;; The actual adgif-shader is a 5 quadwords of A+D for GIF PACKED mode. ;; there is some extra data snuck in. (deftype adgif-shader (structure) - ((quad qword 5 :score -100 :inline :offset 0) - (prims gs-reg64 10 :score -100 :offset 0) + ((quad qword 5 :inline :offset 0) + (prims gs-reg64 10 :overlay-at quad) ;; tex0, contains texture location, size, format, clut settings - (tex0 gs-tex0 :offset 0) + (tex0 gs-tex0 :overlay-at (-> prims 0)) ;; prims 1 is the register id ;; prims 1 is shared with the link-test bitfield. ;; tex1, more texture information (LOD/MIP setup) - (tex1 gs-tex1 :offset 16) + (tex1 gs-tex1 :overlay-at (-> prims 2)) ;; prims 3 ;; prims 3 is shared with texture-id ;; miptb1, mip addresses/widths (levels 1 - 3) - (miptbp1 gs-miptbp :offset 32) + (miptbp1 gs-miptbp :overlay-at (-> prims 4)) ;; prims 5 ;; prims 5 is shared with the next shader-ptr ;; clamp, used for texture wrapping - (clamp gs-clamp :offset 48) - (clamp-reg gs-reg64 :offset 56) ;; or prims 7 + (clamp gs-clamp :overlay-at (-> prims 6)) + (clamp-reg gs-reg64 :overlay-at (-> prims 7)) ;; alpha blending. NOTE: this can also be miptbp2 (mip 4+ settings) - (alpha gs-alpha :offset 64) - (alpha-as-miptb2 gs-miptbp :offset 64) + (alpha gs-alpha :overlay-at (-> prims 8)) + (alpha-as-miptb2 gs-miptbp :overlay-at alpha) ;; prims 9 ;; sneaky overlays - (link-test link-test-flags :offset 8) ;; don't touch lower 8 bits of this - (texture-id texture-id :offset 24) ;; ok to touch all bits - (next shader-ptr :offset 40) ;; don't touch lower 8 bits of this + (link-test link-test-flags :overlay-at (-> prims 1)) ;; don't touch lower 8 bits of this + (texture-id texture-id :overlay-at (-> prims 3)) ;; ok to touch all bits + (next shader-ptr :overlay-at (-> prims 5)) ;; don't touch lower 8 bits of this ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) + (deftype adgif-shader-array (inline-array-class) - ((data adgif-shader :inline :dynamic :offset 16) + ((data adgif-shader :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> adgif-shader-array heap-base) 80) diff --git a/goal_src/jak1/engine/gfx/texture/texture.gc b/goal_src/jak1/engine/gfx/texture/texture.gc index bcf216289f6..88da443413f 100644 --- a/goal_src/jak1/engine/gfx/texture/texture.gc +++ b/goal_src/jak1/engine/gfx/texture/texture.gc @@ -99,7 +99,7 @@ ;; You can check for this by looking at the texture-pool ids. ;; Or, use the upload-vram-pages function which will add uploads to a DMA chain only if needed. -(defmethod print texture-page ((this texture-page)) +(defmethod print ((this texture-page)) "Print a short description of a texture page." (format #t "#" (-> this name) @@ -111,17 +111,17 @@ this ) -(defmethod length texture-page ((this texture-page)) +(defmethod length ((this texture-page)) "Get the number of textures in a texture page" (-> this length) ) -(defmethod asize-of texture-page ((this texture-page)) +(defmethod asize-of ((this texture-page)) "Get the size in memory of a texture page object, not including the actual texture objects or texture data" (the-as int (+ (-> this type size) (the-as uint (shl (-> this length) 2)))) ) -(defmethod mem-usage texture-page ((this texture-page) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this texture-page) (arg0 memory-usage-block) (arg1 int)) "Update the mem-usage for a texture." ;; some setup for texture memory usage. @@ -235,7 +235,7 @@ ;; after load, these point to location of the texture in VRAM _if the texture were uploaded to address 0_. ;; these records will be updated to point to the correct spot in VRAM by the texture allocators. -(defmethod print texture ((this texture)) +(defmethod print ((this texture)) "Print out texture object, describing the texture format." (format #t "# this name) @@ -465,7 +465,7 @@ ) ) -(defmethod allocate-vram-words! texture-pool ((this texture-pool) (word-count int)) +(defmethod allocate-vram-words! ((this texture-pool) (word-count int)) "Allocate words in vram. Returns the index of the first word." (let ((v0-0 (-> this cur))) (set! (-> this cur) (+ (-> this cur) word-count)) @@ -476,7 +476,7 @@ ;; boot common textures are "common" textures that are loaded at boot, but will live in RAM ;; and be uploaded to VRAM as needed. -(defmethod lookup-boot-common-id texture-pool ((this texture-pool) (arg0 int)) +(defmethod lookup-boot-common-id ((this texture-pool) (arg0 int)) "Map these special textures to a number betwen 0 and 19. For other textures, return -1. NOTE: hud means start menu + zoomer, not the usual health HUD." (case arg0 @@ -546,7 +546,7 @@ ) ) -(defmethod initialize! texture-pool ((this texture-pool)) +(defmethod initialize! ((this texture-pool)) "Initialize (or maybe reinitialize) a texture pool." ;; reset allocator (set! (-> this cur) 0) @@ -573,7 +573,7 @@ this ) -(defmethod get-leftover-block-count texture-page ((this texture-page) (segment-count int) (additional-size int)) +(defmethod get-leftover-block-count ((this texture-page) (segment-count int) (additional-size int)) "This returns how many blocks are used in the last pool page. It uses pool-pages, which are 64 blocks or 16 kB." (let ((v1-0 additional-size)) @@ -584,7 +584,7 @@ ) ) -(defmethod print-usage texture-pool ((this texture-pool)) +(defmethod print-usage ((this texture-pool)) "Print out VRAM usage." (format #t "--------------------~%") (format #t "texture pool ~DK - ~DK (~DK used, ~DK free)~%" @@ -597,7 +597,7 @@ this ) -(defmethod allocate-segment! texture-pool ((this texture-pool) (segment texture-pool-segment) (size int)) +(defmethod allocate-segment! ((this texture-pool) (segment texture-pool-segment) (size int)) "Allocate a segment of the given size. The segment is an output here, containing size/dest." (set! (-> segment size) (the-as uint size)) (set! (-> segment dest) (the-as uint (allocate-vram-words! this size))) @@ -611,7 +611,7 @@ (defconstant SPECIAL_VRAM_WORDS #x7000) ;; for sky, eyes, ocean, and depth-cue effect rendering. -(defmethod allocate-defaults! texture-pool ((this texture-pool)) +(defmethod allocate-defaults! ((this texture-pool)) "Allocate default segments" ;; allocate the common and near segments (allocate-segment! this (-> this segment-common) COMMON_SEGMENT_WORDS) ;; ~0.5 MB @@ -639,7 +639,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod remove-from-heap texture-page ((this texture-page) (seg kheap)) +(defmethod remove-from-heap ((this texture-page) (seg kheap)) "Remove the texture data from the heap. This can only safely be called immediately after the texture-page is loaded. This is used for textures that always live in VRAM." @@ -1363,7 +1363,7 @@ ;; It will also link the textures. ;; You _must_ login textures. -(defmethod login-level-textures texture-pool ((this texture-pool) (level level) (max-page-kind int) (id-array (pointer texture-id))) +(defmethod login-level-textures ((this texture-pool) (level level) (max-page-kind int) (id-array (pointer texture-id))) "Login textures in a level. Only does up to max-page-kind. Set this to water (4) to do all of them. Also checks sizes. This is called from level.gc as part of level loading." @@ -1441,7 +1441,7 @@ ;; for movie hack. (defun-extern movie? symbol) -(defmethod add-tex-to-dma! texture-pool ((this texture-pool) (level level) (tex-page-kind int)) +(defmethod add-tex-to-dma! ((this texture-pool) (level level) (tex-page-kind int)) "For the given tpage-kind, upload as needed for the level" (when (= tex-page-kind (tpage-kind tfrag)) ;; TFRAG (0) ;; get the texture page, bucket to add to, and an effective distance from the closest thing. @@ -1591,7 +1591,7 @@ (none) ) -(defmethod upload-one-common! texture-pool ((this texture-pool) (lev level)) +(defmethod upload-one-common! ((this texture-pool) (lev level)) "Upload the first common texture page that's in in the common-page-mask." (dotimes (v1-0 32) (let ((a2-0 (-> this common-page v1-0))) @@ -1607,7 +1607,7 @@ #f ) -(defmethod add-irq-to-tex-buckets! level ((this level)) +(defmethod add-irq-to-tex-buckets! ((this level)) "Adds a packet that will cause a VIF interrupt to the end of all texture buckets for a given level. This will trigger a VU1 profiler bar" (cond @@ -1692,7 +1692,7 @@ ;; the actual texture data doesn't go in the buffer, just tags to set up the transfer (define *txt-dma-list* (new 'global 'dma-buffer 4096)) -(defmethod upload-now! texture-page ((this texture-page) (arg0 int)) +(defmethod upload-now! ((this texture-page) (arg0 int)) "Immediately upload the texture-page to the given buffer, using arg0 mode." (#when PC_PORT @@ -1731,7 +1731,7 @@ (none) ) -(defmethod add-to-dma-buffer texture-page ((this texture-page) (dma-buff dma-buffer) (mode int)) +(defmethod add-to-dma-buffer ((this texture-page) (dma-buff dma-buffer) (mode int)) "Helper for upload-now! to upload texture-page to VRAM" (local-vars (total-size int)) (let ((v1-0 mode)) @@ -1883,7 +1883,7 @@ ;; The font texture is a special case. (define-perm *font-texture* texture #f) -(defmethod setup-font-texture! texture-pool ((this texture-pool)) +(defmethod setup-font-texture! ((this texture-pool)) "Move the font textures to the upper 8-bits of the depth buffer." (local-vars (heap-before-font-tex int) (clut-dest-addr int)) ;; we reserved some space for the CLUT earlier. I guess it didn't fit in the depth buffer too @@ -2008,17 +2008,17 @@ ;; The texture page directory is a list of all texture pages. ;; It is actually stored in the dir-tpages.o object file, which is pre-populated with lengths. -(defmethod asize-of texture-page-dir ((this texture-page-dir)) +(defmethod asize-of ((this texture-page-dir)) "Get the size in memory of a texture-page-dir" (the-as int (+ (-> texture-page-dir size) (the-as uint (* 12 (+ (-> this length) -1))))) ) -(defmethod length texture-page-dir ((this texture-page-dir)) +(defmethod length ((this texture-page-dir)) "Get the number of tpages in the texture-page-dir" (-> this length) ) -(defmethod relocate texture-page-dir ((this texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate ((this texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) "Load a texture-page-dir" ;; just set the global. (tex-dbg "Loaded texture-page-dir ~A with ~D entries~%" this (-> this length)) @@ -2026,7 +2026,7 @@ (none) ) -(defmethod relocate-dests! texture-page ((this texture-page) (new-dest int) (seg-id int)) +(defmethod relocate-dests! ((this texture-page) (new-dest int) (seg-id int)) "Update a texture-page so all the textures point to a new location" (let ((v1-0 (shr new-dest 6)) (dst-block (shr (-> this segment seg-id dest) 6)) @@ -2070,7 +2070,7 @@ (none) ) -(defmethod relocate texture-page ((this texture-page) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate ((this texture-page) (arg0 kheap) (arg1 (pointer uint8))) "Add to VRAM and allocate links. This method is called by the GOAL linker when it loads a texture page." (tex-dbg "loaded tpage ~A~%" this @@ -2203,7 +2203,7 @@ ) ) -(defmethod unload! texture-pool ((this texture-pool) (arg0 texture-page)) +(defmethod unload! ((this texture-pool) (arg0 texture-page)) "Unload the texture from the directory" (local-vars (a0-2 int)) (let ((v1-0 *texture-page-dir*)) @@ -2258,7 +2258,7 @@ ) ) -(defmethod unlink-textures-in-heap! texture-page-dir ((this texture-page-dir) (heap kheap)) +(defmethod unlink-textures-in-heap! ((this texture-page-dir) (heap kheap)) "Remove adgif shaders that are in the given heap" (local-vars (dist-past-end uint)) (let ((mem-start (-> heap base)) @@ -2627,7 +2627,7 @@ (none) ) -(defmethod inspect texture-page-dir ((this texture-page-dir)) +(defmethod inspect ((this texture-page-dir)) (texture-page-dir-inspect this #f) this ) diff --git a/goal_src/jak1/engine/gfx/tfrag/tfrag-h.gc b/goal_src/jak1/engine/gfx/tfrag/tfrag-h.gc index 6c6a883d823..06e432600b9 100644 --- a/goal_src/jak1/engine/gfx/tfrag/tfrag-h.gc +++ b/goal_src/jak1/engine/gfx/tfrag/tfrag-h.gc @@ -9,252 +9,205 @@ ;; definition of type tfragment-stats (deftype tfragment-stats (structure) - ((num-tris uint16 4 :offset-assert 0) - (num-dverts uint16 4 :offset-assert 8) + ((num-tris uint16 4) + (num-dverts uint16 4) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype tfragment-debug-data (structure) - ((stats tfragment-stats :inline :offset-assert 0) - (debug-lines (array vector-array) :offset-assert 16) + ((stats tfragment-stats :inline) + (debug-lines (array vector-array)) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) + (deftype generic-tfragment (structure) - ((dummy int32 :offset-assert 0) + ((dummy int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) + (deftype tfragment (drawable) - ((color-index uint16 :offset 6) - (debug-data tfragment-debug-data :offset 8) - (color-indices uint32 :offset 12) - (colors uint32 :offset 12) - (dma-chain uint32 3 :offset-assert 32) - (dma-common uint32 :offset 32) - (dma-level-0 uint32 :offset 32) - (dma-base uint32 :offset 36) - (dma-level-1 uint32 :offset 40) - (dma-qwc uint8 4 :offset-assert 44) - (shader (inline-array adgif-shader) :offset 48) - (num-shaders uint8 :offset 52) - (num-base-colors uint8 :offset 53) - (num-level0-colors uint8 :offset 54) - (num-level1-colors uint8 :offset 55) - (color-offset uint8 :offset 56) - (color-count uint8 :offset 57) - (pad0 uint8 :offset 58) - (pad1 uint8 :offset 59) - (generic generic-tfragment :offset-assert 60) - (generic-u32 uint32 :offset 60) + ((color-index uint16 :offset 6) + (debug-data tfragment-debug-data :offset 8) + (color-indices uint32 :offset 12) + (colors uint32 :overlay-at color-indices) + (dma-chain uint32 3) + (dma-common uint32 :overlay-at (-> dma-chain 0)) + (dma-level-0 uint32 :overlay-at (-> dma-chain 0)) + (dma-base uint32 :overlay-at (-> dma-chain 1)) + (dma-level-1 uint32 :overlay-at (-> dma-chain 2)) + (dma-qwc uint8 4 :offset 44) + (shader (inline-array adgif-shader) :offset 48) + (num-shaders uint8 :offset 52) + (num-base-colors uint8 :offset 53) + (num-level0-colors uint8 :offset 54) + (num-level1-colors uint8 :offset 55) + (color-offset uint8 :offset 56) + (color-count uint8 :offset 57) + (pad0 uint8 :offset 58) + (pad1 uint8 :offset 59) + (generic generic-tfragment) + (generic-u32 uint32 :overlay-at generic) ) - :method-count-assert 18 - :size-assert #x40 - :flag-assert #x1200000040 ) + (deftype drawable-inline-array-tfrag (drawable-inline-array) - ((data tfragment 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 96) + ((data tfragment 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x64 - :flag-assert #x1200000064 ) (deftype drawable-inline-array-trans-tfrag (drawable-inline-array-tfrag) - ((data2 tfragment 1 :inline :offset-assert 112) - (pad2 uint32 :offset-assert 176) + ((data2 tfragment 1 :inline) + (pad2 uint32) ) - :method-count-assert 18 - :size-assert #xb4 - :flag-assert #x12000000b4 ) (deftype drawable-tree-tfrag (drawable-tree) - ((time-of-day-pal time-of-day-palette :offset 12) - (arrays drawable-inline-array 1 :offset 32) ;; either drawable-inline-array-node or drawable-inline-array-tfrag + ((time-of-day-pal time-of-day-palette :offset 12) + (arrays drawable-inline-array 1 :overlay-at (-> data 0)) ) - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) (deftype drawable-tree-trans-tfrag (drawable-tree-tfrag) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) (deftype drawable-tree-dirt-tfrag (drawable-tree-tfrag) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) (deftype drawable-tree-ice-tfrag (drawable-tree-tfrag) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) (deftype drawable-tree-lowres-tfrag (drawable-tree-tfrag) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) (deftype drawable-tree-lowres-trans-tfrag (drawable-tree-trans-tfrag) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) (deftype tfrag-dists (structure) - ((data uint32 16 :offset-assert 0) - (vector vector 4 :inline :offset 0) - (k0s vector 2 :inline :offset 0) - (k1s vector 2 :inline :offset 32) + ((data uint32 16) + (vector vector 4 :inline :overlay-at (-> data 0)) + (k0s vector 2 :inline :overlay-at (-> data 0)) + (k1s vector 2 :inline :overlay-at (-> data 8)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) + (deftype tfrag-data (structure) - ((data uint32 56 :offset 0) - (vector vector 14 :inline :offset 0) - (fog vector :inline :offset 0) - (val vector :inline :offset 16) - (strgif gs-gif-tag :inline :offset 32) ;; was qword - (fangif gs-gif-tag :inline :offset 48) ;; was qword - (adgif gs-gif-tag :inline :offset 64) ;; was qword - (hvdf-offset vector :inline :offset 80) - (hmge-scale vector :inline :offset 96) - (invh-scale vector :inline :offset 112) - (ambient vector :inline :offset 128) - (guard vector :inline :offset 144) - (dists tfrag-dists :inline :offset 160) - (k0s uint128 2 :offset 160) - (k1s uint128 2 :offset 192) + ((data uint32 56 :offset 0) + (vector vector 14 :inline :overlay-at (-> data 0)) + (fog vector :inline :overlay-at (-> vector 0)) + (val vector :inline :overlay-at (-> vector 1)) + (strgif gs-gif-tag :inline :overlay-at (-> data 8)) + (fangif gs-gif-tag :inline :overlay-at (-> data 12)) + (adgif gs-gif-tag :inline :overlay-at (-> data 16)) + (hvdf-offset vector :inline :overlay-at (-> vector 5)) + (hmge-scale vector :inline :overlay-at (-> vector 6)) + (invh-scale vector :inline :overlay-at (-> vector 7)) + (ambient vector :inline :overlay-at (-> vector 8)) + (guard vector :inline :overlay-at (-> vector 9)) + (dists tfrag-dists :inline :overlay-at (-> data 40)) + (k0s uint128 2 :overlay-at (-> data 40)) + (k1s uint128 2 :overlay-at (-> data 48)) ) - :method-count-assert 9 - :size-assert #xe0 - :flag-assert #x9000000e0 ) + (deftype tfrag-control (structure) - ((num-base-points uint32 :offset-assert 0) - (num-shared-base-points uint32 :offset-assert 4) - (num-level0-points uint32 :offset-assert 8) - (num-shared-level0-points uint32 :offset-assert 12) - (num-level1-points uint32 :offset-assert 16) - (num-shared-level1-points uint32 :offset-assert 20) - (ptr-vtxdata uint32 :offset-assert 24) - (ptr-base-points uint32 :offset-assert 28) - (ptr-shared-base-points uint32 :offset-assert 32) - (ptr-level0-points uint32 :offset-assert 36) - (ptr-shared-level0-points uint32 :offset-assert 40) - (ptr-level1-points uint32 :offset-assert 44) - (ptr-shared-level1-points uint32 :offset-assert 48) - (ptr-draw-points uint32 :offset-assert 52) - (ptr-interpolated-0 uint32 :offset-assert 56) - (ptr-shared-interpolated-0 uint32 :offset-assert 60) - (ptr-interpolated1 uint32 :offset-assert 64) - (ptr-shared-interpolated1 uint32 :offset-assert 68) - (ptr-strip-data uint32 :offset-assert 72) - (ptr-texture-data uint32 :offset-assert 76) + ((num-base-points uint32) + (num-shared-base-points uint32) + (num-level0-points uint32) + (num-shared-level0-points uint32) + (num-level1-points uint32) + (num-shared-level1-points uint32) + (ptr-vtxdata uint32) + (ptr-base-points uint32) + (ptr-shared-base-points uint32) + (ptr-level0-points uint32) + (ptr-shared-level0-points uint32) + (ptr-level1-points uint32) + (ptr-shared-level1-points uint32) + (ptr-draw-points uint32) + (ptr-interpolated-0 uint32) + (ptr-shared-interpolated-0 uint32) + (ptr-interpolated1 uint32) + (ptr-shared-interpolated1 uint32) + (ptr-strip-data uint32) + (ptr-texture-data uint32) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) + (deftype tfrag-stats (structure) - ((from int32 :offset-assert 0) - (to int32 :offset-assert 4) - (cnt int32 :offset-assert 8) - (tris int32 :offset-assert 12) - (tfaces int32 :offset-assert 16) - (tfrags int32 :offset-assert 20) - (dtris int32 :offset-assert 24) - (base-verts int32 :offset-assert 28) - (level0-verts int32 :offset-assert 32) - (level1-verts int32 :offset-assert 36) - (dma-cnt int32 :offset-assert 40) - (dma-dta int32 :offset-assert 44) - (dma-tex int32 :offset-assert 48) - (strips int32 :offset-assert 52) - (drawpoints int32 :offset-assert 56) - (vif int32 :offset-assert 60) + ((from int32) + (to int32) + (cnt int32) + (tris int32) + (tfaces int32) + (tfrags int32) + (dtris int32) + (base-verts int32) + (level0-verts int32) + (level1-verts int32) + (dma-cnt int32) + (dma-dta int32) + (dma-tex int32) + (strips int32) + (drawpoints int32) + (vif int32) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) + (deftype tfrag-packet (structure) - ((tag uint128 2 :offset-assert 0) + ((tag uint128 2) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype tfrag-work (structure) - ((base-tmpl dma-packet :inline :offset-assert 0) - (level-0-tmpl dma-packet :inline :offset-assert 16) - (common-tmpl dma-packet :inline :offset-assert 32) - (level-1-tmpl dma-packet :inline :offset-assert 48) - (color-tmpl dma-packet :inline :offset-assert 64) - (frag-dists vector :inline :offset-assert 80) - (max-dist vector :inline :offset-assert 96) - (min-dist vector :inline :offset-assert 112) - (color-ptr vector4w :inline :offset-assert 128) - (tr-stat-tfrag tr-stat :offset-assert 144) - (tr-stat-tfrag-near tr-stat :offset-assert 148) - (vu1-enable-tfrag int32 :offset-assert 152) - (vu1-enable-tfrag-near int32 :offset-assert 156) - (cur-vis-bits uint32 :offset-assert 160) - (end-vis-bits uint32 :offset-assert 164) - (src-ptr uint32 :offset-assert 168) - (last-call uint32 :offset-assert 172) - (dma-buffer basic :offset-assert 176) - (test-id uint32 :offset-assert 180) - (wait-from-spr uint32 :offset-assert 184) - (wait-to-spr uint32 :offset-assert 188) - (near-wait-from-spr uint32 :offset-assert 192) - (near-wait-to-spr uint32 :offset-assert 196) + ((base-tmpl dma-packet :inline) + (level-0-tmpl dma-packet :inline) + (common-tmpl dma-packet :inline) + (level-1-tmpl dma-packet :inline) + (color-tmpl dma-packet :inline) + (frag-dists vector :inline) + (max-dist vector :inline) + (min-dist vector :inline) + (color-ptr vector4w :inline) + (tr-stat-tfrag tr-stat) + (tr-stat-tfrag-near tr-stat) + (vu1-enable-tfrag int32) + (vu1-enable-tfrag-near int32) + (cur-vis-bits uint32) + (end-vis-bits uint32) + (src-ptr uint32) + (last-call uint32) + (dma-buffer basic) + (test-id uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (near-wait-from-spr uint32) + (near-wait-to-spr uint32) ) - :method-count-assert 9 - :size-assert #xc8 - :flag-assert #x9000000c8 ) + (deftype tfrag-dma (structure) - ((banka tfragment 16 :inline :offset-assert 0) - (bankb tfragment 16 :inline :offset-assert 1024) - (outa uint128 128 :offset-assert 2048) - (outb uint128 128 :offset-assert 4096) - (colors rgba 2047 :offset-assert 6144) + ((banka tfragment 16 :inline) + (bankb tfragment 16 :inline) + (outa uint128 128) + (outb uint128 128) + (colors rgba 2047) ) - :method-count-assert 9 - :size-assert #x37fc - :flag-assert #x9000037fc ) (define-extern *tfrag-work* tfrag-work) diff --git a/goal_src/jak1/engine/gfx/tfrag/tfrag-methods.gc b/goal_src/jak1/engine/gfx/tfrag/tfrag-methods.gc index 6a8ed997c42..6a3f1295e0f 100644 --- a/goal_src/jak1/engine/gfx/tfrag/tfrag-methods.gc +++ b/goal_src/jak1/engine/gfx/tfrag/tfrag-methods.gc @@ -718,7 +718,7 @@ ;; definition for method 10 of type drawable-tree-tfrag ;; INFO: Return type mismatch drawable-tree-tfrag vs none. -(defmethod draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* tfrag-tree-count)) (a1-2 (-> (scratchpad-object terrain-context) bsp lev-index)) (a1-5 (-> *level* level a1-2)) @@ -732,7 +732,7 @@ ;; definition for method 10 of type drawable-tree-trans-tfrag ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. -(defmethod draw drawable-tree-trans-tfrag ((this drawable-tree-trans-tfrag) (arg0 drawable-tree-trans-tfrag) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-trans-tfrag) (arg0 drawable-tree-trans-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* trans-tfrag-tree-count)) (a1-2 (-> (scratchpad-object terrain-context) bsp lev-index)) (a1-5 (-> *level* level a1-2)) @@ -746,7 +746,7 @@ ;; definition for method 10 of type drawable-tree-dirt-tfrag ;; INFO: Return type mismatch drawable-tree-dirt-tfrag vs none. -(defmethod draw drawable-tree-dirt-tfrag ((this drawable-tree-dirt-tfrag) (arg0 drawable-tree-dirt-tfrag) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-dirt-tfrag) (arg0 drawable-tree-dirt-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* dirt-tfrag-tree-count)) (a1-2 (-> (scratchpad-object terrain-context) bsp lev-index)) (a1-5 (-> *level* level a1-2)) @@ -760,7 +760,7 @@ ;; definition for method 10 of type drawable-tree-ice-tfrag ;; INFO: Return type mismatch drawable-tree-ice-tfrag vs none. -(defmethod draw drawable-tree-ice-tfrag ((this drawable-tree-ice-tfrag) (arg0 drawable-tree-ice-tfrag) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-ice-tfrag) (arg0 drawable-tree-ice-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* ice-tfrag-tree-count)) (a1-2 (-> (scratchpad-object terrain-context) bsp lev-index)) (a1-5 (-> *level* level a1-2)) @@ -774,7 +774,7 @@ ;; definition for method 10 of type drawable-tree-lowres-tfrag ;; INFO: Return type mismatch drawable-tree-lowres-tfrag vs none. -(defmethod draw drawable-tree-lowres-tfrag ((this drawable-tree-lowres-tfrag) (arg0 drawable-tree-lowres-tfrag) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-lowres-tfrag) (arg0 drawable-tree-lowres-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* lowres-tfrag-tree-count)) (a1-2 (-> (scratchpad-object terrain-context) bsp lev-index)) (a1-5 (-> *level* level a1-2)) @@ -804,7 +804,7 @@ ) ;; definition for method 14 of type tfragment -(defmethod collect-stats tfragment ((this tfragment)) +(defmethod collect-stats ((this tfragment)) (stats-tfrag-asm this) (none) ) @@ -812,7 +812,7 @@ ;; definition for method 14 of type drawable-tree-tfrag ;; INFO: Return type mismatch drawable-tree-tfrag vs none. ;; Used lq/sq -(defmethod collect-stats drawable-tree-tfrag ((this drawable-tree-tfrag)) +(defmethod collect-stats ((this drawable-tree-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))) @@ -831,7 +831,7 @@ ;; definition for method 14 of type drawable-tree-lowres-tfrag ;; INFO: Return type mismatch drawable-tree-lowres-tfrag vs none. ;; Used lq/sq -(defmethod collect-stats drawable-tree-lowres-tfrag ((this drawable-tree-lowres-tfrag)) +(defmethod collect-stats ((this drawable-tree-lowres-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))) @@ -850,7 +850,7 @@ ;; definition for method 14 of type drawable-tree-trans-tfrag ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. ;; Used lq/sq -(defmethod collect-stats drawable-tree-trans-tfrag ((this drawable-tree-trans-tfrag)) +(defmethod collect-stats ((this drawable-tree-trans-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) @@ -869,7 +869,7 @@ ;; definition for method 14 of type drawable-tree-lowres-trans-tfrag ;; INFO: Return type mismatch drawable-tree-lowres-trans-tfrag vs none. ;; Used lq/sq -(defmethod collect-stats drawable-tree-lowres-trans-tfrag ((this drawable-tree-lowres-trans-tfrag)) +(defmethod collect-stats ((this drawable-tree-lowres-trans-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) @@ -888,7 +888,7 @@ ;; definition for method 14 of type drawable-tree-dirt-tfrag ;; INFO: Return type mismatch drawable-tree-dirt-tfrag vs none. ;; Used lq/sq -(defmethod collect-stats drawable-tree-dirt-tfrag ((this drawable-tree-dirt-tfrag)) +(defmethod collect-stats ((this drawable-tree-dirt-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) @@ -907,7 +907,7 @@ ;; definition for method 14 of type drawable-tree-ice-tfrag ;; INFO: Return type mismatch drawable-tree-ice-tfrag vs none. ;; Used lq/sq -(defmethod collect-stats drawable-tree-ice-tfrag ((this drawable-tree-ice-tfrag)) +(defmethod collect-stats ((this drawable-tree-ice-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) @@ -925,7 +925,7 @@ ;; definition for method 14 of type drawable-inline-array-tfrag ;; INFO: Return type mismatch drawable-inline-array-tfrag vs none. -(defmethod collect-stats drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) +(defmethod collect-stats ((this drawable-inline-array-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this data s5-0))) @@ -940,7 +940,7 @@ ;; definition for method 14 of type drawable-inline-array-trans-tfrag ;; INFO: Return type mismatch drawable-inline-array-trans-tfrag vs none. -(defmethod collect-stats drawable-inline-array-trans-tfrag ((this drawable-inline-array-trans-tfrag)) +(defmethod collect-stats ((this drawable-inline-array-trans-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this data s5-0))) @@ -955,7 +955,7 @@ ;; definition for method 15 of type drawable-tree-tfrag ;; INFO: Return type mismatch drawable-tree-tfrag vs none. -(defmethod debug-draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (dotimes (s4-0 (-> this length)) (let ((a1-1 (-> this arrays s4-0))) @@ -968,7 +968,7 @@ ;; definition for method 15 of type drawable-tree-trans-tfrag ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. -(defmethod debug-draw drawable-tree-trans-tfrag ((this drawable-tree-trans-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-trans-tfrag) (arg0 drawable) (arg1 display-frame)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (dotimes (s4-0 (-> this length)) (let ((a1-1 (-> this arrays s4-0))) @@ -996,7 +996,7 @@ ) ;; definition for method 15 of type tfragment -(defmethod debug-draw tfragment ((this tfragment) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this tfragment) (arg0 drawable) (arg1 display-frame)) (-> arg1 global-buf) (edge-debug-lines (-> this debug-data debug-lines)) diff --git a/goal_src/jak1/engine/gfx/tfrag/tfrag.gc b/goal_src/jak1/engine/gfx/tfrag/tfrag.gc index 12abe6403d5..494d5f2d575 100644 --- a/goal_src/jak1/engine/gfx/tfrag/tfrag.gc +++ b/goal_src/jak1/engine/gfx/tfrag/tfrag.gc @@ -28,7 +28,7 @@ ;; basic methods ;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod login tfragment ((this tfragment)) +(defmethod login ((this tfragment)) "Initialize a tfragment by linking the textures in adgif shaders" (dotimes (s5-0 (the-as int (-> this num-shaders))) (adgif-shader-login-no-remap (-> this shader s5-0)) @@ -36,7 +36,7 @@ this ) -(defmethod mem-usage tfragment ((this tfragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this tfragment) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a tfragment" ;; seems like this flag does colors? @@ -94,12 +94,16 @@ ) ) (+! (-> arg0 data (+ s4-0 4) count) 1) - (let ((v1-70 (* (- (-> this dma-qwc 3) - (the-as uint (- (/ (the-as int (- (-> this dma-level-1) (-> this dma-common))) 16) (the-as int (-> this dma-qwc 0)))) - ) - 16 + (let ((v1-70 + (* (- (-> this dma-qwc 3) + (the-as + uint + (- (/ (the-as int (- (-> this dma-level-1) (-> this dma-common))) 16) (the-as int (-> this dma-qwc 0))) ) - ) + ) + 16 + ) + ) ) (+! (-> arg0 data (+ s4-0 4) used) v1-70) (+! (-> arg0 data (+ s4-0 4) total) v1-70) @@ -109,11 +113,12 @@ ;; colors (set! (-> arg0 data (+ s4-0 5) name) "tfragment-color") (+! (-> arg0 data (+ s4-0 5) count) 1) - (let ((v1-79 (if (logtest? arg1 1) - 0 - (the-as int (* (+ (-> this num-base-colors) (-> this num-level0-colors) (-> this num-level1-colors)) 2)) - ) - ) + (let ((v1-79 + (if (logtest? arg1 1) + 0 + (the-as int (* (+ (-> this num-base-colors) (-> this num-level0-colors) (-> this num-level1-colors)) 2)) + ) + ) ) (+! (-> arg0 data (+ s4-0 5) used) v1-79) (+! (-> arg0 data (+ s4-0 5) total) (logand -16 (+ v1-79 15))) @@ -122,7 +127,7 @@ ;; debug (unused) (set! (-> arg0 data (+ s4-0 6) name) "tfragment-debug") ) - + (label cfg-16) this ) @@ -141,14 +146,14 @@ this ) -(defmethod login drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) +(defmethod login ((this drawable-inline-array-tfrag)) (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) ) this ) -(defmethod mem-usage drawable-inline-array-tfrag ((this drawable-inline-array-tfrag) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-tfrag) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -162,7 +167,7 @@ this ) -(defmethod mem-usage drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-tree-tfrag) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) "drawable-group") (+! (-> arg0 data 0 count) 1) @@ -185,7 +190,7 @@ this ) -(defmethod asize-of drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) +(defmethod asize-of ((this drawable-inline-array-tfrag)) (the-as int (+ (-> drawable-inline-array-tfrag size) (* (+ (-> this length) -1) 64))) ) @@ -200,68 +205,72 @@ (defun tfrag-data-setup ((arg0 tfrag-data) (arg1 int)) "Set up a tfrag-data. This is loaded to VU1 memory. Arg1 sets abe (alpha blend enable)" (let ((v1-0 *math-camera*)) - (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) - (set-vector! (-> arg0 val) 0.5 1.0 2048.0 0.0) - (set-vector! (-> arg0 ambient) 1.0 1.0 1.0 1.0) - (cond - ((zero? *subdivide-draw-mode*) - (set! (-> arg0 strgif tag) - (new 'static 'gif-tag64 - :pre #x1 - :nreg #x3 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1) - ) - ) - (set! (-> arg0 fangif tag) - (new 'static 'gif-tag64 - :pre #x1 - :nreg #x3 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe arg1) - ) - ) - ) - ((= *subdivide-draw-mode* 1) - (set! (-> arg0 strgif tag) - (new 'static 'gif-tag64 - :pre #x1 - :nreg #x3 - :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1) - ) - ) - (set! (-> arg0 fangif tag) - (new 'static 'gif-tag64 - :pre #x1 - :nreg #x3 - :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1) + (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) + (set-vector! (-> arg0 val) 0.5 1.0 2048.0 0.0) + (set-vector! (-> arg0 ambient) 1.0 1.0 1.0 1.0) + (cond + ((zero? *subdivide-draw-mode*) + (set! (-> arg0 strgif tag) + (new 'static 'gif-tag64 + :pre #x1 + :nreg #x3 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1) + ) + ) + (set! (-> arg0 fangif tag) + (new 'static 'gif-tag64 + :pre #x1 + :nreg #x3 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe arg1) + ) + ) ) - ) - ) - ((= *subdivide-draw-mode* 2) - (set! (-> arg0 strgif tag) - (new 'static 'gif-tag64 - :pre #x1 - :nreg #x3 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe arg1) + ((= *subdivide-draw-mode* 1) + (set! (-> arg0 strgif tag) + (new 'static 'gif-tag64 + :pre #x1 + :nreg #x3 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1) + ) + ) + (set! (-> arg0 fangif tag) + (new 'static 'gif-tag64 + :pre #x1 + :nreg #x3 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1) + ) + ) ) - ) - (set! (-> arg0 fangif tag) - (new 'static 'gif-tag64 - :pre #x1 - :nreg #x3 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe arg1) + ((= *subdivide-draw-mode* 2) + (set! (-> arg0 strgif tag) + (new 'static 'gif-tag64 + :pre #x1 + :nreg #x3 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe arg1) + ) + ) + (set! (-> arg0 fangif tag) + (new 'static 'gif-tag64 + :pre #x1 + :nreg #x3 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe arg1) + ) + ) ) ) - ) - ) - (set! (-> arg0 strgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))) - (set! (-> arg0 fangif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))) - (set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) - (set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) - (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) - (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) - (set! (-> arg0 invh-scale quad) (-> v1-0 inv-hmge-scale quad)) - (set! (-> arg0 guard quad) (-> v1-0 guard quad)) - ) + (set! (-> arg0 strgif regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 fangif regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) + (set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) + (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) + (set! (-> arg0 invh-scale quad) (-> v1-0 inv-hmge-scale quad)) + (set! (-> arg0 guard quad) (-> v1-0 guard quad)) + ) (set-tfrag-dists! (-> arg0 dists)) (none) ) @@ -273,13 +282,16 @@ ) (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-0)) (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) - (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd unpack-v4-32) :num a1-0)) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd unpack-v4-32) :num a1-0) + ) (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) ) - (column-scale-matrix! (the-as matrix (-> arg0 base)) - (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) - (-> *math-camera* camera-temp) - ) + (column-scale-matrix! + (the-as matrix (-> arg0 base)) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (-> *math-camera* camera-temp) + ) (&+! (-> arg0 base) 64) (none) ) @@ -291,10 +303,16 @@ ) (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-0)) (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) - (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x14d :cmd (vif-cmd unpack-v4-32) :num a1-0)) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x14d :cmd (vif-cmd unpack-v4-32) :num a1-0) + ) (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) ) - (column-scale-matrix! (the-as matrix (-> arg0 base)) (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) (-> *math-camera* camera-temp)) + (column-scale-matrix! + (the-as matrix (-> arg0 base)) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (-> *math-camera* camera-temp) + ) (&+! (-> arg0 base) 64) (none) ) @@ -306,7 +324,9 @@ ) (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0)) (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) - (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x290 :cmd (vif-cmd unpack-v4-32) :num a2-0)) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x290 :cmd (vif-cmd unpack-v4-32) :num a2-0) + ) (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) ) (tfrag-data-setup (the-as tfrag-data (-> arg0 base)) arg1) @@ -374,11 +394,7 @@ (when (and *tfrag-display-stats* (!= *master-mode* 'menu)) (format arg0 "~%") (format arg0 "tris: ~8d~%" (-> t-stat tris)) - (format - arg0 - "verts: ~8d~%" - (+ (-> t-stat base-verts) (-> t-stat level0-verts) (-> t-stat level1-verts)) - ) + (format arg0 "verts: ~8d~%" (+ (-> t-stat base-verts) (-> t-stat level0-verts) (-> t-stat level1-verts))) (format arg0 " base: ~8d~%" (-> t-stat base-verts)) (format arg0 " lev0: ~8d~%" (-> t-stat level0-verts)) (format arg0 " lev1: ~8d~%" (-> t-stat level1-verts)) @@ -424,32 +440,13 @@ (a0-4 (the-as object (-> v1-1 base))) ) (set! (-> (the-as gs-gif-tag a0-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-4) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) - ) + (set! (-> (the-as gs-gif-tag a0-4) regs) GIF_REGS_ALL_AD) (set! (-> v1-1 base) (&+ (the-as pointer a0-4) 16)) ) (let* ((v1-2 arg0) (a0-6 (-> v1-2 base)) ) - (set! (-> (the-as (pointer gs-test) a0-6)) arg1) + (set! (-> (the-as (pointer gs-test) a0-6) 0) arg1) (set! (-> (the-as (pointer gs-reg64) a0-6) 1) (gs-reg64 test-1)) (set! (-> v1-2 base) (&+ a0-6 16)) ) @@ -514,134 +511,69 @@ ;;(define-extern draw-inline-array-tfrag (function pointer drawable-inline-array int dma-buffer none)) (def-mips2c draw-inline-array-tfrag (function pointer drawable-inline-array int dma-buffer none)) - (defun tfrag-near-init-buffer ((arg0 dma-buffer) (arg1 gs-test) (arg2 int)) (dma-buffer-add-vu-function arg0 tnear-vu1-block 1) (let* ((v1-0 arg0) (a0-2 (the-as object (-> v1-0 base))) ) - (set! - (-> (the-as dma-packet a0-2) dma) - (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)) - ) - (set! (-> (the-as dma-packet a0-2) vif0) (new 'static 'vif-tag)) - (set! - (-> (the-as dma-packet a0-2) vif1) - (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1) + (set! (-> (the-as dma-packet a0-2) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-2) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-2) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-2) 16)) ) - (set! (-> v1-0 base) (&+ (the-as pointer a0-2) 16)) - ) (let* ((v1-1 arg0) (a0-4 (the-as object (-> v1-1 base))) ) - (set! - (-> (the-as gs-gif-tag a0-4) tag) - (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1) - ) - (set! - (-> (the-as gs-gif-tag a0-4) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) - ) - (set! (-> v1-1 base) (&+ (the-as pointer a0-4) 16)) - ) + (set! (-> (the-as gs-gif-tag a0-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> (the-as gs-gif-tag a0-4) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-4) 16)) + ) (let* ((v1-2 arg0) (a0-6 (-> v1-2 base)) ) - (set! (-> (the-as (pointer gs-test) a0-6)) arg1) - (set! (-> (the-as (pointer gs-reg64) a0-6) 1) (gs-reg64 test-1)) - (set! (-> v1-2 base) (&+ a0-6 16)) - ) + (set! (-> (the-as (pointer gs-test) a0-6) 0) arg1) + (set! (-> (the-as (pointer gs-reg64) a0-6) 1) (gs-reg64 test-1)) + (set! (-> v1-2 base) (&+ a0-6 16)) + ) (add-tfrag-mtx-0 arg0) (add-tfrag-mtx-1 arg0) (add-tfrag-data arg0 arg2) (let ((v1-3 (the-as object (-> arg0 base)))) - (set! - (-> (the-as dma-packet v1-3) dma) - (new 'static 'dma-tag :id (dma-tag-id cnt)) - ) - (set! - (-> (the-as dma-packet v1-3) vif0) - (new 'static 'vif-tag :cmd (vif-cmd base)) - ) - (set! - (-> (the-as dma-packet v1-3) vif1) - (new 'static 'vif-tag :imm #x148 :cmd (vif-cmd offset)) + (set! (-> (the-as dma-packet v1-3) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet v1-3) vif0) (new 'static 'vif-tag :cmd (vif-cmd base))) + (set! (-> (the-as dma-packet v1-3) vif1) (new 'static 'vif-tag :imm #x148 :cmd (vif-cmd offset))) + (set! (-> arg0 base) (&+ (the-as pointer v1-3) 16)) ) - (set! (-> arg0 base) (&+ (the-as pointer v1-3) 16)) - ) (set! (-> *tfrag-work* last-call) (the-as uint 0)) (none) ) -;; definition for function tfrag-near-end-buffer -;; INFO: Return type mismatch symbol vs none. (defun tfrag-near-end-buffer ((arg0 dma-buffer)) (let* ((v1-0 arg0) (a1-0 (the-as object (-> v1-0 base))) ) - (set! - (-> (the-as dma-packet a1-0) dma) - (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt)) - ) - (set! - (-> (the-as dma-packet a1-0) vif0) - (new 'static 'vif-tag :cmd (vif-cmd stmask)) + (set! (-> (the-as dma-packet a1-0) dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a1-0) vif0) (new 'static 'vif-tag :cmd (vif-cmd stmask))) + (set! (-> (the-as dma-packet a1-0) vif1) (new 'static 'vif-tag)) + (set! (-> v1-0 base) (&+ (the-as pointer a1-0) 16)) ) - (set! (-> (the-as dma-packet a1-0) vif1) (new 'static 'vif-tag)) - (set! (-> v1-0 base) (&+ (the-as pointer a1-0) 16)) - ) (let* ((v1-1 arg0) (a0-1 (-> v1-1 base)) ) - (set! (-> (the-as (pointer uint32) a0-1)) (-> *tfrag-work* last-call)) - (set! - (-> (the-as (pointer vif-tag) a0-1) 1) - (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1) - ) - (set! - (-> (the-as (pointer vif-tag) a0-1) 2) - (new 'static 'vif-tag :cmd (vif-cmd stmod)) - ) - (set! - (-> (the-as (pointer vif-tag) a0-1) 3) - (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1) - ) - (set! (-> (the-as (pointer uint32) a0-1) 4) (the-as uint 0)) - (set! (-> (the-as (pointer uint32) a0-1) 5) (the-as uint 0)) - (set! (-> (the-as (pointer uint32) a0-1) 6) (the-as uint 0)) - (set! (-> (the-as (pointer uint32) a0-1) 7) (the-as uint 0)) - (set! - (-> (the-as (pointer vif-tag) a0-1) 8) - (new 'static 'vif-tag :cmd (vif-cmd base)) - ) - (set! - (-> (the-as (pointer vif-tag) a0-1) 9) - (new 'static 'vif-tag :cmd (vif-cmd offset)) - ) - (set! - (-> (the-as (pointer vif-tag) a0-1) 10) - (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)) - ) - (set! (-> (the-as (pointer vif-tag) a0-1) 11) (new 'static 'vif-tag)) - (set! (-> v1-1 base) (&+ a0-1 48)) - ) + (set! (-> (the-as (pointer uint32) a0-1)) (-> *tfrag-work* last-call)) + (set! (-> (the-as (pointer vif-tag) a0-1) 1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> (the-as (pointer vif-tag) a0-1) 2) (new 'static 'vif-tag :cmd (vif-cmd stmod))) + (set! (-> (the-as (pointer vif-tag) a0-1) 3) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1)) + (set! (-> (the-as (pointer uint32) a0-1) 4) (the-as uint 0)) + (set! (-> (the-as (pointer uint32) a0-1) 5) (the-as uint 0)) + (set! (-> (the-as (pointer uint32) a0-1) 6) (the-as uint 0)) + (set! (-> (the-as (pointer uint32) a0-1) 7) (the-as uint 0)) + (set! (-> (the-as (pointer vif-tag) a0-1) 8) (new 'static 'vif-tag :cmd (vif-cmd base))) + (set! (-> (the-as (pointer vif-tag) a0-1) 9) (new 'static 'vif-tag :cmd (vif-cmd offset))) + (set! (-> (the-as (pointer vif-tag) a0-1) 10) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as (pointer vif-tag) a0-1) 11) (new 'static 'vif-tag)) + (set! (-> v1-1 base) (&+ a0-1 48)) + ) (none) ) diff --git a/goal_src/jak1/engine/gfx/tie/generic-tie-h.gc b/goal_src/jak1/engine/gfx/tie/generic-tie-h.gc index 4ac591ec324..a610ba5d0e7 100644 --- a/goal_src/jak1/engine/gfx/tie/generic-tie-h.gc +++ b/goal_src/jak1/engine/gfx/tie/generic-tie-h.gc @@ -1,3 +1,4 @@ + ;;-*-Lisp-*- (in-package goal) @@ -10,229 +11,197 @@ ;; DECOMP BEGINS (deftype generic-tie-instance (structure) - ((matrix-tag dma-packet :inline :offset-assert 0) - (matrix-data vector 6 :inline :offset-assert 16) - (index-tag dma-packet :inline :offset-assert 112) - (indices uint8 224 :offset-assert 128) - (end-tag dma-packet :inline :offset-assert 352) + ((matrix-tag dma-packet :inline) + (matrix-data vector 6 :inline) + (index-tag dma-packet :inline) + (indices uint8 224) + (end-tag dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x170 - :flag-assert #x900000170 ) + (deftype generic-tie-input (structure) - ((palette-tag dma-packet :inline :offset-assert 0) - (palette rgba 128 :offset-assert 16) - (model-tag dma-packet :inline :offset-assert 528) - (model vector 146 :inline :offset-assert 544) - (matrix-tag dma-packet :inline :offset-assert 2880) - (matrix-data vector 6 :inline :offset-assert 2896) - (index-tag dma-packet :inline :offset-assert 2992) - (indices uint8 224 :offset-assert 3008) - (end-tag dma-packet :inline :offset-assert 3232) + ((palette-tag dma-packet :inline) + (palette rgba 128) + (model-tag dma-packet :inline) + (model vector 146 :inline) + (matrix-tag dma-packet :inline) + (matrix-data vector 6 :inline) + (index-tag dma-packet :inline) + (indices uint8 224) + (end-tag dma-packet :inline) ) - :method-count-assert 9 - :size-assert #xcb0 - :flag-assert #x900000cb0 ) + (deftype generic-tie-run-control (structure) - ((skip-bp2 uint8 :offset-assert 0) - (skip-ips uint8 :offset-assert 1) - (gifbuf-skip uint8 :offset-assert 2) - (strips uint8 :offset-assert 3) - (target-bp1 uint8 :offset-assert 4) - (target-bp2 uint8 :offset-assert 5) - (target-ip1 uint8 :offset-assert 6) - (target-ip2 uint8 :offset-assert 7) - (target-bps uint8 :offset-assert 8) - (target-ips uint8 :offset-assert 9) - (is-generic uint8 :offset-assert 10) - (reserved uint8 :offset-assert 11) + ((skip-bp2 uint8) + (skip-ips uint8) + (gifbuf-skip uint8) + (strips uint8) + (target-bp1 uint8) + (target-bp2 uint8) + (target-ip1 uint8) + (target-ip2 uint8) + (target-bps uint8) + (target-ips uint8) + (is-generic uint8) + (reserved uint8) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) + (deftype generic-tie-base-point (structure) - ((x int16 :offset-assert 0) - (y int16 :offset-assert 2) - (z int16 :offset-assert 4) - (d0 int16 :offset-assert 6) - (vtx uint64 :offset 0) - (u int16 :offset-assert 8) - (v int16 :offset-assert 10) - (tex uint32 :offset 8) - (w int16 :offset-assert 12) - (d1 int16 :offset-assert 14) - (data uint16 8 :offset 0) ;; moved - (quad uint128 :offset 0) ;; moved + ((x int16) + (y int16) + (z int16) + (d0 int16) + (vtx uint64 :overlay-at x) + (u int16) + (v int16) + (tex uint32 :overlay-at u) + (w int16) + (d1 int16) + (data uint16 8 :overlay-at x) + (quad uint128 :overlay-at x) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype generic-tie-bps (structure) - ((bp generic-tie-base-point 4 :inline :offset-assert 0) + ((bp generic-tie-base-point 4 :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) + (deftype generic-tie-interp-point (structure) - ((x int16 :offset-assert 0) - (y int16 :offset-assert 2) - (z int16 :offset-assert 4) - (d0 int16 :offset-assert 6) - (vtx0 uint64 :offset 0) - (dx int16 :offset-assert 8) - (dy int16 :offset-assert 10) - (dz int16 :offset-assert 12) - (unused int16 :offset-assert 14) - (vtx1 uint64 :offset 8) - (u int16 :offset-assert 16) - (v int16 :offset-assert 18) - (tex uint32 :offset 16) - (w int16 :offset-assert 20) - (d1 int16 :offset-assert 22) - (data uint16 12 :offset 0) - ;(quad uint128 :offset 0) + ((x int16) + (y int16) + (z int16) + (d0 int16) + (vtx0 uint64 :overlay-at x) + (dx int16) + (dy int16) + (dz int16) + (unused int16) + (vtx1 uint64 :overlay-at dx) + (u int16) + (v int16) + (tex uint32 :overlay-at u) + (w int16) + (d1 int16) + (data uint16 12 :overlay-at x) ) :pack-me - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) + (deftype generic-tie-ips (structure) - ((ip generic-tie-interp-point 2 :inline :offset-assert 0) + ((ip generic-tie-interp-point 2 :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype generic-tie-header (structure) - ((effect uint8 :offset-assert 0) - (interp-table-size uint8 :offset-assert 1) - (num-bps uint8 :offset-assert 2) - (num-ips uint8 :offset-assert 3) - (tint-color uint32 :offset-assert 4) - (index-table-offset uint16 :offset-assert 8) - (kick-table-offset uint16 :offset-assert 10) - (normal-table-offset uint16 :offset-assert 12) - (interp-table-offset uint16 :offset-assert 14) - (gsf-header gsf-header :inline :offset-assert 16) + ((effect uint8) + (interp-table-size uint8) + (num-bps uint8) + (num-ips uint8) + (tint-color uint32) + (index-table-offset uint16) + (kick-table-offset uint16) + (normal-table-offset uint16) + (interp-table-offset uint16) + (gsf-header gsf-header :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype generic-tie-matrix (structure) - ((matrix matrix :inline :offset-assert 0) - (morph vector :inline :offset-assert 64) - (fog qword :inline :offset-assert 80) + ((matrix matrix :inline) + (morph vector :inline) + (fog qword :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) + (deftype generic-tie-normal (structure) - ((x int8 :offset-assert 0) - (y int8 :offset-assert 1) - (z int8 :offset-assert 2) - (dummy int8 :offset-assert 3) + ((x int8) + (y int8) + (z int8) + (dummy int8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) + (deftype generic-tie-control (structure) - ((ptr-palette uint32 :offset-assert 0) - (ptr-shaders uint32 :offset-assert 4) - (ptr-runctrl generic-tie-run-control :offset-assert 8) - (ptr-verts uint32 :offset-assert 12) - (ptr-generic generic-tie-header :offset-assert 16) - (ptr-dps uint32 :offset-assert 20) - (ptr-kicks uint32 :offset-assert 24) - (ptr-normals uint32 :offset-assert 28) - (ptr-interp uint32 :offset-assert 32) - (ptr-mtxs generic-tie-matrix :offset-assert 36) - (ptr-cinds uint32 :offset-assert 40) - (next-instance uint32 :offset-assert 44) - (next-model uint32 :offset-assert 48) - (next-is-model uint32 :offset-assert 52) - (tie-type uint32 :offset-assert 56) + ((ptr-palette uint32) + (ptr-shaders uint32) + (ptr-runctrl generic-tie-run-control) + (ptr-verts uint32) + (ptr-generic generic-tie-header) + (ptr-dps uint32) + (ptr-kicks uint32) + (ptr-normals uint32) + (ptr-interp uint32) + (ptr-mtxs generic-tie-matrix) + (ptr-cinds uint32) + (next-instance uint32) + (next-model uint32) + (next-is-model uint32) + (tie-type uint32) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) + (deftype generic-tie-stats (structure) - ((num-bps uint32 :offset-assert 0) - (num-ips uint32 :offset-assert 4) - (num-dps uint32 :offset-assert 8) - (num-shaders uint32 :offset-assert 12) - (num-models uint32 :offset-assert 16) - (num-instances uint32 :offset-assert 20) - (num-waits uint32 :offset-assert 24) - (num-qwc uint32 :offset-assert 28) - (max-qwc uint32 :offset-assert 32) + ((num-bps uint32) + (num-ips uint32) + (num-dps uint32) + (num-shaders uint32) + (num-models uint32) + (num-instances uint32) + (num-waits uint32) + (num-qwc uint32) + (max-qwc uint32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) + (deftype generic-tie-calls (structure) - ((generic-prepare-dma-double basic :offset-assert 0) - (generic-envmap-dproc basic :offset-assert 4) - (generic-interp-dproc basic :offset-assert 8) - (generic-no-light-dproc basic :offset-assert 12) + ((generic-prepare-dma-double basic) + (generic-envmap-dproc basic) + (generic-interp-dproc basic) + (generic-no-light-dproc basic) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype generic-tie-shadow (structure) - ((out-buf gsf-buffer :offset-assert 0) - (cur-buf uint32 :offset-assert 4) - (tie-type int32 :offset-assert 8) - (ptr-inst uint32 :offset-assert 12) - (ptr-buf uint32 :offset-assert 16) - (inst-xor int32 :offset-assert 20) - (end-of-chain uint32 :offset-assert 24) - (write-limit uint32 :offset-assert 28) - (calls generic-tie-calls :inline :offset-assert 32) + ((out-buf gsf-buffer) + (cur-buf uint32) + (tie-type int32) + (ptr-inst uint32) + (ptr-buf uint32) + (inst-xor int32) + (end-of-chain uint32) + (write-limit uint32) + (calls generic-tie-calls :inline) ) :pack-me - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype generic-tie-work (structure) - ((control generic-tie-control :inline :offset-assert 0) - (interp-job generic-interp-job :inline :offset-assert 60) - (shadow generic-tie-shadow :inline :offset-assert 76) - (input-a generic-tie-input :inline :offset-assert 128) - (input-b generic-tie-input :inline :offset-assert 3376) - (inst-buf generic-tie-instance :inline :offset-assert 6624) - (palette-buf rgba 128 :offset-assert 6992) + ((control generic-tie-control :inline) + (interp-job generic-interp-job :inline) + (shadow generic-tie-shadow :inline) + (input-a generic-tie-input :inline) + (input-b generic-tie-input :inline) + (inst-buf generic-tie-instance :inline) + (palette-buf rgba 128) ) - :method-count-assert 9 - :size-assert #x1d50 - :flag-assert #x900001d50 ) -(define-extern generic-tie-execute (function generic-dma-foreground-sink dma-buffer basic none)) \ No newline at end of file +(define-extern generic-tie-execute (function generic-dma-foreground-sink dma-buffer basic none)) diff --git a/goal_src/jak1/engine/gfx/tie/tie-h.gc b/goal_src/jak1/engine/gfx/tie/tie-h.gc index a7dda29554c..ecb9515544b 100644 --- a/goal_src/jak1/engine/gfx/tie/tie-h.gc +++ b/goal_src/jak1/engine/gfx/tie/tie-h.gc @@ -12,189 +12,159 @@ ;; to the actual data. ;; Unlike with tfrag, tie-fragments aren't part of the draw-node tree - instead they are associated with a prototype. (deftype tie-fragment (drawable) - ((gif-ref (inline-array adgif-shader) :offset 4) ;; starts with adgif shaders, may have more after. - (point-ref uint32 :offset 8) - (color-index uint16 :offset 12) - (base-colors uint8 :offset 14) - (tex-count uint16 :offset-assert 32) ;; number of qw's of adgif-shaders in gif-ref (5 qw/shader) - (gif-count uint16 :offset-assert 34) - (vertex-count uint16 :offset-assert 36) ;; number of qw's of vertex data - (color-count uint16 :offset-assert 38) - (num-tris uint16 :offset-assert 40) - (num-dverts uint16 :offset-assert 42) - (dp-ref uint32 :offset-assert 44) - (dp-qwc uint32 :offset-assert 48) ;; number of "draw points", in qw's. - (generic-ref uint32 :offset-assert 52) ;; L891 ish, just a pointer to data. - (generic-count uint32 :offset-assert 56) ;; number of qw's of generic data. - (debug-lines (array vector-array) :offset-assert 60) + ((gif-ref (inline-array adgif-shader) :overlay-at id) + (point-ref uint32 :offset 8) + (color-index uint16 :offset 12) + (base-colors uint8 :offset 14) + (tex-count uint16) + (gif-count uint16) + (vertex-count uint16) + (color-count uint16) + (num-tris uint16) + (num-dverts uint16) + (dp-ref uint32) + (dp-qwc uint32) + (generic-ref uint32) + (generic-count uint32) + (debug-lines (array vector-array)) ) - :method-count-assert 18 - :size-assert #x40 - :flag-assert #x1200000040 ) ;; This is a specialization of the shared instance type for a TIE. ;; It is the child node type in the draw-node BVH tree. (deftype instance-tie (instance) - ((color-indices uint32 :offset 8) - (bucket-ptr prototype-bucket-tie :offset 12) - (max-scale uint16 :offset 38) - (flags uint16 :offset 46) ;; 1 = has collision? + ((color-indices uint32 :overlay-at error) + (bucket-ptr prototype-bucket-tie :offset 12) + (max-scale uint16 :overlay-at (-> origin data 3)) + (flags uint16 :overlay-at (-> origin data 7)) ) - :method-count-assert 18 - :size-assert #x40 - :flag-assert #x1200000040 ) ;; Wrapper class for lists of consecutive instances. ;; This is equivalent to drawable-inline-array-tfrag of tfrag. (deftype drawable-inline-array-instance-tie (drawable-inline-array) - ((data instance-tie 1 :inline :offset-assert 32) ;; dynamic sized - (pad uint32 :offset-assert 96) + ((data instance-tie 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x64 - :flag-assert #x1200000064 ) ;; Top-level drawable tree for TIE instances. ;; this is also a drawable-group, so it has a data array containing drawables. ;; based on the login methods it seems like the data field has all the drawables. (deftype drawable-tree-instance-tie (drawable-tree) - ((prototypes proxy-prototype-array-tie :offset 8) + ((prototypes proxy-prototype-array-tie :offset 8) ) - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; Wrapper class for lists of consecutive prototypes. ;; It's not known if these are proper draw-node BVH trees. ;; you could imagine it being for things with only one instance (like generic stuff?) (deftype prototype-tie (drawable-inline-array) - ((data tie-fragment 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 96) + ((data tie-fragment 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x64 - :flag-assert #x1200000064 ) ;; The actual matrix type we will upload to VU1 per instance. (deftype tie-matrix (structure) - ((mat matrix :inline :offset-assert 0) ;; the transformation matrix - (morph qword :inline :offset-assert 64) ;; ? LOD stuff? - (fog qword :inline :offset-assert 80) ;; ? why 4 values? + ((mat matrix :inline) + (morph qword :inline) + (fog qword :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; Temps used in the instance drawing asm functions (deftype instance-tie-work (structure) - ((wind-const vector :inline :offset-assert 0) - (hmge-d vector :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (wind-force vector :inline :offset-assert 48) - (constant vector :inline :offset-assert 64) - (far-morph vector :inline :offset-assert 80) - (dist-test vector :inline :offset-assert 96) - (min-dist vector :inline :offset-assert 112) - (guard-plane plane 4 :inline :offset-assert 128) - (upload-color-0 dma-packet :inline :offset-assert 192) - (upload-color-1 dma-packet :inline :offset-assert 208) - (upload-color-2 dma-packet :inline :offset-assert 224) - (upload-color-ret dma-packet :inline :offset-assert 240) - (upload-color-temp dma-packet :inline :offset-assert 256) - (generic-color-0 dma-packet :inline :offset-assert 272) - (generic-color-1 dma-packet :inline :offset-assert 288) - (generic-color-end dma-packet :inline :offset-assert 304) - (tie-near-perspective-matrix matrix :inline :offset-assert 320) - (wind-vectors uint32 :offset-assert 384) - (test-id uint32 :offset-assert 388) - (test-id2 uint32 :offset-assert 392) - (dma-buffer basic :offset-assert 396) - (to-spr uint32 :offset-assert 400) - (from-spr uint32 :offset-assert 404) - (wind-work uint32 :offset-assert 408) - (cur-vis-bits uint32 :offset-assert 412) - (end-vis-bits uint32 :offset-assert 416) - (first-generic-prototype uint32 :offset-assert 420) - (refl-fade-fac float :offset-assert 424) - (refl-fade-end float :offset-assert 428) - (flags uint32 :offset-assert 432) - (paused basic :offset-assert 436) - (wait-from-spr uint32 :offset-assert 440) - (wait-to-spr uint32 :offset-assert 444) + ((wind-const vector :inline) + (hmge-d vector :inline) + (hvdf-offset vector :inline) + (wind-force vector :inline) + (constant vector :inline) + (far-morph vector :inline) + (dist-test vector :inline) + (min-dist vector :inline) + (guard-plane plane 4 :inline) + (upload-color-0 dma-packet :inline) + (upload-color-1 dma-packet :inline) + (upload-color-2 dma-packet :inline) + (upload-color-ret dma-packet :inline) + (upload-color-temp dma-packet :inline) + (generic-color-0 dma-packet :inline) + (generic-color-1 dma-packet :inline) + (generic-color-end dma-packet :inline) + (tie-near-perspective-matrix matrix :inline) + (wind-vectors uint32) + (test-id uint32) + (test-id2 uint32) + (dma-buffer basic) + (to-spr uint32) + (from-spr uint32) + (wind-work uint32) + (cur-vis-bits uint32) + (end-vis-bits uint32) + (first-generic-prototype uint32) + (refl-fade-fac float) + (refl-fade-end float) + (flags uint32) + (paused basic) + (wait-from-spr uint32) + (wait-to-spr uint32) ) - :method-count-assert 9 - :size-assert #x1c0 - :flag-assert #x9000001c0 ) ;; DMA storage for instance dma generation (mapped to scratchpad) (deftype instance-tie-dma (structure) - ((banka instance-tie 32 :inline :offset-assert 0) - (bankb instance-tie 32 :inline :offset-assert 2048) - (outa uint128 256 :offset-assert 4096) - (outb uint128 256 :offset-assert 8192) - (work instance-tie-work :dynamic :offset-assert 12288) + ((banka instance-tie 32 :inline) + (bankb instance-tie 32 :inline) + (outa uint128 256) + (outb uint128 256) + (work instance-tie-work :dynamic) ) - :method-count-assert 9 - :size-assert #x3000 - :flag-assert #x900003000 ) ;; temps used in the prototype drawing (deftype prototype-tie-work (structure) - ((upload-palette-0 dma-packet :inline :offset-assert 0) - (upload-palette-1 dma-packet :inline :offset-assert 16) - (upload-model-0 dma-packet :inline :offset-assert 32) - (upload-model-1 dma-packet :inline :offset-assert 48) - (upload-model-2 dma-packet :inline :offset-assert 64) - (upload-model-3 dma-packet :inline :offset-assert 80) - (upload-model-near-0 dma-packet :inline :offset-assert 96) - (upload-model-near-1 dma-packet :inline :offset-assert 112) - (upload-model-near-2 dma-packet :inline :offset-assert 128) - (upload-model-near-3 dma-packet :inline :offset-assert 144) - (upload-model-near-4 dma-packet :inline :offset-assert 160) - (generic-envmap-shader dma-packet :inline :offset-assert 176) - (generic-palette dma-packet :inline :offset-assert 192) - (generic-model-0 dma-packet :inline :offset-assert 208) - (generic-model-1 dma-packet :inline :offset-assert 224) - (generic-model-2 dma-packet :inline :offset-assert 240) - (generic-model-next dma-packet :inline :offset-assert 256) - (clamp uint64 :offset-assert 272) - (prototype-array basic :offset-assert 280) - (generic-wait-from-spr uint32 :offset-assert 284) - (generic-wait-to-spr uint32 :offset-assert 288) - (wait-from-spr uint32 :offset-assert 292) - (wait-to-spr uint32 :offset-assert 296) - (near-wait-from-spr uint32 :offset-assert 300) - (near-wait-to-spr uint32 :offset-assert 304) + ((upload-palette-0 dma-packet :inline) + (upload-palette-1 dma-packet :inline) + (upload-model-0 dma-packet :inline) + (upload-model-1 dma-packet :inline) + (upload-model-2 dma-packet :inline) + (upload-model-3 dma-packet :inline) + (upload-model-near-0 dma-packet :inline) + (upload-model-near-1 dma-packet :inline) + (upload-model-near-2 dma-packet :inline) + (upload-model-near-3 dma-packet :inline) + (upload-model-near-4 dma-packet :inline) + (generic-envmap-shader dma-packet :inline) + (generic-palette dma-packet :inline) + (generic-model-0 dma-packet :inline) + (generic-model-1 dma-packet :inline) + (generic-model-2 dma-packet :inline) + (generic-model-next dma-packet :inline) + (clamp uint64) + (prototype-array basic) + (generic-wait-from-spr uint32) + (generic-wait-to-spr uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (near-wait-from-spr uint32) + (near-wait-to-spr uint32) ) - :method-count-assert 9 - :size-assert #x134 - :flag-assert #x900000134 ) ;; DMA storage for prototype dma generation (mapped to scratchpad) (deftype prototype-tie-dma (structure) - ((colora rgba 256 :offset-assert 0) - (colorb rgba 256 :offset-assert 1024) - (outa uint128 256 :offset-assert 2048) - (outb uint128 256 :offset-assert 6144) - (length uint32 :offset-assert 10240) - (dma-buffer basic :offset-assert 10244) - (this-frag-count uint32 :offset-assert 10248) - (next uint32 4 :offset 10256) - (geometry uint32 4 :offset-assert 10272) - (frag-count uint8 4 :offset-assert 10288) + ((colora rgba 256) + (colorb rgba 256) + (outa uint128 256) + (outb uint128 256) + (length uint32) + (dma-buffer basic) + (this-frag-count uint32) + (next uint32 4 :offset 10256) + (geometry uint32 4) + (frag-count uint8 4) ) - :method-count-assert 9 - :size-assert #x2834 - :flag-assert #x900002834 ) diff --git a/goal_src/jak1/engine/gfx/tie/tie-methods.gc b/goal_src/jak1/engine/gfx/tie/tie-methods.gc index ddc0568cbc1..3f165f683f3 100644 --- a/goal_src/jak1/engine/gfx/tie/tie-methods.gc +++ b/goal_src/jak1/engine/gfx/tie/tie-methods.gc @@ -132,12 +132,12 @@ (tie-near-init-engine s5-4 (new 'static 'gs-test - :ate #x1 - :atst (gs-atest greater-equal) - :aref #x26 - :zte #x1 - :ztst (gs-ztest greater-equal) - ) + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) 0 ) (let ((v1-48 (the-as object (-> s5-4 base)))) @@ -179,12 +179,12 @@ (tie-near-init-engine s5-6 (new 'static 'gs-test - :ate #x1 - :atst (gs-atest greater-equal) - :aref #x26 - :zte #x1 - :ztst (gs-ztest greater-equal) - ) + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) 0 ) (let ((v1-68 (the-as object (-> s5-6 base)))) @@ -230,12 +230,9 @@ ;; a ranges of instances to debug (deftype tie-instance-debug (structure) - ((max-instance uint32 :offset-assert 0) - (min-instance uint32 :offset-assert 4) + ((max-instance uint32) + (min-instance uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; unused @@ -447,8 +444,8 @@ (set! (-> a0-51 data 17 name) "tie-generic") (+! (-> a0-51 data 17 count) 1) (+! (-> a0-51 data 17 used) - (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s2-1)) - ) + (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s2-1)) + ) (set! (-> a0-51 data 17 total) (-> a0-51 data 17 used)) ) ) @@ -486,11 +483,10 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id (if (zero? (-> arg1 index)) - (bucket-id tie-0) - (bucket-id tie-1) - ) - ) + (if (zero? (-> arg1 index)) + (bucket-id tie-0) + (bucket-id tie-1) + ) s2-2 (the-as (pointer dma-tag) a3-11) ) @@ -503,8 +499,8 @@ (set! (-> v1-100 data 9 name) "tie-fragment") (+! (-> v1-100 data 9 count) 1) (+! (-> v1-100 data 9 used) - (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s3-2)) - ) + (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s3-2)) + ) (set! (-> v1-100 data 9 total) (-> v1-100 data 9 used)) ) ) @@ -535,11 +531,10 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id (if (zero? (-> arg1 index)) - (bucket-id tie-near-0) - (bucket-id tie-near-1) - ) - ) + (if (zero? (-> arg1 index)) + (bucket-id tie-near-0) + (bucket-id tie-near-1) + ) s2-3 (the-as (pointer dma-tag) a3-16) ) @@ -551,8 +546,8 @@ (set! (-> a0-92 data 15 name) "tie-near") (+! (-> a0-92 data 15 count) 1) (+! (-> a0-92 data 15 used) - (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s3-3)) - ) + (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s3-3)) + ) (set! (-> a0-92 data 15 total) (-> a0-92 data 15 used)) ) ) @@ -569,7 +564,7 @@ (none) ) -(defmethod draw drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 drawable-tree-instance-tie) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-instance-tie) (arg0 drawable-tree-instance-tie) (arg1 display-frame)) "Add the tree to the background work list." (let* ((v1-1 (-> *background-work* tie-tree-count)) (a1-2 (-> (scratchpad-object terrain-context) bsp lev-index)) @@ -582,7 +577,7 @@ (none) ) -(defmethod collect-stats drawable-tree-instance-tie ((this drawable-tree-instance-tie)) +(defmethod collect-stats ((this drawable-tree-instance-tie)) "Collect statistics on TIE drawing." ;; only if tie/generic ran @@ -698,9 +693,7 @@ (none) ) - - -(defmethod debug-draw drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-instance-tie) (arg0 drawable) (arg1 display-frame)) (-> this data (+ (-> this length) -1)) (let* ((s5-0 (-> this prototypes prototype-array-tie)) (s4-0 (-> s5-0 length)) @@ -720,44 +713,44 @@ ;; note: the first three methods appear twice in the original code. -(defmethod collide-with-box drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) (collide-with-box (-> this data 0) (-> this length) arg1) 0 (none) ) -(defmethod collide-y-probe drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) (collide-y-probe (-> this data 0) (-> this length) arg1) 0 (none) ) -(defmethod collide-ray drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) (collide-ray (-> this data 0) (-> this length) arg1) 0 (none) ) -(defmethod collide-with-box drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) (collide-with-box (the-as instance-tie (-> this data)) (-> this length) arg1) 0 (none) ) -(defmethod collide-y-probe drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) (collide-y-probe (the-as instance-tie (-> this data)) (-> this length) arg1) 0 (none) ) -(defmethod collide-ray drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) (collide-ray (the-as instance-tie (-> this data)) (-> this length) arg1) 0 (none) ) -(defun tie-test-cam-restore () +(defun-debug tie-test-cam-restore () (let ((a0-0 (new-stack-vector0)) (a1-0 (new-stack-matrix0)) ) diff --git a/goal_src/jak1/engine/gfx/tie/tie-near.gc b/goal_src/jak1/engine/gfx/tie/tie-near.gc index 17175d2aca1..32d0e04e7cc 100644 --- a/goal_src/jak1/engine/gfx/tie/tie-near.gc +++ b/goal_src/jak1/engine/gfx/tie/tie-near.gc @@ -16,22 +16,19 @@ ;; uploaded to VU1 once per frame. (deftype tie-near-consts (structure) - ((extra qword :inline :offset-assert 0) - (gifbufs qword :inline :offset-assert 16) - (clrbufs qword :inline :offset-assert 32) - (adgif gs-gif-tag :inline :offset-assert 48) - (strgif gs-gif-tag :inline :offset-assert 64) - (fangif gs-gif-tag :inline :offset-assert 80) - (hvdfoffs vector :inline :offset-assert 96) - (invhscale vector :inline :offset-assert 112) - (guard vector :inline :offset-assert 128) - (atest ad-cmd 2 :inline :offset-assert 144) - (atest-tra ad-cmd :inline :offset 144) - (atest-def ad-cmd :inline :offset 160) + ((extra qword :inline) + (gifbufs qword :inline) + (clrbufs qword :inline) + (adgif gs-gif-tag :inline) + (strgif gs-gif-tag :inline) + (fangif gs-gif-tag :inline) + (hvdfoffs vector :inline) + (invhscale vector :inline) + (guard vector :inline) + (atest ad-cmd 2 :inline) + (atest-tra ad-cmd :inline :overlay-at (-> atest 0)) + (atest-def ad-cmd :inline :overlay-at (-> atest 1)) ) - :method-count-assert 9 - :size-assert #xb0 - :flag-assert #x9000000b0 ) ;; the actual program. diff --git a/goal_src/jak1/engine/gfx/tie/tie.gc b/goal_src/jak1/engine/gfx/tie/tie.gc index fb151f2dd72..f31de60cede 100644 --- a/goal_src/jak1/engine/gfx/tie/tie.gc +++ b/goal_src/jak1/engine/gfx/tie/tie.gc @@ -27,7 +27,7 @@ ;; something is going wrong mem-usage (believed fixed) -(defmethod login tie-fragment ((this tie-fragment)) +(defmethod login ((this tie-fragment)) "Initialize the shaders for a tie-fragment" ;; the gif data is just adgif shaders, each are 5 qw's @@ -53,12 +53,9 @@ this ) -(defmethod asize-of drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) +(defmethod asize-of ((this drawable-inline-array-instance-tie)) "Compute the size in memory of an array of instances." - (the-as int (+ (-> drawable-inline-array-instance-tie size) - (* (+ (-> this length) -1) 64) ;; 64 bytes / instance, minus the 1 in the type. - ) - ) + (the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> this length) -1) 64))) ) #| @@ -68,7 +65,7 @@ this ) |# -(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) +(defmethod login ((this drawable-tree-instance-tie)) "Login method for the tie instance tree." ;; just log in all of the drawables. (dotimes (s5-0 (-> this length)) @@ -89,7 +86,7 @@ this this ) -(defmethod login prototype-tie ((this prototype-tie)) +(defmethod login ((this prototype-tie)) "Login each tie-fragment." (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) @@ -97,7 +94,7 @@ this this ) -(defmethod mem-usage drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) "Compute memory usage for a drawable tree of TIE instances" (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) @@ -117,7 +114,7 @@ this this ) -(defmethod mem-usage tie-fragment ((this tie-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this tie-fragment) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a TIE prototype." (when (logtest? arg1 2) ;; count for an instance of this prototype. @@ -181,10 +178,7 @@ this ) (when (nonzero? (-> this debug-lines)) (dotimes (s4-0 (-> this debug-lines length)) - (+! - (-> arg0 data 14 count) - (-> (the-as (pointer int32) (-> this debug-lines s4-0)) 0) - ) + (+! (-> arg0 data 14 count) (-> (the-as (pointer int32) (-> this debug-lines s4-0)) 0)) (let ((v1-52 (asize-of (the-as basic (-> this debug-lines s4-0))))) (+! (-> arg0 data 12 used) v1-52) (+! (-> arg0 data 12 total) (logand -16 (+ v1-52 15))) @@ -195,7 +189,7 @@ this this ) -(defmethod mem-usage instance-tie ((this instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this instance-tie) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of TIE instance." (set! (-> arg0 length) (max 19 (-> arg0 length))) (set! (-> arg0 data 18 name) "instance-tie") @@ -240,7 +234,7 @@ this this ) -(defmethod mem-usage drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of an entire array of instances" (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) @@ -256,7 +250,7 @@ this this ) -(defmethod mem-usage prototype-tie ((this prototype-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-tie) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of an entire array of prototypes." (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) @@ -272,7 +266,7 @@ this this ) -(defmethod asize-of prototype-tie ((this prototype-tie)) +(defmethod asize-of ((this prototype-tie)) "Compute the size in memory of a prototype array" ;; 64 bytes/fragment, minus 1 in the type. (the-as int (+ (-> prototype-tie size) (* (+ (-> this length) -1) 64))) @@ -284,23 +278,20 @@ this ;; these constants are uploaded to the VU once per frame. (deftype tie-consts (structure) - ((data uint32 24 :offset-assert 0) - (vector vector 6 :inline :offset 0) - (quads uint128 6 :offset 0) - (adgif gs-gif-tag :inline :offset 0) ;; was qword - (strgif gs-gif-tag :inline :offset 16) ;; was qword - (extra vector :inline :offset 32) ;; was qword - (gifbufs vector :inline :offset 48) ;; was qword - (clrbufs qword :inline :offset 64) - (misc qword :inline :offset 80) - (atestgif gs-gif-tag :inline :offset 96) - (atest ad-cmd 2 :inline :offset 112) - (atest-tra ad-cmd :inline :offset 112) - (atest-def ad-cmd :inline :offset 128) + ((data uint32 24) + (vector vector 6 :inline :overlay-at (-> data 0)) + (quads uint128 6 :overlay-at (-> data 0)) + (adgif gs-gif-tag :inline :overlay-at (-> data 0)) + (strgif gs-gif-tag :inline :overlay-at (-> data 4)) + (extra vector :inline :overlay-at (-> data 8)) + (gifbufs vector :inline :overlay-at (-> data 12)) + (clrbufs qword :inline :overlay-at (-> data 16)) + (misc qword :inline :overlay-at (-> data 20)) + (atestgif gs-gif-tag :inline :offset 96) + (atest ad-cmd 2 :inline :offset 112) + (atest-tra ad-cmd :inline :overlay-at (-> atest 0)) + (atest-def ad-cmd :inline :overlay-at (-> atest 1)) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) ;; definition for symbol tie-vu1-block, type vu-function (define tie-vu1-block (new 'static 'vu-function :length 0 :qlength 0)) ;; was 0x3e1, 0x1f1 @@ -423,26 +414,7 @@ this (a0-4 (the-as object (-> v1-4 base))) ) (set! (-> (the-as gs-gif-tag a0-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-4) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) - ) + (set! (-> (the-as gs-gif-tag a0-4) regs) GIF_REGS_ALL_AD) (set! (-> v1-4 base) (the-as pointer (&+ (the-as gs-gif-tag a0-4) 16))) ) (let* ((v1-5 arg0) @@ -523,26 +495,7 @@ this (a1-2 (the-as object (-> v1-4 base))) ) (set! (-> (the-as gs-gif-tag a1-2) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a1-2) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) - ) + (set! (-> (the-as gs-gif-tag a1-2) regs) GIF_REGS_ALL_AD) (set! (-> v1-4 base) (&+ (the-as pointer a1-2) 16)) ) (let* ((v1-5 arg0) diff --git a/goal_src/jak1/engine/gfx/vu1-user-h.gc b/goal_src/jak1/engine/gfx/vu1-user-h.gc index acd0ab57140..34dc6692651 100644 --- a/goal_src/jak1/engine/gfx/vu1-user-h.gc +++ b/goal_src/jak1/engine/gfx/vu1-user-h.gc @@ -67,45 +67,33 @@ ;; a dma "sink" is somewhere where a renderer can put stuff. (deftype dma-foreground-sink (basic) - ((bucket bucket-id :offset-assert 4) ;; the DMA bucket - (foreground-texture-page int8 :offset-assert 8) ;; the tpage we need (in the level) - (foreground-texture-level int8 :offset-assert 9) ;; the level we belong to - (foreground-output-bucket int8 :offset-assert 10) ;; ? + ((bucket bucket-id) + (foreground-texture-page int8) + (foreground-texture-level int8) + (foreground-output-bucket int8) ) - :method-count-assert 9 - :size-assert #xb - :flag-assert #x90000000b ) ;; additional info for the generic renderer (deftype generic-bucket-state (structure) - ((gifbuf-adr uint32 :offset-assert 0) - (inbuf-adr uint32 :offset-assert 4) + ((gifbuf-adr uint32) + (inbuf-adr uint32) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; sink for the generic renderer, a normal sink + extra data. (deftype generic-dma-foreground-sink (dma-foreground-sink) - ((state generic-bucket-state :inline :offset-assert 12) + ((state generic-bucket-state :inline) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; group of sinks used for the foreground renderers. (declare-type level basic) (deftype dma-foreground-sink-group (basic) - ((sink dma-foreground-sink 3 :offset-assert 4) - (merc-sink dma-foreground-sink :offset 4) - (generic-sink generic-dma-foreground-sink :offset 8) - (level level :offset-assert 16) + ((sink dma-foreground-sink 3) + (merc-sink dma-foreground-sink :overlay-at (-> sink 0)) + (generic-sink generic-dma-foreground-sink :overlay-at (-> sink 1)) + (level level) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) diff --git a/goal_src/jak1/engine/level/bsp-h.gc b/goal_src/jak1/engine/level/bsp-h.gc index 3d5e8cc79d1..b2dd5e974c2 100644 --- a/goal_src/jak1/engine/level/bsp-h.gc +++ b/goal_src/jak1/engine/level/bsp-h.gc @@ -30,179 +30,138 @@ ;; a node in the bsp tree (deftype bsp-node (structure) - ((front int32 :offset-assert 0) ;; if > 0, is a pointer to another bsp-node - (back int32 :offset-assert 4) ;; if > 0, is a pointer to another bsp-node - (front-flags uint32 :offset-assert 8) ;; ? - (back-flags uint32 :offset-assert 12) ;; ? - (plane vector :inline :offset-assert 16) ;; the partitioning plane + ((front int32) + (back int32) + (front-flags uint32) + (back-flags uint32) + (plane vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; This is the object stored first in the level bt (-vis) ;; It is also a drawable, and drawing it will draw the level. (deftype bsp-header (drawable) - ((info file-info :offset 4) - (all-visible-list (pointer uint16) :offset-assert 32) - (visible-list-length int32 :offset-assert 36) - (drawable-trees drawable-tree-array :offset-assert 40) - (pat pointer :offset-assert 44) - (pat-length int32 :offset-assert 48) - (texture-remap-table (pointer uint64) :offset-assert 52) - (texture-remap-table-len int32 :offset-assert 56) - (texture-ids (pointer texture-id) :offset-assert 60) - (texture-page-count int32 :offset-assert 64) - (unk-zero-0 basic :offset-assert 68) - (name symbol :offset-assert 72) - (nickname symbol :offset-assert 76) - (vis-info level-vis-info 8 :offset-assert 80) ;; note: 0 when not present. - (actors drawable-inline-array-actor :offset-assert 112) - (cameras (array entity-camera) :offset-assert 116) - (nodes (inline-array bsp-node) :offset-assert 120) - (level level :offset-assert 124) - (current-leaf-idx uint16 :offset-assert 128) - (unk-data-2 uint16 9 :offset-assert 130) - (boxes box8s-array :offset-assert 148) - (current-bsp-back-flags uint32 :offset-assert 152) - (ambients drawable-inline-array-ambient :offset-assert 156) - (unk-data-4 float :offset-assert 160) - (unk-data-5 float :offset-assert 164) - (adgifs adgif-shader-array :offset-assert 168) - (actor-birth-order (pointer uint32) :offset-assert 172) - (split-box-indices (pointer uint16) :offset-assert 176) - (unk-data-8 uint32 55 :offset-assert 180) + ((info file-info :overlay-at id) + (all-visible-list (pointer uint16)) + (visible-list-length int32) + (drawable-trees drawable-tree-array) + (pat pointer) + (pat-length int32) + (texture-remap-table (pointer uint64)) + (texture-remap-table-len int32) + (texture-ids (pointer texture-id)) + (texture-page-count int32) + (unk-zero-0 basic) + (name symbol) + (nickname symbol) + (vis-info level-vis-info 8) + (actors drawable-inline-array-actor) + (cameras (array entity-camera)) + (nodes (inline-array bsp-node)) + (level level) + (current-leaf-idx uint16) + (unk-data-2 uint16 9) + (boxes box8s-array) + (current-bsp-back-flags uint32) + (ambients drawable-inline-array-ambient) + (unk-data-4 float) + (unk-data-5 float) + (adgifs adgif-shader-array) + (actor-birth-order (pointer uint32)) + (split-box-indices (pointer uint16)) + (unk-data-8 uint32 55) ) - :method-count-assert 20 - :size-assert #x190 - :flag-assert #x1400000190 (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (birth (_type_) none 18) - (deactivate-entities (_type_) none 19) - ) + (relocate (_type_ kheap (pointer uint8)) none :replace) + (birth (_type_) none) + (deactivate-entities (_type_) none) + ) ) ;; seems to be unused? ;; In practice, a normal bsp-header is a game-level. (deftype game-level (basic) - ((master-bsp basic :offset-assert 4) + ((master-bsp basic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype view-frustum (structure) - ((hither-top-left vector :inline :offset-assert 0) - (hither-top-right vector :inline :offset-assert 16) - (hither-bottom-left vector :inline :offset-assert 32) - (hither-bottom-right vector :inline :offset-assert 48) - (yon-top-left vector :inline :offset-assert 64) - (yon-top-right vector :inline :offset-assert 80) - (yon-bottom-left vector :inline :offset-assert 96) - (yon-bottom-right vector :inline :offset-assert 112) + ((hither-top-left vector :inline) + (hither-top-right vector :inline) + (hither-bottom-left vector :inline) + (hither-bottom-right vector :inline) + (yon-top-left vector :inline) + (yon-top-right vector :inline) + (yon-bottom-left vector :inline) + (yon-bottom-right vector :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 - ) -(define-extern inspect-bsp-tree (function bsp-header bsp-node none)) - -(defmethod inspect bsp-header ((this bsp-header)) - (format #t "[~8x] ~A~%" this (-> this type)) - (format #t "~Tall-visible-list: #x~X~%" (-> this all-visible-list)) - (format #t "~Tvisible-list-length: ~D~%" (-> this visible-list-length)) - (format #t "~Tdrawable-trees: ~A~%" (-> this drawable-trees)) - (format #t "~Tpat: #x~X~%" (-> this pat)) - (format #t "~Tpat-length: ~D~%" (-> this pat-length)) - ;; putting this stuff here for debugging! - (format #t "~Ttexture-remap-table-len: ~D~%" (-> this texture-remap-table-len)) - (dotimes (i (-> this texture-remap-table-len)) - (let* ((tex-id-array (the (pointer texture-id) (&-> this texture-remap-table i))) - (tex-id-from (-> tex-id-array 0)) - (tex-id-to (-> tex-id-array 1)) - ) - (format #t "~T~Ttex-remap[~D]: # --> #~%" - i - (-> tex-id-from page) (-> tex-id-from index) - (-> tex-id-to page) (-> tex-id-to index) - ) - ) - ) - ;;(inspect-bsp-tree this (the-as bsp-node (-> this nodes))) - this ) -(defun-debug inspect-bsp-tree ((arg0 bsp-header) (arg1 bsp-node)) + +(defun-debug-recursive inspect-bsp-tree none ((arg0 bsp-header) (arg1 bsp-node)) "Recursively print all nodes in a bsp tree. This makes a huge mess" (cond - ((zero? arg1) - ) - (else - (format #t "_#x~X________________~%" arg1) - (inspect arg1) - (let ((s4-0 *print-column*)) - (set! *print-column* (+ *print-column* 8)) - (if (> (-> arg1 front) 0) - (inspect-bsp-tree arg0 (the-as bsp-node (-> arg1 front))) - (format #t "_#x~X________________~%" arg1) - ) - (if (> (-> arg1 back) 0) - (inspect-bsp-tree arg0 (the-as bsp-node (-> arg1 back))) + ((zero? arg1) + ) + (else (format #t "_#x~X________________~%" arg1) + (inspect arg1) + (let ((s4-0 *print-column*)) + (set! *print-column* (+ *print-column* 64)) + (if (> (-> arg1 front) 0) + (inspect-bsp-tree arg0 (the-as bsp-node (-> arg1 front))) + (format #t "_#x~X________________~%" arg1) + ) + (if (> (-> arg1 back) 0) + (inspect-bsp-tree arg0 (the-as bsp-node (-> arg1 back))) + (format #t "_#x~X________________~%" arg1) + ) + (set! *print-column* s4-0) + ) ) - (set! *print-column* s4-0) - ) ) - ) (none) ) (defun-recursive map-bsp-tree none ((arg0 (function bsp-node none)) (arg1 bsp-header) (arg2 bsp-node)) "Recursively apply arg0 to all nodes in the bsp tree" (cond - ((zero? arg2) - ) - (else - (if (> (-> arg2 front) 0) - (map-bsp-tree arg0 arg1 (the-as bsp-node (-> arg2 front))) - (arg0 arg2) - ) - (if (> (-> arg2 back) 0) - (map-bsp-tree arg0 arg1 (the-as bsp-node (-> arg2 back))) - (arg0 arg2) + ((zero? arg2) ) + (else + (if (> (-> arg2 front) 0) + (map-bsp-tree arg0 arg1 (the-as bsp-node (-> arg2 front))) + (arg0 arg2) + ) + (if (> (-> arg2 back) 0) + (map-bsp-tree arg0 arg1 (the-as bsp-node (-> arg2 back))) + (arg0 arg2) + ) + ) ) - ) (none) ) (deftype cl-stat (structure) - ((fragments uint32 :offset-assert 0) - (tris uint32 :offset-assert 4) - (output uint32 :offset-assert 8) + ((fragments uint32) + (tris uint32) + (output uint32) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) + (deftype collide-stats (structure) - ((other cl-stat :inline :offset-assert 0) - (total cl-stat :inline :offset-assert 12) - (nodes uint32 :offset-assert 24) - (calls uint32 :offset-assert 28) - (total-target stopwatch :inline :offset-assert 32) - (target-cache-fill stopwatch :inline :offset-assert 64) - (target-ray-poly stopwatch :inline :offset-assert 96) - (pad uint32 :offset-assert 124) + ((other cl-stat :inline) + (total cl-stat :inline) + (nodes uint32) + (calls uint32) + (total-target stopwatch :inline) + (target-cache-fill stopwatch :inline) + (target-ray-poly stopwatch :inline) + (pad uint32) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; offsets of stuff in the scratchpad during bsp draw. diff --git a/goal_src/jak1/engine/level/bsp.gc b/goal_src/jak1/engine/level/bsp.gc index 129bc7f8ce2..9e5eec8a74f 100644 --- a/goal_src/jak1/engine/level/bsp.gc +++ b/goal_src/jak1/engine/level/bsp.gc @@ -14,26 +14,26 @@ (defun-recursive mem-usage-bsp-tree none ((header bsp-header) (node bsp-node) (mem-use memory-usage-block) (flags int)) "Update the given mem-use for the memory used by the tree structure itself" (cond - ((zero? node) - ) - (else - (+! (-> mem-use data 58 count) 1) - (let ((v1-3 32)) - (+! (-> mem-use data 58 used) v1-3) - (+! (-> mem-use data 58 total) (logand -16 (+ v1-3 15))) - ) - (if (> (-> node front) 0) - (mem-usage-bsp-tree header (the-as bsp-node (-> node front)) mem-use flags) - ) - (if (> (-> node back) 0) - (mem-usage-bsp-tree header (the-as bsp-node (-> node back)) mem-use flags) + ((zero? node) ) + (else + (+! (-> mem-use data 58 count) 1) + (let ((v1-3 32)) + (+! (-> mem-use data 58 used) v1-3) + (+! (-> mem-use data 58 total) (logand -16 (+ v1-3 15))) + ) + (if (> (-> node front) 0) + (mem-usage-bsp-tree header (the-as bsp-node (-> node front)) mem-use flags) + ) + (if (> (-> node back) 0) + (mem-usage-bsp-tree header (the-as bsp-node (-> node back)) mem-use flags) + ) + ) ) - ) (none) ) -(defmethod mem-usage bsp-header ((this bsp-header) (mem-use memory-usage-block) (flags int)) +(defmethod mem-usage ((this bsp-header) (mem-use memory-usage-block) (flags int)) "Update the memory usage info for this bsp-header. This will visit all the stuff in the level data." @@ -176,8 +176,7 @@ this ) - -(defmethod login bsp-header ((this bsp-header)) +(defmethod login ((this bsp-header)) "Main login for a level" ;; login our drawables (if (nonzero? (-> this drawable-trees)) @@ -197,7 +196,7 @@ (define *test-shrub* 0) ;; unused. -(defmethod draw bsp-header ((this bsp-header) (other-draw bsp-header) (arg1 display-frame)) +(defmethod draw ((this bsp-header) (other-draw bsp-header) (disp-frame display-frame)) "Draw the level" (local-vars (a3-4 uint128) (a3-5 uint128) (r0 uint128)) (set! r0 (the-as uint128 0)) @@ -289,7 +288,7 @@ ) ;; draw! (let ((a1-7 (-> this drawable-trees))) - (draw a1-7 a1-7 arg1) + (draw a1-7 a1-7 disp-frame) ) ;; end a profile bar (if *debug-segment* @@ -331,7 +330,7 @@ (none) ) -(defmethod debug-draw bsp-header ((this bsp-header) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this bsp-header) (arg0 drawable) (arg1 display-frame)) "This is some sort of debugging thing. It calls debug-draw on the drawables with the scratchpad and vfs set up." @@ -390,7 +389,7 @@ (none) ) -(defmethod collect-stats bsp-header ((this bsp-header)) +(defmethod collect-stats ((this bsp-header)) "Collect drawing statistics" (let ((v1-0 (-> this level)) (a2-0 (/ (+ (-> this visible-list-length) 15) 16)) @@ -486,41 +485,41 @@ ;; Collision ;;;;;;;;;;;;;;; -(defmethod collide-with-box bsp-header ((this bsp-header) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this bsp-header) (arg0 int) (arg1 collide-list)) "Top level collision with a box function. I think the arg0 length doesn't really matter here." (+! (-> *collide-stats* calls) 1) (let ((s4-0 (-> this drawable-trees))) (dotimes (s3-0 (-> s4-0 length)) - (collide-with-box (-> s4-0 data s3-0) arg0 arg1) + (collide-with-box (-> s4-0 trees s3-0) arg0 arg1) ) ) (none) ) -(defmethod collide-y-probe bsp-header ((this bsp-header) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this bsp-header) (arg0 int) (arg1 collide-list)) (+! (-> *collide-stats* calls) 1) (let ((s4-0 (-> this drawable-trees))) (dotimes (s3-0 (-> s4-0 length)) - (collide-y-probe (-> s4-0 data s3-0) arg0 arg1) + (collide-y-probe (-> s4-0 trees s3-0) arg0 arg1) ) ) (none) ) -(defmethod collide-ray bsp-header ((this bsp-header) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this bsp-header) (arg0 int) (arg1 collide-list)) (+! (-> *collide-stats* calls) 1) (let ((s4-0 (-> this drawable-trees))) (dotimes (s3-0 (-> s4-0 length)) - (collide-ray (-> s4-0 data s3-0) arg0 arg1) + (collide-ray (-> s4-0 trees s3-0) arg0 arg1) ) ) (none) ) -(defmethod collect-ambients bsp-header ((this bsp-header) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients ((this bsp-header) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (let ((s3-0 (-> this drawable-trees))) (dotimes (s2-0 (-> s3-0 length)) - (collect-ambients (-> s3-0 data s2-0) arg0 arg1 arg2) + (collect-ambients (-> s3-0 trees s2-0) arg0 arg1 arg2) ) ) (none) @@ -539,15 +538,15 @@ "Print stats for arg1" (when (nonzero? (+ (-> arg0 fragments) (-> arg0 tris))) (format - *stdcon* - "~0k~5d/~d ~6d/~d ~6d/~d " - (-> arg0 fragments) - (/ (-> arg0 fragments) (-> *collide-stats* calls)) - (-> arg0 tris) - (/ (-> arg0 tris) (-> *collide-stats* calls)) - (-> arg0 output) - (/ (-> arg0 output) (-> *collide-stats* calls)) - ) + *stdcon* + "~0k~5d/~d ~6d/~d ~6d/~d " + (-> arg0 fragments) + (/ (-> arg0 fragments) (-> *collide-stats* calls)) + (-> arg0 tris) + (/ (-> arg0 tris) (-> *collide-stats* calls)) + (-> arg0 output) + (/ (-> arg0 output) (-> *collide-stats* calls)) + ) (format *stdcon* "~0k~s~%" arg1) (+! (-> *collide-stats* total fragments) (-> arg0 fragments)) (+! (-> *collide-stats* total tris) (-> arg0 tris)) @@ -560,10 +559,11 @@ "Print and reset collide stats for this frame" ;; for some unknown reason, we profile this. (if *debug-segment* - (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) - 'draw - (new 'static 'rgba :r #x40 :b #x40 :a #x80) - ) + (add-frame + (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'draw + (new 'static 'rgba :r #x40 :b #x40 :a #x80) + ) ) (format *stdcon* "~0k frags tris output~%") (print-cl-stat (-> *collide-stats* other) "other") @@ -578,14 +578,8 @@ ) (format *stdcon* "~0ktotal-target ~D~%" gp-0) ;; these can divide by zero if it doesn't run. - (format *stdcon* "~0ktarget-cache-fill ~D ~0,,2f%~%" - s4-0 - (/ (* 100.0 (the float s4-0)) (the float gp-0)) - ) - (format *stdcon* "~0ktarget-ray-poly ~D ~0,,2f%~%" - s5-0 - (/ (* 100.0 (the float s5-0)) (the float gp-0)) - ) + (format *stdcon* "~0ktarget-cache-fill ~D ~0,,2f%~%" s4-0 (/ (* 100.0 (the float s4-0)) (the float gp-0))) + (format *stdcon* "~0ktarget-ray-poly ~D ~0,,2f%~%" s5-0 (/ (* 100.0 (the float s5-0)) (the float gp-0))) ) ;; reset (clear-cl-stat (-> *collide-stats* other)) @@ -596,17 +590,18 @@ (stopwatch-init (-> *collide-stats* target-cache-fill)) (stopwatch-init (-> *collide-stats* target-ray-poly)) (if *debug-segment* - (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) - 'draw - (new 'static 'rgba :b #xff :a #x80) - ) + (add-frame + (-> *display* frames (-> *display* on-screen) frame profile-bar 0) + 'draw + (new 'static 'rgba :b #xff :a #x80) + ) ) 0 (none) ) (defun level-remap-texture ((tex-id texture-id)) - "Levels can request textures to be remapped during login" + "Uses the currently loading level's remap table to turn a texture-id into a level-specific texture-id" (let ((bsp-hdr (-> *level* log-in-level-bsp))) (when bsp-hdr (let* ((table-size (-> bsp-hdr texture-remap-table-len)) ;; in 64-bit entries diff --git a/goal_src/jak1/engine/level/level-h.gc b/goal_src/jak1/engine/level/level-h.gc index f359f2e0fef..f97219aa346 100644 --- a/goal_src/jak1/engine/level/level-h.gc +++ b/goal_src/jak1/engine/level/level-h.gc @@ -66,27 +66,24 @@ ;; levels. This means that visibility for "beach" near the border of "village1" is stored in ;; both BEA.VIS and VI1.VIS. (deftype level-vis-info (basic) - ((level symbol :offset-assert 4) - (from-level symbol :offset-assert 8) - (from-bsp bsp-header :offset-assert 12) - (flags uint32 :offset-assert 16) - (length uint32 :offset-assert 20) - (allocated-length uint32 :offset-assert 24) - (dictionary-length uint32 :offset-assert 28) - (dictionary uint32 :offset-assert 32) - (string-block uint32 :offset-assert 36) - (ramdisk uint32 :offset-assert 40) ;; ramdisk file ID. - (vis-bits pointer :offset-assert 44) - (current-vis-string uint32 :offset-assert 48) - (vis-string uint32 :dynamic :offset-assert 52) + ((level symbol) + (from-level symbol) + (from-bsp bsp-header) + (flags uint32) + (length uint32) + (allocated-length uint32) + (dictionary-length uint32) + (dictionary uint32) + (string-block uint32) + (ramdisk uint32) + (vis-bits pointer) + (current-vis-string uint32) + (vis-string uint32 :dynamic) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) -(defmethod asize-of level-vis-info ((this level-vis-info)) +(defmethod asize-of ((this level-vis-info)) "Get the size of a level-vis-info in memory" (the-as int (+ (-> level-vis-info size) (-> this dictionary-length))) ) @@ -95,192 +92,158 @@ ;; These are stored in level-info.gc which is always loaded, so this should have all the information required ;; to do a level load. (deftype level-load-info (basic) - ((name-list symbol 3 :offset-assert 4) - (index int32 :offset-assert 16) ;; the level number (starting with 1?) - (name symbol :offset 4) ;; symbol with full name, like "misty" - (visname symbol :offset 8) ;; symbol with vis file name, like "misty-vis" - (nickname symbol :offset 12) ;; 3 letter name for DGO, like "mis" - (packages pair :offset-assert 20) ;; list of symbols, usually empty or the level name - (sound-banks pair :offset-assert 24) ;; require sound bank files (list of symbols) - (music-bank symbol :offset-assert 28) ;; name of level music - (ambient-sounds pair :offset-assert 32) ;; always empty list. - (mood symbol :offset-assert 36) ;; mood object name - (mood-func symbol :offset-assert 40) ;; mood update function name - (ocean symbol :offset-assert 44) ;; ocean map object - (sky symbol :offset-assert 48) ;; boolean to enable sky - (sun-fade float :offset-assert 52) ;; sun/sky setting - (continues pair :offset-assert 56) ;; list of checkpoints - (tasks pair :offset-assert 60) ;; list of boxed integers for tasks - (priority int32 :offset-assert 64) ;; either 100 or 200 - (load-commands pair :offset-assert 68) ;; ?? - (alt-load-commands pair :offset-assert 72) ;; ?? - (bsp-mask uint64 :offset-assert 80) ;; ?? unused - (bsphere sphere :offset-assert 88) ;; boundings sphere of level? - (buzzer int32 :offset-assert 92) ;; which task is the scout fly? - (bottom-height meters :offset-assert 96) - (run-packages pair :offset-assert 100) ;; possibly unused? - (prev-level basic :offset-assert 104) ;; unused - (next-level basic :offset-assert 108) ;; unused - (wait-for-load symbol :offset-assert 112) + ((name-list symbol 3) + (index int32) ;; the level number (starting with 1?) + (name symbol :overlay-at (-> name-list 0)) + (visname symbol :overlay-at (-> name-list 1)) + (nickname symbol :overlay-at (-> name-list 2)) + (packages pair) + (sound-banks pair) + (music-bank symbol) + (ambient-sounds pair) + (mood symbol) + (mood-func symbol) + (ocean symbol) + (sky symbol) + (sun-fade float) + (continues pair) + (tasks pair) + (priority int32) + (load-commands pair) + (alt-load-commands pair) + (bsp-mask uint64) + (bsphere sphere) + (buzzer int32) + (bottom-height meters) + (run-packages pair) + (prev-level basic) + (next-level basic) + (wait-for-load symbol) ) - :method-count-assert 9 - :size-assert #x74 - :flag-assert #x900000074 ) ;; The levels are initialized (called "login") over multiple frames. ;; The state of this process is stored in a login-state. (deftype login-state (basic) - ((state int32 :offset-assert 4) - (pos uint32 :offset-assert 8) - (elts uint32 :offset-assert 12) - (elt drawable 16 :offset-assert 16) ;; might be more specific + ((state int32) + (pos uint32) + (elts uint32) + (elt drawable 16) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; The actual "level". This manages loading and running a game level. ;; These are allocated by the engine and aren't in static level data. -(deftype level (basic) - ((name symbol :offset-assert 4) - (load-name symbol :offset-assert 8) - (nickname symbol :offset-assert 12) - (index int32 :offset-assert 16) - (status symbol :offset-assert 20) - (other level :offset-assert 24) ;; the other level object - (heap kheap :inline :offset-assert 32) ;; level's ~10 MB heap - (bsp bsp-header :offset-assert 48) ;; the main level object in the DGO - (art-group load-dir-art-group :offset-assert 52) ;; the art (foreground models/anims) for the level - (info level-load-info :offset-assert 56) ;; the load-info for this level, - (texture-page texture-page 9 :offset-assert 60) ;; logged-in texture pages (tfrag, pris, shrub, alpha, water) - (loaded-texture-page texture-page 16 :offset-assert 96) ;; texture pages that are loaded (and will need unloading) - (loaded-texture-page-count int32 :offset-assert 160) - - ;; dma "sinks" for foreground level things to render to (plus water and generic tie) - (tfrag-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 176) - (pris-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 208) - (water-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 240) - (foreground-sink-group dma-foreground-sink-group 3 :inline :offset 176) ;; overlay of previous 3. - - ;; engines for each of the three sinks - (foreground-draw-engine engine 3 :offset-assert 272) - - ;; linked entities/ambients - (entity entity-links-array :offset-assert 284) - (ambient entity-ambient-data-array :offset-assert 288) - - ;; closest objects, used for texture upload decisions. indexed by tpage (only first 5 used) - (closest-object float 9 :offset-assert 292) - ;; texture upload size, bytes. indexed by tpage (only first 5 used) - (upload-size int32 9 :offset-assert 328) - - ;; info about jak/camera position, relative to the level - (level-distance meters :offset-assert 364) ;; camera distance from level bsphere origin - (inside-sphere? symbol :offset-assert 368) ;; camera inside bsphere? - (inside-boxes? symbol :offset-assert 372) ;; inside the level box list? - (display? symbol :offset-assert 376) ;; level being displayed? - (meta-inside? symbol :offset-assert 380) ;; inside, but stays true until you go inside another level. - - ;; mood - (mood mood-context :offset-assert 384) ;; current state - (mood-func (function mood-context float int none) :offset-assert 388) ;; function to call to update mood - - ;; vis - (vis-bits pointer :offset-assert 392) ;; visibility string buffer - (all-visible? symbol :offset-assert 396) ;; set if visibility system has no info - (force-all-visible? symbol :offset-assert 400) ;; set to disable visibiltiy system and display all - (linking basic :offset-assert 404) ;; is linking in progress? - (vis-info level-vis-info 8 :offset-assert 408) ;; note: #f when doesn't exist. - (vis-self-index int32 :offset-assert 440) ;; vis-info index for this level - (vis-adj-index int32 :offset-assert 444) ;; vis-info index for the other level - (vis-buffer uint8 2048 :offset-assert 448) ;; buffer for vis decompression - (mem-usage-block memory-usage-block :offset-assert 2496) ;; level data memory usage stats - (mem-usage int32 :offset-assert 2500) ;; total use - (code-memory-start pointer :offset-assert 2504) ;; address of start of code - (code-memory-end pointer :offset-assert 2508) ;; address of end of code - (texture-mask uint32 9 :offset-assert 2512) ;; mask of textures we need, per tpage. - (force-inside? symbol :offset-assert 2548) ;; fake being inside? - (pad uint8 56) +(deftype level (basic) + ((name symbol) + (load-name symbol) + (nickname symbol) + (index int32) + (status symbol) + (other level) + (heap kheap :inline) + (bsp bsp-header) + (art-group load-dir-art-group) + (info level-load-info) + (texture-page texture-page 9) + (loaded-texture-page texture-page 16) + (loaded-texture-page-count int32) + (tfrag-tex-foreground-sink-group dma-foreground-sink-group :inline) + (pris-tex-foreground-sink-group dma-foreground-sink-group :inline) + (water-tex-foreground-sink-group dma-foreground-sink-group :inline) + (foreground-sink-group dma-foreground-sink-group 3 :inline :overlay-at tfrag-tex-foreground-sink-group) + (foreground-draw-engine engine 3) + (entity entity-links-array) + (ambient entity-ambient-data-array) + (closest-object float 9) + (upload-size int32 9) + (level-distance meters) + (inside-sphere? symbol) + (inside-boxes? symbol) + (display? symbol) + (meta-inside? symbol) + (mood mood-context) + (mood-func (function mood-context float int none)) + (vis-bits pointer) + (all-visible? symbol) + (force-all-visible? symbol) + (linking basic) + (vis-info level-vis-info 8) + (vis-self-index int32) + (vis-adj-index int32) + (vis-buffer uint8 2048) + (mem-usage-block memory-usage-block) + (mem-usage int32) + (code-memory-start pointer) + (code-memory-end pointer) + (texture-mask uint32 9) + (force-inside? symbol) + (pad uint8 56) ) - :method-count-assert 29 - :size-assert #xa30 - :flag-assert #x1d00000a30 (:methods - (deactivate (_type_) _type_ 9) - (is-object-visible? (_type_ int) symbol 10) - (add-irq-to-tex-buckets! (_type_) none 11) - (unload! (_type_) _type_ 12) - (bsp-name (_type_) symbol 13) - (compute-memory-usage (_type_ object) memory-usage-block 14) - (point-in-boxes? (_type_ vector) symbol 15) - (update-vis! (_type_ level-vis-info uint uint) symbol 16) - (load-continue (_type_) _type_ 17) - (load-begin (_type_) _type_ 18) - (login-begin (_type_) _type_ 19) - (vis-load (_type_) uint 20) - (unused-21 (_type_) none 21) - (birth (_type_) _type_ 22) - (level-status-set! (_type_ symbol) _type_ 23) - (load-required-packages (_type_) _type_ 24) - (init-vis (_type_) int 25) - (vis-clear (_type_) int 26) - (debug-print-splitbox (_type_ vector string) none 27) - (art-group-get-by-name (_type_ string) art-group 28) + (deactivate (_type_) _type_) + (is-object-visible? (_type_ int) symbol) + (add-irq-to-tex-buckets! (_type_) none) + (unload! (_type_) _type_) + (bsp-name (_type_) symbol) + (compute-memory-usage (_type_ object) memory-usage-block) + (point-in-boxes? (_type_ vector) symbol) + (update-vis! (_type_ level-vis-info uint uint) symbol) + (load-continue (_type_) _type_) + (load-begin (_type_) _type_) + (login-begin (_type_) _type_) + (vis-load (_type_) uint) + (unused-21 (_type_) none) + (birth (_type_) _type_) + (level-status-set! (_type_ symbol) _type_) + (load-required-packages (_type_) _type_) + (init-vis (_type_) int) + (vis-clear (_type_) int) + (debug-print-splitbox (_type_ vector string) none) + (art-group-get-by-name (_type_ string) art-group) ) ) -;; Main *level* object. -;; There are actually three levels. level0 and level1 correspond to the actual buffered levels -;; The level-default is to be a fake level that can possibly be used by renderers that -;; don't belong to any level, for example to render Jak. (deftype level-group (basic) - ((length int32 :offset-assert 4) - (log-in-level-bsp bsp-header :offset-assert 8) ;; level currently logging in - (loading-level level :offset-assert 12) ;; currently loading - (entity-link entity-links :offset-assert 16) ;; not sure what's going on here - (border? basic :offset-assert 20) - (vis? basic :offset-assert 24) - (want-level basic :offset-assert 28) - (receiving-level basic :offset-assert 32) - (load-commands pair :offset-assert 36) - (play? symbol :offset-assert 40) - ;; there's something? from 40 -> 96. - (_hack-pad uint8 :offset 90) - (level0 level :inline :offset-assert 96) - (level1 level :inline :offset-assert 2704) - (level-default level :inline :offset-assert 5312) - ;; this actually went earlier, - (level level 3 :inline :offset 96) - ;; and this one too. why another one? - (data level 3 :score -1 :inline :offset 96) - (pad uint32) + ((length int32) + (log-in-level-bsp bsp-header) + (loading-level level) + (entity-link entity-links) + (border? basic) + (vis? basic) + (want-level basic) + (receiving-level basic) + (load-commands pair) + (play? symbol) + (_hack-pad uint8 :offset 90) + (level0 level :inline) + (level1 level :inline) + (level-default level :inline) + (level level 3 :inline :overlay-at level0) + (data level 3 :inline :overlay-at level0) + (pad uint32) ) - :method-count-assert 27 - :size-assert #x1ef4 - :flag-assert #x1b00001ef4 (:methods - (level-get (_type_ symbol) level 9) - (level-get-with-status (_type_ symbol) level 10) - (level-get-for-use (_type_ symbol symbol) level 11) - (activate-levels! (_type_) int 12) - (debug-print-entities (_type_ symbol type) none 13) - (debug-draw-actors (_type_ symbol) none 14) - (actors-update (_type_) object 15) - (level-update (_type_) int 16) - (level-get-target-inside (_type_) level 17) - (alloc-levels! (_type_ symbol) int 18) - (load-commands-set! (_type_ pair) pair 19) - (art-group-get-by-name (_type_ string) art-group 20) - (load-command-get-index (_type_ symbol int) pair 21) - (update-vis-volumes (_type_) none 22) - (update-vis-volumes-from-nav-mesh (_type_) none 23) - (print-volume-sizes (_type_) none 24) - (level-status (_type_ symbol) symbol 25) - (level-get-most-disposable (_type_) level 26) + (level-get (_type_ symbol) level) + (level-get-with-status (_type_ symbol) level) + (level-get-for-use (_type_ symbol symbol) level) + (activate-levels! (_type_) int) + (debug-print-entities (_type_ symbol type) none) + (debug-draw-actors (_type_ symbol) none) + (actors-update (_type_) object) + (level-update (_type_) int) + (level-get-target-inside (_type_) level) + (alloc-levels! (_type_ symbol) int) + (load-commands-set! (_type_ pair) pair) + (art-group-get-by-name (_type_ string) art-group) + (load-command-get-index (_type_ symbol int) pair) + (update-vis-volumes (_type_) none) + (update-vis-volumes-from-nav-mesh (_type_) none) + (print-volume-sizes (_type_) none) + (level-status (_type_ symbol) symbol) + (level-get-most-disposable (_type_) level) ) ) @@ -294,162 +257,140 @@ (if (zero? *level*) (set! *level* (new 'static 'level-group - :length 2 - :log-in-level-bsp #f - :loading-level #f - :entity-link #f - :border? #f - :want-level #f - :load-commands '() - :play? #f - :level0 - (new 'static 'level - :name #f - :status 'inactive - :tfrag-tex-foreground-sink-group - (new 'static 'dma-foreground-sink-group - :sink - (new 'static 'array dma-foreground-sink 3 - ;; merc + tfrag texture - (new 'static 'dma-foreground-sink :bucket (bucket-id merc-tfrag-tex0)) - ;; generic + tfrag texture - (new 'static 'generic-dma-foreground-sink :bucket (bucket-id generic-tfrag-tex0) :foreground-output-bucket 1) - ) - ) - :pris-tex-foreground-sink-group - (new 'static 'dma-foreground-sink-group - :sink - (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink :bucket (bucket-id merc-pris0) :foreground-texture-page 1) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id generic-pris0) - :foreground-texture-page 1 - :foreground-output-bucket 1 - ) - ) - ) - :water-tex-foreground-sink-group - (new 'static 'dma-foreground-sink-group - :sink - (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink :bucket (bucket-id merc-water0) :foreground-texture-page 2) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id generic-water0) - :foreground-texture-page 2 - :foreground-output-bucket 1 - ) - ) - ) - :inside-sphere? #f - :inside-boxes? #f - :force-inside? #f + :length 2 + :log-in-level-bsp #f + :loading-level #f + :entity-link #f + :border? #f + :want-level #f + :load-commands '() + :play? #f + :level0 (new 'static 'level + :name #f + :status 'inactive + :tfrag-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group + :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-tfrag-tex0)) + (new 'static 'generic-dma-foreground-sink :bucket (bucket-id generic-tfrag-tex0) :foreground-output-bucket 1) + ) + ) + :pris-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group + :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-pris0) :foreground-texture-page 1) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-pris0) + :foreground-texture-page 1 + :foreground-output-bucket 1 + ) + ) + ) + :water-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group + :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-water0) :foreground-texture-page 2) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-water0) + :foreground-texture-page 2 + :foreground-output-bucket 1 ) - :level1 - (new 'static 'level - :name #f - :index 1 - :status 'inactive - :tfrag-tex-foreground-sink-group - (new 'static 'dma-foreground-sink-group - :sink - (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink :bucket (bucket-id merc-tfrag-tex1) :foreground-texture-level 1) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id generic-tfrag-tex1) - :foreground-texture-level 1 - :foreground-output-bucket 1 - ) - ) - ) - :pris-tex-foreground-sink-group - (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket (bucket-id merc-pris1) - :foreground-texture-page 1 - :foreground-texture-level 1 - ) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id generic-pris1) - :foreground-texture-page 1 - :foreground-texture-level 1 - :foreground-output-bucket 1 - ) - ) - ) - :water-tex-foreground-sink-group - (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket (bucket-id merc-water1) - :foreground-texture-page 2 - :foreground-texture-level 1 - ) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id generic-water1) - :foreground-texture-page 2 - :foreground-texture-level 1 - :foreground-output-bucket 1 - ) - ) - ) - :inside-sphere? #f - :inside-boxes? #f - :force-inside? #f + ) + ) + :inside-sphere? #f + :inside-boxes? #f + :force-inside? #f + ) + :level1 (new 'static 'level + :name #f + :index 1 + :status 'inactive + :tfrag-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group + :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-tfrag-tex1) :foreground-texture-level 1) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-tfrag-tex1) + :foreground-texture-level 1 + :foreground-output-bucket 1 ) - :level-default - (new 'static 'level - :name 'default - :index 2 - :status 'reserved - :tfrag-tex-foreground-sink-group - ;; the tfrag texture sink group for the common level uses alpha - (new 'static 'dma-foreground-sink-group - :sink - (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink :bucket (bucket-id merc-alpha-tex) :foreground-texture-level 2) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id generic-alpha-tex) - :foreground-texture-level 2 - :foreground-output-bucket 1 - ) - ) - ) - :pris-tex-foreground-sink-group - ;; pris uses the separate pris common area - (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket (bucket-id merc-pris-common) - :foreground-texture-page 1 - :foreground-texture-level 2 - ) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id generic-pris-common) - :foreground-texture-page 1 - :foreground-texture-level 2 - :foreground-output-bucket 1 - ) - ) - ) - :water-tex-foreground-sink-group - ;; water just goes to level 0's buckets - (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 - (new 'static 'dma-foreground-sink - :bucket (bucket-id merc-water0) - :foreground-texture-page 2 - :foreground-texture-level 2 - ) - (new 'static 'generic-dma-foreground-sink - :bucket (bucket-id generic-water0) - :foreground-texture-page 2 - :foreground-texture-level 2 - :foreground-output-bucket 1 - ) - ) - ) - :inside-sphere? #f - :inside-boxes? #f - :force-inside? #f + ) + ) + :pris-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink + :bucket (bucket-id merc-pris1) + :foreground-texture-page 1 + :foreground-texture-level 1 + ) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-pris1) + :foreground-texture-page 1 + :foreground-texture-level 1 + :foreground-output-bucket 1 + ) + ) + ) + :water-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink + :bucket (bucket-id merc-water1) + :foreground-texture-page 2 + :foreground-texture-level 1 + ) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-water1) + :foreground-texture-page 2 + :foreground-texture-level 1 + :foreground-output-bucket 1 + ) + ) + ) + :inside-sphere? #f + :inside-boxes? #f + :force-inside? #f + ) + :level-default (new 'static 'level + :name 'default + :index 2 + :status 'reserved + :tfrag-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group + :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink :bucket (bucket-id merc-alpha-tex) :foreground-texture-level 2) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-alpha-tex) + :foreground-texture-level 2 + :foreground-output-bucket 1 ) - ) + ) + ) + :pris-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink + :bucket (bucket-id merc-pris-common) + :foreground-texture-page 1 + :foreground-texture-level 2 + ) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-pris-common) + :foreground-texture-page 1 + :foreground-texture-level 2 + :foreground-output-bucket 1 + ) + ) + ) + :water-tex-foreground-sink-group (new 'static 'dma-foreground-sink-group :sink (new 'static 'array dma-foreground-sink 3 + (new 'static 'dma-foreground-sink + :bucket (bucket-id merc-water0) + :foreground-texture-page 2 + :foreground-texture-level 2 + ) + (new 'static 'generic-dma-foreground-sink + :bucket (bucket-id generic-water0) + :foreground-texture-page 2 + :foreground-texture-level 2 + :foreground-output-bucket 1 + ) + ) + ) + :inside-sphere? #f + :inside-boxes? #f + :force-inside? #f + ) + ) ) ) @@ -457,4 +398,4 @@ (define-extern *level-load-list* pair) -(define-extern lookup-level-info (function symbol level-load-info)) \ No newline at end of file +(define-extern lookup-level-info (function symbol level-load-info)) diff --git a/goal_src/jak1/engine/level/level.gc b/goal_src/jak1/engine/level/level.gc index 8cf53899165..50b0a104939 100644 --- a/goal_src/jak1/engine/level/level.gc +++ b/goal_src/jak1/engine/level/level.gc @@ -34,7 +34,7 @@ ) -(defmethod load-command-get-index level-group ((this level-group) (name symbol) (cmd-idx int)) +(defmethod load-command-get-index ((this level-group) (name symbol) (cmd-idx int)) "Get the n-th load command for the given level." (let ((cmd-lst (-> (lookup-level-info name) alt-load-commands))) (while (nonzero? cmd-idx) @@ -57,7 +57,7 @@ ) ) -(defmethod art-group-get-by-name level ((this level) (arg0 string)) +(defmethod art-group-get-by-name ((this level) (arg0 string)) "Get the art group in the given level with the given name. If it doesn't exist, #f." (countdown (i (-> this art-group art-group-array length)) @@ -68,7 +68,7 @@ (the-as art-group #f) ) -(defmethod bsp-name level ((this level)) +(defmethod bsp-name ((this level)) "Get the name of the bsp tree of the level" (if (and (!= (-> this status) 'inactive) @@ -103,7 +103,7 @@ ) -(defmethod print level ((this level)) +(defmethod print ((this level)) "print a level." (format #t "#<~A ~A ~S @ #x~X>" @@ -115,7 +115,7 @@ this ) -(defmethod relocate bsp-header ((this bsp-header) (dest-heap kheap) (name (pointer uint8))) +(defmethod relocate ((this bsp-header) (dest-heap kheap) (name (pointer uint8))) "Handle a bsp file load." ;; we expect that we'll have a loading-level set when we link/login a bsp-header @@ -159,7 +159,7 @@ (none) ) -(defmethod load-required-packages level ((this level)) +(defmethod load-required-packages ((this level)) "Load required packages for the level. This is mostly useless, but might load common. This will have no effect most of the time - common is often loaded at boot as part of game.cgo." @@ -175,7 +175,7 @@ ;; vis ;;;;;;;;;;;;;; -(defmethod vis-clear level ((this level)) +(defmethod vis-clear ((this level)) "Clear the visibility info for when the level is loading." ;; clear vis-infos, so we can't try to look up a vis string. @@ -193,7 +193,7 @@ ) -(defmethod vis-load level ((this level)) +(defmethod vis-load ((this level)) "Start the initial load of a VIS file to the IOP VIS buffer. After this is done, we can use ramdisk-load to load chunks." @@ -245,7 +245,7 @@ 0 ) -(defmethod init-vis level ((this level)) +(defmethod init-vis ((this level)) "Set up the vis info in a level from the vis info in the BSP." (when (not (or (= (-> this status) 'inactive) (not (-> this bsp)))) @@ -306,7 +306,7 @@ 0 ) -(defmethod level-get-for-use level-group ((this level-group) (name symbol) (want-status symbol)) +(defmethod level-get-for-use ((this level-group) (name symbol) (want-status symbol)) "Get a level in a playable form, loading it if necessary." (local-vars (s5-1 level)) @@ -361,7 +361,7 @@ ;; - alive: level is birthed, etc ;; - active: level is being drawn -(defmethod level-status level-group ((this level-group) (level-name symbol)) +(defmethod level-status ((this level-group) (level-name symbol)) "Get the status of an existing level." (let ((lev (level-get *level* level-name))) @@ -371,7 +371,7 @@ ) ) -(defmethod level-status-set! level ((this level) (want-status symbol)) +(defmethod level-status-set! ((this level) (want-status symbol)) "Change the status of a level, performing any cleanup and prep work as necessary. Only change loading statuses in order! Returns the level." @@ -449,7 +449,7 @@ (define *login-state* (new 'global 'login-state)) (define *print-login* #t) -(defmethod load-continue level ((this level)) +(defmethod load-continue ((this level)) "Continue loading a level from where we left off last time." ;; see if we are still linking some file @@ -536,7 +536,7 @@ this ) -(defmethod load-begin level ((this level)) +(defmethod load-begin ((this level)) "Start loading the level. Uses 2 megabyte heaps for loading each object." ;; set the level heap. level code logins called from linker may allocate here @@ -586,7 +586,7 @@ this ) -(defmethod login-begin level ((this level)) +(defmethod login-begin ((this level)) "Start the login. This is spread over multiple frames." ;; done with load, reset the texture page allocator @@ -874,7 +874,7 @@ loaded-level ) -(defmethod birth level ((this level)) +(defmethod birth ((this level)) "Birth a level to make it alive! It must be loaded." (case (-> this status) @@ -900,7 +900,7 @@ this ) -(defmethod deactivate level ((this level)) +(defmethod deactivate ((this level)) "Kill the level. This won't remove it from memory." (case (-> this status) @@ -954,7 +954,7 @@ this ) -(defmethod unload! level ((this level)) +(defmethod unload! ((this level)) "Unloads the level. This does not free the heap. The level will be made inactive and ready to be loaded some other time." (deactivate this) @@ -1053,7 +1053,7 @@ ;; method 27 level ;; method 10 level -(defmethod is-object-visible? level ((this level) (arg0 int)) +(defmethod is-object-visible? ((this level) (arg0 int)) "Is arg0 visible? Note that this will return #f if the visibility data is not loaded." ;; og:preserve-this pc port added option to show every actor regardless @@ -1082,7 +1082,7 @@ ) ) -(defmethod point-in-boxes? level ((this level) (arg0 vector)) +(defmethod point-in-boxes? ((this level) (arg0 vector)) "Is this point in the list of level boxes?" (cond ((or (not (-> this bsp)) (zero? (-> this bsp boxes))) @@ -1115,7 +1115,7 @@ ) -(defmethod debug-print-splitbox level ((this level) (arg0 vector) (arg1 string)) +(defmethod debug-print-splitbox ((this level) (arg0 vector) (arg1 string)) "Print the current splitbox, if we're in one." (cond ((or (not (-> this bsp)) (zero? (-> this bsp boxes)) (zero? (-> this bsp split-box-indices))) @@ -1147,7 +1147,7 @@ ) -(defmethod mem-usage level ((this level) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this level) (arg0 memory-usage-block) (arg1 int)) "Get the memory usage for a level." (when (= (-> this status) 'active) @@ -1244,7 +1244,7 @@ ) ) -(defmethod alloc-levels! level-group ((this level-group) (compact-level-heaps symbol)) +(defmethod alloc-levels! ((this level-group) (compact-level-heaps symbol)) "Allocate the level heaps and load the common packages for levels." ;; only do stuff if levels are not allocated @@ -1276,7 +1276,7 @@ ) -(defmethod level-get-with-status level-group ((this level-group) (status symbol)) +(defmethod level-get-with-status ((this level-group) (status symbol)) (dotimes (i (-> this length)) (if (= (-> this level i status) status) (return (-> this level i)) @@ -1285,7 +1285,7 @@ (the-as level #f) ) -(defmethod level-get-most-disposable level-group ((this level-group)) +(defmethod level-get-most-disposable ((this level-group)) "Get a level that's least likely to be in use right now. #f = all levels in use." ;; check inactive levels first @@ -1334,7 +1334,7 @@ ) ) -(defmethod level-get level-group ((this level-group) (name symbol)) +(defmethod level-get ((this level-group) (name symbol)) "Return the level data using its name, if it is available. Returns #f if none are found." (dotimes (lev (-> this length)) @@ -1349,7 +1349,7 @@ (the level #f) ) -(defmethod art-group-get-by-name level-group ((this level-group) (arg0 string)) +(defmethod art-group-get-by-name ((this level-group) (arg0 string)) (countdown (i 3) (let ((lev (-> this level i))) (countdown (ii (-> lev art-group art-group-array length)) @@ -1363,7 +1363,7 @@ ) -(defmethod activate-levels! level-group ((this level-group)) +(defmethod activate-levels! ((this level-group)) "Try to activate all levels." (dotimes (i (-> this length)) @@ -1372,7 +1372,7 @@ 0 ) -(defmethod level-get-target-inside level-group ((this level-group)) +(defmethod level-get-target-inside ((this level-group)) "Get the level target is in, or one it is close to. The distance checks do not work." @@ -1416,12 +1416,12 @@ ) ) -(defmethod load-commands-set! level-group ((this level-group) (load-commands pair)) +(defmethod load-commands-set! ((this level-group) (load-commands pair)) (set! (-> this load-commands) load-commands) load-commands ) -(defmethod mem-usage level-group ((this level-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this level-group) (arg0 memory-usage-block) (arg1 int)) "Get the memory usage data for a level-group" ;; get memory usage of each level @@ -1666,7 +1666,7 @@ 0 ) -(defmethod update! load-state ((this load-state)) +(defmethod update! ((this load-state)) "Updates load requests." (update-sound-banks) @@ -1866,7 +1866,7 @@ ;; method 16 level-group (debug text stuff) -(defmethod level-update level-group ((this level-group)) +(defmethod level-update ((this level-group)) ;; this does nothing... (camera-pos) diff --git a/goal_src/jak1/engine/level/load-boundary-h.gc b/goal_src/jak1/engine/level/load-boundary-h.gc index 5525eddd8a3..3d8fa52df6c 100644 --- a/goal_src/jak1/engine/level/load-boundary-h.gc +++ b/goal_src/jak1/engine/level/load-boundary-h.gc @@ -17,19 +17,16 @@ ;; the vertex type used for load boundaries (deftype lbvtx (structure) - ((x float :offset-assert 0) - (y float :offset-assert 4) - (z float :offset-assert 8) - (v0 uint8 :offset-assert 12) - (v1 uint8 :offset-assert 13) - (v2 uint8 :offset-assert 14) - (ix uint8 :offset-assert 15) - (quad uint128 :offset 0) - (v vector :inline :offset 0) + ((x float) + (y float) + (z float) + (v0 uint8) + (v1 uint8) + (v2 uint8) + (ix uint8) + (quad uint128 :overlay-at x) + (v vector :inline :overlay-at x) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; the types of commands in load boundaries @@ -47,22 +44,19 @@ ;; command to execute when crossing. ;; there are 3 1-byte paramaters and 2 4-byte parameters. (deftype load-boundary-crossing-command (structure) - ((cmd load-boundary-cmd :offset-assert 0) - (bparm uint8 3 :offset-assert 1) - (parm uint32 2 :offset-assert 4) - (lev0 basic :offset 4) - (lev1 basic :offset 8) - (displev basic :offset 4) - (dispcmd basic :offset 8) - (nick basic :offset 4) - (forcelev basic :offset 4) - (forceonoff basic :offset 8) - (checkname basic :offset 4) + ((cmd load-boundary-cmd) + (bparm uint8 3) + (parm uint32 2) + (lev0 basic :overlay-at (-> parm 0)) + (lev1 basic :overlay-at (-> parm 1)) + (displev basic :overlay-at (-> parm 0)) + (dispcmd basic :overlay-at (-> parm 1)) + (nick basic :overlay-at (-> parm 0)) + (forcelev basic :overlay-at (-> parm 0)) + (forceonoff basic :overlay-at (-> parm 1)) + (checkname basic :overlay-at (-> parm 0)) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (defenum load-boundary-flags @@ -75,23 +69,20 @@ ;; actual boundary ;; vertices come after this in memory (deftype load-boundary (basic) - ((num-points uint16 :offset-assert 4) - (flags load-boundary-flags :offset-assert 6) - (top-plane float :offset-assert 8) - (bot-plane float :offset-assert 12) - (tri-cnt int32 :offset-assert 16) - (next load-boundary :offset-assert 20) - (cmd-fwd load-boundary-crossing-command :inline :offset-assert 24) - (cmd-bwd load-boundary-crossing-command :inline :offset-assert 36) - (rejector vector :inline :offset-assert 48) - (data lbvtx 1 :inline :offset-assert 64) - (data2 lbvtx :inline :dynamic :offset 64) + ((num-points uint16) + (flags load-boundary-flags) + (top-plane float) + (bot-plane float) + (tri-cnt int32) + (next load-boundary) + (cmd-fwd load-boundary-crossing-command :inline) + (cmd-bwd load-boundary-crossing-command :inline) + (rejector vector :inline) + (data lbvtx 1 :inline) + (data2 lbvtx :inline :dynamic :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 (:methods - (new (symbol type int symbol symbol) _type_ 0) + (new (symbol type int symbol symbol) _type_) ) ) diff --git a/goal_src/jak1/engine/level/load-boundary.gc b/goal_src/jak1/engine/level/load-boundary.gc index 5e4b1963c99..b0c8017ad12 100644 --- a/goal_src/jak1/engine/level/load-boundary.gc +++ b/goal_src/jak1/engine/level/load-boundary.gc @@ -9,14 +9,11 @@ ;; the editor state (deftype lb-editor-parms (basic) - ((boundary load-boundary :offset-assert 4) - (vertex int32 :offset-assert 8) - (x-origin float :offset-assert 12) - (z-origin float :offset-assert 16) + ((boundary load-boundary) + (vertex int32) + (x-origin float) + (z-origin float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (define *lb-editor-parms* (new 'global 'lb-editor-parms)) @@ -86,29 +83,24 @@ (let* ((v1-0 arg1) (a1-1 (the-as object (-> v1-0 base))) ) - (set! - (-> (the-as gs-gif-tag a1-1) tag) - (new 'static 'gif-tag64 :nloop #x1 :nreg #x5) - ) - (set! - (-> (the-as gs-gif-tag a1-1) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a1-1) tag) (new 'static 'gif-tag64 :nloop #x1 :nreg #x5)) + (set! (-> (the-as gs-gif-tag a1-1) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + ) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) ) - (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) - ) (let ((s5-0 (the-as adgif-shader (-> arg1 base)))) - (adgif-shader<-texture-simple! s5-0 (lookup-texture-by-id arg0)) - (set! (-> s5-0 alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) - (set! (-> s5-0 tex0 tfx) 0) - (set! (-> s5-0 tex1 mmag) 0) - (set! (-> s5-0 clamp) (new 'static 'gs-clamp)) - ) + (adgif-shader<-texture-simple! s5-0 (lookup-texture-by-id arg0)) + (set! (-> s5-0 alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> s5-0 tex0 tfx) 0) + (set! (-> s5-0 tex1 mmag) 0) + (set! (-> s5-0 clamp) (new 'static 'gs-clamp)) + ) 0 (&+! (-> arg1 base) 80) (none) @@ -123,257 +115,256 @@ ;; the polygon curently rendering. (define *boundary-polygon* (new 'static 'inline-array lbvtx 12 - (new 'static 'lbvtx) - (new 'static 'lbvtx) - (new 'static 'lbvtx) - (new 'static 'lbvtx) - (new 'static 'lbvtx) - (new 'static 'lbvtx) - (new 'static 'lbvtx) - (new 'static 'lbvtx) - (new 'static 'lbvtx) - (new 'static 'lbvtx) - (new 'static 'lbvtx) - (new 'static 'lbvtx) - ) + (new 'static 'lbvtx) + (new 'static 'lbvtx) + (new 'static 'lbvtx) + (new 'static 'lbvtx) + (new 'static 'lbvtx) + (new 'static 'lbvtx) + (new 'static 'lbvtx) + (new 'static 'lbvtx) + (new 'static 'lbvtx) + (new 'static 'lbvtx) + (new 'static 'lbvtx) + (new 'static 'lbvtx) + ) ) - (defun-debug draw-boundary-side ((arg0 load-boundary) (arg1 integer) (arg2 integer) (arg3 dma-buffer) (arg4 symbol)) (rlet ((vf27 :class vf)) - (let ((v1-2 (-> arg0 data arg1))) - (let ((a1-3 (-> arg0 data arg2))) - (let ((a2-2 (-> *boundary-polygon* 0))) - (set! (-> a2-2 x) (-> v1-2 x)) - (set! (-> a2-2 y) (-> arg0 bot-plane)) - (set! (-> a2-2 z) (-> v1-2 z)) - (set! (-> a2-2 v w) 1.0) - ) - (let ((a2-4 (-> *boundary-polygon* 3))) - (set! (-> a2-4 x) (-> a1-3 x)) - (set! (-> a2-4 y) (-> arg0 bot-plane)) - (set! (-> a2-4 z) (-> a1-3 z)) - (set! (-> a2-4 v w) 1.0) - ) - (let ((a2-6 (-> *boundary-polygon* 6))) - (set! (-> a2-6 x) (-> a1-3 x)) - (set! (-> a2-6 y) (-> arg0 top-plane)) - (set! (-> a2-6 z) (-> a1-3 z)) - (set! (-> a2-6 v w) 1.0) - ) - ) - (let ((a1-5 (-> *boundary-polygon* 9))) - (set! (-> a1-5 x) (-> v1-2 x)) - (set! (-> a1-5 y) (-> arg0 top-plane)) - (set! (-> a1-5 z) (-> v1-2 z)) - (set! (-> a1-5 v w) 1.0) - ) - ) - (cond - (arg4 - (let ((v1-4 (-> *boundary-polygon* 1))) - (set! (-> v1-4 x) 0.0) - (set! (-> v1-4 y) 0.0) - (set! (-> v1-4 z) 1.0) - (set! (-> v1-4 v w) 1.0) - ) - (let ((v1-6 (-> *boundary-polygon* 4))) - (set! (-> v1-6 x) 1.0) - (set! (-> v1-6 y) 0.0) - (set! (-> v1-6 z) 1.0) - (set! (-> v1-6 v w) 1.0) - ) - (let ((v1-8 (-> *boundary-polygon* 7))) - (set! (-> v1-8 x) 1.0) - (set! (-> v1-8 y) 8.0) - (set! (-> v1-8 z) 1.0) - (set! (-> v1-8 v w) 1.0) - ) - (let ((v1-10 (-> *boundary-polygon* 10))) - (set! (-> v1-10 x) 0.0) - (set! (-> v1-10 y) 8.0) - (set! (-> v1-10 z) 1.0) - (set! (-> v1-10 v w) 1.0) - ) - ) - (else - (let ((v1-12 (-> *boundary-polygon* 1))) - (set! (-> v1-12 x) 1.0) - (set! (-> v1-12 y) 0.0) - (set! (-> v1-12 z) 1.0) - (set! (-> v1-12 v w) 1.0) - ) - (let ((v1-14 (-> *boundary-polygon* 4))) - (set! (-> v1-14 x) 0.0) - (set! (-> v1-14 y) 0.0) - (set! (-> v1-14 z) 1.0) - (set! (-> v1-14 v w) 1.0) - ) - (let ((v1-16 (-> *boundary-polygon* 7))) - (set! (-> v1-16 x) 0.0) - (set! (-> v1-16 y) 8.0) - (set! (-> v1-16 z) 1.0) - (set! (-> v1-16 v w) 1.0) + (let ((v1-2 (-> arg0 data arg1))) + (let ((a1-3 (-> arg0 data arg2))) + (let ((a2-2 (-> *boundary-polygon* 0))) + (set! (-> a2-2 x) (-> v1-2 x)) + (set! (-> a2-2 y) (-> arg0 bot-plane)) + (set! (-> a2-2 z) (-> v1-2 z)) + (set! (-> a2-2 v w) 1.0) + ) + (let ((a2-4 (-> *boundary-polygon* 3))) + (set! (-> a2-4 x) (-> a1-3 x)) + (set! (-> a2-4 y) (-> arg0 bot-plane)) + (set! (-> a2-4 z) (-> a1-3 z)) + (set! (-> a2-4 v w) 1.0) + ) + (let ((a2-6 (-> *boundary-polygon* 6))) + (set! (-> a2-6 x) (-> a1-3 x)) + (set! (-> a2-6 y) (-> arg0 top-plane)) + (set! (-> a2-6 z) (-> a1-3 z)) + (set! (-> a2-6 v w) 1.0) + ) + ) + (let ((a1-5 (-> *boundary-polygon* 9))) + (set! (-> a1-5 x) (-> v1-2 x)) + (set! (-> a1-5 y) (-> arg0 top-plane)) + (set! (-> a1-5 z) (-> v1-2 z)) + (set! (-> a1-5 v w) 1.0) + ) ) - (let ((v1-18 (-> *boundary-polygon* 10))) - (set! (-> v1-18 x) 1.0) - (set! (-> v1-18 y) 8.0) - (set! (-> v1-18 z) 1.0) - (set! (-> v1-18 v w) 1.0) + (cond + (arg4 + (let ((v1-4 (-> *boundary-polygon* 1))) + (set! (-> v1-4 x) 0.0) + (set! (-> v1-4 y) 0.0) + (set! (-> v1-4 z) 1.0) + (set! (-> v1-4 v w) 1.0) + ) + (let ((v1-6 (-> *boundary-polygon* 4))) + (set! (-> v1-6 x) 1.0) + (set! (-> v1-6 y) 0.0) + (set! (-> v1-6 z) 1.0) + (set! (-> v1-6 v w) 1.0) + ) + (let ((v1-8 (-> *boundary-polygon* 7))) + (set! (-> v1-8 x) 1.0) + (set! (-> v1-8 y) 8.0) + (set! (-> v1-8 z) 1.0) + (set! (-> v1-8 v w) 1.0) + ) + (let ((v1-10 (-> *boundary-polygon* 10))) + (set! (-> v1-10 x) 0.0) + (set! (-> v1-10 y) 8.0) + (set! (-> v1-10 z) 1.0) + (set! (-> v1-10 v w) 1.0) + ) + ) + (else + (let ((v1-12 (-> *boundary-polygon* 1))) + (set! (-> v1-12 x) 1.0) + (set! (-> v1-12 y) 0.0) + (set! (-> v1-12 z) 1.0) + (set! (-> v1-12 v w) 1.0) + ) + (let ((v1-14 (-> *boundary-polygon* 4))) + (set! (-> v1-14 x) 0.0) + (set! (-> v1-14 y) 0.0) + (set! (-> v1-14 z) 1.0) + (set! (-> v1-14 v w) 1.0) + ) + (let ((v1-16 (-> *boundary-polygon* 7))) + (set! (-> v1-16 x) 0.0) + (set! (-> v1-16 y) 8.0) + (set! (-> v1-16 z) 1.0) + (set! (-> v1-16 v w) 1.0) + ) + (let ((v1-18 (-> *boundary-polygon* 10))) + (set! (-> v1-18 x) 1.0) + (set! (-> v1-18 y) 8.0) + (set! (-> v1-18 z) 1.0) + (set! (-> v1-18 v w) 1.0) + ) + ) ) - ) + (init-boundary-regs) + ;;(.lvf vf27 (&-> *sky-tng-data* giftag-roof qword)) + (set-sky-vf27 (&-> *sky-tng-data* giftag-roof qword)) + (render-boundary-quad (-> *boundary-polygon* 0) arg3) + 0 + (none) ) - (init-boundary-regs) - ;;(.lvf vf27 (&-> *sky-tng-data* giftag-roof qword)) - (set-sky-vf27 (&-> *sky-tng-data* giftag-roof qword)) - (render-boundary-quad (-> *boundary-polygon* 0) arg3) - 0 - (none) - ) ) (defun-debug draw-boundary-cap ((arg0 load-boundary) (arg1 float) (arg2 dma-buffer) (arg3 symbol)) (rlet ((vf27 :class vf)) - (dotimes (s2-0 (-> arg0 tri-cnt)) - (let ((a1-1 (-> arg0 data (-> arg0 data s2-0 v0))) - (a0-1 (-> arg0 data (-> arg0 data s2-0 v1))) - (v1-15 (-> arg0 data (-> arg0 data s2-0 v2))) + (dotimes (s2-0 (-> arg0 tri-cnt)) + (let ((a1-1 (-> arg0 data (-> arg0 data s2-0 v0))) + (a0-1 (-> arg0 data (-> arg0 data s2-0 v1))) + (v1-15 (-> arg0 data (-> arg0 data s2-0 v2))) + ) + (let ((a2-2 (-> *boundary-polygon* 0))) + (set! (-> a2-2 x) (-> a1-1 x)) + (set! (-> a2-2 y) arg1) + (set! (-> a2-2 z) (-> a1-1 z)) + (set! (-> a2-2 v w) 1.0) ) - (let ((a2-2 (-> *boundary-polygon* 0))) - (set! (-> a2-2 x) (-> a1-1 x)) - (set! (-> a2-2 y) arg1) - (set! (-> a2-2 z) (-> a1-1 z)) - (set! (-> a2-2 v w) 1.0) - ) - (let ((a1-3 (-> *boundary-polygon* 3))) - (set! (-> a1-3 x) (-> a0-1 x)) - (set! (-> a1-3 y) arg1) - (set! (-> a1-3 z) (-> a0-1 z)) - (set! (-> a1-3 v w) 1.0) - ) - (let ((a0-3 (-> *boundary-polygon* 6))) - (set! (-> a0-3 x) (-> v1-15 x)) - (set! (-> a0-3 y) arg1) - (set! (-> a0-3 z) (-> v1-15 z)) - (set! (-> a0-3 v w) 1.0) - ) - ) - (cond - (arg3 - (let ((v1-17 (-> *boundary-polygon* 1))) - (set! (-> v1-17 x) 0.0) - (set! (-> v1-17 y) 0.0) - (set! (-> v1-17 z) 1.0) - (set! (-> v1-17 v w) 1.0) - ) - (let ((v1-19 (-> *boundary-polygon* 4))) - (set! (-> v1-19 x) 0.0) - (set! (-> v1-19 y) 1.0) - (set! (-> v1-19 z) 1.0) - (set! (-> v1-19 v w) 1.0) - ) - (let ((v1-21 (-> *boundary-polygon* 7))) - (set! (-> v1-21 x) 1.0) - (set! (-> v1-21 y) 0.0) - (set! (-> v1-21 z) 1.0) - (set! (-> v1-21 v w) 1.0) - ) - ) - (else - (let ((v1-23 (-> *boundary-polygon* 1))) - (set! (-> v1-23 x) 1.0) - (set! (-> v1-23 y) 0.0) - (set! (-> v1-23 z) 1.0) - (set! (-> v1-23 v w) 1.0) - ) - (let ((v1-25 (-> *boundary-polygon* 4))) - (set! (-> v1-25 x) 1.0) - (set! (-> v1-25 y) 1.0) - (set! (-> v1-25 z) 1.0) - (set! (-> v1-25 v w) 1.0) - ) - (let ((v1-27 (-> *boundary-polygon* 7))) - (set! (-> v1-27 x) 0.0) - (set! (-> v1-27 y) 0.0) - (set! (-> v1-27 z) 1.0) - (set! (-> v1-27 v w) 1.0) - ) + (let ((a1-3 (-> *boundary-polygon* 3))) + (set! (-> a1-3 x) (-> a0-1 x)) + (set! (-> a1-3 y) arg1) + (set! (-> a1-3 z) (-> a0-1 z)) + (set! (-> a1-3 v w) 1.0) + ) + (let ((a0-3 (-> *boundary-polygon* 6))) + (set! (-> a0-3 x) (-> v1-15 x)) + (set! (-> a0-3 y) arg1) + (set! (-> a0-3 z) (-> v1-15 z)) + (set! (-> a0-3 v w) 1.0) + ) + ) + (cond + (arg3 + (let ((v1-17 (-> *boundary-polygon* 1))) + (set! (-> v1-17 x) 0.0) + (set! (-> v1-17 y) 0.0) + (set! (-> v1-17 z) 1.0) + (set! (-> v1-17 v w) 1.0) + ) + (let ((v1-19 (-> *boundary-polygon* 4))) + (set! (-> v1-19 x) 0.0) + (set! (-> v1-19 y) 1.0) + (set! (-> v1-19 z) 1.0) + (set! (-> v1-19 v w) 1.0) + ) + (let ((v1-21 (-> *boundary-polygon* 7))) + (set! (-> v1-21 x) 1.0) + (set! (-> v1-21 y) 0.0) + (set! (-> v1-21 z) 1.0) + (set! (-> v1-21 v w) 1.0) + ) + ) + (else + (let ((v1-23 (-> *boundary-polygon* 1))) + (set! (-> v1-23 x) 1.0) + (set! (-> v1-23 y) 0.0) + (set! (-> v1-23 z) 1.0) + (set! (-> v1-23 v w) 1.0) + ) + (let ((v1-25 (-> *boundary-polygon* 4))) + (set! (-> v1-25 x) 1.0) + (set! (-> v1-25 y) 1.0) + (set! (-> v1-25 z) 1.0) + (set! (-> v1-25 v w) 1.0) + ) + (let ((v1-27 (-> *boundary-polygon* 7))) + (set! (-> v1-27 x) 0.0) + (set! (-> v1-27 y) 0.0) + (set! (-> v1-27 z) 1.0) + (set! (-> v1-27 v w) 1.0) + ) + ) + ) + (init-boundary-regs) + ;;(.lvf vf27 (&-> *sky-tng-data* giftag-roof qword)) + (set-sky-vf27 (&-> *sky-tng-data* giftag-roof qword)) + (render-boundary-tri (-> *boundary-polygon* 0) arg2) ) - ) - (init-boundary-regs) - ;;(.lvf vf27 (&-> *sky-tng-data* giftag-roof qword)) - (set-sky-vf27 (&-> *sky-tng-data* giftag-roof qword)) - (render-boundary-tri (-> *boundary-polygon* 0) arg2) + 0 + (none) ) - 0 - (none) - ) ) (defun-debug boundary-set-color ((arg0 lbvtx) (arg1 load-boundary-crossing-command)) "Set the color based on the color." (case (-> arg1 cmd) - (((load-boundary-cmd load)) - (let ((v1-1 arg0)) - (set! (-> v1-1 x) 128.0) - (set! (-> v1-1 y) 128.0) - (set! (-> v1-1 z) 128.0) - (set! (-> v1-1 v w) 128.0) - ) - ) - (((load-boundary-cmd cmd2)) - (let ((v1-2 arg0)) - (set! (-> v1-2 x) 0.0) - (set! (-> v1-2 y) 0.0) - (set! (-> v1-2 z) 0.0) - (set! (-> v1-2 v w) 128.0) - ) - ) - (((load-boundary-cmd display)) - (cond - ((-> arg1 lev1) - (let ((v1-4 arg0)) - (set! (-> v1-4 x) 128.0) - (set! (-> v1-4 y) 128.0) - (set! (-> v1-4 z) 0.0) - (set! (-> v1-4 v w) 128.0) - ) - ) - (else - (let ((v1-5 arg0)) - (set! (-> v1-5 x) 64.0) - (set! (-> v1-5 y) 64.0) - (set! (-> v1-5 z) 0.0) - (set! (-> v1-5 v w) 128.0) - ) - ) - ) - ) - (((load-boundary-cmd vis)) - (let ((v1-6 arg0)) - (set! (-> v1-6 x) 128.0) - (set! (-> v1-6 y) 0.0) - (set! (-> v1-6 z) 0.0) - (set! (-> v1-6 v w) 128.0) - ) - ) - (((load-boundary-cmd checkpt)) - (let ((v1-7 arg0)) - (set! (-> v1-7 x) 0.0) - (set! (-> v1-7 y) 128.0) - (set! (-> v1-7 z) 128.0) - (set! (-> v1-7 v w) 128.0) + (((load-boundary-cmd load)) + (let ((v1-1 arg0)) + (set! (-> v1-1 x) 128.0) + (set! (-> v1-1 y) 128.0) + (set! (-> v1-1 z) 128.0) + (set! (-> v1-1 v w) 128.0) + ) + ) + (((load-boundary-cmd cmd2)) + (let ((v1-2 arg0)) + (set! (-> v1-2 x) 0.0) + (set! (-> v1-2 y) 0.0) + (set! (-> v1-2 z) 0.0) + (set! (-> v1-2 v w) 128.0) + ) + ) + (((load-boundary-cmd display)) + (cond + ((-> arg1 lev1) + (let ((v1-4 arg0)) + (set! (-> v1-4 x) 128.0) + (set! (-> v1-4 y) 128.0) + (set! (-> v1-4 z) 0.0) + (set! (-> v1-4 v w) 128.0) + ) + ) + (else + (let ((v1-5 arg0)) + (set! (-> v1-5 x) 64.0) + (set! (-> v1-5 y) 64.0) + (set! (-> v1-5 z) 0.0) + (set! (-> v1-5 v w) 128.0) ) ) - (else - (let ((v1-8 arg0)) - (set! (-> v1-8 x) 64.0) - (set! (-> v1-8 y) 64.0) - (set! (-> v1-8 z) 64.0) - (set! (-> v1-8 v w) 128.0) - ) - ) + ) + ) + (((load-boundary-cmd vis)) + (let ((v1-6 arg0)) + (set! (-> v1-6 x) 128.0) + (set! (-> v1-6 y) 0.0) + (set! (-> v1-6 z) 0.0) + (set! (-> v1-6 v w) 128.0) + ) + ) + (((load-boundary-cmd checkpt)) + (let ((v1-7 arg0)) + (set! (-> v1-7 x) 0.0) + (set! (-> v1-7 y) 128.0) + (set! (-> v1-7 z) 128.0) + (set! (-> v1-7 v w) 128.0) + ) + ) + (else + (let ((v1-8 arg0)) + (set! (-> v1-8 x) 64.0) + (set! (-> v1-8 y) 64.0) + (set! (-> v1-8 z) 64.0) + (set! (-> v1-8 v w) 128.0) ) + ) + ) 0 (none) ) @@ -442,24 +433,24 @@ (defun-debug format-boundary-cmd ((arg0 load-boundary-crossing-command)) (case (-> arg0 cmd) - (((load-boundary-cmd load)) + (((load-boundary-cmd load)) (format *stdcon* " LOAD(~A,~A)~%" (-> arg0 lev0) (-> arg0 lev1)) ) - (((load-boundary-cmd cmd2)) - ) - (((load-boundary-cmd display)) - (if (-> arg0 lev1) - (format *stdcon* " DISPLAY(~A,~A)~%" (-> arg0 lev0) (-> arg0 lev1)) - (format *stdcon* " DISPLAY(~A,OFF)~%" (-> arg0 lev0)) + (((load-boundary-cmd cmd2)) + ) + (((load-boundary-cmd display)) + (if (-> arg0 lev1) + (format *stdcon* " DISPLAY(~A,~A)~%" (-> arg0 lev0) (-> arg0 lev1)) + (format *stdcon* " DISPLAY(~A,OFF)~%" (-> arg0 lev0)) + ) + ) + (((load-boundary-cmd vis)) + (format *stdcon* " VIS(~A)~%" (-> arg0 lev0)) + ) + (((load-boundary-cmd checkpt)) + (format *stdcon* " CHECKPT(~A)~%" (-> arg0 lev0)) ) ) - (((load-boundary-cmd vis)) - (format *stdcon* " VIS(~A)~%" (-> arg0 lev0)) - ) - (((load-boundary-cmd checkpt)) - (format *stdcon* " CHECKPT(~A)~%" (-> arg0 lev0)) - ) - ) 0 (none) ) @@ -468,139 +459,127 @@ (let* ((gp-0 *lb-editor-parms*) (s5-0 (-> gp-0 boundary)) ) - (format *stdcon* "~3L") - (cond - ((not s5-0) - (format *stdcon* "No load boundary selected - use Player 2 pad to select~%") - ) - (else - (format *stdcon* "Selected load boundary ~X~%" s5-0) - (if (logtest? (-> s5-0 flags) (load-boundary-flags player)) - (format *stdcon* "PLAYER activated~%") - (format *stdcon* "CAMERA activated~%") - ) - (when (nonzero? (-> s5-0 cmd-fwd cmd)) - (format *stdcon* "in->out~%") - (format-boundary-cmd (-> s5-0 cmd-fwd)) - ) - (when (nonzero? (-> s5-0 cmd-bwd cmd)) - (format *stdcon* "out->in~%") - (format-boundary-cmd (-> s5-0 cmd-bwd)) - ) - ) - ) - (format *stdcon* "~0L") - (let ((s3-0 (new 'stack-no-clear 'vector)) - (s4-0 (new 'stack-no-clear 'vector)) - ) - (set! (-> s3-0 quad) (-> *math-camera* inv-camera-rot vector 0 quad)) - (set! (-> s4-0 quad) (-> *math-camera* inv-camera-rot vector 1 quad)) - (set! (-> s3-0 y) 0.0) - (set! (-> s4-0 y) 0.0) - (when (and s5-0 (!= -1 (-> gp-0 vertex))) - (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> s5-0 data (-> gp-0 vertex) quad)) - (set! (-> s2-0 y) (-> s5-0 top-plane)) - (add-debug-sphere - #t - (bucket-id debug-no-zbuf) - s2-0 - 8192.0 - (new 'static 'rgba :a #x80) + (format *stdcon* "~3L") + (cond + ((not s5-0) + (format *stdcon* "No load boundary selected - use Player 2 pad to select~%") ) - (when (zero? (logand (-> s5-0 flags) (load-boundary-flags closed))) - (set! (-> s2-0 y) (-> s5-0 bot-plane)) - (add-debug-sphere - #t - (bucket-id debug-no-zbuf) - s2-0 - 8192.0 - (new 'static 'rgba :a #x80) + (else + (format *stdcon* "Selected load boundary ~X~%" s5-0) + (if (logtest? (-> s5-0 flags) (load-boundary-flags player)) + (format *stdcon* "PLAYER activated~%") + (format *stdcon* "CAMERA activated~%") + ) + (when (nonzero? (-> s5-0 cmd-fwd cmd)) + (format *stdcon* "in->out~%") + (format-boundary-cmd (-> s5-0 cmd-fwd)) + ) + (when (nonzero? (-> s5-0 cmd-bwd cmd)) + (format *stdcon* "out->in~%") + (format-boundary-cmd (-> s5-0 cmd-bwd)) + ) ) - ) - ) - ) - (let* ((f30-1 (* 4096.0 (analog-input (the-as int (-> *cpad-list* cpads 1 leftx)) 128.0 48.0 110.0 -1.0))) - (f28-1 (* 4096.0 (analog-input (the-as int (-> *cpad-list* cpads 1 lefty)) 128.0 48.0 110.0 -1.0))) - (f30-2 (+ f30-1 (* 409.6 (analog-input (the-as int (-> *cpad-list* cpads 1 rightx)) 128.0 48.0 110.0 -1.0)))) - (f0-10 (+ f28-1 (* 409.6 (analog-input (the-as int (-> *cpad-list* cpads 1 righty)) 128.0 48.0 110.0 -1.0)))) ) - (cond - ((logtest? (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons x)) - (cond - ((= (-> gp-0 vertex) -1) - (dotimes (v1-37 (the-as int (-> s5-0 num-points))) - (+! (-> s5-0 data v1-37 x) (* f30-2 (-> s3-0 x))) - (+! (-> s5-0 data v1-37 z) (* f30-2 (-> s3-0 z))) - (+! (-> s5-0 data v1-37 x) (* f0-10 (-> s4-0 x))) - (+! (-> s5-0 data v1-37 z) (* f0-10 (-> s4-0 z))) + (format *stdcon* "~0L") + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) ) - ) - (else - (+! (-> s5-0 data (-> gp-0 vertex) x) (* f30-2 (-> s3-0 x))) - (+! (-> s5-0 data (-> gp-0 vertex) z) (* f30-2 (-> s3-0 z))) - (+! (-> s5-0 data (-> gp-0 vertex) x) (* f0-10 (-> s4-0 x))) - (+! (-> s5-0 data (-> gp-0 vertex) z) (* f0-10 (-> s4-0 z))) - ) - ) - (set! (-> s5-0 tri-cnt) 0) - 0 - ) - ((logtest? (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons r1)) - (if s5-0 - (+! (-> s5-0 top-plane) f0-10) - ) - ) - ((logtest? (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons r2)) - (if s5-0 - (+! (-> s5-0 bot-plane) f0-10) - ) - ) - ((logtest? (-> *cpad-list* cpads 1 button0-rel 0) (pad-buttons up)) - (if s5-0 - (set! s5-0 (-> s5-0 next)) - (set! s5-0 *load-boundary-list*) - ) - (set! (-> gp-0 vertex) -1) - ) - ((logtest? (-> *cpad-list* cpads 1 button0-rel 0) (pad-buttons down)) - (cond - ((= s5-0 *load-boundary-list*) - (set! s5-0 (the-as load-boundary #f)) - ) - (else - (let ((v1-95 *load-boundary-list*)) - (while v1-95 - (when (= s5-0 (-> v1-95 next)) - (set! s5-0 v1-95) - (set! v1-95 (the-as load-boundary #f)) + (set! (-> s3-0 quad) (-> *math-camera* inv-camera-rot vector 0 quad)) + (set! (-> s4-0 quad) (-> *math-camera* inv-camera-rot vector 1 quad)) + (set! (-> s3-0 y) 0.0) + (set! (-> s4-0 y) 0.0) + (when (and s5-0 (!= -1 (-> gp-0 vertex))) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> s5-0 data (-> gp-0 vertex) quad)) + (set! (-> s2-0 y) (-> s5-0 top-plane)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s2-0 8192.0 (new 'static 'rgba :a #x80)) + (when (not (logtest? (-> s5-0 flags) (load-boundary-flags closed))) + (set! (-> s2-0 y) (-> s5-0 bot-plane)) + (add-debug-sphere #t (bucket-id debug-no-zbuf) s2-0 8192.0 (new 'static 'rgba :a #x80)) ) - (if v1-95 - (set! v1-95 (-> v1-95 next)) - ) - ) ) - ) - ) - (set! (-> gp-0 vertex) -1) - ) - ((logtest? (-> *cpad-list* cpads 1 button0-rel 0) (pad-buttons right)) - (+! (-> gp-0 vertex) 1) - (if (= (-> gp-0 vertex) (-> s5-0 num-points)) - (set! (-> gp-0 vertex) -1) ) - ) - ((logtest? (-> *cpad-list* cpads 1 button0-rel 0) (pad-buttons left)) - (+! (-> gp-0 vertex) -1) - (if (= (-> gp-0 vertex) -2) - (set! (-> gp-0 vertex) (the-as int (+ (-> s5-0 num-points) -1))) + (let* ((f30-1 (* 4096.0 (analog-input (the-as int (-> *cpad-list* cpads 1 leftx)) 128.0 48.0 110.0 -1.0))) + (f28-1 (* 4096.0 (analog-input (the-as int (-> *cpad-list* cpads 1 lefty)) 128.0 48.0 110.0 -1.0))) + (f30-2 (+ f30-1 (* 409.6 (analog-input (the-as int (-> *cpad-list* cpads 1 rightx)) 128.0 48.0 110.0 -1.0)))) + (f0-10 (+ f28-1 (* 409.6 (analog-input (the-as int (-> *cpad-list* cpads 1 righty)) 128.0 48.0 110.0 -1.0)))) + ) + (cond + ((cpad-hold? 1 x) + (cond + ((= (-> gp-0 vertex) -1) + (dotimes (v1-37 (the-as int (-> s5-0 num-points))) + (+! (-> s5-0 data v1-37 x) (* f30-2 (-> s3-0 x))) + (+! (-> s5-0 data v1-37 z) (* f30-2 (-> s3-0 z))) + (+! (-> s5-0 data v1-37 x) (* f0-10 (-> s4-0 x))) + (+! (-> s5-0 data v1-37 z) (* f0-10 (-> s4-0 z))) + ) + ) + (else + (+! (-> s5-0 data (-> gp-0 vertex) x) (* f30-2 (-> s3-0 x))) + (+! (-> s5-0 data (-> gp-0 vertex) z) (* f30-2 (-> s3-0 z))) + (+! (-> s5-0 data (-> gp-0 vertex) x) (* f0-10 (-> s4-0 x))) + (+! (-> s5-0 data (-> gp-0 vertex) z) (* f0-10 (-> s4-0 z))) + ) + ) + (set! (-> s5-0 tri-cnt) 0) + 0 + ) + ((cpad-hold? 1 r1) + (if s5-0 + (+! (-> s5-0 top-plane) f0-10) + ) + ) + ((cpad-hold? 1 r2) + (if s5-0 + (+! (-> s5-0 bot-plane) f0-10) + ) + ) + ((cpad-pressed? 1 up) + (if s5-0 + (set! s5-0 (-> s5-0 next)) + (set! s5-0 *load-boundary-list*) + ) + (set! (-> gp-0 vertex) -1) + ) + ((cpad-pressed? 1 down) + (cond + ((= s5-0 *load-boundary-list*) + (set! s5-0 (the-as load-boundary #f)) + ) + (else + (let ((v1-95 *load-boundary-list*)) + (while v1-95 + (when (= s5-0 (-> v1-95 next)) + (set! s5-0 v1-95) + (set! v1-95 (the-as load-boundary #f)) + ) + (if v1-95 + (set! v1-95 (-> v1-95 next)) + ) + ) + ) + ) + ) + (set! (-> gp-0 vertex) -1) + ) + ((cpad-pressed? 1 right) + (+! (-> gp-0 vertex) 1) + (if (= (-> gp-0 vertex) (-> s5-0 num-points)) + (set! (-> gp-0 vertex) -1) + ) + ) + ((cpad-pressed? 1 left) + (+! (-> gp-0 vertex) -1) + (if (= (-> gp-0 vertex) -2) + (set! (-> gp-0 vertex) (the-as int (+ (-> s5-0 num-points) -1))) + ) + ) + ) ) - ) ) - ) + (set! (-> gp-0 boundary) s5-0) ) - (set! (-> gp-0 boundary) s5-0) - ) 0 (none) ) @@ -608,11 +587,11 @@ (defun-debug copy-load-command! ((arg0 load-boundary-crossing-command) (arg1 load-boundary-crossing-command)) (set! (-> arg0 cmd) (-> arg1 cmd)) (dotimes (v1-1 3) - (set! (-> arg0 bparm v1-1) (-> arg1 bparm v1-1)) - ) + (set! (-> arg0 bparm v1-1) (-> arg1 bparm v1-1)) + ) (dotimes (v1-4 2) - (set! (-> arg0 parm v1-4) (-> arg1 parm v1-4)) - ) + (set! (-> arg0 parm v1-4) (-> arg1 parm v1-4)) + ) 0 (none) ) @@ -631,21 +610,21 @@ (defun-debug replace-load-boundary ((arg0 load-boundary) (arg1 load-boundary)) (set! (-> arg1 next) (-> arg0 next)) (if (= (-> *lb-editor-parms* boundary) arg0) - (set! (-> *lb-editor-parms* boundary) arg1) - ) + (set! (-> *lb-editor-parms* boundary) arg1) + ) (when (= arg0 *load-boundary-list*) - (set! *load-boundary-list* arg1) - (return 0) - ) - (let ((v1-9 *load-boundary-list*)) - (while (and v1-9 (!= (-> v1-9 next) arg0)) - (set! v1-9 (-> v1-9 next)) - ) - (when v1-9 - (set! (-> v1-9 next) arg1) + (set! *load-boundary-list* arg1) (return 0) ) - ) + (let ((v1-9 *load-boundary-list*)) + (while (and v1-9 (!= (-> v1-9 next) arg0)) + (set! v1-9 (-> v1-9 next)) + ) + (when v1-9 + (set! (-> v1-9 next) arg1) + (return 0) + ) + ) (format 0 "ERROR: Couldn't find old boundary in list!!!!~%") 0 (none) @@ -653,25 +632,25 @@ (defun-debug lb-del () (let ((v1-1 (-> *lb-editor-parms* boundary))) - (set! (-> *lb-editor-parms* boundary) #f) - (when (not v1-1) - (format 0 "No boundary selected~%") - (return 0) - ) - (when (= v1-1 *load-boundary-list*) - (set! *load-boundary-list* (-> v1-1 next)) - (return 0) - ) - (let ((a0-5 *load-boundary-list*)) - (while (and a0-5 (!= (-> a0-5 next) v1-1)) - (set! a0-5 (-> a0-5 next)) - ) - (when a0-5 - (set! (-> a0-5 next) (-> v1-1 next)) - (return 0) - ) + (set! (-> *lb-editor-parms* boundary) #f) + (when (not v1-1) + (format 0 "No boundary selected~%") + (return 0) + ) + (when (= v1-1 *load-boundary-list*) + (set! *load-boundary-list* (-> v1-1 next)) + (return 0) + ) + (let ((a0-5 *load-boundary-list*)) + (while (and a0-5 (!= (-> a0-5 next) v1-1)) + (set! a0-5 (-> a0-5 next)) + ) + (when a0-5 + (set! (-> a0-5 next) (-> v1-1 next)) + (return 0) + ) + ) ) - ) (format 0 "ERROR: Couldn't find old boundary in list!!!!~%") 0 (none) @@ -682,101 +661,87 @@ (gp-0 (-> v1-0 boundary)) (s4-0 (-> v1-0 vertex)) ) - (when (not gp-0) - (format 0 "No boundary selected~%") - (return 0) - ) - (when (= s4-0 -1) - (format 0 "No vertex selected~%") - (return 0) - ) - (let ((s5-0 (new 'global 'load-boundary (the-as int (+ (-> gp-0 num-points) 1)) #f #f))) - (copy-load-boundary! s5-0 gp-0) - (let ((v1-8 0)) - (while (< v1-8 s4-0) - (set! (-> s5-0 data v1-8 quad) (-> gp-0 data v1-8 quad)) - (+! v1-8 1) + (when (not gp-0) + (format 0 "No boundary selected~%") + (return 0) ) - (cond - ((zero? s4-0) - (set! (-> s5-0 data v1-8 x) - (* 0.5 (+ (-> gp-0 data 0 x) (-> gp-0 data (+ (-> gp-0 num-points) -1) x)))) - (set! (-> s5-0 data v1-8 z) - (* 0.5 (+ (-> gp-0 data 0 z) (-> gp-0 data (+ (-> gp-0 num-points) -1) z)))) - ) - (else - (set! (-> s5-0 data v1-8 x) - (* 0.5 (+ (-> gp-0 data (+ s4-0 -1) x) (-> gp-0 data s4-0 x))) - ) - (set! (-> s5-0 data v1-8 z) - (* 0.5 (+ (-> gp-0 data (+ s4-0 -1) z) (-> gp-0 data s4-0 z))) - ) - ) + (when (= s4-0 -1) + (format 0 "No vertex selected~%") + (return 0) ) - (let ((v1-9 (+ v1-8 1))) - (while (>= (the-as int (-> gp-0 num-points)) v1-9) - (set! (-> s5-0 data v1-9 quad) (-> gp-0 data (+ v1-9 -1) quad)) - (+! v1-9 1) - ) + (let ((s5-0 (new 'global 'load-boundary (the-as int (+ (-> gp-0 num-points) 1)) #f #f))) + (copy-load-boundary! s5-0 gp-0) + (let ((v1-8 0)) + (while (< v1-8 s4-0) + (set! (-> s5-0 data v1-8 quad) (-> gp-0 data v1-8 quad)) + (+! v1-8 1) + ) + (cond + ((zero? s4-0) + (set! (-> s5-0 data v1-8 x) (* 0.5 (+ (-> gp-0 data 0 x) (-> gp-0 data (+ (-> gp-0 num-points) -1) x)))) + (set! (-> s5-0 data v1-8 z) (* 0.5 (+ (-> gp-0 data 0 z) (-> gp-0 data (+ (-> gp-0 num-points) -1) z)))) + ) + (else + (set! (-> s5-0 data v1-8 x) (* 0.5 (+ (-> gp-0 data (+ s4-0 -1) x) (-> gp-0 data s4-0 x)))) + (set! (-> s5-0 data v1-8 z) (* 0.5 (+ (-> gp-0 data (+ s4-0 -1) z) (-> gp-0 data s4-0 z)))) + ) + ) + (let ((v1-9 (+ v1-8 1))) + (while (>= (the-as int (-> gp-0 num-points)) v1-9) + (set! (-> s5-0 data v1-9 quad) (-> gp-0 data (+ v1-9 -1) quad)) + (+! v1-9 1) + ) + ) + ) + (replace-load-boundary gp-0 s5-0) ) - ) - (replace-load-boundary gp-0 s5-0) ) - ) 0 (none) ) (defun-debug lb-add-vtx-after () (let ((gp-0 *lb-editor-parms*)) - (let ((s5-0 (-> gp-0 boundary)) - (s3-0 (-> gp-0 vertex)) - ) - (when (not s5-0) - (format 0 "No boundary selected~%") - (return 0) - ) - (when (= s3-0 -1) - (format 0 "No vertex selected~%") - (return 0) - ) - (let ((s4-0 (new 'global 'load-boundary (the-as int (+ (-> s5-0 num-points) 1)) #f #f))) - (copy-load-boundary! s4-0 s5-0) - (let ((v1-7 0)) - (while (>= s3-0 v1-7) - (set! (-> s4-0 data v1-7 quad) (-> s5-0 data v1-7 quad)) - (+! v1-7 1) - ) - (cond - ((= s3-0 (+ (-> s5-0 num-points) -1)) - (set! (-> s4-0 data v1-7 x) - (* 0.5 (+ (-> s5-0 data 0 x) (-> s5-0 data (+ (-> s5-0 num-points) -1) x))) - ) - (set! (-> s4-0 data v1-7 z) - (* 0.5 (+ (-> s5-0 data 0 z) (-> s5-0 data (+ (-> s5-0 num-points) -1) z))) - ) + (let ((s5-0 (-> gp-0 boundary)) + (s3-0 (-> gp-0 vertex)) + ) + (when (not s5-0) + (format 0 "No boundary selected~%") + (return 0) ) - (else - (set! (-> s4-0 data v1-7 x) - (* 0.5 (+ (-> s5-0 data (+ s3-0 1) x) (-> s5-0 data s3-0 x))) - ) - (set! (-> s4-0 data v1-7 z) - (* 0.5 (+ (-> s5-0 data (+ s3-0 1) z) (-> s5-0 data s3-0 z))) - ) + (when (= s3-0 -1) + (format 0 "No vertex selected~%") + (return 0) ) - ) - (let ((v1-8 (+ v1-7 1))) - (while (>= (the-as int (-> s5-0 num-points)) v1-8) - (set! (-> s4-0 data v1-8 quad) (-> s5-0 data (+ v1-8 -1) quad)) - (+! v1-8 1) + (let ((s4-0 (new 'global 'load-boundary (the-as int (+ (-> s5-0 num-points) 1)) #f #f))) + (copy-load-boundary! s4-0 s5-0) + (let ((v1-7 0)) + (while (>= s3-0 v1-7) + (set! (-> s4-0 data v1-7 quad) (-> s5-0 data v1-7 quad)) + (+! v1-7 1) + ) + (cond + ((= s3-0 (+ (-> s5-0 num-points) -1)) + (set! (-> s4-0 data v1-7 x) (* 0.5 (+ (-> s5-0 data 0 x) (-> s5-0 data (+ (-> s5-0 num-points) -1) x)))) + (set! (-> s4-0 data v1-7 z) (* 0.5 (+ (-> s5-0 data 0 z) (-> s5-0 data (+ (-> s5-0 num-points) -1) z)))) + ) + (else + (set! (-> s4-0 data v1-7 x) (* 0.5 (+ (-> s5-0 data (+ s3-0 1) x) (-> s5-0 data s3-0 x)))) + (set! (-> s4-0 data v1-7 z) (* 0.5 (+ (-> s5-0 data (+ s3-0 1) z) (-> s5-0 data s3-0 z)))) + ) + ) + (let ((v1-8 (+ v1-7 1))) + (while (>= (the-as int (-> s5-0 num-points)) v1-8) + (set! (-> s4-0 data v1-8 quad) (-> s5-0 data (+ v1-8 -1) quad)) + (+! v1-8 1) + ) + ) + ) + (replace-load-boundary s5-0 s4-0) ) - ) ) - (replace-load-boundary s5-0 s4-0) - ) + (+! (-> gp-0 vertex) 1) ) - (+! (-> gp-0 vertex) 1) - ) 0 (none) ) @@ -785,60 +750,60 @@ (let* ((gp-0 *lb-editor-parms*) (s5-0 (-> gp-0 boundary)) ) - (let ((s3-0 (-> gp-0 vertex))) - (when (not s5-0) - (format 0 "No boundary selected~%") - (return 0) - ) - (when (= s3-0 -1) - (format 0 "No vertex selected~%") - (return 0) - ) - (let ((s4-0 (new 'global 'load-boundary (the-as int (+ (-> s5-0 num-points) -1)) #f #f))) - (copy-load-boundary! s4-0 s5-0) - (let ((v1-7 0)) - (while (< v1-7 s3-0) - (set! (-> s4-0 data v1-7 quad) (-> s5-0 data v1-7 quad)) - (+! v1-7 1) - ) - (let ((v1-8 (+ v1-7 1))) - (while (< v1-8 (the-as int (-> s5-0 num-points))) - (set! (-> s4-0 data (+ v1-8 -1) quad) (-> s5-0 data v1-8 quad)) - (+! v1-8 1) + (let ((s3-0 (-> gp-0 vertex))) + (when (not s5-0) + (format 0 "No boundary selected~%") + (return 0) + ) + (when (= s3-0 -1) + (format 0 "No vertex selected~%") + (return 0) + ) + (let ((s4-0 (new 'global 'load-boundary (the-as int (+ (-> s5-0 num-points) -1)) #f #f))) + (copy-load-boundary! s4-0 s5-0) + (let ((v1-7 0)) + (while (< v1-7 s3-0) + (set! (-> s4-0 data v1-7 quad) (-> s5-0 data v1-7 quad)) + (+! v1-7 1) + ) + (let ((v1-8 (+ v1-7 1))) + (while (< v1-8 (the-as int (-> s5-0 num-points))) + (set! (-> s4-0 data (+ v1-8 -1) quad) (-> s5-0 data v1-8 quad)) + (+! v1-8 1) + ) + ) + ) + (replace-load-boundary s5-0 s4-0) ) - ) ) - (replace-load-boundary s5-0 s4-0) - ) - ) - (if (= (-> gp-0 vertex) (+ (-> s5-0 num-points) -1)) - (set! (-> gp-0 vertex) -1) + (if (= (-> gp-0 vertex) (+ (-> s5-0 num-points) -1)) + (set! (-> gp-0 vertex) -1) + ) ) - ) 0 (none) ) (defun-debug save-boundary-cmd ((arg0 load-boundary-crossing-command) (arg1 string) (arg2 object)) (case (-> arg0 cmd) - (((load-boundary-cmd load)) + (((load-boundary-cmd load)) (format arg2 " :~S (load ~A ~A)~%" arg1 (-> arg0 lev0) (-> arg0 lev1)) ) - (((load-boundary-cmd cmd2)) - ) - (((load-boundary-cmd display)) - (format arg2 " :~S (display ~A ~A)~%" arg1 (-> arg0 lev0) (-> arg0 lev1)) - ) - (((load-boundary-cmd vis)) - (format arg2 " :~S (vis ~A #f)~%" arg1 (-> arg0 lev0)) - ) - (((load-boundary-cmd force-vis)) - (format arg2 " :~S (force-vis ~A ~A)~%" arg1 (-> arg0 lev0) (-> arg0 lev1)) - ) - (((load-boundary-cmd checkpt)) - (format arg2 " :~S (checkpt ~A #f)~%" arg1 (-> arg0 lev0)) + (((load-boundary-cmd cmd2)) + ) + (((load-boundary-cmd display)) + (format arg2 " :~S (display ~A ~A)~%" arg1 (-> arg0 lev0) (-> arg0 lev1)) + ) + (((load-boundary-cmd vis)) + (format arg2 " :~S (vis ~A #f)~%" arg1 (-> arg0 lev0)) + ) + (((load-boundary-cmd force-vis)) + (format arg2 " :~S (force-vis ~A ~A)~%" arg1 (-> arg0 lev0) (-> arg0 lev1)) + ) + (((load-boundary-cmd checkpt)) + (format arg2 " :~S (checkpt ~A #f)~%" arg1 (-> arg0 lev0)) + ) ) - ) 0 (none) ) @@ -848,42 +813,33 @@ (a2-0 (+ (/ (-> s5-0 length) 2) -1)) (v0-0 (new 'global 'load-boundary a2-0 #f #t)) ) - (set! - (-> v0-0 flags) - (the-as load-boundary-flags (/ (the-as int (-> arg0 0)) 8)) - ) - (set! (-> v0-0 top-plane) (-> s5-0 0)) - (set! (-> v0-0 bot-plane) (-> s5-0 1)) - (let ((v1-5 2)) - (while (< v1-5 (-> s5-0 length)) - (let ((a0-6 (-> v0-0 data (+ (/ v1-5 2) -1)))) - (set! (-> a0-6 x) (-> s5-0 v1-5)) - (set! (-> a0-6 z) (-> s5-0 (+ v1-5 1))) + (set! (-> v0-0 flags) (the-as load-boundary-flags (/ (the-as int (-> arg0 0)) 8))) + (set! (-> v0-0 top-plane) (-> s5-0 0)) + (set! (-> v0-0 bot-plane) (-> s5-0 1)) + (let ((v1-5 2)) + (while (< v1-5 (-> s5-0 length)) + (let ((a0-6 (-> v0-0 data (+ (/ v1-5 2) -1)))) + (set! (-> a0-6 x) (-> s5-0 v1-5)) + (set! (-> a0-6 z) (-> s5-0 (+ v1-5 1))) + ) + (+! v1-5 2) + ) + ) + (let ((v1-7 (-> v0-0 cmd-fwd)) + (a0-9 (-> arg0 2)) + ) + (set! (-> v1-7 cmd) (the-as load-boundary-cmd (/ (the-as int (car (the-as pair a0-9))) 8))) + (set! (-> v1-7 lev0) (the-as basic (car (cdr a0-9)))) + (set! (-> v1-7 lev1) (the-as basic (car (cdr (cdr a0-9))))) + ) + (let ((v1-8 (-> v0-0 cmd-bwd)) + (a0-13 (-> arg0 3)) + ) + (set! (-> v1-8 cmd) (the-as load-boundary-cmd (/ (the-as int (car (the-as pair a0-13))) 8))) + (set! (-> v1-8 lev0) (the-as basic (car (cdr a0-13)))) + (set! (-> v1-8 lev1) (the-as basic (car (cdr (cdr a0-13))))) ) - (+! v1-5 2) - ) - ) - (let ((v1-7 (-> v0-0 cmd-fwd)) - (a0-9 (-> arg0 2)) - ) - (set! - (-> v1-7 cmd) - (the-as load-boundary-cmd (/ (the-as int (car (the-as pair a0-9))) 8)) - ) - (set! (-> v1-7 lev0) (the-as basic (car (cdr a0-9)))) - (set! (-> v1-7 lev1) (the-as basic (car (cdr (cdr a0-9))))) - ) - (let ((v1-8 (-> v0-0 cmd-bwd)) - (a0-13 (-> arg0 3)) - ) - (set! - (-> v1-8 cmd) - (the-as load-boundary-cmd (/ (the-as int (car (the-as pair a0-13))) 8)) - ) - (set! (-> v1-8 lev0) (the-as basic (car (cdr a0-13)))) - (set! (-> v1-8 lev1) (the-as basic (car (cdr (cdr a0-13))))) ) - ) (none) ) @@ -891,53 +847,42 @@ (clear *temp-string*) (format *temp-string* "game/load-boundary-data.gc") (let ((gp-0 (new 'stack 'file-stream *temp-string* 'write))) - (format gp-0 ";-*-Lisp-*-~%") - (format gp-0 "(in-package goal)~%~%") - (format gp-0 ";; reset boundary in editor~%") - (format gp-0 "(set! (-> *lb-editor-parms* boundary) #f)~%~%") - (format gp-0 ";; reset all existing load boundaries~%") - (format gp-0 "(set! *load-boundary-list* #f)~%~%") - (format - gp-0 - "(define *static-load-boundary-list* (new 'static 'array 'array 0~%~%" - ) - (let ((s5-0 *load-boundary-list*)) - (while s5-0 - (format - gp-0 - "(static-load-boundary :flags (~S~S)~%" - (if (logtest? (-> s5-0 flags) (load-boundary-flags closed)) - "closed " - "" - ) - (if (logtest? (-> s5-0 flags) (load-boundary-flags player)) - "player " - "" - ) - ) - (format - gp-0 - " :top ~f :bot ~f~%" - (-> s5-0 top-plane) - (-> s5-0 bot-plane) - ) - (format gp-0 " :points (") - (dotimes (s4-0 (the-as int (-> s5-0 num-points))) - (format gp-0 " ~f ~f " (-> s5-0 data s4-0 x) (-> s5-0 data s4-0 z)) + (format gp-0 ";-*-Lisp-*-~%") + (format gp-0 "(in-package goal)~%~%") + (format gp-0 ";; reset boundary in editor~%") + (format gp-0 "(set! (-> *lb-editor-parms* boundary) #f)~%~%") + (format gp-0 ";; reset all existing load boundaries~%") + (format gp-0 "(set! *load-boundary-list* #f)~%~%") + (format gp-0 "(define *static-load-boundary-list* (new 'static 'array 'array 0~%~%") + (let ((s5-0 *load-boundary-list*)) + (while s5-0 + (format + gp-0 + "(static-load-boundary :flags (~S~S)~%" + (if (logtest? (-> s5-0 flags) (load-boundary-flags closed)) + "closed " + "" + ) + (if (logtest? (-> s5-0 flags) (load-boundary-flags player)) + "player " + "" + ) + ) + (format gp-0 " :top ~f :bot ~f~%" (-> s5-0 top-plane) (-> s5-0 bot-plane)) + (format gp-0 " :points (") + (dotimes (s4-0 (the-as int (-> s5-0 num-points))) + (format gp-0 " ~f ~f " (-> s5-0 data s4-0 x) (-> s5-0 data s4-0 z)) + ) + (format gp-0 ")~%") + (save-boundary-cmd (-> s5-0 cmd-fwd) "fwd" gp-0) + (save-boundary-cmd (-> s5-0 cmd-bwd) "bwd" gp-0) + (format gp-0 " )~%~%") + (set! s5-0 (-> s5-0 next)) + ) ) - (format gp-0 ")~%") - (save-boundary-cmd (-> s5-0 cmd-fwd) "fwd" gp-0) - (save-boundary-cmd (-> s5-0 cmd-bwd) "bwd" gp-0) - (format gp-0 " )~%~%") - (set! s5-0 (-> s5-0 next)) - ) - ) - (format - gp-0 - "))~%~%(doarray (i *static-load-boundary-list*)~% (load-boundary-from-template i)~% )~%~%" + (format gp-0 "))~%~%(doarray (i *static-load-boundary-list*)~% (load-boundary-from-template i)~% )~%~%") + (file-stream-close gp-0) ) - (file-stream-close gp-0) - ) (format 0 "Written ~S~%" *temp-string*) 0 (none) @@ -945,111 +890,112 @@ (defun-debug lb-add () (let ((gp-0 (new 'global 'load-boundary 2 #f #t))) - (let ((v1-1 (camera-pos))) - (set! (-> gp-0 data 0 x) (-> v1-1 x)) - (set! (-> gp-0 data 0 z) (-> v1-1 z)) - (set! (-> gp-0 data2 1 x) (-> v1-1 x)) - (set! (-> gp-0 data2 1 z) (+ 204800.0 (-> v1-1 z))) + (let ((v1-1 (camera-pos))) + (set! (-> gp-0 data 0 x) (-> v1-1 x)) + (set! (-> gp-0 data 0 z) (-> v1-1 z)) + (set! (-> gp-0 data2 1 x) (-> v1-1 x)) + (set! (-> gp-0 data2 1 z) (+ 204800.0 (-> v1-1 z))) + ) + (set! (-> *lb-editor-parms* boundary) gp-0) + (set! (-> *lb-editor-parms* vertex) -1) + gp-0 ) - (set! (-> *lb-editor-parms* boundary) gp-0) - (set! (-> *lb-editor-parms* vertex) -1) - gp-0 - ) ) (defun-debug lb-add-plane () (let ((gp-0 (new 'global 'load-boundary 4 #t #t))) - (let ((v1-1 (camera-pos))) - (set! (-> gp-0 data 0 x) (-> v1-1 x)) - (set! (-> gp-0 data 0 z) (-> v1-1 z)) - (set! (-> gp-0 data2 1 x) (-> v1-1 x)) - (set! (-> gp-0 data2 1 z) (+ 204800.0 (-> v1-1 z))) - (set! (-> gp-0 data2 2 x) (+ 204800.0 (-> v1-1 x))) - (set! (-> gp-0 data2 2 z) (+ 204800.0 (-> v1-1 z))) - (set! (-> gp-0 data2 3 x) (+ 204800.0 (-> v1-1 x))) - (set! (-> gp-0 data2 3 z) (-> v1-1 z)) + (let ((v1-1 (camera-pos))) + (set! (-> gp-0 data 0 x) (-> v1-1 x)) + (set! (-> gp-0 data 0 z) (-> v1-1 z)) + (set! (-> gp-0 data2 1 x) (-> v1-1 x)) + (set! (-> gp-0 data2 1 z) (+ 204800.0 (-> v1-1 z))) + (set! (-> gp-0 data2 2 x) (+ 204800.0 (-> v1-1 x))) + (set! (-> gp-0 data2 2 z) (+ 204800.0 (-> v1-1 z))) + (set! (-> gp-0 data2 3 x) (+ 204800.0 (-> v1-1 x))) + (set! (-> gp-0 data2 3 z) (-> v1-1 z)) + ) + (set! (-> *lb-editor-parms* boundary) gp-0) + (set! (-> *lb-editor-parms* vertex) -1) + gp-0 ) - (set! (-> *lb-editor-parms* boundary) gp-0) - (set! (-> *lb-editor-parms* vertex) -1) - gp-0 - ) ) (defun-debug lb-add-load ((arg0 object) (arg1 object)) (let ((v1-0 (lb-add))) - (set! (-> v1-0 cmd-fwd cmd) (load-boundary-cmd load)) - (set! (-> v1-0 cmd-fwd lev0) (the-as basic arg0)) - (set! (-> v1-0 cmd-fwd lev1) (the-as basic arg1)) - ) + (set! (-> v1-0 cmd-fwd cmd) (load-boundary-cmd load)) + (set! (-> v1-0 cmd-fwd lev0) (the-as basic arg0)) + (set! (-> v1-0 cmd-fwd lev1) (the-as basic arg1)) + ) 0 (none) ) (defun-debug lb-add-load-plane ((arg0 object) (arg1 object)) (let ((v1-0 (lb-add-plane))) - (set! (-> v1-0 cmd-fwd cmd) (load-boundary-cmd load)) - (set! (-> v1-0 cmd-fwd lev0) (the-as basic arg0)) - (set! (-> v1-0 cmd-fwd lev1) (the-as basic arg1)) - ) + (set! (-> v1-0 cmd-fwd cmd) (load-boundary-cmd load)) + (set! (-> v1-0 cmd-fwd lev0) (the-as basic arg0)) + (set! (-> v1-0 cmd-fwd lev1) (the-as basic arg1)) + ) 0 (none) ) +;; WARN: Function lb-flip has a return type of none, but the expression builder found a return statement. (defun lb-flip () (let ((gp-0 (-> *lb-editor-parms* boundary))) - (when (not gp-0) - (format 0 "No boundary selected~%") - (return 0) - ) - (let ((s5-0 (new 'stack 'load-boundary-crossing-command))) - (copy-load-command! s5-0 (-> gp-0 cmd-fwd)) - (copy-load-command! (-> gp-0 cmd-fwd) (-> gp-0 cmd-bwd)) - (copy-load-command! (-> gp-0 cmd-bwd) s5-0) + (when (not gp-0) + (format 0 "No boundary selected~%") + (return 0) + ) + (let ((s5-0 (new 'stack 'load-boundary-crossing-command))) + (copy-load-command! s5-0 (-> gp-0 cmd-fwd)) + (copy-load-command! (-> gp-0 cmd-fwd) (-> gp-0 cmd-bwd)) + (copy-load-command! (-> gp-0 cmd-bwd) s5-0) + ) ) - ) (none) ) +;; WARN: Function lb-set-camera has a return type of none, but the expression builder found a return statement. (defun lb-set-camera () (let ((v1-1 (-> *lb-editor-parms* boundary))) - (when (not v1-1) - (format 0 "No boundary selected~%") - (return 0) + (when (not v1-1) + (format 0 "No boundary selected~%") + (return 0) + ) + (logclear! (-> v1-1 flags) (load-boundary-flags player)) ) - (logclear! (-> v1-1 flags) (load-boundary-flags player)) - ) 0 (none) ) +;; WARN: Function lb-set-player has a return type of none, but the expression builder found a return statement. (defun lb-set-player () (let ((v1-1 (-> *lb-editor-parms* boundary))) - (when (not v1-1) - (format 0 "No boundary selected~%") - (return 0) + (when (not v1-1) + (format 0 "No boundary selected~%") + (return 0) + ) + (logior! (-> v1-1 flags) (load-boundary-flags player)) ) - (logior! (-> v1-1 flags) (load-boundary-flags player)) - ) 0 (none) ) (defun-debug lb-copy () (let ((s5-0 (-> *lb-editor-parms* boundary))) - (when (not s5-0) - (format 0 "No boundary selected~%") - (return 0) - ) - (let - ((gp-0 (new 'global 'load-boundary (the-as int (-> s5-0 num-points)) #f #t)) - ) - (copy-load-boundary! gp-0 s5-0) - (dotimes (v1-4 (the-as int (-> s5-0 num-points))) - (set! (-> gp-0 data v1-4 quad) (-> s5-0 data v1-4 quad)) - ) - (set! (-> *lb-editor-parms* boundary) gp-0) + (when (not s5-0) + (format 0 "No boundary selected~%") + (return 0) + ) + (let ((gp-0 (new 'global 'load-boundary (the-as int (-> s5-0 num-points)) #f #t))) + (copy-load-boundary! gp-0 s5-0) + (dotimes (v1-4 (the-as int (-> s5-0 num-points))) + (set! (-> gp-0 data v1-4 quad) (-> s5-0 data v1-4 quad)) + ) + (set! (-> *lb-editor-parms* boundary) gp-0) + ) ) - ) 0 (none) ) @@ -1060,27 +1006,27 @@ (defun render-boundaries () (when (-> *level* border?) - (set! (-> *load-boundary-target* 2 quad) (-> *load-boundary-target* 0 quad)) - (set! (-> *load-boundary-target* 3 quad) (-> *load-boundary-target* 1 quad)) - (set! (-> *load-boundary-target* 0 quad) (-> (camera-pos) quad)) - (set! (-> *load-boundary-target* 1 quad) (-> (target-pos 0) quad)) - (let ((gp-2 *load-boundary-list*)) - (while gp-2 - (when (zero? (-> gp-2 tri-cnt)) - (triangulate-boundary gp-2) - (find-bounding-circle gp-2) - ) - (if *display-load-boundaries* - (render-boundary gp-2) + (set! (-> *load-boundary-target* 2 quad) (-> *load-boundary-target* 0 quad)) + (set! (-> *load-boundary-target* 3 quad) (-> *load-boundary-target* 1 quad)) + (set! (-> *load-boundary-target* 0 quad) (-> (camera-pos) quad)) + (set! (-> *load-boundary-target* 1 quad) (-> (target-pos 0) quad)) + (let ((gp-2 *load-boundary-list*)) + (while gp-2 + (when (zero? (-> gp-2 tri-cnt)) + (triangulate-boundary gp-2) + (find-bounding-circle gp-2) + ) + (if *display-load-boundaries* + (render-boundary gp-2) + ) + (check-boundary gp-2) + (set! gp-2 (-> gp-2 next)) + ) ) - (check-boundary gp-2) - (set! gp-2 (-> gp-2 next)) - ) ) - ) (if *display-load-boundaries* - (edit-load-boundaries) - ) + (edit-load-boundaries) + ) 0 (none) ) @@ -1095,29 +1041,29 @@ (f0-0 268435460.0) (f2-0 -268435460.0) ) - (dotimes (v1-0 (the-as int (-> arg0 num-points))) - (if (< (-> arg0 data v1-0 x) f1-0) - (set! f1-0 (-> arg0 data v1-0 x)) - ) - (if (< f3-0 (-> arg0 data v1-0 x)) - (set! f3-0 (-> arg0 data v1-0 x)) - ) - (if (< (-> arg0 data v1-0 z) f0-0) - (set! f0-0 (-> arg0 data v1-0 z)) - ) - (if (< f2-0 (-> arg0 data v1-0 z)) - (set! f2-0 (-> arg0 data v1-0 z)) - ) - ) - (let* ((f3-2 (* 0.5 (+ f1-0 f3-0))) - (f2-2 (* 0.5 (+ f0-0 f2-0))) - (f1-1 (- f3-2 f1-0)) - (f0-1 (- f2-2 f0-0)) - (f0-4 (sqrtf (+ (* f1-1 f1-1) (* f0-1 f0-1)))) + (dotimes (v1-0 (the-as int (-> arg0 num-points))) + (if (< (-> arg0 data v1-0 x) f1-0) + (set! f1-0 (-> arg0 data v1-0 x)) + ) + (if (< f3-0 (-> arg0 data v1-0 x)) + (set! f3-0 (-> arg0 data v1-0 x)) + ) + (if (< (-> arg0 data v1-0 z) f0-0) + (set! f0-0 (-> arg0 data v1-0 z)) ) - (set-vector! (-> arg0 rejector) f3-2 0.0 f2-2 f0-4) + (if (< f2-0 (-> arg0 data v1-0 z)) + (set! f2-0 (-> arg0 data v1-0 z)) + ) + ) + (let* ((f3-2 (* 0.5 (+ f1-0 f3-0))) + (f2-2 (* 0.5 (+ f0-0 f2-0))) + (f1-1 (- f3-2 f1-0)) + (f0-1 (- f2-2 f0-0)) + (f0-4 (sqrtf (+ (* f1-1 f1-1) (* f0-1 f0-1)))) + ) + (set-vector! (-> arg0 rejector) f3-2 0.0 f2-2 f0-4) + ) ) - ) 0 (none) ) @@ -1125,124 +1071,113 @@ (define *triangulation-buffer* (the-as (inline-array lbvtx) (malloc 'global 4096))) (defun triangulate-boundary ((arg0 load-boundary)) - (when (zero? (logand (-> arg0 flags) (load-boundary-flags closed))) - (set! (-> arg0 tri-cnt) 1) - (return (the-as object 0)) - ) - (let ((s5-0 *triangulation-buffer*)) - (new 'stack 'lbvtx) - (let ((s4-0 (-> arg0 num-points))) - (set! (-> arg0 tri-cnt) 0) - (dotimes (v1-7 (the-as int s4-0)) - (let ((a0-4 (-> arg0 data v1-7 quad))) - (set! (-> s5-0 v1-7 quad) a0-4) - ) - (if (zero? v1-7) - (set! (-> s5-0 v1-7 v0) (+ s4-0 -1)) - (set! (-> s5-0 v1-7 v0) (the-as uint (+ v1-7 -1))) - ) - (cond - ((= v1-7 (+ s4-0 -1)) - (set! (-> s5-0 v1-7 v1) (the-as uint 0)) - 0 - ) - (else - (set! (-> s5-0 v1-7 v1) (the-as uint (+ v1-7 1))) - ) - ) - (set! (-> s5-0 v1-7 v2) (the-as uint 1)) - ) - (while #t - (let ((a1-11 -1)) - (let ((f0-0 268435460.0)) - (dotimes (v1-10 (the-as int s4-0)) - (when (nonzero? (-> s5-0 v1-10 v2)) - (when - (or - (< (-> s5-0 v1-10 z) f0-0) - (and - (= (-> s5-0 v1-10 z) f0-0) - (< (-> s5-0 v1-10 x) (-> s5-0 a1-11 x)) - ) - ) - (set! f0-0 (-> s5-0 v1-10 z)) - (set! a1-11 v1-10) - ) - ) - ) - ) - (let* ((v1-14 (-> s5-0 a1-11)) - (a2-0 (-> s5-0 (-> v1-14 v0))) - (a0-36 (-> s5-0 (-> v1-14 v1))) - (f0-2 (- (-> v1-14 x) (-> a2-0 x))) - (f1-5 (- (-> v1-14 z) (-> a2-0 z))) - (f2-3 (- (-> a0-36 x) (-> v1-14 x))) - ) - (when (< (- (* f0-2 (- (-> a0-36 z) (-> v1-14 z))) (* f2-3 f1-5)) 0.0) - (dotimes (v1-16 (the-as int s4-0)) - (let ((a0-39 (-> s5-0 v1-16 v0))) - (set! (-> s5-0 v1-16 v0) (-> s5-0 v1-16 v1)) - (set! (-> s5-0 v1-16 v1) a0-39) - ) - ) - ) - ) - (let ((s3-0 a1-11) - (a0-40 (-> s5-0 a1-11 v0)) - (v1-23 (-> s5-0 a1-11 v1)) + (when (not (logtest? (-> arg0 flags) (load-boundary-flags closed))) + (set! (-> arg0 tri-cnt) 1) + (return (the-as object 0)) + ) + (let ((s5-0 *triangulation-buffer*)) + (new 'stack 'lbvtx) + (let ((s4-0 (-> arg0 num-points))) + (set! (-> arg0 tri-cnt) 0) + (dotimes (v1-7 (the-as int s4-0)) + (let ((a0-4 (-> arg0 data v1-7 quad))) + (set! (-> s5-0 v1-7 quad) a0-4) + ) + (if (zero? v1-7) + (set! (-> s5-0 v1-7 v0) (+ s4-0 -1)) + (set! (-> s5-0 v1-7 v0) (the-as uint (+ v1-7 -1))) + ) + (cond + ((= v1-7 (+ s4-0 -1)) + (set! (-> s5-0 v1-7 v1) (the-as uint 0)) + 0 + ) + (else + (set! (-> s5-0 v1-7 v1) (the-as uint (+ v1-7 1))) ) - (let ((a2-6 0)) - (while (>= (-> s5-0 a0-40 z) (-> s5-0 s3-0 z)) - (set! s3-0 (the-as int a0-40)) - (set! a0-40 (-> s5-0 (the-as uint s3-0) v0)) - (+! a2-6 1) - (when (= a2-6 10) - (break!) - 0 ) - ) - ) - (while (and (!= s3-0 a1-11) (>= (-> s5-0 s3-0 z) (-> s5-0 a0-40 z))) - (set! s3-0 (the-as int a0-40)) - (set! a0-40 (-> s5-0 (the-as uint s3-0) v0)) + (set! (-> s5-0 v1-7 v2) (the-as uint 1)) ) - (when (= s3-0 a1-11) - (split-monotone-polygon arg0 a1-11) - (fix-boundary-normals arg0) - (return (the-as object 0)) - ) - (let ((s2-0 a1-11)) - (while - (and - (>= (-> s5-0 v1-23 z) (-> s5-0 s2-0 z)) - (>= (-> s5-0 s3-0 z) (-> s5-0 v1-23 z)) - ) - (set! s2-0 (the-as int v1-23)) - (set! v1-23 (-> s5-0 (the-as uint s2-0) v1)) - ) - (let ((s1-0 (-> s5-0 s3-0 v0)) - (s0-0 (-> s5-0 s2-0 v1)) + (loop + (let ((a1-11 -1)) + (let ((f0-0 268435460.0)) + (dotimes (v1-10 (the-as int s4-0)) + (when (nonzero? (-> s5-0 v1-10 v2)) + (when (or (< (-> s5-0 v1-10 z) f0-0) (and (= (-> s5-0 v1-10 z) f0-0) (< (-> s5-0 v1-10 x) (-> s5-0 a1-11 x)))) + (set! f0-0 (-> s5-0 v1-10 z)) + (set! a1-11 v1-10) + ) + ) ) - (set! (-> s5-0 s3-0 v0) (the-as uint s2-0)) - (set! (-> s5-0 s2-0 v1) (the-as uint s3-0)) - (let ((v1-37 (-> s5-0 s3-0 v1))) - (while (!= v1-37 s2-0) - (set! (-> s5-0 v1-37 v2) (the-as uint 0)) - (set! v1-37 (-> s5-0 v1-37 v1)) - ) + ) + (let* ((v1-14 (-> s5-0 a1-11)) + (a2-0 (-> s5-0 (-> v1-14 v0))) + (a0-36 (-> s5-0 (-> v1-14 v1))) + (f0-2 (- (-> v1-14 x) (-> a2-0 x))) + (f1-5 (- (-> v1-14 z) (-> a2-0 z))) + (f2-3 (- (-> a0-36 x) (-> v1-14 x))) + ) + (when (< (- (* f0-2 (- (-> a0-36 z) (-> v1-14 z))) (* f2-3 f1-5)) 0.0) + (dotimes (v1-16 (the-as int s4-0)) + (let ((a0-39 (-> s5-0 v1-16 v0))) + (set! (-> s5-0 v1-16 v0) (-> s5-0 v1-16 v1)) + (set! (-> s5-0 v1-16 v1) a0-39) + ) + ) + ) + ) + (let ((s3-0 a1-11) + (a0-40 (-> s5-0 a1-11 v0)) + (v1-23 (-> s5-0 a1-11 v1)) + ) + (let ((a2-6 0)) + (while (>= (-> s5-0 a0-40 z) (-> s5-0 s3-0 z)) + (set! s3-0 (the-as int a0-40)) + (set! a0-40 (-> s5-0 (the-as uint s3-0) v0)) + (+! a2-6 1) + (when (= a2-6 10) + (break!) + 0 + ) + ) + ) + (while (and (!= s3-0 a1-11) (>= (-> s5-0 s3-0 z) (-> s5-0 a0-40 z))) + (set! s3-0 (the-as int a0-40)) + (set! a0-40 (-> s5-0 (the-as uint s3-0) v0)) + ) + (when (= s3-0 a1-11) + (split-monotone-polygon arg0 a1-11) + (fix-boundary-normals arg0) + (return (the-as object 0)) + ) + (let ((s2-0 a1-11)) + (while (and (>= (-> s5-0 v1-23 z) (-> s5-0 s2-0 z)) (>= (-> s5-0 s3-0 z) (-> s5-0 v1-23 z))) + (set! s2-0 (the-as int v1-23)) + (set! v1-23 (-> s5-0 (the-as uint s2-0) v1)) + ) + (let ((s1-0 (-> s5-0 s3-0 v0)) + (s0-0 (-> s5-0 s2-0 v1)) + ) + (set! (-> s5-0 s3-0 v0) (the-as uint s2-0)) + (set! (-> s5-0 s2-0 v1) (the-as uint s3-0)) + (let ((v1-37 (-> s5-0 s3-0 v1))) + (while (!= v1-37 s2-0) + (set! (-> s5-0 v1-37 v2) (the-as uint 0)) + (set! v1-37 (-> s5-0 v1-37 v1)) + ) + ) + (split-monotone-polygon arg0 a1-11) + (set! (-> s5-0 s3-0 v0) s1-0) + (set! (-> s5-0 s2-0 v1) s0-0) + ) + (set! (-> s5-0 s2-0 v0) (the-as uint s3-0)) + (set! (-> s5-0 s3-0 v1) (the-as uint s2-0)) + ) + ) ) - (split-monotone-polygon arg0 a1-11) - (set! (-> s5-0 s3-0 v0) s1-0) - (set! (-> s5-0 s2-0 v1) s0-0) - ) - (set! (-> s5-0 s2-0 v0) (the-as uint s3-0)) - (set! (-> s5-0 s3-0 v1) (the-as uint s2-0)) ) - ) ) - ) ) - ) 0 ) @@ -1254,141 +1189,133 @@ (f1-2 (- (-> v1-0 a0-3 z) (-> v1-0 a1-3 z))) (a2-10 (-> v1-0 a1-3 v1)) ) - (while (!= a2-10 a0-3) - (let ((f2-2 (- (-> v1-0 a2-10 x) (-> v1-0 a1-3 x))) - (f3-2 (- (-> v1-0 a2-10 z) (-> v1-0 a1-3 z))) - ) - (if (< (- (* f2-2 f1-2) (* f0-1 f3-2)) 0.0) - (return #f) + (while (!= a2-10 a0-3) + (let ((f2-2 (- (-> v1-0 a2-10 x) (-> v1-0 a1-3 x))) + (f3-2 (- (-> v1-0 a2-10 z) (-> v1-0 a1-3 z))) + ) + (if (< (- (* f2-2 f1-2) (* f0-1 f3-2)) 0.0) + (return #f) + ) + ) + (set! a2-10 (-> v1-0 a2-10 v1)) ) - ) - (set! a2-10 (-> v1-0 a2-10 v1)) ) - ) #t ) (defun split-monotone-polygon ((arg0 load-boundary) (arg1 int)) (let ((s5-0 *triangulation-buffer*)) - (while #t - (when (= (-> s5-0 (-> s5-0 (-> s5-0 arg1 v0) v0) v0) arg1) - (let ((v1-10 (-> arg0 tri-cnt))) - (set! (-> arg0 data v1-10 v0) (the-as uint arg1)) - (set! (-> arg0 data v1-10 v1) (-> s5-0 arg1 v0)) - (set! (-> arg0 data v1-10 v2) (-> s5-0 (-> s5-0 arg1 v0) v0)) - ) - (+! (-> arg0 tri-cnt) 1) - (return 0) - ) - (let ((s3-0 arg1)) - (while (not (try-corner arg0 s3-0)) - (set! s3-0 (the-as int (-> s5-0 s3-0 v1))) - (when (= (the-as uint s3-0) arg1) - ) - ) - (let ((a0-13 (-> arg0 tri-cnt))) - (set! arg1 (the-as int (-> s5-0 s3-0 v0))) - (let ((v1-25 (-> s5-0 s3-0 v1))) - (set! (-> arg0 data a0-13 v0) (the-as uint arg1)) - (set! (-> arg0 data a0-13 v1) (the-as uint s3-0)) - (set! (-> arg0 data a0-13 v2) v1-25) - (+! (-> arg0 tri-cnt) 1) - (set! (-> s5-0 (the-as uint arg1) v1) v1-25) - (set! (-> s5-0 v1-25 v0) (the-as uint arg1)) - ) + (loop + (when (= (-> s5-0 (-> s5-0 (-> s5-0 arg1 v0) v0) v0) arg1) + (let ((v1-10 (-> arg0 tri-cnt))) + (set! (-> arg0 data v1-10 v0) (the-as uint arg1)) + (set! (-> arg0 data v1-10 v1) (-> s5-0 arg1 v0)) + (set! (-> arg0 data v1-10 v2) (-> s5-0 (-> s5-0 arg1 v0) v0)) + ) + (+! (-> arg0 tri-cnt) 1) + (return 0) + ) + (let ((s3-0 arg1)) + (while (not (try-corner arg0 s3-0)) + (set! s3-0 (the-as int (-> s5-0 s3-0 v1))) + (when (= (the-as uint s3-0) arg1) + ) + ) + (let ((a0-13 (-> arg0 tri-cnt))) + (set! arg1 (the-as int (-> s5-0 s3-0 v0))) + (let ((v1-25 (-> s5-0 s3-0 v1))) + (set! (-> arg0 data a0-13 v0) (the-as uint arg1)) + (set! (-> arg0 data a0-13 v1) (the-as uint s3-0)) + (set! (-> arg0 data a0-13 v2) v1-25) + (+! (-> arg0 tri-cnt) 1) + (set! (-> s5-0 (the-as uint arg1) v1) v1-25) + (set! (-> s5-0 v1-25 v0) (the-as uint arg1)) + ) + ) + ) ) - ) ) - ) 0 (none) ) (defun fix-boundary-normals ((arg0 load-boundary)) (dotimes (s5-0 (-> arg0 tri-cnt)) - (let ((a1-0 (-> arg0 data (-> arg0 data s5-0 v0))) - (a2-0 (-> arg0 data (-> arg0 data s5-0 v1))) - (a3-0 (-> arg0 data (-> arg0 data s5-0 v2))) - (s4-0 (new 'stack-no-clear 'vector)) - ) - (normal-of-plane - s4-0 - (the-as vector a1-0) - (the-as vector a2-0) - (the-as vector a3-0) - ) - (if (or (!= (-> s4-0 x) 0.0) (!= (-> s4-0 z) 0.0)) - (format 0 "ERROR in the load-boundary code : tell Eddie!!!~%") - ) - (when (< (-> s4-0 y) 0.0) - (let ((v1-22 (-> arg0 data s5-0 v0))) - (set! (-> arg0 data s5-0 v0) (-> arg0 data s5-0 v1)) - (set! (-> arg0 data s5-0 v1) v1-22) + (let ((a1-0 (-> arg0 data (-> arg0 data s5-0 v0))) + (a2-0 (-> arg0 data (-> arg0 data s5-0 v1))) + (a3-0 (-> arg0 data (-> arg0 data s5-0 v2))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (normal-of-plane s4-0 (the-as vector a1-0) (the-as vector a2-0) (the-as vector a3-0)) + (if (or (!= (-> s4-0 x) 0.0) (!= (-> s4-0 z) 0.0)) + (format 0 "ERROR in the load-boundary code : tell Eddie!!!~%") + ) + (when (< (-> s4-0 y) 0.0) + (let ((v1-22 (-> arg0 data s5-0 v0))) + (set! (-> arg0 data s5-0 v0) (-> arg0 data s5-0 v1)) + (set! (-> arg0 data s5-0 v1) v1-22) + ) + ) ) - ) ) - ) 0 (none) ) (defun point-in-polygon ((arg0 load-boundary) (arg1 vector)) (dotimes (v1-0 (-> arg0 tri-cnt)) - (let* ((a2-5 (-> arg0 data (-> arg0 data v1-0 v0))) - (t0-0 (-> arg0 data (-> arg0 data v1-0 v1))) - (a3-10 (-> arg0 data (-> arg0 data v1-0 v2))) - (f0-1 (- (-> t0-0 x) (-> a3-10 x))) - (f1-2 (- (-> t0-0 z) (-> a3-10 z))) - (f2-2 (- (-> t0-0 x) (-> arg1 x))) - (f3-2 (- (-> t0-0 z) (-> arg1 z))) - ) - (when (>= (- (* f2-2 f1-2) (* f0-1 f3-2)) 0.0) - (let ((f0-5 (- (-> t0-0 x) (-> arg1 x))) - (f1-7 (- (-> t0-0 z) (-> arg1 z))) - (f2-5 (- (-> t0-0 x) (-> a2-5 x))) - (f3-5 (- (-> t0-0 z) (-> a2-5 z))) + (let* ((a2-5 (-> arg0 data (-> arg0 data v1-0 v0))) + (t0-0 (-> arg0 data (-> arg0 data v1-0 v1))) + (a3-10 (-> arg0 data (-> arg0 data v1-0 v2))) + (f0-1 (- (-> t0-0 x) (-> a3-10 x))) + (f1-2 (- (-> t0-0 z) (-> a3-10 z))) + (f2-2 (- (-> t0-0 x) (-> arg1 x))) + (f3-2 (- (-> t0-0 z) (-> arg1 z))) ) - (when (>= (- (* f2-5 f1-7) (* f0-5 f3-5)) 0.0) - (let ((f0-9 (- (-> arg1 x) (-> a3-10 x))) - (f1-12 (- (-> arg1 z) (-> a3-10 z))) - (f2-8 (- (-> arg1 x) (-> a2-5 x))) - (f3-8 (- (-> arg1 z) (-> a2-5 z))) - ) - (if (>= (- (* f2-8 f1-12) (* f0-9 f3-8)) 0.0) - (return #t) - ) + (when (>= (- (* f2-2 f1-2) (* f0-1 f3-2)) 0.0) + (let ((f0-5 (- (-> t0-0 x) (-> arg1 x))) + (f1-7 (- (-> t0-0 z) (-> arg1 z))) + (f2-5 (- (-> t0-0 x) (-> a2-5 x))) + (f3-5 (- (-> t0-0 z) (-> a2-5 z))) + ) + (when (>= (- (* f2-5 f1-7) (* f0-5 f3-5)) 0.0) + (let ((f0-9 (- (-> arg1 x) (-> a3-10 x))) + (f1-12 (- (-> arg1 z) (-> a3-10 z))) + (f2-8 (- (-> arg1 x) (-> a2-5 x))) + (f3-8 (- (-> arg1 z) (-> a2-5 z))) + ) + (if (>= (- (* f2-8 f1-12) (* f0-9 f3-8)) 0.0) + (return #t) + ) + ) + ) + ) ) - ) ) - ) ) - ) #f ) (defun check-closed-boundary ((arg0 load-boundary) (arg1 lbvtx) (arg2 lbvtx)) - (if - (and (< (-> arg0 top-plane) (-> arg1 y)) (< (-> arg0 top-plane) (-> arg2 y))) - (return (the-as symbol 0)) - ) - (if - (and (< (-> arg1 y) (-> arg0 top-plane)) (< (-> arg2 y) (-> arg0 top-plane))) - (return (the-as symbol 0)) - ) - (let - ((f0-6 (/ (- (-> arg1 y) (-> arg2 y)) (- (-> arg0 top-plane) (-> arg2 y)))) - (a1-1 (new 'stack-no-clear 'vector)) - ) - (set! (-> a1-1 x) (+ (-> arg2 x) (* f0-6 (- (-> arg1 x) (-> arg2 x))))) - (set! (-> a1-1 y) (+ (-> arg2 y) (* f0-6 (- (-> arg1 y) (-> arg2 y))))) - (set! (-> a1-1 z) (+ (-> arg2 z) (* f0-6 (- (-> arg1 z) (-> arg2 z))))) - (when (point-in-polygon arg0 a1-1) - (if (< (-> arg0 top-plane) (-> arg1 y)) - (return (the-as symbol 2)) - ) - (return (the-as symbol 1)) + (if (and (< (-> arg0 top-plane) (-> arg1 y)) (< (-> arg0 top-plane) (-> arg2 y))) + (return (the-as symbol 0)) + ) + (if (and (< (-> arg1 y) (-> arg0 top-plane)) (< (-> arg2 y) (-> arg0 top-plane))) + (return (the-as symbol 0)) + ) + (let ((f0-6 (/ (- (-> arg1 y) (-> arg2 y)) (- (-> arg0 top-plane) (-> arg2 y)))) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-1 x) (+ (-> arg2 x) (* f0-6 (- (-> arg1 x) (-> arg2 x))))) + (set! (-> a1-1 y) (+ (-> arg2 y) (* f0-6 (- (-> arg1 y) (-> arg2 y))))) + (set! (-> a1-1 z) (+ (-> arg2 z) (* f0-6 (- (-> arg1 z) (-> arg2 z))))) + (when (point-in-polygon arg0 a1-1) + (if (< (-> arg0 top-plane) (-> arg1 y)) + (return (the-as symbol 2)) + ) + (return (the-as symbol 1)) + ) ) - ) (the-as symbol 0) ) @@ -1402,65 +1329,55 @@ (a3-0 1) (v1-0 0) ) - (if (and (= f0-0 f2-0) (= f1-0 f3-0)) - (return (the-as symbol 0)) - ) - (let ((f4-0 (- f2-0 f0-0)) - (f5-0 (- f3-0 f1-0)) - ) - (while (< a3-0 (the-as int (-> arg0 num-points))) - (let ((f8-0 (-> arg0 data a3-0 x)) - (f9-0 (-> arg0 data a3-0 z)) - ) - (let ((f10-2 (- (* (- f7-0 f1-0) f4-0) (* (- f6-0 f0-0) f5-0))) - (f11-4 - (- (* (- f7-0 f1-0) (- f8-0 f6-0)) (* (- f6-0 f0-0) (- f9-0 f7-0))) - ) - (f12-5 (- (* (- f8-0 f6-0) f5-0) (* (- f9-0 f7-0) f4-0))) - ) - (when (!= f12-5 0.0) - (let ((f10-3 (/ f10-2 f12-5)) - (f11-5 (/ f11-4 f12-5)) - ) - (if (and (>= f10-3 0.0) (>= 1.0 f10-3)) - 0 + (if (and (= f0-0 f2-0) (= f1-0 f3-0)) + (return (the-as symbol 0)) + ) + (let ((f4-0 (- f2-0 f0-0)) + (f5-0 (- f3-0 f1-0)) ) - (when (and (>= f10-3 0.0) (>= 1.0 f10-3) (< 0.0 f11-5) (>= 1.0 f11-5)) - (let ((f10-5 (+ (-> arg2 y) (* f10-3 (- (-> arg1 y) (-> arg2 y)))))) - (when - (and (>= f10-5 (-> arg0 bot-plane)) (>= (-> arg0 top-plane) f10-5)) - (let - ((f6-3 - (- - (* (- f2-0 f6-0) (- f9-0 f7-0)) - (* (- f3-0 f7-0) (- f8-0 f6-0)) - ) - ) + (while (< a3-0 (the-as int (-> arg0 num-points))) + (let ((f8-0 (-> arg0 data a3-0 x)) + (f9-0 (-> arg0 data a3-0 z)) ) - (if (< 0.0 f6-3) - (+! v1-0 1) - (+! v1-0 -1) + (let ((f10-2 (- (* (- f7-0 f1-0) f4-0) (* (- f6-0 f0-0) f5-0))) + (f11-4 (- (* (- f7-0 f1-0) (- f8-0 f6-0)) (* (- f6-0 f0-0) (- f9-0 f7-0)))) + (f12-5 (- (* (- f8-0 f6-0) f5-0) (* (- f9-0 f7-0) f4-0))) + ) + (when (!= f12-5 0.0) + (let ((f10-3 (/ f10-2 f12-5)) + (f11-5 (/ f11-4 f12-5)) + ) + (if (and (>= f10-3 0.0) (>= 1.0 f10-3)) + 0 + ) + (when (and (>= f10-3 0.0) (>= 1.0 f10-3) (< 0.0 f11-5) (>= 1.0 f11-5)) + (let ((f10-5 (+ (-> arg2 y) (* f10-3 (- (-> arg1 y) (-> arg2 y)))))) + (when (and (>= f10-5 (-> arg0 bot-plane)) (>= (-> arg0 top-plane) f10-5)) + (let ((f6-3 (- (* (- f2-0 f6-0) (- f9-0 f7-0)) (* (- f3-0 f7-0) (- f8-0 f6-0))))) + (if (< 0.0 f6-3) + (+! v1-0 1) + (+! v1-0 -1) + ) + ) + ) + ) + ) + ) ) - ) ) - ) + (set! f6-0 f8-0) + (set! f7-0 f9-0) ) - ) + (+! a3-0 1) ) - ) - (set! f6-0 f8-0) - (set! f7-0 f9-0) ) - (+! a3-0 1) - ) - ) - (if (> v1-0 0) - (return (the-as symbol 1)) - ) - (if (< v1-0 0) - (return (the-as symbol 2)) + (if (> v1-0 0) + (return (the-as symbol 1)) + ) + (if (< v1-0 0) + (return (the-as symbol 2)) + ) ) - ) (the-as symbol 0) ) @@ -1470,104 +1387,110 @@ (defun command-get-int ((arg0 object) (arg1 int)) (cond - ((null? arg0) - arg1 - ) - ((type-type? (rtype-of arg0) binteger) - (/ (the-as int arg0) 8) - ) - ((type-type? (rtype-of arg0) bfloat) - (the int (-> (the-as bfloat arg0) data)) - ) - (else - arg1 + ((null? arg0) + (empty) + arg1 + ) + ((type-type? (rtype-of arg0) binteger) + (/ (the-as int arg0) 8) + ) + ((type-type? (rtype-of arg0) bfloat) + (the int (-> (the-as bfloat arg0) data)) + ) + (else + (empty) + arg1 + ) ) - ) ) (defun command-get-float ((arg0 object) (arg1 float)) (cond - ((null? arg0) - arg1 - ) - ((type-type? (rtype-of arg0) binteger) - (the float (/ (the-as int arg0) 8)) - ) - ((type-type? (rtype-of arg0) bfloat) - (-> (the-as bfloat arg0) data) - ) - (else - arg1 + ((null? arg0) + (empty) + arg1 + ) + ((type-type? (rtype-of arg0) binteger) + (the float (/ (the-as int arg0) 8)) + ) + ((type-type? (rtype-of arg0) bfloat) + (-> (the-as bfloat arg0) data) + ) + (else + (empty) + arg1 + ) ) - ) ) (defun command-get-time ((arg0 object) (arg1 int)) (cond - ((null? arg0) - arg1 - ) - ((and (pair? arg0) (= (car arg0) 'seconds)) - (the int (* 300.0 (command-get-float (car (cdr arg0)) 0.0))) - ) - ((type-type? (rtype-of arg0) binteger) - (/ (the-as int arg0) 8) - ) - ((type-type? (rtype-of arg0) bfloat) - (the int (-> (the-as bfloat arg0) data)) - ) - (else - arg1 + ((null? arg0) + (empty) + arg1 + ) + ((and (pair? arg0) (= (car arg0) 'seconds)) + (the int (* 300.0 (command-get-float (car (cdr arg0)) 0.0))) + ) + ((type-type? (rtype-of arg0) binteger) + (/ (the-as int arg0) 8) + ) + ((type-type? (rtype-of arg0) bfloat) + (the int (-> (the-as bfloat arg0) data)) + ) + (else + (empty) + arg1 + ) ) - ) ) (defun command-get-param ((arg0 object) (arg1 object)) (cond - ((null? arg0) - arg1 - ) - ((and (pair? arg0) (= (car arg0) 'seconds)) - (the int (* 300.0 (command-get-float (car (cdr arg0)) 0.0))) - ) - ((and (pair? arg0) (= (car arg0) 'meters)) - (* 4096.0 (command-get-float (car (cdr arg0)) 0.0)) - ) - ((and (pair? arg0) (= (car arg0) 'deg)) - (* 182.04445 (command-get-float (car (cdr arg0)) 0.0)) - ) - ((and (pair? arg0) (= (car arg0) 'static-vectorm)) - (let ((s4-0 (the-as object (new 'static 'vector)))) - (set-vector! - (the-as vector s4-0) - (* 4096.0 (command-get-float (car (cdr arg0)) 0.0)) - (* 4096.0 (command-get-float (car (cdr (cdr arg0))) 0.0)) - (* 4096.0 (command-get-float (car (cdr (cdr (cdr arg0)))) 0.0)) - 1.0 - ) - s4-0 + ((null? arg0) + arg1 ) + ((and (pair? arg0) (= (car arg0) 'seconds)) + (the int (* 300.0 (command-get-float (car (cdr arg0)) 0.0))) + ) + ((and (pair? arg0) (= (car arg0) 'meters)) + (* 4096.0 (command-get-float (car (cdr arg0)) 0.0)) + ) + ((and (pair? arg0) (= (car arg0) 'deg)) + (* 182.04445 (command-get-float (car (cdr arg0)) 0.0)) + ) + ((and (pair? arg0) (= (car arg0) 'static-vectorm)) + (let ((s4-0 (the-as object (new 'static 'vector)))) + (set-vector! + (the-as vector s4-0) + (* 4096.0 (command-get-float (car (cdr arg0)) 0.0)) + (* 4096.0 (command-get-float (car (cdr (cdr arg0))) 0.0)) + (* 4096.0 (command-get-float (car (cdr (cdr (cdr arg0)))) 0.0)) + 1.0 + ) + s4-0 + ) + ) + ((type-type? (rtype-of arg0) binteger) + (/ (the-as int arg0) 8) + ) + ((type-type? (rtype-of arg0) bfloat) + (-> (the-as bfloat arg0) data) + ) + (else + arg0 + ) ) - ((type-type? (rtype-of arg0) binteger) - (/ (the-as int arg0) 8) - ) - ((type-type? (rtype-of arg0) bfloat) - (-> (the-as bfloat arg0) data) - ) - (else - arg0 - ) - ) ) (defun command-get-quoted-param ((arg0 object) (arg1 object)) (if (and (pair? arg0) (= (car arg0) 'quote)) - (command-get-param (car (cdr arg0)) arg1) - (command-get-param arg0 arg1) - ) + (command-get-param (car (cdr arg0)) arg1) + (command-get-param arg0 arg1) + ) ) -(defmethod reset! load-state ((this load-state)) +(defmethod reset! ((this load-state)) (set! (-> this want 0 name) #f) (set! (-> this want 0 display?) #f) (set! (-> this want 0 force-vis?) #f) @@ -1578,87 +1501,87 @@ (set! (-> this want 1 force-inside?) #f) (set! (-> this command-list) '()) (dotimes (v1-1 256) - (set! (-> this object-name v1-1) #f) - (set! (-> this object-status v1-1) (the-as basic 0)) - ) + (set! (-> this object-name v1-1) #f) + (set! (-> this object-status v1-1) (the-as basic 0)) + ) this ) -(defmethod want-levels load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-levels ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) - (cond - ((= (-> this want v1-0 name) arg0) - (set! arg0 #f) - ) - ((= (-> this want v1-0 name) arg1) - (set! arg1 #f) - ) - (else - (set! (-> this want v1-0 name) #f) - ) + (cond + ((= (-> this want v1-0 name) arg0) + (set! arg0 #f) + ) + ((= (-> this want v1-0 name) arg1) + (set! arg1 #f) + ) + (else + (set! (-> this want v1-0 name) #f) + ) + ) ) - ) (when arg0 - (dotimes (v1-4 2) - (when (not (-> this want v1-4 name)) - (set! (-> this want v1-4 name) arg0) - (set! (-> this want v1-4 display?) #f) - (set! (-> this want v1-4 force-vis?) #f) - (set! (-> this want v1-4 force-inside?) #f) - (set! v1-4 2) - ) + (dotimes (v1-4 2) + (when (not (-> this want v1-4 name)) + (set! (-> this want v1-4 name) arg0) + (set! (-> this want v1-4 display?) #f) + (set! (-> this want v1-4 force-vis?) #f) + (set! (-> this want v1-4 force-inside?) #f) + (set! v1-4 2) + ) + ) ) - ) (when arg1 - (dotimes (v1-10 2) - (when (not (-> this want v1-10 name)) - (set! (-> this want v1-10 name) arg1) - (set! (-> this want v1-10 display?) #f) - (set! (-> this want v1-10 force-vis?) #f) - (set! (-> this want v1-10 force-inside?) #f) - (set! v1-10 2) - ) + (dotimes (v1-10 2) + (when (not (-> this want v1-10 name)) + (set! (-> this want v1-10 name) arg1) + (set! (-> this want v1-10 display?) #f) + (set! (-> this want v1-10 force-vis?) #f) + (set! (-> this want v1-10 force-inside?) #f) + (set! v1-10 2) + ) + ) ) - ) 0 ) -(defmethod want-display-level load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-display-level ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) - (when (= (-> this want v1-0 name) arg0) - (set! (-> this want v1-0 display?) arg1) - (return 0) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 display?) arg1) + (return 0) + ) ) - ) (if arg1 - (format 0 "ERROR: can't display ~A because it isn't loaded~%" arg0) - ) + (format 0 "ERROR: can't display ~A because it isn't loaded~%" arg0) + ) 0 ) -(defmethod want-vis load-state ((this load-state) (arg0 symbol)) +(defmethod want-vis ((this load-state) (arg0 symbol)) (set! (-> this vis-nick) arg0) 0 ) -(defmethod want-force-vis load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-force-vis ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) - (when (= (-> this want v1-0 name) arg0) - (set! (-> this want v1-0 force-vis?) arg1) - (return 0) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 force-vis?) arg1) + (return 0) + ) ) - ) (format 0 "ERROR: can't force vis on ~A because it isn't loaded~%" arg0) 0 ) -(defmethod set-force-inside! load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod set-force-inside! ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) - (when (= (-> this want v1-0 name) arg0) - (set! (-> this want v1-0 force-inside?) arg1) - (return 0) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 force-inside?) arg1) + (return 0) + ) ) - ) (format 0 "ERROR: can't force inside on ~A because it isn't loaded~%" arg0) 0 (none) @@ -1683,172 +1606,151 @@ (define *display-load-commands* #f) (define *backup-load-state* (new 'global 'load-state)) -(defmethod backup-load-state-and-set-cmds load-state ((this load-state) (arg0 pair)) +(defmethod backup-load-state-and-set-cmds ((this load-state) (arg0 pair)) (dotimes (s4-0 256) - (when (-> this object-name s4-0) - (format 0 "WARNING: load state somehow aquired object command ~A~%" - (-> this object-name s4-0) - ) - (set! (-> this object-name s4-0) #f) + (when (-> this object-name s4-0) + (format 0 "WARNING: load state somehow aquired object command ~A~%" (-> this object-name s4-0)) + (set! (-> this object-name s4-0) #f) + ) ) - ) (mem-copy! (&-> *backup-load-state* type) (&-> this type) 2092) (set! (-> *backup-load-state* command-list) '()) (set! (-> this command-list) arg0) 0 ) -(defmethod restore-load-state-and-cleanup load-state ((this load-state)) +(defmethod restore-load-state-and-cleanup ((this load-state)) (execute-commands-up-to this 100000.0) (dotimes (s5-0 256) - (when (-> this object-name s5-0) - (let ((a0-3 (entity-by-name (the-as string (-> this object-name s5-0))))) - (set! - (-> a0-3 extra perm status) - (the-as entity-perm-status (-> this object-status s5-0)) - ) - (if (-> a0-3 extra process) - (kill! a0-3) + (when (-> this object-name s5-0) + (let ((a0-3 (entity-by-name (the-as string (-> this object-name s5-0))))) + (set! (-> a0-3 extra perm status) (the-as entity-perm-status (-> this object-status s5-0))) + (if (-> a0-3 extra process) + (kill! a0-3) + ) + ) + (set! (-> this object-name s5-0) #f) ) - ) - (set! (-> this object-name s5-0) #f) ) - ) (mem-copy! (&-> this type) (&-> *backup-load-state* type) 2092) 0 ) -(defmethod restore-load-state load-state ((this load-state)) +(defmethod restore-load-state ((this load-state)) (dotimes (v1-0 256) - (if (-> this object-name v1-0) - (set! (-> this object-name v1-0) #f) + (if (-> this object-name v1-0) + (set! (-> this object-name v1-0) #f) + ) ) - ) (mem-copy! (&-> this type) (&-> *backup-load-state* type) 2092) 0 ) +;; ERROR: Failed load: (set! a0-1 (l.wu (+ a0-0 -4))) at op 11 (defun command-list-get-process ((arg0 object)) (with-pp - (set! arg0 (cond - ((null? arg0) - #f - ) - ((type-type? (rtype-of arg0) process) - (empty) - arg0 - ) - ((= arg0 'target) - *target* - ) - ((= arg0 'sidekick) - (if *target* + (set! arg0 + (cond + ((null? arg0) + #f + ) + ((type-type? (rtype-of arg0) process) + (empty) + arg0 + ) + ((= arg0 'target) + *target* + ) + ((= arg0 'sidekick) + (if *target* (ppointer->process (-> *target* sidekick)) ) - ) - ((= arg0 'self) - pp - ) - ((= arg0 'parent) - (ppointer->process (-> pp parent)) - ) - ((= arg0 'camera) - *camera* - ) - ((type-type? (rtype-of arg0) string) - (let ((v1-14 (process-by-ename (the-as string arg0)))) - (cond - (v1-14 + ) + ((= arg0 'self) + pp + ) + ((= arg0 'parent) + (ppointer->process (-> pp parent)) + ) + ((= arg0 'camera) + *camera* + ) + ((type-type? (rtype-of arg0) string) + (let ((v1-14 (process-by-ename (the-as string arg0)))) + (cond + (v1-14 (empty) v1-14 ) - (else + (else (let ((s5-0 (ppointer->process (-> pp child)))) - (while s5-0 - (let* ((s3-0 s5-0) - (s4-0 - (if - (and - (nonzero? s3-0) - (type-type? (-> s3-0 type) process-drawable) - ) - s3-0 + (while s5-0 + (let* ((s3-0 s5-0) + (s4-0 (if (and (nonzero? s3-0) (type-type? (-> s3-0 type) process-drawable)) + s3-0 + ) + ) ) - ) - ) - (when - (and - s4-0 - (nonzero? (-> (the-as process-drawable s4-0) draw)) - (nonzero? - (-> (the-as process-drawable s4-0) draw art-group) - ) - (string= - (the-as string arg0) - (-> (the-as process-drawable s4-0) draw art-group name) + (when (and s4-0 + (nonzero? (-> (the-as process-drawable s4-0) draw)) + (nonzero? (-> (the-as process-drawable s4-0) draw art-group)) + (string= (the-as string arg0) (-> (the-as process-drawable s4-0) draw art-group name)) + ) + (set! arg0 s4-0) + (goto cfg-56) + ) ) - ) - (set! arg0 s4-0) - (goto cfg-56) + (set! s5-0 (ppointer->process (-> s5-0 brother))) ) - ) - (set! s5-0 (ppointer->process (-> s5-0 brother))) ) - ) (the-as process #f) ) - ) ) - ) - (else - #f - ) ) + ) + (else + #f + ) + ) + ) + (label cfg-56) + (the-as process arg0) ) - (label cfg-56) - (the-as process arg0) - ) ) -(defmethod execute-commands-up-to load-state ((this load-state) (arg0 float)) +(defmethod execute-commands-up-to ((this load-state) (arg0 float)) (while (not (null? (-> this command-list))) - (let ((f0-0 (command-get-float (car (car (-> this command-list))) 0.0)) - (s4-0 (cdr (car (-> this command-list)))) + (let ((f0-0 (command-get-float (car (car (-> this command-list))) 0.0)) + (s4-0 (cdr (car (-> this command-list)))) + ) + (if (< arg0 f0-0) + (return (the-as int #f)) + ) + (if *display-load-commands* + (format 0 "NOTICE: ~D: ~f: execute command ~A~%" (current-time) f0-0 s4-0) + ) + (cond + ((pair? (car s4-0)) + (let ((a1-3 (car s4-0))) + (while (not (null? s4-0)) + (execute-command this (the-as pair a1-3)) + (set! s4-0 (cdr s4-0)) + (set! a1-3 (car s4-0)) + ) + ) ) - (if (< arg0 f0-0) - (return (the-as int #f)) - ) - (if *display-load-commands* - (format - 0 - "NOTICE: ~D: ~f: execute command ~A~%" - (-> *display* base-frame-counter) - f0-0 - s4-0 - ) - ) - (cond - ((pair? (car s4-0)) - (let ((a1-3 (car s4-0))) - (while (not (null? s4-0)) - (execute-command this (the-as pair a1-3)) - (set! s4-0 (cdr s4-0)) - (set! a1-3 (car s4-0)) + (else + (execute-command this s4-0) + ) ) - ) - ) - (else - (execute-command this s4-0) ) - ) + (set! (-> this command-list) (cdr (-> this command-list))) ) - (set! (-> this command-list) (cdr (-> this command-list))) - ) 0 ) -(defmethod execute-command load-state ((this load-state) (arg0 pair)) +(defmethod execute-command ((this load-state) (arg0 pair)) (local-vars (v1-26 int) (v1-57 int)) (with-pp (cond diff --git a/goal_src/jak1/engine/load/decomp-h.gc b/goal_src/jak1/engine/load/decomp-h.gc index 8d11fe63ddb..7a25e80f236 100644 --- a/goal_src/jak1/engine/load/decomp-h.gc +++ b/goal_src/jak1/engine/load/decomp-h.gc @@ -10,12 +10,9 @@ ;; temporary storage for visibility data decompression. ;; this is stored on the scratchpad. (deftype decomp-work (structure) - ((buffer0 uint8 2048 :offset-assert 0) - (buffer1 uint8 2048 :offset-assert 2048) - (indices uint16 2048 :offset-assert 4096) - (temp-indices uint16 2048 :offset-assert 8192) + ((buffer0 uint8 2048) + (buffer1 uint8 2048) + (indices uint16 2048) + (temp-indices uint16 2048) ) - :method-count-assert 9 - :size-assert #x3000 - :flag-assert #x900003000 - ) \ No newline at end of file + ) diff --git a/goal_src/jak1/engine/load/decomp.gc b/goal_src/jak1/engine/load/decomp.gc index 32ee747e746..e7bbf35c693 100644 --- a/goal_src/jak1/engine/load/decomp.gc +++ b/goal_src/jak1/engine/load/decomp.gc @@ -17,32 +17,38 @@ "Unpack run-length-encoded data. Has sections of repeated values, then normally copied." (local-vars (current-input int) (copy-length int)) (nop!) - (while #t - (while #t - + (loop + (loop + ;; read the input and see what kind it is, based on number. (set! current-input (-> in 0)) (set! in (&-> in 1)) (b! (<= current-input 0) cfg-5 :delay (nop!)) - + ;; it's a repated value, loop to copy it. (let ((repeated-value (-> in 0))) (set! in (&-> in 1)) (label cfg-3) + (nop!) + (nop!) + (nop!) + (nop!) (set! (-> out 0) repeated-value) ) (set! out (&-> out 1)) (b! (> current-input 0) cfg-3 :delay (set! current-input (+ current-input -1))) ) - + (label cfg-5) ;; check for end (b! (zero? current-input) cfg-8 :delay (set! copy-length (- current-input))) - + ;; copy (label cfg-6) (let ((src-val (-> in 0))) (set! in (&-> in 1)) + (nop!) + (nop!) (set! (-> out 0) src-val) ) (+! copy-length -1) @@ -53,19 +59,17 @@ (none) ) - (deftype huf-dictionary-node (structure) - ((zero uint16 :offset-assert 0) - (one uint16 :offset-assert 2) + ((zero uint16) + (one uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) + (defun unpack-comp-huf ((dst (pointer uint8)) (src (pointer uint8)) (arg2 uint) (dict huf-dictionary-node)) "Unpack data compressed with huffman encoding." (local-vars (t1-1 uint) (t3-2 object)) + (nop!) (let ((t1-0 (-> dict zero)) (a2-1 (+ arg2 -1028)) (t2-0 (-> dict one)) @@ -89,13 +93,9 @@ (let ((t3-1 (* t1-1 4))) (b! (< (the-as int t2-1) 0) cfg-8 :delay (set! t3-2 (+ t3-1 a2-1))) ) - (b! (zero? t2-1) cfg-10 - :delay (set! t1-0 (-> (the-as (pointer uint16) t3-2) 0)) - ) + (b! (zero? t2-1) cfg-10 :delay (set! t1-0 (-> (the-as (pointer uint16) t3-2) 0))) ) - (b! (nonzero? v1-4) cfg-2 - :delay (set! t2-0 (-> (the-as (pointer uint16) t3-2) 1)) - ) + (b! (nonzero? v1-4) cfg-2 :delay (set! t2-0 (-> (the-as (pointer uint16) t3-2) 1))) (b! #t cfg-1 :delay (nop!)) (label cfg-8) (set! (-> dst 0) t1-1) @@ -113,7 +113,7 @@ (none) ) -(defmethod update-vis! level ((this level) (vis-info level-vis-info) (arg1 uint) (arg2 uint)) +(defmethod update-vis! ((this level) (vis-info level-vis-info) (arg1 uint) (arg2 uint)) "Update the vis-bits for the level with the given vis info. arg1 unused. if the vis-file flag isn't set, will use arg2 as vis data." (local-vars (t0-3 uint128) (vis-buffer object)) @@ -343,4 +343,4 @@ ) ) ) - ) \ No newline at end of file + ) diff --git a/goal_src/jak1/engine/load/file-io.gc b/goal_src/jak1/engine/load/file-io.gc index 97c38d27a38..4944ec75021 100644 --- a/goal_src/jak1/engine/load/file-io.gc +++ b/goal_src/jak1/engine/load/file-io.gc @@ -22,17 +22,14 @@ ;; DECOMP BEGINS (deftype file-stream (basic) - ((flags uint32 :offset-assert 4) - (mode symbol :offset-assert 8) - (name string :offset-assert 12) - (file uint32 :offset-assert 16) + ((flags uint32) + (mode symbol) + (name string) + (file uint32) ) (:methods - (new (symbol type string symbol) _type_) - ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 + (new (symbol type string symbol) _type_) + ) ) (defconstant SCE_SEEK_SET 0) @@ -49,9 +46,8 @@ (defmethod new file-stream ((allocation symbol) (type-to-make type) (name string) (mode symbol)) "Allocate a file-stream and open it." - (let ((stream (object-new allocation type-to-make))) - (file-stream-open stream name mode) - stream + (let ((a0-1 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (file-stream-open a0-1 name mode) ) ) @@ -72,17 +68,14 @@ ;; A common file header found in GOAL files. (deftype file-info (basic) - ((file-type symbol :offset-assert 4) - (file-name basic :offset-assert 8) - (major-version uint32 :offset-assert 12) - (minor-version uint32 :offset-assert 16) - (maya-file-name basic :offset-assert 20) - (tool-debug basic :offset-assert 24) - (mdb-file-name basic :offset-assert 28) + ((file-type symbol) + (file-name basic) + (major-version uint32) + (minor-version uint32) + (maya-file-name basic) + (tool-debug basic) + (mdb-file-name basic) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (defmethod print file-info ((this file-info)) diff --git a/goal_src/jak1/engine/load/load-dgo.gc b/goal_src/jak1/engine/load/load-dgo.gc index 6c818930a57..5b2245757fc 100644 --- a/goal_src/jak1/engine/load/load-dgo.gc +++ b/goal_src/jak1/engine/load/load-dgo.gc @@ -26,18 +26,15 @@ ;; load command sent to the IOP to load a DGO. ;; The OVERLORD responds with the same message. (deftype load-dgo-msg (structure) - ((rsvd uint16 :offset-assert 0) ;; unused? - (result load-msg-result :offset-assert 2) ;; status from OVERLORD - (b1 pointer :offset-assert 4) ;; EE -> OVERLORD, first temp load buffer - (b2 pointer :offset-assert 8) ;; EE -> OVERLORD, second temp load buffer - (bt pointer :offset-assert 12) ;; EE -> OVERLORD, location of heap - (name uint128 :offset-assert 16) ;; EE -> OVERLORD, name of file. - (name-chars uint8 16 :offset 16) ;; name of file (as chars) - (address uint32 :offset 4) ;; OVERLORD -> EE, location of loaded file. + ((rsvd uint16) + (result load-msg-result) + (b1 pointer) + (b2 pointer) + (bt pointer) + (name uint128) + (name-chars uint8 16 :overlay-at name) + (address uint32 :overlay-at b1) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) #| @@ -54,17 +51,14 @@ struct RPC_Dgo_Cmd { ;; load commmand/response for loading a chunk of a file. ;; It can either be an entire file, or a section of a STR file. (deftype load-chunk-msg (structure) - ((rsvd uint16 :offset-assert 0) ;; unused? - (result load-msg-result :offset-assert 2) ;; only done or error. - (address pointer :offset-assert 4) ;; where to load to - (section uint32 :offset-assert 8) ;; chunk ID, or -1 for the whole file. - (maxlen uint32 :offset-assert 12) ;; maximum length to load. - (id uint32 :offset 4) ;; ? same as chunk - (basename uint8 48 :offset-assert 16) ;; name of file to load. + ((rsvd uint16) + (result load-msg-result) + (address pointer) + (section uint32) + (maxlen uint32) + (id uint32 :overlay-at address) + (basename uint8 48) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) #| @@ -81,14 +75,10 @@ struct RPC_Str_Cmd { ;; The header of a DGO file (deftype dgo-header (structure) - ((length uint32 :offset-assert 0) ;; number of object files contained. - (rootname uint8 60 :offset-assert 4) - ;; added data field - (data uint8 :dynamic :offset-assert 64) + ((length uint32) + (rootname uint8 60) + (data uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) #| diff --git a/goal_src/jak1/engine/load/loader-h.gc b/goal_src/jak1/engine/load/loader-h.gc index 31272cae0d0..454200945e4 100644 --- a/goal_src/jak1/engine/load/loader-h.gc +++ b/goal_src/jak1/engine/load/loader-h.gc @@ -19,32 +19,26 @@ ;; DECOMP BEGINS ;; A load-dir is a collection of references to loaded art. -;; This type didn't have a nomral inspect method, so these field names are made up. +;; This type didn't have a normal inspect method, so these field names are made up. (declare-type art-group basic) (deftype load-dir (basic) - ((lev level :offset-assert 4) - (string-array (array string) :offset-assert 8) ;; these are the names - (data-array (array basic) :offset-assert 12) ;; this is the file data. + ((lev level) + (string-array (array string)) ;; these are the names + (data-array (array basic)) ;; this is the file data. ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (new (symbol type int level) _type_ 0) - (load-to-heap-by-name (_type_ string symbol kheap int) art-group 9) - (set-loaded-art (_type_ art-group) art-group 10) + (new (symbol type int level) _type_) + (load-to-heap-by-name (_type_ string symbol kheap int) art-group) + (set-loaded-art (_type_ art-group) art-group) ) ) ;; specialization of load-dir where the data-array holds art-groups. (deftype load-dir-art-group (load-dir) - ((art-group-array (array art-group) :offset 12) + ((art-group-array (array art-group) :overlay-at data-array) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (new (symbol type int level) _type_ 0) + (new (symbol type int level) _type_) ) ) @@ -94,104 +88,96 @@ ;; Note: a locked buffer has loaded/linked the file, but hasn't linked the file ;; to the "master" art group, located in the level. (deftype external-art-buffer (basic) - ((index int32 :offset-assert 4) - (other external-art-buffer :offset-assert 8) - (status symbol :offset-assert 12) - (locked? symbol :offset-assert 16) - (frame-lock symbol :offset-assert 20) - (heap kheap :inline :offset-assert 32) - (pending-load-file string :offset-assert 48) - (pending-load-file-part int32 :offset-assert 52) - (pending-load-file-owner handle :offset-assert 56) - (pending-load-file-priority float :offset-assert 64) - (load-file string :offset-assert 68) - (load-file-part int32 :offset-assert 72) - (load-file-owner handle :offset-assert 80) - (load-file-priority float :offset-assert 88) - (buf pointer :offset-assert 92) - (len int32 :offset-assert 96) - (art-group art-group :offset-assert 100) + ((index int32) + (other external-art-buffer) + (status symbol) + (locked? symbol) + (frame-lock symbol) + (heap kheap :inline) + (pending-load-file string) + (pending-load-file-part int32) + (pending-load-file-owner handle) + (pending-load-file-priority float) + (load-file string) + (load-file-part int32) + (load-file-owner handle) + (load-file-priority float) + (buf pointer) + (len int32) + (art-group art-group) ) - :method-count-assert 16 - :size-assert #x68 - :flag-assert #x1000000068 (:methods - (new (symbol type int) _type_ 0) - (set-pending-file (_type_ string int handle float) int 9) - (update (_type_) int 10) - (inactive? (_type_) symbol 11) - (file-status (_type_ string int) symbol 12) - (link-file (_type_ art-group) art-group 13) - (unlink-file (_type_ art-group) int 14) - (unlock! (_type_) symbol 15) + (new (symbol type int) _type_) + (set-pending-file (_type_ string int handle float) int) + (update (_type_) int) + (inactive? (_type_) symbol) + (file-status (_type_ string int) symbol) + (link-file (_type_ art-group) art-group) + (unlink-file (_type_ art-group) int) + (unlock! (_type_) symbol) ) ) + (defmethod new external-art-buffer ((allocation symbol) (type-to-make type) (idx int)) "Allocate a new external-art-buffer" (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> this index) idx) - (set! (-> this load-file) #f) - (set! (-> this load-file-part) -1) - (set! (-> this load-file-owner) (the-as handle #f)) - (set! (-> this load-file-priority) SPOOL_PRIORITY_LOWEST) - (set! (-> this pending-load-file) #f) - (set! (-> this pending-load-file-part) -1) - (set! (-> this pending-load-file-owner) (the-as handle #f)) - (set! (-> this pending-load-file-priority) SPOOL_PRIORITY_LOWEST) - (set! (-> this art-group) #f) - (set! (-> this status) 'initialize) - (set! (-> this locked?) #f) - (set! (-> this other) #f) - this - ) + (set! (-> this index) idx) + (set! (-> this load-file) #f) + (set! (-> this load-file-part) -1) + (set! (-> this load-file-owner) (the-as handle #f)) + (set! (-> this load-file-priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this pending-load-file) #f) + (set! (-> this pending-load-file-part) -1) + (set! (-> this pending-load-file-owner) (the-as handle #f)) + (set! (-> this pending-load-file-priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this art-group) #f) + (set! (-> this status) 'initialize) + (set! (-> this locked?) #f) + (set! (-> this other) #f) + this + ) ) ;; A spool-anim tracks the buffers holding chunks of a spooled animation. (deftype spool-anim (basic) - ((name string :offset 16) ;; why? - (buf1 external-art-buffer :offset 16) ;; custom - (index int32 :score 100 :offset 20) - (buf2 external-art-buffer :offset 20) ;; custom the old buffer - (parts int32 :offset-assert 24) - (priority float :offset-assert 28) - (owner handle :offset-assert 32) - (command-list pair :offset-assert 40) + ((name string :offset 16) + (buf1 external-art-buffer :overlay-at name) + (index int32 :offset 20) + (buf2 external-art-buffer :overlay-at index) + (parts int32) + (priority float) + (owner handle) + (command-list pair) ) :pack-me - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; This is the main controller for the streaming loader. ;; It has two buffers for holding chunks of a spooling animation ;; The buffer can also be reused to hold other things. (deftype external-art-control (basic) - ((buffer external-art-buffer 2 :offset-assert 4) ;; actual data buffers - (rec spool-anim 3 :inline :offset-assert 16) ;; things we would consider loading - (spool-lock handle :offset-assert 160) - (reserve-buffer external-art-buffer :offset-assert 168) ;; ?? - (reserve-buffer-count int32 :offset-assert 172) ;; ?? - (active-stream string :offset-assert 176) - (preload-stream spool-anim :inline :offset-assert 184) - (last-preload-stream spool-anim :inline :offset-assert 232) - (end-pad uint32) + ((buffer external-art-buffer 2) + (rec spool-anim 3 :inline) + (spool-lock handle) + (reserve-buffer external-art-buffer) + (reserve-buffer-count int32) + (active-stream string) + (preload-stream spool-anim :inline) + (last-preload-stream spool-anim :inline) + (end-pad uint32) ) - :method-count-assert 17 - :size-assert #x118 - :flag-assert #x1100000118 (:methods - (new (symbol type) _type_ 0) - (update (_type_ symbol) int 9) - (clear-rec (_type_) int 10) - (spool-push (_type_ string int process float) int 11) - (file-status (_type_ string int) symbol 12) - (reserve-alloc (_type_) kheap 13) - (reserve-free (_type_ kheap) int 14) - (none-reserved? (_type_) symbol 15) - (try-preload-stream (_type_ string int process float) int 16) + (new (symbol type) _type_) + (update (_type_ symbol) int) + (clear-rec (_type_) int) + (spool-push (_type_ string int process float) int) + (file-status (_type_ string int) symbol) + (reserve-alloc (_type_) kheap) + (reserve-free (_type_ kheap) int) + (none-reserved? (_type_) symbol) + (try-preload-stream (_type_ string int process float) int) ) ) diff --git a/goal_src/jak1/engine/load/loader.gc b/goal_src/jak1/engine/load/loader.gc index cf3f0b416c9..8eee9fc2205 100644 --- a/goal_src/jak1/engine/load/loader.gc +++ b/goal_src/jak1/engine/load/loader.gc @@ -8,7 +8,7 @@ ;; DECOMP BEGINS -(defmethod inspect load-dir ((this load-dir)) +(defmethod inspect ((this load-dir)) "Print all the stuff in a load-dir" (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlevel: ~A~%" (-> this lev)) @@ -21,7 +21,7 @@ this ) -(defmethod mem-usage load-dir ((this load-dir) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this load-dir) (arg0 memory-usage-block) (arg1 int)) "Get the memory usage data of a load-dir" (set! (-> arg0 length) (max 82 (-> arg0 length))) @@ -60,7 +60,7 @@ (the-as load-dir #f) ) -(defmethod load-to-heap-by-name load-dir-art-group ((this load-dir-art-group) (art-name string) (do-reload symbol) (heap kheap) (version int)) +(defmethod load-to-heap-by-name ((this load-dir-art-group) (art-name string) (do-reload symbol) (heap kheap) (version int)) "Load the art with the given name to the heap and return the art. Won't load a thing if it's already loaded, unless you set do-reload. This is intended for debug only." @@ -94,7 +94,7 @@ ) ) -(defmethod set-loaded-art load-dir-art-group ((this load-dir-art-group) (arg0 art-group)) +(defmethod set-loaded-art ((this load-dir-art-group) (arg0 art-group)) "Add some already loaded art to the load-dir." (let ((s4-0 (-> this string-array))) @@ -182,7 +182,7 @@ ) ) -(defmethod set-pending-file external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) +(defmethod set-pending-file ((this external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) "Request a new file to be loaded into this buffer." (set! (-> this pending-load-file) arg0) @@ -192,7 +192,7 @@ 0 ) -(defmethod unlock! external-art-buffer ((this external-art-buffer)) +(defmethod unlock! ((this external-art-buffer)) "Unlock this buffer." (declare (inline)) @@ -200,14 +200,14 @@ #f ) -(defmethod inactive? external-art-buffer ((this external-art-buffer)) +(defmethod inactive? ((this external-art-buffer)) "Is this buffer inactive?" (declare (inline)) (!= (-> this status) 'active) ) -(defmethod file-status external-art-buffer ((this external-art-buffer) (name string) (part int)) +(defmethod file-status ((this external-art-buffer) (name string) (part int)) "Get the status of a file in the buffer. #f = file is not present." (when (and (name= (-> this pending-load-file) name) @@ -221,7 +221,7 @@ ) ) -(defmethod link-art! art-group ((this art-group)) +(defmethod link-art! ((this art-group)) "Links the elements of this art-group. This will put a reference to this joint animation in the level art group. Level art groups have slots for temporarily loaded joint animations." @@ -279,7 +279,7 @@ this ) -(defmethod unlink-art! art-group ((this art-group)) +(defmethod unlink-art! ((this art-group)) "Unlinks the elements of this art-group. This will undo the link-art! function." (when this @@ -320,7 +320,7 @@ 0 ) -(defmethod link-file external-art-buffer ((this external-art-buffer) (ag art-group)) +(defmethod link-file ((this external-art-buffer) (ag art-group)) "Link the art-group and set it to this buffer's art group." (when ag @@ -330,7 +330,7 @@ ag ) -(defmethod unlink-file external-art-buffer ((this external-art-buffer) (ag art-group)) +(defmethod unlink-file ((this external-art-buffer) (ag art-group)) "Unlink the art-group and remove this buffer's art group." (when ag @@ -340,7 +340,7 @@ 0 ) -(defmethod update external-art-buffer ((this external-art-buffer)) +(defmethod update ((this external-art-buffer)) "Update this buffer." (when (or (not (name= (-> this pending-load-file) (-> this load-file))) @@ -551,7 +551,7 @@ ;; (some processes may want to wait for the stream to be preloaded, which won't happen with this disabled) (define *preload-spool-anims* #t) -(defmethod file-status external-art-control ((this external-art-control) (name string) (part int)) +(defmethod file-status ((this external-art-control) (name string) (part int)) "Get the status of a file in this art control. #f = file not found" (dotimes (i 2) @@ -562,7 +562,7 @@ #f ) -(defmethod update external-art-control ((this external-art-control) (debug-print symbol)) +(defmethod update ((this external-art-control) (debug-print symbol)) "Update this external-art-control. This validates the spool buffers, sorts the spools and queues the highest priority one, and does some other things. If debug-print, also prints some text to the display console" @@ -689,13 +689,13 @@ 0 ) -(defmethod none-reserved? external-art-control ((this external-art-control)) +(defmethod none-reserved? ((this external-art-control)) "are there any reserved buffers?" (declare (inline)) (zero? (-> this reserve-buffer-count)) ) -(defmethod reserve-alloc external-art-control ((this external-art-control)) +(defmethod reserve-alloc ((this external-art-control)) "Reserve a buffer!" (set! (-> this reserve-buffer-count) 1) @@ -704,7 +704,7 @@ ) ) -(defmethod reserve-free external-art-control ((this external-art-control) (arg0 kheap)) +(defmethod reserve-free ((this external-art-control) (arg0 kheap)) "Free the reserved buffer!" (cond @@ -726,7 +726,7 @@ 0 ) -(defmethod clear-rec external-art-control ((this external-art-control)) +(defmethod clear-rec ((this external-art-control)) "Clears the recent spool anims from the art control." (cond @@ -776,7 +776,7 @@ ) ) -(defmethod try-preload-stream external-art-control ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) +(defmethod try-preload-stream ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) "Set a new stream to be preloaded, if appropriate." (spool-calc-priority arg3 arg2) @@ -792,7 +792,7 @@ 0 ) -(defmethod spool-push external-art-control ((this external-art-control) (name string) (part int) (proc process) (priority float)) +(defmethod spool-push ((this external-art-control) (name string) (part int) (proc process) (priority float)) "Push a spool-anim to the spool array. There are only space for three, and only the three highest priority spool anims will be kept. (lowest priority = top)" (spool-calc-priority priority proc) diff --git a/goal_src/jak1/engine/load/ramdisk.gc b/goal_src/jak1/engine/load/ramdisk.gc index 67eeaff5a95..1a3125314d4 100644 --- a/goal_src/jak1/engine/load/ramdisk.gc +++ b/goal_src/jak1/engine/load/ramdisk.gc @@ -16,40 +16,31 @@ ;; command to load something into the OVERLORD RAMDISK from the DVD ;; use with fno = 1 (deftype ramdisk-rpc-fill (structure) - ((rsvd1 int32 :offset-assert 0) - (ee-id int32 :offset-assert 4) - (rsvd2 int32 2 :offset-assert 8) - (filename uint128 :offset-assert 16) + ((rsvd1 int32) + (ee-id int32) + (rsvd2 int32 2) + (filename uint128) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; get data in ramdisk on EE. (deftype ramdisk-rpc-load (structure) - ((rsvd int32 :offset-assert 0) - (ee-id int32 :offset-assert 4) - (offset uint32 :offset-assert 8) - (length uint32 :offset-assert 12) + ((rsvd int32) + (ee-id int32) + (offset uint32) + (length uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; load file directly to EE. ;; this seems very similar to some functionality in STR. (deftype ramdisk-rpc-load-to-ee (structure) - ((rsvd int32 :offset-assert 0) - (addr int32 :offset-assert 4) - (offset int32 :offset-assert 8) - (length int32 :offset-assert 12) - (filename uint128 :offset-assert 16) + ((rsvd int32) + (addr int32) + (offset int32) + (length int32) + (filename uint128) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; allocate the ramdisk RPC buffer @@ -71,5 +62,6 @@ (defun ramdisk-sync () "Wait for ramdisk RPC to complete." (sync *ramdisk-rpc* #t) + 0 (none) ) diff --git a/goal_src/jak1/engine/math/euler-h.gc b/goal_src/jak1/engine/math/euler-h.gc index b8f98af06cb..62f3c2dac90 100644 --- a/goal_src/jak1/engine/math/euler-h.gc +++ b/goal_src/jak1/engine/math/euler-h.gc @@ -19,7 +19,4 @@ ;; Euler angles are mostly unused (deftype euler-angles (vector) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) diff --git a/goal_src/jak1/engine/math/math.gc b/goal_src/jak1/engine/math/math.gc index 5a036be6187..8240827001a 100644 --- a/goal_src/jak1/engine/math/math.gc +++ b/goal_src/jak1/engine/math/math.gc @@ -40,7 +40,6 @@ (b uint8 :offset 16) (a uint8 :offset 24) ) - :flag-assert #x900000004 ) (defmacro static-rgba (r g b a) @@ -57,13 +56,11 @@ ;; TODO: fields (deftype xyzw (uint128) () - :flag-assert #x900000010 ) ;; TODO: fields (deftype xyzwh (uint128) () - :flag-assert #x900000010 ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -273,11 +270,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftype random-generator (basic) - ((seed uint32 :offset-assert 4) + ((seed uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (define *random-generator* (new 'global 'random-generator)) @@ -318,4 +312,4 @@ (defmacro rand-float-gen (&key (gen *random-generator*)) "Generate a float from [0, 1)" `(+ -1.0 (the-as float (logior #x3f800000 (/ (rand-uint31-gen ,gen) 256)))) - ) \ No newline at end of file + ) diff --git a/goal_src/jak1/engine/math/matrix-h.gc b/goal_src/jak1/engine/math/matrix-h.gc index cf8ba5b01b2..141e4c65992 100644 --- a/goal_src/jak1/engine/math/matrix-h.gc +++ b/goal_src/jak1/engine/math/matrix-h.gc @@ -11,16 +11,13 @@ ;; some, but not all, functions assume that a matrix is an affine transform. ;; others assume that the rotation has no scale or shear (and that its inverse is its transpose) (deftype matrix (structure) - ((vector vector 4 :inline :offset-assert 0) - (quad uint128 4 :offset 0) - (data float 16 :offset 0) ;; moved so the decompiler looks at vector first. + ((vector vector 4 :inline :offset 0) + (quad uint128 4 :overlay-at vector) + (data float 16 :overlay-at vector) ) - :method-count-assert 10 - :size-assert #x40 - :flag-assert #xa00000040 (:methods - (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none 9) - ) + (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none) + ) ) ;; A 3x3 matrix, stored in row-major order. @@ -28,13 +25,10 @@ ;; so this is really a 3x4 matrix. ;; this type is rarely used (deftype matrix3 (structure) - ((data float 12 :offset-assert 0) - (vector vector 3 :inline :offset 0) - (quad uint128 3 :offset 0) + ((data float 12) + (vector vector 3 :inline :overlay-at (-> data 0)) + (quad uint128 3 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; a matrix stored using 16-bit integers. @@ -43,15 +37,13 @@ ;; so you generally should not unpack these to floats without knowing where they came from ;; and how they were originally packed (for example, in tie/shrub) (deftype matrix4h (structure) - ((data int16 16 :offset-assert 0) - (vector4h vector4h 4 :inline :offset 0) - (long int64 4 :offset 0) + ((data int16 16) + (vector4h vector4h 4 :inline :overlay-at (-> data 0)) + (long int64 4 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (defun matrix-copy! ((dst matrix) (src matrix)) "Copy src to dst" (let ((v1-0 (-> src vector 0 quad)) diff --git a/goal_src/jak1/engine/math/matrix.gc b/goal_src/jak1/engine/math/matrix.gc index 2f602e5e4c4..78e417e2210 100644 --- a/goal_src/jak1/engine/math/matrix.gc +++ b/goal_src/jak1/engine/math/matrix.gc @@ -34,7 +34,7 @@ ;; DECOMP BEGINS -(defmethod inspect matrix ((this matrix)) +(defmethod inspect ((this matrix)) "Print out all the values in a matrix." (format #t "[~8x] matrix~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" @@ -64,7 +64,7 @@ this ) -(defmethod inspect matrix3 ((this matrix3)) +(defmethod inspect ((this matrix3)) "Print out the values in a 3x3 matrix." (format #t "[~8x] matrix3~%" this) (format #t "~T[~F] [~F] [~F]~%" diff --git a/goal_src/jak1/engine/math/quaternion-h.gc b/goal_src/jak1/engine/math/quaternion-h.gc index 11ee8d8ec15..5ea16c2ed05 100644 --- a/goal_src/jak1/engine/math/quaternion-h.gc +++ b/goal_src/jak1/engine/math/quaternion-h.gc @@ -11,17 +11,14 @@ ;; avoids singularities of euler angles, and reasonably efficient to transform. ;; the w component is stored last. (deftype quaternion (structure) - ((x float :offset-assert 0) - (y float :offset-assert 4) - (z float :offset-assert 8) - (w float :offset-assert 12) - (data float 4 :score -9999 :offset 0) - (vec vector :inline :offset 0) - (quad uint128 :offset 0) + ((x float) + (y float) + (z float) + (w float) + (data float 4 :overlay-at x) + (vec vector :inline :overlay-at x) + (quad uint128 :overlay-at x) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (define *unity-quaternion* (new 'static 'quaternion :x 0.0 :y 0.0 :z 0.0 :w 1.0)) diff --git a/goal_src/jak1/engine/math/quaternion.gc b/goal_src/jak1/engine/math/quaternion.gc index 819d6f09806..dd3a5cb9c0d 100644 --- a/goal_src/jak1/engine/math/quaternion.gc +++ b/goal_src/jak1/engine/math/quaternion.gc @@ -10,12 +10,7 @@ (defmethod inspect quaternion ((this quaternion)) "Print a quaternion. Prints the values and axis-angle" (format #t "[~8x] quaternion~%" this) - (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> this x) - (-> this y) - (-> this z) - (-> this w) - ) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z)(-> this w)) (let ((f0-5 (/ 1.0 (sqrtf (+ (* (-> this x) (-> this x)) (* (-> this y) (-> this y)) @@ -25,11 +20,7 @@ ) ) ) - (format #t "~Taxis: ~F ~F ~F" - (* f0-5 (-> this x)) - (* f0-5 (-> this y)) - (* f0-5 (-> this z)) - ) + (format #t "~Taxis: ~F ~F ~F" (* f0-5 (-> this x)) (* f0-5 (-> this y)) (* f0-5 (-> this z))) ) (let ((f0-9 (* 2.0 (acos (-> this w))))) (format #t "~T~Tangle: (deg ~R)~%" f0-9) @@ -57,9 +48,9 @@ (f30-0 (sin f28-0)) (f0-1 (cos f28-0)) ) - (set! (-> quat x) (* (-> axis data 0) f30-0)) - (set! (-> quat y) (* (-> axis data 1) f30-0)) - (set! (-> quat z) (* (-> axis data 2) f30-0)) + (set! (-> quat x) (* (-> axis x) f30-0)) + (set! (-> quat y) (* (-> axis y) f30-0)) + (set! (-> quat z) (* (-> axis z) f30-0)) (set! (-> quat w) f0-1) ) quat @@ -73,10 +64,10 @@ (f30-0 (/ f0-0 (sqrtf (- f1-0 (* f2-0 f2-0))))) (f0-3 (* 2.0 (acos-rad (-> arg1 w)))) ) - (set! (-> arg0 data 0) (* (-> arg1 x) f30-0)) - (set! (-> arg0 data 1) (* (-> arg1 y) f30-0)) - (set! (-> arg0 data 2) (* (-> arg1 z) f30-0)) - (set! (-> arg0 data 3) f0-3) + (set! (-> arg0 x) (* (-> arg1 x) f30-0)) + (set! (-> arg0 y) (* (-> arg1 y) f30-0)) + (set! (-> arg0 z) (* (-> arg1 z) f30-0)) + (set! (-> arg0 w) f0-3) ) arg0 ) @@ -359,22 +350,22 @@ (f1-0 (-> arg1 z)) (f0-0 (-> arg1 w)) ) - (set! (-> arg0 data 0) f0-0) - (set! (-> arg0 data 1) f1-0) - (set! (-> arg0 data 2) (- f2-0)) - (set! (-> arg0 data 3) f3-0) - (set! (-> arg0 data 4) (- f1-0)) - (set! (-> arg0 data 5) f0-0) - (set! (-> arg0 data 6) f3-0) - (set! (-> arg0 data 7) f2-0) - (set! (-> arg0 data 8) f2-0) - (set! (-> arg0 data 9) (- f3-0)) - (set! (-> arg0 data 10) f0-0) - (set! (-> arg0 data 11) f1-0) - (set! (-> arg0 data 12) (- f3-0)) - (set! (-> arg0 data 13) (- f2-0)) - (set! (-> arg0 data 14) (- f1-0)) - (set! (-> arg0 data 15) f0-0) + (set! (-> arg0 vector 0 x) f0-0) + (set! (-> arg0 vector 0 y) f1-0) + (set! (-> arg0 vector 0 z) (- f2-0)) + (set! (-> arg0 vector 0 w) f3-0) + (set! (-> arg0 vector 1 x) (- f1-0)) + (set! (-> arg0 vector 1 y) f0-0) + (set! (-> arg0 vector 1 z) f3-0) + (set! (-> arg0 vector 1 w) f2-0) + (set! (-> arg0 vector 2 x) f2-0) + (set! (-> arg0 vector 2 y) (- f3-0)) + (set! (-> arg0 vector 2 z) f0-0) + (set! (-> arg0 vector 2 w) f1-0) + (set! (-> arg0 vector 3 x) (- f3-0)) + (set! (-> arg0 vector 3 y) (- f2-0)) + (set! (-> arg0 vector 3 z) (- f1-0)) + (set! (-> arg0 vector 3 w) f0-0) ) arg0 ) @@ -386,23 +377,23 @@ (f0-0 (-> arg1 z)) ) (let ((f3-0 (-> arg1 w))) - (set! (-> arg0 data 0) f2-0) - (set! (-> arg0 data 1) f3-0) - (set! (-> arg0 data 2) (- f0-0)) - (set! (-> arg0 data 3) f1-0) - (set! (-> arg0 data 4) f1-0) - (set! (-> arg0 data 5) f0-0) - (set! (-> arg0 data 6) f3-0) - (set! (-> arg0 data 7) (- f3-0)) - (set! (-> arg0 data 8) f0-0) - (set! (-> arg0 data 9) (- f1-0)) - (set! (-> arg0 data 10) f2-0) - (set! (-> arg0 data 11) f3-0) - (set! (-> arg0 data 12) f3-0) + (set! (-> arg0 vector 0 x) f2-0) + (set! (-> arg0 vector 0 y) f3-0) + (set! (-> arg0 vector 0 z) (- f0-0)) + (set! (-> arg0 vector 0 w) f1-0) + (set! (-> arg0 vector 1 x) f1-0) + (set! (-> arg0 vector 1 y) f0-0) + (set! (-> arg0 vector 1 z) f3-0) + (set! (-> arg0 vector 1 w) (- f3-0)) + (set! (-> arg0 vector 2 x) f0-0) + (set! (-> arg0 vector 2 y) (- f1-0)) + (set! (-> arg0 vector 2 z) f2-0) + (set! (-> arg0 vector 2 w) f3-0) + (set! (-> arg0 vector 3 x) f3-0) ) - (set! (-> arg0 data 13) (- f2-0)) - (set! (-> arg0 data 14) (- f1-0)) - (set! (-> arg0 data 15) (- f0-0)) + (set! (-> arg0 vector 3 y) (- f2-0)) + (set! (-> arg0 vector 3 z) (- f1-0)) + (set! (-> arg0 vector 3 w) (- f0-0)) ) arg0 ) @@ -523,7 +514,6 @@ arg0 ) - (defun matrix-with-scale->quaternion ((arg0 quaternion) (arg1 matrix)) "Convert a matrix with a rotation and scale into a quaternion (just the rotation)" (rlet ((vf1 :class vf) @@ -596,18 +586,14 @@ (set! (-> arg0 z) (* 1.5707963 (-> arg1 z))) ) (else - (let* ((f30-0 (quaternion-vector-len arg1)) - (f0-9 (/ (atan2-rad (-> arg1 w) f30-0) f30-0)) - ) - (set! (-> arg0 x) (* (-> arg1 x) f0-9)) - (set! (-> arg0 y) (* (-> arg1 y) f0-9)) - (let ((f0-10 (* (-> arg1 z) f0-9))) - (set! (-> arg0 z) f0-10) - (let ((v1-0 f0-10)) - ) - ) - ) - ) + (let* ((f30-0 (quaternion-vector-len arg1)) + (f0-9 (/ (atan2-rad (-> arg1 w) f30-0) f30-0)) + ) + (set! (-> arg0 x) (* (-> arg1 x) f0-9)) + (set! (-> arg0 y) (* (-> arg1 y) f0-9)) + (set! (-> arg0 z) (* (-> arg1 z) f0-9)) + ) + ) ) arg0 ) @@ -623,16 +609,16 @@ (set! (-> arg0 w) 1.0) ) (else - (let ((s5-0 (new 'stack-no-clear 'vector))) - (sincos-rad! (the-as (pointer float) s5-0) f30-0) - (let ((f0-6 (/ (-> s5-0 data 0) f30-0))) - (set! (-> arg0 x) (* (-> arg1 x) f0-6)) - (set! (-> arg0 y) (* (-> arg1 y) f0-6)) - (set! (-> arg0 z) (* (-> arg1 z) f0-6)) - (set! (-> arg0 w) (-> s5-0 data 1)) - ) - ) - ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (sincos-rad! (the-as (pointer float) s5-0) f30-0) + (let ((f0-6 (/ (-> s5-0 x) f30-0))) + (set! (-> arg0 x) (* (-> arg1 x) f0-6)) + (set! (-> arg0 y) (* (-> arg1 y) f0-6)) + (set! (-> arg0 z) (* (-> arg1 z) f0-6)) + ) + (set! (-> arg0 w) (-> s5-0 y)) + ) + ) ) ) arg0 @@ -654,8 +640,6 @@ (when (< f0-0 0.0) (set! f0-0 (- f0-0)) (set! f30-0 -1.0) - (let ((v1-1 f30-0)) - ) ) (cond ((< (- 1.0 f0-0) 0.0001) @@ -673,39 +657,39 @@ (quaternion-normalize! arg0) ) (else - (let* ((f1-4 1.0) - (f2-1 f0-0) - (f1-6 (sqrtf (- f1-4 (* f2-1 f2-1)))) - (f0-6 (/ (- f1-6 f0-0) (+ f1-6 f0-0))) - (f28-0 (/ 1.0 f1-6)) - ) - (let ((f0-7 (atan-series-rad f0-6)) - (s2-0 (new 'stack-no-clear 'vector)) + (let* ((f1-4 1.0) + (f2-1 f0-0) + (f1-6 (sqrtf (- f1-4 (* f2-1 f2-1)))) + (f0-6 (/ (- f1-6 f0-0) (+ f1-6 f0-0))) + (f28-0 (/ 1.0 f1-6)) ) - (set! (-> s2-0 data 0) (* (- 1.0 arg3) f0-7)) - (set! (-> s2-0 data 1) (* (* arg3 f0-7) f30-0)) - (vector-sin-rad! s2-0 s2-0) - (.lvf vf1 (&-> s2-0 quad)) - ) - (let ((v1-6 f28-0)) - (.mov vf2 v1-6) - ) - ) - (.mul.x.vf vf1 vf1 vf2) - (.lvf vf3 (&-> arg1 vec quad)) - (.lvf vf4 (&-> arg2 vec quad)) - (.mul.x.vf acc vf3 vf1) - (.add.mul.y.vf vf3 vf4 vf1 acc) - (.svf (&-> arg0 vec quad) vf3) - (.mov v1-7 vf3) - ) + (let ((f0-7 (atan-series-rad f0-6)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-0 x) (* (- 1.0 arg3) f0-7)) + (set! (-> s2-0 y) (* arg3 f0-7 f30-0)) + (vector-sin-rad! s2-0 s2-0) + (.lvf vf1 (&-> s2-0 quad)) + ) + (let ((v1-6 f28-0)) + (.mov vf2 v1-6) + ) + ) + (.mul.x.vf vf1 vf1 vf2) + (.lvf vf3 (&-> arg1 vec quad)) + (.lvf vf4 (&-> arg2 vec quad)) + (.mul.x.vf acc vf3 vf1) + (.add.mul.y.vf vf3 vf4 vf1 acc) + (.svf (&-> arg0 vec quad) vf3) + (.mov v1-7 vf3) + ) ) ) arg0 ) ) -(defun quaternion-pseudo-slerp! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) +(defun quaternion-pseudo-slerp! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) "This is a bad interpolation between quaternions. It lerps then normalizes. It will behave extremely poorly for 180 rotations. It is unused." @@ -719,11 +703,8 @@ (f0-0 1.0) ) (when (< f1-0 0.0) - (let ((f0-1 (- f1-0))) - ) + (- f1-0) (set! f0-0 -1.0) - (let ((v1-1 f0-0)) - ) ) (let ((v1-2 (- 1.0 arg3))) (.mov vf1 v1-2) @@ -798,7 +779,7 @@ "Get the first row of the rotation matrix for this quaternion" (let ((s5-0 (new-stack-matrix0))) (quaternion->matrix s5-0 arg1) - (set! (-> arg0 quad) (-> (the-as (pointer uint128) (-> s5-0 data)) 0)) + (set! (-> arg0 quad) (-> (the-as (pointer uint128) (-> s5-0 vector)) 0)) ) arg0 ) @@ -807,7 +788,7 @@ "Get the second row of the rotation matrix for this quaternion" (let ((s5-0 (new-stack-matrix0))) (quaternion->matrix s5-0 arg1) - (set! (-> arg0 quad) (-> (the-as (pointer uint128) (&-> s5-0 data 4)) 0)) + (set! (-> arg0 quad) (-> (the-as (pointer uint128) (-> s5-0 vector 1)) 0)) ) arg0 ) @@ -816,7 +797,7 @@ "Get the third row of the rotation matrix for this quaternion" (let ((s5-0 (new-stack-matrix0))) (quaternion->matrix s5-0 arg1) - (set! (-> arg0 quad) (-> (the-as (pointer uint128) (&-> s5-0 data 8)) 0)) + (set! (-> arg0 quad) (-> (the-as (pointer uint128) (-> s5-0 vector 2)) 0)) ) arg0 ) @@ -824,14 +805,14 @@ (defun quaternion-y-angle ((arg0 quaternion)) "Get the y rotation angle. Not very efficient" (let ((v1-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) arg0))) - (atan (-> v1-1 data 0) (-> v1-1 data 2)) + (atan (-> v1-1 x) (-> v1-1 z)) ) ) (defun quaternion-vector-y-angle ((arg0 quaternion) (arg1 vector)) "Not sure. Angle between quaternion and axis, projected in xz plane?" (let ((f30-0 (quaternion-y-angle arg0)) - (f0-2 (atan (-> arg1 data 0) (-> arg1 data 2))) + (f0-2 (atan (-> arg1 x) (-> arg1 z))) ) (deg-diff f30-0 f0-2) ) @@ -839,52 +820,28 @@ (defun quaternion-rotate-local-x! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) "Rotate existing quaternion along x axis." - (let ((a2-1 (quaternion-vector-angle! - (new-stack-quaternion0) - (new 'static 'vector :x 1.0 :w 1.0) - arg2 - ) - ) - ) + (let ((a2-1 (quaternion-vector-angle! (new-stack-quaternion0) (new 'static 'vector :x 1.0 :w 1.0) arg2))) (quaternion-normalize! (quaternion*! arg0 arg1 a2-1)) ) ) (defun quaternion-rotate-local-y! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) "Rotate existing quaternion along y axis" - (let ((a2-1 (quaternion-vector-angle! - (new-stack-quaternion0) - (new 'static 'vector :y 1.0 :w 1.0) - arg2 - ) - ) - ) + (let ((a2-1 (quaternion-vector-angle! (new-stack-quaternion0) (new 'static 'vector :y 1.0 :w 1.0) arg2))) (quaternion-normalize! (quaternion*! arg0 arg1 a2-1)) ) ) (defun quaternion-rotate-local-z! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) "Rotate existing quaternion along z axis." - (let ((a2-1 (quaternion-vector-angle! - (new-stack-quaternion0) - (new 'static 'vector :z 1.0 :w 1.0) - arg2 - ) - ) - ) + (let ((a2-1 (quaternion-vector-angle! (new-stack-quaternion0) (new 'static 'vector :z 1.0 :w 1.0) arg2))) (quaternion-normalize! (quaternion*! arg0 arg1 a2-1)) ) ) (defun quaternion-rotate-y! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) "Rotate existing quaternion along y axis (right multiply)" - (let ((a1-2 (quaternion-vector-angle! - (new-stack-quaternion0) - (new 'static 'vector :y 1.0 :w 1.0) - arg2 - ) - ) - ) + (let ((a1-2 (quaternion-vector-angle! (new-stack-quaternion0) (new 'static 'vector :y 1.0 :w 1.0) arg2))) (quaternion-normalize! (quaternion*! arg0 a1-2 arg1)) ) ) @@ -892,12 +849,7 @@ (defun quaternion-rotate-x! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) "Rotate existing quaternion along x axis. This has a different implementation from the others for some reason." - (let ((a1-3 (quaternion-vector-angle! - (new-stack-quaternion0) - (vector-x-quaternion! (new-stack-vector0) arg1) - arg2 - ) - ) + (let ((a1-3 (quaternion-vector-angle! (new-stack-quaternion0) (vector-x-quaternion! (new-stack-vector0) arg1) arg2)) ) (quaternion-normalize! (quaternion*! arg0 a1-3 arg1)) ) @@ -905,12 +857,7 @@ (defun quaternion-rotate-z! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) "Rotate existing quaternion along z axis. Has the weird implementation too." - (let ((a1-3 (quaternion-vector-angle! - (new-stack-quaternion0) - (vector-z-quaternion! (new-stack-vector0) arg1) - arg2 - ) - ) + (let ((a1-3 (quaternion-vector-angle! (new-stack-quaternion0) (vector-z-quaternion! (new-stack-vector0) arg1) arg2)) ) (quaternion-normalize! (quaternion*! arg0 a1-3 arg1)) ) @@ -930,32 +877,26 @@ (let ((t9-0 vector-xz-normalize!) (a0-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-1 data 0) (-> arg2 x)) - (set! (-> a0-1 data 1) 0.0) - (set! (-> a0-1 data 2) (-> arg2 z)) - (set! (-> a0-1 data 3) 1.0) + (set! (-> a0-1 x) (-> arg2 x)) + (set! (-> a0-1 y) 0.0) + (set! (-> a0-1 z) (-> arg2 z)) + (set! (-> a0-1 w) 1.0) (let ((s0-0 (t9-0 a0-1 1.0))) (quaternion-from-two-vectors-max-angle! - s5-0 - (vector-z-quaternion! (the-as vector (new 'stack-no-clear 'quaternion)) arg1) - s0-0 - arg3 - ) + s5-0 + (vector-z-quaternion! (the-as vector (new 'stack-no-clear 'quaternion)) arg1) + s0-0 + arg3 + ) ) ) (quaternion-normalize! (quaternion*! arg0 s5-0 arg1)) ) ) - (defun vector-rotate-y! ((arg0 vector) (arg1 vector) (arg2 float)) "Rotate vector along y axis. Not very efficient." - (let ((a1-2 (quaternion-vector-angle! - (new 'stack-no-clear 'quaternion) - (new 'static 'vector :y 1.0 :w 1.0) - arg2 - ) - ) + (let ((a1-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (new 'static 'vector :y 1.0 :w 1.0) arg2)) (s4-0 (new 'stack-no-clear 'matrix)) ) (quaternion->matrix s4-0 a1-2) @@ -969,33 +910,17 @@ (defun vector-y-angle ((arg0 vector)) "Get the yaw angle of a vector." - (atan (-> arg0 data 0) (-> arg0 data 2)) + (atan (-> arg0 x) (-> arg0 z)) ) (defun vector-x-angle ((arg0 vector)) "Get the pitch angle of a vector." - (atan (-> arg0 data 1) (vector-xz-length arg0)) + (atan (-> arg0 y) (vector-xz-length arg0)) ) (defun quaterion<-rotate-y-vector ((arg0 quaternion) (arg1 vector)) "Create a quaternion representing only the yaw of the given vector" - (quaternion-vector-angle! - arg0 - (new 'static 'vector :y 1.0 :w 1.0) - (vector-y-angle arg1) - ) - ) - -(defun quaternion-xz-angle ((arg0 quaternion)) - "yet another function to compute the yaw of a quaternion. This is a particularly inefficient version." - (let ((gp-0 (new 'stack-no-clear 'matrix)) - (s5-0 (new 'stack-no-clear 'vector)) - ) - (quaternion->matrix gp-0 arg0) - (set-vector! s5-0 0.0 0.0 1.0 1.0) - (vector-matrix*! s5-0 s5-0 gp-0) - (vector-y-angle s5-0) - ) + (quaternion-vector-angle! arg0 (new 'static 'vector :y 1.0 :w 1.0) (vector-y-angle arg1)) ) (defun-debug quaternion-validate ((arg0 quaternion)) @@ -1010,6 +935,19 @@ ) ) ) + 0 (none) ) ) + +(defun quaternion-xz-angle ((arg0 quaternion)) + "yet another function to compute the yaw of a quaternion. This is a particularly inefficient version." + (let ((gp-0 (new 'stack-no-clear 'matrix)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (quaternion->matrix gp-0 arg0) + (set-vector! s5-0 0.0 0.0 1.0 1.0) + (vector-matrix*! s5-0 s5-0 gp-0) + (vector-y-angle s5-0) + ) + ) diff --git a/goal_src/jak1/engine/math/transform-h.gc b/goal_src/jak1/engine/math/transform-h.gc index 8d1a03b9ccb..3e010699bef 100644 --- a/goal_src/jak1/engine/math/transform-h.gc +++ b/goal_src/jak1/engine/math/transform-h.gc @@ -11,26 +11,20 @@ ;; This can represent any rotation, translation, and scaling. ;; Note that the scaling is applied before rotation (meaning it scales along the axes of the pre-transformed frame). (deftype transform (structure) - ((trans vector :inline :offset-assert 0) ;; translation - (rot vector :inline :offset-assert 16) ;; rotation (rotation vector) - (scale vector :inline :offset-assert 32) ;; scale (xyz components) + ((trans vector :inline) + (rot vector :inline) + (scale vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; Like transform, but it's a basic. ;; some in-game objects have trs as their parent type to represent their location in the game world. (deftype trs (basic) - ((trans vector :inline :offset-assert 16) - (rot vector :inline :offset-assert 32) - (scale vector :inline :offset-assert 48) + ((trans vector :inline) + (rot vector :inline) + (scale vector :inline) ) (:methods - (new (symbol type) _type_ 0) - ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 + (new (symbol type) _type_) + ) ) diff --git a/goal_src/jak1/engine/math/transform.gc b/goal_src/jak1/engine/math/transform.gc index 13c40d97507..f2321848cfe 100644 --- a/goal_src/jak1/engine/math/transform.gc +++ b/goal_src/jak1/engine/math/transform.gc @@ -9,37 +9,22 @@ ;; DECOMP BEGINS -(defmethod print transform ((this transform)) +(defmethod print ((this transform)) (format #t "# this trans data 0) - (-> this trans data 1) - (-> this trans data 2) - (-> this trans data 3) - ) - (format #t "~T~Trot: ~F ~F ~F ~F ~%" - (-> this rot data 0) - (-> this rot data 1) - (-> this rot data 2) - (-> this rot data 3) - ) - (format #t "~T~Tscale:~F ~F ~F ~F>" - (-> this scale data 0) - (-> this scale data 1) - (-> this scale data 2) - (-> this scale data 3) - ) + (format #t "~T~Ttrans:~F ~F ~F ~F ~%" (-> this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) + (format #t "~T~Trot: ~F ~F ~F ~F ~%" (-> this rot x) (-> this rot y) (-> this rot z) (-> this rot w)) + (format #t "~T~Tscale:~F ~F ~F ~F>" (-> this scale x) (-> this scale y) (-> this scale z) (-> this scale w)) this ) (defmethod new trs ((allocation symbol) (type-to-make type)) "Create a new trs and set it equal to identity." (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> this trans data 3) 1.0) - (set! (-> this rot data 3) 1.0) - (vector-identity! (-> this scale)) - this - ) + (set! (-> this trans w) 1.0) + (set! (-> this rot w) 1.0) + (vector-identity! (-> this scale)) + this + ) ) (defun transform-matrix-calc! ((tf transform) (dst-mat matrix)) @@ -52,17 +37,18 @@ ;; set translation (which also sets identity...) (matrix-translate! dst-mat (-> tf trans)) ;; rotate y axis (this is first, so yaw is "world aligned" - (matrix-rotate-y! s4-0 (-> tf rot data 1)) + (matrix-rotate-y! s4-0 (-> tf rot y)) (matrix*! s3-0 s4-0 dst-mat) ;; rotate x axis - (matrix-rotate-x! s4-0 (-> tf rot data 0)) + (matrix-rotate-x! s4-0 (-> tf rot x)) (matrix*! dst-mat s4-0 s3-0) ;; rotate z axis - (matrix-rotate-z! s4-0 (-> tf rot data 2)) + (matrix-rotate-z! s4-0 (-> tf rot z)) (matrix*! s3-0 s4-0 dst-mat) ;; apply scale (matrix-scale! s4-0 (-> tf scale)) - ) + (matrix*! dst-mat s4-0 s3-0) + ) ) (defun transform-matrix-parent-calc! ((tf transform) (dst-mat matrix) (inv-scale vector)) @@ -74,11 +60,11 @@ (matrix-translate! s3-0 (-> tf trans)) (matrix-inv-scale! s4-0 inv-scale) (matrix*! dst-mat s4-0 s3-0) - (matrix-rotate-y! s4-0 (-> tf rot data 1)) + (matrix-rotate-y! s4-0 (-> tf rot y)) (matrix*! s3-0 s4-0 dst-mat) - (matrix-rotate-x! s4-0 (-> tf rot data 0)) + (matrix-rotate-x! s4-0 (-> tf rot x)) (matrix*! dst-mat s4-0 s3-0) - (matrix-rotate-z! s4-0 (-> tf rot data 2)) + (matrix-rotate-z! s4-0 (-> tf rot z)) (matrix*! s3-0 s4-0 dst-mat) (matrix-scale! s4-0 (-> tf scale)) (matrix*! dst-mat s4-0 s3-0) diff --git a/goal_src/jak1/engine/math/transformq-h.gc b/goal_src/jak1/engine/math/transformq-h.gc index c18f541dadf..2f1c1971374 100644 --- a/goal_src/jak1/engine/math/transformq-h.gc +++ b/goal_src/jak1/engine/math/transformq-h.gc @@ -11,21 +11,15 @@ ;; it is much more commonly used than transform. (deftype transformq (transform) ;; this overlays the rot field of transform. - ((quat quaternion :inline :offset 16) + ((quat quaternion :inline :overlay-at (-> rot x)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; trsq is the quaternion version of trs (trs is like a transform, but is basic.) (deftype trsq (trs) ;; this overlays the rot field of trs. - ((quat quaternion :inline :offset 32) + ((quat quaternion :inline :overlay-at (-> rot x)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; Representing a translate/rotate/scale with a quaternion and a velocity. @@ -34,57 +28,50 @@ ;; many of these functions assume that y is up and assume that roll/pitch is small ;; (a reasonable assumption for most in-game objects that don't do flips) ;; note: Jak's control uses this as a base class. + (deftype trsqv (trsq) - ((pause-adjust-distance meters :offset 4) ;; hack: adjusts the distance where actor logic is paused, if this is an actor - (nav-radius meters :offset 8) ;; hack: the radius of the bounding sphere used by the navigate system. - (transv vector :inline :offset-assert 64) ;; velocity (meters/second) - (rotv vector :inline :offset-assert 80) ;; angular velocity (deg/second) - (scalev vector :inline :offset-assert 96) ;; scale velocity (unused?) + ((pause-adjust-distance meters :offset 4) ;; hack: adjusts the distance where actor logic is paused, if this is an actor + (nav-radius meters :offset 8) ;; hack: the radius of the bounding sphere used by the navigate system. + (transv vector :inline) ;; velocity (meters/second) + (rotv vector :inline) ;; angular velocity (deg/second) + (scalev vector :inline) ;; scale velocity (unused?) ;; there's a hacky ~first-order orientation yaw control with hysteresis ;; it makes the yaw change smoothly and attempts to cancel out oscillations from the collision system - (dir-targ quaternion :inline :offset-assert 112) ;; direction target - (angle-change-time time-frame :offset-assert 128) ;; the time when we change rotation directions - (old-y-angle-diff float :offset-assert 136) ;; the amount we moved last time + (dir-targ quaternion :inline) ;; direction target + (angle-change-time time-frame) ;; the time when we change rotation directions + (old-y-angle-diff float) ;; the amount we moved last time ) - :method-count-assert 28 - :size-assert #x8c - :flag-assert #x1c0000008c (:methods - (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion 9) - (set-heading-vec! (_type_ vector) quaternion 10) - (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion 11) - (point-toward-point! (_type_ vector) quaternion 12) - (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion 13) - (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion 14) - (set-roll-to-grav! (_type_ float) quaternion 15) - (set-roll-to-grav-2! (_type_ float) quaternion 16) - (rotate-toward-orientation! (_type_ quaternion float float) quaternion 17) - (set-quaternion! (_type_ quaternion) quaternion 18) - (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion 19) - (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion 20) - (rot->dir-targ! (_type_) quaternion 21) - (y-angle (_type_) float 22) - (global-y-angle-to-point (_type_ vector) float 23) - (relative-y-angle-to-point (_type_ vector) float 24) - (roll-relative-to-gravity (_type_) float 25) - (set-and-limit-velocity (_type_ int vector float) trsqv 26) - - ;; note: child classes can override this method to use a different quaternion - ;; to represent the "current" orientation for the above methods. - (get-quaternion (_type_) quaternion 27) - ) + (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion) + (set-heading-vec! (_type_ vector) quaternion) + (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion) + (point-toward-point! (_type_ vector) quaternion) + (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion) + (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion) + (set-roll-to-grav! (_type_ float) quaternion) + (set-roll-to-grav-2! (_type_ float) quaternion) + (rotate-toward-orientation! (_type_ quaternion float float) quaternion) + (set-quaternion! (_type_ quaternion) quaternion) + (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion) + (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion) + (rot->dir-targ! (_type_) quaternion) + (y-angle (_type_) float) + (global-y-angle-to-point (_type_ vector) float) + (relative-y-angle-to-point (_type_ vector) float) + (roll-relative-to-gravity (_type_) float) + (set-and-limit-velocity (_type_ int vector float) trsqv) + (get-quaternion (_type_) quaternion) + ) ) -(defmethod global-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) + +(defmethod global-y-angle-to-point ((this trsqv) (arg0 vector)) "Get the angle in the xz plane from the position of this trsqv to the point arg0." (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans))) ) -(defmethod relative-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) +(defmethod relative-y-angle-to-point ((this trsqv) (arg0 vector)) "Get the y angle between the current orientation and arg0." - (deg-diff - (y-angle this) - (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans))) - ) + (deg-diff (y-angle this) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)))) ) diff --git a/goal_src/jak1/engine/math/transformq.gc b/goal_src/jak1/engine/math/transformq.gc index c7acc6c02e9..fd4622e2ce2 100644 --- a/goal_src/jak1/engine/math/transformq.gc +++ b/goal_src/jak1/engine/math/transformq.gc @@ -7,61 +7,43 @@ ;; DECOMP BEGINS -(defmethod print transformq ((this transformq)) +(defmethod print ((this transformq)) "Print a transformq" (format #t "# this trans x) - (-> this trans y) - (-> this trans z) - (-> this trans w) - ) - (format #t "~T~Tquat: ~F ~F ~F ~F ~%" - (-> this rot x) - (-> this rot y) - (-> this rot z) - (-> this rot w) - ) - (format #t "~T~Tscale:~F ~F ~F ~F>" - (-> this scale x) - (-> this scale y) - (-> this scale z) - (-> this scale w) - ) + (format #t "~T~Ttrans:~F ~F ~F ~F ~%" (-> this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) + (format #t "~T~Tquat: ~F ~F ~F ~F ~%" (-> this quat x) (-> this quat y) (-> this quat z) (-> this quat w)) + (format #t "~T~Tscale:~F ~F ~F ~F>" (-> this scale x) (-> this scale y) (-> this scale z) (-> this scale w)) this ) -(defmethod get-quaternion trsqv ((this trsqv)) +(defmethod get-quaternion ((this trsqv)) "Get the rotation as a quaternion." (-> this quat) ) -(defmethod set-quaternion! trsqv ((this trsqv) (arg0 quaternion)) +(defmethod set-quaternion! ((this trsqv) (arg0 quaternion)) "Set the rotation as a quaternion" (quaternion-copy! (get-quaternion this) arg0) ) -(defmethod rot->dir-targ! trsqv ((this trsqv)) +(defmethod rot->dir-targ! ((this trsqv)) "Set the dir-targ to our current orientation" (quaternion-copy! (-> this dir-targ) (get-quaternion this)) ) -(defmethod y-angle trsqv ((this trsqv)) +(defmethod y-angle ((this trsqv)) "Get our current y-angle (y is up, so yaw)" (quaternion-y-angle (get-quaternion this)) ) -(defmethod seek-toward-heading-vec! trsqv ((this trsqv) (dir vector) (vel float) (frame-count time-frame)) +(defmethod seek-toward-heading-vec! ((this trsqv) (dir vector) (vel float) (frame-count time-frame)) "Adjust the orientation to point along dir, only changing our yaw. The vel is a maximum velocity limit. The frame count is the time constant (first order). There's some logic to avoid rapidly changing directions" (let* ((yaw-error (deg-diff (quaternion-y-angle (-> this quat)) (vector-y-angle dir))) ;; limit both on a max velocity, and a proportional to error term. - (yaw-limit (fmin (* vel (-> *display* seconds-per-frame)) - (/ (* 5.0 (fabs yaw-error)) (the float frame-count)) - ) - ) + (yaw-limit (fmin (* vel (seconds-per-frame)) (/ (* 5.0 (fabs yaw-error)) (the float frame-count)))) ;; saturate the yaw error (saturated-yaw (fmax (fmin yaw-error yaw-limit) (- yaw-limit))) ) @@ -72,15 +54,9 @@ ;; But it prevents changes in direction from happening too often. ((or (= old-diff 0.0) (and (< 0.0 saturated-yaw) (< 0.0 old-diff)) - (or (and (< saturated-yaw 0.0) (< old-diff 0.0)) - (>= (- (-> *display* base-frame-counter) - (-> this angle-change-time) - ) - 60 - ) - ) + (or (and (< saturated-yaw 0.0) (< old-diff 0.0)) (time-elapsed? (-> this angle-change-time) (seconds 0.2))) ) - (set! (-> this angle-change-time) (-> *display* base-frame-counter)) + (set-time! (-> this angle-change-time)) saturated-yaw ) (else @@ -97,64 +73,53 @@ ) ) -(defmethod set-heading-vec! trsqv ((this trsqv) (arg0 vector)) +(defmethod set-heading-vec! ((this trsqv) (arg0 vector)) "Makes us look in the arg0 direction immediately. Pitch will be unchanged." (let ((s3-0 (get-quaternion this))) - (forward-up-nopitch->quaternion - s3-0 - (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) ;; forward is the given dir. - (vector-y-quaternion! (new 'stack-no-clear 'vector) s3-0) ;; use the old up + (forward-up-nopitch->quaternion + s3-0 + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) ;; forward is the given dir. + (vector-y-quaternion! (new 'stack-no-clear 'vector) s3-0) ;; use the old up + ) ) - ) ) -(defmethod seek-to-point-toward-point! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) +(defmethod seek-to-point-toward-point! ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) "Seek toward pointing toward arg0 from our current location." - (seek-toward-heading-vec! - this - (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) - arg1 - arg2 - ) + (seek-toward-heading-vec! this (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) arg1 arg2) ) -(defmethod point-toward-point! trsqv ((this trsqv) (arg0 vector)) +(defmethod point-toward-point! ((this trsqv) (arg0 vector)) "Immediately point toward arg0" (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion - s3-0 - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0) - (vector-y-quaternion! (new 'stack-no-clear 'vector) s3-0) - ) + s3-0 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0) + (vector-y-quaternion! (new 'stack-no-clear 'vector) s3-0) + ) ) ) - -(defmethod seek-toward-yaw-angle! trsqv ((this trsqv) (yaw float) (vel float) (frame-count time-frame)) +(defmethod seek-toward-yaw-angle! ((this trsqv) (yaw float) (vel float) (frame-count time-frame)) "Seek toward the given yaw angle." - (seek-toward-heading-vec! - this - ;; make a vector that points toward +z (forward) rotated by the yaw. - (set-vector! (new 'stack-no-clear 'vector) (sin yaw) 0.0 (cos yaw) 1.0) - vel - frame-count - ) + (seek-toward-heading-vec! this + ;; make a vector that points toward +z (forward) rotated by the yaw. + (set-vector! (new 'stack-no-clear 'vector) (sin yaw) 0.0 (cos yaw) 1.0) + vel + frame-count) ) -(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((this trsqv) (yaw float)) +(defmethod set-yaw-angle-clear-roll-pitch! ((this trsqv) (yaw float)) "Immediately clear our roll and pitch and set yaw to the given angle" - (set-heading-vec-clear-roll-pitch! - this - (set-vector! (new 'stack-no-clear 'vector) (sin yaw) 0.0 (cos yaw) 1.0) - ) + (set-heading-vec-clear-roll-pitch! this (set-vector! (new 'stack-no-clear 'vector) (sin yaw) 0.0 (cos yaw) 1.0)) ) -(defmethod set-roll-to-grav! trsqv ((this trsqv) (arg0 float)) +(defmethod set-roll-to-grav! ((this trsqv) (arg0 float)) "Set our roll so that our local down aligns with standard gravity" (set-roll-to-grav-2! this arg0) ) -(defmethod set-roll-to-grav-2! trsqv ((this trsqv) (arg0 float)) +(defmethod set-roll-to-grav-2! ((this trsqv) (arg0 float)) "Set our roll so that our local down aligns with standard gravity" (let* ((quat (get-quaternion this)) ;; our orientation (grav (-> *standard-dynamics* gravity-normal)) ;; dir of gravity @@ -165,11 +130,7 @@ ;; then updates the rotation matrix so that this is our y axis (up) (vector-normalize! (vector-flatten! (-> rot-mat vector 1) grav dir-z) 1.0) ;; fix up the rotation matrix x vector to make the matrix orthonormal again. - (vector-cross! - (-> rot-mat vector 0) - (-> rot-mat vector 1) - dir-z - ) + (vector-cross! (the-as vector (-> rot-mat vector)) (-> rot-mat vector 1) dir-z) ) ;; add some additional roll offset @@ -182,35 +143,27 @@ ) ) -(defmethod roll-relative-to-gravity trsqv ((this trsqv)) +(defmethod roll-relative-to-gravity ((this trsqv)) "Get our roll, relative to 'down' from gravity" (let* ((quat (get-quaternion this)) (dir-z (vector-z-quaternion! (new 'stack-no-clear 'vector) quat)) (dir-y (vector-y-quaternion! (new 'stack-no-clear 'vector) quat)) (dir-grav (-> *standard-dynamics* gravity-normal)) ;; project gravity to our z plane (kills pitch) - (grav-z-plane - (vector-normalize! - (vector-flatten! (new 'stack-no-clear 'vector) dir-grav dir-z) - 1.0 - ) - ) + (grav-z-plane (vector-normalize! (vector-flatten! (new 'stack-no-clear 'vector) dir-grav dir-z) 1.0)) (grav-dot (vector-dot grav-z-plane dir-y)) ) ;; normally we'd just do (acos (vector-dot grav-z-plane y)) ;; but this won't give us the correct sign if we're rolled negatively. ;; this check below manually inverts the acos as needed. - (if (< (vector-dot (vector-cross! (new 'stack-no-clear 'vector) grav-z-plane dir-y) dir-z) - 0.0 - ) + (if (< (vector-dot (vector-cross! (new 'stack-no-clear 'vector) grav-z-plane dir-y) dir-z) 0.0) (- (acos grav-dot)) (acos grav-dot) ) ) ) - -(defmethod rotate-toward-orientation! trsqv ((this trsqv) (target quaternion) (y-rate float) (z-rate float)) +(defmethod rotate-toward-orientation! ((this trsqv) (target quaternion) (y-rate float) (z-rate float)) "Adjust our orientation toward target, subject to some rate limits. I don't think this is a very robust function and probably doesn't work right in cases where an axis flips by 180 degrees." @@ -218,7 +171,7 @@ ;; the basic idea is that we apply two rotations: ;; the first moves our y axis toward the desired's y axis, and the second moves ;; out z axis. These are both rate limited. - + (local-vars (sv-96 vector)) (let ((quat (get-quaternion this))) (let ((temp-quat (new 'stack-no-clear 'quaternion))) @@ -228,7 +181,7 @@ ) (set! sv-96 (vector-y-quaternion! (new 'stack-no-clear 'vector) quat)) (let ((a2-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) target)) - (a3-1 (* z-rate (-> *display* seconds-per-frame))) + (a3-1 (* z-rate (seconds-per-frame))) ) (s1-0 s0-0 sv-96 a2-1 a3-1) ) @@ -237,11 +190,11 @@ ) (when (< 0.0 y-rate) (quaternion-from-two-vectors-max-angle! - temp-quat - (vector-z-quaternion! (new 'stack-no-clear 'vector) quat) - (vector-z-quaternion! (new 'stack-no-clear 'vector) target) - (* y-rate (-> *display* seconds-per-frame)) - ) + temp-quat + (vector-z-quaternion! (new 'stack-no-clear 'vector) quat) + (vector-z-quaternion! (new 'stack-no-clear 'vector) target) + (* y-rate (seconds-per-frame)) + ) (quaternion-normalize! (quaternion*! quat temp-quat quat)) ) ) @@ -249,25 +202,22 @@ ) ) -(defmethod set-heading-vec-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) +(defmethod set-heading-vec-clear-roll-pitch! ((this trsqv) (arg0 vector)) "Set our rotation to point along the given heading, with no roll or pitch." (forward-up->quaternion - (get-quaternion this) - (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) - (new 'static 'vector :y 1.0 :w 1.0) - ) + (get-quaternion this) + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + ) ) -(defmethod point-toward-point-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) +(defmethod point-toward-point-clear-roll-pitch! ((this trsqv) (arg0 vector)) "Set our orientation to point toward arg0, clearing roll and pitch" (forward-up->quaternion - (get-quaternion this) - (vector-normalize! - (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) - 1.0 + (get-quaternion this) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0) + (new 'static 'vector :y 1.0 :w 1.0) ) - (new 'static 'vector :y 1.0 :w 1.0) - ) ) (defun transformq-copy! ((arg0 transformq) (arg1 transformq)) @@ -288,32 +238,31 @@ (vf4 :class vf) (vf5 :class vf) ) - (.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0)) - (quaternion->matrix arg0 (the-as quaternion (-> arg1 rot))) - (cond - (#f - (set! (-> arg0 vector 3 quad) (-> arg1 trans quad)) - ) - (else - ;; apply scale and copy trans - (.lvf vf1 (&-> arg1 scale quad)) - (.lvf vf2 (&-> arg1 trans quad)) - (.lvf vf3 (&-> arg0 vector 0 quad)) - (.lvf vf4 (&-> arg0 vector 1 quad)) - (.lvf vf5 (&-> arg0 vector 2 quad)) - (.mov.vf vf2 vf0 :mask #b1000) ;; don't forget the 1. - (.mul.x.vf vf3 vf3 vf1) - (.mul.y.vf vf4 vf4 vf1) - (.mul.z.vf vf5 vf5 vf1) - (.svf (&-> arg0 vector 3 quad) vf2) - (.svf (&-> arg0 vector 0 quad) vf3) - (.svf (&-> arg0 vector 1 quad) vf4) - (.svf (&-> arg0 vector 2 quad) vf5) - (.mov v1-1 vf5) - ) + (init-vf0-vector) + (quaternion->matrix arg0 (-> arg1 quat)) + (cond + (#f + (set! (-> arg0 vector 3 quad) (-> arg1 trans quad)) + ) + (else + (.lvf vf1 (&-> arg1 scale quad)) + (.lvf vf2 (&-> arg1 trans quad)) + (.lvf vf3 (&-> arg0 vector 0 quad)) + (.lvf vf4 (&-> arg0 vector 1 quad)) + (.lvf vf5 (&-> arg0 vector 2 quad)) + (.mov.vf vf2 vf0 :mask #b1000) + (.mul.x.vf vf3 vf3 vf1) + (.mul.y.vf vf4 vf4 vf1) + (.mul.z.vf vf5 vf5 vf1) + (.svf (&-> arg0 vector 3 quad) vf2) + (.svf (&-> arg0 vector 0 quad) vf3) + (.svf (&-> arg0 vector 1 quad) vf4) + (.svf (&-> arg0 vector 2 quad) vf5) + (.mov v1-1 vf5) + ) + ) + arg0 ) - arg0 - ) ) (defun matrix<-no-trans-transformq! ((arg0 matrix) (arg1 transformq)) @@ -325,22 +274,22 @@ (vf4 :class vf) (vf5 :class vf) ) - (.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0)) - (quaternion->matrix arg0 (the-as quaternion (-> arg1 rot))) - (.lvf vf1 (&-> arg1 scale quad)) - (.lvf vf3 (&-> arg0 vector 0 quad)) - (.lvf vf4 (&-> arg0 vector 1 quad)) - (.lvf vf5 (&-> arg0 vector 2 quad)) - (.mov.vf vf2 vf0) ;; trans = 0,0,0,1 - (.mul.x.vf vf3 vf3 vf1) - (.mul.y.vf vf4 vf4 vf1) - (.mul.z.vf vf5 vf5 vf1) - (.svf (&-> arg0 vector 3 quad) vf2) - (.svf (&-> arg0 vector 0 quad) vf3) - (.svf (&-> arg0 vector 1 quad) vf4) - (.svf (&-> arg0 vector 2 quad) vf5) - arg0 - ) + (init-vf0-vector) + (quaternion->matrix arg0 (-> arg1 quat)) + (.lvf vf1 (&-> arg1 scale quad)) + (.lvf vf3 (&-> arg0 vector 0 quad)) + (.lvf vf4 (&-> arg0 vector 1 quad)) + (.lvf vf5 (&-> arg0 vector 2 quad)) + (.mov.vf vf2 vf0) + (.mul.x.vf vf3 vf3 vf1) + (.mul.y.vf vf4 vf4 vf1) + (.mul.z.vf vf5 vf5 vf1) + (.svf (&-> arg0 vector 3 quad) vf2) + (.svf (&-> arg0 vector 0 quad) vf3) + (.svf (&-> arg0 vector 1 quad) vf4) + (.svf (&-> arg0 vector 2 quad) vf5) + arg0 + ) ) (defun matrix<-transformq+trans! ((arg0 matrix) (arg1 transformq) (arg2 vector)) @@ -354,28 +303,28 @@ (vf5 :class vf) (vf6 :class vf) ) - (.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0)) - (quaternion->matrix arg0 (the-as quaternion (-> arg1 rot))) - (.lvf vf1 (&-> arg1 scale quad)) - (.lvf vf2 (&-> arg1 trans quad)) - (.lvf vf6 (&-> arg2 quad)) - (.lvf vf3 (&-> arg0 vector 0 quad)) - (.lvf vf4 (&-> arg0 vector 1 quad)) - (.lvf vf5 (&-> arg0 vector 2 quad)) - (.mov.vf vf2 vf0 :mask #b1000) - (.mul.x.vf vf3 vf3 vf1) - (.mul.y.vf vf4 vf4 vf1) - (.mul.z.vf vf5 vf5 vf1) - (.mul.x.vf acc vf3 vf6) - (.add.mul.y.vf acc vf4 vf6 acc) - (.add.mul.z.vf acc vf5 vf6 acc) - (.add.mul.w.vf vf2 vf2 vf0 acc :mask #b111) - (.svf (&-> arg0 vector 3 quad) vf2) - (.svf (&-> arg0 vector 0 quad) vf3) - (.svf (&-> arg0 vector 1 quad) vf4) - (.svf (&-> arg0 vector 2 quad) vf5) - arg0 - ) + (init-vf0-vector) + (quaternion->matrix arg0 (-> arg1 quat)) + (.lvf vf1 (&-> arg1 scale quad)) + (.lvf vf2 (&-> arg1 trans quad)) + (.lvf vf6 (&-> arg2 quad)) + (.lvf vf3 (&-> arg0 vector 0 quad)) + (.lvf vf4 (&-> arg0 vector 1 quad)) + (.lvf vf5 (&-> arg0 vector 2 quad)) + (.mov.vf vf2 vf0 :mask #b1000) + (.mul.x.vf vf3 vf3 vf1) + (.mul.y.vf vf4 vf4 vf1) + (.mul.z.vf vf5 vf5 vf1) + (.mul.x.vf acc vf3 vf6) + (.add.mul.y.vf acc vf4 vf6 acc) + (.add.mul.z.vf acc vf5 vf6 acc) + (.add.mul.w.vf vf2 vf2 vf0 acc :mask #b111) + (.svf (&-> arg0 vector 3 quad) vf2) + (.svf (&-> arg0 vector 0 quad) vf3) + (.svf (&-> arg0 vector 1 quad) vf4) + (.svf (&-> arg0 vector 2 quad) vf5) + arg0 + ) ) (defun matrix<-transformq+world-trans! ((arg0 matrix) (arg1 transformq) (arg2 vector)) @@ -388,25 +337,25 @@ (vf5 :class vf) (vf6 :class vf) ) - (.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0)) - (quaternion->matrix arg0 (the-as quaternion (-> arg1 rot))) - (.lvf vf1 (&-> arg1 scale quad)) - (.lvf vf2 (&-> arg1 trans quad)) - (.lvf vf6 (&-> arg2 quad)) - (.lvf vf3 (&-> arg0 vector 0 quad)) - (.lvf vf4 (&-> arg0 vector 1 quad)) - (.lvf vf5 (&-> arg0 vector 2 quad)) - (.mov.vf vf2 vf0 :mask #b1000) - (.mul.x.vf vf3 vf3 vf1) - (.mul.y.vf vf4 vf4 vf1) - (.mul.z.vf vf5 vf5 vf1) - (.add.vf vf2 vf2 vf6 :mask #b111) - (.svf (&-> arg0 vector 3 quad) vf2) - (.svf (&-> arg0 vector 0 quad) vf3) - (.svf (&-> arg0 vector 1 quad) vf4) - (.svf (&-> arg0 vector 2 quad) vf5) - arg0 - ) + (init-vf0-vector) + (quaternion->matrix arg0 (-> arg1 quat)) + (.lvf vf1 (&-> arg1 scale quad)) + (.lvf vf2 (&-> arg1 trans quad)) + (.lvf vf6 (&-> arg2 quad)) + (.lvf vf3 (&-> arg0 vector 0 quad)) + (.lvf vf4 (&-> arg0 vector 1 quad)) + (.lvf vf5 (&-> arg0 vector 2 quad)) + (.mov.vf vf2 vf0 :mask #b1000) + (.mul.x.vf vf3 vf3 vf1) + (.mul.y.vf vf4 vf4 vf1) + (.mul.z.vf vf5 vf5 vf1) + (.add.vf vf2 vf2 vf6 :mask #b111) + (.svf (&-> arg0 vector 3 quad) vf2) + (.svf (&-> arg0 vector 0 quad) vf3) + (.svf (&-> arg0 vector 1 quad) vf4) + (.svf (&-> arg0 vector 2 quad) vf5) + arg0 + ) ) (defun matrix<-parented-transformq! ((arg0 matrix) (arg1 transformq) (arg2 vector)) diff --git a/goal_src/jak1/engine/math/trigonometry.gc b/goal_src/jak1/engine/math/trigonometry.gc index dc29cd8497c..dc1ac456660 100644 --- a/goal_src/jak1/engine/math/trigonometry.gc +++ b/goal_src/jak1/engine/math/trigonometry.gc @@ -33,6 +33,7 @@ (defconstant PI_OVER_2 (the-as float #x3fc90fda)) (defconstant TWO_PI (the-as float #x40c90fda)) +;; DECOP BEGINS (defun radmod ((arg0 float)) "Wrap arg0 to be within (-pi, pi)." @@ -977,7 +978,6 @@ ;; ???? (deftype float-type (uint32) () - :flag-assert #x900000004 ) ;; magic numbers for exp. diff --git a/goal_src/jak1/engine/math/vector-h.gc b/goal_src/jak1/engine/math/vector-h.gc index 2e38948b9fa..ffb57c34a4e 100644 --- a/goal_src/jak1/engine/math/vector-h.gc +++ b/goal_src/jak1/engine/math/vector-h.gc @@ -17,26 +17,24 @@ ;; the bit-array is a dynamically sized array that is bit addressable (deftype bit-array (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) + ((length int32) + (allocated-length int32) ;; neither of these show up in the inspect. ;; it seems like there's a single byte of data array ;; included in the type already - (_pad uint8 :offset-assert 12) - (bytes uint8 :dynamic :offset 12) + (_pad uint8) + (bytes uint8 :dynamic :overlay-at _pad) ) - :method-count-assert 13 - :size-assert #xd - :flag-assert #xd0000000d (:methods - (new (symbol type int) _type_ 0) - (get-bit (_type_ int) symbol 9) - (clear-bit (_type_ int) int 10) - (set-bit (_type_ int) int 11) - (clear-all! (_type_) _type_ 12) - ) + (new (symbol type int) _type_) + (get-bit (_type_ int) symbol) + (clear-bit (_type_ int) int) + (set-bit (_type_ int) int) + (clear-all! (_type_) _type_) + ) ) + (defmethod new bit-array ((allocation symbol) (type-to-make type) (length int)) "Allocate a new bit-array which can hold length bits. Sets both the length and the allocated-length to this length." @@ -53,45 +51,39 @@ ) ) -(defmethod length bit-array ((this bit-array)) +(defmethod length ((this bit-array)) "Get the length (in bits)" (-> this length) ) -(defmethod asize-of bit-array ((this bit-array)) +(defmethod asize-of ((this bit-array)) "Get the size in memory. It is wrong and says its one byte longer, which is safe." - (the-as int - (+ (-> this type size) - (the-as uint (/ (logand -8 (+ (-> this allocated-length) 7)) 8)) - ) - ) + (the-as int (+ (-> this type size) (/ (logand -8 (+ (-> this allocated-length) 7)) 8))) ) -(defmethod get-bit bit-array ((this bit-array) (idx int)) +(defmethod get-bit ((this bit-array) (arg0 int)) "Is the bit at idx set or not?" - (let ((v1-2 (-> this bytes (/ idx 8)))) - (logtest? v1-2 (ash 1 (logand idx 7))) + (let ((v1-2 (-> this bytes (/ arg0 8)))) + (logtest? v1-2 (ash 1 (logand arg0 7))) ) ) -(defmethod clear-bit bit-array ((this bit-array) (idx int)) +(defmethod clear-bit ((this bit-array) (arg0 int)) "Clear the bit at position idx" - (logclear! (-> this bytes (/ idx 8)) (ash 1 (logand idx 7))) + (logclear! (-> this bytes (/ arg0 8)) (ash 1 (logand arg0 7))) 0 ) -(defmethod set-bit bit-array ((this bit-array) (idx int)) +(defmethod set-bit ((this bit-array) (arg0 int)) "Set the bit at position idx" - (logior! (-> this bytes (/ idx 8)) (the-as uint (ash 1 (logand idx 7)))) + (logior! (-> this bytes (/ arg0 8)) (ash 1 (logand arg0 7))) 0 ) -(defmethod clear-all! bit-array ((this bit-array)) +(defmethod clear-all! ((this bit-array)) "Set all bits to zero." (countdown (idx (/ (logand -8 (+ (-> this allocated-length) 7)) 8)) - (nop!) - (nop!) (set! (-> this bytes idx) (the-as uint 0)) ) this @@ -110,185 +102,139 @@ ;; Vector of 4 unsigned bytes. (deftype vector4ub (structure) - ((data uint8 4 :offset-assert 0) - (x uint8 :offset 0) - (y uint8 :offset 1) - (z uint8 :offset 2) - (w uint8 :offset 3) - (clr uint32 :offset 0) + ((data uint8 4) + (x uint8 :overlay-at (-> data 0)) + (y uint8 :overlay-at (-> data 1)) + (z uint8 :overlay-at (-> data 2)) + (w uint8 :overlay-at (-> data 3)) + (clr uint32 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; Vector of 4 signed bytes (deftype vector4b (structure) - ((data int8 4 :offset-assert 0) - (x int8 :offset 0) - (y int8 :offset 1) - (z int8 :offset 2) - (w int8 :offset 3) + ((data int8 4) + (x int8 :overlay-at (-> data 0)) + (y int8 :overlay-at (-> data 1)) + (z int8 :overlay-at (-> data 2)) + (w int8 :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; Vector of 2 signed halfwords (deftype vector2h (structure) - ((data int16 2 :offset-assert 0) - (x int16 :offset 0) - (y int16 :offset 2) + ((data int16 2) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; Vector of 2 unsigned halfwords (deftype vector2uh (structure) - ((data uint16 2 :offset-assert 0) - (x uint16 :offset 0) - (y uint16 :offset 2) - (val uint32 :offset 0) + ((data uint16 2) + (x uint16 :overlay-at (-> data 0)) + (y uint16 :overlay-at (-> data 1)) + (val uint32 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; Vector of 3 halfwords (deftype vector3h (structure) - ((data int16 2 :offset-assert 0) ;; probably a bug, should be 3. - (x int16 :offset 0) - (y int16 :offset 2) - (z int16 :offset-assert 4) + ((data int16 2) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) ;; Vector of 2 signed words (deftype vector2w (structure) - ((data int32 2 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) + ((data int32 2) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; Vector of 3 signed words (deftype vector3w (structure) - ((data int32 3 :score -9999 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) - (z int32 :offset 8) + ((data int32 3) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) + (z int32 :overlay-at (-> data 2)) ) :allow-misaligned - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; Vector of 4 signed words (deftype vector4w (structure) - ((data uint32 4 :score -9999 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) - (z int32 :offset 8) - (w int32 :offset 12) - (dword uint64 2 :offset 0) - (quad uint128 :offset 0) + ((data uint32 4) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) + (z int32 :overlay-at (-> data 2)) + (w int32 :overlay-at (-> data 3)) + (dword uint64 2 :overlay-at (-> data 0)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 - ) - -(defmethod print vector4w ((this vector4w)) - (format #t "#" - (-> this data 0) - (-> this data 1) - (-> this data 2) - (-> this data 3) - this) + ) + + +(defmethod print ((this vector4w)) + (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) this ) ;; Two vector4w's (deftype vector4w-2 (structure) - ((data int32 8 :offset-assert 0) - (quad uint128 2 :offset 0) - (vector vector4w 2 :inline :offset 0) + ((data int32 8) + (quad uint128 2 :overlay-at (-> data 0)) + (vector vector4w 2 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; Three vector4w's (deftype vector4w-3 (structure) - ((data int32 12 :offset-assert 0) - (quad uint128 3 :offset 0) - (vector vector4w 3 :inline :offset 0) + ((data int32 12) + (quad uint128 3 :overlay-at (-> data 0)) + (vector vector4w 3 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; Four vector4w's (deftype vector4w-4 (structure) - ((data int32 16 :offset-assert 0) - (quad uint128 4 :offset 0) - (vector vector4w 4 :inline :offset 0) + ((data int32 16) + (quad uint128 4 :overlay-at (-> data 0)) + (vector vector4w 4 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; Vector of 4 halfwords (deftype vector4h (structure) - ((data int16 4 :offset-assert 0) - (x int16 :offset 0) - (y int16 :offset 2) - (z int16 :offset 4) - (w int16 :offset 6) - (long uint64 :offset 0) + ((data int16 4) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) + (w int16 :overlay-at (-> data 3)) + (long uint64 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; Vector of 8 halfwords (deftype vector8h (structure) - ((data int16 8 :offset-assert 0) - (quad uint128 :offset 0) + ((data int16 8) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; Vector of 16 signed bytes (deftype vector16b (structure) - ((data int8 16 :offset-assert 0) - (quad uint128 :offset 0) + ((data int8 16) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -297,35 +243,24 @@ ;; Vector of 4 floats. Shortened to "vector" because it is the most commonly used. (deftype vector (structure) - ((x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (w float :offset 12) - (data float 4 :do-not-decompile :score -9999 :offset 0) - (quad uint128 :offset 0) + ((x float :offset 0) + (y float :offset 4) + (z float :offset 8) + (w float :offset 12) + (data float 4 :overlay-at x) + (quad uint128 :overlay-at x) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) -(defmethod inspect vector ((this vector)) +(defmethod inspect ((this vector)) (format #t "[~8x] vector~%" this) - (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> this data 0) - (-> this data 1) - (-> this data 2) - (-> this data 3)) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w)) this) -(defmethod print vector ((this vector)) - (format #t "#" - (-> this data 0) - (-> this data 1) - (-> this data 2) - (-> this data 3) - this) - this) +(defmethod print ((this vector)) + (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) + this + ) (define *null-vector* (new 'static 'vector :x 0. :y 0. :z 0. :w 1.)) @@ -340,34 +275,26 @@ ;; Three vector's (deftype vector4s-3 (structure) - ((data float 12 :offset-assert 0) ;; guess - (quad uint128 3 :offset 0) - (vector vector 3 :inline :offset 0) ;; guess + ((data float 12) + (quad uint128 3 :overlay-at (-> data 0)) + (vector vector 3 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype vector-array (inline-array-class) - ((data vector :inline :dynamic :offset 16) + ((data vector :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> vector-array heap-base) 16) (deftype rgbaf (vector) - ((r float :offset 0) - (g float :offset 4) - (b float :offset 8) - (a float :offset 12) + ((r float :overlay-at x) + (g float :overlay-at y) + (b float :overlay-at z) + (a float :overlay-at w) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -376,30 +303,22 @@ ;; ax + by + cz = d form (deftype plane (vector) - ((a float :offset 0) - (b float :offset 4) - (c float :offset 8) - (d float :offset 12) + ((a float :overlay-at x) + (b float :overlay-at y) + (c float :overlay-at z) + (d float :overlay-at w) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; x, y, z are the origin, replaces w with r, the radius (deftype sphere (vector) - ((r float :offset 12 :score 10) ;; prefer over w + ((r float :overlay-at w) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype isphere (vec4s) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (defmacro static-vector (x y z w) @@ -422,103 +341,81 @@ ;; this type represents a bounding-box, stored as minimum/maximum points ;; note that the types in bounding-box are mostly used, this is used very rarely. (deftype box8s (structure) - ((data float 8 :offset-assert 0) - (quad uint128 2 :offset 0) - (vector vector 2 :offset 0) - (min vector :inline :offset 0) - (max vector :inline :offset 16) + ((data float 8) + (quad uint128 2 :overlay-at (-> data 0)) + (vector vector 2 :overlay-at (-> data 0)) + (min vector :inline :overlay-at (-> data 0)) + (max vector :inline :overlay-at (-> data 4)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype box8s-array (inline-array-class) - ((data box8s :inline :dynamic :offset 16) + ((data box8s :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> box8s-array heap-base) 32) ;; This is really a capsule - a cylinder with spheres at both ends (deftype cylinder (structure) - ((origin vector :inline :offset-assert 0) - (axis vector :inline :offset-assert 16) - (radius float :offset-assert 32) - (length float :offset-assert 36) + ((origin vector :inline) + (axis vector :inline) + (radius float) + (length float) ) - :method-count-assert 11 - :size-assert #x28 - :flag-assert #xb00000028 (:methods - (debug-draw (_type_ vector4w) none 9) - (ray-capsule-intersect (_type_ vector vector) float 10) - ) + (debug-draw (_type_ vector4w) none) + (ray-capsule-intersect (_type_ vector vector) float) + ) ) ;; This is a normal cylinder. (deftype cylinder-flat (structure) - ((origin vector :inline :offset-assert 0) - (axis vector :inline :offset-assert 16) - (radius float :offset-assert 32) - (length float :offset-assert 36) + ((origin vector :inline) + (axis vector :inline) + (radius float) + (length float) ) - :method-count-assert 11 - :size-assert #x28 - :flag-assert #xb00000028 (:methods - (debug-draw (_type_ vector4w) none 9) - (ray-flat-cyl-intersect (_type_ vector vector) float 10) - ) + (debug-draw (_type_ vector4w) none) + (ray-flat-cyl-intersect (_type_ vector vector) float) + ) ) ;; these vertical plane types are basically unused (deftype vertical-planes (structure) - ((data uint128 4 :offset-assert 0) ;; probably wrong + ((data uint128 4) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) + (deftype vertical-planes-array (basic) - ((length uint32 :offset-assert 4) - (data vertical-planes :inline :dynamic :offset-assert 16) ;; likely inline based on alignment + ((length uint32) + (data vertical-planes :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; common 16-byte "quadword" structure. ;; allows access to unsigned arrays of integers of all sizes and floats (deftype qword (structure) - ((data uint32 4 :offset-assert 0) - (byte uint8 16 :offset 0) - (hword uint16 8 :offset 0) - (word uint32 4 :offset 0) - (dword uint64 2 :offset 0) - (quad uint128 :offset 0) - (vector vector :inline :offset 0) - (vector4w vector4w :inline :offset 0) + ((data uint32 4) + (byte uint8 16 :overlay-at (-> data 0)) + (hword uint16 8 :overlay-at (-> data 0)) + (word uint32 4 :overlay-at (-> data 0)) + (dword uint64 2 :overlay-at (-> data 0)) + (quad uint128 :overlay-at (-> data 0)) + (vector vector :inline :overlay-at (-> data 0)) + (vector4w vector4w :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; 12-byte vector with only 3 components. It's not used very much. (deftype vector3s (structure) - ((data float 3 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) + ((data float 3) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) + (z float :overlay-at (-> data 2)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) diff --git a/goal_src/jak1/engine/nav/navigate-h.gc b/goal_src/jak1/engine/nav/navigate-h.gc index 416ffc601d9..6e578b976dc 100644 --- a/goal_src/jak1/engine/nav/navigate-h.gc +++ b/goal_src/jak1/engine/nav/navigate-h.gc @@ -36,263 +36,237 @@ ;; DECOMP BEGINS (deftype nav-poly (structure) - ((id uint8 :offset-assert 0) - (vertex uint8 3 :offset-assert 1) - (adj-poly uint8 3 :offset-assert 4) - (pat uint8 :offset-assert 7) + ((id uint8) + (vertex uint8 3) + (adj-poly uint8 3) + (pat uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype nav-vertex (vector) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype nav-sphere (structure) - ((trans sphere :inline :offset-assert 0) + ((trans sphere :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype nav-ray (structure) - ((current-pos vector :inline :offset-assert 0) - (dir vector :inline :offset-assert 16) - (dest-pos vector :inline :offset-assert 32) - (current-poly nav-poly :offset-assert 48) - (next-poly nav-poly :offset-assert 52) - (len meters :offset-assert 56) - (last-edge int8 :offset-assert 60) - (terminated symbol :offset-assert 64) - (reached-dest symbol :offset-assert 68) - (hit-boundary symbol :offset-assert 72) - (hit-gap symbol :offset-assert 76) + ((current-pos vector :inline) + (dir vector :inline) + (dest-pos vector :inline) + (current-poly nav-poly) + (next-poly nav-poly) + (len meters) + (last-edge int8) + (terminated symbol) + (reached-dest symbol) + (hit-boundary symbol) + (hit-gap symbol) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) + (deftype nav-route-portal (structure) - ((next-poly nav-poly :offset-assert 0) - (vertex nav-vertex 2 :offset-assert 4) - (edge-index int8 :offset-assert 12) + ((next-poly nav-poly) + (vertex nav-vertex 2) + (edge-index int8) ) - :method-count-assert 9 - :size-assert #xd - :flag-assert #x90000000d ) (deftype clip-travel-vector-to-mesh-return-info (structure) - ((found-boundary symbol :offset-assert 0) - (intersection vector :inline :offset-assert 16) - (boundary-normal vector :inline :offset-assert 32) - (prev-normal vector :inline :offset-assert 48) - (next-normal vector :inline :offset-assert 64) - (poly nav-poly :offset-assert 80) - (gap-poly nav-poly :offset-assert 84) - (edge int32 :offset-assert 88) - (vert-prev vector :inline :offset-assert 96) - (vert-0 vector :inline :offset-assert 112) - (vert-1 vector :inline :offset-assert 128) - (vert-next vector :inline :offset-assert 144) + ((found-boundary symbol) + (intersection vector :inline) + (boundary-normal vector :inline) + (prev-normal vector :inline) + (next-normal vector :inline) + (poly nav-poly) + (gap-poly nav-poly) + (edge int32) + (vert-prev vector :inline) + (vert-0 vector :inline) + (vert-1 vector :inline) + (vert-next vector :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) + (deftype nav-node (structure) - ((center-x float :offset-assert 0) - (center-y float :offset-assert 4) - (center-z float :offset-assert 8) - (type uint16 :offset-assert 12) - (parent-offset uint16 :offset-assert 14) - (center vector :inline :offset 0) - (radius-x float :offset-assert 16) - (radius-y float :offset-assert 20) - (radius-z float :offset-assert 24) - (left-offset uint16 :offset-assert 28) - (right-offset uint16 :offset-assert 30) - (num-tris uint32 :offset 28) - (radius vector :inline :offset 16) - (scale-x float :offset-assert 32) - (first-tris uint8 4 :offset-assert 36) - (scale-z float :offset-assert 40) - (last-tris uint8 4 :offset-assert 44) - (scale vector :inline :offset 32) + ((center-x float) + (center-y float) + (center-z float) + (type uint16) + (parent-offset uint16) + (center vector :inline :overlay-at center-x) + (radius-x float) + (radius-y float) + (radius-z float) + (left-offset uint16) + (right-offset uint16) + (num-tris uint32 :overlay-at left-offset) + (radius vector :inline :overlay-at radius-x) + (scale-x float) + (first-tris uint8 4) + (scale-z float) + (last-tris uint8 4) + (scale vector :inline :overlay-at scale-x) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype nav-lookup-elem (structure) - ((vec vector :inline :offset-assert 0) - (y-thresh float :offset 12) - (time uint32 :offset-assert 16) - (node-offset uint32 :offset-assert 20) - (lookup-type uint8 :offset-assert 24) - (poly-ind uint8 :offset-assert 25) - (dummy0 uint16 :offset-assert 26) - (dummy uint32 :offset-assert 28) + ((vec vector :inline) + (y-thresh float :overlay-at (-> vec w)) + (time uint32) + (node-offset uint32) + (lookup-type uint8) + (poly-ind uint8) + (dummy0 uint16) + (dummy uint32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype nav-mesh (basic) - ((user-list engine :offset-assert 4) - (poly-lookup-history uint8 2 :offset-assert 8) - (debug-time uint8 :offset-assert 10) - (static-sphere-count uint8 :offset-assert 11) - (static-sphere (inline-array nav-sphere) :offset-assert 12) - (bounds sphere :inline :offset-assert 16) - (origin vector :inline :offset-assert 32) - (cache nav-lookup-elem 4 :inline :offset-assert 48) - (node-count int32 :offset-assert 176) - (nodes (inline-array nav-node) :offset-assert 180) - (vertex-count int32 :offset-assert 184) - (vertex (inline-array nav-vertex) :offset-assert 188) - (poly-count int32 :offset-assert 192) - (poly (inline-array nav-poly) :offset-assert 196) - (route (inline-array vector4ub) :offset-assert 200) + ((user-list engine) + (poly-lookup-history uint8 2) + (debug-time uint8) + (static-sphere-count uint8) + (static-sphere (inline-array nav-sphere)) + (bounds sphere :inline) + (origin vector :inline) + (cache nav-lookup-elem 4 :inline) + (node-count int32) + (nodes (inline-array nav-node)) + (vertex-count int32) + (vertex (inline-array nav-vertex)) + (poly-count int32) + (poly (inline-array nav-poly)) + (route (inline-array vector4ub)) ) - :method-count-assert 30 - :size-assert #xcc - :flag-assert #x1e000000cc (:methods - (tri-centroid-world (_type_ nav-poly vector) vector 9) ;; finds the centroid of the given triangle, in the "world" coordinate system. - (tri-centroid-local (_type_ nav-poly vector) vector 10) ;; finds the centroid of the given triangle, in the local nav-mesh coordinate system. - (get-adj-poly (_type_ nav-poly nav-poly symbol) nav-poly 11) - (setup-portal (_type_ nav-poly nav-poly nav-route-portal) object 12) ;; sets up a portal between two polys. - (initialize-mesh! (_type_) none 13) - (move-along-nav-ray! (_type_ nav-ray) none 14) ;; think this updates the current position in a nav-ray, and updates which triangle you're in. + (tri-centroid-world (_type_ nav-poly vector) vector) ;; finds the centroid of the given triangle, in the "world" coordinate system. + (tri-centroid-local (_type_ nav-poly vector) vector) ;; finds the centroid of the given triangle, in the local nav-mesh coordinate system. + (get-adj-poly (_type_ nav-poly nav-poly symbol) nav-poly) + (setup-portal (_type_ nav-poly nav-poly nav-route-portal) object) ;; sets up a portal between two polys. + (initialize-mesh! (_type_) none) + (move-along-nav-ray! (_type_ nav-ray) none) ;; think this updates the current position in a nav-ray, and updates which triangle you're in. ;; this takes in a point/direction/distance, and see what would happen if you tried to move this way. ;; it returns the distance you can go before one of these happens: ;; - you reach the destination ;; - you hit a nav mesh boundary/gap ;; - you cross 15 triangles. - (try-move-along-ray (_type_ nav-poly vector vector float) meters 15) - (nav-mesh-method-16 (_type_ vector nav-poly vector symbol float clip-travel-vector-to-mesh-return-info) none 16) - (update-route-table (_type_) none 17) ;; (initialization related) - (nav-mesh-method-18 (_type_ int vector int (pointer int8) int) none 18) ;; something to do with routes. - (compute-bounding-box (_type_ vector vector) none 19) - (debug-draw-poly (_type_ nav-poly rgba) none 20) ;; TODO - is rgba a vector4w? - (point-in-poly? (_type_ nav-poly vector) symbol 21) ;; is the point inside of the triangle? - (find-opposite-vertices (_type_ nav-poly nav-poly) uint 22) ;; given two triangles that share an edge, get the indices of the two vertices that aren't part of the edge. - (nav-mesh-method-23 (_type_ nav-poly vector vector vector nav-route-portal) vector 23) - (closest-point-on-boundary (_type_ nav-poly vector vector) vector 24) ;; find the closest point on the perimeter of the triangle. - (project-point-into-tri-3d (_type_ nav-poly vector vector) none 25) ;; will move a 3D point in space to the surface of this nav-poly + (try-move-along-ray (_type_ nav-poly vector vector float) meters) + (nav-mesh-method-16 (_type_ vector nav-poly vector symbol float clip-travel-vector-to-mesh-return-info) none) + (update-route-table (_type_) none) ;; (initialization related) + (nav-mesh-method-18 (_type_ int vector int (pointer int8) int) none) ;; something to do with routes. + (compute-bounding-box (_type_ vector vector) none) + (debug-draw-poly (_type_ nav-poly rgba) none) ;; TODO - is rgba a vector4w? + (point-in-poly? (_type_ nav-poly vector) symbol) ;; is the point inside of the triangle? + (find-opposite-vertices (_type_ nav-poly nav-poly) uint) ;; given two triangles that share an edge, get the indices of the two vertices that aren't part of the edge. + (nav-mesh-method-23 (_type_ nav-poly vector vector vector nav-route-portal) vector) + (closest-point-on-boundary (_type_ nav-poly vector vector) vector) ;; find the closest point on the perimeter of the triangle. + (project-point-into-tri-3d (_type_ nav-poly vector vector) none) ;; will move a 3D point in space to the surface of this nav-poly ;; Looking from the top down, is the point inside the nav-poly? ;; - if the point is inside the triangle, returns that point. ;; - if the point is outside the triangle, move it to the closest point (will be on the edge) - (project-point-into-tri-2d (_type_ nav-poly vector vector) vector 26) + (project-point-into-tri-2d (_type_ nav-poly vector vector) vector) ;; finds which triangle the given point is in. ;; also has some caching stuff so if you look up the same point multiple times, it won't redo the work. ;; I _think_ this is only an approximate check that may return #f even if you are inside. ;; But, if it returns a poly, it will be right. - (find-poly-fast (_type_ vector meters) nav-poly 27) - (find-poly (_type_ vector meters (pointer nav-control-flags)) nav-poly 28) ;; The accurate version of find-poly (tries find-poly-fast first) + (find-poly-fast (_type_ vector meters) nav-poly) + (find-poly (_type_ vector meters (pointer nav-control-flags)) nav-poly) ;; The accurate version of find-poly (tries find-poly-fast first) ;; checks to see if the triangle is in the mesh or not. ;; not sure why it's separate from 27 (and such a different implementation). there might be some details I'm missing here. - (is-in-mesh? (_type_ vector float meters) symbol 29) + (is-in-mesh? (_type_ vector float meters) symbol) ) ) (define-extern *default-nav-mesh* nav-mesh) (deftype check-vector-collision-with-nav-spheres-info (structure) - ((u float :offset-assert 0) - (intersect vector :inline :offset-assert 16) - (normal vector :inline :offset-assert 32) + ((u float) + (intersect vector :inline) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype nav-gap-info (structure) - ((dest vector :inline :offset-assert 0) - (poly nav-poly :offset-assert 16) + ((dest vector :inline) + (poly nav-poly) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) + (deftype nav-control (basic) - ((flags nav-control-flags :offset-assert 4) - (process basic :offset-assert 8) - (shape collide-shape :offset-assert 12) - (mesh nav-mesh :offset-assert 16) - (gap-event basic :offset-assert 20) - (block-event basic :offset-assert 24) - (current-poly nav-poly :offset-assert 28) - (next-poly nav-poly :offset-assert 32) - (target-poly nav-poly :offset-assert 36) - (portal nav-route-portal 2 :offset-assert 40) - (nearest-y-threshold meters :offset-assert 48) - (event-temp vector :inline :offset-assert 64) - (old-travel vector :inline :offset-assert 80) - (blocked-travel vector :inline :offset-assert 96) - (prev-pos vector :inline :offset-assert 112) - (extra-nav-sphere vector :inline :offset-assert 128) - (travel vector :inline :offset-assert 144) - (target-pos vector :inline :offset-assert 160) - (destination-pos vector :inline :offset-assert 176) - (block-time time-frame :offset-assert 192) - (block-count float :offset-assert 200) - (user-poly nav-poly :offset-assert 204) - (nav-cull-radius float :offset-assert 208) - (num-spheres int16 :offset-assert 212) - (max-spheres int16 :offset-assert 214) - (sphere sphere :inline :dynamic :offset-assert 224) + ((flags nav-control-flags) + (process basic) + (shape collide-shape) + (mesh nav-mesh) + (gap-event basic) + (block-event basic) + (current-poly nav-poly) + (next-poly nav-poly) + (target-poly nav-poly) + (portal nav-route-portal 2) + (nearest-y-threshold meters) + (event-temp vector :inline) + (old-travel vector :inline) + (blocked-travel vector :inline) + (prev-pos vector :inline) + (extra-nav-sphere vector :inline) + (travel vector :inline) + (target-pos vector :inline) + (destination-pos vector :inline) + (block-time time-frame) + (block-count float) + (user-poly nav-poly) + (nav-cull-radius float) + (num-spheres int16) + (max-spheres int16) + (sphere sphere :inline :dynamic) ) - :method-count-assert 36 - :size-assert #xe0 - :flag-assert #x24000000e0 (:methods - (new (symbol type collide-shape int float) _type_ 0) - (debug-draw (_type_) none 9) - (point-in-bounds? (_type_ vector) symbol 10) - (nav-control-method-11 (_type_ vector) vector 11) - (nav-control-method-12 (_type_ nav-gap-info) symbol 12) - (nav-control-method-13 (_type_ vector vector) vector 13) ;; see - puffer::20 | second vector may be clip-travel-vector-to-mesh-return-info though - (set-current-poly! (_type_ nav-poly) none 14) - (set-target-pos! (_type_ vector) none 15) - (nav-control-method-16 (_type_ vector) nav-poly 16) ; see - nav-enemy-test-point-in-nav-mesh? - (project-onto-nav-mesh (_type_ vector vector) vector 17) ;; moves point to nav-mesh. - (find-poly (_type_ vector) nav-poly 18) - (nav-control-method-19 (_type_ vector collide-shape-moving vector float) none 19) ;; csm not trsqv? ret not vector? - (project-point-into-tri-3d (_type_ nav-poly vector vector) vector 20) - (nav-control-method-21 (_type_ vector) nav-poly 21) - (nav-control-method-22 (_type_ vector float) symbol 22) - (nav-control-method-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23) ;; TODO - unconfirmed maybe - (nav-control-method-24 (_type_ float clip-travel-vector-to-mesh-return-info) none 24) - (is-in-mesh? (_type_ vector float) symbol 25) ; see - nav-enemy-test-point-near-nav-mesh? - (nav-control-method-26 (_type_) none 26) ;; stub - (nav-control-method-27 (_type_) none 27) - (nav-control-method-28 (_type_ collide-kind) none 28) - (should-display? (_type_) symbol 29) - (nav-control-method-30 (_type_ vector vector vector) sphere 30) ;; TODO - last arg? - it has a float as the first arg, vector is a total guess - (intersect-ray-line-segment? (_type_ vector vector vector vector) symbol 31) - (nav-control-method-32 (_type_ vector vector vector vector float) symbol 32) - (nav-control-method-33 (_type_ vector vector vector vector float) symbol 33) - (nav-control-method-34 () none 34) - (nav-control-method-35 (_type_ vector vector vector vector float) none 35) + (new (symbol type collide-shape int float) _type_) + (debug-draw (_type_) none) + (point-in-bounds? (_type_ vector) symbol) + (nav-control-method-11 (_type_ vector) vector) + (nav-control-method-12 (_type_ nav-gap-info) symbol) + (nav-control-method-13 (_type_ vector vector) vector) + (set-current-poly! (_type_ nav-poly) none) + (set-target-pos! (_type_ vector) none) + (nav-control-method-16 (_type_ vector) nav-poly) + (project-onto-nav-mesh (_type_ vector vector) vector) + (find-poly (_type_ vector) nav-poly) + (nav-control-method-19 (_type_ vector collide-shape-moving vector float) none) + (project-point-into-tri-3d (_type_ nav-poly vector vector) vector) + (nav-control-method-21 (_type_ vector) nav-poly) + (nav-control-method-22 (_type_ vector float) symbol) + (nav-control-method-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float) + (nav-control-method-24 (_type_ float clip-travel-vector-to-mesh-return-info) none) + (is-in-mesh? (_type_ vector float) symbol) + (nav-control-method-26 (_type_) none) + (nav-control-method-27 (_type_) none) + (nav-control-method-28 (_type_ collide-kind) none) + (should-display? (_type_) symbol) + (nav-control-method-30 (_type_ vector vector vector) sphere) + (intersect-ray-line-segment? (_type_ vector vector vector vector) symbol) + (nav-control-method-32 (_type_ vector vector vector vector float) symbol) + (nav-control-method-33 (_type_ vector vector vector vector float) symbol) + (nav-control-method-34 () none) + (nav-control-method-35 (_type_ vector vector vector vector float) none) ) ) + (defbehavior nav-mesh-connect process ((proc process) (trans trsqv) (nav-cont nav-control)) ;; try to find an entity with a nav-mesh, first from the given process (let ((ent (-> proc entity))) @@ -391,11 +365,11 @@ ) ) -(defmethod should-display? nav-control ((this nav-control)) +(defmethod should-display? ((this nav-control)) (and *display-nav-marks* (logtest? (-> this flags) (nav-control-flags display-marks))) ) -(defmethod point-in-bounds? nav-control ((this nav-control) (arg0 vector)) +(defmethod point-in-bounds? ((this nav-control) (arg0 vector)) "Is the point in bounds?" (let ((v1-1 (-> this mesh bounds))) ;; w is the sphere radius @@ -403,7 +377,7 @@ ) ) -(defmethod set-target-pos! nav-control ((this nav-control) (arg0 vector)) +(defmethod set-target-pos! ((this nav-control) (arg0 vector)) (set! (-> this target-pos quad) (-> arg0 quad)) (none) ) @@ -411,8 +385,5 @@ (defun has-nav-mesh? ((arg0 entity-actor)) "Does the actor have a nav mesh? Either loaded an in the nav-mesh field, or in the res-lump." - (the-as - symbol - (or (-> arg0 nav-mesh) (res-lump-struct arg0 'nav-mesh-actor structure)) - ) + (the-as symbol (or (-> arg0 nav-mesh) (res-lump-struct arg0 'nav-mesh-actor structure))) ) diff --git a/goal_src/jak1/engine/nav/navigate.gc b/goal_src/jak1/engine/nav/navigate.gc index 2c6d79c1b3d..bbd1120565a 100644 --- a/goal_src/jak1/engine/nav/navigate.gc +++ b/goal_src/jak1/engine/nav/navigate.gc @@ -131,11 +131,11 @@ (none) ) -(defmethod length nav-control ((this nav-control)) +(defmethod length ((this nav-control)) (-> this num-spheres) ) -(defmethod asize-of nav-control ((this nav-control)) +(defmethod asize-of ((this nav-control)) (the-as int (+ (-> nav-control size) (* (-> this max-spheres) 16))) ) @@ -176,11 +176,11 @@ ) ) -(defmethod length nav-mesh ((this nav-mesh)) +(defmethod length ((this nav-mesh)) (-> this poly-count) ) -(defmethod debug-draw-poly nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) +(defmethod debug-draw-poly ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) (let ((s5-0 (-> this origin)) (s2-0 (-> this vertex)) (gp-0 (new 'stack-no-clear 'vector)) @@ -222,14 +222,14 @@ (set! (-> *nav-one-third* x) 0.33333334) -(defmethod tri-centroid-local nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod tri-centroid-local ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (set! (-> arg1 quad) (-> this vertex (-> arg0 vertex 0) quad)) (vector+! arg1 arg1 (the-as vector (-> this vertex (-> arg0 vertex 1)))) (vector+! arg1 arg1 (the-as vector (-> this vertex (-> arg0 vertex 2)))) (vector-float*! arg1 arg1 0.333333) ) -(defmethod tri-centroid-world nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod tri-centroid-world ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (tri-centroid-local this arg0 arg1) (vector+! arg1 arg1 (-> this origin)) ) @@ -314,7 +314,7 @@ ) ) -(defmethod point-in-poly? nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod point-in-poly? ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (vu-point-triangle-intersection? arg1 (-> this vertex (-> arg0 vertex 0)) @@ -323,7 +323,7 @@ ) ) -(defmethod closest-point-on-boundary nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod closest-point-on-boundary ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (let ((s2-0 (-> this vertex)) (s1-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) @@ -345,7 +345,7 @@ arg1 ) -(defmethod project-point-into-tri-2d nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-tri-2d ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (if (point-in-poly? this arg0 arg2) (set! (-> arg1 quad) (-> arg2 quad)) (closest-point-on-boundary this arg0 arg1 arg2) @@ -484,11 +484,11 @@ -1 ) -(defmethod find-poly-fast nav-mesh ((this nav-mesh) (arg0 vector) (arg1 meters)) +(defmethod find-poly-fast ((this nav-mesh) (arg0 vector) (arg1 meters)) (local-vars (a0-6 symbol) (a2-3 uint128) (a2-4 uint128)) -1 (let ((s2-0 -1) - (s3-0 (-> *display* base-frame-counter)) + (s3-0 (current-time)) (f0-0 (-> this bounds w)) ) (when (>= (* f0-0 f0-0) (vector-length-squared arg0)) @@ -741,7 +741,7 @@ ) ;; ERROR: Failed load: (set! vf3 (l.vf a0-4)) at op 42 -(defmethod is-in-mesh? nav-mesh ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 meters)) +(defmethod is-in-mesh? ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 meters)) (local-vars (v1-10 int)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -820,7 +820,7 @@ ) ) -(defmethod move-along-nav-ray! nav-mesh ((this nav-mesh) (arg0 nav-ray)) +(defmethod move-along-nav-ray! ((this nav-mesh) (arg0 nav-ray)) (local-vars (a2-7 int) (a3-3 int)) (let ((v1-0 -1) (f0-1 (- (-> arg0 dest-pos x) (-> arg0 current-pos x))) @@ -919,7 +919,7 @@ (init-ray arg0) ) -(defmethod try-move-along-ray nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod try-move-along-ray ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (v1-2 symbol)) (let ((gp-0 (new 'stack-no-clear 'nav-ray))) (let ((s4-0 0)) @@ -984,7 +984,7 @@ (define *nav-update-route-table-route-count* 0) -(defmethod nav-mesh-method-18 nav-mesh ((this nav-mesh) (arg0 int) (arg1 vector) (arg2 int) (arg3 (pointer int8)) (arg4 int)) +(defmethod nav-mesh-method-18 ((this nav-mesh) (arg0 int) (arg1 vector) (arg2 int) (arg3 (pointer int8)) (arg4 int)) (local-vars (sv-32 int) (sv-48 uint)) (set! (-> arg3 arg2) 1) (nav-mesh-update-route-table this arg0 arg2 (the-as uint 3)) @@ -1028,7 +1028,7 @@ (none) ) -(defmethod update-route-table nav-mesh ((this nav-mesh)) +(defmethod update-route-table ((this nav-mesh)) (when *nav-patch-route-table* (stopwatch-init *nav-timer*) (stopwatch-begin *nav-timer*) @@ -1162,7 +1162,7 @@ ) ) -(defmethod find-poly nav-mesh ((this nav-mesh) (arg0 vector) (arg1 meters) (arg2 (pointer nav-control-flags))) +(defmethod find-poly ((this nav-mesh) (arg0 vector) (arg1 meters) (arg2 (pointer nav-control-flags))) (local-vars (s3-1 nav-poly)) (let ((v1-1 (find-poly-fast this arg0 arg1))) (when v1-1 @@ -1204,7 +1204,7 @@ s3-1 ) -(defmethod setup-portal nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) +(defmethod setup-portal ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) (local-vars (t0-6 int) (t1-1 int)) (set! (-> arg2 next-poly) #f) (cond @@ -1244,7 +1244,7 @@ ) ) -(defmethod get-adj-poly nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 symbol)) +(defmethod get-adj-poly ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 symbol)) (local-vars (v1-12 uint) (t0-6 int) (t1-1 int)) (cond ((and arg0 arg1) @@ -1286,7 +1286,7 @@ ) ) -(defmethod compute-bounding-box nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector)) +(defmethod compute-bounding-box ((this nav-mesh) (arg0 vector) (arg1 vector)) (let ((f0-0 10000000000000000000000000000000000000.0) (f1-0 -10000000000000000000000000000000000000.0) ) @@ -1313,7 +1313,7 @@ (none) ) -(defmethod initialize-mesh! nav-mesh ((this nav-mesh)) +(defmethod initialize-mesh! ((this nav-mesh)) (local-vars (sv-32 vector) (sv-48 int)) (with-pp (set! sv-32 (new 'stack-no-clear 'vector)) @@ -1386,7 +1386,7 @@ ) ) -(defmethod find-opposite-vertices nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) +(defmethod find-opposite-vertices ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) (when (!= arg0 arg1) (dotimes (v1-1 3) (dotimes (a0-1 3) @@ -1463,7 +1463,7 @@ ) ) -(defmethod nav-mesh-method-23 nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 nav-route-portal)) +(defmethod nav-mesh-method-23 ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 nav-route-portal)) (local-vars (v1-32 int) (a0-14 int) (a0-17 int) (a1-10 int) (sv-16 nav-vertex)) (let ((s1-0 (-> this vertex)) (s0-0 -1) @@ -1535,7 +1535,7 @@ arg2 ) -(defmethod project-point-into-tri-3d nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-tri-3d ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'matrix)) ) @@ -1551,7 +1551,7 @@ (none) ) -(defmethod project-onto-nav-mesh nav-control ((this nav-control) (arg0 vector) (arg1 vector)) +(defmethod project-onto-nav-mesh ((this nav-control) (arg0 vector) (arg1 vector)) (local-vars (sv-32 int)) (let ((s5-0 (-> this mesh)) (s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 (-> this mesh origin))) @@ -1572,7 +1572,7 @@ arg0 ) -(defmethod find-poly nav-control ((this nav-control) (arg0 vector)) +(defmethod find-poly ((this nav-control) (arg0 vector)) (find-poly (-> this mesh) (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) @@ -1581,7 +1581,7 @@ ) ) -(defmethod project-point-into-tri-3d nav-control ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-tri-3d ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (project-point-into-tri-3d (-> this mesh) arg0 @@ -1592,7 +1592,7 @@ arg1 ) -(defmethod is-in-mesh? nav-control ((this nav-control) (arg0 vector) (arg1 float)) +(defmethod is-in-mesh? ((this nav-control) (arg0 vector) (arg1 float)) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin))) (a1-1 (-> this mesh)) ) @@ -1600,7 +1600,7 @@ ) ) -(defmethod debug-draw nav-control ((this nav-control)) +(defmethod debug-draw ((this nav-control)) (local-vars (sv-192 vector) (sv-208 uint) @@ -1842,7 +1842,7 @@ (none) ) -(defmethod mem-usage nav-mesh ((this nav-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this nav-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) @@ -1874,14 +1874,14 @@ (the-as nav-mesh 0) ) -(defmethod set-current-poly! nav-control ((this nav-control) (arg0 nav-poly)) +(defmethod set-current-poly! ((this nav-control) (arg0 nav-poly)) (set! (-> this current-poly) arg0) (logior! (-> this flags) (nav-control-flags navcf9)) 0 (none) ) -(defmethod nav-control-method-30 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod nav-control-method-30 ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (the-as sphere #f))) (let ((f30-0 -0.000001)) (countdown (s1-0 (-> this num-spheres)) @@ -1900,7 +1900,7 @@ ) ) -(defmethod intersect-ray-line-segment? nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod intersect-ray-line-segment? ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (ray-line-segment-intersection? arg0 arg1 arg2 arg3) ) @@ -1966,7 +1966,7 @@ (none) ) -(defmethod nav-control-method-28 nav-control ((this nav-control) (arg0 collide-kind)) +(defmethod nav-control-method-28 ((this nav-control) (arg0 collide-kind)) (local-vars (sv-32 nav-control) (sv-48 sphere) @@ -2116,7 +2116,7 @@ (none) ) -(defmethod nav-control-method-35 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-control-method-35 ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg1 (-> this mesh origin)) (nav-control-method-32 this arg0 v1-0 arg2 arg3 arg4) @@ -2125,60 +2125,51 @@ ) (deftype cfs-travel-vec (structure) - ((dir vector :inline :offset-assert 0) - (delta-angle float :offset-assert 16) + ((dir vector :inline) + (delta-angle float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype cfs-work (structure) - ((desired-travel-dist float :offset-assert 0) - (desired-angle float :offset-assert 4) - (max-dist float :offset-assert 8) - (old-angle float :offset-assert 12) - (modified int32 :offset-assert 16) - (blocked-mask uint64 :offset-assert 24) - (travel vector :inline :offset-assert 32) - (current vector :inline :offset-assert 48) - (new-travel cfs-travel-vec 2 :inline :offset-assert 64) - (temp-travel cfs-travel-vec 2 :inline :offset-assert 128) - (prev-dir vector :inline :offset-assert 192) - (attempt-dir vector :inline :offset-assert 208) - (tangent vector 2 :inline :offset-assert 224) + ((desired-travel-dist float) + (desired-angle float) + (max-dist float) + (old-angle float) + (modified int32) + (blocked-mask uint64) + (travel vector :inline) + (current vector :inline) + (new-travel cfs-travel-vec 2 :inline) + (temp-travel cfs-travel-vec 2 :inline) + (prev-dir vector :inline) + (attempt-dir vector :inline) + (tangent vector 2 :inline) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) (deftype nav-control-cfs-work (structure) - ((in-dir vector :inline :offset-assert 0) - (right-dir vector :inline :offset-assert 16) - (best-dir vector 2 :inline :offset-assert 32) - (temp-dir vector 2 :inline :offset-assert 64) - (away-dir vector :inline :offset-assert 96) - (best-dir-angle degrees 2 :offset-assert 112) - (ignore-mask uint64 :offset-assert 120) - (initial-ignore-mask uint64 :offset-assert 128) - (i-sphere int32 :offset-assert 136) - (i-first-sphere int32 :offset-assert 140) - (i-inside-sphere int32 :offset-assert 144) - (inside-sphere-dist float :offset-assert 148) - (sign float :offset-assert 152) - (travel-len float :offset-assert 156) - (dist2 float :offset-assert 160) - (inside-dist float :offset-assert 164) - (rand-angle float :offset-assert 168) - (dir-update basic :offset-assert 172) - (debug-offset vector :inline :offset-assert 176) + ((in-dir vector :inline) + (right-dir vector :inline) + (best-dir vector 2 :inline) + (temp-dir vector 2 :inline) + (away-dir vector :inline) + (best-dir-angle degrees 2) + (ignore-mask uint64) + (initial-ignore-mask uint64) + (i-sphere int32) + (i-first-sphere int32) + (i-inside-sphere int32) + (inside-sphere-dist float) + (sign float) + (travel-len float) + (dist2 float) + (inside-dist float) + (rand-angle float) + (dir-update basic) + (debug-offset vector :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) @@ -2257,7 +2248,7 @@ ) ) -(defmethod nav-control-method-32 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-control-method-32 ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) (local-vars (v0-3 symbol) (v1-38 int) (a0-29 int) (a3-7 int) (sv-208 sphere)) (let ((gp-0 (new 'stack-no-clear 'nav-control-cfs-work))) (set! (-> gp-0 in-dir quad) (-> arg2 quad)) @@ -2333,7 +2324,12 @@ (b! #t cfg-31 :delay (nop!)) (label cfg-22) (+! (-> gp-0 ignore-mask) (ash 1 v1-38)) - (circle-tangent-directions arg1 (-> this sphere v1-38) (the-as vector (-> gp-0 temp-dir)) (-> gp-0 temp-dir 1)) + (circle-tangent-directions + arg1 + (-> this sphere v1-38) + (the-as vector (-> gp-0 temp-dir)) + (-> gp-0 temp-dir 1) + ) (set! (-> gp-0 dir-update) #f) (dotimes (v1-40 2) (let ((f0-23 (-> gp-0 sign)) @@ -2411,7 +2407,7 @@ v0-3 ) -(defmethod nav-control-method-23 nav-control ((this nav-control) (arg0 vector) (arg1 check-vector-collision-with-nav-spheres-info)) +(defmethod nav-control-method-23 ((this nav-control) (arg0 vector) (arg1 check-vector-collision-with-nav-spheres-info)) (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this shape trans) (-> this mesh origin))) (f30-0 -1.0) ) @@ -2452,14 +2448,14 @@ ) ) -(defmethod nav-control-method-33 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-control-method-33 ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) (let ((f30-0 (vector-xz-length (-> this travel)))) (when (nav-control-method-32 this arg0 arg1 arg2 arg3 f30-0) (set! (-> this blocked-travel quad) (-> this travel quad)) (let ((f0-0 (vector-xz-length (-> this travel)))) (when (and (>= f30-0 f0-0) (< f0-0 204.8)) (logior! (-> this flags) (nav-control-flags navcf17)) - (set! (-> this block-time) (-> *display* base-frame-counter)) + (set-time! (-> this block-time)) (+! (-> this block-count) 1.0) (if (-> this block-event) (send-event (the-as process-tree (-> this process)) (the-as symbol (-> this block-event)) this) @@ -2483,9 +2479,9 @@ (define *test-ray-dest-pos* (new 'static 'vector :x -722887.7 :y 9532.475 :z -958862.25 :w 1.0)) -(defmethod nav-control-method-19 nav-control ((this nav-control) (arg0 vector) (arg1 collide-shape-moving) (arg2 vector) (arg3 float)) +(defmethod nav-control-method-19 ((this nav-control) (arg0 vector) (arg1 collide-shape-moving) (arg2 vector) (arg3 float)) (local-vars (sv-48 float)) - (let ((f30-0 (* arg3 (-> *display* seconds-per-frame))) + (let ((f30-0 (* arg3 (seconds-per-frame))) (s0-0 arg1) (s1-0 arg2) (s2-0 deg-diff) @@ -2521,7 +2517,7 @@ (none) ) -(defmethod nav-control-method-16 nav-control ((this nav-control) (arg0 vector)) +(defmethod nav-control-method-16 ((this nav-control) (arg0 vector)) (find-poly-fast (-> this mesh) (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) @@ -2529,7 +2525,7 @@ ) ) -(defmethod nav-control-method-21 nav-control ((this nav-control) (arg0 vector)) +(defmethod nav-control-method-21 ((this nav-control) (arg0 vector)) (find-poly-fast (-> this mesh) (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) @@ -2537,7 +2533,7 @@ ) ) -(defmethod nav-control-method-22 nav-control ((this nav-control) (arg0 vector) (arg1 float)) +(defmethod nav-control-method-22 ((this nav-control) (arg0 vector) (arg1 float)) (the-as symbol (and (find-poly-fast (-> this mesh) (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) @@ -2558,12 +2554,12 @@ ) ) -(defmethod nav-control-method-26 nav-control ((this nav-control)) +(defmethod nav-control-method-26 ((this nav-control)) 0 (none) ) -(defmethod nav-control-method-27 nav-control ((this nav-control)) +(defmethod nav-control-method-27 ((this nav-control)) (local-vars (v1-7 symbol)) (cond ((-> this current-poly) @@ -2609,14 +2605,14 @@ (none) ) -(defmethod nav-mesh-method-16 nav-mesh ((this nav-mesh) - (arg0 vector) - (arg1 nav-poly) - (arg2 vector) - (arg3 symbol) - (arg4 float) - (arg5 clip-travel-vector-to-mesh-return-info) - ) +(defmethod nav-mesh-method-16 ((this nav-mesh) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 symbol) + (arg4 float) + (arg5 clip-travel-vector-to-mesh-return-info) + ) (local-vars (v1-10 symbol) (sv-96 symbol) (sv-112 int) (sv-128 int)) (when arg5 (set! (-> arg5 found-boundary) #f) @@ -2702,7 +2698,7 @@ (none) ) -(defmethod nav-control-method-24 nav-control ((this nav-control) (arg0 float) (arg1 clip-travel-vector-to-mesh-return-info)) +(defmethod nav-control-method-24 ((this nav-control) (arg0 float) (arg1 clip-travel-vector-to-mesh-return-info)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 (-> this shape trans) (-> this mesh origin)) (nav-mesh-method-16 @@ -2823,7 +2819,7 @@ ) ) -(defmethod nav-control-method-13 nav-control ((this nav-control) (arg0 vector) (arg1 vector)) +(defmethod nav-control-method-13 ((this nav-control) (arg0 vector) (arg1 vector)) (local-vars (sv-80 vector) (sv-84 vector) @@ -2933,7 +2929,7 @@ (-> this travel) ) -(defmethod nav-control-method-12 nav-control ((this nav-control) (arg0 nav-gap-info)) +(defmethod nav-control-method-12 ((this nav-control) (arg0 nav-gap-info)) (when (and (-> this next-poly) (logtest? (-> this next-poly pat) 1)) (let ((s4-0 (-> this next-poly)) (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this shape trans) (-> this mesh origin))) @@ -2954,7 +2950,7 @@ ) ) -(defmethod nav-control-method-11 nav-control ((this nav-control) (arg0 vector)) +(defmethod nav-control-method-11 ((this nav-control) (arg0 vector)) (set! (-> this old-travel quad) (-> this travel quad)) (-> this block-count) (seek! (-> this block-count) 0.0 0.016666668) diff --git a/goal_src/jak1/engine/physics/dynamics-h.gc b/goal_src/jak1/engine/physics/dynamics-h.gc index e999d44ded1..3015dd6f9b4 100644 --- a/goal_src/jak1/engine/physics/dynamics-h.gc +++ b/goal_src/jak1/engine/physics/dynamics-h.gc @@ -9,19 +9,17 @@ ;; dyanamics contain gravity properties (deftype dynamics (basic) - ((name basic :offset-assert 4) - (gravity-max meters :offset-assert 8) - (gravity-length meters :offset-assert 12) - (gravity vector :inline :offset-assert 16) - (gravity-normal vector :inline :offset-assert 32) - (walk-distance meters :offset-assert 48) - (run-distance meters :offset-assert 52) + ((name basic) + (gravity-max meters) + (gravity-length meters) + (gravity vector :inline) + (gravity-normal vector :inline) + (walk-distance meters) + (run-distance meters) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) + (defun time-to-apex ((arg0 float) (arg1 float)) "How many ticks it takes to reach the apex of a ballistic trajectory." (the int (/ arg0 (- (vel-tick arg1)))) diff --git a/goal_src/jak1/engine/physics/trajectory-h.gc b/goal_src/jak1/engine/physics/trajectory-h.gc index 30d2396e445..556d982299b 100644 --- a/goal_src/jak1/engine/physics/trajectory-h.gc +++ b/goal_src/jak1/engine/physics/trajectory-h.gc @@ -12,21 +12,18 @@ ;; Then, use eval-position or eval-velocity to get the position or velocity of the ;; object along the trajectory. (deftype trajectory (structure) - ((initial-position vector :inline :offset-assert 0) - (initial-velocity vector :inline :offset-assert 16) - (time float :offset-assert 32) - (gravity meters :offset-assert 36) + ((initial-position vector :inline) + (initial-velocity vector :inline) + (time float) + (gravity meters) ) - :method-count-assert 16 - :size-assert #x28 - :flag-assert #x1000000028 (:methods - (eval-position! (_type_ float vector) vector 9) - (eval-velocity! (_type_ float vector) vector 10) - (setup-from-to-duration! (_type_ vector vector float float) none 11) - (setup-from-to-xz-vel! (_type_ vector vector float float) none 12) - (setup-from-to-y-vel! (_type_ vector vector float float) none 13) - (setup-from-to-height! (_type_ vector vector float float) none 14) - (debug-draw! (_type_) none 15) + (eval-position! (_type_ float vector) vector) + (eval-velocity! (_type_ float vector) vector) + (setup-from-to-duration! (_type_ vector vector float float) none) + (setup-from-to-xz-vel! (_type_ vector vector float float) none) + (setup-from-to-y-vel! (_type_ vector vector float float) none) + (setup-from-to-height! (_type_ vector vector float float) none) + (debug-draw! (_type_) none) ) ) diff --git a/goal_src/jak1/engine/physics/trajectory.gc b/goal_src/jak1/engine/physics/trajectory.gc index 20cd1e5ea12..0b931817c4c 100644 --- a/goal_src/jak1/engine/physics/trajectory.gc +++ b/goal_src/jak1/engine/physics/trajectory.gc @@ -7,24 +7,24 @@ ;; DECOMP BEGINS -(defmethod eval-position! trajectory ((this trajectory) (time float) (result vector)) +(defmethod eval-position! ((this trajectory) (time float) (result vector)) "Evaluate the position of the object at a give time" (set! (-> result quad) (-> this initial-position quad)) (+! (-> result x) (* time (-> this initial-velocity x))) (+! (-> result y) (* time (-> this initial-velocity y))) (+! (-> result z) (* time (-> this initial-velocity z))) - (+! (-> result y) (* (* (* 0.5 time) time) (-> this gravity))) + (+! (-> result y) (* 0.5 time time (-> this gravity))) result ) -(defmethod eval-velocity! trajectory ((this trajectory) (time float) (result vector)) +(defmethod eval-velocity! ((this trajectory) (time float) (result vector)) "Evaluate the velocity of the object at a given time" (set! (-> result quad) (-> this initial-velocity quad)) (+! (-> result y) (* time (-> this gravity))) result ) -(defmethod setup-from-to-duration! trajectory ((this trajectory) (from vector) (to vector) (duration float) (grav float)) +(defmethod setup-from-to-duration! ((this trajectory) (from vector) (to vector) (duration float) (grav float)) "Set up a trajectory that goes from->to in the given duration" (set! (-> this initial-position quad) (-> from quad)) (set! (-> this gravity) grav) @@ -38,54 +38,55 @@ ) ;; solve for the y velocity that makes us land at the right height. (set! (-> this initial-velocity y) - (- (/ (- (-> to y) (-> from y)) duration) - (* (* 0.5 duration) (-> this gravity)) - ) - ) + (- (/ (- (-> to y) (-> from y)) duration) (* 0.5 duration (-> this gravity))) + ) + 0 (none) ) -(defmethod setup-from-to-xz-vel! trajectory ((this trajectory) (from vector) (to vector) (xz-vel float) (grav float)) +(defmethod setup-from-to-xz-vel! ((this trajectory) (from vector) (to vector) (xz-vel float) (grav float)) "Set up a trajectory that goes from->to with the given velocity" ;; just solve for the duration and use the previous (let ((duration (/ (vector-vector-xz-distance to from) xz-vel))) (setup-from-to-duration! this from to duration grav) ) + 0 (none) ) -(defmethod setup-from-to-y-vel! trajectory ((this trajectory) (from vector) (to vector) (y-vel float) (grav float)) +(defmethod setup-from-to-y-vel! ((this trajectory) (from vector) (to vector) (y-vel float) (grav float)) "Set up a trajectory with the given initial y velocity." (let* ((f0-0 y-vel) - (f1-3 (- (* f0-0 f0-0) (* (* 2.0 (- (-> from y) (-> to y))) grav))) + (f1-3 (- (* f0-0 f0-0) (* 2.0 (- (-> from y) (-> to y)) grav))) (f0-3 900.0) ) - (when (>= f1-3 0.0) - (let ((f0-4 (sqrtf f1-3))) - (set! f0-3 (fmax (/ (- (- y-vel) f0-4) grav) (/ (+ (- y-vel) f0-4) grav))) - ) + (when (>= f1-3 0.0) + (let ((f0-4 (sqrtf f1-3))) + (set! f0-3 (fmax (/ (- (- y-vel) f0-4) grav) (/ (+ (- y-vel) f0-4) grav))) + ) + ) + (setup-from-to-duration! this from to f0-3 grav) ) - (setup-from-to-duration! this from to f0-3 grav) - ) 0 (none) ) -(defmethod setup-from-to-height! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-height! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) "Setup a trajectory that reaches a given height" (let* ((f1-2 (+ arg2 (fmax (-> arg0 y) (-> arg1 y)))) - (f1-5 (* (* 2.0 (- (-> arg0 y) f1-2)) arg3)) + (f1-5 (* 2.0 (- (-> arg0 y) f1-2) arg3)) (f0-3 4096.0) ) - (if (< 0.0 f1-5) - (set! f0-3 (sqrtf f1-5)) + (if (< 0.0 f1-5) + (set! f0-3 (sqrtf f1-5)) + ) + (setup-from-to-y-vel! this arg0 arg1 f0-3 arg3) ) - (setup-from-to-y-vel! this arg0 arg1 f0-3 arg3) - ) + 0 (none) ) -(defmethod debug-draw! trajectory ((this trajectory)) +(defmethod debug-draw! ((this trajectory)) "Draw the trajectory" (let ((prev-pos (new 'stack-no-clear 'vector)) (pos (new 'stack-no-clear 'vector)) @@ -98,15 +99,16 @@ (eval-position! this t-eval pos) ) (add-debug-line - #t - (bucket-id debug-no-zbuf) - prev-pos - pos - (new 'static 'rgba :r #xff :a #x80) - #f - (the-as rgba -1) - ) + #t + (bucket-id debug-no-zbuf) + prev-pos + pos + (new 'static 'rgba :r #xff :a #x80) + #f + (the-as rgba -1) + ) ) ) + 0 (none) ) diff --git a/goal_src/jak1/engine/ps2/memcard-h.gc b/goal_src/jak1/engine/ps2/memcard-h.gc index 975a6e527ad..0d328c08492 100644 --- a/goal_src/jak1/engine/ps2/memcard-h.gc +++ b/goal_src/jak1/engine/ps2/memcard-h.gc @@ -9,64 +9,56 @@ (deftype mc-handle (int32) () - :flag-assert #x900000004 ) ;; Information sent from the C kernel about a file on a memory card (deftype mc-file-info (structure) - ((present int32 :offset-assert 0) - (blind-data float 16 :offset-assert 4) - (blind-data-int8 int8 64 :offset 4) - (level-index int32 :offset 4) - (fuel-cell-count float :offset 8) - (money-count float :offset 12) - (buzzer-count float :offset 16) - (completion-percentage float :offset 20) - (minute uint8 :offset 24) - (hour uint8 :offset 25) - (week uint8 :offset 26) - (day uint8 :offset 27) - (month uint8 :offset 28) - (year uint8 :offset 29) + ((present int32) + (blind-data float 16) + (blind-data-int8 int8 64 :overlay-at (-> blind-data 0)) + (level-index int32 :overlay-at (-> blind-data 0)) + (fuel-cell-count float :overlay-at (-> blind-data 1)) + (money-count float :overlay-at (-> blind-data 2)) + (buzzer-count float :overlay-at (-> blind-data 3)) + (completion-percentage float :overlay-at (-> blind-data 4)) + (minute uint8 :overlay-at (-> blind-data 5)) + (hour uint8 :overlay-at (-> blind-data-int8 21)) + (week uint8 :overlay-at (-> blind-data-int8 22)) + (day uint8 :overlay-at (-> blind-data-int8 23)) + (month uint8 :overlay-at (-> blind-data 6)) + (year uint8 :overlay-at (-> blind-data-int8 25)) ) :pack-me - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) ;; Information sent from the C kernel about all the files on a memory card. ;; Note that the C kernel takes care of cleaning up all this, so in GOAL ;; we should assume that all this data is valid. (deftype mc-slot-info (structure) - ((handle int32 :offset-assert 0) - (known int32 :offset-assert 4) - (formatted int32 :offset-assert 8) - (inited int32 :offset-assert 12) - (last-file int32 :offset-assert 16) - (mem-required int32 :offset-assert 20) - (mem-actual int32 :offset-assert 24) - (file mc-file-info 4 :inline :offset-assert 28) + ((handle int32) + (known int32) + (formatted int32) + (inited int32) + (last-file int32) + (mem-required int32) + (mem-actual int32) + (file mc-file-info 4 :inline) ) :pack-me - :method-count-assert 9 - :size-assert #x12c - :flag-assert #x90000012c ) + (defun mc-sync () "Block here, waiting for the memory card to finish being read/written. Note - this will freeze the entire game, so this should not be used outside of debugging." (let ((v0-0 0)) - (while (zero? v0-0) - ;; run the memory card state machine (in C Kernel) - (mc-run) - ;; see if we got a good response - (set! v0-0 (mc-check-result)) + (while (zero? v0-0) + (mc-run) + (set! v0-0 (mc-check-result)) + ) + v0-0 ) - v0-0 - ) ) (defun show-mc-info ((dma-buf dma-buffer)) @@ -77,30 +69,44 @@ (cond ((zero? (-> info known)) (format (clear *temp-string*) "SLOT ~D: EXAMINING SLOT~%" slot-idx) + *temp-string* ) ((zero? (-> info handle)) (format (clear *temp-string*) "SLOT ~D: NO CARD~%" slot-idx) + *temp-string* ) ((zero? (-> info formatted)) (format (clear *temp-string*) "SLOT ~D: CARD [~D] : NOT FORMATTED~%" slot-idx (-> info handle)) + *temp-string* ) ((zero? (-> info inited)) - (format (clear *temp-string*) "SLOT ~D: CARD [~D] : NO FILE [~D/~D]~%" - slot-idx (-> info handle) (-> info mem-required) (-> info mem-actual)) + (format + (clear *temp-string*) + "SLOT ~D: CARD [~D] : NO FILE [~D/~D]~%" + slot-idx + (-> info handle) + (-> info mem-required) + (-> info mem-actual) + ) + *temp-string* ) (else - (format (clear *temp-string*) "SLOT ~D: CARD [~D] : " slot-idx (-> info handle)) - (format *temp-string* "SAVES ~D ~D ~D ~D : LAST ~D~%" - (-> info file 0 present) - (-> info file 1 present) - (-> info file 2 present) - (-> info file 3 present) - (-> info last-file) + (format (clear *temp-string*) "SLOT ~D: CARD [~D] : " slot-idx (-> info handle)) + *temp-string* + (format + *temp-string* + "SAVES ~D ~D ~D ~D : LAST ~D~%" + (-> info file 0 present) + (-> info file 1 present) + (-> info file 2 present) + (-> info file 3 present) + (-> info last-file) + ) ) - ) ) (draw-string-xy *temp-string* dma-buf 32 (+ (* 12 slot-idx) 8) (font-color red) (font-flags shadow)) ) ) + 0 (none) ) diff --git a/goal_src/jak1/engine/ps2/pad.gc b/goal_src/jak1/engine/ps2/pad.gc index 942ef2b99d6..e29d7831134 100644 --- a/goal_src/jak1/engine/ps2/pad.gc +++ b/goal_src/jak1/engine/ps2/pad.gc @@ -66,53 +66,47 @@ (deftype hw-cpad (basic) (;; BASIC CONTROLLER data ;; status = 0x40 | (data length / 2) - (valid uint8 :offset-assert 4) ;; 0 if success, 255 if fail - (status uint8 :offset-assert 5) ;; depends on controller - (button0 uint16 :offset-assert 6) ;; binary button states! + (valid uint8) ;; 0 if success, 255 if fail + (status uint8) ;; depends on controller + (button0 uint16) ;; binary button states! ;; DUALSHOCK or JOYSTICK data ;; status (dualshock) = 0x70 | (data length / 2) ;; status (joystick) = 0x50 | (data length / 2) - (rightx uint8 :offset-assert 8) ;; right stick xdir - (righty uint8 :offset-assert 9) ;; right stick ydir - (leftx uint8 :offset-assert 10) ;; left stick xdir - (lefty uint8 :offset-assert 11) ;; left stick ydir + (rightx uint8) ;; right stick xdir + (righty uint8) ;; right stick ydir + (leftx uint8) ;; left stick xdir + (lefty uint8) ;; left stick ydir ;; DUALSHOCK 2 data ;; status = 0x70 | (data length / 2) - (abutton uint8 12 :offset-assert 12) ;; pressure sensitivity information + (abutton uint8 12) ;; pressure sensitivity information ;; pad buffer needs to be 32 bytes large. - (dummy uint8 12 :offset-assert 24) + (dummy uint8 12) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; data from hardware + additional info calculated here. (deftype cpad-info (hw-cpad) - ((number int32 :offset-assert 36) ;; controller port number - (cpad-file int32 :offset-assert 40) - (button0-abs pad-buttons 3 :offset-assert 44) ;; bitmask of buttons, pressed or not, with history - (button0-shadow-abs pad-buttons 1 :offset-assert 56) ;; modify this to change button history in the future. - (button0-rel pad-buttons 3 :offset-assert 60) ;; bitmask of if button going down. - (stick0-dir float :offset-assert 72) - (stick0-speed float :offset-assert 76) - (new-pad int32 :offset-assert 80) - (state int32 :offset-assert 84) - (align uint8 6 :offset-assert 88) ;; hardware control of buzzing. - (direct uint8 6 :offset-assert 94) ;; hardware control of buzzing. - (buzz-val uint8 2 :offset-assert 100) ;; intensity for buzzing - (buzz-time time-frame 2 :offset-assert 104) ;; when to stop buzzing - (buzz basic :offset-assert 120) ;; is vibration enabled? - (buzz-act int32 :offset-assert 124) - (change-time time-frame :offset-assert 128) + ((number int32) ;; controller port number + (cpad-file int32) + (button0-abs pad-buttons 3) ;; bitmask of buttons, pressed or not, with history + (button0-shadow-abs pad-buttons 1) ;; modify this to change button history in the future. + (button0-rel pad-buttons 3) ;; bitmask of if button going down. + (stick0-dir float) + (stick0-speed float) + (new-pad int32) + (state int32) + (align uint8 6) ;; hardware control of buzzing. + (direct uint8 6) ;; hardware control of buzzing. + (buzz-val uint8 2) ;; intensity for buzzing + (buzz-time time-frame 2) ;; when to stop buzzing + (buzz basic) ;; is vibration enabled? + (buzz-act int32) + (change-time time-frame) ) (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) - :method-count-assert 9 - :size-assert #x88 - :flag-assert #x900000088 ) (defmacro cpad-type? (type) @@ -165,15 +159,12 @@ ;; List of controllers. It always has 4 controllers. (deftype cpad-list (basic) - ((num-cpads int32 :offset-assert 4) - (cpads cpad-info 4 :offset-assert 8) ;; modified from 2->4 for PC 4-pad support + ((num-cpads int32) + (cpads cpad-info 4) ;; modified from 2->4 for PC 4-pad support ) (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) diff --git a/goal_src/jak1/engine/ps2/rpc-h.gc b/goal_src/jak1/engine/ps2/rpc-h.gc index 9f39d37b597..395d6561a43 100644 --- a/goal_src/jak1/engine/ps2/rpc-h.gc +++ b/goal_src/jak1/engine/ps2/rpc-h.gc @@ -21,20 +21,17 @@ ;; it is possible to use fewer elements than elt-count. ;; the buffer is 64-byte aligned. (deftype rpc-buffer (basic) - ((elt-size uint32 :offset-assert 4) - (elt-count uint32 :offset-assert 8) - (elt-used uint32 :offset-assert 12) - (busy basic :offset-assert 16) ;; are we being sent currently? - (base pointer :offset-assert 20) ;; 64-byte aligned buffer of elts. + ((elt-size uint32) + (elt-count uint32) + (elt-used uint32) + (busy basic) ;; are we being sent currently? + (base pointer) ;; 64-byte aligned buffer of elts. ;; I suspect this was 16-byte aligned for DMA purposes. - (data uint8 :dynamic :offset 32) + (data uint8 :dynamic :offset 32) ) (:methods - (new (symbol type uint uint) rpc-buffer 0) + (new (symbol type uint uint) rpc-buffer) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (defmethod new rpc-buffer ((allocation symbol) (type-to-make type) (elt-size uint) (elt-count uint)) @@ -58,22 +55,19 @@ ;; The other is referred to as the active buffer. ;; This also supports receiving data, though it just gives you a plain pointer. (deftype rpc-buffer-pair (basic) - ((buffer rpc-buffer 2 :offset-assert 4) ;; the two buffers - (current rpc-buffer :offset-assert 12) ;; the buffer being loaded - (last-recv-buffer pointer :offset-assert 16) ;; the last reply - (rpc-port int32 :offset-assert 20) ;; the RPC port number + ((buffer rpc-buffer 2) ;; the two buffers + (current rpc-buffer) ;; the buffer being loaded + (last-recv-buffer pointer) ;; the last reply + (rpc-port int32) ;; the RPC port number ) - :method-count-assert 15 - :size-assert #x18 - :flag-assert #xf00000018 (:methods - (new (symbol type uint uint int) rpc-buffer-pair 0) - (call (rpc-buffer-pair uint pointer uint) int 9) - (add-element (rpc-buffer-pair) pointer 10) - (decrement-elt-used (rpc-buffer-pair) int 11) - (sync (rpc-buffer-pair symbol) int 12) - (check-busy (rpc-buffer-pair) symbol 13) - (pop-last-received (rpc-buffer-pair) pointer 14) + (new (symbol type uint uint int) rpc-buffer-pair) + (call (rpc-buffer-pair uint pointer uint) int) + (add-element (rpc-buffer-pair) pointer) + (decrement-elt-used (rpc-buffer-pair) int) + (sync (rpc-buffer-pair symbol) int) + (check-busy (rpc-buffer-pair) symbol) + (pop-last-received (rpc-buffer-pair) pointer) ) ) @@ -89,50 +83,50 @@ ) ) -;; method 12 -(defmethod sync rpc-buffer-pair ((this rpc-buffer-pair) (print-stall-warning symbol)) +(defmethod sync ((this rpc-buffer-pair) (print-stall-warning symbol)) "Wait for the in progress RPC to complete." - (let ((active-buffer (if (= (-> this buffer 0) (-> this current)) + (let ((active-buffer (if (= (-> this current) (-> this buffer 0)) (-> this buffer 1) - (-> this buffer 0)) + (-> this buffer 0) + ) ) ) - (when (-> active-buffer busy) ;; the flag is set, meaning we should check. - (cond - ((!= 0 (rpc-busy? (-> this rpc-port))) - ;; we're busy - (if print-stall-warning - (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> this rpc-port)) - ) - (while (!= 0 (rpc-busy? (-> this rpc-port))) - ;; real game has a bunch of nops - (+ 1 2 3) - ) - ) - (else - ;; not actually busy, clear the flag! - (set! (-> active-buffer busy) #f) - (set! (-> active-buffer elt-used) 0) + (when (nonzero? (rpc-busy? (-> this rpc-port))) + ;; we're busy + (if print-stall-warning + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> this rpc-port)) + ) + (while (nonzero? (rpc-busy? (-> this rpc-port))) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) ) ) + ;; not longer busy, clear the flag! + (set! (-> active-buffer busy) #f) + (set! (-> active-buffer elt-used) (the-as uint 0)) + 0 ) - ) - 0 + 0 ) -;; method 13 -(defmethod check-busy rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod check-busy ((this rpc-buffer-pair)) "Is the currently running RPC still busy?" - (let ((active-buffer (if (= (-> this buffer 0) (-> this current)) + (let ((active-buffer (if (= (-> this current) (-> this buffer 0)) (-> this buffer 1) (-> this buffer 0) ))) (when (-> active-buffer busy) - (if (!= 0 (rpc-busy? (-> this rpc-port))) - (return-from #f #t) + (if (nonzero? (rpc-busy? (-> this rpc-port))) + (return #t) ) (set! (-> active-buffer busy) #f) (set! (-> active-buffer elt-used) 0) @@ -141,26 +135,33 @@ #f ) - -;; method 9 -(defmethod call rpc-buffer-pair ((this rpc-buffer-pair) (fno uint) (recv-buff pointer) (recv-size uint)) +(defmethod call ((obj rpc-buffer-pair) (fno uint) (recv-buff pointer) (recv-size uint)) "Call an RPC. This is an async RPC. Use check-busy or sync to see if it's done." - (when (!= 0 (-> this current elt-used)) + (when (nonzero? (-> obj current elt-used)) ;; when we have used elements - ;; (format 0 "call rpc-buffer-pair with ~D elts~%" (-> this current elt-used)) - + ;; make sure the previous buffer is done - (let ((active-buffer (if (= (-> this buffer 0) (-> this current)) - (-> this buffer 1) - (-> this buffer 0)))) + (let ((active-buffer (if (= (-> obj current) (-> obj buffer 0)) + (-> obj buffer 1) + (-> obj buffer 0) + ) + ) + ) (when (-> active-buffer busy) ;; we think the active buffer may be busy. ;; first lets just do a simple check - (when (!= 0 (rpc-busy? (-> this rpc-port))) + (when (nonzero? (rpc-busy? (-> obj rpc-port))) ;; busy! print an error and stall! - (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> this rpc-port)) - (while (!= 0 (rpc-busy? (-> this rpc-port))) - (+ 1 2 3) + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) + (while (nonzero? (rpc-busy? (-> obj rpc-port))) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) ) ) ;; not busy. @@ -168,69 +169,64 @@ (set! (-> active-buffer elt-used) 0) ) ;; now we've cleared the last RPC call, we can do another - (let ((current-buffer (-> this current))) + (let ((current-buffer (-> obj current))) ;; rpc_channel, fno, async, send_buff, send_size, recv_buff, recv_size - ;; (format 0 "recv-size is ~D~%" recv-size) - (rpc-call (-> this rpc-port) - fno - (the uint 1) - (the uint (-> current-buffer base)) - (the int (* (-> current-buffer elt-used) (-> current-buffer elt-size))) - (the uint recv-buff) - (the int recv-size) - ) + (rpc-call + (-> obj rpc-port) + fno + (the-as uint 1) + (the-as uint (-> current-buffer base)) + (the-as int (* (-> current-buffer elt-size) (-> current-buffer elt-used))) + (the-as uint recv-buff) + (the-as int recv-size) + ) (set! (-> current-buffer busy) #t) - (set! (-> this last-recv-buffer) recv-buff) - (set! (-> this current) active-buffer) ) + (set! (-> obj last-recv-buffer) recv-buff) + (set! (-> obj current) active-buffer) ) ) 0 ) - -;; method 14 -(defmethod pop-last-received rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod pop-last-received ((this rpc-buffer-pair)) (let ((result (-> this last-recv-buffer))) - (set! (-> this last-recv-buffer) (the pointer #f)) + (set! (-> this last-recv-buffer) (the-as pointer #f)) result ) ) -;; method 10 -(defmethod add-element rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod add-element ((this rpc-buffer-pair)) "Add an element, and return a pointer to the element. If we are out of elements, flush by doing an RPC call. DANGER: this uses all arguments of 0. If you want something else, flush it yourself. If we're RPC 0 and we do this auto-flush, print a warning. " (let ((current-buffer (-> this current))) - (when (= (-> current-buffer elt-count) (-> current-buffer elt-used)) + (when (= (-> current-buffer elt-used) (-> current-buffer elt-count)) ;; oops, we're full. - (when (= 0 (-> this rpc-port)) + (when (zero? (-> this rpc-port)) ;; if we're RPC 0, this is evidently a situation to warn about. (format 0 "WARNING: too many sound commands queued~%") ;;(sound-buffer-dump) ) ;; otherwise we just flush ;; seems kinda dangerous. these could be the wrong parameters... - (call this (the uint 0) (the pointer 0) (the uint 0)) + (call this (the-as uint 0) (the-as pointer 0) (the-as uint 0)) ;; update the current-buffer. (set! current-buffer (-> this current)) ) - (let ((result (&+ (-> current-buffer base) (* (-> current-buffer elt-size) (-> current-buffer elt-used))))) + (let ((result (&+ (-> current-buffer base) (* (-> current-buffer elt-used) (-> current-buffer elt-size))))) (+! (-> current-buffer elt-used) 1) result ) ) ) - -;; method 11 -(defmethod decrement-elt-used rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod decrement-elt-used ((this rpc-buffer-pair)) "If elt-used > 0, decrease it by one." - (when (> (-> this current elt-used) 0) - (-! (-> this current elt-used) 1) - ) + (if (> (-> this current elt-used) 0) + (+! (-> this current elt-used) -1) + ) 0 ) diff --git a/goal_src/jak1/engine/ps2/timer-h.gc b/goal_src/jak1/engine/ps2/timer-h.gc index 40c2b065add..f027412d4a8 100644 --- a/goal_src/jak1/engine/ps2/timer-h.gc +++ b/goal_src/jak1/engine/ps2/timer-h.gc @@ -54,60 +54,43 @@ ;; this matches the Tn_MODE register structure of the ps2 EE timers. ;; Only the lower 32 bits of these registers are usable, and the upper 16 hardwired to zero (deftype timer-mode (uint32) - ((clks timer-clock-selection :offset 0 :size 2) - (gate uint8 :offset 2 :size 1) ;; gate function enable - (gats uint8 :offset 3 :size 1) ;; gate selection: 0 = hblank, 1 = vblank - ;; gate mode: - ;; 0: count while gate signal is low - ;; 1: start when gate signal rises - ;; 2: start when gate signal falls - ;; 3: start when gate signal rises/falls - (gatm uint8 :offset 4 :size 2) - (zret uint8 :offset 6 :size 1) ;; zero return: clear counter when equal to reference value - (cue uint8 :offset 7 :size 1) ;; count-up enable - (cmpe uint8 :offset 8 :size 1) ;; compare-interrupt enable - (ovfe uint8 :offset 9 :size 1) ;; overflow-interrupt enable - (equf uint8 :offset 10 :size 1) ;; equal-flag - (ovff uint8 :offset 11 :size 1) ;; overflow-flag + ((clks timer-clock-selection :offset 0 :size 2) + (gate uint8 :offset 2 :size 1) + (gats uint8 :offset 3 :size 1) + (gatm uint8 :offset 4 :size 2) + (zret uint8 :offset 6 :size 1) + (cue uint8 :offset 7 :size 1) + (cmpe uint8 :offset 8 :size 1) + (ovfe uint8 :offset 9 :size 1) + (equf uint8 :offset 10 :size 1) + (ovff uint8 :offset 11 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; this matches an EE timer (without a HOLD register, timers 2 and 3) ;; Each register is 128-bits wide, but only the lower 32-bits are usable, and the upper ;; 16-bits of that are hardwired to zero. (deftype timer-bank (structure) - ((count uint32 :offset 0) - (mode timer-mode :offset 16) - (comp uint32 :offset 32) + ((count uint32 :offset 0) + (mode timer-mode :offset 16) + (comp uint32 :offset 32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; this matches an EE timer (with a HOLD register, timers 0 and 1) (deftype timer-hold-bank (timer-bank) - ((hold uint32 :offset 48) + ((hold uint32 :offset 48) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; stopwatches are used to measure CPU clock cycles ;; they don't use the timer above, but instead the Count COP0 register ;; which counts CPU clock cycles directly (deftype stopwatch (basic) - ((prev-time-elapsed time-frame :offset-assert 8) - (start-time time-frame :offset-assert 16) - (begin-level int32 :offset-assert 24) + ((prev-time-elapsed time-frame) + (start-time time-frame) + (begin-level int32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; Confusing! What IS this measuring exactly? Hmm... @@ -136,42 +119,27 @@ ;; A single thing in the profiler (deftype profile-frame (structure) - ((name symbol :offset-assert 0) - (time-stamp uint32 :offset-assert 4) - (color rgba :offset-assert 8) + ((name symbol) + (time-stamp uint32) + (color rgba) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) -(defmethod inspect profile-frame ((this profile-frame)) - (let ((this-frame this)) - (format #t "[~8x] profile-frame~%" this-frame) - (format #t "~Tname: ~A~%" (-> this-frame name)) - (format #t "~Ttime-stamp: ~D~%" (-> this-frame time-stamp)) - (format #t "~Tcolor: ~D ~D ~D~%" (-> this-frame color r) (-> this-frame color g) (-> this-frame color b)) - ) - this - ) ;; A "bar" to display all the timed events (declare-type dma-buffer basic) (deftype profile-bar (basic) - ((profile-frame-count int32 :offset-assert 4) - (cache-time time-frame :offset-assert 8) - (data profile-frame 1024 :inline :offset-assert 16) + ((profile-frame-count int32) + (cache-time time-frame) + (data profile-frame 1024 :inline) ) - :method-count-assert 14 - :size-assert #x4010 - :flag-assert #xe00004010 (:methods - (new (symbol type) _type_ 0) - (get-last-frame-time-stamp (_type_) uint 9) - (reset (_type_) _type_ 10) - (add-frame (_type_ symbol rgba) profile-frame 11) - (add-end-frame (_type_ symbol rgba) profile-frame 12) - (draw (_type_ dma-buffer int) float 13) + (new (symbol type) _type_) + (get-last-frame-time-stamp (_type_) uint) + (reset (_type_) _type_) + (add-frame (_type_ symbol rgba) profile-frame) + (add-end-frame (_type_ symbol rgba) profile-frame) + (draw (_type_ dma-buffer int) float) ) ) diff --git a/goal_src/jak1/engine/ps2/vif-h.gc b/goal_src/jak1/engine/ps2/vif-h.gc index d6555546ede..c5597844fbb 100644 --- a/goal_src/jak1/engine/ps2/vif-h.gc +++ b/goal_src/jak1/engine/ps2/vif-h.gc @@ -16,88 +16,63 @@ ;;VIF0_STAT or VIF1_STAT bitfields (deftype vif-stat (uint32) - ((vps uint8 :offset 0 :size 2) - (vew uint8 :offset 2 :size 1) - (mrk uint8 :offset 6 :size 1) - (vss uint8 :offset 8 :size 1) - (vfs uint8 :offset 9 :size 1) - (vis uint8 :offset 10 :size 1) - (int uint8 :offset 11 :size 1) - (er0 uint8 :offset 12 :size 1) - (er1 uint8 :offset 13 :size 1) - (fqc uint8 :offset 24 :size 4) + ((vps uint8 :offset 0 :size 2) + (vew uint8 :offset 2 :size 1) + (mrk uint8 :offset 6 :size 1) + (vss uint8 :offset 8 :size 1) + (vfs uint8 :offset 9 :size 1) + (vis uint8 :offset 10 :size 1) + (int uint8 :offset 11 :size 1) + (er0 uint8 :offset 12 :size 1) + (er1 uint8 :offset 13 :size 1) + (fqc uint8 :offset 24 :size 4) ) - - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) -(defmethod inspect vif-stat ((this vif-stat)) - (format #t "~Tvps: ~D" (-> this vps)) - (format #t "~Tvew: ~D" (-> this vew)) - (format #t "~Tmrk: ~D" (-> this mrk)) - (format #t "~Tvss: ~D" (-> this vss)) - (format #t "~Tvfs: ~D" (-> this vfs)) - (format #t "~Tvis: ~D" (-> this vis)) - (format #t "~Tint: ~D" (-> this int)) - (format #t "~Ter0: ~D" (-> this er0)) - (format #t "~Ter1: ~D" (-> this er1)) - (format #t "~Tfqc: ~D" (-> this fqc)) - this) ;; VIF "reset" register. (deftype vif-fbrst (uint32) - ((rst uint8 :offset 0 :size 1) - (fbk uint8 :offset 1 :size 1) - (stp uint8 :offset 2 :size 1) - (stc uint8 :offset 3 :size 1) + ((rst uint8 :offset 0 :size 1) + (fbk uint8 :offset 1 :size 1) + (stp uint8 :offset 2 :size 1) + (stc uint8 :offset 3 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; Error mask register (deftype vif-err (uint32) - ((mii uint8 :offset 0 :size 1) - (me0 uint8 :offset 1 :size 1) ;; PS2 hardware bug, must set this to 1 for correct operation. - (me1 uint8 :offset 2 :size 1) + ((mii uint8 :offset 0 :size 1) + (me0 uint8 :offset 1 :size 1) + (me1 uint8 :offset 2 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; Common layout of hardware registers shared between the two VIFs (deftype vif-bank (structure) - ((stat uint32 :offset-assert 0) - (fbrst uint32 :offset 16) - (err vif-err :offset 32) - (mark uint32 :offset 48) - (cycle uint32 :offset 64) - (mode uint32 :offset 80) - (num uint32 :offset 96) - (mask uint32 :offset 112) - (code uint32 :offset 128) - (itops uint32 :offset 144) - (base uint32 :offset 160) - (offset uint32 :offset 176) - (tops uint32 :offset 192) - (itop uint32 :offset 208) - (top uint32 :offset 224) - (r0 uint32 :offset 256) - (r1 uint32 :offset 272) - (r2 uint32 :offset 288) - (r3 uint32 :offset 304) - (c0 uint32 :offset 320) - (c1 uint32 :offset 336) - (c2 uint32 :offset 352) - (c3 uint32 :offset 368) + ((stat uint32) + (fbrst uint32 :offset 16) + (err vif-err :offset 32) + (mark uint32 :offset 48) + (cycle uint32 :offset 64) + (mode uint32 :offset 80) + (num uint32 :offset 96) + (mask uint32 :offset 112) + (code uint32 :offset 128) + (itops uint32 :offset 144) + (base uint32 :offset 160) + (offset uint32 :offset 176) + (tops uint32 :offset 192) + (itop uint32 :offset 208) + (top uint32 :offset 224) + (r0 uint32 :offset 256) + (r1 uint32 :offset 272) + (r2 uint32 :offset 288) + (r3 uint32 :offset 304) + (c0 uint32 :offset 320) + (c1 uint32 :offset 336) + (c2 uint32 :offset 352) + (c3 uint32 :offset 368) ) - :method-count-assert 9 - :size-assert #x174 - :flag-assert #x900000174 ) ;; PS2 VIF map. There are no VIFs in OpenGOAL. diff --git a/goal_src/jak1/engine/sound/gsound-h.gc b/goal_src/jak1/engine/sound/gsound-h.gc index f7e25a3e0b2..dd99d590b5d 100644 --- a/goal_src/jak1/engine/sound/gsound-h.gc +++ b/goal_src/jak1/engine/sound/gsound-h.gc @@ -28,24 +28,21 @@ (deftype sound-id (uint32) () (:methods - (unused-9 () none 9) ;; unused - ) - :flag-assert #xa00000004 + (unused-9 () none) + ) ) (deftype sound-bank-id (uint32) () - :flag-assert #x900000004 ) ;; Sound names were sometimes packed into a uint128 ;; this is also used for dgo names sent to the IOP. ;; fields added by us (deftype sound-name (uint128) - ((lo uint64 :offset 0) - (hi uint64 :offset 64) + ((lo uint64 :offset 0 :size 64) + (hi uint64 :offset 64 :size 64) ) - :flag-assert #x900000010 ) (defmacro static-sound-name (str) @@ -176,309 +173,245 @@ ;; like should match the sound type in OVERLORD ;; This is shared between all sound RPCs and acts like the header for the sound messages (deftype sound-rpc-cmd (structure) - ((rsvd1 uint16 :offset-assert 0) - (command sound-command :offset-assert 2) + ((rsvd1 uint16) + (command sound-command) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) -;; playback parameters sent to the IOP. + (deftype sound-play-parms (structure) - ((mask sound-mask :offset-assert 0) - (pitch-mod int16 :offset-assert 2) - (bend int16 :offset-assert 4) - (fo-min int16 :offset-assert 6) - (fo-max int16 :offset-assert 8) - (fo-curve int8 :offset-assert 10) - (priority int8 :offset-assert 11) - (volume int32 :offset-assert 12) - (trans vector3w :inline :offset-assert 16) - (group sound-group :offset-assert 28) + ((mask sound-mask) + (pitch-mod int16) + (bend int16) + (fo-min int16) + (fo-max int16) + (fo-curve int8) + (priority int8) + (volume int32) + (trans vector3w :inline) + (group sound-group) ) :pack-me - :method-count-assert 9 - :size-assert #x1d - :flag-assert #x90000001d ) + (deftype sound-rpc-bank-cmd (sound-rpc-cmd) - ((bank-name sound-name :offset-assert 16) + ((bank-name sound-name) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype sound-rpc-sound-cmd (sound-rpc-cmd) - ((id sound-id :offset-assert 4) + ((id sound-id) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype sound-rpc-group-cmd (sound-rpc-cmd) - ((group sound-group :offset-assert 4) + ((group sound-group) ) - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) + (deftype sound-rpc-load-bank (sound-rpc-bank-cmd) () - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype sound-rpc-load-music (sound-rpc-bank-cmd) () - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype sound-rpc-unload-bank (sound-rpc-bank-cmd) () - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype sound-rpc-play (sound-rpc-sound-cmd) - ((name sound-name :offset-assert 16) - (parms sound-play-parms :inline :offset-assert 32) + ((name sound-name) + (parms sound-play-parms :inline) ) - :method-count-assert 9 - :size-assert #x3d - :flag-assert #x90000003d ) + (deftype sound-rpc-pause-sound (sound-rpc-sound-cmd) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype sound-rpc-stop-sound (sound-rpc-sound-cmd) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype sound-rpc-continue-sound (sound-rpc-sound-cmd) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype sound-rpc-set-param (sound-rpc-sound-cmd) - ((parms sound-play-parms :inline :offset-assert 8) - (auto-time int32 :offset-assert 40) - (auto-from int32 :offset-assert 44) + ((parms sound-play-parms :inline) + (auto-time int32) + (auto-from int32) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype sound-rpc-set-master-volume (sound-rpc-group-cmd) - ((volume int32 :offset-assert 8) + ((volume int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) + (deftype sound-rpc-pause-group (sound-rpc-group-cmd) () - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) + (deftype sound-rpc-stop-group (sound-rpc-group-cmd) () - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) + (deftype sound-rpc-continue-group (sound-rpc-group-cmd) () - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) + (deftype sound-rpc-get-irx-version (sound-rpc-cmd) - ((major uint32 :offset-assert 4) - (minor uint32 :offset-assert 8) - (ee-addr pointer :offset-assert 12) + ((major uint32) + (minor uint32) + (ee-addr pointer) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype sound-rpc-set-language (sound-rpc-cmd) - ((lang uint32 :offset-assert 4) + ((lang uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype sound-rpc-set-falloff-curve (sound-rpc-cmd) - ((curve int32 :offset-assert 4) - (falloff int32 :offset-assert 8) - (ease int32 :offset-assert 12) + ((curve int32) + (falloff int32) + (ease int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype sound-rpc-set-sound-falloff (sound-rpc-cmd) - ((name sound-name :offset-assert 16) - (curve int32 :offset-assert 32) - (min int32 :offset-assert 36) - (max int32 :offset-assert 40) + ((name sound-name) + (curve int32) + (min int32) + (max int32) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) + (deftype sound-rpc-reload-info (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) + (deftype sound-rpc-set-reverb (sound-rpc-cmd) - ((core uint8 :offset-assert 4) - (reverb int32 :offset-assert 8) - (left uint32 :offset-assert 12) - (right uint32 :offset-assert 16) + ((core uint8) + (reverb int32) + (left uint32) + (right uint32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) + (deftype sound-rpc-set-ear-trans (sound-rpc-cmd) - ((ear-trans vector3w :inline :offset-assert 4) - (cam-trans vector3w :inline :offset-assert 16) - (cam-angle int32 :offset-assert 28) + ((ear-trans vector3w :inline) + (cam-trans vector3w :inline) + (cam-angle int32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (deftype sound-rpc-set-flava (sound-rpc-cmd) - ((flava uint8 :offset-assert 4) + ((flava uint8) ) - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) + (deftype sound-rpc-shutdown (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) + (deftype sound-rpc-set-fps (sound-rpc-cmd) - ((fps uint8 :offset-assert 4) + ((fps uint8) ) - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) + (deftype sound-rpc-list-sounds (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) + (deftype sound-rpc-unload-music (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) + ;; og:preserve-this added for mirror mode (deftype sound-rpc-set-mirror-mode (sound-rpc-cmd) ((mirror sound-mirror-mode))) + ;; union of all the possible sound commands. (deftype sound-rpc-union (structure) - ((data uint32 20 :offset-assert 0) - (load-bank sound-rpc-load-bank :offset 0) - (unload-bank sound-rpc-unload-bank :offset 0) - (play sound-rpc-play :offset 0) - (pause-sound sound-rpc-pause-sound :offset 0) - (stop-sound sound-rpc-stop-sound :offset 0) - (continue-sound sound-rpc-continue-sound :offset 0) - (set-param sound-rpc-set-param :offset 0) - (set-master-volume sound-rpc-set-master-volume :offset 0) - (pause-group sound-rpc-pause-group :offset 0) - (stop-group sound-rpc-stop-group :offset 0) - (continue-group sound-rpc-continue-group :offset 0) - (get-irx-version sound-rpc-get-irx-version :offset 0) - (set-falloff-curve sound-rpc-set-falloff-curve :offset 0) - (set-sound-falloff sound-rpc-set-sound-falloff :offset 0) - (reload-info sound-rpc-reload-info :offset 0) - (set-language sound-rpc-set-language :offset 0) - (set-reverb sound-rpc-set-reverb :offset 0) - (set-ear-trans sound-rpc-set-ear-trans :offset 0) - (set-flava sound-rpc-set-flava :offset 0) - (set-fps sound-rpc-set-fps :offset 0) - (shutdown sound-rpc-shutdown :offset 0) - (list-sounds sound-rpc-list-sounds :offset 0) - (unload-music sound-rpc-unload-music :offset 0) - (mirror-mode sound-rpc-set-mirror-mode :offset 0) + ((data uint32 20) + (load-bank sound-rpc-load-bank :overlay-at (-> data 0)) + (unload-bank sound-rpc-unload-bank :overlay-at (-> data 0)) + (play sound-rpc-play :overlay-at (-> data 0)) + (pause-sound sound-rpc-pause-sound :overlay-at (-> data 0)) + (stop-sound sound-rpc-stop-sound :overlay-at (-> data 0)) + (continue-sound sound-rpc-continue-sound :overlay-at (-> data 0)) + (set-param sound-rpc-set-param :overlay-at (-> data 0)) + (set-master-volume sound-rpc-set-master-volume :overlay-at (-> data 0)) + (pause-group sound-rpc-pause-group :overlay-at (-> data 0)) + (stop-group sound-rpc-stop-group :overlay-at (-> data 0)) + (continue-group sound-rpc-continue-group :overlay-at (-> data 0)) + (get-irx-version sound-rpc-get-irx-version :overlay-at (-> data 0)) + (set-falloff-curve sound-rpc-set-falloff-curve :overlay-at (-> data 0)) + (set-sound-falloff sound-rpc-set-sound-falloff :overlay-at (-> data 0)) + (reload-info sound-rpc-reload-info :overlay-at (-> data 0)) + (set-language sound-rpc-set-language :overlay-at (-> data 0)) + (set-reverb sound-rpc-set-reverb :overlay-at (-> data 0)) + (set-ear-trans sound-rpc-set-ear-trans :overlay-at (-> data 0)) + (set-flava sound-rpc-set-flava :overlay-at (-> data 0)) + (set-fps sound-rpc-set-fps :overlay-at (-> data 0)) + (shutdown sound-rpc-shutdown :overlay-at (-> data 0)) + (list-sounds sound-rpc-list-sounds :overlay-at (-> data 0)) + (unload-music sound-rpc-unload-music :overlay-at (-> data 0)) + (mirror-mode sound-rpc-set-mirror-mode :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; GOAL-side sound specification. (deftype sound-spec (basic) - ((mask sound-mask :offset-assert 4) - (num float :offset-assert 8) - (group sound-group :offset-assert 12) - (sound-name-char uint8 16 :offset 16) - (sound-name sound-name :score 20 :offset 16) - (trans float 4 :offset-assert 32) ;; guess - (volume int32 :offset-assert 48) - (pitch-mod int32 :offset-assert 52) - (bend int32 :offset-assert 56) - (fo-min int16 :offset-assert 60) - (fo-max int16 :offset-assert 62) - (fo-curve int8 :offset-assert 64) - (priority int8 :offset-assert 65) - (auto-time int32 :offset-assert 68) - (auto-from int32 :offset-assert 72) + ((mask sound-mask) + (num float) + (group sound-group) + (sound-name-char uint8 16 :offset 16) + (sound-name sound-name :overlay-at (-> sound-name-char 0)) + (trans float 4) + (volume int32) + (pitch-mod int32) + (bend int32) + (fo-min int16) + (fo-max int16) + (fo-curve int8) + (priority int8) + (auto-time int32) + (auto-from int32) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) (defmacro sound-vol (vol) @@ -518,33 +451,30 @@ ;; a in-game background sound. (declare-type entity basic) (deftype ambient-sound (basic) - ((spec sound-spec :offset-assert 4) - (playing-id sound-id :offset-assert 8) - (trans vector :inline :offset-assert 16) - (name sound-name :offset-assert 32) - (play-time time-frame :offset-assert 48) - (time-base time-frame :offset-assert 56) - (time-random time-frame :offset-assert 64) - (volume int32 :offset-assert 72) - (pitch int32 :offset-assert 76) - (falloff-near int32 :offset-assert 80) - (falloff-far int32 :offset-assert 84) - (falloff-mode int32 :offset-assert 88) - (params (pointer float) :offset-assert 92) - (param-count int32 :offset-assert 96) - (entity entity :offset-assert 100) - (sound-count int32 :offset-assert 104) + ((spec sound-spec) + (playing-id sound-id) + (trans vector :inline) + (name sound-name) + (play-time time-frame) + (time-base time-frame) + (time-random time-frame) + (volume int32) + (pitch int32) + (falloff-near int32) + (falloff-far int32) + (falloff-mode int32) + (params (pointer float)) + (param-count int32) + (entity entity) + (sound-count int32) ) - :method-count-assert 14 - :size-assert #x6c - :flag-assert #xe0000006c (:methods - (new (symbol type basic vector) _type_ 0) - (update! (_type_) int 9) - (change-sound! (_type_ sound-name) int 10) - (update-trans! (_type_ vector) int 11) - (update-vol! (_type_ int) int 12) - (stop! (_type_) int 13) + (new (symbol type basic vector) _type_) + (update! (_type_) int) + (change-sound! (_type_ sound-name) int) + (update-trans! (_type_ vector) int) + (update-vol! (_type_ int) int) + (stop! (_type_) int) ) ) diff --git a/goal_src/jak1/engine/sound/gsound.gc b/goal_src/jak1/engine/sound/gsound.gc index 3f958be80c9..991a386a010 100644 --- a/goal_src/jak1/engine/sound/gsound.gc +++ b/goal_src/jak1/engine/sound/gsound.gc @@ -21,24 +21,21 @@ ) (deftype sound-iop-info (basic) - ((frame uint32 :offset 16) - (strpos int32 :offset-assert 20) - (str-id sound-id :offset-assert 24) - (str-id-sign int32 :offset 24) - (freemem uint32 :offset-assert 28) - (chinfo uint8 48 :offset-assert 32) - (freemem2 uint32 :offset-assert 80) - (nocd uint32 :offset-assert 84) - (dirtycd uint32 :offset-assert 88) - (diskspeed uint32 2 :offset-assert 92) - (lastspeed uint32 :offset-assert 100) - (dupseg int32 :offset-assert 104) - (times uint32 41 :offset-assert 108) - (times-seq uint32 :offset-assert 272) + ((frame uint32 :offset 16) + (strpos int32) + (str-id sound-id) + (str-id-sign int32 :overlay-at str-id) + (freemem uint32) + (chinfo uint8 48) + (freemem2 uint32) + (nocd uint32) + (dirtycd uint32) + (diskspeed uint32 2) + (lastspeed uint32) + (dupseg int32) + (times uint32 41) + (times-seq uint32) ) - :method-count-assert 9 - :size-assert #x114 - :flag-assert #x900000114 ) (define *sound-iop-info* (new 'global 'sound-iop-info)) @@ -616,7 +613,7 @@ (define-extern *debug-effect-control* symbol) -(defmethod update! ambient-sound ((this ambient-sound)) +(defmethod update! ((this ambient-sound)) "Called once per frame to update the sound playback" (if (not *ambient-sound-class*) @@ -704,14 +701,14 @@ 0 ) -(defmethod stop! ambient-sound ((this ambient-sound)) +(defmethod stop! ((this ambient-sound)) "Halt playback of this ambient-sound" (sound-stop (-> this playing-id)) 0 ) -(defmethod update-trans! ambient-sound ((this ambient-sound) (sound-trans vector)) +(defmethod update-trans! ((this ambient-sound) (sound-trans vector)) "Update the position of the thing playing the sound" (set! (-> this trans quad) (-> sound-trans quad)) @@ -729,7 +726,7 @@ 0 ) -(defmethod update-vol! ambient-sound ((this ambient-sound) (arg0 int)) +(defmethod update-vol! ((this ambient-sound) (arg0 int)) "Update the volume of the sound" (when (nonzero? (-> this playing-id)) @@ -745,7 +742,7 @@ 0 ) -(defmethod change-sound! ambient-sound ((this ambient-sound) (name sound-name)) +(defmethod change-sound! ((this ambient-sound) (name sound-name)) "Change the sound being played" (when (not (sound-name= (-> this name) name)) (stop! this) @@ -832,21 +829,16 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftype flava-table-row (structure) - ((music symbol :offset-assert 0) - (flava uint8 50 :offset-assert 4) ;; index is some flava event, value is music variation + ((music symbol) + (flava uint8 50) ;; index is some flava event, value is music variation ) - :allow-misaligned :method-count-assert 9 - :size-assert #x36 - :flag-assert #x900000036 + :allow-misaligned ) (deftype flava-table (basic) - ((row flava-table-row 20 :inline :offset-assert 4) - (count int32 :offset-assert 1284) + ((row flava-table-row 20 :inline) + (count int32) ) - :method-count-assert 9 - :size-assert #x508 - :flag-assert #x900000508 ) ;; make a new flava table with nothing defined diff --git a/goal_src/jak1/engine/target/logic-target.gc b/goal_src/jak1/engine/target/logic-target.gc index 4fc5a484c98..f311aa57951 100644 --- a/goal_src/jak1/engine/target/logic-target.gc +++ b/goal_src/jak1/engine/target/logic-target.gc @@ -12,9 +12,7 @@ (defbehavior build-conversions target ((arg0 vector)) (surface-mult! (-> self control unknown-surface01) (-> self control unknown-surface00) (-> self control surf)) - (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-blue)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (and (= (-> self fact eco-type) (pickup-type eco-blue)) (>= (-> self fact eco-level) 1.0)) (or (= (-> self control unknown-surface00 name) 'run) (= (-> self control unknown-surface00 name) 'jump)) ) (+! (-> self control unknown-surface01 target-speed) 20480.0) @@ -2012,7 +2010,7 @@ (set! (-> self control unknown-cspace00 joint) (the-as joint (joint-node-index eichar-lod0-jg rindA))) (set! (-> self control unknown-cspace10 parent) (joint-node-index eichar-lod0-jg LshoulderPad)) (set! (-> self neck) (new 'process 'joint-mod (joint-mod-handler-mode look-at) self 7)) - (set! (-> self fact-info-target) + (set! (-> self fact) (new 'process 'fact-info-target self (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (set! (-> self sound) (new 'process 'ambient-sound 'none (-> self control trans))) @@ -2039,7 +2037,7 @@ (none) ) -(defmethod deactivate target ((this target)) +(defmethod deactivate ((this target)) (set-zero! *camera-smush-control*) (call-parent-method this) (none) diff --git a/goal_src/jak1/engine/target/target-death.gc b/goal_src/jak1/engine/target/target-death.gc index b90e0424841..ab58de1dd26 100644 --- a/goal_src/jak1/engine/target/target-death.gc +++ b/goal_src/jak1/engine/target/target-death.gc @@ -612,7 +612,7 @@ (case (-> arg4 angle) (('jump 'up 'up-forward) (when (and (not (logtest? (-> self control root-prim prim-core action) (collide-action racer flut))) - (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health)))) + (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health)))) ) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) (go target-attack-air #f) @@ -820,7 +820,7 @@ :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control unknown-cpad-info00 number) r2)) - (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) + (pickup-collectable! (-> self fact) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) (go target-stance) ) ) @@ -894,7 +894,7 @@ ) (else (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (the-as float -1000.0) (the-as handle #f) @@ -905,7 +905,7 @@ ) (('drown-death 'sharkey 'lava 'dark-eco-pool 'ogreboss-super-boulder 'melt 'instant-death) (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (the-as float -1000.0) (the-as handle #f) @@ -916,7 +916,7 @@ ) (('death) (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (the-as float -1000.0) (the-as handle #f) @@ -924,18 +924,18 @@ ) (('plant-boss) (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) ) - (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) (go target-death (-> gp-0 mode)) ) ) (else (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) @@ -956,7 +956,7 @@ (target-hit-setup-anim gp-0) (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-falling-anim-trans (the-as float 1.0)) ) - (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) (go target-death (-> gp-0 mode)) ) ) diff --git a/goal_src/jak1/engine/target/target-h.gc b/goal_src/jak1/engine/target/target-h.gc index ef1e15c231a..3ccb20e68df 100644 --- a/goal_src/jak1/engine/target/target-h.gc +++ b/goal_src/jak1/engine/target/target-h.gc @@ -14,40 +14,36 @@ ;; DECOMP BEGINS (deftype target (process-drawable) - ((self-override target :offset 28) - (control control-info :offset 112) - (fact-info-target fact-info-target :offset 144) - (skel2 basic :offset-assert 176) - (racer racer-info :offset-assert 180) - (game game-info :offset-assert 184) - (neck joint-mod :offset-assert 188) - (state-hook-time time-frame :offset-assert 192) - (state-hook (function none :behavior target) :offset-assert 200) - (cam-user-mode symbol :offset-assert 204) - (sidekick (pointer sidekick) :offset-assert 208) - (manipy (pointer manipy) :offset-assert 212) - (attack-info attack-info :inline :offset-assert 224) - (attack-info-rec attack-info :inline :offset-assert 336) - (anim-seed uint64 :offset-assert 440) - (alt-cam-pos vector :inline :offset-assert 448) - (snowball snowball-info :offset-assert 464) - (tube tube-info :offset-assert 468) - (flut flut-info :offset-assert 472) - (current-level level :offset-assert 476) - (saved-pos transformq :inline :offset-assert 480) - (saved-owner uint64 :offset-assert 528) - (alt-neck-pos vector :inline :offset-assert 544) - (fp-hud handle :offset-assert 560) - (no-load-wait time-frame :offset-assert 568) - (no-look-around-wait time-frame :offset-assert 576) - (burn-proc handle :offset-assert 584) + ((fact fact-info-target :override) + (self-override target :overlay-at self) + (control control-info :overlay-at root) + (skel2 basic) + (racer racer-info) + (game game-info) + (neck joint-mod) + (state-hook-time time-frame) + (state-hook (function none :behavior target)) + (cam-user-mode symbol) + (sidekick (pointer sidekick)) + (manipy (pointer manipy)) + (attack-info attack-info :inline) + (attack-info-rec attack-info :inline) + (anim-seed uint64) + (alt-cam-pos vector :inline) + (snowball snowball-info) + (tube tube-info) + (flut flut-info) + (current-level level) + (saved-pos transformq :inline) + (saved-owner uint64) + (alt-neck-pos vector :inline) + (fp-hud handle) + (no-load-wait time-frame) + (no-look-around-wait time-frame) + (burn-proc handle) ) - :heap-base #x1e0 - :method-count-assert 21 - :size-assert #x250 - :flag-assert #x1501e00250 (:methods - (find-edge-grabs! (_type_ collide-cache) object 20) + (find-edge-grabs! (_type_ collide-cache) object) ) (:states target-attack @@ -163,15 +159,11 @@ (define-perm *target* target #f) (deftype sidekick (process-drawable) - ((parent-override (pointer target) :offset 12) - (control control-info :offset 112) - (anim-seed uint64 :offset 192) - (shadow-in-movie? symbol :offset-assert 200) + ((parent-override (pointer target) :overlay-at parent) + (control control-info :overlay-at root) + (anim-seed uint64 :offset 192) + (shadow-in-movie? symbol) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xcc - :flag-assert #x14006000cc (:states sidekick-clone ) diff --git a/goal_src/jak1/engine/target/target-handler.gc b/goal_src/jak1/engine/target/target-handler.gc index 18024a112e9..e258e070b33 100644 --- a/goal_src/jak1/engine/target/target-handler.gc +++ b/goal_src/jak1/engine/target/target-handler.gc @@ -17,13 +17,8 @@ (let ((s4-0 (-> arg3 param 0)) (f28-0 (the-as float (-> arg3 param 1))) ) - (if (!= (pickup-collectable! - (-> self fact-info-target) - (the-as pickup-type s4-0) - (the-as float 0.0) - (the-as handle #f) - ) - (pickup-collectable! (-> self fact-info-target) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) + (if (!= (pickup-collectable! (-> self fact) (the-as pickup-type s4-0) (the-as float 0.0) (the-as handle #f)) + (pickup-collectable! (-> self fact) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) ) #t 'full @@ -32,7 +27,7 @@ ) ) (('reset-pickup) - (reset! (-> self fact-info-target) (the-as symbol (-> arg3 param 0))) + (reset! (-> self fact) (the-as symbol (-> arg3 param 0))) ) (('reset-collide) (cond @@ -53,13 +48,9 @@ (let ((s5-1 (-> v1-21 info))) (let ((v1-22 (-> s5-1 buzzer))) (if (zero? v1-22) - (set! (-> self fact-info-target buzzer) 0.0) - (set! (-> self fact-info-target buzzer) (pickup-collectable! - (-> self fact-info-target) - (pickup-type buzzer) - (the float (logior -65536 v1-22)) - (the-as handle #f) - ) + (set! (-> self fact buzzer) 0.0) + (set! (-> self fact buzzer) + (pickup-collectable! (-> self fact) (pickup-type buzzer) (the float (logior -65536 v1-22)) (the-as handle #f)) ) ) ) @@ -85,11 +76,11 @@ (('query) (case (-> arg3 param 0) (('powerup) - (and (= (-> self fact-info-target eco-type) (-> arg3 param 1)) (< 0.0 (-> self fact-info-target eco-level))) + (and (= (-> self fact eco-type) (-> arg3 param 1)) (< 0.0 (-> self fact eco-level))) ) (('pickup) (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (the-as pickup-type (-> arg3 param 1)) (the-as float 0.0) (the-as handle #f) @@ -318,9 +309,7 @@ ((or (logtest? (-> self state-flags) (state-flags invulnerable timed-invulnerable invuln-powerup)) (and (logtest? (-> arg1 mask) (attack-mask mode)) (= (-> arg1 mode) 'darkeco) - (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (and (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (logtest? (state-flags dangerous flop-hit-ground) (-> self state-flags)) ) ) @@ -362,11 +351,11 @@ (cond ((and (logtest? (-> self attack-info-rec mask) (attack-mask mode)) (and (= (-> self attack-info-rec mode) 'damage) - (not (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact-info-target health)))) + (not (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact health)))) ) ) (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) @@ -398,7 +387,7 @@ ) (else (logior! (-> self state-flags) (state-flags being-attacked)) - (if (and (= (-> self game mode) 'play) (and (>= 1.0 (-> self fact-info-target health)) (= arg0 'attack))) + (if (and (= (-> self game mode) 'play) (and (>= 1.0 (-> self fact health)) (= arg0 'attack))) (logior! (-> self state-flags) (state-flags dying)) ) (go arg4 arg0 (-> self attack-info-rec)) diff --git a/goal_src/jak1/engine/target/target-util.gc b/goal_src/jak1/engine/target/target-util.gc index aadcb2970cb..11d561227a6 100644 --- a/goal_src/jak1/engine/target/target-util.gc +++ b/goal_src/jak1/engine/target/target-util.gc @@ -29,92 +29,89 @@ ) (deftype target-bank (basic) - ((jump-collide-offset meters :offset-assert 4) - (jump-height-min meters :offset-assert 8) - (jump-height-max meters :offset-assert 12) - (double-jump-height-min meters :offset-assert 16) - (double-jump-height-max meters :offset-assert 20) - (flip-jump-height-min meters :offset-assert 24) - (flip-jump-height-max meters :offset-assert 28) - (duck-jump-height-min meters :offset-assert 32) - (duck-jump-height-max meters :offset-assert 36) - (flop-jump-height-min meters :offset-assert 40) - (flop-jump-height-max meters :offset-assert 44) - (attack-jump-height-min meters :offset-assert 48) - (attack-jump-height-max meters :offset-assert 52) - (edge-grab-jump-height-min meters :offset-assert 56) - (edge-grab-jump-height-max meters :offset-assert 60) - (swim-jump-height-min meters :offset-assert 64) - (swim-jump-height-max meters :offset-assert 68) - (tube-jump-height-min meters :offset-assert 72) - (tube-jump-height-max meters :offset-assert 76) - (wheel-duration time-frame :offset-assert 80) - (wheel-jump-pre-window time-frame :offset-assert 88) - (wheel-jump-post-window time-frame :offset-assert 96) - (wheel-timeout time-frame :offset-assert 104) - (wheel-speed-min meters :offset-assert 112) - (wheel-speed-inc meters :offset-assert 116) - (wheel-flip-duration time-frame :offset-assert 120) - (wheel-flip-height meters :offset-assert 128) - (wheel-flip-dist meters :offset-assert 132) - (wheel-flip-art-height meters :offset-assert 136) - (wheel-flip-art-dist meters :offset-assert 140) - (duck-slide-distance meters :offset-assert 144) - (fall-far meters :offset-assert 148) - (fall-far-inc meters :offset-assert 152) - (attack-timeout time-frame :offset-assert 160) - (ground-timeout time-frame :offset-assert 168) - (slide-down-timeout time-frame :offset-assert 176) - (fall-timeout time-frame :offset-assert 184) - (fall-stumble-threshold meters :offset-assert 192) - (yellow-projectile-speed meters :offset-assert 196) - (hit-invulnerable-timeout time-frame :offset-assert 200) - (run-cycle-length float :offset-assert 208) - (walk-cycle-dist meters :offset-assert 212) - (walk-up-cycle-dist meters :offset-assert 216) - (walk-down-cycle-dist meters :offset-assert 220) - (walk-side-cycle-dist meters :offset-assert 224) - (run-cycle-dist meters :offset-assert 228) - (run-up-cycle-dist meters :offset-assert 232) - (run-down-cycle-dist meters :offset-assert 236) - (run-side-cycle-dist meters :offset-assert 240) - (run-wall-cycle-dist meters :offset-assert 244) - (duck-walk-cycle-dist meters :offset-assert 248) - (wade-shallow-walk-cycle-dist meters :offset-assert 252) - (wade-deep-walk-cycle-dist meters :offset-assert 256) - (smack-surface-dist meters :offset-assert 260) - (smack-surface-height meters :offset-assert 264) - (min-dive-depth meters :offset-assert 268) - (root-radius meters :offset-assert 272) - (root-offset vector :inline :offset-assert 288) - (body-radius meters :offset-assert 304) - (edge-radius meters :offset-assert 308) - (edge-offset vector :inline :offset-assert 320) - (head-radius meters :offset-assert 336) - (head-height meters :offset-assert 340) - (head-offset vector :inline :offset-assert 352) - (spin-radius meters :offset-assert 368) - (spin-offset vector :inline :offset-assert 384) - (duck-spin-radius meters :offset-assert 400) - (duck-spin-offset vector :inline :offset-assert 416) - (punch-radius meters :offset-assert 432) - (punch-offset vector :inline :offset-assert 448) - (uppercut-radius meters :offset-assert 464) - (uppercut0-offset vector :inline :offset-assert 480) - (uppercut1-offset vector :inline :offset-assert 496) - (flop-radius meters :offset-assert 512) - (flop0-offset vector :inline :offset-assert 528) - (flop1-offset vector :inline :offset-assert 544) - (stuck-time seconds :offset-assert 560) - (stuck-timeout seconds :offset-assert 568) - (stuck-distance meters :offset-assert 576) - (tongue-pull-speed-min float :offset-assert 580) - (tongue-pull-speed-max float :offset-assert 584) - (yellow-attack-timeout time-frame :offset-assert 592) + ((jump-collide-offset meters) + (jump-height-min meters) + (jump-height-max meters) + (double-jump-height-min meters) + (double-jump-height-max meters) + (flip-jump-height-min meters) + (flip-jump-height-max meters) + (duck-jump-height-min meters) + (duck-jump-height-max meters) + (flop-jump-height-min meters) + (flop-jump-height-max meters) + (attack-jump-height-min meters) + (attack-jump-height-max meters) + (edge-grab-jump-height-min meters) + (edge-grab-jump-height-max meters) + (swim-jump-height-min meters) + (swim-jump-height-max meters) + (tube-jump-height-min meters) + (tube-jump-height-max meters) + (wheel-duration time-frame) + (wheel-jump-pre-window time-frame) + (wheel-jump-post-window time-frame) + (wheel-timeout time-frame) + (wheel-speed-min meters) + (wheel-speed-inc meters) + (wheel-flip-duration time-frame) + (wheel-flip-height meters) + (wheel-flip-dist meters) + (wheel-flip-art-height meters) + (wheel-flip-art-dist meters) + (duck-slide-distance meters) + (fall-far meters) + (fall-far-inc meters) + (attack-timeout time-frame) + (ground-timeout time-frame) + (slide-down-timeout time-frame) + (fall-timeout time-frame) + (fall-stumble-threshold meters) + (yellow-projectile-speed meters) + (hit-invulnerable-timeout time-frame) + (run-cycle-length float) + (walk-cycle-dist meters) + (walk-up-cycle-dist meters) + (walk-down-cycle-dist meters) + (walk-side-cycle-dist meters) + (run-cycle-dist meters) + (run-up-cycle-dist meters) + (run-down-cycle-dist meters) + (run-side-cycle-dist meters) + (run-wall-cycle-dist meters) + (duck-walk-cycle-dist meters) + (wade-shallow-walk-cycle-dist meters) + (wade-deep-walk-cycle-dist meters) + (smack-surface-dist meters) + (smack-surface-height meters) + (min-dive-depth meters) + (root-radius meters) + (root-offset vector :inline) + (body-radius meters) + (edge-radius meters) + (edge-offset vector :inline) + (head-radius meters) + (head-height meters) + (head-offset vector :inline) + (spin-radius meters) + (spin-offset vector :inline) + (duck-spin-radius meters) + (duck-spin-offset vector :inline) + (punch-radius meters) + (punch-offset vector :inline) + (uppercut-radius meters) + (uppercut0-offset vector :inline) + (uppercut1-offset vector :inline) + (flop-radius meters) + (flop0-offset vector :inline) + (flop1-offset vector :inline) + (stuck-time seconds) + (stuck-timeout seconds) + (stuck-distance meters) + (tongue-pull-speed-min float) + (tongue-pull-speed-max float) + (yellow-attack-timeout time-frame) ) - :method-count-assert 9 - :size-assert #x258 - :flag-assert #x900000258 ) @@ -637,7 +634,7 @@ 0 ) -(defmethod get-quaternion control-info ((this control-info)) +(defmethod get-quaternion ((this control-info)) (-> this unknown-quaternion00) ) @@ -651,7 +648,7 @@ ) ) -(defmethod apply-alignment target ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg2 quad)) (set! (-> s2-0 z) (target-align-vel-z-adjust (-> s2-0 z))) @@ -853,10 +850,7 @@ ((or (not (cpad-pressed? (-> self control unknown-cpad-info00 number) square)) (or (and (logtest? (-> self state-flags) (state-flags prevent-attack)) (or (not (logtest? (-> self state-flags) (state-flags remove-prevents))) - (not (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) - ) + (not (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0))) ) ) (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) @@ -869,9 +863,7 @@ ) ) (time-elapsed? - (if (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (if (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (-> *TARGET-bank* yellow-attack-timeout) (-> *TARGET-bank* attack-timeout) ) @@ -982,7 +974,7 @@ (none) ) -(defmethod combine! attack-info ((this attack-info) (arg0 attack-info)) +(defmethod combine! ((this attack-info) (arg0 attack-info)) (with-pp (let ((s4-0 (-> arg0 mask))) (set! (-> this mask) (-> arg0 mask)) diff --git a/goal_src/jak1/engine/target/target.gc b/goal_src/jak1/engine/target/target.gc index e41883be58e..b0c90f71bd6 100644 --- a/goal_src/jak1/engine/target/target.gc +++ b/goal_src/jak1/engine/target/target.gc @@ -1953,9 +1953,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (effect-control-method-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 74) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) (level-hint-spawn @@ -2047,9 +2045,7 @@ ) ) :enter (behavior () - (if (or (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (if (or (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (not (time-elapsed? (-> self control unknown-dword82) (seconds 1.5))) ) (go target-yellow-blast) @@ -2144,9 +2140,7 @@ (-> self control transv) ) ) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (effect-control-method-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 23) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) (level-hint-spawn @@ -2359,9 +2353,7 @@ (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) ) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (effect-control-method-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 70) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) (level-hint-spawn @@ -2516,9 +2508,7 @@ (go target-attack-air 'uppercut) ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (effect-control-method-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 23) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) ) @@ -2595,9 +2585,7 @@ ) ) :enter (behavior ((arg0 float) (arg1 float) (arg2 float)) - (if (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (if (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (go target-yellow-jump-blast) ) (if (= arg2 0.0) @@ -2655,9 +2643,7 @@ ) (when gp-1 (logior! (-> self control status) (cshape-moving-flags onsurf)) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (effect-control-method-10 (-> self skel effect) 'group-red-eco-strike-ground (ja-frame-num 0) 0) (let ((s5-1 (process-spawn touch-tracker :init touch-tracker-init (-> self control trans) 4096.0 30 :to self))) @@ -2682,9 +2668,7 @@ (go target-flop-hit-ground gp-1) ) ) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (effect-control-method-10 (-> self skel effect) 'group-red-eco-spinkick @@ -2841,9 +2825,7 @@ (go target-attack-air 'flop) ) ) - (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (not (time-elapsed? (-> self state-time) (seconds 0.25))) ) (effect-control-method-10 diff --git a/goal_src/jak1/engine/target/target2.gc b/goal_src/jak1/engine/target/target2.gc index bfa0a704ab5..cce4db58842 100644 --- a/goal_src/jak1/engine/target/target2.gc +++ b/goal_src/jak1/engine/target/target2.gc @@ -142,20 +142,16 @@ ) (deftype first-person-hud (process) - ((max-nb-of-particles int32 :offset-assert 112) - (nb-of-particles int32 :offset-assert 116) - (particles hud-particle 3 :offset-assert 120) - (in-out-position int32 :offset-assert 132) - (sides-x-scale float :offset-assert 136) - (sides-y-scale float :offset-assert 140) - (x-offset int32 :offset-assert 144) + ((max-nb-of-particles int32) + (nb-of-particles int32) + (particles hud-particle 3) + (in-out-position int32) + (sides-x-scale float) + (sides-y-scale float) + (x-offset int32) ) - :heap-base #x30 - :method-count-assert 15 - :size-assert #x94 - :flag-assert #xf00300094 (:methods - (dumb-15 (_type_) none 14) + (dumb-15 (_type_) none) ) (:states hud-coming-in @@ -168,7 +164,7 @@ (define *fp-hud-stack* (malloc 'global #x3800)) -(defmethod deactivate first-person-hud ((this first-person-hud)) +(defmethod deactivate ((this first-person-hud)) (dotimes (s5-0 (-> this nb-of-particles)) (kill-and-free-particles (-> this particles s5-0 part)) (set! (-> this particles s5-0 part matrix) -1) @@ -235,7 +231,7 @@ (none) ) -(defmethod relocate first-person-hud ((this first-person-hud) (arg0 int)) +(defmethod relocate ((this first-person-hud) (arg0 int)) (dotimes (v1-0 (-> this nb-of-particles)) (when (-> this particles v1-0 part) (if (nonzero? (-> this particles v1-0 part)) @@ -246,7 +242,7 @@ (the-as first-person-hud ((method-of-type process relocate) this arg0)) ) -(defmethod dumb-15 first-person-hud ((this first-person-hud)) +(defmethod dumb-15 ((this first-person-hud)) (dotimes (s5-0 (-> this nb-of-particles)) (set! (-> this particles s5-0 pos x) (+ -256.0 (-> this particles s5-0 init-pos x))) (set! (-> this particles s5-0 pos y) @@ -502,9 +498,7 @@ ) (pad-buttons r2 circle square) ) - (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (time-elapsed? (-> self control unknown-dword82) (seconds 0.5)) (not *pause-lock*) ) @@ -535,7 +529,7 @@ (.lvf vf5 (&-> s5-1 quad)) (.add.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-48 quad) vf6) - (let ((t1-0 (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + (let ((t1-0 (if (>= (-> self fact eco-level) (-> *FACT-bank* eco-level-max)) 56 40 ) @@ -655,9 +649,7 @@ (pad-buttons r2 circle square) ) (time-elapsed? (-> self control unknown-dword82) (seconds 0.45)) - (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (not *pause-lock*) ) (let ((gp-1 (vector-float*! @@ -687,7 +679,7 @@ (.lvf vf5 (&-> s5-1 quad)) (.add.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-48 quad) vf6) - (let ((t1-0 (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + (let ((t1-0 (if (>= (-> self fact eco-level) (-> *FACT-bank* eco-level-max)) 120 104 ) @@ -1352,9 +1344,7 @@ (let ((s5-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)))) (set! (-> s5-2 y) 0.0) (vector-normalize! s5-2 (-> *TARGET-bank* yellow-projectile-speed)) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (let ((gp-1 (get-process *default-dead-pool* projectile-yellow #x4000))) (set! gp-0 (ppointer->handle (when gp-1 @@ -1367,7 +1357,7 @@ (-> self entity) (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node-index eichar-lod0-jg sk_rhand)) s5-2 - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + (if (>= (-> self fact eco-level) (-> *FACT-bank* eco-level-max)) 25 9 ) @@ -1488,7 +1478,7 @@ (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) (the-as float (-> *TARGET-bank* yellow-projectile-speed)) ) - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + (if (>= (-> self fact eco-level) (-> *FACT-bank* eco-level-max)) 16 0 ) @@ -1561,9 +1551,7 @@ (go target-attack-air #f) ) (when (can-hands? #f) - (if (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (if (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (go target-yellow-jump-blast) (go target-running-attack) ) @@ -2131,7 +2119,7 @@ (let ((v1-2 (the-as attack-info (-> block param 1)))) (when (or (not (logtest? (-> v1-2 mask) (attack-mask mode))) (= (-> v1-2 mode) 'generic) (= (-> v1-2 mode) 'drown)) (set! (-> v1-2 mode) 'damage) - (if (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact-info-target health))) + (if (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact health))) (set! (-> v1-2 mode) 'drown-death) ) (logior! (-> v1-2 mask) (attack-mask mode)) @@ -2464,7 +2452,7 @@ (let ((f0-5 (the float (the int (+ 1.0 (/ (- arg0 (-> *TARGET-bank* fall-far)) (-> *TARGET-bank* fall-far-inc)))))) ) (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (* (-> *FACT-bank* health-single-inc) (- (fmax 0.0 f0-5))) (the-as handle #f) @@ -2475,7 +2463,7 @@ ) ) (cond - ((and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + ((and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) (set! (-> self attack-info attacker) (the-as handle #f)) (go target-death 'target-hit-ground-hard) ) diff --git a/goal_src/jak1/engine/ui/hud-classes.gc b/goal_src/jak1/engine/ui/hud-classes.gc index ab7d2549567..a06f58198d2 100644 --- a/goal_src/jak1/engine/ui/hud-classes.gc +++ b/goal_src/jak1/engine/ui/hud-classes.gc @@ -8,7 +8,6 @@ ;; DECOMP BEGINS - (defpartgroup group-part-hud-pickup :id 75 :flags (screen-space) @@ -127,14 +126,10 @@ (deftype hud-pickups (hud) () - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x118 - :flag-assert #x1b00b00118 ) -(defmethod draw-hud hud-pickups ((this hud-pickups)) +(defmethod draw-hud ((this hud-pickups)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this) ) @@ -175,15 +170,15 @@ (none) ) -(defmethod hud-update hud-pickups ((this hud-pickups)) +(defmethod hud-update ((this hud-pickups)) (if *target* - (tally-value this (the int (+ 0.5 (-> *target* fact-info-target eco-pill))) 0) + (tally-value this (the int (+ 0.5 (-> *target* fact eco-pill))) 0) ) 0 (none) ) -(defmethod init-particles! hud-pickups ((this hud-pickups) (arg0 int)) +(defmethod init-particles! ((this hud-pickups) (arg0 int)) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) (set! (-> this particles s5-0) (new 'static 'hud-particle)) @@ -276,12 +271,8 @@ ) (deftype hud-health (hud) - ((scale float :offset-assert 280) + ((scale float) ) - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x11c - :flag-assert #x1b00b0011c ) @@ -291,14 +282,14 @@ (set! (-> arg2 pos x) f0-0) ) (cond - ((and *target* (< (-> *target* fact-info-target health) 1.0)) + ((and *target* (< (-> *target* fact health) 1.0)) (set! (-> arg2 prev-pos x) 32.0) ) (else (let ((f0-3 128.0)) ;; low health flashing ;; og:preserve-this modified to support high fps - (when (and *target* (= (-> *target* fact-info-target health) 1.0)) + (when (and *target* (= (-> *target* fact health) 1.0)) (let* ((scaled-frame-counter (the int (* DISPLAY_FPS_RATIO (-> *display* integral-frame-counter)))) (v1-16 (logand scaled-frame-counter 7))) (set! f0-3 (if (zero? (logand scaled-frame-counter 8)) @@ -324,7 +315,7 @@ (set! (-> arg2 init-pos x) f0-0) (set! (-> arg2 pos x) f0-0) ) - (if (and *target* (< (-> *target* fact-info-target health) 2.0)) + (if (and *target* (< (-> *target* fact health) 2.0)) (set! (-> arg2 prev-pos x) 32.0) (set! (-> arg2 prev-pos x) 128.0) ) @@ -337,7 +328,7 @@ (set! (-> arg2 init-pos x) f0-0) (set! (-> arg2 pos x) f0-0) ) - (if (and *target* (< (-> *target* fact-info-target health) 3.0)) + (if (and *target* (< (-> *target* fact health) 3.0)) (set! (-> arg2 prev-pos x) 32.0) (set! (-> arg2 prev-pos x) 128.0) ) @@ -345,25 +336,21 @@ (none) ) -(defmethod draw-hud hud-health ((this hud-health)) +(defmethod draw-hud ((this hud-health)) ((method-of-type hud draw-hud) this) 0 (none) ) -(defmethod hud-update hud-health ((this hud-health)) +(defmethod hud-update ((this hud-health)) (if *target* - (tally-value - this - (the int (-> *target* fact-info-target health)) - (the-as int (-> *target* fact-info-target health-pickup-time)) - ) + (tally-value this (the int (-> *target* fact health)) (the-as int (-> *target* fact health-pickup-time))) ) 0 (none) ) -(defmethod init-particles! hud-health ((this hud-health) (arg0 int)) +(defmethod init-particles! ((this hud-health) (arg0 int)) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) (set! (-> this particles s5-0) (new 'static 'hud-particle)) @@ -410,7 +397,7 @@ (none) ) -(defmethod set-pos-and-scale hud-health ((this hud-health) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-health) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> this particles 0 init-pos x) 65.0) @@ -465,21 +452,17 @@ ) (deftype hud-money-all (hud) - ((x-scale float :offset-assert 280) - (y-scale float :offset-assert 284) - (y-pos int32 :offset-assert 288) - (total-orbs int32 :offset-assert 292) - (level-index int32 :offset-assert 296) - (start-time time-frame :offset-assert 304) + ((x-scale float) + (y-scale float) + (y-pos int32) + (total-orbs int32) + (level-index int32) + (start-time time-frame) ) - :heap-base #xd0 - :method-count-assert 27 - :size-assert #x138 - :flag-assert #x1b00d00138 ) -(defmethod draw-hud hud-money-all ((this hud-money-all)) +(defmethod draw-hud ((this hud-money-all)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this) ) @@ -566,7 +549,7 @@ (none) ) -(defmethod hud-update hud-money-all ((this hud-money-all)) +(defmethod hud-update ((this hud-money-all)) (when *target* (hide-bottom-hud) (when (!= *master-mode* 'pause) @@ -582,16 +565,16 @@ ) ) ) - (if (>= (+ (-> *display* base-frame-counter) (seconds -5)) (-> this start-time)) + (if (>= (+ (current-time) (seconds -5)) (-> this start-time)) (set! (-> this deactivate-when-hidden) #t) - (tally-value this (the-as int (-> *display* base-frame-counter)) 0) + (tally-value this (the-as int (current-time)) 0) ) ) 0 (none) ) -(defmethod init-particles! hud-money-all ((this hud-money-all) (arg0 int)) +(defmethod init-particles! ((this hud-money-all) (arg0 int)) (when (< (-> this nb-of-icons) 6) (let ((s4-0 (-> this nb-of-icons))) (set! (-> this icons s4-0) (new 'static 'hud-icon)) @@ -672,21 +655,21 @@ ) ) ) - (set! (-> this start-time) (-> *display* base-frame-counter)) + (set-time! (-> this start-time)) (sound-play "get-all-orbs") 0 (none) ) -(defmethod set-pos-and-scale hud-money-all ((this hud-money-all) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-money-all) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> this x-scale) 0.01845) (set! (-> this y-scale) -0.02175) (set! (-> this y-pos) (if arg1 - 374 - 373 - ) + 374 + 373 + ) ) ) (else @@ -726,18 +709,14 @@ ) (deftype hud-money (hud) - ((x-scale float :offset-assert 280) - (y-scale float :offset-assert 284) - (y-pos int32 :offset-assert 288) + ((x-scale float) + (y-scale float) + (y-pos int32) ) - :heap-base #xc0 - :method-count-assert 27 - :size-assert #x124 - :flag-assert #x1b00c00124 ) (define-extern *game-counts* game-count-info) -(defmethod draw-hud hud-money ((this hud-money)) +(defmethod draw-hud ((this hud-money)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this) ) @@ -799,7 +778,7 @@ (none) ) -(defmethod hud-update hud-money ((this hud-money)) +(defmethod hud-update ((this hud-money)) (when *target* (when (!= *master-mode* 'pause) (when (and (!= (-> this icons 0) 0) (-> this icons 0 icon)) @@ -820,7 +799,7 @@ (none) ) -(defmethod init-particles! hud-money ((this hud-money) (arg0 int)) +(defmethod init-particles! ((this hud-money) (arg0 int)) (when (< (-> this nb-of-icons) 6) (let ((s5-0 (-> this nb-of-icons))) (set! (-> this icons s5-0) (new 'static 'hud-icon)) @@ -874,7 +853,7 @@ (none) ) -(defmethod set-pos-and-scale hud-money ((this hud-money) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-money) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> this x-scale) 0.0123) @@ -891,30 +870,30 @@ (set! (-> this x-scale) (* 1.1 (-> this x-scale))) (set! (-> this y-scale) (* 1.2 (-> this y-scale))) (set! (-> this y-pos) (the int (* (the float (-> this y-pos)) (if arg0 - 0.95 - 0.9 - ) - ) - ) + 0.95 + 0.9 + ) + ) + ) ) ) 0 (none) ) -(defmethod get-icon-pos-x hud-money ((this hud-money)) +(defmethod get-icon-pos-x ((this hud-money)) (-> this icons 0 icon-x) ) -(defmethod get-icon-pos-y hud-money ((this hud-money)) +(defmethod get-icon-pos-y ((this hud-money)) (-> this icons 0 icon-y) ) -(defmethod get-icon-scale-x hud-money ((this hud-money)) +(defmethod get-icon-scale-x ((this hud-money)) 0.01 ) -(defmethod get-icon-scale-y hud-money ((this hud-money)) +(defmethod get-icon-scale-y ((this hud-money)) -0.011 ) @@ -1122,22 +1101,18 @@ ) (deftype hud-fuel-cell (hud) - ((scale-starburst-3-x float :offset-assert 280) - (scale-starburst-3-y float :offset-assert 284) - (scale-starburst-4-x float :offset-assert 288) - (scale-starburst-4-y float :offset-assert 292) - (scale-icon float :offset-assert 296) - (scale-center float :offset-assert 300) - (icon-pos-y int32 :offset-assert 304) + ((scale-starburst-3-x float) + (scale-starburst-3-y float) + (scale-starburst-4-x float) + (scale-starburst-4-y float) + (scale-icon float) + (scale-center float) + (icon-pos-y int32) ) - :heap-base #xd0 - :method-count-assert 27 - :size-assert #x134 - :flag-assert #x1b00d00134 ) -(defmethod draw-hud hud-fuel-cell ((this hud-fuel-cell)) +(defmethod draw-hud ((this hud-fuel-cell)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this) ) @@ -1251,7 +1226,7 @@ (none) ) -(defmethod hud-update hud-fuel-cell ((this hud-fuel-cell)) +(defmethod hud-update ((this hud-fuel-cell)) (when *target* (when (!= *master-mode* 'pause) (let ((a0-2 (-> this icons 0 icon 0 root))) @@ -1274,7 +1249,7 @@ (none) ) -(defmethod init-particles! hud-fuel-cell ((this hud-fuel-cell) (arg0 int)) +(defmethod init-particles! ((this hud-fuel-cell) (arg0 int)) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) (set! (-> this particles s5-0) (new 'static 'hud-particle)) @@ -1333,7 +1308,7 @@ (none) ) -(defmethod set-pos-and-scale hud-fuel-cell ((this hud-fuel-cell) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-fuel-cell) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> this scale-starburst-3-x) 10240.0) @@ -1356,11 +1331,11 @@ ) (if arg1 (set! (-> this icon-pos-y) (the int (* (the float (-> this icon-pos-y)) (if arg0 - 1.1 - 1.14 - ) - ) - ) + 1.1 + 1.14 + ) + ) + ) ) ) 0 @@ -1410,13 +1385,9 @@ ) (deftype hud-buzzers (hud) - ((scale float :offset-assert 280) - (text-y-offset int32 :offset-assert 284) + ((scale float) + (text-y-offset int32) ) - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x120 - :flag-assert #x1b00b00120 ) @@ -1428,16 +1399,16 @@ (none) ) -(defmethod draw-hud hud-buzzers ((this hud-buzzers)) +(defmethod draw-hud ((this hud-buzzers)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this) ) (set! (-> this text-y) (+ (if (nonzero? (-> this next-y-offset)) - (-> this text-y-offset) - 0 - ) - 362 - ) + (-> this text-y-offset) + 0 + ) + 362 + ) ) (with-dma-buffer-add-bucket ((buf (-> (current-frame) global-buf)) (bucket-id debug)) @@ -1497,15 +1468,15 @@ (none) ) -(defmethod hud-update hud-buzzers ((this hud-buzzers)) +(defmethod hud-update ((this hud-buzzers)) (if *target* - (tally-value this (the int (+ 0.5 (-> *target* fact-info-target buzzer))) 0) + (tally-value this (the int (+ 0.5 (-> *target* fact buzzer))) 0) ) 0 (none) ) -(defmethod init-particles! hud-buzzers ((this hud-buzzers) (arg0 int)) +(defmethod init-particles! ((this hud-buzzers) (arg0 int)) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) (set! (-> this particles s5-0) (new 'static 'hud-particle)) @@ -1533,11 +1504,11 @@ (none) ) -(defmethod get-icon-pos-x hud-buzzers ((this hud-buzzers)) +(defmethod get-icon-pos-x ((this hud-buzzers)) (-> this text-x) ) -(defmethod get-icon-pos-y hud-buzzers ((this hud-buzzers)) +(defmethod get-icon-pos-y ((this hud-buzzers)) (+ (if (= (-> *setting-control* current video-mode) 'pal) (+ (-> this text-y) 120) (+ (-> this text-y) 50) @@ -1546,15 +1517,15 @@ ) ) -(defmethod get-icon-scale-x hud-buzzers ((this hud-buzzers)) +(defmethod get-icon-scale-x ((this hud-buzzers)) 0.008 ) -(defmethod get-icon-scale-y hud-buzzers ((this hud-buzzers)) +(defmethod get-icon-scale-y ((this hud-buzzers)) -0.008 ) -(defmethod set-pos-and-scale hud-buzzers ((this hud-buzzers) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-buzzers) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> this scale) 6553.6) @@ -1667,14 +1638,10 @@ ) (deftype hud-power (hud) - ((scale-timer float :offset-assert 280) - (scale-backing float :offset-assert 284) - (scale-blue float :offset-assert 288) + ((scale-timer float) + (scale-backing float) + (scale-blue float) ) - :heap-base #xc0 - :method-count-assert 27 - :size-assert #x124 - :flag-assert #x1b00c00124 ) @@ -1723,12 +1690,10 @@ (defun part-hud-eco-timer-01-func ((arg0 basic) (arg1 basic) (arg2 hud-particle)) (let ((f0-2 (/ (the float - (the-as - uint - (- (-> *target* fact-info-target eco-timeout) - (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact-info-target eco-pickup-time))) - ) - ) + (the-as uint (- (-> *target* fact eco-timeout) + (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))) + ) + ) ) (the float (the-as uint (-> *FACT-bank* eco-full-timeout))) ) @@ -1737,7 +1702,7 @@ (a3-0 64) (t0-0 128) ) - (case (-> *target* fact-info-target eco-type) + (case (-> *target* fact eco-type) (((pickup-type eco-yellow)) (set! a2-1 128) (set! a3-0 96) @@ -1767,12 +1732,10 @@ (defun part-hud-eco-timer-02-func ((arg0 basic) (arg1 basic) (arg2 hud-particle)) (let ((f0-2 (/ (the float - (the-as - uint - (- (-> *target* fact-info-target eco-timeout) - (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact-info-target eco-pickup-time))) - ) - ) + (the-as uint (- (-> *target* fact eco-timeout) + (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))) + ) + ) ) (the float (the-as uint (-> *FACT-bank* eco-full-timeout))) ) @@ -1781,7 +1744,7 @@ (a3-0 64) (t0-0 128) ) - (case (-> *target* fact-info-target eco-type) + (case (-> *target* fact eco-type) (((pickup-type eco-yellow)) (set! a2-1 128) (set! a3-0 96) @@ -1811,12 +1774,10 @@ (defun part-hud-eco-timer-03-func ((arg0 basic) (arg1 basic) (arg2 hud-particle)) (let ((f0-2 (/ (the float - (the-as - uint - (- (-> *target* fact-info-target eco-timeout) - (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact-info-target eco-pickup-time))) - ) - ) + (the-as uint (- (-> *target* fact eco-timeout) + (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))) + ) + ) ) (the float (the-as uint (-> *FACT-bank* eco-full-timeout))) ) @@ -1825,7 +1786,7 @@ (a3-0 64) (t0-0 128) ) - (case (-> *target* fact-info-target eco-type) + (case (-> *target* fact eco-type) (((pickup-type eco-yellow)) (set! a2-1 128) (set! a3-0 96) @@ -1870,30 +1831,28 @@ (none) ) -(defmethod hud-update hud-power ((this hud-power)) +(defmethod hud-update ((this hud-power)) (if *target* (tally-value this (max 0 (min - (the-as - int - (- (-> *target* fact-info-target eco-timeout) - (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact-info-target eco-pickup-time))) - ) - ) - (the-as int (-> *target* fact-info-target eco-timeout)) + (the-as int (- (-> *target* fact eco-timeout) + (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))) + ) + ) + (the-as int (-> *target* fact eco-timeout)) ) ) - (the-as int (-> *target* fact-info-target eco-timeout)) + (the-as int (-> *target* fact eco-timeout)) ) ) 0 (none) ) -(defmethod init-particles! hud-power ((this hud-power) (arg0 int)) +(defmethod init-particles! ((this hud-power) (arg0 int)) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) (set! (-> this particles s5-0) (new 'static 'hud-particle)) @@ -1939,7 +1898,7 @@ (none) ) -(defmethod set-pos-and-scale hud-power ((this hud-power) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-power) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> this scale-blue) 7168.0) diff --git a/goal_src/jak1/engine/ui/hud-h.gc b/goal_src/jak1/engine/ui/hud-h.gc index 2cc351a5bd0..c8d695f377a 100644 --- a/goal_src/jak1/engine/ui/hud-h.gc +++ b/goal_src/jak1/engine/ui/hud-h.gc @@ -29,77 +29,67 @@ ;; DECOMP BEGINS (deftype hud-icon (basic) - ((icon (pointer manipy) :offset-assert 4) - (icon-y int32 :offset-assert 8) - (icon-x int32 :offset-assert 12) - (icon-z int32 :offset-assert 16) - (scale-x float :offset-assert 20) - (scale-y float :offset-assert 24) + ((icon (pointer manipy)) + (icon-y int32) + (icon-x int32) + (icon-z int32) + (scale-x float) + (scale-y float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype hud-particle (basic) - ((part sparticle-launch-control :offset-assert 4) - (init-pos vector :inline :offset-assert 16) - (pos vector :inline :offset-assert 32) - (prev-pos vector :inline :offset-assert 48) + ((part sparticle-launch-control) + (init-pos vector :inline) + (pos vector :inline) + (prev-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype hud (process) - ((value int32 :offset-assert 112) - (value2 int32 :offset-assert 116) - (target-value int32 :offset-assert 120) - (last-increment-time time-frame :offset-assert 128) - (last-target-equal-time time-frame :offset-assert 136) - (offset int32 :offset-assert 144) - (y-offset int32 :offset-assert 148) - (next-y-offset int32 :offset-assert 152) - (x-sgn int32 :offset-assert 156) - (y-sgn int32 :offset-assert 160) - (text-x int32 :offset-assert 164) - (text-y int32 :offset-assert 168) - (friend int32 :offset-assert 172) - (first-init symbol :offset-assert 176) - (increment-on-event symbol :offset-assert 180) - (skip-particle int32 :offset-assert 184) - (disable symbol :offset-assert 188) - (force-on-screen symbol :offset-assert 192) - (deactivate-when-hidden symbol :offset-assert 196) - (trigger-time time-frame :offset-assert 200) - (last-hide-time time-frame :offset-assert 208) - (nb-of-icons int32 :offset-assert 216) - (icons hud-icon 6 :offset-assert 220) - (max-nb-of-particles int32 :offset-assert 244) - (nb-of-particles int32 :offset-assert 248) - (particles hud-particle 7 :offset-assert 252) + ((value int32) + (value2 int32) + (target-value int32) + (last-increment-time time-frame) + (last-target-equal-time time-frame) + (offset int32) + (y-offset int32) + (next-y-offset int32) + (x-sgn int32) + (y-sgn int32) + (text-x int32) + (text-y int32) + (friend int32) + (first-init symbol) + (increment-on-event symbol) + (skip-particle int32) + (disable symbol) + (force-on-screen symbol) + (deactivate-when-hidden symbol) + (trigger-time time-frame) + (last-hide-time time-frame) + (nb-of-icons int32) + (icons hud-icon 6) + (max-nb-of-particles int32) + (nb-of-particles int32) + (particles hud-particle 7) ) - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x118 - :flag-assert #x1b00b00118 (:methods - (hidden? (_type_) symbol 14) - (draw-hud (_type_) none 15) - (tally-value (_type_ int int) none 16) - (draw-icons (_type_) none 17) - (draw-particles (_type_) none 18) - (hud-update (_type_) none 19) - (init-particles! (_type_ int) none 20) - (get-icon-pos-x (_type_) int 21) - (get-icon-pos-y (_type_) int 22) - (hud-method-23 (_type_) none 23) - (set-pos-and-scale (_type_ symbol symbol) none 24) - (get-icon-scale-x (_type_) float 25) - (get-icon-scale-y (_type_) float 26) + (hidden? (_type_) symbol) + (draw-hud (_type_) none) + (tally-value (_type_ int int) none) + (draw-icons (_type_) none) + (draw-particles (_type_) none) + (hud-update (_type_) none) + (init-particles! (_type_ int) none) + (get-icon-pos-x (_type_) int) + (get-icon-pos-y (_type_) int) + (hud-method-23 (_type_) none) + (set-pos-and-scale (_type_ symbol symbol) none) + (get-icon-scale-x (_type_) float) + (get-icon-scale-y (_type_) float) ) (:states hud-arriving @@ -111,20 +101,17 @@ (deftype hud-parts (structure) - ((pickups (pointer hud-pickups) :offset-assert 0) - (money (pointer hud-money) :offset-assert 4) - (fuel-cell (pointer hud-fuel-cell) :offset-assert 8) - (health (pointer hud-health) :offset-assert 12) - (buzzers (pointer hud-buzzers) :offset-assert 16) - (power (pointer hud-power) :offset-assert 20) - (bike-speed (pointer hud-bike-speed) :offset-assert 24) - (bike-heat (pointer hud-bike-heat) :offset-assert 28) - (money-all (pointer hud-money-all) :offset-assert 32) - (parts (pointer hud) 9 :offset 0) + ((pickups (pointer hud-pickups)) + (money (pointer hud-money)) + (fuel-cell (pointer hud-fuel-cell)) + (health (pointer hud-health)) + (buzzers (pointer hud-buzzers)) + (power (pointer hud-power)) + (bike-speed (pointer hud-bike-speed)) + (bike-heat (pointer hud-bike-heat)) + (money-all (pointer hud-money-all)) + (parts (pointer hud) 9 :overlay-at pickups) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) diff --git a/goal_src/jak1/engine/ui/hud.gc b/goal_src/jak1/engine/ui/hud.gc index 6f19996ab78..7e18a1bfc33 100644 --- a/goal_src/jak1/engine/ui/hud.gc +++ b/goal_src/jak1/engine/ui/hud.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod relocate hud ((this hud) (arg0 int)) +(defmethod relocate ((this hud) (arg0 int)) (dotimes (v1-0 (-> this nb-of-particles)) (if (nonzero? (-> this particles v1-0 part)) (&+! (-> this particles v1-0 part) arg0) @@ -16,7 +16,7 @@ (the-as hud ((method-of-type process relocate) this arg0)) ) -(defmethod deactivate hud ((this hud)) +(defmethod deactivate ((this hud)) (dotimes (v1-0 9) (if (and (-> *hud-parts* parts v1-0) (= (ppointer->process (-> *hud-parts* parts v1-0)) this)) (set! (-> *hud-parts* parts v1-0) (the-as (pointer hud) #f)) @@ -30,7 +30,7 @@ (none) ) -(defmethod draw-hud hud ((this hud)) +(defmethod draw-hud ((this hud)) (when (and (not (hidden? this)) (not (paused?))) (dotimes (s5-0 (-> this nb-of-particles)) (when (!= s5-0 (-> this skip-particle)) @@ -44,15 +44,15 @@ (none) ) -(defmethod tally-value hud ((this hud) (arg0 int) (arg1 int)) +(defmethod tally-value ((this hud) (arg0 int) (arg1 int)) (if (= arg0 (-> this target-value)) - (set! (-> this last-target-equal-time) (-> *display* base-frame-counter)) + (set-time! (-> this last-target-equal-time)) ) (when (and (not *progress-process*) - (and (!= (-> this last-hide-time) (-> *display* base-frame-counter)) + (and (!= (-> this last-hide-time) (current-time)) (not (movie?)) - (>= (- (-> *display* base-frame-counter) (-> *game-info* letterbox-time)) (seconds 0.1)) - (>= (- (-> *display* base-frame-counter) (-> *game-info* blackout-time)) (seconds 0.1)) + (time-elapsed? (-> *game-info* letterbox-time) (seconds 0.1)) + (time-elapsed? (-> *game-info* blackout-time) (seconds 0.1)) (not (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed)))) ) ) @@ -80,25 +80,20 @@ ((and (-> this increment-on-event) (< (-> this value) arg0) (not (-> this first-init)) - (< (- (-> *display* base-frame-counter) (-> this last-target-equal-time)) (seconds 1.5)) + (not (time-elapsed? (-> this last-target-equal-time) (seconds 1.5))) ) - (when (and (!= (-> this value) (-> this target-value)) - (>= (- (-> *display* base-frame-counter) (-> this last-increment-time)) (seconds 0.1)) - ) + (when (and (!= (-> this value) (-> this target-value)) (time-elapsed? (-> this last-increment-time) (seconds 0.1))) (sound-play "cursor-options") (+! (-> this value) 1) - (set! (-> this last-increment-time) (-> *display* base-frame-counter)) + (set-time! (-> this last-increment-time)) ) ) (else - (if (not (and (not (-> this first-init)) - (>= (- (-> *display* base-frame-counter) (-> this last-target-equal-time)) (seconds 1.5)) - ) - ) + (if (not (and (not (-> this first-init)) (time-elapsed? (-> this last-target-equal-time) (seconds 1.5)))) (set! (-> this value) arg0) ) (set! (-> this target-value) arg0) - (set! (-> this last-target-equal-time) (-> *display* base-frame-counter)) + (set-time! (-> this last-target-equal-time)) ) ) (set! (-> this value2) arg1) @@ -108,7 +103,7 @@ ) (go hud-arriving) ) - (set! (-> this trigger-time) (-> *display* base-frame-counter)) + (set-time! (-> this trigger-time)) (set! (-> this first-init) #f) ) ) @@ -116,7 +111,7 @@ (none) ) -(defmethod draw-icons hud ((this hud)) +(defmethod draw-icons ((this hud)) (dotimes (v1-0 (-> this nb-of-icons)) (set-vector! (-> this icons v1-0 icon 0 root scale) @@ -145,7 +140,7 @@ (none) ) -(defmethod draw-particles hud ((this hud)) +(defmethod draw-particles ((this hud)) (dotimes (s5-0 (-> this nb-of-particles)) (when (!= (-> this skip-particle) -2) (set! (-> this particles s5-0 pos x) @@ -185,38 +180,38 @@ (none) ) -(defmethod hud-update hud ((this hud)) +(defmethod hud-update ((this hud)) 0 (none) ) -(defmethod init-particles! hud ((this hud) (arg0 int)) +(defmethod init-particles! ((this hud) (arg0 int)) 0 (none) ) -(defmethod get-icon-pos-x hud ((this hud)) +(defmethod get-icon-pos-x ((this hud)) 0 ) -(defmethod get-icon-pos-y hud ((this hud)) +(defmethod get-icon-pos-y ((this hud)) 0 ) -(defmethod get-icon-scale-x hud ((this hud)) +(defmethod get-icon-scale-x ((this hud)) 0.0 ) -(defmethod get-icon-scale-y hud ((this hud)) +(defmethod get-icon-scale-y ((this hud)) 0.0 ) -(defmethod set-pos-and-scale hud ((this hud) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud) (arg0 symbol) (arg1 symbol)) 0 (none) ) -(defmethod hidden? hud ((this hud)) +(defmethod hidden? ((this hud)) (= (-> this next-state name) 'hud-hidden) ) @@ -225,17 +220,17 @@ (local-vars (v0-0 object)) (case message (('show) - (if (and (not *progress-process*) (!= (-> self last-hide-time) (-> *display* base-frame-counter))) + (if (and (not *progress-process*) (!= (-> self last-hide-time) (current-time))) (go hud-arriving) ) ) (('hide) - (set! v0-0 (-> *display* base-frame-counter)) + (set! v0-0 (current-time)) (set! (-> self last-hide-time) (the-as time-frame v0-0)) v0-0 ) (('hide-quick) - (set! v0-0 (-> *display* base-frame-counter)) + (set! v0-0 (current-time)) (set! (-> self last-hide-time) (the-as time-frame v0-0)) v0-0 ) @@ -297,7 +292,7 @@ (local-vars (v0-3 object)) (case message (('hide-quick) - (set! (-> self last-hide-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hide-time)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) (draw-particles self) @@ -306,12 +301,12 @@ (go hud-hidden) ) (('hide) - (set! (-> self last-hide-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hide-time)) (set! (-> self force-on-screen) #f) (go hud-leaving 10) ) (('show) - (if (and (not *progress-process*) (!= (-> self last-hide-time) (-> *display* base-frame-counter))) + (if (and (not *progress-process*) (!= (-> self last-hide-time) (current-time))) (go hud-arriving) ) ) @@ -359,7 +354,7 @@ (go hud-in) ) (when (movie?) - (set! (-> self last-hide-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hide-time)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) (draw-particles self) @@ -380,14 +375,14 @@ (defstate hud-in (hud) :event (-> hud-arriving event) :code (behavior () - (set! (-> self trigger-time) (-> *display* base-frame-counter)) - (while (and (< (- (-> *display* base-frame-counter) (-> self trigger-time)) (seconds 2)) (not (movie?))) + (set-time! (-> self trigger-time)) + (while (and (not (time-elapsed? (-> self trigger-time) (seconds 2))) (not (movie?))) (set! (-> self offset) 0) (draw-icons self) (suspend) ) (when (movie?) - (set! (-> self last-hide-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hide-time)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) (draw-particles self) @@ -409,7 +404,7 @@ ) (draw-icons self) (when (movie?) - (set! (-> self last-hide-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hide-time)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) (draw-particles self) @@ -432,8 +427,8 @@ (set! (-> self max-nb-of-particles) 7) (set! (-> self first-init) #t) (set! (-> self friend) -1) - (set! (-> self last-increment-time) (-> *display* base-frame-counter)) - (set! (-> self last-target-equal-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-increment-time)) + (set-time! (-> self last-target-equal-time)) (set! (-> self increment-on-event) #f) (set! (-> self skip-particle) -1) (set! (-> self disable) #f) @@ -441,7 +436,7 @@ (set! (-> self deactivate-when-hidden) #f) (set! (-> self y-offset) 0) (set! (-> self next-y-offset) 0) - (set! (-> self last-hide-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hide-time)) (logior! (-> self mask) (process-mask menu)) (logclear! (-> self mask) (process-mask pause progress)) (init-particles! self arg0) @@ -480,7 +475,7 @@ (f22-0 (-> self root scale z)) ) (loop - (let ((f0-7 (* f30-0 (-> *display* seconds-per-frame)))) + (let ((f0-7 (* f30-0 (seconds-per-frame)))) (+! f26-0 f0-7) (when (< 1.0 f26-0) (let ((f0-8 (- f26-0 f0-7))) diff --git a/goal_src/jak1/engine/ui/progress/progress-draw.gc b/goal_src/jak1/engine/ui/progress/progress-draw.gc index 0003884d17f..66eb669937b 100644 --- a/goal_src/jak1/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak1/engine/ui/progress/progress-draw.gc @@ -14,7 +14,7 @@ ) ) -(defmethod draw-fuel-cell-screen progress ((this progress) (arg0 int)) +(defmethod draw-fuel-cell-screen ((this progress) (arg0 int)) (local-vars (sv-112 int) (sv-128 int) @@ -190,7 +190,7 @@ (none) ) -(defmethod draw-money-screen progress ((this progress) (arg0 int)) +(defmethod draw-money-screen ((this progress) (arg0 int)) (hide-progress-icons) (let* ((v1-1 (/ (-> this transition-offset) 16)) (s4-0 (if (= (-> this level-transition) 1) @@ -273,7 +273,7 @@ (none) ) -(defmethod draw-buzzer-screen progress ((this progress) (arg0 int)) +(defmethod draw-buzzer-screen ((this progress) (arg0 int)) (hide-progress-icons) (let* ((v1-2 (-> *level-task-data* arg0)) (a0-3 (/ (-> this transition-offset) 16)) @@ -351,7 +351,7 @@ (none) ) -(defmethod draw-memcard-storage-error progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-storage-error ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.55) ) @@ -419,7 +419,7 @@ (none) ) -(defmethod draw-memcard-format progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-format ((this progress) (arg0 font-context)) (set! (-> arg0 origin y) 35.0) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.55) @@ -466,7 +466,7 @@ (none) ) -(defmethod draw-memcard-data-exists progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-data-exists ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.65) ) @@ -502,7 +502,7 @@ (none) ) -(defmethod draw-memcard-no-data progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-no-data ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.65) ) @@ -536,7 +536,7 @@ (none) ) -(defmethod draw-memcard-accessing progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-accessing ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 1.0) ) @@ -585,7 +585,7 @@ (none) ) -(defmethod draw-memcard-insert progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-insert ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.65) ) @@ -630,7 +630,7 @@ (none) ) -(defmethod draw-memcard-file-select progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-file-select ((this progress) (arg0 font-context)) (local-vars (sv-16 (function _varargs_ object)) (sv-32 (function _varargs_ object)) @@ -900,7 +900,7 @@ (none) ) -(defmethod draw-memcard-auto-save-error progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-auto-save-error ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.6) ) @@ -974,7 +974,7 @@ (none) ) -(defmethod draw-memcard-removed progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-removed ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.6) ) @@ -1035,7 +1035,7 @@ (none) ) -(defmethod draw-memcard-error progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-error ((this progress) (arg0 font-context)) (set! (-> arg0 origin y) 15.0) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.7) @@ -1093,7 +1093,7 @@ (none) ) -(defmethod draw-auto-save progress ((this progress) (arg0 font-context)) +(defmethod draw-auto-save ((this progress) (arg0 font-context)) (set! (-> arg0 origin x) (the float (- 35 (-> this left-x-offset)))) (set! (-> arg0 origin y) 18.0) (let ((v1-2 arg0)) @@ -1159,7 +1159,7 @@ (none) ) -(defmethod draw-pal-change-to-60hz progress ((this progress) (arg0 font-context)) +(defmethod draw-pal-change-to-60hz ((this progress) (arg0 font-context)) (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 20.0) (let ((v1-2 arg0)) @@ -1219,7 +1219,7 @@ (none) ) -(defmethod draw-no-disc progress ((this progress) (arg0 font-context)) +(defmethod draw-no-disc ((this progress) (arg0 font-context)) (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 50.0) (let ((v1-2 arg0)) @@ -1271,7 +1271,7 @@ (none) ) -(defmethod draw-bad-disc progress ((this progress) (arg0 font-context)) +(defmethod draw-bad-disc ((this progress) (arg0 font-context)) (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 50.0) (let ((v1-2 arg0)) @@ -1321,7 +1321,7 @@ (none) ) -(defmethod draw-quit progress ((this progress) (arg0 font-context)) +(defmethod draw-quit ((this progress) (arg0 font-context)) (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 70.0) (let ((v1-2 arg0)) @@ -1344,7 +1344,7 @@ (none) ) -(defmethod draw-pal-now-60hz progress ((this progress) (arg0 font-context)) +(defmethod draw-pal-now-60hz ((this progress) (arg0 font-context)) (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 45.0) (let ((v1-2 arg0)) @@ -1377,7 +1377,7 @@ (none) ) -(defmethod draw-notice-screen progress ((this progress)) +(defmethod draw-notice-screen ((this progress)) (hide-progress-icons) (when *common-text* (let ((a1-1 (new @@ -1699,7 +1699,7 @@ (none) ) -(defmethod draw-progress progress ((this progress)) +(defmethod draw-progress ((this progress)) (let ((f30-0 (+ -409.0 (-> this particles 2 init-pos x) (* 0.8 (the float (-> this left-x-offset))))) (s5-0 (if (or (-> this stat-transition) (nonzero? (-> this level-transition))) 0 @@ -1739,7 +1739,7 @@ ) ) (let ((s2-2 draw-string-xy)) - (format (clear *temp-string*) "~D" (the int (+ 0.5 (-> *target* fact-info-target buzzer)))) + (format (clear *temp-string*) "~D" (the int (+ 0.5 (-> *target* fact buzzer)))) (s2-2 *temp-string* s3-0 diff --git a/goal_src/jak1/engine/ui/progress/progress-h.gc b/goal_src/jak1/engine/ui/progress/progress-h.gc index ab595462db6..77d8096b0c2 100644 --- a/goal_src/jak1/engine/ui/progress/progress-h.gc +++ b/goal_src/jak1/engine/ui/progress/progress-h.gc @@ -193,178 +193,160 @@ ;; DECOMP BEGINS (deftype count-info (structure) - ((money-count int32 :offset-assert 0) - (buzzer-count int32 :offset-assert 4) + ((money-count int32) + (buzzer-count int32) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype game-count-info (basic) - ((length int32 :offset-assert 4) - (data count-info :inline :dynamic :offset-assert 8) + ((length int32) + (data count-info :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype task-info-data (basic) - ((task-id game-task :offset-assert 4) - (task-name text-id 4 :offset-assert 8) - (text-index-when-resolved int32 :offset-assert 24) + ((task-id game-task) + (task-name text-id 4) + (text-index-when-resolved int32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype level-tasks-info (basic) - ((level-name-id text-id :offset-assert 4) - (text-group-index int32 :offset-assert 8) - (nb-of-tasks int32 :offset-assert 12) - (buzzer-task-index int32 :offset-assert 16) - (task-info task-info-data 8 :offset-assert 20) + ((level-name-id text-id) + (text-group-index int32) + (nb-of-tasks int32) + (buzzer-task-index int32) + (task-info task-info-data 8) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) + (deftype game-option (basic) - ((option-type game-option-type :offset-assert 8) - (name text-id :offset-assert 16) - (scale symbol :offset-assert 20) - (param1 float :offset-assert 24) - (param2 float :offset-assert 28) - (param3 game-option-menu :offset-assert 32) - (value-to-modify pointer :offset-assert 36) + ((option-type game-option-type) + (name text-id) + (scale symbol) + (param1 float) + (param2 float) + (param3 game-option-menu) + (value-to-modify pointer) ;; fields below added in pc port - (option-disabled-func (function symbol) :offset-assert 40) - (name-override string :offset-assert 44) - (on-change (function object none) :offset-assert 48) - (on-confirm (function none) :offset-assert 52) - (slider-step-size float :offset-assert 56) - (slider-show-decimal? symbol :offset-assert 60) - (bind-info bind-assignment-info :inline :offset-assert 64) + (option-disabled-func (function symbol)) + (name-override string) + (on-change (function object none)) + (on-confirm (function none)) + (slider-step-size float) + (slider-show-decimal? symbol) + (bind-info bind-assignment-info :inline) ) - :method-count-assert 9 - :size-assert #x54 - :flag-assert #x900000054 ) (deftype progress (process) - ((current-debug-string int32 :offset-assert 112) - (current-debug-language int32 :offset-assert 116) - (current-debug-group int32 :offset-assert 120) - (in-out-position int32 :offset-assert 124) - (display-state progress-screen :offset-assert 128) - (next-display-state progress-screen :offset-assert 136) - (option-index int32 :offset-assert 144) - (selected-option basic :offset-assert 148) - (completion-percentage float :offset-assert 152) - (ready-to-run basic :offset-assert 156) - (display-level-index int32 :offset-assert 160) - (next-level-index int32 :offset-assert 164) - (task-index int32 :offset-assert 168) - (in-transition basic :offset-assert 172) - (last-in-transition basic :offset-assert 176) - (force-transition basic :offset-assert 180) - (stat-transition basic :offset-assert 184) - (level-transition int32 :offset-assert 188) - (language-selection language-enum :offset-assert 192) - (language-direction symbol :offset-assert 200) - (language-transition basic :offset-assert 204) - (language-x-offset int32 :offset-assert 208) - (sides-x-scale float :offset-assert 212) - (sides-y-scale float :offset-assert 216) - (left-x-offset int32 :offset-assert 220) - (right-x-offset int32 :offset-assert 224) - (button-scale float :offset-assert 228) - (slot-scale float :offset-assert 232) - (left-side-x-scale float :offset-assert 236) - (left-side-y-scale float :offset-assert 240) - (right-side-x-scale float :offset-assert 244) - (right-side-y-scale float :offset-assert 248) - (small-orb-y-offset int32 :offset-assert 252) - (big-orb-y-offset int32 :offset-assert 256) - (transition-offset int32 :offset-assert 260) - (transition-offset-invert int32 :offset-assert 264) - (transition-percentage float :offset-assert 268) - (transition-percentage-invert float :offset-assert 272) - (transition-speed float :offset-assert 276) - (total-nb-of-power-cells int32 :offset-assert 280) - (total-nb-of-orbs int32 :offset-assert 284) - (total-nb-of-buzzers int32 :offset-assert 288) - (card-info mc-slot-info :offset-assert 292) - (last-option-index-change time-frame :offset-assert 296) - (video-mode-timeout time-frame :offset-assert 304) - (display-state-stack progress-screen 5 :offset-assert 312) - (option-index-stack int32 5 :offset-assert 352) - (display-state-pos int32 :offset-assert 372) - (nb-of-icons int32 :offset-assert 376) - (icons hud-icon 6 :offset-assert 380) - (max-nb-of-particles int32 :offset-assert 404) - (nb-of-particles int32 :offset-assert 408) - (particles hud-particle 40 :offset-assert 412) - (particle-state int32 40 :offset-assert 572) + ((current-debug-string int32) + (current-debug-language int32) + (current-debug-group int32) + (in-out-position int32) + (display-state progress-screen) + (next-display-state progress-screen) + (option-index int32) + (selected-option basic) + (completion-percentage float) + (ready-to-run basic) + (display-level-index int32) + (next-level-index int32) + (task-index int32) + (in-transition basic) + (last-in-transition basic) + (force-transition basic) + (stat-transition basic) + (level-transition int32) + (language-selection language-enum) + (language-direction symbol) + (language-transition basic) + (language-x-offset int32) + (sides-x-scale float) + (sides-y-scale float) + (left-x-offset int32) + (right-x-offset int32) + (button-scale float) + (slot-scale float) + (left-side-x-scale float) + (left-side-y-scale float) + (right-side-x-scale float) + (right-side-y-scale float) + (small-orb-y-offset int32) + (big-orb-y-offset int32) + (transition-offset int32) + (transition-offset-invert int32) + (transition-percentage float) + (transition-percentage-invert float) + (transition-speed float) + (total-nb-of-power-cells int32) + (total-nb-of-orbs int32) + (total-nb-of-buzzers int32) + (card-info mc-slot-info) + (last-option-index-change time-frame) + (video-mode-timeout time-frame) + (display-state-stack progress-screen 5) + (option-index-stack int32 5) + (display-state-pos int32) + (nb-of-icons int32) + (icons hud-icon 6) + (max-nb-of-particles int32) + (nb-of-particles int32) + (particles hud-particle 40) + (particle-state int32 40) ) - :heap-base #x270 - :method-count-assert 59 - :size-assert #x2dc - :flag-assert #x3b027002dc (:methods - (progress-method-14 (_type_) none 14) - (progress-method-15 (_type_) none 15) - (progress-method-16 (_type_) none 16) - (draw-progress (_type_) none 17) - (progress-method-18 () none 18) - (visible? (_type_) symbol 19) - (hidden? (_type_) symbol 20) - (adjust-sprites (_type_) none 21) - (adjust-icons (_type_) none 22) - (adjust-ratios (_type_ symbol symbol) none 23) - (draw-fuel-cell-screen (_type_ int) none 24) - (draw-money-screen (_type_ int) none 25) - (draw-buzzer-screen (_type_ int) none 26) - (draw-notice-screen (_type_) none 27) - (draw-options (_type_ int int float) none 28) - (respond-common (_type_) none 29) - (respond-progress (_type_) none 30) - (respond-memcard (_type_) none 31) - (can-go-back? (_type_) symbol 32) - (initialize-icons (_type_) none 33) - (initialize-particles (_type_) none 34) - (draw-memcard-storage-error (_type_ font-context) none 35) - (draw-memcard-data-exists (_type_ font-context) none 36) - (draw-memcard-no-data (_type_ font-context) none 37) - (draw-memcard-accessing (_type_ font-context) none 38) - (draw-memcard-insert (_type_ font-context) none 39) - (draw-memcard-file-select (_type_ font-context) none 40) - (draw-memcard-auto-save-error (_type_ font-context) none 41) - (draw-memcard-removed (_type_ font-context) none 42) - (draw-memcard-error (_type_ font-context) none 43) - (progress-method-44 (_type_) none 44) - (push! (_type_) none 45) - (pop! (_type_) none 46) - (progress-method-47 (_type_) none 47) - (enter! (_type_ progress-screen int) none 48) - (draw-memcard-format (_type_ font-context) none 49) - (draw-auto-save (_type_ font-context) none 50) - (set-transition-progress! (_type_ int) none 51) - (set-transition-speed! (_type_) none 52) - (set-memcard-screen (_type_ progress-screen) progress-screen 53) - (draw-pal-change-to-60hz (_type_ font-context) none 54) - (draw-pal-now-60hz (_type_ font-context) none 55) - (draw-no-disc (_type_ font-context) none 56) - (draw-bad-disc (_type_ font-context) none 57) - (draw-quit (_type_ font-context) none 58) + (progress-method-14 (_type_) none) + (progress-method-15 (_type_) none) + (progress-method-16 (_type_) none) + (draw-progress (_type_) none) + (progress-method-18 () none) + (visible? (_type_) symbol) + (hidden? (_type_) symbol) + (adjust-sprites (_type_) none) + (adjust-icons (_type_) none) + (adjust-ratios (_type_ symbol symbol) none) + (draw-fuel-cell-screen (_type_ int) none) + (draw-money-screen (_type_ int) none) + (draw-buzzer-screen (_type_ int) none) + (draw-notice-screen (_type_) none) + (draw-options (_type_ int int float) none) + (respond-common (_type_) none) + (respond-progress (_type_) none) + (respond-memcard (_type_) none) + (can-go-back? (_type_) symbol) + (initialize-icons (_type_) none) + (initialize-particles (_type_) none) + (draw-memcard-storage-error (_type_ font-context) none) + (draw-memcard-data-exists (_type_ font-context) none) + (draw-memcard-no-data (_type_ font-context) none) + (draw-memcard-accessing (_type_ font-context) none) + (draw-memcard-insert (_type_ font-context) none) + (draw-memcard-file-select (_type_ font-context) none) + (draw-memcard-auto-save-error (_type_ font-context) none) + (draw-memcard-removed (_type_ font-context) none) + (draw-memcard-error (_type_ font-context) none) + (progress-method-44 (_type_) none) + (push! (_type_) none) + (pop! (_type_) none) + (progress-method-47 (_type_) none) + (enter! (_type_ progress-screen int) none) + (draw-memcard-format (_type_ font-context) none) + (draw-auto-save (_type_ font-context) none) + (set-transition-progress! (_type_ int) none) + (set-transition-speed! (_type_) none) + (set-memcard-screen (_type_ progress-screen) progress-screen) + (draw-pal-change-to-60hz (_type_ font-context) none) + (draw-pal-now-60hz (_type_ font-context) none) + (draw-no-disc (_type_ font-context) none) + (draw-bad-disc (_type_ font-context) none) + (draw-quit (_type_ font-context) none) ) (:states progress-coming-in diff --git a/goal_src/jak1/engine/ui/progress/progress-part.gc b/goal_src/jak1/engine/ui/progress/progress-part.gc index e31aaa8f3d8..f160a149267 100644 --- a/goal_src/jak1/engine/ui/progress/progress-part.gc +++ b/goal_src/jak1/engine/ui/progress/progress-part.gc @@ -28,8 +28,8 @@ (#cond (PC_PORT (unless (and *pc-settings* (not (-> *pc-settings* use-vis?))) - (set! (-> arg2 vector 0 w) (/ 5324.8 (-> *progress-process* 0 sides-x-scale))) - (set! (-> arg2 vector 1 w) (/ 5324.8 (-> *progress-process* 0 sides-x-scale))) + (set! (-> arg2 vector 0 w) (/ 5324.8 (-> *progress-process* 0 sides-x-scale))) + (set! (-> arg2 vector 1 w) (/ 5324.8 (-> *progress-process* 0 sides-x-scale))) ) ) (#t @@ -45,8 +45,8 @@ (#cond (PC_PORT (unless (and *pc-settings* (not (-> *pc-settings* use-vis?))) - (set! (-> arg2 vector 0 w) (/ 6144.0 (-> *progress-process* 0 sides-x-scale))) - (set! (-> arg2 vector 1 w) (/ 6144.0 (-> *progress-process* 0 sides-x-scale))) + (set! (-> arg2 vector 0 w) (/ 6144.0 (-> *progress-process* 0 sides-x-scale))) + (set! (-> arg2 vector 1 w) (/ 6144.0 (-> *progress-process* 0 sides-x-scale))) ) ) (#t @@ -67,8 +67,8 @@ ) ) (#t - (set! (-> arg2 vector 0 w) (/ 6553.6 (-> *progress-process* 0 sides-x-scale))) - (set! (-> arg2 vector 1 w) (/ 6553.6 (-> *progress-process* 0 sides-x-scale))) + (set! (-> arg2 vector 0 w) (/ 6553.6 (-> *progress-process* 0 sides-x-scale))) + (set! (-> arg2 vector 1 w) (/ 6553.6 (-> *progress-process* 0 sides-x-scale))) ) ) (none) @@ -82,6 +82,7 @@ (set! (-> arg2 vector 0 w) (* (meters 15) (-> *pc-settings* aspect-ratio-scale))) ) ) + 0 (none) ) @@ -937,7 +938,7 @@ ) ) -(defmethod initialize-particles progress ((this progress)) +(defmethod initialize-particles ((this progress)) (progress-new-particle :part 90 :x 256.0 :y 224.0 :z 16.0) ;; tint (progress-new-particle :part 88 :x -42.0 :y (#if PC_PORT 256.0 254.0) :z 5.0) ;; left (progress-new-particle :part 89 :x 610.0 :y (#if PC_PORT 256.0 254.0) :z 5.0) ;; right diff --git a/goal_src/jak1/engine/ui/progress/progress.gc b/goal_src/jak1/engine/ui/progress/progress.gc index 307920c684d..3b831bf27ba 100644 --- a/goal_src/jak1/engine/ui/progress/progress.gc +++ b/goal_src/jak1/engine/ui/progress/progress.gc @@ -8,23 +8,20 @@ ;; DECOMP BEGINS (deftype progress-global-state (basic) - ((aspect-ratio-choice symbol :offset-assert 4) - (video-mode-choice symbol :offset-assert 8) - (yes-no-choice symbol :offset-assert 12) - (which int32 :offset-assert 16) - (starting-state progress-screen :offset-assert 24) - (last-slot-saved int32 :offset-assert 32) - (slider-backup float :offset-assert 36) - (language-backup language-enum :offset-assert 40) - (on-off-backup symbol :offset-assert 48) - (center-x-backup int32 :offset-assert 52) - (center-y-backup int32 :offset-assert 56) - (aspect-ratio-backup symbol :offset-assert 60) - (last-slider-sound time-frame :offset-assert 64) + ((aspect-ratio-choice symbol) + (video-mode-choice symbol) + (yes-no-choice symbol) + (which int32) + (starting-state progress-screen) + (last-slot-saved int32) + (slider-backup float) + (language-backup language-enum) + (on-off-backup symbol) + (center-x-backup int32) + (center-y-backup int32) + (aspect-ratio-backup symbol) + (last-slider-sound time-frame) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) @@ -369,7 +366,7 @@ ) ) -(defmethod initialize-icons progress ((this progress)) +(defmethod initialize-icons ((this progress)) (progress-make-icon this :skel *fuelcell-naked-sg* :x 256 :y 77 :z (meters 0.5) :scale-x 0.006 :scale-y 0.006) @@ -395,7 +392,7 @@ (none) ) -(defmethod enter! progress ((this progress) (screen progress-screen) (option int)) +(defmethod enter! ((this progress) (screen progress-screen) (option int)) (when (!= (-> this display-state) screen) (set! (-> *progress-state* yes-no-choice) #f) (set! (-> this selected-option) #f) @@ -432,7 +429,7 @@ (none) ) -(defmethod push! progress ((this progress)) +(defmethod push! ((this progress)) (let ((v1-0 (-> this display-state-pos))) (cond ((< v1-0 5) @@ -449,7 +446,7 @@ (none) ) -(defmethod pop! progress ((this progress)) +(defmethod pop! ((this progress)) (let ((v1-0 (-> this display-state-pos))) (cond ((> v1-0 0) @@ -467,7 +464,7 @@ (none) ) -(defmethod set-transition-progress! progress ((this progress) (arg0 int)) +(defmethod set-transition-progress! ((this progress) (arg0 int)) (set! (-> this transition-offset) arg0) (set! (-> this transition-offset-invert) (- 512 arg0)) (set! (-> this transition-percentage) (* (1/ 512) (the float arg0))) @@ -476,7 +473,7 @@ (none) ) -(defmethod set-transition-speed! progress ((this progress)) +(defmethod set-transition-speed! ((this progress)) (case (-> this display-state) (((progress-screen fuel-cell) (progress-screen money) @@ -679,13 +676,13 @@ (none) ) -(defmethod relocate game-count-info ((this game-count-info) (arg0 int)) +(defmethod relocate ((this game-count-info) (arg0 int)) "Load in the game-count-info. This is a bit of a hack." (set! *game-counts* this) this ) -(defmethod relocate progress ((this progress) (arg0 int)) +(defmethod relocate ((this progress) (arg0 int)) (dotimes (v1-0 (-> this nb-of-particles)) (when (-> this particles v1-0 part) (if (nonzero? (-> this particles v1-0 part)) @@ -698,7 +695,7 @@ (the-as progress ((method-of-type process relocate) this arg0)) ) -(defmethod adjust-sprites progress ((this progress)) +(defmethod adjust-sprites ((this progress)) (let ((f0-1 (* (1/ METER_LENGTH) (the float (-> this in-out-position))))) (set! (-> this particles 2 init-pos x) (the float (+ (-> this right-x-offset) 409 (the int (* 301.5 f0-1))))) (set! (-> this particles 1 init-pos x) (the float (+ (-> this left-x-offset) 59))) @@ -730,7 +727,7 @@ (none) ) -(defmethod adjust-icons progress ((this progress)) +(defmethod adjust-icons ((this progress)) (dotimes (v1-0 (-> this nb-of-icons)) (when (>= v1-0 4) (set-vector! (-> this icons v1-0 icon 0 root scale) @@ -753,7 +750,7 @@ (none) ) -(defmethod adjust-ratios progress ((this progress) (aspect symbol) (video-mode symbol)) +(defmethod adjust-ratios ((this progress) (aspect symbol) (video-mode symbol)) (case aspect (('aspect4x3) (set! (-> this sides-x-scale) 1.0) @@ -804,7 +801,7 @@ (none) ) -(defmethod can-go-back? progress ((this progress)) +(defmethod can-go-back? ((this progress)) (let ((v1-2 (-> *progress-process* 0 display-state)) (a1-1 (-> *progress-state* starting-state)) ) @@ -865,11 +862,11 @@ ) ) -(defmethod visible? progress ((this progress)) +(defmethod visible? ((this progress)) (the-as symbol (and *progress-process* (zero? (-> *progress-process* 0 in-out-position)))) ) -(defmethod hidden? progress ((this progress)) +(defmethod hidden? ((this progress)) (or (not *progress-process*) (= (-> *progress-process* 0 in-out-position) 4096)) ) @@ -908,7 +905,7 @@ ) ) -(defmethod set-memcard-screen progress ((this progress) (arg0 progress-screen)) +(defmethod set-memcard-screen ((this progress) (arg0 progress-screen)) (let ((s4-0 (-> this card-info)) (gp-0 arg0) ) @@ -1009,7 +1006,7 @@ ) ) -(defmethod respond-memcard progress ((this progress)) +(defmethod respond-memcard ((this progress)) (let ((s5-0 (-> this card-info))) (when (and s5-0 (not (-> this in-transition))) (when (or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) @@ -1202,7 +1199,7 @@ (none) ) -(defmethod respond-common progress ((this progress)) +(defmethod respond-common ((this progress)) (mc-get-slot-info 0 *progress-save-info*) (set! (-> this card-info) *progress-save-info*) (let ((s5-0 (-> *options-remap* (-> this display-state)))) @@ -1638,7 +1635,7 @@ (none) ) -(defmethod respond-progress progress ((this progress)) +(defmethod respond-progress ((this progress)) (when (not (-> this in-transition)) (cond ((cpad-pressed? 0 up) diff --git a/goal_src/jak1/engine/ui/text-h.gc b/goal_src/jak1/engine/ui/text-h.gc index 50fda6a71a5..c5886a64ab4 100644 --- a/goal_src/jak1/engine/ui/text-h.gc +++ b/goal_src/jak1/engine/ui/text-h.gc @@ -832,28 +832,22 @@ ;; an individual string. (deftype game-text (structure) - ((id text-id :offset-assert 0) - (text string :offset-assert 4) + ((id text-id) + (text string) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; A table of all strings. (deftype game-text-info (basic) - ((length int32 :offset-assert 4) - (language-id int32 :offset-assert 8) - (group-name string :offset-assert 12) - (data game-text :inline :dynamic :offset-assert 16) + ((length int32) + (language-id int32) + (group-name string) + (data game-text :inline :dynamic) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (lookup-text! (_type_ text-id symbol) string 9) - ) + (lookup-text! (_type_ text-id symbol) string) + ) ) ;; all text is stored in the COMMON text files (one file per language). diff --git a/goal_src/jak1/engine/ui/text.gc b/goal_src/jak1/engine/ui/text.gc index 3a418125626..7d754fb8b38 100644 --- a/goal_src/jak1/engine/ui/text.gc +++ b/goal_src/jak1/engine/ui/text.gc @@ -22,29 +22,24 @@ (define *level-text-file-load-flag* #t) ;; allocate the game text heap if it isn't already allocated. -(when (= 0 (-> *common-text-heap* base)) - (let ((heap *common-text-heap*)) - (set! (-> heap base) (malloc 'global 64000)) - (set! (-> heap current) (-> heap base)) - (set! (-> heap top-base) (&+ (-> heap base) 64000)) - (set! (-> heap top) (-> heap top-base)) - ) +(when (zero? (-> *common-text-heap* base)) + (kheap-alloc *common-text-heap* (* 64 1024)) ;; changed from 34K -> 64K ) ;; The game-text-info stores records for each string in the loaded text on the text heap. -(defmethod length game-text-info ((this game-text-info)) +(defmethod length ((this game-text-info)) "Get the length (number of strings) in a game-text-info." (-> this length) ) -(defmethod asize-of game-text-info ((this game-text-info)) +(defmethod asize-of ((this game-text-info)) "Get the size in memory of the game-text-info" ;; each record is 8 bytes - (the int (+ (-> this type size) (* 8 (-> this length)))) + (the-as int (+ (-> this type size) (* (-> this length) 8))) ) -(defmethod inspect game-text-info ((this game-text-info)) +(defmethod inspect ((this game-text-info)) "Print a game text info, including all strings" (format '#t "[~8x] ~A~%" this (-> this type)) (format '#t "~Tlength: ~D~%" (-> this length)) @@ -59,36 +54,32 @@ this ) -(defmethod mem-usage game-text-info ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) "Get the memory usage." (set! (-> arg0 length) (max 81 (-> arg0 length))) (set! (-> arg0 data 80 name) "string") - (set! (-> arg0 data 80 count) (+ (-> arg0 data 80 count) 1)) + (+! (-> arg0 data 80 count) 1) ;; get the size of this structure (let ((v1-6 (asize-of this))) - (set! (-> arg0 data 80 used) (+ (-> arg0 data 80 used) v1-6)) - (set! (-> arg0 data 80 total) - (+ (-> arg0 data 80 total) (logand -16 (+ v1-6 15))) - ) + (+! (-> arg0 data 80 used) v1-6) + (+! (-> arg0 data 80 total) (logand -16 (+ v1-6 15))) ) ;; get the size of all the strings (dotimes (s4-0 (-> this length)) (set! (-> arg0 length) (max 81 (-> arg0 length))) (set! (-> arg0 data 80 name) "string") - (set! (-> arg0 data 80 count) (+ (-> arg0 data 80 count) 1)) + (+! (-> arg0 data 80 count) 1) (let ((v1-18 (asize-of (-> this data s4-0 text)))) - (set! (-> arg0 data 80 used) (+ (-> arg0 data 80 used) v1-18)) - (set! (-> arg0 data 80 total) - (+ (-> arg0 data 80 total) (logand -16 (+ v1-18 15))) - ) + (+! (-> arg0 data 80 used) v1-18) + (+! (-> arg0 data 80 total) (logand -16 (+ v1-18 15))) ) ) this ) -(defmethod lookup-text! game-text-info ((this game-text-info) (arg0 text-id) (arg1 symbol)) +(defmethod lookup-text! ((this game-text-info) (arg0 text-id) (arg1 symbol)) "Look up text by ID. Will return the string. If the ID can't be found, and arg1 is #t, it will return #f, otherwise the temp string UNKNOWN ID " @@ -110,26 +101,26 @@ ) (cond ((!= (-> this data v1-2 id) arg0) ;; didn't find it :( - (cond - (arg1 - (the-as string #f) - ) - (else - ;; First, look up the id in the fallback - (#if PC_PORT - (if *fallback-text-lookup?* - (let ((fallback-result (lookup-text! *fallback-text* arg0 #t))) - (if (!= fallback-result #f) - fallback-result - (string-format "UNKNOWN ID ~D" arg0))) + (cond + (arg1 + (the-as string #f) + ) + (else + ;; First, look up the id in the fallback + (#if PC_PORT + (if *fallback-text-lookup?* + (let ((fallback-result (lookup-text! *fallback-text* arg0 #t))) + (if (!= fallback-result #f) + fallback-result + (string-format "UNKNOWN ID ~D" arg0))) + (string-format "UNKNOWN ID ~D" arg0)) (string-format "UNKNOWN ID ~D" arg0)) - (string-format "UNKNOWN ID ~D" arg0)) + ) ) - ) - ) + ) (else - (-> this data v1-2 text) ;; found it! - ) + (-> this data v1-2 text) ;; found it! + ) ) ) ) @@ -143,16 +134,11 @@ ;; loading is complete once load-game-text-info returns (define text-is-loading #f) +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. (defun load-game-text-info ((txt-name string) (curr-text symbol) (heap kheap)) "Load text, if needed. txt-name is the group name, curr-text is the _symbol_ for the game-text-info, and heap is the heap to load to. The heap will be cleared." - (local-vars - (v0-2 int) - (heap-sym-heap game-text-info) - (lang language-enum) - (load-status int) - (heap-free int) - ) + (local-vars (v0-2 int) (heap-sym-heap game-text-info) (lang language-enum) (load-status int) (heap-free int)) (set! heap-sym-heap (the-as game-text-info (-> curr-text value))) ;; split languages in PC port (set! lang (#if PC_PORT (the language-enum (-> *pc-settings* text-language)) @@ -347,9 +333,9 @@ in a single text group and file." (when (or *level-text-file-load-flag* (>= arg0 0)) - (load-game-text-info "common" '*common-text* *common-text-heap*) - (#when PC_PORT - (load-fallback-game-text-info "common" '*fallback-text* *fallback-text-heap*)) + (load-game-text-info "common" '*common-text* *common-text-heap*) + (#when PC_PORT + (load-fallback-game-text-info "common" '*fallback-text* *fallback-text-heap*)) ) (none) ) @@ -437,6 +423,7 @@ (set! (-> *font-work* color-table idx color 2 a) alpha) (set! (-> *font-work* color-table idx color 3 a) alpha) (set! (-> *font-work* color-shadow w) alpha) + 0 (none) ) @@ -470,34 +457,35 @@ (set! (-> font-ctxt height) orig-height) (set! (-> font-ctxt scale) orig-scale) ) + 0 (none) ) (defun print-game-text ((str string) (font-ctxt font-context) (no-draw symbol) (alpha int) (line-height int)) "Print text. Not worth commenting until we get stack variables in lets, I think" (local-vars - (sv-112 float) - (sv-116 float) - (sv-120 float) - (sv-124 float) - (sv-128 float) - (sv-132 float) - (sv-136 float) - (sv-140 (pointer uint8)) - (sv-144 float) - (sv-148 float) - (sv-152 float) - (sv-156 float) - (sv-160 float) - (sv-164 float) - (sv-168 int) - (sv-176 int) - (sv-184 int) - (sv-192 int) - (sv-200 int) - (sv-208 symbol) - (sv-212 symbol) - ) + (sv-112 float) + (sv-116 float) + (sv-120 float) + (sv-124 float) + (sv-128 float) + (sv-132 float) + (sv-136 float) + (sv-140 (pointer uint8)) + (sv-144 float) + (sv-148 float) + (sv-152 float) + (sv-156 float) + (sv-160 float) + (sv-164 float) + (sv-168 int) + (sv-176 int) + (sv-184 int) + (sv-192 int) + (sv-200 int) + (sv-208 symbol) + (sv-212 symbol) + ) (let ((gp-0 (new 'stack 'font-context @@ -689,10 +677,12 @@ (defun disable-level-text-file-loading () (set! *level-text-file-load-flag* #f) + 0 (none) ) (defun enable-level-text-file-loading () (set! *level-text-file-load-flag* #t) + 0 (none) ) diff --git a/goal_src/jak1/engine/util/capture.gc b/goal_src/jak1/engine/util/capture.gc index a3ba4b37bb6..9ac600cd651 100644 --- a/goal_src/jak1/engine/util/capture.gc +++ b/goal_src/jak1/engine/util/capture.gc @@ -15,22 +15,19 @@ ;; vif/gif tags to do a transfer of data from VRAM to EE memory. (deftype gs-store-image-packet (structure) - ((vifcode vif-tag 4 :offset-assert 0) - (giftag gif-tag :offset-assert 16) - (bitbltbuf gs-bitbltbuf :offset-assert 32) - (bitbltbuf-addr gs-reg64 :offset-assert 40) - (trxpos gs-trxpos :offset-assert 48) - (trxpos-addr gs-reg64 :offset-assert 56) - (trxreg gs-trxreg :offset-assert 64) - (trxreg-addr gs-reg64 :offset-assert 72) - (finish int64 :offset-assert 80) - (finish-addr gs-reg64 :offset-assert 88) - (trxdir gs-trxdir :offset-assert 96) - (trxdir-addr gs-reg64 :offset-assert 104) + ((vifcode vif-tag 4) + (giftag gif-tag) + (bitbltbuf gs-bitbltbuf) + (bitbltbuf-addr gs-reg64) + (trxpos gs-trxpos) + (trxpos-addr gs-reg64) + (trxreg gs-trxreg) + (trxreg-addr gs-reg64) + (finish int64) + (finish-addr gs-reg64) + (trxdir gs-trxdir) + (trxdir-addr gs-reg64) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) (defun gs-set-default-store-image ((packet gs-store-image-packet) (src-fbp int) (src-w int) (src-psm int) (ssax int) (ssay int) (rrw int) (rrh int)) @@ -82,17 +79,17 @@ (file (new 'debug 'file-stream "image.raw" 'write)) ) ;; create (and leak memory) for 2 arrays. - (let ((buff0 (new 'debug 'boxed-array uint128 (sar (* width height) 2)))) - (let ((buff1 (new 'debug 'boxed-array uint128 (sar (* width height) 2)))) + (let ((buff0 (the-as (array uint128) (new 'debug 'boxed-array uint128 (/ (* width height) 4))))) + (let ((buff1 (the-as (array uint128) (new 'debug 'boxed-array uint128 (/ (* width height) 4))))) ;; set up a packet. (let ((packet (new 'static 'gs-store-image-packet))) ;; capture one field - (gs-set-default-store-image packet #x2800 (sar width 6) 0 0 0 width height) + (gs-set-default-store-image packet #x2800 (/ width 64) 0 0 0 width height) (flush-cache 0) (gs-store-image packet (-> buff0 data)) (sync-path 0 0) ;; capture other field - (gs-set-default-store-image packet #x3000 (sar width 6) 0 0 0 width height) + (gs-set-default-store-image packet #x3000 (/ width 64) 0 0 0 width height) (flush-cache 0) (gs-store-image packet (-> buff1 data)) ) @@ -104,19 +101,19 @@ ((zero? oddeven) (set! y-idx 0) (while (< y-idx height) - (file-stream-write file (&+ ptr-0 (* y-idx (shl width 2))) (the-as uint (shl width 2))) - (file-stream-write file (&+ ptr-1 (* y-idx (shl width 2))) (the-as uint (shl width 2))) + (file-stream-write file (&+ ptr-0 (* y-idx (* width 4))) (the-as uint (* width 4))) + (file-stream-write file (&+ ptr-1 (* y-idx (* width 4))) (the-as uint (* width 4))) (set! y-idx (+ y-idx 1)) ) ) (else - (set! y-idx-2 0) - (while (< y-idx-2 height) - (file-stream-write file (&+ ptr-1 (* y-idx-2 (shl width 2))) (the-as uint (shl width 2))) - (file-stream-write file (&+ ptr-0 (* y-idx-2 (shl width 2))) (the-as uint (shl width 2))) - (set! y-idx-2 (+ y-idx-2 1)) - ) - ) + (set! y-idx-2 0) + (while (< y-idx-2 height) + (file-stream-write file (&+ ptr-1 (* y-idx-2 (* width 4))) (the-as uint (* width 4))) + (file-stream-write file (&+ ptr-0 (* y-idx-2 (* width 4))) (the-as uint (* width 4))) + (set! y-idx-2 (+ y-idx-2 1)) + ) + ) ) ) (format #t "oddeven = ~d~%" oddeven) diff --git a/goal_src/jak1/engine/util/glist-h.gc b/goal_src/jak1/engine/util/glist-h.gc index 37c0c69c169..4bbcc89a19c 100644 --- a/goal_src/jak1/engine/util/glist-h.gc +++ b/goal_src/jak1/engine/util/glist-h.gc @@ -15,32 +15,25 @@ (declare-file (debug)) (deftype glst-node (structure) - ((next glst-node :offset-assert 0) - (prev glst-node :offset-assert 4) + ((next glst-node) + (prev glst-node) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype glst-named-node (glst-node) - ((privname string :offset-assert 8) + ((privname string) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) + (deftype glst-list (structure) - ((head glst-node :offset-assert 0) - (tail glst-node :offset-assert 4) - (tailpred glst-node :offset-assert 8) - (numelem int32 :offset-assert 12) + ((head glst-node) + (tail glst-node) + (tailpred glst-node) + (numelem int32) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -49,65 +42,64 @@ ;; BEFORE the docstring, they end up being considered part of the body and the compiled output! ;; This amusing mistake is reproduced here. -(defun-debug glst-next ((node glst-node)) +(defun glst-next ((arg0 glst-node)) (declare (inline)) "return the next node in the list" - (-> node next) + (-> arg0 next) ) -(defun-debug glst-prev ((node glst-node)) +(defun glst-prev ((arg0 glst-node)) (declare (inline)) "return the previous node in the list" - (-> node prev) + (-> arg0 prev) ) -(defun-debug glst-head ((list glst-list)) +(defun glst-head ((arg0 glst-list)) (declare (inline)) "return the start of the list" - (-> list head) + (-> arg0 head) ) -(defun-debug glst-tail ((list glst-list)) +(defun glst-tail ((arg0 glst-list)) (declare (inline)) "return the tail of the list" - (-> list tailpred) + (-> arg0 tailpred) ) -(defun-debug glst-end-of-list? ((node glst-node)) +(defun glst-end-of-list? ((arg0 glst-node)) (declare (inline)) "is this node the end of the list. #t = end" - (not (-> node next)) + (not (-> arg0 next)) ) -(defun-debug glst-start-of-list? ((node glst-node)) +(defun glst-start-of-list? ((arg0 glst-node)) (declare (inline)) "is this node the start of the list. #t = start" - (not (-> node prev)) + (not (-> arg0 prev)) ) -(defun-debug glst-empty? ((list glst-list)) +(defun glst-empty? ((arg0 glst-list)) (declare (inline)) "is the list empty, #t = empty" - (= (-> list tailpred) (&-> list head)) + (= (-> arg0 tailpred) arg0) ) -(defun-debug glst-node-name ((node glst-named-node)) +(defun glst-node-name ((arg0 glst-named-node)) "Return the name of the node" - (-> node privname) + (-> arg0 privname) ) -(defun-debug glst-set-name! ((node glst-named-node) (name string)) +(defun glst-set-name! ((arg0 glst-named-node) (arg1 string)) "Set the name of the node" (declare (inline)) - (set! (-> node privname) name) + (set! (-> arg0 privname) arg1) ) - diff --git a/goal_src/jak1/engine/util/smush-control-h.gc b/goal_src/jak1/engine/util/smush-control-h.gc index d0727b4fda6..562de33a744 100644 --- a/goal_src/jak1/engine/util/smush-control-h.gc +++ b/goal_src/jak1/engine/util/smush-control-h.gc @@ -13,36 +13,34 @@ ;; DECOMP BEGINS (deftype smush-control (structure) - ((start-time time-frame :offset-assert 0) - (period float :offset-assert 8) - (duration float :offset-assert 12) - (amp float :offset-assert 16) - (damp-amp float :offset-assert 20) - (damp-period float :offset-assert 24) ;; set a negative value here to flag as die on next update - (ticks float :offset-assert 28) + ((start-time time-frame) + (period float) + (duration float) + (amp float) + (damp-amp float) + (damp-period float) ;; set a negative value here to flag as die on next update + (ticks float) ) :pack-me - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 (:methods - (set-zero! (_type_) _type_ 9) - (update! (_type_) float 10) - (get-no-update (_type_) float 11) - (activate! (_type_ float int int float float) _type_ 12) - (nonzero-amplitude? (_type_) symbol 13) - (die-on-next-update! (_type_) _type_ 14) - ) + (set-zero! (_type_) _type_) + (update! (_type_) float) + (get-no-update (_type_) float) + (activate! (_type_ float int int float float) _type_) + (nonzero-amplitude? (_type_) symbol) + (die-on-next-update! (_type_) _type_) + ) ) -(defmethod nonzero-amplitude? smush-control ((this smush-control)) + +(defmethod nonzero-amplitude? ((this smush-control)) "Return #t if amp is not zero, #f otherwise" (declare (inline)) - + (!= (-> this amp) 0.0) ) -(defmethod set-zero! smush-control ((this smush-control)) +(defmethod set-zero! ((this smush-control)) (set! (-> this period) 0.0) (set! (-> this duration) 0.0) (set! (-> this amp) 0.0) @@ -52,7 +50,7 @@ this ) -(defmethod update! smush-control ((this smush-control)) +(defmethod update! ((this smush-control)) "Run the smush control and return the result. Updates the internal state." (cond @@ -91,7 +89,7 @@ ) ) -(defmethod get-no-update smush-control ((this smush-control)) +(defmethod get-no-update ((this smush-control)) "Get the value, but don't update internal state" (cond @@ -110,7 +108,7 @@ ) ) -(defmethod die-on-next-update! smush-control ((this smush-control)) +(defmethod die-on-next-update! ((this smush-control)) "On the next call to update!, zero everything. Calls to get-no-update will still work." @@ -120,25 +118,16 @@ this ) -(defmethod activate! smush-control ((this smush-control) - (arg0 float) - (arg1 int) - (arg2 int) - (arg3 float) - (arg4 float) - ) +(defmethod activate! ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float)) "Activate the smush! This only activates if the ongoing smush is mostly done." - - (when (>= (fabs (* 0.2 (-> this amp))) - (fabs (get-no-update this)) - ) + (when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this))) (set! (-> this amp) arg0) (set! (-> this period) (the float arg1)) (set! (-> this duration) (the float arg2)) (set! (-> this damp-amp) arg3) (set! (-> this damp-period) arg4) (set! (-> this ticks) 0.0) - (set! (-> this start-time) (-> *display* base-frame-counter)) + (set-time! (-> this start-time)) ) this ) diff --git a/goal_src/jak1/engine/util/sync-info-h.gc b/goal_src/jak1/engine/util/sync-info-h.gc index a5986b1432e..cd014ebcbf2 100644 --- a/goal_src/jak1/engine/util/sync-info-h.gc +++ b/goal_src/jak1/engine/util/sync-info-h.gc @@ -15,147 +15,122 @@ ;; Simplest synchronization. Simply counts up, then resets once it reaches period. ;; For example, this is used to synchronize the "pies" in citadel. (deftype sync-info (structure) - ((offset float :offset-assert 0) ;; offset, stored as a time, not a phase. - (period uint32 :offset-assert 4) ;; period, stored in seconds units + ((offset float) ;; offset, stored as a time, not a phase. + (period uint32);; period, stored in seconds units ) :pack-me - :method-count-assert 18 - :size-assert #x8 - :flag-assert #x1200000008 (:methods - (get-current-value (_type_ float) float 9) - (get-current-phase-no-mod (_type_) float 10) - (get-current-phase (_type_) float 11) - (get-current-value-with-mirror (_type_ float) float 12) - (get-current-phase-with-mirror (_type_) float 13) - (setup-params! (_type_ uint float float float) none 14) - (load-params! (_type_ process uint float float float) symbol 15) - (sync-now! (_type_ float) float 16) - (get-phase-offset (_type_) float 17) - ) + (get-current-value (_type_ float) float) + (get-current-phase-no-mod (_type_) float) + (get-current-phase (_type_) float) + (get-current-value-with-mirror (_type_ float) float) + (get-current-phase-with-mirror (_type_) float) + (setup-params! (_type_ uint float float float) none) + (load-params! (_type_ process uint float float float) symbol) + (sync-now! (_type_ float) float) + (get-phase-offset (_type_) float) + ) ) ;; Syncronized, but also includes some smoothing at the beginning. ;; This is used for motion of platforms. (deftype sync-info-eased (sync-info) - ((tlo float :offset-assert 8) - (thi float :offset-assert 12) - (ylo float :offset-assert 16) - (m2 float :offset-assert 20) - (yend float :offset-assert 24) + ((tlo float) + (thi float) + (ylo float) + (m2 float) + (yend float) ) :allow-misaligned - :method-count-assert 18 - :size-assert #x1c - :flag-assert #x120000001c ) ;; Syncronized, but includes a pause. ;; This is used for whirlpools in lpc and the pushers in the yellow-eco room in snowy (deftype sync-info-paused (sync-info) - ((pause-after-out float :offset-assert 8) - (pause-after-in float :offset-assert 12) + ((pause-after-out float) + (pause-after-in float) ) :pack-me - :method-count-assert 18 - :size-assert #x10 - :flag-assert #x1200000010 ) ;; This is a strange one. After a random amount of time, it changes to a random value. (deftype delayed-rand-float (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (max-val float :offset-assert 8) - (timer int32 :offset-assert 12) - (start-time time-frame :offset-assert 16) - (value float :offset-assert 24) + ((min-time int32) + (max-time int32) + (max-val float) + (timer int32) + (start-time time-frame) + (value float) ) :pack-me - :method-count-assert 11 - :size-assert #x1c - :flag-assert #xb0000001c (:methods - (set-params! (_type_ int int float) float 9) - (update! (_type_ ) float 10) + (set-params! (_type_ int int float) float) + (update! (_type_) float) ) ) ;; second order oscillating float. (deftype oscillating-float (structure) - ((value float :offset-assert 0) - (target float :offset-assert 4) - (vel float :offset-assert 8) - (max-vel float :offset-assert 12) - (damping float :offset-assert 16) - (accel float :offset-assert 20) + ((value float) + (target float) + (vel float) + (max-vel float) + (damping float) + (accel float) ) :pack-me - :method-count-assert 11 - :size-assert #x18 - :flag-assert #xb00000018 (:methods - (set-params! (_type_ float float float float) float 9) - (update! (_type_ float) float 10) - ) + (set-params! (_type_ float float float float) float) + (update! (_type_ float) float) + ) ) ;; float that "bounces". (deftype bouncing-float (structure) - ((osc oscillating-float :inline :offset-assert 0) - (max-value float :offset-assert 24) - (min-value float :offset-assert 28) - (elasticity float :offset-assert 32) - (state int32 :offset-assert 36) + ((osc oscillating-float :inline) + (max-value float) + (min-value float) + (elasticity float) + (state int32) ) :pack-me - :method-count-assert 13 - :size-assert #x28 - :flag-assert #xd00000028 (:methods - (set-params! (_type_ float float float float float float float) float 9) - (update! (_type_ float) float 10) - (at-min? (_type_) symbol 11) - (at-max? (_type_) symbol 12) - ) + (set-params! (_type_ float float float float float float float) float) + (update! (_type_ float) float) + (at-min? (_type_) symbol) + (at-max? (_type_) symbol) + ) ) ;; like delayed-rand-float, but does 4 at a time. (deftype delayed-rand-vector (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (xz-max float :offset-assert 8) - (y-max float :offset-assert 12) - (timer int32 :offset-assert 16) - (start-time time-frame :offset-assert 24) - (value vector :inline :offset-assert 32) + ((min-time int32) + (max-time int32) + (xz-max float) + (y-max float) + (timer int32) + (start-time time-frame) + (value vector :inline) ) - :method-count-assert 13 - :size-assert #x30 - :flag-assert #xd00000030 (:methods - (set-params! (_type_ int int float float) vector 9) - (update-now! (_type_) vector 10) - (update-with-delay! (_type_) vector 11) - (update-with-delay-or-reset! (_type_) vector 12) - ) + (set-params! (_type_ int int float float) vector) + (update-now! (_type_) vector) + (update-with-delay! (_type_) vector) + (update-with-delay-or-reset! (_type_) vector) + ) ) ;; like oscillating-float, but does 4 at a time. (deftype oscillating-vector (structure) - ((value vector :inline :offset-assert 0) - (target vector :inline :offset-assert 16) - (vel vector :inline :offset-assert 32) - (max-vel float :offset-assert 48) - (damping float :offset-assert 52) - (accel float :offset-assert 56) + ((value vector :inline) + (target vector :inline) + (vel vector :inline) + (max-vel float) + (damping float) + (accel float) ) - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (set-params! (_type_ vector float float float) vector 9) - (update! (_type_ vector) vector 10) - ) + (set-params! (_type_ vector float float float) vector) + (update! (_type_ vector) vector) + ) ) - diff --git a/goal_src/jak1/engine/util/sync-info.gc b/goal_src/jak1/engine/util/sync-info.gc index f27be79d3f1..1b8e06f10cb 100644 --- a/goal_src/jak1/engine/util/sync-info.gc +++ b/goal_src/jak1/engine/util/sync-info.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod setup-params! sync-info ((this sync-info) (period uint) (phase float) (arg2 float) (arg3 float)) +(defmethod setup-params! ((this sync-info) (period uint) (phase float) (arg2 float) (arg3 float)) "Setup a sync-info. period is the duration of the pattern. phase is the offset relative to the global clock, specified as a fraction of period." @@ -16,14 +16,13 @@ (value (* phase period-float)) ) ;; this is like (fmod value period-float) - (set! (-> this offset) - (- value (* (the float (the int (/ value period-float))) period-float)) - ) + (set! (-> this offset) (- value (* (the float (the int (/ value period-float))) period-float))) ) + 0 (none) ) -(defmethod setup-params! sync-info-eased ((this sync-info-eased) (period uint) (phase float) (out-param float) (in-param float)) +(defmethod setup-params! ((this sync-info-eased) (period uint) (phase float) (out-param float) (in-param float)) "Setup a sync-info-eased. The out-param and in-param are related to the smoothing at the beginning/end. it looks like the easing is cubic so the first derivative is continuous." (set! (-> this period) period) @@ -56,9 +55,9 @@ (f0-10 out-param) (f1-12 (+ out-param total-normal-phase)) (f2-5 (* f0-10 f0-10)) - (f3-3 (+ (* (* 2.0 f0-10) (- f1-12 f0-10)) f2-5)) + (f3-3 (+ (* 2.0 f0-10 (- f1-12 f0-10)) f2-5)) (f4-3 (/ f0-10 (- 1.0 f1-12))) - (y-end (+ (* (* (- 1.0 f1-12) (- 1.0 f1-12)) f4-3) f3-3)) + (y-end (+ (* (- 1.0 f1-12) (- 1.0 f1-12) f4-3) f3-3)) ) (set! (-> this tlo) f0-10) (set! (-> this thi) f1-12) @@ -67,10 +66,11 @@ (set! (-> this yend) y-end) ) ) + 0 (none) ) -(defmethod setup-params! sync-info-paused ((this sync-info-paused) (period uint) (phase float) (out-param float) (in-param float)) +(defmethod setup-params! ((this sync-info-paused) (period uint) (phase float) (out-param float) (in-param float)) "Setup a sync-info-paused. The params are delays for the pause, specified in a fraction of period." (set! (-> this period) period) ;; set phase. @@ -99,10 +99,17 @@ ) (set! (-> this pause-after-in) in-param) (set! (-> this pause-after-out) out-param) + 0 (none) ) -(defmethod load-params! sync-info ((this sync-info) (proc process) (default-period uint) (default-phase float) (default-out float) (default-in float)) +(defmethod load-params! ((this sync-info) + (proc process) + (default-period uint) + (default-phase float) + (default-out float) + (default-in float) + ) "Load params from the res of a process, and set them up. If the res lookup fails, returns #f and uses the specified defaults." (local-vars (sv-16 res-tag)) @@ -110,26 +117,32 @@ (let ((v1-1 (res-lump-data (-> proc entity) 'sync pointer :tag-ptr (& sv-16)))) (cond (v1-1 - ;; res lookup succeeded, we should have two values: a period (not yet in seconds) and a phase. - (setup-params! - this - (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) - (-> (the-as (pointer float) v1-1) 1) - 0.15 - 0.15 + ;; res lookup succeeded, we should have two values: a period (not yet in seconds) and a phase. + (setup-params! + this + (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) + (-> (the-as (pointer float) v1-1) 1) + 0.15 + 0.15 + ) + #t ) - #t - ) (else - ;; failed, set defaults - (setup-params! this default-period default-phase 0.15 0.15) - #f - ) + ;; failed, set defaults + (setup-params! this default-period default-phase 0.15 0.15) + #f + ) ) ) ) -(defmethod load-params! sync-info-eased ((this sync-info-eased) (proc process) (default-period uint) (default-phase float) (default-out float) (default-in float)) +(defmethod load-params! ((this sync-info-eased) + (proc process) + (default-period uint) + (default-phase float) + (default-out float) + (default-in float) + ) "Load settings from a res. Can load settings from just a sync-info and uses defaults. If res lookup totally fails, will return #f and use all defaults." (local-vars (sv-16 res-tag)) @@ -137,195 +150,169 @@ (let ((v1-1 (res-lump-data (-> proc entity) 'sync pointer :tag-ptr (& sv-16)))) (cond (v1-1 - ;; we may not get all the parameters - (if (>= (-> sv-16 elt-count) (the-as uint 4)) - (setup-params! - this - (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) - (-> (the-as (pointer float) v1-1) 1) - (-> (the-as (pointer float) v1-1) 2) - (-> (the-as (pointer float) v1-1) 3) - ) - (setup-params! - this - (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) - (-> (the-as (pointer float) v1-1) 1) - default-out - default-in + ;; we may not get all the parameters + (if (>= (-> sv-16 elt-count) (the-as uint 4)) + (setup-params! + this + (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) + (-> (the-as (pointer float) v1-1) 1) + (-> (the-as (pointer float) v1-1) 2) + (-> (the-as (pointer float) v1-1) 3) + ) + (setup-params! + this + (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) + (-> (the-as (pointer float) v1-1) 1) + default-out + default-in + ) ) - ) - #t - ) + #t + ) (else - (setup-params! this default-period default-phase default-out default-in) - #f - ) + (setup-params! this default-period default-phase default-out default-in) + #f + ) ) ) ) -(defmethod load-params! sync-info-paused ((this sync-info-paused) (proc process) (default-period uint) (default-phase float) (default-out float) (default-in float)) +(defmethod load-params! ((this sync-info-paused) + (proc process) + (default-period uint) + (default-phase float) + (default-out float) + (default-in float) + ) "Load and setup a sync-info-paused." (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (res-lump-data (-> proc entity) 'sync pointer :tag-ptr (& sv-16)))) - (cond - (v1-1 - (if (>= (-> sv-16 elt-count) (the-as uint 4)) - (setup-params! - this - (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) - (-> (the-as (pointer float) v1-1) 1) - (-> (the-as (pointer float) v1-1) 2) - (-> (the-as (pointer float) v1-1) 3) - ) - (setup-params! - this - (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) - (-> (the-as (pointer float) v1-1) 1) - default-out - default-in - ) + (cond + (v1-1 + (if (>= (-> sv-16 elt-count) (the-as uint 4)) + (setup-params! + this + (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) + (-> (the-as (pointer float) v1-1) 1) + (-> (the-as (pointer float) v1-1) 2) + (-> (the-as (pointer float) v1-1) 3) + ) + (setup-params! + this + (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) + (-> (the-as (pointer float) v1-1) 1) + default-out + default-in + ) + ) + #t + ) + (else + (setup-params! this default-period default-phase default-out default-in) + #f + ) ) - #t - ) - (else - (setup-params! this default-period default-phase default-out default-in) - #f - ) ) - ) ) -(defmethod get-current-phase-no-mod sync-info ((this sync-info)) +(defmethod get-current-phase-no-mod ((this sync-info)) "Based on the current frame, get the current phase. Does not apply any modifications like pauses or eases." (let* ((period (-> this period)) (period-float (the float period)) ;; now + offset - (current-time - (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) - (-> this offset) - ) - ) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) ) ;; compute wrapped phase from current-time - (/ (- current-time - (* (the float (the int (/ current-time period-float))) period-float)) - period-float - ) + (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) ) ) -(defmethod get-phase-offset sync-info ((this sync-info)) +(defmethod get-phase-offset ((this sync-info)) "Get the offset, as a fraction of period" (/ (-> this offset) (the float (-> this period))) ) -(defmethod sync-now! sync-info ((this sync-info) (user-phase-offset float)) +(defmethod sync-now! ((this sync-info) (user-time-offset float)) "Adjusts our offset so we are at phase user-phase-offset now" (let* ((period (-> this period)) (period-float (the float period)) ;; in (0, 1) (wrapped-user-offset - (- user-phase-offset - (* (the float (the int (/ user-phase-offset period-float))) - period-float - ) - ) + (- user-time-offset (* (the float (the int (/ user-time-offset period-float))) period-float)) ) ;; with the current offset, what is the time (0, period)? - (current-time - (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) - (-> this offset) - ) - ) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) ;; current period in (0, 1) - (current-period-wrapped - (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) - period-float - ) + (current-time-wrapped + (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) ) ;; a time (combined-offset - (+ (+ (* (- wrapped-user-offset current-period-wrapped) period-float) - period-float - ) - (-> this offset) - ) - ) - ;; wrap it - (combined-offset-wrapped - (- combined-offset - (* (the float (the int (/ combined-offset period-float))) period-float) - ) + (+ (* (- wrapped-user-offset current-time-wrapped) period-float) period-float (-> this offset)) ) ) - (set! (-> this offset) combined-offset-wrapped) - combined-offset-wrapped + ;; wrap it + (set! (-> this offset) + (- combined-offset (* (the float (the int (/ combined-offset period-float))) period-float)) + ) ) ) -(defmethod get-current-phase sync-info ((this sync-info)) +(defmethod get-current-phase ((this sync-info)) "Get the current phase." (let* ((period (-> this period)) (period-float (the float period)) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> this offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) ) ;; don't need to wrap this again. - (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) - period-float - ) + (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) ) ) -(defmethod get-current-phase sync-info-paused ((this sync-info-paused)) +(defmethod get-current-phase ((this sync-info-paused)) "Get the current phase. this only uses the pause-after-out - use the mirrored version for pauses on both ends" (let* ((period (-> this period)) (period-float (the float period)) (max-phase 1.0) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> this offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) ) - (fmin max-phase - (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) - (* period-float (- 1.0 (-> this pause-after-out))) ;; just tweak the effective period so we end early - ) + (fmin max-phase (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) + (* period-float (- 1.0 (-> this pause-after-out))) + ) ) ) ) -(defmethod get-current-value sync-info ((this sync-info) (max-val float)) +(defmethod get-current-value ((this sync-info) (max-val float)) "This is just get-current-phase multiplied by max-val" (let* ((period (-> this period)) (period-float (the float period)) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> this offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) ) - (* (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) - period-float - ) + (* (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) max-val ) ) ) -(defmethod get-current-value sync-info-paused ((this sync-info-paused) (arg0 float)) +(defmethod get-current-value ((this sync-info-paused) (arg0 float)) "This is just get-current-phase multiplied by max-val" (* (get-current-phase this) arg0) ) -(defmethod get-current-phase-with-mirror sync-info ((this sync-info)) +(defmethod get-current-phase-with-mirror ((this sync-info)) "Gets the phase that goes from 0 to 1 back to 0 every period." (let* ((period (-> this period)) (period-float (the float period)) (max-val 2.0) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> this offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) (phase-out-of-2 - (* max-val - (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) - period-float - ) - ) + (* max-val + (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) + ) ) ) (if (>= phase-out-of-2 1.0) @@ -334,21 +321,18 @@ phase-out-of-2 ) ) - -(defmethod get-current-phase-with-mirror sync-info-eased ((this sync-info-eased)) +(defmethod get-current-phase-with-mirror ((this sync-info-eased)) "Get the phase that goes from 0 to 1 back to 0 every period. Note that sync-info-eased only does easing on this mirrored version." (let* ((period (-> this period)) (period-float (the float period)) (max-val 2.0) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> this offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) (current-val - (* max-val - (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) - period-float - ) - ) + (* max-val + (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) + ) ) (in-mirror? #f) ) @@ -366,18 +350,18 @@ ) ((< current-val (-> this thi)) ;; linear part - (+ (* (* 2.0 tlo) (- current-val tlo)) (-> this ylo)) + (+ (* 2.0 tlo (- current-val tlo)) (-> this ylo)) ) (else - (let ((f1-7 (- 1.0 current-val))) - ;; quadratic ramp out - (- (-> this yend) (* (* f1-7 f1-7) (-> this m2))) - ) - ) + (let ((f1-7 (- 1.0 current-val))) + ;; quadratic ramp out + (- (-> this yend) (* f1-7 f1-7 (-> this m2))) + ) + ) ) (-> this yend) ) - ) + ) ) ;; flip again (if in-mirror? @@ -388,52 +372,50 @@ ) ) -(defmethod get-current-phase-with-mirror sync-info-paused ((this sync-info-paused)) +(defmethod get-current-phase-with-mirror ((this sync-info-paused)) "Get the phase that goes from 0 to 1 to 0 in one period." (let* ((v1-0 (-> this period)) (f1-0 (the float v1-0)) ;; max val (f0-1 2.0) ;; current-time - (f2-2 (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) v1-0)) (-> this offset))) + (f2-2 (+ (the float (mod (the-as uint (current-time)) v1-0)) (-> this offset))) ;; phase (f0-2 (* f0-1 (/ (- f2-2 (* (the float (the int (/ f2-2 f1-0))) f1-0)) f1-0))) ;; offset for pause (f1-3 (- 1.0 (* 2.0 (-> this pause-after-in)))) (f2-7 (- 1.0 (* 2.0 (-> this pause-after-out)))) ) - (cond - ((>= f0-2 (+ 1.0 f1-3)) - 0.0 ;; before pause ends - ) - ((< 1.0 f0-2) - ;; in moving part - (- 1.0 (/ (+ -1.0 f0-2) f1-3)) - ) - ((>= f0-2 f2-7) - ;; after end pause - 1.0 - ) - (else - ;; in moving part - (/ f0-2 f2-7) - ) + (cond + ((>= f0-2 (+ 1.0 f1-3)) + 0.0 ;; before pause ends + ) + ((< 1.0 f0-2) + ;; in mmoving part + (- 1.0 (/ (+ -1.0 f0-2) f1-3)) + ) + ((>= f0-2 f2-7) + ;; after end pause + 1.0 + ) + (else + ;; in mmoving part + (/ f0-2 f2-7) + ) + ) ) - ) ) -(defmethod get-current-value-with-mirror sync-info ((this sync-info) (max-out-val float)) +(defmethod get-current-value-with-mirror ((this sync-info) (max-out-val float)) "Get the phase that goes from 0 to max-out-val to 0 in each period." (let* ((period (-> this period)) (period-float (the float period)) (max-val 2.0) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> this offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) (current-val - (* max-val - (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) - period-float - ) - ) + (* max-val + (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) + ) ) ) (if (>= current-val 1.0) @@ -443,17 +425,17 @@ ) ) -(defmethod get-current-value-with-mirror sync-info-eased ((this sync-info-eased) (max-out-val float)) +(defmethod get-current-value-with-mirror ((this sync-info-eased) (max-out-val float)) "Get phase that goes from 0 to max-out-val to 0 in each period" (* (get-current-phase-with-mirror this) max-out-val) ) -(defmethod get-current-value-with-mirror sync-info-paused ((this sync-info-paused) (max-out-val float)) +(defmethod get-current-value-with-mirror ((this sync-info-paused) (max-out-val float)) "Get phase that goes from 0 to max-out-val to 0 in each period" (* (get-current-phase-with-mirror this) max-out-val) ) -(defmethod set-params! delayed-rand-float ((this delayed-rand-float) (min-tim int) (max-time int) (max-times-two float)) +(defmethod set-params! ((this delayed-rand-float) (min-tim int) (max-time int) (max-times-two float)) "Float that changes randomly: min-time: minimum time between changes max-time: maximum time between changes @@ -467,11 +449,11 @@ (-> this value) ) -(defmethod update! delayed-rand-float ((this delayed-rand-float)) +(defmethod update! ((this delayed-rand-float)) "Get the value." - (when (>= (- (-> *display* base-frame-counter) (-> this start-time)) (-> this timer)) + (when (time-elapsed? (-> this start-time) (-> this timer)) ;; only update if enough time has passed. - (set! (-> this start-time) (-> *display* base-frame-counter)) + (set-time! (-> this start-time)) ;; come up with a random end time. (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) ;; come up with a random value in (-max, max) @@ -480,14 +462,14 @@ (-> this value) ) -(defmethod set-params! oscillating-float ((this oscillating-float) (init-val float) (accel float) (max-vel float) (damping float)) +(defmethod set-params! ((this oscillating-float) (init-val float) (accel float) (max-vel float) (damping float)) "Setup an oscillating-float. It will head toward the target, but will overshoot and oscillate before eventually reaching the target. init-val: the initial value and target max-vel: velocity limit damping: this is 1 - damping really. 0 means don't move, 1 means oscillate forever. accel: gain." - + (set! (-> this value) init-val) (set! (-> this target) init-val) (set! (-> this vel) 0.0) @@ -497,12 +479,12 @@ (-> this value) ) -(defmethod update! oscillating-float ((this oscillating-float) (target-offset float)) +(defmethod update! ((this oscillating-float) (target-offset float)) ;; first compute desired acceleration (let ((acc (* (- (+ (-> this target) target-offset) (-> this value)) (* (-> this accel) (-> *display* time-adjust-ratio)) ) - ) + ) ) ;; integrate and update velocity (+! (-> this vel) acc) @@ -516,7 +498,15 @@ (-> this value) ) -(defmethod set-params! bouncing-float ((this bouncing-float) (init-val float) (max-val float) (min-val float) (elast float) (accel float) (max-vel float) (damping float)) +(defmethod set-params! ((this bouncing-float) + (init-val float) + (max-val float) + (min-val float) + (elast float) + (accel float) + (max-vel float) + (damping float) + ) "Float that bounces. It's an oscillating float, but you can add a floor/ceiling that has an elastic collision. init-val: intial value and target. @@ -534,7 +524,7 @@ (-> this osc value) ) -(defmethod update! bouncing-float ((this bouncing-float) (arg0 float)) +(defmethod update! ((this bouncing-float) (arg0 float)) ;; first, update the oscillator and assume we aren't in a bouncing part (update! (-> this osc) arg0) (set! (-> this state) 0) @@ -560,17 +550,17 @@ (-> this osc value) ) -(defmethod at-min? bouncing-float ((this bouncing-float)) - "Did the last update it the minimum value?" +(defmethod at-min? ((this bouncing-float)) + "Did the last update hit the minimum value?" (= (-> this state) -1) ) -(defmethod at-max? bouncing-float ((this bouncing-float)) +(defmethod at-max? ((this bouncing-float)) "Did the last update hit the maximum value?" (= (-> this state) 1) ) -(defmethod set-params! delayed-rand-vector ((this delayed-rand-vector) (min-time int) (max-time int) (xz-range float) (y-range float)) +(defmethod set-params! ((this delayed-rand-vector) (min-time int) (max-time int) (xz-range float) (y-range float)) "Set up a delayed-rand-vector. This vector randomly changes at random times. min-time: minimum time between changes max-time: maximum time between changes @@ -586,9 +576,9 @@ (-> this value) ) -(defmethod update-now! delayed-rand-vector ((this delayed-rand-vector)) +(defmethod update-now! ((this delayed-rand-vector)) "update to a random value now" - (set! (-> this start-time) (-> *display* base-frame-counter)) + (set-time! (-> this start-time)) (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) (set! (-> this value x) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) (set! (-> this value y) (rand-vu-float-range (- (-> this y-max)) (-> this y-max))) @@ -596,36 +586,36 @@ (-> this value) ) -(defmethod update-with-delay! delayed-rand-vector ((this delayed-rand-vector)) +(defmethod update-with-delay! ((this delayed-rand-vector)) "Update, if enough time has passed" - (if (>= (- (-> *display* base-frame-counter) (-> this start-time)) (-> this timer)) - (update-now! this) - ) + (if (time-elapsed? (-> this start-time) (-> this timer)) + (update-now! this) + ) (-> this value) ) -(defmethod update-with-delay-or-reset! delayed-rand-vector ((this delayed-rand-vector)) +(defmethod update-with-delay-or-reset! ((this delayed-rand-vector)) "Update, if enough time has passed. Otherwise reset to zero." - (if (>= (- (-> *display* base-frame-counter) (-> this start-time)) (-> this timer)) - (update-now! this) - (vector-reset! (-> this value)) - ) + (if (time-elapsed? (-> this start-time) (-> this timer)) + (update-now! this) + (vector-reset! (-> this value)) + ) (-> this value) ) -(defmethod set-params! oscillating-vector ((this oscillating-vector) (init-val vector) (accel float) (max-vel float) (damping float)) +(defmethod set-params! ((this oscillating-vector) (init-val vector) (accel float) (max-vel float) (damping float)) "Works just like oscillating-float, but does a whole vector. init-val can be #f to reset to 0." (cond - (init-val - (set! (-> this value quad) (-> init-val quad)) - (set! (-> this target quad) (-> init-val quad)) - ) - (else - (vector-reset! (-> this value)) - (vector-reset! (-> this target)) + (init-val + (set! (-> this value quad) (-> init-val quad)) + (set! (-> this target quad) (-> init-val quad)) + ) + (else + (vector-reset! (-> this value)) + (vector-reset! (-> this target)) + ) ) - ) (vector-reset! (-> this vel)) (set! (-> this max-vel) max-vel) (set! (-> this damping) damping) @@ -633,17 +623,17 @@ (-> this value) ) -(defmethod update! oscillating-vector ((this oscillating-vector) (target-offset vector)) +(defmethod update! ((this oscillating-vector) (target-offset vector)) "target-offset can be #f, acts like 0" (let ((s5-0 (new 'stack-no-clear 'vector))) (cond (target-offset - (vector+! s5-0 (-> this target) target-offset) - (vector-! s5-0 s5-0 (-> this value)) - ) + (vector+! s5-0 (-> this target) target-offset) + (vector-! s5-0 s5-0 (-> this value)) + ) (else - (vector-! s5-0 (-> this target) (-> this value)) - ) + (vector-! s5-0 (-> this target) (-> this value)) + ) ) (vector-float*! s5-0 s5-0 (* (-> this accel) (-> *display* time-adjust-ratio))) (vector+! (-> this vel) (-> this vel) s5-0) diff --git a/goal_src/jak1/engine/util/types-h.gc b/goal_src/jak1/engine/util/types-h.gc index a94b5b640b0..cdcdf1bbf73 100644 --- a/goal_src/jak1/engine/util/types-h.gc +++ b/goal_src/jak1/engine/util/types-h.gc @@ -10,12 +10,10 @@ (deftype time-frame (int64) () - :flag-assert #x900000008 ) (deftype part-id (uint32) () - :flag-assert #x900000004 ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/goal_src/jak1/kernel-defs.gc b/goal_src/jak1/kernel-defs.gc index 7f4d06af58e..7d5350b57d4 100644 --- a/goal_src/jak1/kernel-defs.gc +++ b/goal_src/jak1/kernel-defs.gc @@ -278,12 +278,12 @@ ) (:methods - (new (symbol type basic) _type_ 0) - (activate (_type_ process-tree basic pointer) process-tree 9) - (deactivate (_type_) none 10) - (init-from-entity! (_type_ entity-actor) none 11) - (run-logic? (_type_) symbol 12) - (process-tree-method-13 () none 13) + (new (symbol type basic) _type_) + (activate (_type_ process-tree basic pointer) process-tree) ;; 9 + (deactivate (_type_) none) ;; 10 + (init-from-entity! (_type_ entity-actor) none) ;; 11 + (run-logic? (_type_) symbol) ;; 12 + (process-tree-method-13 () none) ;; 13 ) :size-assert #x20 diff --git a/goal_src/jak1/kernel/dgo-h.gc b/goal_src/jak1/kernel/dgo-h.gc index 343d4706f0f..d17d03d6793 100644 --- a/goal_src/jak1/kernel/dgo-h.gc +++ b/goal_src/jak1/kernel/dgo-h.gc @@ -13,23 +13,17 @@ ;; seems to be unused, and not accurate to a DGO file anyway. ;; all DGO stuff is handled on the IOP. (deftype dgo-entry (structure) - ((offset uint32 :offset-assert 0) - (length uint32 :offset-assert 4) + ((offset uint32) + (length uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; seems to be unused, and not accurate to a DGO file anyway. ;; all DGO stuff is handled on the IOP. (deftype dgo-file (basic) - ((num-go-files uint32 :offset-assert 4) - (total-length uint32 :offset-assert 8) - (rsvd uint32 :offset-assert 12) - (data uint8 :dynamic :offset-assert 16) + ((num-go-files uint32) + (total-length uint32) + (rsvd uint32) + (data uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) diff --git a/goal_src/jak1/kernel/gcommon.gc b/goal_src/jak1/kernel/gcommon.gc index aa64657e579..1b3f987f689 100644 --- a/goal_src/jak1/kernel/gcommon.gc +++ b/goal_src/jak1/kernel/gcommon.gc @@ -236,12 +236,9 @@ (y float :offset 32) (z float :offset 64) (w float :offset 96)) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) -(defmethod inspect vec4s ((this vec4s)) +(defmethod inspect ((this vec4s)) (format #t "[~8x] ~A~%" this 'vec4s) (format #t "~Tx: ~f~%" (-> this x)) (format #t "~Ty: ~f~%" (-> this y)) @@ -250,7 +247,7 @@ this ) -(defmethod print vec4s ((this vec4s)) +(defmethod print ((this vec4s)) (format #t "#" (-> this x) (-> this y) @@ -282,13 +279,10 @@ ;; A "boxed float" type. Simply a float with type information. (deftype bfloat (basic) - ((data float :offset-assert 4)) - :size-assert 8 - :method-count-assert 9 - :flag-assert #x900000008 + ((data float)) ) -(defmethod print bfloat ((this bfloat)) +(defmethod print ((this bfloat)) "Override the default print method to print a bfloat like a normal float" (format #t "~f" (-> this data)) this @@ -298,7 +292,7 @@ ;; Type System ;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod asize-of type ((this type)) +(defmethod asize-of ((this type)) "Get the size in memory of a type" ;; The 28 is 8 bytes too large. It's also strange that types have a 16-byte aligned size always, ;; but this matches what the runtime does as well. There's no reason that I can see for this, @@ -389,7 +383,7 @@ (car lst) ) -(defmethod length pair ((this pair)) +(defmethod length ((this pair)) "Get the length of a proper list" (local-vars (result int)) (cond @@ -410,10 +404,8 @@ ) -(defmethod asize-of pair ((this pair)) - "Get the size in memory of pair. - Note: if you make a child type of pair, - you must override this. (nobody does this?)" +(defmethod asize-of ((this pair)) + "Get the size in memory of pair." (the-as int (-> pair size)) ) @@ -663,18 +655,15 @@ ;; however, as far as we've seen, nothing actually reads the stride. (deftype inline-array-class (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) + ((length int32) + (allocated-length int32) ;; this is 16-byte aligned. ;; children of inline-array-class should define their own data which overlays this one. (_data uint8 :dynamic :offset 16) ) - (:methods (new (symbol type int) _type_ 0)) - - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 + (:methods + (new (symbol type int) _type_)) ) @@ -700,13 +689,13 @@ ) -(defmethod length inline-array-class ((this inline-array-class)) +(defmethod length ((this inline-array-class)) "Get the length of the inline-array-class. This is the length field, not how much storage there is" (-> this length) ) -(defmethod asize-of inline-array-class ((this inline-array-class)) +(defmethod asize-of ((this inline-array-class)) "Get the size in memory of an inline-array-class." (the-as int (+ (-> this type size) @@ -754,7 +743,7 @@ ) -(defmethod print array ((this array)) +(defmethod print ((this array)) "Print array." (format #t "#(") (cond @@ -883,7 +872,7 @@ this ) -(defmethod inspect array ((this array)) +(defmethod inspect ((this array)) "Inspect an array" (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -959,12 +948,12 @@ this ) -(defmethod length array ((this array)) +(defmethod length ((this array)) "Get the length of an array" (-> this length) ) -(defmethod asize-of array ((this array)) +(defmethod asize-of ((this array)) "Get the size in memory of an array" (the-as int (+ (-> array size) (* (-> this allocated-length) diff --git a/goal_src/jak1/kernel/gkernel-h.gc b/goal_src/jak1/kernel/gkernel-h.gc index 8ed5313762c..7e03bf78a3a 100644 --- a/goal_src/jak1/kernel/gkernel-h.gc +++ b/goal_src/jak1/kernel/gkernel-h.gc @@ -137,17 +137,17 @@ ;; this stores the current state of the kernel. (deftype kernel-context (basic) - ((prevent-from-run process-mask :offset-assert 4) ;; don't run processes with any of these bits set. - (require-for-run process-mask :offset-assert 8) ;; unused - (allow-to-run process-mask :offset-assert 12) ;; unused - (next-pid int32 :offset-assert 16) ;; next unused unique process ID - (fast-stack-top pointer :offset-assert 20) - (current-process process :offset-assert 24) ;; currently executing process - (relocating-process basic :offset-assert 28) ;; currently relocating process - (relocating-min int32 :offset-assert 32) ;; start of memory being relocated - (relocating-max int32 :offset-assert 36) ;; end of memory being relocated - (relocating-offset int32 :offset-assert 40) ;; how far the memory being relocated is moving - (low-memory-message symbol :offset-assert 44) ;; should we print warnings if low on memory? + ((prevent-from-run process-mask) ;; don't run processes with any of these bits set. + (require-for-run process-mask) ;; unused + (allow-to-run process-mask) ;; unused + (next-pid int32) ;; next unused unique process ID + (fast-stack-top pointer) + (current-process process) ;; currently executing process + (relocating-process basic) ;; currently relocating process + (relocating-min int32) ;; start of memory being relocated + (relocating-max int32) ;; end of memory being relocated + (relocating-offset int32) ;; how far the memory being relocated is moving + (low-memory-message symbol) ;; should we print warnings if low on memory? ) :size-assert #x30 @@ -170,26 +170,22 @@ ;; NOTE! - this type is created in kscheme.cpp. It has room for 12 methods and size 0x28 bytes. (deftype thread (basic) - ((name basic :offset-assert 4) ;; name of the thread (usually a symbol?) - (process process :offset-assert 8) ;; process that the thread belongs to - (previous thread :offset-assert 12) ;; previous thread that was running in the process - (suspend-hook (function cpu-thread none) :offset-assert 16) ;; function to suspend this thread - (resume-hook (function cpu-thread none) :offset-assert 20) ;; function to resume this thread - (pc pointer :offset-assert 24) ;; program counter of the thread - (sp pointer :offset-assert 28) ;; stack pointer of the thread (actual stack) - (stack-top pointer :offset-assert 32) ;; top of the thread's stack (actual stack) - (stack-size int32 :offset-assert 36) ;; size of the thread's stack (backup stack) + ((name basic) ;; name of the thread (usually a symbol?) + (process process) ;; process that the thread belongs to + (previous thread) ;; previous thread that was running in the process + (suspend-hook (function cpu-thread none)) ;; function to suspend this thread + (resume-hook (function cpu-thread none)) ;; function to resume this thread + (pc pointer) ;; program counter of the thread + (sp pointer) ;; stack pointer of the thread (actual stack) + (stack-top pointer) ;; top of the thread's stack (actual stack) + (stack-size int32) ;; size of the thread's stack (backup stack) ) (:methods - (stack-size-set! (_type_ int) none 9) - (thread-suspend (_type_) none 10) - (thread-resume (_type_) none 11) + (stack-size-set! (_type_ int) none) + (thread-suspend (_type_) none) + (thread-resume (_type_) none) ) - - :size-assert #x28 - :method-count-assert 12 - :flag-assert #xc00000028 ;; is already defined in kscheme but we define it again. ) @@ -209,14 +205,10 @@ ) (:methods - (new (symbol type process symbol int pointer) _type_ 0) - (thread-suspend (_type_) none 10) - (thread-resume (_type_) none 11) + (new (symbol type process symbol int pointer) _type_) + (thread-suspend (_type_) none) + (thread-resume (_type_) none) ) - - :size-assert #x80 - :method-count-assert 12 - :flag-assert #xc00000080 ) ;; ppointer system: @@ -230,62 +222,58 @@ ;; (except GOAL is old and it looks like they called them left-child right-brother trees back then) (declare-type entity-actor basic) (deftype process-tree (basic) - ((name basic :offset-assert 4) - (mask process-mask :offset-assert 8) + ((name basic) + (mask process-mask) ;; tree - (parent (pointer process-tree) :offset-assert 12) - (brother (pointer process-tree) :offset-assert 16) - (child (pointer process-tree) :offset-assert 20) - (ppointer (pointer process) :offset-assert 24) + (parent (pointer process-tree)) + (brother (pointer process-tree)) + (child (pointer process-tree)) + (ppointer (pointer process)) ;; in cases where the process never moves, the kernel will set ppointer to the address of the self field - (self process-tree :offset-assert 28) + (self process-tree) ) (:methods - (new (symbol type basic) _type_ 0) - (activate (_type_ process-tree basic pointer) process-tree 9) - (deactivate (_type_) none 10) - (init-from-entity! (_type_ entity-actor) none 11) - (run-logic? (_type_) symbol 12) - (process-tree-method-13 () none 13) + (new (symbol type basic) _type_) + (activate (_type_ process-tree basic pointer) process-tree) + (deactivate (_type_) none) + (init-from-entity! (_type_ entity-actor) none) + (run-logic? (_type_) symbol) + (process-tree-method-13 () none) ) - :size-assert #x20 - :method-count-assert 14 :no-runtime-type ;; already defined by kscheme. Don't do it again. ) ;; A GOAL process. A GOAL process contains memory and a suspendable main-thread. (deftype process (process-tree) - ((pool dead-pool :offset-assert #x20) ;; the memory pool we came from, and should return to when we die - (status basic :offset-assert #x24) - (pid int32 :offset-assert #x28) ;; unqiue process ID - (main-thread cpu-thread :offset-assert #x2c) ;; our suspendable main thread - (top-thread thread :offset-assert #x30) ;; currently running thread - (entity entity-actor :offset-assert #x34) ;; if we are a process spawned by an entity-actor, our entity - (state state :offset-assert #x38) ;; if we use the state system, our current state - (trans-hook function :offset-assert #x3c) ;; function to call for trans - (post-hook function :offset-assert #x40) ;; function to call for post - (event-hook (function process int symbol event-message-block object) :offset-assert #x44) ;; function to call for events - (allocated-length int32 :offset-assert #x48) ;; size not included in process (including fields + heap) - (next-state state :offset-assert #x4c) ;; if we are "going", the next state to go to. - (heap-base pointer :offset-assert #x50) ;; process heap - (heap-top pointer :offset-assert #x54) - (heap-cur pointer :offset-assert #x58) - (stack-frame-top stack-frame :offset-assert #x5c) ;; stack frame. top means "closest to current execution" - (connection-list connectable :inline :offset-assert #x60) ;; list of engines we're connected to - (stack uint8 :dynamic :offset-assert #x70) ;; memory for fields + process heap + ((pool dead-pool) ;; the memory pool we came from, and should return to when we die + (status basic) + (pid int32) ;; unqiue process ID + (main-thread cpu-thread) ;; our suspendable main thread + (top-thread thread) ;; currently running thread + (entity entity-actor) ;; if we are a process spawned by an entity-actor, our entity + (state state) ;; if we use the state system, our current state + (trans-hook function) ;; function to call for trans + (post-hook function) ;; function to call for post + (event-hook (function process int symbol event-message-block object)) ;; function to call for events + (allocated-length int32) ;; size not included in process (including fields + heap) + (next-state state) ;; if we are "going", the next state to go to. + (heap-base pointer) ;; process heap + (heap-top pointer) + (heap-cur pointer) + (stack-frame-top stack-frame) ;; stack frame. top means "closest to current execution" + (connection-list connectable :inline) ;; list of engines we're connected to + (stack uint8 :dynamic) ;; memory for fields + process heap ) (:methods - (new (symbol type basic int) _type_ 0) + (new (symbol type basic int) _type_) ) (:states dead-state empty-state) - :size-assert #x70 - :method-count-assert 14 :no-runtime-type ;; already defined by kscheme. Don't do it again. ) @@ -296,13 +284,10 @@ ;; nothing new! ) (:methods - (new (symbol type int int basic) _type_ 0) - (get-process (_type_ type int) process 14) - (return-process ( _type_ process) none 15) + (new (symbol type int int basic) _type_) + (get-process (_type_ type int) process) + (return-process ( _type_ process) none) ) - :size-assert #x20 - :method-count-assert 16 - :flag-assert #x1000000020 ) ;; A dead-pool-heap-rec is a record for a process which lives on a dead-pool-heap. @@ -310,52 +295,45 @@ ;; This is a small record that will be updated by the kernel so it always points to the process. ;; A handle can use a pointer to this type's "process" field as a fixed ppointer. (deftype dead-pool-heap-rec (structure) - ((process process :offset-assert 0) ;; the process of this record - (prev dead-pool-heap-rec :offset-assert 4) ;; next rec in the linked list - (next dead-pool-heap-rec :offset-assert 8) ;; prev. rec in the linked list + ((process process) ;; the process of this record + (prev dead-pool-heap-rec) ;; next rec in the linked list + (next dead-pool-heap-rec) ;; prev. rec in the linked list ) :pack-me ; don't worry about aligning me to 16-bytes in arrays and types. - :size-assert #xc - :method-count-assert 9 - :flag-assert #x90000000c ) ;; This is a pool of dead processes which can be dynamically sized and allocated from a common heap. ;; It doesn't quite behave like a tree, so there's some hacks related to child/brother etc. ;; Alive processes in a dead-pool-heap can be relocated and compacted to reduce heap fragmentation. (deftype dead-pool-heap (dead-pool) - ((allocated-length int32 :offset-assert #x20) ;; size of heap - (compact-time uint32 :offset-assert #x24) ;; unused... - (compact-count-targ uint32 :offset-assert #x28) ;; number of compactions requested - (compact-count uint32 :offset-assert #x2c) ;; number of compactions perfomed - (fill-percent float :offset-assert #x30) ;; unused - (first-gap dead-pool-heap-rec :offset-assert #x34) ;; the lowest process with a gap in the heap - (first-shrink dead-pool-heap-rec :offset-assert #x38) ;; the lowest process that needs shrinking - (heap kheap :inline :offset-assert 64) ;; our shared heap for processes - (alive-list dead-pool-heap-rec :inline :offset-assert 80) ;; records for processes that are alive - (last dead-pool-heap-rec :offset #x54 :offset-assert #x54) ;; overlay of (-> alive-list prev) - (dead-list dead-pool-heap-rec :inline :offset-assert 92) ;; unused records - (process-list dead-pool-heap-rec :inline :dynamic :offset-assert 104) ;; array of records + ((allocated-length int32) ;; size of heap + (compact-time uint32) ;; unused... + (compact-count-targ uint32) ;; number of compactions requested + (compact-count uint32) ;; number of compactions perfomed + (fill-percent float) ;; unused + (first-gap dead-pool-heap-rec) ;; the lowest process with a gap in the heap + (first-shrink dead-pool-heap-rec) ;; the lowest process that needs shrinking + (heap kheap :inline) ;; our shared heap for processes + (alive-list dead-pool-heap-rec :inline) ;; records for processes that are alive + (last dead-pool-heap-rec :overlay-at (-> alive-list prev)) + (dead-list dead-pool-heap-rec :inline) ;; unused records + (process-list dead-pool-heap-rec :inline :dynamic) ;; array of records ) (:methods - (new (symbol type basic int int) _type_ 0) - (compact (dead-pool-heap int) none 16) - (shrink-heap (dead-pool-heap process) dead-pool-heap 17) - (churn (dead-pool-heap int) none 18) - (memory-used (dead-pool-heap) int 19) - (memory-total (dead-pool-heap) int 20) - (gap-size (dead-pool-heap dead-pool-heap-rec) int 21) - (gap-location (dead-pool-heap dead-pool-heap-rec) pointer 22) - (find-gap (dead-pool-heap dead-pool-heap-rec) dead-pool-heap-rec 23) - (find-gap-by-size (dead-pool-heap int) dead-pool-heap-rec 24) - (memory-free (dead-pool-heap) int 25) - (compact-time (dead-pool-heap) uint 26) + (new (symbol type basic int int) _type_) + (compact (dead-pool-heap int) none) + (shrink-heap (dead-pool-heap process) dead-pool-heap) + (churn (dead-pool-heap int) none) + (memory-used (dead-pool-heap) int) + (memory-total (dead-pool-heap) int) + (gap-size (dead-pool-heap dead-pool-heap-rec) int) + (gap-location (dead-pool-heap dead-pool-heap-rec) pointer) + (find-gap (dead-pool-heap dead-pool-heap-rec) dead-pool-heap-rec) + (find-gap-by-size (dead-pool-heap int) dead-pool-heap-rec) + (memory-free (dead-pool-heap) int) + (compact-time (dead-pool-heap) uint) ) - - :size-assert #x68 - :method-count-assert #x1b - :flag-assert #x1b00000068 ) @@ -366,9 +344,6 @@ (next stack-frame :offset 8) ;; follow this to get to the root frame, away from top. ) - :size-assert #xc - :method-count-assert 9 - :flag-assert #x90000000c :no-runtime-type ;; already constructed, don't do it again. ) @@ -389,23 +364,17 @@ ) (:methods - (new (symbol type symbol function (pointer uint64)) object 0) + (new (symbol type symbol function (pointer uint64)) object) ) - :size-assert #xb0 - :method-count-assert 9 - :flag-assert #x9000000b0 ) ;; A protect frame is a frame which has a cleanup function called on exit. (deftype protect-frame (stack-frame) - ((exit (function object) :offset-assert 12)) ;; function to call to clean up + ((exit (function object))) ;; function to call to clean up (:methods (new (symbol type (function object)) protect-frame) ) - :size-assert 16 - :method-count-assert 9 - :flag-assert #x900000010 ) ;; A handle is a reference to a _specific_ process. @@ -421,10 +390,9 @@ (pid int32 :offset 32) (u64 uint64 :offset 0) ) - :flag-assert #x900000008 ) -(defmethod inspect handle ((this handle)) +(defmethod inspect ((this handle)) (format #t "[~8x] ~A~%" 'handle) (format #t "~Tprocess: #x~x~%" (-> this process)) (format #t "~Tpid: ~D~%" (-> this pid)) @@ -474,7 +442,7 @@ `(ppointer->handle (process->ppointer ,proc)) ) -(defmethod print handle ((this handle)) +(defmethod print ((this handle)) "print a handle" (if (nonzero? (-> this u64)) ;; zero-initialized handles can't be derefenced safely. (format #t "#" @@ -496,37 +464,30 @@ ;; While "state" is technically a stack frame, it's always the base stack frame, and just used for the exit ;; so if you abort out of a process, it cleans up the state too. (deftype state (protect-frame) - ((code function :offset-assert 16) - (trans (function object) :offset-assert 20) - (post function :offset-assert 24) - (enter function :offset-assert 28) - (event (function process int symbol event-message-block object) :offset-assert 32) + ((code function) + (trans (function object)) + (post function) + (enter function) + (event (function process int symbol event-message-block object)) ) (:methods (new (symbol type symbol function (function object) function (function object) - (function process int symbol event-message-block object)) _type_ 0) + (function process int symbol event-message-block object)) _type_) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; this is used for the event system to pass around parameters from one process to another. (deftype event-message-block (structure) - ((to process :offset-assert 0) - (from process :offset-assert 4) - (num-params int32 :offset-assert 8) - (message symbol :offset-assert 12) - (param uint64 7 :offset-assert 16) + ((to process) + (from process) + (num-params int32) + (message symbol) + (param uint64 7) ) - - :size-assert #x48 - :method-count-assert 9 - :flag-assert #x900000048 :always-stack-singleton ) diff --git a/goal_src/jak1/kernel/gkernel.gc b/goal_src/jak1/kernel/gkernel.gc index fa135e44b18..a78ef37098e 100644 --- a/goal_src/jak1/kernel/gkernel.gc +++ b/goal_src/jak1/kernel/gkernel.gc @@ -57,7 +57,7 @@ ;; for any references. ;; Note - the actual relocation method of process is in relocate.gc. -(defmethod relocate object ((this object) (offset int)) +(defmethod relocate ((this object) (offset int)) this ) @@ -181,7 +181,7 @@ ;; All threads are actually cpu-threads. It's not clear why there are two separate types. ;; Perhaps the thread was the public interface and cpu-thread is internal to the kernel? -(defmethod delete thread ((this thread)) +(defmethod delete ((this thread)) "Clean up a temporary thread after it is done being used. This assumes it's the top-thread of the process and restores the previous top thread." (when (eq? this (-> this process main-thread)) @@ -194,12 +194,12 @@ (none) ) -(defmethod print thread ((this thread)) +(defmethod print ((this thread)) "Print thread." (format #t "#<~A ~S of ~S pc: #x~X @ #x~X>" (-> this type) (-> this name) (-> this process name) (-> this pc) this) this) -(defmethod stack-size-set! thread ((this thread) (stack-size int)) +(defmethod stack-size-set! ((this thread) (stack-size int)) "Set the backup stack size of a thread. This should only be done on the main-thread. This should be done immediately after allocating the main-thread. Users can do this if they want a larger or smaller backup stack than the default." @@ -283,7 +283,7 @@ ) -(defmethod asize-of cpu-thread ((this cpu-thread)) +(defmethod asize-of ((this cpu-thread)) "Get the size of a cpu-thread" ;; we need this because the cpu-thread is stored in the process stack (the int (+ (-> this type size) (-> this stack-size))) @@ -412,7 +412,7 @@ ) ) -(defmethod inspect process ((this process)) +(defmethod inspect ((this process)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~S~%" (-> this name)) (format #t "~Tmask: #x~X~%" (-> this mask)) @@ -447,11 +447,11 @@ this ) -(defmethod asize-of process ((this process)) +(defmethod asize-of ((this process)) (the int (+ (-> process size) (-> this allocated-length))) ) -(defmethod print process ((this process)) +(defmethod print ((this process)) (format #t "#<~A ~S ~A :state ~S " (-> this type) (-> this name) @@ -627,7 +627,7 @@ ;; these are for resuming and suspending main threads. -(defmethod thread-suspend cpu-thread ((unused cpu-thread)) +(defmethod thread-suspend ((unused cpu-thread)) "Suspend the thread and return to the kernel." (declare (asm-func none)) @@ -742,7 +742,7 @@ ) -(defmethod thread-resume cpu-thread ((thread-to-resume cpu-thread)) +(defmethod thread-resume ((thread-to-resume cpu-thread)) "Resume a suspended thread. Call this from the kernel only. This is also used to start a thread initialized with set-to-run. As a result of MIPS/x86 differences, there is a hack for this." @@ -904,7 +904,7 @@ ) ) -(defmethod get-process dead-pool ((this dead-pool) (type-to-make type) (stack-size int)) +(defmethod get-process ((this dead-pool) (type-to-make type) (stack-size int)) "Get a process from this dead pool of the given type." (let ((proc (-> this child))) @@ -938,7 +938,7 @@ ) -(defmethod return-process dead-pool ((this dead-pool) (proc process)) +(defmethod return-process ((this dead-pool) (proc process)) "Return a process to its pool once you are done with it." (change-parent proc this) (none) @@ -1004,7 +1004,7 @@ ) ) -(defmethod gap-location dead-pool-heap ((this dead-pool-heap) (rec dead-pool-heap-rec)) +(defmethod gap-location ((this dead-pool-heap) (rec dead-pool-heap-rec)) "Get the gap after the given process. If root of the alive list is given, will give the first gap between the heap and the first process. If there is no gap, may point to the next process. Not 16-byte aligned." @@ -1019,7 +1019,7 @@ ) ) -(defmethod gap-size dead-pool-heap ((this dead-pool-heap) (rec dead-pool-heap-rec)) +(defmethod gap-size ((this dead-pool-heap) (rec dead-pool-heap-rec)) "Determine the size between the given process and the next process or end of the heap. If you give the first rec, it will given the gap between the beginning of the heap and the next process." (the int @@ -1044,7 +1044,7 @@ ) ) -(defmethod find-gap dead-pool-heap ((this dead-pool-heap) (rec dead-pool-heap-rec)) +(defmethod find-gap ((this dead-pool-heap) (rec dead-pool-heap-rec)) "Start at the given record and find the closest gap after it. Returns the rec which has the gap after it. If no gaps, returns the last rec." (while (and (-> rec next) (zero? (gap-size this rec))) @@ -1055,7 +1055,7 @@ ) -(defmethod inspect dead-pool-heap ((this dead-pool-heap)) +(defmethod inspect ((this dead-pool-heap)) "Inspect a dead-pool-heap and all of the recs and their gaps" (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) @@ -1102,12 +1102,12 @@ this) -(defmethod asize-of dead-pool-heap ((this dead-pool-heap)) +(defmethod asize-of ((this dead-pool-heap)) "Get our total size. Uses the heap top as the end." (- (the int (-> this heap top)) (the int this) *gtype-basic-offset*) ) -(defmethod memory-used dead-pool-heap ((this dead-pool-heap)) +(defmethod memory-used ((this dead-pool-heap)) "Get the amount of memory used. This includes gaps between processes." (if (-> this last) ; we have at least one process, get the not-last-gap memory @@ -1117,12 +1117,12 @@ ) ) -(defmethod memory-total dead-pool-heap ((this dead-pool-heap)) +(defmethod memory-total ((this dead-pool-heap)) "Get the total amount of memory for processes" (the int (&- (-> this heap top) (-> this heap base))) ) -(defmethod memory-free dead-pool-heap ((this dead-pool-heap)) +(defmethod memory-free ((this dead-pool-heap)) "Get the total memory free." (let ((top (-> this heap top))) (if (-> this last) @@ -1134,12 +1134,12 @@ ) ) -(defmethod compact-time dead-pool-heap ((this dead-pool-heap)) +(defmethod compact-time ((this dead-pool-heap)) "Access the compact time field." (-> this compact-time) ) -(defmethod find-gap-by-size dead-pool-heap ((this dead-pool-heap) (size int)) +(defmethod find-gap-by-size ((this dead-pool-heap) (size int)) "Find a gap which will fit at least size bytes. Returns the rec for the proc before the gap. Will return a #f rec if there's no gap big enough." ; start our search at first-gap @@ -1157,7 +1157,7 @@ ;; warn when this happens. (define-extern *vis-boot* basic) -(defmethod get-process dead-pool-heap ((this dead-pool-heap) (type-to-make type) (stack-size int)) +(defmethod get-process ((this dead-pool-heap) (type-to-make type) (stack-size int)) "Allocate a process" ;; get a record for the new process @@ -1249,7 +1249,7 @@ proc) ) -(defmethod return-process dead-pool-heap ((this dead-pool-heap) (proc process)) +(defmethod return-process ((this dead-pool-heap) (proc process)) "Return a process to a dead pool heap" ;; check we are returning to the correct pool @@ -1305,7 +1305,7 @@ ) ) -(defmethod shrink-heap dead-pool-heap ((this dead-pool-heap) (proc process)) +(defmethod shrink-heap ((this dead-pool-heap) (proc process)) "Shrink the heap of a process. This resizes the process heap to be the exact size it is currently using." (when proc @@ -1338,7 +1338,7 @@ this ) -(defmethod compact dead-pool-heap ((this dead-pool-heap) (count int)) +(defmethod compact ((this dead-pool-heap) (count int)) "Do heap compaction. The count argument tells us how much work to do. If the heap is very full we will automatically do more work than requested." @@ -1416,7 +1416,7 @@ (none) ) -(defmethod churn dead-pool-heap ((this dead-pool-heap) (count int)) +(defmethod churn ((this dead-pool-heap) (count int)) "Mess with the heap" (countdown (ii count) @@ -1545,7 +1545,7 @@ ;; Process Iterating ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod run-logic? process ((this process)) +(defmethod run-logic? ((this process)) "Return if the process should be run or not. Children of process should override this with more interesting functions" #t) @@ -2235,7 +2235,7 @@ ;; Process Control ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod activate process ((this process) (dest process-tree) (name basic) (stack-top pointer)) +(defmethod activate ((this process) (dest process-tree) (name basic) (stack-top pointer)) "Activate a process! Put it on the given active tree and set up the main thread." ;; if we got the scratchpad stack, move to the fake scratchpad. @@ -2422,7 +2422,7 @@ ;; Process Deactivation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod deactivate process-tree ((this process-tree)) +(defmethod deactivate ((this process-tree)) "Can't deactivate a process-tree" (none) ) @@ -2447,7 +2447,7 @@ (define-extern process-disconnect (function process int)) -(defmethod deactivate process ((this process)) +(defmethod deactivate ((this process)) "Deactivate a process. This returns the process to the dead pool it came from. You can use this on your own process to kill yourself and immediately return to the kernel. diff --git a/goal_src/jak1/kernel/gstate.gc b/goal_src/jak1/kernel/gstate.gc index d7aff099656..7c0f29fd8ed 100644 --- a/goal_src/jak1/kernel/gstate.gc +++ b/goal_src/jak1/kernel/gstate.gc @@ -326,7 +326,7 @@ It type checks the arguments for the entry function. child ) -(defmethod print state ((this state)) +(defmethod print ((this state)) "Print a state." (format '#t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) this diff --git a/goal_src/jak1/kernel/gstring.gc b/goal_src/jak1/kernel/gstring.gc index 8bc2009c383..f564573a10b 100644 --- a/goal_src/jak1/kernel/gstring.gc +++ b/goal_src/jak1/kernel/gstring.gc @@ -17,7 +17,7 @@ ;; String methods ;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod length string ((this string)) +(defmethod length ((this string)) "Get the length of a string. Like strlen" (let ((str-ptr (-> this data))) (while (!= 0 (-> str-ptr 0)) @@ -27,7 +27,7 @@ ) ) -(defmethod asize-of string ((this string)) +(defmethod asize-of ((this string)) "get the size in bytes of a string." (+ (-> this allocated-length) 1 (-> string size)) ) diff --git a/goal_src/jak1/kernel/pskernel.gc b/goal_src/jak1/kernel/pskernel.gc index eb08f749eeb..896f7135f96 100644 --- a/goal_src/jak1/kernel/pskernel.gc +++ b/goal_src/jak1/kernel/pskernel.gc @@ -24,24 +24,21 @@ In the PC port, all of these functions are just stubs. ;; map of the kernel's memory. (deftype lowmemmap (structure) - ((irq-info-stack uint32 :offset-assert 0) - (irq2-info-stack uint32 :offset-assert 4) - (kernel-copy-fn uint32 :offset-assert 8) - (kernel-write-fn uint32 :offset-assert 12) - (r1-save uint128 :offset-assert 16) - (last-time uint32 :offset-assert 32) - (high-time uint32 :offset-assert 36) - (dma-status uint32 :offset-assert 40) - (dma-qnext uint32 :offset-assert 44) - (dma-qwc uint32 :offset-assert 48) - (dma-tnext uint32 :offset-assert 52) - (dma-stack0 uint32 :offset-assert 56) - (dma-stack1 uint32 :offset-assert 60) - (kernel-read-fn uint32 :offset-assert 64) + ((irq-info-stack uint32) + (irq2-info-stack uint32) + (kernel-copy-fn uint32) + (kernel-write-fn uint32) + (r1-save uint128) + (last-time uint32) + (high-time uint32) + (dma-status uint32) + (dma-qnext uint32) + (dma-qwc uint32) + (dma-tnext uint32) + (dma-stack0 uint32) + (dma-stack1 uint32) + (kernel-read-fn uint32) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) (defmacro nyi-break (name) diff --git a/goal_src/jak1/levels/beach/air-h.gc b/goal_src/jak1/levels/beach/air-h.gc index 366dd45bd9c..6bf56a191b5 100644 --- a/goal_src/jak1/levels/beach/air-h.gc +++ b/goal_src/jak1/levels/beach/air-h.gc @@ -8,18 +8,15 @@ ;; DECOMP BEGINS (deftype air-box (structure) - ((vecs vector 2 :inline :offset-assert 0) - (x-pos float :offset 0) - (height-level float :offset 4) - (z-pos float :offset 8) - (cos-angle float :offset 12) - (x-length float :offset 16) - (z-length float :offset 24) - (sin-angle float :offset 28) + ((vecs vector 2 :inline) + (x-pos float :overlay-at (-> vecs 0 x)) + (height-level float :overlay-at (-> vecs 0 y)) + (z-pos float :overlay-at (-> vecs 0 z)) + (cos-angle float :overlay-at (-> vecs 0 w)) + (x-length float :offset 16) + (z-length float :offset 24) + (sin-angle float :offset 28) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) diff --git a/goal_src/jak1/levels/beach/beach-obs.gc b/goal_src/jak1/levels/beach/beach-obs.gc index cab2f119cd2..5ed356ca980 100644 --- a/goal_src/jak1/levels/beach/beach-obs.gc +++ b/goal_src/jak1/levels/beach/beach-obs.gc @@ -15,13 +15,9 @@ ) (deftype windmill-one (process-drawable) - ((root-override collide-shape-moving :offset 112) - (sound-id sound-id :offset-assert 176) + ((root collide-shape-moving :override) + (sound-id sound-id) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states windmill-one-idle ) @@ -58,7 +54,7 @@ :post rider-post ) -(defmethod init-from-entity! windmill-one ((this windmill-one) (arg0 entity-actor)) +(defmethod init-from-entity! ((this windmill-one) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -95,13 +91,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> this root-override pause-adjust-distance) 409600.0) + (set! (-> this root pause-adjust-distance) 409600.0) (process-drawable-from-entity! this arg0) (initialize-skeleton this *windmill-one-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this sound-id) (new-sound-id)) (go windmill-one-idle) (none) @@ -178,17 +174,13 @@ ) (deftype grottopole (process-drawable) - ((root-override collide-shape :offset 112) - (speed meters :offset-assert 176) - (distance meters :offset-assert 180) - (position int32 :offset-assert 184) - (max-position int32 :offset-assert 188) - (incomming-attack-id uint64 :offset-assert 192) + ((root collide-shape :override) + (speed meters) + (distance meters) + (position int32) + (max-position int32) + (incomming-attack-id uint64) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xc8 - :flag-assert #x14006000c8 (:states grottopole-idle grottopole-moving-down @@ -212,11 +204,11 @@ (set! (-> self incomming-attack-id) v1-2) (case (-> block param 1) (('uppercut) - (when (and (< (-> *target* control trans y) (+ -40960.0 (-> self root-override trans y))) + (when (and (< (-> *target* control trans y) (+ -40960.0 (-> self root trans y))) (< (-> self position) (-> self max-position)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 2) ) ) @@ -227,11 +219,11 @@ ) ) (('flop) - (when (and (< (+ -40960.0 (-> self root-override trans y)) (-> *target* control trans y)) + (when (and (< (+ -40960.0 (-> self root trans y)) (-> *target* control trans y)) (> (-> self position) 0) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) ) @@ -274,7 +266,7 @@ (set! s2-0 #t) ) (set! (-> s4-0 y) (* f28-0 arg1)) - (move-by-vector! (-> arg0 root-override) s4-0) + (move-by-vector! (-> arg0 root) s4-0) (+! f30-0 f28-0) ) (set! (-> s3-0 quad) (-> arg0 entity extra trans quad)) @@ -291,7 +283,7 @@ (defun move-grottopole-to-position ((arg0 grottopole)) (let ((a1-0 (new 'stack-no-clear 'vector))) (set-vector! a1-0 0.0 (* (-> arg0 distance) (the float (-> arg0 position))) 0.0 1.0) - (move-by-vector! (-> arg0 root-override) a1-0) + (move-by-vector! (-> arg0 root) a1-0) ) 0 (none) @@ -323,7 +315,7 @@ :post transform-post ) -(defmethod init-from-entity! grottopole ((this grottopole) (arg0 entity-actor)) +(defmethod init-from-entity! ((this grottopole) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) @@ -361,7 +353,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *grottopole-sg* '()) @@ -377,12 +369,8 @@ ) (deftype ecoventrock (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states (ecoventrock-break symbol) ecoventrock-idle @@ -552,7 +540,7 @@ :code (behavior ((arg0 symbol)) (local-vars (sv-128 symbol)) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (process-entity-status! self (entity-perm-status complete) #t) (let ((v1-2 (entity-actor-lookup (-> self entity) 'alt-actor 0))) @@ -572,10 +560,10 @@ #f #f #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to *entity-pool* ) - (let* ((s5-1 (-> self root-override trans)) + (let* ((s5-1 (-> self root trans)) (v1-14 (target-pos 0)) (f0-1 (- (-> s5-1 x) (-> v1-14 x))) (f1-2 (- (-> s5-1 z) (-> v1-14 z))) @@ -626,19 +614,18 @@ (suspend) ) ) - (let ((gp-1 - (cond - (arg0 - (the-as int #f) - ) - (else - (ambient-hint-spawn "gamcam10" (the-as vector #f) *entity-pool* 'camera) - (ppointer->handle - (process-spawn pov-camera (-> self root-override trans) *beachcam-sg* (-> self name) 0 #f '() :to self) + (let ((gp-1 (cond + (arg0 + (the-as int #f) + ) + (else + (ambient-hint-spawn "gamcam10" (the-as vector #f) *entity-pool* 'camera) + (ppointer->handle + (process-spawn pov-camera (-> self root trans) *beachcam-sg* (-> self name) 0 #f '() :to self) + ) + ) ) ) - ) - ) ) (process-drawable-birth-fuel-cell (the-as entity #f) (the-as vector #f) #f) (while (handle->process (the-as handle gp-1)) @@ -655,7 +642,7 @@ ) ) -(defmethod init-from-entity! ecoventrock ((this ecoventrock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ecoventrock) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -669,13 +656,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *ecoventrock-sg* '()) (set! (-> this link) (new 'process 'actor-link-info this)) (transform-post) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go ecoventrock-break #t) (go ecoventrock-idle) @@ -684,13 +671,9 @@ ) (deftype flying-rock (process-drawable) - ((root-override collide-shape-moving :offset 112) - (tumble quaternion :inline :offset-assert 176) + ((root collide-shape-moving :override) + (tumble quaternion :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc0 - :flag-assert #x14005000c0 (:states flying-rock-idle flying-rock-rolling @@ -714,7 +697,7 @@ ) (while (< s5-0 2) (cond - ((logtest? (-> self root-override status) (cshape-moving-flags onsurf)) + ((logtest? (-> self root status) (cshape-moving-flags onsurf)) (when (not gp-0) (+! s5-0 1) (set! f30-0 0.8) @@ -728,54 +711,40 @@ ) ) ) - (vector-float*! (-> self root-override transv) (-> self root-override transv) f30-0) - (set! (-> self root-override transv w) 1.0) + (vector-float*! (-> self root transv) (-> self root transv) f30-0) + (set! (-> self root transv w) 1.0) (if (not gp-0) - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0) - ) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 1.0)) ) - (update-transforms! (-> self root-override)) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (collide-kind background) - ) - (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble)) + (update-transforms! (-> self root)) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (collide-kind background)) + (quaternion*! (-> self root quat) (-> self root quat) (-> self tumble)) (suspend) ) ) - (while (< 2048.0 (vector-length (-> self root-override transv))) + (while (< 2048.0 (vector-length (-> self root transv))) (cond - ((logtest? (-> self root-override status) (cshape-moving-flags onsurf)) - (vector-float*! (-> self root-override transv) (-> self root-override transv) 0.8) + ((logtest? (-> self root status) (cshape-moving-flags onsurf)) + (vector-float*! (-> self root transv) (-> self root transv) 0.8) ) (else - (vector-float*! (-> self root-override transv) (-> self root-override transv) 0.99) - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0) - ) + (vector-float*! (-> self root transv) (-> self root transv) 0.99) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 1.0)) ) ) - (set! (-> self root-override transv w) 1.0) - (update-transforms! (-> self root-override)) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (collide-kind background) - ) + (set! (-> self root transv w) 1.0) + (update-transforms! (-> self root)) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (collide-kind background)) (let ((gp-2 (new 'stack-no-clear 'vector)) - (f30-1 (vector-length (-> self root-override transv))) + (f30-1 (vector-length (-> self root transv))) ) - (set-vector! gp-2 (-> self root-override transv z) 0.0 (- (-> self root-override transv x)) 1.0) + (set-vector! gp-2 (-> self root transv z) 0.0 (- (-> self root transv x)) 1.0) (vector-normalize! gp-2 1.0) (let ((f0-12 (* 0.00061035156 (seconds-per-frame) f30-1))) (quaternion-vector-angle! (-> self tumble) gp-2 (* 10430.379 f0-12)) ) ) - (quaternion*! (-> self root-override quat) (-> self tumble) (-> self root-override quat)) + (quaternion*! (-> self root quat) (-> self tumble) (-> self root quat)) (suspend) ) (go flying-rock-idle) @@ -790,11 +759,9 @@ (defstate flying-rock-idle (flying-rock) :code (behavior () - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (while (or (logtest? (-> self draw status) (draw-status was-drawn)) - (and *target* - (>= 204800.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (and *target* (>= 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) ) (suspend) ) @@ -822,10 +789,10 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set-vector! (-> self root-override scale) arg2 arg2 arg2 1.0) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-vector! (-> self root scale) arg2 arg2 arg2 1.0) (let ((s5-1 (new-stack-vector0))) (set-vector! s5-1 @@ -837,9 +804,9 @@ (vector-normalize! s5-1 1.0) (quaternion-vector-angle! (-> self tumble) s5-1 (rand-vu-float-range 0.0 1820.4445)) ) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (rand-vu-float-range 0.0 65536.0)) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (rand-vu-float-range 0.0 65536.0)) (initialize-skeleton self *kickrock-sg* '()) - (set! (-> self root-override transv quad) (-> arg1 quad)) + (set! (-> self root transv quad) (-> arg1 quad)) (go flying-rock-rolling) (none) ) @@ -851,13 +818,9 @@ ) (deftype bladeassm (process-drawable) - ((root-override collide-shape-moving :offset 112) - (angle float :offset-assert 176) + ((root collide-shape-moving :override) + (angle float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states bladeassm-idle ) @@ -888,7 +851,7 @@ 0 ) -(defmethod init-from-entity! bladeassm ((this bladeassm) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bladeassm) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -907,7 +870,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *bladeassm-sg* '()) @@ -920,24 +883,20 @@ ) (deftype flutflutegg (process-drawable) - ((root-override collide-shape-moving :offset 112) - (fall-dist meters :offset-assert 176) - (start vector :inline :offset-assert 192) - (dir vector :inline :offset-assert 208) - (pos float :offset-assert 224) - (vel float :offset-assert 228) - (wobbler wobbler :offset-assert 232) - (last-impulse-time int32 :offset-assert 236) - (incomming-attack-id uint64 :offset-assert 240) - (ambients-played int32 :offset-assert 248) - (ambient ambient-control :inline :offset-assert 256) + ((root collide-shape-moving :override) + (fall-dist meters) + (start vector :inline) + (dir vector :inline) + (pos float) + (vel float) + (wobbler wobbler) + (last-impulse-time int32) + (incomming-attack-id uint64) + (ambients-played int32) + (ambient ambient-control :inline) ) - :heap-base #xa0 - :method-count-assert 21 - :size-assert #x110 - :flag-assert #x1500a00110 (:methods - (flutflutegg-method-20 (_type_ float float float) none 20) + (flutflutegg-method-20 (_type_ float float float) none) ) (:states (flutflutegg-break symbol) @@ -958,7 +917,7 @@ :bounds (static-spherem 0 0 0 8) ) -(defmethod relocate flutflutegg ((this flutflutegg) (arg0 int)) +(defmethod relocate ((this flutflutegg) (arg0 int)) (if (nonzero? (-> this wobbler)) (&+! (-> this wobbler) arg0) ) @@ -966,7 +925,7 @@ ) ;; WARN: Function (method 20 flutflutegg) has a return type of none, but the expression builder found a return statement. -(defmethod flutflutegg-method-20 flutflutegg ((this flutflutegg) (arg0 float) (arg1 float) (arg2 float)) +(defmethod flutflutegg-method-20 ((this flutflutegg) (arg0 float) (arg1 float) (arg2 float)) (if (not (time-elapsed? (the-as time-frame (-> this last-impulse-time)) (seconds 0.5))) (return 0) ) @@ -1004,10 +963,7 @@ ) (set! (-> self incomming-attack-id) (-> block param 2)) (flutflutegg-hit-sounds) - (let ((s5-1 - (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) - ) - ) + (let ((s5-1 (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root trans)))) (set! (-> s5-1 y) 0.0) (vector-normalize! s5-1 1.0) (let ((f0-2 (vector-dot s5-1 (-> self dir))) @@ -1062,19 +1018,19 @@ ((not (time-elapsed? (-> self ambient last-ambient-time) (seconds 30))) ) ((< 0.8 f30-0) - (play-ambient (-> self ambient) "BIR-AM07" #f (-> self root-override trans)) + (play-ambient (-> self ambient) "BIR-AM07" #f (-> self root trans)) ) ((< 0.6 f30-0) - (play-ambient (-> self ambient) "BIR-AM08" #f (-> self root-override trans)) + (play-ambient (-> self ambient) "BIR-AM08" #f (-> self root trans)) ) ((< 0.4 f30-0) - (play-ambient (-> self ambient) "BIR-AM09" #f (-> self root-override trans)) + (play-ambient (-> self ambient) "BIR-AM09" #f (-> self root trans)) ) ((< 0.2 f30-0) - (play-ambient (-> self ambient) "BIR-AM12" #f (-> self root-override trans)) + (play-ambient (-> self ambient) "BIR-AM12" #f (-> self root trans)) ) (else - (play-ambient (-> self ambient) "BIR-AM13" #f (-> self root-override trans)) + (play-ambient (-> self ambient) "BIR-AM13" #f (-> self root trans)) ) ) ) @@ -1096,10 +1052,7 @@ ) (set! (-> self incomming-attack-id) (-> block param 2)) (flutflutegg-hit-sounds) - (let ((s5-1 - (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) - ) - ) + (let ((s5-1 (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root trans)))) (set! (-> s5-1 y) 0.0) (vector-normalize! s5-1 1.0) (let ((f0-2 (vector-dot s5-1 (-> self dir))) @@ -1123,11 +1076,11 @@ (let ((a1-0 (new 'stack-no-clear 'vector))) (vector-float*! a1-0 (-> self dir) (-> self pos)) (vector+! a1-0 a1-0 (-> self start)) - (move-to-point! (-> self root-override) a1-0) + (move-to-point! (-> self root) a1-0) ) - (wobbler-method-12 (-> self wobbler) (-> self root-override quat)) + (wobbler-method-12 (-> self wobbler) (-> self root quat)) (let ((a2-3 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 -18204.445))) - (quaternion*! (-> self root-override quat) (-> self root-override quat) a2-3) + (quaternion*! (-> self root quat) (-> self root quat) a2-3) ) (suspend) (when (>= (-> self pos) (-> self fall-dist)) @@ -1173,16 +1126,13 @@ ) (close-specific-task! (game-task beach-flutflut) (task-status need-reminder)) (loop - (vector-float*! (-> self root-override transv) (-> self dir) (-> self vel)) + (vector-float*! (-> self root transv) (-> self dir) (-> self vel)) (set-time! (-> self state-time)) (until v1-25 - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) - ) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) (integrate-for-enemy-with-move-to-ground! - (-> self root-override) - (-> self root-override transv) + (-> self root) + (-> self root transv) (collide-kind background) 8192.0 #f @@ -1190,13 +1140,13 @@ #f ) (move! (-> self wobbler)) - (wobbler-method-12 (-> self wobbler) (-> self root-override quat)) + (wobbler-method-12 (-> self wobbler) (-> self root quat)) (let ((a2-6 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 -18204.445))) - (quaternion*! (-> self root-override quat) (-> self root-override quat) a2-6) + (quaternion*! (-> self root quat) (-> self root quat) a2-6) ) (suspend) (set! v1-25 (and (time-elapsed? (-> self state-time) (seconds 0.5)) - (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) + (logtest? (-> self root status) (cshape-moving-flags onsurf)) ) ) ) @@ -1210,11 +1160,11 @@ (defstate flutflutegg-break (flutflutegg) :code (behavior ((arg0 symbol)) (when arg0 - (set-vector! (-> self root-override trans) -231190.94 64559.105 -1164727.5 1.0) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 -18204.445) + (set-vector! (-> self root trans) -231190.94 64559.105 -1164727.5 1.0) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 -18204.445) ) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (when (not arg0) (ja-no-eval :group! flutflutegg-crack-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -1250,8 +1200,8 @@ (suspend) ) (ja-channel-set! 1) - (set-vector! (-> self root-override trans) -231190.94 64559.105 -1164727.5 1.0) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 0.0) + (set-vector! (-> self root trans) -231190.94 64559.105 -1164727.5 1.0) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 0.0) (ja :group! flutflutegg-broke-ja :num! max) (loop (logior! (-> self mask) (process-mask sleep)) @@ -1261,7 +1211,7 @@ :post ja-post ) -(defmethod init-from-entity! flutflutegg ((this flutflutegg) (arg0 entity-actor)) +(defmethod init-from-entity! ((this flutflutegg) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -1294,14 +1244,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *flutflutegg-sg* '()) - (vector-z-quaternion! (-> this dir) (-> this root-override quat)) - (set! (-> this start quad) (-> this root-override trans quad)) + (vector-z-quaternion! (-> this dir) (-> this root quat)) + (set! (-> this start quad) (-> this root trans quad)) (set! (-> this fall-dist) 20480.0) - (set-yaw-angle-clear-roll-pitch! (-> this root-override) (+ -16384.0 (y-angle (-> this root-override)))) + (set-yaw-angle-clear-roll-pitch! (-> this root) (+ -16384.0 (y-angle (-> this root)))) (set! (-> this pos) 0.0) (set! (-> this vel) 0.0) (set! (-> this wobbler) (new 'process 'wobbler)) @@ -1316,13 +1266,9 @@ ) (deftype harvester (process-drawable) - ((root-override collide-shape :offset 112) - (alt-actor entity-actor :offset-assert 176) + ((root collide-shape :override) + (alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states harvester-idle (harvester-inflate symbol) @@ -1378,7 +1324,7 @@ :post ja-post ) -(defmethod init-from-entity! harvester ((this harvester) (arg0 entity-actor)) +(defmethod init-from-entity! ((this harvester) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) @@ -1436,7 +1382,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *harvester-sg* '()) @@ -1447,9 +1393,6 @@ (deftype beachcam (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) diff --git a/goal_src/jak1/levels/beach/beach-part.gc b/goal_src/jak1/levels/beach/beach-part.gc index 70d6cf333f1..a6db46f5feb 100644 --- a/goal_src/jak1/levels/beach/beach-part.gc +++ b/goal_src/jak1/levels/beach/beach-part.gc @@ -9,10 +9,6 @@ (deftype beach-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 (:states beach-part-grotto-1 ) diff --git a/goal_src/jak1/levels/beach/beach-rocks.gc b/goal_src/jak1/levels/beach/beach-rocks.gc index fc5383b3204..6f1b03ae34d 100644 --- a/goal_src/jak1/levels/beach/beach-rocks.gc +++ b/goal_src/jak1/levels/beach/beach-rocks.gc @@ -228,27 +228,23 @@ ) (deftype beach-rock (process-drawable) - ((root-override collide-shape-moving :offset 112) - (trigger basic :offset-assert 176) - (movie-start time-frame :offset-assert 184) - (part-falling sparticle-launch-control :offset-assert 192) - (part-landing sparticle-launch-control :offset-assert 196) - (prev-frame float :offset-assert 200) + ((root collide-shape-moving :override) + (trigger basic) + (movie-start time-frame) + (part-falling sparticle-launch-control) + (part-landing sparticle-launch-control) + (prev-frame float) ) - :heap-base #x60 - :method-count-assert 24 - :size-assert #xcc - :flag-assert #x18006000cc - (:methods - (idle () _type_ :state 20) - (loading () _type_ :state 21) - (falling () _type_ :state 22) - (fallen () _type_ :state 23) + (:state-methods + idle + loading + falling + fallen ) ) -(defmethod relocate beach-rock ((this beach-rock) (arg0 int)) +(defmethod relocate ((this beach-rock) (arg0 int)) (if (nonzero? (-> this part-falling)) (set! (-> this part-falling) (the-as sparticle-launch-control (+ (the-as int (-> this part-falling)) arg0))) ) @@ -258,7 +254,7 @@ (call-parent-method this arg0) ) -(defmethod deactivate beach-rock ((this beach-rock)) +(defmethod deactivate ((this beach-rock)) (if (nonzero? (-> this part-falling)) (kill-and-free-particles (-> this part-falling)) ) @@ -313,7 +309,7 @@ (let ((f30-0 (ja-aframe-num 0))) (when (and (< -50.0 f30-0) (< f30-0 158.0)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (spawn (-> self part) gp-0) (+! (-> gp-0 x) 122880.0) (+! (-> gp-0 z) 102400.0) @@ -425,11 +421,11 @@ (ja :group! lrocklrg-fallen-ja) (compute-alignment! (-> self align)) (let ((v1-6 (first-transform (-> self align)))) - (set! (-> self root-override trans quad) (-> self entity extra trans quad)) - (+! (-> self root-override trans y) (-> v1-6 trans y)) + (set! (-> self root trans quad) (-> self entity extra trans quad)) + (+! (-> self root trans y) (-> v1-6 trans y)) ) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (logior! (-> self mask) (process-mask sleep)) (suspend) 0 @@ -437,7 +433,7 @@ :post ja-post ) -(defmethod init-from-entity! beach-rock ((this beach-rock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this beach-rock) (arg0 entity-actor)) (set! (-> this link) (new 'process 'actor-link-info this)) (set! (-> this align) (new 'process 'align-control this)) (set! (-> this trigger) #f) @@ -475,14 +471,10 @@ (deftype lrocklrg (beach-rock) () - :heap-base #x60 - :method-count-assert 24 - :size-assert #xcc - :flag-assert #x18006000cc ) -(defmethod init-from-entity! lrocklrg ((this lrocklrg) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lrocklrg) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -501,7 +493,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lrocklrg-sg* '()) diff --git a/goal_src/jak1/levels/beach/bird-lady-beach.gc b/goal_src/jak1/levels/beach/bird-lady-beach.gc index 2cde3c5dece..9726842556b 100644 --- a/goal_src/jak1/levels/beach/bird-lady-beach.gc +++ b/goal_src/jak1/levels/beach/bird-lady-beach.gc @@ -8,13 +8,9 @@ ;; DECOMP BEGINS (deftype bird-lady-beach (process-taskable) - ((flutflut handle :offset-assert 384) - (egg handle :offset-assert 392) + ((flutflut handle) + (egg handle) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x190 - :flag-assert #x3501200190 ) @@ -44,21 +40,19 @@ ) ) -(defmethod play-anim! bird-lady-beach ((this bird-lady-beach) (arg0 symbol)) +(defmethod play-anim! ((this bird-lady-beach) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (when arg0 (set! (-> this cell-for-task) (current-task (-> this tasks))) (close-current! (-> this tasks)) (set! (-> this flutflut) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *flutflut-naked-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *flutflut-naked-sg* #f :to this)) ) (send-event (handle->process (-> this flutflut)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this flutflut)) 'blend-shape #t) (set! (-> this egg) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *flutflutegg-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *flutflutegg-sg* #f :to this)) ) (send-event (handle->process (-> this egg)) 'anim-mode 'clone-anim) ) @@ -83,15 +77,15 @@ ) ) -(defmethod get-art-elem bird-lady-beach ((this bird-lady-beach)) +(defmethod get-art-elem ((this bird-lady-beach)) (-> this draw art-group data 3) ) -(defmethod should-display? bird-lady-beach ((this bird-lady-beach)) +(defmethod should-display? ((this bird-lady-beach)) (= (current-status (-> this tasks)) (task-status need-reward-speech)) ) -(defmethod init-from-entity! bird-lady-beach ((this bird-lady-beach) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bird-lady-beach) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *bird-lady-beach-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task beach-flutflut))) (set! (-> this sound-flava) (music-flava birdlady)) diff --git a/goal_src/jak1/levels/beach/bird-lady.gc b/goal_src/jak1/levels/beach/bird-lady.gc index 574e18b500a..5666ab9bf87 100644 --- a/goal_src/jak1/levels/beach/bird-lady.gc +++ b/goal_src/jak1/levels/beach/bird-lady.gc @@ -9,10 +9,6 @@ (deftype bird-lady (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -22,10 +18,10 @@ :shadow bird-lady-shadow-mg ) -(defmethod process-taskable-method-52 bird-lady ((this bird-lady)) +(defmethod process-taskable-method-52 ((this bird-lady)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -1024.0 f0-0))) ) @@ -41,7 +37,7 @@ (none) ) -(defmethod draw-npc-shadow bird-lady ((this bird-lady)) +(defmethod draw-npc-shadow ((this bird-lady)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -64,7 +60,7 @@ (none) ) -(defmethod play-anim! bird-lady ((this bird-lady) (arg0 symbol)) +(defmethod play-anim! ((this bird-lady) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 @@ -128,33 +124,33 @@ ) ) -(defmethod get-art-elem bird-lady ((this bird-lady)) +(defmethod get-art-elem ((this bird-lady)) (-> this draw art-group data 3) ) -(defmethod process-taskable-method-43 bird-lady ((this bird-lady)) +(defmethod process-taskable-method-43 ((this bird-lady)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.66 f0-2) - (play-ambient (-> this ambient) "BIR-LO02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIR-LO02" #f (-> this root trans)) ) ((< 0.33 f0-2) - (play-ambient (-> this ambient) "BIR-LO03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIR-LO03" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "BIR-am08" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIR-am08" #f (-> this root trans)) ) ) ) ) ) -(defmethod target-above-threshold? bird-lady ((this bird-lady)) +(defmethod target-above-threshold? ((this bird-lady)) (the-as symbol (and *target* (< (-> (target-pos 0) z) -81920.0))) ) -(defmethod init-from-entity! bird-lady ((this bird-lady) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bird-lady) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *bird-lady-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task beach-flutflut))) (set! (-> this sound-flava) (music-flava birdlady)) diff --git a/goal_src/jak1/levels/beach/lurkercrab.gc b/goal_src/jak1/levels/beach/lurkercrab.gc index babf4390ddc..22f951099a0 100644 --- a/goal_src/jak1/levels/beach/lurkercrab.gc +++ b/goal_src/jak1/levels/beach/lurkercrab.gc @@ -56,12 +56,8 @@ ) (deftype lurkercrab (nav-enemy) - ((orient basic :offset-assert 400) + ((orient basic) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x194 - :flag-assert #x4c01300194 (:states lurkercrab-pushed ) @@ -73,7 +69,7 @@ :bounds (static-spherem 0 0 0 2.5) ) -(defmethod touch-handler lurkercrab ((this lurkercrab) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this lurkercrab) (arg0 process) (arg1 event-message-block)) (if (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) @@ -96,7 +92,7 @@ ) ) -(defmethod attack-handler lurkercrab ((this lurkercrab) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this lurkercrab) (arg0 process) (arg1 event-message-block)) (let ((s5-0 (-> this incomming-attack-id))) (set! (-> this incomming-attack-id) (the-as handle (-> arg1 param 2))) (let ((v1-1 (-> arg1 param 1))) @@ -155,7 +151,7 @@ nav-enemy-default-event-handler -(defmethod nav-enemy-method-37 lurkercrab ((this lurkercrab)) +(defmethod nav-enemy-method-37 ((this lurkercrab)) (when (-> this orient) (if (logtest? (nav-control-flags navcf19) (-> this nav flags)) (seek-to-point-toward-point! @@ -183,7 +179,7 @@ nav-enemy-default-event-handler (none) ) -(defmethod nav-enemy-method-38 lurkercrab ((this lurkercrab)) +(defmethod nav-enemy-method-38 ((this lurkercrab)) (integrate-for-enemy-with-move-to-ground! (-> this collide-info) (-> this collide-info transv) @@ -525,7 +521,7 @@ nav-enemy-default-event-handler ) ) -(defmethod init-from-entity! lurkercrab ((this lurkercrab) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lurkercrab) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) diff --git a/goal_src/jak1/levels/beach/lurkerpuppy.gc b/goal_src/jak1/levels/beach/lurkerpuppy.gc index c9e4d055212..d3b432a1276 100644 --- a/goal_src/jak1/levels/beach/lurkerpuppy.gc +++ b/goal_src/jak1/levels/beach/lurkerpuppy.gc @@ -9,10 +9,6 @@ (deftype lurkerpuppy (nav-enemy) () - :heap-base #x120 - :method-count-assert 76 - :size-assert #x190 - :flag-assert #x4c01200190 ) @@ -235,7 +231,7 @@ nav-enemy-default-event-handler ) ) -(defmethod initialize-collision lurkerpuppy ((this lurkerpuppy)) +(defmethod initialize-collision ((this lurkerpuppy)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -258,7 +254,7 @@ nav-enemy-default-event-handler (none) ) -(defmethod nav-enemy-method-48 lurkerpuppy ((this lurkerpuppy)) +(defmethod nav-enemy-method-48 ((this lurkerpuppy)) (initialize-skeleton this *lurkerpuppy-sg* '()) (init-defaults! this *lurkerpuppy-nav-enemy-info*) (when (nonzero? (-> this neck)) diff --git a/goal_src/jak1/levels/beach/lurkerworm.gc b/goal_src/jak1/levels/beach/lurkerworm.gc index b416a2b5589..13b1f899470 100644 --- a/goal_src/jak1/levels/beach/lurkerworm.gc +++ b/goal_src/jak1/levels/beach/lurkerworm.gc @@ -8,21 +8,17 @@ ;; DECOMP BEGINS (deftype lurkerworm (process-drawable) - ((root-override collide-shape-moving :offset 112) - (twister twister :offset-assert 176) - (head-tilt float :offset-assert 180) - (strike-count int32 :offset-assert 184) - (angle float :offset-assert 188) - (vulnerable symbol :offset-assert 192) - (part2 sparticle-launch-control :offset-assert 196) + ((root collide-shape-moving :override) + (twister twister) + (head-tilt float) + (strike-count int32) + (angle float) + (vulnerable symbol) + (part2 sparticle-launch-control) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16006000c8 (:methods - (lurkerworm-method-20 (_type_) none 20) - (particle-effect (_type_) none 21) + (lurkerworm-method-20 (_type_) none) + (particle-effect (_type_) none) ) (:states lurkerworm-die @@ -36,7 +32,7 @@ ) -(defmethod relocate lurkerworm ((this lurkerworm) (arg0 int)) +(defmethod relocate ((this lurkerworm) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -46,7 +42,7 @@ (the-as lurkerworm ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate lurkerworm ((this lurkerworm)) +(defmethod deactivate ((this lurkerworm)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -201,9 +197,9 @@ :init-specs ((:fade-a -0.10666667)) ) -(defmethod lurkerworm-method-20 lurkerworm ((this lurkerworm)) +(defmethod lurkerworm-method-20 ((this lurkerworm)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (target-pos 0) (-> this root-override trans)) + (vector-! s5-0 (target-pos 0) (-> this root trans)) (set-target! (-> this twister) (atan (-> s5-0 x) (-> s5-0 z))) (twister-method-11 (-> this twister)) (let* ((f0-5 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z))))) @@ -237,7 +233,7 @@ (none) ) -(defmethod particle-effect lurkerworm ((this lurkerworm)) +(defmethod particle-effect ((this lurkerworm)) (let ((a2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 5)))) (launch-particles (-> *part-id-table* 661) a2-0) ) @@ -263,7 +259,7 @@ (('touch) (if ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) @@ -293,7 +289,7 @@ lurkerworm-default-post-behavior (loop (if (and (time-elapsed? (-> self state-time) (seconds 1)) *target* - (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (go lurkerworm-spot) ) @@ -312,10 +308,10 @@ lurkerworm-default-post-behavior :code (behavior () (set! (-> self part local-clock) 0) (loop - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (particle-effect self) (when (time-elapsed? (-> self state-time) (seconds 1)) - (if (and *target* (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and *target* (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (go lurkerworm-rise) (go lurkerworm-idle) ) @@ -335,7 +331,7 @@ lurkerworm-default-post-behavior (ja-channel-set! 1) (ja-no-eval :group! lurkerworm-rise-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (particle-effect self) (suspend) (ja :num! (seek!)) @@ -372,13 +368,13 @@ lurkerworm-default-post-behavior (particle-effect self) (when gp-1 (let* ((f0-13 - (- 1.0 (* 0.00009765625 - (+ -16384.0 (if *target* - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - 4096000.0 - ) - ) - ) + (- 1.0 + (* 0.00009765625 (+ -16384.0 (if *target* + (vector-vector-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + ) + ) ) ) (f30-2 (* 0.2 f0-13)) @@ -434,7 +430,7 @@ lurkerworm-default-post-behavior :code (behavior () (ja-no-eval :group! lurkerworm-sink-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (spawn (-> self part2) (-> self root-override trans)) + (spawn (-> self part2) (-> self root trans)) (particle-effect self) (suspend) (ja :num! (seek!)) @@ -448,7 +444,7 @@ lurkerworm-default-post-behavior :event process-drawable-death-event-handler :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (let ((v1-3 (-> self root-override root-prim))) + (let ((v1-3 (-> self root root-prim))) (set! (-> v1-3 collide-with) (collide-kind)) (set! (-> v1-3 prim-core collide-as) (collide-kind)) ) @@ -463,7 +459,7 @@ lurkerworm-default-post-behavior :post lurkerworm-default-post-behavior ) -(defmethod init-from-entity! lurkerworm ((this lurkerworm) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lurkerworm) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -533,7 +529,7 @@ lurkerworm-default-post-behavior ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lurkerworm-sg* '()) @@ -549,8 +545,8 @@ lurkerworm-default-post-behavior (set! (-> this head-tilt) 0.0) (set! (-> this skel prebind-function) lurkerworm-prebind-function) (set! (-> this skel postbind-function) lurkerworm-joint-callback) - (set! (-> this root-override nav-radius) 12288.0) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this root nav-radius) 12288.0) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (go lurkerworm-idle) (none) ) diff --git a/goal_src/jak1/levels/beach/mayor.gc b/goal_src/jak1/levels/beach/mayor.gc index d91caa3cce5..330ae6ac114 100644 --- a/goal_src/jak1/levels/beach/mayor.gc +++ b/goal_src/jak1/levels/beach/mayor.gc @@ -9,10 +9,6 @@ (deftype mayor (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -22,10 +18,10 @@ :shadow mayor-shadow-mg ) -(defmethod process-taskable-method-52 mayor ((this mayor)) +(defmethod process-taskable-method-52 ((this mayor)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) ) @@ -38,7 +34,7 @@ (none) ) -(defmethod draw-npc-shadow mayor ((this mayor)) +(defmethod draw-npc-shadow ((this mayor)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -76,7 +72,7 @@ ) ) -(defmethod play-anim! mayor ((this mayor) (arg0 symbol)) +(defmethod play-anim! ((this mayor) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -637,58 +633,58 @@ ) ) -(defmethod get-art-elem mayor ((this mayor)) +(defmethod get-art-elem ((this mayor)) (-> this draw art-group data 3) ) -(defmethod should-display? mayor ((this mayor)) +(defmethod should-display? ((this mayor)) (if *target* - (< (- (-> (target-pos 0) z) (-> this root-override trans z)) 57344.0) - (< (- (-> (camera-pos) z) (-> this root-override trans z)) 57344.0) + (< (- (-> (target-pos 0) z) (-> this root trans z)) 57344.0) + (< (- (-> (camera-pos) z) (-> this root trans z)) 57344.0) ) ) -(defmethod process-taskable-method-43 mayor ((this mayor)) +(defmethod process-taskable-method-43 ((this mayor)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8888889 f0-2) (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> this ambient) "CHI-LO01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-LO01" #f (-> this root trans)) ) ) ((< 0.7777778 f0-2) (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> this ambient) "CHI-LO02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-LO02" #f (-> this root trans)) ) ) ((< 0.6666667 f0-2) (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> this ambient) "CHI-AM07" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM07" #f (-> this root trans)) ) ) ((< 0.5555556 f0-2) - (play-ambient (-> this ambient) "CHI-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM06" #f (-> this root trans)) ) ((< 0.44444445 f0-2) - (play-ambient (-> this ambient) "CHI-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM05" #f (-> this root trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> this ambient) "CHI-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM04" #f (-> this root trans)) ) ((< 0.22222222 f0-2) (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> this ambient) "CHI-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM03" #f (-> this root trans)) ) ) ((< 0.11111111 f0-2) (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> this ambient) "CHI-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM02" #f (-> this root trans)) ) ) (else (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> this ambient) "CHI-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM01" #f (-> this root trans)) ) ) ) @@ -710,11 +706,11 @@ ((the-as (function none) t9-0)) ) ) - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) ) ) -(defmethod init-from-entity! mayor ((this mayor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mayor) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *mayor-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) (set! (-> this bounce-away) #f) (set! (-> this tasks) (get-task-control (game-task jungle-lurkerm))) diff --git a/goal_src/jak1/levels/beach/pelican.gc b/goal_src/jak1/levels/beach/pelican.gc index c38245c3b47..936eeefa9c0 100644 --- a/goal_src/jak1/levels/beach/pelican.gc +++ b/goal_src/jak1/levels/beach/pelican.gc @@ -8,20 +8,17 @@ ;; DECOMP BEGINS (deftype pelican-bank (basic) - ((circle-speed meters :offset-assert 4) - (dive-time seconds :offset-assert 8) - (to-nest0-time seconds :offset-assert 16) - (to-nest1-time seconds :offset-assert 24) - (land-time seconds :offset-assert 32) - (from-nest-time seconds :offset-assert 40) - (spit-time seconds :offset-assert 48) - (pre-spit-wait-time seconds :offset-assert 56) - (post-spit-wait-time seconds :offset-assert 64) - (run-away-time seconds :offset-assert 72) + ((circle-speed meters) + (dive-time seconds) + (to-nest0-time seconds) + (to-nest1-time seconds) + (land-time seconds) + (from-nest-time seconds) + (spit-time seconds) + (pre-spit-wait-time seconds) + (post-spit-wait-time seconds) + (run-away-time seconds) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) @@ -40,35 +37,31 @@ ) (deftype pelican (process-drawable) - ((root-override collide-shape-moving :offset 112) - (query gui-query :inline :offset-assert 176) - (fuel-cell handle :offset-assert 208) - (cam-tracker handle :offset-assert 216) - (path-data curve-control 8 :offset-assert 224) - (path-circle curve-control :offset 224) - (path-dive0 curve-control :offset 228) - (path-to-nest0 curve-control :offset 232) - (path-from-nest0 curve-control :offset 236) - (path-spit0 curve-control :offset 240) - (path-dive1 curve-control :offset 244) - (path-to-nest1 curve-control :offset 248) - (path-to-nest2 curve-control :offset 252) - (path-cache curve-control :offset-assert 256) - (time-cache time-frame :offset-assert 264) - (path-pos float :offset-assert 272) - (path-speed float :offset-assert 276) - (path-max float :offset-assert 280) - (path-vector vector :inline :offset-assert 288) - (state-vector vector :inline :offset-assert 304) - (state-vector1 vector :inline :offset-assert 320) - (state-float float 2 :offset-assert 336) - (state-object symbol :offset-assert 344) - (neck joint-mod :offset-assert 348) + ((root collide-shape-moving :override) + (query gui-query :inline) + (fuel-cell handle) + (cam-tracker handle) + (path-data curve-control 8) + (path-circle curve-control :overlay-at (-> path-data 0)) + (path-dive0 curve-control :overlay-at (-> path-data 1)) + (path-to-nest0 curve-control :overlay-at (-> path-data 2)) + (path-from-nest0 curve-control :overlay-at (-> path-data 3)) + (path-spit0 curve-control :overlay-at (-> path-data 4)) + (path-dive1 curve-control :overlay-at (-> path-data 5)) + (path-to-nest1 curve-control :overlay-at (-> path-data 6)) + (path-to-nest2 curve-control :overlay-at (-> path-data 7)) + (path-cache curve-control) + (time-cache time-frame) + (path-pos float) + (path-speed float) + (path-max float) + (path-vector vector :inline) + (state-vector vector :inline) + (state-vector1 vector :inline) + (state-float float 2) + (state-object symbol) + (neck joint-mod) ) - :heap-base #xf0 - :method-count-assert 20 - :size-assert #x160 - :flag-assert #x1400f00160 (:states pelican-circle (pelican-dive path-control curve-control time-frame) @@ -83,7 +76,7 @@ ) -(defmethod relocate pelican ((this pelican) (arg0 int)) +(defmethod relocate ((this pelican) (arg0 int)) (countdown (v1-0 8) (if (nonzero? (-> this path-data v1-0)) (&+! (-> this path-data v1-0) arg0) @@ -113,12 +106,12 @@ ) (eval-path-curve-div! (-> self path) s3-0 f30-0 'interp) (+! (-> s3-0 y) (-> self align align trans y)) - (move-to-point! (-> self root-override) s3-0) + (move-to-point! (-> self root) s3-0) (path-control-method-12 (-> self path) s3-0 f30-0) ) (if arg4 - (set-heading-vec-clear-roll-pitch! (-> self root-override) s3-0) - (seek-toward-heading-vec! (-> self root-override) s3-0 arg0 (the-as time-frame arg1)) + (set-heading-vec-clear-roll-pitch! (-> self root) s3-0) + (seek-toward-heading-vec! (-> self root) s3-0 arg0 (the-as time-frame arg1)) ) ) ) @@ -191,7 +184,7 @@ (('position) (set! (-> self path-pos) (the-as float (-> block param 0))) (let ((a1-3 (path-control-method-12 (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos)))) - (set-heading-vec! (-> self root-override) a1-3) + (set-heading-vec! (-> self root) a1-3) ) ) ) @@ -225,7 +218,7 @@ (set! (-> self path-speed) (/ (* (-> *PELICAN-bank* circle-speed) (-> self path-max)) (path-distance (-> self path))) ) - (set-roll-to-grav-2! (-> self root-override) -2730.6667) + (set-roll-to-grav-2! (-> self root) -2730.6667) ) :trans (behavior () (pelican-path-update 728177.75 30 1.0 (/ (-> self path-max) (path-distance (-> self path))) #f) @@ -321,7 +314,7 @@ (init! (-> self query) (the-as string #f) 40 150 25 #t (the-as string #f)) (set! (-> self state-object) #f) (set-time! (-> self state-time)) - (set-roll-to-grav-2! (-> self root-override) 0.0) + (set-roll-to-grav-2! (-> self root) 0.0) (let ((a0-4 (handle->process (-> self fuel-cell)))) (cond (a0-4 @@ -339,7 +332,7 @@ (set! (-> self path-speed) (/ (* 300.0 (-> self path-max)) (the float (-> *PELICAN-bank* dive-time)))) (let ((gp-1 (new 'stack-no-clear 'vector))) (path-control-method-12 (-> self path) gp-1 (-> self path-pos)) - (set-heading-vec! (-> self root-override) gp-1) + (set-heading-vec! (-> self root) gp-1) ) (set! (-> self draw force-lod) 0) 0 @@ -421,7 +414,7 @@ (('explode) (let ((a0-2 (handle->process (-> self fuel-cell)))) (if a0-2 - (send-event a0-2 'trans (-> self root-override trans)) + (send-event a0-2 'trans (-> self root trans)) ) ) (go pelican-explode #f) @@ -434,7 +427,7 @@ ) ) (f30-0 8192.0) - (gp-1 (-> self root-override)) + (gp-1 (-> self root)) (s4-0 (-> (the-as process-drawable v1-13) root trans)) ) (if (< f30-0 @@ -449,14 +442,7 @@ ) ) (('touch) - (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> block param 0)) - 0.7 - 6144.0 - 16384.0 - ) + (send-shove-back (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) ) ) ) @@ -467,15 +453,14 @@ (set! (-> self path-speed) (/ (* 300.0 (-> self path-max)) (the float (-> *PELICAN-bank* from-nest-time)))) (let ((s5-0 (-> self state-vector))) (eval-path-curve-div! (-> self path) s5-0 (-> self path-pos) 'interp) - (set! (-> self state-float 0) (/ (* 300.0 (vector-vector-distance (-> self root-override trans) s5-0)) - (the float (-> *PELICAN-bank* land-time)) - ) + (set! (-> self state-float 0) + (/ (* 300.0 (vector-vector-distance (-> self root trans) s5-0)) (the float (-> *PELICAN-bank* land-time))) ) ) (path-control-method-12 (-> self path) (-> self path-vector) (-> self path-pos)) (when arg0 - (move-to-point! (-> self root-override) (-> self state-vector)) - (set-heading-vec! (-> self root-override) (-> self path-vector)) + (move-to-point! (-> self root) (-> self state-vector)) + (set-heading-vec! (-> self root) (-> self path-vector)) (let ((a0-7 (handle->process (-> self fuel-cell)))) (if a0-7 (send-event a0-7 'draw #f) @@ -500,12 +485,12 @@ (let ((a1-0 (-> self state-vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (vector-seek! gp-0 a1-0 (* (-> self state-float 0) (seconds-per-frame))) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) - (do-push-aways! (-> self root-override)) - (seek-toward-heading-vec! (-> self root-override) (-> self path-vector) 131072.0 (seconds 1)) + (do-push-aways! (-> self root)) + (seek-toward-heading-vec! (-> self root) (-> self path-vector) 131072.0 (seconds 1)) (spool-push *art-control* "pelican-spit-ext" 0 self -99.0) ) :code (behavior ((arg0 symbol)) @@ -522,7 +507,7 @@ (suspend) (ja :num! (seek!)) ) - (until (vector= (-> self root-override trans) (-> self state-vector)) + (until (vector= (-> self root trans) (-> self state-vector)) (suspend) (ja :num! (loop!)) ) @@ -550,7 +535,7 @@ :post (behavior () (when *target* (if *target* - (look-at-enemy! (-> *target* neck) (the-as vector (-> self root-override root-prim prim-core)) 'nothing self) + (look-at-enemy! (-> *target* neck) (the-as vector (-> self root root-prim prim-core)) 'nothing self) ) (if (nonzero? (-> self neck)) (set-target! (-> self neck) (target-pos 5)) @@ -583,7 +568,7 @@ ) (s5-2 (new 'stack-no-clear 'quaternion)) ) - (quaternion-copy! s5-2 (-> self root-override quat)) + (quaternion-copy! s5-2 (-> self root quat)) (until v1-21 (suspend) (set! v1-21 (or (not *target*) (process-grab? *target*))) @@ -610,7 +595,7 @@ (if (handle->process s4-0) (deactivate (-> s4-0 process 0)) ) - (quaternion-copy! (-> self root-override quat) s5-2) + (quaternion-copy! (-> self root quat) s5-2) ) ) (process-spawn-function @@ -652,7 +637,7 @@ ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (or (= arg2 'touch) (= arg2 'attack)) (let ((v1-7 (birth-pickup-at-point - (-> self root-override trans) + (-> self root trans) (pickup-type fuel-cell) (the float (-> self entity extra perm task)) #f @@ -676,7 +661,7 @@ ) :post (behavior () (if (not (ja-group? pelican-sleep-ja)) - (quaternion-identity! (-> self root-override quat)) + (quaternion-identity! (-> self root quat)) ) (pelican-post) ) @@ -714,11 +699,11 @@ (set! (-> self path-pos) 0.0) (set! (-> self path-max) (the float (+ (-> self path curve num-cverts) -1))) (set! (-> self path-speed) (/ (* 300.0 (-> self path-max)) (the float arg1))) - (set! (-> self state-vector quad) (-> self root-override trans quad)) + (set! (-> self state-vector quad) (-> self root trans quad)) (set! (-> self state-float 0) 0.0) (let ((gp-1 (new 'stack-no-clear 'vector))) (eval-path-curve-div! (-> self path) gp-1 0.0 'interp) - (set! (-> self state-float 1) (* 0.0073242188 (vector-vector-distance (-> self root-override trans) gp-1))) + (set! (-> self state-float 1) (* 0.0073242188 (vector-vector-distance (-> self root trans) gp-1))) ) ) :trans (behavior () @@ -729,12 +714,7 @@ ) (when (not (time-elapsed? (-> self state-time) (the int (-> self state-float 1)))) (set! (-> self state-float 0) (/ (the float (- (current-time) (-> self state-time))) (-> self state-float 1))) - (vector-lerp! - (-> self root-override trans) - (-> self state-vector) - (-> self root-override trans) - (-> self state-float 0) - ) + (vector-lerp! (-> self root trans) (-> self state-vector) (-> self root trans) (-> self state-float 0)) ) ) :code (behavior ((arg0 path-control) (arg1 time-frame)) @@ -772,12 +752,12 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) ) (let ((gp-2 (new-stack-vector0))) - (set! (-> gp-2 quad) (-> self root-override trans quad)) + (set! (-> gp-2 quad) (-> self root trans quad)) (let ((a0-7 (handle->process (-> self fuel-cell)))) (when a0-7 (set! (-> gp-2 quad) (-> (the-as process-drawable a0-7) root trans quad)) @@ -800,14 +780,14 @@ ) ) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-channel-set! 0) (anim-loop) ) :post ja-post ) -(defmethod init-from-entity! pelican ((this pelican) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pelican) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -825,7 +805,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *pelican-sg* '()) @@ -857,14 +837,9 @@ (go pelican-wait-at-nest #t) ) ((2) - (let ((s5-2 (manipy-spawn - (-> this root-override trans) - (-> this entity) - *fuel-cell-sg* - (new 'static 'vector :w 4915.2) - :to this - ) - ) + (let ((s5-2 + (manipy-spawn (-> this root trans) (-> this entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to this) + ) ) (set! (-> this fuel-cell) (if s5-2 (ppointer->handle s5-2) diff --git a/goal_src/jak1/levels/beach/sculptor.gc b/goal_src/jak1/levels/beach/sculptor.gc index 3a9a37d923b..55f8f318a2a 100644 --- a/goal_src/jak1/levels/beach/sculptor.gc +++ b/goal_src/jak1/levels/beach/sculptor.gc @@ -9,12 +9,8 @@ ;; DECOMP BEGINS (deftype sculptor (process-taskable) - ((muse handle :offset-assert 384) + ((muse handle) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x188 - :flag-assert #x3501200188 ) @@ -29,10 +25,10 @@ :shadow sculptor-shadow-mg ) -(defmethod process-taskable-method-52 sculptor ((this sculptor)) +(defmethod process-taskable-method-52 ((this sculptor)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) ) @@ -45,7 +41,7 @@ (none) ) -(defmethod draw-npc-shadow sculptor ((this sculptor)) +(defmethod draw-npc-shadow ((this sculptor)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -92,7 +88,7 @@ ) ) -(defmethod play-anim! sculptor ((this sculptor) (arg0 symbol)) +(defmethod play-anim! ((this sculptor) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 @@ -131,9 +127,7 @@ (set! (-> this cell-for-task) (current-task (-> this tasks))) (close-current! (-> this tasks)) (set! (-> this muse) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *sculptor-muse-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *sculptor-muse-sg* #f :to this)) ) (let ((v1-18 (handle->process (-> this muse)))) (if v1-18 @@ -164,7 +158,7 @@ ) ) -(defmethod get-art-elem sculptor ((this sculptor)) +(defmethod get-art-elem ((this sculptor)) (case (current-status (-> this tasks)) (((task-status invalid) (task-status need-resolution)) (-> this draw art-group data 11) @@ -175,30 +169,30 @@ ) ) -(defmethod process-taskable-method-43 sculptor ((this sculptor)) +(defmethod process-taskable-method-43 ((this sculptor)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) - (play-ambient (-> this ambient) "SCU-LO01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-LO01" #f (-> this root trans)) ) ((< 0.71428573 f0-2) - (play-ambient (-> this ambient) "SCU-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-AM05" #f (-> this root trans)) ) ((< 0.5714286 f0-2) - (play-ambient (-> this ambient) "SCU-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-AM06" #f (-> this root trans)) ) ((< 0.42857143 f0-2) - (play-ambient (-> this ambient) "SCU-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-AM03" #f (-> this root trans)) ) ((< 0.2857143 f0-2) - (play-ambient (-> this ambient) "SCU-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-AM04" #f (-> this root trans)) ) ((< 0.14285715 f0-2) - (play-ambient (-> this ambient) "SCU-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-AM01" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "SCU-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-AM02" #f (-> this root trans)) ) ) ) @@ -345,7 +339,7 @@ ) ) -(defmethod init-from-entity! sculptor ((this sculptor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sculptor) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sculptor-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task misty-muse))) (set! (-> this muse) (the-as handle #f)) diff --git a/goal_src/jak1/levels/beach/seagull.gc b/goal_src/jak1/levels/beach/seagull.gc index 8c437a070f4..703572b3b68 100644 --- a/goal_src/jak1/levels/beach/seagull.gc +++ b/goal_src/jak1/levels/beach/seagull.gc @@ -36,34 +36,30 @@ (define sound-seagull-squall (static-sound-spec "seagulls-2")) (deftype seagull (process-drawable) - ((root-override collide-shape-moving :offset 112) - (index int32 :offset-assert 176) - (flock (pointer seagullflock) :offset-assert 180) - (heading float :offset-assert 184) - (tilt float :offset-assert 188) - (max-tilt float :offset-assert 192) - (angletan float :offset-assert 196) - (target-dist float :offset-assert 200) - (scared int32 :offset-assert 204) - (temp-heading float :offset-assert 208) - (temp-heading-time int32 :offset-assert 212) - (part-time time-frame :offset-assert 216) - (thrust float :offset-assert 224) - (teleport symbol :offset-assert 228) + ((root collide-shape-moving :override) + (index int32) + (flock (pointer seagullflock)) + (heading float) + (tilt float) + (max-tilt float) + (angletan float) + (target-dist float) + (scared int32) + (temp-heading float) + (temp-heading-time int32) + (part-time time-frame) + (thrust float) + (teleport symbol) ) - :heap-base #x80 - :method-count-assert 28 - :size-assert #xe8 - :flag-assert #x1c008000e8 (:methods - (move-vertically! (_type_ symbol) none 20) - (adjust-heading-around-point-slow! (_type_ float) none 21) - (seagull-method-22 (_type_) none 22) - (adjust-heading-around-point! (_type_ float) none 23) - (seagull-method-24 (_type_) none 24) - (seagull-method-25 (_type_ float) none 25) - (seagull-method-26 (_type_) symbol 26) - (seagull-method-27 (_type_) none 27) + (move-vertically! (_type_ symbol) none) + (adjust-heading-around-point-slow! (_type_ float) none) + (seagull-method-22 (_type_) none) + (adjust-heading-around-point! (_type_ float) none) + (seagull-method-24 (_type_) none) + (seagull-method-25 (_type_ float) none) + (seagull-method-26 (_type_) symbol) + (seagull-method-27 (_type_) none) ) (:states seagull-flying @@ -76,31 +72,27 @@ (deftype seagullflock (process) - ((self-override seagullflock :offset 28) - (path path-control :offset-assert 112) - (trans vector :inline :offset-assert 128) - (bird (pointer seagull) 64 :offset-assert 144) - (birds int32 :offset-assert 400) - (link actor-link-info :offset-assert 404) - (bird-at-waterfall uint64 :offset-assert 408) - (birds-at-waterfall int32 :offset-assert 416) - (target vector :inline :offset-assert 432) - (targetnum int32 :offset-assert 448) - (alert-time time-frame :offset-assert 456) - (teleport-frames int32 :offset-assert 464) - (cam-tracker uint64 :offset-assert 472) - (state-time time-frame :offset-assert 480) - (squall ambient-sound :offset-assert 488) - (max-lift float :offset-assert 492) + ((self-override seagullflock :overlay-at self) + (path path-control) + (trans vector :inline) + (bird (pointer seagull) SEAGULLFLOCK_MAX) + (birds int32) + (link actor-link-info) + (bird-at-waterfall uint64) + (birds-at-waterfall int32) + (target vector :inline) + (targetnum int32) + (alert-time time-frame) + (teleport-frames int32) + (cam-tracker uint64) + (state-time time-frame) + (squall ambient-sound) + (max-lift float) ) - :heap-base #x180 - :method-count-assert 17 - :size-assert #x1f0 - :flag-assert #x11018001f0 (:methods - (spawn-bird (_type_ vector) (pointer process) 14) - (play-hint (_type_ int) none 15) - (seagullflock-method-16 (_type_ seagull) float 16) + (spawn-bird (_type_ vector) (pointer process)) + (play-hint (_type_ int) none) + (seagullflock-method-16 (_type_ seagull) float) ) (:states seagullflock-at-waterfall @@ -109,7 +101,7 @@ ) -(defmethod relocate seagullflock ((this seagullflock) (arg0 int)) +(defmethod relocate ((this seagullflock) (arg0 int)) (if (nonzero? (-> this path)) (&+! (-> this path) arg0) ) @@ -122,7 +114,7 @@ (the-as seagullflock ((method-of-type process relocate) this arg0)) ) -(defmethod deactivate seagullflock ((this seagullflock)) +(defmethod deactivate ((this seagullflock)) (if (nonzero? (-> this squall)) (stop! (-> this squall)) ) @@ -190,7 +182,7 @@ :bounds (static-spherem 0 0 0 2) ) -(defmethod seagull-method-25 seagull ((this seagull) (arg0 float)) +(defmethod seagull-method-25 ((this seagull) (arg0 float)) (let ((f1-1 (the float (sar (shl (the int (- arg0 (-> this heading))) 48) 48))) (f0-5 (- (-> this tilt))) ) @@ -224,9 +216,9 @@ (none) ) -(defmethod seagull-method-24 seagull ((this seagull)) +(defmethod seagull-method-24 ((this seagull)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (-> this flock 0 target) (-> this root-override trans)) + (vector-! s5-0 (-> this flock 0 target) (-> this root trans)) (when (< (vector-dot s5-0 s5-0) 6710886400.0) (let ((v1-5 (ash 1 (-> this index)))) (when (not (logtest? v1-5 (-> this flock 0 bird-at-waterfall))) @@ -321,7 +313,7 @@ ) (quaternion-axis-angle! s5-0 0.0 0.0 1.0 (-> self tilt)) (quaternion-axis-angle! gp-0 0.0 1.0 0.0 (-> self heading)) - (quaternion*! (-> self root-override quat) gp-0 s5-0) + (quaternion*! (-> self root quat) gp-0 s5-0) ) (transform-post) 0 @@ -350,12 +342,12 @@ (when (nonzero? (-> self scared)) (+! (-> self scared) -1) (when (zero? (-> self scared)) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (go seagull-takeoff) ) ) (when *target* - (let ((v1-12 (vector-! (new 'stack-no-clear 'vector) (-> *target* control trans) (-> self root-override trans)))) + (let ((v1-12 (vector-! (new 'stack-no-clear 'vector) (-> *target* control trans) (-> self root trans)))) (when (< (vector-dot v1-12 v1-12) 1677721600.0) (let ((v1-14 (-> self flock))) (play-hint @@ -370,10 +362,10 @@ ) ) :code (behavior () - (+! (-> self root-override trans y) 20480.0) - (move-to-ground (-> self root-override) 40960.0 40960.0 #t (collide-kind background)) - (update-transforms! (-> self root-override)) - (clear-collide-with-as (-> self root-override)) + (+! (-> self root trans y) 20480.0) + (move-to-ground (-> self root) 40960.0 40960.0 #t (collide-kind background)) + (update-transforms! (-> self root)) + (clear-collide-with-as (-> self root)) (ja :group! seagull-idle-ja :num! (identity (ja-aframe 0.0 0))) (loop (let* ((f30-0 4.0) @@ -454,8 +446,8 @@ :post seagull-post ) -(defmethod move-vertically! seagull ((this seagull) (arg0 symbol)) - (let ((f0-0 (-> this root-override transv y))) +(defmethod move-vertically! ((this seagull) (arg0 symbol)) + (let ((f0-0 (-> this root transv y))) (set! f0-0 (cond (arg0 (if (< f0-0 (-> this flock 0 max-lift)) @@ -469,13 +461,13 @@ ) ) ;; og:preserve-this changed for high fps - (set! (-> this root-override transv y) (* DISPLAY_FPS_RATIO f0-0)) + (set! (-> this root transv y) (* DISPLAY_FPS_RATIO f0-0)) ) 0 (none) ) -(defmethod seagull-method-26 seagull ((this seagull)) +(defmethod seagull-method-26 ((this seagull)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((f30-0 -4096.0) (f28-0 8192.0) @@ -492,45 +484,45 @@ ) (set! (-> s5-0 z) (+ f30-2 (* f28-2 (rand-float-gen)) (-> this flock 0 target z))) ) - (vector-! s5-0 s5-0 (-> this root-override trans)) + (vector-! s5-0 s5-0 (-> this root trans)) (vector-float*! s5-0 s5-0 0.9) - (move-by-vector! (-> this root-override) s5-0) + (move-by-vector! (-> this root) s5-0) ) (set! (-> this teleport) #f) #f ) -(defmethod adjust-heading-around-point-slow! seagull ((this seagull) (arg0 float)) +(defmethod adjust-heading-around-point-slow! ((this seagull) (arg0 float)) (let ((f30-1 (* arg0 (sin (-> this heading)))) (f0-4 (* arg0 (cos (-> this heading)))) ) ;; og:preserve-this changed for high fps - (set! (-> this root-override transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> this root-override transv x)) (* 0.2 f30-1)))) - (set! (-> this root-override transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> this root-override transv z)) (* 0.2 f0-4)))) + (set! (-> this root transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> this root transv x)) (* 0.2 f30-1)))) + (set! (-> this root transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> this root transv z)) (* 0.2 f0-4)))) ) 0 (none) ) -(defmethod adjust-heading-around-point! seagull ((this seagull) (arg0 float)) +(defmethod adjust-heading-around-point! ((this seagull) (arg0 float)) (let ((f30-1 (* arg0 (sin (-> this heading)))) (f0-4 (* arg0 (cos (-> this heading)))) ) ;; og:preserve-this changed for high fps - (set! (-> this root-override transv x) (* DISPLAY_FPS_RATIO f30-1)) - (set! (-> this root-override transv z) (* DISPLAY_FPS_RATIO f0-4)) + (set! (-> this root transv x) (* DISPLAY_FPS_RATIO f30-1)) + (set! (-> this root transv z) (* DISPLAY_FPS_RATIO f0-4)) ) 0 (none) ) -(defmethod seagull-method-22 seagull ((this seagull)) - (set! (-> this root-override transv y) -8192.0) +(defmethod seagull-method-22 ((this seagull)) + (set! (-> this root transv y) -8192.0) 0 (none) ) -(defmethod seagull-method-27 seagull ((this seagull)) +(defmethod seagull-method-27 ((this seagull)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -538,8 +530,8 @@ ) (init-vf0-vector) (let ((v1-0 (new 'stack-no-clear 'vector)) - (a0-2 (-> this root-override trans)) - (s5-0 (-> this root-override transv)) + (a0-2 (-> this root trans)) + (s5-0 (-> this root transv)) (a1-1 (new 'stack-no-clear 'vector)) ) (let ((a2-0 v1-0)) @@ -554,8 +546,8 @@ ) (vector+! a1-1 a0-2 v1-0) (if (points-in-air? a0-2 a1-1 *seagull-boxes* 10) - (integrate-no-collide! (-> this root-override) (-> this root-override transv)) - (fill-cache-integrate-and-collide! (-> this root-override) s5-0 (collide-kind background)) + (integrate-no-collide! (-> this root) (-> this root transv)) + (fill-cache-integrate-and-collide! (-> this root) s5-0 (collide-kind background)) ) ) (none) @@ -566,7 +558,7 @@ :trans (behavior () (when (< (+ (current-time) (seconds -2)) (-> self part-time)) (-> self part) - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) ) ) :code (behavior () @@ -576,7 +568,7 @@ (when (and (>= (ja-frame-num 0) (ja-aframe 2.0 0)) (>= (ja-aframe 3.0 0) (ja-frame-num 0))) (let* ((v1-13 self) (a0-7 #t) - (f0-5 (-> v1-13 root-override transv y)) + (f0-5 (-> v1-13 root transv y)) ) (set! f0-5 (cond (a0-7 @@ -591,7 +583,7 @@ ) ) ;; og:preserve-this changed for high fps - (set! (-> v1-13 root-override transv y) (* DISPLAY_FPS_RATIO f0-5)) + (set! (-> v1-13 root transv y) (* DISPLAY_FPS_RATIO f0-5)) ) 0 (let* ((gp-1 self) @@ -600,8 +592,8 @@ (f0-10 (* f28-0 (cos (-> gp-1 heading)))) ) ;; og:preserve-this changed for high fps - (set! (-> gp-1 root-override transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-2)))) - (set! (-> gp-1 root-override transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-10)))) + (set! (-> gp-1 root transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root transv x)) (* 0.2 f30-2)))) + (set! (-> gp-1 root transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root transv z)) (* 0.2 f0-10)))) ) 0 ) @@ -620,7 +612,7 @@ :trans (behavior () (when (< (+ (current-time) (seconds -2)) (-> self part-time)) (-> self part) - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) ) ) :code (behavior () @@ -638,7 +630,7 @@ (let ((s5-0 self) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector-! s4-0 (-> s5-0 flock 0 target) (-> s5-0 root-override trans)) + (vector-! s4-0 (-> s5-0 flock 0 target) (-> s5-0 root trans)) (when (< (vector-dot s4-0 s4-0) 6710886400.0) (let ((v1-24 (ash 1 (-> s5-0 index)))) (when (not (logtest? v1-24 (-> s5-0 flock 0 bird-at-waterfall))) @@ -729,7 +721,7 @@ ((and v1-42 (>= (ja-aframe 9.0 0) (ja-frame-num 0))) (let* ((v1-44 self) (a0-49 #t) - (f0-38 (-> v1-44 root-override transv y)) + (f0-38 (-> v1-44 root transv y)) ) (set! f0-38 (cond (a0-49 @@ -744,14 +736,14 @@ ) ) ;; og:preserve-this changed for high fps - (set! (-> v1-44 root-override transv y) (* DISPLAY_FPS_RATIO f0-38)) + (set! (-> v1-44 root transv y) (* DISPLAY_FPS_RATIO f0-38)) ) 0 ) (else (let* ((v1-48 self) (a0-55 #f) - (f0-39 (-> v1-48 root-override transv y)) + (f0-39 (-> v1-48 root transv y)) ) (set! f0-39 (cond (a0-55 @@ -766,7 +758,7 @@ ) ) ;; og:preserve-this changed for high fps - (set! (-> v1-48 root-override transv y) (* DISPLAY_FPS_RATIO f0-39)) + (set! (-> v1-48 root transv y) (* DISPLAY_FPS_RATIO f0-39)) ) 0 ) @@ -777,8 +769,8 @@ (f30-2 (* f28-0 (sin (-> s5-1 heading)))) (f0-44 (* f28-0 (cos (-> s5-1 heading)))) ) - (set! (-> s5-1 root-override transv x) (+ (* 0.8 (-> s5-1 root-override transv x)) (* 0.2 f30-2))) - (set! (-> s5-1 root-override transv z) (+ (* 0.8 (-> s5-1 root-override transv z)) (* 0.2 f0-44))) + (set! (-> s5-1 root transv x) (+ (* 0.8 (-> s5-1 root transv x)) (* 0.2 f30-2))) + (set! (-> s5-1 root transv z) (+ (* 0.8 (-> s5-1 root transv z)) (* 0.2 f0-44))) ) 0 (seagull-method-27 self) @@ -788,10 +780,10 @@ (+! gp-0 1) (when (>= gp-0 0) (when (>= (-> self angletan) 0.1) - (if (< 204800.0 (-> self root-override trans y)) + (if (< 204800.0 (-> self root trans y)) (go seagull-soaring) ) - (when (< 57344.0 (-> self root-override trans y)) + (when (< 57344.0 (-> self root trans y)) (let* ((f30-3 0.8) (v1-77 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-78 (the-as number (logior #x3f800000 v1-77))) @@ -813,7 +805,7 @@ :trans (behavior () (when (< (+ (current-time) (seconds -2)) (-> self part-time)) (-> self part) - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) ) ) :code (behavior () @@ -831,7 +823,7 @@ (let ((gp-0 self) (s5-0 (new 'stack-no-clear 'vector)) ) - (vector-! s5-0 (-> gp-0 flock 0 target) (-> gp-0 root-override trans)) + (vector-! s5-0 (-> gp-0 flock 0 target) (-> gp-0 root trans)) (when (< (vector-dot s5-0 s5-0) 6710886400.0) (let ((v1-26 (ash 1 (-> gp-0 index)))) (when (not (logtest? v1-26 (-> gp-0 flock 0 bird-at-waterfall))) @@ -918,7 +910,7 @@ ) 0 (let ((v1-44 self)) - (set! (-> v1-44 root-override transv y) -8192.0) + (set! (-> v1-44 root transv y) -8192.0) ) 0 (let* ((gp-1 self) @@ -927,16 +919,16 @@ (f0-41 (* f28-0 (cos (-> gp-1 heading)))) ) ;; og:preserve-this changed for high fps - (set! (-> gp-1 root-override transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-0)))) - (set! (-> gp-1 root-override transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-41)))) + (set! (-> gp-1 root transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root transv x)) (* 0.2 f30-0)))) + (set! (-> gp-1 root transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root transv z)) (* 0.2 f0-41)))) ) 0 (seagull-method-27 self) (when (< (-> self angletan) 0.2) - (if (< (-> self root-override trans y) 40960.0) + (if (< (-> self root trans y) 40960.0) (go seagull-flying) ) - (when (< (-> self root-override trans y) 204800.0) + (when (< (-> self root trans y) 204800.0) (if (and (time-elapsed? (-> self state-time) (seconds 0.5)) (let* ((f30-1 0.99) (v1-67 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -975,11 +967,11 @@ (let ((s5-0 (new 'stack 'collide-tri-result))) 0.0 (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> self root-override transv y) (* 4096.0 (- arg0))) - (set! (-> gp-0 quad) (-> self root-override transv quad)) + (set! (-> self root transv y) (* 4096.0 (- arg0))) + (set! (-> gp-0 quad) (-> self root transv quad)) (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* - (-> self root-override trans) + (-> self root trans) gp-0 409.6 (collide-kind background) @@ -994,15 +986,11 @@ (go seagull-soaring) ) (vector-float*! gp-0 gp-0 f30-0) - (vector+! gp-0 gp-0 (-> self root-override trans)) + (vector+! gp-0 gp-0 (-> self root trans)) (while (< 0.5 f30-0) (suspend) (set! f30-0 (- f30-0 (seconds-per-frame))) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (collide-kind background) - ) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (collide-kind background)) (let* ((v1-21 self) (f1-3 (the float (sar (shl (the int (- (-> self heading) (-> v1-21 heading))) 48) 48))) (f0-12 (- (-> v1-21 tilt))) @@ -1042,11 +1030,7 @@ (suspend) (ja :num! (seek!)) (set! f30-0 (- f30-0 (seconds-per-frame))) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (collide-kind background) - ) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (collide-kind background)) (let* ((v1-48 self) (f1-13 (the float (sar (shl (the int (- (-> self heading) (-> v1-48 heading))) 48) 48))) (f0-32 (- (-> v1-48 tilt))) @@ -1165,9 +1149,9 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *seagull-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self index) arg1) @@ -1184,7 +1168,7 @@ (none) ) -(defmethod play-hint seagullflock ((this seagullflock) (arg0 int)) +(defmethod play-hint ((this seagullflock) (arg0 int)) (when (time-elapsed? (-> this alert-time) (seconds 5)) (eval-path-curve-div! (-> this path) (-> this target) (the float (-> this targetnum)) 'interp) (let ((f0-2 4096.0) @@ -1241,10 +1225,10 @@ (none) ) -(defmethod seagullflock-method-16 seagullflock ((this seagullflock) (arg0 seagull)) +(defmethod seagullflock-method-16 ((this seagullflock) (arg0 seagull)) (let ((gp-0 (new 'stack-no-clear 'vector))) (eval-path-curve-div! (-> this path) gp-0 (the float (-> this targetnum)) 'interp) - (vector-! gp-0 gp-0 (-> arg0 root-override trans)) + (vector-! gp-0 gp-0 (-> arg0 root trans)) (atan (-> gp-0 x) (-> gp-0 z)) ) ) @@ -1320,7 +1304,7 @@ ) ) -(defmethod init-from-entity! seagullflock ((this seagullflock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this seagullflock) (arg0 entity-actor)) (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) @@ -1330,7 +1314,7 @@ (set! (-> this target quad) (-> this trans quad)) (set! (-> this max-lift) 20480.0) (set! (-> this birds) 0) - (dotimes (v1-16 64) + (dotimes (v1-16 SEAGULLFLOCK_MAX) (set! (-> this bird v1-16) (the-as (pointer seagull) #f)) ) (spawn-bird this (-> this trans)) @@ -1364,7 +1348,7 @@ (none) ) -(defmethod spawn-bird seagullflock ((this seagullflock) (arg0 vector)) +(defmethod spawn-bird ((this seagullflock) (arg0 vector)) ;; og:preserve-this constant (if (= (-> this birds) SEAGULLFLOCK_MAX) (return (the-as (pointer process) #f)) diff --git a/goal_src/jak1/levels/beach/twister.gc b/goal_src/jak1/levels/beach/twister.gc index c4fdc2c4ef4..d0eaf65834d 100644 --- a/goal_src/jak1/levels/beach/twister.gc +++ b/goal_src/jak1/levels/beach/twister.gc @@ -8,38 +8,32 @@ ;; DECOMP BEGINS (deftype twist-joint (structure) - ((ry float :offset-assert 0) - (max-dry float :offset-assert 4) + ((ry float) + (max-dry float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype twister (basic) - ((num-joints int32 :offset-assert 4) - (first-joint int32 :offset-assert 8) - (last-joint int32 :offset-assert 12) - (something uint16 :offset 12) - (max-speed float :offset-assert 16) - (smoothing float :offset-assert 20) - (min-dist float :offset-assert 24) - (target float :offset-assert 28) - (ry float :offset-assert 32) - (max-speed-ry float :offset-assert 36) - (data twist-joint :inline :dynamic :offset-assert 40) + ((num-joints int32) + (first-joint int32) + (last-joint int32) + (something uint16 :overlay-at last-joint) + (max-speed float) + (smoothing float) + (min-dist float) + (target float) + (ry float) + (max-speed-ry float) + (data twist-joint :inline :dynamic) ) - :method-count-assert 13 - :size-assert #x28 - :flag-assert #xd00000028 (:methods - (new (symbol type int int float float float float) _type_ 0) - (twister-method-9 (_type_ int int float) none 9) - (set-target! (_type_ float) none 10) - (twister-method-11 (_type_) none 11) - (twister-method-12 (_type_ process-drawable) none 12) + (new (symbol type int int float float float float) _type_) + (twister-method-9 (_type_ int int float) none) + (set-target! (_type_ float) none) + (twister-method-11 (_type_) none) + (twister-method-12 (_type_ process-drawable) none) ) ) @@ -73,11 +67,11 @@ ) ) -(defmethod asize-of twister ((this twister)) +(defmethod asize-of ((this twister)) (+ (* (-> this num-joints) 16) 40) ) -(defmethod twister-method-9 twister ((this twister) (arg0 int) (arg1 int) (arg2 float)) +(defmethod twister-method-9 ((this twister) (arg0 int) (arg1 int) (arg2 float)) (let ((v1-1 (- arg0 (-> this first-joint))) (a1-2 (- arg1 (-> this first-joint))) ) @@ -90,13 +84,13 @@ (none) ) -(defmethod set-target! twister ((this twister) (arg0 float)) +(defmethod set-target! ((this twister) (arg0 float)) (set! (-> this target) arg0) 0 (none) ) -(defmethod twister-method-11 twister ((this twister)) +(defmethod twister-method-11 ((this twister)) (let* ((s5-0 (+ (-> this num-joints) -1)) (s4-0 (-> this data s5-0)) ) @@ -136,7 +130,7 @@ (none) ) -(defmethod twister-method-12 twister ((this twister) (arg0 process-drawable)) +(defmethod twister-method-12 ((this twister) (arg0 process-drawable)) (let ((s4-0 (new 'stack-no-clear 'matrix))) (dotimes (s3-0 (-> this num-joints)) (let ((s2-0 (-> arg0 node-list data (+ (-> this first-joint) s3-0) bone transform))) diff --git a/goal_src/jak1/levels/beach/wobbler.gc b/goal_src/jak1/levels/beach/wobbler.gc index 03c628a358d..77ff9c0cbf5 100644 --- a/goal_src/jak1/levels/beach/wobbler.gc +++ b/goal_src/jak1/levels/beach/wobbler.gc @@ -8,27 +8,24 @@ ;; DECOMP BEGINS (deftype wobbler (basic) - ((posx float :offset-assert 4) - (posy float :offset-assert 8) - (velx float :offset-assert 12) - (vely float :offset-assert 16) - (spring float :offset-assert 20) - (damping float :offset-assert 24) - (height float :offset-assert 28) + ((posx float) + (posy float) + (velx float) + (vely float) + (spring float) + (damping float) + (height float) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 (:methods - (reset! (_type_ float float float) none 9) - (inc-xy-vel! (_type_ float float) none 10) - (move! (_type_) none 11) - (wobbler-method-12 (_type_ quaternion) none 12) + (reset! (_type_ float float float) none) + (inc-xy-vel! (_type_ float float) none) + (move! (_type_) none) + (wobbler-method-12 (_type_ quaternion) none) ) ) -(defmethod reset! wobbler ((this wobbler) (arg0 float) (arg1 float) (arg2 float)) +(defmethod reset! ((this wobbler) (arg0 float) (arg1 float) (arg2 float)) (set! (-> this posx) 0.0) (set! (-> this posy) 0.0) (set! (-> this velx) 0.0) @@ -40,14 +37,14 @@ (none) ) -(defmethod inc-xy-vel! wobbler ((this wobbler) (arg0 float) (arg1 float)) +(defmethod inc-xy-vel! ((this wobbler) (arg0 float) (arg1 float)) (+! (-> this velx) arg0) (+! (-> this vely) arg1) 0 (none) ) -(defmethod move! wobbler ((this wobbler)) +(defmethod move! ((this wobbler)) (+! (-> this posx) (* (-> this velx) (seconds-per-frame))) (+! (-> this posy) (* (-> this vely) (seconds-per-frame))) (set! (-> this velx) (* (-> this velx) (-> this damping))) @@ -58,7 +55,7 @@ (none) ) -(defmethod wobbler-method-12 wobbler ((this wobbler) (arg0 quaternion)) +(defmethod wobbler-method-12 ((this wobbler) (arg0 quaternion)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 x) (-> this posy)) (set! (-> s5-0 y) 0.0) diff --git a/goal_src/jak1/levels/citadel/assistant-citadel.gc b/goal_src/jak1/levels/citadel/assistant-citadel.gc index 3e35c67b267..ec9d89f83a8 100644 --- a/goal_src/jak1/levels/citadel/assistant-citadel.gc +++ b/goal_src/jak1/levels/citadel/assistant-citadel.gc @@ -9,10 +9,6 @@ (deftype assistant-lavatube-end (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -22,7 +18,7 @@ :shadow assistant-lavatube-end-shadow-mg ) -(defmethod play-anim! assistant-lavatube-end ((this assistant-lavatube-end) (arg0 symbol)) +(defmethod play-anim! ((this assistant-lavatube-end) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status unknown) (task-status need-hint)) (new 'static 'spool-anim :name "assistant-lavatube-end-resolution" :index 4 :parts 11 :command-list '()) @@ -65,7 +61,7 @@ ) ) -(defmethod get-art-elem assistant-lavatube-end ((this assistant-lavatube-end)) +(defmethod get-art-elem ((this assistant-lavatube-end)) (-> this draw art-group data 3) ) @@ -74,7 +70,7 @@ :trans (behavior () (process-taskable-method-33 self) ((-> (method-of-type process-taskable hidden) trans)) - (when (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (not (closed? (-> self tasks) (game-task village4-button) (task-status need-reward-speech))) ) ) @@ -106,7 +102,7 @@ ) ) -(defmethod should-display? assistant-lavatube-end ((this assistant-lavatube-end)) +(defmethod should-display? ((this assistant-lavatube-end)) (first-any (-> this tasks) #t) (let ((v1-3 (current-status (-> this tasks)))) (and (or (= v1-3 (task-status need-reward-speech)) (= v1-3 (task-status invalid))) @@ -115,7 +111,7 @@ ) ) -(defmethod init-from-entity! assistant-lavatube-end ((this assistant-lavatube-end) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant-lavatube-end) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-lavatube-end-sg* 3 29 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task village4-button))) (first-any (-> this tasks) #t) diff --git a/goal_src/jak1/levels/citadel/citadel-obs.gc b/goal_src/jak1/levels/citadel/citadel-obs.gc index fc7e02caf72..fcc15f62c9e 100644 --- a/goal_src/jak1/levels/citadel/citadel-obs.gc +++ b/goal_src/jak1/levels/citadel/citadel-obs.gc @@ -8,20 +8,16 @@ ;; DECOMP BEGINS (deftype citb-arm-section (process-drawable) - ((sync sync-info :inline :offset-assert 176) - (cull-dir-local vector :inline :offset-assert 192) - (cull-dot float :offset-assert 208) - (rot-scale float :offset-assert 212) - (y-angle float :offset-assert 216) + ((sync sync-info :inline) + (cull-dir-local vector :inline) + (cull-dot float) + (rot-scale float) + (y-angle float) ) - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc (:methods - (init-root! (_type_) none 20) - (setup-new-process! (_type_) none 21) - (idle () _type_ :state 22) + (init-root! (_type_) none) + (setup-new-process! (_type_) none) + (idle () _type_ :state) ) ) @@ -97,13 +93,13 @@ :post ja-post ) -(defmethod init-root! citb-arm-section ((this citb-arm-section)) +(defmethod init-root! ((this citb-arm-section)) (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) -(defmethod setup-new-process! citb-arm-section ((this citb-arm-section)) +(defmethod setup-new-process! ((this citb-arm-section)) (logclear! (-> this mask) (process-mask actor-pause)) (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (cond @@ -124,7 +120,7 @@ (none) ) -(defmethod init-from-entity! citb-arm-section ((this citb-arm-section) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-arm-section) (arg0 entity-actor)) (init-root! this) (process-drawable-from-entity! this arg0) (setup-new-process! this) @@ -133,12 +129,8 @@ ) (deftype citb-arm (citb-arm-section) - ((root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) ) - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) @@ -147,14 +139,14 @@ :trans rider-trans :post (behavior () (if (logtest? (-> self draw status) (draw-status hidden)) - (clear-collide-with-as (-> self root-override)) - (restore-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) + (restore-collide-with-as (-> self root)) ) (rider-post) ) ) -(defmethod init-root! citb-arm ((this citb-arm)) +(defmethod init-root! ((this citb-arm)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -173,13 +165,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod setup-new-process! citb-arm ((this citb-arm)) +(defmethod setup-new-process! ((this citb-arm)) (call-parent-method this) (set! (-> this draw origin-joint-index) (the-as uint 4)) (set-vector! (-> this cull-dir-local) 0.0 0.0 -1.0 1.0) @@ -190,14 +182,10 @@ (deftype citb-arm-shoulder (citb-arm-section) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) -(defmethod setup-new-process! citb-arm-shoulder ((this citb-arm-shoulder)) +(defmethod setup-new-process! ((this citb-arm-shoulder)) (call-parent-method this) (set! (-> this draw origin-joint-index) (the-as uint 4)) (set-vector! (-> this cull-dir-local) 1.0 0.0 1.0 1.0) @@ -208,98 +196,74 @@ (deftype citb-arm-a (citb-arm) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) (deftype citb-arm-b (citb-arm) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) (deftype citb-arm-c (citb-arm) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) (deftype citb-arm-d (citb-arm) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) (deftype citb-arm-shoulder-a (citb-arm-shoulder) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) (deftype citb-arm-shoulder-b (citb-arm-shoulder) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) -(defmethod setup-new-process! citb-arm-a ((this citb-arm-a)) +(defmethod setup-new-process! ((this citb-arm-a)) (initialize-skeleton this *citb-arm-a-sg* '()) (call-parent-method this) - (set! (-> this root-override root-prim local-sphere z) -184320.0) + (set! (-> this root root-prim local-sphere z) -184320.0) 0 (none) ) -(defmethod setup-new-process! citb-arm-b ((this citb-arm-b)) +(defmethod setup-new-process! ((this citb-arm-b)) (initialize-skeleton this *citb-arm-b-sg* '()) (call-parent-method this) - (set! (-> this root-override root-prim local-sphere z) -225280.0) + (set! (-> this root root-prim local-sphere z) -225280.0) 0 (none) ) -(defmethod setup-new-process! citb-arm-c ((this citb-arm-c)) +(defmethod setup-new-process! ((this citb-arm-c)) (initialize-skeleton this *citb-arm-c-sg* '()) (call-parent-method this) - (set! (-> this root-override root-prim local-sphere z) -266240.0) + (set! (-> this root root-prim local-sphere z) -266240.0) 0 (none) ) -(defmethod setup-new-process! citb-arm-d ((this citb-arm-d)) +(defmethod setup-new-process! ((this citb-arm-d)) (initialize-skeleton this *citb-arm-d-sg* '()) (call-parent-method this) - (set! (-> this root-override root-prim local-sphere z) -307200.0) + (set! (-> this root root-prim local-sphere z) -307200.0) 0 (none) ) -(defmethod setup-new-process! citb-arm-shoulder-a ((this citb-arm-shoulder-a)) +(defmethod setup-new-process! ((this citb-arm-shoulder-a)) (initialize-skeleton this *citb-arm-shoulder-a-sg* '()) (call-parent-method this) 0 (none) ) -(defmethod setup-new-process! citb-arm-shoulder-b ((this citb-arm-shoulder-b)) +(defmethod setup-new-process! ((this citb-arm-shoulder-b)) (initialize-skeleton this *citb-arm-shoulder-b-sg* '()) (call-parent-method this) 0 @@ -331,17 +295,13 @@ ) (deftype citb-disc (process-drawable) - ((root-override collide-shape-moving :offset 112) - (sync sync-info :inline :offset-assert 176) - (rot-scale float :offset-assert 184) + ((root collide-shape-moving :override) + (sync sync-info :inline) + (rot-scale float) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xbc - :flag-assert #x16005000bc (:methods - (init! (_type_) none 20) - (citb-disc-method-21 (_type_) none 21) + (init! (_type_) none) + (citb-disc-method-21 (_type_) none) ) (:states citb-disc-idle @@ -363,7 +323,7 @@ (loop (update! (-> self sound)) (quaternion-axis-angle! - (-> self root-override quat) + (-> self root quat) 0.0 1.0 0.0 @@ -375,7 +335,7 @@ :post rider-post ) -(defmethod init! citb-disc ((this citb-disc)) +(defmethod init! ((this citb-disc)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -394,18 +354,18 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod citb-disc-method-21 citb-disc ((this citb-disc)) +(defmethod citb-disc-method-21 ((this citb-disc)) 0 (none) ) -(defmethod init-from-entity! citb-disc ((this citb-disc) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-disc) (arg0 entity-actor)) (init! this) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -423,7 +383,7 @@ ) (citb-disc-method-21 this) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> this root trans)) ) (logior! (-> this skel status) (janim-status inited)) (go citb-disc-idle) @@ -432,59 +392,43 @@ (deftype citb-disc-a (citb-disc) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xbc - :flag-assert #x16005000bc ) (deftype citb-disc-b (citb-disc) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xbc - :flag-assert #x16005000bc ) (deftype citb-disc-c (citb-disc) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xbc - :flag-assert #x16005000bc ) (deftype citb-disc-d (citb-disc) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xbc - :flag-assert #x16005000bc ) -(defmethod citb-disc-method-21 citb-disc-a ((this citb-disc-a)) +(defmethod citb-disc-method-21 ((this citb-disc-a)) (initialize-skeleton this *citb-disc-a-sg* '()) 0 (none) ) -(defmethod citb-disc-method-21 citb-disc-b ((this citb-disc-b)) +(defmethod citb-disc-method-21 ((this citb-disc-b)) (initialize-skeleton this *citb-disc-b-sg* '()) 0 (none) ) -(defmethod citb-disc-method-21 citb-disc-c ((this citb-disc-c)) +(defmethod citb-disc-method-21 ((this citb-disc-c)) (initialize-skeleton this *citb-disc-c-sg* '()) 0 (none) ) -(defmethod citb-disc-method-21 citb-disc-d ((this citb-disc-d)) +(defmethod citb-disc-method-21 ((this citb-disc-d)) (initialize-skeleton this *citb-disc-d-sg* '()) 0 (none) @@ -492,10 +436,6 @@ (deftype citb-iris-door (eco-door) () - :heap-base #xa0 - :method-count-assert 27 - :size-assert #x104 - :flag-assert #x1b00a00104 ) @@ -504,7 +444,7 @@ :bounds (static-spherem 0 0 0 8) ) -(defmethod eco-door-method-24 citb-iris-door ((this citb-iris-door)) +(defmethod eco-door-method-24 ((this citb-iris-door)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -517,19 +457,19 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod eco-door-method-25 citb-iris-door ((this citb-iris-door)) +(defmethod eco-door-method-25 ((this citb-iris-door)) (initialize-skeleton this *citb-iris-door-sg* '()) (set! (-> this open-distance) 32768.0) (set! (-> this close-distance) 49152.0) (set! (-> this auto-close) #t) (process-entity-status! this (entity-perm-status complete) #t) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) 0 (none) ) @@ -541,14 +481,10 @@ (deftype citb-button (basebutton) () - :heap-base #x90 - :method-count-assert 32 - :size-assert #x100 - :flag-assert #x2000900100 ) -(defmethod basebutton-method-27 citb-button ((this citb-button)) +(defmethod basebutton-method-27 ((this citb-button)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -566,12 +502,12 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (the-as collide-shape-moving 0) ) -(defmethod basebutton-method-26 citb-button ((this citb-button)) +(defmethod basebutton-method-26 ((this citb-button)) (initialize-skeleton this *citb-button-sg* '()) (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) @@ -601,18 +537,14 @@ ) (set! (-> this anim-speed) 2.0) (set! (-> this timeout) 1.0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (ja-post) (none) ) (deftype citb-launcher (plat) - ((launcher (pointer launcher) :offset-assert 264) + ((launcher (pointer launcher)) ) - :heap-base #xa0 - :method-count-assert 33 - :size-assert #x10c - :flag-assert #x2100a0010c ) @@ -633,17 +565,17 @@ :bounds (static-spherem 0 0 0 4) ) -(defmethod get-unlit-skel citb-launcher ((this citb-launcher)) +(defmethod get-unlit-skel ((this citb-launcher)) *citb-launcher-sg* ) -(defmethod baseplat-method-26 citb-launcher ((this citb-launcher)) +(defmethod baseplat-method-26 ((this citb-launcher)) (let ((f30-0 (res-lump-float (-> this entity) 'spring-height :default 163840.0)) (s5-0 (res-lump-value (-> this entity) 'mode uint128)) ) - (set! (-> this launcher) (process-spawn launcher (-> this root-override trans) f30-0 s5-0 81920.0 :to this)) + (set! (-> this launcher) (process-spawn launcher (-> this root trans) f30-0 s5-0 81920.0 :to this)) ) - (set! (-> this root-override root-prim local-sphere w) 18432.0) + (set! (-> this root root-prim local-sphere w) 18432.0) (logclear! (-> this mask) (process-mask actor-pause)) 0 (none) @@ -703,13 +635,9 @@ ) (deftype citb-robotboss (process-drawable) - ((root-override collide-shape :offset 112) - (shield-on symbol :offset-assert 176) + ((root collide-shape :override) + (shield-on symbol) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states citb-robotboss-die citb-robotboss-idle @@ -766,58 +694,51 @@ ) ) :code (behavior () - (let ((gp-0 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-nose-sg* #f :to self))) + (let ((gp-0 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-nose-sg* #f :to self))) (send-event (ppointer->process gp-0) 'anim-mode 'loop) (send-event (ppointer->process gp-0) 'art-joint-anim "citb-robotboss-nose-idle" 0) (send-event (ppointer->process gp-0) 'draw #t) ) - (let ((gp-1 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-head-sg* #f :to self))) + (let ((gp-1 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-head-sg* #f :to self))) (send-event (ppointer->process gp-1) 'anim-mode 'loop) (send-event (ppointer->process gp-1) 'art-joint-anim "citb-robotboss-head-idle" 0) (send-event (ppointer->process gp-1) 'draw #t) ) - (let ((gp-2 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-gun-sg* #f :to self))) + (let ((gp-2 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-gun-sg* #f :to self))) (send-event (ppointer->process gp-2) 'anim-mode 'loop) (send-event (ppointer->process gp-2) 'art-joint-anim "citb-robotboss-gun-idle" 0) (send-event (ppointer->process gp-2) 'draw #t) ) - (let ((gp-3 - (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-leftshoulder-sg* #f :to self) - ) - ) + (let ((gp-3 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-leftshoulder-sg* #f :to self))) (send-event (ppointer->process gp-3) 'anim-mode 'loop) (send-event (ppointer->process gp-3) 'art-joint-anim "citb-robotboss-leftshoulder-idle" 0) (send-event (ppointer->process gp-3) 'draw #t) ) - (let ((gp-4 - (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-rightshoulder-sg* #f :to self) - ) - ) + (let ((gp-4 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-rightshoulder-sg* #f :to self))) (send-event (ppointer->process gp-4) 'anim-mode 'loop) (send-event (ppointer->process gp-4) 'art-joint-anim "citb-robotboss-rightshoulder-idle" 0) (send-event (ppointer->process gp-4) 'draw #t) ) - (let ((gp-5 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-leftarm-sg* #f :to self))) + (let ((gp-5 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-leftarm-sg* #f :to self))) (send-event (ppointer->process gp-5) 'anim-mode 'loop) (send-event (ppointer->process gp-5) 'art-joint-anim "citb-robotboss-leftarm-idle" 0) (send-event (ppointer->process gp-5) 'draw #t) ) - (let ((gp-6 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-rightarm-sg* #f :to self)) - ) + (let ((gp-6 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-rightarm-sg* #f :to self))) (send-event (ppointer->process gp-6) 'anim-mode 'loop) (send-event (ppointer->process gp-6) 'art-joint-anim "citb-robotboss-rightarm-idle" 0) (send-event (ppointer->process gp-6) 'draw #t) ) - (let ((gp-7 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-belly-sg* #f :to self))) + (let ((gp-7 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-belly-sg* #f :to self))) (send-event (ppointer->process gp-7) 'anim-mode 'loop) (send-event (ppointer->process gp-7) 'art-joint-anim "citb-robotboss-belly-idle" 0) (send-event (ppointer->process gp-7) 'draw #t) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (loop (when (-> self shield-on) (update! (-> self sound)) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (set! (-> *palette-fade-controls* control 7 fade) 1.0) ) (suspend) @@ -833,7 +754,7 @@ ) ) -(defmethod init-from-entity! citb-robotboss ((this citb-robotboss) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-robotboss) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object)) @@ -846,7 +767,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *citb-robotboss-sg* '()) @@ -854,7 +775,7 @@ (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this shield-on) #t) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "robotcage-lp" :fo-max 150) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "robotcage-lp" :fo-max 150) (-> this root trans)) ) (if (= (get-task-status (-> this entity extra perm task)) (task-status invalid)) (go citb-robotboss-die) @@ -869,12 +790,8 @@ ) (deftype citb-coil (process-drawable) - ((part-off sparticle-launch-control :offset-assert 176) + ((part-off sparticle-launch-control) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states citb-coil-break citb-coil-broken @@ -883,14 +800,14 @@ ) -(defmethod relocate citb-coil ((this citb-coil) (arg0 int)) +(defmethod relocate ((this citb-coil) (arg0 int)) (if (nonzero? (-> this part-off)) (&+! (-> this part-off) arg0) ) (the-as citb-coil ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate citb-coil ((this citb-coil)) +(defmethod deactivate ((this citb-coil)) (if (nonzero? (-> this part-off)) (kill-and-free-particles (-> this part-off)) ) @@ -950,7 +867,7 @@ :post ja-post ) -(defmethod init-from-entity! citb-coil ((this citb-coil) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-coil) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *citb-coil-sg* '()) @@ -975,10 +892,6 @@ (deftype citb-hose (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states citb-hose-die citb-hose-idle @@ -1041,7 +954,7 @@ :post ja-post ) -(defmethod init-from-entity! citb-hose ((this citb-hose) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-hose) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *citb-hose-sg* '()) @@ -1059,9 +972,6 @@ (deftype citb-chains (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) @@ -1076,23 +986,19 @@ ) (deftype citb-generator (process-drawable) - ((root-override collide-shape :offset 112) - (normal-look lod-set :inline :offset-assert 176) - (broken-look lod-set :inline :offset-assert 212) - (mushroom-pos vector :inline :offset-assert 256) - (mushroom symbol :offset-assert 272) - (birth-fuel-cell symbol :offset-assert 276) - (trigger-others symbol :offset-assert 280) - (part-broken sparticle-launch-control :offset-assert 284) - (part-mushroom sparticle-launch-control :offset-assert 288) + ((root collide-shape :override) + (normal-look lod-set :inline) + (broken-look lod-set :inline) + (mushroom-pos vector :inline) + (mushroom symbol) + (birth-fuel-cell symbol) + (trigger-others symbol) + (part-broken sparticle-launch-control) + (part-mushroom sparticle-launch-control) ) - :heap-base #xc0 - :method-count-assert 22 - :size-assert #x124 - :flag-assert #x1600c00124 (:methods - (init! (_type_) none 20) - (citb-generator-method-21 (_type_) none 21) + (init! (_type_) none) + (citb-generator-method-21 (_type_) none) ) (:states citb-generator-break @@ -1102,7 +1008,7 @@ ) -(defmethod relocate citb-generator ((this citb-generator) (arg0 int)) +(defmethod relocate ((this citb-generator) (arg0 int)) (if (nonzero? (-> this part-broken)) (&+! (-> this part-broken) arg0) ) @@ -1112,7 +1018,7 @@ (the-as citb-generator ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate citb-generator ((this citb-generator)) +(defmethod deactivate ((this citb-generator)) (if (nonzero? (-> this part-broken)) (kill-and-free-particles (-> this part-broken)) ) @@ -1218,9 +1124,9 @@ ) :code (behavior () (lods-assign! (-> self draw) (-> self normal-look)) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (loop - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (update! (-> self sound)) (if (-> self mushroom) (spawn (-> self part-mushroom) (-> self mushroom-pos)) @@ -1228,7 +1134,7 @@ (if (not (-> self mushroom)) (+! (-> *palette-fade-controls* control 3 fade) 0.3333) ) - (when (and *target* (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and *target* (>= 32768.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (if (-> self mushroom) (level-hint-spawn (text-id citadel-generator) "sksp0381" (the-as entity #f) *entity-pool* (game-task none)) (level-hint-spawn @@ -1288,7 +1194,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (sound-play "sagecage-open") @@ -1304,7 +1210,7 @@ (defstate citb-generator-broken (citb-generator) :code (behavior () (lods-assign! (-> self draw) (-> self broken-look)) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (cond ((-> self birth-fuel-cell) (process-drawable-birth-fuel-cell (the-as entity #f) (the-as vector #f) #t) @@ -1322,12 +1228,12 @@ (anim-loop) ) :post (behavior () - (spawn (-> self part-broken) (-> self root-override trans)) + (spawn (-> self part-broken) (-> self root trans)) (ja-post) ) ) -(defmethod init! citb-generator ((this citb-generator)) +(defmethod init! ((this citb-generator)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) @@ -1339,20 +1245,20 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod citb-generator-method-21 citb-generator ((this citb-generator)) +(defmethod citb-generator-method-21 ((this citb-generator)) (initialize-skeleton this *citb-generator-sg* '()) (setup-lods! (-> this normal-look) *citb-generator-sg* (-> this draw art-group) (-> this entity)) (setup-lods! (-> this broken-look) *citb-generator-broken-sg* (-> this draw art-group) (-> this entity)) (set! (-> this link) (new 'process 'actor-link-info this)) (set! (-> this birth-fuel-cell) (< (the-as uint 1) (the-as uint (-> this entity extra perm task)))) (set! (-> this trigger-others) #f) - (set! (-> this mushroom-pos quad) (-> this root-override trans quad)) + (set! (-> this mushroom-pos quad) (-> this root trans quad)) (let ((f30-0 0.0)) (cond ((name= (-> this name) "citb-generator-1") @@ -1384,13 +1290,13 @@ (set! (-> this part-broken) (create-launch-control (-> *part-group-id-table* 597) this)) (set! (-> this part-mushroom) (create-launch-control (-> *part-group-id-table* 599) this)) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "mushroom-gen" :fo-max 20) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "mushroom-gen" :fo-max 20) (-> this root trans)) ) 0 (none) ) -(defmethod init-from-entity! citb-generator ((this citb-generator) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-generator) (arg0 entity-actor)) (init! this) (process-drawable-from-entity! this arg0) (citb-generator-method-21 this) @@ -1413,10 +1319,6 @@ (deftype citadelcam (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states citadelcam-idle citadelcam-stair-plats @@ -1492,7 +1394,7 @@ ) ) -(defmethod init-from-entity! citadelcam ((this citadelcam) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citadelcam) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1502,10 +1404,6 @@ (deftype citb-battlecontroller (battlecontroller) () - :heap-base #x210 - :method-count-assert 29 - :size-assert #x27c - :flag-assert #x1d0210027c ) @@ -1549,7 +1447,7 @@ ) ) -(defmethod battlecontroller-method-27 citb-battlecontroller ((this citb-battlecontroller)) +(defmethod battlecontroller-method-27 ((this citb-battlecontroller)) (call-parent-method this) (set! (-> this activate-distance) 143360.0) 0 diff --git a/goal_src/jak1/levels/citadel/citadel-part.gc b/goal_src/jak1/levels/citadel/citadel-part.gc index c99f3a2c386..07f633fe639 100644 --- a/goal_src/jak1/levels/citadel/citadel-part.gc +++ b/goal_src/jak1/levels/citadel/citadel-part.gc @@ -9,10 +9,6 @@ (deftype citb-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) @@ -63,8 +59,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (sp-kill-particle arg0 arg1) (set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0) - (launch-particles (-> *part-id-table* 2882) gp-0 :rate 1.0) - (launch-particles (-> *part-id-table* 2883) gp-0 :rate 1.0) + (launch-particles (-> *part-id-table* 2882) gp-0 :rate (the-as float 1.0)) + (launch-particles (-> *part-id-table* 2883) gp-0 :rate (the-as float 1.0)) ) ) (none) diff --git a/goal_src/jak1/levels/citadel/citadel-sages.gc b/goal_src/jak1/levels/citadel/citadel-sages.gc index 848bdf50fe5..52ff1029be9 100644 --- a/goal_src/jak1/levels/citadel/citadel-sages.gc +++ b/goal_src/jak1/levels/citadel/citadel-sages.gc @@ -18,20 +18,16 @@ ) (deftype citb-sagecage (process-drawable) - ((parent-override (pointer citb-sage) :offset 12) - (root-override collide-shape-moving :offset 112) - (bar-array vector 12 :inline :offset-assert 176) - (angle-offset float :offset-assert 368) - (bars-on symbol :offset-assert 372) - (cloning symbol :offset-assert 376) + ((root collide-shape-moving :override) + (parent-override (pointer citb-sage) :overlay-at parent) + (bar-array vector 12 :inline) + (angle-offset float) + (bars-on symbol) + (cloning symbol) ) - :heap-base #x110 - :method-count-assert 22 - :size-assert #x17c - :flag-assert #x160110017c (:methods - (citb-sagecage-method-20 (_type_) none 20) - (citb-sagecage-method-21 (_type_) none 21) + (citb-sagecage-method-20 (_type_) none) + (citb-sagecage-method-21 (_type_) none) ) (:states citb-sagecage-idle @@ -47,7 +43,7 @@ (let ((s4-0 (new 'stack-no-clear 'quaternion))) (let ((s3-0 (new 'stack-no-clear 'vector))) (matrix->quaternion s4-0 gp-0) - (vector-! s3-0 (camera-pos) (-> self root-override trans)) + (vector-! s3-0 (camera-pos) (-> self root trans)) (let ((v1-7 (-> gp-0 vector 2))) (set! (-> self angle-offset) (- (atan (-> v1-7 x) (-> v1-7 z)))) ) @@ -73,10 +69,10 @@ ) (defbehavior citb-sagecage-update-collision citb-sagecage () - (change-mesh (the-as collide-shape-prim-mesh (-> self root-override root-prim)) (if (-> self bars-on) - 0 - 1 - ) + (change-mesh (the-as collide-shape-prim-mesh (-> self root root-prim)) (if (-> self bars-on) + 0 + 1 + ) ) 0 (none) @@ -146,7 +142,7 @@ ) ) -(defmethod citb-sagecage-method-20 citb-sagecage ((this citb-sagecage)) +(defmethod citb-sagecage-method-20 ((this citb-sagecage)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -165,16 +161,16 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod citb-sagecage-method-21 citb-sagecage ((this citb-sagecage)) +(defmethod citb-sagecage-method-21 ((this citb-sagecage)) (initialize-skeleton this *citb-sagecage-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (set! (-> this root-override pause-adjust-distance) 409600.0) + (set! (-> this root pause-adjust-distance) 409600.0) (let ((f0-1 20766.72) (f4-0 14745.6) (f1-0 -14745.6) @@ -196,7 +192,7 @@ (set-vector! (-> this bar-array 11) f2-0 f0-1 f1-0 1.0) ) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "sagecage-gen" :fo-max 20) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "sagecage-gen" :fo-max 20) (-> this root trans)) ) (set! (-> this bars-on) (not (task-complete? *game-info* (-> this entity extra perm task)))) (citb-sagecage-update-collision) @@ -208,9 +204,9 @@ (defbehavior citb-sagecage-init-by-other citb-sagecage ((arg0 citb-sage)) (citb-sagecage-method-20 self) - (mem-copy! (the-as pointer (-> self root-override trans)) (the-as pointer (-> arg0 root-override trans)) 16) - (mem-copy! (the-as pointer (-> self root-override quat)) (the-as pointer (-> arg0 root-override quat)) 16) - (mem-copy! (the-as pointer (-> self root-override scale)) (the-as pointer (-> arg0 root-override scale)) 16) + (mem-copy! (the-as pointer (-> self root trans)) (the-as pointer (-> arg0 root trans)) 16) + (mem-copy! (the-as pointer (-> self root quat)) (the-as pointer (-> arg0 root quat)) 16) + (mem-copy! (the-as pointer (-> self root scale)) (the-as pointer (-> arg0 root scale)) 16) (citb-sagecage-method-21 self) (go citb-sagecage-idle) (none) @@ -253,38 +249,34 @@ ) (deftype citb-sage (process-taskable) - ((spawn-pos vector :inline :offset-assert 384) - (target-pos vector :inline :offset-assert 400) - (dir vector :inline :offset-assert 416) - (rot-y float :offset-assert 432) - (rot-x float :offset-assert 436) - (idle-anim int32 :offset-assert 440) - (attack-start-anim int32 :offset-assert 444) - (attack-anim int32 :offset-assert 448) - (beam-joint int32 :offset-assert 452) - (cage handle :offset-assert 456) - (part-impact sparticle-launch-control :offset-assert 464) - (beam-on symbol :offset-assert 468) - (resolution-anim spool-anim :offset-assert 472) - (sound-name string :offset-assert 476) - (sound-id sound-id :offset-assert 480) - (alt-actor entity-actor :offset-assert 484) + ((spawn-pos vector :inline) + (target-pos vector :inline) + (dir vector :inline) + (rot-y float) + (rot-x float) + (idle-anim int32) + (attack-start-anim int32) + (attack-anim int32) + (beam-joint int32) + (cage handle) + (part-impact sparticle-launch-control) + (beam-on symbol) + (resolution-anim spool-anim) + (sound-name string) + (sound-id sound-id) + (alt-actor entity-actor) ) - :heap-base #x180 - :method-count-assert 53 - :size-assert #x1e8 - :flag-assert #x35018001e8 ) -(defmethod relocate citb-sage ((this citb-sage) (arg0 int)) +(defmethod relocate ((this citb-sage) (arg0 int)) (if (nonzero? (-> this part-impact)) (&+! (-> this part-impact) arg0) ) (the-as citb-sage ((method-of-type process-taskable relocate) this arg0)) ) -(defmethod deactivate citb-sage ((this citb-sage)) +(defmethod deactivate ((this citb-sage)) (if (nonzero? (-> this part-impact)) (kill-and-free-particles (-> this part-impact)) ) @@ -293,8 +285,8 @@ (none) ) -(defmethod play-reminder citb-sage ((this citb-sage)) - (set! (-> this root-override pause-adjust-distance) 409600.0) +(defmethod play-reminder ((this citb-sage)) + (set! (-> this root pause-adjust-distance) 409600.0) (set! (-> this cage) (ppointer->handle (process-spawn citb-sagecage this :to this))) (set! (-> this beam-on) #f) (set! (-> this sound-id) (new-sound-id)) @@ -309,7 +301,7 @@ (set! v1-9 (entity-by-name "citb-robotboss-1")) ) (set! (-> this alt-actor) (the-as entity-actor v1-9)) - (set! (-> this spawn-pos quad) (-> this root-override trans quad)) + (set! (-> this spawn-pos quad) (-> this root trans quad)) (set! (-> s5-1 quad) (-> v1-9 extra trans quad)) (+! (-> s5-1 y) 81920.0) (vector-! s4-0 (-> this spawn-pos) s5-1) @@ -326,12 +318,12 @@ (the-as symbol 0) ) -(defmethod process-taskable-method-45 citb-sage ((this citb-sage)) - (set! (-> this spawn-pos quad) (-> this root-override trans quad)) +(defmethod process-taskable-method-45 ((this citb-sage)) + (set! (-> this spawn-pos quad) (-> this root trans quad)) (the-as symbol 0) ) -(defmethod process-taskable-method-42 citb-sage ((this citb-sage)) +(defmethod process-taskable-method-42 ((this citb-sage)) (if (not (should-display? this)) (go (method-of-object this hidden)) (go (method-of-object this idle)) @@ -339,11 +331,11 @@ (none) ) -(defmethod play-anim! citb-sage ((this citb-sage) (arg0 symbol)) +(defmethod play-anim! ((this citb-sage) (arg0 symbol)) (the-as basic (-> this resolution-anim)) ) -(defmethod get-art-elem citb-sage ((this citb-sage)) +(defmethod get-art-elem ((this citb-sage)) (cond ((= (current-status (-> this tasks)) (task-status invalid)) (set! (-> this beam-on) #t) @@ -355,7 +347,7 @@ ) ) -(defmethod should-display? citb-sage ((this citb-sage)) +(defmethod should-display? ((this citb-sage)) (!= (get-task-status (game-task citadel-sage-green)) (task-status invalid)) ) @@ -438,14 +430,10 @@ (deftype red-sagecage (citb-sage) () - :heap-base #x180 - :method-count-assert 53 - :size-assert #x1e8 - :flag-assert #x35018001e8 ) -(defmethod process-taskable-method-52 red-sagecage ((this red-sagecage)) +(defmethod process-taskable-method-52 ((this red-sagecage)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) @@ -462,7 +450,7 @@ (none) ) -(defmethod draw-npc-shadow red-sagecage ((this red-sagecage)) +(defmethod draw-npc-shadow ((this red-sagecage)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -485,7 +473,7 @@ (none) ) -(defmethod process-taskable-method-45 red-sagecage ((this red-sagecage)) +(defmethod process-taskable-method-45 ((this red-sagecage)) (set! (-> *part-id-table* 2455 init-specs 14 initial-valuef) (-> this rot-y)) (set! (-> *part-id-table* 2455 init-specs 13 initial-valuef) (-> this rot-x)) (set! (-> *part-id-table* 2457 init-specs 14 initial-valuef) (-> this rot-y)) @@ -495,7 +483,7 @@ (the-as symbol 0) ) -(defmethod play-reminder red-sagecage ((this red-sagecage)) +(defmethod play-reminder ((this red-sagecage)) (set! (-> this idle-anim) 4) (set! (-> this attack-start-anim) 5) (set! (-> this attack-anim) 6) @@ -519,7 +507,7 @@ (the-as symbol 0) ) -(defmethod process-taskable-method-43 red-sagecage ((this red-sagecage)) +(defmethod process-taskable-method-43 ((this red-sagecage)) (if (-> this beam-on) (return #f) ) @@ -527,20 +515,20 @@ (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) - (play-ambient (-> this ambient) "RED-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "RED-AM01" #f (-> this root trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> this ambient) "RED-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "RED-AM02" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "RED-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "RED-AM03" #f (-> this root trans)) ) ) ) ) ) -(defmethod init-from-entity! red-sagecage ((this red-sagecage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this red-sagecage) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *redsage-sg* 3 33 (new 'static 'vector :w 8192.0) 5) (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) (play-reminder this) @@ -551,14 +539,10 @@ (deftype blue-sagecage (citb-sage) () - :heap-base #x180 - :method-count-assert 53 - :size-assert #x1e8 - :flag-assert #x35018001e8 ) -(defmethod process-taskable-method-52 blue-sagecage ((this blue-sagecage)) +(defmethod process-taskable-method-52 ((this blue-sagecage)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) @@ -575,7 +559,7 @@ (none) ) -(defmethod draw-npc-shadow blue-sagecage ((this blue-sagecage)) +(defmethod draw-npc-shadow ((this blue-sagecage)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -598,7 +582,7 @@ (none) ) -(defmethod process-taskable-method-45 blue-sagecage ((this blue-sagecage)) +(defmethod process-taskable-method-45 ((this blue-sagecage)) (set! (-> *part-id-table* 2448 init-specs 14 initial-valuef) (-> this rot-y)) (set! (-> *part-id-table* 2448 init-specs 13 initial-valuef) (-> this rot-x)) (set! (-> *part-id-table* 2450 init-specs 14 initial-valuef) (-> this rot-y)) @@ -608,7 +592,7 @@ (the-as symbol 0) ) -(defmethod play-reminder blue-sagecage ((this blue-sagecage)) +(defmethod play-reminder ((this blue-sagecage)) (set! (-> this idle-anim) 4) (set! (-> this attack-start-anim) 5) (set! (-> this attack-anim) 6) @@ -637,7 +621,7 @@ (the-as symbol 0) ) -(defmethod process-taskable-method-43 blue-sagecage ((this blue-sagecage)) +(defmethod process-taskable-method-43 ((this blue-sagecage)) (if (-> this beam-on) (return #f) ) @@ -645,20 +629,20 @@ (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) - (play-ambient (-> this ambient) "BLU-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BLU-AM01" #f (-> this root trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> this ambient) "BLU-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BLU-AM02" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "BLU-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BLU-AM03" #f (-> this root trans)) ) ) ) ) ) -(defmethod init-from-entity! blue-sagecage ((this blue-sagecage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this blue-sagecage) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *bluesage-sg* 3 54 (new 'static 'vector :w 8192.0) 5) (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) (play-reminder this) @@ -669,14 +653,10 @@ (deftype yellow-sagecage (citb-sage) () - :heap-base #x180 - :method-count-assert 53 - :size-assert #x1e8 - :flag-assert #x35018001e8 ) -(defmethod process-taskable-method-52 yellow-sagecage ((this yellow-sagecage)) +(defmethod process-taskable-method-52 ((this yellow-sagecage)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) @@ -693,7 +673,7 @@ (none) ) -(defmethod draw-npc-shadow yellow-sagecage ((this yellow-sagecage)) +(defmethod draw-npc-shadow ((this yellow-sagecage)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -716,7 +696,7 @@ (none) ) -(defmethod process-taskable-method-45 yellow-sagecage ((this yellow-sagecage)) +(defmethod process-taskable-method-45 ((this yellow-sagecage)) (set! (-> *part-id-table* 2462 init-specs 14 initial-valuef) (-> this rot-y)) (set! (-> *part-id-table* 2462 init-specs 13 initial-valuef) (-> this rot-x)) (set! (-> *part-id-table* 2464 init-specs 14 initial-valuef) (-> this rot-y)) @@ -726,7 +706,7 @@ (the-as symbol 0) ) -(defmethod play-reminder yellow-sagecage ((this yellow-sagecage)) +(defmethod play-reminder ((this yellow-sagecage)) (set! (-> this idle-anim) 4) (set! (-> this attack-start-anim) 5) (set! (-> this attack-anim) 6) @@ -750,7 +730,7 @@ (the-as symbol 0) ) -(defmethod process-taskable-method-43 yellow-sagecage ((this yellow-sagecage)) +(defmethod process-taskable-method-43 ((this yellow-sagecage)) (if (-> this beam-on) (return #f) ) @@ -758,20 +738,20 @@ (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) - (play-ambient (-> this ambient) "YEL-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "YEL-AM01" #f (-> this root trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> this ambient) "YEL-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "YEL-AM02" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "YEL-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "YEL-AM03" #f (-> this root trans)) ) ) ) ) ) -(defmethod init-from-entity! yellow-sagecage ((this yellow-sagecage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this yellow-sagecage) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *yellowsage-sg* 3 50 (new 'static 'vector :w 8192.0) 5) (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) (play-reminder this) @@ -781,20 +761,16 @@ ) (deftype green-sagecage (citb-sage) - ((which-movie int32 :offset-assert 488) - (evilbro handle :offset-assert 496) - (evilsis handle :offset-assert 504) - (robotboss handle :offset-assert 512) - (exitplat handle :offset-assert 520) + ((which-movie int32) + (evilbro handle) + (evilsis handle) + (robotboss handle) + (exitplat handle) ) - :heap-base #x1a0 - :method-count-assert 53 - :size-assert #x210 - :flag-assert #x3501a00210 ) -(defmethod process-taskable-method-45 green-sagecage ((this green-sagecage)) +(defmethod process-taskable-method-45 ((this green-sagecage)) (set! (-> *part-id-table* 2469 init-specs 14 initial-valuef) (-> this rot-y)) (set! (-> *part-id-table* 2469 init-specs 13 initial-valuef) (-> this rot-x)) (set! (-> *part-id-table* 2471 init-specs 14 initial-valuef) (-> this rot-y)) @@ -804,7 +780,7 @@ (the-as symbol 0) ) -(defmethod play-reminder green-sagecage ((this green-sagecage)) +(defmethod play-reminder ((this green-sagecage)) (set! (-> this idle-anim) 4) (set! (-> this attack-start-anim) 4) (set! (-> this attack-anim) 4) @@ -830,7 +806,7 @@ (the-as symbol 0) ) -(defmethod play-anim! green-sagecage ((this green-sagecage) (arg0 symbol)) +(defmethod play-anim! ((this green-sagecage) (arg0 symbol)) (local-vars (v1-7 int)) (let ((v1-1 (current-status (-> this tasks)))) (cond @@ -868,17 +844,13 @@ (+! (-> this which-movie) 1) (set! (-> this draw bounds w) 40960.0) (set! (-> this evilbro) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *evilbro-citadel-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *evilbro-citadel-sg* #f :to this)) ) (send-event (handle->process (-> this evilbro)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this evilbro)) 'blend-shape #t) (send-event (handle->process (-> this evilbro)) 'center-joint 3) (set! (-> this evilsis) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *evilsis-citadel-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *evilsis-citadel-sg* #f :to this)) ) (send-event (handle->process (-> this evilsis)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this evilsis)) 'blend-shape #t) @@ -994,7 +966,7 @@ (format 0 "robotboss ent ~A~%" gp-0) (when gp-0 (set! (-> self robotboss) - (ppointer->handle (manipy-spawn (-> self root-override trans) gp-0 *robotboss-sg* #f :to self)) + (ppointer->handle (manipy-spawn (-> self root trans) gp-0 *robotboss-sg* #f :to self)) ) (send-event (handle->process (-> self robotboss)) 'anim-mode 'clone-anim) (send-event (handle->process (-> self robotboss)) 'center-joint 3) @@ -1103,7 +1075,7 @@ ) ) -(defmethod should-display? green-sagecage ((this green-sagecage)) +(defmethod should-display? ((this green-sagecage)) (< (-> this which-movie) 2) ) @@ -1124,7 +1096,7 @@ ) ) -(defmethod init-from-entity! green-sagecage ((this green-sagecage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this green-sagecage) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *green-sagecage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) (play-reminder this) diff --git a/goal_src/jak1/levels/citadel/citb-bunny.gc b/goal_src/jak1/levels/citadel/citb-bunny.gc index 392006ee20c..5d2f5852b66 100644 --- a/goal_src/jak1/levels/citadel/citb-bunny.gc +++ b/goal_src/jak1/levels/citadel/citb-bunny.gc @@ -9,12 +9,8 @@ (deftype citb-bunny (snow-bunny) () - :heap-base #x190 - :method-count-assert 77 - :size-assert #x200 - :flag-assert #x4d01900200 (:methods - (citb-bunny-method-48 (_type_ object) none :replace 48) + (nav-enemy-method-48 (_type_ object) none :replace) ) ) @@ -76,15 +72,15 @@ ) ) -(defmethod snow-bunny-method-60 citb-bunny ((this citb-bunny)) +(defmethod nav-enemy-method-60 ((this citb-bunny)) (initialize-skeleton this *citb-bunny-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) 0 (none) ) -(defmethod citb-bunny-method-48 citb-bunny ((this citb-bunny) (arg0 object)) - (snow-bunny-method-60 this) +(defmethod nav-enemy-method-48 ((this citb-bunny) (arg0 object)) + (nav-enemy-method-60 this) (init-defaults! this *citb-bunny-nav-enemy-info*) (logclear! (-> this draw shadow-ctrl settings flags) (shadow-flags shdf03)) (cond @@ -112,7 +108,7 @@ (none) ) -(defmethod set-jump-height-factor! citb-bunny ((this citb-bunny) (arg0 int)) +(defmethod set-jump-height-factor! ((this citb-bunny) (arg0 int)) (let ((v1-0 arg0)) (cond ((zero? v1-0) diff --git a/goal_src/jak1/levels/citadel/citb-drop-plat.gc b/goal_src/jak1/levels/citadel/citb-drop-plat.gc index dcc9f053d49..625bd26350d 100644 --- a/goal_src/jak1/levels/citadel/citb-drop-plat.gc +++ b/goal_src/jak1/levels/citadel/citb-drop-plat.gc @@ -33,22 +33,18 @@ ) (deftype drop-plat (process-drawable) - ((root-override collide-shape-moving :offset 112) - (spin-axis vector :inline :offset-assert 176) - (spin-angle float :offset-assert 192) - (spin-speed float :offset-assert 196) - (interp float :offset-assert 200) - (duration time-frame :offset-assert 208) - (delay time-frame :offset-assert 216) - (color int8 :offset-assert 224) + ((root collide-shape-moving :override) + (spin-axis vector :inline) + (spin-angle float) + (spin-speed float) + (interp float) + (duration time-frame) + (delay time-frame) + (color int8) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xe1 - :flag-assert #x16008000e1 (:methods - (drop-plat-method-20 (_type_) none 20) - (drop-plat-method-21 (_type_) none 21) + (drop-plat-method-20 (_type_) none) + (drop-plat-method-21 (_type_) none) ) (:states drop-plat-die @@ -76,7 +72,7 @@ ) :code (behavior () (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (set-time! (-> self state-time)) (logior! (-> self mask) (process-mask actor-pause)) (loop @@ -91,11 +87,12 @@ (defbehavior drop-plat-set-fade drop-plat () (let ((f0-1 - (fmin 1.0 (* 0.000012207031 (- (-> self root-override trans y) - (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y)) - ) - ) - ) + (fmin + 1.0 + (* 0.000012207031 + (- (-> self root trans y) (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y))) + ) + ) ) ) (set-vector! (-> self draw color-mult) f0-1 f0-1 f0-1 1.0) @@ -113,9 +110,7 @@ ) ) :code (behavior () - (set! (-> self root-override trans y) - (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y)) - ) + (set! (-> self root trans y) (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y))) (logior! (-> self draw status) (draw-status hidden)) (ja-post) (set-time! (-> self state-time)) @@ -145,19 +140,17 @@ (set! (-> self interp) 1.0) (set-time! (-> self state-time)) (set! (-> self spin-angle) 0.0) - (set! (-> self root-override trans y) - (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y)) - ) + (set! (-> self root trans y) (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y))) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 #f) ) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (set! (-> gp-0 y) (-> (the-as process-drawable (-> self parent 0)) root trans y)) (loop (let ((f0-6 (fmax 0.0 (- 1.0 (* 0.0033333334 (the float (- (current-time) (-> self state-time)))))))) (set! (-> self interp) (* f0-6 f0-6)) ) - (set! (-> self root-override trans y) + (set! (-> self root trans y) (- (-> (the-as process-drawable (-> self parent 0)) root trans y) (* 204800.0 (-> self interp))) ) (when (and (not s5-0) (< (-> self interp) 0.05)) @@ -165,7 +158,7 @@ (sound-play "bridge-piece-up" :position (the-as symbol gp-0)) ) (set! (-> self spin-angle) (* 10.0 (-> self spin-speed) (-> self interp))) - (if (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) + (if (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root trans y)) (go drop-plat-idle) ) (suspend) @@ -175,7 +168,7 @@ :post (behavior () (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-vector-angle! gp-0 (-> self spin-axis) (-> self spin-angle)) - (quaternion*! (-> self root-override quat) (-> (the-as process-drawable (-> self parent 0)) root quat) gp-0) + (quaternion*! (-> self root quat) (-> (the-as process-drawable (-> self parent 0)) root quat) gp-0) ) (drop-plat-set-fade) (transform-post) @@ -184,7 +177,7 @@ (defstate drop-plat-drop (drop-plat) :code (behavior () - (when (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) + (when (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root trans y)) (set-time! (-> self state-time)) (sound-play "bridge-piece-dn") (let ((gp-1 (the int (* 300.0 (rand-vu-float-range 0.2 0.3))))) @@ -196,14 +189,9 @@ ) ) (loop - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) - ) - (vector-v++! (-> self root-override trans) (-> self root-override transv)) - (if (< 204800.0 - (- (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) - ) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) + (vector-v++! (-> self root trans) (-> self root transv)) + (if (< 204800.0 (- (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root trans y))) (go drop-plat-die) ) (+! (-> self spin-angle) (* (-> self spin-speed) (seconds-per-frame))) @@ -213,7 +201,7 @@ :post (behavior () (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-vector-angle! gp-0 (-> self spin-axis) (-> self spin-angle)) - (quaternion*! (-> self root-override quat) (-> (the-as process-drawable (-> self parent 0)) root quat) gp-0) + (quaternion*! (-> self root quat) (-> (the-as process-drawable (-> self parent 0)) root quat) gp-0) ) (drop-plat-set-fade) (transform-post) @@ -226,7 +214,7 @@ ) ) -(defmethod drop-plat-method-20 drop-plat ((this drop-plat)) +(defmethod drop-plat-method-20 ((this drop-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -245,13 +233,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod drop-plat-method-21 drop-plat ((this drop-plat)) +(defmethod drop-plat-method-21 ((this drop-plat)) (case (-> this color) ((1) (initialize-skeleton this *citb-drop-plat-red-sg* '()) @@ -297,44 +285,37 @@ (set! (-> self delay) arg1) (set! (-> self duration) arg2) (drop-plat-method-20 self) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (vector-identity! (-> self root-override scale)) - (quaternion-copy! (-> self root-override quat) (-> (the-as process-drawable (-> self parent 0)) root quat)) + (set! (-> self root trans quad) (-> arg0 quad)) + (vector-identity! (-> self root scale)) + (quaternion-copy! (-> self root quat) (-> (the-as process-drawable (-> self parent 0)) root quat)) (drop-plat-method-21 self) (go drop-plat-spawn) (none) ) (deftype handle-inline-array (inline-array-class) - ((data handle :dynamic :offset-assert 16) + ((data handle :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> handle-inline-array heap-base) (the-as uint 8)) (deftype citb-drop-plat (process-drawable) - ((x-count int32 :offset-assert 176) - (z-count int32 :offset-assert 180) - (child-count int32 :offset-assert 184) - (child-array handle-inline-array :offset-assert 188) - (child-color-array (pointer int8) :offset-assert 192) - (x-dir vector :inline :offset-assert 208) - (z-dir vector :inline :offset-assert 224) - (origin vector :inline :offset-assert 240) - (x-spacing float :offset-assert 256) - (z-spacing float :offset-assert 260) - (idle-distance float :offset-assert 264) - (duration time-frame :offset-assert 272) - (drop-time time-frame :offset-assert 280) + ((x-count int32) + (z-count int32) + (child-count int32) + (child-array handle-inline-array) + (child-color-array (pointer int8)) + (x-dir vector :inline) + (z-dir vector :inline) + (origin vector :inline) + (x-spacing float) + (z-spacing float) + (idle-distance float) + (duration time-frame) + (drop-time time-frame) ) - :heap-base #xb0 - :method-count-assert 20 - :size-assert #x120 - :flag-assert #x1400b00120 (:states citb-drop-plat-active citb-drop-plat-idle @@ -342,7 +323,7 @@ ) -(defmethod relocate citb-drop-plat ((this citb-drop-plat) (arg0 int)) +(defmethod relocate ((this citb-drop-plat) (arg0 int)) (if (nonzero? (-> this child-array)) (&+! (-> this child-array) arg0) ) @@ -491,7 +472,7 @@ ) ) -(defmethod init-from-entity! citb-drop-plat ((this citb-drop-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-drop-plat) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (let ((v1-2 (res-lump-data arg0 'count pointer))) diff --git a/goal_src/jak1/levels/citadel/citb-plat.gc b/goal_src/jak1/levels/citadel/citb-plat.gc index 6e1da67f4c0..20823abce12 100644 --- a/goal_src/jak1/levels/citadel/citb-plat.gc +++ b/goal_src/jak1/levels/citadel/citb-plat.gc @@ -34,19 +34,17 @@ ) (deftype citb-base-plat (process-drawable) - ((root-override collide-shape-moving :offset 112) - (idle-distance float :offset-assert 176) + ((root collide-shape-moving :override) + (idle-distance float) ) - :heap-base #x50 - :method-count-assert 25 - :size-assert #xb4 - :flag-assert #x19005000b4 + (:state-methods + citb-base-plat-idle + ) (:methods - (citb-base-plat-idle () _type_ :state 20) - (citb-base-plat-method-21 (_type_) none 21) - (citb-base-plat-method-22 (_type_) none 22) - (citb-base-plat-active () _type_ :state 23) - (citb-base-plat-method-24 (_type_) none 24) + (citb-base-plat-method-21 (_type_) none) + (citb-base-plat-method-22 (_type_) none) + (citb-base-plat-active () _type_ :state) + (citb-base-plat-method-24 (_type_) none) ) ) @@ -54,9 +52,8 @@ (defstate citb-base-plat-idle (citb-base-plat) :virtual #t :trans (behavior () - (if (and *target* (>= (-> self idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (and *target* + (>= (-> self idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (go-virtual citb-base-plat-active) ) @@ -69,7 +66,7 @@ :virtual #t :trans (behavior () (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + (vector-vector-distance (-> self root trans) (-> *target* control trans)) ) ) (go-virtual citb-base-plat-idle) @@ -80,7 +77,7 @@ :post rider-post ) -(defmethod citb-base-plat-method-21 citb-base-plat ((this citb-base-plat)) +(defmethod citb-base-plat-method-21 ((this citb-base-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -99,25 +96,25 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod citb-base-plat-method-22 citb-base-plat ((this citb-base-plat)) +(defmethod citb-base-plat-method-22 ((this citb-base-plat)) (initialize-skeleton this *plat-citb-sg* '()) 0 (none) ) -(defmethod citb-base-plat-method-24 citb-base-plat ((this citb-base-plat)) +(defmethod citb-base-plat-method-24 ((this citb-base-plat)) (go (method-of-object this citb-base-plat-idle)) 0 (none) ) -(defmethod init-from-entity! citb-base-plat ((this citb-base-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-base-plat) (arg0 entity-actor)) (citb-base-plat-method-21 this) (process-drawable-from-entity! this arg0) (set! (-> this idle-distance) 245760.0) @@ -129,14 +126,10 @@ (deftype citb-plat-eco (plat-eco) () - :heap-base #x100 - :method-count-assert 33 - :size-assert #x165 - :flag-assert #x2101000165 ) -(defmethod baseplat-method-24 citb-plat-eco ((this citb-plat-eco)) +(defmethod baseplat-method-24 ((this citb-plat-eco)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -155,33 +148,29 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod baseplat-method-26 citb-plat-eco ((this citb-plat-eco)) +(defmethod baseplat-method-26 ((this citb-plat-eco)) (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this notice-dist) 8192.0) (none) ) -(defmethod get-unlit-skel citb-plat-eco ((this citb-plat-eco)) +(defmethod get-unlit-skel ((this citb-plat-eco)) *plat-eco-citb-unlit-sg* ) -(defmethod get-lit-skel citb-plat-eco ((this citb-plat-eco)) +(defmethod get-lit-skel ((this citb-plat-eco)) *plat-eco-citb-lit-sg* ) (deftype citb-plat (plat) - ((trans-offset vector :inline :offset-assert 272) + ((trans-offset vector :inline) ) - :heap-base #xb0 - :method-count-assert 33 - :size-assert #x120 - :flag-assert #x2100b00120 ) @@ -195,18 +184,18 @@ ) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (vector+! (-> self basetrans) (-> self basetrans) (-> self trans-offset)) - (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) + (if (< (vector-vector-distance (-> self root trans) (ear-trans)) 81920.0) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root trans))) ) (plat-trans) ) ) -(defmethod get-unlit-skel citb-plat ((this citb-plat)) +(defmethod get-unlit-skel ((this citb-plat)) *plat-citb-sg* ) -(defmethod baseplat-method-24 citb-plat ((this citb-plat)) +(defmethod baseplat-method-24 ((this citb-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -225,19 +214,17 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod baseplat-method-26 citb-plat ((this citb-plat)) +(defmethod baseplat-method-26 ((this citb-plat)) (logclear! (-> this mask) (process-mask actor-pause)) - (set! (-> this root-override scale quad) (-> (res-lump-struct (-> this entity) 'scale vector) quad)) - (let ((f0-0 (-> this root-override scale x))) - (set! (-> this root-override root-prim local-sphere w) - (* (-> this root-override root-prim local-sphere w) f0-0) - ) + (set! (-> this root scale quad) (-> (res-lump-struct (-> this entity) 'scale vector) quad)) + (let ((f0-0 (-> this root scale x))) + (set! (-> this root root-prim local-sphere w) (* (-> this root root-prim local-sphere w) f0-0)) (set! (-> this draw bounds w) (* (-> this draw bounds w) f0-0)) ) (set! (-> this trans-offset quad) (-> (the-as vector ((method-of-type res-lump get-property-struct) @@ -258,15 +245,11 @@ ) (deftype citb-stair-plat (citb-base-plat) - ((idle-height float :offset-assert 180) - (rise-height float :offset-assert 184) - (delay time-frame :offset-assert 192) - (rise symbol :offset-assert 200) + ((idle-height float) + (rise-height float) + (delay time-frame) + (rise symbol) ) - :heap-base #x60 - :method-count-assert 25 - :size-assert #xcc - :flag-assert #x19006000cc ) @@ -300,12 +283,12 @@ (loop (let ((f30-0 (- 1.0 (* 0.0011111111 (the float (- (current-time) (-> self state-time))))))) (when (< f30-0 0.0) - (set! (-> self root-override trans y) (-> self rise-height)) + (set! (-> self root trans y) (-> self rise-height)) (go-virtual citb-base-plat-active) ) - (set! (-> self root-override trans y) (lerp (-> self rise-height) (-> self idle-height) (* f30-0 f30-0))) + (set! (-> self root trans y) (lerp (-> self rise-height) (-> self idle-height) (* f30-0 f30-0))) ) - (let ((f0-12 (fmax 0.0 (fmin 1.0 (* 0.000012207031 (+ 409600.0 (-> self root-override trans y))))))) + (let ((f0-12 (fmax 0.0 (fmin 1.0 (* 0.000012207031 (+ 409600.0 (-> self root trans y))))))) (set! (-> self draw color-mult x) f0-12) (set! (-> self draw color-mult y) f0-12) (set! (-> self draw color-mult z) f0-12) @@ -321,36 +304,34 @@ :virtual #t :trans #f :code (behavior () - (set! (-> self root-override trans y) (-> self rise-height)) + (set! (-> self root trans y) (-> self rise-height)) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (logior! (-> self mask) (process-mask actor-pause)) (anim-loop) ) :post ja-post ) -(defmethod citb-base-plat-method-22 citb-stair-plat ((this citb-stair-plat)) +(defmethod citb-base-plat-method-22 ((this citb-stair-plat)) (initialize-skeleton this *plat-citb-sg* '()) - (set! (-> this rise-height) (-> this root-override trans y)) + (set! (-> this rise-height) (-> this root trans y)) (set! (-> this idle-height) (+ -409600.0 (-> this rise-height))) - (set! (-> this root-override trans y) (-> this idle-height)) + (set! (-> this root trans y) (-> this idle-height)) (set! (-> this rise) #f) (set! (-> this delay) (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'delay :default 1.0)))) ) (let ((f0-7 1.5)) - (set-vector! (-> this root-override scale) f0-7 f0-7 f0-7 1.0) - (set! (-> this root-override root-prim local-sphere w) - (* (-> this root-override root-prim local-sphere w) f0-7) - ) + (set-vector! (-> this root scale) f0-7 f0-7 f0-7 1.0) + (set! (-> this root root-prim local-sphere w) (* (-> this root root-prim local-sphere w) f0-7)) (set! (-> this draw bounds w) (* (-> this draw bounds w) f0-7)) ) 0 (none) ) -(defmethod citb-base-plat-method-24 citb-stair-plat ((this citb-stair-plat)) +(defmethod citb-base-plat-method-24 ((this citb-stair-plat)) (if (and (task-complete? *game-info* (game-task citadel-sage-blue)) (task-complete? *game-info* (game-task citadel-sage-red)) (task-complete? *game-info* (game-task citadel-sage-yellow)) @@ -389,23 +370,19 @@ ) (deftype citb-chain-plat (rigid-body-platform) - ((orig-trans vector :inline :offset-assert 736) - (orig-quat quaternion :inline :offset-assert 752) - (beam-end vector :inline :offset-assert 768) - (float-offset float :offset-assert 784) - (idle-offset float :offset-assert 788) + ((orig-trans vector :inline) + (orig-quat quaternion :inline) + (beam-end vector :inline) + (float-offset float) + (idle-offset float) ) - :heap-base #x2b0 - :method-count-assert 35 - :size-assert #x318 - :flag-assert #x2302b00318 (:states citb-chain-plat-settle ) ) -(defmethod rigid-body-platform-method-22 citb-chain-plat ((this citb-chain-plat) (arg0 vector) (arg1 float)) +(defmethod rigid-body-platform-method-22 ((this citb-chain-plat) (arg0 vector) (arg1 float)) (+ 12288.0 (* 2048.0 (fmax 0.0 (fmin 1.0 (* 0.000024414063 (-> this float-height-offset)))) @@ -416,7 +393,7 @@ ) ) -(defmethod rigid-body-platform-method-27 citb-chain-plat ((this citb-chain-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-27 ((this citb-chain-plat) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 arg0 (-> this rbody position)) (set! (-> gp-0 y) 0.0) @@ -433,7 +410,7 @@ (none) ) -(defmethod rigid-body-platform-method-23 citb-chain-plat ((this citb-chain-plat) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this citb-chain-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this orig-trans)) 0 @@ -535,7 +512,7 @@ :post rider-post ) -(defmethod rigid-body-platform-method-30 citb-chain-plat ((this citb-chain-plat)) +(defmethod rigid-body-platform-method-30 ((this citb-chain-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -560,7 +537,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 citb-chain-plat ((this citb-chain-plat)) +(defmethod rigid-body-platform-method-31 ((this citb-chain-plat)) (initialize-skeleton this *citb-chain-plat-sg* '()) (set! (-> this orig-trans quad) (-> this root-overlay trans quad)) (quaternion-copy! (-> this orig-quat) (-> this root-overlay quat)) @@ -596,10 +573,6 @@ (deftype citb-rotatebox (citb-base-plat) () - :heap-base #x50 - :method-count-assert 25 - :size-assert #xb4 - :flag-assert #x19005000b4 ) @@ -614,7 +587,7 @@ (ja :num! (seek!)) ) (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + (vector-vector-distance (-> self root trans) (-> *target* control trans)) ) ) (go-virtual citb-base-plat-idle) @@ -623,7 +596,7 @@ ) ) -(defmethod citb-base-plat-method-21 citb-rotatebox ((this citb-rotatebox)) +(defmethod citb-base-plat-method-21 ((this citb-rotatebox)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -642,13 +615,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod citb-base-plat-method-22 citb-rotatebox ((this citb-rotatebox)) +(defmethod citb-base-plat-method-22 ((this citb-rotatebox)) (initialize-skeleton this *citb-rotatebox-sg* '()) 0 (none) @@ -660,12 +633,8 @@ ) (deftype citb-donut (citb-base-plat) - ((sync sync-info :inline :offset-assert 180) + ((sync sync-info :inline) ) - :heap-base #x50 - :method-count-assert 25 - :size-assert #xbc - :flag-assert #x19005000bc ) @@ -673,18 +642,12 @@ :virtual #t :post (behavior () (update! (-> self sound)) - (quaternion-axis-angle! - (-> self root-override quat) - 0.0 - 1.0 - 0.0 - (* 65536.0 (get-current-phase (-> self sync))) - ) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (* 65536.0 (get-current-phase (-> self sync)))) (rider-post) ) ) -(defmethod citb-base-plat-method-21 citb-donut ((this citb-donut)) +(defmethod citb-base-plat-method-21 ((this citb-donut)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -703,17 +666,17 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod citb-base-plat-method-22 citb-donut ((this citb-donut)) +(defmethod citb-base-plat-method-22 ((this citb-donut)) (initialize-skeleton this *citb-donut-sg* '()) (setup-params! (-> this sync) (the-as uint 9000) 0.0 0.15 0.15) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> this root trans)) ) (logclear! (-> this mask) (process-mask actor-pause)) 0 @@ -727,10 +690,6 @@ (deftype citb-stopbox (plat) () - :heap-base #xa0 - :method-count-assert 33 - :size-assert #x108 - :flag-assert #x2100a00108 ) @@ -739,18 +698,18 @@ :trans (behavior () (set! (-> self path-pos) (get-current-phase (-> self sync))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) + (if (< (vector-vector-distance (-> self root trans) (ear-trans)) 81920.0) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root trans))) ) (plat-trans) ) ) -(defmethod get-unlit-skel citb-stopbox ((this citb-stopbox)) +(defmethod get-unlit-skel ((this citb-stopbox)) *citb-stopbox-sg* ) -(defmethod baseplat-method-24 citb-stopbox ((this citb-stopbox)) +(defmethod baseplat-method-24 ((this citb-stopbox)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -769,13 +728,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod baseplat-method-26 citb-stopbox ((this citb-stopbox)) +(defmethod baseplat-method-26 ((this citb-stopbox)) (logior! (-> this fact options) (fact-options wrap-phase)) (logclear! (-> this mask) (process-mask actor-pause)) 0 @@ -783,16 +742,12 @@ ) (deftype citb-firehose (process-drawable) - ((root-override collide-shape :offset 112) - (idle-distance float :offset-assert 176) - (sync sync-info :inline :offset-assert 180) - (last-sync float :offset-assert 188) - (blast-pos vector :inline :offset-assert 192) + ((root collide-shape :override) + (idle-distance float) + (sync sync-info :inline) + (last-sync float) + (blast-pos vector :inline) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14006000d0 (:states citb-firehose-active citb-firehose-blast @@ -808,9 +763,8 @@ (defstate citb-firehose-idle (citb-firehose) :trans (behavior () - (if (and *target* (>= (-> self idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (and *target* + (>= (-> self idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (go citb-firehose-active) ) @@ -826,7 +780,7 @@ (defstate citb-firehose-active (citb-firehose) :trans (behavior () (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + (vector-vector-distance (-> self root trans) (-> *target* control trans)) ) ) (go citb-firehose-idle) @@ -881,7 +835,7 @@ (ja :num! (seek!)) ) (ja-channel-push! 1 (seconds 0.1)) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (sound-play "eco-torch" :position (the-as symbol (-> self blast-pos))) (dotimes (gp-1 2) (ja-no-eval :group! citb-firehose-loopflame-ja :num! (seek!) :frame-num 0.0) @@ -892,7 +846,7 @@ (ja :num! (seek!)) ) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! citb-firehose-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -904,7 +858,7 @@ :post transform-post ) -(defmethod init-from-entity! citb-firehose ((this citb-firehose) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-firehose) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -936,14 +890,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *citb-firehose-sg* '()) (load-params! (-> this sync) this (the-as uint 900) 0.0 0.15 0.15) (set! (-> this idle-distance) 286720.0) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 685) this)) - (clear-collide-with-as (-> this root-override)) + (clear-collide-with-as (-> this root)) (go citb-firehose-idle) (none) ) @@ -954,14 +908,10 @@ ) (deftype citb-exit-plat (plat-button) - ((idle-height float :offset-assert 240) - (rise-height float :offset-assert 244) - (activated symbol :offset-assert 248) + ((idle-height float) + (rise-height float) + (activated symbol) ) - :heap-base #x90 - :method-count-assert 33 - :size-assert #xfc - :flag-assert #x21009000fc (:states citb-exit-plat-idle citb-exit-plat-rise @@ -983,7 +933,7 @@ ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (loop (suspend) ) @@ -994,15 +944,15 @@ :trans rider-trans :code (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (set-time! (-> self state-time)) (loop (let ((f30-0 (- 1.0 (* 0.0016666667 (the float (- (current-time) (-> self state-time))))))) (when (< f30-0 0.0) - (set! (-> self root-override trans y) (-> self rise-height)) + (set! (-> self root trans y) (-> self rise-height)) (go-virtual plat-button-idle) ) - (set! (-> self root-override trans y) (lerp (-> self rise-height) (-> self idle-height) (* f30-0 f30-0))) + (set! (-> self root trans y) (lerp (-> self rise-height) (-> self idle-height) (* f30-0 f30-0))) ) (suspend) ) @@ -1013,8 +963,8 @@ (defbehavior citb-exit-plat-move-player citb-exit-plat ((arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! gp-0 (-> self root-override trans) arg0) - (vector-! s5-0 (-> *target* control trans) (-> self root-override trans)) + (vector-! gp-0 (-> self root trans) arg0) + (vector-! s5-0 (-> *target* control trans) (-> self root trans)) (set! (-> s5-0 y) 0.0) (let ((f30-0 (vector-length s5-0))) (when (< 122880.0 f30-0) @@ -1034,7 +984,7 @@ :virtual #t :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (let ((t9-1 (-> (the-as (state plat-button) (find-parent-state)) trans))) (if t9-1 (t9-1) @@ -1050,7 +1000,7 @@ :virtual #t :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (let ((t9-1 (-> (the-as (state plat-button) (find-parent-state)) trans))) (if t9-1 (t9-1) @@ -1062,16 +1012,16 @@ :post transform-post ) -(defmethod can-activate? citb-exit-plat ((this citb-exit-plat)) +(defmethod can-activate? ((this citb-exit-plat)) (not (movie?)) ) -(defmethod plat-button-method-31 citb-exit-plat ((this citb-exit-plat)) +(defmethod plat-button-method-31 ((this citb-exit-plat)) (initialize-skeleton this *citb-exit-plat-sg* '()) (none) ) -(defmethod plat-button-method-32 citb-exit-plat ((this citb-exit-plat)) +(defmethod plat-button-method-32 ((this citb-exit-plat)) (if (-> this activated) (go (method-of-object this plat-button-idle)) (go citb-exit-plat-idle) @@ -1080,7 +1030,7 @@ (none) ) -(defmethod plat-button-method-28 citb-exit-plat ((this citb-exit-plat)) +(defmethod plat-button-method-28 ((this citb-exit-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1116,12 +1066,12 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) -(defmethod can-target-move? citb-exit-plat ((this citb-exit-plat)) +(defmethod can-target-move? ((this citb-exit-plat)) (process-entity-status! this (entity-perm-status bit-7) #t) (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this draw light-index) (the-as uint 255)) @@ -1141,15 +1091,15 @@ (set! (-> this path-pos) 1.0) ) ) - (let ((s5-0 (-> this root-override trans))) + (let ((s5-0 (-> this root trans))) (eval-path-curve! (-> this path) s5-0 (-> this path-pos) 'interp) (vector+! s5-0 s5-0 (-> this trans-off)) ) - (set! (-> this rise-height) (-> this root-override trans y)) + (set! (-> this rise-height) (-> this root trans y)) (set! (-> this idle-height) (+ -286720.0 (-> this rise-height))) (if (-> this activated) - (set! (-> this root-override trans y) (-> this rise-height)) - (set! (-> this root-override trans y) (-> this idle-height)) + (set! (-> this root trans y) (-> this rise-height)) + (set! (-> this root trans y) (-> this idle-height)) ) (set! (-> this allow-auto-kill) #f) (process-entity-status! this (entity-perm-status bit-3) #t) diff --git a/goal_src/jak1/levels/common/battlecontroller.gc b/goal_src/jak1/levels/common/battlecontroller.gc index b49021b6ff7..f0d0d06ef9c 100644 --- a/goal_src/jak1/levels/common/battlecontroller.gc +++ b/goal_src/jak1/levels/common/battlecontroller.gc @@ -8,70 +8,60 @@ ;; DECOMP BEGINS (deftype battlecontroller-spawner (structure) - ((path path-control :offset-assert 0) - (creature handle :offset-assert 8) - (trigger-actor entity-actor :offset-assert 16) - (blocker-actor entity-actor :offset-assert 20) - (state int8 :offset-assert 24) - (enabled symbol :offset-assert 28) + ((path path-control) + (creature handle) + (trigger-actor entity-actor) + (blocker-actor entity-actor) + (state int8) + (enabled symbol) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype battlecontroller-creature-type (structure) - ((type2 type :offset-assert 0) - (percent float :offset-assert 4) - (pickup-percent float :offset-assert 8) - (pickup-type pickup-type :offset-assert 12) - (max-pickup-count int8 :offset-assert 16) - (pickup-count int8 :offset-assert 17) + ((type2 type) + (percent float) + (pickup-percent float) + (pickup-type pickup-type) + (max-pickup-count int8) + (pickup-count int8) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x12 - :flag-assert #x900000012 ) (deftype battlecontroller (process-drawable) - ((final-pickup-spawn-point vector :inline :offset-assert 176) - (activate-distance float :offset-assert 192) - (max-spawn-count int16 :offset-assert 196) - (spawn-count int16 :offset-assert 198) - (die-count int16 :offset-assert 200) - (target-count int8 :offset-assert 202) - (spawner-count int8 :offset-assert 203) - (creature-type-count int8 :offset-assert 204) - (spawner-array battlecontroller-spawner 8 :inline :offset-assert 208) - (spawn-period time-frame :offset-assert 464) - (path-spawn path-control :offset-assert 472) - (creature-type-array battlecontroller-creature-type 4 :inline :offset-assert 476) - (final-pickup-type pickup-type :offset-assert 604) - (prespawn symbol :offset-assert 608) - (noticed-player symbol :offset-assert 612) - (camera-on symbol :offset-assert 616) - (misty-ambush-collision-hack symbol :offset-assert 620) - (disable-ocean symbol :offset-assert 624) - (disable-near-ocean symbol :offset-assert 628) - (disable-mid-ocean symbol :offset-assert 632) + ((final-pickup-spawn-point vector :inline) + (activate-distance float) + (max-spawn-count int16) + (spawn-count int16) + (die-count int16) + (target-count int8) + (spawner-count int8) + (creature-type-count int8) + (spawner-array battlecontroller-spawner 8 :inline) + (spawn-period time-frame) + (path-spawn path-control) + (creature-type-array battlecontroller-creature-type 4 :inline) + (final-pickup-type pickup-type) + (prespawn symbol) + (noticed-player symbol) + (camera-on symbol) + (misty-ambush-collision-hack symbol) + (disable-ocean symbol) + (disable-near-ocean symbol) + (disable-mid-ocean symbol) ) - :heap-base #x210 - :method-count-assert 29 - :size-assert #x27c - :flag-assert #x1d0210027c (:methods - (battlecontroller-method-20 () none 20) - (battlecontroller-idle () _type_ :state 21) - (battlecontroller-play-intro-camera () _type_ :state 22) - (battlecontroller-method-23 () none 23) - (battlecontroller-active () _type_ :state 24) - (battlecontroller-method-25 () none 25) - (battlecontroller-die () _type_ :state 26) - (battlecontroller-method-27 (_type_) none 27) - (cleanup-if-finished! (_type_) none 28) + (battlecontroller-method-20 () none) + (battlecontroller-idle () _type_ :state) + (battlecontroller-play-intro-camera () _type_ :state) + (battlecontroller-method-23 () none) + (battlecontroller-active () _type_ :state) + (battlecontroller-method-25 () none) + (battlecontroller-die () _type_ :state) + (battlecontroller-method-27 (_type_) none) + (cleanup-if-finished! (_type_) none) ) ) @@ -579,7 +569,7 @@ battlecontroller-default-event-handler :post #f ) -(defmethod relocate battlecontroller ((this battlecontroller) (arg0 int)) +(defmethod relocate ((this battlecontroller) (arg0 int)) (dotimes (v1-0 (-> this spawner-count)) (let ((a0-3 (-> this spawner-array v1-0))) (if (nonzero? (-> a0-3 path)) @@ -593,7 +583,7 @@ battlecontroller-default-event-handler (call-parent-method this arg0) ) -(defmethod deactivate battlecontroller ((this battlecontroller)) +(defmethod deactivate ((this battlecontroller)) (with-pp (let ((gp-0 pp)) (set! pp this) @@ -606,7 +596,7 @@ battlecontroller-default-event-handler ) ) -(defmethod battlecontroller-method-27 battlecontroller ((this battlecontroller)) +(defmethod battlecontroller-method-27 ((this battlecontroller)) (local-vars (sv-16 res-tag)) (set! (-> this fact) (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) @@ -749,7 +739,7 @@ battlecontroller-default-event-handler (none) ) -(defmethod cleanup-if-finished! battlecontroller ((this battlecontroller)) +(defmethod cleanup-if-finished! ((this battlecontroller)) (if (battlecontroller-task-completed?) (go (method-of-object this battlecontroller-die)) (go (method-of-object this battlecontroller-idle)) @@ -758,7 +748,7 @@ battlecontroller-default-event-handler (none) ) -(defmethod init-from-entity! battlecontroller ((this battlecontroller) (arg0 entity-actor)) +(defmethod init-from-entity! ((this battlecontroller) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) diff --git a/goal_src/jak1/levels/common/blocking-plane.gc b/goal_src/jak1/levels/common/blocking-plane.gc index 85dd5858687..25722aa4a60 100644 --- a/goal_src/jak1/levels/common/blocking-plane.gc +++ b/goal_src/jak1/levels/common/blocking-plane.gc @@ -9,10 +9,6 @@ (deftype blocking-plane (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states blocking-plane-idle ) diff --git a/goal_src/jak1/levels/common/launcherdoor.gc b/goal_src/jak1/levels/common/launcherdoor.gc index d3b288f866a..d64cffefb2c 100644 --- a/goal_src/jak1/levels/common/launcherdoor.gc +++ b/goal_src/jak1/levels/common/launcherdoor.gc @@ -9,17 +9,13 @@ ;; DECOMP BEGINS (deftype launcherdoor (process-drawable) - ((root-override collide-shape :offset 112) - (notify-player-passed-thru? symbol :offset-assert 176) - (thresh-y float :offset-assert 180) - (open-speed float :offset-assert 184) - (close-speed float :offset-assert 188) - (load-mode symbol :offset-assert 192) + ((root collide-shape :override) + (notify-player-passed-thru? symbol) + (thresh-y float) + (open-speed float) + (close-speed float) + (load-mode symbol) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xc4 - :flag-assert #x14006000c4 (:states (launcherdoor-closed symbol) (launcherdoor-open symbol) @@ -49,7 +45,7 @@ ) ) ) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (ja-no-eval :num! (seek! 0.0)) (when arg0 (ja :num-func num-func-identity :frame-num 0.0) @@ -104,7 +100,7 @@ (sound-play "ldoor-open") ) (set! (-> self draw force-lod) 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :num! (seek!)) (if arg0 (ja :num-func num-func-identity :frame-num max) @@ -112,7 +108,7 @@ (loop (when (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump) - (< (+ 4096.0 (-> self root-override trans y)) (-> *target* control trans y)) + (< (+ 4096.0 (-> self root trans y)) (-> *target* control trans y)) ) (when (and *target* (< (-> self thresh-y) (-> *target* control trans y))) (let ((a1-3 (res-lump-struct (-> self entity) 'continue-name structure))) @@ -133,7 +129,7 @@ :post ja-post ) -(defmethod init-from-entity! launcherdoor ((this launcherdoor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this launcherdoor) (arg0 entity-actor)) (set! (-> this notify-player-passed-thru?) #f) (set! (-> this open-speed) 4.0) (set! (-> this close-speed) 2.0) @@ -149,7 +145,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (cond @@ -199,7 +195,7 @@ name ) ) - (set! (-> this thresh-y) (+ -81920.0 (-> this root-override trans y))) + (set! (-> this thresh-y) (+ -81920.0 (-> this root trans y))) (if (and *target* (= (-> *target* control unknown-surface00 name) 'launch-jump)) (go launcherdoor-open #t) (go launcherdoor-closed #t) diff --git a/goal_src/jak1/levels/darkcave/darkcave-obs.gc b/goal_src/jak1/levels/darkcave/darkcave-obs.gc index 26089096f84..45bb267783d 100644 --- a/goal_src/jak1/levels/darkcave/darkcave-obs.gc +++ b/goal_src/jak1/levels/darkcave/darkcave-obs.gc @@ -8,30 +8,26 @@ ;; DECOMP BEGINS (deftype cavecrystal (process-drawable) - ((root-override collide-shape :offset 112) - (is-master? symbol :offset-assert 176) - (crystal-id int32 :offset-assert 180) - (glow-u float :offset-assert 184) - (glow-wf-period int32 :offset-assert 188) - (glow-wf-offset int32 :offset-assert 192) - (prev-compute-glow-time time-frame :offset-assert 200) - (start-fade-time time-frame :offset-assert 208) - (end-fade-time time-frame :offset-assert 216) - (activated-time time-frame :offset-assert 224) - (last-updated-user-lighting time-frame :offset-assert 232) - (player-attack-id uint64 :offset-assert 240) - (on-color-mult vector :inline :offset-assert 256) - (on-color-emissive vector :inline :offset-assert 272) - (off-color-mult vector :inline :offset-assert 288) - (off-color-emissive vector :inline :offset-assert 304) + ((root collide-shape :override) + (is-master? symbol) + (crystal-id int32) + (glow-u float) + (glow-wf-period int32) + (glow-wf-offset int32) + (prev-compute-glow-time time-frame) + (start-fade-time time-frame) + (end-fade-time time-frame) + (activated-time time-frame) + (last-updated-user-lighting time-frame) + (player-attack-id uint64) + (on-color-mult vector :inline) + (on-color-emissive vector :inline) + (off-color-mult vector :inline) + (off-color-emissive vector :inline) ) - :heap-base #xd0 - :method-count-assert 22 - :size-assert #x140 - :flag-assert #x1600d00140 (:methods - (update-connected-crystals! (_type_) none 20) - (compute-glow (_type_) float 21) + (update-connected-crystals! (_type_) none) + (compute-glow (_type_) float) ) (:states cavecrystal-active @@ -45,7 +41,7 @@ :bounds (static-spherem 0 4.7 0 5.4) ) -(defmethod update-connected-crystals! cavecrystal ((this cavecrystal)) +(defmethod update-connected-crystals! ((this cavecrystal)) (when (-> this is-master?) (let ((v1-2 (current-time))) (when (!= (-> this last-updated-user-lighting) v1-2) @@ -57,7 +53,7 @@ (none) ) -(defmethod compute-glow cavecrystal ((this cavecrystal)) +(defmethod compute-glow ((this cavecrystal)) (set! (-> this prev-compute-glow-time) (-> *display* game-frame-counter)) (let* ((gp-1 (max 1 (+ (- 1 (-> this activated-time)) (-> *display* game-frame-counter)))) (f0-2 (/ (the float (mod (+ (current-time) (-> this glow-wf-offset)) (-> this glow-wf-period))) @@ -98,7 +94,7 @@ ) ) :trans (behavior () - (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id darkcave-light-hint) "sksp0333" (the-as entity #f) *entity-pool* (game-task none)) ) (update-connected-crystals! self) @@ -179,7 +175,7 @@ ) ) -(defmethod deactivate cavecrystal ((this cavecrystal)) +(defmethod deactivate ((this cavecrystal)) (if (nonzero? (-> this sound)) (stop! (-> this sound)) ) @@ -187,7 +183,7 @@ (none) ) -(defmethod init-from-entity! cavecrystal ((this cavecrystal) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cavecrystal) (arg0 entity-actor)) (set! (-> this glow-u) 0.0) (set! (-> this player-attack-id) (the-as uint 0)) (set! (-> this last-updated-user-lighting) 0) @@ -207,7 +203,7 @@ ) (set! (-> s4-0 nav-radius) 4915.2) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (set! (-> this link) (new 'process 'actor-link-info this)) (set! (-> this crystal-id) (actor-count-before (-> this link))) @@ -222,7 +218,7 @@ ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *cavecrystal-sg* '()) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (set! (-> this draw color-mult quad) (-> this off-color-mult quad)) (set! (-> this draw color-emissive quad) (-> this off-color-emissive quad)) (ja-channel-push! 1 0) @@ -235,10 +231,10 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (cavecrystal-light-control-method-9 *cavecrystal-light-control* (-> this crystal-id) 0.0 this) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "crystal-on" :fo-max 80) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "crystal-on" :fo-max 80) (-> this root trans)) ) (go cavecrystal-idle) (none) diff --git a/goal_src/jak1/levels/demo/static-screen.gc b/goal_src/jak1/levels/demo/static-screen.gc index 5cf99e2139f..e1f216fa27b 100644 --- a/goal_src/jak1/levels/demo/static-screen.gc +++ b/goal_src/jak1/levels/demo/static-screen.gc @@ -8,20 +8,16 @@ ;; DECOMP BEGINS (deftype static-screen (process) - ((part sparticle-launch-control 1 :offset-assert 112) - (state-time time-frame :offset-assert 120) + ((part sparticle-launch-control 1) + (state-time time-frame) ) - :heap-base #x10 - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00100080 - (:methods - (idle (int time-frame symbol) _type_ :state 14) + (:state-methods + (idle int time-frame symbol) ) ) -(defmethod relocate static-screen ((this static-screen) (arg0 int)) +(defmethod relocate ((this static-screen) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -38,7 +34,7 @@ (the-as static-screen ((method-of-type process relocate) this arg0)) ) -(defmethod deactivate static-screen ((this static-screen)) +(defmethod deactivate ((this static-screen)) (dotimes (s5-0 1) (if (nonzero? (-> this part s5-0)) (kill-and-free-particles (-> this part s5-0)) diff --git a/goal_src/jak1/levels/finalboss/final-door.gc b/goal_src/jak1/levels/finalboss/final-door.gc index 857360f804e..9471d082a66 100644 --- a/goal_src/jak1/levels/finalboss/final-door.gc +++ b/goal_src/jak1/levels/finalboss/final-door.gc @@ -11,22 +11,17 @@ (deftype fin-door (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) (deftype final-door (process-drawable) () - :heap-base #x40 - :method-count-assert 23 - :size-assert #xb0 - :flag-assert #x17004000b0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (final-door-method-21 (_type_) none 21) - (open (symbol) _type_ :state 22) + (final-door-method-21 (_type_) none) + (open (symbol) _type_ :state) ) ) @@ -109,7 +104,7 @@ ) ) -(defmethod init-from-entity! final-door ((this final-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this final-door) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -137,19 +132,11 @@ (deftype power-left (final-door) () - :heap-base #x40 - :method-count-assert 23 - :size-assert #xb0 - :flag-assert #x17004000b0 ) (deftype power-right (final-door) () - :heap-base #x40 - :method-count-assert 23 - :size-assert #xb0 - :flag-assert #x17004000b0 ) @@ -180,32 +167,28 @@ ) ) -(defmethod final-door-method-21 power-left ((this power-left)) +(defmethod final-door-method-21 ((this power-left)) (initialize-skeleton this *power-left-sg* '()) 0 (none) ) -(defmethod final-door-method-21 power-right ((this power-right)) +(defmethod final-door-method-21 ((this power-right)) (initialize-skeleton this *power-right-sg* '()) 0 (none) ) (deftype powercellalt (process-drawable) - ((root-override collide-shape-moving :offset 112) - (jump-pos vector :inline :offset-assert 176) - (base vector :inline :offset-assert 192) - (index int32 :offset-assert 208) + ((root collide-shape-moving :override) + (jump-pos vector :inline) + (base vector :inline) + (index int32) ) - :heap-base #x70 - :method-count-assert 23 - :size-assert #xd4 - :flag-assert #x17007000d4 (:methods - (powercellalt-method-20 () none 20) - (jump () _type_ :state 21) - (idle () _type_ :state 22) + (powercellalt-method-20 () none) + (jump () _type_ :state) + (idle () _type_ :state) ) ) @@ -216,22 +199,22 @@ (sound-play "cell-prize") (let ((gp-1 (new 'stack 'trajectory))) (set! (-> self base y) (-> self jump-pos y)) - (setup-from-to-duration! gp-1 (-> self root-override trans) (-> self jump-pos) 300.0 -2.2755556) + (setup-from-to-duration! gp-1 (-> self root trans) (-> self jump-pos) 300.0 -2.2755556) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 1)) (let ((f0-2 (the float (- (current-time) (-> self state-time))))) - (eval-position! gp-1 f0-2 (-> self root-override trans)) + (eval-position! gp-1 f0-2 (-> self root trans)) ) (transform-post) - (spawn (-> self part) (the-as vector (-> self root-override root-prim prim-core))) + (spawn (-> self part) (the-as vector (-> self root root-prim prim-core))) (suspend) (if (nonzero? (-> self skel)) (ja :num! (loop! 0.5)) ) ) ) - (set! (-> self root-override trans quad) (-> self jump-pos quad)) - (set! (-> self base quad) (-> self root-override trans quad)) + (set! (-> self root trans quad) (-> self jump-pos quad)) + (set! (-> self base quad) (-> self root trans quad)) (transform-post) (sound-play "land-pcmetal" :pitch 2) (process-spawn @@ -242,7 +225,7 @@ #f #f #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to *entity-pool* ) (go-virtual idle) @@ -254,7 +237,7 @@ :code (behavior () (loop (vector<-cspace! - (-> self root-override trans) + (-> self root trans) (-> (the-as process-drawable (-> self parent 0)) node-list data (-> self index)) ) (transform-post) @@ -279,16 +262,16 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg1 quad)) (set! (-> self jump-pos quad) (-> arg2 quad)) - (set-vector! (-> self root-override scale) 0.5 0.5 0.5 1.0) + (set-vector! (-> self root scale) 0.5 0.5 0.5 1.0) (set! (-> self index) arg3) (initialize-skeleton self *powercellalt-sg* '()) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 63) self)) enter-state - (-> self root-override trans) + (-> self root trans) (-> self jump-pos) (go-virtual jump) (none) diff --git a/goal_src/jak1/levels/finalboss/green-eco-lurker.gc b/goal_src/jak1/levels/finalboss/green-eco-lurker.gc index 7026f034844..39e8c4ee73b 100644 --- a/goal_src/jak1/levels/finalboss/green-eco-lurker.gc +++ b/goal_src/jak1/levels/finalboss/green-eco-lurker.gc @@ -8,17 +8,13 @@ ;; DECOMP BEGINS (deftype green-eco-lurker (nav-enemy) - ((played-sound? symbol :offset-assert 400) - (sound-delay int32 :offset-assert 404) - (appear-dest vector :inline :offset-assert 416) - (traj trajectory :inline :offset-assert 432) + ((played-sound? symbol) + (sound-delay int32) + (appear-dest vector :inline) + (traj trajectory :inline) ) - :heap-base #x170 - :method-count-assert 76 - :size-assert #x1d8 - :flag-assert #x4c017001d8 (:methods - (green-eco-lurker-method-51 (_type_ vector) symbol :replace 51) + (nav-enemy-method-51 (_type_ vector) symbol :replace) ) (:states green-eco-lurker-appear @@ -30,14 +26,10 @@ (deftype green-eco-lurker-gen (process-drawable) - ((num-to-spawn int32 :offset-assert 176) - (num-spawned int32 :offset-assert 180) - (num-alive int32 :offset-assert 184) + ((num-to-spawn int32) + (num-spawned int32) + (num-alive int32) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states spawn-minions ) @@ -294,7 +286,7 @@ ) ) -(defmethod attack-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) (cond ((= (-> arg0 type) target) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) @@ -309,7 +301,7 @@ ) ) -(defmethod nav-enemy-attack-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod nav-enemy-attack-handler ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) (cond ((= (-> arg0 type) target) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) @@ -323,7 +315,7 @@ ) ) -(defmethod touch-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) @@ -337,7 +329,7 @@ ) ) -(defmethod nav-enemy-touch-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod nav-enemy-touch-handler ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) @@ -351,7 +343,7 @@ ) ) -(defmethod green-eco-lurker-method-51 green-eco-lurker ((this green-eco-lurker) (arg0 vector)) +(defmethod nav-enemy-method-51 ((this green-eco-lurker) (arg0 vector)) (when (or (not *target*) (>= (vector-vector-xz-distance arg0 (target-pos 0)) 36864.0)) (let ((v1-3 (new 'stack-no-clear 'vector))) (set! (-> v1-3 quad) (-> arg0 quad)) @@ -364,7 +356,7 @@ #f ) -(defmethod nav-enemy-method-52 green-eco-lurker ((this green-eco-lurker) (arg0 vector)) +(defmethod nav-enemy-method-52 ((this green-eco-lurker) (arg0 vector)) (let ((s4-0 (-> this path curve num-cverts))) (when (> s4-0 0) (let ((s2-0 (nav-enemy-rnd-int-count s4-0)) @@ -372,7 +364,7 @@ ) (while (> s3-0 0) (eval-path-curve-div! (-> this path) arg0 (the float s2-0) 'interp) - (if (green-eco-lurker-method-51 this arg0) + (if (nav-enemy-method-51 this arg0) (return #t) ) (set! s2-0 (mod (+ s2-0 1) s4-0)) @@ -416,7 +408,7 @@ ) ) -(defmethod nav-enemy-method-53 green-eco-lurker ((this green-eco-lurker)) +(defmethod nav-enemy-method-53 ((this green-eco-lurker)) (the-as symbol (cond ((and (-> this draw shadow) (zero? (-> this draw cur-lod)) @@ -648,7 +640,7 @@ ) ) -(defmethod initialize-collision green-eco-lurker ((this green-eco-lurker)) +(defmethod initialize-collision ((this green-eco-lurker)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -728,7 +720,7 @@ (none) ) -(defmethod nav-enemy-method-48 green-eco-lurker ((this green-eco-lurker)) +(defmethod nav-enemy-method-48 ((this green-eco-lurker)) (initialize-skeleton this *green-eco-lurker-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) (logclear! (-> this collide-info nav-flags) (nav-flags navf0)) diff --git a/goal_src/jak1/levels/finalboss/light-eco.gc b/goal_src/jak1/levels/finalboss/light-eco.gc index da10b783506..4dce6400d1d 100644 --- a/goal_src/jak1/levels/finalboss/light-eco.gc +++ b/goal_src/jak1/levels/finalboss/light-eco.gc @@ -8,21 +8,17 @@ ;; DECOMP BEGINS (deftype light-eco-child (process-drawable) - ((root-override collide-shape :offset 112) - (angle-bit int32 :offset-assert 176) - (ground-y float :offset-assert 180) - (falling-start-time time-frame :offset-assert 184) - (last-update-time time-frame :offset-assert 192) - (rot vector :inline :offset-assert 208) - (rotv vector :inline :offset-assert 224) - (traj trajectory :inline :offset-assert 240) + ((root collide-shape :override) + (angle-bit int32) + (ground-y float) + (falling-start-time time-frame) + (last-update-time time-frame) + (rot vector :inline) + (rotv vector :inline) + (traj trajectory :inline) ) - :heap-base #xb0 - :method-count-assert 21 - :size-assert #x118 - :flag-assert #x1500b00118 (:methods - (common-trans (_type_) none 20) + (common-trans (_type_) none) ) (:states light-eco-child-appear @@ -35,20 +31,16 @@ (deftype light-eco-mother (process-drawable) - ((player-got-eco? symbol :offset-assert 176) - (angle-mask int64 :offset-assert 184) - (delay-til-spawn int32 :offset-assert 192) - (part2 sparticle-launch-control :offset-assert 196) - (last-update-time time-frame :offset-assert 200) - (last-spawned-time time-frame :offset-assert 208) + ((player-got-eco? symbol) + (angle-mask int64) + (delay-til-spawn int32) + (part2 sparticle-launch-control) + (last-update-time time-frame) + (last-spawned-time time-frame) ) - :heap-base #x70 - :method-count-assert 22 - :size-assert #xd8 - :flag-assert #x16007000d8 (:methods - (spawn-child-eco (_type_) symbol 20) - (common-trans (_type_) none 21) + (spawn-child-eco (_type_) symbol) + (common-trans (_type_) none) ) (:states light-eco-mother-active @@ -358,7 +350,7 @@ ) ) -(defmethod common-trans light-eco-child ((this light-eco-child)) +(defmethod common-trans ((this light-eco-child)) (let ((v1-1 (current-time))) (when (!= v1-1 (-> this last-update-time)) (set! (-> this last-update-time) v1-1) @@ -370,9 +362,9 @@ (set! (-> s4-0 w) (+ f30-0 (* (-> this rotv w) (seconds-per-frame)))) (set-vector! s5-0 (cos (-> s4-0 x)) (cos (-> s4-0 y)) (cos (-> s4-0 z)) 1.0) (vector-normalize! s5-0 1.0) - (quaternion-vector-angle! (-> this root-override quat) s5-0 f30-0) + (quaternion-vector-angle! (-> this root quat) s5-0 f30-0) ) - (spawn (-> this part) (-> this root-override trans)) + (spawn (-> this part) (-> this root trans)) ) ) (none) @@ -385,7 +377,7 @@ ) :trans (behavior () (let ((f30-0 (fmin (the float (- (current-time) (-> self falling-start-time))) (-> self traj time)))) - (eval-position! (-> self traj) f30-0 (-> self root-override trans)) + (eval-position! (-> self traj) f30-0 (-> self root trans)) (if (= f30-0 (-> self traj time)) (go light-eco-child-hit-ground) ) @@ -407,32 +399,30 @@ (set-time! (-> self state-time)) ) :trans (behavior () - (let ((f30-0 (+ (-> self root-override transv y) (* -544768.0 (seconds-per-frame))))) - (when (and (< f30-0 0.0) (>= (-> self ground-y) (-> self root-override trans y))) + (let ((f30-0 (+ (-> self root transv y) (* -544768.0 (seconds-per-frame))))) + (when (and (< f30-0 0.0) (>= (-> self ground-y) (-> self root trans y))) (if (>= 4096.0 (fabs f30-0)) (go light-eco-child-idle) ) - (set! (-> self root-override transv y) 0.0) - (vector-normalize! (-> self root-override transv) (* 0.25 (vector-xz-length (-> self root-override transv)))) + (set! (-> self root transv y) 0.0) + (vector-normalize! (-> self root transv) (* 0.25 (vector-xz-length (-> self root transv)))) (set! f30-0 (* 0.35 (- f30-0))) ) - (set! (-> self root-override transv y) f30-0) + (set! (-> self root transv y) f30-0) ) - (vector-v+! (-> self root-override trans) (-> self root-override trans) (-> self root-override transv)) - (let ((f0-8 (vector-vector-xz-distance - (-> self root-override trans) - (-> (the-as light-eco-mother (-> self parent 0)) root trans) - ) - ) + (vector-v+! (-> self root trans) (-> self root trans) (-> self root transv)) + (let ((f0-8 + (vector-vector-xz-distance (-> self root trans) (-> (the-as light-eco-mother (-> self parent 0)) root trans)) + ) ) (when (< 92610.56 f0-8) (let ((gp-1 (new 'stack-no-clear 'vector))) - (vector-! gp-1 (-> self root-override trans) (-> (the-as light-eco-mother (-> self parent 0)) root trans)) + (vector-! gp-1 (-> self root trans) (-> (the-as light-eco-mother (-> self parent 0)) root trans)) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 92610.56) (vector+! gp-1 gp-1 (-> (the-as light-eco-mother (-> self parent 0)) root trans)) - (set! (-> gp-1 y) (-> self root-override trans y)) - (set! (-> self root-override trans quad) (-> gp-1 quad)) + (set! (-> gp-1 y) (-> self root trans y)) + (set! (-> self root trans quad) (-> gp-1 quad)) ) ) ) @@ -470,7 +460,7 @@ (defstate light-eco-child-die (light-eco-child) :code (behavior () (send-event (ppointer->process (-> self parent)) 'untrigger (-> self angle-bit)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (logior! (-> self draw status) (draw-status hidden)) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 0.1)) @@ -515,13 +505,13 @@ ) (set! (-> s4-2 nav-radius) (* 0.75 (-> s4-2 root-prim local-sphere w))) (backup-collide-with-as s4-2) - (set! (-> self root-override) s4-2) + (set! (-> self root) s4-2) ) - (set! (-> self root-override trans quad) (-> arg1 quad)) - (set-vector! (-> self root-override scale) 2.0 2.0 2.0 1.0) - (quaternion-identity! (-> self root-override quat)) - (setup-from-to-height! (-> self traj) (-> self root-override trans) arg2 4096.0 -4.551111) - (let ((s4-3 (-> self root-override transv))) + (set! (-> self root trans quad) (-> arg1 quad)) + (set-vector! (-> self root scale) 2.0 2.0 2.0 1.0) + (quaternion-identity! (-> self root quat)) + (setup-from-to-height! (-> self traj) (-> self root trans) arg2 4096.0 -4.551111) + (let ((s4-3 (-> self root transv))) (vector-! s4-3 arg2 arg1) (set! (-> s4-3 y) 0.0) (vector-normalize! s4-3 163840.0) @@ -538,7 +528,7 @@ (none) ) -(defmethod common-trans light-eco-mother ((this light-eco-mother)) +(defmethod common-trans ((this light-eco-mother)) (let ((v1-1 (current-time))) (when (!= v1-1 (-> this last-update-time)) (set! (-> this last-update-time) v1-1) @@ -574,7 +564,7 @@ (none) ) -(defmethod spawn-child-eco light-eco-mother ((this light-eco-mother)) +(defmethod spawn-child-eco ((this light-eco-mother)) (countdown (s3-0 4) (let ((gp-0 (rand-vu-int-count 32))) (when (not (logtest? (-> this angle-mask) (ash 1 gp-0))) @@ -682,7 +672,7 @@ :post ja-post ) -(defmethod deactivate light-eco-mother ((this light-eco-mother)) +(defmethod deactivate ((this light-eco-mother)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -690,7 +680,7 @@ (none) ) -(defmethod relocate light-eco-mother ((this light-eco-mother) (arg0 int)) +(defmethod relocate ((this light-eco-mother) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) diff --git a/goal_src/jak1/levels/finalboss/robotboss-h.gc b/goal_src/jak1/levels/finalboss/robotboss-h.gc index 186e118186f..0997f778ac3 100644 --- a/goal_src/jak1/levels/finalboss/robotboss-h.gc +++ b/goal_src/jak1/levels/finalboss/robotboss-h.gc @@ -8,63 +8,56 @@ ;; DECOMP BEGINS (deftype robotboss-dda (structure) - ((blue-bomb-time float :offset-assert 0) - (num-blobs int32 :offset-assert 4) - (green-bomb-time float :offset-assert 8) - (red-shots-min int32 :offset-assert 12) - (red-shots-rnd int32 :offset-assert 16) - (red-shot-time-min float :offset-assert 20) - (red-shot-time-rnd float :offset-assert 24) - (red-bomb-time float :offset-assert 28) - (yellow-shot-time-min float :offset-assert 32) - (yellow-shot-time-rnd float :offset-assert 36) - (yellow-gun-hits int32 :offset-assert 40) - (yellow-bomb-time float :offset-assert 44) + ((blue-bomb-time float) + (num-blobs int32) + (green-bomb-time float) + (red-shots-min int32) + (red-shots-rnd int32) + (red-shot-time-min float) + (red-shot-time-rnd float) + (red-bomb-time float) + (yellow-shot-time-min float) + (yellow-shot-time-rnd float) + (yellow-gun-hits int32) + (yellow-bomb-time float) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype robotboss (process-drawable) - ((root-override collide-shape-moving :offset 112) - (alts entity-actor 13 :offset-assert 176) - (desired-loc vector :inline :offset-assert 240) - (old-loc vector :inline :offset-assert 256) - (loc-t float :offset-assert 272) - (loc-t-start time-frame :offset-assert 280) - (loc-t-duration time-frame :offset-assert 288) - (hits-to-go int32 :offset-assert 296) - (took-hit symbol :offset-assert 300) - (children-spawned int32 :offset-assert 304) - (vulnerable int64 :offset-assert 312) - (till-next-shot int64 :offset-assert 320) - (shot-attractor handle :offset-assert 328) - (desired-pool-y float :offset-assert 336) - (particle sparticle-launch-control 7 :offset-assert 340) - (blue-smoke symbol :offset-assert 368) - (red-smoke symbol :offset-assert 372) - (yellow-smoke symbol :offset-assert 376) - (white-eco handle :offset-assert 384) - (des-cam-entity string :offset-assert 392) - (use-interesting symbol :offset-assert 396) - (ignore-camera symbol :offset-assert 400) - (ambient ambient-control :inline :offset-assert 408) - (yellow-gun joint-mod :offset-assert 424) - (palette-val float :offset-assert 428) - (looping-sound ambient-sound 4 :offset-assert 432) - (dda robotboss-dda :offset-assert 448) - (valid-frames int32 :offset-assert 452) - (skip-cut symbol :offset-assert 456) - (keep-charging symbol :offset-assert 460) + ((root collide-shape-moving :override) + (alts entity-actor 13) + (desired-loc vector :inline) + (old-loc vector :inline) + (loc-t float) + (loc-t-start time-frame) + (loc-t-duration time-frame) + (hits-to-go int32) + (took-hit symbol) + (children-spawned int32) + (vulnerable int64) + (till-next-shot int64) + (shot-attractor handle) + (desired-pool-y float) + (particle sparticle-launch-control 7) + (blue-smoke symbol) + (red-smoke symbol) + (yellow-smoke symbol) + (white-eco handle) + (des-cam-entity string) + (use-interesting symbol) + (ignore-camera symbol) + (ambient ambient-control :inline) + (yellow-gun joint-mod) + (palette-val float) + (looping-sound ambient-sound 4) + (dda robotboss-dda) + (valid-frames int32) + (skip-cut symbol) + (keep-charging symbol) ) - :heap-base #x160 - :method-count-assert 21 - :size-assert #x1d0 - :flag-assert #x15016001d0 (:methods - (ease-loc-t (_type_) float 20) + (ease-loc-t (_type_) float) ) (:states robotboss-blue-dark-bomb @@ -88,7 +81,7 @@ ) -(defmethod relocate robotboss ((this robotboss) (arg0 int)) +(defmethod relocate ((this robotboss) (arg0 int)) (dotimes (v1-0 7) (if (nonzero? (-> this particle v1-0)) (&+! (-> this particle v1-0) arg0) @@ -105,7 +98,7 @@ (the-as robotboss ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate robotboss ((this robotboss)) +(defmethod deactivate ((this robotboss)) (dotimes (s5-0 7) (let ((a0-1 (-> this particle s5-0))) (if (nonzero? a0-1) diff --git a/goal_src/jak1/levels/finalboss/robotboss-misc.gc b/goal_src/jak1/levels/finalboss/robotboss-misc.gc index bc08982fa29..461357a0e8e 100644 --- a/goal_src/jak1/levels/finalboss/robotboss-misc.gc +++ b/goal_src/jak1/levels/finalboss/robotboss-misc.gc @@ -86,23 +86,16 @@ ) (deftype ecoclaw-part-info (structure) - ((tracker handle :offset-assert 0) - (kind basic :offset-assert 8) - (trans vector :inline :offset-assert 16) + ((tracker handle) + (kind basic) + (trans vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype ecoclaw (process-drawable) - ((particles ecoclaw-part-info 3 :inline :offset-assert 176) + ((particles ecoclaw-part-info 3 :inline) ) - :heap-base #xa0 - :method-count-assert 20 - :size-assert #x110 - :flag-assert #x1400a00110 (:states ecoclaw-activate ecoclaw-idle @@ -261,7 +254,7 @@ :post ja-post ) -(defmethod init-from-entity! ecoclaw ((this ecoclaw) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ecoclaw) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *ecoclaw-sg* '()) @@ -275,15 +268,11 @@ ) (deftype silodoor (process-drawable) - ((part-opened float :offset-assert 176) + ((part-opened float) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xb4 - :flag-assert #x16005000b4 - (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) + (:state-methods + idle + hidden ) ) @@ -350,7 +339,7 @@ ) ) -(defmethod init-from-entity! silodoor ((this silodoor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this silodoor) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -420,12 +409,8 @@ ) (deftype finalbosscam (process-taskable) - ((robotboss handle :offset-assert 384) + ((robotboss handle) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x188 - :flag-assert #x3501200188 ) @@ -443,10 +428,10 @@ (none) ) -(defmethod play-anim! finalbosscam ((this finalbosscam) (arg0 symbol)) +(defmethod play-anim! ((this finalbosscam) (arg0 symbol)) (when arg0 (set! (-> this robotboss) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *robotboss-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *robotboss-sg* #f :to this)) ) (send-event (handle->process (-> this robotboss)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this robotboss)) 'center-joint 3) @@ -470,11 +455,11 @@ (the-as basic (new 'static 'spool-anim :name "finalbosscam-white-eco" :index 3 :parts 3 :command-list '())) ) -(defmethod get-art-elem finalbosscam ((this finalbosscam)) +(defmethod get-art-elem ((this finalbosscam)) (-> this draw art-group data 2) ) -(defmethod should-display? finalbosscam ((this finalbosscam)) +(defmethod should-display? ((this finalbosscam)) #f ) diff --git a/goal_src/jak1/levels/finalboss/robotboss-weapon.gc b/goal_src/jak1/levels/finalboss/robotboss-weapon.gc index d0ccbc9d86e..feea1e79aa7 100644 --- a/goal_src/jak1/levels/finalboss/robotboss-weapon.gc +++ b/goal_src/jak1/levels/finalboss/robotboss-weapon.gc @@ -8,24 +8,21 @@ ;; DECOMP BEGINS (deftype torus (structure) - ((origin vector :inline :offset-assert 0) - (axis vector :inline :offset-assert 16) - (radius-primary float :offset-assert 32) - (radius-secondary float :offset-assert 36) + ((origin vector :inline) + (axis vector :inline) + (radius-primary float) + (radius-secondary float) ) - :method-count-assert 13 - :size-assert #x28 - :flag-assert #xd00000028 (:methods - (torus-method-9 (_type_ vector) none 9) - (torus-method-10 (_type_ collide-prim-core vector) symbol 10) - (torus-method-11 (_type_ vector) symbol 11) - (torus-method-12 (_type_ vector) vector 12) + (torus-method-9 (_type_ vector) none) + (torus-method-10 (_type_ collide-prim-core vector) symbol) + (torus-method-11 (_type_ vector) symbol) + (torus-method-12 (_type_ vector) vector) ) ) -(defmethod torus-method-10 torus ((this torus) (arg0 collide-prim-core) (arg1 vector)) +(defmethod torus-method-10 ((this torus) (arg0 collide-prim-core) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (f30-0 (+ (-> this radius-secondary) (-> arg0 world-sphere w))) @@ -38,7 +35,7 @@ ) ) -(defmethod torus-method-11 torus ((this torus) (arg0 vector)) +(defmethod torus-method-11 ((this torus) (arg0 vector)) (let ((s4-0 (the-as collide-shape-prim-group (-> *target* control root-prim)))) (when (and (logtest? (-> s4-0 prim-core collide-as) (collide-kind target)) (torus-method-10 this (-> s4-0 prim-core) arg0) @@ -59,15 +56,12 @@ ) (deftype torus-verts (structure) - ((vert vector 8 :inline :offset-assert 0) + ((vert vector 8 :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) -(defmethod torus-method-9 torus ((this torus) (arg0 vector)) +(defmethod torus-method-9 ((this torus) (arg0 vector)) (local-vars (sv-256 int) (sv-272 int) (sv-288 int)) (let ((s0-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -117,7 +111,7 @@ (none) ) -(defmethod torus-method-12 torus ((this torus) (arg0 vector)) +(defmethod torus-method-12 ((this torus) (arg0 vector)) (let* ((f30-0 65536.0) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-2 (the-as number (logior #x3f800000 v1-1))) @@ -147,16 +141,12 @@ ) (deftype arcing-shot (process-drawable) - ((root-override collide-shape-moving :offset 112) - (y-vel float :offset-assert 176) - (grav float :offset-assert 180) - (from vector :inline :offset-assert 192) - (to vector :inline :offset-assert 208) + ((root collide-shape-moving :override) + (y-vel float) + (grav float) + (from vector :inline) + (to vector :inline) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xe0 - :flag-assert #x14007000e0 (:states arcing-shot-debug-trajectory ) @@ -216,15 +206,11 @@ ) (deftype darkecobomb (arcing-shot) - ((flight-time time-frame :offset-assert 224) - (countdown-time float :offset-assert 232) - (anim-speed float :offset-assert 236) - (next-tick float :offset-assert 240) + ((flight-time time-frame) + (countdown-time float) + (anim-speed float) + (next-tick float) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #xf4 - :flag-assert #x14009000f4 (:states darkecobomb-countdown (darkecobomb-explode symbol) @@ -253,7 +239,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (logior! (-> self draw status) (draw-status hidden)) @@ -332,7 +318,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (+! (-> self next-tick) -0.06) @@ -403,7 +389,7 @@ ) :trans (behavior () (arcing-shot-calculate - (-> self root-override trans) + (-> self root trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) ) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time)) @@ -445,9 +431,9 @@ ) (set! (-> s1-0 nav-radius) (* 0.75 (-> s1-0 root-prim local-sphere w))) (backup-collide-with-as s1-0) - (set! (-> self root-override) s1-0) + (set! (-> self root) s1-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *darkecobomb-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 639) self)) @@ -460,12 +446,8 @@ ) (deftype greenshot (arcing-shot) - ((flight-time time-frame :offset-assert 224) + ((flight-time time-frame) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xe8 - :flag-assert #x14008000e8 (:states greenshot-idle ) @@ -483,13 +465,13 @@ ) :trans (behavior () (arcing-shot-calculate - (-> self root-override trans) + (-> self root trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) ) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time)) (deactivate self) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) ) :code (behavior () (loop @@ -519,9 +501,9 @@ ) (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) (backup-collide-with-as s2-0) - (set! (-> self root-override) s2-0) + (set! (-> self root) s2-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *greenshot-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (arcing-shot-setup arg0 arg1 arg2) @@ -533,18 +515,14 @@ ) (deftype redshot (arcing-shot) - ((flight-time time-frame :offset-assert 224) - (stall-time time-frame :offset-assert 232) - (ring torus :inline :offset-assert 240) - (rotation-offset int64 :offset-assert 280) - (part-track handle :offset-assert 288) - (shot-particle sparticle-launch-control :offset-assert 296) - (test-particle sparticle-launch-control :offset-assert 300) + ((flight-time time-frame) + (stall-time time-frame) + (ring torus :inline) + (rotation-offset int64) + (part-track handle) + (shot-particle sparticle-launch-control) + (test-particle sparticle-launch-control) ) - :heap-base #xc0 - :method-count-assert 20 - :size-assert #x130 - :flag-assert #x1400c00130 (:states redshot-explode redshot-idle @@ -553,7 +531,7 @@ ) -(defmethod relocate redshot ((this redshot) (arg0 int)) +(defmethod relocate ((this redshot) (arg0 int)) (if (nonzero? (-> this shot-particle)) (&+! (-> this shot-particle) arg0) ) @@ -563,7 +541,7 @@ (the-as redshot ((method-of-type arcing-shot relocate) this arg0)) ) -(defmethod deactivate redshot ((this redshot)) +(defmethod deactivate ((this redshot)) (if (nonzero? (-> this shot-particle)) (kill-and-free-particles (-> this shot-particle)) ) @@ -597,10 +575,10 @@ (* 436.90668 (the float (+ (-> self rotation-offset) (-> *display* game-frame-counter)))) (* 291.27112 (the float (+ (-> self rotation-offset) (-> *display* game-frame-counter)))) ) - (matrix->quaternion (-> self root-override quat) s5-0) + (matrix->quaternion (-> self root quat) s5-0) ) (if (< (* 0.006666667 (the float (min 150 arg0))) 1.0) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) ) (none) ) @@ -610,9 +588,9 @@ (set! (-> self state-time) (-> *display* game-frame-counter)) (sound-play "red-explode") (logclear! (-> self draw status) (draw-status hidden)) - (quaternion-identity! (-> self root-override quat)) + (quaternion-identity! (-> self root quat)) (set! (-> self ring radius-secondary) 3072.0) - (set! (-> self ring origin quad) (-> self root-override trans quad)) + (set! (-> self ring origin quad) (-> self root trans quad)) (+! (-> self ring origin y) (-> self ring radius-secondary)) (set-vector! (-> self ring axis) 0.0 1.0 0.0 1.0) (set! (-> self part-track) (ppointer->handle (process-spawn @@ -623,7 +601,7 @@ redshot-particle-callback (-> self ppointer) #f - (-> self root-override trans) + (-> self root trans) :to self ) ) @@ -687,7 +665,7 @@ (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self stall-time)) (go redshot-explode) ) - (spawn (-> self shot-particle) (-> self root-override trans)) + (spawn (-> self shot-particle) (-> self root trans)) ) :code (behavior () (loop @@ -705,13 +683,13 @@ :trans (behavior () (redshot-trans (seconds 5)) (arcing-shot-calculate - (-> self root-override trans) + (-> self root trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) ) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time)) (go redshot-wait) ) - (spawn (-> self shot-particle) (-> self root-override trans)) + (spawn (-> self shot-particle) (-> self root trans)) ) :code (behavior () (loop @@ -739,9 +717,9 @@ (set-root-prim! s0-0 sv-16) (set! (-> s0-0 nav-radius) (* 0.75 (-> s0-0 root-prim local-sphere w))) (backup-collide-with-as s0-0) - (set! (-> self root-override) s0-0) + (set! (-> self root) s0-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *redring-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (arcing-shot-setup arg0 arg1 arg2) @@ -753,19 +731,15 @@ (set! (-> self test-particle) (create-launch-control (-> *part-group-id-table* 679) self)) (logior! (-> self draw status) (draw-status hidden)) (set! (-> self sound) - (new 'process 'ambient-sound (static-sound-spec "red-fireball" :fo-max 80) (-> self root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "red-fireball" :fo-max 80) (-> self root trans)) ) (go redshot-idle) (none) ) (deftype yellowshot (arcing-shot) - ((flight-time time-frame :offset-assert 224) + ((flight-time time-frame) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xe8 - :flag-assert #x14008000e8 (:states yellowshot-idle ) @@ -788,10 +762,10 @@ ) :trans (behavior () (arcing-shot-calculate - (-> self root-override trans) + (-> self root trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (when (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time)) (send-event (ppointer->process (-> self parent)) 'missed-jak) (deactivate self) @@ -822,9 +796,9 @@ ) (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) (backup-collide-with-as s2-0) - (set! (-> self root-override) s2-0) + (set! (-> self root) s2-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *redring-sg* '()) (logior! (-> self draw status) (draw-status hidden)) (arcing-shot-setup arg0 arg1 arg2) diff --git a/goal_src/jak1/levels/finalboss/robotboss.gc b/goal_src/jak1/levels/finalboss/robotboss.gc index d7b03e6f246..8c7f6a8e64d 100644 --- a/goal_src/jak1/levels/finalboss/robotboss.gc +++ b/goal_src/jak1/levels/finalboss/robotboss.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod ease-loc-t robotboss ((this robotboss)) +(defmethod ease-loc-t ((this robotboss)) (parameter-ease-sin-clamp (-> this loc-t)) ) @@ -52,7 +52,7 @@ (else (logior! (-> self skel status) (janim-status inited)) (process-grab? *target*) - (set! (-> *camera-other-root* quad) (-> self root-override trans quad)) + (set! (-> *camera-other-root* quad) (-> self root trans quad)) (let ((s5-1 (-> self node-list data 88 bone transform)) (gp-1 (-> self node-list data 88 bone scale)) ) @@ -150,9 +150,7 @@ (b! (not (and (-> self des-cam-entity) (or (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 188416.0) - (and *target* - (>= 290816.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (and *target* (>= 290816.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) ) ) ) @@ -172,9 +170,7 @@ (label cfg-37) (b! (not (or (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 73728.0) - (and *target* - (>= 290816.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (and *target* (>= 290816.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) ) ) cfg-49 @@ -188,9 +184,7 @@ (label cfg-49) (when (and (< 196608.0 (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0))) (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 614400.0) - (not (and *target* - (>= 299008.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (not (and *target* (>= 299008.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) ) ) (when (not (send-event *camera* 'query-state cam-string)) @@ -233,7 +227,7 @@ (let ((gp-0 (new 'stack 'sphere))) (set! (-> gp-0 w) 4096.0) (set! (-> self shot-attractor) - (ppointer->handle (manipy-spawn (-> self root-override trans) (-> self entity) *redring-sg* gp-0 :to self)) + (ppointer->handle (manipy-spawn (-> self root trans) (-> self entity) *redring-sg* gp-0 :to self)) ) ) (send-event (handle->process (-> self shot-attractor)) 'attackable #t) @@ -293,12 +287,12 @@ (matrix-rotate-y! s4-0 (-> gp-0 x)) (set! (-> gp-0 x) 0.0) (vector-matrix*! gp-0 gp-0 s4-0) - (vector+! (-> self root-override trans) gp-0 (-> self entity extra trans)) + (vector+! (-> self root trans) gp-0 (-> self entity extra trans)) (vector-negate! (the-as vector (-> s4-0 vector)) (the-as vector (-> s4-0 vector))) (vector-negate! (-> s4-0 vector 2) (-> s4-0 vector 2)) - (matrix->quaternion (-> self root-override quat) s4-0) + (matrix->quaternion (-> self root quat) s4-0) ) - (vector-! gp-0 s5-0 (-> self root-override trans)) + (vector-! gp-0 s5-0 (-> self root trans)) (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 (the-as float 204800.0)) (set! (-> gp-0 y) 32768.0) @@ -398,7 +392,7 @@ (let ((a0-5 (-> arg3 param 0))) (when (and a0-5 ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry a0-5) - (-> self root-override) + (-> self root) (the-as uint (-> self vulnerable)) ) ) @@ -960,10 +954,8 @@ ) ) ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 3 collide-with) - (collide-kind) - ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 3 prim-core collide-as) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 3 collide-with) (collide-kind)) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 3 prim-core collide-as) (collide-kind) ) (set! (-> self use-interesting) #f) @@ -1002,10 +994,10 @@ :to *entity-pool* ) ) - (let ((gp-1 (manipy-spawn (-> self root-override trans) (-> self entity) *robotboss-yelloweco-sg* #f :to self))) + (let ((gp-1 (manipy-spawn (-> self root trans) (-> self entity) *robotboss-yelloweco-sg* #f :to self))) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-1) 'anim-mode 'play1) - (send-event (ppointer->process gp-1) 'rot-quat (-> self root-override quat)) + (send-event (ppointer->process gp-1) 'rot-quat (-> self root quat)) ;; og:preserve-this the zero passed here was missing in the original game, but is a bug that causes undefined behavior (send-event (ppointer->process gp-1) 'art-joint-anim "robotboss-yelloweco-yellow-last-hit" 0) ) @@ -1294,22 +1286,16 @@ ) (deftype redshot-launch-info (structure) - ((dest vector :inline :offset-assert 0) - (flight-time time-frame :offset-assert 16) - (stall-time time-frame :offset-assert 24) + ((dest vector :inline) + (flight-time time-frame) + (stall-time time-frame) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype redshot-launch-array (structure) - ((info redshot-launch-info 6 :inline :offset-assert 0) + ((info redshot-launch-info 6 :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) @@ -1521,10 +1507,8 @@ ) ) ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 5 collide-with) - (collide-kind) - ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 5 prim-core collide-as) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 5 collide-with) (collide-kind)) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 5 prim-core collide-as) (collide-kind) ) (set! (-> self use-interesting) #f) @@ -1586,10 +1570,10 @@ :to *entity-pool* ) ) - (let ((gp-1 (manipy-spawn (-> self root-override trans) (-> self entity) *robotboss-redeco-sg* #f :to self))) + (let ((gp-1 (manipy-spawn (-> self root trans) (-> self entity) *robotboss-redeco-sg* #f :to self))) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-1) 'anim-mode 'play1) - (send-event (ppointer->process gp-1) 'rot-quat (-> self root-override quat)) + (send-event (ppointer->process gp-1) 'rot-quat (-> self root quat)) ;; og:preserve-this the zero passed here was missing in the original game, but is a bug that causes undefined behavior (send-event (ppointer->process gp-1) 'art-joint-anim "robotboss-redeco-red-last-hit" 0) ) @@ -1987,10 +1971,8 @@ ) ) ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 9 collide-with) - (collide-kind) - ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 9 prim-core collide-as) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 9 collide-with) (collide-kind)) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 9 prim-core collide-as) (collide-kind) ) (set! (-> self des-cam-entity) #f) @@ -2487,10 +2469,8 @@ ) ) ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 collide-with) - (collide-kind) - ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core collide-as) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 collide-with) (collide-kind)) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core collide-as) (collide-kind) ) (set! (-> self use-interesting) #f) @@ -2532,10 +2512,10 @@ :to *entity-pool* ) ) - (let ((gp-2 (manipy-spawn (-> self root-override trans) (-> self entity) *robotboss-blueeco-sg* #f :to self))) + (let ((gp-2 (manipy-spawn (-> self root trans) (-> self entity) *robotboss-blueeco-sg* #f :to self))) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-2) 'anim-mode 'play1) - (send-event (ppointer->process gp-2) 'rot-quat (-> self root-override quat)) + (send-event (ppointer->process gp-2) 'rot-quat (-> self root quat)) ;; og:preserve-this the zero passed here was missing in the original game, but is a bug that causes undefined behavior (send-event (ppointer->process gp-2) 'art-joint-anim "robotboss-blueeco-blue-last-hit" 0) ) @@ -2631,7 +2611,7 @@ :post transform-post ) -(defmethod init-from-entity! robotboss ((this robotboss) (arg0 entity-actor)) +(defmethod init-from-entity! ((this robotboss) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -2820,18 +2800,18 @@ ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *robotboss-sg* '()) (aybabtu 2) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 (the-as float 40960.0))) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 (the-as float 40960.0))) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (logclear! (-> this root-override nav-flags) (nav-flags navf0)) + (logclear! (-> this root nav-flags) (nav-flags navf0)) (set! (-> this path) (new 'process 'path-control this 'path (the-as float 0.0))) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (logclear! (-> this mask) (process-mask actor-pause)) - (set! (-> this root-override pause-adjust-distance) 1228800.0) + (set! (-> this root pause-adjust-distance) 1228800.0) (set-vector! (-> this old-loc) 8192.0 0.0 245760.0 1.0) (set! (-> this desired-loc quad) (-> this old-loc quad)) (set! (-> this loc-t) 1.0) @@ -2859,16 +2839,16 @@ (set! (-> this particle 5) (create-launch-control (-> *part-group-id-table* 646) this)) (set! (-> this particle 6) (create-launch-control (-> *part-group-id-table* 651) this)) (set! (-> this looping-sound 0) - (new 'process 'ambient-sound (static-sound-spec "robo-blue-lp" :fo-max 80) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "robo-blue-lp" :fo-max 80) (-> this root trans)) ) (set! (-> this looping-sound 1) - (new 'process 'ambient-sound (static-sound-spec "eco-torch" :fo-max 80) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "eco-torch" :fo-max 80) (-> this root trans)) ) (set! (-> this looping-sound 2) - (new 'process 'ambient-sound (static-sound-spec "red-buzz" :fo-max 80) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "red-buzz" :fo-max 80) (-> this root trans)) ) (set! (-> this looping-sound 3) - (new 'process 'ambient-sound (static-sound-spec "bfg-buzz" :fo-max 80) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "bfg-buzz" :fo-max 80) (-> this root trans)) ) (set! (-> this blue-smoke) #f) (set! (-> this red-smoke) #f) diff --git a/goal_src/jak1/levels/finalboss/sage-finalboss.gc b/goal_src/jak1/levels/finalboss/sage-finalboss.gc index d536465ef06..0e8276af49c 100644 --- a/goal_src/jak1/levels/finalboss/sage-finalboss.gc +++ b/goal_src/jak1/levels/finalboss/sage-finalboss.gc @@ -33,28 +33,24 @@ ) (deftype plat-eco-finalboss (plat-eco) - ((force-dest float :offset-assert 360) - (targ-dest float :offset-assert 364) - (dest float :offset-assert 368) - (speed float :offset-assert 372) - (touch-time time-frame :offset-assert 376) + ((force-dest float) + (targ-dest float) + (dest float) + (speed float) + (touch-time time-frame) ) - :heap-base #x110 - :method-count-assert 33 - :size-assert #x180 - :flag-assert #x2101100180 ) -(defmethod get-unlit-skel plat-eco-finalboss ((this plat-eco-finalboss)) +(defmethod get-unlit-skel ((this plat-eco-finalboss)) *plat-eco-finalboss-unlit-sg* ) -(defmethod get-lit-skel plat-eco-finalboss ((this plat-eco-finalboss)) +(defmethod get-lit-skel ((this plat-eco-finalboss)) *plat-eco-finalboss-lit-sg* ) -(defmethod baseplat-method-26 plat-eco-finalboss ((this plat-eco-finalboss)) +(defmethod baseplat-method-26 ((this plat-eco-finalboss)) (set! (-> this force-dest) -1.0) (set! (-> this targ-dest) -1.0) (set! (-> this dest) 0.0) @@ -139,8 +135,8 @@ ) (seek! (-> self path-pos) (-> self dest) (* (-> self speed) (seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) + (if (< (vector-vector-distance (-> self root trans) (ear-trans)) 81920.0) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root trans))) ) (plat-trans) (when (send-event *target* 'query 'powerup (pickup-type eco-yellow)) @@ -151,46 +147,39 @@ ) (deftype sage-finalboss-particle (structure) - ((part sparticle-launch-control :offset-assert 0) - (active symbol :offset-assert 4) + ((part sparticle-launch-control) + (active symbol) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype sage-finalboss (process-taskable) - ((redsage handle :offset-assert 384) - (bluesage handle :offset-assert 392) - (yellowsage handle :offset-assert 400) - (assistant handle :offset-assert 408) - (robotplat handle :offset-assert 416) - (robotboss handle :offset-assert 424) - (silodoor handle :offset-assert 432) - (jak-white handle :offset-assert 440) - (left-door entity-actor :offset-assert 448) - (right-door entity-actor :offset-assert 452) - (kick-in-the-door symbol :offset-assert 456) - (kick-the-credits symbol :offset-assert 460) - (credit-fade float :offset-assert 464) - (palette-val float :offset-assert 468) - (particle sage-finalboss-particle 9 :inline :offset-assert 472) - (particle-whiteout sparticle-launch-control :offset-assert 616) - (credits-played symbol :offset-assert 620) + ((redsage handle) + (bluesage handle) + (yellowsage handle) + (assistant handle) + (robotplat handle) + (robotboss handle) + (silodoor handle) + (jak-white handle) + (left-door entity-actor) + (right-door entity-actor) + (kick-in-the-door symbol) + (kick-the-credits symbol) + (credit-fade float) + (palette-val float) + (particle sage-finalboss-particle 9 :inline) + (particle-whiteout sparticle-launch-control) + (credits-played symbol) ) - :heap-base #x200 - :method-count-assert 53 - :size-assert #x270 - :flag-assert #x3502000270 (:states sage-finalboss-credits ) ) -(defmethod relocate sage-finalboss ((this sage-finalboss) (arg0 int)) +(defmethod relocate ((this sage-finalboss) (arg0 int)) (dotimes (v1-0 9) (if (nonzero? (-> this particle v1-0 part)) (&+! (-> this particle v1-0 part) arg0) @@ -202,7 +191,7 @@ (the-as sage-finalboss ((method-of-type process-taskable relocate) this arg0)) ) -(defmethod deactivate sage-finalboss ((this sage-finalboss)) +(defmethod deactivate ((this sage-finalboss)) (dotimes (s5-0 9) (let ((a0-1 (-> this particle s5-0 part))) (if (nonzero? a0-1) @@ -223,12 +212,10 @@ :shadow green-sagecage-shadow-mg ) -(defmethod play-reminder sage-finalboss ((this sage-finalboss)) +(defmethod play-reminder ((this sage-finalboss)) (let ((s5-0 (entity-by-name "red-sagecage-1"))) (when s5-0 - (set! (-> this redsage) - (ppointer->handle (manipy-spawn (-> this root-override trans) s5-0 *redsage-sg* #f :to this)) - ) + (set! (-> this redsage) (ppointer->handle (manipy-spawn (-> this root trans) s5-0 *redsage-sg* #f :to this))) (send-event (handle->process (-> this redsage)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this redsage)) 'blend-shape #t) (send-event (handle->process (-> this redsage)) 'center-joint 3) @@ -238,7 +225,7 @@ (let ((s5-1 (entity-by-name "blue-sagecage-1"))) (when s5-1 (set! (-> this bluesage) - (ppointer->handle (manipy-spawn (-> this root-override trans) s5-1 *bluesage-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) s5-1 *bluesage-sg* #f :to this)) ) (send-event (handle->process (-> this bluesage)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this bluesage)) 'blend-shape #t) @@ -251,7 +238,7 @@ symbol (when s5-2 (set! (-> this yellowsage) - (ppointer->handle (manipy-spawn (-> this root-override trans) s5-2 *yellowsage-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) s5-2 *yellowsage-sg* #f :to this)) ) (send-event (handle->process (-> this yellowsage)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this yellowsage)) 'blend-shape #t) @@ -262,13 +249,13 @@ ) ) -(defmethod process-taskable-method-45 sage-finalboss ((this sage-finalboss)) +(defmethod process-taskable-method-45 ((this sage-finalboss)) (let ((s5-0 (entity-by-name "assistant-lavatube-end-3"))) (the-as symbol (when s5-0 (set! (-> this assistant) - (ppointer->handle (manipy-spawn (-> this root-override trans) s5-0 *assistant-lavatube-end-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) s5-0 *assistant-lavatube-end-sg* #f :to this)) ) (let ((s5-1 (handle->process (-> this assistant)))) (if (the-as manipy s5-1) @@ -284,12 +271,12 @@ ) ) -(defmethod play-anim! sage-finalboss ((this sage-finalboss) (arg0 symbol)) +(defmethod play-anim! ((this sage-finalboss) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status unknown)) (when arg0 (close-current! (-> this tasks)) - (set-yaw-angle-clear-roll-pitch! (-> this root-override) 0.0) + (set-yaw-angle-clear-roll-pitch! (-> this root) 0.0) ) (new 'static 'spool-anim :name "green-sagecage-daxter-sacrifice" @@ -300,10 +287,10 @@ ) (((task-status need-introduction)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> this root-override) 0.0) + (set-yaw-angle-clear-roll-pitch! (-> this root) 0.0) (close-current! (-> this tasks)) (set! (-> this jak-white) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *jak-white-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *jak-white-sg* #f :to this)) ) (send-event (handle->process (-> this jak-white)) @@ -314,9 +301,7 @@ (send-event (handle->process (-> this jak-white)) 'origin-joint-index 3) (send-event (handle->process (-> this jak-white)) 'blend-shape #t) (set! (-> this robotboss) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *robotboss-cinematic-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *robotboss-cinematic-sg* #f :to this)) ) (send-event (handle->process (-> this robotboss)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this robotboss)) 'origin-joint-index 3) @@ -326,7 +311,7 @@ ) ) (set! (-> this silodoor) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *silodoor-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *silodoor-sg* #f :to this)) ) (send-event (handle->process (-> this silodoor)) 'anim-mode 'clone-anim) (let ((v1-84 (handle->process (-> this silodoor)))) @@ -381,14 +366,14 @@ ) (((task-status need-reminder-a)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> this root-override) 0.0) + (set-yaw-angle-clear-roll-pitch! (-> this root) 0.0) (close-current! (-> this tasks)) (play-reminder this) (process-taskable-method-45 this) (set! (-> this kick-the-credits) #t) (set! (-> this robotplat) (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *plat-eco-finalboss-lit-sg* #f :to this) + (manipy-spawn (-> this root trans) (-> this entity) *plat-eco-finalboss-lit-sg* #f :to this) ) ) (send-event (handle->process (-> this robotplat)) 'anim-mode 'clone-anim) @@ -436,7 +421,7 @@ ) (((task-status need-reminder)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> this root-override) -13116.667) + (set-yaw-angle-clear-roll-pitch! (-> this root) -13116.667) (close-current! (-> this tasks)) (process-taskable-method-45 this) (send-event *camera* 'teleport) @@ -484,7 +469,7 @@ ) (((task-status need-reward-speech)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> this root-override) -13116.667) + (set-yaw-angle-clear-roll-pitch! (-> this root) -13116.667) (close-current! (-> this tasks)) (process-taskable-method-45 this) (set! (-> this left-door) (the-as entity-actor (entity-by-name "power-left-2"))) @@ -524,7 +509,7 @@ ) ) -(defmethod get-art-elem sage-finalboss ((this sage-finalboss)) +(defmethod get-art-elem ((this sage-finalboss)) (-> this draw art-group data 4) ) @@ -932,7 +917,7 @@ ) ) -(defmethod should-display? sage-finalboss ((this sage-finalboss)) +(defmethod should-display? ((this sage-finalboss)) #f ) @@ -992,7 +977,7 @@ ) ) -(defmethod init-from-entity! sage-finalboss ((this sage-finalboss) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sage-finalboss) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sage-finalboss-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task finalboss-movies))) (set! (-> this redsage) (the-as handle #f)) @@ -1025,7 +1010,7 @@ (set! (-> this particle v1-37 active) #f) ) (set! (-> this palette-val) 0.0) - (+! (-> this root-override trans y) 2048.0) + (+! (-> this root trans y) 2048.0) (if (not (should-display? this)) (go (method-of-object this hidden)) (go (method-of-object this idle)) diff --git a/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc b/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc index b08affe0ad3..00afaa2e765 100644 --- a/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc +++ b/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc @@ -9,10 +9,6 @@ (deftype assistant-firecanyon (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -22,7 +18,7 @@ :shadow assistant-firecanyon-shadow-mg ) -(defmethod play-anim! assistant-firecanyon ((this assistant-firecanyon) (arg0 symbol)) +(defmethod play-anim! ((this assistant-firecanyon) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (if arg0 @@ -62,7 +58,7 @@ ) ) -(defmethod get-art-elem assistant-firecanyon ((this assistant-firecanyon)) +(defmethod get-art-elem ((this assistant-firecanyon)) (if (= (current-status (-> this tasks)) (task-status invalid)) (-> this draw art-group data 8) (-> this draw art-group data 3) @@ -74,7 +70,7 @@ :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) (when (and (cond - ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + ((and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) #t ) (else @@ -248,12 +244,12 @@ ) ) -(defmethod should-display? assistant-firecanyon ((this assistant-firecanyon)) +(defmethod should-display? ((this assistant-firecanyon)) (first-any (-> this tasks) #t) (= (current-status (-> this tasks)) (task-status need-reward-speech)) ) -(defmethod init-from-entity! assistant-firecanyon ((this assistant-firecanyon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant-firecanyon) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-firecanyon-sg* 3 29 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task firecanyon-assistant))) (first-any (-> this tasks) #t) diff --git a/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc b/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc index ffe47a76ab6..a5d91f3a51a 100644 --- a/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc +++ b/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc @@ -9,12 +9,8 @@ ;; DECOMP BEGINS (deftype balloon (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states balloon-idle balloon-popping @@ -92,7 +88,7 @@ (defstate balloon-popping (balloon) :code (behavior () (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (sound-play "cool-balloon") (process-spawn @@ -103,7 +99,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (suspend) @@ -134,7 +130,7 @@ :post ja-post ) -(defmethod init-from-entity! balloon ((this balloon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this balloon) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -145,7 +141,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *balloon-sg* '()) @@ -155,13 +151,9 @@ ) (deftype spike (process-drawable) - ((root-override collide-shape :offset 112) - (num-alts int32 :offset-assert 176) + ((root collide-shape :override) + (num-alts int32) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states spike-down spike-idle @@ -272,7 +264,7 @@ :trans (behavior () (when (and *target* (= (send-event *target* 'query 'mode) 'racer) - (< (vector-vector-distance (-> self root-override trans) (target-pos 0)) 225280.0) + (< (vector-vector-distance (-> self root trans) (target-pos 0)) 225280.0) ) (sound-play "magma-rock") (let ((v1-8 (entity-actor-count (-> self entity) 'alt-actor))) @@ -299,7 +291,7 @@ ) ) -(defmethod init-from-entity! spike ((this spike) (arg0 entity-actor)) +(defmethod init-from-entity! ((this spike) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -348,7 +340,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *spike-sg* '()) @@ -367,15 +359,11 @@ ) (deftype crate-darkeco-cluster (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) @@ -569,7 +557,7 @@ :virtual #t :code (behavior () (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (sound-play "dcrate-break") (process-spawn @@ -580,7 +568,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (suspend) @@ -607,7 +595,7 @@ ) ) -(defmethod init-from-entity! crate-darkeco-cluster ((this crate-darkeco-cluster) (arg0 entity-actor)) +(defmethod init-from-entity! ((this crate-darkeco-cluster) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind crate)) @@ -620,7 +608,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *crate-darkeco-cluster-sg* '()) diff --git a/goal_src/jak1/levels/firecanyon/firecanyon-part.gc b/goal_src/jak1/levels/firecanyon/firecanyon-part.gc index dc6bf7192d1..d99b9ae1543 100644 --- a/goal_src/jak1/levels/firecanyon/firecanyon-part.gc +++ b/goal_src/jak1/levels/firecanyon/firecanyon-part.gc @@ -9,10 +9,6 @@ (deftype firecanyon-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/flut_common/flutflut.gc b/goal_src/jak1/levels/flut_common/flutflut.gc index 2067d8c0bc1..7d785c27704 100644 --- a/goal_src/jak1/levels/flut_common/flutflut.gc +++ b/goal_src/jak1/levels/flut_common/flutflut.gc @@ -12,32 +12,28 @@ ) (deftype flutflut (process-drawable) - ((parent-override (pointer target) :offset 12) - (root-override collide-shape-moving :offset 112) - (extra-trans vector :inline :offset-assert 176) - (condition int32 :offset-assert 192) - (auto-get-off symbol :offset-assert 196) - (cell handle :offset-assert 200) - (path-data path-control 2 :offset-assert 208) - (path-target path-control :offset 208) - (path-flut path-control :offset 212) - (touch-time time-frame :offset-assert 216) + ((root collide-shape-moving :override) + (parent-override (pointer target) :overlay-at parent) + (extra-trans vector :inline) + (condition int32) + (auto-get-off symbol) + (cell handle) + (path-data path-control 2) + (path-target path-control :overlay-at (-> path-data 0)) + (path-flut path-control :overlay-at (-> path-data 1)) + (touch-time time-frame) ) :pack-me - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe0 - :flag-assert #x18007000e0 - (:methods - (wait-for-start () _type_ :state 20) - (idle () _type_ :state 21) - (pickup ((state flutflut)) _type_ :state 22) - (wait-for-return () _type_ :state 23) + (:state-methods + wait-for-start + idle + (pickup (state flutflut)) + wait-for-return ) ) -(defmethod relocate flutflut ((this flutflut) (arg0 int)) +(defmethod relocate ((this flutflut) (arg0 int)) (countdown (v1-0 2) (if (-> this path-data v1-0) (&+! (-> this path-data v1-0) arg0) @@ -64,7 +60,7 @@ ) (defbehavior flutflut-effect flutflut () - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (update! (-> self sound)) 0 (none) @@ -75,7 +71,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('trans) - (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) (('notify) (let ((v0-1 (the-as structure #t))) @@ -90,8 +86,8 @@ ) ) :exit (behavior () - (set! (-> self root-override root-prim prim-core action) (collide-action)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) + (set! (-> self root root-prim prim-core action) (collide-action)) + (set! (-> self root root-prim prim-core offense) (collide-offense no-offense)) 0 ) :code (behavior () @@ -137,7 +133,7 @@ (set! (-> self cell) (ppointer->handle (birth-pickup-at-point - (vector+! (new 'stack-no-clear 'vector) (-> self root-override trans) (new 'static 'vector :y 8192.0 :w 1.0)) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 8192.0 :w 1.0)) (pickup-type fuel-cell) (the float (-> self entity extra perm task)) #f @@ -176,18 +172,18 @@ :code (behavior () (ja-channel-set! 1) (ja :group! flut-saddle-flut-idle-ja) - (set! (-> self root-override root-prim prim-core action) (collide-action solid attackable-unused)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> self root root-prim prim-core action) (collide-action solid attackable-unused)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) (loop (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut))) (go-virtual wait-for-return) ) (when (logtest? (-> self draw status) (draw-status was-drawn)) - (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id swamp-flutflut-hint) "sksp0160" (the-as entity #f) *entity-pool* (game-task none)) ) ) - (when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (not (movie?)) (not (level-hint-displayed?)) (!= (-> self condition) 4) @@ -229,12 +225,12 @@ (('draw) (ja-channel-set! 1) (ja :group! flut-saddle-flut-idle-ja) - (set! (-> self root-override root-prim prim-core action) (collide-action solid attackable-unused)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> self root root-prim prim-core action) (collide-action solid attackable-unused)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) (transform-post) ) (('trans) - (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) (('touch 'attack) #f @@ -248,9 +244,7 @@ (ja-channel-set! 0) (ja-post) (while (zero? (ja-group-size)) - (if (or (not *target*) - (< 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (or (not *target*) (< 24576.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (go arg0) ) (flutflut-effect) @@ -277,7 +271,7 @@ (go-virtual pickup (method-of-object self idle)) ) (if (= message 'trans) - (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) ) :enter (behavior () @@ -297,7 +291,7 @@ ) ) -(defmethod init-from-entity! flutflut ((this flutflut) (arg0 entity-actor)) +(defmethod init-from-entity! ((this flutflut) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -312,16 +306,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (set-yaw-angle-clear-roll-pitch! (-> this root-override) (res-lump-float arg0 'rotoffset)) + (set-yaw-angle-clear-roll-pitch! (-> this root) (res-lump-float arg0 'rotoffset)) (initialize-skeleton this *flutflut-sg* '()) (logior! (-> this skel status) (janim-status eye)) (set! (-> this draw shadow-ctrl) *flutflut-shadow-control*) (let ((v1-24 (-> this node-list data))) (set! (-> v1-24 0 param0) cspace<-transformq+trans!) - (set! (-> v1-24 0 param1) (the-as basic (-> this root-override trans))) + (set! (-> v1-24 0 param1) (the-as basic (-> this root trans))) (set! (-> v1-24 0 param2) (the-as basic (-> this extra-trans))) ) (dotimes (s4-2 2) @@ -338,7 +332,7 @@ ) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 120) this)) (set! (-> this auto-get-off) #f) - (move-to-ground (-> this root-override) 40960.0 40960.0 #t (collide-kind background)) + (move-to-ground (-> this root) 40960.0 40960.0 #t (collide-kind background)) (set! (-> this cell) (the-as handle #f)) (blocking-plane-spawn (the-as @@ -350,7 +344,7 @@ ) ) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> this root trans)) ) (go (method-of-object this wait-for-start)) (none) diff --git a/goal_src/jak1/levels/flut_common/target-flut.gc b/goal_src/jak1/levels/flut_common/target-flut.gc index aa18ac3481b..2c56f9ee60a 100644 --- a/goal_src/jak1/levels/flut_common/target-flut.gc +++ b/goal_src/jak1/levels/flut_common/target-flut.gc @@ -8,30 +8,24 @@ ;; DECOMP BEGINS (deftype flut-info (basic) - ((entity entity-actor :offset-assert 4) - (flut-trans vector :inline :offset-assert 16) - (flut-quat vector :inline :offset-assert 32) - (flut-scale vector :inline :offset-assert 48) - (stick-lock basic :offset-assert 64) - (flap-sound-id sound-id :offset-assert 68) + ((entity entity-actor) + (flut-trans vector :inline) + (flut-quat vector :inline) + (flut-scale vector :inline) + (stick-lock basic) + (flap-sound-id sound-id) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) (deftype flut-bank (basic) - ((jump-height-min meters :offset-assert 4) - (jump-height-max meters :offset-assert 8) - (double-jump-height-min meters :offset-assert 12) - (double-jump-height-max meters :offset-assert 16) - (air-attack-speed meters :offset-assert 20) - (ground-timeout time-frame :offset-assert 24) + ((jump-height-min meters) + (jump-height-max meters) + (double-jump-height-min meters) + (double-jump-height-max meters) + (air-attack-speed meters) + (ground-timeout time-frame) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) @@ -457,12 +451,12 @@ ) ) ) - (set! (-> self root-override trans quad) (-> v1-0 flut flut-trans quad)) + (set! (-> self root trans quad) (-> v1-0 flut flut-trans quad)) (let ((a0-4 (-> v1-0 flut flut-quat quad))) - (set! (-> self root-override quat vec quad) a0-4) + (set! (-> self root quat vec quad) a0-4) ) - (set! (-> self root-override scale quad) (-> v1-0 flut flut-scale quad)) - (set! (-> self root-override ground-pat material) (the-as int (-> v1-0 control ground-pat material))) + (set! (-> self root scale quad) (-> v1-0 flut flut-scale quad)) + (set! (-> self root ground-pat material) (the-as int (-> v1-0 control ground-pat material))) (set! (-> self draw light-index) (the-as uint 255)) (let ((a0-13 (-> v1-0 draw color-mult quad))) (set! (-> self draw color-mult quad) a0-13) @@ -1183,9 +1177,7 @@ (set! (-> *run-attack-mods* turnvv) 655360.0) (target-start-attack) (target-danger-set! 'flut-attack #f) - (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (time-elapsed? (-> self control unknown-dword82) (seconds 0.25)) ) (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) @@ -1200,7 +1192,7 @@ (-> self entity) s5-0 gp-0 - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + (if (>= (-> self fact eco-level) (-> *FACT-bank* eco-level-max)) 281 265 ) @@ -1564,7 +1556,7 @@ :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control unknown-cpad-info00 number) r2)) - (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) + (pickup-collectable! (-> self fact) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) (go target-flut-stance) ) ) @@ -1635,38 +1627,23 @@ (go target-flut-stance) ) (else - (pickup-collectable! - (-> self fact-info-target) - (pickup-type eco-green) - (the-as float -1000.0) - (the-as handle #f) - ) + (pickup-collectable! (-> self fact) (pickup-type eco-green) (the-as float -1000.0) (the-as handle #f)) (go target-flut-death (-> gp-0 mode)) ) ) ) (('water-vol 'sharkey) - (pickup-collectable! - (-> self fact-info-target) - (pickup-type eco-green) - (the-as float -1000.0) - (the-as handle #f) - ) + (pickup-collectable! (-> self fact) (pickup-type eco-green) (the-as float -1000.0) (the-as handle #f)) (if (= (-> self game mode) 'play) (go target-flut-death (-> gp-0 mode)) ) ) (('death) - (pickup-collectable! - (-> self fact-info-target) - (pickup-type eco-green) - (the-as float -1000.0) - (the-as handle #f) - ) + (pickup-collectable! (-> self fact) (pickup-type eco-green) (the-as float -1000.0) (the-as handle #f)) ) (else (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) @@ -1697,7 +1674,7 @@ (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-flut-falling-anim-trans f30-0) ) ) - (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) (go target-flut-death (-> gp-0 mode)) ) ) diff --git a/goal_src/jak1/levels/intro/evilbro.gc b/goal_src/jak1/levels/intro/evilbro.gc index 068adb69815..8c365c607eb 100644 --- a/goal_src/jak1/levels/intro/evilbro.gc +++ b/goal_src/jak1/levels/intro/evilbro.gc @@ -8,12 +8,8 @@ ;; DECOMP BEGINS (deftype evilbro (process-taskable) - ((evilsis entity-actor :offset-assert 380) + ((evilsis entity-actor) ) - :heap-base #x110 - :method-count-assert 53 - :size-assert #x180 - :flag-assert #x3501100180 ) @@ -23,7 +19,7 @@ :shadow evilbro-shadow-mg ) -(defmethod play-anim! evilbro ((this evilbro) (arg0 symbol)) +(defmethod play-anim! ((this evilbro) (arg0 symbol)) (cond (arg0 (close-specific-task! (game-task leaving-misty) (task-status need-introduction)) @@ -36,7 +32,7 @@ (the-as basic (new 'static 'spool-anim :name "evilbro-misty-end" :index 5 :parts 9 :command-list '())) ) -(defmethod get-art-elem evilbro ((this evilbro)) +(defmethod get-art-elem ((this evilbro)) (-> this draw art-group data 3) ) @@ -91,7 +87,7 @@ ) ) -(defmethod init-from-entity! evilbro ((this evilbro) (arg0 entity-actor)) +(defmethod init-from-entity! ((this evilbro) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *evilbro-intro-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task leaving-misty))) (set! (-> this evilsis) (entity-actor-lookup arg0 'alt-actor 0)) @@ -101,10 +97,6 @@ (deftype evilsis (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -114,7 +106,7 @@ :shadow evilsis-shadow-mg ) -(defmethod play-anim! evilsis ((this evilsis) (arg0 symbol)) +(defmethod play-anim! ((this evilsis) (arg0 symbol)) (if arg0 (format 0 @@ -126,7 +118,7 @@ (the-as basic (get-art-elem this)) ) -(defmethod get-art-elem evilsis ((this evilsis)) +(defmethod get-art-elem ((this evilsis)) (-> this draw art-group data 3) ) @@ -138,7 +130,7 @@ ) ) -(defmethod init-from-entity! evilsis ((this evilsis) (arg0 entity-actor)) +(defmethod init-from-entity! ((this evilsis) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *evilsis-intro-sg* 3 0 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task leaving-misty))) (process-taskable-method-42 this) diff --git a/goal_src/jak1/levels/jungle/bouncer.gc b/goal_src/jak1/levels/jungle/bouncer.gc index a70cb58c107..43c38c77840 100644 --- a/goal_src/jak1/levels/jungle/bouncer.gc +++ b/goal_src/jak1/levels/jungle/bouncer.gc @@ -10,13 +10,9 @@ ;; DECOMP BEGINS (deftype springbox (process-drawable) - ((spring-height meters :offset-assert 176) - (smush float :offset-assert 180) + ((spring-height meters) + (smush float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states bouncer-fire bouncer-smush @@ -116,7 +112,7 @@ :post transform-post ) -(defmethod init-from-entity! springbox ((this springbox) (arg0 entity-actor)) +(defmethod init-from-entity! ((this springbox) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) diff --git a/goal_src/jak1/levels/jungle/darkvine.gc b/goal_src/jak1/levels/jungle/darkvine.gc index 0a5d913f851..8fc6654dd23 100644 --- a/goal_src/jak1/levels/jungle/darkvine.gc +++ b/goal_src/jak1/levels/jungle/darkvine.gc @@ -13,19 +13,15 @@ ;; DECOMP BEGINS (deftype darkvine (process-drawable) - ((root-override collide-shape :offset 112) - (speed float :offset-assert 176) - (tip-index int8 :offset-assert 180) - (dangerous symbol :offset-assert 184) - (vulnerable symbol :offset-assert 188) - (hit-player symbol :offset-assert 192) - (touch-time time-frame :offset-assert 200) - (player-attack-id int32 :offset-assert 208) + ((root collide-shape :override) + (speed float) + (tip-index int8) + (dangerous symbol) + (vulnerable symbol) + (hit-player symbol) + (touch-time time-frame) + (player-attack-id int32) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd4 - :flag-assert #x14007000d4 (:states (darkvine-die symbol) darkvine-idle @@ -34,12 +30,12 @@ ) -(defmethod run-logic? darkvine ((this darkvine)) +(defmethod run-logic? ((this darkvine)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status was-drawn)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root-override pause-adjust-distance)) - (vector-vector-distance (-> this root-override trans) (math-camera-pos)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) ) (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) @@ -128,10 +124,10 @@ (defbehavior darkvine-event-handler darkvine ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) (when (-> self dangerous) (if (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) + (set-collide-offense (-> self root) 2 (collide-offense no-offense)) ) ) ) @@ -141,7 +137,7 @@ ((!= v1-10 (-> self player-attack-id)) (set! (-> self player-attack-id) (the-as int v1-10)) (when (-> self vulnerable) - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) (go darkvine-retreat) ) ) @@ -167,7 +163,7 @@ (ja-no-eval :group! darkvine-idle-ja :num! (seek! max (-> self speed)) :frame-num 0.0) (until (ja-done? 0) (if (and (>= (ja-aframe-num 0) 120.0) (>= 180.0 (ja-aframe-num 0))) - (seek-toward-yaw-angle! (-> self root-override) f30-0 32768.0 (seconds 0.5)) + (seek-toward-yaw-angle! (-> self root) f30-0 32768.0 (seconds 0.5)) ) (suspend) (ja :num! (seek! max (-> self speed))) @@ -182,7 +178,7 @@ ) :post (behavior () (when (and (-> self hit-player) (or (not *target*) (time-elapsed? (-> self touch-time) (seconds 0.05)))) - (set-collide-offense (-> self root-override) 2 (collide-offense indestructible)) + (set-collide-offense (-> self root) 2 (collide-offense indestructible)) (set! (-> self hit-player) #f) ) (transform-post) @@ -207,7 +203,7 @@ (ja-channel-push! 1 (seconds 0.15)) (ja-no-eval :group! darkvine-retreat-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (launch-particles (-> *part-id-table* 800) (-> self root-override trans)) + (launch-particles (-> *part-id-table* 800) (-> self root trans)) (suspend) (ja :num! (seek!)) ) @@ -225,7 +221,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (let ((gp-2 (current-time))) @@ -253,7 +249,7 @@ (ja-channel-set! 1) (ja-channel-push! 1 (seconds 0.5)) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja :group! darkvine-dead-ja :num! min) (while (!= (-> self skel root-channel 0) (-> self skel channel)) (suspend) @@ -264,7 +260,7 @@ :post (-> darkvine-idle post) ) -(defmethod init-from-entity! darkvine ((this darkvine) (arg0 entity-actor)) +(defmethod init-from-entity! ((this darkvine) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) @@ -312,12 +308,12 @@ ) (set! (-> s4-0 nav-radius) 2048.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (set! (-> this tip-index) 8) (process-drawable-from-entity! this arg0) (initialize-skeleton this *darkvine-sg* '()) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (set! (-> this hit-player) #f) (set! (-> this speed) (rand-vu-float-range 0.95 1.05)) (if (logtest? (get-reminder (get-task-control (game-task jungle-plant)) 0) 1) diff --git a/goal_src/jak1/levels/jungle/fisher.gc b/goal_src/jak1/levels/jungle/fisher.gc index a894ad378de..7888ccf363d 100644 --- a/goal_src/jak1/levels/jungle/fisher.gc +++ b/goal_src/jak1/levels/jungle/fisher.gc @@ -10,14 +10,11 @@ ;; DECOMP BEGINS (deftype fisher-bank (basic) - ((width meters :offset-assert 4) - (net-radius meters :offset-assert 8) - (max-caught int32 :offset-assert 12) - (max-missed int32 :offset-assert 16) + ((width meters) + (net-radius meters) + (max-caught int32) + (max-missed int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -154,20 +151,17 @@ ) (deftype fisher-params (structure) - ((timeout time-frame :offset-assert 0) - (vel float :offset-assert 8) - (swing-min time-frame :offset-assert 16) - (swing-max time-frame :offset-assert 24) - (period time-frame :offset-assert 32) - (fish-vel float :offset-assert 40) - (bad-percent float :offset-assert 44) - (deadly-percent float :offset-assert 48) - (powerup-percent float :offset-assert 52) + ((timeout time-frame) + (vel float) + (swing-min time-frame) + (swing-max time-frame) + (period time-frame) + (fish-vel float) + (bad-percent float) + (deadly-percent float) + (powerup-percent float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) @@ -715,34 +709,30 @@ ) (deftype fisher (process-taskable) - ((paddle-end vector 2 :inline :offset-assert 384) - (paddle-pos vector :inline :offset-assert 416) - (paddle float :offset-assert 432) - (paddle-vel float :offset-assert 436) - (spawner float :offset-assert 440) - (spawner-last float :offset-assert 444) - (spawn-time time-frame :offset-assert 448) - (turn-time time-frame :offset-assert 456) - (swing-time time-frame :offset-assert 464) - (block-time time-frame :offset-assert 472) - (block int32 :offset-assert 480) - (caught int32 :offset-assert 484) - (missed int32 :offset-assert 488) - (difficulty int32 :offset-assert 492) - (start-time time-frame :offset-assert 496) - (ambient-big-one time-frame :offset-assert 504) - (ambient-steady time-frame :offset-assert 512) - (ambient-sagging time-frame :offset-assert 520) - (ambient-almost time-frame :offset-assert 528) - (cheat-temp int32 :offset-assert 536) - (hard symbol :offset-assert 540) - (training symbol :offset-assert 544) - (params fisher-params :inline :offset-assert 552) + ((paddle-end vector 2 :inline) + (paddle-pos vector :inline) + (paddle float) + (paddle-vel float) + (spawner float) + (spawner-last float) + (spawn-time time-frame) + (turn-time time-frame) + (swing-time time-frame) + (block-time time-frame) + (block int32) + (caught int32) + (missed int32) + (difficulty int32) + (start-time time-frame) + (ambient-big-one time-frame) + (ambient-steady time-frame) + (ambient-sagging time-frame) + (ambient-almost time-frame) + (cheat-temp int32) + (hard symbol) + (training symbol) + (params fisher-params :inline) ) - :heap-base #x1f0 - :method-count-assert 53 - :size-assert #x260 - :flag-assert #x3501f00260 (:states fisher-done fisher-playing @@ -751,17 +741,13 @@ (deftype fisher-fish (process-drawable) - ((dir vector :inline :offset-assert 176) - (offset float :offset-assert 192) - (pos float :offset-assert 196) - (vel float :offset-assert 200) - (mode basic :offset-assert 204) - (size meters :offset-assert 208) + ((dir vector :inline) + (offset float) + (pos float) + (vel float) + (mode basic) + (size meters) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd4 - :flag-assert #x14007000d4 (:states fisher-fish-caught fisher-fish-die @@ -796,10 +782,10 @@ :shadow fisher-shadow-mg ) -(defmethod process-taskable-method-52 fisher ((this fisher)) +(defmethod process-taskable-method-52 ((this fisher)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -1024.0 f0-0))) ) @@ -815,7 +801,7 @@ (none) ) -(defmethod draw-npc-shadow fisher ((this fisher)) +(defmethod draw-npc-shadow ((this fisher)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -1082,7 +1068,7 @@ (none) ) -(defmethod play-anim! fisher ((this fisher) (arg0 symbol)) +(defmethod play-anim! ((this fisher) (arg0 symbol)) (if arg0 (set! (-> this training) #f) ) @@ -1159,14 +1145,14 @@ ) ) -(defmethod get-art-elem fisher ((this fisher)) +(defmethod get-art-elem ((this fisher)) (if (closed? (-> this tasks) (game-task jungle-fishgame) (task-status need-reminder)) (-> this draw art-group data 7) (-> this draw art-group data 6) ) ) -(defmethod process-taskable-method-38 fisher ((this fisher)) +(defmethod process-taskable-method-38 ((this fisher)) (case (current-status (-> this tasks)) (((task-status need-reminder-a) (task-status need-reminder)) (go (method-of-object this query)) @@ -1181,7 +1167,7 @@ (none) ) -(defmethod get-accept-anim fisher ((this fisher) (arg0 symbol)) +(defmethod get-accept-anim ((this fisher) (arg0 symbol)) (when arg0 (close-current! (-> this tasks)) (aybabtu 2) @@ -1194,7 +1180,7 @@ ) ) -(defmethod get-reject-anim fisher ((this fisher) (arg0 symbol)) +(defmethod get-reject-anim ((this fisher) (arg0 symbol)) (new 'static 'spool-anim :name "fisher-reject" :index 11 :parts 2 :command-list '()) ) @@ -1378,7 +1364,7 @@ (cond ((and (< 0.3 f0-2) (< (+ (-> *FISHER-bank* max-caught) -30) (-> self caught))) (if (and (time-elapsed? (-> self ambient-almost) (seconds 10)) - (play-ambient (-> self ambient) "FIS-TA11" #t (-> self root-override trans)) + (play-ambient (-> self ambient) "FIS-TA11" #t (-> self root trans)) ) (set-time! (-> self ambient-almost)) ) @@ -1387,14 +1373,14 @@ ) ((< 0.1 f0-2) (if (and (time-elapsed? (-> self ambient-steady) (seconds 10)) - (play-ambient (-> self ambient) "FIS-TA06" #t (-> self root-override trans)) + (play-ambient (-> self ambient) "FIS-TA06" #t (-> self root trans)) ) (set-time! (-> self ambient-steady)) ) ) ((< (+ (-> *FISHER-bank* max-missed) -6) (-> self missed)) (if (and (time-elapsed? (-> self ambient-sagging) (seconds 10)) - (play-ambient (-> self ambient) "FIS-TA07" #t (-> self root-override trans)) + (play-ambient (-> self ambient) "FIS-TA07" #t (-> self root trans)) ) (set-time! (-> self ambient-sagging)) ) @@ -1440,7 +1426,7 @@ (cond ((rand-vu-percent? (-> self params powerup-percent)) (if (and (time-elapsed? (-> self ambient-big-one) (seconds 30)) - (play-ambient (-> self ambient) "FIS-TA03" #t (-> self root-override trans)) + (play-ambient (-> self ambient) "FIS-TA03" #t (-> self root trans)) ) (set-time! (-> self ambient-big-one)) ) @@ -1515,7 +1501,7 @@ (set-setting! 'ambient-volume 'rel 50.0 0) (send-event *target* 'reset-pickup 'eco) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (process-spawn-function process (lambda :behavior fisher-fish @@ -1548,8 +1534,8 @@ ) (set! (-> *camera-other-fov* data) (-> *camera-combiner* fov)) (set! (-> *camera-other-trans* quad) (-> *camera-combiner* trans quad)) - (set! (-> *camera-other-root* quad) (-> self root-override trans quad)) - (restore-collide-with-as (-> self root-override)) + (set! (-> *camera-other-root* quad) (-> self root trans quad)) + (restore-collide-with-as (-> self root)) (send-event *camera* 'blend-from-as-fixed) (send-event *camera* 'change-state *camera-base-mode* 0) (send-event *camera* 'clear-entity) @@ -1666,14 +1652,14 @@ ((-> (method-of-type process-taskable play-anim) exit))) ) -(defmethod process-taskable-method-43 fisher ((this fisher)) +(defmethod process-taskable-method-43 ((this fisher)) (cond ((closed? (-> this tasks) (game-task jungle-fishgame) (task-status need-reminder)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 1) 122880.0 this) (let ((f0-2 (rand-float-gen))) (if (< 0.5 f0-2) - (play-ambient (-> this ambient) "FIS-LO03" #f (-> this root-override trans)) - (play-ambient (-> this ambient) "FIS-LO05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-LO03" #f (-> this root trans)) + (play-ambient (-> this ambient) "FIS-LO05" #f (-> this root trans)) ) ) ) @@ -1683,28 +1669,28 @@ (let ((f0-5 (rand-float-gen))) (cond ((< 0.875 f0-5) - (play-ambient (-> this ambient) "FIS-LO01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-LO01" #f (-> this root trans)) ) ((< 0.75 f0-5) - (play-ambient (-> this ambient) "FIS-LO04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-LO04" #f (-> this root trans)) ) ((< 0.625 f0-5) - (play-ambient (-> this ambient) "FIS-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-AM01" #f (-> this root trans)) ) ((< 0.5 f0-5) - (play-ambient (-> this ambient) "FIS-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-AM02" #f (-> this root trans)) ) ((< 0.375 f0-5) - (play-ambient (-> this ambient) "FIS-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-AM03" #f (-> this root trans)) ) ((< 0.25 f0-5) - (play-ambient (-> this ambient) "FIS-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-AM04" #f (-> this root trans)) ) ((< 0.125 f0-5) - (play-ambient (-> this ambient) "FIS-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-AM05" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "FIS-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-AM06" #f (-> this root trans)) ) ) ) @@ -1913,7 +1899,7 @@ ) ) -(defmethod initialize-collision fisher ((this fisher) (arg0 int) (arg1 vector)) +(defmethod initialize-collision ((this fisher) (arg0 int) (arg1 vector)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) @@ -1943,17 +1929,17 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod target-above-threshold? fisher ((this fisher)) +(defmethod target-above-threshold? ((this fisher)) (or (= (current-task (-> this tasks)) (game-task jungle-fishgame)) (-> this hard)) ) -(defmethod init-from-entity! fisher ((this fisher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fisher) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *fisher-sg* 3 49 (new 'static 'vector :w 4096.0) 33) (set! (-> this tasks) (get-task-control (game-task jungle-fishgame))) (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) diff --git a/goal_src/jak1/levels/jungle/hopper.gc b/goal_src/jak1/levels/jungle/hopper.gc index de888e5806b..c2ad3df8f08 100644 --- a/goal_src/jak1/levels/jungle/hopper.gc +++ b/goal_src/jak1/levels/jungle/hopper.gc @@ -8,13 +8,9 @@ ;; DECOMP BEGINS (deftype hopper (nav-enemy) - ((jump-length float :offset-assert 400) - (shadow-min-y float :offset-assert 404) + ((jump-length float) + (shadow-min-y float) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x198 - :flag-assert #x4c01300198 ) @@ -27,7 +23,7 @@ nav-enemy-default-event-handler -(defmethod common-post hopper ((this hopper)) +(defmethod common-post ((this hopper)) (let ((v1-1 (-> this draw shadow-ctrl))) (set! (-> v1-1 settings bot-plane w) (- (- (-> this shadow-min-y) (-> this collide-info trans y)))) ) @@ -302,7 +298,7 @@ nav-enemy-default-event-handler ) ) -(defmethod initialize-collision hopper ((this hopper)) +(defmethod initialize-collision ((this hopper)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -341,7 +337,7 @@ nav-enemy-default-event-handler (none) ) -(defmethod nav-enemy-method-48 hopper ((this hopper)) +(defmethod nav-enemy-method-48 ((this hopper)) (initialize-skeleton this *hopper-sg* '()) (init-defaults! this *hopper-nav-enemy-info*) (set! (-> this shadow-min-y) (+ (-> this collide-info trans y) (-> this nav-info shadow-min-y))) diff --git a/goal_src/jak1/levels/jungle/jungle-elevator.gc b/goal_src/jak1/levels/jungle/jungle-elevator.gc index 3cbbea8b313..a274a924e9a 100644 --- a/goal_src/jak1/levels/jungle/jungle-elevator.gc +++ b/goal_src/jak1/levels/jungle/jungle-elevator.gc @@ -8,18 +8,14 @@ ;; DECOMP BEGINS (deftype jungle-elevator (plat-button) - ((bottom-height float :offset-assert 240) - (teleport-if-below-y float :offset-assert 244) - (teleport-if-above-y float :offset-assert 248) + ((bottom-height float) + (teleport-if-below-y float) + (teleport-if-above-y float) ) - :heap-base #x90 - :method-count-assert 33 - :size-assert #xfc - :flag-assert #x21009000fc ) -(defmethod can-activate? jungle-elevator ((this jungle-elevator)) +(defmethod can-activate? ((this jungle-elevator)) (and ((method-of-type plat-button can-activate?) this) (task-complete? *game-info* (game-task jungle-tower))) ) @@ -48,13 +44,13 @@ (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> self root-override trans quad)) + (set! (-> s5-0 quad) (-> self root trans quad)) (let ((t9-1 (-> (find-parent-state) trans))) (if t9-1 (t9-1) ) ) - (vector-! gp-0 (-> self root-override trans) s5-0) + (vector-! gp-0 (-> self root trans) s5-0) (when (< (-> self path-pos) 0.9) (move-by-vector! (-> *target* control) gp-0) (send-event *target* 'reset-height) @@ -126,7 +122,7 @@ ) ) -(defmethod should-teleport? jungle-elevator ((this jungle-elevator)) +(defmethod should-teleport? ((this jungle-elevator)) (let ((f0-0 (-> (camera-pos) y))) (case (-> this path-pos) ((0.0) @@ -146,7 +142,7 @@ #f ) -(defmethod can-target-move? jungle-elevator ((this jungle-elevator)) +(defmethod can-target-move? ((this jungle-elevator)) (let ((s5-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> this path) s5-0 0.4 'interp) (set! (-> this teleport-if-above-y) (-> s5-0 y)) diff --git a/goal_src/jak1/levels/jungle/jungle-mirrors.gc b/goal_src/jak1/levels/jungle/jungle-mirrors.gc index 26d78491900..663d534fd05 100644 --- a/goal_src/jak1/levels/jungle/jungle-mirrors.gc +++ b/goal_src/jak1/levels/jungle/jungle-mirrors.gc @@ -488,36 +488,32 @@ ) (deftype periscope (process-drawable) - ((root-override collide-shape :offset 112) - (y-offset meters :offset-assert 176) - (y-offset-grips meters :offset-assert 180) - (height meters :offset-assert 184) - (turn degrees :offset-assert 188) - (tilt degrees :offset-assert 192) - (target-turn degrees :offset-assert 196) - (target-tilt degrees :offset-assert 200) - (base vector :inline :offset-assert 208) - (reflector-trans vector :inline :offset-assert 224) - (next-reflector-trans vector :inline :offset-assert 240) - (prev-reflector-trans vector :inline :offset-assert 256) - (old-camera-matrix matrix :inline :offset-assert 272) - (reflector (pointer reflector) :offset-assert 336) - (gauge-rot degrees :offset-assert 340) - (lock-time time-frame :offset-assert 344) - (aligned? symbol :offset-assert 352) - (raised? symbol :offset-assert 356) - (player-touching-grips? symbol :offset-assert 360) - (grips-moving? symbol :offset-assert 364) - (sound-id sound-id :offset-assert 368) - (rise-sound-id sound-id :offset-assert 372) - (grips-sound-id sound-id :offset-assert 376) - (grips joint-mod-set-world :offset-assert 380) - (part-aligned sparticle-launch-control :offset-assert 384) + ((root collide-shape :override) + (y-offset meters) + (y-offset-grips meters) + (height meters) + (turn degrees) + (tilt degrees) + (target-turn degrees) + (target-tilt degrees) + (base vector :inline) + (reflector-trans vector :inline) + (next-reflector-trans vector :inline) + (prev-reflector-trans vector :inline) + (old-camera-matrix matrix :inline) + (reflector (pointer reflector)) + (gauge-rot degrees) + (lock-time time-frame) + (aligned? symbol) + (raised? symbol) + (player-touching-grips? symbol) + (grips-moving? symbol) + (sound-id sound-id) + (rise-sound-id sound-id) + (grips-sound-id sound-id) + (grips joint-mod-set-world) + (part-aligned sparticle-launch-control) ) - :heap-base #x120 - :method-count-assert 20 - :size-assert #x184 - :flag-assert #x1401200184 (:states periscope-activate periscope-idle @@ -529,7 +525,7 @@ ) -(defmethod relocate periscope ((this periscope) (arg0 int)) +(defmethod relocate ((this periscope) (arg0 int)) (if (nonzero? (-> this grips)) (&+! (-> this grips) arg0) ) @@ -539,7 +535,7 @@ (the-as periscope ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate periscope ((this periscope)) +(defmethod deactivate ((this periscope)) (if (nonzero? (-> this part-aligned)) (kill-and-free-particles (-> this part-aligned)) ) @@ -548,13 +544,9 @@ ) (deftype reflector (process-drawable) - ((parent-override (pointer periscope) :offset 12) - (root-override collide-shape :offset 112) + ((root collide-shape :override) + (parent-override (pointer periscope) :overlay-at parent) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states reflector-idle ) @@ -562,16 +554,12 @@ (deftype reflector-origin (process-drawable) - ((reflector-trans vector :inline :offset-assert 176) - (next-reflector-trans vector :inline :offset-assert 192) - (reflector uint32 :offset-assert 208) - (next basic :offset-assert 212) - (blocker entity-actor :offset-assert 216) + ((reflector-trans vector :inline) + (next-reflector-trans vector :inline) + (reflector uint32) + (next basic) + (blocker entity-actor) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xdc - :flag-assert #x14007000dc (:states reflector-origin-idle ) @@ -579,13 +567,9 @@ (deftype reflector-mirror (process-drawable) - ((root-override collide-shape :offset 112) - (beam-end vector :inline :offset-assert 176) + ((root collide-shape :override) + (beam-end vector :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc0 - :flag-assert #x14005000c0 (:states (reflector-mirror-broken symbol) reflector-mirror-idle @@ -727,12 +711,10 @@ (set! (-> gp-0 y) (-> self parent-override 0 turn)) (set! (-> gp-0 z) 0.0) (set! (-> gp-0 w) 1.0) - (quaternion-zxy! (-> self root-override quat) gp-0) - (set! (-> self root-override trans quad) - (-> self parent-override 0 node-list data 6 bone transform vector 3 quad) - ) + (quaternion-zxy! (-> self root quat) gp-0) + (set! (-> self root trans quad) (-> self parent-override 0 node-list data 6 bone transform vector 3 quad)) (ja-post) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (suspend) ) ) @@ -753,9 +735,9 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *periscope-mirror-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (go reflector-idle) @@ -1013,9 +995,9 @@ (set! (-> a1-0 from) (the-as process (-> self turn))) (set! (-> a1-0 num-params) (the-as int 0.0)) (set! (-> a1-0 message) (the-as symbol 1.0)) - (quaternion-zxy! (-> self root-override quat) (the-as vector a1-0)) + (quaternion-zxy! (-> self root quat) (the-as vector a1-0)) ) - (set! (-> self root-override trans y) (+ -184320.0 (-> self y-offset) (-> self base y))) + (set! (-> self root trans y) (+ -184320.0 (-> self y-offset) (-> self base y))) (set! (-> self grips transform trans y) (+ (- (+ (-> self base y) (-> self y-offset)) (-> self height)) (-> self y-offset-grips)) ) @@ -1027,7 +1009,7 @@ (periscope-draw-beam-impact) (periscope-update-joints) (ja-post) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) 0 (none) ) @@ -1159,10 +1141,10 @@ ) ) :enter (behavior () - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) ) :exit (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (logclear! (-> self draw status) (draw-status hidden)) ) :trans periscope-debug-trans @@ -1176,7 +1158,7 @@ (periscope-update-joints) (ja-post) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (logior! (-> self draw status) (draw-status hidden)) (loop (suspend) @@ -1228,7 +1210,7 @@ (suspend) ) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (set! (-> self y-offset) (-> self height)) (loop (if (periscope-has-power-input?) @@ -1255,7 +1237,7 @@ ) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) (let ((v0-0 (the-as object #t))) @@ -1327,7 +1309,7 @@ (vector-z-quaternion! s3-0 (-> self grips transform quat)) (set! (-> self grips-moving?) (< (vector-dot s4-0 s3-0) (cos 182.04445))) (periscope-update-joints) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (when (and (-> self player-touching-grips?) (not (level-hint-displayed?))) (set! (-> self player-touching-grips?) #f) (hide-hud) @@ -1620,7 +1602,7 @@ :post periscope-post ) -(defmethod init-from-entity! periscope ((this periscope) (arg0 entity-actor)) +(defmethod init-from-entity! ((this periscope) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) @@ -1659,13 +1641,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set! (-> this height) (res-lump-float (-> this entity) 'height-info)) (set! (-> this y-offset) (-> this height)) (set! (-> this y-offset-grips) (+ -20480.0 (-> this height))) - (set! (-> this base quad) (-> this root-override trans quad)) + (set! (-> this base quad) (-> this root trans quad)) (set! (-> this reflector-trans quad) (-> this base quad)) (+! (-> this reflector-trans y) (-> this height)) (set! (-> this reflector) (process-spawn reflector (-> this reflector-trans) :to this)) @@ -1675,7 +1657,7 @@ (set! (-> this part) (create-launch-control (-> *part-group-id-table* 176) this)) (set! (-> this part-aligned) (create-launch-control (-> *part-group-id-table* 689) this)) (set! (-> this grips) (new 'process 'joint-mod-set-world this 4 #t)) - (transformq-copy! (-> this grips transform) (the-as transformq (-> this root-override trans))) + (transformq-copy! (-> this grips transform) (the-as transformq (-> this root trans))) (periscope-find-reflection-angles) (set! (-> this turn) (-> this target-turn)) (set! (-> this tilt) (-> this target-tilt)) @@ -1687,8 +1669,8 @@ ) (set! (-> this rise-sound-id) (new-sound-id)) (set! (-> this grips-sound-id) (new-sound-id)) - (set! (-> this root-override nav-radius) 8192.0) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this root nav-radius) 8192.0) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (cond ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go periscope-power-on) @@ -1762,7 +1744,7 @@ ) ) -(defmethod init-from-entity! reflector-origin ((this reflector-origin) (arg0 entity-actor)) +(defmethod init-from-entity! ((this reflector-origin) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1787,14 +1769,14 @@ ) :code (behavior () (let ((gp-0 (new-stack-vector0))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (+! (-> gp-0 y) 49152.0) (loop (draw-power-beam gp-0 (-> self beam-end)) (update! (-> self sound)) (when (logtest? (-> self draw status) (draw-status was-drawn)) (launch-particles (-> *part-id-table* 825) (-> self beam-end)) - (when (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and *target* (>= 24576.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (start-hint-timer (text-id sidekick-hint-reflector-mirror)) (level-hint-spawn (text-id sidekick-hint-reflector-mirror) @@ -1815,7 +1797,7 @@ (defstate reflector-mirror-broken (reflector-mirror) :code (behavior ((arg0 symbol)) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (let ((s5-0 (entity-actor-count (-> self entity) 'alt-actor))) (dotimes (s4-0 s5-0) @@ -1841,8 +1823,7 @@ ) (when (not arg0) (ambient-hint-spawn "gamcam21" (the-as vector #f) *entity-pool* 'camera) - (let ((v1-11 (manipy-spawn (-> self root-override trans) (-> self entity) *reflector-mirror-break-sg* #f :to self)) - ) + (let ((v1-11 (manipy-spawn (-> self root trans) (-> self entity) *reflector-mirror-break-sg* #f :to self))) (send-event (ppointer->process v1-11) 'anim-mode 'play1) ) (let ((gp-2 (current-time))) @@ -1869,7 +1850,7 @@ ) ) -(defmethod init-from-entity! reflector-mirror ((this reflector-mirror) (arg0 entity-actor)) +(defmethod init-from-entity! ((this reflector-mirror) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -1905,7 +1886,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/goal_src/jak1/levels/jungle/jungle-obs.gc b/goal_src/jak1/levels/jungle/jungle-obs.gc index 3c3a12fe422..ed535f6508d 100644 --- a/goal_src/jak1/levels/jungle/jungle-obs.gc +++ b/goal_src/jak1/levels/jungle/jungle-obs.gc @@ -20,14 +20,10 @@ ) (deftype logtrap (process-drawable) - ((root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) ) - :heap-base #x40 - :method-count-assert 21 - :size-assert #xb0 - :flag-assert #x15004000b0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -59,7 +55,7 @@ (else (transform-post) (if *target* - (look-at-enemy! (-> *target* neck) (the-as vector (-> self root-override root-prim prim-core)) #f self) + (look-at-enemy! (-> *target* neck) (the-as vector (-> self root root-prim prim-core)) #f self) ) ) ) @@ -71,7 +67,7 @@ ) ) -(defmethod init-from-entity! logtrap ((this logtrap) (arg0 entity-actor)) +(defmethod init-from-entity! ((this logtrap) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -88,7 +84,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *logtrap-sg* '()) @@ -96,18 +92,14 @@ (new 'process 'shadow-control -5734.4 0.0 614400.0 (the-as float 1) 163840.0) ) (logclear! (-> this mask) (process-mask actor-pause)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go (method-of-object this idle)) (none) ) (deftype towertop (process-drawable) - ((root-override trsq :offset 112) + ((root-override trsq :overlay-at root) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states towertop-idle ) @@ -132,7 +124,7 @@ :post ja-post ) -(defmethod init-from-entity! towertop ((this towertop) (arg0 entity-actor)) +(defmethod init-from-entity! ((this towertop) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (set! (-> this root-override) (new 'process 'trsq)) (process-drawable-from-entity! this arg0) @@ -143,14 +135,10 @@ ) (deftype lurkerm-tall-sail (process-drawable) - ((root-override collide-shape-moving :offset 112) - (speed float :offset-assert 176) - (alt-actor entity-actor :offset-assert 180) + ((root collide-shape-moving :override) + (speed float) + (alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states lurkerm-tall-sail-idle ) @@ -181,8 +169,8 @@ (ja-no-eval :group! lurkerm-tall-sail-idle-ja :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! - (-> self root-override quat) - (-> self root-override quat) + (-> self root quat) + (-> self root quat) (* 12743.111 (seconds-per-frame) (-> self speed)) ) (suspend) @@ -193,7 +181,7 @@ :post rider-post ) -(defmethod init-from-entity! lurkerm-tall-sail ((this lurkerm-tall-sail) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lurkerm-tall-sail) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -221,12 +209,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lurkerm-tall-sail-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (set! (-> this speed) 1.0) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) @@ -237,14 +225,10 @@ ) (deftype lurkerm-short-sail (process-drawable) - ((root-override collide-shape-moving :offset 112) - (speed float :offset-assert 176) - (alt-actor entity-actor :offset-assert 180) + ((root collide-shape-moving :override) + (speed float) + (alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states lurkerm-short-sail-idle ) @@ -271,8 +255,8 @@ (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! - (-> self root-override quat) - (-> self root-override quat) + (-> self root quat) + (-> self root quat) (* -12743.111 (seconds-per-frame) (-> self speed)) ) (suspend) @@ -283,7 +267,7 @@ :post rider-post ) -(defmethod init-from-entity! lurkerm-short-sail ((this lurkerm-short-sail) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lurkerm-short-sail) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -328,12 +312,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lurkerm-short-sail-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (set! (-> this speed) 1.0) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) @@ -344,17 +328,13 @@ ) (deftype lurkerm-piston (process-drawable) - ((root-override collide-shape-moving :offset 112) - (sync sync-info :inline :offset-assert 176) - (base vector :inline :offset-assert 192) - (height vector :inline :offset-assert 208) - (speed float :offset-assert 224) - (alt-actor entity-actor :offset-assert 228) + ((root collide-shape-moving :override) + (sync sync-info :inline) + (base vector :inline) + (height vector :inline) + (speed float) + (alt-actor entity-actor) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xe8 - :flag-assert #x14008000e8 (:states lurkerm-piston-idle ) @@ -383,7 +363,7 @@ (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 quad) (-> self base quad)) (+! (-> gp-0 y) (* (get-current-value-with-mirror (-> self sync) (-> self height y)) (-> self speed))) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) (suspend) (ja :num! (seek! max (-> self speed))) @@ -393,7 +373,7 @@ :post rider-post ) -(defmethod init-from-entity! lurkerm-piston ((this lurkerm-piston) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lurkerm-piston) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -414,14 +394,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton this *lurkerm-piston-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) - (set! (-> this base quad) (-> this root-override trans quad)) + (update-transforms! (-> this root)) + (set! (-> this base quad) (-> this root trans quad)) (let ((f30-0 (-> this base y))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-32 (res-lump-data arg0 'height-info pointer :tag-ptr (& sv-16)))) @@ -457,13 +437,9 @@ ) (deftype accordian (process-drawable) - ((speed float :offset-assert 176) - (alt-actor entity-actor :offset-assert 180) + ((speed float) + (alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states accordian-idle ) @@ -498,7 +474,7 @@ ) ) -(defmethod init-from-entity! accordian ((this accordian) (arg0 entity-actor)) +(defmethod init-from-entity! ((this accordian) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *accordian-sg* '()) @@ -519,18 +495,11 @@ (deftype junglecam (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) (deftype precurbridgecam (pov-camera) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) @@ -556,23 +525,16 @@ (deftype precurbridge-span (structure) () - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) (deftype precurbridge (process-drawable) - ((root-override collide-shape-moving :offset 112) - (smush smush-control :inline :offset-assert 176) - (base vector :inline :offset-assert 208) - (activation-point vector :inline :offset-assert 224) - (span-array precurbridge-span 8 :offset-assert 240) + ((root collide-shape-moving :override) + (smush smush-control :inline) + (base vector :inline) + (activation-point vector :inline) + (span-array precurbridge-span 8) ) - :heap-base #xa0 - :method-count-assert 20 - :size-assert #x110 - :flag-assert #x1400a00110 (:states precurbridge-activate (precurbridge-active symbol) @@ -655,7 +617,7 @@ :trans rider-trans :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root trans))) (ja-no-eval :group! precurbridge-idle-ja :num! (seek! max 0.25) :frame-num 0.0) (until (ja-done? 0) (if (rand-vu-percent? 0.1) @@ -675,7 +637,7 @@ (('bonk) (let* ((gp-0 (the-as object (-> block param 0))) (a0-2 (-> (the-as touching-shapes-entry gp-0) head)) - (s5-0 (-> self root-override)) + (s5-0 (-> self root)) ) (get-touched-prim a0-2 s5-0 (the-as touching-shapes-entry gp-0)) ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s5-0) @@ -692,14 +654,14 @@ (ja :group! precurbridge-float-ja :num! min) ) (ja-post) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (logior! (-> self mask) (process-mask actor-pause)) (loop (if (not (movie?)) (logior! (-> self mask) (process-mask platform)) ) (cond - ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + ((and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (when (not (ja-group? precurbridge-static-ja)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! precurbridge-static-ja :num! min) @@ -720,7 +682,7 @@ :post rider-post ) -(defmethod init-from-entity! precurbridge ((this precurbridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this precurbridge) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -884,16 +846,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set-vector! (-> this activation-point) 1765785.6 61440.0 -1279180.8 1.0) (initialize-skeleton this *precurbridge-sg* '()) (logior! (-> this skel status) (janim-status inited)) (ja-post) - (update-transforms! (-> this root-override)) - (set! (-> this base quad) (-> this root-override trans quad)) - (set! (-> this sound) (new 'process 'ambient-sound arg0 (-> this root-override trans))) + (update-transforms! (-> this root)) + (set! (-> this base quad) (-> this root trans quad)) + (set! (-> this sound) (new 'process 'ambient-sound arg0 (-> this root trans))) (cond ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (logclear! (-> this mask) (process-mask actor-pause)) @@ -907,13 +869,9 @@ ) (deftype maindoor (process-drawable) - ((root-override collide-shape :offset 112) - (thresh vector :inline :offset-assert 176) + ((root collide-shape :override) + (thresh vector :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc0 - :flag-assert #x14005000c0 (:states (maindoor-closed symbol) (maindoor-open symbol) @@ -934,20 +892,20 @@ (ja :num-func num-func-identity :frame-num 0.0) ) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (loop (when (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) (and (and *target* - (>= (-> self thresh w) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + (>= (-> self thresh w) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) - (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root trans))) (go maindoor-open #f) ) (if (and *target* - (>= (-> self thresh w) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + (>= (-> self thresh w) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (level-hint-spawn (text-id sidekick-hint-rounddoor) @@ -958,8 +916,8 @@ ) ) (when (ja-min? 0) - (set! (-> self root-override root-prim prim-core action) (collide-action solid)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> self root root-prim prim-core action) (collide-action solid)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) ) (ja :num! (seek! 0.0)) (ja-post) @@ -976,8 +934,8 @@ (if arg0 (ja :num-func num-func-identity :frame-num max) ) - (set! (-> self root-override root-prim prim-core action) (collide-action)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) + (set! (-> self root root-prim prim-core action) (collide-action)) + (set! (-> self root root-prim prim-core offense) (collide-offense no-offense)) (while (not (ja-max? 0)) (ja :num! (seek! max 2.0)) (if (and (not arg0) (rand-vu-percent? 0.2)) @@ -993,7 +951,7 @@ :post ja-post ) -(defmethod init-from-entity! maindoor ((this maindoor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this maindoor) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) @@ -1006,15 +964,15 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *maindoor-sg* '()) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this thresh w) 61440.0) (if (or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (and (and *target* - (>= (-> this thresh w) (vector-vector-distance (-> this root-override trans) (-> *target* control trans))) + (>= (-> this thresh w) (vector-vector-distance (-> this root trans) (-> *target* control trans))) ) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) @@ -1027,10 +985,6 @@ (deftype sidedoor (eco-door) () - :heap-base #xa0 - :method-count-assert 27 - :size-assert #x104 - :flag-assert #x1b00a00104 ) @@ -1039,7 +993,7 @@ :bounds (static-spherem 0 0 0 8) ) -(defmethod eco-door-method-24 sidedoor ((this sidedoor)) +(defmethod eco-door-method-24 ((this sidedoor)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -1052,38 +1006,34 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod eco-door-method-25 sidedoor ((this sidedoor)) +(defmethod eco-door-method-25 ((this sidedoor)) (initialize-skeleton this *sidedoor-sg* '()) (set! (-> this open-distance) 22528.0) (set! (-> this close-distance) 61440.0) (set! (-> this speed) 6.0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) 0 (none) ) (deftype jngpusher (process-drawable) - ((root-override trsqv :offset 112) - (sync sync-info :inline :offset-assert 176) - (back-prim collide-shape-prim :offset-assert 184) + ((root trsqv :override) + (sync sync-info :inline) + (back-prim collide-shape-prim) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states jngpusher-idle ) ) -(defmethod relocate jngpusher ((this jngpusher) (arg0 int)) +(defmethod relocate ((this jngpusher) (arg0 int)) (if (nonzero? (-> this back-prim)) (&+! (-> this back-prim) arg0) ) @@ -1116,7 +1066,7 @@ :post rider-post ) -(defmethod init-from-entity! jngpusher ((this jngpusher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this jngpusher) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -1164,10 +1114,6 @@ (deftype jungle-water (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) @@ -1184,7 +1130,7 @@ ) ) -(defmethod water-vol-method-22 jungle-water ((this jungle-water)) +(defmethod water-vol-method-22 ((this jungle-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/goal_src/jak1/levels/jungle/jungle-part.gc b/goal_src/jak1/levels/jungle/jungle-part.gc index 3a50399aca6..a3ceac72eb7 100644 --- a/goal_src/jak1/levels/jungle/jungle-part.gc +++ b/goal_src/jak1/levels/jungle/jungle-part.gc @@ -9,10 +9,6 @@ (deftype jungle-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/jungle/junglefish.gc b/goal_src/jak1/levels/jungle/junglefish.gc index 9c0b07c4385..1cb5d15bd57 100644 --- a/goal_src/jak1/levels/jungle/junglefish.gc +++ b/goal_src/jak1/levels/jungle/junglefish.gc @@ -9,10 +9,6 @@ (deftype junglefish (nav-enemy) () - :heap-base #x120 - :method-count-assert 76 - :size-assert #x190 - :flag-assert #x4c01200190 ) @@ -23,7 +19,7 @@ nav-enemy-default-event-handler -(defmethod common-post junglefish ((this junglefish)) +(defmethod common-post ((this junglefish)) (water-control-method-10 (-> this water)) (call-parent-method this) 0 @@ -219,7 +215,7 @@ nav-enemy-default-event-handler ) ) -(defmethod init-from-entity! junglefish ((this junglefish) (arg0 entity-actor)) +(defmethod init-from-entity! ((this junglefish) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) diff --git a/goal_src/jak1/levels/jungle/junglesnake.gc b/goal_src/jak1/levels/jungle/junglesnake.gc index e6a9d0dbe9f..f10f9aac9db 100644 --- a/goal_src/jak1/levels/jungle/junglesnake.gc +++ b/goal_src/jak1/levels/jungle/junglesnake.gc @@ -44,53 +44,43 @@ ) (deftype junglesnake-twist-joint (structure) - ((joint-index int32 :offset-assert 0) - (ry float :offset-assert 4) - (drag-delta-ry float :offset-assert 8) + ((joint-index int32) + (ry float) + (drag-delta-ry float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype junglesnake-tilt-joint (structure) - ((joint-index int32 :offset-assert 0) - (flip-it symbol :offset-assert 4) + ((joint-index int32) + (flip-it symbol) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype junglesnake (process-drawable) - ((root-override collide-shape :offset 112) - (state-time2 time-frame :offset-assert 176) - (hit-player symbol :offset 184) - (is-lethal? symbol :offset-assert 188) - (refractory-delay int32 :offset-assert 192) - (ry float :offset-assert 196) - (des-ry float :offset-assert 200) - (tilt float :offset-assert 204) - (des-tilt float :offset-assert 208) - (track-player-ry symbol :offset-assert 212) - (track-player-tilt symbol :offset-assert 216) - (twist-joints junglesnake-twist-joint 24 :inline :offset 220) - (tilt-joints junglesnake-tilt-joint 3 :inline :offset 604) + ((root collide-shape :override) + (state-time2 time-frame) + (hit-player symbol :offset 184) + (is-lethal? symbol) + (refractory-delay int32) + (ry float) + (des-ry float) + (tilt float) + (des-tilt float) + (track-player-ry symbol) + (track-player-tilt symbol) + (twist-joints junglesnake-twist-joint 24 :inline :offset 220) + (tilt-joints junglesnake-tilt-joint 3 :inline :offset 604) ) - :heap-base #x220 - :method-count-assert 25 - :size-assert #x28c - :flag-assert #x190220028c (:methods - (junglesnake-method-20 (_type_) symbol 20) - (junglesnake-method-21 (_type_) symbol 21) - (junglesnake-method-22 (_type_ float) symbol 22) - (junglesnake-method-23 (_type_) none 23) - (junglesnake-method-24 (_type_) none 24) + (junglesnake-method-20 (_type_) symbol) + (junglesnake-method-21 (_type_) symbol) + (junglesnake-method-22 (_type_ float) symbol) + (junglesnake-method-23 (_type_) none) + (junglesnake-method-24 (_type_) none) ) (:states junglesnake-attack @@ -109,7 +99,7 @@ (('touch) (when (and *target* ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) ) @@ -128,7 +118,7 @@ ) ) (else - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) (send-event arg0 'shove @@ -147,12 +137,10 @@ junglesnake-default-event-handler -(defmethod junglesnake-method-20 junglesnake ((this junglesnake)) +(defmethod junglesnake-method-20 ((this junglesnake)) (when (and *target* (-> this track-player-ry)) (let ((v1-3 (target-pos 0))) - (set! (-> this des-ry) - (atan (- (-> v1-3 x) (-> this root-override trans x)) (- (-> v1-3 z) (-> this root-override trans z))) - ) + (set! (-> this des-ry) (atan (- (-> v1-3 x) (-> this root trans x)) (- (-> v1-3 z) (-> this root trans z)))) ) ) (let ((f0-7 (deg-diff (-> this ry) (-> this des-ry)))) @@ -198,13 +186,7 @@ junglesnake-default-event-handler (s2-0 (new 'stack-no-clear 'matrix)) ) (let ((s1-0 (new 'stack-no-clear 'vector))) - (set-vector! - s1-0 - (-> arg0 root-override trans x) - (-> arg0 root-override trans y) - (-> arg0 root-override trans z) - 1.0 - ) + (set-vector! s1-0 (-> arg0 root trans x) (-> arg0 root trans y) (-> arg0 root trans z) 1.0) (matrix-translate! s2-0 s1-0) (vector-negate! s1-0 s1-0) (matrix-translate! s3-0 s1-0) @@ -336,9 +318,9 @@ junglesnake-default-event-handler :trans (behavior () (when *target* (let* ((a0-1 (target-pos 0)) - (f0-1 (- (-> a0-1 y) (-> self root-override trans y))) + (f0-1 (- (-> a0-1 y) (-> self root trans y))) ) - (if (and (>= 40960.0 f0-1) (>= 143360.0 (vector-vector-xz-distance a0-1 (-> self root-override trans)))) + (if (and (>= 40960.0 f0-1) (>= 143360.0 (vector-vector-xz-distance a0-1 (-> self root trans)))) (go junglesnake-wake) ) ) @@ -367,7 +349,7 @@ junglesnake-default-event-handler (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -393,7 +375,7 @@ junglesnake-default-event-handler (set! (-> self track-player-tilt) #t) ) :trans (behavior () - (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (time-elapsed? (-> self state-time) (-> self refractory-delay)) (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) @@ -404,8 +386,8 @@ junglesnake-default-event-handler ) (when *target* (let ((a0-8 (target-pos 0))) - (if (or (>= (- (-> a0-8 y) (-> self root-override trans y)) 57344.0) - (>= (vector-vector-xz-distance a0-8 (-> self root-override trans)) 163840.0) + (if (or (>= (- (-> a0-8 y) (-> self root trans y)) 57344.0) + (>= (vector-vector-xz-distance a0-8 (-> self root trans)) 163840.0) ) (go junglesnake-give-up) ) @@ -416,7 +398,7 @@ junglesnake-default-event-handler (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -460,7 +442,7 @@ junglesnake-default-event-handler (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -472,18 +454,16 @@ junglesnake-default-event-handler (set! (-> self track-player-tilt) #t) (ja-channel-push! 2 (seconds 0.15)) (junglesnake-method-23 self) - (let ((f30-0 (lerp-scale 0.0 1.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)) 0.0 24576.0)) - ) + (let ((f30-0 (lerp-scale 0.0 1.0 (vector-vector-distance (target-pos 0) (-> self root trans)) 0.0 24576.0))) (ja-no-eval :group! junglesnake-strike-close-ja :num! (seek! max 1.25) :frame-num 0.0) (ja-no-eval :chan 1 :group! junglesnake-strike-far-ja :num! (chan 0) :frame-interp f30-0 :frame-num 0.0) (until (ja-done? 0) (suspend) - (set! f30-0 - (seek - f30-0 - (lerp-scale 0.0 1.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)) 0.0 24576.0) - (* 2.0 (seconds-per-frame)) - ) + (set! f30-0 (seek + f30-0 + (lerp-scale 0.0 1.0 (vector-vector-distance (target-pos 0) (-> self root trans)) 0.0 24576.0) + (* 2.0 (seconds-per-frame)) + ) ) (ja :num! (seek! max 1.25)) (ja :chan 1 :num! (chan 0) :frame-interp f30-0) @@ -528,7 +508,7 @@ junglesnake-default-event-handler (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (set! (-> s5-0 quad) (-> gp-0 quad)) (+! (-> s5-0 y) 131072.0) (ja-no-eval :group! junglesnake-give-up-ja :num! (seek! max 0.5) :frame-num 0.0) @@ -538,17 +518,17 @@ junglesnake-default-event-handler (f0-7 (/ f0-6 (the float (+ (-> v1-18 data 0 length) -1)))) (s4-0 (new 'stack-no-clear 'vector)) ) - (set-vector! (-> self root-override scale) 1.0 (- 1.0 f0-7) 1.0 1.0) + (set-vector! (-> self root scale) 1.0 (- 1.0 f0-7) 1.0 1.0) (vector-lerp! s4-0 gp-0 s5-0 f0-7) - (move-to-point! (-> self root-override) s4-0) + (move-to-point! (-> self root) s4-0) ) (suspend) (ja :num! (seek! max 0.5)) ) ) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) - (set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (go junglesnake-sleeping) ) :post transform-post @@ -558,7 +538,7 @@ junglesnake-default-event-handler :event process-drawable-death-event-handler :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-channel-push! 1 (seconds 0.15)) (ja-no-eval :group! junglesnake-death-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -570,10 +550,10 @@ junglesnake-default-event-handler :post ja-post ) -(defmethod junglesnake-method-23 junglesnake ((this junglesnake)) +(defmethod junglesnake-method-23 ((this junglesnake)) (when (not (-> this is-lethal?)) (set! (-> this is-lethal?) #t) - (let ((v1-5 (-> (the-as collide-shape-prim-group (-> this root-override root-prim)) prims 0))) + (let ((v1-5 (-> (the-as collide-shape-prim-group (-> this root root-prim)) prims 0))) (logclear! (-> v1-5 prim-core action) (collide-action solid)) ) ) @@ -581,13 +561,13 @@ junglesnake-default-event-handler (none) ) -(defmethod junglesnake-method-24 junglesnake ((this junglesnake)) +(defmethod junglesnake-method-24 ((this junglesnake)) (when (-> this is-lethal?) (set! (-> this is-lethal?) #f) - (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root-override root-prim)) prims 0))) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) prims 0))) (logior! (-> v1-4 prim-core action) (collide-action solid)) ) - (do-push-aways! (-> this root-override)) + (do-push-aways! (-> this root)) ) 0 (none) @@ -625,7 +605,7 @@ junglesnake-default-event-handler ) ) -(defmethod junglesnake-method-22 junglesnake ((this junglesnake) (arg0 float)) +(defmethod junglesnake-method-22 ((this junglesnake) (arg0 float)) (let ((f0-0 0.0)) (dotimes (v1-0 24) (let ((a2-2 (-> this twist-joints v1-0))) @@ -641,7 +621,7 @@ junglesnake-default-event-handler #f ) -(defmethod junglesnake-method-21 junglesnake ((this junglesnake)) +(defmethod junglesnake-method-21 ((this junglesnake)) (dotimes (v1-0 3) (let ((a1-2 (-> this tilt-joints v1-0))) (set! (-> a1-2 joint-index) (+ v1-0 23)) @@ -659,7 +639,7 @@ junglesnake-default-event-handler ) ) -(defmethod init-from-entity! junglesnake ((this junglesnake) (arg0 entity-actor)) +(defmethod init-from-entity! ((this junglesnake) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) @@ -752,7 +732,7 @@ junglesnake-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *junglesnake-sg* '()) @@ -761,13 +741,13 @@ junglesnake-default-event-handler ) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 173) this)) (set! (-> this is-lethal?) #f) - (set! (-> this ry) (y-angle (-> this root-override))) + (set! (-> this ry) (y-angle (-> this root))) (set! (-> this des-ry) (-> this ry)) (set! (-> this tilt) 0.0) (set! (-> this des-tilt) (-> this tilt)) (set! (-> this track-player-ry) #f) (set! (-> this track-player-tilt) #f) - (quaternion-identity! (-> this root-override quat)) + (quaternion-identity! (-> this root quat)) (junglesnake-method-22 this (-> this ry)) (junglesnake-method-21 this) (logior! (-> this skel status) (janim-status inited)) diff --git a/goal_src/jak1/levels/jungleb/aphid.gc b/goal_src/jak1/levels/jungleb/aphid.gc index 5e7f810c4f1..8e4891137e5 100644 --- a/goal_src/jak1/levels/jungleb/aphid.gc +++ b/goal_src/jak1/levels/jungleb/aphid.gc @@ -8,12 +8,8 @@ ;; DECOMP BEGINS (deftype aphid (nav-enemy) - ((try int32 :offset-assert 400) + ((try int32) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x194 - :flag-assert #x4c01300194 ) @@ -35,7 +31,7 @@ (none) ) -(defmethod attack-handler aphid ((this aphid) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this aphid) (arg0 process) (arg1 event-message-block)) (cond ((or (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf5)) (= arg0 (ppointer->process (-> this parent))) @@ -252,7 +248,7 @@ ) ) -(defmethod initialize-collision aphid ((this aphid)) +(defmethod initialize-collision ((this aphid)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -276,7 +272,7 @@ (none) ) -(defmethod nav-enemy-method-48 aphid ((this aphid)) +(defmethod nav-enemy-method-48 ((this aphid)) (initialize-skeleton this *aphid-sg* '()) (init-defaults! this *aphid-nav-enemy-info*) (set! (-> this neck up) (the-as uint 0)) diff --git a/goal_src/jak1/levels/jungleb/jungleb-obs.gc b/goal_src/jak1/levels/jungleb/jungleb-obs.gc index 88a74621665..bafcd79adca 100644 --- a/goal_src/jak1/levels/jungleb/jungleb-obs.gc +++ b/goal_src/jak1/levels/jungleb/jungleb-obs.gc @@ -9,14 +9,10 @@ ;; DECOMP BEGINS (deftype eggtop (process-drawable) - ((root-override collide-shape-moving :offset 112) - (cam-tracker handle :offset-assert 176) - (sound-id sound-id :offset-assert 184) + ((root collide-shape-moving :override) + (cam-tracker handle) + (sound-id sound-id) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states (eggtop-close symbol) eggtop-idle @@ -194,12 +190,12 @@ (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) (go eggtop-close #f) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (sound-play "electric-loop" :id (-> self sound-id)) ) :code (behavior () (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (anim-loop) ) :post ja-post @@ -221,7 +217,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (set! (-> self cam-tracker) @@ -289,7 +285,7 @@ :post rider-post ) -(defmethod init-from-entity! eggtop ((this eggtop) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eggtop) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -308,12 +304,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *eggtop-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 189) this)) (set! (-> this sound-id) (new-sound-id)) (cond @@ -322,7 +318,7 @@ ) (else (birth-pickup-at-point - (vector+! (new 'stack-no-clear 'vector) (-> this root-override trans) (new 'static 'vector :y 6144.0 :w 1.0)) + (vector+! (new 'stack-no-clear 'vector) (-> this root trans) (new 'static 'vector :y 6144.0 :w 1.0)) (pickup-type fuel-cell) (the float (-> this entity extra perm task)) #f @@ -337,10 +333,6 @@ (deftype jng-iris-door (eco-door) () - :heap-base #xa0 - :method-count-assert 27 - :size-assert #x104 - :flag-assert #x1b00a00104 ) @@ -349,7 +341,7 @@ :bounds (static-spherem 0 0 0 8) ) -(defmethod eco-door-method-24 jng-iris-door ((this jng-iris-door)) +(defmethod eco-door-method-24 ((this jng-iris-door)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -362,17 +354,17 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod eco-door-method-25 jng-iris-door ((this jng-iris-door)) +(defmethod eco-door-method-25 ((this jng-iris-door)) (initialize-skeleton this *jng-iris-door-sg* '()) (set! (-> this open-distance) 32768.0) (set! (-> this close-distance) 49152.0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) 0 (none) ) diff --git a/goal_src/jak1/levels/jungleb/plant-boss.gc b/goal_src/jak1/levels/jungleb/plant-boss.gc index 0711f749f2a..b2fae13fabd 100644 --- a/goal_src/jak1/levels/jungleb/plant-boss.gc +++ b/goal_src/jak1/levels/jungleb/plant-boss.gc @@ -10,31 +10,27 @@ ;; DECOMP BEGINS (deftype plant-boss (process-drawable) - ((root-override collide-shape :offset 112) - (neck joint-mod :offset-assert 176) - (body joint-mod :offset-assert 180) - (leaf (pointer plant-boss-leaf) 2 :offset-assert 184) - (energy float :offset-assert 192) - (health float :offset-assert 196) - (ate symbol :offset-assert 200) - (cycle-count int32 :offset-assert 204) - (snap-count int32 :offset-assert 208) - (attack-prim collide-shape-prim-sphere 3 :offset-assert 212) - (death-prim collide-shape-prim-mesh 3 :offset-assert 224) - (cam-tracker handle :offset-assert 240) - (want-aphid-count int32 :offset-assert 248) - (aphid-count int32 :offset-assert 252) - (aphid-spawn-time time-frame :offset-assert 256) - (interp float :offset-assert 264) - (try int32 :offset-assert 268) - (camera handle :offset-assert 272) - (money handle :offset-assert 280) - (try-inc symbol :offset-assert 288) + ((root collide-shape :override) + (neck joint-mod) + (body joint-mod) + (leaf (pointer plant-boss-leaf) 2) + (energy float) + (health float) + (ate symbol) + (cycle-count int32) + (snap-count int32) + (attack-prim collide-shape-prim-sphere 3) + (death-prim collide-shape-prim-mesh 3) + (cam-tracker handle) + (want-aphid-count int32) + (aphid-count int32) + (aphid-spawn-time time-frame) + (interp float) + (try int32) + (camera handle) + (money handle) + (try-inc symbol) ) - :heap-base #xc0 - :method-count-assert 20 - :size-assert #x124 - :flag-assert #x1400c00124 (:states (plant-boss-attack int) (plant-boss-dead symbol) @@ -52,7 +48,7 @@ ) -(defmethod relocate plant-boss ((this plant-boss) (arg0 int)) +(defmethod relocate ((this plant-boss) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) @@ -71,14 +67,10 @@ ) (deftype plant-boss-arm (process-drawable) - ((parent-override (pointer plant-boss) :offset 12) - (root-override collide-shape :offset 112) - (side int32 :offset-assert 176) + ((root collide-shape :override) + (parent-override (pointer plant-boss) :overlay-at parent) + (side int32) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states (plant-boss-arm-die symbol) (plant-boss-arm-hit basic) @@ -96,15 +88,11 @@ (deftype plant-boss-leaf (process-drawable) - ((root-override collide-shape-moving :offset 112) - (side int32 :offset-assert 176) - (state-object symbol :offset-assert 180) - (state-time-frame time-frame :offset-assert 184) + ((root collide-shape-moving :override) + (side int32) + (state-object symbol) + (state-time-frame time-frame) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc0 - :flag-assert #x14005000c0 (:states plant-boss-leaf-bounce plant-boss-leaf-close @@ -205,7 +193,7 @@ (('touch 'attack) (if (and ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) (not (ja-group? plant-boss-main-vulnerable2idle-ja)) @@ -277,8 +265,8 @@ (defstate plant-boss-arm-die (plant-boss-arm) :code (behavior ((arg0 symbol)) - (let ((a0-1 (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0))) - (set! (-> self root-override root-prim local-sphere w) 81920.0) + (let ((a0-1 (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0))) + (set! (-> self root root-prim local-sphere w) 81920.0) (set! (-> (the-as collide-shape-prim-mesh a0-1) local-sphere w) 69632.0) (set! (-> (the-as collide-shape-prim-mesh a0-1) collide-with) (collide-kind target)) (set! (-> (the-as collide-shape-prim-mesh a0-1) prim-core collide-as) (collide-kind enemy)) @@ -329,11 +317,11 @@ (ja :group! plant-boss-arms-die-ja :num! max) ) ) - (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 1)) prim-core action) (collide-action)) + (set! (-> (find-prim-by-id (-> self root) (the-as uint 1)) prim-core action) (collide-action)) 0 - (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 2)) prim-core action) (collide-action)) + (set! (-> (find-prim-by-id (-> self root) (the-as uint 2)) prim-core action) (collide-action)) 0 - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (loop (logior! (-> self mask) (process-mask sleep)) (suspend) @@ -422,7 +410,7 @@ ) ) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja :group! plant-boss-back-arms-die-ja :num! max) (loop (suspend) @@ -527,7 +515,7 @@ (when (not arg0) (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 4)) - (+! (-> self root-override trans z) (* -4096.0 (seconds-per-frame))) + (+! (-> self root trans z) (* -4096.0 (seconds-per-frame))) (suspend) ) ) @@ -574,10 +562,10 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set-yaw-angle-clear-roll-pitch! (-> self root-override) arg1) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-yaw-angle-clear-roll-pitch! (-> self root) arg1) (set! (-> self side) arg2) (initialize-skeleton self *plant-boss-arm-sg* '()) (set! (-> self draw shadow-ctrl) *plant-boss-shadow-control*) @@ -614,10 +602,10 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set-yaw-angle-clear-roll-pitch! (-> self root-override) arg1) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-yaw-angle-clear-roll-pitch! (-> self root) arg1) (set! (-> self side) arg2) (initialize-skeleton self *plant-boss-back-arms-sg* '()) (set! (-> self draw shadow-ctrl) *plant-boss-shadow-control*) @@ -627,10 +615,10 @@ (defbehavior plant-boss-vine-init plant-boss-arm ((arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) (stack-size-set! (-> self main-thread) 128) - (set! (-> self root-override) (the-as collide-shape (new 'process 'trsqv))) - (set-vector! (-> self root-override scale) arg2 arg2 arg2 1.0) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-zxy! (-> self root-override quat) arg1) + (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) + (set-vector! (-> self root scale) arg2 arg2 arg2 1.0) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-zxy! (-> self root quat) arg1) (set! (-> self side) arg3) (initialize-skeleton self *plant-boss-vine-sg* '()) (go plant-boss-vine-idle) @@ -639,10 +627,10 @@ (defbehavior plant-boss-root-init plant-boss-arm ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 int)) (stack-size-set! (-> self main-thread) 128) - (set! (-> self root-override) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root-override scale quad) (-> arg2 quad)) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-zxy! (-> self root-override quat) arg1) + (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) + (set! (-> self root scale quad) (-> arg2 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-zxy! (-> self root quat) arg1) (set! (-> self side) arg3) (initialize-skeleton self *plant-boss-root-sg* '()) (go plant-boss-root-idle) @@ -894,10 +882,10 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set-yaw-angle-clear-roll-pitch! (-> self root-override) arg1) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-yaw-angle-clear-roll-pitch! (-> self root) arg1) (set! (-> self side) arg2) (initialize-skeleton self *plant-boss-leaf-sg* '()) (set! (-> self draw shadow-ctrl) *plant-boss-shadow-control*) @@ -933,10 +921,8 @@ (ja-no-eval :group! plant-boss-main-initial-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek! (-> self energy) (the-as float 0.25) (seconds-per-frame)) - (if (and (and *target* - (>= 245760.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) - (< (fabs (- (-> (target-pos 0) y) (-> self root-override trans y))) 40960.0) + (if (and (and *target* (>= 245760.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (< (fabs (- (-> (target-pos 0) y) (-> self root trans y))) 40960.0) ) (go plant-boss-intro) ) @@ -1046,7 +1032,7 @@ (set! (-> self neck flex-blend) 1.0) ) :trans (behavior () - (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) + (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self root trans)))) (if (< 409600.0 f30-0) (go plant-boss-far-idle) ) @@ -1170,7 +1156,7 @@ ) ) :trans (behavior () - (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) + (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self root trans)))) (if (< 409600.0 f0-0) (go plant-boss-far-idle) ) @@ -1194,7 +1180,7 @@ ) ) ((time-elapsed? (-> self aphid-spawn-time) (seconds 1.4)) - (when (process-spawn aphid self (-> self root-override trans) (target-pos 0) :to self) + (when (process-spawn aphid self (-> self root trans) (target-pos 0) :to self) (+! (-> self aphid-count) 1) (seekl! (-> self want-aphid-count) 0 1) (set-time! (-> self aphid-spawn-time)) @@ -1212,7 +1198,7 @@ (('attack) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) (send-event @@ -1308,7 +1294,7 @@ (('touch 'attack) (when (and ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) (not (ja-group? plant-boss-main-vulnerable2idle-ja)) @@ -1346,7 +1332,7 @@ (let ((f30-0 (lerp-scale (the-as float 0.0) (the-as float 1.0) - (vector-vector-distance (target-pos 0) (-> self root-override trans)) + (vector-vector-distance (target-pos 0) (-> self root trans)) (the-as float 26624.0) (the-as float 86016.0) ) @@ -1360,7 +1346,7 @@ (lerp-scale (the-as float 1.0) (the-as float 0.0) - (vector-vector-distance (target-pos 0) (-> self root-override trans)) + (vector-vector-distance (target-pos 0) (-> self root trans)) (the-as float 26624.0) (the-as float 86016.0) ) @@ -1629,9 +1615,9 @@ (set! (-> self death-prim 1 collide-with) (collide-kind target)) (set! (-> self death-prim 1 prim-core offense) (collide-offense indestructible)) (logior! (-> self death-prim 1 prim-core action) (collide-action solid)) - (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 8)) prim-core action) (collide-action)) + (set! (-> (find-prim-by-id (-> self root) (the-as uint 8)) prim-core action) (collide-action)) 0 - (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 16)) prim-core action) (collide-action)) + (set! (-> (find-prim-by-id (-> self root) (the-as uint 16)) prim-core action) (collide-action)) 0 (logior! (-> self mask) (process-mask actor-pause)) (remove-setting! 'music) @@ -1639,7 +1625,7 @@ ) :post (behavior () (plant-boss-post) - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) ) ) @@ -1667,7 +1653,7 @@ (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 5)) (transform-post) - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) (suspend) ) ) @@ -1709,7 +1695,7 @@ :post rider-post ) -(defmethod init-from-entity! plant-boss ((this plant-boss) (arg0 entity-actor)) +(defmethod init-from-entity! ((this plant-boss) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) @@ -1765,7 +1751,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *plant-boss-sg* '()) @@ -1773,11 +1759,7 @@ (process-spawn plant-boss-arm :init plant-boss-arm-init - (vector+! - (new-stack-vector0) - (-> this root-override trans) - (new 'static 'vector :x -24576.0 :z 8192.0 :w 1.0) - ) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x -24576.0 :z 8192.0 :w 1.0)) -8192.0 1 :to this @@ -1785,7 +1767,7 @@ (process-spawn plant-boss-arm :init plant-boss-arm-init - (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :x 24576.0 :z 8192.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x 24576.0 :z 8192.0 :w 1.0)) 8192.0 0 :to this @@ -1793,7 +1775,7 @@ (process-spawn plant-boss-arm :init plant-boss-back-arms-init - (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :w 1.0)) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :w 1.0)) 0.0 2 :to this @@ -1801,7 +1783,7 @@ (process-spawn plant-boss-arm :init plant-boss-vine-init - (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :x 38912.0 :z 8192.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x 38912.0 :z 8192.0 :w 1.0)) (new 'static 'vector :y 14563.556) 1.0 3 @@ -1810,11 +1792,7 @@ (process-spawn plant-boss-arm :init plant-boss-vine-init - (vector+! - (new-stack-vector0) - (-> this root-override trans) - (new 'static 'vector :x -40960.0 :z 8192.0 :w 1.0) - ) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x -40960.0 :z 8192.0 :w 1.0)) (new 'static 'vector :y -5461.3335) 1.0 3 @@ -1823,11 +1801,7 @@ (process-spawn plant-boss-arm :init plant-boss-vine-init - (vector+! - (new-stack-vector0) - (-> this root-override trans) - (new 'static 'vector :x -29491.2 :z -7168.0 :w 1.0) - ) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x -29491.2 :z -7168.0 :w 1.0)) (new 'static 'vector :x -1820.4445 :y -11286.756) 0.8 3 @@ -1836,11 +1810,7 @@ (process-spawn plant-boss-arm :init plant-boss-vine-init - (vector+! - (new-stack-vector0) - (-> this root-override trans) - (new 'static 'vector :x 32768.0 :z -3072.0 :w 1.0) - ) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x 32768.0 :z -3072.0 :w 1.0)) (new 'static 'vector :x -910.2222 :y 22755.555) 0.8 3 @@ -1849,7 +1819,7 @@ (process-spawn plant-boss-arm :init plant-boss-root-init - (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :x 18841.6 :z 4096.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x 18841.6 :z 4096.0 :w 1.0)) (new 'static 'vector :y -4096.0) (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) 4 @@ -1858,11 +1828,7 @@ (process-spawn plant-boss-arm :init plant-boss-root-init - (vector+! - (new-stack-vector0) - (-> this root-override trans) - (new 'static 'vector :x -18841.6 :z 4096.0 :w 1.0) - ) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x -18841.6 :z 4096.0 :w 1.0)) (new 'static 'vector :x 364.0889 :y 4096.0) (new 'static 'vector :x 1.0 :y 1.25 :z 1.0) 4 @@ -1871,28 +1837,27 @@ (process-spawn plant-boss-arm :init plant-boss-root-init - (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :z -2048.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :z -2048.0 :w 1.0)) (new 'static 'vector :x 1820.4445) (new 'static 'vector :x 0.9 :y 1.5 :z 1.0) 4 :to this ) - (set! (-> this leaf 0) - (process-spawn - plant-boss-leaf - :init plant-boss-leaf-init - (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :w 1.0)) - 0.0 - 0 - :to this - ) + (set! (-> this leaf 0) (process-spawn + plant-boss-leaf + :init plant-boss-leaf-init + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :w 1.0)) + 0.0 + 0 + :to this + ) ) (set! (-> this leaf 1) (process-spawn plant-boss-leaf :init plant-boss-leaf-init (vector+! (new-stack-vector0) - (-> this root-override trans) + (-> this root trans) (new 'static 'vector :x -13189.12 :y 2838.528 :z 12288.0 :w 1.0) ) 0.0 diff --git a/goal_src/jak1/levels/jungleb/plat-flip.gc b/goal_src/jak1/levels/jungleb/plat-flip.gc index 79a018b46ed..8479088c012 100644 --- a/goal_src/jak1/levels/jungleb/plat-flip.gc +++ b/goal_src/jak1/levels/jungleb/plat-flip.gc @@ -8,21 +8,17 @@ ;; DECOMP BEGINS (deftype plat-flip (process-drawable) - ((root-override collide-shape-moving :offset 112) - (path-pos float :offset-assert 176) - (before-turn-down-time float :offset-assert 180) - (turn-down-time float :offset-assert 184) - (before-turn-up-time float :offset-assert 188) - (turn-up-time float :offset-assert 192) - (total-time float :offset-assert 196) - (sync sync-info :inline :offset-assert 200) - (base-pos vector :inline :offset-assert 208) - (smush smush-control :inline :offset-assert 224) + ((root collide-shape-moving :override) + (path-pos float) + (before-turn-down-time float) + (turn-down-time float) + (before-turn-up-time float) + (turn-up-time float) + (total-time float) + (sync sync-info :inline) + (base-pos vector :inline) + (smush smush-control :inline) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #x100 - :flag-assert #x1400900100 (:states plat-flip-idle ) @@ -92,7 +88,7 @@ (let ((s5-5 (new 'stack-no-clear 'vector))) (set! (-> s5-5 quad) (-> self base-pos quad)) (+! (-> s5-5 y) (* 1638.4 (update! (-> self smush)))) - (move-to-point! (-> self root-override) s5-5) + (move-to-point! (-> self root) s5-5) ) (suspend) ) @@ -101,7 +97,7 @@ :post rider-post ) -(defmethod init-from-entity! plat-flip ((this plat-flip) (arg0 entity-actor)) +(defmethod init-from-entity! ((this plat-flip) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -122,10 +118,10 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (set! (-> this base-pos quad) (-> this root-override trans quad)) + (set! (-> this base-pos quad) (-> this root trans quad)) (initialize-skeleton this *plat-flip-sg* '()) (logior! (-> this skel status) (janim-status inited)) (let ((f30-0 300.0)) @@ -176,7 +172,7 @@ ) ) ) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go plat-flip-idle) (none) ) diff --git a/goal_src/jak1/levels/lavatube/assistant-lavatube.gc b/goal_src/jak1/levels/lavatube/assistant-lavatube.gc index 92ee7edb58a..6bbc10ece82 100644 --- a/goal_src/jak1/levels/lavatube/assistant-lavatube.gc +++ b/goal_src/jak1/levels/lavatube/assistant-lavatube.gc @@ -9,10 +9,6 @@ (deftype assistant-lavatube-start (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -22,7 +18,7 @@ :shadow assistant-lavatube-start-shadow-mg ) -(defmethod play-anim! assistant-lavatube-start ((this assistant-lavatube-start) (arg0 symbol)) +(defmethod play-anim! ((this assistant-lavatube-start) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (if arg0 @@ -49,7 +45,7 @@ ) ) -(defmethod get-art-elem assistant-lavatube-start ((this assistant-lavatube-start)) +(defmethod get-art-elem ((this assistant-lavatube-start)) (-> this draw art-group data 3) ) @@ -58,7 +54,7 @@ :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) (when (and (cond - ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + ((and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) #t ) (else @@ -138,12 +134,12 @@ ) ) -(defmethod should-display? assistant-lavatube-start ((this assistant-lavatube-start)) +(defmethod should-display? ((this assistant-lavatube-start)) (first-any (-> this tasks) #t) (= (current-status (-> this tasks)) (task-status need-reward-speech)) ) -(defmethod init-from-entity! assistant-lavatube-start ((this assistant-lavatube-start) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant-lavatube-start) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-lavatube-start-sg* 3 29 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task lavatube-start))) (first-any (-> this tasks) #t) diff --git a/goal_src/jak1/levels/lavatube/lavatube-energy.gc b/goal_src/jak1/levels/lavatube/lavatube-energy.gc index bbf62b05063..8bea22420a9 100644 --- a/goal_src/jak1/levels/lavatube/lavatube-energy.gc +++ b/goal_src/jak1/levels/lavatube/lavatube-energy.gc @@ -355,13 +355,9 @@ ) (deftype energydoor (process-drawable) - ((root-override collide-shape-moving :offset 112) - (alt-actor entity-actor :offset-assert 176) + ((root collide-shape-moving :override) + (alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states energydoor-closed-till-near energydoor-closed-till-task @@ -381,8 +377,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'matrix)) ) - (vector-! gp-0 (target-pos 0) (-> self root-override trans)) - (quaternion->matrix s5-0 (-> self root-override quat)) + (vector-! gp-0 (target-pos 0) (-> self root trans)) + (quaternion->matrix s5-0 (-> self root quat)) (vector-dot gp-0 (the-as vector (-> s5-0 vector))) ) ) @@ -529,7 +525,7 @@ ) ) -(defmethod init-from-entity! energydoor ((this energydoor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this energydoor) (arg0 entity-actor)) (with-pp (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -548,11 +544,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *energydoor-sg* '()) - (set! (-> this root-override pause-adjust-distance) 245760.0) + (set! (-> this root pause-adjust-distance) 245760.0) (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) (cond ((< (energydoor-player-dist) -409600.0) @@ -595,10 +591,6 @@ (deftype energybase (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states energybase-idle energybase-stopped @@ -663,7 +655,7 @@ :post ja-post ) -(defmethod init-from-entity! energybase ((this energybase) (arg0 entity-actor)) +(defmethod init-from-entity! ((this energybase) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *energybase-sg* '()) @@ -675,21 +667,17 @@ ) (deftype energyhub (process-drawable) - ((self-override energyhub :offset 28) - (alts entity-actor 3 :offset-assert 176) - (arm handle 5 :offset-assert 192) - (rot-mat matrix :inline :offset-assert 240) - (rot-mat-init matrix :inline :offset-assert 304) - (rotation-speed oscillating-float :inline :offset-assert 368) - (rotation-speed-offset delayed-rand-float :inline :offset-assert 392) - (y-rotation float :offset-assert 420) - (x-rotation float :offset-assert 424) - (palette-val float :offset-assert 428) + ((self-override energyhub :overlay-at self) + (alts entity-actor 3) + (arm handle 5) + (rot-mat matrix :inline) + (rot-mat-init matrix :inline) + (rotation-speed oscillating-float :inline) + (rotation-speed-offset delayed-rand-float :inline) + (y-rotation float) + (x-rotation float) + (palette-val float) ) - :heap-base #x140 - :method-count-assert 20 - :size-assert #x1b0 - :flag-assert #x14014001b0 (:states energyhub-idle energyhub-stop @@ -699,23 +687,19 @@ (deftype energyarm (process-drawable) - ((parent-overide (pointer energyhub) :offset 12) - (self-override energyarm :offset 28) - (root-override collide-shape-moving :offset 112) - (offset vector :inline :offset-assert 176) - (y-rotation float :offset-assert 192) - (y-chatter-rotation bouncing-float :inline :offset-assert 196) - (y-chatter-min delayed-rand-float :inline :offset-assert 240) - (x-rotation bouncing-float :inline :offset-assert 268) - (x-fall-rotation bouncing-float :inline :offset-assert 308) - (rot-mat matrix :inline :offset-assert 352) - (ball handle :offset-assert 416) - (x-correction float :offset-assert 424) + ((root collide-shape-moving :override) + (parent-overide (pointer energyhub) :overlay-at parent) + (self-override energyarm :overlay-at self) + (offset vector :inline) + (y-rotation float) + (y-chatter-rotation bouncing-float :inline) + (y-chatter-min delayed-rand-float :inline) + (x-rotation bouncing-float :inline) + (x-fall-rotation bouncing-float :inline) + (rot-mat matrix :inline) + (ball handle) + (x-correction float) ) - :heap-base #x140 - :method-count-assert 20 - :size-assert #x1ac - :flag-assert #x14014001ac (:states energyarm-fall energyarm-idle @@ -726,13 +710,9 @@ (deftype energyball (process-drawable) - ((parent-overide (pointer energyarm) :offset 12) - (root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) + (parent-overide (pointer energyarm) :overlay-at parent) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states energyball-idle ) @@ -759,7 +739,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (cleanup-for-death self) @@ -770,7 +750,7 @@ ) :trans (behavior () (rider-trans) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (let* ((v1-3 (-> self parent-overide)) (s5-0 (if v1-3 (-> v1-3 0 self-override) @@ -788,10 +768,10 @@ (when gp-0 (set-vector! s4-0 0.0 -61440.0 -106496.0 1.0) (vector-matrix*! s4-0 s4-0 (-> gp-0 rot-mat)) - (vector+! (-> self root-override trans) s4-0 (-> gp-0 root-override trans)) + (vector+! (-> self root trans) s4-0 (-> gp-0 root trans)) (matrix-rotate-y! s5-1 (* -436.90668 f30-0)) (matrix*! s5-1 s5-1 (-> gp-0 rot-mat)) - (matrix->quaternion (-> self root-override quat) s5-1) + (matrix->quaternion (-> self root quat) s5-1) ) ) ) @@ -825,14 +805,14 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> arg0 root-override) s5-0) + (set! (-> arg0 root) s5-0) s5-0 ) ) (defbehavior energyball-init-by-other energyball ((arg0 vector)) (energyball-init self) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *energyball-sg* '()) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 545) self)) (go energyball-idle) @@ -875,9 +855,9 @@ (set-vector! gp-1 0.0 0.0 -81920.0 1.0) (vector-matrix*! (-> self draw bounds) gp-1 (-> self rot-mat)) (set! (-> self draw bounds w) 69632.0) - (matrix->quaternion (-> self root-override quat) (-> self rot-mat)) + (matrix->quaternion (-> self root quat) (-> self rot-mat)) (vector-matrix*! gp-1 (-> self offset) (-> s5-0 rot-mat)) - (vector+! (-> self root-override trans) (-> s5-0 root trans) gp-1) + (vector+! (-> self root trans) (-> s5-0 root trans) gp-1) ) ) ) @@ -1071,7 +1051,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> arg0 root-override) s5-0) + (set! (-> arg0 root) s5-0) ) (let ((v0-5 (create-launch-control (-> *part-group-id-table* 544) arg0))) (set! (-> arg0 part) v0-5) @@ -1092,7 +1072,7 @@ ) ) (if a0-3 - (set! (-> self root-override trans quad) (-> a0-3 root trans quad)) + (set! (-> self root trans quad) (-> a0-3 root trans quad)) ) ) (initialize-skeleton self *energyarm-sg* '()) @@ -1110,7 +1090,7 @@ (go energyarm-stop) ) (else - (set! (-> self ball) (ppointer->handle (process-spawn energyball (-> self root-override trans) :to self))) + (set! (-> self ball) (ppointer->handle (process-spawn energyball (-> self root trans) :to self))) (go energyarm-idle) ) ) @@ -1354,7 +1334,7 @@ :post ja-post ) -(defmethod init-from-entity! energyhub ((this energyhub) (arg0 entity-actor)) +(defmethod init-from-entity! ((this energyhub) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *energyhub-sg* '()) @@ -1397,12 +1377,7 @@ ) (deftype energylava (process-drawable) - ((root-override basic :offset 112) - ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 + () (:states energylava-idle ) @@ -1424,7 +1399,7 @@ :post ja-post ) -(defmethod init-from-entity! energylava ((this energylava) (arg0 entity-actor)) +(defmethod init-from-entity! ((this energylava) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *energylava-sg* '()) diff --git a/goal_src/jak1/levels/lavatube/lavatube-obs.gc b/goal_src/jak1/levels/lavatube/lavatube-obs.gc index 93c3dd10382..8883434ad41 100644 --- a/goal_src/jak1/levels/lavatube/lavatube-obs.gc +++ b/goal_src/jak1/levels/lavatube/lavatube-obs.gc @@ -9,10 +9,6 @@ (deftype lavabase (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states lavabase-idle ) @@ -38,7 +34,7 @@ :post ja-post ) -(defmethod init-from-entity! lavabase ((this lavabase) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavabase) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavabase-sg* '()) @@ -48,10 +44,6 @@ (deftype lavafall (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states lavafall-idle ) @@ -77,7 +69,7 @@ :post ja-post ) -(defmethod init-from-entity! lavafall ((this lavafall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavafall) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavafall-sg* '()) @@ -87,10 +79,6 @@ (deftype lavashortcut (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states lavashortcut-idle ) @@ -116,7 +104,7 @@ :post ja-post ) -(defmethod init-from-entity! lavashortcut ((this lavashortcut) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavashortcut) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavashortcut-sg* '()) @@ -343,40 +331,29 @@ ) (deftype darkecobarrel-leak (structure) - ((offset vector :inline :offset-assert 0) - (first-frame basic :offset-assert 16) + ((offset vector :inline) + (first-frame basic) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype darkecobarrel-base (process-drawable) - ((root-override collide-shape-moving :offset 112) - (speed float :offset-assert 176) - (sync time-frame :offset-assert 184) + ((root collide-shape-moving :override) + (speed float) + (sync time-frame) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc0 - :flag-assert #x14005000c0 ) (deftype darkecobarrel-mover (darkecobarrel-base) - ((start-time time-frame :offset-assert 192) - (hits int32 :offset-assert 200) - (leak darkecobarrel-leak 1 :inline :offset-assert 208) - (y-offset bouncing-float :inline :offset-assert 240) - (y-offset-tgt delayed-rand-float :inline :offset-assert 280) - (down oscillating-vector :inline :offset-assert 320) - (down-tgt delayed-rand-vector :inline :offset-assert 384) + ((start-time time-frame) + (hits int32) + (leak darkecobarrel-leak 1 :inline) + (y-offset bouncing-float :inline) + (y-offset-tgt delayed-rand-float :inline) + (down oscillating-vector :inline) + (down-tgt delayed-rand-vector :inline) ) - :heap-base #x140 - :method-count-assert 20 - :size-assert #x1b0 - :flag-assert #x14014001b0 (:states darkecobarrel-mover-die darkecobarrel-mover-move @@ -385,21 +362,17 @@ (deftype darkecobarrel (darkecobarrel-base) - ((self-override darkecobarrel :offset 28) - (spawn-array (array int64) :offset-assert 192) - (cur-spawn int32 :offset-assert 196) + ((self-override darkecobarrel :overlay-at self) + (spawn-array (array int64)) + (cur-spawn int32) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xc8 - :flag-assert #x14006000c8 (:states darkecobarrel-spawner ) ) -(defmethod relocate darkecobarrel ((this darkecobarrel) (arg0 int)) +(defmethod relocate ((this darkecobarrel) (arg0 int)) (if (nonzero? (-> this spawn-array)) (&+! (-> this spawn-array) arg0) ) @@ -442,9 +415,9 @@ (if (darkecobarrel-base-done? f30-0) (deactivate self) ) - (eval-path-curve! (-> self path) (-> self root-override trans) f30-0 'interp) - (+! (-> self root-override trans y) (* 4096.0 (-> self y-offset osc value))) - (+! (-> self root-override trans y) -4096.0) + (eval-path-curve! (-> self path) (-> self root trans) f30-0 'interp) + (+! (-> self root trans y) (* 4096.0 (-> self y-offset osc value))) + (+! (-> self root trans y) -4096.0) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'matrix)) ) @@ -455,7 +428,7 @@ (vector-normalize! s4-0 1.0) (forward-down-nopitch->inv-matrix gp-0 s5-0 s4-0) ) - (matrix->quaternion (-> self root-override quat) gp-0) + (matrix->quaternion (-> self root quat) gp-0) (dotimes (s5-1 (-> self hits)) (when (-> self leak s5-1 first-frame) (set! (-> self leak s5-1 first-frame) #f) @@ -466,13 +439,13 @@ ) (let ((s4-2 (new 'stack-no-clear 'vector))) (vector-matrix*! s4-2 (the-as vector (-> self leak s5-1)) gp-0) - (vector+! s4-2 s4-2 (-> self root-override trans)) + (vector+! s4-2 s4-2 (-> self root trans)) (spawn (-> self part) s4-2) ) ) ) ) - (if (< (vector-vector-xz-distance-squared (-> self root-override trans) (camera-pos)) 1073741800.0) + (if (< (vector-vector-xz-distance-squared (-> self root trans) (camera-pos)) 1073741800.0) (logior! (-> self draw status) (draw-status skip-bones)) (set! (-> self draw status) (the-as draw-status (logclear (-> self draw status) (draw-status skip-bones)))) ) @@ -482,11 +455,11 @@ (defstate darkecobarrel-mover-die (darkecobarrel-mover) :code (behavior () (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (sound-play "dcrate-break") (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root-override trans quad)) + (set! (-> gp-1 quad) (-> self root trans quad)) (+! (-> gp-1 y) -49152.0) (process-spawn part-tracker @@ -520,7 +493,7 @@ (if (and s5-0 ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry s5-0) - (-> self root-override) + (-> self root) (the-as uint 1) ) (send-event proc 'attack-invinc s5-0 (static-attack-info ((mode 'death)))) @@ -547,7 +520,7 @@ (set! (-> self leak (+ (-> self hits) -1) first-frame) #t) (cond (v1-17 - (vector-! gp-1 (-> (the-as process-drawable v1-17) root trans) (-> self root-override trans)) + (vector-! gp-1 (-> (the-as process-drawable v1-17) root trans) (-> self root trans)) (set! (-> self leak (+ (-> self hits) -1) offset quad) (-> gp-1 quad)) (vector-normalize! gp-1 -0.04) (let ((v0-0 (the-as object (-> self down vel)))) @@ -556,7 +529,7 @@ ) ) (else - (set! (-> self leak (+ (-> self hits) -1) offset quad) (-> self root-override trans quad)) + (set! (-> self leak (+ (-> self hits) -1) offset quad) (-> self root trans quad)) (set! (-> self leak (+ (-> self hits) -1) offset y) (+ -49152.0 (-> self leak (+ (-> self hits) -1) offset y)) ) @@ -633,7 +606,7 @@ ) (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) (backup-collide-with-as s2-0) - (set! (-> self root-override) s2-0) + (set! (-> self root) s2-0) ) (darkecobarrel-base-init arg0) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 540) self)) @@ -700,12 +673,12 @@ ) ) -(defmethod init-from-entity! darkecobarrel ((this darkecobarrel) (arg0 entity-actor)) +(defmethod init-from-entity! ((this darkecobarrel) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> this root-override) (the-as collide-shape-moving (new 'process 'trsqv))) + (set! (-> this root) (the-as collide-shape-moving (new 'process 'trsqv))) (darkecobarrel-base-init arg0) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "lav-dark-eco" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "lav-dark-eco" :fo-max 30) (-> this root trans)) ) (logior! (-> this draw status) (draw-status hidden)) (set! (-> this speed) (/ 300.0 (res-lump-float (-> this entity) 'speed :default 61440.0))) @@ -767,10 +740,6 @@ (deftype lavafallsewera (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states lavafallsewera-idle ) @@ -795,7 +764,7 @@ :post ja-post ) -(defmethod init-from-entity! lavafallsewera ((this lavafallsewera) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavafallsewera) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavafallsewera-sg* '()) @@ -805,10 +774,6 @@ (deftype lavafallsewerb (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states lavafallsewerb-idle ) @@ -833,7 +798,7 @@ :post ja-post ) -(defmethod init-from-entity! lavafallsewerb ((this lavafallsewerb) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavafallsewerb) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavafallsewerb-sg* '()) @@ -842,15 +807,11 @@ ) (deftype chainmine (process-drawable) - ((root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) ) - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 - (:methods - (die () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + die + idle ) ) @@ -993,11 +954,11 @@ :virtual #t :code (behavior () (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (sound-play "dcrate-break") (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root-override trans quad)) + (set! (-> gp-1 quad) (-> self root trans quad)) (+! (-> gp-1 y) -73728.0) (process-spawn part-tracker @@ -1046,7 +1007,7 @@ :post ja-post ) -(defmethod init-from-entity! chainmine ((this chainmine) (arg0 entity-actor)) +(defmethod init-from-entity! ((this chainmine) (arg0 entity-actor)) (logior! (-> this mask) (process-mask attackable)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -1065,12 +1026,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *chainmine-sg* '()) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "lava-mine-chain" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "lava-mine-chain" :fo-max 30) (-> this root trans)) ) (go (method-of-object this idle)) (none) @@ -1082,16 +1043,12 @@ ) (deftype lavaballoon (process-drawable) - ((root-override collide-shape :offset 112) - (move-per-tick float :offset-assert 176) + ((root collide-shape :override) + (move-per-tick float) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xb4 - :flag-assert #x16005000b4 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) @@ -1167,7 +1124,7 @@ :virtual #t :code (behavior () (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (sound-play "cool-balloon") (process-spawn @@ -1178,7 +1135,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (suspend) @@ -1200,7 +1157,7 @@ :trans (behavior () (when (not (logtest? (-> self path flags) (path-control-flag not-found))) (let ((f0-4 (* 0.5 (+ 1.0 (sin (* (-> self move-per-tick) (the float (current-time)))))))) - (eval-path-curve! (-> self path) (-> self root-override trans) f0-4 'interp) + (eval-path-curve! (-> self path) (-> self root trans) f0-4 'interp) ) ) ) @@ -1216,7 +1173,7 @@ :post transform-post ) -(defmethod init-from-entity! lavaballoon ((this lavaballoon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavaballoon) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -1227,12 +1184,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavaballoon-sg* '()) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 543) this)) - (set! (-> this root-override pause-adjust-distance) 122880.0) + (set! (-> this root pause-adjust-distance) 122880.0) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (when (not (logtest? (-> this path flags) (path-control-flag not-found))) @@ -1246,10 +1203,6 @@ (deftype lavatube-lava (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) @@ -1277,7 +1230,7 @@ ) ) -(defmethod water-vol-method-22 lavatube-lava ((this lavatube-lava)) +(defmethod water-vol-method-22 ((this lavatube-lava)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) @@ -1294,10 +1247,6 @@ (deftype lavayellowtarp (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states lavayellowtarp-idle ) @@ -1322,7 +1271,7 @@ :post ja-post ) -(defmethod init-from-entity! lavayellowtarp ((this lavayellowtarp) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavayellowtarp) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavayellowtarp-sg* '()) diff --git a/goal_src/jak1/levels/lavatube/lavatube-part.gc b/goal_src/jak1/levels/lavatube/lavatube-part.gc index f6d5a009abb..a30717cede5 100644 --- a/goal_src/jak1/levels/lavatube/lavatube-part.gc +++ b/goal_src/jak1/levels/lavatube/lavatube-part.gc @@ -9,10 +9,6 @@ (deftype lavatube-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/maincave/baby-spider.gc b/goal_src/jak1/levels/maincave/baby-spider.gc index f94e7bc2301..bf22114ea87 100644 --- a/goal_src/jak1/levels/maincave/baby-spider.gc +++ b/goal_src/jak1/levels/maincave/baby-spider.gc @@ -11,47 +11,40 @@ ;; DECOMP BEGINS (deftype baby-spider-spawn-params (structure) - ((hatched? symbol :offset-assert 0) - (fast-start? symbol :offset-assert 4) - (hack-move-above-ground? symbol :offset-assert 8) - (die-if-not-visible? symbol :offset-assert 12) - (pickup int32 :offset-assert 16) - (pickup-amount int32 :offset-assert 20) - (event-death symbol :offset-assert 24) - (delay-before-dying-if-not-visible time-frame :offset-assert 32) + ((hatched? symbol) + (fast-start? symbol) + (hack-move-above-ground? symbol) + (die-if-not-visible? symbol) + (pickup int32) + (pickup-amount int32) + (event-death symbol) + (delay-before-dying-if-not-visible time-frame) ) - :method-count-assert 11 - :size-assert #x28 - :flag-assert #xb00000028 (:methods - (init! (_type_ symbol symbol symbol symbol int int symbol) none 9) - (set-delay! (_type_ time-frame) none 10) + (init! (_type_ symbol symbol symbol symbol int int symbol) none) + (set-delay! (_type_ time-frame) none) ) ) (deftype baby-spider (nav-enemy) - ((die-if-not-visible? symbol :offset-assert 400) - (hack-move-above-ground? symbol :offset-assert 404) - (state-float float :offset-assert 408) - (wiggle-angle float :offset-assert 412) - (delta-wiggle-angle float :offset-assert 416) - (wiggle-factor float :offset-assert 420) - (event-death symbol :offset-assert 424) - (delay-before-dying-if-not-visible time-frame :offset-assert 432) - (chase-rest-time time-frame :offset-assert 440) - (target-nav-time time-frame :offset-assert 448) - (unknown00 basic :offset-assert 456) - (unknown01 basic :offset-assert 460) - (wiggle-time time-frame :offset-assert 464) - (last-visible-time time-frame :offset-assert 472) - (up-vector vector :inline :offset-assert 480) - (state-vector vector :inline :offset-assert 496) + ((die-if-not-visible? symbol) + (hack-move-above-ground? symbol) + (state-float float) + (wiggle-angle float) + (delta-wiggle-angle float) + (wiggle-factor float) + (event-death symbol) + (delay-before-dying-if-not-visible time-frame) + (chase-rest-time time-frame) + (target-nav-time time-frame) + (unknown00 basic) + (unknown01 basic) + (wiggle-time time-frame) + (last-visible-time time-frame) + (up-vector vector :inline) + (state-vector vector :inline) ) - :heap-base #x190 - :method-count-assert 76 - :size-assert #x200 - :flag-assert #x4c01900200 (:states baby-spider-die-fast baby-spider-hatching @@ -172,15 +165,15 @@ ) ) -(defmethod init! baby-spider-spawn-params ((this baby-spider-spawn-params) - (arg0 symbol) - (arg1 symbol) - (arg2 symbol) - (arg3 symbol) - (arg4 int) - (arg5 int) - (arg6 symbol) - ) +(defmethod init! ((this baby-spider-spawn-params) + (arg0 symbol) + (arg1 symbol) + (arg2 symbol) + (arg3 symbol) + (arg4 int) + (arg5 int) + (arg6 symbol) + ) (set! (-> this hatched?) arg0) (set! (-> this fast-start?) arg1) (set! (-> this die-if-not-visible?) arg2) @@ -192,12 +185,12 @@ (none) ) -(defmethod set-delay! baby-spider-spawn-params ((this baby-spider-spawn-params) (arg0 time-frame)) +(defmethod set-delay! ((this baby-spider-spawn-params) (arg0 time-frame)) (set! (-> this delay-before-dying-if-not-visible) arg0) (none) ) -(defmethod touch-handler baby-spider ((this baby-spider) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this baby-spider) (arg0 process) (arg1 event-message-block)) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) (-> this collide-info) @@ -222,7 +215,7 @@ baby-spider-default-event-handler -(defmethod common-post baby-spider ((this baby-spider)) +(defmethod common-post ((this baby-spider)) (when (logtest? (-> this collide-info status) (cshape-moving-flags onsurf)) (vector-deg-seek (-> this up-vector) (-> this up-vector) (-> this collide-info surface-normal) 910.2222) (vector-normalize! (-> this up-vector) 1.0) @@ -236,7 +229,7 @@ baby-spider-default-event-handler (none) ) -(defmethod nav-enemy-method-38 baby-spider ((this baby-spider)) +(defmethod nav-enemy-method-38 ((this baby-spider)) (integrate-for-enemy-with-move-to-ground! (-> this collide-info) (-> this collide-info transv) @@ -249,7 +242,7 @@ baby-spider-default-event-handler (none) ) -(defmethod nav-enemy-method-51 baby-spider ((this baby-spider)) +(defmethod nav-enemy-method-51 ((this baby-spider)) (let* ((f0-0 (rand-vu-float-range 0.0 1.0)) (f1-1 (+ 1.0 (* 2.0 f0-0))) (f2-2 f1-1) @@ -263,7 +256,7 @@ baby-spider-default-event-handler (none) ) -(defmethod nav-enemy-method-52 baby-spider ((this baby-spider) (arg0 vector)) +(defmethod nav-enemy-method-52 ((this baby-spider) (arg0 vector)) ;; og:preserve-this changed for high fps (+! (-> this wiggle-angle) (* DISPLAY_FPS_RATIO (-> this delta-wiggle-angle))) (if (< 65536.0 (-> this wiggle-angle)) @@ -282,7 +275,7 @@ baby-spider-default-event-handler ) ) -(defmethod nav-enemy-method-53 baby-spider ((this baby-spider)) +(defmethod nav-enemy-method-53 ((this baby-spider)) (cond ((logtest? (-> this draw status) (draw-status was-drawn)) (set-time! (-> this last-visible-time)) @@ -630,7 +623,7 @@ baby-spider-default-event-handler ) ) -(defmethod initialize-collision baby-spider ((this baby-spider)) +(defmethod initialize-collision ((this baby-spider)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -653,7 +646,7 @@ baby-spider-default-event-handler (none) ) -(defmethod nav-enemy-method-48 baby-spider ((this baby-spider)) +(defmethod nav-enemy-method-48 ((this baby-spider)) (set-time! (-> this last-visible-time)) (initialize-skeleton this *baby-spider-sg* '()) (if (= (-> this parent 0 type) cave-trap) @@ -715,7 +708,7 @@ baby-spider-default-event-handler (none) ) -(defmethod init-from-entity! baby-spider ((this baby-spider) (arg0 entity-actor)) +(defmethod init-from-entity! ((this baby-spider) (arg0 entity-actor)) (set! (-> this die-if-not-visible?) #f) (set! (-> this delay-before-dying-if-not-visible) (seconds 2)) (set! (-> this hack-move-above-ground?) #f) diff --git a/goal_src/jak1/levels/maincave/cavecrystal-light.gc b/goal_src/jak1/levels/maincave/cavecrystal-light.gc index 4f0041d6be0..3cd9439b4a5 100644 --- a/goal_src/jak1/levels/maincave/cavecrystal-light.gc +++ b/goal_src/jak1/levels/maincave/cavecrystal-light.gc @@ -10,36 +10,30 @@ (define *cavecrystal-engine* (new 'loading-level 'engine 'cavecrystal 64)) (deftype cavecrystal-light (structure) - ((next cavecrystal-light :offset-assert 0) - (crystal-id int32 :offset-assert 4) - (intensity float :offset-assert 8) - (fade-start float :offset-assert 12) - (fade-end float :offset-assert 16) - (crystal-handle handle :offset-assert 24) - (trans vector :inline :offset-assert 32) + ((next cavecrystal-light) + (crystal-id int32) + (intensity float) + (fade-start float) + (fade-end float) + (crystal-handle handle) + (trans vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype cavecrystal-light-control (basic) - ((active-count int32 :offset-assert 4) - (head cavecrystal-light :offset-assert 8) - (last-known-valid-time time-frame :offset-assert 16) - (crystal cavecrystal-light 7 :inline :offset-assert 32) + ((active-count int32) + (head cavecrystal-light) + (last-known-valid-time time-frame) + (crystal cavecrystal-light 7 :inline) ) - :method-count-assert 15 - :size-assert #x170 - :flag-assert #xf00000170 (:methods - (cavecrystal-light-control-method-9 (_type_ int float process-drawable) none 9) - (cavecrystal-light-control-method-10 (_type_ vector) float 10) - (inc-intensities! (_type_) none 11) - (cavecrystal-light-control-method-12 (_type_) none 12) - (create-connection! (_type_ process-drawable res-lump (function object object object object object) int float) connection 13) - (execute-connections (_type_) int 14) + (cavecrystal-light-control-method-9 (_type_ int float process-drawable) none) + (cavecrystal-light-control-method-10 (_type_ vector) float) + (inc-intensities! (_type_) none) + (cavecrystal-light-control-method-12 (_type_) none) + (create-connection! (_type_ process-drawable res-lump (function object object object object object) int float) connection) + (execute-connections (_type_) int) ) ) @@ -65,23 +59,23 @@ (none) ) -(defmethod create-connection! cavecrystal-light-control ((this cavecrystal-light-control) - (arg0 process-drawable) - (arg1 res-lump) - (arg2 (function object object object object object)) - (arg3 int) - (arg4 float) - ) +(defmethod create-connection! ((this cavecrystal-light-control) + (arg0 process-drawable) + (arg1 res-lump) + (arg2 (function object object object object object)) + (arg3 int) + (arg4 float) + ) (if (nonzero? (res-lump-value arg1 'crystal-light uint128)) (add-connection *cavecrystal-engine* arg0 arg2 (process->ppointer arg0) arg3 arg4) ) ) -(defmethod execute-connections cavecrystal-light-control ((this cavecrystal-light-control)) +(defmethod execute-connections ((this cavecrystal-light-control)) (execute-connections *cavecrystal-engine* #f) ) -(defmethod cavecrystal-light-control-method-12 cavecrystal-light-control ((this cavecrystal-light-control)) +(defmethod cavecrystal-light-control-method-12 ((this cavecrystal-light-control)) (let ((v1-0 (-> this last-known-valid-time)) (a1-1 (current-time)) ) @@ -136,7 +130,7 @@ (none) ) -(defmethod inc-intensities! cavecrystal-light-control ((this cavecrystal-light-control)) +(defmethod inc-intensities! ((this cavecrystal-light-control)) (set! (-> this head) #f) (let ((a1-0 (the-as cavecrystal-light #f)) (v0-0 0) @@ -160,7 +154,7 @@ ) ;; WARN: Function (method 9 cavecrystal-light-control) has a return type of none, but the expression builder found a return statement. -(defmethod cavecrystal-light-control-method-9 cavecrystal-light-control ((this cavecrystal-light-control) (arg0 int) (arg1 float) (arg2 process-drawable)) +(defmethod cavecrystal-light-control-method-9 ((this cavecrystal-light-control) (arg0 int) (arg1 float) (arg2 process-drawable)) (cavecrystal-light-control-method-12 this) (when (or (< arg0 0) (>= arg0 7)) (format 0 "ERROR: Bogus cavecrystal id!~%") @@ -189,7 +183,7 @@ (none) ) -(defmethod cavecrystal-light-control-method-10 cavecrystal-light-control ((this cavecrystal-light-control) (arg0 vector)) +(defmethod cavecrystal-light-control-method-10 ((this cavecrystal-light-control) (arg0 vector)) (cavecrystal-light-control-method-12 this) (let ((s5-1 (-> this head)) (f30-0 0.0) diff --git a/goal_src/jak1/levels/maincave/dark-crystal.gc b/goal_src/jak1/levels/maincave/dark-crystal.gc index acc04af644d..d78abc550de 100644 --- a/goal_src/jak1/levels/maincave/dark-crystal.gc +++ b/goal_src/jak1/levels/maincave/dark-crystal.gc @@ -9,22 +9,18 @@ ;; DECOMP BEGINS (deftype dark-crystal (process-drawable) - ((root-override collide-shape :offset 112) - (crystal-num int32 :offset-assert 176) - (underwater? symbol :offset-assert 180) - (explode-danger-radius float :offset-assert 184) - (lit-color-mult vector :inline :offset-assert 192) - (lit-color-emissive vector :inline :offset-assert 208) - (unlit-color-mult vector :inline :offset-assert 224) - (unlit-color-emissive vector :inline :offset-assert 240) + ((root collide-shape :override) + (crystal-num int32) + (underwater? symbol) + (explode-danger-radius float) + (lit-color-mult vector :inline) + (lit-color-emissive vector :inline) + (unlit-color-mult vector :inline) + (unlit-color-emissive vector :inline) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x100 - :flag-assert #x1600900100 (:methods - (dark-crystal-method-20 (_type_) none 20) - (dark-crystal-method-21 (_type_) symbol 21) + (dark-crystal-method-20 (_type_) none) + (dark-crystal-method-21 (_type_) symbol) ) (:states dark-crystal-activate @@ -467,7 +463,7 @@ :code (behavior () (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (let ((gp-0 (new 'stack 'joint-exploder-tuning 0))) (when (-> self underwater?) (set! (-> gp-0 duration) (seconds 4)) @@ -500,7 +496,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (let ((s5-4 (current-time))) @@ -523,7 +519,7 @@ :event process-drawable-fuel-cell-handler :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (level-hint-spawn (text-id cave-dark-crystals-resolution) "sksp0327" @@ -536,7 +532,7 @@ (logior! (-> self draw status) (draw-status hidden)) (if (not (task-complete? *game-info* (-> self entity extra perm task))) (birth-pickup-at-point - (-> self root-override trans) + (-> self root trans) (pickup-type fuel-cell) (the float (-> self entity extra perm task)) #t @@ -553,13 +549,13 @@ ) ) -(defmethod dark-crystal-method-20 dark-crystal ((this dark-crystal)) +(defmethod dark-crystal-method-20 ((this dark-crystal)) (when *target* (let ((s5-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> this root-override trans quad)) + (set! (-> s5-0 quad) (-> this root trans quad)) (+! (-> s5-0 y) 6144.0) (set! (-> s3-0 quad) (-> (target-pos 0) quad)) (+! (-> s3-0 y) 6144.0) @@ -587,7 +583,7 @@ (none) ) -(defmethod dark-crystal-method-21 dark-crystal ((this dark-crystal)) +(defmethod dark-crystal-method-21 ((this dark-crystal)) (let ((s5-0 #f)) (when (nonzero? (-> this crystal-num)) (let* ((s4-0 (get-task-control (game-task cave-dark-crystals))) @@ -604,7 +600,7 @@ ) ) -(defmethod init-from-entity! dark-crystal ((this dark-crystal) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dark-crystal) (arg0 entity-actor)) (set-vector! (-> this unlit-color-mult) 0.5 0.5 0.5 1.0) (set-vector! (-> this unlit-color-emissive) 0.0 0.0 0.0 0.0) (set-vector! (-> this lit-color-mult) 1.0 1.0 1.0 1.0) @@ -622,7 +618,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *dark-crystal-sg* '()) @@ -632,7 +628,7 @@ (set! (-> this underwater?) (= (res-lump-value arg0 'mode uint128) 1)) (set! (-> this explode-danger-radius) (res-lump-float arg0 'extra-radius :default 28672.0)) (set! (-> this crystal-num) (res-lump-value arg0 'extra-id int)) - (set-vector! (-> this root-override scale) 2.0 2.0 2.0 1.0) + (set-vector! (-> this root scale) 2.0 2.0 2.0 1.0) (ja-channel-push! 1 0) (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! @@ -643,7 +639,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go dark-crystal-spawn-fuel-cell) (go dark-crystal-idle) diff --git a/goal_src/jak1/levels/maincave/driller-lurker.gc b/goal_src/jak1/levels/maincave/driller-lurker.gc index a6accc39460..96c099056be 100644 --- a/goal_src/jak1/levels/maincave/driller-lurker.gc +++ b/goal_src/jak1/levels/maincave/driller-lurker.gc @@ -9,45 +9,41 @@ ;; DECOMP BEGINS (deftype driller-lurker (process-drawable) - ((root-overeride collide-shape-moving :offset 112) - (hit-player? symbol :offset-assert 176) - (played-drill-sound? symbol :offset-assert 180) - (mode uint64 :offset-assert 184) - (path-u float :offset-assert 192) - (path-units-per-meter float :offset-assert 196) - (path-speed float :offset-assert 200) - (targ-path-speed float :offset-assert 204) - (path-dir float :offset-assert 208) - (path-ry float :offset-assert 212) - (facing-ry float :offset-assert 216) - (drill-rz float :offset-assert 220) - (drill-speed float :offset-assert 224) - (up-blend float :offset-assert 228) - (player-path-u float :offset-assert 232) - (ambient-drilling-u float :offset-assert 236) - (timeout int32 :offset-assert 240) - (neck joint-mod :offset-assert 244) - (drill joint-mod :offset-assert 248) - (sound2 ambient-sound :offset-assert 252) - (last-update-time time-frame :offset-assert 256) - (last-player-path-u-time time-frame :offset-assert 264) - (started-chasing-time time-frame :offset-assert 272) - (hit-player-time time-frame :offset-assert 280) - (player-attack-id uint64 :offset-assert 288) + ((root-overeride collide-shape-moving :overlay-at root) + (hit-player? symbol) + (played-drill-sound? symbol) + (mode uint64) + (path-u float) + (path-units-per-meter float) + (path-speed float) + (targ-path-speed float) + (path-dir float) + (path-ry float) + (facing-ry float) + (drill-rz float) + (drill-speed float) + (up-blend float) + (player-path-u float) + (ambient-drilling-u float) + (timeout int32) + (neck joint-mod) + (drill joint-mod) + (sound2 ambient-sound) + (last-update-time time-frame) + (last-player-path-u-time time-frame) + (started-chasing-time time-frame) + (hit-player-time time-frame) + (player-attack-id uint64) ) - :heap-base #xc0 - :method-count-assert 28 - :size-assert #x128 - :flag-assert #x1c00c00128 (:methods - (driller-lurker-method-20 (_type_ symbol target) symbol 20) - (driller-lurker-method-21 (_type_) none 21) - (driller-lurker-method-22 (_type_) none 22) - (driller-lurker-method-23 (_type_) float 23) - (driller-lurker-method-24 (_type_) symbol 24) - (driller-lurker-method-25 (_type_) symbol 25) - (driller-lurker-method-26 (_type_) symbol 26) - (driller-lurker-method-27 (_type_) object 27) + (driller-lurker-method-20 (_type_ symbol target) symbol) + (driller-lurker-method-21 (_type_) none) + (driller-lurker-method-22 (_type_) none) + (driller-lurker-method-23 (_type_) float) + (driller-lurker-method-24 (_type_) symbol) + (driller-lurker-method-25 (_type_) symbol) + (driller-lurker-method-26 (_type_) symbol) + (driller-lurker-method-27 (_type_) object) ) (:states driller-lurker-attack @@ -315,7 +311,7 @@ ) ) -(defmethod driller-lurker-method-20 driller-lurker ((this driller-lurker) (arg0 symbol) (arg1 target)) +(defmethod driller-lurker-method-20 ((this driller-lurker) (arg0 symbol) (arg1 target)) (let ((v1-1 (current-time))) (when (!= v1-1 (-> this last-update-time)) (set! (-> this last-update-time) v1-1) @@ -525,7 +521,7 @@ ) ) -(defmethod driller-lurker-method-23 driller-lurker ((this driller-lurker)) +(defmethod driller-lurker-method-23 ((this driller-lurker)) (let ((v1-1 (current-time))) (when (!= v1-1 (-> this last-player-path-u-time)) (set! (-> this last-player-path-u-time) v1-1) @@ -547,7 +543,7 @@ (-> this player-path-u) ) -(defmethod driller-lurker-method-25 driller-lurker ((this driller-lurker)) +(defmethod driller-lurker-method-25 ((this driller-lurker)) (when *target* (let* ((s5-0 (target-pos 0)) (f0-1 (- (-> s5-0 y) (-> this root-overeride trans y))) @@ -578,7 +574,7 @@ #f ) -(defmethod driller-lurker-method-26 driller-lurker ((this driller-lurker)) +(defmethod driller-lurker-method-26 ((this driller-lurker)) (when *target* (let* ((a1-0 (target-pos 0)) (f0-1 (- (-> a1-0 y) (-> this root-overeride trans y))) @@ -594,7 +590,7 @@ #t ) -(defmethod driller-lurker-method-24 driller-lurker ((this driller-lurker)) +(defmethod driller-lurker-method-24 ((this driller-lurker)) (when *target* (let* ((a1-0 (target-pos 0)) (f0-1 (- (-> a1-0 y) (-> this root-overeride trans y))) @@ -622,7 +618,7 @@ #f ) -(defmethod driller-lurker-method-27 driller-lurker ((this driller-lurker)) +(defmethod driller-lurker-method-27 ((this driller-lurker)) (let ((a2-0 (-> this node-list data 25 bone transform)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -947,7 +943,7 @@ :post ja-post ) -(defmethod relocate driller-lurker ((this driller-lurker) (arg0 int)) +(defmethod relocate ((this driller-lurker) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) @@ -960,7 +956,7 @@ (call-parent-method this arg0) ) -(defmethod deactivate driller-lurker ((this driller-lurker)) +(defmethod deactivate ((this driller-lurker)) (if (nonzero? (-> this sound2)) (stop! (-> this sound2)) ) @@ -968,7 +964,7 @@ (none) ) -(defmethod init-from-entity! driller-lurker ((this driller-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this driller-lurker) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (set! (-> this hit-player?) #f) (set! (-> this played-drill-sound?) #f) diff --git a/goal_src/jak1/levels/maincave/gnawer.gc b/goal_src/jak1/levels/maincave/gnawer.gc index b48b1218d66..22a86f1f014 100644 --- a/goal_src/jak1/levels/maincave/gnawer.gc +++ b/goal_src/jak1/levels/maincave/gnawer.gc @@ -13,97 +13,80 @@ ;; DECOMP BEGINS (deftype gnawer-falling-segment (process-drawable) - ((transv vector :inline :offset-assert 176) - (facing-rot vector :inline :offset-assert 192) - (facing-rotv vector :inline :offset-assert 208) + ((transv vector :inline) + (facing-rot vector :inline) + (facing-rotv vector :inline) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xe0 - :flag-assert #x15007000e0 - (:methods - (falling () _type_ :state 20) + (:state-methods + falling ) ) (deftype gnawer-segment-info (structure) - ((num-joints int32 :offset-assert 0) - (joint-index int8 8 :offset-assert 4) + ((num-joints int32) + (joint-index int8 8) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype gnawer-segment (structure) - ((place int32 :offset-assert 0) - (world-pos vector :inline :offset-assert 16) - (anim-to-local-trans-offset vector :inline :offset-assert 32) - (orient-mat matrix :inline :offset-assert 48) + ((place int32) + (world-pos vector :inline) + (anim-to-local-trans-offset vector :inline) + (orient-mat matrix :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) (deftype gnawer-route (structure) - ((src-pt-index int32 :offset-assert 0) - (dest-pt-index int32 :offset-assert 4) - (total-travel-time time-frame :offset-assert 8) - (src-ang float :offset-assert 16) - (dest-ang float :offset-assert 20) - (delta-ang float :offset-assert 24) - (surface-dist float :offset-assert 28) - (total-dist float :offset-assert 32) - (src-pt-offset vector :inline :offset-assert 48) - (dest-pt-offset vector :inline :offset-assert 64) - (surface-dir vector :inline :offset-assert 80) + ((src-pt-index int32) + (dest-pt-index int32) + (total-travel-time time-frame) + (src-ang float) + (dest-ang float) + (delta-ang float) + (surface-dist float) + (total-dist float) + (src-pt-offset vector :inline) + (dest-pt-offset vector :inline) + (surface-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) (deftype gnawer (process-drawable) - ((root-override collide-shape :offset 112) - (hit-points int32 :offset-assert 176) - (gnawer-id int32 :offset-assert 180) - (total-money int32 :offset-assert 184) - (money-mask uint32 :offset-assert 188) - (eco-green-mask uint32 :offset-assert 192) - (hidden? symbol :offset-assert 196) - (show-damage? symbol :offset-assert 200) - (route-dist float :offset-assert 204) - (speed float :offset-assert 208) - (anim-speed float :offset-assert 212) - (part2 sparticle-launch-control :offset-assert 216) - (sound2 ambient-sound :offset-assert 220) - (last-hit-time time-frame :offset-assert 224) - (post-trans vector :inline :offset-assert 240) - (fall-trans vector :inline :offset-assert 256) - (route gnawer-route :inline :offset-assert 272) - (segments gnawer-segment 10 :inline :offset-assert 368) + ((root collide-shape :override) + (hit-points int32) + (gnawer-id int32) + (total-money int32) + (money-mask uint32) + (eco-green-mask uint32) + (hidden? symbol) + (show-damage? symbol) + (route-dist float) + (speed float) + (anim-speed float) + (part2 sparticle-launch-control) + (sound2 ambient-sound) + (last-hit-time time-frame) + (post-trans vector :inline) + (fall-trans vector :inline) + (route gnawer-route :inline) + (segments gnawer-segment 10 :inline) ) - :heap-base #x560 - :method-count-assert 31 - :size-assert #x5d0 - :flag-assert #x1f056005d0 (:methods - (gnawer-method-20 (_type_ int) matrix 20) - (gnawer-method-21 (_type_ int bounding-box symbol float) float 21) - (gnawer-method-22 (_type_ float) symbol 22) - (gnawer-method-23 (_type_) none 23) - (gnawer-method-24 (_type_) none 24) - (gnawer-method-25 (_type_) symbol 25) - (gnawer-method-26 (_type_) none 26) - (gnawer-method-27 (_type_) none 27) - (gnawer-method-28 (_type_ int int) symbol 28) - (gnawer-method-29 (_type_ int vector vector) float 29) - (gnawer-method-30 (_type_ process-drawable) uint 30) + (gnawer-method-20 (_type_ int) matrix) + (gnawer-method-21 (_type_ int bounding-box symbol float) float) + (gnawer-method-22 (_type_ float) symbol) + (gnawer-method-23 (_type_) none) + (gnawer-method-24 (_type_) none) + (gnawer-method-25 (_type_) symbol) + (gnawer-method-26 (_type_) none) + (gnawer-method-27 (_type_) none) + (gnawer-method-28 (_type_ int int) symbol) + (gnawer-method-29 (_type_ int vector vector) float) + (gnawer-method-30 (_type_ process-drawable) uint) ) (:states gnawer-chewing-on-post @@ -388,14 +371,14 @@ (none) ) -(defmethod gnawer-method-23 gnawer ((this gnawer)) +(defmethod gnawer-method-23 ((this gnawer)) (when (not (-> this hidden?)) (set! (-> this hidden?) #t) (logior! (-> this draw status) (draw-status hidden)) (logclear! (-> this mask) (process-mask attackable)) (set! (-> this skel postbind-function) #f) - (set! (-> this root-override trans quad) (-> this post-trans quad)) - (clear-collide-with-as (-> this root-override)) + (set! (-> this root trans quad) (-> this post-trans quad)) + (clear-collide-with-as (-> this root)) (dotimes (v1-12 10) (set! (-> this segments v1-12 world-pos quad) (-> this post-trans quad)) ) @@ -404,17 +387,17 @@ (none) ) -(defmethod gnawer-method-26 gnawer ((this gnawer)) +(defmethod gnawer-method-26 ((this gnawer)) (when (-> this hidden?) (set! (-> this hidden?) #f) - (restore-collide-with-as (-> this root-override)) + (restore-collide-with-as (-> this root)) (set! (-> this skel postbind-function) gnawer-joint-callback) (logclear! (-> this draw status) (draw-status hidden)) ) (none) ) -(defmethod gnawer-method-24 gnawer ((this gnawer)) +(defmethod gnawer-method-24 ((this gnawer)) (local-vars (sv-48 vector) (sv-64 vector)) (let ((s5-0 0) (s4-0 0) @@ -512,7 +495,7 @@ (none) ) -(defmethod gnawer-method-22 gnawer ((this gnawer) (arg0 float)) +(defmethod gnawer-method-22 ((this gnawer) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'bounding-box)) (a3-0 #t) (gp-0 #t) @@ -545,32 +528,32 @@ (set! a3-0 #f) ) (set-vector! - (-> this root-override trans) + (-> this root trans) (* 0.5 (+ (-> s4-0 min x) (-> s4-0 max x))) (* 0.5 (+ (-> s4-0 min y) (-> s4-0 max y))) (* 0.5 (+ (-> s4-0 min z) (-> s4-0 max z))) 1.0 ) - (let* ((f0-10 (- (-> s4-0 max x) (-> this root-override trans x))) - (f1-12 (- (-> s4-0 max y) (-> this root-override trans y))) - (f2-7 (- (-> s4-0 max z) (-> this root-override trans z))) + (let* ((f0-10 (- (-> s4-0 max x) (-> this root trans x))) + (f1-12 (- (-> s4-0 max y) (-> this root trans y))) + (f2-7 (- (-> s4-0 max z) (-> this root trans z))) (f0-14 (sqrtf (+ (* f0-10 f0-10) (* f1-12 f1-12) (* f2-7 f2-7)))) (a0-3 (-> this draw bounds)) - (v1-21 (-> this root-override root-prim)) + (v1-21 (-> this root root-prim)) (f0-15 (+ 12288.0 f0-14)) ) (vector-reset! a0-3) (set! (-> a0-3 w) f0-15) (vector-reset! (-> v1-21 local-sphere)) (set! (-> v1-21 local-sphere w) f0-15) - (set! (-> v1-21 prim-core world-sphere quad) (-> this root-override trans quad)) + (set! (-> v1-21 prim-core world-sphere quad) (-> this root trans quad)) (set! (-> v1-21 prim-core world-sphere w) f0-15) ) gp-0 ) ) -(defmethod gnawer-method-21 gnawer ((this gnawer) (arg0 int) (arg1 bounding-box) (arg2 symbol) (arg3 float)) +(defmethod gnawer-method-21 ((this gnawer) (arg0 int) (arg1 bounding-box) (arg2 symbol) (arg3 float)) (let ((gp-0 (-> this segments arg0))) (let ((f0-1 (+ 10240.0 (-> this route surface-dist)))) (cond @@ -637,7 +620,7 @@ ) ) -(defmethod gnawer-method-20 gnawer ((this gnawer) (arg0 int)) +(defmethod gnawer-method-20 ((this gnawer) (arg0 int)) (let ((v1-3 (-> this segments arg0)) (a0-1 (-> this segments (+ arg0 -1))) ) @@ -659,7 +642,7 @@ ) ) -(defmethod gnawer-method-25 gnawer ((this gnawer)) +(defmethod gnawer-method-25 ((this gnawer)) (dotimes (s5-0 3) (when (> (-> this hit-points) 0) (+! (-> this hit-points) -1) @@ -671,7 +654,7 @@ (let ((s1-0 (new 'stack-no-clear 'vector)) (s2-0 (-> s3-0 world-pos)) ) - (vector-! s1-0 s2-0 (-> this root-override trans)) + (vector-! s1-0 s2-0 (-> this root trans)) (set! (-> s1-0 y) 0.0) (vector-normalize! s1-0 1.0) (process-spawn gnawer-falling-segment this s2-0 s1-0 :to this) @@ -694,7 +677,7 @@ (<= (-> this hit-points) 0) ) -(defmethod gnawer-method-28 gnawer ((this gnawer) (arg0 int) (arg1 int)) +(defmethod gnawer-method-28 ((this gnawer) (arg0 int) (arg1 int)) (when (> arg0 0) (let* ((v1-1 (rand-vu-int-count arg0)) (a0-2 v1-1) @@ -712,16 +695,15 @@ (the-as symbol 0) ) -(defmethod gnawer-method-27 gnawer ((this gnawer)) +(defmethod gnawer-method-27 ((this gnawer)) (set! (-> this eco-green-mask) (the-as uint 0)) (let ((s4-0 (-> this path curve num-cverts)) (s3-0 (get-death-count *game-info* #f)) (s5-0 (-> this money-mask)) ) - (when (and *target* - (or (and (= s3-0 1) (and (>= 1.0 (-> *target* fact-info-target health)) (rand-vu-percent? 0.1))) - (and (< 1 s3-0) (and (>= 2.0 (-> *target* fact-info-target health)) (rand-vu-percent? 0.05))) - ) + (when (and *target* (or (and (= s3-0 1) (and (>= 1.0 (-> *target* fact health)) (rand-vu-percent? 0.1))) + (and (< 1 s3-0) (and (>= 2.0 (-> *target* fact health)) (rand-vu-percent? 0.05))) + ) ) (let ((v1-14 (gnawer-method-28 this s4-0 (the-as int s5-0)))) (logior s5-0 (the-as uint v1-14)) @@ -732,7 +714,7 @@ (none) ) -(defmethod gnawer-method-29 gnawer ((this gnawer) (arg0 int) (arg1 vector) (arg2 vector)) +(defmethod gnawer-method-29 ((this gnawer) (arg0 int) (arg1 vector) (arg2 vector)) (let ((s1-0 (-> this path curve num-cverts)) (s2-0 (new 'stack-no-clear 'vector)) ) @@ -759,7 +741,7 @@ (set! (-> arg2 y) (+ 4096.0 (-> arg2 y))) ) -(defmethod gnawer-method-30 gnawer ((this gnawer) (arg0 process-drawable)) +(defmethod gnawer-method-30 ((this gnawer) (arg0 process-drawable)) (local-vars (sv-48 vector)) (let ((gp-0 (-> this entity extra perm))) (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) @@ -821,7 +803,7 @@ (stop! (-> self sound2)) ) :trans (behavior () - (if (and *target* (>= 81920.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) + (if (and *target* (>= 81920.0 (vector-vector-distance (target-pos 0) (-> self root trans)))) (go gnawer-retreat-into-post) ) ) @@ -923,7 +905,7 @@ (suspend) (ja :num! (seek!)) ) - (quaternion-identity! (-> self root-override quat)) + (quaternion-identity! (-> self root quat)) (go gnawer-wait-to-run) ) :post transform-post @@ -974,7 +956,7 @@ (let* ((a2-1 (the-as object (-> block param 0))) (v1-19 (-> (get-touched-prim (-> (the-as touching-shapes-entry a2-1) head) - (-> self root-override) + (-> self root) (the-as touching-shapes-entry a2-1) ) prim-id @@ -1046,25 +1028,25 @@ :enter (behavior () (let ((v1-0 (-> self segments))) (set! (-> self fall-trans quad) (-> v1-0 0 world-pos quad)) - (vector-! (-> self root-override transv) (-> v1-0 0 world-pos) (-> self post-trans)) + (vector-! (-> self root transv) (-> v1-0 0 world-pos) (-> self post-trans)) ) - (set! (-> self root-override transv y) 0.0) - (vector-normalize! (-> self root-override transv) 1.0) - (set! (-> self root-override transv y) 0.3) - (vector-normalize! (-> self root-override transv) 32768.0) + (set! (-> self root transv y) 0.0) + (vector-normalize! (-> self root transv) 1.0) + (set! (-> self root transv y) 0.3) + (vector-normalize! (-> self root transv) 32768.0) ) :trans (behavior () - (+! (-> self root-override transv y) (* -409600.0 (seconds-per-frame))) + (+! (-> self root transv y) (* -409600.0 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self fall-trans quad)) - (vector-v+! (-> self fall-trans) (-> self fall-trans) (-> self root-override transv)) + (vector-v+! (-> self fall-trans) (-> self fall-trans) (-> self root transv)) (vector-! gp-0 (-> self fall-trans) gp-0) (dotimes (v1-6 10) (let ((a1-3 (-> self segments v1-6))) (vector+! (-> a1-3 world-pos) (-> a1-3 world-pos) gp-0) ) ) - (vector+! (-> self root-override trans) (-> self root-override trans) gp-0) + (vector+! (-> self root trans) (-> self root trans) gp-0) ) (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) ) @@ -1072,7 +1054,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) (ja-channel-push! 1 (seconds 0.1)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :group! gnawer-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1098,7 +1080,7 @@ ) :code (behavior () (local-vars (sv-128 symbol)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (set! (-> self skel postbind-function) #f) (ja-channel-set! 0) (ja-post) @@ -1229,7 +1211,7 @@ ) :code (behavior () (set! (-> self draw origin-joint-index) (the-as uint 0)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (set! (-> self skel postbind-function) #f) (ja-channel-set! 0) (ja-post) @@ -1282,7 +1264,7 @@ ) (countdown (s2-0 (-> v1-1 num-joints)) (let ((s1-0 (-> arg0 node-list data (-> s3-0 0) bone transform))) - (vector-! (-> s1-0 vector 3) (-> s1-0 vector 3) (-> arg0 root-override trans)) + (vector-! (-> s1-0 vector 3) (-> s1-0 vector 3) (-> arg0 root trans)) (vector+! (-> s1-0 vector 3) (-> s1-0 vector 3) (-> s4-0 anim-to-local-trans-offset)) (matrix*! s1-0 s1-0 (-> s4-0 orient-mat)) (vector+! (-> s1-0 vector 3) (-> s1-0 vector 3) (-> s4-0 world-pos)) @@ -1295,7 +1277,7 @@ (none) ) -(defmethod deactivate gnawer ((this gnawer)) +(defmethod deactivate ((this gnawer)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -1306,7 +1288,7 @@ (none) ) -(defmethod relocate gnawer ((this gnawer) (arg0 int)) +(defmethod relocate ((this gnawer) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -1316,7 +1298,7 @@ (call-parent-method this arg0) ) -(defmethod init-from-entity! gnawer ((this gnawer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gnawer) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) (set! (-> this hidden?) #f) (set! (-> this show-damage?) #f) @@ -1398,23 +1380,23 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (quaternion-identity! (-> this root-override quat)) + (quaternion-identity! (-> this root quat)) (initialize-skeleton this *gnawer-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 8)) - (set! (-> this post-trans quad) (-> this root-override trans quad)) + (set! (-> this post-trans quad) (-> this root trans quad)) (let ((f0-40 (res-lump-float (-> this entity) 'rotoffset))) - (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-40) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-40) ) - (+! (-> this root-override trans y) -2048.0) + (+! (-> this root trans y) -2048.0) (set! sv-16 (new 'static 'res-tag)) (let ((v1-81 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-81 - (+! (-> this root-override trans x) (-> v1-81 0)) - (+! (-> this root-override trans y) (-> v1-81 1)) - (+! (-> this root-override trans z) (-> v1-81 2)) + (+! (-> this root trans x) (-> v1-81 0)) + (+! (-> this root trans y) (-> v1-81 1)) + (+! (-> this root trans z) (-> v1-81 2)) ) ) (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) @@ -1457,15 +1439,10 @@ ) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 329) this)) (set! (-> this sound) - (new - 'process - 'ambient-sound - (static-sound-spec "gnawer-crawl" :fo-min 30 :fo-max 30) - (-> this root-override trans) - ) + (new 'process 'ambient-sound (static-sound-spec "gnawer-crawl" :fo-min 30 :fo-max 30) (-> this root trans)) ) (set! (-> this sound2) - (new 'process 'ambient-sound (static-sound-spec "gnawer-chew" :fo-max 40) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "gnawer-chew" :fo-max 40) (-> this root trans)) ) (dotimes (v1-110 10) (let ((a0-59 (-> this segments v1-110))) diff --git a/goal_src/jak1/levels/maincave/maincave-obs.gc b/goal_src/jak1/levels/maincave/maincave-obs.gc index c8e23abd186..bdf87e45a01 100644 --- a/goal_src/jak1/levels/maincave/maincave-obs.gc +++ b/goal_src/jak1/levels/maincave/maincave-obs.gc @@ -8,12 +8,8 @@ ;; DECOMP BEGINS (deftype maincavecam (pov-camera) - ((seq uint64 :offset-assert 224) + ((seq uint64) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xe8 - :flag-assert #x1e008000e8 ) @@ -22,7 +18,7 @@ :bounds (static-spherem 0 0 0 10) ) -(defmethod set-stack-size! maincavecam ((this maincavecam)) +(defmethod set-stack-size! ((this maincavecam)) (stack-size-set! (-> this main-thread) 512) (none) ) @@ -68,10 +64,6 @@ (deftype cave-water (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) @@ -88,7 +80,7 @@ ) ) -(defmethod water-vol-method-22 cave-water ((this cave-water)) +(defmethod water-vol-method-22 ((this cave-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) @@ -108,12 +100,8 @@ ) (deftype cavecrusher (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states cavecrusher-idle ) @@ -155,7 +143,7 @@ :post ja-post ) -(defmethod init-from-entity! cavecrusher ((this cavecrusher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cavecrusher) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -168,12 +156,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *cavecrusher-sg* '()) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "crush-click" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "crush-click" :fo-max 30) (-> this root trans)) ) (ja-channel-push! 1 0) (let ((s5-1 (-> this skel root-channel 0))) @@ -185,22 +173,18 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go cavecrusher-idle) (none) ) (deftype cavetrapdoor (process-drawable) - ((root-override collide-shape-moving :offset 112) - (delay-before-wiggle int32 :offset-assert 176) + ((root collide-shape-moving :override) + (delay-before-wiggle int32) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xb4 - :flag-assert #x16005000b4 - (:methods - (idle () _type_ :state 20) - (trigger () _type_ :state 21) + (:state-methods + idle + trigger ) ) @@ -217,7 +201,7 @@ (case message (('touch) (when (= (-> proc type) target) - (when (>= (- (-> (target-pos 0) y) (-> self root-override trans y)) 409.6) + (when (>= (- (-> (target-pos 0) y) (-> self root trans y)) 409.6) (send-event proc 'no-look-around (seconds 1.5)) (go-virtual trigger) ) @@ -250,21 +234,19 @@ (suspend) (ja :num! (seek!)) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :group! cavetrapdoor-swing-ja :num! (seek! (ja-aframe 290.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 290.0 0))) ) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (until (or (or (not *target*) - (< 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (until (or (or (not *target*) (< 28672.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) @@ -281,7 +263,7 @@ ) (ja-no-eval :group! cavetrapdoor-reset-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (when (and (and *target* (>= 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and (and *target* (>= 28672.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) @@ -302,7 +284,7 @@ :post pusher-post ) -(defmethod init-from-entity! cavetrapdoor ((this cavetrapdoor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cavetrapdoor) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -322,7 +304,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *cavetrapdoor-sg* '()) @@ -336,8 +318,8 @@ (set! (-> s4-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) - (let ((f0-7 (quaternion-y-angle (-> this root-override quat))) + (update-transforms! (-> this root)) + (let ((f0-7 (quaternion-y-angle (-> this root quat))) (s4-2 (-> this draw bounds)) ) (set-vector! s4-2 0.0 -8192.0 4096.0 1.0) @@ -358,19 +340,15 @@ ) (deftype caveflamepots (process-drawable) - ((root-override collide-shape :offset 112) - (shove-up float :offset-assert 176) - (cycle-speed int32 :offset-assert 180) - (cycle-pause int32 :offset-assert 184) - (cycle-offset uint32 :offset-assert 188) - (was-deadly? symbol :offset-assert 192) - (should-play-sound? symbol :offset-assert 196) - (launch-pos vector 2 :inline :offset-assert 208) + ((root collide-shape :override) + (shove-up float) + (cycle-speed int32) + (cycle-pause int32) + (cycle-offset uint32) + (was-deadly? symbol) + (should-play-sound? symbol) + (launch-pos vector 2 :inline) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xf0 - :flag-assert #x14008000f0 (:states caveflamepots-active ) @@ -433,7 +411,7 @@ (collide-action) ) (let ((s4-0 (new 'stack 'attack-info))) - (calc-shove-up (-> self root-override) s4-0 (-> self shove-up)) + (calc-shove-up (-> self root) s4-0 (-> self shove-up)) (if (or (= (-> *target* control unknown-surface00 mode) 'air) (>= (+ (current-time) (seconds -0.2)) (-> *target* control unknown-dword11)) (< 0.75 (-> *target* control poly-normal y)) @@ -470,7 +448,7 @@ ) (cond ((< gp-0 a0-1) - (when (sphere-in-view-frustum? (the-as sphere (-> self root-override root-prim prim-core))) + (when (sphere-in-view-frustum? (the-as sphere (-> self root root-prim prim-core))) (launch-particles (-> *part-id-table* 704) (the-as vector (-> self launch-pos))) (launch-particles (-> *part-id-table* 705) (the-as vector (&-> self stack 112))) ) @@ -482,26 +460,26 @@ ((< gp-0 30) (when (-> self was-deadly?) (set! (-> self was-deadly?) #f) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) ) ) (else (when (not (-> self was-deadly?)) (set! (-> self was-deadly?) #t) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) ) ) ) (when (and (not (-> self was-deadly?)) (< 60 gp-0)) (set! (-> self was-deadly?) #t) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) ) ) (else (set! (-> self should-play-sound?) #t) (when (-> self was-deadly?) (set! (-> self was-deadly?) #f) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) ) ) ) @@ -515,7 +493,7 @@ ) ) -(defmethod init-from-entity! caveflamepots ((this caveflamepots) (arg0 entity-actor)) +(defmethod init-from-entity! ((this caveflamepots) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) (set! (-> this was-deadly?) #f) (set! (-> this should-play-sound?) #f) @@ -561,7 +539,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (let ((v1-42 (new 'process 'path-control this 'path 0.0))) @@ -573,10 +551,10 @@ ) (let ((f0-23 (res-lump-float arg0 'rotoffset))) (if (!= f0-23 0.0) - (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-23) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-23) ) ) - (let ((f30-0 (quaternion-y-angle (-> this root-override quat)))) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (let ((s4-1 (-> this launch-pos))) (let ((v1-53 s4-1)) (set! (-> v1-53 0 x) 6144.0) @@ -585,14 +563,14 @@ (set! (-> v1-53 0 w) 1.0) ) (vector-rotate-around-y! (the-as vector s4-1) (the-as vector s4-1) f30-0) - (vector+! (the-as vector s4-1) (the-as vector s4-1) (-> this root-override trans)) + (vector+! (the-as vector s4-1) (the-as vector s4-1) (-> this root trans)) ) (let ((s4-2 (the-as object (&-> this stack 112)))) (set-vector! (the-as vector s4-2) -6144.0 0.0 0.0 1.0) (vector-rotate-around-y! (the-as vector s4-2) (the-as vector s4-2) f30-0) - (vector+! (the-as vector s4-2) (the-as vector s4-2) (-> this root-override trans)) + (vector+! (the-as vector s4-2) (the-as vector s4-2) (-> this root trans)) ) - (let ((s4-3 (-> this root-override root-prim))) + (let ((s4-3 (-> this root root-prim))) (dotimes (s3-1 (-> (the-as collide-shape-prim-group s4-3) num-prims)) (let ((a1-19 (-> (the-as collide-shape-prim-group s4-3) prims s3-1 local-sphere))) (vector-rotate-around-y! a1-19 a1-19 f30-0) @@ -600,7 +578,7 @@ ) ) ) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (let ((f30-1 300.0)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-70 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-16)))) @@ -644,13 +622,9 @@ ) (deftype cavespatula (process-drawable) - ((root-override collide-shape-moving :offset 112) - (sync sync-info :inline :offset-assert 176) + ((root collide-shape-moving :override) + (sync sync-info :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states cavespatula-idle ) @@ -672,7 +646,7 @@ (rider-trans) (update! (-> self sound)) (let ((f0-0 (get-current-phase (-> self sync)))) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (* -65536.0 f0-0)) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (* -65536.0 f0-0)) ) ) :code (behavior () @@ -684,7 +658,7 @@ :post rider-post ) -(defmethod init-from-entity! cavespatula ((this cavespatula) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cavespatula) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -704,16 +678,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set! (-> this sound) - (new - 'process - 'ambient-sound - (static-sound-spec "spatula" :fo-min 25 :fo-max 50) - (-> this root-override trans) - ) + (new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> this root trans)) ) (case (-> (if (-> this entity) (-> this entity extra level) @@ -749,7 +718,7 @@ (logior! (-> this skel status) (janim-status inited)) (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (create-connection! *cavecrystal-light-control* this @@ -763,13 +732,9 @@ ) (deftype cavespatulatwo (process-drawable) - ((root-override collide-shape-moving :offset 112) - (sync sync-info :inline :offset-assert 176) + ((root collide-shape-moving :override) + (sync sync-info :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states cavespatulatwo-idle ) @@ -787,7 +752,7 @@ (rider-trans) (update! (-> self sound)) (let ((f0-0 (get-current-phase (-> self sync)))) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (* -65536.0 f0-0)) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (* -65536.0 f0-0)) ) ) :code (behavior () @@ -799,7 +764,7 @@ :post rider-post ) -(defmethod init-from-entity! cavespatulatwo ((this cavespatulatwo) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cavespatulatwo) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -819,7 +784,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *cavespatulatwo-sg* '()) @@ -836,36 +801,28 @@ (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (set! (-> this sound) (new - 'process - 'ambient-sound - (static-sound-spec "spatula" :fo-min 25 :fo-max 50) - (-> this root-override trans) - ) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> this root trans)) ) (go cavespatulatwo-idle) (none) ) (deftype caveelevator (process-drawable) - ((root-override collide-shape-moving :offset 112) - (elev-mode uint64 :offset-assert 176) - (elev-type int32 :offset-assert 184) - (prev-frame-num float :offset-assert 188) - (last-update-bounce-time time-frame :offset-assert 192) - (orig-trans vector :inline :offset-assert 208) - (sync sync-info :inline :offset-assert 224) - (smush smush-control :inline :offset-assert 232) - (anim int32 2 :offset-assert 264) - (wheel-ry-mat matrix :inline :offset 272) + ((root collide-shape-moving :override) + (elev-mode uint64) + (elev-type int32) + (prev-frame-num float) + (last-update-bounce-time time-frame) + (orig-trans vector :inline) + (sync sync-info :inline) + (smush smush-control :inline) + (anim int32 2) + (wheel-ry-mat matrix :inline :offset 272) ) - :heap-base #xe0 - :method-count-assert 22 - :size-assert #x150 - :flag-assert #x1600e00150 (:methods - (caveelevator-method-20 (_type_) none 20) - (caveelevator-method-21 (_type_) float 21) + (caveelevator-method-20 (_type_) none) + (caveelevator-method-21 (_type_) float) ) (:states caveelevator-cycle-active @@ -887,7 +844,7 @@ (let ((v1-1 (-> arg0 0 node-list))) (if (and (>= arg1 0) (nonzero? v1-1)) (vector<-cspace! s5-0 (-> v1-1 data arg1)) - (set! (-> s5-0 quad) (-> arg0 0 root-override trans quad)) + (set! (-> s5-0 quad) (-> arg0 0 root trans quad)) ) ) (set! (-> s5-0 w) arg2) @@ -900,7 +857,7 @@ ) ) -(defmethod caveelevator-method-20 caveelevator ((this caveelevator)) +(defmethod caveelevator-method-20 ((this caveelevator)) (let ((v1-1 (current-time))) (when (!= v1-1 (-> this last-update-bounce-time)) (set! (-> this last-update-bounce-time) v1-1) @@ -908,7 +865,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> this orig-trans quad)) (+! (-> s5-0 y) (* 819.2 (update! (-> this smush)))) - (move-to-point! (-> this root-override) s5-0) + (move-to-point! (-> this root) s5-0) ) ) ) @@ -916,12 +873,12 @@ (none) ) -(defmethod caveelevator-method-21 caveelevator ((this caveelevator)) +(defmethod caveelevator-method-21 ((this caveelevator)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (-> this draw bounds)) ) (vector<-cspace! s5-0 (-> this node-list data 3)) - (vector-! gp-0 s5-0 (-> this root-override trans)) + (vector-! gp-0 s5-0 (-> this root trans)) (set! (-> gp-0 w) 17408.0) ) ) @@ -970,9 +927,7 @@ (go caveelevator-one-way-travel-to-end) ) (('attack 'touch) - (if (and (= (-> proc type) target) - (>= 8192.0 (vector-vector-xz-distance (target-pos 0) (-> self root-override trans))) - ) + (if (and (= (-> proc type) target) (>= 8192.0 (vector-vector-xz-distance (target-pos 0) (-> self root trans)))) (go caveelevator-one-way-travel-to-end) ) ) @@ -1044,7 +999,7 @@ ) :trans (behavior () (cond - ((zero? (-> self root-override riders num-riders)) + ((zero? (-> self root riders num-riders)) (if (time-elapsed? (-> self state-time) (seconds 3)) (go caveelevator-one-way-travel-to-start) ) @@ -1122,7 +1077,7 @@ (none) ) -(defmethod init-from-entity! caveelevator ((this caveelevator) (arg0 entity-actor)) +(defmethod init-from-entity! ((this caveelevator) (arg0 entity-actor)) (local-vars (v1-43 int) (sv-16 res-tag)) (set! (-> this prev-frame-num) 10000.0) (set! (-> this last-update-bounce-time) 0) @@ -1145,7 +1100,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *caveelevator-sg* '()) @@ -1154,18 +1109,18 @@ (set! sv-16 (new 'static 'res-tag)) (let ((v1-28 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-28 - (+! (-> this root-override trans x) (-> v1-28 0)) - (+! (-> this root-override trans y) (-> v1-28 1)) - (+! (-> this root-override trans z) (-> v1-28 2)) + (+! (-> this root trans x) (-> v1-28 0)) + (+! (-> this root trans y) (-> v1-28 1)) + (+! (-> this root trans z) (-> v1-28 2)) ) ) - (set! (-> this orig-trans quad) (-> this root-override trans quad)) + (set! (-> this orig-trans quad) (-> this root trans quad)) (let ((f0-13 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-13 0.0) - (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-13) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-13) ) ) - (let ((f0-14 (quaternion-y-angle (-> this root-override quat)))) + (let ((f0-14 (quaternion-y-angle (-> this root quat)))) (matrix-rotate-y! (-> this wheel-ry-mat) f0-14) ) (set-zero! (-> this smush)) diff --git a/goal_src/jak1/levels/maincave/maincave-part.gc b/goal_src/jak1/levels/maincave/maincave-part.gc index c2836c9eb9b..5bb067970be 100644 --- a/goal_src/jak1/levels/maincave/maincave-part.gc +++ b/goal_src/jak1/levels/maincave/maincave-part.gc @@ -9,19 +9,11 @@ (deftype maincave-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) (deftype darkcave-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/maincave/mother-spider-egg.gc b/goal_src/jak1/levels/maincave/mother-spider-egg.gc index 889ccfac8e3..e8b7cab9a9d 100644 --- a/goal_src/jak1/levels/maincave/mother-spider-egg.gc +++ b/goal_src/jak1/levels/maincave/mother-spider-egg.gc @@ -9,24 +9,20 @@ ;; DECOMP BEGINS (deftype mother-spider-egg (process-drawable) - ((parent-override (pointer mother-spider) :offset 12) - (root-override collide-shape-moving :offset 112) - (anim-speed float :offset-assert 176) - (part2 sparticle-launch-control :offset-assert 180) - (falling-start-time time-frame :offset-assert 184) - (fall-dest vector :inline :offset-assert 192) - (fall-dest-normal vector :inline :offset-assert 208) - (broken-look lod-set :inline :offset-assert 224) - (traj trajectory :inline :offset-assert 272) - (shadow-pos vector :inline :offset-assert 320) + ((root collide-shape-moving :override) + (parent-override (pointer mother-spider) :overlay-at parent) + (anim-speed float) + (part2 sparticle-launch-control) + (falling-start-time time-frame) + (fall-dest vector :inline) + (fall-dest-normal vector :inline) + (broken-look lod-set :inline) + (traj trajectory :inline) + (shadow-pos vector :inline) ) - :heap-base #xe0 - :method-count-assert 22 - :size-assert #x150 - :flag-assert #x1600e00150 (:methods - (mother-spider-egg-method-20 (_type_) none 20) - (draw-egg-shadow (_type_ vector symbol) symbol 21) + (mother-spider-egg-method-20 (_type_) none) + (draw-egg-shadow (_type_ vector symbol) symbol) ) (:states mother-spider-egg-die @@ -155,7 +151,7 @@ ) ) -(defmethod draw-egg-shadow mother-spider-egg ((this mother-spider-egg) (arg0 vector) (arg1 symbol)) +(defmethod draw-egg-shadow ((this mother-spider-egg) (arg0 vector) (arg1 symbol)) (cond ((and (-> this draw shadow) (zero? (-> this draw cur-lod)) @@ -165,7 +161,7 @@ (a1-1 (new 'stack-no-clear 'vector)) (a2-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> this root-override trans quad)) + (set! (-> a1-1 quad) (-> this root trans quad)) (+! (-> a1-1 y) 1228.8) (set-vector! a2-1 0.0 -61440.0 0.0 1.0) (cond @@ -228,9 +224,9 @@ :trans (behavior () (let ((f30-0 (fmin (the float (- (current-time) (-> self falling-start-time))) (-> self traj time)))) (let ((f28-0 (/ f30-0 (-> self traj time)))) - (eval-position! (-> self traj) f30-0 (-> self root-override trans)) + (eval-position! (-> self traj) f30-0 (-> self root trans)) (let ((f0-3 (lerp 0.3 0.4 f28-0))) - (set-vector! (-> self root-override scale) f0-3 f0-3 f0-3 1.0) + (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) ) (when (= f30-0 (-> self traj time)) @@ -257,14 +253,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('touch) - (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> block param 0)) - 0.7 - 6144.0 - 16384.0 - ) + (send-shove-back (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) ) (('attack) (go mother-spider-egg-die) @@ -291,7 +280,7 @@ (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (quaternion-copy! gp-0 (-> self root-override quat)) + (quaternion-copy! gp-0 (-> self root quat)) (set-vector! s4-0 0.0 1.0 0.0 1.0) (set! (-> s3-0 quad) (-> self fall-dest-normal quad)) (vector-normalize! s3-0 1.0) @@ -304,7 +293,7 @@ (v1-19 (ja-group)) (f0-9 (/ f0-8 (the float (+ (-> v1-19 data 0 length) -1)))) ) - (quaternion-slerp! (-> self root-override quat) gp-0 s5-0 f0-9) + (quaternion-slerp! (-> self root quat) gp-0 s5-0 f0-9) ) (suspend) (ja :num! (seek! max 1.3)) @@ -327,7 +316,7 @@ (let ((a1-0 (new 'stack-no-clear 'vector))) (set! (-> a1-0 quad) (-> self fall-dest quad)) (compute-and-draw-shadow - (-> self root-override trans) + (-> self root trans) a1-0 (-> self fall-dest-normal) (the-as vector 7372.8) @@ -339,7 +328,7 @@ ) :code (behavior () (send-event (ppointer->process (-> self parent-override)) 'trigger) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (process-spawn part-tracker :init part-tracker-init @@ -348,7 +337,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) @@ -376,7 +365,7 @@ 0 (lods-assign! (-> self draw) (-> self broken-look)) (ja-channel-push! 1 (seconds 0.1)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (process-spawn part-tracker :init part-tracker-init @@ -385,7 +374,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (ja-no-eval :group! spider-egg-die-ja :num! (seek!) :frame-num 0.0) @@ -401,12 +390,12 @@ (defstate mother-spider-egg-die-while-falling (mother-spider-egg) :trans (behavior () (let ((f0-2 (fmin (the float (- (current-time) (-> self falling-start-time))) (-> self traj time)))) - (eval-position! (-> self traj) f0-2 (-> self root-override trans)) + (eval-position! (-> self traj) f0-2 (-> self root trans)) ) ) :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (let ((v1-5 (-> self draw shadow-ctrl))) (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) @@ -419,7 +408,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) @@ -442,9 +431,9 @@ (logior! (-> v1-8 settings flags) (shadow-flags disable-draw)) ) 0 - (logclear! (-> self root-override nav-flags) (nav-flags navf0)) - (logclear! (-> self root-override nav-flags) (nav-flags navf1)) - (clear-collide-with-as (-> self root-override)) + (logclear! (-> self root nav-flags) (nav-flags navf0)) + (logclear! (-> self root nav-flags) (nav-flags navf1)) + (clear-collide-with-as (-> self root)) (until (not (-> self child)) (suspend) ) @@ -473,24 +462,24 @@ ) (set! (-> s4-1 nav-radius) 4096.0) (backup-collide-with-as s4-1) - (set! (-> self root-override) s4-1) + (set! (-> self root) s4-1) ) - (set! (-> self root-override trans quad) (-> arg1 quad)) - (set-vector! (-> self root-override scale) 0.3 0.3 0.3 1.0) - (quaternion-copy! (-> self root-override quat) (-> self parent-override 0 root-override quat)) + (set! (-> self root trans quad) (-> arg1 quad)) + (set-vector! (-> self root scale) 0.3 0.3 0.3 1.0) + (quaternion-copy! (-> self root quat) (-> self parent-override 0 root quat)) (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self mask) (process-mask enemy)) (logior! (-> self mask) (process-mask attackable)) (initialize-skeleton self *mother-spider-egg-unbroken-sg* '()) (setup-lods! (-> self broken-look) *mother-spider-egg-broken-sg* (-> self draw art-group) (-> self entity)) (set! (-> self draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) - (set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0)) + (set! (-> self nav) (new 'process 'nav-control (-> self root) 16 40960.0)) (logior! (-> self nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (logclear! (-> self root-override nav-flags) (nav-flags navf0)) - (logior! (-> self root-override nav-flags) (nav-flags navf1)) + (logclear! (-> self root nav-flags) (nav-flags navf0)) + (logior! (-> self root nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self fall-dest quad)) (set! (-> self nav extra-nav-sphere w) 4096.0) - (setup-from-to-height! (-> self traj) (-> self root-override trans) arg2 4096.0 -4.551111) + (setup-from-to-height! (-> self traj) (-> self root trans) arg2 4096.0 -4.551111) (create-connection! *cavecrystal-light-control* self diff --git a/goal_src/jak1/levels/maincave/mother-spider-h.gc b/goal_src/jak1/levels/maincave/mother-spider-h.gc index f7261857f5e..e22458f167f 100644 --- a/goal_src/jak1/levels/maincave/mother-spider-h.gc +++ b/goal_src/jak1/levels/maincave/mother-spider-h.gc @@ -8,15 +8,11 @@ ;; DECOMP BEGINS (deftype mother-spider-leg (process-drawable) - ((gravity float :offset-assert 176) - (transv vector :inline :offset-assert 192) - (facing-rot vector :inline :offset-assert 208) - (facing-rotv vector :inline :offset-assert 224) + ((gravity float) + (transv vector :inline) + (facing-rot vector :inline) + (facing-rotv vector :inline) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xf0 - :flag-assert #x14008000f0 (:states mother-spider-leg-flying ) @@ -24,110 +20,94 @@ (deftype mother-spider-thread (structure) - ((joint-index int32 :offset-assert 0) - (trans-u float :offset-assert 4) - (swing-arc-u float :offset-assert 8) + ((joint-index int32) + (trans-u float) + (swing-arc-u float) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype mother-spider-leg-info (structure) - ((joint-index0 int32 :offset-assert 0) - (joint-index1 int32 :offset-assert 4) - (cprim-index int32 :offset-assert 8) + ((joint-index0 int32) + (joint-index1 int32) + (cprim-index int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype mother-spider-history (structure) - ((trans vector :inline :offset-assert 0) + ((trans vector :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype mother-spider-history-array (inline-array-class) - ((data mother-spider-history :dynamic :offset-assert 16) + ((data mother-spider-history :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> mother-spider-history-array heap-base) (the-as uint 16)) (deftype mother-spider (process-drawable) - ((root-override collide-shape :offset 112) - (mode uint64 :offset-assert 176) - (damage int32 :offset-assert 184) - (baby-count int32 :offset-assert 188) - (max-baby-count int32 :offset-assert 192) - (birthing-counter int32 :offset-assert 196) - (spit-counter int32 :offset-assert 200) - (leg-socket-part-mask int32 :offset-assert 204) - (dist-from-anchor float :offset-assert 208) - (targ-dist-from-anchor float :offset-assert 212) - (idle-dist-from-anchor float :offset-assert 216) - (player-sticky-dist-from-anchor float :offset-assert 220) - (max-dist-from-anchor float :offset-assert 224) - (activate-xz-dist float :offset-assert 228) - (deactivate-xz-dist float :offset-assert 232) - (max-spit-xz-dist float :offset-assert 236) - (max-swing-radius float :offset-assert 240) - (spin-vel float :offset-assert 244) - (thread-speed float :offset-assert 248) - (thread-vel float :offset-assert 252) - (history mother-spider-history-array :offset-assert 256) - (history-len int32 :offset-assert 260) - (history-next-index int32 :offset-assert 264) - (hit? symbol :offset-assert 268) - (going-up? symbol :offset-assert 272) - (check-z-thresh? symbol :offset-assert 276) - (activate-z-thresh float :offset-assert 280) - (deactivate-z-thresh float :offset-assert 284) - (spawned-time time-frame :offset-assert 288) - (last-update-time time-frame :offset-assert 296) - (spin-time time-frame :offset-assert 304) - (last-spit-time time-frame :offset-assert 312) - (last-player-in-air-time time-frame :offset-assert 320) - (started-birthing-time time-frame :offset-assert 328) - (neck joint-mod :offset-assert 336) - (player-attack-id uint64 :offset-assert 344) - (leg-socket-part-time time-frame 6 :offset-assert 352) - (orient-rot vector :inline :offset-assert 400) - (anchor-trans vector :inline :offset-assert 416) - (thread-min-trans vector :inline :offset-assert 432) - (swing-pos vector :inline :offset-assert 448) - (swing-base-pos vector :inline :offset-assert 464) - (swing-vel vector :inline :offset-assert 480) + ((root collide-shape :override) + (mode uint64) + (damage int32) + (baby-count int32) + (max-baby-count int32) + (birthing-counter int32) + (spit-counter int32) + (leg-socket-part-mask int32) + (dist-from-anchor float) + (targ-dist-from-anchor float) + (idle-dist-from-anchor float) + (player-sticky-dist-from-anchor float) + (max-dist-from-anchor float) + (activate-xz-dist float) + (deactivate-xz-dist float) + (max-spit-xz-dist float) + (max-swing-radius float) + (spin-vel float) + (thread-speed float) + (thread-vel float) + (history mother-spider-history-array) + (history-len int32) + (history-next-index int32) + (hit? symbol) + (going-up? symbol) + (check-z-thresh? symbol) + (activate-z-thresh float) + (deactivate-z-thresh float) + (spawned-time time-frame) + (last-update-time time-frame) + (spin-time time-frame) + (last-spit-time time-frame) + (last-player-in-air-time time-frame) + (started-birthing-time time-frame) + (neck joint-mod) + (player-attack-id uint64) + (leg-socket-part-time time-frame 6) + (orient-rot vector :inline) + (anchor-trans vector :inline) + (thread-min-trans vector :inline) + (swing-pos vector :inline) + (swing-base-pos vector :inline) + (swing-vel vector :inline) ) - :heap-base #x180 - :method-count-assert 32 - :size-assert #x1f0 - :flag-assert #x20018001f0 (:methods - (mother-spider-method-20 (_type_ vector vector) symbol 20) - (mother-spider-method-21 (_type_ vector float symbol) symbol 21) - (mother-spider-method-22 (_type_ matrix vector) float 22) - (mother-spider-method-23 (_type_) none 23) - (shadow-handler (_type_) number 24) - (letgo-player? (_type_) symbol 25) - (grab-player? (_type_) symbol 26) - (mother-spider-method-27 (_type_) none 27) - (mother-spider-method-28 (_type_) none 28) - (mother-spider-method-29 (_type_ symbol symbol) none 29) - (spawn-child (_type_ vector vector symbol) int 30) - (is-player-stuck? (_type_) symbol 31) + (mother-spider-method-20 (_type_ vector vector) symbol) + (mother-spider-method-21 (_type_ vector float symbol) symbol) + (mother-spider-method-22 (_type_ matrix vector) float) + (mother-spider-method-23 (_type_) none) + (shadow-handler (_type_) number) + (letgo-player? (_type_) symbol) + (grab-player? (_type_) symbol) + (mother-spider-method-27 (_type_) none) + (mother-spider-method-28 (_type_) none) + (mother-spider-method-29 (_type_ symbol symbol) none) + (spawn-child (_type_ vector vector symbol) int) + (is-player-stuck? (_type_) symbol) ) (:states mother-spider-birth-baby diff --git a/goal_src/jak1/levels/maincave/mother-spider-proj.gc b/goal_src/jak1/levels/maincave/mother-spider-proj.gc index e6440d1fc6d..9dc98340f1d 100644 --- a/goal_src/jak1/levels/maincave/mother-spider-proj.gc +++ b/goal_src/jak1/levels/maincave/mother-spider-proj.gc @@ -8,13 +8,9 @@ ;; DECOMP BEGINS (deftype mother-spider-proj (projectile) - ((parent-process (pointer projectile) :offset 12) - (facing-dir vector :inline :offset-assert 416) + ((parent-process (pointer projectile) :overlay-at parent) + (facing-dir vector :inline) ) - :heap-base #x140 - :method-count-assert 29 - :size-assert #x1b0 - :flag-assert #x1d014001b0 ) @@ -225,13 +221,13 @@ :parts ((sp-item 722)) ) -(defmethod projectile-method-24 mother-spider-proj ((this mother-spider-proj)) +(defmethod projectile-method-24 ((this mother-spider-proj)) (with-pp - (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) + (spawn (-> this part) (the-as vector (-> this root root-prim prim-core))) (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) (set! (-> s5-0 id) (-> this sound-id)) - (let ((a1-1 (-> this root-override trans))) + (let ((a1-1 (-> this root trans))) (let ((s4-0 pp)) (when (= a1-1 #t) (if (and s4-0 (type-type? (-> s4-0 type) process-drawable) (nonzero? (-> (the-as process-drawable s4-0) root))) @@ -247,7 +243,7 @@ ) (let ((f0-5 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (current-time) 75))))))))) (find-ground-and-draw-shadow - (-> this root-override trans) + (-> this root trans) (the-as vector #f) f0-5 (collide-kind background) @@ -261,15 +257,15 @@ ) (defun mother-spider-proj-update-velocity ((arg0 mother-spider-proj)) - (when (>= (vector-vector-xz-distance (-> arg0 parent-process 0 root-override trans) (-> arg0 target)) - (vector-vector-xz-distance (-> arg0 parent-process 0 root-override trans) (-> arg0 root-override trans)) + (when (>= (vector-vector-xz-distance (-> arg0 parent-process 0 root trans) (-> arg0 target)) + (vector-vector-xz-distance (-> arg0 parent-process 0 root trans) (-> arg0 root trans)) ) - (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target) (-> arg0 root-override trans))) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target) (-> arg0 root trans))) (s4-0 (new 'stack-no-clear 'vector)) - (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) + (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root transv) 1.0)) ) - (if (logtest? (-> arg0 root-override status) (cshape-moving-flags tsurf)) - (vector-flatten! s3-1 s3-1 (-> arg0 root-override local-normal)) + (if (logtest? (-> arg0 root status) (cshape-moving-flags tsurf)) + (vector-flatten! s3-1 s3-1 (-> arg0 root local-normal)) ) (vector-normalize-copy! s4-0 s3-1 1.0) (let ((s3-2 (new 'stack-no-clear 'matrix))) @@ -283,14 +279,14 @@ (vector-matrix*! s5-0 s5-0 s3-2) ) (vector-normalize! s5-0 1.0) - (vector-float*! (-> arg0 root-override transv) s5-0 (-> arg0 max-speed)) + (vector-float*! (-> arg0 root transv) s5-0 (-> arg0 max-speed)) ) ) 0 (none) ) -(defmethod projectile-method-26 mother-spider-proj ((this mother-spider-proj)) +(defmethod projectile-method-26 ((this mother-spider-proj)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) @@ -311,7 +307,7 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (logclear! (-> this mask) (process-mask enemy)) (logclear! (-> this mask) (process-mask crate)) @@ -321,7 +317,7 @@ (none) ) -(defmethod projectile-method-27 mother-spider-proj ((this mother-spider-proj)) +(defmethod projectile-method-27 ((this mother-spider-proj)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 326) this)) (set! (-> this max-speed) 32768.0) (set! (-> this update-velocity) mother-spider-proj-update-velocity) @@ -337,7 +333,7 @@ (none) ) -(defmethod projectile-method-28 mother-spider-proj ((this mother-spider-proj)) +(defmethod projectile-method-28 ((this mother-spider-proj)) (when (and *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) @@ -347,7 +343,7 @@ (let ((gp-0 (-> this target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (+! (-> gp-0 y) 4915.2) - (let ((f0-2 (vector-vector-distance gp-0 (-> this root-override trans))) + (let ((f0-2 (vector-vector-distance gp-0 (-> this root trans))) (a2-0 (new 'stack-no-clear 'vector)) ) (if (>= 0.0 f0-2) @@ -375,7 +371,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (if (nonzero? (-> self sound-id)) @@ -398,7 +394,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (if (nonzero? (-> self sound-id)) diff --git a/goal_src/jak1/levels/maincave/mother-spider.gc b/goal_src/jak1/levels/maincave/mother-spider.gc index 5cec1f37dc7..9453327c2c6 100644 --- a/goal_src/jak1/levels/maincave/mother-spider.gc +++ b/goal_src/jak1/levels/maincave/mother-spider.gc @@ -244,7 +244,7 @@ (else (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((v1-5 (target-pos 0))) - (vector-! gp-0 (-> self root-override trans) v1-5) + (vector-! gp-0 (-> self root trans) v1-5) ) (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 1.0) @@ -261,7 +261,7 @@ (else (let ((gp-1 (new 'stack-no-clear 'vector))) (let ((v1-10 (-> (the-as process-drawable arg0) root trans))) - (vector-! gp-1 (-> self root-override trans) v1-10) + (vector-! gp-1 (-> self root trans) v1-10) ) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) @@ -283,7 +283,7 @@ ) (let ((gp-2 (new 'stack-no-clear 'vector))) (let ((v1-20 (target-pos 0))) - (vector-! gp-2 (-> self root-override trans) v1-20) + (vector-! gp-2 (-> self root trans) v1-20) ) (set! (-> gp-2 y) 0.0) (vector-normalize! gp-2 1.0) @@ -342,7 +342,7 @@ ) ) -(defmethod spawn-child mother-spider ((this mother-spider) (arg0 vector) (arg1 vector) (arg2 symbol)) +(defmethod spawn-child ((this mother-spider) (arg0 vector) (arg1 vector) (arg2 symbol)) (let ((s3-0 (new 'stack-no-clear 'baby-spider-spawn-params))) (init! s3-0 arg2 #f #t #f 7 1 'untrigger) (set-delay! s3-0 (seconds 9)) @@ -354,7 +354,7 @@ ) ) -(defmethod is-player-stuck? mother-spider ((this mother-spider)) +(defmethod is-player-stuck? ((this mother-spider)) (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) @@ -373,16 +373,16 @@ #f ) -(defmethod mother-spider-method-27 mother-spider ((this mother-spider)) +(defmethod mother-spider-method-27 ((this mother-spider)) (none) ) -(defmethod mother-spider-method-28 mother-spider ((this mother-spider)) +(defmethod mother-spider-method-28 ((this mother-spider)) 0 (none) ) -(defmethod shadow-handler mother-spider ((this mother-spider)) +(defmethod shadow-handler ((this mother-spider)) (cond ((and (-> this draw shadow) (zero? (-> this draw cur-lod)) @@ -392,7 +392,7 @@ (a1-0 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> this root-override trans quad)) + (set! (-> a1-0 quad) (-> this root trans quad)) (set-vector! a2-0 0.0 -81920.0 0.0 1.0) (+! (-> a1-0 y) -8192.0) (cond @@ -420,7 +420,7 @@ (set! (-> v1-17 settings top-plane w) (- (+ 6144.0 (-> s5-0 intersect y)))) ) 0 - (let* ((f3-0 (vector-vector-distance (-> s5-0 intersect) (-> this root-override trans))) + (let* ((f3-0 (vector-vector-distance (-> s5-0 intersect) (-> this root trans))) (f0-14 (* 0.000030517578 (fmin 32768.0 (fmax 0.0 (+ -57344.0 f3-0))))) ) (set! (-> this draw shadow-ctrl settings shadow-dir w) (lerp 409600.0 40960.0 f0-14)) @@ -444,7 +444,7 @@ ) ) -(defmethod grab-player? mother-spider ((this mother-spider)) +(defmethod grab-player? ((this mother-spider)) (when *target* (let ((s5-0 (target-pos 0))) (when (and (>= 40960.0 (- (-> this thread-min-trans y) (-> s5-0 y))) @@ -452,7 +452,7 @@ ) (cond ((-> this check-z-thresh?) - (let ((f0-3 (- (-> s5-0 z) (-> this root-override trans z)))) + (let ((f0-3 (- (-> s5-0 z) (-> this root trans z)))) (if (>= (-> this activate-z-thresh) f0-3) (return #t) ) @@ -468,13 +468,13 @@ #f ) -(defmethod letgo-player? mother-spider ((this mother-spider)) +(defmethod letgo-player? ((this mother-spider)) (if (not *target*) (return #t) ) (let ((a1-0 (target-pos 0))) (when (-> this check-z-thresh?) - (if (>= (- (-> a1-0 z) (-> this root-override trans z)) (-> this deactivate-z-thresh)) + (if (>= (- (-> a1-0 z) (-> this root trans z)) (-> this deactivate-z-thresh)) (return #t) ) ) @@ -487,7 +487,7 @@ #f ) -(defmethod mother-spider-method-21 mother-spider ((this mother-spider) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod mother-spider-method-21 ((this mother-spider) (arg0 vector) (arg1 float) (arg2 symbol)) (local-vars (sv-112 process) (sv-128 vector) (sv-144 vector)) (let ((f30-0 (vector-length (-> this swing-pos)))) (when (< 0.0 f30-0) @@ -517,7 +517,7 @@ (set! (-> this spin-vel) 131072.0) (set-time! (-> this spin-time)) (let ((s4-1 (-> this damage)) - (s3-1 (-> this root-override root-prim)) + (s3-1 (-> this root root-prim)) ) (dotimes (s2-2 2) (when (< (-> this damage) 6) @@ -559,7 +559,7 @@ (>= (-> this damage) 6) ) -(defmethod mother-spider-method-29 mother-spider ((this mother-spider) (arg0 symbol) (arg1 symbol)) +(defmethod mother-spider-method-29 ((this mother-spider) (arg0 symbol) (arg1 symbol)) (let ((v1-1 (current-time))) (when (!= v1-1 (-> this last-update-time)) (set! (-> this last-update-time) v1-1) @@ -567,11 +567,11 @@ (let ((f0-1 (fmax 0.0 (- (-> this dist-from-anchor) (-> this idle-dist-from-anchor))))) (cond ((>= f0-1 20480.0) - (vector-identity! (-> this root-override scale)) + (vector-identity! (-> this root scale)) ) (else (let ((f0-2 (* 0.000048828126 f0-1))) - (set-vector! (-> this root-override scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) ) ) @@ -606,12 +606,7 @@ (case (-> this mode) ((1 2) (if *target* - (look-at-enemy! - (-> *target* neck) - (the-as vector (-> this root-override root-prim prim-core)) - 'attacking - this - ) + (look-at-enemy! (-> *target* neck) (the-as vector (-> this root root-prim prim-core)) 'attacking this) ) ) ) @@ -623,7 +618,7 @@ (none) ) -(defmethod mother-spider-method-23 mother-spider ((this mother-spider)) +(defmethod mother-spider-method-23 ((this mother-spider)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -743,23 +738,23 @@ (let* ((f30-2 (-> this dist-from-anchor)) (f28-2 (* 10430.379 (/ f0-26 f30-2))) ) - (set-vector! (-> this root-override trans) 0.0 (* (cos f28-2) (- f30-2)) (* (sin f28-2) f30-2) 1.0) + (set-vector! (-> this root trans) 0.0 (* (cos f28-2) (- f30-2)) (* (sin f28-2) f30-2) 1.0) ) (let ((f0-36 (atan (-> this swing-pos x) (-> this swing-pos z)))) - (vector-rotate-around-y! (-> this root-override trans) (-> this root-override trans) f0-36) + (vector-rotate-around-y! (-> this root trans) (-> this root trans) f0-36) ) - (vector+! (-> this root-override trans) (-> this root-override trans) (-> this anchor-trans)) + (vector+! (-> this root trans) (-> this root trans) (-> this anchor-trans)) ) (else - (set! (-> this root-override trans quad) (-> this anchor-trans quad)) - (set! (-> this root-override trans y) (- (-> this root-override trans y) (-> this dist-from-anchor))) + (set! (-> this root trans quad) (-> this anchor-trans quad)) + (set! (-> this root trans y) (- (-> this root trans y) (-> this dist-from-anchor))) ) ) ) (let ((v1-51 (-> this draw bounds))) - (vector+! v1-51 (-> this root-override trans) (-> this anchor-trans)) + (vector+! v1-51 (-> this root trans) (-> this anchor-trans)) (vector-float*! v1-51 v1-51 0.5) - (vector-! v1-51 v1-51 (-> this root-override trans)) + (vector-! v1-51 v1-51 (-> this root trans)) (set! (-> v1-51 w) (+ 28672.0 (* 0.5 (-> this dist-from-anchor)))) ) (cond @@ -776,9 +771,7 @@ (cond (*target* (let* ((v1-59 (target-pos 0)) - (f0-59 - (atan (- (-> v1-59 x) (-> this root-override trans x)) (- (-> v1-59 z) (-> this root-override trans z))) - ) + (f0-59 (atan (- (-> v1-59 x) (-> this root trans x)) (- (-> v1-59 z) (-> this root trans z)))) ) (if (>= 3640.889 (fabs (deg- f0-59 (-> this orient-rot y)))) (set! (-> this spin-vel) 0.0) @@ -794,9 +787,7 @@ (else (when *target* (let* ((v1-66 (target-pos 0)) - (f0-69 - (atan (- (-> v1-66 x) (-> this root-override trans x)) (- (-> v1-66 z) (-> this root-override trans z))) - ) + (f0-69 (atan (- (-> v1-66 x) (-> this root trans x)) (- (-> v1-66 z) (-> this root trans z)))) ) (set! (-> this orient-rot y) (deg-seek-smooth (-> this orient-rot y) f0-69 (* 32768.0 (seconds-per-frame)) 0.2) @@ -805,7 +796,7 @@ ) ) ) - (quaternion-zxy! (-> this root-override quat) (-> this orient-rot)) + (quaternion-zxy! (-> this root quat) (-> this orient-rot)) 0 (none) ) @@ -819,13 +810,13 @@ 0 (set! (-> self mode) (the-as uint 0)) (set! (-> self skel postbind-function) (the-as (function process-drawable none) 0)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (shut-down! (-> self neck)) (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self draw status) (draw-status hidden)) ) :exit (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (set! (-> self skel postbind-function) mother-spider-full-joint-callback) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) @@ -1046,12 +1037,12 @@ (when (and *target* (time-elapsed? (-> self last-spit-time) (seconds 3)) (time-elapsed? (-> self last-player-in-air-time) (seconds 0.06)) - (>= (-> self max-spit-xz-dist) (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) + (>= (-> self max-spit-xz-dist) (vector-vector-xz-distance (-> self root trans) (target-pos 0))) ) (let ((gp-2 (new 'stack-no-clear 'vector)) (s5-2 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-2 quad) (-> self root-override trans quad)) + (set! (-> gp-2 quad) (-> self root trans quad)) (set! (-> gp-2 w) 4096.0) (when (sphere-in-view-frustum? (the-as sphere gp-2)) (vector<-cspace! gp-2 (joint-node-index mother-spider-lod0-jg jaw)) @@ -1232,7 +1223,7 @@ (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (nav-control-method-21 (-> self nav) (-> self root-override trans)) + (nav-control-method-21 (-> self nav) (-> self root trans)) ) ) (go mother-spider-birth-baby) @@ -1276,7 +1267,7 @@ (if (letgo-player? self) (go mother-spider-traveling (the-as uint 0)) ) - (if (not (nav-control-method-21 (-> self nav) (-> self root-override trans))) + (if (not (nav-control-method-21 (-> self nav) (-> self root trans))) (go mother-spider-birthing) ) (mother-spider-method-29 self #t #t) @@ -1292,7 +1283,7 @@ (s4-0 (new 'stack-no-clear 'vector)) ) (when (mother-spider-method-20 self s5-0 s4-0) - (process-spawn mother-spider-egg (-> self entity) (-> self root-override trans) s5-0 s4-0 :to self) + (process-spawn mother-spider-egg (-> self entity) (-> self root trans) s5-0 s4-0 :to self) (+! (-> self baby-count) 1) (+! (-> self birthing-counter) -1) (sound-play "lay-eggs") @@ -1308,9 +1299,9 @@ :post transform-post ) -(defmethod mother-spider-method-20 mother-spider ((this mother-spider) (arg0 vector) (arg1 vector)) +(defmethod mother-spider-method-20 ((this mother-spider) (arg0 vector) (arg1 vector)) (set! (-> this nav nav-cull-radius) 40960.0) - (set-current-poly! (-> this nav) (nav-control-method-16 (-> this nav) (-> this root-override trans))) + (set-current-poly! (-> this nav) (nav-control-method-16 (-> this nav) (-> this root trans))) (nav-control-method-28 (-> this nav) (the-as collide-kind -1)) (dotimes (s3-1 4) (let ((f28-0 (+ 32768.0 (-> this orient-rot y))) @@ -1323,13 +1314,13 @@ (set-vector! s1-0 (sin f28-1) 0.0 (cos f28-1) 1.0) ) (vector-float*! s2-1 s1-0 f30-0) - (nav-control-method-35 (-> this nav) (-> this nav travel) (-> this root-override trans) s2-1 s1-0 f30-0) + (nav-control-method-35 (-> this nav) (-> this nav travel) (-> this root trans) s2-1 s1-0 f30-0) ) (nav-control-method-24 (-> this nav) f30-0 (the-as clip-travel-vector-to-mesh-return-info #f)) ) (cond ((>= (vector-xz-length (-> this nav travel)) 4096.0) - (vector+! arg0 (-> this root-override trans) (-> this nav travel)) + (vector+! arg0 (-> this root trans) (-> this nav travel)) (let ((s2-2 (new 'stack-no-clear 'collide-tri-result))) (cond ((>= (fill-and-probe-using-line-sphere @@ -1359,7 +1350,7 @@ ) ) ) - (project-onto-nav-mesh (-> this nav) arg0 (-> this root-override trans)) + (project-onto-nav-mesh (-> this nav) arg0 (-> this root trans)) (let ((a1-12 (new 'stack-no-clear 'vector)) (s3-2 (new 'stack-no-clear 'collide-tri-result)) ) @@ -1464,7 +1455,7 @@ ) (logclear! (-> self mask) (process-mask actor-pause)) (ja-channel-push! 1 (seconds 0.1)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :group! mother-spider-die-from-uppercut-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1488,7 +1479,7 @@ (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) (ja-channel-push! 1 (seconds 0.1)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :group! mother-spider-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1503,7 +1494,7 @@ :event mother-spider-death-event-handler :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (set! (-> self skel postbind-function) #f) (logior! (-> self draw status) (draw-status hidden)) (while (-> self child) @@ -1520,7 +1511,7 @@ (let* ((v1-1 (the-as mother-spider-thread (+ (the-as uint *mother-spider-threads*) (* s5-0 16)))) (s4-0 (-> arg0 node-list data (-> v1-1 joint-index) bone transform)) ) - (vector-! (-> s4-0 vector 3) (-> arg0 root-override trans) (-> arg0 anchor-trans)) + (vector-! (-> s4-0 vector 3) (-> arg0 root trans) (-> arg0 anchor-trans)) (vector-float*! (-> s4-0 vector 3) (-> s4-0 vector 3) (-> v1-1 trans-u)) (vector+! (-> s4-0 vector 3) (-> s4-0 vector 3) (-> arg0 anchor-trans)) (let ((f1-2 (- (-> s4-0 vector 3 x) (-> arg0 anchor-trans x))) @@ -1538,8 +1529,8 @@ (let ((a0-11 (-> arg0 node-list data 22 bone transform)) (a2-7 (new 'stack-no-clear 'vector)) ) - (vector-! a2-7 (-> arg0 root-override trans) (-> a0-11 vector 3)) - (vector+! a2-7 a2-7 (-> arg0 root-override trans)) + (vector-! a2-7 (-> arg0 root trans) (-> a0-11 vector 3)) + (vector+! a2-7 a2-7 (-> arg0 root trans)) (mother-spider-method-22 arg0 a1-0 a2-7) ) ) @@ -1563,7 +1554,7 @@ (none) ) -(defmethod mother-spider-method-22 mother-spider ((this mother-spider) (arg0 matrix) (arg1 vector)) +(defmethod mother-spider-method-22 ((this mother-spider) (arg0 matrix) (arg1 vector)) (rlet ((vf0 :class vf)) (init-vf0-vector) (vector-! (-> arg0 vector 2) arg1 (-> arg0 vector 3)) @@ -1586,23 +1577,23 @@ ) ) -(defmethod run-logic? mother-spider ((this mother-spider)) +(defmethod run-logic? ((this mother-spider)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) - (or (< (vector-vector-xz-distance (-> this root-override trans) (math-camera-pos)) (-> this deactivate-xz-dist)) + (or (< (vector-vector-xz-distance (-> this root trans) (math-camera-pos)) (-> this deactivate-xz-dist)) (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) -(defmethod relocate mother-spider ((this mother-spider) (arg0 int)) +(defmethod relocate ((this mother-spider) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) (the-as mother-spider ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod init-from-entity! mother-spider ((this mother-spider) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mother-spider) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-64 vector)) (set! (-> this baby-count) 0) (set! (-> this spit-counter) 0) @@ -1713,15 +1704,15 @@ ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *mother-spider-sg* '()) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> this nav nearest-y-threshold) 409600.0) - (logclear! (-> this root-override nav-flags) (nav-flags navf0)) - (logclear! (-> this root-override nav-flags) (nav-flags navf1)) + (logclear! (-> this root nav-flags) (nav-flags navf0)) + (logclear! (-> this root nav-flags) (nav-flags navf1)) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (set! (-> this fact) @@ -1739,8 +1730,8 @@ (set! (-> v0-30 max-dist) 102400.0) (set! (-> v0-30 ignore-angle) 16384.0) ) - (set! (-> this thread-min-trans quad) (-> this root-override trans quad)) - (set! (-> this anchor-trans quad) (-> this root-override trans quad)) + (set! (-> this thread-min-trans quad) (-> this root trans quad)) + (set! (-> this anchor-trans quad) (-> this root trans quad)) (set! (-> this max-swing-radius) 73728.0) (set! (-> this max-baby-count) 4) (let ((s4-1 #f)) @@ -1772,10 +1763,10 @@ (set! (-> this max-dist-from-anchor) (- (-> this anchor-trans y) (-> this thread-min-trans y))) (set! (-> this player-sticky-dist-from-anchor) (-> this max-dist-from-anchor)) (set! (-> this targ-dist-from-anchor) (-> this idle-dist-from-anchor)) - (set! (-> this root-override trans quad) (-> this anchor-trans quad)) - (set! (-> this root-override trans y) (- (-> this root-override trans y) (-> this idle-dist-from-anchor))) + (set! (-> this root trans quad) (-> this anchor-trans quad)) + (set! (-> this root trans y) (- (-> this root trans y) (-> this idle-dist-from-anchor))) (set-vector! (-> this orient-rot) 0.0 0.0 0.0 1.0) - (quaternion-zxy! (-> this root-override quat) (-> this orient-rot)) + (quaternion-zxy! (-> this root quat) (-> this orient-rot)) (ja-channel-push! 1 0) (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! diff --git a/goal_src/jak1/levels/maincave/spiderwebs.gc b/goal_src/jak1/levels/maincave/spiderwebs.gc index dd87276112a..3f002f85cb1 100644 --- a/goal_src/jak1/levels/maincave/spiderwebs.gc +++ b/goal_src/jak1/levels/maincave/spiderwebs.gc @@ -37,12 +37,8 @@ ) (deftype spiderwebs (process-drawable) - ((spring-height meters :offset-assert 176) + ((spring-height meters) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states spiderwebs-bounce spiderwebs-idle @@ -121,7 +117,7 @@ :post transform-post ) -(defmethod init-from-entity! spiderwebs ((this spiderwebs) (arg0 entity-actor)) +(defmethod init-from-entity! ((this spiderwebs) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) diff --git a/goal_src/jak1/levels/misty/babak-with-cannon.gc b/goal_src/jak1/levels/misty/babak-with-cannon.gc index cb97e03d917..688180f2279 100644 --- a/goal_src/jak1/levels/misty/babak-with-cannon.gc +++ b/goal_src/jak1/levels/misty/babak-with-cannon.gc @@ -10,13 +10,9 @@ ;; DECOMP BEGINS (deftype babak-with-cannon (babak) - ((cannon-ent entity :offset-assert 400) - (distance float :offset-assert 404) + ((cannon-ent entity) + (distance float) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x198 - :flag-assert #x4c01300198 (:states babak-with-cannon-jump-off-cannon babak-with-cannon-jump-onto-cannon @@ -130,7 +126,7 @@ nav-enemy-default-event-handler ) (defun babak-with-cannon-compute-ride-point ((arg0 mistycannon) (arg1 vector)) - (set! (-> arg1 quad) (-> arg0 root-override trans quad)) + (set! (-> arg1 quad) (-> arg0 root trans quad)) (let ((a1-4 (new 'static 'vector :y 18149.377 :z -17289.217 :w 1.0)) (a2-0 (-> arg0 node-list data 3 bone transform)) ) @@ -351,7 +347,7 @@ nav-enemy-default-event-handler ) ) -(defmethod common-post babak-with-cannon ((this babak-with-cannon)) +(defmethod common-post ((this babak-with-cannon)) (cond ((= (level-status *level* 'beach) 'active) (spool-push *art-control* "beachcam-cannon" 0 this -99.0) @@ -364,7 +360,7 @@ nav-enemy-default-event-handler (none) ) -(defmethod init-from-entity! babak-with-cannon ((this babak-with-cannon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this babak-with-cannon) (arg0 entity-actor)) (initialize-collision this) (process-drawable-from-entity! this arg0) (nav-enemy-method-48 this) diff --git a/goal_src/jak1/levels/misty/balloonlurker.gc b/goal_src/jak1/levels/misty/balloonlurker.gc index 47b43e41f0c..df197b63df0 100644 --- a/goal_src/jak1/levels/misty/balloonlurker.gc +++ b/goal_src/jak1/levels/misty/balloonlurker.gc @@ -213,20 +213,17 @@ ) (deftype balloonlurker-bank (basic) - ((buoyancy-depth-offset meters :offset-assert 4) - (player-mass float :offset-assert 8) - (rudder-factor float :offset-assert 12) - (max-engine-thrust float :offset-assert 16) - (max-rudder-deflection-angle float :offset-assert 20) - (throttle-factor float :offset-assert 24) - (throttle-distance float :offset-assert 28) - (throttle-close-distance float :offset-assert 32) - (explosion-force float :offset-assert 36) - (mine-weight float :offset-assert 40) + ((buoyancy-depth-offset meters) + (player-mass float) + (rudder-factor float) + (max-engine-thrust float) + (max-rudder-deflection-angle float) + (throttle-factor float) + (throttle-distance float) + (throttle-close-distance float) + (explosion-force float) + (mine-weight float) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) @@ -272,34 +269,30 @@ ) (deftype balloonlurker (rigid-body-platform) - ((explosion-force-position vector :inline :offset-assert 736) - (explosion-force vector :inline :offset-assert 752) - (explosion symbol :offset-assert 768) - (explosion-joint-index uint16 2 :offset-assert 772) - (explosion-joint-index-bytes int8 4 :offset 772) - (vulnerable symbol :offset-assert 776) - (water-y float :offset-assert 780) - (propeller joint-mod-spinner :offset-assert 784) - (rudder joint-mod-set-local :offset-assert 788) - (mine joint-mod-set-world 2 :offset-assert 792) - (buoyancy-factor float :offset-assert 800) - (rudder-control float :offset-assert 804) - (throttle-control float :offset-assert 808) - (engine-thrust float :offset-assert 812) - (dest-point vector :inline :offset-assert 816) - (dest-point-old vector :inline :offset-assert 832) - (dest-index int8 :offset-assert 848) - (auto-pilot symbol :offset-assert 852) - (dead symbol :offset-assert 856) - (anim-frame float :offset-assert 860) - (engine-sound-id sound-id :offset-assert 864) - (pedal-sound-id sound-id :offset-assert 868) - (frame-count int8 :offset-assert 872) + ((explosion-force-position vector :inline) + (explosion-force vector :inline) + (explosion symbol) + (explosion-joint-index uint16 2) + (explosion-joint-index-bytes int8 4 :overlay-at (-> explosion-joint-index 0)) + (vulnerable symbol) + (water-y float) + (propeller joint-mod-spinner) + (rudder joint-mod-set-local) + (mine joint-mod-set-world 2) + (buoyancy-factor float) + (rudder-control float) + (throttle-control float) + (engine-thrust float) + (dest-point vector :inline) + (dest-point-old vector :inline) + (dest-index int8) + (auto-pilot symbol) + (dead symbol) + (anim-frame float) + (engine-sound-id sound-id) + (pedal-sound-id sound-id) + (frame-count int8) ) - :heap-base #x300 - :method-count-assert 35 - :size-assert #x369 - :flag-assert #x2303000369 (:states balloonlurker-die (balloonlurker-mine-explode int) @@ -309,16 +302,12 @@ (deftype balloonlurker-pilot (process-drawable) - ((parent-override (pointer balloonlurker) :offset 12) - (root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) + (parent-override (pointer balloonlurker) :overlay-at parent) ) - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 (:methods - (balloonlurker-pilot-method-20 (_type_) none 20) - (balloonlurker-pilot-method-21 (_type_) none 21) + (balloonlurker-pilot-method-20 (_type_) none) + (balloonlurker-pilot-method-21 (_type_) none) ) (:states balloonlurker-pilot-die @@ -467,7 +456,7 @@ ) ) -(defmethod rigid-body-platform-method-23 balloonlurker ((this balloonlurker) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this balloonlurker) (arg0 float)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (-> this rbody matrix)) @@ -803,7 +792,7 @@ :post balloonlurker-post ) -(defmethod relocate balloonlurker ((this balloonlurker) (arg0 int)) +(defmethod relocate ((this balloonlurker) (arg0 int)) (if (nonzero? (-> this propeller)) (&+! (-> this propeller) arg0) ) @@ -838,9 +827,9 @@ ) ) :post (behavior () - (set! (-> self root-override trans quad) (-> self parent-override 0 root-overlay trans quad)) - (quaternion-copy! (-> self root-override quat) (-> self parent-override 0 root-overlay quat)) - (update-transforms! (-> self root-override)) + (set! (-> self root trans quad) (-> self parent-override 0 root-overlay trans quad)) + (quaternion-copy! (-> self root quat) (-> self parent-override 0 root-overlay quat)) + (update-transforms! (-> self root)) (ja-post) ) ) @@ -856,15 +845,11 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) - (rigid-body-method-17 - (-> self parent-override 0 rbody) - (-> self root-override trans) - (-> self root-override transv) - ) - (clear-collide-with-as (-> self root-override)) + (rigid-body-method-17 (-> self parent-override 0 rbody) (-> self root trans) (-> self root transv)) + (clear-collide-with-as (-> self root)) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! balloonlurker-pilot-death-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -874,16 +859,13 @@ (cleanup-for-death self) ) :post (behavior () - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) - ) - (integrate-no-collide! (-> self root-override) (-> self root-override transv)) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) + (integrate-no-collide! (-> self root) (-> self root transv)) (ja-post) ) ) -(defmethod balloonlurker-pilot-method-20 balloonlurker-pilot ((this balloonlurker-pilot)) +(defmethod balloonlurker-pilot-method-20 ((this balloonlurker-pilot)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -900,13 +882,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod balloonlurker-pilot-method-21 balloonlurker-pilot ((this balloonlurker-pilot)) +(defmethod balloonlurker-pilot-method-21 ((this balloonlurker-pilot)) (initialize-skeleton this *balloonlurker-pilot-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 6)) 0 @@ -920,15 +902,15 @@ (set! (-> self fact) (new 'process 'fact-info-enemy self (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> self root-override trans quad) (-> arg0 root-overlay trans quad)) - (set! (-> self root-override quat vec quad) (-> arg0 root-overlay quat vec quad)) - (set! (-> self root-override scale quad) (-> arg0 root-overlay scale quad)) + (set! (-> self root trans quad) (-> arg0 root-overlay trans quad)) + (set! (-> self root quat vec quad) (-> arg0 root-overlay quat vec quad)) + (set! (-> self root scale quad) (-> arg0 root-overlay scale quad)) (balloonlurker-pilot-method-21 self) (go balloonlurker-pilot-idle) (none) ) -(defmethod rigid-body-platform-method-30 balloonlurker ((this balloonlurker)) +(defmethod rigid-body-platform-method-30 ((this balloonlurker)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -983,7 +965,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 balloonlurker ((this balloonlurker)) +(defmethod rigid-body-platform-method-31 ((this balloonlurker)) (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton this *balloonlurker-sg* '()) (set! (-> this root-overlay pause-adjust-distance) 1228800.0) @@ -1049,7 +1031,7 @@ ) ;; WARN: Function (method 11 balloonlurker) has a return type of none, but the expression builder found a return statement. -(defmethod init-from-entity! balloonlurker ((this balloonlurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this balloonlurker) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (rigid-body-platform-method-30 this) (process-drawable-from-entity! this arg0) diff --git a/goal_src/jak1/levels/misty/bonelurker.gc b/goal_src/jak1/levels/misty/bonelurker.gc index 3aae5cedf7a..4a986f3431a 100644 --- a/goal_src/jak1/levels/misty/bonelurker.gc +++ b/goal_src/jak1/levels/misty/bonelurker.gc @@ -10,12 +10,8 @@ ;; DECOMP BEGINS (deftype bonelurker (nav-enemy) - ((bump-player-time time-frame :offset-assert 400) + ((bump-player-time time-frame) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x198 - :flag-assert #x4c01300198 (:states bonelurker-stun ) @@ -40,7 +36,7 @@ (none) ) -(defmethod touch-handler bonelurker ((this bonelurker) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this bonelurker) (arg0 process) (arg1 event-message-block)) (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) @@ -55,7 +51,7 @@ ) ) -(defmethod attack-handler bonelurker ((this bonelurker) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this bonelurker) (arg0 process) (arg1 event-message-block)) (with-pp (set-time! (-> this state-time)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -444,7 +440,7 @@ nav-enemy-default-event-handler ) ) -(defmethod initialize-collision bonelurker ((this bonelurker)) +(defmethod initialize-collision ((this bonelurker)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -491,7 +487,7 @@ nav-enemy-default-event-handler (none) ) -(defmethod nav-enemy-method-48 bonelurker ((this bonelurker)) +(defmethod nav-enemy-method-48 ((this bonelurker)) (initialize-skeleton this *bonelurker-sg* '()) (init-defaults! this *bonelurker-nav-enemy-info*) (set! (-> this neck up) (the-as uint 0)) diff --git a/goal_src/jak1/levels/misty/misty-conveyor.gc b/goal_src/jak1/levels/misty/misty-conveyor.gc index c078bb76883..5d17bd4bf77 100644 --- a/goal_src/jak1/levels/misty/misty-conveyor.gc +++ b/goal_src/jak1/levels/misty/misty-conveyor.gc @@ -55,13 +55,9 @@ ) (deftype keg-conveyor (process-drawable) - ((pivot joint-mod-spinner :offset-assert 176) - (quat quaternion :inline :offset-assert 192) + ((pivot joint-mod-spinner) + (quat quaternion :inline) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14006000d0 (:states keg-conveyor-idle ) @@ -69,14 +65,10 @@ (deftype keg-conveyor-paddle (process-drawable) - ((root-override collide-shape-moving :offset 112) - (object-on-paddle (pointer bouncing-float) :offset-assert 176) - (sync sync-info :inline :offset-assert 180) + ((root collide-shape-moving :override) + (object-on-paddle (pointer bouncing-float)) + (sync sync-info :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states keg-conveyor-paddle-idle ) @@ -84,18 +76,14 @@ (deftype keg (process-drawable) - ((root-override collide-shape-moving :offset 112) - (sync-offset float :offset-assert 176) - (keg-behavior int8 :offset-assert 180) - (path-position vector :inline :offset-assert 192) - (shadow-enable-plane vector :inline :offset-assert 208) - (smush smush-control :inline :offset-assert 224) - (sound-id sound-id :offset-assert 256) + ((root collide-shape-moving :override) + (sync-offset float) + (keg-behavior int8) + (path-position vector :inline) + (shadow-enable-plane vector :inline) + (smush smush-control :inline) + (sound-id sound-id) ) - :heap-base #xa0 - :method-count-assert 20 - :size-assert #x104 - :flag-assert #x1400a00104 (:states keg-die keg-in-chute @@ -123,9 +111,9 @@ ) (defun keg-update-smush ((arg0 keg) (arg1 float)) - (set! (-> arg0 root-override scale x) (+ 1.0 (* -1.0 arg1))) - (set! (-> arg0 root-override scale y) (+ 1.0 (* 2.0 arg1))) - (set! (-> arg0 root-override scale z) (+ 1.0 (* -1.0 arg1))) + (set! (-> arg0 root scale x) (+ 1.0 (* -1.0 arg1))) + (set! (-> arg0 root scale y) (+ 1.0 (* 2.0 arg1))) + (set! (-> arg0 root scale z) (+ 1.0 (* -1.0 arg1))) 0 (none) ) @@ -143,7 +131,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (sound-stop (-> self sound-id)) @@ -158,8 +146,8 @@ ((= (-> self keg-behavior) 1) ) (else - (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 163840.0) - (sound-play "barrel-roll" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) + (if (< (vector-vector-distance (-> self root trans) (ear-trans)) 163840.0) + (sound-play "barrel-roll" :id (-> self sound-id) :position (the-as symbol (-> self root trans))) ) ) ) @@ -179,10 +167,10 @@ (ja :num-func num-func-identity :frame-num 0.0) (loop (let ((gp-0 (-> (the-as process-drawable (-> self parent 0)) node-list data 4))) - (matrix->quaternion (-> self root-override quat) (-> gp-0 bone transform)) - (vector<-cspace! (-> self root-override trans) gp-0) + (matrix->quaternion (-> self root quat) (-> gp-0 bone transform)) + (vector<-cspace! (-> self root trans) gp-0) ) - (set! (-> self path-position quad) (-> self root-override trans quad)) + (set! (-> self path-position quad) (-> self root trans quad)) (set-time! (-> self state-time)) (suspend) ) @@ -194,11 +182,11 @@ :event keg-event-handler :code (behavior () (let ((gp-0 (new-stack-vector0))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (let ((s5-0 (eval-path-curve-div! (-> (the-as process-drawable (-> self parent 0)) path) (new-stack-vector0) 0.0 'interp) ) - (s4-0 (quaternion-copy! (new-stack-quaternion0) (-> self root-override quat))) + (s4-0 (quaternion-copy! (new-stack-quaternion0) (-> self root quat))) (s3-0 (new-stack-quaternion0)) (a1-3 (path-control-method-12 (-> (the-as process-drawable (-> self parent 0)) path) (new-stack-vector0) 0.0)) (f30-0 45.0) @@ -211,9 +199,9 @@ (go keg-on-path) ) (let ((f28-0 (/ (the float (- (current-time) (-> self state-time))) f30-0))) - (vector-lerp! (-> self root-override trans) gp-0 s5-0 f28-0) - (set! (-> self path-position quad) (-> self root-override trans quad)) - (quaternion-slerp! (-> self root-override quat) s4-0 s3-0 f28-0) + (vector-lerp! (-> self root trans) gp-0 s5-0 f28-0) + (set! (-> self path-position quad) (-> self root trans quad)) + (quaternion-slerp! (-> self root quat) s4-0 s3-0 f28-0) ) (ja :num! (loop!)) (suspend) @@ -262,8 +250,8 @@ 'interp ) (path-control-method-12 (-> (the-as keg-conveyor-paddle (-> self parent 0)) path) gp-0 sv-112) - (seek-toward-heading-vec! (-> self root-override) gp-0 131072.0 (seconds 0.1)) - (set! (-> self root-override trans quad) (-> self path-position quad)) + (seek-toward-heading-vec! (-> self root) gp-0 131072.0 (seconds 0.1)) + (set! (-> self root trans quad) (-> self path-position quad)) (when (= (-> self keg-behavior) 1) (cond ((>= (vector4-dot (camera-pos) (-> self shadow-enable-plane)) 0.0) @@ -315,14 +303,14 @@ keg-bounce-set-particle-rotation-callback (-> self ppointer) #f - (-> self root-override trans) + (-> self root trans) :to self ) ) (let ((f0-39 (update! (-> self smush)))) (keg-update-smush self f0-39) ) - (+! (-> self root-override trans y) (* f22-0 sv-48)) + (+! (-> self root trans y) (* f22-0 sv-48)) (set! (-> s5-0 x) 0.0) (set! (-> s5-0 y) 1.0) (set! (-> s5-0 z) 0.0) @@ -357,14 +345,14 @@ (logior! (-> v1-10 settings flags) (shadow-flags disable-draw)) ) 0 - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (vector-normalize! gp-0 1.0) (set-time! (-> self state-time)) (loop (if (time-elapsed? (-> self state-time) (seconds 1)) (go keg-die) ) - (let ((v1-23 (-> self root-override trans))) + (let ((v1-23 (-> self root trans))) (vector-float*! s5-0 gp-0 (* f30-0 (seconds-per-frame))) (set! (-> s5-0 y) (* f28-0 (seconds-per-frame))) (+! f28-0 (* f26-0 (seconds-per-frame))) @@ -405,9 +393,9 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> self root-override) s4-0) + (set! (-> self root) s4-0) ) - (set! (-> self root-override trans quad) (-> arg0 root-override trans quad)) + (set! (-> self root trans quad) (-> arg0 root trans quad)) (initialize-skeleton self *keg-sg* '()) (set! (-> self draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) (let ((v1-25 (-> self draw shadow-ctrl))) @@ -432,7 +420,7 @@ (logclear! (-> self mask) (process-mask actor-pause enemy)) (let ((gp-1 (new-stack-vector0))) (path-control-method-12 (-> (the-as process-drawable (-> self parent 0)) path) gp-1 0.0) - (set-heading-vec! (-> self root-override) gp-1) + (set-heading-vec! (-> self root) gp-1) ) (set! (-> self sound-id) (new-sound-id)) (go keg-on-paddle) @@ -468,9 +456,7 @@ ) (loop (let ((s4-0 #f)) - (when (or (not *target*) - (< 102400.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (when (or (not *target*) (< 102400.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (let ((v1-10 (-> *keg-conveyor-keg-spawn-table* gp-0))) (cond ((zero? v1-10) @@ -543,13 +529,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) (set! (-> self path) (new 'process 'curve-control self 'path -1000000000.0)) (logior! (-> self path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> self root-override trans quad) (-> arg0 root-override trans quad)) - (set! (-> self root-override quat vec quad) (-> arg0 root-override quat vec quad)) - (set! (-> self root-override scale quad) (-> arg0 root-override scale quad)) + (set! (-> self root trans quad) (-> arg0 root trans quad)) + (set! (-> self root quat vec quad) (-> arg0 root quat vec quad)) + (set! (-> self root scale quad) (-> arg0 root scale quad)) (initialize-skeleton self *keg-conveyor-paddle-sg* '()) (setup-params! (-> self sync) (the-as uint 4800) 0.0 0.15 0.15) (logclear! (-> self mask) (process-mask actor-pause enemy)) @@ -558,7 +544,7 @@ (none) ) -(defmethod relocate keg-conveyor ((this keg-conveyor) (arg0 int)) +(defmethod relocate ((this keg-conveyor) (arg0 int)) (if (nonzero? (-> this pivot)) (&+! (-> this pivot) arg0) ) @@ -566,7 +552,7 @@ ) ;; WARN: Function (method 11 keg-conveyor) has a return type of none, but the expression builder found a return statement. -(defmethod init-from-entity! keg-conveyor ((this keg-conveyor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this keg-conveyor) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy death)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) diff --git a/goal_src/jak1/levels/misty/misty-obs.gc b/goal_src/jak1/levels/misty/misty-obs.gc index 304c0aa265e..ee5c9963ce0 100644 --- a/goal_src/jak1/levels/misty/misty-obs.gc +++ b/goal_src/jak1/levels/misty/misty-obs.gc @@ -1003,10 +1003,6 @@ (deftype boatpaddle (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states boatpaddle-idle ) @@ -1043,7 +1039,7 @@ :post ja-post ) -(defmethod init-from-entity! boatpaddle ((this boatpaddle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this boatpaddle) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -1055,13 +1051,9 @@ ) (deftype windturbine (process-drawable) - ((spawn-particle-enable symbol :offset-assert 176) - (angle-speed float :offset-assert 180) + ((spawn-particle-enable symbol) + (angle-speed float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states windturbine-idle ) @@ -1101,7 +1093,7 @@ :post ja-post ) -(defmethod init-from-entity! windturbine ((this windturbine) (arg0 entity-actor)) +(defmethod init-from-entity! ((this windturbine) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -1116,16 +1108,12 @@ ) (deftype mis-bone-bridge (process-drawable) - ((root-override collide-shape-moving :offset 112) - (particle-group sparticle-launch-group :offset-assert 176) - (player-attack-id int32 :offset-assert 180) - (fall-anim-index int32 :offset-assert 184) - (hit-points int8 :offset-assert 188) + ((root collide-shape-moving :override) + (particle-group sparticle-launch-group) + (player-attack-id int32) + (fall-anim-index int32) + (hit-points int8) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbd - :flag-assert #x14005000bd (:states mis-bone-bridge-bump (mis-bone-bridge-fall symbol) @@ -1144,9 +1132,9 @@ (case arg2 (('attack) (let ((s5-0 (-> arg3 param 2)) - (gp-0 (vector-x-quaternion! (new-stack-vector0) (-> self root-override quat))) - (a0-4 (vector-z-quaternion! (new-stack-vector0) (-> self root-override quat))) - (v1-4 (vector-! (new-stack-vector0) (-> *target* control trans) (-> self root-override trans))) + (gp-0 (vector-x-quaternion! (new-stack-vector0) (-> self root quat))) + (a0-4 (vector-z-quaternion! (new-stack-vector0) (-> self root quat))) + (v1-4 (vector-! (new-stack-vector0) (-> *target* control trans) (-> self root trans))) ) 0.0 0.0 @@ -1179,7 +1167,7 @@ :code (behavior () (ja :num-func num-func-identity :frame-num 0.0) (loop - (if (and *target* (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and *target* (>= 32768.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id misty-bone-bridge-hint) "sksp0435" @@ -1239,7 +1227,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (ja-no-eval :group! (-> self draw art-group data (-> self fall-anim-index)) :num! (seek!) :frame-num 0.0) @@ -1258,7 +1246,7 @@ :post rider-post ) -(defmethod init-from-entity! mis-bone-bridge ((this mis-bone-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mis-bone-bridge) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -1296,7 +1284,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *mis-bone-bridge-sg* '()) @@ -1333,15 +1321,11 @@ ) (deftype breakaway (process-drawable) - ((root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) ) - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 (:methods - (init! (_type_ res-lump int) none 20) - (go-idle (_type_) none 21) + (init! (_type_ res-lump int) none) + (go-idle (_type_) none) ) (:states breakaway-about-to-fall @@ -1376,7 +1360,7 @@ (defstate breakaway-about-to-fall (breakaway) :code (behavior () (sound-play "falling-bones") - (launch-particles (-> *part-id-table* 281) (-> self root-override trans)) + (launch-particles (-> *part-id-table* 281) (-> self root trans)) (let ((gp-1 #f) (s5-1 (current-time)) ) @@ -1409,7 +1393,7 @@ (until (ja-done? 0) (+! f30-0 (* f28-0 (seconds-per-frame))) (+! f28-0 (* f26-0 (seconds-per-frame))) - (+! (-> self root-override trans y) f30-0) + (+! (-> self root trans y) f30-0) (suspend) (ja :num! (seek! (ja-aframe 32.0 0) 0.4)) ) @@ -1419,7 +1403,7 @@ :post rider-post ) -(defmethod init! breakaway ((this breakaway) (arg0 res-lump) (arg1 int)) +(defmethod init! ((this breakaway) (arg0 res-lump) (arg1 int)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -1439,42 +1423,30 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (set! (-> this link) (new 'process 'actor-link-info this)) (process-drawable-from-entity! this (the-as entity-actor arg0)) (none) ) -(defmethod go-idle breakaway ((this breakaway)) +(defmethod go-idle ((this breakaway)) (go breakaway-idle) (none) ) (deftype breakaway-right (breakaway) () - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 ) (deftype breakaway-mid (breakaway) () - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 ) (deftype breakaway-left (breakaway) () - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 ) @@ -1493,21 +1465,21 @@ :bounds (static-spherem 0 0 0 7) ) -(defmethod init-from-entity! breakaway-right ((this breakaway-right) (arg0 entity-actor)) +(defmethod init-from-entity! ((this breakaway-right) (arg0 entity-actor)) (init! this arg0 3) (initialize-skeleton this *breakaway-right-sg* '()) (go-idle this) (none) ) -(defmethod init-from-entity! breakaway-mid ((this breakaway-mid) (arg0 entity-actor)) +(defmethod init-from-entity! ((this breakaway-mid) (arg0 entity-actor)) (init! this arg0 3) (initialize-skeleton this *breakaway-mid-sg* '()) (go-idle this) (none) ) -(defmethod init-from-entity! breakaway-left ((this breakaway-left) (arg0 entity-actor)) +(defmethod init-from-entity! ((this breakaway-left) (arg0 entity-actor)) (init! this arg0 3) (initialize-skeleton this *breakaway-left-sg* '()) (go-idle this) @@ -1542,12 +1514,8 @@ ) (deftype bone-platform (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 736) + ((anchor-point vector :inline) ) - :heap-base #x280 - :method-count-assert 35 - :size-assert #x2f0 - :flag-assert #x23028002f0 ) @@ -1556,7 +1524,7 @@ :bounds (static-spherem 0 0 0 4) ) -(defmethod rigid-body-platform-method-27 bone-platform ((this bone-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-27 ((this bone-platform) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 arg0 (-> this rbody position)) (set! (-> gp-0 y) 0.0) @@ -1573,7 +1541,7 @@ (none) ) -(defmethod rigid-body-platform-method-23 bone-platform ((this bone-platform) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this bone-platform) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 @@ -1626,7 +1594,7 @@ :post rigid-body-platform-post ) -(defmethod rigid-body-platform-method-30 bone-platform ((this bone-platform)) +(defmethod rigid-body-platform-method-30 ((this bone-platform)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1651,7 +1619,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 bone-platform ((this bone-platform)) +(defmethod rigid-body-platform-method-31 ((this bone-platform)) (initialize-skeleton this *mis-bone-platform-sg* '()) (rigid-body-platform-method-29 this *bone-platform-constants*) (set! (-> this float-height-offset) -4096.0) @@ -1677,9 +1645,6 @@ (deftype mistycam (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) @@ -1729,10 +1694,6 @@ (deftype misty-battlecontroller (battlecontroller) () - :heap-base #x210 - :method-count-assert 29 - :size-assert #x27c - :flag-assert #x1d0210027c ) @@ -1752,7 +1713,7 @@ ) ) -(defmethod battlecontroller-method-27 misty-battlecontroller ((this misty-battlecontroller)) +(defmethod battlecontroller-method-27 ((this misty-battlecontroller)) (call-parent-method this) (set! (-> this misty-ambush-collision-hack) #t) 0 @@ -1801,12 +1762,8 @@ ) (deftype boat-fuelcell (process-drawable) - ((play-cutscene? symbol :offset-assert 176) + ((play-cutscene? symbol) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states boat-fuelcell-die boat-fuelcell-idle @@ -1858,7 +1815,7 @@ ) ) -(defmethod init-from-entity! boat-fuelcell ((this boat-fuelcell) (arg0 entity-actor)) +(defmethod init-from-entity! ((this boat-fuelcell) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/goal_src/jak1/levels/misty/misty-part.gc b/goal_src/jak1/levels/misty/misty-part.gc index 19575edd399..7b4747ad8ae 100644 --- a/goal_src/jak1/levels/misty/misty-part.gc +++ b/goal_src/jak1/levels/misty/misty-part.gc @@ -9,10 +9,6 @@ (deftype misty-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/misty/misty-teetertotter.gc b/goal_src/jak1/levels/misty/misty-teetertotter.gc index 25ac96e9c6c..ba5f1f6ec89 100644 --- a/goal_src/jak1/levels/misty/misty-teetertotter.gc +++ b/goal_src/jak1/levels/misty/misty-teetertotter.gc @@ -10,14 +10,10 @@ ;; DECOMP BEGINS (deftype teetertotter (process-drawable) - ((launched-player basic :offset-assert 176) - (in-launch-window basic :offset-assert 180) - (rock-is-dangerous basic :offset-assert 184) + ((launched-player basic) + (in-launch-window basic) + (rock-is-dangerous basic) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states teetertotter-bend teetertotter-idle @@ -135,7 +131,7 @@ :post rider-post ) -(defmethod init-from-entity! teetertotter ((this teetertotter) (arg0 entity-actor)) +(defmethod init-from-entity! ((this teetertotter) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) diff --git a/goal_src/jak1/levels/misty/misty-warehouse.gc b/goal_src/jak1/levels/misty/misty-warehouse.gc index 7a223667644..569c421a706 100644 --- a/goal_src/jak1/levels/misty/misty-warehouse.gc +++ b/goal_src/jak1/levels/misty/misty-warehouse.gc @@ -10,13 +10,9 @@ ;; DECOMP BEGINS (deftype silostep (process-drawable) - ((anim-limit float :offset-assert 176) - (cam-tracker handle :offset-assert 184) + ((anim-limit float) + (cam-tracker handle) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc0 - :flag-assert #x14005000c0 (:states silostep-camera silostep-idle @@ -123,7 +119,7 @@ :post #f ) -(defmethod init-from-entity! silostep ((this silostep) (arg0 entity-actor)) +(defmethod init-from-entity! ((this silostep) (arg0 entity-actor)) (logior! (-> this mask) (process-mask movie-subject)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -167,14 +163,10 @@ (deftype rounddoor (eco-door) () - :heap-base #xa0 - :method-count-assert 27 - :size-assert #x104 - :flag-assert #x1b00a00104 ) -(defmethod eco-door-method-24 rounddoor ((this rounddoor)) +(defmethod eco-door-method-24 ((this rounddoor)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) @@ -187,13 +179,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod eco-door-method-25 rounddoor ((this rounddoor)) +(defmethod eco-door-method-25 ((this rounddoor)) (initialize-skeleton this *rounddoor-sg* '()) (set! (-> this open-distance) 69632.0) (set! (-> this close-distance) 81920.0) @@ -202,9 +194,9 @@ (set! (-> this speed) 1.5) (set! (-> this auto-close) #t) (set! (-> this one-way) #t) - (vector-x-quaternion! (-> this out-dir) (-> this root-override quat)) - (set! (-> this out-dir w) (- 8192.0 (vector-dot (-> this out-dir) (-> this root-override trans)))) - (update-transforms! (-> this root-override)) + (vector-x-quaternion! (-> this out-dir) (-> this root quat)) + (set! (-> this out-dir w) (- 8192.0 (vector-dot (-> this out-dir) (-> this root trans)))) + (update-transforms! (-> this root)) 0 (none) ) diff --git a/goal_src/jak1/levels/misty/mistycannon.gc b/goal_src/jak1/levels/misty/mistycannon.gc index 8fdaa9f6ed1..7150b0d8894 100644 --- a/goal_src/jak1/levels/misty/mistycannon.gc +++ b/goal_src/jak1/levels/misty/mistycannon.gc @@ -8,14 +8,11 @@ ;; DECOMP BEGINS (deftype angle-tracker (structure) - ((value float :offset-assert 0) - (min float :offset-assert 4) - (range float :offset-assert 8) - (speed float :offset-assert 12) + ((value float) + (min float) + (range float) + (speed float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -601,21 +598,17 @@ ) (deftype mistycannon-missile (process-drawable) - ((root-override collide-shape-moving :offset 112) - (muzzle-time float :offset-assert 176) - (tumble-quat quaternion :inline :offset-assert 192) - (blast-radius float :offset-assert 208) - (water-height float :offset-assert 212) - (sfx uint32 :offset-assert 216) - (part2 sparticle-launch-control :offset-assert 220) - (ground-time time-frame :offset-assert 224) + ((root collide-shape-moving :override) + (muzzle-time float) + (tumble-quat quaternion :inline) + (blast-radius float) + (water-height float) + (sfx uint32) + (part2 sparticle-launch-control) + (ground-time time-frame) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #xe8 - :flag-assert #x15008000e8 (:methods - (spawn-part (_type_) none 20) + (spawn-part (_type_) none) ) (:states mistycannon-missile-explode @@ -625,14 +618,14 @@ ) -(defmethod relocate mistycannon-missile ((this mistycannon-missile) (arg0 int)) +(defmethod relocate ((this mistycannon-missile) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) (the-as mistycannon-missile ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate mistycannon-missile ((this mistycannon-missile)) +(defmethod deactivate ((this mistycannon-missile)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -645,7 +638,7 @@ :bounds (static-spherem 0 0 0 4) ) -(defmethod spawn-part mistycannon-missile ((this mistycannon-missile)) +(defmethod spawn-part ((this mistycannon-missile)) (let ((gp-0 (-> this part)) (a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 7))) ) @@ -669,14 +662,14 @@ 0 ) :trans (behavior () - (if (< (-> self root-override trans y) (-> self water-height)) + (if (< (-> self root trans y) (-> self water-height)) (go mistycannon-missile-in-water) ) ) :code (behavior () - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (while (not (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self muzzle-time))))) - (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) + (quaternion*! (-> self root quat) (-> self root quat) (-> self tumble-quat)) (suspend) (let ((f0-1 (fmin @@ -685,35 +678,32 @@ ) ) ) - (set! (-> self root-override scale x) (* 0.6 f0-1)) - (set! (-> self root-override scale y) (* 0.6 f0-1)) - (set! (-> self root-override scale z) (* 0.6 f0-1)) + (set! (-> self root scale x) (* 0.6 f0-1)) + (set! (-> self root scale y) (* 0.6 f0-1)) + (set! (-> self root scale z) (* 0.6 f0-1)) ) ) - (restore-collide-with-as (-> self root-override)) - (set-vector! (-> self root-override scale) 0.6 0.6 0.6 1.0) - (while (not (logtest? (-> self root-override status) (cshape-moving-flags onsurf))) - (if (and (zero? (-> self sfx)) - (< (if *target* - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - 4096000.0 - ) - 409600.0 - ) + (restore-collide-with-as (-> self root)) + (set-vector! (-> self root scale) 0.6 0.6 0.6 1.0) + (while (not (logtest? (-> self root status) (cshape-moving-flags onsurf))) + (if (and (zero? (-> self sfx)) (< (if *target* + (vector-vector-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + 409600.0 + ) ) - (set! (-> self sfx) - (the-as uint (sound-play "sack-incoming" :position (the-as symbol (-> self root-override trans)))) - ) + (set! (-> self sfx) (the-as uint (sound-play "sack-incoming" :position (the-as symbol (-> self root trans))))) ) (when (nonzero? (-> self sfx)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (the-as sound-id (-> self sfx))) - (let ((a1-3 (-> self root-override trans))) + (let ((a1-3 (-> self root trans))) (let ((s5-1 self)) (when (= a1-3 #t) - (if (and s5-1 (type-type? (-> s5-1 type) process-drawable) (nonzero? (-> s5-1 root-override))) - (set! a1-3 (-> s5-1 root-override trans)) + (if (and s5-1 (type-type? (-> s5-1 type) process-drawable) (nonzero? (-> s5-1 root))) + (set! a1-3 (-> s5-1 root trans)) (set! a1-3 (the-as vector #f)) ) ) @@ -724,18 +714,18 @@ (-> gp-1 id) ) ) - (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) + (quaternion*! (-> self root quat) (-> self root quat) (-> self tumble-quat)) (suspend) ) - (quaternion-set! (-> self root-override quat) 0.0 0.0 0.0 1.0) - (update-transforms! (-> self root-override)) + (quaternion-set! (-> self root quat) 0.0 0.0 0.0 1.0) + (update-transforms! (-> self root)) (when (nonzero? (-> self sfx)) (sound-stop (the-as sound-id (-> self sfx))) (set! (-> self sfx) (the-as uint 0)) 0 ) (set-time! (-> self ground-time)) - (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) + (sound-play "sack-land" :position (the-as symbol (-> self root trans))) (ja-no-eval :group! sack-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -749,31 +739,24 @@ (go mistycannon-missile-explode) ) :post (behavior () - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0) - ) - (set! (-> self root-override root-prim prim-core offense) (collide-offense touch)) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (-> self root-override root-prim collide-with) - ) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 1.0)) + (set! (-> self root root-prim prim-core offense) (collide-offense touch)) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (-> self root root-prim collide-with)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) (spawn-part self) (when (and (zero? (-> self draw cur-lod)) (logtest? (-> self draw status) (draw-status was-drawn))) - (if (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) + (if (logtest? (-> self root status) (cshape-moving-flags onsurf)) (draw-shadow - (-> self root-override shadow-pos) - (-> self root-override shadow-pos) - (-> self root-override ground-poly-normal) + (-> self root shadow-pos) + (-> self root shadow-pos) + (-> self root ground-poly-normal) 8192.0 4096.0 (the-as float 0) ) (find-ground-and-draw-shadow - (-> self root-override trans) - (-> self root-override shadow-pos) + (-> self root trans) + (-> self root shadow-pos) 8192.0 (collide-kind background) (the-as process-drawable #f) @@ -794,28 +777,21 @@ 0 ) (let ((a1-0 (new-stack-vector0))) - (set! (-> a1-0 x) (-> self root-override trans x)) + (set! (-> a1-0 x) (-> self root trans x)) (set! (-> a1-0 y) (-> self water-height)) - (set! (-> a1-0 z) (-> self root-override trans z)) + (set! (-> a1-0 z) (-> self root trans z)) (set! (-> a1-0 w) 1.0) (splash-spawn (the-as basic 1.0) (the-as basic a1-0) 1) ) (label cfg-3) - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0) - ) - (vector-float*! (-> self root-override transv) (-> self root-override transv) 0.5) - (update-transforms! (-> self root-override)) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (-> self root-override root-prim collide-with) - ) - (seek! (-> self root-override scale x) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - (seek! (-> self root-override scale y) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - (seek! (-> self root-override scale z) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - (when (< 0.05 (-> self root-override scale x)) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 1.0)) + (vector-float*! (-> self root transv) (-> self root transv) 0.5) + (update-transforms! (-> self root)) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (-> self root root-prim collide-with)) + (seek! (-> self root scale x) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) + (seek! (-> self root scale y) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) + (seek! (-> self root scale z) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) + (when (< 0.05 (-> self root scale x)) (suspend) (goto cfg-3) ) @@ -835,8 +811,8 @@ ) ) (when v1-2 - (let* ((v1-3 (-> (the-as mistycannon-missile v1-2) root-override)) - (a1-2 (-> self root-override root-prim prim-core)) + (let* ((v1-3 (-> (the-as mistycannon-missile v1-2) root)) + (a1-2 (-> self root root-prim prim-core)) (v1-5 (-> v1-3 root-prim prim-core)) (a2-1 (new 'stack-no-clear 'vector)) (t2-0 (new 'stack-no-clear 'collide-tri-result)) @@ -887,25 +863,25 @@ (sound-play-by-spec (static-sound-spec "explosion" :fo-min 200 :fo-max 400) (new-sound-id) (the-as vector #t)) (sound-play-by-spec (static-sound-spec "explosion") (new-sound-id) (the-as vector #t)) ) - (spawn (-> self part2) (-> self root-override trans)) + (spawn (-> self part2) (-> self root trans)) (ja-channel-set! 0) - (let ((v1-11 (-> self root-override root-prim))) + (let ((v1-11 (-> self root root-prim))) (set! (-> v1-11 local-sphere w) (-> self blast-radius)) (set! (-> v1-11 prim-core world-sphere w) (-> self blast-radius)) (set! (-> v1-11 collide-with) (collide-kind cak-2 cak-3 target crate enemy wall-object)) (set! (-> v1-11 prim-core collide-as) (collide-kind enemy)) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (let ((a1-3 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-3 options) (the-as uint 0)) (set! (-> a1-3 tlist) *touching-list*) - (find-overlapping-shapes (-> self root-override) a1-3) + (find-overlapping-shapes (-> self root) a1-3) ) (suspend) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (let ((gp-2 (current-time))) (until (time-elapsed? gp-2 (seconds 3)) - (spawn (-> self part2) (-> self root-override trans)) + (spawn (-> self part2) (-> self root trans)) (suspend) ) ) @@ -936,16 +912,13 @@ ) (deftype mistycannon-init-data (structure) - ((pos vector :offset-assert 0) - (vel vector :offset-assert 4) - (rotate float :offset-assert 8) - (flight-time float :offset-assert 12) - (muzzle-time float :offset-assert 16) - (blast-radius float :offset-assert 20) + ((pos vector) + (vel vector) + (rotate float) + (flight-time float) + (muzzle-time float) + (blast-radius float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) @@ -972,17 +945,17 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 event-self) 'touched) (set! (-> s5-0 max-iteration-count) (the-as uint 4)) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) - (set! (-> self root-override trans quad) (-> arg0 pos quad)) - (set-vector! (-> self root-override scale) 0.0 0.0 0.0 1.0) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (set-vector! (-> self root scale) 0.0 0.0 0.0 1.0) (set! (-> self muzzle-time) (-> arg0 muzzle-time)) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> arg0 rotate)) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (-> arg0 rotate)) (let ((f0-13 (/ 655360.0 (the float (the int (* 300.0 (-> arg0 flight-time))))))) (quaternion-axis-angle! (-> self tumble-quat) 1.0 0.0 0.0 f0-13) ) (initialize-skeleton self *mistycannon-missile-sg* '()) - (set! (-> self root-override transv quad) (-> arg0 vel quad)) + (set! (-> self root transv quad) (-> arg0 vel quad)) (set! (-> self blast-radius) (-> arg0 blast-radius)) (set! (-> self water-height) (res-lump-float (-> self entity) 'water-height :default -4096000.0)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 117) self)) @@ -1014,36 +987,32 @@ ) (deftype mistycannon (process-drawable) - ((root-override collide-shape-moving :offset 112) - (rotate angle-tracker :inline :offset-assert 176) - (fact-info-override fact-info-enemy :offset 144) - (tilt angle-tracker :inline :offset-assert 192) - (front-wheel float :offset-assert 208) - (rear-wheel float :offset-assert 212) - (last-known-rotation float :offset-assert 216) - (part-timer time-frame :offset-assert 224) - (hellmouth vector :inline :offset-assert 240) - (postbindinfo-ok symbol :offset-assert 256) - (launch-origin vector :inline :offset-assert 272) - (goggles vector :inline :offset-assert 288) - (avoid-entity entity-actor :offset-assert 304) - (center-point vector :inline :offset-assert 320) - (at-point vector :inline :offset-assert 336) - (accuracy-range float :offset-assert 352) - (target-theta float :offset-assert 356) - (sound-id sound-id :offset-assert 360) - (aim-sound-id sound-id :offset-assert 364) - (player-touching-grips? symbol :offset-assert 368) + ((root collide-shape-moving :override) + (fact fact-info-enemy :override) + (rotate angle-tracker :inline) + (tilt angle-tracker :inline) + (front-wheel float) + (rear-wheel float) + (last-known-rotation float) + (part-timer time-frame) + (hellmouth vector :inline) + (postbindinfo-ok symbol) + (launch-origin vector :inline) + (goggles vector :inline) + (avoid-entity entity-actor) + (center-point vector :inline) + (at-point vector :inline) + (accuracy-range float) + (target-theta float) + (sound-id sound-id) + (aim-sound-id sound-id) + (player-touching-grips? symbol) ) - :heap-base #x110 - :method-count-assert 24 - :size-assert #x174 - :flag-assert #x1801100174 (:methods - (rotate! (_type_ float) none 20) - (tilt! (_type_ float) none 21) - (mistycannon-method-22 (_type_ float float float) none 22) - (mistycannon-method-23 (_type_) none 23) + (rotate! (_type_ float) none) + (tilt! (_type_ float) none) + (mistycannon-method-22 (_type_ float float float) none) + (mistycannon-method-23 (_type_) none) ) (:states mistycannon-aim-at-player @@ -1068,20 +1037,20 @@ (none) ) -(defmethod rotate! mistycannon ((this mistycannon) (arg0 float)) +(defmethod rotate! ((this mistycannon) (arg0 float)) (angle-tracker-apply-move! (-> this rotate) arg0) 0 (none) ) -(defmethod tilt! mistycannon ((this mistycannon) (arg0 float)) +(defmethod tilt! ((this mistycannon) (arg0 float)) (angle-tracker-apply-move! (-> this tilt) arg0) 0 (none) ) ;; WARN: Function (method 22 mistycannon) has a return type of none, but the expression builder found a return statement. -(defmethod mistycannon-method-22 mistycannon ((this mistycannon) (arg0 float) (arg1 float) (arg2 float)) +(defmethod mistycannon-method-22 ((this mistycannon) (arg0 float) (arg1 float) (arg2 float)) (if (not (-> this postbindinfo-ok)) (return #f) ) @@ -1110,7 +1079,7 @@ (none) ) -(defmethod mistycannon-method-23 mistycannon ((this mistycannon)) +(defmethod mistycannon-method-23 ((this mistycannon)) (when (not (time-elapsed? (-> this part-timer) (seconds 3))) (let ((v1-4 (-> this rotate))) (set! (-> *part-id-table* 529 init-specs 24 initial-valuef) @@ -1231,9 +1200,7 @@ ) (if (and (-> self postbindinfo-ok) *target* - (>= (-> self fact-info-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (go mistycannon-aim-at-player) ) @@ -1249,12 +1216,9 @@ ) (deftype quadratic-solution (structure) - ((s1 float :offset-assert 0) - (s2 float :offset-assert 4) + ((s1 float) + (s2 float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -1278,16 +1242,13 @@ ) (deftype trajectory-params (structure) - ((x float :offset-assert 0) - (y float :offset-assert 4) - (gravity float :offset-assert 8) - (theta float :offset-assert 12) - (speed float :offset-assert 16) - (time float :offset-assert 20) + ((x float) + (y float) + (gravity float) + (theta float) + (speed float) + (time float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) @@ -1416,9 +1377,8 @@ (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (go mistycannon-waiting-for-player) ) - (if (not (and *target* (>= (-> self fact-info-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (not (and *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) ) (go mistycannon-idle) @@ -1444,7 +1404,7 @@ (('touch) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) (let ((v0-1 (the-as object #t))) @@ -1632,7 +1592,7 @@ (('touch) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) (let ((v0-0 (current-time))) @@ -1659,7 +1619,7 @@ :post rider-post ) -(defmethod init-from-entity! mistycannon ((this mistycannon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mistycannon) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) @@ -1696,16 +1656,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (quaternion-identity! (-> this root-override quat)) + (quaternion-identity! (-> this root quat)) (initialize-skeleton this *mistycannon-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this skel prebind-function) mistycannon-prebind-function) (set! (-> this skel postbind-function) mistycannon-postbind-function) - (set! (-> this fact-info-override) + (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1725,8 +1685,8 @@ (set! (-> this center-point w) (res-lump-float arg0 'center-radius)) (cond ((= (-> this center-point w) 0.0) - (set! (-> this center-point quad) (-> this root-override trans quad)) - (set! (-> this center-point w) (-> this fact-info-override idle-distance)) + (set! (-> this center-point quad) (-> this root trans quad)) + (set! (-> this center-point w) (-> this fact idle-distance)) ) (else (set! sv-16 (new 'static 'res-tag)) diff --git a/goal_src/jak1/levels/misty/mud.gc b/goal_src/jak1/levels/misty/mud.gc index 31f36744e56..a7a9c0818f3 100644 --- a/goal_src/jak1/levels/misty/mud.gc +++ b/goal_src/jak1/levels/misty/mud.gc @@ -9,10 +9,6 @@ (deftype mud (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) @@ -42,7 +38,7 @@ ) ) -(defmethod water-vol-method-22 mud ((this mud)) +(defmethod water-vol-method-22 ((this mud)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/goal_src/jak1/levels/misty/muse.gc b/goal_src/jak1/levels/misty/muse.gc index 61e0a43f2cc..ead194ea2a4 100644 --- a/goal_src/jak1/levels/misty/muse.gc +++ b/goal_src/jak1/levels/misty/muse.gc @@ -8,22 +8,18 @@ ;; DECOMP BEGINS (deftype muse (nav-enemy) - ((root-override collide-shape-moving :offset 112) - (current-path-index float :offset-assert 400) - (prev-path-index float :offset-assert 404) - (dest-path-index float :offset-assert 408) - (player-path-index float :offset-assert 412) - (max-path-index float :offset-assert 416) - (sprint-distance float :offset-assert 420) - (dest-point vector :inline :offset-assert 432) - (anim spool-anim :offset-assert 448) - (victory-anim spool-anim :offset-assert 452) - (old-target-pos transformq :inline :offset-assert 464) + ((root collide-shape-moving :override) + (current-path-index float) + (prev-path-index float) + (dest-path-index float) + (player-path-index float) + (max-path-index float) + (sprint-distance float) + (dest-point vector :inline) + (anim spool-anim) + (victory-anim spool-anim) + (old-target-pos transformq :inline) ) - :heap-base #x190 - :method-count-assert 76 - :size-assert #x200 - :flag-assert #x4c01900200 (:states muse-caught muse-idle @@ -32,17 +28,14 @@ (deftype point-on-path-segment-info (structure) - ((point vector :inline :offset-assert 0) - (segment vector 2 :inline :offset-assert 16) - (dir vector :inline :offset-assert 48) - (nearest-point vector :inline :offset-assert 64) - (segment-length float :offset-assert 80) - (distance-to-segment float :offset-assert 84) - (parametric-index float :offset-assert 88) + ((point vector :inline) + (segment vector 2 :inline) + (dir vector :inline) + (nearest-point vector :inline) + (segment-length float) + (distance-to-segment float) + (parametric-index float) ) - :method-count-assert 9 - :size-assert #x5c - :flag-assert #x90000005c ) @@ -139,7 +132,7 @@ (none) ) -(defmethod nav-enemy-method-51 muse ((this muse)) +(defmethod nav-enemy-method-51 ((this muse)) (dotimes (s5-0 2) (let ((v1-2 (rand-vu-int-range 3 (+ (-> this node-list length) -1)))) (launch-particles @@ -152,7 +145,7 @@ (none) ) -(defmethod common-post muse ((this muse)) +(defmethod common-post ((this muse)) (spool-push *art-control* (-> this anim name) 0 this -99.0) (nav-enemy-method-51 this) ((method-of-type nav-enemy common-post) this) @@ -165,11 +158,11 @@ :shadow muse-shadow-mg ) -(defmethod touch-handler muse ((this muse) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this muse) (arg0 process) (arg1 event-message-block)) (go muse-caught) ) -(defmethod attack-handler muse ((this muse) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this muse) (arg0 process) (arg1 event-message-block)) (go muse-caught) ) @@ -446,7 +439,7 @@ nav-enemy-default-event-handler ) ) -(defmethod init-from-entity! muse ((this muse) (arg0 entity-actor)) +(defmethod init-from-entity! ((this muse) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) diff --git a/goal_src/jak1/levels/misty/quicksandlurker.gc b/goal_src/jak1/levels/misty/quicksandlurker.gc index 8f4688c80aa..9246afba1e0 100644 --- a/goal_src/jak1/levels/misty/quicksandlurker.gc +++ b/goal_src/jak1/levels/misty/quicksandlurker.gc @@ -287,12 +287,8 @@ ) (deftype quicksandlurker-missile (process-drawable) - ((root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states quicksandlurker-missile-idle quicksandlurker-missile-impact @@ -335,21 +331,15 @@ ) :code (behavior () (while (not (time-elapsed? (-> self state-time) (seconds 4))) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (-> self root-override root-prim collide-with) - ) - (if (or (logtest? (-> self root-override status) (cshape-moving-flags twall)) - (< (vector-vector-distance (-> self root-override trans) (the-as vector (-> self root-override trans-old))) - 40.96 - ) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (-> self root root-prim collide-with)) + (if (or (logtest? (-> self root status) (cshape-moving-flags twall)) + (< (vector-vector-distance (-> self root trans) (the-as vector (-> self root trans-old))) 40.96) ) (go quicksandlurker-missile-impact) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (find-ground-and-draw-shadow - (-> self root-override trans) + (-> self root trans) (the-as vector #f) 8192.0 (collide-kind background) @@ -362,13 +352,13 @@ (cleanup-for-death self) ) :post (behavior () - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) ) ) (defstate quicksandlurker-missile-impact (quicksandlurker-missile) :code (behavior () - (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) + (sound-play "sack-land" :position (the-as symbol (-> self root trans))) (process-spawn part-tracker :init part-tracker-init @@ -377,7 +367,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (set-time! (-> self state-time)) @@ -389,12 +379,9 @@ ) (deftype quicksandlurker-missile-init-data (structure) - ((position vector :offset-assert 0) - (velocity vector :offset-assert 4) + ((position vector) + (velocity vector) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -420,14 +407,12 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) - (set! (-> self root-override trans quad) (-> arg0 position quad)) - (set! (-> self root-override quat vec quad) - (-> (the-as process-drawable (-> self parent 0)) root quat vec quad) - ) - (vector-identity! (-> self root-override scale)) - (set! (-> self root-override transv quad) (-> arg0 velocity quad)) + (set! (-> self root trans quad) (-> arg0 position quad)) + (set! (-> self root quat vec quad) (-> (the-as process-drawable (-> self parent 0)) root quat vec quad)) + (vector-identity! (-> self root scale)) + (set! (-> self root transv quad) (-> arg0 velocity quad)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 198) self)) (go quicksandlurker-missile-idle) (none) @@ -444,18 +429,14 @@ ) (deftype quicksandlurker (process-drawable) - ((root-override collide-shape :offset 112) - (original-position vector :inline :offset-assert 176) - (y-offset float :offset-assert 192) - (theta-angle float :offset-assert 196) - (radial-offset float :offset-assert 200) - (bob-angle float :offset-assert 204) - (mud-entity entity-actor :offset-assert 208) + ((root collide-shape :override) + (original-position vector :inline) + (y-offset float) + (theta-angle float) + (radial-offset float) + (bob-angle float) + (mud-entity entity-actor) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd4 - :flag-assert #x14007000d4 (:states quicksandlurker-attack quicksandlurker-die @@ -477,7 +458,7 @@ (defbehavior orient-to-face-target quicksandlurker () (if *target* - (seek-to-point-toward-point! (-> self root-override) (-> *target* control trans) 65536.0 (seconds 0.2)) + (seek-to-point-toward-point! (-> self root) (-> *target* control trans) 65536.0 (seconds 0.2)) ) ) @@ -515,8 +496,8 @@ (f30-2 (* 0.0 (sin (-> self theta-angle)))) ) (let ((f0-10 (* (-> self radial-offset) (sin (-> self theta-angle))))) - (set! (-> self root-override trans x) (+ (-> self original-position x) f28-0)) - (set! (-> self root-override trans z) (+ (-> self original-position z) f0-10)) + (set! (-> self root trans x) (+ (-> self original-position x) f28-0)) + (set! (-> self root trans z) (+ (-> self original-position z) f0-10)) ) (let* ((v1-4 (-> self mud-entity)) (a0-5 (if v1-4 @@ -525,10 +506,10 @@ ) ) (if a0-5 - (set! (-> self root-override trans y) - (+ (get-ripple-height (the-as water-anim a0-5) (-> self root-override trans)) f30-2 (-> self y-offset)) + (set! (-> self root trans y) + (+ (get-ripple-height (the-as water-anim a0-5) (-> self root trans)) f30-2 (-> self y-offset)) ) - (set! (-> self root-override trans y) (+ (-> self original-position y) f30-2 (-> self y-offset))) + (set! (-> self root trans y) (+ (-> self original-position y) f30-2 (-> self y-offset))) ) ) ) @@ -538,7 +519,7 @@ (defbehavior quicksandlurker-check-hide-transition quicksandlurker () (when *target* - (if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (!= (-> *target* next-state name) 'target-flop) ) (go quicksandlurker-hide) @@ -568,9 +549,7 @@ (logclear! (-> self draw status) (draw-status hidden)) ) :trans (behavior () - (if (and *target* - (>= 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* (>= 163840.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (go quicksandlurker-wait) ) ) @@ -586,13 +565,11 @@ :event quicksandlurker-default-event-handler :trans (behavior () (cond - ((and *target* (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + ((and *target* (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (set! (-> self y-offset) 1228.8) (go quicksandlurker-track) ) - ((or (not *target*) - (< 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + ((or (not *target*) (< 163840.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (seek! (-> self y-offset) -6553.6 (* 20480.0 (seconds-per-frame))) (if (= (-> self y-offset) -6553.6) (go quicksandlurker-idle) @@ -654,9 +631,7 @@ (defstate quicksandlurker-track (quicksandlurker) :event quicksandlurker-default-event-handler :trans (behavior () - (if (or (not *target*) - (< 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (or (not *target*) (< 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (go quicksandlurker-wait) ) (quicksandlurker-check-hide-transition) @@ -774,7 +749,7 @@ (set-time! (-> self state-time)) ) :exit (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) ) :trans (behavior () (if (not *target*) @@ -787,7 +762,7 @@ ((or (if (nav-control-method-16 a0-0 a1-0) #t ) - (and *target* (>= 16384.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (and *target* (>= 16384.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) ) (set-time! (-> self state-time)) ) @@ -814,10 +789,10 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (loop (orient-to-face-target) (suspend) @@ -837,7 +812,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (ja-no-eval :group! quicksandlurker-popup-ja :num! (seek!) :frame-num 0.0) @@ -866,7 +841,7 @@ :post quicksandlurker-post ) -(defmethod init-from-entity! quicksandlurker ((this quicksandlurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this quicksandlurker) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) @@ -902,18 +877,18 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (+! (-> this root-override trans y) -2048.0) - (set! (-> this original-position quad) (-> this root-override trans quad)) + (+! (-> this root trans y) -2048.0) + (set! (-> this original-position quad) (-> this root trans quad)) (set! (-> this theta-angle) (rand-vu-float-range 0.0 65536.0)) (set! (-> this bob-angle) (rand-vu-float-range 0.0 65536.0)) (set! (-> this radial-offset) 4096.0) (set! (-> this y-offset) -6553.6) - (set-yaw-angle-clear-roll-pitch! (-> this root-override) (rand-vu-float-range 0.0 65536.0)) + (set-yaw-angle-clear-roll-pitch! (-> this root) (rand-vu-float-range 0.0 65536.0)) (initialize-skeleton this *quicksandlurker-sg* '()) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) diff --git a/goal_src/jak1/levels/misty/sidekick-human.gc b/goal_src/jak1/levels/misty/sidekick-human.gc index 6c7b22d6f78..56510d30f8d 100644 --- a/goal_src/jak1/levels/misty/sidekick-human.gc +++ b/goal_src/jak1/levels/misty/sidekick-human.gc @@ -9,9 +9,6 @@ (deftype sequenceA (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) @@ -1082,27 +1079,19 @@ ) (deftype sequenceB (process-taskable) - ((bonelurker handle :offset-assert 384) - (evilbro handle :offset-assert 392) - (evilsis handle :offset-assert 400) - (lurker-army handle 9 :offset-assert 408) + ((bonelurker handle) + (evilbro handle) + (evilsis handle) + (lurker-army handle 9) ) - :heap-base #x170 - :method-count-assert 53 - :size-assert #x1e0 - :flag-assert #x35017001e0 ) (deftype sequenceC (process-taskable) - ((bonelurker handle :offset-assert 384) - (darkecocan handle :offset-assert 392) - (darkecocan-glowing-look lod-set :inline :offset-assert 400) + ((bonelurker handle) + (darkecocan handle) + (darkecocan-glowing-look lod-set :inline) ) - :heap-base #x150 - :method-count-assert 53 - :size-assert #x1b1 - :flag-assert #x35015001b1 ) @@ -1133,14 +1122,11 @@ ) (deftype army-info (structure) - ((pos vector :offset-assert 0) - (rot float :offset-assert 4) - (start-frame float :offset-assert 8) - (skel symbol :offset-assert 12) + ((pos vector) + (rot float) + (start-frame float) + (skel symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -1224,12 +1210,12 @@ (none) ) -(defmethod play-anim! sequenceB ((this sequenceB) (arg0 symbol)) +(defmethod play-anim! ((this sequenceB) (arg0 symbol)) (cond (arg0 (send-event *target* 'sidekick #f) (set! (-> this bonelurker) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *bonelurker-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *bonelurker-sg* #f :to this)) ) (send-event (handle->process (-> this bonelurker)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this bonelurker)) 'center-joint 3) @@ -1374,7 +1360,7 @@ ) ) -(defmethod get-art-elem sequenceB ((this sequenceB)) +(defmethod get-art-elem ((this sequenceB)) (-> this draw art-group data 3) ) @@ -1394,9 +1380,7 @@ (when (= (level-status *level* 'intro) 'active) (let ((gp-2 (entity-by-name "evilbro-2"))) (when gp-2 - (set! (-> self evilbro) - (ppointer->handle (manipy-spawn (-> self root-override trans) gp-2 *evilbro-sg* #f :to self)) - ) + (set! (-> self evilbro) (ppointer->handle (manipy-spawn (-> self root trans) gp-2 *evilbro-sg* #f :to self))) (let ((gp-3 (handle->process (-> self evilbro)))) (when gp-3 (set! (-> (the-as evilbro gp-3) draw light-index) (the-as uint 1)) @@ -1421,9 +1405,7 @@ ) (let ((gp-4 (entity-by-name "evilsis-2"))) (when gp-4 - (set! (-> self evilsis) - (ppointer->handle (manipy-spawn (-> self root-override trans) gp-4 *evilsis-sg* #f :to self)) - ) + (set! (-> self evilsis) (ppointer->handle (manipy-spawn (-> self root trans) gp-4 *evilsis-sg* #f :to self))) (let ((gp-5 (handle->process (-> self evilsis)))) (when gp-5 (set! (-> (the-as evilsis gp-5) draw light-index) (the-as uint 1)) @@ -1505,11 +1487,11 @@ ) ) -(defmethod should-display? sequenceB ((this sequenceB)) +(defmethod should-display? ((this sequenceB)) #f ) -(defmethod init-from-entity! sequenceB ((this sequenceB) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sequenceB) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sidekick-human-sg* 3 44 (new 'static 'vector :w 4096.0) -1) (set! (-> this tasks) (get-task-control (game-task intro))) (set! (-> this bonelurker) (the-as handle #f)) @@ -1555,18 +1537,18 @@ (none) ) -(defmethod play-anim! sequenceC ((this sequenceC) (arg0 symbol)) +(defmethod play-anim! ((this sequenceC) (arg0 symbol)) (when arg0 (set-setting! 'music-volume-movie 'abs 0.0 0) (set-setting! 'sfx-volume-movie 'abs 0.0 0) (set-setting! 'ambient-volume-movie 'abs 0.0 0) (set! (-> this bonelurker) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *bonelurker-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *bonelurker-sg* #f :to this)) ) (send-event (handle->process (-> this bonelurker)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this bonelurker)) 'center-joint 3) (set! (-> this darkecocan) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *darkecocan-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *darkecocan-sg* #f :to this)) ) (send-event (handle->process (-> this darkecocan)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this darkecocan)) 'center-joint 3) @@ -1648,7 +1630,7 @@ ) ) -(defmethod get-art-elem sequenceC ((this sequenceC)) +(defmethod get-art-elem ((this sequenceC)) (-> this draw art-group data 3) ) @@ -1686,7 +1668,7 @@ ) ) -(defmethod should-display? sequenceC ((this sequenceC)) +(defmethod should-display? ((this sequenceC)) #f ) @@ -1712,7 +1694,7 @@ (none) ) -(defmethod init-from-entity! sequenceC ((this sequenceC) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sequenceC) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sidekick-human-sg* 3 44 (new 'static 'vector :w 4096.0) -1) (set! (-> this tasks) (get-task-control (game-task intro))) (set! (-> this bonelurker) (the-as handle #f)) diff --git a/goal_src/jak1/levels/ogre/flying-lurker.gc b/goal_src/jak1/levels/ogre/flying-lurker.gc index 7d4775f135d..52cc63a3908 100644 --- a/goal_src/jak1/levels/ogre/flying-lurker.gc +++ b/goal_src/jak1/levels/ogre/flying-lurker.gc @@ -13,13 +13,9 @@ ) (deftype plunger-lurker (process-drawable) - ((alt-actor entity-actor :offset-assert 176) - (got-hit symbol :offset-assert 180) + ((alt-actor entity-actor) + (got-hit symbol) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states plunger-lurker-die plunger-lurker-flee @@ -250,7 +246,7 @@ ) ) -(defmethod init-from-entity! plunger-lurker ((this plunger-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this plunger-lurker) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -279,32 +275,28 @@ ) (deftype flying-lurker (process-drawable) - ((curve-position float :offset-assert 176) - (speed float :offset-assert 180) - (tangent vector :inline :offset-assert 192) - (anim-blend float :offset-assert 208) - (y-offset float :offset-assert 212) - (y-offset-desired float :offset-assert 216) - (y-vel float :offset-assert 220) - (last-look-time time-frame :offset-assert 224) - (time-to-next-look time-frame :offset-assert 232) - (take-off symbol :offset-assert 240) - (race-seconds float :offset-assert 244) - (race-start-time time-frame :offset-assert 248) - (rank int32 :offset-assert 256) - (alt-actor entity-actor :offset-assert 260) - (alt-trans vector :offset-assert 264) - (shadow-backup shadow-geo :offset-assert 268) - (try-count uint8 :offset-assert 272) - (try-counted symbol :offset-assert 276) - (default-bounds vector :inline :offset-assert 288) + ((curve-position float) + (speed float) + (tangent vector :inline) + (anim-blend float) + (y-offset float) + (y-offset-desired float) + (y-vel float) + (last-look-time time-frame) + (time-to-next-look time-frame) + (take-off symbol) + (race-seconds float) + (race-start-time time-frame) + (rank int32) + (alt-actor entity-actor) + (alt-trans vector) + (shadow-backup shadow-geo) + (try-count uint8) + (try-counted symbol) + (default-bounds vector :inline) ) - :heap-base #xc0 - :method-count-assert 21 - :size-assert #x130 - :flag-assert #x1500c00130 (:methods - (flying-lurker-method-20 (_type_) none 20) + (flying-lurker-method-20 (_type_) none) ) (:states (flying-lurker-clone handle string) @@ -327,7 +319,7 @@ :shadow flying-lurker-shadow-mg ) -(defmethod flying-lurker-method-20 flying-lurker ((this flying-lurker)) +(defmethod flying-lurker-method-20 ((this flying-lurker)) (with-pp (let ((s5-0 (-> this draw shadow-ctrl)) (s4-0 #f) @@ -1182,7 +1174,7 @@ :post ja-post ) -(defmethod init-from-entity! flying-lurker ((this flying-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this flying-lurker) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) diff --git a/goal_src/jak1/levels/ogre/ogre-obs.gc b/goal_src/jak1/levels/ogre/ogre-obs.gc index 1c501171e06..5272842b00f 100644 --- a/goal_src/jak1/levels/ogre/ogre-obs.gc +++ b/goal_src/jak1/levels/ogre/ogre-obs.gc @@ -293,15 +293,11 @@ ) (deftype tntbarrel (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 - (:methods - (idle () _type_ :state 20) - (die (symbol) _type_ :state 21) + (:state-methods + idle + (die symbol) ) ) @@ -310,7 +306,7 @@ :virtual #t :code (behavior ((arg0 symbol)) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (sound-play "dcrate-break") (if arg0 @@ -322,7 +318,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (process-spawn @@ -333,7 +329,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) ) @@ -367,7 +363,7 @@ ) ) -(defmethod init-from-entity! tntbarrel ((this tntbarrel) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tntbarrel) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind crate)) @@ -380,7 +376,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *tntbarrel-sg* '()) @@ -425,21 +421,17 @@ ) (deftype ogre-plat (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 736) - (idle-y-offset float :offset-assert 752) - (float-y-offset float :offset-assert 756) - (delay time-frame :offset-assert 760) - (active symbol :offset-assert 768) - (triggered entity-actor :offset-assert 772) + ((anchor-point vector :inline) + (idle-y-offset float) + (float-y-offset float) + (delay time-frame) + (active symbol) + (triggered entity-actor) ) - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) -(defmethod rigid-body-platform-method-23 ogre-plat ((this ogre-plat) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this ogre-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 @@ -519,7 +511,7 @@ :post rigid-body-platform-post ) -(defmethod rigid-body-platform-method-30 ogre-plat ((this ogre-plat)) +(defmethod rigid-body-platform-method-30 ((this ogre-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -544,7 +536,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 ogre-plat ((this ogre-plat)) +(defmethod rigid-body-platform-method-31 ((this ogre-plat)) (set! (-> this float-height-offset) (-> this idle-y-offset)) (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) @@ -595,14 +587,10 @@ (deftype ogre-step (ogre-plat) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) -(defmethod rigid-body-platform-method-31 ogre-step ((this ogre-step)) +(defmethod rigid-body-platform-method-31 ((this ogre-step)) (set! (-> this idle-y-offset) -28672.0) (set! (-> this float-y-offset) 0.0) (+! (-> this root-overlay trans y) (-> this idle-y-offset)) @@ -617,7 +605,7 @@ (none) ) -(defmethod rigid-body-platform-method-34 ogre-step ((this ogre-step)) +(defmethod rigid-body-platform-method-34 ((this ogre-step)) (if (-> this active) (go (method-of-object this rigid-body-platform-float)) (go (method-of-object this rigid-body-platform-idle)) @@ -628,41 +616,25 @@ (deftype ogre-step-a (ogre-step) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) (deftype ogre-step-b (ogre-step) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) (deftype ogre-step-c (ogre-step) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) (deftype ogre-step-d (ogre-step) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) -(defmethod rigid-body-platform-method-31 ogre-step-a ((this ogre-step-a)) +(defmethod rigid-body-platform-method-31 ((this ogre-step-a)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0) (initialize-skeleton this *ogre-step-a-sg* '()) (call-parent-method this) @@ -670,7 +642,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 ogre-step-b ((this ogre-step-b)) +(defmethod rigid-body-platform-method-31 ((this ogre-step-b)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0) (initialize-skeleton this *ogre-step-b-sg* '()) (call-parent-method this) @@ -678,7 +650,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 ogre-step-c ((this ogre-step-c)) +(defmethod rigid-body-platform-method-31 ((this ogre-step-c)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 26624.0) (initialize-skeleton this *ogre-step-c-sg* '()) (call-parent-method this) @@ -686,7 +658,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 ogre-step-d ((this ogre-step-d)) +(defmethod rigid-body-platform-method-31 ((this ogre-step-d)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0) (initialize-skeleton this *ogre-step-b-sg* '()) (call-parent-method this) @@ -723,14 +695,10 @@ (deftype ogre-isle (ogre-plat) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) -(defmethod rigid-body-platform-method-31 ogre-isle ((this ogre-isle)) +(defmethod rigid-body-platform-method-31 ((this ogre-isle)) (set! (-> this idle-y-offset) -6144.0) (set! (-> this float-y-offset) 4096.0) (rigid-body-platform-method-29 this *ogre-isle-constants*) @@ -742,32 +710,20 @@ (deftype ogre-isle-b (ogre-isle) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) (deftype ogre-isle-c (ogre-isle) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) (deftype ogre-isle-d (ogre-isle) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) -(defmethod rigid-body-platform-method-31 ogre-isle-b ((this ogre-isle-b)) +(defmethod rigid-body-platform-method-31 ((this ogre-isle-b)) (+! (-> this root-overlay trans x) -8192.0) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 8192.0 0.0 24576.0) (initialize-skeleton this *ogre-isle-b-sg* '()) @@ -776,7 +732,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 ogre-isle-c ((this ogre-isle-c)) +(defmethod rigid-body-platform-method-31 ((this ogre-isle-c)) (+! (-> this root-overlay trans x) -8192.0) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 8192.0 0.0 24576.0) (initialize-skeleton this *ogre-isle-b-sg* '()) @@ -785,7 +741,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 ogre-isle-d ((this ogre-isle-d)) +(defmethod rigid-body-platform-method-31 ((this ogre-isle-d)) (+! (-> this root-overlay trans x) -8192.0) (+! (-> this root-overlay trans z) -8192.0) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 8192.0 0.0 22528.0) @@ -802,14 +758,10 @@ ) (deftype ogre-bridge (process-drawable) - ((root-override collide-shape-moving :offset 112) - (joint-mod-array joint-mod 8 :offset-assert 176) - (dead-joint-count int8 :offset-assert 208) + ((root collide-shape-moving :override) + (joint-mod-array joint-mod 8) + (dead-joint-count int8) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd1 - :flag-assert #x14007000d1 (:states ogre-bridge-activate ogre-bridge-activated @@ -819,7 +771,7 @@ ) -(defmethod relocate ogre-bridge ((this ogre-bridge) (arg0 int)) +(defmethod relocate ((this ogre-bridge) (arg0 int)) (dotimes (v1-0 8) (if (nonzero? (-> this joint-mod-array v1-0)) (&+! (-> this joint-mod-array v1-0) arg0) @@ -847,9 +799,7 @@ (ogre-bridge-update-joints) ) :trans (behavior () - (if (and (and *target* - (>= 286720.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and (and *target* (>= 286720.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) (go ogre-bridge-activate) @@ -958,7 +908,7 @@ (define *ogre-bridge-joint-array* (new 'static 'boxed-array :type uint8 #x4 #x9 #xc #x11 #x7 #xa #xf #x12)) -(defmethod init-from-entity! ogre-bridge ((this ogre-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ogre-bridge) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -1131,7 +1081,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1162,12 +1112,8 @@ ) (deftype ogre-bridgeend (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states ogre-bridgeend-idle ) @@ -1181,7 +1127,7 @@ ) ) -(defmethod init-from-entity! ogre-bridgeend ((this ogre-bridgeend) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ogre-bridgeend) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object)) @@ -1194,7 +1140,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *ogre-bridgeend-sg* '()) @@ -1203,13 +1149,9 @@ ) (deftype ogre-lava (water-anim) - ((idle-anim int32 :offset-assert 220) - (anim int32 :offset-assert 224) + ((idle-anim int32) + (anim int32) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xe4 - :flag-assert #x1e008000e4 ) @@ -1282,7 +1224,7 @@ ) ) -(defmethod water-vol-method-22 ogre-lava ((this ogre-lava)) +(defmethod water-vol-method-22 ((this ogre-lava)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) @@ -1298,13 +1240,9 @@ ) (deftype shortcut-boulder (process-drawable) - ((root-override collide-shape :offset 112) - (broken-look lod-set :inline :offset-assert 176) + ((root collide-shape :override) + (broken-look lod-set :inline) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd1 - :flag-assert #x14007000d1 (:states shortcut-boulder-break shortcut-boulder-idle @@ -1411,7 +1349,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) @@ -1444,7 +1382,7 @@ ) ) -(defmethod init-from-entity! shortcut-boulder ((this shortcut-boulder) (arg0 entity-actor)) +(defmethod init-from-entity! ((this shortcut-boulder) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) @@ -1457,7 +1395,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *shortcut-boulder-whole-sg* '()) diff --git a/goal_src/jak1/levels/ogre/ogre-part.gc b/goal_src/jak1/levels/ogre/ogre-part.gc index a5a35013482..90b0431dc9d 100644 --- a/goal_src/jak1/levels/ogre/ogre-part.gc +++ b/goal_src/jak1/levels/ogre/ogre-part.gc @@ -648,8 +648,4 @@ (deftype ogre-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/ogre/ogreboss.gc b/goal_src/jak1/levels/ogre/ogreboss.gc index f41bd8aef0d..c1a8818a5d7 100644 --- a/goal_src/jak1/levels/ogre/ogreboss.gc +++ b/goal_src/jak1/levels/ogre/ogreboss.gc @@ -68,20 +68,16 @@ ) (deftype ogreboss-missile (process-drawable) - ((parent-override (pointer process-drawable) :offset 12) - (root-override collide-shape-moving :offset 112) - (trajectory trajectory :inline :offset-assert 176) - (src-pos vector :inline :offset-assert 224) - (dest-pos vector :inline :offset-assert 240) - (start-time time-frame :offset-assert 256) - (tumble-quat quaternion :inline :offset-assert 272) - (blast-radius float :offset-assert 288) - (pickup-type pickup-type :offset-assert 292) + ((root collide-shape-moving :override) + (parent-override (pointer process-drawable) :overlay-at parent) + (trajectory trajectory :inline) + (src-pos vector :inline) + (dest-pos vector :inline) + (start-time time-frame) + (tumble-quat quaternion :inline) + (blast-radius float) + (pickup-type pickup-type) ) - :heap-base #xc0 - :method-count-assert 20 - :size-assert #x128 - :flag-assert #x1400c00128 (:states ogreboss-missile-idle ogreboss-missile-impact @@ -103,13 +99,13 @@ (let ((f0-1 (the float (- (current-time) (-> self start-time))))) (eval-position! (-> self trajectory) f0-1 gp-0) ) - (vector-! s5-0 gp-0 (-> self root-override trans)) + (vector-! s5-0 gp-0 (-> self root trans)) (let ((f0-2 (fill-and-probe-using-line-sphere *collide-cache* - (-> self root-override trans) + (-> self root trans) s5-0 (the-as float 4096.0) - (-> self root-override root-prim collide-with) + (-> self root root-prim collide-with) (-> self parent-override 0) s4-0 (new 'static 'pat-surface :noentity #x1) @@ -118,17 +114,17 @@ ) (cond ((>= f0-2 0.0) - (vector+*! (-> self root-override trans) (-> self root-override trans) s5-0 f0-2) + (vector+*! (-> self root trans) (-> self root trans) s5-0 f0-2) (go ogreboss-missile-impact) ) (else - (set! (-> self root-override trans quad) (-> gp-0 quad)) + (set! (-> self root trans quad) (-> gp-0 quad)) 0 ) ) ) - (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) - (spawn (-> self part) (-> self root-override trans)) + (quaternion*! (-> self root quat) (-> self root quat) (-> self tumble-quat)) + (spawn (-> self part) (-> self root trans)) (suspend) ) ) @@ -151,13 +147,13 @@ (let ((f0-1 (the float (- (current-time) (-> self start-time))))) (eval-position! (-> self trajectory) f0-1 gp-0) ) - (vector-! s5-0 gp-0 (-> self root-override trans)) + (vector-! s5-0 gp-0 (-> self root trans)) (let ((f0-2 (fill-and-probe-using-line-sphere *collide-cache* - (-> self root-override trans) + (-> self root trans) s5-0 (the-as float 4096.0) - (-> self root-override root-prim collide-with) + (-> self root root-prim collide-with) (-> self parent-override 0) s4-0 (new 'static 'pat-surface :noentity #x1) @@ -166,23 +162,23 @@ ) (cond ((>= f0-2 0.0) - (vector+*! (-> self root-override trans) (-> self root-override trans) s5-0 f0-2) + (vector+*! (-> self root trans) (-> self root trans) s5-0 f0-2) (go ogreboss-missile-impact) ) (else - (set! (-> self root-override trans quad) (-> gp-0 quad)) + (set! (-> self root trans quad) (-> gp-0 quad)) 0 ) ) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (suspend) ) ) (cleanup-for-death self) ) :post (behavior () - (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) + (quaternion*! (-> self root quat) (-> self root quat) (-> self tumble-quat)) (transform-post) ) ) @@ -280,7 +276,7 @@ s4-1 s3-0 (the-as float 40.96) - (-> self root-override root-prim collide-with) + (-> self root root-prim collide-with) t1-0 t2-0 (new 'static 'pat-surface :noentity #x1) @@ -317,11 +313,11 @@ ) :code (behavior () (logclear! (-> self mask) (process-mask enemy projectile)) - (ogreboss-rock-explosion-effect (the-as basic (-> self root-override trans))) + (ogreboss-rock-explosion-effect (the-as basic (-> self root trans))) (when (nonzero? (-> self pickup-type)) (let ((t1-0 (new 'static 'fact-info :options (fact-options fade) :fade-time (seconds 5)))) (birth-pickup-at-point - (-> self root-override trans) + (-> self root trans) (-> self pickup-type) (-> *FACT-bank* eco-single-inc) #t @@ -331,20 +327,20 @@ ) ) (ja-channel-set! 0) - (let ((v1-10 (-> self root-override root-prim))) + (let ((v1-10 (-> self root root-prim))) (set! (-> v1-10 local-sphere w) (-> self blast-radius)) (set! (-> v1-10 prim-core world-sphere w) (-> self blast-radius)) (set! (-> v1-10 collide-with) (collide-kind cak-2 cak-3 target crate enemy wall-object ground-object)) (set! (-> v1-10 prim-core collide-as) (collide-kind enemy)) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (let ((a1-1 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-1 options) (the-as uint 0)) (set! (-> a1-1 tlist) *touching-list*) - (find-overlapping-shapes (-> self root-override) a1-1) + (find-overlapping-shapes (-> self root) a1-1) ) (suspend) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (while (-> self child) (suspend) ) @@ -354,16 +350,13 @@ ) (deftype ogreboss-missile-init-data (structure) - ((src vector :offset-assert 0) - (dest vector :offset-assert 4) - (duration time-frame :offset-assert 8) - (xz-speed float :offset-assert 16) - (blast-radius float :offset-assert 20) - (pickup-type pickup-type :offset-assert 24) + ((src vector) + (dest vector) + (duration time-frame) + (xz-speed float) + (blast-radius float) + (pickup-type pickup-type) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) @@ -386,13 +379,13 @@ (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) (set! (-> s5-0 event-self) 'touched) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) - (set! (-> self root-override trans quad) (-> arg0 src quad)) + (set! (-> self root trans quad) (-> arg0 src quad)) (set! (-> self src-pos quad) (-> arg0 src quad)) (set! (-> self dest-pos quad) (-> arg0 dest quad)) - (set! (-> self root-override quat vec quad) (-> self parent-override 0 root quat vec quad)) - (vector-identity! (-> self root-override scale)) + (set! (-> self root quat vec quad) (-> self parent-override 0 root quat vec quad)) + (vector-identity! (-> self root scale)) (initialize-skeleton self *ogreboss-shoot-boulder-sg* '()) (logior! (-> self mask) (process-mask enemy projectile)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -432,24 +425,20 @@ ) (deftype ogreboss-super-boulder (process-drawable) - ((parent-override (pointer process-drawable) :offset 12) - (root-override collide-shape-moving :offset 112) - (orig-pos vector :inline :offset-assert 176) - (src-pos vector :inline :offset-assert 192) - (spin-axis vector :inline :offset-assert 208) - (joint joint-mod-blend-local :offset-assert 224) - (speed float :offset-assert 228) - (size float :offset-assert 232) - (grow-rate float :offset-assert 236) - (lava entity-actor :offset-assert 240) - (sound-id sound-id :offset-assert 244) - (hit-boss symbol :offset-assert 248) - (tumble-quat quaternion :inline :offset-assert 256) + ((root collide-shape-moving :override) + (parent-override (pointer process-drawable) :overlay-at parent) + (orig-pos vector :inline) + (src-pos vector :inline) + (spin-axis vector :inline) + (joint joint-mod-blend-local) + (speed float) + (size float) + (grow-rate float) + (lava entity-actor) + (sound-id sound-id) + (hit-boss symbol) + (tumble-quat quaternion :inline) ) - :heap-base #xa0 - :method-count-assert 20 - :size-assert #x110 - :flag-assert #x1400a00110 (:states ogreboss-super-boulder-die ogreboss-super-boulder-hit @@ -468,7 +457,7 @@ (('touch 'attack) (when (and *target* ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) ) @@ -580,7 +569,7 @@ ) (defbehavior ogreboss-super-boulder-play-hit-anim ogreboss-super-boulder () - (set! (-> self src-pos quad) (-> self root-override trans quad)) + (set! (-> self src-pos quad) (-> self root trans quad)) (ja-no-eval :group! ogreboss-super-boulder-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (seconds-per-frame))) @@ -590,7 +579,7 @@ ) (f0-13 (fmax 0.0 (fmin 1.0 f1-1))) ) - (vector-lerp! (-> self root-override trans) (-> self src-pos) (-> self orig-pos) f0-13) + (vector-lerp! (-> self root trans) (-> self src-pos) (-> self orig-pos) f0-13) ) (suspend) (ja :num! (seek!)) @@ -602,7 +591,7 @@ :event ogreboss-super-boulder-event-handler :code (behavior () (set! (-> self hit-boss) #f) - (set! (-> self src-pos quad) (-> self root-override trans quad)) + (set! (-> self src-pos quad) (-> self root trans quad)) (ja-no-eval :group! ogreboss-super-boulder-throw-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (seconds-per-frame))) @@ -612,7 +601,7 @@ ) (f0-13 (fmax 0.0 (fmin 1.0 f1-1))) ) - (vector-lerp! (-> self root-override trans) (-> self src-pos) (-> self orig-pos) f0-13) + (vector-lerp! (-> self root trans) (-> self src-pos) (-> self orig-pos) f0-13) ) 0 (suspend) @@ -651,7 +640,7 @@ (defstate ogreboss-super-boulder-land (ogreboss-super-boulder) :event ogreboss-super-boulder-event-handler :code (behavior () - (set! (-> self root-override trans quad) (-> self orig-pos quad)) + (set! (-> self root trans quad) (-> self orig-pos quad)) (ogreboss-super-boulder-impact-effect) (set! (-> self joint enable) #f) (ja-no-eval :group! ogreboss-super-boulder-roll-ja @@ -659,9 +648,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (when (< 81920.0 - (vector-vector-distance (the-as vector (-> self root-override root-prim prim-core)) (target-pos 0)) - ) + (when (< 81920.0 (vector-vector-distance (the-as vector (-> self root root-prim prim-core)) (target-pos 0))) (ja-channel-push! 1 (seconds 0.1)) (go ogreboss-super-boulder-roll) ) @@ -688,7 +675,7 @@ (suspend) (ja :num! (seek! (ja-aframe (the-as float 162.0) 0))) ) - (set! (-> self root-override root-prim local-sphere w) 28672.0) + (set! (-> self root root-prim local-sphere w) 28672.0) (cond ((-> self hit-boss) (while (let ((gp-2 (new 'stack-no-clear 'event-message-block))) @@ -747,7 +734,7 @@ ) ) -(defmethod relocate ogreboss-super-boulder ((this ogreboss-super-boulder) (arg0 int)) +(defmethod relocate ((this ogreboss-super-boulder) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -756,7 +743,7 @@ (defstate ogreboss-super-boulder-killed-player (ogreboss-super-boulder) :code (behavior () - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (loop (suspend) @@ -783,12 +770,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> self root-override) s4-0) + (set! (-> self root) s4-0) ) (set! (-> self orig-pos quad) (-> arg0 quad)) - (set! (-> self root-override trans quad) (-> self parent-override 0 root trans quad)) - (set! (-> self root-override quat vec quad) (-> self parent-override 0 root quat vec quad)) - (vector-identity! (-> self root-override scale)) + (set! (-> self root trans quad) (-> self parent-override 0 root trans quad)) + (set! (-> self root quat vec quad) (-> self parent-override 0 root quat vec quad)) + (vector-identity! (-> self root scale)) (initialize-skeleton self *ogreboss-super-boulder-sg* '()) ;; og:preserve-this PAL patch here (logclear! (-> self mask) (process-mask actor-pause enemy)) @@ -816,18 +803,14 @@ ) (deftype ogreboss-bounce-boulder (process-drawable) - ((parent-override (pointer ogreboss-super-boulder) :offset 12) - (root-override collide-shape-moving :offset 112) - (src-pos vector :inline :offset-assert 176) - (side-dir vector :inline :offset-assert 192) - (side-pos float :offset-assert 208) - (dest-pos float :offset-assert 212) - (boulder-type int8 :offset-assert 216) + ((root collide-shape-moving :override) + (parent-override (pointer ogreboss-super-boulder) :overlay-at parent) + (src-pos vector :inline) + (side-dir vector :inline) + (side-pos float) + (dest-pos float) + (boulder-type int8) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd9 - :flag-assert #x14007000d9 (:states ogreboss-bounce-boulder-idle ) @@ -839,7 +822,7 @@ (('touch) (if (and *target* ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) ) @@ -880,10 +863,10 @@ (cleanup-for-death self) ) :post (behavior () - (vector+*! (-> self root-override trans) (-> self src-pos) (-> self side-dir) (-> self side-pos)) + (vector+*! (-> self root trans) (-> self src-pos) (-> self side-dir) (-> self side-pos)) (transform-post) (find-ground-and-draw-shadow - (the-as vector (-> self root-override root-prim prim-core)) + (the-as vector (-> self root root-prim prim-core)) (the-as vector #f) (the-as float 49152.0) (collide-kind background) @@ -913,13 +896,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) (set! (-> self boulder-type) arg0) - (set! (-> self root-override trans quad) (-> self parent-override 0 root-override trans quad)) - (set! (-> self root-override quat vec quad) (-> self parent-override 0 root-override quat vec quad)) - (vector-identity! (-> self root-override scale)) - (set! (-> self src-pos quad) (-> self root-override trans quad)) + (set! (-> self root trans quad) (-> self parent-override 0 root trans quad)) + (set! (-> self root quat vec quad) (-> self parent-override 0 root quat vec quad)) + (vector-identity! (-> self root scale)) + (set! (-> self src-pos quad) (-> self root trans quad)) (set! (-> self side-pos) 0.0) (set! (-> self dest-pos) (the-as float (cond ((zero? arg0) @@ -937,7 +920,7 @@ ) ) ) - (vector-x-quaternion! (-> self side-dir) (-> self root-override quat)) + (vector-x-quaternion! (-> self side-dir) (-> self root quat)) (initialize-skeleton self *ogreboss-bounce-boulder-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self draw origin-joint-index) (the-as uint 3)) @@ -947,40 +930,36 @@ ) (deftype ogreboss (process-drawable) - ((root-override collide-shape :offset 112) - (old-player-transform transformq :inline :offset-assert 176) - (level float :offset-assert 224) - (difficulty float :offset-assert 228) - (boulder handle :offset-assert 232) - (column handle :offset-assert 240) - (z-plane vector :inline :offset-assert 256) - (far-pos vector :inline :offset-assert 272) - (near-pos vector :inline :offset-assert 288) - (side-dir vector :inline :offset-assert 304) - (target-offset-array vector 3 :inline :offset-assert 320) - (target-offset-array-2 vector :inline :offset 336) - (target-offset-array-3 vector :inline :offset 352) - (target-actor-array entity-actor 3 :offset-assert 368) - (target-blast-radius-array float 3 :offset-assert 380) - (shuffle-pos float :offset-assert 392) - (target-count int8 :offset-assert 396) - (hit-count int8 :offset-assert 397) - (max-hit-count int8 :offset-assert 398) - (roll-boulder int8 :offset-assert 399) - (try-count uint8 :offset-assert 400) - (hit-time time-frame :offset-assert 408) - (grow-time float :offset-assert 416) - (lava entity-actor :offset-assert 420) - (vulnerable symbol :offset-assert 424) - (bridge-assembled symbol :offset-assert 428) - (at-near-spot symbol :offset-assert 432) - (submerged symbol :offset-assert 436) - (try-counted symbol :offset-assert 440) + ((root collide-shape :override) + (old-player-transform transformq :inline) + (level float) + (difficulty float) + (boulder handle) + (column handle) + (z-plane vector :inline) + (far-pos vector :inline) + (near-pos vector :inline) + (side-dir vector :inline) + (target-offset-array vector 3 :inline) + (target-offset-array-2 vector :inline :overlay-at (-> target-offset-array 1)) + (target-offset-array-3 vector :inline :overlay-at (-> target-offset-array 2)) + (target-actor-array entity-actor 3) + (target-blast-radius-array float 3) + (shuffle-pos float) + (target-count int8) + (hit-count int8) + (max-hit-count int8) + (roll-boulder int8) + (try-count uint8) + (hit-time time-frame) + (grow-time float) + (lava entity-actor) + (vulnerable symbol) + (bridge-assembled symbol) + (at-near-spot symbol) + (submerged symbol) + (try-counted symbol) ) - :heap-base #x150 - :method-count-assert 20 - :size-assert #x1bc - :flag-assert #x14015001bc (:states ogreboss-dead ogreboss-die @@ -1089,7 +1068,7 @@ (defstate ogreboss-idle (ogreboss) :enter (behavior () (when (zero? (-> self try-count)) - (let ((gp-0 (manipy-spawn (-> self root-override trans) (-> self entity) *ogreboss-column-sg* #f :to self))) + (let ((gp-0 (manipy-spawn (-> self root trans) (-> self entity) *ogreboss-column-sg* #f :to self))) (set! (-> self column) (ppointer->handle gp-0)) (send-event (ppointer->process gp-0) 'anim-mode 'loop) (send-event (ppointer->process gp-0) 'art-joint-anim "ogreboss-column-idle" 0) @@ -1129,7 +1108,7 @@ (run-now-in-process gp-0 pov-camera-init-by-other - (-> self root-override trans) + (-> self root trans) *ogreboss-cam-sg* "ogreboss-cam-intro" 0 @@ -1235,7 +1214,7 @@ ) (if a1-0 (set! (-> s5-0 quad) (-> (the-as process-drawable a1-0) root trans quad)) - (set! (-> s5-0 quad) (-> self root-override trans quad)) + (set! (-> s5-0 quad) (-> self root trans quad)) ) ) (vector+! s5-0 s5-0 (-> self target-offset-array v1-10)) @@ -1243,12 +1222,12 @@ ) ) (else - (vector+*! s5-0 (-> self root-override trans) *z-vector* (the-as float 409600.0)) + (vector+*! s5-0 (-> self root trans) *z-vector* (the-as float 409600.0)) ) ) (set! (-> gp-0 dest) s5-0) ) - (sound-play "ogre-fires" :position (the-as symbol (-> self root-override trans))) + (sound-play "ogre-fires" :position (the-as symbol (-> self root trans))) (process-spawn part-tracker :init part-tracker-init @@ -1391,7 +1370,7 @@ (when (not (-> self at-near-spot)) (ogreboss-submerge arg0 arg1) (set! (-> self at-near-spot) #t) - (set! (-> self root-override trans quad) (-> self near-pos quad)) + (set! (-> self root trans quad) (-> self near-pos quad)) (ogreboss-emerge arg1) ) 0 @@ -1402,7 +1381,7 @@ (when (-> self at-near-spot) (ogreboss-submerge arg0 arg1) (set! (-> self at-near-spot) #f) - (set! (-> self root-override trans quad) (-> self far-pos quad)) + (set! (-> self root trans quad) (-> self far-pos quad)) (ogreboss-emerge arg1) ) 0 @@ -1474,10 +1453,10 @@ (let ((boulder-pickup (pickup-type none))) (let ((f28-0 0.0)) (cond - ((>= 1.0 (-> *target* fact-info-target health)) + ((>= 1.0 (-> *target* fact health)) (set! f28-0 0.1) ) - ((>= 2.0 (-> *target* fact-info-target health)) + ((>= 2.0 (-> *target* fact health)) (set! f28-0 0.05) ) ) @@ -1527,7 +1506,7 @@ ) (defbehavior ogreboss-roll-boulder ogreboss () - (sound-play "ogre-fires" :position (the-as symbol (-> self root-override trans))) + (sound-play "ogre-fires" :position (the-as symbol (-> self root trans))) (+! (-> self roll-boulder) (rand-vu-int-range 1 2)) (if (>= (-> self roll-boulder) 3) (+! (-> self roll-boulder) -3) @@ -1582,7 +1561,7 @@ (defbehavior ogreboss-update-super-boulder ogreboss () (let ((a1-0 (handle->process (-> self boulder)))) (if a1-0 - (set! (-> (the-as ogreboss-super-boulder a1-0) root-override trans quad) (-> self root-override trans quad)) + (set! (-> (the-as ogreboss-super-boulder a1-0) root trans quad) (-> self root trans quad)) ) ) 0 @@ -1602,7 +1581,7 @@ (when (-> self vulnerable) (if ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 128) ) (ja :chan 1 :group! ogreboss-hit-crotch-ja :num! min :frame-interp 0.0) @@ -1612,13 +1591,13 @@ (let ((v1-17 (rand-vu-int-range 0 2))) (cond ((zero? v1-17) - (sound-play "ogre-grunt1" :position (the-as symbol (-> self root-override trans))) + (sound-play "ogre-grunt1" :position (the-as symbol (-> self root trans))) ) ((= v1-17 1) - (sound-play "ogre-grunt2" :position (the-as symbol (-> self root-override trans))) + (sound-play "ogre-grunt2" :position (the-as symbol (-> self root trans))) ) (else - (sound-play "ogre-grunt3" :position (the-as symbol (-> self root-override trans))) + (sound-play "ogre-grunt3" :position (the-as symbol (-> self root trans))) ) ) ) @@ -1807,7 +1786,7 @@ ) ) :post (behavior () - (vector+*! (-> self root-override trans) (-> self far-pos) (-> self side-dir) (-> self shuffle-pos)) + (vector+*! (-> self root trans) (-> self far-pos) (-> self side-dir) (-> self shuffle-pos)) (ogreboss-post) ) ) @@ -1924,7 +1903,7 @@ ) (process-entity-status! self (entity-perm-status complete) #t) (close-specific-task! (game-task ogre-boss) (task-status need-reminder)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-channel-set! 0) (ja-post) (when (not (task-complete? *game-info* (-> self entity extra perm task))) @@ -1974,7 +1953,7 @@ (none) ) -(defmethod init-from-entity! ogreboss ((this ogreboss) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ogreboss) (arg0 entity-actor)) (logior! (-> this mask) (process-mask attackable)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 6) 0))) @@ -2040,7 +2019,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -2068,17 +2047,17 @@ (set! (-> this vulnerable) #f) (set! (-> this bridge-assembled) #f) (set! (-> this submerged) #f) - (vector-z-quaternion! (-> this z-plane) (-> this root-override quat)) - (set! (-> this z-plane w) (- (vector-dot (-> this z-plane) (-> this root-override trans)))) - (vector-x-quaternion! (-> this side-dir) (-> this root-override quat)) - (set! (-> this far-pos quad) (-> this root-override trans quad)) + (vector-z-quaternion! (-> this z-plane) (-> this root quat)) + (set! (-> this z-plane w) (- (vector-dot (-> this z-plane) (-> this root trans)))) + (vector-x-quaternion! (-> this side-dir) (-> this root quat)) + (set! (-> this far-pos quad) (-> this root trans quad)) (let ((f0-38 1.0)) - (set-vector! (-> this root-override scale) f0-38 f0-38 f0-38 1.0) + (set-vector! (-> this root scale) f0-38 f0-38 f0-38 1.0) ) (vector+*! (-> this near-pos) (-> this far-pos) (-> this z-plane) (the-as float 348160.0)) (set! (-> this at-near-spot) #t) (set! (-> this try-counted) #f) - (set! (-> this root-override trans quad) (-> this near-pos quad)) + (set! (-> this root trans quad) (-> this near-pos quad)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go ogreboss-dead) (go ogreboss-idle) diff --git a/goal_src/jak1/levels/racer_common/racer-part.gc b/goal_src/jak1/levels/racer_common/racer-part.gc index 3c4c31929a3..7b0eab9cc5f 100644 --- a/goal_src/jak1/levels/racer_common/racer-part.gc +++ b/goal_src/jak1/levels/racer_common/racer-part.gc @@ -314,14 +314,10 @@ (deftype hud-bike-heat (hud) () - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x118 - :flag-assert #x1b00b00118 ) -(defmethod hud-update hud-bike-heat ((this hud-bike-heat)) +(defmethod hud-update ((this hud-bike-heat)) (if *target* (tally-value this (the int (-> *target* racer heat)) 0) ) @@ -329,7 +325,7 @@ (none) ) -(defmethod init-particles! hud-bike-heat ((this hud-bike-heat) (arg0 int)) +(defmethod init-particles! ((this hud-bike-heat) (arg0 int)) (add-setting! 'common-page 'set 0.0 2) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) @@ -389,14 +385,10 @@ (deftype hud-bike-speed (hud) () - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x118 - :flag-assert #x1b00b00118 ) -(defmethod hud-update hud-bike-speed ((this hud-bike-speed)) +(defmethod hud-update ((this hud-bike-speed)) (if *target* (tally-value this (the int (-> *target* control unknown-float01)) 0) ) @@ -404,7 +396,7 @@ (none) ) -(defmethod init-particles! hud-bike-speed ((this hud-bike-speed) (arg0 int)) +(defmethod init-particles! ((this hud-bike-speed) (arg0 int)) (add-setting! 'common-page 'set 0.0 2) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) @@ -453,7 +445,7 @@ (#when PC_PORT ;; og:preserve-this extra methods needed for aspect ratio in pc port -(defmethod set-pos-and-scale hud-bike-heat ((this hud-bike-heat) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-bike-heat) (arg0 symbol) (arg1 symbol)) (with-pc (let ((base-x (-> this particles 0 init-pos x))) (*! base-x (-> *pc-settings* aspect-ratio-reciprocal)) @@ -473,7 +465,7 @@ (none) ) -(defmethod set-pos-and-scale hud-bike-speed ((this hud-bike-speed) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-bike-speed) (arg0 symbol) (arg1 symbol)) (with-pc (let ((base-x (-> this particles 1 init-pos x))) (+! base-x (* (- 512.0 base-x) (- 1.0 (-> *pc-settings* aspect-ratio-reciprocal)))) diff --git a/goal_src/jak1/levels/racer_common/racer-states.gc b/goal_src/jak1/levels/racer_common/racer-states.gc index 99c2be412ac..ebfe8494ccf 100644 --- a/goal_src/jak1/levels/racer_common/racer-states.gc +++ b/goal_src/jak1/levels/racer_common/racer-states.gc @@ -755,11 +755,11 @@ (combine! (-> self attack-info) arg1) (case (-> self attack-info mode) (('endlessfall 'death 'explode 'water-vol 'heat 'melt 'instant-death) - (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) -1000.0 (the-as handle #f)) + (pickup-collectable! (-> self fact) (pickup-type eco-green) -1000.0 (the-as handle #f)) ) (else (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) @@ -787,7 +787,7 @@ (set! (-> self racer boost-target) 0.0) (set! (-> self racer boost-output) 0.0) (set! (-> self racer boost-time) 0) - (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) (go target-racing-death (-> self attack-info mode)) ) (case (-> self attack-info mode) @@ -1061,11 +1061,11 @@ ) ) (when s4-1 - (set! (-> s5-0 quad) (-> s4-1 root-override trans quad)) - (quaternion-copy! (-> self control unknown-quaternion03) (-> s4-1 root-override quat)) + (set! (-> s5-0 quad) (-> s4-1 root trans quad)) + (quaternion-copy! (-> self control unknown-quaternion03) (-> s4-1 root quat)) (send-event s4-1 'trans (-> self racer bike-trans)) - (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> s4-1 root-override quat)) - (set! (-> self racer bike-scale quad) (-> s4-1 root-override scale quad)) + (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> s4-1 root quat)) + (set! (-> self racer bike-scale quad) (-> s4-1 root scale quad)) (set! (-> self control unknown-int21) (the-as int (-> self racer bike-trans y))) ) ) @@ -1223,12 +1223,12 @@ ) ) (when s3-0 - (set! (-> s4-1 quad) (-> s3-0 root-override trans quad)) - (set-yaw-angle-clear-roll-pitch! (-> s3-0 root-override) (quaternion-y-angle (-> self control quat))) - (quaternion-copy! (-> self control unknown-quaternion03) (-> s3-0 root-override quat)) + (set! (-> s4-1 quad) (-> s3-0 root trans quad)) + (set-yaw-angle-clear-roll-pitch! (-> s3-0 root) (quaternion-y-angle (-> self control quat))) + (quaternion-copy! (-> self control unknown-quaternion03) (-> s3-0 root quat)) (send-event s3-0 'trans (-> self racer bike-trans)) - (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> s3-0 root-override quat)) - (set! (-> self racer bike-scale quad) (-> s3-0 root-override scale quad)) + (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> s3-0 root quat)) + (set! (-> self racer bike-scale quad) (-> s3-0 root scale quad)) (set! (-> self control unknown-int21) (the-as int (-> self racer bike-trans y))) ) ) diff --git a/goal_src/jak1/levels/racer_common/racer.gc b/goal_src/jak1/levels/racer_common/racer.gc index abc6c812484..6e01019f379 100644 --- a/goal_src/jak1/levels/racer_common/racer.gc +++ b/goal_src/jak1/levels/racer_common/racer.gc @@ -15,31 +15,27 @@ ) (deftype racer (process-drawable) - ((parent-override (pointer target) :offset 12) - (root-override collide-shape-moving :offset 112) - (extra-trans vector :inline :offset-assert 176) - (condition int32 :offset-assert 192) - (cell handle :offset-assert 200) - (path-data path-control 2 :offset-assert 208) - (path-target curve-control :offset 208) - (path-racer path-control :offset 212) - (auto-get-off symbol :offset-assert 216) - (shadow-backup shadow-geo :offset-assert 220) + ((root collide-shape-moving :override) + (parent-override (pointer target) :overlay-at parent) + (extra-trans vector :inline) + (condition int32) + (cell handle) + (path-data path-control 2) + (path-target curve-control :overlay-at (-> path-data 0)) + (path-racer path-control :overlay-at (-> path-data 1)) + (auto-get-off symbol) + (shadow-backup shadow-geo) ) - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe0 - :flag-assert #x18007000e0 - (:methods - (wait-for-start () _type_ :state 20) - (idle () _type_ :state 21) - (pickup ((state collectable)) _type_ :state 22) - (wait-for-return () _type_ :state 23) + (:state-methods + wait-for-start + idle + (pickup (state collectable)) + wait-for-return ) ) -(defmethod relocate racer ((this racer) (arg0 int)) +(defmethod relocate ((this racer) (arg0 int)) (countdown (v1-0 2) (if (-> this path-data v1-0) (&+! (-> this path-data v1-0) arg0) @@ -72,7 +68,7 @@ (defbehavior racer-effect racer () (when (!= (-> self condition) 4) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (update! (-> self sound)) ) 0 @@ -85,7 +81,7 @@ (local-vars (v0-1 structure)) (case message (('trans) - (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) (('notify) (set! v0-1 #t) @@ -108,8 +104,8 @@ ) ) :exit (behavior () - (set! (-> self root-override root-prim prim-core action) (collide-action)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) + (set! (-> self root root-prim prim-core action) (collide-action)) + (set! (-> self root root-prim prim-core offense) (collide-offense no-offense)) 0 ) :code (behavior () @@ -125,8 +121,8 @@ (((task-status need-reward-speech)) (ja-channel-set! 1) (ja :group! racer-racer-idle-ja) - (set! (-> self root-override root-prim prim-core action) (collide-action solid attackable-unused)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> self root root-prim prim-core action) (collide-action solid attackable-unused)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) (ja-post) ) (((task-status invalid)) @@ -167,7 +163,7 @@ (set! (-> self cell) (ppointer->handle (birth-pickup-at-point - (vector+! (new 'stack-no-clear 'vector) (-> self root-override trans) (new 'static 'vector :y 8192.0 :w 1.0)) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 8192.0 :w 1.0)) (pickup-type fuel-cell) (the float (-> self entity extra perm task)) #f @@ -210,8 +206,8 @@ :code (behavior () (ja-channel-set! 1) (ja :group! racer-racer-idle-ja) - (set! (-> self root-override root-prim prim-core action) (collide-action solid attackable-unused)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> self root root-prim prim-core action) (collide-action solid attackable-unused)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) 0.0 (let ((f30-0 (if (= (-> self condition) 4) 61440.0 @@ -223,7 +219,7 @@ (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) (go-virtual wait-for-return) ) - (when (and (and *target* (>= f30-0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and (and *target* (>= f30-0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (and (not (movie?)) (not (level-hint-displayed?))) ) (hide-hud) @@ -263,12 +259,12 @@ (('draw) (ja-channel-set! 1) (ja :group! racer-racer-idle-ja) - (set! (-> self root-override root-prim prim-core action) (collide-action solid attackable-unused)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> self root root-prim prim-core action) (collide-action solid attackable-unused)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) (transform-post) ) (('trans) - (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) (('touch 'attack) #f @@ -296,9 +292,7 @@ (ja-channel-set! 0) (ja-post) (while (zero? (ja-group-size)) - (when (or (not *target*) - (< 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (when (or (not *target*) (< 24576.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (when (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) (case (-> (level-get-target-inside *level*) name) (('misty) @@ -336,7 +330,7 @@ ) (cond ((= message 'trans) - (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) ((= message 'shadow) (cond @@ -371,7 +365,7 @@ ) ) -(defmethod init-from-entity! racer ((this racer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this racer) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -386,16 +380,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (set-yaw-angle-clear-roll-pitch! (-> this root-override) (res-lump-float arg0 'rotoffset)) + (set-yaw-angle-clear-roll-pitch! (-> this root) (res-lump-float arg0 'rotoffset)) (initialize-skeleton this *racer-sg* '()) (set! (-> this shadow-backup) (-> this draw shadow)) (set! (-> this draw shadow-ctrl) *racer-shadow-control*) (let ((v1-23 (-> this node-list data))) (set! (-> v1-23 0 param0) cspace<-transformq+trans!) - (set! (-> v1-23 0 param1) (the-as basic (-> this root-override trans))) + (set! (-> v1-23 0 param1) (the-as basic (-> this root trans))) (set! (-> v1-23 0 param2) (the-as basic (-> this extra-trans))) ) (set! (-> this condition) (res-lump-value arg0 'index int)) @@ -414,7 +408,7 @@ (set! (-> this path) (-> this path-target)) (set-vector! (-> this extra-trans) 0.0 6144.0 0.0 1.0) (set! (-> this auto-get-off) #f) - (move-to-ground (-> this root-override) 40960.0 40960.0 #t (collide-kind background)) + (move-to-ground (-> this root) 40960.0 40960.0 #t (collide-kind background)) (set! (-> this cell) (the-as handle #f)) (blocking-plane-spawn (the-as @@ -428,7 +422,7 @@ ) ) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> this root trans)) ) (go (method-of-object this wait-for-start)) (none) diff --git a/goal_src/jak1/levels/racer_common/target-racer-h.gc b/goal_src/jak1/levels/racer_common/target-racer-h.gc index 155cb7e6c51..c469d009ed1 100644 --- a/goal_src/jak1/levels/racer_common/target-racer-h.gc +++ b/goal_src/jak1/levels/racer_common/target-racer-h.gc @@ -18,123 +18,117 @@ ;; DECOMP BEGINS (deftype racer-info (basic) - ((entity entity-actor :offset-assert 4) - (bike-trans vector :inline :offset-assert 16) - (bike-quat vector :inline :offset-assert 32) - (bike-scale vector :inline :offset-assert 48) - (mod-x float :offset-assert 64) - (rot vector :inline :offset-assert 80) - (rot-old vector :inline :offset-assert 96) - (rotv vector :inline :offset-assert 112) - (lean-rotx degrees :offset-assert 128) - (change-roty degrees :offset-assert 132) - (change-roty-old degrees :offset-assert 136) - (quat vector :inline :offset-assert 144) - (surface-y meters :offset-assert 160) - (surface-vy meters :offset-assert 164) - (surface-quat vector :inline :offset-assert 176) - (surface-quat-smooth vector :inline :offset-assert 192) - (cushion-base meters :offset-assert 208) - (cushion-offset meters :offset-assert 212) - (cushion-bob meters :offset-assert 216) - (cushion-bob-old meters :offset-assert 220) - (cushion-smush smush-control :inline :offset-assert 224) - (shock-offset meters :offset-assert 256) - (shock-offsetv meters :offset-assert 260) - (shock-rotx meters :offset-assert 264) - (hill-value float :offset-assert 268) - (hill-ground-value float :offset-assert 272) - (hill-offset meters :offset-assert 276) - (hill-rotx degrees :offset-assert 280) - (hill-boost meters :offset-assert 284) - (bob-timer float :offset-assert 288) - (bob-meta-timer float :offset-assert 292) - (bob-meta-meta-timer float :offset-assert 296) - (bob-mult-rot float :offset-assert 300) - (bob-mult-trans float :offset-assert 304) - (bob-period float :offset-assert 308) - (bob-meta-time time-frame :offset-assert 312) - (bob-hit-ground-time time-frame :offset-assert 320) - (cur-rotx degrees :offset-assert 328) - (targ-rotx degrees :offset-assert 332) - (speed-rotx float :offset-assert 336) - (mult-rotx degrees :offset-assert 340) - (front-blade joint-mod :offset-assert 344) - (front-rot degrees :offset-assert 348) - (front-rotv degrees :offset-assert 352) - (bottom-blade joint-mod :offset-assert 356) - (bottom-rot degrees :offset-assert 360) - (front joint-mod :offset-assert 364) - (front-turn degrees :offset-assert 368) - (tail joint-mod :offset-assert 372) - (tail-tilt degrees :offset-assert 376) - (transv-max meters :offset-assert 380) - (slide-down-time time-frame 2 :offset-assert 384) - (slide-enter-time time-frame :offset-assert 400) - (slide-mode int32 :offset-assert 408) - (slide-amp float :offset-assert 412) - (slide-grip-mult float :offset-assert 416) - (slide-shift-x float :offset-assert 420) - (slide-interp float :offset-assert 424) - (heat float :offset-assert 428) - (boost-time time-frame :offset-assert 432) - (boost-duration time-frame :offset-assert 440) - (boost-curve float :offset-assert 448) - (boost-level float :offset-assert 452) - (boost-target float :offset-assert 456) - (boost-output float :offset-assert 460) - (hop? symbol :offset-assert 464) - (hop-start-y float :offset-assert 468) - (bounce int32 :offset-assert 472) - (bounce-hit float :offset-assert 476) - (engine-sound-id sound-id :offset-assert 480) - (boost-sound-id sound-id :offset-assert 484) - (engine-sound-pitch float :offset-assert 488) - (turn-anim-targ float :offset-assert 492) - (turn-anim-frame float :offset-assert 496) - (turn-anim-vel float :offset-assert 500) - (tail-anim-vel float :offset-assert 504) - (tail-anim-frame float :offset-assert 508) - (rudd-anim-vel float :offset-assert 512) - (rudd-anim-frame float :offset-assert 516) - (racing-time time-frame :offset-assert 520) - (stick-lock symbol :offset-assert 528) - (stick-off symbol :offset-assert 532) - (heavy symbol :offset-assert 536) - (unstuck-time time-frame :offset-assert 544) - (stuck-count int32 :offset-assert 552) - (scrape-sound-id sound-id :offset-assert 556) - (heat-sound-time time-frame :offset-assert 560) + ((entity entity-actor) + (bike-trans vector :inline) + (bike-quat vector :inline) + (bike-scale vector :inline) + (mod-x float) + (rot vector :inline) + (rot-old vector :inline) + (rotv vector :inline) + (lean-rotx degrees) + (change-roty degrees) + (change-roty-old degrees) + (quat vector :inline) + (surface-y meters) + (surface-vy meters) + (surface-quat vector :inline) + (surface-quat-smooth vector :inline) + (cushion-base meters) + (cushion-offset meters) + (cushion-bob meters) + (cushion-bob-old meters) + (cushion-smush smush-control :inline) + (shock-offset meters) + (shock-offsetv meters) + (shock-rotx meters) + (hill-value float) + (hill-ground-value float) + (hill-offset meters) + (hill-rotx degrees) + (hill-boost meters) + (bob-timer float) + (bob-meta-timer float) + (bob-meta-meta-timer float) + (bob-mult-rot float) + (bob-mult-trans float) + (bob-period float) + (bob-meta-time time-frame) + (bob-hit-ground-time time-frame) + (cur-rotx degrees) + (targ-rotx degrees) + (speed-rotx float) + (mult-rotx degrees) + (front-blade joint-mod) + (front-rot degrees) + (front-rotv degrees) + (bottom-blade joint-mod) + (bottom-rot degrees) + (front joint-mod) + (front-turn degrees) + (tail joint-mod) + (tail-tilt degrees) + (transv-max meters) + (slide-down-time time-frame 2) + (slide-enter-time time-frame) + (slide-mode int32) + (slide-amp float) + (slide-grip-mult float) + (slide-shift-x float) + (slide-interp float) + (heat float) + (boost-time time-frame) + (boost-duration time-frame) + (boost-curve float) + (boost-level float) + (boost-target float) + (boost-output float) + (hop? symbol) + (hop-start-y float) + (bounce int32) + (bounce-hit float) + (engine-sound-id sound-id) + (boost-sound-id sound-id) + (engine-sound-pitch float) + (turn-anim-targ float) + (turn-anim-frame float) + (turn-anim-vel float) + (tail-anim-vel float) + (tail-anim-frame float) + (rudd-anim-vel float) + (rudd-anim-frame float) + (racing-time time-frame) + (stick-lock symbol) + (stick-off symbol) + (heavy symbol) + (unstuck-time time-frame) + (stuck-count int32) + (scrape-sound-id sound-id) + (heat-sound-time time-frame) ) - :method-count-assert 9 - :size-assert #x238 - :flag-assert #x900000238 ) (deftype racer-bank (basic) - ((slide-hold-time seconds :offset-assert 8) - (heat-max float :offset-assert 16) - (hotcoals-heat-inc float :offset-assert 20) - (lava-heat-inc float :offset-assert 24) - (lava-air-heat-inc float :offset-assert 28) - (surface-heat-inc float :offset-assert 32) - (jump-heat-inc float :offset-assert 36) - (lavatube-hotcoals-heat-inc float :offset-assert 40) - (lavatube-lava-heat-inc float :offset-assert 44) - (lavatube-lava-air-heat-inc float :offset-assert 48) - (lavatube-surface-heat-inc float :offset-assert 52) - (lavatube-jump-heat-inc float :offset-assert 56) - (boost-curve-max meters :offset-assert 60) - (boost-level-max meters :offset-assert 64) - (boost-level-inc meters :offset-assert 68) - (boost-duration seconds :offset-assert 72) - (default-front-blade degrees :offset-assert 80) - (yellow-projectile-speed meters :offset-assert 84) + ((slide-hold-time seconds) + (heat-max float) + (hotcoals-heat-inc float) + (lava-heat-inc float) + (lava-air-heat-inc float) + (surface-heat-inc float) + (jump-heat-inc float) + (lavatube-hotcoals-heat-inc float) + (lavatube-lava-heat-inc float) + (lavatube-lava-air-heat-inc float) + (lavatube-surface-heat-inc float) + (lavatube-jump-heat-inc float) + (boost-curve-max meters) + (boost-level-max meters) + (boost-level-inc meters) + (boost-duration seconds) + (default-front-blade degrees) + (yellow-projectile-speed meters) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) diff --git a/goal_src/jak1/levels/racer_common/target-racer.gc b/goal_src/jak1/levels/racer_common/target-racer.gc index d92c9f426e1..b0be63eb17a 100644 --- a/goal_src/jak1/levels/racer_common/target-racer.gc +++ b/goal_src/jak1/levels/racer_common/target-racer.gc @@ -91,7 +91,7 @@ ) (defbehavior racer-on-ground? racer () - (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) + (logtest? (-> self root status) (cshape-moving-flags onsurf)) ) (defbehavior racer-calc-gravity target () @@ -287,10 +287,7 @@ ) (set! f0-13 (cond - ((and (not (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) - ) + ((and (not (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0))) (cpad-hold? (-> self control unknown-cpad-info00 number) square) ) (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) x) @@ -760,9 +757,7 @@ ) ) ) - (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (cpad-pressed? (-> self control unknown-cpad-info00 number) circle square) (time-elapsed? (-> self control unknown-dword82) (seconds 0.25)) (not (logtest? (-> self state-flags) (state-flags being-attacked dying))) @@ -779,7 +774,7 @@ (-> self entity) s5-4 gp-6 - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + (if (>= (-> self fact eco-level) (-> *FACT-bank* eco-level-max)) 152 136 ) diff --git a/goal_src/jak1/levels/robocave/cave-trap.gc b/goal_src/jak1/levels/robocave/cave-trap.gc index 1830f3606f6..84fae44e6d0 100644 --- a/goal_src/jak1/levels/robocave/cave-trap.gc +++ b/goal_src/jak1/levels/robocave/cave-trap.gc @@ -10,19 +10,15 @@ ;; DECOMP BEGINS (deftype cave-trap (process-drawable) - ((root-override collide-shape :offset 112) - (spider-count int32 :offset-assert 176) - (alt-actors (array entity-actor) :offset-assert 180) - (spawn-delay time-frame :offset-assert 184) - (last-spawn-time time-frame :offset-assert 192) - (debug-targ-pos vector :inline :offset-assert 208) + ((root collide-shape :override) + (spider-count int32) + (alt-actors (array entity-actor)) + (spawn-delay time-frame) + (last-spawn-time time-frame) + (debug-targ-pos vector :inline) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xe0 - :flag-assert #x15007000e0 (:methods - (cave-trap-method-20 (_type_) symbol 20) + (cave-trap-method-20 (_type_) symbol) ) (:states cave-trap-active @@ -33,12 +29,8 @@ (deftype spider-vent (process-drawable) - ((last-spawn-time time-frame :offset-assert 176) + ((last-spawn-time time-frame) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states spider-vent-idle ) @@ -67,7 +59,7 @@ ) ) -(defmethod init-from-entity! spider-vent ((this spider-vent) (arg0 entity-actor)) +(defmethod init-from-entity! ((this spider-vent) (arg0 entity-actor)) (set! (-> this last-spawn-time) 0) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -94,25 +86,19 @@ ) (deftype spawn-baby-spider-best (structure) - ((index int32 :offset-assert 0) - (dist float :offset-assert 4) + ((index int32) + (dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype spawn-baby-spider-work (structure) - ((best spawn-baby-spider-best 4 :inline :offset-assert 0) + ((best spawn-baby-spider-best 4 :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) -(defmethod cave-trap-method-20 cave-trap ((this cave-trap)) +(defmethod cave-trap-method-20 ((this cave-trap)) (set-time! (-> this last-spawn-time)) (set! (-> this spawn-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.5))) (let ((s5-0 (new 'stack-no-clear 'spawn-baby-spider-work))) @@ -218,8 +204,8 @@ :trans (behavior () (when *target* (let* ((gp-0 (target-pos 0)) - (f0-0 (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) - (f1-1 (- (-> gp-0 y) (-> self root-override trans y))) + (f0-0 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) + (f1-1 (- (-> gp-0 y) (-> self root trans y))) ) (when (and (>= 61440.0 f1-1) (>= f1-1 -16384.0)) (when (>= 274432.0 f0-0) @@ -249,8 +235,8 @@ (cond (*target* (let* ((gp-0 (target-pos 0)) - (f0-0 (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) - (f1-1 (- (-> gp-0 y) (-> self root-override trans y))) + (f0-0 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) + (f1-1 (- (-> gp-0 y) (-> self root trans y))) ) (if (or (< 73728.0 f1-1) (< f1-1 -24576.0) (< 368640.0 f0-0)) (go cave-trap-give-up) @@ -281,14 +267,14 @@ ) ) -(defmethod relocate cave-trap ((this cave-trap) (arg0 int)) +(defmethod relocate ((this cave-trap) (arg0 int)) (if (nonzero? (-> this alt-actors)) (&+! (-> this alt-actors) arg0) ) (call-parent-method this arg0) ) -(defmethod init-from-entity! cave-trap ((this cave-trap) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cave-trap) (arg0 entity-actor)) (set! (-> this spider-count) 0) (set! (-> this spawn-delay) 0) (set! (-> this last-spawn-time) 0) @@ -300,13 +286,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> this nav nearest-y-threshold) 409600.0) - (logclear! (-> this root-override nav-flags) (nav-flags navf0)) + (logclear! (-> this root nav-flags) (nav-flags navf0)) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((s4-1 (entity-actor-count arg0 'alt-actor))) diff --git a/goal_src/jak1/levels/robocave/robocave-part.gc b/goal_src/jak1/levels/robocave/robocave-part.gc index da119880bd6..4ab6348280b 100644 --- a/goal_src/jak1/levels/robocave/robocave-part.gc +++ b/goal_src/jak1/levels/robocave/robocave-part.gc @@ -9,10 +9,6 @@ (deftype robocave-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/robocave/spider-egg.gc b/goal_src/jak1/levels/robocave/spider-egg.gc index dcf5a471bf6..1f1c515a35a 100644 --- a/goal_src/jak1/levels/robocave/spider-egg.gc +++ b/goal_src/jak1/levels/robocave/spider-egg.gc @@ -9,14 +9,10 @@ ;; DECOMP BEGINS (deftype spider-egg (process-drawable) - ((root-override collide-shape-moving :offset 112) - (notify-actor entity-actor :offset-assert 176) - (broken-look lod-set :inline :offset-assert 180) + ((root collide-shape-moving :override) + (notify-actor entity-actor) + (broken-look lod-set :inline) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd5 - :flag-assert #x14007000d5 (:states spider-egg-die spider-egg-hatch @@ -46,14 +42,7 @@ (local-vars (v0-0 object)) (case message (('touch) - (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> block param 0)) - 0.7 - 6144.0 - 16384.0 - ) + (send-shove-back (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) ) (('can-spawn?) (return #t) @@ -124,7 +113,7 @@ :code (behavior () (cleanup-for-death self) (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (process-spawn part-tracker :init part-tracker-init @@ -133,7 +122,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) @@ -190,12 +179,12 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) (ja-channel-push! 1 (seconds 0.1)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :group! spider-egg-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -209,7 +198,7 @@ :post ja-post ) -(defmethod init-from-entity! spider-egg ((this spider-egg) (arg0 entity-actor)) +(defmethod init-from-entity! ((this spider-egg) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (logior! (-> this mask) (process-mask attackable)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -228,31 +217,31 @@ ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *spider-egg-unbroken-sg* '()) (setup-lods! (-> this broken-look) *spider-egg-broken-sg* (-> this draw art-group) (-> this entity)) - (set-vector! (-> this root-override scale) 0.4 0.4 0.4 1.0) - (if (not (move-to-ground (-> this root-override) 12288.0 40960.0 #t (collide-kind background))) + (set-vector! (-> this root scale) 0.4 0.4 0.4 1.0) + (if (not (move-to-ground (-> this root) 12288.0 40960.0 #t (collide-kind background))) (go process-drawable-art-error "no ground") ) - (+! (-> this root-override trans y) -409.6) + (+! (-> this root trans y) -409.6) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> this root-override surface-normal quad)) + (set! (-> s4-1 quad) (-> this root surface-normal quad)) (+! (-> s4-1 x) (rand-vu-float-range -0.2 0.2)) (+! (-> s4-1 z) (rand-vu-float-range -0.2 0.2)) (vector-normalize! s4-1 1.0) (quaternion-axis-angle! - (-> this root-override quat) + (-> this root quat) (-> s4-1 x) (-> s4-1 y) (-> s4-1 z) (rand-vu-float-range 0.0 65536.0) ) ) - (update-transforms! (-> this root-override)) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (update-transforms! (-> this root)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (if (> (entity-actor-count arg0 'alt-actor) 0) (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> this notify-actor) #f) diff --git a/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc b/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc index d1d1a1ff333..17528bc80fd 100644 --- a/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc +++ b/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc @@ -127,44 +127,37 @@ ) (deftype fleeing-nav-enemy-info (structure) - ((min-reflect-angle float :offset-assert 0) - (max-reflect-angle float :offset-assert 4) - (max-boundary-deflection float :offset-assert 8) - (deflection-min-dist float :offset-assert 12) - (deflection-max-dist float :offset-assert 16) - (reflection-time int32 :offset-assert 20) - (travel-rotate-speed float :offset-assert 24) - (blend_interp_angle float :offset-assert 28) - (min-speed-adjust float :offset-assert 32) - (max-speed-adjust float :offset-assert 36) - (speed-adjust-center float :offset-assert 40) - (speed-adjust-range float :offset-assert 44) - (abort-notice-distance float :offset-assert 48) - (min-notice-dist float :offset-assert 52) - (max-notice-dist float :offset-assert 56) - (min-stop-chase-dist float :offset-assert 60) - (max-stop-chase-dist float :offset-assert 64) - (max-flee-rotation float :offset-assert 68) + ((min-reflect-angle float) + (max-reflect-angle float) + (max-boundary-deflection float) + (deflection-min-dist float) + (deflection-max-dist float) + (reflection-time int32) + (travel-rotate-speed float) + (blend_interp_angle float) + (min-speed-adjust float) + (max-speed-adjust float) + (speed-adjust-center float) + (speed-adjust-range float) + (abort-notice-distance float) + (min-notice-dist float) + (max-notice-dist float) + (min-stop-chase-dist float) + (max-stop-chase-dist float) + (max-flee-rotation float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) (deftype fleeing-nav-enemy (nav-enemy) - ((last-reflection-time time-frame :offset-assert 400) - (run-blend-interp float :offset-assert 408) - (desired-travel vector :inline :offset-assert 416) - (saved-travel vector :inline :offset-assert 432) - (speed-adjust float :offset-assert 448) - (flee-info fleeing-nav-enemy-info :inline :offset-assert 452) + ((last-reflection-time time-frame) + (run-blend-interp float) + (desired-travel vector :inline) + (saved-travel vector :inline) + (speed-adjust float) + (flee-info fleeing-nav-enemy-info :inline) ) - :heap-base #x1a0 - :method-count-assert 76 - :size-assert #x20c - :flag-assert #x4c01a0020c (:states fleeing-nav-enemy-debug ) @@ -499,13 +492,9 @@ (define *lightning-mole-hole* (new 'static 'vector :x -241664.0 :y 106496.0 :z -6393856.0)) (deftype lightning-mole (fleeing-nav-enemy) - ((debug-vector vector :inline :offset-assert 528) - (alt-actor entity-actor :offset-assert 544) + ((debug-vector vector :inline) + (alt-actor entity-actor) ) - :heap-base #x1c0 - :method-count-assert 76 - :size-assert #x224 - :flag-assert #x4c01c00224 (:states lightning-mole-debug-blend lightning-mole-debug-run @@ -867,7 +856,7 @@ :post fleeing-nav-enemy-chase-post ) -(defmethod attack-handler lightning-mole ((this lightning-mole) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this lightning-mole) (arg0 process) (arg1 event-message-block)) (send-event arg0 'get-attack-count 1) (when (!= (-> this state) lightning-mole-yelp) (send-event arg0 'jump 32768.0 32768.0) @@ -876,7 +865,7 @@ #t ) -(defmethod touch-handler lightning-mole ((this lightning-mole) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this lightning-mole) (arg0 process) (arg1 event-message-block)) (when (!= (-> this state) lightning-mole-yelp) (send-event arg0 'jump 32768.0 32768.0) (go lightning-mole-yelp) @@ -937,7 +926,7 @@ ) ) -(defmethod init-from-entity! lightning-mole ((this lightning-mole) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lightning-mole) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -1155,10 +1144,6 @@ (deftype peeper (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states peeper-down peeper-hide @@ -1295,7 +1280,7 @@ :post ja-post ) -(defmethod init-from-entity! peeper ((this peeper) (arg0 entity-actor)) +(defmethod init-from-entity! ((this peeper) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lightning-mole-sg* '()) diff --git a/goal_src/jak1/levels/rolling/rolling-obs.gc b/goal_src/jak1/levels/rolling/rolling-obs.gc index d977a0ece49..12014edee43 100644 --- a/goal_src/jak1/levels/rolling/rolling-obs.gc +++ b/goal_src/jak1/levels/rolling/rolling-obs.gc @@ -8,20 +8,12 @@ ;; DECOMP BEGINS (deftype rolling-part (part-spawner) - ((root-override basic :offset 112) - ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 + () ) (deftype rollingcam (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) @@ -31,24 +23,16 @@ ) (deftype pusher-base (process-drawable) - ((root-override collide-shape-moving :offset 112) - (max-frame float :offset-assert 176) + ((root collide-shape-moving :override) + (max-frame float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 ) (deftype pusher (pusher-base) - ((sync sync-info-paused :inline :offset-assert 180) - (cyl cylinder :inline :offset-assert 208) + ((sync sync-info-paused :inline) + (cyl cylinder :inline) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #xf8 - :flag-assert #x14009000f8 (:states pusher-idle ) @@ -56,12 +40,8 @@ (deftype gorge-pusher (pusher-base) - ((min-frame float :offset-assert 180) + ((min-frame float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states gorge-pusher-idle ) @@ -100,7 +80,7 @@ ) (set! (-> gp-0 nav-radius) (* 0.75 (-> gp-0 root-prim local-sphere w))) (backup-collide-with-as gp-0) - (set! (-> self root-override) gp-0) + (set! (-> self root) gp-0) gp-0 ) ) @@ -127,14 +107,14 @@ :post rider-post ) -(defmethod init-from-entity! pusher ((this pusher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pusher) (arg0 entity-actor)) (pusher-base-init) (process-drawable-from-entity! this arg0) (initialize-skeleton this *pusher-sg* '()) (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) (set! (-> this max-frame) (res-lump-float arg0 'max-frame :default (the float (ja-num-frames 0)))) - (set! (-> this cyl origin quad) (-> this root-override trans quad)) - (vector-x-quaternion! (-> this cyl axis) (-> this root-override quat)) + (set! (-> this cyl origin quad) (-> this root trans quad)) + (vector-x-quaternion! (-> this cyl axis) (-> this root quat)) (vector-negate! (-> this cyl axis) (-> this cyl axis)) (set! (-> this cyl length) 36864.0) (set! (-> this cyl radius) 20480.0) @@ -156,7 +136,7 @@ :post rider-post ) -(defmethod init-from-entity! gorge-pusher ((this gorge-pusher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gorge-pusher) (arg0 entity-actor)) (pusher-base-init) (process-drawable-from-entity! this arg0) (initialize-skeleton this *pusher-sg* '()) @@ -183,13 +163,9 @@ ) (deftype dark-plant (process-drawable) - ((num-alts int32 :offset-assert 176) - (alts entity-actor 4 :offset-assert 180) + ((num-alts int32) + (alts entity-actor 4) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xc4 - :flag-assert #x14006000c4 (:states dark-plant-death dark-plant-gone @@ -446,7 +422,7 @@ ) ) -(defmethod init-from-entity! dark-plant ((this dark-plant) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dark-plant) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *dark-plant-sg* '()) @@ -471,13 +447,9 @@ ) (deftype happy-plant (process-drawable) - ((root-override collide-shape :offset 112) - (alt-actor entity-actor :offset-assert 176) + ((root collide-shape :override) + (alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states happy-plant-init happy-plant-opened @@ -516,7 +488,7 @@ (close-specific-task! (game-task rolling-plants) (task-status need-reminder)) (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self mask) (process-mask actor-pause)) - (while (and *target* (< (vector-vector-distance (-> self root-override trans) (target-pos 0)) 24576.0)) + (while (and *target* (< (vector-vector-distance (-> self root trans) (target-pos 0)) 24576.0)) (suspend) ) (let ((gp-2 @@ -568,7 +540,7 @@ ) ) ) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (go happy-plant-opened) ) :post transform-post @@ -593,7 +565,7 @@ ) ) :code (behavior () - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -605,7 +577,7 @@ :post ja-post ) -(defmethod init-from-entity! happy-plant ((this happy-plant) (arg0 entity-actor)) +(defmethod init-from-entity! ((this happy-plant) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -618,7 +590,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *happy-plant-sg* '()) @@ -651,12 +623,9 @@ ) (deftype race-time (structure) - ((digit int8 5 :offset-assert 0) + ((digit int8 5) ) :pack-me - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) @@ -746,13 +715,9 @@ ) (deftype rolling-start (process-drawable) - ((whole-look lod-set :inline :offset-assert 176) - (broken-look lod-set :inline :offset-assert 212) + ((whole-look lod-set :inline) + (broken-look lod-set :inline) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #xf5 - :flag-assert #x14009000f5 (:states (rolling-start-break symbol) rolling-start-whole @@ -834,15 +799,11 @@ ) (deftype gorge (process-drawable) - ((root-override collide-shape-moving :offset 112) - (coord matrix :inline :offset-assert 176) - (radius float :offset-assert 240) - (thickness float :offset-assert 244) + ((root collide-shape-moving :override) + (coord matrix :inline) + (radius float) + (thickness float) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #xf8 - :flag-assert #x14009000f8 ) @@ -859,18 +820,14 @@ ) (deftype gorge-start (gorge) - ((tasks task-control :offset-assert 248) - (record-time race-time :inline :offset-assert 252) - (this-time race-time :inline :offset-assert 257) - (start-banner handle :offset-assert 264) - (end-banner handle :offset-assert 272) - (timer-pos-offset int32 :offset-assert 280) - (ticker ticky :inline :offset-assert 288) + ((tasks task-control) + (record-time race-time :inline) + (this-time race-time :inline) + (start-banner handle) + (end-banner handle) + (timer-pos-offset int32) + (ticker ticky :inline) ) - :heap-base #xd0 - :method-count-assert 20 - :size-assert #x140 - :flag-assert #x1400d00140 (:states gorge-start-idle gorge-start-race-aborted @@ -882,12 +839,8 @@ (deftype gorge-finish (gorge) - ((alt-actor entity-actor :offset-assert 248) + ((alt-actor entity-actor) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #xfc - :flag-assert #x14009000fc (:states gorge-finish-idle ) @@ -896,10 +849,6 @@ (deftype gorge-abort (gorge) () - :heap-base #x90 - :method-count-assert 20 - :size-assert #xf8 - :flag-assert #x14009000f8 (:states gorge-abort-idle ) @@ -952,8 +901,8 @@ ) (defbehavior gorge-abort-init-by-other gorge-abort ((arg0 vector) (arg1 vector) (arg2 float)) - (set! (-> self root-override) (the-as collide-shape-moving (new 'process 'trsqv))) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root) (the-as collide-shape-moving (new 'process 'trsqv))) + (set! (-> self root trans quad) (-> arg0 quad)) (gorge-init arg0 arg1 arg2 8192.0) (go gorge-abort-idle) (none) @@ -972,8 +921,8 @@ ) (defbehavior gorge-finish-init-by-other gorge-finish ((arg0 vector) (arg1 vector) (arg2 float)) - (set! (-> self root-override) (the-as collide-shape-moving (new 'process 'trsqv))) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root) (the-as collide-shape-moving (new 'process 'trsqv))) + (set! (-> self root trans quad) (-> arg0 quad)) (gorge-init arg0 arg1 arg2 20480.0) (go gorge-finish-idle) (none) @@ -1097,7 +1046,7 @@ (the-as handle (when (task-closed? (game-task rolling-race) (task-status need-introduction)) (when (not (handle->process (-> self start-banner))) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (let ((v0-1 (ppointer->handle (process-spawn rolling-start gp-0 0.0 :to self)))) (set! (-> self start-banner) (the-as handle v0-1)) v0-1 @@ -1316,11 +1265,11 @@ ) ) -(defmethod init-from-entity! gorge-start ((this gorge-start) (arg0 entity-actor)) - (set! (-> this root-override) (the-as collide-shape-moving (new 'process 'trsqv))) +(defmethod init-from-entity! ((this gorge-start) (arg0 entity-actor)) + (set! (-> this root) (the-as collide-shape-moving (new 'process 'trsqv))) (process-drawable-from-entity! this arg0) (let ((a0-3 (new 'stack-no-clear 'vector))) - (set! (-> a0-3 quad) (-> this root-override trans quad)) + (set! (-> a0-3 quad) (-> this root trans quad)) (+! (-> a0-3 y) -8192.0) (gorge-init a0-3 (new 'static 'vector :z 1.0) 102400.0 40960.0) ) @@ -1334,10 +1283,6 @@ (deftype rolling-water (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) @@ -1356,7 +1301,7 @@ ) ) -(defmethod water-vol-method-22 rolling-water ((this rolling-water)) +(defmethod water-vol-method-22 ((this rolling-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/goal_src/jak1/levels/rolling/rolling-race-ring.gc b/goal_src/jak1/levels/rolling/rolling-race-ring.gc index f78fe6f101b..673fd06979f 100644 --- a/goal_src/jak1/levels/rolling/rolling-race-ring.gc +++ b/goal_src/jak1/levels/rolling/rolling-race-ring.gc @@ -8,20 +8,16 @@ ;; DECOMP BEGINS (deftype race-ring (process-drawable) - ((rot-y float :offset-assert 176) - (face-vec vector :inline :offset-assert 192) - (part-track handle :offset-assert 208) - (keep-part-track-alive symbol :offset-assert 216) - (timeout time-frame :offset-assert 224) - (alt-actor entity-actor :offset-assert 232) - (alt-task uint8 :offset-assert 236) - (cyl cylinder-flat :inline :offset-assert 240) - (old-hips vector :inline :offset-assert 288) + ((rot-y float) + (face-vec vector :inline) + (part-track handle) + (keep-part-track-alive symbol) + (timeout time-frame) + (alt-actor entity-actor) + (alt-task uint8) + (cyl cylinder-flat :inline) + (old-hips vector :inline) ) - :heap-base #xc0 - :method-count-assert 20 - :size-assert #x130 - :flag-assert #x1400c00130 (:states race-ring-active race-ring-idle @@ -937,7 +933,7 @@ ) ) -(defmethod init-from-entity! race-ring ((this race-ring) (arg0 entity-actor)) +(defmethod init-from-entity! ((this race-ring) (arg0 entity-actor)) (let ((a0-1 arg0)) (if (not (entity-actor-lookup a0-1 'next-actor 0)) (stack-size-set! (-> this main-thread) 512) diff --git a/goal_src/jak1/levels/rolling/rolling-robber.gc b/goal_src/jak1/levels/rolling/rolling-robber.gc index 593522f7ed4..04a0e8e37bb 100644 --- a/goal_src/jak1/levels/rolling/rolling-robber.gc +++ b/goal_src/jak1/levels/rolling/rolling-robber.gc @@ -24,7 +24,7 @@ (set-time! (-> self state-time)) (loop (*! arg2 (- 1.0 (* 0.05 (-> *display* time-adjust-ratio)))) ;; og:preserve-this changed for high fps - (when (and (< (fabs arg2) 13.653334) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.5))) + (when (and (< (fabs arg2) 13.653334) (time-elapsed? (-> self state-time) (seconds 1.5))) (if *target* (process-release? *target*) ) @@ -39,14 +39,14 @@ (set! arg1 (+ 1.0 arg1)) ) ) - (eval-path-curve! (-> self path) (-> self root-override trans) arg1 'interp) - (+! (-> self root-override trans y) 8192.0) - (set! (-> self root-override trans y) (fmax 106496.0 (-> self root-override trans y))) - (set! (-> self base quad) (-> self root-override trans quad)) + (eval-path-curve! (-> self path) (-> self root trans) arg1 'interp) + (+! (-> self root trans y) 8192.0) + (set! (-> self root trans y) (fmax 106496.0 (-> self root trans y))) + (set! (-> self base quad) (-> self root trans quad)) (transform-post) (animate self) (let ((s4-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 (-> self root-override trans) *camera-other-trans*) + (vector-! s4-0 (-> self root trans) *camera-other-trans*) (vector-normalize! s4-0 1.0) (forward-down->inv-matrix *camera-other-matrix* s4-0 (new 'static 'vector :y -1.0 :w 1.0)) ) @@ -73,26 +73,22 @@ ) (deftype robber (process-drawable) - ((root-override collide-shape-moving :offset 112) - (curve-position float :offset-assert 176) - (speed float :offset-assert 180) - (facing vector :inline :offset-assert 192) - (tangent vector :inline :offset-assert 208) - (run-blend-interp float :offset-assert 224) - (near-timer int32 :offset-assert 228) - (far-time time-frame :offset-assert 232) - (y-offset float :offset-assert 240) - (y-offset-desired float :offset-assert 244) - (y-vel float :offset-assert 248) - (water-height float :offset-assert 252) - (timeout time-frame :offset-assert 256) - (last-ambient-time time-frame :offset-assert 264) - (time-to-next-ambient time-frame :offset-assert 272) + ((root collide-shape-moving :override) + (curve-position float) + (speed float) + (facing vector :inline) + (tangent vector :inline) + (run-blend-interp float) + (near-timer int32) + (far-time time-frame) + (y-offset float) + (y-offset-desired float) + (y-vel float) + (water-height float) + (timeout time-frame) + (last-ambient-time time-frame) + (time-to-next-ambient time-frame) ) - :heap-base #xb0 - :method-count-assert 20 - :size-assert #x118 - :flag-assert #x1400b00118 (:states robber-dead robber-debug @@ -141,7 +137,7 @@ (defbehavior robber-find-ground robber () (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result))) (+! (-> gp-0 y) 8192.0) (let ((f0-2 (fill-and-probe-using-line-sphere @@ -157,12 +153,12 @@ ) (v1-5 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-5 quad) (-> self root-override trans quad)) + (set! (-> v1-5 quad) (-> self root trans quad)) (set! (-> v1-5 y) (+ (-> gp-0 y) (* -81920.0 f0-2))) (cond ((and (>= f0-2 0.0) (< 204.8 (fabs (- (-> v1-5 y) (-> self water-height))))) (set! (-> self y-offset-desired) - (- (+ (-> gp-0 y) (* -81920.0 f0-2)) (- (-> self root-override trans y) (-> self y-offset))) + (- (+ (-> gp-0 y) (* -81920.0 f0-2)) (- (-> self root trans y) (-> self y-offset))) ) #t ) @@ -183,7 +179,7 @@ (path-control-method-14 (-> self path) (-> self tangent) (-> self curve-position)) (cond ((and arg0 *target*) - (vector-! gp-0 (-> self root-override trans) (target-pos 0)) + (vector-! gp-0 (-> self root trans) (target-pos 0)) (vector-normalize! gp-0 1.0) ) ((< (-> self speed) 0.0) @@ -197,7 +193,7 @@ (vector-matrix*! gp-0 (-> self facing) s5-0) (vector-normalize! gp-0 1.0) (forward-down->inv-matrix s5-0 gp-0 (new 'static 'vector :y -1.0)) - (matrix->quaternion (-> self root-override quat) s5-0) + (matrix->quaternion (-> self root quat) s5-0) (set! (-> self run-blend-interp) (acos (vector-dot gp-0 (-> self facing)))) (set! (-> self run-blend-interp) (* 0.0002746582 (-> self run-blend-interp))) (if (< (vector-dot (-> self facing) (the-as vector (-> s5-0 vector))) 0.0) @@ -224,7 +220,7 @@ (+! (-> self curve-position) 1.0) ) ) - (eval-path-curve! (-> self path) (-> self root-override trans) (-> self curve-position) 'interp) + (eval-path-curve! (-> self path) (-> self root trans) (-> self curve-position) 'interp) (cond ((< (-> self y-offset-desired) (-> self y-offset)) (set! (-> self y-vel) (* 0.25 (- (-> self y-offset-desired) (-> self y-offset)))) @@ -245,11 +241,11 @@ ) ) ) - (set! (-> self root-override trans y) (+ (-> self root-override trans y) (-> self y-offset))) + (set! (-> self root trans y) (+ (-> self root trans y) (-> self y-offset))) ) (defbehavior robber-calc-speed robber ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 symbol)) - (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root-override trans) (target-pos 0)))) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (target-pos 0)))) (set! (-> gp-1 y) 0.0) (let* ((f2-1 (/ (- (vector-length gp-1) arg0) (- arg1 arg0))) (f0-4 (- 1.0 (fmax 0.0 (fmin 1.0 f2-1)))) @@ -303,7 +299,7 @@ (+! (-> self curve-position) 1.0) ) ) - (eval-path-curve! (-> self path) (-> self root-override trans) (-> self curve-position) 'interp) + (eval-path-curve! (-> self path) (-> self root trans) (-> self curve-position) 'interp) (robber-rotate (the-as target #f) 1820.4445) (robber-find-ground) (suspend) @@ -390,17 +386,13 @@ (defstate robber-got-away (robber) :event robber-event-handler :trans (behavior () - (if (and (not (and *target* - (>= 204800.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and (not (and *target* (>= 204800.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) ) (robber-find-ground) ) (go robber-idle) ) - (if (and *target* - (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* (>= 122880.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go robber-flee) ) ) @@ -431,9 +423,7 @@ (set! (-> self y-offset-desired) 0.0) ) :trans (behavior () - (if (not (and *target* - (>= 163840.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (not (and *target* (>= 163840.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) ) (go robber-got-away) ) @@ -484,15 +474,11 @@ (set! (-> self y-offset-desired) 0.0) ) :trans (behavior () - (if (not (and *target* - (>= 163840.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (not (and *target* (>= 163840.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) ) (go robber-got-away) ) - (when (and *target* - (>= 102400.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (when (and *target* (>= 102400.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (set! (-> self near-timer) (- (the-as time-frame (-> self near-timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) @@ -549,9 +535,7 @@ (set! (-> self speed) 0.0) ) :trans (behavior () - (if (and *target* - (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* (>= 122880.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go robber-flee) ) (robber-rotate (the-as target #t) 182.04445) @@ -574,21 +558,17 @@ :event robber-event-handler :trans (behavior () (when (logtest? (-> self draw status) (draw-status was-drawn)) - (if (and *target* - (>= 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* (>= 163840.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id rolling-robbers-hint) "sksp0116" (the-as entity #f) *entity-pool* (game-task none)) ) ) - (if (and *target* - (>= 32768.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* (>= 32768.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go robber-flee) ) ) :code (behavior () (path-control-method-14 (-> self path) (-> self tangent) (-> self curve-position)) - (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root-override trans) (target-pos 0))) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (target-pos 0))) (f0-1 6.826667) ) (set! (-> gp-1 y) 0.0) @@ -618,9 +598,7 @@ (set! (-> self speed) 0.0) ) :trans (behavior () - (if (and *target* - (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* (>= 122880.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go robber-initial-notice) ) (robber-move) @@ -638,7 +616,7 @@ :post transform-post ) -(defmethod init-from-entity! robber ((this robber) (arg0 entity-actor)) +(defmethod init-from-entity! ((this robber) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -656,11 +634,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *robber-sg* '()) - (set! (-> this root-override pause-adjust-distance) 122880.0) + (set! (-> this root pause-adjust-distance) 122880.0) (set! (-> this link) (new 'process 'actor-link-info this)) (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) @@ -669,12 +647,12 @@ ) (set! (-> this draw origin-joint-index) (the-as uint 3)) (set! (-> this curve-position) (res-lump-float (-> this entity) 'initial-spline-pos)) - (eval-path-curve! (-> this path) (-> this root-override trans) (-> this curve-position) 'interp) + (eval-path-curve! (-> this path) (-> this root trans) (-> this curve-position) 'interp) (path-control-method-14 (-> this path) (-> this tangent) (-> this curve-position)) (set! (-> this facing quad) (-> this tangent quad)) (let ((s4-1 (new 'stack-no-clear 'matrix))) (forward-down->inv-matrix s4-1 (-> this facing) (new 'static 'vector :y -1.0)) - (matrix->quaternion (-> this root-override quat) s4-1) + (matrix->quaternion (-> this root quat) s4-1) ) (set! (-> this y-vel) 0.0) (set! (-> this water-height) (res-lump-float (-> this entity) 'water-height)) diff --git a/goal_src/jak1/levels/snow/ice-cube.gc b/goal_src/jak1/levels/snow/ice-cube.gc index feefe27116d..ec8276835d6 100644 --- a/goal_src/jak1/levels/snow/ice-cube.gc +++ b/goal_src/jak1/levels/snow/ice-cube.gc @@ -13,30 +13,26 @@ ) (deftype ice-cube (nav-enemy) - ((part2 sparticle-launch-control :offset-assert 400) - (part3 sparticle-launch-control :offset-assert 404) - (part4 sparticle-launch-control :offset-assert 408) - (track-target? symbol :offset-assert 412) - (slow-down? symbol :offset-assert 416) - (tracking-player? symbol :offset-assert 420) - (force-spawn-pt int32 :offset-assert 424) - (speed float :offset-assert 428) - (anim-blend float :offset-assert 432) - (prev-charge-angle-diff float :offset-assert 436) - (charge-angle float :offset-assert 440) - (ground-y float :offset-assert 444) - (cprims-type uint64 :offset-assert 448) - (next-skid-sound-time time-frame :offset-assert 456) - (starting-pos vector :inline :offset-assert 464) - (target-pt vector :inline :offset-assert 480) + ((part2 sparticle-launch-control) + (part3 sparticle-launch-control) + (part4 sparticle-launch-control) + (track-target? symbol) + (slow-down? symbol) + (tracking-player? symbol) + (force-spawn-pt int32) + (speed float) + (anim-blend float) + (prev-charge-angle-diff float) + (charge-angle float) + (ground-y float) + (cprims-type uint64) + (next-skid-sound-time time-frame) + (starting-pos vector :inline) + (target-pt vector :inline) ) - :heap-base #x180 - :method-count-assert 76 - :size-assert #x1f0 - :flag-assert #x4c018001f0 (:methods - (ice-cube-method-51 (_type_ vector vector) symbol :replace 51) - (ice-cube-method-53 (_type_ vector vector) symbol :replace 53) + (ice-cube-method-51 (_type_ vector vector) symbol :overlay-at nav-enemy-method-51) + (ice-cube-method-53 (_type_ vector vector) symbol :overlay-at nav-enemy-method-53) ) (:states ice-cube-appear @@ -462,7 +458,7 @@ ) ) -(defmethod initialize-collision ice-cube ((this ice-cube)) +(defmethod initialize-collision ((this ice-cube)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -529,7 +525,7 @@ (none) ) -(defmethod nav-enemy-method-57 ice-cube ((this ice-cube)) +(defmethod nav-enemy-method-57 ((this ice-cube)) (when (!= (-> this cprims-type) 1) (set! (-> this cprims-type) (the-as uint 1)) (let ((v1-3 (-> this collide-info root-prim))) @@ -541,7 +537,7 @@ (none) ) -(defmethod nav-enemy-method-58 ice-cube ((this ice-cube)) +(defmethod nav-enemy-method-58 ((this ice-cube)) (when (!= (-> this cprims-type) 2) (set! (-> this cprims-type) (the-as uint 2)) (let ((v1-3 (-> this collide-info root-prim))) @@ -553,7 +549,7 @@ (none) ) -(defmethod nav-enemy-method-48 ice-cube ((this ice-cube)) +(defmethod nav-enemy-method-48 ((this ice-cube)) (process-drawable-from-entity! this (-> this entity)) (initialize-skeleton this *ice-cube-sg* '()) (init-defaults! this *ice-cube-nav-enemy-info*) @@ -564,7 +560,7 @@ (none) ) -(defmethod deactivate ice-cube ((this ice-cube)) +(defmethod deactivate ((this ice-cube)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -578,7 +574,7 @@ (none) ) -(defmethod relocate ice-cube ((this ice-cube) (arg0 int)) +(defmethod relocate ((this ice-cube) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -591,7 +587,7 @@ (call-parent-method this arg0) ) -(defmethod init-from-entity! ice-cube ((this ice-cube) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ice-cube) (arg0 entity-actor)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 507) this)) (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 508) this)) (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 509) this)) @@ -613,7 +609,7 @@ (none) ) -(defmethod nav-enemy-method-60 ice-cube ((this ice-cube) (arg0 symbol)) +(defmethod nav-enemy-method-60 ((this ice-cube) (arg0 symbol)) (let ((gp-0 (new 'stack-no-clear 'vector))) (when (-> this tracking-player?) (if (and *target* arg0) @@ -632,7 +628,7 @@ ) ) -(defmethod ice-cube-method-51 ice-cube ((this ice-cube) (arg0 vector) (arg1 vector)) +(defmethod ice-cube-method-51 ((this ice-cube) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let* ((s4-0 (new 'stack-no-clear 'collide-tri-result)) (f0-0 40960.0) @@ -663,7 +659,7 @@ #t ) -(defmethod nav-enemy-method-52 ice-cube ((this ice-cube) (arg0 vector)) +(defmethod nav-enemy-method-52 ((this ice-cube) (arg0 vector)) (when *target* (let ((f0-0 (vector-vector-xz-distance arg0 (target-pos 0)))) (when (and (>= f0-0 40960.0) (>= 81920.0 f0-0) (not (nav-enemy-method-50 this arg0))) @@ -680,7 +676,7 @@ #f ) -(defmethod ice-cube-method-53 ice-cube ((this ice-cube) (arg0 vector) (arg1 vector)) +(defmethod ice-cube-method-53 ((this ice-cube) (arg0 vector) (arg1 vector)) (local-vars (s1-0 int) (s2-0 int)) (let ((s3-0 (-> this path curve num-cverts))) (if (<= s3-0 0) @@ -998,7 +994,7 @@ :post nav-enemy-simple-post ) -(defmethod nav-enemy-method-54 ice-cube ((this ice-cube) (arg0 vector)) +(defmethod nav-enemy-method-54 ((this ice-cube) (arg0 vector)) (let* ((s4-0 (-> this path curve num-cverts)) (s2-0 (nav-enemy-rnd-int-count s4-0)) (s5-0 (new 'stack-no-clear 'vector)) diff --git a/goal_src/jak1/levels/snow/snow-ball.gc b/goal_src/jak1/levels/snow/snow-ball.gc index ccbf5313c9a..07615e2ec72 100644 --- a/goal_src/jak1/levels/snow/snow-ball.gc +++ b/goal_src/jak1/levels/snow/snow-ball.gc @@ -9,10 +9,6 @@ (deftype snow-ball-shadow (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states snow-ball-shadow-idle ) @@ -20,50 +16,40 @@ (deftype snow-ball-junction (structure) - ((enter-time time-frame :offset-assert 0) - (exit-time time-frame :offset-assert 8) + ((enter-time time-frame) + (exit-time time-frame) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype snow-ball-path-info (structure) - ((hug-path? symbol :offset-assert 0) - (path-pos vector :inline :offset-assert 16) + ((hug-path? symbol) + (path-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype snow-ball-roller (process-drawable) - ((root-override collide-shape-moving :offset 112) - (which-path int32 :offset-assert 176) - (path-u float :offset-assert 180) - (path-speed float :offset-assert 184) - (path-length float :offset-assert 188) - (path-fall-u float :offset-assert 192) - (path-coming-out-u float :offset-assert 196) - (path-faded-up-u float :offset-assert 200) - (delay-til-bounce int32 :offset-assert 204) - (rolling-sound-id sound-id :offset-assert 208) - (rolling-sound-enabled? symbol :offset-assert 212) - (last-bounce-time time-frame :offset-assert 216) - (hit-player-time time-frame :offset-assert 224) - (path-info snow-ball-path-info :inline :offset-assert 240) - (junctions snow-ball-junction 4 :inline :offset-assert 272) + ((root collide-shape-moving :override) + (which-path int32) + (path-u float) + (path-speed float) + (path-length float) + (path-fall-u float) + (path-coming-out-u float) + (path-faded-up-u float) + (delay-til-bounce int32) + (rolling-sound-id sound-id) + (rolling-sound-enabled? symbol) + (last-bounce-time time-frame) + (hit-player-time time-frame) + (path-info snow-ball-path-info :inline) + (junctions snow-ball-junction 4 :inline) ) - :heap-base #xe0 - :method-count-assert 23 - :size-assert #x150 - :flag-assert #x1700e00150 (:methods - (follow-path (_type_) none 20) - (play-landing-sound (_type_ float) sound-id 21) - (snow-ball-roller-method-22 (_type_ process-drawable) none 22) + (follow-path (_type_) none) + (play-landing-sound (_type_ float) sound-id) + (snow-ball-roller-method-22 (_type_ process-drawable) none) ) (:states snow-ball-roller-idle @@ -72,20 +58,16 @@ (deftype snow-ball (process) - ((child-override (pointer snow-ball-roller) :offset 20) - (state-time time-frame :offset-assert 112) - (last-path-picked int32 :offset-assert 120) - (same-path-picked-count int32 :offset-assert 124) - (delay-til-next int32 :offset-assert 128) - (path curve-control 2 :offset-assert 132) + ((child-override (pointer snow-ball-roller) :overlay-at child) + (state-time time-frame) + (last-path-picked int32) + (same-path-picked-count int32) + (delay-til-next int32) + (path curve-control 2) ) - :heap-base #x20 - :method-count-assert 16 - :size-assert #x8c - :flag-assert #x100020008c (:methods - (snow-ball-method-14 (_type_ (inline-array snow-ball-junction) float int) symbol 14) - (snow-ball-method-15 (_type_ (inline-array snow-ball-junction) int) symbol 15) + (snow-ball-method-14 (_type_ (inline-array snow-ball-junction) float int) symbol) + (snow-ball-method-15 (_type_ (inline-array snow-ball-junction) int) symbol) ) (:states snow-ball-idle @@ -151,7 +133,7 @@ (none) ) -(defmethod follow-path snow-ball-roller ((this snow-ball-roller)) +(defmethod follow-path ((this snow-ball-roller)) (let ((s5-0 (-> this path-info))) (set! (-> s5-0 hug-path?) #f) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -180,13 +162,13 @@ (cond ((>= (-> this path-u) (-> this path-fall-u)) (set! (-> s5-0 path-pos y) -409600.0) - (set! (-> s5-0 path-pos x) (+ (-> s4-0 x) (-> this root-override transv x))) - (set! (-> s5-0 path-pos z) (+ (-> s4-0 z) (-> this root-override transv z))) + (set! (-> s5-0 path-pos x) (+ (-> s4-0 x) (-> this root transv x))) + (set! (-> s5-0 path-pos z) (+ (-> s4-0 z) (-> this root transv z))) (set! (-> this rolling-sound-enabled?) #f) ) (else - (set! (-> this root-override transv x) (- (-> s5-0 path-pos x) (-> s4-0 x))) - (set! (-> this root-override transv z) (- (-> s5-0 path-pos z) (-> s4-0 z))) + (set! (-> this root transv x) (- (-> s5-0 path-pos x) (-> s4-0 x))) + (set! (-> this root transv z) (- (-> s5-0 path-pos z) (-> s4-0 z))) ) ) ) @@ -194,7 +176,7 @@ (none) ) -(defmethod play-landing-sound snow-ball-roller ((this snow-ball-roller) (arg0 float)) +(defmethod play-landing-sound ((this snow-ball-roller) (arg0 float)) (let ((f30-0 (* 0.0018780049 (fmin 53248.0 (fmax 0.0 (+ -4096.0 (fabs arg0))))))) (sound-play "snowball-land" :vol f30-0) ) @@ -202,9 +184,9 @@ (defbehavior snow-ball-roller-path-update snow-ball-roller () (local-vars (f0-5 float)) - (let ((f0-0 (-> self root-override trans y))) - (+! (-> self root-override transv y) (* -491520.0 (seconds-per-frame))) - (let ((f30-0 (+ f0-0 (* (-> self root-override transv y) (seconds-per-frame))))) + (let ((f0-0 (-> self root trans y))) + (+! (-> self root transv y) (* -491520.0 (seconds-per-frame))) + (let ((f30-0 (+ f0-0 (* (-> self root transv y) (seconds-per-frame))))) (follow-path self) (let ((a1-0 (new 'stack-no-clear 'vector))) (let ((a0-1 (-> self path-info))) @@ -213,30 +195,30 @@ (+! (-> a1-0 y) 9216.0) (cond ((-> self path-info hug-path?) - (move-to-point! (-> self root-override) a1-0) - (set! (-> self root-override transv y) 0.0) + (move-to-point! (-> self root) a1-0) + (set! (-> self root transv y) 0.0) ) ((begin (set! f0-5 (- f30-0 (-> a1-0 y))) (< 0.0 f0-5)) (+! (-> a1-0 y) f0-5) - (move-to-point! (-> self root-override) a1-0) + (move-to-point! (-> self root) a1-0) ) (else - (move-to-point! (-> self root-override) a1-0) - (let ((f0-7 (-> self root-override transv y))) + (move-to-point! (-> self root) a1-0) + (let ((f0-7 (-> self root transv y))) (cond ((>= -40960.0 f0-7) - (set! (-> self root-override transv y) (* 0.4 (- f0-7))) - (play-landing-sound self (-> self root-override transv y)) + (set! (-> self root transv y) (* 0.4 (- f0-7))) + (play-landing-sound self (-> self root transv y)) ) (else - (set! (-> self root-override transv y) 0.0) + (set! (-> self root transv y) 0.0) ) ) ) (when (< (-> self path-u) (-> self path-fall-u)) (when (time-elapsed? (-> self last-bounce-time) (-> self delay-til-bounce)) (let ((f0-13 (rand-vu-float-range 8192.0 20480.0))) - (+! (-> self root-override transv y) f0-13) + (+! (-> self root transv y) f0-13) (play-landing-sound self f0-13) ) (set-time! (-> self last-bounce-time)) @@ -259,14 +241,14 @@ (matrix-rotate-x! s5-0 (* 1.1317686 (-> self path-u) (-> self path-length))) (matrix*! gp-0 s5-0 gp-0) ) - (matrix->quaternion (-> self root-override quat) gp-0) + (matrix->quaternion (-> self root quat) gp-0) ) ) (+! (-> self path-u) (* (-> self path-speed) (seconds-per-frame))) (if (< 1.0 (-> self path-u)) (set! (-> self path-u) 1.0) ) - (let ((f0-23 (- 819200.0 (-> self root-override trans y)))) + (let ((f0-23 (- 819200.0 (-> self root trans y)))) (when (>= f0-23 0.0) (cond ((>= f0-23 245760.0) @@ -274,29 +256,23 @@ ) (else (let ((f0-25 (- 1.0 (* 0.0000040690106 f0-23)))) - (set! (-> self root-override scale x) f0-25) - (set! (-> self root-override scale y) f0-25) - (set! (-> self root-override scale z) f0-25) + (set! (-> self root scale x) f0-25) + (set! (-> self root scale y) f0-25) + (set! (-> self root scale z) f0-25) ) ) ) ) ) - (let ((v1-54 (< (vector-vector-distance (-> self root-override trans) (math-camera-pos)) 163840.0))) + (let ((v1-54 (< (vector-vector-distance (-> self root trans) (math-camera-pos)) 163840.0))) (cond ((zero? (-> self rolling-sound-id)) (if (and v1-54 (-> self rolling-sound-enabled?)) - (set! (-> self rolling-sound-id) - (sound-play "snowball-roll" :position (the-as symbol (-> self root-override trans))) - ) + (set! (-> self rolling-sound-id) (sound-play "snowball-roll" :position (the-as symbol (-> self root trans)))) ) ) ((and v1-54 (-> self rolling-sound-enabled?)) - (sound-play - "snowball-roll" - :id (-> self rolling-sound-id) - :position (the-as symbol (-> self root-override trans)) - ) + (sound-play "snowball-roll" :id (-> self rolling-sound-id) :position (the-as symbol (-> self root trans))) ) (else (sound-stop (-> self rolling-sound-id)) @@ -308,24 +284,24 @@ (none) ) -(defmethod snow-ball-roller-method-22 snow-ball-roller ((this snow-ball-roller) (arg0 process-drawable)) +(defmethod snow-ball-roller-method-22 ((this snow-ball-roller) (arg0 process-drawable)) (cond - ((< (+ 4096.0 (-> arg0 root trans y)) (-> this root-override trans y)) + ((< (+ 4096.0 (-> arg0 root trans y)) (-> this root trans y)) (let ((f0-2 81920.0)) - (+! (-> this root-override transv y) f0-2) + (+! (-> this root transv y) f0-2) (play-landing-sound this f0-2) ) ) (else (let ((f0-3 24576.0)) - (+! (-> this root-override transv y) f0-3) + (+! (-> this root transv y) f0-3) (play-landing-sound this f0-3) ) ) ) (let ((s4-0 (new 'stack-no-clear 'vector))) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 (-> arg0 root trans) (-> this root-override trans)) + (vector-! s4-0 (-> arg0 root trans) (-> this root trans)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) (path-control-method-14 (-> this path) s3-0 (-> this path-u)) @@ -349,7 +325,7 @@ ) ) (vector-normalize! s4-0 25600.0) - (vector+! s4-0 s4-0 (-> this root-override trans)) + (vector+! s4-0 s4-0 (-> this root trans)) (vector-! s4-0 s4-0 (-> arg0 root trans)) (set! (-> s4-0 y) 0.0) (let ((f30-2 (vector-length s4-0))) @@ -365,7 +341,7 @@ (case message (('touch 'attack) (when (= (-> proc type) target) - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) (when (time-elapsed? (-> self hit-player-time) (seconds 0.5)) (set-time! (-> self hit-player-time)) (snow-ball-roller-method-22 self *target*) @@ -424,9 +400,9 @@ ) (set! (-> s4-1 nav-radius) (* 0.75 (-> s4-1 root-prim local-sphere w))) (backup-collide-with-as s4-1) - (set! (-> self root-override) s4-1) + (set! (-> self root) s4-1) ) - (set-vector! (-> self root-override transv) 0.0 0.0 0.0 1.0) + (set-vector! (-> self root transv) 0.0 0.0 0.0 1.0) (process-drawable-from-entity! self arg0) (initialize-skeleton self *snow-ball-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) @@ -452,7 +428,7 @@ (none) ) -(defmethod snow-ball-method-14 snow-ball ((this snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 float) (arg2 int)) +(defmethod snow-ball-method-14 ((this snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 float) (arg2 int)) (local-vars (v1-0 (pointer float))) (if (zero? arg2) (set! v1-0 (new 'static 'array float 8 0.3309 0.36 0.4691 0.5061 0.6904 0.7264 0.864 0.8667)) @@ -472,7 +448,7 @@ #f ) -(defmethod snow-ball-method-15 snow-ball ((this snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 int)) +(defmethod snow-ball-method-15 ((this snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 int)) (local-vars (v0-0 symbol)) (let ((v1-0 (-> this child-override))) (while v1-0 @@ -554,7 +530,7 @@ ) ) -(defmethod relocate snow-ball ((this snow-ball) (arg0 int)) +(defmethod relocate ((this snow-ball) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this path v1-0)) (&+! (-> this path v1-0) arg0) @@ -563,7 +539,7 @@ (call-parent-method this arg0) ) -(defmethod init-from-entity! snow-ball ((this snow-ball) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-ball) (arg0 entity-actor)) (set! (-> this last-path-picked) 1) (set! (-> this same-path-picked-count) 1) (dotimes (s5-0 2) diff --git a/goal_src/jak1/levels/snow/snow-bumper.gc b/goal_src/jak1/levels/snow/snow-bumper.gc index 37696e6add6..bdd01ec29d7 100644 --- a/goal_src/jak1/levels/snow/snow-bumper.gc +++ b/goal_src/jak1/levels/snow/snow-bumper.gc @@ -9,19 +9,15 @@ ;; DECOMP BEGINS (deftype snow-bumper (process-drawable) - ((bumper-id int32 :offset-assert 176) - (base-shove-ry float :offset-assert 180) - (max-shove-diff-ry float :offset-assert 184) - (part2 sparticle-launch-control :offset-assert 188) - (last-shoved-player-time time-frame :offset-assert 192) + ((bumper-id int32) + (base-shove-ry float) + (max-shove-diff-ry float) + (part2 sparticle-launch-control) + (last-shoved-player-time time-frame) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16006000c8 (:methods - (snow-bumper-method-20 (_type_) none 20) - (shove-player (_type_ process-drawable) none 21) + (snow-bumper-method-20 (_type_) none) + (shove-player (_type_ process-drawable) none) ) (:states snow-bumper-active-close-idle @@ -99,7 +95,7 @@ ) ) -(defmethod shove-player snow-bumper ((this snow-bumper) (arg0 process-drawable)) +(defmethod shove-player ((this snow-bumper) (arg0 process-drawable)) (let ((s5-0 (new 'stack-no-clear 'vector))) (vector-! s5-0 (-> arg0 root trans) (-> this root trans)) (set! (-> s5-0 y) 0.0) @@ -287,7 +283,7 @@ ) ) -(defmethod deactivate snow-bumper ((this snow-bumper)) +(defmethod deactivate ((this snow-bumper)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -295,14 +291,14 @@ (none) ) -(defmethod relocate snow-bumper ((this snow-bumper) (arg0 int)) +(defmethod relocate ((this snow-bumper) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) (call-parent-method this arg0) ) -(defmethod init-from-entity! snow-bumper ((this snow-bumper) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-bumper) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (set! (-> this last-shoved-player-time) 0) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) diff --git a/goal_src/jak1/levels/snow/snow-bunny.gc b/goal_src/jak1/levels/snow/snow-bunny.gc index aa8b9503b3a..62c8532db6b 100644 --- a/goal_src/jak1/levels/snow/snow-bunny.gc +++ b/goal_src/jak1/levels/snow/snow-bunny.gc @@ -8,38 +8,34 @@ ;; DECOMP BEGINS (deftype snow-bunny (nav-enemy) - ((patrol-rand-distraction int32 :offset-assert 400) - (base-hop-dist float :offset-assert 404) - (halfway-dist float :offset-assert 408) - (retreat-timeout float :offset-assert 412) - (gnd-popup float :offset-assert 416) - (jump-height-min float :offset-assert 420) - (jump-height-factor float :offset-assert 424) - (jump-anim-start-frame float :offset-assert 428) - (defense uint64 :offset-assert 432) - (retreat-timeout-time time-frame :offset-assert 440) - (last-nondangerous-time time-frame :offset-assert 448) - (patrol-hop-failed? basic :offset-assert 456) - (should-retreat? basic :offset-assert 460) - (got-jump-event? symbol :offset-assert 464) - (using-jump-event? basic :offset-assert 468) - (jump-anim int8 :offset-assert 472) - (notice-land-anim int8 :offset-assert 473) - (attack-anim int8 :offset-assert 474) - (final-dest vector :inline :offset-assert 480) - (jump-event-dest vector :inline :offset-assert 496) + ((patrol-rand-distraction int32) + (base-hop-dist float) + (halfway-dist float) + (retreat-timeout float) + (gnd-popup float) + (jump-height-min float) + (jump-height-factor float) + (jump-anim-start-frame float) + (defense uint64) + (retreat-timeout-time time-frame) + (last-nondangerous-time time-frame) + (patrol-hop-failed? basic) + (should-retreat? basic) + (got-jump-event? symbol) + (using-jump-event? basic) + (jump-anim int8) + (notice-land-anim int8) + (attack-anim int8) + (final-dest vector :inline) + (jump-event-dest vector :inline) ) - :heap-base #x190 - :method-count-assert 77 - :size-assert #x200 - :flag-assert #x4d01900200 (:methods - (snow-bunny-method-51 (_type_ vector vector) symbol :replace 51) - (snow-bunny-method-52 (_type_) symbol :replace 52) - (snow-bunny-method-54 (_type_) symbol :replace 54) - (snow-bunny-method-57 (_type_) symbol :replace 57) - (snow-bunny-method-60 (_type_) none :replace 60) - (snow-bunny-method-76 (_type_ symbol) none 76) + (nav-enemy-method-51 (_type_ vector vector) symbol :replace) + (nav-enemy-method-52 (_type_) symbol :replace) + (nav-enemy-method-54 (_type_) symbol :replace) + (nav-enemy-method-57 (_type_) symbol :replace) + (nav-enemy-method-60 (_type_) none :replace) + (snow-bunny-method-76 (_type_ symbol) none) ) ) @@ -129,7 +125,7 @@ ) ) -(defmethod snow-bunny-method-76 snow-bunny ((this snow-bunny) (arg0 symbol)) +(defmethod snow-bunny-method-76 ((this snow-bunny) (arg0 symbol)) (let ((f0-0 -4096.0)) (if arg0 (set! f0-0 -20480.0) @@ -142,7 +138,7 @@ (none) ) -(defmethod initialize-collision snow-bunny ((this snow-bunny)) +(defmethod initialize-collision ((this snow-bunny)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -189,14 +185,14 @@ (none) ) -(defmethod snow-bunny-method-60 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-60 ((this snow-bunny)) (initialize-skeleton this *snow-bunny-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) (none) ) -(defmethod nav-enemy-method-48 snow-bunny ((this snow-bunny)) - (snow-bunny-method-60 this) +(defmethod nav-enemy-method-48 ((this snow-bunny)) + (nav-enemy-method-60 this) (init-defaults! this *snow-bunny-nav-enemy-info*) (logclear! (-> this draw shadow-ctrl settings flags) (shadow-flags shdf03)) (cond @@ -223,7 +219,7 @@ (none) ) -(defmethod init-from-entity! snow-bunny ((this snow-bunny) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-bunny) (arg0 entity-actor)) (initialize-collision this) (process-drawable-from-entity! this arg0) (nav-enemy-method-48 this) @@ -235,7 +231,7 @@ (none) ) -(defmethod nav-enemy-method-58 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-58 ((this snow-bunny)) (if (not (logtest? (-> *target* state-flags) (state-flags dangerous))) (set-time! (-> this last-nondangerous-time)) ) @@ -256,7 +252,7 @@ (none) ) -(defmethod set-jump-height-factor! snow-bunny ((this snow-bunny) (arg0 int)) +(defmethod set-jump-height-factor! ((this snow-bunny) (arg0 int)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -282,7 +278,7 @@ (none) ) -(defmethod snow-bunny-method-57 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-57 ((this snow-bunny)) (if (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags dangerous)))) (return #f) ) @@ -388,7 +384,7 @@ (set! (-> self state-timeout) (seconds 0.1)) ) :trans (behavior () - (if (snow-bunny-method-57 self) + (if (nav-enemy-method-57 self) (go-virtual snow-bunny-defend) ) (when (time-elapsed? (-> self state-time) (-> self state-timeout)) @@ -443,7 +439,7 @@ :post nav-enemy-simple-post ) -(defmethod snow-bunny-method-51 snow-bunny ((this snow-bunny) (arg0 vector) (arg1 vector)) +(defmethod nav-enemy-method-51 ((this snow-bunny) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let* ((s4-0 (new 'stack-no-clear 'collide-tri-result)) (f0-0 (-> this gnd-popup)) @@ -474,7 +470,7 @@ #t ) -(defmethod nav-enemy-method-53 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-53 ((this snow-bunny)) (let* ((s4-0 (-> this path curve num-cverts)) (s2-0 (nav-enemy-rnd-int-count s4-0)) (s5-0 (new 'stack-no-clear 'vector)) @@ -483,7 +479,7 @@ (eval-path-curve-div! (-> this path) s5-0 (the float s2-0) 'interp) (let ((f30-0 (vector-vector-xz-distance s5-0 (-> this collide-info trans)))) (when (>= f30-0 6144.0) - (when (snow-bunny-method-51 this s5-0 s5-0) + (when (nav-enemy-method-51 this s5-0 s5-0) (set! (-> this final-dest quad) (-> s5-0 quad)) (set! (-> this halfway-dist) (* 0.5 f30-0)) (set! (-> this base-hop-dist) (rand-vu-float-range 6144.0 22118.4)) @@ -497,7 +493,7 @@ #f ) -(defmethod snow-bunny-method-54 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-54 ((this snow-bunny)) (local-vars (sv-48 (function float float))) (set! (-> this using-jump-event?) #f) (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this final-dest) (-> this collide-info trans))) @@ -557,7 +553,7 @@ ) (let ((a2-2 (-> this nav target-pos))) (vector+! a2-2 (-> this collide-info trans) s5-2) - (if (not (snow-bunny-method-51 this a2-2 a2-2)) + (if (not (nav-enemy-method-51 this a2-2 a2-2)) (return #f) ) ) @@ -572,11 +568,11 @@ :event snow-bunny-default-event-handler :enter (behavior () (set-time! (-> self state-time)) - (when (not (snow-bunny-method-54 self)) + (when (not (nav-enemy-method-54 self)) (set! (-> self patrol-hop-failed?) #t) (go-virtual snow-bunny-patrol-idle) ) - (if (snow-bunny-method-57 self) + (if (nav-enemy-method-57 self) (go-virtual snow-bunny-defend) ) (set-jump-height-factor! self 0) @@ -681,7 +677,7 @@ :post #f ) -(defmethod snow-bunny-method-52 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-52 ((this snow-bunny)) (local-vars (sv-48 (function float float))) (set! (-> this using-jump-event?) #f) (if (not *target*) @@ -689,7 +685,7 @@ ) (let ((s4-0 (-> this final-dest))) (set! (-> s4-0 quad) (-> (target-pos 0) quad)) - (if (not (snow-bunny-method-51 this s4-0 s4-0)) + (if (not (nav-enemy-method-51 this s4-0 s4-0)) (return #f) ) (set! (-> this base-hop-dist) (rand-vu-float-range 18022.4 22118.4)) @@ -739,7 +735,7 @@ ) (let ((a2-3 (-> this nav target-pos))) (vector+! a2-3 (-> this collide-info trans) s5-3) - (if (not (snow-bunny-method-51 this a2-3 a2-3)) + (if (not (nav-enemy-method-51 this a2-3 a2-3)) (return #f) ) ) @@ -761,10 +757,10 @@ (if (not (target-in-range? self (-> self nav-info stop-chase-distance))) (go-virtual nav-enemy-patrol) ) - (if (snow-bunny-method-57 self) + (if (nav-enemy-method-57 self) (go-virtual snow-bunny-defend) ) - (when (not (snow-bunny-method-52 self)) + (when (not (nav-enemy-method-52 self)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-notice) ) @@ -779,7 +775,7 @@ (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) ) :trans (behavior () - (if (snow-bunny-method-57 self) + (if (nav-enemy-method-57 self) (set! (-> self should-retreat?) #t) ) (nav-enemy-method-58 self) @@ -808,19 +804,16 @@ ) (deftype snow-bunny-retreat-work (structure) - ((found-best basic :offset-assert 0) - (using-jump-event? basic :offset-assert 4) - (best-travel-dist float :offset-assert 8) - (best-dest vector :inline :offset-assert 16) - (away-vec vector :inline :offset-assert 32) + ((found-best basic) + (using-jump-event? basic) + (best-travel-dist float) + (best-dest vector :inline) + (away-vec vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) -(defmethod nav-enemy-method-55 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-55 ((this snow-bunny)) (set! (-> this using-jump-event?) #f) (if (not *target*) (return #f) @@ -917,7 +910,7 @@ (when (>= f30-2 409.6) (let ((s1-5 (-> this nav target-pos))) (vector+! s1-5 (-> this collide-info trans) s0-0) - (when (snow-bunny-method-51 this s1-5 s1-5) + (when (nav-enemy-method-51 this s1-5 s1-5) (if (>= f30-2 (+ -409.6 (-> this base-hop-dist))) (return #t) ) diff --git a/goal_src/jak1/levels/snow/snow-flutflut-obs.gc b/goal_src/jak1/levels/snow/snow-flutflut-obs.gc index a4619292e3f..234eb55b9f0 100644 --- a/goal_src/jak1/levels/snow/snow-flutflut-obs.gc +++ b/goal_src/jak1/levels/snow/snow-flutflut-obs.gc @@ -9,23 +9,19 @@ ;; DECOMP BEGINS (deftype flutflut-plat (plat) - ((has-path? symbol :offset-assert 264) - (plat-type int32 :offset-assert 268) - (rise-time int32 :offset-assert 272) - (fall-time int32 :offset-assert 276) - (part-ry float :offset-assert 280) - (sync-starting-val float :offset-assert 284) - (flutflut-button entity-actor :offset-assert 288) - (appear-trans-top vector :inline :offset-assert 304) - (appear-trans-bottom vector :inline :offset-assert 320) - (appear-quat-top quaternion :inline :offset-assert 336) - (appear-quat-bottom quaternion :inline :offset-assert 352) - (start-trans vector :inline :offset-assert 368) + ((has-path? symbol) + (plat-type int32) + (rise-time int32) + (fall-time int32) + (part-ry float) + (sync-starting-val float) + (flutflut-button entity-actor) + (appear-trans-top vector :inline) + (appear-trans-bottom vector :inline) + (appear-quat-top quaternion :inline) + (appear-quat-bottom quaternion :inline) + (start-trans vector :inline) ) - :heap-base #x110 - :method-count-assert 33 - :size-assert #x180 - :flag-assert #x2101100180 (:states elevator-idle-at-cave elevator-idle-at-fort @@ -39,18 +35,14 @@ (deftype snow-button (process-drawable) - ((root-override collide-shape-moving :offset 112) - (wiggled? symbol :offset-assert 176) - (trying-for-fuel-cell? symbol :offset-assert 180) - (timeout time-frame :offset-assert 184) - (delay-til-wiggle time-frame :offset-assert 192) - (prev-button entity-actor :offset-assert 200) - (ticker ticky :inline :offset-assert 208) + ((root collide-shape-moving :override) + (wiggled? symbol) + (trying-for-fuel-cell? symbol) + (timeout time-frame) + (delay-til-wiggle time-frame) + (prev-button entity-actor) + (ticker ticky :inline) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xf0 - :flag-assert #x14008000f0 (:states snow-button-activate snow-button-deactivate @@ -230,7 +222,7 @@ (('touch 'attack 'bonk) (when (and (= (-> proc type) target) (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)) - (>= 10649.6 (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) + (>= 10649.6 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) ) (close-specific-task! (game-task snow-ball) (task-status need-hint)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -348,7 +340,7 @@ :post rider-post ) -(defmethod init-from-entity! snow-button ((this snow-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-button) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -391,7 +383,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set! (-> this link) (new 'process 'actor-link-info this)) @@ -419,7 +411,7 @@ (none) ) -(defmethod baseplat-method-26 flutflut-plat ((this flutflut-plat)) +(defmethod baseplat-method-26 ((this flutflut-plat)) (let ((t9-0 (method-of-type plat baseplat-method-26))) (t9-0 this) ) @@ -431,7 +423,7 @@ (set! (-> this flutflut-button) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-0 0.0) - (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-0) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-0) ) ) (set! (-> this has-path?) @@ -453,12 +445,12 @@ ) ) (else - (set! (-> this appear-trans-top quad) (-> this root-override trans quad)) + (set! (-> this appear-trans-top quad) (-> this root trans quad)) ) ) (set! (-> this appear-trans-bottom quad) (-> this appear-trans-top quad)) (+! (-> this appear-trans-bottom y) -286720.0) - (quaternion-copy! (-> this appear-quat-top) (-> this root-override quat)) + (quaternion-copy! (-> this appear-quat-top) (-> this root quat)) (let ((v1-33 (res-lump-value (-> this entity) 'extra-id uint128))) (set! (-> this rise-time) (the int (* 300.0 (+ 0.6 (* 0.15 (the float v1-33)))))) ) @@ -467,7 +459,7 @@ (none) ) -(defmethod get-lit-skel flutflut-plat ((this flutflut-plat)) +(defmethod get-lit-skel ((this flutflut-plat)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (return (the-as skeleton-group #t)) ) @@ -541,8 +533,8 @@ ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) - (clear-collide-with-as (-> self root-override)) - (set! (-> self root-override trans quad) (-> self appear-trans-top quad)) + (clear-collide-with-as (-> self root)) + (set! (-> self root trans quad) (-> self appear-trans-top quad)) (transform-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -562,7 +554,7 @@ (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (set! (-> self basetrans quad) (-> self appear-trans-bottom quad)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'quaternion)) @@ -586,7 +578,7 @@ (f30-0 (- 1.0 f0-3)) ) (vector-lerp! (-> self basetrans) (-> self appear-trans-bottom) (-> self appear-trans-top) f30-0) - (quaternion-slerp! (-> self root-override quat) (-> self appear-quat-bottom) (-> self appear-quat-top) f30-0) + (quaternion-slerp! (-> self root quat) (-> self appear-quat-bottom) (-> self appear-quat-top) f30-0) (set-vector! (-> self draw color-mult) f30-0 f30-0 f30-0 1.0) (when (>= f30-0 1.0) (baseplat-method-22 self) @@ -701,8 +693,8 @@ :enter (behavior () (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) - (logclear! (-> self root-override root-prim prim-core action) (collide-action rider-plat-sticky)) - (set! (-> self start-trans quad) (-> self root-override trans quad)) + (logclear! (-> self root root-prim prim-core action) (collide-action rider-plat-sticky)) + (set! (-> self start-trans quad) (-> self root trans quad)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'quaternion)) ) @@ -716,7 +708,7 @@ ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (logior! (-> self root-override root-prim prim-core action) (collide-action rider-plat-sticky)) + (logior! (-> self root root-prim prim-core action) (collide-action rider-plat-sticky)) ) :trans (behavior () (plat-trans) @@ -724,7 +716,7 @@ (f30-0 (* f0-1 f0-1)) ) (vector-lerp! (-> self basetrans) (-> self start-trans) (-> self appear-trans-bottom) f30-0) - (quaternion-slerp! (-> self root-override quat) (-> self appear-quat-top) (-> self appear-quat-bottom) f30-0) + (quaternion-slerp! (-> self root quat) (-> self appear-quat-top) (-> self appear-quat-bottom) f30-0) (let ((f0-3 (- 1.0 f30-0))) (set-vector! (-> self draw color-mult) f0-3 f0-3 f0-3 1.0) ) @@ -847,60 +839,48 @@ (deftype flutflut-plat-small (flutflut-plat) () - :heap-base #x110 - :method-count-assert 33 - :size-assert #x180 - :flag-assert #x2101100180 ) (deftype flutflut-plat-med (flutflut-plat) () - :heap-base #x110 - :method-count-assert 33 - :size-assert #x180 - :flag-assert #x2101100180 ) (deftype flutflut-plat-large (flutflut-plat) () - :heap-base #x110 - :method-count-assert 33 - :size-assert #x180 - :flag-assert #x2101100180 ) -(defmethod get-unlit-skel flutflut-plat-small ((this flutflut-plat-small)) +(defmethod get-unlit-skel ((this flutflut-plat-small)) *flutflut-plat-small-sg* ) -(defmethod baseplat-method-25 flutflut-plat-small ((this flutflut-plat-small)) +(defmethod baseplat-method-25 ((this flutflut-plat-small)) (let ((v0-0 (create-launch-control (-> *part-group-id-table* 516) this))) (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) ) ) -(defmethod baseplat-method-20 flutflut-plat-small ((this flutflut-plat-small)) +(defmethod baseplat-method-20 ((this flutflut-plat-small)) (when (nonzero? (-> this part)) (set! (-> *part-id-table* 2087 init-specs 12 initial-valuef) (-> this part-ry)) (set! (-> *part-id-table* 2088 init-specs 17 initial-valuef) (-> this part-ry)) - (spawn (-> this part) (-> this root-override trans)) + (spawn (-> this part) (-> this root trans)) ) (none) ) -(defmethod baseplat-method-26 flutflut-plat-small ((this flutflut-plat-small)) +(defmethod baseplat-method-26 ((this flutflut-plat-small)) (let ((t9-0 (method-of-type flutflut-plat baseplat-method-26))) (t9-0 this) ) - (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root-override quat)))) + (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root quat)))) (none) ) -(defmethod baseplat-method-24 flutflut-plat-small ((this flutflut-plat-small)) +(defmethod baseplat-method-24 ((this flutflut-plat-small)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -919,24 +899,24 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod get-unlit-skel flutflut-plat-med ((this flutflut-plat-med)) +(defmethod get-unlit-skel ((this flutflut-plat-med)) *flutflut-plat-med-sg* ) -(defmethod baseplat-method-25 flutflut-plat-med ((this flutflut-plat-med)) +(defmethod baseplat-method-25 ((this flutflut-plat-med)) (let ((v0-0 (create-launch-control (-> *part-group-id-table* 517) this))) (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) ) ) -(defmethod baseplat-method-24 flutflut-plat-med ((this flutflut-plat-med)) +(defmethod baseplat-method-24 ((this flutflut-plat-med)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -955,41 +935,41 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod get-unlit-skel flutflut-plat-large ((this flutflut-plat-large)) +(defmethod get-unlit-skel ((this flutflut-plat-large)) *flutflut-plat-large-sg* ) -(defmethod baseplat-method-25 flutflut-plat-large ((this flutflut-plat-large)) +(defmethod baseplat-method-25 ((this flutflut-plat-large)) (let ((v0-0 (create-launch-control (-> *part-group-id-table* 518) this))) (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) ) ) -(defmethod baseplat-method-20 flutflut-plat-large ((this flutflut-plat-large)) +(defmethod baseplat-method-20 ((this flutflut-plat-large)) (when (nonzero? (-> this part)) (set! (-> *part-id-table* 2091 init-specs 12 initial-valuef) (-> this part-ry)) (set! (-> *part-id-table* 2092 init-specs 17 initial-valuef) (-> this part-ry)) - (spawn (-> this part) (-> this root-override trans)) + (spawn (-> this part) (-> this root trans)) ) (none) ) -(defmethod baseplat-method-26 flutflut-plat-large ((this flutflut-plat-large)) +(defmethod baseplat-method-26 ((this flutflut-plat-large)) (let ((t9-0 (method-of-type flutflut-plat baseplat-method-26))) (t9-0 this) ) - (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root-override quat)))) + (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root quat)))) (none) ) -(defmethod baseplat-method-24 flutflut-plat-large ((this flutflut-plat-large)) +(defmethod baseplat-method-24 ((this flutflut-plat-large)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1008,7 +988,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) diff --git a/goal_src/jak1/levels/snow/snow-obs.gc b/goal_src/jak1/levels/snow/snow-obs.gc index 25e05e0b111..8b00849c8e9 100644 --- a/goal_src/jak1/levels/snow/snow-obs.gc +++ b/goal_src/jak1/levels/snow/snow-obs.gc @@ -8,12 +8,8 @@ ;; DECOMP BEGINS (deftype snowcam (pov-camera) - ((seq uint64 :offset-assert 224) + ((seq uint64) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xe8 - :flag-assert #x1e008000e8 ) @@ -22,7 +18,7 @@ :bounds (static-spherem 0 0 0 10) ) -(defmethod set-stack-size! snowcam ((this snowcam)) +(defmethod set-stack-size! ((this snowcam)) (stack-size-set! (-> this main-thread) 512) (none) ) @@ -108,14 +104,10 @@ ) (deftype snow-eggtop (process-drawable) - ((root-override collide-shape-moving :offset 112) - (spawn-trans vector :inline :offset-assert 176) - (play-sound? symbol :offset-assert 192) + ((root collide-shape-moving :override) + (spawn-trans vector :inline) + (play-sound? symbol) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xc4 - :flag-assert #x14006000c4 (:states snow-eggtop-activate snow-eggtop-idle-down @@ -291,7 +283,7 @@ (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) (go snow-eggtop-activate) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (update! (-> self sound)) ) :code (behavior () @@ -347,7 +339,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (let ((v1-7 @@ -424,7 +416,7 @@ ) ) -(defmethod init-from-entity! snow-eggtop ((this snow-eggtop) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-eggtop) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -443,17 +435,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-eggtop-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (set! (-> this spawn-trans quad) (-> this root-override trans quad)) - (+! (-> this root-override trans y) -2662.4) - (update-transforms! (-> this root-override)) + (set! (-> this spawn-trans quad) (-> this root trans quad)) + (+! (-> this root trans y) -2662.4) + (update-transforms! (-> this root)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 510) this)) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "electric-loop" :fo-max 40) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "electric-loop" :fo-max 40) (-> this root trans)) ) (cond ((task-complete? *game-info* (-> this entity extra perm task)) @@ -461,7 +453,7 @@ ) (else (let ((a0-17 (new 'stack-no-clear 'vector))) - (set! (-> a0-17 quad) (-> this root-override trans quad)) + (set! (-> a0-17 quad) (-> this root trans quad)) (+! (-> a0-17 y) 3072.0) (birth-pickup-at-point a0-17 @@ -479,16 +471,12 @@ ) (deftype snowpusher (process-drawable) - ((root-override collide-shape-moving :offset 112) - (max-frame float :offset-assert 176) - (open-sound sound-name :offset-assert 192) - (close-sound sound-name :offset-assert 208) - (sync sync-info-paused :inline :offset-assert 224) + ((root collide-shape-moving :override) + (max-frame float) + (open-sound sound-name) + (close-sound sound-name) + (sync sync-info-paused :inline) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xf0 - :flag-assert #x14008000f0 (:states snowpusher-idle ) @@ -536,7 +524,7 @@ :post pusher-post ) -(defmethod init-from-entity! snowpusher ((this snowpusher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snowpusher) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (logior! (-> this mask) (process-mask enemy platform)) (let ((s3-0 0) @@ -580,7 +568,7 @@ ) (set! (-> s3-1 nav-radius) (* 0.75 (-> s3-1 root-prim local-sphere w))) (backup-collide-with-as s3-1) - (set! (-> this root-override) s3-1) + (set! (-> this root) s3-1) ) ) (process-drawable-from-entity! this arg0) @@ -601,13 +589,9 @@ ) (deftype snow-spatula (baseplat) - ((sync sync-info :inline :offset-assert 228) - (startmat matrix :inline :offset-assert 240) + ((sync sync-info :inline) + (startmat matrix :inline) ) - :heap-base #xc0 - :method-count-assert 27 - :size-assert #x130 - :flag-assert #x1b00c00130 (:states snow-spatula-idle ) @@ -658,7 +642,7 @@ (let ((s5-2 (new 'stack-no-clear 'matrix))) (matrix-rotate-y! s5-2 (* 16384.0 f30-0)) (matrix*! s5-2 s5-2 (-> self startmat)) - (matrix->quaternion (-> self root-override quat) s5-2) + (matrix->quaternion (-> self root quat) s5-2) ) ) (suspend) @@ -668,7 +652,7 @@ :post plat-post ) -(defmethod init-from-entity! snow-spatula ((this snow-spatula) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-spatula) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -688,29 +672,25 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-spatula-sg* '()) (logior! (-> this skel status) (janim-status inited)) (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) - (quaternion->matrix (-> this startmat) (-> this root-override quat)) + (quaternion->matrix (-> this startmat) (-> this root quat)) (baseplat-method-21 this) (go snow-spatula-idle) (none) ) (deftype snow-fort-gate (process-drawable) - ((root-override collide-shape :offset 112) - (part2 sparticle-launch-control :offset-assert 176) - (part3 sparticle-launch-control :offset-assert 180) - (open-trans vector :inline :offset-assert 192) - (closed-trans vector :inline :offset-assert 208) + ((root collide-shape :override) + (part2 sparticle-launch-control) + (part3 sparticle-launch-control) + (open-trans vector :inline) + (closed-trans vector :inline) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xe0 - :flag-assert #x14007000e0 (:states snow-fort-gate-activate snow-fort-gate-idle-closed @@ -899,14 +879,14 @@ ) ) :trans (behavior () - (when (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id snow-fort-hint) "sksp0345" (the-as entity #f) *entity-pool* (game-task none)) (close-specific-task! (game-task snow-fort) (task-status need-hint)) ) ) :code (behavior () (ja :group! snow-fort-gate-idle-ja :num! min) - (set! (-> self root-override trans quad) (-> self closed-trans quad)) + (set! (-> self root trans quad) (-> self closed-trans quad)) (transform-post) (suspend) (loop @@ -934,7 +914,7 @@ (spawn (-> self part) a1-0) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self root-override trans quad)) + (set! (-> s5-0 quad) (-> self root trans quad)) (let ((f30-0 (vector-vector-distance-squared s5-0 (-> self open-trans)))) (when (and (not gp-0) (>= 1048576.0 f30-0)) (set! gp-0 #t) @@ -952,10 +932,10 @@ ) ) (vector-seek-3d-smooth! s5-0 (-> self open-trans) (* 16384.0 (seconds-per-frame)) 0.9) - (move-to-point! (-> self root-override) s5-0) + (move-to-point! (-> self root) s5-0) ) (let ((a1-7 (new 'stack-no-clear 'vector))) - (set! (-> a1-7 quad) (-> self root-override trans quad)) + (set! (-> a1-7 quad) (-> self root trans quad)) (+! (-> a1-7 x) 20480.0) (+! (-> a1-7 y) 106496.0) (+! (-> a1-7 z) -32768.0) @@ -972,7 +952,7 @@ (defstate snow-fort-gate-idle-open (snow-fort-gate) :code (behavior () (ja :group! snow-fort-gate-idle-ja :num! min) - (set! (-> self root-override trans quad) (-> self open-trans quad)) + (set! (-> self root trans quad) (-> self open-trans quad)) (transform-post) (suspend) (transform-post) @@ -983,7 +963,7 @@ ) ) -(defmethod deactivate snow-fort-gate ((this snow-fort-gate)) +(defmethod deactivate ((this snow-fort-gate)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -994,7 +974,7 @@ (none) ) -(defmethod relocate snow-fort-gate ((this snow-fort-gate) (arg0 int)) +(defmethod relocate ((this snow-fort-gate) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -1004,7 +984,7 @@ (call-parent-method this arg0) ) -(defmethod init-from-entity! snow-fort-gate ((this snow-fort-gate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-fort-gate) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object)) @@ -1017,14 +997,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-fort-gate-sg* '()) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 512) this)) (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 513) this)) (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 514) this)) - (set! (-> this open-trans quad) (-> this root-override trans quad)) + (set! (-> this open-trans quad) (-> this root trans quad)) (set! (-> this closed-trans quad) (-> this open-trans quad)) (+! (-> this open-trans y) -141312.0) (+! (-> this open-trans z) 32768.0) @@ -1042,12 +1022,12 @@ ) (cond ((task-complete? *game-info* (game-task snow-ball)) - (set! (-> this root-override trans quad) (-> this open-trans quad)) + (set! (-> this root trans quad) (-> this open-trans quad)) (transform-post) (go snow-fort-gate-idle-open) ) (else - (set! (-> this root-override trans quad) (-> this closed-trans quad)) + (set! (-> this root trans quad) (-> this closed-trans quad)) (transform-post) (go snow-fort-gate-idle-closed) ) @@ -1057,12 +1037,8 @@ (deftype snow-gears (process-drawable) () - :heap-base #x40 - :method-count-assert 21 - :size-assert #xb0 - :flag-assert #x15004000b0 (:methods - (snow-gears-method-20 (_type_) none 20) + (snow-gears-method-20 (_type_) none) ) (:states snow-gears-activate @@ -1142,7 +1118,7 @@ :init-specs ((:fade-a -0.14222223)) ) -(defmethod snow-gears-method-20 snow-gears ((this snow-gears)) +(defmethod snow-gears-method-20 ((this snow-gears)) (let ((a1-0 (new 'stack-no-clear 'vector))) (set! (-> a1-0 quad) (-> this root trans quad)) (+! (-> a1-0 y) 61440.0) @@ -1236,7 +1212,7 @@ ) ) -(defmethod init-from-entity! snow-gears ((this snow-gears) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-gears) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-gears-sg* '()) @@ -1249,15 +1225,11 @@ ) (deftype snow-switch (process-drawable) - ((root-override collide-shape-moving :offset 112) - (pressed? symbol :offset-assert 176) - (fcell-handle handle :offset-assert 184) - (orig-trans vector :inline :offset-assert 192) + ((root collide-shape-moving :override) + (pressed? symbol) + (fcell-handle handle) + (orig-trans vector :inline) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14006000d0 (:states snow-switch-activate snow-switch-idle-down @@ -1353,7 +1325,7 @@ (let ((s5-1 (new 'stack-no-clear 'vector)) (f0-1 (+ -1433.6 (-> self orig-trans y))) ) - (set! (-> s5-1 quad) (-> self root-override trans quad)) + (set! (-> s5-1 quad) (-> self root trans quad)) (cond ((= (-> s5-1 y) f0-1) (when (not gp-2) @@ -1362,10 +1334,8 @@ ) ) (else - (set! (-> s5-1 y) - (seek-with-smooth (-> self root-override trans y) f0-1 (* 6144.0 (seconds-per-frame)) 0.2 204.8) - ) - (move-to-point! (-> self root-override) s5-1) + (set! (-> s5-1 y) (seek-with-smooth (-> self root trans y) f0-1 (* 6144.0 (seconds-per-frame)) 0.2 204.8)) + (move-to-point! (-> self root) s5-1) ) ) ) @@ -1380,8 +1350,8 @@ :event snow-switch-event-handler :code (behavior () (set! (-> self pressed?) #t) - (set! (-> self root-override trans quad) (-> self orig-trans quad)) - (+! (-> self root-override trans y) -1433.6) + (set! (-> self root trans quad) (-> self orig-trans quad)) + (+! (-> self root trans y) -1433.6) (transform-post) (loop (logior! (-> self mask) (process-mask sleep-code)) @@ -1390,7 +1360,7 @@ ) ) -(defmethod init-from-entity! snow-switch ((this snow-switch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-switch) (arg0 entity-actor)) (set! (-> this pressed?) #f) (set! (-> this fcell-handle) (the-as handle #f)) (set! (-> this link) (new 'process 'actor-link-info this)) @@ -1412,7 +1382,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-switch-sg* '()) @@ -1427,7 +1397,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (set! (-> this orig-trans quad) (-> this root-override trans quad)) + (set! (-> this orig-trans quad) (-> this root trans quad)) (let ((s5-2 (task-complete? *game-info* (game-task snow-ball)))) (set! (-> this pressed?) s5-2) (when (not s5-2) @@ -1455,13 +1425,9 @@ ) (deftype snow-log (process-drawable) - ((root-override collide-shape-moving :offset 112) - (master entity-actor :offset-assert 176) + ((root collide-shape-moving :override) + (master entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states snow-log-activate snow-log-active @@ -1605,7 +1571,7 @@ :post rider-post ) -(defmethod init-from-entity! snow-log ((this snow-log) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-log) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -1624,16 +1590,16 @@ ) (set! (-> s4-0 nav-radius) 11264.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-log-sg* '()) (logior! (-> this skel status) (janim-status inited)) (logior! (-> this draw status) (draw-status hidden)) - (+! (-> this root-override trans x) -1024.0) - (+! (-> this root-override trans y) -4915.2) - (set-vector! (-> this root-override scale) 1.5 1.0 1.5 1.0) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (+! (-> this root trans x) -1024.0) + (+! (-> this root trans y) -4915.2) + (set-vector! (-> this root scale) 1.5 1.0 1.5 1.0) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (set! (-> this master) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> this draw origin-joint-index) (the-as uint 3)) (go snow-log-wait-for-master) @@ -1641,14 +1607,10 @@ ) (deftype snow-log-button (process-drawable) - ((root-override collide-shape-moving :offset 112) - (log entity-actor :offset-assert 176) - (orig-trans vector :inline :offset-assert 192) + ((root collide-shape-moving :override) + (log entity-actor) + (orig-trans vector :inline) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14006000d0 (:states snow-log-button-activate snow-log-button-idle-down @@ -1663,7 +1625,7 @@ (('touch 'bonk 'attack) (when (and (= (-> arg0 type) target) (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - (>= 6553.6 (vector-vector-xz-distance (target-pos 0) (-> self root-override trans))) + (>= 6553.6 (vector-vector-xz-distance (target-pos 0) (-> self root trans))) ) (process-entity-status! self (entity-perm-status complete) #t) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1707,7 +1669,7 @@ (sound-play "prec-button1") (loop (let ((f30-0 (+ -1433.6 (-> self orig-trans y)))) - (when (= (-> self root-override trans y) f30-0) + (when (= (-> self root trans y) f30-0) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 0) @@ -1725,8 +1687,8 @@ ) (go snow-log-button-idle-down) ) - (set! (-> self root-override trans y) - (seek-with-smooth (-> self root-override trans y) f30-0 (* 12288.0 (seconds-per-frame)) 0.2 204.8) + (set! (-> self root trans y) + (seek-with-smooth (-> self root trans y) f30-0 (* 12288.0 (seconds-per-frame)) 0.2 204.8) ) ) (suspend) @@ -1738,8 +1700,8 @@ (defstate snow-log-button-idle-down (snow-log-button) :event snow-log-button-event-handler :code (behavior () - (set! (-> self root-override trans quad) (-> self orig-trans quad)) - (+! (-> self root-override trans y) -1433.6) + (set! (-> self root trans quad) (-> self orig-trans quad)) + (+! (-> self root trans y) -1433.6) (transform-post) (loop (logior! (-> self mask) (process-mask sleep-code)) @@ -1748,7 +1710,7 @@ ) ) -(defmethod init-from-entity! snow-log-button ((this snow-log-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-log-button) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -1767,7 +1729,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-switch-sg* '()) @@ -1782,7 +1744,7 @@ (set! (-> s4-1 frame-num) 0.0) ) (transform-post) - (set! (-> this orig-trans quad) (-> this root-override trans quad)) + (set! (-> this orig-trans quad) (-> this root trans quad)) (set! (-> this log) (entity-actor-lookup arg0 'alt-actor 0)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go snow-log-button-idle-down) diff --git a/goal_src/jak1/levels/snow/snow-part.gc b/goal_src/jak1/levels/snow/snow-part.gc index ec896023c96..5917d2eab83 100644 --- a/goal_src/jak1/levels/snow/snow-part.gc +++ b/goal_src/jak1/levels/snow/snow-part.gc @@ -9,10 +9,6 @@ (deftype snow-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/snow/snow-ram-boss.gc b/goal_src/jak1/levels/snow/snow-ram-boss.gc index b2fb0dc5bf9..cccb8387b33 100644 --- a/goal_src/jak1/levels/snow/snow-ram-boss.gc +++ b/goal_src/jak1/levels/snow/snow-ram-boss.gc @@ -10,18 +10,14 @@ ;; DECOMP BEGINS (deftype ram-boss-proj (projectile) - ((parent-override (pointer ram-boss) :offset 12) - (part2 sparticle-launch-control :offset-assert 412) - (launched? symbol :offset-assert 416) - (growth float :offset-assert 420) - (charge-sound-id sound-id :offset-assert 424) - (launch-time time-frame :offset-assert 432) - (facing-dir vector :inline :offset-assert 448) + ((parent-override (pointer ram-boss) :overlay-at parent) + (part2 sparticle-launch-control) + (launched? symbol) + (growth float) + (charge-sound-id sound-id) + (launch-time time-frame) + (facing-dir vector :inline) ) - :heap-base #x160 - :method-count-assert 29 - :size-assert #x1d0 - :flag-assert #x1d016001d0 (:states ram-boss-proj-growing ram-boss-proj-launch @@ -30,30 +26,26 @@ (deftype ram-boss (nav-enemy) - ((parent-override (pointer ram) :offset 12) - (facing-y float :offset-assert 400) - (player-dir-y float :offset-assert 404) - (last-turn-speed float :offset-assert 408) - (frustration int32 :offset-assert 412) - (dead? symbol :offset-assert 416) - (has-shield? symbol :offset-assert 420) - (proj-stoked basic :offset-assert 424) - (proj-status uint64 :offset-assert 432) - (part2 sparticle-launch-control :offset-assert 440) - (proj-last-thrown-time time-frame :offset-assert 448) - (nav-enemy-patrol-timeout time-frame :offset-assert 456) - (proj-launch-vec vector :inline :offset-assert 464) - (local-throw-point vector :inline :offset-assert 480) - (shield-jmod joint-mod-set-local :offset-assert 496) + ((parent-override (pointer ram) :overlay-at parent) + (facing-y float) + (player-dir-y float) + (last-turn-speed float) + (frustration int32) + (dead? symbol) + (has-shield? symbol) + (proj-stoked basic) + (proj-status uint64) + (part2 sparticle-launch-control) + (proj-last-thrown-time time-frame) + (nav-enemy-patrol-timeout time-frame) + (proj-launch-vec vector :inline) + (local-throw-point vector :inline) + (shield-jmod joint-mod-set-local) ) - :heap-base #x190 - :method-count-assert 76 - :size-assert #x1f4 - :flag-assert #x4c019001f4 (:methods - (ram-boss-method-51 (_type_ vector) symbol :replace 51) - (ram-boss-method-52 (_type_) symbol :replace 52) - (ram-boss-method-57 (_type_ float) float :replace 57) + (ram-boss-method-51 (_type_ vector) symbol :overlay-at nav-enemy-method-51) + (ram-boss-method-52 (_type_) symbol :overlay-at nav-enemy-method-52) + (ram-boss-method-57 (_type_ float) float :overlay-at nav-enemy-method-57) ) (:states (ram-boss-already-down basic) @@ -456,21 +448,13 @@ :parts ((sp-item 1914)) ) -(defmethod projectile-method-24 ram-boss-proj ((this ram-boss-proj)) +(defmethod projectile-method-24 ((this ram-boss-proj)) (with-pp - (quaternion-rotate-local-x! - (-> this root-override quat) - (-> this root-override quat) - (* 65718.05 (seconds-per-frame)) - ) - (quaternion-rotate-local-y! - (-> this root-override quat) - (-> this root-override quat) - (* 32221.867 (seconds-per-frame)) - ) + (quaternion-rotate-local-x! (-> this root quat) (-> this root quat) (* 65718.05 (seconds-per-frame))) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) (* 32221.867 (seconds-per-frame))) (let ((f0-9 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (current-time) 75))))))))) (find-ground-and-draw-shadow - (-> this root-override trans) + (-> this root trans) (the-as vector #f) f0-9 (collide-kind background) @@ -480,12 +464,12 @@ ) ) (if (-> this launched?) - (spawn (-> this part2) (the-as vector (-> this root-override root-prim prim-core))) + (spawn (-> this part2) (the-as vector (-> this root root-prim prim-core))) ) (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) (set! (-> s5-0 id) (-> this sound-id)) - (let ((a1-4 (-> this root-override trans))) + (let ((a1-4 (-> this root trans))) (let ((gp-1 pp)) (when (= a1-4 #t) (if (and gp-1 (type-type? (-> gp-1 type) process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root))) @@ -505,14 +489,14 @@ (defun snow-ram-proj-update-velocity ((arg0 ram-boss-proj)) (when (>= (vector-vector-distance (-> arg0 parent-override 0 collide-info trans) (-> arg0 target)) - (vector-vector-distance (-> arg0 parent-override 0 collide-info trans) (-> arg0 root-override trans)) + (vector-vector-distance (-> arg0 parent-override 0 collide-info trans) (-> arg0 root trans)) ) - (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target) (-> arg0 root-override trans))) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target) (-> arg0 root trans))) (s4-0 (new 'stack-no-clear 'vector)) - (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) + (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root transv) 1.0)) ) - (if (logtest? (-> arg0 root-override status) (cshape-moving-flags tsurf)) - (vector-flatten! s3-1 s3-1 (-> arg0 root-override local-normal)) + (if (logtest? (-> arg0 root status) (cshape-moving-flags tsurf)) + (vector-flatten! s3-1 s3-1 (-> arg0 root local-normal)) ) (vector-normalize-copy! s4-0 s3-1 1.0) (let ((s3-2 (new 'stack-no-clear 'matrix))) @@ -526,20 +510,20 @@ (vector-matrix*! s5-0 s5-0 s3-2) ) (vector-normalize! s5-0 1.0) - (vector-float*! (-> arg0 root-override transv) s5-0 (-> arg0 max-speed)) + (vector-float*! (-> arg0 root transv) s5-0 (-> arg0 max-speed)) ) ) 0 (none) ) -(defmethod projectile-method-25 ram-boss-proj ((this ram-boss-proj)) +(defmethod projectile-method-25 ((this ram-boss-proj)) (go ram-boss-proj-growing) 0 (none) ) -(defmethod projectile-method-26 ram-boss-proj ((this ram-boss-proj)) +(defmethod projectile-method-26 ((this ram-boss-proj)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) @@ -559,13 +543,13 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod projectile-method-27 ram-boss-proj ((this ram-boss-proj)) +(defmethod projectile-method-27 ((this ram-boss-proj)) (set! (-> this charge-sound-id) (new 'static 'sound-id)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 521) this)) (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 522) this)) @@ -586,7 +570,7 @@ (none) ) -(defmethod deactivate ram-boss-proj ((this ram-boss-proj)) +(defmethod deactivate ((this ram-boss-proj)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -594,14 +578,14 @@ (none) ) -(defmethod relocate ram-boss-proj ((this ram-boss-proj) (arg0 int)) +(defmethod relocate ((this ram-boss-proj) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) (the-as ram-boss-proj ((method-of-type projectile relocate) this arg0)) ) -(defmethod projectile-method-28 ram-boss-proj ((this ram-boss-proj)) +(defmethod projectile-method-28 ((this ram-boss-proj)) (when (and *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) @@ -611,7 +595,7 @@ (let ((gp-0 (-> this target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (+! (-> gp-0 y) 4915.2) - (let ((f0-2 (vector-vector-distance gp-0 (-> this root-override trans))) + (let ((f0-2 (vector-vector-distance gp-0 (-> this root trans))) (a2-0 (new 'stack-no-clear 'vector)) ) (if (>= 0.0 f0-2) @@ -651,8 +635,8 @@ (sound-stop (-> self charge-sound-id)) (go-virtual projectile-dissipate) ) - (nav-enemy-method-54 (-> gp-1 0) (-> self root-override trans)) - (update-transforms! (-> self root-override)) + (nav-enemy-method-54 (-> gp-1 0) (-> self root trans)) + (update-transforms! (-> self root)) (cond ((-> gp-1 0 proj-stoked) (set! (-> gp-1 0 proj-stoked) #f) @@ -672,9 +656,9 @@ ) ) (let ((f0-6 (-> self growth))) - (set-vector! (-> self root-override scale) f0-6 f0-6 f0-6 1.0) + (set-vector! (-> self root scale) f0-6 f0-6 f0-6 1.0) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (suspend) ) ) @@ -685,9 +669,9 @@ (sound-play "ramboss-fire") (set! (-> self launched?) #t) (set! (-> self growth) 1.0) - (logior! (-> self root-override root-prim prim-core action) (collide-action solid)) + (logior! (-> self root root-prim prim-core action) (collide-action solid)) (set-time! (-> self launch-time)) - (vector-float*! (-> self root-override transv) (-> self parent-override 0 proj-launch-vec) 40960.0) + (vector-float*! (-> self root transv) (-> self parent-override 0 proj-launch-vec) 40960.0) (set! (-> self target quad) (-> (target-pos 0) quad)) (+! (-> self target y) 4915.2) (set! (-> self target-base quad) (-> self target quad)) @@ -706,7 +690,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (if (nonzero? (-> self sound-id)) @@ -729,7 +713,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (if (nonzero? (-> self sound-id)) @@ -974,7 +958,7 @@ ) ) -(defmethod deactivate ram-boss ((this ram-boss)) +(defmethod deactivate ((this ram-boss)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -982,7 +966,7 @@ (none) ) -(defmethod relocate ram-boss ((this ram-boss) (arg0 int)) +(defmethod relocate ((this ram-boss) (arg0 int)) (if (nonzero? (-> this shield-jmod)) (&+! (-> this shield-jmod) arg0) ) @@ -992,7 +976,7 @@ (the-as ram-boss ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod initialize-collision ram-boss ((this ram-boss)) +(defmethod initialize-collision ((this ram-boss)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1045,7 +1029,7 @@ (none) ) -(defmethod ram-boss-method-52 ram-boss ((this ram-boss)) +(defmethod ram-boss-method-52 ((this ram-boss)) (let ((v1-1 (the-as basic (-> this collide-info root-prim)))) (set-vector! (-> (the-as collide-shape-prim v1-1) local-sphere) 0.0 8192.0 0.0 13516.8) (set-vector! (-> (the-as (array collide-shape-prim) v1-1) 16 local-sphere) 0.0 4096.0 0.0 4505.6) @@ -1066,7 +1050,7 @@ ) ) -(defmethod nav-enemy-method-53 ram-boss ((this ram-boss)) +(defmethod nav-enemy-method-53 ((this ram-boss)) (let ((v1-1 (the-as (array collide-shape-prim) (-> this collide-info root-prim)))) (let ((a0-1 (-> v1-1 16))) (set! (-> a0-1 prim-core offense) (collide-offense touch)) @@ -1087,7 +1071,7 @@ (the-as symbol 0) ) -(defmethod nav-enemy-method-48 ram-boss ((this ram-boss)) +(defmethod nav-enemy-method-48 ((this ram-boss)) (initialize-skeleton this *ram-boss-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) (init-defaults! this *ram-boss-nav-enemy-info*) @@ -1143,7 +1127,7 @@ (none) ) -(defmethod nav-enemy-method-54 ram-boss ((this ram-boss) (arg0 vector)) +(defmethod nav-enemy-method-54 ((this ram-boss) (arg0 vector)) (let ((a2-0 (-> this node-list data 18 bone transform))) (set-vector! arg0 0.0 0.0 -2457.6 1.0) (vector-matrix*! arg0 arg0 a2-0) @@ -1151,7 +1135,7 @@ (the-as symbol (vector-float*! arg0 arg0 (/ 1.0 (-> arg0 w)))) ) -(defmethod nav-enemy-method-55 ram-boss ((this ram-boss)) +(defmethod nav-enemy-method-55 ((this ram-boss)) (if (not *target*) (return #f) ) @@ -1187,7 +1171,7 @@ ) ) -(defmethod ram-boss-method-51 ram-boss ((this ram-boss) (arg0 vector)) +(defmethod ram-boss-method-51 ((this ram-boss) (arg0 vector)) (let* ((f30-0 (quaternion-y-angle (-> this collide-info quat))) (f0-2 (atan (-> arg0 x) (-> arg0 z))) (f0-3 (deg- f30-0 f0-2)) @@ -1202,7 +1186,7 @@ #t ) -(defmethod set-jump-height-factor! ram-boss ((this ram-boss) (arg0 int)) +(defmethod set-jump-height-factor! ((this ram-boss) (arg0 int)) (cond ((zero? (-> this proj-status)) (when (and *target* (time-elapsed? (-> this proj-last-thrown-time) (seconds 2))) @@ -1503,7 +1487,7 @@ ) ) -(defmethod ram-boss-method-57 ram-boss ((this ram-boss) (arg0 float)) +(defmethod ram-boss-method-57 ((this ram-boss) (arg0 float)) (let ((f0-0 0.0)) (when *target* (let ((s3-0 (new 'stack-no-clear 'vector))) diff --git a/goal_src/jak1/levels/snow/snow-ram-h.gc b/goal_src/jak1/levels/snow/snow-ram-h.gc index 51a845c283a..08182b0a9a4 100644 --- a/goal_src/jak1/levels/snow/snow-ram-h.gc +++ b/goal_src/jak1/levels/snow/snow-ram-h.gc @@ -8,22 +8,18 @@ ;; DECOMP BEGINS (deftype ram (process-drawable) - ((root-override collide-shape-moving :offset 112) - (ram-id int32 :offset-assert 176) - (give-fuel-cell? symbol :offset-assert 180) - (give-fuel-cell-anim spool-anim :offset-assert 184) - (part2 sparticle-launch-control :offset-assert 188) - (orient-ry float :offset-assert 192) - (fuel-cell-dest-pos vector :inline :offset-assert 208) + ((root collide-shape-moving :override) + (ram-id int32) + (give-fuel-cell? symbol) + (give-fuel-cell-anim spool-anim) + (part2 sparticle-launch-control) + (orient-ry float) + (fuel-cell-dest-pos vector :inline) ) - :heap-base #x70 - :method-count-assert 23 - :size-assert #xe0 - :flag-assert #x17007000e0 (:methods - (ram-method-20 (_type_) object 20) - (ram-method-21 (_type_) object 21) - (ram-method-22 (_type_) symbol 22) + (ram-method-20 (_type_) object) + (ram-method-21 (_type_) object) + (ram-method-22 (_type_) symbol) ) (:states ram-fun-idle diff --git a/goal_src/jak1/levels/snow/snow-ram.gc b/goal_src/jak1/levels/snow/snow-ram.gc index a4158db773d..2485cf0ff21 100644 --- a/goal_src/jak1/levels/snow/snow-ram.gc +++ b/goal_src/jak1/levels/snow/snow-ram.gc @@ -107,7 +107,7 @@ ) ) -(defmethod ram-method-20 ram ((this ram)) +(defmethod ram-method-20 ((this ram)) (let ((gp-0 (-> this part))) (when (nonzero? gp-0) (let ((a2-0 (-> this node-list data 8 bone transform)) @@ -122,7 +122,7 @@ ) ) -(defmethod ram-method-21 ram ((this ram)) +(defmethod ram-method-21 ((this ram)) (let ((gp-0 (-> this part2))) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -153,7 +153,7 @@ ) ) -(defmethod ram-method-22 ram ((this ram)) +(defmethod ram-method-22 ((this ram)) (process-entity-status! this (entity-perm-status complete) #t) (let ((v1-0 (alt-actor-list-subtask-incomplete-count this))) (cond @@ -183,7 +183,7 @@ (('touch 'attack) (if ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) (send-event @@ -236,7 +236,7 @@ (logior! (-> self mask) (process-mask actor-pause)) (set! sv-16 (the-as symbol #f)) (apply-function-forward (-> self link) actor-link-dead-hook (& sv-16)) - (when (or sv-16 (nonzero? (-> self root-override riders num-riders))) + (when (or sv-16 (nonzero? (-> self root riders num-riders))) (let ((v1-67 (-> self entity extra perm))) (logior! (-> v1-67 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-67 user-int8 0) 1) @@ -304,7 +304,7 @@ (let ((v1-14 (process-spawn snowcam :init pov-camera-init-by-other - (-> self root-override trans) + (-> self root trans) *snowcam-sg* (-> self give-fuel-cell-anim) 0 @@ -325,7 +325,7 @@ ) ) -(defmethod deactivate ram ((this ram)) +(defmethod deactivate ((this ram)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -333,14 +333,14 @@ (none) ) -(defmethod relocate ram ((this ram) (arg0 int)) +(defmethod relocate ((this ram) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) (the-as ram ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod init-from-entity! ram ((this ram) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ram) (arg0 entity-actor)) (set! (-> this give-fuel-cell?) #f) (set! (-> this link) (new 'process 'actor-link-info this)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) @@ -385,15 +385,15 @@ ) (set! (-> s4-0 nav-radius) 20480.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *ram-sg* '()) (logior! (-> this skel status) (janim-status inited)) (ja-post) - (update-transforms! (-> this root-override)) - (set! (-> this orient-ry) (quaternion-y-angle (-> this root-override quat))) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (update-transforms! (-> this root)) + (set! (-> this orient-ry) (quaternion-y-angle (-> this root quat))) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 526) this)) (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 527) this)) (set! (-> this ram-id) (res-lump-value arg0 'extra-id int)) diff --git a/goal_src/jak1/levels/snow/target-snowball.gc b/goal_src/jak1/levels/snow/target-snowball.gc index 824f46d61af..59fdd5ef9e0 100644 --- a/goal_src/jak1/levels/snow/target-snowball.gc +++ b/goal_src/jak1/levels/snow/target-snowball.gc @@ -9,19 +9,13 @@ ;; DECOMP BEGINS (deftype snowball-info (basic) - ((entity basic :offset-assert 4) + ((entity basic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype snowball-bank (basic) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) diff --git a/goal_src/jak1/levels/snow/yeti.gc b/goal_src/jak1/levels/snow/yeti.gc index ebd02e0ef11..7a29b752b11 100644 --- a/goal_src/jak1/levels/snow/yeti.gc +++ b/goal_src/jak1/levels/snow/yeti.gc @@ -11,13 +11,9 @@ ;; DECOMP BEGINS (deftype yeti-slave (nav-enemy) - ((ground-y float :offset-assert 400) - (part2 sparticle-launch-control :offset-assert 404) + ((ground-y float) + (part2 sparticle-launch-control) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x198 - :flag-assert #x4c01300198 (:states yeti-slave-appear-jump-up yeti-slave-appear-land @@ -27,21 +23,17 @@ (deftype yeti (process-drawable) - ((child-process (pointer yeti-slave) :offset 20) - (desired-num-children int32 :offset-assert 176) - (spawn-delay int32 :offset-assert 180) - (first-time-spawn-dist float :offset-assert 184) - (unknown basic :offset-assert 188) - (unknown1 basic :offset-assert 192) - (unknown2 basic :offset-assert 196) + ((child-process (pointer yeti-slave) :overlay-at child) + (desired-num-children int32) + (spawn-delay int32) + (first-time-spawn-dist float) + (unknown basic) + (unknown1 basic) + (unknown2 basic) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16006000c8 (:methods - (yeti-method-20 (_type_ vector vector) symbol 20) - (aggro? (_type_ vector) symbol 21) + (yeti-method-20 (_type_ vector vector) symbol) + (aggro? (_type_ vector) symbol) ) (:states yeti-first-time-start @@ -471,7 +463,7 @@ ) ) -(defmethod initialize-collision yeti-slave ((this yeti-slave)) +(defmethod initialize-collision ((this yeti-slave)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -518,7 +510,7 @@ (none) ) -(defmethod nav-enemy-method-48 yeti-slave ((this yeti-slave)) +(defmethod nav-enemy-method-48 ((this yeti-slave)) (initialize-skeleton this *yeti-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) (init-defaults! this *yeti-nav-enemy-info*) @@ -529,7 +521,7 @@ (none) ) -(defmethod deactivate yeti-slave ((this yeti-slave)) +(defmethod deactivate ((this yeti-slave)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -537,7 +529,7 @@ (none) ) -(defmethod relocate yeti-slave ((this yeti-slave) (arg0 int)) +(defmethod relocate ((this yeti-slave) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -560,7 +552,7 @@ (none) ) -(defmethod aggro? yeti ((this yeti) (arg0 vector)) +(defmethod aggro? ((this yeti) (arg0 vector)) (let ((s5-0 (the-as (pointer process-tree) (-> this child-process)))) (while s5-0 (if (< (vector-vector-xz-distance-squared arg0 (-> (the-as (pointer yeti-slave) s5-0) 0 collide-info trans)) @@ -579,7 +571,7 @@ #t ) -(defmethod yeti-method-20 yeti ((this yeti) (arg0 vector) (arg1 vector)) +(defmethod yeti-method-20 ((this yeti) (arg0 vector) (arg1 vector)) (let ((s3-0 (-> this path curve num-cverts))) (if (<= s3-0 0) (return #f) @@ -691,7 +683,7 @@ ) ) -(defmethod init-from-entity! yeti ((this yeti) (arg0 entity-actor)) +(defmethod init-from-entity! ((this yeti) (arg0 entity-actor)) (set! (-> this spawn-delay) 0) (set! (-> this root) (new 'process 'trsqv)) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) diff --git a/goal_src/jak1/levels/sunken/bully.gc b/goal_src/jak1/levels/sunken/bully.gc index 58817f53701..271d222fb49 100644 --- a/goal_src/jak1/levels/sunken/bully.gc +++ b/goal_src/jak1/levels/sunken/bully.gc @@ -10,12 +10,8 @@ ;; DECOMP BEGINS (deftype bully-broken-cage (process-drawable) - ((parent-override (pointer bully) :offset 12) + ((parent-override (pointer bully) :overlay-at parent) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states bully-broken-cage-explode ) @@ -23,28 +19,24 @@ (deftype bully (process-drawable) - ((root-override collide-shape-moving :offset 112) - (fact-override fact-info-enemy :offset 144) - (hit-player? symbol :offset-assert 176) - (bounced? symbol :offset-assert 180) - (bounce-volume int32 :offset-assert 184) - (facing-ry float :offset-assert 188) - (travel-ry float :offset-assert 192) - (speed-u float :offset-assert 196) - (spin-vel float :offset-assert 200) - (travel-speed float :offset-assert 204) - (reaction-delay time-frame :offset-assert 208) - (start-spin-time time-frame :offset-assert 216) - (slow-down time-frame :offset-assert 224) - (hit-player-time time-frame :offset-assert 232) - (neck joint-mod :offset-assert 240) + ((root collide-shape-moving :override) + (fact fact-info-enemy :override) + (hit-player? symbol) + (bounced? symbol) + (bounce-volume int32) + (facing-ry float) + (travel-ry float) + (speed-u float) + (spin-vel float) + (travel-speed float) + (reaction-delay time-frame) + (start-spin-time time-frame) + (slow-down time-frame) + (hit-player-time time-frame) + (neck joint-mod) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #xf4 - :flag-assert #x15009000f4 (:methods - (bully-method-20 (_type_) float 20) + (bully-method-20 (_type_) float) ) (:states bully-die @@ -231,9 +223,9 @@ (defbehavior bully-broken-cage-init-by-other bully-broken-cage ((arg0 entity-actor)) (set! (-> self entity) arg0) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> self parent-override 0 root-override trans quad)) - (quaternion-copy! (-> self root quat) (-> self parent-override 0 root-override quat)) - (set! (-> self root scale quad) (-> self parent-override 0 root-override scale quad)) + (set! (-> self root trans quad) (-> self parent-override 0 root trans quad)) + (quaternion-copy! (-> self root quat) (-> self parent-override 0 root quat)) + (set! (-> self root scale quad) (-> self parent-override 0 root scale quad)) (initialize-skeleton self *bully-broken-cage-sg* '()) (go bully-broken-cage-explode) (none) @@ -247,7 +239,7 @@ (cond ((= (-> arg0 type) bully) (let ((v1-3 (new 'stack-no-clear 'vector))) - (vector-! v1-3 (-> self root-override trans) (-> (the-as process-drawable arg0) root trans)) + (vector-! v1-3 (-> self root trans) (-> (the-as process-drawable arg0) root trans)) (set! (-> self travel-ry) (atan (-> v1-3 x) (-> v1-3 z))) ) (set! (-> self bounced?) #t) @@ -264,13 +256,13 @@ ) ((or (= arg2 'touch) (= arg2 'attack)) (cond - ((>= (- (-> (target-pos 0) y) (-> self root-override trans y)) 6144.0) + ((>= (- (-> (target-pos 0) y) (-> self root trans y)) 6144.0) (let* ((f0-6 (fmax 0.6 (* 0.000023935356 (-> self travel-speed)))) (f28-0 (* 8192.0 f0-6)) (f30-0 (* 8192.0 f0-6)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector-! s4-0 (target-pos 0) (-> self root-override trans)) + (vector-! s4-0 (target-pos 0) (-> self root trans)) (let ((f26-0 (atan (-> s4-0 x) (-> s4-0 z)))) (when (< 0.0 (-> self travel-speed)) (let ((f0-11 (deg- f26-0 (-> self travel-ry)))) @@ -319,7 +311,7 @@ (set! (-> self bounced?) #t) (set! (-> self bounce-volume) 100) (set-time! (-> self hit-player-time)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) + (set-collide-offense (-> self root) 2 (collide-offense no-offense)) ) ) ) @@ -367,14 +359,14 @@ ) ) ) - (set-collide-offense (-> self root-override) 2 (collide-offense normal-attack)) + (set-collide-offense (-> self root) 2 (collide-offense normal-attack)) (set! (-> self hit-player?) #f) ) (transform-post) (none) ) -(defmethod bully-method-20 bully ((this bully)) +(defmethod bully-method-20 ((this bully)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -382,7 +374,7 @@ ) (init-vf0-vector) (set-vector! - (-> this root-override transv) + (-> this root transv) (* (sin (-> this travel-ry)) (-> this travel-speed)) 0.0 (* (cos (-> this travel-ry)) (-> this travel-speed)) @@ -391,7 +383,7 @@ (let ((s5-1 #f)) (nav-control-method-28 (-> this nav) (collide-kind wall-object ground-object)) (let ((v1-4 (-> this nav travel))) - (.lvf vf1 (&-> (-> this root-override transv) quad)) + (.lvf vf1 (&-> (-> this root transv) quad)) (let ((f0-8 (seconds-per-frame))) (.mov at-0 f0-8) ) @@ -406,34 +398,33 @@ (set! (-> s5-2 quad) (-> s4-0 normal quad)) (set! (-> s5-2 y) 0.0) (vector-normalize! s5-2 1.0) - (vector-reflect! (-> this root-override transv) (-> this root-override transv) s5-2) + (vector-reflect! (-> this root transv) (-> this root transv) s5-2) ) - (set! (-> this travel-ry) (atan (-> this root-override transv x) (-> this root-override transv z))) + (set! (-> this travel-ry) (atan (-> this root transv x) (-> this root transv z))) (+! (-> this travel-ry) (rand-vu-float-range -910.2222 910.2222)) - (vector-reset! (-> this root-override transv)) + (vector-reset! (-> this root transv)) (set! s5-1 #t) (set! (-> this bounced?) #t) (set! (-> this bounce-volume) 100) ) ) (when (not s5-1) - (vector-normalize-copy! (-> this nav travel) (-> this root-override transv) 2048.0) + (vector-normalize-copy! (-> this nav travel) (-> this root transv) 2048.0) (let ((s5-3 (new 'stack 'clip-travel-vector-to-mesh-return-info))) (nav-control-method-24 (-> this nav) 2048.0 s5-3) - (when (and (-> s5-3 found-boundary) - (>= (* (-> this travel-speed) (seconds-per-frame)) - (vector-vector-xz-distance (-> s5-3 intersection) (-> this root-override trans)) - ) + (when (and (-> s5-3 found-boundary) (>= (* (-> this travel-speed) (seconds-per-frame)) + (vector-vector-xz-distance (-> s5-3 intersection) (-> this root trans)) + ) ) (let ((s4-1 (new 'stack-no-clear 'vector))) (vector-negate! s4-1 (-> s5-3 boundary-normal)) (set! (-> s4-1 y) 0.0) (vector-normalize! s4-1 1.0) - (vector-reflect! (-> this root-override transv) (-> this root-override transv) s4-1) + (vector-reflect! (-> this root transv) (-> this root transv) s4-1) ) - (set! (-> this travel-ry) (atan (-> this root-override transv x) (-> this root-override transv z))) + (set! (-> this travel-ry) (atan (-> this root transv x) (-> this root transv z))) (+! (-> this travel-ry) (rand-vu-float-range -910.2222 910.2222)) - (vector-reset! (-> this root-override transv)) + (vector-reset! (-> this root transv)) #t (set! (-> this bounced?) #t) (set! (-> this bounce-volume) 60) @@ -441,7 +432,7 @@ ) ) ) - (set! (-> this root-override transv y) (+ -36864.0 (-> this root-override transv y))) + (set! (-> this root transv y) (+ -36864.0 (-> this root transv y))) ) ) @@ -464,9 +455,8 @@ 0 ) :trans (behavior () - (when (and (and *target* (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (when (and (and *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (time-elapsed? (-> self state-time) (-> self reaction-delay)) ) @@ -497,7 +487,7 @@ (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -508,18 +498,18 @@ :code (behavior () (set! (-> self travel-speed) 0.0) (ja-channel-push! 1 (seconds 0.075)) - (set-vector! (-> self root-override transv) 0.0 (rand-vu-float-range 61440.0 90112.0) 0.0 1.0) + (set-vector! (-> self root transv) 0.0 (rand-vu-float-range 61440.0 90112.0) 0.0 1.0) (ja-no-eval :group! bully-notice-jump-up-ja :num! (seek! (ja-aframe 13.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 13.0 0))) ) - (until (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) + (until (logtest? (-> self root status) (cshape-moving-flags onsurf)) (ja :num! (seek!)) - (+! (-> self root-override transv y) (* -545996.8 (seconds-per-frame))) + (+! (-> self root transv y) (* -545996.8 (seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! - (-> self root-override) - (-> self root-override transv) + (-> self root) + (-> self root transv) (collide-kind background) 12288.0 #f @@ -528,10 +518,10 @@ ) (when *target* (let ((gp-3 (new 'stack-no-clear 'vector))) - (vector-! gp-3 (target-pos 0) (-> self root-override trans)) - (seek-toward-heading-vec! (-> self root-override) gp-3 524288.0 (seconds 0.1)) + (vector-! gp-3 (target-pos 0) (-> self root trans)) + (seek-toward-heading-vec! (-> self root) gp-3 524288.0 (seconds 0.1)) ) - (set! (-> self facing-ry) (quaternion-y-angle (-> self root-override quat))) + (set! (-> self facing-ry) (quaternion-y-angle (-> self root quat))) ) (suspend) ) @@ -555,8 +545,8 @@ (set! (-> self bounced?) #f) (let ((gp-0 (new 'stack-no-clear 'vector))) (if *target* - (vector-! gp-0 (target-pos 0) (-> self root-override trans)) - (vector-z-quaternion! gp-0 (-> self root-override quat)) + (vector-! gp-0 (target-pos 0) (-> self root trans)) + (vector-z-quaternion! gp-0 (-> self root quat)) ) (set! (-> self travel-ry) (atan (-> gp-0 x) (-> gp-0 z))) ) @@ -567,7 +557,7 @@ (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -588,11 +578,11 @@ (set! (-> self spin-vel) (* 196608.0 (-> self speed-u))) (set! (-> self travel-speed) (* 41779.2 (-> self speed-u))) (+! (-> self facing-ry) (* (-> self spin-vel) (seconds-per-frame))) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> self facing-ry)) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (-> self facing-ry)) (bully-method-20 self) (integrate-for-enemy-with-move-to-ground! - (-> self root-override) - (-> self root-override transv) + (-> self root) + (-> self root transv) (collide-kind background) 8192.0 #f @@ -651,7 +641,7 @@ (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -695,9 +685,8 @@ ) ) ) - (if (or (not *target*) (< (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (or (not *target*) + (< (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (go bully-idle #f) ) @@ -712,9 +701,9 @@ (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) (process-spawn bully-broken-cage (-> self entity) :to self) - (spawn (-> self part) (-> self root-override trans)) - (clear-collide-with-as (-> self root-override)) - (drop-pickup (-> self fact-override) #t *entity-pool* (-> self fact-override) 0) + (spawn (-> self part) (-> self root trans)) + (clear-collide-with-as (-> self root)) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0) (ja-channel-push! 1 (seconds 0.075)) (ja-no-eval :group! bully-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -730,14 +719,14 @@ :post transform-post ) -(defmethod relocate bully ((this bully) (arg0 int)) +(defmethod relocate ((this bully) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) (call-parent-method this arg0) ) -(defmethod init-from-entity! bully ((this bully) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bully) (arg0 entity-actor)) (set! (-> this hit-player?) #f) (set! (-> this bounced?) #f) (set! (-> this bounce-volume) 100) @@ -776,17 +765,17 @@ ) (set! (-> s4-0 nav-radius) 7680.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> this root-override event-self) 'touched) - (set! (-> this root-override event-other) 'touch) + (set! (-> this root event-self) 'touched) + (set! (-> this root event-other) 'touch) (process-drawable-from-entity! this arg0) (initialize-skeleton this *bully-sg* '()) (set! (-> this draw shadow-ctrl) *bully-shadow-control*) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 454) this)) - (set! (-> this fact-override) + (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (let ((v1-49 (new 'process 'joint-mod (joint-mod-handler-mode reset) this 5))) @@ -799,10 +788,10 @@ (set! (-> v1-49 ignore-angle) 16384.0) ) (transform-post) - (if (not (move-to-ground (-> this root-override) 12288.0 40960.0 #t (collide-kind background))) + (if (not (move-to-ground (-> this root) 12288.0 40960.0 #t (collide-kind background))) (go process-drawable-art-error "no ground") ) - (set! (-> this facing-ry) (quaternion-y-angle (-> this root-override quat))) + (set! (-> this facing-ry) (quaternion-y-angle (-> this root quat))) (go bully-idle #t) (none) ) diff --git a/goal_src/jak1/levels/sunken/double-lurker.gc b/goal_src/jak1/levels/sunken/double-lurker.gc index 52ddcbd4994..7a71a5d0798 100644 --- a/goal_src/jak1/levels/sunken/double-lurker.gc +++ b/goal_src/jak1/levels/sunken/double-lurker.gc @@ -10,13 +10,9 @@ ;; DECOMP BEGINS (deftype double-lurker-top (nav-enemy) - ((parent-process (pointer double-lurker) :offset 12) - (fall-dest vector :inline :offset-assert 400) + ((parent-process (pointer double-lurker) :overlay-at parent) + (fall-dest vector :inline) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x1a0 - :flag-assert #x4c013001a0 (:states (double-lurker-top-knocked-down object vector vector) double-lurker-top-on-shoulders @@ -27,19 +23,15 @@ (deftype double-lurker (nav-enemy) - ((knocked-back-speed float :offset-assert 400) - (buddy-on-shoulders? symbol :offset-assert 404) - (dead? symbol :offset-assert 408) - (buddy-dead? symbol :offset-assert 412) - (buddy-handle handle :offset-assert 416) + ((knocked-back-speed float) + (buddy-on-shoulders? symbol) + (dead? symbol) + (buddy-dead? symbol) + (buddy-handle handle) ) - :heap-base #x140 - :method-count-assert 76 - :size-assert #x1a8 - :flag-assert #x4c014001a8 (:methods - (initialize-collision (_type_) collide-shape-moving :replace 47) - (double-lurker-method-53 (_type_ vector) symbol :replace 53) + (initialize-collision (_type_) collide-shape-moving :replace) + (double-lurker-method-53 (_type_ vector) symbol :overlay-at nav-enemy-method-53) ) (:states double-lurker-both-knocked-back @@ -387,14 +379,14 @@ ) ) -(defmethod nav-enemy-method-51 double-lurker-top ((this double-lurker-top)) +(defmethod nav-enemy-method-51 ((this double-lurker-top)) (restore-collide-with-as (-> this collide-info)) (logior! (-> this collide-info nav-flags) (nav-flags navf0)) (nav-control-method-27 (-> this nav)) (none) ) -(defmethod initialize-collision double-lurker-top ((this double-lurker-top)) +(defmethod initialize-collision ((this double-lurker-top)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -464,7 +456,7 @@ (none) ) -(defmethod nav-enemy-method-48 double-lurker-top ((this double-lurker-top)) +(defmethod nav-enemy-method-48 ((this double-lurker-top)) (initialize-skeleton this *double-lurker-top-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) (init-defaults! this *double-lurker-top-nav-enemy-info*) @@ -753,7 +745,7 @@ :post nav-enemy-simple-post ) -(defmethod nav-enemy-method-52 double-lurker ((this double-lurker) (arg0 vector)) +(defmethod nav-enemy-method-52 ((this double-lurker) (arg0 vector)) (nav-control-method-28 (-> this nav) (the-as collide-kind -1)) (let ((a1-2 (new 'stack-no-clear 'vector))) (vector-float*! a1-2 (-> this hit-from-dir) 22937.602) @@ -903,7 +895,7 @@ ) ) -(defmethod double-lurker-method-53 double-lurker ((this double-lurker) (arg0 vector)) +(defmethod double-lurker-method-53 ((this double-lurker) (arg0 vector)) (let* ((s3-0 (-> this path curve num-cverts)) (s4-0 (rand-vu-int-count s3-0)) ) @@ -918,7 +910,7 @@ #f ) -(defmethod initialize-collision double-lurker ((this double-lurker)) +(defmethod initialize-collision ((this double-lurker)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1011,7 +1003,7 @@ ) ) -(defmethod nav-enemy-method-51 double-lurker ((this double-lurker)) +(defmethod nav-enemy-method-51 ((this double-lurker)) (let ((v1-1 (-> this collide-info root-prim))) (let ((a0-1 0)) (dotimes (a1-0 3) @@ -1036,7 +1028,7 @@ (none) ) -(defmethod nav-enemy-method-48 double-lurker ((this double-lurker)) +(defmethod nav-enemy-method-48 ((this double-lurker)) (set! (-> this buddy-handle) (the-as handle #f)) (process-drawable-from-entity! this (-> this entity)) (set! (-> this align) (new 'process 'align-control this)) @@ -1092,7 +1084,7 @@ (none) ) -(defmethod init-from-entity! double-lurker ((this double-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this double-lurker) (arg0 entity-actor)) (initialize-collision this) (nav-enemy-method-48 this) (if (-> this dead?) diff --git a/goal_src/jak1/levels/sunken/floating-launcher.gc b/goal_src/jak1/levels/sunken/floating-launcher.gc index ca7643f19e4..9b5228fdb50 100644 --- a/goal_src/jak1/levels/sunken/floating-launcher.gc +++ b/goal_src/jak1/levels/sunken/floating-launcher.gc @@ -8,13 +8,9 @@ ;; DECOMP BEGINS (deftype floating-launcher (baseplat) - ((trigger-height float :offset-assert 228) - (launcher (pointer launcher) :offset-assert 232) + ((trigger-height float) + (launcher (pointer launcher)) ) - :heap-base #x80 - :method-count-assert 27 - :size-assert #xec - :flag-assert #x1b008000ec (:states floating-launcher-idle floating-launcher-lowering @@ -32,9 +28,7 @@ :event plat-event :trans (behavior () (plat-trans) - (when (< (vector-xz-length (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root-override trans))) - 81920.0 - ) + (when (< (vector-xz-length (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans))) 81920.0) (if (and (>= (-> (target-pos 0) y) (-> self trigger-height)) (logtest? (-> *target* control status) (cshape-moving-flags onground)) ) @@ -67,14 +61,14 @@ (while (!= f30-0 0.0) (set! f30-0 (seek f30-0 0.0 (seconds-per-frame))) (eval-path-curve-div! (-> self path) (-> self basetrans) f30-0 'interp) - (set! (-> self launcher 0 root-override trans quad) (-> self basetrans quad)) - (update-transforms! (-> self launcher 0 root-override)) + (set! (-> self launcher 0 root trans quad) (-> self basetrans quad)) + (update-transforms! (-> self launcher 0 root)) (suspend) ) ) (eval-path-curve-div! (-> self path) (-> self basetrans) 0.0 'interp) - (set! (-> self launcher 0 root-override trans quad) (-> self basetrans quad)) - (update-transforms! (-> self launcher 0 root-override)) + (set! (-> self launcher 0 root trans quad) (-> self basetrans quad)) + (update-transforms! (-> self launcher 0 root)) (go floating-launcher-ready) ) :post plat-post @@ -87,7 +81,7 @@ :post plat-post ) -(defmethod init-from-entity! floating-launcher ((this floating-launcher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this floating-launcher) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -107,18 +101,18 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) - (eval-path-curve-div! (-> this path) (-> this root-override trans) 1.0 'interp) + (eval-path-curve-div! (-> this path) (-> this root trans) 1.0 'interp) (let ((f30-0 (res-lump-float arg0 'spring-height :default 163840.0))) - (set! (-> this launcher) (process-spawn launcher (-> this root-override trans) f30-0 0 81920.0 :to this)) + (set! (-> this launcher) (process-spawn launcher (-> this root trans) f30-0 0 81920.0 :to this)) ) (initialize-skeleton this *floating-launcher-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (baseplat-method-21 this) (set! (-> this trigger-height) (res-lump-float arg0 'trigger-height)) (go floating-launcher-idle) diff --git a/goal_src/jak1/levels/sunken/helix-water.gc b/goal_src/jak1/levels/sunken/helix-water.gc index a5a10148a02..d41514f8464 100644 --- a/goal_src/jak1/levels/sunken/helix-water.gc +++ b/goal_src/jak1/levels/sunken/helix-water.gc @@ -15,12 +15,8 @@ ;; DECOMP BEGINS (deftype helix-slide-door (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states helix-slide-door-close helix-slide-door-idle-closed @@ -35,17 +31,13 @@ ) (deftype helix-button (process-drawable) - ((root-override collide-shape-moving :offset 112) - (my-water entity-actor :offset-assert 176) - (my-door entity-actor :offset-assert 180) - (fcell-handle handle :offset-assert 184) - (down-y float :offset-assert 192) - (spawn-trans vector :inline :offset-assert 208) + ((root collide-shape-moving :override) + (my-water entity-actor) + (my-door entity-actor) + (fcell-handle handle) + (down-y float) + (spawn-trans vector :inline) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xe0 - :flag-assert #x14007000e0 (:states helix-button-activate helix-button-idle-down @@ -63,28 +55,20 @@ (deftype helix-dark-eco (dark-eco-pool) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) (deftype helix-water (process-drawable) - ((last-alt-actor-consumed int32 :offset-assert 176) - (alt-actors (array entity-actor) :offset-assert 180) - (transv-y float :offset-assert 184) - (start-y float :offset-assert 188) - (end-y float :offset-assert 192) - (dark-eco (pointer helix-dark-eco) :offset-assert 196) + ((last-alt-actor-consumed int32) + (alt-actors (array entity-actor)) + (transv-y float) + (start-y float) + (end-y float) + (dark-eco (pointer helix-dark-eco)) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16006000c8 (:methods - (helix-water-method-20 (_type_) none 20) - (helix-water-method-21 (_type_) object 21) + (helix-water-method-20 (_type_) none) + (helix-water-method-21 (_type_) object) ) (:states helix-water-activated @@ -174,7 +158,7 @@ ) ) -(defmethod init-from-entity! helix-slide-door ((this helix-slide-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this helix-slide-door) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) @@ -187,7 +171,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *helix-slide-door-sg* '()) @@ -202,7 +186,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! *helix-slide-door* this) (go helix-slide-door-idle-open) (none) @@ -212,7 +196,7 @@ :code (behavior () (when (not (task-complete? *game-info* (game-task sunken-slide))) (let ((a0-1 (new 'stack-no-clear 'vector))) - (set! (-> a0-1 quad) (-> self root-override trans quad)) + (set! (-> a0-1 quad) (-> self root trans quad)) (+! (-> a0-1 y) 30720.0) (let ((v1-7 (birth-pickup-at-point a0-1 @@ -226,7 +210,7 @@ ) (set! (-> self fcell-handle) (ppointer->handle v1-7)) (if v1-7 - (clear-collide-with-as (-> (the-as collectable (-> v1-7 0)) root-override)) + (clear-collide-with-as (-> (the-as collectable (-> v1-7 0)) root)) ) ) ) @@ -312,13 +296,13 @@ (set-time! (-> self state-time)) (when *target* (let ((gp-1 (new 'stack-no-clear 'vector))) - (vector-! gp-1 (-> self root-override trans) (target-pos 0)) + (vector-! gp-1 (-> self root trans) (target-pos 0)) (when (< 12288.0 (vector-xz-length gp-1)) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 4096.0) (move-by-vector! (-> *target* control) gp-1) - (do-push-aways! (-> self root-override)) - (detect-riders! (-> self root-override)) + (do-push-aways! (-> self root)) + (detect-riders! (-> self root)) ) ) ) @@ -328,11 +312,11 @@ (level-hint-spawn (text-id sunken-helix-hint) "sksp0124" (the-as entity #f) *entity-pool* (game-task none)) (send-event *target* 'play-anim 'shock-in) (sound-play "prec-button8") - (set! (-> self root-override transv quad) (the-as uint128 0)) + (set! (-> self root transv quad) (the-as uint128 0)) (let ((gp-3 5)) (until (<= gp-3 0) - (let ((f1-0 (-> self root-override transv y)) - (f0-2 (-> self root-override trans y)) + (let ((f1-0 (-> self root transv y)) + (f0-2 (-> self root trans y)) (a1-11 (new 'stack-no-clear 'vector)) ) (let* ((f1-1 (+ f1-0 (* -737280.0 (seconds-per-frame)))) @@ -343,11 +327,11 @@ (set! f1-1 (* 0.65 (- f1-1))) (+! gp-3 -1) ) - (set! (-> self root-override transv y) f1-1) - (set! (-> a1-11 quad) (-> self root-override trans quad)) + (set! (-> self root transv y) f1-1) + (set! (-> a1-11 quad) (-> self root trans quad)) (set! (-> a1-11 y) f0-3) ) - (move-to-point! (-> self root-override) a1-11) + (move-to-point! (-> self root) a1-11) ) (suspend) ) @@ -463,11 +447,11 @@ ) ) ) - (set! (-> self root-override transv quad) (the-as uint128 0)) + (set! (-> self root transv quad) (the-as uint128 0)) (let ((gp-2 5)) (until (<= gp-2 0) - (let ((f1-0 (-> self root-override transv y)) - (f0-0 (-> self root-override trans y)) + (let ((f1-0 (-> self root transv y)) + (f0-0 (-> self root trans y)) (a1-5 (new 'stack-no-clear 'vector)) ) (let* ((f1-1 (+ f1-0 (* -737280.0 (seconds-per-frame)))) @@ -478,11 +462,11 @@ (set! f1-1 (* 0.65 (- f1-1))) (+! gp-2 -1) ) - (set! (-> self root-override transv y) f1-1) - (set! (-> a1-5 quad) (-> self root-override trans quad)) + (set! (-> self root transv y) f1-1) + (set! (-> a1-5 quad) (-> self root trans quad)) (set! (-> a1-5 y) f0-1) ) - (move-to-point! (-> self root-override) a1-5) + (move-to-point! (-> self root) a1-5) ) (suspend) ) @@ -500,7 +484,7 @@ ) ) -(defmethod init-from-entity! helix-button ((this helix-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this helix-button) (arg0 entity-actor)) (set! (-> this fcell-handle) (the-as handle #f)) (set! (-> this my-water) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> this my-door) (entity-actor-lookup arg0 'alt-actor 1)) @@ -522,7 +506,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *helix-button-sg* '()) @@ -536,20 +520,20 @@ ) (set! (-> s5-1 frame-num) 0.0) ) - (set! (-> this spawn-trans quad) (-> this root-override trans quad)) - (+! (-> this root-override trans y) -26624.0) - (set! (-> this down-y) (+ -6553.6 (-> this root-override trans y))) + (set! (-> this spawn-trans quad) (-> this root trans quad)) + (+! (-> this root trans y) -26624.0) + (set! (-> this down-y) (+ -6553.6 (-> this root trans y))) (set! (-> this fact) (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! *helix-button* this) (go helix-button-startup) (none) ) -(defmethod helix-water-method-21 helix-water ((this helix-water)) +(defmethod helix-water-method-21 ((this helix-water)) (let ((s5-0 (+ (-> this last-alt-actor-consumed) 1))) (when (< s5-0 (-> this alt-actors length)) (let* ((v1-5 (-> this alt-actors s5-0)) @@ -665,14 +649,14 @@ :post ja-post ) -(defmethod relocate helix-water ((this helix-water) (arg0 int)) +(defmethod relocate ((this helix-water) (arg0 int)) (if (nonzero? (-> this alt-actors)) (&+! (-> this alt-actors) arg0) ) (call-parent-method this arg0) ) -(defmethod init-from-entity! helix-water ((this helix-water) (arg0 entity-actor)) +(defmethod init-from-entity! ((this helix-water) (arg0 entity-actor)) (set! (-> this last-alt-actor-consumed) -1) (set! (-> this transv-y) 9216.0) (set! (-> this root) (new 'process 'trsqv)) diff --git a/goal_src/jak1/levels/sunken/orbit-plat.gc b/goal_src/jak1/levels/sunken/orbit-plat.gc index 08069f5e160..3c493279589 100644 --- a/goal_src/jak1/levels/sunken/orbit-plat.gc +++ b/goal_src/jak1/levels/sunken/orbit-plat.gc @@ -10,15 +10,11 @@ ;; DECOMP BEGINS (deftype orbit-plat-bottom (process-drawable) - ((parent-override (pointer orbit-plat) :offset 12) - (part2 sparticle-launch-control :offset-assert 176) + ((parent-override (pointer orbit-plat) :overlay-at parent) + (part2 sparticle-launch-control) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xb4 - :flag-assert #x15005000b4 (:methods - (orbit-plat-bottom-method-20 (_type_ vector vector) none 20) + (orbit-plat-bottom-method-20 (_type_ vector vector) none) ) (:states orbit-plat-bottom-idle @@ -32,21 +28,17 @@ ) (deftype orbit-plat (baseplat) - ((other entity-actor :offset-assert 228) - (rot-dir float :offset-assert 232) - (reset-trans vector :inline :offset-assert 240) - (is-reset? symbol :offset-assert 256) - (reset-length float :offset-assert 260) - (timeout float :offset-assert 264) - (plat-status uint64 :offset-assert 272) + ((other entity-actor) + (rot-dir float) + (reset-trans vector :inline) + (is-reset? symbol) + (reset-length float) + (timeout float) + (plat-status uint64) ) - :heap-base #xb0 - :method-count-assert 29 - :size-assert #x118 - :flag-assert #x1d00b00118 (:methods - (orbit-plat-method-27 (_type_) symbol 27) - (orbit-plat-method-28 (_type_) symbol 28) + (orbit-plat-method-27 (_type_) symbol) + (orbit-plat-method-28 (_type_) symbol) ) (:states orbit-plat-idle @@ -137,7 +129,7 @@ ) ) -(defmethod orbit-plat-bottom-method-20 orbit-plat-bottom ((this orbit-plat-bottom) (arg0 vector) (arg1 vector)) +(defmethod orbit-plat-bottom-method-20 ((this orbit-plat-bottom) (arg0 vector) (arg1 vector)) (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) (f30-0 (vector-length s5-1)) ) @@ -157,7 +149,7 @@ (defstate orbit-plat-bottom-idle (orbit-plat-bottom) :code (behavior () (loop - (set! (-> self root trans quad) (-> self parent-override 0 root-override trans quad)) + (set! (-> self root trans quad) (-> self parent-override 0 root trans quad)) (+! (-> self root trans y) -5324.8) (spawn (-> self part2) (-> self root trans)) (let* ((a0-6 (-> self parent-override 0 other)) @@ -168,8 +160,8 @@ ) (when v1-9 (let ((f30-0 (atan - (- (-> (the-as orbit-plat v1-9) root-override trans x) (-> self root trans x)) - (- (-> (the-as orbit-plat v1-9) root-override trans z) (-> self root trans z)) + (- (-> (the-as orbit-plat v1-9) root trans x) (-> self root trans x)) + (- (-> (the-as orbit-plat v1-9) root trans z) (-> self root trans z)) ) ) ) @@ -205,7 +197,7 @@ (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root trans quad)) (+! (-> gp-1 y) -2048.0) - (set! (-> s5-0 quad) (-> (the-as orbit-plat v1-32) root-override trans quad)) + (set! (-> s5-0 quad) (-> (the-as orbit-plat v1-32) root trans quad)) (+! (-> s5-0 y) -7372.8) (vector-! s4-0 s5-0 gp-1) (vector-normalize! s4-0 1.0) @@ -228,14 +220,14 @@ :post ja-post ) -(defmethod relocate orbit-plat-bottom ((this orbit-plat-bottom) (arg0 int)) +(defmethod relocate ((this orbit-plat-bottom) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) (the-as orbit-plat-bottom ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate orbit-plat-bottom ((this orbit-plat-bottom)) +(defmethod deactivate ((this orbit-plat-bottom)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -247,9 +239,9 @@ (set! (-> self entity) arg0) (logior! (-> self mask) (process-mask platform)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg1 root-override trans quad)) - (quaternion-copy! (-> self root quat) (-> arg1 root-override quat)) - (set! (-> self root scale quad) (-> arg1 root-override scale quad)) + (set! (-> self root trans quad) (-> arg1 root trans quad)) + (quaternion-copy! (-> self root quat) (-> arg1 root quat)) + (set! (-> self root scale quad) (-> arg1 root scale quad)) (+! (-> self root trans y) -5324.8) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 440) self)) (set! (-> self part2) (create-launch-control (-> *part-group-id-table* 107) self)) @@ -306,7 +298,7 @@ ) ) (loop - (when (nonzero? (-> self root-override riders num-riders)) + (when (nonzero? (-> self root riders num-riders)) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) self) (set! (-> a1-2 num-params) 0) @@ -350,13 +342,13 @@ :post plat-post ) -(defmethod orbit-plat-method-28 orbit-plat ((this orbit-plat)) +(defmethod orbit-plat-method-28 ((this orbit-plat)) (when (time-elapsed? (-> this state-time) (the int (* 300.0 (-> this timeout)))) (cond (*target* (let ((s5-0 (target-pos 0))) - (if (or (>= (vector-vector-xz-distance s5-0 (-> this root-override trans)) 102400.0) - (>= (- (-> this root-override trans y) (-> s5-0 y)) 16384.0) + (if (or (>= (vector-vector-xz-distance s5-0 (-> this root trans)) 102400.0) + (>= (- (-> this root trans y) (-> s5-0 y)) 16384.0) ) (return #t) ) @@ -387,7 +379,7 @@ (set-time! (-> self state-time)) (ja-no-eval :num! (seek! 0.0)) (until (orbit-plat-method-28 self) - (when (nonzero? (-> self root-override riders num-riders)) + (when (nonzero? (-> self root riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 0) @@ -422,7 +414,7 @@ (set! (-> self plat-status) (the-as uint 1)) (ja-no-eval :num! (seek!)) (loop - (when (zero? (-> self root-override riders num-riders)) + (when (zero? (-> self root riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 0) @@ -478,9 +470,9 @@ ) (vector-normalize! (-> arg1 nav travel) (* f0-0 (seconds-per-frame))) ) - (set! (-> arg0 x) (+ (-> arg1 root-override trans x) (-> arg1 nav travel x))) - (set! (-> arg0 y) (-> arg1 root-override trans x)) - (set! (-> arg0 z) (+ (-> arg1 root-override trans z) (-> arg1 nav travel z))) + (set! (-> arg0 x) (+ (-> arg1 root trans x) (-> arg1 nav travel x))) + (set! (-> arg0 y) (-> arg1 root trans x)) + (set! (-> arg0 z) (+ (-> arg1 root trans z) (-> arg1 nav travel z))) arg0 ) @@ -511,7 +503,7 @@ (-> a1-0 extra process) ) ) - root-override + root trans quad ) @@ -544,7 +536,7 @@ ) ;; WARN: disable def twice: 132. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod orbit-plat-method-27 orbit-plat ((this orbit-plat)) +(defmethod orbit-plat-method-27 ((this orbit-plat)) (local-vars (v0-11 object)) (let* ((v1-0 (-> this other)) (s5-0 (if v1-0 @@ -593,7 +585,7 @@ (-> a1-5 extra process) ) ) - root-override + root trans quad ) @@ -634,7 +626,7 @@ (-> a0-19 extra process) ) ) - root-override + root trans quad ) @@ -708,7 +700,7 @@ (ja-no-eval :num! (seek! 0.0)) (while (not (logtest? (nav-control-flags navcf19) (-> self nav flags))) (orbit-plat-method-27 self) - (when (nonzero? (-> self root-override riders num-riders)) + (when (nonzero? (-> self root riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 0) @@ -759,7 +751,7 @@ :post ja-post ) -(defmethod init-from-entity! orbit-plat ((this orbit-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this orbit-plat) (arg0 entity-actor)) (set! (-> this plat-status) (the-as uint 0)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) @@ -780,7 +772,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *orbit-plat-sg* '()) @@ -795,14 +787,14 @@ (set! (-> s4-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (baseplat-method-21 this) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> this nav gap-event) 'blocked) (set! (-> this other) (entity-actor-lookup arg0 'alt-actor 0)) (let ((f0-7 (res-lump-float arg0 'scale :default 1.0))) - (set-vector! (-> this root-override scale) f0-7 f0-7 f0-7 1.0) + (set-vector! (-> this root scale) f0-7 f0-7 f0-7 1.0) ) (set! (-> this timeout) (res-lump-float arg0 'timeout :default 10.0)) (set! (-> this rot-dir) 1.0) diff --git a/goal_src/jak1/levels/sunken/puffer.gc b/goal_src/jak1/levels/sunken/puffer.gc index 41730670f63..19107b38931 100644 --- a/goal_src/jak1/levels/sunken/puffer.gc +++ b/goal_src/jak1/levels/sunken/puffer.gc @@ -9,53 +9,49 @@ ;; DECOMP BEGINS (deftype puffer (process-drawable) - ((root-override collide-shape-moving :offset 112) - (fact-info-override fact-info-enemy :offset 144) - (path-index int32 :offset-assert 176) - (facing-ry float :offset-assert 180) - (travel-ry float :offset-assert 184) - (travel-speed float :offset-assert 188) - (attack-bottom-y float :offset-assert 192) - (patrol-bottom-y float :offset-assert 196) - (top-y float :offset-assert 200) - (targ-trans-y float :offset-assert 204) - (acc-y float :offset-assert 208) - (travel-turn-speed float :offset-assert 212) - (notice-dist float :offset-assert 216) - (give-up-dist float :offset-assert 220) - (attacking? symbol :offset-assert 224) - (hit-player? symbol :offset-assert 228) - (look-mean? symbol :offset-assert 232) - (cprims-type uint64 :offset-assert 240) - (neck joint-mod :offset-assert 248) - (hit-player-time time-frame :offset-assert 256) - (reaction-delay time-frame :offset-assert 264) - (picked-point-time time-frame :offset-assert 272) - (pick-new-point-delay time-frame :offset-assert 280) - (last-on-screen-time time-frame :offset-assert 288) - (buddy process-drawable :offset-assert 296) - (nice-look lod-set :inline :offset-assert 300) - (mean-look lod-set :inline :offset-assert 336) - (dest-pos vector :inline :offset-assert 384) - (sync sync-info :inline :offset-assert 400) + ((root collide-shape-moving :override) + (fact fact-info-enemy :override) + (path-index int32) + (facing-ry float) + (travel-ry float) + (travel-speed float) + (attack-bottom-y float) + (patrol-bottom-y float) + (top-y float) + (targ-trans-y float) + (acc-y float) + (travel-turn-speed float) + (notice-dist float) + (give-up-dist float) + (attacking? symbol) + (hit-player? symbol) + (look-mean? symbol) + (cprims-type uint64) + (neck joint-mod) + (hit-player-time time-frame) + (reaction-delay time-frame) + (picked-point-time time-frame) + (pick-new-point-delay time-frame) + (last-on-screen-time time-frame) + (buddy process-drawable) + (nice-look lod-set :inline) + (mean-look lod-set :inline) + (dest-pos vector :inline) + (sync sync-info :inline) ) - :heap-base #x130 - :method-count-assert 32 - :size-assert #x198 - :flag-assert #x2001300198 (:methods - (puffer-method-20 (_type_ vector) none 20) - (puffer-method-21 (_type_) none 21) - (puffer-method-22 (_type_) symbol 22) - (puffer-method-23 (_type_ symbol) symbol 23) - (puffer-method-24 (_type_ vector) symbol 24) - (puffer-method-25 (_type_ float) symbol 25) - (puffer-method-26 (_type_) none 26) - (puffer-method-27 (_type_) none 27) - (puffer-method-28 (_type_) none 28) - (flip-look! (_type_ symbol) none 29) - (puffer-method-30 (_type_) vector 30) - (puffer-method-31 (_type_) vector 31) + (puffer-method-20 (_type_ vector) none) + (puffer-method-21 (_type_) none) + (puffer-method-22 (_type_) symbol) + (puffer-method-23 (_type_ symbol) symbol) + (puffer-method-24 (_type_ vector) symbol) + (puffer-method-25 (_type_ float) symbol) + (puffer-method-26 (_type_) none) + (puffer-method-27 (_type_) none) + (puffer-method-28 (_type_) none) + (flip-look! (_type_ symbol) none) + (puffer-method-30 (_type_) vector) + (puffer-method-31 (_type_) vector) ) (:states puffer-attack @@ -92,12 +88,12 @@ ) (when v1-7 (let ((f0-4 (atan - (- (-> (the-as process-drawable v1-7) root trans x) (-> self root-override trans x)) - (- (-> (the-as process-drawable v1-7) root trans z) (-> self root-override trans z)) + (- (-> (the-as process-drawable v1-7) root trans x) (-> self root trans x)) + (- (-> (the-as process-drawable v1-7) root trans z) (-> self root trans z)) ) ) ) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 f0-4) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 f0-4) ) ) ) @@ -113,7 +109,7 @@ ) (set! (-> self hit-player?) #t) (set-time! (-> self hit-player-time)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) + (set-collide-offense (-> self root) 2 (collide-offense no-offense)) ) ) ) @@ -131,14 +127,14 @@ ) ) ) - (set-collide-offense (-> self root-override) 2 (collide-offense normal-attack)) + (set-collide-offense (-> self root) 2 (collide-offense normal-attack)) (set! (-> self hit-player?) #f) ) (transform-post) (none) ) -(defmethod puffer-method-28 puffer ((this puffer)) +(defmethod puffer-method-28 ((this puffer)) (cond ((and (-> this draw shadow) (zero? (-> this draw cur-lod)) @@ -148,7 +144,7 @@ (a1-0 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> this root-override trans quad)) + (set! (-> a1-0 quad) (-> this root trans quad)) (set-vector! a2-0 0.0 -40960.0 0.0 1.0) (cond ((>= (fill-and-probe-using-line-sphere @@ -195,13 +191,13 @@ (none) ) -(defmethod puffer-method-24 puffer ((this puffer) (arg0 vector)) +(defmethod puffer-method-24 ((this puffer) (arg0 vector)) (and (is-in-mesh? (-> this nav) arg0 11468.8) - (< (-> arg0 y) (+ (-> this root-override trans y) (-> this fact-info-override notice-top))) + (< (-> arg0 y) (+ (-> this root trans y) (-> this fact notice-top))) ) ) -(defmethod puffer-method-22 puffer ((this puffer)) +(defmethod puffer-method-22 ((this puffer)) (let* ((a1-0 (-> this buddy)) (v1-0 (if a1-0 (-> a1-0 ppointer 3) @@ -209,9 +205,7 @@ ) ) (if (and v1-0 - (>= 25395.2 - (vector-vector-xz-distance (-> this root-override trans) (-> (the-as process-drawable v1-0) root trans)) - ) + (>= 25395.2 (vector-vector-xz-distance (-> this root trans) (-> (the-as process-drawable v1-0) root trans))) ) (return #t) ) @@ -219,7 +213,7 @@ #f ) -(defmethod puffer-method-25 puffer ((this puffer) (arg0 float)) +(defmethod puffer-method-25 ((this puffer) (arg0 float)) (when *target* (let ((gp-0 (target-pos 0))) (when (and (not (logtest? (-> *target* state-flags) @@ -230,7 +224,7 @@ (>= (-> gp-0 y) (+ -14336.0 (-> this attack-bottom-y))) (>= (+ 2048.0 (-> this top-y)) (-> gp-0 y)) ) - (let ((f30-0 (vector-vector-xz-distance gp-0 (-> this root-override trans)))) + (let ((f30-0 (vector-vector-xz-distance gp-0 (-> this root trans)))) (when (>= arg0 f30-0) (let* ((a0-4 (-> this buddy)) (v1-12 (if a0-4 @@ -243,7 +237,7 @@ (if (not (-> (the-as puffer v1-12) attacking?)) (return #t) ) - (if (< f30-0 (vector-vector-xz-distance gp-0 (-> (the-as puffer v1-12) root-override trans))) + (if (< f30-0 (vector-vector-xz-distance gp-0 (-> (the-as puffer v1-12) root trans))) (return #t) ) ) @@ -261,20 +255,17 @@ ) (deftype pick-patrol-point-away-from-buddy-work (structure) - ((best-path-index int32 :offset-assert 0) - (best-rating float :offset-assert 4) - (best-dest vector :inline :offset-assert 16) - (pt-dir vector :inline :offset-assert 32) - (buddy-dir vector :inline :offset-assert 48) - (dest vector :inline :offset-assert 64) + ((best-path-index int32) + (best-rating float) + (best-dest vector :inline) + (pt-dir vector :inline) + (buddy-dir vector :inline) + (dest vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) -(defmethod puffer-method-23 puffer ((this puffer) (arg0 symbol)) +(defmethod puffer-method-23 ((this puffer) (arg0 symbol)) (local-vars (v1-0 process)) (set! v1-0 (when arg0 (let ((a0-1 (-> this buddy))) @@ -295,12 +286,12 @@ (s5-0 (new 'stack-no-clear 'inline-array 'vector 5)) ) (set! (-> s5-0 0 x) (the-as float -1)) - (vector-! (-> s5-0 3) (-> this root-override trans) (-> (the-as process-drawable v1-0) root trans)) + (vector-! (-> s5-0 3) (-> this root trans) (-> (the-as process-drawable v1-0) root trans)) (set! (-> s5-0 3 y) 0.0) (vector-normalize! (-> s5-0 3) 1.0) (dotimes (s3-0 s4-0) (eval-path-curve-div! (-> this path) (-> s5-0 4) (the float s3-0) 'interp) - (vector-! (-> s5-0 2) (-> s5-0 4) (-> this root-override trans)) + (vector-! (-> s5-0 2) (-> s5-0 4) (-> this root trans)) (when (>= (vector-xz-length (-> s5-0 2)) 10240.0) (set! (-> s5-0 2 y) 0.0) (vector-normalize! (-> s5-0 2) 1.0) @@ -317,7 +308,7 @@ ) (when (>= (the-as int (-> s5-0 0 x)) 0) (set! (-> this dest-pos quad) (-> s5-0 1 quad)) - (set! (-> this dest-pos y) (-> this root-override trans y)) + (set! (-> this dest-pos y) (-> this root trans y)) (return #t) ) ) @@ -330,9 +321,9 @@ (while (nonzero? s3-1) (+! s3-1 -1) (eval-path-curve-div! (-> this path) s4-1 (the float s5-1) 'interp) - (when (>= (vector-vector-xz-distance s4-1 (-> this root-override trans)) 10240.0) + (when (>= (vector-vector-xz-distance s4-1 (-> this root trans)) 10240.0) (set! (-> this dest-pos quad) (-> s4-1 quad)) - (set! (-> this dest-pos y) (-> this root-override trans y)) + (set! (-> this dest-pos y) (-> this root trans y)) (set! (-> this path-index) s5-1) (return #t) ) @@ -343,7 +334,7 @@ #f ) -(defmethod puffer-method-20 puffer ((this puffer) (arg0 vector)) +(defmethod puffer-method-20 ((this puffer) (arg0 vector)) (if (-> this attacking?) (set! (-> this travel-speed) (seek-with-smooth (-> this travel-speed) 30720.0 (* 8192.0 (seconds-per-frame)) 0.125 40.96) @@ -354,7 +345,7 @@ ) (nav-control-method-27 (-> this nav)) (nav-control-method-28 (-> this nav) (the-as collide-kind -1)) - (nav-control-method-13 (-> this nav) arg0 (-> this root-override transv)) + (nav-control-method-13 (-> this nav) arg0 (-> this root transv)) (let ((f30-0 (* (vector-xz-length (-> this nav travel)) (-> *display* frames-per-second)))) (let ((f0-11 (atan (-> this nav travel x) (-> this nav travel z))) (s5-1 (new 'stack-no-clear 'vector)) @@ -376,12 +367,12 @@ (set! (-> this nav travel quad) (-> s4-0 quad)) (nav-control-method-24 (-> this nav) f28-0 s3-1) (if (-> s3-1 found-boundary) - (set! f26-0 (vector-vector-xz-distance (-> s3-1 intersection) (-> this root-override trans))) + (set! f26-0 (vector-vector-xz-distance (-> s3-1 intersection) (-> this root trans))) ) ) (let ((s3-2 (new 'stack-no-clear 'matrix))) (when (>= (nav-control-method-23 (-> this nav) s4-0 (the-as check-vector-collision-with-nav-spheres-info s3-2)) 0.0) - (let ((f0-26 (vector-vector-xz-distance (-> s3-2 vector 1) (-> this root-override trans)))) + (let ((f0-26 (vector-vector-xz-distance (-> s3-2 vector 1) (-> this root trans)))) (if (or (< f26-0 0.0) (< f0-26 f26-0)) (set! f26-0 f0-26) ) @@ -397,9 +388,9 @@ ) ) (set-vector! - (-> this root-override transv) + (-> this root transv) (* (sin (-> this travel-ry)) f30-0) - (-> this root-override transv y) + (-> this root transv y) (* (cos (-> this travel-ry)) f30-0) 1.0 ) @@ -411,37 +402,37 @@ (none) ) -(defmethod puffer-method-27 puffer ((this puffer)) +(defmethod puffer-method-27 ((this puffer)) (let ((f30-0 (-> this patrol-bottom-y))) (cond ((-> this attacking?) (let ((f30-1 (-> this attack-bottom-y))) (set! (-> this targ-trans-y) (fmax (fmin (+ 4096.0 (-> (target-pos 0) y)) (-> this top-y)) f30-1)) ) - (set! (-> this root-override transv y) - (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root-override trans y))) + (set! (-> this root transv y) + (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root trans y))) ) - (when (< 6144.0 (fabs (-> this root-override transv y))) - (if (>= (-> this root-override transv y) 0.0) - (set! (-> this root-override transv y) 6144.0) - (set! (-> this root-override transv y) -6144.0) + (when (< 6144.0 (fabs (-> this root transv y))) + (if (>= (-> this root transv y) 0.0) + (set! (-> this root transv y) 6144.0) + (set! (-> this root transv y) -6144.0) ) ) ) - ((< (-> this root-override trans y) f30-0) + ((< (-> this root trans y) f30-0) (set! (-> this targ-trans-y) (* 0.5 (+ (-> this top-y) (-> this patrol-bottom-y)))) - (set! (-> this root-override transv y) - (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root-override trans y))) + (set! (-> this root transv y) + (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root trans y))) ) - (when (< 2048.0 (fabs (-> this root-override transv y))) - (if (>= (-> this root-override transv y) 0.0) - (set! (-> this root-override transv y) 2048.0) - (set! (-> this root-override transv y) -2048.0) + (when (< 2048.0 (fabs (-> this root transv y))) + (if (>= (-> this root transv y) 0.0) + (set! (-> this root transv y) 2048.0) + (set! (-> this root transv y) -2048.0) ) ) ) (else - (let ((f0-22 (- (-> this targ-trans-y) (-> this root-override trans y)))) + (let ((f0-22 (- (-> this targ-trans-y) (-> this root trans y)))) (when (or (and (>= f0-22 0.0) (< (-> this acc-y) 0.0)) (and (< f0-22 0.0) (>= (-> this acc-y) 0.0))) (when (not (-> this attacking?)) (cond @@ -460,20 +451,20 @@ (set! (-> this acc-y) (- (-> this acc-y))) ) ) - (+! (-> this root-override transv y) (* (-> this acc-y) (seconds-per-frame))) - (let ((f0-37 (* (-> this root-override transv y) (seconds-per-frame)))) + (+! (-> this root transv y) (* (-> this acc-y) (seconds-per-frame))) + (let ((f0-37 (* (-> this root transv y) (seconds-per-frame)))) (cond ((>= f0-37 0.0) - (let ((f1-27 (* 0.0625 (- (-> this top-y) (-> this root-override trans y))))) + (let ((f1-27 (* 0.0625 (- (-> this top-y) (-> this root trans y))))) (if (< f1-27 f0-37) - (set! (-> this root-override transv y) (* f1-27 (-> *display* frames-per-second))) + (set! (-> this root transv y) (* f1-27 (-> *display* frames-per-second))) ) ) ) (else - (let ((f1-29 (* 0.0625 (- f30-0 (-> this root-override trans y))))) + (let ((f1-29 (* 0.0625 (- f30-0 (-> this root trans y))))) (if (< f0-37 f1-29) - (set! (-> this root-override transv y) (* f1-29 (-> *display* frames-per-second))) + (set! (-> this root transv y) (* f1-29 (-> *display* frames-per-second))) ) ) ) @@ -498,9 +489,8 @@ ) :code (behavior () (loop - (if (and (and *target* (>= (-> self fact-info-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (and (and *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (logtest? (-> self draw status) (draw-status was-drawn)) (time-elapsed? (-> self state-time) (seconds 0.2)) @@ -528,9 +518,8 @@ (set-time! (-> self last-on-screen-time)) ) :trans (behavior () - (if (and (not (and *target* (>= (-> self fact-info-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (and (not (and *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) ) (time-elapsed? (-> self state-time) (seconds 3)) @@ -558,7 +547,7 @@ ) (go puffer-attack) ) - (when (or (< (vector-vector-xz-distance (-> self root-override trans) (-> self dest-pos)) 8192.0) + (when (or (< (vector-vector-xz-distance (-> self root trans) (-> self dest-pos)) 8192.0) (time-elapsed? (-> self picked-point-time) (-> self pick-new-point-delay)) ) (when (puffer-method-23 self #f) @@ -569,9 +558,9 @@ (puffer-method-20 self (-> self dest-pos)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set-vector! gp-0 (sin (-> self facing-ry)) 0.0 (cos (-> self facing-ry)) 1.0) - (set-heading-vec-clear-roll-pitch! (-> self root-override) gp-0) + (set-heading-vec-clear-roll-pitch! (-> self root) gp-0) ) - (vector-v+! (-> self root-override trans) (-> self root-override trans) (-> self root-override transv)) + (vector-v+! (-> self root trans) (-> self root trans) (-> self root transv)) (puffer-method-28 self) ) :code (behavior () @@ -603,7 +592,7 @@ (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -613,9 +602,9 @@ (puffer-method-20 self (target-pos 0)) (let ((gp-2 (new 'stack-no-clear 'vector))) (set-vector! gp-2 (sin (-> self facing-ry)) 0.0 (cos (-> self facing-ry)) 1.0) - (set-heading-vec-clear-roll-pitch! (-> self root-override) gp-2) + (set-heading-vec-clear-roll-pitch! (-> self root) gp-2) ) - (vector-v+! (-> self root-override trans) (-> self root-override trans) (-> self root-override transv)) + (vector-v+! (-> self root trans) (-> self root trans) (-> self root transv)) (puffer-method-28 self) ) :code (behavior () @@ -629,27 +618,25 @@ (defstate puffer-die (puffer) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (the-as - uint - (case message - (('death-start) - (the-as uint (drop-pickup (-> self fact-info-override) #t *entity-pool* (-> self fact-info-override) 0)) - ) - (('death-end) - (let ((v0-0 (the-as uint (logior (-> self draw status) (draw-status hidden))))) - (set! (-> self draw status) (the-as draw-status v0-0)) - v0-0 - ) - ) - ) - ) + (the-as uint (case message + (('death-start) + (the-as uint (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0)) + ) + (('death-end) + (let ((v0-0 (the-as uint (logior (-> self draw status) (draw-status hidden))))) + (set! (-> self draw status) (the-as draw-status v0-0)) + v0-0 + ) + ) + ) + ) ) :code (behavior () (cleanup-for-death self) (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) (ja-channel-push! 1 (seconds 0.075)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :group! puffer-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -659,7 +646,7 @@ :post ja-post ) -(defmethod puffer-method-21 puffer ((this puffer)) +(defmethod puffer-method-21 ((this puffer)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -698,14 +685,14 @@ ) (set! (-> s5-0 nav-radius) 12288.0) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (puffer-method-30 this) 0 (none) ) -(defmethod flip-look! puffer ((this puffer) (arg0 symbol)) +(defmethod flip-look! ((this puffer) (arg0 symbol)) (when (!= arg0 (-> this look-mean?)) (set! (-> this look-mean?) arg0) (if arg0 @@ -716,10 +703,10 @@ (none) ) -(defmethod puffer-method-30 puffer ((this puffer)) +(defmethod puffer-method-30 ((this puffer)) (when (!= (-> this cprims-type) 1) (set! (-> this cprims-type) (the-as uint 1)) - (let ((v1-3 (the-as basic (-> this root-override root-prim)))) + (let ((v1-3 (the-as basic (-> this root root-prim)))) (set-vector! (-> (the-as collide-shape-prim v1-3) local-sphere) 0.0 6144.0 0.0 18432.0) (let ((v0-0 (-> (the-as (array collide-shape-prim) v1-3) 17 local-sphere))) (set! (-> v0-0 x) 0.0) @@ -732,10 +719,10 @@ ) ) -(defmethod puffer-method-31 puffer ((this puffer)) +(defmethod puffer-method-31 ((this puffer)) (when (!= (-> this cprims-type) 2) (set! (-> this cprims-type) (the-as uint 2)) - (let ((v1-3 (the-as basic (-> this root-override root-prim)))) + (let ((v1-3 (the-as basic (-> this root root-prim)))) (set-vector! (-> (the-as collide-shape-prim v1-3) local-sphere) 0.0 6144.0 0.0 18432.0) (let ((v0-0 (-> (the-as (array collide-shape-prim) v1-3) 17 local-sphere))) (set! (-> v0-0 x) 0.0) @@ -748,7 +735,7 @@ ) ) -(defmethod puffer-method-26 puffer ((this puffer)) +(defmethod puffer-method-26 ((this puffer)) (let ((f30-0 (get-current-phase (-> this sync)))) (if (and (< 0.025 f30-0) (< f30-0 0.525)) (flip-look! this #f) @@ -1050,14 +1037,14 @@ (none) ) -(defmethod relocate puffer ((this puffer) (arg0 int)) +(defmethod relocate ((this puffer) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) (call-parent-method this arg0) ) -(defmethod init-from-entity! puffer ((this puffer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this puffer) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (set! (-> this cprims-type) (the-as uint 0)) (set! (-> this attacking?) #f) @@ -1076,12 +1063,12 @@ (load-params! (-> this sync) this (the-as uint 2400) 0.0 0.15 0.15) (set! (-> this notice-dist) (res-lump-float arg0 'notice-dist :default 57344.0)) (set! (-> this give-up-dist) (+ 20480.0 (-> this notice-dist))) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (nav-control-method-26 (-> this nav)) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> this fact-info-override) + (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) @@ -1103,11 +1090,11 @@ ) (set! (-> s4-0 frame-num) 0.0) ) - (set! (-> this facing-ry) (quaternion-y-angle (-> this root-override quat))) + (set! (-> this facing-ry) (quaternion-y-angle (-> this root quat))) (set! (-> this travel-ry) (-> this facing-ry)) (set! (-> this travel-speed) 18432.0) - (vector-reset! (-> this root-override transv)) - (set! (-> this patrol-bottom-y) (-> this root-override trans y)) + (vector-reset! (-> this root transv)) + (set! (-> this patrol-bottom-y) (-> this root trans y)) (let ((f28-0 8192.0) (f30-0 -8192.0) ) @@ -1121,8 +1108,8 @@ (set! (-> this top-y) (+ (-> this patrol-bottom-y) f28-0)) (set! (-> this attack-bottom-y) (+ (-> this patrol-bottom-y) f30-0)) ) - (set! (-> this root-override trans y) (rand-vu-float-range (-> this patrol-bottom-y) (-> this top-y))) - (set! (-> this targ-trans-y) (-> this root-override trans y)) + (set! (-> this root trans y) (rand-vu-float-range (-> this patrol-bottom-y) (-> this top-y))) + (set! (-> this targ-trans-y) (-> this root trans y)) (set! (-> this acc-y) 2048.0) (let ((v1-59 (new 'process 'joint-mod (joint-mod-handler-mode reset) this 5))) (set! (-> this neck) v1-59) @@ -1133,7 +1120,7 @@ (set! (-> v1-59 max-dist) 102400.0) (set! (-> v1-59 ignore-angle) 16384.0) ) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go puffer-idle) (none) ) diff --git a/goal_src/jak1/levels/sunken/qbert-plat.gc b/goal_src/jak1/levels/sunken/qbert-plat.gc index d51e5ae9e4b..2b0a5a9f1ef 100644 --- a/goal_src/jak1/levels/sunken/qbert-plat.gc +++ b/goal_src/jak1/levels/sunken/qbert-plat.gc @@ -12,10 +12,6 @@ (deftype qbert-plat-on (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 ) @@ -25,16 +21,12 @@ ) (deftype qbert-plat (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 736) - (plat-id int32 :offset-assert 752) - (on? symbol :offset-assert 756) - (player-is-riding? symbol :offset-assert 760) - (master entity-actor :offset-assert 764) + ((anchor-point vector :inline) + (plat-id int32) + (on? symbol) + (player-is-riding? symbol) + (master entity-actor) ) - :heap-base #x290 - :method-count-assert 35 - :size-assert #x300 - :flag-assert #x2302900300 (:states qbert-plat-on-die qbert-plat-on-mimic @@ -75,24 +67,20 @@ ) (deftype qbert-plat-master (process-drawable) - ((last-plat-triggered int32 :offset-assert 176) - (plat-states uint32 :offset-assert 180) - (plat-states-needed-to-open-door uint32 :offset-assert 184) - (player-in-bounds? symbol :offset-assert 188) - (player-in-water? symbol :offset-assert 192) - (play-door-cam? symbol :offset-assert 196) - (puzzle-beaten? symbol :offset-assert 200) - (door entity-actor :offset-assert 204) - (door-plat entity-actor :offset-assert 208) - (bounds-start vector :inline :offset-assert 224) - (bounds-end vector :inline :offset-assert 240) + ((last-plat-triggered int32) + (plat-states uint32) + (plat-states-needed-to-open-door uint32) + (player-in-bounds? symbol) + (player-in-water? symbol) + (play-door-cam? symbol) + (puzzle-beaten? symbol) + (door entity-actor) + (door-plat entity-actor) + (bounds-start vector :inline) + (bounds-end vector :inline) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x100 - :flag-assert #x1500900100 (:methods - (plat-state-set? (_type_ uint) symbol 20) + (plat-state-set? (_type_ uint) symbol) ) (:states (qbert-plat-master-do-door symbol) @@ -163,7 +151,7 @@ ) ) -(defmethod rigid-body-platform-method-33 qbert-plat ((this qbert-plat)) +(defmethod rigid-body-platform-method-33 ((this qbert-plat)) (let* ((a1-0 (-> this master)) (v1-0 (if a1-0 (-> a1-0 extra process) @@ -176,7 +164,7 @@ ) ) -(defmethod rigid-body-platform-method-32 qbert-plat ((this qbert-plat)) +(defmethod rigid-body-platform-method-32 ((this qbert-plat)) (let* ((v1-0 (-> this master)) (a0-1 (if v1-0 (-> v1-0 extra process) @@ -272,21 +260,21 @@ ) ) -(defmethod rigid-body-platform-method-22 qbert-plat ((this qbert-plat) (arg0 vector) (arg1 float)) +(defmethod rigid-body-platform-method-22 ((this qbert-plat) (arg0 vector) (arg1 float)) (+ (-> this anchor-point y) (-> this float-height-offset) (* 512.0 (cos (* 546.13336 (+ (* 60.0 arg1) (* 0.03 (-> arg0 x)) (* 0.03 (-> arg0 z)))))) ) ) -(defmethod rigid-body-platform-method-23 qbert-plat ((this qbert-plat) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this qbert-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) ) -(defmethod rigid-body-platform-method-30 qbert-plat ((this qbert-plat)) +(defmethod rigid-body-platform-method-30 ((this qbert-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -311,7 +299,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 qbert-plat ((this qbert-plat)) +(defmethod rigid-body-platform-method-31 ((this qbert-plat)) (initialize-skeleton this *qbert-plat-sg* '()) (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) (logior! (-> this skel status) (janim-status inited)) @@ -351,7 +339,7 @@ (none) ) -(defmethod init-from-entity! qbert-plat ((this qbert-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this qbert-plat) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (rigid-body-platform-method-30 this) (process-drawable-from-entity! this arg0) @@ -360,7 +348,7 @@ (none) ) -(defmethod plat-state-set? qbert-plat-master ((this qbert-plat-master) (arg0 uint)) +(defmethod plat-state-set? ((this qbert-plat-master) (arg0 uint)) (logtest? (-> this plat-states) (ash 1 arg0)) ) @@ -712,7 +700,7 @@ ) ) -(defmethod init-from-entity! qbert-plat-master ((this qbert-plat-master) (arg0 entity-actor)) +(defmethod init-from-entity! ((this qbert-plat-master) (arg0 entity-actor)) (set! (-> this last-plat-triggered) -1) (set! (-> this player-in-water?) #f) (set! (-> this player-in-bounds?) #f) diff --git a/goal_src/jak1/levels/sunken/shover.gc b/goal_src/jak1/levels/sunken/shover.gc index d6e4112889c..284f6e1294a 100644 --- a/goal_src/jak1/levels/sunken/shover.gc +++ b/goal_src/jak1/levels/sunken/shover.gc @@ -11,13 +11,9 @@ ;; DECOMP BEGINS (deftype shover (process-drawable) - ((root-override collide-shape :offset 112) - (shove-up float :offset-assert 176) + ((root collide-shape :override) + (shove-up float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states shover-idle ) @@ -41,7 +37,7 @@ (collide-action) ) (let ((s4-0 (new 'stack 'attack-info))) - (calc-shove-up (-> self root-override) s4-0 (-> self shove-up)) + (calc-shove-up (-> self root) s4-0 (-> self shove-up)) (level-hint-spawn (text-id sunken-hotpipes) "sksp0134" (the-as entity #f) *entity-pool* (game-task none)) (if (or (= (-> *target* control unknown-surface00 mode) 'air) (>= (+ (current-time) (seconds -0.2)) (-> *target* control unknown-dword11)) @@ -75,7 +71,7 @@ :code anim-loop ) -(defmethod init-from-entity! shover ((this shover) (arg0 entity-actor)) +(defmethod init-from-entity! ((this shover) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (set! (-> this shove-up) (res-lump-float arg0 'shove :default 12288.0)) (let ((s3-0 (res-lump-value arg0 'collision-mesh-id uint128)) @@ -92,7 +88,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *shover-sg* '()) @@ -106,14 +102,14 @@ (set! sv-16 (new 'static 'res-tag)) (let ((v1-23 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-23 - (+! (-> this root-override trans x) (-> v1-23 0)) - (+! (-> this root-override trans y) (-> v1-23 1)) - (+! (-> this root-override trans z) (-> v1-23 2)) + (+! (-> this root trans x) (-> v1-23 0)) + (+! (-> this root trans y) (-> v1-23 1)) + (+! (-> this root trans z) (-> v1-23 2)) ) ) (let ((f0-13 (res-lump-float arg0 'rotoffset))) (if (!= f0-13 0.0) - (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-13) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-13) ) ) (ja-channel-set! 1) @@ -126,7 +122,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! *shover* this) (go shover-idle) (none) diff --git a/goal_src/jak1/levels/sunken/square-platform.gc b/goal_src/jak1/levels/sunken/square-platform.gc index b55a31ab7b3..15ba4a150d1 100644 --- a/goal_src/jak1/levels/sunken/square-platform.gc +++ b/goal_src/jak1/levels/sunken/square-platform.gc @@ -11,23 +11,19 @@ ;; DECOMP BEGINS (deftype square-platform (baseplat) - ((plat-id int32 :offset-assert 228) - (pos-u float :offset-assert 232) - (water-entity entity-actor :offset-assert 236) - (splash-counter int32 :offset-assert 240) - (start-splash-time time-frame :offset-assert 248) - (part2 sparticle-launch-control :offset-assert 256) - (part3 sparticle-launch-control :offset-assert 260) - (part4 sparticle-launch-control :offset-assert 264) - (up-pos vector :inline :offset-assert 272) - (down-pos vector :inline :offset-assert 288) + ((plat-id int32) + (pos-u float) + (water-entity entity-actor) + (splash-counter int32) + (start-splash-time time-frame) + (part2 sparticle-launch-control) + (part3 sparticle-launch-control) + (part4 sparticle-launch-control) + (up-pos vector :inline) + (down-pos vector :inline) ) - :heap-base #xc0 - :method-count-assert 28 - :size-assert #x130 - :flag-assert #x1c00c00130 (:methods - (square-platform-method-27 (_type_ symbol) none 27) + (square-platform-method-27 (_type_ symbol) none) ) (:states square-platform-lowered @@ -45,28 +41,20 @@ (deftype square-platform-button (basebutton) () - :heap-base #x90 - :method-count-assert 32 - :size-assert #x100 - :flag-assert #x2000900100 ) (deftype square-platform-master (process-drawable) - ((button-id int32 :offset-assert 176) - (plat-id int32 :offset-assert 180) - (plat-mask uint32 :offset-assert 184) - (plat-id-dir int32 :offset-assert 188) - (wiggled? symbol :offset-assert 192) - (timeout time-frame :offset-assert 200) - (last-plat-activated-time time-frame :offset-assert 208) - (delay-til-wiggle time-frame :offset-assert 216) - (ticker ticky :inline :offset-assert 224) + ((button-id int32) + (plat-id int32) + (plat-mask uint32) + (plat-id-dir int32) + (wiggled? symbol) + (timeout time-frame) + (last-plat-activated-time time-frame) + (delay-til-wiggle time-frame) + (ticker ticky :inline) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #x100 - :flag-assert #x1400900100 (:states square-platform-master-activate square-platform-master-idle @@ -174,10 +162,10 @@ :parts ((sp-item 2222 :flags (is-3d)) (sp-item 2315 :flags (is-3d))) ) -(defmethod square-platform-method-27 square-platform ((this square-platform) (arg0 symbol)) +(defmethod square-platform-method-27 ((this square-platform) (arg0 symbol)) (local-vars (v0-3 sound-id) (sv-48 int)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this root-override trans quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) (+! (-> s4-0 y) -20480.0) (let* ((v1-1 (-> this water-entity)) (a0-4 (if v1-1 @@ -380,7 +368,7 @@ :post plat-post ) -(defmethod deactivate square-platform ((this square-platform)) +(defmethod deactivate ((this square-platform)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -394,7 +382,7 @@ (none) ) -(defmethod relocate square-platform ((this square-platform) (arg0 int)) +(defmethod relocate ((this square-platform) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -407,7 +395,7 @@ (call-parent-method this arg0) ) -(defmethod init-from-entity! square-platform ((this square-platform) (arg0 entity-actor)) +(defmethod init-from-entity! ((this square-platform) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) (set! (-> this pos-u) 0.0) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -428,7 +416,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set! (-> this link) (new 'process 'actor-link-info this)) @@ -460,20 +448,20 @@ ) ) ) - (set! (-> this down-pos quad) (-> this root-override trans quad)) + (set! (-> this down-pos quad) (-> this root trans quad)) (+! (-> this down-pos y) f30-0) - (set! (-> this up-pos quad) (-> this root-override trans quad)) + (set! (-> this up-pos quad) (-> this root trans quad)) (+! (-> this up-pos y) f0-10) ) ) (set! (-> this basetrans quad) (-> this down-pos quad)) - (set! (-> this root-override trans quad) (-> this basetrans quad)) + (set! (-> this root trans quad) (-> this basetrans quad)) (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 437) this)) (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 438) this)) (set! (-> this part4) (create-launch-control (-> *part-group-id-table* 439) this)) (set! (-> this water-entity) (entity-actor-lookup arg0 'alt-actor 0)) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go square-platform-lowered) (none) ) @@ -638,7 +626,7 @@ ) ) -(defmethod init-from-entity! square-platform-master ((this square-platform-master) (arg0 entity-actor)) +(defmethod init-from-entity! ((this square-platform-master) (arg0 entity-actor)) (set! (-> this button-id) -1) (set! (-> this plat-id) -1) (set! (-> this root) (new 'process 'trsqv)) diff --git a/goal_src/jak1/levels/sunken/steam-cap.gc b/goal_src/jak1/levels/sunken/steam-cap.gc index 70a1b78d0f4..ed30b9393c2 100644 --- a/goal_src/jak1/levels/sunken/steam-cap.gc +++ b/goal_src/jak1/levels/sunken/steam-cap.gc @@ -8,36 +8,29 @@ ;; DECOMP BEGINS (deftype steam-cap-control-pt (structure) - ((trans vector :inline :offset-assert 0) - (transv vector :inline :offset-assert 16) + ((trans vector :inline) + (transv vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype steam-cap (process-drawable) - ((root-override collide-shape-moving :offset 112) - (do-burst? symbol :offset-assert 176) - (do-falling-sound? symbol :offset-assert 180) - (do-landing-sound? symbol :offset-assert 184) - (begin-travel-up float :offset-assert 188) - (begin-travel-down float :offset-assert 192) - (sync sync-info :inline :offset-assert 196) - (part2 sparticle-launch-control :offset-assert 204) - (part3 sparticle-launch-control :offset-assert 208) - (down vector :inline :offset-assert 224) - (up vector :inline :offset-assert 240) - (control-pt steam-cap-control-pt 3 :inline :offset-assert 256) + ((root collide-shape-moving :override) + (do-burst? symbol) + (do-falling-sound? symbol) + (do-landing-sound? symbol) + (begin-travel-up float) + (begin-travel-down float) + (sync sync-info :inline) + (part2 sparticle-launch-control) + (part3 sparticle-launch-control) + (down vector :inline) + (up vector :inline) + (control-pt steam-cap-control-pt 3 :inline) ) - :heap-base #xf0 - :method-count-assert 22 - :size-assert #x160 - :flag-assert #x1600f00160 (:methods - (steam-cap-method-20 (_type_) none 20) - (steam-cap-method-21 (_type_) quaternion 21) + (steam-cap-method-20 (_type_) none) + (steam-cap-method-21 (_type_) quaternion) ) (:states steam-cap-idle @@ -410,23 +403,23 @@ :bounds (static-spherem 0 0 0 3) ) -(defmethod steam-cap-method-20 steam-cap ((this steam-cap)) +(defmethod steam-cap-method-20 ((this steam-cap)) (when *target* (let* ((a1-0 (target-pos 0)) (f0-0 (-> a1-0 y)) ) (when (and (>= f0-0 (+ -8192.0 (-> this down y))) - (and (>= (+ -4096.0 (-> this root-override trans y)) f0-0) (zero? (-> this root-override riders num-riders))) + (and (>= (+ -4096.0 (-> this root trans y)) f0-0) (zero? (-> this root riders num-riders))) ) (let ((f0-1 (vector-vector-xz-distance-squared (-> this down) a1-0))) (when (>= 104857600.0 f0-1) (let ((s5-0 (>= 37748736.0 f0-1))) (when (not s5-0) - (when (>= (- (-> this root-override trans y) (-> this down y)) 3072.0) + (when (>= (- (-> this root trans y) (-> this down y)) 3072.0) (let ((a1-1 (new 'stack-no-clear 'vector))) (set! (-> a1-1 x) (the-as float 1)) (set! (-> a1-1 y) (the-as float #f)) - (if (find-overlapping-shapes (-> this root-override) (the-as overlaps-others-params a1-1)) + (if (find-overlapping-shapes (-> this root) (the-as overlaps-others-params a1-1)) (set! s5-0 #t) ) ) @@ -444,7 +437,7 @@ (none) ) -(defmethod steam-cap-method-21 steam-cap ((this steam-cap)) +(defmethod steam-cap-method-21 ((this steam-cap)) (local-vars (at-0 int) (at-1 int) (s5-0 symbol)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -491,7 +484,7 @@ (when (< f30-1 0.94) (spawn (-> this part2) (-> this down)) (let ((a1-8 (new 'stack-no-clear 'vector))) - (set! (-> a1-8 quad) (-> this root-override trans quad)) + (set! (-> a1-8 quad) (-> this root trans quad)) (+! (-> a1-8 y) -3072.0) (spawn (-> this part3) a1-8) ) @@ -609,9 +602,9 @@ (let ((f0-32 (* 0.33333334 f0-31)) (a1-16 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-16 quad) (-> this root-override trans quad)) + (set! (-> a1-16 quad) (-> this root trans quad)) (set! (-> a1-16 y) f0-32) - (move-to-point! (-> this root-override) a1-16) + (move-to-point! (-> this root) a1-16) ) ) (let ((v1-77 (new 'stack-no-clear 'vector)) @@ -623,8 +616,8 @@ (vector-cross! s5-1 v1-77 a0-35) (vector-normalize! s5-1 1.0) (forward-up-nopitch->quaternion - (-> this root-override quat) - (vector-z-quaternion! (new-stack-vector0) (-> this root-override quat)) + (-> this root quat) + (vector-z-quaternion! (new-stack-vector0) (-> this root quat)) s5-1 ) ) @@ -643,7 +636,7 @@ :post rider-post ) -(defmethod relocate steam-cap ((this steam-cap) (arg0 int)) +(defmethod relocate ((this steam-cap) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -653,7 +646,7 @@ (call-parent-method this arg0) ) -(defmethod deactivate steam-cap ((this steam-cap)) +(defmethod deactivate ((this steam-cap)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -664,7 +657,7 @@ (none) ) -(defmethod init-from-entity! steam-cap ((this steam-cap) (arg0 entity-actor)) +(defmethod init-from-entity! ((this steam-cap) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -685,7 +678,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (set! (-> this do-burst?) #f) (set! (-> this do-falling-sound?) #f) @@ -702,7 +695,7 @@ ) (set! (-> s4-1 frame-num) 0.0) ) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (load-params! (-> this sync) this (the-as uint 1800) 0.0 0.15 0.15) (let ((f30-0 0.4) (f28-0 0.9) @@ -730,13 +723,13 @@ (set! (-> this begin-travel-up) f30-0) (set! (-> this begin-travel-down) f28-0) ) - (set! (-> this down quad) (-> this root-override trans quad)) - (set! (-> this up quad) (-> this root-override trans quad)) + (set! (-> this down quad) (-> this root trans quad)) + (set! (-> this up quad) (-> this root trans quad)) (+! (-> this up y) 40960.0) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 441) this)) (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 442) this)) (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 443) this)) - (vector-reset! (-> this root-override transv)) + (vector-reset! (-> this root transv)) (let ((s5-1 (new 'stack-no-clear 'vector)) (f30-1 0.0) ) @@ -745,7 +738,7 @@ (set-vector! s5-1 0.0 0.0 10240.0 1.0) (vector-rotate-around-y! s5-1 s5-1 f30-1) (set! f30-1 (+ 21845.334 f30-1)) - (vector+! (-> s3-1 trans) s5-1 (-> this root-override trans)) + (vector+! (-> s3-1 trans) s5-1 (-> this root trans)) (vector-reset! (-> s3-1 transv)) ) ) diff --git a/goal_src/jak1/levels/sunken/sun-exit-chamber.gc b/goal_src/jak1/levels/sunken/sun-exit-chamber.gc index fc8e2c4af25..79eecfd90fb 100644 --- a/goal_src/jak1/levels/sunken/sun-exit-chamber.gc +++ b/goal_src/jak1/levels/sunken/sun-exit-chamber.gc @@ -11,18 +11,14 @@ ;; DECOMP BEGINS (deftype blue-eco-charger-orb (process-drawable) - ((parent-process (pointer blue-eco-charger) :offset 12) - (orbit-rot vector :inline :offset-assert 176) - (orbit-rotv vector :inline :offset-assert 192) - (targ-orbit-rotv vector :inline :offset-assert 208) - (rest-pos vector :inline :offset-assert 224) + ((parent-process (pointer blue-eco-charger) :overlay-at parent) + (orbit-rot vector :inline) + (orbit-rotv vector :inline) + (targ-orbit-rotv vector :inline) + (rest-pos vector :inline) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #xf0 - :flag-assert #x15008000f0 (:methods - (blue-eco-charger-orb-method-20 (_type_ float) vector 20) + (blue-eco-charger-orb-method-20 (_type_ float) vector) ) (:states blue-eco-charger-orb-active @@ -37,18 +33,14 @@ ) (deftype blue-eco-charger (process-drawable) - ((root-override collide-shape :offset 112) - (charger-id int32 :offset-assert 176) - (open-level float :offset-assert 180) - (master entity-actor :offset-assert 184) + ((root collide-shape :override) + (charger-id int32) + (open-level float) + (master entity-actor) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xbc - :flag-assert #x16005000bc (:methods - (blue-eco-charger-method-20 (_type_) object 20) - (blue-eco-charger-method-21 (_type_ symbol) object 21) + (blue-eco-charger-method-20 (_type_) object) + (blue-eco-charger-method-21 (_type_ symbol) object) ) (:states blue-eco-charger-close @@ -65,41 +57,34 @@ ) (deftype exit-chamber-items (structure) - ((door-pos vector :inline :offset-assert 0) - (door-quat quaternion :inline :offset-assert 16) - (button-pos vector :inline :offset-assert 32) - (button-quat quaternion :inline :offset-assert 48) - (fcell-pos vector :inline :offset-assert 64) + ((door-pos vector :inline) + (door-quat quaternion :inline) + (button-pos vector :inline) + (button-quat quaternion :inline) + (fcell-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype exit-chamber (process-drawable) - ((root-override collide-shape-moving :offset 112) - (chargers-active uint32 :offset-assert 176) - (move-player? symbol :offset-assert 180) - (move-fcell? symbol :offset-assert 184) - (play-assistant-message? symbol :offset-assert 188) - (wave-scale float :offset-assert 192) - (button (pointer exit-chamber-button) :offset-assert 196) - (door (pointer sun-iris-door) :offset-assert 200) - (fcell-handle handle :offset-assert 208) - (orig-trans vector :inline :offset-assert 224) - (last-pos vector :inline :offset-assert 240) + ((root collide-shape-moving :override) + (chargers-active uint32) + (move-player? symbol) + (move-fcell? symbol) + (play-assistant-message? symbol) + (wave-scale float) + (button (pointer exit-chamber-button)) + (door (pointer sun-iris-door)) + (fcell-handle handle) + (orig-trans vector :inline) + (last-pos vector :inline) ) - :heap-base #x90 - :method-count-assert 25 - :size-assert #x100 - :flag-assert #x1900900100 (:methods - (exit-chamber-method-20 (_type_ float) float 20) - (exit-chamber-method-21 (_type_ exit-chamber-items) vector 21) - (exit-chamber-method-22 (_type_) none 22) - (exit-chamber-method-23 (_type_ symbol) object 23) - (exit-chamber-method-24 (_type_ float) none 24) + (exit-chamber-method-20 (_type_ float) float) + (exit-chamber-method-21 (_type_ exit-chamber-items) vector) + (exit-chamber-method-22 (_type_) none) + (exit-chamber-method-23 (_type_ symbol) object) + (exit-chamber-method-24 (_type_ float) none) ) (:states exit-chamber-charger-puzzle @@ -181,7 +166,7 @@ ) ) -(defmethod blue-eco-charger-orb-method-20 blue-eco-charger-orb ((this blue-eco-charger-orb) (arg0 float)) +(defmethod blue-eco-charger-orb-method-20 ((this blue-eco-charger-orb) (arg0 float)) (set-vector! (-> this targ-orbit-rotv) (rand-vu-float-range 72817.78 258503.11) @@ -274,7 +259,7 @@ (set! (-> gp-1 y) (rand-vu-float-range -4096.0 4096.0)) (set! (-> gp-1 z) (rand-vu-float-range -4096.0 4096.0)) (vector+! gp-1 gp-1 (-> self root trans)) - (vector-lerp! gp-1 gp-1 (-> self parent-process 0 root-override trans) (rand-vu-float-range 0.2 0.8)) + (vector-lerp! gp-1 gp-1 (-> self parent-process 0 root trans) (rand-vu-float-range 0.2 0.8)) (eco-blue-glow gp-1) ) (suspend) @@ -302,7 +287,7 @@ (none) ) -(defmethod blue-eco-charger-method-21 blue-eco-charger ((this blue-eco-charger) (arg0 symbol)) +(defmethod blue-eco-charger-method-21 ((this blue-eco-charger) (arg0 symbol)) (let* ((v1-0 (-> this master)) (a0-1 (if v1-0 (-> v1-0 extra process) @@ -332,8 +317,8 @@ ) ) -(defmethod blue-eco-charger-method-20 blue-eco-charger ((this blue-eco-charger)) - (and (and *target* (>= 16384.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans)))) +(defmethod blue-eco-charger-method-20 ((this blue-eco-charger)) + (and (and *target* (>= 16384.0 (vector-vector-distance (-> this root trans) (-> *target* control trans)))) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) @@ -345,7 +330,7 @@ (ja :group! blue-eco-charger-open-ja :num! min) (loop (when (logtest? (-> self draw status) (draw-status was-drawn)) - (if (and (and *target* (>= 16384.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and (and *target* (>= 16384.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (level-hint-spawn @@ -452,7 +437,7 @@ :post ja-post ) -(defmethod init-from-entity! blue-eco-charger ((this blue-eco-charger) (arg0 entity-actor)) +(defmethod init-from-entity! ((this blue-eco-charger) (arg0 entity-actor)) (set! (-> this open-level) 0.0) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -466,13 +451,13 @@ ) (set! (-> s4-0 nav-radius) 6553.6) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *blue-eco-charger-sg* '()) (let ((f0-6 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-6 0.0) - (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-6) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-6) ) ) (ja-channel-set! 1) @@ -485,14 +470,14 @@ (set! (-> s4-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (update-transforms! (-> this root)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (set! (-> this master) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> this link) (new 'process 'actor-link-info this)) (set! (-> this charger-id) (+ (actor-count-before (-> this link)) 1)) (process-spawn blue-eco-charger-orb (-> this entity) this :to this) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "blue-eco-charg" :fo-max 35) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "blue-eco-charg" :fo-max 35) (-> this root trans)) ) (if (zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) (go blue-eco-charger-idle) @@ -503,10 +488,6 @@ (deftype exit-chamber-button (basebutton) () - :heap-base #x90 - :method-count-assert 32 - :size-assert #x100 - :flag-assert #x2000900100 ) @@ -515,8 +496,8 @@ (none) ) -(defmethod exit-chamber-method-20 exit-chamber ((this exit-chamber) (arg0 float)) - (set! (-> this root-override trans y) +(defmethod exit-chamber-method-20 ((this exit-chamber) (arg0 float)) + (set! (-> this root trans y) (+ (-> this orig-trans y) (* 2252.8 arg0 (cos (* 36.40889 (the float (mod (current-time) 1800)))))) ) ) @@ -540,7 +521,7 @@ ) ) -(defmethod exit-chamber-method-24 exit-chamber ((this exit-chamber) (arg0 float)) +(defmethod exit-chamber-method-24 ((this exit-chamber) (arg0 float)) (let ((s4-0 (-> this node-list data 3 bone transform)) (f30-0 (rand-vu-float-range 0.0 65536.0)) (f28-0 (rand-vu-float-range 8192.0 40960.0)) @@ -555,7 +536,7 @@ (none) ) -(defmethod exit-chamber-method-21 exit-chamber ((this exit-chamber) (arg0 exit-chamber-items)) +(defmethod exit-chamber-method-21 ((this exit-chamber) (arg0 exit-chamber-items)) (let ((s5-0 (-> this node-list data 3 bone transform))) (set-vector! (-> arg0 door-pos) 0.0 13107.2 -40960.0 1.0) (vector-matrix*! (-> arg0 door-pos) (-> arg0 door-pos) s5-0) @@ -571,11 +552,11 @@ (vector-float*! (-> arg0 fcell-pos) (-> arg0 fcell-pos) (/ 1.0 (-> arg0 fcell-pos w))) ) -(defmethod exit-chamber-method-23 exit-chamber ((this exit-chamber) (arg0 symbol)) +(defmethod exit-chamber-method-23 ((this exit-chamber) (arg0 symbol)) (new 'stack-no-clear 'vector) (let ((s5-0 (new 'stack-no-clear 'vector))) (vector<-cspace! (-> this last-pos) (-> this node-list data 3)) - (vector-! s5-0 (-> this last-pos) (-> this root-override trans)) + (vector-! s5-0 (-> this last-pos) (-> this root trans)) (set! (-> this draw bounds quad) (-> s5-0 quad)) ) (+! (-> this draw bounds y) 16384.0) @@ -599,7 +580,7 @@ (when arg0 (let ((a0-12 (handle->process (-> this fcell-handle)))) (when a0-12 - (when (or (-> this move-fcell?) (< (-> (the-as fuel-cell a0-12) root-override trans y) (-> s5-1 fcell-pos y))) + (when (or (-> this move-fcell?) (< (-> (the-as fuel-cell a0-12) root trans y) (-> s5-1 fcell-pos y))) (when (not (-> this move-fcell?)) (set! (-> this move-fcell?) #t) (let ((v1-50 (-> this entity extra perm))) @@ -654,7 +635,7 @@ ) :code (behavior () (loop - (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root-override trans))) + (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root trans))) (logclear! (-> self draw status) (draw-status hidden)) (logior! (-> self draw status) (draw-status hidden)) ) @@ -666,16 +647,7 @@ (defstate exit-chamber-charger-puzzle-beaten (exit-chamber) :code (behavior () - (process-spawn - pov-camera - (-> self root-override trans) - *sunkencam-sg* - "exit-chamber-door-open" - 0 - #f - '() - :to self - ) + (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "exit-chamber-door-open" 0 #f '() :to self) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 2.5)) (suspend) @@ -722,7 +694,7 @@ (send-event (ppointer->process (-> self button)) 'untrigger) ) (loop - (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root-override trans))) + (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root trans))) (logclear! (-> self draw status) (draw-status hidden)) (logior! (-> self draw status) (draw-status hidden)) ) @@ -744,7 +716,7 @@ (aybabtu 2) (let ((v1-1 (handle->process (-> self fcell-handle)))) (if v1-1 - (clear-collide-with-as (-> (the-as fuel-cell v1-1) root-override)) + (clear-collide-with-as (-> (the-as fuel-cell v1-1) root)) ) ) (close-specific-task! (game-task sunken-room) (task-status need-reminder)) @@ -757,7 +729,7 @@ (run-now-in-process gp-0 pov-camera-init-by-other - (-> self root-override trans) + (-> self root trans) *sunkencam-sg* "qbert-show-door-open" 0 @@ -835,7 +807,7 @@ (send-event *target* 'dry) (let ((v1-143 (handle->process (-> self fcell-handle)))) (if v1-143 - (restore-collide-with-as (-> (the-as fuel-cell v1-143) root-override)) + (restore-collide-with-as (-> (the-as fuel-cell v1-143) root)) ) ) (set-time! (-> self state-time)) @@ -947,7 +919,7 @@ (set! (-> self move-player?) #t) (let ((v1-2 (handle->process (-> self fcell-handle)))) (if v1-2 - (clear-collide-with-as (-> (the-as fuel-cell v1-2) root-override)) + (clear-collide-with-as (-> (the-as fuel-cell v1-2) root)) ) ) ) @@ -962,7 +934,7 @@ (let ((v1-1 (process-spawn sunkencam :init pov-camera-init-by-other - (-> self root-override trans) + (-> self root trans) *sunkencam-sg* "qbert-show-door-open" 0 @@ -1026,7 +998,7 @@ ) (let ((v1-109 (handle->process (-> self fcell-handle)))) (if v1-109 - (restore-collide-with-as (-> (the-as fuel-cell v1-109) root-override)) + (restore-collide-with-as (-> (the-as fuel-cell v1-109) root)) ) ) (set-time! (-> self state-time)) @@ -1045,7 +1017,7 @@ ) ) -(defmethod init-from-entity! exit-chamber ((this exit-chamber) (arg0 entity-actor)) +(defmethod init-from-entity! ((this exit-chamber) (arg0 entity-actor)) (process-entity-status! this (entity-perm-status bit-3) #t) (process-entity-status! this (entity-perm-status bit-7) #t) (set! (-> this move-player?) #f) @@ -1071,7 +1043,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *exit-chamber-sg* '()) @@ -1126,7 +1098,7 @@ ) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (exit-chamber-method-21 this (the-as exit-chamber-items s3-1)) (let ((s1-3 #t)) (let ((v1-64 s4-1)) @@ -1146,12 +1118,8 @@ (set! (-> this button) (process-spawn exit-chamber-button (-> s3-1 vector 2) (-> s3-1 vector 3) arg0 #f :to this) ) - (set! (-> this sound) (new - 'process - 'ambient-sound - (static-sound-spec "chamber-move" :fo-min 300 :fo-max 400) - (-> this root-override trans) - ) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "chamber-move" :fo-min 300 :fo-max 400) (-> this root trans)) ) (when (not (task-complete? *game-info* (game-task sunken-room))) (let ((a0-40 (new 'stack-no-clear 'vector))) @@ -1172,8 +1140,8 @@ ) ) ) - (set! (-> this orig-trans quad) (-> this root-override trans quad)) - (set! (-> this last-pos quad) (-> this root-override trans quad)) + (set! (-> this orig-trans quad) (-> this root trans quad)) + (set! (-> this last-pos quad) (-> this root trans quad)) (set! (-> this move-player?) #f) (exit-chamber-method-23 this #t) (set! (-> this move-player?) #f) diff --git a/goal_src/jak1/levels/sunken/sun-iris-door.gc b/goal_src/jak1/levels/sunken/sun-iris-door.gc index 8125db28203..d7b40f132c2 100644 --- a/goal_src/jak1/levels/sunken/sun-iris-door.gc +++ b/goal_src/jak1/levels/sunken/sun-iris-door.gc @@ -8,25 +8,21 @@ ;; DECOMP BEGINS (deftype sun-iris-door (process-drawable) - ((root-override collide-shape :offset 112) - (timeout float :offset-assert 176) - (proximity? symbol :offset-assert 180) - (directional-proximity? symbol :offset-assert 184) - (move-to? symbol :offset-assert 188) - (locked-by-task? symbol :offset-assert 192) - (close-dist float :offset-assert 196) - (open-dist float :offset-assert 200) - (move-to-pos vector :inline :offset-assert 208) - (outward-vec vector :inline :offset-assert 224) - (move-to-quat quaternion :inline :offset-assert 240) + ((root collide-shape :override) + (timeout float) + (proximity? symbol) + (directional-proximity? symbol) + (move-to? symbol) + (locked-by-task? symbol) + (close-dist float) + (open-dist float) + (move-to-pos vector :inline) + (outward-vec vector :inline) + (move-to-quat quaternion :inline) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x100 - :flag-assert #x1600900100 (:methods - (should-close? (_type_) symbol 20) - (should-open? (_type_) symbol 21) + (should-close? (_type_) symbol) + (should-open? (_type_) symbol) ) (:states sun-iris-door-closed @@ -42,27 +38,27 @@ :bounds (static-spherem 0 0 0 4.5) ) -(defmethod should-open? sun-iris-door ((this sun-iris-door)) +(defmethod should-open? ((this sun-iris-door)) (let ((f30-0 1228800.0)) 0.0 (let ((f0-7 (cond ((-> this directional-proximity?) (let ((s5-0 (new 'stack-no-clear 'vector))) (when *target* - (vector-! s5-0 (target-pos 0) (-> this root-override trans)) + (vector-! s5-0 (target-pos 0) (-> this root trans)) (set! (-> s5-0 y) 0.0) (set! f30-0 (fabs (vector-dot s5-0 (-> this outward-vec)))) ) - (vector-! s5-0 (camera-pos) (-> this root-override trans)) + (vector-! s5-0 (camera-pos) (-> this root trans)) (set! (-> s5-0 y) 0.0) (fabs (vector-dot s5-0 (-> this outward-vec))) ) ) (else (if *target* - (set! f30-0 (vector-vector-xz-distance (-> this root-override trans) (target-pos 0))) + (set! f30-0 (vector-vector-xz-distance (-> this root trans) (target-pos 0))) ) - (vector-vector-xz-distance (-> this root-override trans) (camera-pos)) + (vector-vector-xz-distance (-> this root trans) (camera-pos)) ) ) ) @@ -106,8 +102,8 @@ :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) - (move-to-point! (-> self root-override) (-> self move-to-pos)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (move-to-point! (-> self root) (-> self move-to-pos)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (ja-post) ) ) @@ -140,8 +136,8 @@ (cond ((-> self move-to?) (set! (-> self move-to?) #f) - (move-to-point! (-> self root-override) (-> self move-to-pos)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (move-to-point! (-> self root) (-> self move-to-pos)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (ja-post) ) (else @@ -151,27 +147,27 @@ ) ) -(defmethod should-close? sun-iris-door ((this sun-iris-door)) +(defmethod should-close? ((this sun-iris-door)) (let ((f30-0 1228800.0)) 0.0 (let ((f0-7 (cond ((-> this directional-proximity?) (let ((s5-0 (new 'stack-no-clear 'vector))) (when *target* - (vector-! s5-0 (target-pos 0) (-> this root-override trans)) + (vector-! s5-0 (target-pos 0) (-> this root trans)) (set! (-> s5-0 y) 0.0) (set! f30-0 (fabs (vector-dot s5-0 (-> this outward-vec)))) ) - (vector-! s5-0 (camera-pos) (-> this root-override trans)) + (vector-! s5-0 (camera-pos) (-> this root trans)) (set! (-> s5-0 y) 0.0) (fabs (vector-dot s5-0 (-> this outward-vec))) ) ) (else (if *target* - (set! f30-0 (vector-vector-xz-distance (-> this root-override trans) (target-pos 0))) + (set! f30-0 (vector-vector-xz-distance (-> this root trans) (target-pos 0))) ) - (vector-vector-xz-distance (-> this root-override trans) (camera-pos)) + (vector-vector-xz-distance (-> this root trans) (camera-pos)) ) ) ) @@ -182,9 +178,9 @@ (let ((s4-6 (new 'stack-no-clear 'vector)) (s5-3 (new 'stack-no-clear 'vector)) ) - (vector-! s4-6 (target-pos 0) (-> this root-override trans)) + (vector-! s4-6 (target-pos 0) (-> this root trans)) (set! (-> s4-6 y) 0.0) - (vector-! s5-3 (camera-pos) (-> this root-override trans)) + (vector-! s5-3 (camera-pos) (-> this root trans)) (set! (-> s5-3 y) 0.0) (case (>= (vector-dot (-> this outward-vec) s4-6) 0.0) (((>= (vector-dot (-> this outward-vec) s5-3) 0.0)) @@ -224,11 +220,11 @@ ) :enter (behavior () (set-time! (-> self state-time)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (logior! (-> self draw status) (draw-status hidden)) ) :exit (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (logclear! (-> self draw status) (draw-status hidden)) ) :trans (behavior () @@ -250,8 +246,8 @@ :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) - (move-to-point! (-> self root-override) (-> self move-to-pos)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (move-to-point! (-> self root) (-> self move-to-pos)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (ja-post) ) ) @@ -284,8 +280,8 @@ (cond ((-> self move-to?) (set! (-> self move-to?) #f) - (move-to-point! (-> self root-override) (-> self move-to-pos)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (move-to-point! (-> self root) (-> self move-to-pos)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (ja-post) ) (else @@ -295,7 +291,7 @@ ) ) -(defmethod init-from-entity! sun-iris-door ((this sun-iris-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sun-iris-door) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (set! (-> this move-to?) #f) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) @@ -310,7 +306,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *sun-iris-door-sg* '()) @@ -326,21 +322,21 @@ ) (set! (-> this locked-by-task?) (nonzero? (-> this entity extra perm task))) (let ((f0-11 (res-lump-float arg0 'scale-factor :default 1.0))) - (set-vector! (-> this root-override scale) f0-11 f0-11 f0-11 1.0) + (set-vector! (-> this root scale) f0-11 f0-11 f0-11 1.0) (set! (-> this draw bounds w) (* 18432.0 f0-11)) - (let ((v1-25 (-> this root-override root-prim))) + (let ((v1-25 (-> this root root-prim))) (set! (-> v1-25 local-sphere w) (* 24576.0 f0-11 f0-11)) ) ) (set! sv-16 (new 'static 'res-tag)) (let ((v1-28 (res-lump-data (-> this entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-28 - (+! (-> this root-override trans x) (-> v1-28 0)) - (+! (-> this root-override trans y) (-> v1-28 1)) - (+! (-> this root-override trans z) (-> v1-28 2)) + (+! (-> this root trans x) (-> v1-28 0)) + (+! (-> this root trans y) (-> v1-28 1)) + (+! (-> this root trans z) (-> v1-28 2)) ) ) - (let ((f30-0 (quaternion-y-angle (-> this root-override quat)))) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (set-vector! (-> this outward-vec) (sin f30-0) 0.0 (cos f30-0) 1.0) ) (ja-channel-set! 1) @@ -352,7 +348,7 @@ ) (set! (-> s5-2 frame-num) 0.0) ) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (ja-post) (go sun-iris-door-closed) (none) @@ -372,10 +368,10 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-copy! (-> self root-override quat) arg1) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) (initialize-skeleton self *sun-iris-door-sg* '()) (set! (-> self close-dist) 49152.0) (set! (-> self open-dist) 40960.0) diff --git a/goal_src/jak1/levels/sunken/sunken-fish.gc b/goal_src/jak1/levels/sunken/sunken-fish.gc index f77f1d83a5e..cf23f5e7a23 100644 --- a/goal_src/jak1/levels/sunken/sunken-fish.gc +++ b/goal_src/jak1/levels/sunken/sunken-fish.gc @@ -8,34 +8,30 @@ ;; DECOMP BEGINS (deftype sunkenfisha (process-drawable) - ((path-u float :offset-assert 176) - (path-speed float :offset-assert 180) - (path-speed-seek-speed float :offset-assert 184) - (targ-path-speed float :offset-assert 188) - (path-normal-speed-lo float :offset-assert 192) - (path-normal-speed-hi float :offset-assert 196) - (path-dir float :offset-assert 200) - (change-path-dir-time time-frame :offset-assert 208) - (local-path-offset vector :inline :offset-assert 224) - (targ-local-path-offset vector :inline :offset-assert 240) - (local-path-offset-dir vector :inline :offset-assert 256) - (max-local-path-offset vector :inline :offset-assert 272) - (facing-rot vector :inline :offset-assert 288) - (path-trans-offset vector :inline :offset-assert 304) + ((path-u float) + (path-speed float) + (path-speed-seek-speed float) + (targ-path-speed float) + (path-normal-speed-lo float) + (path-normal-speed-hi float) + (path-dir float) + (change-path-dir-time time-frame) + (local-path-offset vector :inline) + (targ-local-path-offset vector :inline) + (local-path-offset-dir vector :inline) + (max-local-path-offset vector :inline) + (facing-rot vector :inline) + (path-trans-offset vector :inline) ) - :heap-base #xd0 - :method-count-assert 28 - :size-assert #x140 - :flag-assert #x1c00d00140 (:methods - (sunkenfisha-method-20 (_type_) float 20) - (sunkenfisha-method-21 (_type_ vector float vector) vector 21) - (sunkenfisha-method-22 (_type_) none 22) - (sunkenfisha-method-23 (_type_) quaternion 23) - (sunkenfisha-method-24 (_type_) vector 24) - (sunkenfisha-method-25 (_type_) none 25) - (sunkenfisha-method-26 (_type_) float 26) - (sunkenfisha-method-27 (_type_) float 27) + (sunkenfisha-method-20 (_type_) float) + (sunkenfisha-method-21 (_type_ vector float vector) vector) + (sunkenfisha-method-22 (_type_) none) + (sunkenfisha-method-23 (_type_) quaternion) + (sunkenfisha-method-24 (_type_) vector) + (sunkenfisha-method-25 (_type_) none) + (sunkenfisha-method-26 (_type_) float) + (sunkenfisha-method-27 (_type_) float) ) (:states sunkenfisha-idle @@ -58,12 +54,12 @@ :bounds (static-spherem 0 1.5 0 2.5) ) -(defmethod sunkenfisha-method-22 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-22 ((this sunkenfisha)) 0 (none) ) -(defmethod sunkenfisha-method-21 sunkenfisha ((this sunkenfisha) (arg0 vector) (arg1 float) (arg2 vector)) +(defmethod sunkenfisha-method-21 ((this sunkenfisha) (arg0 vector) (arg1 float) (arg2 vector)) (eval-path-curve! (-> this path) arg0 arg1 'interp) (vector+! arg0 arg0 (-> this path-trans-offset)) (let ((s2-0 (new 'stack-no-clear 'vector))) @@ -77,7 +73,7 @@ ) ) -(defmethod sunkenfisha-method-24 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-24 ((this sunkenfisha)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'matrix)) (gp-0 (new 'stack-no-clear 'vector)) @@ -109,7 +105,7 @@ ) ) -(defmethod sunkenfisha-method-25 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-25 ((this sunkenfisha)) (let* ((f0-0 (-> this path-speed)) (f1-1 (seek f0-0 (-> this targ-path-speed) (* (-> this path-speed-seek-speed) (seconds-per-frame)))) ) @@ -131,7 +127,7 @@ (none) ) -(defmethod sunkenfisha-method-23 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-23 ((this sunkenfisha)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set-vector! s5-0 (- (vector-x-angle (-> this root transv))) (vector-y-angle (-> this root transv)) 0.0 1.0) (set! (-> this facing-rot x) @@ -144,7 +140,7 @@ (quaternion-zxy! (-> this root quat) (-> this facing-rot)) ) -(defmethod sunkenfisha-method-20 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-20 ((this sunkenfisha)) (set! (-> this path-dir) (- (-> this path-dir))) (set! (-> this path-speed) 0.0) (set! (-> this targ-path-speed) @@ -209,7 +205,7 @@ :post ja-post ) -(defmethod sunkenfisha-method-26 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-26 ((this sunkenfisha)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this (-> this entity)) (set-vector! (-> this root scale) 6.0 6.0 6.0 1.0) @@ -237,7 +233,7 @@ ) ) -(defmethod sunkenfisha-method-27 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-27 ((this sunkenfisha)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) (vector-reset! (-> this path-trans-offset)) (set! (-> this path-u) (rand-vu-float-range 0.0 1.0)) @@ -322,7 +318,7 @@ (none) ) -(defmethod init-from-entity! sunkenfisha ((this sunkenfisha) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sunkenfisha) (arg0 entity-actor)) (sunkenfisha-method-26 this) (sunkenfisha-method-27 this) (let ((s5-0 (+ (res-lump-value (-> this entity) 'count uint128 :default (the-as uint128 1)) -1))) diff --git a/goal_src/jak1/levels/sunken/sunken-obs.gc b/goal_src/jak1/levels/sunken/sunken-obs.gc index b71b0f22711..d2f504430ab 100644 --- a/goal_src/jak1/levels/sunken/sunken-obs.gc +++ b/goal_src/jak1/levels/sunken/sunken-obs.gc @@ -12,19 +12,12 @@ (deftype water-vol-deadly (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) (deftype side-to-side-plat (plat) - ((part-ry float :offset-assert 264) + ((part-ry float) ) - :heap-base #xa0 - :method-count-assert 33 - :size-assert #x10c - :flag-assert #x2100a0010c ) @@ -85,11 +78,11 @@ ) ) -(defmethod get-unlit-skel side-to-side-plat ((this side-to-side-plat)) +(defmethod get-unlit-skel ((this side-to-side-plat)) *side-to-side-plat-sg* ) -(defmethod baseplat-method-24 side-to-side-plat ((this side-to-side-plat)) +(defmethod baseplat-method-24 ((this side-to-side-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -108,41 +101,37 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod baseplat-method-26 side-to-side-plat ((this side-to-side-plat)) - (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root-override quat)))) +(defmethod baseplat-method-26 ((this side-to-side-plat)) + (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root quat)))) (none) ) -(defmethod baseplat-method-25 side-to-side-plat ((this side-to-side-plat)) +(defmethod baseplat-method-25 ((this side-to-side-plat)) (let ((v0-0 (create-launch-control (-> *part-group-id-table* 436) this))) (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) ) ) -(defmethod baseplat-method-20 side-to-side-plat ((this side-to-side-plat)) +(defmethod baseplat-method-20 ((this side-to-side-plat)) (when (nonzero? (-> this part)) (set! (-> *part-id-table* 1713 init-specs 14 initial-valuef) (-> this part-ry)) (set! (-> *part-id-table* 1714 init-specs 19 initial-valuef) (-> this part-ry)) - (spawn (-> this part) (-> this root-override trans)) + (spawn (-> this part) (-> this root trans)) ) (none) ) (deftype sunkencam (pov-camera) - ((ppointer-override (pointer sunkencam) :offset 24) - (seq uint64 :offset-assert 224) + ((ppointer-override (pointer sunkencam) :overlay-at ppointer) + (seq uint64) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xe8 - :flag-assert #x1e008000e8 ) @@ -151,7 +140,7 @@ :bounds (static-spherem 0 0 0 10) ) -(defmethod set-stack-size! sunkencam ((this sunkencam)) +(defmethod set-stack-size! ((this sunkencam)) (stack-size-set! (-> this main-thread) 512) (none) ) @@ -301,12 +290,8 @@ ) (deftype seaweed (process-drawable) - ((anim-speed float :offset-assert 176) + ((anim-speed float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states seaweed-idle ) @@ -336,7 +321,7 @@ :post ja-post ) -(defmethod init-from-entity! seaweed ((this seaweed) (arg0 entity-actor)) +(defmethod init-from-entity! ((this seaweed) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *seaweed-sg* '()) diff --git a/goal_src/jak1/levels/sunken/sunken-part.gc b/goal_src/jak1/levels/sunken/sunken-part.gc index 93c37a94bcd..bb658657a3c 100644 --- a/goal_src/jak1/levels/sunken/sunken-part.gc +++ b/goal_src/jak1/levels/sunken/sunken-part.gc @@ -9,10 +9,6 @@ (deftype sunken-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/sunken/sunken-pipegame.gc b/goal_src/jak1/levels/sunken/sunken-pipegame.gc index 43d2beed5be..8ebe459aaad 100644 --- a/goal_src/jak1/levels/sunken/sunken-pipegame.gc +++ b/goal_src/jak1/levels/sunken/sunken-pipegame.gc @@ -9,49 +9,38 @@ (deftype sunken-pipegame-button (basebutton) () - :heap-base #x90 - :method-count-assert 32 - :size-assert #x100 - :flag-assert #x2000900100 ) (deftype sunken-pipegame-prize (structure) - ((puzzle-delay time-frame :offset-assert 0) - (pipe-travel-time-to-far time-frame :offset-assert 8) - (pipe-travel-time-to-jar time-frame :offset-assert 16) - (actor-handle handle :offset-assert 24) - (jar-pos vector :inline :offset-assert 32) - (far-pos vector :inline :offset-assert 48) - (sucked-up-jar-part-pos vector :inline :offset-assert 64) - (sucked-up-far-part-pos vector :inline :offset-assert 80) - (blown-out-jar-part-pos vector :inline :offset-assert 96) - (blown-out-far-part-pos vector :inline :offset-assert 112) - (sucked-up-part sparticle-launch-control :offset-assert 128) - (blown-out-part sparticle-launch-control :offset-assert 132) + ((puzzle-delay time-frame) + (pipe-travel-time-to-far time-frame) + (pipe-travel-time-to-jar time-frame) + (actor-handle handle) + (jar-pos vector :inline) + (far-pos vector :inline) + (sucked-up-jar-part-pos vector :inline) + (sucked-up-far-part-pos vector :inline) + (blown-out-jar-part-pos vector :inline) + (blown-out-far-part-pos vector :inline) + (sucked-up-part sparticle-launch-control) + (blown-out-part sparticle-launch-control) ) - :method-count-assert 9 - :size-assert #x88 - :flag-assert #x900000088 ) (deftype sunken-pipegame (process-drawable) - ((abort-audio-if-beaten? symbol :offset-assert 176) - (challenges-mask uint32 :offset-assert 180) - (challenge int32 :offset-assert 184) - (ticker ticky :inline :offset-assert 192) - (button (pointer sunken-pipegame-button) 3 :offset-assert 224) - (prize sunken-pipegame-prize 3 :inline :offset-assert 240) + ((abort-audio-if-beaten? symbol) + (challenges-mask uint32) + (challenge int32) + (ticker ticky :inline) + (button (pointer sunken-pipegame-button) 3) + (prize sunken-pipegame-prize 3 :inline) ) - :heap-base #x230 - :method-count-assert 23 - :size-assert #x2a0 - :flag-assert #x17023002a0 (:methods - (sunken-pipegame-method-20 (_type_) uint 20) - (sunken-pipegame-method-21 (_type_ symbol) symbol 21) - (sunken-pipegame-method-22 (_type_ symbol) none 22) + (sunken-pipegame-method-20 (_type_) uint) + (sunken-pipegame-method-21 (_type_ symbol) symbol) + (sunken-pipegame-method-22 (_type_ symbol) none) ) (:states sunken-pipegame-beat-challenge @@ -489,7 +478,7 @@ (none) ) -(defmethod sunken-pipegame-method-20 sunken-pipegame ((this sunken-pipegame)) +(defmethod sunken-pipegame-method-20 ((this sunken-pipegame)) (let ((gp-0 0)) (if (task-complete? *game-info* (game-task sunken-pipe)) (+! gp-0 1) @@ -834,7 +823,7 @@ ) ) -(defmethod sunken-pipegame-method-22 sunken-pipegame ((this sunken-pipegame) (arg0 symbol)) +(defmethod sunken-pipegame-method-22 ((this sunken-pipegame) (arg0 symbol)) (let* ((v1-0 (-> this challenge)) (a2-0 v1-0) ) @@ -843,8 +832,8 @@ (let ((v1-5 (handle->process (-> this prize v1-0 actor-handle)))) (when v1-5 (if arg0 - (restore-collide-with-as (-> (the-as collectable v1-5) root-override)) - (clear-collide-with-as (-> (the-as collectable v1-5) root-override)) + (restore-collide-with-as (-> (the-as collectable v1-5) root)) + (clear-collide-with-as (-> (the-as collectable v1-5) root)) ) ) ) @@ -853,8 +842,8 @@ (let ((v1-13 (handle->process (-> this prize v1-0 actor-handle)))) (when v1-13 (if arg0 - (restore-collide-with-as (-> (the-as collectable v1-13) root-override)) - (clear-collide-with-as (-> (the-as collectable v1-13) root-override)) + (restore-collide-with-as (-> (the-as collectable v1-13) root)) + (clear-collide-with-as (-> (the-as collectable v1-13) root)) ) ) ) @@ -864,7 +853,7 @@ (none) ) -(defmethod sunken-pipegame-method-21 sunken-pipegame ((this sunken-pipegame) (arg0 symbol)) +(defmethod sunken-pipegame-method-21 ((this sunken-pipegame) (arg0 symbol)) (if arg0 (logior! (-> this mask) (process-mask actor-pause)) (logclear! (-> this mask) (process-mask actor-pause)) @@ -881,7 +870,7 @@ #f ) -(defmethod deactivate sunken-pipegame ((this sunken-pipegame)) +(defmethod deactivate ((this sunken-pipegame)) (dotimes (s5-0 3) (let ((s4-0 (-> this prize s5-0))) (if (nonzero? (-> s4-0 sucked-up-part)) @@ -896,7 +885,7 @@ (none) ) -(defmethod relocate sunken-pipegame ((this sunken-pipegame) (arg0 int)) +(defmethod relocate ((this sunken-pipegame) (arg0 int)) (dotimes (v1-0 3) (let ((a0-4 (-> this prize v1-0))) (when (nonzero? (-> a0-4 sucked-up-part)) @@ -914,7 +903,7 @@ (call-parent-method this arg0) ) -(defmethod init-from-entity! sunken-pipegame ((this sunken-pipegame) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sunken-pipegame) (arg0 entity-actor)) (set! (-> this abort-audio-if-beaten?) #f) (stack-size-set! (-> this main-thread) 512) (set! (-> this challenge) -1) @@ -962,7 +951,7 @@ ) (let ((a1-10 (handle->process (-> s0-0 actor-handle)))) (if a1-10 - (clear-collide-with-as (-> (the-as collectable a1-10) root-override)) + (clear-collide-with-as (-> (the-as collectable a1-10) root)) ) ) ) @@ -986,7 +975,7 @@ (let ((s0-1 (handle->process (-> s0-0 actor-handle)))) (when s0-1 (send-event s0-1 'movie-pos 1) - (clear-collide-with-as (-> (the-as collectable s0-1) root-override)) + (clear-collide-with-as (-> (the-as collectable s0-1) root)) ) ) ) @@ -1010,7 +999,7 @@ (let ((s0-2 (handle->process (-> s0-0 actor-handle)))) (when s0-2 (send-event s0-2 'movie-pos 2) - (clear-collide-with-as (-> (the-as collectable s0-2) root-override)) + (clear-collide-with-as (-> (the-as collectable s0-2) root)) ) ) ) diff --git a/goal_src/jak1/levels/sunken/sunken-water.gc b/goal_src/jak1/levels/sunken/sunken-water.gc index f0561c2abad..c94a2ff14e7 100644 --- a/goal_src/jak1/levels/sunken/sunken-water.gc +++ b/goal_src/jak1/levels/sunken/sunken-water.gc @@ -8,22 +8,18 @@ ;; DECOMP BEGINS (deftype sunken-water (water-anim) - ((use-sync? symbol :offset-assert 220) - (playing-deadly-sound? symbol :offset-assert 224) - (deadly-time float :offset-assert 228) - (deadly-fade float :offset-assert 232) - (sync sync-info :inline :offset-assert 236) - (safe-color-mult vector :inline :offset-assert 256) - (safe-color-emissive vector :inline :offset-assert 272) - (deadly-color-mult vector :inline :offset-assert 288) - (deadly-color-emissive vector :inline :offset-assert 304) + ((use-sync? symbol) + (playing-deadly-sound? symbol) + (deadly-time float) + (deadly-fade float) + (sync sync-info :inline) + (safe-color-mult vector :inline) + (safe-color-emissive vector :inline) + (deadly-color-mult vector :inline) + (deadly-color-emissive vector :inline) ) - :heap-base #xd0 - :method-count-assert 31 - :size-assert #x140 - :flag-assert #x1f00d00140 (:methods - (draw-ripple (_type_) symbol 30) + (draw-ripple (_type_) symbol) ) ) @@ -72,7 +68,7 @@ :init-specs ((:r 255.0) (:g 128.0 128.0) (:b 0.0) (:fade-a -1.28)) ) -(defmethod draw-ripple sunken-water ((this sunken-water)) +(defmethod draw-ripple ((this sunken-water)) (set! (-> this draw ripple send-query) #t) (let ((gp-0 (-> this draw ripple query))) (let ((a0-1 (current-time))) @@ -178,7 +174,7 @@ :post ja-post ) -(defmethod water-vol-method-25 sunken-water ((this sunken-water)) +(defmethod water-vol-method-25 ((this sunken-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-25))) (t9-0 this) ) @@ -223,7 +219,7 @@ (none) ) -(defmethod water-vol-method-22 sunken-water ((this sunken-water)) +(defmethod water-vol-method-22 ((this sunken-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/goal_src/jak1/levels/sunken/target-tube.gc b/goal_src/jak1/levels/sunken/target-tube.gc index 91271a9e1a6..b0af4d4639f 100644 --- a/goal_src/jak1/levels/sunken/target-tube.gc +++ b/goal_src/jak1/levels/sunken/target-tube.gc @@ -121,34 +121,28 @@ ) (deftype tube-info (basic) - ((entity basic :offset-assert 4) - (tube handle :offset-assert 8) - (downhill vector :inline :offset-assert 16) - (centertube vector :inline :offset-assert 32) - (downtube vector :inline :offset-assert 48) - (sidetube vector :inline :offset-assert 64) - (foretube vector :inline :offset-assert 80) - (old-transv vector :inline :offset-assert 96) - (mod-x float :offset-assert 112) - (mod-y float :offset-assert 116) - (start-time time-frame :offset-assert 120) - (turn-anim-targ float :offset-assert 128) - (turn-anim-frame float :offset-assert 132) - (turn-anim-vel float :offset-assert 136) - (tube-sound-id sound-id :offset-assert 140) - (tube-sound-vol float :offset-assert 144) + ((entity basic) + (tube handle) + (downhill vector :inline) + (centertube vector :inline) + (downtube vector :inline) + (sidetube vector :inline) + (foretube vector :inline) + (old-transv vector :inline) + (mod-x float) + (mod-y float) + (start-time time-frame) + (turn-anim-targ float) + (turn-anim-frame float) + (turn-anim-vel float) + (tube-sound-id sound-id) + (tube-sound-vol float) ) - :method-count-assert 9 - :size-assert #x94 - :flag-assert #x900000094 ) (deftype tube-bank (basic) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -760,7 +754,7 @@ (combine! gp-0 arg1) (when (= arg0 'attack) (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) @@ -794,7 +788,7 @@ (set! (-> a0-35 quad) (-> self control transv quad)) (s5-3 s4-2 (t9-9 a0-35 1.0) (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ))) ) - (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) (go target-tube-death (-> gp-0 mode)) ) ) @@ -846,19 +840,15 @@ ) (deftype slide-control (process-drawable) - ((target handle :offset-assert 176) - (pos float :offset-assert 184) - (trans vector :inline :offset-assert 192) - (rot vector :inline :offset-assert 208) - (side vector :inline :offset-assert 224) + ((target handle) + (pos float) + (trans vector :inline) + (rot vector :inline) + (side vector :inline) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf0 - :flag-assert #x16008000f0 - (:methods - (slide-control-watch () _type_ :state 20) - (slide-control-ride () _type_ :state 21) + (:state-methods + slide-control-watch + slide-control-ride ) ) @@ -988,7 +978,7 @@ :code anim-loop ) -(defmethod init-from-entity! slide-control ((this slide-control) (arg0 entity-actor)) +(defmethod init-from-entity! ((this slide-control) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/goal_src/jak1/levels/sunken/wall-plat.gc b/goal_src/jak1/levels/sunken/wall-plat.gc index 7ccd1faa7c3..fe637b12542 100644 --- a/goal_src/jak1/levels/sunken/wall-plat.gc +++ b/goal_src/jak1/levels/sunken/wall-plat.gc @@ -10,17 +10,13 @@ ;; DECOMP BEGINS (deftype wall-plat (process-drawable) - ((root-override collide-shape-moving :offset 112) - (use-sync? symbol :offset-assert 176) - (extended-amount float :offset-assert 180) - (in-trans vector :inline :offset-assert 192) - (out-trans vector :inline :offset-assert 208) - (sync sync-info-paused :inline :offset-assert 224) + ((root collide-shape-moving :override) + (use-sync? symbol) + (extended-amount float) + (in-trans vector :inline) + (out-trans vector :inline) + (sync sync-info-paused :inline) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xf0 - :flag-assert #x14008000f0 (:states wall-plat-extended wall-plat-extending @@ -46,9 +42,9 @@ ) :code (behavior () (set! (-> self extended-amount) 0.0) - (move-to-point! (-> self root-override) (-> self in-trans)) + (move-to-point! (-> self root) (-> self in-trans)) (transform-post) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -70,13 +66,13 @@ ) :trans rider-trans :code (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (set-time! (-> self state-time)) (loop (seek! (-> self extended-amount) 1.0 (* 2.5 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) (suspend) (if (= (-> self extended-amount) 1.0) @@ -97,7 +93,7 @@ ) :code (behavior () (set! (-> self extended-amount) 1.0) - (move-to-point! (-> self root-override) (-> self out-trans)) + (move-to-point! (-> self root) (-> self out-trans)) (transform-post) (loop (logior! (-> self mask) (process-mask sleep-code)) @@ -125,7 +121,7 @@ (seek! (-> self extended-amount) 0.0 (* 2.5 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) (suspend) (if (= (-> self extended-amount) 0.0) @@ -158,23 +154,23 @@ (let ((f30-0 (get-current-phase-with-mirror (-> self sync)))) (let ((s5-0 (new 'stack-no-clear 'vector))) (vector-lerp! s5-0 (-> self in-trans) (-> self out-trans) f30-0) - (move-to-point! (-> self root-override) s5-0) + (move-to-point! (-> self root) s5-0) ) (cond ((= f30-0 0.0) (set! gp-0 #f) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) ) ((= f30-0 1.0) (set! gp-0 #f) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) ) (else (when (not gp-0) (sound-play "wall-plat") (set! gp-0 #t) ) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) ) ) ) @@ -185,7 +181,7 @@ :post rider-post ) -(defmethod init-from-entity! wall-plat ((this wall-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this wall-plat) (arg0 entity-actor)) (set! (-> this extended-amount) 0.0) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -206,18 +202,18 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *wall-plat-sg* '()) (logior! (-> this skel status) (janim-status inited)) (set! (-> this use-sync?) (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.2 0.2)) - (let ((f30-0 (quaternion-y-angle (-> this root-override quat))) + (let ((f30-0 (quaternion-y-angle (-> this root quat))) (s4-1 (new 'stack-no-clear 'vector)) ) (set-vector! s4-1 0.0 0.0 (+ 1638.4 (res-lump-float arg0 'tunemeters)) 1.0) (vector-rotate-around-y! s4-1 s4-1 f30-0) - (vector+! (-> this out-trans) (-> this root-override trans) s4-1) + (vector+! (-> this out-trans) (-> this root trans) s4-1) (set-vector! s4-1 0.0 0.0 20480.0 1.0) (vector-rotate-around-y! s4-1 s4-1 f30-0) (vector+! (-> this in-trans) (-> this out-trans) s4-1) @@ -232,7 +228,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (cond ((-> this use-sync?) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/goal_src/jak1/levels/sunken/wedge-plats.gc b/goal_src/jak1/levels/sunken/wedge-plats.gc index 8cc8e75d5a6..59771a804e8 100644 --- a/goal_src/jak1/levels/sunken/wedge-plats.gc +++ b/goal_src/jak1/levels/sunken/wedge-plats.gc @@ -12,15 +12,11 @@ ;; DECOMP BEGINS (deftype wedge-plat-master (process) - ((center vector :inline :offset-assert 112) - (rotspeed float :offset-assert 128) - (rotate-inner float :offset-assert 132) - (rotate-outer float :offset-assert 136) + ((center vector :inline) + (rotspeed float) + (rotate-inner float) + (rotate-outer float) ) - :heap-base #x20 - :method-count-assert 14 - :size-assert #x8c - :flag-assert #xe0020008c (:states wedge-plat-master-idle ) @@ -41,7 +37,7 @@ ) ) -(defmethod init-from-entity! wedge-plat-master ((this wedge-plat-master) (arg0 entity-actor)) +(defmethod init-from-entity! ((this wedge-plat-master) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (set! (-> this center quad) (-> arg0 extra trans quad)) (+! (-> this center y) 819.2) @@ -54,16 +50,12 @@ ) (deftype wedge-plat (baseplat) - ((master wedge-plat-master :offset-assert 228) - (distance float :offset-assert 232) - (offset float :offset-assert 236) + ((master wedge-plat-master) + (distance float) + (offset float) ) - :heap-base #x80 - :method-count-assert 28 - :size-assert #xf0 - :flag-assert #x1c008000f0 (:methods - (wedge-plat-method-27 (_type_) symbol 27) + (wedge-plat-method-27 (_type_) symbol) ) (:states wedge-plat-idle @@ -77,7 +69,7 @@ :bounds (static-spherem 0 0 0 6) ) -(defmethod wedge-plat-method-27 wedge-plat ((this wedge-plat)) +(defmethod wedge-plat-method-27 ((this wedge-plat)) (let* ((a0-1 (-> this master)) (v1-0 (if a0-1 (-> (the-as process-drawable (-> a0-1 ppointer)) brother) @@ -91,7 +83,7 @@ (s5-0 #f) ) (quaternion-axis-angle! - (-> this root-override quat) + (-> this root quat) 0.0 1.0 0.0 @@ -175,7 +167,7 @@ :post plat-post ) -(defmethod init-from-entity! wedge-plat ((this wedge-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this wedge-plat) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -195,12 +187,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *wedge-plat-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (baseplat-method-21 this) (set! (-> this master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) (set! (-> this offset) (res-lump-float arg0 'rotoffset)) @@ -212,10 +204,6 @@ (deftype wedge-plat-outer (wedge-plat) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #xf0 - :flag-assert #x1c008000f0 (:states wedge-plat-outer-idle wedge-plat-outer-tip @@ -228,7 +216,7 @@ :bounds (static-spherem 0 0 0 8) ) -(defmethod wedge-plat-method-27 wedge-plat-outer ((this wedge-plat-outer)) +(defmethod wedge-plat-method-27 ((this wedge-plat-outer)) (let* ((a0-1 (-> this master)) (v1-0 (if a0-1 (-> (the-as process-drawable (-> a0-1 ppointer)) brother) @@ -242,7 +230,7 @@ (s5-0 #f) ) (quaternion-axis-angle! - (-> this root-override quat) + (-> this root quat) 0.0 1.0 0.0 @@ -325,7 +313,7 @@ :post plat-post ) -(defmethod init-from-entity! wedge-plat-outer ((this wedge-plat-outer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this wedge-plat-outer) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -345,12 +333,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *wedge-plat-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (baseplat-method-21 this) (set! (-> this master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) (set! (-> this offset) (res-lump-float arg0 'rotoffset)) diff --git a/goal_src/jak1/levels/sunken/whirlpool.gc b/goal_src/jak1/levels/sunken/whirlpool.gc index b3e51b44596..6cb0781e8d9 100644 --- a/goal_src/jak1/levels/sunken/whirlpool.gc +++ b/goal_src/jak1/levels/sunken/whirlpool.gc @@ -8,18 +8,14 @@ ;; DECOMP BEGINS (deftype whirlpool (process-drawable) - ((root-override collide-shape :offset 112) - (spin-ry float :offset-assert 176) - (spin-speed-idle float :offset-assert 180) - (spin-speed-delta float :offset-assert 184) - (sync sync-info-paused :inline :offset-assert 188) + ((root collide-shape :override) + (spin-ry float) + (spin-speed-idle float) + (spin-speed-delta float) + (sync sync-info-paused :inline) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xcc - :flag-assert #x15006000cc (:methods - (whirlpool-method-20 (_type_ float) cshape-moving-flags 20) + (whirlpool-method-20 (_type_ float) cshape-moving-flags) ) (:states whirlpool-idle @@ -284,21 +280,21 @@ ) ) -(defmethod whirlpool-method-20 whirlpool ((this whirlpool) (arg0 float)) +(defmethod whirlpool-method-20 ((this whirlpool) (arg0 float)) (let* ((gp-0 (target-pos 0)) - (f28-0 (vector-vector-xz-distance (-> this root-override trans) gp-0)) + (f28-0 (vector-vector-xz-distance (-> this root trans) gp-0)) ) (when (< f28-0 40960.0) (let* ((f0-2 (* 0.000024414063 (- 40960.0 f28-0))) (f26-0 (* f0-2 f0-2)) - (f0-7 (atan (- (-> gp-0 x) (-> this root-override trans x)) (- (-> gp-0 z) (-> this root-override trans z)))) + (f0-7 (atan (- (-> gp-0 x) (-> this root trans x)) (- (-> gp-0 z) (-> this root trans z)))) (f30-0 (* 0.5 f26-0 arg0 (seconds-per-frame))) (f24-0 (+ f0-7 f30-0)) (f28-1 (- f28-0 (fmin f28-0 (* 0.16874999 f26-0 (fabs arg0) (seconds-per-frame))))) (s4-1 (new 'stack-no-clear 'vector)) ) (set-vector! s4-1 (* (sin f24-0) f28-1) 0.0 (* (cos f24-0) f28-1) 1.0) - (vector+! s4-1 s4-1 (-> this root-override trans)) + (vector+! s4-1 s4-1 (-> this root trans)) (set! (-> s4-1 x) (* (- (-> s4-1 x) (-> gp-0 x)) (-> *display* frames-per-second))) (set! (-> s4-1 y) 0.0) (set! (-> s4-1 z) (* (- (-> s4-1 z) (-> gp-0 z)) (-> *display* frames-per-second))) @@ -324,13 +320,13 @@ ) (when (>= (fabs f30-0) 45511.11) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root-override trans quad)) + (set! (-> a1-0 quad) (-> self root trans quad)) (+! (-> a1-0 y) -8192.0) (spawn (-> self part) a1-0) ) ) (+! (-> self spin-ry) (* f30-0 (seconds-per-frame))) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> self spin-ry)) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (-> self spin-ry)) (if (and *target* (logtest? (-> *target* water flags) (water-flags wt09))) (whirlpool-method-20 self f30-0) ) @@ -344,7 +340,7 @@ :post ja-post ) -(defmethod deactivate whirlpool ((this whirlpool)) +(defmethod deactivate ((this whirlpool)) (if (nonzero? (-> this sound)) (stop! (-> this sound)) ) @@ -352,7 +348,7 @@ (none) ) -(defmethod init-from-entity! whirlpool ((this whirlpool) (arg0 entity-actor)) +(defmethod init-from-entity! ((this whirlpool) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (set! (-> this spin-ry) (rand-vu-float-range 0.0 65536.0)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) @@ -366,7 +362,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *whirlpool-sg* '()) @@ -386,7 +382,7 @@ ) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 447) this)) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "whirlpool" :fo-max 55) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "whirlpool" :fo-max 55) (-> this root trans)) ) (ja-channel-set! 1) (let ((s5-1 (-> this skel root-channel 0))) @@ -398,7 +394,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go whirlpool-idle) (none) ) diff --git a/goal_src/jak1/levels/swamp/billy.gc b/goal_src/jak1/levels/swamp/billy.gc index 406aa2aabaa..82a1a6d531b 100644 --- a/goal_src/jak1/levels/swamp/billy.gc +++ b/goal_src/jak1/levels/swamp/billy.gc @@ -10,26 +10,22 @@ ;; DECOMP BEGINS (deftype billy (process-taskable) - ((child-override (pointer billy-snack) :offset 20) - (farthy handle :offset-assert 384) - (path-data path-control 3 :offset-assert 392) - (path-snacks path-control :offset 392) - (path-starts path-control :offset 396) - (path-waypts path-control :offset 400) - (passed-last-stage symbol :offset-assert 404) - (spawn-rats symbol :offset-assert 408) - (current-wave int32 :offset-assert 412) - (wave-start-time time-frame :offset-assert 416) - (num-snacks int32 :offset-assert 424) - (num-rats int32 :offset-assert 428) - (max-rats int32 :offset-assert 432) - (rat-speed float :offset-assert 436) - (offending-rat handle :offset-assert 440) + ((child-override (pointer billy-snack) :overlay-at child) + (farthy handle) + (path-data path-control 3) + (path-snacks path-control :overlay-at (-> path-data 0)) + (path-starts path-control :overlay-at (-> path-data 1)) + (path-waypts path-control :overlay-at (-> path-data 2)) + (passed-last-stage symbol) + (spawn-rats symbol) + (current-wave int32) + (wave-start-time time-frame) + (num-snacks int32) + (num-rats int32) + (max-rats int32) + (rat-speed float) + (offending-rat handle) ) - :heap-base #x150 - :method-count-assert 53 - :size-assert #x1c0 - :flag-assert #x35015001c0 (:states billy-done billy-playing @@ -37,7 +33,7 @@ ) -(defmethod relocate billy ((this billy) (arg0 int)) +(defmethod relocate ((this billy) (arg0 int)) (countdown (v1-0 3) (if (nonzero? (-> this path-data v1-0)) (&+! (-> this path-data v1-0) arg0) @@ -47,12 +43,8 @@ ) (deftype billy-snack (process-drawable) - ((num-rats int32 :offset-assert 176) + ((num-rats int32) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states billy-snack-eat billy-snack-idle @@ -111,15 +103,11 @@ ) (deftype billy-rat (swamp-rat) - ((dest-type uint64 :offset-assert 496) - (snack handle :offset-assert 504) - (destination vector :inline :offset-assert 512) - (billy (pointer billy) :offset-assert 528) + ((dest-type uint64) + (snack handle) + (destination vector :inline) + (billy (pointer billy)) ) - :heap-base #x1b0 - :method-count-assert 76 - :size-assert #x214 - :flag-assert #x4c01b00214 (:states billy-rat-eat billy-rat-salivate @@ -282,7 +270,7 @@ #f ) -(defmethod play-anim! billy ((this billy) (arg0 symbol)) +(defmethod play-anim! ((this billy) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 @@ -415,7 +403,7 @@ ) ) -(defmethod get-art-elem billy ((this billy)) +(defmethod get-art-elem ((this billy)) (case (current-status (-> this tasks)) (((task-status invalid) (task-status need-resolution)) (-> this draw art-group data 10) @@ -426,7 +414,7 @@ ) ) -(defmethod process-taskable-method-38 billy ((this billy)) +(defmethod process-taskable-method-38 ((this billy)) (case (current-status (-> this tasks)) (((task-status need-reminder-a) (task-status need-reminder)) (go (method-of-object this query)) @@ -441,14 +429,14 @@ (none) ) -(defmethod get-accept-anim billy ((this billy) (arg0 symbol)) +(defmethod get-accept-anim ((this billy) (arg0 symbol)) (if arg0 (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "billy-accept" :index 6 :parts 3 :command-list '()) ) -(defmethod get-reject-anim billy ((this billy) (arg0 symbol)) +(defmethod get-reject-anim ((this billy) (arg0 symbol)) (new 'static 'spool-anim :name "billy-reject" :index 7 :parts 3 :command-list '()) ) @@ -857,7 +845,7 @@ :enter (behavior () (add-setting! 'music 'danger 0.0 0) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (init! (-> self query) (the-as string #f) 40 150 25 #t (lookup-text! *common-text* (text-id quit) #f)) (set-time! (-> self wave-start-time)) (set! (-> self num-snacks) 0) @@ -907,7 +895,7 @@ ) ) :exit (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (restore-load-state-and-cleanup *load-state*) (set! (-> *ACTOR-bank* birth-max) 1000) (remove-setting! 'music) @@ -952,63 +940,63 @@ ) ) -(defmethod process-taskable-method-43 billy ((this billy)) +(defmethod process-taskable-method-43 ((this billy)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f30-0 (rand-float-gen))) (cond ((< 0.9411765 f30-0) - (play-ambient (-> this ambient) "BIL-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM01" #f (-> this root trans)) ) ((< 0.88235295 f30-0) - (play-ambient (-> this ambient) "BIL-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM02" #f (-> this root trans)) ) ((< 0.8235294 f30-0) - (play-ambient (-> this ambient) "BIL-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM03" #f (-> this root trans)) ) ((< 0.7647059 f30-0) - (play-ambient (-> this ambient) "BIL-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM04" #f (-> this root trans)) ) ((< 0.7058824 f30-0) - (play-ambient (-> this ambient) "BIL-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM05" #f (-> this root trans)) ) ((< 0.64705884 f30-0) - (play-ambient (-> this ambient) "BIL-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM06" #f (-> this root trans)) ) ((< 0.5882353 f30-0) - (play-ambient (-> this ambient) "BIL-AM07" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM07" #f (-> this root trans)) ) ((< 0.5294118 f30-0) - (play-ambient (-> this ambient) "BIL-AM08" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM08" #f (-> this root trans)) ) ((< 0.47058824 f30-0) - (play-ambient (-> this ambient) "BIL-AM1A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM1A" #f (-> this root trans)) ) ((< 0.4117647 f30-0) - (play-ambient (-> this ambient) "BIL-AM2A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM2A" #f (-> this root trans)) ) ((< 0.3529412 f30-0) - (play-ambient (-> this ambient) "BIL-AM2B" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM2B" #f (-> this root trans)) ) ((= (current-status (-> this tasks)) (task-status invalid)) #f ) ((< 0.29411766 f30-0) - (play-ambient (-> this ambient) "BIL-LO01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-LO01" #f (-> this root trans)) ) ((< 0.23529412 f30-0) - (play-ambient (-> this ambient) "BIL-LO02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-LO02" #f (-> this root trans)) ) ((< 0.1764706 f30-0) - (play-ambient (-> this ambient) "BIL-LO03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-LO03" #f (-> this root trans)) ) ((< 0.11764706 f30-0) - (play-ambient (-> this ambient) "BIL-LO1A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-LO1A" #f (-> this root trans)) ) ((< 0.05882353 f30-0) - (play-ambient (-> this ambient) "BIL-LO2A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-LO2A" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "BIL-LO2B" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-LO2B" #f (-> this root trans)) ) ) ) @@ -1055,14 +1043,14 @@ ) ) -(defmethod target-above-threshold? billy ((this billy)) +(defmethod target-above-threshold? ((this billy)) (the-as symbol (and *target* (not (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)))) ) ) -(defmethod init-from-entity! billy ((this billy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this billy) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *billy-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task swamp-billy))) (dotimes (s5-0 3) @@ -1073,9 +1061,7 @@ ) (set! (-> this path) (-> this path-snacks)) (set! (-> this farthy) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *billy-sidekick-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *billy-sidekick-sg* #f :to this)) ) (send-event (handle->process (-> this farthy)) 'center-joint 3) (send-event (handle->process (-> this farthy)) 'anim-mode 'clone-anim) diff --git a/goal_src/jak1/levels/swamp/kermit.gc b/goal_src/jak1/levels/swamp/kermit.gc index 79329cdbc2a..caac11ebf3b 100644 --- a/goal_src/jak1/levels/swamp/kermit.gc +++ b/goal_src/jak1/levels/swamp/kermit.gc @@ -383,26 +383,23 @@ ) (deftype joint-mod-tracker (basic) - ((target-pos vector :inline :offset-assert 16) - (target-pos-func (function vector vector) :offset-assert 32) - (inv-forward-scale-factor float :offset-assert 36) - (forward-scale-control float :offset-assert 40) - (forward-scale-max float :offset-assert 44) - (process kermit :offset-assert 48) - (enable symbol :offset-assert 52) - (up-axis int8 :offset-assert 56) - (forward-axis int8 :offset-assert 57) + ((target-pos vector :inline) + (target-pos-func (function vector vector)) + (inv-forward-scale-factor float) + (forward-scale-control float) + (forward-scale-max float) + (process kermit) + (enable symbol) + (up-axis int8) + (forward-axis int8) ) - :method-count-assert 9 - :size-assert #x3a - :flag-assert #x90000003a (:methods - (new (symbol type kermit int function int int) _type_ 0) + (new (symbol type kermit int function int int) _type_) ) ) -(defmethod relocate joint-mod-tracker ((this joint-mod-tracker) (arg0 int)) +(defmethod relocate ((this joint-mod-tracker) (arg0 int)) (&+! (-> this process) arg0) this ) @@ -497,15 +494,11 @@ ) (deftype kermit-pulse (process-drawable) - ((parent-override (pointer kermit) :offset 12) - (self-override kermit-pulse :offset 28) - (root-override collide-shape-moving :offset 112) - (sound-id sound-id :offset-assert 176) + ((root collide-shape-moving :override) + (parent-override (pointer kermit) :overlay-at parent) + (self-override kermit-pulse :overlay-at self) + (sound-id sound-id) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states kermit-pulse-idle kermit-pulse-impact @@ -530,10 +523,10 @@ ) :code (behavior () (while (not (time-elapsed? (-> self state-time) (seconds 4))) - (sound-play "kermit-loop" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) - (spawn (-> self part) (-> self root-override trans)) + (sound-play "kermit-loop" :id (-> self sound-id) :position (the-as symbol (-> self root trans))) + (spawn (-> self part) (-> self root trans)) (find-ground-and-draw-shadow - (-> self root-override trans) + (-> self root trans) (the-as vector #f) 8192.0 (collide-kind background) @@ -546,7 +539,7 @@ (cleanup-for-death self) ) :post (behavior () - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) ) ) @@ -561,7 +554,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (cleanup-for-death self) @@ -588,12 +581,12 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set! (-> self root-override quat vec quad) (-> self parent-override 0 collide-info quat vec quad)) - (vector-identity! (-> self root-override scale)) - (vector-reset! (-> self root-override transv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root quat vec quad) (-> self parent-override 0 collide-info quat vec quad)) + (vector-identity! (-> self root scale)) + (vector-reset! (-> self root transv)) (set! (-> self sound-id) (new-sound-id)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 300) self)) (go kermit-pulse-idle) @@ -607,20 +600,16 @@ ) (deftype kermit (nav-enemy) - ((child-override (pointer kermit-pulse) :offset 20) - (rotate-dir vector :inline :offset-assert 400) - (charging-part sparticle-launch-control :offset-assert 416) - (airborne symbol :offset-assert 420) - (tongue-control joint-mod-tracker :offset-assert 424) - (tongue-pulse-pos float :offset-assert 428) - (miss-count int8 :offset-assert 432) - (charged-up symbol :offset-assert 436) - (sound-id sound-id :offset-assert 440) + ((child-override (pointer kermit-pulse) :overlay-at child) + (rotate-dir vector :inline) + (charging-part sparticle-launch-control) + (airborne symbol) + (tongue-control joint-mod-tracker) + (tongue-pulse-pos float) + (miss-count int8) + (charged-up symbol) + (sound-id sound-id) ) - :heap-base #x150 - :method-count-assert 76 - :size-assert #x1bc - :flag-assert #x4c015001bc (:states kermit-attack kermit-chase @@ -635,7 +624,7 @@ ) -(defmethod relocate kermit ((this kermit) (arg0 int)) +(defmethod relocate ((this kermit) (arg0 int)) (if (nonzero? (-> this tongue-control)) (&+! (-> this tongue-control) arg0) ) @@ -645,7 +634,7 @@ (the-as kermit ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod deactivate kermit ((this kermit)) +(defmethod deactivate ((this kermit)) (if (nonzero? (-> this charging-part)) (kill-and-free-particles (-> this charging-part)) ) @@ -828,7 +817,7 @@ nav-enemy-default-event-handler -(defmethod common-post kermit ((this kermit)) +(defmethod common-post ((this kermit)) (call-parent-method this) (when (-> this charged-up) ) @@ -1185,7 +1174,7 @@ nav-enemy-default-event-handler ) (v1-15 (vector-lerp! (new 'stack-no-clear 'vector) gp-0 s5-0 (-> self tongue-pulse-pos))) ) - (set! (-> s4-0 root-override trans quad) (-> v1-15 quad)) + (set! (-> s4-0 root trans quad) (-> v1-15 quad)) ) ) (send-event *target* 'tongue gp-0) @@ -1308,7 +1297,7 @@ nav-enemy-default-event-handler ) ) -(defmethod init-from-entity! kermit ((this kermit) (arg0 entity-actor)) +(defmethod init-from-entity! ((this kermit) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) diff --git a/goal_src/jak1/levels/swamp/swamp-bat.gc b/goal_src/jak1/levels/swamp/swamp-bat.gc index 4ee9f2be26f..6de0adb1999 100644 --- a/goal_src/jak1/levels/swamp/swamp-bat.gc +++ b/goal_src/jak1/levels/swamp/swamp-bat.gc @@ -11,20 +11,17 @@ ;; DECOMP BEGINS (deftype swamp-bat-idle-path (structure) - ((origin vector :inline :offset-assert 0) - (x-axis vector :inline :offset-assert 16) - (y-axis vector :inline :offset-assert 32) + ((origin vector :inline) + (x-axis vector :inline) + (y-axis vector :inline) ) - :method-count-assert 10 - :size-assert #x30 - :flag-assert #xa00000030 (:methods - (swamp-bat-idle-path-method-9 (_type_ vector float) vector 9) + (swamp-bat-idle-path-method-9 (_type_ vector float) vector) ) ) -(defmethod swamp-bat-idle-path-method-9 swamp-bat-idle-path ((this swamp-bat-idle-path) (arg0 vector) (arg1 float)) +(defmethod swamp-bat-idle-path-method-9 ((this swamp-bat-idle-path) (arg0 vector) (arg1 float)) (let ((f30-0 (* 65536.0 arg1))) (set! (-> arg0 quad) (-> this origin quad)) (vector+*! arg0 arg0 (-> this x-axis) (cos f30-0)) @@ -34,21 +31,17 @@ ) (deftype swamp-bat (process-drawable) - ((child-process (pointer swamp-bat-slave) :offset 20) - (root-override collide-shape :offset 112) - (fact-override fact-info-enemy :offset 144) - (path-origin vector :inline :offset-assert 176) - (idle-position-angle float 8 :offset-assert 192) - (path-select-plane plane 2 :inline :offset-assert 224) - (path-list curve-control 2 :offset-assert 256) - (path-select int8 :offset-assert 264) - (slave-count int8 :offset-assert 265) - (path-count int8 :offset-assert 266) + ((root collide-shape :override) + (fact fact-info-enemy :override) + (child-process (pointer swamp-bat-slave) :overlay-at child) + (path-origin vector :inline) + (idle-position-angle float 8) + (path-select-plane plane 2 :inline) + (path-list curve-control 2) + (path-select int8) + (slave-count int8) + (path-count int8) ) - :heap-base #xa0 - :method-count-assert 20 - :size-assert #x10b - :flag-assert #x1400a0010b (:states swamp-bat-idle swamp-bat-launch-slaves @@ -56,7 +49,7 @@ ) -(defmethod relocate swamp-bat ((this swamp-bat) (arg0 int)) +(defmethod relocate ((this swamp-bat) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this path-list v1-0)) (&+! (-> this path-list v1-0) arg0) @@ -66,25 +59,21 @@ ) (deftype swamp-bat-slave (process-drawable) - ((parent-process (pointer swamp-bat) :offset 12) - (root-override collide-shape-moving :offset 112) - (sync sync-info :inline :offset-assert 176) - (idle-anim-speed float :offset-assert 184) - (strafe-envelope float :offset-assert 188) - (strafe-distance float :offset-assert 192) - (path-point-count float :offset-assert 196) - (idle-path swamp-bat-idle-path :inline :offset-assert 208) - (idle-position vector :inline :offset-assert 256) - (idle-position-index int8 :offset-assert 272) - (path-select int8 :offset-assert 273) - (launch-ready symbol :offset-assert 276) + ((root collide-shape-moving :override) + (parent-process (pointer swamp-bat) :overlay-at parent) + (sync sync-info :inline) + (idle-anim-speed float) + (strafe-envelope float) + (strafe-distance float) + (path-point-count float) + (idle-path swamp-bat-idle-path :inline) + (idle-position vector :inline) + (idle-position-index int8) + (path-select int8) + (launch-ready symbol) ) - :heap-base #xb0 - :method-count-assert 21 - :size-assert #x118 - :flag-assert #x1500b00118 (:methods - (swamp-bat-slave-method-20 (_type_) float 20) + (swamp-bat-slave-method-20 (_type_) float) ) (:states (swamp-bat-slave-die handle) @@ -121,7 +110,7 @@ swamp-bat-slave-event-handler (transform-post) ) -(defmethod swamp-bat-slave-method-20 swamp-bat-slave ((this swamp-bat-slave)) +(defmethod swamp-bat-slave-method-20 ((this swamp-bat-slave)) (* (get-current-phase (-> this sync)) (-> this path-point-count)) ) @@ -146,8 +135,8 @@ swamp-bat-slave-event-handler (seek! (-> self strafe-distance) f0-4 (* 20480.0 (seconds-per-frame))) ) (vector-float*! s4-0 s4-0 (-> self strafe-distance)) - (vector+! (-> self root-override trans) s5-0 s4-0) - (forward-up->quaternion (-> self root-override quat) gp-0 s3-0) + (vector+! (-> self root trans) s5-0 s4-0) + (forward-up->quaternion (-> self root quat) gp-0 s3-0) ) (swamp-bat-slave-post) ) @@ -190,8 +179,8 @@ swamp-bat-slave-event-handler (ja-channel-push! 1 (seconds 0.165)) (ja :group! swamp-bat-idle-ja) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self root-override trans quad)) - (let ((s4-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root-override quat))) + (set! (-> s5-0 quad) (-> self root trans quad)) + (let ((s4-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat))) (gp-0 (new-stack-quaternion0)) ) (let ((s2-0 (path-control-method-12 @@ -218,8 +207,8 @@ swamp-bat-slave-event-handler (set-pos *__private-assert-info* "swamp-bat" (the-as uint 283) (the-as uint 20)) (__assert (< f30-1 1.0) "(< interp 1.0)") ) - (vector-lerp! (-> self root-override trans) s5-0 (-> self idle-position) f30-1) - (quaternion-slerp! (-> self root-override quat) s4-0 gp-0 f30-1) + (vector-lerp! (-> self root trans) s5-0 (-> self idle-position) f30-1) + (quaternion-slerp! (-> self root quat) s4-0 gp-0 f30-1) ) ) (ja :num! (loop! (-> self idle-anim-speed))) @@ -229,8 +218,8 @@ swamp-bat-slave-event-handler ) ) (label cfg-10) - (set! (-> self root-override trans quad) (-> self idle-position quad)) - (quaternion-copy! (-> self root-override quat) gp-0) + (set! (-> self root trans quad) (-> self idle-position quad)) + (quaternion-copy! (-> self root quat) gp-0) ) ) (set! (-> self launch-ready) #t) @@ -240,9 +229,9 @@ swamp-bat-slave-event-handler (let ((f26-0 (cos f30-2)) (f28-0 (sin f30-2)) ) - (set! (-> self root-override trans quad) (-> self idle-path origin quad)) - (vector+*! (-> self root-override trans) (-> self root-override trans) (-> self idle-path x-axis) f26-0) - (vector+*! (-> self root-override trans) (-> self root-override trans) (-> self idle-path y-axis) f28-0) + (set! (-> self root trans quad) (-> self idle-path origin quad)) + (vector+*! (-> self root trans) (-> self root trans) (-> self idle-path x-axis) f26-0) + (vector+*! (-> self root trans) (-> self root trans) (-> self idle-path y-axis) f28-0) ) (ja :num! (loop! (-> self idle-anim-speed))) (suspend) @@ -260,7 +249,7 @@ swamp-bat-slave-event-handler (set! (-> self launch-ready) #f) (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new-stack-vector0))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (let ((s5-0 (new-stack-vector0))) (eval-path-curve-div! (-> self parent-process 0 path-list (-> self path-select)) s5-0 0.0 'interp) (ja :group! swamp-bat-idle-ja) @@ -270,7 +259,7 @@ swamp-bat-slave-event-handler (go swamp-bat-slave-swoop) ) (let ((f0-1 (* 0.011111111 (the float s4-0)))) - (vector-lerp! (-> self root-override trans) gp-0 s5-0 f0-1) + (vector-lerp! (-> self root trans) gp-0 s5-0 f0-1) ) ) (ja :num! (loop! (-> self idle-anim-speed))) @@ -364,14 +353,14 @@ swamp-bat-slave-event-handler (let ((gp-0 (new-stack-vector0))) (let ((v1-1 (handle->process arg0))) (if v1-1 - (vector-! gp-0 (-> self root-override trans) (-> (the-as swamp-bat v1-1) root-override trans)) + (vector-! gp-0 (-> self root trans) (-> (the-as swamp-bat v1-1) root trans)) ) ) (+! (-> gp-0 y) -6144.0) (vector-normalize! gp-0 98304.0) (ja :group! swamp-bat-die-ja) (until (ja-done? 0) - (vector-v++! (-> self root-override trans) gp-0) + (vector-v++! (-> self root trans) gp-0) (ja :num! (seek! max 0.5)) (suspend) ) @@ -407,12 +396,12 @@ swamp-bat-slave-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> self root-override) s4-0) + (set! (-> self root) s4-0) ) - (set! (-> self root-override trans quad) (-> arg0 root-override trans quad)) - (set! (-> self root-override quat vec quad) (-> arg0 root-override quat vec quad)) - (vector-float*! (-> self root-override scale) *identity-vector* 2.0) - (set! (-> self root-override pause-adjust-distance) 286720.0) + (set! (-> self root trans quad) (-> arg0 root trans quad)) + (set! (-> self root quat vec quad) (-> arg0 root quat vec quad)) + (vector-float*! (-> self root scale) *identity-vector* 2.0) + (set! (-> self root pause-adjust-distance) 286720.0) (set! (-> self fact) (new 'process 'fact-info-enemy self (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) @@ -421,7 +410,7 @@ swamp-bat-slave-event-handler (set! (-> self strafe-envelope) 0.0) (set! (-> self idle-position-index) arg1) (swamp-bat-slave-get-new-path) - (set! (-> self root-override trans quad) (-> self idle-position quad)) + (set! (-> self root trans quad) (-> self idle-position quad)) (setup-params! (-> self sync) (the-as uint 1200) 0.0 0.15 0.15) (initialize-skeleton self *swamp-bat-slave-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) @@ -508,9 +497,7 @@ swamp-bat-slave-event-handler (loop (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) *target* - (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (when (not (-> self child-process)) (process-entity-status! self (entity-perm-status dead) #t) @@ -524,8 +511,8 @@ swamp-bat-slave-event-handler ) ) (let ((gp-1 (new 'static 'matrix))) - (quaternion->matrix gp-1 (-> self root-override quat)) - (set! (-> gp-1 vector 3 quad) (-> self root-override trans quad)) + (quaternion->matrix gp-1 (-> self root quat)) + (set! (-> gp-1 vector 3 quad) (-> self root trans quad)) ) (suspend) ) @@ -568,7 +555,7 @@ swamp-bat-slave-event-handler :post #f ) -(defmethod init-from-entity! swamp-bat ((this swamp-bat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swamp-bat) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 0.0) @@ -576,7 +563,7 @@ swamp-bat-slave-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -599,7 +586,7 @@ swamp-bat-slave-event-handler (if (!= (-> this path-count) 2) (go process-drawable-art-error "need 2 paths") ) - (set! (-> this fact-override) + (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (let ((a1-10 (res-lump-value arg0 'num-lurkers uint128 :default (the-as uint128 6)))) diff --git a/goal_src/jak1/levels/swamp/swamp-obs.gc b/goal_src/jak1/levels/swamp/swamp-obs.gc index 9e428f1127b..66c1953fc7f 100644 --- a/goal_src/jak1/levels/swamp/swamp-obs.gc +++ b/goal_src/jak1/levels/swamp/swamp-obs.gc @@ -114,17 +114,13 @@ ) (deftype swamp-spike (process-drawable) - ((root-override collide-shape :offset 112) - (sync sync-info :inline :offset-assert 176) - (open-gate symbol :offset-assert 184) - (dangerous symbol :offset-assert 188) + ((root collide-shape :override) + (sync sync-info :inline) + (open-gate symbol) + (dangerous symbol) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc0 - :flag-assert #x15005000c0 (:methods - (init! (_type_) symbol 20) + (init! (_type_) symbol) ) (:states swamp-spike-idle @@ -144,7 +140,7 @@ (when (-> self dangerous) (if ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) @@ -156,7 +152,7 @@ (defun swamp-spike-set-particle-rotation-callback ((arg0 part-tracker)) (let* ((v1-0 (the-as object (-> arg0 userdata))) - (f0-1 (+ -65314.562 (quaternion-y-angle (-> (the-as (pointer swamp-spike) v1-0) 0 root-override quat)))) + (f0-1 (+ -65314.562 (quaternion-y-angle (-> (the-as (pointer swamp-spike) v1-0) 0 root quat)))) ) (set! (-> *part-id-table* 1325 init-specs 20 initial-valuef) f0-1) (set! (-> *part-id-table* 1326 init-specs 20 initial-valuef) f0-1) @@ -171,8 +167,8 @@ (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 to) (the-as process 1)) (set! (-> a1-0 from) (the-as process *touching-list*)) - (if (find-overlapping-shapes (-> self root-override) (the-as overlaps-others-params a1-0)) - (do-push-aways! (-> self root-override)) + (if (find-overlapping-shapes (-> self root) (the-as overlaps-others-params a1-0)) + (do-push-aways! (-> self root)) ) ) (none) @@ -184,8 +180,8 @@ (set! (-> self dangerous) #f) (let ((gp-0 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) - (vector-z-quaternion! gp-0 (-> self root-override quat)) - (set! (-> gp-0 w) (- (vector-dot gp-0 (-> self root-override trans)))) + (vector-z-quaternion! gp-0 (-> self root quat)) + (set! (-> gp-0 w) (- (vector-dot gp-0 (-> self root trans)))) (loop (set-time! (-> self state-time)) (ja :group! swamp-spike-up-ja) @@ -193,12 +189,11 @@ (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) - (let ((s5-0 (or (not *target*) - (< 204800.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) - ) + (let ((s5-0 + (or (not *target*) (< 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + ) ) - (if (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) *camera* ) (set! s5-0 (< (* (vector4-dot gp-0 (target-pos 0)) (vector4-dot gp-0 (camera-pos))) 0.0)) @@ -224,7 +219,7 @@ swamp-spike-set-particle-rotation-callback (-> self ppointer) #f - (-> self root-override trans) + (-> self root trans) :to self ) ) @@ -249,7 +244,7 @@ swamp-spike-set-particle-rotation-callback (-> self ppointer) #f - (-> self root-override trans) + (-> self root trans) :to self ) ) @@ -293,7 +288,7 @@ swamp-spike-set-particle-rotation-callback (-> self ppointer) #f - (-> self root-override trans) + (-> self root trans) :to self ) (ja-no-eval :group! swamp-spike-down-ja :num! (seek!) :frame-num 0.0) @@ -314,7 +309,7 @@ :post swamp-spike-post ) -(defmethod init! swamp-spike ((this swamp-spike)) +(defmethod init! ((this swamp-spike)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -343,7 +338,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (process-drawable-from-entity! this (-> this entity)) (initialize-skeleton this *swamp-spike-sg* '()) @@ -354,7 +349,7 @@ #f ) -(defmethod init-from-entity! swamp-spike ((this swamp-spike) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swamp-spike) (arg0 entity-actor)) (init! this) (go swamp-spike-idle) (none) @@ -362,10 +357,6 @@ (deftype swampgate (swamp-spike) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc0 - :flag-assert #x15005000c0 (:states swamp-spike-gate-down swamp-spike-gate-up @@ -373,7 +364,7 @@ ) -(defmethod init-from-entity! swampgate ((this swampgate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swampgate) (arg0 entity-actor)) (init! this) (if (logtest? (-> arg0 extra perm status) (entity-perm-status complete)) (go swamp-spike-gate-down) @@ -383,18 +374,14 @@ ) (deftype balance-plat (process-drawable) - ((root-override collide-shape-moving :offset 112) - (y-travel float :offset-assert 176) - (y-init float :offset-assert 180) - (y-offset float :offset-assert 184) - (y-vel float :offset-assert 188) - (y-accel float :offset-assert 192) - (got-grow symbol :offset-assert 196) + ((root collide-shape-moving :override) + (y-travel float) + (y-init float) + (y-offset float) + (y-vel float) + (y-accel float) + (got-grow symbol) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xc8 - :flag-assert #x14006000c8 (:states balance-plat-idle ) @@ -425,7 +412,7 @@ (f28-0 (* -0.025 (- (-> self y-offset) (-> self y-travel)))) ) (cond - ((and (-> self root-override riders) (nonzero? (-> self root-override riders num-riders))) + ((and (-> self root riders) (nonzero? (-> self root riders num-riders))) ;; has rider, accelerate downwards (send-event *target* 'no-look-around (seconds 0.25)) (set! (-> self y-accel) (fmin 4.096 (fmax -4.096 (+ (* DISPLAY_FPS_RATIO -0.2048) (-> self y-accel))))) @@ -461,14 +448,14 @@ ) ) (+! (-> self y-offset) (* DISPLAY_FPS_RATIO (-> self y-vel))) - (set! (-> self root-override trans y) (+ (-> self y-init) (-> self y-offset))) + (set! (-> self root trans y) (+ (-> self y-init) (-> self y-offset))) (suspend) ) ) :post rider-post ) -(defmethod init-from-entity! balance-plat ((this balance-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this balance-plat) (arg0 entity-actor)) ;; og:preserve-this PAL patch here. usually-hit-by-player -> hit-by-others (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) @@ -489,7 +476,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *balance-plat-sg* '()) @@ -497,7 +484,7 @@ (set! (-> this y-accel) 0.0) (set! (-> this y-vel) 0.0) (set! (-> this y-offset) 0.0) - (set! (-> this y-init) (-> this root-override trans y)) + (set! (-> this y-init) (-> this root trans y)) (set! (-> this got-grow) #f) (set! (-> this y-travel) (res-lump-float arg0 'distance :default 20480.0)) (go balance-plat-idle) @@ -505,12 +492,8 @@ ) (deftype swamp-rock (process-drawable) - ((root-override basic :offset 112) + ((root collide-shape-moving :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states swamp-rock-break swamp-rock-idle @@ -640,7 +623,7 @@ ) ) -(defmethod init-from-entity! swamp-rock ((this swamp-rock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swamp-rock) (arg0 entity-actor)) (logior! (-> this mask) (process-mask attackable)) (let ((f30-0 (res-lump-float arg0 'scale-factor :default 1.0))) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -655,7 +638,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root) s4-0) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) (process-drawable-from-entity! this arg0) (vector-float*! (-> this root scale) *identity-vector* f30-0) @@ -730,24 +713,20 @@ ) (deftype tar-plat (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 736) - (float-height float :offset-assert 752) + ((anchor-point vector :inline) + (float-height float) ) - :heap-base #x290 - :method-count-assert 35 - :size-assert #x2f4 - :flag-assert #x23029002f4 ) -(defmethod rigid-body-platform-method-22 tar-plat ((this tar-plat) (arg0 vector) (arg1 float)) +(defmethod rigid-body-platform-method-22 ((this tar-plat) (arg0 vector) (arg1 float)) (+ (-> this float-height) (-> this float-height-offset) (* 512.0 (cos (* 109.22667 (+ (* 60.0 arg1) (* 0.03 (-> arg0 x)) (* 0.03 (-> arg0 z)))))) ) ) -(defmethod rigid-body-platform-method-23 tar-plat ((this tar-plat) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this tar-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 @@ -799,7 +778,7 @@ :post rigid-body-platform-post ) -(defmethod rigid-body-platform-method-30 tar-plat ((this tar-plat)) +(defmethod rigid-body-platform-method-30 ((this tar-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -824,7 +803,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 tar-plat ((this tar-plat)) +(defmethod rigid-body-platform-method-31 ((this tar-plat)) (initialize-skeleton this *tar-plat-sg* '()) (rigid-body-platform-method-29 this *tar-plat-constants*) (set! (-> this float-height) (-> this entity extra trans y)) @@ -852,18 +831,11 @@ (deftype swamp-barrel (barrel) () - :heap-base #x90 - :method-count-assert 30 - :size-assert #x100 - :flag-assert #x1e00900100 ) (deftype swampcam (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) @@ -874,10 +846,6 @@ (deftype swamp-battlecontroller (battlecontroller) () - :heap-base #x210 - :method-count-assert 29 - :size-assert #x27c - :flag-assert #x1d0210027c ) diff --git a/goal_src/jak1/levels/swamp/swamp-part.gc b/goal_src/jak1/levels/swamp/swamp-part.gc index a5494ad7c89..691563cfce8 100644 --- a/goal_src/jak1/levels/swamp/swamp-part.gc +++ b/goal_src/jak1/levels/swamp/swamp-part.gc @@ -9,10 +9,6 @@ (deftype swamp-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/swamp/swamp-rat-nest.gc b/goal_src/jak1/levels/swamp/swamp-rat-nest.gc index 98e519add1e..b7065405dac 100644 --- a/goal_src/jak1/levels/swamp/swamp-rat-nest.gc +++ b/goal_src/jak1/levels/swamp/swamp-rat-nest.gc @@ -574,23 +574,19 @@ ) (deftype swamp-rat-nest (process-drawable) - ((child-process (pointer swamp-rat-nest-dummy) :offset 20) - (fact-override fact-info-enemy :offset 144) - (dummy (pointer swamp-rat-nest-dummy) :offset-assert 176) - (damaged symbol :offset-assert 180) - (dummy-type int8 :offset-assert 184) - (rat-count int8 :offset-assert 185) - (hit-points int8 :offset-assert 186) - (defensive-rat-count int8 :offset-assert 187) - (spawn-period float :offset-assert 188) - (spawn-period-scale float :offset-assert 192) - (test-interval time-frame :offset-assert 200) - (player-attack-id int32 :offset-assert 208) + ((fact fact-info-enemy :override) + (child-process (pointer swamp-rat-nest-dummy) :overlay-at child) + (dummy (pointer swamp-rat-nest-dummy)) + (damaged symbol) + (dummy-type int8) + (rat-count int8) + (hit-points int8) + (defensive-rat-count int8) + (spawn-period float) + (spawn-period-scale float) + (test-interval time-frame) + (player-attack-id int32) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd4 - :flag-assert #x14007000d4 (:states swamp-rat-nest-active swamp-rat-nest-die @@ -602,21 +598,17 @@ (deftype swamp-rat-nest-dummy (process-drawable) - ((parent-process (pointer swamp-rat-nest) :offset 12) - (root-override collide-shape :offset 112) - (top-sphere sphere :inline :offset-assert 176) - (death-part sparticle-launch-group :offset-assert 192) - (spawn-joint-array int8 6 :offset-assert 196) - (spawn-joint-count int8 :offset-assert 202) - (particle-spawn-joint int8 :offset-assert 203) + ((root collide-shape :override) + (parent-process (pointer swamp-rat-nest) :overlay-at parent) + (top-sphere sphere :inline) + (death-part sparticle-launch-group) + (spawn-joint-array int8 6) + (spawn-joint-count int8) + (particle-spawn-joint int8) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16006000cc (:methods - (swamp-rat-nest-dummy-method-20 (_type_) none 20) - (swamp-rat-nest-dummy-method-21 (_type_) int 21) + (swamp-rat-nest-dummy-method-20 (_type_) none) + (swamp-rat-nest-dummy-method-21 (_type_) int) ) (:states swamp-rat-nest-dummy-die @@ -629,28 +621,16 @@ (deftype swamp-rat-nest-dummy-a (swamp-rat-nest-dummy) () - :heap-base #x60 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16006000cc ) (deftype swamp-rat-nest-dummy-b (swamp-rat-nest-dummy) () - :heap-base #x60 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16006000cc ) (deftype swamp-rat-nest-dummy-c (swamp-rat-nest-dummy) () - :heap-base #x60 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16006000cc ) @@ -785,14 +765,14 @@ (logior! (-> self mask) (process-mask enemy)) (swamp-rat-nest-dummy-method-20 self) (process-drawable-from-entity! self gp-0) - (set! (-> self top-sphere quad) (-> self root-override trans quad)) + (set! (-> self top-sphere quad) (-> self root trans quad)) (+! (-> self top-sphere y) 24576.0) (set! (-> self top-sphere w) 18432.0) (set! (-> self entity) gp-0) ) - (set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0)) + (set! (-> self nav) (new 'process 'nav-control (-> self root) 16 40960.0)) (logior! (-> self nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set-current-poly! (-> self nav) (find-poly (-> self nav) (-> self root-override trans))) + (set-current-poly! (-> self nav) (find-poly (-> self nav) (-> self root trans))) (+! (-> self parent-process 0 hit-points) 3) (swamp-rat-nest-dummy-method-21 self) (when (zero? (-> self skel)) @@ -851,7 +831,7 @@ swamp-rat-nest-default-event-handler ) (set! (-> gp-0 quad) (-> v1-8 transform vector 3 quad)) (let ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-8 transform vector 1) 1.0)) - (s4-0 (if (= (-> self fact-override pickup-type) (pickup-type none)) + (s4-0 (if (= (-> self fact pickup-type) (pickup-type none)) 0 9 ) @@ -906,9 +886,8 @@ swamp-rat-nest-default-event-handler (set-time! (-> self state-time)) ) :trans (behavior () - (if (and *target* (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root trans) (-> *target* control trans)) - ) + (if (and *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (go swamp-rat-nest-active) ) @@ -1004,7 +983,7 @@ swamp-rat-nest-default-event-handler :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (process-entity-status! self (entity-perm-status dead) #t) - (drop-pickup (-> self fact-override) #t *entity-pool* (-> self fact-override) 0) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0) (while (-> self child-process) (suspend) ) @@ -1012,11 +991,11 @@ swamp-rat-nest-default-event-handler :post #f ) -(defmethod init-from-entity! swamp-rat-nest ((this swamp-rat-nest) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swamp-rat-nest) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) - (set! (-> this fact-override) + (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) @@ -1057,7 +1036,7 @@ swamp-rat-nest-default-event-handler :bounds (static-spherem 0 0 0 5) ) -(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-a ((this swamp-rat-nest-dummy-a)) +(defmethod swamp-rat-nest-dummy-method-20 ((this swamp-rat-nest-dummy-a)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -1070,13 +1049,13 @@ swamp-rat-nest-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton this *swamp-rat-nest-dummy-a-sg* '()) (none) ) -(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-b ((this swamp-rat-nest-dummy-b)) +(defmethod swamp-rat-nest-dummy-method-20 ((this swamp-rat-nest-dummy-b)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -1089,13 +1068,13 @@ swamp-rat-nest-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton this *swamp-rat-nest-dummy-b-sg* '()) (none) ) -(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-c ((this swamp-rat-nest-dummy-c)) +(defmethod swamp-rat-nest-dummy-method-20 ((this swamp-rat-nest-dummy-c)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -1108,13 +1087,13 @@ swamp-rat-nest-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton this *swamp-rat-nest-dummy-c-sg* '()) (none) ) -(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-a ((this swamp-rat-nest-dummy-a)) +(defmethod swamp-rat-nest-dummy-method-21 ((this swamp-rat-nest-dummy-a)) (let ((v1-0 0)) (let* ((a0-1 '(5 6 7 8 9 10)) (a1-0 (car a0-1)) @@ -1138,7 +1117,7 @@ swamp-rat-nest-default-event-handler ) ) -(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-b ((this swamp-rat-nest-dummy-b)) +(defmethod swamp-rat-nest-dummy-method-21 ((this swamp-rat-nest-dummy-b)) (let ((v1-0 0)) (let* ((a0-1 '(5 9 10 6 7 8)) (a1-0 (car a0-1)) @@ -1162,7 +1141,7 @@ swamp-rat-nest-default-event-handler ) ) -(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-c ((this swamp-rat-nest-dummy-c)) +(defmethod swamp-rat-nest-dummy-method-21 ((this swamp-rat-nest-dummy-c)) (let ((v1-0 0)) (let* ((a0-1 '(5 6)) (a1-0 (car a0-1)) diff --git a/goal_src/jak1/levels/swamp/swamp-rat.gc b/goal_src/jak1/levels/swamp/swamp-rat.gc index 3c19dafebda..27ef0f45520 100644 --- a/goal_src/jak1/levels/swamp/swamp-rat.gc +++ b/goal_src/jak1/levels/swamp/swamp-rat.gc @@ -12,22 +12,18 @@ ;; DECOMP BEGINS (deftype swamp-rat (nav-enemy) - ((up-vector vector :inline :offset-assert 400) - (state-float float :offset-assert 416) - (state-vector vector :inline :offset-assert 432) - (_hack uint64 :offset-assert 448) - (wiggle-time time-frame :offset-assert 456) - (wiggle-angle float :offset-assert 464) - (delta-wiggle-angle float :offset-assert 468) - (wiggle-factor float :offset-assert 472) - (min-height float :offset-assert 476) - (chase-rest-time time-frame :offset-assert 480) - (target-nav-time time-frame :offset-assert 488) + ((up-vector vector :inline) + (state-float float) + (state-vector vector :inline) + (_hack uint64) + (wiggle-time time-frame) + (wiggle-angle float) + (delta-wiggle-angle float) + (wiggle-factor float) + (min-height float) + (chase-rest-time time-frame) + (target-nav-time time-frame) ) - :heap-base #x180 - :method-count-assert 76 - :size-assert #x1f0 - :flag-assert #x4c018001f0 (:states swamp-rat-spawn ) @@ -40,7 +36,7 @@ :longest-edge (meters 1) ) -(defmethod touch-handler swamp-rat ((this swamp-rat) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this swamp-rat) (arg0 process) (arg1 event-message-block)) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) (-> this collide-info) @@ -75,7 +71,7 @@ swamp-rat-default-event-handler -(defmethod common-post swamp-rat ((this swamp-rat)) +(defmethod common-post ((this swamp-rat)) (when (logtest? (-> this collide-info status) (cshape-moving-flags onsurf)) (vector-deg-seek (-> this up-vector) (-> this up-vector) (-> this collide-info surface-normal) 910.2222) (vector-normalize! (-> this up-vector) 1.0) @@ -89,7 +85,7 @@ swamp-rat-default-event-handler (none) ) -(defmethod nav-enemy-method-38 swamp-rat ((this swamp-rat)) +(defmethod nav-enemy-method-38 ((this swamp-rat)) (integrate-for-enemy-with-move-to-ground! (-> this collide-info) (-> this collide-info transv) @@ -409,7 +405,7 @@ swamp-rat-default-event-handler ) ) -(defmethod initialize-collision swamp-rat ((this swamp-rat)) +(defmethod initialize-collision ((this swamp-rat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -432,7 +428,7 @@ swamp-rat-default-event-handler (none) ) -(defmethod nav-enemy-method-48 swamp-rat ((this swamp-rat)) +(defmethod nav-enemy-method-48 ((this swamp-rat)) (initialize-skeleton this *swamp-rat-sg* '()) (init-defaults! this *swamp-rat-nav-enemy-info*) (vector-float*! (-> this collide-info scale) *identity-vector* 1.5) diff --git a/goal_src/jak1/levels/title/title-obs.gc b/goal_src/jak1/levels/title/title-obs.gc index b8de6b3c8a1..0b1ef3e5feb 100644 --- a/goal_src/jak1/levels/title/title-obs.gc +++ b/goal_src/jak1/levels/title/title-obs.gc @@ -8,31 +8,27 @@ ;; DECOMP BEGINS (deftype logo (process-drawable) - ((camera handle :offset-assert 176) - (camera-anim handle :offset-assert 184) - (volumes handle :offset-assert 192) - (black handle :offset-assert 200) - (target handle :offset-assert 208) - (sidekick handle :offset-assert 216) - (main-joint joint-mod :offset-assert 224) - (anim spool-anim :offset-assert 228) - (next-anim spool-anim :offset-assert 232) - (done? symbol :offset-assert 236) + ((camera handle) + (camera-anim handle) + (volumes handle) + (black handle) + (target handle) + (sidekick handle) + (main-joint joint-mod) + (anim spool-anim) + (next-anim spool-anim) + (done? symbol) ) - :heap-base #x80 - :method-count-assert 24 - :size-assert #xf0 - :flag-assert #x18008000f0 - (:methods - (idle () _type_ :state 20) - (startup () _type_ :state 21) - (hidden () _type_ :state 22) - (ndi () _type_ :state 23) + (:state-methods + idle + startup + hidden + ndi ) ) -(defmethod relocate logo ((this logo) (arg0 int)) +(defmethod relocate ((this logo) (arg0 int)) (if (nonzero? (-> this main-joint)) (&+! (-> this main-joint) arg0) ) @@ -40,20 +36,16 @@ ) (deftype logo-slave (process-drawable) - ((parent-process (pointer logo) :offset 12) - (main-joint joint-mod :offset-assert 176) + ((parent-process (pointer logo) :overlay-at parent) + (main-joint joint-mod) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xb4 - :flag-assert #x15005000b4 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) -(defmethod relocate logo-slave ((this logo-slave) (arg0 int)) +(defmethod relocate ((this logo-slave) (arg0 int)) (if (nonzero? (-> this main-joint)) (&+! (-> this main-joint) arg0) ) diff --git a/goal_src/jak1/levels/training/training-obs.gc b/goal_src/jak1/levels/training/training-obs.gc index 7077f7c3fb2..9ff46f2f8cc 100644 --- a/goal_src/jak1/levels/training/training-obs.gc +++ b/goal_src/jak1/levels/training/training-obs.gc @@ -9,10 +9,6 @@ (deftype training-water (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) @@ -29,7 +25,7 @@ ) ) -(defmethod water-vol-method-22 training-water ((this training-water)) +(defmethod water-vol-method-22 ((this training-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) @@ -50,22 +46,18 @@ ) (deftype training-cam (process) - ((root trsq :offset-assert 112) - (range meters :offset-assert 116) - (index int32 :offset-assert 120) - (state-time time-frame :offset-assert 128) + ((root trsq) + (range meters) + (index int32) + (state-time time-frame) ) - :heap-base #x20 - :method-count-assert 15 - :size-assert #x88 - :flag-assert #xf00200088 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) -(defmethod relocate training-cam ((this training-cam) (arg0 int)) +(defmethod relocate ((this training-cam) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) @@ -208,7 +200,7 @@ ) ) -(defmethod init-from-entity! training-cam ((this training-cam) (arg0 entity-actor)) +(defmethod init-from-entity! ((this training-cam) (arg0 entity-actor)) "Copy defaults from the entity." (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this root) (new 'process 'trsq)) @@ -222,16 +214,12 @@ ) (deftype tra-pontoon (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 736) + ((anchor-point vector :inline) ) - :heap-base #x280 - :method-count-assert 35 - :size-assert #x2f0 - :flag-assert #x23028002f0 ) -(defmethod init-from-entity! tra-pontoon ((this tra-pontoon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tra-pontoon) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (rigid-body-platform-method-30 this) (process-drawable-from-entity! this arg0) @@ -241,7 +229,7 @@ (none) ) -(defmethod rigid-body-platform-method-23 tra-pontoon ((this tra-pontoon) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this tra-pontoon) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 @@ -279,7 +267,7 @@ :bounds (static-spherem 0 0 0 5) ) -(defmethod rigid-body-platform-method-30 tra-pontoon ((this tra-pontoon)) +(defmethod rigid-body-platform-method-30 ((this tra-pontoon)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -304,7 +292,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 tra-pontoon ((this tra-pontoon)) +(defmethod rigid-body-platform-method-31 ((this tra-pontoon)) (initialize-skeleton this *tra-pontoon-sg* '()) (rigid-body-platform-method-29 this *tra-pontoon-constants*) (set! (-> this float-height-offset) 6144.0) @@ -341,10 +329,6 @@ (deftype tra-iris-door (eco-door) () - :heap-base #xa0 - :method-count-assert 27 - :size-assert #x104 - :flag-assert #x1b00a00104 ) @@ -353,7 +337,7 @@ :bounds (static-spherem 0 0 0 8) ) -(defmethod eco-door-method-24 tra-iris-door ((this tra-iris-door)) +(defmethod eco-door-method-24 ((this tra-iris-door)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -366,17 +350,17 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod eco-door-method-25 tra-iris-door ((this tra-iris-door)) +(defmethod eco-door-method-25 ((this tra-iris-door)) (initialize-skeleton this *tra-iris-door-sg* '()) (set! (-> this open-distance) 32768.0) (set! (-> this close-distance) 49152.0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) 0 (none) ) @@ -541,33 +525,25 @@ ) (deftype scarecrow-a (process-drawable) - ((root-override collide-shape :offset 112) - (incomming-attack-id uint64 :offset-assert 176) - (intersection vector :inline :offset-assert 192) + ((root collide-shape :override) + (incomming-attack-id uint64) + (intersection vector :inline) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16006000d0 - (:methods - (idle () _type_ :state 20) - (hit (float vector symbol) _type_ :state 21) + (:state-methods + idle + (hit float vector symbol) ) ) (deftype scarecrow-b (process-drawable) - ((root-override collide-shape :offset 112) - (incomming-attack-id uint64 :offset-assert 176) - (intersection vector :inline :offset-assert 192) + ((root collide-shape :override) + (incomming-attack-id uint64) + (intersection vector :inline) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16006000d0 - (:methods - (idle () _type_ :state 20) - (hit (float vector symbol) _type_ :state 21) + (:state-methods + idle + (hit float vector symbol) ) ) @@ -617,7 +593,7 @@ (f30-0 (cond (v1-14 - (let ((s4-2 (-> self root-override)) + (let ((s4-2 (-> self root)) (s2-0 (-> (the-as process-drawable v1-14) root trans)) ) (deg-diff (y-angle s4-2) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-2 trans)))) @@ -630,7 +606,7 @@ ) (a0-24 ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint -1) ) ) @@ -646,7 +622,7 @@ symbol (and ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 2) ) (or (= (-> self type) scarecrow-a) @@ -663,19 +639,12 @@ ) ) (('touch) - (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> block param 0)) - 0.7 - 6144.0 - 16384.0 - ) + (send-shove-back (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) ) ) ) :trans (behavior () - (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (get-reminder (get-task-control (game-task training-gimmie)) 0) ) ) @@ -723,7 +692,7 @@ ) (go-virtual idle) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (effect-control-method-10 (-> self skel effect) 'group-scarecrow-joint-explode 12.0 -1) (effect-control-method-10 (-> self skel effect) 'group-scarecrow-joint-explode 20.0 -1) (effect-control-method-10 (-> self skel effect) 'group-scarecrow-explode 4.0 -1) @@ -767,7 +736,7 @@ :post ja-post ) -(defmethod init-from-entity! scarecrow-a ((this scarecrow-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this scarecrow-a) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -794,7 +763,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *scarecrow-a-sg* '()) @@ -859,7 +828,7 @@ ) (go-virtual idle) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (effect-control-method-10 (-> self skel effect) 'group-scarecrow-joint-explode 12.0 -1) (effect-control-method-10 (-> self skel effect) 'group-scarecrow-joint-explode 21.0 -1) (effect-control-method-10 (-> self skel effect) 'group-scarecrow-explode 4.0 -1) @@ -906,7 +875,7 @@ :post ja-post ) -(defmethod init-from-entity! scarecrow-b ((this scarecrow-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this scarecrow-b) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -941,7 +910,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *scarecrow-b-sg* '()) diff --git a/goal_src/jak1/levels/training/training-part.gc b/goal_src/jak1/levels/training/training-part.gc index d011a071a7a..9c2ad9f175e 100644 --- a/goal_src/jak1/levels/training/training-part.gc +++ b/goal_src/jak1/levels/training/training-part.gc @@ -9,10 +9,6 @@ (deftype training-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/village1/assistant.gc b/goal_src/jak1/levels/village1/assistant.gc index c1d331f2961..b434e1ffc0a 100644 --- a/goal_src/jak1/levels/village1/assistant.gc +++ b/goal_src/jak1/levels/village1/assistant.gc @@ -8,12 +8,8 @@ ;; DECOMP BEGINS (deftype assistant (process-taskable) - ((sound-id sound-id :offset-assert 380) + ((sound-id sound-id) ) - :heap-base #x110 - :method-count-assert 53 - :size-assert #x180 - :flag-assert #x3501100180 ) @@ -23,10 +19,10 @@ :shadow assistant-shadow-mg ) -(defmethod process-taskable-method-52 assistant ((this assistant)) +(defmethod process-taskable-method-52 ((this assistant)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -42,7 +38,7 @@ (none) ) -(defmethod draw-npc-shadow assistant ((this assistant)) +(defmethod draw-npc-shadow ((this assistant)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -65,7 +61,7 @@ (none) ) -(defmethod play-anim! assistant ((this assistant) (arg0 symbol)) +(defmethod play-anim! ((this assistant) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (case (current-task (-> this tasks)) @@ -166,11 +162,11 @@ ) ) -(defmethod get-art-elem assistant ((this assistant)) +(defmethod get-art-elem ((this assistant)) (-> this draw art-group data 3) ) -(defmethod process-taskable-method-43 assistant ((this assistant)) +(defmethod process-taskable-method-43 ((this assistant)) (let ((s5-0 (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this)) ) (when s5-0 @@ -180,19 +176,19 @@ #f ) ((< 0.8 f0-2) - (play-ambient (-> this ambient) "ASSTLP01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP01" #f (-> this root trans)) ) ((< 0.6 f0-2) - (play-ambient (-> this ambient) "ASSTLP04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP04" #f (-> this root trans)) ) ((< 0.4 f0-2) - (play-ambient (-> this ambient) "ASSTLP05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP05" #f (-> this root trans)) ) ((< 0.2 f0-2) - (play-ambient (-> this ambient) "ASSTLP02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP02" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "ASSTLP03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP03" #f (-> this root trans)) ) ) ) @@ -369,7 +365,7 @@ (none) ) -(defmethod init-from-entity! assistant ((this assistant) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-sg* 3 31 (new 'static 'vector :w 4096.0) 5) (set! (-> this bounce-away) #f) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 122) this)) diff --git a/goal_src/jak1/levels/village1/explorer.gc b/goal_src/jak1/levels/village1/explorer.gc index 82e1d780ce8..91ad1b21355 100644 --- a/goal_src/jak1/levels/village1/explorer.gc +++ b/goal_src/jak1/levels/village1/explorer.gc @@ -9,10 +9,6 @@ (deftype explorer (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -22,10 +18,10 @@ :shadow explorer-shadow-mg ) -(defmethod process-taskable-method-52 explorer ((this explorer)) +(defmethod process-taskable-method-52 ((this explorer)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -41,7 +37,7 @@ (none) ) -(defmethod draw-npc-shadow explorer ((this explorer)) +(defmethod draw-npc-shadow ((this explorer)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -64,7 +60,7 @@ (none) ) -(defmethod play-anim! explorer ((this explorer) (arg0 symbol)) +(defmethod play-anim! ((this explorer) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -139,45 +135,45 @@ ) ) -(defmethod get-art-elem explorer ((this explorer)) +(defmethod get-art-elem ((this explorer)) (-> this draw art-group data 3) ) -(defmethod process-taskable-method-43 explorer ((this explorer)) +(defmethod process-taskable-method-43 ((this explorer)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) - (play-ambient (-> this ambient) "EXP-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-AM05" #f (-> this root trans)) ) ((< 0.71428573 f0-2) (if (not (closed? (-> this tasks) (game-task village1-uncle-money) (task-status need-reminder))) - (play-ambient (-> this ambient) "EXP-LO02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-LO02" #f (-> this root trans)) ) ) ((< 0.5714286 f0-2) - (play-ambient (-> this ambient) "EXP-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-AM04" #f (-> this root trans)) ) ((< 0.42857143 f0-2) - (play-ambient (-> this ambient) "EXP-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-AM03" #f (-> this root trans)) ) ((< 0.2857143 f0-2) - (play-ambient (-> this ambient) "EXP-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-AM02" #f (-> this root trans)) ) ((< 0.14285715 f0-2) (if (not (closed? (-> this tasks) (game-task village1-uncle-money) (task-status need-reminder))) - (play-ambient (-> this ambient) "EXP-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-AM01" #f (-> this root trans)) ) ) (else - (play-ambient (-> this ambient) "EXP-LO1A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-LO1A" #f (-> this root trans)) ) ) ) ) ) -(defmethod target-above-threshold? explorer ((this explorer)) +(defmethod target-above-threshold? ((this explorer)) (the-as symbol (and *target* (< (-> (target-pos 0) x) -202752.0) (< 98304.0 (-> (target-pos 0) z)))) ) @@ -332,7 +328,7 @@ ) ) -(defmethod init-from-entity! explorer ((this explorer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this explorer) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *explorer-sg* 3 42 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task village1-uncle-money))) (set! (-> this sound-flava) (music-flava explorer)) diff --git a/goal_src/jak1/levels/village1/farmer.gc b/goal_src/jak1/levels/village1/farmer.gc index 56b322ba96a..cbf8a99cd99 100644 --- a/goal_src/jak1/levels/village1/farmer.gc +++ b/goal_src/jak1/levels/village1/farmer.gc @@ -9,10 +9,6 @@ (deftype farmer (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -22,7 +18,7 @@ :shadow farmer-shadow-mg ) -(defmethod play-anim! farmer ((this farmer) (arg0 symbol)) +(defmethod play-anim! ((this farmer) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 @@ -68,7 +64,7 @@ ) ) -(defmethod get-art-elem farmer ((this farmer)) +(defmethod get-art-elem ((this farmer)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction) (task-status need-resolution) (task-status invalid)) (-> this draw art-group data 4) @@ -79,24 +75,24 @@ ) ) -(defmethod process-taskable-method-43 farmer ((this farmer)) +(defmethod process-taskable-method-43 ((this farmer)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8333333 f0-2) - (play-ambient (-> this ambient) "FAR-LO1A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FAR-LO1A" #f (-> this root trans)) ) ((< 0.6666667 f0-2) - (play-ambient (-> this ambient) "FAR-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FAR-AM01" #f (-> this root trans)) ) ((< 0.5 f0-2) #f ) ((< 0.33333334 f0-2) - (play-ambient (-> this ambient) "FAR-AM2A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FAR-AM2A" #f (-> this root trans)) ) ((< 0.16666667 f0-2) - (play-ambient (-> this ambient) "FAR-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FAR-AM02" #f (-> this root trans)) ) (else #f @@ -106,7 +102,7 @@ ) ) -(defmethod initialize-collision farmer ((this farmer) (arg0 int) (arg1 vector)) +(defmethod initialize-collision ((this farmer) (arg0 int) (arg1 vector)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) @@ -134,16 +130,16 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-from-entity! farmer ((this farmer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farmer) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *farmer-sg* 3 25 (new 'static 'vector :w 4096.0) 5) - (set! (-> this root-override nav-radius) 40960.0) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this root nav-radius) 40960.0) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (set! (-> this tasks) (get-task-control (game-task village1-yakow))) (process-taskable-method-42 this) (none) diff --git a/goal_src/jak1/levels/village1/fishermans-boat.gc b/goal_src/jak1/levels/village1/fishermans-boat.gc index 3109d451b6a..c30ba3dcc9e 100644 --- a/goal_src/jak1/levels/village1/fishermans-boat.gc +++ b/goal_src/jak1/levels/village1/fishermans-boat.gc @@ -38,42 +38,36 @@ ) (deftype boat-stabilizer (structure) - ((local-pos vector :inline :offset-assert 0) - (normal vector :inline :offset-assert 16) + ((local-pos vector :inline) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype vehicle-path (structure) - ((point-array vector 10 :inline :offset-assert 0) - (point-count int32 :offset-assert 160) + ((point-array vector 10 :inline) + (point-count int32) ) - :method-count-assert 14 - :size-assert #xa4 - :flag-assert #xe000000a4 (:methods - (get-point-count (_type_) int 9) - (nth-point (_type_ int vector) vector 10) - (distance-to-next-point (_type_ int vector) vector 11) - (add-point! (_type_ float float float float) none 12) - (debug-draw (_type_) symbol 13) + (get-point-count (_type_) int) + (nth-point (_type_ int vector) vector) + (distance-to-next-point (_type_ int vector) vector) + (add-point! (_type_ float float float float) none) + (debug-draw (_type_) symbol) ) ) -(defmethod get-point-count vehicle-path ((this vehicle-path)) +(defmethod get-point-count ((this vehicle-path)) (-> this point-count) ) -(defmethod nth-point vehicle-path ((this vehicle-path) (arg0 int) (arg1 vector)) +(defmethod nth-point ((this vehicle-path) (arg0 int) (arg1 vector)) (set! (-> arg1 quad) (-> this point-array arg0 quad)) arg1 ) -(defmethod distance-to-next-point vehicle-path ((this vehicle-path) (arg0 int) (arg1 vector)) +(defmethod distance-to-next-point ((this vehicle-path) (arg0 int) (arg1 vector)) (let ((a2-1 (+ arg0 1))) (if (>= a2-1 (-> this point-count)) (set! a2-1 0) @@ -85,7 +79,7 @@ arg1 ) -(defmethod add-point! vehicle-path ((this vehicle-path) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) +(defmethod add-point! ((this vehicle-path) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (let ((v1-0 (-> this point-count))) (when (< v1-0 10) (set-vector! (-> this point-array v1-0) arg0 arg1 arg2 arg3) @@ -96,7 +90,7 @@ (none) ) -(defmethod debug-draw vehicle-path ((this vehicle-path)) +(defmethod debug-draw ((this vehicle-path)) (local-vars (sv-64 int) (sv-80 (function _varargs_ object))) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -233,48 +227,45 @@ ) (deftype vehicle-controller (structure) - ((path vehicle-path :offset-assert 0) - (turning-radius-table (pointer float) :offset-assert 4) - (throttle-control-table (pointer float) :offset-assert 8) - (table-step float :offset-assert 12) - (table-length int32 :offset-assert 16) - (circle-radius float :offset-assert 20) - (throttle float :offset-assert 24) - (steering float :offset-assert 28) - (path-dest-index int8 :offset-assert 32) - (left-circle int8 :offset-assert 33) - (path-dest-point vector :inline :offset-assert 48) - (path-dest-velocity vector :inline :offset-assert 64) - (dest-circle vector :inline :offset-assert 80) - (target-point vector :inline :offset-assert 96) - (sample-dir vector :inline :offset-assert 112) - (sample-time time-frame :offset-assert 128) - (sample-index int32 :offset-assert 136) + ((path vehicle-path) + (turning-radius-table (pointer float)) + (throttle-control-table (pointer float)) + (table-step float) + (table-length int32) + (circle-radius float) + (throttle float) + (steering float) + (path-dest-index int8) + (left-circle int8) + (path-dest-point vector :inline) + (path-dest-velocity vector :inline) + (dest-circle vector :inline) + (target-point vector :inline) + (sample-dir vector :inline) + (sample-time time-frame) + (sample-index int32) ) - :method-count-assert 17 - :size-assert #x8c - :flag-assert #x110000008c (:methods - (init! (_type_ vehicle-path (pointer float) (pointer float) int float) none 9) - (vehicle-controller-method-10 (_type_ vector float int) none 10) - (vehicle-controller-method-11 (_type_) none 11) - (vehicle-controller-method-12 (_type_ int vector) none 12) - (move-to-next-point (_type_ vector) none 13) - (vehicle-controller-method-14 (_type_ vector vector) none 14) - (vehicle-controller-method-15 (_type_ collide-shape-moving) none 15) - (vehicle-controller-method-16 (_type_) none 16) + (init! (_type_ vehicle-path (pointer float) (pointer float) int float) none) + (vehicle-controller-method-10 (_type_ vector float int) none) + (vehicle-controller-method-11 (_type_) none) + (vehicle-controller-method-12 (_type_ int vector) none) + (move-to-next-point (_type_ vector) none) + (vehicle-controller-method-14 (_type_ vector vector) none) + (vehicle-controller-method-15 (_type_ collide-shape-moving) none) + (vehicle-controller-method-16 (_type_) none) ) ) -(defmethod relocate vehicle-controller ((this vehicle-controller) (arg0 int)) +(defmethod relocate ((this vehicle-controller) (arg0 int)) (if (nonzero? (-> this path)) (&+! (-> this path) arg0) ) (the-as vehicle-controller 0) ) -(defmethod vehicle-controller-method-12 vehicle-controller ((this vehicle-controller) (arg0 int) (arg1 vector)) +(defmethod vehicle-controller-method-12 ((this vehicle-controller) (arg0 int) (arg1 vector)) (when (< arg0 (get-point-count (-> this path))) (set! (-> this path-dest-index) arg0) (nth-point (-> this path) arg0 (-> this path-dest-point)) @@ -309,7 +300,7 @@ (none) ) -(defmethod move-to-next-point vehicle-controller ((this vehicle-controller) (arg0 vector)) +(defmethod move-to-next-point ((this vehicle-controller) (arg0 vector)) (let ((s4-0 (+ (-> this path-dest-index) 1))) (if (>= s4-0 (get-point-count (-> this path))) (set! s4-0 0) @@ -320,7 +311,7 @@ (none) ) -(defmethod vehicle-controller-method-14 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 vector)) +(defmethod vehicle-controller-method-14 ((this vehicle-controller) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) @@ -355,7 +346,7 @@ (none) ) -(defmethod vehicle-controller-method-15 vehicle-controller ((this vehicle-controller) (arg0 collide-shape-moving)) +(defmethod vehicle-controller-method-15 ((this vehicle-controller) (arg0 collide-shape-moving)) (vehicle-controller-method-14 this (-> arg0 trans) (-> this target-point)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -395,7 +386,7 @@ (none) ) -(defmethod vehicle-controller-method-11 vehicle-controller ((this vehicle-controller)) +(defmethod vehicle-controller-method-11 ((this vehicle-controller)) (format #t "(define *turning-radius-table* (new 'static 'inline-array 'float 0~%") (dotimes (s5-0 (-> this table-length)) (format #t " (meters ~4,,2M)~%" (-> this turning-radius-table s5-0)) @@ -412,7 +403,7 @@ (none) ) -(defmethod vehicle-controller-method-10 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 float) (arg2 int)) +(defmethod vehicle-controller-method-10 ((this vehicle-controller) (arg0 vector) (arg1 float) (arg2 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 quad) (-> arg0 quad)) (set! (-> s3-0 y) 0.0) @@ -443,7 +434,7 @@ (none) ) -(defmethod vehicle-controller-method-16 vehicle-controller ((this vehicle-controller)) +(defmethod vehicle-controller-method-16 ((this vehicle-controller)) (debug-draw (-> this path)) (add-debug-sphere #t @@ -462,13 +453,13 @@ (none) ) -(defmethod init! vehicle-controller ((this vehicle-controller) - (arg0 vehicle-path) - (arg1 (pointer float)) - (arg2 (pointer float)) - (arg3 int) - (arg4 float) - ) +(defmethod init! ((this vehicle-controller) + (arg0 vehicle-path) + (arg1 (pointer float)) + (arg2 (pointer float)) + (arg3 int) + (arg4 float) + ) (set! (-> this path) arg0) (set! (-> this turning-radius-table) arg1) (set! (-> this throttle-control-table) arg2) @@ -480,37 +471,33 @@ ) (deftype fishermans-boat (rigid-body-platform) - ((stabilizer-array boat-stabilizer 2 :inline :offset-assert 736) - (engine-thrust-local-pos vector :inline :offset-assert 800) - (ignition symbol :offset-assert 816) - (engine-thrust float :offset-assert 820) - (propeller joint-mod-spinner :offset-assert 824) - (dock-point vector :inline :offset-assert 832) - (dest-dir vector :inline :offset-assert 848) - (dock-point-index int8 :offset-assert 864) - (auto-pilot symbol :offset-assert 868) - (anchored symbol :offset-assert 872) - (waiting-for-player symbol :offset-assert 876) - (player-riding symbol :offset-assert 880) - (boat-path vehicle-path :inline :offset-assert 896) - (cam-tracker handle :offset-assert 1064) - (kill-player symbol :offset 1076) - (engine-sound-id sound-id :offset 1080) - (engine-sound-envelope float :offset 1084) - (debug-draw basic :offset 1088) - (debug-path-record basic :offset 1092) - (debug-path-playback basic :offset 1096) - (measure-parameters basic :offset 1100) - (controller vehicle-controller :inline :offset 1104) - (anim spool-anim :offset 1244) - (old-target-pos transformq :inline :offset 1248) - (evilbro handle :offset 1296) - (evilsis handle :offset 1304) + ((stabilizer-array boat-stabilizer 2 :inline) + (engine-thrust-local-pos vector :inline) + (ignition symbol) + (engine-thrust float) + (propeller joint-mod-spinner) + (dock-point vector :inline) + (dest-dir vector :inline) + (dock-point-index int8) + (auto-pilot symbol) + (anchored symbol) + (waiting-for-player symbol) + (player-riding symbol) + (boat-path vehicle-path :inline) + (cam-tracker handle) + (kill-player symbol :offset 1076) + (engine-sound-id sound-id :offset 1080) + (engine-sound-envelope float :offset 1084) + (debug-draw basic :offset 1088) + (debug-path-record basic :offset 1092) + (debug-path-playback basic :offset 1096) + (measure-parameters basic :offset 1100) + (controller vehicle-controller :inline :offset 1104) + (anim spool-anim :offset 1244) + (old-target-pos transformq :inline :offset 1248) + (evilbro handle :offset 1296) + (evilsis handle :offset 1304) ) - :heap-base #x4b0 - :method-count-assert 35 - :size-assert #x520 - :flag-assert #x2304b00520 (:states fishermans-boat-docked-misty fishermans-boat-docked-village @@ -542,7 +529,7 @@ :bounds (static-spherem 0 0 0 1) ) -(defmethod rigid-body-platform-method-23 fishermans-boat ((this fishermans-boat) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this fishermans-boat) (arg0 float)) (local-vars (sv-128 int) (sv-144 rigid-body-control-point) (sv-160 int) (sv-176 vector)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) @@ -1213,7 +1200,7 @@ :post fishermans-boat-post ) -(defmethod relocate fishermans-boat ((this fishermans-boat) (arg0 int)) +(defmethod relocate ((this fishermans-boat) (arg0 int)) (relocate (-> this controller) arg0) (if (nonzero? (-> this propeller)) (&+! (-> this propeller) arg0) @@ -1221,7 +1208,7 @@ (call-parent-method this arg0) ) -(defmethod rigid-body-platform-method-30 fishermans-boat ((this fishermans-boat)) +(defmethod rigid-body-platform-method-30 ((this fishermans-boat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1254,7 +1241,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 fishermans-boat ((this fishermans-boat)) +(defmethod rigid-body-platform-method-31 ((this fishermans-boat)) (initialize-skeleton this *fishermans-boat-sg* '()) (logclear! (-> this mask) (process-mask actor-pause movie)) (logior! (-> this skel status) (janim-status inited)) @@ -1363,7 +1350,7 @@ (none) ) -(defmethod init-from-entity! fishermans-boat ((this fishermans-boat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fishermans-boat) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (logior! (-> this mask) (process-mask platform)) (rigid-body-platform-method-30 this) diff --git a/goal_src/jak1/levels/village1/sage.gc b/goal_src/jak1/levels/village1/sage.gc index ce2db8980e9..f1d248159cf 100644 --- a/goal_src/jak1/levels/village1/sage.gc +++ b/goal_src/jak1/levels/village1/sage.gc @@ -8,13 +8,9 @@ ;; DECOMP BEGINS (deftype sage (process-taskable) - ((reminder-played basic :offset-assert 380) - (assistant handle :offset-assert 384) + ((reminder-played basic) + (assistant handle) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x188 - :flag-assert #x3501200188 ) @@ -24,7 +20,7 @@ :shadow sage-shadow-mg ) -(defmethod play-anim! sage ((this sage) (arg0 symbol)) +(defmethod play-anim! ((this sage) (arg0 symbol)) (when (!= *kernel-boot-message* 'play) (close-specific-task! (game-task intro) (task-status need-resolution)) (return (new 'static 'spool-anim @@ -231,7 +227,7 @@ (apply-settings *setting-control*) (close-status! (-> this tasks) (task-status need-reward-speech)) (set! (-> this assistant) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *assistant-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *assistant-sg* #f :to this)) ) (send-event (handle->process (-> this assistant)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this assistant)) 'blend-shape #t) @@ -333,7 +329,7 @@ ) ) -(defmethod process-taskable-method-45 sage ((this sage)) +(defmethod process-taskable-method-45 ((this sage)) (cond ((and (closed? (-> this tasks) (game-task beach-ecorocks) (task-status need-reminder)) (= (get-reminder (-> this tasks) 0) 0) @@ -345,9 +341,7 @@ ) #t ) - ((and (-> this reminder-played) - (< 81920.0 (vector-vector-distance (-> this root-override trans) (camera-pos))) - ) + ((and (-> this reminder-played) (< 81920.0 (vector-vector-distance (-> this root trans) (camera-pos)))) #t ) (else @@ -356,7 +350,7 @@ ) ) -(defmethod get-art-elem sage ((this sage)) +(defmethod get-art-elem ((this sage)) (cond ((and (= (current-task (-> this tasks)) (game-task beach-ecorocks)) (or (= (current-status (-> this tasks)) (task-status need-hint)) @@ -418,7 +412,7 @@ ) ) -(defmethod process-taskable-method-43 sage ((this sage)) +(defmethod process-taskable-method-43 ((this sage)) (let ((s5-0 (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this)) ) (when s5-0 @@ -428,19 +422,19 @@ #f ) ((< 0.8 f0-2) - (play-ambient (-> this ambient) "SAGELP03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP03" #f (-> this root trans)) ) ((< 0.6 f0-2) - (play-ambient (-> this ambient) "SAGELP04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP04" #f (-> this root trans)) ) ((< 0.4 f0-2) - (play-ambient (-> this ambient) "SAGELP05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP05" #f (-> this root trans)) ) ((< 0.2 f0-2) - (play-ambient (-> this ambient) "SAGELP06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP06" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "SAGELP11" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP11" #f (-> this root trans)) ) ) ) @@ -474,9 +468,7 @@ (process-taskable-method-43 self) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (if (and (-> self reminder-played) - (< 81920.0 (vector-vector-distance (-> self root-override trans) (camera-pos))) - ) + (if (and (-> self reminder-played) (< 81920.0 (vector-vector-distance (-> self root trans) (camera-pos)))) (go-virtual idle) ) (suspend) @@ -536,11 +528,11 @@ ) ) -(defmethod should-display? sage ((this sage)) +(defmethod should-display? ((this sage)) (not (sages-kidnapped?)) ) -(defmethod initialize-collision sage ((this sage) (arg0 int) (arg1 vector)) +(defmethod initialize-collision ((this sage) (arg0 int) (arg1 vector)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) @@ -571,13 +563,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-from-entity! sage ((this sage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sage) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task misty-cannon))) (set! (-> this reminder-played) #f) diff --git a/goal_src/jak1/levels/village1/sequence-a-village1.gc b/goal_src/jak1/levels/village1/sequence-a-village1.gc index 6ae7a74fd47..77b2ce2201c 100644 --- a/goal_src/jak1/levels/village1/sequence-a-village1.gc +++ b/goal_src/jak1/levels/village1/sequence-a-village1.gc @@ -196,17 +196,13 @@ ) (deftype sequenceA-village1 (process-taskable) - ((boat handle :offset-assert 384) - (side handle :offset-assert 392) + ((boat handle) + (side handle) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x190 - :flag-assert #x3501200190 ) -(defmethod play-anim! sequenceA-village1 ((this sequenceA-village1) (arg0 symbol)) +(defmethod play-anim! ((this sequenceA-village1) (arg0 symbol)) (when arg0 (set! (-> *time-of-day-proc* 0 time-ratio) 0.0) (set! (-> *time-of-day-proc* 0 hour) 23) @@ -216,9 +212,7 @@ (send-event *camera* 'change-state cam-fixed 0) (send-event *target* 'sidekick #f) (set! (-> this boat) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *fishermans-boat-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *fishermans-boat-sg* #f :to this)) ) (send-event (handle->process (-> this boat)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this boat)) 'origin-joint-index 3) @@ -254,7 +248,7 @@ ) ) -(defmethod get-art-elem sequenceA-village1 ((this sequenceA-village1)) +(defmethod get-art-elem ((this sequenceA-village1)) (-> this draw art-group data 3) ) @@ -269,7 +263,7 @@ (when gp-1 (format 0 "found entity for sidekick-human~%") (set! (-> self side) - (ppointer->handle (manipy-spawn (-> self root-override trans) gp-1 *sidekick-human-sg* #f :to self)) + (ppointer->handle (manipy-spawn (-> self root trans) gp-1 *sidekick-human-sg* #f :to self)) ) (send-event (handle->process (-> self side)) 'anim-mode 'clone-anim) (send-event (handle->process (-> self side)) 'center-joint 3) @@ -337,7 +331,7 @@ ) ) -(defmethod should-display? sequenceA-village1 ((this sequenceA-village1)) +(defmethod should-display? ((this sequenceA-village1)) #f ) diff --git a/goal_src/jak1/levels/village1/village-obs.gc b/goal_src/jak1/levels/village1/village-obs.gc index 7562ce0481f..0c27637c9cf 100644 --- a/goal_src/jak1/levels/village1/village-obs.gc +++ b/goal_src/jak1/levels/village1/village-obs.gc @@ -180,31 +180,27 @@ ) (deftype windmill-sail (process-drawable) - ((root-override trsq :offset 112) - (sync sync-info :inline :offset-assert 176) - (blade-normal vector :inline :offset-assert 192) - (orig-quat quaternion :inline :offset-assert 208) - (alt-actor entity-actor :offset-assert 224) - (part2 sparticle-launch-control :offset-assert 228) + ((root-override trsq :overlay-at root) + (sync sync-info :inline) + (blade-normal vector :inline) + (orig-quat quaternion :inline) + (alt-actor entity-actor) + (part2 sparticle-launch-control) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xe8 - :flag-assert #x14008000e8 (:states windmill-sail-idle ) ) -(defmethod relocate windmill-sail ((this windmill-sail) (arg0 int)) +(defmethod relocate ((this windmill-sail) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) (the-as windmill-sail ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate windmill-sail ((this windmill-sail)) +(defmethod deactivate ((this windmill-sail)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -292,7 +288,7 @@ :post ja-post ) -(defmethod init-from-entity! windmill-sail ((this windmill-sail) (arg0 entity-actor)) +(defmethod init-from-entity! ((this windmill-sail) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (load-params! (-> this sync) this (the-as uint 4800) 0.0 0.15 0.15) (set! (-> this root-override) (new 'process 'trsq)) @@ -310,15 +306,11 @@ ) (deftype sagesail (process-drawable) - ((root-override trsq :offset 112) - (sync sync-info :inline :offset-assert 176) - (blade-normal vector :inline :offset-assert 192) - (orig-quat quaternion :inline :offset-assert 208) + ((root-override trsq :overlay-at root) + (sync sync-info :inline) + (blade-normal vector :inline) + (orig-quat quaternion :inline) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xe0 - :flag-assert #x14007000e0 (:states sagesail-idle ) @@ -349,7 +341,7 @@ :post ja-post ) -(defmethod init-from-entity! sagesail ((this sagesail) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sagesail) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (set! (-> this root-override) (new 'process 'trsq)) @@ -364,22 +356,18 @@ ) (deftype windspinner (process-drawable) - ((blade-normal vector :inline :offset-assert 176) - (orig-quat quaternion :inline :offset-assert 192) - (angle float :offset-assert 208) - (angle-vel float :offset-assert 212) + ((blade-normal vector :inline) + (orig-quat quaternion :inline) + (angle float) + (angle-vel float) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd8 - :flag-assert #x14007000d8 (:states windspinner-idle ) ) -(defmethod run-logic? windspinner ((this windspinner)) +(defmethod run-logic? ((this windspinner)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status was-drawn)) @@ -438,7 +426,7 @@ :post ja-post ) -(defmethod init-from-entity! windspinner ((this windspinner) (arg0 entity-actor)) +(defmethod init-from-entity! ((this windspinner) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (set! (-> this angle) 0.0) (set! (-> this angle-vel) 145.63556) @@ -454,12 +442,8 @@ ) (deftype mayorgears (process-drawable) - ((alt-actor entity-actor :offset-assert 176) + ((alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states mayorgears-idle ) @@ -484,7 +468,7 @@ :post ja-post ) -(defmethod init-from-entity! mayorgears ((this mayorgears) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mayorgears) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -497,12 +481,8 @@ ;; og:preserve-this PAL patch here (deftype evilplant (process-drawable) () - :heap-base #x40 - :method-count-assert 21 - :size-assert #xb0 - :flag-assert #x15004000b0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -529,7 +509,7 @@ ) ) ) - :post (the-as (function none :behavior evilplant) ja-post) + :post ja-post ) (defmethod init-from-entity! evilplant ((obj evilplant) (arg0 entity-actor)) @@ -541,13 +521,9 @@ ) (deftype reflector-middle (process-drawable) - ((reflector-trans vector :inline :offset-assert 176) - (next-reflector-trans vector :inline :offset-assert 192) + ((reflector-trans vector :inline) + (next-reflector-trans vector :inline) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14006000d0 (:states reflector-middle-idle ) @@ -570,7 +546,7 @@ :post ja-post ) -(defmethod init-from-entity! reflector-middle ((this reflector-middle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this reflector-middle) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *reflector-middle-sg* '()) @@ -591,10 +567,6 @@ (deftype reflector-end (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states reflector-end-idle ) @@ -605,7 +577,7 @@ :code anim-loop ) -(defmethod init-from-entity! reflector-end ((this reflector-end) (arg0 entity-actor)) +(defmethod init-from-entity! ((this reflector-end) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (go reflector-end-idle) @@ -613,12 +585,8 @@ ) (deftype villa-starfish (process-drawable) - ((child-count int8 :offset-assert 176) + ((child-count int8) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb1 - :flag-assert #x14005000b1 (:states villa-starfish-idle ) @@ -632,10 +600,6 @@ (deftype starfish (nav-enemy) () - :heap-base #x120 - :method-count-assert 76 - :size-assert #x190 - :flag-assert #x4c01200190 (:states starfish-idle starfish-patrol @@ -746,7 +710,7 @@ ) ) -(defmethod initialize-collision starfish ((this starfish)) +(defmethod initialize-collision ((this starfish)) (logior! (-> this mask) (process-mask enemy)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -767,7 +731,7 @@ (none) ) -(defmethod nav-enemy-method-48 starfish ((this starfish)) +(defmethod nav-enemy-method-48 ((this starfish)) (initialize-skeleton this *starfish-sg* '()) (init-defaults! this *starfish-nav-enemy-info*) 0 @@ -825,7 +789,7 @@ :post #f ) -(defmethod init-from-entity! villa-starfish ((this villa-starfish) (arg0 entity-actor)) +(defmethod init-from-entity! ((this villa-starfish) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (let ((a1-4 (res-lump-value arg0 'num-lurkers uint128 :default (the-as uint128 3)))) @@ -837,12 +801,8 @@ ) (deftype village-fish (process-drawable) - ((child-count int8 :offset-assert 176) + ((child-count int8) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb1 - :flag-assert #x14005000b1 (:states village-fish-idle ) @@ -859,7 +819,7 @@ :post #f ) -(defmethod init-from-entity! village-fish ((this village-fish) (arg0 entity-actor)) +(defmethod init-from-entity! ((this village-fish) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (go village-fish-idle) @@ -868,30 +828,19 @@ (deftype villa-fisha (village-fish) () - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb1 - :flag-assert #x14005000b1 ) (deftype villa-fishb (village-fish) () - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb1 - :flag-assert #x14005000b1 ) (deftype cyclegen (structure) - ((output float :offset-assert 0) - (inc float :offset-assert 4) + ((output float) + (inc float) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -907,20 +856,16 @@ ) (deftype hutlamp (process-drawable) - ((pivot joint-mod-set-local :offset-assert 176) - (clock cyclegen :inline :offset-assert 180) + ((pivot joint-mod-set-local) + (clock cyclegen :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states hutlamp-idle ) ) -(defmethod relocate hutlamp ((this hutlamp) (arg0 int)) +(defmethod relocate ((this hutlamp) (arg0 int)) (if (nonzero? (-> this pivot)) (&+! (-> this pivot) arg0) ) @@ -945,7 +890,7 @@ :post ja-post ) -(defmethod init-from-entity! hutlamp ((this hutlamp) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hutlamp) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *hutlamp-sg* '()) @@ -958,12 +903,8 @@ (deftype revcycleprop (process-drawable) () - :heap-base #x40 - :method-count-assert 21 - :size-assert #xb0 - :flag-assert #x15004000b0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -979,7 +920,7 @@ :post ja-post ) -(defmethod init-from-entity! revcycleprop ((this revcycleprop) (arg0 entity-actor)) +(defmethod init-from-entity! ((this revcycleprop) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *revcycleprop-sg* '()) @@ -990,12 +931,8 @@ (deftype revcycle (process-drawable) () - :heap-base #x40 - :method-count-assert 21 - :size-assert #xb0 - :flag-assert #x15004000b0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1011,7 +948,7 @@ :post ja-post ) -(defmethod init-from-entity! revcycle ((this revcycle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this revcycle) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *revcycle-sg* '()) @@ -1022,10 +959,6 @@ (deftype villagea-water (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) @@ -1042,7 +975,7 @@ ) ) -(defmethod water-vol-method-22 villagea-water ((this villagea-water)) +(defmethod water-vol-method-22 ((this villagea-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/goal_src/jak1/levels/village1/village1-part.gc b/goal_src/jak1/levels/village1/village1-part.gc index 9f4ec271aef..1fa9d0a76ed 100644 --- a/goal_src/jak1/levels/village1/village1-part.gc +++ b/goal_src/jak1/levels/village1/village1-part.gc @@ -9,10 +9,6 @@ (deftype villagea-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/village1/yakow.gc b/goal_src/jak1/levels/village1/yakow.gc index f0a9042aa7a..76d35e06986 100644 --- a/goal_src/jak1/levels/village1/yakow.gc +++ b/goal_src/jak1/levels/village1/yakow.gc @@ -26,35 +26,32 @@ ) (deftype yakow-bank (basic) - ((walk-cycle-frame-count float :offset-assert 4) - (run-cycle-frame-count float :offset-assert 8) - (walk-speed meters :offset-assert 12) - (run-speed meters :offset-assert 16) - (walk-anim-speed float :offset-assert 20) - (run-anim-speed float :offset-assert 24) - (walk-away-dist meters :offset-assert 28) - (run-away-dist meters :offset-assert 32) - (walk-rotate-speed float :offset-assert 36) - (run-rotate-speed float :offset-assert 40) - (walk-turn-time time-frame :offset-assert 48) - (run-turn-time time-frame :offset-assert 56) - (max-walk-speed float :offset-assert 64) - (min-run-speed float :offset-assert 68) - (walk-run-blend-rate float :offset-assert 72) - (walk-turn-blend-rate float :offset-assert 76) - (max-run-speed float :offset-assert 80) - (acceleration meters :offset-assert 84) - (default-patrol-time time-frame :offset-assert 88) - (default-idle-distance meters :offset-assert 96) - (safe-distance meters :offset-assert 100) - (min-run-anim-speed float :offset-assert 104) - (max-run-anim-speed float :offset-assert 108) - (min-walk-anim-speed float :offset-assert 112) - (speed-boost-impulse meters :offset-assert 116) + ((walk-cycle-frame-count float) + (run-cycle-frame-count float) + (walk-speed meters) + (run-speed meters) + (walk-anim-speed float) + (run-anim-speed float) + (walk-away-dist meters) + (run-away-dist meters) + (walk-rotate-speed float) + (run-rotate-speed float) + (walk-turn-time time-frame) + (run-turn-time time-frame) + (max-walk-speed float) + (min-run-speed float) + (walk-run-blend-rate float) + (walk-turn-blend-rate float) + (max-run-speed float) + (acceleration meters) + (default-patrol-time time-frame) + (default-idle-distance meters) + (safe-distance meters) + (min-run-anim-speed float) + (max-run-anim-speed float) + (min-walk-anim-speed float) + (speed-boost-impulse meters) ) - :method-count-assert 9 - :size-assert #x78 - :flag-assert #x900000078 ) @@ -88,30 +85,26 @@ ) (deftype yakow (process-drawable) - ((root-override collide-shape-moving :offset 112) - (fact-override fact-info-enemy :offset 144) - (player-attack-id int32 :offset-assert 176) - (walk-run-blend float :offset-assert 180) - (walk-turn-blend float :offset-assert 184) - (run-mode basic :offset-assert 188) - (travel-speed meters :offset-assert 192) - (final-speed meters :offset-assert 196) - (rotate-speed float :offset-assert 200) - (turn-time time-frame :offset-assert 208) - (vulnerable basic :offset-assert 216) - (grazing basic :offset-assert 220) - (push-velocity vector :inline :offset-assert 224) - (home-base vector :inline :offset-assert 240) - (dest-base vector :inline :offset-assert 256) - (dest-rot degrees :offset-assert 272) - (enable-turn-around basic :offset-assert 276) - (rotating basic :offset-assert 280) - (in-pen basic :offset-assert 284) + ((root collide-shape-moving :override) + (fact fact-info-enemy :override) + (player-attack-id int32) + (walk-run-blend float) + (walk-turn-blend float) + (run-mode basic) + (travel-speed meters) + (final-speed meters) + (rotate-speed float) + (turn-time time-frame) + (vulnerable basic) + (grazing basic) + (push-velocity vector :inline) + (home-base vector :inline) + (dest-base vector :inline) + (dest-rot degrees) + (enable-turn-around basic) + (rotating basic) + (in-pen basic) ) - :heap-base #xb0 - :method-count-assert 20 - :size-assert #x120 - :flag-assert #x1400b00120 (:states yakow-die yakow-graze @@ -141,16 +134,9 @@ ) ) ) - (when (and v1-2 (< 8192.0 (- (-> v1-2 root trans y) (-> self root-override trans y)))) - (do-push-aways! (-> self root-override)) - (send-shove-back - (-> self root-override) - arg0 - (the-as touching-shapes-entry (-> arg3 param 0)) - 0.7 - 6144.0 - 16384.0 - ) + (when (and v1-2 (< 8192.0 (- (-> v1-2 root trans y) (-> self root trans y)))) + (do-push-aways! (-> self root)) + (send-shove-back (-> self root) arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 0.7 6144.0 16384.0) ) ) ) @@ -230,7 +216,7 @@ yakow-default-event-handler (defbehavior yakow-common-post yakow () (update-direction-from-time-of-day (-> self draw shadow-ctrl)) (if *target* - (look-at-enemy! (-> *target* neck) (the-as vector (-> self root-override root-prim prim-core)) #f self) + (look-at-enemy! (-> *target* neck) (the-as vector (-> self root root-prim prim-core)) #f self) ) (ja-post) (none) @@ -238,7 +224,7 @@ yakow-default-event-handler (defbehavior yakow-simple-post yakow () (yakow-common-post) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (none) ) @@ -250,14 +236,9 @@ yakow-default-event-handler (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (vector-z-quaternion! s5-0 (-> self root-override quat)) - (seek-toward-heading-vec! - (-> self root-override) - (-> self nav travel) - (-> self rotate-speed) - (-> self turn-time) - ) - (vector-z-quaternion! gp-0 (-> self root-override quat)) + (vector-z-quaternion! s5-0 (-> self root quat)) + (seek-toward-heading-vec! (-> self root) (-> self nav travel) (-> self rotate-speed) (-> self turn-time)) + (vector-z-quaternion! gp-0 (-> self root quat)) (set! (-> self rotating) (< (vector-dot gp-0 s5-0) (cos (* 8192.0 (seconds-per-frame))))) (when (-> self rotating) (let ((v1-16 (new 'stack-no-clear 'vector))) @@ -273,18 +254,15 @@ yakow-default-event-handler (fmin (-> self travel-speed) (* (vector-length (-> self nav travel)) (-> *display* frames-per-second))) ) (let ((v1-24 (vector-normalize-copy! (new-stack-vector0) (-> self nav travel) (-> self final-speed)))) - (set! (-> self root-override transv x) (-> v1-24 x)) - (set! (-> self root-override transv z) (-> v1-24 z)) - ) - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) + (set! (-> self root transv x) (-> v1-24 x)) + (set! (-> self root transv z) (-> v1-24 z)) ) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) (let ((gp-2 (new 'stack-no-clear 'vector))) - (set! (-> gp-2 quad) (-> self root-override trans quad)) + (set! (-> gp-2 quad) (-> self root trans quad)) (integrate-for-enemy-with-move-to-ground! - (-> self root-override) - (-> self root-override transv) + (-> self root) + (-> self root transv) (collide-kind background) 8192.0 #t @@ -292,7 +270,7 @@ yakow-default-event-handler #f ) (set! (-> self final-speed) - (* (vector-vector-xz-distance gp-2 (-> self root-override trans)) (-> *display* frames-per-second)) + (* (vector-vector-xz-distance gp-2 (-> self root trans)) (-> *display* frames-per-second)) ) ) (set! (-> self travel-speed) (fmin (-> self travel-speed) (-> self final-speed))) @@ -309,8 +287,8 @@ yakow-default-event-handler ) (defbehavior yakow-generate-travel-vector yakow () - (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root-override trans) (target-pos 0))) - (s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override quat))) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (target-pos 0))) + (s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) 0.0 0.0 @@ -332,7 +310,7 @@ yakow-default-event-handler (vector-length (-> self nav travel)) ) ) - (vector+! (-> self nav target-pos) (-> self root-override trans) (-> self nav travel)) + (vector+! (-> self nav target-pos) (-> self root trans) (-> self nav travel)) ) (defbehavior yakow-run-post yakow () @@ -414,7 +392,7 @@ yakow-default-event-handler ) (defbehavior yakow-facing-direction? yakow ((arg0 vector) (arg1 float)) - (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override quat))) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s5-0 quad) (-> arg0 quad)) @@ -425,7 +403,7 @@ yakow-default-event-handler ) (defbehavior yakow-facing-point? yakow ((arg0 vector) (arg1 float)) - (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> self root-override trans)))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> self root trans)))) (yakow-facing-direction? v1-1 arg1) ) ) @@ -442,9 +420,8 @@ yakow-default-event-handler ) :trans (behavior () (if (and (time-elapsed? (-> self state-time) (-> *YAKOW-bank* default-patrol-time)) - (and *target* (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (and *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (not (yakow-facing-player? 21845.334)) ) @@ -508,9 +485,7 @@ yakow-default-event-handler (if (and (time-elapsed? (-> self state-time) (-> *YAKOW-bank* default-patrol-time)) (not (-> self in-pen)) (and *target* - (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (not (yakow-facing-player? 21845.334)) ) @@ -518,7 +493,7 @@ yakow-default-event-handler ) (when (time-elapsed? (-> self state-time) (seconds 0.05)) (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) - (< (vector-vector-xz-distance (-> self root-override trans) (-> self nav destination-pos)) 4096.0) + (< (vector-vector-xz-distance (-> self root trans) (-> self nav destination-pos)) 4096.0) ) (if (-> self in-pen) (go yakow-graze) @@ -537,7 +512,7 @@ yakow-default-event-handler (nav-control-method-19 (-> self nav) (-> self nav target-pos) - (-> self root-override) + (-> self root) (-> self nav destination-pos) 131072.0 ) @@ -564,11 +539,11 @@ yakow-default-event-handler ) ) :code (behavior () - (while (< 546.13336 (fabs (deg-diff (-> self dest-rot) (y-angle (-> self root-override))))) + (while (< 546.13336 (fabs (deg-diff (-> self dest-rot) (y-angle (-> self root))))) (if (not (ja-group? yakow-walk-ja)) (ja-channel-push! 1 (seconds 0.075)) ) - (seek-toward-yaw-angle! (-> self root-override) (-> self dest-rot) 16384.0 (seconds 0.5)) + (seek-toward-yaw-angle! (-> self root) (-> self dest-rot) 16384.0 (seconds 0.5)) (ja :group! yakow-walk-ja :num! (loop!)) (suspend) ) @@ -615,9 +590,8 @@ yakow-default-event-handler (set! (-> self turn-time) (-> *YAKOW-bank* run-turn-time)) ) :trans (behavior () - (when (or (not *target*) (< (-> *YAKOW-bank* safe-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (when (or (not *target*) + (< (-> *YAKOW-bank* safe-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (if (-> self in-pen) (go yakow-walk-to (-> self dest-base)) @@ -628,7 +602,7 @@ yakow-default-event-handler 0.5 1.0 ) - (vector-vector-distance (-> self root-override trans) (target-pos 0)) + (vector-vector-distance (-> self root trans) (target-pos 0)) ) ) (f30-2 (lerp-scale @@ -722,17 +696,17 @@ yakow-default-event-handler (defstate yakow-die (yakow) :event #f :code (behavior () - (let ((v1-1 (-> self root-override root-prim))) + (let ((v1-1 (-> self root root-prim))) (set! (-> v1-1 collide-with) (collide-kind)) (set! (-> v1-1 prim-core collide-as) (collide-kind)) ) 0 - (drop-pickup (-> self fact-override) #t *entity-pool* (-> self fact-override) 0) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0) (process-entity-status! self (entity-perm-status dead) #t) ) ) -(defmethod init-from-entity! yakow ((this yakow) (arg0 entity-actor)) +(defmethod init-from-entity! ((this yakow) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -750,17 +724,17 @@ yakow-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set! (-> this align) (new 'process 'align-control this)) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> this nav nearest-y-threshold) 409600.0) - (set! (-> this fact-override) + (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> this fact-override idle-distance) (-> *YAKOW-bank* default-idle-distance)) + (set! (-> this fact idle-distance) (-> *YAKOW-bank* default-idle-distance)) (initialize-skeleton this *yakow-sg* '()) (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control -4096.0 4096.0 614400.0 (the-as float 24) 245760.0) @@ -770,7 +744,7 @@ yakow-default-event-handler (set! (-> this water flags) (water-flags wt01)) (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) (set! (-> this water ripple-size) 12288.0) - (set! (-> this home-base quad) (-> this root-override trans quad)) + (set! (-> this home-base quad) (-> this root trans quad)) (let ((v1-40 (res-lump-struct (-> this entity) 'alt-vector vector))) (when v1-40 (set! (-> this dest-base quad) (-> v1-40 quad)) @@ -786,8 +760,8 @@ yakow-default-event-handler ) (cond ((-> this in-pen) - (set! (-> this root-override trans quad) (-> this dest-base quad)) - (set-yaw-angle-clear-roll-pitch! (-> this root-override) (-> this dest-rot)) + (set! (-> this root trans quad) (-> this dest-base quad)) + (set-yaw-angle-clear-roll-pitch! (-> this root) (-> this dest-rot)) (go yakow-graze) ) (else diff --git a/goal_src/jak1/levels/village2/assistant-village2.gc b/goal_src/jak1/levels/village2/assistant-village2.gc index bb4d24968ce..4727201fe26 100644 --- a/goal_src/jak1/levels/village2/assistant-village2.gc +++ b/goal_src/jak1/levels/village2/assistant-village2.gc @@ -8,20 +8,16 @@ ;; DECOMP BEGINS (deftype assistant-levitator (process-taskable) - ((boulder entity-actor :offset-assert 380) - (particle sparticle-launch-control 4 :offset-assert 384) + ((boulder entity-actor) + (particle sparticle-launch-control 4) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x190 - :flag-assert #x3501200190 (:states just-particles ) ) -(defmethod relocate assistant-levitator ((this assistant-levitator) (arg0 int)) +(defmethod relocate ((this assistant-levitator) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this particle v1-0)) (&+! (-> this particle v1-0) arg0) @@ -30,7 +26,7 @@ (the-as assistant-levitator ((method-of-type process-taskable relocate) this arg0)) ) -(defmethod deactivate assistant-levitator ((this assistant-levitator)) +(defmethod deactivate ((this assistant-levitator)) (dotimes (s5-0 4) (let ((a0-1 (-> this particle s5-0))) (if (nonzero? a0-1) @@ -56,10 +52,10 @@ :bounds (static-spherem 0 0 0 0.25) ) -(defmethod process-taskable-method-52 assistant-levitator ((this assistant-levitator)) +(defmethod process-taskable-method-52 ((this assistant-levitator)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -409.6 f0-0))) ) @@ -75,7 +71,7 @@ (none) ) -(defmethod draw-npc-shadow assistant-levitator ((this assistant-levitator)) +(defmethod draw-npc-shadow ((this assistant-levitator)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -98,7 +94,7 @@ (none) ) -(defmethod play-anim! assistant-bluehut ((this assistant-bluehut) (arg0 symbol)) +(defmethod play-anim! ((this assistant-bluehut) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk-to-assistant)) (case (current-status (-> this tasks)) (((task-status unknown) (task-status need-hint) (task-status need-introduction)) @@ -280,7 +276,7 @@ ) (close-status! (-> this tasks) (task-status need-introduction)) (set! (-> this jaws) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *jaws-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *jaws-sg* #f :to this)) ) (let ((v1-42 (handle->process (-> this jaws)))) (if v1-42 @@ -393,11 +389,11 @@ ) ) -(defmethod get-art-elem assistant-bluehut ((this assistant-bluehut)) +(defmethod get-art-elem ((this assistant-bluehut)) (-> this draw art-group data 10) ) -(defmethod play-reminder assistant-bluehut ((this assistant-bluehut)) +(defmethod play-reminder ((this assistant-bluehut)) (cond ((and (-> this will-talk) *target*) (let* ((f30-1 (+ -1552384.0 (-> (target-pos 0) x))) @@ -412,7 +408,7 @@ ) ) -(defmethod target-above-threshold? assistant-bluehut ((this assistant-bluehut)) +(defmethod target-above-threshold? ((this assistant-bluehut)) (when (not (play-reminder this)) (set! (-> this im-talking) #f) (return #f) @@ -462,7 +458,7 @@ (the-as symbol 0) ) -(defmethod process-taskable-method-43 assistant-bluehut ((this assistant-bluehut)) +(defmethod process-taskable-method-43 ((this assistant-bluehut)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f30-0 (rand-float-gen))) (cond @@ -470,10 +466,10 @@ #f ) ((< 0.5 f30-0) - (play-ambient (-> this ambient) "ASSTLP23" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP23" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "ASSTLP24" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP24" #f (-> this root trans)) ) ) ) @@ -599,7 +595,7 @@ ) ) -(defmethod should-display? assistant-bluehut ((this assistant-bluehut)) +(defmethod should-display? ((this assistant-bluehut)) (cond ((not (closed? (-> this tasks) (game-task village2-levitator) (task-status unknown))) (process-taskable-method-33 this) @@ -695,7 +691,7 @@ (none) ) -(defmethod init-from-entity! assistant-bluehut ((this assistant-bluehut) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant-bluehut) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 288) this)) (set! (-> this tasks) (get-task-control (game-task village2-levitator))) @@ -1220,7 +1216,7 @@ (none) ) -(defmethod play-anim! assistant-levitator ((this assistant-levitator) (arg0 symbol)) +(defmethod play-anim! ((this assistant-levitator) (arg0 symbol)) (with-pp (case (current-status (-> this tasks)) (((task-status need-reward-speech)) @@ -1273,7 +1269,7 @@ ) ) -(defmethod get-art-elem assistant-levitator ((this assistant-levitator)) +(defmethod get-art-elem ((this assistant-levitator)) (if (= (get-task-status (game-task village2-levitator)) (task-status invalid)) (-> this draw art-group data 9) (-> this draw art-group data 5) @@ -1314,7 +1310,7 @@ :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) (when (and (cond - ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + ((and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) #t ) (else @@ -1365,7 +1361,7 @@ ) ) -(defmethod target-above-threshold? assistant-levitator ((this assistant-levitator)) +(defmethod target-above-threshold? ((this assistant-levitator)) (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) ) @@ -1437,7 +1433,7 @@ ) ) -(defmethod should-display? assistant-levitator ((this assistant-levitator)) +(defmethod should-display? ((this assistant-levitator)) (or (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) (zero? (get-task-status (game-task village2-levitator))) ) @@ -1455,7 +1451,7 @@ ) ) -(defmethod init-from-entity! assistant-levitator ((this assistant-levitator) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant-levitator) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task village2-levitator))) (set! (-> this boulder) (entity-actor-lookup arg0 'alt-actor 0)) @@ -1464,7 +1460,7 @@ (set! (-> this particle 2) (create-launch-control (-> *part-group-id-table* 660) this)) (set! (-> this particle 3) (create-launch-control (-> *part-group-id-table* 661) this)) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "lev-mach-idle" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "lev-mach-idle" :fo-max 30) (-> this root trans)) ) (if (= (get-task-status (game-task village2-levitator)) (task-status invalid)) (go just-particles) diff --git a/goal_src/jak1/levels/village2/flutflut-bluehut.gc b/goal_src/jak1/levels/village2/flutflut-bluehut.gc index b15f4d0dcb5..a2e919f58b2 100644 --- a/goal_src/jak1/levels/village2/flutflut-bluehut.gc +++ b/goal_src/jak1/levels/village2/flutflut-bluehut.gc @@ -9,10 +9,6 @@ (deftype flutflut-bluehut (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -21,7 +17,7 @@ :bounds (static-spherem 0 0 0 3.25) ) -(defmethod play-anim! flutflut-bluehut ((this flutflut-bluehut) (arg0 symbol)) +(defmethod play-anim! ((this flutflut-bluehut) (arg0 symbol)) (current-status (-> this tasks)) (if arg0 (format @@ -34,11 +30,11 @@ (the-as basic (get-art-elem this)) ) -(defmethod get-art-elem flutflut-bluehut ((this flutflut-bluehut)) +(defmethod get-art-elem ((this flutflut-bluehut)) (-> this draw art-group data 2) ) -(defmethod should-display? flutflut-bluehut ((this flutflut-bluehut)) +(defmethod should-display? ((this flutflut-bluehut)) (and (closed? (-> this tasks) (game-task village2-levitator) (task-status need-introduction)) (task-closed? (game-task beach-flutflut) (task-status need-resolution)) ) @@ -110,7 +106,7 @@ ) ) -(defmethod init-from-entity! flutflut-bluehut ((this flutflut-bluehut) (arg0 entity-actor)) +(defmethod init-from-entity! ((this flutflut-bluehut) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *flutflut-bluehut-sg* 3 0 (new 'static 'vector :w 4096.0) 27) (set! (-> this tasks) (get-task-control (game-task village2-levitator))) (set! (-> this draw light-index) (the-as uint 1)) diff --git a/goal_src/jak1/levels/village2/gambler.gc b/goal_src/jak1/levels/village2/gambler.gc index c11f0724300..dce10c91880 100644 --- a/goal_src/jak1/levels/village2/gambler.gc +++ b/goal_src/jak1/levels/village2/gambler.gc @@ -9,10 +9,6 @@ (deftype gambler (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -22,7 +18,7 @@ :shadow gambler-shadow-mg ) -(defmethod play-anim! gambler ((this gambler) (arg0 symbol)) +(defmethod play-anim! ((this gambler) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -118,54 +114,54 @@ ) ) -(defmethod get-art-elem gambler ((this gambler)) +(defmethod get-art-elem ((this gambler)) (-> this draw art-group data 7) ) -(defmethod process-taskable-method-43 gambler ((this gambler)) +(defmethod process-taskable-method-43 ((this gambler)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 61440.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.9230769 f0-2) - (play-ambient (-> this ambient) "GAM-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM01" #f (-> this root trans)) ) ((< 0.84615386 f0-2) - (play-ambient (-> this ambient) "GAM-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM02" #f (-> this root trans)) ) ((< 0.7692308 f0-2) - (play-ambient (-> this ambient) "GAM-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM03" #f (-> this root trans)) ) ((< 0.6923077 f0-2) - (play-ambient (-> this ambient) "GAM-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM04" #f (-> this root trans)) ) ((< 0.61538464 f0-2) - (play-ambient (-> this ambient) "GAM-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM05" #f (-> this root trans)) ) ((< 0.53846157 f0-2) - (play-ambient (-> this ambient) "GAM-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM06" #f (-> this root trans)) ) ((< 0.46153846 f0-2) - (play-ambient (-> this ambient) "GAM-AM07" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM07" #f (-> this root trans)) ) ((< 0.3846154 f0-2) - (play-ambient (-> this ambient) "GAM-AM08" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM08" #f (-> this root trans)) ) ((< 0.30769232 f0-2) - (play-ambient (-> this ambient) "GAM-AM09" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM09" #f (-> this root trans)) ) ((< 0.23076923 f0-2) (if (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) - (play-ambient (-> this ambient) "GAM-AM10" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM10" #f (-> this root trans)) ) ) ((< 0.15384616 f0-2) - (play-ambient (-> this ambient) "GAM-AM11" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM11" #f (-> this root trans)) ) ((< 0.07692308 f0-2) - (play-ambient (-> this ambient) "GAM-AM12" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM12" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "GAM-AM13" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM13" #f (-> this root trans)) ) ) ) @@ -212,7 +208,7 @@ ) ) -(defmethod init-from-entity! gambler ((this gambler) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gambler) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *gambler-sg* 3 32 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task rolling-race))) (set! (-> this sound-flava) (music-flava gambler)) diff --git a/goal_src/jak1/levels/village2/geologist.gc b/goal_src/jak1/levels/village2/geologist.gc index a3c8044a7cd..646f27637a8 100644 --- a/goal_src/jak1/levels/village2/geologist.gc +++ b/goal_src/jak1/levels/village2/geologist.gc @@ -9,10 +9,6 @@ (deftype geologist (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -22,7 +18,7 @@ :shadow geologist-shadow-mg ) -(defmethod play-anim! geologist ((this geologist) (arg0 symbol)) +(defmethod play-anim! ((this geologist) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -110,56 +106,56 @@ ) ) -(defmethod get-art-elem geologist ((this geologist)) +(defmethod get-art-elem ((this geologist)) (-> this draw art-group data 5) ) -(defmethod process-taskable-method-43 geologist ((this geologist)) +(defmethod process-taskable-method-43 ((this geologist)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8888889 f0-2) - (play-ambient (-> this ambient) "GEO-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM01" #f (-> this root trans)) ) ((< 0.7777778 f0-2) (if (not (closed? (-> this tasks) (game-task rolling-moles) (task-status need-reminder))) - (play-ambient (-> this ambient) "GEO-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM02" #f (-> this root trans)) ) ) ((< 0.6666667 f0-2) - (play-ambient (-> this ambient) "GEO-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM03" #f (-> this root trans)) ) ((< 0.5555556 f0-2) (if (closed? (-> this tasks) (game-task village2-geologist-money) (task-status need-introduction)) - (play-ambient (-> this ambient) "GEO-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM04" #f (-> this root trans)) ) ) ((< 0.44444445 f0-2) - (play-ambient (-> this ambient) "GEO-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM05" #f (-> this root trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> this ambient) "GEO-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM06" #f (-> this root trans)) ) ((< 0.22222222 f0-2) (if (not (closed? (-> this tasks) (game-task rolling-moles) (task-status need-reminder))) - (play-ambient (-> this ambient) "GEO-AM07" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM07" #f (-> this root trans)) ) ) ((< 0.11111111 f0-2) - (play-ambient (-> this ambient) "GEO-LO02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-LO02" #f (-> this root trans)) ) ((closed? (-> this tasks) (game-task village2-geologist-money) (task-status need-resolution)) - (play-ambient (-> this ambient) "GEO-AM08" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM08" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "GEO-LO01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-LO01" #f (-> this root trans)) ) ) ) ) ) -(defmethod init-from-entity! geologist ((this geologist) (arg0 entity-actor)) +(defmethod init-from-entity! ((this geologist) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *geologist-sg* 3 45 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task rolling-moles))) (set! (-> this sound-flava) (music-flava geologist)) diff --git a/goal_src/jak1/levels/village2/sage-bluehut.gc b/goal_src/jak1/levels/village2/sage-bluehut.gc index 27642a5aaab..3a4334a24a3 100644 --- a/goal_src/jak1/levels/village2/sage-bluehut.gc +++ b/goal_src/jak1/levels/village2/sage-bluehut.gc @@ -8,26 +8,18 @@ ;; DECOMP BEGINS (deftype assistant-bluehut (process-taskable) - ((sound-id sound-id :offset-assert 380) - (jaws handle :offset-assert 384) - (sage entity-actor :offset-assert 392) - (im-talking symbol :offset-assert 396) + ((sound-id sound-id) + (jaws handle) + (sage entity-actor) + (im-talking symbol) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x190 - :flag-assert #x3501200190 ) (deftype sage-bluehut (process-taskable) - ((reminder-played symbol :offset-assert 380) - (assistant entity-actor :offset-assert 384) + ((reminder-played symbol) + (assistant entity-actor) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x184 - :flag-assert #x3501200184 ) @@ -37,7 +29,7 @@ :shadow sage-bluehut-shadow-mg ) -(defmethod play-anim! sage-bluehut ((this sage-bluehut) (arg0 symbol)) +(defmethod play-anim! ((this sage-bluehut) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk-to-sage)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -126,7 +118,7 @@ ) ) -(defmethod process-taskable-method-45 sage-bluehut ((this sage-bluehut)) +(defmethod process-taskable-method-45 ((this sage-bluehut)) (cond ((= (current-status (-> this tasks)) (task-status unknown)) #f @@ -144,9 +136,7 @@ ) #t ) - ((and (-> this reminder-played) - (< 81920.0 (vector-vector-distance (-> this root-override trans) (camera-pos))) - ) + ((and (-> this reminder-played) (< 81920.0 (vector-vector-distance (-> this root trans) (camera-pos)))) #t ) (else @@ -155,7 +145,7 @@ ) ) -(defmethod get-art-elem sage-bluehut ((this sage-bluehut)) +(defmethod get-art-elem ((this sage-bluehut)) (cond ((and (= (current-task (-> this tasks)) (game-task rolling-plants)) (or (= (current-status (-> this tasks)) (task-status need-hint)) @@ -206,18 +196,18 @@ ) ) -(defmethod should-display? sage-bluehut ((this sage-bluehut)) +(defmethod should-display? ((this sage-bluehut)) (and (task-closed? (game-task village2-levitator) (task-status need-introduction)) (not (sages-kidnapped?))) ) -(defmethod play-reminder sage-bluehut ((this sage-bluehut)) +(defmethod play-reminder ((this sage-bluehut)) (the-as symbol (and (-> this will-talk) *target* (< -6365184.0 (-> (target-pos 0) z)) (< (-> (target-pos 0) x) 1612800.0)) ) ) -(defmethod target-above-threshold? sage-bluehut ((this sage-bluehut)) +(defmethod target-above-threshold? ((this sage-bluehut)) (local-vars (v0-1 symbol)) (if (not (play-reminder this)) (return #f) @@ -232,24 +222,24 @@ v0-1 ) -(defmethod process-taskable-method-43 sage-bluehut ((this sage-bluehut)) +(defmethod process-taskable-method-43 ((this sage-bluehut)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8 f0-2) - (play-ambient (-> this ambient) "SAGELP20" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP20" #f (-> this root trans)) ) ((< 0.6 f0-2) - (play-ambient (-> this ambient) "SAGELP21" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP21" #f (-> this root trans)) ) ((< 0.4 f0-2) - (play-ambient (-> this ambient) "SAGELP22" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP22" #f (-> this root trans)) ) ((< 0.2 f0-2) - (play-ambient (-> this ambient) "SAGELP23" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP23" #f (-> this root trans)) ) ((nonzero? (get-task-status (game-task citadel-sage-blue))) - (play-ambient (-> this ambient) "SAGELP24" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP24" #f (-> this root trans)) ) ) ) @@ -314,7 +304,7 @@ ) ) -(defmethod init-from-entity! sage-bluehut ((this sage-bluehut) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sage-bluehut) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sage-bluehut-sg* 3 40 (new 'static 'vector :w 4505.6) 5) (set! (-> this tasks) (get-task-control (game-task rolling-plants))) (set! (-> this reminder-played) #f) diff --git a/goal_src/jak1/levels/village2/sunken-elevator.gc b/goal_src/jak1/levels/village2/sunken-elevator.gc index 96abe2e2aac..10094cc3cb7 100644 --- a/goal_src/jak1/levels/village2/sunken-elevator.gc +++ b/goal_src/jak1/levels/village2/sunken-elevator.gc @@ -8,14 +8,10 @@ ;; DECOMP BEGINS (deftype sunken-elevator (plat-button) - ((play-at-top-going-up-camera? symbol :offset-assert 240) - (teleport-if-below-y float :offset-assert 244) - (teleport-if-above-y float :offset-assert 248) + ((play-at-top-going-up-camera? symbol) + (teleport-if-below-y float) + (teleport-if-above-y float) ) - :heap-base #x90 - :method-count-assert 33 - :size-assert #xfc - :flag-assert #x21009000fc ) @@ -24,7 +20,7 @@ :bounds (static-spherem 0 -1 0 6.6) ) -(defmethod should-teleport? sunken-elevator ((this sunken-elevator)) +(defmethod should-teleport? ((this sunken-elevator)) (let ((f0-0 (-> (camera-pos) y))) (case (-> this path-pos) ((0.0) @@ -147,13 +143,13 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (set! *teleport* #t) - (set! (-> s5-0 quad) (-> self root-override trans quad)) + (set! (-> s5-0 quad) (-> self root trans quad)) (let ((t9-1 (-> (find-parent-state) trans))) (if t9-1 (t9-1) ) ) - (vector-! gp-0 (-> self root-override trans) s5-0) + (vector-! gp-0 (-> self root trans) s5-0) (when (< (-> self path-pos) 0.9) (move-by-vector! (-> *target* control) gp-0) (send-event *target* 'reset-height) @@ -162,7 +158,7 @@ ) ) -(defmethod can-target-move? sunken-elevator ((this sunken-elevator)) +(defmethod can-target-move? ((this sunken-elevator)) (set! (-> this play-at-top-going-up-camera?) #f) (let ((s5-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> this path) s5-0 0.4 'interp) @@ -173,7 +169,7 @@ (none) ) -(defmethod plat-button-method-27 sunken-elevator ((this sunken-elevator)) +(defmethod plat-button-method-27 ((this sunken-elevator)) (ja-channel-set! 1) (cond ((can-activate? this) @@ -200,11 +196,11 @@ ) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (none) ) -(defmethod plat-button-method-31 sunken-elevator ((this sunken-elevator)) +(defmethod plat-button-method-31 ((this sunken-elevator)) (initialize-skeleton this *sunken-elevator-sg* '()) 0 (none) diff --git a/goal_src/jak1/levels/village2/swamp-blimp.gc b/goal_src/jak1/levels/village2/swamp-blimp.gc index 69a1c5fc36b..2da2f72aa57 100644 --- a/goal_src/jak1/levels/village2/swamp-blimp.gc +++ b/goal_src/jak1/levels/village2/swamp-blimp.gc @@ -194,14 +194,11 @@ ) (deftype swamp-blimp-bank (basic) - ((arm-index int32 :offset-assert 4) - (pause-before-dropping-arm int32 :offset-assert 8) - (rise-per-break float :offset-assert 12) - (arm-sink-wait float :offset-assert 16) + ((arm-index int32) + (pause-before-dropping-arm int32) + (rise-per-break float) + (arm-sink-wait float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -210,16 +207,13 @@ ) (deftype tetherrock-info (structure) - ((rock-camera string :offset-assert 0) - (arm-camera string :offset-assert 4) - (blimp-rp int32 :offset-assert 8) - (other-rp int32 :offset-assert 12) - (connected-to-rock basic :offset-assert 16) - (damping float :offset-assert 20) + ((rock-camera string) + (arm-camera string) + (blimp-rp int32) + (other-rp int32) + (connected-to-rock basic) + (damping float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) @@ -279,24 +273,21 @@ ) (deftype swamp-rope-rand-float (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (max-val float :offset-assert 8) - (timer int32 :offset-assert 12) - (value float :offset-assert 16) + ((min-time int32) + (max-time int32) + (max-val float) + (timer int32) + (value float) ) :pack-me - :method-count-assert 11 - :size-assert #x14 - :flag-assert #xb00000014 (:methods - (init! (_type_ int int float) none 9) - (update-timer! (_type_) none 10) + (init! (_type_ int int float) none) + (update-timer! (_type_) none) ) ) -(defmethod init! swamp-rope-rand-float ((this swamp-rope-rand-float) (arg0 int) (arg1 int) (arg2 float)) +(defmethod init! ((this swamp-rope-rand-float) (arg0 int) (arg1 int) (arg2 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) (set! (-> this max-val) (* 0.5 arg2)) @@ -306,7 +297,7 @@ (none) ) -(defmethod update-timer! swamp-rope-rand-float ((this swamp-rope-rand-float)) +(defmethod update-timer! ((this swamp-rope-rand-float)) (set! (-> this timer) (- (the-as time-frame (-> this timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) @@ -319,25 +310,22 @@ ) (deftype swamp-rope-oscillator (structure) - ((target float :offset-assert 0) - (value float :offset-assert 4) - (vel float :offset-assert 8) - (accel float :offset-assert 12) - (vector-overlay vector :inline :offset 0) - (max-vel float :offset-assert 16) - (damping float :offset-assert 20) + ((target float) + (value float) + (vel float) + (accel float) + (vector-overlay vector :inline :overlay-at target) + (max-vel float) + (damping float) ) - :method-count-assert 11 - :size-assert #x18 - :flag-assert #xb00000018 (:methods - (init! (_type_ float float float float) none 9) - (swamp-rope-oscillator-method-10 (_type_ float) none 10) + (init! (_type_ float float float float) none) + (swamp-rope-oscillator-method-10 (_type_ float) none) ) ) -(defmethod init! swamp-rope-oscillator ((this swamp-rope-oscillator) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init! ((this swamp-rope-oscillator) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (set! (-> this target) arg0) (set! (-> this value) arg0) (set! (-> this vel) 0.0) @@ -348,7 +336,7 @@ (none) ) -(defmethod swamp-rope-oscillator-method-10 swamp-rope-oscillator ((this swamp-rope-oscillator) (arg0 float)) +(defmethod swamp-rope-oscillator-method-10 ((this swamp-rope-oscillator) (arg0 float)) (let ((f0-3 (* (- (+ (-> this target) arg0) (-> this value)) (* (-> this accel) (-> *display* time-adjust-ratio)))) ) (+! (-> this vel) f0-3) @@ -361,24 +349,21 @@ ) (deftype swamp-blimp-rand-vector (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (xz-max float :offset-assert 8) - (y-max float :offset-assert 12) - (timer int32 :offset-assert 16) - (value vector :inline :offset-assert 32) + ((min-time int32) + (max-time int32) + (xz-max float) + (y-max float) + (timer int32) + (value vector :inline) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (init! (_type_ int int float float) none 9) - (update-timer! (_type_) none 10) + (init! (_type_ int int float float) none) + (update-timer! (_type_) none) ) ) -(defmethod init! swamp-blimp-rand-vector ((this swamp-blimp-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) +(defmethod init! ((this swamp-blimp-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) (set! (-> this xz-max) (* 0.5 arg2)) @@ -389,7 +374,7 @@ (none) ) -(defmethod update-timer! swamp-blimp-rand-vector ((this swamp-blimp-rand-vector)) +(defmethod update-timer! ((this swamp-blimp-rand-vector)) (set! (-> this timer) (- (the-as time-frame (-> this timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) @@ -404,25 +389,22 @@ ) (deftype swamp-blimp-oscillator (structure) - ((target vector :inline :offset-assert 0) - (value vector :inline :offset-assert 16) - (vel vector :inline :offset-assert 32) - (accel float :offset-assert 48) - (max-vel float :offset-assert 52) - (damping float :offset-assert 56) + ((target vector :inline) + (value vector :inline) + (vel vector :inline) + (accel float) + (max-vel float) + (damping float) ) :pack-me - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (init! (_type_ vector float float float) none 9) - (swamp-blimp-oscillator-method-10 (_type_ vector) none 10) + (init! (_type_ vector float float float) none) + (swamp-blimp-oscillator-method-10 (_type_ vector) none) ) ) -(defmethod init! swamp-blimp-oscillator ((this swamp-blimp-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init! ((this swamp-blimp-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 (set! (-> this target quad) (-> arg0 quad)) @@ -441,7 +423,7 @@ (none) ) -(defmethod swamp-blimp-oscillator-method-10 swamp-blimp-oscillator ((this swamp-blimp-oscillator) (arg0 vector)) +(defmethod swamp-blimp-oscillator-method-10 ((this swamp-blimp-oscillator) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (cond (arg0 @@ -468,17 +450,13 @@ ) (deftype swamp-tetherrock (process-drawable) - ((root-override collide-shape-moving :offset 112) - (tension float :offset-assert 176) - (tension-pt vector :inline :offset-assert 192) - (blimp entity-actor :offset-assert 208) - (rot-at-init quaternion :inline :offset-assert 224) - (hits int32 :offset-assert 240) + ((root collide-shape-moving :override) + (tension float) + (tension-pt vector :inline) + (blimp entity-actor) + (rot-at-init quaternion :inline) + (hits int32) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #xf4 - :flag-assert #x14009000f4 (:states swamp-tetherrock-break swamp-tetherrock-die @@ -489,20 +467,16 @@ (deftype precursor-arm (process-drawable) - ((root-override collide-shape :offset 112) - (y-init float :offset-assert 176) - (y-offset float :offset-assert 180) - (rot-speed float :offset-assert 184) - (rot-dist float :offset-assert 188) - (rot-base float :offset-assert 192) - (rot-t float :offset-assert 196) - (init-mat matrix :inline :offset-assert 208) - (tension float :offset-assert 272) + ((root collide-shape :override) + (y-init float) + (y-offset float) + (rot-speed float) + (rot-dist float) + (rot-base float) + (rot-t float) + (init-mat matrix :inline) + (tension float) ) - :heap-base #xb0 - :method-count-assert 20 - :size-assert #x114 - :flag-assert #x1400b00114 (:states precursor-arm-die precursor-arm-idle @@ -512,26 +486,22 @@ (deftype swamp-rope (process-drawable) - ((parent-override (pointer swamp-blimp) :offset 12) - (parent-rp int32 :offset-assert 176) - (other-entity entity-actor :offset-assert 180) - (other-rp int32 :offset-assert 184) - (old-scale float :offset-assert 188) - (frame swamp-rope-oscillator :inline :offset-assert 192) - (other-pos vector :inline :offset-assert 224) - (scale-base float :offset-assert 240) - (base-vec vector :inline :offset-assert 256) - (scale-t float :offset-assert 272) - (x-t float :offset-assert 276) - (z-t float :offset-assert 280) - (rot-speed float :offset-assert 284) + ((parent-override (pointer swamp-blimp) :overlay-at parent) + (parent-rp int32) + (other-entity entity-actor) + (other-rp int32) + (old-scale float) + (frame swamp-rope-oscillator :inline) + (other-pos vector :inline) + (scale-base float) + (base-vec vector :inline) + (scale-t float) + (x-t float) + (z-t float) + (rot-speed float) ) - :heap-base #xb0 - :method-count-assert 21 - :size-assert #x120 - :flag-assert #x1500b00120 (:methods - (swamp-rope-method-20 (_type_) basic 20) + (swamp-rope-method-20 (_type_) basic) ) (:states swamp-rope-break @@ -541,35 +511,31 @@ ) -(defmethod swamp-rope-method-20 swamp-rope ((this swamp-rope)) +(defmethod swamp-rope-method-20 ((this swamp-rope)) (and (-> this other-entity) (not (task-closed? (-> this other-entity extra perm task) (task-status need-reminder))) ) ) (deftype swamp-blimp (process-drawable) - ((root-override collide-shape-moving :offset 112) - (the-ropes handle 5 :offset-assert 176) - (arm-timer int32 :offset-assert 216) - (trans-at-init vector :inline :offset-assert 224) - (rot-at-init quaternion :inline :offset-assert 240) - (y-vel float :offset-assert 256) - (y-offset float :offset-assert 260) - (y-offset-target float :offset-assert 264) - (main-tilt-rand swamp-blimp-rand-vector :inline :offset-assert 272) - (main-tilt-oscillator swamp-blimp-oscillator :inline :offset-assert 320) - (gondola-tilt-oscillator swamp-blimp-oscillator :inline :offset-assert 384) - (pos-rand swamp-blimp-rand-vector :inline :offset-assert 448) - (pos-oscillator swamp-blimp-oscillator :inline :offset-assert 496) - (scale-rand swamp-rope-rand-float :inline :offset-assert 556) - (scale-oscillator swamp-rope-oscillator :inline :offset-assert 576) - (gondola joint-mod :offset-assert 600) - (bag joint-mod :offset-assert 604) + ((root collide-shape-moving :override) + (the-ropes handle 5) + (arm-timer int32) + (trans-at-init vector :inline) + (rot-at-init quaternion :inline) + (y-vel float) + (y-offset float) + (y-offset-target float) + (main-tilt-rand swamp-blimp-rand-vector :inline) + (main-tilt-oscillator swamp-blimp-oscillator :inline) + (gondola-tilt-oscillator swamp-blimp-oscillator :inline) + (pos-rand swamp-blimp-rand-vector :inline) + (pos-oscillator swamp-blimp-oscillator :inline) + (scale-rand swamp-rope-rand-float :inline) + (scale-oscillator swamp-rope-oscillator :inline) + (gondola joint-mod) + (bag joint-mod) ) - :heap-base #x1f0 - :method-count-assert 20 - :size-assert #x260 - :flag-assert #x1401f00260 (:states swamp-blimp-bye-bye swamp-blimp-idle @@ -577,7 +543,7 @@ ) -(defmethod relocate swamp-blimp ((this swamp-blimp) (arg0 int)) +(defmethod relocate ((this swamp-blimp) (arg0 int)) (if (nonzero? (-> this gondola)) (&+! (-> this gondola) arg0) ) @@ -598,7 +564,7 @@ (defstate swamp-tetherrock-hide (swamp-tetherrock) :code (behavior () - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (logior! (-> self draw status) (draw-status hidden)) (loop (when (= (get-task-status (-> self entity extra perm task)) (task-status invalid)) @@ -648,7 +614,7 @@ (cam-slave-get-rot (the-as entity-actor s5-1) *camera-other-matrix*) (set! (-> *camera-other-fov* data) (cam-slave-get-fov s5-1)) ) - (set! (-> *camera-other-root* quad) (-> self root-override trans quad)) + (set! (-> *camera-other-root* quad) (-> self root trans quad)) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 0.6)) (set! *camera-look-through-other* 2) @@ -657,7 +623,7 @@ (set! (-> self tension) 0.0) (close-specific-task! (-> self entity extra perm task) (task-status need-reminder)) (birth-pickup-at-point - (-> self root-override trans) + (-> self root trans) (pickup-type fuel-cell) (the float (-> self entity extra perm task)) #f @@ -687,19 +653,15 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (logior! (-> self draw status) (draw-status skip-bones)) - (let ((s4-3 (ppointer->handle (manipy-spawn - (-> self root-override trans) - (-> self entity) - *swamp-tetherrock-explode-sg* - #f - :to *entity-pool* - ) - ) - ) + (let ((s4-3 + (ppointer->handle + (manipy-spawn (-> self root trans) (-> self entity) *swamp-tetherrock-explode-sg* #f :to *entity-pool*) + ) + ) ) (send-event (handle->process (the-as handle s4-3)) 'anim-mode 'play1) (send-event (handle->process (the-as handle s4-3)) 'art-joint-anim "swamp-tetherrock-explode-explode" 0) @@ -720,7 +682,7 @@ (cam-slave-get-rot (the-as entity-actor gp-1) *camera-other-matrix*) (set! (-> *camera-other-fov* data) (cam-slave-get-fov gp-1)) ) - (set! (-> *camera-other-root* quad) (-> self root-override trans quad)) + (set! (-> *camera-other-root* quad) (-> self root trans quad)) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 5)) (set! *camera-look-through-other* 2) @@ -733,7 +695,7 @@ (a0-58 (-> self blimp extra process)) ) (when a0-58 - (vector-! gp-2 (-> (the-as swamp-blimp a0-58) root-override trans) *camera-other-trans*) + (vector-! gp-2 (-> (the-as swamp-blimp a0-58) root trans) *camera-other-trans*) (vector-normalize! gp-2 1.0) (forward-down->inv-matrix *camera-other-matrix* gp-2 (-> *camera* local-down)) ) @@ -823,7 +785,7 @@ #f (if gp-0 (-> (the-as process-drawable gp-0) root trans) - (-> self root-override trans) + (-> self root trans) ) :to *entity-pool* ) @@ -842,16 +804,16 @@ (gp-0 (new 'stack-no-clear 'quaternion)) ) 0.0 - (vector-! s3-0 (-> self tension-pt) (-> self root-override trans)) + (vector-! s3-0 (-> self tension-pt) (-> self root trans)) (vector-normalize! s3-0 1.0) (vector-cross! s5-0 s4-0 s3-0) (let ((f30-0 (asin (vector-normalize-ret-len! s5-0 1.0)))) (vector-normalize! s5-0 1.0) (quaternion-vector-angle! gp-0 s5-0 (* (fmin 1820.4445 f30-0) (- 1.0 (-> self tension)))) ) - (quaternion*! (-> self root-override quat) gp-0 (-> self rot-at-init)) + (quaternion*! (-> self root quat) gp-0 (-> self rot-at-init)) ) - (if (and *target* (>= 49152.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and *target* (>= 49152.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id swamp-tetherrock-eco-yellow-hint) "sksp0138" @@ -866,7 +828,7 @@ :post transform-post ) -(defmethod init-from-entity! swamp-tetherrock ((this swamp-tetherrock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swamp-tetherrock) (arg0 entity-actor)) (logior! (-> this mask) (process-mask attackable)) (process-entity-status! this (entity-perm-status bit-7) #t) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -887,7 +849,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *swamp-tetherrock-sg* '()) @@ -897,7 +859,7 @@ (set! (-> this blimp) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> this tension) 0.0) (vector-reset! (-> this tension-pt)) - (quaternion-copy! (-> this rot-at-init) (-> this root-override quat)) + (quaternion-copy! (-> this rot-at-init) (-> this root quat)) (logclear! (-> this mask) (process-mask actor-pause)) (case (get-task-status (-> this entity extra perm task)) (((task-status invalid)) @@ -905,7 +867,7 @@ ) (((task-status need-resolution)) (birth-pickup-at-point - (-> this root-override trans) + (-> this root trans) (pickup-type fuel-cell) (the float (-> this entity extra perm task)) #f @@ -950,7 +912,7 @@ (deactivate self) ) ) - (set! (-> self root-override trans y) (+ (-> self y-offset) (-> self y-init))) + (set! (-> self root trans y) (+ (-> self y-offset) (-> self y-init))) (suspend) ) ) @@ -999,11 +961,11 @@ (+ (-> self rot-base) (* (parameter-ease-sin-clamp (-> self rot-t)) (-> self rot-dist))) ) (matrix*! gp-0 (-> self init-mat) gp-0) - (matrix->quaternion (-> self root-override quat) gp-0) + (matrix->quaternion (-> self root quat) gp-0) ) - (when (< (vector-vector-distance (-> self root-override trans) (camera-pos)) 204800.0) + (when (< (vector-vector-distance (-> self root trans) (camera-pos)) 204800.0) (let ((a2-1 (new 'static 'vector))) - (set! (-> a2-1 quad) (-> self root-override trans quad)) + (set! (-> a2-1 quad) (-> self root trans quad)) (set! (-> a2-1 y) 0.0) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2017) a2-1) ) @@ -1028,7 +990,7 @@ (set! (-> self y-offset) (+ f30-2 (* f28-2 (precursor-arm-slip (/ (the float (- (current-time) (-> self state-time))) f26-1)))) ) - (set! (-> self root-override trans y) (+ (-> self y-offset) (-> self y-init))) + (set! (-> self root trans y) (+ (-> self y-offset) (-> self y-init))) (suspend) ) ) @@ -1050,7 +1012,7 @@ (set! (-> self y-offset) (+ f30-5 (* f28-4 (parameter-ease-sin-clamp (/ (the float (- (current-time) (-> self state-time))) f26-3)))) ) - (set! (-> self root-override trans y) (+ (-> self y-offset) (-> self y-init))) + (set! (-> self root trans y) (+ (-> self y-offset) (-> self y-init))) (suspend) ) ) @@ -1062,7 +1024,7 @@ :post transform-post ) -(defmethod init-from-entity! precursor-arm ((this precursor-arm) (arg0 entity-actor)) +(defmethod init-from-entity! ((this precursor-arm) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (alloc-riders s4-0 1) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -1075,7 +1037,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *precursor-arm-sg* '()) @@ -1083,9 +1045,9 @@ (set! (-> this rot-dist) 0.0) (set! (-> this rot-base) 0.0) (set! (-> this rot-t) 1.0) - (quaternion->matrix (-> this init-mat) (-> this root-override quat)) + (quaternion->matrix (-> this init-mat) (-> this root quat)) (set! (-> this y-offset) 0.0) - (set! (-> this y-init) (-> this root-override trans y)) + (set! (-> this y-init) (-> this root trans y)) (set! (-> this tension) 0.0) (process-entity-status! this (entity-perm-status bit-7) #t) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1371,11 +1333,11 @@ (quaternion-vector-angle! gp-0 s5-0 f30-1) ) ) - (quaternion*! (-> self root-override quat) gp-0 (-> self rot-at-init)) + (quaternion*! (-> self root quat) gp-0 (-> self rot-at-init)) ) - (quaternion-normalize! (-> self root-override quat)) - (vector+! (-> self root-override trans) (-> self trans-at-init) (-> self pos-oscillator value)) - (set! (-> self root-override trans y) (+ (-> self root-override trans y) (-> self y-offset))) + (quaternion-normalize! (-> self root quat)) + (vector+! (-> self root trans) (-> self trans-at-init) (-> self pos-oscillator value)) + (set! (-> self root trans y) (+ (-> self root trans y) (-> self y-offset))) ) (defstate swamp-blimp-bye-bye (swamp-blimp) @@ -1440,7 +1402,7 @@ (vector-! (the-as vector (-> self pos-oscillator)) (the-as vector (-> self pos-oscillator)) - (-> self root-override trans) + (-> self root trans) ) ) ((swamp-rope-method-20 (the-as swamp-rope s4-0)) @@ -1468,7 +1430,7 @@ (vector+! (the-as vector (-> self gondola-tilt-oscillator)) (the-as vector (-> self gondola-tilt-oscillator)) - (-> self root-override trans) + (-> self root trans) ) ) ) @@ -1550,7 +1512,7 @@ :post transform-post ) -(defmethod init-from-entity! swamp-blimp ((this swamp-blimp) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swamp-blimp) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -1569,13 +1531,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *swamp-blimp-sg* '()) - (quaternion-copy! (-> this rot-at-init) (-> this root-override quat)) + (quaternion-copy! (-> this rot-at-init) (-> this root quat)) (set! (-> this arm-timer) 0) - (set! (-> this trans-at-init quad) (-> this root-override trans quad)) + (set! (-> this trans-at-init quad) (-> this root trans quad)) (set! (-> this y-vel) 0.0) (set! (-> this y-offset) 0.0) (set! (-> this y-offset-target) 0.0) diff --git a/goal_src/jak1/levels/village2/village2-obs.gc b/goal_src/jak1/levels/village2/village2-obs.gc index 748f89ddbff..cfe25252645 100644 --- a/goal_src/jak1/levels/village2/village2-obs.gc +++ b/goal_src/jak1/levels/village2/village2-obs.gc @@ -9,12 +9,8 @@ ;; DECOMP BEGINS (deftype village2cam (pov-camera) - ((seq uint64 :offset-assert 224) + ((seq uint64) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xe8 - :flag-assert #x1e008000e8 ) @@ -23,7 +19,7 @@ :bounds (static-spherem 0 0 0 10) ) -(defmethod set-stack-size! village2cam ((this village2cam)) +(defmethod set-stack-size! ((this village2cam)) (stack-size-set! (-> this main-thread) 512) (none) ) @@ -83,14 +79,10 @@ ) (deftype pontoon (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 736) - (task uint8 :offset-assert 752) - (alt-task uint8 :offset-assert 753) + ((anchor-point vector :inline) + (task uint8) + (alt-task uint8) ) - :heap-base #x290 - :method-count-assert 35 - :size-assert #x2f2 - :flag-assert #x23029002f2 (:states pontoon-die pontoon-hidden @@ -153,7 +145,7 @@ ) ) -(defmethod init-from-entity! pontoon ((this pontoon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pontoon) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (rigid-body-platform-method-30 this) (process-drawable-from-entity! this arg0) @@ -182,7 +174,7 @@ (none) ) -(defmethod rigid-body-platform-method-23 pontoon ((this pontoon) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this pontoon) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 @@ -243,19 +235,11 @@ (deftype pontoonfive (pontoon) () - :heap-base #x290 - :method-count-assert 35 - :size-assert #x2f2 - :flag-assert #x23029002f2 ) (deftype pontoonten (pontoon) () - :heap-base #x290 - :method-count-assert 35 - :size-assert #x2f2 - :flag-assert #x23029002f2 ) @@ -271,7 +255,7 @@ :longest-edge (meters 4) ) -(defmethod rigid-body-platform-method-30 pontoonfive ((this pontoonfive)) +(defmethod rigid-body-platform-method-30 ((this pontoonfive)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -296,7 +280,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 pontoonfive ((this pontoonfive)) +(defmethod rigid-body-platform-method-31 ((this pontoonfive)) (initialize-skeleton this *pontoonfive-sg* '()) (rigid-body-platform-method-29 this *pontoonfive-constants*) (set! (-> this float-height-offset) 6144.0) @@ -331,7 +315,7 @@ (none) ) -(defmethod rigid-body-platform-method-30 pontoonten ((this pontoonten)) +(defmethod rigid-body-platform-method-30 ((this pontoonten)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -356,7 +340,7 @@ (none) ) -(defmethod rigid-body-platform-method-31 pontoonten ((this pontoonten)) +(defmethod rigid-body-platform-method-31 ((this pontoonten)) (initialize-skeleton this *pontoonten-sg* '()) (rigid-body-platform-method-29 this *pontoonten-constants*) (set! (-> this float-height-offset) 6144.0) @@ -455,12 +439,8 @@ ) (deftype allpontoons (process-drawable) - ((task uint8 :offset-assert 176) + ((task uint8) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb1 - :flag-assert #x14005000b1 (:states (allpontoons-be-clone handle) allpontoons-idle @@ -547,7 +527,7 @@ ) ) -(defmethod init-from-entity! allpontoons ((this allpontoons) (arg0 entity-actor)) +(defmethod init-from-entity! ((this allpontoons) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *allpontoons-sg* '()) @@ -558,14 +538,10 @@ ) (deftype fireboulder (process-drawable) - ((root-override collide-shape :offset 112) - (tracker handle :offset-assert 176) - (task uint8 :offset-assert 184) + ((root collide-shape :override) + (tracker handle) + (task uint8) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb9 - :flag-assert #x14005000b9 (:states (fireboulder-be-clone handle) fireboulder-hover @@ -581,7 +557,7 @@ ) (defbehavior fireboulder-disable-blocking-collision fireboulder () - (let ((v1-1 (-> self root-override root-prim))) + (let ((v1-1 (-> self root root-prim))) (dotimes (a0-0 (-> (the-as collide-shape-prim-group v1-1) num-prims)) (let ((a1-2 (-> (the-as collide-shape-prim-group v1-1) prims a0-0))) (when (= (-> a1-2 prim-id) 256) @@ -612,24 +588,16 @@ ) (else (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (set! v0-1 (ppointer->handle - (when gp-1 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 678) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) - ) + (set! v0-1 + (ppointer->handle + (when gp-1 + (let ((t9-2 (method-of-type part-tracker activate))) + (t9-2 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) + ) + (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 678) -1 #f #f #f (-> self root trans)) + (-> gp-1 ppointer) + ) + ) ) ) (set! (-> self tracker) (the-as handle v0-1)) @@ -645,14 +613,14 @@ (ja-channel-set! 1) (ja :group! fireboulder-hover-ja) (logclear! (-> self draw status) (draw-status hidden)) - (set! (-> self root-override trans quad) (-> self entity extra trans quad)) + (set! (-> self root trans quad) (-> self entity extra trans quad)) (vector-reset! (-> self draw origin)) (logior! (-> self skel status) (janim-status inited)) (ja-post) (logclear! (-> self skel status) (janim-status inited)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (joint-node-index fireboulder-lod0-jg bouldercenter)) - (vector-! (-> self draw bounds) gp-0 (-> self root-override trans)) + (vector-! (-> self draw bounds) gp-0 (-> self root trans)) ) (set! (-> self draw bounds w) 24576.0) ) @@ -667,11 +635,7 @@ (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (quaternion-rotate-y! - (-> self root-override quat) - (-> self root-override quat) - (* 455.1111 (-> *display* time-adjust-ratio)) - ) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 455.1111 (-> *display* time-adjust-ratio))) (suspend) (ja :num! (seek!)) ) @@ -739,7 +703,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) ) @@ -754,7 +718,7 @@ :post ja-post ) -(defmethod init-from-entity! fireboulder ((this fireboulder) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fireboulder) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) @@ -784,14 +748,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (cond ((name= (-> this name) "fireboulder-6") - (quaternion-axis-angle! (-> this root-override quat) 0.0 1.0 0.0 16384.0) + (quaternion-axis-angle! (-> this root quat) 0.0 1.0 0.0 16384.0) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "rock-hover" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "rock-hover" :fo-max 30) (-> this root trans)) ) ) (else @@ -818,10 +782,6 @@ (deftype ceilingflag (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states ceilingflag-idle ) @@ -846,7 +806,7 @@ :post ja-post ) -(defmethod init-from-entity! ceilingflag ((this ceilingflag) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ceilingflag) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *ceilingflag-sg* '()) @@ -855,15 +815,11 @@ ) (deftype exit-chamber-dummy (process-drawable) - ((orig-trans vector :inline :offset-assert 176) - (fcell-handle handle :offset-assert 192) + ((orig-trans vector :inline) + (fcell-handle handle) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15006000c8 (:methods - (skip-reminder? (_type_) symbol 20) + (skip-reminder? (_type_) symbol) ) (:states exit-chamber-dummy-idle @@ -877,7 +833,7 @@ :bounds (static-spherem 0 5 0 15) ) -(defmethod skip-reminder? exit-chamber-dummy ((this exit-chamber-dummy)) +(defmethod skip-reminder? ((this exit-chamber-dummy)) (case (get-reminder (get-task-control (game-task sunken-room)) 0) ((2) (let ((v1-4 (level-get *level* 'sunken))) @@ -944,7 +900,7 @@ :post ja-post ) -(defmethod init-from-entity! exit-chamber-dummy ((this exit-chamber-dummy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this exit-chamber-dummy) (arg0 entity-actor)) (set! (-> this fcell-handle) (the-as handle #f)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -967,12 +923,8 @@ ) (deftype ogreboss-village2 (process-drawable) - ((boulder handle :offset-assert 176) + ((boulder handle) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states ogreboss-village2-idle ogreboss-village2-throw @@ -1504,7 +1456,7 @@ :post ja-post ) -(defmethod init-from-entity! ogreboss-village2 ((this ogreboss-village2) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ogreboss-village2) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -1538,19 +1490,11 @@ (deftype villageb-ogreboss (ogreboss-village2) () - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 ) (deftype villageb-water (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) @@ -1567,7 +1511,7 @@ ) ) -(defmethod water-vol-method-22 villageb-water ((this villageb-water)) +(defmethod water-vol-method-22 ((this villageb-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/goal_src/jak1/levels/village2/village2-part.gc b/goal_src/jak1/levels/village2/village2-part.gc index f7cf109a404..fbbd4db9e0f 100644 --- a/goal_src/jak1/levels/village2/village2-part.gc +++ b/goal_src/jak1/levels/village2/village2-part.gc @@ -9,10 +9,6 @@ (deftype villageb-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/village2/warrior.gc b/goal_src/jak1/levels/village2/warrior.gc index c90ff0c548e..536840ff6d2 100644 --- a/goal_src/jak1/levels/village2/warrior.gc +++ b/goal_src/jak1/levels/village2/warrior.gc @@ -9,10 +9,6 @@ (deftype warrior (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -22,10 +18,10 @@ :shadow warrior-shadow-mg ) -(defmethod process-taskable-method-52 warrior ((this warrior)) +(defmethod process-taskable-method-52 ((this warrior)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -38,7 +34,7 @@ (none) ) -(defmethod draw-npc-shadow warrior ((this warrior)) +(defmethod draw-npc-shadow ((this warrior)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -61,7 +57,7 @@ (none) ) -(defmethod play-anim! warrior ((this warrior) (arg0 symbol)) +(defmethod play-anim! ((this warrior) (arg0 symbol)) (with-pp (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) @@ -144,7 +140,7 @@ ) ) -(defmethod get-art-elem warrior ((this warrior)) +(defmethod get-art-elem ((this warrior)) (-> this draw art-group data 5) ) @@ -156,25 +152,25 @@ ) ) -(defmethod process-taskable-method-43 warrior ((this warrior)) +(defmethod process-taskable-method-43 ((this warrior)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 2) 61440.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.66 f0-2) - (play-ambient (-> this ambient) "WAR-LO1A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "WAR-LO1A" #f (-> this root trans)) ) ((< 0.33 f0-2) - (play-ambient (-> this ambient) "WAR-LO1B" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "WAR-LO1B" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "WAR-LO1C" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "WAR-LO1C" #f (-> this root trans)) ) ) ) ) ) -(defmethod initialize-collision warrior ((this warrior) (arg0 int) (arg1 vector)) +(defmethod initialize-collision ((this warrior) (arg0 int) (arg1 vector)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) @@ -202,13 +198,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-from-entity! warrior ((this warrior) (arg0 entity-actor)) +(defmethod init-from-entity! ((this warrior) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *warrior-sg* 3 33 (new 'static 'vector :y -4096.0 :w 10240.0) 5) (set! (-> this tasks) (get-task-control (game-task village2-warrior-money))) (set! (-> this sound-flava) (music-flava warrior)) diff --git a/goal_src/jak1/levels/village3/assistant-village3.gc b/goal_src/jak1/levels/village3/assistant-village3.gc index 89b1be6c9d1..574a6ed275b 100644 --- a/goal_src/jak1/levels/village3/assistant-village3.gc +++ b/goal_src/jak1/levels/village3/assistant-village3.gc @@ -9,10 +9,6 @@ (deftype assistant-villagec (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -22,10 +18,10 @@ :shadow assistant-village3-shadow-mg ) -(defmethod process-taskable-method-52 assistant-villagec ((this assistant-villagec)) +(defmethod process-taskable-method-52 ((this assistant-villagec)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) ) @@ -38,7 +34,7 @@ (none) ) -(defmethod draw-npc-shadow assistant-villagec ((this assistant-villagec)) +(defmethod draw-npc-shadow ((this assistant-villagec)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -61,7 +57,7 @@ (none) ) -(defmethod play-anim! assistant-villagec ((this assistant-villagec) (arg0 symbol)) +(defmethod play-anim! ((this assistant-villagec) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk-to-assistant)) (cond ((= (get-task-status (game-task finalboss-movies)) (task-status need-introduction)) @@ -81,54 +77,54 @@ ) ) -(defmethod get-art-elem assistant-villagec ((this assistant-villagec)) +(defmethod get-art-elem ((this assistant-villagec)) (-> this draw art-group data 3) ) -(defmethod should-display? assistant-villagec ((this assistant-villagec)) +(defmethod should-display? ((this assistant-villagec)) (and (task-closed? (game-task village3-button) (task-status need-introduction)) (not (sages-kidnapped?))) ) -(defmethod target-above-threshold? assistant-villagec ((this assistant-villagec)) +(defmethod target-above-threshold? ((this assistant-villagec)) (the-as symbol (and *target* (< (-> (target-pos 0) z) -14245888.0))) ) -(defmethod process-taskable-method-43 assistant-villagec ((this assistant-villagec)) +(defmethod process-taskable-method-43 ((this assistant-villagec)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) - (play-ambient (-> this ambient) "ASSTLP31" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP31" #f (-> this root trans)) ) ((< 0.71428573 f0-2) - (play-ambient (-> this ambient) "ASSTLP32" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP32" #f (-> this root trans)) ) ((< 0.5714286 f0-2) - (play-ambient (-> this ambient) "ASSTLP33" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP33" #f (-> this root trans)) ) ((< 0.42857143 f0-2) (let ((v1-16 (get-task-status (game-task lavatube-end)))) (if (not (or (= v1-16 (task-status need-reward-speech)) (= v1-16 (task-status invalid)))) - (play-ambient (-> this ambient) "ASSTLP34" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP34" #f (-> this root trans)) ) ) ) ((< 0.2857143 f0-2) (let ((v1-21 (get-task-status (game-task lavatube-end)))) (if (not (or (= v1-21 (task-status need-reward-speech)) (= v1-21 (task-status invalid)))) - (play-ambient (-> this ambient) "ASSTLP35" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP35" #f (-> this root trans)) ) ) ) ((< 0.14285715 f0-2) (let ((v1-26 (get-task-status (game-task lavatube-end)))) (if (not (or (= v1-26 (task-status need-reward-speech)) (= v1-26 (task-status invalid)))) - (play-ambient (-> this ambient) "ASSTLP36" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP36" #f (-> this root trans)) ) ) ) ((nonzero? (get-task-status (game-task citadel-sage-green))) - (play-ambient (-> this ambient) "ASSTLP37" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP37" #f (-> this root trans)) ) ) ) @@ -179,7 +175,7 @@ ) ) -(defmethod init-from-entity! assistant-villagec ((this assistant-villagec) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant-villagec) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-village3-sg* 3 31 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task assistant-village3))) (process-taskable-method-42 this) diff --git a/goal_src/jak1/levels/village3/minecart.gc b/goal_src/jak1/levels/village3/minecart.gc index 62a4bdba3ba..00f7fa7396f 100644 --- a/goal_src/jak1/levels/village3/minecart.gc +++ b/goal_src/jak1/levels/village3/minecart.gc @@ -16,17 +16,13 @@ ) (deftype minecartsteel (process-drawable) - ((root-override collide-shape-moving :offset 112) - (index int32 :offset-assert 176) - (anim spool-anim :offset-assert 180) - (sync sync-info :inline :offset-assert 184) + ((root collide-shape-moving :override) + (index int32) + (anim spool-anim) + (sync sync-info :inline) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc0 - :flag-assert #x15005000c0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -38,7 +34,7 @@ (('touch 'attack) (when (= (-> proc type) target) (let ((a2-1 (new 'stack 'collide-overlap-result))) - (if (not (on-platform (-> self root-override) (-> *target* control) a2-1)) + (if (not (on-platform (-> self root) (-> *target* control) a2-1)) (send-event proc 'no-look-around (seconds 1.5)) ) ) @@ -84,17 +80,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> self root-override) s4-0) + (set! (-> self root) s4-0) ) (process-drawable-from-entity! self arg0) (logclear! (-> self mask) (process-mask actor-pause)) - (quaternion-identity! (-> self root-override quat)) + (quaternion-identity! (-> self root quat)) (initialize-skeleton self *minecartsteel-sg* '()) (set! (-> self draw origin-joint-index) (the-as uint 3)) (logior! (-> self skel status) (janim-status inited)) (load-params! (-> self sync) self (the-as uint 9000) arg1 0.15 0.15) (set! (-> self sound) - (new 'process 'ambient-sound (static-sound-spec "v3-cartride" :fo-max 30) (-> self root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "v3-cartride" :fo-max 30) (-> self root trans)) ) (set! (-> self index) (res-lump-value arg0 'index int)) (let ((v1-33 (-> self index))) @@ -132,7 +128,7 @@ (go-virtual idle) ) -(defmethod init-from-entity! minecartsteel ((this minecartsteel) (arg0 entity-actor)) +(defmethod init-from-entity! ((this minecartsteel) (arg0 entity-actor)) (dotimes (s4-0 4) (process-spawn minecartsteel diff --git a/goal_src/jak1/levels/village3/miners.gc b/goal_src/jak1/levels/village3/miners.gc index 36d7ca1f00e..f3287b192fa 100644 --- a/goal_src/jak1/levels/village3/miners.gc +++ b/goal_src/jak1/levels/village3/miners.gc @@ -27,10 +27,6 @@ (deftype minertall (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) @@ -40,10 +36,10 @@ :shadow minertall-shadow-mg ) -(defmethod process-taskable-method-52 minertall ((this minertall)) +(defmethod process-taskable-method-52 ((this minertall)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -59,7 +55,7 @@ (none) ) -(defmethod draw-npc-shadow minertall ((this minertall)) +(defmethod draw-npc-shadow ((this minertall)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -82,7 +78,7 @@ (none) ) -(defmethod play-anim! minertall ((this minertall) (arg0 symbol)) +(defmethod play-anim! ((this minertall) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (current-status (-> this tasks)) (if arg0 @@ -96,7 +92,7 @@ (the-as basic (-> this draw art-group data 3)) ) -(defmethod get-art-elem minertall ((this minertall)) +(defmethod get-art-elem ((this minertall)) (-> this draw art-group data 3) ) @@ -109,7 +105,7 @@ :code miners-anim-loop ) -(defmethod init-from-entity! minertall ((this minertall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this minertall) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *minertall-sg* 32 47 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task village3-miner-money1))) (set! (-> this draw light-index) (the-as uint 1)) @@ -118,12 +114,8 @@ ) (deftype minershort (process-taskable) - ((other-miner minertall :offset-assert 380) + ((other-miner minertall) ) - :heap-base #x110 - :method-count-assert 53 - :size-assert #x180 - :flag-assert #x3501100180 ) @@ -214,10 +206,10 @@ ) ) -(defmethod process-taskable-method-52 minershort ((this minershort)) +(defmethod process-taskable-method-52 ((this minershort)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -233,7 +225,7 @@ (none) ) -(defmethod draw-npc-shadow minershort ((this minershort)) +(defmethod draw-npc-shadow ((this minershort)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -264,7 +256,7 @@ (none) ) -(defmethod play-anim! minershort ((this minershort) (arg0 symbol)) +(defmethod play-anim! ((this minershort) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -464,100 +456,100 @@ ) ) -(defmethod get-art-elem minershort ((this minershort)) +(defmethod get-art-elem ((this minershort)) (-> this draw art-group data 3) ) -(defmethod process-taskable-method-43 minershort ((this minershort)) +(defmethod process-taskable-method-43 ((this minershort)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.9655172 f0-2) - (play-ambient (-> this ambient) "MIN-LO01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MIN-LO01" #f (-> this root trans)) ) ((< 0.9310345 f0-2) - (play-ambient (-> this ambient) "MIN-LO03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MIN-LO03" #f (-> this root trans)) ) ((< 0.8965517 f0-2) - (play-ambient (-> this ambient) "MIN-LO04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MIN-LO04" #f (-> this root trans)) ) ((< 0.86206895 f0-2) - (play-ambient (-> this ambient) "MIN-LO05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MIN-LO05" #f (-> this root trans)) ) ((< 0.82758623 f0-2) - (play-ambient (-> this ambient) "MIN-LO06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MIN-LO06" #f (-> this root trans)) ) ((< 0.79310346 f0-2) - (play-ambient (-> this ambient) "MSH-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM01" #f (-> this root trans)) ) ((< 0.7586207 f0-2) - (play-ambient (-> this ambient) "MSH-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM02" #f (-> this root trans)) ) ((< 0.7241379 f0-2) - (play-ambient (-> this ambient) "MSH-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM03" #f (-> this root trans)) ) ((< 0.6896552 f0-2) - (play-ambient (-> this ambient) "MSH-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM04" #f (-> this root trans)) ) ((< 0.6551724 f0-2) - (play-ambient (-> this ambient) "MSH-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM05" #f (-> this root trans)) ) ((< 0.62068963 f0-2) - (play-ambient (-> this ambient) "MSH-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM06" #f (-> this root trans)) ) ((< 0.5862069 f0-2) - (play-ambient (-> this ambient) "MSH-AM07" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM07" #f (-> this root trans)) ) ((< 0.55172414 f0-2) - (play-ambient (-> this ambient) "MSH-AM08" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM08" #f (-> this root trans)) ) ((< 0.51724136 f0-2) - (play-ambient (-> this ambient) "MSH-AM09" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM09" #f (-> this root trans)) ) ((< 0.4827586 f0-2) - (play-ambient (-> this ambient) "MSH-AM10" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM10" #f (-> this root trans)) ) ((< 0.44827586 f0-2) - (play-ambient (-> this ambient) "MSH-AM11" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM11" #f (-> this root trans)) ) ((< 0.41379312 f0-2) - (play-ambient (-> this ambient) "MSH-AM12" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM12" #f (-> this root trans)) ) ((< 0.37931034 f0-2) - (play-ambient (-> this ambient) "MSH-AM1A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM1A" #f (-> this root trans)) ) ((< 0.3448276 f0-2) - (play-ambient (-> this ambient) "MSH-AM2A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM2A" #f (-> this root trans)) ) ((< 0.31034482 f0-2) - (play-ambient (-> this ambient) "MSH-AM3A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM3A" #f (-> this root trans)) ) ((< 0.27586207 f0-2) - (play-ambient (-> this ambient) "MTA-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM01" #f (-> this root trans)) ) ((< 0.2413793 f0-2) - (play-ambient (-> this ambient) "MTA-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM02" #f (-> this root trans)) ) ((< 0.20689656 f0-2) - (play-ambient (-> this ambient) "MTA-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM03" #f (-> this root trans)) ) ((< 0.1724138 f0-2) - (play-ambient (-> this ambient) "MTA-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM04" #f (-> this root trans)) ) ((< 0.13793103 f0-2) - (play-ambient (-> this ambient) "MTA-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM05" #f (-> this root trans)) ) ((< 0.10344828 f0-2) - (play-ambient (-> this ambient) "MTA-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM06" #f (-> this root trans)) ) ((< 0.06896552 f0-2) - (play-ambient (-> this ambient) "MTA-AM07" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM07" #f (-> this root trans)) ) ((< 0.03448276 f0-2) - (play-ambient (-> this ambient) "MTA-AM08" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM08" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "MTA-AM09" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM09" #f (-> this root trans)) ) ) ) @@ -569,7 +561,7 @@ :code miners-anim-loop ) -(defmethod init-from-entity! minershort ((this minershort) (arg0 entity-actor)) +(defmethod init-from-entity! ((this minershort) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *minershort-sg* 34 46 (new 'static 'vector :w 4096.0) 5) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 566) this)) (set! (-> this tasks) (get-task-control (game-task village3-miner-money1))) @@ -583,12 +575,8 @@ (deftype cavegem (process-drawable) () - :heap-base #x40 - :method-count-assert 21 - :size-assert #xb0 - :flag-assert #x15004000b0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -612,7 +600,7 @@ :post ja-post ) -(defmethod init-from-entity! cavegem ((this cavegem) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cavegem) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *cavegem-sg* '()) diff --git a/goal_src/jak1/levels/village3/sage-village3.gc b/goal_src/jak1/levels/village3/sage-village3.gc index 746584e0531..15edcf35a17 100644 --- a/goal_src/jak1/levels/village3/sage-village3.gc +++ b/goal_src/jak1/levels/village3/sage-village3.gc @@ -8,14 +8,10 @@ ;; DECOMP BEGINS (deftype sage-villagec (process-taskable) - ((evilbro handle :offset-assert 384) - (evilsis handle :offset-assert 392) - (assistant entity-actor :offset-assert 400) + ((evilbro handle) + (evilsis handle) + (assistant entity-actor) ) - :heap-base #x130 - :method-count-assert 53 - :size-assert #x194 - :flag-assert #x3501300194 ) @@ -37,7 +33,7 @@ :shadow evilsis-village3-shadow-mg ) -(defmethod play-anim! sage-villagec ((this sage-villagec) (arg0 symbol)) +(defmethod play-anim! ((this sage-villagec) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk-to-sage)) (case (current-status (-> this tasks)) (((task-status unknown) (task-status need-hint) (task-status need-introduction)) @@ -50,17 +46,13 @@ (close-status! (-> this tasks) (task-status need-introduction)) (send-event (-> this assistant extra process) 'clone (process->handle this)) (set! (-> this evilbro) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *evilbro-village3-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *evilbro-village3-sg* #f :to this)) ) (send-event (handle->process (-> this evilbro)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this evilbro)) 'blend-shape #t) (send-event (handle->process (-> this evilbro)) 'center-joint 3) (set! (-> this evilsis) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *evilsis-village3-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *evilsis-village3-sg* #f :to this)) ) (send-event (handle->process (-> this evilsis)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this evilsis)) 'blend-shape #t) @@ -179,47 +171,47 @@ ) ) -(defmethod get-art-elem sage-villagec ((this sage-villagec)) +(defmethod get-art-elem ((this sage-villagec)) (-> this draw art-group data 3) ) -(defmethod target-above-threshold? sage-villagec ((this sage-villagec)) +(defmethod target-above-threshold? ((this sage-villagec)) (the-as symbol (and *target* (< (-> (target-pos 0) x) 4575232.0) (< -14323302.0 (-> (target-pos 0) z)))) ) -(defmethod process-taskable-method-43 sage-villagec ((this sage-villagec)) +(defmethod process-taskable-method-43 ((this sage-villagec)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.875 f0-2) - (play-ambient (-> this ambient) "SAGELP31" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP31" #f (-> this root trans)) ) ((< 0.75 f0-2) (if (not (closed? (-> this tasks) (game-task cave-dark-crystals) (task-status need-reminder))) - (play-ambient (-> this ambient) "SAGELP32" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP32" #f (-> this root trans)) ) ) ((< 0.625 f0-2) (if (nonzero? (get-task-status (game-task citadel-sage-green))) - (play-ambient (-> this ambient) "SAGELP33" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP33" #f (-> this root trans)) ) ) ((< 0.5 f0-2) - (play-ambient (-> this ambient) "SAGELP34" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP34" #f (-> this root trans)) ) ((< 0.375 f0-2) - (play-ambient (-> this ambient) "SAGELP35" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP35" #f (-> this root trans)) ) ((< 0.25 f0-2) - (play-ambient (-> this ambient) "SAGELP36" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP36" #f (-> this root trans)) ) ((< 0.125 f0-2) (if (nonzero? (get-task-status (game-task citadel-sage-green))) - (play-ambient (-> this ambient) "SAGELP37" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP37" #f (-> this root trans)) ) ) ((!= (get-task-status (game-task citadel-sage-green)) (task-status need-resolution)) - (play-ambient (-> this ambient) "SAGELP38" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP38" #f (-> this root trans)) ) ) ) @@ -257,7 +249,7 @@ ) ) -(defmethod should-display? sage-villagec ((this sage-villagec)) +(defmethod should-display? ((this sage-villagec)) (cond ((not (closed? (-> this tasks) (game-task village3-button) (task-status need-hint))) (process-taskable-method-33 this) @@ -273,7 +265,7 @@ ) ) -(defmethod draw-npc-shadow sage-villagec ((this sage-villagec)) +(defmethod draw-npc-shadow ((this sage-villagec)) (let ((v1-1 (-> this draw shadow-ctrl))) (cond ((and (-> this draw shadow) @@ -298,7 +290,7 @@ (none) ) -(defmethod init-from-entity! sage-villagec ((this sage-villagec) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sage-villagec) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sage-village3-sg* 3 40 (new 'static 'vector :w 8192.0) 5) (set! (-> this tasks) (get-task-control (game-task cave-dark-crystals))) (set! (-> this assistant) (entity-actor-lookup arg0 'alt-actor 0)) diff --git a/goal_src/jak1/levels/village3/village3-obs.gc b/goal_src/jak1/levels/village3/village3-obs.gc index 2dfe3de7022..b94ba178fa4 100644 --- a/goal_src/jak1/levels/village3/village3-obs.gc +++ b/goal_src/jak1/levels/village3/village3-obs.gc @@ -33,10 +33,6 @@ (deftype villagec-lava (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) @@ -52,7 +48,7 @@ ) ) -(defmethod water-vol-method-22 villagec-lava ((this villagec-lava)) +(defmethod water-vol-method-22 ((this villagec-lava)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) @@ -68,18 +64,14 @@ ) (deftype gondola (process-drawable) - ((root-override collide-shape-moving :offset 112) - (anim spool-anim :offset-assert 176) - (old-target-pos transformq :inline :offset-assert 192) + ((root collide-shape-moving :override) + (anim spool-anim) + (old-target-pos transformq :inline) ) - :heap-base #x80 - :method-count-assert 23 - :size-assert #xf0 - :flag-assert #x17008000f0 - (:methods - (idle (symbol) _type_ :state 20) - (ride-up () _type_ :state 21) - (ride-down () _type_ :state 22) + (:state-methods + (idle symbol) + ride-up + ride-down ) ) @@ -266,7 +258,7 @@ (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) (send-event *target* 'trans 'restore (-> self old-target-pos)) (send-event *target* 'end-mode) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) (logior! (-> *target* control status) (cshape-moving-flags onsurf onground tsurf)) (suspend) @@ -307,7 +299,7 @@ (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) (send-event *target* 'trans 'restore (-> self old-target-pos)) (send-event *target* 'end-mode) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) (logior! (-> *target* control status) (cshape-moving-flags onsurf onground tsurf)) (suspend) @@ -322,7 +314,7 @@ :post (-> (method-of-type gondola ride-up) post) ) -(defmethod init-from-entity! gondola ((this gondola) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gondola) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -342,10 +334,10 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (quaternion-identity! (-> this root-override quat)) + (quaternion-identity! (-> this root quat)) (initialize-skeleton this *gondola-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) (logclear! (-> this mask) (process-mask actor-pause)) @@ -365,7 +357,7 @@ ) ) (cond - ((< (-> (target-pos 0) y) (+ 204800.0 (-> this root-override trans y))) + ((< (-> (target-pos 0) y) (+ 204800.0 (-> this root trans y))) (go (method-of-object this idle) #f) ) (else @@ -378,13 +370,9 @@ (deftype pistons (process-drawable) () - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 - (:methods - (idle () _type_ :state 20) - (active (handle symbol) _type_ :state 21) + (:state-methods + idle + (active handle symbol) ) ) @@ -437,7 +425,7 @@ ) ) -(defmethod init-from-entity! pistons ((this pistons) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pistons) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *pistons-sg* '()) @@ -453,12 +441,8 @@ (deftype gondolacables (process-drawable) () - :heap-base #x40 - :method-count-assert 21 - :size-assert #xb0 - :flag-assert #x15004000b0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -493,7 +477,7 @@ :post ja-post ) -(defmethod init-from-entity! gondolacables ((this gondolacables) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gondolacables) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *gondolacables-sg* '()) diff --git a/goal_src/jak1/levels/village3/village3-part.gc b/goal_src/jak1/levels/village3/village3-part.gc index 05d5bf97322..705d4de0e1c 100644 --- a/goal_src/jak1/levels/village3/village3-part.gc +++ b/goal_src/jak1/levels/village3/village3-part.gc @@ -9,10 +9,6 @@ (deftype villagec-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) diff --git a/goal_src/jak1/levels/village_common/oracle.gc b/goal_src/jak1/levels/village_common/oracle.gc index 107cc66b1ef..9a9b274aa96 100644 --- a/goal_src/jak1/levels/village_common/oracle.gc +++ b/goal_src/jak1/levels/village_common/oracle.gc @@ -8,15 +8,11 @@ ;; DECOMP BEGINS (deftype oracle (process-taskable) - ((first-task uint8 :offset-assert 380) - (second-task uint8 :offset-assert 381) - (left-eye-cell handle :offset-assert 384) - (right-eye-cell handle :offset-assert 392) + ((first-task uint8) + (second-task uint8) + (left-eye-cell handle) + (right-eye-cell handle) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x190 - :flag-assert #x3501200190 ) @@ -25,7 +21,7 @@ :bounds (static-spherem 0 0 0 4) ) -(defmethod play-anim! oracle ((this oracle) (arg0 symbol)) +(defmethod play-anim! ((this oracle) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -217,7 +213,7 @@ ) ) -(defmethod get-art-elem oracle ((this oracle)) +(defmethod get-art-elem ((this oracle)) (-> this draw art-group data 2) ) @@ -233,10 +229,10 @@ ) ) -(defmethod init-from-entity! oracle ((this oracle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this oracle) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *oracle-sg* 3 4 (new 'static 'vector :y -4096.0 :w 4096.0) -1) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "oracle-sleep" :fo-max 50) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "oracle-sleep" :fo-max 50) (-> this root trans)) ) (set! (-> this first-task) (the-as uint (-> arg0 extra perm task))) (set! (-> this second-task) (res-lump-value arg0 'alt-task uint)) @@ -247,14 +243,14 @@ (let ((s4-0 (new 'stack-no-clear 'vector)) (s5-1 (lambda :behavior oracle () - (let* ((gp-0 (-> self root-override)) + (let* ((gp-0 (-> self root)) (v1-1 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) collide-shape)) gp-0 ) ) (a1-1 (if v1-1 (-> v1-1 root-prim prim-core) - (-> self root-override trans) + (-> self root trans) ) ) ) diff --git a/goal_src/jak1/levels/village_common/villagep-obs.gc b/goal_src/jak1/levels/village_common/villagep-obs.gc index 6f477151c37..b32eeae0a4d 100644 --- a/goal_src/jak1/levels/village_common/villagep-obs.gc +++ b/goal_src/jak1/levels/village_common/villagep-obs.gc @@ -10,9 +10,6 @@ (deftype warpgate (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) @@ -441,14 +438,10 @@ ) (deftype warp-gate-switch (basebutton) - ((warp handle :offset-assert 256) + ((warp handle) ) - :heap-base #xa0 - :method-count-assert 33 - :size-assert #x108 - :flag-assert #x2100a00108 (:methods - (pressable? (_type_) symbol 32) + (pressable? (_type_) symbol) ) ) @@ -458,7 +451,7 @@ :bounds (static-spherem 0 0 0 1.5) ) -(defmethod basebutton-method-27 warp-gate-switch ((this warp-gate-switch)) +(defmethod basebutton-method-27 ((this warp-gate-switch)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -484,12 +477,12 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) -(defmethod pressable? warp-gate-switch ((this warp-gate-switch)) +(defmethod pressable? ((this warp-gate-switch)) (let ((v1-2 (-> this entity extra perm task))) (cond ((logtest? (-> *target* control root-prim prim-core action) @@ -525,7 +518,7 @@ ) ) -(defmethod basebutton-method-26 warp-gate-switch ((this warp-gate-switch)) +(defmethod basebutton-method-26 ((this warp-gate-switch)) (set! (-> this warp) (the-as handle #f)) (let ((v1-2 (-> this entity extra perm task))) (cond @@ -572,12 +565,12 @@ ) ) (set! (-> this anim-speed) 2.0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (ja-post) (none) ) -(defmethod press! warp-gate-switch ((this warp-gate-switch) (arg0 symbol)) +(defmethod press! ((this warp-gate-switch) (arg0 symbol)) (with-pp (when arg0 (let ((s4-0 (-> this entity extra perm task))) @@ -849,22 +842,18 @@ ) (deftype village-cam (process) - ((root-override trsq :offset-assert 112) - (range meters :offset-assert 116) - (index int32 :offset-assert 120) - (state-time time-frame :offset-assert 128) + ((root-override trsq) + (range meters) + (index int32) + (state-time time-frame) ) - :heap-base #x20 - :method-count-assert 15 - :size-assert #x88 - :flag-assert #xf00200088 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) -(defmethod relocate village-cam ((this village-cam) (arg0 int)) +(defmethod relocate ((this village-cam) (arg0 int)) (if (nonzero? (-> this root-override)) (&+! (-> this root-override) arg0) ) @@ -1119,7 +1108,7 @@ ) ) -(defmethod init-from-entity! village-cam ((this village-cam) (arg0 entity-actor)) +(defmethod init-from-entity! ((this village-cam) (arg0 entity-actor)) "Copy defaults from the entity." (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this root-override) (new 'process 'trsq)) diff --git a/goal_src/jak1/pc/debug/anim-tester-x.gc b/goal_src/jak1/pc/debug/anim-tester-x.gc index a0fec20e58e..a6ecdb83f40 100644 --- a/goal_src/jak1/pc/debug/anim-tester-x.gc +++ b/goal_src/jak1/pc/debug/anim-tester-x.gc @@ -30,7 +30,7 @@ (deftype atx-item (basic) - ((next atx-item :offset-assert 4) + ((next atx-item) (text string) (extra basic) @@ -40,7 +40,7 @@ (mgeo merc-ctrl :overlay-at extra) ) (:methods - (new (symbol type string basic) _type_ 0) + (new (symbol type string basic) _type_) ) ) @@ -56,7 +56,7 @@ ) (deftype atx-list (structure) - ((head atx-item :offset-assert 0) + ((head atx-item) (tail atx-item) (selection int16) (offset int16) @@ -94,7 +94,7 @@ (mg-list atx-list :inline) ) (:methods - (new (symbol type string art-group) _type_ 0) + (new (symbol type string art-group) _type_) ) ) @@ -115,14 +115,14 @@ (deftype anim-tester-x (process-drawable) ( - (edit-mode atx-edit-mode) - (cur-list atx-list) - (selected-art-group atx-item-art-group) - - (cur-art-group art-group) - (cur-joint-geo art-joint-geo) - (cur-mesh-geo merc-ctrl) - (cur-joint-anim art-joint-anim) + (edit-mode atx-edit-mode) + (cur-list atx-list) + (selected-art-group atx-item-art-group) + + (cur-art-group art-group) + (cur-joint-geo art-joint-geo) + (cur-mesh-geo merc-ctrl) + (cur-joint-anim art-joint-anim) ) ) diff --git a/goal_src/jak1/pc/pckernel.gc b/goal_src/jak1/pc/pckernel.gc index 6006038eb53..495843faff1 100644 --- a/goal_src/jak1/pc/pckernel.gc +++ b/goal_src/jak1/pc/pckernel.gc @@ -98,18 +98,18 @@ (if (nonzero? (-> *target* skel)) (set! (-> *target* skel postbind-function) target-joint-callback-pc)) - (with-pp (protect ((-> *target* fact-info-target eco-source) *sound-player-enable*) + (with-pp (protect ((-> *target* fact eco-source) *sound-player-enable*) ;; act as if this isnt a new source of eco to prevent spamming sounds. then restore the old source! - (when (< 0 (-> *target* fact-info-target eco-level)) - (set! (-> *target* fact-info-target eco-source) (process->handle pp)) + (when (< 0 (-> *target* fact eco-level)) + (set! (-> *target* fact eco-source) (process->handle pp)) (false! *sound-player-enable*) ) (cond ;; green eco! ((pc-cheats? (-> obj cheats) eco-green) - (when (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-green)) - (<= (-> *target* fact-info-target eco-level) 0.0)) + (when (or (= (-> *target* fact eco-type) (pickup-type eco-green)) + (<= (-> *target* fact eco-level) 0.0)) (define-extern vent type) (protect ((-> pp type) (-> *target* control root-prim prim-core action)) (set! (-> pp type) vent) @@ -119,15 +119,15 @@ ) ;; red eco! ((pc-cheats? (-> obj cheats) eco-red) - (when (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-red)) - (<= (-> *target* fact-info-target eco-level) 0.0)) + (when (or (= (-> *target* fact eco-type) (pickup-type eco-red)) + (<= (-> *target* fact eco-level) 0.0)) (send-event *target* 'get-pickup (pickup-type eco-red) (-> *FACT-bank* eco-full-inc)) ) ) ;; blue eco! ((pc-cheats? (-> obj cheats) eco-blue) - (when (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-blue)) - (<= (-> *target* fact-info-target eco-level) 0.0)) + (when (or (= (-> *target* fact eco-type) (pickup-type eco-blue)) + (<= (-> *target* fact eco-level) 0.0)) (protect ((-> *target* event-hook)) (set! (-> *target* event-hook) target-generic-event-handler) (send-event *target* 'get-pickup (pickup-type eco-blue) (-> *FACT-bank* eco-full-inc)) @@ -137,8 +137,8 @@ ) ;; yellow eco! ((pc-cheats? (-> obj cheats) eco-yellow) - (when (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-yellow)) - (<= (-> *target* fact-info-target eco-level) 0.0)) + (when (or (= (-> *target* fact eco-type) (pickup-type eco-yellow)) + (<= (-> *target* fact eco-level) 0.0)) (send-event *target* 'get-pickup (pickup-type eco-yellow) (-> *FACT-bank* eco-full-inc)) ) ) @@ -340,16 +340,16 @@ (when (-> obj controller-led-hp?) ;; flicker led according to hp. lower hp = faster and more intense flicker (cond - ((= (-> *target* fact-info-target health) 0.0) + ((= (-> *target* fact health) 0.0) ;; dead. just set to minimum brightness. (set! (-> obj controller-led-color a) (-> obj controller-led-min-brightness)) ) (else (let ((flicker-speed (lerp-scale 2.0 0.0 - (-> *target* fact-info-target health) + (-> *target* fact health) 1.0 (-> *FACT-bank* health-max-default))) (flicker-amp (lerp-scale (- 1.0 (-> obj controller-led-min-brightness)) (- 1.0 (-> obj controller-led-max-brightness)) - (-> *target* fact-info-target health) + (-> *target* fact health) 1.0 (-> *FACT-bank* health-max-default))) ) (set! (-> obj controller-led-color a) (- 1.0 (* flicker-amp (/ (+ 1.0 (sin (* flicker-speed (degrees (-> *display* game-frame-counter))))) 2.0)))) @@ -380,7 +380,7 @@ (when (-> obj controller-led-eco?) ;; get remaining eco as a number from 0.0 to 1.0 - (let ((eco-remain-fac (/ (the float (- (-> *target* fact-info-target eco-timeout) (- (-> *display* game-frame-counter) (-> *target* fact-info-target eco-pickup-time)))) + (let ((eco-remain-fac (/ (the float (- (-> *target* fact eco-timeout) (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time)))) (the float (-> *FACT-bank* eco-full-timeout))))) (when set-no-eco-color? (set! (-> obj controller-led-color r) 1.0) @@ -389,7 +389,7 @@ ;; dont set eco color if we don't have eco. (when (< 0.0 eco-remain-fac) ;; set color according to eco type. matches the color in the meter! - (case (-> *target* fact-info-target eco-type) + (case (-> *target* fact eco-type) (((pickup-type eco-blue)) (set! (-> obj controller-led-color r) 0.0) (set! (-> obj controller-led-color g) 0.5) diff --git a/goal_src/jak2/engine/ai/enemy-h.gc b/goal_src/jak2/engine/ai/enemy-h.gc index 12ebe624923..2a60dbf1304 100644 --- a/goal_src/jak2/engine/ai/enemy-h.gc +++ b/goal_src/jak2/engine/ai/enemy-h.gc @@ -93,346 +93,320 @@ ;; DECOMP BEGINS (deftype enemy-focus (focus) - ((aware enemy-aware :offset-assert 16) - (flags enemy-flag :offset-assert 24) + ((aware enemy-aware) + (flags enemy-flag) ) - :method-count-assert 14 - :size-assert #x20 - :flag-assert #xe00000020 (:methods - (try-update-focus (_type_ process-focusable enemy) symbol :replace 12) - (enemy-focus-method-13 (_type_ process-focusable enemy-aware) symbol 13) + (try-update-focus (_type_ process-focusable enemy) symbol :replace) + (enemy-focus-method-13 (_type_ process-focusable enemy-aware) symbol) ) ) (deftype enemy-info (basic) - ((fact-defaults fact-info-enemy-defaults :offset-assert 4) - (use-die-falling symbol :offset-assert 8) - (use-victory symbol :offset-assert 12) - (use-jump-blocked symbol :offset-assert 16) - (debug-draw-neck symbol :offset-assert 20) - (jump-debug-draw symbol :offset-assert 24) - (move-to-ground symbol :offset-assert 28) - (hover-if-no-ground symbol :offset-assert 32) - (idle-anim-script (pointer idle-control-frame) :offset-assert 36) - (idle-anim int32 :offset-assert 40) - (notice-anim int32 :offset-assert 44) - (hostile-anim int32 :offset-assert 48) - (hit-anim int32 :offset-assert 52) - (knocked-anim int32 :offset-assert 56) - (knocked-land-anim int32 :offset-assert 60) - (die-anim int32 :offset-assert 64) - (die-falling-anim int32 :offset-assert 68) - (victory-anim int32 :offset-assert 72) - (jump-wind-up-anim int32 :offset-assert 76) - (jump-in-air-anim int32 :offset-assert 80) - (jump-land-anim int32 :offset-assert 84) - (neck-joint int32 :offset-assert 88) - (look-at-joint int32 :offset-assert 92) - (bullseye-joint int32 :offset-assert 96) - (sound-hit sound-name :offset-assert 112) - (sound-die sound-name :offset-assert 128) - (notice-distance meters :offset-assert 144) - (notice-distance-delta meters :offset-assert 148) - (proximity-notice-distance meters :offset-assert 152) - (default-hit-points int32 :offset-assert 156) - (gnd-collide-with collide-spec :offset-assert 160) - (overlaps-others-collide-with-filter collide-spec :offset-assert 164) - (penetrate-flinch penetrate :offset-assert 168) - (penetrate-knocked penetrate :offset-assert 176) - (movement-gravity meters :offset-assert 184) - (friction float :offset-assert 188) - (slip-factor float :offset-assert 192) - (attack-shove-back meters :offset-assert 196) - (attack-shove-up meters :offset-assert 200) - (attack-mode symbol :offset-assert 204) - (attack-damage int32 :offset-assert 208) - (recover-gnd-collide-with collide-spec :offset-assert 212) - (jump-height-min meters :offset-assert 216) - (jump-height-factor float :offset-assert 220) - (knocked-seek-ry-clamp float :offset-assert 224) - (knocked-soft-vxz-lo float :offset-assert 228) - (knocked-soft-vxz-hi float :offset-assert 232) - (knocked-soft-vy-lo float :offset-assert 236) - (knocked-soft-vy-hi float :offset-assert 240) - (knocked-medium-vxz-lo float :offset-assert 244) - (knocked-medium-vxz-hi float :offset-assert 248) - (knocked-medium-vy-lo float :offset-assert 252) - (knocked-medium-vy-hi float :offset-assert 256) - (knocked-hard-vxz-lo float :offset-assert 260) - (knocked-hard-vxz-hi float :offset-assert 264) - (knocked-hard-vy-lo float :offset-assert 268) - (knocked-hard-vy-hi float :offset-assert 272) - (knocked-huge-vxz-lo float :offset-assert 276) - (knocked-huge-vxz-hi float :offset-assert 280) - (knocked-huge-vy-lo float :offset-assert 284) - (knocked-huge-vy-hi float :offset-assert 288) - (knocked-yellow-vxz-lo float :offset-assert 292) - (knocked-yellow-vxz-hi float :offset-assert 296) - (knocked-yellow-vy-lo float :offset-assert 300) - (knocked-yellow-vy-hi float :offset-assert 304) - (knocked-red-vxz-lo float :offset-assert 308) - (knocked-red-vxz-hi float :offset-assert 312) - (knocked-red-vy-lo float :offset-assert 316) - (knocked-red-vy-hi float :offset-assert 320) - (knocked-blue-vxz-lo float :offset-assert 324) - (knocked-blue-vxz-hi float :offset-assert 328) - (knocked-blue-vy-lo float :offset-assert 332) - (knocked-blue-vy-hi float :offset-assert 336) - (shadow-size meters :offset-assert 340) - (shadow-max-y meters :offset-assert 344) - (shadow-min-y meters :offset-assert 348) - (shadow-locus-dist meters :offset-assert 352) - (gem-joint int32 :offset-assert 356) - (gem-seg uint32 :offset-assert 360) - (gem-no-seg uint32 :offset-assert 364) - (gem-offset sphere :inline :offset-assert 368) + ((fact-defaults fact-info-enemy-defaults) + (use-die-falling symbol) + (use-victory symbol) + (use-jump-blocked symbol) + (debug-draw-neck symbol) + (jump-debug-draw symbol) + (move-to-ground symbol) + (hover-if-no-ground symbol) + (idle-anim-script (pointer idle-control-frame)) + (idle-anim int32) + (notice-anim int32) + (hostile-anim int32) + (hit-anim int32) + (knocked-anim int32) + (knocked-land-anim int32) + (die-anim int32) + (die-falling-anim int32) + (victory-anim int32) + (jump-wind-up-anim int32) + (jump-in-air-anim int32) + (jump-land-anim int32) + (neck-joint int32) + (look-at-joint int32) + (bullseye-joint int32) + (sound-hit sound-name) + (sound-die sound-name) + (notice-distance meters) + (notice-distance-delta meters) + (proximity-notice-distance meters) + (default-hit-points int32) + (gnd-collide-with collide-spec) + (overlaps-others-collide-with-filter collide-spec) + (penetrate-flinch penetrate) + (penetrate-knocked penetrate) + (movement-gravity meters) + (friction float) + (slip-factor float) + (attack-shove-back meters) + (attack-shove-up meters) + (attack-mode symbol) + (attack-damage int32) + (recover-gnd-collide-with collide-spec) + (jump-height-min meters) + (jump-height-factor float) + (knocked-seek-ry-clamp float) + (knocked-soft-vxz-lo float) + (knocked-soft-vxz-hi float) + (knocked-soft-vy-lo float) + (knocked-soft-vy-hi float) + (knocked-medium-vxz-lo float) + (knocked-medium-vxz-hi float) + (knocked-medium-vy-lo float) + (knocked-medium-vy-hi float) + (knocked-hard-vxz-lo float) + (knocked-hard-vxz-hi float) + (knocked-hard-vy-lo float) + (knocked-hard-vy-hi float) + (knocked-huge-vxz-lo float) + (knocked-huge-vxz-hi float) + (knocked-huge-vy-lo float) + (knocked-huge-vy-hi float) + (knocked-yellow-vxz-lo float) + (knocked-yellow-vxz-hi float) + (knocked-yellow-vy-lo float) + (knocked-yellow-vy-hi float) + (knocked-red-vxz-lo float) + (knocked-red-vxz-hi float) + (knocked-red-vy-lo float) + (knocked-red-vy-hi float) + (knocked-blue-vxz-lo float) + (knocked-blue-vxz-hi float) + (knocked-blue-vy-lo float) + (knocked-blue-vy-hi float) + (shadow-size meters) + (shadow-max-y meters) + (shadow-min-y meters) + (shadow-locus-dist meters) + (gem-joint int32) + (gem-seg uint32) + (gem-no-seg uint32) + (gem-offset sphere :inline) ) - :method-count-assert 10 - :size-assert #x180 - :flag-assert #xa00000180 (:methods - (copy-enemy-info! (_type_ _type_) none 9) + (copy-enemy-info! (_type_ _type_) none) ) ) (deftype enemy-knocked-info (structure) - ((anim-speed float :offset-assert 0) - (on-surface-count int32 :offset-assert 4) - (move-count int32 :offset-assert 8) - (land-can-land-time time-frame :offset-assert 16) + ((anim-speed float) + (on-surface-count int32) + (move-count int32) + (land-can-land-time time-frame) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype enemy-jump-info (structure) - ((flags uint8 :offset-assert 0) - (anim-speed float :offset-assert 4) - (hang-time time-frame :offset-assert 8) - (start-pos vector :inline :offset-assert 16) - (dest-pos vector :inline :offset-assert 32) - (traj trajectory :inline :offset-assert 48) + ((flags uint8) + (anim-speed float) + (hang-time time-frame) + (start-pos vector :inline) + (dest-pos vector :inline) + (traj trajectory :inline) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) (deftype enemy-init-by-other-params (structure) - ((trans vector :inline :offset-assert 0) - (quat quaternion :inline :offset-assert 16) - (entity entity :offset-assert 32) - (directed? symbol :offset-assert 36) - (no-initial-move-to-ground? symbol :offset-assert 40) + ((trans vector :inline) + (quat quaternion :inline) + (entity entity) + (directed? symbol) + (no-initial-move-to-ground? symbol) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) (deftype enemy-attack-info (structure) - ((attack-id uint32 :offset-assert 0) - (knocked-type knocked-type :offset-assert 4) - (blue-juggle-count uint8 :offset-assert 5) - (attacker-handle handle :offset-assert 8) - (attack-time time-frame :offset-assert 16) - (penetrate-using uint64 :offset-assert 24) - (attacker-pos vector :inline :offset-assert 32) - (attack-direction vector :inline :offset-assert 48) + ((attack-id uint32) + (knocked-type knocked-type) + (blue-juggle-count uint8) + (attacker-handle handle) + (attack-time time-frame) + (penetrate-using uint64) + (attacker-pos vector :inline) + (attack-direction vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype enemy-best-focus (structure) - ((proc process :offset-assert 0) - (rating float :offset-assert 4) - (aware enemy-aware :offset-assert 8) + ((proc process) + (rating float) + (aware enemy-aware) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype enemy (process-focusable) - ((root collide-shape-moving :override) - (fact fact-info-enemy :override) - (enemy-flags enemy-flag :offset-assert 208) - (enemy-info enemy-info :offset-assert 216) - (hit-points int32 :offset-assert 220) - (gnd-collide uint32 :offset-assert 224) - (attack-id uint32 :offset-assert 228) - (persistent-attack-id uint32 :offset-assert 232) - (water-max-height meters :offset-assert 236) - (water-surface-height meters :offset-assert 240) - (desired-angle degrees :offset-assert 244) - (jump-why uint64 :offset-assert 248) - (penetrated-by-all penetrate :offset-assert 256) - (penetrated-flinch penetrate :offset-assert 264) - (penetrated-knocked penetrate :offset-assert 272) - (reaction-time time-frame :offset-assert 280) - (notice-time time-frame :offset-assert 288) - (state-timeout time-frame :offset-assert 296) - (auto-reset-penetrate-time time-frame :offset-assert 304) - (hit-focus-time time-frame :offset-assert 312) - (last-draw-time time-frame :offset-assert 320) - (starting-time time-frame :offset-assert 328) - (fated-time time-frame :offset-assert 336) - (focus-pos vector :inline :offset-assert 352) - (event-param-point vector :inline :offset-assert 368) - (jump-dest vector :inline :offset 368) - (focus enemy-focus :inline :offset-assert 384) - (incoming enemy-attack-info :inline :offset-assert 416) - (actor-group (pointer actor-group) :offset-assert 480) - (actor-group-count int32 :offset-assert 484) - (neck joint-mod :offset-assert 488) - (on-notice symbol :offset-assert 492) - (on-active symbol :offset-assert 496) - (on-hostile symbol :offset-assert 500) - (on-death symbol :offset-assert 504) - (idle-anim-player idle-control :inline :offset-assert 512) - (rand-gen symbol :offset-assert 528) + ((root collide-shape-moving :override) + (fact fact-info-enemy :override) + (enemy-flags enemy-flag) + (enemy-info enemy-info) + (hit-points int32) + (gnd-collide uint32) + (attack-id uint32) + (persistent-attack-id uint32) + (water-max-height meters) + (water-surface-height meters) + (desired-angle degrees) + (jump-why uint64) + (penetrated-by-all penetrate) + (penetrated-flinch penetrate) + (penetrated-knocked penetrate) + (reaction-time time-frame) + (notice-time time-frame) + (state-timeout time-frame) + (auto-reset-penetrate-time time-frame) + (hit-focus-time time-frame) + (last-draw-time time-frame) + (starting-time time-frame) + (fated-time time-frame) + (focus-pos vector :inline) + (event-param-point vector :inline) + (jump-dest vector :inline :overlay-at event-param-point) + (focus enemy-focus :inline) + (incoming enemy-attack-info :inline) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (neck joint-mod) + (on-notice symbol) + (on-active symbol) + (on-hostile symbol) + (on-death symbol) + (idle-anim-player idle-control :inline) + (rand-gen symbol) ) - :heap-base #x1a0 - :method-count-assert 137 - :size-assert #x214 - :flag-assert #x8901a00214 + (:state-methods + dormant + dormant-aware + hit + knocked + idle + active + notice + flee + stare + hostile + victory + die + die-falling + die-fast + directed + jump + jump-blocked + ambush + view-anims + ) (:methods - (dormant () _type_ :state 27) - (dormant-aware () _type_ :state 28) - (hit () _type_ :state 29) - (knocked () _type_ :state 30) - (idle () _type_ :state 31) - (active () _type_ :state 32) - (notice () _type_ :state 33) - (flee () _type_ :state 34) - (stare () _type_ :state 35) - (hostile () _type_ :state 36) - (victory () _type_ :state 37) - (die () _type_ :state 38) - (die-falling () _type_ :state 39) - (die-fast () _type_ :state 40) - (directed () _type_ :state 41) - (jump () _type_ :state 42) - (jump-blocked () _type_ :state 43) - (ambush () _type_ :state 44) - (view-anims () _type_ :state 45) - (enemy-method-46 (_type_ int) none 46) - (enemy-method-47 (_type_ vector) float 47) - (take-damage-from-attack (_type_ process event-message-block) int 48) - (enemy-method-49 (_type_) time-frame :behavior enemy 49) - (enemy-method-50 (_type_ vector) vector 50) - (enemy-method-51 (_type_) float 51) - (enemy-method-52 (_type_ vector) none 52) - (enemy-method-53 (_type_ process-focusable) symbol 53) - (enemy-method-54 (_type_) enemy-flag 54) - (track-target! (_type_) none 55) - (damage-amount-from-attack (_type_ process event-message-block) int 56) - (update-target-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware 57) - (enemy-method-58 (_type_ process event-message-block) symbol 58) - (get-penetrate-info (_type_) penetrate 59) - (coin-flip? (_type_) symbol 60) - (enemy-method-61 (_type_ int) int :behavior enemy 61) - (enemy-method-62 (_type_) none 62) - (enemy-method-63 (_type_ process-focusable enemy-aware) symbol 63) - (enemy-method-64 (_type_) none 64) - (enemy-method-65 (_type_) none 65) - (go-ambush (_type_) object 66) - (go-stare (_type_) object 67) - (go-stare2 (_type_) object 68) - (go-directed (_type_) object 69) - (go-hostile (_type_) object 70) - (go-flee (_type_) object 71) - (react-to-focus (_type_) object 72) - (kill-prefer-falling (_type_) object 73) - (general-event-handler (_type_ process int symbol event-message-block) object 74) - (enemy-method-75 (_type_ process event-message-block) object 75) - (enemy-method-76 (_type_ process event-message-block) symbol 76) - (enemy-method-77 (_type_ (pointer float)) symbol 77) - (enemy-method-78 (_type_ (pointer float)) symbol 78) - (enemy-method-79 (_type_ int enemy-knocked-info) symbol 79) - (enemy-method-80 (_type_ enemy-knocked-info) symbol 80) - (enemy-method-81 (_type_) symbol 81) - (enemy-method-82 (_type_ enemy-jump-info) symbol 82) - (enemy-method-83 (_type_ enemy-jump-info) none 83) - (enemy-method-84 (_type_ enemy-jump-info) none 84) - (enemy-method-85 (_type_) float 85) - (enemy-method-86 (_type_) symbol 86) - (enemy-method-87 (_type_ enemy-jump-info) symbol 87) - (enemy-method-88 (_type_ enemy-jump-info) symbol 88) - (enemy-method-89 (_type_ enemy-jump-info) symbol 89) - (enemy-method-90 (_type_ int enemy-jump-info) symbol 90) - (enemy-method-91 (_type_ int enemy-jump-info) none 91) - (enemy-method-92 (_type_ int nav-poly) none 92) - (enemy-method-93 (_type_) none 93) - (enemy-method-94 (_type_ vector float) symbol 94) - (enemy-method-95 (_type_ vector float) symbol 95) - (enemy-method-96 (_type_ float symbol) symbol 96) - (enemy-method-97 (_type_) process 97) - (in-aggro-range? (_type_ process-focusable vector) symbol 98) - (enemy-method-99 (_type_ process-focusable) symbol 99) - (enemy-method-100 (_type_) symbol 100) - (enemy-method-101 (_type_) none 101) - (enemy-method-102 (_type_) symbol 102) - (enemy-method-103 (_type_) collide-spec 103) - (enemy-method-104 (_type_ process touching-shapes-entry uint) symbol :behavior process 104) - (enemy-method-105 (_type_ process) enemy-flag 105) - (enemy-method-106 (_type_ process object int attack-info) none :behavior enemy 106) - (get-enemy-target (_type_) process-focusable 107) - (enemy-method-108 (_type_ enemy event-message-block) int 108) - (look-at-target! (_type_ enemy-flag) none 109) - (stop-looking-at-target! (_type_) none 110) - (enemy-method-111 (_type_) none :behavior enemy 111) - (set-enemy-info! (_type_ enemy-info) none 112) - (init-enemy-behaviour-and-stats! (_type_ enemy-info) none 113) - (init-enemy-collision! (_type_) none 114) - (init-enemy! (_type_) none 115) - (go-idle (_type_) none 116) - (get-rand-float (_type_) float 117) - (get-rand-float-range (_type_ float float) float 118) - (get-rand-int (_type_ int) int 119) - (enemy-method-120 (_type_ int int) int 120) - (get-rand-int-range (_type_ int int) int 121) - (rng-hit? (_type_ float) symbol 122) - (enemy-method-123 (_type_ float) symbol 123) - (enemy-method-124 (_type_) collide-spec 124) - (enemy-method-125 (_type_ collide-query collide-spec float float float) pat-surface 125) - (enemy-above-ground? (_type_ collide-query vector collide-spec float float float) symbol 126) - (enemy-method-127 (_type_ float float symbol collide-spec) symbol 127) - (enemy-method-128 (_type_ vector move-above-ground-params) none 128) - (enemy-method-129 (_type_) none 129) - (enemy-method-130 (_type_ float) symbol 130) - (enemy-method-131 (_type_ int) uint 131) - (dispose! (_type_) none 132) - (enemy-method-133 (_type_) symbol 133) - (enemy-method-134 (_type_ process attack-info) process-focusable 134) - (enemy-method-135 (_type_ int) sound-id 135) - (enemy-method-136 (_type_) enemy-flag 136) + (enemy-method-46 (_type_ int) none) + (enemy-method-47 (_type_ vector) float) + (take-damage-from-attack (_type_ process event-message-block) int) + (enemy-method-49 (_type_) time-frame :behavior enemy) + (enemy-method-50 (_type_ vector) vector) + (enemy-method-51 (_type_) float) + (enemy-method-52 (_type_ vector) none) + (enemy-method-53 (_type_ process-focusable) symbol) + (enemy-method-54 (_type_) enemy-flag) + (track-target! (_type_) none) + (damage-amount-from-attack (_type_ process event-message-block) int) + (update-target-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware) + (enemy-method-58 (_type_ process event-message-block) symbol) + (get-penetrate-info (_type_) penetrate) + (coin-flip? (_type_) symbol) + (enemy-method-61 (_type_ int) int :behavior enemy) + (enemy-method-62 (_type_) none) + (enemy-method-63 (_type_ process-focusable enemy-aware) symbol) + (enemy-method-64 (_type_) none) + (enemy-method-65 (_type_) none) + (go-ambush (_type_) object) + (go-stare (_type_) object) + (go-stare2 (_type_) object) + (go-directed (_type_) object) + (go-hostile (_type_) object) + (go-flee (_type_) object) + (react-to-focus (_type_) object) + (kill-prefer-falling (_type_) object) + (general-event-handler (_type_ process int symbol event-message-block) object) + (enemy-method-75 (_type_ process event-message-block) object) + (enemy-method-76 (_type_ process event-message-block) symbol) + (enemy-method-77 (_type_ (pointer float)) symbol) + (enemy-method-78 (_type_ (pointer float)) symbol) + (enemy-method-79 (_type_ int enemy-knocked-info) symbol) + (enemy-method-80 (_type_ enemy-knocked-info) symbol) + (enemy-method-81 (_type_) symbol) + (enemy-method-82 (_type_ enemy-jump-info) symbol) + (enemy-method-83 (_type_ enemy-jump-info) none) + (enemy-method-84 (_type_ enemy-jump-info) none) + (enemy-method-85 (_type_) float) + (enemy-method-86 (_type_) symbol) + (enemy-method-87 (_type_ enemy-jump-info) symbol) + (enemy-method-88 (_type_ enemy-jump-info) symbol) + (enemy-method-89 (_type_ enemy-jump-info) symbol) + (enemy-method-90 (_type_ int enemy-jump-info) symbol) + (enemy-method-91 (_type_ int enemy-jump-info) none) + (enemy-method-92 (_type_ int nav-poly) none) + (enemy-method-93 (_type_) none) + (enemy-method-94 (_type_ vector float) symbol) + (enemy-method-95 (_type_ vector float) symbol) + (enemy-method-96 (_type_ float symbol) symbol) + (enemy-method-97 (_type_) process) + (in-aggro-range? (_type_ process-focusable vector) symbol) + (enemy-method-99 (_type_ process-focusable) symbol) + (enemy-method-100 (_type_) symbol) + (enemy-method-101 (_type_) none) + (enemy-method-102 (_type_) symbol) + (enemy-method-103 (_type_) collide-spec) + (enemy-method-104 (_type_ process touching-shapes-entry uint) symbol :behavior process) + (enemy-method-105 (_type_ process) enemy-flag) + (enemy-method-106 (_type_ process object int attack-info) none :behavior enemy) + (get-enemy-target (_type_) process-focusable) + (enemy-method-108 (_type_ enemy event-message-block) int) + (look-at-target! (_type_ enemy-flag) none) + (stop-looking-at-target! (_type_) none) + (enemy-method-111 (_type_) none :behavior enemy) + (set-enemy-info! (_type_ enemy-info) none) + (init-enemy-behaviour-and-stats! (_type_ enemy-info) none) + (init-enemy-collision! (_type_) none) + (init-enemy! (_type_) none) + (go-idle (_type_) none) + (get-rand-float (_type_) float) + (get-rand-float-range (_type_ float float) float) + (get-rand-int (_type_ int) int) + (enemy-method-120 (_type_ int int) int) + (get-rand-int-range (_type_ int int) int) + (rng-hit? (_type_ float) symbol) + (enemy-method-123 (_type_ float) symbol) + (enemy-method-124 (_type_) collide-spec) + (enemy-method-125 (_type_ collide-query collide-spec float float float) pat-surface) + (enemy-above-ground? (_type_ collide-query vector collide-spec float float float) symbol) + (enemy-method-127 (_type_ float float symbol collide-spec) symbol) + (enemy-method-128 (_type_ vector move-above-ground-params) none) + (enemy-method-129 (_type_) none) + (enemy-method-130 (_type_ float) symbol) + (enemy-method-131 (_type_ int) uint) + (dispose! (_type_) none) + (enemy-method-133 (_type_) symbol) + (enemy-method-134 (_type_ process attack-info) process-focusable) + (enemy-method-135 (_type_ int) sound-id) + (enemy-method-136 (_type_) enemy-flag) ) ) (deftype anim-info (structure) - ((anim-index int32 :offset-assert 0) - (travel-speed meters :offset-assert 4) + ((anim-index int32) + (travel-speed meters) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) -(defmethod try-update-focus enemy-focus ((this enemy-focus) (arg0 process-focusable) (arg1 enemy)) +(defmethod try-update-focus ((this enemy-focus) (arg0 process-focusable) (arg1 enemy)) (let* ((t9-0 (method-of-type focus try-update-focus)) (s3-0 (t9-0 this arg0)) ) @@ -449,7 +423,7 @@ ) ) -(defmethod enemy-focus-method-13 enemy-focus ((this enemy-focus) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-focus-method-13 ((this enemy-focus) (arg0 process-focusable) (arg1 enemy-aware)) (let* ((t9-0 (method-of-type focus try-update-focus)) (v0-0 (t9-0 this arg0)) ) @@ -462,7 +436,7 @@ ) ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod clear-focused enemy-focus ((this enemy-focus)) +(defmethod clear-focused ((this enemy-focus)) (let ((t9-0 (method-of-type focus clear-focused))) (t9-0 this) ) diff --git a/goal_src/jak2/engine/ai/enemy.gc b/goal_src/jak2/engine/ai/enemy.gc index 2b83f0a1d7f..d547db63b63 100644 --- a/goal_src/jak2/engine/ai/enemy.gc +++ b/goal_src/jak2/engine/ai/enemy.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod copy-enemy-info! enemy-info ((this enemy-info) (obj-to-copy enemy-info)) +(defmethod copy-enemy-info! ((this enemy-info) (obj-to-copy enemy-info)) "Copies the given [[enemy-info]] into the current [[enemy-info]]" (mem-copy! (&-> this type) (&-> obj-to-copy type) 384) 0 @@ -24,40 +24,40 @@ ) ) -(defmethod relocate enemy ((this enemy) (arg0 int)) +(defmethod relocate ((this enemy) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) (call-parent-method this arg0) ) -(defmethod get-rand-float enemy ((this enemy)) +(defmethod get-rand-float ((this enemy)) "@returns the result of calling [[rand-vu]]" (rand-vu) ) -(defmethod get-rand-float-range enemy ((this enemy) (low float) (high float)) +(defmethod get-rand-float-range ((this enemy) (low float) (high float)) "@param low The lower bound of the range (inclusive) @param high The upper bound of the range (exclusive) @returns A random float in the specified range" (+ low (* (rand-vu) (- high low))) ) -(defmethod get-rand-int enemy ((this enemy) (high int)) +(defmethod get-rand-int ((this enemy) (high int)) "@param high The upper bound of the range (exclusive) @returns a random integer in the range 0 to `high` @see [[rand-vu]]" (the int (* (rand-vu) (the float high))) ) -(defmethod get-rand-int-range enemy ((this enemy) (low int) (high int)) +(defmethod get-rand-int-range ((this enemy) (low int) (high int)) "@param low The lower bound of the range (inclusive) @param high The upper bound of the range (exclusive) @returns A random integer in the specified range" (+ low (the int (* (rand-vu) (the float (+ (- 1 low) high))))) ) -(defmethod rng-hit? enemy ((this enemy) (chance float)) +(defmethod rng-hit? ((this enemy) (chance float)) "TODO - not the best name @param chance The value to compare ([[>=]]) with the result from [[rand-vu]]. @returns If `chance` is greater than the random draw" @@ -65,7 +65,7 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod enemy-method-120 enemy ((this enemy) (arg0 int) (arg1 int)) +(defmethod enemy-method-120 ((this enemy) (arg0 int) (arg1 int)) "TODO" (let ((v1-0 0) (s5-0 0) @@ -105,7 +105,7 @@ ) ) -(defmethod enemy-method-123 enemy ((this enemy) (arg0 float)) +(defmethod enemy-method-123 ((this enemy) (arg0 float)) "TODO" (let* ((v1-5 (-> *display* frames (-> *display* last-screen) run-time)) (f1-2 (fmax 0.0 (fmin 1.0 (* 0.001 (+ -7000.0 (the float v1-5)))))) @@ -114,13 +114,13 @@ ) ) -(defmethod coin-flip? enemy ((this enemy)) +(defmethod coin-flip? ((this enemy)) "@returns The result of a 50/50 RNG roll" (zero? (get-rand-int this 2)) ) ;; WARN: disable def twice: 40. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod run-logic? enemy ((this enemy)) +(defmethod run-logic? ((this enemy)) (cond ((logtest? (-> this mask) (process-mask actor-pause)) (let ((draw (-> this draw))) @@ -144,12 +144,12 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-53 enemy ((this enemy) (proc-focus process-focusable)) +(defmethod enemy-method-53 ((this enemy) (proc-focus process-focusable)) "TODO" (the-as symbol (and proc-focus (!= this proc-focus) (collide-check? (-> this focus) proc-focus))) ) -(defmethod get-trans enemy ((this enemy) (arg0 int)) +(defmethod get-trans ((this enemy) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (let ((s4-0 (-> this root))) (cond @@ -175,7 +175,7 @@ ) ) -(defmethod enemy-method-124 enemy ((this enemy)) +(defmethod enemy-method-124 ((this enemy)) "TODO" (let* ((v1-0 (-> this enemy-info)) (v0-0 (if (logtest? (enemy-flag use-trigger) (-> this enemy-flags)) @@ -189,17 +189,17 @@ ) ) -(defmethod get-penetrate-info enemy ((this enemy)) +(defmethod get-penetrate-info ((this enemy)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (penetrated-by-all&hit-points->penetrated-by (-> this penetrated-by-all) (-> this hit-points)) ) -(defmethod get-water-height enemy ((this enemy)) +(defmethod get-water-height ((this enemy)) (-> this water-surface-height) ) -(defmethod enemy-method-54 enemy ((this enemy)) +(defmethod enemy-method-54 ((this enemy)) (let ((s4-0 (-> this root))) (when (>= (-> this water-max-height) (-> s4-0 trans y)) (let ((s5-0 (new 'stack-no-clear 'water-info))) @@ -285,7 +285,7 @@ ) ) -(defmethod track-target! enemy ((self enemy)) +(defmethod track-target! ((self enemy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -339,7 +339,7 @@ (none) ) -(defmethod enemy-method-136 enemy ((this enemy)) +(defmethod enemy-method-136 ((this enemy)) (when (or (time-elapsed? (-> this hit-focus-time) (seconds 2)) (and (handle->process (-> this focus handle)) (not (logtest? (-> (the-as process-focusable (handle->process (-> this focus handle))) focus-status) @@ -385,7 +385,7 @@ ) ;; WARN: Return type mismatch process vs process-focusable. -(defmethod get-enemy-target enemy ((this enemy)) +(defmethod get-enemy-target ((this enemy)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" (let ((v0-0 (handle->process (-> this focus handle)))) (if (and v0-0 @@ -400,14 +400,14 @@ ) ) -(defmethod enemy-method-63 enemy ((this enemy) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this enemy) (arg0 process-focusable) (arg1 enemy-aware)) (if arg1 (enemy-focus-method-13 (-> this focus) arg0 arg1) (try-update-focus (-> this focus) arg0 this) ) ) -(defmethod enemy-method-62 enemy ((this enemy)) +(defmethod enemy-method-62 ((this enemy)) (when (not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags))) (let* ((s4-0 (handle->process (-> this incoming attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) @@ -425,7 +425,7 @@ (none) ) -(defmethod enemy-method-108 enemy ((this enemy) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 ((this enemy) (arg0 enemy) (arg1 event-message-block)) (let ((s4-0 (the-as touching-shapes-entry (-> arg1 param 0)))) (when (and s4-0 (and (logtest? (-> this incoming penetrate-using) 4096) @@ -463,7 +463,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-64 enemy ((this enemy)) +(defmethod enemy-method-64 ((this enemy)) (let ((v1-1 (-> this root root-prim))) (set! (-> v1-1 prim-core collide-as) (collide-spec)) (set! (-> v1-1 prim-core collide-with) (collide-spec)) @@ -476,7 +476,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-65 enemy ((this enemy)) +(defmethod enemy-method-65 ((this enemy)) (let ((v1-1 (-> this root root-prim))) (set! (-> v1-1 prim-core collide-as) (collide-spec)) (set! (-> v1-1 prim-core collide-with) (collide-spec)) @@ -488,31 +488,31 @@ (none) ) -(defmethod go-stare enemy ((this enemy)) +(defmethod go-stare ((this enemy)) (go (method-of-object this stare)) ) -(defmethod go-stare2 enemy ((this enemy)) +(defmethod go-stare2 ((this enemy)) (go (method-of-object this stare)) ) -(defmethod go-hostile enemy ((this enemy)) +(defmethod go-hostile ((this enemy)) (go (method-of-object this hostile)) ) -(defmethod go-ambush enemy ((this enemy)) +(defmethod go-ambush ((this enemy)) (go (method-of-object this ambush)) ) -(defmethod go-flee enemy ((this enemy)) +(defmethod go-flee ((this enemy)) (go (method-of-object this flee)) ) -(defmethod go-directed enemy ((this enemy)) +(defmethod go-directed ((this enemy)) (go (method-of-object this directed)) ) -(defmethod react-to-focus enemy ((this enemy)) +(defmethod react-to-focus ((this enemy)) "@TODO - flesh out docs" (let ((s5-0 (-> this focus aware))) (cond @@ -536,7 +536,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 enemy ((this enemy)) +(defmethod enemy-method-93 ((this enemy)) (if (logtest? (enemy-flag alert) (-> this enemy-flags)) (go-directed this) (react-to-focus this) @@ -544,7 +544,7 @@ (none) ) -(defmethod kill-prefer-falling enemy ((this enemy)) +(defmethod kill-prefer-falling ((this enemy)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (if (-> this enemy-info use-die-falling) (go (method-of-object this die-falling)) @@ -552,7 +552,7 @@ ) ) -(defmethod enemy-method-135 enemy ((this enemy) (arg0 int)) +(defmethod enemy-method-135 ((this enemy) (arg0 int)) (let ((gp-0 (make-u128 0 0))) (let ((v1-0 arg0)) (cond @@ -570,7 +570,7 @@ ) ) -(defmethod enemy-method-94 enemy ((this enemy) (arg0 vector) (arg1 float)) +(defmethod enemy-method-94 ((this enemy) (arg0 vector) (arg1 float)) (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -583,13 +583,13 @@ ) ) -(defmethod enemy-method-95 enemy ((this enemy) (arg0 vector) (arg1 float)) +(defmethod enemy-method-95 ((this enemy) (arg0 vector) (arg1 float)) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans)))) (enemy-method-94 this v1-1 arg1) ) ) -(defmethod enemy-method-96 enemy ((this enemy) (arg0 float) (arg1 symbol)) +(defmethod enemy-method-96 ((this enemy) (arg0 float) (arg1 symbol)) (let ((a0-2 (handle->process (-> this focus handle)))) (cond (a0-2 @@ -607,7 +607,7 @@ ) ) -(defmethod enemy-method-104 enemy ((this enemy) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ((this enemy) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (let ((v1-1 (-> this enemy-info attack-damage))) (if (and (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) (= v1-1 1)) (set! v1-1 2) @@ -627,7 +627,7 @@ ) ) -(defmethod enemy-method-105 enemy ((this enemy) (arg0 process)) +(defmethod enemy-method-105 ((this enemy) (arg0 process)) (when (logtest? (process-mask target bot) (-> arg0 mask)) (set! (-> this root penetrated-by) (the-as penetrate -1)) (enemy-method-49 this) @@ -655,7 +655,7 @@ ) ) -(defmethod enemy-method-49 enemy ((this enemy)) +(defmethod enemy-method-49 ((this enemy)) (logior! (-> this enemy-flags) (enemy-flag attackable-backup)) (let ((v0-0 (current-time))) (set! (-> this auto-reset-penetrate-time) v0-0) @@ -663,7 +663,7 @@ ) ) -(defmethod enemy-method-50 enemy ((this enemy) (arg0 vector)) +(defmethod enemy-method-50 ((this enemy) (arg0 vector)) (set! (-> arg0 quad) (-> this incoming attack-direction quad)) (let ((v1-1 arg0)) (when (= (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))) 0.0) @@ -676,7 +676,7 @@ ) ;; WARN: Return type mismatch int vs uint. -(defmethod enemy-method-131 enemy ((this enemy) (arg0 int)) +(defmethod enemy-method-131 ((this enemy) (arg0 int)) (the-as uint (cond ((logtest? arg0 1024) 7 @@ -706,7 +706,7 @@ ) ) -(defmethod enemy-method-106 enemy ((this enemy) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 ((this enemy) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (set! (-> this incoming penetrate-using) (the-as uint arg2)) (set! (-> this incoming attack-id) (-> arg3 id)) (let ((v1-3 (if (logtest? (attack-mask knock) (-> arg3 mask)) @@ -749,7 +749,7 @@ (none) ) -(defmethod look-at-target! enemy ((this enemy) (arg0 enemy-flag)) +(defmethod look-at-target! ((this enemy) (arg0 enemy-flag)) "Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available @param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details" (case arg0 @@ -769,7 +769,7 @@ (none) ) -(defmethod stop-looking-at-target! enemy ((this enemy)) +(defmethod stop-looking-at-target! ((this enemy)) "Will unset [[enemy-flag::death-start]] and [[enemy-flag::lock-focus]] and call [[joint-mod::shut-down]] if applicable" (when (nonzero? (-> this neck)) (logclear! (-> this enemy-flags) (enemy-flag lock-focus death-start)) @@ -779,7 +779,7 @@ (none) ) -(defmethod enemy-method-125 enemy ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) (let ((v0-1 (-> arg0 best-other-tri pat))) (set! (-> this root ground-pat) v0-1) @@ -788,13 +788,13 @@ ) ) -(defmethod enemy-above-ground? enemy ((this enemy) (arg0 collide-query) (arg1 vector) (arg2 collide-spec) (arg3 float) (arg4 float) (arg5 float)) +(defmethod enemy-above-ground? ((this enemy) (arg0 collide-query) (arg1 vector) (arg2 collide-spec) (arg3 float) (arg4 float) (arg5 float)) "@returns if the enemy is above the ground or not @see [[above-ground?]]" (above-ground? (-> this root) arg0 arg1 arg2 arg3 arg4 arg5) ) -(defmethod enemy-method-127 enemy ((this enemy) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) +(defmethod enemy-method-127 ((this enemy) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) (cond ((enemy-method-125 this s4-0 arg3 arg0 arg1 1024.0) @@ -858,7 +858,7 @@ ) ) -(defmethod enemy-method-128 enemy ((this enemy) (arg0 vector) (arg1 move-above-ground-params)) +(defmethod enemy-method-128 ((this enemy) (arg0 vector) (arg1 move-above-ground-params)) (let ((gp-0 (-> this root))) (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) @@ -957,7 +957,7 @@ (none) ) -(defmethod enemy-method-111 enemy ((this enemy)) +(defmethod enemy-method-111 ((this enemy)) (let ((v1-0 (-> this root))) (when (logtest? (-> v1-0 status) (collide-status touch-surface)) (let ((f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 (-> this enemy-info friction))))))) @@ -970,25 +970,25 @@ (none) ) -(defmethod init-enemy-collision! enemy ((this enemy)) +(defmethod init-enemy-collision! ((this enemy)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" 0 (none) ) -(defmethod init-enemy! enemy ((this enemy)) +(defmethod init-enemy! ((this enemy)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle enemy ((this enemy)) +(defmethod go-idle ((this enemy)) (go (method-of-object this idle)) (none) ) -(defmethod set-enemy-info! enemy ((this enemy) (arg0 enemy-info)) +(defmethod set-enemy-info! ((this enemy) (arg0 enemy-info)) "In addition to setting the `enemy-info`, also init the `neck-joint` if applicable from it @param info Set `enemy-info` accordingly" (set! (-> this enemy-info) arg0) @@ -1007,7 +1007,7 @@ (none) ) -(defmethod init-enemy-behaviour-and-stats! enemy ((this enemy) (arg0 enemy-info)) +(defmethod init-enemy-behaviour-and-stats! ((this enemy) (arg0 enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (local-vars (sv-16 res-tag)) (when (coin-flip? this) @@ -1217,7 +1217,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! enemy ((this enemy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this enemy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1276,7 +1276,7 @@ This commonly includes things such as: (none) ) -(defmethod in-aggro-range? enemy ((this enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this enemy) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -1285,11 +1285,11 @@ This commonly includes things such as: #t ) -(defmethod enemy-method-99 enemy ((this enemy) (arg0 process-focusable)) +(defmethod enemy-method-99 ((this enemy) (arg0 process-focusable)) #f ) -(defmethod reset-to-collide-spec enemy-focus ((this enemy-focus) (arg0 collide-spec)) +(defmethod reset-to-collide-spec ((this enemy-focus) (arg0 collide-spec)) (let ((t9-0 (method-of-type focus reset-to-collide-spec))) (t9-0 this arg0) ) @@ -1300,7 +1300,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch process vs none. ;; WARN: Function (method 129 enemy) has a return type of none, but the expression builder found a return statement. -(defmethod enemy-method-129 enemy ((this enemy)) +(defmethod enemy-method-129 ((this enemy)) (let ((gp-0 (-> this focus))) (let ((a1-0 (handle->process (-> gp-0 handle)))) (when a1-0 @@ -1345,7 +1345,7 @@ This commonly includes things such as: (none) ) -(defmethod enemy-method-97 enemy ((this enemy)) +(defmethod enemy-method-97 ((this enemy)) (let ((s4-0 (-> this focus collide-with)) (gp-0 (new 'stack-no-clear 'enemy-best-focus)) ) @@ -1446,7 +1446,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! enemy ((this enemy) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod update-target-awareness! ((this enemy) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! @TODO - flesh out docs @returns the value that sets `aware`" @@ -1522,7 +1522,7 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-130 enemy ((this enemy) (arg0 float)) +(defmethod enemy-method-130 ((this enemy) (arg0 float)) (let* ((v1-0 (-> this fact)) (a2-0 (-> v1-0 trig-mask-count)) (a3-0 (-> v1-0 trig-mask)) @@ -1555,7 +1555,7 @@ This commonly includes things such as: #f ) -(defmethod enemy-method-61 enemy ((this enemy) (arg0 int)) +(defmethod enemy-method-61 ((this enemy) (arg0 int)) (let ((v1-1 (< 1 arg0))) (cond (v1-1 @@ -1587,7 +1587,7 @@ This commonly includes things such as: ) ) -(defmethod general-event-handler enemy ((this enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (s5-5 rgbaf) (sv-432 process) (sv-448 event-message-block)) @@ -1950,7 +1950,7 @@ This commonly includes things such as: ) ) -(defmethod damage-amount-from-attack enemy ((this enemy) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this enemy) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let ((v1-0 (the-as attack-info (-> arg1 param 1)))) (if (logtest? (attack-mask damage) (-> v1-0 mask)) @@ -1960,7 +1960,7 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-58 enemy ((this enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 ((this enemy) (arg0 process) (arg1 event-message-block)) (let ((v1-0 (-> this incoming penetrate-using))) (cond ((logtest? (the-as penetrate v1-0) (-> this penetrated-flinch)) @@ -1976,7 +1976,7 @@ This commonly includes things such as: ) ) -(defmethod take-damage-from-attack enemy ((this enemy) (arg0 process) (arg1 event-message-block)) +(defmethod take-damage-from-attack ((this enemy) (arg0 process) (arg1 event-message-block)) (let* ((v1-1 (damage-amount-from-attack this arg0 arg1)) (s5-0 (-> this hit-points)) (s4-1 (max 0 (- s5-0 v1-1))) @@ -2002,11 +2002,11 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-134 enemy ((this enemy) (arg0 process) (arg1 attack-info)) +(defmethod enemy-method-134 ((this enemy) (arg0 process) (arg1 attack-info)) (find-offending-process-focusable arg0 arg1) ) -(defmethod enemy-method-75 enemy ((this enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-75 ((this enemy) (arg0 process) (arg1 event-message-block)) (let* ((touch-entry (the-as touching-shapes-entry (-> arg1 param 0))) (s2-0 arg0) (s3-0 (if (type? s2-0 process-focusable) @@ -2056,7 +2056,7 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-76 enemy ((this enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 ((this enemy) (arg0 process) (arg1 event-message-block)) (let ((s4-0 (-> arg1 param 0))) (when s4-0 (when (or (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) @@ -2129,7 +2129,7 @@ This commonly includes things such as: (none) ) -(defmethod enemy-method-47 enemy ((this enemy) (arg0 vector)) +(defmethod enemy-method-47 ((this enemy) (arg0 vector)) (let* ((f2-0 0.8) (f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 f2-0))))) ) @@ -2521,12 +2521,12 @@ This commonly includes things such as: :post enemy-simple-post ) -(defmethod enemy-method-82 enemy ((this enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-82 ((this enemy) (arg0 enemy-jump-info)) "@abstract" #f ) -(defmethod enemy-method-83 enemy ((this enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-83 ((this enemy) (arg0 enemy-jump-info)) (set! (-> arg0 flags) (the-as uint 1)) (set! (-> arg0 anim-speed) (get-rand-float-range this 0.9 1.1)) (set! (-> arg0 hang-time) 0) @@ -2549,7 +2549,7 @@ This commonly includes things such as: (none) ) -(defmethod enemy-method-84 enemy ((this enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 ((this enemy) (arg0 enemy-jump-info)) (let* ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos))) (f0-2 (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0))) ) @@ -2558,7 +2558,7 @@ This commonly includes things such as: (none) ) -(defmethod enemy-method-86 enemy ((this enemy)) +(defmethod enemy-method-86 ((this enemy)) (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) (let ((a1-0 (new 'stack-no-clear 'collide-query))) @@ -2569,7 +2569,7 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-85 enemy ((this enemy)) +(defmethod enemy-method-85 ((this enemy)) (let* ((v1-0 (-> this root)) (f0-0 (-> v1-0 gspot-pos y)) ) @@ -2580,14 +2580,14 @@ This commonly includes things such as: (set! (-> this root transv y) 0.0) ) -(defmethod enemy-method-92 enemy ((this enemy) (arg0 int) (arg1 nav-poly)) +(defmethod enemy-method-92 ((this enemy) (arg0 int) (arg1 nav-poly)) "TODO - nav-poly is a guess @abstract" 0 (none) ) -(defmethod enemy-method-91 enemy ((this enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-91 ((this enemy) (arg0 int) (arg1 enemy-jump-info)) (case arg0 ((2 3) (logior! (-> this enemy-flags) (enemy-flag directed)) @@ -2606,7 +2606,7 @@ This commonly includes things such as: (none) ) -(defmethod enemy-method-89 enemy ((this enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this enemy) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -2624,7 +2624,7 @@ This commonly includes things such as: #t ) -(defmethod enemy-method-87 enemy ((this enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this enemy) (arg0 enemy-jump-info)) (let ((s5-0 (-> this draw art-group data (-> this enemy-info jump-in-air-anim)))) (let ((v1-6 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) @@ -2655,7 +2655,7 @@ This commonly includes things such as: #t ) -(defmethod enemy-method-88 enemy ((this enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this enemy) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -2673,7 +2673,7 @@ This commonly includes things such as: #t ) -(defmethod enemy-method-90 enemy ((this enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 ((this enemy) (arg0 int) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond @@ -2905,7 +2905,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch collide-spec vs none. -(defmethod enemy-method-101 enemy ((this enemy)) +(defmethod enemy-method-101 ((this enemy)) (when (not (logtest? (enemy-flag use-trigger) (-> this enemy-flags))) (logior! (-> this enemy-flags) (enemy-flag use-trigger)) (logclear! (-> this enemy-flags) (enemy-flag directed)) @@ -2914,19 +2914,19 @@ This commonly includes things such as: (none) ) -(defmethod enemy-method-103 enemy ((this enemy)) +(defmethod enemy-method-103 ((this enemy)) (when (logtest? (enemy-flag use-trigger) (-> this enemy-flags)) (logclear! (-> this enemy-flags) (enemy-flag use-trigger directed)) (enemy-method-124 this) ) ) -(defmethod enemy-method-102 enemy ((this enemy)) +(defmethod enemy-method-102 ((this enemy)) #f ) ;; WARN: Return type mismatch vector vs symbol. -(defmethod enemy-method-100 enemy ((this enemy)) +(defmethod enemy-method-100 ((this enemy)) (local-vars (v0-1 vector)) (when (not (-> this enemy-info move-to-ground)) (enemy-method-103 this) @@ -2985,14 +2985,14 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-46 enemy ((this enemy) (arg0 int)) +(defmethod enemy-method-46 ((this enemy) (arg0 int)) "@abstract" 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 enemy ((this enemy) (arg0 vector)) +(defmethod enemy-method-52 ((this enemy) (arg0 vector)) (enemy-method-50 this arg0) (let ((s5-0 (-> this enemy-info))) (case (-> this incoming knocked-type) @@ -3075,7 +3075,7 @@ This commonly includes things such as: (none) ) -(defmethod enemy-method-51 enemy ((this enemy)) +(defmethod enemy-method-51 ((this enemy)) (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) @@ -3123,7 +3123,7 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-77 enemy ((this enemy) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this enemy) (arg0 (pointer float))) (ja-channel-push! 1 0) (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-anim))) (a0-4 (-> this skel root-channel 0)) @@ -3137,7 +3137,7 @@ This commonly includes things such as: #t ) -(defmethod enemy-method-78 enemy ((this enemy) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this enemy) (arg0 (pointer float))) (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-3 (-> this skel root-channel 0)) ) @@ -3150,7 +3150,7 @@ This commonly includes things such as: #t ) -(defmethod enemy-method-80 enemy ((this enemy) (arg0 enemy-knocked-info)) +(defmethod enemy-method-80 ((this enemy) (arg0 enemy-knocked-info)) (let ((gp-0 (-> this root))) (or (>= (-> arg0 on-surface-count) 3) (and (logtest? (-> gp-0 status) (collide-status on-ground)) (>= 16384.0 (-> gp-0 transv y))) @@ -3166,7 +3166,7 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-81 enemy ((this enemy)) +(defmethod enemy-method-81 ((this enemy)) (let ((s5-0 (-> this root)) (a1-0 (new 'stack-no-clear 'collide-query)) (gp-0 #t) @@ -3182,7 +3182,7 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-79 enemy ((this enemy) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this enemy) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond @@ -3407,7 +3407,7 @@ This commonly includes things such as: :post enemy-falling-post ) -(defmethod dispose! enemy ((this enemy)) +(defmethod dispose! ((this enemy)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) (set! (-> this enemy-flags) @@ -3488,7 +3488,7 @@ This commonly includes things such as: :post enemy-simple-post ) -(defmethod enemy-method-133 enemy ((this enemy)) +(defmethod enemy-method-133 ((this enemy)) (let ((s5-0 (-> this root)) (a1-0 (new 'stack-no-clear 'collide-query)) (gp-0 #t) diff --git a/goal_src/jak2/engine/ai/traffic-h.gc b/goal_src/jak2/engine/ai/traffic-h.gc index fc58ba121b6..2588b3121f7 100644 --- a/goal_src/jak2/engine/ai/traffic-h.gc +++ b/goal_src/jak2/engine/ai/traffic-h.gc @@ -94,62 +94,53 @@ (define *race-vehicle-entity* (the-as entity-actor #f)) (deftype traffic-danger-info (structure) - ((sphere sphere :inline :offset-assert 0) - (velocity vector :inline :offset-assert 16) - (handle handle :offset-assert 32) - (notify-radius float :offset-assert 40) - (danger-level float :offset-assert 44) - (decay-rate float :offset-assert 48) - (flags traffic-danger-flags :offset-assert 52) - (danger-type traffic-danger-type :offset-assert 53) + ((sphere sphere :inline) + (velocity vector :inline) + (handle handle) + (notify-radius float) + (danger-level float) + (decay-rate float) + (flags traffic-danger-flags) + (danger-type traffic-danger-type) ) - :method-count-assert 9 - :size-assert #x36 - :flag-assert #x900000036 ) (deftype traffic-suppression-params (structure) - ((bbox bounding-box :inline :offset-assert 0) - (duration time-frame :offset-assert 32) - (id int8 :offset-assert 40) + ((bbox bounding-box :inline) + (duration time-frame) + (id int8) ) - :method-count-assert 13 - :size-assert #x29 - :flag-assert #xd00000029 (:methods - (try-creating-new-suppression-box (_type_) symbol 9) - (create-or-update-suppression-box (_type_) symbol 10) - (has-valid-id? (_type_) none 11) - (kill-suppression-box (_type_) none 12) + (try-creating-new-suppression-box (_type_) symbol) + (create-or-update-suppression-box (_type_) symbol) + (has-valid-id? (_type_) none) + (kill-suppression-box (_type_) none) ) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod has-valid-id? traffic-suppression-params ((this traffic-suppression-params)) +(defmethod has-valid-id? ((this traffic-suppression-params)) (!= (-> this id) -1) (none) ) (deftype traffic-object-spawn-params (structure) - ((object-type traffic-type :offset-assert 0) - (behavior uint64 :offset-assert 8) - (id uint32 :offset-assert 16) - (nav-mesh nav-mesh :offset-assert 20) - (nav-branch nav-branch :offset-assert 24) - (position vector :inline :offset-assert 32) - (rotation quaternion :inline :offset-assert 48) - (velocity vector :inline :offset-assert 64) - (handle handle :offset-assert 80) - (guard-type uint8 :offset-assert 88) - (user-data uint32 :offset-assert 92) - (flags traffic-spawn-flags :offset-assert 96) - (proc process :offset-assert 100) + ((object-type traffic-type) + (behavior uint64) + (id uint32) + (nav-mesh nav-mesh) + (nav-branch nav-branch) + (position vector :inline) + (rotation quaternion :inline) + (velocity vector :inline) + (handle handle) + (guard-type uint8) + (user-data uint32) + (flags traffic-spawn-flags) + (proc process) ) - :method-count-assert 9 - :size-assert #x68 - :flag-assert #x900000068 ) (deftype mystery-traffic-object-spawn-params (structure) diff --git a/goal_src/jak2/engine/ambient/ambient-h.gc b/goal_src/jak2/engine/ambient/ambient-h.gc index 724ee9b891e..02cf86bba87 100644 --- a/goal_src/jak2/engine/ambient/ambient-h.gc +++ b/goal_src/jak2/engine/ambient/ambient-h.gc @@ -21,54 +21,49 @@ ;; DECOMP BEGINS (deftype talker-speech-class (structure) - ((name string :offset-assert 0) - (channel gui-channel :offset-assert 4) - (flags uint8 :offset-assert 5) - (speech uint16 :offset-assert 6) - (text-message text-id :offset-assert 8) - (text-duration uint16 :offset-assert 12) - (delay uint16 :offset-assert 14) - (pos uint16 :offset-assert 16) - (neg uint16 :offset-assert 18) - (on-close pair :offset-assert 20) + ((name string) + (channel gui-channel) + (flags uint8) + (speech uint16) + (text-message text-id) + (text-duration uint16) + (delay uint16) + (pos uint16) + (neg uint16) + (on-close pair) ) :pack-me - :method-count-assert 14 - :size-assert #x18 - :flag-assert #xe00000018 (:methods - (talker-speech-class-method-9 (_type_) symbol 9) - (play-communicator-speech! (_type_) none 10) - (talker-speech-class-method-11 (_type_) none 11) - (talker-speech-class-method-12 (_type_ int) none 12) - (talker-speech-class-method-13 (_type_ int) none 13) + (talker-speech-class-method-9 (_type_) symbol) + (play-communicator-speech! (_type_) none) + (talker-speech-class-method-11 (_type_) none) + (talker-speech-class-method-12 (_type_ int) none) + (talker-speech-class-method-13 (_type_ int) none) ) ) (deftype talker (process) - ((trans vector :inline :offset-assert 128) - (message talker-speech-class :offset-assert 144) - (total-time time-frame :offset-assert 152) - (total-off-time time-frame :offset-assert 160) - (start-time time-frame :offset-assert 168) - (state-time time-frame :offset-assert 176) - (voicebox handle :offset-assert 184) - (voice-id sound-id :offset-assert 192) - (message-id sound-id :offset-assert 196) - (region region :offset-assert 200) - (interp float :offset-assert 204) - (save? symbol :offset-assert 208) + ((trans vector :inline) + (message talker-speech-class) + (total-time time-frame) + (total-off-time time-frame) + (start-time time-frame) + (state-time time-frame) + (voicebox handle) + (voice-id sound-id) + (message-id sound-id) + (region region) + (interp float) + (save? symbol) ) - :heap-base #x60 - :method-count-assert 18 - :size-assert #xd4 - :flag-assert #x12006000d4 + (:state-methods + idle + active + exit + ) (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (exit () _type_ :state 16) - (talker-method-17 (_type_) none 17) + (talker-method-17 (_type_) none) ) ) diff --git a/goal_src/jak2/engine/ambient/ambient.gc b/goal_src/jak2/engine/ambient/ambient.gc index 1ad337542cd..2cfe9de08b3 100644 --- a/goal_src/jak2/engine/ambient/ambient.gc +++ b/goal_src/jak2/engine/ambient/ambient.gc @@ -113,13 +113,13 @@ (-> *talker-speech* 0) ) -(defmethod talker-speech-class-method-9 talker-speech-class ((this talker-speech-class)) +(defmethod talker-speech-class-method-9 ((this talker-speech-class)) (and (>= (-> *game-info* unknown-pad6 (* (-> this speech) 2)) (-> this pos)) (>= (-> this neg) (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1))) ) ) -(defmethod play-communicator-speech! talker-speech-class ((this talker-speech-class)) +(defmethod play-communicator-speech! ((this talker-speech-class)) "Plays the provided [[talker-speech-class]] @TODO - understand the array from [[game-info]] better" (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) (the-as uint #xffff)) @@ -127,13 +127,13 @@ (none) ) -(defmethod talker-speech-class-method-11 talker-speech-class ((this talker-speech-class)) +(defmethod talker-speech-class-method-11 ((this talker-speech-class)) (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) (the-as uint 0)) 0 (none) ) -(defmethod talker-speech-class-method-12 talker-speech-class ((this talker-speech-class) (arg0 int)) +(defmethod talker-speech-class-method-12 ((this talker-speech-class) (arg0 int)) (if (>= arg0 0) (set! (-> *game-info* unknown-pad6 (* (-> this speech) 2)) (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (* (-> this speech) 2))) #xfff0 arg0)) @@ -149,7 +149,7 @@ (none) ) -(defmethod talker-speech-class-method-13 talker-speech-class ((this talker-speech-class) (arg0 int)) +(defmethod talker-speech-class-method-13 ((this talker-speech-class) (arg0 int)) (if (>= arg0 0) (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1))) #xfff0 arg0)) @@ -257,13 +257,13 @@ (none) ) -(defmethod deactivate talker ((this talker)) +(defmethod deactivate ((this talker)) (send-event (handle->process (-> this voicebox)) 'die) (call-parent-method this) (none) ) -(defmethod talker-method-17 talker ((this talker)) +(defmethod talker-method-17 ((this talker)) (let ((gp-0 (new 'stack 'font-context *font-default-matrix* 36 310 0.0 (font-color default) (font-flags shadow kerning)) ) diff --git a/goal_src/jak2/engine/anim/aligner-h.gc b/goal_src/jak2/engine/anim/aligner-h.gc index 11c108d51c3..a4395b9110b 100644 --- a/goal_src/jak2/engine/anim/aligner-h.gc +++ b/goal_src/jak2/engine/anim/aligner-h.gc @@ -37,26 +37,23 @@ ;; DECOMP BEGINS (deftype align-control (basic) - ((flags align-flags :offset-assert 4) - (process process-drawable :offset-assert 8) - (frame-group art-joint-anim :offset-assert 12) - (frame-num float :offset-assert 16) - (matrix matrix 2 :inline :offset-assert 32) - (transform transform 2 :inline :offset-assert 160) - (delta transformq :inline :offset-assert 256) - (last-speed meters :offset-assert 304) - (align transformq :inline :offset 160) + ((flags align-flags) + (process process-drawable) + (frame-group art-joint-anim) + (frame-num float) + (matrix matrix 2 :inline) + (transform transform 2 :inline) + (delta transformq :inline) + (last-speed meters) + (align transformq :inline :overlay-at (-> transform 0 trans data 0)) ) - :method-count-assert 14 - :size-assert #x134 - :flag-assert #xe00000134 (:methods - (new (symbol type process) _type_ 0) - (compute-alignment! (_type_) transformq 9) - (align! (_type_ align-opts float float float) trsqv 10) - (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv :behavior process 11) - (first-transform (_type_) transform 12) - (second-transform (_type_) transform 13) + (new (symbol type process) _type_) + (compute-alignment! (_type_) transformq) + (align! (_type_ align-opts float float float) trsqv) + (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv :behavior process) + (first-transform (_type_) transform) + (second-transform (_type_) transform) ) ) diff --git a/goal_src/jak2/engine/anim/aligner.gc b/goal_src/jak2/engine/anim/aligner.gc index 5a3ee5c9bd6..83695ffa5fa 100644 --- a/goal_src/jak2/engine/anim/aligner.gc +++ b/goal_src/jak2/engine/anim/aligner.gc @@ -11,7 +11,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod compute-alignment! align-control ((this align-control)) +(defmethod compute-alignment! ((this align-control)) (local-vars (a0-10 symbol) (s7-0 none) (ra-0 int)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -131,17 +131,17 @@ ) ;; WARN: Return type mismatch (inline-array transform) vs transform. -(defmethod first-transform align-control ((this align-control)) +(defmethod first-transform ((this align-control)) "@returns The first of the two [[transforms]] held by the object" (the-as transform (-> this transform)) ) -(defmethod second-transform align-control ((this align-control)) +(defmethod second-transform ((this align-control)) "@returns The second of the two [[transforms]] held by the object" (-> this transform 1) ) -(defmethod align! align-control ((this align-control) (options align-opts) (x float) (y float) (z float)) +(defmethod align! ((this align-control) (options align-opts) (x float) (y float) (z float)) "As long as [[align-flags::0]] is not set call [[process-drawable::16]] on the process being controlled using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> @@ -163,7 +163,7 @@ using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> (-> this process root) ) -(defmethod set-and-limit-velocity trsqv ((this trsqv) (unkBitfield int) (limit vector) (arg2 float)) +(defmethod set-and-limit-velocity ((this trsqv) (unkBitfield int) (limit vector) (arg2 float)) "TODO - arg1 is an bitfield of some sort" (let ((transv (-> this transv))) (when (logtest? unkBitfield 4) @@ -184,7 +184,7 @@ using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> this ) -(defmethod align-vel-and-quat-only! align-control ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) +(defmethod align-vel-and-quat-only! ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) (when (not (logtest? (-> this flags) (align-flags disabled))) (let ((s5-0 (-> this delta))) (let ((a0-1 (-> this process root transv))) diff --git a/goal_src/jak2/engine/anim/fma-sphere.gc b/goal_src/jak2/engine/anim/fma-sphere.gc index e0a543f0b12..dd08e62cc0b 100644 --- a/goal_src/jak2/engine/anim/fma-sphere.gc +++ b/goal_src/jak2/engine/anim/fma-sphere.gc @@ -20,27 +20,23 @@ ;; DECOMP BEGINS (deftype fma-sphere (process-drawable) - ((root collide-shape :override) - (first-time? symbol :offset-assert 200) - (mode fma-sphere-mode :offset-assert 204) - (track-handle handle :offset-assert 208) - (track-joint int32 :offset-assert 216) - (attack-id uint32 :offset-assert 220) - (duration time-frame :offset-assert 224) - (sphere sphere :inline :offset-assert 240) - (danger traffic-danger-info :inline :offset-assert 256) + ((root collide-shape :override) + (first-time? symbol) + (mode fma-sphere-mode) + (track-handle handle) + (track-joint int32) + (attack-id uint32) + (duration time-frame) + (sphere sphere :inline) + (danger traffic-danger-info :inline) ) - :heap-base #xc0 - :method-count-assert 21 - :size-assert #x136 - :flag-assert #x1500c00136 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) -(defmethod run-logic? fma-sphere ((this fma-sphere)) +(defmethod run-logic? ((this fma-sphere)) (or (logtest? *display-scene-control* (scene-controls display-controls)) (and *display-nav-marks* (logtest? (-> this mode) (fma-sphere-mode nav))) (logtest? (-> this mode) (fma-sphere-mode deadly-overlap)) diff --git a/goal_src/jak2/engine/anim/joint-exploder.gc b/goal_src/jak2/engine/anim/joint-exploder.gc index 6d48d8430d4..26d64c7b8d4 100644 --- a/goal_src/jak2/engine/anim/joint-exploder.gc +++ b/goal_src/jak2/engine/anim/joint-exploder.gc @@ -9,121 +9,99 @@ ;; DECOMP BEGINS (deftype joint-exploder-tuning (structure) - ((explosion uint64 :offset-assert 0) - (duration time-frame :offset-assert 8) - (gravity float :offset-assert 16) - (rot-speed float :offset-assert 20) - (bounds-inflate float :offset-assert 24) - (max-probe-width float :offset-assert 28) - (max-probe-height float :offset-assert 32) - (max-probe-depth float :offset-assert 36) - (fountain-rand-transv-lo vector :inline :offset-assert 48) - (fountain-rand-transv-hi vector :inline :offset-assert 64) - (away-from-focal-pt vector :inline :offset 48) - (away-from-rand-transv-xz-lo float :offset 64) - (away-from-rand-transv-xz-hi float :offset 68) - (away-from-rand-transv-y-lo float :offset 72) - (away-from-rand-transv-y-hi float :offset 76) - (hit-xz-reaction float :offset-assert 80) - (hit-y-reaction float :offset-assert 84) + ((explosion uint64) + (duration time-frame) + (gravity float) + (rot-speed float) + (bounds-inflate float) + (max-probe-width float) + (max-probe-height float) + (max-probe-depth float) + (fountain-rand-transv-lo vector :inline) + (fountain-rand-transv-hi vector :inline) + (away-from-focal-pt vector :inline :overlay-at fountain-rand-transv-lo) + (away-from-rand-transv-xz-lo float :overlay-at (-> fountain-rand-transv-hi data 0)) + (away-from-rand-transv-xz-hi float :overlay-at (-> fountain-rand-transv-hi data 1)) + (away-from-rand-transv-y-lo float :overlay-at (-> fountain-rand-transv-hi data 2)) + (away-from-rand-transv-y-hi float :overlay-at (-> fountain-rand-transv-hi data 3)) + (hit-xz-reaction float) + (hit-y-reaction float) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 (:methods - (new (symbol type uint) _type_ 0) + (new (symbol type uint) _type_) ) ) (deftype joint-exploder-static-joint-params (structure) - ((joint-index int16 :offset-assert 0) - (parent-joint-index int16 :offset-assert 2) + ((joint-index int16) + (parent-joint-index int16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype joint-exploder-static-params (basic) - ((joints (array joint-exploder-static-joint-params) :offset-assert 4) - (collide-spec uint32 :offset-assert 8) - (art-level symbol :offset-assert 12) + ((joints (array joint-exploder-static-joint-params)) + (collide-spec uint32) + (art-level symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype joint-exploder-joint (structure) - ((next int16 :offset-assert 0) - (prev int16 :offset-assert 2) - (joint-index int16 :offset-assert 4) - (mat matrix :inline :offset-assert 16) - (rmat matrix :inline :offset-assert 80) - (update-rmat matrix :inline :offset-assert 144) - (transv vector :inline :offset-assert 208) - (prev-pos vector :inline :offset-assert 224) + ((next int16) + (prev int16) + (joint-index int16) + (mat matrix :inline) + (rmat matrix :inline) + (update-rmat matrix :inline) + (transv vector :inline) + (prev-pos vector :inline) ) - :method-count-assert 9 - :size-assert #xf0 - :flag-assert #x9000000f0 ) (deftype joint-exploder-joints (basic) - ((num-joints int32 :offset-assert 4) - (joint joint-exploder-joint :inline :dynamic :offset-assert 16) + ((num-joints int32) + (joint joint-exploder-joint :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type joint-exploder-static-params) _type_ 0) + (new (symbol type joint-exploder-static-params) _type_) ) ) (deftype joint-exploder-list (structure) - ((head int32 :offset-assert 0) - (pre-moved? symbol :offset-assert 4) - (bbox-valid? symbol :offset-assert 8) - (probeless? symbol :offset-assert 12) - (bbox bounding-box :inline :offset-assert 16) + ((head int32) + (pre-moved? symbol) + (bbox-valid? symbol) + (probeless? symbol) + (bbox bounding-box :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype joint-exploder (process-drawable) - ((die-if-below-y float :offset-assert 200) - (die-if-beyond-xz-dist-sqrd float :offset-assert 204) - (joints joint-exploder-joints :offset-assert 208) - (static-params joint-exploder-static-params :offset-assert 212) - (anim art-joint-anim :offset-assert 216) - (scale-vector vector :inline :offset-assert 224) - (tuning joint-exploder-tuning :inline :offset-assert 240) - (lists joint-exploder-list 5 :inline :offset-assert 336) + ((die-if-below-y float) + (die-if-beyond-xz-dist-sqrd float) + (joints joint-exploder-joints) + (static-params joint-exploder-static-params) + (anim art-joint-anim) + (scale-vector vector :inline) + (tuning joint-exploder-tuning :inline) + (lists joint-exploder-list 5 :inline) ) - :heap-base #x1c0 - :method-count-assert 30 - :size-assert #x240 - :flag-assert #x1e01c00240 (:methods - (add-joint-to-list (_type_ joint-exploder-list int) int 20) - (update-bbox-for-joint (_type_ joint-exploder-list joint-exploder-joint) none 21) - (do-collision-response (_type_ joint-exploder-list) none 22) - (init-joint-list (_type_) none 23) - (remove-from-list-and-reset (_type_ joint-exploder-list int) int 24) - (final-adjust (_type_ joint-exploder-list int) int 25) - (integrate-and-kill (_type_ joint-exploder-list) none 26) - (remove-joint-from-list (_type_ joint-exploder-list int) int 27) - (adjust-bbox-for-limits-along-axis (_type_ joint-exploder-list int) joint-exploder-list 28) - (adjust-bbox-for-limits (_type_ joint-exploder-list) none 29) + (add-joint-to-list (_type_ joint-exploder-list int) int) + (update-bbox-for-joint (_type_ joint-exploder-list joint-exploder-joint) none) + (do-collision-response (_type_ joint-exploder-list) none) + (init-joint-list (_type_) none) + (remove-from-list-and-reset (_type_ joint-exploder-list int) int) + (final-adjust (_type_ joint-exploder-list int) int) + (integrate-and-kill (_type_ joint-exploder-list) none) + (remove-joint-from-list (_type_ joint-exploder-list int) int) + (adjust-bbox-for-limits-along-axis (_type_ joint-exploder-list int) joint-exploder-list) + (adjust-bbox-for-limits (_type_ joint-exploder-list) none) ) (:states joint-exploder-shatter @@ -132,7 +110,7 @@ ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-exploder-joints ((this joint-exploder-joints)) +(defmethod asize-of ((this joint-exploder-joints)) (the-as int (+ (-> this type size) (* 240 (-> this num-joints)))) ) @@ -176,7 +154,7 @@ (none) ) -(defmethod remove-from-list-and-reset joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod remove-from-list-and-reset ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (let ((v0-0 (remove-joint-from-list this arg0 arg1))) (let* ((v1-1 (-> this joints)) (v1-2 (-> v1-1 joint arg1)) @@ -190,7 +168,7 @@ ) ) -(defmethod remove-joint-from-list joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod remove-joint-from-list ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (let* ((v1-0 (-> this joints)) (a2-1 (-> v1-0 joint arg1)) (a0-4 (-> a2-1 prev)) @@ -221,7 +199,7 @@ ) ) -(defmethod add-joint-to-list joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod add-joint-to-list ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (let* ((v1-0 (-> this joints)) (a3-0 (-> v1-0 joint arg1)) (a0-4 (-> arg0 head)) @@ -236,7 +214,7 @@ ) ) -(defmethod update-bbox-for-joint joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) +(defmethod update-bbox-for-joint ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) (let ((a1-1 (-> arg1 mat trans))) (cond ((-> arg0 bbox-valid?) @@ -253,7 +231,7 @@ (none) ) -(defmethod adjust-bbox-for-limits-along-axis joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod adjust-bbox-for-limits-along-axis ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (local-vars (sv-16 int) (sv-32 int) @@ -375,7 +353,7 @@ ) ;; WARN: Return type mismatch symbol vs int. -(defmethod final-adjust joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod final-adjust ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (local-vars (sv-48 int) (sv-64 (inline-array joint-exploder-list)) (sv-80 joint-exploder-joint)) (set! (-> arg0 bbox-valid?) #f) (let ((s3-0 (-> this joints)) @@ -420,7 +398,7 @@ (the-as int #f) ) -(defmethod adjust-bbox-for-limits joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) +(defmethod adjust-bbox-for-limits ((this joint-exploder) (arg0 joint-exploder-list)) (when (and (-> arg0 bbox-valid?) (>= (-> arg0 head) 0) (not (-> arg0 probeless?))) (let ((a2-0 -1)) (cond @@ -448,7 +426,7 @@ (none) ) -(defmethod integrate-and-kill joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) +(defmethod integrate-and-kill ((this joint-exploder) (arg0 joint-exploder-list)) (set! (-> arg0 bbox-valid?) #f) (set! (-> arg0 pre-moved?) #t) (let ((s4-0 (-> this joints)) @@ -481,7 +459,7 @@ (none) ) -(defmethod do-collision-response joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) +(defmethod do-collision-response ((this joint-exploder) (arg0 joint-exploder-list)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (set! (-> s5-0 collide-with) (the-as collide-spec (-> this static-params collide-spec))) (set! (-> s5-0 ignore-process0) this) @@ -595,7 +573,7 @@ :post ja-post ) -(defmethod init-joint-list joint-exploder ((this joint-exploder)) +(defmethod init-joint-list ((this joint-exploder)) (let ((gp-0 (-> this joints))) (dotimes (s4-0 (-> gp-0 num-joints)) (let ((v1-2 (-> this static-params joints s4-0)) @@ -700,7 +678,7 @@ ) ;; WARN: Return type mismatch process-drawable vs joint-exploder. -(defmethod relocate joint-exploder ((this joint-exploder) (arg0 int)) +(defmethod relocate ((this joint-exploder) (arg0 int)) (if (nonzero? (-> this joints)) (&+! (-> this joints) arg0) ) diff --git a/goal_src/jak2/engine/anim/joint-h.gc b/goal_src/jak2/engine/anim/joint-h.gc index 3f334bc3340..2d3aa7725c1 100644 --- a/goal_src/jak2/engine/anim/joint-h.gc +++ b/goal_src/jak2/engine/anim/joint-h.gc @@ -41,130 +41,112 @@ ;; DECOMP BEGINS (deftype joint-control-channel (structure) - ((parent joint-control :offset-assert 0) - (frame-group art-joint-anim :offset-assert 4) - (frame-num float :offset-assert 8) - (dist meters :offset-assert 12) - (num-func (function joint-control-channel float float float float) :offset-assert 16) - (param float 3 :offset-assert 20) - (frame-interp float 2 :offset-assert 32) - (inspector-amount uint8 :offset-assert 40) - (command joint-control-command :offset-assert 48) - (group-sub-index int8 :offset-assert 56) - (group-size int8 :offset-assert 57) - (eval-time uint32 :offset-assert 60) + ((parent joint-control) + (frame-group art-joint-anim) + (frame-num float) + (dist meters) + (num-func (function joint-control-channel float float float float)) + (param float 3) + (frame-interp float 2) + (inspector-amount uint8) + (command joint-control-command) + (group-sub-index int8) + (group-size int8) + (eval-time uint32) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype top-anim-joint-control (basic) - ((process (pointer process-drawable) :offset-assert 4) - (interp-select uint64 2 :offset-assert 8) - (base-anim basic :offset-assert 24) - (base-anim-speed float :offset-assert 28) - (base-anim-blend float :offset-assert 32) - (interp float :offset-assert 36) - (frame-group art-joint-anim :offset-assert 40) - (frame-group-push art-joint-anim :offset-assert 44) - (frame-num float :offset-assert 48) - (frame-targ art-joint-anim :offset-assert 52) - (frame-speed float :offset-assert 56) - (frame-blend float :offset-assert 60) - (frame-cur-blend float :offset-assert 64) - (frame-start float :offset-assert 68) - (frame-post-blend float :offset-assert 72) - (frame-post-end float :offset-assert 76) - (frame-push-time time-frame :offset-assert 80) - (frame-post-put-away basic :offset-assert 88) - (update-time time-frame :offset-assert 96) + ((process (pointer process-drawable)) + (interp-select uint64 2) + (base-anim basic) + (base-anim-speed float) + (base-anim-blend float) + (interp float) + (frame-group art-joint-anim) + (frame-group-push art-joint-anim) + (frame-num float) + (frame-targ art-joint-anim) + (frame-speed float) + (frame-blend float) + (frame-cur-blend float) + (frame-start float) + (frame-post-blend float) + (frame-post-end float) + (frame-push-time time-frame) + (frame-post-put-away basic) + (update-time time-frame) ) - :method-count-assert 13 - :size-assert #x68 - :flag-assert #xd00000068 (:methods - (new (symbol type process-drawable) _type_ 0) - (reset (_type_) none 9) - (update (_type_) none 10) - (get-channel (_type_ int) joint-control-channel 11) - (push-anim-to-targ (_type_ art-joint-anim float int int float float symbol) none 12) + (new (symbol type process-drawable) _type_) + (reset (_type_) none) + (update (_type_) none) + (get-channel (_type_ int) joint-control-channel) + (push-anim-to-targ (_type_ art-joint-anim float int int float float symbol) none) ) ) (deftype joint-control (basic) - ((status joint-control-status :offset-assert 4) - (allocated-length uint8 :offset-assert 6) - (active-channels uint8 :offset-assert 7) - (root-channel (inline-array joint-control-channel) :offset 16) - (blend-index uint8 :offset-assert 20) - (active-frame-interp uint8 :offset-assert 21) - (float-channels uint8 :offset-assert 22) - (generate-frame-function (function joint-anim-frame int joint-control int) :offset-assert 24) - (prebind-function (function joint-anim-frame int joint-control int) :offset-assert 28) - (postbind-function (function draw-control cspace-array joint-control none) :offset-assert 32) - (effect effect-control :offset-assert 36) - (interp-select int64 2 :offset-assert 40) - (top-anim top-anim-joint-control :offset-assert 56) - (override (array float) :offset-assert 60) - (channel joint-control-channel :inline :dynamic :offset-assert 64) + ((status joint-control-status) + (allocated-length uint8) + (active-channels uint8) + (root-channel (inline-array joint-control-channel) :offset 16) + (blend-index uint8) + (active-frame-interp uint8) + (float-channels uint8) + (generate-frame-function (function joint-anim-frame int joint-control int)) + (prebind-function (function joint-anim-frame int joint-control int)) + (postbind-function (function draw-control cspace-array joint-control none)) + (effect effect-control) + (interp-select int64 2) + (top-anim top-anim-joint-control) + (override (array float)) + (channel joint-control-channel :inline :dynamic) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 (:methods - (new (symbol type int) _type_ 0) - (current-cycle-distance (_type_) float 9) - (update-anim-data (_type_) none 10) - (debug-print-channels (_type_ symbol) int 11) + (new (symbol type int) _type_) + (current-cycle-distance (_type_) float) + (update-anim-data (_type_) none) + (debug-print-channels (_type_ symbol) int) ) ) (deftype matrix-stack (structure) - ((top matrix :offset-assert 0) - (data matrix 24 :inline :offset-assert 16) + ((top matrix) + (data matrix 24 :inline) ) - :method-count-assert 9 - :size-assert #x610 - :flag-assert #x900000610 ) (deftype channel-upload-info (structure) - ((fixed joint-anim-compressed-fixed :offset-assert 0) - (fixed-qwc int32 :offset-assert 4) - (frame joint-anim-compressed-frame :offset-assert 8) - (frame-qwc int32 :offset-assert 12) - (amount float :offset-assert 16) - (interp float :offset-assert 20) + ((fixed joint-anim-compressed-fixed) + (fixed-qwc int32) + (frame joint-anim-compressed-frame) + (frame-qwc int32) + (amount float) + (interp float) ) :pack-me - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype joint-work (structure) - ((temp-mtx matrix :inline :offset-assert 0) - (joint-stack matrix-stack :inline :offset-assert 64) - (fix-jmp-table (function none) 16 :offset-assert 1616) - (frm-jmp-table (function none) 16 :offset-assert 1680) - (pair-jmp-table (function none) 16 :offset-assert 1744) - (uploads channel-upload-info 24 :inline :offset-assert 1808) - (num-uploads int32 :offset-assert 2384) - (mtx-acc matrix 2 :inline :offset-assert 2400) - (tq-acc transformq 100 :inline :offset-assert 2528) - (jacp-hdr joint-anim-compressed-hdr :inline :offset-assert 7328) - (fixed-data joint-anim-compressed-fixed :inline :offset-assert 7392) - (frame-data joint-anim-compressed-frame 2 :inline :offset-assert 9600) - (flatten-array float 576 :offset 2400) - (flattened vector 24 :offset 2400) + ((temp-mtx matrix :inline) + (joint-stack matrix-stack :inline) + (fix-jmp-table (function none) 16) + (frm-jmp-table (function none) 16) + (pair-jmp-table (function none) 16) + (uploads channel-upload-info 24 :inline) + (num-uploads int32) + (mtx-acc matrix 2 :inline) + (tq-acc transformq 100 :inline) + (jacp-hdr joint-anim-compressed-hdr :inline) + (fixed-data joint-anim-compressed-fixed :inline) + (frame-data joint-anim-compressed-frame 2 :inline) + (flatten-array float 576 :overlay-at mtx-acc) + (flattened vector 24 :overlay-at mtx-acc) ) - :method-count-assert 9 - :size-assert #x3640 - :flag-assert #x900003640 ) diff --git a/goal_src/jak2/engine/anim/joint-mod-h.gc b/goal_src/jak2/engine/anim/joint-mod-h.gc index d9317e09083..1b0897a88cf 100644 --- a/goal_src/jak2/engine/anim/joint-mod-h.gc +++ b/goal_src/jak2/engine/anim/joint-mod-h.gc @@ -60,68 +60,62 @@ ;; DECOMP BEGINS (deftype joint-mod (basic) - ((mode joint-mod-mode :offset-assert 4) - (process process-drawable :offset-assert 8) - (joint cspace :offset-assert 12) - (target vector :inline :offset-assert 16) - (twist vector :inline :offset-assert 32) - (twist-max vector :inline :offset-assert 48) - (extra-twist degrees :offset 40) - (track-mode track-mode :offset 44) - (loock-at-count uint16 :offset 46) - (twist-range-x meters :offset 56) - (twist-range-y meters :offset 60) - (twist-speed-x float :offset 64) - (twist-speed-y float :offset 68) - (twist-min-x float :offset 72) - (twist-min-y float :offset 76) - (trans vector :inline :offset-assert 80) - (shmushy-old float :offset 80) - (smushy-off float :offset 84) - (smushyv float :offset 88) - (quat quaternion :inline :offset-assert 96) - (scale vector :inline :offset-assert 112) - (notice-time time-frame :offset-assert 128) - (flex-blend float :offset-assert 136) - (blend float :offset-assert 140) - (max-dist meters :offset-assert 144) - (ignore-angle degrees :offset-assert 148) - (up uint8 :offset-assert 152) - (nose uint8 :offset-assert 153) - (ear uint8 :offset-assert 154) - (base-joint uint8 :offset-assert 155) - (base-nose uint8 :offset-assert 156) - (shutting-down? symbol :offset-assert 160) - (parented-scale? symbol :offset-assert 164) - (polar-internal-tilt-max float :offset-assert 168) - (polar-internal-radius float :offset-assert 172) - (polar-external-tilt-max float :offset-assert 176) - (polar-external-radius float :offset-assert 180) + ((mode joint-mod-mode) + (process process-drawable) + (joint cspace) + (target vector :inline) + (twist vector :inline) + (twist-max vector :inline) + (extra-twist degrees :overlay-at (-> twist data 2)) + (track-mode track-mode :overlay-at (-> twist data 3)) + (loock-at-count uint16 :offset 46) + (twist-range-x meters :overlay-at (-> twist-max data 2)) + (twist-range-y meters :overlay-at (-> twist-max data 3)) + (twist-speed-x float :offset 64) + (twist-speed-y float :offset 68) + (twist-min-x float :offset 72) + (twist-min-y float :offset 76) + (trans vector :inline) + (shmushy-old float :overlay-at (-> trans data 0)) + (smushy-off float :overlay-at (-> trans data 1)) + (smushyv float :overlay-at (-> trans data 2)) + (quat quaternion :inline) + (scale vector :inline) + (notice-time time-frame) + (flex-blend float) + (blend float) + (max-dist meters) + (ignore-angle degrees) + (up uint8) + (nose uint8) + (ear uint8) + (base-joint uint8) + (base-nose uint8) + (shutting-down? symbol) + (parented-scale? symbol) + (polar-internal-tilt-max float) + (polar-internal-radius float) + (polar-external-tilt-max float) + (polar-external-radius float) ) - :method-count-assert 16 - :size-assert #xb8 - :flag-assert #x10000000b8 (:methods - (new (symbol type joint-mod-mode process-drawable int) _type_ 0) - (mode-set! (_type_ joint-mod-mode) none 9) - (target-set! (_type_ vector) none 10) - (look-at! (_type_ vector symbol process) none :behavior process 11) - (reset-blend! (_type_) _type_ 12) - (twist-set! (_type_ float float float) vector 13) - (trs-set! (_type_ vector quaternion vector) none 14) - (shut-down (_type_) none 15) + (new (symbol type joint-mod-mode process-drawable int) _type_) + (mode-set! (_type_ joint-mod-mode) none) + (target-set! (_type_ vector) none) + (look-at! (_type_ vector symbol process) none :behavior process) + (reset-blend! (_type_) _type_) + (twist-set! (_type_ float float float) vector) + (trs-set! (_type_ vector quaternion vector) none) + (shut-down (_type_) none) ) ) (deftype try-to-look-at-info (basic) - ((who handle :offset-assert 8) - (horz float :offset-assert 16) - (vert float :offset-assert 20) + ((who handle) + (horz float) + (vert float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) @@ -131,7 +125,7 @@ (none) ) -(defmethod reset-blend! joint-mod ((this joint-mod)) +(defmethod reset-blend! ((this joint-mod)) (set! (-> this blend) 0.0) this ) @@ -147,17 +141,14 @@ ) (deftype joint-mod-wheel (basic) - ((last-position vector :inline :offset-assert 16) - (angle float :offset-assert 32) - (process process-drawable :offset-assert 36) - (wheel-radius float :offset-assert 40) - (wheel-axis int8 :offset-assert 44) + ((last-position vector :inline) + (angle float) + (process process-drawable) + (wheel-radius float) + (wheel-axis int8) ) - :method-count-assert 9 - :size-assert #x2d - :flag-assert #x90000002d (:methods - (new (symbol type process-drawable int float int) _type_ 0) + (new (symbol type process-drawable int float int) _type_) ) ) @@ -205,17 +196,14 @@ ) (deftype joint-mod-set-local (basic) - ((transform transformq :inline :offset-assert 16) - (set-rotation symbol :offset-assert 64) - (set-scale symbol :offset-assert 68) - (set-translation symbol :offset-assert 72) - (enable symbol :offset-assert 76) + ((transform transformq :inline) + (set-rotation symbol) + (set-scale symbol) + (set-translation symbol) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 (:methods - (new (symbol type process-drawable int symbol symbol symbol) _type_ 0) + (new (symbol type process-drawable int symbol symbol symbol) _type_) ) ) @@ -268,17 +256,14 @@ ) (deftype joint-mod-add-local (basic) - ((transform transformq :inline :offset-assert 16) - (add-rotation symbol :offset-assert 64) - (add-scale symbol :offset-assert 68) - (add-translation symbol :offset-assert 72) - (enable symbol :offset-assert 76) + ((transform transformq :inline) + (add-rotation symbol) + (add-scale symbol) + (add-translation symbol) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 (:methods - (new (symbol type process-drawable int symbol symbol symbol) _type_ 0) + (new (symbol type process-drawable int symbol symbol symbol) _type_) ) ) @@ -326,15 +311,12 @@ ) (deftype joint-mod-set-world (basic) - ((transform transformq :inline :offset-assert 16) - (node-index int32 :offset-assert 64) - (enable symbol :offset-assert 68) + ((transform transformq :inline) + (node-index int32) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 (:methods - (new (symbol type process-drawable int symbol) _type_ 0) + (new (symbol type process-drawable int symbol) _type_) ) ) @@ -366,17 +348,14 @@ ) (deftype joint-mod-blend-local (basic) - ((transform transformq :inline :offset-assert 16) - (blend-transform transformq :inline :offset-assert 64) - (node-index int32 :offset-assert 112) - (blend float :offset-assert 116) - (enable symbol :offset-assert 120) + ((transform transformq :inline) + (blend-transform transformq :inline) + (node-index int32) + (blend float) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x7c - :flag-assert #x90000007c (:methods - (new (symbol type process-drawable int symbol) _type_ 0) + (new (symbol type process-drawable int symbol) _type_) ) ) @@ -420,16 +399,13 @@ ) (deftype joint-mod-spinner (basic) - ((spin-axis vector :inline :offset-assert 16) - (angle float :offset-assert 32) - (spin-rate float :offset-assert 36) - (enable symbol :offset-assert 40) + ((spin-axis vector :inline) + (angle float) + (spin-rate float) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c (:methods - (new (symbol type process-drawable int vector float) _type_ 0) + (new (symbol type process-drawable int vector float) _type_) ) ) @@ -465,18 +441,15 @@ ) (deftype joint-mod-blend-world (basic) - ((transform transformq :inline :offset-assert 16) - (blend-transform transformq :inline :offset-assert 64) - (blend-flags joint-mod-blend-flags :offset-assert 112) - (node-index int32 :offset-assert 116) - (blend float :offset-assert 120) - (enable symbol :offset-assert 124) + ((transform transformq :inline) + (blend-transform transformq :inline) + (blend-flags joint-mod-blend-flags) + (node-index int32) + (blend float) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 (:methods - (new (symbol type process-drawable int symbol float) _type_ 0) + (new (symbol type process-drawable int symbol float) _type_) ) ) @@ -576,14 +549,11 @@ ) (deftype joint-mod-rotate-local (basic) - ((enable symbol :offset-assert 4) - (rotation quaternion :inline :offset-assert 16) + ((enable symbol) + (rotation quaternion :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 (:methods - (new (symbol type process-drawable int symbol) _type_ 0) + (new (symbol type process-drawable int symbol) _type_) ) ) @@ -612,29 +582,26 @@ ) (deftype joint-mod-ik (basic) - ((flags joint-mod-ik-flags :offset-assert 4) - (process process-drawable :offset-assert 8) - (hand-dist float :offset-assert 12) - (handle-pos vector :inline :offset-assert 16) - (elbow-pole-vector-axis uint32 :offset-assert 32) - (elbow-rotation-axis uint32 :offset-assert 36) - (user-position vector :inline :offset-assert 48) - (user-normal vector :inline :offset-assert 64) - (user-blend float :offset-assert 80) - (user-float float :offset-assert 84) - (callback (function joint-mod-ik matrix matrix vector object) :offset-assert 88) - (shoulder-matrix-no-ik matrix :inline :offset-assert 96) - (elbow-matrix-no-ik matrix :inline :offset-assert 160) - (blend float :offset-assert 224) - (blend-interp float :offset-assert 228) + ((flags joint-mod-ik-flags) + (process process-drawable) + (hand-dist float) + (handle-pos vector :inline) + (elbow-pole-vector-axis uint32) + (elbow-rotation-axis uint32) + (user-position vector :inline) + (user-normal vector :inline) + (user-blend float) + (user-float float) + (callback (function joint-mod-ik matrix matrix vector object)) + (shoulder-matrix-no-ik matrix :inline) + (elbow-matrix-no-ik matrix :inline) + (blend float) + (blend-interp float) ) - :method-count-assert 11 - :size-assert #xe8 - :flag-assert #xb000000e8 (:methods - (new (symbol type process-drawable int float) _type_ 0) - (handle-copy! (_type_ vector) none 9) - (enable-set! (_type_ symbol) none 10) + (new (symbol type process-drawable int float) _type_) + (handle-copy! (_type_ vector) none) + (enable-set! (_type_ symbol) none) ) ) diff --git a/goal_src/jak2/engine/anim/joint-mod.gc b/goal_src/jak2/engine/anim/joint-mod.gc index 7f4c8691b59..a932fec63d3 100644 --- a/goal_src/jak2/engine/anim/joint-mod.gc +++ b/goal_src/jak2/engine/anim/joint-mod.gc @@ -323,13 +323,13 @@ ) ) -(defmethod handle-copy! joint-mod-ik ((this joint-mod-ik) (arg0 vector)) +(defmethod handle-copy! ((this joint-mod-ik) (arg0 vector)) (set! (-> this handle-pos quad) (-> arg0 quad)) 0 (none) ) -(defmethod enable-set! joint-mod-ik ((this joint-mod-ik) (arg0 symbol)) +(defmethod enable-set! ((this joint-mod-ik) (arg0 symbol)) (if arg0 (logior! (-> this flags) (joint-mod-ik-flags enable)) (logclear! (-> this flags) (joint-mod-ik-flags enable)) @@ -589,7 +589,7 @@ ) ;; WARN: Return type mismatch joint-mod vs none. -(defmethod mode-set! joint-mod ((this joint-mod) (arg0 joint-mod-mode)) +(defmethod mode-set! ((this joint-mod) (arg0 joint-mod-mode)) (set! (-> this mode) arg0) (let ((v1-0 (-> this joint))) (case arg0 @@ -697,13 +697,13 @@ ) ;; WARN: Return type mismatch joint-mod vs none. -(defmethod shut-down joint-mod ((this joint-mod)) +(defmethod shut-down ((this joint-mod)) (set! (-> this shutting-down?) #t) (set! (-> this blend) 0.0) (none) ) -(defmethod twist-set! joint-mod ((this joint-mod) (arg0 float) (arg1 float) (arg2 float)) +(defmethod twist-set! ((this joint-mod) (arg0 float) (arg1 float) (arg2 float)) (if arg0 (set! (-> this twist x) arg0) ) @@ -716,7 +716,7 @@ (-> this twist) ) -(defmethod trs-set! joint-mod ((this joint-mod) (arg0 vector) (arg1 quaternion) (arg2 vector)) +(defmethod trs-set! ((this joint-mod) (arg0 vector) (arg1 quaternion) (arg2 vector)) (if arg0 (set! (-> this trans quad) (-> arg0 quad)) ) @@ -730,7 +730,7 @@ (none) ) -(defmethod target-set! joint-mod ((this joint-mod) (arg0 vector)) +(defmethod target-set! ((this joint-mod) (arg0 vector)) (if (= (-> this mode) (joint-mod-mode reset)) (mode-set! this (joint-mod-mode look-at)) ) @@ -748,7 +748,7 @@ (define last-try-to-look-at-data (new 'global 'try-to-look-at-info)) -(defmethod look-at! joint-mod ((this joint-mod) (arg0 vector) (arg1 symbol) (arg2 process)) +(defmethod look-at! ((this joint-mod) (arg0 vector) (arg1 symbol) (arg2 process)) (when (= arg1 'attacking) (let* ((s2-0 arg2) (s1-0 (if (type? s2-0 process-drawable) diff --git a/goal_src/jak2/engine/anim/joint.gc b/goal_src/jak2/engine/anim/joint.gc index 291c0cfdaba..c9c09432b68 100644 --- a/goal_src/jak2/engine/anim/joint.gc +++ b/goal_src/jak2/engine/anim/joint.gc @@ -10,12 +10,12 @@ ;; DECOMP BEGINS -(defmethod print joint ((this joint)) +(defmethod print ((this joint)) (format #t "#<~A ~S ~D @ #x~X>" (-> this type) (-> this name) (-> this number) this) this ) -(defmethod mem-usage joint ((this joint) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this joint) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 68 (-> arg0 length))) (set! (-> arg0 data 67 name) "joint") (+! (-> arg0 data 67 count) 1) @@ -26,27 +26,27 @@ this ) -(defmethod print joint-anim ((this joint-anim)) +(defmethod print ((this joint-anim)) (format #t "#<~A ~S ~D [~D] @ #x~X>" (-> this type) (-> this name) (-> this number) (-> this length) this) this ) -(defmethod length joint-anim ((this joint-anim)) +(defmethod length ((this joint-anim)) (-> this length) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-matrix ((this joint-anim-matrix)) +(defmethod asize-of ((this joint-anim-matrix)) (the-as int (+ (-> joint-anim-matrix size) (* (-> this length) 64))) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-transformq ((this joint-anim-transformq)) +(defmethod asize-of ((this joint-anim-transformq)) (the-as int (+ (-> joint-anim-transformq size) (* 48 (-> this length)))) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-drawable ((this joint-anim-drawable)) +(defmethod asize-of ((this joint-anim-drawable)) (the-as int (+ (-> joint-anim-drawable size) (* (-> this length) 4))) ) @@ -71,7 +71,7 @@ arg0 ) -(defmethod mem-usage joint-anim-drawable ((this joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 80 (-> arg0 length))) (set! (-> arg0 data 79 name) "joint-anim-drawable") (+! (-> arg0 data 79 count) 1) @@ -112,7 +112,7 @@ arg0 ) -(defmethod print joint-control-channel ((this joint-control-channel)) +(defmethod print ((this joint-control-channel)) (let ((t9-0 format) (a0-1 #t) (a1-0 "#") @@ -153,7 +153,7 @@ ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-control ((this joint-control)) +(defmethod asize-of ((this joint-control)) (the-as int (+ (-> this type size) (* (-> this allocated-length) 64))) ) @@ -177,7 +177,7 @@ ) ) -(defmethod debug-print-channels joint-control ((this joint-control) (arg0 symbol)) +(defmethod debug-print-channels ((this joint-control) (arg0 symbol)) (format arg0 "~0K") (dotimes (s4-0 (the-as int (+ (-> this active-channels) (-> this float-channels)))) (let* ((s3-0 (-> this channel s4-0)) @@ -264,42 +264,43 @@ 0 ) -(defmethod needs-link? art ((this art)) +(defmethod needs-link? ((this art)) #f ) ;; WARN: Return type mismatch symbol vs basic. -(defmethod get-art-by-name-method art ((this art) (arg0 string) (arg1 type)) +(defmethod get-art-by-name-method ((this art) (arg0 string) (arg1 type)) (the-as basic #f) ) +;; og:preserve-this added macro (defmacro get-art-by-name (this name type) "Helper macro for casting the result of get-art-by-name-method. Generated by decompiler." `(the-as ,type (get-art-by-name-method ,this ,name ,type)) ) ;; WARN: Return type mismatch symbol vs int. -(defmethod get-art-idx-by-name-method art ((this art) (arg0 string) (arg1 type)) +(defmethod get-art-idx-by-name-method ((this art) (arg0 string) (arg1 type)) (the-as int #f) ) -(defmethod print art ((this art)) +(defmethod print ((this art)) (format #t "#<~A ~S :length ~D @ #x~X>" (-> this type) (-> this name) (-> this length) this) this ) -(defmethod length art ((this art)) +(defmethod length ((this art)) (-> this length) ) -(defmethod login art ((this art)) +(defmethod login ((this art)) (if (and (-> this extra) (zero? (-> this extra tag))) (set! (-> this extra tag) (the-as (pointer res-tag) (&+ (the-as pointer (-> this extra)) 28))) ) this ) -(defmethod mem-usage art-mesh-anim ((this art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 75 (-> arg0 length))) (set! (-> arg0 data 74 name) "art-mesh-anim") (+! (-> arg0 data 74 count) 1) @@ -316,7 +317,7 @@ this ) -(defmethod mem-usage art-joint-anim ((this art-joint-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-joint-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 78 (-> arg0 length))) (set! (-> arg0 data 77 name) "art-joint-anim") (+! (-> arg0 data 77 count) 1) @@ -341,7 +342,7 @@ ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of art-joint-anim ((this art-joint-anim)) +(defmethod asize-of ((this art-joint-anim)) (the-as int (+ (-> art size) (* (-> this length) 4))) ) @@ -361,7 +362,7 @@ this ) -(defmethod needs-link? art-group ((this art-group)) +(defmethod needs-link? ((this art-group)) (and (nonzero? (-> this length)) (type? (-> this data 0) art-joint-anim) (!= (-> this name) (-> (the-as art-joint-anim (-> this data 0)) master-art-group-name)) @@ -369,7 +370,7 @@ ) ;; WARN: Return type mismatch art-element vs basic. -(defmethod get-art-by-name-method art-group ((this art-group) (arg0 string) (arg1 type)) +(defmethod get-art-by-name-method ((this art-group) (arg0 string) (arg1 type)) (cond (arg1 (let ((s3-0 (+ (length (-> this name)) 1))) @@ -395,7 +396,7 @@ ) ) -(defmethod get-art-idx-by-name-method art-group ((this art-group) (arg0 string) (arg1 type)) +(defmethod get-art-idx-by-name-method ((this art-group) (arg0 string) (arg1 type)) (cond (arg1 (let ((s3-0 (+ (length (-> this name)) 1))) @@ -421,7 +422,7 @@ ) ) -(defmethod login art-group ((this art-group)) +(defmethod login ((this art-group)) (dotimes (s5-0 (-> this length)) (if (-> this data s5-0) (set! (-> this data s5-0) (login (-> this data s5-0))) @@ -430,7 +431,7 @@ this ) -(defmethod mem-usage art-group ((this art-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 74 (-> arg0 length))) (set! (-> arg0 data 73 name) "art-group") (+! (-> arg0 data 73 count) 1) @@ -450,7 +451,7 @@ ) ;; WARN: Return type mismatch art-group vs none. -(defmethod relocate art-group ((this art-group) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate ((this art-group) (arg0 kheap) (arg1 (pointer uint8))) (let ((s4-0 (clear *temp-string*))) (string<-charp s4-0 arg1) (set! this @@ -516,11 +517,11 @@ ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of art-mesh-geo ((this art-mesh-geo)) +(defmethod asize-of ((this art-mesh-geo)) (the-as int (+ (-> art size) (* (-> this length) 4))) ) -(defmethod mem-usage art-mesh-geo ((this art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 76 (-> arg0 length))) (set! (-> arg0 data 75 name) "art-mesh-geo") (+! (-> arg0 data 75 count) 1) @@ -537,7 +538,7 @@ this ) -(defmethod login art-mesh-geo ((this art-mesh-geo)) +(defmethod login ((this art-mesh-geo)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (the-as object (-> this data s5-0)))) (dotimes (s3-0 (-> (the-as (pointer int16) s4-0) 3)) @@ -550,7 +551,7 @@ this ) -(defmethod login art-joint-anim ((this art-joint-anim)) +(defmethod login ((this art-joint-anim)) (if (and (-> this extra) (zero? (-> this extra tag))) (set! (-> this extra tag) (the-as (pointer res-tag) (&+ (the-as pointer (-> this extra)) 28))) ) @@ -558,12 +559,12 @@ ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of art-joint-geo ((this art-joint-geo)) +(defmethod asize-of ((this art-joint-geo)) (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; WARN: Return type mismatch joint vs basic. -(defmethod get-art-by-name-method art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) +(defmethod get-art-by-name-method ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 (dotimes (s3-0 (-> this length)) @@ -584,7 +585,7 @@ ) ) -(defmethod get-art-idx-by-name-method art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) +(defmethod get-art-idx-by-name-method ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 (dotimes (s3-0 (-> this length)) @@ -605,7 +606,7 @@ ) ) -(defmethod mem-usage art-joint-geo ((this art-joint-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-joint-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 77 (-> arg0 length))) (set! (-> arg0 data 76 name) "art-joint-geo") (+! (-> arg0 data 76 count) 1) @@ -693,7 +694,6 @@ arg0 ) -;; WARN: Return type mismatch symbol vs object. ;; WARN: Using new Jak 2 rtype-of (defun joint-control-remap! ((arg0 joint-control) (arg1 art-group) (arg2 art-group) (arg3 pair) (arg4 int) (arg5 string)) (local-vars @@ -1103,7 +1103,7 @@ (the-as matrix (-> arg0 data)) ) -(defmethod reset-and-assign-geo! cspace ((this cspace) (arg0 drawable)) +(defmethod reset-and-assign-geo! ((this cspace) (arg0 drawable)) (set! (-> this parent) #f) (set! (-> this joint) #f) (set! (-> this geo) arg0) @@ -1625,7 +1625,7 @@ 0 ) -(defmethod print art-joint-anim-manager-slot ((this art-joint-anim-manager-slot)) +(defmethod print ((this art-joint-anim-manager-slot)) (let* ((gp-0 format) (s5-0 #t) (s4-0 "#") @@ -1662,7 +1662,7 @@ this ) -(defmethod used-bytes-for-slot art-joint-anim-manager ((this art-joint-anim-manager) (arg0 int)) +(defmethod used-bytes-for-slot ((this art-joint-anim-manager) (arg0 int)) (let ((v1-2 (-> this slot arg0))) (if (< arg0 (+ (-> this free-index) -1)) (&- @@ -1674,7 +1674,7 @@ ) ) -(defmethod unload-from-slot art-joint-anim-manager ((this art-joint-anim-manager) (arg0 int)) +(defmethod unload-from-slot ((this art-joint-anim-manager) (arg0 int)) (let* ((s3-0 (-> this slot arg0)) (s5-0 (-> s3-0 anim)) ) @@ -1695,7 +1695,7 @@ ) ) (logior! (-> v1-6 flags) 1) - (set! (-> v1-6 flags) (logand -3 (-> v1-6 flags))) + (logand! (-> v1-6 flags) -3) ) (cond ((< arg0 (+ (-> this free-index) -1)) @@ -1734,7 +1734,7 @@ ) ) -(defmethod update-time-stamp art-joint-anim-manager ((this art-joint-anim-manager) (arg0 art-joint-anim)) +(defmethod update-time-stamp ((this art-joint-anim-manager) (arg0 art-joint-anim)) (countdown (v1-0 (-> this free-index)) (when (= arg0 (-> this slot v1-0 anim)) (set! (-> this slot v1-0 time-stamp) (the-as uint (-> *display* base-clock frame-counter))) @@ -1744,7 +1744,7 @@ arg0 ) -(defmethod decompress art-joint-anim-manager ((this art-joint-anim-manager) (arg0 art-joint-anim)) +(defmethod decompress ((this art-joint-anim-manager) (arg0 art-joint-anim)) (let* ((s5-0 (-> arg0 frames)) (s3-0 (* (+ (-> s5-0 fixed-qwc) (* (-> s5-0 num-frames) (-> s5-0 frame-qwc))) 16)) ) @@ -1772,7 +1772,7 @@ ) (let ((s4-1 (kmalloc (-> this kheap) (the-as int s3-0) (kmalloc-flags) "malloc"))) (unpack-comp-lzo (the-as (pointer uint8) s4-1) (the-as (pointer uint8) (-> s5-0 fixed))) - (set! (-> s5-0 flags) (logand -2 (-> s5-0 flags))) + (logand! (-> s5-0 flags) -2) (logior! (-> s5-0 flags) 2) (set! (-> s5-0 fixed) (the-as joint-anim-compressed-fixed s4-1)) (dotimes (v1-22 (the-as int (-> s5-0 num-frames))) @@ -1789,7 +1789,7 @@ arg0 ) -(defmethod unload-from-level art-joint-anim-manager ((this art-joint-anim-manager) (arg0 level)) +(defmethod unload-from-level ((this art-joint-anim-manager) (arg0 level)) (let ((s5-0 (-> arg0 heap base)) (s4-0 (-> arg0 heap top-base)) ) diff --git a/goal_src/jak2/engine/anim/mspace-h.gc b/goal_src/jak2/engine/anim/mspace-h.gc index 08154f7f858..2bcc008fa69 100644 --- a/goal_src/jak2/engine/anim/mspace-h.gc +++ b/goal_src/jak2/engine/anim/mspace-h.gc @@ -14,83 +14,65 @@ ;; DECOMP BEGINS (deftype joint (basic) - ((name basic :offset-assert 4) - (number int32 :offset-assert 8) - (parent joint :offset-assert 12) - (bind-pose matrix :inline :offset-assert 16) + ((name basic) + (number int32) + (parent joint) + (bind-pose matrix :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype bone-cache (structure) - ((bone-matrix uint32 :offset-assert 0) - (parent-matrix uint32 :offset-assert 4) - (dummy uint32 :offset-assert 8) - (frame uint32 :offset-assert 12) + ((bone-matrix uint32) + (parent-matrix uint32) + (dummy uint32) + (frame uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype bone (structure) - ((transform matrix :inline :offset-assert 0) - (position vector :inline :offset 48) - (scale vector :inline :offset-assert 64) + ((transform matrix :inline) + (position vector :inline :overlay-at (-> transform data 12)) + (scale vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype skeleton (inline-array-class) - ((bones bone :inline :dynamic :offset-assert 16) + ((bones bone :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> skeleton heap-base) (the-as uint 80)) (deftype cspace (structure) - ((parent cspace :offset-assert 0) - (joint joint :offset-assert 4) - (joint-num int16 :offset-assert 8) - (geo drawable :offset-assert 12) - (bone bone :offset-assert 16) - (param0 (function cspace transformq none) :offset-assert 20) - (param1 basic :offset-assert 24) - (param2 basic :offset-assert 28) + ((parent cspace) + (joint joint) + (joint-num int16) + (geo drawable) + (bone bone) + (param0 (function cspace transformq none)) + (param1 basic) + (param2 basic) ) - :method-count-assert 10 - :size-assert #x20 - :flag-assert #xa00000020 (:methods - (new (symbol type drawable) _type_ 0) - (reset-and-assign-geo! (_type_ drawable) _type_ 9) + (new (symbol type drawable) _type_) + (reset-and-assign-geo! (_type_ drawable) _type_) ) ) (deftype cspace-array (inline-array-class) - ((data cspace :inline :dynamic :offset-assert 16) + ((data cspace :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> cspace-array heap-base) (the-as uint 32)) -(defmethod print cspace ((this cspace)) +(defmethod print ((this cspace)) (format #t "#" diff --git a/goal_src/jak2/engine/camera/cam-debug.gc b/goal_src/jak2/engine/camera/cam-debug.gc index 2d5db9bc147..639abba8a00 100644 --- a/goal_src/jak2/engine/camera/cam-debug.gc +++ b/goal_src/jak2/engine/camera/cam-debug.gc @@ -42,28 +42,27 @@ (define-perm *camera-old-stat-string-total* string (new 'global 'string 128 (the-as string #f))) (deftype cam-dbg-scratch (structure) - ((linevec4w vector4w 2 :inline :offset-assert 0) - (color vector4w :inline :offset-assert 32) - (plotvec vector4w 2 :inline :offset-assert 48) - (linevec vector4w 2 :inline :offset-assert 80) - (rel-vec vector :inline :offset-assert 112) - (sphere-v-start vector :inline :offset-assert 128) - (sphere-v-end vector :inline :offset-assert 144) - (sphere-v-down vector :inline :offset-assert 160) - (sphere-vec vector :inline :offset-assert 176) - (crossvec vector 3 :inline :offset-assert 192) - (bboxvec vector 6 :inline :offset-assert 240) - (fov-vv vector 4 :inline :offset-assert 336) - (fov-src vector :inline :offset-assert 400) - (fov-dest vector :inline :offset-assert 416) - (fov-vert vector :inline :offset-assert 432) - (fov-horz vector :inline :offset-assert 448) + ((linevec4w vector4w 2 :inline) + (color vector4w :inline) + (plotvec vector4w 2 :inline) + (linevec vector4w 2 :inline) + (rel-vec vector :inline) + (sphere-v-start vector :inline) + (sphere-v-end vector :inline) + (sphere-v-down vector :inline) + (sphere-vec vector :inline) + (crossvec vector 3 :inline) + (bboxvec vector 6 :inline) + (fov-vv vector 4 :inline) + (fov-src vector :inline) + (fov-dest vector :inline) + (fov-vert vector :inline) + (fov-horz vector :inline) ) - :method-count-assert 9 - :size-assert #x1d0 - :flag-assert #x9000001d0 ) + +;; WARN: Return type mismatch object vs string. (defun cam-slave-options->string ((arg0 cam-slave-options) (arg1 object)) (if (= (logand arg0 (cam-slave-options SAME_SIDE)) (cam-slave-options SAME_SIDE)) (format arg1 "SAME_SIDE ") @@ -142,6 +141,7 @@ (the-as string arg1) ) +;; WARN: Return type mismatch object vs string. (defun cam-index-options->string ((arg0 cam-index-options) (arg1 object)) (if (= (logand arg0 (cam-index-options SPHERICAL)) (cam-index-options SPHERICAL)) (format arg1 "RADIAL ") @@ -172,8 +172,6 @@ ) ) -;; WARN: Failed store: (s.w! (+ a0-2 8) 0) at op 78 -;; WARN: Failed store: (s.w! (+ a0-2 12) 0) at op 79 (defun cam-line-dma () (with-dma-buffer-add-bucket ((v1-5 (-> *display* frames (-> *display* on-screen) debug-buf)) (bucket-id debug-no-zbuf1) @@ -362,6 +360,7 @@ (none) ) +;; WARN: Function camera-line-draw has a return type of none, but the expression builder found a return statement. (defun camera-line-draw ((arg0 vector) (arg1 vector)) (set! (-> (scratchpad-object cam-dbg-scratch) linevec 0 quad) (-> arg0 quad)) (set! (-> (scratchpad-object cam-dbg-scratch) linevec 1 quad) (-> arg1 quad)) @@ -572,15 +571,13 @@ ) (deftype cam-debug-tri (structure) - ((vertex vector 3 :inline :offset-assert 0) - (intersect vector :inline :offset-assert 48) - (color vector4w :offset-assert 64) + ((vertex vector 3 :inline) + (intersect vector :inline) + (color vector4w) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) + (define *cam-debug-los-tri-current* 0) (define *cam-debug-los-tri* (the-as (inline-array cam-debug-tri) (malloc 'debug #x8fc0))) @@ -717,6 +714,7 @@ (none) ) +;; WARN: Return type mismatch none vs symbol. (defun camera-fov-frame ((arg0 matrix) (arg1 vector) (arg2 float) (arg3 float) (arg4 float) (arg5 vector4w)) (vector-float*! (-> (scratchpad-object cam-dbg-scratch) fov-vert) (-> arg0 vector 1) (* arg3 (tan arg2))) (vector-float*! @@ -818,7 +816,7 @@ ) ) -(defmethod debug-point-info tracking-spline ((this tracking-spline) (arg0 int)) +(defmethod debug-point-info ((this tracking-spline) (arg0 int)) (if (= arg0 (-> this used-point)) (format 0 "u") (format 0 " ") @@ -846,7 +844,7 @@ (none) ) -(defmethod debug-all-points tracking-spline ((this tracking-spline)) +(defmethod debug-all-points ((this tracking-spline)) (let ((s5-0 (-> this used-point))) (while (!= s5-0 -134250495) (debug-point-info this s5-0) @@ -858,7 +856,7 @@ (none) ) -(defmethod debug-draw-spline tracking-spline ((this tracking-spline)) +(defmethod debug-draw-spline ((this tracking-spline)) (let ((s5-0 (-> this used-point))) (let ((s4-0 (-> this point (-> this used-point) next))) (let ((s3-0 (new 'stack-no-clear 'vector))) @@ -1101,9 +1099,9 @@ ((= (-> arg0 blend-to-type) (camera-blend-to-type unknown-2)) (vector+float*! s5-1 s4-1 (the-as vector (-> *camera-combiner* tracking)) 2048.0) (camera-line s4-1 s5-1 (new 'static 'vector4w :x #xff :w #x80)) - (vector+float*! s5-1 s4-1 (the-as vector (&-> *camera-combiner* stack 176)) 2048.0) + (vector+float*! s5-1 s4-1 (-> *camera-combiner* tracking inv-mat vector 1) 2048.0) (camera-line s4-1 s5-1 (new 'static 'vector4w :y #xff :w #x80)) - (vector+float*! s5-1 s4-1 (the-as vector (&-> *camera-combiner* stack 192)) 2048.0) + (vector+float*! s5-1 s4-1 (-> *camera-combiner* tracking inv-mat vector 2) 2048.0) (camera-line s4-1 s5-1 (new 'static 'vector4w :z #xff :w #x80)) ) (else @@ -1290,33 +1288,28 @@ ) (deftype cam-collision-record (structure) - ((pos vector :inline :offset-assert 0) - (vel vector :inline :offset-assert 16) - (desired-pos vector :inline :offset-assert 32) - (cam-tpos-cur vector :inline :offset-assert 48) - (cam-tpos-old vector :inline :offset-assert 64) - (view-flat vector :inline :offset-assert 80) - (string-min-val vector :inline :offset-assert 96) - (string-max-val vector :inline :offset-assert 112) - (view-off vector :inline :offset-assert 128) - (min-z-override float :offset-assert 144) - (string-push-z float :offset-assert 148) - (view-off-param float :offset-assert 152) - (frame int32 :offset-assert 156) - (iteration int32 :offset-assert 160) - (move-type symbol :offset-assert 164) + ((pos vector :inline) + (vel vector :inline) + (desired-pos vector :inline) + (cam-tpos-cur vector :inline) + (cam-tpos-old vector :inline) + (view-flat vector :inline) + (string-min-val vector :inline) + (string-max-val vector :inline) + (view-off vector :inline) + (min-z-override float) + (string-push-z float) + (view-off-param float) + (frame int32) + (iteration int32) + (move-type symbol) ) - :method-count-assert 9 - :size-assert #xa8 - :flag-assert #x9000000a8 ) + (deftype cam-collision-record-array (inline-array-class) - ((data cam-collision-record :dynamic :offset-assert 16) + ((data cam-collision-record :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) diff --git a/goal_src/jak2/engine/camera/cam-layout.gc b/goal_src/jak2/engine/camera/cam-layout.gc index c83ab953de8..77f40f10dcf 100644 --- a/goal_src/jak2/engine/camera/cam-layout.gc +++ b/goal_src/jak2/engine/camera/cam-layout.gc @@ -22,16 +22,13 @@ (define *camera-layout-blink* #f) (deftype cam-layout-bank (basic) - ((spline-t float :offset-assert 4) - (spline-step float :offset-assert 8) - (intro-t float :offset-assert 12) - (intro-step float :offset-assert 16) - (debug-t float :offset-assert 20) - (debug-step float :offset-assert 24) + ((spline-t float) + (spline-step float) + (intro-t float) + (intro-step float) + (debug-t float) + (debug-step float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) @@ -49,74 +46,56 @@ (deftype clm-basic (basic) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype clm-item-action (structure) - ((button uint64 :offset-assert 0) - (options uint64 :offset-assert 8) - (func symbol :offset-assert 16) - (parm0 int32 :offset 20) - (parm0-symbol symbol :offset 20) - (parm0-basic basic :offset 20) - (parm1 symbol :offset 24) - (parm1-basic basic :offset 24) + ((button uint64) + (options uint64) + (func symbol) + (parm0 int32 :offset 20) + (parm0-symbol symbol :overlay-at parm0) + (parm0-basic basic :overlay-at parm0-symbol) + (parm1 symbol :offset 24) + (parm1-basic basic :overlay-at parm1) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype clm-item (clm-basic) - ((description string :offset-assert 4) - (button-symbol symbol :offset-assert 8) - (action clm-item-action :inline :offset-assert 16) + ((description string) + (button-symbol symbol) + (action clm-item-action :inline) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) (deftype clm-list-item (basic) - ((description string :offset-assert 4) - (track-val symbol :offset-assert 8) - (val-func symbol :offset-assert 12) - (val-parm0 int32 :offset 16) - (val-parm0-symbol symbol :offset 16) - (val-parm0-basic basic :offset 16) - (val-parm1 symbol :offset 20) - (val-parm1-basic basic :offset 20) - (actions (array clm-item-action) :offset-assert 24) + ((description string) + (track-val symbol) + (val-func symbol) + (val-parm0 int32 :offset 16) + (val-parm0-symbol symbol :overlay-at val-parm0) + (val-parm0-basic basic :overlay-at val-parm0-symbol) + (val-parm1 symbol :offset 20) + (val-parm1-basic basic :overlay-at val-parm1) + (actions (array clm-item-action)) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype clm-list (clm-basic) - ((tracker symbol :offset-assert 4) - (cur-list-item int32 :offset-assert 8) - (items (array clm-list-item) :offset-assert 12) + ((tracker symbol) + (cur-list-item int32) + (items (array clm-list-item)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype clm (basic) - ((title string :offset-assert 4) - (items (array clm-basic) :offset-assert 8) + ((title string) + (items (array clm-basic)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -129,11 +108,8 @@ (define *volume-normal* (new 'debug 'vector-array 600)) (deftype volume-descriptor-array (inline-array-class) - ((data plane-volume :inline :dynamic :offset 16) + ((data plane-volume :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -144,19 +120,16 @@ (define *volume-descriptor* (the-as vol-control (new 'debug 'volume-descriptor-array 100))) (deftype cam-layout (process) - ((cam-entity entity-camera :offset-assert 128) - (num-entities int32 :offset-assert 132) - (cur-entity int32 :offset-assert 136) - (num-volumes int32 :offset-assert 140) - (cur-volume int32 :offset-assert 144) - (first-pvol int32 :offset-assert 148) - (first-cutoutvol int32 :offset-assert 152) - (res-key float :offset-assert 156) + ((cam-entity entity-camera) + (num-entities int32) + (cur-entity int32) + (num-volumes int32) + (cur-volume int32) + (first-pvol int32) + (first-cutoutvol int32) + (res-key float) ) :heap-base #x200 - :method-count-assert 14 - :size-assert #xa0 - :flag-assert #xe020000a0 (:states cam-layout-active ) @@ -434,16 +407,13 @@ ) (deftype interp-test-info (structure) - ((from vector :inline :offset-assert 0) - (to vector :inline :offset-assert 16) - (origin vector :inline :offset-assert 32) - (color vector4w :offset-assert 48) - (axis vector :offset-assert 52) - (disp string :offset-assert 56) + ((from vector :inline) + (to vector :inline) + (origin vector :inline) + (color vector4w) + (axis vector) + (disp string) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) @@ -2019,13 +1989,10 @@ ) (deftype clmf-cam-flag-toggle-info (structure) - ((key float :offset-assert 0) - (force-on int32 :offset-assert 4) - (force-off int32 :offset-assert 8) + ((key float) + (force-on int32) + (force-off int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) diff --git a/goal_src/jak2/engine/camera/cam-master.gc b/goal_src/jak2/engine/camera/cam-master.gc index cd591fd3ece..4fabe271e3f 100644 --- a/goal_src/jak2/engine/camera/cam-master.gc +++ b/goal_src/jak2/engine/camera/cam-master.gc @@ -8,7 +8,7 @@ ;; DECOMP BEGINS -(defmethod camera-master-method-16 camera-master ((this camera-master) (arg0 symbol)) +(defmethod camera-master-method-16 ((this camera-master) (arg0 symbol)) (let ((a2-0 (the-as target (handle->process (-> this focus handle)))) (v1-4 0) ) @@ -1075,7 +1075,7 @@ (none) ) -(defmethod camera-master-method-14 camera-master ((this camera-master) (arg0 vector)) +(defmethod camera-master-method-14 ((this camera-master) (arg0 vector)) (if (handle->process (-> this focus handle)) (vector-! arg0 (-> this tpos-curr) (-> this tpos-old)) (vector-reset! arg0) @@ -1083,7 +1083,7 @@ arg0 ) -(defmethod camera-master-method-15 camera-master ((this camera-master) (arg0 vector)) +(defmethod camera-master-method-15 ((this camera-master) (arg0 vector)) (if (and (-> this slave) (-> this slave 0 next-state) (= (-> this slave 0 next-state name) 'cam-string)) (set! (-> arg0 quad) (-> this slave 0 view-flat quad)) (vector-reset! arg0) diff --git a/goal_src/jak2/engine/camera/cam-states-dbg.gc b/goal_src/jak2/engine/camera/cam-states-dbg.gc index 0cdd09f017e..b7d1b03ea67 100644 --- a/goal_src/jak2/engine/camera/cam-states-dbg.gc +++ b/goal_src/jak2/engine/camera/cam-states-dbg.gc @@ -8,12 +8,9 @@ ;; DECOMP BEGINS (deftype cam-point-watch-bank (basic) - ((speed float :offset-assert 4) - (rot-speed degrees :offset-assert 8) + ((speed float) + (rot-speed degrees) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -88,12 +85,9 @@ ) (deftype cam-free-bank (basic) - ((speed float :offset-assert 4) - (rot-speed degrees :offset-assert 8) + ((speed float) + (rot-speed degrees) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -386,14 +380,11 @@ ) (deftype camera-free-floating-move-info (structure) - ((rv vector :inline :offset-assert 0) - (tv vector :inline :offset-assert 16) - (up vector :inline :offset-assert 32) - (tm matrix :inline :offset-assert 48) + ((rv vector :inline) + (tv vector :inline) + (up vector :inline) + (tm matrix :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) diff --git a/goal_src/jak2/engine/camera/cam-states.gc b/goal_src/jak2/engine/camera/cam-states.gc index fe446d6abb4..38ea11e3408 100644 --- a/goal_src/jak2/engine/camera/cam-states.gc +++ b/goal_src/jak2/engine/camera/cam-states.gc @@ -442,14 +442,11 @@ ) (deftype cam-eye-bank (basic) - ((rot-speed float :offset-assert 4) - (max-degrees float :offset-assert 8) - (max-fov float :offset-assert 12) - (min-fov float :offset-assert 16) + ((rot-speed float) + (max-degrees float) + (max-fov float) + (min-fov float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -1163,12 +1160,9 @@ ) (deftype cam-string-bank (basic) - ((los-coll-rad meters :offset-assert 4) - (los-coll-rad2 meters :offset-assert 8) + ((los-coll-rad meters) + (los-coll-rad2 meters) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -1264,30 +1258,24 @@ ) (deftype los-dist (structure) - ((par-dist float :offset-assert 0) - (lat-dist float :offset-assert 4) - (vert-dist float :offset-assert 8) + ((par-dist float) + (lat-dist float) + (vert-dist float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype collide-los-dist-info (structure) - ((min-par float :offset-assert 0) - (max-par float :offset-assert 4) - (min-lat float :offset-assert 8) - (max-lat float :offset-assert 12) - (min-vp float :offset-assert 16) - (max-vp float :offset-assert 20) - (min-vn float :offset-assert 24) - (max-vn float :offset-assert 28) - (count int32 :offset-assert 32) + ((min-par float) + (max-par float) + (min-lat float) + (max-lat float) + (min-vp float) + (max-vp float) + (min-vn float) + (max-vn float) + (count int32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) @@ -1391,15 +1379,12 @@ ) (deftype collide-los-result (structure) - ((lateral vector :inline :offset-assert 0) - (cw collide-los-dist-info :inline :offset-assert 16) - (ccw collide-los-dist-info :inline :offset-assert 64) - (straddle collide-los-dist-info :inline :offset-assert 112) - (lateral-valid symbol :offset-assert 148) + ((lateral vector :inline) + (cw collide-los-dist-info :inline) + (ccw collide-los-dist-info :inline) + (straddle collide-los-dist-info :inline) + (lateral-valid symbol) ) - :method-count-assert 9 - :size-assert #x98 - :flag-assert #x900000098 ) @@ -3186,14 +3171,11 @@ ) (deftype cam-stick-bank (basic) - ((max-z meters :offset-assert 4) - (min-z meters :offset-assert 8) - (max-y meters :offset-assert 12) - (min-y meters :offset-assert 16) + ((max-z meters) + (min-z meters) + (max-y meters) + (min-y meters) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -3397,14 +3379,11 @@ ) (deftype cam-bike-bank (basic) - ((max-z meters :offset-assert 4) - (min-z meters :offset-assert 8) - (max-y meters :offset-assert 12) - (min-y meters :offset-assert 16) + ((max-z meters) + (min-z meters) + (max-y meters) + (min-y meters) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) diff --git a/goal_src/jak2/engine/camera/camera-defs-h.gc b/goal_src/jak2/engine/camera/camera-defs-h.gc index 970ccfb3dfe..efe2aa05b74 100644 --- a/goal_src/jak2/engine/camera/camera-defs-h.gc +++ b/goal_src/jak2/engine/camera/camera-defs-h.gc @@ -29,20 +29,17 @@ ;; DECOMP BEGINS (deftype camera-bank (basic) - ((collide-move-rad float :offset-assert 4) - (joypad uint32 :offset-assert 8) - (min-detectable-velocity float :offset-assert 12) - (attack-timeout time-frame :offset-assert 16) - (default-string-max-y meters :offset-assert 24) - (default-string-min-y meters :offset-assert 28) - (default-string-max-z meters :offset-assert 32) - (default-string-min-z meters :offset-assert 36) - (default-string-push-z meters :offset-assert 40) - (default-tilt-adjust degrees :offset-assert 44) + ((collide-move-rad float) + (joypad uint32) + (min-detectable-velocity float) + (attack-timeout time-frame) + (default-string-max-y meters) + (default-string-min-y meters) + (default-string-max-z meters) + (default-string-min-z meters) + (default-string-push-z meters) + (default-tilt-adjust degrees) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) @@ -60,18 +57,15 @@ ) (deftype camera-master-bank (basic) - ((onscreen-head-height meters :offset-assert 4) - (onscreen-foot-height meters :offset-assert 8) - (target-height meters :offset-assert 12) - (up-move-to-pitch-ratio-in-air float :offset-assert 16) - (down-move-to-pitch-ratio-in-air float :offset-assert 20) - (up-move-to-pitch-on-ground float :offset-assert 24) - (down-move-to-pitch-on-ground float :offset-assert 28) - (pitch-off-blend float :offset-assert 32) + ((onscreen-head-height meters) + (onscreen-foot-height meters) + (target-height meters) + (up-move-to-pitch-ratio-in-air float) + (down-move-to-pitch-ratio-in-air float) + (up-move-to-pitch-on-ground float) + (down-move-to-pitch-on-ground float) + (pitch-off-blend float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) diff --git a/goal_src/jak2/engine/camera/camera-h.gc b/goal_src/jak2/engine/camera/camera-h.gc index 629141751a8..dea5fbd99c9 100644 --- a/goal_src/jak2/engine/camera/camera-h.gc +++ b/goal_src/jak2/engine/camera/camera-h.gc @@ -58,103 +58,88 @@ ;; DECOMP BEGINS (deftype cam-index (structure) - ((flags cam-index-options :offset-assert 0) - (vec vector 2 :inline :offset-assert 16) + ((flags cam-index-options) + (vec vector 2 :inline) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (cam-index-method-9 (_type_ symbol entity vector curve) symbol 9) - (cam-index-method-10 (_type_ vector) float 10) + (cam-index-method-9 (_type_ symbol entity vector curve) symbol) + (cam-index-method-10 (_type_ vector) float) ) ) (deftype tracking-point (structure) - ((position vector :inline :offset-assert 0) - (direction vector :inline :offset-assert 16) - (tp-length float :offset-assert 32) - (next int32 :offset-assert 36) - (incarnation int32 :offset-assert 40) + ((position vector :inline) + (direction vector :inline) + (tp-length float) + (next int32) + (incarnation int32) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) (deftype tracking-spline-sampler (structure) - ((cur-pt int32 :offset-assert 0) - (partial-pt float :offset-assert 4) + ((cur-pt int32) + (partial-pt float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype tracking-spline (structure) - ((point tracking-point 32 :inline :offset-assert 0) - (summed-len float :offset-assert 1536) - (free-point int32 :offset-assert 1540) - (used-point int32 :offset-assert 1544) - (partial-point float :offset-assert 1548) - (end-point int32 :offset-assert 1552) - (next-to-last-point int32 :offset-assert 1556) - (max-move float :offset-assert 1560) - (sample-len float :offset-assert 1564) - (used-count int32 :offset-assert 1568) - (old-position vector :inline :offset-assert 1584) - (debug-old-position vector :inline :offset-assert 1600) - (debug-out-position vector :inline :offset-assert 1616) - (debug-last-point int32 :offset-assert 1632) + ((point tracking-point 32 :inline) + (summed-len float) + (free-point int32) + (used-point int32) + (partial-point float) + (end-point int32) + (next-to-last-point int32) + (max-move float) + (sample-len float) + (used-count int32) + (old-position vector :inline) + (debug-old-position vector :inline) + (debug-out-position vector :inline) + (debug-last-point int32) ) - :method-count-assert 24 - :size-assert #x664 - :flag-assert #x1800000664 (:methods - (tracking-spline-method-9 (_type_) none 9) - (tracking-spline-method-10 (_type_ vector) none 10) - (debug-point-info (_type_ int) none 11) - (debug-all-points (_type_) none 12) - (tracking-spline-method-13 (_type_ int) none 13) - (tracking-spline-method-14 (_type_ tracking-spline-sampler) none 14) - (tracking-spline-method-15 (_type_) none 15) - (tracking-spline-method-16 (_type_ float) none 16) - (tracking-spline-method-17 (_type_ vector float float symbol) int 17) - (tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector 18) - (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector 19) - (tracking-spline-method-20 (_type_ vector int) none 20) - (tracking-spline-method-21 (_type_ vector float float float) vector 21) - (tracking-spline-method-22 (_type_ float) symbol 22) - (debug-draw-spline (_type_) none 23) + (tracking-spline-method-9 (_type_) none) + (tracking-spline-method-10 (_type_ vector) none) + (debug-point-info (_type_ int) none) + (debug-all-points (_type_) none) + (tracking-spline-method-13 (_type_ int) none) + (tracking-spline-method-14 (_type_ tracking-spline-sampler) none) + (tracking-spline-method-15 (_type_) none) + (tracking-spline-method-16 (_type_ float) none) + (tracking-spline-method-17 (_type_ vector float float symbol) int) + (tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector) + (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector) + (tracking-spline-method-20 (_type_ vector int) none) + (tracking-spline-method-21 (_type_ vector float float float) vector) + (tracking-spline-method-22 (_type_ float) symbol) + (debug-draw-spline (_type_) none) ) ) (deftype cam-float-seeker (structure) - ((target float :offset-assert 0) - (value float :offset-assert 4) - (vel float :offset-assert 8) - (accel float :offset-assert 12) - (max-vel float :offset-assert 16) - (max-partial float :offset-assert 20) + ((target float) + (value float) + (vel float) + (accel float) + (max-vel float) + (max-partial float) ) :pack-me - :method-count-assert 13 - :size-assert #x18 - :flag-assert #xd00000018 (:methods - (init (_type_ float float float float) none 9) - (copy-to (_type_ _type_) none 10) - (update! (_type_ float) none 11) - (jump-to-target! (_type_ float) float 12) + (init (_type_ float float float float) none) + (copy-to (_type_ _type_) none) + (update! (_type_ float) none) + (jump-to-target! (_type_ float) float) ) ) -(defmethod init cam-float-seeker ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (set! (-> this target) arg0) (set! (-> this value) arg0) (set! (-> this vel) 0.0) @@ -165,7 +150,7 @@ (none) ) -(defmethod copy-to cam-float-seeker ((this cam-float-seeker) (arg0 cam-float-seeker)) +(defmethod copy-to ((this cam-float-seeker) (arg0 cam-float-seeker)) (set! (-> this target) (-> arg0 target)) (set! (-> this value) (-> arg0 value)) (set! (-> this vel) (-> arg0 vel)) @@ -176,7 +161,7 @@ (none) ) -(defmethod update! cam-float-seeker ((this cam-float-seeker) (arg0 float)) +(defmethod update! ((this cam-float-seeker) (arg0 float)) (with-pp 0.0 0.0 @@ -202,31 +187,28 @@ ) ) -(defmethod jump-to-target! cam-float-seeker ((this cam-float-seeker) (arg0 float)) +(defmethod jump-to-target! ((this cam-float-seeker) (arg0 float)) (set! (-> this value) (+ (-> this target) arg0)) (set! (-> this vel) 0.0) 0.0 ) (deftype cam-vector-seeker (structure) - ((target vector :inline :offset-assert 0) - (value vector :inline :offset-assert 16) - (vel vector :inline :offset-assert 32) - (accel float :offset-assert 48) - (max-vel float :offset-assert 52) - (max-partial float :offset-assert 56) + ((target vector :inline) + (value vector :inline) + (vel vector :inline) + (accel float) + (max-vel float) + (max-partial float) ) - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (init (_type_ vector float float float) none 9) - (update! (_type_ vector) none 10) + (init (_type_ vector float float float) none) + (update! (_type_ vector) none) ) ) -(defmethod init cam-vector-seeker ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 (set! (-> this target quad) (-> arg0 quad)) @@ -245,7 +227,7 @@ (none) ) -(defmethod update! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector)) +(defmethod update! ((this cam-vector-seeker) (arg0 vector)) (with-pp (let ((v1-0 (new 'stack-no-clear 'vector))) 0.0 @@ -278,44 +260,37 @@ ) (deftype cam-rotation-tracker (structure) - ((inv-mat matrix :inline :offset-assert 0) - (no-follow basic :offset-assert 64) - (follow-pt vector :inline :offset-assert 80) - (follow-off vector :inline :offset-assert 96) - (follow-blend float :offset-assert 112) - (tilt-adjust cam-float-seeker :inline :offset-assert 116) - (point-of-interest-blend cam-float-seeker :inline :offset-assert 140) - (underwater-blend cam-float-seeker :inline :offset-assert 164) - (looking-at vector :inline :offset-assert 192) - (looking-interesting vector :inline :offset-assert 208) - (old-cam-trans vector :inline :offset-assert 224) - (follow-height-extra cam-float-seeker :inline :offset-assert 240) + ((inv-mat matrix :inline) + (no-follow basic) + (follow-pt vector :inline) + (follow-off vector :inline) + (follow-blend float) + (tilt-adjust cam-float-seeker :inline) + (point-of-interest-blend cam-float-seeker :inline) + (underwater-blend cam-float-seeker :inline) + (looking-at vector :inline) + (looking-interesting vector :inline) + (old-cam-trans vector :inline) + (follow-height-extra cam-float-seeker :inline) ) - :method-count-assert 9 - :size-assert #x108 - :flag-assert #x900000108 ) (deftype camera-combiner (process) - ((trans vector :inline :offset-assert 128) - (inv-camera-rot matrix :inline :offset-assert 144) - (fov float :offset-assert 208) - (interp-val float :offset-assert 212) - (interp-step float :offset-assert 216) - (dist-from-src float :offset-assert 220) - (dist-from-dest float :offset-assert 224) - (flip-control-axis vector :inline :offset-assert 240) - (velocity vector :inline :offset-assert 256) - (tracking-status uint64 :offset-assert 272) - (tracking-options int32 :offset-assert 280) - (tracking cam-rotation-tracker :inline :offset-assert 288) - (fast-rot basic :offset-assert 552) + ((trans vector :inline) + (inv-camera-rot matrix :inline) + (fov float) + (interp-val float) + (interp-step float) + (dist-from-src float) + (dist-from-dest float) + (flip-control-axis vector :inline) + (velocity vector :inline) + (tracking-status uint64) + (tracking-options int32) + (tracking cam-rotation-tracker :inline) + (fast-rot basic) ) - :heap-base #x1b0 - :method-count-assert 14 - :size-assert #x22c - :flag-assert #xe01b0022c (:states cam-combiner-active ) @@ -323,66 +298,62 @@ (deftype camera-slave (process) - ((trans vector :inline :offset-assert 128) - (fov float :offset-assert 144) - (fov0 float :offset-assert 148) - (fov1 float :offset-assert 152) - (fov-index cam-index :inline :offset-assert 160) - (tracking cam-rotation-tracker :inline :offset-assert 208) - (view-off-param float :offset-assert 472) - (view-off vector :inline :offset-assert 480) - (joystick-saved-view-off vector :inline :offset-assert 496) - (min-z-override float :offset-assert 512) - (view-flat vector :inline :offset-assert 528) - (string-vel-dir uint32 :offset-assert 544) - (string-trans vector :inline :offset-assert 560) - (position-spline tracking-spline :inline :offset-assert 576) - (pivot-pt vector :inline :offset-assert 2224) - (pivot-rad float :offset-assert 2240) - (circular-follow vector :inline :offset-assert 2256) - (max-angle-offset float :offset-assert 2272) - (max-angle-curr float :offset-assert 2276) - (options cam-slave-options-u32 :offset-assert 2280) - (cam-entity entity :offset-assert 2284) - (butt-timer uint64 :offset-assert 2288) - (butt-seek basic :offset-assert 2296) - (butt-vector vector :inline :offset-assert 2304) - (velocity vector :inline :offset-assert 2320) - (desired-pos vector :inline :offset-assert 2336) - (time-dist-too-far uint32 :offset-assert 2352) - (los-state slave-los-state :offset-assert 2356) - (good-point vector :inline :offset-assert 2368) - (los-tgt-spline-pt int32 :offset-assert 2384) - (los-tgt-spline-pt-incarnation int32 :offset-assert 2388) - (los-last-pos vector :inline :offset-assert 2400) - (intro-curve curve :inline :offset-assert 2416) - (intro-offset vector :inline :offset-assert 2448) - (intro-t float :offset-assert 2464) - (intro-t-step float :offset-assert 2468) - (outro-exit-value float :offset-assert 2472) - (spline-exists basic :offset-assert 2476) - (spline-curve curve :inline :offset-assert 2480) - (spline-offset vector :inline :offset-assert 2512) - (index cam-index :inline :offset-assert 2528) - (saved-pt vector :inline :offset-assert 2576) - (spline-tt float :offset-assert 2592) - (spline-follow-dist float :offset-assert 2596) - (enter-has-run symbol :offset-assert 2600) - (blend-from-type uint64 :offset-assert 2608) - (blend-to-type camera-blend-to-type :offset-assert 2616) - (have-phony-joystick basic :offset-assert 2624) - (phony-joystick-x float :offset-assert 2628) - (phony-joystick-y float :offset-assert 2632) - (string-min-val vector :inline :offset-assert 2640) - (string-max-val vector :inline :offset-assert 2656) - (string-val-locked basic :offset-assert 2672) - (relative-position vector :inline :offset-assert 2688) - (string-relative basic :offset-assert 2704) + ((trans vector :inline) + (fov float) + (fov0 float) + (fov1 float) + (fov-index cam-index :inline) + (tracking cam-rotation-tracker :inline) + (view-off-param float) + (view-off vector :inline) + (joystick-saved-view-off vector :inline) + (min-z-override float) + (view-flat vector :inline) + (string-vel-dir uint32) + (string-trans vector :inline) + (position-spline tracking-spline :inline) + (pivot-pt vector :inline) + (pivot-rad float) + (circular-follow vector :inline) + (max-angle-offset float) + (max-angle-curr float) + (options cam-slave-options-u32) + (cam-entity entity) + (butt-timer uint64) + (butt-seek basic) + (butt-vector vector :inline) + (velocity vector :inline) + (desired-pos vector :inline) + (time-dist-too-far uint32) + (los-state slave-los-state) + (good-point vector :inline) + (los-tgt-spline-pt int32) + (los-tgt-spline-pt-incarnation int32) + (los-last-pos vector :inline) + (intro-curve curve :inline) + (intro-offset vector :inline) + (intro-t float) + (intro-t-step float) + (outro-exit-value float) + (spline-exists basic) + (spline-curve curve :inline) + (spline-offset vector :inline) + (index cam-index :inline) + (saved-pt vector :inline) + (spline-tt float) + (spline-follow-dist float) + (enter-has-run symbol) + (blend-from-type uint64) + (blend-to-type camera-blend-to-type) + (have-phony-joystick basic) + (phony-joystick-x float) + (phony-joystick-y float) + (string-min-val vector :inline) + (string-max-val vector :inline) + (string-val-locked basic) + (relative-position vector :inline) + (string-relative basic) ) - :heap-base #xa20 - :method-count-assert 14 - :size-assert #xa94 - :flag-assert #xe0a200a94 (:states cam-bike cam-circular @@ -413,54 +384,50 @@ (deftype camera-master (process) - ((master-options cam-master-options-u32 :offset-assert 128) - (settings cam-setting-data :offset-assert 132) - (slave (pointer camera-slave) :offset-assert 136) - (decel (pointer camera-slave) :offset-assert 140) - (slave-options uint32 :offset-assert 144) - (view-off-param-save float :offset-assert 148) - (changer uint32 :offset-assert 152) - (string-min cam-vector-seeker :inline :offset-assert 160) - (string-max cam-vector-seeker :inline :offset-assert 224) - (string-push-z float :offset-assert 284) - (local-down vector :inline :offset-assert 288) - (focus focus :inline :offset-assert 304) - (being-attacked symbol :offset-assert 316) - (attack-start time-frame :offset-assert 320) - (on-ground symbol :offset-assert 328) - (under-water int32 :offset-assert 332) - (on-pole symbol :offset-assert 336) - (tgt-rot-mat matrix :inline :offset-assert 352) - (tgt-face-mat matrix :inline :offset-assert 416) - (tpos-old vector :inline :offset-assert 480) - (tpos-curr vector :inline :offset-assert 496) - (tpos-old-adj vector :inline :offset-assert 512) - (tpos-curr-adj vector :inline :offset-assert 528) - (tpos-tgt vector :inline :offset-assert 544) - (upspeed float :offset-assert 560) - (pitch-off vector :inline :offset-assert 576) - (target-spline tracking-spline :inline :offset-assert 592) - (ease-from vector :inline :offset-assert 2240) - (ease-t float :offset-assert 2256) - (ease-step float :offset-assert 2260) - (ease-to vector :inline :offset-assert 2272) - (outro-curve curve :inline :offset-assert 2288) - (outro-t float :offset-assert 2308) - (outro-t-step float :offset-assert 2312) - (outro-exit-value float :offset-assert 2316) - (water-drip-time time-frame :offset-assert 2320) - (water-drip sparticle-launch-control :offset-assert 2328) - (water-drip-mult float :offset-assert 2332) - (water-drip-speed float :offset-assert 2336) + ((master-options cam-master-options-u32) + (settings cam-setting-data) + (slave (pointer camera-slave)) + (decel (pointer camera-slave)) + (slave-options uint32) + (view-off-param-save float) + (changer uint32) + (string-min cam-vector-seeker :inline) + (string-max cam-vector-seeker :inline) + (string-push-z float) + (local-down vector :inline) + (focus focus :inline) + (being-attacked symbol) + (attack-start time-frame) + (on-ground symbol) + (under-water int32) + (on-pole symbol) + (tgt-rot-mat matrix :inline) + (tgt-face-mat matrix :inline) + (tpos-old vector :inline) + (tpos-curr vector :inline) + (tpos-old-adj vector :inline) + (tpos-curr-adj vector :inline) + (tpos-tgt vector :inline) + (upspeed float) + (pitch-off vector :inline) + (target-spline tracking-spline :inline) + (ease-from vector :inline) + (ease-t float) + (ease-step float) + (ease-to vector :inline) + (outro-curve curve :inline) + (outro-t float) + (outro-t-step float) + (outro-exit-value float) + (water-drip-time time-frame) + (water-drip sparticle-launch-control) + (water-drip-mult float) + (water-drip-speed float) ) - :heap-base #x8b0 - :method-count-assert 17 - :size-assert #x924 - :flag-assert #x1108b00924 (:methods - (camera-master-method-14 (_type_ vector) vector 14) - (camera-master-method-15 (_type_ vector) vector 15) - (camera-master-method-16 (_type_ symbol) int 16) + (camera-master-method-14 (_type_ vector) vector) + (camera-master-method-15 (_type_ vector) vector) + (camera-master-method-16 (_type_ symbol) int) ) (:states cam-master-active diff --git a/goal_src/jak2/engine/camera/camera.gc b/goal_src/jak2/engine/camera/camera.gc index d30327dd541..3732e5a77ad 100644 --- a/goal_src/jak2/engine/camera/camera.gc +++ b/goal_src/jak2/engine/camera/camera.gc @@ -360,7 +360,7 @@ ) ) -(defmethod cam-index-method-9 cam-index ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) +(defmethod cam-index-method-9 ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) (local-vars (sv-32 (function _varargs_ object))) (format (clear *cam-res-string*) "~S-flags" arg0) (set! (-> this flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *cam-res-string*)))) @@ -436,7 +436,7 @@ #t ) -(defmethod cam-index-method-10 cam-index ((this cam-index) (arg0 vector)) +(defmethod cam-index-method-10 ((this cam-index) (arg0 vector)) (let ((s5-0 (new-stack-vector0))) 0.0 (vector-! s5-0 arg0 (the-as vector (-> this vec))) @@ -455,7 +455,7 @@ ) ) -(defmethod tracking-spline-method-10 tracking-spline ((this tracking-spline) (arg0 vector)) +(defmethod tracking-spline-method-10 ((this tracking-spline) (arg0 vector)) (set! (-> this point 0 position quad) (-> arg0 quad)) (set! (-> this point 0 next) -134250495) (set! (-> this summed-len) 0.0) @@ -479,7 +479,7 @@ (none) ) -(defmethod tracking-spline-method-13 tracking-spline ((this tracking-spline) (arg0 int)) +(defmethod tracking-spline-method-13 ((this tracking-spline) (arg0 int)) (let ((v1-3 (-> this point arg0 next))) (cond ((= v1-3 -134250495) @@ -512,7 +512,7 @@ (none) ) -(defmethod tracking-spline-method-14 tracking-spline ((this tracking-spline) (arg0 tracking-spline-sampler)) +(defmethod tracking-spline-method-14 ((this tracking-spline) (arg0 tracking-spline-sampler)) (let ((v1-0 (-> this used-point))) (set! (-> this partial-point) (-> arg0 partial-pt)) (when (= (-> this next-to-last-point) v1-0) @@ -551,7 +551,7 @@ (none) ) -(defmethod tracking-spline-method-15 tracking-spline ((this tracking-spline)) +(defmethod tracking-spline-method-15 ((this tracking-spline)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 cur-pt) (-> this used-point)) @@ -597,7 +597,7 @@ (none) ) -(defmethod tracking-spline-method-16 tracking-spline ((this tracking-spline) (arg0 float)) +(defmethod tracking-spline-method-16 ((this tracking-spline) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 cur-pt) (-> this used-point)) @@ -635,7 +635,7 @@ (none) ) -(defmethod tracking-spline-method-17 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) +(defmethod tracking-spline-method-17 ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) (let ((s3-0 (-> this free-point)) (s2-0 (-> this end-point)) ) @@ -677,7 +677,7 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod tracking-spline-method-18 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-18 ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (local-vars (f0-4 float)) (when (not arg2) (set! arg2 (new 'stack-no-clear 'tracking-spline-sampler)) @@ -720,13 +720,13 @@ (the-as vector #f) ) -(defmethod tracking-spline-method-19 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-19 ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (vector-reset! arg1) (tracking-spline-method-18 this arg0 arg1 arg2) arg1 ) -(defmethod tracking-spline-method-20 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 int)) +(defmethod tracking-spline-method-20 ((this tracking-spline) (arg0 vector) (arg1 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-! s3-0 @@ -808,7 +808,7 @@ (none) ) -(defmethod tracking-spline-method-21 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod tracking-spline-method-21 ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (with-pp (let ((v1-0 (-> this used-point)) (f0-0 (-> this partial-point)) @@ -858,7 +858,7 @@ ) ;; WARN: Return type mismatch int vs symbol. -(defmethod tracking-spline-method-22 tracking-spline ((this tracking-spline) (arg0 float)) +(defmethod tracking-spline-method-22 ((this tracking-spline) (arg0 float)) (when (< arg0 (-> this summed-len)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) @@ -872,7 +872,7 @@ (the-as symbol 0) ) -(defmethod tracking-spline-method-9 tracking-spline ((this tracking-spline)) +(defmethod tracking-spline-method-9 ((this tracking-spline)) (let ((v1-0 (-> this used-point)) (s4-0 0) (s5-0 0) diff --git a/goal_src/jak2/engine/camera/pov-camera-h.gc b/goal_src/jak2/engine/camera/pov-camera-h.gc index e58c30f2ec8..8c014faa4f2 100644 --- a/goal_src/jak2/engine/camera/pov-camera-h.gc +++ b/goal_src/jak2/engine/camera/pov-camera-h.gc @@ -21,29 +21,27 @@ ;; DECOMP BEGINS (deftype pov-camera (process-drawable) - ((flags pov-camera-flag :offset-assert 200) - (debounce-start-time time-frame :offset-assert 208) - (notify-handle handle :offset-assert 216) - (anim-name string :offset-assert 224) - (command-list pair :offset-assert 228) - (mask-to-clear process-mask :offset-assert 232) - (music-volume-movie float :offset-assert 236) - (sfx-volume-movie float :offset-assert 240) + ((flags pov-camera-flag) + (debounce-start-time time-frame) + (notify-handle handle) + (anim-name string) + (command-list pair) + (mask-to-clear process-mask) + (music-volume-movie float) + (sfx-volume-movie float) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xf4 - :flag-assert #x1e008000f4 + (:state-methods + pov-camera-abort + pov-camera-done-playing + pov-camera-playing + pov-camera-start-playing + pov-camera-startup + ) (:methods - (pov-camera-abort () _type_ :state 20) - (pov-camera-done-playing () _type_ :state 21) - (pov-camera-playing () _type_ :state 22) - (pov-camera-start-playing () _type_ :state 23) - (pov-camera-startup () _type_ :state 24) - (abort? (_type_) symbol :behavior pov-camera 25) - (target-grabbed? (_type_) symbol 26) - (pov-camera-method-27 () none 27) - (pov-camera-method-28 () none 28) - (target-released? (_type_) symbol 29) + (abort? (_type_) symbol :behavior pov-camera) + (target-grabbed? (_type_) symbol) + (pov-camera-method-27 () none) + (pov-camera-method-28 () none) + (target-released? (_type_) symbol) ) ) diff --git a/goal_src/jak2/engine/collide/collide-cache-h.gc b/goal_src/jak2/engine/collide/collide-cache-h.gc index b2d57dbeed5..4921b228dd9 100644 --- a/goal_src/jak2/engine/collide/collide-cache-h.gc +++ b/goal_src/jak2/engine/collide/collide-cache-h.gc @@ -12,128 +12,107 @@ ;; DECOMP BEGINS (deftype collide-puss-sphere (structure) - ((bsphere sphere :inline :offset-assert 0) - (bbox4w bounding-box4w :inline :offset-assert 16) + ((bsphere sphere :inline) + (bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype collide-puss-work (structure) - ((closest-pt vector :inline :offset-assert 0) - (tri-normal vector :inline :offset-assert 16) - (tri-bbox4w bounding-box4w :inline :offset-assert 32) - (spheres-bbox4w bounding-box4w :inline :offset-assert 64) - (spheres collide-puss-sphere 64 :inline :offset-assert 96) + ((closest-pt vector :inline) + (tri-normal vector :inline) + (tri-bbox4w bounding-box4w :inline) + (spheres-bbox4w bounding-box4w :inline) + (spheres collide-puss-sphere 64 :inline) ) - :method-count-assert 11 - :size-assert #xc60 - :flag-assert #xb00000c60 (:methods - (collide-puss-work-method-9 () none 9) - (collide-puss-work-method-10 () none 10) + (collide-puss-work-method-9 () none) + (collide-puss-work-method-10 () none) ) ) (deftype collide-cache-tri (structure) - ((vertex vector 3 :inline :offset-assert 0) - (extra-quad uint8 16 :offset-assert 48) - (pat pat-surface :offset 48) - (collide-ptr basic :offset 52) - (prim-index uint16 :offset 56) - (user16 uint16 :offset 58) - (user32 uint32 :offset 60) - (clear-flags uint128 :offset 48) + ((vertex vector 3 :inline) + (extra-quad uint8 16) + (pat pat-surface :overlay-at (-> extra-quad 0)) + (collide-ptr basic :overlay-at (-> extra-quad 4)) + (prim-index uint16 :overlay-at (-> extra-quad 8)) + (user16 uint16 :overlay-at (-> extra-quad 10)) + (user32 uint32 :overlay-at (-> extra-quad 12)) + (clear-flags uint128 :overlay-at (-> extra-quad 0)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype collide-cache-prim (structure) - ((prim-core collide-prim-core :inline :offset-assert 0) - (extra-quad uint8 16 :offset-assert 32) - (ccache collide-cache :offset 32) - (prim collide-shape-prim :offset 36) - (first-tri uint16 :offset 40) - (num-tris uint16 :offset 42) - (unused uint8 4 :offset 44) - (world-sphere vector :inline :offset 0) - (collide-as collide-spec :offset 16) - (action collide-action :offset 24) - (prim-type prim-type :offset 28) + ((prim-core collide-prim-core :inline) + (extra-quad uint8 16) + (ccache collide-cache :overlay-at (-> extra-quad 0)) + (prim collide-shape-prim :overlay-at (-> extra-quad 4)) + (first-tri uint16 :overlay-at (-> extra-quad 8)) + (num-tris uint16 :overlay-at (-> extra-quad 10)) + (unused uint8 4 :overlay-at (-> extra-quad 12)) + (world-sphere vector :inline :overlay-at (-> prim-core world-sphere)) + (collide-as collide-spec :overlay-at (-> prim-core collide-as)) + (action collide-action :overlay-at (-> prim-core action)) + (prim-type prim-type :overlay-at (-> prim-core prim-type)) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float 9) - (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float 10) + (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float) + (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float) ) ) (deftype collide-cache (basic) - ((num-tris int32 :offset-assert 4) - (num-tris-u32 uint32 :offset 4) - (num-prims int32 :offset-assert 8) - (num-prims-u32 uint32 :offset 8) - (ignore-mask pat-surface :offset-assert 12) - (ignore-processes process 2 :offset-assert 16) - (collide-box bounding-box :inline :offset-assert 32) - (collide-box4w bounding-box4w :inline :offset-assert 64) - (collide-with collide-spec :offset-assert 96) - (unused uint32 :offset-assert 100) - (prims collide-cache-prim 100 :inline :offset-assert 112) - (tris collide-cache-tri 461 :inline :offset-assert 4912) + ((num-tris int32) + (num-tris-u32 uint32 :overlay-at num-tris) + (num-prims int32) + (num-prims-u32 uint32 :overlay-at num-prims) + (ignore-mask pat-surface) + (ignore-processes process 2) + (collide-box bounding-box :inline) + (collide-box4w bounding-box4w :inline) + (collide-with collide-spec) + (unused uint32) + (prims collide-cache-prim 100 :inline) + (tris collide-cache-tri 461 :inline) ) - :method-count-assert 26 - :size-assert #x8670 - :flag-assert #x1a00008670 (:methods - (debug-draw (_type_) none 9) - (fill-and-probe-using-line-sphere (_type_ collide-query) float 10) - (fill-and-probe-using-spheres (_type_ collide-query) symbol 11) - (fill-using-bounding-box (_type_ collide-query) none 12) - (fill-using-line-sphere (_type_ collide-query) none 13) - (fill-using-spheres (_type_ collide-query) none 14) - (reset (_type_) none 15) - (probe-using-line-sphere (_type_ collide-query) float 16) - (probe-using-spheres (_type_ collide-query) symbol 17) - (fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none 18) - (fill-from-fg-boxes (_type_) none 19) - (fill-from-fg-line-sphere (_type_ collide-query) none 20) - (fill-from-water (_type_ water-control) none 21) - (collide-cache-method-22 () none 22) - (collide-cache-method-23 () none 23) - (collide-cache-method-24 () none 24) - (collide-cache-method-25 () none 25) + (debug-draw (_type_) none) + (fill-and-probe-using-line-sphere (_type_ collide-query) float) + (fill-and-probe-using-spheres (_type_ collide-query) symbol) + (fill-using-bounding-box (_type_ collide-query) none) + (fill-using-line-sphere (_type_ collide-query) none) + (fill-using-spheres (_type_ collide-query) none) + (reset (_type_) none) + (probe-using-line-sphere (_type_ collide-query) float) + (probe-using-spheres (_type_ collide-query) symbol) + (fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none) + (fill-from-fg-boxes (_type_) none) + (fill-from-fg-line-sphere (_type_ collide-query) none) + (fill-from-water (_type_ water-control) none) + (collide-cache-method-22 () none) + (collide-cache-method-23 () none) + (collide-cache-method-24 () none) + (collide-cache-method-25 () none) ) ) (deftype collide-list-item (structure) - ((mesh instance-tie :offset-assert 0) - (inst basic :offset-assert 4) + ((mesh instance-tie) + (inst basic) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype collide-list (structure) - ((num-items int32 :offset-assert 0) - (items collide-list-item 256 :inline :offset 16) + ((num-items int32) + (items collide-list-item 256 :inline :offset 16) ) - :method-count-assert 9 - :size-assert #x810 - :flag-assert #x900000810 ) diff --git a/goal_src/jak2/engine/collide/collide-cache.gc b/goal_src/jak2/engine/collide/collide-cache.gc index 1e8884c0412..731b91960dc 100644 --- a/goal_src/jak2/engine/collide/collide-cache.gc +++ b/goal_src/jak2/engine/collide/collide-cache.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod reset collide-cache ((this collide-cache)) +(defmethod reset ((this collide-cache)) (set! (-> this num-tris) 0) (set! (-> this num-prims) 0) (set! (-> this ignore-processes 0) #f) @@ -17,11 +17,11 @@ (none) ) -(defmethod fill-from-bg collide-cache ((this collide-cache) - (arg0 (function collide-hash int collide-list collide-query int)) - (arg1 (function collide-cache collide-list collide-query none)) - (arg2 collide-query) - ) +(defmethod fill-from-bg ((this collide-cache) + (arg0 (function collide-hash int collide-list collide-query int)) + (arg1 (function collide-cache collide-list collide-query none)) + (arg2 collide-query) + ) (set! *already-printed-exeeded-max-cache-tris* #f) (set! (-> *collide-list* num-items) 0) (if *collide-list-boxes* @@ -63,7 +63,7 @@ ) ;; WARN: Function (method 21 collide-cache) has a return type of none, but the expression builder found a return statement. -(defmethod fill-from-water collide-cache ((this collide-cache) (arg0 water-control)) +(defmethod fill-from-water ((this collide-cache) (arg0 water-control)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -139,7 +139,7 @@ ) ) -(defmethod fill-using-bounding-box collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod fill-using-bounding-box ((this collide-cache) (arg0 collide-query)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -219,7 +219,7 @@ ) ) -(defmethod fill-using-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod fill-using-line-sphere ((this collide-cache) (arg0 collide-query)) ;; og:preserve-this float -> uint (local-vars (v1-11 uint) (v1-20 float)) (rlet ((acc :class vf) @@ -486,7 +486,7 @@ ) ) -(defmethod fill-from-fg-boxes collide-cache ((this collide-cache)) +(defmethod fill-from-fg-boxes ((this collide-cache)) (let ((s5-0 (-> this collide-with))) (set! *actor-list-length* 0) (if (logtest? s5-0 (collide-spec hit-by-others-list)) @@ -573,7 +573,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod add-fg-prim-using-box collide-shape-prim ((this collide-shape-prim) (arg0 collide-cache)) +(defmethod add-fg-prim-using-box ((this collide-shape-prim) (arg0 collide-cache)) (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-box!~%") (none) ) @@ -584,7 +584,7 @@ (defmethod-mips2c "(method 10 collide-shape-prim-group)" 10 collide-shape-prim-group) -(defmethod fill-from-fg-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod fill-from-fg-line-sphere ((this collide-cache) (arg0 collide-query)) (local-vars (v1-9 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -712,7 +712,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod add-fg-prim-using-line-sphere collide-shape-prim ((this collide-shape-prim) (arg0 collide-cache) (arg1 object)) +(defmethod add-fg-prim-using-line-sphere ((this collide-shape-prim) (arg0 collide-cache) (arg1 object)) (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-line-sphere!~%" @@ -726,23 +726,20 @@ (defmethod-mips2c "(method 11 collide-shape-prim-group)" 11 collide-shape-prim-group) -(defmethod fill-and-probe-using-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod fill-and-probe-using-line-sphere ((this collide-cache) (arg0 collide-query)) (fill-using-line-sphere this arg0) (probe-using-line-sphere this arg0) ) (deftype collide-puls-work (structure) - ((ignore-pat pat-surface :offset-assert 0) - (bsphere sphere :inline :offset-assert 16) - (move-dist vector :inline :offset-assert 32) + ((ignore-pat pat-surface) + (bsphere sphere :inline) + (move-dist vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) -(defmethod probe-using-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod probe-using-line-sphere ((this collide-cache) (arg0 collide-query)) (rlet ((vf0 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -813,14 +810,11 @@ ) (deftype lsmi-work (structure) - ((best-u float :offset-assert 0) - (orig-best-u float :offset-assert 4) - (action uint32 :offset-assert 8) - (cquery collide-query :inline :offset-assert 16) + ((best-u float) + (orig-best-u float) + (action uint32) + (cquery collide-query :inline) ) - :method-count-assert 9 - :size-assert #x22c - :flag-assert #x90000022c ) @@ -828,12 +822,12 @@ (defmethod-mips2c "(method 10 collide-cache-prim)" 10 collide-cache-prim) -(defmethod fill-and-probe-using-spheres collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod fill-and-probe-using-spheres ((this collide-cache) (arg0 collide-query)) (fill-using-spheres this arg0) (probe-using-spheres this arg0) ) -(defmethod fill-using-spheres collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod fill-using-spheres ((this collide-cache) (arg0 collide-query)) (new 'stack-no-clear 'bounding-box) (set-from-spheres! (-> arg0 bbox) diff --git a/goal_src/jak2/engine/collide/collide-debug.gc b/goal_src/jak2/engine/collide/collide-debug.gc index e730db3c85a..88f13db59d6 100644 --- a/goal_src/jak2/engine/collide/collide-debug.gc +++ b/goal_src/jak2/engine/collide/collide-debug.gc @@ -10,7 +10,7 @@ ;; this file is debug only (declare-file (debug)) -(defmethod debug-draw collide-cache ((this collide-cache)) +(defmethod debug-draw ((this collide-cache)) (let ((gp-0 (the-as object (-> this tris)))) (countdown (s4-0 (-> this num-tris)) (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-cache-tri gp-0) pat mode) color) a 64))) @@ -58,13 +58,10 @@ ) (deftype col-rend-filter (structure) - ((show-pat-set pat-surface :offset-assert 0) - (show-pat-clear pat-surface :offset-assert 4) - (event-mask uint32 :offset-assert 8) + ((show-pat-set pat-surface) + (show-pat-clear pat-surface) + (event-mask uint32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -171,7 +168,7 @@ (none) ) -(defmethod col-rend-method-9 col-rend ((this col-rend)) +(defmethod col-rend-method-9 ((this col-rend)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f30-0 (-> this bbox-radius))) (let ((v1-0 (-> this track))) diff --git a/goal_src/jak2/engine/collide/collide-edge-grab-h.gc b/goal_src/jak2/engine/collide/collide-edge-grab-h.gc index 9bf0ebbdb16..8de9a1b8190 100644 --- a/goal_src/jak2/engine/collide/collide-edge-grab-h.gc +++ b/goal_src/jak2/engine/collide/collide-edge-grab-h.gc @@ -21,163 +21,139 @@ ;; DECOMP BEGINS (deftype pilot-edge-grab-info (structure) - ((local-pos vector :inline :offset-assert 0) - (local-dir vector :inline :offset-assert 16) - (handle handle :offset-assert 32) + ((local-pos vector :inline) + (local-dir vector :inline) + (handle handle) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) (deftype edge-grab-info (structure) - ((world-vertex vector 8 :inline :offset-assert 0) - (local-vertex vector 8 :inline :offset-assert 128) - (status uint64 :offset-assert 256) - (actor-cshape-prim-offset int32 :offset-assert 264) - (actor-handle handle :offset-assert 272) - (hanging-matrix matrix :inline :offset-assert 288) - (edge-vertex vector 2 :inline :offset 0) - (center-hold vector :inline :offset 32) - (tri-vertex vector 3 :inline :offset 48) - (adjacent-edge-left-vertex vector :inline :offset 96) - (adjacent-edge-right-vertex vector :inline :offset 112) - (left-hand-hold vector :inline :offset-assert 352) - (right-hand-hold vector :inline :offset-assert 368) - (center-hold-old vector :inline :offset-assert 384) - (edge-tri-pat uint32 :offset-assert 400) - (found-edge? symbol :offset-assert 404) - (pilot-edge-grab? symbol :offset-assert 408) - (pilot-edge-grab pilot-edge-grab-info :inline :offset-assert 416) - (pilot-start-grab-pos vector :inline :offset-assert 464) - (pilot-grab-interp float :offset-assert 480) + ((world-vertex vector 8 :inline) + (local-vertex vector 8 :inline) + (status uint64) + (actor-cshape-prim-offset int32) + (actor-handle handle) + (hanging-matrix matrix :inline) + (edge-vertex vector 2 :inline :overlay-at (-> world-vertex 0)) + (center-hold vector :inline :overlay-at (-> world-vertex 2)) + (tri-vertex vector 3 :inline :overlay-at (-> world-vertex 3)) + (adjacent-edge-left-vertex vector :inline :overlay-at (-> world-vertex 6)) + (adjacent-edge-right-vertex vector :inline :overlay-at (-> world-vertex 7)) + (left-hand-hold vector :inline) + (right-hand-hold vector :inline) + (center-hold-old vector :inline) + (edge-tri-pat uint32) + (found-edge? symbol) + (pilot-edge-grab? symbol) + (pilot-edge-grab pilot-edge-grab-info :inline) + (pilot-start-grab-pos vector :inline) + (pilot-grab-interp float) ) - :method-count-assert 11 - :size-assert #x1e4 - :flag-assert #xb000001e4 (:methods - (edge-grab-info-method-9 (_type_) symbol 9) - (debug-draw (_type_) none 10) + (edge-grab-info-method-9 (_type_) symbol) + (debug-draw (_type_) none) ) ) (deftype collide-edge-tri (structure) - ((ctri collide-cache-tri :offset-assert 0) - (normal vector :inline :offset-assert 16) + ((ctri collide-cache-tri) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype collide-edge-edge (structure) - ((ignore basic :offset-assert 0) - (etri collide-edge-tri :offset-assert 4) - (vertex-ptr (inline-array vector) 2 :offset-assert 8) - (outward vector :inline :offset-assert 16) - (edge-vec-norm vector :inline :offset-assert 32) + ((ignore basic) + (etri collide-edge-tri) + (vertex-ptr (inline-array vector) 2) + (outward vector :inline) + (edge-vec-norm vector :inline) ) - :method-count-assert 10 - :size-assert #x30 - :flag-assert #xa00000030 (:methods - (no-collision-at-edge (_type_ collide-edge-work edge-grab-info) symbol 9) + (no-collision-at-edge (_type_ collide-edge-work edge-grab-info) symbol) ) ) (deftype collide-edge-hold-item (structure) - ((next collide-edge-hold-item :offset-assert 0) - (rating float :offset-assert 4) - (split int8 :offset-assert 8) - (edge collide-edge-edge :offset-assert 12) - (center-pt vector :inline :offset-assert 16) - (outward-pt vector :inline :offset-assert 32) + ((next collide-edge-hold-item) + (rating float) + (split int8) + (edge collide-edge-edge) + (center-pt vector :inline) + (outward-pt vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype collide-edge-hold-list (structure) - ((num-allocs uint32 :offset-assert 0) - (num-attempts uint32 :offset-assert 4) - (head collide-edge-hold-item :offset-assert 8) - (items collide-edge-hold-item 32 :inline :offset-assert 16) - (attempts qword 32 :inline :offset-assert 1552) + ((num-allocs uint32) + (num-attempts uint32) + (head collide-edge-hold-item) + (items collide-edge-hold-item 32 :inline) + (attempts qword 32 :inline) ) - :method-count-assert 11 - :size-assert #x810 - :flag-assert #xb00000810 (:methods - (debug-draw (_type_) object 9) - (add-to-list! (_type_ collide-edge-hold-item) none 10) + (debug-draw (_type_) object) + (add-to-list! (_type_ collide-edge-hold-item) none) ) ) (deftype collide-edge-spec (structure) - ((split-dists float 2 :offset-assert 0) - (outward-offset vector :inline :offset-assert 16) - (flags collide-edge-spec-flags :offset-assert 32) - (ignore-pat pat-surface :offset-assert 40) - (max-dist-sqrd-to-outward-pt float :offset-assert 44) - (max-dir-cosa-delta float :offset-assert 48) - (max-dir-cosa-player float :offset-assert 52) - (touching-segment symbol :offset-assert 56) - (local-cache-fill-box bounding-box :inline :offset-assert 64) - (local-within-reach-box bounding-box :inline :offset-assert 96) - (local-player-spheres sphere 12 :inline :offset 128) - (local-player-hanging-spheres sphere 6 :inline :offset 128) - (local-player-leap-up-spheres sphere 6 :inline :offset 224) + ((split-dists float 2) + (outward-offset vector :inline) + (flags collide-edge-spec-flags) + (ignore-pat pat-surface) + (max-dist-sqrd-to-outward-pt float) + (max-dir-cosa-delta float) + (max-dir-cosa-player float) + (touching-segment symbol) + (local-cache-fill-box bounding-box :inline) + (local-within-reach-box bounding-box :inline) + (local-player-spheres sphere 12 :inline :offset 128) + (local-player-hanging-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 0)) + (local-player-leap-up-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 6)) ) - :method-count-assert 9 - :size-assert #x140 - :flag-assert #x900000140 ) (deftype collide-edge-work (structure) - ((ccache collide-cache :offset-assert 0) - (cshape collide-shape :offset-assert 4) - (num-verts uint32 :offset-assert 8) - (num-edges uint32 :offset-assert 12) - (num-tris uint32 :offset-assert 16) - (cache-fill-box bounding-box :inline :offset-assert 32) - (within-reach-box bounding-box :inline :offset-assert 64) - (within-reach-box4w bounding-box4w :inline :offset-assert 96) - (search-pt vector :inline :offset-assert 128) - (search-dir-vec vector :inline :offset-assert 144) - (world-player-spheres sphere 12 :inline :offset-assert 160) - (world-player-hanging-spheres sphere 6 :inline :offset 160) - (world-player-leap-up-spheres sphere 6 :inline :offset 256) - (spec collide-edge-spec :inline :offset-assert 352) - (process (pointer process-drawable) :offset-assert 672) - (verts vector 64 :inline :offset-assert 688) - (edges collide-edge-edge 96 :inline :offset-assert 1712) - (tris collide-edge-tri 48 :inline :offset-assert 6320) - (hold-list collide-edge-hold-list :inline :offset-assert 7856) + ((ccache collide-cache) + (cshape collide-shape) + (num-verts uint32) + (num-edges uint32) + (num-tris uint32) + (cache-fill-box bounding-box :inline) + (within-reach-box bounding-box :inline) + (within-reach-box4w bounding-box4w :inline) + (search-pt vector :inline) + (search-dir-vec vector :inline) + (world-player-spheres sphere 12 :inline) + (world-player-hanging-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 0)) + (world-player-leap-up-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 6)) + (spec collide-edge-spec :inline) + (process (pointer process-drawable)) + (verts vector 64 :inline) + (edges collide-edge-edge 96 :inline) + (tris collide-edge-tri 48 :inline) + (hold-list collide-edge-hold-list :inline) ) - :method-count-assert 21 - :size-assert #x26c0 - :flag-assert #x15000026c0 (:methods - (search-for-edges (_type_ collide-edge-hold-list) none 9) - (debug-draw-edges (_type_) object 10) - (debug-draw-tris (_type_) none 11) - (debug-draw-sphere (_type_) none 12) - (find-adjacent-edge (_type_ collide-edge-hold-item edge-grab-info) none 13) - (compute-center-point! (_type_ collide-edge-edge vector) float 14) - (get-best-hand-point (_type_ vector vector int) float 15) - (find-grabbable-edges (_type_) none 16) - (find-grabbable-tris (_type_) none 17) - (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol 18) - (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol 19) - (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol 20) + (search-for-edges (_type_ collide-edge-hold-list) none) + (debug-draw-edges (_type_) object) + (debug-draw-tris (_type_) none) + (debug-draw-sphere (_type_) none) + (find-adjacent-edge (_type_ collide-edge-hold-item edge-grab-info) none) + (compute-center-point! (_type_ collide-edge-edge vector) float) + (get-best-hand-point (_type_ vector vector int) float) + (find-grabbable-edges (_type_) none) + (find-grabbable-tris (_type_) none) + (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol) + (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol) + (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol) ) ) diff --git a/goal_src/jak2/engine/collide/collide-edge-grab.gc b/goal_src/jak2/engine/collide/collide-edge-grab.gc index 2f2ba3bdcec..fd32c1205ad 100644 --- a/goal_src/jak2/engine/collide/collide-edge-grab.gc +++ b/goal_src/jak2/engine/collide/collide-edge-grab.gc @@ -8,7 +8,7 @@ ;; DECOMP BEGINS ;; WARN: Function (method 27 target) has a return type of none, but the expression builder found a return statement. -(defmethod do-edge-grabs target ((this target) (arg0 collide-cache) (arg1 collide-edge-spec)) +(defmethod do-edge-grabs ((this target) (arg0 collide-cache) (arg1 collide-edge-spec)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -88,7 +88,7 @@ ) ;; WARN: Function (method 9 collide-edge-work) has a return type of none, but the expression builder found a return statement. -(defmethod search-for-edges collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-list)) +(defmethod search-for-edges ((this collide-edge-work) (arg0 collide-edge-hold-list)) (set! (-> arg0 num-allocs) (the-as uint 0)) (set! (-> arg0 num-attempts) (the-as uint 0)) (set! (-> arg0 head) #f) @@ -118,21 +118,18 @@ (defmethod-mips2c "(method 10 collide-edge-hold-list)" 10 collide-edge-hold-list) (deftype pbhp-stack-vars (structure) - ((edge collide-edge-edge :offset-assert 0) - (allocated basic :offset-assert 4) - (neg-hold-pt vector :inline :offset-assert 16) - (split-vec vector :inline :offset-assert 32) + ((edge collide-edge-edge) + (allocated basic) + (neg-hold-pt vector :inline) + (split-vec vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (defmethod-mips2c "(method 19 collide-edge-work)" 19 collide-edge-work) ;; WARN: Return type mismatch int vs symbol. -(defmethod check-grab-for-collisions collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) +(defmethod check-grab-for-collisions ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) (local-vars (sv-656 vector) (sv-672 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -269,20 +266,17 @@ ) (deftype faei-stack-vars (structure) - ((hold-edge-vec-norm vector :inline :offset-assert 0) - (adj-edge-vec-norm vector :inline :offset-assert 16) - (found-left? symbol :offset-assert 32) - (left-dot float :offset-assert 36) - (found-right? symbol :offset-assert 40) - (right-dot float :offset-assert 44) + ((hold-edge-vec-norm vector :inline) + (adj-edge-vec-norm vector :inline) + (found-left? symbol) + (left-dot float) + (found-right? symbol) + (right-dot float) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) -(defmethod no-collision-at-edge collide-edge-edge ((this collide-edge-edge) (arg0 collide-edge-work) (arg1 edge-grab-info)) +(defmethod no-collision-at-edge ((this collide-edge-edge) (arg0 collide-edge-work) (arg1 edge-grab-info)) (let ((s4-0 (new 'stack-no-clear 'matrix)) (s5-0 (new 'stack-no-clear 'inline-array 'sphere 6)) ) @@ -313,7 +307,7 @@ ) ) -(defmethod find-adjacent-edge collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) +(defmethod find-adjacent-edge ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) (let ((s5-0 (new 'stack-no-clear 'faei-stack-vars))) (let* ((v1-0 (-> arg0 edge)) (s3-0 (-> v1-0 vertex-ptr 0 0)) @@ -376,14 +370,14 @@ (none) ) -;; todo: this wasn't mips2c i njak 1... +;; todo: this wasn't mips2c in jak 1... (defmethod-mips2c "(method 9 edge-grab-info)" 9 edge-grab-info) (defmethod-mips2c "(method 17 collide-edge-work)" 17 collide-edge-work) (defmethod-mips2c "(method 16 collide-edge-work)" 16 collide-edge-work) -(defmethod get-best-hand-point collide-edge-work ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod get-best-hand-point ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) (let ((f30-0 -1.0)) (let ((s2-0 (new 'stack-no-clear 'vector))) (dotimes (s1-0 (the-as int (-> this num-edges))) @@ -407,7 +401,7 @@ (defmethod-mips2c "(method 18 collide-edge-work)" 18 collide-edge-work) -(defmethod compute-center-point! collide-edge-work ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) +(defmethod compute-center-point! ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) (local-vars (v1-1 float) (v1-2 float) (v1-3 float)) (rlet ((Q :class vf) (vf0 :class vf) @@ -474,7 +468,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod debug-draw edge-grab-info ((this edge-grab-info)) +(defmethod debug-draw ((this edge-grab-info)) (add-debug-line #t (bucket-id debug-no-zbuf1) @@ -549,7 +543,7 @@ (none) ) -(defmethod debug-draw-edges collide-edge-work ((this collide-edge-work)) +(defmethod debug-draw-edges ((this collide-edge-work)) (local-vars (sv-32 (function _varargs_ object))) (let ((gp-0 0)) (dotimes (s4-0 (the-as int (-> this num-edges))) @@ -604,7 +598,7 @@ ) ) -(defmethod debug-draw-sphere collide-edge-work ((this collide-edge-work)) +(defmethod debug-draw-sphere ((this collide-edge-work)) (dotimes (s5-0 (the-as int (-> this num-verts))) (let ((a2-0 (-> this verts s5-0))) (add-debug-sphere #t (bucket-id debug-no-zbuf1) a2-0 (meters 0.2) (new 'static 'rgba :r #xff :g #xff :a #x80)) @@ -614,7 +608,7 @@ (none) ) -(defmethod debug-draw collide-edge-hold-list ((this collide-edge-hold-list)) +(defmethod debug-draw ((this collide-edge-hold-list)) (let ((s4-0 (-> this head)) (s5-0 0) ) @@ -678,7 +672,7 @@ (format *stdcon* "hold list has ~D attempt(s)~%" (-> this num-attempts)) ) -(defmethod debug-draw-tris collide-edge-work ((this collide-edge-work)) +(defmethod debug-draw-tris ((this collide-edge-work)) (dotimes (s5-0 (the-as int (-> this num-tris))) (let* ((v1-3 (-> this tris s5-0 ctri)) (t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-3 pat mode) color) a 64)) diff --git a/goal_src/jak2/engine/collide/collide-frag-h.gc b/goal_src/jak2/engine/collide/collide-frag-h.gc index ec84761bc99..4487ff0dd92 100644 --- a/goal_src/jak2/engine/collide/collide-frag-h.gc +++ b/goal_src/jak2/engine/collide/collide-frag-h.gc @@ -9,52 +9,37 @@ (deftype collide-frag-vertex (vector) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype collide-frag-mesh (basic) - ((packed-data uint32 :offset-assert 4) - (pat-array uint32 :offset-assert 8) - (strip-data-len uint16 :offset-assert 12) - (poly-count uint16 :offset-assert 14) - (base-trans vector4w :inline :offset-assert 16) - (vertex-count uint8 :offset 28) - (vertex-data-qwc uint8 :offset 29) - (total-qwc uint8 :offset 30) - (unused uint8 :offset 31) + ((packed-data uint32) + (pat-array uint32) + (strip-data-len uint16) + (poly-count uint16) + (base-trans vector4w :inline) + (vertex-count uint8 :overlay-at (-> base-trans data 3)) + (vertex-data-qwc uint8 :offset 29) + (total-qwc uint8 :offset 30) + (unused uint8 :offset 31) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype collide-fragment (drawable) - ((mesh collide-frag-mesh :offset 8) - (collide-new basic :offset 12) + ((mesh collide-frag-mesh :offset 8) + (collide-new basic :offset 12) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) (deftype drawable-inline-array-collide-fragment (drawable-inline-array) - ((data collide-fragment 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 64) + ((data collide-fragment 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 ) (deftype drawable-tree-collide-fragment (drawable-tree) () - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) diff --git a/goal_src/jak2/engine/collide/collide-frag.gc b/goal_src/jak2/engine/collide/collide-frag.gc index 6307a3db05a..b78bf6d3902 100644 --- a/goal_src/jak2/engine/collide/collide-frag.gc +++ b/goal_src/jak2/engine/collide/collide-frag.gc @@ -11,11 +11,11 @@ Note: this is probably not used in jak 2 - this is the old tree-based background ;; DECOMP BEGINS -(defmethod login drawable-tree-collide-fragment ((this drawable-tree-collide-fragment)) +(defmethod login ((this drawable-tree-collide-fragment)) this ) -(defmethod draw drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) (when *display-render-collision* (dotimes (s4-0 (-> this length)) (draw (-> this data s4-0) (-> this data s4-0) arg1) @@ -25,12 +25,12 @@ Note: this is probably not used in jak 2 - this is the old tree-based background (none) ) -(defmethod unpack-vis drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) ;; WARN: Return type mismatch int vs collide-fragment. -(defmethod mem-usage collide-fragment ((this collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-fragment) (arg0 memory-usage-block) (arg1 int)) (let ((s5-0 (if (logtest? arg1 1) 54 50 @@ -62,19 +62,19 @@ Note: this is probably not used in jak 2 - this is the old tree-based background ) ) -(defmethod login drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment)) +(defmethod login ((this drawable-inline-array-collide-fragment)) this ) -(defmethod draw collide-fragment ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) +(defmethod draw ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) 0 (none) ) -(defmethod draw drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) - (arg0 drawable-inline-array-collide-fragment) - (arg1 display-frame) - ) +(defmethod draw ((this drawable-inline-array-collide-fragment) + (arg0 drawable-inline-array-collide-fragment) + (arg1 display-frame) + ) (dotimes (s4-0 (-> this length)) (let ((s3-0 (-> this data s4-0))) (if (sphere-cull (-> s3-0 bsphere)) @@ -86,7 +86,7 @@ Note: this is probably not used in jak 2 - this is the old tree-based background (none) ) -(defmethod mem-usage drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) diff --git a/goal_src/jak2/engine/collide/collide-h.gc b/goal_src/jak2/engine/collide/collide-h.gc index b4d8bf1ef34..f0166bd6954 100644 --- a/goal_src/jak2/engine/collide/collide-h.gc +++ b/goal_src/jak2/engine/collide/collide-h.gc @@ -10,49 +10,46 @@ ;; DECOMP BEGINS (deftype collide-query (structure) - ((best-other-tri collide-tri-result :inline :offset-assert 0) - (best-my-tri collide-tri-result :inline :offset 0) - (ignore-processes process-tree 2 :offset-assert 88) - (ignore-process0 process-tree :offset 88) - (ignore-process1 process-tree :offset 92) - (ignore-pat pat-surface :offset-assert 96) - (ignore-pat-s32 int32 :offset 96) - (collide-with collide-spec :offset-assert 100) - (collide-with-s32 int32 :offset 100) - (overlay-params uint32 3 :offset 112) - (bbox bounding-box :inline :offset-assert 128) - (bbox4w bounding-box4w :inline :offset-assert 160) - (bsphere sphere :inline :offset-assert 192) - (start-pos vector :inline :offset-assert 208) - (move-dist vector :inline :offset-assert 224) - (rlength vector :inline :offset-assert 240) - (exit-planes plane 2 :inline :offset-assert 256) - (radius float :offset 268) - (inv-mat matrix :inline :offset 288) - (spheres (inline-array sphere) :offset 112) - (num-spheres uint32 :offset 116) - (solid-only symbol :offset 120) - (best-dist float :offset 112) - (best-other-prim collide-shape-prim :offset 116) - (best-my-prim collide-shape-prim :offset 120) - (move-vec vector :inline :offset 224) - (best-u float :offset 112) - (action-mask collide-action :offset-assert 352) - (local-box4w bounding-box4w :inline :offset-assert 368) - (search-box bounding-box4w :inline :offset-assert 400) - (search-vector vector4w :inline :offset-assert 432) - (instance-mat matrix :inline :offset-assert 448) - (instance-ptr basic :offset-assert 512) - (x-addr uint32 :offset-assert 516) - (x-step uint32 :offset-assert 520) - (y-addr uint32 :offset-assert 524) - (y-step uint32 :offset-assert 528) - (z-addr uint32 :offset-assert 532) - (z-step uint32 :offset-assert 536) + ((best-other-tri collide-tri-result :inline) + (best-my-tri collide-tri-result :inline :overlay-at best-other-tri) + (ignore-processes process-tree 2) + (ignore-process0 process-tree :overlay-at (-> ignore-processes 0)) + (ignore-process1 process-tree :overlay-at (-> ignore-processes 1)) + (ignore-pat pat-surface) + (ignore-pat-s32 int32 :overlay-at ignore-pat) + (collide-with collide-spec) + (collide-with-s32 int32 :overlay-at collide-with) + (overlay-params uint32 3 :offset 112) + (bbox bounding-box :inline) + (bbox4w bounding-box4w :inline) + (bsphere sphere :inline) + (start-pos vector :inline) + (move-dist vector :inline) + (rlength vector :inline) + (exit-planes plane 2 :inline) + (radius float :overlay-at (-> exit-planes 0 data 3)) + (inv-mat matrix :inline :offset 288) + (spheres (inline-array sphere) :overlay-at (-> overlay-params 0)) + (num-spheres uint32 :overlay-at (-> overlay-params 1)) + (solid-only symbol :overlay-at (-> overlay-params 2)) + (best-dist float :overlay-at spheres) + (best-other-prim collide-shape-prim :overlay-at num-spheres) + (best-my-prim collide-shape-prim :overlay-at solid-only) + (move-vec vector :inline :overlay-at move-dist) + (best-u float :overlay-at best-dist) + (action-mask collide-action) + (local-box4w bounding-box4w :inline) + (search-box bounding-box4w :inline) + (search-vector vector4w :inline) + (instance-mat matrix :inline) + (instance-ptr basic) + (x-addr uint32) + (x-step uint32) + (y-addr uint32) + (y-step uint32) + (z-addr uint32) + (z-step uint32) ) - :method-count-assert 9 - :size-assert #x21c - :flag-assert #x90000021c ) diff --git a/goal_src/jak2/engine/collide/collide-mesh-h.gc b/goal_src/jak2/engine/collide/collide-mesh-h.gc index ee23dc7add6..9cfadc6fd2e 100644 --- a/goal_src/jak2/engine/collide/collide-mesh-h.gc +++ b/goal_src/jak2/engine/collide/collide-mesh-h.gc @@ -11,92 +11,74 @@ ;; DECOMP BEGINS (deftype collide-tri-result (structure) - ((vertex vector 3 :inline :offset-assert 0) - (intersect vector :inline :offset-assert 48) - (normal vector :inline :offset-assert 64) - (pat pat-surface :offset-assert 80) - (collide-ptr basic :offset-assert 84) + ((vertex vector 3 :inline) + (intersect vector :inline) + (normal vector :inline) + (pat pat-surface) + (collide-ptr basic) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) (deftype collide-mesh-tri (structure) - ((vertex-index uint8 3 :offset-assert 0) - (unused uint8 :offset-assert 3) - (pat pat-surface :offset-assert 4) + ((vertex-index uint8 3) + (unused uint8) + (pat pat-surface) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype collide-mesh (basic) - ((joint-id int32 :offset-assert 4) - (num-tris uint32 :offset-assert 8) - (num-verts uint32 :offset-assert 12) - (vertex-data (inline-array vector) :offset-assert 16) - (tris collide-mesh-tri 1 :inline :offset 32) + ((joint-id int32) + (num-tris uint32) + (num-verts uint32) + (vertex-data (inline-array vector)) + (tris collide-mesh-tri 1 :inline :offset 32) ) - :method-count-assert 16 - :size-assert #x28 - :flag-assert #x1000000028 (:methods - (debug-draw-tris (_type_ process-drawable int) none 9) - (overlap-test (_type_ collide-mesh-cache-tri vector) symbol 10) - (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 11) - (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 12) - (unpack-mesh-to-cache! (_type_ (inline-array collide-mesh-cache-tri) matrix) none 13) - (collide-mesh-math-1 (_type_ object object) none 14) - (collide-mesh-math-2 (_type_ object object object) none 15) + (debug-draw-tris (_type_ process-drawable int) none) + (overlap-test (_type_ collide-mesh-cache-tri vector) symbol) + (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (unpack-mesh-to-cache! (_type_ (inline-array collide-mesh-cache-tri) matrix) none) + (collide-mesh-math-1 (_type_ object object) none) + (collide-mesh-math-2 (_type_ object object object) none) ) ) (deftype collide-mesh-cache-tri (structure) - ((vertex vector 3 :inline :offset-assert 0) - (normal vector :inline :offset-assert 48) - (bbox4w bounding-box4w :inline :offset-assert 64) - (pat pat-surface :offset 60) + ((vertex vector 3 :inline) + (normal vector :inline) + (bbox4w bounding-box4w :inline) + (pat pat-surface :overlay-at (-> normal data 3)) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) (deftype collide-mesh-cache-entry (structure) - ((mat matrix :inline :offset-assert 0) - (tris collide-mesh-cache-tri :inline :dynamic :offset-assert 64) + ((mat matrix :inline) + (tris collide-mesh-cache-tri :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype collide-mesh-cache (basic) - ((used-size uint32 :offset-assert 4) - (max-size uint32 :offset-assert 8) - (id uint32 :offset-assert 12) - (data uint8 48000 :offset-assert 16) + ((used-size uint32) + (max-size uint32) + (id uint32) + (data uint8 48000) ) - :method-count-assert 13 - :size-assert #xbb90 - :flag-assert #xd0000bb90 (:methods - (populate-for-prim-mesh (_type_ collide-shape-prim-mesh) collide-mesh-cache-entry 9) - (is-id? (_type_ int) symbol 10) - (next-id! (_type_) uint 11) - (allocate! (_type_ int) collide-mesh-cache-entry 12) + (populate-for-prim-mesh (_type_ collide-shape-prim-mesh) collide-mesh-cache-entry) + (is-id? (_type_ int) symbol) + (next-id! (_type_) uint) + (allocate! (_type_ int) collide-mesh-cache-entry) ) ) -(defmethod next-id! collide-mesh-cache ((this collide-mesh-cache)) +(defmethod next-id! ((this collide-mesh-cache)) "Reset all used entries in the cache and increment the id. If the id is zero, set it to 1" ;; ld v1, 12(a0) @@ -118,7 +100,7 @@ ) ) -(defmethod is-id? collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) +(defmethod is-id? ((this collide-mesh-cache) (arg0 int)) (= (-> this id) arg0) ) diff --git a/goal_src/jak2/engine/collide/collide-mesh.gc b/goal_src/jak2/engine/collide/collide-mesh.gc index e8ba4070177..8b301841c61 100644 --- a/goal_src/jak2/engine/collide/collide-mesh.gc +++ b/goal_src/jak2/engine/collide/collide-mesh.gc @@ -28,11 +28,11 @@ Another limitation is that triangles don't have per-tri pat info. ;; DECOMP BEGINS -(defmethod asize-of collide-mesh ((this collide-mesh)) +(defmethod asize-of ((this collide-mesh)) (the-as int (+ (-> collide-mesh size) (* (+ (-> this num-tris) -1) 8))) ) -(defmethod mem-usage collide-mesh ((this collide-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 82 (-> arg0 length))) (set! (-> arg0 data 81 name) "collide-mesh") (+! (-> arg0 data 81 count) 1) @@ -50,7 +50,7 @@ Another limitation is that triangles don't have per-tri pat info. (the-as collide-mesh 0) ) -(defmethod debug-draw-tris collide-mesh ((this collide-mesh) (arg0 process-drawable) (arg1 int)) +(defmethod debug-draw-tris ((this collide-mesh) (arg0 process-drawable) (arg1 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -70,9 +70,9 @@ Another limitation is that triangles don't have per-tri pat info. (a3-0 (new 'stack-no-clear 'vector)) (t0-0 (new 'stack-no-clear 'vector)) ) - (.lvf vf4 (&-> s4-0 vector 0 quad)) - (.lvf vf5 (&-> s4-0 vector 1 quad)) - (.lvf vf6 (&-> s4-0 vector 2 quad)) + (.lvf vf4 (&-> s4-0 quad 0)) + (.lvf vf5 (&-> s4-0 quad 1)) + (.lvf vf6 (&-> s4-0 quad 2)) (.lvf vf7 (&-> s4-0 trans quad)) (.lvf vf1 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 0)) quad)) (.lvf vf2 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 1)) quad)) @@ -110,14 +110,12 @@ Another limitation is that triangles don't have per-tri pat info. ;;;;;;;;;;;;;;;;;;;;;;; (deftype sopt-work (structure) - ((intersect vector :inline :offset-assert 0) - (sphere-bbox4w bounding-box4w :inline :offset-assert 16) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (defmethod-mips2c "(method 12 collide-mesh)" 12 collide-mesh) @@ -126,15 +124,12 @@ Another limitation is that triangles don't have per-tri pat info. ;;;;;;;;;;;;;;;;;;;;; (deftype spat-work (structure) - ((intersect vector :inline :offset-assert 0) - (sphere-bbox4w bounding-box4w :inline :offset-assert 16) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) -(defmethod should-push-away-test collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 collide-tri-result) (arg2 vector) (arg3 float)) +(defmethod should-push-away-test ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 collide-tri-result) (arg2 vector) (arg3 float)) (local-vars (v1-0 uint128) (a0-1 uint128) @@ -269,13 +264,14 @@ Another limitation is that triangles don't have per-tri pat info. ;; these two are unknown. (defmethod-mips2c "(method 14 collide-mesh)" 14 collide-mesh) + (defmethod-mips2c "(method 15 collide-mesh)" 15 collide-mesh) ;;;;;;;;;;;;;;;;;;;;;; ;; Collide Mesh Cache ;;;;;;;;;;;;;;;;;;;;;; -(defmethod populate-for-prim-mesh collide-mesh-cache ((this collide-mesh-cache) (arg0 collide-shape-prim-mesh)) +(defmethod populate-for-prim-mesh ((this collide-mesh-cache) (arg0 collide-shape-prim-mesh)) "Populate the mesh cache for the given prim-mesh. Will reuse existing data only if the transform and object are the same." (local-vars @@ -295,19 +291,19 @@ Another limitation is that triangles don't have per-tri pat info. (cond ((= (-> arg0 mesh-cache-id) (-> this id)) ;; check id first ;; this weird pxor stuff is checking the transform for equality - (let ((v1-6 (-> s5-0 vector 0 quad)) - (a0-4 (-> s4-0 mat vector 0 quad)) + (let ((v1-6 (-> s5-0 quad 0)) + (a0-4 (-> s4-0 mat quad 0)) ) (.pxor v1-7 v1-6 a0-4) ) - (let ((a0-5 (-> s5-0 vector 1 quad)) - (a1-1 (-> s4-0 mat vector 1 quad)) + (let ((a0-5 (-> s5-0 quad 1)) + (a1-1 (-> s4-0 mat quad 1)) ) (.pxor a0-6 a0-5 a1-1) ) (.por v1-8 v1-7 a0-6) - (let ((a0-7 (-> s5-0 vector 2 quad)) - (a1-2 (-> s4-0 mat vector 2 quad)) + (let ((a0-7 (-> s5-0 quad 2)) + (a1-2 (-> s4-0 mat quad 2)) ) (.pxor a0-8 a0-7 a1-2) ) @@ -324,9 +320,9 @@ Another limitation is that triangles don't have per-tri pat info. ) (when (nonzero? v1-11) ;; the id is equal, but the transform isn't. update transform - (set! (-> s4-0 mat vector 0 quad) (-> s5-0 vector 0 quad)) - (set! (-> s4-0 mat vector 1 quad) (-> s5-0 vector 1 quad)) - (set! (-> s4-0 mat vector 2 quad) (-> s5-0 vector 2 quad)) + (set! (-> s4-0 mat quad 0) (-> s5-0 quad 0)) + (set! (-> s4-0 mat quad 1) (-> s5-0 quad 1)) + (set! (-> s4-0 mat quad 2) (-> s5-0 quad 2)) (set! (-> s4-0 mat trans quad) (-> s5-0 trans quad)) ;; and unpack to cache again. (unpack-mesh-to-cache! (-> arg0 mesh) (-> s4-0 tris) s5-0) @@ -344,9 +340,9 @@ Another limitation is that triangles don't have per-tri pat info. (s4-0 ;; if allocation succeeds, set up: (set! (-> arg0 mesh-cache-id) (-> this id)) - (set! (-> s4-0 mat vector 0 quad) (-> s5-0 vector 0 quad)) - (set! (-> s4-0 mat vector 1 quad) (-> s5-0 vector 1 quad)) - (set! (-> s4-0 mat vector 2 quad) (-> s5-0 vector 2 quad)) + (set! (-> s4-0 mat quad 0) (-> s5-0 quad 0)) + (set! (-> s4-0 mat quad 1) (-> s5-0 quad 1)) + (set! (-> s4-0 mat quad 2) (-> s5-0 quad 2)) (set! (-> s4-0 mat trans quad) (-> s5-0 trans quad)) ;; and unpack. (unpack-mesh-to-cache! (-> arg0 mesh) (-> s4-0 tris) s5-0) @@ -364,7 +360,7 @@ Another limitation is that triangles don't have per-tri pat info. ) ) -(defmethod allocate! collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) +(defmethod allocate! ((this collide-mesh-cache) (arg0 int)) "Allocate room in the collide-mesh-cache for an unpacked mesh with arg0 tris." (local-vars (a1-2 int) (a2-2 int)) (let* ((v1-0 (+ arg0 15)) @@ -399,7 +395,7 @@ Another limitation is that triangles don't have per-tri pat info. ) ) -(defmethod unpack-mesh-to-cache! collide-mesh ((this collide-mesh) (arg0 (inline-array collide-mesh-cache-tri)) (arg1 matrix)) +(defmethod unpack-mesh-to-cache! ((this collide-mesh) (arg0 (inline-array collide-mesh-cache-tri)) (arg1 matrix)) "Unpack mesh and store in cache. Transform triangles, computes normals and bbox." (local-vars (t0-2 uint)) @@ -426,12 +422,12 @@ Another limitation is that triangles don't have per-tri pat info. ) (nop!) (let ((a3-0 (the-as object (-> this vertex-data)))) - (b! (zero? v1-0) cfg-3 :delay (.lvf vf1 (&-> arg1 vector 0 quad))) + (b! (zero? v1-0) cfg-3 :delay (.lvf vf1 (&-> arg1 quad 0))) (nop!) - (.lvf vf2 (&-> arg1 vector 1 quad)) + (.lvf vf2 (&-> arg1 quad 1)) ;; this first loop does the transformation. (let ((t0-1 (the-as object (+ t0-0 -64)))) - (.lvf vf3 (&-> arg1 vector 2 quad)) + (.lvf vf3 (&-> arg1 quad 2)) (nop!) (.lvf vf4 (&-> arg1 trans quad)) (nop!) @@ -578,15 +574,13 @@ Another limitation is that triangles don't have per-tri pat info. ;; this checks to see if a point is inside the mesh or not. (deftype oot-work (structure) - ((intersect vector :inline :offset-assert 0) - (sphere-bbox4w bounding-box4w :inline :offset-assert 16) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) -(defmethod overlap-test collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) + +(defmethod overlap-test ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) (local-vars (v1-0 uint128) (a0-1 uint128) diff --git a/goal_src/jak2/engine/collide/collide-shape-h.gc b/goal_src/jak2/engine/collide/collide-shape-h.gc index e755f61a6d2..ad3ffe0aac1 100644 --- a/goal_src/jak2/engine/collide/collide-shape-h.gc +++ b/goal_src/jak2/engine/collide/collide-shape-h.gc @@ -247,32 +247,26 @@ ;; DECOMP BEGINS (deftype collide-rider (structure) - ((rider-handle handle :offset-assert 0) - (sticky-prim collide-shape-prim :offset-assert 8) - (prim-ry float :offset-assert 12) - (rider-local-pos vector :inline :offset-assert 16) + ((rider-handle handle) + (sticky-prim collide-shape-prim) + (prim-ry float) + (rider-local-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype collide-rider-pool (basic) - ((alloc-count int32 :offset-assert 4) - (riders collide-rider 20 :inline :offset-assert 16) + ((alloc-count int32) + (riders collide-rider 20 :inline) ) - :method-count-assert 11 - :size-assert #x290 - :flag-assert #xb00000290 (:methods - (add-rider (_type_ handle) collide-rider 9) - (prepare (_type_) none 10) + (add-rider (_type_ handle) collide-rider) + (prepare (_type_) none) ) ) -(defmethod prepare collide-rider-pool ((this collide-rider-pool)) +(defmethod prepare ((this collide-rider-pool)) "Gets this pool ready to be used to allow allocations. This should be called once at the start of every frame." (set! (-> this alloc-count) 0) 0 @@ -280,14 +274,11 @@ ) (deftype pull-rider-info (structure) - ((rider collide-rider :offset-assert 0) - (rider-cshape collide-shape-moving :offset-assert 4) - (rider-delta-ry float :offset-assert 8) - (rider-dest vector :inline :offset-assert 16) + ((rider collide-rider) + (rider-cshape collide-shape-moving) + (rider-delta-ry float) + (rider-dest vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) @@ -295,240 +286,213 @@ (define *collide-hit-by-player-list* (new 'global 'engine 'collide-hit-by-player-list (* 640 PROCESS_HEAP_MULT) connection)) -(define *collide-hit-by-others-list* (new 'global 'engine 'collide-hit-by-others-list PROCESS_HEAP_MAX connection)) +(define *collide-hit-by-others-list* (new 'global 'engine 'collide-hit-by-others-list (* 768 PROCESS_HEAP_MULT) connection)) (define *collide-player-list* (new 'global 'engine 'collide-player-list 32 connection)) (kmemclose) (deftype overlaps-others-params (structure) - ((options overlaps-others-options :offset-assert 0) - (collide-with-filter collide-spec :offset-assert 4) - (tlist touching-list :offset-assert 8) - (filtered-root-collide-with collide-spec :offset-assert 12) - (filtered-child-collide-with collide-spec :offset-assert 16) - (filtered-other-collide-as collide-spec :offset-assert 20) + ((options overlaps-others-options) + (collide-with-filter collide-spec) + (tlist touching-list) + (filtered-root-collide-with collide-spec) + (filtered-child-collide-with collide-spec) + (filtered-other-collide-as collide-spec) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype move-above-ground-params (structure) - ((gnd-collide-with collide-spec :offset-assert 0) - (popup float :offset-assert 4) - (dont-move-if-overlaps? symbol :offset-assert 8) - (hover-if-no-ground? symbol :offset-assert 12) - (overlaps-params overlaps-others-params :inline :offset-assert 16) - (new-pos vector :inline :offset-assert 48) - (old-gspot-pos vector :inline :offset-assert 64) - (old-gspot-normal vector :inline :offset-assert 80) - (pat pat-surface :offset-assert 96) - (on-ground? symbol :offset-assert 100) - (do-move? symbol :offset-assert 104) + ((gnd-collide-with collide-spec) + (popup float) + (dont-move-if-overlaps? symbol) + (hover-if-no-ground? symbol) + (overlaps-params overlaps-others-params :inline) + (new-pos vector :inline) + (old-gspot-pos vector :inline) + (old-gspot-normal vector :inline) + (pat pat-surface) + (on-ground? symbol) + (do-move? symbol) ) - :method-count-assert 9 - :size-assert #x6c - :flag-assert #x90000006c ) (deftype collide-prim-core (structure) - ((world-sphere vector :inline :offset-assert 0) - (collide-as collide-spec :offset 16) - (collide-with collide-spec :offset-assert 20) - (action collide-action :offset-assert 24) - (prim-type prim-type :offset-assert 28) - (unused1 uint8 3 :offset-assert 29) - (quad uint128 2 :offset 0) + ((world-sphere vector :inline) + (collide-as collide-spec :offset 16) + (collide-with collide-spec) + (action collide-action) + (prim-type prim-type) + (unused1 uint8 3) + (quad uint128 2 :overlay-at (-> world-sphere data 0)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype collide-shape-prim (basic) - ((cshape collide-shape :offset-assert 4) - (prim-id uint32 :offset-assert 8) - (transform-index int8 :offset-assert 12) - (unused2 int8 3 :offset-assert 13) - (prim-core collide-prim-core :inline :offset-assert 16) - (local-sphere vector :inline :offset-assert 48) - (world-sphere vector :inline :offset 16) - (collide-as collide-spec :offset 32) - (collide-with collide-spec :offset 36) - (action collide-action :offset 40) - (prim-type int8 :offset 44) - (radius float :offset 60) - (specific uint8 16 :offset-assert 64) + ((cshape collide-shape) + (prim-id uint32) + (transform-index int8) + (unused2 int8 3) + (prim-core collide-prim-core :inline) + (local-sphere vector :inline) + (world-sphere vector :inline :overlay-at (-> prim-core world-sphere)) + (collide-as collide-spec :overlay-at (-> prim-core collide-as)) + (collide-with collide-spec :overlay-at (-> prim-core collide-with)) + (action collide-action :overlay-at (-> prim-core action)) + (prim-type int8 :overlay-at (-> prim-core prim-type)) + (radius float :overlay-at (-> local-sphere data 3)) + (specific uint8 16) ) - :method-count-assert 20 - :size-assert #x50 - :flag-assert #x1400000050 (:methods - (new (symbol type collide-shape uint int) _type_ 0) - (debug-draw (_type_) none 9) - (add-fg-prim-using-box (_type_ collide-cache) none 10) - (add-fg-prim-using-line-sphere (_type_ collide-cache object) none 11) - (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 12) - (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 13) - (collide-shape-prim-method-14 () none 14) - (collide-with-collide-cache-prim-mesh (_type_ collide-query collide-cache-prim) none 15) - (collide-with-collide-cache-prim-sphere (_type_ collide-query collide-cache-prim) none 16) - (on-platform-test (_type_ collide-shape-prim collide-query float) none 17) - (should-push-away-test (_type_ collide-shape-prim collide-query) none 18) - (should-push-away-a-group-test (_type_ collide-shape-prim-group collide-query) none 19) + (new (symbol type collide-shape uint int) _type_) + (debug-draw (_type_) none) + (add-fg-prim-using-box (_type_ collide-cache) none) + (add-fg-prim-using-line-sphere (_type_ collide-cache object) none) + (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol) + (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol) + (collide-shape-prim-method-14 () none) + (collide-with-collide-cache-prim-mesh (_type_ collide-query collide-cache-prim) none) + (collide-with-collide-cache-prim-sphere (_type_ collide-query collide-cache-prim) none) + (on-platform-test (_type_ collide-shape-prim collide-query float) none) + (should-push-away-test (_type_ collide-shape-prim collide-query) none) + (should-push-away-a-group-test (_type_ collide-shape-prim-group collide-query) none) ) ) (deftype collide-shape-prim-sphere (collide-shape-prim) - ((pat pat-surface :offset 64) - (nav-radius float :offset 68) + ((pat pat-surface :overlay-at (-> specific 0)) + (nav-radius float :overlay-at (-> specific 4)) ) - :method-count-assert 20 - :size-assert #x50 - :flag-assert #x1400000050 (:methods - (new (symbol type collide-shape uint) _type_ 0) + (new (symbol type collide-shape uint) _type_) ) ) (deftype collide-shape-prim-mesh (collide-shape-prim) - ((mesh collide-mesh :offset 64) - (mesh-id int32 :offset 68) - (mesh-cache-id uint32 :offset 72) - (mesh-cache-entry collide-mesh-cache-entry :offset 76) + ((mesh collide-mesh :overlay-at (-> specific 0)) + (mesh-id int32 :overlay-at (-> specific 4)) + (mesh-cache-id uint32 :overlay-at (-> specific 8)) + (mesh-cache-entry collide-mesh-cache-entry :overlay-at (-> specific 12)) ) - :method-count-assert 20 - :size-assert #x50 - :flag-assert #x1400000050 (:methods - (new (symbol type collide-shape uint uint) _type_ 0) + (new (symbol type collide-shape uint uint) _type_) ) ) (deftype collide-shape-prim-group (collide-shape-prim) - ((num-children uint8 :offset 64) - (num-alloc-children uint8 :offset 65) - (child (inline-array collide-shape-prim) :offset 68) + ((num-children uint8 :overlay-at (-> specific 0)) + (num-alloc-children uint8 :overlay-at (-> specific 1)) + (child (inline-array collide-shape-prim) :overlay-at (-> specific 4)) ) - :method-count-assert 20 - :size-assert #x50 - :flag-assert #x1400000050 (:methods - (new (symbol type collide-shape uint int) _type_ 0) + (new (symbol type collide-shape uint int) _type_) ) ) (deftype collide-shape (trsqv) - ((actor-hash-index int16 :offset 12) - (process process-drawable :offset-assert 140) - (max-iteration-count uint8 :offset-assert 144) - (nav-flags nav-flags :offset-assert 145) - (total-prims uint8 :offset-assert 146) - (num-riders uint8 :offset-assert 147) - (pat-ignore-mask pat-surface :offset-assert 148) - (event-self symbol :offset-assert 152) - (event-other symbol :offset-assert 156) - (root-prim collide-shape-prim :offset-assert 160) - (riders (inline-array collide-rider) :offset-assert 164) - (penetrate-using penetrate :offset-assert 168) - (penetrated-by penetrate :offset-assert 176) - (backup-collide-as collide-spec :offset-assert 184) - (backup-collide-with collide-spec :offset-assert 188) - (event-priority uint8 :offset-assert 192) - (rider-max-momentum float :offset-assert 196) + ((actor-hash-index int16 :offset 12) + (process process-drawable) + (max-iteration-count uint8) + (nav-flags nav-flags) + (total-prims uint8) + (num-riders uint8) + (pat-ignore-mask pat-surface) + (event-self symbol) + (event-other symbol) + (root-prim collide-shape-prim) + (riders (inline-array collide-rider)) + (penetrate-using penetrate) + (penetrated-by penetrate) + (backup-collide-as collide-spec) + (backup-collide-with collide-spec) + (event-priority uint8) + (rider-max-momentum float) ) - :method-count-assert 55 - :size-assert #xc8 - :flag-assert #x37000000c8 (:methods - (new (symbol type process-drawable collide-list-enum) _type_ 0) - (move-by-vector! (_type_ vector) none 28) - (move-to-point! (_type_ vector) none 29) - (debug-draw (_type_) none 30) - (fill-cache-for-shape (_type_ float collide-query) none 31) - (fill-cache-integrate-and-collide (_type_ vector collide-query meters) none 32) - (find-prim-by-id (_type_ uint) collide-shape-prim 33) - (find-prim-by-id-logtest (_type_ uint) collide-shape-prim 34) - (detect-riders! (_type_) symbol 35) - (build-bounding-box-for-shape (_type_ bounding-box float collide-spec) symbol 36) - (integrate-and-collide! (_type_ vector) none 37) - (find-collision-meshes (_type_) none 38) - (on-platform (_type_ collide-shape collide-query) symbol 39) - (find-overlapping-shapes (_type_ overlaps-others-params) symbol 40) - (shove-to-closest-point-on-path (_type_ attack-info float) vector 41) - (should-push-away (_type_ collide-shape collide-query) symbol 42) - (pull-rider! (_type_ pull-rider-info) none 43) - (pull-riders! (_type_) symbol 44) - (do-push-aways (_type_) collide-spec 45) - (update-transforms (_type_) none 46) - (set-collide-with! (_type_ collide-spec) none 47) - (set-collide-as! (_type_ collide-spec) none 48) - (modify-collide-as! (_type_ int collide-spec collide-spec) none 49) - (send-shoves (_type_ process touching-shapes-entry float float float) symbol 50) - (above-ground? (_type_ collide-query vector collide-spec float float float) symbol 51) - (water-info-init! (_type_ water-info collide-action) water-info 52) - (iterate-prims (_type_ (function collide-shape-prim none)) none 53) - (pusher-init (_type_) none 54) + (new (symbol type process-drawable collide-list-enum) _type_) + (move-by-vector! (_type_ vector) none) + (move-to-point! (_type_ vector) none) + (debug-draw (_type_) none) + (fill-cache-for-shape (_type_ float collide-query) none) + (fill-cache-integrate-and-collide (_type_ vector collide-query meters) none) + (find-prim-by-id (_type_ uint) collide-shape-prim) + (find-prim-by-id-logtest (_type_ uint) collide-shape-prim) + (detect-riders! (_type_) symbol) + (build-bounding-box-for-shape (_type_ bounding-box float collide-spec) symbol) + (integrate-and-collide! (_type_ vector) none) + (find-collision-meshes (_type_) none) + (on-platform (_type_ collide-shape collide-query) symbol) + (find-overlapping-shapes (_type_ overlaps-others-params) symbol) + (shove-to-closest-point-on-path (_type_ attack-info float) vector) + (should-push-away (_type_ collide-shape collide-query) symbol) + (pull-rider! (_type_ pull-rider-info) none) + (pull-riders! (_type_) symbol) + (do-push-aways (_type_) collide-spec) + (update-transforms (_type_) none) + (set-collide-with! (_type_ collide-spec) none) + (set-collide-as! (_type_ collide-spec) none) + (modify-collide-as! (_type_ int collide-spec collide-spec) none) + (send-shoves (_type_ process touching-shapes-entry float float float) symbol) + (above-ground? (_type_ collide-query vector collide-spec float float float) symbol) + (water-info-init! (_type_ water-info collide-action) water-info) + (iterate-prims (_type_ (function collide-shape-prim none)) none) + (pusher-init (_type_) none) ) ) (deftype collide-shape-moving (collide-shape) - ((rider-time time-frame :offset-assert 200) - (rider-last-move vector :inline :offset-assert 208) - (trans-old vector :inline :offset-assert 224) - (trans-old-old vector :inline :offset 240) - (trans-old-old-old vector :inline :offset 256) - (poly-pat pat-surface :offset 272) - (cur-pat pat-surface :offset-assert 276) - (ground-pat pat-surface :offset-assert 280) - (status collide-status :offset-assert 288) - (old-status collide-status :offset-assert 296) - (prev-status collide-status :offset-assert 304) - (reaction-flag cshape-reaction-flags :offset-assert 312) - (reaction (function control-info collide-query vector vector collide-status) :offset-assert 316) - (no-reaction (function collide-shape-moving collide-query vector vector object) :offset-assert 320) - (local-normal vector :inline :offset-assert 336) - (surface-normal vector :inline :offset-assert 352) - (poly-normal vector :inline :offset-assert 368) - (ground-poly-normal vector :inline :offset-assert 384) - (gspot-pos vector :inline :offset-assert 400) - (gspot-normal vector :inline :offset-assert 416) - (grount-touch-point vector :inline :offset-assert 432) - (ground-impact-vel meters :offset-assert 448) - (surface-angle float :offset-assert 452) - (poly-angle float :offset-assert 456) - (touch-angle float :offset-assert 460) - (coverage float :offset-assert 464) - (dynam dynamics :offset-assert 468) - (surf surface :offset-assert 472) + ((rider-time time-frame) + (rider-last-move vector :inline) + (trans-old vector :inline) + (trans-old-old vector :inline :offset 240) + (trans-old-old-old vector :inline :offset 256) + (poly-pat pat-surface :offset 272) + (cur-pat pat-surface) + (ground-pat pat-surface) + (status collide-status) + (old-status collide-status) + (prev-status collide-status) + (reaction-flag cshape-reaction-flags) + (reaction (function control-info collide-query vector vector collide-status)) + (no-reaction (function collide-shape-moving collide-query vector vector object)) + (local-normal vector :inline) + (surface-normal vector :inline) + (poly-normal vector :inline) + (ground-poly-normal vector :inline) + (gspot-pos vector :inline) + (gspot-normal vector :inline) + (grount-touch-point vector :inline) + (ground-impact-vel meters) + (surface-angle float) + (poly-angle float) + (touch-angle float) + (coverage float) + (dynam dynamics) + (surf surface) ) - :method-count-assert 68 - :size-assert #x1dc - :flag-assert #x44000001dc (:methods - (new (symbol type process-drawable collide-list-enum) _type_ 0) - (find-ground (_type_ collide-query collide-spec float float float) symbol 55) - (react-to-pat! (_type_ pat-surface) cshape-reaction-flags 56) - (integrate-no-collide! (_type_ vector) none 57) - (integrate-for-enemy-no-mtg (_type_ vector overlaps-others-params) symbol 58) - (move-above-ground (_type_ vector move-above-ground-params) none 59) - (move-to-ground (_type_ float float symbol collide-spec) none 60) - (move-to-ground-point (_type_ vector vector vector) none 61) - (compute-acc-due-to-gravity (_type_ vector float) vector 62) - (collide-shape-moving-method-63 (_type_ rigid-body float) none 63) - (try-snap-to-surface (_type_ vector float float float) symbol 64) - (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol 65) - (step-collison! (_type_ vector vector float int) float 66) - (collide-with-all-collide-cache-prims (_type_ matrix collide-query) none 67) + (new (symbol type process-drawable collide-list-enum) _type_) + (find-ground (_type_ collide-query collide-spec float float float) symbol) + (react-to-pat! (_type_ pat-surface) cshape-reaction-flags) + (integrate-no-collide! (_type_ vector) none) + (integrate-for-enemy-no-mtg (_type_ vector overlaps-others-params) symbol) + (move-above-ground (_type_ vector move-above-ground-params) none) + (move-to-ground (_type_ float float symbol collide-spec) none) + (move-to-ground-point (_type_ vector vector vector) none) + (compute-acc-due-to-gravity (_type_ vector float) vector) + (collide-shape-moving-method-63 (_type_ rigid-body float) none) + (try-snap-to-surface (_type_ vector float float float) symbol) + (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol) + (step-collison! (_type_ vector vector float int) float) + (collide-with-all-collide-cache-prims (_type_ matrix collide-query) none) ) ) @@ -582,7 +546,7 @@ ) ;; WARN: Return type mismatch uint vs int. -(defmethod length collide-shape-prim-group ((this collide-shape-prim-group)) +(defmethod length ((this collide-shape-prim-group)) (the-as int (-> this num-children)) ) @@ -672,6 +636,7 @@ (define-perm *collide-rider-pool* collide-rider-pool (new 'global 'collide-rider-pool)) +;; og:preserve-this added macro (defmacro normalized-heading-to-quaternion! (quat heading) "Modified for PC. This does a clever trick, but it doesn't work if the heading is exactly [0, 0, -1] because this tries to normalize a quaternion that's all 0's. diff --git a/goal_src/jak2/engine/collide/collide-shape-rider.gc b/goal_src/jak2/engine/collide/collide-shape-rider.gc index e0fab0f9ca7..13891623dac 100644 --- a/goal_src/jak2/engine/collide/collide-shape-rider.gc +++ b/goal_src/jak2/engine/collide/collide-shape-rider.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod on-platform collide-shape ((this collide-shape) (arg0 collide-shape) (arg1 collide-query)) +(defmethod on-platform ((this collide-shape) (arg0 collide-shape) (arg1 collide-query)) (let ((v1-0 arg1)) (set! (-> v1-0 best-dist) 0.0) (set! (-> v1-0 best-my-prim) #f) @@ -38,12 +38,12 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod on-platform-test collide-shape-prim ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) +(defmethod on-platform-test ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%") (none) ) -(defmethod on-platform-test collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) +(defmethod on-platform-test ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (let ((s4-0 (-> arg0 prim-core collide-as)) (s3-0 (-> this child 0)) ) @@ -71,7 +71,7 @@ ) ;; WARN: Return type mismatch pat-surface vs none. -(defmethod on-platform-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) +(defmethod on-platform-test ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (case (-> arg0 type) ((collide-shape-prim-group) (let ((s4-0 (-> this prim-core collide-with)) @@ -135,7 +135,7 @@ (none) ) -(defmethod add-rider collide-rider-pool ((this collide-rider-pool) (arg0 handle)) +(defmethod add-rider ((this collide-rider-pool) (arg0 handle)) (let ((v1-0 (-> this alloc-count))) (cond ((< v1-0 20) @@ -155,7 +155,7 @@ ) ;; WARN: Return type mismatch joint-control-status vs symbol. -(defmethod detect-riders! collide-shape ((this collide-shape)) +(defmethod detect-riders! ((this collide-shape)) (local-vars (v0-7 joint-control-status) (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -314,7 +314,7 @@ ) ;; WARN: Return type mismatch int vs symbol. -(defmethod pull-riders! collide-shape ((this collide-shape)) +(defmethod pull-riders! ((this collide-shape)) (let ((s5-0 (-> this riders))) (when s5-0 (let ((s4-0 (new 'stack-no-clear 'pull-rider-info))) @@ -349,7 +349,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod pull-rider! collide-shape ((this collide-shape) (arg0 pull-rider-info)) +(defmethod pull-rider! ((this collide-shape) (arg0 pull-rider-info)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) diff --git a/goal_src/jak2/engine/collide/collide-shape.gc b/goal_src/jak2/engine/collide/collide-shape.gc index 4dc8f715c80..87662e5fe52 100644 --- a/goal_src/jak2/engine/collide/collide-shape.gc +++ b/goal_src/jak2/engine/collide/collide-shape.gc @@ -29,7 +29,7 @@ it returns a triangle and normal direction to push in. ;; PUSHER ;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod pusher-init collide-shape ((this collide-shape)) +(defmethod pusher-init ((this collide-shape)) "Initialize a collide-shape as a pusher and move it to the pusher pool." (when (logtest? (collide-spec pusher) (-> this root-prim prim-core collide-as)) (let ((proc (the-as process-tree (-> this process)))) @@ -45,7 +45,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod should-push-away collide-shape ((this collide-shape) (other collide-shape) (cquery collide-query)) +(defmethod should-push-away ((this collide-shape) (other collide-shape) (cquery collide-query)) "Should this shape push away the other? Most generic implementation." (local-vars (v1-2 uint) (v1-3 float) (a2-2 uint) (a3-2 uint)) (rlet ((acc :class vf) @@ -106,13 +106,13 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod should-push-away-test collide-shape-prim ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query)) +(defmethod should-push-away-test ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query)) "Most generic should-push-away-test - child prims are expected to override." (format 0 "ERROR: collide-shape-prim::should-push-away-test was called illegally!~%") (none) ) -(defmethod should-push-away-test collide-shape-prim-group ((this collide-shape-prim-group) (other collide-shape-prim) (cquery collide-query)) +(defmethod should-push-away-test ((this collide-shape-prim-group) (other collide-shape-prim) (cquery collide-query)) "Should push away test where the pusher is a group." (local-vars (a0-2 collide-action) (a0-3 float) (f0-0 float)) (rlet ((acc :class vf) @@ -169,7 +169,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod should-push-away-a-group-test collide-shape-prim ((this collide-shape-prim) (other collide-shape-prim-group) (cquery collide-query)) +(defmethod should-push-away-a-group-test ((this collide-shape-prim) (other collide-shape-prim-group) (cquery collide-query)) "should-push-away-test anything vs. a group." (local-vars (a0-2 collide-action) (a0-3 float) (f0-0 float)) (rlet ((acc :class vf) @@ -226,7 +226,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod should-push-away-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (other collide-shape-prim) (cquery collide-query)) +(defmethod should-push-away-test ((this collide-shape-prim-mesh) (other collide-shape-prim) (cquery collide-query)) "Check if we should push away another shape (must be sphere or group)" (let ((v1-0 (-> other prim-core prim-type))) (cond @@ -278,7 +278,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod should-push-away-test collide-shape-prim-sphere ((this collide-shape-prim-sphere) (other collide-shape-prim) (cquery collide-query)) +(defmethod should-push-away-test ((this collide-shape-prim-sphere) (other collide-shape-prim) (cquery collide-query)) "Sphere against anything test." (local-vars (v1-3 float)) (rlet ((acc :class vf) @@ -448,12 +448,12 @@ it returns a triangle and normal direction to push in. ;; NOTE: it will over-populate the list, and the user must call (update-from-step-size *touching-list* u) ;; in order to get an accurate list. -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-mesh!~%") (none) ) -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-sphere ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) "Collide a moving sphere with a mesh in the collide cache." (rlet ((vf1 :class vf) (vf2 :class vf) @@ -529,13 +529,13 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) "moving mesh to mesh not supported." (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim mesh is not currently supported!~%") (none) ) -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) "Collide a group with a mesh in the collide cache." (let ((s4-0 (-> arg1 prim-core collide-as)) (s3-0 (-> this child 0)) @@ -551,12 +551,12 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-sphere!~%") (none) ) -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-sphere ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -623,13 +623,13 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) "Can't collide meshes with collide cache." (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim sphere is not currently supported!~%") (none) ) -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) (let ((s4-0 (-> arg1 prim-core collide-as)) (s3-0 (-> this child 0)) ) @@ -811,7 +811,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod react-to-pat! collide-shape-moving ((this collide-shape-moving) (arg0 pat-surface)) +(defmethod react-to-pat! ((this collide-shape-moving) (arg0 pat-surface)) "React to colliding with the given 'pat'." (let ((set-flags (cshape-reaction-flags))) (set! (-> this cur-pat) arg0) @@ -1099,7 +1099,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod step-collison! collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) +(defmethod step-collison! ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) "Main function to move forward until we hit a single thing, then react." (local-vars (sv-592 int)) (with-pp @@ -1213,7 +1213,7 @@ it returns a triangle and normal direction to push in. ;; this function moves collide shapes by one frame. -(defmethod integrate-and-collide! collide-shape ((this collide-shape) (arg0 vector)) +(defmethod integrate-and-collide! ((this collide-shape) (arg0 vector)) ;; for the simple collide shape, just move, and ignore collision. (local-vars (at-0 int)) (rlet ((vf0 :class vf) @@ -1238,7 +1238,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod integrate-and-collide! collide-shape-moving ((this collide-shape-moving) (arg0 vector)) +(defmethod integrate-and-collide! ((this collide-shape-moving) (arg0 vector)) "Main function to move a collide shape at a given velocity for 1 frame." ;; compute the location of our collision geometry based on transforms from animations/other places. @@ -1298,7 +1298,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod integrate-and-collide! control-info ((this control-info) (arg0 vector)) +(defmethod integrate-and-collide! ((this control-info) (arg0 vector)) "specialization of integrate-and-collide! for the control-info used in target." (with-pp (stopwatch-start (the-as stopwatch (&-> *collide-stats* pad0 1))) ;; i think this code is just broken. @@ -1511,7 +1511,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod try-snap-to-surface collide-shape-moving ((this collide-shape-moving) (vel vector) (check-dist float) (amt float) (bounce-dist float)) +(defmethod try-snap-to-surface ((this collide-shape-moving) (vel vector) (check-dist float) (amt float) (bounce-dist float)) "Strange function to try to find a surface and move to it. Teleports a distance of check-dist, then moves back to the start point plus amt. If this move hits something, moves to that surface, then an additional bounce-dist. @@ -1604,7 +1604,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod fill-and-try-snap-to-surface collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 collide-query)) +(defmethod fill-and-try-snap-to-surface ((this collide-shape-moving) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 collide-query)) "Fill the collision cache and try to snap to a nearby surface." (vector-normalize-copy! (-> arg4 start-pos) arg0 arg1) (vector+! (-> arg4 start-pos) (-> arg4 start-pos) (-> this trans)) @@ -1613,7 +1613,7 @@ it returns a triangle and normal direction to push in. (try-snap-to-surface this arg0 arg1 arg2 arg3) ) -(defmethod move-to-ground-point collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod move-to-ground-point ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) "Move to point, and treat as ground." (move-to-point! this arg0) (set! (-> arg1 y) 0.0) @@ -1628,7 +1628,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod integrate-no-collide! collide-shape-moving ((this collide-shape-moving) (arg0 vector)) +(defmethod integrate-no-collide! ((this collide-shape-moving) (arg0 vector)) "Move, ignoring all collision." (local-vars (at-0 int)) (rlet ((vf0 :class vf) @@ -1685,7 +1685,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod integrate-for-enemy-no-mtg collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 overlaps-others-params)) +(defmethod integrate-for-enemy-no-mtg ((this collide-shape-moving) (arg0 vector) (arg1 overlaps-others-params)) "Simpler move for enemy, with no moving to ground. Will just stop if the move collides." (integrate-no-collide! this arg0) (let ((s5-1 (find-overlapping-shapes this arg1))) @@ -1696,7 +1696,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod find-ground collide-shape-moving ((this collide-shape-moving) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod find-ground ((this collide-shape-moving) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) "Find the ground, return #t if we found it, and fill out gspot in the collide-query." (set! (-> this gspot-pos quad) (-> this trans quad)) (set! (-> arg0 start-pos quad) (-> this trans quad)) @@ -1730,14 +1730,14 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod above-ground? collide-shape ((this collide-shape) - (arg0 collide-query) - (arg1 vector) - (arg2 collide-spec) - (arg3 float) - (arg4 float) - (arg5 float) - ) +(defmethod above-ground? ((this collide-shape) + (arg0 collide-query) + (arg1 vector) + (arg2 collide-spec) + (arg3 float) + (arg4 float) + (arg5 float) + ) (set! (-> arg0 start-pos quad) (-> arg1 quad)) (+! (-> arg0 start-pos y) arg3) (vector-reset! (-> arg0 move-dist)) @@ -1753,7 +1753,7 @@ it returns a triangle and normal direction to push in. (>= (fill-and-probe-using-line-sphere *collide-cache* arg0) 0.0) ) -(defmethod move-above-ground collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 move-above-ground-params)) +(defmethod move-above-ground ((this collide-shape-moving) (arg0 vector) (arg1 move-above-ground-params)) "Move at the given velocity, while not going through the ground" (with-profiler 'collide *profile-collide-color* (set! (-> arg1 on-ground?) #f) @@ -1869,7 +1869,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod move-to-ground collide-shape-moving ((this collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) +(defmethod move-to-ground ((this collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) "Find the ground a move to it." (local-vars (sv-576 profile-segment) (sv-592 int)) (with-profiler 'collide *profile-collide-color* @@ -1934,7 +1934,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod compute-acc-due-to-gravity collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 float)) +(defmethod compute-acc-due-to-gravity ((this collide-shape-moving) (arg0 vector) (arg1 float)) "Adjust the velocity from the acceleration of gravity." (let* ((s4-0 (vector-negate! (new 'stack-no-clear 'vector) (-> this dynam gravity))) (a2-1 (-> this local-normal)) @@ -1954,7 +1954,7 @@ it returns a triangle and normal direction to push in. arg0 ) -(defmethod fill-cache-integrate-and-collide collide-shape ((this collide-shape) (arg0 vector) (arg1 collide-query) (arg2 meters)) +(defmethod fill-cache-integrate-and-collide ((this collide-shape) (arg0 vector) (arg1 collide-query) (arg2 meters)) "Helper to fill the collide cache and call integrate-and-collide." (local-vars (at-0 int)) (rlet ((vf0 :class vf) @@ -1983,7 +1983,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod fill-cache-for-shape collide-shape ((this collide-shape) (arg0 float) (arg1 collide-query)) +(defmethod fill-cache-for-shape ((this collide-shape) (arg0 float) (arg1 collide-query)) "Fill the collide cache for a collide-shape by buliding a bounding box and filling from that." (cond ((build-bounding-box-for-shape this (-> arg1 bbox) arg0 (-> arg1 collide-with)) @@ -2000,7 +2000,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod build-bounding-box-for-shape collide-shape ((this collide-shape) (arg0 bounding-box) (arg1 float) (arg2 collide-spec)) +(defmethod build-bounding-box-for-shape ((this collide-shape) (arg0 bounding-box) (arg1 float) (arg2 collide-spec)) (rlet ((vf0 :class vf) (vf24 :class vf) (vf25 :class vf) @@ -2065,7 +2065,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod find-prim-by-id collide-shape ((this collide-shape) (arg0 uint)) +(defmethod find-prim-by-id ((this collide-shape) (arg0 uint)) (let ((v1-0 (-> this root-prim))) (countdown (a0-1 (-> this total-prims)) (if (= (-> v1-0 prim-id) arg0) @@ -2077,7 +2077,7 @@ it returns a triangle and normal direction to push in. (the-as collide-shape-prim #f) ) -(defmethod find-prim-by-id-logtest collide-shape ((this collide-shape) (arg0 uint)) +(defmethod find-prim-by-id-logtest ((this collide-shape) (arg0 uint)) (let ((v1-0 (-> this root-prim))) (countdown (a0-1 (-> this total-prims)) (if (logtest? (-> v1-0 prim-id) arg0) @@ -2156,7 +2156,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod debug-draw collide-shape ((this collide-shape)) +(defmethod debug-draw ((this collide-shape)) (if (sphere-in-view-frustum? (the-as sphere (-> this root-prim prim-core))) (debug-draw (-> this root-prim)) ) @@ -2182,7 +2182,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod update-transforms collide-shape ((this collide-shape)) +(defmethod update-transforms ((this collide-shape)) "Update collisision transforms." (local-vars (v1-8 float) (a1-5 float) (a1-7 float)) (rlet ((acc :class vf) @@ -2267,7 +2267,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod move-by-vector! collide-shape ((this collide-shape) (arg0 vector)) +(defmethod move-by-vector! ((this collide-shape) (arg0 vector)) "Move everything by a vector." (vector+! (-> this trans) (-> this trans) arg0) (let ((v1-1 (-> this root-prim))) @@ -2281,7 +2281,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod move-to-point! collide-shape ((this collide-shape) (arg0 vector)) +(defmethod move-to-point! ((this collide-shape) (arg0 vector)) "Move root to a point." (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> this trans)) @@ -2298,7 +2298,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod set-collide-with! collide-shape ((this collide-shape) (arg0 collide-spec)) +(defmethod set-collide-with! ((this collide-shape) (arg0 collide-spec)) "Set the collide with field of everything." (let ((v1-0 (-> this root-prim))) (countdown (a0-1 (-> this total-prims)) @@ -2312,7 +2312,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod set-collide-as! collide-shape ((this collide-shape) (arg0 collide-spec)) +(defmethod set-collide-as! ((this collide-shape) (arg0 collide-spec)) "Set the collide as field of everything" (let ((v1-0 (-> this root-prim))) (countdown (a0-1 (-> this total-prims)) @@ -2326,7 +2326,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod iterate-prims collide-shape ((this collide-shape) (arg0 (function collide-shape-prim none))) +(defmethod iterate-prims ((this collide-shape) (arg0 (function collide-shape-prim none))) "Call the given function for each prim." (let ((s5-0 (-> this root-prim))) (countdown (s4-0 (-> this total-prims)) @@ -2338,7 +2338,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod find-collision-meshes collide-shape ((this collide-shape)) +(defmethod find-collision-meshes ((this collide-shape)) "Find collision meshes for our collide prims. The collide shape system is built in code, so this function should be called to actually find the matching meshes." @@ -2402,7 +2402,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod debug-draw collide-shape-prim ((this collide-shape-prim)) +(defmethod debug-draw ((this collide-shape-prim)) (add-debug-sphere #t (bucket-id debug2) @@ -2414,7 +2414,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod debug-draw collide-shape-prim-sphere ((this collide-shape-prim-sphere)) +(defmethod debug-draw ((this collide-shape-prim-sphere)) (add-debug-sphere #t (bucket-id debug2) @@ -2436,7 +2436,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod debug-draw collide-shape-prim-mesh ((this collide-shape-prim-mesh)) +(defmethod debug-draw ((this collide-shape-prim-mesh)) (add-debug-sphere #t (bucket-id debug2) @@ -2448,7 +2448,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod debug-draw collide-shape-prim-group ((this collide-shape-prim-group)) +(defmethod debug-draw ((this collide-shape-prim-group)) (add-debug-sphere #t (bucket-id debug2) @@ -2472,7 +2472,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod do-push-aways collide-shape ((this collide-shape)) +(defmethod do-push-aways ((this collide-shape)) "Push away things." (local-vars (at-0 int) (v1-55 int) (a2-5 float) (a2-12 float)) (with-pp @@ -2664,7 +2664,7 @@ it returns a triangle and normal direction to push in. ;; definition for method 40 of type collide-shape ;; WARN: Return type mismatch object vs symbol. -(defmethod find-overlapping-shapes collide-shape ((this collide-shape) (arg0 overlaps-others-params)) +(defmethod find-overlapping-shapes ((this collide-shape) (arg0 overlaps-others-params)) (local-vars (a0-10 float) (a0-14 uint) (a2-5 float) (a2-12 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2825,14 +2825,14 @@ it returns a triangle and normal direction to push in. ) ;; definition for method 12 of type collide-shape-prim -(defmethod overlaps-others-test collide-shape-prim ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (format 0 "ERROR: Unsupported call to collide-shape-prim::overlaps-others-test!~%") #f ) ;; definition for method 12 of type collide-shape-prim-group ;; WARN: Return type mismatch object vs symbol. -(defmethod overlaps-others-test collide-shape-prim-group ((this collide-shape-prim-group) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test ((this collide-shape-prim-group) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (a0-3 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2891,7 +2891,7 @@ it returns a triangle and normal direction to push in. ;; definition for method 13 of type collide-shape-prim ;; WARN: Return type mismatch object vs symbol. -(defmethod overlaps-others-group collide-shape-prim ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim-group)) +(defmethod overlaps-others-group ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim-group)) (local-vars (a0-4 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2950,7 +2950,7 @@ it returns a triangle and normal direction to push in. ) ;; definition for method 12 of type collide-shape-prim-sphere -(defmethod overlaps-others-test collide-shape-prim-sphere ((this collide-shape-prim-sphere) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test ((this collide-shape-prim-sphere) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (v1-11 uint) (s4-0 uint)) (let ((v1-0 (-> arg1 prim-core prim-type))) (b! (nonzero? v1-0) cfg-2 :delay (set! s4-0 (the-as uint (-> arg0 options)))) @@ -2996,7 +2996,7 @@ it returns a triangle and normal direction to push in. ) ;; definition for method 12 of type collide-shape-prim-mesh -(defmethod overlaps-others-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test ((this collide-shape-prim-mesh) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (v1-3 uint) (v1-11 uint) (s4-0 uint)) (let ((v1-0 (-> arg1 prim-core prim-type))) (b! (nonzero? v1-0) cfg-2 :delay (set! s4-0 (the-as uint (-> arg0 options)))) @@ -3051,7 +3051,7 @@ it returns a triangle and normal direction to push in. ;; definition for method 49 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod modify-collide-as! collide-shape ((this collide-shape) (arg0 int) (arg1 collide-spec) (arg2 collide-spec)) +(defmethod modify-collide-as! ((this collide-shape) (arg0 int) (arg1 collide-spec) (arg2 collide-spec)) (let ((v1-0 (-> this root-prim))) (countdown (a0-1 (-> this total-prims)) (if (logtest? (-> v1-0 prim-id) arg0) @@ -3064,7 +3064,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod send-shoves collide-shape ((this collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float)) +(defmethod send-shoves ((this collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float)) (local-vars (sv-144 process) (sv-160 collide-shape-prim) (sv-176 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -3129,7 +3129,7 @@ it returns a triangle and normal direction to push in. ;; definition for method 41 of type collide-shape ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs vector. -(defmethod shove-to-closest-point-on-path collide-shape ((this collide-shape) (arg0 attack-info) (arg1 float)) +(defmethod shove-to-closest-point-on-path ((this collide-shape) (arg0 attack-info) (arg1 float)) (set! (-> arg0 shove-up) arg1) (let* ((s3-0 (-> this process path)) (s2-0 (-> s3-0 curve num-cverts)) diff --git a/goal_src/jak2/engine/collide/collide-target-h.gc b/goal_src/jak2/engine/collide/collide-target-h.gc index 090849db0e7..b5a05aa3dbc 100644 --- a/goal_src/jak2/engine/collide/collide-target-h.gc +++ b/goal_src/jak2/engine/collide/collide-target-h.gc @@ -8,228 +8,225 @@ ;; DECOMP BEGINS (deftype control-info (collide-shape-moving) - ((unknown-float00 float :offset 448) - (unknown-float01 float :offset 452) - (unknown-float02 float :offset 456) - (unknown-float03 float :offset 460) - (transv-ctrl vector :inline :offset 480) - (target-transv vector :inline :offset 496) - (bent-gravity-normal vector :inline :offset 512) - (quat-for-control quaternion :inline :offset 528) - (override-quat quaternion :inline :offset 544) - (override-quat-alpha float :offset 560) - (ctrl-xz-vel float :offset 564) - (unknown-float003 float :offset 568) - (turn-go-the-long-way float :offset 572) - (velocity-after-thrust float :offset 576) - (turn-lockout-end-time time-frame :offset 584) - (turn-to-alt-heading vector :inline :offset 592) - (last-transv vector :inline :offset 608) - (last-quat-for-control quaternion :inline :offset 624) - (trans-log-trans vector 128 :inline :offset 640) - (trans-log-times time-frame 128 :offset 2688) - (trans-log-idx int32 :offset 3712) - (draw-offset vector :inline :offset 3728) - (cspace-offset vector :inline :offset 3744) - (anim-collide-offset-local vector :inline :offset 3760) - (anim-collide-offset-world vector :inline :offset 3776) - (old-anim-collide-offset-world vector :inline :offset 3792) - (anim-collide-offset-delta-world vector :inline :offset 3808) - (standard-dynamics dynamics :offset 3824) - (mod-surface surface :offset 3828) - (current-surface surface :offset 3832) - (prev-surf surface :offset 3836) - (time-of-last-surface-change time-frame :offset 3840) - (cpad cpad-info :offset 3848) - (turn-to-angle float :offset 3852) - (last-turn-to-angle float :offset 3856) - (turn-to-magnitude float :offset 3860) - (last-turn-to-magnitude float :offset 3864) - (to-target-pt-xz vector :inline :offset 3872) - (last-to-target-pt-xz vector :inline :offset 3888) - (turn-to-target vector :inline :offset 3904) - (last-turn-to-target vector :inline :offset 3920) - (turn-history-ctrl vector 7 :inline :offset 3936) - (pad-xz-dir vector :inline :offset 4064) - (last-pad-xz-dir vector :inline :offset 4080) - (pad-magnitude float :offset 4096) - (last-pad-magnitude float :offset 4100) - (time-of-last-pad-read time-frame :offset 4104) - (w-R-c matrix :inline :offset 4112) - (c-R-w matrix :inline :offset 4176) - (ctrl-orientation matrix :inline :offset 4240) - (pre-collide-local-normal vector :inline :offset 4320) - (camera-pos vector :inline :offset 4336) - (cam-R-w matrix :inline :offset 4352) - (update-cam-R-w-start-time int64 :offset 4416) - (force-turn-to-direction vector :inline :offset 4432) - (force-turn-to-speed float :offset 4448) - (unknown-floatiujh1bnb2n3i1 float :offset 4452) - (force-turn-to-strength float :offset 4456) - (tongue-counter int32 :offset 4460) - (collide-extra-velocity vector :inline :offset 4464) - (additional-decaying-velocity vector :inline :offset 4480) - (additional-decaying-velocity-end-time time-frame :offset 4496) - (additional-decaying-velocity-decay-start-time time-frame :offset 4504) - (gravity-normal vector :inline :offset 4512) - (last-gravity-normal vector :inline :offset 4528) - (last-trans-any-surf vector :inline :offset 4544) - (unknown-float16 float :offset 4548) - (ground-contact-normal vector :inline :offset 4560) - (last-trans-on-ground vector :inline :offset 4576) - (ground-contact-sphere-center vector :inline :offset 4592) - (transv-on-last-impact vector :inline :offset 4608) - (list-time-on-ground time-frame :offset 4624) - (ground-local-norm-dot-grav float :offset 4632) - (local-slope-z float :offset 4636) - (local-slope-x float :offset 4640) - (surface-slope-z float :offset 4644) - (surface-slope-x float :offset 4648) - (last-time-on-surface time-frame :offset 4656) - (normal-impact-vel float :offset 4664) - (last-time-touching-actor time-frame :offset 4672) - (wall-contact-pat pat-surface :offset 4680) - (wall-contact-pt vector :inline :offset 4688) - (wall-contact-poly-normal vector :inline :offset 4704) - (wall-contact-normal vector :inline :offset 4720) - (actor-contact-pt vector :inline :offset 4736) - (actor-contact-normal vector :inline :offset 4752) - (actor-contact-handle handle :offset 4768) - (gspot-pat-surfce pat-surface :offset 4776) - (gspot-slope-z float :offset 4780) - (gspot-slope-x float :offset 4784) - (ctrl-slope-heading float :offset 4788) - (ctrl-slope-z float :offset 4792) - (ctrl-slope-x float :offset 4796) - (unknown-word000 int32 :offset 4800) - (unknown-float002 float :offset 4804) - (unknown-float-n12iuh3n1 float :offset 4808) - (unknown-float-ki1jhbn23hj float :offset 4812) - (time-of-last-lc time-frame :offset 4816) - (low-coverage-pat-next1 pat-surface :offset 4828) - (low-coverage-dist-to-next2 float :offset 4832) - (low-coverage-pat-next2 pat-surface :offset 4836) - (low-coverage-slope-to-next1 float :offset 4824) - (low-coverage-norm-of-next1 vector :inline :offset 4848) - (low-coverage-norm-of-next2 vector :inline :offset 4864) - (low-coverage-overhang-plane-normal vector :inline :offset 4912) - (low-coverage-tangent vector :inline :offset 4928) - (low-coverage-tangent-xz vector :inline :offset 4944) - (btransv vector :inline :offset 4976) - (blocked-factor float :offset 4992) - (blocked-in-air-factor float :offset 4996) - (time-of-last-clear-wall-in-jump time-frame :offset 5000) - (time-of-last-lc-touch-edge time-frame :offset 5008) - (collision-spheres collide-shape-prim-sphere 10 :offset 5016) - (unknown-word02 int32 :offset 5064) - (last-roll-end-time time-frame :offset 5072) - (last-running-attack-end-time time-frame :offset 5080) - (last-hands-attempt-time time-frame :offset 5088) - (last-attack-end-time time-frame :offset 5096) - (last-feet-attempt-time time-frame :offset 5104) - (unknown-time-frame13 time-frame :offset 5112) - (last-time-of-stuck time-frame :offset 5120) - (bend-amount float :offset 5132) - (bend-target float :offset 5136) - (bend-speed float :offset 5140) - (ctrl-to-head-offset vector :inline :offset 5152) - (lhand-cspace cspace :offset 5168) - (rhand-cspace cspace :offset 5172) - (midpoint-of-hands vector :inline :offset 5184) - (ctrl-to-hands-offset vector :inline :offset 5200) - (sidekick-root cspace :inline :offset 5216) - (collide-mode symbol :offset 5248) - (collide-mode-transition float :offset 5252) - (duck-gun-tube-transision float :offset 5256) - (transv-history vector 15 :inline :offset 5264) - (average-xz-vel float :offset 5520) - (idx-of-fastest-xz-vel int32 :offset 5524) - (hand-to-edge-dist float :offset 5528) - (unknown-symbol000 symbol :offset 5532) - (edge-grab-edge-dir vector :inline :offset 5536) - (unknown-vector35 vector :inline :offset 5552) - (edge-grab-across-edge-dir vector :inline :offset 5568) - (last-successful-compute-edge-time time-frame :offset 5584) - (edge-grab-start-time time-frame :offset 5592) - (unknown-handle000 handle :offset 5600) - (anim-handle handle :offset 5608) - (unknown-word04 uint32 :offset 5616) - (unknown-spool-anim00 spool-anim :offset 5616) - (unknown-word05 int32 :offset 5616) - (unknown-symbol01 symbol :offset 5616) - (unknown-float34 float :offset 5616) - (did-move-to-pole-or-max-jump-height float :offset 5620) - (unknown-symbol03 float :offset 5624) - (unknown-float35 float :offset 5628) - (unknown-float36 float :offset 5632) - (unknown-float37 float :offset 5636) - (unknown-vector37 vector :inline :offset 5648) - (unknown-vector38 vector :inline :offset 5664) - (unknown-vector39 vector :inline :offset 5680) - (unknown-vector40 vector :inline :offset 5696) - (sliding-start-time time-frame :offset 5712) - (unknown-time-frame18 time-frame :offset 5720) - (unknown-sound-id00 sound-id :offset 5776) - (unknown-handle02 handle :offset 5792) - (impact-ctrl impact-control :inline :offset 5824) - (unknown-word06 int32 :offset 5832) - (unknown-vector41 vector :inline :offset 5888) - (last-trans-leaving-surf vector :inline :offset 5904) - (unknown-float38 float :offset 5908) - (highest-jump-mark vector :inline :offset 5920) - (unknown-float39 float :offset 5924) - (unknown-time-frame19 time-frame :offset 5936) - (time-of-last-debug-float time-frame :offset 5944) - (danger-mode symbol :offset 5984) - (target-attack-id uint32 :offset 5988) - (attacked-by-id int32 :offset 5992) - (bomb-scale float :offset 5996) - (attack-count uint64 :offset 6000) - (send-attack-dest handle :offset 6008) - (send-attack-time time-frame :offset 6016) - (unknown-combo-tracker00 combo-tracker :inline :offset 6032) - (unknown-time-frame21 time-frame :offset 6072) - (unknown-dword07 int64 :offset 6096) - (unknown-dword08 int64 :offset 6104) - (unknown-dword09 int64 :offset 6112) - (unknown-dword10 int64 :offset 6120) - (jump-kind symbol :offset 6144) - (unknown-quaternion04 quaternion :inline :offset 6160) - (unknown-sound-id01 sound-id :offset 6176) - (unknown-float41 float :offset 6180) - (unknown-float42 float :offset 6184) - (history-idx uint16 :offset 6188) - (history-length uint16 :offset 6190) - (remaining-ctrl-iterations int32 :offset 6192) - (invul1-on-time time-frame :offset 6200) - (invul1-off-time time-frame :offset 6208) - (invul2-on-time time-frame :offset 6216) - (invul2-off-time time-frame :offset 6224) - (unknown-float43 float :offset 6232) - (unknown-float001 float :offset 6236) - (board-jump-and-swim-sound sound-id :offset 6240) - (bubbles-sound sound-id :offset 6244) - (unknown-time-frame26 time-frame :offset 6248) - (unknown-time-frame27 time-frame :offset 6256) - (yellow-eco-last-use-time int64 :offset 6264) - (align-xz-vel vector :inline :offset 6272) - (zx-vel-frac float :offset 6288) - (unknown-sound-id04 sound-id :offset 6292) - (unknown-float45 float :offset 6296) - (default-collide-as-all collide-spec :offset 6300) - (default-collide-as-fgnd collide-spec :offset 6304) - (default-collide-with-all collide-spec :offset 6308) - (default-collide-with-fgnd collide-spec :offset 6312) - (time-of-last-zero-input time-frame :offset 6320) - (time-of-last-nonzero-input time-frame :offset 6328) - (time-between-zero-inputs time-frame :offset 6336) - (time-of-last-debug-heal time-frame :offset 6368) - (last-nonzero-input-dir-targ quaternion :inline :offset 6384) - (time-of-last-wall-hide-first-check-pass time-frame :offset 6400) - (time-of-first-wall-hide-first-check-pass time-frame :offset 6408) - (pad uint8 :offset 6415) + ((unknown-float00 float :overlay-at ground-impact-vel) + (unknown-float01 float :overlay-at surface-angle) + (unknown-float02 float :overlay-at poly-angle) + (unknown-float03 float :overlay-at touch-angle) + (transv-ctrl vector :inline :offset 480) + (target-transv vector :inline :offset 496) + (bent-gravity-normal vector :inline :offset 512) + (quat-for-control quaternion :inline :offset 528) + (override-quat quaternion :inline :offset 544) + (override-quat-alpha float :offset 560) + (ctrl-xz-vel float :offset 564) + (unknown-float003 float :offset 568) + (turn-go-the-long-way float :offset 572) + (velocity-after-thrust float :offset 576) + (turn-lockout-end-time time-frame :offset 584) + (turn-to-alt-heading vector :inline :offset 592) + (last-transv vector :inline :offset 608) + (last-quat-for-control quaternion :inline :offset 624) + (trans-log-trans vector 128 :inline :offset 640) + (trans-log-times time-frame 128 :offset 2688) + (trans-log-idx int32 :offset 3712) + (draw-offset vector :inline :offset 3728) + (cspace-offset vector :inline :offset 3744) + (anim-collide-offset-local vector :inline :offset 3760) + (anim-collide-offset-world vector :inline :offset 3776) + (old-anim-collide-offset-world vector :inline :offset 3792) + (anim-collide-offset-delta-world vector :inline :offset 3808) + (standard-dynamics dynamics :offset 3824) + (mod-surface surface :offset 3828) + (current-surface surface :offset 3832) + (prev-surf surface :offset 3836) + (time-of-last-surface-change time-frame :offset 3840) + (cpad cpad-info :offset 3848) + (turn-to-angle float :offset 3852) + (last-turn-to-angle float :offset 3856) + (turn-to-magnitude float :offset 3860) + (last-turn-to-magnitude float :offset 3864) + (to-target-pt-xz vector :inline :offset 3872) + (last-to-target-pt-xz vector :inline :offset 3888) + (turn-to-target vector :inline :offset 3904) + (last-turn-to-target vector :inline :offset 3920) + (turn-history-ctrl vector 7 :inline :offset 3936) + (pad-xz-dir vector :inline :offset 4064) + (last-pad-xz-dir vector :inline :offset 4080) + (pad-magnitude float :offset 4096) + (last-pad-magnitude float :offset 4100) + (time-of-last-pad-read time-frame :offset 4104) + (w-R-c matrix :inline :offset 4112) + (c-R-w matrix :inline :offset 4176) + (ctrl-orientation matrix :inline :offset 4240) + (pre-collide-local-normal vector :inline :offset 4320) + (camera-pos vector :inline :offset 4336) + (cam-R-w matrix :inline :offset 4352) + (update-cam-R-w-start-time int64 :offset 4416) + (force-turn-to-direction vector :inline :offset 4432) + (force-turn-to-speed float :offset 4448) + (unknown-floatiujh1bnb2n3i1 float :offset 4452) + (force-turn-to-strength float :offset 4456) + (tongue-counter int32 :offset 4460) + (collide-extra-velocity vector :inline :offset 4464) + (additional-decaying-velocity vector :inline :offset 4480) + (additional-decaying-velocity-end-time time-frame :offset 4496) + (additional-decaying-velocity-decay-start-time time-frame :offset 4504) + (gravity-normal vector :inline :offset 4512) + (last-gravity-normal vector :inline :offset 4528) + (last-trans-any-surf vector :inline :offset 4544) + (unknown-float16 float :overlay-at (-> last-trans-any-surf y)) + (ground-contact-normal vector :inline :offset 4560) + (last-trans-on-ground vector :inline :offset 4576) + (ground-contact-sphere-center vector :inline :offset 4592) + (transv-on-last-impact vector :inline :offset 4608) + (list-time-on-ground time-frame :offset 4624) + (ground-local-norm-dot-grav float :offset 4632) + (local-slope-z float :offset 4636) + (local-slope-x float :offset 4640) + (surface-slope-z float :offset 4644) + (surface-slope-x float :offset 4648) + (last-time-on-surface time-frame :offset 4656) + (normal-impact-vel float :offset 4664) + (last-time-touching-actor time-frame :offset 4672) + (wall-contact-pat pat-surface :offset 4680) + (wall-contact-pt vector :inline :offset 4688) + (wall-contact-poly-normal vector :inline :offset 4704) + (wall-contact-normal vector :inline :offset 4720) + (actor-contact-pt vector :inline :offset 4736) + (actor-contact-normal vector :inline :offset 4752) + (actor-contact-handle handle :offset 4768) + (gspot-pat-surfce pat-surface :offset 4776) + (gspot-slope-z float :offset 4780) + (gspot-slope-x float :offset 4784) + (ctrl-slope-heading float :offset 4788) + (ctrl-slope-z float :offset 4792) + (ctrl-slope-x float :offset 4796) + (unknown-word000 int32 :offset 4800) + (unknown-float002 float :offset 4804) + (unknown-float-n12iuh3n1 float :offset 4808) + (unknown-float-ki1jhbn23hj float :offset 4812) + (time-of-last-lc time-frame :offset 4816) + (low-coverage-pat-next1 pat-surface :offset 4828) + (low-coverage-dist-to-next2 float :offset 4832) + (low-coverage-pat-next2 pat-surface :offset 4836) + (low-coverage-slope-to-next1 float :offset 4824) + (low-coverage-norm-of-next1 vector :inline :offset 4848) + (low-coverage-norm-of-next2 vector :inline :offset 4864) + (low-coverage-overhang-plane-normal vector :inline :offset 4912) + (low-coverage-tangent vector :inline :offset 4928) + (low-coverage-tangent-xz vector :inline :offset 4944) + (btransv vector :inline :offset 4976) + (blocked-factor float :offset 4992) + (blocked-in-air-factor float :offset 4996) + (time-of-last-clear-wall-in-jump time-frame :offset 5000) + (time-of-last-lc-touch-edge time-frame :offset 5008) + (collision-spheres collide-shape-prim-sphere 10 :offset 5016) + (unknown-word02 int32 :offset 5064) + (last-roll-end-time time-frame :offset 5072) + (last-running-attack-end-time time-frame :offset 5080) + (last-hands-attempt-time time-frame :offset 5088) + (last-attack-end-time time-frame :offset 5096) + (last-feet-attempt-time time-frame :offset 5104) + (unknown-time-frame13 time-frame :offset 5112) + (last-time-of-stuck time-frame :offset 5120) + (bend-amount float :offset 5132) + (bend-target float :offset 5136) + (bend-speed float :offset 5140) + (ctrl-to-head-offset vector :inline :offset 5152) + (lhand-cspace cspace :offset 5168) + (rhand-cspace cspace :offset 5172) + (midpoint-of-hands vector :inline :offset 5184) + (ctrl-to-hands-offset vector :inline :offset 5200) + (sidekick-root cspace :inline :offset 5216) + (collide-mode symbol :offset 5248) + (collide-mode-transition float :offset 5252) + (duck-gun-tube-transision float :offset 5256) + (transv-history vector 15 :inline :offset 5264) + (average-xz-vel float :offset 5520) + (idx-of-fastest-xz-vel int32 :offset 5524) + (hand-to-edge-dist float :offset 5528) + (unknown-symbol000 symbol :offset 5532) + (edge-grab-edge-dir vector :inline :offset 5536) + (unknown-vector35 vector :inline :offset 5552) + (edge-grab-across-edge-dir vector :inline :offset 5568) + (last-successful-compute-edge-time time-frame :offset 5584) + (edge-grab-start-time time-frame :offset 5592) + (unknown-handle000 handle :offset 5600) + (anim-handle handle :offset 5608) + (unknown-word04 uint32 :offset 5616) + (unknown-spool-anim00 spool-anim :overlay-at unknown-word04) + (unknown-word05 int32 :overlay-at unknown-spool-anim00) + (unknown-symbol01 symbol :overlay-at unknown-word05) + (unknown-float34 float :overlay-at unknown-symbol01) + (did-move-to-pole-or-max-jump-height float :offset 5620) + (unknown-symbol03 float :offset 5624) + (unknown-float35 float :offset 5628) + (unknown-float36 float :offset 5632) + (unknown-float37 float :offset 5636) + (unknown-vector37 vector :inline :offset 5648) + (unknown-vector38 vector :inline :offset 5664) + (unknown-vector39 vector :inline :offset 5680) + (unknown-vector40 vector :inline :offset 5696) + (sliding-start-time time-frame :offset 5712) + (unknown-time-frame18 time-frame :offset 5720) + (unknown-sound-id00 sound-id :offset 5776) + (unknown-handle02 handle :offset 5792) + (impact-ctrl impact-control :inline :offset 5824) + (unknown-word06 int32 :offset 5832) + (unknown-vector41 vector :inline :offset 5888) + (last-trans-leaving-surf vector :inline :offset 5904) + (unknown-float38 float :overlay-at (-> last-trans-leaving-surf y)) + (highest-jump-mark vector :inline :offset 5920) + (unknown-float39 float :overlay-at (-> highest-jump-mark y)) + (unknown-time-frame19 time-frame :offset 5936) + (time-of-last-debug-float time-frame :offset 5944) + (danger-mode symbol :offset 5984) + (target-attack-id uint32 :offset 5988) + (attacked-by-id int32 :offset 5992) + (bomb-scale float :offset 5996) + (attack-count uint64 :offset 6000) + (send-attack-dest handle :offset 6008) + (send-attack-time time-frame :offset 6016) + (unknown-combo-tracker00 combo-tracker :inline :offset 6032) + (unknown-time-frame21 time-frame :offset 6072) + (unknown-dword07 int64 :offset 6096) + (unknown-dword08 int64 :offset 6104) + (unknown-dword09 int64 :offset 6112) + (unknown-dword10 int64 :offset 6120) + (jump-kind symbol :offset 6144) + (unknown-quaternion04 quaternion :inline :offset 6160) + (unknown-sound-id01 sound-id :offset 6176) + (unknown-float41 float :offset 6180) + (unknown-float42 float :offset 6184) + (history-idx uint16 :offset 6188) + (history-length uint16 :offset 6190) + (remaining-ctrl-iterations int32 :offset 6192) + (invul1-on-time time-frame :offset 6200) + (invul1-off-time time-frame :offset 6208) + (invul2-on-time time-frame :offset 6216) + (invul2-off-time time-frame :offset 6224) + (unknown-float43 float :offset 6232) + (unknown-float001 float :offset 6236) + (board-jump-and-swim-sound sound-id :offset 6240) + (bubbles-sound sound-id :offset 6244) + (unknown-time-frame26 time-frame :offset 6248) + (unknown-time-frame27 time-frame :offset 6256) + (yellow-eco-last-use-time int64 :offset 6264) + (align-xz-vel vector :inline :offset 6272) + (zx-vel-frac float :offset 6288) + (unknown-sound-id04 sound-id :offset 6292) + (unknown-float45 float :offset 6296) + (default-collide-as-all collide-spec :offset 6300) + (default-collide-as-fgnd collide-spec :offset 6304) + (default-collide-with-all collide-spec :offset 6308) + (default-collide-with-fgnd collide-spec :offset 6312) + (time-of-last-zero-input time-frame :offset 6320) + (time-of-last-nonzero-input time-frame :offset 6328) + (time-between-zero-inputs time-frame :offset 6336) + (time-of-last-debug-heal time-frame :offset 6368) + (last-nonzero-input-dir-targ quaternion :inline :offset 6384) + (time-of-last-wall-hide-first-check-pass time-frame :offset 6400) + (time-of-first-wall-hide-first-check-pass time-frame :offset 6408) + (pad uint8 :offset 6415) ) - :method-count-assert 68 - :size-assert #x1910 - :flag-assert #x4400001910 ) diff --git a/goal_src/jak2/engine/collide/collide-touch-h.gc b/goal_src/jak2/engine/collide/collide-touch-h.gc index c82e1d73db4..02131ed7ae9 100644 --- a/goal_src/jak2/engine/collide/collide-touch-h.gc +++ b/goal_src/jak2/engine/collide/collide-touch-h.gc @@ -12,53 +12,44 @@ ;; DECOMP BEGINS (deftype touching-prim (structure) - ((cprim collide-shape-prim :offset-assert 0) - (has-tri? symbol :offset-assert 4) - (tri collide-tri-result :inline :offset-assert 16) + ((cprim collide-shape-prim) + (has-tri? symbol) + (tri collide-tri-result :inline) ) - :method-count-assert 9 - :size-assert #x68 - :flag-assert #x900000068 ) (deftype touching-prims-entry (structure) - ((next touching-prims-entry :offset-assert 0) - (prev touching-prims-entry :offset-assert 4) - (allocated? symbol :offset-assert 8) - (u float :offset-assert 12) - (prim1 touching-prim :inline :offset-assert 16) - (prim2 touching-prim :inline :offset-assert 128) + ((next touching-prims-entry) + (prev touching-prims-entry) + (allocated? symbol) + (u float) + (prim1 touching-prim :inline) + (prim2 touching-prim :inline) ) - :method-count-assert 12 - :size-assert #xe8 - :flag-assert #xc000000e8 (:methods - (get-middle-of-bsphere-overlap (_type_ vector) vector 9) - (get-touched-prim (_type_ collide-shape touching-shapes-entry) collide-shape-prim 10) - (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result 11) + (get-middle-of-bsphere-overlap (_type_ vector) vector) + (get-touched-prim (_type_ collide-shape touching-shapes-entry) collide-shape-prim) + (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result) ) ) (deftype touching-prims-entry-pool (structure) - ((head touching-prims-entry :offset-assert 0) - (nodes touching-prims-entry 64 :inline :offset-assert 16) + ((head touching-prims-entry) + (nodes touching-prims-entry 64 :inline) ) - :method-count-assert 13 - :size-assert #x3c10 - :flag-assert #xd00003c10 (:methods - (new (symbol type) _type_ 0) - (alloc-node (_type_) touching-prims-entry 9) - (get-free-node-count (_type_) int 10) - (init-list! (_type_) none 11) - (free-node (_type_ touching-prims-entry) touching-prims-entry 12) + (new (symbol type) _type_) + (alloc-node (_type_) touching-prims-entry) + (get-free-node-count (_type_) int) + (init-list! (_type_) none) + (free-node (_type_ touching-prims-entry) touching-prims-entry) ) ) -(defmethod init-list! touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod init-list! ((this touching-prims-entry-pool)) (let ((v1-0 (the-as touching-prims-entry #f))) (let ((a1-0 (the-as touching-prims-entry (-> this nodes)))) (set! (-> this head) a1-0) @@ -92,43 +83,37 @@ ) (deftype touching-shapes-entry (structure) - ((cshape1 collide-shape :offset-assert 0) - (cshape2 collide-shape :offset-assert 4) - (resolve-u int8 :offset-assert 8) - (head touching-prims-entry :offset-assert 12) - (handle1 handle :offset-assert 16) - (handle2 handle :offset-assert 24) + ((cshape1 collide-shape) + (cshape2 collide-shape) + (resolve-u int8) + (head touching-prims-entry) + (handle1 handle) + (handle2 handle) ) :pack-me - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 (:methods - (get-head (_type_) touching-prims-entry 9) - (get-next (_type_ touching-shapes-entry) touching-prims-entry 10) - (get-touched-shape (_type_ collide-shape) collide-shape 11) - (prims-touching? (_type_ collide-shape uint) touching-prims-entry 12) - (prims-touching-action? (_type_ collide-shape collide-action collide-action) basic 13) - (free-touching-prims-list (_type_) none 14) + (get-head (_type_) touching-prims-entry) + (get-next (_type_ touching-shapes-entry) touching-prims-entry) + (get-touched-shape (_type_ collide-shape) collide-shape) + (prims-touching? (_type_ collide-shape uint) touching-prims-entry) + (prims-touching-action? (_type_ collide-shape collide-action collide-action) basic) + (free-touching-prims-list (_type_) none) ) ) (deftype touching-list (structure) - ((num-touching-shapes int32 :offset-assert 0) - (resolve-u int8 :offset-assert 4) - (touching-shapes touching-shapes-entry 32 :inline :offset-assert 8) + ((num-touching-shapes int32) + (resolve-u int8) + (touching-shapes touching-shapes-entry 32 :inline) ) - :method-count-assert 14 - :size-assert #x408 - :flag-assert #xe00000408 (:methods - (new (symbol type) _type_ 0) - (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none 9) - (free-nodes (_type_) none 10) - (update-from-step-size (_type_ float) none 11) - (send-events-for-touching-shapes (_type_) none 12) - (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry 13) + (new (symbol type) _type_) + (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none) + (free-nodes (_type_) none) + (update-from-step-size (_type_ float) none) + (send-events-for-touching-shapes (_type_) none) + (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry) ) ) @@ -147,12 +132,12 @@ ) ) -(defmethod get-head touching-shapes-entry ((this touching-shapes-entry)) +(defmethod get-head ((this touching-shapes-entry)) (-> this head) ) ;; WARN: Return type mismatch collide-shape vs touching-prims-entry. -(defmethod get-next touching-shapes-entry ((this touching-shapes-entry) (arg0 touching-shapes-entry)) +(defmethod get-next ((this touching-shapes-entry) (arg0 touching-shapes-entry)) (the-as touching-prims-entry (-> arg0 cshape1)) ) diff --git a/goal_src/jak2/engine/collide/collide-touch.gc b/goal_src/jak2/engine/collide/collide-touch.gc index 6c29401e095..1047a105f53 100644 --- a/goal_src/jak2/engine/collide/collide-touch.gc +++ b/goal_src/jak2/engine/collide/collide-touch.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod get-free-node-count touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod get-free-node-count ((this touching-prims-entry-pool)) (let ((v0-0 0)) (let ((v1-0 (-> this head))) (while v1-0 @@ -22,7 +22,7 @@ ) ) -(defmethod alloc-node touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod alloc-node ((this touching-prims-entry-pool)) (let ((gp-0 (-> this head))) (cond (gp-0 @@ -44,7 +44,7 @@ ) ) -(defmethod free-node touching-prims-entry-pool ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) +(defmethod free-node ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) (when (-> arg0 allocated?) (set! (-> arg0 allocated?) #f) (let ((v1-1 (-> this head))) @@ -59,7 +59,7 @@ ) ) -(defmethod free-touching-prims-list touching-shapes-entry ((this touching-shapes-entry)) +(defmethod free-touching-prims-list ((this touching-shapes-entry)) (when (-> this cshape1) (set! (-> this cshape1) #f) (let ((gp-0 (-> this head))) @@ -80,7 +80,7 @@ (none) ) -(defmethod free-nodes touching-list ((this touching-list)) +(defmethod free-nodes ((this touching-list)) (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) (countdown (s4-0 (-> this num-touching-shapes)) (free-touching-prims-list s5-0) @@ -94,7 +94,7 @@ ) ;; WARN: Return type mismatch object vs touching-shapes-entry. -(defmethod get-shapes-entry touching-list ((this touching-list) (shape1 collide-shape) (shape2 collide-shape)) +(defmethod get-shapes-entry ((this touching-list) (shape1 collide-shape) (shape2 collide-shape)) (let ((entry (the-as touching-shapes-entry (-> this touching-shapes)))) (let ((v1-0 (the-as touching-shapes-entry #f))) (countdown (a3-0 (-> this num-touching-shapes)) @@ -140,23 +140,20 @@ ) (deftype add-prims-touching-work (structure) - ((tri1 collide-tri-result :offset-assert 0) - (tri2 collide-tri-result :offset-assert 4) + ((tri1 collide-tri-result) + (tri2 collide-tri-result) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; WARN: Function (method 9 touching-list) has a return type of none, but the expression builder found a return statement. -(defmethod add-touching-prims touching-list ((this touching-list) - (arg0 collide-shape-prim) - (arg1 collide-shape-prim) - (arg2 float) - (arg3 collide-tri-result) - (arg4 collide-tri-result) - ) +(defmethod add-touching-prims ((this touching-list) + (arg0 collide-shape-prim) + (arg1 collide-shape-prim) + (arg2 float) + (arg3 collide-tri-result) + (arg4 collide-tri-result) + ) (let ((gp-0 (new 'stack-no-clear 'add-prims-touching-work))) (set! (-> gp-0 tri1) arg3) (set! (-> gp-0 tri2) arg4) @@ -257,7 +254,7 @@ (none) ) -(defmethod update-from-step-size touching-list ((this touching-list) (arg0 float)) +(defmethod update-from-step-size ((this touching-list) (arg0 float)) (when (nonzero? (-> this resolve-u)) (set! (-> this resolve-u) 0) (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) @@ -316,7 +313,7 @@ (none) ) -(defmethod send-events-for-touching-shapes touching-list ((this touching-list)) +(defmethod send-events-for-touching-shapes ((this touching-list)) (let ((gp-0 (the-as touching-shapes-entry (-> this touching-shapes)))) (countdown (s5-0 (-> this num-touching-shapes)) (let ((s3-0 (-> gp-0 cshape1))) @@ -368,7 +365,7 @@ (none) ) -(defmethod prims-touching? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape) (arg1 uint)) +(defmethod prims-touching? ((this touching-shapes-entry) (arg0 collide-shape) (arg1 uint)) (cond ((= (-> this cshape1) arg0) (let ((v1-1 (-> this head))) @@ -398,7 +395,7 @@ ) ;; WARN: Return type mismatch touching-prims-entry vs basic. -(defmethod prims-touching-action? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) +(defmethod prims-touching-action? ((this touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) (cond ((= (-> this cshape1) arg0) (let ((v1-1 (-> this head))) @@ -431,7 +428,7 @@ (the-as basic #f) ) -(defmethod get-touched-shape touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape)) +(defmethod get-touched-shape ((this touching-shapes-entry) (arg0 collide-shape)) (cond ((= (-> this cshape1) arg0) (return (-> this cshape2)) @@ -443,7 +440,7 @@ (the-as collide-shape #f) ) -(defmethod get-touched-prim touching-prims-entry ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) +(defmethod get-touched-prim ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) (cond ((= (-> arg1 cshape1) arg0) (return (-> this prim1 cprim)) @@ -455,7 +452,7 @@ (the-as collide-shape-prim #f) ) -(defmethod get-touched-tri touching-prims-entry ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) +(defmethod get-touched-tri ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) (let ((v0-0 (the-as collide-tri-result #f))) (cond ((not this) @@ -479,7 +476,7 @@ ) ) -(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((this touching-prims-entry) (arg0 vector)) +(defmethod get-middle-of-bsphere-overlap ((this touching-prims-entry) (arg0 vector)) (let* ((s4-0 (-> this prim1 cprim)) (v1-0 (-> this prim2 cprim)) (gp-1 (vector-! diff --git a/goal_src/jak2/engine/collide/find-nearest.gc b/goal_src/jak2/engine/collide/find-nearest.gc index dcfcec646b2..d9863cf72cf 100644 --- a/goal_src/jak2/engine/collide/find-nearest.gc +++ b/goal_src/jak2/engine/collide/find-nearest.gc @@ -8,22 +8,19 @@ ;; DECOMP BEGINS (deftype search-info (structure) - ((point vector :inline :offset-assert 0) - (best-point vector :inline :offset-assert 16) - (match-handle handle :offset-assert 32) - (match basic :offset-assert 40) - (best float :offset-assert 44) - (radius float :offset-assert 48) - (rating search-info-flag :offset-assert 52) - (require search-info-flag :offset-assert 56) - (mask search-info-flag :offset-assert 60) - (rot-base vector :inline :offset-assert 64) - (ack-point vector :inline :offset-assert 80) - (rot-range float :offset-assert 96) + ((point vector :inline) + (best-point vector :inline) + (match-handle handle) + (match basic) + (best float) + (radius float) + (rating search-info-flag) + (require search-info-flag) + (mask search-info-flag) + (rot-base vector :inline) + (ack-point vector :inline) + (rot-range float) ) - :method-count-assert 9 - :size-assert #x64 - :flag-assert #x900000064 ) diff --git a/goal_src/jak2/engine/collide/los-control-h.gc b/goal_src/jak2/engine/collide/los-control-h.gc index 91f17ec15fa..289b9b7ef5f 100644 --- a/goal_src/jak2/engine/collide/los-control-h.gc +++ b/goal_src/jak2/engine/collide/los-control-h.gc @@ -8,23 +8,20 @@ ;; decomp begins (deftype los-control (structure) - ((src-proc handle :offset-assert 0) - (dst-proc handle :offset-assert 8) - (have-los time-frame :offset-assert 16) - (have-no-los time-frame :offset-assert 24) - (check-interval time-frame :offset-assert 32) - (last-check-time time-frame :offset-assert 40) - (last-collide-result collide-tri-result :inline :offset-assert 48) - (collide-with collide-spec :offset 144) + ((src-proc handle) + (dst-proc handle) + (have-los time-frame) + (have-no-los time-frame) + (check-interval time-frame) + (last-check-time time-frame) + (last-collide-result collide-tri-result :inline) + (collide-with collide-spec :offset 144) ) - :method-count-assert 14 - :size-assert #x94 - :flag-assert #xe00000094 (:methods - (los-control-method-9 (_type_ process-focusable vector float) none :behavior process 9) - (check-los? (_type_ time-frame) symbol :behavior process 10) - (skip-check-los? (_type_ int) symbol :behavior process 11) - (set-dst-proc! (_type_ handle) none 12) - (new-source! (_type_ process time-frame collide-spec) none 13) + (los-control-method-9 (_type_ process-focusable vector float) none :behavior process) + (check-los? (_type_ time-frame) symbol :behavior process) + (skip-check-los? (_type_ int) symbol :behavior process) + (set-dst-proc! (_type_ handle) none) + (new-source! (_type_ process time-frame collide-spec) none) ) ) diff --git a/goal_src/jak2/engine/collide/los-control.gc b/goal_src/jak2/engine/collide/los-control.gc index c3c6efc2691..1307594068d 100644 --- a/goal_src/jak2/engine/collide/los-control.gc +++ b/goal_src/jak2/engine/collide/los-control.gc @@ -10,7 +10,7 @@ (define *los-time-offset* (the-as time-frame 0)) ;; WARN: Return type mismatch time-frame vs none. -(defmethod los-control-method-9 los-control ((this los-control) (process process-focusable) (trans-vec vector) (radius float)) +(defmethod los-control-method-9 ((this los-control) (process process-focusable) (trans-vec vector) (radius float)) (when (and (time-elapsed? (-> this last-check-time) (-> this check-interval)) (-> this src-proc) (or process (-> this dst-proc)) @@ -67,25 +67,25 @@ (none) ) -(defmethod check-los? los-control ((this los-control) (arg0 time-frame)) +(defmethod check-los? ((this los-control) (arg0 time-frame)) (and (time-elapsed? (-> this have-los) (+ (-> this check-interval) arg0)) (not (time-elapsed? (-> this have-no-los) (-> this check-interval))) ) ) -(defmethod skip-check-los? los-control ((this los-control) (arg0 int)) +(defmethod skip-check-los? ((this los-control) (arg0 int)) (and (time-elapsed? (-> this have-no-los) (+ (-> this check-interval) arg0)) (not (time-elapsed? (-> this have-los) (-> this check-interval))) ) ) -(defmethod set-dst-proc! los-control ((this los-control) (dst handle)) +(defmethod set-dst-proc! ((this los-control) (dst handle)) (set! (-> this dst-proc) dst) 0 (none) ) -(defmethod new-source! los-control ((this los-control) (proc process) (check-interval time-frame) (c-spec collide-spec)) +(defmethod new-source! ((this los-control) (proc process) (check-interval time-frame) (c-spec collide-spec)) (set! (-> this src-proc) (process->handle proc)) (set! (-> this dst-proc) (the-as handle #f)) (set! (-> this have-los) 0) diff --git a/goal_src/jak2/engine/collide/pat-h.gc b/goal_src/jak2/engine/collide/pat-h.gc index a2705595d21..e3854e560f7 100644 --- a/goal_src/jak2/engine/collide/pat-h.gc +++ b/goal_src/jak2/engine/collide/pat-h.gc @@ -88,9 +88,6 @@ (noprobe uint8 :offset 28 :size 1) (nolineofsight uint8 :offset 16 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -107,14 +104,11 @@ ) (deftype pat-mode-info (structure) - ((name string :offset-assert 0) - (wall-angle float :offset-assert 4) - (color rgba :offset-assert 8) - (hilite-color rgba :offset-assert 12) + ((name string) + (wall-angle float) + (color rgba) + (hilite-color rgba) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) diff --git a/goal_src/jak2/engine/common_objs/base-plat.gc b/goal_src/jak2/engine/common_objs/base-plat.gc index 05c4e8b0a33..fcb7e2cb1dc 100644 --- a/goal_src/jak2/engine/common_objs/base-plat.gc +++ b/goal_src/jak2/engine/common_objs/base-plat.gc @@ -20,37 +20,33 @@ ;; DECOMP BEGINS (deftype base-plat (process-focusable) - ((root collide-shape-moving :override) - (smush smush-control :inline :offset-assert 208) - (basetrans vector :inline :offset-assert 240) - (bounce-time time-frame :offset-assert 256) - (bouncing symbol :offset-assert 264) - (bounce-scale meters :offset-assert 268) + ((root collide-shape-moving :override) + (smush smush-control :inline) + (basetrans vector :inline) + (bounce-time time-frame) + (bouncing symbol) + (bounce-scale meters) ) - :heap-base #x90 - :method-count-assert 34 - :size-assert #x110 - :flag-assert #x2200900110 (:methods - (execute-effects (_type_) none 27) - (stop-bouncing! (_type_) none 28) - (start-bouncing! (_type_) none :behavior base-plat 29) - (get-art-group (_type_) art-group 30) - (init-plat-collision! (_type_) none 31) - (base-plat-method-32 (_type_) none 32) - (init-plat! (_type_) none 33) + (execute-effects (_type_) none) + (stop-bouncing! (_type_) none) + (start-bouncing! (_type_) none :behavior base-plat) + (get-art-group (_type_) art-group) + (init-plat-collision! (_type_) none) + (base-plat-method-32 (_type_) none) + (init-plat! (_type_) none) ) ) -(defmethod init-plat! base-plat ((this base-plat)) +(defmethod init-plat! ((this base-plat)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." 0 (none) ) -(defmethod stop-bouncing! base-plat ((this base-plat)) +(defmethod stop-bouncing! ((this base-plat)) "Sets `bouncing` to false and resets related settings to their defaults" (set! (-> this basetrans quad) (-> this root trans quad)) (set! (-> this bouncing) #f) @@ -59,7 +55,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod start-bouncing! base-plat ((this base-plat)) +(defmethod start-bouncing! ((this base-plat)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" @@ -127,12 +123,12 @@ If we aren't bouncing however, TODO - CSHAPE" (none) ) -(defmethod base-plat-method-32 base-plat ((this base-plat)) +(defmethod base-plat-method-32 ((this base-plat)) 0 (none) ) -(defmethod execute-effects base-plat ((this base-plat)) +(defmethod execute-effects ((this base-plat)) "Executes various ancillary tasks with the platform, such as spawning particles or playing the associated sound" (if (nonzero? (-> this part)) (spawn (-> this part) (-> this root trans)) @@ -157,31 +153,29 @@ If we aren't bouncing however, TODO - CSHAPE" (deftype eco-door (process-drawable) "@unused - Likely a left-over from Jak 1" - ((root collide-shape :override) - (speed float :offset-assert 200) - (open-distance float :offset-assert 204) - (close-distance float :offset-assert 208) - (out-dir vector :inline :offset-assert 224) - (open-sound sound-name :offset-assert 240) - (close-sound sound-name :offset-assert 256) - (state-actor entity-actor :offset-assert 272) - (flags eco-door-flags :offset-assert 276) - (locked symbol :offset-assert 280) - (auto-close symbol :offset-assert 284) - (one-way symbol :offset-assert 288) + ((root collide-shape :override) + (speed float) + (open-distance float) + (close-distance float) + (out-dir vector :inline) + (open-sound sound-name) + (close-sound sound-name) + (state-actor entity-actor) + (flags eco-door-flags) + (locked symbol) + (auto-close symbol) + (one-way symbol) ) - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x124 - :flag-assert #x1b00b00124 + (:state-methods + door-closed + door-opening + door-open + door-closing + ) (:methods - (door-closed () _type_ :state 20) - (door-opening () _type_ :state 21) - (door-open () _type_ :state 22) - (door-closing () _type_ :state 23) - (lock-according-to-task! (_type_) none 24) - (eco-door-method-25 (_type_) none 25) - (stub (_type_) none 26) + (lock-according-to-task! (_type_) none) + (eco-door-method-25 (_type_) none) + (stub (_type_) none) ) ) @@ -334,7 +328,7 @@ eco-door-event-handler :post transform-post ) -(defmethod lock-according-to-task! eco-door ((this eco-door)) +(defmethod lock-according-to-task! ((this eco-door)) "If the associated subtask is completed, lock the door if [[eco-door-flags:0]] is set otherwise, lock it if [[eco-door-flags:0]] is set" (when (-> this state-actor) @@ -347,7 +341,7 @@ otherwise, lock it if [[eco-door-flags:0]] is set" (none) ) -(defmethod eco-door-method-25 eco-door ((this eco-door)) +(defmethod eco-door-method-25 ((this eco-door)) (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) (set! (-> collision-mesh prim-core collide-as) (collide-spec obstacle)) @@ -369,14 +363,14 @@ otherwise, lock it if [[eco-door-flags:0]] is set" (none) ) -(defmethod stub eco-door ((this eco-door)) +(defmethod stub ((this eco-door)) "@unused - Stub with no overrides" 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! eco-door ((this eco-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/engine/common_objs/basebutton.gc b/goal_src/jak2/engine/common_objs/basebutton.gc index 8913f45f06c..2024104168b 100644 --- a/goal_src/jak2/engine/common_objs/basebutton.gc +++ b/goal_src/jak2/engine/common_objs/basebutton.gc @@ -20,37 +20,35 @@ ;; DECOMP BEGINS (deftype basebutton (process-focusable) - ((button-status button-status :offset-assert 204) - (notify-actor entity :offset-assert 208) - (actor-group (pointer actor-group) :offset-assert 212) - (actor-group-count int32 :offset-assert 216) - (timeout float :offset-assert 220) - (button-id int32 :offset-assert 224) - (event-going-down symbol :offset-assert 228) - (event-down symbol :offset-assert 232) - (event-going-up symbol :offset-assert 236) - (event-up symbol :offset-assert 240) - (anim-speed float :offset-assert 244) - (move-to-pos vector :inline :offset-assert 256) - (move-to-quat quaternion :inline :offset-assert 272) + ((button-status button-status) + (notify-actor entity) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (timeout float) + (button-id int32) + (event-going-down symbol) + (event-down symbol) + (event-going-up symbol) + (event-up symbol) + (anim-speed float) + (move-to-pos vector :inline) + (move-to-quat quaternion :inline) ) - :heap-base #xa0 - :method-count-assert 39 - :size-assert #x120 - :flag-assert #x2700a00120 + (:state-methods + down-idle + going-down + going-up + up-idle + ) (:methods - (down-idle () _type_ :state 27) - (going-down () _type_ :state 28) - (going-up () _type_ :state 29) - (up-idle () _type_ :state 30) - (reset! (_type_) none 31) - (idle-state-transition (_type_) object 32) - (basebutton-method-33 (_type_) none 33) - (basebutton-method-34 (_type_) none 34) - (prepare-trigger-event! (_type_) none 35) - (send-event! (_type_ symbol) none :behavior basebutton 36) - (move-to! (_type_ vector quaternion) none 37) - (press! (_type_ symbol) entity-perm-status 38) + (reset! (_type_) none) + (idle-state-transition (_type_) object) + (basebutton-method-33 (_type_) none) + (basebutton-method-34 (_type_) none) + (prepare-trigger-event! (_type_) none) + (send-event! (_type_ symbol) none :behavior basebutton) + (move-to! (_type_ vector quaternion) none) + (press! (_type_ symbol) entity-perm-status) ) ) @@ -60,7 +58,7 @@ :bounds (static-spherem 0 0 0 3) ) -(defmethod move-to! basebutton ((this basebutton) (vec vector) (quat quaternion)) +(defmethod move-to! ((this basebutton) (vec vector) (quat quaternion)) (logclear! (-> this button-status) (button-status button-status-2)) (if vec (set! (-> this move-to-pos quad) (-> vec quad)) @@ -74,7 +72,7 @@ (none) ) -(defmethod idle-state-transition basebutton ((this basebutton)) +(defmethod idle-state-transition ((this basebutton)) "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" (if (logtest? (-> this button-status) (button-status pressed)) (go (method-of-object this down-idle)) @@ -255,7 +253,7 @@ ) ) -(defmethod press! basebutton ((this basebutton) (pressed? symbol)) +(defmethod press! ((this basebutton) (pressed? symbol)) (if pressed? (logior! (-> this button-status) (button-status pressed)) (logclear! (-> this button-status) (button-status pressed)) @@ -268,7 +266,7 @@ ) ) -(defmethod send-event! basebutton ((this basebutton) (event-type symbol)) +(defmethod send-event! ((this basebutton) (event-type symbol)) "Prepares an [[event-message-block]] using the provided type to send an event to: - the `notify-actor` - every [[entity-actor]] in the `actor-group` array @@ -312,7 +310,7 @@ (none) ) -(defmethod reset! basebutton ((this basebutton)) +(defmethod reset! ((this basebutton)) (set! (-> this button-status) (button-status)) (set! (-> this notify-actor) #f) (set! (-> this timeout) 0.0) @@ -325,14 +323,14 @@ (none) ) -(defmethod prepare-trigger-event! basebutton ((this basebutton)) +(defmethod prepare-trigger-event! ((this basebutton)) "Sets `event-going-down` to `'trigger`" (set! (-> this event-going-down) 'trigger) 0 (none) ) -(defmethod basebutton-method-33 basebutton ((this basebutton)) +(defmethod basebutton-method-33 ((this basebutton)) "TODO - joint stuff" (initialize-skeleton this @@ -369,7 +367,7 @@ (none) ) -(defmethod basebutton-method-34 basebutton ((this basebutton)) +(defmethod basebutton-method-34 ((this basebutton)) "TODO - collision stuff" (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) @@ -394,7 +392,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! basebutton ((this basebutton) (arg0 entity-actor)) +(defmethod init-from-entity! ((this basebutton) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/engine/common_objs/blocking-plane.gc b/goal_src/jak2/engine/common_objs/blocking-plane.gc index f652c7c4287..ecafe4dccbd 100644 --- a/goal_src/jak2/engine/common_objs/blocking-plane.gc +++ b/goal_src/jak2/engine/common_objs/blocking-plane.gc @@ -8,15 +8,13 @@ ;; DECOMP BEGINS (deftype blocking-plane (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (init! (_type_ (inline-array vector) float) none 21) + (init! (_type_ (inline-array vector) float) none) ) ) @@ -86,7 +84,7 @@ :code sleep-code ) -(defmethod init! blocking-plane ((this blocking-plane) (vec-pair (inline-array vector)) (height float)) +(defmethod init! ((this blocking-plane) (vec-pair (inline-array vector)) (height float)) "TODO - but sets up the plane given 2 vectors and a height" (let ((s3-0 (-> vec-pair 0)) (s4-0 (-> vec-pair 1)) @@ -160,7 +158,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! blocking-plane ((this blocking-plane) (arg0 entity-actor)) +(defmethod init-from-entity! ((this blocking-plane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/engine/common_objs/collectables.gc b/goal_src/jak2/engine/common_objs/collectables.gc index 2e860ddb1a6..f8d6bdaa979 100644 --- a/goal_src/jak2/engine/common_objs/collectables.gc +++ b/goal_src/jak2/engine/common_objs/collectables.gc @@ -60,57 +60,55 @@ ) (deftype collectable (process-drawable) - ((root collide-shape-moving :override) - (pickup-type pickup-type :offset-assert 200) - (pickup-amount float :offset-assert 204) - (notify handle :offset-assert 208) - (old-base vector :inline :offset-assert 224) - (base vector :inline :offset-assert 240) - (extra-trans vector :inline :offset-assert 256) - (jump-pos vector :inline :offset-assert 272) - (flags collectable-flag :offset-assert 288) - (birth-time seconds :offset-assert 296) - (collect-timeout seconds :offset-assert 304) - (fadeout-timeout seconds :offset-assert 312) - (bob-offset seconds :offset-assert 320) - (bob-amount float :offset-assert 328) - (pickup-handle handle :offset-assert 336) - (actor-pause symbol :offset-assert 344) - (collect-effect basic :offset-assert 348) - (collect-effect2 basic :offset-assert 352) - (target handle :offset-assert 360) - (suck-time seconds :offset-assert 368) - (suck-y-offset float :offset-assert 376) - (speed vector :inline :offset-assert 384) - (movie-pos-index int32 :offset-assert 400) + ((root collide-shape-moving :override) + (pickup-type pickup-type) + (pickup-amount float) + (notify handle) + (old-base vector :inline) + (base vector :inline) + (extra-trans vector :inline) + (jump-pos vector :inline) + (flags collectable-flag) + (birth-time seconds) + (collect-timeout seconds) + (fadeout-timeout seconds) + (bob-offset seconds) + (bob-amount float) + (pickup-handle handle) + (actor-pause symbol) + (collect-effect basic) + (collect-effect2 basic) + (target handle) + (suck-time seconds) + (suck-y-offset float) + (speed vector :inline) + (movie-pos-index int32) ) - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 + (:state-methods + blocked + wait + deploy + (suck handle) + jump + fade + (pickup symbol handle) + die + (notice-blue handle) + ) (:methods - (blocked () _type_ :state 20) - (wait () _type_ :state 21) - (deploy () _type_ :state 22) - (suck (handle) _type_ :state 23) - (jump () _type_ :state 24) - (fade () _type_ :state 25) - (pickup (symbol handle) _type_ :state 26) - (die () _type_ :state 27) - (notice-blue (handle) _type_ :state 28) - (init-common (_type_ entity-actor pickup-type float) none 29) - (initialize-effects (_type_ pickup-type) none 30) - (go-to-initial-state (_type_) none 31) - (initialize-options (_type_ int float fact-info) collectable 32) - (initialize-allocations (_type_) none 33) - (common-post (_type_) none 34) - (do-pickup (_type_ handle) none 35) + (init-common (_type_ entity-actor pickup-type float) none) + (initialize-effects (_type_ pickup-type) none) + (go-to-initial-state (_type_) none) + (initialize-options (_type_ int float fact-info) collectable) + (initialize-allocations (_type_) none) + (common-post (_type_) none) + (do-pickup (_type_ handle) none) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-to-initial-state collectable ((this collectable)) +(defmethod go-to-initial-state ((this collectable)) (cond ((logtest? (-> this fact options) (actor-option wait-for-task-complete)) (go (method-of-object this blocked)) @@ -125,7 +123,7 @@ (none) ) -(defmethod initialize-options collectable ((this collectable) (arg0 int) (arg1 float) (arg2 fact-info)) +(defmethod initialize-options ((this collectable) (arg0 int) (arg1 float) (arg2 fact-info)) (logclear! (-> this mask) (process-mask crate enemy platform ambient)) (logior! (-> this mask) (process-mask bit18)) (set! (-> this flags) (collectable-flag pickup no-eco-blue)) @@ -193,7 +191,7 @@ this ) -(defmethod initialize-allocations collectable ((this collectable)) +(defmethod initialize-allocations ((this collectable)) (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #t) @@ -224,7 +222,7 @@ ) ;; WARN: Return type mismatch ambient-sound vs none. -(defmethod initialize-effects collectable ((this collectable) (arg0 pickup-type)) +(defmethod initialize-effects ((this collectable) (arg0 pickup-type)) (let ((s5-0 (the-as sparticle-launch-group #f)) (s4-0 (the-as sound-spec #f)) ) @@ -344,7 +342,7 @@ (none) ) -(defmethod init-common collectable ((this collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) +(defmethod init-common ((this collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) (set! (-> this pickup-amount) arg2) (set! (-> this pickup-type) arg1) (initialize-allocations this) @@ -359,7 +357,7 @@ (none) ) -(defmethod common-post collectable ((this collectable)) +(defmethod common-post ((this collectable)) (let ((s5-0 (-> this part)) (s4-0 (-> this root root-prim prim-core)) ) @@ -377,7 +375,7 @@ (none) ) -(defmethod do-pickup collectable ((this collectable) (arg0 handle)) +(defmethod do-pickup ((this collectable) (arg0 handle)) (set! (-> this pickup-handle) arg0) (logclear! (-> this mask) (process-mask actor-pause)) (let ((v1-3 (-> this root root-prim))) @@ -1148,16 +1146,12 @@ ) (deftype eco (collectable) - ((respan-delay seconds :offset-assert 408) + ((respan-delay seconds) ) - :heap-base #x120 - :method-count-assert 36 - :size-assert #x1a0 - :flag-assert #x24012001a0 ) -(defmethod initialize-allocations eco ((this eco)) +(defmethod initialize-allocations ((this eco)) (let ((t9-0 (method-of-type collectable initialize-allocations))) (t9-0 this) ) @@ -1241,14 +1235,10 @@ (deftype eco-yellow (eco) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x1a0 - :flag-assert #x24012001a0 ) -(defmethod init-from-entity! eco-yellow ((this eco-yellow) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1261,14 +1251,10 @@ This commonly includes things such as: (deftype eco-red (eco) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x1a0 - :flag-assert #x24012001a0 ) -(defmethod init-from-entity! eco-red ((this eco-red) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-red) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1281,14 +1267,10 @@ This commonly includes things such as: (deftype eco-blue (eco) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x1a0 - :flag-assert #x24012001a0 ) -(defmethod init-from-entity! eco-blue ((this eco-blue) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1301,14 +1283,10 @@ This commonly includes things such as: (deftype eco-green (eco) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x1a0 - :flag-assert #x24012001a0 ) -(defmethod init-from-entity! eco-green ((this eco-green) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-green) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1321,14 +1299,10 @@ This commonly includes things such as: (deftype health (collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 ) -(defmethod init-from-entity! health ((this health) (arg0 entity-actor)) +(defmethod init-from-entity! ((this health) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1341,10 +1315,6 @@ This commonly includes things such as: (deftype eco-pill (collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 ) @@ -1372,7 +1342,7 @@ This commonly includes things such as: ) ) -(defmethod init-from-entity! eco-pill ((this eco-pill) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-pill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1383,13 +1353,13 @@ This commonly includes things such as: (none) ) -(defmethod deactivate eco-pill ((this eco-pill)) +(defmethod deactivate ((this eco-pill)) (+! (-> *game-info* live-eco-pill-count) -1) ((method-of-type collectable deactivate) this) (none) ) -(defmethod initialize-allocations eco-pill ((this eco-pill)) +(defmethod initialize-allocations ((this eco-pill)) (+! (-> *game-info* live-eco-pill-count) 1) (stack-size-set! (-> this main-thread) 128) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1422,14 +1392,10 @@ This commonly includes things such as: (deftype money (collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 ) -(defmethod run-logic? money ((this money)) +(defmethod run-logic? ((this money)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen)) @@ -1443,7 +1409,7 @@ This commonly includes things such as: ) ) -(defmethod deactivate money ((this money)) +(defmethod deactivate ((this money)) (when (and (-> this next-state) (= (-> this next-state name) 'pickup)) (case (-> this pickup-type) (((pickup-type gem)) @@ -1463,7 +1429,7 @@ This commonly includes things such as: (none) ) -(defmethod common-post money ((this money)) +(defmethod common-post ((this money)) (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) (let ((f30-0 (-> this bob-amount))) (when (< 0.0 f30-0) @@ -1527,7 +1493,7 @@ This commonly includes things such as: ) ) -(defmethod initialize-allocations money ((this money)) +(defmethod initialize-allocations ((this money)) (stack-size-set! (-> this main-thread) 128) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1578,7 +1544,7 @@ This commonly includes things such as: (none) ) -(defmethod init-from-entity! money ((this money) (arg0 entity-actor)) +(defmethod init-from-entity! ((this money) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1656,23 +1622,19 @@ This commonly includes things such as: ) (deftype gem (money) - ((roty-speed degrees :offset-assert 404) - (bounce-time seconds :offset-assert 408) + ((roty-speed degrees) + (bounce-time seconds) ) - :heap-base #x120 - :method-count-assert 36 - :size-assert #x1a0 - :flag-assert #x24012001a0 ) -(defmethod deactivate gem ((this gem)) +(defmethod deactivate ((this gem)) (+! (-> *game-info* live-gem-count) -1) (call-parent-method this) (none) ) -(defmethod common-post gem ((this gem)) +(defmethod common-post ((this gem)) (seek! (-> this roty-speed) 20024.889 (* 65536.0 (seconds-per-frame))) (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* (-> this roty-speed) (seconds-per-frame))) (logclear! (-> this draw status) (draw-control-status no-draw-temp uninited)) @@ -1817,7 +1779,7 @@ This commonly includes things such as: ) ) -(defmethod initialize-allocations gem ((this gem)) +(defmethod initialize-allocations ((this gem)) (+! (-> *game-info* live-gem-count) 1) (stack-size-set! (-> this main-thread) 128) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -1884,10 +1846,6 @@ This commonly includes things such as: (deftype skill (money) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 ) @@ -1912,7 +1870,7 @@ This commonly includes things such as: ) ) -(defmethod initialize-allocations skill ((this skill)) +(defmethod initialize-allocations ((this skill)) (stack-size-set! (-> this main-thread) 128) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1974,31 +1932,20 @@ This commonly includes things such as: (deftype fuel-cell (process-hidden) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 ) (deftype trick-point (collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 ) (deftype skate-point (trick-point) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 ) -(defmethod initialize-allocations trick-point ((this trick-point)) +(defmethod initialize-allocations ((this trick-point)) (stack-size-set! (-> this main-thread) 128) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -2031,7 +1978,7 @@ This commonly includes things such as: (none) ) -(defmethod init-from-entity! trick-point ((this trick-point) (arg0 entity-actor)) +(defmethod init-from-entity! ((this trick-point) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2047,16 +1994,12 @@ This commonly includes things such as: ) (deftype ammo-collectable (collectable) - ((ammo-effect basic :offset-assert 404) + ((ammo-effect basic) ) - :heap-base #x120 - :method-count-assert 36 - :size-assert #x198 - :flag-assert #x2401200198 ) -(defmethod initialize-allocations ammo-collectable ((this ammo-collectable)) +(defmethod initialize-allocations ((this ammo-collectable)) (stack-size-set! (-> this main-thread) 128) (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #f) @@ -2102,7 +2045,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod initialize-effects ammo-collectable ((this ammo-collectable) (arg0 pickup-type)) +(defmethod initialize-effects ((this ammo-collectable) (arg0 pickup-type)) (set! (-> this fact pickup-type) arg0) (case arg0 (((pickup-type ammo-yellow)) @@ -2216,7 +2159,7 @@ This commonly includes things such as: (none) ) -(defmethod init-common ammo-collectable ((this ammo-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) +(defmethod init-common ((this ammo-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) (set! (-> this pickup-amount) arg2) (set! (-> this pickup-type) arg1) (initialize-allocations this) @@ -2228,7 +2171,7 @@ This commonly includes things such as: (none) ) -(defmethod common-post ammo-collectable ((this ammo-collectable)) +(defmethod common-post ((this ammo-collectable)) (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) ((method-of-type collectable common-post) this) 0 @@ -2244,28 +2187,16 @@ This commonly includes things such as: (deftype ammo (ammo-collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x198 - :flag-assert #x2401200198 ) (deftype shield (ammo-collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x198 - :flag-assert #x2401200198 ) (deftype upgrade-collectable (ammo-collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x198 - :flag-assert #x2401200198 ) @@ -2301,7 +2232,7 @@ This commonly includes things such as: (none) ) -(defmethod init-from-entity! eco ((this eco) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2536,7 +2467,7 @@ This commonly includes things such as: sv-40 ) -(defmethod drop-pickup fact-info ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) +(defmethod drop-pickup ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) (let ((s2-0 (-> this pickup-type)) (f30-0 (-> this pickup-amount)) ) @@ -2695,9 +2626,6 @@ This commonly includes things such as: (deftype ecovent (process-hidden) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 ) ;; og:preserve-this added macro diff --git a/goal_src/jak2/engine/common_objs/conveyor.gc b/goal_src/jak2/engine/common_objs/conveyor.gc index e1b3a835f33..b08a4860ce6 100644 --- a/goal_src/jak2/engine/common_objs/conveyor.gc +++ b/goal_src/jak2/engine/common_objs/conveyor.gc @@ -8,75 +8,67 @@ ;; DECOMP BEGINS (deftype conveyor-section (structure) - ((start vector :inline :offset-assert 0) - (trailing plane :inline :offset-assert 16) - (pull-dir vector :inline :offset-assert 32) - (radial-dir vector :inline :offset-assert 48) + ((start vector :inline) + (trailing plane :inline) + (pull-dir vector :inline) + (radial-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype conveyor-section-array (inline-array-class) - ((data conveyor-section :inline :dynamic :offset-assert 16) + ((data conveyor-section :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> conveyor-section-array heap-base) (the-as uint 64)) (deftype conveyor (process-drawable) - ((speed float :offset-assert 200) - (belt-radius float :offset-assert 204) - (pull-y-threshold float :offset-assert 208) - (speed-mult-array (array float) :offset-assert 212) - (speed-mult-array-len int8 :offset-assert 216) - (sections conveyor-section-array :offset-assert 220) - (leading plane :inline :offset-assert 224) - (collide-bounds sphere :inline :offset-assert 240) + ((speed float) + (belt-radius float) + (pull-y-threshold float) + (speed-mult-array (array float)) + (speed-mult-array-len int8) + (sections conveyor-section-array) + (leading plane :inline) + (collide-bounds sphere :inline) ) - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (conveyor-method-21 (_type_) float 21) - (get-art-group (_type_) art-group 22) - (reset-root! (_type_) none 23) - (init! (_type_) none 24) - (set-and-get-ambient-sound! (_type_) ambient-sound 25) - (conveyor-method-26 (_type_ process-focusable) symbol :behavior conveyor 26) - (conveyor-method-27 (_type_) symbol 27) + (conveyor-method-21 (_type_) float) + (get-art-group (_type_) art-group) + (reset-root! (_type_) none) + (init! (_type_) none) + (set-and-get-ambient-sound! (_type_) ambient-sound) + (conveyor-method-26 (_type_ process-focusable) symbol :behavior conveyor) + (conveyor-method-27 (_type_) symbol) ) ) -(defmethod relocate conveyor ((this conveyor) (new-addr int)) +(defmethod relocate ((this conveyor) (new-addr int)) (&+! (-> this sections) new-addr) (call-parent-method this new-addr) ) ;; WARN: Return type mismatch symbol vs art-group. -(defmethod get-art-group conveyor ((this conveyor)) +(defmethod get-art-group ((this conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (go process-drawable-art-error "invalid type") (the-as art-group #f) ) -(defmethod reset-root! conveyor ((this conveyor)) +(defmethod reset-root! ((this conveyor)) "Re-initializes the `root` [[trsqv]]" (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) -(defmethod init! conveyor ((this conveyor)) +(defmethod init! ((this conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (local-vars (tag res-tag)) (set! (-> this speed) 24576.0) @@ -98,7 +90,7 @@ ) ;; WARN: Return type mismatch object vs ambient-sound. -(defmethod set-and-get-ambient-sound! conveyor ((this conveyor)) +(defmethod set-and-get-ambient-sound! ((this conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" (let ((actor-options (res-lump-value (-> this entity) 'options actor-option :time -1000000000.0))) @@ -123,7 +115,7 @@ and return it as well. Otherwise, set it to `0`" ) ) -(defmethod conveyor-method-26 conveyor ((this conveyor) (proc-focus process-focusable)) +(defmethod conveyor-method-26 ((this conveyor) (proc-focus process-focusable)) "TODO - conveyor section related, perhaps related to moving the process along the belt?" (let ((vec (new 'stack-no-clear 'vector))) (set! (-> vec quad) (-> (get-trans proc-focus 0) quad)) @@ -167,7 +159,7 @@ and return it as well. Otherwise, set it to `0`" ) ) -(defmethod conveyor-method-27 conveyor ((this conveyor)) +(defmethod conveyor-method-27 ((this conveyor)) "TODO - collision related, has some dead code as well (previous iteration?)" (local-vars (a0-10 float) (a2-5 float) (a2-12 float)) (rlet ((acc :class vf) @@ -304,7 +296,7 @@ and return it as well. Otherwise, set it to `0`" ) ) -(defmethod conveyor-method-21 conveyor ((this conveyor)) +(defmethod conveyor-method-21 ((this conveyor)) "TODO - quite dense, has to do with the conveyor sections and the path they are associated with" (local-vars (sv-32 conveyor-section) (sv-48 conveyor-section)) (let* ((s5-0 (-> this path)) @@ -375,7 +367,7 @@ and return it as well. Otherwise, set it to `0`" ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! conveyor ((this conveyor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this conveyor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -400,10 +392,6 @@ This commonly includes things such as: (deftype strip-conveyor (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) @@ -412,17 +400,13 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 36) ) -(defmethod get-art-group strip-conveyor ((this strip-conveyor)) +(defmethod get-art-group ((this strip-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-strip-conveyor" (the-as (pointer uint32) #f)) ) (deftype lgconveyor (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) @@ -433,13 +417,13 @@ This commonly includes things such as: :origin-joint-index 3 ) -(defmethod get-art-group lgconveyor ((this lgconveyor)) +(defmethod get-art-group ((this lgconveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-lgconveyor" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch float vs none. -(defmethod init! lgconveyor ((this lgconveyor)) +(defmethod init! ((this lgconveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (set! (-> this speed) 30720.0) (set! (-> this belt-radius) 11878.4) diff --git a/goal_src/jak2/engine/common_objs/crates.gc b/goal_src/jak2/engine/common_objs/crates.gc index dcc7b1f8160..b8b5d2bc4ac 100644 --- a/goal_src/jak2/engine/common_objs/crates.gc +++ b/goal_src/jak2/engine/common_objs/crates.gc @@ -17,13 +17,10 @@ ) (deftype crate-bank (basic) - ((COLLIDE_YOFF float :offset-assert 4) - (COLLIDE_RADIUS float :offset-assert 8) - (DARKECO_EXPLODE_RADIUS float :offset-assert 12) + ((COLLIDE_YOFF float) + (COLLIDE_RADIUS float) + (DARKECO_EXPLODE_RADIUS float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -32,35 +29,33 @@ ) (deftype crate (process-focusable) - ((root collide-shape-moving :override) - (smush smush-control :inline :offset-assert 208) - (base vector :inline :offset-assert 240) - (look symbol :offset-assert 256) - (defense symbol :offset-assert 260) - (incoming-attack-id uint32 :offset-assert 264) - (target handle :offset-assert 272) - (child-count int32 :offset-assert 280) - (victory-anim spool-anim :offset-assert 284) + ((root collide-shape-moving :override) + (smush smush-control :inline) + (base vector :inline) + (look symbol) + (defense symbol) + (incoming-attack-id uint32) + (target handle) + (child-count int32) + (victory-anim spool-anim) ) - :heap-base #xa0 - :method-count-assert 41 - :size-assert #x120 - :flag-assert #x2900a00120 + (:state-methods + hide + idle + (die symbol int) + special-contents-die + bounce-on + (notice-blue handle) + carry + fall + ) (:methods - (hide () _type_ :state 27) - (idle () _type_ :state 28) - (die (symbol int) _type_ :state 29) - (special-contents-die () _type_ :state 30) - (bounce-on () _type_ :state 31) - (notice-blue (handle) _type_ :state 32) - (carry () _type_ :state 33) - (fall () _type_ :state 34) - (crate-init! (_type_ entity-actor) none 35) - (skel-init! (_type_) none 36) - (params-set! (_type_ symbol symbol) none 37) - (crate-method-38 (_type_) none 38) - (smush-update! (_type_) none 39) - (crate-method-40 (_type_) symbol :behavior crate 40) + (crate-init! (_type_ entity-actor) none) + (skel-init! (_type_) none) + (params-set! (_type_ symbol symbol) none) + (crate-method-38 (_type_) none) + (smush-update! (_type_) none) + (crate-method-40 (_type_) symbol :behavior crate) ) ) @@ -1107,7 +1102,7 @@ (none) ) -(defmethod init-from-entity! crate ((this crate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1121,7 +1116,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch crate vs none. -(defmethod crate-init! crate ((this crate) (arg0 entity-actor)) +(defmethod crate-init! ((this crate) (arg0 entity-actor)) "Initialize the [[crate]] with the specified [[entity-actor]]." (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask crate)) @@ -1212,7 +1207,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch crate vs none. -(defmethod skel-init! crate ((this crate)) +(defmethod skel-init! ((this crate)) "Initialize the [[crate]]'s skeleton and other parameters based on the crate type." (case (-> this look) (('iron) @@ -1271,7 +1266,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch crate vs none. -(defmethod params-set! crate ((this crate) (arg0 symbol) (arg1 symbol)) +(defmethod params-set! ((this crate) (arg0 symbol) (arg1 symbol)) "Set [[crate]] params based on the arguments." (if arg0 (set! (-> this look) arg0) @@ -1282,7 +1277,7 @@ This commonly includes things such as: (none) ) -(defmethod crate-method-38 crate ((this crate)) +(defmethod crate-method-38 ((this crate)) (when (-> this entity) (if (>= (-> this entity extra perm user-int8 0) 1) (go (method-of-object this die) #t 0) @@ -1303,7 +1298,7 @@ This commonly includes things such as: (none) ) -(defmethod smush-update! crate ((this crate)) +(defmethod smush-update! ((this crate)) (let ((f0-0 (update! (-> this smush)))) (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) (set! (-> this root scale y) (+ 1.0 f0-0)) @@ -1314,7 +1309,7 @@ This commonly includes things such as: ) ;; WARN: disable def twice: 57. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod crate-method-40 crate ((this crate)) +(defmethod crate-method-40 ((this crate)) (cond ((and (> (-> (the-as fact-info-crate (-> this fact)) suck-count) 0) (< (you-suck-stage *game-info* #f) (-> (the-as fact-info-crate (-> this fact)) suck-count)) @@ -1346,17 +1341,13 @@ This commonly includes things such as: ) (deftype pickup-spawner (crate) - ((blocker entity-actor :offset-assert 288) + ((blocker entity-actor) ) - :heap-base #xb0 - :method-count-assert 41 - :size-assert #x124 - :flag-assert #x2900b00124 ) ;; WARN: Return type mismatch pickup-spawner vs none. -(defmethod crate-init! pickup-spawner ((this pickup-spawner) (arg0 entity-actor)) +(defmethod crate-init! ((this pickup-spawner) (arg0 entity-actor)) "Initialize the [[crate]] with the specified [[entity-actor]]." (let ((t9-0 (method-of-type crate crate-init!))) (t9-0 this arg0) @@ -1369,7 +1360,7 @@ This commonly includes things such as: (none) ) -(defmethod crate-method-38 pickup-spawner ((this pickup-spawner)) +(defmethod crate-method-38 ((this pickup-spawner)) (go (method-of-object this idle)) 0 (none) diff --git a/goal_src/jak2/engine/common_objs/dark-eco-pool.gc b/goal_src/jak2/engine/common_objs/dark-eco-pool.gc index f662917adc0..4ba017be993 100644 --- a/goal_src/jak2/engine/common_objs/dark-eco-pool.gc +++ b/goal_src/jak2/engine/common_objs/dark-eco-pool.gc @@ -9,10 +9,6 @@ (deftype dark-eco-pool (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) @@ -44,7 +40,7 @@ ) ;; WARN: Return type mismatch ambient-sound vs none. -(defmethod offset! dark-eco-pool ((this dark-eco-pool)) +(defmethod offset! ((this dark-eco-pool)) "Offset a [[water-anim]]'s `trans` and `quat` by the lump data in `entity`." (let ((t9-0 (method-of-type water-anim offset!))) (t9-0 this) @@ -72,7 +68,7 @@ ) ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! dark-eco-pool ((this dark-eco-pool)) +(defmethod init-water! ((this dark-eco-pool)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) (t9-0 this) diff --git a/goal_src/jak2/engine/common_objs/elevator.gc b/goal_src/jak2/engine/common_objs/elevator.gc index 574095e0935..623d65bd902 100644 --- a/goal_src/jak2/engine/common_objs/elevator.gc +++ b/goal_src/jak2/engine/common_objs/elevator.gc @@ -52,79 +52,68 @@ ;; DECOMP BEGINS (deftype elevator-params (structure) - ((xz-threshold float :offset-assert 0) - (y-threshold float :offset-assert 4) - (start-pos float :offset-assert 8) - (move-rate float :offset-assert 12) - (flags elevator-flags :offset-assert 16) + ((xz-threshold float) + (y-threshold float) + (start-pos float) + (move-rate float) + (flags elevator-flags) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype path-step (structure) - ((next-pos float :offset-assert 0) - (dist float :offset-assert 4) + ((next-pos float) + (dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype path-step-inline-array (inline-array-class) - ((data path-step :inline :dynamic :offset-assert 16) + ((data path-step :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> path-step-inline-array heap-base) (the-as uint 16)) (deftype elevator (base-plat) - ((params elevator-params :inline :offset-assert 272) - (path-seq path-step-inline-array :offset-assert 296) - (path-dest float :offset-assert 300) - (bottom-top float 2 :offset-assert 304) - (move-pos float 2 :offset-assert 312) - (move-dist float :offset-assert 320) - (path-pos float :offset-assert 324) - (path-eased-pos float :offset-assert 328) - (ride-timer time-frame :offset-assert 336) - (sticky-player-last-ride-time time-frame :offset-assert 344) - (elevator-status elevator-status :offset-assert 352) - (on-activate pair :offset-assert 360) - (on-deactivate pair :offset-assert 364) + ((params elevator-params :inline) + (path-seq path-step-inline-array) + (path-dest float) + (bottom-top float 2) + (move-pos float 2) + (move-dist float) + (path-pos float) + (path-eased-pos float) + (ride-timer time-frame) + (sticky-player-last-ride-time time-frame) + (elevator-status elevator-status) + (on-activate pair) + (on-deactivate pair) ) - :heap-base #xf0 - :method-count-assert 49 - :size-assert #x170 - :flag-assert #x3100f00170 + (:state-methods + dormant + waiting + running + arrived + ) (:methods - (dormant () _type_ :state 34) - (waiting () _type_ :state 35) - (running () _type_ :state 36) - (arrived () _type_ :state 37) - (elevator-method-38 (_type_) none 38) - (calc-dist-between-points! (_type_ int int) none 39) - (activate-elevator (_type_) object 40) - (init-defaults! (_type_) none 41) - (set-ambient-sound! (_type_) none 42) - (move-between-points (_type_ vector float float) symbol 43) - (elevator-method-44 (_type_) symbol 44) - (commited-to-ride? (_type_) symbol 45) - (move-to-next-point! (_type_) none 46) - (find-closest-point-in-path! (_type_ vector (pointer float) symbol symbol) symbol 47) - (elevator-method-48 (_type_) none 48) + (elevator-method-38 (_type_) none) + (calc-dist-between-points! (_type_ int int) none) + (activate-elevator (_type_) object) + (init-defaults! (_type_) none) + (set-ambient-sound! (_type_) none) + (move-between-points (_type_ vector float float) symbol) + (elevator-method-44 (_type_) symbol) + (commited-to-ride? (_type_) symbol) + (move-to-next-point! (_type_) none) + (find-closest-point-in-path! (_type_ vector (pointer float) symbol symbol) symbol) + (elevator-method-48 (_type_) none) ) ) -(defmethod move-between-points elevator ((this elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -133,7 +122,7 @@ #f ) -(defmethod elevator-method-48 elevator ((this elevator)) +(defmethod elevator-method-48 ((this elevator)) "TODO - collision related" (let ((target *target*)) (when target @@ -167,7 +156,7 @@ (none) ) -(defmethod init-defaults! elevator ((this elevator)) +(defmethod init-defaults! ((this elevator)) "Initializes default settings related to the [[elevator]]: - `elevator-xz-threshold` - `elevator-y-threshold` @@ -401,7 +390,7 @@ which is obviously useful for an elevator." ) ) -(defmethod find-closest-point-in-path! elevator ((this elevator) (arg0 vector) (arg1 (pointer float)) (arg2 symbol) (arg3 symbol)) +(defmethod find-closest-point-in-path! ((this elevator) (arg0 vector) (arg1 (pointer float)) (arg2 symbol) (arg3 symbol)) "Finds and sets the provided [[path-step]]'s `next-pos` field to the vertex index in the path which is closest to the provided [[vector]] @@ -445,7 +434,7 @@ the provided [[vector]] ) ;; WARN: Return type mismatch object vs symbol. -(defmethod elevator-method-44 elevator ((this elevator)) +(defmethod elevator-method-44 ((this elevator)) (let* ((target-temp *target*) (target (if (type? target-temp process-focusable) target-temp @@ -459,12 +448,12 @@ the provided [[vector]] ) ) -(defmethod commited-to-ride? elevator ((this elevator)) +(defmethod commited-to-ride? ((this elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" #t ) -(defmethod move-to-next-point! elevator ((this elevator)) +(defmethod move-to-next-point! ((this elevator)) "If the [[*target*]] is in a valid state and there is a point to transition to in the elevator's path do so. @see [[elevator::47]]" @@ -731,7 +720,7 @@ do so. :post plat-post ) -(defmethod calc-dist-between-points! elevator ((this elevator) (path-point-x int) (path-point-y int)) +(defmethod calc-dist-between-points! ((this elevator) (path-point-x int) (path-point-y int)) "Calculates the distance between two points in the elevator's path. @param path-point-x The index of the first point in the distance calculation, and where `next-pos` and `dist` are stored in the `path-seq` array @@ -746,28 +735,28 @@ do so. (none) ) -(defmethod set-ambient-sound! elevator ((this elevator)) +(defmethod set-ambient-sound! ((this elevator)) "Sets the elevator's [[ambient-sound]] up" (set! (-> this sound) (the-as ambient-sound 0)) 0 (none) ) -(defmethod init-plat! elevator ((this elevator)) +(defmethod init-plat! ((this elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." 0 (none) ) -(defmethod relocate elevator ((this elevator) (arg0 int)) +(defmethod relocate ((this elevator) (arg0 int)) (if (nonzero? (-> this path-seq)) (&+! (-> this path-seq) arg0) ) (call-parent-method this arg0) ) -(defmethod activate-elevator elevator ((this elevator)) +(defmethod activate-elevator ((this elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (if (logtest? (-> this params flags) (elevator-flags elevator-flags-6)) (go (method-of-object this arrived)) @@ -776,7 +765,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! elevator ((this elevator) (entity entity-actor)) +(defmethod init-from-entity! ((this elevator) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/engine/common_objs/generic-obs-h.gc b/goal_src/jak2/engine/common_objs/generic-obs-h.gc index 620d05ce283..85d1730e728 100644 --- a/goal_src/jak2/engine/common_objs/generic-obs-h.gc +++ b/goal_src/jak2/engine/common_objs/generic-obs-h.gc @@ -23,195 +23,172 @@ ;; DECOMP BEGINS (deftype manipy (process-drawable) - ((root collide-shape :override) - (new-trans-hook (function none) :offset-assert 200) - (cur-trans-hook (function none) :offset-assert 204) - (cur-event-hook (function none) :offset-assert 208) - (new-joint-anim art-joint-anim :offset-assert 212) - (new-joint-anim-blend uint64 :offset-assert 216) - (anim-mode symbol :offset-assert 224) - (cur-grab-handle handle :offset-assert 232) - (cur-target-handle handle :offset-assert 240) - (old-grab-pos vector :inline :offset-assert 256) - (joint joint-mod 4 :offset-assert 272) - (new-post-hook (function none) :offset-assert 288) - (cur-post-hook (function none) :offset-assert 292) - (clone-copy-trans symbol :offset-assert 296) - (shadow-backup basic :offset-assert 300) - (draw? symbol :offset-assert 304) - (userdata uint64 :offset-assert 312) - (prefix basic :offset-assert 320) - (shadow-volume-joint int32 :offset-assert 324) - (speed float :offset-assert 328) - (user-uint64 uint64 4 :offset-assert 336) - (options manipy-options :offset-assert 368) + ((root collide-shape :override) + (new-trans-hook (function none)) + (cur-trans-hook (function none)) + (cur-event-hook (function none)) + (new-joint-anim art-joint-anim) + (new-joint-anim-blend uint64) + (anim-mode symbol) + (cur-grab-handle handle) + (cur-target-handle handle) + (old-grab-pos vector :inline) + (joint joint-mod 4) + (new-post-hook (function none)) + (cur-post-hook (function none)) + (clone-copy-trans symbol) + (shadow-backup basic) + (draw? symbol) + (userdata uint64) + (prefix basic) + (shadow-volume-joint int32) + (speed float) + (user-uint64 uint64 4) + (options manipy-options) ) - :heap-base #x100 - :method-count-assert 21 - :size-assert #x174 - :flag-assert #x1501000174 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype part-spawner (process) - ((root trsqv :offset-assert 128) - (part sparticle-launch-control :offset-assert 132) - (sound ambient-sound :offset-assert 136) - (mode (pointer sparticle-launch-group) :offset-assert 140) - (enable symbol :offset-assert 144) - (radius meters :offset-assert 148) - (world-sphere sphere :inline :offset-assert 160) + ((root trsqv) + (part sparticle-launch-control) + (sound ambient-sound) + (mode (pointer sparticle-launch-group)) + (enable symbol) + (radius meters) + (world-sphere sphere :inline) ) - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 + (:state-methods + active + ) (:methods - (active () _type_ :state 14) - (is-in-view? (_type_) symbol 15) + (is-in-view? (_type_) symbol) ) ) (deftype part-tracker (process) - ((root trsqv :offset-assert 128) - (mat matrix :inline :offset-assert 144) - (part sparticle-launch-control :offset-assert 208) - (callback (function part-tracker vector) :offset-assert 212) - (linger-callback (function part-tracker vector) :offset-assert 216) - (duration uint64 :offset-assert 224) - (linger-duration uint64 :offset-assert 232) - (start-time time-frame :offset-assert 240) - (target handle :offset-assert 248) - (target-joint int32 :offset-assert 256) - (offset vector :inline :offset-assert 272) - (userdata uint64 :offset-assert 288) - (user-time time-frame 2 :offset-assert 296) - (user-vector vector :inline :offset-assert 320) - (user-handle uint32 2 :offset 352) + ((root trsqv) + (mat matrix :inline) + (part sparticle-launch-control) + (callback (function part-tracker vector)) + (linger-callback (function part-tracker vector)) + (duration uint64) + (linger-duration uint64) + (start-time time-frame) + (target handle) + (target-joint int32) + (offset vector :inline) + (userdata uint64) + (user-time time-frame 2) + (user-vector vector :inline) + (user-handle uint32 2 :offset 352) ) - :heap-base #xf0 - :method-count-assert 16 - :size-assert #x168 - :flag-assert #x1000f00168 + (:state-methods + active + ) (:methods - (active () _type_ :state 14) - (notify-parent-of-death (_type_) none 15) + (notify-parent-of-death (_type_) none) ) ) (deftype lightning-tracker (process) - ((ppointer (pointer lightning-tracker) :override) - (root trsqv :offset-assert 128) - (lightning lightning-control :offset-assert 132) - (callback (function lightning-tracker none) :offset-assert 136) - (duration uint64 :offset-assert 144) - (start-time time-frame :offset-assert 152) - (offset0 vector :inline :offset-assert 160) - (offset1 vector :inline :offset-assert 176) - (target0 handle :offset-assert 192) - (target1 handle :offset-assert 200) - (target-joint0 int32 :offset-assert 208) - (target-joint1 int32 :offset-assert 212) - (sound sound-id :offset-assert 216) - (userdata uint64 :offset-assert 224) - (user-time time-frame 2 :offset-assert 232) - (user-vector vector :inline :offset-assert 256) - (user-handle handle 2 :offset 288) + ((ppointer (pointer lightning-tracker) :override) + (root trsqv) + (lightning lightning-control) + (callback (function lightning-tracker none)) + (duration uint64) + (start-time time-frame) + (offset0 vector :inline) + (offset1 vector :inline) + (target0 handle) + (target1 handle) + (target-joint0 int32) + (target-joint1 int32) + (sound sound-id) + (userdata uint64) + (user-time time-frame 2) + (user-vector vector :inline) + (user-handle handle 2 :offset 288) ) - :heap-base #xb0 - :method-count-assert 17 - :size-assert #x130 - :flag-assert #x1100b00130 + (:state-methods + active + ) (:methods - (active () _type_ :state 14) - (notify-parent-of-death (_type_) none 15) - (update (_type_) none 16) + (notify-parent-of-death (_type_) none) + (update (_type_) none) ) ) (deftype touch-tracker (process-drawable) - ((root collide-shape :override) - (duration time-frame :offset-assert 200) - (target handle :offset-assert 208) - (event symbol :offset-assert 216) - (run-function (function object) :offset-assert 220) - (callback (function touch-tracker none) :offset-assert 224) - (event-mode basic :offset-assert 228) + ((root collide-shape :override) + (duration time-frame) + (target handle) + (event symbol) + (run-function (function object)) + (callback (function touch-tracker none)) + (event-mode basic) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xe8 - :flag-assert #x15007000e8 - (:methods - (active () _type_ :state 20) + (:state-methods + active ) ) (deftype swingpole (process-drawable) - ((root collide-shape :override) - (edge-length meters :offset-assert 200) - (path-pos float :offset-assert 204) - (joint-track int32 :offset-assert 208) - (speed meters :offset-assert 212) - (dir vector :inline :offset-assert 224) - (sync sync-eased :inline :offset-assert 240) + ((root collide-shape :override) + (edge-length meters) + (path-pos float) + (joint-track int32) + (speed meters) + (dir vector :inline) + (sync sync-eased :inline) ) - :heap-base #xa0 - :method-count-assert 23 - :size-assert #x11c - :flag-assert #x1700a0011c + (:state-methods + idle + (active handle) + ) (:methods - (idle () _type_ :state 20) - (active (handle) _type_ :state 21) - (move-along-path (_type_) none 22) + (move-along-path (_type_) none) ) ) (deftype gui-query (structure) - ((x-position int32 :offset-assert 0) - (y-position int32 :offset-assert 4) - (message string :offset-assert 8) - (decision symbol :offset-assert 12) - (only-allow-cancel symbol :offset-assert 16) - (no-msg string :offset-assert 20) - (message-space int32 :offset-assert 24) + ((x-position int32) + (y-position int32) + (message string) + (decision symbol) + (only-allow-cancel symbol) + (no-msg string) + (message-space int32) ) - :method-count-assert 11 - :size-assert #x1c - :flag-assert #xb0000001c (:methods - (gui-query-method-9 () none 9) - (gui-query-method-10 () none 10) + (gui-query-method-9 () none) + (gui-query-method-10 () none) ) ) (deftype othercam (process) - ((hand handle :offset-assert 128) - (old-global-mask process-mask :offset-assert 136) - (mask-to-clear process-mask :offset-assert 140) - (cam-joint-index int32 :offset-assert 144) - (old-pos vector :inline :offset-assert 160) - (old-mat-z vector :inline :offset-assert 176) - (had-valid-frame basic :offset-assert 192) - (border-value basic :offset-assert 196) - (die? symbol :offset-assert 200) - (survive-anim-end? symbol :offset-assert 204) - (spooling? symbol :offset-assert 208) - (fov float :offset-assert 212) + ((hand handle) + (old-global-mask process-mask) + (mask-to-clear process-mask) + (cam-joint-index int32) + (old-pos vector :inline) + (old-mat-z vector :inline) + (had-valid-frame basic) + (border-value basic) + (die? symbol) + (survive-anim-end? symbol) + (spooling? symbol) + (fov float) ) - :heap-base #x60 - :method-count-assert 14 - :size-assert #xd8 - :flag-assert #xe006000d8 (:states othercam-running ) @@ -219,44 +196,36 @@ (deftype explosion (process-drawable) - ((root collide-shape :override) - (start-time time-frame :offset-assert 200) - (duration uint32 :offset-assert 208) - (linger-duration uint32 :offset-assert 212) - (attack-id uint32 :offset-assert 216) + ((root collide-shape :override) + (start-time time-frame) + (duration uint32) + (linger-duration uint32) + (attack-id uint32) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17006000dc + (:state-methods + explode + ) (:methods - (explode () _type_ :state 20) - (setup-explosion-collision (_type_) none 21) - (explosion-method-22 (_type_) none 22) + (setup-explosion-collision (_type_) none) + (explosion-method-22 (_type_) none) ) ) (deftype explosion-init-params (structure) - ((spawn-point vector :inline :offset-assert 0) - (spawn-quat quaternion :inline :offset-assert 16) - (radius float :offset-assert 32) - (group sparticle-launch-group :offset-assert 36) - (collide-with collide-spec :offset-assert 40) - (penetrate-using penetrate :offset-assert 48) + ((spawn-point vector :inline) + (spawn-quat quaternion :inline) + (radius float) + (group sparticle-launch-group) + (collide-with collide-spec) + (penetrate-using penetrate) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) (deftype process-hidden (process) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 - (:methods - (die () _type_ :state 14) + (:state-methods + die ) ) diff --git a/goal_src/jak2/engine/common_objs/generic-obs.gc b/goal_src/jak2/engine/common_objs/generic-obs.gc index 43a76f92795..a7c6dc452e1 100644 --- a/goal_src/jak2/engine/common_objs/generic-obs.gc +++ b/goal_src/jak2/engine/common_objs/generic-obs.gc @@ -41,7 +41,7 @@ ) (set! gp-0 (lookup-part-group-pointer-by-name (the-as string s3-0))) (if (the-as (pointer object) gp-0) - ;; TODO - manual fix here + ;; og:preserve-this TODO - manual fix here (set! (-> (the-as (pointer int32) s4-0)) (the-as int gp-0)) ) ) @@ -138,7 +138,7 @@ (none) ) -(defmethod move-along-path swingpole ((this swingpole)) +(defmethod move-along-path ((this swingpole)) (with-pp (if (nonzero? (-> this draw)) (ja-post) @@ -240,7 +240,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! swingpole ((this swingpole) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swingpole) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -337,7 +337,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! process-hidden ((this process-hidden) (arg0 entity-actor)) +(defmethod init-from-entity! ((this process-hidden) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -352,17 +352,11 @@ This commonly includes things such as: (deftype target-start (process-hidden) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 ) (deftype camera-start (process-hidden) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 ) @@ -1025,7 +1019,7 @@ This commonly includes things such as: (none) ) -(defmethod deactivate part-tracker ((this part-tracker)) +(defmethod deactivate ((this part-tracker)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) @@ -1034,7 +1028,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod notify-parent-of-death part-tracker ((this part-tracker)) +(defmethod notify-parent-of-death ((this part-tracker)) (with-pp (let ((gp-0 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-0 from) (process->ppointer pp)) @@ -1250,7 +1244,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod notify-parent-of-death lightning-tracker ((this lightning-tracker)) +(defmethod notify-parent-of-death ((this lightning-tracker)) (with-pp (let ((gp-0 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-0 from) (process->ppointer pp)) @@ -1272,7 +1266,7 @@ This commonly includes things such as: ) ) -(defmethod update lightning-tracker ((this lightning-tracker)) +(defmethod update ((this lightning-tracker)) (if (-> this callback) ((-> this callback) this) ) @@ -1554,9 +1548,8 @@ This commonly includes things such as: (set! (-> self target-joint1) -1) ;; og:preserve-this hack, fixed bug in original game (when arg5 - (set! (-> self offset1 quad) (-> arg5 quad)) - ) - ) + (set! (-> self offset1 quad) (-> arg5 quad)) + )) ) (set! (-> self root) (new 'process 'trsqv)) (set! (-> self callback) (the-as (function lightning-tracker none) arg2)) @@ -1700,16 +1693,12 @@ This commonly includes things such as: ) (deftype med-res-level (process-drawable) - ((level-name basic :offset-assert 200) - (part-mode basic :offset-assert 204) - (index int32 :offset-assert 208) + ((level-name basic) + (part-mode basic) + (index int32) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd4 - :flag-assert #x15006000d4 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1745,7 +1734,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! med-res-level ((this med-res-level) (arg0 entity-actor)) +(defmethod init-from-entity! ((this med-res-level) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1773,7 +1762,7 @@ This commonly includes things such as: (none) ) -(defmethod deactivate part-spawner ((this part-spawner)) +(defmethod deactivate ((this part-spawner)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) @@ -1784,7 +1773,7 @@ This commonly includes things such as: (none) ) -(defmethod is-in-view? part-spawner ((this part-spawner)) +(defmethod is-in-view? ((this part-spawner)) (sphere<-vector+r! (-> this world-sphere) (-> this root trans) (-> this radius)) (sphere-in-view-frustum? (-> this world-sphere)) ) @@ -1826,7 +1815,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! part-spawner ((this part-spawner) (arg0 entity-actor)) +(defmethod init-from-entity! ((this part-spawner) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1889,22 +1878,18 @@ This commonly includes things such as: ) (deftype launcher (process-drawable) - ((root collide-shape :override) - (spring-height meters :offset-assert 200) - (camera state :offset-assert 204) - (active-distance float :offset-assert 208) - (seek-time time-frame :offset-assert 216) - (dest vector :inline :offset-assert 224) - (sound-id sound-id :offset-assert 240) + ((root collide-shape :override) + (spring-height meters) + (camera state) + (active-distance float) + (seek-time time-frame) + (dest vector :inline) + (sound-id sound-id) ) - :heap-base #x80 - :method-count-assert 23 - :size-assert #xf4 - :flag-assert #x17008000f4 - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (deactivated () _type_ :state 22) + (:state-methods + idle + active + deactivated ) ) @@ -2433,7 +2418,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! launcher ((this launcher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this launcher) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2724,7 +2709,7 @@ This commonly includes things such as: (none) ) -(defmethod setup-explosion-collision explosion ((this explosion)) +(defmethod setup-explosion-collision ((this explosion)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (set! (-> s5-0 penetrate-using) (penetrate explode)) (let ((v1-3 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) @@ -2745,7 +2730,7 @@ This commonly includes things such as: (none) ) -(defmethod explosion-method-22 explosion ((this explosion)) +(defmethod explosion-method-22 ((this explosion)) 0 (none) ) diff --git a/goal_src/jak2/engine/common_objs/plat.gc b/goal_src/jak2/engine/common_objs/plat.gc index c663a3dcb6a..2994a615058 100644 --- a/goal_src/jak2/engine/common_objs/plat.gc +++ b/goal_src/jak2/engine/common_objs/plat.gc @@ -8,18 +8,16 @@ ;; DECOMP BEGINS (deftype plat (base-plat) - ((path-pos float :offset-assert 272) - (sound-id sound-id :offset-assert 276) - (sync sync-eased :inline :offset-assert 280) + ((path-pos float) + (sound-id sound-id) + (sync sync-eased :inline) ) - :heap-base #xd0 - :method-count-assert 37 - :size-assert #x144 - :flag-assert #x2500d00144 + (:state-methods + plat-idle + plat-path-active + ) (:methods - (plat-idle () _type_ :state 34) - (plat-path-active () _type_ :state 35) - (plat-path-sync (_type_) object 36) + (plat-path-sync (_type_) object) ) ) @@ -29,12 +27,12 @@ :bounds (static-spherem 0 -0.5 0 3) ) -(defmethod get-art-group plat ((this plat)) +(defmethod get-art-group ((this plat)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-plat" (the-as (pointer uint32) #f)) ) -(defmethod init-plat-collision! plat ((this plat)) +(defmethod init-plat-collision! ((this plat)) "TODO - collision stuff for setting up the platform" (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) @@ -58,19 +56,19 @@ (none) ) -(defmethod init-plat! plat ((this plat)) +(defmethod init-plat! ((this plat)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." 0 (none) ) -(defmethod base-plat-method-32 plat ((this plat)) +(defmethod base-plat-method-32 ((this plat)) 0 (none) ) -(defmethod plat-path-sync plat ((this plat)) +(defmethod plat-path-sync ((this plat)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @@ -144,7 +142,7 @@ otherwise, [[plat::34]] ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! plat ((this plat) (entity entity-actor)) +(defmethod init-from-entity! ((this plat) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -204,25 +202,21 @@ This commonly includes things such as: ) (deftype drop-plat (base-plat) - ((art-name string :offset-assert 272) - (anim spool-anim :offset-assert 276) - (break-anim-name string :offset-assert 280) - (safe-time time-frame :offset-assert 288) - (hit-point vector :inline :offset-assert 304) + ((art-name string) + (anim spool-anim) + (break-anim-name string) + (safe-time time-frame) + (hit-point vector :inline) ) - :heap-base #xc0 - :method-count-assert 36 - :size-assert #x140 - :flag-assert #x2400c00140 - (:methods - (idle () _type_ :state 34) - (fall (symbol) _type_ :state 35) + (:state-methods + idle + (fall symbol) ) ) ;; WARN: Return type mismatch base-plat vs drop-plat. -(defmethod relocate drop-plat ((this drop-plat) (arg0 int)) +(defmethod relocate ((this drop-plat) (arg0 int)) (if (nonzero? (-> this break-anim-name)) (&+! (-> this break-anim-name) arg0) ) diff --git a/goal_src/jak2/engine/common_objs/projectile-h.gc b/goal_src/jak2/engine/common_objs/projectile-h.gc index 48ff732221e..98ce6be6fe7 100644 --- a/goal_src/jak2/engine/common_objs/projectile-h.gc +++ b/goal_src/jak2/engine/common_objs/projectile-h.gc @@ -28,80 +28,75 @@ ;; DECOMP BEGINS (deftype projectile (process-drawable) - ((root collide-shape-moving :override) - (starting-pos vector :inline :offset-assert 208) - (starting-dir vector :inline :offset-assert 224) - (target-pos vector :inline :offset-assert 240) - (base-target-pos vector :inline :offset-assert 256) - (pre-move-transv vector :inline :offset-assert 272) - (timeout time-frame :offset-assert 288) - (spawn-time time-frame :offset-assert 296) - (options projectile-options :offset-assert 304) - (last-target handle :offset-assert 312) - (notify-handle handle :offset-assert 320) - (owner-handle handle :offset-assert 328) - (ignore-handle handle :offset-assert 336) - (update-velocity (function projectile none) :offset-assert 344) - (move (function projectile none) :offset-assert 348) - (pick-target (function projectile none) :offset-assert 352) - (max-speed float :offset-assert 356) - (old-dist float 16 :offset-assert 360) - (old-dist-count int32 :offset-assert 424) - (hits int32 :offset-assert 428) - (max-hits int32 :offset-assert 432) - (tween float :offset-assert 436) - (attack-mode symbol :offset-assert 440) - (attack-id uint32 :offset-assert 444) - (damage float :offset-assert 448) - (charge-level float :offset-assert 452) - (sound-id sound-id :offset-assert 456) - (stop-speed meters :offset-assert 460) - (invinc-time time-frame :offset-assert 464) + ((root collide-shape-moving :override) + (starting-pos vector :inline) + (starting-dir vector :inline) + (target-pos vector :inline) + (base-target-pos vector :inline) + (pre-move-transv vector :inline) + (timeout time-frame) + (spawn-time time-frame) + (options projectile-options) + (last-target handle) + (notify-handle handle) + (owner-handle handle) + (ignore-handle handle) + (update-velocity (function projectile none)) + (move (function projectile none)) + (pick-target (function projectile none)) + (max-speed float) + (old-dist float 16) + (old-dist-count int32) + (hits int32) + (max-hits int32) + (tween float) + (attack-mode symbol) + (attack-id uint32) + (damage float) + (charge-level float) + (sound-id sound-id) + (stop-speed meters) + (invinc-time time-frame) ) - :heap-base #x160 - :method-count-assert 40 - :size-assert #x1d8 - :flag-assert #x28016001d8 + (:state-methods + die + dissipate + impact + moving + ) (:methods - (die () _type_ :state 20) - (dissipate () _type_ :state 21) - (impact () _type_ :state 22) - (moving () _type_ :state 23) - (draw-laser-sight (_type_) none 24) - (spawn-impact-particles (_type_) none 25) - (spawn-shell-particles (_type_) none 26) - (unknown-particles (_type_) none 27) - (play-impact-sound (_type_ projectile-options) none 28) - (stop-sound! (_type_) none 29) - (init-proj-collision! (_type_) none 30) - (init-proj-settings! (_type_) none 31) - (go-moving! (_type_) none 32) - (go-sitting! (_type_) none 33) - (kill-projectile! (_type_) symbol 34) - (event-handler! (_type_ process int symbol event-message-block) object 35) - (handle-proj-hit! (_type_ process event-message-block) object 36) - (deal-damage! (_type_ process event-message-block) symbol 37) - (made-impact? (_type_) symbol 38) - (play-impact-sound! (_type_) none :behavior projectile 39) + (draw-laser-sight (_type_) none) + (spawn-impact-particles (_type_) none) + (spawn-shell-particles (_type_) none) + (unknown-particles (_type_) none) + (play-impact-sound (_type_ projectile-options) none) + (stop-sound! (_type_) none) + (init-proj-collision! (_type_) none) + (init-proj-settings! (_type_) none) + (go-moving! (_type_) none) + (go-sitting! (_type_) none) + (kill-projectile! (_type_) symbol) + (event-handler! (_type_ process int symbol event-message-block) object) + (handle-proj-hit! (_type_ process event-message-block) object) + (deal-damage! (_type_ process event-message-block) symbol) + (made-impact? (_type_) symbol) + (play-impact-sound! (_type_) none :behavior projectile) ) ) (deftype projectile-init-by-other-params (structure) - ((ent entity :offset-assert 0) - (charge float :offset-assert 4) - (attack-id uint32 :offset-assert 8) - (options projectile-options :offset-assert 16) - (notify-handle handle :offset-assert 24) - (owner-handle handle :offset-assert 32) - (ignore-handle handle :offset-assert 40) - (pos vector :inline :offset-assert 48) - (vel vector :inline :offset-assert 64) - (timeout time-frame :offset-assert 80) + ((ent entity) + (charge float) + (attack-id uint32) + (options projectile-options) + (notify-handle handle) + (owner-handle handle) + (ignore-handle handle) + (pos vector :inline) + (vel vector :inline) + (timeout time-frame) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) @@ -119,15 +114,13 @@ (deftype projectile-bounce (projectile) "This seems to be the scrapped peacemaker gun implementation - the bouncing dark eco grenade launcher" - ((played-bounce-time time-frame :offset-assert 472) - (tumble-quat quaternion :inline :offset-assert 480) + ((played-bounce-time time-frame) + (tumble-quat quaternion :inline) ) - :heap-base #x170 - :method-count-assert 42 - :size-assert #x1f0 - :flag-assert #x2a017001f0 + (:state-methods + sitting + ) (:methods - (sitting () _type_ :state 40) - (noop (_type_) none 41) + (noop (_type_) none) ) ) diff --git a/goal_src/jak2/engine/common_objs/projectile.gc b/goal_src/jak2/engine/common_objs/projectile.gc index 0902a16cd55..52eb7990ef3 100644 --- a/goal_src/jak2/engine/common_objs/projectile.gc +++ b/goal_src/jak2/engine/common_objs/projectile.gc @@ -19,13 +19,13 @@ ) ) -(defmethod play-impact-sound! projectile ((this projectile)) +(defmethod play-impact-sound! ((this projectile)) "Plays impact sound" 0 (none) ) -(defmethod event-handler! projectile ((this projectile) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod event-handler! ((this projectile) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Multiplex the projectile's event processing, called by [[projectile-event-handler]]" (case arg2 (('track) @@ -49,7 +49,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod deal-damage! projectile ((this projectile) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! ((this projectile) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((v1-1 (new 'stack 'attack-info))) (let ((a0-2 v1-1)) @@ -86,7 +86,7 @@ ) ) -(defmethod handle-proj-hit! projectile ((this projectile) (arg0 process) (arg1 event-message-block)) +(defmethod handle-proj-hit! ((this projectile) (arg0 process) (arg1 event-message-block)) "When a projectile hits something, first deal damage via [[projectile::37]] and increment the projectiles hit count. @@ -108,7 +108,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) ) -(defmethod kill-projectile! projectile ((this projectile)) +(defmethod kill-projectile! ((this projectile)) "Transition to the [[projectile::impact]] state, always return [[#t]]" (if (not (and (-> this next-state) (= (-> this next-state name) 'impact))) (go (method-of-object this impact)) @@ -116,13 +116,13 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p #t ) -(defmethod draw-laser-sight projectile ((this projectile)) +(defmethod draw-laser-sight ((this projectile)) "TODO - confirm If applicable, draw the laser sight particles" 0 (none) ) -(defmethod spawn-impact-particles projectile ((this projectile)) +(defmethod spawn-impact-particles ((this projectile)) "Spawns associated particles with the projectile if applicable" (if (nonzero? (-> this part)) (spawn (-> this part) (-> this root trans)) @@ -131,24 +131,24 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (none) ) -(defmethod spawn-shell-particles projectile ((this projectile)) +(defmethod spawn-shell-particles ((this projectile)) "TODO - confirm" 0 (none) ) -(defmethod unknown-particles projectile ((this projectile)) +(defmethod unknown-particles ((this projectile)) "TODO - confirm" 0 (none) ) -(defmethod play-impact-sound projectile ((this projectile) (arg0 projectile-options)) +(defmethod play-impact-sound ((this projectile) (arg0 projectile-options)) 0 (none) ) -(defmethod stop-sound! projectile ((this projectile)) +(defmethod stop-sound! ((this projectile)) "Stops the current `sound-id` if set, re-init the `sound-id` after being stopped" (when (nonzero? (-> this sound-id)) (sound-stop (-> this sound-id)) @@ -159,7 +159,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (none) ) -(defmethod made-impact? projectile ((this projectile)) +(defmethod made-impact? ((this projectile)) "TODO - queries the collision cache, return true/false" (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) @@ -376,13 +376,13 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) ) -(defmethod init-proj-settings! projectile ((this projectile)) +(defmethod init-proj-settings! ((this projectile)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" 0 (none) ) -(defmethod init-proj-collision! projectile ((this projectile)) +(defmethod init-proj-collision! ((this projectile)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -416,21 +416,21 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (none) ) -(defmethod go-moving! projectile ((this projectile)) +(defmethod go-moving! ((this projectile)) (go (method-of-object this moving)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-sitting! projectile ((this projectile)) +(defmethod go-sitting! ((this projectile)) (if (not (and (-> this next-state) (= (-> this next-state name) 'impact))) (go (method-of-object this impact)) ) (none) ) -(defmethod deactivate projectile ((this projectile)) +(defmethod deactivate ((this projectile)) (stop-sound! this) ((method-of-type process-drawable deactivate) this) (none) @@ -538,7 +538,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p :post projectile-bounce-falling-post ) -(defmethod noop projectile-bounce ((this projectile-bounce)) +(defmethod noop ((this projectile-bounce)) "Does nothing" 0 (none) @@ -552,12 +552,12 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) ;; WARN: Return type mismatch object vs none. -(defmethod go-sitting! projectile-bounce ((this projectile-bounce)) +(defmethod go-sitting! ((this projectile-bounce)) (go (method-of-object this sitting)) (none) ) -(defmethod spawn-impact-particles projectile-bounce ((this projectile-bounce)) +(defmethod spawn-impact-particles ((this projectile-bounce)) "Spawns associated particles with the projectile if applicable" (ja-post) 0 @@ -583,7 +583,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound! projectile-bounce ((this projectile-bounce)) +(defmethod play-impact-sound! ((this projectile-bounce)) "Plays impact sound" (let* ((a2-0 (-> this root)) (v1-0 (-> a2-0 status)) @@ -601,7 +601,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (none) ) -(defmethod init-proj-collision! projectile-bounce ((this projectile-bounce)) +(defmethod init-proj-collision! ((this projectile-bounce)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -636,7 +636,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (none) ) -(defmethod init-proj-settings! projectile-bounce ((this projectile-bounce)) +(defmethod init-proj-settings! ((this projectile-bounce)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this max-speed) 450560.0) (set! (-> this timeout) (seconds 1.6)) diff --git a/goal_src/jak2/engine/common_objs/rigid-body-plat.gc b/goal_src/jak2/engine/common_objs/rigid-body-plat.gc index 843d2c9c909..d5db9caefee 100644 --- a/goal_src/jak2/engine/common_objs/rigid-body-plat.gc +++ b/goal_src/jak2/engine/common_objs/rigid-body-plat.gc @@ -8,79 +8,66 @@ ;; DECOMP BEGINS (deftype rigid-body-platform-constants (rigid-body-object-constants) - ((drag-factor float :offset-assert 208) - (buoyancy-factor float :offset-assert 212) - (max-buoyancy-depth meters :offset-assert 216) - (player-weight meters :offset-assert 220) - (player-bonk-factor float :offset-assert 224) - (player-dive-factor float :offset-assert 228) - (player-force-distance meters :offset-assert 232) - (player-force-clamp meters :offset-assert 236) - (player-force-timeout uint64 :offset-assert 240) - (explosion-force meters :offset-assert 248) - (control-point-count int32 :offset-assert 252) - (platform symbol :offset-assert 256) - (sound-name string :offset-assert 260) + ((drag-factor float) + (buoyancy-factor float) + (max-buoyancy-depth meters) + (player-weight meters) + (player-bonk-factor float) + (player-dive-factor float) + (player-force-distance meters) + (player-force-clamp meters) + (player-force-timeout uint64) + (explosion-force meters) + (control-point-count int32) + (platform symbol) + (sound-name string) ) - :method-count-assert 9 - :size-assert #x108 - :flag-assert #x900000108 ) (deftype rigid-body-control-point (structure) - ((local-pos vector :inline :offset-assert 0) - (world-pos vector :inline :offset-assert 16) - (velocity vector :inline :offset-assert 32) + ((local-pos vector :inline) + (world-pos vector :inline) + (velocity vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype rigid-body-control-point-inline-array (inline-array-class) - ((data rigid-body-control-point :inline :dynamic :offset-assert 16) + ((data rigid-body-control-point :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> rigid-body-control-point-inline-array heap-base) (the-as uint 48)) (deftype rigid-body-platform (rigid-body-object) - ((info rigid-body-platform-constants :override) - (control-point-array rigid-body-control-point-inline-array :offset-assert 272) - (player-velocity vector :inline :offset-assert 288) - (player-velocity-prev vector :inline :offset-assert 304) - (unknown-pad uint32 8 :offset-assert 320) - (float-height-offset float :offset-assert 352) - (player-bonk-timeout uint64 :offset-assert 360) - (water-anim water-anim :offset-assert 368) + ((info rigid-body-platform-constants :override) + (control-point-array rigid-body-control-point-inline-array) + (player-velocity vector :inline) + (player-velocity-prev vector :inline) + (unknown-pad uint32 8) + (float-height-offset float) + (player-bonk-timeout uint64) + (water-anim water-anim) ) - :heap-base #x100 - :method-count-assert 57 - :size-assert #x174 - :flag-assert #x3901000174 (:methods - (rigid-body-platform-method-53 (_type_ vector) float 53) - (rigid-body-platform-method-54 (_type_ rigid-body-control-point) none 54) - (rigid-body-platform-method-55 (_type_) none 55) - (rigid-body-platform-method-56 (_type_ vector) none 56) + (rigid-body-platform-method-53 (_type_ vector) float) + (rigid-body-platform-method-54 (_type_ rigid-body-control-point) none) + (rigid-body-platform-method-55 (_type_) none) + (rigid-body-platform-method-56 (_type_ vector) none) ) ) -(defmethod relocate rigid-body-platform ((this rigid-body-platform) (new-addr int)) +(defmethod relocate ((this rigid-body-platform) (new-addr int)) (if (nonzero? (-> this control-point-array)) (&+! (-> this control-point-array) new-addr) ) (call-parent-method this new-addr) ) -(defmethod rigid-body-platform-method-53 rigid-body-platform ((this rigid-body-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-53 ((this rigid-body-platform) (arg0 vector)) (local-vars (f0-1 object)) (let ((v1-0 (-> this water-anim))) 0.0 @@ -105,7 +92,7 @@ (the-as float f0-1) ) -(defmethod rigid-body-platform-method-54 rigid-body-platform ((this rigid-body-platform) (ctrl-point rigid-body-control-point)) +(defmethod rigid-body-platform-method-54 ((this rigid-body-platform) (ctrl-point rigid-body-control-point)) (set! (-> ctrl-point world-pos w) (+ (rigid-body-platform-method-53 this (-> ctrl-point world-pos)) (-> this float-height-offset)) ) @@ -142,7 +129,7 @@ (none) ) -(defmethod rigid-body-object-method-50 rigid-body-platform ((this rigid-body-platform) (arg0 float)) +(defmethod rigid-body-object-method-50 ((this rigid-body-platform) (arg0 float)) (when (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) (if (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)) (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force)) @@ -159,7 +146,7 @@ (none) ) -(defmethod rigid-body-platform-method-55 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-55 ((this rigid-body-platform)) (let ((a1-0 (new 'stack-no-clear 'vector))) (vector-float*! a1-0 *y-vector* (* -1.0 (-> this info extra gravity) (-> this rbody state info mass))) (rigid-body-method-20 (-> this rbody state) a1-0) @@ -168,7 +155,7 @@ (none) ) -(defmethod rigid-body-platform-method-56 rigid-body-platform ((this rigid-body-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-56 ((this rigid-body-platform) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> this rbody state position)) (set! (-> v1-0 y) 0.0) @@ -185,7 +172,7 @@ (none) ) -(defmethod rigid-body-object-method-29 rigid-body-platform ((this rigid-body-platform) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this rigid-body-platform) (arg0 float)) (let ((s4-0 (-> this rbody state matrix))) (dotimes (s3-0 (-> this info control-point-count)) (let ((s2-0 (-> this control-point-array data s3-0))) @@ -206,7 +193,7 @@ (none) ) -(defmethod rigid-body-object-method-30 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-object-method-30 ((this rigid-body-platform)) (if (-> this info platform) (detect-riders! (-> this root)) ) @@ -223,17 +210,17 @@ (none) ) -(defmethod rigid-body-object-method-47 rigid-body-platform ((this rigid-body-platform) - (arg0 process-drawable) - (arg1 attack-info) - (arg2 touching-shapes-entry) - (arg3 penetrate) - ) +(defmethod rigid-body-object-method-47 ((this rigid-body-platform) + (arg0 process-drawable) + (arg1 attack-info) + (arg2 touching-shapes-entry) + (arg3 penetrate) + ) ((method-of-type rigid-body-object rigid-body-object-method-47) this arg0 arg1 arg2 arg3) #f ) -(defmethod rigid-body-object-method-46 rigid-body-platform ((this rigid-body-platform) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 ((this rigid-body-platform) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('edge-grabbed) (let ((v1-1 (the-as object (-> arg3 param 0)))) @@ -316,7 +303,7 @@ ) ) -(defmethod rigid-body-object-method-37 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-object-method-37 ((this rigid-body-platform)) (if (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)) (sound-play-by-name (string->sound-name (-> this info sound-name)) @@ -339,7 +326,7 @@ (none) ) -(defmethod alloc-and-init-rigid-body-control rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-object-constants)) +(defmethod alloc-and-init-rigid-body-control ((this rigid-body-platform) (arg0 rigid-body-object-constants)) (set! (-> this info) (the-as rigid-body-platform-constants arg0)) (set! (-> this rbody) (new 'process 'rigid-body-control this)) (set! (-> this control-point-array) @@ -365,7 +352,7 @@ (none) ) -(defmethod allocate-and-init-cshape rigid-body-platform ((this rigid-body-platform)) +(defmethod allocate-and-init-cshape ((this rigid-body-platform)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -427,7 +414,7 @@ ) ) -(defmethod init-skel-and-rigid-body rigid-body-platform ((this rigid-body-platform)) +(defmethod init-skel-and-rigid-body ((this rigid-body-platform)) (set! (-> this float-height-offset) 0.0) (alloc-and-init-rigid-body-control this *rigid-body-platform-constants*) (let ((s5-0 (-> this info control-point-count))) @@ -446,7 +433,7 @@ (none) ) -(defmethod init-from-entity! rigid-body-platform ((this rigid-body-platform) (arg0 entity-actor)) +(defmethod init-from-entity! ((this rigid-body-platform) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/engine/common_objs/voicebox.gc b/goal_src/jak2/engine/common_objs/voicebox.gc index bc43d12011e..75ac8260f5a 100644 --- a/goal_src/jak2/engine/common_objs/voicebox.gc +++ b/goal_src/jak2/engine/common_objs/voicebox.gc @@ -50,34 +50,28 @@ (deftype camera-remote (camera-slave) () - :heap-base #xa20 - :method-count-assert 14 - :size-assert #xa94 - :flag-assert #xe0a200a94 ) (deftype remote (process-drawable) - ((parent (pointer camera-slave) :override) - (base-trans vector :inline :offset-assert 208) - (focus focus :inline :offset-assert 224) - (seeker cam-float-seeker :inline :offset-assert 236) - (start-time time-frame :offset-assert 264) - (blend float :offset-assert 272) - (twist float :offset-assert 276) - (speak-effect? basic :offset-assert 280) + ((parent (pointer camera-slave) :override) + (base-trans vector :inline) + (focus focus :inline) + (seeker cam-float-seeker :inline) + (start-time time-frame) + (blend float) + (twist float) + (speak-effect? basic) ) - :heap-base #xa0 - :method-count-assert 26 - :size-assert #x11c - :flag-assert #x1a00a0011c + (:state-methods + enter + idle + exit + ) (:methods - (enter () _type_ :state 20) - (idle () _type_ :state 21) - (exit () _type_ :state 22) - (init (_type_) none 23) - (get-track-pt-and-scale (_type_ vector) float 24) - (post-common (_type_) none 25) + (init (_type_) none) + (get-track-pt-and-scale (_type_ vector) float) + (post-common (_type_) none) ) ) @@ -89,7 +83,7 @@ :sort 1 ) -(defmethod get-track-pt-and-scale remote ((this remote) (arg0 vector)) +(defmethod get-track-pt-and-scale ((this remote) (arg0 vector)) (let ((s4-0 (handle->process (-> this focus handle)))) (when s4-0 (set! (-> arg0 quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) @@ -101,7 +95,7 @@ (lerp-scale 1.0 0.0 (-> this blend) 0.8 1.0) ) -(defmethod post-common remote ((this remote)) +(defmethod post-common ((this remote)) (with-pp (rlet ((acc :class vf) (vf0 :class vf) @@ -310,7 +304,7 @@ ) ;; WARN: Return type mismatch remote vs none. -(defmethod init remote ((this remote)) +(defmethod init ((this remote)) (reset-to-collide-spec (-> this focus) (collide-spec jak player-list)) (initialize-skeleton this @@ -339,12 +333,8 @@ ) (deftype voicebox (remote) - ((hint handle :offset-assert 288) + ((hint handle) ) - :heap-base #xb0 - :method-count-assert 26 - :size-assert #x128 - :flag-assert #x1a00b00128 ) @@ -396,28 +386,26 @@ ) (deftype judge (remote) - ((total-time time-frame :offset-assert 288) - (beep-time time-frame :offset-assert 296) - (hud-timer handle :offset-assert 304) - (score uint8 :offset-assert 312) + ((total-time time-frame) + (beep-time time-frame) + (hud-timer handle) + (score uint8) ) - :heap-base #xc0 - :method-count-assert 28 - :size-assert #x139 - :flag-assert #x1c00c00139 + (:state-methods + wait + ) (:methods - (wait () _type_ :state 26) - (setup-collision (_type_) none 27) + (setup-collision (_type_) none) ) ) -(defmethod get-track-pt-and-scale judge ((this judge) (arg0 vector)) +(defmethod get-track-pt-and-scale ((this judge) (arg0 vector)) (set! (-> arg0 quad) (-> this base-trans quad)) 1.0 ) -(defmethod post-common judge ((this judge)) +(defmethod post-common ((this judge)) (ja-post) (if (type? (-> this root) collide-shape) (update-transforms (the-as collide-shape (-> this root))) @@ -516,7 +504,7 @@ ) ) -(defmethod setup-collision judge ((this judge)) +(defmethod setup-collision ((this judge)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec collectable)) @@ -537,7 +525,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! judge ((this judge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this judge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/engine/common_objs/water-anim.gc b/goal_src/jak2/engine/common_objs/water-anim.gc index 91e5ad29863..23db141d42d 100644 --- a/goal_src/jak2/engine/common_objs/water-anim.gc +++ b/goal_src/jak2/engine/common_objs/water-anim.gc @@ -10,38 +10,36 @@ ;; DECOMP BEGINS (deftype water-anim (process-drawable) - ((water-height meters :offset-assert 200) - (wade-height meters :offset-assert 204) - (swim-height meters :offset-assert 208) - (bottom-height meters :offset-assert 212) - (attack-event symbol :offset-assert 216) - (attack-id uint32 :offset-assert 220) - (flow flow-control :offset-assert 224) - (target handle :offset-assert 232) - (flags water-flags :offset-assert 240) - (look int32 :offset-assert 244) - (play-ambient-sound? symbol :offset-assert 248) - (visible symbol :offset-assert 252) + ((water-height meters) + (wade-height meters) + (swim-height meters) + (bottom-height meters) + (attack-event symbol) + (attack-id uint32) + (flow flow-control) + (target handle) + (flags water-flags) + (look int32) + (play-ambient-sound? symbol) + (visible symbol) ) - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 + (:state-methods + water-anim-state-20 + idle + ) (:methods - (water-anim-method-20 () none 20) - (idle () _type_ :state 21) - (move-to-point! (_type_ vector) int 22) - (get-ripple-height (_type_ vector) float 23) - (init-water! (_type_) none 24) - (reset-root! (_type_) trsqv 25) - (water-anim-init! (_type_) none 26) - (water-anim-method-27 (_type_) none 27) - (offset! (_type_) none 28) + (move-to-point! (_type_ vector) int) + (get-ripple-height (_type_ vector) float) + (init-water! (_type_) none) + (reset-root! (_type_) trsqv) + (water-anim-init! (_type_) none) + (water-anim-method-27 (_type_) none) + (offset! (_type_) none) ) ) -(defmethod relocate water-anim ((this water-anim) (arg0 int)) +(defmethod relocate ((this water-anim) (arg0 int)) (if (nonzero? (-> this flow)) (&+! (-> this flow) arg0) ) @@ -225,13 +223,10 @@ ) (deftype water-anim-look (structure) - ((skel-group string :offset-assert 0) - (anim int32 :offset-assert 4) - (ambient-sound-spec sound-spec :offset-assert 8) + ((skel-group string) + (anim int32) + (ambient-sound-spec sound-spec) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -436,7 +431,7 @@ ) ) -(defmethod move-to-point! water-anim ((this water-anim) (arg0 vector)) +(defmethod move-to-point! ((this water-anim) (arg0 vector)) "Set a [[water-anim]]'s `trans` as specified by the [[vector]] and update `water-height`." (set! (-> this root trans quad) (-> arg0 quad)) (set! (-> this water-height) (-> this root trans y)) @@ -445,18 +440,18 @@ ) ) -(defmethod get-ripple-height water-anim ((this water-anim) (arg0 vector)) +(defmethod get-ripple-height ((this water-anim) (arg0 vector)) (ripple-find-height this 0 arg0) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod water-anim-method-27 water-anim ((this water-anim)) +(defmethod water-anim-method-27 ((this water-anim)) "Empty." (none) ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod offset! water-anim ((this water-anim)) +(defmethod offset! ((this water-anim)) "Offset a [[water-anim]]'s `trans` and `quat` by the lump data in `entity`." (local-vars (sv-16 res-tag)) (set! (-> this play-ambient-sound?) #t) @@ -480,7 +475,7 @@ (none) ) -(defmethod init-water! water-anim ((this water-anim)) +(defmethod init-water! ((this water-anim)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((s5-0 (-> this look))) (if (or (< s5-0 0) (>= s5-0 (-> *water-anim-look* length))) @@ -511,7 +506,7 @@ (none) ) -(defmethod reset-root! water-anim ((this water-anim)) +(defmethod reset-root! ((this water-anim)) "Reset a [[water-anim]]'s `root`." (let ((v0-0 (new 'process 'trsqv))) (set! (-> this root) v0-0) @@ -520,7 +515,7 @@ ) ;; WARN: Return type mismatch water-flags vs none. -(defmethod water-anim-init! water-anim ((this water-anim)) +(defmethod water-anim-init! ((this water-anim)) "Initialize a [[water-anim]]." (local-vars (sv-16 res-tag)) (set! (-> this attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) @@ -603,7 +598,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! water-anim ((this water-anim) (arg0 entity-actor)) +(defmethod init-from-entity! ((this water-anim) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/engine/common_objs/water-flow.gc b/goal_src/jak2/engine/common_objs/water-flow.gc index f5ba23f9e54..8936b610234 100644 --- a/goal_src/jak2/engine/common_objs/water-flow.gc +++ b/goal_src/jak2/engine/common_objs/water-flow.gc @@ -18,50 +18,41 @@ ) (deftype flow-section (structure) - ((start vector :inline :offset-assert 0) - (trailing plane :inline :offset-assert 16) - (pull-dir vector :inline :offset-assert 32) - (radial-dir vector :inline :offset-assert 48) + ((start vector :inline) + (trailing plane :inline) + (pull-dir vector :inline) + (radial-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype flow-section-array (inline-array-class) - ((data flow-section :inline :dynamic :offset-assert 16) + ((data flow-section :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> flow-section-array heap-base) (the-as uint 64)) (deftype flow-control (basic) - ((path path-control :offset-assert 4) - (speed float :offset-assert 8) - (belt-radius float :offset-assert 12) - (sections flow-section-array :offset-assert 16) - (leading plane :inline :offset-assert 32) - (collide-bounds sphere :inline :offset-assert 48) + ((path path-control) + (speed float) + (belt-radius float) + (sections flow-section-array) + (leading plane :inline) + (collide-bounds sphere :inline) ) - :method-count-assert 13 - :size-assert #x40 - :flag-assert #xd00000040 (:methods - (new (symbol type process-drawable res-lump) _type_ 0) - (draw-path (_type_) none 9) - (setup (_type_) none 10) - (push-process (_type_ process-focusable) none 11) - (find-and-push-things (_type_) none 12) + (new (symbol type process-drawable res-lump) _type_) + (draw-path (_type_) none) + (setup (_type_) none) + (push-process (_type_ process-focusable) none) + (find-and-push-things (_type_) none) ) ) -(defmethod relocate flow-control ((this flow-control) (arg0 int)) +(defmethod relocate ((this flow-control) (arg0 int)) (if (nonzero? (-> this sections)) (&+! (-> this sections) arg0) ) @@ -71,7 +62,7 @@ (call-parent-method this arg0) ) -(defmethod draw-path flow-control ((this flow-control)) +(defmethod draw-path ((this flow-control)) (let ((a0-1 (-> this path))) (if (nonzero? a0-1) (debug-draw a0-1) @@ -82,7 +73,7 @@ ) ;; WARN: Function (method 11 flow-control) has a return type of none, but the expression builder found a return statement. -(defmethod push-process flow-control ((this flow-control) (arg0 process-focusable)) +(defmethod push-process ((this flow-control) (arg0 process-focusable)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -171,7 +162,7 @@ ) ) -(defmethod find-and-push-things flow-control ((this flow-control)) +(defmethod find-and-push-things ((this flow-control)) (local-vars (a0-10 float) (a2-5 float) (a2-12 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -317,7 +308,7 @@ ) ) -(defmethod setup flow-control ((this flow-control)) +(defmethod setup ((this flow-control)) (local-vars (sv-32 flow-section) (sv-48 flow-section)) (let* ((s5-0 (-> this path)) (s4-0 (-> s5-0 curve num-cverts)) diff --git a/goal_src/jak2/engine/common_objs/water-h.gc b/goal_src/jak2/engine/common_objs/water-h.gc index b84f217d410..f38c97a462b 100644 --- a/goal_src/jak2/engine/common_objs/water-h.gc +++ b/goal_src/jak2/engine/common_objs/water-h.gc @@ -47,80 +47,74 @@ ;; DECOMP BEGINS (deftype water-info (structure) - ((trans vector :inline :offset-assert 0) - (normal vector :inline :offset-assert 16) - (base-height meters :offset-assert 32) - (depth meters :offset-assert 36) - (handle handle :offset-assert 40) - (flags water-flags :offset-assert 48) - (prim drawable-region-prim :offset-assert 52) - (extra-flags uint32 :offset-assert 56) + ((trans vector :inline) + (normal vector :inline) + (base-height meters) + (depth meters) + (handle handle) + (flags water-flags) + (prim drawable-region-prim) + (extra-flags uint32) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) (deftype water-control (basic) - ((flags water-flags :offset-assert 4) - (process target :offset-assert 8) - (joint-index int32 :offset-assert 12) - (top-y-offset float :offset-assert 16) - (attack-id uint32 :offset-assert 20) - (enter-water-time time-frame :offset-assert 24) - (wade-time time-frame :offset-assert 32) - (on-water-time time-frame :offset-assert 40) - (enter-swim-time time-frame :offset-assert 48) - (swim-time time-frame :offset-assert 56) - (base-height meters :offset-assert 64) - (wade-height meters :offset-assert 68) - (swim-height meters :offset-assert 72) - (surface-height meters :offset-assert 76) - (bottom-height meters :offset-assert 80) - (collide-height meters :offset-assert 84) - (height meters :offset-assert 88) - (height-offset float 4 :offset-assert 92) - (base-ocean-offset meters :offset 92) - (real-ocean-offset meters :offset 92) - (ocean-offset meters :offset 96) - (bob-offset meters :offset 100) - (align-offset meters :offset 104) - (swim-depth meters :offset 108) - (bob smush-control :inline :offset 112) - (ripple handle :offset 144) - (ripple-size meters :offset 152) - (wake-size meters :offset 156) - (bottom vector 2 :inline :offset 160) - (top vector 2 :inline :offset 192) - (enter-water-pos vector :inline :offset 224) - (drip-old-pos vector :inline :offset 240) - (drip-joint-index int32 :offset 256) - (drip-wetness float :offset 260) - (drip-time time-frame :offset 264) - (drip-speed float :offset 272) - (drip-height meters :offset 276) - (drip-mult float :offset 280) - (distort-time time-frame :offset 288) + ((flags water-flags) + (process target) + (joint-index int32) + (top-y-offset float) + (attack-id uint32) + (enter-water-time time-frame) + (wade-time time-frame) + (on-water-time time-frame) + (enter-swim-time time-frame) + (swim-time time-frame) + (base-height meters) + (wade-height meters) + (swim-height meters) + (surface-height meters) + (bottom-height meters) + (collide-height meters) + (height meters) + (height-offset float 4) + (base-ocean-offset meters :overlay-at (-> height-offset 0)) + (real-ocean-offset meters :overlay-at (-> height-offset 0)) + (ocean-offset meters :overlay-at (-> height-offset 1)) + (bob-offset meters :overlay-at (-> height-offset 2)) + (align-offset meters :overlay-at (-> height-offset 3)) + (swim-depth meters :offset 108) + (bob smush-control :inline :offset 112) + (ripple handle :offset 144) + (ripple-size meters :offset 152) + (wake-size meters :offset 156) + (bottom vector 2 :inline :offset 160) + (top vector 2 :inline :offset 192) + (enter-water-pos vector :inline :offset 224) + (drip-old-pos vector :inline :offset 240) + (drip-joint-index int32 :offset 256) + (drip-wetness float :offset 260) + (drip-time time-frame :offset 264) + (drip-speed float :offset 272) + (drip-height meters :offset 276) + (drip-mult float :offset 280) + (distort-time time-frame :offset 288) ) - :method-count-assert 17 - :size-assert #x128 - :flag-assert #x1100000128 (:methods - (new (symbol type process int float float float) _type_ 0) - (water-control-method-9 (_type_) none 9) - (water-control-method-10 (_type_) none 10) - (start-bobbing! (_type_ float int int) none 11) - (distance-from-surface (_type_) float 12) - (spawn-ripples (_type_ float vector int vector symbol) none 13) - (display-water-marks? (_type_) symbol 14) - (enter-water (_type_) none 15) - (water-control-method-16 (_type_) none 16) + (new (symbol type process int float float float) _type_) + (water-control-method-9 (_type_) none) + (water-control-method-10 (_type_) none) + (start-bobbing! (_type_ float int int) none) + (distance-from-surface (_type_) float) + (spawn-ripples (_type_ float vector int vector symbol) none) + (display-water-marks? (_type_) symbol) + (enter-water (_type_) none) + (water-control-method-16 (_type_) none) ) ) -(defmethod display-water-marks? water-control ((this water-control)) +(defmethod display-water-marks? ((this water-control)) *display-water-marks* ) @@ -146,13 +140,10 @@ ) ) -(defmethod distance-from-surface water-control ((this water-control)) +(defmethod distance-from-surface ((this water-control)) (- (-> this top 0 y) (-> this height)) ) (deftype water-vol (process-hidden) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 ) diff --git a/goal_src/jak2/engine/common_objs/water.gc b/goal_src/jak2/engine/common_objs/water.gc index 99cf8e20cbb..a26c942aad4 100644 --- a/goal_src/jak2/engine/common_objs/water.gc +++ b/goal_src/jak2/engine/common_objs/water.gc @@ -648,12 +648,12 @@ ) ) -(defmethod water-control-method-9 water-control ((this water-control)) +(defmethod water-control-method-9 ((this water-control)) 0 (none) ) -(defmethod water-control-method-10 water-control ((this water-control)) +(defmethod water-control-method-10 ((this water-control)) (local-vars (sv-272 (function vector entity-actor skeleton-group vector object none :behavior manipy)) (sv-288 vector) @@ -1121,7 +1121,7 @@ ) ) -(defmethod start-bobbing! water-control ((this water-control) (arg0 float) (arg1 int) (arg2 int)) +(defmethod start-bobbing! ((this water-control) (arg0 float) (arg1 int) (arg2 int)) (with-pp (activate! (-> this bob) (- arg0) arg1 arg2 0.9 1.0 (-> pp clock)) 0 @@ -1210,7 +1210,7 @@ (none) ) -(defmethod enter-water water-control ((this water-control)) +(defmethod enter-water ((this water-control)) (with-pp (logior! (-> this flags) (water-flags touch-water)) (logclear! (-> this flags) (water-flags jump-out)) @@ -1242,7 +1242,7 @@ ) ) -(defmethod water-control-method-16 water-control ((this water-control)) +(defmethod water-control-method-16 ((this water-control)) (logclear! (-> this flags) (water-flags touch-water)) (set-zero! (-> this bob)) (if (logtest? (-> this flags) (water-flags tar lava)) @@ -1319,7 +1319,7 @@ (none) ) -(defmethod spawn-ripples water-control ((this water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector) (arg4 symbol)) +(defmethod spawn-ripples ((this water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector) (arg4 symbol)) (when (and (logtest? (water-flags part-splash) (-> this flags)) (logtest? (water-flags part-water) (-> this flags))) (let ((s4-1 (vector+float*! (new 'stack-no-clear 'vector) arg1 arg3 0.05))) (set! (-> s4-1 y) (+ 40.96 (-> this surface-height))) @@ -1491,7 +1491,7 @@ arg0 ) -(defmethod water-info-init! collide-shape ((this collide-shape) (arg0 water-info) (arg1 collide-action)) +(defmethod water-info-init! ((this collide-shape) (arg0 water-info) (arg1 collide-action)) "Initialize a [[water-info]] with the currently loaded regions." (local-vars (sv-80 int)) (let ((s3-0 (new 'stack 'water-info))) diff --git a/goal_src/jak2/engine/data/art-h.gc b/goal_src/jak2/engine/data/art-h.gc index 7677300a90b..ac7490bfc43 100644 --- a/goal_src/jak2/engine/data/art-h.gc +++ b/goal_src/jak2/engine/data/art-h.gc @@ -53,51 +53,36 @@ ;; DECOMP BEGINS (deftype joint-anim (basic) - ((name string :offset-assert 4) - (number int16 :offset-assert 8) - (length int16 :offset-assert 10) + ((name string) + (number int16) + (length int16) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype joint-anim-matrix (joint-anim) - ((data matrix :inline :dynamic :offset 16) + ((data matrix :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype joint-anim-transformq (joint-anim) - ((data transformq :inline :dynamic :offset 16) + ((data transformq :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype joint-anim-drawable (joint-anim) - ((data drawable :dynamic :offset-assert 12) + ((data drawable :dynamic) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype joint-anim-frame (structure) - ((matrices matrix 2 :inline :offset-assert 0) - (data transformq :inline :dynamic :offset-assert 128) + ((matrices matrix 2 :inline) + (data transformq :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) @@ -113,163 +98,124 @@ ) (deftype joint-anim-compressed-hdr (structure) - ((control-bits uint32 14 :offset-assert 0) - (num-joints uint32 :offset-assert 56) - (matrix-bits uint32 :offset-assert 60) + ((control-bits uint32 14) + (num-joints uint32) + (matrix-bits uint32) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype joint-anim-compressed-fixed (structure) - ((hdr joint-anim-compressed-hdr :inline :offset-assert 0) - (offset-64 uint32 :offset-assert 64) - (offset-32 uint32 :offset-assert 68) - (offset-16 uint32 :offset-assert 72) - (reserved uint32 :offset-assert 76) - (data vector 133 :inline :offset-assert 80) + ((hdr joint-anim-compressed-hdr :inline) + (offset-64 uint32) + (offset-32 uint32) + (offset-16 uint32) + (reserved uint32) + (data vector 133 :inline) ) - :method-count-assert 9 - :size-assert #x8a0 - :flag-assert #x9000008a0 ) (deftype joint-anim-compressed-frame (structure) - ((offset-64 uint32 :offset-assert 0) - (offset-32 uint32 :offset-assert 4) - (offset-16 uint32 :offset-assert 8) - (reserved uint32 :offset-assert 12) - (data vector 133 :inline :offset-assert 16) + ((offset-64 uint32) + (offset-32 uint32) + (offset-16 uint32) + (reserved uint32) + (data vector 133 :inline) ) - :method-count-assert 9 - :size-assert #x860 - :flag-assert #x900000860 ) (deftype joint-anim-compressed-control (structure) - ((num-frames uint16 :offset-assert 0) - (flags uint16 :offset-assert 2) - (fixed-qwc uint32 :offset-assert 4) - (frame-qwc uint32 :offset-assert 8) - (fixed joint-anim-compressed-fixed :offset-assert 12) - (data joint-anim-compressed-frame :dynamic :offset-assert 16) + ((num-frames uint16) + (flags uint16) + (fixed-qwc uint32) + (frame-qwc uint32) + (fixed joint-anim-compressed-fixed) + (data joint-anim-compressed-frame :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype art (basic) - ((name string :offset 8) - (length int32 :offset-assert 12) - (extra res-lump :offset-assert 16) + ((name string :offset 8) + (length int32) + (extra res-lump) ) - :method-count-assert 13 - :size-assert #x14 - :flag-assert #xd00000014 (:methods - (login (_type_) _type_ 9) - (get-art-by-name-method (_type_ string type) basic 10) - (get-art-idx-by-name-method (_type_ string type) int 11) - (needs-link? (_type_) symbol 12) + (login (_type_) _type_) + (get-art-by-name-method (_type_ string type) basic) + (get-art-idx-by-name-method (_type_ string type) int) + (needs-link? (_type_) symbol) ) ) (deftype art-element (art) - ((pad uint8 12 :offset-assert 20) + ((pad uint8 12) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) (deftype art-mesh-anim (art-element) - ((data basic :dynamic :offset-assert 32) + ((data basic :dynamic) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) (deftype art-joint-anim (art-element) - ((speed float :offset 20) - (artist-base float :offset 24) - (artist-step float :offset 28) - (eye-anim merc-eye-anim-block :offset 4) - (master-art-group-name string :offset-assert 32) - (master-art-group-index int32 :offset-assert 36) - (blend-shape-anim (pointer int8) :offset-assert 40) - (frames joint-anim-compressed-control :offset-assert 44) + ((speed float :overlay-at (-> pad 0)) + (artist-base float :overlay-at (-> pad 4)) + (artist-step float :overlay-at (-> pad 8)) + (eye-anim merc-eye-anim-block :offset 4) + (master-art-group-name string) + (master-art-group-index int32) + (blend-shape-anim (pointer int8)) + (frames joint-anim-compressed-control) ) - :method-count-assert 13 - :size-assert #x30 - :flag-assert #xd00000030 ) (deftype art-group (art) - ((info file-info :offset 4) - (data art-element :dynamic :offset 32) + ((info file-info :offset 4) + (data art-element :dynamic :offset 32) ) - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (link-art! (_type_) art-group 13) - (unlink-art! (_type_) int 14) + (relocate (_type_ kheap (pointer uint8)) none :replace) + (link-art! (_type_) art-group) + (unlink-art! (_type_) int) ) ) (deftype art-mesh-geo (art-element) - ((data basic :dynamic :offset-assert 32) + ((data basic :dynamic) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) (deftype art-joint-geo (art-element) - ((data joint :dynamic :offset-assert 32) + ((data joint :dynamic) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) (deftype art-joint-anim-manager-slot (structure) - ((anim art-joint-anim :offset-assert 0) - (comp-data uint32 :offset-assert 4) - (time-stamp uint64 :offset-assert 8) + ((anim art-joint-anim) + (comp-data uint32) + (time-stamp uint64) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype art-joint-anim-manager (basic) - ((kheap kheap :inline :offset-assert 16) - (free-index int32 :offset-assert 32) - (slot art-joint-anim-manager-slot 64 :inline :offset-assert 48) + ((kheap kheap :inline) + (free-index int32) + (slot art-joint-anim-manager-slot 64 :inline) ) - :method-count-assert 14 - :size-assert #x430 - :flag-assert #xe00000430 (:methods - (new (symbol type int) _type_ 0) - (decompress (_type_ art-joint-anim) art-joint-anim 9) - (update-time-stamp (_type_ art-joint-anim) art-joint-anim 10) - (unload-from-slot (_type_ int) art-joint-anim 11) - (used-bytes-for-slot (_type_ int) int 12) - (unload-from-level (_type_ level) none 13) + (new (symbol type int) _type_) + (decompress (_type_ art-joint-anim) art-joint-anim) + (update-time-stamp (_type_ art-joint-anim) art-joint-anim) + (unload-from-slot (_type_ int) art-joint-anim) + (used-bytes-for-slot (_type_ int) int) + (unload-from-level (_type_ level) none) ) ) @@ -291,115 +237,103 @@ ) (deftype skeleton-group (art-group) - ((art-group-name string :offset-assert 32) - (jgeo int32 :offset-assert 36) - (janim int32 :offset-assert 40) - (bounds vector :inline :offset-assert 48) - (radius meters :offset 60) - (mgeo int16 6 :offset-assert 64) - (max-lod int32 :offset-assert 76) - (lod-dist float 6 :offset-assert 80) - (longest-edge meters :offset-assert 104) - (texture-level int8 :offset-assert 108) - (version int8 :offset-assert 109) - (shadow int8 :offset-assert 110) - (sort int8 :offset-assert 111) - (origin-joint-index int8 :offset-assert 112) - (shadow-joint-index int8 :offset-assert 113) - (light-index uint8 :offset-assert 114) - (pad uint8 :offset-assert 115) + ((art-group-name string) + (jgeo int32) + (janim int32) + (bounds vector :inline) + (radius meters :overlay-at (-> bounds data 3)) + (mgeo int16 6) + (max-lod int32) + (lod-dist float 6) + (longest-edge meters) + (texture-level int8) + (version int8) + (shadow int8) + (sort int8) + (origin-joint-index int8) + (shadow-joint-index int8) + (light-index uint8) + (pad uint8) ) - :method-count-assert 16 - :size-assert #x74 - :flag-assert #x1000000074 (:methods - (add-to-loading-level (_type_) skeleton-group 15) + (add-to-loading-level (_type_) skeleton-group) ) ) (deftype lod-group (structure) - ((geo merc-ctrl :offset-assert 0) - (dist meters :offset-assert 4) + ((geo merc-ctrl) + (dist meters) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype lod-set (structure) - ((lod lod-group 6 :inline :offset-assert 0) - (max-lod int8 :offset-assert 48) + ((lod lod-group 6 :inline) + (max-lod int8) ) - :method-count-assert 10 - :size-assert #x31 - :flag-assert #xa00000031 (:methods - (setup-lods! (_type_ skeleton-group art-group entity) _type_ 9) + (setup-lods! (_type_ skeleton-group art-group entity) _type_) ) ) (deftype draw-control (basic) - ((process process-drawable :offset-assert 4) - (status draw-control-status :offset-assert 8) - (data-format draw-control-data-format :offset-assert 10) - (global-effect draw-control-global-effect :offset-assert 11) - (art-group art-group :offset-assert 12) - (jgeo art-joint-geo :offset-assert 16) - (mgeo merc-ctrl :offset-assert 20) - (dma-add-func (function process-drawable draw-control symbol object none) :offset-assert 24) - (skeleton skeleton :offset-assert 28) - (lod-set lod-set :inline :offset-assert 32) - (max-lod int8 :offset 80) - (force-lod int8 :offset-assert 81) - (cur-lod int8 :offset-assert 82) - (desired-lod int8 :offset-assert 83) - (ripple ripple-control :offset-assert 84) - (longest-edge meters :offset-assert 88) - (longest-edge? uint32 :offset 88) - (light-index uint8 :offset-assert 92) - (shadow-mask uint8 :offset-assert 93) - (level-index uint8 :offset-assert 94) - (death-draw-overlap uint8 :offset-assert 95) - (death-timer uint8 :offset-assert 96) - (death-timer-org uint8 :offset-assert 97) - (death-vertex-skip uint16 :offset-assert 98) - (death-effect uint32 :offset-assert 100) - (shadow shadow-geo :offset-assert 104) - (shadow-ctrl shadow-control :offset-assert 108) - (distance meters :offset-assert 112) - (origin vector :inline :offset-assert 128) - (bounds vector :inline :offset-assert 144) - (radius meters :offset 156) - (color-mult rgbaf :inline :offset-assert 160) - (color-emissive rgbaf :inline :offset-assert 176) - (effect-mask uint64 :offset-assert 192) - (seg-mask uint64 :offset-assert 200) - (origin-joint-index uint8 :offset-assert 208) - (shadow-joint-index uint8 :offset-assert 209) - (force-fade uint8 :offset-assert 210) - (default-texture-page uint8 :offset-assert 211) - (shadow-values uint32 :offset-assert 212) + ((process process-drawable) + (status draw-control-status) + (data-format draw-control-data-format) + (global-effect draw-control-global-effect) + (art-group art-group) + (jgeo art-joint-geo) + (mgeo merc-ctrl) + (dma-add-func (function process-drawable draw-control symbol object none)) + (skeleton skeleton) + (lod-set lod-set :inline) + (max-lod int8 :overlay-at (-> lod-set max-lod)) + (force-lod int8) + (cur-lod int8) + (desired-lod int8) + (ripple ripple-control) + (longest-edge meters) + (longest-edge? uint32 :overlay-at longest-edge) + (light-index uint8) + (shadow-mask uint8) + (level-index uint8) + (death-draw-overlap uint8) + (death-timer uint8) + (death-timer-org uint8) + (death-vertex-skip uint16) + (death-effect uint32) + (shadow shadow-geo) + (shadow-ctrl shadow-control) + (distance meters) + (origin vector :inline) + (bounds vector :inline) + (radius meters :overlay-at (-> bounds data 3)) + (color-mult rgbaf :inline) + (color-emissive rgbaf :inline) + (effect-mask uint64) + (seg-mask uint64) + (origin-joint-index uint8) + (shadow-joint-index uint8) + (force-fade uint8) + (default-texture-page uint8) + (shadow-values uint32) ) - :method-count-assert 15 - :size-assert #xd8 - :flag-assert #xf000000d8 (:methods - (new (symbol type process symbol) _type_ 0) - (get-skeleton-origin (_type_) vector 9) - (lod-set! (_type_ int) none 10) - (lods-assign! (_type_ lod-set) none 11) - (setup-masks (_type_ int int) none 12) - (setup-cspace-and-add (_type_ art-joint-geo symbol) cspace-array 13) - (do-joint-math (_type_ cspace-array joint-control) none 14) + (new (symbol type process symbol) _type_) + (get-skeleton-origin (_type_) vector) + (lod-set! (_type_ int) none) + (lods-assign! (_type_ lod-set) none) + (setup-masks (_type_ int int) none) + (setup-cspace-and-add (_type_ art-joint-geo symbol) cspace-array) + (do-joint-math (_type_ cspace-array joint-control) none) ) ) -(defmethod get-skeleton-origin draw-control ((this draw-control)) +(defmethod get-skeleton-origin ((this draw-control)) (-> this skeleton bones 0 transform trans) ) diff --git a/goal_src/jak2/engine/debug/debug-h.gc b/goal_src/jak2/engine/debug/debug-h.gc index ceeddbde957..2136cbe78c7 100644 --- a/goal_src/jak2/engine/debug/debug-h.gc +++ b/goal_src/jak2/engine/debug/debug-h.gc @@ -58,37 +58,28 @@ ;; DECOMP BEGINS (deftype pos-history (structure) - ((points (inline-array vector) :offset-assert 0) - (num-points int32 :offset-assert 4) - (h-first int32 :offset-assert 8) - (h-last int32 :offset-assert 12) + ((points (inline-array vector)) + (num-points int32) + (h-first int32) + (h-last int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype debug-vertex (structure) - ((trans vector4w :inline :offset-assert 0) - (normal vector3h :inline :offset-assert 16) - (st vector2h :inline :offset-assert 22) - (color uint32 :offset-assert 28) + ((trans vector4w :inline) + (normal vector3h :inline) + (st vector2h :inline) + (color uint32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype debug-vertex-stats (basic) - ((length int32 :offset-assert 4) - (pos-count int32 :offset-assert 8) - (vertex debug-vertex 600 :inline :offset-assert 16) + ((length int32) + (pos-count int32) + (vertex debug-vertex 600 :inline) ) - :method-count-assert 9 - :size-assert #x4b10 - :flag-assert #x900004b10 ) diff --git a/goal_src/jak2/engine/debug/debug.gc b/goal_src/jak2/engine/debug/debug.gc index 3490461aff7..ada64d74591 100644 --- a/goal_src/jak2/engine/debug/debug.gc +++ b/goal_src/jak2/engine/debug/debug.gc @@ -477,39 +477,30 @@ Most functions take a boolean as their first argument. If the boolean is set to (when *debug-segment* (deftype debug-line (structure) - ((flags int32 :offset-assert 0) - (bucket bucket-id :offset-assert 4) - (v1 vector :inline :offset-assert 16) - (v2 vector :inline :offset-assert 32) - (color rgba :offset-assert 48) - (mode symbol :offset-assert 52) - (color2 rgba :offset-assert 56) + ((flags int32) + (bucket bucket-id) + (v1 vector :inline) + (v2 vector :inline) + (color rgba) + (mode symbol) + (color2 rgba) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) (deftype debug-text-3d (structure) - ((flags int32 :offset-assert 0) - (bucket bucket-id :offset-assert 4) - (pos vector :inline :offset-assert 16) - (color font-color :offset-assert 32) - (offset vector2h :inline :offset-assert 36) - (str string :offset-assert 40) + ((flags int32) + (bucket bucket-id) + (pos vector :inline) + (color font-color) + (offset vector2h :inline) + (str string) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) (deftype debug-tracking-thang (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) + ((length int32) + (allocated-length int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) diff --git a/goal_src/jak2/engine/debug/editable-h.gc b/goal_src/jak2/engine/debug/editable-h.gc index 5b6519f91db..caaeb683c90 100644 --- a/goal_src/jak2/engine/debug/editable-h.gc +++ b/goal_src/jak2/engine/debug/editable-h.gc @@ -365,102 +365,93 @@ ) (deftype editable-region (basic) - ((changed symbol :offset-assert 4) - (locked symbol :offset-assert 8) - (id uint64 :offset-assert 16) - (filter editable-filter :offset-assert 24) - (tree symbol :offset-assert 28) - (level string :offset-assert 32) - (on-enter string :offset-assert 36) - (on-inside string :offset-assert 40) - (on-exit string :offset-assert 44) + ((changed symbol) + (locked symbol) + (id uint64) + (filter editable-filter) + (tree symbol) + (level string) + (on-enter string) + (on-inside string) + (on-exit string) ) - :method-count-assert 13 - :size-assert #x30 - :flag-assert #xd00000030 (:methods - (new (symbol type) _type_ 0) - (editable-region-method-9 (_type_ editable-array int int) symbol 9) - (editable-region-method-10 (_type_ int) symbol 10) - (editable-region-method-11 (_type_ vector int) none 11) - (editable-region-method-12 (_type_) editable-filter 12) + (new (symbol type) _type_) + (editable-region-method-9 (_type_ editable-array int int) symbol) + (editable-region-method-10 (_type_ int) symbol) + (editable-region-method-11 (_type_ vector int) none) + (editable-region-method-12 (_type_) editable-filter) ) ) (deftype editable (basic) - ((flags editable-flag :offset-assert 4) - (name string :offset-assert 8) - (id uint32 :offset-assert 12) - (region editable-region :offset-assert 16) - (owner pair :offset-assert 20) + ((flags editable-flag) + (name string) + (id uint32) + (region editable-region) + (owner pair) ) - :method-count-assert 30 - :size-assert #x18 - :flag-assert #x1e00000018 (:methods - (get-color (_type_ int) rgba 9) - (editable-method-10 (_type_) none 10) - (editable-method-11 (_type_ vector) symbol 11) - (select-editable! (_type_ symbol) none 12) - (edit-get-distance (_type_ vector) float 13) - (edit-get-trans (_type_) vector 14) - (editable-method-15 (_type_ vector int) none 15) - (edit-coord! (_type_ vector editable-flag) none 16) - (editable-method-17 (_type_ vector) none 17) - (editable-method-18 (_type_ vector matrix) none 18) - (editable-method-19 (_type_ vector) none 19) - (editable-method-20 (_type_ vector vector vector vector) none 20) - (editable-method-21 (_type_ editable-region) none 21) - (editable-method-22 (_type_ editable-array int int) symbol 22) - (editable-method-23 (_type_) symbol 23) - (editable-method-24 (_type_) none 24) - (editable-method-25 (_type_ editable-array) none 25) - (editable-method-26 (_type_ editable editable-array) none 26) - (editable-method-27 (_type_ editable-array) editable 27) - (editable-method-28 (_type_ editable-filter) none 28) - (editable-method-29 (_type_ editable-filter) symbol 29) + (get-color (_type_ int) rgba) + (editable-method-10 (_type_) none) + (editable-method-11 (_type_ vector) symbol) + (select-editable! (_type_ symbol) none) + (edit-get-distance (_type_ vector) float) + (edit-get-trans (_type_) vector) + (editable-method-15 (_type_ vector int) none) + (edit-coord! (_type_ vector editable-flag) none) + (editable-method-17 (_type_ vector) none) + (editable-method-18 (_type_ vector matrix) none) + (editable-method-19 (_type_ vector) none) + (editable-method-20 (_type_ vector vector vector vector) none) + (editable-method-21 (_type_ editable-region) none) + (editable-method-22 (_type_ editable-array int int) symbol) + (editable-method-23 (_type_) symbol) + (editable-method-24 (_type_) none) + (editable-method-25 (_type_ editable-array) none) + (editable-method-26 (_type_ editable editable-array) none) + (editable-method-27 (_type_ editable-array) editable) + (editable-method-28 (_type_ editable-filter) none) + (editable-method-29 (_type_ editable-filter) symbol) ) ) (deftype editable-array (basic) - ((allocated-length int32 :offset-assert 4) - (length int32 :offset-assert 8) - (region editable-region :offset-assert 12) - (backup-region editable-region :offset-assert 16) - (region-lock? symbol :offset-assert 20) - (move-lock? symbol :offset-assert 24) - (move-speed float :offset-assert 28) - (selection (array editable) :offset-assert 32) - (filter editable-filter 2 :offset-assert 36) - (target editable :offset-assert 44) - (target-mode editable-command :offset-assert 48) - (target-command editable-command :offset-assert 52) - (target-message string :offset-assert 56) - (edit-plane editable-plane :offset-assert 60) - (edit-plane-center vector :inline :offset-assert 64) - (edit-plane-normal vector :inline :offset-assert 80) - (level-offset vector :inline :offset-assert 96) - (level-info-id uint32 :offset-assert 112) - (level uint32 :offset-assert 116) - (edit-param0 float :offset-assert 120) - (data editable :dynamic :offset-assert 124) + ((allocated-length int32) + (length int32) + (region editable-region) + (backup-region editable-region) + (region-lock? symbol) + (move-lock? symbol) + (move-speed float) + (selection (array editable)) + (filter editable-filter 2) + (target editable) + (target-mode editable-command) + (target-command editable-command) + (target-message string) + (edit-plane editable-plane) + (edit-plane-center vector :inline) + (edit-plane-normal vector :inline) + (level-offset vector :inline) + (level-info-id uint32) + (level uint32) + (edit-param0 float) + (data editable :dynamic) ) - :method-count-assert 18 - :size-assert #x7c - :flag-assert #x120000007c (:methods - (new (symbol type int) _type_ 0) - (editable-array-method-9 (_type_ editable-command mouse-info) symbol :behavior editable-player 9) - (editable-array-method-10 (_type_ vector int) editable 10) - (editable-array-method-11 (_type_) int 11) - (editable-array-method-12 (_type_ editable-array) none 12) - (editable-array-method-13 (_type_ editable-command editable-command string) none 13) - (editable-array-method-14 (_type_ (function editable editable-region symbol) editable-region) (array editable) 14) - (editable-array-method-15 (_type_ editable) none 15) - (editable-array-method-16 (_type_) none 16) - (editable-array-method-17 (_type_ vector vector) vector 17) + (new (symbol type int) _type_) + (editable-array-method-9 (_type_ editable-command mouse-info) symbol :behavior editable-player) + (editable-array-method-10 (_type_ vector int) editable) + (editable-array-method-11 (_type_) int) + (editable-array-method-12 (_type_ editable-array) none) + (editable-array-method-13 (_type_ editable-command editable-command string) none) + (editable-array-method-14 (_type_ (function editable editable-region symbol) editable-region) (array editable)) + (editable-array-method-15 (_type_ editable) none) + (editable-array-method-16 (_type_) none) + (editable-array-method-17 (_type_ vector vector) vector) ) ) @@ -505,14 +496,11 @@ ) (deftype editable-point (editable) - ((radius float :offset-assert 24) - (trans vector :inline :offset-assert 32) + ((radius float) + (trans vector :inline) ) - :method-count-assert 30 - :size-assert #x30 - :flag-assert #x1e00000030 (:methods - (new (symbol type vector editable-region) _type_ 0) + (new (symbol type vector editable-region) _type_) ) ) @@ -540,11 +528,8 @@ (deftype editable-sphere (editable-point) () - :method-count-assert 30 - :size-assert #x30 - :flag-assert #x1e00000030 (:methods - (new (symbol type vector float editable-region) _type_ 0) + (new (symbol type vector float editable-region) _type_) ) ) @@ -572,24 +557,18 @@ (deftype editable-sample (editable-point) () - :method-count-assert 30 - :size-assert #x30 - :flag-assert #x1e00000030 ) (deftype editable-light (editable-sphere) - ((direction vector :inline :offset-assert 48) - (color vector :inline :offset-assert 64) - (decay-start float :offset-assert 80) - (ambient-point-ratio float :offset-assert 84) - (brightness float :offset-assert 88) + ((direction vector :inline) + (color vector :inline) + (decay-start float) + (ambient-point-ratio float) + (brightness float) ) - :method-count-assert 30 - :size-assert #x5c - :flag-assert #x1e0000005c (:methods - (new (symbol type vector float editable-region) _type_ 0) + (new (symbol type vector float editable-region) _type_) ) ) @@ -626,25 +605,19 @@ (deftype editable-entity (editable-point) () - :method-count-assert 30 - :size-assert #x30 - :flag-assert #x1e00000030 ) (deftype editable-face (editable) - ((length int32 :offset-assert 24) - (normal vector :inline :offset-assert 32) - (center vector :inline :offset-assert 48) - (vertex editable-point 6 :offset-assert 64) ;; can hold up to 6 (kinda a weird number...) but still does just define 1 face! + ((length int32) + (normal vector :inline) + (center vector :inline) + (vertex editable-point 6) ;; can hold up to 6 (kinda a weird number...) but still does just define 1 face! ) - :method-count-assert 32 - :size-assert #x58 - :flag-assert #x2000000058 (:methods - (new (symbol type editable-region) _type_ 0) - (editable-face-method-30 (_type_ (inline-array vector)) int 30) - (editable-face-method-31 (_type_ vector) vector 31) + (new (symbol type editable-region) _type_) + (editable-face-method-30 (_type_ (inline-array vector)) int) + (editable-face-method-31 (_type_ vector) vector) ) ) @@ -670,16 +643,15 @@ (deftype editable-plane (editable) "Modified from the original, in the original editor code a plane is defined by a normal vector (2 points) and a radius (equal side lengths)" - ((length int32) + ((length int32) (normal vector :inline) (position vector :inline) - (vertex editable-point 4) + (vertex editable-point 4) ;; was 2 ) - :method-count-assert 32 (:methods - (new (symbol type editable-region) _type_ 0) - (editable-plane-method-30 (_type_ (inline-array vector)) int 30) - (editable-plane-method-31 (_type_ vector) vector 31) + (new (symbol type editable-region) _type_) + (editable-plane-method-30 (_type_ (inline-array vector)) int) + (editable-plane-method-31 (_type_ vector) vector) ) ) @@ -704,38 +676,33 @@ ) (deftype editable-player (process-drawable) - ((current editable-array :offset-assert 200) - (select-command function :offset-assert 204) - (move-command function :offset-assert 208) - (extra-command function :offset-assert 212) - (left-handed basic :offset-assert 216) - (light-names basic :offset-assert 220) - (external-cam-mode symbol :offset-assert 224) - (command editable-command 6 :offset-assert 228) - (close-menu-time time-frame :offset-assert 256) + ((current editable-array) + (select-command function) + (move-command function) + (extra-command function) + (left-handed basic) + (light-names basic) + (external-cam-mode symbol) + (command editable-command 6) + (close-menu-time time-frame) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x108 - :flag-assert #x1600900108 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (editable-player-method-21 (_type_) none 21) + (editable-player-method-21 (_type_) none) ) ) (deftype editable-work (basic) - ((num-found int16 :offset-assert 4) - (last-found int16 :offset-assert 6) - (last-x float :offset-assert 8) - (last-y float :offset-assert 12) - (found editable 256 :offset-assert 16) - (dists uint32 256 :offset-assert 1040) + ((num-found int16) + (last-found int16) + (last-x float) + (last-y float) + (found editable 256) + (dists uint32 256) ) - :method-count-assert 9 - :size-assert #x810 - :flag-assert #x900000810 ) diff --git a/goal_src/jak2/engine/debug/editable-player.gc b/goal_src/jak2/engine/debug/editable-player.gc index 9aee725a84b..1db1b003d8d 100644 --- a/goal_src/jak2/engine/debug/editable-player.gc +++ b/goal_src/jak2/engine/debug/editable-player.gc @@ -1106,7 +1106,7 @@ #t ) -(defmethod editable-array-method-9 editable-array ((this editable-array) (arg0 editable-command) (arg1 mouse-info)) +(defmethod editable-array-method-9 ((this editable-array) (arg0 editable-command) (arg1 mouse-info)) (if (execute-select this arg0 arg1) (return #f) ) @@ -1419,7 +1419,7 @@ #f ) -(defmethod deactivate editable-player ((this editable-player)) +(defmethod deactivate ((this editable-player)) ;; og:preserve-this ;; Put the pad back to normal (pc-treat-pad0-as-pad1 #f) @@ -1437,7 +1437,7 @@ ) ;; WARN: Return type mismatch process-drawable vs editable-player. -(defmethod relocate editable-player ((this editable-player) (arg0 int)) +(defmethod relocate ((this editable-player) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -1456,7 +1456,7 @@ (the-as editable-player ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod editable-player-method-21 editable-player ((this editable-player)) +(defmethod editable-player-method-21 ((this editable-player)) (set! *display-region-marks* #f) (let* ((s5-0 (-> this current length)) (s4-0 0) diff --git a/goal_src/jak2/engine/debug/editable.gc b/goal_src/jak2/engine/debug/editable.gc index d8580ae0711..a72db8aa658 100644 --- a/goal_src/jak2/engine/debug/editable.gc +++ b/goal_src/jak2/engine/debug/editable.gc @@ -30,12 +30,12 @@ ) ) -(defmethod print editable-region ((this editable-region)) +(defmethod print ((this editable-region)) (format #t "#<~A region-~D ~A ~A @ #x~X>" (-> this type) (-> this id) (-> this level) (-> this tree) this) this ) -(defmethod editable-region-method-10 editable-region ((this editable-region) (arg0 int)) +(defmethod editable-region-method-10 ((this editable-region) (arg0 int)) (local-vars (sv-16 string) (sv-32 string)) (when (nonzero? (-> this id)) (let ((s5-0 (clear *temp-string*))) @@ -112,7 +112,7 @@ #f ) -(defmethod editable-region-method-9 editable-region ((this editable-region) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-region-method-9 ((this editable-region) (arg0 editable-array) (arg1 int) (arg2 int)) (local-vars (v0-0 symbol) (v1-5 object) (v1-28 object)) (set! v0-0 (when (-> this changed) @@ -301,7 +301,7 @@ v0-0 ) -(defmethod editable-region-method-11 editable-region ((this editable-region) (arg0 vector) (arg1 int)) +(defmethod editable-region-method-11 ((this editable-region) (arg0 vector) (arg1 int)) (local-vars (sv-32 vector2h)) (set! sv-32 (new 'stack 'vector2h)) (add-debug-x #t (bucket-id debug-no-zbuf1) arg0 (new 'static 'rgba :r #xff :g #xff :a #x80)) @@ -356,7 +356,7 @@ ) ;; WARN: Return type mismatch int vs editable-filter. -(defmethod editable-region-method-12 editable-region ((this editable-region)) +(defmethod editable-region-method-12 ((this editable-region)) (let* ((s5-0 0) (s4-0 (lambda ((arg0 string)) (let ((gp-0 0)) (when (not (type? arg0 string)) @@ -422,11 +422,11 @@ ) ) -(defmethod editable-method-23 editable ((this editable)) +(defmethod editable-method-23 ((this editable)) #t ) -(defmethod editable-method-28 editable ((this editable) (arg0 editable-filter)) +(defmethod editable-method-28 ((this editable) (arg0 editable-filter)) (let* ((s5-0 (-> this owner)) (a0-1 (car s5-0)) ) @@ -441,7 +441,7 @@ ) ;; WARN: Return type mismatch int vs symbol. -(defmethod editable-method-29 editable ((this editable) (arg0 editable-filter)) +(defmethod editable-method-29 ((this editable) (arg0 editable-filter)) (let* ((s5-0 (-> this owner)) (a0-1 (car s5-0)) ) @@ -454,7 +454,7 @@ (the-as symbol 0) ) -(defmethod editable-method-21 editable ((this editable) (arg0 editable-region)) +(defmethod editable-method-21 ((this editable) (arg0 editable-region)) (when (not (and (-> this region) (-> this region locked))) (if arg0 (set! (-> arg0 changed) #t) @@ -470,7 +470,7 @@ ) ;; WARN: Return type mismatch int vs rgba. -(defmethod get-color editable ((this editable) (arg0 int)) +(defmethod get-color ((this editable) (arg0 int)) "Returns the [[rgba]] that corresponds to the type of [[editable]] TODO - document the colors" (the-as rgba (cond ((and (logtest? (-> this flags) (editable-flag selected)) @@ -500,7 +500,7 @@ ) ) -(defmethod editable-method-10 editable ((this editable)) +(defmethod editable-method-10 ((this editable)) (when (logtest? (-> this flags) (editable-flag selected)) (let ((s5-0 (new 'stack-no-clear 'vector))) (when (editable-method-11 this s5-0) @@ -514,7 +514,7 @@ (none) ) -(defmethod select-editable! editable ((this editable) (arg0 symbol)) +(defmethod select-editable! ((this editable) (arg0 symbol)) (case arg0 (('toggle) (logxor! (-> this flags) (editable-flag selected)) @@ -530,12 +530,12 @@ (none) ) -(defmethod edit-get-distance editable ((this editable) (arg0 vector)) +(defmethod edit-get-distance ((this editable) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" -1.0 ) -(defmethod editable-method-20 editable ((this editable) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod editable-method-20 ((this editable) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (local-vars (sv-48 vector) (sv-52 vector)) (set! sv-48 (new 'stack-no-clear 'vector)) (set! sv-52 (new 'stack-no-clear 'vector)) @@ -553,7 +553,7 @@ (none) ) -(defmethod editable-method-11 editable ((this editable) (arg0 vector)) +(defmethod editable-method-11 ((this editable) (arg0 vector)) (with-pp (let ((s5-0 (new 'stack 'collide-query))) (set! (-> s5-0 start-pos quad) (-> (edit-get-trans this) quad)) @@ -576,51 +576,51 @@ ) ) -(defmethod editable-method-24 editable ((this editable)) +(defmethod editable-method-24 ((this editable)) 0 (none) ) -(defmethod editable-method-17 editable ((this editable) (arg0 vector)) +(defmethod editable-method-17 ((this editable) (arg0 vector)) 0 (none) ) -(defmethod editable-method-22 editable ((this editable) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable) (arg0 editable-array) (arg1 int) (arg2 int)) #t ) -(defmethod editable-method-15 editable ((this editable) (arg0 vector) (arg1 int)) +(defmethod editable-method-15 ((this editable) (arg0 vector) (arg1 int)) 0 (none) ) -(defmethod edit-coord! editable ((this editable) (arg0 vector) (arg1 editable-flag)) +(defmethod edit-coord! ((this editable) (arg0 vector) (arg1 editable-flag)) 0 (none) ) -(defmethod editable-method-18 editable ((this editable) (arg0 vector) (arg1 matrix)) +(defmethod editable-method-18 ((this editable) (arg0 vector) (arg1 matrix)) 0 (none) ) -(defmethod edit-get-trans editable ((this editable)) +(defmethod edit-get-trans ((this editable)) "Returns the `trans` [[vector]] or [[*null-vector*]]" *null-vector* ) -(defmethod editable-method-19 editable ((this editable) (arg0 vector)) +(defmethod editable-method-19 ((this editable) (arg0 vector)) 0 (none) ) -(defmethod editable-method-26 editable ((this editable) (arg0 editable) (arg1 editable-array)) +(defmethod editable-method-26 ((this editable) (arg0 editable) (arg1 editable-array)) 0 (none) ) -(defmethod editable-method-25 editable ((this editable) (arg0 editable-array)) +(defmethod editable-method-25 ((this editable) (arg0 editable-array)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -640,7 +640,7 @@ (none) ) -(defmethod editable-method-27 editable ((this editable) (arg0 editable-array)) +(defmethod editable-method-27 ((this editable) (arg0 editable-array)) (local-vars (s4-0 editable)) (let ((v1-0 0)) (while (< v1-0 (-> arg0 selection length)) @@ -681,7 +681,7 @@ s4-0 ) -(defmethod print editable-point ((this editable-point)) +(defmethod print ((this editable-point)) (format #t "#<~A~S~m ~m ~m :r ~m" @@ -700,7 +700,7 @@ ) ;; WARN: Function (method 28 editable-point) has a return type of none, but the expression builder found a return statement. -(defmethod editable-method-28 editable-point ((this editable-point) (arg0 editable-filter)) +(defmethod editable-method-28 ((this editable-point) (arg0 editable-filter)) (if (logtest? arg0 (editable-filter water-command)) (return #f) ) @@ -741,7 +741,7 @@ (none) ) -(defmethod editable-method-15 editable-point ((this editable-point) (arg0 vector) (arg1 int)) +(defmethod editable-method-15 ((this editable-point) (arg0 vector) (arg1 int)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -754,7 +754,7 @@ (none) ) -(defmethod edit-coord! editable-point ((this editable-point) (arg0 vector) (arg1 editable-flag)) +(defmethod edit-coord! ((this editable-point) (arg0 vector) (arg1 editable-flag)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -775,12 +775,12 @@ (none) ) -(defmethod edit-get-trans editable-point ((this editable-point)) +(defmethod edit-get-trans ((this editable-point)) "Returns the `trans` [[vector]] or [[*null-vector*]]" (-> this trans) ) -(defmethod editable-method-18 editable-point ((this editable-point) (arg0 vector) (arg1 matrix)) +(defmethod editable-method-18 ((this editable-point) (arg0 vector) (arg1 matrix)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -795,7 +795,7 @@ (none) ) -(defmethod editable-method-10 editable-point ((this editable-point)) +(defmethod editable-method-10 ((this editable-point)) (let* ((s5-0 vector-vector-distance) (a0-1 (math-camera-pos)) (a1-0 (-> this trans)) @@ -831,7 +831,7 @@ (none) ) -(defmethod edit-get-distance editable-point ((this editable-point) (arg0 vector)) +(defmethod edit-get-distance ((this editable-point) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" (let ((a0-1 (new 'stack-no-clear 'sphere)) (s5-0 (new 'stack-no-clear 'vector)) @@ -850,7 +850,7 @@ -1.0 ) -(defmethod editable-method-19 editable-point ((this editable-point) (arg0 vector)) +(defmethod editable-method-19 ((this editable-point) (arg0 vector)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -865,7 +865,7 @@ (none) ) -(defmethod editable-method-22 editable-point ((this editable-point) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable-point) (arg0 editable-array) (arg1 int) (arg2 int)) (case arg1 ((2) (let ((s3-0 (clear *temp-string*))) @@ -891,7 +891,7 @@ ) ) -(defmethod editable-method-17 editable-sphere ((this editable-sphere) (arg0 vector)) +(defmethod editable-method-17 ((this editable-sphere) (arg0 vector)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -910,7 +910,7 @@ (none) ) -(defmethod editable-method-22 editable-sphere ((this editable-sphere) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable-sphere) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((gp-0 (clear *temp-string*))) (format gp-0 @@ -925,7 +925,7 @@ ) ) -(defmethod editable-method-22 editable-sample ((this editable-sample) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable-sample) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((s5-0 (clear *temp-string*))) (format s5-0 @@ -944,7 +944,7 @@ ) ) -(defmethod print editable-light ((this editable-light)) +(defmethod print ((this editable-light)) (format #t "#<~A~S ~S ~m ~m ~m" @@ -962,7 +962,7 @@ this ) -(defmethod editable-method-23 editable-light ((this editable-light)) +(defmethod editable-method-23 ((this editable-light)) (let ((v1-0 *light-hash*)) (let* ((a2-0 (-> v1-0 num-lights)) (a1-1 (-> v1-0 light-sphere-array a2-0)) @@ -999,7 +999,7 @@ (none) ) -(defmethod editable-method-17 editable-light ((this editable-light) (arg0 vector)) +(defmethod editable-method-17 ((this editable-light) (arg0 vector)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -1019,7 +1019,7 @@ (none) ) -(defmethod editable-method-15 editable-light ((this editable-light) (arg0 vector) (arg1 int)) +(defmethod editable-method-15 ((this editable-light) (arg0 vector) (arg1 int)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -1034,7 +1034,7 @@ ) ;; WARN: Function (method 25 editable-light) has a return type of none, but the expression builder found a return statement. -(defmethod editable-method-25 editable-light ((this editable-light) (arg0 editable-array)) +(defmethod editable-method-25 ((this editable-light) (arg0 editable-array)) (call-parent-method this arg0) (when (nonzero? (-> this id)) (let ((s5-1 (clear *temp-string*))) @@ -1051,7 +1051,7 @@ (none) ) -(defmethod editable-method-22 editable-light ((this editable-light) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable-light) (arg0 editable-array) (arg1 int) (arg2 int)) (cond ((logtest? (-> this flags) (editable-flag changed)) (let ((s5-0 (clear *temp-string*))) @@ -1124,7 +1124,7 @@ ) ) -(defmethod editable-method-10 editable-light ((this editable-light)) +(defmethod editable-method-10 ((this editable-light)) (if (!= (-> this direction w) 0.0) (add-debug-vector #t @@ -1148,7 +1148,7 @@ (none) ) -(defmethod edit-get-trans editable-face ((this editable-face)) +(defmethod edit-get-trans ((this editable-face)) "Returns the `trans` [[vector]] or [[*null-vector*]]" "The center of the obj." (cond @@ -1175,7 +1175,7 @@ ) ) -(defmethod editable-method-22 editable-face ((this editable-face) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable-face) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((s4-0 (clear *temp-string*))) (format s4-0 "insert into region_face set kind='face',region_id=~D" (-> this region id)) (if (logtest? (-> this flags) (editable-flag orient)) @@ -1194,7 +1194,7 @@ #t ) -(defmethod editable-method-25 editable-face ((this editable-face) (arg0 editable-array)) +(defmethod editable-method-25 ((this editable-face) (arg0 editable-array)) (dotimes (s4-0 (-> this length)) (let ((s3-0 (-> this vertex s4-0))) (set! (-> s3-0 owner) (delete! this (-> s3-0 owner))) @@ -1204,7 +1204,7 @@ (none) ) -(defmethod editable-method-26 editable-face ((this editable-face) (arg0 editable) (arg1 editable-array)) +(defmethod editable-method-26 ((this editable-face) (arg0 editable) (arg1 editable-array)) (-> this length) (countdown (v1-1 (-> this length)) (when (= (-> this vertex v1-1) arg0) @@ -1227,7 +1227,7 @@ ) ;; WARN: Return type mismatch editable-face vs editable. -(defmethod editable-method-27 editable-face ((this editable-face) (arg0 editable-array)) +(defmethod editable-method-27 ((this editable-face) (arg0 editable-array)) (let ((gp-1 (the-as editable-face (call-parent-method this arg0)))) (dotimes (s4-0 (-> gp-1 length)) (set! (-> gp-1 vertex s4-0) (the-as editable-point (editable-method-27 (-> gp-1 vertex s4-0) arg0))) @@ -1237,7 +1237,7 @@ ) ) -(defmethod editable-method-24 editable-face ((this editable-face)) +(defmethod editable-method-24 ((this editable-face)) (logxor! (-> this flags) (editable-flag orient)) (editable-face-method-31 this (-> this normal)) (logior! (-> this flags) (editable-flag changed)) @@ -1246,7 +1246,7 @@ (none) ) -(defmethod editable-face-method-30 editable-face ((this editable-face) (arg0 (inline-array vector))) +(defmethod editable-face-method-30 ((this editable-face) (arg0 (inline-array vector))) (let ((v1-0 (-> this length))) (cond ((or (zero? v1-0) (= v1-0 1)) @@ -1275,7 +1275,7 @@ ) ) -(defmethod editable-face-method-31 editable-face ((this editable-face) (arg0 vector)) +(defmethod editable-face-method-31 ((this editable-face) (arg0 vector)) (let ((s4-0 (new 'stack-no-clear 'matrix))) (dotimes (v1-0 6) (set! (-> s4-0 quad v1-0) (the-as uint128 0)) @@ -1290,7 +1290,7 @@ arg0 ) -(defmethod edit-get-distance editable-face ((this editable-face) (arg0 vector)) +(defmethod edit-get-distance ((this editable-face) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (editable-face-method-31 this (new 'stack-no-clear 'vector))) @@ -1325,7 +1325,7 @@ ) ;; WARN: Return type mismatch int vs symbol. -(defmethod editable-method-29 editable-face ((this editable-face) (arg0 editable-filter)) +(defmethod editable-method-29 ((this editable-face) (arg0 editable-filter)) (local-vars (sv-208 (inline-array vector)) (sv-216 int) @@ -1495,7 +1495,7 @@ (the-as symbol 0) ) -(defmethod editable-method-10 editable-face ((this editable-face)) +(defmethod editable-method-10 ((this editable-face)) ;; Greatly simplify the code here (let ((points (new 'stack-no-clear 'inline-array 'vector 4))) (dotimes (point-idx 4) @@ -1590,7 +1590,7 @@ (none) ) -(defmethod edit-get-trans editable-plane ((this editable-plane)) +(defmethod edit-get-trans ((this editable-plane)) "Returns the `trans` [[vector]] or [[*null-vector*]]" (if (>= (-> this length) 1) (edit-get-trans (-> this vertex 0)) @@ -1598,7 +1598,7 @@ ) ) -(defmethod editable-method-22 editable-plane ((this editable-plane) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable-plane) (arg0 editable-array) (arg1 int) (arg2 int)) (format 0 "TODO - UPDATE THIS") ;; (let ((s4-0 (clear *temp-string*))) ;; (format @@ -1620,31 +1620,25 @@ #t ) -(defmethod editable-method-25 editable-plane ((this editable-plane) (arg0 editable-array)) +(defmethod editable-method-25 ((this editable-plane) (arg0 editable-array)) (dotimes (s4-0 (-> this length)) (let ((s3-0 (-> this vertex s4-0))) (set! (-> s3-0 owner) (delete! this (-> s3-0 owner))) ) ) - ((the-as (function editable-plane editable-array none) (find-parent-method editable-plane 25)) this arg0) + (call-parent-method this arg0) (none) ) -(defmethod editable-method-26 editable-plane ((this editable-plane) (arg0 editable) (arg1 editable-array)) +(defmethod editable-method-26 ((this editable-plane) (arg0 editable) (arg1 editable-array)) (editable-array-method-15 arg1 this) ((method-of-type editable editable-method-26) this arg0 arg1) (none) ) ;; WARN: Return type mismatch editable-plane vs editable. -(defmethod editable-method-27 editable-plane ((this editable-plane) (arg0 editable-array)) - (let ((gp-1 - (the-as - editable-plane - ((the-as (function editable-plane editable-array editable) (find-parent-method editable-plane 27)) this arg0) - ) - ) - ) +(defmethod editable-method-27 ((this editable-plane) (arg0 editable-array)) + (let ((gp-1 (the-as editable-plane (call-parent-method this arg0)))) (dotimes (s4-0 (-> gp-1 length)) (set! (-> gp-1 vertex s4-0) (the-as editable-point (editable-method-27 (-> gp-1 vertex s4-0) arg0))) (set! (-> gp-1 vertex s4-0 owner) (cons gp-1 (-> gp-1 vertex s4-0 owner))) @@ -1653,7 +1647,7 @@ ) ) -(defmethod editable-method-24 editable-plane ((this editable-plane)) +(defmethod editable-method-24 ((this editable-plane)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) @@ -1674,7 +1668,7 @@ (none) ) -(defmethod editable-plane-method-30 editable-plane ((this editable-plane) (arg0 (inline-array vector))) +(defmethod editable-plane-method-30 ((this editable-plane) (arg0 (inline-array vector))) ;; og:preserve-this ;; This function converts 2 points (defining the normal) along with the radius into the 4 points that describe the plane ;; this means that they can only generate square planes, so this code is no longer used @@ -1713,7 +1707,7 @@ 0 ) -(defmethod editable-plane-method-31 editable-plane ((this editable-plane) (arg0 vector)) +(defmethod editable-plane-method-31 ((this editable-plane) (arg0 vector)) (case (-> this length) ((2) (let ((s3-0 (-> this vertex 0)) @@ -1727,7 +1721,7 @@ arg0 ) -(defmethod edit-get-distance editable-plane ((this editable-plane) (arg0 vector)) +(defmethod edit-get-distance ((this editable-plane) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (editable-plane-method-31 this (new 'stack-no-clear 'vector))) @@ -1762,7 +1756,7 @@ -1.0 ) -(defmethod editable-method-10 editable-plane ((this editable-plane)) +(defmethod editable-method-10 ((this editable-plane)) (let ((points (new 'stack-no-clear 'inline-array 'vector 4))) (dotimes (point-idx 4) ;; (inspect this) @@ -1793,7 +1787,7 @@ (none) ) -(defmethod editable-method-17 editable-plane ((this editable-plane) (arg0 vector)) +(defmethod editable-method-17 ((this editable-plane) (arg0 vector)) (format 0 "TODO - UPDATE THIS") ;; (let ((v1-0 (-> this region))) ;; (if v1-0 @@ -1814,7 +1808,7 @@ ) ;; WARN: Return type mismatch (array editable) vs editable-array. -(defmethod relocate editable-array ((this editable-array) (arg0 int)) +(defmethod relocate ((this editable-array) (arg0 int)) (the-as editable-array (when (nonzero? (-> this selection)) (let ((v0-0 (&+ (-> this selection) arg0))) (set! (-> this selection) v0-0) @@ -1824,16 +1818,16 @@ ) ) -(defmethod length editable-array ((this editable-array)) +(defmethod length ((this editable-array)) (-> this length) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of editable-array ((this editable-array)) +(defmethod asize-of ((this editable-array)) (the-as int (+ (-> this type size) (* (-> this allocated-length) 4))) ) -(defmethod editable-array-method-11 editable-array ((this editable-array)) +(defmethod editable-array-method-11 ((this editable-array)) (dotimes (v1-0 (-> this length)) (if (not (-> this data v1-0)) (return v1-0) @@ -1846,7 +1840,7 @@ -1 ) -(defmethod editable-array-method-10 editable-array ((this editable-array) (arg0 vector) (arg1 int)) +(defmethod editable-array-method-10 ((this editable-array) (arg0 vector) (arg1 int)) (when (or (!= (-> arg0 x) (-> *editable-work* last-x)) (!= (-> arg0 y) (-> *editable-work* last-y))) (set! (-> *editable-work* last-found) 0) (set! (-> *editable-work* last-x) (-> arg0 x)) @@ -1917,7 +1911,7 @@ ) ) -(defmethod editable-array-method-14 editable-array ((this editable-array) (arg0 (function editable editable-region symbol)) (arg1 editable-region)) +(defmethod editable-array-method-14 ((this editable-array) (arg0 (function editable editable-region symbol)) (arg1 editable-region)) (let ((gp-0 (-> this selection))) (set! (-> gp-0 length) 0) (let* ((s2-0 (-> this length)) @@ -1939,7 +1933,7 @@ ) ) -(defmethod editable-array-method-15 editable-array ((this editable-array) (arg0 editable)) +(defmethod editable-array-method-15 ((this editable-array) (arg0 editable)) (let ((gp-0 (-> arg0 region))) (when gp-0 (editable-method-25 arg0 this) @@ -1977,7 +1971,7 @@ ;; WARN: Return type mismatch symbol vs none. ;; WARN: Function (method 12 editable-array) has a return type of none, but the expression builder found a return statement. -(defmethod editable-array-method-12 editable-array ((this editable-array) (arg0 editable-array)) +(defmethod editable-array-method-12 ((this editable-array) (arg0 editable-array)) (local-vars (sv-16 sql-result) (sv-20 sql-result) @@ -2250,7 +2244,7 @@ ) ) ) - (set! sv-64 (+ sv-64 12)) + (set! sv-64 (+ sv-64 5)) ) (let* ((v1-293 (-> this length)) (a0-158 0) @@ -2364,7 +2358,7 @@ (none) ) -(defmethod editable-array-method-13 editable-array ((this editable-array) (arg0 editable-command) (arg1 editable-command) (arg2 string)) +(defmethod editable-array-method-13 ((this editable-array) (arg0 editable-command) (arg1 editable-command) (arg2 string)) (set! (-> this target) #f) (set! (-> this target-mode) arg0) (set! (-> this target-command) arg1) @@ -2373,7 +2367,7 @@ (none) ) -(defmethod editable-array-method-16 editable-array ((this editable-array)) +(defmethod editable-array-method-16 ((this editable-array)) (cond ((-> this edit-plane) (editable-plane-method-31 (-> this edit-plane) (-> this edit-plane-normal)) @@ -2390,7 +2384,7 @@ (none) ) -(defmethod editable-array-method-17 editable-array ((this editable-array) (arg0 vector) (arg1 vector)) +(defmethod editable-array-method-17 ((this editable-array) (arg0 vector) (arg1 vector)) (cond ((and (cpad-hold? 0 up) *target*) (set! (-> arg0 quad) (-> (get-trans *target* 0) quad)) diff --git a/goal_src/jak2/engine/debug/history.gc b/goal_src/jak2/engine/debug/history.gc index a425ed58cc9..875f82a46fe 100644 --- a/goal_src/jak2/engine/debug/history.gc +++ b/goal_src/jak2/engine/debug/history.gc @@ -88,69 +88,60 @@ ) (deftype history-elt (structure) - ((record-tag-bytes uint8 4 :offset-assert 0) - (record-tag uint32 :offset 0) - (record-id uint16 :offset 0) - (owner uint8 :offset 2) - (channel history-channel :offset-assert 4) - (timestamp time-frame :offset-assert 8) - (origin vector :inline :offset-assert 16) - (bytes uint8 16 :offset-assert 32) - (vector vector :inline :offset 32) - (float float :offset 32) - (collide-status collide-status :offset 32) - (collide-reaction-flag uint32 :offset 40) - (pat pat-surface :offset 32) + ((record-tag-bytes uint8 4) + (record-tag uint32 :overlay-at (-> record-tag-bytes 0)) + (record-id uint16 :overlay-at (-> record-tag-bytes 0)) + (owner uint8 :overlay-at (-> record-tag-bytes 2)) + (channel history-channel) + (timestamp time-frame) + (origin vector :inline) + (bytes uint8 16) + (vector vector :inline :overlay-at (-> bytes 0)) + (float float :overlay-at (-> bytes 0)) + (collide-status collide-status :overlay-at (-> bytes 0)) + (collide-reaction-flag uint32 :overlay-at (-> bytes 8)) + (pat pat-surface :overlay-at (-> bytes 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype history-iterator (basic) - ((max-age uint32 :offset-assert 4) - (owner uint8 :offset-assert 8) - (proc process :offset-assert 12) - (out object :offset-assert 16) - (channel-mask uint64 :offset-assert 24) - (index int32 :offset-assert 32) - (done? symbol :offset-assert 36) + ((max-age uint32) + (owner uint8) + (proc process) + (out object) + (channel-mask uint64) + (index int32) + (done? symbol) ) - :method-count-assert 12 - :size-assert #x28 - :flag-assert #xc00000028 (:methods - (new (symbol type uint) _type_ 0) - (frame-counter-delta (_type_ history-elt) time-frame 9) - (update-entries! (_type_) history-elt 10) - (get-age (_type_ history-elt) float 11) + (new (symbol type uint) _type_) + (frame-counter-delta (_type_ history-elt) time-frame) + (update-entries! (_type_) history-elt) + (get-age (_type_ history-elt) float) ) ) (deftype history (basic) - ((alloc-index int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (elts history-elt :inline :dynamic :offset 16) + ((alloc-index int32) + (allocated-length int32) + (elts history-elt :inline :dynamic :offset 16) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (new (symbol type int) _type_ 0) - (clear-record-tags! (_type_ history-channel uint uint) history-elt 9) - (clear-history-entries! (_type_) none 10) + (new (symbol type int) _type_) + (clear-record-tags! (_type_ history-channel uint uint) history-elt) + (clear-history-entries! (_type_) none) ) ) -(defmethod length history ((this history)) +(defmethod length ((this history)) (-> this allocated-length) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of history ((this history)) +(defmethod asize-of ((this history)) (the-as int (+ (-> this type size) (* 48 (-> this allocated-length)))) ) @@ -161,7 +152,7 @@ ) ) -(defmethod clear-history-entries! history ((this history)) +(defmethod clear-history-entries! ((this history)) "Iterates through each [[history-elt]] in the `elt` dynamic array For each entry: - clear `timestamp` @@ -183,7 +174,7 @@ For each entry: (clear-history-entries! *history*) ;; WARN: new jak 2 until loop case, check carefully -(defmethod clear-record-tags! history ((this history) (arg0 history-channel) (arg1 uint) (arg2 uint)) +(defmethod clear-record-tags! ((this history) (arg0 history-channel) (arg1 uint) (arg2 uint)) "First grab the latest [[history-elt]] at `alloc-index` 1. update it's `channel`, `record-id` and `owner` from the provided args 2. - if it's `record-tag` is zero -- return it @@ -235,7 +226,7 @@ For each entry: ) ) -(defmethod update-entries! history-iterator ((this history-iterator)) +(defmethod update-entries! ((this history-iterator)) "Iterate through each [[history-elt]] in [[*history*]] - If we hit the end set `done?` to true - If the `timestamp` on the elt, minus the current framecounter exceeds `max-age`, we are also done, return #f @@ -269,7 +260,7 @@ For each entry: (the-as history-elt #f) ) -(defmethod get-age history-iterator ((this history-iterator) (arg0 history-elt)) +(defmethod get-age ((this history-iterator) (arg0 history-elt)) "Get the age of a history element" (- 1.0 (fmin 1.0 (/ (the float (+ (- 1 (-> arg0 timestamp)) (-> *display* base-clock frame-counter))) (the float (+ (-> this max-age) 1)) @@ -278,7 +269,7 @@ For each entry: ) ) -(defmethod frame-counter-delta history-iterator ((this history-iterator) (arg0 history-elt)) +(defmethod frame-counter-delta ((this history-iterator) (arg0 history-elt)) "Returns the difference between [[*display*]]'s `base-clock.frame-counter` and the elt's `timestamp`" (- (-> *display* base-clock frame-counter) (-> arg0 timestamp)) ) diff --git a/goal_src/jak2/engine/debug/memory-usage-h.gc b/goal_src/jak2/engine/debug/memory-usage-h.gc index 2bac1cfde5c..bfb174619e7 100644 --- a/goal_src/jak2/engine/debug/memory-usage-h.gc +++ b/goal_src/jak2/engine/debug/memory-usage-h.gc @@ -105,29 +105,23 @@ (declare-file (debug)) (deftype memory-usage-info (structure) - ((name string :offset-assert 0) - (count int32 :offset-assert 4) - (used int32 :offset-assert 8) - (total int32 :offset-assert 12) + ((name string) + (count int32) + (used int32) + (total int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype memory-usage-block (basic) - ((work-bsp basic :offset-assert 4) - (length int32 :offset-assert 8) - (data memory-usage-info 112 :inline :offset-assert 16) + ((work-bsp basic) + (length int32) + (data memory-usage-info 112 :inline) ) - :method-count-assert 12 - :size-assert #x710 - :flag-assert #xc00000710 (:methods - (reset! (_type_) _type_ 9) - (calculate-total (_type_) int 10) - (print-mem-usage (_type_ level object) _type_ 11) + (reset! (_type_) _type_) + (calculate-total (_type_) int) + (print-mem-usage (_type_ level object) _type_) ) ) diff --git a/goal_src/jak2/engine/debug/memory-usage.gc b/goal_src/jak2/engine/debug/memory-usage.gc index ee1007644ee..3b3cf5b239f 100644 --- a/goal_src/jak2/engine/debug/memory-usage.gc +++ b/goal_src/jak2/engine/debug/memory-usage.gc @@ -39,11 +39,11 @@ obj ) -(defmethod mem-usage object ((this object) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this object) (arg0 memory-usage-block) (arg1 int)) this ) -(defmethod calculate-total memory-usage-block ((this memory-usage-block)) +(defmethod calculate-total ((this memory-usage-block)) "@returns The total sum of all [[memory-usage-info]] `total`s" (let ((sum 0)) (dotimes (idx (-> this length)) @@ -53,7 +53,7 @@ ) ) -(defmethod reset! memory-usage-block ((this memory-usage-block)) +(defmethod reset! ((this memory-usage-block)) "Sets `length` to 0 as well as resets all fields except `name` in the associated [[memory-usage-info]]" (set! (-> this length) 0) (dotimes (idx 112) @@ -78,7 +78,7 @@ ) ) -(defmethod compute-memory-usage! level ((this level) (force? symbol)) +(defmethod compute-memory-usage! ((this level) (force? symbol)) "Calculates the memory usage of the level, returns and stores the [[memory-usage-block]] in `mem-usage-block` as well as the total size in `mem-usage` @@ -97,7 +97,7 @@ in `mem-usage-block` as well as the total size in `mem-usage` (-> this mem-usage-block) ) -(defmethod mem-usage process-tree ((this process-tree) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this process-tree) (arg0 memory-usage-block) (arg1 int)) (let ((v1-0 90)) (let* ((a0-1 *dead-pool-list*) (a3-0 (car a0-1)) @@ -310,7 +310,7 @@ in `mem-usage-block` as well as the total size in `mem-usage` (define *max-dma* 0) -(defmethod print-mem-usage memory-usage-block ((this memory-usage-block) (level level) (fmt-dest object)) +(defmethod print-mem-usage ((this memory-usage-block) (level level) (fmt-dest object)) (local-vars (sv-16 object) (sv-32 string) (sv-48 int)) (let ((s3-0 (&- (-> level heap current) (the-as uint (-> level heap base))))) (let ((v1-2 (+ (-> this data 61 total) (-> this data 62 total)))) diff --git a/goal_src/jak2/engine/debug/menu.gc b/goal_src/jak2/engine/debug/menu.gc index a00205bec93..d513a60d486 100644 --- a/goal_src/jak2/engine/debug/menu.gc +++ b/goal_src/jak2/engine/debug/menu.gc @@ -11,21 +11,18 @@ (declare-file (debug)) (deftype debug-menu-context (basic) - ((is-active symbol :offset-assert 4) - (sel-length int32 :offset-assert 8) - (sel-menu debug-menu 8 :offset-assert 12) - (root-menu debug-menu :offset-assert 44) - (joypad-func (function basic int none) :offset-assert 48) - (joypad-item basic :offset-assert 52) - (font font-context :offset-assert 56) - (is-hidden symbol :offset-assert 60) - (joypad-number int32 :offset-assert 64) + ((is-active symbol) + (sel-length int32) + (sel-menu debug-menu 8) + (root-menu debug-menu) + (joypad-func (function basic int none)) + (joypad-item basic) + (font font-context) + (is-hidden symbol) + (joypad-number int32) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) @@ -39,6 +36,7 @@ (set! (-> gp-0 joypad-func) #f) (set! (-> gp-0 joypad-item) #f) (set! (-> gp-0 font) + ;; og:preserve-this (new 'debug 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning pc-hack)) ) (set! (-> gp-0 joypad-number) 0) @@ -47,34 +45,28 @@ ) (deftype debug-menu-node (basic) - ((name string :offset-assert 4) - (parent debug-menu :offset-assert 8) - (refresh-delay int32 :offset-assert 12) - (refresh-ctr int32 :offset-assert 16) + ((name string) + (parent debug-menu) + (refresh-delay int32) + (refresh-ctr int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) -(defmethod print debug-menu-node ((this debug-menu-node)) +(defmethod print ((this debug-menu-node)) (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) this ) (deftype debug-menu (debug-menu-node) - ((context debug-menu-context :offset-assert 20) - (selected-item debug-menu-item :offset-assert 24) - (pix-width int32 :offset-assert 28) - (pix-height int32 :offset-assert 32) - (items pair :offset-assert 36) + ((context debug-menu-context) + (selected-item debug-menu-item) + (pix-width int32) + (pix-height int32) + (items pair) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 (:methods - (new (symbol type debug-menu-context string) _type_ 0) + (new (symbol type debug-menu-context string) _type_) ) ) @@ -91,22 +83,16 @@ ) (deftype debug-menu-item (debug-menu-node) - ((id int32 :offset-assert 20) + ((id int32) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype debug-menu-item-submenu (debug-menu-item) - ((submenu debug-menu :offset-assert 24) + ((submenu debug-menu) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c (:methods - (new (symbol type string debug-menu) _type_ 0) + (new (symbol type string debug-menu) _type_) ) ) @@ -124,14 +110,11 @@ ) (deftype debug-menu-item-function (debug-menu-item) - ((activate-func (function object object) :offset-assert 24) - (hilite-timer int8 :offset-assert 28) + ((activate-func (function object object)) + (hilite-timer int8) ) - :method-count-assert 9 - :size-assert #x1d - :flag-assert #x90000001d (:methods - (new (symbol type string object (function object object)) _type_ 0) + (new (symbol type string object (function object object)) _type_) ) ) @@ -150,14 +133,11 @@ ) (deftype debug-menu-item-flag (debug-menu-item) - ((activate-func (function object debug-menu-msg object) :offset-assert 24) - (is-on object :offset-assert 28) + ((activate-func (function object debug-menu-msg object)) + (is-on object) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 (:methods - (new (symbol type string object (function object debug-menu-msg object)) _type_ 0) + (new (symbol type string object (function object debug-menu-msg object)) _type_) ) ) @@ -182,38 +162,35 @@ ) (deftype debug-menu-item-var (debug-menu-item) - ((display-str string :offset-assert 24) - (grabbed-joypad-p symbol :offset-assert 28) - (float-p symbol :offset-assert 32) - (range-p symbol :offset-assert 36) - (show-len int32 :offset-assert 40) - (inc-delay int32 :offset-assert 44) - (inc-delay-ctr int32 :offset-assert 48) - (step-delay-ctr int32 :offset-assert 52) - (inc-dir int32 :offset-assert 56) - (fval float :offset-assert 60) - (fundo-val float :offset-assert 64) - (frange-min float :offset-assert 68) - (frange-max float :offset-assert 72) - (fstart-inc float :offset-assert 76) - (fstep float :offset-assert 80) - (fprecision int32 :offset-assert 84) - (factivate-func (function int debug-menu-msg float float float) :offset-assert 88) - (ival int32 :offset 60) - (iundo-val int32 :offset 64) - (irange-min int32 :offset 68) - (irange-max int32 :offset 72) - (istart-inc int32 :offset 76) - (istep int32 :offset 80) - (ihex-p symbol :offset-assert 92) - (iactivate-func (function int debug-menu-msg int int int) :offset 88) - (ifloat-p symbol :offset-assert 96) + ((display-str string) + (grabbed-joypad-p symbol) + (float-p symbol) + (range-p symbol) + (show-len int32) + (inc-delay int32) + (inc-delay-ctr int32) + (step-delay-ctr int32) + (inc-dir int32) + (fval float) + (fundo-val float) + (frange-min float) + (frange-max float) + (fstart-inc float) + (fstep float) + (fprecision int32) + (factivate-func (function int debug-menu-msg float float float)) + (ival int32 :overlay-at fval) + (iundo-val int32 :overlay-at fundo-val) + (irange-min int32 :overlay-at frange-min) + (irange-max int32 :overlay-at frange-max) + (istart-inc int32 :overlay-at fstart-inc) + (istep int32 :overlay-at fstep) + (ihex-p symbol) + (iactivate-func (function int debug-menu-msg int int int) :overlay-at factivate-func) + (ifloat-p symbol) ) - :method-count-assert 9 - :size-assert #x64 - :flag-assert #x900000064 (:methods - (new (symbol type string int int) _type_ 0) + (new (symbol type string int int) _type_) ) ) diff --git a/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc b/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc index 25337629852..f1c3a6b4d92 100644 --- a/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc +++ b/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc @@ -84,152 +84,128 @@ (declare-file (debug)) (deftype mysql-nav-node (structure) - ((mysql-save-flag mysql-save-flag :offset-assert 0) - (runtime-id uint32 :offset-assert 4) - (temp-edge-list (inline-array mysql-nav-edge) :offset-assert 8) - (level-node-index int32 :offset-assert 12) - (cam-dist float :offset-assert 16) - (visible symbol :offset-assert 20) - (nav_node_id uint32 :offset-assert 24) - (nav_graph_id uint32 :offset-assert 28) - (position vector :inline :offset-assert 32) - (level_name symbol :offset-assert 48) - (angle float :offset-assert 52) - (radius float :offset-assert 56) - (nav_node_flag nav-node-flag :offset-assert 60) - (nav_mesh_id uint32 :offset-assert 64) + ((mysql-save-flag mysql-save-flag) + (runtime-id uint32) + (temp-edge-list (inline-array mysql-nav-edge)) + (level-node-index int32) + (cam-dist float) + (visible symbol) + (nav_node_id uint32) + (nav_graph_id uint32) + (position vector :inline) + (level_name symbol) + (angle float) + (radius float) + (nav_node_flag nav-node-flag) + (nav_mesh_id uint32) ) :pack-me - :method-count-assert 11 - :size-assert #x44 - :flag-assert #xb00000044 (:methods - (exec-sql! (_type_) symbol 9) - (temp-edge-size (_type_) int 10) + (exec-sql! (_type_) symbol) + (temp-edge-size (_type_) int) ) ) (deftype mysql-nav-node-array (inline-array-class) - ((data mysql-nav-node :inline :dynamic :offset-assert 16) + ((data mysql-nav-node :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> mysql-nav-node-array heap-base) (the-as uint 80)) (deftype mysql-nav-edge (structure) - ((mysql-save-flag mysql-save-flag :offset-assert 0) - (runtime-id uint32 :offset-assert 4) - (runtime-node-id-1 int32 :offset-assert 8) - (runtime-node-id-2 int32 :offset-assert 12) - (temp-next-edge mysql-nav-edge :offset-assert 16) - (nav_edge_id uint32 :offset-assert 20) - (nav_graph_id uint32 :offset-assert 24) - (nav_node_id_1 uint32 :offset-assert 28) - (nav_node_id_2 uint32 :offset-assert 32) - (directionality nav-directionality :offset-assert 36) - (speed_limit float :offset-assert 40) - (density float :offset-assert 44) - (traffic_edge_flag int32 :offset-assert 48) - (nav_clock_mask nav-clock-mask :offset-assert 52) - (nav_clock_type nav-clock-type :offset-assert 56) - (width float :offset-assert 60) - (minimap_edge_flag nav-minimap-edge-flag :offset-assert 64) + ((mysql-save-flag mysql-save-flag) + (runtime-id uint32) + (runtime-node-id-1 int32) + (runtime-node-id-2 int32) + (temp-next-edge mysql-nav-edge) + (nav_edge_id uint32) + (nav_graph_id uint32) + (nav_node_id_1 uint32) + (nav_node_id_2 uint32) + (directionality nav-directionality) + (speed_limit float) + (density float) + (traffic_edge_flag int32) + (nav_clock_mask nav-clock-mask) + (nav_clock_type nav-clock-type) + (width float) + (minimap_edge_flag nav-minimap-edge-flag) ) :allow-misaligned - :method-count-assert 10 - :size-assert #x44 - :flag-assert #xa00000044 (:methods - (exec-sql! (_type_) symbol 9) + (exec-sql! (_type_) symbol) ) ) (deftype mysql-nav-edge-array (inline-array-class) - ((data mysql-nav-edge :inline :dynamic :offset-assert 16) + ((data mysql-nav-edge :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> mysql-nav-edge-array heap-base) (the-as uint 80)) (deftype mysql-nav-visnode (structure) - ((mysql-save-flag mysql-save-flag :offset-assert 0) - (runtime-node-id int32 :offset-assert 4) - (runtime-edge-id int32 :offset-assert 8) - (nav_visnode_id uint32 :offset-assert 12) - (nav_graph_id uint32 :offset-assert 16) - (nav_node_id uint32 :offset-assert 20) - (nav_edge_id uint32 :offset-assert 24) + ((mysql-save-flag mysql-save-flag) + (runtime-node-id int32) + (runtime-edge-id int32) + (nav_visnode_id uint32) + (nav_graph_id uint32) + (nav_node_id uint32) + (nav_edge_id uint32) ) - :method-count-assert 10 - :size-assert #x1c - :flag-assert #xa0000001c (:methods - (exec-sql! (_type_) symbol 9) + (exec-sql! (_type_) symbol) ) ) (deftype mysql-nav-visnode-array (inline-array-class) - ((data mysql-nav-visnode :inline :dynamic :offset-assert 16) + ((data mysql-nav-visnode :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> mysql-nav-visnode-array heap-base) (the-as uint 32)) (deftype mysql-nav-graph-level-info (structure) - ((level symbol :offset-assert 0) - (level-id uint32 :offset-assert 4) - (node-count int32 :offset-assert 8) - (branch-count int32 :offset-assert 12) - (to-link-count int32 :offset-assert 16) + ((level symbol) + (level-id uint32) + (node-count int32) + (branch-count int32) + (to-link-count int32) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype mysql-nav-graph (basic) - ((nav_graph_id uint32 :offset-assert 4) - (node-array mysql-nav-node-array :offset-assert 8) - (edge-array mysql-nav-edge-array :offset-assert 12) - (visnode-array mysql-nav-visnode-array :offset-assert 16) - (level-info-array-length int32 :offset-assert 20) - (level-info-last-lookup int32 :offset-assert 24) - (level-info-array mysql-nav-graph-level-info 32 :inline :offset-assert 28) + ((nav_graph_id uint32) + (node-array mysql-nav-node-array) + (edge-array mysql-nav-edge-array) + (visnode-array mysql-nav-visnode-array) + (level-info-array-length int32) + (level-info-last-lookup int32) + (level-info-array mysql-nav-graph-level-info 32 :inline) ) - :method-count-assert 21 - :size-assert #x41c - :flag-assert #x150000041c (:methods - (new (symbol type string) _type_ 0) - (init-from-sql! (_type_ string string) symbol 9) - (exec-sql! (_type_) symbol 10) - (indexof-nav-node (_type_ int) int 11) - (indexof-nav-edge (_type_ int) int 12) - (alloc-new-node! (_type_) int 13) - (alloc-new-edge! (_type_) int 14) - (indexof-visnode (_type_ int int) int 15) - (alloc-new-visnode! (_type_ int int) int 16) - (mysql-nav-graph-method-17 (_type_) none 17) - (lookup-level-info2 (_type_ mysql-nav-node symbol) mysql-nav-graph-level-info 18) - (mysql-nav-graph-method-19 (_type_) none 19) - (mysql-nav-graph-method-20 (_type_) none 20) + (new (symbol type string) _type_) + (init-from-sql! (_type_ string string) symbol) + (exec-sql! (_type_) symbol) + (indexof-nav-node (_type_ int) int) + (indexof-nav-edge (_type_ int) int) + (alloc-new-node! (_type_) int) + (alloc-new-edge! (_type_) int) + (indexof-visnode (_type_ int int) int) + (alloc-new-visnode! (_type_ int int) int) + (mysql-nav-graph-method-17 (_type_) none) + (lookup-level-info2 (_type_ mysql-nav-node symbol) mysql-nav-graph-level-info) + (mysql-nav-graph-method-19 (_type_) none) + (mysql-nav-graph-method-20 (_type_) none) ) ) @@ -260,7 +236,7 @@ ) ) -(defmethod alloc-new-node! mysql-nav-graph ((this mysql-nav-graph)) +(defmethod alloc-new-node! ((this mysql-nav-graph)) "Allocates a new `[[mysql-nav-node]]`, if `node-array`'s `length` exceeds `3000` return `-1` otherwise, return the new size of the array" (cond @@ -284,7 +260,7 @@ otherwise, return the new size of the array" ) ) -(defmethod alloc-new-edge! mysql-nav-graph ((this mysql-nav-graph)) +(defmethod alloc-new-edge! ((this mysql-nav-graph)) "Allocates a new `[[mysql-nav-edge]]`, if `edge-array`'s `length` exceeds `5000` return `-1` otherwise, return the new size of the array" (cond @@ -308,7 +284,7 @@ otherwise, return the new size of the array" ) ) -(defmethod indexof-visnode mysql-nav-graph ((this mysql-nav-graph) (edge-id int) (node-id int)) +(defmethod indexof-visnode ((this mysql-nav-graph) (edge-id int) (node-id int)) "Returns the index in the `visnode-array` whom's [[mysql-nav-visnode]] has the provided `runtime-edge-id` and `runtime-node-id` if none exist, return `-1`" (dotimes (v1-0 (-> this visnode-array length)) @@ -321,7 +297,7 @@ if none exist, return `-1`" -1 ) -(defmethod alloc-new-visnode! mysql-nav-graph ((this mysql-nav-graph) (edge-id int) (node-id int)) +(defmethod alloc-new-visnode! ((this mysql-nav-graph) (edge-id int) (node-id int)) "Potentially allocates a new `[[mysql-nav-visnode]]`: - if `visnode-array`'s `length` exceeds `3000` return `-1` - otherwise, if the node already exists, TODO @@ -356,7 +332,7 @@ if none exist, return `-1`" ) ) -(defmethod exec-sql! mysql-nav-node ((this mysql-nav-node)) +(defmethod exec-sql! ((this mysql-nav-node)) "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) (logtest? (-> this mysql-save-flag) (mysql-save-flag delete)) @@ -461,7 +437,7 @@ if none exist, return `-1`" #t ) -(defmethod exec-sql! mysql-nav-edge ((this mysql-nav-edge)) +(defmethod exec-sql! ((this mysql-nav-edge)) "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) (logtest? (-> this mysql-save-flag) (mysql-save-flag delete)) @@ -665,7 +641,7 @@ if none exist, return `-1`" #t ) -(defmethod exec-sql! mysql-nav-visnode ((this mysql-nav-visnode)) +(defmethod exec-sql! ((this mysql-nav-visnode)) "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) (logtest? (-> this mysql-save-flag) (mysql-save-flag delete)) @@ -719,7 +695,7 @@ if none exist, return `-1`" #t ) -(defmethod indexof-nav-node mysql-nav-graph ((this mysql-nav-graph) (node-id int)) +(defmethod indexof-nav-node ((this mysql-nav-graph) (node-id int)) "Iterate through the `node-array` and return the index for the first [[mysql-nav-node]] whom's `nav_node_id` matches the provided id returns `-1` if none is found" (dotimes (v1-0 (-> this node-array length)) @@ -730,7 +706,7 @@ returns `-1` if none is found" -1 ) -(defmethod indexof-nav-edge mysql-nav-graph ((this mysql-nav-graph) (edge-id int)) +(defmethod indexof-nav-edge ((this mysql-nav-graph) (edge-id int)) "Iterate through the `edge-array` and return the index for the first [[mysql-nav-edge]] whom's `nav_edge_id` matches the provided id returns `-1` if none is found" (dotimes (v1-0 (-> this edge-array length)) @@ -748,7 +724,7 @@ returns `-1` if none is found" ;; WARN: new jak 2 until loop case, check carefully ;; WARN: new jak 2 until loop case, check carefully ;; WARN: new jak 2 until loop case, check carefully -(defmethod init-from-sql! mysql-nav-graph ((this mysql-nav-graph) (arg0 string) (arg1 string)) +(defmethod init-from-sql! ((this mysql-nav-graph) (arg0 string) (arg1 string)) "Query the database and initialize the [[mysql-nav-graph]] and all it's related components" (local-vars (sv-16 string) (sv-32 int) (sv-48 int) (sv-64 int)) (set! (-> this node-array length) 0) @@ -1080,7 +1056,7 @@ returns `-1` if none is found" #t ) -(defmethod temp-edge-size mysql-nav-node ((this mysql-nav-node)) +(defmethod temp-edge-size ((this mysql-nav-node)) "Returns the number of [[mysql-nav-edge]] stored in the `temp-edge-list`" (let ((v0-0 0)) (let ((v1-0 (the-as object (-> this temp-edge-list)))) @@ -1093,7 +1069,7 @@ returns `-1` if none is found" ) ) -(defmethod mysql-nav-graph-method-17 mysql-nav-graph ((this mysql-nav-graph)) +(defmethod mysql-nav-graph-method-17 ((this mysql-nav-graph)) (dotimes (v1-0 (-> this node-array length)) (set! (-> (the-as mysql-nav-node (-> this node-array data v1-0)) temp-edge-list) (the-as (inline-array mysql-nav-edge) #f) @@ -1125,7 +1101,7 @@ returns `-1` if none is found" (none) ) -(defmethod lookup-level-info2 mysql-nav-graph ((this mysql-nav-graph) (arg0 mysql-nav-node) (arg1 symbol)) +(defmethod lookup-level-info2 ((this mysql-nav-graph) (arg0 mysql-nav-node) (arg1 symbol)) "TODO - this was originally called `lookup-level-info` but it clashes with the function defined in `level`" (let ((s5-0 (the-as mysql-nav-graph-level-info #f))) (b! (>= (-> this level-info-last-lookup) (-> this level-info-array-length)) cfg-3 :delay #f) @@ -1193,7 +1169,7 @@ returns `-1` if none is found" ) -(defmethod mysql-nav-graph-method-20 mysql-nav-graph ((this mysql-nav-graph)) +(defmethod mysql-nav-graph-method-20 ((this mysql-nav-graph)) (mysql-nav-graph-method-17 this) (mysql-nav-graph-method-19 this) 0 diff --git a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc index 49962abe95a..3b53d09b6d6 100644 --- a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc +++ b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc @@ -17,113 +17,105 @@ (declare-file (debug)) (deftype nav-graph-command (structure) - ((com-type uint32 :offset-assert 0) - (id int32 :offset-assert 4) - (index int32 :offset-assert 8) - (move-vec vector :inline :offset-assert 16) + ((com-type uint32) + (id int32) + (index int32) + (move-vec vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype nav-graph-command-array (inline-array-class) - ((data nav-graph-command :inline :dynamic :offset-assert 16) + ((data nav-graph-command :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> nav-graph-command-array heap-base) (the-as uint 32)) (deftype nav-graph-editor (process) - ((self nav-graph-editor :override) - (nav-graph mysql-nav-graph :offset-assert 128) - (mode symbol :offset-assert 132) - (command-id int32 :offset-assert 136) - (max-command int32 :offset-assert 140) - (selected-index int32 :offset-assert 144) - (selected-dist float :offset-assert 148) - (selected-node-edge? symbol :offset-assert 152) - (closest-node int32 :offset-assert 156) - (dist-closest-node float :offset-assert 160) - (closest-edge int32 :offset-assert 164) - (dist-closest-edge float :offset-assert 168) - (mouse-pos vector :inline :offset-assert 176) - (mouse-hit vector :inline :offset-assert 192) - (mouse-hit-pick vector :inline :offset-assert 208) - (mouse-normal vector :inline :offset-assert 224) - (mouse-spos-hold vector :inline :offset-assert 240) - (edge-src int32 :offset-assert 256) - (edge-dst int32 :offset-assert 260) - (edge-visibility int32 :offset-assert 264) - (vehicle-edit-mode symbol :offset-assert 268) - (hover-edit-mode symbol :offset-assert 272) - (clipping-dist float :offset-assert 276) - (plane-height float :offset-assert 280) - (plane-height-hold float :offset-assert 284) - (default-node mysql-nav-node :inline :offset-assert 288) - (default-edge mysql-nav-edge :inline :offset-assert 356) - (command-array nav-graph-command-array :offset-assert 424) + ((self nav-graph-editor :override) + (nav-graph mysql-nav-graph) + (mode symbol) + (command-id int32) + (max-command int32) + (selected-index int32) + (selected-dist float) + (selected-node-edge? symbol) + (closest-node int32) + (dist-closest-node float) + (closest-edge int32) + (dist-closest-edge float) + (mouse-pos vector :inline) + (mouse-hit vector :inline) + (mouse-hit-pick vector :inline) + (mouse-normal vector :inline) + (mouse-spos-hold vector :inline) + (edge-src int32) + (edge-dst int32) + (edge-visibility int32) + (vehicle-edit-mode symbol) + (hover-edit-mode symbol) + (clipping-dist float) + (plane-height float) + (plane-height-hold float) + (default-node mysql-nav-node :inline) + (default-edge mysql-nav-edge :inline) + (command-array nav-graph-command-array) ) - :heap-base #x130 - :method-count-assert 64 - :size-assert #x1ac - :flag-assert #x40013001ac + (:state-methods + move-node + move-plane + create + edit-edge + create-edge + adjust-plane + adjust-it + adjust-minimap + adjust-node-angle + adjust-node-radius + adjust-edge-visibility + adjust-edge-width + adjust-edge-density + draw-closest-minimap + ) (:methods - (move-node () _type_ :state 14) - (move-plane () _type_ :state 15) - (create () _type_ :state 16) - (edit-edge () _type_ :state 17) - (create-edge () _type_ :state 18) - (adjust-plane () _type_ :state 19) - (adjust-it () _type_ :state 20) - (adjust-minimap () _type_ :state 21) - (adjust-node-angle () _type_ :state 22) - (adjust-node-radius () _type_ :state 23) - (adjust-edge-visibility () _type_ :state 24) - (adjust-edge-width () _type_ :state 25) - (adjust-edge-density () _type_ :state 26) - (draw-closest-minimap () _type_ :state 27) - (nav-graph-editor-method-28 (_type_) none 28) - (nav-graph-editor-method-29 (_type_ string string string) none 29) - (nav-graph-editor-method-30 (_type_ int) symbol 30) - (nav-graph-editor-method-31 (_type_ int) symbol 31) - (nav-graph-editor-method-32 (_type_ symbol int) none 32) - (nav-graph-editor-method-33 (_type_ int) none 33) - (nav-graph-editor-method-34 (_type_) object 34) - (nav-graph-editor-method-35 (_type_) none 35) - (nav-graph-editor-method-36 (_type_) none 36) - (nav-graph-editor-method-37 (_type_) none 37) - (nav-graph-editor-method-38 (_type_) none 38) - (nav-graph-editor-method-39 (_type_) none 39) - (nav-graph-editor-method-40 (_type_) none 40) - (nav-graph-editor-method-41 (_type_) none 41) - (nav-graph-editor-method-42 (_type_) symbol 42) - (nav-graph-editor-method-43 (_type_) none 43) - (nav-graph-editor-method-44 (_type_) symbol 44) - (nav-graph-editor-method-45 (_type_) none 45) - (nav-graph-editor-method-46 (_type_) pad-buttons 46) - (nav-graph-editor-method-47 (_type_) none 47) - (nav-graph-editor-method-48 (_type_ uint) nav-graph-command 48) - (nav-graph-editor-method-49 (_type_) nav-graph-command 49) - (nav-graph-editor-method-50 (_type_) none 50) - (nav-graph-editor-method-51 (_type_) none 51) - (nav-graph-editor-method-52 (_type_) uint 52) - (nav-graph-editor-method-53 (_type_ int int) none 53) - (nav-graph-editor-method-54 (_type_ int) none 54) - (nav-graph-editor-method-55 (_type_ int) none 55) - (nav-graph-editor-method-56 (_type_ int) none 56) - (nav-graph-editor-method-57 (_type_ int int) int 57) - (nav-graph-editor-method-58 (_type_) symbol 58) - (nav-graph-editor-method-59 (_type_) pad-buttons 59) - (nav-graph-editor-method-60 (_type_) none 60) - (nav-graph-editor-method-61 (_type_) none 61) - (nav-graph-editor-method-62 (_type_ symbol symbol) none 62) - (nav-graph-editor-method-63 (_type_) none 63) + (nav-graph-editor-method-28 (_type_) none) + (nav-graph-editor-method-29 (_type_ string string string) none) + (nav-graph-editor-method-30 (_type_ int) symbol) + (nav-graph-editor-method-31 (_type_ int) symbol) + (nav-graph-editor-method-32 (_type_ symbol int) none) + (nav-graph-editor-method-33 (_type_ int) none) + (nav-graph-editor-method-34 (_type_) object) + (nav-graph-editor-method-35 (_type_) none) + (nav-graph-editor-method-36 (_type_) none) + (nav-graph-editor-method-37 (_type_) none) + (nav-graph-editor-method-38 (_type_) none) + (nav-graph-editor-method-39 (_type_) none) + (nav-graph-editor-method-40 (_type_) none) + (nav-graph-editor-method-41 (_type_) none) + (nav-graph-editor-method-42 (_type_) symbol) + (nav-graph-editor-method-43 (_type_) none) + (nav-graph-editor-method-44 (_type_) symbol) + (nav-graph-editor-method-45 (_type_) none) + (nav-graph-editor-method-46 (_type_) pad-buttons) + (nav-graph-editor-method-47 (_type_) none) + (nav-graph-editor-method-48 (_type_ uint) nav-graph-command) + (nav-graph-editor-method-49 (_type_) nav-graph-command) + (nav-graph-editor-method-50 (_type_) none) + (nav-graph-editor-method-51 (_type_) none) + (nav-graph-editor-method-52 (_type_) uint) + (nav-graph-editor-method-53 (_type_ int int) none) + (nav-graph-editor-method-54 (_type_ int) none) + (nav-graph-editor-method-55 (_type_ int) none) + (nav-graph-editor-method-56 (_type_ int) none) + (nav-graph-editor-method-57 (_type_ int int) int) + (nav-graph-editor-method-58 (_type_) symbol) + (nav-graph-editor-method-59 (_type_) pad-buttons) + (nav-graph-editor-method-60 (_type_) none) + (nav-graph-editor-method-61 (_type_) none) + (nav-graph-editor-method-62 (_type_ symbol symbol) none) + (nav-graph-editor-method-63 (_type_) none) ) ) @@ -131,7 +123,7 @@ (define *nav-graph-editor* (the-as (pointer nav-graph-editor) #f)) ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-62 nav-graph-editor ((this nav-graph-editor) (arg0 symbol) (arg1 symbol)) +(defmethod nav-graph-editor-method-62 ((this nav-graph-editor) (arg0 symbol) (arg1 symbol)) (case arg0 (('minimap) (set! (-> this vehicle-edit-mode) #t) @@ -150,24 +142,24 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-63 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-63 ((this nav-graph-editor)) (set! (-> this command-array length) 0) (exec-sql! (-> this nav-graph)) (none) ) -(defmethod deactivate nav-graph-editor ((this nav-graph-editor)) +(defmethod deactivate ((this nav-graph-editor)) (set! *nav-graph-editor* (the-as (pointer nav-graph-editor) #f)) ((method-of-type process deactivate) this) (none) ) -(defmethod relocate nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod relocate ((this nav-graph-editor) (arg0 int)) (call-parent-method this arg0) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-60 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-60 ((this nav-graph-editor)) (let ((v0-0 (not (-> this vehicle-edit-mode)))) (set! (-> this vehicle-edit-mode) v0-0) (set! (-> this default-node nav_node_flag) (if v0-0 @@ -180,14 +172,14 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-61 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-61 ((this nav-graph-editor)) (set! (-> this hover-edit-mode) (not (-> this hover-edit-mode))) (none) ) ;; WARN: Return type mismatch symbol vs none. ;; WARN: Function (method 54 nav-graph-editor) has a return type of none, but the expression builder found a return statement. -(defmethod nav-graph-editor-method-54 nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-54 ((this nav-graph-editor) (arg0 int)) (when (not (-> this hover-edit-mode)) (let ((gp-0 (-> this nav-graph node-array data arg0))) (dotimes (s5-0 (-> *level* length)) @@ -233,7 +225,7 @@ (none) ) -(defmethod nav-graph-editor-method-30 nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-30 ((this nav-graph-editor) (arg0 int)) (let ((s3-0 (-> this nav-graph edge-array data arg0)) (s4-0 (new 'stack-no-clear 'matrix)) ) @@ -330,7 +322,7 @@ #f ) -(defmethod nav-graph-editor-method-33 nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-33 ((this nav-graph-editor) (arg0 int)) (let* ((gp-0 (-> this nav-graph edge-array data arg0)) (s5-0 (-> this nav-graph node-array data (-> gp-0 runtime-node-id-1))) (s3-0 (-> this nav-graph node-array data (-> gp-0 runtime-node-id-2))) @@ -363,7 +355,7 @@ (none) ) -(defmethod nav-graph-editor-method-31 nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-31 ((this nav-graph-editor) (arg0 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -431,7 +423,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-29 nav-graph-editor ((this nav-graph-editor) (arg0 string) (arg1 string) (arg2 string)) +(defmethod nav-graph-editor-method-29 ((this nav-graph-editor) (arg0 string) (arg1 string) (arg2 string)) (format *stdcon* "~0K") ;; og:preserve-this (format *stdcon* "~%~%~3L~18S~18S~18S~%~0L" "Left button" "Middle button" "Right button") @@ -440,7 +432,7 @@ (none) ) -(defmethod nav-graph-editor-method-28 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-28 ((this nav-graph-editor)) (local-vars (sv-144 int) (sv-160 (function _varargs_ object))) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -608,7 +600,7 @@ ) ) -(defmethod nav-graph-editor-method-34 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-34 ((this nav-graph-editor)) (with-pp (rlet ((acc :class vf) (vf0 :class vf) @@ -910,12 +902,12 @@ ) ) -(defmethod nav-graph-editor-method-41 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-41 ((this nav-graph-editor)) (set! (-> this selected-index) -1) (none) ) -(defmethod nav-graph-editor-method-42 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-42 ((this nav-graph-editor)) (let ((s5-0 (-> this nav-graph))) (dotimes (s4-0 (-> s5-0 node-array length)) (let ((s3-0 (-> s5-0 node-array data s4-0))) @@ -952,7 +944,7 @@ #f ) -(defmethod nav-graph-editor-method-44 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-44 ((this nav-graph-editor)) (set! (-> this closest-node) -1) (set! (-> this dist-closest-node) 0.0) (let ((s5-0 (-> this nav-graph))) @@ -976,7 +968,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-45 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-45 ((this nav-graph-editor)) (set! (-> this closest-edge) -1) (set! (-> this dist-closest-edge) 0.0) (let ((s5-0 (-> this nav-graph))) @@ -1011,7 +1003,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-43 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-43 ((this nav-graph-editor)) (local-vars (sv-128 vector) (sv-144 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1086,7 +1078,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-32 nav-graph-editor ((this nav-graph-editor) (arg0 symbol) (arg1 int)) +(defmethod nav-graph-editor-method-32 ((this nav-graph-editor) (arg0 symbol) (arg1 int)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) @@ -1155,13 +1147,13 @@ ) ) -(defmethod nav-graph-editor-method-47 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-47 ((this nav-graph-editor)) (+! (-> this command-id) 1) (-> this command-id) (none) ) -(defmethod nav-graph-editor-method-48 nav-graph-editor ((this nav-graph-editor) (arg0 uint)) +(defmethod nav-graph-editor-method-48 ((this nav-graph-editor) (arg0 uint)) "TODO - enum / com-type" (let* ((v1-1 (-> this command-array length)) (v0-0 (-> this command-array data v1-1)) @@ -1174,18 +1166,18 @@ ) ) -(defmethod nav-graph-editor-method-49 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-49 ((this nav-graph-editor)) (-> this command-array data (+ (-> this command-array length) -1)) ) -(defmethod nav-graph-editor-method-50 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-50 ((this nav-graph-editor)) (+! (-> this command-array length) -1) (set! (-> this max-command) (-> this command-array length)) (none) ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod nav-graph-editor-method-58 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-58 ((this nav-graph-editor)) (if (zero? (-> this command-array length)) (return #f) ) @@ -1242,7 +1234,7 @@ #f ) -(defmethod nav-graph-editor-method-51 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-51 ((this nav-graph-editor)) (let ((gp-0 (alloc-new-node! (-> this nav-graph)))) (when (!= gp-0 -1) (let ((v1-6 (-> this nav-graph node-array data gp-0)) @@ -1261,7 +1253,7 @@ (none) ) -(defmethod nav-graph-editor-method-53 nav-graph-editor ((this nav-graph-editor) (arg0 int) (arg1 int)) +(defmethod nav-graph-editor-method-53 ((this nav-graph-editor) (arg0 int) (arg1 int)) (let ((s5-0 (indexof-visnode (-> this nav-graph) arg0 arg1))) (if (= s5-0 -1) (set! s5-0 (alloc-new-visnode! (-> this nav-graph) arg0 arg1)) @@ -1275,7 +1267,7 @@ ) ;; WARN: Return type mismatch int vs uint. -(defmethod nav-graph-editor-method-52 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-52 ((this nav-graph-editor)) (let ((gp-0 (alloc-new-edge! (-> this nav-graph)))) (when (!= gp-0 -1) (let ((v1-6 (-> this nav-graph edge-array data gp-0)) @@ -1298,7 +1290,7 @@ ) ) -(defmethod nav-graph-editor-method-57 nav-graph-editor ((this nav-graph-editor) (arg0 int) (arg1 int)) +(defmethod nav-graph-editor-method-57 ((this nav-graph-editor) (arg0 int) (arg1 int)) (case (indexof-visnode (-> this nav-graph) arg0 arg1) ((-1) (return (the-as int #f)) @@ -1314,7 +1306,7 @@ 0 ) -(defmethod nav-graph-editor-method-55 nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-55 ((this nav-graph-editor) (arg0 int)) (nav-graph-editor-method-47 this) (let ((s5-0 (-> this nav-graph node-array data arg0))) (logior! (-> s5-0 mysql-save-flag) (mysql-save-flag delete)) @@ -1344,7 +1336,7 @@ (none) ) -(defmethod nav-graph-editor-method-56 nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-56 ((this nav-graph-editor) (arg0 int)) (nav-graph-editor-method-47 this) (let ((s5-0 (-> this nav-graph edge-array data arg0))) (logior! (-> s5-0 mysql-save-flag) (mysql-save-flag delete)) @@ -1389,7 +1381,7 @@ (none) ) -(defmethod nav-graph-editor-method-59 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-59 ((this nav-graph-editor)) (if (cpad-pressed? 0 triangle) (nav-graph-editor-method-58 this) ) @@ -1400,7 +1392,7 @@ ) ) -(defmethod nav-graph-editor-method-46 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-46 ((this nav-graph-editor)) (if (cpad-pressed? 0 up) (go (method-of-object this create)) ) @@ -1427,7 +1419,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-35 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-35 ((this nav-graph-editor)) (nav-graph-editor-method-34 this) (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) (cond @@ -1531,7 +1523,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-38 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-38 ((this nav-graph-editor)) (nav-graph-editor-method-41 this) (nav-graph-editor-method-34 this) (nav-graph-editor-method-42 this) @@ -1616,7 +1608,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-37 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-37 ((this nav-graph-editor)) (nav-graph-editor-method-41 this) (nav-graph-editor-method-34 this) (nav-graph-editor-method-42 this) @@ -1799,7 +1791,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-39 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-39 ((this nav-graph-editor)) (nav-graph-editor-method-41 this) (nav-graph-editor-method-34 this) (nav-graph-editor-method-42 this) @@ -1858,7 +1850,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-40 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-40 ((this nav-graph-editor)) (nav-graph-editor-method-41 this) (nav-graph-editor-method-34 this) (nav-graph-editor-method-43 this) @@ -1956,7 +1948,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-36 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-36 ((this nav-graph-editor)) (nav-graph-editor-method-41 this) (nav-graph-editor-method-34 this) (nav-graph-editor-method-42 this) diff --git a/goal_src/jak2/engine/debug/part-tester.gc b/goal_src/jak2/engine/debug/part-tester.gc index 797ab5c54fb..a0404072f36 100644 --- a/goal_src/jak2/engine/debug/part-tester.gc +++ b/goal_src/jak2/engine/debug/part-tester.gc @@ -25,14 +25,10 @@ ) (deftype part-tester (process) - ((root trsqv :offset-assert 128) - (part sparticle-launch-control :offset-assert 132) - (old-group sparticle-launch-group :offset-assert 136) + ((root trsqv) + (part sparticle-launch-control) + (old-group sparticle-launch-group) ) - :heap-base #x10 - :method-count-assert 14 - :size-assert #x8c - :flag-assert #xe0010008c (:states part-tester-idle ) @@ -41,7 +37,7 @@ (define *part-tester-name* (the-as string #f)) -(defmethod deactivate part-tester ((this part-tester)) +(defmethod deactivate ((this part-tester)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) diff --git a/goal_src/jak2/engine/debug/stats-h.gc b/goal_src/jak2/engine/debug/stats-h.gc index 4a8fc41a284..f33c34850bc 100644 --- a/goal_src/jak2/engine/debug/stats-h.gc +++ b/goal_src/jak2/engine/debug/stats-h.gc @@ -65,56 +65,50 @@ ;; DECOMP BEGINS (deftype tr-stat (structure) - ((groups uint16 :offset-assert 0) - (fragments uint16 :offset-assert 2) - (tris uint32 :offset-assert 4) - (dverts uint32 :offset-assert 8) - (instances uint16 :offset-assert 12) - (pad uint16 :offset-assert 14) + ((groups uint16) + (fragments uint16) + (tris uint32) + (dverts uint32) + (instances uint16) + (pad uint16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype merc-global-stats (structure) - ((merc tr-stat :inline :offset-assert 0) - (emerc tr-stat :inline :offset-assert 16) - (mercneric tr-stat :inline :offset-assert 32) + ((merc tr-stat :inline) + (emerc tr-stat :inline) + (mercneric tr-stat :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype perf-stat (structure) - ((frame-number uint32 :offset-assert 0) - (count uint32 :offset-assert 4) - (cycles uint32 :offset-assert 8) - (instructions uint32 :offset-assert 12) - (icache uint32 :offset-assert 16) - (dcache uint32 :offset-assert 20) - (select uint32 :offset-assert 24) - (ctrl uint32 :offset-assert 28) - (accum0 uint32 :offset-assert 32) - (accum1 uint32 :offset-assert 36) - (to-vu0-waits uint32 :offset-assert 40) - (to-spr-waits uint32 :offset-assert 44) - (from-spr-waits uint32 :offset-assert 48) + ((frame-number uint32) + (count uint32) + (cycles uint32) + (instructions uint32) + (icache uint32) + (dcache uint32) + (select uint32) + (ctrl uint32) + (accum0 uint32) + (accum1 uint32) + (to-vu0-waits uint32) + (to-spr-waits uint32) + (from-spr-waits uint32) ) :pack-me - :method-count-assert 14 - :size-assert #x34 - :flag-assert #xe00000034 (:methods - (perf-stat-method-9 () none 9) - (print-to-stream (_type_ string basic) none 10) - (reset! (_type_) none 11) - (read! (_type_) none 12) - (update-wait-stats (_type_ uint uint uint) none 13) + (perf-stat-method-9 () none) + (print-to-stream (_type_ string basic) none) + (reset! (_type_) none) + (read! (_type_) none) + (update-wait-stats (_type_ uint uint uint) none) ) ) + (defun-debug perf-stat-bucket->string ((arg0 perf-stat-bucket)) (case arg0 (((perf-stat-bucket collide-fill)) @@ -276,13 +270,9 @@ ) ) -;; definition of type perf-stat-array (deftype perf-stat-array (inline-array-class) - ((data perf-stat :inline :dynamic :offset-assert 16) + ((data perf-stat :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type perf-stat-array @@ -300,9 +290,10 @@ ) (set! (-> perf-stat-array heap-base) (the-as uint 52)) +;; og:preserve-this (define *pc-perf-stat-counter* (the-as uint 0)) -(defmethod reset! perf-stat ((this perf-stat)) +(defmethod reset! ((this perf-stat)) ; (let ((v1-0 (-> this ctrl))) (+! (-> this count) 1) (when (nonzero? (-> this ctrl)) @@ -326,7 +317,7 @@ ) -(defmethod read! perf-stat ((this perf-stat)) +(defmethod read! ((this perf-stat)) ; (local-vars (v1-1 int) (v1-3 int)) ; (b! (zero? (-> this ctrl)) cfg-2 :delay (nop!)) (when (nonzero? (-> this ctrl)) @@ -344,9 +335,7 @@ (none) ) -;; definition for method 13 of type perf-stat -;; INFO: Return type mismatch int vs none. -(defmethod update-wait-stats perf-stat ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) +(defmethod update-wait-stats ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) (when (nonzero? (-> this ctrl)) (+! (-> this to-vu0-waits) arg0) (+! (-> this to-spr-waits) arg1) @@ -356,13 +345,8 @@ (none) ) -;; failed to figure out what this is: (when (not *debug-segment*) (set! (-> perf-stat method-table 11) nothing) (set! (-> perf-stat method-table 12) nothing) (set! (-> perf-stat method-table 13) nothing) ) - - - - diff --git a/goal_src/jak2/engine/debug/viewer.gc b/goal_src/jak2/engine/debug/viewer.gc index cf393c041a9..c304e160c45 100644 --- a/goal_src/jak2/engine/debug/viewer.gc +++ b/goal_src/jak2/engine/debug/viewer.gc @@ -17,12 +17,8 @@ ) (deftype viewer (process-drawable) - ((janim art-joint-anim :offset-assert 200) + ((janim art-joint-anim) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xcc - :flag-assert #x14005000cc (:states viewer-process ) @@ -206,7 +202,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! viewer ((this viewer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this viewer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/engine/dma/dma-buffer.gc b/goal_src/jak2/engine/dma/dma-buffer.gc index 9716f57ae5b..fedf0f823b3 100644 --- a/goal_src/jak2/engine/dma/dma-buffer.gc +++ b/goal_src/jak2/engine/dma/dma-buffer.gc @@ -32,50 +32,38 @@ note that the second vifcode can also hold other stuff depending on the mode. ;; Most DMA stuff goes directly to the VIF, so this is the ;; most common. (deftype dma-packet (structure) - ((dma dma-tag :offset-assert 0) - (vif0 vif-tag :offset-assert 8) - (vif1 vif-tag :offset-assert 12) - (quad uint128 :offset 0) + ((dma dma-tag) + (vif0 vif-tag) + (vif1 vif-tag) + (quad uint128 :overlay-at dma) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; seems to be unused? Also, it seems to be broken. Do not use this. (deftype dma-packet-array (inline-array-class) - ((data dma-packet :inline :dynamic :offset-assert 16) + ((data dma-packet :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> dma-packet-array heap-base) (the-as uint 16)) (deftype dma-gif (structure) - ((gif uint64 2 :offset-assert 0) - (quad uint128 :offset 0) + ((gif uint64 2) + (quad uint128 :overlay-at (-> gif 0)) ;; added these two - (gif0 uint64 :offset 0 :score 1) - (gif1 uint64 :offset 8 :score 1) + (gif0 uint64 :overlay-at (-> gif 0)) + (gif1 uint64 :overlay-at (-> gif 1)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; For doing a dma -> vif -> gif (path 2) transfer. (deftype dma-gif-packet (structure) - ((dma-vif dma-packet :inline :offset-assert 0) - (gif uint64 2 :offset-assert 16) - (gif0 uint64 :offset 16) ;; added - (gif1 uint64 :offset 24) ;; added - (quad uint128 2 :offset 0) + ((dma-vif dma-packet :inline) + (gif uint64 2) + (gif0 uint64 :overlay-at (-> gif 0)) ;; added + (gif1 uint64 :overlay-at (-> gif 1)) ;; added + (quad uint128 2 :overlay-at (-> dma-vif dma)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; dma-buffer is a dynamically sized container for storing DMA data. @@ -83,17 +71,14 @@ note that the second vifcode can also hold other stuff depending on the mode. ;; I added a data-buffer field that overlaps with data to get at the array of ;; bytes more easily. (deftype dma-buffer (basic) - ((allocated-length int32 :offset-assert 4) - (base pointer :offset-assert 8) - (end pointer :offset-assert 12) - (data uint64 1 :offset-assert 16) - (data-buffer uint8 :dynamic :offset 16) ;; the actual dynamic array backing it. + ((allocated-length int32) + (base pointer) + (end pointer) + (data uint64 1) + (data-buffer uint8 :dynamic :overlay-at (-> data 0)) ;; the actual dynamic array backing it. ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) @@ -114,12 +99,12 @@ note that the second vifcode can also hold other stuff depending on the mode. arg0 ) -(defmethod length dma-buffer ((this dma-buffer)) +(defmethod length ((this dma-buffer)) "Get the amount of data the buffer can hold, in bytes." (-> this allocated-length) ) -(defmethod asize-of dma-buffer ((this dma-buffer)) +(defmethod asize-of ((this dma-buffer)) "Get the size in memory of the object" (+ (-> this allocated-length) -4 (-> dma-buffer size)) ) diff --git a/goal_src/jak2/engine/dma/dma-disasm.gc b/goal_src/jak2/engine/dma/dma-disasm.gc index 2a8ea5e7f20..c94074826c4 100644 --- a/goal_src/jak2/engine/dma/dma-disasm.gc +++ b/goal_src/jak2/engine/dma/dma-disasm.gc @@ -11,19 +11,17 @@ Debug tool to print out a DMA list. ;; DECOMP BEGINS +;; this file is debug only (declare-file (debug)) (deftype vif-disasm-element (structure) - ((mask uint32 :offset-assert 0) - (tag vif-cmd-32 :offset-assert 4) - (val uint32 :offset-assert 8) - (print uint32 :offset-assert 12) - (string1 string :offset-assert 16) - (string2 string :offset-assert 20) + ((mask uint32) + (tag vif-cmd-32) + (val uint32) + (print uint32) + (string1 string) + (string2 string) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) @@ -308,6 +306,7 @@ Debug tool to print out a DMA list. ) ) +;; WARN: Return type mismatch object vs none. (defun disasm-dma-tag ((arg0 dma-tag) (arg1 symbol)) (format arg1 "(dma-tag ") (let ((t9-1 format) @@ -367,6 +366,7 @@ Debug tool to print out a DMA list. (define *dma-disasm* #t) +;; WARN: Check prologue - tricky store of a0 (defun disasm-dma-list ((arg0 dma-packet) (arg1 symbol) (arg2 symbol) (arg3 symbol) (arg4 int)) (local-vars (sv-16 object) @@ -580,6 +580,3 @@ Debug tool to print out a DMA list. ) ) ) - - - diff --git a/goal_src/jak2/engine/dma/dma-h.gc b/goal_src/jak2/engine/dma/dma-h.gc index aeb55dc08d1..c5f96b827c3 100644 --- a/goal_src/jak2/engine/dma/dma-h.gc +++ b/goal_src/jak2/engine/dma/dma-h.gc @@ -28,32 +28,23 @@ The code is organized into dma, dma-buffer, and dma-bucket (tte uint8 :offset 6 :size 1) ;; transfer tag (sc only) (tie uint8 :offset 7 :size 1) ;; tag interrupt (str uint8 :offset 8 :size 1) ;; start! - (tag uint16 :offset 16) + (tag uint16 :offset 16 :size 16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; Each DMA Channel has a bank of registers with the following layout. ;; Some channels have more advanced features, but all support at least these three. (deftype dma-bank (structure) - ((chcr dma-chcr :offset 0) ;; control register - (madr uint32 :offset 16) ;; memory address - (qwc uint32 :offset 32) ;; quadword count + ((chcr dma-chcr :offset 0) + (madr uint32 :offset 16) + (qwc uint32 :offset 32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; DMA register layout for channels supporting source-chain (deftype dma-bank-source (dma-bank) ((tadr uint32 :offset 48) ;; tag address ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; The DMA source chain supports a two-entry "call stack" of tags. @@ -62,9 +53,6 @@ The code is organized into dma, dma-buffer, and dma-bucket ((as0 uint32 :offset 64) ;; pushed tag register (as1 uint32 :offset 80) ;; pushed tag register ) - :method-count-assert 9 - :size-assert #x54 - :flag-assert #x900000054 ) ;; The toSPR and fromSPR DMA channels require a second address in the scratchpad. @@ -72,9 +60,6 @@ The code is organized into dma, dma-buffer, and dma-bucket (deftype dma-bank-spr (dma-bank-source) ((sadr uint32 :offset 128) ;; spad address. ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) ;; These addresses are the location of DMA banks for each channel. @@ -98,18 +83,12 @@ The code is organized into dma, dma-buffer, and dma-bucket (std uint8 :offset 6 :size 2) (rcyc uint8 :offset 8 :size 3) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; D_ENABLEW, D_ENABLER? (deftype dma-enable (uint32) ((cpnd uint8 :offset 16 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; D_SQWC @@ -117,46 +96,34 @@ The code is organized into dma, dma-buffer, and dma-bucket ((sqwc uint8 :offset 0 :size 8) (tqwc uint8 :offset 16 :size 8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; Shared DMA control registers. (deftype dma-bank-control (structure) - ((ctrl dma-ctrl :offset 0) - (stat uint32 :offset 16) - (pcr uint32 :offset 32) - (sqwc dma-sqwc :offset 48) - (rbsr uint32 :offset 64) - (rbor uint32 :offset 80) - (stadr uint32 :offset 96) - (enabler uint32 :offset 5408) - (enablew uint32 :offset 5520) + ((ctrl dma-ctrl :offset 0) + (stat uint32 :offset 16) + (pcr uint32 :offset 32) + (sqwc dma-sqwc :offset 48) + (rbsr uint32 :offset 64) + (rbor uint32 :offset 80) + (stadr uint32 :offset 96) + (enabler uint32 :offset 5408) + (enablew uint32 :offset 5520) ) - :method-count-assert 9 - :size-assert #x1594 - :flag-assert #x900001594 ) ;; Seems to be unused. The vu-function type is used instead. (deftype vu-code-block (basic) - ((name basic :offset-assert 4) - (code uint32 :offset-assert 8) - (size int32 :offset-assert 12) - (dest-address uint32 :offset-assert 16) + ((name basic) + (code uint32) + (size int32) + (dest-address uint32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; ?? not sure what this is. (deftype vu-stat (uint64) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (defenum dma-tag-id @@ -176,16 +143,13 @@ The code is organized into dma, dma-buffer, and dma-bucket ;; sizes, and the next thing to transfer. ;; A tag is 8 bytes. (deftype dma-tag (uint64) - ((qwc uint16 :offset 0) ;; quadword count - (pce uint8 :offset 26 :size 2) ;; priority (source mode) - (id dma-tag-id :offset 28 :size 3) ;; ID (what the tag means) - (irq uint8 :offset 31 :size 1) ;; interrupt at the end? - (addr uint32 :offset 32 :size 31) ;; address (31 bits) - (spr uint8 :offset 63 :size 1) ;; spr or not flag. + ((qwc uint16 :offset 0 :size 16) + (pce uint8 :offset 26 :size 2) + (id dma-tag-id :offset 28 :size 3) + (irq uint8 :offset 31 :size 1) + (addr uint32 :offset 32 :size 31) + (spr uint8 :offset 63 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -199,17 +163,14 @@ The code is organized into dma, dma-buffer, and dma-bucket ;; the addr field of their tag should point to the next bucket. ;; This is not a PS2 hardware thing (deftype dma-bucket (structure) - ((tag dma-tag :offset-assert 0) ;; the DMA tag to transfer the bucket's data - (last (pointer dma-tag) :offset-assert 8) ;; the last tag of this bucket. - (dummy uint32 :offset-assert 12) ;; empty space. - (next uint32 :offset 4) - (clear uint64 :offset 8) - (vif0 uint32 :offset 8) - (vif1 uint32 :offset 12) + ((tag dma-tag) ;; the DMA tag to transfer the bucket's data + (last (pointer dma-tag)) ;; the last tag of this bucket. + (dummy uint32) ;; empty space. + (next uint32 :offset 4) + (clear uint64 :overlay-at last) + (vif0 uint32 :overlay-at last) + (vif1 uint32 :overlay-at dummy) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; guess - VIF_MASK register? @@ -231,9 +192,6 @@ The code is organized into dma, dma-buffer, and dma-bucket (m14 uint8 :offset 28 :size 2) (m15 uint8 :offset 30 :size 2) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; the IMM field of a VIF STCYCL instruction @@ -241,9 +199,6 @@ The code is organized into dma, dma-buffer, and dma-bucket ((cl uint8 :offset 0 :size 8) (wl uint8 :offset 8 :size 8) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; the IMM field of a VIF UNPACK instruction @@ -252,9 +207,6 @@ The code is organized into dma, dma-buffer, and dma-bucket (usn uint8 :offset 14 :size 1) (flg uint8 :offset 15 :size 1) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; all these have mask (only applies to unpacks) and interrupt not set. @@ -317,9 +269,6 @@ The code is organized into dma, dma-buffer, and dma-bucket (irq uint8 :offset 31 :size 1) (msk uint8 :offset 28 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; The dma send functions are disabled in OpenGOAL. diff --git a/goal_src/jak2/engine/draw/draw-node-h.gc b/goal_src/jak2/engine/draw/draw-node-h.gc index 098dbebbbfc..23708a49988 100644 --- a/goal_src/jak2/engine/draw/draw-node-h.gc +++ b/goal_src/jak2/engine/draw/draw-node-h.gc @@ -8,30 +8,22 @@ ;; DECOMP BEGINS (deftype draw-node (drawable) - ((child-count uint8 :offset 6) - (flags uint8 :offset 7) - (child drawable :offset 8) - (distance float :offset 12) + ((child-count uint8 :offset 6) + (flags uint8 :offset 7) + (child drawable :offset 8) + (distance float :offset 12) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) + (deftype drawable-inline-array-node (drawable-inline-array) - ((data draw-node 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 64) + ((data draw-node 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 ) (deftype draw-node-dma (structure) - ((banka draw-node 32 :inline :offset-assert 0) - (bankb draw-node 32 :inline :offset-assert 1024) + ((banka draw-node 32 :inline) + (bankb draw-node 32 :inline) ) - :method-count-assert 9 - :size-assert #x800 - :flag-assert #x900000800 ) diff --git a/goal_src/jak2/engine/draw/drawable-actor-h.gc b/goal_src/jak2/engine/draw/drawable-actor-h.gc index b6b032c9f28..5d9fc25f427 100644 --- a/goal_src/jak2/engine/draw/drawable-actor-h.gc +++ b/goal_src/jak2/engine/draw/drawable-actor-h.gc @@ -8,31 +8,22 @@ ;; DECOMP BEGINS (deftype drawable-actor (drawable) - ((actor entity-actor :offset 8) + ((actor entity-actor :offset 8) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) (deftype drawable-tree-actor (drawable-tree) () - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) (deftype drawable-inline-array-actor (drawable-inline-array) - ((data drawable-actor 1 :inline :offset-assert 32) - (pad uint8 4 :offset-assert 64) + ((data drawable-actor 1 :inline) + (pad uint8 4) ) - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 ) -(defmethod draw drawable-tree-actor ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) 0 (none) ) diff --git a/goal_src/jak2/engine/draw/drawable-group-h.gc b/goal_src/jak2/engine/draw/drawable-group-h.gc index bdb7599da38..19aae24b735 100644 --- a/goal_src/jak2/engine/draw/drawable-group-h.gc +++ b/goal_src/jak2/engine/draw/drawable-group-h.gc @@ -8,13 +8,10 @@ ;; DECOMP BEGINS (deftype drawable-group (drawable) - ((length int16 :offset 6) - (data drawable :dynamic :offset-assert 32) + ((length int16 :offset 6) + (data drawable :dynamic) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) diff --git a/goal_src/jak2/engine/draw/drawable-group.gc b/goal_src/jak2/engine/draw/drawable-group.gc index 8d61c95ff8b..3f047b0e7ae 100644 --- a/goal_src/jak2/engine/draw/drawable-group.gc +++ b/goal_src/jak2/engine/draw/drawable-group.gc @@ -15,7 +15,7 @@ ) ) -(defmethod print drawable-group ((this drawable-group)) +(defmethod print ((this drawable-group)) (format #t "#<~A @ #x~X [~D]" (-> this type) this (-> this length)) (dotimes (idx (-> this length)) (format #t " ~A" (-> this data idx)) @@ -24,16 +24,16 @@ this ) -(defmethod length drawable-group ((this drawable-group)) +(defmethod length ((this drawable-group)) (-> this length) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of drawable-group ((this drawable-group)) +(defmethod asize-of ((this drawable-group)) (the-as int (+ (-> drawable-group size) (* (-> this length) 4))) ) -(defmethod mem-usage drawable-group ((this drawable-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) "drawable-group") (+! (-> arg0 data 0 count) 1) @@ -47,14 +47,14 @@ this ) -(defmethod login drawable-group ((this drawable-group)) +(defmethod login ((this drawable-group)) (dotimes (idx (-> this length)) (login (-> this data idx)) ) this ) -(defmethod draw drawable-group ((this drawable-group) (arg0 drawable-group) (arg1 display-frame)) +(defmethod draw ((this drawable-group) (arg0 drawable-group) (arg1 display-frame)) (when (vis-cull (-> this id)) (when (sphere-cull (-> this bsphere)) (dotimes (idx (-> this length)) @@ -66,7 +66,7 @@ (none) ) -(defmethod collect-stats drawable-group ((this drawable-group)) +(defmethod collect-stats ((this drawable-group)) (when (vis-cull (-> this id)) (when (sphere-cull (-> this bsphere)) (dotimes (idx (-> this length)) @@ -78,7 +78,7 @@ (none) ) -(defmethod debug-draw drawable-group ((this drawable-group) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-group) (arg0 drawable) (arg1 display-frame)) (when (vis-cull (-> this id)) (when (sphere-cull (-> this bsphere)) (dotimes (idx (-> this length)) @@ -90,7 +90,7 @@ (none) ) -(defmethod unpack-vis drawable-group ((this drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) (dotimes (idx (-> this length)) (set! arg1 (unpack-vis (-> this data idx) arg0 arg1)) ) diff --git a/goal_src/jak2/engine/draw/drawable-h.gc b/goal_src/jak2/engine/draw/drawable-h.gc index 6de5b9788b8..30649ed901d 100644 --- a/goal_src/jak2/engine/draw/drawable-h.gc +++ b/goal_src/jak2/engine/draw/drawable-h.gc @@ -37,29 +37,23 @@ ;; DECOMP BEGINS (deftype drawable (basic) - ((id int16 :offset-assert 4) - (bsphere vector :inline :offset-assert 16) + ((id int16) + (bsphere vector :inline) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 (:methods - (login (_type_) _type_ 9) - (draw (_type_ _type_ display-frame) none 10) - (fill-collide-list-from-box (_type_ int collide-list collide-query) int 11) - (fill-collide-list-from-line-sphere (_type_ int collide-list collide-query) int 12) - (collect-stats (_type_) none 13) - (debug-draw (_type_ drawable display-frame) none 14) - (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 15) - (collect-regions (_type_ sphere int region-prim-list) none 16) + (login (_type_) _type_) + (draw (_type_ _type_ display-frame) none) + (fill-collide-list-from-box (_type_ int collide-list collide-query) int) + (fill-collide-list-from-line-sphere (_type_ int collide-list collide-query) int) + (collect-stats (_type_) none) + (debug-draw (_type_ drawable display-frame) none) + (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8)) + (collect-regions (_type_ sphere int region-prim-list) none) ) ) (deftype drawable-error (drawable) - ((name string :offset-assert 32) + ((name string) ) - :method-count-assert 17 - :size-assert #x24 - :flag-assert #x1100000024 ) diff --git a/goal_src/jak2/engine/draw/drawable-inline-array-h.gc b/goal_src/jak2/engine/draw/drawable-inline-array-h.gc index 5c9ee323015..3b3f78a60ea 100644 --- a/goal_src/jak2/engine/draw/drawable-inline-array-h.gc +++ b/goal_src/jak2/engine/draw/drawable-inline-array-h.gc @@ -8,9 +8,6 @@ ;; DECOMP BEGINS (deftype drawable-inline-array (drawable) - ((length int16 :offset 6) + ((length int16 :offset 6) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) diff --git a/goal_src/jak2/engine/draw/drawable-inline-array.gc b/goal_src/jak2/engine/draw/drawable-inline-array.gc index 9d3468e7503..c12ec1aec4c 100644 --- a/goal_src/jak2/engine/draw/drawable-inline-array.gc +++ b/goal_src/jak2/engine/draw/drawable-inline-array.gc @@ -7,25 +7,25 @@ ;; DECOMP BEGINS -(defmethod length drawable-inline-array ((this drawable-inline-array)) +(defmethod length ((this drawable-inline-array)) (-> this length) ) -(defmethod login drawable-inline-array ((this drawable-inline-array)) +(defmethod login ((this drawable-inline-array)) this ) -(defmethod draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) +(defmethod draw ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) 0 (none) ) -(defmethod collect-stats drawable-inline-array ((this drawable-inline-array)) +(defmethod collect-stats ((this drawable-inline-array)) 0 (none) ) -(defmethod debug-draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame)) 0 (none) ) diff --git a/goal_src/jak2/engine/draw/drawable-tree-h.gc b/goal_src/jak2/engine/draw/drawable-tree-h.gc index 48bb5797a1f..7652f2c7ab8 100644 --- a/goal_src/jak2/engine/draw/drawable-tree-h.gc +++ b/goal_src/jak2/engine/draw/drawable-tree-h.gc @@ -5,17 +5,13 @@ ;; name in dgo: drawable-tree-h ;; dgos: ENGINE, GAME +;; DECOMP BEGINS + (deftype drawable-tree (drawable-group) () - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) (deftype drawable-tree-array (drawable-group) - ((trees drawable-tree :dynamic :offset 32) + ((trees drawable-tree :dynamic :offset 32) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) diff --git a/goal_src/jak2/engine/draw/drawable-tree.gc b/goal_src/jak2/engine/draw/drawable-tree.gc index 32bf7122b77..317af4b1917 100644 --- a/goal_src/jak2/engine/draw/drawable-tree.gc +++ b/goal_src/jak2/engine/draw/drawable-tree.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) (case (-> *level* draw-level *draw-index* display?) (('special #f) ) @@ -21,7 +21,7 @@ (none) ) -(defmethod collect-stats drawable-tree-array ((this drawable-tree-array)) +(defmethod collect-stats ((this drawable-tree-array)) (dotimes (idx (-> this length)) (collect-stats (-> this trees idx)) ) @@ -29,7 +29,7 @@ (none) ) -(defmethod debug-draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-array) (arg0 drawable) (arg1 display-frame)) (dotimes (idx (-> this length)) (debug-draw (-> this trees idx) (-> (the-as drawable-tree-array arg0) trees idx) arg1) ) @@ -37,7 +37,7 @@ (none) ) -(defmethod unpack-vis drawable-tree ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) (local-vars (t5-1 uint)) (let* ((v1-0 (the-as drawable-inline-array-node (-> this data 0))) (a3-1 (/ (-> v1-0 data 0 id) 8)) diff --git a/goal_src/jak2/engine/draw/drawable.gc b/goal_src/jak2/engine/draw/drawable.gc index 1a0aad5760c..589bede23e2 100644 --- a/goal_src/jak2/engine/draw/drawable.gc +++ b/goal_src/jak2/engine/draw/drawable.gc @@ -285,29 +285,29 @@ ;; Generally, you shouldn't call any of these unless you know the type and ;; what they will do. -(defmethod login drawable ((this drawable)) +(defmethod login ((this drawable)) "Initialize a drawable after load." this ) -(defmethod draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod draw ((this drawable) (arg0 drawable) (arg1 display-frame)) "Draw something. The meaning of this depends on the exact drawable class, but in general the heavy work isn't here - this just adds stuff to lists." 0 (none) ) -(defmethod fill-collide-list-from-box drawable ((this drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) +(defmethod fill-collide-list-from-box ((this drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) "Collect a list of collision meshes contained in the box." 0 ) -(defmethod fill-collide-list-from-line-sphere drawable ((this drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) +(defmethod fill-collide-list-from-line-sphere ((this drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) "Collect a list of collision meshes contained in 'line-sphere'." 0 ) -(defmethod collect-regions drawable ((this drawable) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions ((this drawable) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @@ -317,26 +317,26 @@ (none) ) -(defmethod collect-stats drawable ((this drawable)) +(defmethod collect-stats ((this drawable)) "Collect statistics for debugging" 0 (none) ) -(defmethod debug-draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable) (arg0 drawable) (arg1 display-frame)) "Draw debug visualizations" 0 (none) ) -(defmethod draw drawable-error ((this drawable-error) (arg0 drawable-error) (arg1 display-frame)) +(defmethod draw ((this drawable-error) (arg0 drawable-error) (arg1 display-frame)) "Draw a debug sphere." (error-sphere arg0 (-> arg0 name)) 0 (none) ) -(defmethod unpack-vis drawable ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) "Unpack vis data from arg1 to arg0, unpacking it. Return pointer to next thing." arg1 ) diff --git a/goal_src/jak2/engine/engine/connect.gc b/goal_src/jak2/engine/engine/connect.gc index dc78376ed89..fac9acdc453 100644 --- a/goal_src/jak2/engine/engine/connect.gc +++ b/goal_src/jak2/engine/engine/connect.gc @@ -70,11 +70,11 @@ A "connection" is really just a function that gets called when the engine runs, :size-assert #x20 :flag-assert #xe00000020 (:methods - (get-engine (connection) engine 9) - (get-process (connection) process 10) - (belongs-to-engine? (connection engine) symbol 11) - (belongs-to-process? (connection process) symbol 12) - (move-to-dead (connection) connection 13) + (get-engine (connection) engine) + (get-process (connection) process) + (belongs-to-engine? (connection engine) symbol) + (belongs-to-process? (connection process) symbol) + (move-to-dead (connection) connection) ) ) @@ -104,24 +104,24 @@ A "connection" is really just a function that gets called when the engine runs, :size-assert #x60 :flag-assert #x1a00000060 (:methods - (new (symbol type symbol int type) _type_ 0) - (inspect-all-connections (engine) engine 9) - (apply-to-connections (engine (function connectable none)) int 10) - (apply-to-connections-reverse (engine (function connectable none)) int 11) - (execute-connections (engine object) int 12) - (execute-connections-and-move-to-dead (engine object) int 13) - (execute-connections-if-needed (engine object) int 14) - (add-connection (engine process object object object object) connection 15) - (remove-from-process (engine process) int 16) - (remove-matching (engine (function connection engine symbol)) int 17) - (remove-all (engine) int 18) - (remove-by-param0 (engine object) int 19) - (remove-by-param1 (engine int) int 20) - (remove-by-param2 (engine int) int 21) - (get-first-connectable (engine) connectable 22) - (get-last-connectable (engine) connectable 23) - (get-next-connectable (_type_ connectable) connectable 24) - (get-prev-connectable (_type_ connectable) connectable 25) + (new (symbol type symbol int type) _type_) + (inspect-all-connections (engine) engine) + (apply-to-connections (engine (function connectable none)) int) + (apply-to-connections-reverse (engine (function connectable none)) int) + (execute-connections (engine object) int) + (execute-connections-and-move-to-dead (engine object) int) + (execute-connections-if-needed (engine object) int) + (add-connection (engine process object object object object) connection) + (remove-from-process (engine process) int) + (remove-matching (engine (function connection engine symbol)) int) + (remove-all (engine) int) + (remove-by-param0 (engine object) int) + (remove-by-param1 (engine int) int) + (remove-by-param2 (engine int) int) + (get-first-connectable (engine) connectable) + (get-last-connectable (engine) connectable) + (get-next-connectable (_type_ connectable) connectable) + (get-prev-connectable (_type_ connectable) connectable) ) ) @@ -609,13 +609,13 @@ A "connection" is really just a function that gets called when the engine runs, :size-assert #x20 :flag-assert #xf00000020 (:methods - (new (symbol type symbol int type) _type_ 0) - (schedule-callback (_type_ object time-frame) connection-pers 9) - (kill-callback (_type_ connection-pers) none 10) - (kill-by-key (_type_ object) none 11) - (kill-matching (_type_ (function engine-pers connection-pers object object symbol) object object) none 12) - (update-callback (_type_) none 13) - (run-pending-updates! (_type_ time-frame) none 14) + (new (symbol type symbol int type) _type_) + (schedule-callback (_type_ object time-frame) connection-pers) + (kill-callback (_type_ connection-pers) none) + (kill-by-key (_type_ object) none) + (kill-matching (_type_ (function engine-pers connection-pers object object symbol) object object) none) + (update-callback (_type_) none) + (run-pending-updates! (_type_ time-frame) none) ) ) diff --git a/goal_src/jak2/engine/entity/actor-link-h.gc b/goal_src/jak2/engine/entity/actor-link-h.gc index 61cda6c4eab..0eb153a904b 100644 --- a/goal_src/jak2/engine/entity/actor-link-h.gc +++ b/goal_src/jak2/engine/entity/actor-link-h.gc @@ -39,41 +39,38 @@ ) (deftype actor-link-info (basic) - ((process process :offset-assert 4) - (next entity-actor :offset-assert 8) - (prev entity-actor :offset-assert 12) + ((process process) + (next entity-actor) + (prev entity-actor) ) - :method-count-assert 26 - :size-assert #x10 - :flag-assert #x1a00000010 (:methods - (new (symbol type process symbol) _type_ 0) - (get-matching-actor-type-mask (_type_ type) int 9) - (actor-count-before (_type_) int 10) - (link-to-next-and-prev-actor (_type_) actor-link-info 11) - (get-next (_type_) entity-actor 12) - (get-prev (_type_) entity-actor 13) - (get-next-process (_type_) process 14) - (get-prev-process (_type_) process 15) - (apply-function-forward (_type_ (function entity-actor object object) object) int 16) - (apply-function-reverse (_type_ (function entity-actor object object) object) int 17) - (apply-all (_type_ (function entity-actor object object) object) int 18) - (send-to-all (_type_ symbol) none 19) - (send-to-all-after (_type_ symbol) object 20) - (send-to-all-before (_type_ symbol) object 21) - (send-to-next-and-prev (_type_ symbol) none 22) - (send-to-next (_type_ symbol) none 23) - (send-to-prev (_type_ symbol) none 24) - (actor-count (_type_) int 25) + (new (symbol type process symbol) _type_) + (get-matching-actor-type-mask (_type_ type) int) + (actor-count-before (_type_) int) + (link-to-next-and-prev-actor (_type_) actor-link-info) + (get-next (_type_) entity-actor) + (get-prev (_type_) entity-actor) + (get-next-process (_type_) process) + (get-prev-process (_type_) process) + (apply-function-forward (_type_ (function entity-actor object object) object) int) + (apply-function-reverse (_type_ (function entity-actor object object) object) int) + (apply-all (_type_ (function entity-actor object object) object) int) + (send-to-all (_type_ symbol) none) + (send-to-all-after (_type_ symbol) object) + (send-to-all-before (_type_ symbol) object) + (send-to-next-and-prev (_type_ symbol) none) + (send-to-next (_type_ symbol) none) + (send-to-prev (_type_ symbol) none) + (actor-count (_type_) int) ) ) -(defmethod next-actor entity-actor ((this entity-actor)) +(defmethod next-actor ((this entity-actor)) (entity-actor-lookup this 'next-actor 0) ) -(defmethod prev-actor entity-actor ((this entity-actor)) +(defmethod prev-actor ((this entity-actor)) (entity-actor-lookup this 'prev-actor 0) ) @@ -94,25 +91,25 @@ ) ) -(defmethod get-next actor-link-info ((this actor-link-info)) +(defmethod get-next ((this actor-link-info)) (-> this next) ) -(defmethod get-prev actor-link-info ((this actor-link-info)) +(defmethod get-prev ((this actor-link-info)) (-> this prev) ) ;; WARN: Return type mismatch basic vs process. -(defmethod get-next-process actor-link-info ((this actor-link-info)) +(defmethod get-next-process ((this actor-link-info)) (the-as process (and (-> this next) (-> this next extra process))) ) ;; WARN: Return type mismatch basic vs process. -(defmethod get-prev-process actor-link-info ((this actor-link-info)) +(defmethod get-prev-process ((this actor-link-info)) (the-as process (and (-> this prev) (-> this prev extra process))) ) -(defmethod link-to-next-and-prev-actor actor-link-info ((this actor-link-info)) +(defmethod link-to-next-and-prev-actor ((this actor-link-info)) (let ((a0-1 (-> this process entity))) (set! (-> this next) (entity-actor-lookup a0-1 'next-actor 0)) ) @@ -122,7 +119,7 @@ this ) -(defmethod apply-function-forward actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) +(defmethod apply-function-forward ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) (let ((s3-0 (-> this next))) (while s3-0 (if (arg0 s3-0 arg1) @@ -134,7 +131,7 @@ 0 ) -(defmethod apply-function-reverse actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) +(defmethod apply-function-reverse ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) (let ((s3-0 (-> this prev))) (while s3-0 (if (arg0 s3-0 arg1) @@ -146,7 +143,7 @@ 0 ) -(defmethod apply-all actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) +(defmethod apply-all ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) (let ((s4-0 (-> this process entity))) (while (let ((a0-2 s4-0)) (entity-actor-lookup a0-2 'prev-actor 0) @@ -165,7 +162,7 @@ 0 ) -(defmethod send-to-all-after actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-all-after ((this actor-link-info) (arg0 symbol)) (with-pp (let ((s4-0 (-> this next)) (s5-0 (the-as object #f)) @@ -188,7 +185,7 @@ ) ) -(defmethod send-to-all-before actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-all-before ((this actor-link-info) (arg0 symbol)) (with-pp (let ((s4-0 (-> this prev)) (s5-0 (the-as object #f)) @@ -212,7 +209,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-next actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-next ((this actor-link-info) (arg0 symbol)) (let ((a0-1 (-> this next))) (when a0-1 (let ((a0-2 (-> a0-1 extra process))) @@ -226,7 +223,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-prev actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-prev ((this actor-link-info) (arg0 symbol)) (let ((a0-1 (-> this prev))) (when a0-1 (let ((a0-2 (-> a0-1 extra process))) @@ -240,20 +237,20 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-next-and-prev actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-next-and-prev ((this actor-link-info) (arg0 symbol)) (send-to-next this arg0) (send-to-prev this arg0) (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-all actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-all ((this actor-link-info) (arg0 symbol)) (send-to-all-after this arg0) (send-to-all-before this arg0) (none) ) -(defmethod actor-count actor-link-info ((this actor-link-info)) +(defmethod actor-count ((this actor-link-info)) (let ((s5-0 (-> this process entity)) (gp-0 0) ) @@ -272,7 +269,7 @@ ) ) -(defmethod get-matching-actor-type-mask actor-link-info ((this actor-link-info) (arg0 type)) +(defmethod get-matching-actor-type-mask ((this actor-link-info) (arg0 type)) (let ((s3-0 (-> this process entity)) (s5-0 0) ) @@ -296,7 +293,7 @@ ) ) -(defmethod actor-count-before actor-link-info ((this actor-link-info)) +(defmethod actor-count-before ((this actor-link-info)) (let* ((s5-0 (-> this process entity)) (s4-0 s5-0) (gp-0 0) diff --git a/goal_src/jak2/engine/entity/entity-h.gc b/goal_src/jak2/engine/entity/entity-h.gc index c9831dc2285..62a7f15f9f9 100644 --- a/goal_src/jak2/engine/entity/entity-h.gc +++ b/goal_src/jak2/engine/entity/entity-h.gc @@ -69,187 +69,148 @@ (define *generate-actor-vis-output* #f) (deftype entity-perm (structure) - ((user-object object 2 :offset-assert 0) - (user-uint64 uint64 :offset 0) - (user-float float 2 :offset 0) - (user-int32 int32 2 :offset 0) - (user-uint32 uint32 2 :offset 0) - (user-int16 int16 4 :offset 0) - (user-uint16 uint16 4 :offset 0) - (user-int8 int8 8 :offset 0) - (user-uint8 uint8 8 :offset 0) - (status entity-perm-status :offset 8) - (dummy uint8 1 :offset 10) - (task game-task :offset 11) - (aid actor-id :offset 12) - (quad uint128 :offset 0) + ((user-object object 2) + (user-uint64 uint64 :overlay-at (-> user-object 0)) + (user-float float 2 :overlay-at (-> user-object 0)) + (user-int32 int32 2 :overlay-at (-> user-object 0)) + (user-uint32 uint32 2 :overlay-at (-> user-object 0)) + (user-int16 int16 4 :overlay-at (-> user-object 0)) + (user-uint16 uint16 4 :overlay-at (-> user-object 0)) + (user-int8 int8 8 :overlay-at (-> user-object 0)) + (user-uint8 uint8 8 :overlay-at (-> user-object 0)) + (status entity-perm-status :offset 8) + (dummy uint8 1 :offset 10) + (task game-task :offset 11) + (aid actor-id :offset 12) + (quad uint128 :overlay-at (-> user-object 0)) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (update (_type_ symbol entity-perm-status) _type_ 9) + (update (_type_ symbol entity-perm-status) _type_) ) ) (deftype entity-links (structure) - ((prev-link entity-links :offset-assert 0) - (next-link entity-links :offset-assert 4) - (entity entity :offset-assert 8) - (process process :offset-assert 12) - (level level :offset-assert 16) - (vis-id int32 :offset-assert 20) - (kill-mask task-mask :offset-assert 24) - (vis-dist meters :offset-assert 28) - (trans vector :inline :offset-assert 32) - (perm entity-perm :inline :offset-assert 48) - (status uint16 :offset 56) - (aid uint32 :offset 60) - (task uint8 :offset 59) + ((prev-link entity-links) + (next-link entity-links) + (entity entity) + (process process) + (level level) + (vis-id int32) + (kill-mask task-mask) + (vis-dist meters) + (trans vector :inline) + (perm entity-perm :inline) + (status uint16 :overlay-at (-> perm status)) + (aid uint32 :overlay-at (-> perm aid)) + (task uint8 :overlay-at (-> perm task)) ) - :method-count-assert 10 - :size-assert #x40 - :flag-assert #xa00000040 (:methods - (birth? (_type_ vector) symbol 9) + (birth? (_type_ vector) symbol) ) ) (deftype entity-perm-array (inline-array-class) - ((data entity-perm :inline :dynamic :offset-assert 16) + ((data entity-perm :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> entity-perm-array heap-base) (the-as uint 16)) (deftype entity-links-array (inline-array-class) - ((data entity-links :inline :dynamic :offset-assert 16) + ((data entity-links :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> entity-links-array heap-base) (the-as uint 64)) (deftype entity (res-lump) - ((trans vector :inline :offset-assert 32) - (aid uint32 :offset-assert 48) + ((trans vector :inline) + (aid uint32) ) - :method-count-assert 27 - :size-assert #x34 - :flag-assert #x1b00000034 (:methods - (birth! (_type_) _type_ 22) - (kill! (_type_) _type_ 23) - (add-to-level! (_type_ level-group level actor-id) none 24) - (remove-from-level! (_type_ level-group) _type_ 25) - (get-level (_type_) level 26) + (birth! (_type_) _type_) + (kill! (_type_) _type_) + (add-to-level! (_type_ level-group level actor-id) none) + (remove-from-level! (_type_ level-group) _type_) + (get-level (_type_) level) ) ) (deftype entity-camera (entity) - ((connect connectable :inline :offset-assert 64) + ((connect connectable :inline) ) - :method-count-assert 27 - :size-assert #x50 - :flag-assert #x1b00000050 ) (deftype entity-nav-mesh (entity) - ((nav-mesh nav-mesh :offset-assert 52) + ((nav-mesh nav-mesh) ) - :method-count-assert 29 - :size-assert #x38 - :flag-assert #x1d00000038 (:methods - (initialize-nav-mesh! (_type_) none 27) - (debug-draw (_type_) none 28) + (initialize-nav-mesh! (_type_) none) + (debug-draw (_type_) none) ) ) (deftype entity-race-mesh (entity) - ((race-mesh race-mesh :offset-assert 52) + ((race-mesh race-mesh) ) - :method-count-assert 29 - :size-assert #x38 - :flag-assert #x1d00000038 (:methods - (entity-race-mesh-method-27 () none 27) - (entity-race-mesh-method-28 () none 28) + (entity-race-mesh-method-27 () none) + (entity-race-mesh-method-28 () none) ) ) (deftype entity-actor (entity) - ((etype type :offset 56) - (task game-task :offset-assert 60) - (kill-mask task-mask :offset 52) - (vis-id int16 :offset-assert 62) - (quat quaternion :inline :offset-assert 64) + ((etype type :offset 56) + (task game-task) + (kill-mask task-mask :offset 52) + (vis-id int16) + (quat quaternion :inline) ) - :method-count-assert 33 - :size-assert #x50 - :flag-assert #x2100000050 (:methods - (next-actor (_type_) entity-actor 27) - (prev-actor (_type_) entity-actor 28) - (debug-print (_type_ symbol type) none 29) - (toggle-status (_type_ entity-perm-status symbol) none 30) - (get-simple-travel-vector (_type_ vector vector vector object float) nav-mesh 31) - (project-point-to-nav-mesh (_type_ vector vector nav-poly float) nav-poly 32) + (next-actor (_type_) entity-actor) + (prev-actor (_type_) entity-actor) + (debug-print (_type_ symbol type) none) + (toggle-status (_type_ entity-perm-status symbol) none) + (get-simple-travel-vector (_type_ vector vector vector object float) nav-mesh) + (project-point-to-nav-mesh (_type_ vector vector nav-poly float) nav-poly) ) ) (deftype actor-reference (structure) - ((actor entity :offset-assert 0) - (id uint32 :offset-assert 4) + ((actor entity) + (id uint32) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype actor-group (inline-array-class) - ((data actor-reference :inline :dynamic :offset-assert 16) + ((data actor-reference :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> actor-group heap-base) (the-as uint 8)) (deftype entity-info (basic) - ((ptype type :offset-assert 4) - (package string :offset-assert 8) - (art-group pair :offset-assert 12) - (pool symbol :offset-assert 16) - (heap-size int32 :offset-assert 20) + ((ptype type) + (package string) + (art-group pair) + (pool symbol) + (heap-size int32) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype actor-bank (basic) - ((pause-dist meters :offset-assert 4) - (birth-dist meters :offset-assert 8) - (birth-max int32 :offset-assert 12) + ((pause-dist meters) + (birth-dist meters) + (birth-max int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) diff --git a/goal_src/jak2/engine/entity/entity.gc b/goal_src/jak2/engine/entity/entity.gc index 2b73e861a23..c6847600339 100644 --- a/goal_src/jak2/engine/entity/entity.gc +++ b/goal_src/jak2/engine/entity/entity.gc @@ -18,7 +18,7 @@ (define *vis-actors* #t) ;; WARN: Return type mismatch int vs drawable-actor. -(defmethod mem-usage drawable-actor ((this drawable-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 44 (-> arg0 length))) (set! (-> arg0 data 43 name) "entity") (+! (-> arg0 data 43 count) 1) @@ -31,7 +31,7 @@ ) ;; WARN: Return type mismatch int vs drawable-inline-array-actor. -(defmethod mem-usage drawable-inline-array-actor ((this drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -45,12 +45,12 @@ (the-as drawable-inline-array-actor 0) ) -(defmethod print entity-links ((this entity-links)) +(defmethod print ((this entity-links)) (format #t "#" (-> this process) this) this ) -(defmethod print entity-perm ((this entity-perm)) +(defmethod print ((this entity-perm)) (format #t "#" @@ -63,7 +63,7 @@ this ) -(defmethod print actor-group ((this actor-group)) +(defmethod print ((this actor-group)) (format #t "# this length)) (format #t " ~A" (-> this data s5-0 actor)) @@ -73,22 +73,22 @@ ) -(defmethod birth! entity ((this entity)) +(defmethod birth! ((this entity)) (format #t "birth ~A~%" this) this ) -(defmethod kill! entity ((this entity)) +(defmethod kill! ((this entity)) (format #t "kill ~A~%" this) this ) -(defmethod print entity ((this entity)) +(defmethod print ((this entity)) (format #t "#<~A :name ~S @ #x~X>" (-> this type) (res-lump-struct this 'name structure) this) this ) -(defmethod get-level entity ((this entity)) +(defmethod get-level ((this entity)) (dotimes (v1-0 (-> *level* length)) (let ((a1-3 (-> *level* level v1-0))) (when (= (-> a1-3 status) 'active) @@ -238,7 +238,7 @@ ) ) -(defmethod update-nav-meshes-method level-group ((this level-group)) +(defmethod update-nav-meshes-method ((this level-group)) "Clashes with a function name" (when (not (paused?)) (dotimes (s5-0 (-> this length)) @@ -498,13 +498,19 @@ (-> arg0 level task-mask) ) -(defmethod print process ((this process)) +(defmethod print ((this process)) (cond ((and (-> this top-thread) (!= (-> this status) 'dead)) - (format #t "#<~A ~S ~A :state ~S :flags " (-> this type) (-> this name) (-> this status) (if (-> this state) - (-> this state name) - ) - ) + (format + #t + "#<~A ~S ~A :state ~S :flags " + (-> this type) + (-> this name) + (-> this status) + (if (-> this state) + (-> this state name) + ) + ) (process-status-bits this #t) (format #t @@ -537,7 +543,7 @@ ;; WARN: Return type mismatch entity-actor vs none. -(defmethod debug-print entity-actor ((this entity-actor) (arg0 symbol) (arg1 type)) +(defmethod debug-print ((this entity-actor) (arg0 symbol) (arg1 type)) (let ((s4-0 (-> this etype))) (when (or (not arg1) (and s4-0 (valid? s4-0 type (the-as string #f) #f 0) (type-type? s4-0 arg1))) (format #t "~5D #x~8X ~-26S" (-> this extra vis-id) this (res-lump-struct this 'name structure)) @@ -609,7 +615,7 @@ (none) ) -(defmethod debug-print-entities level-group ((this level-group) (arg0 symbol) (arg1 type)) +(defmethod debug-print-entities ((this level-group) (arg0 symbol) (arg1 type)) (let ((t9-0 format) (a0-1 #t) (a1-1 @@ -647,7 +653,7 @@ ) ;; WARN: Return type mismatch entity-actor vs none. -(defmethod add-to-level! entity-actor ((this entity-actor) (arg0 level-group) (arg1 level) (arg2 actor-id)) +(defmethod add-to-level! ((this entity-actor) (arg0 level-group) (arg1 level) (arg2 actor-id)) (let ((v1-4 (-> arg1 entity data (-> arg1 entity length)))) (+! (-> arg1 entity length) 1) (set! (-> v1-4 process) #f) @@ -718,7 +724,7 @@ (none) ) -(defmethod remove-from-level! entity ((this entity) (arg0 level-group)) +(defmethod remove-from-level! ((this entity) (arg0 level-group)) (let ((v1-0 (-> this extra))) (cond ((= (-> v1-0 next-link) v1-0) @@ -753,7 +759,7 @@ (none) ) -(defmethod update-vis-volumes level-group ((this level-group)) +(defmethod update-vis-volumes ((this level-group)) (local-vars (sv-16 pointer) (sv-20 pointer) (sv-24 pointer) (sv-28 process)) (dotimes (s5-0 (-> this length)) (let ((v1-3 (-> this level s5-0))) @@ -811,7 +817,7 @@ (none) ) -(defmethod update-vis-volumes-from-nav-mesh level-group ((this level-group)) +(defmethod update-vis-volumes-from-nav-mesh ((this level-group)) (local-vars (sv-16 pointer) (sv-20 vector) @@ -908,7 +914,7 @@ (none) ) -(defmethod print-volume-sizes level-group ((this level-group)) +(defmethod print-volume-sizes ((this level-group)) (local-vars (sv-16 pointer) (sv-20 float) @@ -1008,14 +1014,11 @@ ) (deftype debug-actor-info (basic) - ((name basic :offset-assert 4) - (handle handle :offset-assert 8) - (process basic :offset-assert 16) - (pid int32 :offset-assert 20) + ((name basic) + (handle handle) + (process basic) + (pid int32) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) @@ -1193,7 +1196,7 @@ (none) ) -(defmethod debug-draw-actors level-group ((this level-group) (arg0 symbol)) +(defmethod debug-draw-actors ((this level-group) (arg0 symbol)) (local-vars (sv-16 symbol) (sv-20 vector) @@ -1572,12 +1575,12 @@ (none) ) -(defmethod birth! entity-camera ((this entity-camera)) +(defmethod birth! ((this entity-camera)) (add-connection *camera-engine* *camera* nothing this #f #f) this ) -(defmethod kill! entity-camera ((this entity-camera)) +(defmethod kill! ((this entity-camera)) (remove-by-param1 *camera-engine* (the-as int this)) this ) @@ -1592,7 +1595,7 @@ (none) ) -(defmethod birth! entity-actor ((this entity-actor)) +(defmethod birth! ((this entity-actor)) (let* ((s5-0 (-> this etype)) (v1-0 (entity-info-lookup s5-0)) (s4-0 (get-process *default-dead-pool* s5-0 (if v1-0 @@ -1634,7 +1637,7 @@ (none) ) -(defmethod kill! entity-actor ((this entity-actor)) +(defmethod kill! ((this entity-actor)) (let ((a0-1 (-> this extra process))) (if a0-1 (deactivate a0-1) @@ -1647,7 +1650,7 @@ ;; WARN: Return type mismatch bsp-header vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 s5, Count] ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod birth bsp-header ((this bsp-header)) +(defmethod birth ((this bsp-header)) (local-vars (v1-74 int) (s5-0 int) (sv-16 int)) (.mfc0 s5-0 Count) (let ((a2-0 (if (nonzero? (-> this actors)) @@ -1824,7 +1827,7 @@ ) ;; WARN: Return type mismatch bsp-header vs none. -(defmethod deactivate-entities bsp-header ((this bsp-header)) +(defmethod deactivate-entities ((this bsp-header)) (let ((v1-1 (-> this level heap base)) (a0-2 (-> this level heap top-base)) ) @@ -1928,26 +1931,26 @@ (none) ) -(defmethod update entity-perm ((this entity-perm) (arg0 symbol) (arg1 entity-perm-status)) +(defmethod update ((this entity-perm) (arg0 symbol) (arg1 entity-perm-status)) (cond ((= arg0 'game) (logclear! (-> this status) arg1) ) ((task-complete? *game-info* (-> this task)) (logclear! (-> this status) (logior (if (logtest? (-> this status) (entity-perm-status bit-4)) - 524 - 0 - ) - 515 - ) + 524 + 0 + ) + 515 + ) ) ) (else (logclear! (-> this status) (logior arg1 (if (logtest? (-> this status) (entity-perm-status bit-4)) - 524 - 0 - ) - ) + 524 + 0 + ) + ) ) ) ) @@ -2059,7 +2062,7 @@ (none) ) -(defmethod run-logic? process-drawable ((this process-drawable)) +(defmethod run-logic? ((this process-drawable)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) (vector-vector-distance (-> this root trans) (math-camera-pos)) @@ -2070,7 +2073,7 @@ ) ) -(defmethod birth? entity-links ((this entity-links) (arg0 vector)) +(defmethod birth? ((this entity-links) (arg0 vector)) (and (not (logtest? (-> this perm status) (entity-perm-status bit-0 dead))) (< (vector-vector-distance (-> this trans) arg0) (-> *ACTOR-bank* birth-dist)) ) @@ -2081,7 +2084,7 @@ ;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 ;; WARN: Function (method 17 level-group) has a return type of none, but the expression builder found a return statement. -(defmethod actors-update level-group ((this level-group)) +(defmethod actors-update ((this level-group)) (local-vars (sv-16 vector) (sv-24 int) @@ -2332,7 +2335,7 @@ ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod toggle-status entity-actor ((this entity-actor) (arg0 entity-perm-status) (arg1 symbol)) +(defmethod toggle-status ((this entity-actor) (arg0 entity-perm-status) (arg1 symbol)) (let ((v1-0 (-> this extra))) (if arg1 (logior! (-> v1-0 perm status) arg0) diff --git a/goal_src/jak2/engine/entity/relocate.gc b/goal_src/jak2/engine/entity/relocate.gc index 721d0e540ae..759a08aceb1 100644 --- a/goal_src/jak2/engine/entity/relocate.gc +++ b/goal_src/jak2/engine/entity/relocate.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod relocate process ((this process) (arg0 int)) +(defmethod relocate ((this process) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -99,13 +99,13 @@ (&+ this arg0) ) -(defmethod relocate cpu-thread ((this cpu-thread) (arg0 int)) +(defmethod relocate ((this cpu-thread) (arg0 int)) (&+! (-> this process) arg0) this ) ;; WARN: Return type mismatch process vs process-drawable. -(defmethod relocate process-drawable ((this process-drawable) (arg0 int)) +(defmethod relocate ((this process-drawable) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -164,37 +164,37 @@ (the-as process-drawable ((method-of-type process relocate) this arg0)) ) -(defmethod relocate collide-shape ((this collide-shape) (arg0 int)) +(defmethod relocate ((this collide-shape) (arg0 int)) (&+! (-> this process) arg0) (&+! (-> this root-prim) arg0) this ) ;; WARN: Return type mismatch collide-shape vs collide-shape-moving. -(defmethod relocate collide-shape-moving ((this collide-shape-moving) (arg0 int)) +(defmethod relocate ((this collide-shape-moving) (arg0 int)) (if (-> this dynam) (&+! (-> this dynam) arg0) ) (the-as collide-shape-moving ((method-of-type collide-shape relocate) this arg0)) ) -(defmethod relocate collide-shape-prim ((this collide-shape-prim) (arg0 int)) +(defmethod relocate ((this collide-shape-prim) (arg0 int)) (&+! (-> this cshape) arg0) this ) -(defmethod relocate collide-shape-prim-group ((this collide-shape-prim-group) (arg0 int)) +(defmethod relocate ((this collide-shape-prim-group) (arg0 int)) (&+! (-> this cshape) arg0) (set! (-> this child) (the-as (inline-array collide-shape-prim) (&+ (the-as pointer (-> this child)) arg0))) this ) -(defmethod relocate fact-info ((this fact-info) (arg0 int)) +(defmethod relocate ((this fact-info) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate draw-control ((this draw-control) (arg0 int)) +(defmethod relocate ((this draw-control) (arg0 int)) (&+! (-> this skeleton) arg0) (&+! (-> this process) arg0) (when (-> this ripple) @@ -213,7 +213,7 @@ this ) -(defmethod relocate joint-control ((this joint-control) (arg0 int)) +(defmethod relocate ((this joint-control) (arg0 int)) (if (-> this effect) (&+! (-> this effect) arg0) ) @@ -227,7 +227,7 @@ this ) -(defmethod relocate cspace-array ((this cspace-array) (arg0 int)) +(defmethod relocate ((this cspace-array) (arg0 int)) (countdown (v1-0 (-> this length)) (let ((a2-2 (-> this data v1-0))) (if (-> a2-2 parent) @@ -253,53 +253,53 @@ this ) -(defmethod relocate path-control ((this path-control) (arg0 int)) +(defmethod relocate ((this path-control) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate vol-control ((this vol-control) (arg0 int)) +(defmethod relocate ((this vol-control) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate water-control ((this water-control) (arg0 int)) +(defmethod relocate ((this water-control) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate actor-link-info ((this actor-link-info) (arg0 int)) +(defmethod relocate ((this actor-link-info) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate align-control ((this align-control) (arg0 int)) +(defmethod relocate ((this align-control) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate joint-mod ((this joint-mod) (arg0 int)) +(defmethod relocate ((this joint-mod) (arg0 int)) (&+! (-> this process) arg0) (&+! (-> this joint) arg0) this ) -(defmethod relocate joint-mod-wheel ((this joint-mod-wheel) (arg0 int)) +(defmethod relocate ((this joint-mod-wheel) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate joint-mod-ik ((this joint-mod-ik) (arg0 int)) +(defmethod relocate ((this joint-mod-ik) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate effect-control ((this effect-control) (arg0 int)) +(defmethod relocate ((this effect-control) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod relocate sparticle-launch-control ((this sparticle-launch-control) (arg0 int)) +(defmethod relocate ((this sparticle-launch-control) (arg0 int)) (&+! (-> this proc) arg0) (countdown (v1-2 (-> this length)) (let* ((a0-4 (-> this data v1-2)) @@ -331,7 +331,7 @@ ) ;; WARN: Return type mismatch process vs camera-master. -(defmethod relocate camera-master ((this camera-master) (arg0 int)) +(defmethod relocate ((this camera-master) (arg0 int)) (if (nonzero? (-> this water-drip)) (&+! (-> this water-drip) arg0) ) @@ -339,7 +339,7 @@ ) ;; WARN: Return type mismatch process vs time-of-day-proc. -(defmethod relocate time-of-day-proc ((this time-of-day-proc) (arg0 int)) +(defmethod relocate ((this time-of-day-proc) (arg0 int)) (if (nonzero? (-> this sun)) (&+! (-> this sun) arg0) ) @@ -353,7 +353,7 @@ ) ;; WARN: Return type mismatch process vs part-tracker. -(defmethod relocate part-tracker ((this part-tracker) (arg0 int)) +(defmethod relocate ((this part-tracker) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) @@ -364,7 +364,7 @@ ) ;; WARN: Return type mismatch process vs part-spawner. -(defmethod relocate part-spawner ((this part-spawner) (arg0 int)) +(defmethod relocate ((this part-spawner) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) @@ -378,7 +378,7 @@ ) ;; WARN: Return type mismatch process vs lightning-tracker. -(defmethod relocate lightning-tracker ((this lightning-tracker) (arg0 int)) +(defmethod relocate ((this lightning-tracker) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) @@ -389,7 +389,7 @@ ) ;; WARN: Return type mismatch process-drawable vs manipy. -(defmethod relocate manipy ((this manipy) (arg0 int)) +(defmethod relocate ((this manipy) (arg0 int)) (if (nonzero? (-> this joint 0)) (&+! (-> this joint 0) arg0) ) diff --git a/goal_src/jak2/engine/entity/res-h.gc b/goal_src/jak2/engine/entity/res-h.gc index 5e9e9890759..e5487597626 100644 --- a/goal_src/jak2/engine/entity/res-h.gc +++ b/goal_src/jak2/engine/entity/res-h.gc @@ -28,38 +28,32 @@ (elt-count uint32 :offset 112 :size 15) (inlined? uint8 :offset 127 :size 1) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype res-lump (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (data-base pointer :offset-assert 12) - (data-top pointer :offset-assert 16) - (data-size int32 :offset-assert 20) - (extra entity-links :offset-assert 24) - (tag (pointer res-tag) :offset-assert 28) + ((length int32) + (allocated-length int32) + (data-base pointer) + (data-top pointer) + (data-size int32) + (extra entity-links) + (tag (pointer res-tag)) ) - :method-count-assert 22 - :size-assert #x20 - :flag-assert #x1600000020 (:methods - (new (symbol type int int) _type_ 0) - (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual 9) - (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual 10) - (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual 11) - (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual 12) - (get-tag-index-data (_type_ int) pointer 13) - (get-tag-data (_type_ res-tag) pointer 14) - (allocate-data-memory-for-tag! (_type_ res-tag) res-tag 15) - (sort! (_type_) _type_ 16) - (add-data! (_type_ res-tag pointer) res-lump 17) - (add-32bit-data! (_type_ res-tag object) res-lump 18) - (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual 19) - (make-property-data (_type_ float res-tag-pair pointer) pointer 20) - (get-curve-data! (_type_ curve symbol symbol float) symbol 21) + (new (symbol type int int) _type_) + (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual) + (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual) + (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual) + (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual) + (get-tag-index-data (_type_ int) pointer) + (get-tag-data (_type_ res-tag) pointer) + (allocate-data-memory-for-tag! (_type_ res-tag) res-tag) + (sort! (_type_) _type_) + (add-data! (_type_ res-tag pointer) res-lump) + (add-32bit-data! (_type_ res-tag object) res-lump) + (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual) + (make-property-data (_type_ float res-tag-pair pointer) pointer) + (get-curve-data! (_type_ curve symbol symbol float) symbol) ) ) diff --git a/goal_src/jak2/engine/entity/res.gc b/goal_src/jak2/engine/entity/res.gc index 5c699f5bf45..435bceb5da5 100644 --- a/goal_src/jak2/engine/entity/res.gc +++ b/goal_src/jak2/engine/entity/res.gc @@ -41,7 +41,7 @@ This is updated from the entity system used in Crash 2, which had most of these `(zero? (-> ,tag inlined?)) ) -(defmethod print res-tag ((this res-tag)) +(defmethod print ((this res-tag)) "print a res-tag." (if (res-ref? this) @@ -64,7 +64,7 @@ This is updated from the entity system used in Crash 2, which had most of these this ) -(defmethod length res-tag ((this res-tag)) +(defmethod length ((this res-tag)) "get the length in bytes of this tag's resource." (the-as int (if (zero? (-> this inlined?)) (* (-> this elt-count) 4) @@ -73,12 +73,12 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod get-tag-index-data res-lump ((this res-lump) (arg0 int)) +(defmethod get-tag-index-data ((this res-lump) (arg0 int)) "get the data address of the n'th tag." (&+ (-> this data-base) (-> this tag arg0 data-offset)) ) -(defmethod get-tag-data res-lump ((this res-lump) (arg0 res-tag)) +(defmethod get-tag-data ((this res-lump) (arg0 res-tag)) "get the data address of the specified tag." (&+ (-> this data-base) (-> arg0 data-offset)) ) @@ -95,17 +95,17 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod length res-lump ((this res-lump)) +(defmethod length ((this res-lump)) "get the amount of resources in a res-lump." (-> this length) ) -(defmethod asize-of res-lump ((this res-lump)) +(defmethod asize-of ((this res-lump)) "get the allocated size of a res-lump." (the-as int (+ (-> this type psize) (* (-> this allocated-length) 16) (-> this data-size))) ) -(defmethod inspect res-lump ((this res-lump)) +(defmethod inspect ((this res-lump)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Textra: ~A~%" (-> this extra)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -130,7 +130,7 @@ This is updated from the entity system used in Crash 2, which had most of these this ) -(defmethod lookup-tag-idx res-lump ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float)) +(defmethod lookup-tag-idx ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float)) "Look up the index of the tag containing with the given name and timestamp. Correct lookups return a res-tag-pair, which contains one tag index in the lower 32 bits and one in the upper 32 bits. Depending on the mode, they may be the same, or they may be two tags that you should interpolate @@ -239,7 +239,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod make-property-data res-lump ((this res-lump) (arg0 float) (arg1 res-tag-pair) (arg2 pointer)) +(defmethod make-property-data ((this res-lump) (arg0 float) (arg1 res-tag-pair) (arg2 pointer)) "Returns (a pointer to) the value data of a property with the tag-pair. If tag-pair does not represent an exact point in the timeline, then the data is interpolated based on time with the result written into buf. buf must have enough space to copy all of the data. @@ -423,14 +423,14 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod get-property-data res-lump ((this res-lump) - (arg0 symbol) - (arg1 symbol) - (arg2 float) - (arg3 pointer) - (arg4 (pointer res-tag)) - (arg5 pointer) - ) +(defmethod get-property-data ((this res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 pointer) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) "Returns an address to a given property's data at a specific time stamp, or default on error. name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp. default is the default result returned in the case of an error. @@ -453,14 +453,14 @@ This is updated from the entity system used in Crash 2, which had most of these arg3 ) -(defmethod get-property-struct res-lump ((this res-lump) - (arg0 symbol) - (arg1 symbol) - (arg2 float) - (arg3 structure) - (arg4 (pointer res-tag)) - (arg5 pointer) - ) +(defmethod get-property-struct ((this res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 structure) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) "Returns a given struct property's value at a specific time stamp, or default on error. name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp. default is the default result returned in the case of an error. @@ -488,14 +488,14 @@ This is updated from the entity system used in Crash 2, which had most of these (the-as structure arg3) ) -(defmethod get-property-value res-lump ((this res-lump) - (arg0 symbol) - (arg1 symbol) - (arg2 float) - (arg3 uint128) - (arg4 (pointer res-tag)) - (arg5 pointer) - ) +(defmethod get-property-value ((this res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 uint128) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) "Returns a given value property's value at a specific time stamp, or default on error. name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp. default is the default result returned in the case of an error. @@ -568,7 +568,7 @@ This is updated from the entity system used in Crash 2, which had most of these (the-as uint128 arg3) ) -(defmethod get-property-value-float res-lump ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float) (arg3 float) (arg4 (pointer res-tag)) (arg5 pointer)) +(defmethod get-property-value-float ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float) (arg3 float) (arg4 (pointer res-tag)) (arg5 pointer)) "same as get-property-value but float type is checked first?" (local-vars (v1-8 uint) (v1-11 int)) (let ((a2-1 (lookup-tag-idx this arg0 arg1 arg2))) @@ -640,7 +640,7 @@ This is updated from the entity system used in Crash 2, which had most of these arg3 ) -(defmethod sort! res-lump ((this res-lump)) +(defmethod sort! ((this res-lump)) "Sort all tags based on name, then key-frame." (let ((v1-0 -1)) (while (nonzero? v1-0) @@ -668,7 +668,7 @@ This is updated from the entity system used in Crash 2, which had most of these this ) -(defmethod allocate-data-memory-for-tag! res-lump ((this res-lump) (arg0 res-tag)) +(defmethod allocate-data-memory-for-tag! ((this res-lump) (arg0 res-tag)) "Find space for the data described by arg0 in this. Returns a tag with data-offset set correctly for this res-lump. If the lump already contains memory for the given tag, and it is big enough, @@ -736,7 +736,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod add-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 pointer)) +(defmethod add-data! ((this res-lump) (arg0 res-tag) (arg1 pointer)) "Given a tag and a pointer to its data, copy it to this res-lump. This doesn't seem to do the right thing if the given tag is a non-inline tag with > 1 element." @@ -763,7 +763,7 @@ This is updated from the entity system used in Crash 2, which had most of these this ) -(defmethod add-32bit-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 object)) +(defmethod add-32bit-data! ((this res-lump) (arg0 res-tag) (arg1 object)) "Add a single 32-bit value using add-data." (set! (-> arg0 inlined?) 1) (add-data! this arg0 (& arg1)) ;; note, only 32-bits are spilled to the stack here. @@ -779,7 +779,7 @@ This is updated from the entity system used in Crash 2, which had most of these |# ) -(defmethod get-curve-data! res-lump ((this res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) +(defmethod get-curve-data! ((this res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) "Read curve data and write it to curve-target. Return #t if both control points and knots data was succesfully read, #f otherwise." (local-vars (sv-16 res-tag) (sv-32 res-tag)) (let ((s5-0 #f)) @@ -817,7 +817,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod mem-usage res-lump ((this res-lump) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this res-lump) (arg0 memory-usage-block) (arg1 int)) "Get the memory usage of this lump and its data" (local-vars (sv-16 int)) (let ((s3-0 48) diff --git a/goal_src/jak2/engine/game/effect-control-h.gc b/goal_src/jak2/engine/game/effect-control-h.gc index 3cf6132865f..26690ac3ddf 100644 --- a/goal_src/jak2/engine/game/effect-control-h.gc +++ b/goal_src/jak2/engine/game/effect-control-h.gc @@ -45,26 +45,23 @@ ;; DECOMP BEGINS (deftype effect-control (basic) - ((process process-drawable :offset-assert 4) - (flags effect-control-flag :offset-assert 8) - (last-frame-group art-joint-anim :offset-assert 12) - (last-frame-num float :offset-assert 16) - (channel-offset int32 :offset-assert 20) - (res res-lump :offset-assert 24) - (name (pointer res-tag) :offset-assert 28) - (param uint32 :offset-assert 32) + ((process process-drawable) + (flags effect-control-flag) + (last-frame-group art-joint-anim) + (last-frame-num float) + (channel-offset int32) + (res res-lump) + (name (pointer res-tag)) + (param uint32) ) - :method-count-assert 15 - :size-assert #x24 - :flag-assert #xf00000024 (:methods - (new (symbol type process-drawable) _type_ 0) - (update-effects (_type_) none 9) - (do-effect (_type_ symbol float int) none 10) - (do-effect-for-surface (_type_ symbol float int basic pat-surface) none 11) - (play-effect-sound (_type_ symbol float int basic sound-name) int 12) - (set-channel-offset! (_type_ int) none 13) - (play-effects-from-res-lump (_type_ float float float) none 14) + (new (symbol type process-drawable) _type_) + (update-effects (_type_) none) + (do-effect (_type_ symbol float int) none) + (do-effect-for-surface (_type_ symbol float int basic pat-surface) none) + (play-effect-sound (_type_ symbol float int basic sound-name) int) + (set-channel-offset! (_type_ int) none) + (play-effects-from-res-lump (_type_ float float float) none) ) ) @@ -84,7 +81,7 @@ ) ) -(defmethod set-channel-offset! effect-control ((this effect-control) (arg0 int)) +(defmethod set-channel-offset! ((this effect-control) (arg0 int)) (set! (-> this channel-offset) arg0) 0 (none) diff --git a/goal_src/jak2/engine/game/effect-control.gc b/goal_src/jak2/engine/game/effect-control.gc index 9da2131dd19..bb99aad853d 100644 --- a/goal_src/jak2/engine/game/effect-control.gc +++ b/goal_src/jak2/engine/game/effect-control.gc @@ -144,7 +144,7 @@ arg0 ) -(defmethod update-effects effect-control ((this effect-control)) +(defmethod update-effects ((this effect-control)) (let* ((a0-1 (-> this process skel)) (v1-3 (if (< (the-as uint (-> this channel-offset)) (-> a0-1 active-channels)) (-> a0-1 root-channel (-> this channel-offset)) @@ -163,9 +163,9 @@ (set! (-> this res) (-> s5-0 extra)) (let ((v1-6 (-> (lookup-tag-idx (-> s5-0 extra) 'effect-name 'base -1000000000.0) lo))) (set! (-> this name) (if (>= (the-as int v1-6) 0) - (&-> (-> s5-0 extra tag) v1-6) - (the-as (pointer res-tag) #f) - ) + (&-> (-> s5-0 extra tag) v1-6) + (the-as (pointer res-tag) #f) + ) ) ) (if (and (-> this name) (= (-> this name 0 key-frame) -1000000000.0)) @@ -245,7 +245,7 @@ (none) ) -(defmethod play-effects-from-res-lump effect-control ((this effect-control) (arg0 float) (arg1 float) (arg2 float)) +(defmethod play-effects-from-res-lump ((this effect-control) (arg0 float) (arg1 float) (arg2 float)) ;; og:preserve-this ;; note: this check was added. I believe in the original game name could be false, and then the ;; effect-name check below would fail. This did not cause a crash on original hardware because @@ -278,16 +278,8 @@ (none) ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 257] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 317] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 337] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 459] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 480] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 579] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 598] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 303] ;; WARN: Function (method 10 effect-control) has a return type of none, but the expression builder found a return statement. -(defmethod do-effect effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) +(defmethod do-effect ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) (local-vars (sv-320 int) (sv-336 symbol) @@ -406,7 +398,15 @@ ) (when (and (nonzero? s3-0) (= (-> (the-as basic s3-0) type) sparticle-launch-group)) (if *debug-effect-control* - (format #t "(~5D) effect group ~A ~A frame ~F joint ~D~%" (current-time) (-> this process name) arg0 arg1 s5-0) + (format + #t + "(~5D) effect group ~A ~A frame ~F joint ~D~%" + (current-time) + (-> this process name) + arg0 + arg1 + s5-0 + ) ) (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-1 @@ -466,7 +466,15 @@ ) ((= (-> (the-as basic s3-0) type) sparticle-launcher) (if *debug-effect-control* - (format #t "(~5D) effect part ~A ~A frame ~F joint ~D~%" (current-time) (-> this process name) arg0 arg1 s5-0) + (format + #t + "(~5D) effect part ~A ~A frame ~F joint ~D~%" + (current-time) + (-> this process name) + arg0 + arg1 + s5-0 + ) ) (format #t @@ -496,7 +504,15 @@ ) ((= (-> (the-as basic s3-0) type) sparticle-launch-group) (if *debug-effect-control* - (format #t "(~5D) effect group ~A ~A frame ~F joint ~D~%" (current-time) (-> this process name) arg0 arg1 s5-0) + (format + #t + "(~5D) effect group ~A ~A frame ~F joint ~D~%" + (current-time) + (-> this process name) + arg0 + arg1 + s5-0 + ) ) (let ((s4-3 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-3 @@ -600,7 +616,7 @@ (none) ) -(defmethod do-effect-for-surface effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) +(defmethod do-effect-for-surface ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) (local-vars (sv-64 (function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none) @@ -1031,7 +1047,7 @@ (none) ) -(defmethod play-effect-sound effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) +(defmethod play-effect-sound ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) (local-vars (sv-112 res-tag) (sv-128 sound-name) (sv-144 basic) (sv-160 (function vector vector float))) (set! sv-144 arg3) (let ((s0-0 arg4) diff --git a/goal_src/jak2/engine/game/fact-h.gc b/goal_src/jak2/engine/game/fact-h.gc index e0784ba8c33..c899ea2fe9c 100644 --- a/goal_src/jak2/engine/game/fact-h.gc +++ b/goal_src/jak2/engine/game/fact-h.gc @@ -81,44 +81,41 @@ ;; DECOMP BEGINS (deftype fact-bank (basic) - ((eco-level-max float :offset-assert 4) - (eco-single-inc float :offset-assert 8) - (eco-full-inc float :offset-assert 12) - (eco-single-timeout seconds :offset-assert 16) - (eco-full-timeout seconds :offset-assert 24) - (dummy seconds :offset-assert 32) - (health-max-default float :offset-assert 40) - (health-single-inc float :offset-assert 44) - (health-default-inc float :offset-assert 48) - (health-darkjak-inc float :offset-assert 52) - (health-darkjak-min float :offset-assert 56) - (health-darkjak-error float :offset-assert 60) - (eco-pill-green-max-default float :offset-assert 64) - (eco-pill-dark-max-default float :offset-assert 68) - (health-small-inc float :offset-assert 72) - (buzzer-max-default float :offset-assert 76) - (buzzer-single-inc float :offset-assert 80) - (suck-bounce-dist meters :offset-assert 84) - (suck-suck-dist meters :offset-assert 88) - (default-eco-pill-green-inc float :offset-assert 92) - (default-eco-pill-dark-inc float :offset-assert 96) - (ammo-yellow-max float :offset-assert 100) - (ammo-red-max float :offset-assert 104) - (ammo-blue-max float :offset-assert 108) - (ammo-dark-max float :offset-assert 112) - (ammo-yellow-start float :offset-assert 116) - (ammo-red-start float :offset-assert 120) - (ammo-blue-start float :offset-assert 124) - (ammo-dark-start float :offset-assert 128) - (shield-max float :offset-assert 132) - (shield-use-speed float :offset-assert 136) - (shield-time-min seconds :offset-assert 144) - (trick-point-max float :offset-assert 152) - (super-skill-inc float :offset-assert 156) + ((eco-level-max float) + (eco-single-inc float) + (eco-full-inc float) + (eco-single-timeout seconds) + (eco-full-timeout seconds) + (dummy seconds) + (health-max-default float) + (health-single-inc float) + (health-default-inc float) + (health-darkjak-inc float) + (health-darkjak-min float) + (health-darkjak-error float) + (eco-pill-green-max-default float) + (eco-pill-dark-max-default float) + (health-small-inc float) + (buzzer-max-default float) + (buzzer-single-inc float) + (suck-bounce-dist meters) + (suck-suck-dist meters) + (default-eco-pill-green-inc float) + (default-eco-pill-dark-inc float) + (ammo-yellow-max float) + (ammo-red-max float) + (ammo-blue-max float) + (ammo-dark-max float) + (ammo-yellow-start float) + (ammo-red-start float) + (ammo-blue-start float) + (ammo-dark-start float) + (shield-max float) + (shield-use-speed float) + (shield-time-min seconds) + (trick-point-max float) + (super-skill-inc float) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) @@ -269,103 +266,91 @@ ) (deftype fact-info (basic) - ((process process :offset-assert 4) - (pickup-type pickup-type :offset-assert 8) - (pickup-amount float :offset-assert 12) - (pickup-spawn-amount float :offset-assert 16) - (options actor-option :offset-assert 24) - (fade-time time-frame :offset-assert 32) + ((process process) + (pickup-type pickup-type) + (pickup-amount float) + (pickup-spawn-amount float) + (options actor-option) + (fade-time time-frame) ) - :method-count-assert 12 - :size-assert #x28 - :flag-assert #xc00000028 (:methods - (new (symbol type process pickup-type float) _type_ 0) - (drop-pickup (_type_ symbol process-tree fact-info int) (pointer process) 9) - (reset! (_type_ symbol) none 10) - (pickup-collectable! (_type_ pickup-type float handle) float 11) + (new (symbol type process pickup-type float) _type_) + (drop-pickup (_type_ symbol process-tree fact-info int) (pointer process)) + (reset! (_type_ symbol) none) + (pickup-collectable! (_type_ pickup-type float handle) float) ) ) (deftype fact-info-target (fact-info) - ((eco-type int32 :offset-assert 40) - (eco-level float :offset-assert 44) - (eco-pickup-time time-frame :offset-assert 48) - (eco-timeout time-frame :offset-assert 56) - (eco-source handle :offset-assert 64) - (eco-source-time time-frame :offset-assert 72) - (health float :offset-assert 80) - (health-max float :offset-assert 84) - (health-pickup-time time-frame :offset-assert 88) - (buzzer float :offset-assert 96) - (buzzer-max float :offset-assert 100) - (eco-pill-green float :offset-assert 104) - (eco-pill-green-max float :offset-assert 108) - (eco-pill-green-pickup-time time-frame :offset-assert 112) - (eco-pill-dark-pickup-time time-frame :offset-assert 120) - (money-pickup-time time-frame :offset-assert 128) - (buzzer-pickup-time time-frame :offset-assert 136) - (task-pickup-time time-frame :offset-assert 144) - (stop-time-timeout time-frame :offset-assert 152) - (darkjak-start-time time-frame :offset-assert 160) - (darkjak-effect-time time-frame :offset-assert 168) - (ammo-pickup-time time-frame :offset-assert 176) - (shield-pickup-time time-frame :offset-assert 184) - (shield-start-time time-frame :offset-assert 192) - (shield-use-time time-frame :offset-assert 200) - (shield-level float :offset-assert 208) - (shield-attack-id uint32 :offset-assert 212) - (trick-point float :offset-assert 216) - (trick-point-pickup-time time-frame :offset-assert 224) - (trick-point-start-time time-frame :offset-assert 232) - (trick-point-duration time-frame :offset-assert 240) - (gem-pickup-time time-frame :offset-assert 248) - (skill-pickup-time time-frame :offset-assert 256) - (karma-pickup-time time-frame :offset-assert 264) + ((eco-type int32) + (eco-level float) + (eco-pickup-time time-frame) + (eco-timeout time-frame) + (eco-source handle) + (eco-source-time time-frame) + (health float) + (health-max float) + (health-pickup-time time-frame) + (buzzer float) + (buzzer-max float) + (eco-pill-green float) + (eco-pill-green-max float) + (eco-pill-green-pickup-time time-frame) + (eco-pill-dark-pickup-time time-frame) + (money-pickup-time time-frame) + (buzzer-pickup-time time-frame) + (task-pickup-time time-frame) + (stop-time-timeout time-frame) + (darkjak-start-time time-frame) + (darkjak-effect-time time-frame) + (ammo-pickup-time time-frame) + (shield-pickup-time time-frame) + (shield-start-time time-frame) + (shield-use-time time-frame) + (shield-level float) + (shield-attack-id uint32) + (trick-point float) + (trick-point-pickup-time time-frame) + (trick-point-start-time time-frame) + (trick-point-duration time-frame) + (gem-pickup-time time-frame) + (skill-pickup-time time-frame) + (karma-pickup-time time-frame) ) - :method-count-assert 13 - :size-assert #x110 - :flag-assert #xd00000110 (:methods - (new (symbol type process-drawable pickup-type float) _type_ 0) - (get-gun-ammo (_type_) float 12) + (new (symbol type process-drawable pickup-type float) _type_) + (get-gun-ammo (_type_) float) ) ) (deftype fact-info-enemy (fact-info) - ((speed float :offset-assert 40) - (idle-distance meters :offset-assert 44) - (notice-top meters :offset-assert 48) - (notice-bottom meters :offset-assert 52) - (cam-horz meters :offset-assert 56) - (cam-vert meters :offset-assert 60) - (cam-notice-dist meters :offset-assert 64) - (enemy-options enemy-option :offset-assert 68) - (trig-dist meters :offset-assert 72) - (trig-actor-group (pointer actor-group) :offset-assert 76) - (trig-mask-count int8 :offset-assert 80) - (trig-mask uint8 2 :offset-assert 81) + ((speed float) + (idle-distance meters) + (notice-top meters) + (notice-bottom meters) + (cam-horz meters) + (cam-vert meters) + (cam-notice-dist meters) + (enemy-options enemy-option) + (trig-dist meters) + (trig-actor-group (pointer actor-group)) + (trig-mask-count int8) + (trig-mask uint8 2) ) - :method-count-assert 13 - :size-assert #x53 - :flag-assert #xd00000053 (:methods - (new (symbol type process (pointer float) pickup-type float) _type_ 0) - (clear-mask-bits (_type_ int) none 12) + (new (symbol type process (pointer float) pickup-type float) _type_) + (clear-mask-bits (_type_ int) none) ) ) (deftype fact-info-crate (fact-info) - ((suck-count int32 :offset-assert 40) + ((suck-count int32) ) - :method-count-assert 12 - :size-assert #x2c - :flag-assert #xc0000002c (:methods - (new (symbol type process pickup-type float) _type_ 0) + (new (symbol type process pickup-type float) _type_) ) ) @@ -419,16 +404,13 @@ (the-as fact-info sv-16) ) -(defmethod pickup-collectable! fact-info ((this fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) +(defmethod pickup-collectable! ((this fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) 0.0 ) (deftype fact-info-enemy-defaults (basic) - ((idle-distance meters :offset-assert 4) + ((idle-distance meters) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -491,7 +473,7 @@ ) ) -(defmethod clear-mask-bits fact-info-enemy ((this fact-info-enemy) (arg0 int)) +(defmethod clear-mask-bits ((this fact-info-enemy) (arg0 int)) (let ((v1-0 (lognot arg0))) (dotimes (a1-1 (-> this trig-mask-count)) (logand! (-> this trig-mask a1-1) v1-0) diff --git a/goal_src/jak2/engine/game/game-h.gc b/goal_src/jak2/engine/game/game-h.gc index c9d702382e3..d9bf675cf26 100644 --- a/goal_src/jak2/engine/game/game-h.gc +++ b/goal_src/jak2/engine/game/game-h.gc @@ -112,35 +112,31 @@ ;; DECOMP BEGINS (deftype process-drawable (process) - ((root trsqv :offset-assert 128) - (node-list cspace-array :offset-assert 132) - (draw draw-control :offset-assert 136) - (skel joint-control :offset-assert 140) - (nav nav-control :offset-assert 144) - (align align-control :offset-assert 148) - (path path-control :offset-assert 152) - (vol vol-control :offset-assert 156) - (fact fact-info :offset-assert 160) - (link actor-link-info :offset-assert 164) - (part sparticle-launch-control :offset-assert 168) - (water water-control :offset-assert 172) - (sound ambient-sound :offset-assert 176) - (carry carry-info :offset-assert 180) - (rbody rigid-body-control :offset-assert 184) - (state-flags state-flags :offset-assert 188) - (state-time time-frame :offset-assert 192) + ((root trsqv) + (node-list cspace-array) + (draw draw-control) + (skel joint-control) + (nav nav-control) + (align align-control) + (path path-control) + (vol vol-control) + (fact fact-info) + (link actor-link-info) + (part sparticle-launch-control) + (water water-control) + (sound ambient-sound) + (carry carry-info) + (rbody rigid-body-control) + (state-flags state-flags) + (state-time time-frame) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc8 - :flag-assert #x14005000c8 (:methods - (initialize-skeleton (_type_ skeleton-group pair) draw-control 14) - (initialize-skeleton-by-name (_type_ string) draw-control 15) - (apply-alignment (_type_ align-opts transformq vector) trsqv 16) - (cleanup-for-death (_type_) none 17) - (relocate-nav (_type_ int) none 18) - (evaluate-joint-control (_type_) none 19) + (initialize-skeleton (_type_ skeleton-group pair) draw-control) + (initialize-skeleton-by-name (_type_ string) draw-control) + (apply-alignment (_type_ align-opts transformq vector) trsqv) + (cleanup-for-death (_type_) none) + (relocate-nav (_type_ int) none) + (evaluate-joint-control (_type_) none) ) (:states (process-drawable-art-error string) @@ -151,229 +147,216 @@ (deftype process-drawable-reserved (process-drawable) () - :heap-base #x50 - :method-count-assert 178 - :size-assert #xc8 - :flag-assert #xb2005000c8 (:methods - (process-drawable-reserved-method-20 () none 20) - (process-drawable-reserved-method-21 () none 21) - (process-drawable-reserved-method-22 () none 22) - (process-drawable-reserved-method-23 () none 23) - (process-drawable-reserved-method-24 () none 24) - (process-drawable-reserved-method-25 () none 25) - (process-drawable-reserved-method-26 () none 26) - (process-drawable-reserved-method-27 () none 27) - (process-drawable-reserved-method-28 () none 28) - (process-drawable-reserved-method-29 () none 29) - (process-drawable-reserved-method-30 () none 30) - (process-drawable-reserved-method-31 () none 31) - (process-drawable-reserved-method-32 () none 32) - (process-drawable-reserved-method-33 () none 33) - (process-drawable-reserved-method-34 () none 34) - (process-drawable-reserved-method-35 () none 35) - (process-drawable-reserved-method-36 () none 36) - (process-drawable-reserved-method-37 () none 37) - (process-drawable-reserved-method-38 () none 38) - (process-drawable-reserved-method-39 () none 39) - (process-drawable-reserved-method-40 () none 40) - (process-drawable-reserved-method-41 () none 41) - (process-drawable-reserved-method-42 () none 42) - (process-drawable-reserved-method-43 () none 43) - (process-drawable-reserved-method-44 () none 44) - (process-drawable-reserved-method-45 () none 45) - (process-drawable-reserved-method-46 () none 46) - (process-drawable-reserved-method-47 () none 47) - (process-drawable-reserved-method-48 () none 48) - (process-drawable-reserved-method-49 () none 49) - (process-drawable-reserved-method-50 () none 50) - (process-drawable-reserved-method-51 () none 51) - (process-drawable-reserved-method-52 () none 52) - (process-drawable-reserved-method-53 () none 53) - (process-drawable-reserved-method-54 () none 54) - (process-drawable-reserved-method-55 () none 55) - (process-drawable-reserved-method-56 () none 56) - (process-drawable-reserved-method-57 () none 57) - (process-drawable-reserved-method-58 () none 58) - (process-drawable-reserved-method-59 () none 59) - (process-drawable-reserved-method-60 () none 60) - (process-drawable-reserved-method-61 () none 61) - (process-drawable-reserved-method-62 () none 62) - (process-drawable-reserved-method-63 () none 63) - (process-drawable-reserved-method-64 () none 64) - (process-drawable-reserved-method-65 () none 65) - (process-drawable-reserved-method-66 () none 66) - (process-drawable-reserved-method-67 () none 67) - (process-drawable-reserved-method-68 () none 68) - (process-drawable-reserved-method-69 () none 69) - (process-drawable-reserved-method-70 () none 70) - (process-drawable-reserved-method-71 () none 71) - (process-drawable-reserved-method-72 () none 72) - (process-drawable-reserved-method-73 () none 73) - (process-drawable-reserved-method-74 () none 74) - (process-drawable-reserved-method-75 () none 75) - (process-drawable-reserved-method-76 () none 76) - (process-drawable-reserved-method-77 () none 77) - (process-drawable-reserved-method-78 () none 78) - (process-drawable-reserved-method-79 () none 79) - (process-drawable-reserved-method-80 () none 80) - (process-drawable-reserved-method-81 () none 81) - (process-drawable-reserved-method-82 () none 82) - (process-drawable-reserved-method-83 () none 83) - (process-drawable-reserved-method-84 () none 84) - (process-drawable-reserved-method-85 () none 85) - (process-drawable-reserved-method-86 () none 86) - (process-drawable-reserved-method-87 () none 87) - (process-drawable-reserved-method-88 () none 88) - (process-drawable-reserved-method-89 () none 89) - (process-drawable-reserved-method-90 () none 90) - (process-drawable-reserved-method-91 () none 91) - (process-drawable-reserved-method-92 () none 92) - (process-drawable-reserved-method-93 () none 93) - (process-drawable-reserved-method-94 () none 94) - (process-drawable-reserved-method-95 () none 95) - (process-drawable-reserved-method-96 () none 96) - (process-drawable-reserved-method-97 () none 97) - (process-drawable-reserved-method-98 () none 98) - (process-drawable-reserved-method-99 () none 99) - (process-drawable-reserved-method-100 () none 100) - (process-drawable-reserved-method-101 () none 101) - (process-drawable-reserved-method-102 () none 102) - (process-drawable-reserved-method-103 () none 103) - (process-drawable-reserved-method-104 () none 104) - (process-drawable-reserved-method-105 () none 105) - (process-drawable-reserved-method-106 () none 106) - (process-drawable-reserved-method-107 () none 107) - (process-drawable-reserved-method-108 () none 108) - (process-drawable-reserved-method-109 () none 109) - (process-drawable-reserved-method-110 () none 110) - (process-drawable-reserved-method-111 () none 111) - (process-drawable-reserved-method-112 () none 112) - (process-drawable-reserved-method-113 () none 113) - (process-drawable-reserved-method-114 () none 114) - (process-drawable-reserved-method-115 () none 115) - (process-drawable-reserved-method-116 () none 116) - (process-drawable-reserved-method-117 () none 117) - (process-drawable-reserved-method-118 () none 118) - (process-drawable-reserved-method-119 () none 119) - (process-drawable-reserved-method-120 () none 120) - (process-drawable-reserved-method-121 () none 121) - (process-drawable-reserved-method-122 () none 122) - (process-drawable-reserved-method-123 () none 123) - (process-drawable-reserved-method-124 () none 124) - (process-drawable-reserved-method-125 () none 125) - (process-drawable-reserved-method-126 () none 126) - (process-drawable-reserved-method-127 () none 127) - (process-drawable-reserved-method-128 () none 128) - (process-drawable-reserved-method-129 () none 129) - (process-drawable-reserved-method-130 () none 130) - (process-drawable-reserved-method-131 () none 131) - (process-drawable-reserved-method-132 () none 132) - (process-drawable-reserved-method-133 () none 133) - (process-drawable-reserved-method-134 () none 134) - (process-drawable-reserved-method-135 () none 135) - (process-drawable-reserved-method-136 () none 136) - (process-drawable-reserved-method-137 () none 137) - (process-drawable-reserved-method-138 () none 138) - (process-drawable-reserved-method-139 () none 139) - (process-drawable-reserved-method-140 () none 140) - (process-drawable-reserved-method-141 () none 141) - (process-drawable-reserved-method-142 () none 142) - (process-drawable-reserved-method-143 () none 143) - (process-drawable-reserved-method-144 () none 144) - (process-drawable-reserved-method-145 () none 145) - (process-drawable-reserved-method-146 () none 146) - (process-drawable-reserved-method-147 () none 147) - (process-drawable-reserved-method-148 () none 148) - (process-drawable-reserved-method-149 () none 149) - (process-drawable-reserved-method-150 () none 150) - (process-drawable-reserved-method-151 () none 151) - (process-drawable-reserved-method-152 () none 152) - (process-drawable-reserved-method-153 () none 153) - (process-drawable-reserved-method-154 () none 154) - (process-drawable-reserved-method-155 () none 155) - (process-drawable-reserved-method-156 () none 156) - (process-drawable-reserved-method-157 () none 157) - (process-drawable-reserved-method-158 () none 158) - (process-drawable-reserved-method-159 () none 159) - (process-drawable-reserved-method-160 () none 160) - (process-drawable-reserved-method-161 () none 161) - (process-drawable-reserved-method-162 () none 162) - (process-drawable-reserved-method-163 () none 163) - (process-drawable-reserved-method-164 () none 164) - (process-drawable-reserved-method-165 () none 165) - (process-drawable-reserved-method-166 () none 166) - (process-drawable-reserved-method-167 () none 167) - (process-drawable-reserved-method-168 () none 168) - (process-drawable-reserved-method-169 () none 169) - (process-drawable-reserved-method-170 () none 170) - (process-drawable-reserved-method-171 () none 171) - (process-drawable-reserved-method-172 () none 172) - (process-drawable-reserved-method-173 () none 173) - (process-drawable-reserved-method-174 () none 174) - (process-drawable-reserved-method-175 () none 175) - (process-drawable-reserved-method-176 () none 176) - (process-drawable-reserved-method-177 () none 177) + (process-drawable-reserved-method-20 () none) + (process-drawable-reserved-method-21 () none) + (process-drawable-reserved-method-22 () none) + (process-drawable-reserved-method-23 () none) + (process-drawable-reserved-method-24 () none) + (process-drawable-reserved-method-25 () none) + (process-drawable-reserved-method-26 () none) + (process-drawable-reserved-method-27 () none) + (process-drawable-reserved-method-28 () none) + (process-drawable-reserved-method-29 () none) + (process-drawable-reserved-method-30 () none) + (process-drawable-reserved-method-31 () none) + (process-drawable-reserved-method-32 () none) + (process-drawable-reserved-method-33 () none) + (process-drawable-reserved-method-34 () none) + (process-drawable-reserved-method-35 () none) + (process-drawable-reserved-method-36 () none) + (process-drawable-reserved-method-37 () none) + (process-drawable-reserved-method-38 () none) + (process-drawable-reserved-method-39 () none) + (process-drawable-reserved-method-40 () none) + (process-drawable-reserved-method-41 () none) + (process-drawable-reserved-method-42 () none) + (process-drawable-reserved-method-43 () none) + (process-drawable-reserved-method-44 () none) + (process-drawable-reserved-method-45 () none) + (process-drawable-reserved-method-46 () none) + (process-drawable-reserved-method-47 () none) + (process-drawable-reserved-method-48 () none) + (process-drawable-reserved-method-49 () none) + (process-drawable-reserved-method-50 () none) + (process-drawable-reserved-method-51 () none) + (process-drawable-reserved-method-52 () none) + (process-drawable-reserved-method-53 () none) + (process-drawable-reserved-method-54 () none) + (process-drawable-reserved-method-55 () none) + (process-drawable-reserved-method-56 () none) + (process-drawable-reserved-method-57 () none) + (process-drawable-reserved-method-58 () none) + (process-drawable-reserved-method-59 () none) + (process-drawable-reserved-method-60 () none) + (process-drawable-reserved-method-61 () none) + (process-drawable-reserved-method-62 () none) + (process-drawable-reserved-method-63 () none) + (process-drawable-reserved-method-64 () none) + (process-drawable-reserved-method-65 () none) + (process-drawable-reserved-method-66 () none) + (process-drawable-reserved-method-67 () none) + (process-drawable-reserved-method-68 () none) + (process-drawable-reserved-method-69 () none) + (process-drawable-reserved-method-70 () none) + (process-drawable-reserved-method-71 () none) + (process-drawable-reserved-method-72 () none) + (process-drawable-reserved-method-73 () none) + (process-drawable-reserved-method-74 () none) + (process-drawable-reserved-method-75 () none) + (process-drawable-reserved-method-76 () none) + (process-drawable-reserved-method-77 () none) + (process-drawable-reserved-method-78 () none) + (process-drawable-reserved-method-79 () none) + (process-drawable-reserved-method-80 () none) + (process-drawable-reserved-method-81 () none) + (process-drawable-reserved-method-82 () none) + (process-drawable-reserved-method-83 () none) + (process-drawable-reserved-method-84 () none) + (process-drawable-reserved-method-85 () none) + (process-drawable-reserved-method-86 () none) + (process-drawable-reserved-method-87 () none) + (process-drawable-reserved-method-88 () none) + (process-drawable-reserved-method-89 () none) + (process-drawable-reserved-method-90 () none) + (process-drawable-reserved-method-91 () none) + (process-drawable-reserved-method-92 () none) + (process-drawable-reserved-method-93 () none) + (process-drawable-reserved-method-94 () none) + (process-drawable-reserved-method-95 () none) + (process-drawable-reserved-method-96 () none) + (process-drawable-reserved-method-97 () none) + (process-drawable-reserved-method-98 () none) + (process-drawable-reserved-method-99 () none) + (process-drawable-reserved-method-100 () none) + (process-drawable-reserved-method-101 () none) + (process-drawable-reserved-method-102 () none) + (process-drawable-reserved-method-103 () none) + (process-drawable-reserved-method-104 () none) + (process-drawable-reserved-method-105 () none) + (process-drawable-reserved-method-106 () none) + (process-drawable-reserved-method-107 () none) + (process-drawable-reserved-method-108 () none) + (process-drawable-reserved-method-109 () none) + (process-drawable-reserved-method-110 () none) + (process-drawable-reserved-method-111 () none) + (process-drawable-reserved-method-112 () none) + (process-drawable-reserved-method-113 () none) + (process-drawable-reserved-method-114 () none) + (process-drawable-reserved-method-115 () none) + (process-drawable-reserved-method-116 () none) + (process-drawable-reserved-method-117 () none) + (process-drawable-reserved-method-118 () none) + (process-drawable-reserved-method-119 () none) + (process-drawable-reserved-method-120 () none) + (process-drawable-reserved-method-121 () none) + (process-drawable-reserved-method-122 () none) + (process-drawable-reserved-method-123 () none) + (process-drawable-reserved-method-124 () none) + (process-drawable-reserved-method-125 () none) + (process-drawable-reserved-method-126 () none) + (process-drawable-reserved-method-127 () none) + (process-drawable-reserved-method-128 () none) + (process-drawable-reserved-method-129 () none) + (process-drawable-reserved-method-130 () none) + (process-drawable-reserved-method-131 () none) + (process-drawable-reserved-method-132 () none) + (process-drawable-reserved-method-133 () none) + (process-drawable-reserved-method-134 () none) + (process-drawable-reserved-method-135 () none) + (process-drawable-reserved-method-136 () none) + (process-drawable-reserved-method-137 () none) + (process-drawable-reserved-method-138 () none) + (process-drawable-reserved-method-139 () none) + (process-drawable-reserved-method-140 () none) + (process-drawable-reserved-method-141 () none) + (process-drawable-reserved-method-142 () none) + (process-drawable-reserved-method-143 () none) + (process-drawable-reserved-method-144 () none) + (process-drawable-reserved-method-145 () none) + (process-drawable-reserved-method-146 () none) + (process-drawable-reserved-method-147 () none) + (process-drawable-reserved-method-148 () none) + (process-drawable-reserved-method-149 () none) + (process-drawable-reserved-method-150 () none) + (process-drawable-reserved-method-151 () none) + (process-drawable-reserved-method-152 () none) + (process-drawable-reserved-method-153 () none) + (process-drawable-reserved-method-154 () none) + (process-drawable-reserved-method-155 () none) + (process-drawable-reserved-method-156 () none) + (process-drawable-reserved-method-157 () none) + (process-drawable-reserved-method-158 () none) + (process-drawable-reserved-method-159 () none) + (process-drawable-reserved-method-160 () none) + (process-drawable-reserved-method-161 () none) + (process-drawable-reserved-method-162 () none) + (process-drawable-reserved-method-163 () none) + (process-drawable-reserved-method-164 () none) + (process-drawable-reserved-method-165 () none) + (process-drawable-reserved-method-166 () none) + (process-drawable-reserved-method-167 () none) + (process-drawable-reserved-method-168 () none) + (process-drawable-reserved-method-169 () none) + (process-drawable-reserved-method-170 () none) + (process-drawable-reserved-method-171 () none) + (process-drawable-reserved-method-172 () none) + (process-drawable-reserved-method-173 () none) + (process-drawable-reserved-method-174 () none) + (process-drawable-reserved-method-175 () none) + (process-drawable-reserved-method-176 () none) + (process-drawable-reserved-method-177 () none) ) ) (deftype attack-dir-info (structure) - ((dir vector :inline :offset-assert 0) - (xz-dir vector :inline :offset-assert 16) - (attacker-velocity vector :inline :offset-assert 32) - (pos vector :inline :offset-assert 48) + ((dir vector :inline) + (xz-dir vector :inline) + (attacker-velocity vector :inline) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype attack-info (structure) - ((trans vector :inline :offset-assert 0) - (vector vector :inline :offset-assert 16) - (attacker-velocity vector :inline :offset-assert 32) - (intersection vector :inline :offset-assert 48) - (attacker handle :offset-assert 64) - (attack-time time-frame :offset-assert 72) - (invinc-time time-frame :offset-assert 80) - (mask attack-mask :offset-assert 88) - (mode symbol :offset-assert 92) - (shove-back meters :offset-assert 96) - (shove-up meters :offset-assert 100) - (speed meters :offset-assert 104) - (dist meters :offset-assert 108) - (control float :offset-assert 112) - (angle symbol :offset-assert 116) - (rotate-to degrees :offset-assert 120) - (prev-state state :offset-assert 124) - (id uint32 :offset-assert 128) - (count uint32 :offset-assert 132) - (penetrate-using penetrate :offset-assert 136) - (damage float :offset-assert 144) - (shield-damage float :offset-assert 148) - (knock uint8 :offset-assert 152) - (test symbol :offset-assert 156) + ((trans vector :inline) + (vector vector :inline) + (attacker-velocity vector :inline) + (intersection vector :inline) + (attacker handle) + (attack-time time-frame) + (invinc-time time-frame) + (mask attack-mask) + (mode symbol) + (shove-back meters) + (shove-up meters) + (speed meters) + (dist meters) + (control float) + (angle symbol) + (rotate-to degrees) + (prev-state state) + (id uint32) + (count uint32) + (penetrate-using penetrate) + (damage float) + (shield-damage float) + (knock uint8) + (test symbol) ) - :method-count-assert 12 - :size-assert #xa0 - :flag-assert #xc000000a0 (:methods - (attack-info-method-9 (_type_ attack-info process-drawable process-drawable) none 9) - (compute-intersect-info (_type_ object process-drawable process touching-shapes-entry) attack-info 10) - (combine! (_type_ attack-info process-drawable) attack-info 11) + (attack-info-method-9 (_type_ attack-info process-drawable process-drawable) none) + (compute-intersect-info (_type_ object process-drawable process touching-shapes-entry) attack-info) + (combine! (_type_ attack-info process-drawable) attack-info) ) ) (deftype ground-tween-info (structure) - ((chan uint8 3 :offset-assert 0) - (blend float 3 :offset-assert 4) - (group uint32 5 :offset-assert 16) + ((chan uint8 3) + (blend float 3) + (group uint32 5) ) :pack-me - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) diff --git a/goal_src/jak2/engine/game/game-info-h.gc b/goal_src/jak2/engine/game/game-info-h.gc index 8f3ec82b982..cb60886fff9 100644 --- a/goal_src/jak2/engine/game/game-info-h.gc +++ b/goal_src/jak2/engine/game/game-info-h.gc @@ -151,15 +151,12 @@ (local-vars (gp-0 game-info)) (deftype game-bank (basic) - ((life-max-default float :offset-assert 4) - (life-start-default float :offset-assert 8) - (life-single-inc float :offset-assert 12) - (money-task-inc float :offset-assert 16) - (money-oracle-inc float :offset-assert 20) + ((life-max-default float) + (life-start-default float) + (life-single-inc float) + (money-task-inc float) + (money-oracle-inc float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) @@ -174,66 +171,54 @@ (deftype actor-id (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype highscore-info (structure) - ((flags highscore-flags :offset-assert 0) - (award-scores float 3 :offset-assert 4) - (bronze-score float :offset 4) - (silver-score float :offset 8) - (gold-score float :offset 12) + ((flags highscore-flags) + (award-scores float 3) + (bronze-score float :overlay-at (-> award-scores 0)) + (silver-score float :overlay-at (-> award-scores 1)) + (gold-score float :overlay-at (-> award-scores 2)) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (get-rank (_type_ float) int 9) + (get-rank (_type_ float) int) ) ) (deftype level-buffer-state (structure) - ((name symbol :offset-assert 0) - (display? symbol :offset-assert 4) - (force-vis? symbol :offset-assert 8) - (force-inside? symbol :offset-assert 12) + ((name symbol) + (display? symbol) + (force-vis? symbol) + (force-inside? symbol) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype load-state (basic) - ((want level-buffer-state LEVEL_MAX :inline :offset-assert 4) - (want-sound symbol 3 :offset-assert 100) - (vis-nick symbol :offset-assert 112) - (command-list pair :offset-assert 116) - (object-name string 256 :offset-assert 120) - (object-status basic 256 :offset-assert 1144) + ((want level-buffer-state 6 :inline) + (want-sound symbol 3) + (vis-nick symbol) + (command-list pair) + (object-name string 256) + (object-status basic 256) ) - :method-count-assert 22 - :size-assert #x878 - :flag-assert #x1600000878 (:methods - (new (symbol type) _type_ 0) - (reset! (_type_) _type_ 9) - (update! (_type_) int 10) - (want-levels (_type_ (pointer symbol)) int 11) - (want-sound-banks (_type_ (pointer symbol)) none 12) - (want-display-level (_type_ symbol symbol) int 13) - (want-vis-level (_type_ symbol) none 14) - (want-force-vis (_type_ symbol symbol) int 15) - (want-force-inside (_type_ symbol symbol) none 16) - (execute-commands-up-to (_type_ float) none 17) - (backup-load-state-and-set-cmds (_type_ pair) int 18) - (restore-load-state-and-cleanup (_type_) int 19) - (restore-load-state (_type_) int 20) - (add-borrow-levels (_type_) none 21) + (new (symbol type) _type_) + (reset! (_type_) _type_) + (update! (_type_) int) + (want-levels (_type_ (pointer symbol)) int) + (want-sound-banks (_type_ (pointer symbol)) none) + (want-display-level (_type_ symbol symbol) int) + (want-vis-level (_type_ symbol) none) + (want-force-vis (_type_ symbol symbol) int) + (want-force-inside (_type_ symbol symbol) none) + (execute-commands-up-to (_type_ float) none) + (backup-load-state-and-set-cmds (_type_ pair) int) + (restore-load-state-and-cleanup (_type_) int) + (restore-load-state (_type_) int) + (add-borrow-levels (_type_) none) ) ) @@ -243,158 +228,152 @@ ) (deftype continue-point (basic) - ((name string :offset-assert 4) - (level symbol :offset-assert 8) - (flags continue-flags :offset-assert 12) - (trans vector :inline :offset-assert 16) - (quat vector :inline :offset-assert 32) - (camera-trans vector :inline :offset-assert 48) - (camera-rot vector3s 3 :inline :offset-assert 64) - (on-goto pair :offset-assert 100) - (vis-nick symbol :offset-assert 104) - (want level-buffer-state 6 :inline :offset-assert 108) - (want-sound symbol 3 :offset-assert 204) + ((name string) + (level symbol) + (flags continue-flags) + (trans vector :inline) + (quat vector :inline) + (camera-trans vector :inline) + (camera-rot vector3s 3 :inline) + (on-goto pair) + (vis-nick symbol) + (want level-buffer-state 6 :inline) + (want-sound symbol 3) ) - :method-count-assert 12 - :size-assert #xd8 - :flag-assert #xc000000d8 (:methods - (debug-draw (_type_) int 9) - (continue-point-method-10 (_type_ load-state) continue-point 10) - (move-camera! (_type_) none 11) + (debug-draw (_type_) int) + (continue-point-method-10 (_type_ load-state) continue-point) + (move-camera! (_type_) none) ) ) (deftype game-info (basic) - ((mode symbol :offset-assert 4) - (save-name string :offset-assert 8) - (life float :offset-assert 12) - (life-max float :offset-assert 16) - (money float :offset-assert 20) - (money-total float :offset-assert 24) - (money-per-level uint8 32 :offset-assert 28) - (deaths-per-level uint8 32 :offset-assert 60) - (buzzer-total float :offset-assert 92) - (fuel float :offset-assert 96) - (gem float :offset-assert 100) - (gem-total float :offset-assert 104) - (skill float :offset-assert 108) - (skill-total float :offset-assert 112) - (karma float :offset-assert 116) - (eco-pill-dark float :offset-assert 120) - (eco-pill-dark-total float :offset-assert 124) - (features game-feature :offset-assert 128) - (debug-features game-feature :offset-assert 136) - (secrets game-secrets :offset-assert 144) - (unknown-pad1 uint32 :offset-assert 148) - (purchase-secrets game-secrets :offset-assert 152) - (unknown-pad2 uint32 :offset-assert 156) - (gun-type pickup-type :offset-assert 160) - (gun-ammo float 4 :offset-assert 164) - (shield float :offset-assert 180) - (score float :offset-assert 184) - (score-owner handle :offset-assert 192) - (timer time-frame :offset-assert 200) - (timer-owner handle :offset-assert 208) - (timer-flash symbol :offset-assert 216) - (counter float :offset-assert 220) - (counter-flash basic :offset-assert 224) - (attack-id uint32 :offset-assert 228) - (perm-list entity-perm-array :offset-assert 232) - (task-perm-list entity-perm-array :offset-assert 236) - (current-continue continue-point :offset-assert 240) - (last-continue continue-point :offset-assert 244) - (play-list (array game-task-info) :offset-assert 248) - (sub-task-list (array game-task-node-info) :offset-assert 252) - (mission-list (array game-task-node-info) :offset-assert 256) - (task-counter uint32 :offset-assert 260) - (unknown-pad6 (array uint16) :offset-assert 264) - (level-opened uint8 32 :offset-assert 268) - (total-deaths int32 :offset-assert 300) - (continue-deaths int32 :offset-assert 304) - (task-deaths int32 :offset-assert 308) - (total-trys int32 :offset-assert 312) - (game-start-time time-frame :offset-assert 320) - (continue-time time-frame :offset-assert 328) - (death-time time-frame :offset-assert 336) - (hit-time time-frame :offset-assert 344) - (task-pickup-time time-frame :offset-assert 352) - (unknown-array1 (array time-frame) :offset-assert 360) - (task-enter-times (array time-frame) :offset-assert 364) - (task-in-times (array time-frame) :offset-assert 368) - (death-pos vector-array :offset 372) - (stop-watch-start uint64 :offset-assert 376) - (stop-watch-stop uint64 :offset-assert 384) - (blackout-time time-frame :offset-assert 392) - (letterbox-time time-frame :offset-assert 400) - (hint-play-time time-frame :offset-assert 408) - (display-text-time time-frame :offset-assert 416) - (display-text-handle handle :offset-assert 424) - (death-movie-tick int32 :offset-assert 432) - (want-auto-save symbol :offset-assert 436) - (auto-save-proc handle :offset-assert 440) - (auto-save-status mc-status-code :offset-assert 448) - (auto-save-card int32 :offset-assert 452) - (auto-save-which int32 :offset-assert 456) - (auto-save-count int32 :offset-assert 460) - (pov-camera-handle handle :offset-assert 464) - (other-camera-handle handle :offset-assert 472) - (controller handle 2 :offset-assert 480) - (race-timer uint64 :offset-assert 496) - (race-current-lap-count int32 :offset-assert 504) - (race-total-lap-count int32 :offset-assert 508) - (race-position int32 :offset-assert 512) - (race-number-turbos int32 :offset-assert 516) - (bot-health float 3 :offset-assert 520) - (demo-state uint32 :offset-assert 532) - (wanted-flash symbol :offset-assert 536) - (distance float :offset-assert 540) - (kiosk-timeout uint64 :offset-assert 544) - (pause-start-time time-frame :offset-assert 552) - (game-score (array float) :offset-assert 560) - (goal float :offset-assert 564) - (miss float :offset-assert 568) - (miss-max float :offset-assert 572) - (task-close-times (array time-frame) :offset-assert 576) - (live-eco-pill-count int32 :offset-assert 580) - (live-gem-count int32 :offset-assert 584) - (air-supply float :offset-assert 588) - (homing-beacon int32 :offset-assert 592) - (dark-eco-pickup int32 :offset-assert 596) - (green-eco-pickup int32 :offset-assert 600) + ((mode symbol) + (save-name string) + (life float) + (life-max float) + (money float) + (money-total float) + (money-per-level uint8 32) + (deaths-per-level uint8 32) + (buzzer-total float) + (fuel float) + (gem float) + (gem-total float) + (skill float) + (skill-total float) + (karma float) + (eco-pill-dark float) + (eco-pill-dark-total float) + (features game-feature) + (debug-features game-feature) + (secrets game-secrets) + (unknown-pad1 uint32) + (purchase-secrets game-secrets) + (unknown-pad2 uint32) + (gun-type pickup-type) + (gun-ammo float 4) + (shield float) + (score float) + (score-owner handle) + (timer time-frame) + (timer-owner handle) + (timer-flash symbol) + (counter float) + (counter-flash basic) + (attack-id uint32) + (perm-list entity-perm-array) + (task-perm-list entity-perm-array) + (current-continue continue-point) + (last-continue continue-point) + (play-list (array game-task-info)) + (sub-task-list (array game-task-node-info)) + (mission-list (array game-task-node-info)) + (task-counter uint32) + (unknown-pad6 (array uint16)) + (level-opened uint8 32) + (total-deaths int32) + (continue-deaths int32) + (task-deaths int32) + (total-trys int32) + (game-start-time time-frame) + (continue-time time-frame) + (death-time time-frame) + (hit-time time-frame) + (task-pickup-time time-frame) + (unknown-array1 (array time-frame)) + (task-enter-times (array time-frame)) + (task-in-times (array time-frame)) + (death-pos vector-array :offset 372) + (stop-watch-start uint64) + (stop-watch-stop uint64) + (blackout-time time-frame) + (letterbox-time time-frame) + (hint-play-time time-frame) + (display-text-time time-frame) + (display-text-handle handle) + (death-movie-tick int32) + (want-auto-save symbol) + (auto-save-proc handle) + (auto-save-status mc-status-code) + (auto-save-card int32) + (auto-save-which int32) + (auto-save-count int32) + (pov-camera-handle handle) + (other-camera-handle handle) + (controller handle 2) + (race-timer uint64) + (race-current-lap-count int32) + (race-total-lap-count int32) + (race-position int32) + (race-number-turbos int32) + (bot-health float 3) + (demo-state uint32) + (wanted-flash symbol) + (distance float) + (kiosk-timeout uint64) + (pause-start-time time-frame) + (game-score (array float)) + (goal float) + (miss float) + (miss-max float) + (task-close-times (array time-frame)) + (live-eco-pill-count int32) + (live-gem-count int32) + (air-supply float) + (homing-beacon int32) + (dark-eco-pickup int32) + (green-eco-pickup int32) ) - :method-count-assert 31 - :size-assert #x25c - :flag-assert #x1f0000025c (:methods - (initialize! (_type_ symbol game-save string) _type_ 9) - (give (_type_ symbol float handle) float 10) - (task-complete? (_type_ game-task) symbol 11) - (subtask-index-by-name (_type_ string) int 12) - (set-subtask-hook! (_type_ game-task-node int function) function 13) - (actor-perm (_type_ actor-id) entity-perm 14) - (task-perm-by-index (_type_ int) entity-perm 15) - (copy-perms-from-level! (_type_ level) int 16) - (copy-perms-to-level! (_type_ level) int 17) - (debug-inspect (_type_ symbol) _type_ 18) - (get-current-continue-forced (_type_) continue-point 19) - (get-continue-by-name (_type_ string) continue-point 20) - (set-continue! (_type_ basic symbol) continue-point 21) - (game-info-method-22 (_type_) int 22) - (save-game (_type_ game-save string) game-save 23) - (load-game (_type_ game-save) game-save 24) - (you-suck-stage (_type_ symbol) int 25) - (you-suck-scale (_type_ object) float 26) - (get-next-attack-id (_type_) uint 27) - (game-info-method-28 (_type_ game-score float) int 28) - (get-game-score-ref (_type_ int) (pointer float) 29) - (calculate-percentage (_type_) float 30) + (initialize! (_type_ symbol game-save string) _type_) + (give (_type_ symbol float handle) float) + (task-complete? (_type_ game-task) symbol) + (subtask-index-by-name (_type_ string) int) + (set-subtask-hook! (_type_ game-task-node int function) function) + (actor-perm (_type_ actor-id) entity-perm) + (task-perm-by-index (_type_ int) entity-perm) + (copy-perms-from-level! (_type_ level) int) + (copy-perms-to-level! (_type_ level) int) + (debug-inspect (_type_ symbol) _type_) + (get-current-continue-forced (_type_) continue-point) + (get-continue-by-name (_type_ string) continue-point) + (set-continue! (_type_ basic symbol) continue-point) + (game-info-method-22 (_type_) int) + (save-game (_type_ game-save string) game-save) + (load-game (_type_ game-save) game-save) + (you-suck-stage (_type_ symbol) int) + (you-suck-scale (_type_ object) float) + (get-next-attack-id (_type_) uint) + (game-info-method-28 (_type_ game-score float) int) + (get-game-score-ref (_type_ int) (pointer float)) + (calculate-percentage (_type_) float) ) ) -(defmethod get-next-attack-id game-info ((this game-info)) +(defmethod get-next-attack-id ((this game-info)) (let ((v0-0 (+ (-> this attack-id) 1))) (set! (-> this attack-id) v0-0) v0-0 diff --git a/goal_src/jak2/engine/game/game-info.gc b/goal_src/jak2/engine/game/game-info.gc index 627cff1146e..ce7d32be76e 100644 --- a/goal_src/jak2/engine/game/game-info.gc +++ b/goal_src/jak2/engine/game/game-info.gc @@ -15,7 +15,7 @@ ;; DECOMP BEGINS -(defmethod debug-draw border-plane ((this border-plane)) +(defmethod debug-draw ((this border-plane)) (let* ((v1-0 (-> this action)) (plane-color (if (= v1-0 'load) (the-as uint #x8000ff00) @@ -43,15 +43,15 @@ 0 ) -(defmethod point-past-plane? border-plane ((this border-plane) (arg0 vector)) +(defmethod point-past-plane? ((this border-plane) (arg0 vector)) (>= (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) (-> this normal)) 0.0) ) -(defmethod task-complete? game-info ((this game-info) (arg0 game-task)) +(defmethod task-complete? ((this game-info) (arg0 game-task)) (logtest? (-> this task-perm-list data arg0 status) (entity-perm-status complete)) ) -(defmethod subtask-index-by-name game-info ((this game-info) (arg0 string)) +(defmethod subtask-index-by-name ((this game-info) (arg0 string)) (let ((subtasks (-> *game-info* sub-task-list))) (dotimes (i (-> subtasks length)) (when (nonzero? i) @@ -66,7 +66,7 @@ 0 ) -(defmethod set-subtask-hook! game-info ((this game-info) (arg0 game-task-node) (arg1 int) (arg2 function)) +(defmethod set-subtask-hook! ((this game-info) (arg0 game-task-node) (arg1 int) (arg2 function)) (let ((subtask (-> this sub-task-list arg0))) (if (and subtask (-> subtask info)) (set! (-> subtask info hooks arg1) arg2) @@ -97,7 +97,7 @@ ) ) -(defmethod continue-point-method-10 continue-point ((this continue-point) (arg0 load-state)) +(defmethod continue-point-method-10 ((this continue-point) (arg0 load-state)) (let ((v1-0 (lookup-level-info (-> this vis-nick)))) (set! (-> this vis-nick) (if v1-0 (-> v1-0 name) @@ -130,7 +130,7 @@ this ) -(defmethod move-camera! continue-point ((this continue-point)) +(defmethod move-camera! ((this continue-point)) (set! (-> *camera-combiner* trans quad) (-> this camera-trans quad)) (let ((gp-0 (-> *camera-combiner* inv-camera-rot)) (s5-0 (-> this camera-rot)) @@ -152,7 +152,7 @@ (none) ) -(defmethod get-current-continue-forced game-info ((this game-info)) +(defmethod get-current-continue-forced ((this game-info)) (cond ((and (= (-> this mode) 'play) (-> this current-continue)) (-> this current-continue) @@ -168,7 +168,7 @@ ) ) -(defmethod get-continue-by-name game-info ((this game-info) (arg0 string)) +(defmethod get-continue-by-name ((this game-info) (arg0 string)) (if (not arg0) (return (the-as continue-point #f)) ) @@ -191,7 +191,7 @@ ) ;; WARN: Using new Jak 2 rtype-of -(defmethod set-continue! game-info ((this game-info) (arg0 basic) (arg1 symbol)) +(defmethod set-continue! ((this game-info) (arg0 basic) (arg1 symbol)) (let ((s5-0 (-> this current-continue))) (if (null? arg0) (set! arg0 (the-as basic #f)) @@ -240,11 +240,11 @@ (-> this current-continue) ) -(defmethod task-perm-by-index game-info ((this game-info) (arg0 int)) +(defmethod task-perm-by-index ((this game-info) (arg0 int)) (-> this task-perm-list data arg0) ) -(defmethod calculate-percentage game-info ((this game-info)) +(defmethod calculate-percentage ((this game-info)) (let ((story-total 0) (story-complete 0) ) @@ -293,7 +293,7 @@ ) ) -(defmethod initialize! game-info ((this game-info) (arg0 symbol) (arg1 game-save) (arg2 string)) +(defmethod initialize! ((this game-info) (arg0 symbol) (arg1 game-save) (arg2 string)) (local-vars (v0-3 int) (sv-96 game-task-node-info) (sv-112 symbol)) (case arg0 (('dead 'life) @@ -570,7 +570,7 @@ this ) -(defmethod give game-info ((this game-info) (arg0 symbol) (arg1 float) (arg2 handle)) +(defmethod give ((this game-info) (arg0 symbol) (arg1 float) (arg2 handle)) (local-vars (ammo-max float)) (with-pp (case arg0 @@ -745,12 +745,12 @@ ) ) -(defmethod game-info-method-22 game-info ((this game-info)) +(defmethod game-info-method-22 ((this game-info)) 0 ) ;; WARN: Return type mismatch float vs none. -(defmethod reset! fact-info-target ((this fact-info-target) (arg0 symbol)) +(defmethod reset! ((this fact-info-target) (arg0 symbol)) (when (or (not arg0) (= arg0 'eco)) (set! (-> this eco-timeout) 0) (set! (-> this eco-level) 0.0) @@ -781,7 +781,7 @@ (none) ) -(defmethod pickup-collectable! fact-info-target ((this fact-info-target) (arg0 pickup-type) (arg1 float) (arg2 handle)) +(defmethod pickup-collectable! ((this fact-info-target) (arg0 pickup-type) (arg1 float) (arg2 handle)) (case arg0 (((pickup-type health) (pickup-type eco-green)) (cond @@ -1122,7 +1122,7 @@ ) ) -(defmethod actor-perm game-info ((this game-info) (arg0 actor-id)) +(defmethod actor-perm ((this game-info) (arg0 actor-id)) (let ((game-perms (-> this perm-list))) (countdown (i (-> game-perms length)) (if (= arg0 (-> game-perms data i aid)) @@ -1133,7 +1133,7 @@ (the-as entity-perm #f) ) -(defmethod copy-perms-from-level! game-info ((this game-info) (arg0 level)) +(defmethod copy-perms-from-level! ((this game-info) (arg0 level)) (let ((game-perms (-> this perm-list)) (level-entities (-> arg0 bsp level entity)) ) @@ -1158,7 +1158,7 @@ 0 ) -(defmethod copy-perms-to-level! game-info ((this game-info) (arg0 level)) +(defmethod copy-perms-to-level! ((this game-info) (arg0 level)) (let ((level-entities (-> arg0 bsp level entity))) (dotimes (i (-> level-entities length)) (let* ((entity-perm (-> level-entities data i entity extra perm)) @@ -1174,12 +1174,12 @@ 0 ) -(defmethod print continue-point ((this continue-point)) +(defmethod print ((this continue-point)) (format #t "#<~A ~S @ #x~X>" (-> this type) (-> this name) this) this ) -(defmethod debug-draw continue-point ((this continue-point)) +(defmethod debug-draw ((this continue-point)) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this trans) (new 'static 'rgba :r #xff :a #x80)) (add-debug-text-3d #t @@ -1387,12 +1387,12 @@ 0 ) -(defmethod print game-task-info ((this game-task-info)) +(defmethod print ((this game-task-info)) (format #t "#" (-> this name) this) this ) -(defmethod debug-inspect game-info ((this game-info) (arg0 symbol)) +(defmethod debug-inspect ((this game-info) (arg0 symbol)) (local-vars (sv-16 int) (sv-24 int) @@ -1604,7 +1604,7 @@ this ) -(defmethod you-suck-stage game-info ((this game-info) (arg0 symbol)) +(defmethod you-suck-stage ((this game-info) (arg0 symbol)) (cond ((logtest? (-> *game-info* secrets) (game-secrets hero-mode)) 0 @@ -1638,11 +1638,11 @@ ) ) -(defmethod you-suck-scale game-info ((this game-info) (arg0 object)) +(defmethod you-suck-scale ((this game-info) (arg0 object)) (* 0.25 (the float (you-suck-stage this #f))) ) -(defmethod adjust-to-screen-flip cpad-info ((this cpad-info)) +(defmethod adjust-to-screen-flip ((this cpad-info)) (when (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) (set! (-> this leftx) (- 255 (the-as int (-> this leftx)))) (set! (-> this rightx) (- 255 (the-as int (-> this rightx)))) @@ -1650,7 +1650,7 @@ 0 ) -(defmethod game-info-method-28 game-info ((this game-info) (arg0 game-score) (arg1 float)) +(defmethod game-info-method-28 ((this game-info) (arg0 game-score) (arg1 float)) (when (!= arg1 0.0) (let ((v1-3 (&+ (-> this game-score data) (* (* arg0 8) 4)))) (case arg0 @@ -1699,12 +1699,11 @@ -1 ) -(defmethod get-game-score-ref game-info ((this game-info) (arg0 int)) +(defmethod get-game-score-ref ((this game-info) (arg0 int)) (&+ (-> this game-score data) (* (* arg0 8) 4)) ) -;; TODO - make an enum for the highscore-place -(defmethod get-rank highscore-info ((this highscore-info) (score float)) +(defmethod get-rank ((this highscore-info) (score float)) (let ((place 0)) (cond ((logtest? (-> this flags) (highscore-flags time)) diff --git a/goal_src/jak2/engine/game/game-save.gc b/goal_src/jak2/engine/game/game-save.gc index e030e73d67c..573f4b9eafa 100644 --- a/goal_src/jak2/engine/game/game-save.gc +++ b/goal_src/jak2/engine/game/game-save.gc @@ -94,64 +94,58 @@ ) (deftype game-save-tag (structure) - ((user-object object 2 :offset 0) - (user-uint64 uint64 :offset 0) - (user-float0 float :offset 0) - (user-float float 2 :offset 0) - (user-int32 int32 2 :offset 0) - (user-uint32 uint32 2 :offset 0) - (user-int16 int16 4 :offset 0) - (user-uint16 uint16 4 :offset 0) - (user-int8 int8 8 :offset 0) - (user-int80 int8 :offset 0) - (user-int81 int8 :offset 1) - (user-uint8 uint8 8 :offset 0) - (elt-count int32 :offset-assert 8) - (elt-size uint16 :offset-assert 12) - (elt-type game-save-elt :offset-assert 14) + ((user-object object 2 :offset 0) + (user-uint64 uint64 :overlay-at (-> user-object 0)) + (user-float0 float :overlay-at user-uint64) + (user-float float 2 :overlay-at user-float0) + (user-int32 int32 2 :overlay-at user-float0) + (user-uint32 uint32 2 :overlay-at user-float0) + (user-int16 int16 4 :overlay-at user-uint64) + (user-uint16 uint16 4 :overlay-at user-uint64) + (user-int8 int8 8 :overlay-at user-uint64) + (user-int80 int8 :overlay-at user-uint64) + (user-int81 int8 :overlay-at (-> user-int8 1)) + (user-uint8 uint8 8 :overlay-at user-int80) + (elt-count int32) + (elt-size uint16) + (elt-type game-save-elt) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype game-save (basic) - ((version int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (length int32 :offset-assert 12) - (info-int32 int32 16 :offset-assert 16) - (info-int8 int8 64 :offset 16) - (level-index int32 :offset 16) - (gem-count float :offset 20) - (skill-count float :offset 24) - (completion-percentage float :offset 28) - (minute uint8 :offset 36) - (hour uint8 :offset 37) - (week uint8 :offset 38) - (day uint8 :offset 39) - (month uint8 :offset 40) - (year uint8 :offset 41) - (new-game int32 :offset 44) - (game-time time-frame :offset 48) - (secrets uint32 :offset 56) - (features uint32 :offset 60) - (tag game-save-tag :inline :dynamic :offset-assert 80) + ((version int32) + (allocated-length int32) + (length int32) + (info-int32 int32 16) + (info-int8 int8 64 :overlay-at (-> info-int32 0)) + (level-index int32 :overlay-at (-> info-int32 0)) + (gem-count float :overlay-at (-> info-int32 1)) + (skill-count float :overlay-at (-> info-int32 2)) + (completion-percentage float :overlay-at (-> info-int32 3)) + (minute uint8 :overlay-at (-> info-int32 5)) + (hour uint8 :overlay-at (-> info-int8 21)) + (week uint8 :overlay-at (-> info-int8 22)) + (day uint8 :overlay-at (-> info-int8 23)) + (month uint8 :overlay-at (-> info-int32 6)) + (year uint8 :overlay-at (-> info-int8 25)) + (new-game int32 :overlay-at (-> info-int32 7)) + (game-time time-frame :overlay-at (-> info-int32 8)) + (secrets uint32 :overlay-at (-> info-int32 10)) + (features uint32 :overlay-at (-> info-int32 11)) + (tag game-save-tag :inline :dynamic) ) - :method-count-assert 12 - :size-assert #x50 - :flag-assert #xc00000050 (:methods - (new (symbol type int) _type_ 0) - (save-to-file (_type_ string) _type_ 9) - (load-from-file (_type_ string) _type_ 10) - (debug-inspect (_type_ symbol) _type_ 11) + (new (symbol type int) _type_) + (save-to-file (_type_ string) _type_) + (load-from-file (_type_ string) _type_) + (debug-inspect (_type_ symbol) _type_) ) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of game-save ((this game-save)) +(defmethod asize-of ((this game-save)) (the-as int (+ (-> game-save size) (-> this allocated-length))) ) @@ -163,7 +157,7 @@ ) ) -(defmethod debug-inspect game-save ((this game-save) (arg0 symbol)) +(defmethod debug-inspect ((this game-save) (arg0 symbol)) (local-vars (sv-16 int) (sv-32 string) (sv-48 string)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tversion: ~D~%" (-> this version)) @@ -313,7 +307,7 @@ (debug-inspect this #f) ) -(defmethod save-game game-info ((this game-info) (arg0 game-save) (arg1 string)) +(defmethod save-game ((this game-info) (arg0 game-save) (arg1 string)) (with-pp (dotimes (s4-0 (-> *level* length)) (let ((a1-1 (-> *level* level s4-0))) @@ -1105,7 +1099,7 @@ ) ) -(defmethod load-game game-info ((this game-info) (arg0 game-save)) +(defmethod load-game ((this game-info) (arg0 game-save)) (let ((v1-0 (the-as object (-> arg0 tag)))) (while (< (the-as int v1-0) (the-as int (&-> arg0 tag 0 user-int8 (-> arg0 length)))) (case (-> (the-as (inline-array game-save-tag) v1-0) 0 elt-type) @@ -1569,7 +1563,7 @@ arg0 ) -(defmethod save-to-file game-save ((this game-save) (arg0 string)) +(defmethod save-to-file ((this game-save) (arg0 string)) (let ((s5-0 (new 'stack 'file-stream arg0 'write))) (file-stream-write s5-0 (&-> this type) (+ (-> this type size) (-> this length))) (file-stream-close s5-0) @@ -1577,7 +1571,7 @@ this ) -(defmethod load-from-file game-save ((this game-save) (arg0 string)) +(defmethod load-from-file ((this game-save) (arg0 string)) (let ((s5-0 (new 'stack 'file-stream arg0 'read))) (let ((s3-0 (file-stream-length s5-0)) (s4-0 (-> this allocated-length)) @@ -1620,33 +1614,29 @@ (define *auto-save-info* (new 'global 'mc-slot-info)) (deftype auto-save (process) - ((card int32 :offset-assert 128) - (slot int32 :offset-assert 132) - (which int32 :offset-assert 136) - (buffer kheap :offset-assert 140) - (mode symbol :offset-assert 144) - (result mc-status-code :offset-assert 148) - (save game-save :offset-assert 152) - (info mc-slot-info :inline :offset-assert 156) - (notify handle :offset-assert 456) - (force symbol :offset-assert 464) - (state-time time-frame :offset-assert 472) - (icon hud-sprite :inline :offset 480) + ((card int32) + (slot int32) + (which int32) + (buffer kheap) + (mode symbol) + (result mc-status-code) + (save game-save) + (info mc-slot-info :inline) + (notify handle) + (force symbol) + (state-time time-frame) + (icon hud-sprite :inline :offset 480) ) - :heap-base #x1a0 - :method-count-assert 23 - :size-assert #x214 - :flag-assert #x1701a00214 - (:methods - (get-heap () _type_ :state 14) - (get-card () _type_ :state 15) - (format-card () _type_ :state 16) - (unformat-card () _type_ :state 17) - (create-file () _type_ :state 18) - (save () _type_ :state 19) - (restore () _type_ :state 20) - (error (mc-status-code) _type_ :state 21) - (done () _type_ :state 22) + (:state-methods + get-heap + get-card + format-card + unformat-card + create-file + save + restore + (error mc-status-code) + done ) ) diff --git a/goal_src/jak2/engine/game/idle-control.gc b/goal_src/jak2/engine/game/idle-control.gc index 3c9e9966598..d564f82edd7 100644 --- a/goal_src/jak2/engine/game/idle-control.gc +++ b/goal_src/jak2/engine/game/idle-control.gc @@ -20,30 +20,24 @@ (param0 uint8 :offset 16 :size 8) (param1 uint8 :offset 24 :size 8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype idle-control (structure) - ((anim (pointer idle-control-frame) :offset-assert 0) - (current (pointer idle-control-frame) :offset-assert 4) - (counter int32 :offset-assert 8) - (target int32 :offset-assert 12) + ((anim (pointer idle-control-frame)) + (current (pointer idle-control-frame)) + (counter int32) + (target int32) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (idle-control-method-9 (_type_ (pointer idle-control-frame)) none 9) - (idle-control-method-10 (_type_ process-drawable) none :behavior process-drawable 10) + (idle-control-method-9 (_type_ (pointer idle-control-frame)) none) + (idle-control-method-10 (_type_ process-drawable) none :behavior process-drawable) ) ) ;; WARN: Return type mismatch idle-control vs none. -(defmethod idle-control-method-9 idle-control ((this idle-control) (arg0 (pointer idle-control-frame))) +(defmethod idle-control-method-9 ((this idle-control) (arg0 (pointer idle-control-frame))) (set! (-> this anim) arg0) (set! (-> this current) arg0) (set! (-> this counter) 0) @@ -53,7 +47,7 @@ ;; TODO - method manually patched (maybe incorrectly) around `self` changing ;; WARN: Function (method 10 idle-control) has a return type of none, but the expression builder found a return statement. -(defmethod idle-control-method-10 idle-control ((this idle-control) (arg0 process-drawable)) +(defmethod idle-control-method-10 ((this idle-control) (arg0 process-drawable)) (local-vars (a1-1 int) (backup-pp process)) (when (nonzero? (-> this anim)) (with-pp diff --git a/goal_src/jak2/engine/game/main-h.gc b/goal_src/jak2/engine/game/main-h.gc index 65f1c347afe..227674b8560 100644 --- a/goal_src/jak2/engine/game/main-h.gc +++ b/goal_src/jak2/engine/game/main-h.gc @@ -129,112 +129,212 @@ ;; engine debug settings (define *stats-poly* #f) + (define *stats-memory* #f) + (define *stats-memory-short* #f) + (define *stats-memory-level-index* 0) + (define *stats-collide* #f) + (define *stats-bsp* #f) + (define *stats-buffer* #f) + (define *stats-target* #f) + (define *stats-profile-bars* #f) + (define *stats-perf* #f) + (define *artist-all-visible* #f) + (define *artist-flip-visible* #f) + (define *artist-fix-visible* #f) + (define *artist-fix-frustum* #f) + (define *artist-error-spheres* #f) + (define *artist-use-menu-subdiv* #f) + (define *display-profile* #t) + (define *display-sidekick-stats* #f) + (define *display-quad-stats* #f) + (define *display-tri-stats* #f) + (define *display-ground-stats* #f) + (define *display-collision-marks* #f) + (define *display-collide-cache* #f) + (define *display-render-collision* #f) + (define *display-hipri-collision-marks* #f) + (define *display-edge-collision-marks* #f) + (define *display-geo-marks* #f) + (define *display-target-marks* #f) + (define *target-rc-board-controls* #f) + (define *display-collide-history* 0) + (define *display-xyz-axes* #f) + (define *display-cam-collide-history* #f) + (define *record-cam-collide-history* #f) + (define *display-cam-master-marks* #f) + (define *display-cam-other* #f) + (define *display-camera-marks* #f) + (define *camera-no-mip-correction* #f) + (define *display-cam-los-info* #f) + (define *display-cam-los-debug* #f) + (define *display-cam-los-marks* #f) + (define *display-cam-coll-marks* #f) + (define *display-camera-info* #f) + (define *display-camera-old-stats* #f) + (define *display-camera-last-attacker* #f) + (define *display-file-info* #f) + (define *display-actor-marks* #f) + (define *display-sprite-info* #f) + (define *display-sprite-marks* #f) + (define *display-sprite-spheres* #f) + (define *display-entity-errors* #t) (#when PC_PORT (define *display-lights* #f)) + (define *display-instance-info* #f) + (define *display-deci-count* #f) + (define *sync-dma* #f) + (define *display-strip-lines* (the-as strip-lines-controls 0)) + (define *display-battle-marks* #f) + (define *display-joint-axes* #f) + (define *display-nav-marks* #f) + (define *display-nav-network* #f) + (define *display-path-marks* #f) + (define *display-vol-marks* #f) + (define *display-water-marks* #f) + (define *display-nav-mesh* #f) + (define *display-actor-pointer* #f) + (define *display-actor-vis* #f) + (define *display-actor-graph* #f) + (define *display-traffic-height-map* #f) + (define *display-trail-graph* #f) + (define *display-color-bars* #f) + (define *display-bug-report* #f) + (define *display-level-border* #f) + (define *display-memcard-info* #f) + (define *display-split-boxes* #f) + (define *display-split-box-info* #f) + (define *display-texture-distances* #f) + (define *display-texture-download* #f) + (define *display-art-control* #f) + (define *display-gui-control* #f) + (define *display-level-spheres* #f) + (define *time-of-day-fast* #f) + (define *display-iop-info* #f) + (define *ambient-sound-class* #t) + (define *slow-frame-rate* #f) + (define *display-region-marks* #f) + (define *execute-regions* #t) + (define *debug-pause* #f) + (define *debug-view-anims* #f) + (define *debug-unkillable* #f) + (define *debug-actor* (the-as object #f)) + (define *gun-marks* #f) -(define *bug-report-output-mode* - (if *debug-segment* - 'file-stream - '*stdcon* - ) + +(define *bug-report-output-mode* (if *debug-segment* + 'file-stream + '*stdcon* + ) ) + (define *display-scene-control* (the-as scene-controls 0)) + (define *display-bot-marks* (the-as bot-marks-controls 0)) + (define *display-race-marks* (the-as race-marks-controls 0)) + (define *race-record-path* #f) + (define *select-race* (the-as race-selection 0)) + (define *select-race-path* 0) + (define *bot-record-path* -1) + (define *subdivide-draw-mode* (the-as subdivide-setting 0)) + (define *subdivide-scissor-draw-mode* (the-as subdivide-setting 0)) + (define *subdivide-foreground-draw-mode* (the-as subdivide-setting 0)) + (define *subdivide-ocean-draw-mode* (the-as subdivide-setting 0)) + (define *ocean-height-hack* (the-as ocean-height-hack 0)) ;; Main Loop stuff @@ -264,33 +364,27 @@ ;; unused? (deftype frame-stats (structure) - ((field-time time-frame 2 :offset-assert 0) - (field int32 :offset-assert 16) + ((field-time time-frame 2) + (field int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (define *frame-stats* (new 'static 'frame-stats)) (deftype screen-filter (basic) - ((draw? symbol :offset-assert 4) - (bucket bucket-id :offset-assert 8) - (color vector :inline :offset-assert 16) - (color-src vector :inline :offset-assert 32) - (color-dest vector :inline :offset-assert 48) - (extra vector :inline :offset-assert 64) - (speed float :offset 64) - (current-interp float :offset 68) + ((draw? symbol) + (bucket bucket-id) + (color vector :inline) + (color-src vector :inline) + (color-dest vector :inline) + (extra vector :inline) + (speed float :overlay-at (-> extra data 0)) + (current-interp float :overlay-at (-> extra data 1)) ) - :method-count-assert 12 - :size-assert #x50 - :flag-assert #xc00000050 (:methods - (draw (_type_) none 9) - (setup (_type_ vector vector float bucket-id) none 10) - (disable (_type_) none 11) + (draw (_type_) none) + (setup (_type_ vector vector float bucket-id) none) + (disable (_type_) none) ) ) @@ -366,23 +460,20 @@ ;; collision renderer settings. (deftype col-rend (basic) - ((draw? symbol :offset-assert 4) - (outline? symbol :offset-assert 8) - (show-back-faces? symbol :offset-assert 12) - (show-normals? symbol :offset-assert 16) - (ghost-hidden? symbol :offset-assert 20) - (show-only uint32 :offset-assert 24) - (cspec collide-spec :offset-assert 28) - (track uint8 :offset-assert 32) - (bbox-radius float :offset-assert 36) - (bbox-center vector :inline :offset-assert 48) - (camera-to-bbox-dist float :offset-assert 64) + ((draw? symbol) + (outline? symbol) + (show-back-faces? symbol) + (show-normals? symbol) + (ghost-hidden? symbol) + (show-only uint32) + (cspec collide-spec) + (track uint8) + (bbox-radius float) + (bbox-center vector :inline) + (camera-to-bbox-dist float) ) - :method-count-assert 10 - :size-assert #x44 - :flag-assert #xa00000044 (:methods - (col-rend-method-9 (_type_) none 9) + (col-rend-method-9 (_type_) none) ) ) @@ -400,7 +491,6 @@ ) ) - (defun-debug debug-actor? ((arg0 object)) (= arg0 *debug-actor*) ) diff --git a/goal_src/jak2/engine/game/main.gc b/goal_src/jak2/engine/game/main.gc index dd7644c6b78..785b3edf659 100644 --- a/goal_src/jak2/engine/game/main.gc +++ b/goal_src/jak2/engine/game/main.gc @@ -313,7 +313,7 @@ (define *screen-filter* (new 'static 'screen-filter :draw? #f :bucket (bucket-id screen-filter))) -(defmethod draw screen-filter ((this screen-filter)) +(defmethod draw ((this screen-filter)) (local-vars (v1-1 float)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -358,7 +358,7 @@ ) ) -(defmethod setup screen-filter ((this screen-filter) (arg0 vector) (arg1 vector) (arg2 float) (arg3 bucket-id)) +(defmethod setup ((this screen-filter) (arg0 vector) (arg1 vector) (arg2 float) (arg3 bucket-id)) (set! (-> this draw?) #t) (set! (-> this color quad) (-> arg0 quad)) (set! (-> this color-src quad) (-> arg0 quad)) @@ -370,7 +370,7 @@ (none) ) -(defmethod disable screen-filter ((this screen-filter)) +(defmethod disable ((this screen-filter)) (set! (-> this draw?) #f) 0 (none) diff --git a/goal_src/jak2/engine/game/pilot-h.gc b/goal_src/jak2/engine/game/pilot-h.gc index 2618cdfe226..e77d1b1872d 100644 --- a/goal_src/jak2/engine/game/pilot-h.gc +++ b/goal_src/jak2/engine/game/pilot-h.gc @@ -8,44 +8,38 @@ ;; DECOMP BEGINS (deftype vehicle-controls (structure) - ((steering float :offset-assert 0) - (throttle float :offset-assert 4) - (brake float :offset-assert 8) - (lean-z float :offset-assert 12) + ((steering float) + (throttle float) + (brake float) + (lean-z float) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype pilot-info (basic) - ((entity basic :offset-assert 4) - (vehicle handle :offset-assert 8) - (left-right-interp float :offset-assert 16) - (front-back-interp float :offset-assert 20) - (up-down-interp float :offset-assert 24) - (up-down-accel-factor float :offset-assert 28) - (front-back-accel-factor float :offset-assert 32) - (left-right-accel-factor float :offset-assert 36) - (stance uint8 :offset-assert 40) - (seat-index int8 :offset-assert 41) - (backup-nav-radius float :offset-assert 44) - (cam-side-shift float :offset-assert 48) - (enable-cam-side-shift symbol :offset-assert 52) - (gun? symbol :offset-assert 56) - (controls vehicle-controls :inline :offset-assert 60) - (accel-array vector 8 :inline :offset-assert 80) - (local-accel vector :inline :offset-assert 208) - (pilot-trans vector :inline :offset-assert 224) - (pilot-quat vector :inline :offset-assert 240) - (pilot-scale vector :inline :offset-assert 256) - (pilot-time time-frame :offset-assert 272) - (as-daxter? symbol :offset-assert 280) - (art-group-backup basic :offset-assert 284) + ((entity basic) + (vehicle handle) + (left-right-interp float) + (front-back-interp float) + (up-down-interp float) + (up-down-accel-factor float) + (front-back-accel-factor float) + (left-right-accel-factor float) + (stance uint8) + (seat-index int8) + (backup-nav-radius float) + (cam-side-shift float) + (enable-cam-side-shift symbol) + (gun? symbol) + (controls vehicle-controls :inline) + (accel-array vector 8 :inline) + (local-accel vector :inline) + (pilot-trans vector :inline) + (pilot-quat vector :inline) + (pilot-scale vector :inline) + (pilot-time time-frame) + (as-daxter? symbol) + (art-group-backup basic) ) - :method-count-assert 9 - :size-assert #x120 - :flag-assert #x900000120 ) diff --git a/goal_src/jak2/engine/game/settings-h.gc b/goal_src/jak2/engine/game/settings-h.gc index 6247b999249..4628506ab54 100644 --- a/goal_src/jak2/engine/game/settings-h.gc +++ b/goal_src/jak2/engine/game/settings-h.gc @@ -120,211 +120,202 @@ ;; DECOMP BEGINS (deftype user-setting-data (structure) - ((border-mode symbol :offset-assert 0) - (process-mask process-mask :offset-assert 4) - (unknown-int32-00 int32 :offset-assert 8) - (language language-enum :offset 16) - (display-dx int32 :offset-assert 24) - (display-dy int32 :offset-assert 28) - (vibration symbol :offset 32) - (play-hints symbol :offset 36) - (movie (pointer process) :offset 40) - (talking (pointer process) :offset-assert 44) - (spooling (pointer process) :offset-assert 48) - (hint (pointer process) :offset-assert 52) - (ambient (pointer process) :offset-assert 56) - (video-mode symbol :offset-assert 60) - (aspect-ratio symbol :offset-assert 64) - (use-progressive-scan symbol :offset 68) - (auto-save symbol :offset 72) - (bg-r float :offset-assert 76) - (bg-g float :offset-assert 80) - (bg-b float :offset-assert 84) - (bg-a float :offset-assert 88) - (bg-a-speed float :offset-assert 92) - (bg-a-force float :offset-assert 96) - (allow-progress symbol :offset-assert 100) - (allow-pause symbol :offset-assert 104) - (ocean-off symbol :offset-assert 108) - (allow-look-around symbol :offset-assert 112) - (camera-stick-dir symbol :offset-assert 116) - (movie-name symbol :offset 120) - (weather symbol :offset-assert 124) - (mouse symbol :offset-assert 128) - (cursor symbol :offset-assert 132) - (task-mask task-mask :offset 136) - (region-mode symbol :offset-assert 140) - (duck symbol :offset 144) - (attack symbol :offset-assert 148) - (gun symbol :offset-assert 152) - (board symbol :offset-assert 156) - (jump symbol :offset-assert 160) - (speed-mult float :offset-assert 164) - (features game-feature :offset-assert 168) - (sfx-volume float :offset-assert 176) - (sfx-movie-volume float :offset-assert 180) - (music-volume float :offset-assert 184) - (music-volume-movie float :offset-assert 188) - (dialog-volume float :offset-assert 192) - (dialog-volume-hint float :offset-assert 196) - (ambient-volume float :offset-assert 200) - (ambient-volume-move float :offset-assert 204) - (sound-flava uint8 :offset-assert 208) - (sound-flava-priority float :offset-assert 212) - (mode-sound-bank uint32 :offset-assert 216) - (sound-excitement float :offset-assert 220) - (sound-reverb float :offset-assert 224) - (stereo-mode int32 :offset-assert 228) - (music symbol :offset-assert 232) - (sound-stinger int32 :offset-assert 236) - (spool-anim spool-anim :offset-assert 240) - (sound-mode uint32 :offset-assert 244) - (task-manager (pointer process) :offset-assert 248) - (task symbol :offset-assert 252) - (airlock symbol :offset-assert 256) - (minimap uint16 :offset-assert 260) - (sound-tune uint32 :offset-assert 264) - (allow-continue symbol :offset-assert 268) - (spotlight-color rgba :offset-assert 272) - (subtitle symbol :offset-assert 276) - (borrow pair :offset-assert 280) - (doorway symbol :offset-assert 284) - (gem symbol :offset-assert 288) - (half-speed symbol :offset-assert 292) - (gun-buoy symbol :offset-assert 296) - (double-jump symbol :offset-assert 300) - (pilot symbol :offset-assert 304) - (pilot-exit symbol :offset-assert 308) - (exclusive-task int32 :offset-assert 312) - (speech-control symbol :offset-assert 316) - (vehicle-hijacking symbol :offset-assert 320) - (darkjak symbol :offset-assert 324) - (endlessfall symbol :offset-assert 328) - (rain float :offset-assert 332) - (snow float :offset-assert 336) - (exclusive-load symbol :offset-assert 340) - (render symbol :offset-assert 344) - (allow-timeout symbol :offset-assert 348) - (mirror symbol :offset-assert 352) - (movie-skip-frame float :offset-assert 356) - (allow-blackout symbol :offset-assert 360) - (race-minimap int32 :offset-assert 364) - (extra-bank pair :offset-assert 368) - (beard symbol :offset-assert 372) - (ignore-target symbol :offset-assert 376) - (subtitle-language language-enum :offset-assert 384) - (sound-bank-load symbol :offset-assert 392) - (allow-error symbol :offset-assert 396) - (under-water-pitch-mod float :offset-assert 400) - (dummy object 31 :offset-assert 404) + ((border-mode symbol) + (process-mask process-mask) + (unknown-int32-00 int32) + (language language-enum :offset 16) + (display-dx int32) + (display-dy int32) + (vibration symbol :offset 32) + (play-hints symbol :offset 36) + (movie (pointer process) :offset 40) + (talking (pointer process)) + (spooling (pointer process)) + (hint (pointer process)) + (ambient (pointer process)) + (video-mode symbol) + (aspect-ratio symbol) + (use-progressive-scan symbol :offset 68) + (auto-save symbol :offset 72) + (bg-r float) + (bg-g float) + (bg-b float) + (bg-a float) + (bg-a-speed float) + (bg-a-force float) + (allow-progress symbol) + (allow-pause symbol) + (ocean-off symbol) + (allow-look-around symbol) + (camera-stick-dir symbol) + (movie-name symbol :offset 120) + (weather symbol) + (mouse symbol) + (cursor symbol) + (task-mask task-mask :offset 136) + (region-mode symbol) + (duck symbol :offset 144) + (attack symbol) + (gun symbol) + (board symbol) + (jump symbol) + (speed-mult float) + (features game-feature) + (sfx-volume float) + (sfx-movie-volume float) + (music-volume float) + (music-volume-movie float) + (dialog-volume float) + (dialog-volume-hint float) + (ambient-volume float) + (ambient-volume-move float) + (sound-flava uint8) + (sound-flava-priority float) + (mode-sound-bank uint32) + (sound-excitement float) + (sound-reverb float) + (stereo-mode int32) + (music symbol) + (sound-stinger int32) + (spool-anim spool-anim) + (sound-mode uint32) + (task-manager (pointer process)) + (task symbol) + (airlock symbol) + (minimap uint16) + (sound-tune uint32) + (allow-continue symbol) + (spotlight-color rgba) + (subtitle symbol) + (borrow pair) + (doorway symbol) + (gem symbol) + (half-speed symbol) + (gun-buoy symbol) + (double-jump symbol) + (pilot symbol) + (pilot-exit symbol) + (exclusive-task int32) + (speech-control symbol) + (vehicle-hijacking symbol) + (darkjak symbol) + (endlessfall symbol) + (rain float) + (snow float) + (exclusive-load symbol) + (render symbol) + (allow-timeout symbol) + (mirror symbol) + (movie-skip-frame float) + (allow-blackout symbol) + (race-minimap int32) + (extra-bank pair) + (beard symbol) + (ignore-target symbol) + (subtitle-language language-enum) + (sound-bank-load symbol) + (allow-error symbol) + (under-water-pitch-mod float) + (dummy object 31) ) - :method-count-assert 11 - :size-assert #x210 - :flag-assert #xb00000210 (:methods - (user-setting-data-method-9 (_type_ engine engine-pers engine) user-setting-data 9) - (user-setting-data-method-10 (_type_ object symbol float uint) user-setting-data 10) + (user-setting-data-method-9 (_type_ engine engine-pers engine) user-setting-data) + (user-setting-data-method-10 (_type_ object symbol float uint) user-setting-data) ) ) (deftype cam-setting-data (structure) - ((fov degrees :offset-assert 0) - (pov-handle handle :offset 16) - (pov-bone int32 :offset-assert 24) - (pov-offset vector :inline :offset-assert 32) - (string-default symbol :offset-assert 48) - (string-max-length meters :offset-assert 52) - (string-min-length meters :offset-assert 56) - (string-max-height meters :offset-assert 60) - (string-min-height meters :offset-assert 64) - (string-cliff-height meters :offset-assert 68) - (string-camera-ceiling meters :offset-assert 72) - (gun-max-height meters :offset-assert 76) - (gun-min-height meters :offset-assert 80) - (string-local-down vector :inline :offset-assert 96) - (slave-options cam-slave-options :offset-assert 112) - (matrix-blend-max-angle degrees :offset-assert 120) - (matrix-blend-max-partial float :offset-assert 124) - (string-spline-max-move meters :offset-assert 128) - (string-spline-accel meters :offset-assert 132) - (string-spline-max-move-player meters :offset-assert 136) - (string-spline-accel-player meters :offset-assert 140) - (string-startup-vector vector :inline :offset-assert 144) - (string-use-startup-vector symbol :offset-assert 160) - (look-at-point vector :inline :offset-assert 176) - (use-look-at-point symbol :offset-assert 192) - (target-height meters :offset-assert 196) - (foot-offset meters :offset-assert 200) - (head-offset meters :offset-assert 204) - (teleport-on-entity-change symbol :offset-assert 208) - (entity-name string :offset-assert 212) - (entity-or-mode-changed symbol :offset-assert 216) - (master-options cam-master-options :offset-assert 224) - (entity-mask uint32 :offset-assert 232) - (mode-name symbol :offset-assert 236) - (real-entity-name string :offset-assert 240) - (cam-mode symbol :offset-assert 244) - (interp-time uint32 :offset-assert 248) - (no-intro symbol :offset-assert 252) - (use-point-of-interest symbol :offset-assert 256) - (point-of-interest vector :inline :offset-assert 272) - (handle-of-interest handle :offset-assert 288) - (mouse-tumble-point vector :inline :offset-assert 304) - (use-mouse-tumble-point symbol :offset-assert 320) - (mouse-input symbol :offset-assert 324) - (cpad1-skip-buttons symbol :offset-assert 328) - (butt-handle handle :offset-assert 336) - (butt-angle float :offset-assert 344) - (extra-follow-height float :offset-assert 348) - (interp-time-priority uint32 :offset-assert 352) - (string-max-length-default symbol :offset-assert 356) - (string-min-length-default symbol :offset-assert 360) - (string-max-height-default symbol :offset-assert 364) - (string-min-height-default symbol :offset-assert 368) - (dummy object 102 :offset-assert 372) + ((fov degrees) + (pov-handle handle :offset 16) + (pov-bone int32) + (pov-offset vector :inline) + (string-default symbol) + (string-max-length meters) + (string-min-length meters) + (string-max-height meters) + (string-min-height meters) + (string-cliff-height meters) + (string-camera-ceiling meters) + (gun-max-height meters) + (gun-min-height meters) + (string-local-down vector :inline) + (slave-options cam-slave-options) + (matrix-blend-max-angle degrees) + (matrix-blend-max-partial float) + (string-spline-max-move meters) + (string-spline-accel meters) + (string-spline-max-move-player meters) + (string-spline-accel-player meters) + (string-startup-vector vector :inline) + (string-use-startup-vector symbol) + (look-at-point vector :inline) + (use-look-at-point symbol) + (target-height meters) + (foot-offset meters) + (head-offset meters) + (teleport-on-entity-change symbol) + (entity-name string) + (entity-or-mode-changed symbol) + (master-options cam-master-options) + (entity-mask uint32) + (mode-name symbol) + (real-entity-name string) + (cam-mode symbol) + (interp-time uint32) + (no-intro symbol) + (use-point-of-interest symbol) + (point-of-interest vector :inline) + (handle-of-interest handle) + (mouse-tumble-point vector :inline) + (use-mouse-tumble-point symbol) + (mouse-input symbol) + (cpad1-skip-buttons symbol) + (butt-handle handle) + (butt-angle float) + (extra-follow-height float) + (interp-time-priority uint32) + (string-max-length-default symbol) + (string-min-length-default symbol) + (string-max-height-default symbol) + (string-min-height-default symbol) + (dummy object 102) ) - :method-count-assert 11 - :size-assert #x30c - :flag-assert #xb0000030c (:methods - (cam-setting-data-method-9 (_type_ engine engine-pers engine) _type_ 9) - (cam-setting-data-method-10 (_type_ object (pointer process) float int) _type_ 10) + (cam-setting-data-method-9 (_type_ engine engine-pers engine) _type_) + (cam-setting-data-method-10 (_type_ object (pointer process) float int) _type_) ) ) (deftype setting-control (basic) - ((user-current user-setting-data :inline :offset-assert 16) - (user-target user-setting-data :inline :offset-assert 544) - (user-default user-setting-data :inline :offset-assert 1072) - (cam-current cam-setting-data :inline :offset-assert 1600) - (cam-target cam-setting-data :inline :offset-assert 2384) - (cam-default cam-setting-data :inline :offset-assert 3168) - (engine engine :offset-assert 3948) - (engine-pers engine-pers :offset-assert 3952) - (engine-hi engine :offset-assert 3956) - (sound-stinger-time time-frame :offset-assert 3960) - (sound-stinger-change-time time-frame 4 :offset-assert 3968) - (sound-excitement-change-time time-frame :offset-assert 4000) - (sound-excitement-targ float :offset-assert 4008) - (sound-excitement-level uint32 :offset-assert 4012) + ((user-current user-setting-data :inline) + (user-target user-setting-data :inline) + (user-default user-setting-data :inline) + (cam-current cam-setting-data :inline) + (cam-target cam-setting-data :inline) + (cam-default cam-setting-data :inline) + (engine engine) + (engine-pers engine-pers) + (engine-hi engine) + (sound-stinger-time time-frame) + (sound-stinger-change-time time-frame 4) + (sound-excitement-change-time time-frame) + (sound-excitement-targ float) + (sound-excitement-level uint32) ) - :method-count-assert 19 - :size-assert #xfb0 - :flag-assert #x1300000fb0 (:methods - (new (symbol type int) _type_ 0) - (add-setting (_type_ process symbol object object object) none 9) - (persist-with-delay (_type_ symbol time-frame symbol symbol float int) none 10) - (set-setting (_type_ process symbol object object object) none 11) - (remove-setting (_type_ process symbol) none 12) - (kill-persister (_type_ engine-pers object) none 13) - (setting-control-method-14 (_type_ object) connectable 14) - (remove-setting-by-arg0 (_type_ object) none 15) - (set-setting-by-param (_type_ symbol object object object) connection 16) - (apply-settings (_type_) user-setting-data 17) - (update (_type_) user-setting-data 18) + (new (symbol type int) _type_) + (add-setting (_type_ process symbol object object object) none) + (persist-with-delay (_type_ symbol time-frame symbol symbol float int) none) + (set-setting (_type_ process symbol object object object) none) + (remove-setting (_type_ process symbol) none) + (kill-persister (_type_ engine-pers object) none) + (setting-control-method-14 (_type_ object) connectable) + (remove-setting-by-arg0 (_type_ object) none) + (set-setting-by-param (_type_ symbol object object object) connection) + (apply-settings (_type_) user-setting-data) + (update (_type_) user-setting-data) ) ) diff --git a/goal_src/jak2/engine/game/settings.gc b/goal_src/jak2/engine/game/settings.gc index 3749762fd41..89f509ffcc2 100644 --- a/goal_src/jak2/engine/game/settings.gc +++ b/goal_src/jak2/engine/game/settings.gc @@ -15,7 +15,7 @@ (-> *setting-control* user-current language) ) -(defmethod user-setting-data-method-9 user-setting-data ((this user-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) +(defmethod user-setting-data-method-9 ((this user-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) (let ((s3-0 (-> arg1 alive-list))) (while s3-0 (user-setting-data-method-10 @@ -80,7 +80,7 @@ this ) -(defmethod user-setting-data-method-10 user-setting-data ((this user-setting-data) (arg0 object) (arg1 symbol) (arg2 float) (arg3 uint)) +(defmethod user-setting-data-method-10 ((this user-setting-data) (arg0 object) (arg1 symbol) (arg2 float) (arg3 uint)) "set-defaults! perhaps?" (case arg0 (('border-mode) @@ -482,7 +482,7 @@ this ) -(defmethod cam-setting-data-method-9 cam-setting-data ((this cam-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) +(defmethod cam-setting-data-method-9 ((this cam-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) (let ((s3-0 (-> arg1 alive-list))) (while s3-0 (cam-setting-data-method-10 @@ -547,7 +547,7 @@ this ) -(defmethod cam-setting-data-method-10 cam-setting-data ((this cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 float) (arg3 int)) +(defmethod cam-setting-data-method-10 ((this cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 float) (arg3 int)) (case arg0 (('fov) (if (= arg1 'rel) @@ -804,21 +804,21 @@ this ) -(defmethod add-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) +(defmethod add-setting ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) "Originally called `setting-set` see (anon-function 48 script)" (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 (none) ) -(defmethod set-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) +(defmethod set-setting ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) (remove-setting this arg0 arg1) (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 (none) ) -(defmethod persist-with-delay setting-control ((this setting-control) (arg0 symbol) (arg1 time-frame) (arg2 symbol) (arg3 symbol) (arg4 float) (arg5 int)) +(defmethod persist-with-delay ((this setting-control) (arg0 symbol) (arg1 time-frame) (arg2 symbol) (arg3 symbol) (arg4 float) (arg5 int)) "Originally called `setting-pers` see (anon-function 46 script)" (let ((v1-1 (schedule-callback (-> this engine-pers) arg0 arg1))) (when v1-1 @@ -832,7 +832,7 @@ (none) ) -(defmethod remove-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol)) +(defmethod remove-setting ((this setting-control) (arg0 process) (arg1 symbol)) (when arg0 (let ((s5-0 (-> this engine)) (s4-0 (-> arg0 connection-list next1)) @@ -851,7 +851,7 @@ (none) ) -(defmethod kill-persister setting-control ((this setting-control) (arg0 engine-pers) (arg1 object)) +(defmethod kill-persister ((this setting-control) (arg0 engine-pers) (arg1 object)) "Calls [[engine-pers::kill-matching]]" (kill-matching (-> this engine-pers) @@ -865,7 +865,7 @@ (none) ) -(defmethod setting-control-method-14 setting-control ((this setting-control) (arg0 object)) +(defmethod setting-control-method-14 ((this setting-control) (arg0 object)) (let ((v1-1 (-> this engine-hi alive-list next0))) (-> this engine-hi) (let ((a2-2 (-> v1-1 next0))) @@ -882,20 +882,20 @@ (the-as connectable #f) ) -(defmethod remove-setting-by-arg0 setting-control ((this setting-control) (arg0 object)) +(defmethod remove-setting-by-arg0 ((this setting-control) (arg0 object)) "Calls [[engine::remove-by-param0]] on `engine-hi`" (remove-by-param0 (-> this engine-hi) arg0) 0 (none) ) -(defmethod set-setting-by-param setting-control ((this setting-control) (arg0 symbol) (arg1 object) (arg2 object) (arg3 object)) +(defmethod set-setting-by-param ((this setting-control) (arg0 symbol) (arg1 object) (arg2 object) (arg3 object)) "Same as [[setting-control::set-setting]] but will [[engine::remove-by-param0]] using the symbol provided" (remove-by-param0 (-> this engine-hi) arg0) (add-connection (-> this engine-hi) *dproc* arg0 arg1 arg2 arg3) ) -(defmethod apply-settings setting-control ((this setting-control)) +(defmethod apply-settings ((this setting-control)) (speech-control-method-11 *speech-control*) (let ((s5-0 (-> this user-current))) (let ((s4-0 (-> this user-target))) @@ -1054,7 +1054,7 @@ (-> this user-current) ) -(defmethod update setting-control ((this setting-control)) +(defmethod update ((this setting-control)) (local-vars (v1-41 symbol)) (run-pending-updates! (-> this engine-pers) (-> *display* base-clock frame-counter)) (apply-settings this) diff --git a/goal_src/jak2/engine/game/task/task-arrow.gc b/goal_src/jak2/engine/game/task/task-arrow.gc index 37a9197bf61..2f0c7493792 100644 --- a/goal_src/jak2/engine/game/task/task-arrow.gc +++ b/goal_src/jak2/engine/game/task/task-arrow.gc @@ -25,14 +25,11 @@ ) (deftype task-arrow-params (structure) - ((flags task-arrow-flags :offset-assert 0) - (map-icon uint16 :offset-assert 4) - (pos vector :inline :offset-assert 16) - (quat quaternion :inline :offset-assert 32) + ((flags task-arrow-flags) + (map-icon uint16) + (pos vector :inline) + (quat quaternion :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) @@ -40,42 +37,40 @@ "Despite the name, these are actually the beams of light that highlight various objections. Such as the flag in the first ruins mission or collectable items on the ground (jetboard / weapon upgrades / etc)" - ((pos vector :inline :offset-assert 208) - (theta float :offset-assert 224) - (phi float :offset-assert 228) - (dist float :offset-assert 232) - (smoothed-dist float :offset-assert 236) - (max-dist float :offset-assert 240) - (flags task-arrow-flags :offset-assert 244) - (map-icon uint16 :offset-assert 248) - (minimap connection-minimap :offset-assert 252) - (hud-dist handle :offset-assert 256) - (base-quat quaternion :inline :offset-assert 272) - (rod-of-god-scale float :offset-assert 288) - (moving symbol :offset-assert 292) + ((pos vector :inline) + (theta float) + (phi float) + (dist float) + (smoothed-dist float) + (max-dist float) + (flags task-arrow-flags) + (map-icon uint16) + (minimap connection-minimap) + (hud-dist handle) + (base-quat quaternion :inline) + (rod-of-god-scale float) + (moving symbol) ) - :heap-base #xb0 - :method-count-assert 25 - :size-assert #x128 - :flag-assert #x1900b00128 + (:state-methods + idle + die + leave + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (leave () _type_ :state 22) - (task-arrow-method-23 (_type_ vector) none 23) - (draw-arrow (_type_) none :behavior task-arrow 24) + (task-arrow-method-23 (_type_ vector) none) + (draw-arrow (_type_) none :behavior task-arrow) ) ) -(defmethod deactivate task-arrow ((this task-arrow)) +(defmethod deactivate ((this task-arrow)) (send-event (handle->process (-> this hud-dist)) 'hide-and-die) ((method-of-type process-drawable deactivate) this) 0 (none) ) -(defmethod task-arrow-method-23 task-arrow ((this task-arrow) (arg0 vector)) +(defmethod task-arrow-method-23 ((this task-arrow) (arg0 vector)) "Some weird debugging code left here, but checks for collisions on the arrow" (let ((s5-0 (new 'stack-no-clear 'collide-query-with-vec))) (set! (-> s5-0 vec quad) (-> arg0 quad)) @@ -101,7 +96,7 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" (none) ) -(defmethod draw-arrow task-arrow ((this task-arrow)) +(defmethod draw-arrow ((this task-arrow)) (cond ((logtest? (-> this flags) (task-arrow-flags task-arrow-flag-00)) (if (and (not (handle->process (-> this hud-dist))) *target*) diff --git a/goal_src/jak2/engine/game/task/task-control-h.gc b/goal_src/jak2/engine/game/task/task-control-h.gc index aa69d1f9c47..0bd9ad9d617 100644 --- a/goal_src/jak2/engine/game/task/task-control-h.gc +++ b/goal_src/jak2/engine/game/task/task-control-h.gc @@ -618,20 +618,17 @@ ) (deftype game-task-event (basic) - ((actor game-task-actor :offset-assert 4) - (action game-task-action :offset-assert 5) - (tex game-task-icon :offset-assert 6) - (icon uint16 :offset 6) - (flags game-task-flags :offset 7) - (scene basic :offset 8) - (distance meters :offset-assert 12) + ((actor game-task-actor) + (action game-task-action) + (tex game-task-icon) + (icon uint16 :overlay-at tex) + (flags game-task-flags :offset 7) + (scene basic :offset 8) + (distance meters) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) -;; the decompiler uses these! +;; og:preserve-this the decompiler uses these! (defconstant TASK_MANAGER_INIT_HOOK 0) (defconstant TASK_MANAGER_CLEANUP_HOOK 1) (defconstant TASK_MANAGER_UPDATE_HOOK 2) @@ -641,38 +638,35 @@ (defconstant TASK_MANAGER_EVENT_HOOK 6) (deftype task-manager-info (structure) - ((mask task-manager-mask :offset-assert 0) - (level symbol :offset-assert 4) - (manager handle :offset-assert 8) - (fail-message text-id :offset-assert 16) - (retry-message text-id :offset-assert 20) - (intro-scene string :offset-assert 24) - (resolution-scene string :offset-assert 28) - (resolution-scene-continue string :offset-assert 32) - (retry-continue string :offset-assert 36) - (fail-continue string :offset-assert 40) - (init-hook (function object) :offset-assert 44) - (cleanup-hook (function object) :offset-assert 48) - (update-hook (function object) :offset-assert 52) - (code-hook (function object) :offset-assert 56) - (complete-hook (function object) :offset-assert 60) - (fail-hook (function object) :offset-assert 64) - (event-hook (function process int symbol event-message-block object) :offset-assert 68) - (hooks function 7 :offset 44) - (final-node game-task-node :offset-assert 72) - (time-limit int32 :offset-assert 76) - (sphere-count int8 :offset-assert 80) - (index int8 :offset-assert 81) - (intro-delay uint16 :offset-assert 82) - (sphere-array uint32 :offset-assert 84) - (on-complete pair :offset-assert 88) - (on-fail pair :offset-assert 92) - (begin-sphere sphere :inline :offset-assert 96) - (end-sphere sphere :inline :offset-assert 112) + ((mask task-manager-mask) + (level symbol) + (manager handle) + (fail-message text-id) + (retry-message text-id) + (intro-scene string) + (resolution-scene string) + (resolution-scene-continue string) + (retry-continue string) + (fail-continue string) + (init-hook (function object)) + (cleanup-hook (function object)) + (update-hook (function object)) + (code-hook (function object)) + (complete-hook (function object)) + (fail-hook (function object)) + (event-hook (function process int symbol event-message-block object)) + (hooks function 7 :overlay-at init-hook) + (final-node game-task-node) + (time-limit int32) + (sphere-count int8) + (index int8) + (intro-delay uint16) + (sphere-array uint32) + (on-complete pair) + (on-fail pair) + (begin-sphere sphere :inline) + (end-sphere sphere :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) @@ -817,134 +811,120 @@ ) (deftype game-task-node-info (basic) - ((level symbol :offset-assert 4) - (task game-task :offset-assert 8) - (name string :offset-assert 12) - (when-open (array game-task-event) :offset-assert 16) - (flags game-task-node-flag :offset-assert 20) - (parent-node game-task-node 4 :offset-assert 24) - (task-mask task-mask :offset-assert 32) - (on-open pair :offset-assert 36) - (info task-manager-info :offset-assert 40) - (borrow pair :offset-assert 44) - (open? (function game-task-node-info symbol) :offset-assert 48) - (on-close pair :offset-assert 52) - (close-time time-frame :offset-assert 56) - (death-count uint16 :offset-assert 64) - (gem-count uint16 :offset-assert 66) - (skill-count uint16 :offset-assert 68) - (suck-death-count uint8 :offset-assert 70) - (add game-task-node-command :offset-assert 71) - (description text-id :offset-assert 72) + ((level symbol) + (task game-task) + (name string) + (when-open (array game-task-event)) + (flags game-task-node-flag) + (parent-node game-task-node 4) + (task-mask task-mask) + (on-open pair) + (info task-manager-info) + (borrow pair) + (open? (function game-task-node-info symbol)) + (on-close pair) + (close-time time-frame) + (death-count uint16) + (gem-count uint16) + (skill-count uint16) + (suck-death-count uint8) + (add game-task-node-command) + (description text-id) ) - :method-count-assert 14 - :size-assert #x4c - :flag-assert #xe0000004c (:methods - (close! (_type_ symbol) int 9) - (open! (_type_ symbol) int 10) - (open? (_type_) symbol 11) - (copy-hooks! (_type_ game-task-node-info) game-task-node-info 12) - (eval-add (_type_) int 13) + (close! (_type_ symbol) int) + (open! (_type_ symbol) int) + (open? (_type_) symbol) + (copy-hooks! (_type_ game-task-node-info) game-task-node-info) + (eval-add (_type_) int) ) ) (deftype game-task-info (basic) - ((name string :offset-assert 4) - (text-name text-id :offset-assert 8) - (pre-play-node game-task-node :offset-assert 12) - (kiosk-play-node game-task-node :offset-assert 14) - (pre-play-continue string :offset-assert 16) - (play-node game-task-node :offset-assert 20) - (play-continue string :offset-assert 24) - (kiosk-play-continue string :offset-assert 28) + ((name string) + (text-name text-id) + (pre-play-node game-task-node) + (kiosk-play-node game-task-node) + (pre-play-continue string) + (play-node game-task-node) + (play-continue string) + (kiosk-play-continue string) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype game-task-control (basic) - ((counter uint32 :offset-assert 4) - (actor game-task-actor :offset-assert 8) - (current-node game-task-node :offset-assert 10) - (current-event game-task-event :offset-assert 12) + ((counter uint32) + (actor game-task-actor) + (current-node game-task-node) + (current-event game-task-event) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (new (symbol type game-task-actor) _type_ 0) - (get-current-task-event (_type_) game-task-event 9) + (new (symbol type game-task-actor) _type_) + (get-current-task-event (_type_) game-task-event) ) ) (deftype task-manager (process) - ((node-info game-task-node-info :offset-assert 128) - (info task-manager-info :offset-assert 132) - (lev-name symbol :offset-assert 136) - (fail-on-death? symbol :offset-assert 140) - (fail-now symbol :offset-assert 144) - (retry-now symbol :offset-assert 148) - (allow-fail symbol :offset-assert 152) - (state-time time-frame :offset-assert 160) - (count int16 :offset-assert 168) - (max-count int16 :offset-assert 170) - (sub-state uint32 :offset-assert 172) - (slave handle 32 :offset-assert 176) - (arrow handle :offset-assert 432) - (link uint32 :offset-assert 440) - (start-time time-frame :offset-assert 448) - (total-time time-frame :offset-assert 456) - (beep-time time-frame :offset-assert 464) - (time-limit time-frame :offset-assert 472) - (begin-pos vector :inline :offset-assert 480) - (end-pos vector :inline :offset-assert 496) - (data-int8 int8 32 :offset-assert 512) - (data-int32 int32 32 :offset-assert 544) - (data-float float 32 :offset-assert 672) - (data-vector vector 32 :inline :offset-assert 800) - (actor-group (pointer entity-actor) 4 :offset-assert 1312) - (minimap connection-minimap 8 :offset-assert 1328) - (hud handle 4 :offset-assert 1360) - (hud-timer handle :offset 1360) - (hud-counter handle :offset 1368) - (sound-id sound-id 4 :offset-assert 1392) - (intro-time time-frame :offset-assert 1408) + ((node-info game-task-node-info) + (info task-manager-info) + (lev-name symbol) + (fail-on-death? symbol) + (fail-now symbol) + (retry-now symbol) + (allow-fail symbol) + (state-time time-frame) + (count int16) + (max-count int16) + (sub-state uint32) + (slave handle 32) + (arrow handle) + (link uint32) + (start-time time-frame) + (total-time time-frame) + (beep-time time-frame) + (time-limit time-frame) + (begin-pos vector :inline) + (end-pos vector :inline) + (data-int8 int8 32) + (data-int32 int32 32) + (data-float float 32) + (data-vector vector 32 :inline) + (actor-group (pointer entity-actor) 4) + (minimap connection-minimap 8) + (hud handle 4) + (hud-timer handle :overlay-at (-> hud 0)) + (hud-counter handle :overlay-at (-> hud 1)) + (sound-id sound-id 4) + (intro-time time-frame) ) - :heap-base #x510 - :method-count-assert 23 - :size-assert #x588 - :flag-assert #x1705100588 + (:state-methods + wait + active + complete + fail + retry + ) (:methods - (wait () _type_ :state 14) - (active () _type_ :state 15) - (complete () _type_ :state 16) - (fail () _type_ :state 17) - (retry () _type_ :state 18) - (initialize! (_type_) int 19) - (kill-all-children (_type_) int 20) - (check-time (_type_) int 21) - (task-manager-method-22 (_type_) symbol 22) + (initialize! (_type_) int) + (kill-all-children (_type_) int) + (check-time (_type_) int) + (task-manager-method-22 (_type_) symbol) ) ) (deftype ambient-control (structure) - ((last-ambient-time time-frame :offset-assert 0) - (last-ambient string :offset-assert 8) - (last-ambient-id sound-id :offset-assert 12) + ((last-ambient-time time-frame) + (last-ambient string) + (last-ambient-id sound-id) ) - :method-count-assert 12 - :size-assert #x10 - :flag-assert #xc00000010 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) + (dummy-9 () none) + (dummy-10 () none) + (dummy-11 () none) ) ) diff --git a/goal_src/jak2/engine/game/task/task-control.gc b/goal_src/jak2/engine/game/task/task-control.gc index 2a12574afbd..300fce410eb 100644 --- a/goal_src/jak2/engine/game/task/task-control.gc +++ b/goal_src/jak2/engine/game/task/task-control.gc @@ -33,32 +33,26 @@ ;; DECOMP BEGINS (deftype fail-mission-params (structure) - ((message fail-mission-message :offset-assert 0) - (flags fail-mission-flags :offset-assert 1) - (retry-continue string :offset-assert 4) - (fail-continue string :offset-assert 8) - (reset-delay uint32 :offset-assert 12) - (task game-task :offset-assert 16) - (fail-message text-id :offset-assert 20) + ((message fail-mission-message) + (flags fail-mission-flags) + (retry-continue string) + (fail-continue string) + (reset-delay uint32) + (task game-task) + (fail-message text-id) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype fail-mission-control (basic) - ((process handle :offset-assert 8) - (handle-init-hack pointer :offset 8) + ((process handle) + (handle-init-hack pointer :overlay-at process) ) - :method-count-assert 13 - :size-assert #x10 - :flag-assert #xd00000010 (:methods - (reset? (_type_) symbol 9) - (get-proc (_type_) fail-mission 10) - (start! (_type_ fail-mission-params) symbol 11) - (reset! (_type_) object 12) + (reset? (_type_) symbol) + (get-proc (_type_) fail-mission) + (start! (_type_ fail-mission-params) symbol) + (reset! (_type_) object) ) ) @@ -189,7 +183,7 @@ 0 ) -(defmethod level-method-22 level ((this level) (arg0 symbol)) +(defmethod level-method-22 ((this level) (arg0 symbol)) (if (= arg0 'none) (return 0) ) @@ -679,7 +673,7 @@ arg0 ) -(defmethod print game-task-node-info ((this game-task-node-info)) +(defmethod print ((this game-task-node-info)) (format #t "#" @@ -790,7 +784,7 @@ ) ) -(defmethod close! game-task-node-info ((this game-task-node-info) (arg0 symbol)) +(defmethod close! ((this game-task-node-info) (arg0 symbol)) (when (not (logtest? (-> this flags) (game-task-node-flag closed))) (let ((task-node-close-func (lambda ((arg0 game-task-node-info)) @@ -892,7 +886,7 @@ 0 ) -(defmethod open! game-task-node-info ((this game-task-node-info) (arg0 symbol)) +(defmethod open! ((this game-task-node-info) (arg0 symbol)) (local-vars (v1-19 symbol)) (when (logtest? (-> this flags) (game-task-node-flag closed)) (logclear! (-> this flags) (game-task-node-flag closed)) @@ -938,7 +932,7 @@ ) ) -(defmethod open? game-task-node-info ((this game-task-node-info)) +(defmethod open? ((this game-task-node-info)) (local-vars (a1-1 symbol)) (let ((game-nodes (-> *game-info* sub-task-list)) (node-info this) @@ -979,7 +973,7 @@ 0 ) -(defmethod eval-add game-task-node-info ((this game-task-node-info)) +(defmethod eval-add ((this game-task-node-info)) (case (-> this add) (((game-task-node-command none)) ) @@ -1129,7 +1123,7 @@ #f ) -(defmethod print game-task-event ((this game-task-event)) +(defmethod print ((this game-task-event)) (let* ((t9-0 format) (a0-1 #t) (a1-0 "#") @@ -1393,7 +1387,7 @@ ) ) -(defmethod get-current-task-event game-task-control ((this game-task-control)) +(defmethod get-current-task-event ((this game-task-control)) (with-pp (let ((gp-0 (new 'static 'game-task-event :scene #f))) (let ((s5-0 #f)) @@ -1464,35 +1458,33 @@ ) (deftype fail-mission (process) - ((message fail-mission-message :offset-assert 128) - (flags fail-mission-flags :offset-assert 129) - (retry-continue string :offset-assert 132) - (fail-continue string :offset-assert 136) - (reset-delay uint32 :offset-assert 140) - (grabbed-time time-frame :offset-assert 144) - (retry symbol :offset-assert 152) - (task game-task :offset-assert 156) - (message-id sound-id :offset-assert 160) - (fail-message text-id :offset-assert 164) - (stinger sound-id :offset-assert 168) + ((message fail-mission-message) + (flags fail-mission-flags) + (retry-continue string) + (fail-continue string) + (reset-delay uint32) + (grabbed-time time-frame) + (retry symbol) + (task game-task) + (message-id sound-id) + (fail-message text-id) + (stinger sound-id) ) - :heap-base #x30 - :method-count-assert 17 - :size-assert #xac - :flag-assert #x11003000ac + (:state-methods + idle + resetting + ) (:methods - (idle () _type_ :state 14) - (resetting () _type_ :state 15) - (print-text (_type_) float 16) + (print-text (_type_) float) ) ) -(defmethod run-logic? fail-mission ((this fail-mission)) +(defmethod run-logic? ((this fail-mission)) #t ) -(defmethod print-text fail-mission ((this fail-mission)) +(defmethod print-text ((this fail-mission)) (when (and (not (logtest? (-> this flags) (fail-mission-flags famflags-6))) (= (get-status *gui-control* (-> this message-id)) (gui-status active)) ) @@ -1610,10 +1602,10 @@ ) ) (logior! (-> self flags) (fail-mission-flags famflags-1)) - (set! (-> self grabbed-time) (current-time)) + (set-time! (-> self grabbed-time)) (when (not (logtest? (-> self flags) (fail-mission-flags famflags-3))) (when (not (logtest? (-> self flags) (fail-mission-flags famflags-5))) - (while (< (- (current-time) (-> self grabbed-time)) (seconds 1.5)) + (while (not (time-elapsed? (-> self grabbed-time) (seconds 1.5))) (let ((f30-0 (lerp-scale 0.0 1.0 (the float (- (current-time) (-> self grabbed-time))) 0.0 450.0))) (set-filter-color! (lerp-scale 1.0 1.25 f30-0 0.0 1.0) @@ -1637,7 +1629,7 @@ (((fail-mission-message fammsg-0)) (until #f (when (or (and (logtest? (-> self flags) (fail-mission-flags famflags-0)) - (>= (- (current-time) (-> self grabbed-time)) (the-as time-frame (-> self reset-delay))) + (time-elapsed? (-> self grabbed-time) (the-as time-frame (-> self reset-delay))) ) (or (cpad-pressed? 0 confirm) (logtest? (-> self flags) (fail-mission-flags famflags-3))) ) @@ -1683,7 +1675,7 @@ ) ) -(defmethod deactivate fail-mission ((this fail-mission)) +(defmethod deactivate ((this fail-mission)) (set-filter-color! 1.0 1.0 1.0) (sound-group-continue (sound-group sfx music dialog sog3 ambient dialog2 sog6 sog7)) (update-rates! (-> *display* bg-clock) 1.0) @@ -1722,7 +1714,7 @@ :code (behavior () (local-vars (a1-10 string)) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) gp-0)) 0.0 270.0))) (when *sound-player-enable* (let ((v1-6 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -1839,7 +1831,7 @@ (go-virtual idle) ) -(defmethod start! fail-mission-control ((this fail-mission-control) (arg0 fail-mission-params)) +(defmethod start! ((this fail-mission-control) (arg0 fail-mission-params)) (when (not (handle->process (-> this process))) (let ((v1-4 (process-spawn fail-mission arg0 :to *entity-pool*))) (when v1-4 @@ -1850,21 +1842,21 @@ ) ) -(defmethod reset! fail-mission-control ((this fail-mission-control)) +(defmethod reset! ((this fail-mission-control)) (send-event (handle->process (-> this process)) 'reset) ) ;; WARN: Return type mismatch object vs symbol. -(defmethod reset? fail-mission-control ((this fail-mission-control)) +(defmethod reset? ((this fail-mission-control)) (the-as symbol (send-event (handle->process (-> this process)) 'query 'reset)) ) ;; WARN: Return type mismatch process vs fail-mission. -(defmethod get-proc fail-mission-control ((this fail-mission-control)) +(defmethod get-proc ((this fail-mission-control)) (the-as fail-mission (handle->process (-> this process))) ) -(defmethod copy-hooks! game-task-node-info ((this game-task-node-info) (arg0 game-task-node-info)) +(defmethod copy-hooks! ((this game-task-node-info) (arg0 game-task-node-info)) (when (and (-> this info) (-> arg0 info)) (countdown (v1-3 7) (set! (-> this info hooks v1-3) (-> arg0 info hooks v1-3)) @@ -1874,7 +1866,7 @@ ) ;; WARN: Return type mismatch process vs task-manager. -(defmethod relocate task-manager ((this task-manager) (arg0 int)) +(defmethod relocate ((this task-manager) (arg0 int)) (if (nonzero? (-> this link)) (+! (-> this link) arg0) ) @@ -1888,7 +1880,7 @@ (set! (-> self lev-name) arg1) (add-setting! 'task arg0 0.0 0) (add-setting! 'task-manager (process->ppointer self) 0.0 0) - (set! (-> self intro-time) (current-time)) + (set-time! (-> self intro-time)) (set! (-> self fail-on-death?) (not (logtest? (-> arg0 flags) (game-task-node-flag no-fail-on-death)))) (when arg1 (let* ((v1-15 (level-get *level* arg1)) @@ -1906,14 +1898,14 @@ (go-virtual wait) ) -(defmethod kill-all-children task-manager ((this task-manager)) +(defmethod kill-all-children ((this task-manager)) (while (-> this child) (deactivate (ppointer->process (-> this child))) ) 0 ) -(defmethod check-time task-manager ((this task-manager)) +(defmethod check-time ((this task-manager)) (when (nonzero? (-> this start-time)) (let ((v1-3 (handle->process (-> this hud-timer)))) (if (and *target* (not v1-3)) @@ -1937,7 +1929,7 @@ 0 ) -(defmethod initialize! task-manager ((this task-manager)) +(defmethod initialize! ((this task-manager)) (set! (-> this info) (-> this node-info info)) (countdown (v1-2 32) (set! (-> this slave v1-2) (the-as handle #f)) @@ -1958,7 +1950,7 @@ 0 ) -(defmethod deactivate task-manager ((this task-manager)) +(defmethod deactivate ((this task-manager)) (with-pp (let ((s5-0 pp)) (set! pp this) @@ -2092,14 +2084,14 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod task-manager-method-22 task-manager ((this task-manager)) +(defmethod task-manager-method-22 ((this task-manager)) (the-as symbol (and (or (not (logtest? (-> this node-info flags) (game-task-node-flag city-wait))) (let ((a0-2 (level-get-target-inside *level*))) (cond ((not (and a0-2 (logtest? (-> a0-2 info level-flags) 1))) - (set! (-> this intro-time) (current-time)) + (set-time! (-> this intro-time)) #f ) (else @@ -2109,7 +2101,7 @@ ) ) (or (zero? (-> this info intro-delay)) - (>= (- (current-time) (-> this intro-time)) (the-as time-frame (-> this info intro-delay))) + (time-elapsed? (-> this intro-time) (the-as time-frame (-> this info intro-delay))) ) (and *target* (not (logtest? (focus-status dead teleporting) (-> *target* focus-status)))) ) @@ -2173,6 +2165,7 @@ (t9-0) ) ) + ;; og:preserve-this (#when PC_PORT (set! (-> self post-hook) #f)) (until #f @@ -2207,7 +2200,7 @@ (t9-3) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) (let ((gp-2 (ppointer->handle (process-spawn scene-player diff --git a/goal_src/jak2/engine/geometry/bounding-box-h.gc b/goal_src/jak2/engine/geometry/bounding-box-h.gc index 337329c67a5..f3ca915a744 100644 --- a/goal_src/jak2/engine/geometry/bounding-box-h.gc +++ b/goal_src/jak2/engine/geometry/bounding-box-h.gc @@ -7,60 +7,45 @@ ;; DECOMP BEGINS -;; axis-aligned bounding box, using floats. (deftype bounding-box (structure) - ((min vector :inline :offset-assert 0) - (max vector :inline :offset-assert 16) + ((min vector :inline) + (max vector :inline) ) - :method-count-assert 21 - :size-assert #x20 - :flag-assert #x1500000020 (:methods - (add-spheres! (_type_ (inline-array sphere) int) int 9) - (add-box! (_type_ bounding-box) int 10) - (add-point! (_type_ vector) none 11) - (intersects-line-segment? (_type_ vector vector) symbol 12) - (set-from-point-offset! (_type_ vector vector) none 13) - (set-from-point-offset-pad! (_type_ vector vector float) int 14) - (set-to-point! (_type_ vector) none 15) - (set-from-sphere! (_type_ sphere) none 16) - (set-from-spheres! (_type_ (inline-array sphere) int) int 17) - (get-bounding-sphere (_type_ vector) vector 18) - (inside-xyz? (bounding-box vector) symbol 19) - (inside-xz? (bounding-box vector) symbol 20) + (add-spheres! (_type_ (inline-array sphere) int) int) + (add-box! (_type_ bounding-box) int) + (add-point! (_type_ vector) none) + (intersects-line-segment? (_type_ vector vector) symbol) + (set-from-point-offset! (_type_ vector vector) none) + (set-from-point-offset-pad! (_type_ vector vector float) int) + (set-to-point! (_type_ vector) none) + (set-from-sphere! (_type_ sphere) none) + (set-from-spheres! (_type_ (inline-array sphere) int) int) + (get-bounding-sphere (_type_ vector) vector) + (inside-xyz? (bounding-box vector) symbol) + (inside-xz? (bounding-box vector) symbol) ) ) -;; axis-aligned bounding box, using int32's + (deftype bounding-box4w (structure) - ((min vector4w :inline :offset-assert 0) - (max vector4w :inline :offset-assert 16) + ((min vector4w :inline) + (max vector4w :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) -;; axis-aligned bounding box, storing both float and int32's (for crazy collision assembly stuff) + (deftype bounding-box-both (structure) - ((box bounding-box :inline :offset-assert 0) - (box4w bounding-box4w :inline :offset-assert 32) + ((box bounding-box :inline) + (box4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype bounding-box-array (inline-array-class) - ((data bounding-box :inline :dynamic :offset-assert 16) + ((data bounding-box :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) -(set! (-> bounding-box-array heap-base) (the-as uint 32)) - - +(set! (-> bounding-box-array heap-base) (the-as uint 32)) diff --git a/goal_src/jak2/engine/geometry/bounding-box.gc b/goal_src/jak2/engine/geometry/bounding-box.gc index b2517dd0adb..81743a4aadc 100644 --- a/goal_src/jak2/engine/geometry/bounding-box.gc +++ b/goal_src/jak2/engine/geometry/bounding-box.gc @@ -12,7 +12,7 @@ These boxes are used as a primitive in the foreground collision system. ;; DECOMP BEGINS -(defmethod inside-xyz? bounding-box ((this bounding-box) (arg0 vector)) +(defmethod inside-xyz? ((this bounding-box) (arg0 vector)) "Is the point in the box?" (and (< (-> this min x) (-> arg0 x)) (< (-> this min y) (-> arg0 y)) @@ -23,7 +23,7 @@ These boxes are used as a primitive in the foreground collision system. ) ) -(defmethod inside-xz? bounding-box ((this bounding-box) (arg0 vector)) +(defmethod inside-xz? ((this bounding-box) (arg0 vector)) "Is the point in the box? Check xz only." (and (< (-> this min x) (-> arg0 x)) (< (-> this min z) (-> arg0 z)) @@ -54,7 +54,7 @@ These boxes are used as a primitive in the foreground collision system. ) ) -(defmethod set-from-point-offset! bounding-box ((this bounding-box) (arg0 vector) (arg1 vector)) +(defmethod set-from-point-offset! ((this bounding-box) (arg0 vector) (arg1 vector)) "Set to the smallest box containing arg0, (arg0 + arg1)" (rlet ((vf0 :class vf) (vf1 :class vf) @@ -78,7 +78,7 @@ These boxes are used as a primitive in the foreground collision system. ) ) -(defmethod add-point! bounding-box ((this bounding-box) (arg0 vector)) +(defmethod add-point! ((this bounding-box) (arg0 vector)) "Expand the box as needed to contain the given point." (rlet ((vf1 :class vf) (vf2 :class vf) @@ -96,7 +96,7 @@ These boxes are used as a primitive in the foreground collision system. ) ) -(defmethod add-box! bounding-box ((this bounding-box) (arg0 bounding-box)) +(defmethod add-box! ((this bounding-box) (arg0 bounding-box)) "Expand the box as needed to contain the given box." (rlet ((vf1 :class vf) (vf2 :class vf) @@ -115,7 +115,7 @@ These boxes are used as a primitive in the foreground collision system. ) ) -(defmethod set-to-point! bounding-box ((this bounding-box) (arg0 vector)) +(defmethod set-to-point! ((this bounding-box) (arg0 vector)) "Set the box to be a single point." (set! (-> this min quad) (-> arg0 quad)) (set! (-> this max quad) (-> arg0 quad)) @@ -123,7 +123,7 @@ These boxes are used as a primitive in the foreground collision system. (none) ) -(defmethod set-from-point-offset-pad! bounding-box ((this bounding-box) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod set-from-point-offset-pad! ((this bounding-box) (arg0 vector) (arg1 vector) (arg2 float)) "Set the box to contain arg0, arg0 + offset, with some padding." (rlet ((vf0 :class vf) (vf1 :class vf) @@ -150,7 +150,7 @@ These boxes are used as a primitive in the foreground collision system. ) ) -(defmethod set-from-sphere! bounding-box ((this bounding-box) (arg0 sphere)) +(defmethod set-from-sphere! ((this bounding-box) (arg0 sphere)) "Set the box to contain a single sphere." (rlet ((vf0 :class vf) (vf1 :class vf) @@ -176,7 +176,7 @@ These boxes are used as a primitive in the foreground collision system. ;; these are used in the collision system to build bounding boxes around collision geometries, so they are quite optimized. -(defmethod add-spheres! bounding-box ((this bounding-box) (spheres (inline-array sphere)) (count int)) +(defmethod add-spheres! ((this bounding-box) (spheres (inline-array sphere)) (count int)) "Add count spheres." ;; the PS2 implementation is very optimized ;; It is unrolled and 'software pipelined' to do 4 at a time. @@ -207,7 +207,7 @@ These boxes are used as a primitive in the foreground collision system. 0 ) -(defmethod set-from-spheres! bounding-box ((this bounding-box) (spheres (inline-array sphere)) (count int)) +(defmethod set-from-spheres! ((this bounding-box) (spheres (inline-array sphere)) (count int)) "Reset box to hold the given spheres. Note: this implementation could be optimized." ;; This is also unrolled, but does 7 at a time. (rlet ((vf0 :class vf) @@ -245,7 +245,7 @@ These boxes are used as a primitive in the foreground collision system. ) -(defmethod get-bounding-sphere bounding-box ((this bounding-box) (arg0 vector)) +(defmethod get-bounding-sphere ((this bounding-box) (arg0 vector)) "Get a bounding sphere for a bounding box." (let* ((a1-2 (vector-! (new 'stack-no-clear 'vector) (-> this max) (-> this min))) (a0-3 (vector-float*! (new 'stack-no-clear 'vector) a1-2 0.5)) @@ -304,7 +304,7 @@ These boxes are used as a primitive in the foreground collision system. #t ) -(defmethod intersects-line-segment? bounding-box ((this bounding-box) (arg0 vector) (arg1 vector)) +(defmethod intersects-line-segment? ((this bounding-box) (arg0 vector) (arg1 vector)) "Check intersection in xz plane, using liang-barsky. Not sure if this actually a useful check or not..." (let ((f28-0 (- (-> arg1 x) (-> arg0 x))) diff --git a/goal_src/jak2/engine/geometry/cylinder.gc b/goal_src/jak2/engine/geometry/cylinder.gc index 8a31e3e067c..8833ef406e5 100644 --- a/goal_src/jak2/engine/geometry/cylinder.gc +++ b/goal_src/jak2/engine/geometry/cylinder.gc @@ -7,13 +7,15 @@ ;; DECOMP BEGINS -(defmethod ray-capsule-intersect cylinder ((this cylinder) (ray1 vector) (ray2 vector)) +(defmethod ray-capsule-intersect ((this cylinder) (ray1 vector) (ray2 vector)) (let ((t2-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) 0.0 0.0 - (let ((f30-0 (ray-cylinder-intersect ray1 ray2 (-> this origin) (-> this axis) (-> this radius) (-> this length) t2-0)) + (let ((f30-0 + (ray-cylinder-intersect ray1 ray2 (-> this origin) (-> this axis) (-> this radius) (-> this length) t2-0) + ) ) (let ((f0-5 (ray-sphere-intersect ray1 ray2 (-> this origin) (-> this radius)))) (if (and (>= f0-5 0.0) (or (< f30-0 0.0) (< f0-5 f30-0))) @@ -32,15 +34,12 @@ ) (deftype cylinder-verts (structure) - ((vert vector 24 :inline :offset-assert 0) + ((vert vector 24 :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) -(defmethod debug-draw cylinder ((this cylinder) (arg0 vector4w)) +(defmethod debug-draw ((this cylinder) (arg0 vector4w)) (local-vars (sv-896 matrix) (sv-912 vector) @@ -193,13 +192,15 @@ ) ) -(defmethod ray-flat-cyl-intersect cylinder-flat ((this cylinder-flat) (arg0 vector) (arg1 vector)) +(defmethod ray-flat-cyl-intersect ((this cylinder-flat) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) 0.0 0.0 - (let ((f30-0 (ray-cylinder-intersect arg0 arg1 (-> this origin) (-> this axis) (-> this radius) (-> this length) gp-0)) + (let ((f30-0 + (ray-cylinder-intersect arg0 arg1 (-> this origin) (-> this axis) (-> this radius) (-> this length) gp-0) + ) ) (let ((f0-5 (ray-arbitrary-circle-intersect arg0 arg1 (-> this origin) (-> this axis) (-> this radius)))) (when (and (>= f0-5 0.0) (or (< f30-0 0.0) (< f0-5 f30-0))) @@ -220,15 +221,12 @@ ) (deftype cylinder-flat-verts (structure) - ((vert vector 10 :inline :offset-assert 0) + ((vert vector 10 :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) -(defmethod debug-draw cylinder-flat ((this cylinder-flat) (arg0 vector4w)) +(defmethod debug-draw ((this cylinder-flat) (arg0 vector4w)) (local-vars (sv-448 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) diff --git a/goal_src/jak2/engine/geometry/geometry-h.gc b/goal_src/jak2/engine/geometry/geometry-h.gc index 9b88f3bcf10..f132a8fc39d 100644 --- a/goal_src/jak2/engine/geometry/geometry-h.gc +++ b/goal_src/jak2/engine/geometry/geometry-h.gc @@ -10,30 +10,24 @@ ;; DECOMP BEGINS (deftype curve (structure) - ((cverts (inline-array vector) :offset-assert 0) - (num-cverts int32 :offset-assert 4) - (knots (pointer float) :offset-assert 8) - (num-knots int32 :offset-assert 12) - (length float :offset-assert 16) + ((cverts (inline-array vector)) + (num-cverts int32) + (knots (pointer float)) + (num-knots int32) + (length float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype border-plane (basic) - ((name symbol :offset-assert 4) - (action basic :offset-assert 8) - (slot int8 :offset-assert 12) - (trans vector :inline :offset-assert 16) - (normal vector :inline :offset-assert 32) + ((name symbol) + (action basic) + (slot int8) + (trans vector :inline) + (normal vector :inline) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (debug-draw (_type_) int 9) - (point-past-plane? (_type_ vector) symbol 10) + (debug-draw (_type_) int) + (point-past-plane? (_type_ vector) symbol) ) ) diff --git a/goal_src/jak2/engine/geometry/path-h.gc b/goal_src/jak2/engine/geometry/path-h.gc index 5c1c55b227a..25008bc30e3 100644 --- a/goal_src/jak2/engine/geometry/path-h.gc +++ b/goal_src/jak2/engine/geometry/path-h.gc @@ -23,34 +23,31 @@ - debug drawing - conveniant vertex accessing - vertex finding/searching algorithms" - ((flags path-control-flag :offset-assert 4) - (name symbol :offset-assert 8) - (process process-drawable :offset-assert 12) - (curve curve :inline :offset-assert 16) + ((flags path-control-flag) + (name symbol) + (process process-drawable) + (curve curve :inline) ) - :method-count-assert 27 - :size-assert #x24 - :flag-assert #x1b00000024 (:methods - (new (symbol type process symbol float entity symbol) _type_ 0) - (debug-draw (_type_) none 9) - (get-point-in-path! (_type_ vector float symbol) vector 10) - (get-random-point (_type_ vector) vector :behavior process 11) - (displacement-between-two-points-copy! (_type_ vector float float) vector 12) - (displacement-between-two-points-normalized! (_type_ vector float) vector 13) - (get-point-at-percent-along-path! (_type_ vector float symbol) vector 14) - (displacement-between-points-at-percent-scaled! (_type_ vector float float) vector 15) - (displacement-between-points-at-percent-normalized! (_type_ vector float) vector 16) - (get-num-segments (_type_) float 17) - (total-distance (_type_) float 18) - (get-num-verts (_type_) int 19) - (path-distance-equal-spacing (_type_ float) float 20) - (average-segment-length (_type_ float) float 21) - (get-furthest-point-on-path (_type_ vector) float 22) - (get-path-percentage-at-furthest-point (_type_ vector) float 23) - (path-control-method-24 (_type_ vector) vector 24) - (should-display-marks? (_type_) symbol 25) - (displacement-between-two-points! (_type_ vector float float) vector 26) + (new (symbol type process symbol float entity symbol) _type_) + (debug-draw (_type_) none) + (get-point-in-path! (_type_ vector float symbol) vector) + (get-random-point (_type_ vector) vector :behavior process) + (displacement-between-two-points-copy! (_type_ vector float float) vector) + (displacement-between-two-points-normalized! (_type_ vector float) vector) + (get-point-at-percent-along-path! (_type_ vector float symbol) vector) + (displacement-between-points-at-percent-scaled! (_type_ vector float float) vector) + (displacement-between-points-at-percent-normalized! (_type_ vector float) vector) + (get-num-segments (_type_) float) + (total-distance (_type_) float) + (get-num-verts (_type_) int) + (path-distance-equal-spacing (_type_ float) float) + (average-segment-length (_type_ float) float) + (get-furthest-point-on-path (_type_ vector) float) + (get-path-percentage-at-furthest-point (_type_ vector) float) + (path-control-method-24 (_type_ vector) vector) + (should-display-marks? (_type_) symbol) + (displacement-between-two-points! (_type_ vector float float) vector) ) ) @@ -60,11 +57,8 @@ (deftype curve-control (path-control) "Identical in terms of data to a [[path-control]] but has different implementation" () - :method-count-assert 27 - :size-assert #x24 - :flag-assert #x1b00000024 (:methods - (new (symbol type process symbol float) _type_ 0) + (new (symbol type process symbol float) _type_) ) ) @@ -148,23 +142,23 @@ ) ) -(defmethod should-display-marks? path-control ((this path-control)) +(defmethod should-display-marks? ((this path-control)) (and *display-path-marks* (logtest? (-> this flags) (path-control-flag display))) ) -(defmethod get-num-segments path-control ((this path-control)) +(defmethod get-num-segments ((this path-control)) (the float (+ (-> this curve num-cverts) -1)) ) -(defmethod get-num-verts path-control ((this path-control)) +(defmethod get-num-verts ((this path-control)) (-> this curve num-cverts) ) -(defmethod path-distance-equal-spacing path-control ((this path-control) (arg0 float)) +(defmethod path-distance-equal-spacing ((this path-control) (arg0 float)) (* arg0 (get-num-segments this)) ) -(defmethod average-segment-length path-control ((this path-control) (arg0 float)) +(defmethod average-segment-length ((this path-control) (arg0 float)) (/ arg0 (get-num-segments this)) ) diff --git a/goal_src/jak2/engine/geometry/path.gc b/goal_src/jak2/engine/geometry/path.gc index a6afbfe0c94..a183aa7a792 100644 --- a/goal_src/jak2/engine/geometry/path.gc +++ b/goal_src/jak2/engine/geometry/path.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod debug-draw path-control ((this path-control)) +(defmethod debug-draw ((this path-control)) (cond ((logtest? (-> this flags) (path-control-flag not-found)) (when (and (type? (-> this process) process-drawable) *display-entity-errors*) @@ -63,7 +63,7 @@ (none) ) -(defmethod total-distance path-control ((this path-control)) +(defmethod total-distance ((this path-control)) "Calcuate the total path length by summing the distance between each adjacent [[curve]] vertex" (let ((f30-0 0.0)) (dotimes (s5-0 (+ (-> this curve num-cverts) -1)) @@ -73,7 +73,7 @@ ) ) -(defmethod total-distance curve-control ((this curve-control)) +(defmethod total-distance ((this curve-control)) "Will lazily calculate and set the [[curve]]'s `length` @returns total path length of the [[curve]] @see [[curve-length]]" @@ -86,7 +86,7 @@ ) ) -(defmethod get-point-in-path! path-control ((this path-control) (ret vector) (idx float) (search-type symbol)) +(defmethod get-point-in-path! ((this path-control) (ret vector) (idx float) (search-type symbol)) "Depending on the value of `idx`, the result can be quite different: - if `idx` is less than `0.0` - return the first vertex in the path - if `idx` is greater than the number of vertices in the path, return the last vertex @@ -124,7 +124,7 @@ using the fractional component of `idx` as the interpolant, return this result ret ) -(defmethod get-random-point path-control ((this path-control) (arg0 vector)) +(defmethod get-random-point ((this path-control) (arg0 vector)) "Attempts to retrieve a random point along the path, returns the [[*null-vector*]] if no vertices are defined" (cond ((> (-> this curve num-cverts) 0) @@ -143,7 +143,7 @@ using the fractional component of `idx` as the interpolant, return this result arg0 ) -(defmethod get-point-at-percent-along-path! path-control ((this path-control) (ret vector) (percent float) (search-type symbol)) +(defmethod get-point-at-percent-along-path! ((this path-control) (ret vector) (percent float) (search-type symbol)) "@param! ret The [[vector]] that is used to hold the return value @param percent The percentage along the path @param search-type The only recognized value is `exact` @@ -152,7 +152,7 @@ using the fractional component of `idx` as the interpolant, return this result (get-point-in-path! this ret (* percent (the float (+ (-> this curve num-cverts) -1))) search-type) ) -(defmethod get-point-at-percent-along-path! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod get-point-at-percent-along-path! ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) "@param! ret The [[vector]] that is used to hold the return value @param percent The percentage along the path @param search-type The only recognized value is `exact` @@ -171,7 +171,7 @@ using the fractional component of `idx` as the interpolant, return this result arg0 ) -(defmethod get-point-in-path! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod get-point-in-path! ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) "Depending on the value of `idx`, the result can be quite different: - if `idx` is less than `0.0` - return the first vertex in the path - if `idx` is greater than the number of vertices in the path, return the last vertex @@ -196,7 +196,7 @@ using the fractional component of `idx` as the interpolant, return this result arg0 ) -(defmethod displacement-between-two-points! path-control ((this path-control) (ret vector) (idx float) (mag float)) +(defmethod displacement-between-two-points! ((this path-control) (ret vector) (idx float) (mag float)) "Return value can differ quite a bit: - If [[path-control-flag::4]] is set OR there are less than 2 vertices OR `idx` is less than `0.0` - return [[*null-vector*]] - Otherwise, find the scaled (by `mag`) displacement vector between two points in the path: @@ -225,13 +225,13 @@ using the fractional component of `idx` as the interpolant, return this result ret ) -(defmethod displacement-between-two-points-copy! path-control ((this path-control) (ret vector) (idx float) (mag float)) +(defmethod displacement-between-two-points-copy! ((this path-control) (ret vector) (idx float) (mag float)) "Calls [[path-control::26]] with the provided args @see [[path-control::26]]" (displacement-between-two-points! this ret idx mag) ) -(defmethod displacement-between-points-at-percent-scaled! path-control ((this path-control) (ret vector) (percent float) (mag float)) +(defmethod displacement-between-points-at-percent-scaled! ((this path-control) (ret vector) (percent float) (mag float)) "Calls [[path-control::12], with the `idx` at a given percent along the path @param ret The [[vector]] that is used to hold the return value @param percent The percentage along the path to find the first index @@ -245,7 +245,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ) -(defmethod displacement-between-two-points-normalized! path-control ((this path-control) (ret vector) (idx float)) +(defmethod displacement-between-two-points-normalized! ((this path-control) (ret vector) (idx float)) "Calls [[path-control::26], with the provided `idx` @param! ret The [[vector]] the result is stored within @param idx The vertex index @@ -255,7 +255,7 @@ using the fractional component of `idx` as the interpolant, return this result (vector-normalize! ret 1.0) ) -(defmethod displacement-between-points-at-percent-normalized! path-control ((this path-control) (ret vector) (percent float)) +(defmethod displacement-between-points-at-percent-normalized! ((this path-control) (ret vector) (percent float)) "Calls [[path-control::13], with the `idx` at a given percent along the path @param! ret The [[vector]] the result is stored within @param percent The percentage along the path @@ -269,7 +269,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ) -(defmethod displacement-between-two-points! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod displacement-between-two-points! ((this curve-control) (arg0 vector) (arg1 float) (arg2 float)) "Return value can differ quite a bit: - If [[path-control-flag::4]] is set OR there are less than 2 vertices OR `idx` is less than `0.0` - return [[*null-vector*]] - Otherwise, find the scaled (by `mag`) displacement vector between two points in the path: @@ -318,12 +318,12 @@ using the fractional component of `idx` as the interpolant, return this result ) ) -(defmethod displacement-between-two-points-copy! curve-control ((this curve-control) (ret vector) (percent float) (mag float)) +(defmethod displacement-between-two-points-copy! ((this curve-control) (ret vector) (percent float) (mag float)) "Calls [[path-control::26]] with the `idx` at a given percent along the path @see [[path-control::26]]" (displacement-between-two-points! this ret (/ percent (the float (+ (-> this curve num-cverts) -1))) mag) ) -(defmethod displacement-between-points-at-percent-scaled! curve-control ((this curve-control) (ret vector) (idx float) (mag float)) +(defmethod displacement-between-points-at-percent-scaled! ((this curve-control) (ret vector) (idx float) (mag float)) "Calls [[path-control::12], with the `idx` at a given percent along the path @param ret The [[vector]] that is used to hold the return value @param percent The percentage along the path to find the first index @@ -332,7 +332,7 @@ using the fractional component of `idx` as the interpolant, return this result (displacement-between-two-points! this ret idx mag) ) -(defmethod displacement-between-points-at-percent-normalized! curve-control ((this curve-control) (ret vector) (percent float)) +(defmethod displacement-between-points-at-percent-normalized! ((this curve-control) (ret vector) (percent float)) "Calls [[path-control::13], with the `idx` at a given percent along the path @param! ret The [[vector]] the result is stored within @param percent The percentage along the path @@ -343,7 +343,7 @@ using the fractional component of `idx` as the interpolant, return this result (vector-normalize! ret 1.0) ) -(defmethod displacement-between-two-points-normalized! curve-control ((this curve-control) (ret vector) (idx float)) +(defmethod displacement-between-two-points-normalized! ((this curve-control) (ret vector) (idx float)) "@see [[curve-control::12]]" (displacement-between-points-at-percent-normalized! this @@ -352,7 +352,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ) -(defmethod get-furthest-point-on-path path-control ((this path-control) (point vector)) +(defmethod get-furthest-point-on-path ((this path-control) (point vector)) "@param point The point to calculate distance from @returns the `vertex-idx.interpolant` value to the point on the path furthest away from the `point` @see [[path-control::10]]" @@ -387,14 +387,14 @@ using the fractional component of `idx` as the interpolant, return this result ) ) -(defmethod get-path-percentage-at-furthest-point path-control ((this path-control) (point vector)) +(defmethod get-path-percentage-at-furthest-point ((this path-control) (point vector)) "@param point The point to calculate distance from @returns the percentage of path completion from the point on the path furthest away from the `point` @see [[path-control::14]]" (/ (get-furthest-point-on-path this point) (the float (+ (-> this curve num-cverts) -1))) ) -(defmethod debug-draw curve-control ((this curve-control)) +(defmethod debug-draw ((this curve-control)) (cond ((logtest? (-> this flags) (path-control-flag not-found)) (when (and (type? (-> this process) process-drawable) *display-entity-errors*) @@ -448,7 +448,7 @@ using the fractional component of `idx` as the interpolant, return this result (none) ) -(defmethod path-control-method-24 path-control ((this path-control) (arg0 vector)) +(defmethod path-control-method-24 ((this path-control) (arg0 vector)) "TODO" (let ((s4-0 (-> this curve num-cverts))) (let ((f30-0 (/ 1.0 (the float s4-0)))) diff --git a/goal_src/jak2/engine/geometry/vol-h.gc b/goal_src/jak2/engine/geometry/vol-h.gc index a11facc696f..891669815df 100644 --- a/goal_src/jak2/engine/geometry/vol-h.gc +++ b/goal_src/jak2/engine/geometry/vol-h.gc @@ -17,44 +17,38 @@ ;; DECOMP BEGINS (deftype plane-volume (structure) - ((volume-type symbol :offset-assert 0) - (point-count int16 :offset-assert 4) - (normal-count int16 :offset-assert 6) - (first-point (pointer vector) :offset-assert 8) - (first-normal (pointer vector) :offset-assert 12) - (num-planes int32 :offset-assert 16) - (plane (inline-array plane) :offset-assert 20) + ((volume-type symbol) + (point-count int16) + (normal-count int16) + (first-point (pointer vector)) + (first-normal (pointer vector)) + (num-planes int32) + (plane (inline-array plane)) ) :pack-me - :method-count-assert 12 - :size-assert #x18 - :flag-assert #xc00000018 (:methods - (plane-volume-method-9 (_type_ symbol vector-array vector-array) plane-volume 9) - (debug-draw (_type_) none 10) - (point-in-vol? (_type_ vector float) symbol 11) + (plane-volume-method-9 (_type_ symbol vector-array vector-array) plane-volume) + (debug-draw (_type_) none) + (point-in-vol? (_type_ vector float) symbol) ) ) (deftype vol-control (basic) - ((flags vol-flags :offset-assert 4) - (process process-drawable :offset-assert 8) - (pos-vol-count int32 :offset-assert 12) - (pos-vol plane-volume 32 :inline :offset-assert 16) - (neg-vol-count int32 :offset-assert 784) - (neg-vol plane-volume 32 :inline :offset-assert 788) - (debug-point vector-array :offset-assert 1556) - (debug-normal vector-array :offset-assert 1560) + ((flags vol-flags) + (process process-drawable) + (pos-vol-count int32) + (pos-vol plane-volume 32 :inline) + (neg-vol-count int32) + (neg-vol plane-volume 32 :inline) + (debug-point vector-array) + (debug-normal vector-array) ) - :method-count-assert 12 - :size-assert #x61c - :flag-assert #xc0000061c (:methods - (new (symbol type process-drawable) _type_ 0) - (debug-draw (_type_) none 9) - (vol-control-method-10 (_type_ plane) symbol 10) - (should-display? (_type_) symbol 11) + (new (symbol type process-drawable) _type_) + (debug-draw (_type_) none) + (vol-control-method-10 (_type_ plane) symbol) + (should-display? (_type_) symbol) ) ) @@ -117,7 +111,7 @@ ) ) -(defmethod should-display? vol-control ((this vol-control)) +(defmethod should-display? ((this vol-control)) "Returns true/false if the volume's marks should be displayed" (and *display-vol-marks* (logtest? (-> this flags) (vol-flags display?))) ) diff --git a/goal_src/jak2/engine/geometry/vol.gc b/goal_src/jak2/engine/geometry/vol.gc index 6a1c203807a..dd291a7a773 100644 --- a/goal_src/jak2/engine/geometry/vol.gc +++ b/goal_src/jak2/engine/geometry/vol.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS -;; definition for function plane-volume-intersect-dist (defun plane-volume-intersect-dist ((arg0 vector) (arg1 vector) (arg2 vector)) (let ((f0-1 (vector-dot arg1 arg0)) (f1-1 (vector-dot arg2 arg0)) @@ -19,38 +18,7 @@ ) ) -;; definition for method 9 of type plane-volume -;; INFO: Used lq/sq -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -;; WARN: Stack slot offset 148 signed mismatch -(defmethod plane-volume-method-9 plane-volume ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) +(defmethod plane-volume-method-9 ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) (local-vars (sv-144 vector) (sv-148 number) @@ -191,9 +159,7 @@ this ) -;; definition for method 10 of type plane-volume -;; WARN: Return type mismatch int vs none. -(defmethod debug-draw plane-volume ((this plane-volume)) +(defmethod debug-draw ((this plane-volume)) (let* ((v1-0 (-> this volume-type)) (s5-0 (cond ((= v1-0 'vol) @@ -226,8 +192,7 @@ (none) ) -;; definition for method 11 of type plane-volume -(defmethod point-in-vol? plane-volume ((this plane-volume) (arg0 vector) (arg1 float)) +(defmethod point-in-vol? ((this plane-volume) (arg0 vector) (arg1 float)) "TODO - Checks if the given [[vector]] point is inside the volume defined by 6 [[plane]]s by atleast the padding value provided" (dotimes (v1-0 (-> this num-planes)) (if (< arg1 (- (vector-dot arg0 (the-as vector (-> this plane v1-0))) (-> this plane v1-0 w))) @@ -237,9 +202,7 @@ #t ) -;; definition for method 9 of type vol-control -;; WARN: Return type mismatch int vs none. -(defmethod debug-draw vol-control ((this vol-control)) +(defmethod debug-draw ((this vol-control)) (with-pp (let ((a0-1 this)) (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) (vol-flags display?))) @@ -282,8 +245,7 @@ ) ) -;; definition for method 10 of type vol-control -(defmethod vol-control-method-10 vol-control ((this vol-control) (arg0 plane)) +(defmethod vol-control-method-10 ((this vol-control) (arg0 plane)) (dotimes (s4-0 (-> this neg-vol-count)) (if (point-in-vol? (-> this neg-vol s4-0) arg0 0.0) (return #f) diff --git a/goal_src/jak2/engine/gfx/background/background-h.gc b/goal_src/jak2/engine/gfx/background/background-h.gc index 02039719f14..2b571e66834 100644 --- a/goal_src/jak2/engine/gfx/background/background-h.gc +++ b/goal_src/jak2/engine/gfx/background/background-h.gc @@ -10,28 +10,25 @@ ;; DECOMP BEGINS (deftype background-work (basic) - ((tfrag-tree-count int32 :offset-assert 4) - (tfrag-trees drawable-tree-tfrag 8 :offset-assert 8) - (tfrag-levels level 8 :offset-assert 40) - (tfrag-trans-tree-count int32 :offset-assert 72) - (tfrag-trans-trees drawable-tree-tfrag-trans 8 :offset-assert 76) - (tfrag-trans-levels level 8 :offset-assert 108) - (tfrag-water-tree-count int32 :offset-assert 140) - (tfrag-water-trees drawable-tree-tfrag-water 8 :offset-assert 144) - (tfrag-water-levels level 8 :offset-assert 176) - (shrub-tree-count int32 :offset-assert 208) - (shrub-trees drawable-tree-instance-shrub 8 :offset-assert 212) - (shrub-levels level 8 :offset-assert 244) - (tie-tree-count int32 :offset-assert 276) - (tie-trees drawable-tree-instance-tie 8 :offset-assert 280) - (tie-levels level 8 :offset-assert 312) - (tie-generic basic 8 :offset-assert 344) - (tie-generic-trans basic 8 :offset-assert 376) - (wait-to-vu0 uint32 :offset-assert 408) + ((tfrag-tree-count int32) + (tfrag-trees drawable-tree-tfrag 8) + (tfrag-levels level 8) + (tfrag-trans-tree-count int32) + (tfrag-trans-trees drawable-tree-tfrag-trans 8) + (tfrag-trans-levels level 8) + (tfrag-water-tree-count int32) + (tfrag-water-trees drawable-tree-tfrag-water 8) + (tfrag-water-levels level 8) + (shrub-tree-count int32) + (shrub-trees drawable-tree-instance-shrub 8) + (shrub-levels level 8) + (tie-tree-count int32) + (tie-trees drawable-tree-instance-tie 8) + (tie-levels level 8) + (tie-generic basic 8) + (tie-generic-trans basic 8) + (wait-to-vu0 uint32) ) - :method-count-assert 9 - :size-assert #x19c - :flag-assert #x90000019c ) ;; DECOMP ENDS diff --git a/goal_src/jak2/engine/gfx/background/prototype-h.gc b/goal_src/jak2/engine/gfx/background/prototype-h.gc index 8dcf36cf8d6..6ec35ba4089 100644 --- a/goal_src/jak2/engine/gfx/background/prototype-h.gc +++ b/goal_src/jak2/engine/gfx/background/prototype-h.gc @@ -30,186 +30,162 @@ ;; DECOMP BEGINS (deftype prototype-bucket (basic) - ((name string :offset-assert 4) - (flags prototype-flags :offset-assert 8) - (texture-masks-index uint16 :offset-assert 10) - (in-level uint16 :offset-assert 12) - (utextures uint16 :offset-assert 14) - (geometry drawable 4 :offset-assert 16) - (dists vector :inline :offset-assert 32) - (rdists vector :inline :offset-assert 48) - (near-plane meters :offset 32) - (near-stiff meters :offset 36) - (mid-plane meters :offset 40) - (far-plane meters :offset 44) - (rlength-near float :offset 48) - (rlength-stiff float :offset 52) - (rlength-mid float :offset 56) - (stiffness float :offset 60) + ((name string) + (flags prototype-flags) + (texture-masks-index uint16) + (in-level uint16) + (utextures uint16) + (geometry drawable 4) + (dists vector :inline) + (rdists vector :inline) + (near-plane meters :overlay-at (-> dists data 0)) + (near-stiff meters :overlay-at (-> dists data 1)) + (mid-plane meters :overlay-at (-> dists data 2)) + (far-plane meters :overlay-at (-> dists data 3)) + (rlength-near float :overlay-at (-> rdists data 0)) + (rlength-stiff float :overlay-at (-> rdists data 1)) + (rlength-mid float :overlay-at (-> rdists data 2)) + (stiffness float :overlay-at (-> rdists data 3)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype prototype-bucket-shrub (prototype-bucket) - ((next uint32 4 :offset-assert 64) - (count uint16 4 :offset-assert 80) - (mod-count uint16 4 :offset-assert 88) - (last dma-packet 4 :offset-assert 96) - (next-clear uint128 :offset 64) - (count-clear uint64 :offset 80) - (count-clear-qword uint128 :offset 80) - (last-clear uint128 :offset 96) + ((next uint32 4) + (count uint16 4) + (mod-count uint16 4) + (last dma-packet 4) + (next-clear uint128 :overlay-at (-> next 0)) + (count-clear uint64 :overlay-at (-> count 0)) + (count-clear-qword uint128 :overlay-at (-> count 0)) + (last-clear uint128 :overlay-at (-> last 0)) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) (deftype prototype-inline-array-shrub (drawable) - ((length int16 :offset 6) - (data prototype-bucket-shrub 1 :inline :offset 32) - (_pad uint32 :offset-assert 144) + ((length int16 :offset 6) + (data prototype-bucket-shrub 1 :inline :offset 32) + (_pad uint32) ) - :method-count-assert 17 - :size-assert #x94 - :flag-assert #x1100000094 ) (deftype prototype-array-shrub-info (basic) - ((prototype-inline-array-shrub prototype-inline-array-shrub :offset-assert 4) - (wind-vectors uint32 :offset-assert 8) - (wind-count int32 :offset-assert 12) + ((prototype-inline-array-shrub prototype-inline-array-shrub) + (wind-vectors uint32) + (wind-count int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype prototype-bucket-tie (prototype-bucket) - ((next uint32 12 :offset-assert 64) - (count uint16 12 :offset-assert 112) - (frag-count uint8 4 :offset-assert 136) - (index-start uint8 4 :offset-assert 140) - (base-qw uint16 4 :offset-assert 144) - (tie-rvanish float :offset-assert 152) - (tie-vanish-far float :offset-assert 156) - (envmap-rfade float :offset-assert 160) - (envmap-fade-far float :offset-assert 164) - (envmap-shader adgif-shader :offset-assert 168) - (tint-color uint32 :offset-assert 172) - (collide-hash-fragment-array collide-hash-fragment-array :offset-assert 176) - (tie-colors time-of-day-palette :offset-assert 180) - (data uint32 :dynamic :offset-assert 184) - (color-index-qwc uint32 :dynamic :offset-assert 184) - (scissor-frag-count uint8 :offset 136) - (near-frag-count uint8 :offset 137) - (mid-frag-count uint8 :offset 138) - (far-frag-count uint8 :offset 139) - (scissor-index-start uint8 :offset 140) - (near-index-start uint8 :offset 141) - (mid-index-start uint8 :offset 142) - (far-index-start uint8 :offset 143) - (scissor-base-qw uint16 :offset 144) - (near-base-qw uint16 :offset 146) - (mid-base-qw uint16 :offset 148) - (far-base-qw uint16 :offset 150) - (tie-next uint32 4 :offset 64) - (tie-scissor-next uint32 :offset 64) - (tie-near-next uint32 :offset 68) - (tie-mid-next uint32 :offset 72) - (tie-far-next uint32 :offset 76) - (trans-next uint32 4 :offset 64) - (trans-scissor-next uint32 4 :offset 64) - (trans-near-next uint32 :offset 68) - (trans-mid-next uint32 :offset 72) - (trans-far-next uint32 :offset 76) - (water-next uint32 4 :offset 64) - (water-scissor-next uint32 4 :offset 64) - (water-near-next uint32 :offset 68) - (water-mid-next uint32 :offset 72) - (water-far-next uint32 :offset 76) - (envmap-next uint32 4 :offset 80) - (envmap-scissor-next uint32 4 :offset 80) - (envmap-near-next uint32 :offset 84) - (envmap-mid-next uint32 :offset 88) - (envmap-far-next uint32 :offset 92) - (generic-next uint32 3 :offset 96) - (generic-near-next uint32 :offset 96) - (generic-mid-next uint32 :offset 100) - (generic-far-next uint32 :offset 104) - (vanish-next uint32 :offset 108) - (tie-count uint16 4 :offset 112) - (tie-scissor-count uint16 :offset 112) - (tie-near-count uint16 :offset 114) - (tie-mid-count uint16 :offset 116) - (tie-far-count uint16 :offset 118) - (trans-count uint16 4 :offset 112) - (trans-scissor-count uint16 :offset 112) - (trans-near-count uint16 :offset 114) - (trans-mid-count uint16 :offset 116) - (trans-far-count uint16 :offset 118) - (water-count uint16 4 :offset 112) - (water-scissor-count uint16 :offset 112) - (water-near-count uint16 :offset 114) - (water-mid-count uint16 :offset 116) - (water-far-count uint16 :offset 118) - (envmap-count uint16 4 :offset 120) - (envmap-scissor-count uint16 :offset 120) - (envmap-near-count uint16 :offset 122) - (envmap-mid-count uint16 :offset 124) - (envmap-far-count uint16 :offset 126) - (generic-count uint16 3 :offset 128) - (generic-near-count uint16 :offset 128) - (generic-mid-count uint16 :offset 130) - (generic-far-count uint16 :offset 132) - (vanish-count uint16 :offset 134) - (next-clear uint128 3 :offset 64) - (count-clear uint64 3 :offset 112) - (tie-geom prototype-tie 4 :offset 16) + ((next uint32 12) + (count uint16 12) + (frag-count uint8 4) + (index-start uint8 4) + (base-qw uint16 4) + (tie-rvanish float) + (tie-vanish-far float) + (envmap-rfade float) + (envmap-fade-far float) + (envmap-shader adgif-shader) + (tint-color uint32) + (collide-hash-fragment-array collide-hash-fragment-array) + (tie-colors time-of-day-palette) + (data uint32 :dynamic) + (color-index-qwc uint32 :dynamic) + (scissor-frag-count uint8 :overlay-at (-> frag-count 0)) + (near-frag-count uint8 :overlay-at (-> frag-count 1)) + (mid-frag-count uint8 :overlay-at (-> frag-count 2)) + (far-frag-count uint8 :overlay-at (-> frag-count 3)) + (scissor-index-start uint8 :overlay-at (-> index-start 0)) + (near-index-start uint8 :overlay-at (-> index-start 1)) + (mid-index-start uint8 :overlay-at (-> index-start 2)) + (far-index-start uint8 :overlay-at (-> index-start 3)) + (scissor-base-qw uint16 :overlay-at (-> base-qw 0)) + (near-base-qw uint16 :overlay-at (-> base-qw 1)) + (mid-base-qw uint16 :overlay-at (-> base-qw 2)) + (far-base-qw uint16 :overlay-at (-> base-qw 3)) + (tie-next uint32 4 :overlay-at (-> next 0)) + (tie-scissor-next uint32 :overlay-at (-> next 0)) + (tie-near-next uint32 :overlay-at (-> next 1)) + (tie-mid-next uint32 :overlay-at (-> next 2)) + (tie-far-next uint32 :overlay-at (-> next 3)) + (trans-next uint32 4 :overlay-at (-> next 0)) + (trans-scissor-next uint32 4 :overlay-at (-> next 0)) + (trans-near-next uint32 :overlay-at (-> next 1)) + (trans-mid-next uint32 :overlay-at (-> next 2)) + (trans-far-next uint32 :overlay-at (-> next 3)) + (water-next uint32 4 :overlay-at (-> next 0)) + (water-scissor-next uint32 4 :overlay-at (-> next 0)) + (water-near-next uint32 :overlay-at (-> next 1)) + (water-mid-next uint32 :overlay-at (-> next 2)) + (water-far-next uint32 :overlay-at (-> next 3)) + (envmap-next uint32 4 :overlay-at (-> next 4)) + (envmap-scissor-next uint32 4 :overlay-at (-> next 4)) + (envmap-near-next uint32 :overlay-at (-> next 5)) + (envmap-mid-next uint32 :overlay-at (-> next 6)) + (envmap-far-next uint32 :overlay-at (-> next 7)) + (generic-next uint32 3 :overlay-at (-> next 8)) + (generic-near-next uint32 :overlay-at (-> next 8)) + (generic-mid-next uint32 :overlay-at (-> next 9)) + (generic-far-next uint32 :overlay-at (-> next 10)) + (vanish-next uint32 :overlay-at (-> next 11)) + (tie-count uint16 4 :overlay-at (-> count 0)) + (tie-scissor-count uint16 :overlay-at (-> count 0)) + (tie-near-count uint16 :overlay-at (-> count 1)) + (tie-mid-count uint16 :overlay-at (-> count 2)) + (tie-far-count uint16 :overlay-at (-> count 3)) + (trans-count uint16 4 :overlay-at (-> count 0)) + (trans-scissor-count uint16 :overlay-at (-> count 0)) + (trans-near-count uint16 :overlay-at (-> count 1)) + (trans-mid-count uint16 :overlay-at (-> count 2)) + (trans-far-count uint16 :overlay-at (-> count 3)) + (water-count uint16 4 :overlay-at (-> count 0)) + (water-scissor-count uint16 :overlay-at (-> count 0)) + (water-near-count uint16 :overlay-at (-> count 1)) + (water-mid-count uint16 :overlay-at (-> count 2)) + (water-far-count uint16 :overlay-at (-> count 3)) + (envmap-count uint16 4 :overlay-at (-> count 4)) + (envmap-scissor-count uint16 :overlay-at (-> count 4)) + (envmap-near-count uint16 :overlay-at (-> count 5)) + (envmap-mid-count uint16 :overlay-at (-> count 6)) + (envmap-far-count uint16 :overlay-at (-> count 7)) + (generic-count uint16 3 :overlay-at (-> count 8)) + (generic-near-count uint16 :overlay-at (-> count 8)) + (generic-mid-count uint16 :overlay-at (-> count 9)) + (generic-far-count uint16 :overlay-at (-> count 10)) + (vanish-count uint16 :overlay-at (-> count 11)) + (next-clear uint128 3 :overlay-at (-> next 0)) + (count-clear uint64 3 :overlay-at (-> count 0)) + (tie-geom prototype-tie 4 :overlay-at (-> geometry 0)) ) - :method-count-assert 9 - :size-assert #xb8 - :flag-assert #x9000000b8 ) (deftype prototype-array-tie (array) - ((array-data prototype-bucket-tie :dynamic :offset 16) + ((array-data prototype-bucket-tie :dynamic :offset 16) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (login (_type_) none 9) + (login (_type_) none) ) ) (deftype proxy-prototype-array-tie (basic) - ((prototype-array-tie prototype-array-tie :offset-assert 4) - (wind-vectors uint32 :offset-assert 8) - (wind-count uint16 :offset-assert 12) - (prototype-max-qwc uint16 :offset-assert 14) + ((prototype-array-tie prototype-array-tie) + (wind-vectors uint32) + (wind-count uint16) + (prototype-max-qwc uint16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype instance (drawable) - ((bucket-index uint16 :offset 6) - (origin matrix4h :inline :offset-assert 32) - (flags instance-flags :offset 46) - (wind-index uint16 :offset 62) + ((bucket-index uint16 :offset 6) + (origin matrix4h :inline) + (flags instance-flags :overlay-at (-> origin data 7)) + (wind-index uint16 :overlay-at (-> origin data 15)) ) - :method-count-assert 17 - :size-assert #x40 - :flag-assert #x1100000040 ) diff --git a/goal_src/jak2/engine/gfx/background/prototype.gc b/goal_src/jak2/engine/gfx/background/prototype.gc index 511f79dd4e0..68802ede616 100644 --- a/goal_src/jak2/engine/gfx/background/prototype.gc +++ b/goal_src/jak2/engine/gfx/background/prototype.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod login prototype-inline-array-shrub ((this prototype-inline-array-shrub)) +(defmethod login ((this prototype-inline-array-shrub)) (let ((bsp-header (-> *level* level *level-index* bsp))) (dotimes (shrub-idx (-> this length)) (let ((shrub (-> this data shrub-idx))) @@ -31,7 +31,7 @@ this ) -(defmethod mem-usage prototype-array-tie ((this prototype-array-tie) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage ((this prototype-array-tie) (usage memory-usage-block) (arg2 int)) (set! (-> usage length) (max 1 (-> usage length))) (set! (-> usage data 0 name) (symbol->string 'drawable-group)) (+! (-> usage data 0 count) 1) @@ -45,7 +45,7 @@ this ) -(defmethod mem-usage prototype-bucket-tie ((this prototype-bucket-tie) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage ((this prototype-bucket-tie) (usage memory-usage-block) (arg2 int)) (dotimes (idx 4) (let ((tie-geom (-> this tie-geom idx))) (if (nonzero? tie-geom) @@ -75,7 +75,7 @@ this ) -(defmethod mem-usage prototype-inline-array-shrub ((this prototype-inline-array-shrub) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage ((this prototype-inline-array-shrub) (usage memory-usage-block) (arg2 int)) (set! (-> usage length) (max 1 (-> usage length))) (set! (-> usage data 0 name) (symbol->string 'drawable-group)) (+! (-> usage data 0 count) 1) @@ -89,7 +89,7 @@ this ) -(defmethod mem-usage prototype-bucket-shrub ((this prototype-bucket-shrub) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage ((this prototype-bucket-shrub) (usage memory-usage-block) (arg2 int)) (set! (-> usage length) (max 25 (-> usage length))) (set! (-> usage data 24 name) "prototype-bucket-shrub") (+! (-> usage data 24 count) 1) diff --git a/goal_src/jak2/engine/gfx/background/subdivide-h.gc b/goal_src/jak2/engine/gfx/background/subdivide-h.gc index 2bf3eb87f9b..d27610931d4 100644 --- a/goal_src/jak2/engine/gfx/background/subdivide-h.gc +++ b/goal_src/jak2/engine/gfx/background/subdivide-h.gc @@ -17,16 +17,13 @@ ;; DECOMP BEGINS (deftype subdivide-settings (basic) - ((dist float 5 :offset-assert 4) - (meters float 5 :offset-assert 24) - (close float 8 :offset-assert 44) - (far float 8 :offset-assert 76) + ((dist float 5) + (meters float 5) + (close float 8) + (far float 8) ) - :method-count-assert 9 - :size-assert #x6c - :flag-assert #x90000006c (:methods - (new (symbol type meters meters) _type_ 0) + (new (symbol type meters meters) _type_) ) ) @@ -42,154 +39,127 @@ ) (deftype subdivide-dists (structure) - ((data uint32 32 :offset-assert 0) - (vector vector 8 :inline :offset 0) - (k0s uint128 4 :offset 0) - (k1s uint128 4 :offset 64) + ((data uint32 32) + (vector vector 8 :inline :overlay-at (-> data 0)) + (k0s uint128 4 :overlay-at (-> data 0)) + (k1s uint128 4 :overlay-at (-> data 16)) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) (deftype terrain-stats (structure) - ((pris tr-stat :inline :offset-assert 0) - (tie-generic tr-stat :inline :offset-assert 16) - (tie-vanish tr-stat :inline :offset-assert 32) - (tie tr-stat :inline :offset-assert 48) - (tie-scissor tr-stat :inline :offset-assert 64) - (tie-envmap tr-stat :inline :offset-assert 80) - (tie-envmap-scissor tr-stat :inline :offset-assert 96) - (tie-trans tr-stat :inline :offset-assert 112) - (tie-scissor-trans tr-stat :inline :offset-assert 128) - (tie-envmap-trans tr-stat :inline :offset-assert 144) - (tie-envmap-scissor-trans tr-stat :inline :offset-assert 160) - (tie-water tr-stat :inline :offset-assert 176) - (tie-scissor-water tr-stat :inline :offset-assert 192) - (tie-envmap-water tr-stat :inline :offset-assert 208) - (tie-envmap-scissor-water tr-stat :inline :offset-assert 224) - (shrub-near tr-stat :inline :offset-assert 240) - (shrub tr-stat :inline :offset-assert 256) - (tfrag-scissor tr-stat :inline :offset-assert 272) - (tfrag tr-stat :inline :offset-assert 288) - (billboard tr-stat :inline :offset-assert 304) - (tfrag-trans tr-stat :inline :offset-assert 320) - (tfrag-scissor-trans tr-stat :inline :offset-assert 336) - (tfrag-water tr-stat :inline :offset-assert 352) - (tfrag-scissor-water tr-stat :inline :offset-assert 368) - (trans-pris tr-stat :inline :offset-assert 384) - (trans-shrub tr-stat :inline :offset-assert 400) - (ocean-mid tr-stat :inline :offset-assert 416) - (ocean-near tr-stat :inline :offset-assert 432) - (shadow tr-stat :inline :offset-assert 448) - (total tr-stat :inline :offset-assert 464) + ((pris tr-stat :inline) + (tie-generic tr-stat :inline) + (tie-vanish tr-stat :inline) + (tie tr-stat :inline) + (tie-scissor tr-stat :inline) + (tie-envmap tr-stat :inline) + (tie-envmap-scissor tr-stat :inline) + (tie-trans tr-stat :inline) + (tie-scissor-trans tr-stat :inline) + (tie-envmap-trans tr-stat :inline) + (tie-envmap-scissor-trans tr-stat :inline) + (tie-water tr-stat :inline) + (tie-scissor-water tr-stat :inline) + (tie-envmap-water tr-stat :inline) + (tie-envmap-scissor-water tr-stat :inline) + (shrub-near tr-stat :inline) + (shrub tr-stat :inline) + (tfrag-scissor tr-stat :inline) + (tfrag tr-stat :inline) + (billboard tr-stat :inline) + (tfrag-trans tr-stat :inline) + (tfrag-scissor-trans tr-stat :inline) + (tfrag-water tr-stat :inline) + (tfrag-scissor-water tr-stat :inline) + (trans-pris tr-stat :inline) + (trans-shrub tr-stat :inline) + (ocean-mid tr-stat :inline) + (ocean-near tr-stat :inline) + (shadow tr-stat :inline) + (total tr-stat :inline) ) - :method-count-assert 9 - :size-assert #x1e0 - :flag-assert #x9000001e0 ) (deftype dma-area (structure) - ((instance-shrub-dma instance-shrub-dma :inline :offset 0) - (draw-node-dma draw-node-dma :inline :offset 0) - (tfrag-dma tfrag-dma :inline :offset 0) - (instance-tie-dma instance-tie-dma :inline :offset 0) - (prototype-tie-dma prototype-tie-dma :inline :offset 0) - (wind-dma wind-dma :inline :offset 0) - (time-of-day-dma time-of-day-dma :inline :offset 0) - (decomp-work decomp-work :inline :offset 0) - (ocean-vertex ocean-vertex 4 :offset 0) + ((instance-shrub-dma instance-shrub-dma :inline :offset 0) + (draw-node-dma draw-node-dma :inline :offset 0) + (tfrag-dma tfrag-dma :inline :offset 0) + (instance-tie-dma instance-tie-dma :inline :offset 0) + (prototype-tie-dma prototype-tie-dma :inline :offset 0) + (wind-dma wind-dma :inline :offset 0) + (time-of-day-dma time-of-day-dma :inline :offset 0) + (decomp-work decomp-work :inline :offset 0) + (ocean-vertex ocean-vertex 4 :offset 0) ) - :method-count-assert 9 - :size-assert #x38a0 - :flag-assert #x9000038a0 ) (deftype background-area (structure) - ((dma-area dma-area :inline :offset-assert 0) - (vis-list uint8 2048 :offset-assert 14496) + ((dma-area dma-area :inline) + (vis-list uint8 2048) ) - :method-count-assert 9 - :size-assert #x40a0 - :flag-assert #x9000040a0 ) (deftype foreground-area (structure) - ((generic-work generic-work :inline :offset-assert 0) - (foreground-work foreground-work :inline :offset 0) - (joint-work joint-work :inline :offset 0) - (bone-mem bone-memory :inline :offset 0) - (shadow-work shadow-work :inline :offset 0) + ((generic-work generic-work :inline) + (foreground-work foreground-work :inline :overlay-at (-> generic-work saves ptr-dma)) + (joint-work joint-work :inline :overlay-at (-> generic-work saves ptr-dma)) + (bone-mem bone-memory :inline :overlay-at (-> generic-work saves ptr-dma)) + (shadow-work shadow-work :inline :overlay-at (-> generic-work saves ptr-dma)) ) - :method-count-assert 9 - :size-assert #x3fe0 - :flag-assert #x900003fe0 ) (deftype region-prim-area (structure) - ((region-prim-list region-prim-list :inline :offset-assert 0) - (pos vector :inline :offset-assert 1296) - (unknown-vector-uiyb1 vector :inline :offset-assert 1312) - (ray vector :inline :offset 1328) - (unknown-vector-t3edh vector :inline :offset-assert 1344) - (region-enter-count int32 :offset 1360) - (region-enter-list region 320 :offset-assert 1364) - (region-enter-prim-list drawable-region-sphere 320 :offset-assert 2644) - (region-exit-count int32 :offset-assert 3924) - (region-exit-list region 320 :offset-assert 3928) - (region-exit-prim-list drawable-region-sphere 320 :offset-assert 5208) - (region-inside-count int32 :offset-assert 6488) - (region-inside-list region 320 :offset-assert 6492) - (region-inside-prim-list drawable-region-sphere 320 :offset-assert 7772) - (region-start-count int32 :offset-assert 9052) - (region-start-list region 320 :offset-assert 9056) - (region-start-prim-list drawable-region-sphere 320 :offset-assert 10336) + ((region-prim-list region-prim-list :inline) + (pos vector :inline) + (unknown-vector-uiyb1 vector :inline) + (ray vector :inline :offset 1328) + (unknown-vector-t3edh vector :inline) + (region-enter-count int32 :offset 1360) + (region-enter-list region 320) + (region-enter-prim-list drawable-region-sphere 320) + (region-exit-count int32) + (region-exit-list region 320) + (region-exit-prim-list drawable-region-sphere 320) + (region-inside-count int32) + (region-inside-list region 320) + (region-inside-prim-list drawable-region-sphere 320) + (region-start-count int32) + (region-start-list region 320) + (region-start-prim-list drawable-region-sphere 320) ) - :method-count-assert 13 - :size-assert #x2d60 - :flag-assert #xd00002d60 (:methods - (track-entered-region! (_type_ drawable-region-sphere) none 9) - (track-exited-region! (_type_ drawable-region-sphere) none 10) - (track-inside-region! (_type_ drawable-region-sphere) none 11) - (track-start-region! (_type_ drawable-region-sphere) none 12) + (track-entered-region! (_type_ drawable-region-sphere) none) + (track-exited-region! (_type_ drawable-region-sphere) none) + (track-inside-region! (_type_ drawable-region-sphere) none) + (track-start-region! (_type_ drawable-region-sphere) none) ) ) (deftype sprite-area (structure) - ((clock-data vector 13 :inline :offset-assert 0) - (buffer uint8 :dynamic :offset-assert 208) + ((clock-data vector 13 :inline) + (buffer uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #xd0 - :flag-assert #x9000000d0 ) (deftype work-area (structure) - ((background background-area :inline :offset-assert 0) - (foreground foreground-area :inline :offset 0) - (region-prim region-prim-area :inline :offset 0) - (sprite sprite-area :inline :offset 0) + ((background background-area :inline) + (foreground foreground-area :inline :overlay-at (-> background dma-area ocean-vertex 0)) + (region-prim region-prim-area :inline :overlay-at (-> background dma-area ocean-vertex 0)) + (sprite sprite-area :inline :overlay-at (-> background dma-area ocean-vertex 0)) ) - :method-count-assert 9 - :size-assert #x40a0 - :flag-assert #x9000040a0 ) (deftype terrain-context (structure) - ((work work-area :inline :offset-assert 0) + ((work work-area :inline) ) - :method-count-assert 9 - :size-assert #x40a0 - :flag-assert #x9000040a0 ) diff --git a/goal_src/jak2/engine/gfx/background/tfrag/tfrag-h.gc b/goal_src/jak2/engine/gfx/background/tfrag/tfrag-h.gc index a471172873d..3aa05d3679c 100644 --- a/goal_src/jak2/engine/gfx/background/tfrag/tfrag-h.gc +++ b/goal_src/jak2/engine/gfx/background/tfrag/tfrag-h.gc @@ -14,252 +14,201 @@ ;; DECOMP BEGINS (deftype tfragment-stats (structure) - ((num-tris uint16 4 :offset-assert 0) - (num-dverts uint16 4 :offset-assert 8) + ((num-tris uint16 4) + (num-dverts uint16 4) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype tfragment-debug-data (structure) - ((stats tfragment-stats :inline :offset-assert 0) - (debug-lines (array vector-array) :offset-assert 16) + ((stats tfragment-stats :inline) + (debug-lines (array vector-array)) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype generic-tfragment (structure) - ((dummy int32 :offset-assert 0) + ((dummy int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype tfragment (drawable) - ((color-index uint16 :offset 6) - (debug-data tfragment-debug-data :offset 8) - (color-indices uint32 :offset 12) - (colors uint32 :offset 12) - (dma-chain uint32 3 :offset 32) - (dma-common uint32 :offset 32) - (dma-level-0 uint32 :offset 32) - (dma-base uint32 :offset 36) - (dma-level-1 uint32 :offset 40) - (dma-qwc uint8 4 :offset 44) - (dma-u32 uint32 :offset 44) - (shader (inline-array adgif-shader) :offset 48) - (num-shaders uint8 :offset 52) - (num-base-colors uint8 :offset 53) - (num-level0-colors uint8 :offset 54) - (num-level1-colors uint8 :offset 55) - (color-offset uint8 :offset 56) - (color-count uint8 :offset 57) - (texture-masks-index uint16 :offset 58) - (generic generic-tfragment :offset 60) - (generic-u32 uint32 :offset 60) + ((color-index uint16 :offset 6) + (debug-data tfragment-debug-data :offset 8) + (color-indices uint32 :offset 12) + (colors uint32 :overlay-at color-indices) + (dma-chain uint32 3 :offset 32) + (dma-common uint32 :overlay-at (-> dma-chain 0)) + (dma-level-0 uint32 :overlay-at dma-common) + (dma-base uint32 :overlay-at (-> dma-chain 1)) + (dma-level-1 uint32 :overlay-at (-> dma-chain 2)) + (dma-qwc uint8 4 :offset 44) + (dma-u32 uint32 :overlay-at (-> dma-qwc 0)) + (shader (inline-array adgif-shader) :offset 48) + (num-shaders uint8 :offset 52) + (num-base-colors uint8 :offset 53) + (num-level0-colors uint8 :offset 54) + (num-level1-colors uint8 :offset 55) + (color-offset uint8 :offset 56) + (color-count uint8 :offset 57) + (texture-masks-index uint16 :offset 58) + (generic generic-tfragment :offset 60) + (generic-u32 uint32 :overlay-at generic) ) - :method-count-assert 17 - :size-assert #x40 - :flag-assert #x1100000040 ) (deftype drawable-inline-array-tfrag (drawable-inline-array) - ((data tfragment 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 96) + ((data tfragment 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x64 - :flag-assert #x1100000064 ) (deftype drawable-inline-array-tfrag-trans (drawable-inline-array-tfrag) - ((data2 tfragment 1 :inline :offset-assert 112) - (pad2 uint32 :offset-assert 176) + ((data2 tfragment 1 :inline) + (pad2 uint32) ) - :method-count-assert 17 - :size-assert #xb4 - :flag-assert #x11000000b4 ) (deftype drawable-inline-array-tfrag-water (drawable-inline-array-tfrag) - ((data2 tfragment 1 :inline :offset-assert 112) - (pad2 uint32 :offset-assert 176) + ((data2 tfragment 1 :inline) + (pad2 uint32) ) - :method-count-assert 17 - :size-assert #xb4 - :flag-assert #x11000000b4 ) (deftype drawable-tree-tfrag (drawable-tree) - ((time-of-day-pal time-of-day-palette :offset 12) - (arrays drawable-inline-array :dynamic :offset 32) + ((time-of-day-pal time-of-day-palette :offset 12) + (arrays drawable-inline-array :dynamic :offset 32) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) (deftype drawable-tree-tfrag-trans (drawable-tree-tfrag) () - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) (deftype drawable-tree-tfrag-water (drawable-tree-tfrag-trans) () - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) (deftype tfrag-dists (structure) - ((data uint32 16 :offset-assert 0) - (vector vector 4 :inline :offset 0) - (k0s vector 2 :inline :offset 0) - (k1s vector 2 :inline :offset 32) + ((data uint32 16) + (vector vector 4 :inline :overlay-at (-> data 0)) + (k0s vector 2 :inline :overlay-at (-> data 0)) + (k1s vector 2 :inline :overlay-at (-> data 8)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype tfrag-data (structure) - ((data uint32 56 :offset 0) - (vector vector 14 :inline :offset 0) - (fog vector :inline :offset 0) - (val vector :inline :offset 16) - (strgif gs-gif-tag :inline :offset 32) - (fangif gs-gif-tag :inline :offset 48) - (adgif gs-gif-tag :inline :offset 64) - (hvdf-offset vector :inline :offset 80) - (hmge-scale vector :inline :offset 96) - (invh-scale vector :inline :offset 112) - (ambient vector :inline :offset 128) - (guard vector :inline :offset 144) - (dists tfrag-dists :inline :offset 160) - (k0s uint128 2 :offset 160) - (k1s uint128 2 :offset 192) + ((data uint32 56 :offset 0) + (vector vector 14 :inline :overlay-at (-> data 0)) + (fog vector :inline :overlay-at (-> vector 0)) + (val vector :inline :overlay-at (-> vector 1)) + (strgif gs-gif-tag :inline :overlay-at (-> data 8)) + (fangif gs-gif-tag :inline :overlay-at (-> data 12)) + (adgif gs-gif-tag :inline :overlay-at (-> data 16)) + (hvdf-offset vector :inline :overlay-at (-> vector 5)) + (hmge-scale vector :inline :overlay-at (-> vector 6)) + (invh-scale vector :inline :overlay-at (-> vector 7)) + (ambient vector :inline :overlay-at (-> vector 8)) + (guard vector :inline :overlay-at (-> vector 9)) + (dists tfrag-dists :inline :overlay-at (-> data 40)) + (k0s uint128 2 :overlay-at (-> data 40)) + (k1s uint128 2 :overlay-at (-> data 48)) ) - :method-count-assert 9 - :size-assert #xe0 - :flag-assert #x9000000e0 ) (deftype tfrag-control (structure) - ((num-base-points uint32 :offset-assert 0) - (num-shared-base-points uint32 :offset-assert 4) - (num-level0-points uint32 :offset-assert 8) - (num-shared-level0-points uint32 :offset-assert 12) - (num-level1-points uint32 :offset-assert 16) - (num-shared-level1-points uint32 :offset-assert 20) - (ptr-vtxdata uint32 :offset-assert 24) - (ptr-base-points uint32 :offset-assert 28) - (ptr-shared-base-points uint32 :offset-assert 32) - (ptr-level0-points uint32 :offset-assert 36) - (ptr-shared-level0-points uint32 :offset-assert 40) - (ptr-level1-points uint32 :offset-assert 44) - (ptr-shared-level1-points uint32 :offset-assert 48) - (ptr-draw-points uint32 :offset-assert 52) - (ptr-interpolated-0 uint32 :offset-assert 56) - (ptr-shared-interpolated-0 uint32 :offset-assert 60) - (ptr-interpolated1 uint32 :offset-assert 64) - (ptr-shared-interpolated1 uint32 :offset-assert 68) - (ptr-strip-data uint32 :offset-assert 72) - (ptr-texture-data uint32 :offset-assert 76) + ((num-base-points uint32) + (num-shared-base-points uint32) + (num-level0-points uint32) + (num-shared-level0-points uint32) + (num-level1-points uint32) + (num-shared-level1-points uint32) + (ptr-vtxdata uint32) + (ptr-base-points uint32) + (ptr-shared-base-points uint32) + (ptr-level0-points uint32) + (ptr-shared-level0-points uint32) + (ptr-level1-points uint32) + (ptr-shared-level1-points uint32) + (ptr-draw-points uint32) + (ptr-interpolated-0 uint32) + (ptr-shared-interpolated-0 uint32) + (ptr-interpolated1 uint32) + (ptr-shared-interpolated1 uint32) + (ptr-strip-data uint32) + (ptr-texture-data uint32) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype tfrag-stats (structure) - ((from int32 :offset-assert 0) - (to int32 :offset-assert 4) - (cnt int32 :offset-assert 8) - (tris int32 :offset-assert 12) - (tfaces int32 :offset-assert 16) - (tfrags int32 :offset-assert 20) - (dtris int32 :offset-assert 24) - (base-verts int32 :offset-assert 28) - (level0-verts int32 :offset-assert 32) - (level1-verts int32 :offset-assert 36) - (dma-cnt int32 :offset-assert 40) - (dma-dta int32 :offset-assert 44) - (dma-tex int32 :offset-assert 48) - (strips int32 :offset-assert 52) - (drawpoints int32 :offset-assert 56) - (vif int32 :offset-assert 60) + ((from int32) + (to int32) + (cnt int32) + (tris int32) + (tfaces int32) + (tfrags int32) + (dtris int32) + (base-verts int32) + (level0-verts int32) + (level1-verts int32) + (dma-cnt int32) + (dma-dta int32) + (dma-tex int32) + (strips int32) + (drawpoints int32) + (vif int32) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype tfrag-packet (structure) - ((tag uint128 2 :offset-assert 0) + ((tag uint128 2) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype tfrag-work (structure) - ((base-tmpl dma-packet :inline :offset-assert 0) - (level-0-tmpl dma-packet :inline :offset-assert 16) - (common-tmpl dma-packet :inline :offset-assert 32) - (level-1-tmpl dma-packet :inline :offset-assert 48) - (color-tmpl dma-packet :inline :offset-assert 64) - (frag-dists vector :inline :offset-assert 80) - (min-dist vector :inline :offset-assert 96) - (color-ptr vector4w :inline :offset-assert 112) - (tr-stat-tfrag tr-stat :offset-assert 128) - (tr-stat-tfrag-scissor tr-stat :offset-assert 132) - (vu1-enable-tfrag int32 :offset-assert 136) - (vu1-enable-tfrag-scissor int32 :offset-assert 140) - (cur-vis-bits uint32 :offset-assert 144) - (end-vis-bits uint32 :offset-assert 148) - (src-ptr uint32 :offset-assert 152) - (last-call uint32 :offset-assert 156) - (dma-buffer basic :offset-assert 160) - (test-id uint32 :offset-assert 164) - (wait-from-spr uint32 :offset-assert 168) - (wait-to-spr uint32 :offset-assert 172) - (near-wait-from-spr uint32 :offset-assert 176) - (near-wait-to-spr uint32 :offset-assert 180) - (max-fragment uint16 :offset-assert 184) - (min-fragment uint16 :offset-assert 186) - (texture-dists uint32 :offset-assert 188) + ((base-tmpl dma-packet :inline) + (level-0-tmpl dma-packet :inline) + (common-tmpl dma-packet :inline) + (level-1-tmpl dma-packet :inline) + (color-tmpl dma-packet :inline) + (frag-dists vector :inline) + (min-dist vector :inline) + (color-ptr vector4w :inline) + (tr-stat-tfrag tr-stat) + (tr-stat-tfrag-scissor tr-stat) + (vu1-enable-tfrag int32) + (vu1-enable-tfrag-scissor int32) + (cur-vis-bits uint32) + (end-vis-bits uint32) + (src-ptr uint32) + (last-call uint32) + (dma-buffer basic) + (test-id uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (near-wait-from-spr uint32) + (near-wait-to-spr uint32) + (max-fragment uint16) + (min-fragment uint16) + (texture-dists uint32) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) (deftype tfrag-dma (structure) - ((banka tfragment 16 :inline :offset-assert 0) - (bankb tfragment 16 :inline :offset-assert 1024) - (outa uint128 128 :offset-assert 2048) - (outb uint128 128 :offset-assert 4096) - (colors rgba 2047 :offset-assert 6144) + ((banka tfragment 16 :inline) + (bankb tfragment 16 :inline) + (outa uint128 128) + (outb uint128 128) + (colors rgba 2047) ) - :method-count-assert 9 - :size-assert #x37fc - :flag-assert #x9000037fc ) (define-extern draw-drawable-tree-tfrag (function drawable-tree-tfrag none)) diff --git a/goal_src/jak2/engine/gfx/background/tfrag/tfrag-methods.gc b/goal_src/jak2/engine/gfx/background/tfrag/tfrag-methods.gc index f67735615d0..3befd7d62ac 100644 --- a/goal_src/jak2/engine/gfx/background/tfrag/tfrag-methods.gc +++ b/goal_src/jak2/engine/gfx/background/tfrag/tfrag-methods.gc @@ -7,6 +7,7 @@ ;; DECOMP BEGINS +;; WARN: Return type mismatch symbol vs none. (defun edge-debug-lines ((arg0 (array vector-array))) (when (nonzero? arg0) (dotimes (s5-0 (-> arg0 length)) @@ -30,6 +31,7 @@ (none) ) +;; WARN: Return type mismatch drawable-tree-tfrag vs none. (defun draw-drawable-tree-tfrag ((arg0 drawable-tree-tfrag)) (local-vars (sv-16 (pointer uint8))) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) @@ -184,6 +186,7 @@ (none) ) +;; WARN: Return type mismatch drawable-tree-tfrag vs none. (defun draw-drawable-tree-tfrag-trans ((arg0 drawable-tree-tfrag)) (local-vars sv-16 (pointer uint8)) (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) @@ -325,6 +328,7 @@ (none) ) +;; WARN: Return type mismatch drawable-tree-tfrag vs none. (defun draw-drawable-tree-tfrag-water ((arg0 drawable-tree-tfrag)) (local-vars (sv-16 (pointer uint8))) (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) @@ -466,6 +470,7 @@ (none) ) +;; WARN: Return type mismatch pointer vs none. (defun tfrag-vu1-init-buf ((arg0 bucket-id) (arg1 gs-test) (arg2 int) (arg3 uint) (arg4 symbol)) (let ((s4-0 (-> *display* frames (-> *display* on-screen) bucket-group arg0))) (when (!= s4-0 (-> s4-0 last)) @@ -505,22 +510,20 @@ (none) ) +;; WARN: Return type mismatch pointer vs none. (defun tfrag-scissor-vu1-init-buf ((arg0 bucket-id) (arg1 gs-test) (arg2 int) (arg3 uint) (arg4 symbol)) ;; (break!) ;; no scissor (none) ) (deftype tfrag-init-data (structure) - ((tfrag-bucket bucket-id :offset-assert 0) - (tfrag-scissor-bucket bucket-id :offset-assert 4) - (tfrag-trans-bucket bucket-id :offset-assert 8) - (tfrag-scissor-trans-bucket bucket-id :offset-assert 12) - (tfrag-water-bucket bucket-id :offset-assert 16) - (tfrag-water-scissor-bucket bucket-id :offset-assert 20) + ((tfrag-bucket bucket-id) + (tfrag-scissor-bucket bucket-id) + (tfrag-trans-bucket bucket-id) + (tfrag-scissor-trans-bucket bucket-id) + (tfrag-water-bucket bucket-id) + (tfrag-water-scissor-bucket bucket-id) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (define *tfrag-init-table* (new 'static 'inline-array tfrag-init-data LEVEL_MAX @@ -648,7 +651,7 @@ (none) ) -(defmethod draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) (let ((v1-1 (-> *background-work* tfrag-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) @@ -660,7 +663,7 @@ (none) ) -(defmethod draw drawable-tree-tfrag-trans ((this drawable-tree-tfrag-trans) (arg0 drawable-tree-tfrag-trans) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-tfrag-trans) (arg0 drawable-tree-tfrag-trans) (arg1 display-frame)) (let ((v1-1 (-> *background-work* tfrag-trans-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) @@ -672,7 +675,7 @@ (none) ) -(defmethod draw drawable-tree-tfrag-water ((this drawable-tree-tfrag-water) (arg0 drawable-tree-tfrag-water) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-tfrag-water) (arg0 drawable-tree-tfrag-water) (arg1 display-frame)) (let ((v1-1 (-> *background-work* tfrag-water-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) @@ -684,13 +687,13 @@ (none) ) -(defmethod collect-stats tfragment ((this tfragment)) +(defmethod collect-stats ((this tfragment)) (stats-tfrag-asm this) 0 (none) ) -(defmethod collect-stats drawable-tree-tfrag ((this drawable-tree-tfrag)) +(defmethod collect-stats ((this drawable-tree-tfrag)) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))) @@ -711,7 +714,7 @@ (none) ) -(defmethod collect-stats drawable-tree-tfrag-trans ((this drawable-tree-tfrag-trans)) +(defmethod collect-stats ((this drawable-tree-tfrag-trans)) (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))) @@ -732,7 +735,7 @@ (none) ) -(defmethod collect-stats drawable-tree-tfrag-water ((this drawable-tree-tfrag-water)) +(defmethod collect-stats ((this drawable-tree-tfrag-water)) (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))) @@ -753,7 +756,7 @@ (none) ) -(defmethod collect-stats drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) +(defmethod collect-stats ((this drawable-inline-array-tfrag)) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this data s5-0))) @@ -767,7 +770,7 @@ (none) ) -(defmethod collect-stats drawable-inline-array-tfrag-trans ((this drawable-inline-array-tfrag-trans)) +(defmethod collect-stats ((this drawable-inline-array-tfrag-trans)) (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this data s5-0))) @@ -781,7 +784,7 @@ (none) ) -(defmethod collect-stats drawable-inline-array-tfrag-water ((this drawable-inline-array-tfrag-water)) +(defmethod collect-stats ((this drawable-inline-array-tfrag-water)) (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this data s5-0))) @@ -795,7 +798,7 @@ (none) ) -(defmethod debug-draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) (dotimes (s4-0 (-> this length)) (let ((a1-1 (-> this arrays s4-0))) @@ -807,7 +810,7 @@ (none) ) -(defmethod debug-draw drawable-tree-tfrag-trans ((this drawable-tree-tfrag-trans) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-tfrag-trans) (arg0 drawable) (arg1 display-frame)) (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) (dotimes (s4-0 (-> this length)) (let ((a1-1 (-> this arrays s4-0))) @@ -819,7 +822,7 @@ (none) ) -(defmethod debug-draw drawable-tree-tfrag-water ((this drawable-tree-tfrag-water) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-tfrag-water) (arg0 drawable) (arg1 display-frame)) (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) (dotimes (s4-0 (-> this length)) (let ((a1-1 (-> this arrays s4-0))) @@ -831,7 +834,7 @@ (none) ) -(defmethod debug-draw drawable-inline-array-tfrag ((this drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) (dotimes (s4-0 (-> this length)) (let ((s3-0 (-> this data s4-0))) (if (vis-cull (-> s3-0 id)) @@ -843,13 +846,9 @@ (none) ) -(defmethod debug-draw tfragment ((this tfragment) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this tfragment) (arg0 drawable) (arg1 display-frame)) (-> arg1 global-buf) (edge-debug-lines (-> this debug-data debug-lines)) 0 (none) ) - - - - diff --git a/goal_src/jak2/engine/gfx/background/tie/generic-tie-h.gc b/goal_src/jak2/engine/gfx/background/tie/generic-tie-h.gc index 14bb8f7e9dd..2b646097b00 100644 --- a/goal_src/jak2/engine/gfx/background/tie/generic-tie-h.gc +++ b/goal_src/jak2/engine/gfx/background/tie/generic-tie-h.gc @@ -8,240 +8,195 @@ ;; DECOMP BEGINS (deftype generic-tie-instance (structure) - ((matrix-tag dma-packet :inline :offset-assert 0) - (matrix-data vector 6 :inline :offset-assert 16) - (index-tag dma-packet :inline :offset-assert 112) - (indices uint8 224 :offset-assert 128) - (end-tag dma-packet :inline :offset-assert 352) + ((matrix-tag dma-packet :inline) + (matrix-data vector 6 :inline) + (index-tag dma-packet :inline) + (indices uint8 224) + (end-tag dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x170 - :flag-assert #x900000170 ) (deftype generic-tie-input (structure) - ((palette-tag dma-packet :inline :offset-assert 0) - (palette rgba 128 :offset-assert 16) - (model-tag dma-packet :inline :offset-assert 528) - (model vector 146 :inline :offset-assert 544) - (matrix-tag dma-packet :inline :offset-assert 2880) - (matrix-data vector 6 :inline :offset-assert 2896) - (index-tag dma-packet :inline :offset-assert 2992) - (indices uint8 224 :offset-assert 3008) - (end-tag dma-packet :inline :offset-assert 3232) + ((palette-tag dma-packet :inline) + (palette rgba 128) + (model-tag dma-packet :inline) + (model vector 146 :inline) + (matrix-tag dma-packet :inline) + (matrix-data vector 6 :inline) + (index-tag dma-packet :inline) + (indices uint8 224) + (end-tag dma-packet :inline) ) - :method-count-assert 9 - :size-assert #xcb0 - :flag-assert #x900000cb0 ) (deftype generic-tie-run-control (structure) - ((skip-bp2 uint8 :offset-assert 0) - (skip-ips uint8 :offset-assert 1) - (gifbuf-skip uint8 :offset-assert 2) - (strips uint8 :offset-assert 3) - (target-bp1 uint8 :offset-assert 4) - (target-bp2 uint8 :offset-assert 5) - (target-ip1 uint8 :offset-assert 6) - (target-ip2 uint8 :offset-assert 7) - (target-bps uint8 :offset-assert 8) - (target-ips uint8 :offset-assert 9) - (is-generic uint8 :offset-assert 10) - (reserved uint8 :offset-assert 11) + ((skip-bp2 uint8) + (skip-ips uint8) + (gifbuf-skip uint8) + (strips uint8) + (target-bp1 uint8) + (target-bp2 uint8) + (target-ip1 uint8) + (target-ip2 uint8) + (target-bps uint8) + (target-ips uint8) + (is-generic uint8) + (reserved uint8) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype generic-tie-base-point (structure) - ((data uint16 8 :offset-assert 0) - (quad uint128 :offset 0) - (x int16 :offset 0) - (y int16 :offset 2) - (z int16 :offset 4) - (d0 int16 :offset 6) - (vtx uint64 :offset 0) - (u int16 :offset 8) - (v int16 :offset 10) - (tex uint32 :offset 8) - (w int16 :offset 12) - (d1 int16 :offset 14) + ((data uint16 8) + (quad uint128 :overlay-at (-> data 0)) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) + (d0 int16 :overlay-at (-> data 3)) + (vtx uint64 :overlay-at (-> data 0)) + (u int16 :overlay-at (-> data 4)) + (v int16 :overlay-at (-> data 5)) + (tex uint32 :overlay-at (-> data 4)) + (w int16 :overlay-at (-> data 6)) + (d1 int16 :overlay-at (-> data 7)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype generic-tie-bps (structure) - ((bp generic-tie-base-point 4 :inline :offset-assert 0) + ((bp generic-tie-base-point 4 :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype generic-tie-interp-point (structure) - ((data uint16 12 :offset-assert 0) - (x int16 :offset 0) - (y int16 :offset 2) - (z int16 :offset 4) - (d0 int16 :offset 6) - (vtx0 uint64 :offset 0) - (dx int16 :offset 8) - (dy int16 :offset 10) - (dz int16 :offset 12) - (unused int16 :offset 14) - (vtx1 uint64 :offset 8) - (u int16 :offset 16) - (v int16 :offset 18) - (tex uint32 :offset 16) - (w int16 :offset 20) - (d1 int16 :offset 22) + ((data uint16 12) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) + (d0 int16 :overlay-at (-> data 3)) + (vtx0 uint64 :overlay-at (-> data 0)) + (dx int16 :overlay-at (-> data 4)) + (dy int16 :overlay-at (-> data 5)) + (dz int16 :overlay-at (-> data 6)) + (unused int16 :overlay-at (-> data 7)) + (vtx1 uint64 :overlay-at (-> data 4)) + (u int16 :overlay-at (-> data 8)) + (v int16 :overlay-at (-> data 9)) + (tex uint32 :overlay-at (-> data 8)) + (w int16 :overlay-at (-> data 10)) + (d1 int16 :overlay-at (-> data 11)) ) :pack-me - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype generic-tie-ips (structure) - ((ip generic-tie-interp-point 2 :inline :offset-assert 0) + ((ip generic-tie-interp-point 2 :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype generic-tie-header (structure) - ((effect uint8 :offset-assert 0) - (interp-table-size uint8 :offset-assert 1) - (num-bps uint8 :offset-assert 2) - (num-ips uint8 :offset-assert 3) - (tint-color uint32 :offset-assert 4) - (index-table-offset uint16 :offset-assert 8) - (kick-table-offset uint16 :offset-assert 10) - (normal-table-offset uint16 :offset-assert 12) - (interp-table-offset uint16 :offset-assert 14) - (gsf-header gsf-header :inline :offset-assert 16) + ((effect uint8) + (interp-table-size uint8) + (num-bps uint8) + (num-ips uint8) + (tint-color uint32) + (index-table-offset uint16) + (kick-table-offset uint16) + (normal-table-offset uint16) + (interp-table-offset uint16) + (gsf-header gsf-header :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype generic-tie-matrix (structure) - ((matrix matrix :inline :offset-assert 0) - (morph vector :inline :offset-assert 64) - (fog qword :inline :offset-assert 80) + ((matrix matrix :inline) + (morph vector :inline) + (fog qword :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) (deftype generic-tie-normal (structure) - ((x int8 :offset-assert 0) - (y int8 :offset-assert 1) - (z int8 :offset-assert 2) - (dummy int8 :offset-assert 3) + ((x int8) + (y int8) + (z int8) + (dummy int8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype generic-tie-control (structure) - ((ptr-palette uint32 :offset-assert 0) - (ptr-shaders uint32 :offset-assert 4) - (ptr-runctrl generic-tie-run-control :offset-assert 8) - (ptr-verts uint32 :offset-assert 12) - (ptr-generic generic-tie-header :offset-assert 16) - (ptr-dps uint32 :offset-assert 20) - (ptr-kicks uint32 :offset-assert 24) - (ptr-normals uint32 :offset-assert 28) - (ptr-interp uint32 :offset-assert 32) - (ptr-mtxs generic-tie-matrix :offset-assert 36) - (ptr-cinds uint32 :offset-assert 40) - (next-instance uint32 :offset-assert 44) - (next-model uint32 :offset-assert 48) - (next-is-model uint32 :offset-assert 52) - (tie-type uint32 :offset-assert 56) + ((ptr-palette uint32) + (ptr-shaders uint32) + (ptr-runctrl generic-tie-run-control) + (ptr-verts uint32) + (ptr-generic generic-tie-header) + (ptr-dps uint32) + (ptr-kicks uint32) + (ptr-normals uint32) + (ptr-interp uint32) + (ptr-mtxs generic-tie-matrix) + (ptr-cinds uint32) + (next-instance uint32) + (next-model uint32) + (next-is-model uint32) + (tie-type uint32) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) (deftype generic-tie-stats (structure) - ((num-bps uint32 :offset-assert 0) - (num-ips uint32 :offset-assert 4) - (num-dps uint32 :offset-assert 8) - (num-shaders uint32 :offset-assert 12) - (num-models uint32 :offset-assert 16) - (num-instances uint32 :offset-assert 20) - (num-waits uint32 :offset-assert 24) - (num-qwc uint32 :offset-assert 28) - (max-qwc uint32 :offset-assert 32) + ((num-bps uint32) + (num-ips uint32) + (num-dps uint32) + (num-shaders uint32) + (num-models uint32) + (num-instances uint32) + (num-waits uint32) + (num-qwc uint32) + (max-qwc uint32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) (deftype generic-tie-calls (structure) - ((generic-prepare-dma-double basic :offset-assert 0) - (generic-envmap-dproc basic :offset-assert 4) - (generic-interp-dproc basic :offset-assert 8) - (generic-no-light-dproc basic :offset-assert 12) + ((generic-prepare-dma-double basic) + (generic-envmap-dproc basic) + (generic-interp-dproc basic) + (generic-no-light-dproc basic) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype generic-tie-shadow (structure) - ((out-buf gsf-buffer :offset-assert 0) - (cur-buf uint32 :offset-assert 4) - (tie-type int32 :offset-assert 8) - (ptr-inst uint32 :offset-assert 12) - (ptr-buf uint32 :offset-assert 16) - (inst-xor int32 :offset-assert 20) - (end-of-chain uint32 :offset-assert 24) - (write-limit uint32 :offset-assert 28) - (calls generic-tie-calls :inline :offset-assert 32) + ((out-buf gsf-buffer) + (cur-buf uint32) + (tie-type int32) + (ptr-inst uint32) + (ptr-buf uint32) + (inst-xor int32) + (end-of-chain uint32) + (write-limit uint32) + (calls generic-tie-calls :inline) ) :pack-me - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype generic-tie-work (structure) - ((control generic-tie-control :inline :offset-assert 0) - (interp-job generic-interp-job :inline :offset-assert 60) - (shadow generic-tie-shadow :inline :offset-assert 76) - (input-a generic-tie-input :inline :offset-assert 128) - (input-b generic-tie-input :inline :offset-assert 3376) - (inst-buf generic-tie-instance :inline :offset-assert 6624) - (palette-buf rgba 128 :offset-assert 6992) + ((control generic-tie-control :inline) + (interp-job generic-interp-job :inline) + (shadow generic-tie-shadow :inline) + (input-a generic-tie-input :inline) + (input-b generic-tie-input :inline) + (inst-buf generic-tie-instance :inline) + (palette-buf rgba 128) ) - :method-count-assert 9 - :size-assert #x1d50 - :flag-assert #x900001d50 ) diff --git a/goal_src/jak2/engine/gfx/background/tie/tie-h.gc b/goal_src/jak2/engine/gfx/background/tie/tie-h.gc index 7efe52b4129..e789f2385d5 100644 --- a/goal_src/jak2/engine/gfx/background/tie/tie-h.gc +++ b/goal_src/jak2/engine/gfx/background/tie/tie-h.gc @@ -16,332 +16,298 @@ ;; DECOMP BEGINS (deftype tie-fragment-debug (structure) - ((num-tris uint16 :offset-assert 0) - (num-dverts uint16 :offset-assert 2) - (debug-lines (array vector-array) :offset-assert 4) + ((num-tris uint16) + (num-dverts uint16) + (debug-lines (array vector-array)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype tie-fragment (drawable) - ((gif-ref (inline-array adgif-shader) :offset 4) - (point-ref uint32 :offset 8) - (color-index uint16 :offset 12) - (base-colors uint8 :offset 14) - (tex-count uint16 :offset 32) - (gif-count uint16 :offset 34) - (vertex-count uint16 :offset 36) - (color-count uint16 :offset 38) - (dp-ref uint32 :offset 40) - (dp-qwc uint32 :offset 44) - (generic-ref uint32 :offset 48) - (generic-count uint16 :offset 52) - (normal-count uint16 :offset 54) - (normal-ref uint32 :offset 56) - (debug tie-fragment-debug :offset 60) + ((gif-ref (inline-array adgif-shader) :overlay-at id) + (point-ref uint32 :offset 8) + (color-index uint16 :offset 12) + (base-colors uint8 :offset 14) + (tex-count uint16 :offset 32) + (gif-count uint16 :offset 34) + (vertex-count uint16 :offset 36) + (color-count uint16 :offset 38) + (dp-ref uint32 :offset 40) + (dp-qwc uint32 :offset 44) + (generic-ref uint32 :offset 48) + (generic-count uint16 :offset 52) + (normal-count uint16 :offset 54) + (normal-ref uint32 :offset 56) + (debug tie-fragment-debug :offset 60) ) - :method-count-assert 17 - :size-assert #x40 - :flag-assert #x1100000040 ) (deftype instance-tie (instance) - ((color-indices uint32 :offset 8) - (bucket-ptr prototype-bucket-tie :offset 12) - (max-scale uint16 :offset 38) - (rmin-scale uint16 :offset 54) + ((color-indices uint32 :offset 8) + (bucket-ptr prototype-bucket-tie :offset 12) + (max-scale uint16 :overlay-at (-> origin data 3)) + (rmin-scale uint16 :overlay-at (-> origin data 11)) ) - :method-count-assert 17 - :size-assert #x40 - :flag-assert #x1100000040 ) (deftype drawable-inline-array-instance-tie (drawable-inline-array) - ((data instance-tie 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 96) + ((data instance-tie 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x64 - :flag-assert #x1100000064 ) (deftype drawable-tree-instance-tie (drawable-tree) - ((prototypes proxy-prototype-array-tie :offset 8) + ((prototypes proxy-prototype-array-tie :offset 8) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) (deftype prototype-tie (drawable-inline-array) - ((data tie-fragment 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 96) + ((data tie-fragment 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x64 - :flag-assert #x1100000064 ) (deftype tie-matrix (structure) - ((mat matrix :inline :offset-assert 0) - (morph qword :inline :offset-assert 64) - (fog qword :inline :offset-assert 80) - (envmap-flag uint32 :offset 80) - (guard-flag uint32 :offset 84) - (vertex-alpha float :offset 88) - (fog-value float :offset 92) - (fixed-alpha float :offset 68) + ((mat matrix :inline) + (morph qword :inline) + (fog qword :inline) + (envmap-flag uint32 :overlay-at (-> fog data 0)) + (guard-flag uint32 :overlay-at (-> fog data 1)) + (vertex-alpha float :overlay-at (-> fog data 2)) + (fog-value float :overlay-at (-> fog data 3)) + (fixed-alpha float :overlay-at (-> morph data 1)) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) (deftype instance-tie-work (structure) - ((wind-const vector :inline :offset-assert 0) - (hmge-d vector :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (wind-force vector :inline :offset-assert 48) - (constant vector :inline :offset-assert 64) - (far-morph vector :inline :offset-assert 80) - (dist-test vector :inline :offset-assert 96) - (min-dist vector :inline :offset-assert 112) - (guard-plane plane 4 :inline :offset-assert 128) - (upload-color-0 dma-packet :inline :offset-assert 192) - (upload-color-1 dma-packet :inline :offset-assert 208) - (upload-color-2 dma-packet :inline :offset-assert 224) - (upload-color-ret dma-packet :inline :offset-assert 240) - (upload-color-temp dma-packet :inline :offset-assert 256) - (generic-color-0 dma-packet :inline :offset-assert 272) - (generic-color-1 dma-packet :inline :offset-assert 288) - (generic-color-end dma-packet :inline :offset-assert 304) - (envmap-color-0 dma-packet :inline :offset-assert 320) - (envmap-color-1 dma-packet :inline :offset-assert 336) - (tie-scissor-perspective-matrix matrix :inline :offset-assert 352) - (tod-env-color vector :inline :offset-assert 416) - (morph-temp vector :inline :offset-assert 432) - (fog-temp vector :inline :offset-assert 448) - (fade-temp float :offset-assert 464) - (wind-vectors uint32 :offset-assert 468) - (test-id uint32 :offset-assert 472) - (test-id2 uint32 :offset-assert 476) - (dma-buffer basic :offset-assert 480) - (to-spr uint32 :offset-assert 484) - (from-spr uint32 :offset-assert 488) - (wind-work uint32 :offset-assert 492) - (cur-vis-bits uint32 :offset-assert 496) - (end-vis-bits uint32 :offset-assert 500) - (refl-fade-fac float :offset-assert 504) - (refl-fade-end float :offset-assert 508) - (flags uint32 :offset-assert 512) - (vanish-flag uint32 :offset-assert 516) - (translucent-flag uint32 :offset-assert 520) - (wait-from-spr uint32 :offset-assert 524) - (wait-to-spr uint32 :offset-assert 528) - (use-etie symbol :offset-assert 532) - (buffer-start uint32 :offset-assert 536) - (buffer-end uint32 :offset-assert 540) - (tfrag-dists uint32 :offset-assert 544) - (alpha-dists uint32 :offset-assert 548) - (water-dists uint32 :offset-assert 552) + ((wind-const vector :inline) + (hmge-d vector :inline) + (hvdf-offset vector :inline) + (wind-force vector :inline) + (constant vector :inline) + (far-morph vector :inline) + (dist-test vector :inline) + (min-dist vector :inline) + (guard-plane plane 4 :inline) + (upload-color-0 dma-packet :inline) + (upload-color-1 dma-packet :inline) + (upload-color-2 dma-packet :inline) + (upload-color-ret dma-packet :inline) + (upload-color-temp dma-packet :inline) + (generic-color-0 dma-packet :inline) + (generic-color-1 dma-packet :inline) + (generic-color-end dma-packet :inline) + (envmap-color-0 dma-packet :inline) + (envmap-color-1 dma-packet :inline) + (tie-scissor-perspective-matrix matrix :inline) + (tod-env-color vector :inline) + (morph-temp vector :inline) + (fog-temp vector :inline) + (fade-temp float) + (wind-vectors uint32) + (test-id uint32) + (test-id2 uint32) + (dma-buffer basic) + (to-spr uint32) + (from-spr uint32) + (wind-work uint32) + (cur-vis-bits uint32) + (end-vis-bits uint32) + (refl-fade-fac float) + (refl-fade-end float) + (flags uint32) + (vanish-flag uint32) + (translucent-flag uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (use-etie symbol) + (buffer-start uint32) + (buffer-end uint32) + (tfrag-dists uint32) + (alpha-dists uint32) + (water-dists uint32) ) - :method-count-assert 9 - :size-assert #x22c - :flag-assert #x90000022c ) (deftype instance-tie-dma (structure) - ((banka instance-tie 32 :inline :offset-assert 0) - (bankb instance-tie 32 :inline :offset-assert 2048) - (outa uint128 256 :offset-assert 4096) - (outb uint128 256 :offset-assert 8192) - (work instance-tie-work :dynamic :offset-assert 12288) + ((banka instance-tie 32 :inline) + (bankb instance-tie 32 :inline) + (outa uint128 256) + (outb uint128 256) + (work instance-tie-work :dynamic) ) - :method-count-assert 9 - :size-assert #x3000 - :flag-assert #x900003000 ) (deftype prototype-tie-work (structure) - ((upload-flushe dma-packet :inline :offset-assert 0) - (upload-palette dma-packet :inline :offset-assert 16) - (upload-model-0 dma-packet :inline :offset-assert 32) - (upload-model-1 dma-packet :inline :offset-assert 48) - (upload-model-2 dma-packet :inline :offset-assert 64) - (upload-model-3 dma-packet :inline :offset-assert 80) - (upload-model-near-0 dma-packet :inline :offset-assert 96) - (upload-model-near-1 dma-packet :inline :offset-assert 112) - (upload-model-near-2 dma-packet :inline :offset-assert 128) - (upload-model-near-3 dma-packet :inline :offset-assert 144) - (upload-model-near-4 dma-packet :inline :offset-assert 160) - (envmap-palette dma-packet :inline :offset-assert 176) - (envmap-shader dma-packet :inline :offset-assert 192) - (upload-envmap-0 dma-packet :inline :offset-assert 208) - (upload-envmap-1 dma-packet :inline :offset-assert 224) - (upload-envmap-2 dma-packet :inline :offset-assert 240) - (upload-envmap-3 dma-packet :inline :offset-assert 256) - (upload-envmap-4 dma-packet :inline :offset-assert 272) - (upload-envmap-scissor-4 dma-packet :inline :offset-assert 288) - (generic-palette dma-packet :inline :offset-assert 304) - (generic-model-0 dma-packet :inline :offset-assert 320) - (generic-model-1 dma-packet :inline :offset-assert 336) - (generic-model-2 dma-packet :inline :offset-assert 352) - (model-next dma-packet :inline :offset-assert 368) - (clamp uint64 :offset-assert 384) - (prototype-array basic :offset-assert 392) - (wait-from-spr uint32 :offset-assert 396) - (wait-to-spr uint32 :offset-assert 400) - (mood mood-context :offset-assert 404) - (last uint32 16 :offset 416) - (next uint32 16 :offset-assert 480) - (count uint16 16 :offset-assert 544) - (tie-last uint32 :offset 416) - (tie-next uint32 :offset 480) - (tie-count uint16 :offset 544) - (trans-last uint32 :offset 420) - (trans-next uint32 :offset 484) - (trans-count uint16 :offset 546) - (water-last uint32 :offset 424) - (water-next uint32 :offset 488) - (water-count uint16 :offset 548) - (scissor-last uint32 :offset 428) - (scissor-next uint32 :offset 492) - (scissor-count uint16 :offset 550) - (scissor-trans-last uint32 :offset 432) - (scissor-trans-next uint32 :offset 496) - (scissor-trans-count uint16 :offset 552) - (scissor-water-last uint32 :offset 436) - (scissor-water-next uint32 :offset 500) - (scissor-water-count uint16 :offset 554) - (envmap-last uint32 :offset 440) - (envmap-next uint32 :offset 504) - (envmap-count uint16 :offset 556) - (envmap-trans-last uint32 :offset 444) - (envmap-trans-next uint32 :offset 508) - (envmap-trans-count uint16 :offset 558) - (envmap-water-last uint32 :offset 448) - (envmap-water-next uint32 :offset 512) - (envmap-water-count uint16 :offset 560) - (envmap-scissor-last uint32 :offset 452) - (envmap-scissor-next uint32 :offset 516) - (envmap-scissor-count uint16 :offset 562) - (envmap-scissor-trans-last uint32 :offset 456) - (envmap-scissor-trans-next uint32 :offset 520) - (envmap-scissor-trans-count uint16 :offset 564) - (envmap-scissor-water-last uint32 :offset 460) - (envmap-scissor-water-next uint32 :offset 524) - (envmap-scissor-water-count uint16 :offset 566) - (generic-last uint32 :offset 464) - (generic-next uint32 :offset 528) - (generic-count uint16 :offset 568) - (generic-trans-last uint32 :offset 468) - (generic-trans-next uint32 :offset 532) - (generic-trans-count uint16 :offset 570) - (generic-water-last uint32 :offset 472) - (generic-water-next uint32 :offset 536) - (generic-water-count uint16 :offset 572) - (vanish-last uint32 :offset 476) - (vanish-next uint32 :offset 540) - (vanish-count uint16 :offset 574) + ((upload-flushe dma-packet :inline) + (upload-palette dma-packet :inline) + (upload-model-0 dma-packet :inline) + (upload-model-1 dma-packet :inline) + (upload-model-2 dma-packet :inline) + (upload-model-3 dma-packet :inline) + (upload-model-near-0 dma-packet :inline) + (upload-model-near-1 dma-packet :inline) + (upload-model-near-2 dma-packet :inline) + (upload-model-near-3 dma-packet :inline) + (upload-model-near-4 dma-packet :inline) + (envmap-palette dma-packet :inline) + (envmap-shader dma-packet :inline) + (upload-envmap-0 dma-packet :inline) + (upload-envmap-1 dma-packet :inline) + (upload-envmap-2 dma-packet :inline) + (upload-envmap-3 dma-packet :inline) + (upload-envmap-4 dma-packet :inline) + (upload-envmap-scissor-4 dma-packet :inline) + (generic-palette dma-packet :inline) + (generic-model-0 dma-packet :inline) + (generic-model-1 dma-packet :inline) + (generic-model-2 dma-packet :inline) + (model-next dma-packet :inline) + (clamp uint64) + (prototype-array basic) + (wait-from-spr uint32) + (wait-to-spr uint32) + (mood mood-context) + (last uint32 16 :offset 416) + (next uint32 16) + (count uint16 16) + (tie-last uint32 :overlay-at (-> last 0)) + (tie-next uint32 :overlay-at (-> next 0)) + (tie-count uint16 :overlay-at (-> count 0)) + (trans-last uint32 :overlay-at (-> last 1)) + (trans-next uint32 :overlay-at (-> next 1)) + (trans-count uint16 :overlay-at (-> count 1)) + (water-last uint32 :overlay-at (-> last 2)) + (water-next uint32 :overlay-at (-> next 2)) + (water-count uint16 :overlay-at (-> count 2)) + (scissor-last uint32 :overlay-at (-> last 3)) + (scissor-next uint32 :overlay-at (-> next 3)) + (scissor-count uint16 :overlay-at (-> count 3)) + (scissor-trans-last uint32 :overlay-at (-> last 4)) + (scissor-trans-next uint32 :overlay-at (-> next 4)) + (scissor-trans-count uint16 :overlay-at (-> count 4)) + (scissor-water-last uint32 :overlay-at (-> last 5)) + (scissor-water-next uint32 :overlay-at (-> next 5)) + (scissor-water-count uint16 :overlay-at (-> count 5)) + (envmap-last uint32 :overlay-at (-> last 6)) + (envmap-next uint32 :overlay-at (-> next 6)) + (envmap-count uint16 :overlay-at (-> count 6)) + (envmap-trans-last uint32 :overlay-at (-> last 7)) + (envmap-trans-next uint32 :overlay-at (-> next 7)) + (envmap-trans-count uint16 :overlay-at (-> count 7)) + (envmap-water-last uint32 :overlay-at (-> last 8)) + (envmap-water-next uint32 :overlay-at (-> next 8)) + (envmap-water-count uint16 :overlay-at (-> count 8)) + (envmap-scissor-last uint32 :overlay-at (-> last 9)) + (envmap-scissor-next uint32 :overlay-at (-> next 9)) + (envmap-scissor-count uint16 :overlay-at (-> count 9)) + (envmap-scissor-trans-last uint32 :overlay-at (-> last 10)) + (envmap-scissor-trans-next uint32 :overlay-at (-> next 10)) + (envmap-scissor-trans-count uint16 :overlay-at (-> count 10)) + (envmap-scissor-water-last uint32 :overlay-at (-> last 11)) + (envmap-scissor-water-next uint32 :overlay-at (-> next 11)) + (envmap-scissor-water-count uint16 :overlay-at (-> count 11)) + (generic-last uint32 :overlay-at (-> last 12)) + (generic-next uint32 :overlay-at (-> next 12)) + (generic-count uint16 :overlay-at (-> count 12)) + (generic-trans-last uint32 :overlay-at (-> last 13)) + (generic-trans-next uint32 :overlay-at (-> next 13)) + (generic-trans-count uint16 :overlay-at (-> count 13)) + (generic-water-last uint32 :overlay-at (-> last 14)) + (generic-water-next uint32 :overlay-at (-> next 14)) + (generic-water-count uint16 :overlay-at (-> count 14)) + (vanish-last uint32 :overlay-at (-> last 15)) + (vanish-next uint32 :overlay-at (-> next 15)) + (vanish-count uint16 :overlay-at (-> count 15)) ) - :method-count-assert 9 - :size-assert #x240 - :flag-assert #x900000240 ) (deftype prototype-tie-dma (structure) - ((colora rgba 256 :offset-assert 0) - (colorb rgba 256 :offset-assert 1024) - (outa uint128 256 :offset-assert 2048) - (outb uint128 256 :offset-assert 6144) - (geometry uint32 4 :offset-assert 10240) - (next uint32 12 :offset 10256) - (count uint16 12 :offset 10304) - (counts uint32 4 :offset 10328) - (palette-ptr uint32 :offset 10336) - (model-ptr uint32 :offset 10340) - (ret-ptr uint32 :offset 10344) - (length uint32 :offset 10348) - (flags uint32 :offset 10352) - (dma-buffer basic :offset 10356) - (this-frag-count uint32 :offset 10360) - (frag-count uint8 4 :offset 10364) - (from-spr uint32 :offset 10368) - (to-spr uint32 :offset 10372) - (spr-out uint32 :offset 10376) - (this-count uint32 :offset 10380) - (scissor-geometry uint32 :offset 10240) - (near-geometry uint32 :offset 10244) - (mid-geometry uint32 :offset 10248) - (far-geometry uint32 :offset 10252) - (scissor-frag-count uint8 :offset 10364) - (near-frag-count uint8 :offset 10365) - (mid-frag-count uint8 :offset 10366) - (far-frag-count uint8 :offset 10367) - (tie-scissor-next uint32 :offset 10256) - (tie-near-next uint32 :offset 10260) - (tie-mid-next uint32 :offset 10264) - (tie-far-next uint32 :offset 10268) - (trans-scissor-next uint32 4 :offset 10256) - (trans-near-next uint32 :offset 10260) - (trans-mid-next uint32 :offset 10264) - (trans-far-next uint32 :offset 10268) - (water-scissor-next uint32 4 :offset 10256) - (water-near-next uint32 :offset 10260) - (water-mid-next uint32 :offset 10264) - (water-far-next uint32 :offset 10268) - (envmap-scissor-next uint32 4 :offset 10272) - (envmap-near-next uint32 :offset 10276) - (envmap-mid-next uint32 :offset 10280) - (envmap-far-next uint32 :offset 10284) - (generic-near-next uint32 :offset 10288) - (generic-mid-next uint32 :offset 10292) - (generic-far-next uint32 :offset 10296) - (vanish-next uint32 :offset 10300) - (tie-count uint16 :offset 10304) - (tie-scissor-count uint16 :offset 10304) - (tie-near-count uint16 :offset 10306) - (tie-mid-count uint16 :offset 10308) - (tie-far-count uint16 :offset 10310) - (trans-count uint16 :offset 10304) - (trans-scissor-count uint16 :offset 10304) - (trans-near-count uint16 :offset 10306) - (trans-mid-count uint16 :offset 10308) - (trans-far-count uint16 :offset 10310) - (water-count uint16 :offset 10304) - (water-scissor-count uint16 :offset 10304) - (water-near-count uint16 :offset 10306) - (water-mid-count uint16 :offset 10308) - (water-far-count uint16 :offset 10310) - (envmap-count uint16 :offset 10312) - (envmap-scissor-count uint16 :offset 10312) - (envmap-near-count uint16 :offset 10314) - (envmap-mid-count uint16 :offset 10316) - (envmap-far-count uint16 :offset 10318) - (generic-count uint16 :offset 10320) - (generic-near-count uint16 :offset 10320) - (generic-mid-count uint16 :offset 10322) - (generic-far-count uint16 :offset 10324) - (vanish-count uint16 :offset 10326) - (next-clear uint32 3 :offset 10256) - (count-clear uint16 3 :offset 10304) + ((colora rgba 256) + (colorb rgba 256) + (outa uint128 256) + (outb uint128 256) + (geometry uint32 4) + (next uint32 12 :offset 10256) + (count uint16 12 :offset 10304) + (counts uint32 4 :offset 10328) + (palette-ptr uint32 :overlay-at (-> counts 2)) + (model-ptr uint32 :overlay-at (-> counts 3)) + (ret-ptr uint32 :offset 10344) + (length uint32 :offset 10348) + (flags uint32 :offset 10352) + (dma-buffer basic :offset 10356) + (this-frag-count uint32 :offset 10360) + (frag-count uint8 4 :offset 10364) + (from-spr uint32 :offset 10368) + (to-spr uint32 :offset 10372) + (spr-out uint32 :offset 10376) + (this-count uint32 :offset 10380) + (scissor-geometry uint32 :overlay-at (-> geometry 0)) + (near-geometry uint32 :overlay-at (-> geometry 1)) + (mid-geometry uint32 :overlay-at (-> geometry 2)) + (far-geometry uint32 :overlay-at (-> geometry 3)) + (scissor-frag-count uint8 :overlay-at (-> frag-count 0)) + (near-frag-count uint8 :overlay-at (-> frag-count 1)) + (mid-frag-count uint8 :overlay-at (-> frag-count 2)) + (far-frag-count uint8 :overlay-at (-> frag-count 3)) + (tie-scissor-next uint32 :overlay-at (-> next 0)) + (tie-near-next uint32 :overlay-at (-> next 1)) + (tie-mid-next uint32 :overlay-at (-> next 2)) + (tie-far-next uint32 :overlay-at (-> next 3)) + (trans-scissor-next uint32 4 :overlay-at tie-scissor-next) + (trans-near-next uint32 :overlay-at tie-near-next) + (trans-mid-next uint32 :overlay-at tie-mid-next) + (trans-far-next uint32 :overlay-at tie-far-next) + (water-scissor-next uint32 4 :overlay-at tie-scissor-next) + (water-near-next uint32 :overlay-at trans-near-next) + (water-mid-next uint32 :overlay-at trans-mid-next) + (water-far-next uint32 :overlay-at trans-far-next) + (envmap-scissor-next uint32 4 :overlay-at (-> next 4)) + (envmap-near-next uint32 :overlay-at (-> envmap-scissor-next 1)) + (envmap-mid-next uint32 :overlay-at (-> envmap-scissor-next 2)) + (envmap-far-next uint32 :overlay-at (-> envmap-scissor-next 3)) + (generic-near-next uint32 :overlay-at (-> next 8)) + (generic-mid-next uint32 :overlay-at (-> next 9)) + (generic-far-next uint32 :overlay-at (-> next 10)) + (vanish-next uint32 :overlay-at (-> next 11)) + (tie-count uint16 :overlay-at (-> count 0)) + (tie-scissor-count uint16 :overlay-at tie-count) + (tie-near-count uint16 :overlay-at (-> count 1)) + (tie-mid-count uint16 :overlay-at (-> count 2)) + (tie-far-count uint16 :overlay-at (-> count 3)) + (trans-count uint16 :overlay-at tie-scissor-count) + (trans-scissor-count uint16 :overlay-at trans-count) + (trans-near-count uint16 :overlay-at tie-near-count) + (trans-mid-count uint16 :overlay-at tie-mid-count) + (trans-far-count uint16 :overlay-at tie-far-count) + (water-count uint16 :overlay-at trans-scissor-count) + (water-scissor-count uint16 :overlay-at water-count) + (water-near-count uint16 :overlay-at trans-near-count) + (water-mid-count uint16 :overlay-at trans-mid-count) + (water-far-count uint16 :overlay-at trans-far-count) + (envmap-count uint16 :overlay-at (-> count 4)) + (envmap-scissor-count uint16 :overlay-at envmap-count) + (envmap-near-count uint16 :overlay-at (-> count 5)) + (envmap-mid-count uint16 :overlay-at (-> count 6)) + (envmap-far-count uint16 :overlay-at (-> count 7)) + (generic-count uint16 :overlay-at (-> count 8)) + (generic-near-count uint16 :overlay-at generic-count) + (generic-mid-count uint16 :overlay-at (-> count 9)) + (generic-far-count uint16 :overlay-at (-> count 10)) + (vanish-count uint16 :overlay-at (-> count 11)) + (next-clear uint32 3 :overlay-at tie-scissor-next) + (count-clear uint16 3 :overlay-at water-scissor-count) ) - :method-count-assert 9 - :size-assert #x2890 - :flag-assert #x900002890 ) (define *instance-tie-work-copy* (the-as instance-tie-work #f)) - -(define-extern draw-drawable-tree-instance-tie (function drawable-tree-instance-tie level none)) +(define-extern draw-drawable-tree-instance-tie (function drawable-tree-instance-tie level none)) \ No newline at end of file diff --git a/goal_src/jak2/engine/gfx/background/tie/tie.gc b/goal_src/jak2/engine/gfx/background/tie/tie.gc index 7ef8a9a00bd..86a692792cd 100644 --- a/goal_src/jak2/engine/gfx/background/tie/tie.gc +++ b/goal_src/jak2/engine/gfx/background/tie/tie.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod login tie-fragment ((this tie-fragment)) +(defmethod login ((this tie-fragment)) (let ((s5-0 (the-as adgif-shader (-> this gif-ref))) (s4-0 (/ (-> this tex-count) (the-as uint 5))) ) @@ -39,7 +39,7 @@ this ) -(defmethod inspect drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) +(defmethod inspect ((this drawable-inline-array-instance-tie)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) @@ -49,7 +49,7 @@ this ) -(defmethod asize-of drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) +(defmethod asize-of ((this drawable-inline-array-instance-tie)) (the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> this length) -1) 64))) ) @@ -57,14 +57,14 @@ ; this ; ) -(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) +(defmethod login ((this drawable-tree-instance-tie)) (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) ) this ) -(defmethod inspect prototype-tie ((this prototype-tie)) +(defmethod inspect ((this prototype-tie)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) @@ -74,14 +74,14 @@ this ) -(defmethod login prototype-tie ((this prototype-tie)) +(defmethod login ((this prototype-tie)) (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) ) this ) -(defmethod mem-usage drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -96,7 +96,7 @@ this ) -(defmethod mem-usage tie-fragment ((this tie-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this tie-fragment) (arg0 memory-usage-block) (arg1 int)) (when (logtest? arg1 2) (let ((v1-3 (* (-> this color-count) 4)) (a0-2 (cond @@ -168,7 +168,7 @@ this ) -(defmethod mem-usage instance-tie ((this instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 19 (-> arg0 length))) (set! (-> arg0 data 18 name) "instance-tie") (+! (-> arg0 data 18 count) 1) @@ -221,7 +221,7 @@ this ) -(defmethod mem-usage drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -235,7 +235,7 @@ this ) -(defmethod mem-usage prototype-tie ((this prototype-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -249,7 +249,7 @@ this ) -(defmethod asize-of prototype-tie ((this prototype-tie)) +(defmethod asize-of ((this prototype-tie)) (the-as int (+ (-> prototype-tie size) (* (+ (-> this length) -1) 64))) ) @@ -269,9 +269,6 @@ (atest-tra gs-adcmd :inline :offset 128) (atest-def gs-adcmd :inline :offset 144) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) (define tie-vu1-block (new 'static 'vu-function)) diff --git a/goal_src/jak2/engine/gfx/background/wind-h.gc b/goal_src/jak2/engine/gfx/background/wind-h.gc index ef9194302a3..57669214fc9 100644 --- a/goal_src/jak2/engine/gfx/background/wind-h.gc +++ b/goal_src/jak2/engine/gfx/background/wind-h.gc @@ -8,13 +8,10 @@ ;; DECOMP BEGINS (deftype wind-vector (structure) - ((wind-pos vector4w :inline :offset-assert 0) - (wind-vel vector4w :inline :offset-assert 16) - (stiffness float :offset 28) + ((wind-pos vector4w :inline) + (wind-vel vector4w :inline) + (stiffness float :overlay-at (-> wind-vel data 3)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) @@ -55,41 +52,35 @@ ) (deftype wind-work (basic) - ((wind-array vector 64 :inline :offset-assert 16) - (wind-normal vector :inline :offset-assert 1040) - (wind-temp vector :inline :offset-assert 1056) - (wind-force float 64 :offset-assert 1072) - (wind-const vector :inline :offset-assert 1328) - (wind-time uint32 :offset-assert 1344) - (wait-to-vu0 uint32 :offset-assert 1348) - (wait-to-spr uint32 :offset-assert 1352) - (wait-from-spr uint32 :offset-assert 1356) - (spr-index uint32 :offset-assert 1360) - (count uint32 :offset-assert 1364) - (next-count uint32 :offset-assert 1368) - (last-count uint32 :offset-assert 1372) - (to-spr uint32 :offset-assert 1376) - (from-spr uint32 :offset-assert 1380) - (next-mem uint32 :offset-assert 1384) - (last-mem uint32 :offset-assert 1388) - (next-spr uint32 :offset-assert 1392) - (last-spr uint32 :offset-assert 1396) - (to-ptrs uint32 3 :offset-assert 1400) + ((wind-array vector 64 :inline) + (wind-normal vector :inline) + (wind-temp vector :inline) + (wind-force float 64) + (wind-const vector :inline) + (wind-time uint32) + (wait-to-vu0 uint32) + (wait-to-spr uint32) + (wait-from-spr uint32) + (spr-index uint32) + (count uint32) + (next-count uint32) + (last-count uint32) + (to-spr uint32) + (from-spr uint32) + (next-mem uint32) + (last-mem uint32) + (next-spr uint32) + (last-spr uint32) + (to-ptrs uint32 3) ) - :method-count-assert 9 - :size-assert #x584 - :flag-assert #x900000584 ) (deftype wind-dma (structure) - ((buffer0 wind-vector 128 :inline :offset-assert 0) - (buffer1 wind-vector 128 :inline :offset-assert 4096) - (buffer2 wind-vector 128 :inline :offset-assert 8192) + ((buffer0 wind-vector 128 :inline) + (buffer1 wind-vector 128 :inline) + (buffer2 wind-vector 128 :inline) ) - :method-count-assert 9 - :size-assert #x3000 - :flag-assert #x900003000 ) ;; DECOMP ENDS diff --git a/goal_src/jak2/engine/gfx/blit-displays-h.gc b/goal_src/jak2/engine/gfx/blit-displays-h.gc index f3d1484166a..ed21856f51b 100644 --- a/goal_src/jak2/engine/gfx/blit-displays-h.gc +++ b/goal_src/jak2/engine/gfx/blit-displays-h.gc @@ -12,27 +12,24 @@ ;; DECOMP BEGINS (deftype blit-displays-work (structure) - ((adgif-tmpl dma-gif-packet :inline :offset-assert 0) - (sprite-tmpl dma-gif-packet :inline :offset-assert 32) - (sprite-slow-tmpl dma-gif-packet :inline :offset-assert 64) - (line-tmpl dma-gif-packet :inline :offset-assert 96) - (scan-tmpl dma-gif-packet :inline :offset-assert 128) - (color vector4w :inline :offset-assert 160) - (line-color uint64 :offset-assert 176) - (scan-colors vector4w 15 :inline :offset-assert 192) - (menu-mode symbol :offset-assert 432) - (screen-copied symbol :offset-assert 436) - (vu1-enable-user-menu vu1-renderer-mask :offset-assert 440) - (texture-enable-user-menu uint32 :offset-assert 448) - (count-down uint32 :offset-assert 452) - (horizontal-flip-flag symbol :offset-assert 456) - (scan-alpha float :offset-assert 460) - (scanline uint32 :offset-assert 464) - (progress-interp float :offset-assert 468) - (progress-interp-dest float :offset-assert 472) - (progress-interp-speed float :offset-assert 476) + ((adgif-tmpl dma-gif-packet :inline) + (sprite-tmpl dma-gif-packet :inline) + (sprite-slow-tmpl dma-gif-packet :inline) + (line-tmpl dma-gif-packet :inline) + (scan-tmpl dma-gif-packet :inline) + (color vector4w :inline) + (line-color uint64) + (scan-colors vector4w 15 :inline) + (menu-mode symbol) + (screen-copied symbol) + (vu1-enable-user-menu vu1-renderer-mask) + (texture-enable-user-menu uint32) + (count-down uint32) + (horizontal-flip-flag symbol) + (scan-alpha float) + (scanline uint32) + (progress-interp float) + (progress-interp-dest float) + (progress-interp-speed float) ) - :method-count-assert 9 - :size-assert #x1e0 - :flag-assert #x9000001e0 ) diff --git a/goal_src/jak2/engine/gfx/font-h.gc b/goal_src/jak2/engine/gfx/font-h.gc index 1b06257f105..fd44901d691 100644 --- a/goal_src/jak2/engine/gfx/font-h.gc +++ b/goal_src/jak2/engine/gfx/font-h.gc @@ -124,19 +124,19 @@ :size-assert #x54 :flag-assert #x1500000054 (:methods - (new (symbol type matrix int int float font-color font-flags) _type_ 0) - (set-mat! (font-context matrix) font-context 9) - (set-origin! (font-context int int) font-context 10) - (set-depth! (font-context int) font-context 11) - (set-w! (font-context float) font-context 12) - (set-width! (font-context int) font-context 13) - (set-height! (font-context int) font-context 14) - (set-projection! (font-context float) font-context 15) - (set-color! (font-context font-color) font-context 16) - (set-flags! (font-context font-flags) font-context 17) - (set-start-line! (font-context uint) font-context 18) - (set-scale! (font-context float) font-context 19) - (set-alpha! (font-context float) font-context 20) + (new (symbol type matrix int int float font-color font-flags) _type_) + (set-mat! (font-context matrix) font-context) + (set-origin! (font-context int int) font-context) + (set-depth! (font-context int) font-context) + (set-w! (font-context float) font-context) + (set-width! (font-context int) font-context) + (set-height! (font-context int) font-context) + (set-projection! (font-context float) font-context) + (set-color! (font-context font-color) font-context) + (set-flags! (font-context font-flags) font-context) + (set-start-line! (font-context uint) font-context) + (set-scale! (font-context float) font-context) + (set-alpha! (font-context float) font-context) ) ) diff --git a/goal_src/jak2/engine/gfx/foreground/bones-h.gc b/goal_src/jak2/engine/gfx/foreground/bones-h.gc index eb8e3b1970c..88365946e69 100644 --- a/goal_src/jak2/engine/gfx/foreground/bones-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/bones-h.gc @@ -30,93 +30,72 @@ ;; DECOMP BEGINS (deftype bone-buffer (structure) - ((joint matrix 16 :inline :offset-assert 0) - (bone bone 16 :inline :offset-assert 1024) - (output pris-mtx 16 :inline :offset-assert 2304) + ((joint matrix 16 :inline) + (bone bone 16 :inline) + (output pris-mtx 16 :inline) ) - :method-count-assert 9 - :size-assert #x1100 - :flag-assert #x900001100 ) (deftype bone-layout (structure) - ((data uint16 8 :offset-assert 0) - (joint (inline-array matrix) 2 :offset 0) - (bone (inline-array bone) 2 :offset 8) - (output (inline-array pris-mtx) 2 :offset 16) - (unused uint32 2 :offset 24) + ((data uint16 8) + (joint (inline-array matrix) 2 :overlay-at (-> data 0)) + (bone (inline-array bone) 2 :overlay-at (-> data 4)) + (output (inline-array pris-mtx) 2 :offset 16) + (unused uint32 2 :offset 24) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype bone-regs (structure) - ((dma-buf basic :offset-assert 0) - (wait-count uint32 :offset-assert 4) - (in-count uint32 :offset-assert 8) - (sp-size uint32 :offset-assert 12) - (sp-bufnum uint32 :offset-assert 16) - (joint-ptr (inline-array joint) :offset-assert 20) - (bone-ptr (inline-array bone) :offset-assert 24) - (num-bones uint32 :offset-assert 28) - (mtxs (inline-array pris-mtx) :offset-assert 32) + ((dma-buf basic) + (wait-count uint32) + (in-count uint32) + (sp-size uint32) + (sp-bufnum uint32) + (joint-ptr (inline-array joint)) + (bone-ptr (inline-array bone)) + (num-bones uint32) + (mtxs (inline-array pris-mtx)) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) (deftype bone-work (structure) - ((layout bone-layout :inline :offset-assert 0) - (regs bone-regs :inline :offset-assert 32) + ((layout bone-layout :inline) + (regs bone-regs :inline) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) (deftype bone-debug (structure) - ((time-ctr uint32 :offset-assert 0) - (timing uint32 360 :offset-assert 4) + ((time-ctr uint32) + (timing uint32 360) ) - :method-count-assert 9 - :size-assert #x5a4 - :flag-assert #x9000005a4 ) (deftype bone-memory (structure) - ((work bone-work :inline :offset-assert 0) - (buffer bone-buffer 2 :inline :offset-assert 80) + ((work bone-work :inline) + (buffer bone-buffer 2 :inline) ) - :method-count-assert 9 - :size-assert #x2250 - :flag-assert #x900002250 ) (deftype bone-calculation (structure) - ((flags bone-calc-flags :offset-assert 0) - (num-bones uint16 :offset-assert 2) - (matrix-area (inline-array pris-mtx) :offset-assert 4) - (joints (inline-array joint) :offset-assert 8) - (bones (inline-array bone) :offset-assert 12) - (ripple-scale float :offset-assert 16) - (ripple-y-scale float :offset-assert 20) - (ripple-normal-scale float :offset-assert 24) - (ripple-area (inline-array vector) :offset-assert 28) - (ripple-vec vector :inline :offset 16) - (next bone-calculation :offset-assert 32) - (dummy-1 uint32 :offset-assert 36) - (dummy-2 uint32 :offset-assert 40) - (dummy-3 uint32 :offset-assert 44) + ((flags bone-calc-flags) + (num-bones uint16) + (matrix-area (inline-array pris-mtx)) + (joints (inline-array joint)) + (bones (inline-array bone)) + (ripple-scale float) + (ripple-y-scale float) + (ripple-normal-scale float) + (ripple-area (inline-array vector)) + (ripple-vec vector :inline :overlay-at ripple-scale) + (next bone-calculation) + (dummy-1 uint32) + (dummy-2 uint32) + (dummy-3 uint32) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) diff --git a/goal_src/jak2/engine/gfx/foreground/bones.gc b/goal_src/jak2/engine/gfx/foreground/bones.gc index c48b67ba26a..07bbd56cf73 100644 --- a/goal_src/jak2/engine/gfx/foreground/bones.gc +++ b/goal_src/jak2/engine/gfx/foreground/bones.gc @@ -36,12 +36,9 @@ this is done by a linked list of "bone calculations", which is stashed in the dm ;; list node for pending bone calculations. These are terminated by 0's. (deftype bone-calculation-list (structure) - ((first bone-calculation :offset-assert 0) - (next bone-calculation :offset-assert 4) + ((first bone-calculation) + (next bone-calculation) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; head of bone calculation list @@ -243,7 +240,6 @@ this is done by a linked list of "bone calculations", which is stashed in the dm ) ) - (defun-debug dump-qword ((arg0 qword)) (let ((v1-0 arg0)) (format @@ -307,7 +303,3 @@ this is done by a linked list of "bone calculations", which is stashed in the dm 0 (none) ) - - - - diff --git a/goal_src/jak2/engine/gfx/foreground/eye-h.gc b/goal_src/jak2/engine/gfx/foreground/eye-h.gc index f02da921fb2..169245fc066 100644 --- a/goal_src/jak2/engine/gfx/foreground/eye-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/eye-h.gc @@ -11,65 +11,50 @@ ;; DECOMP BEGINS (deftype eye (structure) - ((data vector 2 :inline :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (lid float :offset 8) - (iris-scale float :offset 16) - (pupil-scale float :offset 20) - (lid-scale float :offset 24) + ((data vector 2 :inline) + (x float :overlay-at (-> data 0 data 0)) + (y float :overlay-at (-> data 0 data 1)) + (lid float :overlay-at (-> data 0 data 2)) + (iris-scale float :offset 16) + (pupil-scale float :offset 20) + (lid-scale float :offset 24) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype eye-control (structure) - ((process handle :offset-assert 0) - (draw-flag symbol :offset-assert 8) - (different-eyes symbol :offset-assert 12) - (random-time uint16 :offset-assert 16) - (bucket uint16 :offset-assert 18) - (blink float :offset-assert 20) - (shaders (inline-array adgif-shader) :offset-assert 24) - (left eye :inline :offset-assert 32) - (right eye :inline :offset-assert 64) + ((process handle) + (draw-flag symbol) + (different-eyes symbol) + (random-time uint16) + (bucket uint16) + (blink float) + (shaders (inline-array adgif-shader)) + (left eye :inline) + (right eye :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) (deftype eye-control-array (basic) - ((data eye-control 16 :inline :offset-assert 16) + ((data eye-control 16 :inline) ) - :method-count-assert 9 - :size-assert #x610 - :flag-assert #x900000610 ) (deftype eye-control-arrays (basic) - ((data eye-control-array 6 :inline :offset-assert 16) - (pad uint32 :offset-assert 9328) + ((data eye-control-array 6 :inline) + (pad uint32) ) - :method-count-assert 9 - :size-assert #x2474 - :flag-assert #x900002474 ) (deftype eye-work (structure) - ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) - (sprite-tmpl2 dma-gif-packet :inline :offset-assert 32) - (adgif-tmpl dma-gif-packet :inline :offset-assert 64) - (blink-table float 10 :offset-assert 96) + ((sprite-tmpl dma-gif-packet :inline) + (sprite-tmpl2 dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (blink-table float 10) ) - :method-count-assert 9 - :size-assert #x88 - :flag-assert #x900000088 ) diff --git a/goal_src/jak2/engine/gfx/foreground/foreground-h.gc b/goal_src/jak2/engine/gfx/foreground/foreground-h.gc index 5bb174cde72..224f98e0602 100644 --- a/goal_src/jak2/engine/gfx/foreground/foreground-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/foreground-h.gc @@ -12,94 +12,73 @@ ;; DECOMP BEGINS (deftype mercneric-chain (structure) - ((first uint32 :offset-assert 0) - (next uint32 :offset-assert 4) - (state generic-bucket-state :inline :offset-assert 8) - (vu1-bucket bucket-id :offset-assert 16) + ((first uint32) + (next uint32) + (state generic-bucket-state :inline) + (vu1-bucket bucket-id) ) :pack-me - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype merc-chain (structure) - ((first dma-packet :offset-assert 0) - (patch dma-packet :offset-assert 4) - (vu1-bucket bucket-id :offset-assert 8) + ((first dma-packet) + (patch dma-packet) + (vu1-bucket bucket-id) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype foreground-bucket (structure) - ((merc merc-chain :inline :offset-assert 0) - (emerc merc-chain :inline :offset-assert 12) - (mercneric mercneric-chain :inline :offset-assert 24) + ((merc merc-chain :inline) + (emerc merc-chain :inline) + (mercneric mercneric-chain :inline) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) (deftype foreground-level-buckets (structure) - ((data foreground-bucket 7 :inline :offset-assert 0) + ((data foreground-bucket 7 :inline) ) - :method-count-assert 9 - :size-assert #x150 - :flag-assert #x900000150 ) (deftype foreground-bucket-grid (structure) - ((level-buckets foreground-level-buckets LEVEL_TOTAL :inline :offset-assert 0) - (warp-chain mercneric-chain :inline :offset-assert 2352) + ((level-buckets foreground-level-buckets 7 :inline) + (warp-chain mercneric-chain :inline) ) - :method-count-assert 9 - :size-assert #x944 - :flag-assert #x900000944 ) (deftype foreground-regs (structure) - ((dist float :offset-assert 0) - (merc-used uint32 :offset-assert 4) - (emerc-used uint32 :offset-assert 8) - (mercneric-used uint32 :offset-assert 12) - (use-isometric uint32 :offset-assert 16) - (base-start dma-packet :offset-assert 20) - (joint-ptr (inline-array joint) :offset-assert 24) - (bone-ptr (inline-array bone) :offset-assert 28) - (num-bones uint32 :offset-assert 32) - (mtxs (inline-array pris-mtx) :offset-assert 36) - (dma-buf dma-buffer :offset-assert 40) - (default-texture-index uint32 :offset-assert 44) - (mercneric-chain mercneric-chain :offset-assert 48) - (level-buckets foreground-level-buckets :offset-assert 52) + ((dist float) + (merc-used uint32) + (emerc-used uint32) + (mercneric-used uint32) + (use-isometric uint32) + (base-start dma-packet) + (joint-ptr (inline-array joint)) + (bone-ptr (inline-array bone)) + (num-bones uint32) + (mtxs (inline-array pris-mtx)) + (dma-buf dma-buffer) + (default-texture-index uint32) + (mercneric-chain mercneric-chain) + (level-buckets foreground-level-buckets) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) (deftype foreground-work (structure) - ((regs foreground-regs :inline :offset-assert 0) - (draw-index-map uint8 LEVEL_TOTAL :offset 64) - (grid foreground-bucket-grid :inline :offset-assert 80) - (bounds sphere :inline :offset-assert 2464) - (lights vu-lights :inline :offset-assert 2480) - (distance vector :inline :offset-assert 2592) - (next-tmpl dma-packet :inline :offset-assert 2608) + ((regs foreground-regs :inline) + (draw-index-map uint8 7 :offset 64) + (grid foreground-bucket-grid :inline) + (bounds sphere :inline) + (lights vu-lights :inline) + (distance vector :inline) + (next-tmpl dma-packet :inline) ) - :method-count-assert 9 - :size-assert #xa40 - :flag-assert #x900000a40 ) @@ -115,64 +94,49 @@ ) (deftype texscroll-globals (structure) - ((requests int32 :offset-assert 0) - (effects merc-effect 32 :offset-assert 4) + ((requests int32) + (effects merc-effect 32) ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) (deftype merc-effect-bucket-info (structure) - ((color-fade rgba :offset-assert 0) - (alpha uint8 :offset 3) - (merc-path uint8 :offset-assert 4) - (ignore-alpha uint8 :offset-assert 5) - (disable-draw uint8 :offset-assert 6) - (disable-envmap uint8 :offset-assert 7) + ((color-fade rgba) + (alpha uint8 :offset 3) + (merc-path uint8) + (ignore-alpha uint8) + (disable-draw uint8) + (disable-envmap uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype merc-bucket-info (structure) - ((light vu-lights :inline :offset-assert 0) - (needs-clip int32 :offset-assert 112) - (need-mercprime-if-merc int32 :offset-assert 116) - (must-use-mercneric-for-clip int32 :offset-assert 120) - (effect merc-effect-bucket-info 64 :inline :offset-assert 124) + ((light vu-lights :inline) + (needs-clip int32) + (need-mercprime-if-merc int32) + (must-use-mercneric-for-clip int32) + (effect merc-effect-bucket-info 64 :inline) ) - :method-count-assert 9 - :size-assert #x27c - :flag-assert #x90000027c ) (deftype foreground-globals (structure) - ((foreground-grid foreground-bucket-grid :inline :offset-assert 0) - (merc-bucket-info merc-bucket-info :inline :offset-assert 2384) - (texscroll texscroll-globals :inline :offset-assert 3024) + ((foreground-grid foreground-bucket-grid :inline) + (merc-bucket-info merc-bucket-info :inline) + (texscroll texscroll-globals :inline) ) - :method-count-assert 9 - :size-assert #xc54 - :flag-assert #x900000c54 ) (define *foreground* (new 'global 'foreground-globals)) (deftype shadow-dma-packet (structure) - ((tag generic-merc-tag :inline :offset-assert 0) - (settings shadow-settings :inline :offset-assert 16) - (geo-ref dma-packet :inline :offset-assert 96) - (mtx-ref dma-packet :inline :offset-assert 112) - (end-tag dma-packet :inline :offset-assert 128) + ((tag generic-merc-tag :inline) + (settings shadow-settings :inline) + (geo-ref dma-packet :inline) + (mtx-ref dma-packet :inline) + (end-tag dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) diff --git a/goal_src/jak2/engine/gfx/foreground/lightning-h.gc b/goal_src/jak2/engine/gfx/foreground/lightning-h.gc index 5c35d2c90a4..268e0728ffa 100644 --- a/goal_src/jak2/engine/gfx/foreground/lightning-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/lightning-h.gc @@ -38,31 +38,28 @@ ;; DECOMP BEGINS (deftype lightning-spec (basic) - ((name string :offset-assert 4) - (flags lightning-spec-flags :offset-assert 8) - (rand-func uint8 :offset-assert 10) - (adjust-distance uint8 :offset-assert 11) - (start-color rgba :offset-assert 12) - (end-color rgba :offset-assert 16) - (fade-to-color rgba :offset-assert 20) - (fade-start-factor float :offset-assert 24) - (fade-time float :offset-assert 28) - (texture texture-id :offset-assert 32) - (reduction float :offset-assert 36) - (num-points int32 :offset-assert 40) - (box-size float :offset-assert 44) - (merge-factor float :offset-assert 48) - (merge-count int32 :offset-assert 52) - (radius float :offset-assert 56) - (duration float :offset-assert 60) - (duration-rand float :offset-assert 64) - (sound basic :offset-assert 68) - (delay float :offset-assert 72) - (delay-rand float :offset-assert 76) + ((name string) + (flags lightning-spec-flags) + (rand-func uint8) + (adjust-distance uint8) + (start-color rgba) + (end-color rgba) + (fade-to-color rgba) + (fade-start-factor float) + (fade-time float) + (texture texture-id) + (reduction float) + (num-points int32) + (box-size float) + (merge-factor float) + (merge-count int32) + (radius float) + (duration float) + (duration-rand float) + (sound basic) + (delay float) + (delay-rand float) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) @@ -82,43 +79,37 @@ ) (deftype lightning-state (structure) - ((mode lightning-mode :offset-assert 0) - (counter float :offset-assert 4) - (points-to-draw int32 :offset-assert 8) - (box-size float :offset-assert 12) - (gcf-control gcf-control :inline :offset-assert 16) - (line vector-array :offset-assert 128) - (meet vector-array :offset-assert 132) - (path vector-array :offset-assert 136) - (start-color rgba :offset-assert 140) - (end-color rgba :offset-assert 144) + ((mode lightning-mode) + (counter float) + (points-to-draw int32) + (box-size float) + (gcf-control gcf-control :inline) + (line vector-array) + (meet vector-array) + (path vector-array) + (start-color rgba) + (end-color rgba) ) - :method-count-assert 9 - :size-assert #x94 - :flag-assert #x900000094 ) (deftype lightning-control (basic) - ((spec lightning-spec :offset-assert 4) - (process (pointer process) :offset-assert 8) - (state lightning-state :inline :offset-assert 16) + ((spec lightning-spec) + (process (pointer process)) + (state lightning-state :inline) ) - :method-count-assert 14 - :size-assert #xa4 - :flag-assert #xe000000a4 (:methods - (new (symbol type lightning-spec process float) _type_ 0) - (change-mode (_type_ lightning-mode) lightning-mode 9) - (get-mode (_type_) lightning-mode 10) - (set-point! (_type_ int vector) none 11) - (set-first-meet-point (_type_ vector) none 12) - (set-last-meet-point (_type_ vector) none 13) + (new (symbol type lightning-spec process float) _type_) + (change-mode (_type_ lightning-mode) lightning-mode) + (get-mode (_type_) lightning-mode) + (set-point! (_type_ int vector) none) + (set-first-meet-point (_type_ vector) none) + (set-last-meet-point (_type_ vector) none) ) ) -(defmethod change-mode lightning-control ((this lightning-control) (arg0 lightning-mode)) +(defmethod change-mode ((this lightning-control) (arg0 lightning-mode)) (let ((v1-1 (!= arg0 (-> this state mode)))) (case arg0 (((lightning-mode lm3)) @@ -136,11 +127,11 @@ arg0 ) -(defmethod get-mode lightning-control ((this lightning-control)) +(defmethod get-mode ((this lightning-control)) (-> this state mode) ) -(defmethod set-point! lightning-control ((this lightning-control) (arg0 int) (arg1 vector)) +(defmethod set-point! ((this lightning-control) (arg0 int) (arg1 vector)) (let ((v1-0 (-> this state))) (when (and (-> v1-0 path) (>= arg0 0) (< arg0 (-> v1-0 path length))) (set! (-> v1-0 path data arg0 quad) (-> arg1 quad)) @@ -163,18 +154,18 @@ ) ;; WARN: Return type mismatch (inline-array vector) vs none. -(defmethod set-first-meet-point lightning-control ((this lightning-control) (arg0 vector)) +(defmethod set-first-meet-point ((this lightning-control) (arg0 vector)) (set! (-> this state meet data 0 quad) (-> arg0 quad)) (none) ) ;; WARN: Return type mismatch vector vs none. -(defmethod set-last-meet-point lightning-control ((this lightning-control) (arg0 vector)) +(defmethod set-last-meet-point ((this lightning-control) (arg0 vector)) (set! (-> this state meet data (+ (-> this state points-to-draw) -1) quad) (-> arg0 quad)) (none) ) -(defmethod relocate lightning-control ((this lightning-control) (arg0 int)) +(defmethod relocate ((this lightning-control) (arg0 int)) (&+! (-> this state line) arg0) (&+! (-> this state meet) arg0) (if (-> this state path) @@ -234,17 +225,14 @@ ) (deftype lightning-probe-vars (basic) - ((src-joint-index uint32 :offset-assert 4) - (next-spawn-time time-frame :offset-assert 8) - (last-valid-time time-frame :offset-assert 16) - (point vector 2 :inline :offset-assert 32) - (start-pos vector :inline :offset 32) - (end-pos vector :inline :offset 48) - (probe-dirs (inline-array vector) :offset-assert 64) + ((src-joint-index uint32) + (next-spawn-time time-frame) + (last-valid-time time-frame) + (point vector 2 :inline) + (start-pos vector :inline :overlay-at (-> point 0)) + (end-pos vector :inline :overlay-at (-> point 1)) + (probe-dirs (inline-array vector)) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) diff --git a/goal_src/jak2/engine/gfx/foreground/lightning.gc b/goal_src/jak2/engine/gfx/foreground/lightning.gc index 23e46bf4471..a62d2db9a10 100644 --- a/goal_src/jak2/engine/gfx/foreground/lightning.gc +++ b/goal_src/jak2/engine/gfx/foreground/lightning.gc @@ -254,12 +254,9 @@ ) (deftype lightning-globals (structure) - ((gcf-buf uint16 :offset-assert 0) - (vtx-buf uint16 :offset-assert 2) + ((gcf-buf uint16) + (vtx-buf uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) diff --git a/goal_src/jak2/engine/gfx/foreground/lights-h.gc b/goal_src/jak2/engine/gfx/foreground/lights-h.gc index 39607cdf744..c279230a68c 100644 --- a/goal_src/jak2/engine/gfx/foreground/lights-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/lights-h.gc @@ -23,94 +23,76 @@ ;; Note that the data is transposed to be faster for use in the VU code. ;; the w components are unused for lighting information - you can put whatever you want in them... (deftype vu-lights (structure) - ((direction vector 3 :inline :offset-assert 0) - (color vector 3 :inline :offset-assert 48) - (ambient vector :inline :offset-assert 96) - (fade-int uint32 :offset 44) - (fade-flags uint32 :offset 28) + ((direction vector 3 :inline) + (color vector 3 :inline) + (ambient vector :inline) + (fade-int uint32 :offset 44) + (fade-flags uint32 :offset 28) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) -;; a single directional light. + (deftype light (structure) - ((direction vector :inline :offset-assert 0) - (color rgbaf :inline :offset-assert 16) - (extra vector :inline :offset-assert 32) - (level float :offset 32) - (luminance float :offset 40) - (priority float :offset 44) - (bytes uint8 4 :offset 36) - (mask uint16 :offset 36) - (palette-index int8 :offset 39) + ((direction vector :inline) + (color rgbaf :inline) + (extra vector :inline) + (level float :overlay-at (-> extra data 0)) + (luminance float :overlay-at (-> extra data 2)) + (priority float :overlay-at (-> extra data 3)) + (bytes uint8 4 :overlay-at (-> extra data 1)) + (mask uint16 :overlay-at (-> extra data 1)) + (palette-index int8 :overlay-at (-> bytes 3)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; new jak 2 light, is applied to stuff in the sphere. (deftype light-sphere (structure) - ((name string :offset-assert 0) - (bsphere vector :inline :offset-assert 16) - (direction vector :inline :offset-assert 32) - (color vector :inline :offset-assert 48) - (decay-start float :offset 4) - (ambient-point-ratio float :offset 8) - (brightness float :offset 12) - (bytes uint8 4 :offset 60) - (mask uint16 :offset 60) - (palette-index int8 :offset 63) + ((name string) + (bsphere vector :inline) + (direction vector :inline) + (color vector :inline) + (decay-start float :offset 4) + (ambient-point-ratio float :offset 8) + (brightness float :offset 12) + (bytes uint8 4 :overlay-at (-> color data 3)) + (mask uint16 :overlay-at (-> color data 3)) + (palette-index int8 :overlay-at (-> bytes 3)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; hash bucket for fast "which light am I in?" checks. (deftype light-hash-bucket (structure) - ((index uint16 :offset-assert 0) - (count uint16 :offset-assert 2) + ((index uint16) + (count uint16) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype light-hash (basic) - ((num-lights uint16 :offset-assert 4) - (num-indices uint16 :offset-assert 6) - (num-buckets uint16 :offset-assert 8) - (bucket-step uint8 2 :offset-assert 10) - (base-trans vector :inline :offset-assert 16) - (axis-scale vector :inline :offset-assert 32) - (dimension-array vector4w :inline :offset-assert 48) - (bucket-array (inline-array light-hash-bucket) :offset-assert 64) - (index-array pointer :offset-assert 68) - (light-sphere-array (inline-array light-sphere) :offset-assert 72) + ((num-lights uint16) + (num-indices uint16) + (num-buckets uint16) + (bucket-step uint8 2) + (base-trans vector :inline) + (axis-scale vector :inline) + (dimension-array vector4w :inline) + (bucket-array (inline-array light-hash-bucket)) + (index-array pointer) + (light-sphere-array (inline-array light-sphere)) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) (deftype light-hash-work (structure) - ((ones vector4w :inline :offset-assert 0) + ((ones vector4w :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (define *light-hash* (the-as light-hash #f)) -(defmethod print light ((this light)) +(defmethod print ((this light)) (format #t "# quad 0)) + (tag uint64 :overlay-at (-> quad 0)) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) (deftype generic-merc-tag (dma-packet) - ((next-ptr uint32 :offset 12) - (size uint32 :offset 8) + ((next-ptr uint32 :overlay-at vif1) + (size uint32 :overlay-at vif0) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype generic-merc-ctrl (structure) - ((tag generic-merc-tag :inline :offset-assert 0) - (lights vu-lights :inline :offset-assert 16) - (header merc-ctrl-header :inline :offset-assert 128) - (effect merc-effect :inline :offset-assert 256) + ((tag generic-merc-tag :inline) + (lights vu-lights :inline) + (header merc-ctrl-header :inline) + (effect merc-effect :inline) ) - :method-count-assert 9 - :size-assert #x120 - :flag-assert #x900000120 ) (deftype generic-merc-ctrl-with-sfx (generic-merc-ctrl) - ((sfx-data uint128 11 :offset-assert 288) + ((sfx-data uint128 11) ) - :method-count-assert 9 - :size-assert #x1d0 - :flag-assert #x9000001d0 ) (deftype generic-merc-input (structure) - ((geo-tag generic-merc-tag :inline :offset-assert 0) - (geo-block uint8 1296 :offset-assert 16) - (byte-header merc-byte-header :inline :offset 16) - (matrix merc-matrix 9 :inline :offset-assert 1312) - (control generic-merc-ctrl-with-sfx :inline :offset-assert 2464) - (end-tag generic-merc-tag :inline :offset-assert 2928) - (shader adgif-shader :inline :offset-assert 2944) + ((geo-tag generic-merc-tag :inline) + (geo-block uint8 1296) + (byte-header merc-byte-header :inline :overlay-at (-> geo-block 0)) + (matrix merc-matrix 9 :inline) + (control generic-merc-ctrl-with-sfx :inline) + (end-tag generic-merc-tag :inline) + (shader adgif-shader :inline) ) - :method-count-assert 9 - :size-assert #xbd0 - :flag-assert #x900000bd0 ) (deftype generic-merc-output (structure) - ((info gsf-info :inline :offset-assert 0) - (header gsf-header :inline :offset-assert 16) - (index-kick-table uint16 80 :offset-assert 32) - (index-table uint8 160 :offset 32) - (inverse-table uint8 256 :offset-assert 192) - (vertex-table gsf-vertex 72 :inline :offset-assert 448) + ((info gsf-info :inline) + (header gsf-header :inline) + (index-kick-table uint16 80) + (index-table uint8 160 :overlay-at (-> index-kick-table 0)) + (inverse-table uint8 256) + (vertex-table gsf-vertex 72 :inline) ) - :method-count-assert 9 - :size-assert #xac0 - :flag-assert #x900000ac0 ) (deftype generic-merc-dcache (structure) - ((output-a generic-merc-output :inline :offset-assert 0) - (output-b generic-merc-output :inline :offset-assert 2752) - (inv-table-1 uint8 544 :offset-assert 5504) - (inv-table-7 uint8 544 :offset-assert 6048) - (inv-safety uint8 16 :offset-assert 6592) - (effect-data uint8 1584 :offset-assert 6608) + ((output-a generic-merc-output :inline) + (output-b generic-merc-output :inline) + (inv-table-1 uint8 544) + (inv-table-7 uint8 544) + (inv-safety uint8 16) + (effect-data uint8 1584) ) - :method-count-assert 9 - :size-assert #x2000 - :flag-assert #x900002000 ) (deftype gm-shadow (structure) - ((perspective matrix :inline :offset-assert 0) - (isometric matrix :inline :offset-assert 64) - (inv-camera-rot matrix :inline :offset-assert 128) - (envmap-shader adgif-shader :inline :offset-assert 192) - (current-chain uint32 :offset-assert 272) - (next-chain uint32 :offset-assert 276) - (buf-index uint32 :offset-assert 280) - (fragment-count uint32 :offset-assert 284) - (write-limit int32 :offset-assert 288) - (indexed-input-base generic-merc-input :offset-assert 292) - (other-input-base generic-merc-input :offset-assert 296) - (indexed-output-base generic-merc-output :offset-assert 300) - (other-output-base generic-merc-output :offset-assert 304) - (p-input uint32 :offset-assert 308) - (gsf-buf generic-merc-dcache :offset-assert 312) - (p-fheader merc-fp-header :offset-assert 316) - (curr-chain basic :offset-assert 320) - (mercneric-convert basic :offset-assert 324) - (generic-prepare-dma-single basic :offset-assert 328) - (generic-prepare-dma-double basic :offset-assert 332) - (generic-light-proc basic :offset-assert 336) - (generic-envmap-proc basic :offset-assert 340) - (high-speed-reject basic :offset-assert 344) - (dummy-0 uint32 :offset-assert 348) - (hsr-xmult vector :inline :offset-assert 352) - (hsr-ymult vector :inline :offset-assert 368) - (warp-consts vector :inline :offset-assert 384) + ((perspective matrix :inline) + (isometric matrix :inline) + (inv-camera-rot matrix :inline) + (envmap-shader adgif-shader :inline) + (current-chain uint32) + (next-chain uint32) + (buf-index uint32) + (fragment-count uint32) + (write-limit int32) + (indexed-input-base generic-merc-input) + (other-input-base generic-merc-input) + (indexed-output-base generic-merc-output) + (other-output-base generic-merc-output) + (p-input uint32) + (gsf-buf generic-merc-dcache) + (p-fheader merc-fp-header) + (curr-chain basic) + (mercneric-convert basic) + (generic-prepare-dma-single basic) + (generic-prepare-dma-double basic) + (generic-light-proc basic) + (generic-envmap-proc basic) + (high-speed-reject basic) + (dummy-0 uint32) + (hsr-xmult vector :inline) + (hsr-ymult vector :inline) + (warp-consts vector :inline) ) - :method-count-assert 9 - :size-assert #x190 - :flag-assert #x900000190 ) (deftype generic-merc-work (structure) - ((input-a generic-merc-input :inline :offset-assert 0) - (input-b generic-merc-input :inline :offset-assert 3024) - (ctrl generic-merc-ctrl-with-sfx :inline :offset-assert 6048) - (shadow gm-shadow :inline :offset-assert 6512) - (stack uint128 16 :offset-assert 6912) + ((input-a generic-merc-input :inline) + (input-b generic-merc-input :inline) + (ctrl generic-merc-ctrl-with-sfx :inline) + (shadow gm-shadow :inline) + (stack uint128 16) ) - :method-count-assert 9 - :size-assert #x1c00 - :flag-assert #x900001c00 ) diff --git a/goal_src/jak2/engine/gfx/foreground/merc/merc-death.gc b/goal_src/jak2/engine/gfx/foreground/merc/merc-death.gc index 4e4e6afc51c..56cf46280b7 100644 --- a/goal_src/jak2/engine/gfx/foreground/merc/merc-death.gc +++ b/goal_src/jak2/engine/gfx/foreground/merc/merc-death.gc @@ -10,15 +10,12 @@ (define *merc-death-globals* (new 'global 'vector)) (deftype death-info (basic) - ((vertex-skip uint16 :offset-assert 4) - (timer uint8 :offset-assert 6) - (overlap uint8 :offset-assert 7) - (effect uint32 :offset-assert 8) - (sound symbol :offset-assert 12) + ((vertex-skip uint16) + (timer uint8) + (overlap uint8) + (effect uint32) + (sound symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) diff --git a/goal_src/jak2/engine/gfx/foreground/merc/merc-h.gc b/goal_src/jak2/engine/gfx/foreground/merc/merc-h.gc index dd1f8c2ab9a..2dc0f2558e2 100644 --- a/goal_src/jak2/engine/gfx/foreground/merc/merc-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/merc/merc-h.gc @@ -28,87 +28,72 @@ ;; DECOMP BEGINS (deftype ripple-merc-query (inline-array-class) - ((start-vertex int32 :offset-assert 16) - (vertex-skip int32 :offset-assert 20) - (vertex-count int32 :offset-assert 24) - (current-loc int32 :offset-assert 28) - (data vector :inline :dynamic :offset-assert 32) + ((start-vertex int32) + (vertex-skip int32) + (vertex-count int32) + (current-loc int32) + (data vector :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (set! (-> ripple-merc-query heap-base) (the-as uint 16)) (deftype merc-byte-header (structure) - ((srcdest-off uint8 :offset-assert 0) - (rgba-off uint8 :offset-assert 1) - (lump-off uint8 :offset-assert 2) - (fp-off uint8 :offset-assert 3) - (mat1-cnt uint8 :offset-assert 4) - (mat2-cnt uint8 :offset-assert 5) - (mat3-cnt uint8 :offset-assert 6) - (samecopy-cnt uint8 :offset-assert 7) - (crosscopy-cnt uint8 :offset-assert 8) - (strip-len uint8 :offset-assert 9) - (mm-quadword-fp-off uint8 :offset-assert 10) - (mm-quadword-size uint8 :offset-assert 11) - (perc-off uint8 :offset-assert 12) - (mat-slot uint8 10 :offset-assert 13) + ((srcdest-off uint8) + (rgba-off uint8) + (lump-off uint8) + (fp-off uint8) + (mat1-cnt uint8) + (mat2-cnt uint8) + (mat3-cnt uint8) + (samecopy-cnt uint8) + (crosscopy-cnt uint8) + (strip-len uint8) + (mm-quadword-fp-off uint8) + (mm-quadword-size uint8) + (perc-off uint8) + (mat-slot uint8 10) ) - :method-count-assert 9 - :size-assert #x17 - :flag-assert #x900000017 ) (deftype merc-fragment (structure) - ((header merc-byte-header :inline :offset-assert 0) - (rest uint8 1 :offset-assert 23) + ((header merc-byte-header :inline) + (rest uint8 1) ) - :method-count-assert 10 - :size-assert #x18 - :flag-assert #xa00000018 (:methods - (login-adgifs (_type_) merc-fragment 9) + (login-adgifs (_type_) merc-fragment) ) ) (deftype merc-vtx (structure) - ((mat-0 uint8 :offset-assert 0) - (mat-1 uint8 :offset-assert 1) - (nrm-x uint8 :offset-assert 2) - (pos-x uint8 :offset-assert 3) - (dst-0 uint8 :offset-assert 4) - (dst-1 uint8 :offset-assert 5) - (nrm-y uint8 :offset-assert 6) - (pos-y uint8 :offset-assert 7) - (tex-s uint8 :offset-assert 8) - (tex-t uint8 :offset-assert 9) - (nrm-z uint8 :offset-assert 10) - (pos-z uint8 :offset-assert 11) + ((mat-0 uint8) + (mat-1 uint8) + (nrm-x uint8) + (pos-x uint8) + (dst-0 uint8) + (dst-1 uint8) + (nrm-y uint8) + (pos-y uint8) + (tex-s uint8) + (tex-t uint8) + (nrm-z uint8) + (pos-z uint8) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype merc-fp-header (structure) - ((x-add float :offset-assert 0) - (y-add float :offset-assert 4) - (z-add float :offset-assert 8) - (shader-cnt uint8 :offset-assert 12) - (kick-info-offset uint8 :offset-assert 13) - (kick-info-step uint8 :offset-assert 14) - (hword-cnt uint8 :offset-assert 15) + ((x-add float) + (y-add float) + (z-add float) + (shader-cnt uint8) + (kick-info-offset uint8) + (kick-info-step uint8) + (hword-cnt uint8) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -118,318 +103,258 @@ ) (deftype merc-mat-dest (structure) - ((matrix-number uint8 :offset-assert 0) - (matrix-dest uint8 :offset-assert 1) + ((matrix-number uint8) + (matrix-dest uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) (deftype merc-fragment-control (structure) - ((unsigned-four-count uint8 :offset-assert 0) - (lump-four-count uint8 :offset-assert 1) - (fp-qwc uint8 :offset-assert 2) - (mat-xfer-count uint8 :offset-assert 3) - (mat-dest-data merc-mat-dest :inline :dynamic :offset-assert 4) + ((unsigned-four-count uint8) + (lump-four-count uint8) + (fp-qwc uint8) + (mat-xfer-count uint8) + (mat-dest-data merc-mat-dest :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype merc-blend-data (structure) - ((int8-data int8 :dynamic :offset-assert 0) + ((int8-data int8 :dynamic) ) - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) (deftype merc-blend-ctrl (structure) - ((blend-vtx-count uint8 :offset-assert 0) - (nonzero-index-count uint8 :offset-assert 1) - (bt-index uint8 :dynamic :offset-assert 2) + ((blend-vtx-count uint8) + (nonzero-index-count uint8) + (bt-index uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) (deftype mei-envmap-tint (structure) - ((fade0 float :offset-assert 0) - (fade1 float :offset-assert 4) - (tint rgba :offset-assert 8) - (dummy int32 :offset-assert 12) + ((fade0 float) + (fade1 float) + (tint rgba) + (dummy int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype mei-texture-scroll (structure) - ((max-dist float :offset-assert 0) - (st-int-scale uint8 :offset-assert 4) - (time-factor uint8 :offset-assert 5) - (scroll-dir uint8 :offset-assert 6) - (cached-time uint8 :offset-assert 7) - (time-delta uint8 :offset-assert 8) - (dummy uint8 7 :offset-assert 9) + ((max-dist float) + (st-int-scale uint8) + (time-factor uint8) + (scroll-dir uint8) + (cached-time uint8) + (time-delta uint8) + (dummy uint8 7) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype mei-ripple (structure) - ((x-base float :offset-assert 0) - (z-base float :offset-assert 4) - (grid-size float :offset-assert 8) - (angle float :offset-assert 12) + ((x-base float) + (z-base float) + (grid-size float) + (angle float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype merc-extra-info (structure) - ((envmap-tint-offset uint8 :offset-assert 0) - (shader-offset uint8 :offset-assert 1) - (texture-scroll-offset uint8 :offset-assert 2) - (ripple-offset uint8 :offset-assert 3) - (dummy uint8 12 :offset-assert 4) + ((envmap-tint-offset uint8) + (shader-offset uint8) + (texture-scroll-offset uint8) + (ripple-offset uint8) + (dummy uint8 12) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype merc-effect (structure) - ((frag-geo merc-fragment :offset-assert 0) - (frag-ctrl merc-fragment-control :offset-assert 4) - (blend-data merc-blend-data :offset-assert 8) - (blend-ctrl merc-blend-ctrl :offset-assert 12) - (merc-effect-version uint8 :offset-assert 16) - (effect-bits effect-bits :offset-assert 17) - (frag-count uint16 :offset-assert 18) - (blend-frag-count uint16 :offset-assert 20) - (tri-count uint16 :offset-assert 22) - (dvert-count uint16 :offset-assert 24) - (texture-index uint8 :offset-assert 26) - (effect-usage uint8 :offset-assert 27) - (extra-info merc-extra-info :offset-assert 28) + ((frag-geo merc-fragment) + (frag-ctrl merc-fragment-control) + (blend-data merc-blend-data) + (blend-ctrl merc-blend-ctrl) + (merc-effect-version uint8) + (effect-bits effect-bits) + (frag-count uint16) + (blend-frag-count uint16) + (tri-count uint16) + (dvert-count uint16) + (texture-index uint8) + (effect-usage uint8) + (extra-info merc-extra-info) ) - :method-count-assert 10 - :size-assert #x20 - :flag-assert #xa00000020 (:methods - (login-adgifs (_type_) none 9) + (login-adgifs (_type_) none) ) ) (deftype merc-eye-ctrl (structure) - ((eye-slot int8 :offset-assert 0) - (shader-offset int8 :offset-assert 1) - (shader-count int8 :offset-assert 2) - (shader adgif-shader 6 :inline :offset-assert 16) - (left-iris-shader adgif-shader :inline :offset 16) - (left-pupil-shader adgif-shader :inline :offset 96) - (left-lid-shader adgif-shader :inline :offset 176) - (right-iris-shader adgif-shader :inline :offset 256) - (right-pupil-shader adgif-shader :inline :offset 336) - (right-lid-shader adgif-shader :inline :offset 416) + ((eye-slot int8) + (shader-offset int8) + (shader-count int8) + (shader adgif-shader 6 :inline) + (left-iris-shader adgif-shader :inline :overlay-at (-> shader 0)) + (left-pupil-shader adgif-shader :inline :overlay-at (-> shader 1)) + (left-lid-shader adgif-shader :inline :overlay-at (-> shader 2)) + (right-iris-shader adgif-shader :inline :overlay-at (-> shader 3)) + (right-pupil-shader adgif-shader :inline :overlay-at (-> shader 4)) + (right-lid-shader adgif-shader :inline :overlay-at (-> shader 5)) ) - :method-count-assert 9 - :size-assert #x1f0 - :flag-assert #x9000001f0 ) (deftype merc-eye-anim-frame (structure) - ((pupil-trans-x int8 :offset-assert 0) - (pupil-trans-y int8 :offset-assert 1) - (blink int8 :offset-assert 2) - (iris-scale int8 :offset 4) - (pupil-scale int8 :offset 5) - (lid-scale int8 :offset 6) - (dword uint64 :offset 0) + ((pupil-trans-x int8) + (pupil-trans-y int8) + (blink int8) + (iris-scale int8 :offset 4) + (pupil-scale int8 :offset 5) + (lid-scale int8 :offset 6) + (dword uint64 :overlay-at pupil-trans-x) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype merc-eye-anim-block (structure) - ((max-frame int16 :offset-assert 0) - (data merc-eye-anim-frame :inline :dynamic :offset-assert 8) + ((max-frame int16) + (data merc-eye-anim-frame :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype texture-usage-group (structure) - ((data texture-masks 7 :inline :offset-assert 0) + ((data texture-masks 7 :inline) ) - :method-count-assert 9 - :size-assert #x150 - :flag-assert #x900000150 ) (deftype merc-ctrl-header (structure) - ((xyz-scale float :offset-assert 0) - (st-magic uint32 :offset-assert 4) - (st-out-a uint32 :offset-assert 8) - (st-out-b uint32 :offset-assert 12) - (st-vif-add uint32 :offset-assert 16) - (st-int-off uint16 :offset-assert 20) - (st-int-scale uint16 :offset-assert 22) - (effect-count uint32 :offset-assert 24) - (blend-target-count uint32 :offset-assert 28) - (fragment-count uint16 :offset-assert 32) - (tri-count uint16 :offset-assert 34) - (matrix-count uint8 :offset-assert 36) - (shader-count uint8 :offset-assert 37) - (transform-vertex-count uint16 :offset-assert 38) - (dvert-count uint16 :offset-assert 40) - (one-mat-count uint16 :offset-assert 42) - (two-mat-count uint16 :offset-assert 44) - (two-mat-reuse-count uint16 :offset-assert 46) - (three-mat-count uint16 :offset-assert 48) - (three-mat-reuse-count uint16 :offset-assert 50) - (shader-upload-count uint8 :offset-assert 52) - (matrix-upload-count uint8 :offset-assert 53) - (same-copy-count uint16 :offset-assert 54) - (cross-copy-count uint16 :offset-assert 56) - (num-verts uint16 :offset-assert 58) - (longest-edge float :offset-assert 60) - (eye-ctrl merc-eye-ctrl :offset-assert 64) - (pad uint32 3 :offset-assert 68) - (masks-padding texture-masks :inline :offset-assert 80) - (texture-usage-group texture-usage-group :offset 80) - (dummy-bytes uint8 :dynamic :offset 32) - (envmap-tint uint32 :offset 32) - (query basic :offset 36) - (needs-clip uint8 :offset 40) - (use-isometric uint8 :offset 41) - (use-attached-shader uint8 :offset 42) - (display-triangles uint8 :offset 43) - (death-vertex-skip uint16 :offset 44) - (death-start-vertex uint16 :offset 46) - (death-effect uint32 :offset 48) - (use-translucent uint8 :offset 52) - (display-this-fragment uint8 :offset 53) - (use-warp uint8 :offset 54) - (ignore-alpha uint8 :offset 55) - (force-fade uint8 :offset 56) - (disable-fog uint8 :offset 57) - (disable-envmap uint8 :offset 58) + ((xyz-scale float) + (st-magic uint32) + (st-out-a uint32) + (st-out-b uint32) + (st-vif-add uint32) + (st-int-off uint16) + (st-int-scale uint16) + (effect-count uint32) + (blend-target-count uint32) + (fragment-count uint16) + (tri-count uint16) + (matrix-count uint8) + (shader-count uint8) + (transform-vertex-count uint16) + (dvert-count uint16) + (one-mat-count uint16) + (two-mat-count uint16) + (two-mat-reuse-count uint16) + (three-mat-count uint16) + (three-mat-reuse-count uint16) + (shader-upload-count uint8) + (matrix-upload-count uint8) + (same-copy-count uint16) + (cross-copy-count uint16) + (num-verts uint16) + (longest-edge float) + (eye-ctrl merc-eye-ctrl) + (pad uint32 3) + (masks-padding texture-masks :inline) + (texture-usage-group texture-usage-group :overlay-at (-> masks-padding data 0 mask data 0)) + (dummy-bytes uint8 :dynamic :overlay-at fragment-count) + (envmap-tint uint32 :overlay-at fragment-count) + (query basic :overlay-at matrix-count) + (needs-clip uint8 :overlay-at dvert-count) + (use-isometric uint8 :offset 41) + (use-attached-shader uint8 :overlay-at one-mat-count) + (display-triangles uint8 :offset 43) + (death-vertex-skip uint16 :overlay-at two-mat-count) + (death-start-vertex uint16 :overlay-at two-mat-reuse-count) + (death-effect uint32 :overlay-at three-mat-count) + (use-translucent uint8 :overlay-at shader-upload-count) + (display-this-fragment uint8 :overlay-at matrix-upload-count) + (use-warp uint8 :overlay-at same-copy-count) + (ignore-alpha uint8 :offset 55) + (force-fade uint8 :overlay-at cross-copy-count) + (disable-fog uint8 :offset 57) + (disable-envmap uint8 :overlay-at num-verts) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) (deftype merc-ctrl (art-element) - ((num-joints int32 :offset 20) - (seg-table (array uint64) :offset 24) - (header merc-ctrl-header :inline :offset-assert 32) - (effect merc-effect :inline :dynamic :offset-assert 160) + ((num-joints int32 :overlay-at (-> pad 0)) + (seg-table (array uint64) :overlay-at (-> pad 4)) + (header merc-ctrl-header :inline) + (effect merc-effect :inline :dynamic) ) - :method-count-assert 13 - :size-assert #xa0 - :flag-assert #xd000000a0 ) (deftype merc-vu1-low-mem (structure) - ((tri-strip-gif gs-gif-tag :inline :offset-assert 0) - (ad-gif gs-gif-tag :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (perspective uint128 4 :offset-assert 48) - (fog vector :inline :offset-assert 112) + ((tri-strip-gif gs-gif-tag :inline) + (ad-gif gs-gif-tag :inline) + (hvdf-offset vector :inline) + (perspective uint128 4) + (fog vector :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) (deftype emerc-vu1-low-mem (structure) - ((tri-strip-gif gs-gif-tag :inline :offset-assert 0) - (ad-gif gs-gif-tag :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (perspective vector 4 :inline :offset-assert 48) - (fog vector :inline :offset-assert 112) - (unperspect vector :inline :offset-assert 128) + ((tri-strip-gif gs-gif-tag :inline) + (ad-gif gs-gif-tag :inline) + (hvdf-offset vector :inline) + (perspective vector 4 :inline) + (fog vector :inline) + (unperspect vector :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) (deftype ripple-wave (structure) - ((scale float :offset-assert 0) - (offs float :offset-assert 4) - (xdiv int16 :offset-assert 8) - (zdiv int16 :offset-assert 10) - (speed float :offset-assert 12) - (xmul float :offset-assert 16) - (zmul float :offset-assert 20) - (delta float :offset-assert 24) + ((scale float) + (offs float) + (xdiv int16) + (zdiv int16) + (speed float) + (xmul float) + (zmul float) + (delta float) ) :pack-me - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype ripple-wave-set (basic) - ((count int32 :offset-assert 4) - (converted basic :offset-assert 8) - (normal-scale float :offset-assert 12) - (wave ripple-wave 4 :inline :offset-assert 16) - (frame-save uint64 :offset-assert 128) + ((count int32) + (converted basic) + (normal-scale float) + (wave ripple-wave 4 :inline) + (frame-save uint64) ) - :method-count-assert 9 - :size-assert #x88 - :flag-assert #x900000088 ) (deftype ripple-control (basic) - ((global-scale float :offset-assert 4) - (last-frame-scale float :offset-assert 8) - (close-fade-dist float :offset-assert 12) - (far-fade-dist float :offset-assert 16) - (faded-scale float :offset-assert 20) - (individual-normal-scale float :offset-assert 24) - (waveform ripple-wave-set :offset-assert 28) - (send-query symbol :offset-assert 32) - (query ripple-merc-query :offset-assert 36) + ((global-scale float) + (last-frame-scale float) + (close-fade-dist float) + (far-fade-dist float) + (faded-scale float) + (individual-normal-scale float) + (waveform ripple-wave-set) + (send-query symbol) + (query ripple-merc-query) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) diff --git a/goal_src/jak2/engine/gfx/foreground/merc/merc.gc b/goal_src/jak2/engine/gfx/foreground/merc/merc.gc index f6b0f6e0c74..8a2a7624ade 100644 --- a/goal_src/jak2/engine/gfx/foreground/merc/merc.gc +++ b/goal_src/jak2/engine/gfx/foreground/merc/merc.gc @@ -10,21 +10,18 @@ ;; DECOMP BEGINS (deftype texture-login-data (structure) - ((default-texture-index int32 :offset-assert 0) - (current-texture-index int32 :offset-assert 4) - (texture-usage-group texture-usage-group :offset-assert 8) - (merc-ctrl-header merc-ctrl-header :offset-assert 12) - (name basic :offset-assert 16) + ((default-texture-index int32) + (current-texture-index int32) + (texture-usage-group texture-usage-group) + (merc-ctrl-header merc-ctrl-header) + (name basic) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (define *texture-login-data* (new 'global 'texture-login-data)) -(defmethod login art-joint-geo ((this art-joint-geo)) +(defmethod login ((this art-joint-geo)) (let ((s5-0 *texture-login-data*)) (set! (-> s5-0 default-texture-index) (res-lump-value (-> this extra) 'texture-bucket int :default (the-as uint128 1) :time -1000000000.0) @@ -84,11 +81,12 @@ #f ) -(defmethod asize-of merc-fragment ((this merc-fragment)) +;; WARN: Return type mismatch uint vs int. +(defmethod asize-of ((this merc-fragment)) (the-as int (* (-> this header mm-quadword-size) 16)) ) -(defmethod login-adgifs merc-fragment ((this merc-fragment)) +(defmethod login-adgifs ((this merc-fragment)) (let* ((s5-0 (merc-fragment-fp-data this)) (v1-1 (-> *texture-login-data* merc-ctrl-header)) (s4-0 (if (nonzero? (-> v1-1 eye-ctrl)) @@ -190,11 +188,14 @@ this ) -(defmethod asize-of merc-fragment-control ((this merc-fragment-control)) +;; WARN: Return type mismatch uint vs int. +(defmethod asize-of ((this merc-fragment-control)) (the-as int (+ (* (-> this mat-xfer-count) 2) 4)) ) -(defmethod login-adgifs merc-effect ((this merc-effect)) + +;; WARN: Return type mismatch merc-effect vs none. +(defmethod login-adgifs ((this merc-effect)) (let* ((data *texture-login-data*) (a0-1 (-> data default-texture-index)) ) @@ -234,7 +235,7 @@ ) -(defmethod mem-usage merc-ctrl ((this merc-ctrl) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this merc-ctrl) (arg0 memory-usage-block) (arg1 int)) (if (-> this extra) (mem-usage (-> this extra) arg0 arg1) ) @@ -301,7 +302,7 @@ this ) -(defmethod login merc-ctrl ((this merc-ctrl)) +(defmethod login ((this merc-ctrl)) (set! (-> *kernel-context* login-object) this) (texture-usage-init this) (dotimes (s5-0 (the-as int (-> this header effect-count))) @@ -322,6 +323,7 @@ this ) +;; WARN: Return type mismatch symbol vs none. (defun-debug merc-stats-display ((arg0 merc-ctrl)) "Print merc debug stats." (format #t "~30s:" (-> arg0 name)) @@ -420,7 +422,6 @@ (none) ) -;; definition for function merc-vu1-add-vu-function ;; WARN: Return type mismatch dma-packet vs dma-gif-packet. (defun merc-vu1-add-vu-function ((dma dma-packet) (func vu-function) (flush-mode int)) "Add VU1 function to DMA chain." diff --git a/goal_src/jak2/engine/gfx/foreground/ripple.gc b/goal_src/jak2/engine/gfx/foreground/ripple.gc index 935fca30c76..ce0748a3dd2 100644 --- a/goal_src/jak2/engine/gfx/foreground/ripple.gc +++ b/goal_src/jak2/engine/gfx/foreground/ripple.gc @@ -8,23 +8,17 @@ ;; DECOMP BEGINS (deftype ripple-request (structure) - ((waveform ripple-wave :offset-assert 0) - (effect merc-effect :offset-assert 4) + ((waveform ripple-wave) + (effect merc-effect) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype ripple-globals (structure) - ((count int32 :offset-assert 0) - (requests ripple-request 16 :inline :offset-assert 4) + ((count int32) + (requests ripple-request 16 :inline) ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) diff --git a/goal_src/jak2/engine/gfx/foreground/shadow-cpu-h.gc b/goal_src/jak2/engine/gfx/foreground/shadow-cpu-h.gc index 6ee06083a75..4b1d0396e22 100644 --- a/goal_src/jak2/engine/gfx/foreground/shadow-cpu-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/shadow-cpu-h.gc @@ -49,13 +49,13 @@ :size-assert #x60 :flag-assert #xf00000060 (:methods - (new (symbol type float float float shadow-flags float) _type_ 0) - (clear-offset-bit (shadow-control) int 9) - (set-offset-bit (shadow-control) int 10) - (set-top-plane-offset (shadow-control float) int 11) - (set-bottom-plane-offset (shadow-control float) int 12) - (shadow-control-method-13 (_type_ vector float float float) none 13) - (shadow-control-method-14 (_type_ vector vector float float float) none 14) + (new (symbol type float float float shadow-flags float) _type_) + (clear-offset-bit (shadow-control) int) + (set-offset-bit (shadow-control) int) + (set-top-plane-offset (shadow-control float) int) + (set-bottom-plane-offset (shadow-control float) int) + (shadow-control-method-13 (_type_ vector float float float) none) + (shadow-control-method-14 (_type_ vector vector float float float) none) ) ) diff --git a/goal_src/jak2/engine/gfx/foreground/shadow-cpu.gc b/goal_src/jak2/engine/gfx/foreground/shadow-cpu.gc index d87a480ffda..3c31f5f0abf 100644 --- a/goal_src/jak2/engine/gfx/foreground/shadow-cpu.gc +++ b/goal_src/jak2/engine/gfx/foreground/shadow-cpu.gc @@ -11,11 +11,11 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of shadow-geo ((this shadow-geo)) +(defmethod asize-of ((this shadow-geo)) (the-as int (* (-> this total-qwc) 16)) ) -(defmethod mem-usage shadow-geo ((this shadow-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this shadow-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 111 (-> arg0 length))) (set! (-> arg0 data 110 name) "shadow-geo") (+! (-> arg0 data 110 count) 1) @@ -492,45 +492,39 @@ ) (deftype shadow-stats (structure) - ((num-single-tris uint32 :offset-assert 0) - (num-double-tris uint32 :offset-assert 4) - (num-single-edges uint32 :offset-assert 8) - (num-double-edges uint32 :offset-assert 12) - (num-fragments uint16 :offset-assert 16) - (num-objects uint16 :offset-assert 18) + ((num-single-tris uint32) + (num-double-tris uint32) + (num-single-edges uint32) + (num-double-edges uint32) + (num-fragments uint16) + (num-objects uint16) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype shadow-dcache (structure) - ((vtx-table uint32 :offset-assert 0) - (single-edge-table uint32 :offset-assert 4) - (double-edge-table uint32 :offset-assert 8) - (double-tri-table uint32 :offset-assert 12) - (dcache-top uint32 :offset-assert 16) - (num-facing-single-tris uint32 :offset-assert 20) - (num-single-edges uint32 :offset-assert 24) - (num-double-edges uint32 :offset-assert 28) - (single-tri-list uint32 :offset-assert 32) - (single-edge-list uint32 :offset-assert 36) - (double-edge-list uint32 :offset-assert 40) - (ptr-dual-verts uint32 :offset-assert 44) - (stats shadow-stats :inline :offset-assert 48) - (frag-qwc uint32 :offset-assert 68) - (center vector :inline :offset-assert 80) - (plane vector :inline :offset-assert 96) - (top-plane vector :inline :offset-assert 112) - (near-plane vector :inline :offset-assert 128) - (light-dir vector :inline :offset-assert 144) - (vtx-min vector :inline :offset-assert 160) - (data uint8 :dynamic :offset-assert 176) + ((vtx-table uint32) + (single-edge-table uint32) + (double-edge-table uint32) + (double-tri-table uint32) + (dcache-top uint32) + (num-facing-single-tris uint32) + (num-single-edges uint32) + (num-double-edges uint32) + (single-tri-list uint32) + (single-edge-list uint32) + (double-edge-list uint32) + (ptr-dual-verts uint32) + (stats shadow-stats :inline) + (frag-qwc uint32) + (center vector :inline) + (plane vector :inline) + (top-plane vector :inline) + (near-plane vector :inline) + (light-dir vector :inline) + (vtx-min vector :inline) + (data uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #xb0 - :flag-assert #x9000000b0 ) @@ -566,7 +560,7 @@ (def-mips2c shadow-add-double-edges function) -(defmethod shadow-control-method-14 shadow-control ((this shadow-control) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 float)) +(defmethod shadow-control-method-14 ((this shadow-control) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 float)) (let ((gp-0 (-> this settings))) (let ((s4-0 (-> gp-0 shadow-dir))) (vector-normalize-copy! s4-0 arg1 1.0) @@ -632,6 +626,7 @@ (def-mips2c shadow-execute (function shadow-dma-packet pointer pointer)) +;; ERROR: Failed store: (s.d! (+ (the-as dma-packet a0-5) 8) 0) at op 17 (defun shadow-vu0-upload () (#unless PC_PORT (let ((gp-0 *vu0-dma-list*)) @@ -656,6 +651,7 @@ ) ;; ERROR: Failed store: (s.h! (+ v1-24 18) 0) at op 58 +;; ERROR: Failed store: (s.h! (+ v1-24 16) 0) at op 59 (defun shadow-execute-all ((arg0 dma-buffer)) (when *debug-segment* (let ((gp-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) @@ -790,7 +786,7 @@ (none) ) -(defmethod shadow-control-method-13 shadow-control ((this shadow-control) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod shadow-control-method-13 ((this shadow-control) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (with-pp (let ((s4-0 (new 'stack-no-clear 'collide-query))) (let ((v1-0 pp)) diff --git a/goal_src/jak2/engine/gfx/foreground/shadow-vu1.gc b/goal_src/jak2/engine/gfx/foreground/shadow-vu1.gc index da1b681bf7d..e39774db0f1 100644 --- a/goal_src/jak2/engine/gfx/foreground/shadow-vu1.gc +++ b/goal_src/jak2/engine/gfx/foreground/shadow-vu1.gc @@ -8,38 +8,32 @@ ;; DECOMP BEGINS (deftype shadow-vu1-constants (structure) - ((hmgescale vector :inline :offset-assert 0) - (invhscale vector :inline :offset-assert 16) - (texoffset vector :inline :offset-assert 32) - (texscale vector :inline :offset-assert 48) - (hvdfoff vector :inline :offset-assert 64) - (fog vector :inline :offset-assert 80) - (clrs vector 2 :inline :offset-assert 96) - (adgif gs-gif-tag :inline :offset-assert 128) - (texflush gs-adcmd :inline :offset-assert 144) - (flush gs-adcmd :inline :offset-assert 160) - (trigif gs-gif-tag :inline :offset-assert 176) - (quadgif gs-gif-tag :inline :offset-assert 192) + ((hmgescale vector :inline) + (invhscale vector :inline) + (texoffset vector :inline) + (texscale vector :inline) + (hvdfoff vector :inline) + (fog vector :inline) + (clrs vector 2 :inline) + (adgif gs-gif-tag :inline) + (texflush gs-adcmd :inline) + (flush gs-adcmd :inline) + (trigif gs-gif-tag :inline) + (quadgif gs-gif-tag :inline) ) - :method-count-assert 9 - :size-assert #xd0 - :flag-assert #x9000000d0 ) (deftype shadow-vu1-data (structure) - ((adgif gs-gif-tag :inline :offset-assert 0) - (ad gs-adcmd :inline :offset-assert 16) - (flush gs-adcmd :inline :offset-assert 32) - (trigif gs-gif-tag :inline :offset-assert 48) - (quadgif gs-gif-tag :inline :offset-assert 64) - (texoffset vector :inline :offset-assert 80) - (texscale vector :inline :offset-assert 96) - (clrs qword 2 :inline :offset-assert 112) + ((adgif gs-gif-tag :inline) + (ad gs-adcmd :inline) + (flush gs-adcmd :inline) + (trigif gs-gif-tag :inline) + (quadgif gs-gif-tag :inline) + (texoffset vector :inline) + (texscale vector :inline) + (clrs qword 2 :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) diff --git a/goal_src/jak2/engine/gfx/generic/generic-h.gc b/goal_src/jak2/engine/gfx/generic/generic-h.gc index 6840d626ed1..0b05b0102b5 100644 --- a/goal_src/jak2/engine/gfx/generic/generic-h.gc +++ b/goal_src/jak2/engine/gfx/generic/generic-h.gc @@ -12,244 +12,193 @@ ;; DECOMP BEGINS (deftype gsf-vertex (structure) - ((data uint32 8 :offset-assert 0) - (byte uint8 32 :offset 0) - (quad uint128 2 :offset 0) - (vt qword :inline :offset 0) - (pos vector3s :inline :offset 0) - (tex vector2uh :inline :offset 12) - (nrm vector3s :inline :offset 16) - (nc qword :inline :offset 16) - (clr vector4ub :inline :offset 28) - (dtex vector2uh :inline :offset 16) - (dclr vector4ub :inline :offset 20) + ((data uint32 8) + (byte uint8 32 :overlay-at (-> data 0)) + (quad uint128 2 :overlay-at (-> data 0)) + (vt qword :inline :overlay-at (-> data 0)) + (pos vector3s :inline :overlay-at (-> data 0)) + (tex vector2uh :inline :overlay-at (-> data 3)) + (nrm vector3s :inline :overlay-at (-> data 4)) + (nc qword :inline :overlay-at (-> data 4)) + (clr vector4ub :inline :overlay-at (-> data 7)) + (dtex vector2uh :inline :overlay-at (-> data 4)) + (dclr vector4ub :inline :overlay-at (-> data 5)) ) :pack-me - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype gsf-vertex-array (structure) - ((vtx gsf-vertex :dynamic :offset-assert 0) + ((vtx gsf-vertex :dynamic) ) - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) (deftype gsf-fx-vertex (structure) - ((clr vector4ub :inline :offset-assert 0) - (tex vector2uh :inline :offset-assert 4) + ((clr vector4ub :inline) + (tex vector2uh :inline) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype gsf-fx-vertex-array (structure) - ((data gsf-fx-vertex :dynamic :offset-assert 0) + ((data gsf-fx-vertex :dynamic) ) - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) (deftype gsf-header (structure) - ((num-strips uint8 :offset-assert 0) - (num-new-vtxs uint8 :offset-assert 1) - (num-dps uint16 :offset-assert 2) - (num-vtxs uint16 :offset-assert 4) - (strip-table uint8 10 :offset-assert 6) + ((num-strips uint8) + (num-new-vtxs uint8) + (num-dps uint16) + (num-vtxs uint16) + (strip-table uint8 10) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype gsf-ik (structure) - ((index uint8 :offset-assert 0) - (no-kick uint8 :offset-assert 1) + ((index uint8) + (no-kick uint8) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) (deftype gsf-info (structure) - ((ptr-iks uint32 :offset-assert 0) - (ptr-verts uint32 :offset-assert 4) - (ptr-fx uint32 :offset-assert 8) - (dummy2 uint32 :offset-assert 12) + ((ptr-iks uint32) + (ptr-verts uint32) + (ptr-fx uint32) + (dummy2 uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype gsf-buffer (structure) - ((data uint8 8192 :offset-assert 0) - (info gsf-info :inline :offset 0) - (header gsf-header :inline :offset 16) - (work-area uint8 :dynamic :offset 32) + ((data uint8 8192) + (info gsf-info :inline :overlay-at (-> data 0)) + (header gsf-header :inline :overlay-at (-> data 16)) + (work-area uint8 :dynamic :overlay-at (-> data 32)) ) - :method-count-assert 9 - :size-assert #x2000 - :flag-assert #x900002000 ) (deftype generic-frag (structure) - ((start-pos uint16 :offset-assert 0) - (end-pos uint16 :offset-assert 2) + ((start-pos uint16) + (end-pos uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype generic-strip (structure) - ((pos uint16 :offset-assert 0) - (len uint16 :offset-assert 2) + ((pos uint16) + (len uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype generic-envmap-saves (structure) - ((index-mask vector4w :inline :offset-assert 0) - (verts uint128 12 :offset-assert 16) - (kicks uint128 4 :offset-assert 208) + ((index-mask vector4w :inline) + (verts uint128 12) + (kicks uint128 4) ) - :method-count-assert 9 - :size-assert #x110 - :flag-assert #x900000110 ) (deftype generic-interp-job (structure) - ((job-type uint16 :offset-assert 0) - (num uint16 :offset-assert 2) - (first uint16 :offset-assert 4) - (pad uint16 :offset-assert 6) - (ptr-data uint32 :offset-assert 8) - (morph-z uint16 :offset-assert 12) - (morph-w uint16 :offset-assert 14) + ((job-type uint16) + (num uint16) + (first uint16) + (pad uint16) + (ptr-data uint32) + (morph-z uint16) + (morph-w uint16) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype generic-saves (structure) - ((ptr-dma uint32 :offset-assert 0) - (ptr-vtxs uint32 :offset-assert 4) - (ptr-clrs uint32 :offset-assert 8) - (ptr-texs uint32 :offset-assert 12) - (ptr-env-clrs uint32 :offset-assert 16) - (ptr-env-texs uint32 :offset-assert 20) - (cur-outbuf uint32 :offset-assert 24) - (ptr-fx-buf uint32 :offset-assert 28) - (xor-outbufs uint32 :offset-assert 32) - (num-dps uint32 :offset-assert 36) - (qwc uint32 :offset-assert 40) - (gsf-buf gsf-buffer :offset-assert 44) - (ptr-shaders uint32 :offset-assert 48) - (ptr-env-shader uint32 :offset-assert 52) - (is-envmap uint16 :offset-assert 56) - (is-translucent uint16 :offset-assert 58) - (basep uint32 :offset-assert 60) - (ptr-interp-job generic-interp-job :offset-assert 64) - (gifbuf-adr uint32 :offset-assert 68) - (inbuf-adr uint32 :offset-assert 72) - (fade-val uint32 :offset-assert 76) - (time-of-day-color rgba :offset-assert 80) - (to-vu0-waits uint32 :offset-assert 84) - (to-spr-waits uint32 :offset-assert 88) - (from-spr-waits uint32 :offset-assert 92) - (envmap generic-envmap-saves :inline :offset-assert 96) + ((ptr-dma uint32) + (ptr-vtxs uint32) + (ptr-clrs uint32) + (ptr-texs uint32) + (ptr-env-clrs uint32) + (ptr-env-texs uint32) + (cur-outbuf uint32) + (ptr-fx-buf uint32) + (xor-outbufs uint32) + (num-dps uint32) + (qwc uint32) + (gsf-buf gsf-buffer) + (ptr-shaders uint32) + (ptr-env-shader uint32) + (is-envmap uint16) + (is-translucent uint16) + (basep uint32) + (ptr-interp-job generic-interp-job) + (gifbuf-adr uint32) + (inbuf-adr uint32) + (fade-val uint32) + (time-of-day-color rgba) + (to-vu0-waits uint32) + (to-spr-waits uint32) + (from-spr-waits uint32) + (envmap generic-envmap-saves :inline) ) - :method-count-assert 9 - :size-assert #x170 - :flag-assert #x900000170 ) (deftype generic-gif-tag (structure) - ((data uint32 4 :offset-assert 0) - (qword qword :inline :offset 0) - (fan-prim gif-tag-prim :offset 0) - (str-prim gif-tag-prim :offset 4) - (regs gif-tag-regs-32 :offset 8) - (num-strips uint32 :offset 12) + ((data uint32 4) + (qword qword :inline :overlay-at (-> data 0)) + (fan-prim gif-tag-prim :overlay-at (-> data 0)) + (str-prim gif-tag-prim :overlay-at (-> data 1)) + (regs gif-tag-regs-32 :overlay-at (-> data 2)) + (num-strips uint32 :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype generic-envmap-consts (structure) - ((consts vector :inline :offset-assert 0) - (strgif generic-gif-tag :inline :offset-assert 16) - (colors vector4w :inline :offset-assert 32) - (shader adgif-shader :inline :offset-assert 48) + ((consts vector :inline) + (strgif generic-gif-tag :inline) + (colors vector4w :inline) + (shader adgif-shader :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) (deftype generic-consts (structure) - ((dma-header dma-packet :inline :offset-assert 0) - (vif-header uint32 4 :offset-assert 16) - (dma-ref-vtxs dma-packet :inline :offset-assert 32) - (dma-cnt-call dma-packet :inline :offset-assert 48) - (matrix matrix :inline :offset-assert 64) - (base-strgif generic-gif-tag :inline :offset-assert 128) - (alpha-opaque gs-adcmd :inline :offset-assert 144) - (alpha-translucent gs-adcmd :inline :offset-assert 160) - (ztest-normal gs-adcmd :inline :offset-assert 176) - (ztest-opaque gs-adcmd :inline :offset-assert 192) - (adcmd-offsets uint8 16 :offset-assert 208) - (stcycle-tag uint32 :offset-assert 224) - (unpack-vtx-tag uint32 :offset-assert 228) - (unpack-clr-tag uint32 :offset-assert 232) - (unpack-tex-tag uint32 :offset-assert 236) - (mscal-tag uint32 :offset-assert 240) - (flush-tag uint32 :offset-assert 244) - (reset-cycle-tag uint32 :offset-assert 248) - (dummy0 uint32 :offset-assert 252) - (dma-tag-cnt uint64 :offset-assert 256) - (envmap generic-envmap-consts :inline :offset-assert 272) - (light-consts vector :inline :offset-assert 400) - (texture-offset uint16 8 :offset-assert 416) + ((dma-header dma-packet :inline) + (vif-header uint32 4) + (dma-ref-vtxs dma-packet :inline) + (dma-cnt-call dma-packet :inline) + (matrix matrix :inline) + (base-strgif generic-gif-tag :inline) + (alpha-opaque gs-adcmd :inline) + (alpha-translucent gs-adcmd :inline) + (ztest-normal gs-adcmd :inline) + (ztest-opaque gs-adcmd :inline) + (adcmd-offsets uint8 16) + (stcycle-tag uint32) + (unpack-vtx-tag uint32) + (unpack-clr-tag uint32) + (unpack-tex-tag uint32) + (mscal-tag uint32) + (flush-tag uint32) + (reset-cycle-tag uint32) + (dummy0 uint32) + (dma-tag-cnt uint64) + (envmap generic-envmap-consts :inline) + (light-consts vector :inline) + (texture-offset uint16 8) ) - :method-count-assert 9 - :size-assert #x1b0 - :flag-assert #x9000001b0 ) (deftype generic-storage (structure) - ((data uint128 16 :offset-assert 0) + ((data uint128 16) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) diff --git a/goal_src/jak2/engine/gfx/generic/generic-vu1-h.gc b/goal_src/jak2/engine/gfx/generic/generic-vu1-h.gc index 2f13bce95a0..6db2b1be85f 100644 --- a/goal_src/jak2/engine/gfx/generic/generic-vu1-h.gc +++ b/goal_src/jak2/engine/gfx/generic/generic-vu1-h.gc @@ -8,88 +8,67 @@ ;; DECOMP BEGINS (deftype pris-mtx (structure) - ((data float 32 :offset-assert 0) - (vector vector 8 :offset 0) - (t-mtx matrix :inline :offset 0) - (n-mtx matrix3 :inline :offset 64) - (scale vector :inline :offset 112) + ((data float 32) + (vector vector 8 :overlay-at (-> data 0)) + (t-mtx matrix :inline :overlay-at (-> data 0)) + (n-mtx matrix3 :inline :overlay-at (-> data 16)) + (scale vector :inline :overlay-at (-> data 28)) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) (deftype generic-pris-mtx-save (structure) - ((loc-mtx pris-mtx :inline :offset-assert 0) - (par-mtx pris-mtx :inline :offset-assert 128) - (dif-mtx pris-mtx :inline :offset-assert 256) + ((loc-mtx pris-mtx :inline) + (par-mtx pris-mtx :inline) + (dif-mtx pris-mtx :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) (deftype generic-constants (structure) - ((fog vector :inline :offset-assert 0) - (adgif gs-gif-tag :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (hmge-scale vector :inline :offset-assert 48) - (invh-scale vector :inline :offset-assert 64) - (guard vector :inline :offset-assert 80) - (flush qword :inline :offset-assert 96) - (stores qword :inline :offset-assert 112) + ((fog vector :inline) + (adgif gs-gif-tag :inline) + (hvdf-offset vector :inline) + (hmge-scale vector :inline) + (invh-scale vector :inline) + (guard vector :inline) + (flush qword :inline) + (stores qword :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) (deftype generic-shrub-constants (structure) - ((shrub-giftag generic-gif-tag :inline :offset-assert 0) - (shrub-adnop qword :inline :offset-assert 16) + ((shrub-giftag generic-gif-tag :inline) + (shrub-adnop qword :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype gcf-shader (structure) - ((adgif uint128 5 :offset-assert 0) - (shader adgif-shader :inline :offset 0) - (pos uint32 :offset 12) - (num uint32 :offset 28) + ((adgif uint128 5) + (shader adgif-shader :inline :overlay-at (-> adgif 0)) + (pos uint32 :offset 12) + (num uint32 :offset 28) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype gcf-control (structure) - ((matrix matrix :inline :offset-assert 0) - (giftag generic-gif-tag :inline :offset-assert 64) - (adnops gs-adcmd 2 :inline :offset-assert 80) - (num-strips uint32 :offset 76) - (num-dps uint32 :offset 92) - (kick-offset uint32 :offset 108) - (shader gcf-shader :inline :dynamic :offset-assert 112) + ((matrix matrix :inline) + (giftag generic-gif-tag :inline) + (adnops gs-adcmd 2 :inline) + (num-strips uint32 :overlay-at (-> giftag data 3)) + (num-dps uint32 :overlay-at (-> adnops 0 word 3)) + (kick-offset uint32 :offset 108) + (shader gcf-shader :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) (deftype gcf-vertex (structure) - ((tex vector4w :inline :offset-assert 0) - (clr gs-packed-rgba :inline :offset-assert 16) - (pos gs-packed-xyzw :inline :offset-assert 32) + ((tex vector4w :inline) + (clr gs-packed-rgba :inline) + (pos gs-packed-xyzw :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) diff --git a/goal_src/jak2/engine/gfx/hw/display-h.gc b/goal_src/jak2/engine/gfx/hw/display-h.gc index 802fe7ad76a..b7e64aceaaf 100644 --- a/goal_src/jak2/engine/gfx/hw/display-h.gc +++ b/goal_src/jak2/engine/gfx/hw/display-h.gc @@ -20,24 +20,22 @@ At any point in time, there are 3 frames in progress: ;; per-frame DMA buffers, timing, and profiling info. (deftype display-frame (basic) - ((buffer dma-buffer 11 :offset-assert 4) - (calc-buf dma-buffer :offset 8) - (vu1-buf dma-buffer :offset 8) - (debug-buf dma-buffer :offset 36) - (global-buf dma-buffer :offset 40) - (bucket-group (inline-array dma-bucket) :offset 44) - (profile-array profile-array :inline :offset-assert 48) - (start-time int64 :offset-assert 56) - (run-time int64 :offset-assert 64) + ((buffer dma-buffer 11) + (calc-buf dma-buffer :overlay-at (-> buffer 1)) + (vu1-buf dma-buffer :overlay-at (-> buffer 1)) + (debug-buf dma-buffer :overlay-at (-> buffer 8)) + (global-buf dma-buffer :overlay-at (-> buffer 9)) + (bucket-group (inline-array dma-bucket) :overlay-at (-> buffer 10)) + (profile-array profile-array :inline) + (start-time int64) + (run-time int64) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) + (defmethod new display-frame ((allocation symbol) (type-to-make type)) "Allocate and initialize a display frame. Does not set up dma buffers." (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) @@ -56,41 +54,38 @@ At any point in time, there are 3 frames in progress: ;; The display is the global state related to frame timing and double-buffering of frames. ;; it also holds the render enable mask. (deftype display (basic) - ((on-screen int32 :offset-assert 4) ;; frame index (0 or 1) - (last-screen int32 :offset-assert 8) ;; frame index (0 or 1) - (frames display-frame 2 :offset-assert 12) ;; per-frame dma/timing - (bgcolor gs-bgcolor :offset-assert 24) ;; GS setting - (pmode gs-pmode :offset-assert 32) ;; GS setting - (clock clock 13 :offset-assert 40) - (session-clock clock :offset 40) - (game-clock clock :offset 44) - (base-clock clock :offset 48) - (real-clock clock :offset 52) - (frame-clock clock :offset 56) - (real-frame-clock clock :offset 60) - (target-clock clock :offset 64) - (entity-clock clock :offset 68) - (part-clock clock :offset 72) - (bg-clock clock :offset 76) - (camera-clock clock :offset 80) - (user0-clock clock :offset 84) - (total-game-clock clock :offset 88) - (time-factor float :offset-assert 92) - (dog-ratio float :offset-assert 96) - (vblank-start-time int64 2 :offset-assert 104) - (total-run-time int64 :offset-assert 120) - (run-half-speed basic :offset-assert 128) - (dog-count float :offset-assert 132) - (vu1-enable-user vu1-renderer-mask :offset-assert 136) - (vu1-enable-user-menu vu1-renderer-mask :offset-assert 144) - (force-sync uint32 :offset-assert 152) + ((on-screen int32) ;; frame index (0 or 1) + (last-screen int32) ;; frame index (0 or 1) + (frames display-frame 2) ;; per-frame dma/timing + (bgcolor gs-bgcolor) ;; GS setting + (pmode gs-pmode) ;; GS setting + (clock clock 13) + (session-clock clock :overlay-at (-> clock 0)) + (game-clock clock :overlay-at (-> clock 1)) + (base-clock clock :overlay-at (-> clock 2)) + (real-clock clock :overlay-at (-> clock 3)) + (frame-clock clock :overlay-at (-> clock 4)) + (real-frame-clock clock :overlay-at (-> clock 5)) + (target-clock clock :overlay-at (-> clock 6)) + (entity-clock clock :overlay-at (-> clock 7)) + (part-clock clock :overlay-at (-> clock 8)) + (bg-clock clock :overlay-at (-> clock 9)) + (camera-clock clock :overlay-at (-> clock 10)) + (user0-clock clock :overlay-at (-> clock 11)) + (total-game-clock clock :overlay-at (-> clock 12)) + (time-factor float) + (dog-ratio float) + (vblank-start-time int64 2) + (total-run-time int64) + (run-half-speed basic) + (dog-count float) + (vu1-enable-user vu1-renderer-mask) + (vu1-enable-user-menu vu1-renderer-mask) + (force-sync uint32) ) - :method-count-assert 10 - :size-assert #x9c - :flag-assert #xa0000009c (:methods - (new (symbol type int int int int int) _type_ 0) - (set-time-ratios (_type_ float) float 9) + (new (symbol type int int int int int) _type_) + (set-time-ratios (_type_ float) float) ) ) diff --git a/goal_src/jak2/engine/gfx/hw/display.gc b/goal_src/jak2/engine/gfx/hw/display.gc index c29f0c2242d..009ab481181 100644 --- a/goal_src/jak2/engine/gfx/hw/display.gc +++ b/goal_src/jak2/engine/gfx/hw/display.gc @@ -22,7 +22,7 @@ (-> *display* base-clock integral-frame-counter) ) -(defmethod set-time-ratios display ((this display) (arg0 float)) +(defmethod set-time-ratios ((this display) (arg0 float)) "Set the 'dog ratio'. This should be 1 when the game is running at full speed. Larger dog ratio means slower." @@ -92,6 +92,7 @@ (new 'global 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) ) +;; WARN: Return type mismatch pointer vs none. (defun draw-sprite2d-xy ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 rgba)) "Draw a sprite primitive with the given color and dimensions." (let* ((t2-1 (new 'stack 'draw-context arg1 arg2 arg3 arg4 arg5)) @@ -149,6 +150,7 @@ (none) ) +;; WARN: Return type mismatch pointer vs none. (defun draw-sprite2d-xy-absolute ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 rgba)) "Draw a sprite primitive, setting the gs-xzyf register to exactly the values specified (no offset/clamp)" (let ((t2-0 (+ arg1 1792)) @@ -202,6 +204,7 @@ (none) ) +;; WARN: Return type mismatch pointer vs none. (defun draw-quad2d ((arg0 dma-buffer) (arg1 draw-context)) "Draw a quad that fills the entire context" (let ((a3-1 (max 1792 (min 2304 (+ (-> arg1 orgx) 1792)))) @@ -572,10 +575,9 @@ (kmemopen global "dma-buffers") (define *vu0-dma-list* (new 'global 'dma-buffer 4096)) -(define *display* (new 'global 'display 0 512 416 2 49)) -(allocate-dma-buffers *display*) -(kmemclose) - +(define *display* (new 'global 'display 0 512 416 2 49)) +(allocate-dma-buffers *display*) +(kmemclose) diff --git a/goal_src/jak2/engine/gfx/hw/gs.gc b/goal_src/jak2/engine/gfx/hw/gs.gc index a6f6feec7d2..27021f250db 100644 --- a/goal_src/jak2/engine/gfx/hw/gs.gc +++ b/goal_src/jak2/engine/gfx/hw/gs.gc @@ -136,9 +136,6 @@ (slbg uint8 :offset 7 :size 1) (alp uint8 :offset 8 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's SMODE2 register makes settings related to PCRTC video synchronization. @@ -147,9 +144,6 @@ (ffmd uint8 :offset 1 :size 1) (dpms uint8 :offset 2 :size 2) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (defun psm-size ((arg0 gs-psm)) @@ -236,25 +230,22 @@ ) ) -;; the GS's DISPFB registers make settings for the frame buffer regarding information on -;; Rectangular Area Read Output Circuit n for the PCRTC. -;; write-only (deftype gs-display-fb (uint64) +"the GS's DISPFB registers make settings for the frame buffer regarding information on +Rectangular Area Read Output Circuit n for the PCRTC. +write-only" ((fbp uint16 :offset 0 :size 9) (fbw uint8 :offset 9 :size 6) (psm gs-psm :offset 15 :size 5) (dbx uint16 :offset 32 :size 11) (dby uint16 :offset 43 :size 11) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) -;; the GS's DISPLAY registers make settings for the display position on the screen regarding -;; information on Rectangular Area Read Output Circuit n for the PCRTC. -;; write-only (deftype gs-display (uint64) + "the GS's DISPLAY registers make settings for the display position on the screen regarding +information on Rectangular Area Read Output Circuit n for the PCRTC. +write-only" ((dx uint16 :offset 0 :size 12) (dy uint16 :offset 12 :size 11) (magh uint8 :offset 23 :size 4) @@ -262,28 +253,23 @@ (dw uint16 :offset 32 :size 12) (dh uint16 :offset 44 :size 11) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) -;; the GS's BGCOLOR register sets the background color of the PCRTC with RGB value. -;; write-only (deftype gs-bgcolor (uint64) + "the GS's BGCOLOR register sets the background color of the PCRTC with RGB value. +write-only" ((r uint8 :offset 0 :size 8) (g uint8 :offset 8 :size 8) (b uint8 :offset 16 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) -;; the GS's CSR register sets and obtains various GS statuses. -;; read-write. the fields have different effects depending on whether they're being read from -;; or written to. -;; bits 5 and 6 (0x20 and 0x40) should be zero (deftype gs-csr (uint64) + "the GS's CSR register sets and obtains various GS statuses. +read-write. the fields have different effects depending on whether they're being read from +or written to. + +bits 5 and 6 (0x20 and 0x40) should be zero" ((signal uint8 :offset 0 :size 1) (finish uint8 :offset 1 :size 1) (hsint uint8 :offset 2 :size 1) @@ -297,31 +283,25 @@ (rev uint8 :offset 16 :size 8) (id uint8 :offset 24 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; memory layout of the GS's privileged registers (mapped to EE memory) ;; it is missing the SIGLBLID/LABELID register at 4224 (useless anyway?) (deftype gs-bank (structure) - ((pmode gs-pmode :offset-assert 0) - (smode2 gs-smode2 :offset 32) - (dspfb1 gs-display-fb :offset 112) - (display1 gs-display :offset 128) - (dspfb2 gs-display-fb :offset 144) - (display2 gs-display :offset 160) - (extbuf uint64 :offset 176) - (extdata uint64 :offset 192) - (extwrite uint64 :offset 208) - (bgcolor gs-bgcolor :offset 224) - (csr gs-csr :offset 4096) - (imr uint64 :offset 4112) - (busdir uint64 :offset 4160) + ((pmode gs-pmode) + (smode2 gs-smode2 :offset 32) + (dspfb1 gs-display-fb :offset 112) + (display1 gs-display :offset 128) + (dspfb2 gs-display-fb :offset 144) + (display2 gs-display :offset 160) + (extbuf uint64 :offset 176) + (extdata uint64 :offset 192) + (extwrite uint64 :offset 208) + (bgcolor gs-bgcolor :offset 224) + (csr gs-csr :offset 4096) + (imr uint64 :offset 4112) + (busdir uint64 :offset 4160) ) - :method-count-assert 9 - :size-assert #x1048 - :flag-assert #x900001048 ) ;; the GS's FRAME registers store various settings related to the frame buffer. @@ -331,9 +311,6 @@ (psm gs-psm :offset 24 :size 6) (fbmsk uint32 :offset 32 :size 32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's ZBUF registers make various settings regarding Z buffer. @@ -342,9 +319,6 @@ (psm gs-psm :offset 24 :size 4) (zmsk uint8 :offset 32 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's XYOFFSET registers set the offset value for converting from the primitive coordinate @@ -353,9 +327,6 @@ ((ofx uint16 :offset 0 :size 16) (ofy uint16 :offset 32 :size 16) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's SCISSOR registers specify the scissoring area. The coordinate values for @@ -367,9 +338,6 @@ (scay0 uint16 :offset 32 :size 11) (scay1 uint16 :offset 48 :size 11) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's PRMODECONT register sets whether to use primitive attributes (IIP, TME, FGE, ABE, @@ -377,9 +345,6 @@ (deftype gs-prmode-cont (uint64) ((ac uint8 :offset 0 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's COLCLAMP register stores settings as to whether clamping for the RGB value of the @@ -387,18 +352,12 @@ (deftype gs-color-clamp (uint64) ((clamp uint8 :offset 0 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's DTHE register stores settings for dithering (performed/not performed). (deftype gs-dthe (uint64) ((dthe uint8 :offset 0 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (defenum gs-atest @@ -421,18 +380,15 @@ ) (deftype gs-test (uint64) - ((ate uint8 :offset 0 :size 1) ;; alpha test enable - (atst gs-atest :offset 1 :size 3) ;; alpha test method - (aref uint8 :offset 4 :size 8) ;; alpha val reference - (afail uint8 :offset 12 :size 2) ;; processing method on alpha test fail - (date uint8 :offset 14 :size 1) ;; dest alpha test enable - (datm uint8 :offset 15 :size 1) ;; dest alpha test mode - (zte uint8 :offset 16 :size 1) ;; depth test enable - (ztst gs-ztest :offset 17 :size 2) ;; depth test method + ((ate uint8 :offset 0 :size 1) ;; alpha test enable + (atst gs-atest :offset 1 :size 3) ;; alpha test method + (aref uint8 :offset 4 :size 8) ;; alpha val reference + (afail uint8 :offset 12 :size 2) ;; processing method on alpha test fail + (date uint8 :offset 14 :size 1) ;; dest alpha test enable + (datm uint8 :offset 15 :size 1) ;; dest alpha test mode + (zte uint8 :offset 16 :size 1) ;; depth test enable + (ztst gs-ztest :offset 17 :size 2) ;; depth test method ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (defenum gs-prim-type @@ -459,9 +415,6 @@ (ctxt uint8 :offset 9 :size 1) (fix uint8 :offset 10 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's RGBAQ register sets the RGBA value of the vertex and the Q value of the normalized @@ -473,9 +426,6 @@ (a uint8 :offset 24 :size 8) (q float :offset 32 :size 32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; GS XYZ registers @@ -484,9 +434,6 @@ (y uint16 :offset 16 :size 16) (z uint32 :offset 32 :size 32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's UV register specifies the texel coordinate (UV) values of the vertex. @@ -494,9 +441,6 @@ ((u uint16 :offset 0 :size 16) (v uint16 :offset 16 :size 16) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's ST register sets the S and T values of the vertex texture coordinates. @@ -505,9 +449,6 @@ ((s float :offset 0 :size 32) (t float :offset 32 :size 32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; GS XYZF registers @@ -517,26 +458,20 @@ (z uint32 :offset 32 :size 24) (f uint8 :offset 56 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; Adress + Data command (deftype gs-adcmd (structure) - ((word uint32 4 :offset-assert 0) - (quad uint128 :offset 0) - (data uint64 :offset 0) - (cmds gs-reg64 :offset 8) - (cmd uint8 :offset 8) - (x uint32 :offset 0) - (y uint32 :offset 4) - (z uint32 :offset 8) - (w uint32 :offset 12) + ((word uint32 4) + (quad uint128 :overlay-at (-> word 0)) + (data uint64 :overlay-at (-> word 0)) + (cmds gs-reg64 :overlay-at (-> word 2)) + (cmd uint8 :overlay-at (-> word 2)) + (x uint32 :overlay-at (-> word 0)) + (y uint32 :overlay-at (-> word 1)) + (z uint32 :overlay-at (-> word 2)) + (w uint32 :overlay-at (-> word 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -549,9 +484,6 @@ (dsay uint16 :offset 48 :size 11) (dir uint8 :offset 59 :size 2) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's TRXREG register specifies the size of the rectangular area, where the transmission @@ -561,9 +493,6 @@ ((rrw uint16 :offset 0 :size 12) (rrh uint16 :offset 32 :size 12) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's TRXDIR register specifies the transmission direction in the transmission between @@ -573,9 +502,6 @@ (deftype gs-trxdir (uint64) ((xdir uint8 :offset 0 :size 2) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's BITBLTBUF register stores buffer-related settings for transmission source and @@ -588,9 +514,6 @@ (dbw uint8 :offset 48 :size 6) (dpsm gs-psm :offset 56 :size 6) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's TEX0 registers set various kinds of information regarding the textures to be used. @@ -608,9 +531,6 @@ (csa uint8 :offset 56 :size 5) (cld uint8 :offset 61 :size 3) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's TEX1 registers set information on the sampling method of the textures. @@ -623,9 +543,6 @@ (l uint8 :offset 19 :size 2) (k int16 :offset 32 :size 12) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's TEXA register sets the Alpha value to be referred to when the Alpha value of the @@ -635,9 +552,6 @@ (aem uint8 :offset 15 :size 1) (ta1 uint8 :offset 32 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's TEXCLUT register specifies the CLUT position in the buffer when the CLUT storage mode @@ -647,9 +561,6 @@ (cou uint8 :offset 6 :size 6) (cov uint16 :offset 12 :size 10) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's MIPTBP registers set the buffer pointer and buffer width of textures when performing @@ -663,9 +574,6 @@ (tbp3 uint16 :offset 40 :size 14) (tbw3 uint8 :offset 54 :size 6) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's ALPHA registers define the blend function of alpha blending @@ -676,9 +584,6 @@ (d uint8 :offset 6 :size 2) (fix uint8 :offset 32 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the GS's CLAMP registers set the texture's wrap mode (repeating or clamping) for both S and T. @@ -698,45 +603,32 @@ (minv uint16 :offset 24 :size 10) (maxv uint16 :offset 34 :size 10) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype gs-fog (uint64) ((f uint8 :offset 56 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype gs-fogcol (uint64) ((fcr uint8 :offset 0 :size 8) (fcg uint8 :offset 8 :size 8) (fcb uint8 :offset 16 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + (deftype gif-ctrl (uint32) ((rst uint8 :offset 0 :size 1) (pse uint8 :offset 3 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype gif-mode (uint32) ((m3r uint8 :offset 0 :size 1) (imt uint8 :offset 2 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype gif-stat (uint32) @@ -753,9 +645,6 @@ (dir uint8 :offset 12 :size 1) (fqc uint8 :offset 24 :size 5) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype gif-cnt (uint32) @@ -763,43 +652,31 @@ (regcnt uint8 :offset 16 :size 4) (vuaddr uint16 :offset 20 :size 10) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype gif-p3cnt (uint32) ((p3cnt uint16 :offset 0 :size 15) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype gif-p3tag (uint32) ((loopcnt uint16 :offset 0 :size 15) (eop uint8 :offset 15 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype gif-bank (structure) - ((ctrl gif-ctrl :offset 0) - (mode gif-mode :offset 16) - (stat gif-stat :offset 32) - (tag0 uint32 :offset 64) - (tag1 uint32 :offset 80) - (tag2 uint32 :offset 96) - (tag3 uint32 :offset 112) - (cnt gif-cnt :offset 128) - (p3cnt gif-p3cnt :offset 144) - (p3tag gif-p3tag :offset 160) + ((ctrl gif-ctrl :offset 0) + (mode gif-mode :offset 16) + (stat gif-stat :offset 32) + (tag0 uint32 :offset 64) + (tag1 uint32 :offset 80) + (tag2 uint32 :offset 96) + (tag3 uint32 :offset 112) + (cnt gif-cnt :offset 128) + (p3cnt gif-p3cnt :offset 144) + (p3tag gif-p3tag :offset 160) ) - :method-count-assert 9 - :size-assert #xa4 - :flag-assert #x9000000a4 ) (defenum gif-flag @@ -817,18 +694,12 @@ (flg gif-flag :offset 26 :size 2) (nreg uint8 :offset 28 :size 4) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype gif-tag-count (uint32) ((nloop uint16 :offset 0 :size 15) (eop uint8 :offset 15 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (defenum gif-reg-id @@ -850,7 +721,6 @@ (nop 15) ) - (deftype gif-tag64 (uint64) ((nloop uint16 :offset 0 :size 15) (eop uint8 :offset 15 :size 1) @@ -860,9 +730,6 @@ (flg gif-flag :offset 58 :size 2) (nreg uint8 :offset 60 :size 4) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype gif-tag (uint128) @@ -890,9 +757,6 @@ (regs14 gif-reg-id :offset 120 :size 4) (regs15 gif-reg-id :offset 124 :size 4) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype gif-tag-regs (uint64) @@ -972,15 +836,12 @@ ) (deftype gs-gif-tag (structure) - ((qword uint128 :offset-assert 0) - (tag gif-tag64 :offset 0) - (regs gif-tag-regs :offset 8) - (dword uint64 2 :offset 0) - (word uint32 4 :offset 0) + ((qword uint128) + (tag gif-tag64 :overlay-at qword) + (regs gif-tag-regs :offset 8) + (dword uint64 2 :overlay-at qword) + (word uint32 4 :overlay-at qword) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (defmethod inspect gif-tag ((obj gif-tag)) @@ -1010,23 +871,24 @@ (the-as gif-tag (format #t "~Tregs15: ~4d~%" (-> obj regs15))) ) + +;; WARN: Return type mismatch object vs gif-tag. + (define *fog-color* (new 'static 'rgba :r #x80)) ;; Unused type for building a dynamically sized gif packet. (deftype gif-packet (basic) - ((reg-count int32 :offset-assert 4) - (gif-tag gs-gif-tag :inline :offset-assert 16) - (gif-tag0 uint128 :offset 16) - (args uint64 1 :offset-assert 32) + ((reg-count int32) + (gif-tag gs-gif-tag :inline) + (gif-tag0 uint128 :overlay-at (-> gif-tag qword)) + (args uint64 1) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) + (defmethod new gif-packet ((allocation symbol) (type-to-make type) (arg0 int)) "Allocate a gif packet with enough room for arg0 64-bit args." (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (+ arg0 -1) 8)))) @@ -1039,6 +901,7 @@ arg0 ) +;; WARN: Return type mismatch gif-packet vs none. (defun add-reg-gif-packet ((arg0 gif-packet) (arg1 int) (arg2 int)) "Add a register + value to the packet" (let ((v1-0 (-> arg0 gif-tag))) @@ -1059,21 +922,19 @@ ;; simple drawing context (origin, size, color) used in very simple software renderers for debug quad rendering. (deftype draw-context (basic) - ((orgx int32 :offset-assert 4) - (orgy int32 :offset-assert 8) - (orgz int32 :offset-assert 12) - (width int32 :offset-assert 16) - (height int32 :offset-assert 20) - (color rgba 4 :offset-assert 24) + ((orgx int32) + (orgy int32) + (orgz int32) + (width int32) + (height int32) + (color rgba 4) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 (:methods - (new (symbol type int int int int rgba) _type_ 0) + (new (symbol type int int int int rgba) _type_) ) ) + (defmethod new draw-context ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 rgba)) (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (set! (-> v0-0 orgx) arg0) @@ -1094,60 +955,47 @@ ) (deftype gs-packed-rgba (vector4w) - ((r int32 :offset 0) - (g int32 :offset 4) - (b int32 :offset 8) - (a int32 :offset 12) + ((r int32 :overlay-at (-> data 0)) + (g int32 :overlay-at (-> data 1)) + (b int32 :overlay-at (-> data 2)) + (a int32 :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype gs-packed-xyzw (vector) - ((ix int32 :offset 0) - (iy int32 :offset 4) - (iz int32 :offset 8) - (iw int32 :offset 12) + ((ix int32 :overlay-at (-> data 0)) + (iy int32 :overlay-at (-> data 1)) + (iz int32 :overlay-at (-> data 2)) + (iw int32 :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype gs-packed-stq (vector) - ((tex-s float :offset 0) - (tex-t float :offset 4) - (tex-q float :offset 8) + ((tex-s float :overlay-at (-> data 0)) + (tex-t float :overlay-at (-> data 1)) + (tex-q float :overlay-at (-> data 2)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype gs-packed-uv (vector) - ((u int16 :offset 0) - (v int16 :offset 4) + ((u int16 :overlay-at (-> data 0)) + (v int16 :overlay-at (-> data 1)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype gs-packed-gt (structure) - ((stq gs-packed-stq :inline :offset 0) - (rgba gs-packed-rgba :inline :offset 16) - (xyzw gs-packed-xyzw :inline :offset 32) + ((stq gs-packed-stq :inline :offset 0) + (rgba gs-packed-rgba :inline :offset 16) + (xyzw gs-packed-xyzw :inline :offset 32) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype gs-packed-gt4 (structure) - ((data gs-packed-gt 4 :inline :offset-assert 0) + ((data gs-packed-gt 4 :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) diff --git a/goal_src/jak2/engine/gfx/hw/video-h.gc b/goal_src/jak2/engine/gfx/hw/video-h.gc index 0d6ebce0dc2..c6bd1b1d8ac 100644 --- a/goal_src/jak2/engine/gfx/hw/video-h.gc +++ b/goal_src/jak2/engine/gfx/hw/video-h.gc @@ -12,19 +12,16 @@ ;; very basic settings for video output. (deftype video-params (structure) - ((set-video-mode symbol :offset-assert 0) - (reset-video-mode symbol :offset-assert 4) - (display-fbp int32 :offset-assert 8) - (relative-x-scale float :offset 16) - (display-dx int32 :offset-assert 20) - (display-dy int32 :offset-assert 24) - (display-sy int32 :offset-assert 28) - (relative-x-scale-reciprical float :offset-assert 32) - (screen-pages-high int32 :offset-assert 36) + ((set-video-mode symbol) + (reset-video-mode symbol) + (display-fbp int32) + (relative-x-scale float :offset 16) + (display-dx int32) + (display-dy int32) + (display-sy int32) + (relative-x-scale-reciprical float) + (screen-pages-high int32) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) diff --git a/goal_src/jak2/engine/gfx/math-camera-h.gc b/goal_src/jak2/engine/gfx/math-camera-h.gc index 24889809ca9..3462ddb9e3f 100644 --- a/goal_src/jak2/engine/gfx/math-camera-h.gc +++ b/goal_src/jak2/engine/gfx/math-camera-h.gc @@ -19,105 +19,98 @@ matrix used almost everywhere. ;; unused... (deftype vis-gif-tag (structure) - ((fog0 uint32 :offset-assert 0) - (strip uint32 :offset-assert 4) - (regs uint32 :offset-assert 8) - (fan uint32 :offset-assert 12) + ((fog0 uint32) + (strip uint32) + (regs uint32) + (fan uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; also seems unused? (deftype cull-info (structure) - ((x-fact float :offset-assert 0) - (y-fact float :offset-assert 4) - (z-fact float :offset-assert 8) - (cam-radius float :offset-assert 12) - (cam-x float :offset-assert 16) - (cam-y float :offset-assert 20) - (xz-dir-ax float :offset-assert 24) - (xz-dir-az float :offset-assert 28) - (xz-dir-bx float :offset-assert 32) - (xz-dir-bz float :offset-assert 36) - (xz-cross-ab float :offset-assert 40) - (yz-dir-ay float :offset-assert 44) - (yz-dir-az float :offset-assert 48) - (yz-dir-by float :offset-assert 52) - (yz-dir-bz float :offset-assert 56) - (yz-cross-ab float :offset-assert 60) + ((x-fact float) + (y-fact float) + (z-fact float) + (cam-radius float) + (cam-x float) + (cam-y float) + (xz-dir-ax float) + (xz-dir-az float) + (xz-dir-bx float) + (xz-dir-bz float) + (xz-cross-ab float) + (yz-dir-ay float) + (yz-dir-az float) + (yz-dir-by float) + (yz-dir-bz float) + (yz-cross-ab float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) + (deftype math-camera (basic) - ((d meters :offset-assert 4) - (f meters :offset-assert 8) - (fov degrees :offset-assert 12) - (x-ratio float :offset-assert 16) - (y-ratio float :offset-assert 20) - (x-pix float :offset-assert 24) - (x-clip float :offset-assert 28) - (x-clip-ratio-in float :offset-assert 32) - (x-clip-ratio-over float :offset-assert 36) - (y-pix float :offset-assert 40) - (y-clip float :offset-assert 44) - (y-clip-ratio-in float :offset-assert 48) - (y-clip-ratio-over float :offset-assert 52) - (cull-info cull-info :inline :offset-assert 56) - (fog-start meters :offset-assert 120) - (fog-end meters :offset-assert 124) - (fog-max float :offset-assert 128) - (fog-min float :offset-assert 132) - (reset int32 :offset-assert 136) - (smooth-step float :offset-assert 140) - (smooth-t float :offset-assert 144) - (perspective matrix :inline :offset-assert 160) - (isometric matrix :inline :offset-assert 224) - (sprite-2d matrix :inline :offset-assert 288) - (sprite-2d-hvdf vector :inline :offset-assert 352) - (camera-rot matrix :inline :offset-assert 368) - (inv-camera-rot matrix :inline :offset-assert 432) - (inv-camera-rot-smooth matrix :inline :offset-assert 496) - (inv-camera-rot-smooth-from quaternion :inline :offset-assert 560) - (camera-temp matrix :inline :offset-assert 576) - (prev-camera-temp matrix :inline :offset-assert 640) - (prev-inv-camera-rot matrix :inline :offset-assert 704) - (prev-trans vector :inline :offset-assert 768) - (hmge-scale vector :inline :offset-assert 784) - (inv-hmge-scale vector :inline :offset-assert 800) - (hvdf-off vector :inline :offset-assert 816) - (guard vector :inline :offset-assert 832) - (vis-gifs vis-gif-tag 4 :inline :offset-assert 848) - (giftex uint128 :offset 848) - (gifgr uint128 :offset 864) - (giftex-trans uint128 :offset 880) - (gifgr-trans uint128 :offset 896) - (pfog0 float :offset-assert 912) - (pfog1 float :offset-assert 916) - (trans vector :inline :offset-assert 928) - (plane plane 4 :inline :offset-assert 944) - (guard-plane plane 4 :inline :offset-assert 1008) - (shrub-mat matrix :inline :offset-assert 1072) - (quat-other quaternion :inline :offset-assert 1136) - (trans-other vector :inline :offset-assert 1152) - (shrub-mat-other matrix :inline :offset-assert 1168) - (camera-temp-other matrix :inline :offset-assert 1232) - (camera-rot-other matrix :inline :offset-assert 1296) - (inv-camera-rot-other matrix :inline :offset-assert 1360) - (plane-other plane 4 :inline :offset-assert 1424) - (guard-plane-other plane 4 :inline :offset-assert 1488) - (mirror-trans vector :inline :offset-assert 1552) - (mirror-normal vector :inline :offset-assert 1568) - (fov-correction-factor float :offset-assert 1584) + ((d meters) + (f meters) + (fov degrees) + (x-ratio float) + (y-ratio float) + (x-pix float) + (x-clip float) + (x-clip-ratio-in float) + (x-clip-ratio-over float) + (y-pix float) + (y-clip float) + (y-clip-ratio-in float) + (y-clip-ratio-over float) + (cull-info cull-info :inline) + (fog-start meters) + (fog-end meters) + (fog-max float) + (fog-min float) + (reset int32) + (smooth-step float) + (smooth-t float) + (perspective matrix :inline) + (isometric matrix :inline) + (sprite-2d matrix :inline) + (sprite-2d-hvdf vector :inline) + (camera-rot matrix :inline) + (inv-camera-rot matrix :inline) + (inv-camera-rot-smooth matrix :inline) + (inv-camera-rot-smooth-from quaternion :inline) + (camera-temp matrix :inline) + (prev-camera-temp matrix :inline) + (prev-inv-camera-rot matrix :inline) + (prev-trans vector :inline) + (hmge-scale vector :inline) + (inv-hmge-scale vector :inline) + (hvdf-off vector :inline) + (guard vector :inline) + (vis-gifs vis-gif-tag 4 :inline) + (giftex uint128 :overlay-at (-> vis-gifs 0 fog0)) + (gifgr uint128 :offset 864) + (giftex-trans uint128 :offset 880) + (gifgr-trans uint128 :offset 896) + (pfog0 float) + (pfog1 float) + (trans vector :inline) + (plane plane 4 :inline) + (guard-plane plane 4 :inline) + (shrub-mat matrix :inline) + (quat-other quaternion :inline) + (trans-other vector :inline) + (shrub-mat-other matrix :inline) + (camera-temp-other matrix :inline) + (camera-rot-other matrix :inline) + (inv-camera-rot-other matrix :inline) + (plane-other plane 4 :inline) + (guard-plane-other plane 4 :inline) + (mirror-trans vector :inline) + (mirror-normal vector :inline) + (fov-correction-factor float) ) - (:methods (new (symbol type) _type_ 0)) - - :method-count-assert 9 - :size-assert #x634 - :flag-assert #x900000634 + (:methods + (new (symbol type) _type_) + ) ) diff --git a/goal_src/jak2/engine/gfx/math-camera.gc b/goal_src/jak2/engine/gfx/math-camera.gc index 7b6b81f0d79..364bb36455c 100644 --- a/goal_src/jak2/engine/gfx/math-camera.gc +++ b/goal_src/jak2/engine/gfx/math-camera.gc @@ -41,14 +41,13 @@ renderers that want a single matrix. ;; Without this corrector, the fogginess of the world would change as the fov changes ;; (for example, when jak gets on the zoomer, the fov changes slightly) (deftype fog-corrector (structure) - ((fog-end float :offset-assert 0) - (fog-start float :offset-assert 4) + ((fog-end float) + (fog-start float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) + +;; WARN: Return type mismatch float vs none. (defun fog-corrector-setup ((arg0 fog-corrector) (arg1 math-camera)) "Set the fog corrector based on the supplied math-camera" (set! (-> arg0 fog-end) (* (-> arg1 fog-end) (-> arg1 fov-correction-factor))) @@ -167,10 +166,10 @@ renderers that want a single matrix. (let ((f4-34 (/ f1-21 (* (-> arg0 d) (- (-> arg0 f) (-> arg0 d))))) (f3-30 (-> arg0 fov-correction-factor)) ) - (set! (-> arg0 perspective data 0) (* f3-30 (- (/ (-> arg0 x-pix) (* (-> arg0 x-ratio) (-> arg0 d)))))) - (set! (-> arg0 perspective data 5) (* f3-30 (- (/ (-> arg0 y-pix) (* (-> arg0 y-ratio) (-> arg0 d)))))) - (set! (-> arg0 perspective data 10) (* f3-30 (+ (-> arg0 f) (-> arg0 d)) f4-34)) - (set! (-> arg0 perspective data 11) (* (/ f3-30 (-> arg0 d)) f30-0)) + (set! (-> arg0 perspective vector 0 x) (* f3-30 (- (/ (-> arg0 x-pix) (* (-> arg0 x-ratio) (-> arg0 d)))))) + (set! (-> arg0 perspective vector 1 y) (* f3-30 (- (/ (-> arg0 y-pix) (* (-> arg0 y-ratio) (-> arg0 d)))))) + (set! (-> arg0 perspective vector 2 z) (* f3-30 (+ (-> arg0 f) (-> arg0 d)) f4-34)) + (set! (-> arg0 perspective vector 2 w) (* (/ f3-30 (-> arg0 d)) f30-0)) (set! (-> arg0 perspective trans z) (* -2.0 f4-34 (-> arg0 f) (-> arg0 d) f3-30)) ) (let ((f24-0 2048.0) @@ -226,28 +225,18 @@ renderers that want a single matrix. ) ) (set! (-> arg0 isometric trans w) f30-0) - (let ((f1-28 (-> arg0 perspective data 0)) - (f2-19 (-> arg0 perspective data 5)) - (f0-48 (* -1.9996 (-> arg0 perspective data 0))) + (let ((f1-28 (-> arg0 perspective vector 0 x)) + (f2-19 (-> arg0 perspective vector 1 y)) + (f0-48 (* -1.9996 (-> arg0 perspective vector 0 x))) ) (let ((v1-39 (-> arg0 sprite-2d))) - (set! (-> v1-39 data 0) f0-48) - (set! (-> v1-39 data 1) 0.0) - (set! (-> v1-39 data 2) 0.0) - (set! (-> v1-39 data 3) 0.0) - ) - (let ((v1-40 (&-> arg0 sprite-2d data 4))) - (set! (-> v1-40 0) 0.0) - (set! (-> v1-40 1) (- (* (/ f2-19 f1-28) f0-48))) - (set! (-> v1-40 2) 0.0) - (set! (-> v1-40 3) 0.0) - ) - (let ((v1-41 (&-> arg0 sprite-2d data 8))) - (set! (-> v1-41 0) 0.0) - (set! (-> v1-41 1) 0.0) - (set! (-> v1-41 2) (- f0-48)) - (set! (-> v1-41 3) 0.0) + (set! (-> v1-39 vector 0 x) f0-48) + (set! (-> v1-39 vector 0 y) 0.0) + (set! (-> v1-39 vector 0 z) 0.0) + (set! (-> v1-39 vector 0 w) 0.0) ) + (set-vector! (-> arg0 sprite-2d vector 1) 0.0 (- (* (/ f2-19 f1-28) f0-48)) 0.0 0.0) + (set-vector! (-> arg0 sprite-2d vector 2) 0.0 0.0 (- f0-48) 0.0) (set-vector! (-> arg0 sprite-2d trans) 0.0 0.0 (* 500000000.0 f0-48) (* 60.0 f0-48 (-> arg0 pfog0))) ) (set! (-> arg0 sprite-2d-hvdf quad) (-> arg0 hvdf-off quad)) @@ -327,9 +316,9 @@ renderers that want a single matrix. (matrix-identity! (-> gp-0 inv-camera-rot-other)) (matrix-identity! (-> gp-0 camera-rot-other)) (matrix-identity! (-> gp-0 camera-temp-other)) - (set! (-> gp-0 isometric data 0) 1.0) - (set! (-> gp-0 isometric data 5) 0.5) - (set! (-> gp-0 isometric data 10) -1.0) + (set! (-> gp-0 isometric vector 0 x) 1.0) + (set! (-> gp-0 isometric vector 1 y) 0.5) + (set! (-> gp-0 isometric vector 2 z) -1.0) (set! (-> gp-0 reset) 1) (set! (-> gp-0 smooth-step) 0.0) (set! (-> gp-0 smooth-t) 0.0) @@ -579,12 +568,13 @@ renderers that want a single matrix. ) ) +;; WARN: Return type mismatch vector vs none. (defun reverse-transform-point! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) "Likely transform arg3 from screen space to world coords, using arg1/arg2 for... something." (let* ((v1-1 (-> *math-camera* perspective)) (s2-0 (-> *math-camera* camera-rot)) - (f30-0 (* (/ (-> v1-1 data 11) (-> v1-1 data 0)) (-> *math-camera* hmge-scale w))) - (f28-0 (* (/ (-> v1-1 data 11) (-> v1-1 data 5)) (-> *math-camera* hmge-scale w))) + (f30-0 (* (/ (-> v1-1 vector 2 w) (-> v1-1 vector 0 x)) (-> *math-camera* hmge-scale w))) + (f28-0 (* (/ (-> v1-1 vector 2 w) (-> v1-1 vector 1 y)) (-> *math-camera* hmge-scale w))) (s4-0 (vector-rotate*! (new 'stack-no-clear 'vector) arg2 s2-0)) (v1-3 (vector-matrix*! (new 'stack-no-clear 'vector) arg1 s2-0)) (f0-8 (/ (+ (* (-> s4-0 x) (-> v1-3 x)) (* (-> s4-0 y) (-> v1-3 y)) (* (-> s4-0 z) (-> v1-3 z))) @@ -606,7 +596,7 @@ renderers that want a single matrix. (none) ) - +;; WARN: Return type mismatch symbol vs none. (defun init-for-transform ((arg0 matrix)) "Sets up VU0 registers with camera info. This is probably a very old function and it's only used by camera debug. @@ -712,7 +702,3 @@ renderers that want a single matrix. (none) ) ) - - - - diff --git a/goal_src/jak2/engine/gfx/mood/mood-funcs.gc b/goal_src/jak2/engine/gfx/mood/mood-funcs.gc index 9cb37c3a334..301369095b4 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-funcs.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-funcs.gc @@ -25,13 +25,10 @@ ) (deftype ruins-states (structure) - ((light light-state :inline :offset-assert 0) - (spec-0 sp-field-init-spec :offset-assert 8) - (spec-1 sp-field-init-spec :offset-assert 12) + ((light light-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -80,14 +77,11 @@ ) (deftype strip-states (structure) - ((light0 light-state :inline :offset-assert 0) - (light1 light-state :inline :offset-assert 8) - (spec-0 sp-field-init-spec :offset-assert 16) - (spec-1 sp-field-init-spec :offset-assert 20) + ((light0 light-state :inline) + (light1 light-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) @@ -144,12 +138,9 @@ ) (deftype ctywide-states (structure) - ((light light-state :inline :offset-assert 0) - (flame flames-state :inline :offset-assert 8) + ((light light-state :inline) + (flame flames-state :inline) ) - :method-count-assert 9 - :size-assert #xf - :flag-assert #x90000000f ) @@ -185,11 +176,8 @@ ) (deftype ctyind-states (structure) - ((light light-state :inline :offset-assert 0) + ((light light-state :inline) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -223,16 +211,13 @@ ) (deftype ctysluma-states (structure) - ((light light-state :inline :offset-assert 0) - (neon light-state :inline :offset-assert 8) - (flame flames-state :inline :offset-assert 16) - (spec-0 sp-field-init-spec :offset-assert 24) - (spec-1 sp-field-init-spec :offset-assert 28) - (neon-min-bright float :offset-assert 32) + ((light light-state :inline) + (neon light-state :inline) + (flame flames-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) + (neon-min-bright float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) @@ -282,14 +267,11 @@ ) (deftype ctyslumb-states (structure) - ((light light-state :inline :offset-assert 0) - (flame flames-state :inline :offset-assert 8) - (spec-0 sp-field-init-spec :offset-assert 16) - (spec-1 sp-field-init-spec :offset-assert 20) + ((light light-state :inline) + (flame flames-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) @@ -339,13 +321,10 @@ ) (deftype ctyslumc-states (structure) - ((light light-state :inline :offset-assert 0) - (spec-0 sp-field-init-spec :offset-assert 8) - (spec-1 sp-field-init-spec :offset-assert 12) + ((light light-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -390,13 +369,10 @@ ) (deftype ctyport-states (structure) - ((light light-state :inline :offset-assert 0) - (spec-0 sp-field-init-spec :offset-assert 8) - (neon-min-bright float :offset-assert 12) + ((light light-state :inline) + (spec-0 sp-field-init-spec) + (neon-min-bright float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -453,12 +429,9 @@ ) (deftype ctymarka-states (structure) - ((light light-state :inline :offset-assert 0) - (blink float :offset-assert 8) + ((light light-state :inline) + (blink float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -486,12 +459,9 @@ ) (deftype ctymarkb-states (structure) - ((light light-state :inline :offset-assert 0) - (blink float :offset-assert 8) + ((light light-state :inline) + (blink float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -529,13 +499,10 @@ ) (deftype palcab-states (structure) - ((light light-state :inline :offset-assert 0) - (turret-value float :offset-assert 8) - (electricity electricity-state :inline :offset-assert 12) + ((light light-state :inline) + (turret-value float) + (electricity electricity-state :inline) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -588,12 +555,9 @@ ) (deftype stadium-states (structure) - ((light light-state :inline :offset-assert 0) - (flame flames-state :inline :offset-assert 8) + ((light light-state :inline) + (flame flames-state :inline) ) - :method-count-assert 9 - :size-assert #xf - :flag-assert #x90000000f ) @@ -645,13 +609,10 @@ ) (deftype stadiumb-states (structure) - ((light light-state :inline :offset-assert 0) - (shield-count float :offset-assert 8) - (shield float :offset-assert 12) + ((light light-state :inline) + (shield-count float) + (shield float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -689,12 +650,9 @@ ) (deftype skatea-states (structure) - ((light light-state :inline :offset-assert 0) - (flame flames-state :inline :offset-assert 8) + ((light light-state :inline) + (flame flames-state :inline) ) - :method-count-assert 9 - :size-assert #xf - :flag-assert #x90000000f ) @@ -713,13 +671,10 @@ ) (deftype ltentout-states (structure) - ((light light-state :inline :offset-assert 0) - (flame flames-state :inline :offset-assert 8) - (totem flames-state :inline :offset-assert 16) + ((light light-state :inline) + (flame flames-state :inline) + (totem flames-state :inline) ) - :method-count-assert 9 - :size-assert #x17 - :flag-assert #x900000017 ) @@ -748,19 +703,16 @@ ) (deftype mountain-states (structure) - ((light0 light-state :inline :offset-assert 0) - (light1 light-state :inline :offset-assert 8) - (spec-0 sp-field-init-spec :offset-assert 16) - (spec-1 sp-field-init-spec :offset-assert 20) - (spec-2 sp-field-init-spec :offset-assert 24) - (spec-3 sp-field-init-spec :offset-assert 28) - (spec-4 sp-field-init-spec :offset-assert 32) - (spec-5 sp-field-init-spec :offset-assert 36) - (spec-6 sp-field-init-spec :offset-assert 40) + ((light0 light-state :inline) + (light1 light-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) + (spec-2 sp-field-init-spec) + (spec-3 sp-field-init-spec) + (spec-4 sp-field-init-spec) + (spec-5 sp-field-init-spec) + (spec-6 sp-field-init-spec) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) @@ -865,11 +817,8 @@ ) (deftype forest-states (structure) - ((light light-state :inline :offset-assert 0) + ((light light-state :inline) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -886,12 +835,9 @@ ) (deftype atoll-states (structure) - ((light light-state :inline :offset-assert 0) - (explosion float :offset-assert 8) + ((light light-state :inline) + (explosion float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -946,17 +892,14 @@ ) (deftype drill-states (structure) - ((fire-floor float :offset-assert 0) - (fire-floor-fade float :offset-assert 4) - (fire-floor-flag symbol :offset-assert 8) - (flame flames-state :inline :offset-assert 12) - (electricity electricity-state 2 :inline :offset-assert 20) - (pulse pulse-state :inline :offset 52) - (light-flag basic :offset-assert 56) + ((fire-floor float) + (fire-floor-fade float) + (fire-floor-flag symbol) + (flame flames-state :inline) + (electricity electricity-state 2 :inline) + (pulse pulse-state :inline :offset 52) + (light-flag basic) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) @@ -1078,15 +1021,12 @@ ) (deftype drillb-states (structure) - ((fire-floor float :offset-assert 0) - (fire-floor-fade float :offset-assert 4) - (fire-floor-flag symbol :offset-assert 8) - (pulse pulse-state :inline :offset-assert 12) - (light-flag symbol :offset-assert 16) + ((fire-floor float) + (fire-floor-fade float) + (fire-floor-flag symbol) + (pulse pulse-state :inline) + (light-flag symbol) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -1128,12 +1068,9 @@ ) (deftype casboss-states (structure) - ((light light-state :inline :offset-assert 0) - (explosion float :offset-assert 8) + ((light light-state :inline) + (explosion float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -1206,14 +1143,11 @@ ) (deftype caspad-states (structure) - ((light light-state :inline :offset-assert 0) - (red float :offset-assert 8) - (white float :offset-assert 12) - (white-count int32 :offset-assert 16) + ((light light-state :inline) + (red float) + (white float) + (white-count int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -1246,12 +1180,9 @@ ) (deftype palout-states (structure) - ((light light-state :inline :offset-assert 0) - (flame flames-state :inline :offset-assert 8) + ((light light-state :inline) + (flame flames-state :inline) ) - :method-count-assert 9 - :size-assert #xf - :flag-assert #x90000000f ) @@ -1284,11 +1215,8 @@ ) (deftype palroof-states (structure) - ((electricity electricity-state 2 :inline :offset-assert 0) + ((electricity electricity-state 2 :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) @@ -1324,12 +1252,9 @@ ) (deftype palent-states (structure) - ((flame flames-state :inline :offset-assert 0) - (turret-value float :offset-assert 8) + ((flame flames-state :inline) + (turret-value float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -1362,14 +1287,11 @@ ) (deftype nest-states (structure) - ((light light-state :inline :offset-assert 0) - (green-flag symbol :offset-assert 8) - (green float :offset-assert 12) - (green-noise float :offset-assert 16) + ((light light-state :inline) + (green-flag symbol) + (green float) + (green-noise float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -1423,12 +1345,9 @@ ) (deftype village1-states (structure) - ((interp float :offset-assert 0) - (interp-flag symbol :offset-assert 4) + ((interp float) + (interp-flag symbol) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -1510,12 +1429,9 @@ ) (deftype consite-states (structure) - ((light light-state :inline :offset-assert 0) - (flash float :offset-assert 8) + ((light light-state :inline) + (flash float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -1563,11 +1479,8 @@ ) (deftype mincan-states (structure) - ((beams float 2 :offset-assert 0) + ((beams float 2) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) diff --git a/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc b/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc index 5d62f1d2ba5..eca27e71d93 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc @@ -9,9 +9,6 @@ (deftype default-interior-states (structure) () - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) @@ -38,14 +35,11 @@ ) (deftype vinroom-states (structure) - ((main float :offset-assert 0) - (flicker1 float :offset-assert 4) - (flicker2 float :offset-assert 8) - (warp float :offset-assert 12) + ((main float) + (flicker1 float) + (flicker2 float) + (warp float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -124,12 +118,9 @@ ) (deftype hideout-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) ) - :method-count-assert 9 - :size-assert #xf - :flag-assert #x90000000f ) @@ -195,7 +186,12 @@ (let ((a0-10 (new 'stack-no-clear 'sphere)) (a1-4 (-> *math-camera* trans)) ) - (set-vector! a0-10 4898816.0 32768.0 245760.0 1.0) + (let ((v1-6 a0-10)) + (set! (-> v1-6 x) 4898816.0) + (set! (-> v1-6 y) 32768.0) + (set! (-> v1-6 z) 245760.0) + (set! (-> v1-6 r) 1.0) + ) (let ((f0-5 (get-sphere-interp a0-10 a1-4 61440.0 69632.0))) (set-vector! (-> arg0 times 0) 1.0 1.0 1.0 1.0) (vector-lerp! @@ -223,48 +219,45 @@ ) (deftype hiphog-states (structure) - ((spec-m-on sp-field-init-spec :offset-assert 0) - (spec-o-on sp-field-init-spec :offset-assert 4) - (spec-r-on sp-field-init-spec :offset-assert 8) - (spec-g-on sp-field-init-spec :offset-assert 12) - (spec-a-on sp-field-init-spec :offset-assert 16) - (spec-n-on sp-field-init-spec :offset-assert 20) - (spec-m-off sp-field-init-spec :offset-assert 24) - (spec-o-off sp-field-init-spec :offset-assert 28) - (spec-r-off sp-field-init-spec :offset-assert 32) - (spec-g-off sp-field-init-spec :offset-assert 36) - (spec-a-off sp-field-init-spec :offset-assert 40) - (spec-n-off sp-field-init-spec :offset-assert 44) - (spec-hog-1-on sp-field-init-spec :offset-assert 48) - (spec-hog-2-on sp-field-init-spec :offset-assert 52) - (spec-hiphog-on sp-field-init-spec :offset-assert 56) - (spec-hiphog-off sp-field-init-spec :offset-assert 60) - (spec-hiphog-on2 sp-field-init-spec :offset-assert 64) - (spec-hiphog-off2 sp-field-init-spec :offset-assert 68) - (spec-clock-sun sp-field-init-spec :offset-assert 72) - (spec-clock-moon sp-field-init-spec :offset-assert 76) - (door entity :offset-assert 80) - (m-on uint8 :offset-assert 84) - (o-on uint8 :offset-assert 85) - (r-on uint8 :offset-assert 86) - (g-on uint8 :offset-assert 87) - (a-on uint8 :offset-assert 88) - (n-on uint8 :offset-assert 89) - (m-off uint8 :offset-assert 90) - (o-off uint8 :offset-assert 91) - (r-off uint8 :offset-assert 92) - (g-off uint8 :offset-assert 93) - (a-off uint8 :offset-assert 94) - (n-off uint8 :offset-assert 95) - (hog-on uint8 :offset-assert 96) - (hiphog-on uint8 :offset-assert 97) - (hiphog-off uint8 :offset-assert 98) - (clock-sun uint8 :offset-assert 99) - (clock-moon uint8 :offset-assert 100) + ((spec-m-on sp-field-init-spec) + (spec-o-on sp-field-init-spec) + (spec-r-on sp-field-init-spec) + (spec-g-on sp-field-init-spec) + (spec-a-on sp-field-init-spec) + (spec-n-on sp-field-init-spec) + (spec-m-off sp-field-init-spec) + (spec-o-off sp-field-init-spec) + (spec-r-off sp-field-init-spec) + (spec-g-off sp-field-init-spec) + (spec-a-off sp-field-init-spec) + (spec-n-off sp-field-init-spec) + (spec-hog-1-on sp-field-init-spec) + (spec-hog-2-on sp-field-init-spec) + (spec-hiphog-on sp-field-init-spec) + (spec-hiphog-off sp-field-init-spec) + (spec-hiphog-on2 sp-field-init-spec) + (spec-hiphog-off2 sp-field-init-spec) + (spec-clock-sun sp-field-init-spec) + (spec-clock-moon sp-field-init-spec) + (door entity) + (m-on uint8) + (o-on uint8) + (r-on uint8) + (g-on uint8) + (a-on uint8) + (n-on uint8) + (m-off uint8) + (o-off uint8) + (r-off uint8) + (g-off uint8) + (a-off uint8) + (n-off uint8) + (hog-on uint8) + (hiphog-on uint8) + (hiphog-off uint8) + (clock-sun uint8) + (clock-moon uint8) ) - :method-count-assert 9 - :size-assert #x65 - :flag-assert #x900000065 ) @@ -731,16 +724,13 @@ ) (deftype sewer-states (structure) - ((light-flag symbol :offset-assert 0) - (light-count uint32 :offset-assert 4) - (turret-value float :offset-assert 8) - (spec-light-center sp-field-init-spec :offset-assert 12) - (spec-light sp-field-init-spec :offset-assert 16) - (explosion float :offset-assert 20) + ((light-flag symbol) + (light-count uint32) + (turret-value float) + (spec-light-center sp-field-init-spec) + (spec-light sp-field-init-spec) + (explosion float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) @@ -961,16 +951,13 @@ ) (deftype onintent-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (green-flame flames-state :inline :offset-assert 24) - (totem0 flames-state :inline :offset-assert 32) - (totem1 flames-state :inline :offset-assert 40) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (green-flame flames-state :inline) + (totem0 flames-state :inline) + (totem1 flames-state :inline) ) - :method-count-assert 9 - :size-assert #x2f - :flag-assert #x90000002f ) @@ -1006,20 +993,17 @@ ) (deftype oracle-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (blue-flame flames-state :inline :offset-assert 24) - (door-entity entity :offset-assert 32) - (door-current float :offset-assert 36) - (door-target float :offset-assert 40) - (purple-flag symbol :offset-assert 44) - (purple float :offset-assert 48) - (purple-noise float :offset-assert 52) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (blue-flame flames-state :inline) + (door-entity entity) + (door-current float) + (door-target float) + (purple-flag symbol) + (purple float) + (purple-noise float) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) @@ -1090,15 +1074,12 @@ ) (deftype tomba-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (light light-state :inline :offset-assert 24) - (gem-light float :offset-assert 32) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (light light-state :inline) + (gem-light float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) @@ -1168,14 +1149,11 @@ ) (deftype tombb-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (light light-state :inline :offset-assert 24) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (light light-state :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) @@ -1234,14 +1212,11 @@ ) (deftype tombc-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (electricity electricity-state :inline :offset-assert 24) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (electricity electricity-state :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) @@ -1282,15 +1257,12 @@ ) (deftype tombd-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (light light-state :inline :offset-assert 24) - (gem-light float :offset-assert 32) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (light light-state :inline) + (gem-light float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) @@ -1353,15 +1325,12 @@ ) (deftype tombe-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (light light-state :inline :offset-assert 24) - (gem-light float :offset-assert 32) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (light light-state :inline) + (gem-light float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) @@ -1387,15 +1356,12 @@ ) (deftype tombboss-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (light light-state :inline :offset-assert 24) - (gem-light float :offset-assert 32) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (light light-state :inline) + (gem-light float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) @@ -1544,11 +1510,8 @@ ) (deftype fortress-states (structure) - ((pulse pulse-state :inline :offset-assert 0) + ((pulse pulse-state :inline) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -1614,13 +1577,10 @@ ) (deftype fordumpa-states (structure) - ((turret-value float 4 :offset-assert 0) - (pulse pulse-state :inline :offset-assert 16) - (electricity electricity-state :inline :offset-assert 20) + ((turret-value float 4) + (pulse pulse-state :inline) + (electricity electricity-state :inline) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) @@ -1680,14 +1640,11 @@ ) (deftype fordumpc-states (structure) - ((light-flag symbol :offset-assert 0) - (pulse0 pulse-state :inline :offset-assert 4) - (pulse1 pulse-state :inline :offset-assert 8) - (strobe strobe-state :inline :offset-assert 12) + ((light-flag symbol) + (pulse0 pulse-state :inline) + (pulse1 pulse-state :inline) + (strobe strobe-state :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -1733,12 +1690,9 @@ ) (deftype forresca-states (structure) - ((pulse pulse-state :inline :offset-assert 0) - (electricity electricity-state 2 :inline :offset 4) + ((pulse pulse-state :inline) + (electricity electricity-state 2 :inline :offset 4) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) @@ -1779,12 +1733,9 @@ ) (deftype forrescb-states (structure) - ((electricity electricity-state 2 :inline :offset-assert 0) - (turret float 4 :offset-assert 32) + ((electricity electricity-state 2 :inline) + (turret float 4) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) @@ -1845,14 +1796,11 @@ ) (deftype prison-states (structure) - ((pulse float :offset-assert 0) - (angle float :offset-assert 4) - (torture float :offset-assert 8) - (torture-flag symbol :offset-assert 12) + ((pulse float) + (angle float) + (torture float) + (torture-flag symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -1930,18 +1878,15 @@ ) (deftype under-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (rot float :offset-assert 16) - (rot2 float :offset-assert 20) - (time float :offset-assert 24) - (laser float :offset-assert 28) - (fog-interp float :offset-assert 32) - (flicker float :offset-assert 36) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (rot float) + (rot2 float) + (time float) + (laser float) + (fog-interp float) + (flicker float) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) @@ -2144,11 +2089,8 @@ ) (deftype gungame-states (structure) - ((florescent florescent-state :inline :offset-assert 0) + ((florescent florescent-state :inline) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) @@ -2184,14 +2126,11 @@ ) (deftype dig1-states (structure) - ((pulse0 pulse-state :inline :offset-assert 0) - (pulse1 pulse-state :inline :offset-assert 4) - (explosion float :offset-assert 8) - (drillbit float :offset-assert 12) + ((pulse0 pulse-state :inline) + (pulse1 pulse-state :inline) + (explosion float) + (drillbit float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -2418,20 +2357,17 @@ ) (deftype vortex-states (structure) - ((time float :offset-assert 0) - (level float :offset-assert 4) - (delta float :offset-assert 8) - (scale float :offset-assert 12) - (flash float :offset-assert 16) - (num int32 :offset-assert 20) - (white symbol :offset-assert 24) - (white-count float :offset-assert 28) - (pos vector :inline :offset-assert 32) - (dir vector :inline :offset-assert 48) + ((time float) + (level float) + (delta float) + (scale float) + (flash float) + (num int32) + (white symbol) + (white-count float) + (pos vector :inline) + (dir vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) @@ -2575,14 +2511,11 @@ ) (deftype nestb-states (structure) - ((pulse pulse-state :inline :offset-assert 0) - (rot float :offset-assert 4) - (purple float :offset-assert 8) - (purple-noise float :offset-assert 12) + ((pulse pulse-state :inline) + (rot float) + (purple float) + (purple-noise float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -2656,13 +2589,10 @@ ) (deftype consiteb-states (structure) - ((flicker float :offset-assert 0) - (flicker-count float :offset-assert 4) - (flicker-state int32 :offset-assert 8) + ((flicker float) + (flicker-count float) + (flicker-state int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -2729,14 +2659,11 @@ ) (deftype castle-states (structure) - ((electricity electricity-state :inline :offset-assert 0) - (pulse pulse-state 2 :inline :offset-assert 8) - (rot float :offset-assert 40) - (robot-rot float :offset-assert 44) + ((electricity electricity-state :inline) + (pulse pulse-state 2 :inline) + (rot float) + (robot-rot float) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) @@ -2871,9 +2798,6 @@ (deftype garage-states (structure) () - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) @@ -2933,9 +2857,6 @@ (deftype palshaft-states (structure) () - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) diff --git a/goal_src/jak2/engine/gfx/mood/mood-h.gc b/goal_src/jak2/engine/gfx/mood/mood-h.gc index 11380d4843e..4cf401d95a5 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-h.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-h.gc @@ -12,262 +12,202 @@ ;; DECOMP BEGINS (deftype mood-channel (structure) - ((data float 24 :offset-assert 0) - (vecs vector4 6 :inline :offset 0) + ((data float 24) + (vecs vector4 6 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) (deftype mood-channel-group (structure) - ((data mood-channel 4 :inline :offset-assert 0) + ((data mood-channel 4 :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) (deftype mood-fog (structure) - ((fog-color vector :inline :offset-assert 0) - (fog-dists vector :inline :offset-assert 16) - (fog-start meters :offset 16) - (fog-end meters :offset 20) - (fog-max float :offset 24) - (fog-min float :offset 28) - (erase-color vector :inline :offset-assert 32) + ((fog-color vector :inline) + (fog-dists vector :inline) + (fog-start meters :overlay-at (-> fog-dists data 0)) + (fog-end meters :overlay-at (-> fog-dists data 1)) + (fog-max float :overlay-at (-> fog-dists data 2)) + (fog-min float :overlay-at (-> fog-dists data 3)) + (erase-color vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype mood-fog-table (structure) - ((data mood-fog 8 :inline :offset-assert 0) - (data-raw uint128 24 :offset 0) + ((data mood-fog 8 :inline) + (data-raw uint128 24 :overlay-at data) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) (deftype mood-color (structure) - ((lgt-color vector :inline :offset-assert 0) - (amb-color vector :inline :offset-assert 16) + ((lgt-color vector :inline) + (amb-color vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype mood-direction-table (structure) - ((data vector 4 :inline :offset-assert 0) + ((data vector 4 :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype mood-color-table (structure) - ((data mood-color 8 :inline :offset-assert 0) - (data-raw uint128 16 :offset 0) + ((data mood-color 8 :inline) + (data-raw uint128 16 :overlay-at data) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) (deftype mood-sky-table (structure) - ((data vector 8 :inline :offset-assert 0) + ((data vector 8 :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) (deftype mood-clouds (structure) - ((cloud-min float :offset-assert 0) - (cloud-max float :offset-assert 4) + ((cloud-min float) + (cloud-max float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype mood-weather (structure) - ((data float 2 :offset-assert 0) - (cloud float :offset 0) - (fog float :offset 4) + ((data float 2) + (cloud float :overlay-at (-> data 0)) + (fog float :overlay-at (-> data 1)) ) :pack-me :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype mood-iweather (structure) - ((data int32 2 :offset-assert 0) - (cloud int32 :offset 0) - (fog int32 :offset 4) + ((data int32 2) + (cloud int32 :overlay-at (-> data 0)) + (fog int32 :overlay-at (-> data 1)) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype mood-range (structure) - ((data float 4 :offset-assert 0) - (min-cloud float :offset 0) - (max-cloud float :offset 4) - (min-fog float :offset 8) - (max-fog float :offset 12) - (quad uint128 :offset 0) + ((data float 4) + (min-cloud float :overlay-at (-> data 0)) + (max-cloud float :overlay-at (-> data 1)) + (min-fog float :overlay-at (-> data 2)) + (max-fog float :overlay-at (-> data 3)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype mood-filters-table (structure) - ((data vector 8 :inline :offset-assert 0) + ((data vector 8 :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) (deftype mood-table (basic) - ((mood-fog-table mood-fog-table :offset-assert 4) - (mood-color-table mood-color-table :offset-assert 8) - (mood-channel-group mood-channel-group :offset-assert 12) - (mood-direction-table mood-direction-table :offset-assert 16) - (mood-sky-table mood-sky-table :offset-assert 20) - (mood-interp-table sky-color-day :offset-assert 24) + ((mood-fog-table mood-fog-table) + (mood-color-table mood-color-table) + (mood-channel-group mood-channel-group) + (mood-direction-table mood-direction-table) + (mood-sky-table mood-sky-table) + (mood-interp-table sky-color-day) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype mood-context-core (structure) - ((current-fog mood-fog :inline :offset-assert 0) - (current-sky-color vector :inline :offset-assert 48) - (current-env-color vector :inline :offset-assert 64) - (current-prt-color vector :inline :offset-assert 80) - (current-shadow-color vector :inline :offset-assert 96) + ((current-fog mood-fog :inline) + (current-sky-color vector :inline) + (current-env-color vector :inline) + (current-prt-color vector :inline) + (current-shadow-color vector :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) (deftype mood-context-core2 (mood-context-core) - ((light-group light-group 8 :inline :offset-assert 112) + ((light-group light-group 8 :inline) ) - :method-count-assert 9 - :size-assert #x670 - :flag-assert #x900000670 ) (deftype mood-context-core3 (mood-context-core2) - ((times vector 8 :inline :offset-assert 1648) + ((times vector 8 :inline) ) - :method-count-assert 9 - :size-assert #x6f0 - :flag-assert #x9000006f0 ) (deftype mood-context (mood-context-core3) "`state` holds an arbitrary state structure, ie `[[sewer-states]]` and is used when updating the mood. This means that an individual state structure must be less than 128 bytes" - ((itimes vector4w 4 :inline :offset-assert 1776) - (state uint32 32 :offset-assert 1840) - (data uint128 123 :offset 0) + ((itimes vector4w 4 :inline) + (state uint32 32) + (data uint128 123 :overlay-at (-> current-fog fog-color data 0)) ) - :method-count-assert 9 - :size-assert #x7b0 - :flag-assert #x9000007b0 ) (deftype mood-control-work (structure) - ((weather mood-weather :inline :offset-assert 0) - (iweather mood-iweather :inline :offset-assert 8) - (interp mood-weather :inline :offset-assert 16) - (index int32 4 :offset-assert 24) - (color-interp float :offset-assert 40) - (color-index int32 2 :offset-assert 44) - (channel-interp float :offset-assert 52) - (channel-index int32 2 :offset-assert 56) - (cloud-interp float :offset-assert 64) - (cloud-index int32 2 :offset-assert 68) + ((weather mood-weather :inline) + (iweather mood-iweather :inline) + (interp mood-weather :inline) + (index int32 4) + (color-interp float) + (color-index int32 2) + (channel-interp float) + (channel-index int32 2) + (cloud-interp float) + (cloud-index int32 2) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) (deftype mood-control (mood-table) - ((mood-clouds mood-clouds :offset-assert 28) - (current-interp mood-weather :inline :offset-assert 32) - (target-interp mood-weather :inline :offset-assert 40) - (speed-interp mood-weather :inline :offset-assert 48) - (range mood-range :inline :offset-assert 64) - (time-until-random mood-weather :inline :offset-assert 80) - (time-until-random-min mood-weather :inline :offset-assert 88) - (time-until-random-max mood-weather :inline :offset-assert 96) - (display-flag symbol :offset-assert 104) - (overide-weather-flag symbol :offset-assert 108) - (overide mood-weather :inline :offset-assert 112) - (lightning-index int32 :offset-assert 120) - (lightning-val int32 :offset-assert 124) - (lightning-time int32 :offset-assert 128) - (lightning-time2 float :offset-assert 132) - (lightning-flash float :offset-assert 136) - (lightning-id sound-id :offset-assert 140) - (lightning-count0 uint32 :offset-assert 144) - (lightning-count1 uint32 :offset-assert 148) - (lightning-count2 uint32 :offset-assert 152) - (rain-id sound-id :offset-assert 156) - (sound-pitch float :offset-assert 160) - (fogs mood-fog-table 9 :offset-assert 164) - (colors mood-color-table 3 :offset-assert 200) - (channels mood-channel-group 3 :offset-assert 212) - (clouds mood-clouds 9 :offset-assert 224) + ((mood-clouds mood-clouds) + (current-interp mood-weather :inline) + (target-interp mood-weather :inline) + (speed-interp mood-weather :inline) + (range mood-range :inline) + (time-until-random mood-weather :inline) + (time-until-random-min mood-weather :inline) + (time-until-random-max mood-weather :inline) + (display-flag symbol) + (overide-weather-flag symbol) + (overide mood-weather :inline) + (lightning-index int32) + (lightning-val int32) + (lightning-time int32) + (lightning-time2 float) + (lightning-flash float) + (lightning-id sound-id) + (lightning-count0 uint32) + (lightning-count1 uint32) + (lightning-count2 uint32) + (rain-id sound-id) + (sound-pitch float) + (fogs mood-fog-table 9) + (colors mood-color-table 3) + (channels mood-channel-group 3) + (clouds mood-clouds 9) ) - :method-count-assert 19 - :size-assert #x104 - :flag-assert #x1300000104 (:methods - (init-weather! (_type_) none :behavior process 9) - (update-mood-weather! (_type_ float float float float) none 10) - (update-mood-range! (_type_ float float float float) none 11) - (set-time-for-random-weather! (_type_ float float) none 12) - (apply-mood-clouds-and-fog (_type_ mood-control-work) none 13) - (apply-mood-color (_type_ mood-control-work) none 14) - (apply-mood-channels (_type_ mood-control-work) none 15) - (adjust-num-clouds! (_type_ mood-control-work) none 16) - (gen-lightning-and-thunder! (_type_) number 17) - (play-or-stop-lightning! (_type_ sound-spec vector) sound-id 18) + (init-weather! (_type_) none :behavior process) + (update-mood-weather! (_type_ float float float float) none) + (update-mood-range! (_type_ float float float float) none) + (set-time-for-random-weather! (_type_ float float) none) + (apply-mood-clouds-and-fog (_type_ mood-control-work) none) + (apply-mood-color (_type_ mood-control-work) none) + (apply-mood-channels (_type_ mood-control-work) none) + (adjust-num-clouds! (_type_ mood-control-work) none) + (gen-lightning-and-thunder! (_type_) number) + (play-or-stop-lightning! (_type_ sound-spec vector) sound-id) ) ) diff --git a/goal_src/jak2/engine/gfx/mood/mood.gc b/goal_src/jak2/engine/gfx/mood/mood.gc index cf82d010644..6c888168bdc 100644 --- a/goal_src/jak2/engine/gfx/mood/mood.gc +++ b/goal_src/jak2/engine/gfx/mood/mood.gc @@ -386,15 +386,12 @@ ) (deftype flames-state (structure) - ((time float :offset-assert 0) - (index uint8 :offset-assert 4) - (length uint8 :offset-assert 5) - (height uint8 :offset-assert 6) + ((time float) + (index uint8) + (length uint8) + (height uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x7 - :flag-assert #x900000007 ) @@ -491,13 +488,10 @@ ) (deftype light-state (structure) - ((time float :offset-assert 0) - (fade float :offset-assert 4) + ((time float) + (fade float) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -568,11 +562,8 @@ ) (deftype lava-state (structure) - ((lava float :offset-assert 0) + ((lava float) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -590,12 +581,9 @@ ) (deftype flicker-state (structure) - ((flicker-off uint8 :offset-assert 0) - (flicker-on uint8 :offset-assert 1) + ((flicker-off uint8) + (flicker-on uint8) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) @@ -627,13 +615,10 @@ ) (deftype florescent-state (structure) - ((value float :offset-assert 0) - (delay int8 :offset-assert 4) - (delay2 int8 :offset-assert 5) + ((value float) + (delay int8) + (delay2 int8) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) @@ -664,13 +649,10 @@ ) (deftype electricity-state (structure) - ((value float :offset-assert 0) - (scale float :offset-assert 4) + ((value float) + (scale float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -686,12 +668,9 @@ ) (deftype pulse-state (structure) - ((pulse float :offset-assert 0) + ((pulse float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -707,12 +686,9 @@ ) (deftype strobe-state (structure) - ((time float :offset-assert 0) + ((time float) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -738,7 +714,7 @@ ) ) -(defmethod apply-mood-clouds-and-fog mood-control ((this mood-control) (arg0 mood-control-work)) +(defmethod apply-mood-clouds-and-fog ((this mood-control) (arg0 mood-control-work)) (let ((v1-0 (-> this mood-fog-table))) (dotimes (a0-1 24) (set! (-> v1-0 data-raw a0-1) (the-as uint128 0)) @@ -817,7 +793,7 @@ (none) ) -(defmethod apply-mood-color mood-control ((this mood-control) (arg0 mood-control-work)) +(defmethod apply-mood-color ((this mood-control) (arg0 mood-control-work)) (let ((v1-0 (-> this mood-color-table))) (dotimes (a0-1 16) (set! (-> v1-0 data-raw a0-1) (the-as uint128 0)) @@ -855,7 +831,7 @@ (none) ) -(defmethod apply-mood-channels mood-control ((this mood-control) (arg0 mood-control-work)) +(defmethod apply-mood-channels ((this mood-control) (arg0 mood-control-work)) (let ((v1-0 (-> this mood-channel-group))) (dotimes (a0-1 24) (set! (-> v1-0 data 0 vecs a0-1 quad) (the-as uint128 0)) @@ -893,7 +869,7 @@ (none) ) -(defmethod adjust-num-clouds! mood-control ((this mood-control) (arg0 mood-control-work)) +(defmethod adjust-num-clouds! ((this mood-control) (arg0 mood-control-work)) (let ((v1-0 (-> this mood-clouds))) (set! (-> v1-0 cloud-min) 0.0) (set! (-> v1-0 cloud-max) 0.0) @@ -919,7 +895,7 @@ ) ;; WARN: Return type mismatch int vs sound-id. -(defmethod play-or-stop-lightning! mood-control ((this mood-control) (arg0 sound-spec) (arg1 vector)) +(defmethod play-or-stop-lightning! ((this mood-control) (arg0 sound-spec) (arg1 vector)) "Handles playing/stopping of the lightning sound - Plays the lightning sound if we are not loading and `lightning-id` is zero - Stops the lightning sound first if `lightning-id` is non-zero @@ -950,7 +926,7 @@ Returns the current value of `lightning-id`" ) ;; WARN: disable def twice: 141. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod gen-lightning-and-thunder! mood-control ((this mood-control)) +(defmethod gen-lightning-and-thunder! ((this mood-control)) (local-vars (a1-1 (array float))) (let ((v1-3 (-> this mood-channel-group data (-> this lightning-index) vecs)) (a1-0 (-> this lightning-val)) @@ -1083,7 +1059,7 @@ Returns the current value of `lightning-id`" ) ) -(defmethod init-weather! mood-control ((this mood-control)) +(defmethod init-weather! ((this mood-control)) (local-vars (v1-39 int)) (let ((s5-0 (level-get-target-inside *level*))) (when s5-0 @@ -1328,7 +1304,7 @@ Returns the current value of `lightning-id`" (none) ) -(defmethod update-mood-weather! mood-control ((this mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float)) +(defmethod update-mood-weather! ((this mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float)) "Set the `target-interp` and `speed-interp` for the clouds and fog If `*-speed` is 0.0, use the `*-target` args to set `current-interp` See [[mood-weather]]" @@ -1346,7 +1322,7 @@ See [[mood-weather]]" (none) ) -(defmethod update-mood-range! mood-control ((this mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float)) +(defmethod update-mood-range! ((this mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float)) "Set the minimum and maximum ranges of clouds and fog See [[mood-range]]" (set! (-> this range min-cloud) min-cloud) @@ -1357,7 +1333,7 @@ See [[mood-range]]" (none) ) -(defmethod set-time-for-random-weather! mood-control ((this mood-control) (arg0 float) (arg1 float)) +(defmethod set-time-for-random-weather! ((this mood-control) (arg0 float) (arg1 float)) "Set the `time-until-random`'s cloud and fog values See [[mood-weather]]" (set! (-> this time-until-random cloud) arg0) diff --git a/goal_src/jak2/engine/gfx/mood/time-of-day-h.gc b/goal_src/jak2/engine/gfx/mood/time-of-day-h.gc index 738400d12c0..2725942cc6d 100644 --- a/goal_src/jak2/engine/gfx/mood/time-of-day-h.gc +++ b/goal_src/jak2/engine/gfx/mood/time-of-day-h.gc @@ -35,25 +35,19 @@ ;; DECOMP BEGINS (deftype palette-fade-control (structure) - ((trans vector :inline :offset-assert 0) - (fade float :offset-assert 16) - (actor-dist float :offset-assert 20) + ((trans vector :inline) + (fade float) + (actor-dist float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype palette-fade-controls (basic) - ((control palette-fade-control 8 :inline :offset-assert 16) + ((control palette-fade-control 8 :inline) ) - :method-count-assert 11 - :size-assert #x110 - :flag-assert #xb00000110 (:methods - (reset! (_type_) none 9) - (set-fade! (_type_ int float float vector) object 10) + (reset! (_type_) none) + (set-fade! (_type_ int float float vector) object) ) ) @@ -61,27 +55,23 @@ (define-perm *palette-fade-controls* palette-fade-controls (new 'global 'palette-fade-controls)) (deftype time-of-day-proc (process) - ((hours int32 :offset-assert 128) - (minutes int32 :offset-assert 132) - (seconds int32 :offset-assert 136) - (old-frame uint64 :offset-assert 144) - (current-frame uint64 :offset-assert 152) - (frames uint64 :offset-assert 160) - (time-of-day float :offset-assert 168) - (time-ratio float :offset-assert 172) - (dest-time-ratio float :offset-assert 176) - (dest-time-delta float :offset-assert 180) - (sun-count int32 :offset-assert 184) - (sun sparticle-launch-control :offset-assert 188) - (green-sun-count int32 :offset-assert 192) - (green-sun sparticle-launch-control :offset-assert 196) - (moon-count int32 :offset-assert 200) - (moon sparticle-launch-control :offset-assert 204) + ((hours int32) + (minutes int32) + (seconds int32) + (old-frame uint64) + (current-frame uint64) + (frames uint64) + (time-of-day float) + (time-ratio float) + (dest-time-ratio float) + (dest-time-delta float) + (sun-count int32) + (sun sparticle-launch-control) + (green-sun-count int32) + (green-sun sparticle-launch-control) + (moon-count int32) + (moon sparticle-launch-control) ) - :heap-base #x50 - :method-count-assert 14 - :size-assert #xd0 - :flag-assert #xe005000d0 (:states time-of-day-tick ) @@ -89,59 +79,50 @@ (deftype time-of-day-palette (basic) - ((width int32 :offset-assert 4) - (height int32 :offset-assert 8) - (pad int32 :offset-assert 12) - (data int32 1 :offset-assert 16) + ((width int32) + (height int32) + (pad int32) + (data int32 1) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype time-of-day-context (basic) - ((interp float 6 :offset-assert 4) - (current-fog mood-fog :inline :offset-assert 32) - (current-sky-color vector :inline :offset-assert 80) - (current-env-color vector :inline :offset-assert 96) - (current-prt-color vector :inline :offset-assert 112) - (current-shadow-color vector :inline :offset-assert 128) - (light-group light-group 8 :inline :offset-assert 144) - (current-clouds mood-clouds :inline :offset-assert 1680) - (times vector 8 :inline :offset-assert 1696) - (title-light-group light-group :inline :offset-assert 1824) - (filter vector :inline :offset-assert 2016) - (filter-color vector :inline :offset-assert 2032) - (time float :offset-assert 2048) - (target-interp float :offset-assert 2052) - (erase-color rgba :offset-assert 2056) - (sky symbol :offset-assert 2060) - (use-camera-other basic :offset-assert 2064) - (title-updated symbol :offset-assert 2068) - (mode time-of-day-palette-id :offset-assert 2072) - (overide-enable symbol :offset-assert 2076) - (overide-palette time-of-day-palette-id :offset-assert 2080) - (max-rain float :offset-assert 2084) - (fog-mult float :offset-assert 2088) - (exterior-level basic :offset-assert 2092) - (ocean-alpha float :offset-assert 2096) + ((interp float 6) + (current-fog mood-fog :inline) + (current-sky-color vector :inline) + (current-env-color vector :inline) + (current-prt-color vector :inline) + (current-shadow-color vector :inline) + (light-group light-group 8 :inline) + (current-clouds mood-clouds :inline) + (times vector 8 :inline) + (title-light-group light-group :inline) + (filter vector :inline) + (filter-color vector :inline) + (time float) + (target-interp float) + (erase-color rgba) + (sky symbol) + (use-camera-other basic) + (title-updated symbol) + (mode time-of-day-palette-id) + (overide-enable symbol) + (overide-palette time-of-day-palette-id) + (max-rain float) + (fog-mult float) + (exterior-level basic) + (ocean-alpha float) ) - :method-count-assert 9 - :size-assert #x834 - :flag-assert #x900000834 ) (deftype time-of-day-dma (structure) - ((outa uint32 256 :offset-assert 0) - (outb uint32 256 :offset-assert 1024) - (banka uint32 256 :offset-assert 2048) - (bankb uint32 256 :offset-assert 3072) + ((outa uint32 256) + (outb uint32 256) + (banka uint32 256) + (bankb uint32 256) ) - :method-count-assert 9 - :size-assert #x1000 - :flag-assert #x900001000 ) diff --git a/goal_src/jak2/engine/gfx/mood/time-of-day.gc b/goal_src/jak2/engine/gfx/mood/time-of-day.gc index 59c4e7243e7..eb439c2af87 100644 --- a/goal_src/jak2/engine/gfx/mood/time-of-day.gc +++ b/goal_src/jak2/engine/gfx/mood/time-of-day.gc @@ -10,11 +10,11 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of time-of-day-palette ((this time-of-day-palette)) +(defmethod asize-of ((this time-of-day-palette)) (the-as int (+ (-> this type size) (* (* (-> this height) (-> this width)) 4))) ) -(defmethod deactivate time-of-day-proc ((this time-of-day-proc)) +(defmethod deactivate ((this time-of-day-proc)) (if (nonzero? (-> this sun)) (kill-and-free-particles (-> this sun)) ) @@ -637,7 +637,7 @@ ) ) -(defmethod set-fade! palette-fade-controls ((this palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) +(defmethod set-fade! ((this palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) (cond ((and (>= arg0 0) (< arg0 8)) (let ((v1-3 (-> this control arg0))) @@ -656,7 +656,7 @@ ) ) -(defmethod reset! palette-fade-controls ((this palette-fade-controls)) +(defmethod reset! ((this palette-fade-controls)) (countdown (v1-0 8) (let ((a1-2 (-> this control v1-0))) (set! (-> a1-2 fade) 0.0) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-h.gc b/goal_src/jak2/engine/gfx/ocean/ocean-h.gc index 0bd1c7320fa..ae1c6b8e5b6 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-h.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-h.gc @@ -12,587 +12,488 @@ ;; DECOMP BEGINS (deftype ocean-corner (structure) - ((bsphere sphere :inline :offset-assert 0) - (start-corner vector :inline :offset-assert 16) - (y-scales vector :inline :offset-assert 32) - (alphas vector :inline :offset-assert 48) - (colors uint32 4 :offset-assert 64) + ((bsphere sphere :inline) + (start-corner vector :inline) + (y-scales vector :inline) + (alphas vector :inline) + (colors uint32 4) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype ocean-wave-info (structure) - ((frequency float :offset-assert 0) - (amplitude float :offset-assert 4) - (wave-speed float :offset-assert 8) - (angle float :offset-assert 12) - (kx float :offset-assert 16) - (ky float :offset-assert 20) - (w float :offset-assert 24) - (flags int32 :offset-assert 28) + ((frequency float) + (amplitude float) + (wave-speed float) + (angle float) + (kx float) + (ky float) + (w float) + (flags int32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype ocean-vertex (structure) - ((pos vector :inline :offset-assert 0) - (stq vector :inline :offset-assert 16) - (col vector :inline :offset-assert 32) + ((pos vector :inline) + (stq vector :inline) + (col vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype ocean-spheres (structure) - ((spheres sphere 36 :inline :offset-assert 0) + ((spheres sphere 36 :inline) ) - :method-count-assert 9 - :size-assert #x240 - :flag-assert #x900000240 ) (deftype ocean-colors (structure) - ((colors rgba 2548 :offset-assert 0) + ((colors rgba 2548) ) - :method-count-assert 9 - :size-assert #x27d0 - :flag-assert #x9000027d0 ) (deftype ocean-colors-float (structure) - ((colors vector 2548 :inline :offset-assert 0) + ((colors vector 2548 :inline) ) - :method-count-assert 9 - :size-assert #x9f40 - :flag-assert #x900009f40 ) (deftype ocean-mid-mask (structure) - ((mask uint8 8 :offset-assert 0) - (dword uint64 :offset 0) + ((mask uint8 8) + (dword uint64 :overlay-at (-> mask 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype ocean-mid-indices (basic) - ((data uint16 36 :offset-assert 4) + ((data uint16 36) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) (deftype ocean-mid-masks (basic) - ((data (inline-array ocean-mid-mask) :offset-assert 4) + ((data (inline-array ocean-mid-mask)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype ocean-trans-mask (structure) - ((mask uint8 4 :offset-assert 0) - (word int32 :offset 0) + ((mask uint8 4) + (word int32 :overlay-at (-> mask 0)) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype ocean-trans-index (structure) - ((parent int16 :offset-assert 0) - (child int16 :offset-assert 2) + ((parent int16) + (child int16) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype ocean-trans-indices (basic) - ((data ocean-trans-index 2304 :inline :offset-assert 4) + ((data ocean-trans-index 2304 :inline) ) - :method-count-assert 9 - :size-assert #x2404 - :flag-assert #x900002404 ) (deftype ocean-near-index (structure) - ((data uint16 16 :offset-assert 0) + ((data uint16 16) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype ocean-near-indices (basic) - ((data (inline-array ocean-near-index) :offset-assert 4) + ((data (inline-array ocean-near-index)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype ocean-near-colors (structure) - ((color0 vector :inline :offset-assert 0) - (color1 vector :inline :offset-assert 16) - (color2 vector :inline :offset-assert 32) - (color3 vector :inline :offset-assert 48) + ((color0 vector :inline) + (color1 vector :inline) + (color2 vector :inline) + (color3 vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype ocean-trans-strip (structure) - ((verts uint128 10 :offset-assert 0) + ((verts uint128 10) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) (deftype ocean-trans-strip-array (structure) - ((data ocean-trans-strip 4 :inline :offset-assert 0) + ((data ocean-trans-strip 4 :inline) ) - :method-count-assert 9 - :size-assert #x280 - :flag-assert #x900000280 ) (deftype ocean-wave-data (structure) - ((data uint8 1024 :offset-assert 0) + ((data uint8 1024) ) - :method-count-assert 9 - :size-assert #x400 - :flag-assert #x900000400 ) (deftype ocean-wave-frames (structure) - ((frame ocean-wave-data 64 :inline :offset-assert 0) + ((frame ocean-wave-data 64 :inline) ) - :method-count-assert 9 - :size-assert #x10000 - :flag-assert #x900000000 ) (deftype ocean-texture-constants (structure) - ((giftag gs-gif-tag :inline :offset-assert 0) - (buffers vector4w :inline :offset-assert 16) - (dests vector4w :inline :offset-assert 32) - (start vector :inline :offset-assert 48) - (offsets vector :inline :offset-assert 64) - (constants vector :inline :offset-assert 80) - (cam-nrm vector :inline :offset-assert 96) + ((giftag gs-gif-tag :inline) + (buffers vector4w :inline) + (dests vector4w :inline) + (start vector :inline) + (offsets vector :inline) + (constants vector :inline) + (cam-nrm vector :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) (deftype ocean-mid-vertex (structure) - ((stq vector :inline :offset-assert 0) - (col vector :inline :offset-assert 16) - (pos vector :inline :offset-assert 32) + ((stq vector :inline) + (col vector :inline) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype ocean-mid-constants (structure) - ((hmge-scale vector :inline :offset-assert 0) - (inv-hmge-scale vector :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (fog vector :inline :offset-assert 48) - (constants vector :inline :offset-assert 64) - (constants2 vector :inline :offset-assert 80) - (drw-fan gs-gif-tag :inline :offset-assert 96) - (env-fan gs-gif-tag :inline :offset-assert 112) - (drw-adgif gs-gif-tag :inline :offset-assert 128) - (drw-texture adgif-shader :inline :offset-assert 144) - (drw-strip-0 gs-gif-tag :inline :offset-assert 224) - (drw-strip-1 gs-gif-tag :inline :offset-assert 240) - (env-adgif gs-gif-tag :inline :offset-assert 256) - (env-texture adgif-shader :inline :offset-assert 272) - (env-strip gs-gif-tag :inline :offset-assert 352) - (env-color vector :inline :offset-assert 368) - (index-table vector4w 8 :inline :offset-assert 384) - (pos0 vector :inline :offset-assert 512) - (pos1 vector :inline :offset-assert 528) - (pos2 vector :inline :offset-assert 544) - (pos3 vector :inline :offset-assert 560) - ) - :method-count-assert 9 - :size-assert #x240 - :flag-assert #x900000240 + ((hmge-scale vector :inline) + (inv-hmge-scale vector :inline) + (hvdf-offset vector :inline) + (fog vector :inline) + (constants vector :inline) + (constants2 vector :inline) + (drw-fan gs-gif-tag :inline) + (env-fan gs-gif-tag :inline) + (drw-adgif gs-gif-tag :inline) + (drw-texture adgif-shader :inline) + (drw-strip-0 gs-gif-tag :inline) + (drw-strip-1 gs-gif-tag :inline) + (env-adgif gs-gif-tag :inline) + (env-texture adgif-shader :inline) + (env-strip gs-gif-tag :inline) + (env-color vector :inline) + (index-table vector4w 8 :inline) + (pos0 vector :inline) + (pos1 vector :inline) + (pos2 vector :inline) + (pos3 vector :inline) + ) ) (deftype ocean-mid-upload (structure) - ((rot matrix :inline :offset-assert 0) - (matrix matrix :inline :offset-assert 64) - (colors uint128 108 :offset-assert 128) - (masks uint128 2 :offset-assert 1856) + ((rot matrix :inline) + (matrix matrix :inline) + (colors uint128 108) + (masks uint128 2) ) - :method-count-assert 9 - :size-assert #x760 - :flag-assert #x900000760 ) (deftype ocean-mid-upload2 (structure) - ((rot matrix :inline :offset-assert 0) - (matrix matrix :inline :offset-assert 64) - (count vector4w :inline :offset-assert 128) - (tex0 vector :inline :offset-assert 144) - (tex1 vector :inline :offset-assert 160) - (tex2 vector :inline :offset-assert 176) - (tex3 vector :inline :offset-assert 192) - (clr0 vector :inline :offset-assert 208) - (clr1 vector :inline :offset-assert 224) - (clr2 vector :inline :offset-assert 240) - (clr3 vector :inline :offset-assert 256) - (verts uint128 18 :offset-assert 272) + ((rot matrix :inline) + (matrix matrix :inline) + (count vector4w :inline) + (tex0 vector :inline) + (tex1 vector :inline) + (tex2 vector :inline) + (tex3 vector :inline) + (clr0 vector :inline) + (clr1 vector :inline) + (clr2 vector :inline) + (clr3 vector :inline) + (verts uint128 18) ) - :method-count-assert 9 - :size-assert #x230 - :flag-assert #x900000230 ) (deftype ocean-mid-work (structure) - ((env0 vector :inline :offset-assert 0) - (env1 vector :inline :offset-assert 16) - (env2 vector :inline :offset-assert 32) - (hmg0 vector :inline :offset-assert 48) - (hmg1 vector :inline :offset-assert 64) - (hmg2 vector :inline :offset-assert 80) - (indices uint128 16 :offset-assert 96) + ((env0 vector :inline) + (env1 vector :inline) + (env2 vector :inline) + (hmg0 vector :inline) + (hmg1 vector :inline) + (hmg2 vector :inline) + (indices uint128 16) ) - :method-count-assert 9 - :size-assert #x160 - :flag-assert #x900000160 ) (deftype ocean-near-constants (structure) - ((hmge-scale vector :inline :offset-assert 0) - (inv-hmge-scale vector :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (fog vector :inline :offset-assert 48) - (constants vector :inline :offset-assert 64) - (constants2 vector :inline :offset-assert 80) - (constants3 vector :inline :offset-assert 96) - (constants4 vector :inline :offset-assert 112) - (constants5 vector :inline :offset-assert 128) - (drw-fan gs-gif-tag :inline :offset-assert 144) - (drw2-fan gs-gif-tag :inline :offset-assert 160) - (env-fan gs-gif-tag :inline :offset-assert 176) - (drw-adgif gs-gif-tag :inline :offset-assert 192) - (drw-texture adgif-shader :inline :offset-assert 208) - (drw-strip gs-gif-tag :inline :offset-assert 288) - (env-adgif gs-gif-tag :inline :offset-assert 304) - (env-texture adgif-shader :inline :offset-assert 320) - (env-strip gs-gif-tag :inline :offset-assert 400) - (env-color vector :inline :offset-assert 416) - (drw2-adgif gs-gif-tag :inline :offset-assert 432) - (drw2-tex0 qword :inline :offset-assert 448) - (drw2-frame qword :inline :offset-assert 464) - (drw2-strip gs-gif-tag :inline :offset-assert 480) - (drw3-adgif gs-gif-tag :inline :offset-assert 496) - (drw3-frame gs-adcmd :inline :offset-assert 512) - (index-table vector4w 4 :inline :offset-assert 528) - ) - :method-count-assert 9 - :size-assert #x250 - :flag-assert #x900000250 + ((hmge-scale vector :inline) + (inv-hmge-scale vector :inline) + (hvdf-offset vector :inline) + (fog vector :inline) + (constants vector :inline) + (constants2 vector :inline) + (constants3 vector :inline) + (constants4 vector :inline) + (constants5 vector :inline) + (drw-fan gs-gif-tag :inline) + (drw2-fan gs-gif-tag :inline) + (env-fan gs-gif-tag :inline) + (drw-adgif gs-gif-tag :inline) + (drw-texture adgif-shader :inline) + (drw-strip gs-gif-tag :inline) + (env-adgif gs-gif-tag :inline) + (env-texture adgif-shader :inline) + (env-strip gs-gif-tag :inline) + (env-color vector :inline) + (drw2-adgif gs-gif-tag :inline) + (drw2-tex0 qword :inline) + (drw2-frame qword :inline) + (drw2-strip gs-gif-tag :inline) + (drw3-adgif gs-gif-tag :inline) + (drw3-frame gs-adcmd :inline) + (index-table vector4w 4 :inline) + ) ) (deftype ocean-near-upload (structure) - ((rot matrix :inline :offset-assert 0) - (matrix matrix :inline :offset-assert 64) - (masks uint128 2 :offset-assert 128) - (start-height vector4w :inline :offset-assert 160) - (start-st vector :inline :offset-assert 176) - (near-colors ocean-near-colors :inline :offset-assert 192) + ((rot matrix :inline) + (matrix matrix :inline) + (masks uint128 2) + (start-height vector4w :inline) + (start-st vector :inline) + (near-colors ocean-near-colors :inline) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) (deftype ocean-near-vertex (structure) - ((stq vector :inline :offset-assert 0) - (clr vector :inline :offset-assert 16) - (pos vector :inline :offset-assert 32) + ((stq vector :inline) + (clr vector :inline) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype ocean-near-work (structure) - ((verts-ptr vector :inline :offset-assert 0) - (indices uint128 16 :offset-assert 16) + ((verts-ptr vector :inline) + (indices uint128 16) ) - :method-count-assert 9 - :size-assert #x110 - :flag-assert #x900000110 ) (deftype ocean-height-array (structure) - ((data float 1024 :offset-assert 0) + ((data float 1024) ) - :method-count-assert 9 - :size-assert #x1000 - :flag-assert #x900001000 ) (deftype ocean-vert-array (structure) - ((data vector 2048 :inline :offset-assert 0) + ((data vector 2048 :inline) ) - :method-count-assert 9 - :size-assert #x8000 - :flag-assert #x900008000 ) (deftype ocean-map (structure) - ((start-corner vector :inline :offset-assert 0) - (far-color vector :inline :offset-assert 16) - (ocean-spheres ocean-spheres :offset-assert 32) - (ocean-colors ocean-colors :offset-assert 36) - (ocean-mid-indices ocean-mid-indices :offset-assert 40) - (ocean-trans-indices ocean-trans-indices :offset-assert 44) - (ocean-near-indices ocean-near-indices :offset-assert 48) - (ocean-mid-masks ocean-mid-masks :offset-assert 52) - ) - :method-count-assert 11 - :size-assert #x38 - :flag-assert #xb00000038 + ((start-corner vector :inline) + (far-color vector :inline) + (ocean-spheres ocean-spheres) + (ocean-colors ocean-colors) + (ocean-mid-indices ocean-mid-indices) + (ocean-trans-indices ocean-trans-indices) + (ocean-near-indices ocean-near-indices) + (ocean-mid-masks ocean-mid-masks) + ) (:methods - (set-height! (_type_ float) none 9) - (get-base-height (_type_) float 10) + (set-height! (_type_ float) none) + (get-base-height (_type_) float) ) ) (deftype ocean (ocean-map) - ((off symbol :offset-assert 56) - (near-off symbol :offset-assert 60) - (mid-off symbol :offset-assert 64) - (far-on symbol :offset-assert 68) - (ocean-facing uint32 :offset-assert 72) - (heights ocean-height-array :offset-assert 76) - (heights2 ocean-height-array :offset-assert 80) - (verts ocean-vert-array :offset-assert 84) - (ocean-near-translucent? symbol :offset-assert 88) - (deltas vector :inline :offset-assert 96) - (map-min vector :inline :offset-assert 112) - (map-max vector :inline :offset-assert 128) - (interp vector :inline :offset-assert 144) - (corner-array ocean-corner 25 :inline :offset-assert 160) - (corner-count int32 :offset-assert 2160) - (temp-vecs vector 4 :inline :offset-assert 2176) - (mid-mask-ptrs pointer 36 :offset-assert 2240) - (mid-camera-masks uint64 36 :offset-assert 2384) - (trans-mask-ptrs pointer 64 :offset-assert 2672) - (trans-camera-masks ocean-trans-mask 16 :offset-assert 2928) - (trans-temp-masks uint32 16 :offset-assert 2992) - (sprite-tmpl dma-gif-packet :inline :offset-assert 3056) - (sprite-tmpl2 dma-gif-packet :inline :offset-assert 3088) - (sprite-tmpl3 dma-gif-packet :inline :offset-assert 3120) - (adgif-tmpl dma-gif-packet :inline :offset-assert 3152) - (line-tmpl dma-gif-packet :inline :offset-assert 3184) - (sun-tmpl dma-gif-packet :inline :offset-assert 3216) - (erase-tmpl dma-gif-packet :inline :offset-assert 3248) - (haze-tmpl dma-gif-packet :inline :offset-assert 3280) - (cloud-tmpl dma-gif-packet :inline :offset-assert 3312) - (clut-tmpl dma-gif-packet :inline :offset-assert 3344) - (cloud-lights cloud-lights :inline :offset-assert 3376) - (haze-lights haze-lights :inline :offset-assert 3536) - (constant vector :inline :offset-assert 3664) - (sky-color vector :inline :offset-assert 3680) - (haze-verts vector4w 32 :inline :offset-assert 3696) - (cloud-verts vector4w 36 :inline :offset-assert 4208) - (cloud-nrms vector 36 :inline :offset-assert 4784) - (cloud-col0 vector 36 :inline :offset-assert 5360) - (cloud-col1 vector 36 :inline :offset-assert 5936) - (cloud-st0 vector 36 :inline :offset-assert 6512) - (cloud-st1 vector 36 :inline :offset-assert 7088) - (color80808080 vector4w :inline :offset-assert 7664) - (color80808040 vector4w :inline :offset-assert 7680) - (color80808000 vector4w :inline :offset-assert 7696) - (st0000 vector :inline :offset-assert 7712) - (st0505 vector :inline :offset-assert 7728) - (st1010 vector :inline :offset-assert 7744) - (uv00 vector4w :inline :offset-assert 7760) - (uv44 vector4w :inline :offset-assert 7776) - (uv88 vector4w :inline :offset-assert 7792) - (uv1010 vector4w :inline :offset-assert 7808) - (uv2020 vector4w :inline :offset-assert 7824) - (uv4040 vector4w :inline :offset-assert 7840) - (uv8080 vector4w :inline :offset-assert 7856) - (xy00 vector4w :inline :offset-assert 7872) - (xy88 vector4w :inline :offset-assert 7888) - (xy1010 vector4w :inline :offset-assert 7904) - (xy2020 vector4w :inline :offset-assert 7920) - (xy4040 vector4w :inline :offset-assert 7936) - (xy8080 vector4w :inline :offset-assert 7952) - (cloud-alpha uint8 36 :offset-assert 7968) - (near-mask-indices uint16 16 :offset-assert 8004) - (mid-minx uint8 :offset-assert 8036) - (mid-maxx uint8 :offset-assert 8037) - (mid-minz uint8 :offset-assert 8038) - (mid-maxz uint8 :offset-assert 8039) - (near-minx uint8 :offset-assert 8040) - (near-maxx uint8 :offset-assert 8041) - (near-minz uint8 :offset-assert 8042) - (near-maxz uint8 :offset-assert 8043) - (temp-minx uint8 :offset-assert 8044) - (temp-maxx uint8 :offset-assert 8045) - (temp-minz uint8 :offset-assert 8046) - (temp-maxz uint8 :offset-assert 8047) - (tex1 gs-tex1 :offset-assert 8048) - (tex1-near gs-tex1 :offset-assert 8056) - (corner00 float :offset-assert 8064) - (corner01 float :offset-assert 8068) - (corner10 float :offset-assert 8072) - (corner11 float :offset-assert 8076) - (frame-num float :offset-assert 8080) - (frame-speed float :offset-assert 8084) - (frame-num2 float :offset-assert 8088) - (frame-speed2 float :offset-assert 8092) - (cloud-interp float :offset 3676) - (scales vector :inline :offset-assert 8096) - (mask-hi vector4w :inline :offset-assert 8112) - (mask-lo vector4w :inline :offset-assert 8128) - (lights vu-lights :inline :offset-assert 8144) - (uv-scroll-0 vector4w :inline :offset-assert 8256) - (uv-scroll-1 vector4w :inline :offset-assert 8272) - (st-scroll vector2 :inline :offset-assert 8288) - (wait-to-vu0 uint32 :offset-assert 8296) - ) - :method-count-assert 92 - :size-assert #x206c - :flag-assert #x5c0000206c + ((off symbol) + (near-off symbol) + (mid-off symbol) + (far-on symbol) + (ocean-facing uint32) + (heights ocean-height-array) + (heights2 ocean-height-array) + (verts ocean-vert-array) + (ocean-near-translucent? symbol) + (deltas vector :inline) + (map-min vector :inline) + (map-max vector :inline) + (interp vector :inline) + (corner-array ocean-corner 25 :inline) + (corner-count int32) + (temp-vecs vector 4 :inline) + (mid-mask-ptrs pointer 36) + (mid-camera-masks uint64 36) + (trans-mask-ptrs pointer 64) + (trans-camera-masks ocean-trans-mask 16) + (trans-temp-masks uint32 16) + (sprite-tmpl dma-gif-packet :inline) + (sprite-tmpl2 dma-gif-packet :inline) + (sprite-tmpl3 dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (line-tmpl dma-gif-packet :inline) + (sun-tmpl dma-gif-packet :inline) + (erase-tmpl dma-gif-packet :inline) + (haze-tmpl dma-gif-packet :inline) + (cloud-tmpl dma-gif-packet :inline) + (clut-tmpl dma-gif-packet :inline) + (cloud-lights cloud-lights :inline) + (haze-lights haze-lights :inline) + (constant vector :inline) + (sky-color vector :inline) + (haze-verts vector4w 32 :inline) + (cloud-verts vector4w 36 :inline) + (cloud-nrms vector 36 :inline) + (cloud-col0 vector 36 :inline) + (cloud-col1 vector 36 :inline) + (cloud-st0 vector 36 :inline) + (cloud-st1 vector 36 :inline) + (color80808080 vector4w :inline) + (color80808040 vector4w :inline) + (color80808000 vector4w :inline) + (st0000 vector :inline) + (st0505 vector :inline) + (st1010 vector :inline) + (uv00 vector4w :inline) + (uv44 vector4w :inline) + (uv88 vector4w :inline) + (uv1010 vector4w :inline) + (uv2020 vector4w :inline) + (uv4040 vector4w :inline) + (uv8080 vector4w :inline) + (xy00 vector4w :inline) + (xy88 vector4w :inline) + (xy1010 vector4w :inline) + (xy2020 vector4w :inline) + (xy4040 vector4w :inline) + (xy8080 vector4w :inline) + (cloud-alpha uint8 36) + (near-mask-indices uint16 16) + (mid-minx uint8) + (mid-maxx uint8) + (mid-minz uint8) + (mid-maxz uint8) + (near-minx uint8) + (near-maxx uint8) + (near-minz uint8) + (near-maxz uint8) + (temp-minx uint8) + (temp-maxx uint8) + (temp-minz uint8) + (temp-maxz uint8) + (tex1 gs-tex1) + (tex1-near gs-tex1) + (corner00 float) + (corner01 float) + (corner10 float) + (corner11 float) + (frame-num float) + (frame-speed float) + (frame-num2 float) + (frame-speed2 float) + (cloud-interp float :overlay-at (-> constant data 3)) + (scales vector :inline) + (mask-hi vector4w :inline) + (mask-lo vector4w :inline) + (lights vu-lights :inline) + (uv-scroll-0 vector4w :inline) + (uv-scroll-1 vector4w :inline) + (st-scroll vector2 :inline) + (wait-to-vu0 uint32) + ) (:methods - (get-height (_type_ vector symbol) float 11) - (draw! (_type_) none 12) - (update-map (_type_) none 13) - (interp-wave (_type_ ocean-wave-info uint float) none 14) - (ocean-method-15 (_type_ matrix matrix) none 15) - (generate-verts (_type_ ocean-vert-array ocean-height-array) none 16) - (add-colors! (_type_ vector ocean-vertex) none 17) - (ocean-method-18 (_type_ (pointer ocean-colors) (pointer ocean-colors)) none 18) - (init-buffer! (_type_ dma-buffer) none 19) - (end-buffer! (_type_ dma-buffer) none 20) - (set-corners! (_type_ float float) float 21) - (ocean-near-add-call (_type_ dma-buffer int) none 22) - (ocean-near-add-call-flush (_type_ dma-buffer int) none 23) - (ocean-near-setup-constants (_type_ ocean-near-constants) none 24) - (ocean-near-add-constants (_type_ dma-buffer) none 25) - (ocean-near-add-heights (_type_ dma-buffer) none 26) - (ocean-near-add-matrices (_type_ dma-buffer vector) none 27) - (ocean-near-add-upload (_type_ dma-buffer uint uint) none 28) - (draw-ocean-near (_type_ dma-buffer) none 29) - (ocean-trans-camera-masks-bit? (_type_ uint uint) symbol 30) - (ocean-trans-mask-ptrs-bit? (_type_ int int) symbol 31) - (ocean-trans-mask-ptrs-set! (_type_ uint uint) symbol 32) - (ocean-trans-add-upload-table (_type_ dma-buffer uint uint int int symbol) none 33) - (ocean-trans-add-upload-strip (_type_ dma-buffer uint uint int int int) none 34) - (ocean-transition-check (_type_ ocean-trans-mask int int vector) none 35) - (ocean-make-trans-camera-masks (_type_ uint uint uint uint) none 36) - (ocean-trans-add-upload (_type_ dma-buffer uint uint) none 37) - (draw-ocean-transition-seams (_type_ dma-buffer) none 38) - (ocean-trans-add-constants (_type_ dma-buffer) none 39) - (draw-ocean-transition (_type_ dma-buffer) none 40) - (ocean-mid-add-call (_type_ dma-buffer int) none 41) - (ocean-mid-add-call-flush (_type_ dma-buffer uint) none 42) - (ocean-matrix*! (_type_ matrix matrix matrix) matrix 43) - (ocean-vector-matrix*! (_type_ vector vector matrix) vector 44) - (ocean-mid-add-matrices (_type_ dma-buffer vector) none 45) - (ocean-mid-check (_type_ pointer int int vector) symbol 46) - (ocean-mid-setup-constants (_type_ ocean-mid-constants) none 47) - (ocean-mid-add-constants (_type_ dma-buffer) none 48) - (ocean-mid-camera-masks-bit? (_type_ uint uint) symbol 49) - (ocean-mid-mask-ptrs-bit? (_type_ uint uint) symbol 50) - (ocean-mid-camera-masks-set! (_type_ uint uint) symbol 51) - (ocean-mid-add-upload (_type_ dma-buffer int int int int float) none 52) - (ocean-mid-add-upload-table (_type_ dma-buffer uint uint (pointer float) int symbol) none 53) - (ocean-mid-add-upload-top (_type_ dma-buffer uint uint) none 54) - (ocean-mid-add-upload-middle (_type_ dma-buffer uint uint) none 55) - (ocean-mid-add-upload-bottom (_type_ dma-buffer uint uint) none 56) - (ocean-seams-add-constants (_type_ dma-buffer) none 57) - (draw-ocean-mid-seams (_type_ dma-buffer) none 58) - (draw-ocean-mid (_type_ dma-buffer) none 59) - (ocean-method-60 (_type_ dma-buffer) none 60) - (ocean-method-61 (_type_ dma-buffer) none 61) - (ocean-method-62 (_type_ dma-buffer) none 62) - (ocean-method-63 (_type_ dma-buffer) none 63) - (ocean-method-64 (_type_ dma-buffer) none 64) - (ocean-method-65 (_type_ dma-buffer) none 65) - (ocean-method-66 (_type_ dma-buffer) none 66) - (ocean-method-67 (_type_ dma-buffer) none 67) - (render-ocean-far (_type_ dma-buffer int) none 68) - (draw-ocean-far (_type_ dma-buffer) none 69) - (ocean-texture-setup-constants (_type_ ocean-texture-constants) none 70) - (ocean-texture-add-constants (_type_ dma-buffer) none 71) - (ocean-texture-add-envmap (_type_ dma-buffer) none 72) - (ocean-texture-add-verts (_type_ dma-buffer int) none 73) - (ocean-texture-add-verts-last (_type_ dma-buffer int int) none 74) - (ocean-texture-add-call-start (_type_ dma-buffer) none 75) - (ocean-texture-add-call-rest (_type_ dma-buffer) none 76) - (ocean-texture-add-call-done (_type_ dma-buffer) none 77) - (draw-ocean-texture (_type_ dma-buffer int) none 78) - (ocean-method-79 (_type_ dma-buffer) none 79) - (ocean-method-80 (_type_ (pointer rgba)) none 80) - (ocean-method-81 (_type_ dma-buffer) int 81) - (draw-envmap-debug (_type_ dma-buffer) none 82) - (ocean-method-83 (_type_ dma-buffer float) none 83) - (ocean-method-84 (_type_ dma-buffer sky-upload-data vector4w float) none 84) - (ocean-method-85 (_type_ dma-buffer) none 85) - (ocean-method-86 (_type_ vector vector vector vector) none 86) - (ocean-method-87 (_type_ vector vector vector) none 87) - (ocean-method-88 (_type_ dma-buffer) none 88) - (ocean-method-89 (_type_ dma-buffer) none 89) - (rgba-to-vector! (_type_ vector (pointer rgba)) none 90) - (do-tex-scroll! (_type_) none 91) + (get-height (_type_ vector symbol) float) + (draw! (_type_) none) + (update-map (_type_) none) + (interp-wave (_type_ ocean-wave-info uint float) none) + (ocean-method-15 (_type_ matrix matrix) none) + (generate-verts (_type_ ocean-vert-array ocean-height-array) none) + (add-colors! (_type_ vector ocean-vertex) none) + (ocean-method-18 (_type_ (pointer ocean-colors) (pointer ocean-colors)) none) + (init-buffer! (_type_ dma-buffer) none) + (end-buffer! (_type_ dma-buffer) none) + (set-corners! (_type_ float float) float) + (ocean-near-add-call (_type_ dma-buffer int) none) + (ocean-near-add-call-flush (_type_ dma-buffer int) none) + (ocean-near-setup-constants (_type_ ocean-near-constants) none) + (ocean-near-add-constants (_type_ dma-buffer) none) + (ocean-near-add-heights (_type_ dma-buffer) none) + (ocean-near-add-matrices (_type_ dma-buffer vector) none) + (ocean-near-add-upload (_type_ dma-buffer uint uint) none) + (draw-ocean-near (_type_ dma-buffer) none) + (ocean-trans-camera-masks-bit? (_type_ uint uint) symbol) + (ocean-trans-mask-ptrs-bit? (_type_ int int) symbol) + (ocean-trans-mask-ptrs-set! (_type_ uint uint) symbol) + (ocean-trans-add-upload-table (_type_ dma-buffer uint uint int int symbol) none) + (ocean-trans-add-upload-strip (_type_ dma-buffer uint uint int int int) none) + (ocean-transition-check (_type_ ocean-trans-mask int int vector) none) + (ocean-make-trans-camera-masks (_type_ uint uint uint uint) none) + (ocean-trans-add-upload (_type_ dma-buffer uint uint) none) + (draw-ocean-transition-seams (_type_ dma-buffer) none) + (ocean-trans-add-constants (_type_ dma-buffer) none) + (draw-ocean-transition (_type_ dma-buffer) none) + (ocean-mid-add-call (_type_ dma-buffer int) none) + (ocean-mid-add-call-flush (_type_ dma-buffer uint) none) + (ocean-matrix*! (_type_ matrix matrix matrix) matrix) + (ocean-vector-matrix*! (_type_ vector vector matrix) vector) + (ocean-mid-add-matrices (_type_ dma-buffer vector) none) + (ocean-mid-check (_type_ pointer int int vector) symbol) + (ocean-mid-setup-constants (_type_ ocean-mid-constants) none) + (ocean-mid-add-constants (_type_ dma-buffer) none) + (ocean-mid-camera-masks-bit? (_type_ uint uint) symbol) + (ocean-mid-mask-ptrs-bit? (_type_ uint uint) symbol) + (ocean-mid-camera-masks-set! (_type_ uint uint) symbol) + (ocean-mid-add-upload (_type_ dma-buffer int int int int float) none) + (ocean-mid-add-upload-table (_type_ dma-buffer uint uint (pointer float) int symbol) none) + (ocean-mid-add-upload-top (_type_ dma-buffer uint uint) none) + (ocean-mid-add-upload-middle (_type_ dma-buffer uint uint) none) + (ocean-mid-add-upload-bottom (_type_ dma-buffer uint uint) none) + (ocean-seams-add-constants (_type_ dma-buffer) none) + (draw-ocean-mid-seams (_type_ dma-buffer) none) + (draw-ocean-mid (_type_ dma-buffer) none) + (ocean-method-60 (_type_ dma-buffer) none) + (ocean-method-61 (_type_ dma-buffer) none) + (ocean-method-62 (_type_ dma-buffer) none) + (ocean-method-63 (_type_ dma-buffer) none) + (ocean-method-64 (_type_ dma-buffer) none) + (ocean-method-65 (_type_ dma-buffer) none) + (ocean-method-66 (_type_ dma-buffer) none) + (ocean-method-67 (_type_ dma-buffer) none) + (render-ocean-far (_type_ dma-buffer int) none) + (draw-ocean-far (_type_ dma-buffer) none) + (ocean-texture-setup-constants (_type_ ocean-texture-constants) none) + (ocean-texture-add-constants (_type_ dma-buffer) none) + (ocean-texture-add-envmap (_type_ dma-buffer) none) + (ocean-texture-add-verts (_type_ dma-buffer int) none) + (ocean-texture-add-verts-last (_type_ dma-buffer int int) none) + (ocean-texture-add-call-start (_type_ dma-buffer) none) + (ocean-texture-add-call-rest (_type_ dma-buffer) none) + (ocean-texture-add-call-done (_type_ dma-buffer) none) + (draw-ocean-texture (_type_ dma-buffer int) none) + (ocean-method-79 (_type_ dma-buffer) none) + (ocean-method-80 (_type_ (pointer rgba)) none) + (ocean-method-81 (_type_ dma-buffer) int) + (draw-envmap-debug (_type_ dma-buffer) none) + (ocean-method-83 (_type_ dma-buffer float) none) + (ocean-method-84 (_type_ dma-buffer sky-upload-data vector4w float) none) + (ocean-method-85 (_type_ dma-buffer) none) + (ocean-method-86 (_type_ vector vector vector vector) none) + (ocean-method-87 (_type_ vector vector vector) none) + (ocean-method-88 (_type_ dma-buffer) none) + (ocean-method-89 (_type_ dma-buffer) none) + (rgba-to-vector! (_type_ vector (pointer rgba)) none) + (do-tex-scroll! (_type_) none) ) ) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc b/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc index 974f628248c..6c4e6fbbdcf 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc @@ -9,7 +9,7 @@ (define ocean-mid-block (new 'static 'vu-function)) -(defmethod ocean-mid-setup-constants ocean ((this ocean) (arg0 ocean-mid-constants)) +(defmethod ocean-mid-setup-constants ((this ocean) (arg0 ocean-mid-constants)) (let ((v1-0 *math-camera*)) (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) @@ -290,7 +290,7 @@ (none) ) -(defmethod ocean-mid-add-constants ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-mid-add-constants ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 36) (v1-0 arg0) (a1-1 (the-as object (-> v1-0 base))) @@ -308,7 +308,7 @@ (none) ) -(defmethod ocean-matrix*! ocean ((this ocean) (arg0 matrix) (arg1 matrix) (arg2 matrix)) +(defmethod ocean-matrix*! ((this ocean) (arg0 matrix) (arg1 matrix) (arg2 matrix)) (rlet ((acc :class vf) (vf1 :class vf) (vf10 :class vf) @@ -355,7 +355,7 @@ ) ) -(defmethod ocean-vector-matrix*! ocean ((this ocean) (arg0 vector) (arg1 vector) (arg2 matrix)) +(defmethod ocean-vector-matrix*! ((this ocean) (arg0 vector) (arg1 vector) (arg2 matrix)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -379,7 +379,7 @@ ) ) -(defmethod ocean-mid-add-matrices ocean ((this ocean) (arg0 dma-buffer) (arg1 vector)) +(defmethod ocean-mid-add-matrices ((this ocean) (arg0 dma-buffer) (arg1 vector)) (let ((s4-0 (new-stack-vector0)) (v1-3 (if (-> *time-of-day-context* use-camera-other) (-> *math-camera* camera-rot-other) @@ -427,7 +427,7 @@ (none) ) -(defmethod ocean-mid-check ocean ((this ocean) (arg0 pointer) (arg1 int) (arg2 int) (arg3 vector)) +(defmethod ocean-mid-check ((this ocean) (arg0 pointer) (arg1 int) (arg2 int) (arg3 vector)) (local-vars (v0-0 symbol) (v1-10 float) (t0-3 float) (t0-8 float) (t0-13 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -504,7 +504,7 @@ ) ) -(defmethod ocean-mid-add-call ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-mid-add-call ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -517,7 +517,7 @@ (none) ) -(defmethod ocean-mid-add-call-flush ocean ((this ocean) (arg0 dma-buffer) (arg1 uint)) +(defmethod ocean-mid-add-call-flush ((this ocean) (arg0 dma-buffer) (arg1 uint)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -531,7 +531,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ocean-mid-add-upload ocean ((this ocean) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 float)) +(defmethod ocean-mid-add-upload ((this ocean) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 float)) (local-vars (sv-32 int)) (set! sv-32 arg1) (let ((s0-0 arg2) @@ -607,7 +607,7 @@ (none) ) -(defmethod ocean-mid-camera-masks-bit? ocean ((this ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-mid-camera-masks-bit? ((this ocean) (arg0 uint) (arg1 uint)) (cond ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) #t @@ -625,7 +625,7 @@ ) ) -(defmethod ocean-mid-mask-ptrs-bit? ocean ((this ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-mid-mask-ptrs-bit? ((this ocean) (arg0 uint) (arg1 uint)) (cond ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) #t @@ -646,7 +646,7 @@ ) ) -(defmethod ocean-mid-camera-masks-set! ocean ((this ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-mid-camera-masks-set! ((this ocean) (arg0 uint) (arg1 uint)) (cond ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) #f @@ -680,7 +680,7 @@ ) ) -(defmethod ocean-mid-add-upload-table ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 (pointer float)) (arg4 int) (arg5 symbol)) +(defmethod ocean-mid-add-upload-table ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 (pointer float)) (arg4 int) (arg5 symbol)) (local-vars (v1-13 float) (a0-20 uint128) @@ -790,7 +790,7 @@ ) ) -(defmethod ocean-mid-add-upload-top ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) +(defmethod ocean-mid-add-upload-top ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) (let ((s0-0 (-> this mid-minx)) (s2-0 (-> this mid-maxx)) (s1-0 (ocean-mid-camera-masks-bit? this arg1 arg2)) @@ -861,7 +861,7 @@ (none) ) -(defmethod ocean-mid-add-upload-middle ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) +(defmethod ocean-mid-add-upload-middle ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) (let ((s0-0 (-> this mid-minx)) (s2-0 (-> this mid-maxx)) (s1-0 (ocean-mid-camera-masks-bit? this arg1 arg2)) @@ -899,7 +899,7 @@ (none) ) -(defmethod ocean-mid-add-upload-bottom ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) +(defmethod ocean-mid-add-upload-bottom ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) (let ((s0-0 (-> this mid-minx)) (s2-0 (-> this mid-maxx)) (s1-0 (ocean-mid-camera-masks-bit? this arg1 arg2)) @@ -970,7 +970,7 @@ (none) ) -(defmethod ocean-seams-add-constants ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-seams-add-constants ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 4) (v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) @@ -993,7 +993,7 @@ (none) ) -(defmethod draw-ocean-mid-seams ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-mid-seams ((this ocean) (arg0 dma-buffer)) (local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere)) (ocean-seams-add-constants this arg0) (set! sv-32 (-> this mid-minx)) @@ -1041,7 +1041,7 @@ (none) ) -(defmethod draw-ocean-mid ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-mid ((this ocean) (arg0 dma-buffer)) (local-vars (v1-8 float) (v1-9 float) (sv-32 int)) (rlet ((vf16 :class vf) (vf17 :class vf) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-near.gc b/goal_src/jak2/engine/gfx/ocean/ocean-near.gc index 7388d2684dc..22a4b56234c 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-near.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-near.gc @@ -9,7 +9,7 @@ (define ocean-near-block (new 'static 'vu-function)) -(defmethod ocean-near-add-call ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-near-add-call ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -22,7 +22,7 @@ (none) ) -(defmethod ocean-near-add-call-flush ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-near-add-call-flush ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -35,7 +35,7 @@ (none) ) -(defmethod ocean-near-setup-constants ocean ((this ocean) (arg0 ocean-near-constants)) +(defmethod ocean-near-setup-constants ((this ocean) (arg0 ocean-near-constants)) (let ((v1-0 *math-camera*)) (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) @@ -366,7 +366,7 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defmethod ocean-near-add-constants ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-near-add-constants ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 37) (v1-0 arg0) (a1-1 (the-as object (-> v1-0 base))) @@ -383,7 +383,7 @@ (none) ) -(defmethod ocean-near-add-heights ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-near-add-heights ((this ocean) (arg0 dma-buffer)) (let ((v1-0 128) (a0-1 (-> this heights)) ) @@ -414,7 +414,7 @@ (none) ) -(defmethod ocean-near-add-matrices ocean ((this ocean) (arg0 dma-buffer) (arg1 vector)) +(defmethod ocean-near-add-matrices ((this ocean) (arg0 dma-buffer) (arg1 vector)) (let ((s4-0 (new-stack-vector0))) (if (-> *time-of-day-context* use-camera-other) (-> *math-camera* camera-rot-other) @@ -460,7 +460,7 @@ (none) ) -(defmethod ocean-near-add-upload ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) +(defmethod ocean-near-add-upload ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) (local-vars (v1-17 uint128) (v1-18 uint128) @@ -650,7 +650,7 @@ ) ) -(defmethod draw-ocean-near ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-near ((this ocean) (arg0 dma-buffer)) (local-vars (sv-16 uint)) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc b/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc index 8f7ac460b42..dc595e3779b 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc @@ -12,7 +12,7 @@ ;; og:preserve-this (define ocean-texture-vu1-block (new 'static 'vu-function)) -(defmethod ocean-texture-setup-constants ocean ((this ocean) (arg0 ocean-texture-constants)) +(defmethod ocean-texture-setup-constants ((this ocean) (arg0 ocean-texture-constants)) (set! (-> arg0 giftag tag) (new 'static 'gif-tag64 :nloop #x42 @@ -38,7 +38,7 @@ (none) ) -(defmethod ocean-texture-add-constants ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-constants ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 7) (v1-0 arg0) (a1-1 (the-as object (-> v1-0 base))) @@ -56,7 +56,7 @@ (none) ) -(defmethod ocean-texture-add-envmap ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-envmap ((this ocean) (arg0 dma-buffer)) (let ((v1-0 (the-as object (-> arg0 base)))) (set! (-> (the-as (inline-array vector4w) v1-0) 0 quad) (-> this adgif-tmpl dma-vif quad)) (set! (-> (the-as (inline-array vector4w) v1-0) 1 quad) (-> this adgif-tmpl quad 1)) @@ -72,7 +72,7 @@ (none) ) -(defmethod ocean-texture-add-verts ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-texture-add-verts ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -87,7 +87,7 @@ (none) ) -(defmethod ocean-texture-add-verts-last ocean ((this ocean) (arg0 dma-buffer) (arg1 int) (arg2 int)) +(defmethod ocean-texture-add-verts-last ((this ocean) (arg0 dma-buffer) (arg1 int) (arg2 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -112,7 +112,7 @@ (none) ) -(defmethod ocean-texture-add-call-start ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-call-start ((this ocean) (arg0 dma-buffer)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -125,7 +125,7 @@ (none) ) -(defmethod ocean-texture-add-call-rest ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-call-rest ((this ocean) (arg0 dma-buffer)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -138,7 +138,7 @@ (none) ) -(defmethod ocean-texture-add-call-done ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-call-done ((this ocean) (arg0 dma-buffer)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -151,7 +151,7 @@ (none) ) -(defmethod draw-ocean-texture ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod draw-ocean-texture ((this ocean) (arg0 dma-buffer) (arg1 int)) (set-display-gs-state arg0 21 128 128 0 0) (ocean-texture-add-envmap this arg0) (dma-buffer-add-gs-set arg0 @@ -190,7 +190,7 @@ (none) ) -(defmethod ocean-method-79 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-79 ((this ocean) (arg0 dma-buffer)) (set-display-gs-state arg0 53 64 64 0 0) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) @@ -284,7 +284,7 @@ (none) ) -(defmethod ocean-method-80 ocean ((this ocean) (arg0 (pointer rgba))) +(defmethod ocean-method-80 ((this ocean) (arg0 (pointer rgba))) (dotimes (v1-0 256) (let ((a0-3 (-> *clut-translate* v1-0))) (set! (-> arg0 a0-3 r) v1-0) @@ -297,7 +297,7 @@ (none) ) -(defmethod do-tex-scroll! ocean ((this ocean)) +(defmethod do-tex-scroll! ((this ocean)) (when (not (paused?)) (+! (-> this st-scroll x) (* 8.0 (seconds-per-frame))) (set! (-> this st-scroll y) (- (-> this st-scroll y) (* 8.0 (seconds-per-frame)))) @@ -316,7 +316,7 @@ (none) ) -(defmethod ocean-method-81 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-81 ((this ocean) (arg0 dma-buffer)) (set-display-gs-state arg0 53 128 128 0 0) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) @@ -464,7 +464,7 @@ 0 ) -(defmethod draw-envmap-debug ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-envmap-debug ((this ocean) (arg0 dma-buffer)) (format *stdcon* "draw-envmap-debug~%") (-> arg0 base) (dma-buffer-add-gs-set arg0 @@ -516,7 +516,7 @@ (none) ) -(defmethod ocean-method-83 ocean ((this ocean) (arg0 dma-buffer) (arg1 float)) +(defmethod ocean-method-83 ((this ocean) (arg0 dma-buffer) (arg1 float)) (let* ((s4-0 64) (s3-0 0) (f30-0 (/ -65536.0 (the float s4-0))) @@ -567,7 +567,7 @@ (none) ) -(defmethod ocean-method-84 ocean ((this ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) +(defmethod ocean-method-84 ((this ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) (when (>= (-> arg1 sun 0 pos y) -150.0) (let* ((f2-0 (* 0.00010050251 (-> arg1 sun 0 pos x))) (f1-3 (* 0.00010050251 (-> arg1 sun 0 pos z))) @@ -602,7 +602,7 @@ (none) ) -(defmethod ocean-method-85 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-85 ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 vector4w) (sv-64 vector4w)) (dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x2 :d #x1))) (let ((v1-3 (-> arg0 base))) @@ -663,7 +663,7 @@ (none) ) -(defmethod ocean-method-86 ocean ((this ocean) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod ocean-method-86 ((this ocean) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (local-vars (v1-1 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -724,7 +724,7 @@ ) ) -(defmethod ocean-method-87 ocean ((this ocean) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod ocean-method-87 ((this ocean) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -747,7 +747,7 @@ (none) ) -(defmethod ocean-method-88 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-88 ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 vector) (sv-64 uint) (sv-80 vector) (sv-96 vector) (sv-112 vector)) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test @@ -879,7 +879,7 @@ (none) ) -(defmethod ocean-method-89 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-89 ((this ocean) (arg0 dma-buffer)) (set-display-gs-state arg0 (the-as int (+ (-> *ocean-texture-base* vram-page) 8)) 64 64 0 0) (vector-float*! (-> this sky-color) (-> *time-of-day-context* current-sky-color) 0.25) (+! (-> this sky-color x) (* 0.5 (- (-> this sky-color z) (-> this sky-color x)))) @@ -1017,6 +1017,8 @@ (none) ) +;; ERROR: Expression building failed: In check-normals: Could not match ArrayFieldAccess (stride power of 2) values: v1-4 + (defun-debug generate-cloud-verts ((arg0 int) (arg1 float)) (let ((f30-0 8192.0) (f28-0 (/ 65536.0 (the float arg0))) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-transition.gc b/goal_src/jak2/engine/gfx/ocean/ocean-transition.gc index e03290e4a1e..cc7640070ca 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-transition.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-transition.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod ocean-trans-camera-masks-bit? ocean ((this ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-trans-camera-masks-bit? ((this ocean) (arg0 uint) (arg1 uint)) (let ((v1-2 (- arg0 (* (-> this mid-minz) 4))) (a1-3 (- arg1 (* (-> this mid-minx) 4))) ) @@ -29,7 +29,7 @@ ) ) -(defmethod ocean-trans-mask-ptrs-bit? ocean ((this ocean) (arg0 int) (arg1 int)) +(defmethod ocean-trans-mask-ptrs-bit? ((this ocean) (arg0 int) (arg1 int)) (let ((v1-2 (- arg0 (the-as int (* (-> this mid-minz) 4)))) (a1-3 (- arg1 (the-as int (* (-> this mid-minx) 4)))) ) @@ -58,7 +58,7 @@ ) ) -(defmethod ocean-trans-mask-ptrs-set! ocean ((this ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-trans-mask-ptrs-set! ((this ocean) (arg0 uint) (arg1 uint)) (let ((v1-2 (- arg0 (* (-> this mid-minz) 4))) (a1-3 (- arg1 (* (-> this mid-minx) 4))) ) @@ -99,7 +99,7 @@ ) ) -(defmethod ocean-trans-add-upload-table ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 symbol)) +(defmethod ocean-trans-add-upload-table ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 symbol)) (local-vars (v1-16 (inline-array vector4w)) (v1-18 float) @@ -290,7 +290,7 @@ ) ) -(defmethod ocean-trans-add-upload-strip ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 int)) +(defmethod ocean-trans-add-upload-strip ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 int)) (local-vars (v1-10 float) (a0-24 uint128) @@ -406,7 +406,7 @@ ) ) -(defmethod ocean-transition-check ocean ((this ocean) (arg0 ocean-trans-mask) (arg1 int) (arg2 int) (arg3 vector)) +(defmethod ocean-transition-check ((this ocean) (arg0 ocean-trans-mask) (arg1 int) (arg2 int) (arg3 vector)) (local-vars (v1-13 float) (t0-3 float) (t0-8 float) (t0-13 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -485,7 +485,7 @@ ) ) -(defmethod ocean-make-trans-camera-masks ocean ((this ocean) (arg0 uint) (arg1 uint) (arg2 uint) (arg3 uint)) +(defmethod ocean-make-trans-camera-masks ((this ocean) (arg0 uint) (arg1 uint) (arg2 uint) (arg3 uint)) (local-vars (sv-48 ocean-trans-mask) (sv-52 vector) (sv-56 vector) (sv-60 vector)) (set! sv-48 (the-as ocean-trans-mask (&-> this trans-camera-masks (+ (* arg2 4) arg3)))) (set! sv-52 (-> *math-camera* trans)) @@ -507,7 +507,7 @@ (none) ) -(defmethod ocean-trans-add-upload ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) +(defmethod ocean-trans-add-upload ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) (when (not (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int arg2))) (let ((s0-0 (ocean-trans-camera-masks-bit? this (+ arg1 -1) arg2)) (s1-0 (ocean-trans-camera-masks-bit? this (+ arg1 1) arg2)) @@ -631,7 +631,7 @@ (none) ) -(defmethod draw-ocean-transition-seams ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-transition-seams ((this ocean) (arg0 dma-buffer)) (local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere)) (set! sv-32 (-> this near-minx)) (set! sv-33 (-> this near-maxx)) @@ -681,7 +681,7 @@ (none) ) -(defmethod ocean-trans-add-constants ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-trans-add-constants ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 4) (v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) @@ -704,7 +704,7 @@ (none) ) -(defmethod draw-ocean-transition ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-transition ((this ocean) (arg0 dma-buffer)) (local-vars (sv-32 uint) (sv-33 uint) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean.gc b/goal_src/jak2/engine/gfx/ocean/ocean.gc index 8c8efd546fd..62da36dfac2 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean.gc @@ -9,7 +9,7 @@ ;; DECOMP BEGINS -(defmethod set-corners! ocean ((this ocean) (corner-x float) (corner-z float)) +(defmethod set-corners! ((this ocean) (corner-x float) (corner-z float)) (let* ((f2-0 (* 0.00008138021 corner-x)) (f3-0 (* 0.00008138021 corner-z)) (f0-2 f2-0) @@ -35,7 +35,7 @@ ) ) -(defmethod get-height ocean ((this ocean) (arg0 vector) (arg1 symbol)) +(defmethod get-height ((this ocean) (arg0 vector) (arg1 symbol)) (local-vars (v1-12 int)) (cond ((and (-> this heights) *ocean-map*) @@ -69,7 +69,9 @@ (else (let ((a0-14 (logand (the int (* 0.00008138021 f30-0)) 7))) (cond - ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7)) (ash 1 a0-14)) + ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7)) + (ash 1 a0-14) + ) ) (let* ((f1-2 (vector-vector-distance arg0 (math-camera-pos))) (f26-0 (- 1.0 (fmin 1.0 (* 0.000010172526 f1-2)))) @@ -107,7 +109,7 @@ (def-mips2c render-ocean-quad (function (inline-array ocean-vertex) dma-buffer symbol)) -(defmethod add-colors! ocean ((this ocean) (arg0 vector) (arg1 ocean-vertex)) +(defmethod add-colors! ((this ocean) (arg0 vector) (arg1 ocean-vertex)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (-> this haze-lights)) ) @@ -139,7 +141,7 @@ (none) ) -(defmethod ocean-method-60 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-60 ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) @@ -239,7 +241,7 @@ (none) ) -(defmethod ocean-method-61 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-61 ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) @@ -339,7 +341,7 @@ (none) ) -(defmethod ocean-method-62 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-62 ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) @@ -439,7 +441,7 @@ (none) ) -(defmethod ocean-method-63 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-63 ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) @@ -539,7 +541,7 @@ (none) ) -(defmethod ocean-method-64 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-64 ((this ocean) (arg0 dma-buffer)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) (let* ((v1-1 (-> this ocean-colors)) @@ -648,7 +650,7 @@ (none) ) -(defmethod ocean-method-65 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-65 ((this ocean) (arg0 dma-buffer)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) (let* ((v1-1 (-> this ocean-colors)) @@ -757,7 +759,7 @@ (none) ) -(defmethod ocean-method-66 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-66 ((this ocean) (arg0 dma-buffer)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) (let* ((v1-1 (-> this ocean-colors)) @@ -860,7 +862,7 @@ (none) ) -(defmethod ocean-method-67 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-67 ((this ocean) (arg0 dma-buffer)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) (let* ((v1-1 (-> this ocean-colors)) @@ -963,7 +965,7 @@ (none) ) -(defmethod render-ocean-far ocean ((this ocean) (arg1 dma-buffer) (facing int)) +(defmethod render-ocean-far ((this ocean) (arg1 dma-buffer) (facing int)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) (let ((f0-0 (-> this start-corner y))) @@ -1014,7 +1016,7 @@ ) ;; WARN: Return type mismatch uint vs none. -(defmethod draw-ocean-far ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-far ((this ocean) (arg0 dma-buffer)) (init-ocean-far-regs) (let ((gp-0 (the-as object (-> arg0 base)))) (&+! (-> arg0 base) 16) @@ -1045,7 +1047,7 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defmethod init-buffer! ocean ((this ocean) (arg0 dma-buffer)) +(defmethod init-buffer! ((this ocean) (arg0 dma-buffer)) "Initialize [[ocean]] DMA buffer." (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) @@ -1061,13 +1063,13 @@ (none) ) -(defmethod end-buffer! ocean ((this ocean) (arg0 dma-buffer)) +(defmethod end-buffer! ((this ocean) (arg0 dma-buffer)) (dma-buffer-add-gs-set arg0 (texa (new 'static 'gs-texa :ta1 #x80))) 0 (none) ) -(defmethod set-height! ocean-map ((this ocean-map) (arg0 float)) +(defmethod set-height! ((this ocean-map) (arg0 float)) (if this (set! (-> this start-corner y) arg0) ) @@ -1075,14 +1077,14 @@ (none) ) -(defmethod get-base-height ocean-map ((this ocean-map)) +(defmethod get-base-height ((this ocean-map)) (if this (-> this start-corner y) 0.0 ) ) -(defmethod rgba-to-vector! ocean ((this ocean) (arg0 vector) (arg1 (pointer rgba))) +(defmethod rgba-to-vector! ((this ocean) (arg0 vector) (arg1 (pointer rgba))) "Pack an [[rgba]]'s bytes into a vector." (local-vars (v1-1 uint128) (v1-2 uint128)) (rlet ((vf1 :class vf)) @@ -1098,14 +1100,16 @@ ) ) -(defmethod update-map ocean ((this ocean)) +;; ERROR: Unsupported inline assembly instruction kind - [psrah a2, a2, 8] + +(defmethod update-map ((this ocean)) (set! (-> this heights) #f) (set! (-> this verts) #f) (let ((s5-0 *mood-control*)) (set! (-> this constant w) (if (and (-> s5-0 overide-weather-flag) (not (movie?))) - (-> s5-0 overide cloud) - (-> s5-0 current-interp cloud) - ) + (-> s5-0 overide cloud) + (-> s5-0 current-interp cloud) + ) ) ) (set! (-> this constant w) (fmin 1.0 (* 2.0 (-> this constant w)))) @@ -1128,7 +1132,12 @@ ) (let ((s5-1 (-> *display* frames (-> *display* on-screen) global-buf))) (set! (-> this heights) (the-as ocean-height-array (-> s5-1 base))) - (interp-wave this (the-as ocean-wave-info (-> this heights)) (the-as uint (-> this frame-num)) (* 0.08325 f30-0)) + (interp-wave + this + (the-as ocean-wave-info (-> this heights)) + (the-as uint (-> this frame-num)) + (* 0.08325 f30-0) + ) (&+! (-> s5-1 base) 4096) (set! (-> this heights2) (the-as ocean-height-array (-> s5-1 base))) (interp-wave @@ -1221,9 +1230,9 @@ (set! (-> this off) #f) (set! (-> this mid-off) #f) (set! (-> this near-off) (if this - (not (-> this ocean-near-translucent?)) - #f - ) + (not (-> this ocean-near-translucent?)) + #f + ) ) ) 0 @@ -1240,7 +1249,7 @@ (the-as float #x43000000) ) -(defmethod draw! ocean ((this ocean)) +(defmethod draw! ((this ocean)) (do-tex-scroll! this) (set! *ocean-map* #f) (set! (-> this far-on) #f) diff --git a/goal_src/jak2/engine/gfx/shrub/shrubbery-h.gc b/goal_src/jak2/engine/gfx/shrub/shrubbery-h.gc index 3338d71bfdb..1e6491f76a4 100644 --- a/goal_src/jak2/engine/gfx/shrub/shrubbery-h.gc +++ b/goal_src/jak2/engine/gfx/shrub/shrubbery-h.gc @@ -13,129 +13,96 @@ ;; DECOMP BEGINS (deftype billboard (drawable) - ((flat adgif-shader :inline :offset-assert 32) + ((flat adgif-shader :inline) ) - :method-count-assert 17 - :size-assert #x70 - :flag-assert #x1100000070 ) (deftype shrub-view-data (structure) - ((data uint128 3 :offset-assert 0) - (texture-giftag gs-gif-tag :inline :offset 0) - (consts vector :inline :offset 16) - (fog-clamp vector :inline :offset 32) - (tex-start-ptr int32 :offset 16) - (gifbufsum float :offset 16) - (mtx-buf-ptr int32 :offset 20) - (exp23 float :offset 20) - (fog-0 float :offset 24) - (fog-1 float :offset 28) - (fog-min float :offset 32) - (fog-max float :offset 36) + ((data uint128 3) + (texture-giftag gs-gif-tag :inline :overlay-at (-> data 0)) + (consts vector :inline :overlay-at (-> data 1)) + (fog-clamp vector :inline :overlay-at (-> data 2)) + (tex-start-ptr int32 :overlay-at (-> data 1)) + (gifbufsum float :overlay-at (-> data 1)) + (mtx-buf-ptr int32 :overlay-at (-> consts y)) + (exp23 float :overlay-at mtx-buf-ptr) + (fog-0 float :overlay-at (-> consts z)) + (fog-1 float :overlay-at (-> consts w)) + (fog-min float :overlay-at (-> data 2)) + (fog-max float :overlay-at (-> fog-clamp y)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype shrubbery (drawable) - ((textures (inline-array adgif-shader) :offset 4) - (header qword :offset 8) - (obj-qwc uint8 :offset 12) - (vtx-qwc uint8 :offset 13) - (col-qwc uint8 :offset 14) - (stq-qwc uint8 :offset 15) - (obj uint32 :offset 16) - (vtx uint32 :offset 20) - (col uint32 :offset 24) - (stq uint32 :offset 28) + ((textures (inline-array adgif-shader) :overlay-at id) + (header qword :offset 8) + (obj-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (obj uint32 :overlay-at (-> bsphere data 0)) + (vtx uint32 :overlay-at (-> bsphere data 1)) + (col uint32 :overlay-at (-> bsphere data 2)) + (stq uint32 :overlay-at (-> bsphere data 3)) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) (deftype instance-shrubbery (instance) - ((flat-normal vector :inline :offset-assert 64) - (flat-hwidth float :offset 76) - (color uint32 :offset 8) + ((flat-normal vector :inline) + (flat-hwidth float :overlay-at (-> flat-normal data 3)) + (color uint32 :offset 8) ) - :method-count-assert 17 - :size-assert #x50 - :flag-assert #x1100000050 ) (deftype drawable-inline-array-instance-shrub (drawable-inline-array) - ((data instance-shrubbery 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 112) + ((data instance-shrubbery 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x74 - :flag-assert #x1100000074 ) (deftype drawable-tree-instance-shrub (drawable-tree) - ((info prototype-array-shrub-info :offset 8) - (colors-added time-of-day-palette :offset 12) + ((info prototype-array-shrub-info :offset 8) + (colors-added time-of-day-palette :offset 12) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) (deftype generic-shrub-fragment (drawable) - ((textures (inline-array adgif-shader) :offset 4) - (vtx-cnt uint32 :offset 8) - (cnt-qwc uint8 :offset 12) - (vtx-qwc uint8 :offset 13) - (col-qwc uint8 :offset 14) - (stq-qwc uint8 :offset 15) - (cnt uint32 :offset 16) - (vtx uint32 :offset 20) - (col uint32 :offset 24) - (stq uint32 :offset 28) + ((textures (inline-array adgif-shader) :overlay-at id) + (vtx-cnt uint32 :offset 8) + (cnt-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (cnt uint32 :overlay-at (-> bsphere data 0)) + (vtx uint32 :overlay-at (-> bsphere data 1)) + (col uint32 :overlay-at (-> bsphere data 2)) + (stq uint32 :overlay-at (-> bsphere data 3)) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) (deftype prototype-shrubbery (drawable-inline-array) - ((data shrubbery 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 64) + ((data shrubbery 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 ) (deftype prototype-trans-shrubbery (prototype-shrubbery) () - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 ) (deftype prototype-generic-shrub (drawable-group) () - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) (deftype shrubbery-matrix (structure) - ((mat matrix :inline :offset-assert 0) - (color qword :inline :offset-assert 64) + ((mat matrix :inline) + (color qword :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) @@ -174,105 +141,96 @@ (define *shrub-state* 0) (deftype shrub-near-packet (structure) - ((matrix-tmpl dma-packet :inline :offset-assert 0) - (header-tmpl dma-packet :inline :offset-assert 16) - (stq-tmpl dma-packet :inline :offset-assert 32) - (color-tmpl dma-packet :inline :offset-assert 48) - (vertex-tmpl dma-packet :inline :offset-assert 64) - (mscal-tmpl dma-packet :inline :offset-assert 80) - (init-tmpl dma-packet :inline :offset-assert 96) - (init-data qword 2 :inline :offset-assert 112) + ((matrix-tmpl dma-packet :inline) + (header-tmpl dma-packet :inline) + (stq-tmpl dma-packet :inline) + (color-tmpl dma-packet :inline) + (vertex-tmpl dma-packet :inline) + (mscal-tmpl dma-packet :inline) + (init-tmpl dma-packet :inline) + (init-data qword 2 :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) (deftype instance-shrub-work (structure) - ((dummy qword 3 :inline :offset-assert 0) - (chaina qword 8 :inline :offset-assert 48) - (chainb qword 8 :inline :offset-assert 176) - (colors rgba 1024 :offset-assert 304) - (matrix-tmpl qword 20 :inline :offset-assert 4400) - (count-tmpl vector4w 20 :inline :offset-assert 4720) - (mscalf-tmpl dma-packet :inline :offset-assert 5040) - (mscalf-ret-tmpl dma-packet :inline :offset-assert 5056) - (adgif-tmpl dma-gif-packet :inline :offset-assert 5072) - (billboard-tmpl dma-gif-packet :inline :offset-assert 5104) - (billboard-const vector :inline :offset-assert 5136) - (shrub-near-packets shrub-near-packet 6 :inline :offset-assert 5152) - (dma-ref dma-packet :inline :offset-assert 6016) - (dma-end dma-packet :inline :offset-assert 6032) - (wind-const vector :inline :offset-assert 6048) - (constants vector :inline :offset-assert 6064) - (color-constant vector4w :inline :offset-assert 6080) - (hmge-d vector :inline :offset-assert 6096) - (hvdf-offset vector :inline :offset-assert 6112) - (wind-force vector :inline :offset-assert 6128) - (color vector :inline :offset-assert 6144) - (bb-color vector :inline :offset-assert 6160) - (min-dist vector :inline :offset-assert 6176) - (temp-vec vector :inline :offset-assert 6192) - (guard-plane plane 4 :inline :offset-assert 6208) - (plane plane 4 :inline :offset-assert 6272) - (last uint32 4 :offset-assert 6336) - (next uint32 4 :offset-assert 6352) - (count uint16 4 :offset-assert 6368) - (mod-count uint16 4 :offset-assert 6376) - (wind-vectors uint32 :offset-assert 6384) - (instance-ptr uint32 :offset-assert 6388) - (chain-ptr uint32 :offset-assert 6392) - (chain-ptr-next uint32 :offset-assert 6396) - (stack-ptr uint32 :offset-assert 6400) - (bucket-ptr uint32 :offset-assert 6404) - (src-ptr uint32 :offset-assert 6408) - (to-spr uint32 :offset-assert 6412) - (from-spr uint32 :offset-assert 6416) - (shrub-count uint32 :offset-assert 6420) - (pad uint32 :offset-assert 6424) - (node uint32 6 :offset-assert 6428) - (length uint32 6 :offset-assert 6452) - (prototypes uint32 :offset-assert 6476) - (pad2 uint32 :offset-assert 6480) - (start-bank uint8 20 :offset-assert 6484) - (buffer-index uint32 :offset-assert 6504) - (current-spr uint32 :offset-assert 6508) - (current-mem uint32 :offset-assert 6512) - (current-shrub-near-packet uint32 :offset-assert 6516) - (current-shrub-near-trans-packet uint32 :offset-assert 6520) - (pad3 uint32 :offset-assert 6524) - (dma-buffer basic :offset-assert 6528) - (near-last uint32 :offset-assert 6532) - (near-next uint32 :offset-assert 6536) - (near-count uint32 :offset-assert 6540) - (near-trans-last uint32 :offset-assert 6544) - (near-trans-next uint32 :offset-assert 6548) - (near-trans-count uint32 :offset-assert 6552) - (last-shrubs uint32 :offset-assert 6556) - (chains uint32 :offset-assert 6560) - (flags uint32 :offset-assert 6564) - (node-count uint32 :offset-assert 6568) - (inst-count uint32 :offset-assert 6572) - (wait-from-spr uint32 :offset-assert 6576) - (wait-to-spr uint32 :offset-assert 6580) - (texture-dists uint32 :offset-assert 6584) + ((dummy qword 3 :inline) + (chaina qword 8 :inline) + (chainb qword 8 :inline) + (colors rgba 1024) + (matrix-tmpl qword 20 :inline) + (count-tmpl vector4w 20 :inline) + (mscalf-tmpl dma-packet :inline) + (mscalf-ret-tmpl dma-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (billboard-tmpl dma-gif-packet :inline) + (billboard-const vector :inline) + (shrub-near-packets shrub-near-packet 6 :inline) + (dma-ref dma-packet :inline) + (dma-end dma-packet :inline) + (wind-const vector :inline) + (constants vector :inline) + (color-constant vector4w :inline) + (hmge-d vector :inline) + (hvdf-offset vector :inline) + (wind-force vector :inline) + (color vector :inline) + (bb-color vector :inline) + (min-dist vector :inline) + (temp-vec vector :inline) + (guard-plane plane 4 :inline) + (plane plane 4 :inline) + (last uint32 4) + (next uint32 4) + (count uint16 4) + (mod-count uint16 4) + (wind-vectors uint32) + (instance-ptr uint32) + (chain-ptr uint32) + (chain-ptr-next uint32) + (stack-ptr uint32) + (bucket-ptr uint32) + (src-ptr uint32) + (to-spr uint32) + (from-spr uint32) + (shrub-count uint32) + (pad uint32) + (node uint32 6) + (length uint32 6) + (prototypes uint32) + (pad2 uint32) + (start-bank uint8 20) + (buffer-index uint32) + (current-spr uint32) + (current-mem uint32) + (current-shrub-near-packet uint32) + (current-shrub-near-trans-packet uint32) + (pad3 uint32) + (dma-buffer basic) + (near-last uint32) + (near-next uint32) + (near-count uint32) + (near-trans-last uint32) + (near-trans-next uint32) + (near-trans-count uint32) + (last-shrubs uint32) + (chains uint32) + (flags uint32) + (node-count uint32) + (inst-count uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (texture-dists uint32) ) - :method-count-assert 9 - :size-assert #x19bc - :flag-assert #x9000019bc ) (deftype instance-shrub-dma (structure) - ((instancea uint128 325 :offset-assert 0) - (instanceb uint128 325 :offset-assert 5200) - (outa uint128 128 :offset-assert 10400) - (outb uint128 128 :offset-assert 12448) + ((instancea uint128 325) + (instanceb uint128 325) + (outa uint128 128) + (outb uint128 128) ) - :method-count-assert 9 - :size-assert #x38a0 - :flag-assert #x9000038a0 ) ;; DECOMP ENDS diff --git a/goal_src/jak2/engine/gfx/shrub/shrubbery.gc b/goal_src/jak2/engine/gfx/shrub/shrubbery.gc index 6f8692b6467..349f5f0d429 100644 --- a/goal_src/jak2/engine/gfx/shrub/shrubbery.gc +++ b/goal_src/jak2/engine/gfx/shrub/shrubbery.gc @@ -10,13 +10,13 @@ ;; DECOMP BEGINS -(defmethod login billboard ((this billboard)) +(defmethod login ((this billboard)) "Set up the billboard adgif shader" (adgif-shader-login (-> this flat)) this ) -(defmethod mem-usage billboard ((this billboard) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this billboard) (arg0 memory-usage-block) (arg1 int)) "Compute the memory used for the billboard." (set! (-> arg0 length) (max 34 (-> arg0 length))) (set! (-> arg0 data 33 name) "billboard") @@ -62,7 +62,7 @@ arg0 ) -(defmethod mem-usage drawable-tree-instance-shrub ((this drawable-tree-instance-shrub) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-tree-instance-shrub) (arg0 memory-usage-block) (arg1 int)) "Compute memory usage for an entire shrub tree" (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) @@ -93,7 +93,7 @@ this ) -(defmethod login generic-shrub-fragment ((this generic-shrub-fragment)) +(defmethod login ((this generic-shrub-fragment)) "Set up shaders in a generic shrub fragment" (let ((s5-0 (/ (-> this cnt-qwc) (the-as uint 5)))) (dotimes (s4-0 (the-as int s5-0)) @@ -103,7 +103,7 @@ this ) -(defmethod mem-usage generic-shrub-fragment ((this generic-shrub-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this generic-shrub-fragment) (arg0 memory-usage-block) (arg1 int)) "Compute memory usage of generic shrub fragment" (set! (-> arg0 length) (max 27 (-> arg0 length))) (set! (-> arg0 data 25 name) "generic-shrub") @@ -124,7 +124,7 @@ ) -(defmethod mem-usage prototype-shrubbery ((this prototype-shrubbery) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-shrubbery) (arg0 memory-usage-block) (arg1 int)) "Compute memory usage of all prototypes in a prototype array." (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) @@ -139,7 +139,7 @@ this ) -(defmethod login prototype-shrubbery ((this prototype-shrubbery)) +(defmethod login ((this prototype-shrubbery)) "Login all prototypes in a prototype array" (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) @@ -147,12 +147,12 @@ this ) -(defmethod asize-of prototype-shrubbery ((this prototype-shrubbery)) +(defmethod asize-of ((this prototype-shrubbery)) "Compute the allocation size of a prototype shrubbery array (dynamically sized)" (the-as int (+ (-> prototype-shrubbery size) (* (+ (-> this length) -1) 32))) ) -(defmethod login prototype-generic-shrub ((this prototype-generic-shrub)) +(defmethod login ((this prototype-generic-shrub)) "Initialize all fragments in a generic prototype." (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) @@ -160,7 +160,7 @@ this ) -(defmethod login shrubbery ((this shrubbery)) +(defmethod login ((this shrubbery)) "Initialize a shrubbery fragment." (let ((s5-0 (* (-> this header data 0) 2))) (dotimes (s4-0 (the-as int s5-0)) @@ -186,7 +186,7 @@ this ) -(defmethod mem-usage shrubbery ((this shrubbery) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this shrubbery) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a shrubbery fragment." (set! (-> arg0 length) (max 28 (-> arg0 length))) (set! (-> arg0 data 27 name) "shrubbery") @@ -226,7 +226,7 @@ this ) -(defmethod login drawable-tree-instance-shrub ((this drawable-tree-instance-shrub)) +(defmethod login ((this drawable-tree-instance-shrub)) "Initialize a shrubbery tree." (if (nonzero? (-> this info prototype-inline-array-shrub)) (login (-> this info prototype-inline-array-shrub)) @@ -543,7 +543,7 @@ (none) ) -(defmethod draw drawable-tree-instance-shrub ((this drawable-tree-instance-shrub) (arg0 drawable-tree-instance-shrub) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-instance-shrub) (arg0 drawable-tree-instance-shrub) (arg1 display-frame)) (let ((v1-1 (-> *background-work* shrub-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) @@ -555,11 +555,11 @@ (none) ) -(defmethod unpack-vis drawable-tree-instance-shrub ((this drawable-tree-instance-shrub) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree-instance-shrub) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) -(defmethod collect-stats drawable-tree-instance-shrub ((this drawable-tree-instance-shrub)) +(defmethod collect-stats ((this drawable-tree-instance-shrub)) (when (logtest? (vu1-renderer-mask shrubbery shrub-near billboard shrubbery-vanish) (-> *display* vu1-enable-user)) (let* ((v1-4 (-> this info prototype-inline-array-shrub)) (gp-0 (the-as object (-> v1-4 data))) @@ -647,23 +647,17 @@ ) (deftype dma-test (structure) - ((data qword 101 :inline :offset-assert 0) + ((data qword 101 :inline) ) - :method-count-assert 9 - :size-assert #x650 - :flag-assert #x900000650 ) (define *dma-test* (new 'global 'dma-test)) (deftype dma-test-work (structure) - ((upload dma-packet :inline :offset-assert 0) - (end dma-packet :inline :offset-assert 16) + ((upload dma-packet :inline) + (end dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) diff --git a/goal_src/jak2/engine/gfx/sky/sky-data.gc b/goal_src/jak2/engine/gfx/sky/sky-data.gc index cfb11ddf287..656ae3aa60e 100644 --- a/goal_src/jak2/engine/gfx/sky/sky-data.gc +++ b/goal_src/jak2/engine/gfx/sky/sky-data.gc @@ -314,7 +314,7 @@ (init-haze-vert-array) -(defmethod init-sun-data! sky-work ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init-sun-data! ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float)) "Sets the sun related upload data - the sun, halo and aurora" (let ((v1-0 (logand arg0 1))) (set! (-> this upload-data sun v1-0 r-sun) arg1) @@ -325,7 +325,7 @@ (none) ) -(defmethod init-orbit-settings! sky-work ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) +(defmethod init-orbit-settings! ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) (set! (-> this orbit arg0 high-noon) arg1) (set! (-> this orbit arg0 tilt) (* 0.017453292 arg2)) (set! (-> this orbit arg0 rise) (* 0.017453292 arg3)) @@ -400,7 +400,3 @@ (init-orbit-settings! *sky-work* 1 4.0 0.0 90.0 9950.0 300.0 300.0) (init-orbit-settings! *sky-work* 2 0.5 -40.0 90.0 9950.0 300.0 300.0) - - - - diff --git a/goal_src/jak2/engine/gfx/sky/sky-h.gc b/goal_src/jak2/engine/gfx/sky/sky-h.gc index bc86323b2ad..757322cdf83 100644 --- a/goal_src/jak2/engine/gfx/sky/sky-h.gc +++ b/goal_src/jak2/engine/gfx/sky/sky-h.gc @@ -10,255 +10,213 @@ ;; DECOMP BEGINS (deftype sky-color-hour (structure) - ((snapshot1 int32 :offset-assert 0) - (snapshot2 int32 :offset-assert 4) - (morph-start float :offset-assert 8) - (morph-end float :offset-assert 12) + ((snapshot1 int32) + (snapshot2 int32) + (morph-start float) + (morph-end float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype sky-color-day (structure) - ((hour sky-color-hour 24 :inline :offset-assert 0) + ((hour sky-color-hour 24 :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) (deftype sky-sun-data (structure) - ((data uint128 4 :offset-assert 0) - (pos vector :inline :offset 0) - (r-sun float :offset 16) - (r-halo float :offset 20) - (r-aurora float :offset 24) - (c-sun-start rgba :offset 32) - (c-sun-end rgba :offset 48) - (c-halo-start rgba :offset 36) - (c-halo-end rgba :offset 52) - (c-aurora-start rgba :offset 40) - (c-aurora-end rgba :offset 56) + ((data uint128 4) + (pos vector :inline :overlay-at (-> data 0)) + (r-sun float :overlay-at (-> data 1)) + (r-halo float :offset 20) + (r-aurora float :offset 24) + (c-sun-start rgba :overlay-at (-> data 2)) + (c-sun-end rgba :overlay-at (-> data 3)) + (c-halo-start rgba :offset 36) + (c-halo-end rgba :offset 52) + (c-aurora-start rgba :offset 40) + (c-aurora-end rgba :offset 56) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype sky-moon-data (structure) - ((data uint128 2 :offset-assert 0) - (pos vector :inline :offset 0) - (scale vector :inline :offset 16) + ((data uint128 2) + (pos vector :inline :overlay-at (-> data 0)) + (scale vector :inline :overlay-at (-> data 1)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype sky-orbit (structure) - ((high-noon float :offset-assert 0) - (tilt float :offset-assert 4) - (rise float :offset-assert 8) - (dist float :offset-assert 12) - (min-halo float :offset-assert 16) - (max-halo float :offset-assert 20) + ((high-noon float) + (tilt float) + (rise float) + (dist float) + (min-halo float) + (max-halo float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype sky-upload-data (structure) - ((data uint128 10 :offset-assert 0) - (sun sky-sun-data 2 :inline :offset 0) - (moon sky-moon-data :inline :offset 128) + ((data uint128 10) + (sun sky-sun-data 2 :inline :overlay-at (-> data 0)) + (moon sky-moon-data :inline :overlay-at (-> data 8)) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) (deftype sky-vertex (structure) - ((pos vector :inline :offset-assert 0) - (stq vector :inline :offset-assert 16) - (col vector :inline :offset-assert 32) + ((pos vector :inline) + (stq vector :inline) + (col vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype cloud-vertex (structure) - ((pos vector :inline :offset-assert 0) - (stq vector :inline :offset-assert 16) - (col vector :inline :offset-assert 32) - (nrm vector :inline :offset-assert 48) - (stq2 vector :inline :offset-assert 64) - (col2 vector :inline :offset-assert 80) - (nrm2 vector :inline :offset-assert 96) + ((pos vector :inline) + (stq vector :inline) + (col vector :inline) + (nrm vector :inline) + (stq2 vector :inline) + (col2 vector :inline) + (nrm2 vector :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) (deftype cloud-vert-array (structure) - ((data cloud-vertex 100 :inline :offset-assert 0) + ((data cloud-vertex 100 :inline) ) - :method-count-assert 9 - :size-assert #x2bc0 - :flag-assert #x900002bc0 ) (deftype haze-vertex (structure) - ((pos vector :inline :offset-assert 0) - (nrm vector :inline :offset-assert 16) - (col vector :inline :offset-assert 32) + ((pos vector :inline) + (nrm vector :inline) + (col vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype haze-vert-array (structure) - ((data haze-vertex 36 :inline :offset-assert 0) + ((data haze-vertex 36 :inline) ) - :method-count-assert 9 - :size-assert #x6c0 - :flag-assert #x9000006c0 ) (deftype cloud-lights (structure) - ((sun0-normal vector :inline :offset-assert 0) - (sun1-normal vector :inline :offset-assert 16) - (moon-normal vector :inline :offset-assert 32) - (ambi-color vector :inline :offset-assert 48) - (ambi-color-lower vector :inline :offset-assert 64) - (sun0-color vector :inline :offset-assert 80) - (sun1-color vector :inline :offset-assert 96) - (moon-color vector :inline :offset-assert 112) - (sun0-color-lower vector :inline :offset-assert 128) - (sun0-scale float :offset-assert 144) - (sun1-scale float :offset-assert 148) - (moon-scale float :offset-assert 152) + ((sun0-normal vector :inline) + (sun1-normal vector :inline) + (moon-normal vector :inline) + (ambi-color vector :inline) + (ambi-color-lower vector :inline) + (sun0-color vector :inline) + (sun1-color vector :inline) + (moon-color vector :inline) + (sun0-color-lower vector :inline) + (sun0-scale float) + (sun1-scale float) + (moon-scale float) ) - :method-count-assert 9 - :size-assert #x9c - :flag-assert #x90000009c ) (deftype haze-lights (structure) - ((sun0-normal vector :inline :offset-assert 0) - (sun1-normal vector :inline :offset-assert 16) - (moon-normal vector :inline :offset-assert 32) - (ambi-color vector :inline :offset-assert 48) - (sun0-color vector :inline :offset-assert 64) - (sun1-color vector :inline :offset-assert 80) - (moon-color vector :inline :offset-assert 96) - (sun0-scale float :offset-assert 112) - (sun1-scale float :offset-assert 116) - (moon-scale float :offset-assert 120) + ((sun0-normal vector :inline) + (sun1-normal vector :inline) + (moon-normal vector :inline) + (ambi-color vector :inline) + (sun0-color vector :inline) + (sun1-color vector :inline) + (moon-color vector :inline) + (sun0-scale float) + (sun1-scale float) + (moon-scale float) ) - :method-count-assert 9 - :size-assert #x7c - :flag-assert #x90000007c ) (deftype sky-work (structure) - ((adgif-tmpl dma-gif-packet :inline :offset-assert 0) - (draw-tmpl dma-gif-packet :inline :offset-assert 32) - (draw-tmpl2 dma-gif-packet :inline :offset-assert 64) - (fog-tmpl dma-gif-packet :inline :offset-assert 96) - (blend-tmpl dma-gif-packet :inline :offset-assert 128) - (sprite-tmpl dma-gif-packet :inline :offset-assert 160) - (sprite-tmpl2 dma-gif-packet :inline :offset-assert 192) - (sun-coords vector 2 :inline :offset-assert 224) - (green-coords vector 2 :inline :offset-assert 256) - (moon0-coords vector 2 :inline :offset-assert 288) - (moon1-coords vector 2 :inline :offset-assert 320) - (moon2-coords vector 2 :inline :offset-assert 352) - (star-coords vector 2 :inline :offset-assert 384) - (sun-colors vector4w 2 :inline :offset-assert 416) - (green-colors vector4w 2 :inline :offset-assert 448) - (moon-colors vector4w 3 :inline :offset-assert 480) - (star-colors vector4w 16 :inline :offset-assert 528) - (st-coords vector 2 :inline :offset-assert 784) - (random vector4w 8 :inline :offset-assert 816) - (giftag-base dma-gif :inline :offset-assert 944) - (giftag-haze dma-gif :inline :offset-assert 960) - (giftag-roof dma-gif :inline :offset-assert 976) - (giftag-ocean dma-gif :inline :offset-assert 992) - (fog vector :inline :offset-assert 1008) - (sky float 8 :offset-assert 1024) - (time float :offset-assert 1056) - (off-s uint16 :offset-assert 1060) - (off-t uint16 :offset-assert 1062) - (orbit sky-orbit 3 :inline :offset-assert 1064) - (upload-data sky-upload-data :inline :offset-assert 1168) - (ambi-color vector4w :inline :offset-assert 1328) - (ambi-color-lower vector4w :inline :offset-assert 1344) - (sun0-color vector4w :inline :offset-assert 1360) - (sun1-color vector4w :inline :offset-assert 1376) - (moon-color vector4w :inline :offset-assert 1392) - (sun0-color-lower vector4w :inline :offset-assert 1408) - (cam-mat matrix :inline :offset-assert 1424) - (star-mat matrix :inline :offset-assert 1488) - (vec0 vector4w :inline :offset-assert 1552) - (vec1 vector4w :inline :offset-assert 1568) - (cloud-lights cloud-lights :inline :offset-assert 1584) - (haze-lights haze-lights :inline :offset-assert 1744) - (buf dma-buffer :offset-assert 1868) - (draw-vortex basic :offset-assert 1872) - (stars vector 512 :inline :offset-assert 1888) + ((adgif-tmpl dma-gif-packet :inline) + (draw-tmpl dma-gif-packet :inline) + (draw-tmpl2 dma-gif-packet :inline) + (fog-tmpl dma-gif-packet :inline) + (blend-tmpl dma-gif-packet :inline) + (sprite-tmpl dma-gif-packet :inline) + (sprite-tmpl2 dma-gif-packet :inline) + (sun-coords vector 2 :inline) + (green-coords vector 2 :inline) + (moon0-coords vector 2 :inline) + (moon1-coords vector 2 :inline) + (moon2-coords vector 2 :inline) + (star-coords vector 2 :inline) + (sun-colors vector4w 2 :inline) + (green-colors vector4w 2 :inline) + (moon-colors vector4w 3 :inline) + (star-colors vector4w 16 :inline) + (st-coords vector 2 :inline) + (random vector4w 8 :inline) + (giftag-base dma-gif :inline) + (giftag-haze dma-gif :inline) + (giftag-roof dma-gif :inline) + (giftag-ocean dma-gif :inline) + (fog vector :inline) + (sky float 8) + (time float) + (off-s uint16) + (off-t uint16) + (orbit sky-orbit 3 :inline) + (upload-data sky-upload-data :inline) + (ambi-color vector4w :inline) + (ambi-color-lower vector4w :inline) + (sun0-color vector4w :inline) + (sun1-color vector4w :inline) + (moon-color vector4w :inline) + (sun0-color-lower vector4w :inline) + (cam-mat matrix :inline) + (star-mat matrix :inline) + (vec0 vector4w :inline) + (vec1 vector4w :inline) + (cloud-lights cloud-lights :inline) + (haze-lights haze-lights :inline) + (buf dma-buffer) + (draw-vortex basic) + (stars vector 512 :inline) ) - :method-count-assert 37 - :size-assert #x2760 - :flag-assert #x2500002760 (:methods - (init-sun-data! (_type_ int float float float) none 9) - (init-orbit-settings! (_type_ int float float float float float float) none 10) - (update-colors-for-time (_type_ float) none 11) - (update-time-and-speed (_type_ float float) none 12) - (draw (_type_) none 13) - (update-matrix (_type_ matrix) none 14) - (update-template-colors (_type_) none 15) - (init-regs-for-large-polygon-draw (_type_) none 16) - (init-regs-for-sky-asm (_type_) none 17) - (cloud-vtx-light-update (_type_ vector vector cloud-lights vector vector) none 18) - (cloud-vtx-tex-update (_type_ vector vector vector cloud-lights) none 19) - (adjust-cloud-lighting (_type_) none 20) - (cloud-vtx1-to-sky (_type_ sky-vertex cloud-vertex) none 21) - (cloud-vtx2-to-sky (_type_ sky-vertex cloud-vertex) none 22) - (draw-clouds (_type_ dma-buffer) none 23) - (apply-haze-light (_type_ vector vector haze-lights) none 24) - (adjust-haze-lighting (_type_) none 25) - (haze-vtx-to-sky (_type_ sky-vertex sky-vertex haze-vertex) none 26) - (draw-haze (_type_ dma-buffer) none 27) - (sun-dma (_type_ dma-buffer) none 28) - (green-sun-dma (_type_ dma-buffer) none 29) - (moon-dma (_type_ dma-buffer) none 30) - (setup-stars (_type_ matrix sky-upload-data) none 31) - (stars-transform-asm (_type_) none 32) - (stars-dma (_type_ dma-buffer) none 33) - (draw-roof (_type_ dma-buffer) none 34) - (draw-base (_type_ dma-buffer) none 35) - (draw-fog (_type_ dma-buffer) none 36) + (init-sun-data! (_type_ int float float float) none) + (init-orbit-settings! (_type_ int float float float float float float) none) + (update-colors-for-time (_type_ float) none) + (update-time-and-speed (_type_ float float) none) + (draw (_type_) none) + (update-matrix (_type_ matrix) none) + (update-template-colors (_type_) none) + (init-regs-for-large-polygon-draw (_type_) none) + (init-regs-for-sky-asm (_type_) none) + (cloud-vtx-light-update (_type_ vector vector cloud-lights vector vector) none) + (cloud-vtx-tex-update (_type_ vector vector vector cloud-lights) none) + (adjust-cloud-lighting (_type_) none) + (cloud-vtx1-to-sky (_type_ sky-vertex cloud-vertex) none) + (cloud-vtx2-to-sky (_type_ sky-vertex cloud-vertex) none) + (draw-clouds (_type_ dma-buffer) none) + (apply-haze-light (_type_ vector vector haze-lights) none) + (adjust-haze-lighting (_type_) none) + (haze-vtx-to-sky (_type_ sky-vertex sky-vertex haze-vertex) none) + (draw-haze (_type_ dma-buffer) none) + (sun-dma (_type_ dma-buffer) none) + (green-sun-dma (_type_ dma-buffer) none) + (moon-dma (_type_ dma-buffer) none) + (setup-stars (_type_ matrix sky-upload-data) none) + (stars-transform-asm (_type_) none) + (stars-dma (_type_ dma-buffer) none) + (draw-roof (_type_ dma-buffer) none) + (draw-base (_type_ dma-buffer) none) + (draw-fog (_type_ dma-buffer) none) ) ) diff --git a/goal_src/jak2/engine/gfx/sky/sky-tng.gc b/goal_src/jak2/engine/gfx/sky/sky-tng.gc index 0fc4523d1e6..0caef72d10b 100644 --- a/goal_src/jak2/engine/gfx/sky/sky-tng.gc +++ b/goal_src/jak2/engine/gfx/sky/sky-tng.gc @@ -82,7 +82,7 @@ vf31: cam 0 (premultiplied by hmge) ;; Sky Update ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod update-matrix sky-work ((this sky-work) (arg0 matrix)) +(defmethod update-matrix ((this sky-work) (arg0 matrix)) "Update the projection matrix for sky drawing. The input matrix should not include perepctive. This function will apply the current math camera's perspective." @@ -109,7 +109,7 @@ vf31: cam 0 (premultiplied by hmge) ) ) -(defmethod update-template-colors sky-work ((this sky-work)) +(defmethod update-template-colors ((this sky-work)) "Update skybox colors from level/mood." (let ((v1-1 (-> *time-of-day-context* current-fog erase-color)) (a0-2 (-> *level* default-level mood-context current-sky-color)) @@ -123,7 +123,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod update-time-and-speed sky-work ((this sky-work) (arg0 float) (arg1 float)) +(defmethod update-time-and-speed ((this sky-work) (arg0 float) (arg1 float)) "Update based on the given time. Time is used to place suns/moon at the right spot, speed is used to scroll clouds." (if (and (level-get-target-inside *level*) (= (-> (level-get-target-inside *level*) info taskname) 'nest)) (set! arg1 (* 10.0 arg1)) @@ -141,7 +141,7 @@ vf31: cam 0 (premultiplied by hmge) ;; method 16 ;; init-regs-for-boundary-draw ;; set up vf registers for drawing large polygons -; (defmethod init-regs-for-large-polygon-draw sky-work ((this sky-work)) +; (defmethod init-regs-for-large-polygon-draw ((this sky-work)) ; (local-vars (v1-1 float)) ; (rlet ((vf0 :class vf) ; (vf13 :class vf) @@ -205,7 +205,7 @@ vf31: cam 0 (premultiplied by hmge) ;; vf30: cam 1 ;; vf31: cam 0 -; (defmethod init-regs-for-sky-asm sky-work ((this sky-work)) +; (defmethod init-regs-for-sky-asm ((this sky-work)) ; (local-vars (v1-2 float)) ; (rlet ((vf0 :class vf) ; (vf13 :class vf) @@ -244,7 +244,7 @@ vf31: cam 0 (premultiplied by hmge) (defmethod-mips2c "(method 17 sky-work)" 17 sky-work) -(defmethod update-colors-for-time sky-work ((this sky-work) (arg0 float)) +(defmethod update-colors-for-time ((this sky-work) (arg0 float)) "Update sky colors for the given time." 0 0 @@ -293,7 +293,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod cloud-vtx-light-update sky-work ((this sky-work) (arg0 vector) (arg1 vector) (arg2 cloud-lights) (arg3 vector) (arg4 vector)) +(defmethod cloud-vtx-light-update ((this sky-work) (arg0 vector) (arg1 vector) (arg2 cloud-lights) (arg3 vector) (arg4 vector)) "Update lighting for cloud mesh vertex." (let ((s5-0 (new 'stack-no-clear 'vector4))) (let* ((f0-1 (vector-dot (-> arg2 sun0-normal) arg1)) @@ -317,7 +317,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod cloud-vtx-tex-update sky-work ((this sky-work) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 cloud-lights)) +(defmethod cloud-vtx-tex-update ((this sky-work) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 cloud-lights)) "Update texture stq for cloud mesh vertex." (let ((s5-0 (new 'stack-no-clear 'vector4)) (s2-0 (new 'stack-no-clear 'vector4)) @@ -339,7 +339,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod adjust-cloud-lighting sky-work ((this sky-work)) +(defmethod adjust-cloud-lighting ((this sky-work)) "Apply lighting to cloud vertices" (let ((s5-0 *cloud-vert-array*) (s4-0 (-> this cloud-lights)) @@ -401,7 +401,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod cloud-vtx1-to-sky sky-work ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) +(defmethod cloud-vtx1-to-sky ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) "Convert a cloud vertex to a sky vertex, using the 'normal' stq/col" (set! (-> arg0 pos quad) (-> arg1 pos quad)) (set! (-> arg0 stq quad) (-> arg1 stq quad)) @@ -409,7 +409,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod cloud-vtx2-to-sky sky-work ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) +(defmethod cloud-vtx2-to-sky ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) "Convert a cloud vertex to a sky vertex, using the '2' stq/col" (set! (-> arg0 pos quad) (-> arg1 pos quad)) (set! (-> arg0 stq quad) (-> arg1 stq2 quad)) @@ -417,7 +417,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod draw-clouds sky-work ((this sky-work) (arg0 dma-buffer)) +(defmethod draw-clouds ((this sky-work) (arg0 dma-buffer)) "Draw the cloud layer using large polygon renderer Assumes that init-regs-for-large-polygon-draw was already called." (local-vars (v1-19 float) (sv-16 cloud-vert-array) (sv-20 (inline-array sky-vertex)) (sv-32 int)) @@ -502,7 +502,7 @@ vf31: cam 0 (premultiplied by hmge) ) ) -(defmethod apply-haze-light sky-work ((this sky-work) (arg0 vector) (arg1 vector) (arg2 haze-lights)) +(defmethod apply-haze-light ((this sky-work) (arg0 vector) (arg1 vector) (arg2 haze-lights)) "Apply haze lights to a vertex." (let ((s5-0 (new 'stack-no-clear 'vector4))) (let* ((f0-1 (vector-dot (-> arg2 sun0-normal) arg1)) @@ -526,7 +526,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod adjust-haze-lighting sky-work ((this sky-work)) +(defmethod adjust-haze-lighting ((this sky-work)) "Adjust lighting for haze." (let ((s5-0 *haze-vert-array*) (s4-0 (-> this haze-lights)) @@ -572,7 +572,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod haze-vtx-to-sky sky-work ((this sky-work) (arg0 sky-vertex) (arg1 sky-vertex) (arg2 haze-vertex)) +(defmethod haze-vtx-to-sky ((this sky-work) (arg0 sky-vertex) (arg1 sky-vertex) (arg2 haze-vertex)) "Convert haze vertex to sky format." (set! (-> arg0 pos quad) (-> arg2 pos quad)) (set! (-> arg0 col quad) (-> arg2 col quad)) @@ -585,7 +585,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod draw-haze sky-work ((this sky-work) (arg0 dma-buffer)) +(defmethod draw-haze ((this sky-work) (arg0 dma-buffer)) "Draw haze using large polygon renderer. Calls init-regs-for-large-polygon-draw." (local-vars (sv-16 haze-vert-array) (sv-20 (inline-array sky-vertex))) @@ -633,7 +633,7 @@ vf31: cam 0 (premultiplied by hmge) (defmethod-mips2c "(method 29 sky-work)" 29 sky-work) ;; green sun (defmethod-mips2c "(method 30 sky-work)" 30 sky-work) ;; moon -(defmethod setup-stars sky-work ((this sky-work) (arg0 matrix) (arg1 sky-upload-data)) +(defmethod setup-stars ((this sky-work) (arg0 matrix) (arg1 sky-upload-data)) "Prepare for star drawing." (set! (-> arg0 vector 2 quad) (-> arg1 sun 0 pos quad)) (vector-normalize! (-> arg0 vector 2) 1.0) @@ -659,7 +659,7 @@ vf31: cam 0 (premultiplied by hmge) (defmethod-mips2c "(method 32 sky-work)" 32 sky-work) ;; stars transform (defmethod-mips2c "(method 33 sky-work)" 33 sky-work) ;; stars dma -(defmethod draw-roof sky-work ((this sky-work) (arg0 dma-buffer)) +(defmethod draw-roof ((this sky-work) (arg0 dma-buffer)) "Draw the roof of the sky box. Uses large-polygon renderer." (rlet ((vf27 :class vf)) ;; GS setup @@ -692,7 +692,7 @@ vf31: cam 0 (premultiplied by hmge) ) ) -(defmethod draw-base sky-work ((this sky-work) (arg0 dma-buffer)) +(defmethod draw-base ((this sky-work) (arg0 dma-buffer)) "Draw the base of the sky box. Uses large-polygon renderer." (rlet ((vf27 :class vf)) (dma-buffer-add-gs-set arg0 @@ -718,7 +718,7 @@ vf31: cam 0 (premultiplied by hmge) ) ) -(defmethod draw-fog sky-work ((this sky-work) (arg0 dma-buffer)) +(defmethod draw-fog ((this sky-work) (arg0 dma-buffer)) (let ((s4-0 (-> *sky-texture-anim-array* array-data 8 tex))) (if s4-0 (dma-buffer-add-gs-set arg0 @@ -775,7 +775,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod draw sky-work ((this sky-work)) +(defmethod draw ((this sky-work)) (let ((v1-0 *time-of-day-context*) (a0-1 #f) ) diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc index fe4367bd5ef..c9b6c4f390c 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc @@ -62,95 +62,80 @@ (define *sp-60-hz* #t) (deftype sparticle-cpuinfo (structure) - ((sprite sprite-vec-data-2d :offset-assert 0) - (adgif adgif-shader :offset-assert 4) - (radius float :offset-assert 8) - (omega float :offset-assert 12) - (vel-sxvel vector :inline :offset-assert 16) - (rot-syvel vector :inline :offset-assert 32) - (fade rgbaf :inline :offset-assert 48) - (acc vector :inline :offset-assert 64) - (rotvel3d quaternion :inline :offset-assert 80) - (vel vector :inline :offset 16) - (accel vector :inline :offset 64) - (scalevelx float :offset 28) - (scalevely float :offset 44) - (friction float :offset-assert 96) - (timer int32 :offset-assert 100) - (flags sp-cpuinfo-flag :offset-assert 104) ;; NOTE - loaded with lw and lwu? - (flags-s32 sp-cpuinfo-flag-s32 :offset 104) - (user-int32 int32 :offset-assert 108) - (user-uint32 uint32 :offset 108) - (user-float float :offset 108) - (user-pntr uint32 :offset 108) - (user-object basic :offset 108) - (user-sprite sprite-vec-data-2d :offset 108) - (sp-func (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) :offset-assert 112) - (next-time uint32 :offset-assert 116) - (next-launcher basic :offset-assert 120) - (cache-alpha float :offset-assert 124) - (valid uint8 :offset-assert 128) - (clock-index uint8 :offset-assert 129) - (user1-int16 uint16 :offset-assert 130) - (key sparticle-launch-control :offset-assert 132) - (key-alt sparticle-launch-state :offset 132) - (binding sparticle-launch-state :offset-assert 136) - (data uint32 1 :offset 12) - (datab int8 4 :offset 12) - (dataf float 1 :offset 12) - (datac uint8 1 :offset 12) + ((sprite sprite-vec-data-2d) + (adgif adgif-shader) + (radius float) + (omega float) + (vel-sxvel vector :inline) + (rot-syvel vector :inline) + (fade rgbaf :inline) + (acc vector :inline) + (rotvel3d quaternion :inline) + (vel vector :inline :overlay-at vel-sxvel) + (accel vector :inline :overlay-at acc) + (scalevelx float :overlay-at (-> vel-sxvel data 3)) + (scalevely float :overlay-at (-> rot-syvel data 3)) + (friction float) + (timer int32) + (flags sp-cpuinfo-flag) + (flags-s32 sp-cpuinfo-flag-s32 :overlay-at flags) + (user-int32 int32) + (user-uint32 uint32 :overlay-at user-int32) + (user-float float :overlay-at user-int32) + (user-pntr uint32 :overlay-at user-int32) + (user-object basic :overlay-at user-int32) + (user-sprite sprite-vec-data-2d :overlay-at user-int32) + (sp-func (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none)) + (next-time uint32) + (next-launcher basic) + (cache-alpha float) + (valid uint8) + (clock-index uint8) + (user1-int16 uint16) + (key sparticle-launch-control) + (key-alt sparticle-launch-state :overlay-at key) + (binding sparticle-launch-state) + (data uint32 1 :overlay-at omega) + (datab int8 4 :overlay-at omega) + (dataf float 1 :overlay-at omega) + (datac uint8 1 :overlay-at omega) ) - :method-count-assert 9 - :size-assert #x8c - :flag-assert #x90000008c ) (deftype sparticle-launchinfo (structure) - ((launchrot vector :inline :offset-assert 0) - (conerot vector :inline :offset-assert 16) - (rotate-x float :offset-assert 32) - (rotate-y float :offset-assert 36) - (rotate-z float :offset-assert 40) - (coneradius float :offset-assert 44) - (rotate vector :inline :offset 32) - (scale-x float :offset 48) - (scale-y float :offset 52) - (scale-z float :offset 56) - (dummy float :offset 60) - (scale vector :inline :offset 48) - (data uint8 1 :offset 0) + ((launchrot vector :inline) + (conerot vector :inline) + (rotate-x float) + (rotate-y float) + (rotate-z float) + (coneradius float) + (rotate vector :inline :overlay-at rotate-x) + (scale-x float :offset 48) + (scale-y float :offset 52) + (scale-z float :offset 56) + (dummy float :offset 60) + (scale vector :inline :overlay-at scale-x) + (data uint8 1 :overlay-at (-> launchrot data 0)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype sparticle-system (basic) - ((blocks int32 2 :offset-assert 4) - (length int32 2 :offset-assert 12) - (num-alloc int32 2 :offset-assert 20) - (is-3d basic :offset-assert 28) - (flags uint32 :offset-assert 32) - (alloc-table (pointer uint64) :offset-assert 36) - (cpuinfo-table (inline-array sparticle-cpuinfo) :offset-assert 40) - (vecdata-table pointer :offset-assert 44) - (adgifdata-table (inline-array adgif-shader) :offset-assert 48) + ((blocks int32 2) + (length int32 2) + (num-alloc int32 2) + (is-3d basic) + (flags uint32) + (alloc-table (pointer uint64)) + (cpuinfo-table (inline-array sparticle-cpuinfo)) + (vecdata-table pointer) + (adgifdata-table (inline-array adgif-shader)) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 (:methods - (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_ 0) + (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_) ) ) - -0 - - - - (define-extern *sp-particle-system-2d* sparticle-system) (define-extern *sp-particle-system-3d* sparticle-system) \ No newline at end of file diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc index 8c9c5f69f51..8575fbe24be 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc @@ -365,119 +365,101 @@ ;; DECOMP BEGINS (deftype sparticle-birthinfo (structure) - ((sprite uint32 :offset-assert 0) - (anim int32 :offset-assert 4) - (anim-speed float :offset-assert 8) - (birth-func basic :offset-assert 12) - (joint-ppoint int32 :offset-assert 16) - (num-to-birth float :offset-assert 20) - (sound basic :offset-assert 24) - (dataf float 1 :offset 0) - (data uint32 1 :offset 0) + ((sprite uint32) + (anim int32) + (anim-speed float) + (birth-func basic) + (joint-ppoint int32) + (num-to-birth float) + (sound basic) + (dataf float 1 :overlay-at sprite) + (data uint32 1 :overlay-at sprite) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype sp-field-init-spec (structure) - ((field sp-field-id :offset-assert 0) - (flags sp-flag :offset-assert 2) - (initial-valuef float :offset-assert 4) - (random-rangef float :offset-assert 8) - (random-multf float :offset-assert 12) - (initial-value int32 :offset 4) - (random-range int32 :offset 8) - (random-mult int32 :offset 12) - (func symbol :offset 4) - (tex texture-id :offset 4) - (pntr pointer :offset 4) - (object basic :offset 4) - (sym symbol :offset 4) - (sound sound-spec :offset 4) + ((field sp-field-id) + (flags sp-flag) + (initial-valuef float) + (random-rangef float) + (random-multf float) + (initial-value int32 :overlay-at initial-valuef) + (random-range int32 :overlay-at random-rangef) + (random-mult int32 :overlay-at random-multf) + (func symbol :overlay-at initial-valuef) + (tex texture-id :overlay-at initial-valuef) + (pntr pointer :overlay-at initial-valuef) + (object basic :overlay-at initial-valuef) + (sym symbol :overlay-at initial-valuef) + (sound sound-spec :overlay-at initial-valuef) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype sparticle-launcher (basic) - ((birthaccum float :offset-assert 4) - (soundaccum float :offset-assert 8) - (init-specs (inline-array sp-field-init-spec) :offset-assert 12) + ((birthaccum float) + (soundaccum float) + (init-specs (inline-array sp-field-init-spec)) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (get-field-spec-by-id (_type_ sp-field-id) sp-field-init-spec 9) - (setup-user-array (_type_ string) none 10) + (get-field-spec-by-id (_type_ sp-field-id) sp-field-init-spec) + (setup-user-array (_type_ string) none) ) ) (deftype sparticle-group-item (structure) - ((launcher uint32 :offset-assert 0) - (fade-after meters :offset-assert 4) - (falloff-to meters :offset-assert 8) - (flags sp-group-item-flag :offset-assert 12) - (period uint16 :offset-assert 14) - (length uint16 :offset-assert 16) - (offset int16 :offset-assert 18) - (hour-mask uint32 :offset-assert 20) - (binding uint32 :offset-assert 24) + ((launcher uint32) + (fade-after meters) + (falloff-to meters) + (flags sp-group-item-flag) + (period uint16) + (length uint16) + (offset int16) + (hour-mask uint32) + (binding uint32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype sparticle-launch-state (structure) - ((group-item sparticle-group-item :offset-assert 0) - (flags sp-launch-state-flags :offset-assert 4) - (randomize uint16 :offset-assert 6) - (center vector :offset-assert 8) - (sprite3d sprite-vec-data-3d :offset-assert 12) - (sprite sparticle-cpuinfo :offset-assert 16) - (offset uint32 :offset-assert 20) - (accum float :offset-assert 24) - (spawn-time uint32 :offset-assert 28) - (control sparticle-launch-control :offset-assert 32) - (swarm basic :offset 20) - (seed uint32 :offset 24) - (time uint32 :offset 28) - (spec basic :offset 16) - (id uint32 :offset 12) + ((group-item sparticle-group-item) + (flags sp-launch-state-flags) + (randomize uint16) + (center vector) + (sprite3d sprite-vec-data-3d) + (sprite sparticle-cpuinfo) + (offset uint32) + (accum float) + (spawn-time uint32) + (control sparticle-launch-control) + (swarm basic :overlay-at offset) + (seed uint32 :overlay-at accum) + (time uint32 :overlay-at spawn-time) + (spec basic :overlay-at sprite) + (id uint32 :overlay-at sprite3d) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) (deftype sparticle-launch-group (basic) - ((length int16 :offset-assert 4) - (duration uint16 :offset-assert 6) - (linger-duration uint16 :offset-assert 8) - (flags sp-group-flag :offset-assert 10) - (name string :offset-assert 12) - (launcher (inline-array sparticle-group-item) :offset-assert 16) - (rotate-x degrees :offset-assert 20) - (rotate-y degrees :offset-assert 24) - (rotate-z degrees :offset-assert 28) - (scale-x float :offset-assert 32) - (scale-y float :offset-assert 36) - (scale-z float :offset-assert 40) - (bounds sphere :inline :offset-assert 48) + ((length int16) + (duration uint16) + (linger-duration uint16) + (flags sp-group-flag) + (name string) + (launcher (inline-array sparticle-group-item)) + (rotate-x degrees) + (rotate-y degrees) + (rotate-z degrees) + (scale-x float) + (scale-y float) + (scale-z float) + (bounds sphere :inline) ) - :method-count-assert 10 - :size-assert #x40 - :flag-assert #xa00000040 (:methods - (create-launch-control (_type_ process) sparticle-launch-control 9) + (create-launch-control (_type_ process) sparticle-launch-control) ) ) @@ -485,30 +467,27 @@ (define *launch-matrix* (matrix-identity! (new 'global 'matrix))) (deftype sparticle-launch-control (inline-array-class) - ((group sparticle-launch-group :offset-assert 16) - (proc process-drawable :offset-assert 20) - (local-clock int32 :offset-assert 24) - (fade float :offset-assert 28) - (matrix int8 :offset-assert 32) - (state-mode uint8 3 :offset-assert 33) - (state-counter uint32 :offset-assert 36) - (last-spawn-frame int32 :offset-assert 40) - (last-spawn-time int32 :offset-assert 44) - (origin matrix :inline :offset-assert 48) - (center vector :inline :offset 96) - (data sparticle-launch-state :inline :dynamic :offset-assert 112) + ((group sparticle-launch-group) + (proc process-drawable) + (local-clock int32) + (fade float) + (matrix int8) + (state-mode uint8 3) + (state-counter uint32) + (last-spawn-frame int32) + (last-spawn-time int32) + (origin matrix :inline) + (center vector :inline :overlay-at (-> origin data 12)) + (data sparticle-launch-state :inline :dynamic) ) - :method-count-assert 16 - :size-assert #x70 - :flag-assert #x1000000070 (:methods - (initialize (_type_ sparticle-launch-group process) none 9) - (is-visible? (_type_ vector) symbol 10) - (spawn (_type_ vector) none 11) - (spawn-with-matrix (_type_ matrix) none 12) - (spawn-with-cspace (_type_ cspace) none 13) - (kill-and-free-particles (_type_) none 14) - (kill-particles (_type_) none 15) + (initialize (_type_ sparticle-launch-group process) none) + (is-visible? (_type_ vector) symbol) + (spawn (_type_ vector) none) + (spawn-with-matrix (_type_ matrix) none) + (spawn-with-cspace (_type_ cspace) none) + (kill-and-free-particles (_type_) none) + (kill-particles (_type_) none) ) ) diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc index f2582a7bde7..8f6661efe5a 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc @@ -191,23 +191,17 @@ ) (deftype sp-queued-launch-particles (structure) - ((sp-system sparticle-system :offset-assert 0) - (sp-launcher sparticle-launcher :offset-assert 4) - (pos vector :inline :offset-assert 16) + ((sp-system sparticle-system) + (sp-launcher sparticle-launcher) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype sp-launch-queue (basic) - ((in-use int32 :offset-assert 4) - (queue sp-queued-launch-particles 256 :inline :offset-assert 16) + ((in-use int32) + (queue sp-queued-launch-particles 256 :inline) ) - :method-count-assert 9 - :size-assert #x2010 - :flag-assert #x900002010 ) @@ -248,15 +242,12 @@ ) (deftype particle-adgif-cache (basic) - ((used int32 :offset-assert 4) - (last uint16 :offset-assert 8) - (lastgif adgif-shader :offset-assert 12) - (tidhash uint16 80 :offset-assert 16) - (spadgif adgif-shader 80 :inline :offset-assert 176) + ((used int32) + (last uint16) + (lastgif adgif-shader) + (tidhash uint16 80) + (spadgif adgif-shader 80 :inline) ) - :method-count-assert 9 - :size-assert #x19b0 - :flag-assert #x9000019b0 ) @@ -470,26 +461,23 @@ ) (deftype sp-launch-stack (structure) - ((ra basic :offset-assert 0) - (dummy0 basic :offset-assert 4) - (dummy1 basic :offset-assert 8) - (b-spfic basic :offset-assert 12) - (r16 uint128 :offset-assert 16) - (r17 uint128 :offset-assert 32) - (r18 uint128 :offset-assert 48) - (pos uint128 :offset-assert 64) - (matrix matrix :inline :offset-assert 80) - (l-spfic basic :offset-assert 144) - (birth-info sparticle-birthinfo :inline :offset-assert 160) - (sprite sprite-vec-data-2d :inline :offset-assert 192) - (r19 uint128 :offset-assert 240) - (r20 uint128 :offset-assert 256) - (r21 uint128 :offset-assert 272) - (r22 uint128 :offset-assert 288) + ((ra basic) + (dummy0 basic) + (dummy1 basic) + (b-spfic basic) + (r16 uint128) + (r17 uint128) + (r18 uint128) + (pos uint128) + (matrix matrix :inline) + (l-spfic basic) + (birth-info sparticle-birthinfo :inline) + (sprite sprite-vec-data-2d :inline) + (r19 uint128) + (r20 uint128) + (r21 uint128) + (r22 uint128) ) - :method-count-assert 9 - :size-assert #x130 - :flag-assert #x900000130 ) @@ -784,7 +772,7 @@ ) ) -(defmethod initialize sparticle-launch-control ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) +(defmethod initialize ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) (let ((s5-0 0)) (set! (-> this group) arg0) (set! (-> this proc) (the-as process-drawable arg1)) @@ -867,7 +855,7 @@ ) ;; WARN: Return type mismatch object vs sparticle-launch-control. -(defmethod create-launch-control sparticle-launch-group ((this sparticle-launch-group) (arg0 process)) +(defmethod create-launch-control ((this sparticle-launch-group) (arg0 process)) (let ((gp-0 (the-as object (new 'process 'sparticle-launch-control (-> this length))))) (when (zero? (the-as sparticle-launch-control gp-0)) (go process-drawable-art-error "memory") @@ -880,7 +868,7 @@ ) ) -(defmethod kill-and-free-particles sparticle-launch-control ((this sparticle-launch-control)) +(defmethod kill-and-free-particles ((this sparticle-launch-control)) (countdown (v1-0 (-> this length)) (let ((a0-4 (-> this data v1-0))) (logclear! (-> a0-4 flags) (sp-launch-state-flags particles-active)) @@ -896,13 +884,13 @@ (none) ) -(defmethod kill-particles sparticle-launch-control ((this sparticle-launch-control)) +(defmethod kill-particles ((this sparticle-launch-control)) (kill-all-particles-with-key this) 0 (none) ) -(defmethod is-visible? sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) +(defmethod is-visible? ((this sparticle-launch-control) (arg0 vector)) (let* ((v1-0 (-> this group)) (f0-0 (-> v1-0 bounds r)) ) @@ -916,7 +904,10 @@ (else (let ((s5-1 (vector+! (new 'stack-no-clear 'vector) arg0 (the-as vector (-> v1-0 bounds))))) (set! (-> s5-1 w) f0-0) - (when (or *display-sprite-marks* *display-sprite-spheres* (and *display-actor-vis* (= (-> this proc) *debug-actor*))) + (when (or *display-sprite-marks* + *display-sprite-spheres* + (and *display-actor-vis* (= (-> this proc) *debug-actor*)) + ) (add-debug-sphere *display-sprite-spheres* (bucket-id debug2) @@ -942,7 +933,7 @@ ) ) -(defmethod spawn-with-matrix sparticle-launch-control ((this sparticle-launch-control) (arg0 matrix)) +(defmethod spawn-with-matrix ((this sparticle-launch-control) (arg0 matrix)) (let* ((a2-0 (-> this origin)) (a3-0 arg0) (v1-0 (-> a3-0 quad 0)) @@ -988,7 +979,7 @@ (none) ) -(defmethod spawn-with-cspace sparticle-launch-control ((this sparticle-launch-control) (arg0 cspace)) +(defmethod spawn-with-cspace ((this sparticle-launch-control) (arg0 cspace)) (let* ((v1-0 (-> this origin)) (a3-0 (-> arg0 bone transform)) (a0-2 (-> a3-0 quad 0)) @@ -1035,7 +1026,7 @@ ) ;; WARN: Function (method 11 sparticle-launch-control) has a return type of none, but the expression builder found a return statement. -(defmethod spawn sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) +(defmethod spawn ((this sparticle-launch-control) (arg0 vector)) (with-pp (set! (-> this origin trans quad) (-> arg0 quad)) (if (not (or (is-visible? this arg0) (logtest? (-> this group flags) (sp-group-flag always-draw screen-space)))) @@ -1979,7 +1970,7 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod get-field-spec-by-id sparticle-launcher ((this sparticle-launcher) (arg0 sp-field-id)) +(defmethod get-field-spec-by-id ((this sparticle-launcher) (arg0 sp-field-id)) "Returns the [[sp-field-init-spec]] that has the matching [[sp-field-id]]" (let ((v1-0 0)) (until #f @@ -2001,7 +1992,7 @@ (the-as sp-field-init-spec #f) ) -(defmethod setup-user-array sparticle-launcher ((this sparticle-launcher) (arg0 string)) +(defmethod setup-user-array ((this sparticle-launcher) (arg0 string)) (let ((s5-0 (get-field-spec-by-id this (sp-field-id spt-texture))) (v1-1 (lookup-texture-id-by-name arg0 (the-as string #f))) ) diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc index 03282919762..4912009106c 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc @@ -12,7 +12,8 @@ ;; DECOMP BEGINS -(defmethod print sparticle-cpuinfo ((this sparticle-cpuinfo)) +;; WARN: Return type mismatch object vs sparticle-cpuinfo. +(defmethod print ((this sparticle-cpuinfo)) (format #t "~%") (dotimes (s5-0 16) (format #t "~D:~F~%" s5-0 (the-as float (-> this data s5-0))) @@ -21,6 +22,7 @@ (the-as sparticle-cpuinfo (format #t "FLAGS:~X~%" (-> this flags))) ) +;; WARN: Return type mismatch (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) vs none. (defun sp-particle-copy! ((arg0 sparticle-cpuinfo) (arg1 sparticle-cpuinfo)) (let ((v1-1 (-> arg1 sprite x-y-z-sx quad))) (set! (-> arg0 sprite x-y-z-sx quad) v1-1) @@ -54,6 +56,7 @@ (arg3 pointer) (arg4 (inline-array adgif-shader)) ) + ;; og:preserve-this (#when PC_BIG_MEMORY (*! arg0 SPRITE_MAX_AMOUNT_MULT) ; (*! arg1 SPRITE_MAX_AMOUNT_MULT) @@ -274,6 +277,7 @@ ) (def-mips2c sp-process-block-2d (function sparticle-system int int int int symbol none)) + (def-mips2c sp-process-block-3d (function sparticle-system int int int int symbol none)) (defun sp-copy-to-spr ((arg0 int) (arg1 pointer) (arg2 int)) @@ -429,7 +433,7 @@ ) (defun sparticle-kill-it-level0 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) - (if (zero? (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1))) + (if (not (logtest? (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1))) (sparticle-kill-it arg0 arg1) ) 0 @@ -598,6 +602,7 @@ (none) ) +;; WARN: Return type mismatch gs-miptbp vs none. (defun remap-particle ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer)) (let* ((gp-0 (-> arg1 adgif)) (a0-1 (-> gp-0 texture-id)) @@ -709,7 +714,3 @@ (none) ) ) - - - - diff --git a/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc b/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc index 58548f8e206..566225ca14c 100644 --- a/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc @@ -8,29 +8,26 @@ ;; DECOMP BEGINS (deftype sprite-glow-data (structure) - ((position vector :inline :offset-assert 0) - (size-x float :offset 12) - (size-probe float :offset-assert 16) - (z-offset float :offset-assert 20) - (rot-angle float :offset-assert 24) - (size-y float :offset-assert 28) - (color rgbaf :inline :offset-assert 32) - (fade-a float :offset-assert 48) - (fade-b float :offset-assert 52) - (tex-id texture-id :offset-assert 56) - (dummy uint32 :offset-assert 60) - (quads vector 4 :inline :offset 0) + ((position vector :inline) + (size-x float :overlay-at (-> position data 3)) + (size-probe float) + (z-offset float) + (rot-angle float) + (size-y float) + (color rgbaf :inline) + (fade-a float) + (fade-b float) + (tex-id texture-id) + (dummy uint32) + (quads vector 4 :inline :overlay-at position) ) - :method-count-assert 10 - :size-assert #x40 - :flag-assert #xa00000040 (:methods - (set-trans (_type_ vector) none 9) + (set-trans (_type_ vector) none) ) ) -(defmethod set-trans sprite-glow-data ((this sprite-glow-data) (arg0 vector)) +(defmethod set-trans ((this sprite-glow-data) (arg0 vector)) (let ((f0-0 (-> this position w))) (set! (-> this position quad) (-> arg0 quad)) (set! (-> this position w) f0-0) @@ -40,16 +37,13 @@ ) (deftype simple-sprite-system (structure) - ((count int16 :offset-assert 0) - (max-count int16 :offset-assert 2) - (data (inline-array sprite-glow-data) :offset-assert 4) + ((count int16) + (max-count int16) + (data (inline-array sprite-glow-data)) ) - :method-count-assert 12 - :size-assert #x8 - :flag-assert #xc00000008 (:methods - (add! (_type_ sprite-glow-data) none 9) - (draw-all-sprites! (_type_ dma-buffer) none 10) - (clear! (_type_) none 11) + (add! (_type_ sprite-glow-data) none) + (draw-all-sprites! (_type_ dma-buffer) none) + (clear! (_type_) none) ) ) diff --git a/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc b/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc index 6f5876eccb9..a0477a9492a 100644 --- a/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc +++ b/goal_src/jak2/engine/gfx/sprite/sprite-distort.gc @@ -21,26 +21,21 @@ across the screen. The resolution of the circle is defined by the number of "tur ;; DECOMP BEGINS -;; Contains the base mesh of each possible distort sprite shape. Everything excluding aspx and aspy -;; are uploaded to VU memory. -;; -;; See sprite-distorter-generate-tables. (deftype sprite-distorter-sine-tables (basic) - ((aspx float :offset-assert 4) - (aspy float :offset-assert 8) - (entry vector 128 :inline :offset-assert 16) - (ientry qword 9 :inline :offset-assert 2064) - (giftag gs-gif-tag :inline :offset-assert 2208) - (color qword :inline :offset-assert 2224) + ((aspx float) + (aspy float) + (entry vector 128 :inline) + (ientry qword 9 :inline) + (giftag gs-gif-tag :inline) + (color qword :inline) ) - :method-count-assert 9 - :size-assert #x8c0 - :flag-assert #x9000008c0 ) (kmemopen global "sprite-distort-tables") + (define *sprite-distorter-sine-tables* (new 'global 'sprite-distorter-sine-tables)) + (kmemclose) ;; Called from update-math-camera. @@ -245,17 +240,17 @@ across the screen. The resolution of the circle is defined by the number of "tur (set! dma-color (&+ (the-as pointer dma-position) 32)) (cond ((= (the-as int (-> sprite flag-rot-sy y)) 1) - (.lvf vf3 (&-> *math-camera* sprite-2d vector 0 quad)) - (.lvf vf4 (&-> *math-camera* sprite-2d vector 1 quad)) - (.lvf vf5 (&-> *math-camera* sprite-2d vector 2 quad)) + (.lvf vf3 (&-> *math-camera* sprite-2d quad 0)) + (.lvf vf4 (&-> *math-camera* sprite-2d quad 1)) + (.lvf vf5 (&-> *math-camera* sprite-2d quad 2)) (.lvf vf6 (&-> *math-camera* sprite-2d trans quad)) (.lvf vf9 (&-> *math-camera* sprite-2d-hvdf quad)) (.mov v1-15 vf9) ) (else - (.lvf vf3 (&-> *math-camera* camera-temp vector 0 quad)) - (.lvf vf4 (&-> *math-camera* camera-temp vector 1 quad)) - (.lvf vf5 (&-> *math-camera* camera-temp vector 2 quad)) + (.lvf vf3 (&-> *math-camera* camera-temp quad 0)) + (.lvf vf4 (&-> *math-camera* camera-temp quad 1)) + (.lvf vf5 (&-> *math-camera* camera-temp quad 2)) (.lvf vf6 (&-> *math-camera* camera-temp trans quad)) (.lvf vf9 (&-> *math-camera* hvdf-off quad)) (.mov v1-21 vf9) @@ -290,7 +285,7 @@ across the screen. The resolution of the circle is defined by the number of "tur (set! (-> sprite flag-rot-sy x) (the-as float #xb)) ) (set! (-> (the-as (pointer int32) dma-st-flag) 3) (the-as int (-> sprite flag-rot-sy x))) - (let* ((f1-4 (- (-> *math-camera* perspective data 5))) + (let* ((f1-4 (- (-> *math-camera* perspective vector 1 y))) (f2-2 (-> (the-as vector dma-st-flag) y)) (f4-0 (+ f2-2 (* (-> (the-as vector dma-color) x) f1-4))) (f3-0 256.0) diff --git a/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc b/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc index a7a370b16f2..6e7afd6d13d 100644 --- a/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc +++ b/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc @@ -8,78 +8,67 @@ ;; DECOMP BEGINS (deftype sprite-glow-template (structure) - ((clear-init-giftag gs-gif-tag :inline :offset-assert 0) - (clear-init-adcmds gs-adcmd 5 :inline :offset-assert 16) - (clear-draw-giftag gs-gif-tag :inline :offset-assert 96) - (clear-draw-clr-0 gs-packed-rgba :inline :offset-assert 112) - (clear-draw-xyz-0 gs-packed-xyzw 2 :inline :offset-assert 128) ;; 8 - (clear-draw-clr-1 gs-packed-rgba :inline :offset-assert 160) - (clear-draw-xyz-1 vector 2 :inline :offset-assert 176) ;; 11 - - (offscr-setup-giftag gs-gif-tag :inline :offset-assert 208) ;; 13 - (offscr-setup-adcmds gs-adcmd 8 :inline :offset-assert 224) - (offscr-first-giftag gs-gif-tag :inline :offset-assert 352) - (offscr-first-clr gs-packed-rgba :inline :offset-assert 368) - (offscr-first-uv-0 gs-packed-uv :inline :offset-assert 384) ;; 24 - (offscr-first-xyzw-0 gs-packed-xyzw :inline :offset-assert 400) - (offscr-first-uv-1 gs-packed-uv :inline :offset-assert 416) ;; 26 - (offscr-first-xyzw-1 gs-packed-xyzw :inline :offset-assert 432) - - (repeat-draw-giftag gs-gif-tag :inline :offset-assert 448) ;; 28 - (repeat-draw-adcmds gs-adcmd 29 :inline :offset-assert 464) - - (flare-alpha-giftag gs-gif-tag :inline :offset-assert 928) ;; 58 - (flare-alpha-clr gs-packed-rgba :inline :offset-assert 944) - (flare-alpha-uv gs-packed-uv :inline :offset-assert 960) - (flare-alpha-xyzw-0 gs-packed-xyzw :inline :offset-assert 976) ;; 61 - (flare-alpha-xyzw-1 gs-packed-xyzw :inline :offset-assert 992) - (flare-alpha-xyzw-2 gs-packed-xyzw :inline :offset-assert 1008) - (flare-alpha-xyzw-3 gs-packed-xyzw :inline :offset-assert 1024) - - (flare-init-giftag gs-gif-tag :inline :offset-assert 1040) ;; 65 - (flare-init-adcmds gs-adcmd 8 :inline :offset-assert 1056) - - (flare-draw-giftag gs-gif-tag :inline :offset-assert 1184) ;; 74 - (flare-draw-clr gs-packed-rgba :inline :offset-assert 1200) - (flare-draw-stq-0 gs-packed-stq :inline :offset-assert 1216) - (flare-draw-xyzw-0 gs-packed-xyzw :inline :offset-assert 1232) ;; 77 - (flare-draw-stq-1 gs-packed-stq :inline :offset-assert 1248) - (flare-draw-xyzw-1 gs-packed-xyzw :inline :offset-assert 1264) - (flare-draw-stq-2 gs-packed-stq :inline :offset-assert 1280) - (flare-draw-xyzw-2 gs-packed-xyzw :inline :offset-assert 1296) - (flare-draw-stq-3 gs-packed-stq :inline :offset-assert 1312) - (flare-draw-xyzw-3 gs-packed-xyzw :inline :offset-assert 1328) + ((clear-init-giftag gs-gif-tag :inline) + (clear-init-adcmds gs-adcmd 5 :inline) + (clear-draw-giftag gs-gif-tag :inline) + (clear-draw-clr-0 gs-packed-rgba :inline) + (clear-draw-xyz-0 gs-packed-xyzw 2 :inline) + (clear-draw-clr-1 gs-packed-rgba :inline) + (clear-draw-xyz-1 vector 2 :inline) + (offscr-setup-giftag gs-gif-tag :inline) + (offscr-setup-adcmds gs-adcmd 8 :inline) + (offscr-first-giftag gs-gif-tag :inline) + (offscr-first-clr gs-packed-rgba :inline) + (offscr-first-uv-0 gs-packed-uv :inline) + (offscr-first-xyzw-0 gs-packed-xyzw :inline) + (offscr-first-uv-1 gs-packed-uv :inline) + (offscr-first-xyzw-1 gs-packed-xyzw :inline) + (repeat-draw-giftag gs-gif-tag :inline) + (repeat-draw-adcmds gs-adcmd 29 :inline) + (flare-alpha-giftag gs-gif-tag :inline) + (flare-alpha-clr gs-packed-rgba :inline) + (flare-alpha-uv gs-packed-uv :inline) + (flare-alpha-xyzw-0 gs-packed-xyzw :inline) + (flare-alpha-xyzw-1 gs-packed-xyzw :inline) + (flare-alpha-xyzw-2 gs-packed-xyzw :inline) + (flare-alpha-xyzw-3 gs-packed-xyzw :inline) + (flare-init-giftag gs-gif-tag :inline) + (flare-init-adcmds gs-adcmd 8 :inline) + (flare-draw-giftag gs-gif-tag :inline) + (flare-draw-clr gs-packed-rgba :inline) + (flare-draw-stq-0 gs-packed-stq :inline) + (flare-draw-xyzw-0 gs-packed-xyzw :inline) + (flare-draw-stq-1 gs-packed-stq :inline) + (flare-draw-xyzw-1 gs-packed-xyzw :inline) + (flare-draw-stq-2 gs-packed-stq :inline) + (flare-draw-xyzw-2 gs-packed-xyzw :inline) + (flare-draw-stq-3 gs-packed-stq :inline) + (flare-draw-xyzw-3 gs-packed-xyzw :inline) ) - :method-count-assert 9 - :size-assert #x540 - :flag-assert #x900000540 ) (deftype sprite-glow-consts (structure) - ((camera matrix :inline :offset-assert 0) - (perspective matrix :inline :offset-assert 64) - (hvdf-offset vector :inline :offset-assert 128) - (hmge-scale vector :inline :offset-assert 144) - (consts vector :inline :offset-assert 160) - (pfog0 float :offset 160) - (deg-to-rad float :offset 164) - (min-scale float :offset 168) - (inv-area float :offset 172) - (sincos-01 vector :inline :offset-assert 176) - (sincos-23 vector :inline :offset-assert 192) - (sincos-45 vector :inline :offset-assert 208) - (sincos-67 vector :inline :offset-assert 224) - (sincos-89 vector :inline :offset-assert 240) - (basis-x vector :inline :offset-assert 256) - (basis-y vector :inline :offset-assert 272) - (xy-array vector 4 :inline :offset-assert 288) - (clamp-min vector :inline :offset-assert 352) - (clamp-max vector :inline :offset-assert 368) + ((camera matrix :inline) + (perspective matrix :inline) + (hvdf-offset vector :inline) + (hmge-scale vector :inline) + (consts vector :inline) + (pfog0 float :overlay-at (-> consts data 0)) + (deg-to-rad float :overlay-at (-> consts data 1)) + (min-scale float :overlay-at (-> consts data 2)) + (inv-area float :overlay-at (-> consts data 3)) + (sincos-01 vector :inline) + (sincos-23 vector :inline) + (sincos-45 vector :inline) + (sincos-67 vector :inline) + (sincos-89 vector :inline) + (basis-x vector :inline) + (basis-y vector :inline) + (xy-array vector 4 :inline) + (clamp-min vector :inline) + (clamp-max vector :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) @@ -386,49 +375,40 @@ ) (deftype sprite-glow-dma-packet-data (structure) - ((control-packet dma-packet :inline :offset-assert 0) - (vecdata-packet dma-packet :inline :offset-assert 16) - (shader-cnt-packet dma-packet :inline :offset-assert 32) - (shader-ref-packet dma-packet :inline :offset-assert 48) - (mscal-packet dma-packet :inline :offset-assert 64) + ((control-packet dma-packet :inline) + (vecdata-packet dma-packet :inline) + (shader-cnt-packet dma-packet :inline) + (shader-ref-packet dma-packet :inline) + (mscal-packet dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype sprite-glow-cnt-template (structure) - ((control-packet dma-packet :inline :offset-assert 0) - (num-sprites uint32 :offset-assert 16) - (dummys uint32 3 :offset-assert 20) - (num-sprites-quad uint128 :offset 16) - (vecdata-packet dma-packet :inline :offset-assert 32) - (vecdata sprite-glow-data :inline :offset-assert 48) - (shader-packet dma-packet :inline :offset-assert 112) - (shader adgif-shader :inline :offset-assert 128) - (mscal-packet dma-packet :inline :offset-assert 208) + ((control-packet dma-packet :inline) + (num-sprites uint32) + (dummys uint32 3) + (num-sprites-quad uint128 :overlay-at num-sprites) + (vecdata-packet dma-packet :inline) + (vecdata sprite-glow-data :inline) + (shader-packet dma-packet :inline) + (shader adgif-shader :inline) + (mscal-packet dma-packet :inline) ) - :method-count-assert 9 - :size-assert #xe0 - :flag-assert #x9000000e0 ) (deftype sprite-glow-ref-template (structure) - ((control-packet dma-packet :inline :offset-assert 0) - (num-sprites uint32 :offset-assert 16) - (dummys uint32 3 :offset-assert 20) - (num-sprites-quad uint128 :offset 16) - (vecdata-packet dma-packet :inline :offset-assert 32) - (vecdata sprite-glow-data :inline :offset-assert 48) - (shader-packet dma-packet :inline :offset-assert 112) - (shader-packet-ptr pointer :offset 116) - (mscal-packet dma-packet :inline :offset-assert 128) + ((control-packet dma-packet :inline) + (num-sprites uint32) + (dummys uint32 3) + (num-sprites-quad uint128 :overlay-at num-sprites) + (vecdata-packet dma-packet :inline) + (vecdata sprite-glow-data :inline) + (shader-packet dma-packet :inline) + (shader-packet-ptr pointer :offset 116) + (mscal-packet dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) @@ -581,7 +561,7 @@ (none) ) -(defmethod add! simple-sprite-system ((this simple-sprite-system) (arg0 sprite-glow-data)) +(defmethod add! ((this simple-sprite-system) (arg0 sprite-glow-data)) (let ((v1-0 (-> this count))) (when (< v1-0 (-> this max-count)) (let* ((a2-3 (-> this data v1-0)) @@ -620,12 +600,13 @@ ) ) -(defmethod draw-all-sprites! simple-sprite-system ((this simple-sprite-system) (arg0 dma-buffer)) +(defmethod draw-all-sprites! ((this simple-sprite-system) (arg0 dma-buffer)) (local-vars (sv-528 sprite-glow-dma-packet-data) (sv-532 (pointer texture-id)) (sv-536 pointer)) (b! (zero? (-> this count)) cfg-13 :delay (nop!)) (set! sv-528 *sprite-glow-dma-packet-data*) (set! sv-532 (new 'stack-no-clear 'array 'texture-id 128)) (set! sv-536 (-> arg0 base)) + ;; og:preserve-this (when (> (-> this count) 128) (format 0 "TOO MANY SPRITES (~D)~%" (-> this count)) (break!) @@ -655,7 +636,7 @@ (none) ) -(defmethod clear! simple-sprite-system ((this simple-sprite-system)) +(defmethod clear! ((this simple-sprite-system)) (set! (-> this count) 0) 0 (none) diff --git a/goal_src/jak2/engine/gfx/sprite/sprite-h.gc b/goal_src/jak2/engine/gfx/sprite/sprite-h.gc index d67e3781c3a..aae5abc49a2 100644 --- a/goal_src/jak2/engine/gfx/sprite/sprite-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/sprite-h.gc @@ -17,88 +17,76 @@ ;; DECOMP BEGINS (deftype sprite-vec-data-2d (structure) - ((x-y-z-sx vector :inline :offset-assert 0) - (flag-rot-sy vector :inline :offset-assert 16) - (r-g-b-a vector :inline :offset-assert 32) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (sx float :offset 12) - (sy float :offset 28) - (rot float :offset 24) - (flag int32 :offset 16) - (matrix int32 :offset 20) - (warp-turns int32 :offset 16) - (r float :offset 32) - (g float :offset 36) - (b float :offset 40) - (a float :offset 44) - (trans vector3s :inline :offset 0) - (color rgbaf :inline :offset 32) - (data uint128 1 :offset 0) - (data64 uint64 6 :offset 0) + ((x-y-z-sx vector :inline) + (flag-rot-sy vector :inline) + (r-g-b-a vector :inline) + (x float :overlay-at (-> x-y-z-sx data 0)) + (y float :overlay-at (-> x-y-z-sx data 1)) + (z float :overlay-at (-> x-y-z-sx data 2)) + (sx float :overlay-at (-> x-y-z-sx data 3)) + (sy float :overlay-at (-> flag-rot-sy data 3)) + (rot float :overlay-at (-> flag-rot-sy data 2)) + (flag int32 :overlay-at (-> flag-rot-sy data 0)) + (matrix int32 :overlay-at (-> flag-rot-sy data 1)) + (warp-turns int32 :overlay-at (-> flag-rot-sy data 0)) + (r float :overlay-at (-> r-g-b-a data 0)) + (g float :overlay-at (-> r-g-b-a data 1)) + (b float :overlay-at (-> r-g-b-a data 2)) + (a float :overlay-at (-> r-g-b-a data 3)) + (trans vector3s :inline :overlay-at (-> x-y-z-sx data 0)) + (color rgbaf :inline :overlay-at (-> r-g-b-a data 0)) + (data uint128 1 :overlay-at (-> x-y-z-sx data 0)) + (data64 uint64 6 :overlay-at (-> x-y-z-sx data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype sprite-array-2d (basic) - ((num-sprites int32 2 :offset-assert 4) - (num-valid int32 2 :offset-assert 12) - (vec-data pointer :offset-assert 20) - (adgif-data (inline-array adgif-shader) :offset-assert 24) - (pad uint128 4 :offset-assert 32) - (data uint128 1 :offset-assert 96) + ((num-sprites int32 2) + (num-valid int32 2) + (vec-data pointer) + (adgif-data (inline-array adgif-shader)) + (pad uint128 4) + (data uint128 1) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 (:methods - (new (symbol type int int) _type_ 0) + (new (symbol type int int) _type_) ) ) (deftype sprite-vec-data-3d (structure) - ((x-y-z-sx vector :inline :offset-assert 0) - (qx-qy-qz-sy vector :inline :offset-assert 16) - (r-g-b-a vector :inline :offset-assert 32) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (sx float :offset 12) - (sy float :offset 28) - (qx float :offset 16) - (qy float :offset 20) - (qz float :offset 24) - (r float :offset 32) - (g float :offset 36) - (b float :offset 40) - (a float :offset 44) - (trans vector3s :inline :offset 0) - (rot vector3s :inline :offset 16) - (color rgbaf :inline :offset 32) - (data uint128 1 :offset 0) + ((x-y-z-sx vector :inline) + (qx-qy-qz-sy vector :inline) + (r-g-b-a vector :inline) + (x float :overlay-at (-> x-y-z-sx data 0)) + (y float :overlay-at (-> x-y-z-sx data 1)) + (z float :overlay-at (-> x-y-z-sx data 2)) + (sx float :overlay-at (-> x-y-z-sx data 3)) + (sy float :overlay-at (-> qx-qy-qz-sy data 3)) + (qx float :overlay-at (-> qx-qy-qz-sy data 0)) + (qy float :overlay-at (-> qx-qy-qz-sy data 1)) + (qz float :overlay-at (-> qx-qy-qz-sy data 2)) + (r float :overlay-at (-> r-g-b-a data 0)) + (g float :overlay-at (-> r-g-b-a data 1)) + (b float :overlay-at (-> r-g-b-a data 2)) + (a float :overlay-at (-> r-g-b-a data 3)) + (trans vector3s :inline :overlay-at (-> x-y-z-sx data 0)) + (rot vector3s :inline :overlay-at (-> qx-qy-qz-sy data 0)) + (color rgbaf :inline :overlay-at (-> r-g-b-a data 0)) + (data uint128 1 :overlay-at (-> x-y-z-sx data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype sprite-array-3d (basic) - ((num-sprites int32 2 :offset-assert 4) - (num-valid int32 2 :offset-assert 12) - (vec-data pointer :offset-assert 20) - (adgif-data (inline-array adgif-shader) :offset-assert 24) - (data uint128 1 :offset-assert 32) + ((num-sprites int32 2) + (num-valid int32 2) + (vec-data pointer) + (adgif-data (inline-array adgif-shader)) + (data uint128 1) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 (:methods - (new (symbol type int int) _type_ 0) + (new (symbol type int int) _type_) ) ) diff --git a/goal_src/jak2/engine/gfx/sprite/sprite.gc b/goal_src/jak2/engine/gfx/sprite/sprite.gc index 8e0e4842bfd..bf3df66c888 100644 --- a/goal_src/jak2/engine/gfx/sprite/sprite.gc +++ b/goal_src/jak2/engine/gfx/sprite/sprite.gc @@ -26,12 +26,9 @@ the sprite renderer draw 2D or 3D sprites ;; This is the first quadword of the data sent to VU1. ;; It contains the number of sprites that should be drawn. (deftype sprite-header (structure) - ((header qword 1 :inline :offset-assert 0) - (num-sprites int32 :offset 0) + ((header qword 1 :inline) + (num-sprites int32 :overlay-at (-> header 0 data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -48,22 +45,16 @@ the sprite renderer draw 2D or 3D sprites ;; the meaning of this is unknown. ;; the first one in the list is special and the remaining 75 can be allocated/freed. (deftype sprite-hvdf-data (structure) - ((data qword 76 :inline :offset-assert 0) + ((data qword 76 :inline) ) - :method-count-assert 9 - :size-assert #x4c0 - :flag-assert #x9000004c0 ) ;; Each byte indicates if the corresponding entry in ;; sprite-hvdf-data is allocated or not. (deftype sprite-hvdf-control (structure) - ((alloc int8 76 :offset-assert 0) + ((alloc int8 76) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) (define *sprite-hvdf-data* (new 'global 'sprite-hvdf-data)) @@ -84,33 +75,28 @@ the sprite renderer draw 2D or 3D sprites ;; Represents a particle in *sprite-aux-list*. ;; The aux-type specifies what kind of aux sprite it is (distort, glow, etc.). (deftype sprite-aux-elem (structure) - ((aux-type sprite-aux-type :offset-assert 0) - (data vector 3 :offset-assert 4) - (vec-data sprite-vec-data-2d :offset 4) - (gif-data adgif-shader :offset 8) - (aux-data sparticle-cpuinfo :offset 12) + ((aux-type sprite-aux-type) + (data vector 3) + (vec-data sprite-vec-data-2d :overlay-at (-> data 0)) + (gif-data adgif-shader :overlay-at (-> data 1)) + (aux-data sparticle-cpuinfo :overlay-at (-> data 2)) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + (deftype sprite-aux-list (basic) - ((num-entries int32 :offset-assert 4) ;; capacity - (entry int32 :offset-assert 8) ;; current size - (data sprite-aux-elem :inline :dynamic :offset-assert 12) + ((num-entries int32) ;; capacity + (entry int32) ;; current size + (data sprite-aux-elem :inline :dynamic) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) (defmethod new sprite-aux-list ((allocation symbol) (type-to-make type) (size int)) - + ;; og:preserve-this (#when PC_BIG_MEMORY (*! size SPRITE_AUX_MAX_AMOUNT_MULT)) @@ -165,44 +151,43 @@ the sprite renderer draw 2D or 3D sprites ;; The sprite-frame-data is data transferred to VU1 and remains there for all chunks of sprites. (deftype sprite-frame-data (structure) - ((cdata vector 16 :inline :offset 0) - (xy-array vector 8 :inline :offset 0) - (st-array vector 4 :inline :offset 128) - (xyz-array vector 4 :inline :offset 192) - (hmge-scale vector :inline :offset 256) ;; math camera value - (consts vector :inline :offset 272) - (pfog0 float :offset 272) ;; math camera value - (deg-to-rad float :offset 276) ;; 2*pi / 65,536 - (min-scale float :offset 280) - (inv-area float :offset 284) - (adgif-giftag gs-gif-tag :inline :offset-assert 288) ;; sets adgif shader values - (sprite-2d-giftag gs-gif-tag :inline :offset-assert 304) ;; draws 2d sprites - (sprite-2d-giftag-2 gs-gif-tag :inline :offset-assert 320) ;; 2d with different settings - (sincos-01 vector :inline :offset-assert 336) - (sincos-23 vector :inline :offset-assert 352) - (sincos-45 vector :inline :offset-assert 368) - (sincos-67 vector :inline :offset-assert 384) - (sincos-89 vector :inline :offset-assert 400) - (basis-x vector :inline :offset-assert 416) - (basis-y vector :inline :offset-assert 432) - (sprite-3d-giftag gs-gif-tag :inline :offset-assert 448) ;; draws 3d sprites - (sprite-3d-giftag-2 gs-gif-tag :inline :offset-assert 464) - (screen-shader adgif-shader :inline :offset-assert 480) - (inv-hmge-scale vector :inline :offset 576) ;; math camera value - (stq-offset vector :inline :offset-assert 592) - (stq-scale vector :inline :offset-assert 608) - (rgba-plain qword :inline :offset-assert 624) - (warp-giftag gs-gif-tag :inline :offset-assert 640) - (fog-clamp vector :inline :offset-assert 656) - (fog-min float :offset 656) - (fog-max float :offset 660) - (max-scale float :offset 664) + ((cdata vector 16 :inline :offset 0) + (xy-array vector 8 :inline :overlay-at (-> cdata 0)) + (st-array vector 4 :inline :overlay-at (-> cdata 8)) + (xyz-array vector 4 :inline :overlay-at (-> cdata 12)) + (hmge-scale vector :inline :offset 256) ;; math camera value + (consts vector :inline :offset 272) + (pfog0 float :overlay-at (-> consts x)) ;; math camera value + (deg-to-rad float :overlay-at (-> consts y)) ;; 2*pi / 65,536 + (min-scale float :overlay-at (-> consts z)) + (inv-area float :overlay-at (-> consts w)) + (adgif-giftag gs-gif-tag :inline) ;; sets adgif shader values + (sprite-2d-giftag gs-gif-tag :inline) ;; draws 2d sprites + (sprite-2d-giftag-2 gs-gif-tag :inline) ;; 2d with different settings + (sincos-01 vector :inline) + (sincos-23 vector :inline) + (sincos-45 vector :inline) + (sincos-67 vector :inline) + (sincos-89 vector :inline) + (basis-x vector :inline) + (basis-y vector :inline) + (sprite-3d-giftag gs-gif-tag :inline) ;; draws 3d sprites + (sprite-3d-giftag-2 gs-gif-tag :inline) + (screen-shader adgif-shader :inline) + (inv-hmge-scale vector :inline :offset 576) ;; math camera value + (stq-offset vector :inline) + (stq-scale vector :inline) + (rgba-plain qword :inline) + (warp-giftag gs-gif-tag :inline) + (fog-clamp vector :inline) + (fog-min float :overlay-at (-> fog-clamp data 0)) + (fog-max float :overlay-at (-> fog-clamp data 1)) + (max-scale float :overlay-at (-> fog-clamp data 2)) ) - :method-count-assert 9 - :size-assert #x2a0 - :flag-assert #x9000002a0 ) + +;; WARN: Return type mismatch float vs none. (defun sprite-setup-frame-data ((data sprite-frame-data) (tbp-offset uint)) "Build the sprite-frame-data. This should be done once per frame" (set! (-> data hmge-scale quad) (-> *math-camera* hmge-scale quad)) @@ -345,9 +330,9 @@ the sprite renderer draw 2D or 3D sprites (set! (-> data sincos-89 w) 0.000020170546) ;; math camera stuff (set! (-> data basis-x quad) (the-as uint128 0)) - (set! (-> data basis-x x) (- (-> *math-camera* perspective data 0))) + (set! (-> data basis-x x) (- (-> *math-camera* perspective vector 0 x))) (set! (-> data basis-y quad) (the-as uint128 0)) - (set! (-> data basis-y y) (- (-> *math-camera* perspective data 5))) + (set! (-> data basis-y y) (- (-> *math-camera* perspective vector 1 y))) (set! (-> data min-scale) (sqrtf (* (/ 1.0 (-> data basis-x x)) (/ 1.0 (-> data basis-y y))))) (set! (-> data inv-area) (/ 1.0 (* (-> data min-scale) (-> data min-scale)))) ;; ?? @@ -393,7 +378,7 @@ the sprite renderer draw 2D or 3D sprites (defmethod new sprite-array-2d ((allocation symbol) (type-to-make type) (group-0-size int) (group-1-size int)) "Allocate a sprite-array for 2d sprites. There are two groups, each can contain the given number." - + ;; og:preserve-this (#when PC_BIG_MEMORY (*! group-0-size SPRITE_MAX_AMOUNT_MULT) ; (*! group-1-size SPRITE_MAX_AMOUNT_MULT) @@ -423,7 +408,7 @@ the sprite renderer draw 2D or 3D sprites (defmethod new sprite-array-3d ((allocation symbol) (type-to-make type) (group-0-size int) (group-1-size int)) "Allocate a sprite-array for 3d sprites. There are two groups, each can contain the given number of sprites. Group 1 size is zero in practice for 3d." - + ;; og:preserve-this (#when PC_BIG_MEMORY (*! group-0-size SPRITE_MAX_AMOUNT_MULT) ; (*! group-1-size SPRITE_MAX_AMOUNT_MULT) @@ -466,14 +451,14 @@ the sprite renderer draw 2D or 3D sprites (cond ((< (-> quat w) 0.0) (.lvf vf1 (&-> sprite qx-qy-qz-sy quad)) - (.lvf vf2 (&-> quat vec quad)) + (.lvf vf2 (&-> quat quad)) (.sub.vf vf1 vf0 vf2 :mask #b111) (.svf (&-> sprite qx-qy-qz-sy quad) vf1) (.mov v1-0 vf1) ) (else (.lvf vf1 (&-> sprite qx-qy-qz-sy quad)) - (.lvf vf2 (&-> quat vec quad)) + (.lvf vf2 (&-> quat quad)) (.add.vf vf1 vf0 vf2 :mask #b111) (.svf (&-> sprite qx-qy-qz-sy quad) vf1) (.mov v1-1 vf1) @@ -519,14 +504,14 @@ the sprite renderer draw 2D or 3D sprites ;; send the camera-temp matrix (let* ((mtx (the-as matrix (-> dma-buff base))) (t1-0 (-> *math-camera* camera-temp)) - (a2-4 (-> t1-0 vector 0 quad)) - (a3-4 (-> t1-0 vector 1 quad)) - (t0-4 (-> t1-0 vector 2 quad)) + (a2-4 (-> t1-0 quad 0)) + (a3-4 (-> t1-0 quad 1)) + (t0-4 (-> t1-0 quad 2)) (t1-1 (-> t1-0 trans quad)) ) - (set! (-> mtx vector 0 quad) a2-4) - (set! (-> mtx vector 1 quad) a3-4) - (set! (-> mtx vector 2 quad) t0-4) + (set! (-> mtx quad 0) a2-4) + (set! (-> mtx quad 1) a3-4) + (set! (-> mtx quad 2) t0-4) (set! (-> mtx trans quad) t1-1) ) (&+! (-> dma-buff base) 64) @@ -590,6 +575,7 @@ the sprite renderer draw 2D or 3D sprites (none) ) +;; WARN: Return type mismatch pointer vs none. (defun sprite-add-frame-data ((dma-buff dma-buffer) (tbp-offset uint)) (let ((s5-0 42)) (let* ((v1-0 dma-buff) @@ -606,6 +592,7 @@ the sprite renderer draw 2D or 3D sprites (none) ) +;; WARN: Return type mismatch pointer vs none. (defun sprite-add-2d-chunk ((sprites sprite-array-2d) (start-sprite-idx int) (num-sprites int) (dma-buff dma-buffer) (mscal-addr int)) "Upload sprite data from elements in the array." ;; first packet is just the header @@ -695,6 +682,7 @@ the sprite renderer draw 2D or 3D sprites (none) ) +;; WARN: Return type mismatch pointer vs none. (defun sprite-add-3d-chunk ((sprites sprite-array-3d) (start-sprite-idx int) (num-sprites int) (dma-buff dma-buffer)) "Add DMA list data for up to 48 sprites. This is very similar to the 2D one, see that for more documentation" ;; first packet is just the header @@ -928,6 +916,7 @@ the sprite renderer draw 2D or 3D sprites (none) ) +;; WARN: Return type mismatch qword vs vector. (defun sprite-get-user-hvdf ((idx int)) "Get an HVDF entry by index" (the-as vector (-> *sprite-hvdf-data* data idx)) diff --git a/goal_src/jak2/engine/gfx/texture/texture-anim-h.gc b/goal_src/jak2/engine/gfx/texture/texture-anim-h.gc index d6a586f907e..3206f38d2e8 100644 --- a/goal_src/jak2/engine/gfx/texture/texture-anim-h.gc +++ b/goal_src/jak2/engine/gfx/texture/texture-anim-h.gc @@ -13,172 +13,137 @@ ;; DECOMP BEGINS (deftype texture-anim-layer (structure) - ((interpolated-color vector :inline) ;; added - (interpolated-scale-offset vector :inline) - (interpolated-st-scale-offset vector :inline) - (interpolated-qs vector :inline) - (interpolated-rot vector :inline) - (extra vector :inline :offset 240) - (func (function dma-buffer uint int int texture-anim-layer float int) :offset 256) - (func-id symbol :offset 256) - (init-func (function texture-anim-layer int) :offset 260) - (init-func-id symbol :offset 260) - (tex texture :offset 264) - (start-time float :offset 268) - (end-time float :offset 272) - (tex-name string :offset 276) - (test gs-test :offset 280) - (alpha gs-alpha :offset 288) - (clamp gs-clamp :offset 296) - - (start-vectors vector 5 :inline :offset 80) ;; added - - (start-color vector :inline :offset 80) - (start-scale vector2 :inline :offset 96) - (start-offset vector2 :inline :offset 104) - (start-st-scale vector2 :inline :offset 112) - (start-st-offset vector2 :inline :offset 120) - (start-qs vector :inline :offset 128) - (start-rot degrees :offset 144) - (start-st-rot degrees :offset 148) - - (end-vectors vector 5 :inline :offset 160) ;; added - - (end-color vector :inline :offset 160) - (end-scale vector2 :inline :offset 176) - (end-offset vector2 :inline :offset 184) - (end-scale-offset vector :inline :offset 176) - (end-st-scale vector2 :inline :offset 192) - (end-st-offset vector2 :inline :offset 200) - (end-qs vector :inline :offset 208) - (end-rot degrees :offset 224) - (end-st-rot degrees :offset 228) + ((interpolated-color vector :inline) ;; added + (interpolated-scale-offset vector :inline) + (interpolated-st-scale-offset vector :inline) + (interpolated-qs vector :inline) + (interpolated-rot vector :inline) + (extra vector :inline :offset 240) + (func (function dma-buffer uint int int texture-anim-layer float int) :offset 256) + (func-id symbol :overlay-at func) + (init-func (function texture-anim-layer int) :offset 260) + (init-func-id symbol :overlay-at init-func) + (tex texture :offset 264) + (start-time float :offset 268) + (end-time float :offset 272) + (tex-name string :offset 276) + (test gs-test :offset 280) + (alpha gs-alpha :offset 288) + (clamp gs-clamp :offset 296) + (start-vectors vector 5 :inline :offset 80) ;; added + (start-color vector :inline :overlay-at (-> start-vectors 0)) + (start-scale vector2 :inline :offset 96) + (start-offset vector2 :inline :offset 104) + (start-st-scale vector2 :inline :offset 112) + (start-st-offset vector2 :inline :offset 120) + (start-qs vector :inline :overlay-at (-> start-vectors 3)) + (start-rot degrees :offset 144) + (start-st-rot degrees :offset 148) + (end-vectors vector 5 :inline :offset 160) ;; added + (end-color vector :inline :overlay-at (-> end-vectors 0)) + (end-scale vector2 :inline :offset 176) + (end-offset vector2 :inline :offset 184) + (end-scale-offset vector :inline :overlay-at (-> end-vectors 1)) + (end-st-scale vector2 :inline :offset 192) + (end-st-offset vector2 :inline :offset 200) + (end-qs vector :inline :overlay-at (-> end-vectors 3)) + (end-rot degrees :offset 224) + (end-st-rot degrees :offset 228) ) - :method-count-assert 11 - :size-assert #x130 - :flag-assert #xb00000130 (:methods - (initialize-texture! (_type_) _type_ 9) - (clear-texture! (_type_) _type_ 10) + (initialize-texture! (_type_) _type_) + (clear-texture! (_type_) _type_) ) ) (deftype texture-anim (structure) - ((num-layers uint32 :offset-assert 0) - (func (function dma-buffer texture-anim int) :offset-assert 4) - (func-id symbol :offset 4) - (init-func (function texture-anim int) :offset-assert 8) - (init-func-id symbol :offset 8) - (tex texture :offset-assert 12) - (tex-name string :offset-assert 16) - (extra vector :inline :offset-assert 32) - (color rgba :offset-assert 48) - (frame-time float :offset-assert 52) - (frame-delta float :offset-assert 56) - (frame-mod float :offset-assert 60) - (test gs-test :offset-assert 64) - (alpha gs-alpha :offset-assert 72) - (clamp gs-clamp :offset-assert 80) - (data texture-anim-layer :dynamic :offset-assert 88) + ((num-layers uint32) + (func (function dma-buffer texture-anim int)) + (func-id symbol :overlay-at func) + (init-func (function texture-anim int)) + (init-func-id symbol :overlay-at init-func) + (tex texture) + (tex-name string) + (extra vector :inline) + (color rgba) + (frame-time float) + (frame-delta float) + (frame-mod float) + (test gs-test) + (alpha gs-alpha) + (clamp gs-clamp) + (data texture-anim-layer :dynamic) ) - :method-count-assert 11 - :size-assert #x58 - :flag-assert #xb00000058 (:methods - (init-textures! (_type_) _type_ 9) - (clear-textures! (_type_) _type_ 10) + (init-textures! (_type_) _type_) + (clear-textures! (_type_) _type_) ) ) (deftype texture-anim-array (array) - ((array-data texture-anim :dynamic :offset-assert 16) + ((array-data texture-anim :dynamic) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (init! (_type_) _type_ 9) - (clear! (_type_) _type_ 10) + (init! (_type_) _type_) + (clear! (_type_) _type_) ) ) (deftype texture-anim-work (structure) - ((erase-tmpl dma-gif-packet :inline :offset-assert 0) - (draw-tmpl dma-gif-packet :inline :offset-assert 32) - (draw2-tmpl dma-gif-packet :inline :offset-assert 64) - (fill-tmpl dma-gif-packet :inline :offset-assert 96) - (adgif-tmpl dma-gif-packet :inline :offset-assert 128) - (corner0 vector :inline :offset-assert 160) - (corner1 vector :inline :offset-assert 176) - (corner2 vector :inline :offset-assert 192) - (corner3 vector :inline :offset-assert 208) - (const vector :inline :offset-assert 224) - (random vector4w 8 :inline :offset-assert 240) - (random-index uint8 :offset-assert 368) + ((erase-tmpl dma-gif-packet :inline) + (draw-tmpl dma-gif-packet :inline) + (draw2-tmpl dma-gif-packet :inline) + (fill-tmpl dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (corner0 vector :inline) + (corner1 vector :inline) + (corner2 vector :inline) + (corner3 vector :inline) + (const vector :inline) + (random vector4w 8 :inline) + (random-index uint8) ) - :method-count-assert 9 - :size-assert #x171 - :flag-assert #x900000171 ) (deftype clut16x16 (structure) - ((clut rgba 256 :offset-assert 0) + ((clut rgba 256) ) - :method-count-assert 9 - :size-assert #x400 - :flag-assert #x900000400 ) (deftype noise8x8 (structure) - ((image uint8 64 :offset-assert 0) + ((image uint8 64) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype noise16x16 (structure) - ((image uint8 256 :offset-assert 0) + ((image uint8 256) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) (deftype noise32x32 (structure) - ((image uint8 1024 :offset-assert 0) + ((image uint8 1024) ) - :method-count-assert 9 - :size-assert #x400 - :flag-assert #x900000400 ) (deftype noise64x64 (structure) - ((image uint8 4096 :offset-assert 0) + ((image uint8 4096) ) - :method-count-assert 9 - :size-assert #x1000 - :flag-assert #x900001000 ) (deftype noise128x128 (structure) - ((image uint8 16384 :offset-assert 0) + ((image uint8 16384) ) - :method-count-assert 9 - :size-assert #x4000 - :flag-assert #x900004000 ) - (#when PC_PORT (deftype noise256x256 (structure) ((image uint8 65536 :offset-assert 0) @@ -194,30 +159,24 @@ (deftype fog8x256 (structure) - ((image uint8 256 :offset-assert 0) + ((image uint8 256) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) (deftype fog-texture-work (structure) - ((corner vector 4 :inline :offset-assert 0) - (const vector :inline :offset-assert 64) - (min-corner vector :inline :offset-assert 80) - (max-corner vector :inline :offset-assert 96) - (fog-near float :offset-assert 112) - (fog-far float :offset-assert 116) - (fog-delta float :offset-assert 120) - (alpha-near float :offset-assert 124) - (alpha-far float :offset-assert 128) - (alpha-delta float :offset-assert 132) - (color uint32 :offset-assert 136) + ((corner vector 4 :inline) + (const vector :inline) + (min-corner vector :inline) + (max-corner vector :inline) + (fog-near float) + (fog-far float) + (fog-delta float) + (alpha-near float) + (alpha-far float) + (alpha-delta float) + (color uint32) ) - :method-count-assert 9 - :size-assert #x8c - :flag-assert #x90000008c ) diff --git a/goal_src/jak2/engine/gfx/texture/texture-anim.gc b/goal_src/jak2/engine/gfx/texture/texture-anim.gc index 79300226a3d..36498f729c6 100644 --- a/goal_src/jak2/engine/gfx/texture/texture-anim.gc +++ b/goal_src/jak2/engine/gfx/texture/texture-anim.gc @@ -1830,14 +1830,14 @@ struct SlimeInput { (none) ) -(defmethod init! texture-anim-array ((this texture-anim-array)) +(defmethod init! ((this texture-anim-array)) (dotimes (s5-0 (-> this length)) (init-textures! (-> this array-data s5-0)) ) this ) -(defmethod clear! texture-anim-array ((this texture-anim-array)) +(defmethod clear! ((this texture-anim-array)) (dotimes (s5-0 (-> this length)) (clear-textures! (-> this array-data s5-0)) ) @@ -1862,7 +1862,7 @@ struct SlimeInput { ;; definition for method 9 of type texture-anim ;; INFO: Used lq/sq -(defmethod init-textures! texture-anim ((this texture-anim)) +(defmethod init-textures! ((this texture-anim)) (local-vars (a3-3 uint128) (sv-16 texture-page)) (when (logtest? (the-as int (-> this func)) 1) (assert-symbol-is-function (-> this func)) ;; added @@ -1942,7 +1942,7 @@ struct SlimeInput { this ) -(defmethod clear-textures! texture-anim ((this texture-anim)) +(defmethod clear-textures! ((this texture-anim)) (set! (-> this tex) #f) (dotimes (s5-0 (the-as int (-> this num-layers))) (clear-texture! (-> this data s5-0)) @@ -1950,7 +1950,7 @@ struct SlimeInput { this ) -(defmethod initialize-texture! texture-anim-layer ((this texture-anim-layer)) +(defmethod initialize-texture! ((this texture-anim-layer)) (when (logtest? (the-as int (-> this func)) 1) ;; og:preserve-this added (assert-symbol-is-function (-> this func)) @@ -1978,7 +1978,7 @@ struct SlimeInput { this ) -(defmethod clear-texture! texture-anim-layer ((this texture-anim-layer)) +(defmethod clear-texture! ((this texture-anim-layer)) (set! (-> this tex) #f) this ) \ No newline at end of file diff --git a/goal_src/jak2/engine/gfx/texture/texture-h.gc b/goal_src/jak2/engine/gfx/texture/texture-h.gc index e2709d91858..cda976c3735 100644 --- a/goal_src/jak2/engine/gfx/texture/texture-h.gc +++ b/goal_src/jak2/engine/gfx/texture/texture-h.gc @@ -38,62 +38,53 @@ ((index uint16 :offset 8 :size 12) (page uint16 :offset 20 :size 12) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; a chunk of vram. (deftype texture-pool-segment (structure) - ((dest uint32 :offset-assert 0) - (size uint32 :offset-assert 4) + ((dest uint32) + (size uint32) ) :pack-me :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; the manager for the VRAM. (deftype texture-pool (basic) - ((top int32 :offset-assert 4) - (cur int32 :offset-assert 8) - (allocate-func (function texture-pool texture-page kheap int texture-page) :offset-assert 12) - (font-palette int32 :offset-assert 16) - (segment texture-pool-segment 4 :inline :offset-assert 20) - (segment-near texture-pool-segment :inline :offset 20) - (segment-common texture-pool-segment :inline :offset 28) - (common-page texture-page 32 :offset-assert 52) - (common-page-mask int32 :offset-assert 180) - (update-sprites-flag symbol :offset-assert 184) - (update-flag symbol :offset-assert 188) - (texture-enable-user texture-enable-mask :offset-assert 192) - (texture-enable-user-menu texture-enable-mask :offset-assert 200) - (ids uint32 128 :offset-assert 208) + ((top int32) + (cur int32) + (allocate-func (function texture-pool texture-page kheap int texture-page)) + (font-palette int32) + (segment texture-pool-segment 4 :inline) + (segment-near texture-pool-segment :inline :overlay-at (-> segment 0)) + (segment-common texture-pool-segment :inline :overlay-at (-> segment 1)) + (common-page texture-page 32) + (common-page-mask int32) + (update-sprites-flag symbol) + (update-flag symbol) + (texture-enable-user texture-enable-mask) + (texture-enable-user-menu texture-enable-mask) + (ids uint32 128) ) - :method-count-assert 26 - :size-assert #x2d0 - :flag-assert #x1a000002d0 (:methods - (new (symbol type) _type_ 0) - (initialize! (_type_) _type_ 9) - (print-usage (_type_) _type_ 10) - (setup-font-texture (_type_) none 11) - (allocate-defaults (_type_) none 12) - (login-level-textures (_type_ level int (pointer texture-id)) none 13) - (add-level-tpage-dma (_type_ level tpage-category bucket-id) none 14) - (allocate-vram-words! (_type_ int) int 15) - (allocate-segment (_type_ texture-pool-segment int) texture-pool-segment 16) - (unload-page (_type_ texture-page) none 17) - (get-common-page-slot-by-id (_type_ int) int 18) - (update-warp-and-hud (_type_) none 19) - (update-sprites (_type_) none 20) - (mark-hud-warp-sprite-dirty (_type_) none 21) - (lay-out-sprite-tex (_type_) none 22) - (lay-out-hud-tex (_type_) none 23) - (lay-out-warp-tex (_type_) none 24) - (clear-ids (_type_) none 25) + (new (symbol type) _type_) + (initialize! (_type_) _type_) + (print-usage (_type_) _type_) + (setup-font-texture (_type_) none) + (allocate-defaults (_type_) none) + (login-level-textures (_type_ level int (pointer texture-id)) none) + (add-level-tpage-dma (_type_ level tpage-category bucket-id) none) + (allocate-vram-words! (_type_ int) int) + (allocate-segment (_type_ texture-pool-segment int) texture-pool-segment) + (unload-page (_type_ texture-page) none) + (get-common-page-slot-by-id (_type_ int) int) + (update-warp-and-hud (_type_) none) + (update-sprites (_type_) none) + (mark-hud-warp-sprite-dirty (_type_) none) + (lay-out-sprite-tex (_type_) none) + (lay-out-hud-tex (_type_) none) + (lay-out-warp-tex (_type_) none) + (clear-ids (_type_) none) ) ) @@ -101,33 +92,24 @@ ;; additionally, the w component holds a minimum distance. The texture is only needed ;; if the distance to the object is smaller than this. (deftype texture-mask (structure) - ((mask vector4w :inline :offset-assert 0) - (dist float :offset 12) - (long uint64 2 :offset 0) - (quad uint128 :offset 0) + ((mask vector4w :inline) + (dist float :overlay-at (-> mask data 3)) + (long uint64 2 :overlay-at (-> mask data 0)) + (quad uint128 :overlay-at (-> mask data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; grouping of three masks, corresponding to the 3 segments of the texture. ;; so mask 0 is needed if segment 0 of the texture is needed, etc... (deftype texture-masks (structure) - ((data texture-mask 3 :inline :offset-assert 0) + ((data texture-mask 3 :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; group of all texture-masks for a given tpage (deftype texture-masks-array (inline-array-class) - ((data texture-masks :inline :dynamic :offset-assert 16) + ((data texture-masks :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> texture-masks-array heap-base) (the-as uint 48)) @@ -139,42 +121,37 @@ ;; metadata for a texture. (deftype texture (basic) - ((w int16 :offset-assert 4) - (h int16 :offset-assert 6) - (num-mips uint8 :offset-assert 8) - (tex1-control uint8 :offset-assert 9) - (psm gs-psm :offset-assert 10) - (mip-shift uint8 :offset-assert 11) - (clutpsm uint16 :offset-assert 12) - (dest uint16 7 :offset-assert 14) - (clutdest uint16 :offset-assert 28) - (width uint8 7 :offset-assert 30) - (name string :offset-assert 40) - (size uint32 :offset-assert 44) - (uv-dist float :offset-assert 48) - (pad uint32 3 :offset-assert 52) - (masks texture-masks :inline :offset-assert 64) + ((w int16) + (h int16) + (num-mips uint8) + (tex1-control uint8) + (psm gs-psm) + (mip-shift uint8) + (clutpsm uint16) + (dest uint16 7) + (clutdest uint16) + (width uint8 7) + (name string) + (size uint32) + (uv-dist float) + (pad uint32 3) + (masks texture-masks :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; metadata for a "segment" of a texture page. ;; Each texture page has 3 segments - smaller number segments have higher detail ;; mips. (deftype texture-page-segment (structure) - ((block-data pointer :offset-assert 0) - (size uint32 :offset-assert 4) - (dest uint32 :offset-assert 8) + ((block-data pointer) + (size uint32) + (dest uint32) ) :pack-me :allow-misaligned - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) + (defun texture-mip->segment ((arg0 int) (arg1 int)) "Figure out which segment of a tpage a given mip level of a texture will be in. arg0 is the mip level, arg1 is the total number of mips. @@ -191,49 +168,40 @@ ;; the tpage has multiple textures, and 3 segments. lower number segments ;; are larger and have hi-res versions of textures. (deftype texture-page (basic) - ((info file-info :offset-assert 4) - (name string :offset-assert 8) - (id uint32 :offset-assert 12) - (length int32 :offset-assert 16) - (mip0-size uint32 :offset-assert 20) - (size uint32 :offset-assert 24) - (segment texture-page-segment 3 :inline :offset-assert 28) - (dram-size uint32 :offset-assert 64) - (pad uint32 15 :offset-assert 68) - (data texture :dynamic :offset-assert 128) + ((info file-info) + (name string) + (id uint32) + (length int32) + (mip0-size uint32) + (size uint32) + (segment texture-page-segment 3 :inline) + (dram-size uint32) + (pad uint32 15) + (data texture :dynamic) ) - :method-count-assert 14 - :size-assert #x80 - :flag-assert #xe00000080 (:methods - (relocate (_type_ kheap (pointer uint8)) texture-page :replace 7) - (remove-data-from-heap (_type_ kheap) _type_ 9) - (get-leftover-block-count (_type_ int int) int 10) - (relocate-dests! (_type_ int int) none 11) - (add-to-dma-buffer (_type_ dma-buffer tex-upload-mode) int 12) - (upload-now! (_type_ tex-upload-mode) none 13) + (relocate (_type_ kheap (pointer uint8)) texture-page :replace) + (remove-data-from-heap (_type_ kheap) _type_) + (get-leftover-block-count (_type_ int int) int) + (relocate-dests! (_type_ int int) none) + (add-to-dma-buffer (_type_ dma-buffer tex-upload-mode) int) + (upload-now! (_type_ tex-upload-mode) none) ) ) ;; a pointer to an adgif-shader, stored in bits 8-32. This allows them to fit into ;; an adgif shader easily. (deftype shader-ptr (uint32) - ((first-8 uint8 :offset 0 :size 8) ;; added - (shader uint32 :offset 8 :size 24) + ((first-8 uint8 :offset 0 :size 8) + (shader uint32 :offset 8 :size 24) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; an overlay structure containing a shader-ptr that points to the next adgif shader ;; in a linked list. (deftype texture-link (structure) - ((next shader-ptr 1 :offset-assert 0) + ((next shader-ptr 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; an entry for a texture in the texture-page-dir. @@ -241,49 +209,42 @@ ;; Each entry contains a reference to the tpage, and a linked list of shaders ;; using it. (deftype texture-page-dir-entry (structure) - ((length int16 :offset-assert 0) - (status uint16 :offset-assert 2) - (page texture-page :offset-assert 4) - (link texture-link :offset-assert 8) + ((length int16) + (status uint16) + (page texture-page) + (link texture-link) ) :pack-me :allow-misaligned - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; the list of all texture pages. ;; this is static data loaded from the DVD at boot. (deftype texture-page-dir (basic) - ((length int32 :offset-assert 4) - (entries texture-page-dir-entry 1 :inline :offset-assert 8) + ((length int32) + (entries texture-page-dir-entry 1 :inline) ) - :method-count-assert 10 - :size-assert #x14 - :flag-assert #xa00000014 (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (unlink-shaders-in-heap (_type_ kheap) int 9) + (relocate (_type_ kheap (pointer uint8)) none :replace) + (unlink-shaders-in-heap (_type_ kheap) int) ) ) ;; unused in jak 2, but metadata for postponing tpage copies until a second frame, to have a smaller ;; impact on frame times when loading. (deftype texture-relocate-later (basic) - ((memcpy symbol :offset-assert 4) - (dest uint32 :offset-assert 8) - (source uint32 :offset-assert 12) - (move uint32 :offset-assert 16) - (entry texture-page-dir-entry :offset-assert 20) - (page texture-page :offset-assert 24) + ((memcpy symbol) + (dest uint32) + (source uint32) + (move uint32) + (entry texture-page-dir-entry) + (page texture-page) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) + (define *texture-relocate-later* (new 'global 'texture-relocate-later)) + (set! (-> *texture-relocate-later* memcpy) #f) (define *texture-page-dir* (the-as texture-page-dir #f)) @@ -301,48 +262,42 @@ ;; for example, the texture system will automatically update tbp to point to the location ;; of texture. (deftype adgif-shader (structure) - ((quad qword 5 :inline :offset-assert 0) - (prims gs-reg64 10 :offset 0) - (reg-0 uint8 :offset 8) - (reg-1 uint8 :offset 24) - (reg-2 uint8 :offset 40) - (reg-3 uint8 :offset 56) - (reg-4-u32 gs-reg32 :offset 72) - (reg-4 uint8 :offset 72) - (tex0 gs-tex0 :offset 0) - (tex1 gs-tex1 :offset 16) - (miptbp1 gs-miptbp :offset 32) - (clamp gs-clamp :offset 48) - (clamp-reg gs-reg64 :offset 56) - (alpha gs-alpha :offset 64) - (alpha-as-miptb2 gs-miptbp :offset 64) - (link-test link-test-flags :offset 8) - (texture-id texture-id :offset 24) - (next shader-ptr :offset 40) + ((quad qword 5 :inline) + (prims gs-reg64 10 :overlay-at quad) + (reg-0 uint8 :overlay-at (-> quad 0 data 2)) + (reg-1 uint8 :overlay-at (-> prims 3)) + (reg-2 uint8 :overlay-at (-> prims 5)) + (reg-3 uint8 :overlay-at (-> prims 7)) + (reg-4-u32 gs-reg32 :overlay-at (-> prims 9)) + (reg-4 uint8 :overlay-at reg-4-u32) + (tex0 gs-tex0 :overlay-at (-> quad 0 data 0)) + (tex1 gs-tex1 :overlay-at (-> prims 2)) + (miptbp1 gs-miptbp :overlay-at (-> prims 4)) + (clamp gs-clamp :overlay-at (-> prims 6)) + (clamp-reg gs-reg64 :overlay-at reg-3) + (alpha gs-alpha :overlay-at (-> prims 8)) + (alpha-as-miptb2 gs-miptbp :overlay-at alpha) + (link-test link-test-flags :overlay-at (-> quad 0 data 2)) + (texture-id texture-id :overlay-at reg-1) + (next shader-ptr :overlay-at reg-2) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) + (deftype adgif-shader-array (inline-array-class) - ((data adgif-shader :inline :dynamic :offset-assert 16) + ((data adgif-shader :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + + (set! (-> adgif-shader-array heap-base) (the-as uint 80)) ;; metadata about an area of vram set aside for fancy dynamic texture effects (sky, eye, etc) (deftype texture-base (structure) - ((vram-page uint32 :offset-assert 0) - (vram-block uint32 :offset-assert 4) - (vram-word uint32 :offset-assert 8) + ((vram-page uint32) + (vram-block uint32) + (vram-word uint32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; GS swizzling tables. @@ -407,14 +362,11 @@ ) (deftype texture-page-translate-item (structure) - ((bucket bucket-id :offset-assert 0) - (level-index uint32 :offset-assert 4) - (level-texture-page tpage-category-u32 :offset-assert 8) - (texture-user texture-enable-mask-u32 :offset-assert 12) + ((bucket bucket-id) + (level-index uint32) + (level-texture-page tpage-category-u32) + (texture-user texture-enable-mask-u32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; the order of all texture uploads in a frame. diff --git a/goal_src/jak2/engine/gfx/texture/texture.gc b/goal_src/jak2/engine/gfx/texture/texture.gc index 62f0d1d915d..e8c1c288737 100644 --- a/goal_src/jak2/engine/gfx/texture/texture.gc +++ b/goal_src/jak2/engine/gfx/texture/texture.gc @@ -60,7 +60,7 @@ additionally, some texture pages have a chunk system that allows more specific c ;; DECOMP BEGINS -(defmethod print texture-page ((this texture-page)) +(defmethod print ((this texture-page)) "Print a texture page with name and size." (format #t "#" (-> this name) @@ -72,18 +72,18 @@ additionally, some texture pages have a chunk system that allows more specific c this ) -(defmethod length texture-page ((this texture-page)) +(defmethod length ((this texture-page)) "Get the number of textures in a texture-page." (-> this length) ) -(defmethod asize-of texture-page ((this texture-page)) +(defmethod asize-of ((this texture-page)) "Get the size, in bytes, of a texture-page. Note that this does not include the texture objects, or the texture data." (the-as int (+ (-> this type size) (* (-> this length) 4))) ) -(defmethod mem-usage texture-page ((this texture-page) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this texture-page) (arg0 memory-usage-block) (arg1 int)) "Get the amount of memory used by a texture page, including texture and texture data." (set! (-> arg0 length) (max 83 (-> arg0 length))) (set! (-> arg0 data 82 name) "texture") @@ -197,7 +197,7 @@ additionally, some texture pages have a chunk system that allows more specific c ;; each texture is just some metadata about a texture, including its location in vram ;; and format settings. -(defmethod print texture ((this texture)) +(defmethod print ((this texture)) (format #t "# this name) (psm->string (-> this psm)) ;; format @@ -393,7 +393,7 @@ additionally, some texture pages have a chunk system that allows more specific c ;; at boot time and isn't used at runtime. VRAM is often resued for multiple textures in a single frame, ;; and the common segment does more complicated management at runtime. -(defmethod allocate-vram-words! texture-pool ((this texture-pool) (num-words int)) +(defmethod allocate-vram-words! ((this texture-pool) (num-words int)) "Allocate the given number of vram words." (let ((v0-0 (-> this cur))) (+! (-> this cur) num-words) @@ -411,7 +411,7 @@ additionally, some texture pages have a chunk system that allows more specific c ;; not any specific level/art-group. ;; So it's reasonable for them to hardcode tpage-ids here. -(defmethod get-common-page-slot-by-id texture-pool ((this texture-pool) (tpage-id int)) +(defmethod get-common-page-slot-by-id ((this texture-pool) (tpage-id int)) "Check to see if the given tpage should go in the common page list. If so, return the slot. Otherwise, return -1." (case tpage-id @@ -427,7 +427,7 @@ additionally, some texture pages have a chunk system that allows more specific c ) ) -(defmethod initialize! texture-pool ((this texture-pool)) +(defmethod initialize! ((this texture-pool)) "Initialize or reset the state of the texture-pool." ;; reset allocator (set! (-> this cur) 0) @@ -461,7 +461,7 @@ additionally, some texture pages have a chunk system that allows more specific c this ) -(defmethod get-leftover-block-count texture-page ((this texture-page) (num-segments int) (upload-offset int)) +(defmethod get-leftover-block-count ((this texture-page) (num-segments int) (upload-offset int)) "Unused and somewhat useless function to figure out how many blocks we overflow into the next page. This could be used with gs-largest-block to figure out how much of a page we use if we don't fit exactly." @@ -473,7 +473,7 @@ additionally, some texture pages have a chunk system that allows more specific c ) ) -(defmethod print-usage texture-pool ((this texture-pool)) +(defmethod print-usage ((this texture-pool)) "Print out how much of a texture-pool is used. This is not quite right because it does not count the frame or z buffer as used space." (format #t "--------------------~%") @@ -487,14 +487,14 @@ additionally, some texture pages have a chunk system that allows more specific c this ) -(defmethod allocate-segment texture-pool ((this texture-pool) (seg texture-pool-segment) (num-words int)) +(defmethod allocate-segment ((this texture-pool) (seg texture-pool-segment) (num-words int)) "Assign vram to the given segment." (set! (-> seg size) (the-as uint num-words)) (set! (-> seg dest) (the-as uint (allocate-vram-words! this num-words))) seg ) -(defmethod allocate-defaults texture-pool ((this texture-pool)) +(defmethod allocate-defaults ((this texture-pool)) "Assign vram for the texture system." ;; this "common" segment is about 1 MB and will hold basically all textures. @@ -541,7 +541,7 @@ additionally, some texture pages have a chunk system that allows more specific c ;; it's ok for two textures to be mapped to the same vram address as ;; long as they are in different pages. -(defmethod remove-data-from-heap texture-page ((this texture-page) (heap kheap)) +(defmethod remove-data-from-heap ((this texture-page) (heap kheap)) "Remove a texture-page's data from main memory. This is intended to be run on textures that are permanently in VRAM. This only works if the texture-page was the last thing added to the heap, @@ -658,7 +658,7 @@ additionally, some texture pages have a chunk system that allows more specific c ;; For warp, it's the responsibility of the texture system to update adgifs. -(defmethod lay-out-sprite-tex texture-pool ((this texture-pool)) +(defmethod lay-out-sprite-tex ((this texture-pool)) "Lay out sprite textures from all levels so all can fit into VRAM at the same time." @@ -700,7 +700,7 @@ additionally, some texture pages have a chunk system that allows more specific c (none) ) -(defmethod lay-out-hud-tex texture-pool ((this texture-pool)) +(defmethod lay-out-hud-tex ((this texture-pool)) "Lay out hud/map textures from all levels so all can fit into VRAM at the same time." (let ((level-idx 0)) @@ -740,7 +740,7 @@ additionally, some texture pages have a chunk system that allows more specific c ;; - if the texture moves, the texture system can iterate through all adgifs referencing the texture ;; and update them. The texture system stores a linked list of adgifs per texture in the texture-page-dir. -(defmethod lay-out-warp-tex texture-pool ((this texture-pool)) +(defmethod lay-out-warp-tex ((this texture-pool)) "Lay out warp textures from all levels so all can fit into VRAM at the same time. Also update all adgifs." @@ -814,7 +814,7 @@ additionally, some texture pages have a chunk system that allows more specific c (none) ) -(defmethod clear-ids texture-pool ((this texture-pool)) +(defmethod clear-ids ((this texture-pool)) "Forget everything we have in VRAM and invalidate all caching of common-segment textures." @@ -826,7 +826,7 @@ additionally, some texture pages have a chunk system that allows more specific c (none) ) -(defmethod update-sprites texture-pool ((this texture-pool)) +(defmethod update-sprites ((this texture-pool)) "Redo the layout of sprite textures. This should be done when a new level is added that needs new sprite textures, or a level is unloaded and its sprite textures are no longer available." @@ -843,7 +843,7 @@ additionally, some texture pages have a chunk system that allows more specific c (none) ) -(defmethod update-warp-and-hud texture-pool ((this texture-pool)) +(defmethod update-warp-and-hud ((this texture-pool)) "Redo the layout of warp/hud/map textures. This should be done when a new level is added that needs new sprite textures, or a level is unloaded and its sprite textures are no longer available." @@ -854,7 +854,7 @@ additionally, some texture pages have a chunk system that allows more specific c (none) ) -(defmethod mark-hud-warp-sprite-dirty texture-pool ((this texture-pool)) +(defmethod mark-hud-warp-sprite-dirty ((this texture-pool)) "Mark that we should update sprite/warp/hud/map before the next use. This should happen when any level is loaded/unloaded." (set! (-> this update-sprites-flag) #t) @@ -1475,7 +1475,7 @@ additionally, some texture pages have a chunk system that allows more specific c ) ) -(defmethod login-level-textures texture-pool ((pool texture-pool) (lev level) (num-tpage-ids int) (tpage-ids (pointer texture-id))) +(defmethod login-level-textures ((pool texture-pool) (lev level) (num-tpage-ids int) (tpage-ids (pointer texture-id))) "After all tpages are loaded, call this function to set up level textures. It'll call texture-page-login on each tpage, and set up texture-page field of level." @@ -1524,7 +1524,7 @@ additionally, some texture pages have a chunk system that allows more specific c (none) ) -(defmethod add-level-tpage-dma texture-pool ((pool texture-pool) (lev level) (cat tpage-category) (bucket bucket-id)) +(defmethod add-level-tpage-dma ((pool texture-pool) (lev level) (cat tpage-category) (bucket bucket-id)) "Add dma to upload a tpage of a level." (with-pp ;; get the tpage from the level @@ -1858,7 +1858,7 @@ additionally, some texture pages have a chunk system that allows more specific c (define *txt-dma-list* (new 'global 'dma-buffer 4096)) (kmemclose) -(defmethod upload-now! texture-page ((this texture-page) (arg0 tex-upload-mode)) +(defmethod upload-now! ((this texture-page) (arg0 tex-upload-mode)) "Send the given texture-page to VRAM right now. This function doesn't return until it has happened, and only should be used during boot." @@ -1892,7 +1892,7 @@ additionally, some texture pages have a chunk system that allows more specific c (none) ) -(defmethod add-to-dma-buffer texture-page ((this texture-page) (arg0 dma-buffer) (arg1 tex-upload-mode)) +(defmethod add-to-dma-buffer ((this texture-page) (arg0 dma-buffer) (arg1 tex-upload-mode)) "Add upload data for a texture-page. This is a simple version for non common-segment textures." (local-vars (sv-16 int)) (let ((v1-0 arg1)) @@ -1996,7 +1996,7 @@ additionally, some texture pages have a chunk system that allows more specific c dma-buff ) -(defmethod setup-font-texture texture-pool ((this texture-pool)) +(defmethod setup-font-texture ((this texture-pool)) "Do relocations of font textures." (local-vars (sv-16 int) (sv-20 int)) (let ((s3-0 (-> this font-palette))) @@ -2096,24 +2096,24 @@ additionally, some texture pages have a chunk system that allows more specific c ;; one link per texture. The link is the head of a linked list through all the static adgif-shaders of the ;; level. -(defmethod asize-of texture-page-dir ((this texture-page-dir)) +(defmethod asize-of ((this texture-page-dir)) "Get the size in memory of a texture-page-dir, just the main array, not allocated link stuff." (the-as int (+ (-> texture-page-dir size) (* 12 (+ (-> this length) -1)))) ) -(defmethod length texture-page-dir ((this texture-page-dir)) +(defmethod length ((this texture-page-dir)) "Get the number of elements." (-> this length) ) -(defmethod relocate texture-page-dir ((this texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate ((this texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) "Set up a texture-page-dir when it is loaded." ;; there's just one of these, just set the global one to this. (set! *texture-page-dir* this) (none) ) -(defmethod relocate-dests! texture-page ((this texture-page) (new-dest int) (segs int)) +(defmethod relocate-dests! ((this texture-page) (new-dest int) (segs int)) "Update a texture-page so the texture-page and all its textures point to a new vram address." (let ((new-tbp (shr new-dest 6)) @@ -2154,7 +2154,7 @@ additionally, some texture pages have a chunk system that allows more specific c ;; texture-page management ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod relocate texture-page ((this texture-page) (loading-heap kheap) (name (pointer uint8))) +(defmethod relocate ((this texture-page) (loading-heap kheap) (name (pointer uint8))) "Set up a texture-page when it is loaded. This function is called by the linker when loading is completed." @@ -2370,7 +2370,7 @@ additionally, some texture pages have a chunk system that allows more specific c (lookup-texture-by-name arg0 (the-as string #f) arg2) ) -(defmethod unload-page texture-pool ((this texture-pool) (arg0 texture-page)) +(defmethod unload-page ((this texture-pool) (arg0 texture-page)) "Unload the given texture-page from the texture-page-dir." (local-vars (a0-2 int)) (let ((v1-0 *texture-page-dir*)) @@ -2415,7 +2415,7 @@ additionally, some texture pages have a chunk system that allows more specific c ) ) -(defmethod unlink-shaders-in-heap texture-page-dir ((this texture-page-dir) (heap kheap)) +(defmethod unlink-shaders-in-heap ((this texture-page-dir) (heap kheap)) "Unlink all adgif shaders that are in heap. This iterates through _everything_ so it is somewhat slow." (local-vars (dist-past-end uint)) @@ -2817,7 +2817,7 @@ additionally, some texture pages have a chunk system that allows more specific c ) -(defmethod inspect texture-page-dir ((this texture-page-dir)) +(defmethod inspect ((this texture-page-dir)) (texture-page-dir-inspect this #f) this ) diff --git a/goal_src/jak2/engine/gfx/vu1-user-h.gc b/goal_src/jak2/engine/gfx/vu1-user-h.gc index 6faf4b56bab..768ca9fbb24 100644 --- a/goal_src/jak2/engine/gfx/vu1-user-h.gc +++ b/goal_src/jak2/engine/gfx/vu1-user-h.gc @@ -512,18 +512,15 @@ for example: tie-s-l1-tfrag ;; foreground renderers will output DMA data to one of these "sinks". (deftype dma-foreground-sink (basic) ;; which bucket to output to. determines draw order. - ((bucket bucket-id :offset-assert 4) + ((bucket bucket-id) ;; what kind of textures will be uploaded at this time? - (foreground-texture-page tpage-category :offset-assert 8) + (foreground-texture-page tpage-category) ;; which level do we belong to? - (foreground-texture-level int8 :offset-assert 9) + (foreground-texture-level int8) ;; if there are multiple buckets for the above categories, which bucket ;; (for example, jak 1 had separate merc/gmerc buckets in some categories) - (foreground-output-bucket int8 :offset-assert 10) + (foreground-output-bucket int8) ) - :method-count-assert 9 - :size-assert #xb - :flag-assert #x90000000b ) ;; the generic renderer is double buffered - while one fragment is uploading, another is rendering. @@ -533,22 +530,15 @@ for example: tie-s-l1-tfrag ;; The generic renderer doesn't track this state internally, so we have some extra information ;; to add on to generic buckets. (deftype generic-bucket-state (structure) - ((gifbuf-adr uint32 :offset-assert 0) - (inbuf-adr uint32 :offset-assert 4) + ((gifbuf-adr uint32) + (inbuf-adr uint32) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; as described above, the generic renderer needs a bit of extra state to double ;; buffer between models. (deftype generic-dma-foreground-sink (dma-foreground-sink) - ((state generic-bucket-state :inline :offset-assert 12) + ((state generic-bucket-state :inline) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) - diff --git a/goal_src/jak2/engine/level/bsp-h.gc b/goal_src/jak2/engine/level/bsp-h.gc index 22c98385605..4a282b370ee 100644 --- a/goal_src/jak2/engine/level/bsp-h.gc +++ b/goal_src/jak2/engine/level/bsp-h.gc @@ -6,7 +6,7 @@ ;; dgos: ENGINE, GAME #|@file -the bsp-node class seems broken - it has int16's that get used a pointers. +the bsp-node class seems broken - it has int16's that get used as pointers. |# (declare-type entity-camera entity) @@ -24,130 +24,107 @@ the bsp-node class seems broken - it has int16's that get used a pointers. ;; DECOMP BEGINS (deftype bsp-node (structure) - ((front int16 :offset-assert 0) - (back int16 :offset-assert 2) - (front-box-min vector4b :inline :offset-assert 4) - (front-box-max vector4b :inline :offset-assert 8) - (back-box-min vector4b :inline :offset-assert 12) - (back-box-max vector4b :inline :offset-assert 16) + ((front int16) + (back int16) + (front-box-min vector4b :inline) + (front-box-max vector4b :inline) + (back-box-min vector4b :inline) + (back-box-max vector4b :inline) ) :pack-me - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (define-extern inspect-bsp-tree (function bsp-header bsp-node none)) (define-extern map-bsp-tree (function (function bsp-node none) bsp-header bsp-node none)) (deftype bsp-header (drawable) - ( - ;; TYPE 0 - (info file-info :offset 4) - ;; 0 8 - ;; 0 12 - ;; 0 16 - ;; 0 20 - ;; 0 24 - ;; 0 28 - (all-visible-list (pointer uint16) :offset-assert 32) - (visible-list-length int16 :offset-assert 36) - (extra-vis-list-length int16 :offset-assert 38) - (drawable-trees drawable-tree-array :offset-assert 40) - (pat pointer :offset-assert 44) - (pat-length int32 :offset-assert 48) - (texture-remap-table (pointer uint64) :offset-assert 52) - (texture-remap-table-len int32 :offset-assert 56) - (texture-ids (pointer texture-id) :offset-assert 60) - (texture-page-count int32 :offset-assert 64) - (unknown-basic basic :offset-assert 68) ;; seems to be 0 everywhere. - (name symbol :offset-assert 72) - (nickname symbol :offset-assert 76) - (vis-info level-vis-info 8 :offset-assert 80) - (actors drawable-inline-array-actor :offset-assert 112) - (cameras (array entity-camera) :offset-assert 116) - (nodes (inline-array bsp-node) :offset-assert 120) - (level level :offset-assert 124) - (current-leaf-idx uint16 :offset-assert 128) - (texture-flags texture-page-flag 10 :offset-assert 130) - (cam-outside-bsp uint8 :offset 152) - (cam-using-back uint8 :offset-assert 153) - (cam-box-idx uint16 :offset-assert 154) - (ambients symbol :offset-assert 156) ;; now just #t? - (subdivide-close float :offset-assert 160) - (subdivide-far float :offset-assert 164) - (race-meshes (array entity-race-mesh) :offset-assert 168) - (actor-birth-order (pointer uint32) :offset-assert 172) - (light-hash light-hash :offset-assert 176) - (nav-meshes (array entity-nav-mesh) :offset-assert 180) - (actor-groups (array actor-group) :offset-assert 184) - (region-trees (array drawable-tree-region-prim) :offset-assert 188) - (region-array region-array :offset-assert 192) - (collide-hash collide-hash :offset-assert 196) + ((info file-info :overlay-at id) + ;; 0 8 + ;; 0 12 + ;; 0 16 + ;; 0 20 + ;; 0 24 + ;; 0 28 + (all-visible-list (pointer uint16)) + (visible-list-length int16) + (extra-vis-list-length int16) + (drawable-trees drawable-tree-array) + (pat pointer) + (pat-length int32) + (texture-remap-table (pointer uint64)) + (texture-remap-table-len int32) + (texture-ids (pointer texture-id)) + (texture-page-count int32) + (unknown-basic basic) ;; seems to be 0 everywhere. + (name symbol) + (nickname symbol) + (vis-info level-vis-info 8) + (actors drawable-inline-array-actor) + (cameras (array entity-camera)) + (nodes (inline-array bsp-node)) + (level level) + (current-leaf-idx uint16) + (texture-flags texture-page-flag 10) + (cam-outside-bsp uint8 :offset 152) + (cam-using-back uint8) + (cam-box-idx uint16) + (ambients symbol) ;; now just #t? + (subdivide-close float) + (subdivide-far float) + (race-meshes (array entity-race-mesh)) + (actor-birth-order (pointer uint32)) + (light-hash light-hash) + (nav-meshes (array entity-nav-mesh)) + (actor-groups (array actor-group)) + (region-trees (array drawable-tree-region-prim)) + (region-array region-array) + (collide-hash collide-hash) ;; 200 is some array - (wind-array uint32 :offset 200) - (wind-array-length int32 :offset 204) - - (city-level-info city-level-info :offset 208) - - (vis-spheres vector-array :offset 216) - (vis-spheres-length uint32 :offset 248) - - (region-tree drawable-tree-region-prim :offset 252) - (tfrag-masks texture-masks-array :offset-assert 256) - (tfrag-closest (pointer float) :offset-assert 260) - (tfrag-mask-count uint32 :offset 260) - - (shrub-masks texture-masks-array :offset-assert 264) - (shrub-closest (pointer float) :offset-assert 268) - (shrub-mask-count uint32 :offset 268) - - (alpha-masks texture-masks-array :offset-assert 272) - (alpha-closest (pointer float) :offset-assert 276) - (alpha-mask-count uint32 :offset 276) - - (water-masks texture-masks-array :offset-assert 280) - (water-closest (pointer float) :offset-assert 284) - (water-mask-count uint32 :offset 284) - - (bsp-scale vector :inline :offset-assert 288) - (bsp-offset vector :inline :offset-assert 304) - - (end uint8 :offset 399) + (wind-array uint32 :offset 200) + (wind-array-length int32 :offset 204) + (city-level-info city-level-info :offset 208) + (vis-spheres vector-array :offset 216) + (vis-spheres-length uint32 :offset 248) + (region-tree drawable-tree-region-prim :offset 252) + (tfrag-masks texture-masks-array) + (tfrag-closest (pointer float)) + (tfrag-mask-count uint32 :overlay-at tfrag-closest) + (shrub-masks texture-masks-array) + (shrub-closest (pointer float)) + (shrub-mask-count uint32 :overlay-at shrub-closest) + (alpha-masks texture-masks-array) + (alpha-closest (pointer float)) + (alpha-mask-count uint32 :overlay-at alpha-closest) + (water-masks texture-masks-array) + (water-closest (pointer float)) + (water-mask-count uint32 :overlay-at water-closest) + (bsp-scale vector :inline) + (bsp-offset vector :inline) + (end uint8 :offset 399) ) - :method-count-assert 19 - :size-assert #x190 - :flag-assert #x1300000190 - ;; Failed to read fields. (:methods - (birth (_type_) none 17) - (deactivate-entities (_type_) none 18) + (birth (_type_) none) + (deactivate-entities (_type_) none) ) ) ;; unused (deftype game-level (basic) - ((master-bsp basic :offset-assert 4) + ((master-bsp basic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype view-frustum (structure) - ((hither-top-left vector :inline :offset-assert 0) - (hither-top-right vector :inline :offset-assert 16) - (hither-bottom-left vector :inline :offset-assert 32) - (hither-bottom-right vector :inline :offset-assert 48) - (yon-top-left vector :inline :offset-assert 64) - (yon-top-right vector :inline :offset-assert 80) - (yon-bottom-left vector :inline :offset-assert 96) - (yon-bottom-right vector :inline :offset-assert 112) + ((hither-top-left vector :inline) + (hither-top-right vector :inline) + (hither-bottom-left vector :inline) + (hither-bottom-right vector :inline) + (yon-top-left vector :inline) + (yon-top-right vector :inline) + (yon-bottom-left vector :inline) + (yon-bottom-right vector :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) (defmethod inspect bsp-header ((this bsp-header)) @@ -161,6 +138,8 @@ the bsp-node class seems broken - it has int16's that get used a pointers. this ) + +;; WARN: Return type mismatch bsp-header vs none. (defun-debug inspect-bsp-tree ((arg0 bsp-header) (arg1 bsp-node)) (cond ((zero? arg1) @@ -185,6 +164,7 @@ the bsp-node class seems broken - it has int16's that get used a pointers. (none) ) +;; WARN: Return type mismatch bsp-header vs none. (defun map-bsp-tree ((arg0 (function bsp-node none)) (arg1 bsp-header) (arg2 bsp-node)) (cond ((zero? arg2) @@ -207,20 +187,17 @@ the bsp-node class seems broken - it has int16's that get used a pointers. ;; just replaced with some arrays for now. I don't think this is ;; used anyway. (deftype collide-stats (structure) - ((calls uint32 :offset-assert 0) - (spheres uint32 :offset-assert 4) - (nodes uint32 :offset-assert 8) - (frags uint32 :offset-assert 12) - (tris uint32 :offset-assert 16) - (output uint32 :offset-assert 20) - (pad0 uint32 2 :offset-assert 24) - (total-target uint32 8 :offset-assert 32) - (target-cache-fill uint32 8 :offset-assert 64) - (target-ray-poly uint32 6 :offset-assert 96) + ((calls uint32) + (spheres uint32) + (nodes uint32) + (frags uint32) + (tris uint32) + (output uint32) + (pad0 uint32 2) + (total-target uint32 8) + (target-cache-fill uint32 8) + (target-ray-poly uint32 6) ) - :method-count-assert 9 - :size-assert #x78 - :flag-assert #x900000078 ) diff --git a/goal_src/jak2/engine/level/bsp.gc b/goal_src/jak2/engine/level/bsp.gc index eeac136844f..02b541085e0 100644 --- a/goal_src/jak2/engine/level/bsp.gc +++ b/goal_src/jak2/engine/level/bsp.gc @@ -36,7 +36,7 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib (none) ) -(defmethod mem-usage bsp-header ((this bsp-header) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this bsp-header) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of everything in a bsp-header. This includes all the drawables." (set! (-> arg0 work-bsp) this) @@ -136,7 +136,7 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib this ) -(defmethod login bsp-header ((this bsp-header)) +(defmethod login ((this bsp-header)) "Log in a bsp-header. Note that this version isn't typically used - instead level.gc does a special login that runs over multiple frames." @@ -160,7 +160,7 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib (define *test-shrub* 0) -(defmethod draw bsp-header ((this bsp-header) (arg0 bsp-header) (arg1 display-frame)) +(defmethod draw ((this bsp-header) (arg0 bsp-header) (arg1 display-frame)) "Draw a bsp-header. Note that this mostly just adds drawable trees to a list which is later used by the background system. So this is probably a bit of a leftover from when drawing was done by iterating through all drawable-trees recursively." @@ -246,7 +246,7 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib ) -(defmethod debug-draw bsp-header ((this bsp-header) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this bsp-header) (arg0 drawable) (arg1 display-frame)) "Set up and call debug-draw on a bsp-header and all its drawables. The actual use of debug-draw is up to the drawables, but this is a useful place to do random debug drawing." @@ -311,7 +311,7 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib ) ) -(defmethod collect-stats bsp-header ((this bsp-header)) +(defmethod collect-stats ((this bsp-header)) "Set up and call collect-stats on a bsp-header. This will run (moderately) expensive checks to count triangles, visibility, etc." (rlet ((vf16 :class vf) @@ -483,7 +483,7 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib ) ) -(defmethod collect-regions bsp-header ((this bsp-header) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions ((this bsp-header) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Recursively find all regions containing the sphere, add to region-prim-list" (let ((s3-0 (-> this region-trees))) (dotimes (s2-0 (-> s3-0 length)) diff --git a/goal_src/jak2/engine/level/level-h.gc b/goal_src/jak2/engine/level/level-h.gc index d360d4416da..462c6bbd9e3 100644 --- a/goal_src/jak2/engine/level/level-h.gc +++ b/goal_src/jak2/engine/level/level-h.gc @@ -151,280 +151,265 @@ ;; DECOMP BEGINS (deftype level-vis-info (basic) - ((level level :offset-assert 4) - (from-level symbol :offset-assert 8) - (from-bsp bsp-header :offset-assert 12) - (flags vis-info-flag :offset-assert 16) - (length uint32 :offset-assert 20) - (allocated-length uint32 :offset-assert 24) - (dictionary-length uint32 :offset-assert 28) - (dictionary uint32 :offset-assert 32) - (string-block uint32 :offset-assert 36) - (ramdisk uint32 :offset-assert 40) - (vis-bits uint32 :offset-assert 44) - (current-vis-string uint32 :offset-assert 48) - (vis-string uint32 :dynamic :offset-assert 52) + ((level level) + (from-level symbol) + (from-bsp bsp-header) + (flags vis-info-flag) + (length uint32) + (allocated-length uint32) + (dictionary-length uint32) + (dictionary uint32) + (string-block uint32) + (ramdisk uint32) + (vis-bits uint32) + (current-vis-string uint32) + (vis-string uint32 :dynamic) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of level-vis-info ((this level-vis-info)) +(defmethod asize-of ((this level-vis-info)) (the-as int (+ (-> level-vis-info size) (-> this dictionary-length))) ) (deftype level-load-info (basic) - ((name-list symbol 6 :offset-assert 4) - (index int16 :offset-assert 28) - (task-level uint8 :offset-assert 30) - (name symbol :offset 4) - (visname symbol :offset 8) - (nickname symbol :offset 12) - (dbname symbol :offset 16) - (taskname symbol :offset 20) - (other-name-1 symbol :offset 24) - (packages pair :offset-assert 32) - (memory-mode load-buffer-mode :offset-assert 36) - (music-bank symbol :offset-assert 40) - (ambient-sounds symbol :offset-assert 44) - (sound-reverb float :offset-assert 48) - (mood-func symbol :offset-assert 52) - (mood-init symbol :offset-assert 56) - (ocean symbol :offset-assert 60) - (sky symbol :offset-assert 64) - (use-camera-other symbol :offset-assert 68) - (part-engine-max int32 :offset-assert 72) - (city-map-bits uint64 :offset-assert 80) - (continues pair :offset-assert 88) - (tasks pair :offset-assert 92) - (priority int32 :offset-assert 96) - (load-commands pair :offset-assert 100) - (alt-load-commands pair :offset-assert 104) - (bsp-mask uint64 :offset-assert 112) - (buzzer int32 :offset-assert 120) - (buttom-height meters :offset-assert 124) - (run-packages pair :offset-assert 128) - (prev-level symbol :offset-assert 132) - (next-level symbol :offset-assert 136) - (wait-for-load symbol :offset-assert 140) - (login-func symbol :offset-assert 144) - (activate-func symbol :offset-assert 148) - (deactivate-func symbol :offset-assert 152) - (kill-func symbol :offset-assert 156) - (borrow-size uint16 2 :offset-assert 160) - (borrow-level symbol 2 :offset-assert 164) - (borrow-display? symbol 2 :offset-assert 172) - (base-task-mask task-mask :offset-assert 180) - (texture-anim symbol 10 :offset-assert 184) - (texture-anim-tfrag symbol :offset 184) - (texture-anim-pris symbol :offset 188) - (texture-anim-shrub symbol :offset 192) - (texture-anim-alpha symbol :offset 196) - (texture-anim-water symbol :offset 200) - (texture-anim-twarp symbol :offset 204) - (texture-anim-pris2 symbol :offset 208) - (texture-anim-sprite symbol :offset 212) - (texture-anim-map symbol :offset 216) - (texture-anim-sky symbol :offset 220) - (draw-priority float :offset-assert 224) - (level-flags uint32 :offset-assert 228) - (fog-height float :offset-assert 232) - (bigmap-id bigmap-id :offset-assert 236) - (ocean-near-translucent? symbol :offset-assert 240) - (ocean-far? symbol :offset-assert 244) - (mood-range mood-range :inline :offset-assert 256) - (max-rain float :offset-assert 272) - (fog-mult float :offset-assert 276) - (ocean-alpha float :offset-assert 280) - (extra-sound-bank pair :offset-assert 284) + ((name-list symbol 6) + (index int16) + (task-level uint8) + (name symbol :overlay-at (-> name-list 0)) + (visname symbol :overlay-at (-> name-list 1)) + (nickname symbol :overlay-at (-> name-list 2)) + (dbname symbol :overlay-at (-> name-list 3)) + (taskname symbol :overlay-at (-> name-list 4)) + (other-name-1 symbol :overlay-at (-> name-list 5)) + (packages pair) + (memory-mode load-buffer-mode) + (music-bank symbol) + (ambient-sounds symbol) + (sound-reverb float) + (mood-func symbol) + (mood-init symbol) + (ocean symbol) + (sky symbol) + (use-camera-other symbol) + (part-engine-max int32) + (city-map-bits uint64) + (continues pair) + (tasks pair) + (priority int32) + (load-commands pair) + (alt-load-commands pair) + (bsp-mask uint64) + (buzzer int32) + (buttom-height meters) + (run-packages pair) + (prev-level symbol) + (next-level symbol) + (wait-for-load symbol) + (login-func symbol) + (activate-func symbol) + (deactivate-func symbol) + (kill-func symbol) + (borrow-size uint16 2) + (borrow-level symbol 2) + (borrow-display? symbol 2) + (base-task-mask task-mask) + (texture-anim symbol 10) + (texture-anim-tfrag symbol :overlay-at (-> texture-anim 0)) + (texture-anim-pris symbol :overlay-at (-> texture-anim 1)) + (texture-anim-shrub symbol :overlay-at (-> texture-anim 2)) + (texture-anim-alpha symbol :overlay-at (-> texture-anim 3)) + (texture-anim-water symbol :overlay-at (-> texture-anim 4)) + (texture-anim-twarp symbol :overlay-at (-> texture-anim 5)) + (texture-anim-pris2 symbol :overlay-at (-> texture-anim 6)) + (texture-anim-sprite symbol :overlay-at (-> texture-anim 7)) + (texture-anim-map symbol :overlay-at (-> texture-anim 8)) + (texture-anim-sky symbol :overlay-at (-> texture-anim 9)) + (draw-priority float) + (level-flags uint32) + (fog-height float) + (bigmap-id bigmap-id) + (ocean-near-translucent? symbol) + (ocean-far? symbol) + (mood-range mood-range :inline) + (max-rain float) + (fog-mult float) + (ocean-alpha float) + (extra-sound-bank pair) ) :pack-me - :method-count-assert 9 - :size-assert #x120 - :flag-assert #x900000120 ) (deftype login-state (basic) - ((state int32 :offset-assert 4) - (pos uint32 :offset-assert 8) - (elts uint32 :offset-assert 12) - (elt drawable 16 :offset-assert 16) + ((state int32) + (pos uint32) + (elts uint32) + (elt drawable 16) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype level (basic) - ((name symbol :offset-assert 4) - (load-name symbol :offset-assert 8) - (nickname symbol :offset-assert 12) - (index int32 :offset-assert 16) - (status symbol :offset-assert 20) - (borrow-level level 2 :offset-assert 24) - (borrow-from-level level :offset-assert 32) - (heap kheap :inline :offset-assert 48) - (borrow-heap kheap 2 :inline :offset-assert 64) - (bsp bsp-header :offset-assert 96) - (art-group load-dir-art-group :offset-assert 100) - (info level-load-info :offset-assert 104) - (texture-page texture-page 18 :offset-assert 108) - (loaded-texture-page texture-page 16 :offset-assert 180) - (loaded-texture-page-count int32 :offset-assert 244) - (entity entity-links-array :offset-assert 248) - (closest-object float :offset-assert 252) - (closest-object-array float 18 :offset 252) - (upload-size int32 18 :offset 324) - (inside-boxes symbol :offset-assert 396) - (display? symbol :offset-assert 400) - (render? symbol :offset-assert 404) - (meta-inside? symbol :offset-assert 408) - (force-inside? symbol :offset-assert 412) - (mood-context mood-context :inline :offset-assert 416) - (mood-func (function mood-context float int none) :offset-assert 2384) - (mood-init (function mood-context none) :offset-assert 2388) - (vis-bits pointer :offset-assert 2392) - (all-visible? symbol :offset-assert 2396) - (force-all-visible? symbol :offset-assert 2400) - (linking symbol :offset-assert 2404) - (vis-info level-vis-info 8 :offset-assert 2408) - (vis-self-index int32 :offset-assert 2440) - (vis-adj-index int32 :offset-assert 2444) - (vis-buffer uint8 2048 :offset-assert 2448) - (mem-usage-block memory-usage-block :offset-assert 4496) - (mem-usage int32 :offset-assert 4500) - (code-memory-start pointer :offset-assert 4504) - (code-memory-end pointer :offset-assert 4508) - (load-start-time time-frame :offset-assert 4512) - (load-stop-time time-frame :offset-assert 4520) - (load-buffer uint32 2 :offset-assert 4528) - (load-buffer-size uint32 :offset-assert 4536) - (load-buffer-last uint32 :offset-assert 4540) - (load-buffer-mode load-buffer-mode :offset-assert 4544) - (display-start-time time-frame :offset-assert 4552) - (memory-mask uint32 :offset-assert 4560) - (task-mask task-mask :offset-assert 4564) - (tfrag-gs-test gs-test :offset-assert 4568) - (texture-dirty-masks texture-mask 10 :inline :offset-assert 4576) - (texture-mask texture-mask 18 :inline :offset-assert 4736) - (sky-mask texture-mask :inline :offset-assert 5024) - (tfrag-masks texture-masks-array :offset-assert 5040) - (tfrag-dists pointer :offset-assert 5044) - (shrub-masks texture-masks-array :offset-assert 5048) - (shrub-dists pointer :offset-assert 5052) - (alpha-masks texture-masks-array :offset-assert 5056) - (alpha-dists pointer :offset-assert 5060) - (water-masks texture-masks-array :offset-assert 5064) - (water-dists pointer :offset-assert 5068) - (tfrag-last-calls int32 6 :offset-assert 5072) - (tfrag-last-calls-u32 uint32 6 :offset 5072) - (texture-anim-array texture-anim-array 10 :offset-assert 5096) - (light-hash light-hash :offset-assert 5136) - (draw-priority float :offset-assert 5140) - (draw-index int32 :offset-assert 5144) - (part-engine engine :offset-assert 5148) - (user-object basic 4 :offset-assert 5152) - (loaded-text-info-count int32 :offset-assert 5168) - (loaded-text-info game-text-info 8 :offset-assert 5172) - (level-type type :offset-assert 5204) - (load-order int64 :offset-assert 5208) - (pad int8 12 :offset-assert 5216) + ((name symbol) + (load-name symbol) + (nickname symbol) + (index int32) + (status symbol) + (borrow-level level 2) + (borrow-from-level level) + (heap kheap :inline) + (borrow-heap kheap 2 :inline) + (bsp bsp-header) + (art-group load-dir-art-group) + (info level-load-info) + (texture-page texture-page 18) + (loaded-texture-page texture-page 16) + (loaded-texture-page-count int32) + (entity entity-links-array) + (closest-object float) + (closest-object-array float 18 :overlay-at closest-object) + (upload-size int32 18 :offset 324) + (inside-boxes symbol) + (display? symbol) + (render? symbol) + (meta-inside? symbol) + (force-inside? symbol) + (mood-context mood-context :inline) + (mood-func (function mood-context float int none)) + (mood-init (function mood-context none)) + (vis-bits pointer) + (all-visible? symbol) + (force-all-visible? symbol) + (linking symbol) + (vis-info level-vis-info 8) + (vis-self-index int32) + (vis-adj-index int32) + (vis-buffer uint8 2048) + (mem-usage-block memory-usage-block) + (mem-usage int32) + (code-memory-start pointer) + (code-memory-end pointer) + (load-start-time time-frame) + (load-stop-time time-frame) + (load-buffer uint32 2) + (load-buffer-size uint32) + (load-buffer-last uint32) + (load-buffer-mode load-buffer-mode) + (display-start-time time-frame) + (memory-mask uint32) + (task-mask task-mask) + (tfrag-gs-test gs-test) + (texture-dirty-masks texture-mask 10 :inline) + (texture-mask texture-mask 18 :inline) + (sky-mask texture-mask :inline) + (tfrag-masks texture-masks-array) + (tfrag-dists pointer) + (shrub-masks texture-masks-array) + (shrub-dists pointer) + (alpha-masks texture-masks-array) + (alpha-dists pointer) + (water-masks texture-masks-array) + (water-dists pointer) + (tfrag-last-calls int32 6) + (tfrag-last-calls-u32 uint32 6 :overlay-at (-> tfrag-last-calls 0)) + (texture-anim-array texture-anim-array 10) + (light-hash light-hash) + (draw-priority float) + (draw-index int32) + (part-engine engine) + (user-object basic 4) + (loaded-text-info-count int32) + (loaded-text-info game-text-info 8) + (level-type type) + (load-order int64) + (pad int8 12) ) - :method-count-assert 30 - :size-assert #x146c - :flag-assert #x1e0000146c (:methods - (deactivate (_type_) _type_ 9) - (is-object-visible? (_type_ int) symbol 10) - (level-method-11 () none 11) - (unload! (_type_) _type_ 12) - (bsp-name (_type_) symbol 13) - (compute-memory-usage! (_type_ symbol) memory-usage-block 14) - (inside-boxes-check (_type_ vector) symbol 15) - (update-vis! (_type_ level-vis-info uint (pointer uint8)) symbol 16) - (load-continue (_type_) _type_ 17) - (load-begin (_type_) _type_ 18) - (login-begin (_type_) _type_ 19) - (debug-print-region-splitbox (_type_ vector object) none 20) - (get-art-group-by-name (_type_ string) art-group 21) - (level-method-22 (_type_ symbol) int 22) - (lookup-text (_type_ text-id symbol) string 23) - (level-method-24 () none 24) - (birth (_type_) _type_ 25) - (level-status-update! (_type_ symbol) _type_ 26) - (load-required-packages (_type_) _type_ 27) - (init-vis-from-bsp (_type_) none 28) - (vis-clear (_type_) none 29) + (deactivate (_type_) _type_) + (is-object-visible? (_type_ int) symbol) + (level-method-11 () none) + (unload! (_type_) _type_) + (bsp-name (_type_) symbol) + (compute-memory-usage! (_type_ symbol) memory-usage-block) + (inside-boxes-check (_type_ vector) symbol) + (update-vis! (_type_ level-vis-info uint (pointer uint8)) symbol) + (load-continue (_type_) _type_) + (load-begin (_type_) _type_) + (login-begin (_type_) _type_) + (debug-print-region-splitbox (_type_ vector object) none) + (get-art-group-by-name (_type_ string) art-group) + (level-method-22 (_type_ symbol) int) + (lookup-text (_type_ text-id symbol) string) + (level-method-24 () none) + (birth (_type_) _type_) + (level-status-update! (_type_ symbol) _type_) + (load-required-packages (_type_) _type_) + (init-vis-from-bsp (_type_) none) + (vis-clear (_type_) none) ) ) (deftype level-group (basic) - ((length int32 :offset-assert 4) - (log-in-level-bsp bsp-header :offset-assert 8) - (loading-level level :offset-assert 12) - (entity-link entity-links :offset 16) - (border? symbol :offset-assert 20) - (vis? symbol :offset-assert 24) - (want-level basic :offset-assert 28) - (receiving-level basic :offset-assert 32) - (load-commands pair :offset-assert 36) - (play? symbol :offset-assert 40) - (target-pos vector 2 :inline :offset-assert 48) - (camera-pos vector 2 :inline :offset-assert 80) - (heap kheap :inline :offset-assert 112) - (sound-bank basic 4 :offset-assert 128) - (disk-load-timing? symbol :offset-assert 144) - (load-level symbol :offset-assert 148) - (load-size uint32 :offset-assert 152) - (load-time float :offset-assert 156) - (load-login-time float :offset-assert 160) - (draw-level-count int32 :offset-assert 164) - (draw-level level LEVEL_TOTAL :offset-assert 168) - (draw-index-map uint8 LEVEL_TOTAL :offset-assert 196) - (load-order uint64 :offset-assert 208) - (pad uint8 30 :offset 216) - (level level LEVEL_TOTAL :inline :offset-assert 256) - (level0 level :inline :offset 256) - (level1 level :inline :offset 5488) - (level2 level :inline :offset 10720) - (level3 level :inline :offset 15952) - (level4 level :inline :offset 21184) - (level5 level :inline :offset 26416) - (default-level level :inline :offset 31648) - (pad2 uint8 4) + ((length int32) + (log-in-level-bsp bsp-header) + (loading-level level) + (entity-link entity-links :offset 16) + (border? symbol) + (vis? symbol) + (want-level basic) + (receiving-level basic) + (load-commands pair) + (play? symbol) + (target-pos vector 2 :inline) + (camera-pos vector 2 :inline) + (heap kheap :inline) + (sound-bank basic 4) + (disk-load-timing? symbol) + (load-level symbol) + (load-size uint32) + (load-time float) + (load-login-time float) + (draw-level-count int32) + (draw-level level 7) + (draw-index-map uint8 7) + (load-order uint64) + (pad uint8 30) + (level level 7 :inline) + (level0 level :inline :overlay-at (-> level 0)) + (level1 level :inline :offset 5488) + (level2 level :inline :offset 10720) + (level3 level :inline :offset 15952) + (level4 level :inline :offset 21184) + (level5 level :inline :offset 26416) + (default-level level :inline :offset 31648) + (pad2 uint8 4) ) - :method-count-assert 31 - :size-assert #x9014 - :flag-assert #x1f00009014 (:methods - (level-get (_type_ symbol) level 9) - (level-get-with-status (_type_ symbol) level 10) - (get-level-by-heap-ptr-and-status (_type_ pointer symbol) level 11) - (level-get-for-use (_type_ symbol symbol) level 12) - (activate-levels! (_type_) int 13) - (debug-print-entities (_type_ symbol type) none 14) - (debug-draw-actors (_type_ symbol) none 15) - (assign-draw-indices (_type_) none 16) - (actors-update (_type_) none 17) - (update-nav-meshes-method (_type_) none 18) - (level-update (_type_) none 19) - (level-get-target-inside (_type_) level 20) - (alloc-levels-if-needed (_type_ symbol) none 21) - (load-commands-set! (_type_ pair) none 22) - (art-group-get-by-name (_type_ string (pointer uint32)) art-group 23) - (alt-load-command-get-index (_type_ symbol int) pair 24) - (update-vis-volumes (_type_) none 25) - (update-vis-volumes-from-nav-mesh (_type_) none 26) - (print-volume-sizes (_type_) none 27) - (level-status (_type_ symbol) symbol 28) - (load-in-progress? (_type_) symbol 29) - (level-get-most-disposable (_type_) level 30) + (level-get (_type_ symbol) level) + (level-get-with-status (_type_ symbol) level) + (get-level-by-heap-ptr-and-status (_type_ pointer symbol) level) + (level-get-for-use (_type_ symbol symbol) level) + (activate-levels! (_type_) int) + (debug-print-entities (_type_ symbol type) none) + (debug-draw-actors (_type_ symbol) none) + (assign-draw-indices (_type_) none) + (actors-update (_type_) none) + (update-nav-meshes-method (_type_) none) + (level-update (_type_) none) + (level-get-target-inside (_type_) level) + (alloc-levels-if-needed (_type_ symbol) none) + (load-commands-set! (_type_ pair) none) + (art-group-get-by-name (_type_ string (pointer uint32)) art-group) + (alt-load-command-get-index (_type_ symbol int) pair) + (update-vis-volumes (_type_) none) + (update-vis-volumes-from-nav-mesh (_type_) none) + (print-volume-sizes (_type_) none) + (level-status (_type_ symbol) symbol) + (load-in-progress? (_type_) symbol) + (level-get-most-disposable (_type_) level) ) ) diff --git a/goal_src/jak2/engine/level/level.gc b/goal_src/jak2/engine/level/level.gc index 83bef939536..a2bc8344a90 100644 --- a/goal_src/jak2/engine/level/level.gc +++ b/goal_src/jak2/engine/level/level.gc @@ -104,7 +104,7 @@ into 7 sections, which might explain the weird sizes in the center. default-level ) -(defmethod alt-load-command-get-index level-group ((this level-group) (arg0 symbol) (arg1 int)) +(defmethod alt-load-command-get-index ((this level-group) (arg0 symbol) (arg1 int)) "Get the n-th alt-load-command for the given level. This is likely unused in jak 2 because no levels have alt-load-commands." (let ((v1-1 (-> (lookup-level-info arg0) alt-load-commands))) @@ -119,12 +119,12 @@ into 7 sections, which might explain the weird sizes in the center. ) ) -(defmethod load-in-progress? level-group ((this level-group)) +(defmethod load-in-progress? ((this level-group)) "Is a level being loaded right now?" (!= (-> *level* loading-level) (-> *level* default-level)) ) -(defmethod get-level-by-heap-ptr-and-status level-group ((this level-group) (arg0 pointer) (arg1 symbol)) +(defmethod get-level-by-heap-ptr-and-status ((this level-group) (arg0 pointer) (arg1 symbol)) "Get a level by a heap pointer and status. If no matching level is found, return #f. The purpose of the status check is possibly to prevent bugs with getting stuff @@ -168,7 +168,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) -(defmethod get-art-group-by-name level ((this level) (arg0 string)) +(defmethod get-art-group-by-name ((this level) (arg0 string)) "As the name implies, look through the art-groups of this level and get the one with the given name. Return #f if not found." (countdown (s4-0 (-> this art-group art-group-array length)) @@ -179,7 +179,7 @@ into 7 sections, which might explain the weird sizes in the center. (the-as art-group #f) ) -(defmethod bsp-name level ((this level)) +(defmethod bsp-name ((this level)) "Get the name of the bsp. If this can't be done, get the name of the level." (if (and (!= (-> this status) 'inactive) (-> this bsp) (nonzero? (-> this bsp name))) (-> this bsp name) @@ -199,12 +199,12 @@ into 7 sections, which might explain the weird sizes in the center. (none) ) -(defmethod print level ((this level)) +(defmethod print ((this level)) (format #t "#<~A ~A ~S @ #x~X>" (-> this type) (-> this status) (-> this name) this) this ) -(defmethod relocate bsp-header ((this bsp-header) (arg0 int)) +(defmethod relocate ((this bsp-header) (arg0 int)) "Handle the load of a new bsp-header. The linker calls this function when the bsp-header is linked. Do some sanity checks and link the bsp-header and level to each other." @@ -245,7 +245,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) -(defmethod load-required-packages level ((this level)) +(defmethod load-required-packages ((this level)) "Load packages for a level. This just loads common, and this feature is not really useful. Packages were only used during development, and seem only partially used in Jak 2 @@ -258,7 +258,7 @@ into 7 sections, which might explain the weird sizes in the center. this ) -(defmethod vis-clear level ((this level)) +(defmethod vis-clear ((this level)) "Completely invalide all visibility data, vis-info, and set all-visible? to loading." (countdown (v1-0 8) (nop!) @@ -272,7 +272,7 @@ into 7 sections, which might explain the weird sizes in the center. (none) ) -(defmethod init-vis-from-bsp level ((this level)) +(defmethod init-vis-from-bsp ((this level)) "Set up a level's vis-infos from a bsp." (when (not (or (= (-> this status) 'inactive) (not (-> this bsp)))) ;; mark our visibility as 'loading. @@ -314,7 +314,7 @@ into 7 sections, which might explain the weird sizes in the center. (none) ) -(defmethod level-get-for-use level-group ((this level-group) (arg0 symbol) (arg1 symbol)) +(defmethod level-get-for-use ((this level-group) (arg0 symbol) (arg1 symbol)) "Request a level by name in the given state. Will return quickly (non-blocking) and might not be able to get a level in the desired state, though it will ofborrow do some small amount of work to make progress on loading. @@ -398,7 +398,7 @@ into 7 sections, which might explain the weird sizes in the center. s5-1 ) -(defmethod level-status level-group ((this level-group) (arg0 symbol)) +(defmethod level-status ((this level-group) (arg0 symbol)) "Get the status of a level by name, return #f if no level is found." (let ((v1-1 (level-get *level* arg0))) (if v1-1 @@ -407,7 +407,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) -(defmethod level-status-update! level ((this level) (arg0 symbol)) +(defmethod level-status-update! ((this level) (arg0 symbol)) "Try to update the level to the given status, calling whatever is needed to make it happen. This can do both loading, linking, login, and activation. @@ -561,7 +561,7 @@ into 7 sections, which might explain the weird sizes in the center. ;; a case in the DGO loader here. If the objects come in totally corrupted, we're likely missing ;; some additional syncronization. -(defmethod load-continue level ((this level)) +(defmethod load-continue ((this level)) "Run the loading/login state machine. This will only make progress on loading, linking, and login for loads that have already started. No 'scary' state transitions (like birth, alive, deactivate) are made here." @@ -717,7 +717,7 @@ into 7 sections, which might explain the weird sizes in the center. this ) -(defmethod load-begin level ((this level)) +(defmethod load-begin ((this level)) "Begin loading a level. This assigns memory to a level and is somewhat confusing." (local-vars (bits-to-use int) (borrow-from-lev level) (found-borrow symbol)) @@ -1045,7 +1045,7 @@ into 7 sections, which might explain the weird sizes in the center. this ) -(defmethod login-begin level ((this level)) +(defmethod login-begin ((this level)) "Begin login of a level after linking. The login is spread over multiple frames." @@ -1423,7 +1423,7 @@ into 7 sections, which might explain the weird sizes in the center. lev ) -(defmethod birth level ((this level)) +(defmethod birth ((this level)) "Start running code for a level that has been loaded." (local-vars (sv-96 int)) (case (-> this status) @@ -1497,7 +1497,7 @@ into 7 sections, which might explain the weird sizes in the center. this ) -(defmethod deactivate level ((this level)) +(defmethod deactivate ((this level)) "Take a level out of active/alive" (case (-> this status) (('active 'alive) @@ -1558,7 +1558,7 @@ into 7 sections, which might explain the weird sizes in the center. this ) -(defmethod unload! level ((this level)) +(defmethod unload! ((this level)) "Unload a level." ;; make sure it's not alive/active @@ -1731,7 +1731,7 @@ into 7 sections, which might explain the weird sizes in the center. this ) -(defmethod is-object-visible? level ((this level) (arg0 int)) +(defmethod is-object-visible? ((this level) (arg0 int)) "Is drawable arg0 visible? Note that this will return #f if the visibility data is not loaded." ;; check the vis bits! @@ -1757,7 +1757,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) -(defmethod inside-boxes-check level ((this level) (arg0 vector)) +(defmethod inside-boxes-check ((this level) (arg0 vector)) "NOTE: this function used to check if we were in boxes - here it just checks a flag. However, it is still used to set the inside-boxes field, so it keeps the name we gave it in Jak 1. @@ -1778,7 +1778,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) -(defmethod debug-print-region-splitbox level ((this level) (arg0 vector) (arg1 object)) +(defmethod debug-print-region-splitbox ((this level) (arg0 vector) (arg1 object)) "Display debug info about the regions of a level." (cond ((or (not (-> this bsp)) (zero? (-> this bsp region-tree))) @@ -1791,7 +1791,7 @@ into 7 sections, which might explain the weird sizes in the center. (none) ) -(defmethod mem-usage level ((this level) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this level) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a level." (when (= (-> this status) 'active) (set! (-> arg0 length) (max 67 (-> arg0 length))) @@ -1848,7 +1848,7 @@ into 7 sections, which might explain the weird sizes in the center. ) -(defmethod alloc-levels-if-needed level-group ((this level-group) (arg0 symbol)) +(defmethod alloc-levels-if-needed ((this level-group) (arg0 symbol)) "Setup for playing levels by loading the required base packages (art, common) and allocating the level heap." (when (zero? (-> *level* heap base)) @@ -1882,7 +1882,7 @@ into 7 sections, which might explain the weird sizes in the center. (none) ) -(defmethod level-get-with-status level-group ((this level-group) (arg0 symbol)) +(defmethod level-get-with-status ((this level-group) (arg0 symbol)) "Get a level with the given status." (dotimes (v1-0 (-> this length)) (if (= (-> this level v1-0 status) arg0) @@ -1892,7 +1892,7 @@ into 7 sections, which might explain the weird sizes in the center. (the-as level #f) ) -(defmethod level-get-most-disposable level-group ((this level-group)) +(defmethod level-get-most-disposable ((this level-group)) "Get the level that's least useful." (dotimes (v1-0 (-> this length)) (case (-> this level v1-0 status) @@ -1931,7 +1931,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) -(defmethod level-get level-group ((this level-group) (arg0 symbol)) +(defmethod level-get ((this level-group) (arg0 symbol)) "Get a level by name or load-name" (dotimes (v1-0 (-> this length)) (if (and (!= (-> this level v1-0 status) 'inactive) @@ -1943,7 +1943,7 @@ into 7 sections, which might explain the weird sizes in the center. (the-as level #f) ) -(defmethod art-group-get-by-name level-group ((this level-group) (arg0 string) (arg1 (pointer uint32))) +(defmethod art-group-get-by-name ((this level-group) (arg0 string) (arg1 (pointer uint32))) "Search all levels for an art-group. Return the art group, or #f. Optionally return the level index." (countdown (s4-0 LEVEL_TOTAL) (let ((s3-0 (-> *level* level s4-0))) @@ -1962,7 +1962,7 @@ into 7 sections, which might explain the weird sizes in the center. (the-as art-group #f) ) -(defmethod activate-levels! level-group ((this level-group)) +(defmethod activate-levels! ((this level-group)) "Set all levels to active." (dotimes (s5-0 (-> this length)) (level-status-update! (-> this level s5-0) 'active) @@ -1970,7 +1970,7 @@ into 7 sections, which might explain the weird sizes in the center. 0 ) -(defmethod level-get-target-inside level-group ((this level-group)) +(defmethod level-get-target-inside ((this level-group)) "Get the level that target is 'in'. With a bunch of tricks for what 'in' really means." (let ((s5-0 (target-pos 0))) @@ -2054,13 +2054,13 @@ into 7 sections, which might explain the weird sizes in the center. ) -(defmethod load-commands-set! level-group ((this level-group) (arg0 pair)) +(defmethod load-commands-set! ((this level-group) (arg0 pair)) "Set the load-commands of a level." (set! (-> this load-commands) arg0) (none) ) -(defmethod mem-usage level-group ((this level-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this level-group) (arg0 memory-usage-block) (arg1 int)) "Compute mem-usage for an entire level-group." (dotimes (s3-0 (-> this length)) (mem-usage (-> this level s3-0) arg0 arg1) @@ -2389,7 +2389,7 @@ into 7 sections, which might explain the weird sizes in the center. 0 ) -(defmethod update! load-state ((this load-state)) +(defmethod update! ((this load-state)) "Update level stuff based on load state. This does scary transitions." @@ -2625,7 +2625,7 @@ into 7 sections, which might explain the weird sizes in the center. ;; the draw-level array of level-group stores levels in the order they should be drawn. ;; eg: level3 of the DMA bucket array is actually (-> *level* draw-level 3), not (-> *level* level 3). -(defmethod assign-draw-indices level-group ((this level-group)) +(defmethod assign-draw-indices ((this level-group)) "Sort the levels by draw priority." (local-vars (t0-3 symbol)) (set! (-> this draw-level-count) 0) @@ -2679,7 +2679,7 @@ into 7 sections, which might explain the weird sizes in the center. (none) ) -(defmethod level-update level-group ((this level-group)) +(defmethod level-update ((this level-group)) (local-vars (v1-101 symbol)) (camera-pos) diff --git a/goal_src/jak2/engine/level/region-h.gc b/goal_src/jak2/engine/level/region-h.gc index 8453e4356bf..d1cbbe210a1 100644 --- a/goal_src/jak2/engine/level/region-h.gc +++ b/goal_src/jak2/engine/level/region-h.gc @@ -10,123 +10,90 @@ ;; DECOMP BEGINS (deftype region (structure) - ((id uint32 :offset-assert 0) - (on-enter pair :offset-assert 4) - (on-inside pair :offset-assert 8) - (on-exit pair :offset-assert 12) + ((id uint32) + (on-enter pair) + (on-inside pair) + (on-exit pair) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (region-method-9 (_type_ vector) symbol 9) + (region-method-9 (_type_ vector) symbol) ) ) (deftype region-array (inline-array-class) - ((data region :inline :dynamic :offset-assert 16) + ((data region :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> region-array heap-base) (the-as uint 16)) (deftype drawable-region-prim (drawable) - ((region region :offset 8) + ((region region :offset 8) ) - :method-count-assert 20 - :size-assert #x20 - :flag-assert #x1400000020 (:methods - (debug-draw-region (_type_ int) none 17) - (track-region (_type_ region-prim-area) symbol 18) - (within-area? (_type_ region-prim-area) symbol 19) + (debug-draw-region (_type_ int) none) + (track-region (_type_ region-prim-area) symbol) + (within-area? (_type_ region-prim-area) symbol) ) ) (deftype drawable-tree-region-prim (drawable-tree) - ((name basic :offset 8) - (data2 drawable-inline-array :dynamic :offset 32) + ((name basic :offset 8) + (data2 drawable-inline-array :dynamic :offset 32) ) - :method-count-assert 19 - :size-assert #x20 - :flag-assert #x1300000020 (:methods - (drawable-tree-region-prim-method-17 (_type_ vector) symbol 17) - (debug-print (_type_ vector object) none 18) + (drawable-tree-region-prim-method-17 (_type_ vector) symbol) + (debug-print (_type_ vector object) none) ) ) (deftype drawable-inline-array-region-prim (drawable-inline-array) - ((data drawable-region-prim 1 :inline :offset-assert 32) - (pad uint8 4 :offset-assert 64) + ((data drawable-region-prim 1 :inline) + (pad uint8 4) ) - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 ) (deftype drawable-region-sphere (drawable-region-prim) () - :method-count-assert 20 - :size-assert #x20 - :flag-assert #x1400000020 ) (deftype region-face-data (structure) - ((normal vector :inline :offset-assert 0) - (normal-offset float :offset 12) - (num-points uint32 :offset-assert 16) - (points vector :inline :dynamic :offset-assert 32) + ((normal vector :inline) + (normal-offset float :overlay-at (-> normal data 3)) + (num-points uint32) + (points vector :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype drawable-region-face (drawable-region-prim) - ((data region-face-data :offset 12) + ((data region-face-data :offset 12) ) - :method-count-assert 20 - :size-assert #x20 - :flag-assert #x1400000020 ) (deftype region-face-array (inline-array-class) - ((data drawable-region-face :inline :dynamic :offset 16) - (pad0 uint8 4 :offset-assert 16) + ((data drawable-region-face :inline :dynamic :offset 16) + (pad0 uint8 4) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (set! (-> region-face-array heap-base) (the-as uint 32)) (deftype drawable-region-volume (drawable-region-prim) - ((faces region-face-array :offset 12) + ((faces region-face-array :offset 12) ) - :method-count-assert 20 - :size-assert #x20 - :flag-assert #x1400000020 ) (deftype region-prim-list (structure) - ((num-items int32 :offset-assert 0) - (items drawable-region-prim 320 :offset-assert 4) + ((num-items int32) + (items drawable-region-prim 320) ) - :method-count-assert 9 - :size-assert #x504 - :flag-assert #x900000504 ) diff --git a/goal_src/jak2/engine/level/region.gc b/goal_src/jak2/engine/level/region.gc index 1ccaa12b9c2..4fe048cedf0 100644 --- a/goal_src/jak2/engine/level/region.gc +++ b/goal_src/jak2/engine/level/region.gc @@ -8,7 +8,7 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch int vs drawable-region-prim. -(defmethod mem-usage drawable-region-prim ((this drawable-region-prim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-region-prim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 50 (-> arg0 length))) (set! (-> arg0 data 49 name) "region") (+! (-> arg0 data 49 count) 1) @@ -21,7 +21,7 @@ ) ;; WARN: Return type mismatch int vs drawable-inline-array-region-prim. -(defmethod mem-usage drawable-inline-array-region-prim ((this drawable-inline-array-region-prim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-region-prim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -35,16 +35,16 @@ (the-as drawable-inline-array-region-prim 0) ) -(defmethod draw drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 drawable-tree-region-prim) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-region-prim) (arg0 drawable-tree-region-prim) (arg1 display-frame)) 0 (none) ) -(defmethod unpack-vis drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree-region-prim) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) -(defmethod collect-regions drawable-region-prim ((this drawable-region-prim) (area-of-interest sphere) (_count int) (region-list region-prim-list)) +(defmethod collect-regions ((this drawable-region-prim) (area-of-interest sphere) (_count int) (region-list region-prim-list)) "Determines the number of [[drawable]]s in the `this` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @@ -61,7 +61,7 @@ (none) ) -(defmethod collect-regions drawable-inline-array-region-prim ((this drawable-inline-array-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions ((this drawable-inline-array-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Determines the number of [[drawable]]s in the `this` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @@ -72,7 +72,7 @@ (none) ) -(defmethod collect-regions drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions ((this drawable-tree-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Determines the number of [[drawable]]s in the `this` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @@ -83,7 +83,7 @@ (none) ) -(defmethod debug-draw-region drawable-region-prim ((this drawable-region-prim) (arg0 int)) +(defmethod debug-draw-region ((this drawable-region-prim) (arg0 int)) (#when PC_PORT (when (and *debug-region-hide-empty* (not (or (-> this region on-enter) (-> this region on-exit) (-> this region on-inside)))) ;; no scripts to run means the region is "empty" so do not render (unless enabled) @@ -143,18 +143,18 @@ (none) ) -(defmethod track-region drawable-region-prim ((this drawable-region-prim) (arg0 region-prim-area)) +(defmethod track-region ((this drawable-region-prim) (arg0 region-prim-area)) "TODO" #f ) -(defmethod within-area? drawable-region-prim ((this drawable-region-prim) (arg0 region-prim-area)) +(defmethod within-area? ((this drawable-region-prim) (arg0 region-prim-area)) "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" #f ) ;; WARN: Function (method 9 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-entered-region! region-prim-area ((this region-prim-area) (region-sphere drawable-region-sphere)) +(defmethod track-entered-region! ((this region-prim-area) (region-sphere drawable-region-sphere)) "Enumerates through the objects `region-enter-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-enter-prim-list` and increment `region-enter-count` @@ -177,7 +177,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-enter-prim-list` and in ) ;; WARN: Function (method 10 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-exited-region! region-prim-area ((this region-prim-area) (arg0 drawable-region-sphere)) +(defmethod track-exited-region! ((this region-prim-area) (arg0 drawable-region-sphere)) "Enumerates through the objects `region-exit-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-exit-prim-list` and increment `region-exit-count` @@ -200,7 +200,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-exit-prim-list` and inc ) ;; WARN: Function (method 11 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-inside-region! region-prim-area ((this region-prim-area) (arg0 drawable-region-sphere)) +(defmethod track-inside-region! ((this region-prim-area) (arg0 drawable-region-sphere)) "Enumerates through the objects `region-inside-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-inside-prim-list` and increment `region-inside-count` @@ -223,7 +223,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-inside-prim-list` and i ) ;; WARN: Function (method 12 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-start-region! region-prim-area ((this region-prim-area) (arg0 drawable-region-sphere)) +(defmethod track-start-region! ((this region-prim-area) (arg0 drawable-region-sphere)) "Enumerates through the objects `region-start-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and increment `region-start-count` @@ -245,7 +245,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in (none) ) -(defmethod debug-draw-region drawable-region-sphere ((this drawable-region-sphere) (arg0 int)) +(defmethod debug-draw-region ((this drawable-region-sphere) (arg0 int)) (#when PC_PORT (when (and *debug-region-hide-empty* (not (or (-> this region on-enter) (-> this region on-exit) (-> this region on-inside)))) ;; no scripts to run means the region is "empty" so do not render (unless enabled) @@ -261,7 +261,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in (none) ) -(defmethod track-region drawable-region-sphere ((this drawable-region-sphere) (area region-prim-area)) +(defmethod track-region ((this drawable-region-sphere) (area region-prim-area)) "TODO" (-> this region) (let ((area-of-interest (-> this bsphere))) @@ -287,12 +287,12 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ) -(defmethod within-area? drawable-region-sphere ((this drawable-region-sphere) (area region-prim-area)) +(defmethod within-area? ((this drawable-region-sphere) (area region-prim-area)) "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" (spheres-overlap? (the-as sphere (-> area pos)) (the-as sphere (-> this bsphere))) ) -(defmethod debug-draw-region drawable-region-face ((this drawable-region-face) (arg0 int)) +(defmethod debug-draw-region ((this drawable-region-face) (arg0 int)) (#when PC_PORT (when (and *debug-region-hide-empty* (not (or (-> this region on-enter) (-> this region on-exit) (-> this region on-inside)))) ;; no scripts to run means the region is "empty" so do not render (unless enabled) @@ -352,7 +352,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in (none) ) -(defmethod track-region drawable-region-face ((this drawable-region-face) (arg0 region-prim-area)) +(defmethod track-region ((this drawable-region-face) (arg0 region-prim-area)) "TODO" (local-vars (sv-48 vector) (sv-52 vector) (sv-56 object)) (-> this region) @@ -419,7 +419,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ) -(defmethod debug-draw-region drawable-region-volume ((this drawable-region-volume) (arg0 int)) +(defmethod debug-draw-region ((this drawable-region-volume) (arg0 int)) (#when PC_PORT (when (and *debug-region-hide-empty* (not (or (-> this region on-enter) (-> this region on-exit) (-> this region on-inside)))) ;; no scripts to run means the region is "empty" so do not render (unless enabled) @@ -441,7 +441,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in (none) ) -(defmethod track-region drawable-region-volume ((this drawable-region-volume) (area region-prim-area)) +(defmethod track-region ((this drawable-region-volume) (area region-prim-area)) "TODO" (if (within-area? this area) (track-start-region! area (the-as drawable-region-sphere this)) @@ -462,7 +462,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in #t ) -(defmethod within-area? drawable-region-volume ((this drawable-region-volume) (arg0 region-prim-area)) +(defmethod within-area? ((this drawable-region-volume) (arg0 region-prim-area)) "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" (let* ((v1-1 (-> this faces length)) (a2-0 0) @@ -481,7 +481,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in #t ) -(defmethod drawable-tree-region-prim-method-17 drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 vector)) +(defmethod drawable-tree-region-prim-method-17 ((this drawable-tree-region-prim) (arg0 vector)) (sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area (scratchpad-object region-prim-area)) pos)) arg0 0.0) (let* ((s5-0 (-> this data2 (+ (-> this length) -1) length)) (s4-0 0) @@ -499,7 +499,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ;; WARN: Return type mismatch int vs symbol. -(defmethod region-method-9 region ((this region) (arg0 vector)) +(defmethod region-method-9 ((this region) (arg0 vector)) (local-vars (sv-16 int) (sv-32 int)) (sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area (scratchpad-object region-prim-area)) pos)) arg0 0.0) (dotimes (s5-0 (-> *level* length)) @@ -538,7 +538,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in (the-as symbol #f) ) -(defmethod debug-print drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 vector) (arg1 object)) +(defmethod debug-print ((this drawable-tree-region-prim) (arg0 vector) (arg1 object)) (sphere<-vector+r! (the-as sphere (-> (scratchpad-object region-prim-area) pos)) arg0 0.0) (let* ((s4-0 (-> this data2 (+ (-> this length) -1) length)) (s3-0 0) diff --git a/goal_src/jak2/engine/load/decomp-h.gc b/goal_src/jak2/engine/load/decomp-h.gc index 1710d346a11..eb3f4a98cac 100644 --- a/goal_src/jak2/engine/load/decomp-h.gc +++ b/goal_src/jak2/engine/load/decomp-h.gc @@ -12,12 +12,9 @@ ;; temporary storage for visibility data decompression. ;; this is stored on the scratchpad. (deftype decomp-work (structure) - ((buffer0 uint8 2048 :offset-assert 0) - (buffer1 uint8 2048 :offset-assert 2048) - (indices uint16 2048 :offset-assert 4096) - (temp-indices uint16 2048 :offset-assert 8192) + ((buffer0 uint8 2048) + (buffer1 uint8 2048) + (indices uint16 2048) + (temp-indices uint16 2048) ) - :method-count-assert 9 - :size-assert #x3000 - :flag-assert #x900003000 ) diff --git a/goal_src/jak2/engine/load/decomp.gc b/goal_src/jak2/engine/load/decomp.gc index 0c89100f251..bc5a14cd45c 100644 --- a/goal_src/jak2/engine/load/decomp.gc +++ b/goal_src/jak2/engine/load/decomp.gc @@ -54,12 +54,9 @@ It's not super clear to me why they ditched this system. Maybe the visibility da ) (deftype huf-dictionary-node (structure) - ((zero uint16 :offset-assert 0) - (one uint16 :offset-assert 2) + ((zero uint16) + (one uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -255,9 +252,7 @@ It's not super clear to me why they ditched this system. Maybe the visibility da (none) ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 138] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 145] -(defmethod update-vis! level ((this level) (vis-info level-vis-info) (unused uint) (in-bsp-vis-string (pointer uint8))) +(defmethod update-vis! ((this level) (vis-info level-vis-info) (unused uint) (in-bsp-vis-string (pointer uint8))) (local-vars (t0-3 uint128) (extra-vis-length int) (extra-vis-dest (pointer int8))) (let* ((cam-leaf-idx (-> vis-info from-bsp current-leaf-idx)) (curr-vis-string-offset (-> vis-info current-vis-string)) diff --git a/goal_src/jak2/engine/load/file-io.gc b/goal_src/jak2/engine/load/file-io.gc index 59f8c30b0da..62ba92e9c76 100644 --- a/goal_src/jak2/engine/load/file-io.gc +++ b/goal_src/jak2/engine/load/file-io.gc @@ -24,16 +24,13 @@ NOTE: this is a special type in three ways: ;; DECOMP BEGINS (deftype file-stream (basic) - ((flags uint32 :offset-assert 4) - (mode symbol :offset-assert 8) - (name string :offset-assert 12) - (file uint32 :offset-assert 16) + ((flags uint32) + (mode symbol) + (name string) + (file uint32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 (:methods - (new (symbol type string symbol) _type_ 0) + (new (symbol type string symbol) _type_) ) ) @@ -69,21 +66,18 @@ NOTE: this is a special type in three ways: ) (deftype file-info (basic) - ((file-type (pointer string) :offset-assert 4) - (file-name basic :offset-assert 8) - (major-version uint32 :offset-assert 12) - (minor-version uint32 :offset-assert 16) - (maya-file-name basic :offset-assert 20) - (tool-debug basic :offset-assert 24) - (mdb-file-name basic :offset-assert 28) + ((file-type (pointer string)) + (file-name basic) + (major-version uint32) + (minor-version uint32) + (maya-file-name basic) + (tool-debug basic) + (mdb-file-name basic) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) -(defmethod print file-info ((this file-info)) +(defmethod print ((this file-info)) "Print information about a file" (format #t @@ -244,7 +238,3 @@ NOTE: this is a special type in three ways: ) ) ) - - - - diff --git a/goal_src/jak2/engine/load/load-dgo.gc b/goal_src/jak2/engine/load/load-dgo.gc index 9dd835568ef..94f92942b81 100644 --- a/goal_src/jak2/engine/load/load-dgo.gc +++ b/goal_src/jak2/engine/load/load-dgo.gc @@ -19,57 +19,45 @@ ;; DECOMP BEGINS (deftype load-dgo-msg (structure) - ((rsvd uint16 :offset-assert 0) - (result load-msg-result :offset-assert 2) - (b1 pointer :offset-assert 4) - (b2 pointer :offset-assert 8) - (bt pointer :offset-assert 12) - (name uint128 :offset-assert 16) - (address uint32 :offset 4) + ((rsvd uint16) + (result load-msg-result) + (b1 pointer) + (b2 pointer) + (bt pointer) + (name uint128) + (address uint32 :overlay-at b1) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype load-chunk-msg (structure) - ((rsvd uint16 :offset-assert 0) - (result load-msg-result :offset-assert 2) - (address pointer :offset-assert 4) - (section uint32 :offset-assert 8) - (maxlen uint32 :offset-assert 12) - (dummy uint32 4 :offset-assert 16) - (basename sound-stream-name :inline :offset-assert 32) + ((rsvd uint16) + (result load-msg-result) + (address pointer) + (section uint32) + (maxlen uint32) + (dummy uint32 4) + (basename sound-stream-name :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype play-chunk-msg (structure) - ((rsvd uint16 :offset-assert 0) - (result uint16 :offset-assert 2) - (address pointer :offset-assert 4) - (section uint32 :offset-assert 8) - (maxlen uint32 :offset-assert 12) - (id uint32 4 :offset-assert 16) - (basename sound-stream-name 4 :inline :offset-assert 32) + ((rsvd uint16) + (result uint16) + (address pointer) + (section uint32) + (maxlen uint32) + (id uint32 4) + (basename sound-stream-name 4 :inline) ) - :method-count-assert 9 - :size-assert #xe0 - :flag-assert #x9000000e0 ) (deftype dgo-header (structure) - ((length uint32 :offset-assert 0) - (rootname uint8 60 :offset-assert 4) + ((length uint32) + (rootname uint8 60) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (define-extern *load-dgo-rpc* rpc-buffer-pair) diff --git a/goal_src/jak2/engine/load/load-state.gc b/goal_src/jak2/engine/load/load-state.gc index fe95c385a54..9620c5e98eb 100644 --- a/goal_src/jak2/engine/load/load-state.gc +++ b/goal_src/jak2/engine/load/load-state.gc @@ -10,7 +10,7 @@ ;; DECOMP BEGINS -(defmethod print level-buffer-state ((this level-buffer-state)) +(defmethod print ((this level-buffer-state)) (format #t "#" @@ -23,7 +23,7 @@ this ) -(defmethod reset! load-state ((this load-state)) +(defmethod reset! ((this load-state)) (dotimes (v1-0 (-> *level* length)) (set! (-> this want v1-0 name) #f) (set! (-> this want v1-0 display?) #f) @@ -41,7 +41,7 @@ this ) -(defmethod want-levels load-state ((this load-state) (arg0 (pointer symbol))) +(defmethod want-levels ((this load-state) (arg0 (pointer symbol))) (dotimes (v1-0 LEVEL_MAX) (dotimes (a2-0 6) (when (= (-> this want v1-0 name) (-> arg0 a2-0)) @@ -70,7 +70,7 @@ 0 ) -(defmethod want-sound-banks load-state ((this load-state) (arg0 (pointer symbol))) +(defmethod want-sound-banks ((this load-state) (arg0 (pointer symbol))) (dotimes (v1-0 3) (dotimes (a2-0 3) (when (= (-> this want-sound v1-0) (-> arg0 a2-0)) @@ -96,7 +96,7 @@ (none) ) -(defmethod want-display-level load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-display-level ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 LEVEL_MAX) (when (= (-> this want v1-0 name) arg0) (set! (-> this want v1-0 display?) arg1) @@ -110,7 +110,7 @@ 0 ) -(defmethod want-vis-level load-state ((this load-state) (arg0 symbol)) +(defmethod want-vis-level ((this load-state) (arg0 symbol)) (let ((v1-0 (lookup-level-info arg0))) (if v1-0 (set! arg0 (-> v1-0 name)) @@ -121,7 +121,7 @@ (none) ) -(defmethod want-force-vis load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-force-vis ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 LEVEL_MAX) (when (= (-> this want v1-0 name) arg0) (set! (-> this want v1-0 force-vis?) arg1) @@ -133,7 +133,7 @@ ) ;; WARN: Function (method 16 load-state) has a return type of none, but the expression builder found a return statement. -(defmethod want-force-inside load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-force-inside ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 LEVEL_MAX) (when (= (-> this want v1-0 name) arg0) (set! (-> this want v1-0 force-inside?) arg1) @@ -145,7 +145,7 @@ (none) ) -(defmethod add-borrow-levels load-state ((this load-state)) +(defmethod add-borrow-levels ((this load-state)) "Update the load state so it includes the 'borrow' levels associated with the desired levels. This will also remove borrow levels that are no longer needed." @@ -221,7 +221,7 @@ (define *display-load-commands* #f) -(defmethod backup-load-state-and-set-cmds load-state ((this load-state) (arg0 pair)) +(defmethod backup-load-state-and-set-cmds ((this load-state) (arg0 pair)) (dotimes (s4-0 256) (when (-> this object-name s4-0) (format 0 "WARNING: load state somehow aquired object command ~A~%" (-> this object-name s4-0)) @@ -234,7 +234,7 @@ 0 ) -(defmethod restore-load-state-and-cleanup load-state ((this load-state)) +(defmethod restore-load-state-and-cleanup ((this load-state)) (with-pp (execute-commands-up-to this 100000.0) (dotimes (s5-0 256) @@ -267,7 +267,7 @@ ) ) -(defmethod restore-load-state load-state ((this load-state)) +(defmethod restore-load-state ((this load-state)) (dotimes (v1-0 256) (if (-> this object-name v1-0) (set! (-> this object-name v1-0) #f) @@ -278,7 +278,7 @@ ) ;; WARN: Function (method 17 load-state) has a return type of none, but the expression builder found a return statement. -(defmethod execute-commands-up-to load-state ((this load-state) (arg0 float)) +(defmethod execute-commands-up-to ((this load-state) (arg0 float)) (with-pp (let ((s4-0 (new 'stack 'script-context (process->ppointer pp) pp (the-as vector #f)))) (set! (-> s4-0 load-state) this) diff --git a/goal_src/jak2/engine/load/loader-h.gc b/goal_src/jak2/engine/load/loader-h.gc index 8aca1939e37..4b9b807f773 100644 --- a/goal_src/jak2/engine/load/loader-h.gc +++ b/goal_src/jak2/engine/load/loader-h.gc @@ -22,29 +22,23 @@ ;; load-dir is an array of references to loaded things. ;; it's used to handle art groups that are loaded as part of a level load. (deftype load-dir (basic) - ((lev level :offset-assert 4) - (string-array (array string) :offset-assert 8) - (data-array (array basic) :offset-assert 12) + ((lev level) + (string-array (array string)) + (data-array (array basic)) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (new (symbol type int level) _type_ 0) - (load-to-heap-by-name (_type_ string symbol kheap int) art-group 9) - (set-loaded-art (_type_ art-group) art-group 10) + (new (symbol type int level) _type_) + (load-to-heap-by-name (_type_ string symbol kheap int) art-group) + (set-loaded-art (_type_ art-group) art-group) ) ) ;; specialization of load-dir for art-groups specificially. (deftype load-dir-art-group (load-dir) - ((art-group-array (array art-group) :offset 12) + ((art-group-array (array art-group) :overlay-at data-array) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (new (symbol type int level) _type_ 0) + (new (symbol type int level) _type_) ) ) @@ -72,39 +66,36 @@ ;; an external-art-buffer is a buffer that streamed files use. (deftype external-art-buffer (basic) - ((index int32 :offset-assert 4) - (other external-art-buffer :offset-assert 8) - (status symbol :offset-assert 12) - (locked? symbol :offset-assert 16) - (login? symbol :offset-assert 20) - (frame-lock symbol :offset-assert 24) - (init-heap (function external-art-buffer object) :offset-assert 28) - (heap kheap :inline :offset-assert 32) - (pending-load-file string :offset-assert 48) - (pending-load-file-part int32 :offset-assert 52) - (pending-load-file-owner handle :offset-assert 56) - (pending-load-file-priority float :offset-assert 64) - (load-file string :offset-assert 68) - (load-file-part int32 :offset-assert 72) - (load-file-owner handle :offset-assert 80) - (load-file-priority float :offset-assert 88) - (buf pointer :offset-assert 92) - (len int32 :offset-assert 96) - (art-group art-group :offset-assert 100) - (art-data uint32 :offset 100) + ((index int32) + (other external-art-buffer) + (status symbol) + (locked? symbol) + (login? symbol) + (frame-lock symbol) + (init-heap (function external-art-buffer object)) + (heap kheap :inline) + (pending-load-file string) + (pending-load-file-part int32) + (pending-load-file-owner handle) + (pending-load-file-priority float) + (load-file string) + (load-file-part int32) + (load-file-owner handle) + (load-file-priority float) + (buf pointer) + (len int32) + (art-group art-group) + (art-data uint32 :overlay-at art-group) ) - :method-count-assert 16 - :size-assert #x68 - :flag-assert #x1000000068 (:methods - (new (symbol type int function symbol) _type_ 0) - (set-pending-file (_type_ string int handle float) int 9) - (update (_type_) int 10) - (inactive? (_type_) symbol 11) - (file-status (_type_ string int) symbol 12) - (link-file (_type_ art-group) art-group 13) - (unlink-file (_type_ art-group) int 14) - (unlock! (_type_) int 15) + (new (symbol type int function symbol) _type_) + (set-pending-file (_type_ string int handle float) int) + (update (_type_) int) + (inactive? (_type_) symbol) + (file-status (_type_ string int) symbol) + (link-file (_type_ art-group) art-group) + (unlink-file (_type_ art-group) int) + (unlock! (_type_) int) ) ) @@ -133,45 +124,39 @@ ;; a spool-anim is metadata for an animation that will be loaded in chunks to a pair of external-art-buffers (deftype spool-anim (basic) - ((name string :offset 16) - (anim-name basic :offset-assert 20) - (buffer external-art-buffer :offset 20) - (parts int32 :offset-assert 24) - (hint-id int32 :offset 24) - (priority float :offset-assert 28) - (owner handle :offset-assert 32) - (command-list pair :offset-assert 40) + ((name string :offset 16) + (anim-name basic) + (buffer external-art-buffer :overlay-at anim-name) + (parts int32) + (hint-id int32 :overlay-at parts) + (priority float) + (owner handle) + (command-list pair) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; the external-art-control manages loading chunks from spool-anims to external-art-buffer. (deftype external-art-control (basic) - ((buffer external-art-buffer 2 :offset-assert 4) - (rec spool-anim 3 :inline :offset-assert 16) - (spool-lock handle :offset-assert 160) - (reserve-buffer external-art-buffer :offset-assert 168) - (reserve-buffer-count int16 :offset-assert 172) - (dma-reserve-buffer-count int16 :offset-assert 174) - (active-stream string :offset-assert 176) - (queue-stream (array spool-anim) :offset-assert 180) - (frame-mask uint32 :offset-assert 184) - (dma-reserve-heap kheap :inline :offset-assert 192) + ((buffer external-art-buffer 2) + (rec spool-anim 3 :inline) + (spool-lock handle) + (reserve-buffer external-art-buffer) + (reserve-buffer-count int16) + (dma-reserve-buffer-count int16) + (active-stream string) + (queue-stream (array spool-anim)) + (frame-mask uint32) + (dma-reserve-heap kheap :inline) ) - :method-count-assert 16 - :size-assert #xd0 - :flag-assert #x10000000d0 (:methods - (new (symbol type) _type_ 0) - (update (_type_ symbol) int 9) - (clear-rec (_type_) int 10) - (spool-push (_type_ string int process float) int 11) - (file-status (_type_ string int) symbol 12) - (reserve-alloc (_type_) kheap 13) - (reserve-free (_type_ kheap) int 14) - (none-reserved? (_type_) symbol 15) + (new (symbol type) _type_) + (update (_type_ symbol) int) + (clear-rec (_type_) int) + (spool-push (_type_ string int process float) int) + (file-status (_type_ string int) symbol) + (reserve-alloc (_type_) kheap) + (reserve-free (_type_ kheap) int) + (none-reserved? (_type_) symbol) ) ) @@ -203,25 +188,19 @@ ) (deftype subtitle-range (basic) - ((start-frame float :offset-assert 4) - (end-frame float :offset-assert 8) - (message basic 8 :offset-assert 12) + ((start-frame float) + (end-frame float) + (message basic 8) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) (deftype subtitle-image (basic) - ((width uint16 :offset-assert 4) - (height uint16 :offset-assert 6) - (palette rgba 16 :offset 16) - (data uint8 :dynamic :offset-assert 80) + ((width uint16) + (height uint16) + (palette rgba 16 :offset 16) + (data uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) diff --git a/goal_src/jak2/engine/load/loader.gc b/goal_src/jak2/engine/load/loader.gc index 5685d3da1c2..e28b79a03ce 100644 --- a/goal_src/jak2/engine/load/loader.gc +++ b/goal_src/jak2/engine/load/loader.gc @@ -9,7 +9,7 @@ ;; DECOMP BEGINS -(defmethod mem-usage subtitle-range ((this subtitle-range) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this subtitle-range) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 73 (-> arg0 length))) (set! (-> arg0 data 72 name) "subtitle") (+! (-> arg0 data 72 count) 1) @@ -22,7 +22,7 @@ ;; WARN: Return type mismatch symbol vs load-dir. -(defmethod mem-usage load-dir ((this load-dir) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this load-dir) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 85 (-> arg0 length))) (set! (-> arg0 data 84 name) "array") (+! (-> arg0 data 84 count) 1) @@ -50,7 +50,7 @@ (the-as load-dir #f) ) -(defmethod load-to-heap-by-name load-dir-art-group ((this load-dir-art-group) (arg0 string) (arg1 symbol) (arg2 kheap) (arg3 int)) +(defmethod load-to-heap-by-name ((this load-dir-art-group) (arg0 string) (arg1 symbol) (arg2 kheap) (arg3 int)) (let ((s5-0 (-> this string-array))) (dotimes (s3-0 (-> s5-0 length)) (when (string= arg0 (-> s5-0 s3-0)) @@ -76,7 +76,7 @@ ) ) -(defmethod set-loaded-art load-dir-art-group ((this load-dir-art-group) (arg0 art-group)) +(defmethod set-loaded-art ((this load-dir-art-group) (arg0 art-group)) (let ((s4-0 (-> this string-array))) (dotimes (s3-0 (-> s4-0 length)) (when (string= (-> arg0 name) (-> s4-0 s3-0)) @@ -156,7 +156,7 @@ ) ) -(defmethod print external-art-buffer ((this external-art-buffer)) +(defmethod print ((this external-art-buffer)) (format #t "#<~A ~S ~D ~A @ #x~X>" @@ -179,7 +179,7 @@ 0 ) -(defmethod set-pending-file external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) +(defmethod set-pending-file ((this external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) (set! (-> this pending-load-file) arg0) (set! (-> this pending-load-file-part) arg1) (set! (-> this pending-load-file-owner) arg2) @@ -187,16 +187,16 @@ 0 ) -(defmethod unlock! external-art-buffer ((this external-art-buffer)) +(defmethod unlock! ((this external-art-buffer)) (set! (-> this locked?) #f) 0 ) -(defmethod inactive? external-art-buffer ((this external-art-buffer)) +(defmethod inactive? ((this external-art-buffer)) (!= (-> this status) 'active) ) -(defmethod file-status external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int)) +(defmethod file-status ((this external-art-buffer) (arg0 string) (arg1 int)) (when (and (name= (-> this pending-load-file) arg0) (= (-> this pending-load-file-part) arg1)) (if (and (name= (-> this load-file) arg0) (= (-> this load-file-part) arg1)) (-> this status) @@ -205,7 +205,7 @@ ) ) -(defmethod link-art! art-group ((this art-group)) +(defmethod link-art! ((this art-group)) (when this (countdown (s5-0 (-> this length)) (let* ((s3-0 (-> this data s5-0)) @@ -257,7 +257,7 @@ this ) -(defmethod unlink-art! art-group ((this art-group)) +(defmethod unlink-art! ((this art-group)) (when this (countdown (s5-0 (-> this length)) (let* ((s3-0 (-> this data s5-0)) @@ -294,7 +294,7 @@ 0 ) -(defmethod link-file external-art-buffer ((this external-art-buffer) (arg0 art-group)) +(defmethod link-file ((this external-art-buffer) (arg0 art-group)) (when arg0 (link-art! arg0) (set! (-> this art-group) arg0) @@ -302,7 +302,7 @@ arg0 ) -(defmethod unlink-file external-art-buffer ((this external-art-buffer) (arg0 art-group)) +(defmethod unlink-file ((this external-art-buffer) (arg0 art-group)) (when arg0 (unlink-art! arg0) (set! (-> this art-group) #f) @@ -311,7 +311,7 @@ ) ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. -(defmethod update external-art-buffer ((this external-art-buffer)) +(defmethod update ((this external-art-buffer)) (when (or (not (name= (-> this pending-load-file) (-> this load-file))) (!= (-> this pending-load-file-part) (-> this load-file-part)) ) @@ -493,7 +493,7 @@ (define *preload-spool-anims* #t) -(defmethod file-status external-art-control ((this external-art-control) (arg0 string) (arg1 int)) +(defmethod file-status ((this external-art-control) (arg0 string) (arg1 int)) (dotimes (s3-0 2) (let ((v1-3 (file-status (-> this buffer s3-0) arg0 arg1))) (if v1-3 @@ -504,7 +504,7 @@ #f ) -(defmethod update external-art-control ((this external-art-control) (arg0 symbol)) +(defmethod update ((this external-art-control) (arg0 symbol)) (if (nonzero? (-> this reserve-buffer-count)) (spool-push this "reserved" 0 *dproc* (if (-> this reserve-buffer) -110.0 @@ -626,11 +626,11 @@ 0 ) -(defmethod none-reserved? external-art-control ((this external-art-control)) +(defmethod none-reserved? ((this external-art-control)) (zero? (-> this reserve-buffer-count)) ) -(defmethod reserve-alloc external-art-control ((this external-art-control)) +(defmethod reserve-alloc ((this external-art-control)) (cond ((or (nonzero? (-> this dma-reserve-buffer-count)) (= *master-mode* 'progress)) (set! (-> this dma-reserve-buffer-count) 1) @@ -654,7 +654,7 @@ ) ) -(defmethod reserve-free external-art-control ((this external-art-control) (arg0 kheap)) +(defmethod reserve-free ((this external-art-control) (arg0 kheap)) (cond ((nonzero? (-> this dma-reserve-buffer-count)) (set! (-> this dma-reserve-buffer-count) 0) @@ -682,7 +682,7 @@ 0 ) -(defmethod clear-rec external-art-control ((this external-art-control)) +(defmethod clear-rec ((this external-art-control)) (dotimes (v1-0 3) (set! (-> this rec v1-0 type) spool-anim) (set! (-> this rec v1-0 name) #f) @@ -693,7 +693,7 @@ 0 ) -(defmethod spool-push external-art-control ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) +(defmethod spool-push ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) (when (and (= arg3 -99.0) arg2) (let ((a0-2 (target-pos 0))) (set! arg3 (vector-vector-distance a0-2 (-> (the-as process-drawable arg2) root trans))) @@ -752,26 +752,23 @@ ) (deftype spooler-block (basic) - ((anim spool-anim :offset-assert 4) - (idle art-joint-anim :offset-assert 8) - (exit art-joint-anim :offset-assert 12) - (break-func (function process-drawable object) :offset-assert 16) - (part int32 :offset-assert 20) - (part-audio-start float :offset-assert 24) - (old-status uint16 :offset-assert 28) - (old-pos int32 :offset-assert 32) - (good-time time-frame :offset-assert 40) - (old-time time-frame :offset-assert 48) - (good-count int32 :offset-assert 56) - (sid sound-id :offset-assert 60) - (real-start-time time-frame :offset-assert 64) - (paused? symbol :offset-assert 72) + ((anim spool-anim) + (idle art-joint-anim) + (exit art-joint-anim) + (break-func (function process-drawable object)) + (part int32) + (part-audio-start float) + (old-status uint16) + (old-pos int32) + (good-time time-frame) + (old-time time-frame) + (good-count int32) + (sid sound-id) + (real-start-time time-frame) + (paused? symbol) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c (:methods - (new (symbol type art-joint-anim (function process-drawable symbol)) _type_ 0) + (new (symbol type art-joint-anim (function process-drawable symbol)) _type_) ) ) @@ -1139,7 +1136,7 @@ ) -(defmethod print gui-connection ((this gui-connection)) +(defmethod print ((this gui-connection)) (format #t "# this name) (-> this anim-part) (-> this id) @@ -1150,12 +1147,12 @@ this ) -(defmethod channel-id-set! gui-control ((this gui-control) (arg0 gui-connection) (arg1 sound-id)) +(defmethod channel-id-set! ((this gui-control) (arg0 gui-connection) (arg1 sound-id)) (set! (-> this ids (-> arg0 channel)) arg1) 0 ) -(defmethod lookup-gui-connection gui-control ((this gui-control) (arg0 process) (arg1 gui-channel) (arg2 string) (arg3 sound-id)) +(defmethod lookup-gui-connection ((this gui-control) (arg0 process) (arg1 gui-channel) (arg2 string) (arg3 sound-id)) (let ((s1-0 (the-as gui-connection (-> this engine alive-list next0)))) (-> this engine) (let ((s0-0 (-> s1-0 next0))) @@ -1190,7 +1187,7 @@ ) ;; WARN: Return type mismatch int vs sound-id. -(defmethod lookup-gui-connection-id gui-control ((this gui-control) (arg0 string) (arg1 gui-channel) (arg2 gui-action)) +(defmethod lookup-gui-connection-id ((this gui-control) (arg0 string) (arg1 gui-channel) (arg2 gui-action)) (let ((s2-0 (the-as gui-connection (-> this engine alive-list next0)))) (-> this engine) (let ((s1-0 (-> s2-0 next0))) @@ -1221,7 +1218,7 @@ (the-as sound-id 0) ) -(defmethod set-falloff! gui-control ((this gui-control) (arg0 sound-id) (arg1 symbol) (arg2 int) (arg3 int) (arg4 int)) +(defmethod set-falloff! ((this gui-control) (arg0 sound-id) (arg1 symbol) (arg2 int) (arg3 int) (arg4 int)) (when (nonzero? arg0) (let ((v1-2 (lookup-gui-connection *gui-control* (the-as process #f) (gui-channel none) (the-as string #f) arg0))) (when v1-2 @@ -1248,7 +1245,7 @@ ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 34. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod gui-control-method-18 gui-control ((this gui-control) (arg0 gui-channel)) +(defmethod gui-control-method-18 ((this gui-control) (arg0 gui-channel)) (let ((v1-0 arg0)) (the-as symbol @@ -1269,7 +1266,7 @@ ) ) -(defmethod handle-command gui-control ((this gui-control) (arg0 gui-channel) (arg1 gui-channel) (arg2 symbol) (arg3 gui-connection)) +(defmethod handle-command ((this gui-control) (arg0 gui-channel) (arg1 gui-channel) (arg2 symbol) (arg3 gui-connection)) (let ((s5-0 (-> this ids arg1))) (cond ((nonzero? s5-0) @@ -1339,7 +1336,7 @@ #t ) -(defmethod handle-command-list gui-control ((this gui-control) (arg0 gui-channel) (arg1 gui-connection)) +(defmethod handle-command-list ((this gui-control) (arg0 gui-channel) (arg1 gui-connection)) (local-vars (sv-16 int) (sv-32 int) (sv-48 int)) (let ((gp-0 #t)) (cond @@ -1406,7 +1403,7 @@ ) ;; WARN: Return type mismatch int vs gui-status. -(defmethod get-status gui-control ((this gui-control) (arg0 sound-id)) +(defmethod get-status ((this gui-control) (arg0 sound-id)) (let ((gp-0 (the-as gui-connection #f))) (if (zero? arg0) (return (gui-status unknown)) @@ -1539,15 +1536,15 @@ ) ) -(defmethod set-action! gui-control ((this gui-control) - (arg0 gui-action) - (arg1 sound-id) - (arg2 gui-channel) - (arg3 gui-action) - (arg4 string) - (arg5 (function gui-connection symbol)) - (arg6 process) - ) +(defmethod set-action! ((this gui-control) + (arg0 gui-action) + (arg1 sound-id) + (arg2 gui-channel) + (arg3 gui-action) + (arg4 string) + (arg5 (function gui-connection symbol)) + (arg6 process) + ) (local-vars (sv-16 gui-action) (sv-17 gui-action) (sv-20 string) (sv-24 (function gui-connection symbol))) (set! sv-16 arg0) (set! sv-17 arg3) @@ -1589,14 +1586,14 @@ ) ;; WARN: Return type mismatch int vs sound-id. -(defmethod add-process gui-control ((this gui-control) - (arg0 process) - (arg1 gui-channel) - (arg2 gui-action) - (arg3 string) - (arg4 float) - (arg5 time-frame) - ) +(defmethod add-process ((this gui-control) + (arg0 process) + (arg1 gui-channel) + (arg2 gui-action) + (arg3 string) + (arg4 float) + (arg5 time-frame) + ) (local-vars (sv-16 int) (sv-20 gui-connection) @@ -1661,7 +1658,7 @@ ) ) -(defmethod remove-process gui-control ((this gui-control) (arg0 process) (arg1 gui-channel)) +(defmethod remove-process ((this gui-control) (arg0 process) (arg1 gui-channel)) (let ((s3-0 (the-as gui-connection (-> this engine alive-list next0)))) (-> this engine) (let ((s2-0 (-> s3-0 next0))) @@ -1680,15 +1677,15 @@ ) ;; WARN: Return type mismatch int vs sound-id. -(defmethod gui-control-method-12 gui-control ((this gui-control) - (arg0 process) - (arg1 gui-channel) - (arg2 gui-action) - (arg3 string) - (arg4 int) - (arg5 float) - (arg6 sound-id) - ) +(defmethod gui-control-method-12 ((this gui-control) + (arg0 process) + (arg1 gui-channel) + (arg2 gui-action) + (arg3 string) + (arg4 int) + (arg5 float) + (arg6 sound-id) + ) (local-vars (sv-16 gui-connection) (sv-20 int) @@ -1780,7 +1777,7 @@ ) ) -(defmethod gui-control-method-21 gui-control ((this gui-control) (arg0 gui-connection) (arg1 vector)) +(defmethod gui-control-method-21 ((this gui-control) (arg0 gui-connection) (arg1 vector)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) (let ((s5-0 (-> this spool-connections))) @@ -1851,7 +1848,7 @@ 0 ) -(defmethod stop-str gui-control ((this gui-control) (arg0 gui-connection)) +(defmethod stop-str ((this gui-control) (arg0 gui-connection)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) (if (= (get-status this (-> arg0 id)) (gui-status active)) @@ -1869,7 +1866,7 @@ (#when PC_PORT (define *gui-kick-str* #f)) -(defmethod gui-control-method-22 gui-control ((this gui-control) (arg0 gui-connection) (arg1 process) (arg2 symbol)) +(defmethod gui-control-method-22 ((this gui-control) (arg0 gui-connection) (arg1 process) (arg2 symbol)) (local-vars (v1-66 symbol) (v1-143 symbol)) (with-pp (when (and (>= (the-as uint (-> arg0 channel)) (the-as uint 16)) @@ -2088,7 +2085,7 @@ ) ) -(defmethod update gui-control ((this gui-control) (arg0 symbol)) +(defmethod update ((this gui-control) (arg0 symbol)) (set! (-> this ids 65) (the-as sound-id (if (and (>= (-> *display* base-clock frame-counter) (-> *game-info* blackout-time)) (= (-> *setting-control* user-current bg-a) 0.0) diff --git a/goal_src/jak2/engine/load/ramdisk.gc b/goal_src/jak2/engine/load/ramdisk.gc index 90e5372f590..429bd1e24f1 100644 --- a/goal_src/jak2/engine/load/ramdisk.gc +++ b/goal_src/jak2/engine/load/ramdisk.gc @@ -8,39 +8,30 @@ ;; DECOMP BEGINS (deftype ramdisk-rpc-fill (structure) - ((rsvd1 int32 :offset-assert 0) - (ee-id int32 :offset-assert 4) - (rsvd2 int32 2 :offset-assert 8) - (filename uint128 :offset-assert 16) + ((rsvd1 int32) + (ee-id int32) + (rsvd2 int32 2) + (filename uint128) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype ramdisk-rpc-load (structure) - ((rsvd int32 :offset-assert 0) - (ee-id int32 :offset-assert 4) - (offset uint32 :offset-assert 8) - (length uint32 :offset-assert 12) + ((rsvd int32) + (ee-id int32) + (offset uint32) + (length uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype ramdisk-rpc-load-to-ee (structure) - ((rsvd int32 :offset-assert 0) - (addr int32 :offset-assert 4) - (offset int32 :offset-assert 8) - (length int32 :offset-assert 12) - (filename uint128 :offset-assert 16) + ((rsvd int32) + (addr int32) + (offset int32) + (length int32) + (filename uint128) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) diff --git a/goal_src/jak2/engine/math/euler-h.gc b/goal_src/jak2/engine/math/euler-h.gc index d569e1239e8..50128e2e7e9 100644 --- a/goal_src/jak2/engine/math/euler-h.gc +++ b/goal_src/jak2/engine/math/euler-h.gc @@ -10,6 +10,7 @@ ;; maybe euler angle storage orders? ;; what is this naming convention? (define EulSafe (new 'static 'boxed-array :type int32 0 1 2 0)) + (define EulNext (new 'static 'boxed-array :type int32 1 2 0 1)) ;; just uses the same xyzw and data array as vector. @@ -18,7 +19,4 @@ ;; Euler angles are mostly unused, and the code is a bit of disaster. (deftype euler-angles (vector) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) diff --git a/goal_src/jak2/engine/math/math.gc b/goal_src/jak2/engine/math/math.gc index f6e9dfcf3b2..1b1a3c89d5e 100644 --- a/goal_src/jak2/engine/math/math.gc +++ b/goal_src/jak2/engine/math/math.gc @@ -172,9 +172,6 @@ (deftype float-type (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (define exp-slead (new 'static 'array float 32 @@ -422,9 +419,6 @@ (b uint8 :offset 16 :size 8) (a uint8 :offset 24 :size 8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (defmacro static-rgba (r g b a) @@ -440,16 +434,10 @@ (deftype xyzw (uint128) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype xyzwh (uint128) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (defun print-time ((arg0 object) (arg1 time-frame)) @@ -768,11 +756,8 @@ ) (deftype random-generator (basic) - ((seed uint32 :offset-assert 4) + ((seed uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) diff --git a/goal_src/jak2/engine/math/matrix-h.gc b/goal_src/jak2/engine/math/matrix-h.gc index 3eb3c48b938..ff126f2584f 100644 --- a/goal_src/jak2/engine/math/matrix-h.gc +++ b/goal_src/jak2/engine/math/matrix-h.gc @@ -11,16 +11,13 @@ ;; some, but not all, functions assume that a matrix is an affine transform. ;; others assume that the rotation has no scale or shear (and that its inverse is its transpose) (deftype matrix (structure) - ((data float 16 :offset-assert 0) - (vector vector 4 :inline :offset 0) - (quad uint128 4 :offset 0) - (trans vector :inline :offset 48) + ((data float 16) + (vector vector 4 :inline :overlay-at (-> data 0)) + (quad uint128 4 :overlay-at (-> data 0)) + (trans vector :inline :overlay-at (-> data 12)) ) - :method-count-assert 10 - :size-assert #x40 - :flag-assert #xa00000040 (:methods - (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none 9) + (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none) ) ) @@ -29,13 +26,10 @@ ;; so this is really a 3x4 matrix. ;; this type is rarely used (deftype matrix3 (structure) - ((data float 12 :offset-assert 0) - (vector vector 3 :inline :offset 0) - (quad uint128 3 :offset 0) + ((data float 12) + (vector vector 3 :inline :overlay-at (-> data 0)) + (quad uint128 3 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; a matrix stored using 16-bit integers. @@ -44,26 +38,24 @@ ;; so you generally should not unpack these to floats without knowing where they came from ;; and how they were originally packed (for example, in tie/shrub) (deftype matrix4h (structure) - ((data int16 16 :offset-assert 0) - (vector4h vector4h 4 :inline :offset 0) - (long int64 4 :offset 0) + ((data int16 16) + (vector4h vector4h 4 :inline :overlay-at (-> data 0)) + (long int64 4 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) + (defun matrix-copy! ((arg0 matrix) (arg1 matrix)) "Copy arg1 to arg0" - (let ((v1-0 (-> arg1 vector 0 quad)) - (a2-0 (-> arg1 vector 1 quad)) - (a3-0 (-> arg1 vector 2 quad)) - (a1-1 (-> arg1 vector 3 quad)) + (let ((v1-0 (-> arg1 quad 0)) + (a2-0 (-> arg1 quad 1)) + (a3-0 (-> arg1 quad 2)) + (a1-1 (-> arg1 trans quad)) ) - (set! (-> arg0 vector 0 quad) v1-0) - (set! (-> arg0 vector 1 quad) a2-0) - (set! (-> arg0 vector 2 quad) a3-0) - (set! (-> arg0 vector 3 quad) a1-1) + (set! (-> arg0 quad 0) v1-0) + (set! (-> arg0 quad 1) a2-0) + (set! (-> arg0 quad 2) a3-0) + (set! (-> arg0 trans quad) a1-1) ) arg0 ) diff --git a/goal_src/jak2/engine/math/matrix.gc b/goal_src/jak2/engine/math/matrix.gc index 1095544dba9..07e54d4e758 100644 --- a/goal_src/jak2/engine/math/matrix.gc +++ b/goal_src/jak2/engine/math/matrix.gc @@ -36,7 +36,7 @@ allowed to be the same memory. ;; DECOMP BEGINS -(defmethod inspect matrix ((this matrix)) +(defmethod inspect ((this matrix)) (format #t "[~8x] matrix~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this data 0) (-> this data 1) (-> this data 2) (-> this data 3)) (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this data 4) (-> this data 5) (-> this data 6) (-> this data 7)) @@ -45,7 +45,7 @@ allowed to be the same memory. this ) -(defmethod inspect matrix3 ((this matrix3)) +(defmethod inspect ((this matrix3)) "Print out the values in a 3x3 matrix." (format #t "[~8x] matrix3~%" this) (format #t "~T[~F] [~F] [~F]~%" (-> this data 0) (-> this data 1) (-> this data 2)) diff --git a/goal_src/jak2/engine/math/quaternion-h.gc b/goal_src/jak2/engine/math/quaternion-h.gc index 2512b827641..82a80e5d668 100644 --- a/goal_src/jak2/engine/math/quaternion-h.gc +++ b/goal_src/jak2/engine/math/quaternion-h.gc @@ -9,17 +9,14 @@ ;; quaternion, stored in xyzw order. (deftype quaternion (structure) - ((data float 4 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (w float :offset 12) - (vec vector :inline :offset 0) - (quad uint128 :offset 0) + ((data float 4) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) + (z float :overlay-at (-> data 2)) + (w float :overlay-at (-> data 3)) + (vec vector :inline :overlay-at (-> data 0)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (define *unity-quaternion* (new 'static 'quaternion :w 1.0)) diff --git a/goal_src/jak2/engine/math/quaternion.gc b/goal_src/jak2/engine/math/quaternion.gc index a8ed57f1eaa..224ebab164f 100644 --- a/goal_src/jak2/engine/math/quaternion.gc +++ b/goal_src/jak2/engine/math/quaternion.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod inspect quaternion ((this quaternion)) +(defmethod inspect ((this quaternion)) "Print a quaternion. Prints the values and axis-angle" (format #t "[~8x] quaternion~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w)) diff --git a/goal_src/jak2/engine/math/transform-h.gc b/goal_src/jak2/engine/math/transform-h.gc index 3e712413a2d..6e5a177cdb4 100644 --- a/goal_src/jak2/engine/math/transform-h.gc +++ b/goal_src/jak2/engine/math/transform-h.gc @@ -11,30 +11,21 @@ ;; This can represent any rotation, translation, and scaling. ;; Note that the scaling is applied before rotation (meaning it scales along the axes of the pre-transformed frame). (deftype transform (structure) - ((trans vector :inline :offset-assert 0) - (rot vector :inline :offset-assert 16) - (scale vector :inline :offset-assert 32) + ((trans vector :inline) + (rot vector :inline) + (scale vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; Like transform, but it's a basic. ;; note that the trsq child type overrides this rotation with a quaternion. ;; usage of the plain trs is very limited, at least in jak 1. (deftype trs (basic) - ((trans vector :inline :offset-assert 16) - (rot vector :inline :offset-assert 32) - (scale vector :inline :offset-assert 48) + ((trans vector :inline) + (rot vector :inline) + (scale vector :inline) ) (:methods - (new (symbol type) _type_ 0) - ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 + (new (symbol type) _type_) + ) ) - - - diff --git a/goal_src/jak2/engine/math/transform.gc b/goal_src/jak2/engine/math/transform.gc index 55ce6103f32..440ef19caa1 100644 --- a/goal_src/jak2/engine/math/transform.gc +++ b/goal_src/jak2/engine/math/transform.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod print transform ((this transform)) +(defmethod print ((this transform)) "Print a transform." (format #t "# this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) @@ -77,4 +77,3 @@ ;; this relies on the fact that trs and transform both have the same memory layout. (transform-matrix-calc! (the-as transform (-> arg0 trans)) arg1) ) - diff --git a/goal_src/jak2/engine/math/transformq-h.gc b/goal_src/jak2/engine/math/transformq-h.gc index f3ff19e7805..7ad387b4806 100644 --- a/goal_src/jak2/engine/math/transformq-h.gc +++ b/goal_src/jak2/engine/math/transformq-h.gc @@ -11,19 +11,14 @@ ;; DECOMP BEGINS (deftype transformq (transform) - ((quat quaternion :inline :offset 16) + ((quat quaternion :inline :overlay-at (-> rot data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) + (deftype trsq (trs) - ((quat quaternion :inline :offset 32) + ((quat quaternion :inline :overlay-at (-> rot data 0)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; a transform with: @@ -36,55 +31,50 @@ ;; collision objects (collide-shape, collide-shape-moving) ;; As a result, this type has a lot of weird methods and extra stuff hidden in it. (deftype trsqv (trsq) - (;; some extra info for game objects, hidden in the unused space. - (pause-adjust-distance meters :offset 4) - (nav-radius meters :offset 8) - + ;; some extra info for game objects, hidden in the unused space. + ((pause-adjust-distance meters :offset 4) + (nav-radius meters :offset 8) ;; velocities - (transv vector :inline :offset-assert 64) - (rotv vector :inline :offset-assert 80) - (scalev vector :inline :offset-assert 96) - + (transv vector :inline) + (rotv vector :inline) + (scalev vector :inline) ;; trsqv also supports the ability to adjust its orientation ;; to face a target. This has some logic to prevent chattering ;; that requires some additional state here: - (dir-targ quaternion :inline :offset-assert 112) - (angle-change-time time-frame :offset-assert 128) - (old-y-angle-diff float :offset-assert 136) + (dir-targ quaternion :inline) + (angle-change-time time-frame) + (old-y-angle-diff float) ) - :method-count-assert 28 - :size-assert #x8c - :flag-assert #x1c0000008c (:methods - (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion 9) - (set-heading-vec! (_type_ vector) quaternion 10) - (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion 11) - (point-toward-point! (_type_ vector) quaternion 12) - (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion 13) - (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion 14) - (set-roll-to-grav! (_type_ float) quaternion 15) - (set-roll-to-grav-2! (_type_ float) quaternion 16) - (rotate-toward-orientation! (_type_ quaternion float float int int float) quaternion 17) - (set-quaternion! (_type_ quaternion) quaternion 18) - (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion 19) - (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion 20) - (rot->dir-targ! (_type_) quaternion 21) - (y-angle (_type_) float 22) - (global-y-angle-to-point (_type_ vector) float 23) - (relative-y-angle-to-point (_type_ vector) float 24) - (roll-relative-to-gravity (_type_) float 25) - (set-and-limit-velocity (_type_ int vector float) trsqv :behavior process 26) - (get-quaternion (_type_) quaternion 27) + (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion) + (set-heading-vec! (_type_ vector) quaternion) + (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion) + (point-toward-point! (_type_ vector) quaternion) + (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion) + (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion) + (set-roll-to-grav! (_type_ float) quaternion) + (set-roll-to-grav-2! (_type_ float) quaternion) + (rotate-toward-orientation! (_type_ quaternion float float int int float) quaternion) + (set-quaternion! (_type_ quaternion) quaternion) + (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion) + (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion) + (rot->dir-targ! (_type_) quaternion) + (y-angle (_type_) float) + (global-y-angle-to-point (_type_ vector) float) + (relative-y-angle-to-point (_type_ vector) float) + (roll-relative-to-gravity (_type_) float) + (set-and-limit-velocity (_type_ int vector float) trsqv :behavior process) + (get-quaternion (_type_) quaternion) ) ) -(defmethod global-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) +(defmethod global-y-angle-to-point ((this trsqv) (arg0 vector)) "Get the angle in the xz plane from the position of this trsqv to the point arg0. (ignores our current yaw)" (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans))) ) -(defmethod relative-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) +(defmethod relative-y-angle-to-point ((this trsqv) (arg0 vector)) "Get the y angle between the current orientation and arg0. (how much we'd have to yaw to point at arg0)" (deg-diff (y-angle this) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)))) ) diff --git a/goal_src/jak2/engine/math/transformq.gc b/goal_src/jak2/engine/math/transformq.gc index 4f59a56ae2a..34adaf6ccaa 100644 --- a/goal_src/jak2/engine/math/transformq.gc +++ b/goal_src/jak2/engine/math/transformq.gc @@ -7,8 +7,7 @@ ;; DECOMP BEGINS -(defmethod print transformq ((this transformq)) - "Print a transformq" +(defmethod print ((this transformq)) (format #t "# this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) (format #t "~T~Tquat: ~F ~F ~F ~F ~%" (-> this quat x) (-> this quat y) (-> this quat z) (-> this quat w)) @@ -16,27 +15,23 @@ this ) -(defmethod get-quaternion trsqv ((this trsqv)) - "Get the rotation as a quaternion." +(defmethod get-quaternion ((this trsqv)) (-> this quat) ) -(defmethod set-quaternion! trsqv ((this trsqv) (arg0 quaternion)) - "Set the rotation as a quaternion" +(defmethod set-quaternion! ((this trsqv) (arg0 quaternion)) (quaternion-copy! (get-quaternion this) arg0) ) -(defmethod rot->dir-targ! trsqv ((this trsqv)) - "Set the dir-targ to our current orientation" +(defmethod rot->dir-targ! ((this trsqv)) (quaternion-copy! (-> this dir-targ) (get-quaternion this)) ) -(defmethod y-angle trsqv ((this trsqv)) - "Get our current y-angle (y is up, so yaw)" +(defmethod y-angle ((this trsqv)) (quaternion-y-angle (get-quaternion this)) ) -(defmethod seek-toward-heading-vec! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) +(defmethod seek-toward-heading-vec! ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) "Adjust the orientation to point along dir, only changing our yaw. The vel is a maximum velocity limit. The frame count is the time constant (first order). @@ -50,9 +45,9 @@ (cond ((or (= f0-2 0.0) (and (< 0.0 f30-0) (< 0.0 f0-2)) - (or (and (< f30-0 0.0) (< f0-2 0.0)) (>= (- (current-time) (-> this angle-change-time)) (seconds 0.2))) + (or (and (< f30-0 0.0) (< f0-2 0.0)) (time-elapsed? (-> this angle-change-time) (seconds 0.2))) ) - (set! (-> this angle-change-time) (current-time)) + (set-time! (-> this angle-change-time)) f30-0 ) (else @@ -68,7 +63,7 @@ ) ) -(defmethod set-heading-vec! trsqv ((this trsqv) (arg0 vector)) +(defmethod set-heading-vec! ((this trsqv) (arg0 vector)) "Makes us look in the arg0 direction immediately. Pitch will be unchanged." (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion @@ -79,12 +74,12 @@ ) ) -(defmethod seek-to-point-toward-point! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) +(defmethod seek-to-point-toward-point! ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) "Seek toward pointing toward arg0 from our current location." (seek-toward-heading-vec! this (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) arg1 arg2) ) -(defmethod point-toward-point! trsqv ((this trsqv) (arg0 vector)) +(defmethod point-toward-point! ((this trsqv) (arg0 vector)) "Immediately point toward arg0" (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion @@ -95,7 +90,7 @@ ) ) -(defmethod seek-toward-yaw-angle! trsqv ((this trsqv) (arg0 float) (arg1 float) (arg2 time-frame)) +(defmethod seek-toward-yaw-angle! ((this trsqv) (arg0 float) (arg1 float) (arg2 time-frame)) "Seek toward the given yaw angle." (let ((s3-0 (method-of-object this seek-toward-heading-vec!)) (s2-0 (new 'stack-no-clear 'vector)) @@ -108,7 +103,7 @@ ) ) -(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((this trsqv) (arg0 float)) +(defmethod set-yaw-angle-clear-roll-pitch! ((this trsqv) (arg0 float)) "Immediately clear our roll and pitch and set yaw to the given angle" (let ((s5-0 (method-of-object this set-heading-vec-clear-roll-pitch!)) (s4-0 (new 'stack-no-clear 'vector)) @@ -121,12 +116,12 @@ ) ) -(defmethod set-roll-to-grav! trsqv ((this trsqv) (arg0 float)) +(defmethod set-roll-to-grav! ((this trsqv) (arg0 float)) "Set our roll so that our local down aligns with standard gravity" (set-roll-to-grav-2! this arg0) ) -(defmethod set-roll-to-grav-2! trsqv ((this trsqv) (arg0 float)) +(defmethod set-roll-to-grav-2! ((this trsqv) (arg0 float)) "Set our roll so that our local down aligns with standard gravity" (let* ((s5-0 (get-quaternion this)) (s1-0 (-> *standard-dynamics* gravity-normal)) @@ -159,7 +154,7 @@ ) ) -(defmethod rotate-toward-orientation! trsqv ((this trsqv) (arg0 quaternion) (arg1 float) (arg2 float) (arg3 int) (arg4 int) (arg5 float)) +(defmethod rotate-toward-orientation! ((this trsqv) (arg0 quaternion) (arg1 float) (arg2 float) (arg3 int) (arg4 int) (arg5 float)) "Adjust our orientation toward target, subject to some rate limits. For jak 1, I said: I don't think this is a very robust function and probably doesn't work right in cases @@ -233,7 +228,7 @@ ) ) -(defmethod set-heading-vec-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) +(defmethod set-heading-vec-clear-roll-pitch! ((this trsqv) (arg0 vector)) "Set our rotation to point along the given heading, with no roll or pitch." (forward-up->quaternion (get-quaternion this) @@ -242,7 +237,7 @@ ) ) -(defmethod point-toward-point-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) +(defmethod point-toward-point-clear-roll-pitch! ((this trsqv) (arg0 vector)) "Set our orientation to point toward arg0, clearing roll and pitch" (forward-up->quaternion (get-quaternion this) diff --git a/goal_src/jak2/engine/math/vector-h.gc b/goal_src/jak2/engine/math/vector-h.gc index 8360e9ab986..175afdf4c14 100644 --- a/goal_src/jak2/engine/math/vector-h.gc +++ b/goal_src/jak2/engine/math/vector-h.gc @@ -14,20 +14,17 @@ Changes: ;; Array of booleans, stored as bits. (deftype bit-array (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (_pad uint8 :offset-assert 12) - (bytes uint8 :dynamic :offset 12) - ) - :method-count-assert 13 - :size-assert #xd - :flag-assert #xd0000000d + ((length int32) + (allocated-length int32) + (_pad uint8) + (bytes uint8 :dynamic :overlay-at _pad) + ) (:methods - (new (symbol type int) _type_ 0) - (get-bit (_type_ int) symbol 9) - (clear-bit (_type_ int) int 10) - (set-bit (_type_ int) int 11) - (clear-all! (_type_) _type_ 12) + (new (symbol type int) _type_) + (get-bit (_type_ int) symbol) + (clear-bit (_type_ int) int) + (set-bit (_type_ int) int) + (clear-all! (_type_) _type_) ) ) @@ -40,36 +37,36 @@ Changes: ) ) -(defmethod length bit-array ((obj bit-array)) +(defmethod length ((obj bit-array)) "Get the number of bits." (-> obj length) ) -(defmethod asize-of bit-array ((obj bit-array)) +(defmethod asize-of ((obj bit-array)) "Get the size in memory." (the-as int (+ (-> obj type size) (/ (logand -8 (+ (-> obj allocated-length) 7)) 8))) ) -(defmethod get-bit bit-array ((obj bit-array) (arg0 int)) +(defmethod get-bit ((obj bit-array) (arg0 int)) "Get the nth bit as a boolean." (let ((v1-2 (-> obj bytes (/ arg0 8)))) (logtest? v1-2 (ash 1 (logand arg0 7))) ) ) -(defmethod clear-bit bit-array ((obj bit-array) (arg0 int)) +(defmethod clear-bit ((obj bit-array) (arg0 int)) "Set the nth bit to 0." (logclear! (-> obj bytes (/ arg0 8)) (ash 1 (logand arg0 7))) 0 ) -(defmethod set-bit bit-array ((obj bit-array) (arg0 int)) +(defmethod set-bit ((obj bit-array) (arg0 int)) "Set the nth bit to 1." (logior! (-> obj bytes (/ arg0 8)) (ash 1 (logand arg0 7))) 0 ) -(defmethod clear-all! bit-array ((obj bit-array)) +(defmethod clear-all! ((obj bit-array)) "Set all bits to 0." (countdown (v1-2 (/ (logand -8 (+ (-> obj allocated-length) 7)) 8)) (nop!) @@ -95,194 +92,149 @@ Changes: ;; BYTE vectors (deftype vector16ub (structure) - ((data uint8 16 :offset-assert 0) - (quad uint128 :offset 0) + ((data uint8 16) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype vector4ub (structure) - ((data uint8 4 :offset-assert 0) - (x uint8 :offset 0) - (y uint8 :offset 1) - (z uint8 :offset 2) - (w uint8 :offset 3) - (clr uint32 :offset 0) + ((data uint8 4) + (x uint8 :overlay-at (-> data 0)) + (y uint8 :overlay-at (-> data 1)) + (z uint8 :overlay-at (-> data 2)) + (w uint8 :overlay-at (-> data 3)) + (clr uint32 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype vector4b (structure) - ((data int8 4 :offset-assert 0) - (x int8 :offset 0) - (y int8 :offset 1) - (z int8 :offset 2) - (w int8 :offset 3) - (clr int32 :offset 0) + ((data int8 4) + (x int8 :overlay-at (-> data 0)) + (y int8 :overlay-at (-> data 1)) + (z int8 :overlay-at (-> data 2)) + (w int8 :overlay-at (-> data 3)) + (clr int32 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype vector2ub (structure) - ((data uint8 2 :offset-assert 0) - (x uint8 :offset 0) - (y uint8 :offset 1) - (clr uint16 :offset 0) + ((data uint8 2) + (x uint8 :overlay-at (-> data 0)) + (y uint8 :overlay-at (-> data 1)) + (clr uint16 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) (deftype vector2b (structure) - ((data int8 2 :offset-assert 0) - (x int8 :offset 0) - (y int8 :offset 1) - (clr int16 :offset 0) + ((data int8 2) + (x int8 :overlay-at (-> data 0)) + (y int8 :overlay-at (-> data 1)) + (clr int16 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; HALFWORD vectors (deftype vector2h (structure) - ((data int16 2 :offset-assert 0) - (x int16 :offset 0) - (y int16 :offset 2) + ((data int16 2) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype vector2uh (structure) - ((data uint16 2 :offset-assert 0) - (x uint16 :offset 0) - (y uint16 :offset 2) - (val uint32 :offset 0) + ((data uint16 2) + (x uint16 :overlay-at (-> data 0)) + (y uint16 :overlay-at (-> data 1)) + (val uint32 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype vector3h (structure) - ((data int16 3 :offset-assert 0) - (x int16 :offset 0) - (y int16 :offset 2) - (z int16 :offset 4) + ((data int16 3) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) (deftype vector3uh (structure) - ((data uint16 3 :offset-assert 0) - (x uint16 :offset 0) - (y uint16 :offset 2) - (z uint16 :offset 4) + ((data uint16 3) + (x uint16 :overlay-at (-> data 0)) + (y uint16 :overlay-at (-> data 1)) + (z uint16 :overlay-at (-> data 2)) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) ;; WORD vectors (deftype vector2w (structure) - ((data int32 2 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) + ((data int32 2) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype vector3w (structure) - ((data int32 3 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) - (z int32 :offset 8) + ((data int32 3) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) + (z int32 :overlay-at (-> data 2)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype vector4w (structure) - ((data int32 4 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) - (z int32 :offset 8) - (w int32 :offset 12) - (dword uint64 2 :offset 0) - (quad uint128 :offset 0) + ((data int32 4) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) + (z int32 :overlay-at (-> data 2)) + (w int32 :overlay-at (-> data 3)) + (dword uint64 2 :overlay-at (-> data 0)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; FLOAT vectors (deftype vector2 (structure) - ((data float 2 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) + ((data float 2) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype vector3 (structure) - ((data float 3 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) + ((data float 3) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) + (z float :overlay-at (-> data 2)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; Note: typically vector is used instead of vector4. ;; vector usually means "xyz only, with w = 1", and vector4 ;; is sometimes used when w is more meaningful. (deftype vector4 (structure) - ((data float 4 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (w float :offset 12) - (dword uint64 2 :offset 0) - (quad uint128 :offset 0) + ((data float 4) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) + (z float :overlay-at (-> data 2)) + (w float :overlay-at (-> data 3)) + (dword uint64 2 :overlay-at (-> data 0)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; SPECIAL vectors -(defmethod print vector4w ((obj vector4w)) +(defmethod print ((obj vector4w)) "Print a vector4w" (format #t "#" (-> obj x) (-> obj y) (-> obj z) (-> obj w) obj) obj @@ -290,78 +242,60 @@ Changes: ;; group of 2 vector4w's (deftype vector4w-2 (structure) - ((data int32 8 :offset-assert 0) - (quad uint128 2 :offset 0) - (vector vector4w 2 :inline :offset 0) + ((data int32 8) + (quad uint128 2 :overlay-at (-> data 0)) + (vector vector4w 2 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype vector4w-3 (structure) - ((data int32 12 :offset-assert 0) - (quad uint128 3 :offset 0) - (vector vector4w 3 :inline :offset 0) + ((data int32 12) + (quad uint128 3 :overlay-at (-> data 0)) + (vector vector4w 3 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype vector4w-4 (structure) - ((data int32 16 :offset-assert 0) - (quad uint128 4 :offset 0) - (vector vector4w 4 :inline :offset 0) + ((data int32 16) + (quad uint128 4 :overlay-at (-> data 0)) + (vector vector4w 4 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype vector4h (structure) - ((data int16 4 :offset-assert 0) - (x int16 :offset 0) - (y int16 :offset 2) - (z int16 :offset 4) - (w int16 :offset 6) - (long uint64 :offset 0) + ((data int16 4) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) + (w int16 :overlay-at (-> data 3)) + (long uint64 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype vector8h (structure) - ((data int16 8 :offset-assert 0) - (quad uint128 :offset 0) + ((data int16 8) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype vector16b (structure) - ((data int8 16 :offset-assert 0) - (quad uint128 :offset 0) + ((data int8 16) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) -(defmethod inspect vector ((obj vector)) +(defmethod inspect ((obj vector)) "Inspect a vector." (format #t "[~8x] vector~%" obj) (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj x) (-> obj y) (-> obj z) (-> obj w)) obj ) -(defmethod print vector ((obj vector)) +(defmethod print ((obj vector)) "Print a vector." (format #t "#" (-> obj x) (-> obj y) (-> obj z) (-> obj w) obj) obj @@ -379,61 +313,43 @@ Changes: ;; SPECIAL vector (of floats) (deftype vector4s-3 (structure) - ((data float 12 :offset-assert 0) - (quad uint128 3 :offset 0) - (vector vector 3 :inline :offset 0) + ((data float 12) + (quad uint128 3 :overlay-at (-> data 0)) + (vector vector 3 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition of type vector-array (deftype vector-array (inline-array-class) - ((data vector :inline :dynamic :offset-assert 16) + ((data vector :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> vector-array heap-base) (the-as uint 16)) (deftype rgbaf (vector) - ((r float :offset 0) - (g float :offset 4) - (b float :offset 8) - (a float :offset 12) + ((r float :overlay-at (-> data 0)) + (g float :overlay-at (-> data 1)) + (b float :overlay-at (-> data 2)) + (a float :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; ax + by + cz = d form (deftype plane (vector) - ((a float :offset 0) - (b float :offset 4) - (c float :offset 8) - (d float :offset 12) + ((a float :overlay-at (-> data 0)) + (b float :overlay-at (-> data 1)) + (c float :overlay-at (-> data 2)) + (d float :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype sphere (vector) - ((r float :offset 12) + ((r float :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype isphere (vec4s) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (defmacro static-vector (x y z w) @@ -455,100 +371,76 @@ Changes: ;; box, stored as 8 floats (min/max along each dim, unused w's) (deftype box8s (structure) - ((data float 8 :offset-assert 0) - (quad uint128 2 :offset 0) - (vector vector 2 :offset 0) - (min vector :inline :offset 0) - (max vector :inline :offset 16) + ((data float 8) + (quad uint128 2 :overlay-at (-> data 0)) + (vector vector 2 :overlay-at (-> data 0)) + (min vector :inline :overlay-at (-> data 0)) + (max vector :inline :overlay-at (-> data 4)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype box8s-array (inline-array-class) - ((data box8s :inline :dynamic :offset-assert 16) + ((data box8s :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> box8s-array heap-base) (the-as uint 32)) ;; actually a capsule (deftype cylinder (structure) - ((origin vector :inline :offset-assert 0) - (axis vector :inline :offset-assert 16) - (radius float :offset-assert 32) - (length float :offset-assert 36) - ) - :method-count-assert 11 - :size-assert #x28 - :flag-assert #xb00000028 + ((origin vector :inline) + (axis vector :inline) + (radius float) + (length float) + ) (:methods - (debug-draw (_type_ vector4w) none 9) - (ray-capsule-intersect (_type_ vector vector) float 10) + (debug-draw (_type_ vector4w) none) + (ray-capsule-intersect (_type_ vector vector) float) ) ) ;; a normal cylinder (deftype cylinder-flat (structure) - ((origin vector :inline :offset-assert 0) - (axis vector :inline :offset-assert 16) - (radius float :offset-assert 32) - (length float :offset-assert 36) - ) - :method-count-assert 11 - :size-assert #x28 - :flag-assert #xb00000028 + ((origin vector :inline) + (axis vector :inline) + (radius float) + (length float) + ) (:methods - (debug-draw (_type_ vector4w) none 9) - (ray-flat-cyl-intersect (_type_ vector vector) float 10) + (debug-draw (_type_ vector4w) none) + (ray-flat-cyl-intersect (_type_ vector vector) float) ) ) (deftype vertical-planes (structure) - ((data uint128 4 :offset-assert 0) + ((data uint128 4) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype vertical-planes-array (basic) - ((length uint32 :offset-assert 4) - (data vertical-planes :inline :dynamic :offset-assert 16) + ((length uint32) + (data vertical-planes :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype qword (structure) - ((data uint32 4 :offset-assert 0) - (byte uint8 16 :offset 0) - (hword uint16 8 :offset 0) - (word uint32 4 :offset 0) - (dword uint64 2 :offset 0) - (quad uint128 :offset 0) - (vector vector :inline :offset 0) - (vector4w vector4w :inline :offset 0) + ((data uint32 4) + (byte uint8 16 :overlay-at (-> data 0)) + (hword uint16 8 :overlay-at (-> data 0)) + (word uint32 4 :overlay-at (-> data 0)) + (dword uint64 2 :overlay-at (-> data 0)) + (quad uint128 :overlay-at (-> data 0)) + (vector vector :inline :overlay-at (-> data 0)) + (vector4w vector4w :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype vector3s (structure) - ((data float 3 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - ) - :pack-me ;; removeme - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c + ((data float 3) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) + (z float :overlay-at (-> data 2)) + ) + :pack-me ) (define-extern vector-cross! (function vector vector vector vector)) diff --git a/goal_src/jak2/engine/math/vector.gc b/goal_src/jak2/engine/math/vector.gc index 771668c72b8..53079220582 100644 --- a/goal_src/jak2/engine/math/vector.gc +++ b/goal_src/jak2/engine/math/vector.gc @@ -1609,7 +1609,7 @@ (vector-normalize! arg0 (rand-vu-float-range 0.0 arg1)) ) -(defmethod print vector2 ((obj vector2)) +(defmethod print ((obj vector2)) "Print a vector2." (format #t "#" (-> obj x) (-> obj y) obj) obj diff --git a/goal_src/jak2/engine/nav/nav-control-h.gc b/goal_src/jak2/engine/nav/nav-control-h.gc index cf3e4012374..588806e24c0 100644 --- a/goal_src/jak2/engine/nav/nav-control-h.gc +++ b/goal_src/jak2/engine/nav/nav-control-h.gc @@ -43,192 +43,174 @@ ;; DECOMP BEGINS (deftype check-vector-collision-with-nav-spheres-info (structure) - ((u float :offset-assert 0) - (intersect vector :inline :offset-assert 16) - (normal vector :inline :offset-assert 32) + ((u float) + (intersect vector :inline) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype nav-gap-info (structure) - ((dest vector :inline :offset-assert 0) - (poly nav-poly :offset-assert 16) + ((dest vector :inline) + (poly nav-poly) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype nav-avoid-spheres-params (structure) - ((current-pos vector :inline :offset-assert 0) - (travel vector :inline :offset-assert 16) - (pref-dir vector :inline :offset-assert 32) - (out-travel vector 2 :inline :offset-assert 48) - (closest-sphere-dist2 float :offset-assert 80) - (avoiding-sphere? symbol :offset-assert 84) + ((current-pos vector :inline) + (travel vector :inline) + (pref-dir vector :inline) + (out-travel vector 2 :inline) + (closest-sphere-dist2 float) + (avoiding-sphere? symbol) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) (deftype nav-callback-info (structure) - ((callback-count int32 :offset-assert 0) - (callback-array (function object nav-control none) 10 :offset-assert 4) + ((callback-count int32) + (callback-array (function object nav-control none) 10) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) (deftype nav-state (structure) - ((flags nav-state-flag :offset-assert 0) - (nav nav-control :offset-assert 4) - (user-poly nav-poly :offset-assert 8) - (mesh nav-mesh :offset-assert 12) - (current-poly nav-poly :offset-assert 16) - (virtual-current-poly nav-poly :offset-assert 20) - (next-poly nav-poly :offset-assert 24) - (target-poly nav-poly :offset-assert 28) - (rotation-rate float :offset-assert 32) - (speed meters :offset-assert 36) - (prev-speed meters :offset-assert 40) - (pad0 uint32 1 :offset-assert 44) - (travel vector :inline :offset-assert 48) - (target-post vector :inline :offset-assert 64) - (current-pos vector :inline :offset-assert 80) - (current-pos-local vector :inline :offset-assert 96) - (virtual-current-pos-local vector :inline :offset-assert 112) - (velocity vector :inline :offset-assert 128) - (heading vector :inline :offset-assert 144) - (target-dir vector :inline :offset-assert 160) - (accel vector :inline :offset 160) + ((flags nav-state-flag) + (nav nav-control) + (user-poly nav-poly) + (mesh nav-mesh) + (current-poly nav-poly) + (virtual-current-poly nav-poly) + (next-poly nav-poly) + (target-poly nav-poly) + (rotation-rate float) + (speed meters) + (prev-speed meters) + (pad0 uint32 1) + (travel vector :inline) + (target-post vector :inline) + (current-pos vector :inline) + (current-pos-local vector :inline) + (virtual-current-pos-local vector :inline) + (velocity vector :inline) + (heading vector :inline) + (target-dir vector :inline) + (accel vector :inline :overlay-at target-dir) ) - :method-count-assert 55 - :size-assert #xb0 - :flag-assert #x37000000b0 (:methods - (debug-draw (_type_) none 9) - (nav-state-method-10 (_type_) none 10) - (plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol 11) - (get-velocity (_type_ vector) vector 12) - (get-travel (_type_ vector) vector 13) - (get-heading (_type_ vector) vector 14) - (get-target-post (_type_ vector) vector 15) - (get-speed (_type_) meters 16) - (get-rotation-rate (_type_) float 17) - (try-projecting-to-current-poly (_type_ vector object vector) symbol 18) - (get-current-poly (_type_) nav-poly 19) - (copy-nav-state! (_type_ (pointer nav-state)) none 20) - (nav-state-method-21 () none 21) - (nav-state-method-22 () none 22) - (nav-state-method-23 () none 23) - (turn-and-navigate-to-destination (_type_) none 24) - (navigate-using-route-portals-wrapper (_type_) none 25) - (navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none 26) - (navigate-within-poly-wrapper (_type_) none 27) - (compute-travel-speed (_type_) none 28) - (nav-state-method-29 (_type_) none 29) - (nav-state-method-30 (_type_) none 30) - (navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none 31) - (update-travel-dir-from-spheres (_type_) none 32) - (compute-speed-simple (_type_) none 33) - (navigate-v1! (_type_) none 34) - (reset-target! (_type_) none 35) - (add-offset-to-target! (_type_ vector) none 36) - (navigate-v2! (_type_) none 37) - (set-current-poly! (_type_ nav-poly) none 38) - (nav-state-method-39 (_type_) symbol 39) - (do-navigation-to-destination (_type_ vector) none 40) - (clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol 41) - (set-target-post! (_type_ vector) none 42) - (set-travel! (_type_ vector) none 43) - (set-velocity! (_type_ vector) none 44) - (set-heading! (_type_ vector) none 45) - (set-speed! (_type_ meters) none 46) - (reset! (_type_ nav-control) none 47) - (nav-state-method-48 () none 48) - (navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none 49) - (nav-state-method-50 (_type_) none 50) - (navigate-using-route-portals (_type_) none 51) - (navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none 52) - (navigate-within-poly (_type_) none 53) - (clamp-travel-vector (_type_) none 54) + (debug-draw (_type_) none) + (nav-state-method-10 (_type_) none) + (plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol) + (get-velocity (_type_ vector) vector) + (get-travel (_type_ vector) vector) + (get-heading (_type_ vector) vector) + (get-target-post (_type_ vector) vector) + (get-speed (_type_) meters) + (get-rotation-rate (_type_) float) + (try-projecting-to-current-poly (_type_ vector object vector) symbol) + (get-current-poly (_type_) nav-poly) + (copy-nav-state! (_type_ (pointer nav-state)) none) + (nav-state-method-21 () none) + (nav-state-method-22 () none) + (nav-state-method-23 () none) + (turn-and-navigate-to-destination (_type_) none) + (navigate-using-route-portals-wrapper (_type_) none) + (navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none) + (navigate-within-poly-wrapper (_type_) none) + (compute-travel-speed (_type_) none) + (nav-state-method-29 (_type_) none) + (nav-state-method-30 (_type_) none) + (navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none) + (update-travel-dir-from-spheres (_type_) none) + (compute-speed-simple (_type_) none) + (navigate-v1! (_type_) none) + (reset-target! (_type_) none) + (add-offset-to-target! (_type_ vector) none) + (navigate-v2! (_type_) none) + (set-current-poly! (_type_ nav-poly) none) + (nav-state-method-39 (_type_) symbol) + (do-navigation-to-destination (_type_ vector) none) + (clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol) + (set-target-post! (_type_ vector) none) + (set-travel! (_type_ vector) none) + (set-velocity! (_type_ vector) none) + (set-heading! (_type_ vector) none) + (set-speed! (_type_ meters) none) + (reset! (_type_ nav-control) none) + (nav-state-method-48 () none) + (navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none) + (nav-state-method-50 (_type_) none) + (navigate-using-route-portals (_type_) none) + (navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none) + (navigate-within-poly (_type_) none) + (clamp-travel-vector (_type_) none) ) ) (deftype nav-control (structure) - ((flags nav-control-flag :offset-assert 0) - (callback-info nav-callback-info :offset-assert 4) - (process process :offset-assert 8) - (pad0 uint32 :offset-assert 12) - (shape collide-shape :offset-assert 16) - (nearest-y-threshold meters :offset-assert 20) - (nav-cull-radius meters :offset-assert 24) - (sec-per-frame float :offset-assert 28) - (target-speed meters :offset-assert 32) - (acceleration meters :offset-assert 36) - (turning-acceleration meters :offset-assert 40) - (max-rotation-rate float :offset-assert 44) - (speed-scale float :offset-assert 48) - (sphere-count int32 :offset-assert 52) - (sphere-array (inline-array sphere) :offset-assert 56) - (root-sphere-id uint8 :offset-assert 60) - (sphere-mask uint8 :offset-assert 61) - (pad1 uint8 2 :offset-assert 62) - (sphere-id-array uint8 16 :offset-assert 64) - (extra-nav-sphere vector :inline :offset-assert 80) - (root-nav-sphere vector :inline :offset-assert 96) - (state nav-state :inline :offset-assert 112) + ((flags nav-control-flag) + (callback-info nav-callback-info) + (process process) + (pad0 uint32) + (shape collide-shape) + (nearest-y-threshold meters) + (nav-cull-radius meters) + (sec-per-frame float) + (target-speed meters) + (acceleration meters) + (turning-acceleration meters) + (max-rotation-rate float) + (speed-scale float) + (sphere-count int32) + (sphere-array (inline-array sphere)) + (root-sphere-id uint8) + (sphere-mask uint8) + (pad1 uint8 2) + (sphere-id-array uint8 16) + (extra-nav-sphere vector :inline) + (root-nav-sphere vector :inline) + (state nav-state :inline) ) - :method-count-assert 47 - :size-assert #x120 - :flag-assert #x2f00000120 (:methods - (debug-draw (_type_) none 9) - (point-in-bsphere? (_type_ vector) symbol 10) - (find-poly-containing-point-1 (_type_ vector) nav-poly 11) - (cloest-point-on-mesh (_type_ vector vector nav-poly) nav-poly 12) - (find-nearest-poly-to-point (_type_ vector) nav-poly 13) - (project-point-onto-plane-of-poly (_type_ nav-poly vector vector vector) none 14) - (find-poly-containing-point-2 (_type_ vector) nav-poly 15) - (is-above-poly-max-height? (_type_ vector float) symbol 16) - (is-in-mesh? (_type_ vector float) symbol 17) - (avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol 18) - (avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol 19) - (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 20) - (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none 21) - (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float 22) - (set-spheres-from-nav-ids (_type_) none 23) - (add-root-sphere-to-hash! (_type_ vector int) symbol 24) - (get-max-rotation-rate (_type_) float 25) - (get-sphere-mask (_type_) uint 26) - (get-target-speed (_type_) meters 27) - (enable-extra-sphere! (_type_) none 28) - (disable-extra-sphere! (_type_) none 29) - (copy-extra-nav-sphere! (_type_ sphere) none 30) - (set-extra-nav-sphere-xyz! (_type_ sphere) none 31) - (set-extra-nav-sphere-radius! (_type_ float) none 32) - (set-nearest-y-thres! (_type_ float) none 33) - (set-nav-cull-radius! (_type_ meters) none 34) - (set-speed-scale! (_type_ float) none 35) - (set-target-speed! (_type_ meters) none 36) - (set-acceleration! (_type_ meters) none 37) - (set-turning-acceleration! (_type_ meters) none 38) - (set-max-rotation-rate! (_type_ float) none 39) - (set-sphere-mask! (_type_ uint) none 40) - (remove! (_type_) none 41) - (init! (_type_ collide-shape) none 42) - (display-marks? (_type_) symbol 43) - (nav-control-method-44 () none 44) - (find-first-sphere-intersecting-ray (_type_ vector vector vector) sphere 45) - (find-sphere-ids-from-sphere-hash (_type_ symbol) none 46) + (debug-draw (_type_) none) + (point-in-bsphere? (_type_ vector) symbol) + (find-poly-containing-point-1 (_type_ vector) nav-poly) + (cloest-point-on-mesh (_type_ vector vector nav-poly) nav-poly) + (find-nearest-poly-to-point (_type_ vector) nav-poly) + (project-point-onto-plane-of-poly (_type_ nav-poly vector vector vector) none) + (find-poly-containing-point-2 (_type_ vector) nav-poly) + (is-above-poly-max-height? (_type_ vector float) symbol) + (is-in-mesh? (_type_ vector float) symbol) + (avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol) + (avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) + (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float) + (set-spheres-from-nav-ids (_type_) none) + (add-root-sphere-to-hash! (_type_ vector int) symbol) + (get-max-rotation-rate (_type_) float) + (get-sphere-mask (_type_) uint) + (get-target-speed (_type_) meters) + (enable-extra-sphere! (_type_) none) + (disable-extra-sphere! (_type_) none) + (copy-extra-nav-sphere! (_type_ sphere) none) + (set-extra-nav-sphere-xyz! (_type_ sphere) none) + (set-extra-nav-sphere-radius! (_type_ float) none) + (set-nearest-y-thres! (_type_ float) none) + (set-nav-cull-radius! (_type_ meters) none) + (set-speed-scale! (_type_ float) none) + (set-target-speed! (_type_ meters) none) + (set-acceleration! (_type_ meters) none) + (set-turning-acceleration! (_type_ meters) none) + (set-max-rotation-rate! (_type_ float) none) + (set-sphere-mask! (_type_ uint) none) + (remove! (_type_) none) + (init! (_type_ collide-shape) none) + (display-marks? (_type_) symbol) + (nav-control-method-44 () none) + (find-first-sphere-intersecting-ray (_type_ vector vector vector) sphere) + (find-sphere-ids-from-sphere-hash (_type_ symbol) none) ) ) diff --git a/goal_src/jak2/engine/nav/nav-control.gc b/goal_src/jak2/engine/nav/nav-control.gc index ac474c7a762..9a08f021c72 100644 --- a/goal_src/jak2/engine/nav/nav-control.gc +++ b/goal_src/jak2/engine/nav/nav-control.gc @@ -27,41 +27,41 @@ (none) ) -(defmethod relocate nav-control ((this nav-control) (arg0 int)) +(defmethod relocate ((this nav-control) (arg0 int)) (&+! (-> this process) arg0) (&+! (-> this shape) arg0) this ) -(defmethod remove! nav-control ((this nav-control)) +(defmethod remove! ((this nav-control)) "Remove this nav-control from the nav-mesh it belongs to." (remove-nav-control (-> this state mesh) this) 0 (none) ) -(defmethod enable-extra-sphere! nav-control ((this nav-control)) +(defmethod enable-extra-sphere! ((this nav-control)) "Sets a flag indicating that this nav-control has an extra-nav-sphere." (logior! (-> this shape nav-flags) (nav-flags has-extra-sphere)) 0 (none) ) -(defmethod disable-extra-sphere! nav-control ((this nav-control)) +(defmethod disable-extra-sphere! ((this nav-control)) "Clears a flag indicating that this nav-control has an extra-nav-sphere." (logclear! (-> this shape nav-flags) (nav-flags has-extra-sphere)) 0 (none) ) -(defmethod copy-extra-nav-sphere! nav-control ((this nav-control) (arg0 sphere)) +(defmethod copy-extra-nav-sphere! ((this nav-control) (arg0 sphere)) "Copies the given [[sphere]] into `extra-nav-sphere`" (mem-copy! (the-as pointer (-> this extra-nav-sphere)) (the-as pointer arg0) 16) 0 (none) ) -(defmethod set-extra-nav-sphere-xyz! nav-control ((this nav-control) (arg0 sphere)) +(defmethod set-extra-nav-sphere-xyz! ((this nav-control) (arg0 sphere)) "Set the `extra-nav-sphere` with the data in the given [[sphere]]" (let ((f0-0 (-> this extra-nav-sphere w))) (set! (-> this extra-nav-sphere quad) (-> arg0 quad)) @@ -71,94 +71,94 @@ (none) ) -(defmethod set-extra-nav-sphere-radius! nav-control ((this nav-control) (arg0 float)) +(defmethod set-extra-nav-sphere-radius! ((this nav-control) (arg0 float)) "Set's `extra-nav-sphere`'s radius" (set! (-> this extra-nav-sphere w) arg0) 0 (none) ) -(defmethod set-nearest-y-thres! nav-control ((this nav-control) (arg0 float)) +(defmethod set-nearest-y-thres! ((this nav-control) (arg0 float)) "Set `nearest-y-threshold`" (set! (-> this nearest-y-threshold) arg0) 0 (none) ) -(defmethod set-nav-cull-radius! nav-control ((this nav-control) (arg0 meters)) +(defmethod set-nav-cull-radius! ((this nav-control) (arg0 meters)) "Set `nav-cull-radius`" (set! (-> this nav-cull-radius) arg0) 0 (none) ) -(defmethod set-speed-scale! nav-control ((this nav-control) (arg0 float)) +(defmethod set-speed-scale! ((this nav-control) (arg0 float)) "Set `speed-scale`" (set! (-> this speed-scale) arg0) 0 (none) ) -(defmethod set-target-speed! nav-control ((this nav-control) (arg0 meters)) +(defmethod set-target-speed! ((this nav-control) (arg0 meters)) "Set `target-speed`" (set! (-> this target-speed) arg0) 0 (none) ) -(defmethod get-target-speed nav-control ((this nav-control)) +(defmethod get-target-speed ((this nav-control)) (-> this target-speed) ) -(defmethod set-acceleration! nav-control ((this nav-control) (arg0 meters)) +(defmethod set-acceleration! ((this nav-control) (arg0 meters)) "Set `acceleration`" (set! (-> this acceleration) arg0) 0 (none) ) -(defmethod set-turning-acceleration! nav-control ((this nav-control) (arg0 meters)) +(defmethod set-turning-acceleration! ((this nav-control) (arg0 meters)) "Set `turning-acceleration`" (set! (-> this turning-acceleration) arg0) 0 (none) ) -(defmethod set-max-rotation-rate! nav-control ((this nav-control) (arg0 float)) +(defmethod set-max-rotation-rate! ((this nav-control) (arg0 float)) "Set `max-rotation-rate`" (set! (-> this max-rotation-rate) arg0) 0 (none) ) -(defmethod get-max-rotation-rate nav-control ((this nav-control)) +(defmethod get-max-rotation-rate ((this nav-control)) (-> this max-rotation-rate) ) -(defmethod set-sphere-mask! nav-control ((this nav-control) (arg0 uint)) +(defmethod set-sphere-mask! ((this nav-control) (arg0 uint)) "TODO - probably an enum - Set `sphere-mask`" (set! (-> this sphere-mask) arg0) 0 (none) ) -(defmethod get-sphere-mask nav-control ((this nav-control)) +(defmethod get-sphere-mask ((this nav-control)) (-> this sphere-mask) ) -(defmethod point-in-bsphere? nav-control ((this nav-control) (arg0 vector)) +(defmethod point-in-bsphere? ((this nav-control) (arg0 vector)) "Is the given point ([[vector]]) outside of the [[nav-mesh]]'s `bounds` [[sphere]] radius" (let ((v1-1 (-> this state mesh bounds))) (>= (-> v1-1 w) (vector-vector-distance arg0 v1-1)) ) ) -(defmethod display-marks? nav-control ((this nav-control)) +(defmethod display-marks? ((this nav-control)) "Returns if navigation related marks should be displayed" (and *display-nav-marks* (logtest? (-> this flags) (nav-control-flag display-marks))) ) -(defmethod init! nav-control ((this nav-control) (arg0 collide-shape)) +(defmethod init! ((this nav-control) (arg0 collide-shape)) "Initializes the [[nav-control]], setting `shape` with the provided [[collide-shape]]" (set! (-> this callback-info) #f) (logior! (-> this flags) (nav-control-flag update-heading-from-facing output-sphere-hash)) @@ -203,7 +203,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod find-nearest-poly-to-point nav-control ((this nav-control) (arg0 vector)) +(defmethod find-nearest-poly-to-point ((this nav-control) (arg0 vector)) "Find the nav-poly closest to this point in the nav-mesh." (let ((gp-0 (new 'stack 'nav-find-poly-parms))) (vector-! (-> gp-0 point) arg0 (-> this state mesh bounds)) @@ -214,7 +214,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod project-point-onto-plane-of-poly nav-control ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod project-point-onto-plane-of-poly ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) "Move a point to the be on the plane containing the given nav-poly. Return the normal too" (project-point-onto-plane-of-poly-local (-> this state mesh) @@ -228,7 +228,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod is-in-mesh? nav-control ((this nav-control) (arg0 vector) (arg1 float)) +(defmethod is-in-mesh? ((this nav-control) (arg0 vector) (arg1 float)) "Is this point in the mesh?" (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> this state mesh bounds)) @@ -238,7 +238,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod debug-draw nav-control ((this nav-control)) +(defmethod debug-draw ((this nav-control)) (local-vars (sv-32 nav-mesh) (sv-36 vector)) (when (display-marks? this) (debug-draw (-> this state mesh)) @@ -292,7 +292,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod find-poly-containing-point-1 nav-control ((this nav-control) (arg0 vector)) +(defmethod find-poly-containing-point-1 ((this nav-control) (arg0 vector)) "Find nav-poly containing this point." (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) (vector-! (-> v1-0 point) arg0 (-> this state mesh bounds)) @@ -302,7 +302,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod find-poly-containing-point-2 nav-control ((this nav-control) (arg0 vector)) +(defmethod find-poly-containing-point-2 ((this nav-control) (arg0 vector)) "Find nav-poly containing this point - same as 1" (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) (vector-! (-> v1-0 point) arg0 (-> this state mesh bounds)) @@ -313,7 +313,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; WARN: Return type mismatch object vs symbol. -(defmethod is-above-poly-max-height? nav-control ((this nav-control) (arg0 vector) (arg1 float)) +(defmethod is-above-poly-max-height? ((this nav-control) (arg0 vector) (arg1 float)) "Is the point in a poly, and lower than a max height?" (let ((a1-1 (new 'stack-no-clear 'nav-find-poly-parms))) (vector-! (-> a1-1 point) arg0 (-> this state mesh bounds)) @@ -326,7 +326,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod find-first-sphere-intersecting-ray nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod find-first-sphere-intersecting-ray ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) "Find the first sphere that this ray intersects" (let ((s5-0 (the-as sphere #f))) (let ((f30-0 -0.000001)) @@ -464,7 +464,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod find-sphere-ids-from-sphere-hash nav-control ((this nav-control) (arg0 symbol)) +(defmethod find-sphere-ids-from-sphere-hash ((this nav-control) (arg0 symbol)) "Use sphere-hash to look up navigation sphere IDs and save them." (let ((s5-0 (new 'stack-no-clear 'find-nav-sphere-ids-params))) (set! (-> s5-0 bsphere quad) (-> this root-nav-sphere quad)) @@ -480,7 +480,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod set-spheres-from-nav-ids nav-control ((this nav-control)) +(defmethod set-spheres-from-nav-ids ((this nav-control)) "Set up spheres from sphere ids previously found by find-sphere-ids-from-sphere-hash" (let ((v1-2 (-> this state mesh sphere-hash sphere-array)) (a1-0 (-> this sphere-id-array)) @@ -502,29 +502,26 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (deftype nav-control-cfs-work (structure) - ((in-dir vector :inline :offset-assert 0) - (right-dir vector :inline :offset-assert 16) - (best-dir vector 2 :inline :offset-assert 32) - (temp-dir vector 2 :inline :offset-assert 64) - (away-dir vector :inline :offset-assert 96) - (best-dir-angle degrees 2 :offset-assert 112) - (ignore-mask uint64 :offset-assert 120) - (initial-ignore-mask uint64 :offset-assert 128) - (i-sphere int32 :offset-assert 136) - (i-first-sphere int32 :offset-assert 140) - (i-inside-sphere int32 :offset-assert 144) - (inside-sphere-dist float :offset-assert 148) - (sign float :offset-assert 152) - (travel-len float :offset-assert 156) - (dist2 float :offset-assert 160) - (inside-dist float :offset-assert 164) - (rand-angle float :offset-assert 168) - (dir-update basic :offset-assert 172) - (debug-offset vector :inline :offset-assert 176) + ((in-dir vector :inline) + (right-dir vector :inline) + (best-dir vector 2 :inline) + (temp-dir vector 2 :inline) + (away-dir vector :inline) + (best-dir-angle degrees 2) + (ignore-mask uint64) + (initial-ignore-mask uint64) + (i-sphere int32) + (i-first-sphere int32) + (i-inside-sphere int32) + (inside-sphere-dist float) + (sign float) + (travel-len float) + (dist2 float) + (inside-dist float) + (rand-angle float) + (dir-update basic) + (debug-offset vector :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) @@ -716,7 +713,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod avoid-spheres-1! nav-control ((this nav-control) (arg0 nav-avoid-spheres-params)) +(defmethod avoid-spheres-1! ((this nav-control) (arg0 nav-avoid-spheres-params)) (local-vars (v1-28 int) (a0-29 int) (a1-3 float)) (rlet ((acc :class vf) (Q :class vf) @@ -1014,7 +1011,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod avoid-spheres-2! nav-control ((this nav-control) (arg0 nav-avoid-spheres-params)) +(defmethod avoid-spheres-2! ((this nav-control) (arg0 nav-avoid-spheres-params)) (local-vars (a0-32 int) (a1-3 float)) (rlet ((acc :class vf) (Q :class vf) @@ -1145,18 +1142,18 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod clamp-vector-to-mesh-no-gaps nav-control ((this nav-control) - (arg0 vector) - (arg1 nav-poly) - (arg2 vector) - (arg3 clamp-travel-vector-to-mesh-return-info) - ) +(defmethod clamp-vector-to-mesh-no-gaps ((this nav-control) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 clamp-travel-vector-to-mesh-return-info) + ) (clamp-vector-to-mesh-no-gaps (-> this state mesh) arg0 arg1 arg2 arg3) 0 (none) ) -(defmethod clamp-vector-to-mesh-no-gaps nav-mesh ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) +(defmethod clamp-vector-to-mesh-no-gaps ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) (local-vars (v1-12 symbol) (sv-112 nav-ray) @@ -1377,7 +1374,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Return type mismatch object vs none. ;; WARN: Function (method 21 nav-mesh) has a return type of none, but the expression builder found a return statement. -(defmethod find-adjacent-bounds-one nav-mesh ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) +(defmethod find-adjacent-bounds-one ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) (local-vars (sv-16 nav-poly)) (if (zero? arg3) (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> arg1 vertex-count)))) @@ -1424,7 +1421,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod set-normals-from-adjacent-bounds nav-mesh ((this nav-mesh) (arg0 clamp-travel-vector-to-mesh-return-info)) +(defmethod set-normals-from-adjacent-bounds ((this nav-mesh) (arg0 clamp-travel-vector-to-mesh-return-info)) (find-adjacent-bounds-one this (-> arg0 vert-prev) (-> arg0 poly) (-> arg0 edge) -1) (find-adjacent-bounds-one this (-> arg0 vert-next) (-> arg0 poly) (-> arg0 edge) 0) (vector-! (-> arg0 prev-normal) (-> arg0 vert-0) (-> arg0 vert-prev)) @@ -1445,14 +1442,14 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod clamp-vector-to-mesh-cross-gaps nav-mesh ((this nav-mesh) - (arg0 vector) - (arg1 nav-poly) - (arg2 vector) - (arg3 float) - (arg4 symbol) - (arg5 clamp-travel-vector-to-mesh-return-info) - ) +(defmethod clamp-vector-to-mesh-cross-gaps ((this nav-mesh) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 float) + (arg4 symbol) + (arg5 clamp-travel-vector-to-mesh-return-info) + ) (local-vars (v1-11 symbol) (v1-22 symbol) @@ -1697,7 +1694,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod find-first-sphere-and-update-avoid-params nav-control ((this nav-control) (arg0 vector) (arg1 nav-avoid-spheres-params)) +(defmethod find-first-sphere-and-update-avoid-params ((this nav-control) (arg0 vector) (arg1 nav-avoid-spheres-params)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -1765,7 +1762,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod add-root-sphere-to-hash! nav-control ((this nav-control) (arg0 vector) (arg1 int)) +(defmethod add-root-sphere-to-hash! ((this nav-control) (arg0 vector) (arg1 int)) "Add our root sphere to the hash (if enabled with output-sphere-hash flag) at the given location." (if (logtest? (-> this flags) (nav-control-flag output-sphere-hash)) (add-sphere-with-mask-and-id @@ -1777,7 +1774,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod reset! nav-state ((this nav-state) (arg0 nav-control)) +(defmethod reset! ((this nav-state) (arg0 nav-control)) (set! (-> this nav) arg0) (set! (-> this flags) (nav-state-flag)) (set! (-> this current-poly) #f) @@ -1788,66 +1785,66 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod relocate nav-state ((this nav-state) (arg0 int)) +(defmethod relocate ((this nav-state) (arg0 int)) (break!) (&+! (-> this nav) arg0) this ) -(defmethod get-velocity nav-state ((this nav-state) (arg0 vector)) +(defmethod get-velocity ((this nav-state) (arg0 vector)) (set! (-> arg0 quad) (-> this velocity quad)) arg0 ) -(defmethod get-heading nav-state ((this nav-state) (arg0 vector)) +(defmethod get-heading ((this nav-state) (arg0 vector)) (set! (-> arg0 quad) (-> this heading quad)) arg0 ) -(defmethod get-target-post nav-state ((this nav-state) (arg0 vector)) +(defmethod get-target-post ((this nav-state) (arg0 vector)) (set! (-> arg0 quad) (-> this target-post quad)) arg0 ) -(defmethod get-current-poly nav-state ((this nav-state)) +(defmethod get-current-poly ((this nav-state)) "@returns `current-poly`" (-> this current-poly) ) -(defmethod get-speed nav-state ((this nav-state)) +(defmethod get-speed ((this nav-state)) "@returns `speed`" (-> this speed) ) -(defmethod get-rotation-rate nav-state ((this nav-state)) +(defmethod get-rotation-rate ((this nav-state)) "@returns `rotation-rate`" (-> this rotation-rate) ) -(defmethod get-travel nav-state ((this nav-state) (arg0 vector)) +(defmethod get-travel ((this nav-state) (arg0 vector)) (set! (-> arg0 quad) (-> this travel quad)) arg0 ) -(defmethod set-velocity! nav-state ((this nav-state) (velocity vector)) +(defmethod set-velocity! ((this nav-state) (velocity vector)) (set! (-> this velocity quad) (-> velocity quad)) 0 (none) ) -(defmethod set-heading! nav-state ((this nav-state) (arg0 vector)) +(defmethod set-heading! ((this nav-state) (arg0 vector)) (set! (-> this heading quad) (-> arg0 quad)) 0 (none) ) -(defmethod set-speed! nav-state ((this nav-state) (arg0 meters)) +(defmethod set-speed! ((this nav-state) (arg0 meters)) (set! (-> this speed) arg0) 0 (none) ) -(defmethod set-target-post! nav-state ((this nav-state) (arg0 vector)) +(defmethod set-target-post! ((this nav-state) (arg0 vector)) (logclear! (-> this flags) (nav-state-flag directional-mode)) (logior! (-> this flags) (nav-state-flag target-poly-dirty)) (set! (-> this target-post quad) (-> arg0 quad)) @@ -1855,26 +1852,26 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod set-travel! nav-state ((this nav-state) (arg0 vector)) +(defmethod set-travel! ((this nav-state) (arg0 vector)) (logior! (-> this flags) (nav-state-flag directional-mode)) (set! (-> this travel quad) (-> arg0 quad)) 0 (none) ) -(defmethod copy-nav-state! nav-state ((this nav-state) (arg0 (pointer nav-state))) +(defmethod copy-nav-state! ((this nav-state) (arg0 (pointer nav-state))) "Copies the [[nav-state]] the given pointer points to into the current object" (mem-copy! (the-as pointer this) arg0 176) 0 (none) ) -(defmethod nav-state-method-10 nav-state ((this nav-state)) +(defmethod nav-state-method-10 ((this nav-state)) 0 (none) ) -(defmethod debug-draw nav-state ((this nav-state)) +(defmethod debug-draw ((this nav-state)) (let ((s5-0 (-> this mesh))) (if (-> this next-poly) (debug-draw-poly s5-0 (-> this next-poly) *color-cyan*) @@ -1916,13 +1913,13 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod set-current-poly! nav-state ((this nav-state) (arg0 nav-poly)) +(defmethod set-current-poly! ((this nav-state) (arg0 nav-poly)) (set! (-> this current-poly) arg0) 0 (none) ) -(defmethod clamp-vector-to-mesh-cross-gaps nav-state ((this nav-state) (arg0 vector)) +(defmethod clamp-vector-to-mesh-cross-gaps ((this nav-state) (arg0 vector)) (when (-> this current-poly) (clamp-vector-to-mesh-cross-gaps (-> this nav) @@ -1937,7 +1934,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod do-navigation-to-destination nav-state ((this nav-state) (arg0 vector)) +(defmethod do-navigation-to-destination ((this nav-state) (arg0 vector)) (local-vars (v1-15 symbol)) (rlet ((acc :class vf) (Q :class vf) @@ -2047,7 +2044,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod try-projecting-to-current-poly nav-state ((this nav-state) (arg0 vector) (arg1 object) (arg2 vector)) +(defmethod try-projecting-to-current-poly ((this nav-state) (arg0 vector) (arg1 object) (arg2 vector)) (cond ((-> this current-poly) (let ((s5-0 (-> this nav)) @@ -2076,14 +2073,14 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod clamp-vector-to-mesh-cross-gaps nav-control ((this nav-control) - (arg0 vector) - (arg1 nav-poly) - (arg2 vector) - (arg3 float) - (arg4 symbol) - (arg5 clamp-travel-vector-to-mesh-return-info) - ) +(defmethod clamp-vector-to-mesh-cross-gaps ((this nav-control) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 float) + (arg4 symbol) + (arg5 clamp-travel-vector-to-mesh-return-info) + ) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> this state mesh bounds)) (clamp-vector-to-mesh-cross-gaps (-> this state mesh) v1-0 arg1 arg2 arg3 arg4 arg5) @@ -2092,7 +2089,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod cloest-point-on-mesh nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 nav-poly)) +(defmethod cloest-point-on-mesh ((this nav-control) (arg0 vector) (arg1 vector) (arg2 nav-poly)) (local-vars (sv-16 vector)) (set! sv-16 arg0) (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) @@ -2123,7 +2120,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (defmethod-mips2c "(method 39 nav-state)" 39 nav-state) -(defmethod nav-state-method-50 nav-state ((this nav-state)) +(defmethod nav-state-method-50 ((this nav-state)) 0 (none) ) @@ -2187,7 +2184,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod navigate-using-route-portals nav-state ((this nav-state)) +(defmethod navigate-using-route-portals ((this nav-state)) (local-vars (v1-117 float) (sv-112 vector) @@ -2376,7 +2373,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod navigate-using-best-dir-use-existing-avoid-spheres nav-state ((this nav-state) (arg0 nav-avoid-spheres-params)) +(defmethod navigate-using-best-dir-use-existing-avoid-spheres ((this nav-state) (arg0 nav-avoid-spheres-params)) (local-vars (sv-96 int) (sv-104 nav-mesh-work) @@ -2535,7 +2532,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod navigate-using-best-dir-recompute-avoid-spheres-1 nav-state ((this nav-state)) +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1 ((this nav-state)) (local-vars (sv-192 int) (sv-200 nav-mesh-work) @@ -2707,7 +2704,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod navigate-within-poly nav-state ((this nav-state)) +(defmethod navigate-within-poly ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -2824,7 +2821,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod clamp-travel-vector nav-state ((this nav-state)) +(defmethod clamp-travel-vector ((this nav-state)) (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) (clamp-vector-to-mesh-cross-gaps (-> this mesh) @@ -2859,7 +2856,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod plan-over-pat1-polys-using-route nav-state ((this nav-state) (arg0 nav-gap-info)) +(defmethod plan-over-pat1-polys-using-route ((this nav-state) (arg0 nav-gap-info)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (let ((a1-1 (-> this next-poly))) (when (logtest? (-> a1-1 pat) 1) @@ -2899,7 +2896,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod turn-and-navigate-to-destination nav-state ((this nav-state)) +(defmethod turn-and-navigate-to-destination ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -2958,25 +2955,25 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod navigate-using-route-portals-wrapper nav-state ((this nav-state)) +(defmethod navigate-using-route-portals-wrapper ((this nav-state)) (navigate-using-route-portals this) 0 (none) ) -(defmethod navigate-using-best-dir-recompute-avoid-spheres-1-wrapper nav-state ((this nav-state)) +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1-wrapper ((this nav-state)) (navigate-using-best-dir-recompute-avoid-spheres-1 this) 0 (none) ) -(defmethod navigate-within-poly-wrapper nav-state ((this nav-state)) +(defmethod navigate-within-poly-wrapper ((this nav-state)) (navigate-within-poly this) 0 (none) ) -(defmethod compute-travel-speed nav-state ((this nav-state)) +(defmethod compute-travel-speed ((this nav-state)) (local-vars (sv-192 float) (sv-196 float) (sv-200 float) (sv-204 float) (sv-224 vector)) (let ((s5-0 this)) (let ((s4-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) @@ -3045,7 +3042,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod navigate-v1! nav-state ((this nav-state)) +(defmethod navigate-v1! ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -3131,29 +3128,29 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod reset-target! nav-state ((this nav-state)) +(defmethod reset-target! ((this nav-state)) (vector-reset! (-> this target-dir)) 0 (none) ) -(defmethod add-offset-to-target! nav-state ((this nav-state) (arg0 vector)) +(defmethod add-offset-to-target! ((this nav-state) (arg0 vector)) (vector+! (-> this target-dir) (-> this target-dir) arg0) 0 (none) ) -(defmethod nav-state-method-29 nav-state ((this nav-state)) +(defmethod nav-state-method-29 ((this nav-state)) 0 (none) ) -(defmethod nav-state-method-30 nav-state ((this nav-state)) +(defmethod nav-state-method-30 ((this nav-state)) 0 (none) ) -(defmethod navigate-using-best-dir-recompute-avoid-spheres-2 nav-state ((this nav-state)) +(defmethod navigate-using-best-dir-recompute-avoid-spheres-2 ((this nav-state)) (local-vars (sv-192 int) (sv-200 nav-mesh-work) @@ -3330,7 +3327,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod update-travel-dir-from-spheres nav-state ((this nav-state)) +(defmethod update-travel-dir-from-spheres ((this nav-state)) (local-vars (v1-11 float) (v1-25 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -3392,7 +3389,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod compute-speed-simple nav-state ((this nav-state)) +(defmethod compute-speed-simple ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -3451,7 +3448,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod navigate-v2! nav-state ((this nav-state)) +(defmethod navigate-v2! ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) diff --git a/goal_src/jak2/engine/nav/nav-enemy-h.gc b/goal_src/jak2/engine/nav/nav-enemy-h.gc index 2cccf5287f9..70930dfbb35 100644 --- a/goal_src/jak2/engine/nav/nav-enemy-h.gc +++ b/goal_src/jak2/engine/nav/nav-enemy-h.gc @@ -20,107 +20,99 @@ ;; DECOMP BEGINS (deftype nav-enemy-info (enemy-info) - ((callback-info nav-callback-info :offset-assert 384) - (use-momentum symbol :offset-assert 388) - (use-frustration symbol :offset-assert 392) - (use-stop-chase symbol :offset-assert 396) - (use-circling symbol :offset-assert 400) - (use-pacing symbol :offset-assert 404) - (walk-anim int32 :offset-assert 408) - (turn-anim int32 :offset-assert 412) - (run-anim int32 :offset-assert 416) - (taunt-anim int32 :offset-assert 420) - (run-travel-speed meters :offset-assert 424) - (run-acceleration meters :offset-assert 428) - (run-turning-acceleration meters :offset-assert 432) - (walk-travel-speed meters :offset-assert 436) - (walk-acceleration meters :offset-assert 440) - (walk-turning-acceleration meters :offset-assert 444) - (maximum-rotation-rate degrees :offset-assert 448) - (notice-nav-radius meters :offset-assert 452) - (frustration-distance meters :offset-assert 456) - (frustration-time time-frame :offset-assert 464) - (blocked-time time-frame :offset-assert 472) - (circle-dist-lo float :offset-assert 480) - (circle-dist-hi float :offset-assert 484) - (nav-mesh nav-mesh :offset-assert 488) + ((callback-info nav-callback-info) + (use-momentum symbol) + (use-frustration symbol) + (use-stop-chase symbol) + (use-circling symbol) + (use-pacing symbol) + (walk-anim int32) + (turn-anim int32) + (run-anim int32) + (taunt-anim int32) + (run-travel-speed meters) + (run-acceleration meters) + (run-turning-acceleration meters) + (walk-travel-speed meters) + (walk-acceleration meters) + (walk-turning-acceleration meters) + (maximum-rotation-rate degrees) + (notice-nav-radius meters) + (frustration-distance meters) + (frustration-time time-frame) + (blocked-time time-frame) + (circle-dist-lo float) + (circle-dist-hi float) + (nav-mesh nav-mesh) ) - :method-count-assert 11 - :size-assert #x1ec - :flag-assert #xb000001ec (:methods - (copy-nav-enemy-info! (_type_ nav-enemy-info) none 10) + (copy-nav-enemy-info! (_type_ nav-enemy-info) none) ) ) (deftype nav-enemy (enemy) - ((enemy-info nav-enemy-info :override) - (frustration-point vector :inline :offset-assert 544) - (move-dest vector :inline :offset-assert 560) - (frustration-time time-frame :offset-assert 576) - (blocked-start-time time-frame :offset-assert 584) - (restore-nav-radius-time time-frame :offset-assert 592) - (nav-radius-backup float :offset-assert 600) + ((enemy-info nav-enemy-info :override) + (frustration-point vector :inline) + (move-dest vector :inline) + (frustration-time time-frame) + (blocked-start-time time-frame) + (restore-nav-radius-time time-frame) + (nav-radius-backup float) ) - :heap-base #x1e0 - :method-count-assert 178 - :size-assert #x25c - :flag-assert #xb201e0025c + (:state-methods + taunt + pacing + circling + stop-chase + debug-control + ) (:methods - (set-enemy-info! (_type_ nav-enemy-info) none :replace 112) - (init-enemy-behaviour-and-stats! (_type_ nav-enemy-info) none :replace 113) - (taunt () _type_ :state 137) - (pacing () _type_ :state 138) - (circling () _type_ :state 139) - (stop-chase () _type_ :state 140) - (debug-control () _type_ :state 141) - (nav-enemy-method-142 (_type_ nav-control) none 142) - (nav-enemy-method-143 (_type_ nav-control) none 143) - (nav-enemy-method-144 (_type_) time-frame :behavior nav-enemy 144) - (nav-enemy-method-145 (_type_ nav-control) none 145) - (nav-enemy-method-146 (_type_ nav-control) none 146) - (nav-enemy-method-147 (_type_ nav-control) none 147) - (nav-enemy-method-148 (_type_ nav-control) none 148) - (nav-enemy-method-149 (_type_ nav-control) none 149) - (nav-enemy-method-150 (_type_ nav-control) none 150) - (nav-enemy-method-151 (_type_ nav-control) none 151) - (nav-enemy-method-152 (_type_ nav-control) none 152) - (nav-enemy-method-153 (_type_ nav-control) none 153) - (nav-enemy-method-154 (_type_ nav-control) none 154) - (nav-enemy-method-155 (_type_) none 155) - (nav-enemy-method-156 (_type_) none 156) - (nav-enemy-method-157 (_type_ vector) nav-poly 157) - (nav-enemy-method-158 (_type_ vector) object 158) - (nav-enemy-method-159 (_type_ vector) symbol 159) - (nav-enemy-method-160 (_type_) none 160) - (nav-enemy-method-161 (_type_) none 161) - (nav-enemy-method-162 (_type_) none 162) - (nav-enemy-method-163 (_type_) symbol 163) - (nav-enemy-method-164 (_type_) none 164) - (nav-enemy-method-165 (_type_) none 165) - (nav-enemy-method-166 (_type_) none 166) - (nav-enemy-method-167 (_type_) none 167) - (nav-enemy-method-168 (_type_) float 168) - (nav-enemy-method-169 (_type_ float symbol) float 169) - (nav-enemy-method-170 (_type_) none 170) - (nav-enemy-method-171 (_type_) none 171) - (nav-enemy-method-172 (_type_) none 172) - (nav-enemy-method-173 (_type_) none 173) - (nav-enemy-method-174 (_type_) symbol 174) - (nav-enemy-method-175 (_type_) symbol 175) - (nav-enemy-method-176 (_type_) none :behavior nav-enemy 176) - (nav-enemy-method-177 (_type_) none 177) + (set-enemy-info! (_type_ nav-enemy-info) none :replace) + (init-enemy-behaviour-and-stats! (_type_ nav-enemy-info) none :replace) + (nav-enemy-method-142 (_type_ nav-control) none) + (nav-enemy-method-143 (_type_ nav-control) none) + (nav-enemy-method-144 (_type_) time-frame :behavior nav-enemy) + (nav-enemy-method-145 (_type_ nav-control) none) + (nav-enemy-method-146 (_type_ nav-control) none) + (nav-enemy-method-147 (_type_ nav-control) none) + (nav-enemy-method-148 (_type_ nav-control) none) + (nav-enemy-method-149 (_type_ nav-control) none) + (nav-enemy-method-150 (_type_ nav-control) none) + (nav-enemy-method-151 (_type_ nav-control) none) + (nav-enemy-method-152 (_type_ nav-control) none) + (nav-enemy-method-153 (_type_ nav-control) none) + (nav-enemy-method-154 (_type_ nav-control) none) + (nav-enemy-method-155 (_type_) none) + (nav-enemy-method-156 (_type_) none) + (nav-enemy-method-157 (_type_ vector) nav-poly) + (nav-enemy-method-158 (_type_ vector) object) + (nav-enemy-method-159 (_type_ vector) symbol) + (nav-enemy-method-160 (_type_) none) + (nav-enemy-method-161 (_type_) none) + (nav-enemy-method-162 (_type_) none) + (nav-enemy-method-163 (_type_) symbol) + (nav-enemy-method-164 (_type_) none) + (nav-enemy-method-165 (_type_) none) + (nav-enemy-method-166 (_type_) none) + (nav-enemy-method-167 (_type_) none) + (nav-enemy-method-168 (_type_) float) + (nav-enemy-method-169 (_type_ float symbol) float) + (nav-enemy-method-170 (_type_) none) + (nav-enemy-method-171 (_type_) none) + (nav-enemy-method-172 (_type_) none) + (nav-enemy-method-173 (_type_) none) + (nav-enemy-method-174 (_type_) symbol) + (nav-enemy-method-175 (_type_) symbol) + (nav-enemy-method-176 (_type_) none :behavior nav-enemy) + (nav-enemy-method-177 (_type_) none) ) ) (deftype nav-enemy-debug-control-info (basic) - ((enable basic :offset-assert 4) - (steering float :offset-assert 8) - (throttle float :offset-assert 12) + ((enable basic) + (steering float) + (throttle float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) diff --git a/goal_src/jak2/engine/nav/nav-enemy.gc b/goal_src/jak2/engine/nav/nav-enemy.gc index e885c2cab16..84e697a14fd 100644 --- a/goal_src/jak2/engine/nav/nav-enemy.gc +++ b/goal_src/jak2/engine/nav/nav-enemy.gc @@ -7,14 +7,14 @@ ;; DECOMP BEGINS -(defmethod copy-nav-enemy-info! nav-enemy-info ((this nav-enemy-info) (obj-to-copy nav-enemy-info)) +(defmethod copy-nav-enemy-info! ((this nav-enemy-info) (obj-to-copy nav-enemy-info)) "Copies the provided [[nav-enemy-info]] into the current object" (mem-copy! (&-> this type) (&-> obj-to-copy type) 492) 0 (none) ) -(defmethod enemy-method-61 nav-enemy ((this nav-enemy) (arg0 int)) +(defmethod enemy-method-61 ((this nav-enemy) (arg0 int)) (let* ((t9-0 (method-of-type enemy enemy-method-61)) (s5-0 (t9-0 this arg0)) ) @@ -25,7 +25,7 @@ ) ) -(defmethod general-event-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -59,7 +59,7 @@ ) ) -(defmethod nav-enemy-method-156 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-156 ((this nav-enemy)) (cond ((zero? (-> this path)) (go process-drawable-art-error "no path") @@ -94,7 +94,7 @@ (none) ) -(defmethod enemy-method-102 nav-enemy ((this nav-enemy)) +(defmethod enemy-method-102 ((this nav-enemy)) (let ((gp-0 (-> this root)) (s3-0 (-> this nav state)) ) @@ -136,7 +136,7 @@ ) ;; WARN: Return type mismatch vector vs symbol. -(defmethod enemy-method-100 nav-enemy ((this nav-enemy)) +(defmethod enemy-method-100 ((this nav-enemy)) (local-vars (v0-1 vector)) (when (not (-> this enemy-info move-to-ground)) (enemy-method-103 this) @@ -197,7 +197,7 @@ ) ) -(defmethod track-target! nav-enemy ((self nav-enemy)) +(defmethod track-target! ((self nav-enemy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -278,7 +278,7 @@ (none) ) -(defmethod nav-enemy-method-177 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-177 ((this nav-enemy)) (let ((v1-2 (-> this nav state current-poly))) (when (and v1-2 (logtest? (-> v1-2 pat) 4) (!= (-> v1-2 link) 255)) (let ((v1-6 (-> this nav state mesh link-array (-> v1-2 link) dest-mesh))) @@ -292,7 +292,7 @@ (none) ) -(defmethod nav-enemy-method-176 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-176 ((this nav-enemy)) (nav-enemy-method-177 this) (cond ((nav-enemy-method-174 this) @@ -341,7 +341,7 @@ (none) ) -(defmethod nav-enemy-method-145 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-145 ((this nav-enemy) (arg0 nav-control)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -403,40 +403,40 @@ ) ) -(defmethod nav-enemy-method-146 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-146 ((this nav-enemy) (arg0 nav-control)) (navigate-using-route-portals (-> arg0 state)) 0 0 (none) ) -(defmethod nav-enemy-method-147 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-147 ((this nav-enemy) (arg0 nav-control)) (navigate-using-best-dir-recompute-avoid-spheres-1 (-> arg0 state)) 0 0 (none) ) -(defmethod nav-enemy-method-148 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-148 ((this nav-enemy) (arg0 nav-control)) (navigate-within-poly (-> arg0 state)) 0 0 (none) ) -(defmethod nav-enemy-method-149 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-149 ((this nav-enemy) (arg0 nav-control)) (compute-travel-speed (-> arg0 state)) 0 (none) ) -(defmethod nav-enemy-method-155 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-155 ((this nav-enemy)) (navigate-v1! (-> this nav state)) 0 (none) ) -(defmethod nav-enemy-method-150 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-150 ((this nav-enemy) (arg0 nav-control)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -498,32 +498,32 @@ ) ) -(defmethod nav-enemy-method-151 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-151 ((this nav-enemy) (arg0 nav-control)) (navigate-using-route-portals (-> arg0 state)) 0 0 (none) ) -(defmethod nav-enemy-method-152 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-152 ((this nav-enemy) (arg0 nav-control)) (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg0 state)) 0 (none) ) -(defmethod nav-enemy-method-153 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-153 ((this nav-enemy) (arg0 nav-control)) (update-travel-dir-from-spheres (-> arg0 state)) 0 (none) ) -(defmethod nav-enemy-method-154 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-154 ((this nav-enemy) (arg0 nav-control)) (compute-speed-simple (-> arg0 state)) 0 (none) ) -(defmethod nav-enemy-method-142 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this nav-enemy) (arg0 nav-control)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) (set! (-> s5-0 quad) (-> a1-1 heading quad)) @@ -539,7 +539,7 @@ (none) ) -(defmethod nav-enemy-method-143 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-143 ((this nav-enemy) (arg0 nav-control)) (let ((v1-0 (new 'stack-no-clear 'vector))) (let ((a2-0 (-> arg0 state))) (set! (-> v1-0 quad) (-> a2-0 velocity quad)) @@ -820,7 +820,7 @@ ) ) -(defmethod nav-enemy-method-170 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-170 ((this nav-enemy)) (if (not (logtest? (enemy-flag enemy-flag36) (-> this enemy-flags))) (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> this enemy-flags)))) ) @@ -830,34 +830,34 @@ (none) ) -(defmethod nav-enemy-method-171 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-171 ((this nav-enemy)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> this nav callback-info) *nav-enemy-null-callback-info*) 0 (none) ) -(defmethod nav-enemy-method-172 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-172 ((this nav-enemy)) (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> this enemy-flags)))) 0 (none) ) -(defmethod nav-enemy-method-173 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-173 ((this nav-enemy)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag37)))) 0 (none) ) -(defmethod nav-enemy-method-174 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-174 ((this nav-enemy)) (logtest? (enemy-flag enemy-flag36) (-> this enemy-flags)) ) -(defmethod nav-enemy-method-175 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-175 ((this nav-enemy)) (logtest? (enemy-flag enemy-flag37) (-> this enemy-flags)) ) -(defmethod nav-enemy-method-157 nav-enemy ((this nav-enemy) (arg0 vector)) +(defmethod nav-enemy-method-157 ((this nav-enemy) (arg0 vector)) (let ((v1-0 (-> this nav)) (a0-1 arg0) (a1-1 (new 'stack-no-clear 'nav-find-poly-parms)) @@ -869,7 +869,7 @@ ) ) -(defmethod nav-enemy-method-158 nav-enemy ((this nav-enemy) (arg0 vector)) +(defmethod nav-enemy-method-158 ((this nav-enemy) (arg0 vector)) (let ((f1-0 (-> this root trans y)) (f0-0 (-> arg0 y)) (v1-1 (-> this fact)) @@ -889,7 +889,7 @@ ) ) -(defmethod nav-enemy-method-159 nav-enemy ((this nav-enemy) (arg0 vector)) +(defmethod nav-enemy-method-159 ((this nav-enemy) (arg0 vector)) (let ((f1-0 (-> this root trans y)) (f0-0 (-> arg0 y)) (v1-1 (-> this fact)) @@ -902,7 +902,7 @@ ) ) -(defmethod in-aggro-range? nav-enemy ((this nav-enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this nav-enemy) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -930,7 +930,7 @@ ) ) -(defmethod nav-enemy-method-161 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-161 ((this nav-enemy)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag not-frustrated)))) (set-time! (-> this frustration-time)) (let ((v1-7 (handle->process (-> this focus handle)))) @@ -943,7 +943,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-enemy-method-160 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-160 ((this nav-enemy)) (let ((s5-0 (handle->process (-> this focus handle)))) (cond ((or (not s5-0) @@ -965,19 +965,19 @@ (none) ) -(defmethod nav-enemy-method-162 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-162 ((this nav-enemy)) (set! (-> this blocked-start-time) 0) 0 (none) ) -(defmethod nav-enemy-method-163 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-163 ((this nav-enemy)) (let ((v1-0 (-> this blocked-start-time))) (and (nonzero? v1-0) (time-elapsed? v1-0 (-> this enemy-info blocked-time))) ) ) -(defmethod nav-enemy-method-164 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-164 ((this nav-enemy)) (if (-> this enemy-info use-momentum) (logior! (-> this nav flags) (nav-control-flag use-momentum)) (logclear! (-> this nav flags) (nav-control-flag use-momentum)) @@ -986,7 +986,7 @@ (none) ) -(defmethod nav-enemy-method-167 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-167 ((this nav-enemy)) (let ((v1-0 (-> this nav))) (set! (-> v1-0 target-speed) 0.0) ) @@ -1003,7 +1003,7 @@ (none) ) -(defmethod nav-enemy-method-165 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-165 ((this nav-enemy)) (let ((v1-0 (-> this nav))) (set! (-> v1-0 target-speed) (-> this enemy-info walk-travel-speed)) ) @@ -1020,7 +1020,7 @@ (none) ) -(defmethod nav-enemy-method-166 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-166 ((this nav-enemy)) (let ((v1-0 (-> this nav))) (set! (-> v1-0 target-speed) (-> this enemy-info run-travel-speed)) ) @@ -1038,7 +1038,7 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod set-enemy-info! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) +(defmethod set-enemy-info! ((this nav-enemy) (arg0 nav-enemy-info)) "In addition to setting the `enemy-info`, also init the `neck-joint` if applicable from it @param info Set `enemy-info` accordingly" (set! (-> this enemy-info) arg0) @@ -1057,7 +1057,7 @@ (none) ) -(defmethod init-enemy-behaviour-and-stats! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) +(defmethod init-enemy-behaviour-and-stats! ((this nav-enemy) (arg0 nav-enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (local-vars (sv-16 res-tag)) (when (coin-flip? this) @@ -1234,7 +1234,7 @@ (none) ) -(defmethod init-from-entity! nav-enemy ((this nav-enemy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nav-enemy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1390,7 +1390,7 @@ This commonly includes things such as: (none) ) -(defmethod nav-enemy-method-169 nav-enemy ((this nav-enemy) (arg0 float) (arg1 symbol)) +(defmethod nav-enemy-method-169 ((this nav-enemy) (arg0 float) (arg1 symbol)) (if arg1 (set! (-> this nav-radius-backup) arg0) ) @@ -1399,14 +1399,14 @@ This commonly includes things such as: ) ) -(defmethod nav-enemy-method-168 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-168 ((this nav-enemy)) (if (zero? (-> this restore-nav-radius-time)) (set! (-> this root nav-radius) (-> this nav-radius-backup)) ) ) ;; WARN: Return type mismatch int vs time-frame. -(defmethod nav-enemy-method-144 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-144 ((this nav-enemy)) (set! (-> this root nav-radius) 4.096) (let ((s5-1 (max (-> this restore-nav-radius-time) (+ (current-time) (get-rand-int-range this 1500 2400))))) (set! (-> this restore-nav-radius-time) (the-as time-frame s5-1)) @@ -1474,14 +1474,14 @@ This commonly includes things such as: (none) ) -(defmethod go-stare2 nav-enemy ((this nav-enemy)) +(defmethod go-stare2 ((this nav-enemy)) (if (!= (-> this enemy-info taunt-anim) -1) (go (method-of-object this taunt)) ) (go (method-of-object this stare)) ) -(defmethod go-stare nav-enemy ((this nav-enemy)) +(defmethod go-stare ((this nav-enemy)) (let ((s5-0 (-> this focus aware))) (cond ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) @@ -1502,7 +1502,7 @@ This commonly includes things such as: ) ) -(defmethod go-hostile nav-enemy ((this nav-enemy)) +(defmethod go-hostile ((this nav-enemy)) (if (or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) (nav-enemy-method-163 this) ) @@ -1511,7 +1511,7 @@ This commonly includes things such as: ) ) -(defmethod go-flee nav-enemy ((this nav-enemy)) +(defmethod go-flee ((this nav-enemy)) (go (method-of-object this flee)) ) @@ -2548,7 +2548,7 @@ This commonly includes things such as: :post nav-enemy-die-falling-post ) -(defmethod enemy-method-82 nav-enemy ((this nav-enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-82 ((this nav-enemy) (arg0 enemy-jump-info)) "@abstract" (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) @@ -2558,7 +2558,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod enemy-method-92 nav-enemy ((this nav-enemy) (arg0 int) (arg1 nav-poly)) +(defmethod enemy-method-92 ((this nav-enemy) (arg0 int) (arg1 nav-poly)) "TODO - nav-poly is a guess @abstract" (let ((v1-0 arg0)) diff --git a/goal_src/jak2/engine/nav/nav-mesh-h.gc b/goal_src/jak2/engine/nav/nav-mesh-h.gc index f091e9dc303..ea429dd95ce 100644 --- a/goal_src/jak2/engine/nav/nav-mesh-h.gc +++ b/goal_src/jak2/engine/nav/nav-mesh-h.gc @@ -20,89 +20,77 @@ ;; DECOMP BEGINS (deftype nav-mesh-work-debug (structure) - ((debug-vec1 vector :inline :offset-assert 0) - (debug-vec2 vector :inline :offset-assert 16) - (debug-vec3 vector :inline :offset-assert 32) - (debug-vec4 vector :inline :offset-assert 48) - (debug-vec5 vector :inline :offset-assert 64) - (debug-vec6 vector :inline :offset-assert 80) - (debug-vec7 vector :inline :offset-assert 96) - (debug-vec8 vector :inline :offset-assert 112) - (debug-vec9 vector :inline :offset-assert 128) - (debug-vec10 vector :inline :offset-assert 144) - (debug-vec11 vector :inline :offset-assert 160) - (debug-vec12 vector :inline :offset-assert 176) - (sphere-array sphere 16 :inline :offset-assert 192) + ((debug-vec1 vector :inline) + (debug-vec2 vector :inline) + (debug-vec3 vector :inline) + (debug-vec4 vector :inline) + (debug-vec5 vector :inline) + (debug-vec6 vector :inline) + (debug-vec7 vector :inline) + (debug-vec8 vector :inline) + (debug-vec9 vector :inline) + (debug-vec10 vector :inline) + (debug-vec11 vector :inline) + (debug-vec12 vector :inline) + (sphere-array sphere 16 :inline) ) - :method-count-assert 9 - :size-assert #x1c0 - :flag-assert #x9000001c0 ) (deftype nav-mesh-work (structure) - ((vert0-table int8 4 :offset-assert 0) - (vert1-table int8 4 :offset-assert 4) - (edge-mask-table uint8 3 :offset-assert 8) - (pad0 uint32 :offset-assert 12) - (deg-to-rad float :offset-assert 16) - (rad-to-deg float :offset-assert 20) - (nav-poly-min-dist float :offset-assert 24) - (nav-poly-epsilon float :offset-assert 28) - (sphere-array sphere 16 :inline :offset-assert 32) - (debug nav-mesh-work-debug :offset-assert 288) - (work-struct-in-scratch int8 :offset-assert 292) - (mesh-struct-in-scratch int8 :offset-assert 293) - (polys-in-scratch int8 :offset-assert 294) - (mesh nav-mesh :offset-assert 296) - (nav basic :offset-assert 300) - (poly0 nav-poly :offset-assert 304) - (poly1 nav-poly :offset-assert 308) - (poly-id int32 :offset-assert 312) + ((vert0-table int8 4) + (vert1-table int8 4) + (edge-mask-table uint8 3) + (pad0 uint32) + (deg-to-rad float) + (rad-to-deg float) + (nav-poly-min-dist float) + (nav-poly-epsilon float) + (sphere-array sphere 16 :inline) + (debug nav-mesh-work-debug) + (work-struct-in-scratch int8) + (mesh-struct-in-scratch int8) + (polys-in-scratch int8) + (mesh nav-mesh) + (nav basic) + (poly0 nav-poly) + (poly1 nav-poly) + (poly-id int32) ) - :method-count-assert 9 - :size-assert #x13c - :flag-assert #x90000013c ) (deftype nav-mesh-link (structure) - ((id uint32 :offset-assert 0) - (dest-mesh-id uint32 :offset-assert 4) - (src-link-poly-id uint8 :offset-assert 8) - (src-switch-poly-id uint8 :offset-assert 9) - (dest-link-poly-id uint8 :offset-assert 10) - (dest-switch-poly-id uint8 :offset-assert 11) - (dest-mesh nav-mesh :offset-assert 12) + ((id uint32) + (dest-mesh-id uint32) + (src-link-poly-id uint8) + (src-switch-poly-id uint8) + (dest-link-poly-id uint8) + (dest-switch-poly-id uint8) + (dest-mesh nav-mesh) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype nav-poly (structure) - ((data uint8 64 :offset-assert 0) - (vertex vector 4 :inline :offset 0) - (vertex0 vector :inline :offset 0) - (vertex1 vector :inline :offset 16) - (vertex2 vector :inline :offset 32) - (vertex3 vector :inline :offset 48) - (id uint8 :offset 12) - (pat uint8 :offset 13) - (vertex-count uint8 :offset 14) - (link uint8 :offset 15) - (adj-poly uint8 4 :offset 28) - (adj-poly0 uint8 :offset 28) - (adj-poly1 uint8 :offset 29) - (adj-poly2 uint8 :offset 30) - (adj-poly3 uint8 :offset 31) - (min-y float :offset 44) - (max-y float :offset 60) + ((data uint8 64) + (vertex vector 4 :inline :overlay-at (-> data 0)) + (vertex0 vector :inline :overlay-at (-> data 0)) + (vertex1 vector :inline :overlay-at (-> data 16)) + (vertex2 vector :inline :overlay-at (-> data 32)) + (vertex3 vector :inline :overlay-at (-> data 48)) + (id uint8 :overlay-at (-> data 12)) + (pat uint8 :overlay-at (-> data 13)) + (vertex-count uint8 :overlay-at (-> data 14)) + (link uint8 :overlay-at (-> data 15)) + (adj-poly uint8 4 :overlay-at (-> data 28)) + (adj-poly0 uint8 :overlay-at (-> data 28)) + (adj-poly1 uint8 :overlay-at (-> data 29)) + (adj-poly2 uint8 :overlay-at (-> data 30)) + (adj-poly3 uint8 :overlay-at (-> data 31)) + (min-y float :overlay-at (-> data 44)) + (max-y float :overlay-at (-> data 60)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) @@ -110,155 +98,134 @@ "A typedef for `vector`, not used because our code looks nicer if everything is `vector`s anyway and declared out of order (cannot use forward declared structures in inline arrays)" () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype nav-sphere (structure) - ((trans sphere :inline :offset-assert 0) + ((trans sphere :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype nav-ray (structure) - ((current-pos vector :inline :offset-assert 0) - (dir vector :inline :offset-assert 16) - (dest-pos vector :inline :offset-assert 32) - (current-poly nav-poly :offset-assert 48) - (next-poly nav-poly :offset-assert 52) - (len meters :offset-assert 56) - (last-edge int8 :offset-assert 60) - (ignore uint8 :offset-assert 61) - (terminated symbol :offset-assert 64) - (reached-dest symbol :offset-assert 68) - (hit-boundary symbol :offset-assert 72) - (hit-gap symbol :offset-assert 76) + ((current-pos vector :inline) + (dir vector :inline) + (dest-pos vector :inline) + (current-poly nav-poly) + (next-poly nav-poly) + (len meters) + (last-edge int8) + (ignore uint8) + (terminated symbol) + (reached-dest symbol) + (hit-boundary symbol) + (hit-gap symbol) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype nav-route-portal (structure) - ((vertex nav-vertex 2 :inline :offset-assert 0) - (next-poly nav-poly :offset-assert 32) - (edge-index int8 :offset-assert 36) + ((vertex nav-vertex 2 :inline) + (next-poly nav-poly) + (edge-index int8) ) - :method-count-assert 9 - :size-assert #x25 - :flag-assert #x900000025 ) (deftype nav-find-poly-parms (structure) - ((point vector :inline :offset-assert 0) - (y-threshold float :offset-assert 16) - (ignore uint8 :offset-assert 20) - (poly nav-poly :offset-assert 24) - (dist float :offset-assert 28) - (point-inside? symbol :offset-assert 32) + ((point vector :inline) + (y-threshold float) + (ignore uint8) + (poly nav-poly) + (dist float) + (point-inside? symbol) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) (deftype clamp-travel-vector-to-mesh-return-info (structure) - ((found-boundary symbol :offset-assert 0) - (intersection vector :inline :offset-assert 16) - (boundary-normal vector :inline :offset-assert 32) - (prev-normal vector :inline :offset-assert 48) - (next-normal vector :inline :offset-assert 64) - (poly nav-poly :offset-assert 80) - (gap-poly nav-poly :offset-assert 84) - (edge int8 :offset-assert 88) - (ignore uint8 :offset-assert 89) - (vert-prev vector :inline :offset-assert 96) - (vert-0 vector :inline :offset-assert 112) - (vert-1 vector :inline :offset-assert 128) - (vert-next vector :inline :offset-assert 144) + ((found-boundary symbol) + (intersection vector :inline) + (boundary-normal vector :inline) + (prev-normal vector :inline) + (next-normal vector :inline) + (poly nav-poly) + (gap-poly nav-poly) + (edge int8) + (ignore uint8) + (vert-prev vector :inline) + (vert-0 vector :inline) + (vert-1 vector :inline) + (vert-next vector :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) (deftype nav-mesh (basic) - ((work nav-mesh-work :offset-assert 4) - (poly-array (inline-array nav-poly) :offset-assert 8) - (static-sphere-count uint8 :offset-assert 12) - (poly-count uint8 :offset-assert 13) - (nav-control-count uint8 :offset-assert 14) - (max-nav-control-count uint8 :offset-assert 15) - (route (pointer nav-poly) :offset-assert 16) - (poly-hash grid-hash :offset-assert 20) - (nav-control-array (inline-array nav-control) :offset-assert 24) - (sphere-hash sphere-hash :offset-assert 28) - (static-sphere (inline-array sphere) :offset-assert 32) - (user-list engine :offset-assert 36) - (next-nav-mesh surface :offset-assert 40) - (prev-nav-mesh surface :offset-assert 44) - (bounds vector :inline :offset-assert 48) - (origin vector :inline :offset 48) - (entity entity :offset-assert 64) - (link-array (inline-array nav-mesh-link) :offset-assert 68) - (link-count uint8 :offset-assert 72) - (flags nav-mesh-flag :offset-assert 73) - (pad1 uint8 2 :offset-assert 74) - (nearest-y-threshold meters :offset-assert 76) - (water-max-height meters :offset-assert 80) - (pad2 uint32 7 :offset-assert 84) + ((work nav-mesh-work) + (poly-array (inline-array nav-poly)) + (static-sphere-count uint8) + (poly-count uint8) + (nav-control-count uint8) + (max-nav-control-count uint8) + (route (pointer nav-poly)) + (poly-hash grid-hash) + (nav-control-array (inline-array nav-control)) + (sphere-hash sphere-hash) + (static-sphere (inline-array sphere)) + (user-list engine) + (next-nav-mesh surface) + (prev-nav-mesh surface) + (bounds vector :inline) + (origin vector :inline :overlay-at bounds) + (entity entity) + (link-array (inline-array nav-mesh-link)) + (link-count uint8) + (flags nav-mesh-flag) + (pad1 uint8 2) + (nearest-y-threshold meters) + (water-max-height meters) + (pad2 uint32 7) ) - :method-count-assert 47 - :size-assert #x70 - :flag-assert #x2f00000070 (:methods - (debug-draw (_type_) none 9) - (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly 10) - (poly-centroid (_type_ nav-poly vector) vector 11) - (poly-centroid-local (_type_ nav-poly vector) vector 12) - (lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly 13) - (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex) 14) - (initialize-mesh! (_type_) none 15) - (move-along-nav-ray! (_type_ nav-ray) none 16) - (try-move-along-ray (_type_ nav-poly vector vector float) meters 17) - (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 18) - (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none 19) - (set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none 20) - (find-adjacent-bounds-one (_type_ vector nav-poly int int) none 21) - (compute-bounding-box-from-vertices (_type_ vector vector) none 22) - (init-from-entity (_type_ entity-nav-mesh) none 23) - (handle-birth (_type_) none 24) - (handle-kill (_type_) none 25) - (update-navigation (_type_) none 26) - (new-nav-control (_type_ process-drawable) nav-control 27) - (remove-nav-control (_type_ nav-control) none 28) - (add-process-drawable-to-navmesh (_type_ process-drawable symbol) none 29) - (remove-process-drawable (_type_ process-drawable) none 30) - (change-to (_type_ process-drawable) none 31) - (link-by-id (_type_ uint) symbol 32) - (unlink-by-id (_type_ uint) symbol 33) - (nav-mesh-method-34 (_type_ vector vector float) float 34) - (nav-mesh-method-35 (_type_ vector vector float) float 35) - (debug-draw-poly (_type_ nav-poly rgba) none 36) - (point-in-poly? (_type_ nav-poly vector) symbol 37) - (nav-mesh-method-38 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector 38) - (closest-point-on-boundary (_type_ nav-poly vector vector) none 39) - (project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none 40) - (project-point-into-poly-2d (_type_ nav-poly vector vector) none 41) - (find-poly-containing-point-local (_type_ nav-find-poly-parms) nav-poly 42) - (find-nearest-poly-to-point-local (_type_ nav-find-poly-parms) nav-find-poly-parms 43) - (is-in-mesh-local? (_type_ vector float float) symbol 44) - (link-to-other-mesh (_type_ nav-mesh-link) symbol 45) - (unlink-mesh (_type_ nav-mesh-link) none 46) + (debug-draw (_type_) none) + (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly) + (poly-centroid (_type_ nav-poly vector) vector) + (poly-centroid-local (_type_ nav-poly vector) vector) + (lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly) + (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex)) + (initialize-mesh! (_type_) none) + (move-along-nav-ray! (_type_ nav-ray) none) + (try-move-along-ray (_type_ nav-poly vector vector float) meters) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) + (set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none) + (find-adjacent-bounds-one (_type_ vector nav-poly int int) none) + (compute-bounding-box-from-vertices (_type_ vector vector) none) + (init-from-entity (_type_ entity-nav-mesh) none) + (handle-birth (_type_) none) + (handle-kill (_type_) none) + (update-navigation (_type_) none) + (new-nav-control (_type_ process-drawable) nav-control) + (remove-nav-control (_type_ nav-control) none) + (add-process-drawable-to-navmesh (_type_ process-drawable symbol) none) + (remove-process-drawable (_type_ process-drawable) none) + (change-to (_type_ process-drawable) none) + (link-by-id (_type_ uint) symbol) + (unlink-by-id (_type_ uint) symbol) + (nav-mesh-method-34 (_type_ vector vector float) float) + (nav-mesh-method-35 (_type_ vector vector float) float) + (debug-draw-poly (_type_ nav-poly rgba) none) + (point-in-poly? (_type_ nav-poly vector) symbol) + (nav-mesh-method-38 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector) + (closest-point-on-boundary (_type_ nav-poly vector vector) none) + (project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none) + (project-point-into-poly-2d (_type_ nav-poly vector vector) none) + (find-poly-containing-point-local (_type_ nav-find-poly-parms) nav-poly) + (find-nearest-poly-to-point-local (_type_ nav-find-poly-parms) nav-find-poly-parms) + (is-in-mesh-local? (_type_ vector float float) symbol) + (link-to-other-mesh (_type_ nav-mesh-link) symbol) + (unlink-mesh (_type_ nav-mesh-link) none) ) ) @@ -397,7 +364,7 @@ and declared out of order (cannot use forward declared structures in inline arra #t ) -(defmethod point-in-poly? nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod point-in-poly? ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (let* ((a3-0 this) (v1-0 arg1) (a0-1 (-> arg0 vertex-count)) @@ -424,7 +391,7 @@ and declared out of order (cannot use forward declared structures in inline arra ) ;; WARN: Return type mismatch vector vs none. -(defmethod closest-point-on-boundary nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod closest-point-on-boundary ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (set! sv-48 (new 'stack-no-clear 'vector)) (set! sv-52 (new 'stack-no-clear 'vector)) @@ -447,7 +414,7 @@ and declared out of order (cannot use forward declared structures in inline arra ) ;; WARN: Return type mismatch vector vs none. -(defmethod project-point-into-poly-2d nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-poly-2d ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (cond ((point-in-poly? this arg0 arg2) @@ -478,7 +445,7 @@ and declared out of order (cannot use forward declared structures in inline arra (none) ) -(defmethod move-along-nav-ray! nav-mesh ((this nav-mesh) (ray nav-ray)) +(defmethod move-along-nav-ray! ((this nav-mesh) (ray nav-ray)) (local-vars (next-poly-idx int) (work nav-mesh-work) diff --git a/goal_src/jak2/engine/nav/nav-mesh.gc b/goal_src/jak2/engine/nav/nav-mesh.gc index 8fe0390249f..3dc13bc2bc3 100644 --- a/goal_src/jak2/engine/nav/nav-mesh.gc +++ b/goal_src/jak2/engine/nav/nav-mesh.gc @@ -339,7 +339,7 @@ (none) ) -(defmethod initialize-nav-mesh! entity-nav-mesh ((this entity-nav-mesh)) +(defmethod initialize-nav-mesh! ((this entity-nav-mesh)) "Initialize the nav-mesh in this entity." (let ((v1-0 (-> this nav-mesh))) (if (nonzero? v1-0) @@ -350,7 +350,7 @@ (none) ) -(defmethod birth! entity-nav-mesh ((this entity-nav-mesh)) +(defmethod birth! ((this entity-nav-mesh)) (let ((a0-1 (-> this nav-mesh))) (if (nonzero? a0-1) (handle-birth a0-1) @@ -359,14 +359,14 @@ this ) -(defmethod kill! entity-nav-mesh ((this entity-nav-mesh)) +(defmethod kill! ((this entity-nav-mesh)) (if (-> this nav-mesh) (handle-kill (-> this nav-mesh)) ) this ) -(defmethod debug-draw entity-nav-mesh ((this entity-nav-mesh)) +(defmethod debug-draw ((this entity-nav-mesh)) (add-debug-x #t (bucket-id debug-no-zbuf1) @@ -412,7 +412,7 @@ (none) ) -(defmethod get-simple-travel-vector entity-actor ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 object) (arg4 float)) +(defmethod get-simple-travel-vector ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 object) (arg4 float)) (local-vars (at-0 int) (at-1 int)) (with-pp (rlet ((vf0 :class vf) @@ -480,7 +480,7 @@ ) ) -(defmethod project-point-to-nav-mesh entity-actor ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 nav-poly) (arg3 float)) +(defmethod project-point-to-nav-mesh ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 nav-poly) (arg3 float)) (local-vars (sv-16 vector)) (let ((gp-0 (nav-mesh-from-res-tag this 'nav-mesh-actor 0))) (cond @@ -510,11 +510,11 @@ ) ;; WARN: Return type mismatch uint vs int. -(defmethod length nav-mesh ((this nav-mesh)) +(defmethod length ((this nav-mesh)) (the-as int (-> this poly-count)) ) -(defmethod debug-draw-poly nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) +(defmethod debug-draw-poly ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) (set! (-> gp-0 0 quad) (-> this bounds quad)) (if (logtest? (-> arg0 pat) 7) @@ -559,7 +559,7 @@ (none) ) -(defmethod new-nav-control nav-mesh ((this nav-mesh) (arg0 process-drawable)) +(defmethod new-nav-control ((this nav-mesh) (arg0 process-drawable)) (let ((gp-0 (the-as nav-control #f))) (dotimes (v1-0 (the-as int (-> this nav-control-count))) (let ((a1-2 (-> this nav-control-array v1-0))) @@ -592,7 +592,7 @@ ) ) -(defmethod remove-nav-control nav-mesh ((this nav-mesh) (arg0 nav-control)) +(defmethod remove-nav-control ((this nav-mesh) (arg0 nav-control)) (set! (-> arg0 process) #f) (let ((v1-1 (+ (-> this nav-control-count) -1))) (while (and (>= v1-1 0) (not (-> this nav-control-array v1-1 process))) @@ -604,7 +604,7 @@ (none) ) -(defmethod add-process-drawable-to-navmesh nav-mesh ((this nav-mesh) (arg0 process-drawable) (arg1 symbol)) +(defmethod add-process-drawable-to-navmesh ((this nav-mesh) (arg0 process-drawable) (arg1 symbol)) (if arg1 (change-to this arg0) (add-connection (-> this user-list) arg0 nothing arg0 #f (-> arg0 root)) @@ -613,7 +613,7 @@ (none) ) -(defmethod remove-process-drawable nav-mesh ((this nav-mesh) (arg0 process-drawable)) +(defmethod remove-process-drawable ((this nav-mesh) (arg0 process-drawable)) (remove-from-process (-> this user-list) arg0) (let ((a1-2 (-> arg0 nav))) (when (nonzero? a1-2) @@ -625,7 +625,7 @@ (none) ) -(defmethod change-to nav-mesh ((this nav-mesh) (arg0 process-drawable)) +(defmethod change-to ((this nav-mesh) (arg0 process-drawable)) (local-vars (v1-5 symbol)) (let ((gp-0 arg0)) (b! (nonzero? (-> this user-list)) cfg-2 :delay (empty-form)) @@ -678,7 +678,7 @@ (none) ) -(defmethod link-to-other-mesh nav-mesh ((this nav-mesh) (arg0 nav-mesh-link)) +(defmethod link-to-other-mesh ((this nav-mesh) (arg0 nav-mesh-link)) (when (not (-> arg0 dest-mesh)) (let* ((s4-0 (entity-nav-mesh-by-aid (the-as actor-id (-> arg0 dest-mesh-id)))) (v1-1 (if (type? s4-0 entity-nav-mesh) @@ -716,7 +716,7 @@ ) ) -(defmethod unlink-mesh nav-mesh ((this nav-mesh) (arg0 nav-mesh-link)) +(defmethod unlink-mesh ((this nav-mesh) (arg0 nav-mesh-link)) (let ((a0-1 (-> arg0 dest-mesh))) (when a0-1 (let ((v1-0 (the-as nav-mesh-link #f))) @@ -742,7 +742,7 @@ (none) ) -(defmethod link-by-id nav-mesh ((this nav-mesh) (arg0 uint)) +(defmethod link-by-id ((this nav-mesh) (arg0 uint)) "arg1 is a [[nav-mesh-link]] `id`" (let ((v1-0 (the-as nav-mesh-link #f))) (dotimes (a2-0 (the-as int (-> this link-count))) @@ -760,7 +760,7 @@ ) ) -(defmethod unlink-by-id nav-mesh ((this nav-mesh) (arg0 uint)) +(defmethod unlink-by-id ((this nav-mesh) (arg0 uint)) "arg1 is a [[nav-mesh-link]] `id`" (let ((v1-0 (the-as nav-mesh-link #f))) (dotimes (a2-0 (the-as int (-> this link-count))) @@ -779,7 +779,7 @@ ) ) -(defmethod init-from-entity nav-mesh ((this nav-mesh) (arg0 entity-nav-mesh)) +(defmethod init-from-entity ((this nav-mesh) (arg0 entity-nav-mesh)) "Initialize this mesh from an entity." (local-vars (sv-16 res-tag)) (set! (-> this entity) arg0) @@ -813,7 +813,7 @@ (none) ) -(defmethod handle-birth nav-mesh ((this nav-mesh)) +(defmethod handle-birth ((this nav-mesh)) "Handle the parent nav-mesh-entity birth." (dotimes (s5-0 (the-as int (-> this link-count))) (let ((a1-0 (-> this link-array s5-0))) @@ -826,7 +826,7 @@ (none) ) -(defmethod handle-kill nav-mesh ((this nav-mesh)) +(defmethod handle-kill ((this nav-mesh)) "Handle the parent nav-mesh-entity kill." (when (nonzero? (-> this user-list)) (countdown (s5-0 (-> this nav-control-count)) @@ -854,23 +854,20 @@ ) (deftype nav-engine-spr-buffer (structure) - ((mem-addr (pointer nav-mesh) :offset-assert 0) - (mem-nav uint32 :offset 0) - (spr-addr (inline-array nav-control) :offset-assert 4) - (spr-nav uint32 :offset 4) - (q-size uint32 :offset-assert 8) - (i-nav uint8 :offset-assert 12) - (done int8 :offset-assert 13) - (nav-count int8 :offset-assert 14) - (i-pass int8 :offset-assert 15) + ((mem-addr (pointer nav-mesh)) + (mem-nav uint32 :overlay-at mem-addr) + (spr-addr (inline-array nav-control)) + (spr-nav uint32 :overlay-at spr-addr) + (q-size uint32) + (i-nav uint8) + (done int8) + (nav-count int8) + (i-pass int8) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) -(defmethod inspect nav-engine-spr-buffer ((this nav-engine-spr-buffer)) +(defmethod inspect ((this nav-engine-spr-buffer)) (when (not this) (set! this this) (goto cfg-4) @@ -890,48 +887,45 @@ ) (deftype nav-engine (structure) - ((spr-addr uint32 :offset-assert 0) - (nav-work-addr uint32 :offset-assert 4) - (nav-mesh-addr nav-mesh :offset-assert 8) - (poly-array-addr uint32 :offset-assert 12) - (hash-sphere-addr uint32 :offset-assert 16) - (hash-buckets-addr uint32 :offset-assert 20) - (buf-nav-control-count int8 :offset-assert 24) - (max-pass-count int8 :offset-assert 25) - (output-sphere-hash uint8 :offset-assert 26) - (work-buf-array nav-engine-spr-buffer 3 :inline :offset-assert 28) - (spr-work nav-mesh-work :offset 4) - (mem-work nav-mesh-work :offset-assert 76) - (spr-mesh nav-mesh :offset 8) - (mem-mesh nav-mesh :offset-assert 80) - (spr-poly-array uint32 :offset 12) - (mem-poly-array (inline-array nav-poly) :offset-assert 84) - (hash-sphere-list uint32 :offset 16) - (hash-buckets uint32 :offset 20) - (to-spr-wait uint32 :offset-assert 88) - (from-spr-wait uint32 :offset-assert 92) + ((spr-addr uint32) + (nav-work-addr uint32) + (nav-mesh-addr nav-mesh) + (poly-array-addr uint32) + (hash-sphere-addr uint32) + (hash-buckets-addr uint32) + (buf-nav-control-count int8) + (max-pass-count int8) + (output-sphere-hash uint8) + (work-buf-array nav-engine-spr-buffer 3 :inline) + (spr-work nav-mesh-work :overlay-at nav-work-addr) + (mem-work nav-mesh-work) + (spr-mesh nav-mesh :overlay-at nav-mesh-addr) + (mem-mesh nav-mesh) + (spr-poly-array uint32 :overlay-at poly-array-addr) + (mem-poly-array (inline-array nav-poly)) + (hash-sphere-list uint32 :overlay-at hash-sphere-addr) + (hash-buckets uint32 :overlay-at hash-buckets-addr) + (to-spr-wait uint32) + (from-spr-wait uint32) ) - :method-count-assert 22 - :size-assert #x60 - :flag-assert #x1600000060 (:methods - (inc-spr-addr! (_type_ uint) uint 9) - (lay-out-spad-memory (_type_ nav-mesh) none 10) - (set-up-mem-work (_type_) none 11) - (add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none 12) - (add-all-spheres (_type_) none 13) - (do-sphere-lookups (_type_) none 14) - (update-nav-controls-pipelined-in-spr (_type_) none 15) - (update-nav-controls-in-spr (_type_) none 16) - (upload-nav-to-spr (_type_ nav-engine-spr-buffer) none 17) - (download-nav-from-spr (_type_ nav-engine-spr-buffer) none 18) - (do-callbacks (_type_ nav-engine-spr-buffer) none 19) - (reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none 20) - (reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none 21) - ) - ) - -(defmethod inspect nav-engine ((this nav-engine)) + (inc-spr-addr! (_type_ uint) uint) + (lay-out-spad-memory (_type_ nav-mesh) none) + (set-up-mem-work (_type_) none) + (add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none) + (add-all-spheres (_type_) none) + (do-sphere-lookups (_type_) none) + (update-nav-controls-pipelined-in-spr (_type_) none) + (update-nav-controls-in-spr (_type_) none) + (upload-nav-to-spr (_type_ nav-engine-spr-buffer) none) + (download-nav-from-spr (_type_ nav-engine-spr-buffer) none) + (do-callbacks (_type_ nav-engine-spr-buffer) none) + (reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none) + (reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none) + ) + ) + +(defmethod inspect ((this nav-engine)) (when (not this) (set! this this) (goto cfg-4) @@ -961,7 +955,7 @@ this ) -(defmethod inc-spr-addr! nav-engine ((this nav-engine) (arg0 uint)) +(defmethod inc-spr-addr! ((this nav-engine) (arg0 uint)) "Adds the given integer to `spr-addr` and returns it" (let ((v0-0 (-> this spr-addr))) (+! (-> this spr-addr) arg0) @@ -969,7 +963,7 @@ ) ) -(defmethod lay-out-spad-memory nav-engine ((this nav-engine) (arg0 nav-mesh)) +(defmethod lay-out-spad-memory ((this nav-engine) (arg0 nav-mesh)) (let ((s5-0 0)) ;; og:preserve-this scratchpad (set! (-> this spr-addr) (scratchpad-object uint :offset #x60)) @@ -1054,7 +1048,7 @@ (none) ) -(defmethod set-up-mem-work nav-engine ((this nav-engine)) +(defmethod set-up-mem-work ((this nav-engine)) (let ((v1-0 (-> this mem-mesh))) (set! (-> v1-0 poly-array) (-> this mem-poly-array)) (set! (-> v1-0 work) (-> this mem-work)) @@ -1063,7 +1057,7 @@ (none) ) -(defmethod add-spheres-from-mesh-user-list nav-engine ((this nav-engine) (arg0 sphere-hash) (arg1 nav-mesh)) +(defmethod add-spheres-from-mesh-user-list ((this nav-engine) (arg0 sphere-hash) (arg1 nav-mesh)) (countdown (s3-0 (-> arg1 static-sphere-count)) (add-a-sphere-with-flag arg0 (-> arg1 static-sphere s3-0) 64) ) @@ -1147,7 +1141,7 @@ (none) ) -(defmethod add-all-spheres nav-engine ((this nav-engine)) +(defmethod add-all-spheres ((this nav-engine)) (let ((s4-0 (-> this nav-mesh-addr)) (gp-0 (-> this nav-mesh-addr sphere-hash)) ) @@ -1182,7 +1176,7 @@ (none) ) -(defmethod do-sphere-lookups nav-engine ((this nav-engine)) +(defmethod do-sphere-lookups ((this nav-engine)) (let ((s5-0 (-> this nav-mesh-addr))) (dotimes (s4-0 (the-as int (-> s5-0 nav-control-count))) (let ((a0-3 (-> s5-0 nav-control-array s4-0))) @@ -1222,7 +1216,7 @@ (defmethod-mips2c "(method 18 nav-engine)" 18 nav-engine) -(defmethod do-callbacks nav-engine ((this nav-engine) (arg0 nav-engine-spr-buffer)) +(defmethod do-callbacks ((this nav-engine) (arg0 nav-engine-spr-buffer)) (local-vars (sv-16 nav-callback-info)) (with-pp (dotimes (s4-0 (-> arg0 nav-count)) @@ -1258,7 +1252,7 @@ (defmethod-mips2c "(method 21 nav-engine)" 21 nav-engine) -(defmethod update-nav-controls-pipelined-in-spr nav-engine ((this nav-engine)) +(defmethod update-nav-controls-pipelined-in-spr ((this nav-engine)) (local-vars (v1-33 int) (v1-45 int) @@ -1355,7 +1349,7 @@ (none) ) -(defmethod update-nav-controls-in-spr nav-engine ((this nav-engine)) +(defmethod update-nav-controls-in-spr ((this nav-engine)) (flush-cache 0) (set! (-> this max-pass-count) 1) (let ((gp-0 (the-as object (-> this work-buf-array)))) @@ -1408,7 +1402,7 @@ (none) ) -(defmethod update-navigation nav-mesh ((this nav-mesh)) +(defmethod update-navigation ((this nav-mesh)) (local-vars (sp-0 int)) (when (zero? (-> this next-nav-mesh)) (set! (-> this next-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> this entity) 'next-actor 0))) @@ -1446,7 +1440,7 @@ (none) ) -(defmethod debug-draw nav-mesh ((this nav-mesh)) +(defmethod debug-draw ((this nav-mesh)) (local-vars (sv-32 vector) (sv-36 int)) (set! sv-32 (new 'stack-no-clear 'vector)) (set! sv-36 16) @@ -1486,22 +1480,22 @@ (dotimes (s5-1 (the-as int (-> this poly-count))) (let ((s4-1 (-> this poly-array s5-1))) (debug-draw-poly this s4-1 (cond - ((logtest? (-> s4-1 pat) 1) - *color-black* - ) - ((logtest? (-> s4-1 pat) 2) - *color-gray* - ) - ((logtest? (-> s4-1 pat) 4) - (if (-> this link-array (-> s4-1 link) dest-mesh) - *color-green* - *color-light-red* - ) - ) - (else - *color-cyan* + ((logtest? (-> s4-1 pat) 1) + *color-black* ) - ) + ((logtest? (-> s4-1 pat) 2) + *color-gray* + ) + ((logtest? (-> s4-1 pat) 4) + (if (-> this link-array (-> s4-1 link) dest-mesh) + *color-green* + *color-light-red* + ) + ) + (else + *color-cyan* + ) + ) ) (when (logtest? sv-36 32) (let ((s3-1 add-debug-text-3d) @@ -1526,7 +1520,7 @@ (none) ) -(defmethod poly-centroid-local nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod poly-centroid-local ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((v1-0 (new 'stack-no-clear 'nav-vertex))) @@ -1539,7 +1533,7 @@ ) ) -(defmethod poly-centroid nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod poly-centroid ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (poly-centroid-local this arg0 arg1) (vector+! arg1 arg1 (-> this bounds)) ) @@ -1600,7 +1594,7 @@ (and (>= (+ (-> arg0 vertex3 w) arg2) arg1) (>= arg1 (- (-> arg0 vertex2 w) arg2))) ) -(defmethod find-poly-containing-point-local nav-mesh ((this nav-mesh) (arg0 nav-find-poly-parms)) +(defmethod find-poly-containing-point-local ((this nav-mesh) (arg0 nav-find-poly-parms)) (local-vars (v1-6 symbol) (v1-15 int) (a0-3 symbol) (sv-16 nav-poly)) (let ((s4-0 (search-for-point (-> this poly-hash) (-> arg0 point))) (s3-0 (-> this poly-hash bucket-size)) @@ -1650,7 +1644,7 @@ (the-as nav-poly #f) ) -(defmethod is-in-mesh-local? nav-mesh ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod is-in-mesh-local? ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 float)) (local-vars (v1-3 float) (sv-16 float) (sv-20 vector) (sv-24 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1812,7 +1806,7 @@ ) ) -(defmethod try-move-along-ray nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod try-move-along-ray ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (v1-2 symbol)) (let ((gp-0 (new 'stack-no-clear 'nav-ray))) (let ((s4-0 0)) @@ -1909,7 +1903,7 @@ ) ) -(defmethod find-nearest-poly-to-point-local nav-mesh ((this nav-mesh) (arg0 nav-find-poly-parms)) +(defmethod find-nearest-poly-to-point-local ((this nav-mesh) (arg0 nav-find-poly-parms)) (local-vars (v1-16 int) (v1-34 int) @@ -2035,7 +2029,7 @@ (* (+ arg2 (* arg1 (-> arg0 poly-count))) 2) ) -(defmethod get-route-portal nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) +(defmethod get-route-portal ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) (set! (-> arg2 next-poly) #f) (cond ((and arg0 arg1 (!= arg0 arg1)) @@ -2078,7 +2072,7 @@ ) ) -(defmethod lookup-poly-on-route-to-target nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) +(defmethod lookup-poly-on-route-to-target ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) (cond ((and arg0 arg1 (!= arg0 arg1)) (let* ((a3-0 this) @@ -2109,7 +2103,7 @@ ) ) -(defmethod compute-bounding-box-from-vertices nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector)) +(defmethod compute-bounding-box-from-vertices ((this nav-mesh) (arg0 vector) (arg1 vector)) (let ((f0-0 10000000000000000000000000000000000000.0) (f1-0 -10000000000000000000000000000000000000.0) ) @@ -2140,7 +2134,7 @@ (none) ) -(defmethod initialize-mesh! nav-mesh ((this nav-mesh)) +(defmethod initialize-mesh! ((this nav-mesh)) (local-vars (sv-32 vector) (sv-36 uint) @@ -2284,7 +2278,7 @@ ) ) -(defmethod nav-mesh-method-38 nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 (pointer nav-poly))) +(defmethod nav-mesh-method-38 ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 (pointer nav-poly))) (local-vars (s1-0 vector) (sv-16 int) @@ -2404,7 +2398,7 @@ ) ) -(defmethod project-point-onto-plane-of-poly-local nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod project-point-onto-plane-of-poly-local ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (new 'stack-no-clear 'vector))) (cond @@ -2438,7 +2432,7 @@ ) ;; WARN: Return type mismatch int vs nav-mesh. -(defmethod mem-usage nav-mesh ((this nav-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this nav-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) @@ -2534,7 +2528,7 @@ ) ) -(defmethod nav-mesh-method-10 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 nav-poly)) +(defmethod nav-mesh-method-10 ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 nav-poly)) (local-vars (sv-16 vector)) (set! sv-16 arg0) (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) @@ -2582,7 +2576,7 @@ ) ) -(defmethod nav-mesh-method-34 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod nav-mesh-method-34 ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) (local-vars (v1-8 symbol) (v1-13 int) (a1-2 symbol) (sv-80 vector) (sv-84 (pointer uint8))) (let ((gp-0 (new 'stack-no-clear 'nav-poly))) (set! sv-80 arg0) @@ -2645,7 +2639,7 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod nav-mesh-method-35 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod nav-mesh-method-35 ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'nav-poly 3))) (set! (-> gp-0 2 vertex3 y) arg2) (vector-! (the-as vector (-> gp-0 0)) arg0 (-> this bounds)) diff --git a/goal_src/jak2/engine/physics/chain-physics-h.gc b/goal_src/jak2/engine/physics/chain-physics-h.gc index 80aecb4e9fd..efe3ea612b4 100644 --- a/goal_src/jak2/engine/physics/chain-physics-h.gc +++ b/goal_src/jak2/engine/physics/chain-physics-h.gc @@ -8,55 +8,46 @@ ;; DECOMP BEGINS (deftype chain-physics-setup (structure) - ((joint-index int32 :offset-assert 0) + ((joint-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype chain-physics-joint (structure) - ((position vector :inline :offset-assert 0) - (velocity vector :inline :offset-assert 16) - (old-x vector :inline :offset-assert 32) - (joint-mod joint-mod :offset-assert 48) + ((position vector :inline) + (velocity vector :inline) + (old-x vector :inline) + (joint-mod joint-mod) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) (deftype chain-physics (basic) - ((chain-joints chain-physics-joint 20 :inline :offset-assert 16) - (num-joints uint8 :offset-assert 1296) - (root-joint-index uint8 :offset-assert 1297) - (joint-length float :offset-assert 1300) - (gravity vector :inline :offset-assert 1312) - (gravity-target vector :inline :offset-assert 1328) - (stretch-vel float :offset-assert 1344) - (stretch-vel-parallel float :offset-assert 1348) - (compress-vel float :offset-assert 1352) - (compress-vel-parallel float :offset-assert 1356) - (negate-y symbol :offset-assert 1360) - (axial-slop float :offset-assert 1364) - (maximum-stretch float :offset-assert 1368) - (turn-off-start time-frame :offset-assert 1376) - (turn-off-duration time-frame :offset-assert 1384) + ((chain-joints chain-physics-joint 20 :inline) + (num-joints uint8) + (root-joint-index uint8) + (joint-length float) + (gravity vector :inline) + (gravity-target vector :inline) + (stretch-vel float) + (stretch-vel-parallel float) + (compress-vel float) + (compress-vel-parallel float) + (negate-y symbol) + (axial-slop float) + (maximum-stretch float) + (turn-off-start time-frame) + (turn-off-duration time-frame) ) - :method-count-assert 18 - :size-assert #x570 - :flag-assert #x1200000570 (:methods - (initialize-chain-joints (_type_) symbol 9) - (turn-off (_type_ time-frame) none :behavior process 10) - (update (_type_ process-drawable) none :behavior process 11) - (gravity-update (_type_ process-drawable) none 12) - (apply-gravity (_type_ vector int process-drawable) none :behavior process 13) - (chain-physics-method-14 (_type_ vector int) none 14) - (clamp-length (_type_ vector vector object process-drawable) vector 15) - (chain-physics-method-16 (_type_ int) float 16) - (chain-physics-method-17 (_type_ vector int) none 17) + (initialize-chain-joints (_type_) symbol) + (turn-off (_type_ time-frame) none :behavior process) + (update (_type_ process-drawable) none :behavior process) + (gravity-update (_type_ process-drawable) none) + (apply-gravity (_type_ vector int process-drawable) none :behavior process) + (chain-physics-method-14 (_type_ vector int) none) + (clamp-length (_type_ vector vector object process-drawable) vector) + (chain-physics-method-16 (_type_ int) float) + (chain-physics-method-17 (_type_ vector int) none) ) ) diff --git a/goal_src/jak2/engine/physics/chain-physics.gc b/goal_src/jak2/engine/physics/chain-physics.gc index e10e3a5dec2..0db50c819f0 100644 --- a/goal_src/jak2/engine/physics/chain-physics.gc +++ b/goal_src/jak2/engine/physics/chain-physics.gc @@ -7,13 +7,13 @@ ;; DECOMP BEGINS -(defmethod gravity-update chain-physics ((this chain-physics) (arg0 process-drawable)) +(defmethod gravity-update ((this chain-physics) (arg0 process-drawable)) (vector-seek-3d-smooth! (-> this gravity) (-> this gravity-target) 0.05 0.1) 0 (none) ) -(defmethod apply-gravity chain-physics ((this chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity ((this chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (vector-float*! arg0 (-> this gravity) @@ -23,7 +23,7 @@ (none) ) -(defmethod chain-physics-method-14 chain-physics ((this chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 ((this chain-physics) (arg0 vector) (arg1 int)) (vector-float*! arg0 (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 1) 64))) @@ -33,7 +33,7 @@ (none) ) -(defmethod clamp-length chain-physics ((this chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) +(defmethod clamp-length ((this chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 arg0 arg1) (vector-normalize! gp-0 (-> this joint-length)) @@ -41,16 +41,16 @@ ) ) -(defmethod chain-physics-method-16 chain-physics ((this chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 ((this chain-physics) (arg0 int)) (lerp-scale 5461.3335 10922.667 (the float arg0) 0.0 8.0) ) -(defmethod chain-physics-method-17 chain-physics ((this chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-17 ((this chain-physics) (arg0 vector) (arg1 int)) 0 (none) ) -(defmethod initialize-chain-joints chain-physics ((this chain-physics)) +(defmethod initialize-chain-joints ((this chain-physics)) (set! (-> this turn-off-start) 0) (dotimes (s5-0 (the-as int (-> this num-joints))) (let ((s4-0 (-> this chain-joints s5-0))) @@ -62,14 +62,14 @@ #f ) -(defmethod turn-off chain-physics ((this chain-physics) (arg0 time-frame)) +(defmethod turn-off ((this chain-physics) (arg0 time-frame)) (set-time! (-> this turn-off-start)) (set! (-> this turn-off-duration) arg0) 0 (none) ) -(defmethod update chain-physics ((this chain-physics) (arg0 process-drawable)) +(defmethod update ((this chain-physics) (arg0 process-drawable)) (local-vars (v1-78 float) (f0-11 float) @@ -345,7 +345,7 @@ ) ) -(defmethod relocate chain-physics ((this chain-physics) (arg0 int)) +(defmethod relocate ((this chain-physics) (arg0 int)) (dotimes (v1-0 (the-as int (-> this num-joints))) (if (nonzero? (-> this chain-joints v1-0 joint-mod)) (&+! (-> this chain-joints v1-0 joint-mod) arg0) diff --git a/goal_src/jak2/engine/physics/dynamics-h.gc b/goal_src/jak2/engine/physics/dynamics-h.gc index 408d82d12d2..d6ce5bf6294 100644 --- a/goal_src/jak2/engine/physics/dynamics-h.gc +++ b/goal_src/jak2/engine/physics/dynamics-h.gc @@ -8,24 +8,21 @@ ;; DECOMP BEGINS (deftype dynamics (basic) - ((name symbol :offset-assert 4) - (gravity-max meters :offset-assert 8) - (gravity-length meters :offset-assert 12) - (gravity vector :inline :offset-assert 16) - (gravity-normal vector :inline :offset-assert 32) - (walk-distance meters :offset-assert 48) - (run-distance meters :offset-assert 52) + ((name symbol) + (gravity-max meters) + (gravity-length meters) + (gravity vector :inline) + (gravity-normal vector :inline) + (walk-distance meters) + (run-distance meters) ) - :method-count-assert 10 - :size-assert #x38 - :flag-assert #xa00000038 (:methods - (set-gravity-length (_type_ float) none 9) + (set-gravity-length (_type_ float) none) ) ) -(defmethod set-gravity-length dynamics ((this dynamics) (arg0 float)) +(defmethod set-gravity-length ((this dynamics) (arg0 float)) (set! (-> this gravity-length) arg0) (vector-float*! (-> this gravity) (-> this gravity-normal) arg0) 0 diff --git a/goal_src/jak2/engine/physics/rigid-body-h.gc b/goal_src/jak2/engine/physics/rigid-body-h.gc index e1424150c4d..e8f4587cda6 100644 --- a/goal_src/jak2/engine/physics/rigid-body-h.gc +++ b/goal_src/jak2/engine/physics/rigid-body-h.gc @@ -75,304 +75,281 @@ ;; DECOMP BEGINS (deftype rigid-body-info (structure) - ((mass float :offset-assert 0) - (inv-mass float :offset-assert 4) - (linear-damping float :offset-assert 8) - (angular-damping float :offset-assert 12) - (bounce-factor float :offset-assert 16) - (friction-factor float :offset-assert 20) - (bounce-mult-factor float :offset-assert 24) - (unknown-k1hbn23 float :offset-assert 28) - (cm-offset-joint vector :inline :offset-assert 32) - (inv-inertial-tensor matrix :inline :offset-assert 48) - (inertial-tensor matrix :inline :offset-assert 112) - (inertial-tensor-box meters 3 :offset-assert 176) + ((mass float) + (inv-mass float) + (linear-damping float) + (angular-damping float) + (bounce-factor float) + (friction-factor float) + (bounce-mult-factor float) + (unknown-k1hbn23 float) + (cm-offset-joint vector :inline) + (inv-inertial-tensor matrix :inline) + (inertial-tensor matrix :inline) + (inertial-tensor-box meters 3) ) - :method-count-assert 10 - :size-assert #xbc - :flag-assert #xa000000bc (:methods - (rigid-body-info-method-9 (_type_) none 9) + (rigid-body-info-method-9 (_type_) none) ) ) (deftype rigid-body-object-extra-info (structure) - ((max-time-step float :offset-assert 0) - (gravity meters :offset-assert 4) - (idle-distance meters :offset-assert 8) - (attack-force-scale float :offset-assert 12) + ((max-time-step float) + (gravity meters) + (idle-distance meters) + (attack-force-scale float) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype rigid-body-object-constants (structure) - ((info rigid-body-info :inline :offset-assert 0) - (cm-joint vector :inline :offset 32) - (cm-joint-x meters :offset 32) - (cm-joint-y meters :offset 36) - (cm-joint-z meters :offset 40) - (cm-joint-w meters :offset 44) - (linear-damping float :offset 8) - (angular-damping float :offset 12) - (bounce-factor float :offset 16) - (friction-factor float :offset 20) - (inertial-tensor-x meters :offset 176) - (inertial-tensor-y meters :offset 180) - (inertial-tensor-z meters :offset 184) - (extra rigid-body-object-extra-info :inline :offset-assert 188) - (name symbol :offset-assert 204) + ((info rigid-body-info :inline) + (cm-joint vector :inline :overlay-at (-> info cm-offset-joint)) + (cm-joint-x meters :overlay-at (-> info cm-offset-joint data 0)) + (cm-joint-y meters :overlay-at (-> info cm-offset-joint data 1)) + (cm-joint-z meters :overlay-at (-> info cm-offset-joint data 2)) + (cm-joint-w meters :overlay-at (-> info cm-offset-joint data 3)) + (linear-damping float :overlay-at (-> info linear-damping)) + (angular-damping float :overlay-at (-> info angular-damping)) + (bounce-factor float :overlay-at (-> info bounce-factor)) + (friction-factor float :overlay-at (-> info friction-factor)) + (inertial-tensor-x meters :overlay-at (-> info inertial-tensor-box 0)) + (inertial-tensor-y meters :overlay-at (-> info inertial-tensor-box 1)) + (inertial-tensor-z meters :overlay-at (-> info inertial-tensor-box 2)) + (extra rigid-body-object-extra-info :inline) + (name symbol) ) - :method-count-assert 9 - :size-assert #xd0 - :flag-assert #x9000000d0 ) (deftype rigid-body-impact (structure) - ((point vector :inline :offset-assert 0) - (normal vector :inline :offset-assert 16) - (velocity vector :inline :offset-assert 32) - (impulse float :offset-assert 48) - (pat pat-surface :offset-assert 52) - (rbody basic :offset-assert 56) - (prim-id uint32 :offset-assert 60) + ((point vector :inline) + (normal vector :inline) + (velocity vector :inline) + (impulse float) + (pat pat-surface) + (rbody basic) + (prim-id uint32) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype rigid-body (structure) - ((work rigid-body-work :offset-assert 0) - (info rigid-body-info :offset-assert 4) - (flags rigid-body-flag :offset-assert 8) - (force-callback (function object float none) :offset-assert 12) - (blocked-by rigid-body-object :offset-assert 16) - (time-remaining float :offset-assert 20) - (step-count int16 :offset-assert 24) - (position vector :inline :offset-assert 32) - (rot vector :inline :offset-assert 48) - (rotation quaternion :inline :offset 48) - (lin-momentum vector :inline :offset-assert 64) - (ang-momentum vector :inline :offset-assert 80) - (force vector :inline :offset-assert 96) - (torque vector :inline :offset-assert 112) - (lin-velocity vector :inline :offset-assert 128) - (ang-velocity vector :inline :offset-assert 144) - (matrix matrix :inline :offset-assert 160) - (inv-i-world matrix :inline :offset-assert 224) + ((work rigid-body-work) + (info rigid-body-info) + (flags rigid-body-flag) + (force-callback (function object float none)) + (blocked-by rigid-body-object) + (time-remaining float) + (step-count int16) + (position vector :inline) + (rot vector :inline) + (rotation quaternion :inline :overlay-at (-> rot data 0)) + (lin-momentum vector :inline) + (ang-momentum vector :inline) + (force vector :inline) + (torque vector :inline) + (lin-velocity vector :inline) + (ang-velocity vector :inline) + (matrix matrix :inline) + (inv-i-world matrix :inline) ) - :method-count-assert 32 - :size-assert #x120 - :flag-assert #x2000000120 (:methods - (rigid-body-method-9 (_type_ collide-shape-moving float) none 9) - (rigid-body-method-10 (_type_) none 10) - (rigid-body-method-11 (_type_ collide-shape-moving) none 11) - (rigid-body-method-12 (_type_ float) none 12) - (rigid-body-method-13 (_type_) none 13) - (rigid-body-method-14 (_type_ float) none 14) - (rigid-body-method-15 (_type_ collide-shape-moving float) none 15) - (clear-force-torque! (_type_) none 16) - (clear-momentum! (_type_) none 17) - (rigid-body-method-18 (_type_ vector vector) none 18) - (rigid-body-method-19 (_type_ vector vector) none 19) - (rigid-body-method-20 (_type_ vector) none 20) - (rigid-body-method-21 (_type_ vector vector float) none 21) - (rigid-body-method-22 (_type_ vector vector) vector 22) - (rigid-body-method-23 (_type_ vector) vector 23) - (rigid-body-method-24 (_type_) none 24) - (rigid-body-method-25 (_type_ rigid-body-info vector quaternion function) none 25) - (rigid-body-method-26 (_type_ vector quaternion) none 26) - (print-physics (_type_ object) none 27) - (print-force-torque (_type_ object) none 28) - (print-position-rotation (_type_ object) none 29) - (print-momentum (_type_ object) none 30) - (print-velocity (_type_ object) none 31) + (rigid-body-method-9 (_type_ collide-shape-moving float) none) + (rigid-body-method-10 (_type_) none) + (rigid-body-method-11 (_type_ collide-shape-moving) none) + (rigid-body-method-12 (_type_ float) none) + (rigid-body-method-13 (_type_) none) + (rigid-body-method-14 (_type_ float) none) + (rigid-body-method-15 (_type_ collide-shape-moving float) none) + (clear-force-torque! (_type_) none) + (clear-momentum! (_type_) none) + (rigid-body-method-18 (_type_ vector vector) none) + (rigid-body-method-19 (_type_ vector vector) none) + (rigid-body-method-20 (_type_ vector) none) + (rigid-body-method-21 (_type_ vector vector float) none) + (rigid-body-method-22 (_type_ vector vector) vector) + (rigid-body-method-23 (_type_ vector) vector) + (rigid-body-method-24 (_type_) none) + (rigid-body-method-25 (_type_ rigid-body-info vector quaternion function) none) + (rigid-body-method-26 (_type_ vector quaternion) none) + (print-physics (_type_ object) none) + (print-force-torque (_type_ object) none) + (print-position-rotation (_type_ object) none) + (print-momentum (_type_ object) none) + (print-velocity (_type_ object) none) ) ) (deftype rigid-body-control (basic) - ((process process :offset-assert 4) - (state rigid-body :inline :offset-assert 16) + ((process process) + (state rigid-body :inline) ) - :method-count-assert 26 - :size-assert #x130 - :flag-assert #x1a00000130 (:methods - (new (symbol type process) _type_ 0) - (rigid-body-control-method-9 (_type_ collide-shape-moving float) none 9) - (rigid-body-control-method-10 (_type_ rigid-body-object float float) object 10) - (rigid-body-control-method-11 (_type_ collide-shape-moving) none 11) - (rigid-body-control-method-12 (_type_ float) none 12) - (rigid-body-control-method-13 (_type_) none 13) - (rigid-body-control-method-14 (_type_ float) none 14) - (clear-force-torque! (_type_) none 15) - (clear-momentum! (_type_) none 16) - (rigid-body-control-method-17 (_type_ vector vector) none 17) - (rigid-body-control-method-18 (_type_ vector vector) none 18) - (rigid-body-control-method-19 (_type_ vector) none 19) - (rigid-body-control-method-20 (_type_ vector vector float) none 20) - (rigid-body-control-method-21 (_type_ vector vector) vector 21) - (rigid-body-control-method-22 (_type_ vector) vector 22) - (rigid-body-control-method-23 (_type_) none 23) - (rigid-body-control-method-24 (_type_ rigid-body-info vector quaternion basic) none 24) - (rigid-body-control-method-25 (_type_ vector quaternion) none 25) + (new (symbol type process) _type_) + (rigid-body-control-method-9 (_type_ collide-shape-moving float) none) + (rigid-body-control-method-10 (_type_ rigid-body-object float float) object) + (rigid-body-control-method-11 (_type_ collide-shape-moving) none) + (rigid-body-control-method-12 (_type_ float) none) + (rigid-body-control-method-13 (_type_) none) + (rigid-body-control-method-14 (_type_ float) none) + (clear-force-torque! (_type_) none) + (clear-momentum! (_type_) none) + (rigid-body-control-method-17 (_type_ vector vector) none) + (rigid-body-control-method-18 (_type_ vector vector) none) + (rigid-body-control-method-19 (_type_ vector) none) + (rigid-body-control-method-20 (_type_ vector vector float) none) + (rigid-body-control-method-21 (_type_ vector vector) vector) + (rigid-body-control-method-22 (_type_ vector) vector) + (rigid-body-control-method-23 (_type_) none) + (rigid-body-control-method-24 (_type_ rigid-body-info vector quaternion basic) none) + (rigid-body-control-method-25 (_type_ vector quaternion) none) ) ) -(defmethod rigid-body-control-method-9 rigid-body-control ((this rigid-body-control) (arg0 collide-shape-moving) (arg1 float)) +(defmethod rigid-body-control-method-9 ((this rigid-body-control) (arg0 collide-shape-moving) (arg1 float)) (rigid-body-method-9 (-> this state) arg0 arg1) (none) ) ;; WARN: Return type mismatch none vs object. -(defmethod rigid-body-control-method-10 rigid-body-control ((this rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) +(defmethod rigid-body-control-method-10 ((this rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) (rigid-body-method-10 (-> this state)) ) -(defmethod rigid-body-control-method-11 rigid-body-control ((this rigid-body-control) (arg0 collide-shape-moving)) +(defmethod rigid-body-control-method-11 ((this rigid-body-control) (arg0 collide-shape-moving)) (rigid-body-method-11 (-> this state) arg0) (none) ) -(defmethod rigid-body-control-method-12 rigid-body-control ((this rigid-body-control) (arg0 float)) +(defmethod rigid-body-control-method-12 ((this rigid-body-control) (arg0 float)) (rigid-body-method-12 (-> this state) arg0) (none) ) -(defmethod rigid-body-control-method-13 rigid-body-control ((this rigid-body-control)) +(defmethod rigid-body-control-method-13 ((this rigid-body-control)) (rigid-body-method-13 (-> this state)) (none) ) -(defmethod rigid-body-control-method-14 rigid-body-control ((this rigid-body-control) (arg0 float)) +(defmethod rigid-body-control-method-14 ((this rigid-body-control) (arg0 float)) (rigid-body-method-14 (-> this state) arg0) (none) ) -(defmethod clear-force-torque! rigid-body-control ((this rigid-body-control)) +(defmethod clear-force-torque! ((this rigid-body-control)) (clear-force-torque! (-> this state)) (none) ) -(defmethod clear-momentum! rigid-body-control ((this rigid-body-control)) +(defmethod clear-momentum! ((this rigid-body-control)) (clear-momentum! (-> this state)) (none) ) -(defmethod rigid-body-control-method-17 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-control-method-17 ((this rigid-body-control) (arg0 vector) (arg1 vector)) (rigid-body-method-18 (-> this state) arg0 arg1) (none) ) -(defmethod rigid-body-control-method-18 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-control-method-18 ((this rigid-body-control) (arg0 vector) (arg1 vector)) (rigid-body-method-19 (-> this state) arg0 arg1) (none) ) -(defmethod rigid-body-control-method-19 rigid-body-control ((this rigid-body-control) (arg0 vector)) +(defmethod rigid-body-control-method-19 ((this rigid-body-control) (arg0 vector)) (rigid-body-method-20 (-> this state) arg0) (none) ) -(defmethod rigid-body-control-method-20 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod rigid-body-control-method-20 ((this rigid-body-control) (arg0 vector) (arg1 vector) (arg2 float)) (rigid-body-method-21 (-> this state) arg0 arg1 arg2) (none) ) -(defmethod rigid-body-control-method-21 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-control-method-21 ((this rigid-body-control) (arg0 vector) (arg1 vector)) (rigid-body-method-22 (-> this state) arg0 arg1) ) -(defmethod rigid-body-control-method-22 rigid-body-control ((this rigid-body-control) (arg0 vector)) +(defmethod rigid-body-control-method-22 ((this rigid-body-control) (arg0 vector)) (rigid-body-method-23 (-> this state) arg0) ) -(defmethod rigid-body-control-method-23 rigid-body-control ((this rigid-body-control)) +(defmethod rigid-body-control-method-23 ((this rigid-body-control)) (rigid-body-method-24 (-> this state)) (none) ) -(defmethod rigid-body-control-method-24 rigid-body-control ((this rigid-body-control) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 basic)) +(defmethod rigid-body-control-method-24 ((this rigid-body-control) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 basic)) (rigid-body-method-25 (-> this state) arg0 arg1 arg2 (the-as function arg3)) (none) ) -(defmethod rigid-body-control-method-25 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 quaternion)) +(defmethod rigid-body-control-method-25 ((this rigid-body-control) (arg0 vector) (arg1 quaternion)) (rigid-body-method-26 (-> this state) arg0 arg1) (none) ) (deftype rigid-body-object (process-focusable) - ((root collide-shape-moving :override) - (info rigid-body-object-constants :offset-assert 204) - (flags rigid-body-object-flag :offset-assert 208) - (max-time-step float :offset-assert 216) - (incoming-attack-id uint32 :offset-assert 220) - (player-touch-time time-frame :offset-assert 224) - (disturbed-time time-frame :offset-assert 232) - (player-force-position vector :inline :offset-assert 240) - (player-force vector :inline :offset-assert 256) + ((root collide-shape-moving :override) + (info rigid-body-object-constants) + (flags rigid-body-object-flag) + (max-time-step float) + (incoming-attack-id uint32) + (player-touch-time time-frame) + (disturbed-time time-frame) + (player-force-position vector :inline) + (player-force vector :inline) ) - :heap-base #x90 - :method-count-assert 53 - :size-assert #x110 - :flag-assert #x3500900110 + (:state-methods + idle + active + ) (:methods - (idle () _type_ :state 27) - (active () _type_ :state 28) - (rigid-body-object-method-29 (_type_ float) none 29) - (rigid-body-object-method-30 (_type_) none 30) - (alloc-and-init-rigid-body-control (_type_ rigid-body-object-constants) none 31) - (allocate-and-init-cshape (_type_) none 32) - (init-skel-and-rigid-body (_type_) none 33) - (rigid-body-object-method-34 (_type_) none 34) - (rigid-body-object-method-35 (_type_) none 35) - (do-engine-sounds (_type_) none 36) - (rigid-body-object-method-37 (_type_) none 37) - (rigid-body-object-method-38 (_type_) none 38) - (rigid-body-object-method-39 (_type_) none 39) - (rigid-body-object-method-40 (_type_) none 40) - (rigid-body-object-method-41 (_type_) none 41) - (rigid-body-object-method-42 (_type_) none :behavior rigid-body-object 42) - (rigid-body-object-method-43 (_type_) none 43) - (apply-damage (_type_ float rigid-body-impact) none 44) - (rigid-body-object-method-45 (_type_ rigid-body-impact) none 45) - (rigid-body-object-method-46 (_type_ process-drawable int symbol event-message-block) object :behavior rigid-body-object 46) - (rigid-body-object-method-47 (_type_ process-drawable attack-info touching-shapes-entry penetrate) symbol 47) - (rigid-body-object-method-48 (_type_ process-focusable touching-shapes-entry) symbol 48) - (rigid-body-object-method-49 (_type_ rigid-body-impact touching-shapes-entry) none 49) - (rigid-body-object-method-50 (_type_ float) none 50) - (rigid-body-object-method-51 (_type_) none 51) - (rigid-body-object-method-52 (_type_) none 52) + (rigid-body-object-method-29 (_type_ float) none) + (rigid-body-object-method-30 (_type_) none) + (alloc-and-init-rigid-body-control (_type_ rigid-body-object-constants) none) + (allocate-and-init-cshape (_type_) none) + (init-skel-and-rigid-body (_type_) none) + (rigid-body-object-method-34 (_type_) none) + (rigid-body-object-method-35 (_type_) none) + (do-engine-sounds (_type_) none) + (rigid-body-object-method-37 (_type_) none) + (rigid-body-object-method-38 (_type_) none) + (rigid-body-object-method-39 (_type_) none) + (rigid-body-object-method-40 (_type_) none) + (rigid-body-object-method-41 (_type_) none) + (rigid-body-object-method-42 (_type_) none :behavior rigid-body-object) + (rigid-body-object-method-43 (_type_) none) + (apply-damage (_type_ float rigid-body-impact) none) + (rigid-body-object-method-45 (_type_ rigid-body-impact) none) + (rigid-body-object-method-46 (_type_ process-drawable int symbol event-message-block) object :behavior rigid-body-object) + (rigid-body-object-method-47 (_type_ process-drawable attack-info touching-shapes-entry penetrate) symbol) + (rigid-body-object-method-48 (_type_ process-focusable touching-shapes-entry) symbol) + (rigid-body-object-method-49 (_type_ rigid-body-impact touching-shapes-entry) none) + (rigid-body-object-method-50 (_type_ float) none) + (rigid-body-object-method-51 (_type_) none) + (rigid-body-object-method-52 (_type_) none) ) ) (deftype rigid-body-queue (structure) - ((count int8 :offset-assert 0) - (array handle 128 :offset 8) + ((count int8) + (array handle 128 :offset 8) ) - :method-count-assert 17 - :size-assert #x408 - :flag-assert #x1100000408 (:methods - (rigid-body-queue-method-9 (_type_) none 9) - (rigid-body-queue-method-10 (_type_) none 10) - (rigid-body-queue-method-11 (_type_ rigid-body-object) none 11) - (rigid-body-queue-method-12 (_type_ int int) none 12) - (rigid-body-queue-method-13 (_type_ int rigid-body-object) none 13) - (rigid-body-queue-method-14 (_type_ int) none 14) - (rigid-body-queue-method-15 (_type_ rigid-body-object) none 15) - (validate (_type_) symbol 16) + (rigid-body-queue-method-9 (_type_) none) + (rigid-body-queue-method-10 (_type_) none) + (rigid-body-queue-method-11 (_type_ rigid-body-object) none) + (rigid-body-queue-method-12 (_type_ int int) none) + (rigid-body-queue-method-13 (_type_ int rigid-body-object) none) + (rigid-body-queue-method-14 (_type_ int) none) + (rigid-body-queue-method-15 (_type_ rigid-body-object) none) + (validate (_type_) symbol) ) ) diff --git a/goal_src/jak2/engine/physics/rigid-body-queue.gc b/goal_src/jak2/engine/physics/rigid-body-queue.gc index 982b572d70b..8d6ceec2227 100644 --- a/goal_src/jak2/engine/physics/rigid-body-queue.gc +++ b/goal_src/jak2/engine/physics/rigid-body-queue.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod rigid-body-queue-method-9 rigid-body-queue ((this rigid-body-queue)) +(defmethod rigid-body-queue-method-9 ((this rigid-body-queue)) (set! (-> this count) 0) (dotimes (v1-0 128) (set! (-> this array v1-0) (the-as handle #f)) @@ -16,7 +16,7 @@ (none) ) -(defmethod validate rigid-body-queue ((this rigid-body-queue)) +(defmethod validate ((this rigid-body-queue)) (let ((gp-0 0)) (dotimes (v1-0 (-> this count)) (let ((a1-2 (-> this array v1-0)) @@ -37,7 +37,7 @@ ) ) -(defmethod rigid-body-queue-method-10 rigid-body-queue ((this rigid-body-queue)) +(defmethod rigid-body-queue-method-10 ((this rigid-body-queue)) (local-vars (s4-0 process)) (with-pp (let ((f0-0 (seconds-per-frame)) @@ -116,7 +116,7 @@ ) ) -(defmethod rigid-body-queue-method-11 rigid-body-queue ((this rigid-body-queue) (arg0 rigid-body-object)) +(defmethod rigid-body-queue-method-11 ((this rigid-body-queue) (arg0 rigid-body-object)) (let ((v1-0 -1)) (let ((a2-0 0)) (b! #t cfg-9 :delay (nop!)) @@ -144,7 +144,7 @@ (none) ) -(defmethod rigid-body-queue-method-12 rigid-body-queue ((this rigid-body-queue) (arg0 int) (arg1 int)) +(defmethod rigid-body-queue-method-12 ((this rigid-body-queue) (arg0 int) (arg1 int)) (when (< arg0 arg1) (let ((v1-1 arg1) (a3-0 (+ arg1 -1)) @@ -162,7 +162,7 @@ (none) ) -(defmethod rigid-body-queue-method-13 rigid-body-queue ((this rigid-body-queue) (arg0 int) (arg1 rigid-body-object)) +(defmethod rigid-body-queue-method-13 ((this rigid-body-queue) (arg0 int) (arg1 rigid-body-object)) (let ((v1-2 (process->handle arg1)) (a2-4 (+ arg0 1)) ) @@ -182,7 +182,7 @@ (none) ) -(defmethod rigid-body-queue-method-14 rigid-body-queue ((this rigid-body-queue) (arg0 int)) +(defmethod rigid-body-queue-method-14 ((this rigid-body-queue) (arg0 int)) (let ((v1-0 arg0) (a1-1 (+ arg0 1)) ) @@ -197,7 +197,7 @@ (none) ) -(defmethod rigid-body-queue-method-15 rigid-body-queue ((this rigid-body-queue) (arg0 rigid-body-object)) +(defmethod rigid-body-queue-method-15 ((this rigid-body-queue) (arg0 rigid-body-object)) (let ((v1-2 (process->handle arg0)) (a1-4 0) ) @@ -218,14 +218,10 @@ ) (deftype rigid-body-queue-manager (process) - ((queue rigid-body-queue :offset-assert 128) + ((queue rigid-body-queue) ) - :heap-base #x10 - :method-count-assert 15 - :size-assert #x84 - :flag-assert #xf00100084 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) diff --git a/goal_src/jak2/engine/physics/rigid-body.gc b/goal_src/jak2/engine/physics/rigid-body.gc index 060eb42b6f0..a0451fdc6be 100644 --- a/goal_src/jak2/engine/physics/rigid-body.gc +++ b/goal_src/jak2/engine/physics/rigid-body.gc @@ -33,12 +33,9 @@ ;; DECOMP BEGINS (deftype rigid-body-work (structure) - ((max-ang-momentum float :offset-assert 0) - (max-ang-velocity float :offset-assert 4) + ((max-ang-momentum float) + (max-ang-velocity float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -51,12 +48,12 @@ ) ) -(defmethod relocate rigid-body-control ((this rigid-body-control) (arg0 int)) +(defmethod relocate ((this rigid-body-control) (arg0 int)) (&+! (-> this process) arg0) this ) -(defmethod rigid-body-info-method-9 rigid-body-info ((this rigid-body-info)) +(defmethod rigid-body-info-method-9 ((this rigid-body-info)) (let ((f24-0 (-> this mass)) (f28-0 (-> this inertial-tensor-box 0)) (f30-0 (-> this inertial-tensor-box 1)) @@ -93,21 +90,21 @@ (none) ) -(defmethod clear-force-torque! rigid-body ((this rigid-body)) +(defmethod clear-force-torque! ((this rigid-body)) (set! (-> this force quad) (the-as uint128 0)) (set! (-> this torque quad) (the-as uint128 0)) 0 (none) ) -(defmethod clear-momentum! rigid-body ((this rigid-body)) +(defmethod clear-momentum! ((this rigid-body)) (set! (-> this lin-momentum quad) (the-as uint128 0)) (set! (-> this ang-momentum quad) (the-as uint128 0)) 0 (none) ) -(defmethod rigid-body-method-24 rigid-body ((this rigid-body)) +(defmethod rigid-body-method-24 ((this rigid-body)) (when #t (quaternion->matrix (-> this matrix) (-> this rotation)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -119,7 +116,7 @@ (none) ) -(defmethod rigid-body-method-26 rigid-body ((this rigid-body) (arg0 vector) (arg1 quaternion)) +(defmethod rigid-body-method-26 ((this rigid-body) (arg0 vector) (arg1 quaternion)) (let ((s3-0 (new 'stack-no-clear 'inline-array 'vector 8))) (quaternion->matrix (the-as matrix (-> s3-0 1)) arg1) (vector-rotate*! (-> s3-0 0) (-> this info cm-offset-joint) (the-as matrix (-> s3-0 1))) @@ -132,7 +129,7 @@ (none) ) -(defmethod rigid-body-method-25 rigid-body ((this rigid-body) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 function)) +(defmethod rigid-body-method-25 ((this rigid-body) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 function)) (set! (-> this work) *rigid-body-work*) (set! (-> this info) arg0) (set! (-> this force-callback) (the-as (function object float none) arg3)) @@ -149,7 +146,7 @@ (none) ) -(defmethod rigid-body-method-22 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-22 ((this rigid-body) (arg0 vector) (arg1 vector)) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position)))) (vector-cross! arg1 (-> this ang-velocity) v1-1) ) @@ -179,7 +176,7 @@ arg0 ) -(defmethod rigid-body-method-12 rigid-body ((this rigid-body) (arg0 float)) +(defmethod rigid-body-method-12 ((this rigid-body) (arg0 float)) (local-vars (v1-6 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -244,7 +241,7 @@ ) ) -(defmethod rigid-body-method-13 rigid-body ((this rigid-body)) +(defmethod rigid-body-method-13 ((this rigid-body)) (let ((v1-0 (-> this info))) (vector-float*! (-> this lin-velocity) (-> this lin-momentum) (-> v1-0 inv-mass)) (matrix-3x3-triple-transpose-product (-> this inv-i-world) (-> this matrix) (-> v1-0 inv-inertial-tensor)) @@ -254,7 +251,7 @@ (none) ) -(defmethod rigid-body-method-14 rigid-body ((this rigid-body) (arg0 float)) +(defmethod rigid-body-method-14 ((this rigid-body) (arg0 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -305,7 +302,7 @@ ) ) -(defmethod rigid-body-method-9 rigid-body ((this rigid-body) (arg0 collide-shape-moving) (arg1 float)) +(defmethod rigid-body-method-9 ((this rigid-body) (arg0 collide-shape-moving) (arg1 float)) (rigid-body-method-12 this arg1) (let ((v1-2 (-> this info))) (let* ((a0-2 (-> this lin-momentum)) @@ -340,7 +337,7 @@ (none) ) -(defmethod collide-with-all-collide-cache-prims collide-shape-moving ((this collide-shape-moving) (arg0 matrix) (arg1 collide-query)) +(defmethod collide-with-all-collide-cache-prims ((this collide-shape-moving) (arg0 matrix) (arg1 collide-query)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -440,7 +437,7 @@ ) ) -(defmethod collide-shape-moving-method-63 collide-shape-moving ((this collide-shape-moving) (arg0 rigid-body) (arg1 float)) +(defmethod collide-shape-moving-method-63 ((this collide-shape-moving) (arg0 rigid-body) (arg1 float)) (local-vars (s3-0 rigid-body)) (with-pp (rlet ((acc :class vf) @@ -636,7 +633,7 @@ ) ) -(defmethod rigid-body-method-15 rigid-body ((this rigid-body) (arg0 collide-shape-moving) (arg1 float)) +(defmethod rigid-body-method-15 ((this rigid-body) (arg0 collide-shape-moving) (arg1 float)) (local-vars (sv-576 vector) (sv-624 vector) @@ -732,7 +729,7 @@ ) ) -(defmethod rigid-body-method-18 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-18 ((this rigid-body) (arg0 vector) (arg1 vector)) (vector+! (-> this force) (-> this force) arg1) (let ((a3-1 (new 'stack-no-clear 'vector)) (v1-1 (new 'stack-no-clear 'vector)) @@ -745,7 +742,7 @@ (none) ) -(defmethod rigid-body-method-21 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod rigid-body-method-21 ((this rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) (vector+! (-> this force) (-> this force) arg1) (let* ((t0-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position))) (v1-3 (vector-cross! (new 'stack-no-clear 'vector) t0-2 arg1)) @@ -761,7 +758,7 @@ (none) ) -(defmethod rigid-body-method-19 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-19 ((this rigid-body) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -775,13 +772,13 @@ (none) ) -(defmethod rigid-body-method-20 rigid-body ((this rigid-body) (arg0 vector)) +(defmethod rigid-body-method-20 ((this rigid-body) (arg0 vector)) (vector+! (-> this force) (-> this force) arg0) 0 (none) ) -(defmethod rigid-body-method-23 rigid-body ((this rigid-body) (arg0 vector)) +(defmethod rigid-body-method-23 ((this rigid-body) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-rotate*! gp-0 (-> this info cm-offset-joint) (-> this matrix)) (vector-! arg0 (-> this position) gp-0) @@ -789,14 +786,14 @@ arg0 ) -(defmethod print-force-torque rigid-body ((this rigid-body) (arg0 object)) +(defmethod print-force-torque ((this rigid-body) (arg0 object)) (format arg0 " force ~M ~M ~M" (-> this force x) (-> this force y) (-> this force z)) (format arg0 " torque ~M ~M ~M~%" (-> this torque x) (-> this torque y) (-> this torque z)) 0 (none) ) -(defmethod print-momentum rigid-body ((this rigid-body) (arg0 object)) +(defmethod print-momentum ((this rigid-body) (arg0 object)) (format arg0 " lin-mom ~M ~M ~M" (-> this lin-momentum x) (-> this lin-momentum y) (-> this lin-momentum z)) (format arg0 @@ -809,7 +806,7 @@ (none) ) -(defmethod print-velocity rigid-body ((this rigid-body) (arg0 object)) +(defmethod print-velocity ((this rigid-body) (arg0 object)) (format arg0 " lin-vel ~M ~M ~M" (-> this lin-velocity x) (-> this lin-velocity y) (-> this lin-velocity z)) (format arg0 @@ -822,7 +819,7 @@ (none) ) -(defmethod print-position-rotation rigid-body ((this rigid-body) (arg0 object)) +(defmethod print-position-rotation ((this rigid-body) (arg0 object)) (format arg0 " position ~M ~M ~M" (-> this position x) (-> this position y) (-> this position z)) (format arg0 @@ -836,7 +833,7 @@ (none) ) -(defmethod print-physics rigid-body ((this rigid-body) (arg0 object)) +(defmethod print-physics ((this rigid-body) (arg0 object)) (print-force-torque this arg0) (print-position-rotation this arg0) (print-momentum this arg0) @@ -846,7 +843,7 @@ ) ;; WARN: Return type mismatch int vs object. -(defmethod rigid-body-control-method-10 rigid-body-control ((this rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) +(defmethod rigid-body-control-method-10 ((this rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) (let* ((s4-1 (max 1 (min 4 (+ (the int (* 0.9999 (/ arg1 arg2))) 1)))) (f30-0 (/ arg1 (the float s4-1))) (s3-0 (-> this state force-callback)) @@ -865,7 +862,7 @@ 0 ) -(defmethod rigid-body-method-11 rigid-body ((this rigid-body) (arg0 collide-shape-moving)) +(defmethod rigid-body-method-11 ((this rigid-body) (arg0 collide-shape-moving)) (quaternion-copy! (-> arg0 quat) (-> this rotation)) (rigid-body-method-23 this (-> arg0 trans)) (set! (-> arg0 transv quad) (-> this lin-velocity quad)) @@ -873,11 +870,11 @@ (none) ) -(defmethod get-inv-mass rigid-body-object ((this rigid-body-object)) +(defmethod get-inv-mass ((this rigid-body-object)) (-> this info info inv-mass) ) -(defmethod rigid-body-object-method-35 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-35 ((this rigid-body-object)) (let ((a0-1 (-> this info name))) (when (nonzero? a0-1) (set! (-> this info) (the-as rigid-body-object-constants (-> a0-1 value))) @@ -890,7 +887,7 @@ (none) ) -(defmethod rigid-body-object-method-50 rigid-body-object ((this rigid-body-object) (arg0 float)) +(defmethod rigid-body-object-method-50 ((this rigid-body-object) (arg0 float)) (when (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) (when (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)) (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force)) @@ -907,7 +904,7 @@ (none) ) -(defmethod rigid-body-object-method-29 rigid-body-object ((this rigid-body-object) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this rigid-body-object) (arg0 float)) (let ((a1-1 (new 'stack-no-clear 'vector))) (vector-reset! a1-1) (set! (-> a1-1 y) (* -1.0 (-> this info extra gravity) (-> this rbody state info mass))) @@ -917,14 +914,14 @@ (none) ) -(defmethod rigid-body-object-method-30 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-30 ((this rigid-body-object)) (rigid-body-control-method-10 (-> this rbody) this (seconds-per-frame) (-> this max-time-step)) (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) 0 (none) ) -(defmethod rigid-body-object-method-51 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-51 ((this rigid-body-object)) (rigid-body-control-method-10 (-> this rbody) this @@ -935,19 +932,19 @@ (none) ) -(defmethod rigid-body-object-method-52 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-52 ((this rigid-body-object)) (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) 0 (none) ) -(defmethod rigid-body-object-method-34 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-34 ((this rigid-body-object)) (go (method-of-object this idle)) 0 (none) ) -(defmethod alloc-and-init-rigid-body-control rigid-body-object ((this rigid-body-object) (arg0 rigid-body-object-constants)) +(defmethod alloc-and-init-rigid-body-control ((this rigid-body-object) (arg0 rigid-body-object-constants)) (set! (-> this info) arg0) (set! (-> this rbody) (new 'process 'rigid-body-control this)) (update-transforms (-> this root)) @@ -969,7 +966,7 @@ (none) ) -(defmethod allocate-and-init-cshape rigid-body-object ((this rigid-body-object)) +(defmethod allocate-and-init-cshape ((this rigid-body-object)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1018,13 +1015,13 @@ ) ) -(defmethod init-skel-and-rigid-body rigid-body-object ((this rigid-body-object)) +(defmethod init-skel-and-rigid-body ((this rigid-body-object)) (alloc-and-init-rigid-body-control this *rigid-body-object-constants*) 0 (none) ) -(defmethod init-from-entity! rigid-body-object ((this rigid-body-object) (arg0 entity-actor)) +(defmethod init-from-entity! ((this rigid-body-object) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1039,12 +1036,12 @@ This commonly includes things such as: (none) ) -(defmethod do-engine-sounds rigid-body-object ((this rigid-body-object)) +(defmethod do-engine-sounds ((this rigid-body-object)) 0 (none) ) -(defmethod rigid-body-object-method-37 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-37 ((this rigid-body-object)) (rigid-body-object-method-30 this) (do-engine-sounds this) (let ((v1-4 (-> this rbody)) @@ -1057,7 +1054,7 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-40 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-40 ((this rigid-body-object)) (logior! (-> this flags) (rigid-body-object-flag enable-collision)) (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (-> this root backup-collide-as)) @@ -1067,7 +1064,7 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-41 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-41 ((this rigid-body-object)) (logclear! (-> this flags) (rigid-body-object-flag enable-collision)) (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) @@ -1078,7 +1075,7 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-38 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-38 ((this rigid-body-object)) (when (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) (logior! (-> this rbody state flags) (rigid-body-flag enable-physics)) (rigid-body-method-26 (-> this rbody state) (-> this root trans) (-> this root quat)) @@ -1089,13 +1086,13 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-39 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-39 ((this rigid-body-object)) (logclear! (-> this rbody state flags) (rigid-body-flag enable-physics)) 0 (none) ) -(defmethod rigid-body-object-method-42 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-42 ((this rigid-body-object)) (logior! (-> this flags) (rigid-body-object-flag disturbed)) (set-time! (-> this disturbed-time)) (if (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) @@ -1105,23 +1102,23 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-43 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-43 ((this rigid-body-object)) (go (method-of-object this active)) 0 (none) ) -(defmethod apply-damage rigid-body-object ((this rigid-body-object) (arg0 float) (arg1 rigid-body-impact)) +(defmethod apply-damage ((this rigid-body-object) (arg0 float) (arg1 rigid-body-impact)) 0 (none) ) -(defmethod rigid-body-object-method-45 rigid-body-object ((this rigid-body-object) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 ((this rigid-body-object) (arg0 rigid-body-impact)) 0 (none) ) -(defmethod rigid-body-object-method-49 rigid-body-object ((this rigid-body-object) (arg0 rigid-body-impact) (arg1 touching-shapes-entry)) +(defmethod rigid-body-object-method-49 ((this rigid-body-object) (arg0 rigid-body-impact) (arg1 touching-shapes-entry)) (set! (-> arg0 rbody) #f) (set! (-> arg0 prim-id) (the-as uint 0)) (vector-reset! (-> arg0 normal)) @@ -1151,12 +1148,12 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-47 rigid-body-object ((this rigid-body-object) - (arg0 process-drawable) - (arg1 attack-info) - (arg2 touching-shapes-entry) - (arg3 penetrate) - ) +(defmethod rigid-body-object-method-47 ((this rigid-body-object) + (arg0 process-drawable) + (arg1 attack-info) + (arg2 touching-shapes-entry) + (arg3 penetrate) + ) (local-vars (f0-2 float)) (when arg2 (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact))) @@ -1233,7 +1230,7 @@ This commonly includes things such as: ) ) -(defmethod rigid-body-object-method-48 rigid-body-object ((this rigid-body-object) (arg0 process-focusable) (arg1 touching-shapes-entry)) +(defmethod rigid-body-object-method-48 ((this rigid-body-object) (arg0 process-focusable) (arg1 touching-shapes-entry)) (local-vars (v1-2 symbol)) (b! (not (logtest? (process-mask target crate enemy) (-> arg0 mask))) cfg-5 :likely-delay (set! v1-2 #t)) (b! (not (logtest? (-> arg0 mask) (process-mask target))) cfg-5 :likely-delay (set! v1-2 #f)) @@ -1304,7 +1301,7 @@ This commonly includes things such as: #t ) -(defmethod rigid-body-object-method-46 rigid-body-object ((this rigid-body-object) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 ((this rigid-body-object) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('impact-impulse) (let ((s5-1 (-> arg3 param 0))) diff --git a/goal_src/jak2/engine/physics/trajectory-h.gc b/goal_src/jak2/engine/physics/trajectory-h.gc index 1ebea18301a..47cabb844ce 100644 --- a/goal_src/jak2/engine/physics/trajectory-h.gc +++ b/goal_src/jak2/engine/physics/trajectory-h.gc @@ -10,45 +10,39 @@ ;; DECOMP BEGINS (deftype trajectory (structure) - ((initial-position vector :inline :offset-assert 0) - (initial-velocity vector :inline :offset-assert 16) - (time float :offset-assert 32) - (gravity meters :offset-assert 36) + ((initial-position vector :inline) + (initial-velocity vector :inline) + (time float) + (gravity meters) ) - :method-count-assert 18 - :size-assert #x28 - :flag-assert #x1200000028 (:methods - (compute-trans-at-time (_type_ float vector) vector 9) - (compute-transv-at-time (_type_ float vector) vector 10) - (compute-time-until-apex (_type_) float 11) - (setup-from-to-duration! (_type_ vector vector float float) none 12) - (setup-from-to-xz-vel! (_type_ vector vector float float) none 13) - (setup-from-to-y-vel! (_type_ vector vector float float) none 14) - (setup-from-to-height! (_type_ vector vector float float) none 15) - (setup-from-to-duration-and-height! (_type_ vector vector float float) none 16) - (debug-draw (_type_) none 17) + (compute-trans-at-time (_type_ float vector) vector) + (compute-transv-at-time (_type_ float vector) vector) + (compute-time-until-apex (_type_) float) + (setup-from-to-duration! (_type_ vector vector float float) none) + (setup-from-to-xz-vel! (_type_ vector vector float float) none) + (setup-from-to-y-vel! (_type_ vector vector float float) none) + (setup-from-to-height! (_type_ vector vector float float) none) + (setup-from-to-duration-and-height! (_type_ vector vector float float) none) + (debug-draw (_type_) none) ) ) (deftype impact-control (structure) - ((process (pointer process-drawable) :offset-assert 0) - (radius float :offset-assert 4) - (joint int32 :offset-assert 8) - (collide-with collide-spec :offset-assert 12) - (start-time time-frame :offset-assert 16) - (trans vector 2 :inline :offset-assert 32) - (dir vector :inline :offset-assert 64) + ((process (pointer process-drawable)) + (radius float) + (joint int32) + (collide-with collide-spec) + (start-time time-frame) + (trans vector 2 :inline) + (dir vector :inline) ) - :method-count-assert 12 - :size-assert #x50 - :flag-assert #xc00000050 (:methods - (new (symbol type process-drawable int float collide-spec) _type_ 0) - (initialize (_type_ process-drawable int float collide-spec) impact-control :behavior process 9) - (update-from-cspace (_type_) none 10) - (impact-control-method-11 (_type_ collide-query process pat-surface) float 11) + (new (symbol type process-drawable int float collide-spec) _type_) + (initialize (_type_ process-drawable int float collide-spec) impact-control :behavior process) + (update-from-cspace (_type_) none) + (impact-control-method-11 (_type_ collide-query process pat-surface) float) ) ) @@ -69,16 +63,13 @@ ) (deftype point-tracker (structure) - ((trans vector 2 :inline :offset-assert 0) + ((trans vector 2 :inline) ) - :method-count-assert 12 - :size-assert #x20 - :flag-assert #xc00000020 (:methods - (new (symbol type vector vector) _type_ 0) - (initialize (_type_ vector vector) point-tracker 9) - (point-tracker-method-10 (_type_ vector vector vector float) vector 10) - (point-tracker-method-11 (_type_ vector vector vector float) vector 11) + (new (symbol type vector vector) _type_) + (initialize (_type_ vector vector) point-tracker) + (point-tracker-method-10 (_type_ vector vector vector float) vector) + (point-tracker-method-11 (_type_ vector vector vector float) vector) ) ) @@ -93,60 +84,48 @@ ) (deftype combo-tracker (point-tracker) - ((target handle :offset-assert 32) - (move-start-time time-frame :offset-assert 40) + ((target handle) + (move-start-time time-frame) ) - :method-count-assert 14 - :size-assert #x30 - :flag-assert #xe00000030 (:methods - (combo-tracker-method-12 (_type_ vector vector process time-frame) combo-tracker 12) - (combo-tracker-method-13 (_type_ handle vector float vector float) basic 13) + (combo-tracker-method-12 (_type_ vector vector process time-frame) combo-tracker) + (combo-tracker-method-13 (_type_ handle vector float vector float) basic) ) ) (deftype traj2d-params (structure) - ((x float :offset-assert 0) - (y float :offset-assert 4) - (gravity float :offset-assert 8) - (initial-tilt float :offset-assert 12) - (initial-speed float :offset-assert 16) - (time float :offset-assert 20) + ((x float) + (y float) + (gravity float) + (initial-tilt float) + (initial-speed float) + (time float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype traj3d-params (structure) - ((gravity float :offset-assert 0) - (initial-tilt float :offset-assert 4) - (initial-speed float :offset-assert 8) - (time float :offset-assert 12) - (src vector :inline :offset-assert 16) - (dest vector :inline :offset-assert 32) - (diff vector :inline :offset-assert 48) - (initial-velocity vector :inline :offset-assert 64) + ((gravity float) + (initial-tilt float) + (initial-speed float) + (time float) + (src vector :inline) + (dest vector :inline) + (diff vector :inline) + (initial-velocity vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype cubic-curve (structure) - ((mat matrix :inline :offset-assert 0) + ((mat matrix :inline) ) - :method-count-assert 14 - :size-assert #x40 - :flag-assert #xe00000040 (:methods - (cubic-curve-method-9 (_type_ vector vector vector vector) none 9) - (cubic-curve-method-10 (_type_ vector float) vector 10) - (cubic-curve-method-11 (_type_ vector float) vector 11) - (cubic-curve-method-12 (_type_ vector float) vector 12) - (debug-draw-curve (_type_) none 13) + (cubic-curve-method-9 (_type_ vector vector vector vector) none) + (cubic-curve-method-10 (_type_ vector float) vector) + (cubic-curve-method-11 (_type_ vector float) vector) + (cubic-curve-method-12 (_type_ vector float) vector) + (debug-draw-curve (_type_) none) ) ) diff --git a/goal_src/jak2/engine/physics/trajectory.gc b/goal_src/jak2/engine/physics/trajectory.gc index ccc777b091a..cce583c1df6 100644 --- a/goal_src/jak2/engine/physics/trajectory.gc +++ b/goal_src/jak2/engine/physics/trajectory.gc @@ -7,23 +7,23 @@ ;; DECOMP BEGINS -(defmethod compute-trans-at-time trajectory ((this trajectory) (arg0 float) (arg1 vector)) +(defmethod compute-trans-at-time ((this trajectory) (arg0 float) (arg1 vector)) (vector+float*! arg1 (-> this initial-position) (-> this initial-velocity) arg0) (+! (-> arg1 y) (* 0.5 arg0 arg0 (-> this gravity))) arg1 ) -(defmethod compute-transv-at-time trajectory ((this trajectory) (arg0 float) (arg1 vector)) +(defmethod compute-transv-at-time ((this trajectory) (arg0 float) (arg1 vector)) (set! (-> arg1 quad) (-> this initial-velocity quad)) (+! (-> arg1 y) (* arg0 (-> this gravity))) arg1 ) -(defmethod compute-time-until-apex trajectory ((this trajectory)) +(defmethod compute-time-until-apex ((this trajectory)) (/ (- (-> this initial-velocity y)) (-> this gravity)) ) -(defmethod setup-from-to-duration! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-duration! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (set! (-> this initial-position quad) (-> arg0 quad)) (set! (-> this gravity) arg3) (set! (-> this time) arg2) @@ -36,7 +36,7 @@ (none) ) -(defmethod setup-from-to-xz-vel! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-xz-vel! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let ((f0-1 (/ (vector-vector-xz-distance arg1 arg0) arg2))) (setup-from-to-duration! this arg0 arg1 f0-1 arg3) ) @@ -44,7 +44,7 @@ (none) ) -(defmethod setup-from-to-y-vel! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-y-vel! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let* ((f0-0 arg2) (f1-3 (- (* f0-0 f0-0) (* 2.0 (- (-> arg0 y) (-> arg1 y)) arg3))) (f0-3 900.0) @@ -60,7 +60,7 @@ (none) ) -(defmethod setup-from-to-height! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-height! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let* ((f0-1 (+ arg2 (fmax (-> arg0 y) (-> arg1 y)))) (f1-4 (* 2.0 (- (-> arg0 y) f0-1) arg3)) (f0-4 4096.0) @@ -75,7 +75,7 @@ ) ;; WARN: Function (method 16 trajectory) has a return type of none, but the expression builder found a return statement. -(defmethod setup-from-to-duration-and-height! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-duration-and-height! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let ((f0-1 (- (-> arg1 y) (-> arg0 y)))) (cond ((= f0-1 0.0) @@ -107,7 +107,7 @@ (none) ) -(defmethod debug-draw trajectory ((this trajectory)) +(defmethod debug-draw ((this trajectory)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 10) @@ -133,7 +133,7 @@ (none) ) -(defmethod initialize impact-control ((this impact-control) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) +(defmethod initialize ((this impact-control) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) (set-time! (-> this start-time)) (set! (-> this process) (the-as (pointer process-drawable) (process->ppointer arg0))) (set! (-> this joint) arg1) @@ -144,7 +144,7 @@ this ) -(defmethod update-from-cspace impact-control ((this impact-control)) +(defmethod update-from-cspace ((this impact-control)) (when (>= (-> this joint) 0) (set! (-> this trans 1 quad) (-> this trans 0 quad)) (vector<-cspace! (the-as vector (-> this trans)) (-> this process 0 node-list data (-> this joint))) @@ -154,7 +154,7 @@ (none) ) -(defmethod impact-control-method-11 impact-control ((this impact-control) (arg0 collide-query) (arg1 process) (arg2 pat-surface)) +(defmethod impact-control-method-11 ((this impact-control) (arg0 collide-query) (arg1 process) (arg2 pat-surface)) (set! (-> arg0 start-pos quad) (-> this trans 1 quad)) (set! (-> arg0 move-dist quad) (-> this dir quad)) (let ((v1-2 (ppointer->process (-> this process))) @@ -201,13 +201,13 @@ ) ) -(defmethod initialize point-tracker ((this point-tracker) (arg0 vector) (arg1 vector)) +(defmethod initialize ((this point-tracker) (arg0 vector) (arg1 vector)) (set! (-> this trans 0 quad) (-> arg0 quad)) (set! (-> this trans 1 quad) (-> arg1 quad)) this ) -(defmethod point-tracker-method-10 point-tracker ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod point-tracker-method-10 ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (cond ((>= 0.0 arg3) (set! (-> arg0 quad) (-> arg1 quad)) @@ -224,7 +224,7 @@ arg0 ) -(defmethod point-tracker-method-11 point-tracker ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod point-tracker-method-11 ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (with-pp (let ((v1-1 (point-tracker-method-10 this (new 'stack-no-clear 'vector) arg1 arg2 arg3))) (vector-! arg0 v1-1 arg1) @@ -234,7 +234,7 @@ ) ) -(defmethod combo-tracker-method-13 combo-tracker ((this combo-tracker) (arg0 handle) (arg1 vector) (arg2 float) (arg3 vector) (arg4 float)) +(defmethod combo-tracker-method-13 ((this combo-tracker) (arg0 handle) (arg1 vector) (arg2 float) (arg3 vector) (arg4 float)) (cond ((send-event (handle->process arg0) 'combo) (let ((gp-1 (handle->process arg0))) @@ -285,14 +285,14 @@ ) ) -(defmethod combo-tracker-method-12 combo-tracker ((this combo-tracker) (arg0 vector) (arg1 vector) (arg2 process) (arg3 time-frame)) +(defmethod combo-tracker-method-12 ((this combo-tracker) (arg0 vector) (arg1 vector) (arg2 process) (arg3 time-frame)) (initialize this arg0 arg1) (set! (-> this target) (process->handle arg2)) (set! (-> this move-start-time) arg3) this ) -(defmethod point-tracker-method-11 combo-tracker ((this combo-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod point-tracker-method-11 ((this combo-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -398,7 +398,7 @@ ) ) -(defmethod cubic-curve-method-9 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod cubic-curve-method-9 ((this cubic-curve) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -442,7 +442,7 @@ ) ) -(defmethod cubic-curve-method-10 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 float)) +(defmethod cubic-curve-method-10 ((this cubic-curve) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'trajectory))) (let ((f0-1 (* arg1 arg1))) (set-vector! (-> v1-0 initial-position) 1.0 arg1 f0-1 (* f0-1 arg1)) @@ -453,7 +453,7 @@ arg0 ) -(defmethod cubic-curve-method-11 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 float)) +(defmethod cubic-curve-method-11 ((this cubic-curve) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'trajectory))) (set-vector! (-> v1-0 initial-position) 0.0 1.0 (* 2.0 arg1) (* 3.0 arg1 arg1)) (vector-matrix*! arg0 (-> v1-0 initial-position) (-> this mat)) @@ -462,7 +462,7 @@ arg0 ) -(defmethod cubic-curve-method-12 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 float)) +(defmethod cubic-curve-method-12 ((this cubic-curve) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'trajectory))) (set-vector! (-> v1-0 initial-position) 0.0 0.0 2.0 (* 6.0 arg1)) (vector-matrix*! arg0 (-> v1-0 initial-position) (-> this mat)) @@ -471,7 +471,7 @@ arg0 ) -(defmethod debug-draw-curve cubic-curve ((this cubic-curve)) +(defmethod debug-draw-curve ((this cubic-curve)) (let ((s5-0 (new 'stack-no-clear 'trajectory)) (s4-0 10) ) diff --git a/goal_src/jak2/engine/process-drawable/focus.gc b/goal_src/jak2/engine/process-drawable/focus.gc index 7dca3d68863..5bce0181237 100644 --- a/goal_src/jak2/engine/process-drawable/focus.gc +++ b/goal_src/jak2/engine/process-drawable/focus.gc @@ -9,29 +9,26 @@ ;; DECOMP BEGINS (deftype focus (structure) - ((handle handle :offset-assert 0) - (collide-with collide-spec :offset-assert 8) + ((handle handle) + (collide-with collide-spec) ) - :method-count-assert 13 - :size-assert #xc - :flag-assert #xd0000000c (:methods - (clear-focused (_type_) none 9) - (collide-check? (_type_ process-focusable) object 10) - (reset-to-collide-spec (_type_ collide-spec) none 11) - (try-update-focus (_type_ process-focusable) symbol 12) + (clear-focused (_type_) none) + (collide-check? (_type_ process-focusable) object) + (reset-to-collide-spec (_type_ collide-spec) none) + (try-update-focus (_type_ process-focusable) symbol) ) ) -(defmethod reset-to-collide-spec focus ((this focus) (arg0 collide-spec)) +(defmethod reset-to-collide-spec ((this focus) (arg0 collide-spec)) (set! (-> this collide-with) arg0) (set! (-> this handle) (the-as handle #f)) 0 (none) ) -(defmethod collide-check? focus ((this focus) (arg0 process-focusable)) +(defmethod collide-check? ((this focus) (arg0 process-focusable)) (when (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead)))) (let* ((s5-0 (-> arg0 root)) (v1-2 (if (type? s5-0 collide-shape) @@ -44,14 +41,14 @@ ) ) -(defmethod try-update-focus focus ((this focus) (arg0 process-focusable)) +(defmethod try-update-focus ((this focus) (arg0 process-focusable)) (when (!= (handle->process (-> this handle)) arg0) (set! (-> this handle) (process->handle arg0)) #t ) ) -(defmethod clear-focused focus ((this focus)) +(defmethod clear-focused ((this focus)) (set! (-> this handle) (the-as handle #f)) 0 (none) diff --git a/goal_src/jak2/engine/process-drawable/process-drawable.gc b/goal_src/jak2/engine/process-drawable/process-drawable.gc index e6d69cb733f..f91dfda32e3 100644 --- a/goal_src/jak2/engine/process-drawable/process-drawable.gc +++ b/goal_src/jak2/engine/process-drawable/process-drawable.gc @@ -39,7 +39,7 @@ ;; DECOMP BEGINS -(defmethod add-to-loading-level skeleton-group ((this skeleton-group)) +(defmethod add-to-loading-level ((this skeleton-group)) (let ((v1-1 (-> *level* loading-level))) (if v1-1 (set-loaded-art (-> v1-1 art-group) this) @@ -234,7 +234,7 @@ ) ) -(defmethod lod-set! draw-control ((this draw-control) (arg0 int)) +(defmethod lod-set! ((this draw-control) (arg0 int)) (let ((v1-1 (max 0 (min arg0 (-> this lod-set max-lod))))) (set! (-> this desired-lod) v1-1) (when (!= (-> this cur-lod) v1-1) @@ -249,7 +249,7 @@ (none) ) -(defmethod lods-assign! draw-control ((this draw-control) (arg0 lod-set)) +(defmethod lods-assign! ((this draw-control) (arg0 lod-set)) (mem-copy! (the-as pointer (-> this lod-set)) (the-as pointer arg0) 49) (let ((a1-2 (min (-> this cur-lod) (-> this lod-set max-lod)))) (set! (-> this cur-lod) -1) @@ -259,7 +259,7 @@ (none) ) -(defmethod setup-masks draw-control ((this draw-control) (arg0 int) (arg1 int)) +(defmethod setup-masks ((this draw-control) (arg0 int) (arg1 int)) "TODO - use the enum types" (local-vars (v1-4 int) (a2-1 (array uint64))) (let ((a1-2 (logior (logclear (-> this seg-mask) arg0) arg1))) @@ -287,7 +287,7 @@ (none) ) -(defmethod setup-lods! lod-set ((this lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity)) +(defmethod setup-lods! ((this lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity)) (local-vars (sv-16 res-tag)) (let ((v1-0 (-> arg1 length)) (s3-0 (-> arg0 max-lod)) @@ -325,7 +325,7 @@ this ) -(defmethod setup-cspace-and-add draw-control ((this draw-control) (arg0 art-joint-geo) (arg1 symbol)) +(defmethod setup-cspace-and-add ((this draw-control) (arg0 art-joint-geo) (arg1 symbol)) (let ((s5-0 ((method-of-type cspace-array new) arg1 cspace-array (+ (-> arg0 length) 1)))) (let ((v0-1 ((method-of-type skeleton new) arg1 skeleton (+ (-> arg0 length) 1)))) (set! (-> this skeleton) v0-1) @@ -396,7 +396,7 @@ 0 ) -(defmethod do-joint-math draw-control ((this draw-control) (arg0 cspace-array) (arg1 joint-control)) +(defmethod do-joint-math ((this draw-control) (arg0 cspace-array) (arg1 joint-control)) (with-pp (cond ((logtest? (-> this status) (draw-control-status no-draw no-draw-temp)) @@ -485,7 +485,7 @@ ) ) -(defmethod cleanup-for-death process-drawable ((this process-drawable)) +(defmethod cleanup-for-death ((this process-drawable)) (when (type? (-> this root) collide-shape) (let ((v1-2 (-> (the-as collide-shape (-> this root)) root-prim))) (set! (-> v1-2 prim-core collide-as) (collide-spec)) @@ -501,7 +501,7 @@ (none) ) -(defmethod relocate-nav process-drawable ((this process-drawable) (arg0 int)) +(defmethod relocate-nav ((this process-drawable) (arg0 int)) (set! (-> this nav) (the-as nav-control (&+ (the-as pointer (-> this nav)) arg0))) 0 (none) @@ -556,7 +556,7 @@ (none) ) -(defmethod deactivate process-drawable ((this process-drawable)) +(defmethod deactivate ((this process-drawable)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) @@ -753,7 +753,7 @@ s2-0 ) -(defmethod initialize-skeleton process-drawable ((this process-drawable) (arg0 skeleton-group) (arg1 pair)) +(defmethod initialize-skeleton ((this process-drawable) (arg0 skeleton-group) (arg1 pair)) (local-vars (v1-14 art-element)) (if (not arg0) (go process-drawable-art-error "skel-group") @@ -824,7 +824,7 @@ (-> this draw) ) -(defmethod initialize-skeleton-by-name process-drawable ((this process-drawable) (arg0 string)) +(defmethod initialize-skeleton-by-name ((this process-drawable) (arg0 string)) (let* ((s4-0 *level*) (s3-0 (method-of-object s4-0 art-group-get-by-name)) ) @@ -839,7 +839,7 @@ (-> this draw) ) -(defmethod apply-alignment process-drawable ((this process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment ((this process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (with-pp (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) (let* ((s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) @@ -1192,7 +1192,7 @@ 0 ) -(defmethod update-anim-data joint-control ((this joint-control)) +(defmethod update-anim-data ((this joint-control)) (local-vars (s7-0 none) (ra-0 int)) (let ((s5-0 (+ (-> this active-channels) (-> this float-channels)))) (dotimes (s4-0 (the-as int s5-0)) @@ -1233,7 +1233,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod evaluate-joint-control process-drawable ((this process-drawable)) +(defmethod evaluate-joint-control ((this process-drawable)) (local-vars (s1-0 joint-control-channel) (s2-0 int) (s4-0 uint) (s7-0 none) (ra-0 int)) (let ((gp-0 (-> this skel))) (let ((a0-1 (-> gp-0 top-anim))) @@ -1345,7 +1345,7 @@ (none) ) -(defmethod current-cycle-distance joint-control ((this joint-control)) +(defmethod current-cycle-distance ((this joint-control)) (cond ((< (the-as int (-> this root-channel)) (the-as int (-> this channel (-> this active-channels)))) (let ((s4-0 (-> this root-channel (-> this root-channel 0 group-size))) @@ -1391,7 +1391,7 @@ ) ;; WARN: Return type mismatch top-anim-joint-control vs none. -(defmethod reset top-anim-joint-control ((this top-anim-joint-control)) +(defmethod reset ((this top-anim-joint-control)) (let ((v0-0 this)) (set! (-> v0-0 interp) 0.0) (set! (-> v0-0 frame-targ) #f) @@ -1409,7 +1409,7 @@ (none) ) -(defmethod get-channel top-anim-joint-control ((this top-anim-joint-control) (arg0 int)) +(defmethod get-channel ((this top-anim-joint-control) (arg0 int)) (case arg0 ((1) (case (-> this process 0 skel float-channels) @@ -1437,15 +1437,15 @@ ) ) -(defmethod push-anim-to-targ top-anim-joint-control ((this top-anim-joint-control) - (arg0 art-joint-anim) - (arg1 float) - (arg2 int) - (arg3 int) - (arg4 float) - (arg5 float) - (arg6 symbol) - ) +(defmethod push-anim-to-targ ((this top-anim-joint-control) + (arg0 art-joint-anim) + (arg1 float) + (arg2 int) + (arg3 int) + (arg4 float) + (arg5 float) + (arg6 symbol) + ) (when (!= (-> this interp) 0.0) (let ((v1-1 this)) (set! (-> v1-1 frame-targ) arg0) @@ -1462,7 +1462,7 @@ ) ) (set! (-> v1-1 frame-post-end) (/ arg5 (-> arg0 artist-step))) - (set! (-> v1-1 frame-push-time) (current-time)) + (set-time! (-> v1-1 frame-push-time)) (set! (-> v1-1 frame-post-put-away) #f) ) (if arg6 @@ -1473,7 +1473,7 @@ (none) ) -(defmethod update top-anim-joint-control ((this top-anim-joint-control)) +(defmethod update ((this top-anim-joint-control)) (with-pp (let* ((v1-0 (-> this process)) (pp (if v1-0 @@ -1587,7 +1587,9 @@ ) ) (when s5-0 - (set! (-> s5-0 frame-num) (- (the float (+ (-> s5-0 frame-group frames num-frames) -1)) (-> this frame-start))) + (set! (-> s5-0 frame-num) + (- (the float (+ (-> s5-0 frame-group frames num-frames) -1)) (-> this frame-start)) + ) (set! (-> this base-anim-speed) 1.0) (set! (-> this base-anim-blend) 0.1333333) ) @@ -1701,7 +1703,7 @@ ) ) ) - (set! (-> this update-time) (current-time)) + (set-time! (-> this update-time)) 0 (none) ) @@ -1778,7 +1780,7 @@ (while (and *target* (focus-test? *target* in-air)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (process-grab? *target* #f) (while (or (-> *setting-control* user-current talking) (-> *setting-control* user-current spooling) @@ -1787,7 +1789,7 @@ ) (suspend) ) - (while (< (- (current-time) (-> self state-time)) arg0) + (while (not (time-elapsed? (-> self state-time) arg0)) (suspend) ) (process-release? *target*) diff --git a/goal_src/jak2/engine/process-drawable/process-focusable.gc b/goal_src/jak2/engine/process-drawable/process-focusable.gc index b29bb4ef286..7c54adcdb41 100644 --- a/goal_src/jak2/engine/process-drawable/process-focusable.gc +++ b/goal_src/jak2/engine/process-drawable/process-focusable.gc @@ -45,27 +45,23 @@ ;; DECOMP BEGINS (deftype process-focusable (process-drawable) - ((root collide-shape :override) - (focus-status focus-status :offset-assert 200) + ((root collide-shape :override) + (focus-status focus-status) ) - :heap-base #x50 - :method-count-assert 27 - :size-assert #xcc - :flag-assert #x1b005000cc (:methods - (get-trans (_type_ int) vector 20) - (get-quat (_type_ int) quaternion 21) - (get-transv (_type_) vector 22) - (time-to-apex-or-ground (_type_ int) int 23) - (get-water-height (_type_) meters 24) - (get-notice-time (_type_) time-frame 25) - (get-inv-mass (_type_) float 26) + (get-trans (_type_ int) vector) + (get-quat (_type_ int) quaternion) + (get-transv (_type_) vector) + (time-to-apex-or-ground (_type_ int) int) + (get-water-height (_type_) meters) + (get-notice-time (_type_) time-frame) + (get-inv-mass (_type_) float) ) ) ;; WARN: Return type mismatch structure vs vector. -(defmethod get-trans process-focusable ((this process-focusable) (arg0 int)) +(defmethod get-trans ((this process-focusable) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (let ((gp-0 (-> this root))) (the-as vector (cond @@ -89,29 +85,29 @@ ) ) -(defmethod get-transv process-focusable ((this process-focusable)) +(defmethod get-transv ((this process-focusable)) (-> this root transv) ) -(defmethod get-quat process-focusable ((this process-focusable) (arg0 int)) +(defmethod get-quat ((this process-focusable) (arg0 int)) (-> this root quat) ) -(defmethod time-to-apex-or-ground process-focusable ((this process-focusable) (arg0 int)) +(defmethod time-to-apex-or-ground ((this process-focusable) (arg0 int)) 0 ) ;; WARN: Return type mismatch int vs meters. -(defmethod get-water-height process-focusable ((this process-focusable)) +(defmethod get-water-height ((this process-focusable)) (the-as meters 0) ) -(defmethod get-inv-mass process-focusable ((this process-focusable)) +(defmethod get-inv-mass ((this process-focusable)) 0.0 ) ;; WARN: Return type mismatch int vs time-frame. -(defmethod get-notice-time process-focusable ((this process-focusable)) +(defmethod get-notice-time ((this process-focusable)) (the-as time-frame 0) ) diff --git a/goal_src/jak2/engine/process-drawable/process-taskable-h.gc b/goal_src/jak2/engine/process-drawable/process-taskable-h.gc index d4d6b755754..ff264aa7e5a 100644 --- a/goal_src/jak2/engine/process-drawable/process-taskable-h.gc +++ b/goal_src/jak2/engine/process-drawable/process-taskable-h.gc @@ -8,36 +8,34 @@ ;; DECOMP BEGINS (deftype process-taskable (process-focusable) - ((task game-task-control :offset-assert 204) - (ambient ambient-control :inline :offset-assert 208) - (neck-joint-index int32 :offset-assert 224) - (talk-message text-id :offset-assert 228) - (bounce-away symbol :offset-assert 232) - (will-talk symbol :offset-assert 236) - (look-at-me symbol :offset-assert 240) - (hide-during-movie symbol :offset-assert 244) - (talk-distance meters :offset-assert 248) - (talk-height meters :offset-assert 252) - (last-talk time-frame :offset-assert 256) - (want-to-say time-frame :offset-assert 264) - (birth-time time-frame :offset-assert 272) - (slave handle :offset-assert 280) + ((task game-task-control) + (ambient ambient-control :inline) + (neck-joint-index int32) + (talk-message text-id) + (bounce-away symbol) + (will-talk symbol) + (look-at-me symbol) + (hide-during-movie symbol) + (talk-distance meters) + (talk-height meters) + (last-talk time-frame) + (want-to-say time-frame) + (birth-time time-frame) + (slave handle) ) - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 + (:state-methods + hide + idle + (active game-task-event) + (play-game game-task-event) + ) (:methods - (hide () _type_ :state 27) - (idle () _type_ :state 28) - (active (game-task-event) _type_ :state 29) - (play-game (game-task-event) _type_ :state 30) - (process-taskable-method-31 (_type_) none 31) - (process-taskable-method-32 (_type_) none 32) - (init-art! (_type_) none 33) - (process-taskable-method-34 (_type_) symbol 34) - (get-art-elem (_type_) art-element 35) - (process-taskable-method-36 (_type_) none 36) - (process-taskable-method-37 (_type_) none 37) + (process-taskable-method-31 (_type_) none) + (process-taskable-method-32 (_type_) none) + (init-art! (_type_) none) + (process-taskable-method-34 (_type_) symbol) + (get-art-elem (_type_) art-element) + (process-taskable-method-36 (_type_) none) + (process-taskable-method-37 (_type_) none) ) ) diff --git a/goal_src/jak2/engine/process-drawable/process-taskable.gc b/goal_src/jak2/engine/process-drawable/process-taskable.gc index 0b6521068c0..072cd06bdee 100644 --- a/goal_src/jak2/engine/process-drawable/process-taskable.gc +++ b/goal_src/jak2/engine/process-drawable/process-taskable.gc @@ -8,7 +8,7 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch process-focusable vs process-taskable. -(defmethod relocate process-taskable ((this process-taskable) (arg0 int)) +(defmethod relocate ((this process-taskable) (arg0 int)) (if (nonzero? (-> this task)) (&+! (-> this task) arg0) ) @@ -36,12 +36,12 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (none) ) -(defmethod process-taskable-method-34 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-34 ((this process-taskable)) #t ) ;; WARN: Return type mismatch art-joint-anim vs art-element. -(defmethod get-art-elem process-taskable ((this process-taskable)) +(defmethod get-art-elem ((this process-taskable)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (the-as art-element (if (> (-> this skel active-channels) 0) @@ -50,13 +50,13 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) -(defmethod process-taskable-method-36 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-36 ((this process-taskable)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod process-taskable-method-37 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-37 ((this process-taskable)) (let ((v1-1 (-> this draw shadow-ctrl))) (cond ((and (-> this draw shadow) @@ -339,7 +339,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy :post (-> (method-of-type process-taskable idle) post) ) -(defmethod process-taskable-method-31 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-31 ((this process-taskable)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) (set! (-> s5-0 total-prims) (the-as uint 4)) @@ -378,7 +378,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (none) ) -(defmethod process-taskable-method-32 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-32 ((this process-taskable)) (logior! (-> this skel status) (joint-control-status eye-anim)) (set! (-> this talk-message) (text-id press-triangle-to-talk)) (set! (-> this bounce-away) #t) @@ -409,14 +409,14 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (none) ) -(defmethod init-art! process-taskable ((this process-taskable)) +(defmethod init-art! ((this process-taskable)) "@see [[initialize-skeleton]]" 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! process-taskable ((this process-taskable) (arg0 entity-actor)) +(defmethod init-from-entity! ((this process-taskable) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/engine/process-drawable/simple-focus.gc b/goal_src/jak2/engine/process-drawable/simple-focus.gc index 541a6c46002..b4c251d6476 100644 --- a/goal_src/jak2/engine/process-drawable/simple-focus.gc +++ b/goal_src/jak2/engine/process-drawable/simple-focus.gc @@ -8,24 +8,20 @@ ;; DECOMP BEGINS (deftype simple-focus (process-focusable) - ((first-time? symbol :offset-assert 204) + ((first-time? symbol) ) - :heap-base #x50 - :method-count-assert 28 - :size-assert #xd0 - :flag-assert #x1c005000d0 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) -(defmethod get-trans simple-focus ((this simple-focus) (arg0 int)) +(defmethod get-trans ((this simple-focus) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (-> this root trans) ) -(defmethod run-logic? simple-focus ((this simple-focus)) +(defmethod run-logic? ((this simple-focus)) (when (-> this first-time?) (set! (-> this first-time?) #f) #t diff --git a/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc b/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc index 9569fd663e1..6463d36cf5c 100644 --- a/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc +++ b/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc @@ -8,17 +8,13 @@ ;; DECOMP BEGINS (deftype simple-nav-sphere (process-drawable) - ((root collide-shape :override) - (first-time? symbol :offset-assert 200) - (track-joint int32 :offset-assert 204) + ((root collide-shape :override) + (first-time? symbol) + (track-joint int32) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) + (:state-methods + idle + active ) ) @@ -45,7 +41,7 @@ ) ) -(defmethod run-logic? simple-nav-sphere ((this simple-nav-sphere)) +(defmethod run-logic? ((this simple-nav-sphere)) (cond (*display-nav-marks* #t diff --git a/goal_src/jak2/engine/ps2/memcard-h.gc b/goal_src/jak2/engine/ps2/memcard-h.gc index ce49f6ca08e..6499d2758a4 100644 --- a/goal_src/jak2/engine/ps2/memcard-h.gc +++ b/goal_src/jak2/engine/ps2/memcard-h.gc @@ -34,51 +34,42 @@ (deftype mc-handle (int32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype mc-file-info (structure) - ((present int32 :offset-assert 0) - (blind-data float 16 :offset 4) - (blind-data-int8 int8 64 :offset 4) - (level-index int32 :offset 4) - (gem-count float :offset 8) - (skill-count float :offset 12) - (completion-percentage float :offset 16) - (minute uint8 :offset 24) - (hour uint8 :offset 25) - (week uint8 :offset 26) - (day uint8 :offset 27) - (month uint8 :offset 28) - (year uint8 :offset 29) - (game-time0 uint32 :offset 36) - (game-time1 uint32 :offset 40) - (secrets uint32 :offset 44) - (features uint32 :offset 48) + ((present int32) + (blind-data float 16 :offset 4) + (blind-data-int8 int8 64 :overlay-at (-> blind-data 0)) + (level-index int32 :overlay-at (-> blind-data 0)) + (gem-count float :overlay-at (-> blind-data 1)) + (skill-count float :overlay-at (-> blind-data 2)) + (completion-percentage float :overlay-at (-> blind-data 3)) + (minute uint8 :overlay-at (-> blind-data-int8 20)) + (hour uint8 :overlay-at (-> blind-data-int8 21)) + (week uint8 :overlay-at (-> blind-data-int8 22)) + (day uint8 :overlay-at (-> blind-data-int8 23)) + (month uint8 :overlay-at (-> blind-data-int8 24)) + (year uint8 :overlay-at (-> blind-data-int8 25)) + (game-time0 uint32 :overlay-at (-> blind-data 8)) + (game-time1 uint32 :overlay-at (-> blind-data 9)) + (secrets uint32 :overlay-at (-> blind-data 10)) + (features uint32 :overlay-at (-> blind-data 11)) ) :pack-me - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) (deftype mc-slot-info (structure) - ((handle int32 :offset-assert 0) - (known int32 :offset-assert 4) - (formatted int32 :offset-assert 8) - (inited int32 :offset-assert 12) - (last-file int32 :offset-assert 16) - (mem-required int32 :offset-assert 20) - (mem-actual int32 :offset-assert 24) - (file mc-file-info 4 :inline :offset-assert 28) + ((handle int32) + (known int32) + (formatted int32) + (inited int32) + (last-file int32) + (mem-required int32) + (mem-actual int32) + (file mc-file-info 4 :inline) ) :pack-me - :method-count-assert 9 - :size-assert #x12c - :flag-assert #x90000012c ) diff --git a/goal_src/jak2/engine/ps2/pad.gc b/goal_src/jak2/engine/ps2/pad.gc index a2efa9d36e6..bce30f60d70 100644 --- a/goal_src/jak2/engine/ps2/pad.gc +++ b/goal_src/jak2/engine/ps2/pad.gc @@ -83,18 +83,15 @@ The cpad-set-buzz! function can be used for vibration. ;; decomp begins (deftype scf-time (structure) - ((stat uint8 :offset-assert 0) - (second uint8 :offset-assert 1) - (minute uint8 :offset-assert 2) - (hour uint8 :offset-assert 3) - (week uint8 :offset-assert 4) - (day uint8 :offset-assert 5) - (month uint8 :offset-assert 6) - (year uint8 :offset-assert 7) + ((stat uint8) + (second uint8) + (minute uint8) + (hour uint8) + (week uint8) + (day uint8) + (month uint8) + (year uint8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (define-extern scf-get-time (function scf-time none)) @@ -106,59 +103,53 @@ The cpad-set-buzz! function can be used for vibration. (deftype hw-cpad (basic) (;; BASIC CONTROLLER data ;; status = 0x40 | (data length / 2) - (valid uint8 :offset-assert 4) ;; 0 if success, 255 if fail - (status uint8 :offset-assert 5) ;; depends on controller - (button0 uint16 :offset-assert 6) ;; binary button states! + (valid uint8) ;; 0 if success, 255 if fail + (status uint8) ;; depends on controller + (button0 uint16) ;; binary button states! ;; DUALSHOCK or JOYSTICK data ;; status (dualshock) = 0x70 | (data length / 2) ;; status (joystick) = 0x50 | (data length / 2) - (rightx uint8 :offset-assert 8) ;; right stick xdir - (righty uint8 :offset-assert 9) ;; right stick ydir - (leftx uint8 :offset-assert 10) ;; left stick xdir - (lefty uint8 :offset-assert 11) ;; left stick ydir + (rightx uint8) ;; right stick xdir + (righty uint8) ;; right stick ydir + (leftx uint8) ;; left stick xdir + (lefty uint8) ;; left stick ydir ;; DUALSHOCK 2 data ;; status = 0x70 | (data length / 2) - (abutton uint8 12 :offset-assert 12) ;; pressure sensitivity information + (abutton uint8 12) ;; pressure sensitivity information ;; pad buffer needs to be 32 bytes large. - (dummy uint8 12 :offset-assert 24) + (dummy uint8 12) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; data from hardware + additional info calculated here. (deftype cpad-info (hw-cpad) - ((number int32 :offset-assert 36) - (cpad-file int32 :offset-assert 40) - (button0-abs pad-buttons 3 :offset-assert 44) - (button0-shadow-abs pad-buttons 1 :offset-assert 56) - (button0-rel pad-buttons 3 :offset-assert 60) - (stick0-dir float :offset-assert 72) - (stick0-speed float :offset-assert 76) - (new-pad int32 :offset-assert 80) - (state int32 :offset-assert 84) - (align uint8 6 :offset-assert 88) - (direct uint8 6 :offset-assert 94) - (buzz-val uint8 2 :offset-assert 100) - (buzz-pause-val uint8 1 :offset-assert 102) - (buzz-pause-time uint8 :offset-assert 103) - (buzz-time time-frame 2 :offset-assert 104) - (buzz basic :offset-assert 120) - (buzz-act int32 :offset-assert 124) - (change-time time-frame :offset-assert 128) - (old-rightx uint8 2 :offset-assert 136) - (old-righty uint8 2 :offset-assert 138) - (old-leftx uint8 2 :offset-assert 140) - (old-lefty uint8 2 :offset-assert 142) + ((number int32) + (cpad-file int32) + (button0-abs pad-buttons 3) + (button0-shadow-abs pad-buttons 1) + (button0-rel pad-buttons 3) + (stick0-dir float) + (stick0-speed float) + (new-pad int32) + (state int32) + (align uint8 6) + (direct uint8 6) + (buzz-val uint8 2) + (buzz-pause-val uint8 1) + (buzz-pause-time uint8) + (buzz-time time-frame 2) + (buzz basic) + (buzz-act int32) + (change-time time-frame) + (old-rightx uint8 2) + (old-righty uint8 2) + (old-leftx uint8 2) + (old-lefty uint8 2) ) - :method-count-assert 10 - :size-assert #x90 - :flag-assert #xa00000090 (:methods - (new (symbol type int) _type_ 0) - (adjust-to-screen-flip (_type_) int 9) + (new (symbol type int) _type_) + (adjust-to-screen-flip (_type_) int) ) ) @@ -217,14 +208,11 @@ The cpad-set-buzz! function can be used for vibration. ;; List of controllers. It always has 2 controllers. (deftype cpad-list (basic) - ((num-cpads int32 :offset-assert 4) - (cpads cpad-info 2 :offset-assert 8) + ((num-cpads int32) + (cpads cpad-info 2) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) @@ -566,32 +554,29 @@ The cpad-set-buzz! function can be used for vibration. ) (deftype mouse-info (basic) - ((active symbol :offset-assert 4) - (cursor basic :offset-assert 8) - (valid symbol :offset-assert 12) - (id uint8 :offset-assert 16) - (status uint16 :offset-assert 18) - (button0 uint16 :offset-assert 20) - (deltax int8 :offset-assert 22) - (deltay int8 :offset-assert 23) - (wheel uint8 :offset-assert 24) - (change-time time-frame :offset-assert 32) - (button0-abs mouse-buttons 3 :offset-assert 40) - (button0-shadow-abs mouse-buttons 1 :offset-assert 52) - (button0-rel mouse-buttons 3 :offset-assert 56) - (pos vector 2 :inline :offset-assert 80) - (posx float :offset 80) - (posy float :offset 84) - (oldposx float :offset 96) - (oldposy float :offset 100) - (speedx float :offset 92) - (speedy float :offset 108) + ((active symbol) + (cursor basic) + (valid symbol) + (id uint8) + (status uint16) + (button0 uint16) + (deltax int8) + (deltay int8) + (wheel uint8) + (change-time time-frame) + (button0-abs mouse-buttons 3) + (button0-shadow-abs mouse-buttons 1) + (button0-rel mouse-buttons 3) + (pos vector 2 :inline) + (posx float :overlay-at (-> pos 0 data 0)) + (posy float :overlay-at (-> pos 0 data 1)) + (oldposx float :offset 96) + (oldposy float :offset 100) + (speedx float :overlay-at (-> pos 0 data 3)) + (speedy float :offset 108) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) diff --git a/goal_src/jak2/engine/ps2/rpc-h.gc b/goal_src/jak2/engine/ps2/rpc-h.gc index 79d1ec855c5..03effe1843b 100644 --- a/goal_src/jak2/engine/ps2/rpc-h.gc +++ b/goal_src/jak2/engine/ps2/rpc-h.gc @@ -8,18 +8,15 @@ ;; DECOMP BEGINS (deftype rpc-buffer (basic) - ((elt-size uint32 :offset-assert 4) - (elt-count uint32 :offset-assert 8) - (elt-used uint32 :offset-assert 12) - (busy basic :offset-assert 16) - (base pointer :offset-assert 20) - (data uint8 :dynamic :offset 32) + ((elt-size uint32) + (elt-count uint32) + (elt-used uint32) + (busy basic) + (base pointer) + (data uint8 :dynamic :offset 32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 (:methods - (new (symbol type uint uint) rpc-buffer 0) + (new (symbol type uint uint) rpc-buffer) ) ) @@ -38,22 +35,19 @@ ) (deftype rpc-buffer-pair (basic) - ((buffer rpc-buffer 2 :offset-assert 4) - (current rpc-buffer :offset-assert 12) - (last-recv-buffer pointer :offset-assert 16) - (rpc-port int32 :offset-assert 20) + ((buffer rpc-buffer 2) + (current rpc-buffer) + (last-recv-buffer pointer) + (rpc-port int32) ) - :method-count-assert 15 - :size-assert #x18 - :flag-assert #xf00000018 (:methods - (new (symbol type uint uint int) rpc-buffer-pair 0) - (call (rpc-buffer-pair uint pointer uint) int 9) - (add-element (rpc-buffer-pair) pointer 10) - (decrement-elt-used (rpc-buffer-pair) int 11) - (sync (rpc-buffer-pair symbol) int 12) - (check-busy (rpc-buffer-pair) symbol 13) - (pop-last-received (rpc-buffer-pair) pointer 14) + (new (symbol type uint uint int) rpc-buffer-pair) + (call (rpc-buffer-pair uint pointer uint) int) + (add-element (rpc-buffer-pair) pointer) + (decrement-elt-used (rpc-buffer-pair) int) + (sync (rpc-buffer-pair symbol) int) + (check-busy (rpc-buffer-pair) symbol) + (pop-last-received (rpc-buffer-pair) pointer) ) ) @@ -69,7 +63,7 @@ ) ) -(defmethod sync rpc-buffer-pair ((this rpc-buffer-pair) (arg0 symbol)) +(defmethod sync ((this rpc-buffer-pair) (arg0 symbol)) (let ((s5-0 (if (= (-> this current) (-> this buffer 0)) (-> this buffer 1) (-> this buffer 0) @@ -100,7 +94,7 @@ 0 ) -(defmethod check-busy rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod check-busy ((this rpc-buffer-pair)) (let ((gp-0 (if (= (-> this current) (-> this buffer 0)) (-> this buffer 1) (-> this buffer 0) @@ -119,7 +113,7 @@ #f ) -(defmethod call rpc-buffer-pair ((this rpc-buffer-pair) (arg0 uint) (arg1 pointer) (arg2 uint)) +(defmethod call ((this rpc-buffer-pair) (arg0 uint) (arg1 pointer) (arg2 uint)) (when (nonzero? (-> this current elt-used)) (let ((s2-0 (if (= (-> this current) (-> this buffer 0)) (-> this buffer 1) @@ -164,14 +158,14 @@ 0 ) -(defmethod pop-last-received rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod pop-last-received ((this rpc-buffer-pair)) (let ((v0-0 (-> this last-recv-buffer))) (set! (-> this last-recv-buffer) (the-as pointer #f)) v0-0 ) ) -(defmethod add-element rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod add-element ((this rpc-buffer-pair)) (let ((v1-0 (-> this current))) (when (= (-> v1-0 elt-used) (-> v1-0 elt-count)) (if (zero? (-> this rpc-port)) @@ -187,7 +181,7 @@ ) ) -(defmethod decrement-elt-used rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod decrement-elt-used ((this rpc-buffer-pair)) (if (> (-> this current elt-used) 0) (+! (-> this current elt-used) -1) ) diff --git a/goal_src/jak2/engine/ps2/timer-h.gc b/goal_src/jak2/engine/ps2/timer-h.gc index 819a59b5209..6105d23b609 100644 --- a/goal_src/jak2/engine/ps2/timer-h.gc +++ b/goal_src/jak2/engine/ps2/timer-h.gc @@ -71,44 +71,32 @@ There are two sources for timing: (equf uint8 :offset 10 :size 1) ;; equal-flag (ovff uint8 :offset 11 :size 1) ;; overflow-flag ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; this matches an EE timer (without a HOLD register, timers 2 and 3) ;; Each register is 128-bits wide, but only the lower 32-bits are usable, and the upper ;; 16-bits of that are hardwired to zero. (deftype timer-bank (structure) - ((count uint32 :offset 0) - (mode timer-mode :offset 16) - (comp uint32 :offset 32) + ((count uint32) + (mode timer-mode :offset 16) + (comp uint32 :offset 32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; this matches an EE timer (with a HOLD register, timers 0 and 1) (deftype timer-hold-bank (timer-bank) - ((hold uint32 :offset 48) + ((hold uint32 :offset 48) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; stopwatches are used to measure CPU clock cycles ;; they don't use the timer above, but instead the Count COP0 register ;; which counts CPU clock cycles directly (deftype stopwatch (basic) - ((prev-time-elapsed time-frame :offset-assert 8) - (start-time time-frame :offset-assert 16) - (begin-level int32 :offset-assert 24) + ((prev-time-elapsed time-frame) + (start-time time-frame) + (begin-level int32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; Confusing! What IS this measuring exactly? Hmm... diff --git a/goal_src/jak2/engine/ps2/timer.gc b/goal_src/jak2/engine/ps2/timer.gc index 5aaa0120768..b925d661fd2 100644 --- a/goal_src/jak2/engine/ps2/timer.gc +++ b/goal_src/jak2/engine/ps2/timer.gc @@ -180,7 +180,7 @@ (cpu-ticks-to-seconds (stopwatch-elapsed-ticks this)) ) -(defmethod update-rates! clock ((this clock) (arg0 float)) +(defmethod update-rates! ((this clock) (arg0 float)) "Recompute all clock values for the given clock ratio (arg0)." ;; remember our ratio @@ -217,7 +217,7 @@ arg0 ) -(defmethod advance-by! clock ((this clock) (arg0 float)) +(defmethod advance-by! ((this clock) (arg0 float)) "Advance the clock by arg0 timeframes (as a float). Both counters keep a separate fractional and integer counter." (the int (+ arg0 (-> this accum))) ;; unused @@ -247,7 +247,7 @@ this ) -(defmethod tick! clock ((this clock)) +(defmethod tick! ((this clock)) "Per-game-frame clock tick forward." (if (zero? (logand (-> this mask) (-> *kernel-context* prevent-from-run))) ;; include: ntsc/pal scale, lag, and clock ratio. @@ -257,7 +257,7 @@ this ) -(defmethod reset! clock ((this clock)) +(defmethod reset! ((this clock)) "Reset a clock to 1000s, rate of 1." (set! (-> this frame-counter) (seconds 1000)) (set! (-> this integral-frame-counter) (the-as uint #x493e0)) @@ -269,14 +269,14 @@ (none) ) -(defmethod save! clock ((this clock) (arg0 (pointer uint64))) +(defmethod save! ((this clock) (arg0 (pointer uint64))) "Save a clock's state to a buffer, return bytes used." (set! (-> arg0 0) (the-as uint (-> this frame-counter))) (set! (-> arg0 1) (-> this integral-frame-counter)) 16 ) -(defmethod load! clock ((this clock) (arg0 (pointer uint64))) +(defmethod load! ((this clock) (arg0 (pointer uint64))) "Load a clock's state from a buffer, return bytes used." (set! (-> this frame-counter) (the-as time-frame (-> arg0 0))) (set! (-> this integral-frame-counter) (-> arg0 1)) diff --git a/goal_src/jak2/engine/ps2/vif-h.gc b/goal_src/jak2/engine/ps2/vif-h.gc index 6226b9fc986..5760bf57796 100644 --- a/goal_src/jak2/engine/ps2/vif-h.gc +++ b/goal_src/jak2/engine/ps2/vif-h.gc @@ -29,9 +29,6 @@ Types related to VIF: the PS2's Vector Interface. (er1 uint8 :offset 13 :size 1) (fqc uint8 :offset 24 :size 4) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -41,49 +38,40 @@ Types related to VIF: the PS2's Vector Interface. (stp uint8 :offset 2 :size 1) (stc uint8 :offset 3 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype vif-err (uint32) ((mii uint8 :offset 0 :size 1) - (me0 uint8 :offset 1 :size 1) ;; PS2 hardware bug, must set this to 1 for correct operation. + (me0 uint8 :offset 1 :size 1) (me1 uint8 :offset 2 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype vif-bank (structure) - ((stat uint32 :offset-assert 0) - (fbrst uint32 :offset 16) - (err vif-err :offset 32) - (mark uint32 :offset 48) - (cycle uint32 :offset 64) - (mode uint32 :offset 80) - (num uint32 :offset 96) - (mask uint32 :offset 112) - (code uint32 :offset 128) - (itops uint32 :offset 144) - (base uint32 :offset 160) - (offset uint32 :offset 176) - (tops uint32 :offset 192) - (itop uint32 :offset 208) - (top uint32 :offset 224) - (r0 uint32 :offset 256) - (r1 uint32 :offset 272) - (r2 uint32 :offset 288) - (r3 uint32 :offset 304) - (c0 uint32 :offset 320) - (c1 uint32 :offset 336) - (c2 uint32 :offset 352) - (c3 uint32 :offset 368) + ((stat uint32) + (fbrst uint32 :offset 16) + (err vif-err :offset 32) + (mark uint32 :offset 48) + (cycle uint32 :offset 64) + (mode uint32 :offset 80) + (num uint32 :offset 96) + (mask uint32 :offset 112) + (code uint32 :offset 128) + (itops uint32 :offset 144) + (base uint32 :offset 160) + (offset uint32 :offset 176) + (tops uint32 :offset 192) + (itop uint32 :offset 208) + (top uint32 :offset 224) + (r0 uint32 :offset 256) + (r1 uint32 :offset 272) + (r2 uint32 :offset 288) + (r3 uint32 :offset 304) + (c0 uint32 :offset 320) + (c1 uint32 :offset 336) + (c2 uint32 :offset 352) + (c3 uint32 :offset 368) ) - :method-count-assert 9 - :size-assert #x174 - :flag-assert #x900000174 ) ;; PS2 VIF map. There are no VIFs in OpenGOAL. diff --git a/goal_src/jak2/engine/scene/scene-h.gc b/goal_src/jak2/engine/scene/scene-h.gc index 658a0d716eb..32b5a58861a 100644 --- a/goal_src/jak2/engine/scene/scene-h.gc +++ b/goal_src/jak2/engine/scene/scene-h.gc @@ -12,109 +12,101 @@ ;; DECOMP BEGINS (deftype scene-actor (basic) - ((name string :offset-assert 4) - (level symbol :offset-assert 8) - (art-group string :offset-assert 12) - (prefix string :offset-assert 16) - (draw-frames pair :offset-assert 20) - (scissor-frames pair :offset-assert 24) - (camera int16 :offset-assert 28) - (light-index uint8 :offset-assert 30) - (shadow-mask uint8 :offset-assert 31) - (shadow-values uint32 :offset-assert 32) - (flags uint32 :offset-assert 36) - (command-list basic :offset-assert 40) - (shadow-flags int32 :offset-assert 44) - (shadow-volume-joint basic :offset-assert 48) - (draw-seg uint64 :offset-assert 56) - (no-draw-seg uint64 :offset-assert 64) - (process handle :offset-assert 72) + ((name string) + (level symbol) + (art-group string) + (prefix string) + (draw-frames pair) + (scissor-frames pair) + (camera int16) + (light-index uint8) + (shadow-mask uint8) + (shadow-values uint32) + (flags uint32) + (command-list basic) + (shadow-flags int32) + (shadow-volume-joint basic) + (draw-seg uint64) + (no-draw-seg uint64) + (process handle) ) - :method-count-assert 10 - :size-assert #x50 - :flag-assert #xa00000050 (:methods - (scene-actor-method-9 (_type_ scene-player) (pointer process) 9) + (scene-actor-method-9 (_type_ scene-player) (pointer process)) ) ) (deftype scene (art-group) - ((mask-to-clear process-mask :offset-assert 32) - (entity string :offset-assert 36) - (art-group string :offset-assert 40) - (anim string :offset-assert 44) - (parts int32 :offset-assert 48) - (command-list pair :offset-assert 52) - (cut-list pair :offset-assert 56) - (wait-max-time time-frame :offset-assert 64) - (wait-air-time time-frame :offset-assert 72) - (wait-ground-time time-frame :offset-assert 80) - (draw-target symbol :offset-assert 88) - (abort symbol :offset-assert 92) - (actor (array scene-actor) :offset-assert 96) - (load-point-obj object :offset-assert 100) - (load-point continue-point :offset 100) - (load-point-name string :offset 100) - (end-point-obj object :offset-assert 104) - (end-point continue-point :offset 104) - (end-point-name string :offset 104) - (borrow pair :offset-assert 108) - (sfx-volume float :offset-assert 112) - (ambient-volume float :offset-assert 116) - (music-volume float :offset-assert 120) - (blackout-end symbol :offset-assert 124) - (peaceful symbol :offset-assert 128) - (music-delay float :offset-assert 132) - (save symbol :offset-assert 136) - (scene-task uint16 :offset-assert 140) + ((mask-to-clear process-mask) + (entity string) + (art-group string) + (anim string) + (parts int32) + (command-list pair) + (cut-list pair) + (wait-max-time time-frame) + (wait-air-time time-frame) + (wait-ground-time time-frame) + (draw-target symbol) + (abort symbol) + (actor (array scene-actor)) + (load-point-obj object) + (load-point continue-point :overlay-at load-point-obj) + (load-point-name string :overlay-at load-point-obj) + (end-point-obj object) + (end-point continue-point :overlay-at end-point-obj) + (end-point-name string :overlay-at end-point-obj) + (borrow pair) + (sfx-volume float) + (ambient-volume float) + (music-volume float) + (blackout-end symbol) + (peaceful symbol) + (music-delay float) + (save symbol) + (scene-task uint16) ) - :method-count-assert 17 - :size-assert #x8e - :flag-assert #x110000008e (:methods - (scene-method-15 (_type_ spool-anim) none 15) - (scene-method-16 (_type_) _type_ 16) + (scene-method-15 (_type_ spool-anim) none) + (scene-method-16 (_type_) _type_) ) ) (deftype scene-player (process-drawable) - ((scene-list (array scene) :offset-assert 200) - (scene scene :offset-assert 204) - (scene-index int32 :offset-assert 208) - (anim spool-anim :offset-assert 212) - (next-anim spool-anim :offset-assert 216) - (camera handle :offset-assert 224) - (main-entity entity-actor :offset-assert 232) - (wait symbol :offset-assert 236) - (old-target-pos transformq :inline :offset-assert 240) - (pre-cut-frame basic :offset-assert 288) - (preload-continue string :offset-assert 292) - (dma-max uint32 :offset-assert 296) - (gui-id sound-id :offset-assert 300) - (aborted? symbol :offset-assert 304) - (scene-start-time time-frame :offset-assert 312) - (targ-speed float :offset-assert 320) - (cur-speed float :offset-assert 324) - (speed-change-time time-frame :offset-assert 328) - (speed-press-time time-frame :offset-assert 336) - (speed-change-speed float :offset-assert 344) - (unknown-time time-frame :offset 344) - (subtitle-change-time time-frame :offset-assert 352) - (user-sound sound-id 4 :offset-assert 360) + ((scene-list (array scene)) + (scene scene) + (scene-index int32) + (anim spool-anim) + (next-anim spool-anim) + (camera handle) + (main-entity entity-actor) + (wait symbol) + (old-target-pos transformq :inline) + (pre-cut-frame basic) + (preload-continue string) + (dma-max uint32) + (gui-id sound-id) + (aborted? symbol) + (scene-start-time time-frame) + (targ-speed float) + (cur-speed float) + (speed-change-time time-frame) + (speed-press-time time-frame) + (speed-change-speed float) + (unknown-time time-frame :overlay-at speed-change-speed) + (subtitle-change-time time-frame) + (user-sound sound-id 4) ) - :heap-base #x100 - :method-count-assert 26 - :size-assert #x178 - :flag-assert #x1a01000178 + (:state-methods + (wait symbol) + release + play-anim + ) (:methods - (wait (symbol) _type_ :state 20) - (release () _type_ :state 21) - (play-anim () _type_ :state 22) - (scene-player-method-23 (_type_ string symbol) none 23) - (scene-player-method-24 (_type_ basic symbol) scene 24) - (scene-player-method-25 (_type_ float) none 25) + (scene-player-method-23 (_type_ string symbol) none) + (scene-player-method-24 (_type_ basic symbol) scene) + (scene-player-method-25 (_type_ float) none) ) ) diff --git a/goal_src/jak2/engine/scene/scene.gc b/goal_src/jak2/engine/scene/scene.gc index 1172bb4ce80..fb886eab29e 100644 --- a/goal_src/jak2/engine/scene/scene.gc +++ b/goal_src/jak2/engine/scene/scene.gc @@ -9,19 +9,16 @@ (deftype scene-stage (process-hidden) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 ) -(defmethod print scene ((this scene)) +(defmethod print ((this scene)) (format #t "#" (-> this art-group) (-> this anim) this) this ) ;; WARN: Return type mismatch spool-anim vs none. -(defmethod scene-method-15 scene ((this scene) (arg0 spool-anim)) +(defmethod scene-method-15 ((this scene) (arg0 spool-anim)) (set! (-> arg0 name) (-> this anim)) (set! (-> arg0 anim-name) (-> this anim)) (set! (-> arg0 parts) (-> this parts)) @@ -48,7 +45,7 @@ ) ) -(defmethod scene-actor-method-9 scene-actor ((this scene-actor) (arg0 scene-player)) +(defmethod scene-actor-method-9 ((this scene-actor) (arg0 scene-player)) (local-vars (s4-0 (pointer process)) (sv-96 process) (sv-112 process)) (let ((s1-0 (if (-> this level) (level-get *level* (-> this level)) @@ -236,7 +233,7 @@ s4-0 ) -(defmethod deactivate scene-player ((this scene-player)) +(defmethod deactivate ((this scene-player)) (set! *scene-player* (the-as (pointer scene-player) #f)) (kill-persister *setting-control* (the-as engine-pers 'blackout) 'bg-a-force) ((method-of-type process-drawable deactivate) this) @@ -244,7 +241,7 @@ ) ;; WARN: Return type mismatch process-drawable vs scene-player. -(defmethod relocate scene-player ((this scene-player) (arg0 int)) +(defmethod relocate ((this scene-player) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -263,7 +260,7 @@ (the-as scene-player ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod scene-player-method-25 scene-player ((this scene-player) (arg0 float)) +(defmethod scene-player-method-25 ((this scene-player) (arg0 float)) (local-vars (v1-11 symbol) (v1-40 symbol) (s0-0 object) (s0-1 object)) (dotimes (s4-0 (-> this scene actor length)) (let ((s3-0 (-> this scene actor s4-0))) @@ -373,7 +370,7 @@ ) ;; WARN: Return type mismatch basic vs scene. -(defmethod scene-player-method-24 scene-player ((this scene-player) (arg0 basic) (arg1 symbol)) +(defmethod scene-player-method-24 ((this scene-player) (arg0 basic) (arg1 symbol)) "TODO - arg1 can be string/scene" (when (= (-> arg0 type) string) (let ((v1-2 (scene-lookup arg0))) @@ -396,7 +393,7 @@ (the-as scene arg0) ) -(defmethod scene-player-method-23 scene-player ((this scene-player) (arg0 string) (arg1 symbol)) +(defmethod scene-player-method-23 ((this scene-player) (arg0 string) (arg1 symbol)) (let ((gp-0 (scene-player-method-24 this arg0 #t))) (when (-> gp-0 peaceful) (let ((s3-0 *traffic-manager*)) @@ -547,13 +544,10 @@ ) (deftype subtitle-work (structure) - ((draw-tmpl dma-gif-packet :inline :offset-assert 0) - (color0 vector4w :inline :offset-assert 32) - (color1 vector4w :inline :offset-assert 48) + ((draw-tmpl dma-gif-packet :inline) + (color0 vector4w :inline) + (color1 vector4w :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) @@ -824,7 +818,7 @@ (defstate wait (scene-player) :virtual #t :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (when (or (-> self scene) (-> self preload-continue)) (let ((gp-0 (scene-decode-continue (the-as basic (if (-> self scene) (-> self scene load-point-obj) @@ -913,7 +907,7 @@ (and (-> *target* next-state) (= (-> *target* next-state name) 'target-flop-hit-ground)) ) (-> self scene) - (< (- (current-time) (-> self state-time)) (-> self scene wait-air-time)) + (not (time-elapsed? (-> self state-time) (-> self scene wait-air-time))) ) (suspend) ) @@ -951,8 +945,8 @@ ) ) (when arg0 - (while (and (-> self scene) (not (or (>= (- (current-time) s5-0) (-> self scene wait-ground-time)) - (>= (- (current-time) (-> self state-time)) (-> self scene wait-max-time)) + (while (and (-> self scene) (not (or (time-elapsed? s5-0 (-> self scene wait-ground-time)) + (time-elapsed? (-> self state-time) (-> self scene wait-max-time)) ) ) ) @@ -1052,7 +1046,7 @@ (bucket-id screen-filter) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.05)) + (until (time-elapsed? gp-0 (seconds 0.05)) (suspend) ) ) @@ -1213,7 +1207,7 @@ (suspend) (scene-player-method-25 self 0.0) (set! (-> self cur-speed) 0.0) - (set! (-> self scene-start-time) (current-time)) + (set-time! (-> self scene-start-time)) (ja-play-spooled-anim (-> self anim) (the-as art-joint-anim #f) @@ -1385,9 +1379,9 @@ ) (when (cpad-pressed? 0 square) (set! (-> *setting-control* user-default subtitle) (not (-> *setting-control* user-default subtitle))) - (set! (-> self subtitle-change-time) (current-time)) + (set-time! (-> self subtitle-change-time)) ) - (when (and (< (- (current-time) (-> self subtitle-change-time)) (seconds 2)) + (when (and (not (time-elapsed? (-> self subtitle-change-time) (seconds 2))) (< (mod (- (current-time) (-> self subtitle-change-time)) 300) 210) ) (let ((gp-6 @@ -1430,7 +1424,7 @@ (cond ((cpad-hold? 0 r1) (if (cpad-pressed? 0 circle) - (set! (-> self speed-press-time) (current-time)) + (set-time! (-> self speed-press-time)) ) (seek! (-> self speed-change-speed) @@ -1442,7 +1436,7 @@ ) ((cpad-hold? 0 l1) (if (cpad-pressed? 0 square) - (set! (-> self speed-press-time) (current-time)) + (set-time! (-> self speed-press-time)) ) (seek! (-> self speed-change-speed) @@ -1454,7 +1448,7 @@ ) ((cpad-hold? 0 x) (when (cpad-pressed? 0 x) - (set! (-> self speed-press-time) (current-time)) + (set-time! (-> self speed-press-time)) (cond ((= (-> self cur-speed) 0.0) (set! (-> self speed-change-speed) -1000.0) @@ -1487,12 +1481,12 @@ ) (set! (-> self targ-speed) 0.0) (set! (-> self cur-speed) 0.0) - (set! (-> self speed-change-time) (current-time)) + (set-time! (-> self speed-change-time)) ) ) ((= (-> self speed-change-speed) -1000.0) (when (!= (-> self cur-speed) -1000.0) - (set! (-> self speed-change-time) (current-time)) + (set-time! (-> self speed-change-time)) (set! (-> self targ-speed) -1000.0) (set! (-> self cur-speed) -1000.0) (sound-pause (-> gp-7 id)) @@ -1502,7 +1496,7 @@ (set! (-> self targ-speed) (fmax -10.0 (fmin 10.0 (+ (-> self targ-speed) (* (-> self speed-change-speed) (seconds-per-frame))))) ) - (if (< (- (current-time) (-> self speed-change-time)) (seconds 3)) + (if (not (time-elapsed? (-> self speed-change-time) (seconds 3))) (format *stdcon* "id ~d speed ~f~%" @@ -1515,7 +1509,7 @@ ) (when (and gp-7 (and (!= (-> self targ-speed) (-> self cur-speed)) (< (-> self speed-change-time) (current-time)) - (>= (- (current-time) (-> self scene-start-time)) (seconds 1)) + (time-elapsed? (-> self scene-start-time) (seconds 1)) ) ) (when *sound-player-enable* @@ -1528,7 +1522,7 @@ ) ) (set! (-> self cur-speed) (-> self targ-speed)) - (set! (-> self speed-change-time) (current-time)) + (set-time! (-> self speed-change-time)) ) ) ) @@ -1630,7 +1624,7 @@ (none) ) -(defmethod scene-method-16 scene ((this scene)) +(defmethod scene-method-16 ((this scene)) (let ((v1-1 (-> *level* loading-level))) (if v1-1 (set-loaded-art (-> v1-1 art-group) this) diff --git a/goal_src/jak2/engine/sound/gsound-h.gc b/goal_src/jak2/engine/sound/gsound-h.gc index 01d473b1377..9452e31b8a9 100644 --- a/goal_src/jak2/engine/sound/gsound-h.gc +++ b/goal_src/jak2/engine/sound/gsound-h.gc @@ -190,404 +190,296 @@ ;; DECOMP BEGINS (deftype sound-stream-name (structure) - ((name uint8 48 :offset-assert 0) + ((name uint8 48) ) :pack-me - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype sound-id (uint32) () - :method-count-assert 10 - :size-assert #x4 - :flag-assert #xa00000004 (:methods - (unused-9 () none 9) + (unused-9 () none) ) ) (deftype sound-bank-id (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype sound-name (uint128) ((lo uint64 :offset 0 :size 64) (hi uint64 :offset 64 :size 64) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype sound-rpc-cmd (structure) - ((rsvd1 uint16 :offset-assert 0) - (command sound-command :offset-assert 2) + ((rsvd1 uint16) + (command sound-command) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype sound-play-params (structure) - ((mask uint16 :offset-assert 0) - (pitch-mod int16 :offset-assert 2) - (bend int16 :offset-assert 4) - (fo-min int16 :offset-assert 6) - (fo-max int16 :offset-assert 8) - (fo-curve int8 :offset-assert 10) - (priority int8 :offset-assert 11) - (volume int32 :offset-assert 12) - (trans int32 3 :offset-assert 16) - (group uint8 :offset-assert 28) - (reg uint8 3 :offset-assert 29) - (group-and-regs uint32 :offset 28) + ((mask uint16) + (pitch-mod int16) + (bend int16) + (fo-min int16) + (fo-max int16) + (fo-curve int8) + (priority int8) + (volume int32) + (trans int32 3) + (group uint8) + (reg uint8 3) + (group-and-regs uint32 :overlay-at group) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype sound-rpc-bank-cmd (sound-rpc-cmd) - ((bank-name sound-name :offset-assert 16) + ((bank-name sound-name) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype sound-rpc-test-cmd (sound-rpc-cmd) - ((ee-addr pointer :offset-assert 4) - (param0 uint16 :offset-assert 8) + ((ee-addr pointer) + (param0 uint16) ) - :method-count-assert 9 - :size-assert #xa - :flag-assert #x90000000a ) (deftype sound-rpc-sound-cmd (sound-rpc-cmd) - ((id sound-id :offset-assert 4) + ((id sound-id) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype sound-rpc-group-cmd (sound-rpc-cmd) - ((group sound-group :offset-assert 4) + ((group sound-group) ) - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) (deftype sound-rpc-load-bank (sound-rpc-bank-cmd) - ((ee-addr pointer :offset-assert 32) + ((ee-addr pointer) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) (deftype sound-rpc-load-music (sound-rpc-bank-cmd) () - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype sound-rpc-unload-bank (sound-rpc-bank-cmd) () - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype sound-rpc-play (sound-rpc-sound-cmd) - ((name sound-name :offset-assert 16) - (params sound-play-params :inline :offset-assert 32) + ((name sound-name) + (params sound-play-params :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype sound-rpc-pause-sound (sound-rpc-sound-cmd) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype sound-rpc-stop-sound (sound-rpc-sound-cmd) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype sound-rpc-continue-sound (sound-rpc-sound-cmd) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype sound-rpc-set-param (sound-rpc-sound-cmd) - ((params sound-play-params :inline :offset-assert 8) - (auto-time int32 :offset-assert 40) - (auto-from int32 :offset-assert 44) + ((params sound-play-params :inline) + (auto-time int32) + (auto-from int32) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype sound-rpc-set-master-volume (sound-rpc-group-cmd) - ((volume int32 :offset-assert 8) + ((volume int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype sound-rpc-pause-group (sound-rpc-group-cmd) () - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) (deftype sound-rpc-stop-group (sound-rpc-group-cmd) () - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) (deftype sound-rpc-continue-group (sound-rpc-group-cmd) () - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) (deftype sound-rpc-get-irx-version (sound-rpc-cmd) - ((major uint32 :offset-assert 4) - (minor uint32 :offset-assert 8) - (ee-addr pointer :offset-assert 12) + ((major uint32) + (minor uint32) + (ee-addr pointer) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype sound-rpc-set-language (sound-rpc-cmd) - ((lang uint32 :offset-assert 4) + ((lang uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype sound-rpc-set-stereo-mode (sound-rpc-cmd) - ((mode int32 :offset-assert 4) + ((mode int32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype sound-rpc-set-reverb (sound-rpc-cmd) - ((core uint8 :offset-assert 4) - (reverb int32 :offset-assert 8) - (left uint32 :offset-assert 12) - (right uint32 :offset-assert 16) + ((core uint8) + (reverb int32) + (left uint32) + (right uint32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype sound-rpc-set-ear-trans (sound-rpc-cmd) - ((ear-trans1 int32 3 :offset-assert 4) - (ear-trans0 int32 3 :offset-assert 16) - (cam-trans int32 3 :offset-assert 28) - (cam-angle int32 :offset-assert 40) + ((ear-trans1 int32 3) + (ear-trans0 int32 3) + (cam-trans int32 3) + (cam-angle int32) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) (deftype sound-rpc-set-flava (sound-rpc-cmd) - ((flava uint8 :offset-assert 4) - (excitement uint8 :offset-assert 5) + ((flava uint8) + (excitement uint8) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) (deftype sound-rpc-set-midi-reg (sound-rpc-cmd) - ((reg int32 :offset-assert 4) - (value int16 :offset-assert 8) + ((reg int32) + (value int16) ) - :method-count-assert 9 - :size-assert #xa - :flag-assert #x90000000a ) (deftype sound-rpc-shutdown (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype sound-rpc-set-fps (sound-rpc-cmd) - ((fps uint8 :offset-assert 4) + ((fps uint8) ) - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) (deftype sound-rpc-list-sounds (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype sound-rpc-unload-music (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype sound-rpc-union (structure) - ((data uint32 20 :offset-assert 0) - (load-bank sound-rpc-load-bank :offset 0) - (unload-bank sound-rpc-unload-bank :offset 0) - (play sound-rpc-play :offset 0) - (pause-sound sound-rpc-pause-sound :offset 0) - (stop-sound sound-rpc-stop-sound :offset 0) - (continue-sound sound-rpc-continue-sound :offset 0) - (set-param sound-rpc-set-param :offset 0) - (set-master-volume sound-rpc-set-master-volume :offset 0) - (pause-group sound-rpc-pause-group :offset 0) - (stop-group sound-rpc-stop-group :offset 0) - (continue-group sound-rpc-continue-group :offset 0) - (get-irx-version sound-rpc-get-irx-version :offset 0) - (set-language sound-rpc-set-language :offset 0) - (set-reverb sound-rpc-set-reverb :offset 0) - (set-ear-trans sound-rpc-set-ear-trans :offset 0) - (set-flava sound-rpc-set-flava :offset 0) - (set-midi-reg sound-rpc-set-midi-reg :offset 0) - (set-fps sound-rpc-set-fps :offset 0) - (shutdown sound-rpc-shutdown :offset 0) - (list-sounds sound-rpc-list-sounds :offset 0) - (unload-music sound-rpc-unload-music :offset 0) + ((data uint32 20) + (load-bank sound-rpc-load-bank :overlay-at (-> data 0)) + (unload-bank sound-rpc-unload-bank :overlay-at (-> data 0)) + (play sound-rpc-play :overlay-at (-> data 0)) + (pause-sound sound-rpc-pause-sound :overlay-at (-> data 0)) + (stop-sound sound-rpc-stop-sound :overlay-at (-> data 0)) + (continue-sound sound-rpc-continue-sound :overlay-at (-> data 0)) + (set-param sound-rpc-set-param :overlay-at (-> data 0)) + (set-master-volume sound-rpc-set-master-volume :overlay-at (-> data 0)) + (pause-group sound-rpc-pause-group :overlay-at (-> data 0)) + (stop-group sound-rpc-stop-group :overlay-at (-> data 0)) + (continue-group sound-rpc-continue-group :overlay-at (-> data 0)) + (get-irx-version sound-rpc-get-irx-version :overlay-at (-> data 0)) + (set-language sound-rpc-set-language :overlay-at (-> data 0)) + (set-reverb sound-rpc-set-reverb :overlay-at (-> data 0)) + (set-ear-trans sound-rpc-set-ear-trans :overlay-at (-> data 0)) + (set-flava sound-rpc-set-flava :overlay-at (-> data 0)) + (set-midi-reg sound-rpc-set-midi-reg :overlay-at (-> data 0)) + (set-fps sound-rpc-set-fps :overlay-at (-> data 0)) + (shutdown sound-rpc-shutdown :overlay-at (-> data 0)) + (list-sounds sound-rpc-list-sounds :overlay-at (-> data 0)) + (unload-music sound-rpc-unload-music :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype sound-spec (basic) - ((mask sound-mask :offset-assert 4) - (num float :offset-assert 8) - (group sound-group :offset-assert 12) - (reg uint8 3 :offset-assert 13) - (group-and-regs uint32 :offset 12) - (sound-name-char uint8 16 :offset-assert 16) - (sound-name sound-name :offset 16) - (trans int32 4 :offset-assert 32) - (volume int32 :offset-assert 48) - (pitch-mod int32 :offset-assert 52) - (bend int32 :offset-assert 56) - (fo-min int16 :offset-assert 60) - (fo-max int16 :offset-assert 62) - (fo-curve int8 :offset-assert 64) - (priority int8 :offset-assert 65) - (auto-time int32 :offset-assert 68) - (auto-from int32 :offset-assert 72) + ((mask sound-mask) + (num float) + (group sound-group) + (reg uint8 3) + (group-and-regs uint32 :overlay-at group) + (sound-name-char uint8 16) + (sound-name sound-name :overlay-at (-> sound-name-char 0)) + (trans int32 4) + (volume int32) + (pitch-mod int32) + (bend int32) + (fo-min int16) + (fo-max int16) + (fo-curve int8) + (priority int8) + (auto-time int32) + (auto-from int32) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) (define *current-sound-id* (the-as sound-id #x10000)) (deftype ambient-sound (basic) - ((spec sound-spec :offset-assert 4) - (playing-id sound-id :offset-assert 8) - (trans vector :inline :offset-assert 16) - (name sound-name :offset-assert 32) - (play-time time-frame :offset-assert 48) - (time-base time-frame :offset-assert 56) - (time-random time-frame :offset-assert 64) - (volume int32 :offset-assert 72) - (pitch int32 :offset-assert 76) - (falloff-near int32 :offset-assert 80) - (falloff-far int32 :offset-assert 84) - (falloff-mode int32 :offset-assert 88) - (params (pointer float) :offset-assert 92) - (param-count int32 :offset-assert 96) - (entity entity :offset-assert 100) - (sound-count int32 :offset-assert 104) + ((spec sound-spec) + (playing-id sound-id) + (trans vector :inline) + (name sound-name) + (play-time time-frame) + (time-base time-frame) + (time-random time-frame) + (volume int32) + (pitch int32) + (falloff-near int32) + (falloff-far int32) + (falloff-mode int32) + (params (pointer float)) + (param-count int32) + (entity entity) + (sound-count int32) ) - :method-count-assert 16 - :size-assert #x6c - :flag-assert #x100000006c (:methods - (new (symbol type basic vector) _type_ 0) - (update! (_type_) int 9) - (change-sound! (_type_ sound-name) int 10) - (update-trans! (_type_ vector) int 11) - (update-vol! (_type_ float) int 12) - (update-pitch-mod! (_type_ float) none 13) - (set-falloff-far! (_type_ float) none 14) - (stop! (_type_) int 15) + (new (symbol type basic vector) _type_) + (update! (_type_) int) + (change-sound! (_type_ sound-name) int) + (update-trans! (_type_ vector) int) + (update-vol! (_type_ float) int) + (update-pitch-mod! (_type_ float) none) + (set-falloff-far! (_type_ float) none) + (stop! (_type_) int) ) ) diff --git a/goal_src/jak2/engine/sound/gsound.gc b/goal_src/jak2/engine/sound/gsound.gc index feae1c1f79c..86b393ba1ff 100644 --- a/goal_src/jak2/engine/sound/gsound.gc +++ b/goal_src/jak2/engine/sound/gsound.gc @@ -9,12 +9,10 @@ (deftype engine-sound-pers (engine-pers) () - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 ) -(defmethod kill-callback engine-sound-pers ((this engine-sound-pers) (arg0 connection-pers)) + +(defmethod kill-callback ((this engine-sound-pers) (arg0 connection-pers)) (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-param)) (set! (-> v1-0 id) (the-as sound-id (-> arg0 param-int64 0))) @@ -29,12 +27,17 @@ ) (kmemopen global "sound-loop-engine") + (define *sound-loop-engine* (new 'global 'engine-sound-pers '*sound-loop-engine* 32 connection-pers)) + (kmemclose) (kmemopen global "sound-rpc") + (define *sound-player-rpc* (new 'global 'rpc-buffer-pair (the-as uint 80) (the-as uint 128) 0)) + (define *sound-loader-rpc* (new 'global 'rpc-buffer-pair (the-as uint 80) (the-as uint 1) 1)) + (kmemclose) (defun sound-name= ((arg0 sound-name) (arg1 sound-name)) @@ -42,33 +45,30 @@ ) (deftype sound-iop-info (structure) - ((frame uint32 :offset-assert 0) - (strpos int32 :offset-assert 4) - (str-id uint32 :offset-assert 8) - (str-id-sign int32 :offset 8) - (freemem uint32 :offset-assert 12) - (chinfo uint8 48 :offset-assert 16) - (freemem2 uint32 :offset-assert 64) - (nocd uint32 :offset-assert 68) - (dirtycd uint32 :offset-assert 72) - (diskspeed uint32 2 :offset-assert 76) - (lastspeed uint32 :offset-assert 84) - (dupseg int32 :offset-assert 88) - (times int32 41 :offset-assert 92) - (times-seq uint32 :offset-assert 256) - (iop-ticks uint32 :offset-assert 260) - (stream-position uint32 4 :offset 272) - (stream-status stream-status 4 :offset-assert 288) - (stream-name sound-stream-name 4 :inline :offset-assert 304) - (stream-id sound-id 4 :offset-assert 496) - (stream-id-int32 int32 4 :offset 496) - (music-register uint8 17 :offset-assert 512) - (music-excite int8 :offset 528) - (ramdisk-name uint8 48 :offset-assert 529) + ((frame uint32) + (strpos int32) + (str-id uint32) + (str-id-sign int32 :overlay-at str-id) + (freemem uint32) + (chinfo uint8 48) + (freemem2 uint32) + (nocd uint32) + (dirtycd uint32) + (diskspeed uint32 2) + (lastspeed uint32) + (dupseg int32) + (times int32 41) + (times-seq uint32) + (iop-ticks uint32) + (stream-position uint32 4 :offset 272) + (stream-status stream-status 4) + (stream-name sound-stream-name 4 :inline) + (stream-id sound-id 4) + (stream-id-int32 int32 4 :overlay-at (-> stream-id 0)) + (music-register uint8 17) + (music-excite int8 :overlay-at (-> music-register 16)) + (ramdisk-name uint8 48) ) - :method-count-assert 9 - :size-assert #x241 - :flag-assert #x900000241 ) @@ -665,7 +665,7 @@ otherwise, an explicit [[vector]] can be provided" ) ) -(defmethod update! ambient-sound ((this ambient-sound)) +(defmethod update! ((this ambient-sound)) (with-pp (if (not *ambient-sound-class*) (return (the-as int #f)) @@ -720,14 +720,14 @@ otherwise, an explicit [[vector]] can be provided" ) ) (set! (-> this playing-id) (sound-play-by-name - (-> this name) - (-> this playing-id) - (-> this volume) - (-> this pitch) - 0 - (sound-group sfx) - (-> this trans) - ) + (-> this name) + (-> this playing-id) + (-> this volume) + (-> this pitch) + 0 + (sound-group sfx) + (-> this trans) + ) ) ) (else @@ -753,12 +753,12 @@ otherwise, an explicit [[vector]] can be provided" ) ) -(defmethod stop! ambient-sound ((this ambient-sound)) +(defmethod stop! ((this ambient-sound)) (sound-stop (-> this playing-id)) 0 ) -(defmethod update-trans! ambient-sound ((this ambient-sound) (arg0 vector)) +(defmethod update-trans! ((this ambient-sound) (arg0 vector)) (with-pp (set! (-> this trans quad) (-> arg0 quad)) (when (nonzero? (-> this playing-id)) @@ -784,7 +784,7 @@ otherwise, an explicit [[vector]] can be provided" ) ) -(defmethod update-vol! ambient-sound ((this ambient-sound) (arg0 float)) +(defmethod update-vol! ((this ambient-sound) (arg0 float)) (when (nonzero? (-> this playing-id)) (when *sound-player-enable* (let ((v1-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -800,7 +800,7 @@ otherwise, an explicit [[vector]] can be provided" 0 ) -(defmethod update-pitch-mod! ambient-sound ((this ambient-sound) (arg0 float)) +(defmethod update-pitch-mod! ((this ambient-sound) (arg0 float)) (when (nonzero? (-> this playing-id)) (when *sound-player-enable* (let ((v1-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -817,13 +817,13 @@ otherwise, an explicit [[vector]] can be provided" (none) ) -(defmethod set-falloff-far! ambient-sound ((this ambient-sound) (arg0 float)) +(defmethod set-falloff-far! ((this ambient-sound) (arg0 float)) (set! (-> this falloff-far) (the int (* 0.00024414062 arg0))) 0 (none) ) -(defmethod change-sound! ambient-sound ((this ambient-sound) (arg0 sound-name)) +(defmethod change-sound! ((this ambient-sound) (arg0 sound-name)) (when (not (and (= (the-as uint (-> this name)) (the-as uint arg0)) (= (-> arg0 hi) (-> this name hi)))) (stop! this) (set! (-> this playing-id) (new-sound-id)) @@ -996,7 +996,7 @@ otherwise, an explicit [[vector]] can be provided" (want-sound-banks *load-state* a1-3) ) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) (seconds 1)) + (until (time-elapsed? s5-0 (seconds 1)) (suspend) ) ) diff --git a/goal_src/jak2/engine/sound/speech-h.gc b/goal_src/jak2/engine/sound/speech-h.gc index cc213fb226a..0f874d3926f 100644 --- a/goal_src/jak2/engine/sound/speech-h.gc +++ b/goal_src/jak2/engine/sound/speech-h.gc @@ -91,76 +91,64 @@ ;; DECOMP BEGINS (deftype speech-type-info (structure) - ((channel uint8 :offset-assert 0) - (flags speech-type-flag :offset-assert 1) - (priority int8 :offset-assert 2) - (request-timeout uint16 :offset-assert 4) - (min-delay uint16 :offset-assert 6) - (max-delay uint16 :offset-assert 8) - (delay uint16 :offset-assert 10) - (play-index int16 :offset-assert 12) - (list (array string) :offset-assert 16) + ((channel uint8) + (flags speech-type-flag) + (priority int8) + (request-timeout uint16) + (min-delay uint16) + (max-delay uint16) + (delay uint16) + (play-index int16) + (list (array string)) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype speech-request (structure) - ((handle handle :offset-assert 0) - (time time-frame :offset-assert 8) - (priority float :offset-assert 16) - (speech-type speech-type :offset-assert 20) + ((handle handle) + (time time-frame) + (priority float) + (speech-type speech-type) ) :pack-me - :method-count-assert 9 - :size-assert #x15 - :flag-assert #x900000015 ) (deftype speech-channel (structure) - ((flags speech-channel-flag :offset-assert 0) - (gui-channel gui-channel :offset-assert 1) - (delay uint16 :offset-assert 2) - (id sound-id :offset-assert 4) - (update-time time-frame :offset-assert 8) - (start-time time-frame :offset-assert 16) - (end-time time-frame :offset-assert 24) - (request speech-request :inline :offset-assert 32) - (last-request speech-request :inline :offset-assert 56) - (target-pos vector :inline :offset-assert 80) - (speech-table (pointer speech-type-info) :offset-assert 96) + ((flags speech-channel-flag) + (gui-channel gui-channel) + (delay uint16) + (id sound-id) + (update-time time-frame) + (start-time time-frame) + (end-time time-frame) + (request speech-request :inline) + (last-request speech-request :inline) + (target-pos vector :inline) + (speech-table (pointer speech-type-info)) ) - :method-count-assert 14 - :size-assert #x64 - :flag-assert #xe00000064 (:methods - (speech-channel-method-9 (_type_ process-drawable speech-type) none 9) - (speech-channel-method-10 (_type_ handle) none 10) - (speech-channel-method-11 (_type_) none 11) - (speech-channel-method-12 (_type_) none 12) - (speech-channel-method-13 (_type_) none 13) + (speech-channel-method-9 (_type_ process-drawable speech-type) none) + (speech-channel-method-10 (_type_ handle) none) + (speech-channel-method-11 (_type_) none) + (speech-channel-method-12 (_type_) none) + (speech-channel-method-13 (_type_) none) ) ) (deftype speech-control (structure) - ((channel-array speech-channel 2 :inline :offset-assert 0) - (speech-table speech-type-info 57 :offset-assert 224) + ((channel-array speech-channel 2 :inline) + (speech-table speech-type-info 57) ) - :method-count-assert 17 - :size-assert #x1c4 - :flag-assert #x11000001c4 (:methods - (speech-control-method-9 (_type_) none 9) - (speech-table-set! (_type_ speech-type speech-type-info) none 10) - (speech-control-method-11 (_type_) none 11) - (speech-control-method-12 (_type_ process-drawable speech-type) none 12) - (speech-control-method-13 (_type_ handle) none 13) - (speech-control-method-14 (_type_) none 14) - (speech-control-method-15 (_type_ process-drawable) none 15) - (speech-control-method-16 (_type_) none 16) + (speech-control-method-9 (_type_) none) + (speech-table-set! (_type_ speech-type speech-type-info) none) + (speech-control-method-11 (_type_) none) + (speech-control-method-12 (_type_ process-drawable speech-type) none) + (speech-control-method-13 (_type_ handle) none) + (speech-control-method-14 (_type_) none) + (speech-control-method-15 (_type_ process-drawable) none) + (speech-control-method-16 (_type_) none) ) ) diff --git a/goal_src/jak2/engine/sound/speech.gc b/goal_src/jak2/engine/sound/speech.gc index 204f7a06c6b..8810fa5c7f2 100644 --- a/goal_src/jak2/engine/sound/speech.gc +++ b/goal_src/jak2/engine/sound/speech.gc @@ -7,14 +7,14 @@ ;; DECOMP BEGINS -(defmethod speech-channel-method-12 speech-channel ((this speech-channel)) +(defmethod speech-channel-method-12 ((this speech-channel)) (set! (-> this request handle) (the-as handle #f)) (set! (-> this request priority) -10000000000000000000000000000000000000.0) 0 (none) ) -(defmethod speech-channel-method-13 speech-channel ((this speech-channel)) +(defmethod speech-channel-method-13 ((this speech-channel)) (set! (-> this id) (new 'static 'sound-id)) (set! (-> this last-request handle) (the-as handle #f)) (set! (-> this last-request priority) -10000000000000000000000000000000000000.0) @@ -22,7 +22,7 @@ (none) ) -(defmethod speech-channel-method-11 speech-channel ((this speech-channel)) +(defmethod speech-channel-method-11 ((this speech-channel)) (local-vars (v1-44 int)) (with-pp (logclear! (-> this flags) (speech-channel-flag disable)) @@ -55,10 +55,10 @@ (let ((s4-0 (handle->process (-> this request handle)))) (when s4-0 (when (or (and (>= (-> this request priority) 0.0) - (>= (- (current-time) (-> this end-time)) (the-as time-frame (-> s5-1 delay))) + (time-elapsed? (-> this end-time) (the-as time-frame (-> s5-1 delay))) ) - (and (>= (- (current-time) (-> this end-time)) (the-as time-frame (-> s5-1 delay))) - (>= (- (current-time) (-> this end-time)) (the-as time-frame (-> this delay))) + (and (time-elapsed? (-> this end-time) (the-as time-frame (-> s5-1 delay))) + (time-elapsed? (-> this end-time) (the-as time-frame (-> this delay))) ) ) (let ((s3-0 (-> s5-1 list length)) @@ -85,7 +85,7 @@ (set! (-> s5-1 play-index) v1-44) (let ((s3-1 (-> s5-1 list v1-44))) (mem-copy! (the-as pointer (-> this last-request)) (the-as pointer (-> this request)) 21) - (set! (-> this start-time) (current-time)) + (set-time! (-> this start-time)) (set! (-> this delay) (the-as uint (rand-vu-int-range (the-as int (-> s5-1 min-delay)) (the-as int (-> s5-1 max-delay)))) ) @@ -106,7 +106,7 @@ ) ) ) - (set! (-> this update-time) (current-time)) + (set-time! (-> this update-time)) (when (nonzero? (-> this id)) (let ((s4-1 (handle->process (-> this last-request handle)))) (cond @@ -152,7 +152,7 @@ ) (case (get-status *gui-control* (-> this id)) (((gui-status pending)) - (when (>= (- (current-time) (-> this start-time)) (seconds 1)) + (when (time-elapsed? (-> this start-time) (seconds 1)) (set-action! *gui-control* (gui-action stop) @@ -179,7 +179,7 @@ ) ) -(defmethod speech-channel-method-9 speech-channel ((this speech-channel) (arg0 process-drawable) (arg1 speech-type)) +(defmethod speech-channel-method-9 ((this speech-channel) (arg0 process-drawable) (arg1 speech-type)) (let ((f0-0 (vector-vector-distance-squared (-> arg0 root trans) (-> this target-pos))) (f1-0 245760.0) ) @@ -192,7 +192,7 @@ (set! (-> this request priority) f0-2) (set! (-> this request handle) (process->handle arg0)) (set! (-> this request speech-type) arg1) - (set! (-> this request time) (current-time)) + (set-time! (-> this request time)) ) ) ) @@ -201,7 +201,7 @@ (none) ) -(defmethod speech-channel-method-10 speech-channel ((this speech-channel) (arg0 handle)) +(defmethod speech-channel-method-10 ((this speech-channel) (arg0 handle)) (when (= arg0 (handle->process (-> this last-request handle))) (set-action! *gui-control* @@ -220,7 +220,7 @@ (none) ) -(defmethod speech-control-method-12 speech-control ((this speech-control) (arg0 process-drawable) (arg1 speech-type)) +(defmethod speech-control-method-12 ((this speech-control) (arg0 process-drawable) (arg1 speech-type)) (let ((v1-2 (-> this speech-table arg1))) (when v1-2 (let ((a0-1 (-> this channel-array (-> v1-2 channel)))) @@ -234,7 +234,7 @@ (none) ) -(defmethod speech-control-method-11 speech-control ((this speech-control)) +(defmethod speech-control-method-11 ((this speech-control)) (dotimes (s5-0 2) (speech-channel-method-11 (-> this channel-array s5-0)) ) @@ -242,13 +242,13 @@ (none) ) -(defmethod speech-table-set! speech-control ((this speech-control) (arg0 speech-type) (arg1 speech-type-info)) +(defmethod speech-table-set! ((this speech-control) (arg0 speech-type) (arg1 speech-type-info)) (set! (-> this speech-table arg0) arg1) 0 (none) ) -(defmethod speech-control-method-13 speech-control ((this speech-control) (arg0 handle)) +(defmethod speech-control-method-13 ((this speech-control) (arg0 handle)) (dotimes (s4-0 2) (speech-channel-method-10 (-> this channel-array s4-0) arg0) ) @@ -256,7 +256,7 @@ (none) ) -(defmethod speech-control-method-14 speech-control ((this speech-control)) +(defmethod speech-control-method-14 ((this speech-control)) (speech-control-method-9 this) (let ((s5-0 (-> this channel-array))) ((method-of-type speech-channel speech-channel-method-13) (the-as speech-channel s5-0)) @@ -272,7 +272,7 @@ (none) ) -(defmethod speech-control-method-15 speech-control ((this speech-control) (arg0 process-drawable)) +(defmethod speech-control-method-15 ((this speech-control) (arg0 process-drawable)) (when (not (logtest? (-> this channel-array 0 flags) (speech-channel-flag disable))) (let ((v1-3 *target*)) (when v1-3 @@ -294,7 +294,7 @@ (none) ) -(defmethod speech-control-method-16 speech-control ((this speech-control)) +(defmethod speech-control-method-16 ((this speech-control)) (set-action! *gui-control* (gui-action stop) @@ -322,7 +322,7 @@ (none) ) -(defmethod speech-control-method-9 speech-control ((this speech-control)) +(defmethod speech-control-method-9 ((this speech-control)) (dotimes (v1-0 57) (set! (-> this speech-table v1-0) #f) ) @@ -330,160 +330,160 @@ (speech-channel-method-12 (-> this channel-array s5-0)) ) (speech-table-set! this (speech-type speech-type-0) (new 'static 'speech-type-info - :priority 3 - :request-timeout #x12c - :min-delay (seconds 1) - :max-delay (seconds 1) - :list (new 'static 'boxed-array :type string) - ) + :priority 3 + :request-timeout #x12c + :min-delay (seconds 1) + :max-delay (seconds 1) + :list (new 'static 'boxed-array :type string) + ) ) (speech-table-set! this (speech-type speech-type-3) (new 'static 'speech-type-info - :priority 3 - :request-timeout #x12c - :min-delay (seconds 1) - :max-delay (seconds 1) - :list (new 'static 'boxed-array :type string - "kg136" - "kg139" - "kg140" - "kg141" - "kg142" - "kg134" - "kg157" - "kg143" - "kg156" - "kg176" - "kg177" - "kg536" - "kg551" - ) - ) + :priority 3 + :request-timeout #x12c + :min-delay (seconds 1) + :max-delay (seconds 1) + :list (new 'static 'boxed-array :type string + "kg136" + "kg139" + "kg140" + "kg141" + "kg142" + "kg134" + "kg157" + "kg143" + "kg156" + "kg176" + "kg177" + "kg536" + "kg551" + ) + ) ) (speech-table-set! this (speech-type speech-type-9) (new 'static 'speech-type-info - :priority 1 - :min-delay (seconds 2) - :max-delay (seconds 4) - :list (new 'static 'boxed-array :type string - "kg133" - "kg135" - "kg137" - "kg138" - "kg144" - "kg145" - "kg146" - "kg147" - "kg148" - "kg149" - "kg150" - "kg151" - "kg152" - "kg153" - "kg154" - "kg155" - "kg158" - "kg159" - "kg160" - "kg163" - "kg164" - "kg507" - "kg508" - "kg509" - "kg511" - "kg513" - "kg514" - "kg515" - "kg516" - "kg517" - "kg518" - "kg520" - "kg521" - "kg523" - "kg526" - "kg527" - "kg528" - "kg529" - "kg530" - "kg532" - "kg534" - "kg535" - "kg537" - "kg538" - "kg539" - "kg540" - "kg541" - "kg542" - "kg543" - "kg544" - "kg545" - "kg546" - "kg549" - "kg550" - ) - ) - ) - (speech-table-set! this (speech-type speech-type-10) (new 'static 'speech-type-info - :flags (speech-type-flag random-order) - :priority 10 - :request-timeout #x258 + :priority 1 :min-delay (seconds 2) :max-delay (seconds 4) :list (new 'static 'boxed-array :type string - "kg165" - "kg165a" - "kg165b" - "kg166" - "kg166a" - "kg166b" - "kg167" - "kg167a" - "kg167b" - "kg168" - "kg168a" - "kg168b" - "kg169" - "kg169a" - "kg169b" - "kg170" - "kg170a" - "kg170b" - "kg171" - "kg171a" - "kg171b" - "kg172" - "kg172a" - "kg172b" - "kg173" - "kg173a" - "kg173b" - "kg174" - "kg174a" - "kg174b" - "kg175" - "kg175a" - "kg175b" - "kg510" + "kg133" + "kg135" + "kg137" + "kg138" + "kg144" + "kg145" + "kg146" + "kg147" + "kg148" + "kg149" + "kg150" + "kg151" + "kg152" + "kg153" + "kg154" + "kg155" + "kg158" + "kg159" + "kg160" + "kg163" + "kg164" + "kg507" + "kg508" + "kg509" + "kg511" + "kg513" + "kg514" + "kg515" + "kg516" + "kg517" + "kg518" + "kg520" + "kg521" + "kg523" + "kg526" + "kg527" + "kg528" + "kg529" + "kg530" + "kg532" + "kg534" + "kg535" + "kg537" + "kg538" + "kg539" + "kg540" + "kg541" + "kg542" + "kg543" + "kg544" + "kg545" + "kg546" + "kg549" + "kg550" ) ) ) + (speech-table-set! this (speech-type speech-type-10) (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 10 + :request-timeout #x258 + :min-delay (seconds 2) + :max-delay (seconds 4) + :list (new 'static 'boxed-array :type string + "kg165" + "kg165a" + "kg165b" + "kg166" + "kg166a" + "kg166b" + "kg167" + "kg167a" + "kg167b" + "kg168" + "kg168a" + "kg168b" + "kg169" + "kg169a" + "kg169b" + "kg170" + "kg170a" + "kg170b" + "kg171" + "kg171a" + "kg171b" + "kg172" + "kg172a" + "kg172b" + "kg173" + "kg173a" + "kg173b" + "kg174" + "kg174a" + "kg174b" + "kg175" + "kg175a" + "kg175b" + "kg510" + ) + ) + ) (speech-table-set! this (speech-type speech-type-11) (new 'static 'speech-type-info - :priority 2 - :min-delay (seconds 0.1) - :max-delay (seconds 0.1) - :list (new 'static 'boxed-array :type string - "kg386a" - "kg428a" - "kg641" - "kg650" - "kg338a" - "kg339a" - "kg340a" - "kg341a" - "kg342a" - "kg343a" - "kg344a" - "kg512" - ) - ) + :priority 2 + :min-delay (seconds 0.1) + :max-delay (seconds 0.1) + :list (new 'static 'boxed-array :type string + "kg386a" + "kg428a" + "kg641" + "kg650" + "kg338a" + "kg339a" + "kg340a" + "kg341a" + "kg342a" + "kg343a" + "kg344a" + "kg512" + ) + ) ) 0 (none) diff --git a/goal_src/jak2/engine/spatial-hash/actor-hash.gc b/goal_src/jak2/engine/spatial-hash/actor-hash.gc index c3e311b280c..9846d1139aa 100644 --- a/goal_src/jak2/engine/spatial-hash/actor-hash.gc +++ b/goal_src/jak2/engine/spatial-hash/actor-hash.gc @@ -14,30 +14,24 @@ (kmemclose) (deftype actor-cshape-ptr (structure) - ((cshape collide-shape :offset-assert 0) + ((cshape collide-shape) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype actor-hash-bucket (structure) - ((length int16 :offset-assert 0) - (max-length int16 :offset-assert 2) - (data (inline-array actor-cshape-ptr) :offset-assert 4) + ((length int16) + (max-length int16) + (data (inline-array actor-cshape-ptr)) ) :allow-misaligned - :method-count-assert 10 - :size-assert #x8 - :flag-assert #xa00000008 (:methods - (add-actor-cshape (_type_ collide-shape) none 9) + (add-actor-cshape (_type_ collide-shape) none) ) ) -(defmethod add-actor-cshape actor-hash-bucket ((this actor-hash-bucket) (arg0 collide-shape)) +(defmethod add-actor-cshape ((this actor-hash-bucket) (arg0 collide-shape)) (let ((v1-0 (-> this length))) (when (< v1-0 (-> this max-length)) (set! (-> this data v1-0 cshape) arg0) @@ -49,21 +43,18 @@ ) (deftype actor-hash-buckets (structure) - ((hash spatial-hash :offset-assert 0) - (list engine :offset-assert 4) - (data actor-hash-bucket 4 :inline :offset-assert 8) - (tpos vector :inline :offset-assert 80) + ((hash spatial-hash) + (list engine) + (data actor-hash-bucket 4 :inline) + (tpos vector :inline) ) - :method-count-assert 10 - :size-assert #x60 - :flag-assert #xa00000060 (:methods - (hash-actors (_type_) none 9) + (hash-actors (_type_) none) ) ) -(defmethod hash-actors actor-hash-buckets ((this actor-hash-buckets)) +(defmethod hash-actors ((this actor-hash-buckets)) (local-vars (sv-16 hash-object-info) (sv-32 collide-prim-core) (sv-48 collide-shape) (sv-64 hash-object-info)) (set! (-> this hash) *actor-hash*) (set! (-> this list) *collide-hit-by-others-list*) diff --git a/goal_src/jak2/engine/spatial-hash/collide-hash-h.gc b/goal_src/jak2/engine/spatial-hash/collide-hash-h.gc index cb64567e716..d50fa939b63 100644 --- a/goal_src/jak2/engine/spatial-hash/collide-hash-h.gc +++ b/goal_src/jak2/engine/spatial-hash/collide-hash-h.gc @@ -18,114 +18,90 @@ (define *already-printed-exeeded-max-cache-tris* #f) (deftype collide-hash-scratch (structure) - ((collidable-bits uint128 128 :offset-assert 0) - (poly-bits uint64 2 :offset 0) - (id-bits uint32 512 :offset 0) - (tris uint32 :offset-assert 2048) + ((collidable-bits uint128 128) + (poly-bits uint64 2 :overlay-at (-> collidable-bits 0)) + (id-bits uint32 512 :overlay-at (-> collidable-bits 0)) + (tris uint32) ) - :method-count-assert 9 - :size-assert #x804 - :flag-assert #x900000804 ) (deftype collide-hash-bucket (structure) - ((index int16 :offset-assert 0) - (count int16 :offset-assert 2) + ((index int16) + (count int16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype collide-hash-item (structure) - ((id uint32 :offset-assert 0) - (collidable basic :offset-assert 4) + ((id uint32) + (collidable basic) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype collide-hash-poly (structure) - ((data uint8 4 :offset-assert 0) - (vert-index0 uint8 :offset 0) - (vert-index1 uint8 :offset 1) - (vert-index2 uint8 :offset 2) - (pat-index uint8 :offset 3) - (word uint32 :offset 0) + ((data uint8 4) + (vert-index0 uint8 :overlay-at (-> data 0)) + (vert-index1 uint8 :overlay-at (-> data 1)) + (vert-index2 uint8 :overlay-at (-> data 2)) + (pat-index uint8 :overlay-at (-> data 3)) + (word uint32 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype collide-hash-fragment-stats (structure) - ((num-verts uint16 :offset-assert 0) - (num-polys uint8 :offset-assert 2) - (poly-count uint8 :offset-assert 3) + ((num-verts uint16) + (num-polys uint8) + (poly-count uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype collide-hash-fragment (drawable) - ((num-buckets uint16 :offset 4) - (num-indices uint16 :offset 6) - (pat-array uint32 :offset 8) - (bucket-array uint32 :offset 12) - (grid-step vector :inline :offset-assert 32) - (bbox bounding-box :inline :offset-assert 48) - (bbox4w bounding-box4w :inline :offset-assert 80) - (axis-scale vector :inline :offset 64) - (avg-extents vector :inline :offset 80) - (dimension-array uint32 4 :offset 44) - (stats collide-hash-fragment-stats :inline :offset 60) - (num-verts uint16 :offset 60) - (num-polys uint8 :offset 62) - (poly-count uint8 :offset 63) - (poly-array uint32 :offset 76) - (vert-array uint32 :offset 92) - (index-array uint32 :offset 108) + ((num-buckets uint16 :overlay-at id) + (num-indices uint16 :offset 6) + (pat-array uint32 :offset 8) + (bucket-array uint32 :offset 12) + (grid-step vector :inline) + (bbox bounding-box :inline) + (bbox4w bounding-box4w :inline) + (axis-scale vector :inline :overlay-at (-> bbox max)) + (avg-extents vector :inline :overlay-at (-> bbox4w min data 0)) + (dimension-array uint32 4 :overlay-at (-> grid-step data 3)) + (stats collide-hash-fragment-stats :inline :overlay-at (-> bbox min data 3)) + (num-verts uint16 :overlay-at (-> bbox min data 3)) + (num-polys uint8 :offset 62) + (poly-count uint8 :offset 63) + (poly-array uint32 :overlay-at (-> bbox max data 3)) + (vert-array uint32 :overlay-at (-> bbox4w min data 3)) + (index-array uint32 :overlay-at (-> bbox4w max data 3)) ) - :method-count-assert 17 - :size-assert #x70 - :flag-assert #x1100000070 ) (deftype collide-hash-fragment-array (array) - ((fragments collide-hash-fragment :dynamic :offset 16) + ((fragments collide-hash-fragment :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype collide-hash (drawable) - ((num-ids uint16 :offset 4) - (id-count uint16 :offset 6) - (num-buckets uint32 :offset 8) - (qwc-id-bits uint32 :offset 12) - (grid-step vector :inline :offset 16) - (bbox bounding-box :inline :offset-assert 32) - (bbox4w bounding-box4w :inline :offset-assert 64) - (axis-scale vector :inline :offset 48) - (avg-extents vector :inline :offset 64) - (bucket-array uint32 :offset 44) - (item-array (inline-array collide-hash-item) :offset 60) - (dimension-array uint32 3 :offset 76) - (num-items uint32 :offset 92) + ((num-ids uint16 :overlay-at id) + (id-count uint16 :offset 6) + (num-buckets uint32 :offset 8) + (qwc-id-bits uint32 :offset 12) + (grid-step vector :inline :overlay-at bsphere) + (bbox bounding-box :inline) + (bbox4w bounding-box4w :inline) + (axis-scale vector :inline :overlay-at (-> bbox max)) + (avg-extents vector :inline :overlay-at (-> bbox4w min data 0)) + (bucket-array uint32 :overlay-at (-> bbox min data 3)) + (item-array (inline-array collide-hash-item) :overlay-at (-> bbox max data 3)) + (dimension-array uint32 3 :overlay-at (-> bbox4w min data 3)) + (num-items uint32 :overlay-at (-> bbox4w max data 3)) ) - :method-count-assert 17 - :size-assert #x60 - :flag-assert #x1100000060 ) diff --git a/goal_src/jak2/engine/spatial-hash/collide-hash.gc b/goal_src/jak2/engine/spatial-hash/collide-hash.gc index 341c2216230..3dd02cc20c8 100644 --- a/goal_src/jak2/engine/spatial-hash/collide-hash.gc +++ b/goal_src/jak2/engine/spatial-hash/collide-hash.gc @@ -514,7 +514,7 @@ the side length. ) ) -(defmethod mem-usage collide-hash ((this collide-hash) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-hash) (arg0 memory-usage-block) (arg1 int)) "This one is a bit weird because it touches stuff in the scratchpad... It's called from the bsp-header's mem-usage function, so it should be fine." (set! (-> arg0 length) (max 51 (-> arg0 length))) @@ -542,7 +542,7 @@ the side length. this ) -(defmethod mem-usage collide-hash-fragment ((this collide-hash-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-hash-fragment) (arg0 memory-usage-block) (arg1 int)) (cond ((logtest? arg1 1) (set! (-> arg0 length) (max 58 (-> arg0 length))) @@ -588,7 +588,7 @@ the side length. this ) -(defmethod mem-usage collide-hash-fragment-array ((this collide-hash-fragment-array) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-hash-fragment-array) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 55 (-> arg0 length))) (set! (-> arg0 data 54 name) (symbol->string 'prototype-collision)) (+! (-> arg0 data 54 count) 1) diff --git a/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc b/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc index 7d6ad0abe03..d0739582211 100644 --- a/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc +++ b/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc @@ -11,130 +11,109 @@ (deftype grid-hash-word (uint8) () - :method-count-assert 9 - :size-assert #x1 - :flag-assert #x900000001 ) (deftype grid-hash-box (structure) - ((min int8 3 :offset-assert 0) - (max int8 3 :offset-assert 3) + ((min int8 3) + (max int8 3) ) :pack-me - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) (deftype grid-hash (basic) - ((work grid-hash-work :offset-assert 4) - (search-box grid-hash-box :inline :offset-assert 8) - (bucket-size int16 :offset-assert 14) - (axis-scale float 3 :offset-assert 16) - (dimension-array int8 3 :offset-assert 28) - (vertical-cell-count int8 :offset-assert 31) - (bucket-array (pointer grid-hash-word) :offset-assert 32) - (box-min float 3 :offset-assert 36) - (box-max float 3 :offset-assert 48) - (object-count int16 :offset-assert 60) - (bucket-count int16 :offset-assert 62) - (min-cell-size float :offset-assert 64) - (bucket-memory-size int32 :offset-assert 68) - (mem-bucket-array (pointer grid-hash-word) :offset-assert 72) - (spr-bucket-array (pointer grid-hash-word) :offset-assert 76) - (debug-draw symbol :offset-assert 80) - (use-scratch-ram symbol :offset-assert 84) + ((work grid-hash-work) + (search-box grid-hash-box :inline) + (bucket-size int16) + (axis-scale float 3) + (dimension-array int8 3) + (vertical-cell-count int8) + (bucket-array (pointer grid-hash-word)) + (box-min float 3) + (box-max float 3) + (object-count int16) + (bucket-count int16) + (min-cell-size float) + (bucket-memory-size int32) + (mem-bucket-array (pointer grid-hash-word)) + (spr-bucket-array (pointer grid-hash-word)) + (debug-draw symbol) + (use-scratch-ram symbol) ) - :method-count-assert 25 - :size-assert #x58 - :flag-assert #x1900000058 (:methods - (new (symbol type int) _type_ 0) - (update-grid-for-objects-in-box (_type_ int vector vector) none 9) - (clear-bucket-array (_type_) none 10) - (setup-search-box (_type_ int vector vector vector) none 11) - (search-for-point (_type_ vector) (pointer uint8) 12) - (search-for-sphere (_type_ vector float) (pointer uint8) 13) - (draw (_type_ rgba) none 14) - (dump-grid-info (_type_) none 15) - (verify-bits-in-bucket (_type_ grid-hash-box grid-hash-box) none 16) - (box-of-everything (_type_ object grid-hash-box) none 17) - (grid-hash-method-18 (_type_ grid-hash-box int) none 18) - (grid-hash-method-19 (_type_ grid-hash-box int) none 19) - (do-search! (_type_ grid-hash-box (pointer uint8)) none 20) - (set-up-box (_type_ grid-hash-box vector vector) none 21) - (sphere-to-grid-box (_type_ grid-hash-box sphere) none 22) - (line-sphere-to-grid-box (_type_ grid-hash-box vector vector float) none 23) - (update-grid (_type_) none 24) + (new (symbol type int) _type_) + (update-grid-for-objects-in-box (_type_ int vector vector) none) + (clear-bucket-array (_type_) none) + (setup-search-box (_type_ int vector vector vector) none) + (search-for-point (_type_ vector) (pointer uint8)) + (search-for-sphere (_type_ vector float) (pointer uint8)) + (draw (_type_ rgba) none) + (dump-grid-info (_type_) none) + (verify-bits-in-bucket (_type_ grid-hash-box grid-hash-box) none) + (box-of-everything (_type_ object grid-hash-box) none) + (grid-hash-method-18 (_type_ grid-hash-box int) none) + (grid-hash-method-19 (_type_ grid-hash-box int) none) + (do-search! (_type_ grid-hash-box (pointer uint8)) none) + (set-up-box (_type_ grid-hash-box vector vector) none) + (sphere-to-grid-box (_type_ grid-hash-box sphere) none) + (line-sphere-to-grid-box (_type_ grid-hash-box vector vector float) none) + (update-grid (_type_) none) ) ) (deftype find-nav-sphere-ids-params (structure) - ((bsphere sphere :inline :offset-assert 0) - (y-threshold float :offset-assert 16) - (len int16 :offset-assert 20) - (max-len int16 :offset-assert 22) - (mask uint8 :offset-assert 24) - (array (pointer uint8) :offset-assert 28) + ((bsphere sphere :inline) + (y-threshold float) + (len int16) + (max-len int16) + (mask uint8) + (array (pointer uint8)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype sphere-hash (grid-hash) - ((sphere-array (inline-array sphere) :offset-assert 88) - (max-object-count int16 :offset-assert 92) - (pad int16 :offset-assert 94) - (mem-sphere-array uint32 :offset-assert 96) - (spr-sphere-array uint32 :offset-assert 100) + ((sphere-array (inline-array sphere)) + (max-object-count int16) + (pad int16) + (mem-sphere-array uint32) + (spr-sphere-array uint32) ) - :method-count-assert 34 - :size-assert #x68 - :flag-assert #x2200000068 (:methods - (new (symbol type int int) _type_ 0) - (clear-objects! (_type_) none 25) - (add-a-sphere (_type_ vector) int 26) - (add-a-sphere-with-flag (_type_ vector int) int 27) - (update-from-spheres (_type_) none 28) - (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none 29) - (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none 30) - (add-sphere-with-mask-and-id (_type_ vector int int) symbol 31) - (sphere-hash-method-32 (_type_ vector vector float int) symbol 32) - (remove-by-id (_type_ sphere int) none 33) + (new (symbol type int int) _type_) + (clear-objects! (_type_) none) + (add-a-sphere (_type_ vector) int) + (add-a-sphere-with-flag (_type_ vector int) int) + (update-from-spheres (_type_) none) + (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none) + (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none) + (add-sphere-with-mask-and-id (_type_ vector int int) symbol) + (sphere-hash-method-32 (_type_ vector vector float int) symbol) + (remove-by-id (_type_ sphere int) none) ) ) (deftype hash-object-info (structure) - ((object basic :offset-assert 0) + ((object basic) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype spatial-hash (sphere-hash) - ((object-array (inline-array hash-object-info) :offset-assert 104) - (mem-object-array (inline-array hash-object-info) :offset-assert 108) - (spr-object-array (inline-array hash-object-info) :offset-assert 112) + ((object-array (inline-array hash-object-info)) + (mem-object-array (inline-array hash-object-info)) + (spr-object-array (inline-array hash-object-info)) ) - :method-count-assert 41 - :size-assert #x74 - :flag-assert #x2900000074 (:methods - (new (symbol type int int) _type_ 0) - (add-an-object (_type_ vector hash-object-info) int 34) - (fill-actor-list-for-box (_type_ bounding-box (pointer collide-shape) int) int 35) - (fill-actor-list-for-sphere (_type_ sphere (pointer collide-shape) int) int 36) - (fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int 37) - (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int 38) - (spatial-hash-method-39 (_type_ object hash-object-info) int 39) - (validate-objects (_type_) none 40) + (new (symbol type int int) _type_) + (add-an-object (_type_ vector hash-object-info) int) + (fill-actor-list-for-box (_type_ bounding-box (pointer collide-shape) int) int) + (fill-actor-list-for-sphere (_type_ sphere (pointer collide-shape) int) int) + (fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int) + (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int) + (spatial-hash-method-39 (_type_ object hash-object-info) int) + (validate-objects (_type_) none) ) ) diff --git a/goal_src/jak2/engine/spatial-hash/spatial-hash.gc b/goal_src/jak2/engine/spatial-hash/spatial-hash.gc index 4e7571235bd..60691fe0143 100644 --- a/goal_src/jak2/engine/spatial-hash/spatial-hash.gc +++ b/goal_src/jak2/engine/spatial-hash/spatial-hash.gc @@ -8,21 +8,18 @@ ;; DECOMP BEGINS (deftype grid-hash-work (basic) - ((result-words uint8 32 :offset 16) - (result-bits uint8 32 :offset 16) - (object-id int32 :offset-assert 48) - (temp-box-min vector :inline :offset-assert 64) - (temp-box-max vector :inline :offset-assert 80) - (visit-count int32 :offset-assert 96) - (temp-time uint32 :offset-assert 100) - (queue-object-time uint32 :offset-assert 104) - (make-hash-time uint32 :offset-assert 108) - (search-time uint32 :offset-assert 112) - (add-object-time uint32 :offset-assert 116) + ((result-words uint8 32 :offset 16) + (result-bits uint8 32 :overlay-at (-> result-words 0)) + (object-id int32) + (temp-box-min vector :inline) + (temp-box-max vector :inline) + (visit-count int32) + (temp-time uint32) + (queue-object-time uint32) + (make-hash-time uint32) + (search-time uint32) + (add-object-time uint32) ) - :method-count-assert 9 - :size-assert #x78 - :flag-assert #x900000078 ) @@ -52,7 +49,7 @@ ) ) -(defmethod verify-bits-in-bucket grid-hash ((this grid-hash) (arg0 grid-hash-box) (arg1 grid-hash-box)) +(defmethod verify-bits-in-bucket ((this grid-hash) (arg0 grid-hash-box) (arg1 grid-hash-box)) (let ((s5-0 0)) 0 (let ((v1-1 8) @@ -80,7 +77,7 @@ (none) ) -(defmethod box-of-everything grid-hash ((this grid-hash) (arg0 object) (arg1 grid-hash-box)) +(defmethod box-of-everything ((this grid-hash) (arg0 object) (arg1 grid-hash-box)) (dotimes (v1-0 3) (set! (-> arg1 min v1-0) (-> this dimension-array v1-0)) (set! (-> arg1 max v1-0) -1) @@ -155,7 +152,7 @@ (defmethod-mips2c "(method 20 grid-hash)" 20 grid-hash) -(defmethod set-up-box grid-hash ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector)) +(defmethod set-up-box ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector)) (dotimes (v1-0 3) (set! (-> arg0 min v1-0) (the int @@ -183,7 +180,7 @@ (defmethod-mips2c "(method 22 grid-hash)" 22 grid-hash) -(defmethod line-sphere-to-grid-box grid-hash ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod line-sphere-to-grid-box ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector) (arg3 float)) (let ((s4-0 (new 'stack-no-clear 'grid-hash-box)) (s5-0 (new 'stack-no-clear 'grid-hash-box)) ) @@ -208,7 +205,7 @@ (none) ) -(defmethod clear-bucket-array grid-hash ((this grid-hash)) +(defmethod clear-bucket-array ((this grid-hash)) (let ((v1-5 (/ (+ (* (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (-> this dimension-array 2)) (-> this bucket-size) ) @@ -229,7 +226,7 @@ (none) ) -(defmethod update-grid grid-hash ((this grid-hash)) +(defmethod update-grid ((this grid-hash)) (let ((v1-0 (new 'stack-no-clear 'vector))) (dotimes (a1-0 3) (set! (-> v1-0 data a1-0) (fmax (-> this min-cell-size) (- (-> this box-max a1-0) (-> this box-min a1-0)))) @@ -357,7 +354,7 @@ (none) ) -(defmethod update-grid-for-objects-in-box grid-hash ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector)) +(defmethod update-grid-for-objects-in-box ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector)) (set! (-> this object-count) arg0) (dotimes (v1-0 3) (set! (-> this box-min v1-0) (-> arg1 data v1-0)) @@ -368,7 +365,7 @@ (none) ) -(defmethod setup-search-box grid-hash ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod setup-search-box ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((v1-0 (new 'stack-no-clear 'vector)) (t1-0 (new 'stack-no-clear 'vector)) ) @@ -445,10 +442,12 @@ ) (+! t3-23 -1) (nop!) + ;; og:preserve-this (b! (nonzero? t3-23) cfg-11 :delay (set! t4-6 (&+ (the-as pointer t4-6) a0-2))) ) (+! t2-28 -1) (nop!) + ;; og:preserve-this (b! (nonzero? t2-28) cfg-10 :delay (set! t1-3 (&+ (the-as pointer t1-3) a1-2))) ) 0 @@ -456,7 +455,7 @@ (none) ) -(defmethod search-for-point grid-hash ((this grid-hash) (arg0 vector)) +(defmethod search-for-point ((this grid-hash) (arg0 vector)) (let ((v1-0 this) (a0-1 (-> this search-box)) (a2-0 arg0) @@ -489,7 +488,7 @@ ) ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. -(defmethod search-for-sphere grid-hash ((this grid-hash) (arg0 vector) (arg1 float)) +(defmethod search-for-sphere ((this grid-hash) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'sphere))) (set! (-> v1-0 quad) (-> arg0 quad)) (set! (-> v1-0 r) arg1) @@ -565,7 +564,7 @@ (none) ) -(defmethod draw grid-hash ((this grid-hash) (arg0 rgba)) +(defmethod draw ((this grid-hash) (arg0 rgba)) "Draws the grid-hash" (let ((v1-0 (new 'stack-no-clear 'vector)) (t0-0 (new 'stack-no-clear 'vector)) @@ -580,7 +579,7 @@ (none) ) -(defmethod dump-grid-info grid-hash ((this grid-hash)) +(defmethod dump-grid-info ((this grid-hash)) "Prints out info about the grid-hash, also draws via [[grid-hash::draw-grid]] if `debug-draw` is `#t`" (if (-> this debug-draw) (draw this *color-light-blue*) @@ -658,7 +657,7 @@ ) ) -(defmethod clear-objects! sphere-hash ((this sphere-hash)) +(defmethod clear-objects! ((this sphere-hash)) (set! (-> this object-count) 0) (dotimes (v1-0 3) (set! (-> this box-min v1-0) 10000000000000000000000000000000000000.0) @@ -680,7 +679,7 @@ (defmethod-mips2c "(method 28 sphere-hash)" 28 sphere-hash) -(defmethod add-a-sphere sphere-hash ((this sphere-hash) (arg0 vector)) +(defmethod add-a-sphere ((this sphere-hash) (arg0 vector)) (let ((gp-0 (-> this object-count))) (cond ((< gp-0 (-> this max-object-count)) @@ -701,7 +700,7 @@ ) ) -(defmethod add-a-sphere-with-flag sphere-hash ((this sphere-hash) (arg0 vector) (arg1 int)) +(defmethod add-a-sphere-with-flag ((this sphere-hash) (arg0 vector) (arg1 int)) (let ((gp-0 (-> this object-count))) (cond ((< gp-0 (-> this max-object-count)) @@ -733,7 +732,7 @@ (defmethod-mips2c "(method 32 sphere-hash)" 32 sphere-hash) -(defmethod dump-grid-info sphere-hash ((this sphere-hash)) +(defmethod dump-grid-info ((this sphere-hash)) "Prints out info about the grid-hash, also draws via [[grid-hash::draw-grid]] if `debug-draw` is `#t`" (call-parent-method this) (new 'stack-no-clear 'vector) @@ -786,7 +785,7 @@ ) ) -(defmethod clear-objects! spatial-hash ((this spatial-hash)) +(defmethod clear-objects! ((this spatial-hash)) (set! (-> this object-count) 0) (dotimes (v1-0 3) (set! (-> this box-min v1-0) 10000000000000000000000000000000000000.0) @@ -810,7 +809,7 @@ (defmethod-mips2c "(method 33 spatial-hash)" 33 spatial-hash) -(defmethod add-an-object spatial-hash ((this spatial-hash) (arg0 vector) (arg1 hash-object-info)) +(defmethod add-an-object ((this spatial-hash) (arg0 vector) (arg1 hash-object-info)) (let ((gp-0 (-> this object-count))) (cond ((< gp-0 (-> this max-object-count)) @@ -842,7 +841,7 @@ (defmethod-mips2c "(method 35 spatial-hash)" 35 spatial-hash) -(defmethod fill-actor-list-for-vec+r spatial-hash ((this spatial-hash) (arg0 vector) (arg1 (pointer collide-shape)) (arg2 int)) +(defmethod fill-actor-list-for-vec+r ((this spatial-hash) (arg0 vector) (arg1 (pointer collide-shape)) (arg2 int)) (let ((v1-0 (new 'stack-no-clear 'sphere))) (set! (-> v1-0 quad) (-> arg0 quad)) (set! (-> v1-0 r) 0.0) @@ -850,7 +849,7 @@ ) ) -(defmethod validate-objects spatial-hash ((this spatial-hash)) +(defmethod validate-objects ((this spatial-hash)) (dotimes (s5-0 (-> this object-count)) (let ((a0-2 (-> this object-array s5-0 object))) (when (not (valid? a0-2 basic "" #t 0)) diff --git a/goal_src/jak2/engine/target/board/board-h.gc b/goal_src/jak2/engine/target/board/board-h.gc index af3cbcd3b74..3d1443afc5f 100644 --- a/goal_src/jak2/engine/target/board/board-h.gc +++ b/goal_src/jak2/engine/target/board/board-h.gc @@ -37,10 +37,10 @@ (points-in-combo float) (combo-in-progress? symbol)) (:methods - (reset-combo! (_type_) none 9) - (add-trick-to-combo! (_type_ board-tricks float) none 10) - (render-combo (_type_) none 11) - (end-combo! (_type_) none 12))) + (reset-combo! (_type_) none) + (add-trick-to-combo! (_type_ board-tricks float) none) + (render-combo (_type_) none) + (end-combo! (_type_) none))) (define-extern *board-trick-tracker* board-trick-tracker) @@ -49,197 +49,187 @@ ;; DECOMP BEGINS (deftype board (process-drawable) - ((control control-info :offset 128) - (shadow-backup shadow-geo :offset 208) - (main joint-mod :offset 212) + ((control control-info :overlay-at root) + (shadow-backup shadow-geo :offset 208) + (main joint-mod :offset 212) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xd8 - :flag-assert #x17006000d8 - (:methods - (idle (symbol) _type_ :state 20) - (use () _type_ :state 21) - (hidden () _type_ :state 22) + (:state-methods + (idle symbol) + use + hidden ) ) (deftype board-info (basic) - ((board (pointer board) :offset-assert 4) - (camera-interp float :offset-assert 8) - (process (pointer target) :offset-assert 12) - (board-trans vector :inline :offset-assert 16) - (board-quat vector :inline :offset-assert 32) - (board-scale vector :inline :offset-assert 48) - (main joint-mod :offset-assert 64) - (upper-body joint-mod :offset-assert 68) - (sound-bank-knob float :offset-assert 72) - (sound-air-knob float :offset-assert 76) - (wind-sound-id sound-id :offset-assert 80) - (wind-sound-pitch float :offset-assert 84) - (wind-sound-volume float :offset-assert 88) - (engine-sound-id sound-id :offset-assert 92) - (engine-sound-pitch float :offset-assert 96) - (engine-sound-volume float :offset-assert 100) - (bank-sound-id sound-id :offset-assert 104) - (bank-sound-pitch float :offset-assert 108) - (bank-sound-volume float :offset-assert 112) - (ride-sound-id sound-id :offset-assert 116) - (spin-sound-id sound-id :offset-assert 120) - (spin-sound-volume float :offset-assert 124) - (spin-sound-pitch float :offset-assert 128) - (unknown-sound-id00 sound-id :offset-assert 132) - (unknown-sound-id01 sound-id :offset-assert 136) - (unknown-sound-id02 sound-id :offset-assert 140) - (up-vector vector 2 :inline :offset-assert 144) - (slow-transv vector :inline :offset-assert 176) - (board-time time-frame :offset-assert 192) - (board-get-on-time time-frame :offset-assert 200) - (in-air-time time-frame :offset-assert 208) - (unknown-time-frame00 time-frame :offset-assert 216) - (unknown-time-frame01 time-frame :offset 224) - (unknown-time-frame02 time-frame :offset 232) - (stick-lock symbol :offset 240) - (stick-off symbol :offset-assert 244) - (stance-info ground-tween-info :inline :offset-assert 248) - (mods-backup basic :offset-assert 284) - (attack-id uint32 :offset-assert 288) - (latch? symbol :offset-assert 292) - (unknown-vector00 vector :inline :offset 304) - (unknown-vector01 vector :inline :offset 320) - (unknown-int00 uint32 :offset 336) - (unknown-symbol00 symbol :offset 340) - (unstuck-time time-frame :offset 344) - (stuck-count int32 :offset-assert 352) - (thrust-scale float :offset-assert 356) - (flip-time time-frame :offset-assert 360) - (transv-max meters :offset-assert 368) - (turn-anim-tilt? symbol :offset-assert 372) - (turn-anim-mag float :offset-assert 376) - (turn-anim-targ float :offset-assert 380) - (turn-anim-frame float :offset-assert 384) - (turn-anim-vel float :offset-assert 388) - (turn-anim-duck float :offset-assert 392) - (turn-anim-duck-vel float :offset-assert 396) - (tilt-anim-frame vector :inline :offset-assert 400) - (tilt-anim-target vector :inline :offset-assert 416) - (smack-surface-time time-frame :offset-assert 432) - (smack-speed meters :offset-assert 440) - (smack-normal vector :inline :offset-assert 448) - (glance-time time-frame :offset-assert 464) - (glance-speed meters :offset-assert 472) - (glance-in-transv vector :inline :offset-assert 480) - (glance-out-transv vector :inline :offset-assert 496) - (glance-normal vector :inline :offset-assert 512) - (on-flat-time time-frame :offset-assert 528) - (jump-land-time time-frame :offset-assert 536) - (slip-factor float :offset-assert 544) - (ground-on-dir vector :inline :offset-assert 560) - (ride-time time-frame :offset-assert 576) - (ride-start-time time-frame :offset-assert 584) - (ride-button-time time-frame :offset-assert 592) - (ride-lean-targ float :offset-assert 600) - (ride-lean float :offset-assert 604) - (ride-leanv float :offset-assert 608) - (ride-lean-mag float :offset-assert 612) - (ride-tilt-targ float :offset-assert 616) - (ride-tilt float :offset-assert 620) - (ride-tiltv float :offset-assert 624) - (ride-tilt-mag float :offset-assert 628) - (ride-lock symbol :offset-assert 632) - (ride-lock-on symbol :offset-assert 636) - (ride-speed meters :offset-assert 640) - (ride-mode uint32 :offset-assert 644) - (ride-rot degrees :offset-assert 648) - (ride-rot-old degrees :offset-assert 652) - (ride-rot-abs degrees 2 :offset-assert 656) - (ride-rtv-abs degrees :offset-assert 664) - (ride-touch-segment vector 2 :inline :offset-assert 672) - (ride-dir vector :inline :offset-assert 704) - (ride-vertex-length int16 :offset-assert 720) - (ride-vertex-length-old int16 :offset-assert 722) - (ride-vertex-base int16 :offset-assert 724) - (ride-vertex-base2 int16 :offset-assert 726) - (ride-vertex-index float :offset-assert 728) - (ride-vertex-index2 float :offset-assert 732) - (ride-vertex-index-old float :offset-assert 736) - (ride-vertex vector 3 :inline :offset-assert 752) - (ride-segment vector :inline :offset-assert 800) - (ride-dir-lean vector :inline :offset-assert 816) - (ride-pad-vector vector 1 :inline :offset-assert 832) - (ride-vertex-old vector 3 :inline :offset-assert 848) - (ride-segment-old vector :inline :offset-assert 896) - (ride-vertex-trail vector 128 :inline :offset-assert 912) - (halfpipe-side-time time-frame :offset-assert 2960) - (halfpipe-jump-time time-frame :offset-assert 2968) - (halfpipe-lip-time time-frame :offset-assert 2976) - (halfpipe-time time-frame :offset-assert 2984) - (halfpipe-gspot-time time-frame :offset-assert 2992) - (halfpipe-lip-event symbol :offset-assert 3000) - (spin-check-time time-frame :offset-assert 3008) - (spin-time time-frame :offset-assert 3016) - (spin-start-time time-frame :offset-assert 3024) - (spin-start-dir vector :inline :offset-assert 3040) - (spin-control float :offset-assert 3056) - (spin-ground-start-time time-frame :offset-assert 3064) - (spin-ground-time time-frame :offset-assert 3072) - (spin-ground-press-time time-frame :offset-assert 3080) - (flip-control float :offset-assert 3088) - (flip-count int32 :offset-assert 3092) - (unknown-time-frame03 time-frame :offset 3104) - (unknown-time-frame04 time-frame :offset 3112) - (unknown-time-frame05 time-frame :offset 3120) - (unknown-time-frame06 time-frame :offset 3128) - (unknown-float00 float :offset 3136) - (unknown-float01 float :offset 3140) - (trickx-count int32 :offset 3144) - (trotyv-max degrees :offset-assert 3148) - (trotyv degrees :offset-assert 3152) - (troty degrees :offset-assert 3156) - (troty-cum degrees :offset-assert 3160) - (unknown-deg00 degrees :offset 3164) - (upper-body-rotyv-max degrees :offset 3168) - (upper-body-rotyv degrees :offset-assert 3172) - (upper-body-roty degrees :offset-assert 3176) - (cushion-base meters :offset-assert 3180) - (cushion-offset meters :offset-assert 3184) - (shock-offset meters :offset-assert 3188) - (shock-offsetv meters :offset-assert 3192) - (shock-rotx meters :offset-assert 3196) - (part-control sparticle-launch-control :offset-assert 3200) - (trick-count int32 :offset-assert 3204) - (trick-array board-tricks 16 :offset-assert 3208) - (trick-points-array float 16 :offset 3272) - (trick-list board-tricks 16 :offset 3336) - (pad uint8 :offset 3399) + ((board (pointer board)) + (camera-interp float) + (process (pointer target)) + (board-trans vector :inline) + (board-quat vector :inline) + (board-scale vector :inline) + (main joint-mod) + (upper-body joint-mod) + (sound-bank-knob float) + (sound-air-knob float) + (wind-sound-id sound-id) + (wind-sound-pitch float) + (wind-sound-volume float) + (engine-sound-id sound-id) + (engine-sound-pitch float) + (engine-sound-volume float) + (bank-sound-id sound-id) + (bank-sound-pitch float) + (bank-sound-volume float) + (ride-sound-id sound-id) + (spin-sound-id sound-id) + (spin-sound-volume float) + (spin-sound-pitch float) + (unknown-sound-id00 sound-id) + (unknown-sound-id01 sound-id) + (unknown-sound-id02 sound-id) + (up-vector vector 2 :inline) + (slow-transv vector :inline) + (board-time time-frame) + (board-get-on-time time-frame) + (in-air-time time-frame) + (unknown-time-frame00 time-frame) + (unknown-time-frame01 time-frame :offset 224) + (unknown-time-frame02 time-frame :offset 232) + (stick-lock symbol :offset 240) + (stick-off symbol) + (stance-info ground-tween-info :inline) + (mods-backup basic) + (attack-id uint32) + (latch? symbol) + (unknown-vector00 vector :inline :offset 304) + (unknown-vector01 vector :inline :offset 320) + (unknown-int00 uint32 :offset 336) + (unknown-symbol00 symbol :offset 340) + (unstuck-time time-frame :offset 344) + (stuck-count int32) + (thrust-scale float) + (flip-time time-frame) + (transv-max meters) + (turn-anim-tilt? symbol) + (turn-anim-mag float) + (turn-anim-targ float) + (turn-anim-frame float) + (turn-anim-vel float) + (turn-anim-duck float) + (turn-anim-duck-vel float) + (tilt-anim-frame vector :inline) + (tilt-anim-target vector :inline) + (smack-surface-time time-frame) + (smack-speed meters) + (smack-normal vector :inline) + (glance-time time-frame) + (glance-speed meters) + (glance-in-transv vector :inline) + (glance-out-transv vector :inline) + (glance-normal vector :inline) + (on-flat-time time-frame) + (jump-land-time time-frame) + (slip-factor float) + (ground-on-dir vector :inline) + (ride-time time-frame) + (ride-start-time time-frame) + (ride-button-time time-frame) + (ride-lean-targ float) + (ride-lean float) + (ride-leanv float) + (ride-lean-mag float) + (ride-tilt-targ float) + (ride-tilt float) + (ride-tiltv float) + (ride-tilt-mag float) + (ride-lock symbol) + (ride-lock-on symbol) + (ride-speed meters) + (ride-mode uint32) + (ride-rot degrees) + (ride-rot-old degrees) + (ride-rot-abs degrees 2) + (ride-rtv-abs degrees) + (ride-touch-segment vector 2 :inline) + (ride-dir vector :inline) + (ride-vertex-length int16) + (ride-vertex-length-old int16) + (ride-vertex-base int16) + (ride-vertex-base2 int16) + (ride-vertex-index float) + (ride-vertex-index2 float) + (ride-vertex-index-old float) + (ride-vertex vector 3 :inline) + (ride-segment vector :inline) + (ride-dir-lean vector :inline) + (ride-pad-vector vector 1 :inline) + (ride-vertex-old vector 3 :inline) + (ride-segment-old vector :inline) + (ride-vertex-trail vector 128 :inline) + (halfpipe-side-time time-frame) + (halfpipe-jump-time time-frame) + (halfpipe-lip-time time-frame) + (halfpipe-time time-frame) + (halfpipe-gspot-time time-frame) + (halfpipe-lip-event symbol) + (spin-check-time time-frame) + (spin-time time-frame) + (spin-start-time time-frame) + (spin-start-dir vector :inline) + (spin-control float) + (spin-ground-start-time time-frame) + (spin-ground-time time-frame) + (spin-ground-press-time time-frame) + (flip-control float) + (flip-count int32) + (unknown-time-frame03 time-frame :offset 3104) + (unknown-time-frame04 time-frame :offset 3112) + (unknown-time-frame05 time-frame :offset 3120) + (unknown-time-frame06 time-frame :offset 3128) + (unknown-float00 float :offset 3136) + (unknown-float01 float :offset 3140) + (trickx-count int32 :offset 3144) + (trotyv-max degrees) + (trotyv degrees) + (troty degrees) + (troty-cum degrees) + (unknown-deg00 degrees :offset 3164) + (upper-body-rotyv-max degrees :offset 3168) + (upper-body-rotyv degrees) + (upper-body-roty degrees) + (cushion-base meters) + (cushion-offset meters) + (shock-offset meters) + (shock-offsetv meters) + (shock-rotx meters) + (part-control sparticle-launch-control) + (trick-count int32) + (trick-array board-tricks 16) + (trick-points-array float 16 :offset 3272) + (trick-list board-tricks 16 :offset 3336) + (pad uint8 :offset 3399) ) - :method-count-assert 11 - :size-assert #xd48 - :flag-assert #xb00000d48 (:methods - (add-to-trick-list (_type_ board-tricks float) none 9) - (flush-trick-list (_type_) none 10) + (add-to-trick-list (_type_ board-tricks float) none) + (flush-trick-list (_type_) none) ) ) (deftype target-board-bank (basic) - ((jump-height-min meters :offset-assert 4) - (jump-height-max meters :offset-assert 8) - (duck-jump-height-min meters :offset-assert 12) - (duck-jump-height-max meters :offset-assert 16) - (turn-frames float :offset-assert 20) - (wall-kick-window seconds :offset-assert 24) - (cushion meters :offset-assert 32) - (trickx-jump-height-min meters :offset-assert 36) - (trickx-jump-height-max meters :offset-assert 40) - (tricky-jump-height-min meters :offset-assert 44) - (tricky-jump-height-max meters :offset-assert 48) + ((jump-height-min meters) + (jump-height-max meters) + (duck-jump-height-min meters) + (duck-jump-height-max meters) + (turn-frames float) + (wall-kick-window seconds) + (cushion meters) + (trickx-jump-height-min meters) + (trickx-jump-height-max meters) + (tricky-jump-height-min meters) + (tricky-jump-height-max meters) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) diff --git a/goal_src/jak2/engine/target/board/board-util.gc b/goal_src/jak2/engine/target/board/board-util.gc index 2baf3bce1c4..83fdd7893fa 100644 --- a/goal_src/jak2/engine/target/board/board-util.gc +++ b/goal_src/jak2/engine/target/board/board-util.gc @@ -14,7 +14,7 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch process-drawable vs board. -(defmethod relocate board ((this board) (arg0 int)) +(defmethod relocate ((this board) (arg0 int)) (if (nonzero? (-> this main)) (&+! (-> this main) arg0) ) diff --git a/goal_src/jak2/engine/target/board/target-board.gc b/goal_src/jak2/engine/target/board/target-board.gc index 55d08796bed..b0eaa7cbe48 100644 --- a/goal_src/jak2/engine/target/board/target-board.gc +++ b/goal_src/jak2/engine/target/board/target-board.gc @@ -2895,7 +2895,7 @@ (none) ) -(defmethod add-to-trick-list board-info ((this board-info) (arg0 board-tricks) (arg1 float)) +(defmethod add-to-trick-list ((this board-info) (arg0 board-tricks) (arg1 float)) "Add specified trick and point amount to trick list." (send-event (handle->process (-> this process 0 notify)) 'notify 'trick-point arg0) (when (and (< (-> this trick-count) 16) @@ -2957,7 +2957,7 @@ (none) ) -(defmethod flush-trick-list board-info ((this board-info)) +(defmethod flush-trick-list ((this board-info)) "Flush trick list and give out points." (let ((f30-0 0.0)) (dotimes (v1-0 (-> this trick-count)) diff --git a/goal_src/jak2/engine/target/darkjak-h.gc b/goal_src/jak2/engine/target/darkjak-h.gc index c0374a66268..f8bd691dca1 100644 --- a/goal_src/jak2/engine/target/darkjak-h.gc +++ b/goal_src/jak2/engine/target/darkjak-h.gc @@ -8,24 +8,21 @@ ;; DECOMP BEGINS (deftype darkjak-info (basic) - ((process (pointer target) :offset-assert 4) - (attack-id uint32 :offset-assert 8) - (start-time time-frame :offset-assert 16) - (attack-time time-frame :offset-assert 24) - (attack-count uint64 :offset-assert 32) - (stage darkjak-stage :offset-assert 40) - (want-stage darkjak-stage :offset-assert 44) - (clock-pos float :offset-assert 48) - (clock-vel float :offset-assert 52) - (clock-on symbol :offset-assert 56) - (hud handle 1 :offset 64) - (tone sound-id :offset 72) - (bomb uint32 :offset 76) + ((process (pointer target)) + (attack-id uint32) + (start-time time-frame) + (attack-time time-frame) + (attack-count uint64) + (stage darkjak-stage) + (want-stage darkjak-stage) + (clock-pos float) + (clock-vel float) + (clock-on symbol) + (hud handle 1 :offset 64) + (tone sound-id :offset 72) + (bomb uint32 :offset 76) ) - :method-count-assert 10 - :size-assert #x50 - :flag-assert #xa00000050 (:methods - (update-clock! (_type_ int) none :behavior target 9) + (update-clock! (_type_ int) none :behavior target) ) ) diff --git a/goal_src/jak2/engine/target/gun/gun-blue-shot.gc b/goal_src/jak2/engine/target/gun/gun-blue-shot.gc index 51915d3fd65..b85a254d5e7 100644 --- a/goal_src/jak2/engine/target/gun/gun-blue-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-blue-shot.gc @@ -39,18 +39,14 @@ ) (deftype gun-blue-shot (projectile) - ((init-pos vector :inline :offset-assert 480) - (init-dir vector :inline :offset-assert 496) - (collide-normal vector :inline :offset-assert 512) + ((init-pos vector :inline) + (init-dir vector :inline) + (collide-normal vector :inline) ) - :heap-base #x190 - :method-count-assert 40 - :size-assert #x210 - :flag-assert #x2801900210 ) -(defmethod draw-laser-sight gun-blue-shot ((this gun-blue-shot)) +(defmethod draw-laser-sight ((this gun-blue-shot)) "TODO - confirm If applicable, draw the laser sight particles" (let* ((s5-0 (ppointer->process (-> this parent))) (s4-0 (-> *part-id-table* 196)) @@ -98,7 +94,7 @@ (none) ) -(defmethod spawn-shell-particles gun-blue-shot ((this gun-blue-shot)) +(defmethod spawn-shell-particles ((this gun-blue-shot)) "TODO - confirm" (rlet ((vf0 :class vf) (vf4 :class vf) @@ -184,7 +180,7 @@ ) ) -(defmethod unknown-particles gun-blue-shot ((this gun-blue-shot)) +(defmethod unknown-particles ((this gun-blue-shot)) "TODO - confirm" (draw-beam (-> *part-id-table* 191) (-> this init-pos) (-> this init-dir) #f #t) (draw-beam (-> *part-id-table* 194) (-> this init-pos) (-> this starting-dir) #f #t) @@ -193,7 +189,7 @@ ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound gun-blue-shot ((this gun-blue-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this gun-blue-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -207,7 +203,7 @@ (none) ) -(defmethod made-impact? gun-blue-shot ((this gun-blue-shot)) +(defmethod made-impact? ((this gun-blue-shot)) "TODO - queries the collision cache, return true/false" (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) @@ -247,7 +243,7 @@ ) ) -(defmethod init-proj-collision! gun-blue-shot ((this gun-blue-shot)) +(defmethod init-proj-collision! ((this gun-blue-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -296,7 +292,7 @@ (none) ) -(defmethod init-proj-settings! gun-blue-shot ((this gun-blue-shot)) +(defmethod init-proj-settings! ((this gun-blue-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (with-pp (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) diff --git a/goal_src/jak2/engine/target/gun/gun-dark-shot.gc b/goal_src/jak2/engine/target/gun/gun-dark-shot.gc index 832e458ee22..89f19bb40dd 100644 --- a/goal_src/jak2/engine/target/gun/gun-dark-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-dark-shot.gc @@ -89,26 +89,22 @@ ) (deftype gun-dark-shot (projectile) - ((blast-radius float :offset-assert 472) - (core-position vector :inline :offset-assert 480) - (core-velocity vector :inline :offset-assert 496) - (spin-vector vector :inline :offset-assert 512) - (track-target handle :offset-assert 528) - (size-t float :offset-assert 536) - (result-array handle 16 :offset-assert 544) - (charge-sound sound-id :offset-assert 672) - (fire-sound sound-id :offset-assert 676) - (trail-sound sound-id :offset-assert 680) - (explode-sound sound-id :offset-assert 684) - (start-pilot? basic :offset-assert 688) + ((blast-radius float) + (core-position vector :inline) + (core-velocity vector :inline) + (spin-vector vector :inline) + (track-target handle) + (size-t float) + (result-array handle 16) + (charge-sound sound-id) + (fire-sound sound-id) + (trail-sound sound-id) + (explode-sound sound-id) + (start-pilot? basic) ) - :heap-base #x240 - :method-count-assert 42 - :size-assert #x2b4 - :flag-assert #x2a024002b4 - (:methods - (startup () _type_ :state 40) - (fizzle () _type_ :state 41) + (:state-methods + startup + fizzle ) ) @@ -142,7 +138,7 @@ ) ) -(defmethod init-proj-settings! gun-dark-shot ((this gun-dark-shot)) +(defmethod init-proj-settings! ((this gun-dark-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this attack-mode) 'eco-dark) (vector-normalize! (-> this root transv) (+ 225280.0 (* 225280.0 (-> this charge-level)))) @@ -162,7 +158,7 @@ (none) ) -(defmethod spawn-impact-particles gun-dark-shot ((this gun-dark-shot)) +(defmethod spawn-impact-particles ((this gun-dark-shot)) "Spawns associated particles with the projectile if applicable" (cond ((and (and (-> this next-state) (= (-> this next-state name) 'startup)) @@ -185,7 +181,7 @@ (none) ) -(defmethod go-moving! gun-dark-shot ((this gun-dark-shot)) +(defmethod go-moving! ((this gun-dark-shot)) (go (method-of-object this startup)) 0 (none) @@ -207,7 +203,7 @@ ) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (cond ((or (and *target* @@ -218,7 +214,7 @@ ) (go-virtual dissipate) ) - ((or (< (- (current-time) (-> self state-time)) (seconds 0.3)) (cpad-hold? 0 r1)) + ((or (not (time-elapsed? (-> self state-time) (seconds 0.3))) (cpad-hold? 0 r1)) (set! (-> self size-t) (fmin 1.0 (* 0.016666668 (the float (- (current-time) (-> self state-time)))))) (let ((t9-1 vector<-cspace!) (a0-13 (-> self root trans)) @@ -290,7 +286,7 @@ (vector-float*! (-> self spin-vector) (-> self spin-vector) (/ 1.0 f0-5)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-2 (let ((t9-4 (method-of-type part-tracker activate))) @@ -511,10 +507,10 @@ (defstate fizzle (gun-dark-shot) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (deactivate self) ) (process-drawable-shock-effect @@ -597,7 +593,7 @@ (sv-320 process-drawable) (sv-336 process-drawable) ) - (if (< (- (current-time) (-> self spawn-time)) (seconds 0.1)) + (if (not (time-elapsed? (-> self spawn-time) (seconds 0.1))) (send-event (ppointer->process (-> self parent)) 'release) ) (sound-stop (-> self trail-sound)) @@ -779,17 +775,17 @@ ) ) ) - (< (- (current-time) s3-0) (seconds 0.1)) + (not (time-elapsed? s3-0 (seconds 0.1))) ) ) ) - (< (- (current-time) s3-0) (seconds 5)) + (not (time-elapsed? s3-0 (seconds 5))) (not (logtest? (-> (the-as process-drawable (-> s5-0 0)) draw status) (draw-control-status no-draw no-draw-temp)) ) ) ) ) - (when (>= (- (current-time) (the-as time-frame s4-0)) (seconds 0.05)) + (when (time-elapsed? (the-as time-frame s4-0) (seconds 0.05)) (set! s4-0 (the-as int (current-time))) (if (handle->process arg0) (process-drawable-shock-effect-bullseye @@ -821,7 +817,7 @@ :to s4-1 ) (let ((s4-2 (current-time))) - (until (>= (- (current-time) s4-2) (seconds 0.1)) + (until (time-elapsed? s4-2 (seconds 0.1)) (suspend) ) ) @@ -832,7 +828,7 @@ ) (let ((gp-3 (current-time))) (while (or (-> self child) - (and (nonzero? (get-status *gui-control* (-> self explode-sound))) (< (- (current-time) gp-3) (seconds 10))) + (and (nonzero? (get-status *gui-control* (-> self explode-sound))) (not (time-elapsed? gp-3 (seconds 10)))) ) (suspend) ) diff --git a/goal_src/jak2/engine/target/gun/gun-h.gc b/goal_src/jak2/engine/target/gun/gun-h.gc index ecc56188325..7f23e87d0c0 100644 --- a/goal_src/jak2/engine/target/gun/gun-h.gc +++ b/goal_src/jak2/engine/target/gun/gun-h.gc @@ -26,116 +26,109 @@ ;; DECOMP BEGINS (deftype gun (process-drawable) - ((control control-info :offset 128) - (shadow-backup shadow-geo :offset 208) - (read-scale basic :offset-assert 212) - (gun-type pickup-type :offset-assert 216) - (barrel joint-mod :offset-assert 220) - (mag joint-mod 4 :offset-assert 224) - (mag-scale float 4 :offset-assert 240) + ((control control-info :overlay-at root) + (shadow-backup shadow-geo :offset 208) + (read-scale basic) + (gun-type pickup-type) + (barrel joint-mod) + (mag joint-mod 4) + (mag-scale float 4) ) - :heap-base #x80 - :method-count-assert 24 - :size-assert #x100 - :flag-assert #x1800800100 - (:methods - (idle () _type_ :state 20) - (use (symbol) _type_ :state 21) - (hidden () _type_ :state 22) - (die () _type_ :state 23) + (:state-methods + idle + (use symbol) + hidden + die ) ) (deftype gun-info (basic) - ((process (pointer target) :offset-assert 4) - (gun (pointer gun) :offset-assert 8) - (gun-pos transformq :inline :offset-assert 16) - (gun-trans vector :inline :offset 16) - (gun-quat quaternion :inline :offset 32) - (gun-scale vector :inline :offset 48) - (gun-type pickup-type :offset-assert 64) - (using-gun-type pickup-type :offset-assert 68) - (active? symbol :offset-assert 72) - (latch? symbol :offset-assert 76) - (put-away? symbol :offset-assert 80) - (surpress-time time-frame :offset-assert 88) - (fire-time time-frame :offset-assert 96) - (gun-time time-frame :offset-assert 104) - (gun-get-on-time time-frame :offset-assert 112) - (active-time time-frame :offset-assert 120) - (fire-delay uint32 :offset-assert 128) - (gun-control uint32 :offset-assert 132) - (gun-target uint32 :offset-assert 136) - (gun-daxter float :offset-assert 140) - (gun-roty-rel degrees :offset-assert 144) - (gun-roty degrees :offset-assert 148) - (gun-roty-targ degrees :offset-assert 152) - (hips joint-mod :offset-assert 156) - (upper-body joint-mod :offset-assert 160) - (chest joint-mod :offset-assert 164) - (fire-dir-rot degrees :offset-assert 168) - (fire-dir vector 2 :inline :offset-assert 176) - (fire-point vector :inline :offset-assert 208) - (fire-dir-backup vector :inline :offset-assert 224) - (fire-dir-out vector :inline :offset-assert 240) - (fire-pending int32 :offset-assert 256) - (fire-pending-time time-frame :offset-assert 264) - (fire-start-time time-frame :offset-assert 272) - (fire-charge float :offset-assert 280) - (fire-spin degrees :offset-assert 284) - (fire-spinv degrees :offset-assert 288) - (fire-chamber int32 :offset-assert 292) - (fire-range meters :offset-assert 296) - (laser-active? symbol :offset-assert 300) - (laser-point vector :inline :offset-assert 304) - (laser-dir vector 2 :inline :offset-assert 320) - (laser-hit-point vector :inline :offset-assert 352) - (track? gun-track-flags :offset-assert 368) - (track-tilt degrees :offset-assert 372) - (track-turn degrees :offset-assert 376) - (track-find-range meters :offset-assert 380) - (track-turnv-range meters :offset-assert 384) - (track-tilt-range meters :offset-assert 388) - (track-turn-range meters :offset-assert 392) - (track-tilt-max degrees :offset-assert 396) - (track-turn-max degrees :offset-assert 400) - (track-angle-mult float :offset-assert 404) - (track-beam-size float :offset-assert 408) - (track-auto-fire symbol :offset-assert 412) - (track-require uint32 :offset-assert 416) - (track-target-hold-time time-frame :offset-assert 424) - (track-start-time time-frame :offset-assert 432) - (track-press-start-time time-frame :offset-assert 440) - (track-target focus 2 :inline :offset-assert 448) - (track-trans vector :inline :offset-assert 480) - (track-dir vector :inline :offset-assert 496) - (turn-fast-hold-time time-frame :offset-assert 512) - (blue-whine-sound-id sound-id :offset-assert 520) - (blue-whine-volume float :offset-assert 524) - (top-anim-twist vector :inline :offset-assert 528) - (top-anim-twist-targ vector :inline :offset-assert 544) - (top-anim-look-at vector :inline :offset-assert 560) - (top-anim-twist-reset uint64 :offset-assert 576) - (top-anim-gun-height meters :offset-assert 584) - (top-anim-blue-cycle float :offset-assert 588) - (top-anim-low-high float :offset-assert 592) - (top-anim-extra-twistv degrees :offset-assert 596) - (top-anim-tilt-up degrees :offset-assert 600) - (attack-combo combo-tracker :inline :offset-assert 608) - (combo-window-start time-frame :offset-assert 656) - (combo-window-state symbol :offset-assert 664) - (combo-fire-delay uint32 :offset-assert 668) - (charge-ammo float :offset-assert 672) - (charge-start-time time-frame :offset-assert 680) - (charge-inc-time time-frame :offset-assert 688) - (charge-active? handle :offset-assert 696) + ((process (pointer target)) + (gun (pointer gun)) + (gun-pos transformq :inline) + (gun-trans vector :inline :overlay-at (-> gun-pos trans)) + (gun-quat quaternion :inline :overlay-at (-> gun-pos rot data 0)) + (gun-scale vector :inline :overlay-at (-> gun-pos scale)) + (gun-type pickup-type) + (using-gun-type pickup-type) + (active? symbol) + (latch? symbol) + (put-away? symbol) + (surpress-time time-frame) + (fire-time time-frame) + (gun-time time-frame) + (gun-get-on-time time-frame) + (active-time time-frame) + (fire-delay uint32) + (gun-control uint32) + (gun-target uint32) + (gun-daxter float) + (gun-roty-rel degrees) + (gun-roty degrees) + (gun-roty-targ degrees) + (hips joint-mod) + (upper-body joint-mod) + (chest joint-mod) + (fire-dir-rot degrees) + (fire-dir vector 2 :inline) + (fire-point vector :inline) + (fire-dir-backup vector :inline) + (fire-dir-out vector :inline) + (fire-pending int32) + (fire-pending-time time-frame) + (fire-start-time time-frame) + (fire-charge float) + (fire-spin degrees) + (fire-spinv degrees) + (fire-chamber int32) + (fire-range meters) + (laser-active? symbol) + (laser-point vector :inline) + (laser-dir vector 2 :inline) + (laser-hit-point vector :inline) + (track? gun-track-flags) + (track-tilt degrees) + (track-turn degrees) + (track-find-range meters) + (track-turnv-range meters) + (track-tilt-range meters) + (track-turn-range meters) + (track-tilt-max degrees) + (track-turn-max degrees) + (track-angle-mult float) + (track-beam-size float) + (track-auto-fire symbol) + (track-require uint32) + (track-target-hold-time time-frame) + (track-start-time time-frame) + (track-press-start-time time-frame) + (track-target focus 2 :inline) + (track-trans vector :inline) + (track-dir vector :inline) + (turn-fast-hold-time time-frame) + (blue-whine-sound-id sound-id) + (blue-whine-volume float) + (top-anim-twist vector :inline) + (top-anim-twist-targ vector :inline) + (top-anim-look-at vector :inline) + (top-anim-twist-reset uint64) + (top-anim-gun-height meters) + (top-anim-blue-cycle float) + (top-anim-low-high float) + (top-anim-extra-twistv degrees) + (top-anim-tilt-up degrees) + (attack-combo combo-tracker :inline) + (combo-window-start time-frame) + (combo-window-state symbol) + (combo-fire-delay uint32) + (charge-ammo float) + (charge-start-time time-frame) + (charge-inc-time time-frame) + (charge-active? handle) ) - :method-count-assert 10 - :size-assert #x2c0 - :flag-assert #xa000002c0 (:methods - (gun-info-method-9 (_type_) (inline-array vector) 9) + (gun-info-method-9 (_type_) (inline-array vector)) ) ) @@ -197,7 +190,7 @@ ) ) -(defmethod get-gun-ammo fact-info-target ((this fact-info-target)) +(defmethod get-gun-ammo ((this fact-info-target)) (let ((current-gun (gun->ammo (-> (the-as target (-> this process)) gun gun-type)))) (if (zero? current-gun) 0.0 diff --git a/goal_src/jak2/engine/target/gun/gun-red-shot.gc b/goal_src/jak2/engine/target/gun/gun-red-shot.gc index 78ce6b76df0..d248a219673 100644 --- a/goal_src/jak2/engine/target/gun/gun-red-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-red-shot.gc @@ -11,31 +11,29 @@ ;; DECOMP BEGINS (deftype gun-red-shot (process-drawable) - ((root collide-shape-moving :override) - (probe-count int32 :offset-assert 200) - (probe-mask uint32 :offset-assert 204) - (actor-count int32 :offset-assert 208) - (attack-id uint32 :offset-assert 212) - (start-pos vector :inline :offset-assert 224) - (start-dir vector :inline :offset-assert 240) - (start-rot vector :inline :offset-assert 256) - (probe-dir vector 19 :inline :offset-assert 272) + ((root collide-shape-moving :override) + (probe-count int32) + (probe-mask uint32) + (actor-count int32) + (attack-id uint32) + (start-pos vector :inline) + (start-dir vector :inline) + (start-rot vector :inline) + (probe-dir vector 19 :inline) ) - :heap-base #x1c0 - :method-count-assert 30 - :size-assert #x240 - :flag-assert #x1e01c00240 + (:state-methods + blocked + debug-idle + idle + ) (:methods - (blocked () _type_ :state 20) - (debug-idle () _type_ :state 21) - (idle () _type_ :state 22) - (init-probes! (_type_ collide-shape) none 23) - (gun-red-shot-method-24 (_type_) symbol 24) - (noop (_type_) none 25) - (gun-red-shot-method-26 (_type_) none 26) - (gun-red-shot-method-27 (_type_) none 27) - (gun-red-shot-method-28 (_type_ vector) sound-id 28) - (fire! (_type_ process-drawable int) object :behavior gun-red-shot 29) + (init-probes! (_type_ collide-shape) none) + (gun-red-shot-method-24 (_type_) symbol) + (noop (_type_) none) + (gun-red-shot-method-26 (_type_) none) + (gun-red-shot-method-27 (_type_) none) + (gun-red-shot-method-28 (_type_ vector) sound-id) + (fire! (_type_ process-drawable int) object :behavior gun-red-shot) ) ) @@ -131,7 +129,7 @@ ) ) -(defmethod fire! gun-red-shot ((this gun-red-shot) (arg0 process-drawable) (arg1 int)) +(defmethod fire! ((this gun-red-shot) (arg0 process-drawable) (arg1 int)) (let* ((s5-0 arg0) (v1-0 (if (type? s5-0 process-drawable) s5-0 @@ -180,13 +178,13 @@ ) ) -(defmethod noop gun-red-shot ((this gun-red-shot)) +(defmethod noop ((this gun-red-shot)) "Does nothing" 0 (none) ) -(defmethod init-probes! gun-red-shot ((this gun-red-shot) (arg0 collide-shape)) +(defmethod init-probes! ((this gun-red-shot) (arg0 collide-shape)) "Create all 19 probe vectors" (let ((s5-0 (-> this probe-count))) (when (< s5-0 19) @@ -229,7 +227,7 @@ (none) ) -(defmethod gun-red-shot-method-26 gun-red-shot ((this gun-red-shot)) +(defmethod gun-red-shot-method-26 ((this gun-red-shot)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -342,7 +340,7 @@ ) ) -(defmethod gun-red-shot-method-27 gun-red-shot ((this gun-red-shot)) +(defmethod gun-red-shot-method-27 ((this gun-red-shot)) (gun-red-shot-method-26 this) (let ((s5-0 (-> this probe-count))) (while (< s5-0 19) @@ -362,7 +360,7 @@ (none) ) -(defmethod gun-red-shot-method-28 gun-red-shot ((this gun-red-shot) (arg0 vector)) +(defmethod gun-red-shot-method-28 ((this gun-red-shot) (arg0 vector)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -405,7 +403,7 @@ ) ) -(defmethod gun-red-shot-method-24 gun-red-shot ((this gun-red-shot)) +(defmethod gun-red-shot-method-24 ((this gun-red-shot)) (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) diff --git a/goal_src/jak2/engine/target/gun/gun-util.gc b/goal_src/jak2/engine/target/gun/gun-util.gc index 31fc5872097..ac0704fad5b 100644 --- a/goal_src/jak2/engine/target/gun/gun-util.gc +++ b/goal_src/jak2/engine/target/gun/gun-util.gc @@ -9,14 +9,10 @@ (deftype gun-eject (projectile-bounce) () - :heap-base #x170 - :method-count-assert 42 - :size-assert #x1f0 - :flag-assert #x2a017001f0 ) -(defmethod init-proj-settings! gun-eject ((this gun-eject)) +(defmethod init-proj-settings! ((this gun-eject)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton this @@ -40,14 +36,10 @@ (deftype gun-mag-yellow (projectile-bounce) () - :heap-base #x170 - :method-count-assert 42 - :size-assert #x1f0 - :flag-assert #x2a017001f0 ) -(defmethod init-proj-settings! gun-mag-yellow ((this gun-mag-yellow)) +(defmethod init-proj-settings! ((this gun-mag-yellow)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton this @@ -65,14 +57,10 @@ (deftype gun-mag-red (projectile-bounce) () - :heap-base #x170 - :method-count-assert 42 - :size-assert #x1f0 - :flag-assert #x2a017001f0 ) -(defmethod init-proj-settings! gun-mag-red ((this gun-mag-red)) +(defmethod init-proj-settings! ((this gun-mag-red)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton this @@ -90,14 +78,10 @@ (deftype gun-mag-blue (projectile-bounce) () - :heap-base #x170 - :method-count-assert 42 - :size-assert #x1f0 - :flag-assert #x2a017001f0 ) -(defmethod init-proj-settings! gun-mag-blue ((this gun-mag-blue)) +(defmethod init-proj-settings! ((this gun-mag-blue)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton this @@ -115,14 +99,10 @@ (deftype gun-mag-dark (projectile-bounce) () - :heap-base #x170 - :method-count-assert 42 - :size-assert #x1f0 - :flag-assert #x2a017001f0 ) -(defmethod init-proj-settings! gun-mag-dark ((this gun-mag-dark)) +(defmethod init-proj-settings! ((this gun-mag-dark)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton this @@ -139,11 +119,8 @@ ) (deftype beam-info (structure) - ((y-scale float :offset-assert 0) + ((y-scale float) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -264,7 +241,7 @@ ) ;; WARN: Return type mismatch process-drawable vs gun. -(defmethod relocate gun ((this gun) (arg0 int)) +(defmethod relocate ((this gun) (arg0 int)) (if (nonzero? (-> this barrel)) (&+! (-> this barrel) arg0) ) @@ -885,7 +862,7 @@ (none) ) -(defmethod gun-info-method-9 gun-info ((this gun-info)) +(defmethod gun-info-method-9 ((this gun-info)) (when (and (-> this laser-active?) (-> this active?) (not (logtest? (-> this gun 0 draw status) (draw-control-status no-draw))) diff --git a/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc b/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc index 8b90a6d4376..fa3c2e4efbb 100644 --- a/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc @@ -52,25 +52,21 @@ ) (deftype gun-yellow-shot (projectile) - ((hit-actor? symbol :offset-assert 472) - (tail-pos vector :inline :offset-assert 480) - (hit-pos vector :inline :offset-assert 496) + ((hit-actor? symbol) + (tail-pos vector :inline) + (hit-pos vector :inline) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x200 - :flag-assert #x2801800200 ) -(defmethod draw-laser-sight gun-yellow-shot ((this gun-yellow-shot)) +(defmethod draw-laser-sight ((this gun-yellow-shot)) "TODO - confirm If applicable, draw the laser sight particles" (draw-beam (-> *part-id-table* 227) (-> this tail-pos) (-> this starting-dir) #f #t) 0 (none) ) -(defmethod spawn-impact-particles gun-yellow-shot ((this gun-yellow-shot)) +(defmethod spawn-impact-particles ((this gun-yellow-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -136,7 +132,7 @@ ) ) -(defmethod deal-damage! gun-yellow-shot ((this gun-yellow-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! ((this gun-yellow-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((t9-0 (method-of-type projectile deal-damage!))) (when (t9-0 this arg0 arg1) @@ -146,7 +142,7 @@ ) ) -(defmethod spawn-shell-particles gun-yellow-shot ((this gun-yellow-shot)) +(defmethod spawn-shell-particles ((this gun-yellow-shot)) "TODO - confirm" (cond ((-> this hit-actor?) @@ -229,7 +225,7 @@ ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound gun-yellow-shot ((this gun-yellow-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this gun-yellow-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -249,7 +245,7 @@ (none) ) -(defmethod made-impact? gun-yellow-shot ((this gun-yellow-shot)) +(defmethod made-impact? ((this gun-yellow-shot)) "TODO - queries the collision cache, return true/false" (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) @@ -301,7 +297,7 @@ (none) ) -(defmethod init-proj-collision! gun-yellow-shot ((this gun-yellow-shot)) +(defmethod init-proj-collision! ((this gun-yellow-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -353,7 +349,7 @@ (none) ) -(defmethod init-proj-settings! gun-yellow-shot ((this gun-yellow-shot)) +(defmethod init-proj-settings! ((this gun-yellow-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this hit-actor?) #f) (set! (-> this tail-pos quad) (-> this root trans quad)) diff --git a/goal_src/jak2/engine/target/logic-target.gc b/goal_src/jak2/engine/target/logic-target.gc index 9f9edab7fd0..7b445e2c3d4 100644 --- a/goal_src/jak2/engine/target/logic-target.gc +++ b/goal_src/jak2/engine/target/logic-target.gc @@ -3047,7 +3047,7 @@ self ) -(defmethod init-target target ((this target) (arg0 continue-point) (arg1 symbol)) +(defmethod init-target ((this target) (arg0 continue-point) (arg1 symbol)) (local-vars (s1-0 int) (s2-0 int) (s3-0 int) (s4-0 int) (sv-16 collide-shape-prim-group)) (set! (-> this tobot?) arg1) (set! (-> this tobot-recorder) #f) @@ -3303,7 +3303,7 @@ (none) ) -(defmethod deactivate target ((this target)) +(defmethod deactivate ((this target)) (kill-persister *setting-control* (the-as engine-pers 'bg-a-speed) 'bg-a-speed) (if (nonzero? (-> this darkjak)) (sound-stop (-> this darkjak tone)) diff --git a/goal_src/jak2/engine/target/mech/carry-h.gc b/goal_src/jak2/engine/target/mech/carry-h.gc index d8e8fc9e9c2..bcd34a4ebbe 100644 --- a/goal_src/jak2/engine/target/mech/carry-h.gc +++ b/goal_src/jak2/engine/target/mech/carry-h.gc @@ -23,41 +23,38 @@ ;; DECOMP BEGINS (deftype carry-info (basic) - ((process (pointer target) :offset-assert 4) - (pickup-time time-frame :offset-assert 8) - (other-value float :offset-assert 16) - (other handle :offset-assert 24) - (point vector :inline :offset-assert 32) - (normal vector :inline :offset-assert 48) - (max-angle degrees :offset-assert 64) - (max-distance meters :offset-assert 68) - (max-pull meters :offset-assert 72) - (min-pull meters :offset-assert 76) - (grab-trans-blend float :offset-assert 80) - (carry-radius meters :offset-assert 84) - (backup-radius meters :offset-assert 88) - (joint int8 :offset-assert 92) - (mode carry-mode :offset-assert 93) - (face-dir int8 :offset-assert 94) - (local-point vector :inline :offset-assert 96) - (local-normal vector :inline :offset-assert 112) - (grab-quat quaternion :inline :offset-assert 128) - (grab-trans vector :inline :offset-assert 144) - (hold-trans vector :inline :offset-assert 160) + ((process (pointer target)) + (pickup-time time-frame) + (other-value float) + (other handle) + (point vector :inline) + (normal vector :inline) + (max-angle degrees) + (max-distance meters) + (max-pull meters) + (min-pull meters) + (grab-trans-blend float) + (carry-radius meters) + (backup-radius meters) + (joint int8) + (mode carry-mode) + (face-dir int8) + (local-point vector :inline) + (local-normal vector :inline) + (grab-quat quaternion :inline) + (grab-trans vector :inline) + (hold-trans vector :inline) ) - :method-count-assert 17 - :size-assert #xb0 - :flag-assert #x11000000b0 (:methods - (new (symbol type process-drawable int vector vector float) _type_ 0) - (carry-info-method-9 (_type_) none 9) - (distance-from-destination (_type_ carry-info) float 10) - (drag! (_type_ carry-info) none 11) - (drop-impl! (_type_ carry-info) none 12) - (carry-info-method-13 (_type_) symbol :behavior process-drawable 13) - (carry! (_type_ carry-info vector vector) none 14) - (drop! (_type_ carry-info) none 15) - (translate! (_type_) symbol :behavior process-drawable 16) + (new (symbol type process-drawable int vector vector float) _type_) + (carry-info-method-9 (_type_) none) + (distance-from-destination (_type_ carry-info) float) + (drag! (_type_ carry-info) none) + (drop-impl! (_type_ carry-info) none) + (carry-info-method-13 (_type_) symbol :behavior process-drawable) + (carry! (_type_ carry-info vector vector) none) + (drop! (_type_ carry-info) none) + (translate! (_type_) symbol :behavior process-drawable) ) ) @@ -104,7 +101,7 @@ ) ) -(defmethod carry-info-method-9 carry-info ((this carry-info)) +(defmethod carry-info-method-9 ((this carry-info)) (let ((s5-0 (-> this process 0 node-list data (-> this joint) bone transform))) (vector-rotate*! (-> this normal) (-> this local-normal) s5-0) (vector-matrix*! (-> this point) (-> this local-point) s5-0) @@ -113,7 +110,7 @@ (none) ) -(defmethod distance-from-destination carry-info ((this carry-info) (arg0 carry-info)) +(defmethod distance-from-destination ((this carry-info) (arg0 carry-info)) "Returns the distance from the current `point` and the provided [[carry-info]]'s `point`. Returns `-1.0` if it exceeds the maximum allowed" (let* ((f28-0 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) (-> arg0 point) (-> this point)))) @@ -186,7 +183,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ) -(defmethod drag! carry-info ((this carry-info) (arg0 carry-info)) +(defmethod drag! ((this carry-info) (arg0 carry-info)) (let ((v1-0 (-> arg0 process))) (set! (-> this other) (the-as handle (logior (if v1-0 (new 'static 'handle :pid (-> v1-0 0 pid)) @@ -285,7 +282,7 @@ Returns `-1.0` if it exceeds the maximum allowed" (none) ) -(defmethod drop-impl! carry-info ((this carry-info) (arg0 carry-info)) +(defmethod drop-impl! ((this carry-info) (arg0 carry-info)) (let ((a1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 process 0 control quat)))) (set! (-> a1-2 y) 0.0) (set-heading-vec-clear-roll-pitch! (-> arg0 process 0 control) a1-2) @@ -324,7 +321,7 @@ Returns `-1.0` if it exceeds the maximum allowed" (none) ) -(defmethod carry-info-method-13 carry-info ((this carry-info)) +(defmethod carry-info-method-13 ((this carry-info)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer self)) (set! (-> a1-0 num-params) 0) @@ -395,7 +392,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ;; WARN: Return type mismatch vector vs none. -(defmethod carry! carry-info ((this carry-info) (arg0 carry-info) (arg1 vector) (arg2 vector)) +(defmethod carry! ((this carry-info) (arg0 carry-info) (arg1 vector) (arg2 vector)) (let ((v1-0 (-> arg0 process))) (set! (-> this other) (the-as handle (logior (if v1-0 (new 'static 'handle :pid (-> v1-0 0 pid)) @@ -474,7 +471,7 @@ Returns `-1.0` if it exceeds the maximum allowed" (none) ) -(defmethod translate! carry-info ((this carry-info)) +(defmethod translate! ((this carry-info)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer self)) (set! (-> a1-0 num-params) 0) @@ -490,7 +487,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ) -(defmethod drop! carry-info ((this carry-info) (arg0 carry-info)) +(defmethod drop! ((this carry-info) (arg0 carry-info)) (drop-impl! this arg0) (none) ) diff --git a/goal_src/jak2/engine/target/mech/grunt-mech.gc b/goal_src/jak2/engine/target/mech/grunt-mech.gc index 386d8ae60a0..4f3af9efbc3 100644 --- a/goal_src/jak2/engine/target/mech/grunt-mech.gc +++ b/goal_src/jak2/engine/target/mech/grunt-mech.gc @@ -8,32 +8,26 @@ ;; DECOMP BEGINS (deftype grunt-mech-hold (structure) - ((reserve-mask uint8 :offset-assert 0) - (lower-hold int8 :offset-assert 1) - (grunt-handle handle :offset-assert 8) - (timeout uint64 :offset-assert 16) - (local-pos vector :inline :offset-assert 32) - (local-rot vector :inline :offset-assert 48) - (local-mat matrix :inline :offset-assert 64) - (world-mat matrix :inline :offset-assert 128) + ((reserve-mask uint8) + (lower-hold int8) + (grunt-handle handle) + (timeout uint64) + (local-pos vector :inline) + (local-rot vector :inline) + (local-mat matrix :inline) + (world-mat matrix :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) (deftype grunt-mech-info (basic) - ((reserved-mask uint8 :offset-assert 4) - (last-update-time time-frame :offset-assert 8) - (holds grunt-mech-hold 6 :inline :offset-assert 16) + ((reserved-mask uint8) + (last-update-time time-frame) + (holds grunt-mech-hold 6 :inline) ) - :method-count-assert 11 - :size-assert #x490 - :flag-assert #xb00000490 (:methods - (grunt-mech-info-method-9 (_type_ int process symbol) symbol 9) - (grunt-mech-info-method-10 (_type_) none 10) + (grunt-mech-info-method-9 (_type_ int process symbol) symbol) + (grunt-mech-info-method-10 (_type_) none) ) ) @@ -93,7 +87,7 @@ ) ) -(defmethod grunt-mech-info-method-10 grunt-mech-info ((this grunt-mech-info)) +(defmethod grunt-mech-info-method-10 ((this grunt-mech-info)) (let ((s5-0 (current-time))) (when (!= (-> this last-update-time) s5-0) (when (< s5-0 (-> this last-update-time)) @@ -142,7 +136,7 @@ (none) ) -(defmethod grunt-mech-info-method-9 grunt-mech-info ((this grunt-mech-info) (arg0 int) (arg1 process) (arg2 symbol)) +(defmethod grunt-mech-info-method-9 ((this grunt-mech-info) (arg0 int) (arg1 process) (arg2 symbol)) (grunt-mech-info-method-10 this) (let ((v1-2 *target*)) (when (and v1-2 (focus-test? v1-2 mech) (not (logtest? (-> v1-2 focus-status) (focus-status dead ignore)))) @@ -165,29 +159,27 @@ ) (deftype grunt-mech (grunt) - ((hold-id int8 :offset-assert 692) - (dismount-dest vector :inline :offset-assert 704) + ((hold-id int8) + (dismount-dest vector :inline) ) - :heap-base #x250 - :method-count-assert 196 - :size-assert #x2d0 - :flag-assert #xc4025002d0 + (:state-methods + mech-lunge + mech-hold + mech-dismount + mech-post-circling + mech-pre-circling + ) (:methods - (mech-lunge () _type_ :state 186) - (mech-hold () _type_ :state 187) - (mech-dismount () _type_ :state 188) - (mech-post-circling () _type_ :state 189) - (mech-pre-circling () _type_ :state 190) - (grunt-mech-method-191 (_type_) none 191) - (grunt-mech-method-192 (_type_) symbol 192) - (grunt-mech-method-193 (_type_) int 193) - (grunt-mech-method-194 (_type_) none 194) - (grunt-mech-method-195 (_type_ vector vector vector) symbol 195) + (grunt-mech-method-191 (_type_) none) + (grunt-mech-method-192 (_type_) symbol) + (grunt-mech-method-193 (_type_) int) + (grunt-mech-method-194 (_type_) none) + (grunt-mech-method-195 (_type_ vector vector vector) symbol) ) ) -(defmethod track-target! grunt-mech ((this grunt-mech)) +(defmethod track-target! ((this grunt-mech)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -200,7 +192,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod grunt-mech-method-193 grunt-mech ((this grunt-mech)) +(defmethod grunt-mech-method-193 ((this grunt-mech)) (local-vars (f0-3 float) (sv-592 vector)) (let ((s4-0 *grunt-mech-info*)) (grunt-mech-info-method-10 s4-0) @@ -283,7 +275,7 @@ ) ) -(defmethod grunt-method-184 grunt-mech ((this grunt-mech) (arg0 float)) +(defmethod grunt-method-184 ((this grunt-mech) (arg0 float)) (local-vars (v1-5 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -406,7 +398,7 @@ (none) ) -(defmethod grunt-mech-method-195 grunt-mech ((this grunt-mech) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod grunt-mech-method-195 ((this grunt-mech) (arg0 vector) (arg1 vector) (arg2 vector)) (local-vars (v1-13 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -463,7 +455,7 @@ ) ) -(defmethod grunt-mech-method-192 grunt-mech ((this grunt-mech)) +(defmethod grunt-mech-method-192 ((this grunt-mech)) (do-navigation-to-destination (-> this nav state) (-> this root trans)) (let ((a1-1 *target*)) (if (or (not a1-1) (not (logtest? (focus-status mech) (-> a1-1 focus-status)))) @@ -522,13 +514,13 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod grunt-mech-method-194 grunt-mech ((this grunt-mech)) +(defmethod grunt-mech-method-194 ((this grunt-mech)) (send-event *target* 'attack #f (static-attack-info ((id (new-attack-id)) (mode 'grunt)))) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod grunt-mech-method-191 grunt-mech ((this grunt-mech)) +(defmethod grunt-mech-method-191 ((this grunt-mech)) (if (>= (current-time) (-> this state-timeout)) (go (method-of-object this mech-dismount)) ) diff --git a/goal_src/jak2/engine/target/mech/mech-h.gc b/goal_src/jak2/engine/target/mech/mech-h.gc index d6c9eff614a..8e1ee1c02cd 100644 --- a/goal_src/jak2/engine/target/mech/mech-h.gc +++ b/goal_src/jak2/engine/target/mech/mech-h.gc @@ -8,54 +8,51 @@ ;; DECOMP BEGINS (deftype mech-info (basic) - ((entity basic :offset-assert 4) - (hud handle 1 :offset-assert 8) - (mech-trans vector :inline :offset-assert 16) - (mech-quat vector :inline :offset-assert 32) - (mech-scale vector :inline :offset-assert 48) - (engine-sound-id sound-id :offset-assert 64) - (engine-sound-volume float :offset-assert 68) - (engine-sound-pitch float :offset-assert 72) - (thrust-sound-id sound-id :offset-assert 76) - (drag-sound-id sound-id :offset-assert 80) - (whine-sound-id sound-id :offset-assert 84) - (mech-start-time time-frame :offset-assert 88) - (mech-time time-frame :offset-assert 96) - (no-get-off-time time-frame :offset-assert 104) - (stick-lock basic :offset-assert 112) - (stick-off basic :offset-assert 116) - (forward-vel meters :offset-assert 120) - (jump-thrust meters :offset-assert 124) - (jump-thrust-fuel float :offset-assert 128) - (unstuck-time time-frame :offset-assert 136) - (stuck-count int32 :offset-assert 144) - (back-touch-point vector :inline :offset-assert 160) - (back-touch-trans vector :inline :offset-assert 176) - (back-touch-time time-frame :offset-assert 192) - (attack-id uint32 :offset-assert 200) - (shield-value float :offset-assert 204) - (shield-max float :offset-assert 208) - (walk-anim-leg int32 :offset-assert 212) - (state-impact? symbol 1 :offset-assert 216) - (state-impact impact-control 1 :inline :offset-assert 224) - (thruster-flame-width meters :offset-assert 304) - (thruster-flame-length meters :offset-assert 308) - (thruster-local-pos vector 2 :inline :offset-assert 320) - (exhaust-local-pos vector 2 :inline :offset-assert 352) - (exhaust-local-dir vector 2 :inline :offset-assert 384) - (smoke-local-pos vector 2 :inline :offset-assert 416) - (smoke-local-vel vector 2 :inline :offset-assert 448) - (particle-system-2d basic :offset-assert 480) - (particle-system-3d basic :offset-assert 484) - (part-thruster basic :offset-assert 488) - (part-thruster-scale-x sp-field-init-spec :offset-assert 492) - (part-thruster-scale-y sp-field-init-spec :offset-assert 496) - (part-quat quaternion :offset-assert 500) - (part-vel vector :offset-assert 504) + ((entity basic) + (hud handle 1) + (mech-trans vector :inline) + (mech-quat vector :inline) + (mech-scale vector :inline) + (engine-sound-id sound-id) + (engine-sound-volume float) + (engine-sound-pitch float) + (thrust-sound-id sound-id) + (drag-sound-id sound-id) + (whine-sound-id sound-id) + (mech-start-time time-frame) + (mech-time time-frame) + (no-get-off-time time-frame) + (stick-lock basic) + (stick-off basic) + (forward-vel meters) + (jump-thrust meters) + (jump-thrust-fuel float) + (unstuck-time time-frame) + (stuck-count int32) + (back-touch-point vector :inline) + (back-touch-trans vector :inline) + (back-touch-time time-frame) + (attack-id uint32) + (shield-value float) + (shield-max float) + (walk-anim-leg int32) + (state-impact? symbol 1) + (state-impact impact-control 1 :inline) + (thruster-flame-width meters) + (thruster-flame-length meters) + (thruster-local-pos vector 2 :inline) + (exhaust-local-pos vector 2 :inline) + (exhaust-local-dir vector 2 :inline) + (smoke-local-pos vector 2 :inline) + (smoke-local-vel vector 2 :inline) + (particle-system-2d basic) + (particle-system-3d basic) + (part-thruster basic) + (part-thruster-scale-x sp-field-init-spec) + (part-thruster-scale-y sp-field-init-spec) + (part-quat quaternion) + (part-vel vector) ) - :method-count-assert 9 - :size-assert #x1fc - :flag-assert #x9000001fc ) diff --git a/goal_src/jak2/engine/target/mech/mech.gc b/goal_src/jak2/engine/target/mech/mech.gc index 84f74019ffb..a9b77cfe67d 100644 --- a/goal_src/jak2/engine/target/mech/mech.gc +++ b/goal_src/jak2/engine/target/mech/mech.gc @@ -15,30 +15,28 @@ ) (deftype mech (process-drawable) - ((root collide-shape-moving :override) - (extra-trans vector :inline :offset-assert 208) - (condition int32 :offset-assert 224) - (shadow-backup basic :offset-assert 228) - (rider uint64 :offset-assert 232) - (shield-value float :offset-assert 240) - (nav-sphere-handle uint64 :offset-assert 248) - (probe-time time-frame :offset-assert 256) + ((root collide-shape-moving :override) + (extra-trans vector :inline) + (condition int32) + (shadow-backup basic) + (rider uint64) + (shield-value float) + (nav-sphere-handle uint64) + (probe-time time-frame) ) - :heap-base #x90 - :method-count-assert 25 - :size-assert #x108 - :flag-assert #x1900900108 + (:state-methods + wait-for-start + idle + (pickup (state mech)) + wait-for-return + ) (:methods - (wait-for-start () _type_ :state 20) - (idle () _type_ :state 21) - (pickup ((state mech)) _type_ :state 22) - (wait-for-return () _type_ :state 23) - (mech-method-24 (_type_) none 24) + (mech-method-24 (_type_) none) ) ) -(defmethod mech-method-24 mech ((this mech)) +(defmethod mech-method-24 ((this mech)) (if (nonzero? (-> this part)) (spawn (-> this part) (-> this root trans)) ) @@ -351,7 +349,7 @@ (none) ) -(defmethod init-from-entity! mech ((this mech) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mech) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -364,13 +362,9 @@ This commonly includes things such as: (deftype mech-target (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) + (:state-methods + idle + active ) ) diff --git a/goal_src/jak2/engine/target/surface-h.gc b/goal_src/jak2/engine/target/surface-h.gc index fa52a429d67..cc51e034c05 100644 --- a/goal_src/jak2/engine/target/surface-h.gc +++ b/goal_src/jak2/engine/target/surface-h.gc @@ -67,49 +67,46 @@ ;; DECOMP BEGINS (deftype surface (basic) - ((name symbol :offset-assert 4) - (turnv float :offset-assert 8) - (turnvv float :offset-assert 12) - (tiltv float :offset-assert 16) - (tiltvv float :offset-assert 20) - (transv-max float :offset-assert 24) - (target-speed float :offset-assert 28) - (seek0 float :offset-assert 32) - (seek90 float :offset-assert 36) - (seek180 float :offset-assert 40) - (fric float :offset-assert 44) - (nonlin-fric-dist float :offset-assert 48) - (slip-factor float :offset-assert 52) - (slide-factor float :offset-assert 56) - (slope-up-factor float :offset-assert 60) - (slope-down-factor float :offset-assert 64) - (slope-slip-angle float :offset-assert 68) - (impact-fric float :offset-assert 72) - (bend-factor float :offset-assert 76) - (bend-speed float :offset-assert 80) - (alignv float :offset-assert 84) - (slope-up-traction float :offset-assert 88) - (align-speed float :offset-assert 92) - (slope-change-preserve float :offset-assert 96) - (turnvf float :offset-assert 100) - (turnvvf float :offset-assert 104) - (tiltvf float :offset-assert 108) - (tiltvvf float :offset-assert 112) - (vel-turn float :offset-assert 116) - (active-hook (function none) :offset 128) - (touch-hook (function none) :offset 132) - (impact-hook (function control-info (pointer float) vector none) :offset 136) - (mult-hook (function surface surface surface int none) :offset-assert 140) - (exit-hook function :offset-assert 144) - (mode symbol :offset-assert 148) - (flags surface-flag :offset-assert 152) - (data float 30 :offset 8) - (hook function 4 :offset 128) - (dataw uint32 2 :offset 148) + ((name symbol) + (turnv float) + (turnvv float) + (tiltv float) + (tiltvv float) + (transv-max float) + (target-speed float) + (seek0 float) + (seek90 float) + (seek180 float) + (fric float) + (nonlin-fric-dist float) + (slip-factor float) + (slide-factor float) + (slope-up-factor float) + (slope-down-factor float) + (slope-slip-angle float) + (impact-fric float) + (bend-factor float) + (bend-speed float) + (alignv float) + (slope-up-traction float) + (align-speed float) + (slope-change-preserve float) + (turnvf float) + (turnvvf float) + (tiltvf float) + (tiltvvf float) + (vel-turn float) + (active-hook (function none) :offset 128) + (touch-hook (function none) :offset 132) + (impact-hook (function control-info (pointer float) vector none) :offset 136) + (mult-hook (function surface surface surface int none)) + (exit-hook function) + (mode symbol) + (flags surface-flag) + (data float 30 :overlay-at turnv) + (hook function 4 :overlay-at active-hook) + (dataw uint32 2 :overlay-at mode) ) - :method-count-assert 9 - :size-assert #x9c - :flag-assert #x90000009c ) @@ -130,7 +127,7 @@ ) ;; ERROR: Function may read a register that is not set: t3 -(defmethod print surface ((this surface)) +(defmethod print ((this surface)) (local-vars (t3-0 none)) (format #t diff --git a/goal_src/jak2/engine/target/target-darkjak.gc b/goal_src/jak2/engine/target/target-darkjak.gc index a82e890d95e..3dc3f1e2fd5 100644 --- a/goal_src/jak2/engine/target/target-darkjak.gc +++ b/goal_src/jak2/engine/target/target-darkjak.gc @@ -952,7 +952,7 @@ :post target-post ) -(defmethod update-clock! darkjak-info ((this darkjak-info) (arg0 int)) +(defmethod update-clock! ((this darkjak-info) (arg0 int)) (when (-> this clock-on) (+! (-> this clock-pos) (* (-> this clock-vel) (seconds-per-frame))) (+! (-> this clock-vel) (* 4.0 (seconds-per-frame))) diff --git a/goal_src/jak2/engine/target/target-death.gc b/goal_src/jak2/engine/target/target-death.gc index 95ec8b0ebf2..d3225d1ef1c 100644 --- a/goal_src/jak2/engine/target/target-death.gc +++ b/goal_src/jak2/engine/target/target-death.gc @@ -1277,12 +1277,9 @@ ) (deftype kill-nearby-enemies-info (basic) - ((dist float :offset-assert 4) - (pos vector :inline :offset-assert 16) + ((dist float) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) diff --git a/goal_src/jak2/engine/target/target-h.gc b/goal_src/jak2/engine/target/target-h.gc index 3229cbc522d..da29ea944dc 100644 --- a/goal_src/jak2/engine/target/target-h.gc +++ b/goal_src/jak2/engine/target/target-h.gc @@ -121,81 +121,77 @@ ;; DECOMP BEGINS (deftype target (process-focusable) - ((self target :override) - (fact fact-info-target :override) - (control control-info :offset 128) - (skel2 joint-control :offset-assert 204) - (shadow-backup shadow-geo :offset-assert 208) - (target-flags uint32 :offset 188) - (game game-info :offset-assert 212) - (neck joint-mod :offset-assert 216) - (head joint-mod :offset-assert 220) - (upper-body joint-mod :offset-assert 224) - (horns joint-mod :offset-assert 228) - (hair joint-mod 2 :offset-assert 232) - (darkjak-interp float :offset-assert 240) - (darkjak-giant-interp float :offset-assert 244) - (arm-ik joint-mod-ik 2 :offset-assert 248) - (leg-ik joint-mod-ik 2 :offset-assert 256) - (foot joint-mod 2 :offset-assert 264) - (mech-ik joint-mod-ik 2 :offset-assert 272) - (init-time time-frame :offset 272) - (teleport-time time-frame :offset-assert 280) - (state-hook-time time-frame :offset-assert 288) - (state-hook (function none :behavior target) :offset-assert 296) - (cam-user-mode symbol :offset-assert 300) - (sidekick (pointer sidekick) :offset-assert 304) - (manipy (pointer manipy) :offset-assert 308) - (mirror (pointer process-drawable) :offset-assert 312) - (attack-info attack-info :inline :offset-assert 320) - (attack-info-rec attack-info :inline :offset-assert 480) - (attack-info-old attack-info 8 :inline :offset-assert 640) - (anim-seed uint64 :offset-assert 1920) - (alt-cam-pos vector :inline :offset-assert 1936) - (current-level level :offset-assert 1952) - (saved-pos transformq :inline :offset-assert 1968) - (saved-owner uint64 :offset-assert 2016) - (alt-neck-pos vector :inline :offset-assert 2032) - (focus-search (array collide-shape) :offset-assert 2048) - (excitement float :offset-assert 2052) - (shock-effect-time time-frame :offset-assert 2056) - (beard? symbol :offset-assert 2064) - (spool-anim spool-anim :offset-assert 2068) - (ambient-time time-frame :offset-assert 2072) - (fp-hud handle :offset-assert 2080) - (no-load-wait uint64 :offset-assert 2088) - (no-look-around-wait uint64 :offset-assert 2096) - (burn-proc handle :offset-assert 2104) - (pre-joint-hook (function none :behavior target) :offset-assert 2112) - (notify handle :offset-assert 2120) - (mode-cache basic :offset-assert 2128) - (mode-param1 handle :offset-assert 2136) - (mode-param2 uint64 :offset-assert 2144) - (mode-param3 uint64 :offset-assert 2152) - (tobot-state state :offset-assert 2160) - (tobot? symbol :offset-assert 2164) - (tobot-recorder basic :offset-assert 2168) - (color-effect basic :offset-assert 2172) - (color-effect-start-time time-frame :offset-assert 2176) - (color-effect-duration uint64 :offset-assert 2184) - (racer racer-info :offset-assert 2192) - (tube tube-info :offset-assert 2196) - (flut flut-info :offset-assert 2200) - (board board-info :offset-assert 2204) - (pilot pilot-info :offset-assert 2208) - (gun gun-info :offset-assert 2212) - (mech mech-info :offset-assert 2216) - (turret turret-info :offset-assert 2220) - (darkjak darkjak-info :offset-assert 2224) - (indax indax-info :offset-assert 2228) + ((self target :override) + (fact fact-info-target :override) + (control control-info :overlay-at root) + (skel2 joint-control) + (shadow-backup shadow-geo) + (target-flags uint32 :overlay-at state-flags) + (game game-info) + (neck joint-mod) + (head joint-mod) + (upper-body joint-mod) + (horns joint-mod) + (hair joint-mod 2) + (darkjak-interp float) + (darkjak-giant-interp float) + (arm-ik joint-mod-ik 2) + (leg-ik joint-mod-ik 2) + (foot joint-mod 2) + (mech-ik joint-mod-ik 2) + (init-time time-frame :overlay-at (-> mech-ik 0)) + (teleport-time time-frame) + (state-hook-time time-frame) + (state-hook (function none :behavior target)) + (cam-user-mode symbol) + (sidekick (pointer sidekick)) + (manipy (pointer manipy)) + (mirror (pointer process-drawable)) + (attack-info attack-info :inline) + (attack-info-rec attack-info :inline) + (attack-info-old attack-info 8 :inline) + (anim-seed uint64) + (alt-cam-pos vector :inline) + (current-level level) + (saved-pos transformq :inline) + (saved-owner uint64) + (alt-neck-pos vector :inline) + (focus-search (array collide-shape)) + (excitement float) + (shock-effect-time time-frame) + (beard? symbol) + (spool-anim spool-anim) + (ambient-time time-frame) + (fp-hud handle) + (no-load-wait uint64) + (no-look-around-wait uint64) + (burn-proc handle) + (pre-joint-hook (function none :behavior target)) + (notify handle) + (mode-cache basic) + (mode-param1 handle) + (mode-param2 uint64) + (mode-param3 uint64) + (tobot-state state) + (tobot? symbol) + (tobot-recorder basic) + (color-effect basic) + (color-effect-start-time time-frame) + (color-effect-duration uint64) + (racer racer-info) + (tube tube-info) + (flut flut-info) + (board board-info) + (pilot pilot-info) + (gun gun-info) + (mech mech-info) + (turret turret-info) + (darkjak darkjak-info) + (indax indax-info) ) - :heap-base #x840 - :method-count-assert 29 - :size-assert #x8b8 - :flag-assert #x1d084008b8 (:methods - (do-edge-grabs (_type_ collide-cache collide-edge-spec) none 27) - (init-target (_type_ continue-point symbol) none :behavior target 28) + (do-edge-grabs (_type_ collide-cache collide-edge-spec) none) + (init-target (_type_ continue-point symbol) none :behavior target) ) (:states target-attack @@ -359,20 +355,16 @@ (define-perm *target* target #f) (deftype sidekick (process-drawable) - ((parent (pointer target) :override) - (control control-info :offset 128) - (anim-seed uint64 :offset 208) - (shadow-in-movie? symbol :offset-assert 216) - (special-anim-time time-frame :offset-assert 224) - (special-anim-interp float :offset-assert 232) - (special-anim-frame float :offset-assert 236) - (offset transformq :inline :offset-assert 240) - (mirror (pointer process-drawable) :offset-assert 288) + ((parent (pointer target) :override) + (control control-info :overlay-at root) + (anim-seed uint64 :offset 208) + (shadow-in-movie? symbol) + (special-anim-time time-frame) + (special-anim-interp float) + (special-anim-frame float) + (offset transformq :inline) + (mirror (pointer process-drawable)) ) - :heap-base #xb0 - :method-count-assert 20 - :size-assert #x124 - :flag-assert #x1400b00124 (:states sidekick-clone ) diff --git a/goal_src/jak2/engine/target/target-tube.gc b/goal_src/jak2/engine/target/target-tube.gc index 4513c8d6287..70ca748ae2b 100644 --- a/goal_src/jak2/engine/target/target-tube.gc +++ b/goal_src/jak2/engine/target/target-tube.gc @@ -124,35 +124,29 @@ ) (deftype tube-info (basic) - ((entity basic :offset-assert 4) - (tube handle :offset-assert 8) - (downhill vector :inline :offset-assert 16) - (centertube vector :inline :offset-assert 32) - (downtube vector :inline :offset-assert 48) - (sidetube vector :inline :offset-assert 64) - (foretube vector :inline :offset-assert 80) - (old-transv vector :inline :offset-assert 96) - (mod-x float :offset-assert 112) - (mod-y float :offset-assert 116) - (start-time time-frame :offset-assert 120) - (turn-anim-targ float :offset-assert 128) - (turn-anim-frame float :offset-assert 132) - (turn-anim-vel float :offset-assert 136) - (tube-sound-id sound-id :offset-assert 140) - (tube-sound-vol float :offset-assert 144) - (tube-sound-pitch float :offset-assert 148) + ((entity basic) + (tube handle) + (downhill vector :inline) + (centertube vector :inline) + (downtube vector :inline) + (sidetube vector :inline) + (foretube vector :inline) + (old-transv vector :inline) + (mod-x float) + (mod-y float) + (start-time time-frame) + (turn-anim-targ float) + (turn-anim-frame float) + (turn-anim-vel float) + (tube-sound-id sound-id) + (tube-sound-vol float) + (tube-sound-pitch float) ) - :method-count-assert 9 - :size-assert #x98 - :flag-assert #x900000098 ) (deftype tube-bank (basic) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -950,19 +944,15 @@ ) (deftype slide-control (process-drawable) - ((target handle :offset-assert 200) - (pos float :offset-assert 208) - (trans vector :inline :offset-assert 224) - (rot vector :inline :offset-assert 240) - (side vector :inline :offset-assert 256) + ((target handle) + (pos float) + (trans vector :inline) + (rot vector :inline) + (side vector :inline) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x110 - :flag-assert #x1600900110 - (:methods - (slide-control-watch () _type_ :state 20) - (slide-control-ride () _type_ :state 21) + (:state-methods + slide-control-watch + slide-control-ride ) ) @@ -1100,7 +1090,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! slide-control ((this slide-control) (arg0 entity-actor)) +(defmethod init-from-entity! ((this slide-control) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/engine/target/target-turret-shot.gc b/goal_src/jak2/engine/target/target-turret-shot.gc index 6b335dedc08..bd101e82b7e 100644 --- a/goal_src/jak2/engine/target/target-turret-shot.gc +++ b/goal_src/jak2/engine/target/target-turret-shot.gc @@ -185,12 +185,8 @@ ) (deftype turret-shot (guard-shot) - ((hit-pos vector :inline :offset-assert 496) + ((hit-pos vector :inline) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x200 - :flag-assert #x2801800200 ) @@ -236,7 +232,7 @@ ) ) -(defmethod spawn-impact-particles turret-shot ((this turret-shot)) +(defmethod spawn-impact-particles ((this turret-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -293,7 +289,7 @@ ) ) -(defmethod spawn-shell-particles turret-shot ((this turret-shot)) +(defmethod spawn-shell-particles ((this turret-shot)) "TODO - confirm" (let* ((root (-> this root)) (v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> root trans)) 2048.0)) @@ -341,7 +337,7 @@ (none) ) -(defmethod play-impact-sound turret-shot ((this turret-shot) (proj-options projectile-options)) +(defmethod play-impact-sound ((this turret-shot) (proj-options projectile-options)) (let ((options proj-options)) (cond ((zero? options) @@ -357,7 +353,7 @@ ) ;; WARN: Return type mismatch projectile-options vs none. -(defmethod init-proj-settings! turret-shot ((this turret-shot)) +(defmethod init-proj-settings! ((this turret-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) @@ -369,7 +365,7 @@ (none) ) -(defmethod init-proj-collision! turret-shot ((this turret-shot)) +(defmethod init-proj-collision! ((this turret-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) diff --git a/goal_src/jak2/engine/target/target-turret.gc b/goal_src/jak2/engine/target/target-turret.gc index 9b16425045e..37c9346b854 100644 --- a/goal_src/jak2/engine/target/target-turret.gc +++ b/goal_src/jak2/engine/target/target-turret.gc @@ -257,16 +257,12 @@ ) (deftype hud-turret-health (hud) - ((fade-interp float :offset-assert 2980) + ((fade-interp float) ) - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba8 - :flag-assert #x1b0b300ba8 ) -(defmethod draw hud-turret-health ((this hud-turret-health)) +(defmethod draw ((this hud-turret-health)) (with-pp (seek! (-> this fade-interp) @@ -404,14 +400,14 @@ ) ) -(defmethod update-values hud-turret-health ((this hud-turret-health)) +(defmethod update-values ((this hud-turret-health)) (set! (-> this values 0 target) (the int (-> *game-info* score))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod event-callback hud-turret-health ((this hud-turret-health) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod event-callback ((this hud-turret-health) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('set-heat) (set! (-> this values 1 target) (the int (* 100.0 (the-as float (-> arg3 param 0))))) @@ -552,14 +548,10 @@ (deftype hud-drill-turret-health (hud-turret-health) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba8 - :flag-assert #x1b0b300ba8 ) -(defmethod init-callback hud-drill-turret-health ((this hud-drill-turret-health)) +(defmethod init-callback ((this hud-drill-turret-health)) (set! (-> this level) (level-get *level* 'drillmid)) (init-turret-hud this "drillmid-minimap") ((method-of-type hud init-callback) this) @@ -569,14 +561,10 @@ (deftype hud-port-turret-health (hud-turret-health) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba8 - :flag-assert #x1b0b300ba8 ) -(defmethod init-callback hud-port-turret-health ((this hud-port-turret-health)) +(defmethod init-callback ((this hud-port-turret-health)) (set! (-> this level) (level-get *level* 'portblmp)) (init-turret-hud this "portblmp-minimap") ((method-of-type hud init-callback) this) @@ -585,16 +573,13 @@ ) (deftype turret-info (basic) - ((process (pointer process) :offset-assert 4) - (handle handle :offset-assert 8) - (turret (pointer base-turret) :offset-assert 16) - (grabbed? symbol :offset-assert 20) - (quat quaternion :inline :offset-assert 32) - (trans vector :inline :offset-assert 48) + ((process (pointer process)) + (handle handle) + (turret (pointer base-turret)) + (grabbed? symbol) + (quat quaternion :inline) + (trans vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) @@ -634,110 +619,102 @@ ) (deftype turret-path-event (structure) - ((pos float :offset-assert 0) - (event-type symbol :offset-assert 4) - (param object :offset-assert 8) + ((pos float) + (event-type symbol) + (param object) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype turret-path (structure) - ((event-count int32 :offset-assert 0) - (event-tbl (inline-array turret-path-event) :offset-assert 4) + ((event-count int32) + (event-tbl (inline-array turret-path-event)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype base-turret (process-focusable) - ((hud handle :offset-assert 208) - (condition int32 :offset-assert 216) - (shadow-backup symbol :offset-assert 220) - (rider handle :offset-assert 224) - (actor-group (pointer actor-group) :offset-assert 232) - (actor-group-count int32 :offset-assert 236) - (alt-actor symbol :offset-assert 240) - (smush-control smush-control :inline :offset-assert 248) - (sound-id sound-id 3 :offset-assert 280) - (sound-playing symbol 3 :offset-assert 292) - (cam-string-vector vector :inline :offset-assert 304) - (path-event turret-path :offset-assert 320) - (path-u float :offset-assert 324) - (path-u-prev float :offset-assert 328) - (path-mode uint16 :offset-assert 332) - (path-speed float :offset-assert 336) - (path-speed-mult float :offset-assert 340) - (path-speed-mult-final float :offset-assert 344) - (path-old-pos vector :inline :offset-assert 352) - (path-direction symbol :offset-assert 368) - (pause-proc (function base-turret symbol) :offset-assert 372) - (gun-recoil-jmod joint-mod-add-local 4 :offset-assert 376) - (gun-index int32 :offset-assert 392) - (shot-timeout time-frame :offset-assert 400) - (fire-time time-frame :offset-assert 408) - (fire-time-interval time-frame :offset-assert 416) - (enable-controls symbol :offset-assert 424) - (available-for-pickup symbol :offset-assert 428) - (roty degrees :offset-assert 432) - (rotyv degrees :offset-assert 436) - (rotyvv degrees :offset-assert 440) - (roty-min degrees :offset-assert 444) - (roty-max degrees :offset-assert 448) - (rotx degrees :offset-assert 452) - (rotxv degrees :offset-assert 456) - (rotxvv degrees :offset-assert 460) - (rotx-min degrees :offset-assert 464) - (rotx-max degrees :offset-assert 468) - (target-quat quaternion :inline :offset-assert 480) - (init-quat quaternion :inline :offset-assert 496) - (health float :offset-assert 512) - (track-handle handle :offset-assert 520) - (heat float :offset-assert 528) - (heat-target float :offset-assert 532) - (arrow-angle degrees :offset-assert 536) - (arrow-alpha float :offset-assert 540) - (arrow-red float :offset-assert 544) - (red-filter-timer time-frame :offset-assert 552) - (ride-height float :offset-assert 560) + ((hud handle) + (condition int32) + (shadow-backup symbol) + (rider handle) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (alt-actor symbol) + (smush-control smush-control :inline) + (sound-id sound-id 3) + (sound-playing symbol 3) + (cam-string-vector vector :inline) + (path-event turret-path) + (path-u float) + (path-u-prev float) + (path-mode uint16) + (path-speed float) + (path-speed-mult float) + (path-speed-mult-final float) + (path-old-pos vector :inline) + (path-direction symbol) + (pause-proc (function base-turret symbol)) + (gun-recoil-jmod joint-mod-add-local 4) + (gun-index int32) + (shot-timeout time-frame) + (fire-time time-frame) + (fire-time-interval time-frame) + (enable-controls symbol) + (available-for-pickup symbol) + (roty degrees) + (rotyv degrees) + (rotyvv degrees) + (roty-min degrees) + (roty-max degrees) + (rotx degrees) + (rotxv degrees) + (rotxvv degrees) + (rotx-min degrees) + (rotx-max degrees) + (target-quat quaternion :inline) + (init-quat quaternion :inline) + (health float) + (track-handle handle) + (heat float) + (heat-target float) + (arrow-angle degrees) + (arrow-alpha float) + (arrow-red float) + (red-filter-timer time-frame) + (ride-height float) ) - :heap-base #x1c0 - :method-count-assert 49 - :size-assert #x234 - :flag-assert #x3101c00234 + (:state-methods + idle + setup + active + shutdown + dormant + die + ) (:methods - (idle () _type_ :state 27) - (setup () _type_ :state 28) - (active () _type_ :state 29) - (shutdown () _type_ :state 30) - (dormant () _type_ :state 31) - (die () _type_ :state 32) - (turret-init! (_type_ entity-actor matrix) none 33) - (base-turret-method-34 (_type_ process) none 34) - (base-turret-method-35 (_type_) none 35) - (base-turret-method-36 (_type_) none 36) - (base-turret-method-37 (_type_) none 37) - (base-turret-method-38 (_type_) none 38) - (base-turret-method-39 (_type_ turret-path-event) none 39) - (base-turret-method-40 (_type_) none 40) - (base-turret-method-41 (_type_ vector) symbol 41) - (base-turret-method-42 (_type_ vector vector float) float 42) - (base-turret-method-43 (_type_) none 43) - (base-turret-method-44 (_type_ vector vector) none 44) - (base-turret-method-45 (_type_ object symbol) none 45) - (base-turret-method-46 (_type_ process) process 46) - (base-turret-method-47 (_type_) none 47) - (turret-event-handler (_type_ process int symbol event-message-block) object 48) + (turret-init! (_type_ entity-actor matrix) none) + (base-turret-method-34 (_type_ process) none) + (base-turret-method-35 (_type_) none) + (base-turret-method-36 (_type_) none) + (base-turret-method-37 (_type_) none) + (base-turret-method-38 (_type_) none) + (base-turret-method-39 (_type_ turret-path-event) none) + (base-turret-method-40 (_type_) none) + (base-turret-method-41 (_type_ vector) symbol) + (base-turret-method-42 (_type_ vector vector float) float) + (base-turret-method-43 (_type_) none) + (base-turret-method-44 (_type_ vector vector) none) + (base-turret-method-45 (_type_ object symbol) none) + (base-turret-method-46 (_type_ process) process) + (base-turret-method-47 (_type_) none) + (turret-event-handler (_type_ process int symbol event-message-block) object) ) ) ;; WARN: Return type mismatch process-drawable vs base-turret. -(defmethod relocate base-turret ((this base-turret) (arg0 int)) +(defmethod relocate ((this base-turret) (arg0 int)) (countdown (v1-0 4) (if (-> this gun-recoil-jmod v1-0) (&+! (-> this gun-recoil-jmod v1-0) arg0) @@ -746,18 +723,18 @@ (the-as base-turret ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod base-turret-method-34 base-turret ((this base-turret) (arg0 process)) +(defmethod base-turret-method-34 ((this base-turret) (arg0 process)) 0 (none) ) -(defmethod base-turret-method-35 base-turret ((this base-turret)) +(defmethod base-turret-method-35 ((this base-turret)) (send-event (handle->process (-> this hud)) 'force-show) 0 (none) ) -(defmethod base-turret-method-36 base-turret ((this base-turret)) +(defmethod base-turret-method-36 ((this base-turret)) (if (nonzero? (-> this part)) (spawn (-> this part) (-> this root trans)) ) @@ -765,7 +742,7 @@ (none) ) -(defmethod base-turret-method-40 base-turret ((this base-turret)) +(defmethod base-turret-method-40 ((this base-turret)) (let ((s3-0 (new 'stack-no-clear 'matrix)) (s4-0 (new 'stack-no-clear 'matrix)) (gp-0 (new 'stack-no-clear 'quaternion)) @@ -783,7 +760,7 @@ (none) ) -(defmethod base-turret-method-37 base-turret ((this base-turret)) +(defmethod base-turret-method-37 ((this base-turret)) (let ((f30-0 (fabs (* 0.00006866455 (-> this rotyv)))) (f28-0 (fabs (* 0.00010986328 (-> this rotxv)))) (f26-0 0.33333334) @@ -839,7 +816,7 @@ (none) ) -(defmethod turret-event-handler base-turret ((this base-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod turret-event-handler ((this base-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('trans) @@ -876,7 +853,7 @@ (turret-event-handler self arg0 arg1 arg2 arg3) ) -(defmethod get-trans base-turret ((this base-turret) (arg0 int)) +(defmethod get-trans ((this base-turret) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (if (= arg0 1) (-> this root trans) @@ -1549,11 +1526,11 @@ ) ;; WARN: Return type mismatch symbol vs process. -(defmethod base-turret-method-46 base-turret ((this base-turret) (arg0 process)) +(defmethod base-turret-method-46 ((this base-turret) (arg0 process)) (the-as process #t) ) -(defmethod base-turret-method-47 base-turret ((this base-turret)) +(defmethod base-turret-method-47 ((this base-turret)) (let ((a0-1 (-> this root trans)) (f30-0 0.0) (s4-0 (the-as process-drawable #f)) @@ -1649,7 +1626,7 @@ (none) ) -(defmethod base-turret-method-43 base-turret ((this base-turret)) +(defmethod base-turret-method-43 ((this base-turret)) (set! (-> this roty) (y-angle (-> this root))) (set! (-> this rotyv) 0.0) (set! (-> this rotyvv) 0.0) @@ -1660,7 +1637,7 @@ (none) ) -(defmethod turret-init! base-turret ((this base-turret) (arg0 entity-actor) (arg1 matrix)) +(defmethod turret-init! ((this base-turret) (arg0 entity-actor) (arg1 matrix)) (local-vars (sv-16 res-tag)) ;; og:preserve-this changed from 512 (stack-size-set! (-> this main-thread) 1024) @@ -1792,7 +1769,7 @@ (none) ) -(defmethod base-turret-method-41 base-turret ((this base-turret) (arg0 vector)) +(defmethod base-turret-method-41 ((this base-turret) (arg0 vector)) (local-vars (sv-592 int)) (let* ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this init-quat))) (s1-0 (-> this root trans)) @@ -1829,7 +1806,7 @@ #f ) -(defmethod base-turret-method-44 base-turret ((this base-turret) (arg0 vector) (arg1 vector)) +(defmethod base-turret-method-44 ((this base-turret) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (set! (-> gp-0 ent) (-> this entity)) (set! (-> gp-0 charge) 1.0) @@ -1852,7 +1829,7 @@ (none) ) -(defmethod base-turret-method-42 base-turret ((this base-turret) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod base-turret-method-42 ((this base-turret) (arg0 vector) (arg1 vector) (arg2 float)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (set! (-> s5-0 start-pos quad) (-> arg0 quad)) (vector-normalize-copy! (-> s5-0 move-dist) arg1 819200.0) @@ -1878,7 +1855,7 @@ ) ) -(defmethod base-turret-method-45 base-turret ((this base-turret) (arg0 object) (arg1 symbol)) +(defmethod base-turret-method-45 ((this base-turret) (arg0 object) (arg1 symbol)) (local-vars (sv-112 vector) (sv-128 vector) (sv-144 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1933,7 +1910,7 @@ ) ) -(defmethod base-turret-method-39 base-turret ((this base-turret) (arg0 turret-path-event)) +(defmethod base-turret-method-39 ((this base-turret) (arg0 turret-path-event)) (case (-> arg0 event-type) (('script) (script-eval (the-as pair (-> arg0 param))) @@ -1979,7 +1956,7 @@ (none) ) -(defmethod base-turret-method-38 base-turret ((this base-turret)) +(defmethod base-turret-method-38 ((this base-turret)) (when (nonzero? (-> this path-event)) (let* ((s5-0 (-> this path-event)) (f0-0 (get-num-segments (-> this path))) @@ -1999,7 +1976,7 @@ (none) ) -(defmethod deactivate base-turret ((this base-turret)) +(defmethod deactivate ((this base-turret)) (if (valid? (-> this hud) (the-as type #f) "" #t 0) (send-event (handle->process (-> this hud)) 'hide-and-die) ) @@ -2011,7 +1988,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! base-turret ((this base-turret) (arg0 entity-actor)) +(defmethod init-from-entity! ((this base-turret) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/engine/target/target-util.gc b/goal_src/jak2/engine/target/target-util.gc index e153631dd78..3f4836a711c 100644 --- a/goal_src/jak2/engine/target/target-util.gc +++ b/goal_src/jak2/engine/target/target-util.gc @@ -60,113 +60,110 @@ ) (deftype target-bank (basic) - ((jump-collide-offset meters :offset-assert 4) - (jump-height-min meters :offset-assert 8) - (jump-height-max meters :offset-assert 12) - (double-jump-height-min meters :offset-assert 16) - (double-jump-height-max meters :offset-assert 20) - (flip-jump-height-min meters :offset-assert 24) - (flip-jump-height-max meters :offset-assert 28) - (duck-jump-height-min meters :offset-assert 32) - (duck-jump-height-max meters :offset-assert 36) - (flop-jump-height-min meters :offset-assert 40) - (flop-jump-height-max meters :offset-assert 44) - (attack-jump-height-min meters :offset-assert 48) - (attack-jump-height-max meters :offset-assert 52) - (edge-grab-jump-height-min meters :offset-assert 56) - (edge-grab-jump-height-max meters :offset-assert 60) - (swim-jump-height-min meters :offset-assert 64) - (swim-jump-height-max meters :offset-assert 68) - (tube-jump-height-min meters :offset-assert 72) - (tube-jump-height-max meters :offset-assert 76) - (carry-jump-height-min meters :offset-assert 80) - (carry-jump-height-max meters :offset-assert 84) - (mech-jump-height-min meters :offset-assert 88) - (mech-jump-height-max meters :offset-assert 92) - (mech-carry-jump-height-min meters :offset-assert 96) - (mech-carry-jump-height-max meters :offset-assert 100) - (indax-jump-height-min meters :offset-assert 104) - (indax-jump-height-max meters :offset-assert 108) - (indax-double-jump-height-min meters :offset-assert 112) - (indax-double-jump-height-max meters :offset-assert 116) - (roll-duration uint64 :offset-assert 120) - (roll-jump-pre-window uint64 :offset-assert 128) - (roll-jump-post-window uint64 :offset-assert 136) - (roll-timeout uint64 :offset-assert 144) - (roll-speed-min meters :offset-assert 152) - (roll-speed-inc meters :offset-assert 156) - (roll-flip-duration uint64 :offset-assert 160) - (roll-flip-height meters :offset-assert 168) - (roll-flip-dist meters :offset-assert 172) - (roll-flip-art-height meters :offset-assert 176) - (roll-flip-art-dist meters :offset-assert 180) - (duck-slide-distance meters :offset-assert 184) - (fall-far meters :offset-assert 188) - (fall-far-inc meters :offset-assert 192) - (attack-timeout uint64 :offset-assert 200) - (ground-timeout uint64 :offset-assert 208) - (slide-down-timeout uint64 :offset-assert 216) - (fall-timeout uint64 :offset-assert 224) - (fall-stumble-threshold meters :offset-assert 232) - (yellow-projectile-speed meters :offset-assert 236) - (hit-invulnerable-timeout uint64 :offset-assert 240) - (same-attack-invulnerable-timeout uint64 :offset-assert 248) - (run-cycle-length float :offset-assert 256) - (walk-cycle-dist meters :offset-assert 260) - (walk-up-cycle-dist meters :offset-assert 264) - (walk-down-cycle-dist meters :offset-assert 268) - (walk-side-cycle-dist meters :offset-assert 272) - (run-cycle-dist meters :offset-assert 276) - (run-up-cycle-dist meters :offset-assert 280) - (run-down-cycle-dist meters :offset-assert 284) - (run-side-cycle-dist meters :offset-assert 288) - (run-wall-cycle-dist meters :offset-assert 292) - (duck-walk-cycle-dist meters :offset-assert 296) - (wade-shallow-walk-cycle-dist meters :offset-assert 300) - (wade-deep-walk-cycle-dist meters :offset-assert 304) - (mech-walk-cycle-dist meters :offset-assert 308) - (mech-run-cycle-dist meters :offset-assert 312) - (smack-surface-dist meters :offset-assert 316) - (smack-surface-height meters :offset-assert 320) - (min-dive-depth meters :offset-assert 324) - (root-radius meters :offset-assert 328) - (root-offset vector :inline :offset-assert 336) - (body-radius meters :offset-assert 352) - (edge-radius meters :offset-assert 356) - (edge-offset vector :inline :offset-assert 368) - (edge-grab-height-off-ground meters :offset-assert 384) - (head-radius meters :offset-assert 388) - (head-height meters :offset-assert 392) - (head-offset vector :inline :offset-assert 400) - (spin-radius meters :offset-assert 416) - (spin-offset vector :inline :offset-assert 432) - (duck-spin-radius meters :offset-assert 448) - (duck-spin-offset vector :inline :offset-assert 464) - (punch-radius meters :offset-assert 480) - (punch-offset vector :inline :offset-assert 496) - (uppercut-radius meters :offset-assert 512) - (uppercut0-offset vector :inline :offset-assert 528) - (uppercut1-offset vector :inline :offset-assert 544) - (flop-radius meters :offset-assert 560) - (flop0-offset vector :inline :offset-assert 576) - (flop1-offset vector :inline :offset-assert 592) - (stuck-time seconds :offset-assert 608) - (stuck-timeout seconds :offset-assert 616) - (stuck-distance meters :offset-assert 624) - (tongue-pull-speed-min float :offset-assert 628) - (tongue-pull-speed-max float :offset-assert 632) - (yellow-attack-timeout uint64 :offset-assert 640) - (fall-height meters :offset-assert 648) - (mech-jump-thrust-fuel float :offset-assert 652) - (strafe-jump-pre-window uint64 :offset-assert 656) - (strafe-jump basic :offset-assert 664) - (strafe-duck-jump basic :offset-assert 668) - (dark-jump-height-min meters :offset-assert 672) - (dark-jump-height-max meters :offset-assert 676) + ((jump-collide-offset meters) + (jump-height-min meters) + (jump-height-max meters) + (double-jump-height-min meters) + (double-jump-height-max meters) + (flip-jump-height-min meters) + (flip-jump-height-max meters) + (duck-jump-height-min meters) + (duck-jump-height-max meters) + (flop-jump-height-min meters) + (flop-jump-height-max meters) + (attack-jump-height-min meters) + (attack-jump-height-max meters) + (edge-grab-jump-height-min meters) + (edge-grab-jump-height-max meters) + (swim-jump-height-min meters) + (swim-jump-height-max meters) + (tube-jump-height-min meters) + (tube-jump-height-max meters) + (carry-jump-height-min meters) + (carry-jump-height-max meters) + (mech-jump-height-min meters) + (mech-jump-height-max meters) + (mech-carry-jump-height-min meters) + (mech-carry-jump-height-max meters) + (indax-jump-height-min meters) + (indax-jump-height-max meters) + (indax-double-jump-height-min meters) + (indax-double-jump-height-max meters) + (roll-duration uint64) + (roll-jump-pre-window uint64) + (roll-jump-post-window uint64) + (roll-timeout uint64) + (roll-speed-min meters) + (roll-speed-inc meters) + (roll-flip-duration uint64) + (roll-flip-height meters) + (roll-flip-dist meters) + (roll-flip-art-height meters) + (roll-flip-art-dist meters) + (duck-slide-distance meters) + (fall-far meters) + (fall-far-inc meters) + (attack-timeout uint64) + (ground-timeout uint64) + (slide-down-timeout uint64) + (fall-timeout uint64) + (fall-stumble-threshold meters) + (yellow-projectile-speed meters) + (hit-invulnerable-timeout uint64) + (same-attack-invulnerable-timeout uint64) + (run-cycle-length float) + (walk-cycle-dist meters) + (walk-up-cycle-dist meters) + (walk-down-cycle-dist meters) + (walk-side-cycle-dist meters) + (run-cycle-dist meters) + (run-up-cycle-dist meters) + (run-down-cycle-dist meters) + (run-side-cycle-dist meters) + (run-wall-cycle-dist meters) + (duck-walk-cycle-dist meters) + (wade-shallow-walk-cycle-dist meters) + (wade-deep-walk-cycle-dist meters) + (mech-walk-cycle-dist meters) + (mech-run-cycle-dist meters) + (smack-surface-dist meters) + (smack-surface-height meters) + (min-dive-depth meters) + (root-radius meters) + (root-offset vector :inline) + (body-radius meters) + (edge-radius meters) + (edge-offset vector :inline) + (edge-grab-height-off-ground meters) + (head-radius meters) + (head-height meters) + (head-offset vector :inline) + (spin-radius meters) + (spin-offset vector :inline) + (duck-spin-radius meters) + (duck-spin-offset vector :inline) + (punch-radius meters) + (punch-offset vector :inline) + (uppercut-radius meters) + (uppercut0-offset vector :inline) + (uppercut1-offset vector :inline) + (flop-radius meters) + (flop0-offset vector :inline) + (flop1-offset vector :inline) + (stuck-time seconds) + (stuck-timeout seconds) + (stuck-distance meters) + (tongue-pull-speed-min float) + (tongue-pull-speed-max float) + (yellow-attack-timeout uint64) + (fall-height meters) + (mech-jump-thrust-fuel float) + (strafe-jump-pre-window uint64) + (strafe-jump basic) + (strafe-duck-jump basic) + (dark-jump-height-min meters) + (dark-jump-height-max meters) ) - :method-count-assert 9 - :size-assert #x2a8 - :flag-assert #x9000002a8 ) @@ -990,7 +987,7 @@ 0 ) -(defmethod get-quaternion control-info ((this control-info)) +(defmethod get-quaternion ((this control-info)) (-> this quat-for-control) ) @@ -1011,7 +1008,7 @@ ) ) -(defmethod get-inv-mass target ((this target)) +(defmethod get-inv-mass ((this target)) (if (or (and (focus-test? this dark) (nonzero? (-> this darkjak)) (logtest? (-> this darkjak stage) (darkjak-stage giant)) @@ -1024,7 +1021,7 @@ ) ;; WARN: Return type mismatch control-info vs trsqv. -(defmethod apply-alignment target ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (with-pp (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg2 quad)) @@ -1488,7 +1485,7 @@ #t ) -(defmethod attack-info-method-9 attack-info ((this attack-info) (arg0 attack-info) (arg1 process-drawable) (arg2 process-drawable)) +(defmethod attack-info-method-9 ((this attack-info) (arg0 attack-info) (arg1 process-drawable) (arg2 process-drawable)) (local-vars (v1-14 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1559,7 +1556,7 @@ ) ) -(defmethod compute-intersect-info attack-info ((this attack-info) (arg0 object) (arg1 process-drawable) (arg2 process) (arg3 touching-shapes-entry)) +(defmethod compute-intersect-info ((this attack-info) (arg0 object) (arg1 process-drawable) (arg2 process) (arg3 touching-shapes-entry)) (when (and arg3 arg1) (let ((a1-2 (prims-touching? arg3 (the-as collide-shape (-> arg1 root)) (the-as uint -1)))) (when a1-2 @@ -1586,7 +1583,7 @@ this ) -(defmethod combine! attack-info ((this attack-info) (arg0 attack-info) (arg1 process-drawable)) +(defmethod combine! ((this attack-info) (arg0 attack-info) (arg1 process-drawable)) (let ((s4-0 (-> arg0 mask))) (set! (-> this mask) (-> arg0 mask)) (if (logtest? s4-0 (attack-mask attacker)) @@ -1852,7 +1849,7 @@ ) ) -(defmethod get-trans target ((this target) (arg0 int)) +(defmethod get-trans ((this target) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (local-vars (v0-0 vector)) (let ((v1-0 (-> this control))) @@ -1925,7 +1922,7 @@ ) ) -(defmethod time-to-apex-or-ground target ((this target) (arg0 int)) +(defmethod time-to-apex-or-ground ((this target) (arg0 int)) (let ((v1-0 (-> this control))) (cond ((zero? arg0) @@ -1949,7 +1946,7 @@ ) ) -(defmethod get-quat target ((this target) (arg0 int)) +(defmethod get-quat ((this target) (arg0 int)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -1978,10 +1975,10 @@ ) ) -(defmethod get-water-height target ((this target)) +(defmethod get-water-height ((this target)) (-> this water surface-height) ) -(defmethod get-notice-time target ((this target)) +(defmethod get-notice-time ((this target)) (-> this neck notice-time) ) diff --git a/goal_src/jak2/engine/ui/bigmap-h.gc b/goal_src/jak2/engine/ui/bigmap-h.gc index c82149ad1ee..d67899fcf4a 100644 --- a/goal_src/jak2/engine/ui/bigmap-h.gc +++ b/goal_src/jak2/engine/ui/bigmap-h.gc @@ -14,148 +14,127 @@ ;; DECOMP BEGINS (deftype bigmap-bit-mask (structure) - ((data uint8 6656 :offset-assert 0) + ((data uint8 6656) ) - :method-count-assert 9 - :size-assert #x1a00 - :flag-assert #x900001a00 ) (deftype bigmap-layer-mask (structure) - ((data uint8 26624 :offset-assert 0) + ((data uint8 26624) ) - :method-count-assert 9 - :size-assert #x6800 - :flag-assert #x900006800 ) (deftype bigmap-image (structure) - ((clut-offset uint32 :offset-assert 0) - (image-offset uint32 :offset-assert 4) - (pad uint32 2 :offset-assert 8) - (data uint8 1 :offset-assert 16) + ((clut-offset uint32) + (image-offset uint32) + (pad uint32 2) + (data uint8 1) ) - :method-count-assert 9 - :size-assert #x11 - :flag-assert #x900000011 ) (deftype bigmap-info (vector) - ((scale float :offset 8) - (inv-scale float :offset 12) + ((scale float :overlay-at (-> data 2)) + (inv-scale float :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype bigmap-info-array (structure) - ((data bigmap-info 21 :inline :offset-assert 0) + ((data bigmap-info 21 :inline) ) - :method-count-assert 9 - :size-assert #x150 - :flag-assert #x900000150 ) (deftype bigmap-compressed-layers (structure) - ((data (pointer uint32) 20 :offset-assert 0) - (layer0 (pointer uint32) :offset 0) - (layer1 (pointer uint32) :offset 4) - (layer2 (pointer uint32) :offset 8) - (layer3 (pointer uint32) :offset 12) - (layer4 (pointer uint32) :offset 16) - (layer5 (pointer uint32) :offset 20) - (layer6 (pointer uint32) :offset 24) - (layer7 (pointer uint32) :offset 28) - (layer8 (pointer uint32) :offset 32) - (layer9 (pointer uint32) :offset 36) - (layer10 (pointer uint32) :offset 40) - (layer11 (pointer uint32) :offset 44) - (layer12 (pointer uint32) :offset 48) - (layer13 (pointer uint32) :offset 52) - (layer14 (pointer uint32) :offset 56) - (layer15 (pointer uint32) :offset 60) - (layer16 (pointer uint32) :offset 64) - (layer17 (pointer uint32) :offset 68) - (layer18 (pointer uint32) :offset 72) - (layer19 (pointer uint32) :offset 76) + ((data (pointer uint32) 20) + (layer0 (pointer uint32) :overlay-at (-> data 0)) + (layer1 (pointer uint32) :overlay-at (-> data 1)) + (layer2 (pointer uint32) :overlay-at (-> data 2)) + (layer3 (pointer uint32) :overlay-at (-> data 3)) + (layer4 (pointer uint32) :overlay-at (-> data 4)) + (layer5 (pointer uint32) :overlay-at (-> data 5)) + (layer6 (pointer uint32) :overlay-at (-> data 6)) + (layer7 (pointer uint32) :overlay-at (-> data 7)) + (layer8 (pointer uint32) :overlay-at (-> data 8)) + (layer9 (pointer uint32) :overlay-at (-> data 9)) + (layer10 (pointer uint32) :overlay-at (-> data 10)) + (layer11 (pointer uint32) :overlay-at (-> data 11)) + (layer12 (pointer uint32) :overlay-at (-> data 12)) + (layer13 (pointer uint32) :overlay-at (-> data 13)) + (layer14 (pointer uint32) :overlay-at (-> data 14)) + (layer15 (pointer uint32) :overlay-at (-> data 15)) + (layer16 (pointer uint32) :overlay-at (-> data 16)) + (layer17 (pointer uint32) :overlay-at (-> data 17)) + (layer18 (pointer uint32) :overlay-at (-> data 18)) + (layer19 (pointer uint32) :overlay-at (-> data 19)) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype bigmap (basic) - ((drawing-flag symbol :offset-assert 4) - (loading-flag symbol :offset-assert 8) - (recording-flag symbol :offset-assert 12) - (fill-flag symbol :offset-assert 16) - (bigmap-index uint32 :offset-assert 20) - (bigmap-image external-art-buffer :offset-assert 24) - (tpage external-art-buffer :offset-assert 28) - (progress-minimap texture-page :offset-assert 32) - (mask-index uint32 :offset-assert 36) - (bit-mask bigmap-bit-mask :offset-assert 40) - (compressed-next-index uint32 :offset-assert 44) - (max-next-index uint32 :offset-assert 48) - (compressed-masks (pointer int8) 20 :offset-assert 52) - (compressed-data uint32 :offset-assert 132) - (layer-index uint32 :offset-assert 136) - (layer-mask bigmap-layer-mask :offset-assert 140) - (compressed-layers bigmap-compressed-layers :offset-assert 144) - (layer-mask-enable uint32 :offset-assert 148) - (load-index uint32 :offset-assert 152) - (x0 int32 :offset-assert 156) - (y0 int32 :offset-assert 160) - (x1 int32 :offset-assert 164) - (y1 int32 :offset-assert 168) - (y2 int32 :offset-assert 172) - (goal-time float :offset-assert 176) - (sprite-tmpl dma-gif-packet :inline :offset-assert 192) - (draw-tmpl dma-gif-packet :inline :offset-assert 224) - (adgif-tmpl dma-gif-packet :inline :offset-assert 256) - (offset vector :inline :offset-assert 288) - (size float :offset 296) - (scale float :offset 300) - (draw-offset vector :inline :offset-assert 304) - (draw-size float :offset 312) - (draw-scale float :offset 316) - (scroll vector :inline :offset-assert 320) - (pos vector4w :inline :offset-assert 336) - (color vector4w :inline :offset-assert 352) - (corner vector 4 :inline :offset-assert 368) - (auto-save-icon-flag symbol :offset-assert 432) + ((drawing-flag symbol) + (loading-flag symbol) + (recording-flag symbol) + (fill-flag symbol) + (bigmap-index uint32) + (bigmap-image external-art-buffer) + (tpage external-art-buffer) + (progress-minimap texture-page) + (mask-index uint32) + (bit-mask bigmap-bit-mask) + (compressed-next-index uint32) + (max-next-index uint32) + (compressed-masks (pointer int8) 20) + (compressed-data uint32) + (layer-index uint32) + (layer-mask bigmap-layer-mask) + (compressed-layers bigmap-compressed-layers) + (layer-mask-enable uint32) + (load-index uint32) + (x0 int32) + (y0 int32) + (x1 int32) + (y1 int32) + (y2 int32) + (goal-time float) + (sprite-tmpl dma-gif-packet :inline) + (draw-tmpl dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (offset vector :inline) + (size float :overlay-at (-> offset data 2)) + (scale float :overlay-at (-> offset data 3)) + (draw-offset vector :inline) + (draw-size float :overlay-at (-> draw-offset data 2)) + (draw-scale float :overlay-at (-> draw-offset data 3)) + (scroll vector :inline) + (pos vector4w :inline) + (color vector4w :inline) + (corner vector 4 :inline) + (auto-save-icon-flag symbol) ) - :method-count-assert 28 - :size-assert #x1b4 - :flag-assert #x1c000001b4 (:methods - (new (symbol type) _type_ 0) - (initialize (_type_) none 9) ;; some sort of init? - (update (_type_) none 10) - (draw (_type_ int int int int) int 11) - (handle-cpad-inputs (_type_) int 12) - (compress-all (_type_) int 13) - (enable-drawing (_type_) none 14) - (disable-drawing (_type_) int 15) - (dump-to-file (_type_) file-stream 16) - (set-pos! (_type_ vector) int 17) - (decompress-current-masks! (_type_) int 18) - (compress-current-masks! (_type_) int 19) - (set-enable-from-position! (_type_) int 20) - (maybe-fill-for-position (_type_ int int) int 21) - (texture-upload-dma (_type_ dma-buffer (pointer uint32) int int int gs-psm) none 22) - (mask-image-from-bit-mask (_type_) none 23) - (draw-non-city-map (_type_ dma-buffer) none 24) - (draw-city-map (_type_ dma-buffer) none 25) - (sprite-dma (_type_ dma-buffer int int int int) none 26) - (draw-from-minimap (_type_ dma-buffer connection-minimap) int 27) + (new (symbol type) _type_) + (initialize (_type_) none) + (update (_type_) none) + (draw (_type_ int int int int) int) + (handle-cpad-inputs (_type_) int) + (compress-all (_type_) int) + (enable-drawing (_type_) none) + (disable-drawing (_type_) int) + (dump-to-file (_type_) file-stream) + (set-pos! (_type_ vector) int) + (decompress-current-masks! (_type_) int) + (compress-current-masks! (_type_) int) + (set-enable-from-position! (_type_) int) + (maybe-fill-for-position (_type_ int int) int) + (texture-upload-dma (_type_ dma-buffer (pointer uint32) int int int gs-psm) none) + (mask-image-from-bit-mask (_type_) none) + (draw-non-city-map (_type_ dma-buffer) none) + (draw-city-map (_type_ dma-buffer) none) + (sprite-dma (_type_ dma-buffer int int int int) none) + (draw-from-minimap (_type_ dma-buffer connection-minimap) int) ) ) diff --git a/goal_src/jak2/engine/ui/bigmap.gc b/goal_src/jak2/engine/ui/bigmap.gc index 86d04e57d62..8e83be62b1f 100644 --- a/goal_src/jak2/engine/ui/bigmap.gc +++ b/goal_src/jak2/engine/ui/bigmap.gc @@ -19,7 +19,7 @@ ;; The bit-mask data can be compressed, for including it in saves. -(defmethod set-pos! bigmap ((this bigmap) (arg0 vector)) +(defmethod set-pos! ((this bigmap) (arg0 vector)) "Set (-> this pos) to the integer cell index for the given floating-point position." (rlet ((vf0 :class vf) (vf1 :class vf) @@ -41,7 +41,7 @@ ) ) -(defmethod decompress-current-masks! bigmap ((this bigmap)) +(defmethod decompress-current-masks! ((this bigmap)) "Decompress the layer set by (-> this mask-index). The decompressed result will be stored in (-> this bit-mask data). If it was never compressed, the data will be set to 0." @@ -99,7 +99,7 @@ 0 ) -(defmethod compress-current-masks! bigmap ((this bigmap)) +(defmethod compress-current-masks! ((this bigmap)) "Take the current (-> this bit-mask data), and store it in the compressed layer buffer." ;; store at the end of the buffer (let* ((compressed-data-dest (+ (-> this compressed-next-index) 0 (-> this compressed-data))) @@ -183,7 +183,7 @@ ) ) -(defmethod set-enable-from-position! bigmap ((this bigmap)) +(defmethod set-enable-from-position! ((this bigmap)) "Read the value of the layer-mask at the current position. Future calls to maybe-fill-for-position will only succeed if they correspond to a cell with the same layer-mask value @@ -199,7 +199,7 @@ 0 ) -(defmethod maybe-fill-for-position bigmap ((this bigmap) (arg0 int) (arg1 int)) +(defmethod maybe-fill-for-position ((this bigmap) (arg0 int) (arg1 int)) "Check the layer-mask for this position. If it matches the value read from set-enable-from-position, then set the bit in the bit-mask." (local-vars (v1-3 uint)) @@ -242,7 +242,7 @@ ) ) -(defmethod mask-image-from-bit-mask bigmap ((this bigmap)) +(defmethod mask-image-from-bit-mask ((this bigmap)) "Modify the image-data in place to mask out parts of the map that have not been seen." (let* ((v1-0 (the-as object (-> this bit-mask))) (a1-0 *image-mask-table*) @@ -304,7 +304,7 @@ (pc-texture-anim-flag finish-anim-array dma-buf) ) -(defmethod texture-upload-dma bigmap ((this bigmap) (arg0 dma-buffer) (arg1 (pointer uint32)) (arg2 int) (arg3 int) (arg4 int) (arg5 gs-psm)) +(defmethod texture-upload-dma ((this bigmap) (arg0 dma-buffer) (arg1 (pointer uint32)) (arg2 int) (arg3 int) (arg4 int) (arg5 gs-psm)) "Add a texture upload to the DMA buffer." (local-vars (sv-16 int)) (set! sv-16 arg2) @@ -319,7 +319,7 @@ (none) ) -(defmethod sprite-dma bigmap ((this bigmap) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int)) +(defmethod sprite-dma ((this bigmap) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int)) "Generate DMA for drawing a single sprite." (let ((v1-0 (-> arg0 base))) (set! (-> (the-as (pointer uint128) v1-0) 0) (-> this sprite-tmpl dma-vif quad)) @@ -334,7 +334,7 @@ (none) ) -(defmethod draw-non-city-map bigmap ((this bigmap) (arg0 dma-buffer)) +(defmethod draw-non-city-map ((this bigmap) (arg0 dma-buffer)) "Generate DMA to draw a non-city map using the loaded bigmap image. This appears to have 3 layers." @@ -388,7 +388,7 @@ (none) ) -(defmethod draw-city-map bigmap ((this bigmap) (arg0 dma-buffer)) +(defmethod draw-city-map ((this bigmap) (arg0 dma-buffer)) "Generate DMA to draw the city map. This has only 2 layers, but has scrolling." (let ((s4-0 (the-as (pointer uint32) (-> this bigmap-image art-group)))) @@ -434,7 +434,7 @@ (none) ) -(defmethod draw-from-minimap bigmap ((this bigmap) (arg0 dma-buffer) (arg1 connection-minimap)) +(defmethod draw-from-minimap ((this bigmap) (arg0 dma-buffer) (arg1 connection-minimap)) "Read data from a minimap connection and draw it on the bigmap." (rlet ((vf0 :class vf) (vf1 :class vf) @@ -549,7 +549,7 @@ ) ) -(defmethod initialize bigmap ((this bigmap)) +(defmethod initialize ((this bigmap)) (set! (-> this bigmap-index) (the-as uint 20)) (set-pending-file (-> this bigmap-image) (the-as string #f) 0 (process->handle *dproc*) 0.0) (set! (-> this compressed-next-index) (the-as uint 0)) @@ -564,7 +564,7 @@ (none) ) -(defmethod update bigmap ((this bigmap)) +(defmethod update ((this bigmap)) (let ((v1-1 (level-get-target-inside *level*))) (if v1-1 (set! (-> this bigmap-index) (the-as uint (-> v1-1 info bigmap-id))) @@ -683,7 +683,7 @@ (none) ) -(defmethod draw bigmap ((this bigmap) (arg0 int) (arg1 int) (arg2 int) (arg3 int)) +(defmethod draw ((this bigmap) (arg0 int) (arg1 int) (arg2 int) (arg3 int)) (local-vars (sv-96 pointer) (sv-100 texture) (sv-104 matrix) (sv-112 int)) (when (and (= (file-status (-> this bigmap-image) "world-map" (the-as int (-> this load-index))) 'active) (not (-> this loading-flag)) @@ -843,7 +843,7 @@ 0 ) -(defmethod handle-cpad-inputs bigmap ((this bigmap)) +(defmethod handle-cpad-inputs ((this bigmap)) (cond ((= (-> this bigmap-index) 20) (let* ((v1-2 (-> *cpad-list* cpads 0)) @@ -860,7 +860,7 @@ 0 ) -(defmethod compress-all bigmap ((this bigmap)) +(defmethod compress-all ((this bigmap)) (when (!= (-> this mask-index) 20) (compress-current-masks! this) (set! (-> this mask-index) (the-as uint 20)) @@ -868,7 +868,7 @@ 0 ) -(defmethod enable-drawing bigmap ((this bigmap)) +(defmethod enable-drawing ((this bigmap)) (set! (-> this bigmap-index) (the-as uint (-> (level-get-target-inside *level*) info bigmap-id))) (cond ((= (-> this bigmap-index) 20) @@ -909,7 +909,7 @@ (none) ) -(defmethod disable-drawing bigmap ((this bigmap)) +(defmethod disable-drawing ((this bigmap)) (set-pending-file (-> this bigmap-image) (the-as string #f) @@ -937,7 +937,7 @@ (define *map-save-ptr* (the-as (pointer uint64) #f)) -(defmethod dump-to-file bigmap ((this bigmap)) +(defmethod dump-to-file ((this bigmap)) (if (not *map-save-ptr*) (set! *map-save-ptr* (the-as (pointer uint64) (malloc 'debug #xd0000))) ) diff --git a/goal_src/jak2/engine/ui/gui-h.gc b/goal_src/jak2/engine/ui/gui-h.gc index 1502bcd493f..30de7131ab3 100644 --- a/goal_src/jak2/engine/ui/gui-h.gc +++ b/goal_src/jak2/engine/ui/gui-h.gc @@ -98,57 +98,51 @@ ;; DECOMP BEGINS (deftype gui-connection (connection) - ((priority float :offset 16) - (action gui-action :offset 20) - (channel gui-channel :offset 21) - (anim-part uint8 :offset 22) - (flags gui-connection-flags :offset 23) - (name string :offset 24) - (id sound-id :offset 28) - (handle handle :offset 0) - (time-stamp time-frame :offset 8) - (hold-time time-frame :offset-assert 32) - (fo-min int16 :offset-assert 40) - (fo-max int16 :offset-assert 42) - (fo-curve int8 :offset-assert 44) - (fade uint8 :offset-assert 45) - (pad uint8 2 :offset-assert 46) + ((priority float :overlay-at param0) + (action gui-action :overlay-at param1) + (channel gui-channel :offset 21) + (anim-part uint8 :offset 22) + (flags gui-connection-flags :offset 23) + (name string :overlay-at param2) + (id sound-id :overlay-at param3) + (handle handle :overlay-at next0) + (time-stamp time-frame :overlay-at next1) + (hold-time time-frame) + (fo-min int16) + (fo-max int16) + (fo-curve int8) + (fade uint8) + (pad uint8 2) ) - :method-count-assert 14 - :size-assert #x30 - :flag-assert #xe00000030 ) (deftype gui-control (basic) - ((engine engine :offset-assert 4) - (update-time time-frame :offset-assert 8) - (connections gui-connection 32 :inline :offset-assert 16) - (spool-connections gui-connection 4 :inline :offset-assert 1552) - (ids sound-id 96 :offset-assert 1744) - (times time-frame 96 :offset-assert 2128) - (cmd pair 96 :offset-assert 2896) + ((engine engine) + (update-time time-frame) + (connections gui-connection 32 :inline) + (spool-connections gui-connection 4 :inline) + (ids sound-id 96) + (times time-frame 96) + (cmd pair 96) ) - :method-count-assert 25 - :size-assert #xcd0 - :flag-assert #x1900000cd0 (:methods - (new (symbol type int) _type_ 0) - (add-process (_type_ process gui-channel gui-action string float time-frame) sound-id 9) - (remove-process (_type_ process gui-channel) none 10) - (stop-str (_type_ gui-connection) int 11) - (gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id 12) - (update (_type_ symbol) int 13) - (lookup-gui-connection-id (_type_ string gui-channel gui-action) sound-id 14) - (lookup-gui-connection (_type_ process gui-channel string sound-id) gui-connection 15) - (set-action! (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int 16) - (get-status (_type_ sound-id) gui-status 17) - (gui-control-method-18 (_type_ gui-channel) symbol 18) - (handle-command-list (_type_ gui-channel gui-connection) symbol 19) - (set-falloff! (_type_ sound-id symbol int int int) gui-connection 20) - (gui-control-method-21 (_type_ gui-connection vector) int 21) - (gui-control-method-22 (_type_ gui-connection process symbol) none 22) - (handle-command (_type_ gui-channel gui-channel symbol gui-connection) symbol 23) - (channel-id-set! (_type_ gui-connection sound-id) int 24) + (new (symbol type int) _type_) + (add-process (_type_ process gui-channel gui-action string float time-frame) sound-id) + (remove-process (_type_ process gui-channel) none) + (stop-str (_type_ gui-connection) int) + (gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id) + (update (_type_ symbol) int) + (lookup-gui-connection-id (_type_ string gui-channel gui-action) sound-id) + (lookup-gui-connection (_type_ process gui-channel string sound-id) gui-connection) + (set-action! (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int) + (get-status (_type_ sound-id) gui-status) + (gui-control-method-18 (_type_ gui-channel) symbol) + (handle-command-list (_type_ gui-channel gui-connection) symbol) + (set-falloff! (_type_ sound-id symbol int int int) gui-connection) + (gui-control-method-21 (_type_ gui-connection vector) int) + (gui-control-method-22 (_type_ gui-connection process symbol) none) + (handle-command (_type_ gui-channel gui-channel symbol gui-connection) symbol) + (channel-id-set! (_type_ gui-connection sound-id) int) ) ) diff --git a/goal_src/jak2/engine/ui/hud-classes.gc b/goal_src/jak2/engine/ui/hud-classes.gc index 52b53dd014e..7546b8a9eef 100644 --- a/goal_src/jak2/engine/ui/hud-classes.gc +++ b/goal_src/jak2/engine/ui/hud-classes.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod draw hud-map ((this hud-map)) +(defmethod draw ((this hud-map)) (set-hud-piece-position! (-> this sprites 1) (the int (+ 492.0 (* 140.0 (-> this offset)))) @@ -108,7 +108,7 @@ (none) ) -(defmethod update-values hud-map ((this hud-map)) +(defmethod update-values ((this hud-map)) (cond ((update! *minimap*) (logior! (-> this flags) (hud-flags show)) @@ -134,7 +134,7 @@ (none) ) -(defmethod init-callback hud-map ((this hud-map)) +(defmethod init-callback ((this hud-map)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-lower-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -154,7 +154,7 @@ (none) ) -(defmethod draw hud-health ((this hud-health)) +(defmethod draw ((this hud-health)) (set-hud-piece-position! (-> this sprites 8) (the int (+ (* -130.0 (-> this offset)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) @@ -252,7 +252,7 @@ (none) ) -(defmethod update-values hud-health ((this hud-health)) +(defmethod update-values ((this hud-health)) (set! (-> this values 0 target) (the int (* 10.0 (-> *target* fact health)))) (set! (-> this values 1 target) (the-as int (-> *target* fact health-pickup-time))) (set! (-> this values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) @@ -265,7 +265,7 @@ (none) ) -(defmethod init-callback hud-health ((this hud-health)) +(defmethod init-callback ((this hud-health)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-lower-left-1) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -336,7 +336,7 @@ (none) ) -(defmethod draw hud-dark-eco-symbol ((this hud-dark-eco-symbol)) +(defmethod draw ((this hud-dark-eco-symbol)) (let ((v1-0 (process-by-name "hud-health" *active-pool*)) (f30-0 (-> this offset)) ) @@ -396,7 +396,7 @@ (none) ) -(defmethod update-values hud-dark-eco-symbol ((this hud-dark-eco-symbol)) +(defmethod update-values ((this hud-dark-eco-symbol)) (set! (-> this values 0 target) (the int (* 10.0 (-> *target* fact health)))) (set! (-> this values 1 target) (the-as int (-> *target* fact health-pickup-time))) (set! (-> this values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) @@ -416,7 +416,7 @@ (none) ) -(defmethod init-callback hud-dark-eco-symbol ((this hud-dark-eco-symbol)) +(defmethod init-callback ((this hud-dark-eco-symbol)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-lower-left-2) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -429,7 +429,7 @@ (define *hud-skullgem* (the-as (pointer hud-skullgem) #f)) -(defmethod draw hud-skullgem ((this hud-skullgem)) +(defmethod draw ((this hud-skullgem)) (set-hud-piece-position! (the-as hud-sprite (-> this icons 0 pos)) (the int (+ 60.0 (* -130.0 (-> this offset)))) @@ -456,14 +456,14 @@ (none) ) -(defmethod update-values hud-skullgem ((this hud-skullgem)) +(defmethod update-values ((this hud-skullgem)) (set! (-> this values 0 target) (the int (-> *target* game gem))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-skullgem ((this hud-skullgem)) +(defmethod init-callback ((this hud-skullgem)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-center-left) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -481,7 +481,7 @@ (none) ) -(defmethod draw hud-skill ((this hud-skill)) +(defmethod draw ((this hud-skill)) (set-hud-piece-position! (the-as hud-sprite (-> this icons 0 pos)) (the int (+ 60.0 (* -130.0 (-> this offset)))) @@ -514,14 +514,14 @@ (none) ) -(defmethod update-values hud-skill ((this hud-skill)) +(defmethod update-values ((this hud-skill)) (set! (-> this values 0 target) (the int (-> *target* game skill))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-skill ((this hud-skill)) +(defmethod init-callback ((this hud-skill)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-left) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -544,7 +544,7 @@ (none) ) -(defmethod update-value-callback hud-skill ((this hud-skill) (arg0 int) (arg1 int)) +(defmethod update-value-callback ((this hud-skill) (arg0 int) (arg1 int)) (if (> arg1 0) (sound-play "skill-pickup" :pitch 0.5) ) @@ -552,7 +552,7 @@ (none) ) -(defmethod draw hud-score ((this hud-score)) +(defmethod draw ((this hud-score)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 480.0 (* 130.0 (-> this offset)))) @@ -565,14 +565,14 @@ (none) ) -(defmethod update-values hud-score ((this hud-score)) +(defmethod update-values ((this hud-score)) (set! (-> this values 0 target) (the int (-> *game-info* score))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-score ((this hud-score)) +(defmethod init-callback ((this hud-score)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-center-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -588,7 +588,7 @@ (none) ) -(defmethod draw hud-timer ((this hud-timer)) +(defmethod draw ((this hud-timer)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 264 @@ -626,7 +626,7 @@ (none) ) -(defmethod update-values hud-timer ((this hud-timer)) +(defmethod update-values ((this hud-timer)) (set! (-> this values 0 target) (/ (-> *game-info* timer) #x4650)) (set! (-> this values 1 target) (/ (mod (-> *game-info* timer) #x4650) 300)) (let ((v1-8 (abs (- (-> this values 1 target) (-> this values 2 target))))) @@ -644,7 +644,7 @@ (none) ) -(defmethod init-callback hud-timer ((this hud-timer)) +(defmethod init-callback ((this hud-timer)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -664,7 +664,7 @@ (none) ) -(defmethod draw hud-big-score ((this hud-big-score)) +(defmethod draw ((this hud-big-score)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 264 @@ -677,14 +677,14 @@ (none) ) -(defmethod update-values hud-big-score ((this hud-big-score)) +(defmethod update-values ((this hud-big-score)) (set! (-> this values 0 target) (the int (-> *game-info* score))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-big-score ((this hud-big-score)) +(defmethod init-callback ((this hud-big-score)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -701,7 +701,7 @@ (none) ) -(defmethod draw hud-goal ((this hud-goal)) +(defmethod draw ((this hud-goal)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 65.0 (* -130.0 (-> this offset)))) @@ -715,14 +715,14 @@ (none) ) -(defmethod update-values hud-goal ((this hud-goal)) +(defmethod update-values ((this hud-goal)) (set! (-> this values 0 target) (the int (-> *game-info* goal))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-goal ((this hud-goal)) +(defmethod init-callback ((this hud-goal)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -749,7 +749,7 @@ (none) ) -(defmethod draw hud-miss ((this hud-miss)) +(defmethod draw ((this hud-miss)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 448.0 (* 130.0 (-> this offset)))) @@ -770,7 +770,7 @@ (none) ) -(defmethod update-values hud-miss ((this hud-miss)) +(defmethod update-values ((this hud-miss)) (set! (-> this values 0 target) (the int (-> *game-info* miss))) (set! (-> this values 1 target) (the int (-> *game-info* miss-max))) ((method-of-type hud update-values) this) @@ -778,7 +778,7 @@ (none) ) -(defmethod init-callback hud-miss ((this hud-miss)) +(defmethod init-callback ((this hud-miss)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -798,7 +798,7 @@ (none) ) -(defmethod draw hud-progress ((this hud-progress)) +(defmethod draw ((this hud-progress)) (with-pp (let ((f0-0 (if (process-by-name "hud-timer" *active-pool*) 65.0 @@ -825,7 +825,7 @@ ) ) -(defmethod update-values hud-progress ((this hud-progress)) +(defmethod update-values ((this hud-progress)) (set! (-> this values 0 target) (the int (* 1000.0 (-> *game-info* distance)))) (logclear! (-> this flags) (hud-flags disable)) ((method-of-type hud update-values) this) @@ -833,7 +833,7 @@ (none) ) -(defmethod init-callback hud-progress ((this hud-progress)) +(defmethod init-callback ((this hud-progress)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-center-2) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -855,7 +855,7 @@ (none) ) -(defmethod draw hud-gun ((this hud-gun)) +(defmethod draw ((this hud-gun)) (local-vars (s3-0 int) (sv-16 int) (sv-32 dma-buffer)) (let ((s4-0 0) (s5-0 0) @@ -1040,7 +1040,7 @@ (none) ) -(defmethod update-values hud-gun ((this hud-gun)) +(defmethod update-values ((this hud-gun)) (cond ((focus-test? *target* gun) (set! (-> this values 0 target) (the-as int (-> *target* gun gun-type))) @@ -1059,7 +1059,7 @@ (none) ) -(defmethod init-callback hud-gun ((this hud-gun)) +(defmethod init-callback ((this hud-gun)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -1076,7 +1076,7 @@ (none) ) -(defmethod draw hud-samos-young ((this hud-samos-young)) +(defmethod draw ((this hud-samos-young)) (set-hud-piece-position! (-> this sprites 2) (the int (+ 30.0 (* -130.0 (-> this offset)))) @@ -1091,14 +1091,14 @@ (none) ) -(defmethod update-values hud-samos-young ((this hud-samos-young)) +(defmethod update-values ((this hud-samos-young)) (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-samos-young ((this hud-samos-young)) +(defmethod init-callback ((this hud-samos-young)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/goal_src/jak2/engine/ui/hud-h.gc b/goal_src/jak2/engine/ui/hud-h.gc index ead24a275ae..9680e0efa23 100644 --- a/goal_src/jak2/engine/ui/hud-h.gc +++ b/goal_src/jak2/engine/ui/hud-h.gc @@ -28,114 +28,95 @@ ;; DECOMP BEGINS (deftype hud-string (basic) - ((text string :offset-assert 4) - (scale float :offset-assert 8) - (color font-color :offset-assert 12) - (flags font-flags :offset-assert 16) - (pos int32 4 :offset 32) + ((text string) + (scale float) + (color font-color) + (flags font-flags) + (pos int32 4 :offset 32) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype hud-sprite (structure) - ((pos vector4w :inline :offset-assert 0) - (color vector4w :inline :offset-assert 16) - (color2 int32 4 :offset 16) - (flags uint32 :offset-assert 32) - (scale-x float :offset-assert 36) - (scale-y float :offset-assert 40) - (angle float :offset-assert 44) - (tex texture :offset-assert 48) + ((pos vector4w :inline) + (color vector4w :inline) + (color2 int32 4 :overlay-at (-> color data 0)) + (flags uint32) + (scale-x float) + (scale-y float) + (angle float) + (tex texture) ) - :method-count-assert 11 - :size-assert #x34 - :flag-assert #xb00000034 (:methods - (draw (_type_ dma-buffer level) none 9) - (hud-sprite-method-10 (_type_ dma-buffer level int int int int) object 10) + (draw (_type_ dma-buffer level) none) + (hud-sprite-method-10 (_type_ dma-buffer level int int int int) object) ) ) (deftype hud-box (structure) - ((min vector2 :inline :offset-assert 0) - (max vector2 :inline :offset-assert 8) - (color vector4w :inline :offset-assert 16) + ((min vector2 :inline) + (max vector2 :inline) + (color vector4w :inline) ) - :method-count-assert 16 - :size-assert #x20 - :flag-assert #x1000000020 (:methods - (draw-box-prim-only (_type_ dma-buffer) none 9) - (draw-box-alpha-1 (_type_ dma-buffer) none 10) - (draw-box-alpha-2 (_type_ dma-buffer) none 11) - (draw-box-alpha-3 (_type_ dma-buffer) none 12) - (draw-scan-and-line (_type_ dma-buffer float) int 13) - (setup-scissor (_type_ dma-buffer) none 14) - (restore-scissor (_type_ dma-buffer) none 15) + (draw-box-prim-only (_type_ dma-buffer) none) + (draw-box-alpha-1 (_type_ dma-buffer) none) + (draw-box-alpha-2 (_type_ dma-buffer) none) + (draw-box-alpha-3 (_type_ dma-buffer) none) + (draw-scan-and-line (_type_ dma-buffer float) int) + (setup-scissor (_type_ dma-buffer) none) + (restore-scissor (_type_ dma-buffer) none) ) ) (deftype hud-icon (basic) - ((icon (pointer manipy) :offset-assert 4) - (pos int32 4 :offset 16) - (scale-x float :offset-assert 32) - (scale-y float :offset-assert 36) + ((icon (pointer manipy)) + (pos int32 4 :offset 16) + (scale-x float) + (scale-y float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) (deftype hud-value (basic) - ((current int32 :offset-assert 4) - (target int32 :offset-assert 8) - (flags uint16 :offset-assert 12) - (counter uint16 :offset-assert 14) + ((current int32) + (target int32) + (flags uint16) + (counter uint16) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype hud (process) - ((trigger-time time-frame :offset-assert 128) - (last-hide-time time-frame :offset-assert 136) - (offset float :offset-assert 144) - (flags hud-flags :offset-assert 148) - (values hud-value 8 :inline :offset 148) - (strings hud-string 14 :inline :offset 284) - (sprites hud-sprite 30 :inline :offset 960) - (icons hud-icon 2 :inline :offset 2876) - (gui-id sound-id :offset 2976) + ((trigger-time time-frame) + (last-hide-time time-frame) + (offset float) + (flags hud-flags) + (values hud-value 8 :inline :overlay-at flags) + (strings hud-string 14 :inline :offset 284) + (sprites hud-sprite 30 :inline :offset 960) + (icons hud-icon 2 :inline :offset 2876) + (gui-id sound-id :offset 2976) ) - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 (:methods - (hidden? (_type_) symbol 14) - (draw (_type_) none 15) - (update-values (_type_) none 16) - (init-callback (_type_) none 17) - (event-callback (_type_ process int symbol event-message-block) symbol 18) - (hud-method-19 (_type_) none 19) - (hud-method-20 (_type_) none 20) - (hud-method-21 (_type_) none 21) - (hud-method-22 (_type_) none 22) - (hud-method-23 (_type_) none 23) - (check-ready-and-maybe-show (_type_ symbol) symbol 24) - (update-value-callback (_type_ int int) none 25) - (alloc-string-if-needed (_type_ int) none 26) + (hidden? (_type_) symbol) + (draw (_type_) none) + (update-values (_type_) none) + (init-callback (_type_) none) + (event-callback (_type_ process int symbol event-message-block) symbol) + (hud-method-19 (_type_) none) + (hud-method-20 (_type_) none) + (hud-method-21 (_type_) none) + (hud-method-22 (_type_) none) + (hud-method-23 (_type_) none) + (check-ready-and-maybe-show (_type_ symbol) symbol) + (update-value-callback (_type_ int int) none) + (alloc-string-if-needed (_type_ int) none) ) (:states hud-arriving @@ -148,431 +129,239 @@ (deftype hud-ashelin (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-cargo (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-citizen (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-cpanel (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-dig-clasp (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-gun (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-health (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-dark-eco-symbol (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-helldog (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-lurker (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-map (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-moneybag (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-pegasus (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-plasmite (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-dig-button (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-predator (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-heatmeter (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-progress (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-rocketsensor (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-ruffians (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-score (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-sig (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-skill (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-skullgem (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-timer (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-turret (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-squid (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-gunturret (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-gruntegg (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-crimsonhover (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-metalkor (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-big-score (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-goal (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-miss (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-race-timer (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-race-lap-counter (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-race-turbo-counter (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-race-position (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-race-map (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-samos-old (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-samos-young (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-lurker-button (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-widow (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-race-final-stats (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-mech-air-tank (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-homing-beacon (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-dark-eco-pickup (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) (deftype hud-green-eco-pickup (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) diff --git a/goal_src/jak2/engine/ui/minimap-h.gc b/goal_src/jak2/engine/ui/minimap-h.gc index 1a39e4a95c4..3102f265bae 100644 --- a/goal_src/jak2/engine/ui/minimap-h.gc +++ b/goal_src/jak2/engine/ui/minimap-h.gc @@ -109,132 +109,114 @@ ;; DECOMP BEGINS (deftype minimap-class-node (structure) - ((default-position vector :inline :offset-assert 0) - (flags minimap-flag :offset-assert 16) - (class minimap-class :offset-assert 18) - (name basic :offset-assert 20) - (icon-xy vector2ub :inline :offset-assert 24) - (scale float :offset-assert 28) - (color rgba :offset-assert 32) + ((default-position vector :inline) + (flags minimap-flag) + (class minimap-class) + (name basic) + (icon-xy vector2ub :inline) + (scale float) + (color rgba) ) :pack-me - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) (deftype connection-minimap (connection-pers) - ((handle handle :offset 8) - (position object :offset 16) - (alpha float :offset 20) - (class minimap-class-node :offset 24) - (flags minimap-flag :offset 28) - (node uint16 :offset 30) - (edge-ry float :offset-assert 32) - (last-world-pos vector :inline :offset-assert 48) - (last-relative-pos vector :inline :offset-assert 64) + ((handle handle :overlay-at update-time) + (position object :overlay-at param-quat) + (alpha float :overlay-at (-> param-float 1)) + (class minimap-class-node :overlay-at (-> param-float 2)) + (flags minimap-flag :overlay-at (-> param 3)) + (node uint16 :offset 30) + (edge-ry float) + (last-world-pos vector :inline) + (last-relative-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype engine-minimap (engine-pers) - ((alive-list connection-minimap :override) - (dead-list connection-minimap :override) + ((alive-list connection-minimap :override) + (dead-list connection-minimap :override) ) - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 ) (deftype minimap-trail (structure) - ((used-by connection-minimap :offset-assert 0) - (search-id uint32 :offset-assert 4) - (node-count int16 :offset-assert 8) - (goal-node-id int32 :offset-assert 12) - (node-path-dist float :offset-assert 16) - (last-updated uint64 :offset-assert 24) - (cached-info trail-cached-search-info :inline :offset-assert 32) - (node-id uint16 64 :offset-assert 80) + ((used-by connection-minimap) + (search-id uint32) + (node-count int16) + (goal-node-id int32) + (node-path-dist float) + (last-updated uint64) + (cached-info trail-cached-search-info :inline) + (node-id uint16 64) ) - :method-count-assert 11 - :size-assert #xd0 - :flag-assert #xb000000d0 (:methods - (get-distance-with-path (_type_ vector vector) float 9) - (reset (_type_) none 10) + (get-distance-with-path (_type_ vector vector) float) + (reset (_type_) none) ) ) (deftype minimap-draw-work (structure) - ((buf dma-buffer :offset-assert 0) - (justify-right symbol :offset-assert 4) - (draw-pos vector4w :inline :offset-assert 16) - (mat matrix :inline :offset-assert 32) - (corner vector 4 :inline :offset-assert 96) + ((buf dma-buffer) + (justify-right symbol) + (draw-pos vector4w :inline) + (mat matrix :inline) + (corner vector 4 :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) (deftype minimap (structure) - ((draw-tmpl dma-gif-packet :inline :offset-assert 0) - (draw2-tmpl dma-gif-packet :inline :offset-assert 32) - (draw3-tmpl dma-gif-packet :inline :offset-assert 64) - (draw4-tmpl dma-gif-packet :inline :offset-assert 96) - (sprite-tmpl dma-gif-packet :inline :offset-assert 128) - (adgif-tmpl dma-gif-packet :inline :offset-assert 160) - (color vector4w :inline :offset-assert 192) - (offset vector :inline :offset-assert 208) - (minimap-corner vector :inline :offset-assert 224) - (last-name string :offset-assert 240) - (last-tex basic :offset-assert 244) - (target-inv-scale float :offset-assert 248) - (map-bits uint64 :offset-assert 256) - (level level :offset-assert 264) - (ctywide level :offset-assert 268) - (inv-scale float :offset 212) - (fade float :offset 220) - (engine engine-minimap :offset-assert 272) - (engine-key uint32 :offset-assert 276) - (trail minimap-trail 6 :inline :offset-assert 288) - (race-tex texture :offset-assert 1536) - (race-scale float :offset-assert 1540) - (race-level level :offset-assert 1544) - (sprite2-tmpl dma-gif-packet :inline :offset-assert 1552) - (race-corner vector :inline :offset-assert 1584) - (goal-time float :offset-assert 1600) - (frustum-alpha float :offset-assert 1604) + ((draw-tmpl dma-gif-packet :inline) + (draw2-tmpl dma-gif-packet :inline) + (draw3-tmpl dma-gif-packet :inline) + (draw4-tmpl dma-gif-packet :inline) + (sprite-tmpl dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (color vector4w :inline) + (offset vector :inline) + (minimap-corner vector :inline) + (last-name string) + (last-tex basic) + (target-inv-scale float) + (map-bits uint64) + (level level) + (ctywide level) + (inv-scale float :overlay-at (-> offset data 1)) + (fade float :overlay-at (-> offset data 3)) + (engine engine-minimap) + (engine-key uint32) + (trail minimap-trail 6 :inline) + (race-tex texture) + (race-scale float) + (race-level level) + (sprite2-tmpl dma-gif-packet :inline) + (race-corner vector :inline) + (goal-time float) + (frustum-alpha float) ) - :method-count-assert 28 - :size-assert #x648 - :flag-assert #x1c00000648 (:methods - (debug-draw (_type_) none 9) - (get-trail-for-connection (_type_ connection-minimap symbol) minimap-trail 10) - (get-icon-draw-pos (_type_ connection-minimap minimap-trail vector float vector) symbol 11) - (add-icon! (_type_ process uint int vector int) connection-minimap 12) - (free-trail-by-connection (_type_ connection-minimap) none 13) - (update-trails (_type_) none 14) - (draw-1 (_type_ dma-buffer vector4w symbol) none 15) - (draw-connection (_type_ minimap-draw-work connection-minimap) none 16) - (draw-frustum-1 (_type_ minimap-draw-work connection-minimap) none 17) - (draw-frustum-2 (_type_ minimap-draw-work connection-minimap) none 18) - (sub-draw-1-2 (_type_ minimap-draw-work) none 19) - (update! (_type_) symbol 20) - (sub-draw-1-1 (_type_ minimap-draw-work) none 21) - (set-color (_type_ vector) none 22) - (draw-racer-2 (_type_ minimap-draw-work connection-minimap) none 23) - (draw-sprite2 (_type_ dma-buffer vector4w symbol) none 24) - (set-race-texture (_type_ texture float level) none 25) - (draw-racer-1 (_type_ minimap-draw-work connection-minimap float float float) none 26) - (set-race-corner (_type_ float float) none 27) + (debug-draw (_type_) none) + (get-trail-for-connection (_type_ connection-minimap symbol) minimap-trail) + (get-icon-draw-pos (_type_ connection-minimap minimap-trail vector float vector) symbol) + (add-icon! (_type_ process uint int vector int) connection-minimap) + (free-trail-by-connection (_type_ connection-minimap) none) + (update-trails (_type_) none) + (draw-1 (_type_ dma-buffer vector4w symbol) none) + (draw-connection (_type_ minimap-draw-work connection-minimap) none) + (draw-frustum-1 (_type_ minimap-draw-work connection-minimap) none) + (draw-frustum-2 (_type_ minimap-draw-work connection-minimap) none) + (sub-draw-1-2 (_type_ minimap-draw-work) none) + (update! (_type_) symbol) + (sub-draw-1-1 (_type_ minimap-draw-work) none) + (set-color (_type_ vector) none) + (draw-racer-2 (_type_ minimap-draw-work connection-minimap) none) + (draw-sprite2 (_type_ dma-buffer vector4w symbol) none) + (set-race-texture (_type_ texture float level) none) + (draw-racer-1 (_type_ minimap-draw-work connection-minimap float float float) none) + (set-race-corner (_type_ float float) none) ) ) diff --git a/goal_src/jak2/engine/ui/minimap.gc b/goal_src/jak2/engine/ui/minimap.gc index 907a4b44f1c..0740391d12c 100644 --- a/goal_src/jak2/engine/ui/minimap.gc +++ b/goal_src/jak2/engine/ui/minimap.gc @@ -11,20 +11,14 @@ ;; DECOMP BEGINS (deftype minimap-texture-name-array (structure) - ((data string 35 :offset-assert 0) + ((data string 35) ) - :method-count-assert 9 - :size-assert #x8c - :flag-assert #x90000008c ) (deftype minimap-corner-array (structure) - ((data vector 35 :inline :offset-assert 0) + ((data vector 35 :inline) ) - :method-count-assert 9 - :size-assert #x230 - :flag-assert #x900000230 ) @@ -847,13 +841,13 @@ ) ) -(defmethod debug-draw minimap ((this minimap)) +(defmethod debug-draw ((this minimap)) (when *trail-graph* (dotimes (s5-0 6) (let ((s4-0 (-> this trail s5-0))) (when (and (-> s4-0 used-by) (>= (-> s4-0 node-count) 0) - (< (- (current-time) (the-as int (-> s4-0 last-updated))) (seconds 5)) + (not (time-elapsed? (the-as int (-> s4-0 last-updated)) (seconds 5))) ) (let* ((a3-0 (target-pos 0)) (v1-12 s5-0) @@ -895,7 +889,7 @@ ) ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod update-trails minimap ((this minimap)) +(defmethod update-trails ((this minimap)) "Main function to do trail search per-frame" (let ((s5-0 *trail-graph*)) (when s5-0 @@ -1007,7 +1001,7 @@ (none) ) -(defmethod get-trail-for-connection minimap ((this minimap) (arg0 connection-minimap) (arg1 symbol)) +(defmethod get-trail-for-connection ((this minimap) (arg0 connection-minimap) (arg1 symbol)) "Get a trail for connection. If arg1 is set, allow allocating a new one." (local-vars (gp-0 minimap-trail)) (countdown (v1-0 6) @@ -1038,7 +1032,7 @@ ) ;; WARN: Function (method 13 minimap) has a return type of none, but the expression builder found a return statement. -(defmethod free-trail-by-connection minimap ((this minimap) (arg0 connection-minimap)) +(defmethod free-trail-by-connection ((this minimap) (arg0 connection-minimap)) "Free the trail associated with this connection." (countdown (v1-0 6) (let ((a2-3 (-> this trail v1-0))) @@ -1053,7 +1047,7 @@ (none) ) -(defmethod reset minimap-trail ((this minimap-trail)) +(defmethod reset ((this minimap-trail)) (set! (-> this node-count) -1) (set! (-> this search-id) (the-as uint 0)) (set! (-> this last-updated) (the-as uint 0)) @@ -1061,7 +1055,7 @@ (none) ) -(defmethod get-icon-draw-pos minimap ((this minimap) (arg0 connection-minimap) (arg1 minimap-trail) (arg2 vector) (arg3 float) (arg4 vector)) +(defmethod get-icon-draw-pos ((this minimap) (arg0 connection-minimap) (arg1 minimap-trail) (arg2 vector) (arg3 float) (arg4 vector)) "Follow the path from the start until it reaches the border of the map, then get this position." (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 4))) (vector-reset! (-> s5-0 2)) @@ -1103,7 +1097,7 @@ #f ) -(defmethod get-distance-with-path minimap-trail ((this minimap-trail) (arg0 vector) (arg1 vector)) +(defmethod get-distance-with-path ((this minimap-trail) (arg0 vector) (arg1 vector)) "Assuming we go from a to b, using this path in the middle, how long is it?" 0.0 (let ((s4-0 *trail-graph*)) @@ -1126,7 +1120,7 @@ ) ) -(defmethod print connection-minimap ((this connection-minimap)) +(defmethod print ((this connection-minimap)) (format #t "#" @@ -1139,7 +1133,7 @@ ) -(defmethod run-pending-updates! engine-minimap ((this engine-minimap) (arg0 time-frame)) +(defmethod run-pending-updates! ((this engine-minimap) (arg0 time-frame)) (let ((s2-0 (the-as (pointer connection-pers) (&-> this alive-list))) (s3-0 (-> this alive-list)) ) @@ -1161,7 +1155,7 @@ (let ((f30-0 1.0)) (when (logtest? (-> s3-0 class flags) (minimap-flag trail)) (let ((v1-26 (get-trail-for-connection *minimap* s3-0 #f))) - (if (or (not v1-26) (>= (- (current-time) (the-as int (-> v1-26 last-updated))) (seconds 5))) + (if (or (not v1-26) (time-elapsed? (the-as int (-> v1-26 last-updated)) (seconds 5))) (set! f30-0 0.0001) ) ) @@ -1209,7 +1203,7 @@ (none) ) -(defmethod add-icon! minimap ((this minimap) (arg0 process) (arg1 uint) (arg2 int) (arg3 vector) (arg4 int)) +(defmethod add-icon! ((this minimap) (arg0 process) (arg1 uint) (arg2 int) (arg3 vector) (arg4 int)) "Add an icon to the map!" (when (not arg2) (let ((v1-3 (+ (-> *minimap* engine-key) 1))) @@ -1247,7 +1241,7 @@ ) ;; WARN: Function (method 10 engine-minimap) has a return type of none, but the expression builder found a return statement. -(defmethod kill-callback engine-minimap ((this engine-minimap) (arg0 connection-pers)) +(defmethod kill-callback ((this engine-minimap) (arg0 connection-pers)) (if (not arg0) (return #f) ) @@ -1285,7 +1279,7 @@ (the-as texture #f) ) -(defmethod update! minimap ((this minimap)) +(defmethod update! ((this minimap)) (set! (-> this ctywide) (level-get *level* 'ctywide)) (set! (-> this map-bits) (the-as uint 0)) (dotimes (v1-2 (-> *level* length)) @@ -1365,7 +1359,7 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-racer-2 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-racer-2 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (local-vars (sv-16 process) (sv-20 dma-buffer) @@ -1484,7 +1478,7 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-racer-1 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap) (arg2 float) (arg3 float) (arg4 float)) +(defmethod draw-racer-1 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap) (arg2 float) (arg3 float) (arg4 float)) (local-vars (sv-16 process) (sv-20 float) @@ -1607,7 +1601,7 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-frustum-1 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-frustum-1 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (local-vars (sv-16 process) (sv-20 dma-buffer) @@ -1762,7 +1756,7 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-frustum-2 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-frustum-2 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (local-vars (sv-16 process) (sv-20 dma-buffer) @@ -1894,7 +1888,7 @@ (none) ) -(defmethod sub-draw-1-1 minimap ((this minimap) (arg0 minimap-draw-work)) +(defmethod sub-draw-1-1 ((this minimap) (arg0 minimap-draw-work)) (let ((s5-0 (-> arg0 buf))) (set-display-gs-state s5-0 (the-as int (-> *map-texture-base* vram-page)) 128 128 0 0) (let ((s3-0 (-> s5-0 base))) @@ -2057,7 +2051,7 @@ (none) ) -(defmethod sub-draw-1-2 minimap ((this minimap) (arg0 minimap-draw-work)) +(defmethod sub-draw-1-2 ((this minimap) (arg0 minimap-draw-work)) (local-vars (a3-4 int) (t0-4 int) (sv-48 vector) (sv-52 matrix) (sv-56 vector)) (let ((s5-0 (-> arg0 buf))) (reset-display-gs-state *display* s5-0) @@ -2254,7 +2248,7 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-connection minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-connection ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (let ((s1-0 (target-pos 0))) (cond ((= (-> arg1 position) #t) @@ -2337,7 +2331,7 @@ (set! s2-0 #t) (set! (-> arg1 edge-ry) -131072.0) ) - ((>= (- (current-time) (the-as int (-> a2-2 last-updated))) (seconds 5)) + ((time-elapsed? (the-as int (-> a2-2 last-updated)) (seconds 5)) (set! s2-0 #t) (set! (-> arg1 edge-ry) -131072.0) ) @@ -2515,7 +2509,7 @@ (none) ) -(defmethod draw-1 minimap ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) +(defmethod draw-1 ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) (local-vars (v1-19 uint128)) (when (= (level-status *level* 'ctywide) 'active) (let ((s5-1 (new 'stack-no-clear 'minimap-draw-work))) @@ -2564,7 +2558,7 @@ (none) ) -(defmethod draw-sprite2 minimap ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) +(defmethod draw-sprite2 ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) (local-vars (v1-24 uint128) (a0-8 uint128) (a3-5 int) (t0-4 int)) (when (-> this race-tex) (let ((s5-0 (new 'stack-no-clear 'minimap-draw-work))) @@ -2676,7 +2670,7 @@ (none) ) -(defmethod set-race-texture minimap ((this minimap) (arg0 texture) (arg1 float) (arg2 level)) +(defmethod set-race-texture ((this minimap) (arg0 texture) (arg1 float) (arg2 level)) (set! (-> this race-tex) arg0) (set! (-> this race-scale) arg1) (set! (-> this race-level) arg2) @@ -2684,14 +2678,14 @@ (none) ) -(defmethod set-race-corner minimap ((this minimap) (arg0 float) (arg1 float)) +(defmethod set-race-corner ((this minimap) (arg0 float) (arg1 float)) (set! (-> this race-corner x) arg0) (set! (-> this race-corner z) arg1) 0 (none) ) -(defmethod set-color minimap ((this minimap) (arg0 vector)) +(defmethod set-color ((this minimap) (arg0 vector)) (set! (-> this color quad) (-> arg0 quad)) 0 (none) diff --git a/goal_src/jak2/engine/ui/progress/progress-draw.gc b/goal_src/jak2/engine/ui/progress/progress-draw.gc index 5ab24074983..f779fdf0d20 100644 --- a/goal_src/jak2/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak2/engine/ui/progress/progress-draw.gc @@ -627,12 +627,12 @@ (the-as pointer 0) ) -(defmethod draw-option menu-option ((this menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) 0 (none) ) -(defmethod draw-option menu-on-off-option ((this menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-8 string) (sv-16 string)) (let ((s3-0 (if arg3 (&-> *progress-state* on-off-choice) @@ -696,7 +696,7 @@ (none) ) -(defmethod draw-option menu-yes-no-option ((this menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-8 string)) (let ((s3-0 (&-> *progress-state* yes-no-choice))) (set! a0-8 @@ -742,7 +742,7 @@ (none) ) -(defmethod draw-option menu-video-mode-option ((this menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((s3-0 (&-> *progress-state* video-mode-choice)) (f28-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) (f30-0 (-> arg1 origin y)) @@ -852,7 +852,7 @@ (none) ) -(defmethod draw-option menu-unlocked-menu-option ((this menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((s5-0 (memcard-unlocked-secrets? #t)) (f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) ) @@ -1033,7 +1033,7 @@ (none) ) -(defmethod draw-option menu-main-menu-option ((this menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (-> arg1 flags) (when (and (= (-> arg0 menu-transition) 0.0) (and (= (-> arg0 ring-angle) (-> arg0 ring-want-angle)) (nonzero? (-> this name)) @@ -1949,7 +1949,7 @@ ) ) -(defmethod draw-option menu-memcard-slot-option ((this menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (v0-74 pointer) (sv-16 float) @@ -2385,7 +2385,7 @@ (none) ) -(defmethod draw-option menu-loading-option ((this menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-3 arg1)) @@ -2440,7 +2440,7 @@ (none) ) -(defmethod draw-option menu-insufficient-space-option ((this menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (when (!= (-> arg0 current) 'none) (let ((v1-3 arg1)) @@ -2531,7 +2531,7 @@ (none) ) -(defmethod draw-option menu-secrets-insufficient-space-option ((this menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2576,7 +2576,7 @@ (none) ) -(defmethod draw-option menu-insert-card-option ((this menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2622,7 +2622,7 @@ (none) ) -(defmethod draw-option menu-error-loading-option ((this menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2689,7 +2689,7 @@ (none) ) -(defmethod draw-option menu-error-auto-saving-option ((this menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2764,7 +2764,7 @@ (none) ) -(defmethod draw-option menu-card-removed-option ((this menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2825,7 +2825,7 @@ (none) ) -(defmethod draw-option menu-error-disc-removed-option ((this menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -2883,7 +2883,7 @@ (none) ) -(defmethod draw-option menu-error-reading-option ((this menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -2939,7 +2939,7 @@ (none) ) -(defmethod draw-option menu-icon-info-option ((this menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3013,7 +3013,7 @@ (none) ) -(defmethod draw-option menu-format-card-option ((this menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.5) @@ -3056,7 +3056,7 @@ (none) ) -(defmethod draw-option menu-already-exists-option ((this menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.5) @@ -3093,7 +3093,7 @@ (none) ) -(defmethod draw-option menu-create-game-option ((this menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.5) @@ -3127,7 +3127,7 @@ (none) ) -(defmethod draw-option menu-video-mode-warning-option ((this menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.5) @@ -3182,7 +3182,7 @@ (none) ) -(defmethod draw-option menu-video-mode-ok-option ((this menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.5) @@ -3219,7 +3219,7 @@ (none) ) -(defmethod draw-option menu-progressive-mode-warning-option ((this menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.5) @@ -3274,7 +3274,7 @@ (none) ) -(defmethod draw-option menu-progressive-mode-ok-option ((this menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.55) @@ -3311,7 +3311,7 @@ (none) ) -(defmethod draw-option menu-quit-option ((this menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.55) @@ -3341,7 +3341,7 @@ (defglobalconstant COMPACT_SELECT_START #f) ;; WARN: disable def twice: 147. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod draw-option menu-select-start-option ((this menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-48 int) (sv-64 int) @@ -3483,7 +3483,7 @@ (none) ) -(defmethod draw-option menu-select-scene-option ((this menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-48 int)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) (s4-0 (-> this task-index)) @@ -3580,7 +3580,7 @@ (none) ) -(defmethod draw-option menu-bigmap-option ((this menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) 0 (none) ) @@ -3721,7 +3721,7 @@ ) ) -(defmethod draw-option menu-missions-option ((this menu-missions-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-missions-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (f0-50 float) (sv-16 float) @@ -4116,7 +4116,7 @@ (none) ) -(defmethod draw-option menu-secret-option ((this menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-16 float) (sv-20 symbol) @@ -4341,15 +4341,15 @@ ) (deftype print-highscore-obj (basic) - ((self menu-highscores-option :offset-assert 4) - (index int32 :offset-assert 8) - (previous symbol :offset-assert 12) ; guess - (place int32 :offset-assert 16) - (score float :offset-assert 20) - (game-score symbol :offset-assert 24) - (context font-context :offset-assert 28) - (local-scale float :offset-assert 32) - (interp float :offset-assert 36) + ((self menu-highscores-option) + (index int32) + (previous symbol) ; guess + (place int32) + (score float) + (game-score symbol) + (context font-context) + (local-scale float) + (interp float) ) :method-count-assert 9 :size-assert #x28 @@ -5153,7 +5153,7 @@ ) ) -(defmethod draw-option menu-highscores-option ((this menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-96 float) (sv-100 float) @@ -5456,7 +5456,7 @@ (none) ) -(defmethod draw-option menu-on-off-game-vibrations-option ((this menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-10 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -5544,7 +5544,7 @@ (none) ) -(defmethod draw-option menu-on-off-game-subtitles-option ((this menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-11 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -5632,7 +5632,7 @@ (none) ) -(defmethod draw-option menu-subtitle-language-game-option ((this menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (with-pp (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (let ((v1-2 arg1)) @@ -5765,12 +5765,12 @@ ) ) -(defmethod draw-option menu-language-game-option ((this menu-language-game-option) - (progress progress) - (font-ctx font-context) - (option-index int) - (selected symbol) - ) +(defmethod draw-option ((this menu-language-game-option) + (progress progress) + (font-ctx font-context) + (option-index int) + (selected symbol) + ) (with-pp (let ((alpha (* 2.0 (- 0.5 (-> progress menu-transition))))) (let ((font-ctx-1 font-ctx)) @@ -5917,7 +5917,7 @@ ) ) -(defmethod draw-option menu-sub-menu-game-option ((this menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) 395.0 (-> arg1 origin y) @@ -5938,7 +5938,7 @@ (none) ) -(defmethod draw-option menu-aspect-ratio-option ((this menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-12 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -6043,12 +6043,12 @@ (none) ) -(defmethod draw-option menu-on-off-progressive-scan-graphic-option ((this menu-on-off-progressive-scan-graphic-option) - (arg0 progress) - (arg1 font-context) - (arg2 int) - (arg3 symbol) - ) +(defmethod draw-option ((this menu-on-off-progressive-scan-graphic-option) + (arg0 progress) + (arg1 font-context) + (arg2 int) + (arg3 symbol) + ) (local-vars (a0-11 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -6149,7 +6149,7 @@ (none) ) -(defmethod draw-option menu-center-screen-graphic-option ((this menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) (set! f30-0 0.0) @@ -6254,7 +6254,7 @@ (none) ) -(defmethod draw-option menu-restart-mission-qr-option ((this menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-11 string)) (let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f0-1 0.0) @@ -6317,7 +6317,7 @@ (none) ) -(defmethod draw-option menu-quit-qr-option ((this menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-12 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -6391,7 +6391,7 @@ (none) ) -(defmethod draw-option menu-slider-option ((this menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (v0-42 pointer) (sv-16 progress) @@ -6767,7 +6767,7 @@ (none) ) -(defmethod draw-option menu-stereo-mode-sound-option ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (s5-0 int)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (let ((v1-2 arg1)) @@ -6876,7 +6876,7 @@ ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 361] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 417] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 435] -(defmethod draw-option menu-sub-menu-option ((this menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-16 dma-buffer)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) (s2-0 (the int (+ -1.0 (-> arg1 origin y)))) diff --git a/goal_src/jak2/engine/ui/progress/progress-h.gc b/goal_src/jak2/engine/ui/progress/progress-h.gc index 81ba178c5ad..ad814f413de 100644 --- a/goal_src/jak2/engine/ui/progress/progress-h.gc +++ b/goal_src/jak2/engine/ui/progress/progress-h.gc @@ -24,555 +24,391 @@ ;; DECOMP BEGINS (deftype progress (process-drawable) - ((current-options menu-option-list :offset-assert 200) - (menu-transition float :offset-assert 204) - (option-index int32 :offset-assert 208) - (want-option-index int32 :offset-assert 212) - (next-option-index int32 :offset-assert 216) - (graphic-index int32 :offset-assert 220) - (selected-option symbol :offset-assert 224) - (current symbol :offset-assert 228) - (next symbol :offset-assert 232) - (ring-angle float :offset-assert 236) - (ring-want-angle float :offset-assert 240) - (init-quat quaternion :inline :offset-assert 256) - (pos-transition float :offset-assert 272) - (anim-frame float :offset-assert 276) - (swing float :offset-assert 280) - (main-menu symbol :offset-assert 284) - (state-stack symbol 5 :offset-assert 288) - (option-index-stack int32 5 :offset-assert 308) - (state-pos int32 :offset-assert 328) - (secret-buying basic :offset-assert 332) - (secret-buy-choice basic :offset-assert 336) - (sliding float :offset-assert 340) - (sliding-off float :offset-assert 344) - (scanlines-alpha float :offset-assert 348) - (sliding-height float :offset-assert 352) + ((current-options menu-option-list) + (menu-transition float) + (option-index int32) + (want-option-index int32) + (next-option-index int32) + (graphic-index int32) + (selected-option symbol) + (current symbol) + (next symbol) + (ring-angle float) + (ring-want-angle float) + (init-quat quaternion :inline) + (pos-transition float) + (anim-frame float) + (swing float) + (main-menu symbol) + (state-stack symbol 5) + (option-index-stack int32 5) + (state-pos int32) + (secret-buying basic) + (secret-buy-choice basic) + (sliding float) + (sliding-off float) + (scanlines-alpha float) + (sliding-height float) ) - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x164 - :flag-assert #x2100f00164 + (:state-methods + come-in + idle + go-away + gone + ) (:methods - (come-in () _type_ :state 20) - (idle () _type_ :state 21) - (go-away () _type_ :state 22) - (gone () _type_ :state 23) - (init-defaults (_type_) object 24) - (respond-to-cpad (_type_) none 25) - (gone? (_type_) object 26) - (can-go-back? (_type_) symbol 27) - (get-state-check-card (_type_ symbol) symbol 28) - (push-state (_type_) int 29) - (pop-state (_type_) int 30) - (set-next-state (_type_ symbol int) int 31) - (set-menu-options (_type_ symbol) int 32) + (init-defaults (_type_) object) + (respond-to-cpad (_type_) none) + (gone? (_type_) object) + (can-go-back? (_type_) symbol) + (get-state-check-card (_type_ symbol) symbol) + (push-state (_type_) int) + (pop-state (_type_) int) + (set-next-state (_type_ symbol int) int) + (set-menu-options (_type_ symbol) int) ) ) (deftype menu-option (basic) - ((name text-id :offset-assert 4) - (scale symbol :offset-assert 8) - (unknown function :offset-assert 12) - (box hud-box 1 :inline :offset-assert 16) - (options menu-option 8 :offset 16) + ((name text-id) + (scale symbol) + (unknown function) + (box hud-box 1 :inline) + (options menu-option 8 :overlay-at box) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 (:methods - (respond-progress (_type_ progress symbol) int :behavior progress 9) - (draw-option (_type_ progress font-context int symbol) none 10) - (menu-option-method-11 () none 11) + (respond-progress (_type_ progress symbol) int :behavior progress) + (draw-option (_type_ progress font-context int symbol) none) + (menu-option-method-11 () none) ) ) (deftype menu-on-off-option (menu-option) - ((value-to-modify (pointer symbol) :offset-assert 48) + ((value-to-modify (pointer symbol)) ) - :method-count-assert 12 - :size-assert #x34 - :flag-assert #xc00000034 ) (deftype menu-yes-no-option (menu-option) - ((value-to-modify pointer :offset-assert 48) + ((value-to-modify pointer) ) - :method-count-assert 12 - :size-assert #x34 - :flag-assert #xc00000034 ) (deftype menu-language-option (menu-option) - ((language-selection language-enum :offset-assert 48) - (language-direction symbol :offset-assert 56) - (language-transition basic :offset-assert 60) - (language-x-offset int32 :offset-assert 64) + ((language-selection language-enum) + (language-direction symbol) + (language-transition basic) + (language-x-offset int32) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 ) (deftype menu-quit-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-slider-option (menu-option) - ((value-to-modify pointer :offset-assert 48) - (sprites hud-sprite 5 :inline :offset 64) + ((value-to-modify pointer) + (sprites hud-sprite 5 :inline :offset 64) ) - :method-count-assert 12 - :size-assert #x180 - :flag-assert #xc00000180 ) (deftype menu-sub-menu-option (menu-option) - ((next-state symbol :offset-assert 48) - (pad uint8 44 :offset-assert 52) + ((next-state symbol) + (pad uint8 44) ) - :method-count-assert 12 - :size-assert #x60 - :flag-assert #xc00000060 ) (deftype menu-sub-menu-sound-option (menu-option) - ((next-state symbol :offset-assert 48) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x34 - :flag-assert #xc00000034 ) (deftype menu-stereo-mode-sound-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-sub-menu-graphic-option (menu-option) - ((next-state symbol :offset-assert 48) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x34 - :flag-assert #xc00000034 ) (deftype menu-unlocked-menu-option (menu-sub-menu-option) () - :method-count-assert 12 - :size-assert #x60 - :flag-assert #xc00000060 ) (deftype menu-main-menu-option (menu-option) - ((next-state symbol :offset-assert 48) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x34 - :flag-assert #xc00000034 ) (deftype menu-memcard-slot-option (menu-option) - ((sprites hud-sprite 5 :inline :offset 48) - (pad uint8 32 :offset-assert 368) + ((sprites hud-sprite 5 :inline :offset 48) + (pad uint8 32) ) - :method-count-assert 12 - :size-assert #x190 - :flag-assert #xc00000190 ) (deftype menu-loading-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-insufficient-space-option (menu-option) - ((last-move time-frame :offset-assert 48) + ((last-move time-frame) ) - :method-count-assert 12 - :size-assert #x38 - :flag-assert #xc00000038 ) (deftype menu-secrets-insufficient-space-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-insert-card-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-error-loading-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-error-auto-saving-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-card-removed-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-error-disc-removed-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-error-reading-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-icon-info-option (menu-option) - ((sprites hud-sprite 2 :inline :offset 48) + ((sprites hud-sprite 2 :inline :offset 48) ) - :method-count-assert 12 - :size-assert #xb0 - :flag-assert #xc000000b0 ) (deftype menu-format-card-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-already-exists-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-create-game-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-video-mode-warning-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-video-mode-ok-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-progressive-mode-warning-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-progressive-mode-ok-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype menu-select-start-option (menu-option) - ((task-index int32 :offset-assert 48) - (real-task-index int32 :offset-assert 52) - (last-move time-frame :offset-assert 56) + ((task-index int32) + (real-task-index int32) + (last-move time-frame) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) (deftype menu-select-scene-option (menu-option) - ((task-index int32 :offset-assert 48) - (last-move time-frame :offset-assert 56) + ((task-index int32) + (last-move time-frame) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) (deftype menu-bigmap-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype paged-menu-option (menu-option) - ((page-index int32 :offset-assert 48) - (prev-page-index int32 :offset-assert 52) - (num-pages int32 :offset-assert 56) - (slide-dir float :offset-assert 60) + ((page-index int32) + (prev-page-index int32) + (num-pages int32) + (slide-dir float) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) (deftype menu-missions-option (paged-menu-option) - ((task-line-index int32 :offset-assert 64) - (last-move time-frame :offset-assert 72) + ((task-line-index int32) + (last-move time-frame) ) - :method-count-assert 12 - :size-assert #x50 - :flag-assert #xc00000050 ) (deftype menu-highscores-option (paged-menu-option) - ((last-move time-frame :offset-assert 64) - (sprites hud-sprite 2 :inline :offset 80) + ((last-move time-frame) + (sprites hud-sprite 2 :inline :offset 80) ) - :method-count-assert 12 - :size-assert #xd0 - :flag-assert #xc000000d0 ) (deftype secret-item-option (menu-option) - ((cost int32 :offset-assert 48) - (can-toggle symbol :offset-assert 52) - (flag game-secrets :offset-assert 56) - (avail-after game-task-node :offset-assert 60) + ((cost int32) + (can-toggle symbol) + (flag game-secrets) + (avail-after game-task-node) ) - :method-count-assert 12 - :size-assert #x3e - :flag-assert #xc0000003e ) (deftype menu-secret-option (menu-option) - ((item-index int32 :offset-assert 48) - (prev-item-index int32 :offset-assert 52) - (num-items int32 :offset-assert 56) - (num-hero-items int32 :offset-assert 60) - (secret-items (array secret-item-option) :offset-assert 64) - (last-move time-frame :offset-assert 72) - (sprites hud-sprite 2 :inline :offset 80) + ((item-index int32) + (prev-item-index int32) + (num-items int32) + (num-hero-items int32) + (secret-items (array secret-item-option)) + (last-move time-frame) + (sprites hud-sprite 2 :inline :offset 80) ) - :method-count-assert 12 - :size-assert #xd0 - :flag-assert #xc000000d0 ) (deftype menu-option-list (basic) - ((y-center int32 :offset-assert 4) - (y-space int32 :offset-assert 8) - (scale float :offset-assert 12) - (options (array menu-option) :offset-assert 16) + ((y-center int32) + (y-space int32) + (scale float) + (options (array menu-option)) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype menu-qr-option (menu-option) - ((last-move time-frame :offset-assert 48) - (value-to-modify function :offset 60) + ((last-move time-frame) + (value-to-modify function :offset 60) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) (deftype menu-restart-mission-qr-option (menu-qr-option) - ((next-state symbol :offset-assert 64) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 ) (deftype menu-quit-qr-option (menu-qr-option) - ((next-state symbol :offset-assert 64) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 ) (deftype menu-sub-menu-qr-option (menu-qr-option) - ((next-state symbol :offset-assert 64) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 ) (deftype menu-graphic-option (menu-option) - ((last-move time-frame :offset-assert 48) - (value-to-modify pointer :offset 60) + ((last-move time-frame) + (value-to-modify pointer :offset 60) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) (deftype menu-on-off-progressive-scan-graphic-option (menu-graphic-option) () - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) (deftype menu-aspect-ratio-option (menu-graphic-option) () - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) (deftype menu-center-screen-graphic-option (menu-graphic-option) - ((next-state symbol :offset-assert 64) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 ) (deftype menu-video-mode-option (menu-graphic-option) () - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) (deftype menu-game-option (menu-option) - ((last-move time-frame :offset-assert 48) - (value-to-modify pointer :offset 60) + ((last-move time-frame) + (value-to-modify pointer :offset 60) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) (deftype menu-on-off-game-vibrations-option (menu-game-option) () - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) (deftype menu-on-off-game-subtitles-option (menu-game-option) () - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) (deftype menu-sub-menu-game-option (menu-game-option) - ((next-state symbol :offset-assert 64) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 ) (deftype menu-language-game-option (menu-game-option) - ((language-selection uint64 :offset-assert 64) - (language-direction basic :offset-assert 72) - (language-transition basic :offset-assert 76) - (language-x-offset int32 :offset-assert 80) + ((language-selection uint64) + (language-direction basic) + (language-transition basic) + (language-x-offset int32) ) - :method-count-assert 12 - :size-assert #x54 - :flag-assert #xc00000054 ) (deftype menu-subtitle-language-game-option (menu-game-option) - ((language-selection uint64 :offset-assert 64) - (language-direction basic :offset-assert 72) - (language-transition basic :offset-assert 76) - (language-x-offset int32 :offset-assert 80) + ((language-selection uint64) + (language-direction basic) + (language-transition basic) + (language-x-offset int32) ) - :method-count-assert 12 - :size-assert #x54 - :flag-assert #xc00000054 ) diff --git a/goal_src/jak2/engine/ui/progress/progress-static.gc b/goal_src/jak2/engine/ui/progress/progress-static.gc index 2cf88128572..5b43a386353 100644 --- a/goal_src/jak2/engine/ui/progress/progress-static.gc +++ b/goal_src/jak2/engine/ui/progress/progress-static.gc @@ -838,16 +838,13 @@ ) (deftype hud-scene-info (basic) - ((name string :offset-assert 4) - (continue string :offset-assert 8) - (info object :offset-assert 12) - (info-str string :offset 12) - (info-list pair :offset 12) - (text text-id :offset-assert 16) + ((name string) + (continue string) + (info object) + (info-str string :overlay-at info) + (info-list pair :overlay-at info) + (text text-id) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) diff --git a/goal_src/jak2/engine/ui/progress/progress.gc b/goal_src/jak2/engine/ui/progress/progress.gc index dcdd8fad351..8d15530e6eb 100644 --- a/goal_src/jak2/engine/ui/progress/progress.gc +++ b/goal_src/jak2/engine/ui/progress/progress.gc @@ -8,57 +8,54 @@ ;; DECOMP BEGINS (deftype progress-global-state (basic) - ((aspect-ratio-choice symbol :offset-assert 4) - (video-mode-choice symbol :offset-assert 8) - (yes-no-choice symbol :offset-assert 12) - (on-off-choice symbol :offset-assert 16) - (which-slot int32 :offset-assert 20) - (starting-state symbol :offset-assert 24) - (last-slot-saved int32 :offset-assert 28) - (slider-backup float :offset-assert 32) - (language-backup language-enum :offset-assert 40) - (center-x-backup int32 :offset-assert 48) - (center-y-backup int32 :offset-assert 52) - (aspect-ratio-backup symbol :offset-assert 56) - (last-slider-sound time-frame :offset-assert 64) - (video-mode-timeout time-frame :offset-assert 72) - (progressive-mode-timeout time-frame :offset-assert 80) - (current-task-index int32 :offset-assert 88) - (current-line-index int32 :offset-assert 92) - (first-closed-line-index int32 :offset-assert 96) - (extra-text-state int32 :offset-assert 100) - (current-task uint8 :offset-assert 104) - (num-open-tasks-found int32 :offset-assert 108) - (num-closed-tasks-found int32 :offset-assert 112) - (color-flash-counter int32 :offset-assert 116) - (num-unlocked-secrets int32 :offset-assert 120) - (game-options-item-selected int32 :offset-assert 124) - (game-options-item-picked basic :offset-assert 128) - (game-options-last-move time-frame :offset-assert 136) - (game-options-vibrations symbol :offset-assert 144) - (game-options-subtitles symbol :offset-assert 148) - (game-options-language-index int32 :offset-assert 152) - (game-options-subtitle-language-index int32 :offset-assert 156) - (graphic-options-item-selected int32 :offset-assert 160) - (graphic-options-item-picked symbol :offset-assert 164) - (graphic-options-last-move time-frame :offset-assert 168) - (graphic-options-aspect-ratio symbol :offset-assert 176) - (graphic-options-progressive-scan symbol :offset-assert 180) - (qr-options-item-selected int32 :offset-assert 184) - (qr-options-item-picked basic :offset-assert 188) - (qr-options-last-move time-frame :offset-assert 192) - (qr-options-restart basic :offset-assert 200) - (qr-options-quit basic :offset-assert 204) - (total-num-tasks int32 :offset-assert 208) - (scene-player-act int32 :offset-assert 212) - (stereo-mode-backup int32 :offset-assert 216) - (secrets-unlocked symbol :offset-assert 220) - (missions-total-spacing float :offset-assert 224) - (clear-screen symbol :offset-assert 228) + ((aspect-ratio-choice symbol) + (video-mode-choice symbol) + (yes-no-choice symbol) + (on-off-choice symbol) + (which-slot int32) + (starting-state symbol) + (last-slot-saved int32) + (slider-backup float) + (language-backup language-enum) + (center-x-backup int32) + (center-y-backup int32) + (aspect-ratio-backup symbol) + (last-slider-sound time-frame) + (video-mode-timeout time-frame) + (progressive-mode-timeout time-frame) + (current-task-index int32) + (current-line-index int32) + (first-closed-line-index int32) + (extra-text-state int32) + (current-task uint8) + (num-open-tasks-found int32) + (num-closed-tasks-found int32) + (color-flash-counter int32) + (num-unlocked-secrets int32) + (game-options-item-selected int32) + (game-options-item-picked basic) + (game-options-last-move time-frame) + (game-options-vibrations symbol) + (game-options-subtitles symbol) + (game-options-language-index int32) + (game-options-subtitle-language-index int32) + (graphic-options-item-selected int32) + (graphic-options-item-picked symbol) + (graphic-options-last-move time-frame) + (graphic-options-aspect-ratio symbol) + (graphic-options-progressive-scan symbol) + (qr-options-item-selected int32) + (qr-options-item-picked basic) + (qr-options-last-move time-frame) + (qr-options-restart basic) + (qr-options-quit basic) + (total-num-tasks int32) + (scene-player-act int32) + (stereo-mode-backup int32) + (secrets-unlocked symbol) + (missions-total-spacing float) + (clear-screen symbol) ) - :method-count-assert 9 - :size-assert #xe8 - :flag-assert #x9000000e8 ) @@ -103,7 +100,7 @@ (set-master-mode 'game) 0) -(defmethod init-defaults progress ((this progress)) +(defmethod init-defaults ((this progress)) "Initialize default menu settings." (set! (-> *progress-state* aspect-ratio-choice) (get-aspect-ratio)) (set! (-> *progress-state* video-mode-choice) (get-video-mode)) @@ -174,16 +171,12 @@ (deftype hud-ring-cell (process-drawable) ((parent (pointer progress) :override) - (joint-idx int32 :offset-assert 200) - (init-angle degrees :offset-assert 204) - (graphic-index int32 :offset-assert 208) + (joint-idx int32) + (init-angle degrees) + (graphic-index int32) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd4 - :flag-assert #x15006000d4 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -462,7 +455,7 @@ (none) ) -(defmethod deactivate progress ((this progress)) +(defmethod deactivate ((this progress)) (remove-setting-by-arg0 *setting-control* 'extra-bank) (disable-drawing *bigmap*) (set! (-> *blit-displays-work* menu-mode) #f) @@ -490,7 +483,7 @@ (none) ) -(defmethod gone? progress ((this progress)) +(defmethod gone? ((this progress)) (and *progress-process* (-> *progress-process* 0 next-state) (= (-> *progress-process* 0 next-state name) 'gone) @@ -522,7 +515,7 @@ ) ) -(defmethod can-go-back? progress ((this progress)) +(defmethod can-go-back? ((this progress)) (and (= (-> this menu-transition) 0.0) (not (-> this selected-option)) (!= (-> this current) 'loading) @@ -580,7 +573,7 @@ (none) ) -(defmethod get-state-check-card progress ((this progress) (arg0 symbol)) +(defmethod get-state-check-card ((this progress) (arg0 symbol)) (let ((v1-0 *progress-save-info*) (v0-0 arg0) ) @@ -677,7 +670,7 @@ ) ) -(defmethod push-state progress ((this progress)) +(defmethod push-state ((this progress)) (let ((v1-0 (-> this state-pos))) (cond ((< v1-0 5) @@ -693,7 +686,7 @@ 0 ) -(defmethod pop-state progress ((this progress)) +(defmethod pop-state ((this progress)) (let ((v1-0 (-> this state-pos))) (cond ((> v1-0 0) @@ -716,7 +709,7 @@ 0 ) -(defmethod set-next-state progress ((this progress) (arg0 symbol) (arg1 int)) +(defmethod set-next-state ((this progress) (arg0 symbol) (arg1 int)) "Set the next menu state specified by arg0 at the index specified by arg1." (set! (-> *progress-state* clear-screen) #f) (when (!= arg0 (-> this current)) @@ -762,7 +755,7 @@ 0 ) -(defmethod set-menu-options progress ((this progress) (arg0 symbol)) +(defmethod set-menu-options ((this progress) (arg0 symbol)) "Set the menu options for the menu state specified by arg0." (set! (-> this current-options) #f) (case arg0 @@ -969,7 +962,7 @@ 0 ) -(defmethod respond-to-cpad progress ((this progress)) +(defmethod respond-to-cpad ((this progress)) (mc-get-slot-info 0 *progress-save-info*) (when (-> this current-options) (let ((option-array (-> this current-options options))) @@ -1715,12 +1708,12 @@ ) ) -(defmethod respond-progress menu-option ((this menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." 0 ) -(defmethod respond-progress menu-on-off-option ((this menu-on-off-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-on-off-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* on-off-choice)) (gp-0 #f) @@ -1770,7 +1763,7 @@ 0 ) -(defmethod respond-progress menu-yes-no-option ((this menu-yes-no-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-yes-no-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -1811,7 +1804,7 @@ 0 ) -(defmethod respond-progress menu-slider-option ((this menu-slider-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-slider-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (-> *bigmap* progress-minimap) (let ((gp-0 (-> this value-to-modify)) @@ -1893,7 +1886,7 @@ 0 ) -(defmethod respond-progress menu-stereo-mode-sound-option ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (-> *bigmap* progress-minimap) (let ((a0-1 (-> *setting-control* user-default stereo-mode)) @@ -1931,7 +1924,7 @@ 0 ) -(defmethod respond-progress menu-main-menu-option ((this menu-main-menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-main-menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (cond ((cpad-pressed? 0 start) @@ -2026,7 +2019,7 @@ 0 ) -(defmethod respond-progress menu-sub-menu-option ((this menu-sub-menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-sub-menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (and (-> *progress-state* secrets-unlocked) (not (memcard-unlocked-secrets? #f)) @@ -2086,7 +2079,7 @@ 0 ) -(defmethod respond-progress menu-unlocked-menu-option ((this menu-unlocked-menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-unlocked-menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (memcard-unlocked-secrets? #t))) (logclear! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) @@ -2223,7 +2216,7 @@ 0 ) -(defmethod respond-progress menu-memcard-slot-option ((this menu-memcard-slot-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-memcard-slot-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (memcard-unlocked-secrets? #t) (let ((a1-2 (get-state-check-card arg0 (-> arg0 current)))) @@ -2268,7 +2261,7 @@ 0 ) -(defmethod respond-progress menu-already-exists-option ((this menu-already-exists-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-already-exists-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (&-> *progress-state* yes-no-choice)) (a1-2 (get-state-check-card arg0 'select-save)) @@ -2310,7 +2303,7 @@ 0 ) -(defmethod respond-progress menu-create-game-option ((this menu-create-game-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-create-game-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2355,7 +2348,7 @@ 0 ) -(defmethod respond-progress menu-insufficient-space-option ((this menu-insufficient-space-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-insufficient-space-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s5-0 (&-> *progress-state* yes-no-choice)) (s3-0 (get-state-check-card arg0 'select-save)) @@ -2450,7 +2443,7 @@ 0 ) -(defmethod respond-progress menu-secrets-insufficient-space-option ((this menu-secrets-insufficient-space-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-secrets-insufficient-space-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (&-> *progress-state* yes-no-choice) (cond @@ -2468,7 +2461,7 @@ 0 ) -(defmethod respond-progress menu-video-mode-warning-option ((this menu-video-mode-warning-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-video-mode-warning-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2506,7 +2499,7 @@ 0 ) -(defmethod respond-progress menu-video-mode-ok-option ((this menu-video-mode-ok-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-video-mode-ok-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (s5-0 #f) @@ -2552,7 +2545,7 @@ 0 ) -(defmethod respond-progress menu-progressive-mode-warning-option ((this menu-progressive-mode-warning-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-progressive-mode-warning-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2597,7 +2590,7 @@ 0 ) -(defmethod respond-progress menu-progressive-mode-ok-option ((this menu-progressive-mode-ok-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-progressive-mode-ok-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (s5-0 #f) @@ -2645,7 +2638,7 @@ 0 ) -(defmethod respond-progress menu-card-removed-option ((this menu-card-removed-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-card-removed-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2656,7 +2649,7 @@ 0 ) -(defmethod respond-progress menu-insert-card-option ((this menu-insert-card-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-insert-card-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." *progress-save-info* (cond @@ -2673,7 +2666,7 @@ 0 ) -(defmethod respond-progress menu-error-loading-option ((this menu-error-loading-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-error-loading-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2684,7 +2677,7 @@ 0 ) -(defmethod respond-progress menu-error-auto-saving-option ((this menu-error-auto-saving-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-error-auto-saving-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2695,7 +2688,7 @@ 0 ) -(defmethod respond-progress menu-error-disc-removed-option ((this menu-error-disc-removed-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-error-disc-removed-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2708,7 +2701,7 @@ 0 ) -(defmethod respond-progress menu-error-reading-option ((this menu-error-reading-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-error-reading-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2719,7 +2712,7 @@ 0 ) -(defmethod respond-progress menu-icon-info-option ((this menu-icon-info-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-icon-info-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2730,7 +2723,7 @@ 0 ) -(defmethod respond-progress menu-quit-option ((this menu-quit-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-quit-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2774,7 +2767,7 @@ 0 ) -(defmethod respond-progress menu-format-card-option ((this menu-format-card-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-format-card-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2819,7 +2812,7 @@ ) ;; WARN: disable def twice: 110. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod respond-progress menu-select-start-option ((this menu-select-start-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-select-start-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) @@ -2950,7 +2943,7 @@ 0 ) -(defmethod respond-progress menu-select-scene-option ((this menu-select-scene-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-select-scene-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) @@ -3025,7 +3018,7 @@ 0 ) -(defmethod respond-progress menu-bigmap-option ((this menu-bigmap-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-bigmap-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (handle-cpad-inputs *bigmap*) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -3033,7 +3026,7 @@ 0 ) -(defmethod respond-progress menu-missions-option ((this menu-missions-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-missions-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) @@ -3082,7 +3075,7 @@ 0 ) -(defmethod respond-progress menu-highscores-option ((this menu-highscores-option) (progress progress) (selected? symbol)) +(defmethod respond-progress ((this menu-highscores-option) (progress progress) (selected? symbol)) "Handle progress menu navigation logic." (set! (-> progress sliding) (seek-ease (-> progress sliding) @@ -3149,7 +3142,7 @@ 0 ) -(defmethod respond-progress menu-secret-option ((this menu-secret-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-secret-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let* ((s5-1 (logtest? (-> *game-info* secrets) (game-secrets hero-mode))) (s3-0 (if (not s5-1) @@ -3267,7 +3260,7 @@ 0 ) -(defmethod respond-progress menu-game-option ((this menu-game-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-game-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (-> *progress-state* game-options-vibrations) (-> *progress-state* game-options-subtitles) @@ -3488,7 +3481,7 @@ 0 ) -(defmethod respond-progress menu-graphic-option ((this menu-graphic-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-graphic-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (-> *progress-state* graphic-options-aspect-ratio) (-> *progress-state* graphic-options-progressive-scan) @@ -3700,7 +3693,7 @@ 0 ) -(defmethod respond-progress menu-qr-option ((this menu-qr-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-qr-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (-> *progress-state* qr-options-restart) (-> *progress-state* qr-options-quit) diff --git a/goal_src/jak2/engine/ui/text-h.gc b/goal_src/jak2/engine/ui/text-h.gc index 611910ca341..af7f7923c13 100644 --- a/goal_src/jak2/engine/ui/text-h.gc +++ b/goal_src/jak2/engine/ui/text-h.gc @@ -17,27 +17,21 @@ ;; DECOMP BEGINS (deftype game-text (structure) - ((id text-id :offset-assert 0) - (text string :offset-assert 4) + ((id text-id) + (text string) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype game-text-info (basic) - ((length int32 :offset-assert 4) - (language-id int32 :offset-assert 8) - (group-name string :offset-assert 12) - (data game-text :inline :dynamic :offset-assert 16) + ((length int32) + (language-id int32) + (group-name string) + (data game-text :inline :dynamic) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (lookup-text! (_type_ text-id symbol) string 9) + (lookup-text! (_type_ text-id symbol) string) ) ) diff --git a/goal_src/jak2/engine/ui/text.gc b/goal_src/jak2/engine/ui/text.gc index 795f1d4c9e7..6a27980cab3 100644 --- a/goal_src/jak2/engine/ui/text.gc +++ b/goal_src/jak2/engine/ui/text.gc @@ -32,7 +32,7 @@ (kmemclose) -(defmethod relocate game-text-info ((this game-text-info) (arg0 int)) +(defmethod relocate ((this game-text-info) (arg0 int)) (let ((v1-1 (-> *level* loading-level))) (when v1-1 (set! (-> v1-1 loaded-text-info (-> v1-1 loaded-text-info-count)) this) @@ -42,17 +42,17 @@ this ) -(defmethod length game-text-info ((this game-text-info)) +(defmethod length ((this game-text-info)) (-> this length) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of game-text-info ((this game-text-info)) +(defmethod asize-of ((this game-text-info)) (the-as int (+ (-> this type size) (* (-> this length) 8))) ) -(defmethod mem-usage game-text-info ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 84 (-> arg0 length))) (set! (-> arg0 data 83 name) "string") (+! (-> arg0 data 83 count) 1) @@ -160,7 +160,7 @@ ) ) -(defmethod lookup-text! game-text-info ((this game-text-info) (arg0 text-id) (arg1 symbol)) +(defmethod lookup-text! ((this game-text-info) (arg0 text-id) (arg1 symbol)) (cond ((= this #f) (cond @@ -212,7 +212,7 @@ ) ) -(defmethod lookup-text level ((this level) (arg0 text-id) (arg1 symbol)) +(defmethod lookup-text ((this level) (arg0 text-id) (arg1 symbol)) (let ((v1-0 *common-text*)) (dotimes (a3-0 (-> this loaded-text-info-count)) (if (= (-> this loaded-text-info a3-0 language-id) (-> *setting-control* user-current language)) @@ -314,7 +314,7 @@ in a single text group and file." ) (defun draw-debug-text-box ((arg0 font-context)) - "Draws the boundaries of the font context. requires any cheat to be enabled." + "Draws some lines" (when *cheat-mode* (#when PC_PORT (if (logtest? (-> arg0 flags) (font-flags right)) diff --git a/goal_src/jak2/engine/util/capture-h.gc b/goal_src/jak2/engine/util/capture-h.gc index 8b54cdc1b73..1bf47e42106 100644 --- a/goal_src/jak2/engine/util/capture-h.gc +++ b/goal_src/jak2/engine/util/capture-h.gc @@ -12,43 +12,40 @@ ;; GS packet to download the framebuffer. (deftype gs-store-image-packet (structure) - ((vifcode vif-tag 4 :offset-assert 0) - (giftag gif-tag :offset-assert 16) - (bitbltbuf gs-bitbltbuf :offset-assert 32) - (bitbltbuf-addr gs-reg64 :offset-assert 40) - (trxpos gs-trxpos :offset-assert 48) - (trxpos-addr gs-reg64 :offset-assert 56) - (trxreg gs-trxreg :offset-assert 64) - (trxreg-addr gs-reg64 :offset-assert 72) - (finish int64 :offset-assert 80) - (finish-addr gs-reg64 :offset-assert 88) - (trxdir gs-trxdir :offset-assert 96) - (trxdir-addr gs-reg64 :offset-assert 104) + ((vifcode vif-tag 4) + (giftag gif-tag) + (bitbltbuf gs-bitbltbuf) + (bitbltbuf-addr gs-reg64) + (trxpos gs-trxpos) + (trxpos-addr gs-reg64) + (trxreg gs-trxreg) + (trxreg-addr gs-reg64) + (finish int64) + (finish-addr gs-reg64) + (trxdir gs-trxdir) + (trxdir-addr gs-reg64) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; screen shot settings. (deftype screen-shot-work (structure) - ((count int16 :offset-assert 0) - (size int16 :offset-assert 2) - (name string :offset-assert 4) - (highres-enable symbol :offset-assert 8) - (hud-enable symbol :offset-assert 12) + ((count int16) + (size int16) + (name string) + (highres-enable symbol) + (hud-enable symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) + + (define *screen-shot-work* (new 'global 'screen-shot-work)) (set! (-> *screen-shot-work* count) -1) + (set! (-> *screen-shot-work* size) -1) -(set! (-> *screen-shot-work* highres-enable) #f) -(set! (-> *screen-shot-work* hud-enable) #f) -(define *image-name* (new 'global 'string 32 (the-as string #f))) +(set! (-> *screen-shot-work* highres-enable) #f) +(set! (-> *screen-shot-work* hud-enable) #f) +(define *image-name* (new 'global 'string 32 (the-as string #f))) diff --git a/goal_src/jak2/engine/util/glist-h.gc b/goal_src/jak2/engine/util/glist-h.gc index ad642204be6..004f0050a86 100644 --- a/goal_src/jak2/engine/util/glist-h.gc +++ b/goal_src/jak2/engine/util/glist-h.gc @@ -10,136 +10,70 @@ ;; this file is debug only (declare-file (debug)) -;; definition of type glst-node (deftype glst-node (structure) - ((next glst-node :offset-assert 0) - (prev glst-node :offset-assert 4) + ((next glst-node) + (prev glst-node) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) -;; definition for method 3 of type glst-node -(defmethod inspect glst-node ((this glst-node)) - (when (not this) - (set! this this) - (goto cfg-4) - ) - (format #t "[~8x] ~A~%" this 'glst-node) - (format #t "~1Tnext: #~%" (-> this next)) - (format #t "~1Tprev: #~%" (-> this prev)) - (label cfg-4) - this - ) -;; definition of type glst-named-node (deftype glst-named-node (glst-node) - ((privname string :offset-assert 8) + ((privname string) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) -;; definition for method 3 of type glst-named-node -(defmethod inspect glst-named-node ((this glst-named-node)) - (when (not this) - (set! this this) - (goto cfg-4) - ) - (format #t "[~8x] ~A~%" this 'glst-named-node) - (format #t "~1Tnext: #~%" (-> this next)) - (format #t "~1Tprev: #~%" (-> this prev)) - (format #t "~1Tprivname: ~A~%" (-> this privname)) - (label cfg-4) - this - ) -;; definition of type glst-list (deftype glst-list (structure) - ((head glst-node :offset-assert 0) - (tail glst-node :offset-assert 4) - (tailpred glst-node :offset-assert 8) - (numelem int32 :offset-assert 12) + ((head glst-node) + (tail glst-node) + (tailpred glst-node) + (numelem int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) -;; definition for method 3 of type glst-list -(defmethod inspect glst-list ((this glst-list)) - (when (not this) - (set! this this) - (goto cfg-4) - ) - (format #t "[~8x] ~A~%" this 'glst-list) - (format #t "~1Thead: #~%" (-> this head)) - (format #t "~1Ttail: #~%" (-> this tail)) - (format #t "~1Ttailpred: #~%" (-> this tailpred)) - (format #t "~1Tnumelem: ~D~%" (-> this numelem)) - (label cfg-4) - this - ) -;; definition for function glst-next (defun glst-next ((arg0 glst-node)) "return the next node in the list" (-> arg0 next) ) -;; definition for function glst-prev (defun glst-prev ((arg0 glst-node)) "return the previous node in the list" (-> arg0 prev) ) -;; definition for function glst-head (defun glst-head ((arg0 glst-list)) "return the start of the list" (-> arg0 head) ) -;; definition for function glst-tail (defun glst-tail ((arg0 glst-list)) "return the tail of the list" (-> arg0 tailpred) ) -;; definition for function glst-end-of-list? (defun glst-end-of-list? ((arg0 glst-node)) "is this node the end of the list. #t = end" (not (-> arg0 next)) ) -;; definition for function glst-start-of-list? (defun glst-start-of-list? ((arg0 glst-node)) "is this node the start of the list. #t = start" (not (-> arg0 prev)) ) -;; definition for function glst-empty? (defun glst-empty? ((arg0 glst-list)) "is the list empty, #t = empty" (= (-> arg0 tailpred) arg0) ) -;; definition for function glst-node-name (defun glst-node-name ((arg0 glst-named-node)) "Returns the `privname` of the provided [[glst-named-node]]" (-> arg0 privname) ) -;; definition for function glst-set-name! (defun glst-set-name! ((arg0 glst-named-node) (arg1 string)) "Sets the `privname` of the provided [[glst-named-node]]" (set! (-> arg0 privname) arg1) arg1 ) - -;; failed to figure out what this is: -0 - - - diff --git a/goal_src/jak2/engine/util/profile-h.gc b/goal_src/jak2/engine/util/profile-h.gc index 459c91d2390..b69b02d3cca 100644 --- a/goal_src/jak2/engine/util/profile-h.gc +++ b/goal_src/jak2/engine/util/profile-h.gc @@ -23,50 +23,41 @@ The "count" can be used for whatever you want (ex: fragments, VU calls, etc) ;; to summarize all events in a category (both EE and VU), so there's ;; some overlap (deftype profile-segment (structure) - ((name symbol :offset-assert 0) ;; used for categorization. - (start-time int16 :offset-assert 4) ;; timestamp of start - (end-time int16 :offset-assert 6) ;; timestamp of end - (count uint8 :offset-assert 8) ;; how many on EE - (vu-count uint8 :offset-assert 9) ;; how many on VU - (depth uint16 :offset-assert 10) ;; depth in the profile stack - (color rgba :offset-assert 12) ;; color for bar/text - (code-time uint16 :offset 4) ;; total time, EE - (vu-time uint16 :offset 6) ;; total time, VU + ((name symbol) ;; used for categorization. + (start-time int16) ;; timestamp of start + (end-time int16) ;; timestamp of end + (count uint8) ;; how many on EE + (vu-count uint8) ;; how many on VU + (depth uint16) ;; depth in the profile stack + (color rgba) ;; color for bar/text + (code-time uint16 :overlay-at start-time) ;; total time, EE + (vu-time uint16 :overlay-at end-time) ;; total time, VU ) :allow-misaligned - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; segments with the same name are combined together. Each "collapse" entry ;; has a summary of all the events with the same name. (deftype profile-collapse (structure) - ((count int32 :offset-assert 0) - (data profile-segment 48 :inline :offset-assert 4) + ((count int32) + (data profile-segment 48 :inline) ) - :method-count-assert 9 - :size-assert #x304 - :flag-assert #x900000304 ) ;; Profiling data. For either EE or VU (each has one) (deftype profile-segment-array (basic) - ((count int16 :offset-assert 4) ;; number of used segments - (depth int8 :offset-assert 6) ;; current stack depth - (max-depth int8 :offset-assert 7) ;; max depth ever seen - (base-time int16 :offset-assert 8) ;; time at profile start - (segment profile-segment 9 :offset-assert 12) ;; stack of open segments - (data profile-segment 512 :inline :offset-assert 48) ;; segment buffer + ((count int16) + (depth int8) + (max-depth int8) + (base-time int16) + (segment profile-segment 9) + (data profile-segment 512 :inline) ) - :method-count-assert 13 - :size-assert #x2030 - :flag-assert #xd00002030 (:methods - (get-total-time (_type_) int 9) - (start-frame! (_type_) none 10) - (start-segment! (_type_ symbol rgba) none 11) - (end-segment! (_type_) none 12) + (get-total-time (_type_) int) + (start-frame! (_type_) none) + (start-segment! (_type_ symbol rgba) none) + (end-segment! (_type_) none) ) ) @@ -74,21 +65,17 @@ The "count" can be used for whatever you want (ex: fragments, VU calls, etc) ;; Pair of profilers (EE, VU) (deftype profile-array (structure) - ((data profile-segment-array 2 :offset-assert 0) + ((data profile-segment-array 2) ) - :method-count-assert 12 - :size-assert #x8 - :flag-assert #xc00000008 (:methods - (setup-categories! (_type_) none 9) - (draw-bars! (_type_ dma-buffer int) none 10) - (draw-text! (_type_) none 11) + (setup-categories! (_type_) none) + (draw-bars! (_type_ dma-buffer int) none) + (draw-text! (_type_) none) ) ) -(defmethod get-total-time profile-segment-array ((this profile-segment-array)) - "Get the total time spent." +(defmethod get-total-time ((this profile-segment-array)) ;; assuming 0 is "all" here. (- (-> this data 0 end-time) (-> this data 0 start-time)) ) diff --git a/goal_src/jak2/engine/util/profile.gc b/goal_src/jak2/engine/util/profile.gc index f9e508f386c..416da3225a9 100644 --- a/goal_src/jak2/engine/util/profile.gc +++ b/goal_src/jak2/engine/util/profile.gc @@ -10,13 +10,10 @@ ;; DMA templates for profile drawing (deftype profile-work (structure) - ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) - (line-tmpl dma-gif-packet :inline :offset-assert 32) - (last-index int32 :offset-assert 64) + ((sprite-tmpl dma-gif-packet :inline) + (line-tmpl dma-gif-packet :inline) + (last-index int32) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) ;; dma templates @@ -55,12 +52,16 @@ ;; profile setting (define *profile-x* 1808) + (define *profile-y* 1848) + (define *profile-w* 416) + (define *profile-h* 8) + (define *profile-ticks* #f) -(defmethod start-frame! profile-segment-array ((this profile-segment-array)) +(defmethod start-frame! ((this profile-segment-array)) "Start a frame." (set! (-> this count) 0) (set! (-> this depth) 0) @@ -71,7 +72,7 @@ (none) ) -(defmethod start-segment! profile-segment-array ((this profile-segment-array) (arg0 symbol) (arg1 rgba)) +(defmethod start-segment! ((this profile-segment-array) (arg0 symbol) (arg1 rgba)) "Push a new segment onto the profiling stack." (when (and *dproc* *debug-segment*) (let ((s4-0 (-> this data (-> this count)))) @@ -91,7 +92,7 @@ (none) ) -(defmethod end-segment! profile-segment-array ((this profile-segment-array)) +(defmethod end-segment! ((this profile-segment-array)) "Pop the last pushed segment." (when (and *dproc* *debug-segment*) (let* ((v1-4 (+ (-> this depth) -1)) @@ -381,7 +382,7 @@ ) ) -(defmethod setup-categories! profile-array ((this profile-array)) +(defmethod setup-categories! ((this profile-array)) "Summarize data collected." ;; loop over both EE and VU profilers @@ -550,7 +551,7 @@ (none) ) -(defmethod draw-bars! profile-array ((this profile-array) (arg0 dma-buffer) (arg1 int)) +(defmethod draw-bars! ((this profile-array) (arg0 dma-buffer) (arg1 int)) "Draw the two bars at the top." (local-vars (sv-16 (function _varargs_ object)) (sv-32 (function _varargs_ object))) (dma-buffer-add-gs-set arg0 @@ -728,7 +729,7 @@ ) -(defmethod draw-text! profile-array ((this profile-array)) +(defmethod draw-text! ((this profile-array)) "Draw the table of times." (let ((gp-0 *profile-collapse*)) (dotimes (s5-0 (-> gp-0 count)) diff --git a/goal_src/jak2/engine/util/script-h.gc b/goal_src/jak2/engine/util/script-h.gc index 7ef71a105c1..d12e843673c 100644 --- a/goal_src/jak2/engine/util/script-h.gc +++ b/goal_src/jak2/engine/util/script-h.gc @@ -22,40 +22,34 @@ ;; DECOMP BEGINS (deftype script-form (structure) - ((name symbol :offset-assert 0) - (spec pair :offset-assert 4) - (func (function script-context object) :offset-assert 8) + ((name symbol) + (spec pair) + (func (function script-context object)) ) :pack-me - :method-count-assert 10 - :size-assert #xc - :flag-assert #xa0000000c (:methods - (script-form-method-9 () none 9) + (script-form-method-9 () none) ) ) (deftype script-context (structure) - ((load-state load-state :offset-assert 0) - (key object :offset-assert 4) - (process process :offset-assert 8) - (trans vector :offset-assert 12) - (side-effect? symbol :offset-assert 16) - (got-error? symbol :offset-assert 20) - (expr pair :offset-assert 24) - (param-count int32 :offset-assert 28) - (param object 16 :offset-assert 32) - (param-type object 16 :offset-assert 96) + ((load-state load-state) + (key object) + (process process) + (trans vector) + (side-effect? symbol) + (got-error? symbol) + (expr pair) + (param-count int32) + (param object 16) + (param-type object 16) ) - :method-count-assert 12 - :size-assert #xa0 - :flag-assert #xc000000a0 (:methods - (new (symbol type object process vector) _type_ 0) - (eval! (_type_ pair) object 9) - (script-context-method-10 (_type_ object pair) object 10) - (script-context-method-11 (_type_ pair pair symbol) symbol 11) + (new (symbol type object process vector) _type_) + (eval! (_type_ pair) object) + (script-context-method-10 (_type_ object pair) object) + (script-context-method-11 (_type_ pair pair symbol) symbol) ) ) diff --git a/goal_src/jak2/engine/util/smush-control-h.gc b/goal_src/jak2/engine/util/smush-control-h.gc index 1c401488225..05fea6fb5c7 100644 --- a/goal_src/jak2/engine/util/smush-control-h.gc +++ b/goal_src/jak2/engine/util/smush-control-h.gc @@ -8,34 +8,31 @@ ;; DECOMP BEGINS (deftype smush-control (structure) - ((start-time time-frame :offset-assert 0) - (period float :offset-assert 8) - (duration float :offset-assert 12) - (amp float :offset-assert 16) - (damp-amp float :offset-assert 20) - (damp-period float :offset-assert 24) - (ticks float :offset-assert 28) + ((start-time time-frame) + (period float) + (duration float) + (amp float) + (damp-amp float) + (damp-period float) + (ticks float) ) :pack-me - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 (:methods - (set-zero! (_type_) _type_ 9) - (update! (_type_) float 10) - (get-no-update (_type_) float 11) - (activate! (_type_ float int int float float clock) _type_ 12) - (nonzero-amplitude? (_type_) symbol 13) - (die-on-next-update! (_type_) _type_ 14) + (set-zero! (_type_) _type_) + (update! (_type_) float) + (get-no-update (_type_) float) + (activate! (_type_ float int int float float clock) _type_) + (nonzero-amplitude? (_type_) symbol) + (die-on-next-update! (_type_) _type_) ) ) -(defmethod nonzero-amplitude? smush-control ((this smush-control)) +(defmethod nonzero-amplitude? ((this smush-control)) (!= (-> this amp) 0.0) ) -(defmethod set-zero! smush-control ((this smush-control)) +(defmethod set-zero! ((this smush-control)) (set! (-> this period) 0.0) (set! (-> this duration) 0.0) (set! (-> this amp) 0.0) @@ -45,7 +42,7 @@ this ) -(defmethod update! smush-control ((this smush-control)) +(defmethod update! ((this smush-control)) (cond ((!= (-> this amp) 0.0) (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) @@ -74,7 +71,7 @@ ) ) -(defmethod get-no-update smush-control ((this smush-control)) +(defmethod get-no-update ((this smush-control)) (cond ((!= (-> this amp) 0.0) (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) @@ -92,14 +89,14 @@ ) ) -(defmethod die-on-next-update! smush-control ((this smush-control)) +(defmethod die-on-next-update! ((this smush-control)) (if (!= (-> this amp) 0.0) (set! (-> this damp-period) -1.0) ) this ) -(defmethod activate! smush-control ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock)) +(defmethod activate! ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock)) (when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this))) (set! (-> this amp) arg0) (set! (-> this period) (the float arg1)) diff --git a/goal_src/jak2/engine/util/sync-info-h.gc b/goal_src/jak2/engine/util/sync-info-h.gc index e33e495010b..b2b55da249e 100644 --- a/goal_src/jak2/engine/util/sync-info-h.gc +++ b/goal_src/jak2/engine/util/sync-info-h.gc @@ -14,38 +14,32 @@ ;; DECOMP BEGINS (deftype sync-info-params (structure) - ((sync-type symbol :offset-assert 0) - (sync-flags sync-flags :offset-assert 8) - (entity basic :offset-assert 16) - (period uint32 :offset-assert 20) - (percent float :offset-assert 24) - (ease-in float :offset-assert 28) - (ease-out float :offset-assert 32) - (pause-in float :offset-assert 36) - (pause-out float :offset-assert 40) + ((sync-type symbol) + (sync-flags sync-flags) + (entity basic) + (period uint32) + (percent float) + (ease-in float) + (ease-out float) + (pause-in float) + (pause-out float) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) (deftype sync-info (structure) - ((sync-flags sync-flags :offset-assert 0) - (offset float :offset-assert 8) - (period uint32 :offset-assert 12) + ((sync-flags sync-flags) + (offset float) + (period uint32) ) - :method-count-assert 16 - :size-assert #x10 - :flag-assert #x1000000010 (:methods - (get-current-phase-no-mod (_type_) float 9) - (get-phase-offset (_type_) float 10) - (get-norm! (_type_ int) float 11) - (get-scaled-val! (_type_ float int) float 12) - (initialize! (_type_ sync-info-params) none 13) - (get-timeframe-offset! (_type_ time-frame) time-frame 14) - (sync-now! (_type_ float) none 15) + (get-current-phase-no-mod (_type_) float) + (get-phase-offset (_type_) float) + (get-norm! (_type_ int) float) + (get-scaled-val! (_type_ float int) float) + (initialize! (_type_ sync-info-params) none) + (get-timeframe-offset! (_type_ time-frame) time-frame) + (sync-now! (_type_ float) none) ) ) @@ -53,132 +47,108 @@ (deftype sync-linear (sync-info) () :pack-me - :method-count-assert 16 - :size-assert #x10 - :flag-assert #x1000000010 ) (deftype sync-eased (sync-info) - ((tlo float :offset-assert 16) - (thi float :offset-assert 20) - (ylo float :offset-assert 24) - (m2 float :offset-assert 28) - (yend float :offset-assert 32) - (pause-in float :offset-assert 36) - (pause-out float :offset-assert 40) + ((tlo float) + (thi float) + (ylo float) + (m2 float) + (yend float) + (pause-in float) + (pause-out float) ) :pack-me - :method-count-assert 16 - :size-assert #x2c - :flag-assert #x100000002c ) (deftype sync-paused (sync-info) - ((pause-in float :offset-assert 16) - (pause-out float :offset-assert 20) + ((pause-in float) + (pause-out float) ) - :method-count-assert 16 - :size-assert #x18 - :flag-assert #x1000000018 ) (deftype delayed-rand-float (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (max-val float :offset-assert 8) - (timer int32 :offset-assert 12) - (start-time time-frame :offset-assert 16) - (value float :offset-assert 24) + ((min-time int32) + (max-time int32) + (max-val float) + (timer int32) + (start-time time-frame) + (value float) ) :pack-me - :method-count-assert 13 - :size-assert #x1c - :flag-assert #xd0000001c (:methods - (set-params! (_type_ int int float) float 9) - (reset! (_type_) float 10) - (update! (_type_) float 11) - (update-and-clear! (_type_) none 12) + (set-params! (_type_ int int float) float) + (reset! (_type_) float) + (update! (_type_) float) + (update-and-clear! (_type_) none) ) ) (deftype oscillating-float (structure) - ((value float :offset-assert 0) - (target float :offset-assert 4) - (vel float :offset-assert 8) - (max-vel float :offset-assert 12) - (damping float :offset-assert 16) - (accel float :offset-assert 20) + ((value float) + (target float) + (vel float) + (max-vel float) + (damping float) + (accel float) ) :allow-misaligned - :method-count-assert 11 - :size-assert #x18 - :flag-assert #xb00000018 (:methods - (set-params! (_type_ float float float float) float 9) - (update! (_type_ float) float 10) + (set-params! (_type_ float float float float) float) + (update! (_type_ float) float) ) ) (deftype bouncing-float (structure) - ((osc oscillating-float :inline :offset-assert 0) - (max-value float :offset-assert 24) - (min-value float :offset-assert 28) - (elasticity float :offset-assert 32) - (state int32 :offset-assert 36) + ((osc oscillating-float :inline) + (max-value float) + (min-value float) + (elasticity float) + (state int32) ) :allow-misaligned - :method-count-assert 13 - :size-assert #x28 - :flag-assert #xd00000028 (:methods - (set-params! (_type_ float float float float float float float) float 9) - (update! (_type_ float) float 10) - (at-min? (_type_) symbol 11) - (at-max? (_type_) symbol 12) + (set-params! (_type_ float float float float float float float) float) + (update! (_type_ float) float) + (at-min? (_type_) symbol) + (at-max? (_type_) symbol) ) ) (deftype delayed-rand-vector (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (xz-max float :offset-assert 8) - (y-max float :offset-assert 12) - (timer int32 :offset-assert 16) - (start-time time-frame :offset-assert 24) - (value vector :inline :offset-assert 32) + ((min-time int32) + (max-time int32) + (xz-max float) + (y-max float) + (timer int32) + (start-time time-frame) + (value vector :inline) ) - :method-count-assert 13 - :size-assert #x30 - :flag-assert #xd00000030 (:methods - (set-params! (_type_ int int float float) vector 9) - (update-now! (_type_) vector 10) - (update-with-delay! (_type_) vector 11) - (update-with-delay-or-reset! (_type_) vector 12) + (set-params! (_type_ int int float float) vector) + (update-now! (_type_) vector) + (update-with-delay! (_type_) vector) + (update-with-delay-or-reset! (_type_) vector) ) ) (deftype oscillating-vector (structure) - ((value vector :inline :offset-assert 0) - (target vector :inline :offset-assert 16) - (vel vector :inline :offset-assert 32) - (max-vel float :offset-assert 48) - (damping float :offset-assert 52) - (accel float :offset-assert 56) + ((value vector :inline) + (target vector :inline) + (vel vector :inline) + (max-vel float) + (damping float) + (accel float) ) - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (set-params! (_type_ vector float float float) vector 9) - (update! (_type_ vector) vector 10) + (set-params! (_type_ vector float float float) vector) + (update! (_type_ vector) vector) ) ) diff --git a/goal_src/jak2/engine/util/sync-info.gc b/goal_src/jak2/engine/util/sync-info.gc index 7c535d3bb0c..0aa3e3d618a 100644 --- a/goal_src/jak2/engine/util/sync-info.gc +++ b/goal_src/jak2/engine/util/sync-info.gc @@ -8,13 +8,13 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch object vs none. -(defmethod initialize! sync-info ((this sync-info) (arg0 sync-info-params)) +(defmethod initialize! ((this sync-info) (arg0 sync-info-params)) "Set up a sync-info from params." (format 0 "ERROR: Invalid call to sync-info::initialize!~%") (none) ) -(defmethod get-current-phase-no-mod sync-info ((this sync-info)) +(defmethod get-current-phase-no-mod ((this sync-info)) "Get the current value, with no fancy modifications." (let* ((v1-0 (-> this period)) (f0-1 (the float v1-0)) @@ -24,12 +24,12 @@ ) ) -(defmethod get-phase-offset sync-info ((this sync-info)) +(defmethod get-phase-offset ((this sync-info)) "Get the offset, as a fraction of period" (/ (-> this offset) (the float (-> this period))) ) -(defmethod sync-now! sync-info ((this sync-info) (arg0 float)) +(defmethod sync-now! ((this sync-info) (arg0 float)) "Adjust our offset so our current phase is the given phase." (let* ((a2-0 (-> this period)) (f0-1 (the float a2-0)) @@ -44,18 +44,18 @@ (none) ) -(defmethod get-norm! sync-info ((this sync-info) (arg0 int)) +(defmethod get-norm! ((this sync-info) (arg0 int)) "Get the current value, from 0 to 1." (format 0 "ERROR: Unsupported sync-info::get-norm!~%") 0.0 ) -(defmethod get-scaled-val! sync-info ((this sync-info) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! ((this sync-info) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" (* (get-norm! this arg1) arg0) ) -(defmethod get-timeframe-offset! sync-info ((this sync-info) (arg0 time-frame)) +(defmethod get-timeframe-offset! ((this sync-info) (arg0 time-frame)) "Get the difference between the given time-frame and when this sync-info is at 0." (if (zero? arg0) (set! arg0 (current-time)) @@ -69,7 +69,7 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod initialize! sync-linear ((this sync-linear) (arg0 sync-info-params)) +(defmethod initialize! ((this sync-linear) (arg0 sync-info-params)) "Set up a sync-info from params." (local-vars (sv-16 res-tag)) (if (!= (-> arg0 sync-type) 'sync-linear) @@ -104,7 +104,7 @@ (none) ) -(defmethod get-norm! sync-linear ((this sync-linear) (arg0 int)) +(defmethod get-norm! ((this sync-linear) (arg0 int)) "Get the current value, from 0 to 1." (if (zero? arg0) (set! arg0 (the-as int (current-time))) @@ -133,13 +133,13 @@ ) ) -(defmethod get-scaled-val! sync-linear ((this sync-linear) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! ((this sync-linear) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" (* (get-norm! this arg1) arg0) ) ;; WARN: Return type mismatch float vs none. -(defmethod initialize! sync-eased ((this sync-eased) (arg0 sync-info-params)) +(defmethod initialize! ((this sync-eased) (arg0 sync-info-params)) "Set up a sync-info from params." (local-vars (sv-16 res-tag)) (if (!= (-> arg0 sync-type) 'sync-eased) @@ -238,7 +238,7 @@ (none) ) -(defmethod get-norm! sync-eased ((this sync-eased) (arg0 int)) +(defmethod get-norm! ((this sync-eased) (arg0 int)) "Get the current value, from 0 to 1." (if (zero? arg0) (set! arg0 (the-as int (current-time))) @@ -304,13 +304,13 @@ ) ) -(defmethod get-scaled-val! sync-eased ((this sync-eased) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! ((this sync-eased) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" (* (get-norm! this arg1) arg0) ) ;; WARN: Return type mismatch float vs none. -(defmethod initialize! sync-paused ((this sync-paused) (arg0 sync-info-params)) +(defmethod initialize! ((this sync-paused) (arg0 sync-info-params)) "Set up a sync-info from params." (local-vars (sv-16 res-tag)) (if (!= (-> arg0 sync-type) 'sync-paused) @@ -371,7 +371,7 @@ (none) ) -(defmethod get-norm! sync-paused ((this sync-paused) (arg0 int)) +(defmethod get-norm! ((this sync-paused) (arg0 int)) "Get the current value, from 0 to 1." (if (zero? arg0) (set! arg0 (the-as int (current-time))) @@ -417,12 +417,12 @@ ) ) -(defmethod get-scaled-val! sync-paused ((this sync-paused) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! ((this sync-paused) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" (* (get-norm! this arg1) arg0) ) -(defmethod set-params! delayed-rand-float ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) +(defmethod set-params! ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) (set! (-> this max-val) (* 0.5 arg2)) @@ -432,13 +432,13 @@ (-> this value) ) -(defmethod reset! delayed-rand-float ((this delayed-rand-float)) +(defmethod reset! ((this delayed-rand-float)) (set-time! (-> this start-time)) (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) (set! (-> this value) (rand-vu-float-range (- (-> this max-val)) (-> this max-val))) ) -(defmethod update! delayed-rand-float ((this delayed-rand-float)) +(defmethod update! ((this delayed-rand-float)) (if (time-elapsed? (-> this start-time) (-> this timer)) (reset! this) ) @@ -446,7 +446,7 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod update-and-clear! delayed-rand-float ((this delayed-rand-float)) +(defmethod update-and-clear! ((this delayed-rand-float)) (if (time-elapsed? (-> this start-time) (-> this timer)) (reset! this) (set! (-> this value) 0.0) @@ -455,7 +455,7 @@ (none) ) -(defmethod set-params! oscillating-float ((this oscillating-float) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) +(defmethod set-params! ((this oscillating-float) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (set! (-> this value) arg0) (set! (-> this target) arg0) (set! (-> this vel) 0.0) @@ -465,7 +465,7 @@ (-> this value) ) -(defmethod update! oscillating-float ((this oscillating-float) (arg0 float)) +(defmethod update! ((this oscillating-float) (arg0 float)) (with-pp (let ((f0-3 (* (- (+ (-> this target) arg0) (-> this value)) (* (-> this accel) (-> pp clock time-adjust-ratio))))) (+! (-> this vel) f0-3) @@ -477,15 +477,15 @@ ) ) -(defmethod set-params! bouncing-float ((this bouncing-float) - (arg0 float) - (arg1 float) - (arg2 float) - (arg3 float) - (arg4 float) - (arg5 float) - (arg6 float) - ) +(defmethod set-params! ((this bouncing-float) + (arg0 float) + (arg1 float) + (arg2 float) + (arg3 float) + (arg4 float) + (arg5 float) + (arg6 float) + ) (set-params! (-> this osc) arg0 arg4 arg5 arg6) (set! (-> this max-value) arg1) (set! (-> this min-value) arg2) @@ -494,7 +494,7 @@ (-> this osc value) ) -(defmethod update! bouncing-float ((this bouncing-float) (arg0 float)) +(defmethod update! ((this bouncing-float) (arg0 float)) (update! (-> this osc) arg0) (set! (-> this state) 0) (when (>= (-> this osc value) (-> this max-value)) @@ -514,15 +514,15 @@ (-> this osc value) ) -(defmethod at-min? bouncing-float ((this bouncing-float)) +(defmethod at-min? ((this bouncing-float)) (= (-> this state) -1) ) -(defmethod at-max? bouncing-float ((this bouncing-float)) +(defmethod at-max? ((this bouncing-float)) (= (-> this state) 1) ) -(defmethod set-params! delayed-rand-vector ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) +(defmethod set-params! ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) (set! (-> this xz-max) (* 0.5 arg2)) @@ -533,7 +533,7 @@ (-> this value) ) -(defmethod update-now! delayed-rand-vector ((this delayed-rand-vector)) +(defmethod update-now! ((this delayed-rand-vector)) (set-time! (-> this start-time)) (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) (set! (-> this value x) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) @@ -542,14 +542,14 @@ (-> this value) ) -(defmethod update-with-delay! delayed-rand-vector ((this delayed-rand-vector)) +(defmethod update-with-delay! ((this delayed-rand-vector)) (if (time-elapsed? (-> this start-time) (-> this timer)) (update-now! this) ) (-> this value) ) -(defmethod update-with-delay-or-reset! delayed-rand-vector ((this delayed-rand-vector)) +(defmethod update-with-delay-or-reset! ((this delayed-rand-vector)) (if (time-elapsed? (-> this start-time) (-> this timer)) (update-now! this) (vector-reset! (-> this value)) @@ -557,7 +557,7 @@ (-> this value) ) -(defmethod set-params! oscillating-vector ((this oscillating-vector) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod set-params! ((this oscillating-vector) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 (set! (-> this value quad) (-> arg0 quad)) @@ -575,7 +575,7 @@ (-> this value) ) -(defmethod update! oscillating-vector ((this oscillating-vector) (arg0 vector)) +(defmethod update! ((this oscillating-vector) (arg0 vector)) (with-pp (let ((v1-0 (new 'stack-no-clear 'vector))) (cond diff --git a/goal_src/jak2/engine/util/types-h.gc b/goal_src/jak2/engine/util/types-h.gc index 7db3bc4c209..ab8361575c4 100644 --- a/goal_src/jak2/engine/util/types-h.gc +++ b/goal_src/jak2/engine/util/types-h.gc @@ -10,9 +10,6 @@ ;; Appears to be unused. Possibly a particle ID? (deftype part-id (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (defmacro s.w! (location value) diff --git a/goal_src/jak2/kernel/dgo-h.gc b/goal_src/jak2/kernel/dgo-h.gc index 4e4edd4c478..331ec6f5939 100644 --- a/goal_src/jak2/kernel/dgo-h.gc +++ b/goal_src/jak2/kernel/dgo-h.gc @@ -14,22 +14,16 @@ see also load-dgo.gc's dgo-header. ;; DECOMP BEGINS (deftype dgo-entry (structure) - ((offset uint32 :offset-assert 0) - (length uint32 :offset-assert 4) + ((offset uint32) + (length uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype dgo-file (basic) - ((num-go-files uint32 :offset-assert 4) - (total-length uint32 :offset-assert 8) - (rsvd uint32 :offset-assert 12) - (data uint8 :dynamic :offset-assert 16) + ((num-go-files uint32) + (total-length uint32) + (rsvd uint32) + (data uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) diff --git a/goal_src/jak2/kernel/gcommon.gc b/goal_src/jak2/kernel/gcommon.gc index 8c3b8d42021..8f07d0cee01 100644 --- a/goal_src/jak2/kernel/gcommon.gc +++ b/goal_src/jak2/kernel/gcommon.gc @@ -182,12 +182,9 @@ (z float :offset 64 :size 32) (w float :offset 96 :size 32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) -(defmethod print vec4s ((this vec4s)) +(defmethod print ((this vec4s)) "Custom print for vec4s that prints the 4 values." (format #t "#" (-> this x) @@ -200,16 +197,13 @@ ;; vector: main 4-element floating point vector. (deftype vector (structure) - ((data float 4 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (w float :offset 12) - (quad uint128 :offset 0) + ((data float 4) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) + (z float :overlay-at (-> data 2)) + (w float :overlay-at (-> data 3)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (defmacro print128 (value &key (stream #t)) @@ -235,14 +229,14 @@ ;; bfloat: boxed float type. A floating point number with type information. ;; It's a heap allocated basic. (deftype bfloat (basic) - ((data float :offset-assert 4) + ((data float) ) :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -(defmethod print bfloat ((this bfloat)) +(defmethod print ((this bfloat)) (format #t "~f" (-> this data)) this ) @@ -251,7 +245,7 @@ ;; Type System ;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod asize-of type ((this type)) +(defmethod asize-of ((this type)) "Get the size in memory of a type. The value calculated here is wrong." (the-as int (logand (the-as uint #xfffffff0) (+ (* (-> this allocated-length) 4) 43))) ) @@ -339,7 +333,7 @@ (car arg0) ) -(defmethod length pair ((this pair)) +(defmethod length ((this pair)) "Get the length of a linked list." (local-vars (v0-0 int)) (cond @@ -359,7 +353,7 @@ v0-0 ) -(defmethod asize-of pair ((this pair)) +(defmethod asize-of ((this pair)) "Get the size in memory of a pair." (the-as int (-> pair size)) ) @@ -586,15 +580,12 @@ ;; however, as far as we've seen, nothing actually reads the stride. (deftype inline-array-class (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (_data uint8 :dynamic :offset 16) + ((length int32) + (allocated-length int32) + (_data uint8 :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) @@ -616,13 +607,13 @@ ) ) -(defmethod length inline-array-class ((this inline-array-class)) +(defmethod length ((this inline-array-class)) "Get the length of the inline-array-class. This is the length field, not how much storage there is" (-> this length) ) -(defmethod asize-of inline-array-class ((this inline-array-class)) +(defmethod asize-of ((this inline-array-class)) "Get the size in memory of an inline-array-class." (the-as int (+ (-> this type size) (* (-> this allocated-length) (the-as int (-> this type heap-base))))) ) @@ -663,7 +654,7 @@ ) ) -(defmethod print array ((this array)) +(defmethod print ((this array)) (format #t "#(") (cond ((type-type? (-> this content-type) integer) @@ -811,7 +802,7 @@ this ) -(defmethod inspect array ((this array)) +(defmethod inspect ((this array)) "Inspect an array" (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -887,12 +878,12 @@ this ) -(defmethod length array ((this array)) +(defmethod length ((this array)) "Get the length of an array" (-> this length) ) -(defmethod asize-of array ((this array)) +(defmethod asize-of ((this array)) "Get the size in memory of an array" (the-as int diff --git a/goal_src/jak2/kernel/gkernel-h.gc b/goal_src/jak2/kernel/gkernel-h.gc index 784d9869ce4..e6c2b303374 100644 --- a/goal_src/jak2/kernel/gkernel-h.gc +++ b/goal_src/jak2/kernel/gkernel-h.gc @@ -86,31 +86,25 @@ ;; The state of the kernel, containing the masks to allow/deny certain processes, ;; the currently running process, and the currently relocating process. (deftype kernel-context (basic) - ((prevent-from-run process-mask :offset-assert 4) - (require-for-run process-mask :offset-assert 8) - (allow-to-run process-mask :offset-assert 12) - (next-pid int32 :offset-assert 16) - (fast-stack-top pointer :offset-assert 20) - (current-process process :offset-assert 24) - (relocating-process basic :offset-assert 28) - (relocating-min int32 :offset-assert 32) - (relocating-max int32 :offset-assert 36) - (relocating-offset int32 :offset-assert 40) - (relocating-level level :offset-assert 44) - (low-memory-message symbol :offset-assert 48) - (login-object basic :offset-assert 52) + ((prevent-from-run process-mask) + (require-for-run process-mask) + (allow-to-run process-mask) + (next-pid int32) + (fast-stack-top pointer) + (current-process process) + (relocating-process basic) + (relocating-min int32) + (relocating-max int32) + (relocating-offset int32) + (relocating-level level) + (low-memory-message symbol) + (login-object basic) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) ;; The usual "time" type. (deftype time-frame (int64) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; times are stored in 300ths of a second. @@ -162,34 +156,32 @@ ;; Changing clock-ratio will make integral-frame-counter not count actual vsyncs (deftype clock (basic) - ((index int32 :offset-assert 4) ;; which clock we are, in *display* - (mask process-mask :offset-assert 8) ;; mask for ticking - (clock-ratio float :offset-assert 12) ;; how fast to run. 1.0 = realtime. - (accum float :offset-assert 16) ;; fractional time for frame-counter (time-frame units) - (integral-accum float :offset-assert 20) ;; fractional time for integral (time-frame untis) - (frame-counter time-frame :offset-assert 24) ;; how much time has gone by since reset (time-frame units) - (old-frame-counter time-frame :offset-assert 32) ;; the frame-counter on the last engine iteration - (integral-frame-counter uint64 :offset-assert 40) ;; how many vsyncs have gone by since reset - (old-integral-frame-counter uint64 :offset-assert 48) ;; the integral-frame-counter on the last engine iteration - (sparticle-data vector :inline :offset-assert 64) ;; sparticle timescale info - (seconds-per-frame float :offset-assert 80) ;; how many seconds (not time-frames) should go by in 1 vsync - (frames-per-second float :offset-assert 84) ;; inverse of above - (time-adjust-ratio float :offset-assert 88) ;; 1, if the game runs at 60fps NTSC with clock-ratio = 1. + ((index int32) ;; which clock we are, in *display* + (mask process-mask) ;; mask for ticking + (clock-ratio float) ;; how fast to run. 1.0 = realtime. + (accum float) ;; fractional time for frame-counter (time-frame units) + (integral-accum float) ;; fractional time for integral (time-frame untis) + (frame-counter time-frame) ;; how much time has gone by since reset (time-frame units) + (old-frame-counter time-frame) ;; the frame-counter on the last engine iteration + (integral-frame-counter uint64) ;; how many vsyncs have gone by since reset + (old-integral-frame-counter uint64) ;; the integral-frame-counter on the last engine iteration + (sparticle-data vector :inline) ;; sparticle timescale info + (seconds-per-frame float) ;; how many seconds (not time-frames) should go by in 1 vsync + (frames-per-second float) ;; inverse of above + (time-adjust-ratio float) ;; 1, if the game runs at 60fps NTSC with clock-ratio = 1. ) - :method-count-assert 15 - :size-assert #x5c - :flag-assert #xf0000005c (:methods - (new (symbol type int) _type_ 0) - (update-rates! (_type_ float) float 9) - (advance-by! (_type_ float) clock 10) - (tick! (_type_) clock 11) - (save! (_type_ (pointer uint64)) int 12) - (load! (_type_ (pointer uint64)) int 13) - (reset! (_type_) none 14) + (new (symbol type int) _type_) + (update-rates! (_type_ float) float) + (advance-by! (_type_ float) clock) + (tick! (_type_) clock) + (save! (_type_ (pointer uint64)) int) + (load! (_type_ (pointer uint64)) int) + (reset! (_type_) none) ) ) + (defmethod new clock ((allocation symbol) (type-to-make type) (arg0 int)) "Create a new clock and initialize to a non-zero time." (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) @@ -207,25 +199,23 @@ ;; The process types themselves are children of the process-tree type ;; Typically, each instance of a game object is a process. (deftype process-tree (basic) - ((name string :offset-assert 4) - (mask process-mask :offset-assert 8) - (clock clock :offset-assert 12) - (parent (pointer process-tree) :offset-assert 16) - (brother (pointer process-tree) :offset-assert 20) - (child (pointer process-tree) :offset-assert 24) - (ppointer (pointer process) :offset-assert 28) - (self process-tree :offset-assert 32) + ((name string) + (mask process-mask) + (clock clock) + (parent (pointer process-tree)) + (brother (pointer process-tree)) + (child (pointer process-tree)) + (ppointer (pointer process)) + (self process-tree) ) (:methods - (new (symbol type string) _type_ 0) - (activate (_type_ process-tree basic pointer) process-tree 9) - (deactivate (_type_) none 10) - (init-from-entity! (_type_ entity-actor) none 11) ;; todo check - (run-logic? (_type_) symbol 12) - (process-tree-method-13 () none 13) + (new (symbol type string) _type_) + (activate (_type_ process-tree basic pointer) process-tree) + (deactivate (_type_) none) + (init-from-entity! (_type_ entity-actor) none) ;; todo check + (run-logic? (_type_) symbol) + (process-tree-method-13 () none) ) - :size-assert #x24 - :method-count-assert 14 :no-runtime-type ) @@ -239,37 +229,31 @@ ;; this seems silly, but it has an advantage to reduce memory - typically threads suspend without a very deep call ;; stack, so the backup stack can be much, much smaller than a single large, shared execution stack. (deftype thread (basic) - ((name symbol :offset-assert 4) - (process process :offset-assert 8) - (previous thread :offset-assert 12) - (suspend-hook (function cpu-thread none) :offset-assert 16) ;; called by user to suspend - (resume-hook (function cpu-thread none) :offset-assert 20) ;; called by kernel to resume - (pc pointer :offset-assert 24) ;; pc (x86 rip) to resume to - (sp pointer :offset-assert 28) ;; stack pointer of thread - (stack-top pointer :offset-assert 32) ;; stack to execute on - (stack-size int32 :offset-assert 36) ;; size of _suspend_ stack + ((name symbol) + (process process) + (previous thread) + (suspend-hook (function cpu-thread none)) + (resume-hook (function cpu-thread none)) + (pc pointer) + (sp pointer) + (stack-top pointer) + (stack-size int32) ) - :method-count-assert 12 - :size-assert #x28 - :flag-assert #xc00000028 (:methods - (stack-size-set! (_type_ int) none 9) - (thread-suspend (_type_) none 10) - (thread-resume (_type_) none 11) + (stack-size-set! (_type_ int) none) + (thread-suspend (_type_) none) + (thread-resume (_type_) none) ) ) ;; additional information to context switch (deftype cpu-thread (thread) - ((rreg uint64 7 :offset-assert 40) ;; GPRs - (freg float 8 :offset-assert 96) ;; FPRs - (stack uint8 :dynamic :offset-assert 128) ;; backup stack (dynamically sized) + ((rreg uint64 7) + (freg float 8) + (stack uint8 :dynamic) ) - :method-count-assert 12 - :size-assert #x80 - :flag-assert #xc00000080 (:methods - (new (symbol type process symbol int pointer) _type_ 0) + (new (symbol type process symbol int pointer) _type_) ) ) @@ -277,51 +261,49 @@ ;; this can be used directly, or child types can be made. (deftype process (process-tree) ((self process :override) ;; ourselves! - (pool dead-pool ) ;; where to return us when we die - (status symbol :offset-assert 40) ;; used by kernel to track init/death - (pid int32 ) ;; globally unique ID, never reused for another - (main-thread cpu-thread :offset-assert 48) ;; suspendable main thread - (top-thread cpu-thread :offset-assert 52) ;; currently running thread - (entity entity-actor :offset-assert 56) ;; if we were spawned from an entity, that entity - (level level :offset-assert 60) ;; if we're associated with a level, that level - (state state :offset-assert 64) ;; current state, if we're in one - (next-state state :offset-assert 68) ;; set if we have a pending (go) - (trans-hook function :offset-assert 72) ;; function to run before resuming - (post-hook function :offset-assert 76) ;; function to run after suspending + (pool dead-pool) ;; where to return us when we die + (status symbol) ;; used by kernel to track init/death + (pid int32) ;; globally unique ID, never reused for another + (main-thread cpu-thread) ;; suspendable main thread + (top-thread cpu-thread) ;; currently running thread + (entity entity-actor) ;; if we were spawned from an entity, that entity + (level level) ;; if we're associated with a level, that level + (state state) ;; current state, if we're in one + (next-state state) ;; set if we have a pending (go) + (trans-hook function) ;; function to run before resuming + (post-hook function) ;; function to run after suspending ;; function to run if we receive an event - (event-hook (function process int symbol event-message-block object) :offset-assert 80) + (event-hook (function process int symbol event-message-block object)) ;; process heap size - (allocated-length int32 :offset-assert 84) + (allocated-length int32) ;; ?? (pad-unknown-0 uint32 2) ;; had to rename this unfortunately, there is a type that uses this same name "vehicle" ;; process heap - (heap-base pointer :offset-assert 96) - (heap-top pointer :offset-assert 100) - (heap-cur pointer :offset-assert 104) + (heap-base pointer) + (heap-top pointer) + (heap-cur pointer) ;; linked list of stack frames that have been created. ;; note that these aren't created on every function call, only ;; if the user explicitly creates a catch block or similar - (stack-frame-top stack-frame :offset-assert 108) + (stack-frame-top stack-frame) ;; list of engines this process is connected to - (connection-list connectable :inline :offset-assert 112) + (connection-list connectable :inline) ;; the process memory: contains child fields, then the process heap. - (stack uint8 :dynamic :offset-assert 128) + (stack uint8 :dynamic) ) (:methods - (new (symbol type string int) _type_ 0) + (new (symbol type string int) _type_) ) (:states dead-state empty-state) - :size-assert #x80 - :method-count-assert 14 :no-runtime-type ;; already defined by kscheme. Don't do it again. ) @@ -329,13 +311,10 @@ ;; are inactive. (deftype dead-pool (process-tree) () - :method-count-assert 16 - :size-assert #x24 - :flag-assert #x1000000024 (:methods - (new (symbol type int int string) _type_ 0) - (get-process (_type_ type int) process 14) - (return-process (_type_ process) none 15) + (new (symbol type int int string) _type_) + (get-process (_type_ type int) process) + (return-process (_type_ process) none) ) ) @@ -353,48 +332,42 @@ ;; - the dead-pool-heap-rec itself is never moved in memory, and it always points to some process, or #f. ;; (it is always safe to do (-> rec process pid) and see if it still points to your process) (deftype dead-pool-heap-rec (structure) - ((process process :offset-assert 0) - (prev dead-pool-heap-rec :offset-assert 4) - (next dead-pool-heap-rec :offset-assert 8) + ((process process) + (prev dead-pool-heap-rec) + (next dead-pool-heap-rec) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; the actual pool implementation (deftype dead-pool-heap (dead-pool) - ((allocated-length int32 :offset-assert 36) - (compact-time uint32 :offset-assert 40) - (compact-count-targ uint32 :offset-assert 44) - (compact-count uint32 :offset-assert 48) - (fill-percent float :offset-assert 52) - (first-gap dead-pool-heap-rec :offset-assert 56) - (first-shrink dead-pool-heap-rec :offset-assert 60) - (heap kheap :inline :offset-assert 64) - (alive-list dead-pool-heap-rec :inline :offset-assert 80) - (last dead-pool-heap-rec :offset 84) - (dead-list dead-pool-heap-rec :inline :offset-assert 92) - (process-list dead-pool-heap-rec :inline :dynamic :offset-assert 104) + ((allocated-length int32) + (compact-time uint32) + (compact-count-targ uint32) + (compact-count uint32) + (fill-percent float) + (first-gap dead-pool-heap-rec) + (first-shrink dead-pool-heap-rec) + (heap kheap :inline) + (alive-list dead-pool-heap-rec :inline) + (last dead-pool-heap-rec :overlay-at (-> alive-list prev)) + (dead-list dead-pool-heap-rec :inline) + (process-list dead-pool-heap-rec :inline :dynamic) ) - :method-count-assert 28 - :size-assert #x68 - :flag-assert #x1c00000068 (:methods - (new (symbol type string int int) _type_ 0) - (init (_type_ symbol int) none 16) - (compact (dead-pool-heap int) none 17) - (shrink-heap (dead-pool-heap process) dead-pool-heap 18) - (churn (dead-pool-heap int) none 19) - (memory-used (_type_) int 20) - (memory-total (_type_) int 21) - (memory-free (dead-pool-heap) int 22) - (compact-time (dead-pool-heap) uint 23) - (gap-size (dead-pool-heap dead-pool-heap-rec) int 24) - (gap-location (dead-pool-heap dead-pool-heap-rec) pointer 25) - (find-gap (dead-pool-heap dead-pool-heap-rec) dead-pool-heap-rec 26) - (find-gap-by-size (dead-pool-heap int) dead-pool-heap-rec 27) + (new (symbol type string int int) _type_) + (init (_type_ symbol int) none) + (compact (dead-pool-heap int) none) + (shrink-heap (dead-pool-heap process) dead-pool-heap) + (churn (dead-pool-heap int) none) + (memory-used (_type_) int) + (memory-total (_type_) int) + (memory-free (dead-pool-heap) int) + (compact-time (dead-pool-heap) uint) + (gap-size (dead-pool-heap dead-pool-heap-rec) int) + (gap-location (dead-pool-heap dead-pool-heap-rec) pointer) + (find-gap (dead-pool-heap dead-pool-heap-rec) dead-pool-heap-rec) + (find-gap-by-size (dead-pool-heap int) dead-pool-heap-rec) ) ) @@ -402,43 +375,34 @@ ;; at least for jak 1, these are only used internally by the kernel ;; "next" brings you "up" the stack (toward the caller) (deftype stack-frame (basic) - ((name symbol :offset 4) - (next stack-frame :offset 8) + ((name symbol) + (next stack-frame) ) - :size-assert #xc - :method-count-assert 9 - :flag-assert #x90000000c ) ;; a "catch" frame is a frame that can be "thrown" to. ;; the "throw" is a nonlocal control flow back to the state before the "catch" block. (deftype catch-frame (stack-frame) - ((sp int32 :offset-assert 12) - (ra int32 :offset-assert 16) - ; (freg float 6 :offset-assert 20) - ; (rreg uint128 8 :offset-assert 48) + ((sp int32) + (ra int32) + ; (freg float 6) + ; (rreg uint128 8) ;; In OpenGOAL, we swap a rreg for 4 more fregs. - (freg float 10 :offset-assert 20) ;; only use 8 - (rreg uint128 7) ;; only use 5 + (freg float 10) ;; only use 8 + (rreg uint128 7) ;; only use 5 ) - :method-count-assert 9 - :size-assert #xb0 - :flag-assert #x9000000b0 (:methods - (new (symbol type symbol function (pointer uint64)) object 0) + (new (symbol type symbol function (pointer uint64)) object) ) ) ;; a "protect" frame is a way to indicate there's a "exit" function that should ;; run if there's a "throw" or "abandon". (deftype protect-frame (stack-frame) - ((exit (function object) :offset-assert 12) + ((exit (function object)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type (function object)) protect-frame 0) + (new (symbol type (function object)) protect-frame) ) ) @@ -451,9 +415,6 @@ (pid int32 :offset 32 :size 32) ;; unique pid to check if it's the same process or not. (u64 uint64 :offset 0 :size 64) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (defmethod inspect handle ((this handle)) @@ -465,7 +426,6 @@ (format #t "~1Tpid: ~D~%" (-> this pid)) this ) - (defmacro handle->process (handle) "Convert a handle to a process. If the process no longer exists, returns #f." `(let ((the-handle (the-as handle ,handle))) @@ -507,7 +467,7 @@ `(ppointer->handle (process->ppointer (the-as process ,proc))) ) -(defmethod print handle ((this handle)) +(defmethod print ((this handle)) (if (nonzero? this) (format #t "#" (handle->process this) (-> this pid)) (format #t "#") @@ -525,25 +485,14 @@ ;; See gstate.gc for a lot more details on how this all works. ;; This type is just a container to hold those functions. (deftype state (protect-frame) - ((code function :offset-assert 16) - (trans (function object) :offset-assert 20) - (post function :offset-assert 24) - (enter function :offset-assert 28) - (event (function process int symbol event-message-block object) :offset-assert 32) + ((code function) + (trans (function object)) + (post function) + (enter function) + (event (function process int symbol event-message-block object)) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 (:methods - (new (symbol - type - symbol - function - (function object) - function - (function object) - (function process int symbol event-message-block object)) - _type_ 0) + (new (symbol type symbol function (function object) function (function object) (function process int symbol event-message-block object)) _type_) ) ) @@ -551,51 +500,43 @@ ;; in jak2, the events may be queued and sent at a later time, so the block ;; contains handles, to see if the to/from processes are still alive. (deftype event-message-block (structure) - ((to-handle handle :offset-assert 0) ;; who to send to - (to (pointer process) :offset 0) - (form-handle handle :offset-assert 8) ;; who is doing the sending - (from (pointer process) :offset 8) - (param uint64 6 :offset-assert 16) ;; the data being sent - (message symbol :offset-assert 64) ;; the message name - (num-params int32 :offset-assert 68) + ((to-handle handle) ;; who to send to + (to (pointer process) :overlay-at to-handle) + (form-handle handle) ;; who is doing the sending + (from (pointer process) :overlay-at form-handle) + (param uint64 6) ;; the data being sent + (message symbol) ;; the message name + (num-params int32) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) ;; a queue of messages. (deftype event-message-block-array (inline-array-class) - ((data event-message-block :inline :dynamic :offset-assert 16) + ((data event-message-block :inline :dynamic) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (send-all! (_type_) none 9) + (send-all! (_type_) none) ) ) + + (set! (-> event-message-block-array heap-base) (the-as uint 80)) ;; the type returned by the C Kernel, contains the result of a SQL Query. (deftype sql-result (basic) - ((len int32 :offset-assert 4) - (allocated-length uint32 :offset-assert 8) - (error symbol :offset-assert 12) - (data string :dynamic :offset-assert 16) + ((len int32) + (allocated-length uint32) + (error symbol) + (data string :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type uint) _type_ 0) + (new (symbol type uint) _type_) ) ) (define-extern sql-query (function string sql-result)) (defmethod new sql-result ((allocation symbol) (type-to-make type) (arg0 uint)) - "Allocate a new sql-result with enough room for arg0 entries in data." (let ((v0-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* arg0 4)))))) (set! (-> v0-0 allocated-length) arg0) (set! (-> v0-0 error) 'error) @@ -603,7 +544,7 @@ ) ) -(defmethod print sql-result ((this sql-result)) +(defmethod print ((this sql-result)) "Print a sql-result as an array of symbols." (format #t "#(~A" (-> this error)) (dotimes (s5-0 (-> this len)) diff --git a/goal_src/jak2/kernel/gkernel.gc b/goal_src/jak2/kernel/gkernel.gc index fa87bff01c6..8b500c91690 100644 --- a/goal_src/jak2/kernel/gkernel.gc +++ b/goal_src/jak2/kernel/gkernel.gc @@ -41,7 +41,7 @@ (define *last-loado-global-usage* 0) (define *last-loado-debug-usage* 0) -(defmethod relocate object ((this object) (arg0 int)) +(defmethod relocate ((this object) (arg0 int)) "Most general relocate method." this ) @@ -154,7 +154,7 @@ ;; Thread ;;;;;;;;;;;;; -(defmethod delete thread ((this thread)) +(defmethod delete ((this thread)) "Restore the previous thread as the top-thread." ;; make sure we aren't actually trying to delete the main thread. (when (= this (-> this process main-thread)) @@ -164,12 +164,12 @@ (none) ) -(defmethod print thread ((this thread)) +(defmethod print ((this thread)) (format #t "#<~A ~S of ~S pc: #x~X @ #x~X>" (-> this type) (-> this name) (-> this process name) (-> this pc) this) this ) -(defmethod stack-size-set! thread ((this thread) (arg0 int)) +(defmethod stack-size-set! ((this thread) (arg0 int)) "Modify the backup stack size of a thread. Must be called from the main thread, before any allocations have been done on the process heap." (let ((a2-0 (-> this process))) @@ -227,7 +227,7 @@ ) ) -(defmethod asize-of cpu-thread ((this cpu-thread)) +(defmethod asize-of ((this cpu-thread)) "Get the size in memory of a cpu-thread." (the-as int (+ (-> this type size) (-> this stack-size))) ) @@ -257,7 +257,7 @@ (define *master-mode* 'game) (define *pause-lock* #f) -(defmethod print process-tree ((this process-tree)) +(defmethod print ((this process-tree)) "Print a process tree." (format #t "#<~A ~S @ #x~X>" (-> this type) (-> this name) this) this @@ -278,7 +278,7 @@ ) ) -(defmethod inspect process-tree ((this process-tree)) +(defmethod inspect ((this process-tree)) "Inspect a process-tree" (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~S~%" (-> this name)) @@ -348,8 +348,8 @@ #f ) -(defmethod inspect process ((this process)) - "Inspect process and all objects on the heap.. Autogenerated proces inspects will eventually call this one." +(defmethod inspect ((this process)) + "Inspect process and all objects on the heap.. Autogenerated process inspects will eventually call this one." (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~S~%" (-> this name)) (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) @@ -386,12 +386,12 @@ this ) -(defmethod asize-of process ((this process)) +(defmethod asize-of ((this process)) "Get the size in memory of a process." (the-as int (+ (-> process size) (-> this allocated-length))) ) -(defmethod print process ((this process)) +(defmethod print ((this process)) "Print a process." ;; new: for jak 2, they don't print garbage stack/heap sizes when the process isn't @@ -579,7 +579,7 @@ ) ) -(defmethod thread-suspend cpu-thread ((unused cpu-thread)) +(defmethod thread-suspend ((unused cpu-thread)) "Suspend the thread and return to the kernel." (declare (asm-func none)) @@ -693,7 +693,7 @@ (none) ) -(defmethod thread-resume cpu-thread ((thread-to-resume cpu-thread)) +(defmethod thread-resume ((thread-to-resume cpu-thread)) "Resume a suspended thread. Call this from the kernel only. This is also used to start a thread initialized with set-to-run. As a result of MIPS/x86 differences, there is a hack for this." @@ -843,8 +843,8 @@ ) ) -;; decomp deviation -(defmethod get-process dead-pool ((this dead-pool) (arg0 type) (arg1 int)) +;; og:preserve-this decomp deviation +(defmethod get-process ((this dead-pool) (arg0 type) (arg1 int)) "Try to get a process from this dead pool. If it fails, try the debug dead pool and complain." ;; grab the first child @@ -885,7 +885,7 @@ ) ;; decomp deviation -(defmethod return-process dead-pool ((this dead-pool) (arg0 process)) +(defmethod return-process ((this dead-pool) (arg0 process)) "Return a process to the dead pool." (change-parent arg0 this) (none) @@ -907,7 +907,7 @@ ) ) -(defmethod init dead-pool-heap ((this dead-pool-heap) (arg0 symbol) (arg1 int)) +(defmethod init ((this dead-pool-heap) (arg0 symbol) (arg1 int)) "Initialize the heap." ;; setup the records in a linked list, all referring to *null-process*. @@ -952,7 +952,7 @@ (none) ) -(defmethod gap-location dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod gap-location ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) "Get the location of the first possible gap after the given record." (the-as pointer (if (-> arg0 process) @@ -964,7 +964,7 @@ ) ) -(defmethod gap-size dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod gap-size ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) "Get the size of the gap after the given record (possibly 0)" (cond ((-> arg0 process) @@ -989,7 +989,7 @@ ) ) -(defmethod find-gap dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod find-gap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) "Iterate through records, starting at the given one, and find the first one with a gap after it." (while (and (-> arg0 next) (zero? (gap-size this arg0))) (set! arg0 (-> arg0 next)) @@ -997,7 +997,7 @@ arg0 ) -(defmethod inspect dead-pool-heap ((this dead-pool-heap)) +(defmethod inspect ((this dead-pool-heap)) "Inspect a dead-pool heap, printing proccesses and gaps." (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) @@ -1044,12 +1044,12 @@ this ) -(defmethod asize-of dead-pool-heap ((this dead-pool-heap)) +(defmethod asize-of ((this dead-pool-heap)) "Get the size in memory of a dead-pool-heap." (the-as int (+ (-> this type size) (* 12 (-> this allocated-length)))) ) -(defmethod memory-used dead-pool-heap ((this dead-pool-heap)) +(defmethod memory-used ((this dead-pool-heap)) "Get the amount of used memory. Gaps in between processes are considered used." (if (-> this alive-list prev) (- (memory-total this) (gap-size this (-> this alive-list prev))) @@ -1057,12 +1057,12 @@ ) ) -(defmethod memory-total dead-pool-heap ((this dead-pool-heap)) +(defmethod memory-total ((this dead-pool-heap)) "Get the total size of the heap." (&- (-> this heap top) (the-as uint (-> this heap base))) ) -(defmethod memory-free dead-pool-heap ((this dead-pool-heap)) +(defmethod memory-free ((this dead-pool-heap)) "Get the amount of free memory. Does not include gaps in between processes." (let ((v1-0 (-> this heap top))) (if (-> this alive-list prev) @@ -1072,13 +1072,13 @@ ) ) -(defmethod compact-time dead-pool-heap ((this dead-pool-heap)) +(defmethod compact-time ((this dead-pool-heap)) "Not working, likely was supposed to return how long the compaction took." ;; never set. (-> this compact-time) ) -(defmethod find-gap-by-size dead-pool-heap ((this dead-pool-heap) (arg0 int)) +(defmethod find-gap-by-size ((this dead-pool-heap) (arg0 int)) "Find the first gap which is at least the given size." (let ((gp-0 (-> this first-gap))) (while (and gp-0 (< (gap-size this gp-0) arg0)) @@ -1088,7 +1088,7 @@ ) ) -(defmethod get-process dead-pool-heap ((this dead-pool-heap) (arg0 type) (arg1 int)) +(defmethod get-process ((this dead-pool-heap) (arg0 type) (arg1 int)) "Get a process!" (let ((s4-0 (-> this dead-list next)) (s3-0 (the-as process #f)) @@ -1158,7 +1158,7 @@ ) ;; decomp deviation -(defmethod return-process dead-pool-heap ((this dead-pool-heap) (proc process)) +(defmethod return-process ((this dead-pool-heap) (proc process)) "Return a process to a dead pool heap" ;; check we are returning to the correct pool @@ -1214,7 +1214,7 @@ ) ) -(defmethod shrink-heap dead-pool-heap ((this dead-pool-heap) (proc process)) +(defmethod shrink-heap ((this dead-pool-heap) (proc process)) "Shrink the heap of a process. This resizes the process heap to be the exact size it is currently using." (when proc @@ -1248,7 +1248,7 @@ ) ;; decomp deviation -(defmethod compact dead-pool-heap ((this dead-pool-heap) (arg0 int)) +(defmethod compact ((this dead-pool-heap) (arg0 int)) "Relocate processes to remove gaps and increase free memory." ;; skip if we're an empty dead-pool-heap @@ -1323,7 +1323,7 @@ (none) ) -(defmethod churn dead-pool-heap ((this dead-pool-heap) (arg0 int)) +(defmethod churn ((this dead-pool-heap) (arg0 int)) "Relocate processes to debug process relocation." (while (nonzero? arg0) (+! arg0 -1) @@ -1457,7 +1457,7 @@ #f ) -(defmethod run-logic? process ((this process)) +(defmethod run-logic? ((this process)) "Should this process be run by the kernel?" #t ) @@ -2126,7 +2126,7 @@ ) ;; decomp deviation -(defmethod activate process ((this process) (arg0 process-tree) (arg1 basic) (arg2 pointer)) +(defmethod activate ((this process) (arg0 process-tree) (arg1 basic) (arg2 pointer)) "Start a process!" ;; if we got the scratchpad stack, move to the fake scratchpad. (#when PC_PORT @@ -2316,7 +2316,7 @@ ) ) -(defmethod deactivate process-tree ((this process-tree)) +(defmethod deactivate ((this process-tree)) (none) ) @@ -2336,7 +2336,7 @@ (define entity-deactivate-handler (the-as (function process entity-actor none) nothing)) ;; decomp deviation -(defmethod deactivate process ((this process)) +(defmethod deactivate ((this process)) "Kill a process." (with-pp ;; only if we're not already dead diff --git a/goal_src/jak2/kernel/gstate.gc b/goal_src/jak2/kernel/gstate.gc index 4a01bd3e939..10257e16e5a 100644 --- a/goal_src/jak2/kernel/gstate.gc +++ b/goal_src/jak2/kernel/gstate.gc @@ -326,7 +326,7 @@ It type checks the arguments for the entry function. child ) -(defmethod print state ((this state)) +(defmethod print ((this state)) "Print a state." (format '#t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) this @@ -503,7 +503,7 @@ It type checks the arguments for the entry function. ) ) -(defmethod send-all! event-message-block-array ((this event-message-block-array)) +(defmethod send-all! ((this event-message-block-array)) "Send all pending messages. Will only do the send if both the sender and receiver are still alive." (dotimes (s5-0 (-> this length)) (let* ((a1-0 (-> this data s5-0)) diff --git a/goal_src/jak2/kernel/gstring.gc b/goal_src/jak2/kernel/gstring.gc index f64ccd6c36c..10a4b5b5bb3 100644 --- a/goal_src/jak2/kernel/gstring.gc +++ b/goal_src/jak2/kernel/gstring.gc @@ -7,8 +7,7 @@ ;; DECOMP BEGINS -(defmethod length string ((this string)) - "Get the length of a string. Like strlen" +(defmethod length ((this string)) (let ((v1-0 (-> this data))) (while (nonzero? (-> v1-0 0)) (nop!) @@ -20,8 +19,7 @@ ) ) -(defmethod asize-of string ((this string)) - "get the size in bytes of a string." +(defmethod asize-of ((this string)) (+ (-> this allocated-length) 1 (-> string size)) ) @@ -792,8 +790,11 @@ (kmemopen global "gstring-globals") (define *debug-draw-pauseable* #f) + (define *stdcon0* (new 'global 'string #x4000 (the-as string #f))) + (define *stdcon1* (new 'global 'string #x4000 (the-as string #f))) + (define *stdcon* *stdcon0*) ;; up from 256 bytes in jak 1 @@ -816,7 +817,3 @@ (define *pc-encoded-temp-string* (new 'global 'string 2048 (the-as string #f))) (kmemclose) - - - - diff --git a/goal_src/jak2/levels/atoll/ash1-course.gc b/goal_src/jak2/levels/atoll/ash1-course.gc index f66a2f733b0..2080bb0d100 100644 --- a/goal_src/jak2/levels/atoll/ash1-course.gc +++ b/goal_src/jak2/levels/atoll/ash1-course.gc @@ -8,19 +8,15 @@ ;; DECOMP BEGINS (deftype ashelin-battle (ashelin) - ((player-in-bounds-time time-frame :offset-assert 1040) + ((player-in-bounds-time time-frame) ) - :heap-base #x3a0 - :method-count-assert 252 - :size-assert #x418 - :flag-assert #xfc03a00418 (:methods - (set-frontline-dist! (_type_) none 251) + (set-frontline-dist! (_type_) none) ) ) -(defmethod set-frontline-dist! ashelin-battle ((this ashelin-battle)) +(defmethod set-frontline-dist! ((this ashelin-battle)) (let ((a0-1 *target*)) (when a0-1 (set! (-> this frontline w) diff --git a/goal_src/jak2/levels/atoll/atoll-obs.gc b/goal_src/jak2/levels/atoll/atoll-obs.gc index d93c6843333..6f309b865bd 100644 --- a/goal_src/jak2/levels/atoll/atoll-obs.gc +++ b/goal_src/jak2/levels/atoll/atoll-obs.gc @@ -8,24 +8,20 @@ ;; DECOMP BEGINS (deftype piston (process-focusable) - ((sound-trans vector :inline :offset-assert 208) - (init-height float :offset-assert 224) - (range-top float :offset-assert 228) - (range-bottom float :offset-assert 232) - (sound-time time-frame 2 :offset-assert 240) - (sync sync-eased :inline :offset-assert 256) - (piston-id int32 :offset-assert 300) - (looping-id sound-id :offset-assert 304) + ((sound-trans vector :inline) + (init-height float) + (range-top float) + (range-bottom float) + (sound-time time-frame 2) + (sync sync-eased :inline) + (piston-id int32) + (looping-id sound-id) ) - :heap-base #xc0 - :method-count-assert 31 - :size-assert #x134 - :flag-assert #x1f00c00134 - (:methods - (idle () _type_ :state 27) - (dormant-down () _type_ :state 28) - (dormant-up () _type_ :state 29) - (running () _type_ :state 30) + (:state-methods + idle + dormant-down + dormant-up + running ) ) @@ -115,14 +111,14 @@ ) ) -(defmethod deactivate piston ((this piston)) +(defmethod deactivate ((this piston)) (sound-stop (-> this looping-id)) ((method-of-type process-focusable deactivate) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! piston ((this piston) (arg0 entity-actor)) +(defmethod init-from-entity! ((this piston) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -218,18 +214,14 @@ This commonly includes things such as: ) (deftype turbine (process-drawable) - ((dest-height float :offset-assert 200) - (rise-height float :offset-assert 204) - (rotspeed float :offset-assert 208) - (risen symbol :offset-assert 212) + ((dest-height float) + (rise-height float) + (rotspeed float) + (risen symbol) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xd8 - :flag-assert #x16006000d8 - (:methods - (idle () _type_ :state 20) - (risen () _type_ :state 21) + (:state-methods + idle + risen ) ) @@ -287,7 +279,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! turbine ((this turbine) (arg0 entity-actor)) +(defmethod init-from-entity! ((this turbine) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -357,17 +349,13 @@ This commonly includes things such as: ) (deftype liftcat (process-drawable) - ((up-y float :offset-assert 200) - (down-y float :offset-assert 204) + ((up-y float) + (down-y float) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xd0 - :flag-assert #x17005000d0 - (:methods - (idle-up () _type_ :state 20) - (going-down () _type_ :state 21) - (idle-down () _type_ :state 22) + (:state-methods + idle-up + going-down + idle-down ) ) @@ -443,7 +431,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! liftcat ((this liftcat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this liftcat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -528,20 +516,16 @@ This commonly includes things such as: ) (deftype atollrotpipe (process-drawable) - ((root collide-shape-moving :override) - (smush smush-control :inline :offset 200) - (init-quat quaternion :inline :offset 240) - (rot-angle float :offset 256) - (shudder-angle float :offset 260) - (cycle-time float :offset 264) - (cycle-offset float :offset 268) + ((root collide-shape-moving :override) + (smush smush-control :inline :offset 200) + (init-quat quaternion :inline :offset 240) + (rot-angle float :offset 256) + (shudder-angle float :offset 260) + (cycle-time float :offset 264) + (cycle-offset float :offset 268) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x110 - :flag-assert #x1500900110 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -629,7 +613,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atollrotpipe ((this atollrotpipe) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atollrotpipe) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -694,21 +678,17 @@ This commonly includes things such as: ) (deftype slider (process-drawable) - ((root collide-shape-moving :override) - (path-pos float :offset-assert 200) - (sync sync-eased :inline :offset-assert 208) - (attack-id uint32 :offset-assert 252) - (sound-id uint32 :offset-assert 256) - (collide-off-timer uint64 :offset-assert 264) - (l-points vector 6 :inline :offset-assert 272) - (l-bolts lightning-control 4 :offset-assert 368) + ((root collide-shape-moving :override) + (path-pos float) + (sync sync-eased :inline) + (attack-id uint32) + (sound-id uint32) + (collide-off-timer uint64) + (l-points vector 6 :inline) + (l-bolts lightning-control 4) ) - :heap-base #x100 - :method-count-assert 21 - :size-assert #x180 - :flag-assert #x1501000180 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -799,17 +779,17 @@ This commonly includes things such as: ) ) -(defmethod run-logic? slider ((this slider)) +(defmethod run-logic? ((this slider)) #t ) -(defmethod deactivate slider ((this slider)) +(defmethod deactivate ((this slider)) (sound-stop (the-as sound-id (-> this sound-id))) (call-parent-method this) (none) ) -(defmethod relocate slider ((this slider) (arg0 int)) +(defmethod relocate ((this slider) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this l-bolts v1-0)) (&+! (-> this l-bolts v1-0) arg0) @@ -819,7 +799,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! slider ((this slider) (arg0 entity-actor)) +(defmethod init-from-entity! ((this slider) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -941,16 +921,12 @@ This commonly includes things such as: ) (deftype atoll-windmill (process-drawable) - ((sync sync-linear :inline :offset-assert 200) - (blade-normal vector :inline :offset-assert 224) - (orig-quat quaternion :inline :offset-assert 240) + ((sync sync-linear :inline) + (blade-normal vector :inline) + (orig-quat quaternion :inline) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #x100 - :flag-assert #x1500800100 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -985,7 +961,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-windmill ((this atoll-windmill) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atoll-windmill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1036,12 +1012,8 @@ This commonly includes things such as: (deftype atoll-valve (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1058,7 +1030,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-valve ((this atoll-valve) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atoll-valve) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1081,12 +1053,8 @@ This commonly includes things such as: (deftype atoll-hatch (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1103,7 +1071,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-hatch ((this atoll-hatch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atoll-hatch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1150,13 +1118,9 @@ This commonly includes things such as: (deftype atoll-hellcat (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (die-fast () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + die-fast + idle ) ) @@ -1174,7 +1138,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-hellcat ((this atoll-hellcat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atoll-hellcat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1223,12 +1187,8 @@ This commonly includes things such as: (deftype atoll-mar-symbol (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1239,7 +1199,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-mar-symbol ((this atoll-mar-symbol) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atoll-mar-symbol) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/atoll/atoll-part.gc b/goal_src/jak2/levels/atoll/atoll-part.gc index 6384a02fbc8..db1eeb6238b 100644 --- a/goal_src/jak2/levels/atoll/atoll-part.gc +++ b/goal_src/jak2/levels/atoll/atoll-part.gc @@ -9,10 +9,6 @@ (deftype atoll-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/atoll/atoll-tank.gc b/goal_src/jak2/levels/atoll/atoll-tank.gc index 7bb7507d9e5..e7cbdd365ad 100644 --- a/goal_src/jak2/levels/atoll/atoll-tank.gc +++ b/goal_src/jak2/levels/atoll/atoll-tank.gc @@ -1581,21 +1581,17 @@ ) (deftype atoll-tank (process-focusable) - ((is-master? symbol :offset-assert 204) - (aftermath-part sparticle-launch-control :offset-assert 208) + ((is-master? symbol) + (aftermath-part sparticle-launch-control) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd4 - :flag-assert #x1d006000d4 - (:methods - (dormant () _type_ :state 27) - (idle () _type_ :state 28) + (:state-methods + dormant + idle ) ) -(defmethod deactivate atoll-tank ((this atoll-tank)) +(defmethod deactivate ((this atoll-tank)) (if (nonzero? (-> this aftermath-part)) (kill-and-free-particles (-> this aftermath-part)) ) @@ -1604,18 +1600,18 @@ ) ;; WARN: Return type mismatch process-focusable vs atoll-tank. -(defmethod relocate atoll-tank ((this atoll-tank) (arg0 int)) +(defmethod relocate ((this atoll-tank) (arg0 int)) (if (nonzero? (-> this aftermath-part)) (&+! (-> this aftermath-part) arg0) ) (the-as atoll-tank ((method-of-type process-focusable relocate) this arg0)) ) -(defmethod run-logic? atoll-tank ((this atoll-tank)) +(defmethod run-logic? ((this atoll-tank)) #t ) -(defmethod get-trans atoll-tank ((this atoll-tank) (arg0 int)) +(defmethod get-trans ((this atoll-tank) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (let ((v1-0 (-> this root))) (case arg0 @@ -1698,7 +1694,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-tank ((this atoll-tank) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atoll-tank) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/atoll/juicer.gc b/goal_src/jak2/levels/atoll/juicer.gc index a86e9a68ce1..f4aa08d6ccf 100644 --- a/goal_src/jak2/levels/atoll/juicer.gc +++ b/goal_src/jak2/levels/atoll/juicer.gc @@ -108,17 +108,13 @@ ) (deftype juicer-shot (projectile) - ((lightning lightning-control 5 :offset-assert 472) - (victim handle :offset-assert 496) + ((lightning lightning-control 5) + (victim handle) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x1f8 - :flag-assert #x28018001f8 ) -(defmethod event-handler! juicer-shot ((this juicer-shot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod event-handler! ((this juicer-shot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Multiplex the projectile's event processing, called by [[projectile-event-handler]]" (case arg2 (('reset) @@ -149,7 +145,7 @@ ) ) -(defmethod deal-damage! juicer-shot ((this juicer-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! ((this juicer-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((a0-2 (if (type? arg0 process-focusable) arg0 @@ -163,7 +159,7 @@ ) ) -(defmethod spawn-impact-particles juicer-shot ((this juicer-shot)) +(defmethod spawn-impact-particles ((this juicer-shot)) "Spawns associated particles with the projectile if applicable" (let ((s5-0 (-> this starting-pos)) (s4-0 (-> this root trans)) @@ -206,7 +202,7 @@ (none) ) -(defmethod spawn-shell-particles juicer-shot ((this juicer-shot)) +(defmethod spawn-shell-particles ((this juicer-shot)) "TODO - confirm" (spawn-impact-particles this) (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) @@ -248,7 +244,7 @@ (none) ) -(defmethod made-impact? juicer-shot ((this juicer-shot)) +(defmethod made-impact? ((this juicer-shot)) "TODO - queries the collision cache, return true/false" (let ((gp-0 (-> this root)) (s5-0 (new 'stack-no-clear 'collide-query)) @@ -292,7 +288,7 @@ (none) ) -(defmethod init-proj-collision! juicer-shot ((this juicer-shot)) +(defmethod init-proj-collision! ((this juicer-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -338,7 +334,7 @@ ) ;; WARN: Return type mismatch projectile vs juicer-shot. -(defmethod relocate juicer-shot ((this juicer-shot) (arg0 int)) +(defmethod relocate ((this juicer-shot) (arg0 int)) (dotimes (v1-0 5) (if (nonzero? (-> this lightning v1-0)) (&+! (-> this lightning v1-0) arg0) @@ -347,7 +343,7 @@ (the-as juicer-shot ((method-of-type projectile relocate) this arg0)) ) -(defmethod init-proj-settings! juicer-shot ((this juicer-shot)) +(defmethod init-proj-settings! ((this juicer-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (logior! (-> this options) (projectile-options proj-options-8000)) (set! (-> this attack-mode) 'eco-yellow) @@ -396,63 +392,55 @@ ) (deftype juicer-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype juicer-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (idle-anim int32 3 :offset-assert 8) - (patrol-anim int32 2 :offset-assert 20) - (notice-anim int32 2 :offset-assert 28) - (charge-anim int32 2 :offset-assert 36) - (knocked-anim int32 2 :offset-assert 44) - (celebrate-anim int32 2 :offset-assert 52) - (yellow-hit-anim int32 4 :offset-assert 60) - (blue-hit-anim int32 6 :offset-assert 76) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (idle-anim int32 3) + (patrol-anim int32 2) + (notice-anim int32 2) + (charge-anim int32 2) + (knocked-anim int32 2) + (celebrate-anim int32 2) + (yellow-hit-anim int32 4) + (blue-hit-anim int32 6) ) - :method-count-assert 9 - :size-assert #x64 - :flag-assert #x900000064 ) (deftype juicer (nav-enemy) - ((los los-control :inline :offset-assert 608) - (intro-path path-control :offset-assert 756) - (joint joint-mod :offset-assert 760) - (joint-enable symbol :offset-assert 764) - (joint-blend float :offset-assert 768) - (last-fire-time time-frame :offset-assert 776) - (heading basic :offset-assert 784) - (move-angle float :offset-assert 788) - (torso-track-player basic :offset-assert 792) - (circle-backward? symbol :offset 800) - (using-turn-anim symbol :offset-assert 804) - (hit-focus enemy-focus :offset-assert 808) - (ambush-path-pt int8 :offset-assert 812) - (charge-index int8 :offset-assert 813) - (hostile-dest vector :inline :offset-assert 816) - (focus-is-up symbol :offset-assert 832) - (current-projectile handle :offset-assert 840) + ((los los-control :inline) + (intro-path path-control) + (joint joint-mod) + (joint-enable symbol) + (joint-blend float) + (last-fire-time time-frame) + (heading basic) + (move-angle float) + (torso-track-player basic) + (circle-backward? symbol :offset 800) + (using-turn-anim symbol) + (hit-focus enemy-focus) + (ambush-path-pt int8) + (charge-index int8) + (hostile-dest vector :inline) + (focus-is-up symbol) + (current-projectile handle) ) - :heap-base #x2d0 - :method-count-assert 185 - :size-assert #x350 - :flag-assert #xb902d00350 + (:state-methods + ambush-cont + attack + ) (:methods - (ambush-cont () _type_ :state 178) - (attack () _type_ :state 179) - (juicer-method-180 (_type_) none 180) - (fire-projectile (_type_ process-focusable uint) none 181) - (juicer-method-182 (_type_) none 182) - (juicer-method-183 (_type_) none 183) - (juicer-method-184 (_type_ symbol) none 184) + (juicer-method-180 (_type_) none) + (fire-projectile (_type_ process-focusable uint) none) + (juicer-method-182 (_type_) none) + (juicer-method-183 (_type_) none) + (juicer-method-184 (_type_ symbol) none) ) ) @@ -648,7 +636,7 @@ (set! (-> *juicer-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod juicer-method-182 juicer ((this juicer)) +(defmethod juicer-method-182 ((this juicer)) (let ((s3-0 (handle->process (-> this focus handle)))) (when s3-0 (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4))) @@ -670,7 +658,7 @@ (none) ) -(defmethod juicer-method-183 juicer ((this juicer)) +(defmethod juicer-method-183 ((this juicer)) (cond ((-> this torso-track-player) (set! (-> this joint-enable) #t) @@ -689,7 +677,7 @@ (none) ) -(defmethod track-target! juicer ((this juicer)) +(defmethod track-target! ((this juicer)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -703,7 +691,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod juicer-method-180 juicer ((this juicer)) +(defmethod juicer-method-180 ((this juicer)) (if (and (= (-> this incoming knocked-type) (knocked-type knocked-type-4)) (not (and (-> this next-state) (let ((v1-6 (-> this next-state name))) (or (= v1-6 'knocked) (= v1-6 'jump) (= v1-6 'jump-land)) @@ -723,7 +711,7 @@ (none) ) -(defmethod general-event-handler juicer ((this juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -887,7 +875,7 @@ ) ) -(defmethod enemy-method-84 juicer ((this juicer) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 ((this juicer) (arg0 enemy-jump-info)) (cond ((logtest? (-> this fact enemy-options) (enemy-option user8)) (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos)) @@ -903,7 +891,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 juicer ((this juicer)) +(defmethod enemy-method-93 ((this juicer)) (case (-> this jump-why) ((2) (go (method-of-object this ambush-cont)) @@ -1198,7 +1186,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod fire-projectile juicer ((this juicer) (arg0 process-focusable) (arg1 uint)) +(defmethod fire-projectile ((this juicer) (arg0 process-focusable) (arg1 uint)) (with-pp (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 20))) (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) @@ -1514,7 +1502,7 @@ ) ) -(defmethod enemy-method-77 juicer ((this juicer) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this juicer) (arg0 (pointer float))) (local-vars (a2-2 int)) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) @@ -1579,7 +1567,7 @@ #t ) -(defmethod enemy-method-78 juicer ((this juicer) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this juicer) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -1622,7 +1610,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod juicer-method-184 juicer ((this juicer) (arg0 symbol)) +(defmethod juicer-method-184 ((this juicer) (arg0 symbol)) (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) @@ -1637,7 +1625,7 @@ ) ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 juicer ((this juicer) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this juicer) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) (the-as symbol (if (t9-0 this arg0 arg1) (set-dst-proc! (-> this los) (-> this focus handle)) @@ -1646,7 +1634,7 @@ ) ) -(defmethod init-enemy-collision! juicer ((this juicer)) +(defmethod init-enemy-collision! ((this juicer)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1738,7 +1726,7 @@ (none) ) -(defmethod relocate juicer ((this juicer) (arg0 int)) +(defmethod relocate ((this juicer) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) ) @@ -1748,7 +1736,7 @@ (call-parent-method this arg0) ) -(defmethod init-enemy! juicer ((this juicer)) +(defmethod init-enemy! ((this juicer)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/atoll/sig0-course.gc b/goal_src/jak2/levels/atoll/sig0-course.gc index 85eaca13e9e..4f96dad24f0 100644 --- a/goal_src/jak2/levels/atoll/sig0-course.gc +++ b/goal_src/jak2/levels/atoll/sig0-course.gc @@ -10,31 +10,24 @@ ;; DECOMP BEGINS (deftype sig-atoll (sig) - ((sig-course sig0-course :offset 652) + ((sig-course sig0-course :overlay-at course) ) - :heap-base #x3b0 - :method-count-assert 260 - :size-assert #x430 - :flag-assert #x10403b00430 (:methods - (sig-atoll-method-259 (_type_) symbol 259) + (sig-atoll-method-259 (_type_) symbol) ) ) (deftype sig0-course (bot-course) - ((liftcat-speech-index int8 :offset-assert 48) - (first-liftcat-speeches (array int16) :offset-assert 52) - (second-liftcat-speeches (array int16) :offset-assert 56) + ((liftcat-speech-index int8) + (first-liftcat-speeches (array int16)) + (second-liftcat-speeches (array int16)) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? sig-atoll ((this sig-atoll)) +(defmethod alive? ((this sig-atoll)) (let ((t9-0 (method-of-type bot alive?))) (the-as symbol (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'waiting-far) @@ -50,7 +43,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sig-atoll ((this sig-atoll)) +(defmethod go-idle ((this sig-atoll)) (cond ((task-node-closed? (game-task-node atoll-sig-resolution)) (cleanup-for-death this) @@ -64,7 +57,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod sig-atoll-method-259 sig-atoll ((this sig-atoll)) +(defmethod sig-atoll-method-259 ((this sig-atoll)) (let ((v1-0 *target*)) (the-as symbol (and v1-0 (not (focus-test? v1-0 edge-grab)) diff --git a/goal_src/jak2/levels/atoll/sniper.gc b/goal_src/jak2/levels/atoll/sniper.gc index 2b8519b184a..027b3b0c030 100644 --- a/goal_src/jak2/levels/atoll/sniper.gc +++ b/goal_src/jak2/levels/atoll/sniper.gc @@ -8,12 +8,8 @@ ;; DECOMP BEGINS (deftype sniper (spyder) - ((next-pick-time time-frame :offset-assert 944) + ((next-pick-time time-frame) ) - :heap-base #x340 - :method-count-assert 186 - :size-assert #x3b8 - :flag-assert #xba034003b8 ) @@ -192,13 +188,13 @@ (set! (-> *sniper-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod run-logic? sniper ((this sniper)) +(defmethod run-logic? ((this sniper)) (let ((f0-0 573440.0)) (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> this root trans) (camera-pos))) ) ) -(defmethod enemy-method-129 sniper ((this sniper)) +(defmethod enemy-method-129 ((this sniper)) (let ((a0-1 *target*)) (if a0-1 (set! (-> this focus handle) (process->handle a0-1)) @@ -214,7 +210,7 @@ (none) ) -(defmethod nav-enemy-method-156 sniper ((this sniper)) +(defmethod nav-enemy-method-156 ((this sniper)) (let ((s4-0 (-> this path curve num-cverts))) (if (<= s4-0 0) (go process-drawable-art-error "no path") @@ -281,7 +277,7 @@ ) ) -(defmethod init-enemy! sniper ((this sniper)) +(defmethod init-enemy! ((this sniper)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type spyder init-enemy!))) (t9-0 this) @@ -294,7 +290,7 @@ (none) ) -(defmethod init-enemy-collision! sniper ((this sniper)) +(defmethod init-enemy-collision! ((this sniper)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((t9-0 (method-of-type spyder init-enemy-collision!))) (t9-0 this) @@ -311,7 +307,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sniper ((this sniper)) +(defmethod go-idle ((this sniper)) (cond ((script-eval (res-lump-struct (-> this entity) 'on-activate pair)) (cleanup-for-death this) diff --git a/goal_src/jak2/levels/castle/boss/casboss-part.gc b/goal_src/jak2/levels/castle/boss/casboss-part.gc index dd4e7d9ff72..b55e60377b3 100644 --- a/goal_src/jak2/levels/castle/boss/casboss-part.gc +++ b/goal_src/jak2/levels/castle/boss/casboss-part.gc @@ -9,19 +9,11 @@ (deftype casboss-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) (deftype cascity-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/castle/boss/castle-baron.gc b/goal_src/jak2/levels/castle/boss/castle-baron.gc index 436bcbee3c3..956b7843e0d 100644 --- a/goal_src/jak2/levels/castle/boss/castle-baron.gc +++ b/goal_src/jak2/levels/castle/boss/castle-baron.gc @@ -9,12 +9,8 @@ (deftype cboss-tractor (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -40,7 +36,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cboss-tractor ((this cboss-tractor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cboss-tractor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -64,12 +60,8 @@ This commonly includes things such as: ) (deftype cboss-elevator (elevator) - ((sound-id sound-id :offset-assert 368) + ((sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 49 - :size-assert #x174 - :flag-assert #x3101000174 ) @@ -103,18 +95,18 @@ This commonly includes things such as: ) ) -(defmethod get-art-group cboss-elevator ((this cboss-elevator)) +(defmethod get-art-group ((this cboss-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-cboss-elevator" (the-as (pointer uint32) #f)) ) -(defmethod deactivate cboss-elevator ((this cboss-elevator)) +(defmethod deactivate ((this cboss-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) ) -(defmethod init-plat! cboss-elevator ((this cboss-elevator)) +(defmethod init-plat! ((this cboss-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this sound-id) (new-sound-id)) @@ -122,7 +114,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod move-between-points cboss-elevator ((this cboss-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this cboss-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -141,7 +133,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod commited-to-ride? cboss-elevator ((this cboss-elevator)) +(defmethod commited-to-ride? ((this cboss-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) @@ -161,7 +153,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-plat-collision! cboss-elevator ((this cboss-elevator)) +(defmethod init-plat-collision! ((this cboss-elevator)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -197,56 +189,50 @@ For example for an elevator pre-compute the distance between the first and last ) (deftype krew-boss-clone (nav-enemy) - ((old-y-deg float :offset-assert 604) - (diff-angle degrees :offset-assert 608) - (hit-target symbol :offset-assert 612) - (lightning lightning-control 4 :offset-assert 616) - (wiggle-time time-frame :offset-assert 632) - (wiggle-angle degrees :offset-assert 640) - (delta-wiggle-angle degrees :offset-assert 644) - (wiggle-factor float :offset-assert 648) - (id sound-id :offset-assert 652) + ((old-y-deg float) + (diff-angle degrees) + (hit-target symbol) + (lightning lightning-control 4) + (wiggle-time time-frame) + (wiggle-angle degrees) + (delta-wiggle-angle degrees) + (wiggle-factor float) + (id sound-id) ) - :heap-base #x210 - :method-count-assert 181 - :size-assert #x290 - :flag-assert #xb502100290 + (:state-methods + spawning + ) (:methods - (spawning () _type_ :state 178) - (krew-boss-clone-method-179 (_type_ vector) none 179) - (krew-boss-clone-method-180 (_type_) none 180) + (krew-boss-clone-method-179 (_type_ vector) none) + (krew-boss-clone-method-180 (_type_) none) ) ) (deftype krew-boss (nav-enemy) - ((task-timeout time-frame :offset-assert 608) - (movie-handle handle :offset-assert 616) - (clones handle 8 :offset-assert 624) - (last-closest-spawn int32 :offset-assert 688) - (next-clone-side int32 :offset-assert 692) - (next-shooting-frame int32 :offset-assert 696) - (old-y-deg float :offset-assert 700) - (diff-angle degrees :offset-assert 704) - (hit-target symbol :offset-assert 708) - (floating symbol :offset-assert 712) - (next-path-point int32 :offset-assert 716) - (num-clones-to-spawn int32 :offset-assert 720) - (gameplay-pass int32 :offset-assert 724) - (hud-handle handle :offset-assert 728) - (channel uint8 :offset-assert 736) - (id sound-id :offset-assert 740) - (play-clone-wave-speech symbol :offset-assert 744) - (last-damage-time time-frame :offset-assert 752) - (spawn-charge symbol :offset-assert 760) + ((task-timeout time-frame) + (movie-handle handle) + (clones handle 8) + (last-closest-spawn int32) + (next-clone-side int32) + (next-shooting-frame int32) + (old-y-deg float) + (diff-angle degrees) + (hit-target symbol) + (floating symbol) + (next-path-point int32) + (num-clones-to-spawn int32) + (gameplay-pass int32) + (hud-handle handle) + (channel uint8) + (id sound-id) + (play-clone-wave-speech symbol) + (last-damage-time time-frame) + (spawn-charge symbol) ) - :heap-base #x280 - :method-count-assert 180 - :size-assert #x2fc - :flag-assert #xb4028002fc - (:methods - (hidden () _type_ :state 178) - (play-intro () _type_ :state 179) + (:state-methods + hidden + play-intro ) ) @@ -715,7 +701,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> *krew-boss-clone-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod track-target! krew-boss-clone ((this krew-boss-clone)) +(defmethod track-target! ((this krew-boss-clone)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -791,7 +777,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod general-event-handler krew-boss-clone ((this krew-boss-clone) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this krew-boss-clone) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (with-pp @@ -917,7 +903,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod enemy-method-77 krew-boss-clone ((this krew-boss-clone) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this krew-boss-clone) (arg0 (pointer float))) (with-pp (ja-channel-push! 1 0) (cond @@ -968,7 +954,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod enemy-method-78 krew-boss-clone ((this krew-boss-clone) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this krew-boss-clone) (arg0 (pointer float))) (when (> (-> this hit-points) 0) (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) @@ -997,7 +983,7 @@ For example for an elevator pre-compute the distance between the first and last #t ) -(defmethod enemy-method-79 krew-boss-clone ((this krew-boss-clone) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this krew-boss-clone) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond @@ -1031,7 +1017,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod krew-boss-clone-method-180 krew-boss-clone ((this krew-boss-clone)) +(defmethod krew-boss-clone-method-180 ((this krew-boss-clone)) (let* ((f0-0 (rand-vu-float-range 0.0 1.0)) (f1-1 (+ 1.0 (* 2.0 f0-0))) (f2-2 f1-1) @@ -1045,7 +1031,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod krew-boss-clone-method-179 krew-boss-clone ((this krew-boss-clone) (arg0 vector)) +(defmethod krew-boss-clone-method-179 ((this krew-boss-clone) (arg0 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1084,7 +1070,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod go-stare2 krew-boss-clone ((this krew-boss-clone)) +(defmethod go-stare2 ((this krew-boss-clone)) (go (method-of-object this hostile)) ) @@ -1175,7 +1161,7 @@ For example for an elevator pre-compute the distance between the first and last :post enemy-simple-post ) -(defmethod init-enemy-collision! krew-boss-clone ((this krew-boss-clone)) +(defmethod init-enemy-collision! ((this krew-boss-clone)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1240,13 +1226,13 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod coin-flip? krew-boss-clone ((this krew-boss-clone)) +(defmethod coin-flip? ((this krew-boss-clone)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch nav-enemy vs krew-boss-clone. -(defmethod relocate krew-boss-clone ((this krew-boss-clone) (arg0 int)) +(defmethod relocate ((this krew-boss-clone) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this lightning v1-0)) (&+! (-> this lightning v1-0) arg0) @@ -1256,7 +1242,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: Return type mismatch object vs none. -(defmethod init-enemy! krew-boss-clone ((this krew-boss-clone)) +(defmethod init-enemy! ((this krew-boss-clone)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1340,10 +1326,6 @@ For example for an elevator pre-compute the distance between the first and last (deftype krew-boss-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) @@ -1353,7 +1335,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod init-proj-settings! krew-boss-shot ((this krew-boss-shot)) +(defmethod init-proj-settings! ((this krew-boss-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (call-parent-method this) (set! (-> this move) krew-boss-shot-move) @@ -1362,7 +1344,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod play-impact-sound krew-boss-shot ((this krew-boss-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this krew-boss-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -1379,14 +1361,10 @@ For example for an elevator pre-compute the distance between the first and last (deftype hud-krew-boss (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) -(defmethod draw hud-krew-boss ((this hud-krew-boss)) +(defmethod draw ((this hud-krew-boss)) (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) -96 0) @@ -1433,7 +1411,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod update-values hud-krew-boss ((this hud-krew-boss)) +(defmethod update-values ((this hud-krew-boss)) (set! (-> this values 0 target) (+ (-> (the-as krew-boss (-> this parent 0)) gameplay-pass) -1)) (let ((v1-7 (/ (-> (the-as krew-boss (-> this parent 0)) hit-points) (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) @@ -1464,7 +1442,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod init-callback hud-krew-boss ((this hud-krew-boss)) +(defmethod init-callback ((this hud-krew-boss)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -1837,7 +1815,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod init-enemy! krew-boss ((this krew-boss)) +(defmethod init-enemy! ((this krew-boss)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1891,7 +1869,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle krew-boss ((this krew-boss)) +(defmethod go-idle ((this krew-boss)) (cond ((task-node-closed? (game-task-node castle-boss-resolution)) (cleanup-for-death this) @@ -1956,7 +1934,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: disable def twice: 22. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler krew-boss ((this krew-boss) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this krew-boss) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -1992,11 +1970,11 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod enemy-method-102 krew-boss ((this krew-boss)) +(defmethod enemy-method-102 ((this krew-boss)) #f ) -(defmethod enemy-method-77 krew-boss ((this krew-boss) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this krew-boss) (arg0 (pointer float))) (with-pp (ja-channel-push! 1 0) (cond @@ -2034,7 +2012,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod enemy-method-78 krew-boss ((this krew-boss) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this krew-boss) (arg0 (pointer float))) (cond ((<= (-> this hit-points) 0) #f @@ -2068,7 +2046,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod enemy-method-81 krew-boss ((this krew-boss)) +(defmethod enemy-method-81 ((this krew-boss)) #f ) @@ -2137,7 +2115,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod init-enemy-collision! krew-boss ((this krew-boss)) +(defmethod init-enemy-collision! ((this krew-boss)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -2195,7 +2173,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod coin-flip? krew-boss ((this krew-boss)) +(defmethod coin-flip? ((this krew-boss)) "@returns The result of a 50/50 RNG roll" #f ) @@ -2565,7 +2543,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod damage-amount-from-attack krew-boss ((this krew-boss) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this krew-boss) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let ((v1-0 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg1))) (cond @@ -2590,7 +2568,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod nav-enemy-method-142 krew-boss ((this krew-boss) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this krew-boss) (arg0 nav-control)) (with-pp (cond ((not (logtest? (-> this nav flags) (nav-control-flag update-heading-from-facing))) @@ -2936,7 +2914,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod kill-prefer-falling krew-boss ((this krew-boss)) +(defmethod kill-prefer-falling ((this krew-boss)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (when (handle->process (-> this hud-handle)) (send-event (-> this hud-handle process 0) 'hide-and-die) diff --git a/goal_src/jak2/levels/castle/castle-obs.gc b/goal_src/jak2/levels/castle/castle-obs.gc index 6a7f09612fa..9b033916513 100644 --- a/goal_src/jak2/levels/castle/castle-obs.gc +++ b/goal_src/jak2/levels/castle/castle-obs.gc @@ -10,21 +10,17 @@ (define *cas-conveyor-room-id* 0) (deftype cas-conveyor (conveyor) - ((actor-group (pointer actor-group) :offset-assert 256) - (actor-group-count int32 :offset-assert 260) - (texture-anim-index uint32 :offset-assert 264) - (my-id int32 :offset-assert 268) - (sound-id sound-id :offset-assert 272) - (target-speed float :offset-assert 276) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (texture-anim-index uint32) + (my-id int32) + (sound-id sound-id) + (target-speed float) ) - :heap-base #xa0 - :method-count-assert 28 - :size-assert #x118 - :flag-assert #x1c00a00118 ) -(defmethod init! cas-conveyor ((this cas-conveyor)) +(defmethod init! ((this cas-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (let ((t9-0 (method-of-type conveyor init!))) (t9-0 this) @@ -41,7 +37,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-conveyor ((this cas-conveyor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-conveyor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -77,7 +73,7 @@ This commonly includes things such as: (none) ) -(defmethod deactivate cas-conveyor ((this cas-conveyor)) +(defmethod deactivate ((this cas-conveyor)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -147,24 +143,20 @@ This commonly includes things such as: ) (deftype cas-conveyor-switch (process-focusable) - ((actor-group (pointer actor-group) :offset-assert 204) - (actor-group-count int32 :offset-assert 208) - (incoming-attack-id uint32 :offset-assert 212) - (quat0 quaternion :inline :offset-assert 224) - (quat180 quaternion :inline :offset-assert 240) - (red-pos vector :inline :offset-assert 256) - (blue-pos vector :inline :offset-assert 272) - (track-flag symbol :offset-assert 288) - (lightning-timer time-frame :offset-assert 296) - (speed float :offset-assert 304) - (target-speed float :offset-assert 308) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (incoming-attack-id uint32) + (quat0 quaternion :inline) + (quat180 quaternion :inline) + (red-pos vector :inline) + (blue-pos vector :inline) + (track-flag symbol) + (lightning-timer time-frame) + (speed float) + (target-speed float) ) - :heap-base #xc0 - :method-count-assert 28 - :size-assert #x138 - :flag-assert #x1c00c00138 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) @@ -350,7 +342,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-conveyor-switch ((this cas-conveyor-switch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-conveyor-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -419,16 +411,12 @@ This commonly includes things such as: ) (deftype cas-electric-fence (process-focusable) - ((next-spawn-time time-frame :offset-assert 208) - (stop symbol :offset-assert 216) + ((next-spawn-time time-frame) + (stop symbol) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xdc - :flag-assert #x1d006000dc - (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) + (:state-methods + idle + die ) ) @@ -634,7 +622,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-electric-fence ((this cas-electric-fence) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-electric-fence) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -680,12 +668,8 @@ This commonly includes things such as: (deftype cas-button (basebutton) () - :heap-base #xa0 - :method-count-assert 40 - :size-assert #x120 - :flag-assert #x2800a00120 (:methods - (cas-button-method-39 (_type_) none 39) + (cas-button-method-39 (_type_) none) ) ) @@ -695,7 +679,7 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 2.25) ) -(defmethod basebutton-method-34 cas-button ((this cas-button)) +(defmethod basebutton-method-34 ((this cas-button)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -719,7 +703,7 @@ This commonly includes things such as: (none) ) -(defmethod prepare-trigger-event! cas-button ((this cas-button)) +(defmethod prepare-trigger-event! ((this cas-button)) "Sets `event-going-down` to `'trigger`" (set! (-> this event-down) 'shutdown) 0 @@ -749,7 +733,7 @@ This commonly includes things such as: ) ) -(defmethod basebutton-method-33 cas-button ((this cas-button)) +(defmethod basebutton-method-33 ((this cas-button)) "TODO - joint stuff" (initialize-skeleton this @@ -787,14 +771,10 @@ This commonly includes things such as: ) (deftype cas-elevator (elevator) - ((sound-id sound-id :offset-assert 368) + ((sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 50 - :size-assert #x174 - :flag-assert #x3201000174 (:methods - (cas-elevator-method-49 (_type_) none 49) + (cas-elevator-method-49 (_type_) none) ) ) @@ -804,13 +784,13 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 9) ) -(defmethod get-art-group cas-elevator ((this cas-elevator)) +(defmethod get-art-group ((this cas-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-cas-elevator" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch float vs none. -(defmethod cas-elevator-method-49 cas-elevator ((this cas-elevator)) +(defmethod cas-elevator-method-49 ((this cas-elevator)) (let* ((f0-1 (fmax 0.0 (- (-> this root trans y) (-> this bottom-top 0)))) (f0-3 (* 0.001171875 (- f0-1 (* (the float (the int (/ f0-1 30720.0))) 30720.0)))) (v1-6 (-> this skel root-channel 0)) @@ -821,7 +801,7 @@ This commonly includes things such as: (none) ) -(defmethod move-between-points cas-elevator ((this cas-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this cas-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -839,7 +819,7 @@ This commonly includes things such as: ) ) -(defmethod commited-to-ride? cas-elevator ((this cas-elevator)) +(defmethod commited-to-ride? ((this cas-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) @@ -933,13 +913,13 @@ This commonly includes things such as: ) ) -(defmethod deactivate cas-elevator ((this cas-elevator)) +(defmethod deactivate ((this cas-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) ) -(defmethod init-plat! cas-elevator ((this cas-elevator)) +(defmethod init-plat! ((this cas-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this sound-id) (new-sound-id)) @@ -947,7 +927,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod init-plat-collision! cas-elevator ((this cas-elevator)) +(defmethod init-plat-collision! ((this cas-elevator)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -977,20 +957,16 @@ For example for an elevator pre-compute the distance between the first and last ) (deftype cas-rot-bridge (process-drawable) - ((index uint32 :offset-assert 200) - (anim-index uint32 :offset-assert 204) - (test-index uint32 :offset-assert 208) - (pos float :offset-assert 212) - (pos-old float :offset-assert 216) - (sound-id sound-id :offset-assert 220) - (sound-flag symbol :offset-assert 224) + ((index uint32) + (anim-index uint32) + (test-index uint32) + (pos float) + (pos-old float) + (sound-id sound-id) + (sound-flag symbol) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xe4 - :flag-assert #x15007000e4 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1251,7 +1227,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-rot-bridge ((this cas-rot-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-rot-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1345,23 +1321,19 @@ This commonly includes things such as: ) (deftype cas-switch (process-drawable) - ((actor-group (pointer actor-group) :offset-assert 200) - (actor-group-count int32 :offset-assert 204) - (incoming-attack-id uint32 :offset-assert 208) - (anim-index uint32 :offset-assert 212) - (direction uint32 :offset-assert 216) - (pos-old float :offset-assert 220) - (y-start float :offset-assert 224) - (y-delta float :offset-assert 228) - (sound-id sound-id :offset-assert 232) - (sound-flag symbol :offset-assert 236) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (incoming-attack-id uint32) + (anim-index uint32) + (direction uint32) + (pos-old float) + (y-start float) + (y-delta float) + (sound-id sound-id) + (sound-flag symbol) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xf0 - :flag-assert #x15007000f0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1482,7 +1454,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-switch ((this cas-switch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1575,15 +1547,11 @@ This commonly includes things such as: ) (deftype cas-trapdoor (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) @@ -1696,7 +1664,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-trapdoor ((this cas-trapdoor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-trapdoor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1741,14 +1709,10 @@ This commonly includes things such as: (deftype cas-chain-plat (process-focusable) () - :heap-base #x50 - :method-count-assert 30 - :size-assert #xcc - :flag-assert #x1e005000cc - (:methods - (idle () _type_ :state 27) - (drop () _type_ :state 28) - (down () _type_ :state 29) + (:state-methods + idle + drop + down ) ) @@ -1795,7 +1759,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-chain-plat ((this cas-chain-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-chain-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1831,17 +1795,13 @@ This commonly includes things such as: ) (deftype cas-rot-blade (process-drawable) - ((sync sync-eased :inline :offset-assert 200) - (rot float :offset-assert 244) - (attack-id uint32 :offset-assert 248) - (sound-id sound-id :offset-assert 252) + ((sync sync-eased :inline) + (rot float) + (attack-id uint32) + (sound-id sound-id) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #x100 - :flag-assert #x1500800100 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1913,7 +1873,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-rot-blade ((this cas-rot-blade) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-rot-blade) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1985,7 +1945,7 @@ This commonly includes things such as: (none) ) -(defmethod deactivate cas-rot-blade ((this cas-rot-blade)) +(defmethod deactivate ((this cas-rot-blade)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -1993,12 +1953,8 @@ This commonly includes things such as: (deftype cas-flag-a (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -2024,7 +1980,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-flag-a ((this cas-flag-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-flag-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2044,12 +2000,8 @@ This commonly includes things such as: (deftype cas-flag-b (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -2075,7 +2027,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-flag-b ((this cas-flag-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-flag-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2094,27 +2046,23 @@ This commonly includes things such as: ) (deftype cas-robot-door (process-drawable) - ((spawner-actor symbol :offset-assert 200) - (door-actor entity-actor 2 :offset-assert 204) - (spawn-count int32 :offset-assert 212) - (spawn-count-total int32 :offset-assert 216) - (spawn-max int32 :offset-assert 220) - (spawn-total int32 :offset-assert 224) - (notice-dist float :offset-assert 228) - (player-dist float :offset-assert 232) - (anim-index int32 :offset-assert 236) - (last-guard handle :offset-assert 240) - (actor-group (pointer actor-group) :offset-assert 248) - (actor-group-count int32 :offset-assert 252) + ((spawner-actor symbol) + (door-actor entity-actor 2) + (spawn-count int32) + (spawn-count-total int32) + (spawn-max int32) + (spawn-total int32) + (notice-dist float) + (player-dist float) + (anim-index int32) + (last-guard handle) + (actor-group (pointer actor-group)) + (actor-group-count int32) ) - :heap-base #x80 - :method-count-assert 23 - :size-assert #x100 - :flag-assert #x1700800100 - (:methods - (idle () _type_ :state 20) - (spawning () _type_ :state 21) - (castle-wait-end () _type_ :state 22) + (:state-methods + idle + spawning + castle-wait-end ) ) @@ -2433,7 +2381,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-robot-door ((this cas-robot-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-robot-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2510,15 +2458,11 @@ This commonly includes things such as: ) (deftype lightning-ball (process-drawable) - ((root collide-shape :override) - (timer time-frame :offset-assert 200) + ((root collide-shape :override) + (timer time-frame) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -2589,7 +2533,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! lightning-ball ((this lightning-ball) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lightning-ball) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/castle/castle-part.gc b/goal_src/jak2/levels/castle/castle-part.gc index 51617bdb8b5..12035acaf8e 100644 --- a/goal_src/jak2/levels/castle/castle-part.gc +++ b/goal_src/jak2/levels/castle/castle-part.gc @@ -9,10 +9,6 @@ (deftype castle-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/castle/pad/caspad-obs.gc b/goal_src/jak2/levels/castle/pad/caspad-obs.gc index 1a4b87f6e84..4933ee6a696 100644 --- a/goal_src/jak2/levels/castle/pad/caspad-obs.gc +++ b/goal_src/jak2/levels/castle/pad/caspad-obs.gc @@ -8,14 +8,10 @@ ;; DECOMP BEGINS (deftype cpad-elevator (elevator) - ((sound-id sound-id :offset-assert 368) + ((sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 50 - :size-assert #x174 - :flag-assert #x3201000174 (:methods - (configure-collision (_type_ symbol) none 49) + (configure-collision (_type_ symbol) none) ) ) @@ -25,12 +21,12 @@ :bounds (static-spherem 0 0 0 18) ) -(defmethod get-art-group cpad-elevator ((this cpad-elevator)) +(defmethod get-art-group ((this cpad-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-cpad-elevator" (the-as (pointer uint32) #f)) ) -(defmethod move-between-points cpad-elevator ((this cpad-elevator) (vec vector) (point-a float) (point-b float)) +(defmethod move-between-points ((this cpad-elevator) (vec vector) (point-a float) (point-b float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -49,7 +45,7 @@ ) ) -(defmethod commited-to-ride? cpad-elevator ((this cpad-elevator)) +(defmethod commited-to-ride? ((this cpad-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((target *target*) (target-proc (if (type? target process-focusable) @@ -68,7 +64,7 @@ ) ) -(defmethod configure-collision cpad-elevator ((this cpad-elevator) (collide-with-jak? symbol)) +(defmethod configure-collision ((this cpad-elevator) (collide-with-jak? symbol)) "Appropriately sets the collision on the elevator @param collide-with-jak? If set, the elevator will collide with Jak" (let ((prim (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) @@ -142,7 +138,7 @@ ) ) -(defmethod activate-elevator cpad-elevator ((this cpad-elevator)) +(defmethod activate-elevator ((this cpad-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (if (task-node-closed? (game-task-node dig-knock-down-introduction)) (go (method-of-object this arrived)) @@ -150,14 +146,14 @@ ) ) -(defmethod deactivate cpad-elevator ((this cpad-elevator)) +(defmethod deactivate ((this cpad-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) ) ;; WARN: Return type mismatch ambient-sound vs none. -(defmethod set-ambient-sound! cpad-elevator ((this cpad-elevator)) +(defmethod set-ambient-sound! ((this cpad-elevator)) "Sets the elevator's [[ambient-sound]] up" (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "cpad-elevator-l" :fo-max 70) (-> this root trans)) @@ -166,7 +162,7 @@ ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! cpad-elevator ((this cpad-elevator)) +(defmethod init-plat! ((this cpad-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (let ((last-path-index (+ (-> this path curve num-cverts) -1))) @@ -178,7 +174,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-plat-collision! cpad-elevator ((this cpad-elevator)) +(defmethod init-plat-collision! ((this cpad-elevator)) "TODO - collision stuff for setting up the platform" (let ((cshape-moving (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape-moving dynam) (copy *standard-dynamics* 'process)) diff --git a/goal_src/jak2/levels/castle/pad/caspad-part.gc b/goal_src/jak2/levels/castle/pad/caspad-part.gc index 51cb1d3bb24..b4a90d7dbf8 100644 --- a/goal_src/jak2/levels/castle/pad/caspad-part.gc +++ b/goal_src/jak2/levels/castle/pad/caspad-part.gc @@ -9,10 +9,6 @@ (deftype caspad-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/castle/roboguard-level.gc b/goal_src/jak2/levels/castle/roboguard-level.gc index d0b2e81eafd..d572395c0c3 100644 --- a/goal_src/jak2/levels/castle/roboguard-level.gc +++ b/goal_src/jak2/levels/castle/roboguard-level.gc @@ -8,32 +8,30 @@ ;; DECOMP BEGINS (deftype roboguard-level (nav-enemy) - ((unknown-n12kjh3n123 int32 5 :offset-assert 604) - (flags uint16 :offset-assert 624) - (roll-timer time-frame :offset-assert 632) - (roll-dir vector :inline :offset-assert 640) - (incoming-attack-id uint32 :offset-assert 656) - (turning-acc float :offset-assert 660) - (speed float :offset-assert 664) - (roll-attack-count uint32 :offset-assert 668) - (roll-sound sound-id :offset-assert 672) + ((unknown-n12kjh3n123 int32 5) + (flags uint16) + (roll-timer time-frame) + (roll-dir vector :inline) + (incoming-attack-id uint32) + (turning-acc float) + (speed float) + (roll-attack-count uint32) + (roll-sound sound-id) ) - :heap-base #x230 - :method-count-assert 189 - :size-assert #x2a4 - :flag-assert #xbd023002a4 + (:state-methods + roboguard-level-state-178 + roboguard-level-state-179 + roll-enter + roll-hostile + roll-to-walk + idle-dizzy + explode + ) (:methods - (roboguard-level-method-178 (_type_) none 178) - (roboguard-level-method-179 (_type_) none 179) - (roll-enter () _type_ :state 180) - (roll-hostile () _type_ :state 181) - (roll-to-walk () _type_ :state 182) - (idle-dizzy () _type_ :state 183) - (explode () _type_ :state 184) - (roboguard-level-method-185 (_type_ symbol) none 185) - (roboguard-level-method-186 (_type_) none 186) - (roboguard-level-method-187 (_type_) none 187) - (roboguard-level-method-188 (_type_) none 188) + (roboguard-level-method-185 (_type_ symbol) none) + (roboguard-level-method-186 (_type_) none) + (roboguard-level-method-187 (_type_) none) + (roboguard-level-method-188 (_type_) none) ) ) @@ -728,7 +726,7 @@ ) ) -(defmethod go-hostile roboguard-level ((this roboguard-level)) +(defmethod go-hostile ((this roboguard-level)) (go (method-of-object this roll-enter)) ) @@ -806,7 +804,7 @@ :post #f ) -(defmethod roboguard-level-method-185 roboguard-level ((this roboguard-level) (arg0 symbol)) +(defmethod roboguard-level-method-185 ((this roboguard-level) (arg0 symbol)) (let ((v1-1 (-> this root root-prim)) (a0-1 arg0) ) @@ -872,7 +870,7 @@ (none) ) -(defmethod enemy-method-77 roboguard-level ((this roboguard-level) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this roboguard-level) (arg0 (pointer float))) (ja-channel-push! 1 0) (case (-> this incoming knocked-type) (((knocked-type knocked-type-0) @@ -905,7 +903,7 @@ #t ) -(defmethod enemy-method-78 roboguard-level ((this roboguard-level) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this roboguard-level) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-0) (knocked-type knocked-type-1) @@ -937,7 +935,7 @@ #t ) -(defmethod general-event-handler roboguard-level ((this roboguard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this roboguard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -1019,7 +1017,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 roboguard-level ((this roboguard-level) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 ((this roboguard-level) (arg0 process) (arg1 event-message-block)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1111,7 +1109,7 @@ ) ) -(defmethod nav-enemy-method-142 roboguard-level ((this roboguard-level) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this roboguard-level) (arg0 nav-control)) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) (set! (-> s3-0 quad) (-> a1-1 heading quad)) @@ -1135,7 +1133,7 @@ (none) ) -(defmethod nav-enemy-method-176 roboguard-level ((this roboguard-level)) +(defmethod nav-enemy-method-176 ((this roboguard-level)) (nav-enemy-method-177 this) (let ((a0-2 this)) (when (logtest? (enemy-flag enemy-flag36) (-> a0-2 enemy-flags)) @@ -1157,7 +1155,7 @@ (none) ) -(defmethod dispose! roboguard-level ((this roboguard-level)) +(defmethod dispose! ((this roboguard-level)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) (send-event (ppointer->process (-> this parent)) 'roboguard-die) @@ -1166,17 +1164,17 @@ (none) ) -(defmethod deactivate roboguard-level ((this roboguard-level)) +(defmethod deactivate ((this roboguard-level)) (sound-stop (-> this roll-sound)) (call-parent-method this) (none) ) -(defmethod relocate roboguard-level ((this roboguard-level) (arg0 int)) +(defmethod relocate ((this roboguard-level) (arg0 int)) (call-parent-method this arg0) ) -(defmethod init-enemy-collision! roboguard-level ((this roboguard-level)) +(defmethod init-enemy-collision! ((this roboguard-level)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1234,7 +1232,7 @@ (none) ) -(defmethod init-enemy! roboguard-level ((this roboguard-level)) +(defmethod init-enemy! ((this roboguard-level)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/city/bombbot/bombbot-h.gc b/goal_src/jak2/levels/city/bombbot/bombbot-h.gc index 327feb169a2..529657cbf6e 100644 --- a/goal_src/jak2/levels/city/bombbot/bombbot-h.gc +++ b/goal_src/jak2/levels/city/bombbot/bombbot-h.gc @@ -8,23 +8,17 @@ ;; DECOMP BEGINS (deftype bombbot-node (structure) - ((position vector :inline :offset-assert 0) - (nav-mesh-id uint32 :offset-assert 16) - (pos-x float :offset 0) - (pos-y float :offset 4) - (pos-z float :offset 8) + ((position vector :inline) + (nav-mesh-id uint32) + (pos-x float :overlay-at (-> position data 0)) + (pos-y float :overlay-at (-> position data 1)) + (pos-z float :overlay-at (-> position data 2)) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype bombbot-path (structure) - ((node-count uint16 :offset-assert 0) - (node (inline-array bombbot-node) :offset-assert 4) + ((node-count uint16) + (node (inline-array bombbot-node)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) diff --git a/goal_src/jak2/levels/city/bombbot/bombbot.gc b/goal_src/jak2/levels/city/bombbot/bombbot.gc index 8e9b8c6dd6f..5128911e062 100644 --- a/goal_src/jak2/levels/city/bombbot/bombbot.gc +++ b/goal_src/jak2/levels/city/bombbot/bombbot.gc @@ -489,79 +489,74 @@ ) (deftype bombbot-foot (structure) - ((pos-offset vector :inline :offset-assert 0) - (joint-index uint32 :offset-assert 16) - (offset float :offset-assert 20) - (position vector :inline :offset-assert 32) - (next-position vector :inline :offset-assert 48) - (real-position vector :inline :offset-assert 64) - (speed vector :inline :offset-assert 80) - (moving symbol :offset-assert 96) - (main-y float :offset-assert 100) - (delta-y float :offset-assert 104) + ((pos-offset vector :inline) + (joint-index uint32) + (offset float) + (position vector :inline) + (next-position vector :inline) + (real-position vector :inline) + (speed vector :inline) + (moving symbol) + (main-y float) + (delta-y float) ) :pack-me - :method-count-assert 9 - :size-assert #x6c - :flag-assert #x90000006c ) (deftype bombbot (nav-enemy) - ((joint-ik joint-mod-ik 4 :offset-assert 604) - (feet bombbot-foot 4 :inline :offset-assert 624) - (legs-strength float 4 :offset-assert 1072) - (last-trans vector :inline :offset-assert 1088) - (linear-speed vector :inline :offset-assert 1104) - (last-quat quaternion :inline :offset-assert 1120) - (y-angular-velocity float :offset-assert 1136) - (main-quat quaternion :inline :offset-assert 1152) - (main-spd-y float :offset-assert 1168) - (main-pos-y float :offset-assert 1172) - (main-pos vector :inline :offset-assert 1184) - (city-path bombbot-path :offset-assert 1200) - (current-node uint32 :offset-assert 1204) - (shot-count uint32 :offset-assert 1208) - (next-shoot uint64 :offset-assert 1216) - (stop-shoot uint64 :offset-assert 1224) - (next-target uint64 :offset-assert 1232) - (start-target uint64 :offset-assert 1240) - (beep-time time-frame :offset-assert 1248) - (target-pos vector :inline :offset-assert 1264) - (start-target-pos vector :inline :offset-assert 1280) - (start-target-vel vector :inline :offset-assert 1296) - (top-quat quaternion :inline :offset-assert 1312) - (gun-swivel-quat quaternion :inline :offset-assert 1328) - (gun-quat quaternion :inline :offset-assert 1344) - (angle-turret float :offset-assert 1360) - (angle-gun float :offset-assert 1364) - (high float :offset-assert 1368) - (shield-hit-points float :offset-assert 1372) - (hit-axis vector :inline :offset-assert 1376) - (rigidbody rigid-body-control :offset-assert 1392) - (info rigid-body-object-constants :offset-assert 1396) - (explosing symbol :offset-assert 1400) - (minimap connection-minimap :offset-assert 1404) - (lazer-sound sound-id :offset-assert 1408) - (head-sound sound-id :offset-assert 1412) - (cannon-sound sound-id :offset-assert 1416) - (last-head-roty-speed float :offset-assert 1420) - (head-roty-speed float :offset-assert 1424) - (last-cannon-roty-speed float :offset-assert 1428) - (cannon-roty-speed float :offset-assert 1432) + ((joint-ik joint-mod-ik 4) + (feet bombbot-foot 4 :inline) + (legs-strength float 4) + (last-trans vector :inline) + (linear-speed vector :inline) + (last-quat quaternion :inline) + (y-angular-velocity float) + (main-quat quaternion :inline) + (main-spd-y float) + (main-pos-y float) + (main-pos vector :inline) + (city-path bombbot-path) + (current-node uint32) + (shot-count uint32) + (next-shoot uint64) + (stop-shoot uint64) + (next-target uint64) + (start-target uint64) + (beep-time time-frame) + (target-pos vector :inline) + (start-target-pos vector :inline) + (start-target-vel vector :inline) + (top-quat quaternion :inline) + (gun-swivel-quat quaternion :inline) + (gun-quat quaternion :inline) + (angle-turret float) + (angle-gun float) + (high float) + (shield-hit-points float) + (hit-axis vector :inline) + (rigidbody rigid-body-control) + (info rigid-body-object-constants) + (explosing symbol) + (minimap connection-minimap) + (lazer-sound sound-id) + (head-sound sound-id) + (cannon-sound sound-id) + (last-head-roty-speed float) + (head-roty-speed float) + (last-cannon-roty-speed float) + (cannon-roty-speed float) ) - :heap-base #x520 - :method-count-assert 185 - :size-assert #x59c - :flag-assert #xb90520059c + (:state-methods + explode + ) (:methods - (explode () _type_ :state 178) - (bombbot-method-179 (_type_) none 179) - (bombbot-method-180 (_type_) none 180) - (bombbot-method-181 (_type_ vector) none 181) - (bombbot-method-182 (_type_) none 182) - (bombbot-method-183 (_type_) none 183) - (bombbot-method-184 (_type_) none 184) + (bombbot-method-179 (_type_) none) + (bombbot-method-180 (_type_) none) + (bombbot-method-181 (_type_ vector) none) + (bombbot-method-182 (_type_) none) + (bombbot-method-183 (_type_) none) + (bombbot-method-184 (_type_) none) ) ) @@ -677,12 +672,9 @@ (set! (-> *bombbot-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (deftype ik-setup (structure) - ((elbow-index int32 :offset-assert 0) - (hand-dist float :offset-assert 4) + ((elbow-index int32) + (hand-dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -762,7 +754,7 @@ ) ) -(defmethod bombbot-method-180 bombbot ((this bombbot)) +(defmethod bombbot-method-180 ((this bombbot)) (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) @@ -796,7 +788,7 @@ ;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 -(defmethod bombbot-method-179 bombbot ((this bombbot)) +(defmethod bombbot-method-179 ((this bombbot)) (local-vars (at-0 int) (sv-864 vector) @@ -1149,7 +1141,7 @@ ) ) -(defmethod track-target! bombbot ((this bombbot)) +(defmethod track-target! ((this bombbot)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1239,16 +1231,16 @@ (none) ) -(defmethod run-logic? bombbot ((this bombbot)) +(defmethod run-logic? ((this bombbot)) #t ) -(defmethod enemy-method-58 bombbot ((this bombbot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 ((this bombbot) (arg0 process) (arg1 event-message-block)) ((method-of-type nav-enemy enemy-method-58) this arg0 arg1) 'hit-flinch ) -(defmethod damage-amount-from-attack bombbot ((this bombbot) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this bombbot) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (-> arg1 param 1) (let ((f0-1 (the float (penetrate-using->damage (the-as penetrate (-> this incoming penetrate-using)))))) @@ -1271,7 +1263,7 @@ ) ) -(defmethod general-event-handler bombbot ((this bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -1349,7 +1341,7 @@ ) ) -(defmethod bombbot-method-181 bombbot ((this bombbot) (arg0 vector)) +(defmethod bombbot-method-181 ((this bombbot) (arg0 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1587,7 +1579,7 @@ ) ) -(defmethod bombbot-method-182 bombbot ((this bombbot)) +(defmethod bombbot-method-182 ((this bombbot)) (local-vars (v1-28 symbol) (sv-880 matrix) @@ -2163,7 +2155,7 @@ ) ) -(defmethod relocate bombbot ((this bombbot) (arg0 int)) +(defmethod relocate ((this bombbot) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this joint-ik v1-0)) (&+! (-> this joint-ik v1-0) arg0) @@ -2175,7 +2167,7 @@ (call-parent-method this arg0) ) -(defmethod init-enemy-collision! bombbot ((this bombbot)) +(defmethod init-enemy-collision! ((this bombbot)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -2434,7 +2426,7 @@ (none) ) -(defmethod coin-flip? bombbot ((this bombbot)) +(defmethod coin-flip? ((this bombbot)) "@returns The result of a 50/50 RNG roll" #f ) @@ -2667,12 +2659,9 @@ ) (deftype spring-setup (structure) - ((bpos1 vector :offset-assert 0) - (wpos2 vector :offset-assert 4) + ((bpos1 vector) + (wpos2 vector) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -2696,7 +2685,7 @@ ) ) -(defmethod bombbot-method-183 bombbot ((this bombbot)) +(defmethod bombbot-method-183 ((this bombbot)) (local-vars (at-0 int) (sv-160 vector) (sv-176 vector)) (with-pp (rlet ((vf0 :class vf) @@ -2783,7 +2772,7 @@ ) ) -(defmethod bombbot-method-184 bombbot ((this bombbot)) +(defmethod bombbot-method-184 ((this bombbot)) (rigid-body-control-method-10 (-> this rigidbody) (the-as rigid-body-object this) @@ -2794,7 +2783,7 @@ (none) ) -(defmethod init-enemy! bombbot ((this bombbot)) +(defmethod init-enemy! ((this bombbot)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -2916,14 +2905,11 @@ ) (deftype bombbot-spawn-params (structure) - ((position vector :inline :offset-assert 0) - (quat quaternion :inline :offset-assert 16) - (nav-mesh basic :offset-assert 32) - (path bombbot-path :offset-assert 36) + ((position vector :inline) + (quat quaternion :inline) + (nav-mesh basic) + (path bombbot-path) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) diff --git a/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc b/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc index 37668d73a5c..24a8d0123f8 100644 --- a/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc +++ b/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc @@ -251,21 +251,19 @@ ) (deftype race-ring (process-drawable) - ((last-target-pos vector :inline :offset-assert 208) - (keep-part-track-alive symbol :offset-assert 224) - (part-track handle :offset-assert 232) - (rot-y float :offset-assert 240) - (cyl cylinder-flat :inline :offset-assert 256) + ((last-target-pos vector :inline) + (keep-part-track-alive symbol) + (part-track handle) + (rot-y float) + (cyl cylinder-flat :inline) ) - :heap-base #xb0 - :method-count-assert 24 - :size-assert #x128 - :flag-assert #x1800b00128 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (race-ring-method-22 (_type_) none 22) - (race-ring-method-23 (_type_) none 23) + (race-ring-method-22 (_type_) none) + (race-ring-method-23 (_type_) none) ) ) @@ -455,13 +453,13 @@ ) ) -(defmethod race-ring-method-22 race-ring ((this race-ring)) +(defmethod race-ring-method-22 ((this race-ring)) (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) -(defmethod race-ring-method-23 race-ring ((this race-ring)) +(defmethod race-ring-method-23 ((this race-ring)) (add-icon! *minimap* this (the-as uint 15) (the-as int #f) (the-as vector #t) 0) (set! (-> this keep-part-track-alive) #f) (set! (-> this part-track) (the-as handle #f)) @@ -499,14 +497,11 @@ ) (deftype bb-ring-info (structure) - ((time time-frame :offset-assert 0) - (start-pos vector :inline :offset-assert 16) - (rotation float :offset-assert 32) - (rings (array city-race-ring-info) :offset-assert 36) + ((time time-frame) + (start-pos vector :inline) + (rotation float) + (rings (array city-race-ring-info)) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) @@ -1631,24 +1626,22 @@ ) (deftype bush-collect (process-drawable) - ((minimap connection-minimap :offset-assert 200) - (trans-y float :offset-assert 204) - (beep-time float :offset-assert 208) + ((minimap connection-minimap) + (trans-y float) + (beep-time float) ) - :heap-base #x60 - :method-count-assert 24 - :size-assert #xd4 - :flag-assert #x18006000d4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (bush-collect-method-22 (_type_) none 22) - (bush-collect-method-23 (_type_) none 23) + (bush-collect-method-22 (_type_) none) + (bush-collect-method-23 (_type_) none) ) ) -(defmethod bush-collect-method-22 bush-collect ((this bush-collect)) +(defmethod bush-collect-method-22 ((this bush-collect)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1675,7 +1668,7 @@ (none) ) -(defmethod bush-collect-method-23 bush-collect ((this bush-collect)) +(defmethod bush-collect-method-23 ((this bush-collect)) 0 (none) ) @@ -1745,7 +1738,7 @@ ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! bush-collect ((this bush-collect) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bush-collect) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1819,20 +1812,17 @@ This commonly includes things such as: ) (deftype burning-bush-collection-info (structure) - ((pos vector :inline :offset-assert 0) - (handle handle :offset-assert 16) - (minimap connection-minimap :offset-assert 24) + ((pos vector :inline) + (handle handle) + (minimap connection-minimap) ) - :method-count-assert 10 - :size-assert #x1c - :flag-assert #xa0000001c (:methods - (burning-bush-collection-info-method-9 (_type_ object) none 9) + (burning-bush-collection-info-method-9 (_type_ object) none) ) ) -(defmethod burning-bush-collection-info-method-9 burning-bush-collection-info ((this burning-bush-collection-info) (arg0 object)) +(defmethod burning-bush-collection-info-method-9 ((this burning-bush-collection-info) (arg0 object)) (format arg0 "(static-burning-bush-collection-info~%") (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%)~%" (-> this pos x) (-> this pos y) (-> this pos z)) 0 @@ -1840,13 +1830,10 @@ This commonly includes things such as: ) (deftype bb-collection-info (structure) - ((user-data uint32 :offset-assert 0) - (time time-frame :offset-assert 8) - (colls (array burning-bush-collection-info) :offset-assert 16) + ((user-data uint32) + (time time-frame) + (colls (array burning-bush-collection-info)) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -2680,15 +2667,12 @@ This commonly includes things such as: ) (deftype burning-bush-get-on-info (structure) - ((trans vector :inline :offset-assert 0) - (quat quaternion :inline :offset-assert 16) - (camera-trans vector :inline :offset-assert 32) - (camera-rot float 9 :offset-assert 48) - (time float :offset-assert 84) + ((trans vector :inline) + (quat quaternion :inline) + (camera-trans vector :inline) + (camera-rot float 9) + (time float) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) @@ -3030,7 +3014,7 @@ This commonly includes things such as: (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) ) -(defmethod draw hud-homing-beacon ((this hud-homing-beacon)) +(defmethod draw ((this hud-homing-beacon)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -3048,14 +3032,14 @@ This commonly includes things such as: (none) ) -(defmethod update-values hud-homing-beacon ((this hud-homing-beacon)) +(defmethod update-values ((this hud-homing-beacon)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-homing-beacon ((this hud-homing-beacon)) +(defmethod init-callback ((this hud-homing-beacon)) (set! (-> this level) (level-get *level* 'lbbush)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -3067,7 +3051,7 @@ This commonly includes things such as: (none) ) -(defmethod draw hud-dark-eco-pickup ((this hud-dark-eco-pickup)) +(defmethod draw ((this hud-dark-eco-pickup)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -3085,14 +3069,14 @@ This commonly includes things such as: (none) ) -(defmethod update-values hud-dark-eco-pickup ((this hud-dark-eco-pickup)) +(defmethod update-values ((this hud-dark-eco-pickup)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-dark-eco-pickup ((this hud-dark-eco-pickup)) +(defmethod init-callback ((this hud-dark-eco-pickup)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -3103,7 +3087,7 @@ This commonly includes things such as: (none) ) -(defmethod draw hud-green-eco-pickup ((this hud-green-eco-pickup)) +(defmethod draw ((this hud-green-eco-pickup)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -3121,14 +3105,14 @@ This commonly includes things such as: (none) ) -(defmethod update-values hud-green-eco-pickup ((this hud-green-eco-pickup)) +(defmethod update-values ((this hud-green-eco-pickup)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-green-eco-pickup ((this hud-green-eco-pickup)) +(defmethod init-callback ((this hud-green-eco-pickup)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/goal_src/jak2/levels/city/common/height-map-h.gc b/goal_src/jak2/levels/city/common/height-map-h.gc index 2a64361d9db..49dde0b85c2 100644 --- a/goal_src/jak2/levels/city/common/height-map-h.gc +++ b/goal_src/jak2/levels/city/common/height-map-h.gc @@ -14,28 +14,25 @@ "TODO - not terribly well understood yet, but this is used for the traffic height map this is primarily used to store a massive amount of bytes in the `data` field all initialized from static data." - ((offset float 3 :offset-assert 0) - (x-offset float :offset 0) - (y-offset float :offset 4) - (z-offset float :offset 8) - (x-inv-spacing float :offset-assert 12) - (z-inv-spacing float :offset-assert 16) - (y-scale float :offset-assert 20) - (dim int16 2 :offset-assert 24) - (x-dim int16 :offset 24) - (z-dim int16 :offset 26) - (data (pointer int8) :offset-assert 28) + ((offset float 3) + (x-offset float :overlay-at (-> offset 0)) + (y-offset float :overlay-at (-> offset 1)) + (z-offset float :overlay-at (-> offset 2)) + (x-inv-spacing float) + (z-inv-spacing float) + (y-scale float) + (dim int16 2) + (x-dim int16 :overlay-at (-> dim 0)) + (z-dim int16 :overlay-at (-> dim 1)) + (data (pointer int8)) ) - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 (:methods - (get-height-at-point (_type_ vector) float 9) - (debug-draw-mesh (_type_ vector) none 10) - (debug-print (_type_) none 11) - (debug-draw-at-point (_type_ vector) none 12) - (debug-draw (_type_ vector) none 13) - (debug-add-offset (_type_ vector int) none 14) + (get-height-at-point (_type_ vector) float) + (debug-draw-mesh (_type_ vector) none) + (debug-print (_type_) none) + (debug-draw-at-point (_type_ vector) none) + (debug-draw (_type_ vector) none) + (debug-add-offset (_type_ vector int) none) ) ) diff --git a/goal_src/jak2/levels/city/common/height-map.gc b/goal_src/jak2/levels/city/common/height-map.gc index bc4ae8602b3..4269299ce06 100644 --- a/goal_src/jak2/levels/city/common/height-map.gc +++ b/goal_src/jak2/levels/city/common/height-map.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod debug-print xz-height-map ((this xz-height-map)) +(defmethod debug-print ((this xz-height-map)) (format #t "(define *traffic-height-map*~%") (format #t " (static-height-map~%") (format @@ -40,7 +40,7 @@ (none) ) -(defmethod debug-add-offset xz-height-map ((this xz-height-map) (arg0 vector) (arg1 int)) +(defmethod debug-add-offset ((this xz-height-map) (arg0 vector) (arg1 int)) "Add an offset to the given point, likely for debugging purposes." (let ((v1-1 (the int (+ 0.5 (* (- (-> arg0 x) (-> this x-offset)) (-> this x-inv-spacing))))) (a1-1 (the int (+ 0.5 (* (- (-> arg0 z) (-> this z-offset)) (-> this z-inv-spacing))))) @@ -55,7 +55,7 @@ (none) ) -(defmethod debug-draw-at-point xz-height-map ((this xz-height-map) (arg0 vector)) +(defmethod debug-draw-at-point ((this xz-height-map) (arg0 vector)) (let ((v1-1 (the int (+ 0.5 (* (- (-> arg0 x) (-> this x-offset)) (-> this x-inv-spacing))))) (a1-1 (the int (+ 0.5 (* (- (-> arg0 z) (-> this z-offset)) (-> this z-inv-spacing))))) (a2-1 (-> this x-dim)) @@ -91,7 +91,7 @@ (none) ) -(defmethod get-height-at-point xz-height-map ((this xz-height-map) (arg0 vector)) +(defmethod get-height-at-point ((this xz-height-map) (arg0 vector)) (let* ((f0-1 (fmax 0.0 (* (-> this x-inv-spacing) (- (-> arg0 x) (-> this x-offset))))) (f2-4 (fmax 0.0 (* (-> this z-inv-spacing) (- (-> arg0 z) (-> this z-offset))))) (a2-0 (the int f0-1)) @@ -127,7 +127,7 @@ ) ) -(defmethod debug-draw-mesh xz-height-map ((this xz-height-map) (arg0 vector)) +(defmethod debug-draw-mesh ((this xz-height-map) (arg0 vector)) (local-vars (sv-80 int) (sv-96 int)) (rlet ((vf0 :class vf)) (init-vf0-vector) @@ -214,7 +214,7 @@ ) ) -(defmethod debug-draw xz-height-map ((this xz-height-map) (arg0 vector)) +(defmethod debug-draw ((this xz-height-map) (arg0 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) diff --git a/goal_src/jak2/levels/city/common/nav-graph-h.gc b/goal_src/jak2/levels/city/common/nav-graph-h.gc index 7b90189f4be..14b86d6527f 100644 --- a/goal_src/jak2/levels/city/common/nav-graph-h.gc +++ b/goal_src/jak2/levels/city/common/nav-graph-h.gc @@ -58,115 +58,109 @@ ;; DECOMP BEGINS (deftype nav-branch (structure) - ((node nav-node 2 :offset-assert 0) - (src-node nav-node :offset 0) - (dest-node nav-node :offset 4) - (temp-dest-node-id int32 :offset 4) - (speed-limit uint8 :offset-assert 8) - (density uint8 :offset-assert 9) - (clock-type nav-branch-clock-type :offset-assert 10) - (clock-mask nav-branch-clock-mask :offset-assert 11) - (max-user-count uint8 :offset-assert 12) - (user-count uint8 :offset-assert 13) - (width uint8 :offset-assert 14) - (flags nav-branch-flags :offset-assert 15) + ((node nav-node 2) + (src-node nav-node :overlay-at (-> node 0)) + (dest-node nav-node :overlay-at (-> node 1)) + (temp-dest-node-id int32 :overlay-at (-> node 1)) + (speed-limit uint8) + (density uint8) + (clock-type nav-branch-clock-type) + (clock-mask nav-branch-clock-mask) + (max-user-count uint8) + (user-count uint8) + (width uint8) + (flags nav-branch-flags) ) - :method-count-assert 21 - :size-assert #x10 - :flag-assert #x1500000010 (:methods - (set-default-density-speed-and-width (_type_) none 9) - (debug-print (_type_ object int) none 10) - (get-density (_type_) float 11) - (get-speed-limit (_type_) float 12) - (get-width (_type_) float 13) - (user-limit-reached? (_type_) symbol 14) - (dest-node-id-at-max? (_type_) symbol 15) - (set-density (_type_ float) none 16) - (set-speed-limit (_type_ float) none 17) - (set-width (_type_ float) none 18) - (set-src-node (_type_ nav-node) none 19) - (set-dst-node (_type_ nav-node) none 20) + (set-default-density-speed-and-width (_type_) none) + (debug-print (_type_ object int) none) + (get-density (_type_) float) + (get-speed-limit (_type_) float) + (get-width (_type_) float) + (user-limit-reached? (_type_) symbol) + (dest-node-id-at-max? (_type_) symbol) + (set-density (_type_ float) none) + (set-speed-limit (_type_ float) none) + (set-width (_type_ float) none) + (set-src-node (_type_ nav-node) none) + (set-dst-node (_type_ nav-node) none) ) ) (deftype nav-node (structure) - ((data uint32 8 :offset-assert 0) - (position vector :inline :offset 0) - (pos-x float :offset 0) - (pos-y float :offset 4) - (pos-z float :offset 8) - (angle uint16 :offset 12) - (id uint16 :offset 14) - (radius uint8 :offset 16) - (branch-count int8 :offset 17) - (flags nav-node-flag-byte :offset 18) - (pad0 int8 1 :offset 19) - (branch-array (inline-array nav-branch) :offset 20) - (nav-mesh-id uint32 :offset 24) - (level symbol :offset 28) + ((data uint32 8) + (position vector :inline :overlay-at (-> data 0)) + (pos-x float :overlay-at (-> data 0)) + (pos-y float :overlay-at (-> data 1)) + (pos-z float :overlay-at (-> data 2)) + (angle uint16 :overlay-at (-> data 3)) + (id uint16 :offset 14) + (radius uint8 :overlay-at (-> data 4)) + (branch-count int8 :offset 17) + (flags nav-node-flag-byte :offset 18) + (pad0 int8 1 :offset 19) + (branch-array (inline-array nav-branch) :overlay-at (-> data 5)) + (nav-mesh-id uint32 :overlay-at (-> data 6)) + (level symbol :overlay-at (-> data 7)) ) - :method-count-assert 22 - :size-assert #x20 - :flag-assert #x1600000020 (:methods - (debug-draw (_type_) none 9) - (debug-print (_type_ symbol string) none 10) - (remove-branch-by-idx (_type_ int) none 11) - (init-from-pt-and-heading (_type_ vector vector) none 12) - (set-pos-xyz (_type_ vector) none 13) - (set-angle-from-heading (_type_ vector) none 14) - (set-id-and-link-branches-back (_type_ uint) none 15) - (set-radius (_type_ float) none 16) - (set-angle (_type_ float) none 17) - (get-position (_type_ vector) vector 18) - (calc-sine-and-cosine! (_type_ vector) vector 19) - (get-angle (_type_) float 20) - (get-radius (_type_) float 21) + (debug-draw (_type_) none) + (debug-print (_type_ symbol string) none) + (remove-branch-by-idx (_type_ int) none) + (init-from-pt-and-heading (_type_ vector vector) none) + (set-pos-xyz (_type_ vector) none) + (set-angle-from-heading (_type_ vector) none) + (set-id-and-link-branches-back (_type_ uint) none) + (set-radius (_type_ float) none) + (set-angle (_type_ float) none) + (get-position (_type_ vector) vector) + (calc-sine-and-cosine! (_type_ vector) vector) + (get-angle (_type_) float) + (get-radius (_type_) float) ) ) -(defmethod get-density nav-branch ((this nav-branch)) +(defmethod get-density ((this nav-branch)) "TODO @returns `density * 0.0078125` - is this some kind of trick?" (* 0.0078125 (the float (-> this density))) ) -(defmethod get-speed-limit nav-branch ((this nav-branch)) +(defmethod get-speed-limit ((this nav-branch)) "TODO @returns `speed-limit * 1024.0`" (* 1024.0 (the float (-> this speed-limit))) ) -(defmethod get-width nav-branch ((this nav-branch)) +(defmethod get-width ((this nav-branch)) "TODO @returns `width * 256.0`" (* 256.0 (the float (-> this width))) ) -(defmethod user-limit-reached? nav-branch ((this nav-branch)) +(defmethod user-limit-reached? ((this nav-branch)) (>= (-> this user-count) (-> this max-user-count)) ) -(defmethod dest-node-id-at-max? nav-branch ((this nav-branch)) +(defmethod dest-node-id-at-max? ((this nav-branch)) "@returns if `dest-node`'s `id` is equal to `#FFFF` @see [[nav-node]]" (!= (-> this dest-node id) #xffff) ) -(defmethod get-radius nav-node ((this nav-node)) +(defmethod get-radius ((this nav-node)) "TODO @returns `radius * 1024.0" (* 1024.0 (the float (-> this radius))) ) -(defmethod get-angle nav-node ((this nav-node)) +(defmethod get-angle ((this nav-node)) (the float (-> this angle)) ) -(defmethod calc-sine-and-cosine! nav-node ((this nav-node) (ret vector)) +(defmethod calc-sine-and-cosine! ((this nav-node) (ret vector)) "Computes the sine and cosine of the `angle`. @param! ret The result @returns Nothing, the result will be in `ret`" @@ -182,7 +176,7 @@ ret ) -(defmethod get-position nav-node ((this nav-node) (ret vector)) +(defmethod get-position ((this nav-node) (ret vector)) "@param! ret The [[vector]] that is modified to hold the result @returns the `position` [[vector]] with a `w` component of `1.0`" (set! (-> ret quad) (-> this position quad)) @@ -191,79 +185,73 @@ ) (deftype nav-graph-link (structure) - ((id uint32 :offset-assert 0) - (dest-graph-id uint32 :offset-assert 4) - (src-branch-id uint16 :offset-assert 8) - (dest-node-id uint16 :offset-assert 10) - (dest-graph basic :offset-assert 12) - (dummy-node nav-node :inline :offset-assert 16) + ((id uint32) + (dest-graph-id uint32) + (src-branch-id uint16) + (dest-node-id uint16) + (dest-graph basic) + (dummy-node nav-node :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype nav-graph (basic) - ((node-count int16 :offset-assert 4) - (branch-count int16 :offset-assert 6) - (node-array (inline-array nav-node) :offset-assert 8) - (branch-array (inline-array nav-branch) :offset-assert 12) - (link-count int16 :offset-assert 16) - (pad2 uint16 :offset-assert 18) - (link-array (inline-array nav-graph-link) :offset-assert 20) - (first-node int16 :offset-assert 24) - (pad0 uint16 :offset-assert 26) - (patched symbol :offset-assert 28) - (id uint32 :offset-assert 32) - (pad1 uint32 6 :offset-assert 36) + ((node-count int16) + (branch-count int16) + (node-array (inline-array nav-node)) + (branch-array (inline-array nav-branch)) + (link-count int16) + (pad2 uint16) + (link-array (inline-array nav-graph-link)) + (first-node int16) + (pad0 uint16) + (patched symbol) + (id uint32) + (pad1 uint32 6) ) - :method-count-assert 45 - :size-assert #x3c - :flag-assert #x2d0000003c (:methods - (new (symbol type int int int uint) _type_ 0) - (debug-draw-nodes (_type_) none 9) - (nav-graph-method-10 (_type_ vector int) none 10) - (nav-graph-method-11 (_type_) none 11) - (nav-graph-method-12 (_type_) none 12) - (nav-graph-method-13 (_type_ int int) none 13) - (nav-graph-method-14 (_type_ int int) none 14) - (debug-reset (_type_) none 15) - (debug-add-node (_type_ int) nav-node 16) - (debug-link-node-to-graph (_type_ nav-node) none 17) - (debug-reset-branch-array (_type_ nav-node int) none 18) - (nav-graph-method-19 (_type_ int int int int int int) none 19) - (nav-graph-method-20 (_type_ int int) none 20) - (move-selected-to-height-map-height (_type_) none 21) - (select-nodes-in-range (_type_ int int) none 22) - (deselect-nodes-in-range (_type_ int int) none 23) - (toggle-select-nodes-in-range (_type_ int int) none 24) - (select-nodes-in-level (_type_ symbol symbol) none 25) - (select-nodes-by-nav-mesh-id (_type_ int symbol) none 26) - (select-nodes-by-flags (_type_ nav-node-flag-byte nav-node-flag-byte symbol) none 27) - (print-selected-nodes (_type_) none 28) - (assign-selected-nodes-to-level (_type_ symbol) none 29) - (assign-selected-nodes-to-nav-mesh (_type_ uint) none 30) - (set-radius-of-selected-nodes (_type_ float) none 31) - (set-speed-limit-of-selected (_type_ float) none 32) - (set-density-of-selected (_type_ float) none 33) - (set-width-of-selected (_type_ float) none 34) - (or-flags-of-selected-nodes (_type_ nav-node-flag-byte) none 35) - (and-flags-of-selected-nodes (_type_ nav-node-flag-byte) none 36) - (offset-pos-of-selected (_type_ vector) none 37) - (nav-graph-method-38 (_type_) none 38) - (nav-graph-method-39 (_type_) none 39) - (nav-graph-method-40 (_type_ int) int 40) - (node-at-idx (_type_ int) nav-node 41) - (patch-nodes (_type_) none 42) - (copy-to-mysql-graph (_type_ mysql-nav-graph string) none 43) - (from-editor (_type_ mysql-nav-graph symbol) none 44) + (new (symbol type int int int uint) _type_) + (debug-draw-nodes (_type_) none) + (nav-graph-method-10 (_type_ vector int) none) + (nav-graph-method-11 (_type_) none) + (nav-graph-method-12 (_type_) none) + (nav-graph-method-13 (_type_ int int) none) + (nav-graph-method-14 (_type_ int int) none) + (debug-reset (_type_) none) + (debug-add-node (_type_ int) nav-node) + (debug-link-node-to-graph (_type_ nav-node) none) + (debug-reset-branch-array (_type_ nav-node int) none) + (nav-graph-method-19 (_type_ int int int int int int) none) + (nav-graph-method-20 (_type_ int int) none) + (move-selected-to-height-map-height (_type_) none) + (select-nodes-in-range (_type_ int int) none) + (deselect-nodes-in-range (_type_ int int) none) + (toggle-select-nodes-in-range (_type_ int int) none) + (select-nodes-in-level (_type_ symbol symbol) none) + (select-nodes-by-nav-mesh-id (_type_ int symbol) none) + (select-nodes-by-flags (_type_ nav-node-flag-byte nav-node-flag-byte symbol) none) + (print-selected-nodes (_type_) none) + (assign-selected-nodes-to-level (_type_ symbol) none) + (assign-selected-nodes-to-nav-mesh (_type_ uint) none) + (set-radius-of-selected-nodes (_type_ float) none) + (set-speed-limit-of-selected (_type_ float) none) + (set-density-of-selected (_type_ float) none) + (set-width-of-selected (_type_ float) none) + (or-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) + (and-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) + (offset-pos-of-selected (_type_ vector) none) + (nav-graph-method-38 (_type_) none) + (nav-graph-method-39 (_type_) none) + (nav-graph-method-40 (_type_ int) int) + (node-at-idx (_type_ int) nav-node) + (patch-nodes (_type_) none) + (copy-to-mysql-graph (_type_ mysql-nav-graph string) none) + (from-editor (_type_ mysql-nav-graph symbol) none) ) ) -(defmethod node-at-idx nav-graph ((this nav-graph) (idx int)) +(defmethod node-at-idx ((this nav-graph) (idx int)) "Get the `nav-node` at a given position. @param idx The position in the `node-array` to return @returns the [[nav-node]] if it can be found, otherwise return [[#f]]" diff --git a/goal_src/jak2/levels/city/common/nav-graph.gc b/goal_src/jak2/levels/city/common/nav-graph.gc index de49046706b..4a1030f733a 100644 --- a/goal_src/jak2/levels/city/common/nav-graph.gc +++ b/goal_src/jak2/levels/city/common/nav-graph.gc @@ -7,37 +7,37 @@ ;; DECOMP BEGINS -(defmethod set-density nav-branch ((this nav-branch) (arg0 float)) +(defmethod set-density ((this nav-branch) (arg0 float)) (set! (-> this density) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 128.0 arg0))))))) 0 (none) ) -(defmethod set-speed-limit nav-branch ((this nav-branch) (arg0 float)) +(defmethod set-speed-limit ((this nav-branch) (arg0 float)) (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) 0 (none) ) -(defmethod set-width nav-branch ((this nav-branch) (arg0 float)) +(defmethod set-width ((this nav-branch) (arg0 float)) (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0))))))) 0 (none) ) -(defmethod set-src-node nav-branch ((this nav-branch) (arg0 nav-node)) +(defmethod set-src-node ((this nav-branch) (arg0 nav-node)) (set! (-> this src-node) arg0) 0 (none) ) -(defmethod set-dst-node nav-branch ((this nav-branch) (arg0 nav-node)) +(defmethod set-dst-node ((this nav-branch) (arg0 nav-node)) (set! (-> this dest-node) arg0) 0 (none) ) -(defmethod set-default-density-speed-and-width nav-branch ((this nav-branch)) +(defmethod set-default-density-speed-and-width ((this nav-branch)) (set-density this 0.25) (set-speed-limit this 61440.0) (set-width this 16384.0) @@ -45,7 +45,7 @@ (none) ) -(defmethod debug-draw nav-node ((this nav-node)) +(defmethod debug-draw ((this nav-node)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) @@ -146,7 +146,7 @@ ) ) -(defmethod debug-print nav-branch ((this nav-branch) (arg0 object) (arg1 int)) +(defmethod debug-print ((this nav-branch) (arg0 object) (arg1 int)) (format arg0 "~S~T~T~T (new-nav-branch :dest-node-id ~d~%" arg1 (-> this dest-node id)) (let ((t9-1 format) (a0-2 arg0) @@ -232,7 +232,7 @@ (none) ) -(defmethod debug-print nav-node ((this nav-node) (arg0 symbol) (arg1 string)) +(defmethod debug-print ((this nav-node) (arg0 symbol) (arg1 string)) (format arg0 "~S (new-nav-node :id ~d~%" arg1 (-> this id)) (format arg0 "~S~T :branch-list (~%" arg1) (dotimes (s3-0 (-> this branch-count)) @@ -291,7 +291,7 @@ (none) ) -(defmethod set-pos-xyz nav-node ((this nav-node) (arg0 vector)) +(defmethod set-pos-xyz ((this nav-node) (arg0 vector)) (let ((f0-0 (-> this position w))) (set! (-> this position quad) (-> arg0 quad)) (set! (-> this position w) f0-0) @@ -300,25 +300,25 @@ (none) ) -(defmethod set-angle-from-heading nav-node ((this nav-node) (arg0 vector)) +(defmethod set-angle-from-heading ((this nav-node) (arg0 vector)) (set! (-> this angle) (the-as uint (the int (atan (- (-> arg0 z)) (-> arg0 x))))) 0 (none) ) -(defmethod set-radius nav-node ((this nav-node) (arg0 float)) +(defmethod set-radius ((this nav-node) (arg0 float)) (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) 0 (none) ) -(defmethod set-angle nav-node ((this nav-node) (arg0 float)) +(defmethod set-angle ((this nav-node) (arg0 float)) (set! (-> this angle) (the-as uint (the int (+ 0.5 arg0)))) 0 (none) ) -(defmethod set-id-and-link-branches-back nav-node ((this nav-node) (arg0 uint)) +(defmethod set-id-and-link-branches-back ((this nav-node) (arg0 uint)) (set! (-> this id) arg0) (dotimes (v1-0 (-> this branch-count)) (set! (-> this branch-array v1-0 src-node) this) @@ -327,7 +327,7 @@ (none) ) -(defmethod init-from-pt-and-heading nav-node ((this nav-node) (arg0 vector) (arg1 vector)) +(defmethod init-from-pt-and-heading ((this nav-node) (arg0 vector) (arg1 vector)) (set-pos-xyz this arg0) (set-angle-from-heading this arg1) (set! (-> this flags) (nav-node-flag-byte pedestrian selected)) @@ -341,7 +341,7 @@ (none) ) -(defmethod remove-branch-by-idx nav-node ((this nav-node) (arg0 int)) +(defmethod remove-branch-by-idx ((this nav-node) (arg0 int)) (when (and (>= arg0 0) (< arg0 (-> this branch-count))) (let ((s5-0 (+ arg0 1)) (s4-0 arg0) @@ -358,7 +358,7 @@ (none) ) -(defmethod debug-reset-branch-array nav-graph ((this nav-graph) (arg0 nav-node) (arg1 int)) +(defmethod debug-reset-branch-array ((this nav-graph) (arg0 nav-node) (arg1 int)) "kinda dangerous" (set! (-> arg0 branch-array) (the-as (inline-array nav-branch) (-> this branch-array (-> this branch-count)))) (set! (-> arg0 branch-count) arg1) @@ -374,7 +374,7 @@ (none) ) -(defmethod debug-add-node nav-graph ((this nav-graph) (arg0 int)) +(defmethod debug-add-node ((this nav-graph) (arg0 int)) (let ((s4-0 (the-as nav-node #f))) (let ((s5-0 (-> this node-count)) (v1-1 (+ arg0 -1 (-> this branch-count))) @@ -390,7 +390,7 @@ ) ) -(defmethod debug-link-node-to-graph nav-graph ((this nav-graph) (arg0 nav-node)) +(defmethod debug-link-node-to-graph ((this nav-graph) (arg0 nav-node)) (when (> (-> arg0 branch-count) 0) (let ((a0-1 (-> arg0 branch-array 0)) (t9-0 (method-of-type nav-branch set-dst-node)) @@ -416,7 +416,7 @@ (none) ) -(defmethod nav-graph-method-13 nav-graph ((this nav-graph) (arg0 int) (arg1 int)) +(defmethod nav-graph-method-13 ((this nav-graph) (arg0 int) (arg1 int)) (when (and (< arg0 (-> this node-count)) (> arg1 0)) (let ((s4-1 (min arg1 (- (-> this node-count) arg0)))) (dotimes (s3-0 (-> this node-count)) @@ -477,7 +477,7 @@ (none) ) -(defmethod nav-graph-method-14 nav-graph ((this nav-graph) (arg0 int) (arg1 int)) +(defmethod nav-graph-method-14 ((this nav-graph) (arg0 int) (arg1 int)) (when (and (< arg0 (-> this node-count)) (> arg1 0)) (dotimes (s3-0 (-> this node-count)) (let ((s2-0 (-> this node-array s3-0))) @@ -523,7 +523,7 @@ (none) ) -(defmethod debug-reset nav-graph ((this nav-graph)) +(defmethod debug-reset ((this nav-graph)) (set! (-> this node-count) 0) (set! (-> this branch-count) 0) (set! (-> this first-node) 0) @@ -532,13 +532,13 @@ (none) ) -(defmethod nav-graph-method-12 nav-graph ((this nav-graph)) +(defmethod nav-graph-method-12 ((this nav-graph)) (set! (-> this first-node) (-> this node-count)) 0 (none) ) -(defmethod print-selected-nodes nav-graph ((this nav-graph)) +(defmethod print-selected-nodes ((this nav-graph)) (let ((s4-0 0) (s1-0 0) (v1-0 #f) @@ -577,7 +577,7 @@ (none) ) -(defmethod select-nodes-in-range nav-graph ((this nav-graph) (arg0 int) (arg1 int)) +(defmethod select-nodes-in-range ((this nav-graph) (arg0 int) (arg1 int)) (when (< arg0 (-> this node-count)) (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) (a2-3 arg0) @@ -596,7 +596,7 @@ (none) ) -(defmethod deselect-nodes-in-range nav-graph ((this nav-graph) (arg0 int) (arg1 int)) +(defmethod deselect-nodes-in-range ((this nav-graph) (arg0 int) (arg1 int)) (when (< arg0 (-> this node-count)) (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) (a2-3 arg0) @@ -615,7 +615,7 @@ (none) ) -(defmethod toggle-select-nodes-in-range nav-graph ((this nav-graph) (arg0 int) (arg1 int)) +(defmethod toggle-select-nodes-in-range ((this nav-graph) (arg0 int) (arg1 int)) (when (< arg0 (-> this node-count)) (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) (a2-3 arg0) @@ -634,7 +634,7 @@ (none) ) -(defmethod select-nodes-in-level nav-graph ((this nav-graph) (arg0 symbol) (arg1 symbol)) +(defmethod select-nodes-in-level ((this nav-graph) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 (-> this node-count)) (let* ((a3-1 (-> this node-array v1-0)) (t0-2 (= (-> a3-1 level) arg0)) @@ -664,7 +664,7 @@ (none) ) -(defmethod select-nodes-by-nav-mesh-id nav-graph ((this nav-graph) (arg0 int) (arg1 symbol)) +(defmethod select-nodes-by-nav-mesh-id ((this nav-graph) (arg0 int) (arg1 symbol)) (dotimes (v1-0 (-> this node-count)) (let* ((a3-1 (-> this node-array v1-0)) (t0-2 (= (-> a3-1 nav-mesh-id) arg0)) @@ -694,7 +694,7 @@ (none) ) -(defmethod select-nodes-by-flags nav-graph ((this nav-graph) (arg0 nav-node-flag-byte) (arg1 nav-node-flag-byte) (arg2 symbol)) +(defmethod select-nodes-by-flags ((this nav-graph) (arg0 nav-node-flag-byte) (arg1 nav-node-flag-byte) (arg2 symbol)) (dotimes (v1-0 (-> this node-count)) (let* ((t0-1 (-> this node-array v1-0)) (t1-3 (= (logand (-> t0-1 flags) arg1) arg0)) @@ -724,7 +724,7 @@ (none) ) -(defmethod assign-selected-nodes-to-level nav-graph ((this nav-graph) (arg0 symbol)) +(defmethod assign-selected-nodes-to-level ((this nav-graph) (arg0 symbol)) (dotimes (v1-0 (-> this node-count)) (let ((a2-1 (-> this node-array v1-0))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) @@ -736,7 +736,7 @@ (none) ) -(defmethod assign-selected-nodes-to-nav-mesh nav-graph ((this nav-graph) (arg0 uint)) +(defmethod assign-selected-nodes-to-nav-mesh ((this nav-graph) (arg0 uint)) (dotimes (v1-0 (-> this node-count)) (let ((a2-1 (-> this node-array v1-0))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) @@ -748,7 +748,7 @@ (none) ) -(defmethod set-radius-of-selected-nodes nav-graph ((this nav-graph) (arg0 float)) +(defmethod set-radius-of-selected-nodes ((this nav-graph) (arg0 float)) (dotimes (s4-0 (-> this node-count)) (let ((a0-2 (-> this node-array s4-0))) (if (logtest? (-> a0-2 flags) (nav-node-flag-byte selected)) @@ -760,7 +760,7 @@ (none) ) -(defmethod or-flags-of-selected-nodes nav-graph ((this nav-graph) (arg0 nav-node-flag-byte)) +(defmethod or-flags-of-selected-nodes ((this nav-graph) (arg0 nav-node-flag-byte)) (dotimes (v1-0 (-> this node-count)) (let ((a2-1 (-> this node-array v1-0))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) @@ -772,7 +772,7 @@ (none) ) -(defmethod and-flags-of-selected-nodes nav-graph ((this nav-graph) (arg0 nav-node-flag-byte)) +(defmethod and-flags-of-selected-nodes ((this nav-graph) (arg0 nav-node-flag-byte)) (let ((v1-0 (lognot arg0))) (dotimes (a1-1 (-> this node-count)) (let ((a2-1 (-> this node-array a1-1))) @@ -786,7 +786,7 @@ (none) ) -(defmethod set-speed-limit-of-selected nav-graph ((this nav-graph) (arg0 float)) +(defmethod set-speed-limit-of-selected ((this nav-graph) (arg0 float)) (dotimes (s4-0 (-> this node-count)) (let ((s3-0 (-> this node-array s4-0))) (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) @@ -800,7 +800,7 @@ (none) ) -(defmethod set-density-of-selected nav-graph ((this nav-graph) (arg0 float)) +(defmethod set-density-of-selected ((this nav-graph) (arg0 float)) (dotimes (s4-0 (-> this node-count)) (let ((s3-0 (-> this node-array s4-0))) (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) @@ -814,7 +814,7 @@ (none) ) -(defmethod set-width-of-selected nav-graph ((this nav-graph) (arg0 float)) +(defmethod set-width-of-selected ((this nav-graph) (arg0 float)) (dotimes (s4-0 (-> this node-count)) (let ((s3-0 (-> this node-array s4-0))) (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) @@ -828,7 +828,7 @@ (none) ) -(defmethod offset-pos-of-selected nav-graph ((this nav-graph) (arg0 vector)) +(defmethod offset-pos-of-selected ((this nav-graph) (arg0 vector)) (let ((s4-0 (new 'stack-no-clear 'vector))) (dotimes (s3-0 (-> this node-count)) (let ((a0-2 (-> this node-array s3-0))) @@ -849,7 +849,7 @@ (none) ) -(defmethod nav-graph-method-38 nav-graph ((this nav-graph)) +(defmethod nav-graph-method-38 ((this nav-graph)) (let ((s5-0 (new 'stack-no-clear 'vehicle-controller)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -873,7 +873,7 @@ (none) ) -(defmethod debug-draw-nodes nav-graph ((this nav-graph)) +(defmethod debug-draw-nodes ((this nav-graph)) (let ((s5-0 (new 'stack-no-clear 'matrix))) (dotimes (s4-0 (-> this node-count)) (let ((s3-0 (-> this node-array s4-0))) @@ -932,7 +932,7 @@ ) ;; WARN: Return type mismatch nav-node vs none. -(defmethod nav-graph-method-10 nav-graph ((this nav-graph) (arg0 vector) (arg1 int)) +(defmethod nav-graph-method-10 ((this nav-graph) (arg0 vector) (arg1 int)) (let* ((gp-0 (the-as nav-node #f)) (f0-0 409600000.0) (f30-0 (* f0-0 f0-0)) @@ -963,7 +963,7 @@ (none) ) -(defmethod move-selected-to-height-map-height nav-graph ((this nav-graph)) +(defmethod move-selected-to-height-map-height ((this nav-graph)) (dotimes (s5-0 (-> this node-count)) (let ((s4-0 (-> this node-array s5-0)) (s3-0 (new 'stack-no-clear 'vector)) @@ -989,7 +989,7 @@ (none) ) -(defmethod nav-graph-method-39 nav-graph ((this nav-graph)) +(defmethod nav-graph-method-39 ((this nav-graph)) (local-vars (sv-80 entity-nav-mesh) (sv-96 entity-nav-mesh)) (dotimes (s5-0 (-> this node-count)) (let ((s4-0 (-> this node-array s5-0)) @@ -1042,7 +1042,7 @@ (none) ) -(defmethod nav-graph-method-19 nav-graph ((this nav-graph) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) +(defmethod nav-graph-method-19 ((this nav-graph) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) (let ((gp-0 (-> this node-array arg0)) (s0-0 (-> this node-array arg1)) (s4-0 (-> this node-array arg2)) @@ -1063,12 +1063,12 @@ (none) ) -(defmethod nav-graph-method-40 nav-graph ((this nav-graph) (arg0 int)) +(defmethod nav-graph-method-40 ((this nav-graph) (arg0 int)) -1 (shr (- arg0 (the-as int (-> this node-array 0))) 5) ) -(defmethod nav-graph-method-20 nav-graph ((this nav-graph) (arg0 int) (arg1 int)) +(defmethod nav-graph-method-20 ((this nav-graph) (arg0 int) (arg1 int)) (let ((gp-0 (-> this node-array arg0)) (s5-0 (-> this node-array arg1)) ) @@ -1078,7 +1078,7 @@ (none) ) -(defmethod nav-graph-method-11 nav-graph ((this nav-graph)) +(defmethod nav-graph-method-11 ((this nav-graph)) (format #t "(define *traffic-nav-graph*~%") (format #t " (new-nav-graph~%") (format #t " :node-list (~%") @@ -1095,7 +1095,7 @@ (none) ) -(defmethod patch-nodes nav-graph ((this nav-graph)) +(defmethod patch-nodes ((this nav-graph)) "Patch nodes. Node pointers are stored as indices into arrays to be allocated on the level heap and patched at runtime after loading." (when (not (-> this patched)) @@ -1121,7 +1121,7 @@ and patched at runtime after loading." ) ;; WARN: Function (method 43 nav-graph) has a return type of none, but the expression builder found a return statement. -(defmethod copy-to-mysql-graph nav-graph ((this nav-graph) (arg0 mysql-nav-graph) (arg1 string)) +(defmethod copy-to-mysql-graph ((this nav-graph) (arg0 mysql-nav-graph) (arg1 string)) (set! (-> arg0 node-array length) 0) (set! (-> arg0 edge-array length) 0) (set! (-> arg0 visnode-array length) 0) @@ -1211,7 +1211,7 @@ and patched at runtime after loading." ) ) -(defmethod from-editor nav-graph ((this nav-graph) (arg0 mysql-nav-graph) (arg1 symbol)) +(defmethod from-editor ((this nav-graph) (arg0 mysql-nav-graph) (arg1 symbol)) (local-vars (v1-4 symbol) (v1-6 symbol) diff --git a/goal_src/jak2/levels/city/common/searchlight.gc b/goal_src/jak2/levels/city/common/searchlight.gc index 322d6356a2d..10c0175d8f3 100644 --- a/goal_src/jak2/levels/city/common/searchlight.gc +++ b/goal_src/jak2/levels/city/common/searchlight.gc @@ -8,14 +8,10 @@ ;; DECOMP BEGINS (deftype searchlight (process-drawable) - ((sync sync-eased :inline :offset-assert 200) + ((sync sync-eased :inline) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #xf4 - :flag-assert #x15008000f4 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -71,7 +67,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! searchlight ((this searchlight) (arg0 entity-actor)) +(defmethod init-from-entity! ((this searchlight) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/city/common/trail-h.gc b/goal_src/jak2/levels/city/common/trail-h.gc index ddeffc6d623..2407442ad8f 100644 --- a/goal_src/jak2/levels/city/common/trail-h.gc +++ b/goal_src/jak2/levels/city/common/trail-h.gc @@ -26,156 +26,132 @@ ;; DECOMP BEGINS (deftype trail-node (structure) - ((next-id int16 :offset-assert 0) - (prev-id int16 :offset-assert 2) - (parent-id int16 :offset-assert 4) - (x int16 :offset-assert 6) - (z int16 :offset-assert 8) - (first-conn uint16 :offset-assert 10) - (cost-from-start uint16 :offset-assert 12) - (cost-to-goal uint16 :offset-assert 14) - (flags trail-node-flag :offset-assert 16) - (conn-count uint8 :offset-assert 17) + ((next-id int16) + (prev-id int16) + (parent-id int16) + (x int16) + (z int16) + (first-conn uint16) + (cost-from-start uint16) + (cost-to-goal uint16) + (flags trail-node-flag) + (conn-count uint8) ) :pack-me - :method-count-assert 12 - :size-assert #x12 - :flag-assert #xc00000012 (:methods - (get-dist-score (_type_ vector) uint 9) - (debug-draw (_type_ int) none 10) - (get-position (_type_ vector) vector 11) + (get-dist-score (_type_ vector) uint) + (debug-draw (_type_ int) none) + (get-position (_type_ vector) vector) ) ) (deftype trail-visgroup (structure) - ((first-node uint16 :offset-assert 0) - (node-count uint8 :offset-assert 2) - (pad uint8 :offset-assert 3) + ((first-node uint16) + (node-count uint8) + (pad uint8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype trail-conn (structure) - ((head-id uint16 :offset-assert 0) - (tail-id uint16 :offset-assert 2) - (flags conn-flag :offset-assert 4) - (visgroup-id uint8 :offset-assert 5) - (cost uint16 :offset-assert 6) + ((head-id uint16) + (tail-id uint16) + (flags conn-flag) + (visgroup-id uint8) + (cost uint16) ) :pack-me - :method-count-assert 10 - :size-assert #x8 - :flag-assert #xa00000008 (:methods - (debug-draw (_type_ trail-graph int) none 9) + (debug-draw (_type_ trail-graph int) none) ) ) (deftype trail-conn-hash-cell (structure) - ((first-conn uint16 :offset-assert 0) - (conn-count uint8 :offset-assert 2) - (pad uint8 :offset-assert 3) + ((first-conn uint16) + (conn-count uint8) + (pad uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype trail-conn-search (structure) - ((best-conn-id int32 :offset-assert 0) - (best-dist float :offset-assert 4) - (src-pos vector :offset-assert 8) - (conn-pos vector :offset-assert 12) - (debug-cells-searched int32 :offset-assert 16) - (debug-conns-searched int32 :offset-assert 20) - (bounds bounding-box4w :inline :offset-assert 32) - (cell-quads qword 2 :inline :offset-assert 64) - (conn-quads qword 7 :inline :offset-assert 96) - (cell-bits vector16ub 2 :inline :offset 64) + ((best-conn-id int32) + (best-dist float) + (src-pos vector) + (conn-pos vector) + (debug-cells-searched int32) + (debug-conns-searched int32) + (bounds bounding-box4w :inline) + (cell-quads qword 2 :inline) + (conn-quads qword 7 :inline) + (cell-bits vector16ub 2 :inline :overlay-at cell-quads) ) - :method-count-assert 9 - :size-assert #xd0 - :flag-assert #x9000000d0 ) (deftype trail-conn-hash (basic) - ((cell-width meters :offset-assert 4) - (origin vector :inline :offset-assert 16) - (cell (inline-array trail-conn-hash-cell) :offset-assert 32) - (conn-ids (pointer uint16) :offset-assert 36) + ((cell-width meters) + (origin vector :inline) + (cell (inline-array trail-conn-hash-cell)) + (conn-ids (pointer uint16)) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) (deftype trail-cached-search-info (structure) - ((goal-conn-id int16 :offset-assert 0) - (orig-goal-pos vector :inline :offset-assert 16) - (conn-goal-pos vector :inline :offset-assert 32) + ((goal-conn-id int16) + (orig-goal-pos vector :inline) + (conn-goal-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype trail-graph (basic) - ((mode uint8 :offset-assert 4) - (search-id uint32 :offset-assert 8) - (open-head-id int16 :offset-assert 12) - (goal-conn-id int16 :offset-assert 14) - (goal-node-id int16 :offset-assert 16) - (node-count uint16 :offset-assert 18) - (conn-count uint16 :offset-assert 20) - (conn-mask uint8 :offset-assert 22) - (node (inline-array trail-node) :offset-assert 24) - (conn (inline-array trail-conn) :offset-assert 28) - (conn-ids (pointer uint16) :offset-assert 32) - (visgroup (inline-array trail-conn-hash-cell) :offset-assert 36) - (visnode-ids (pointer uint16) :offset-assert 40) - (conn-hash trail-conn-hash :offset-assert 44) - (orig-start-pos vector :inline :offset-assert 48) - (orig-goal-pos vector :inline :offset-assert 64) - (conn-start-pos vector :inline :offset-assert 80) - (conn-goal-pos vector :inline :offset-assert 96) - (open-quads qword 6 :inline :offset-assert 112) - (closed-quads qword 6 :inline :offset-assert 208) + ((mode uint8) + (search-id uint32) + (open-head-id int16) + (goal-conn-id int16) + (goal-node-id int16) + (node-count uint16) + (conn-count uint16) + (conn-mask uint8) + (node (inline-array trail-node)) + (conn (inline-array trail-conn)) + (conn-ids (pointer uint16)) + (visgroup (inline-array trail-conn-hash-cell)) + (visnode-ids (pointer uint16)) + (conn-hash trail-conn-hash) + (orig-start-pos vector :inline) + (orig-goal-pos vector :inline) + (conn-start-pos vector :inline) + (conn-goal-pos vector :inline) + (open-quads qword 6 :inline) + (closed-quads qword 6 :inline) ) - :method-count-assert 29 - :size-assert #x130 - :flag-assert #x1d00000130 (:methods - (trail-graph-method-9 (_type_ int) none 9) - (trail-graph-method-10 (_type_ int) none 10) - (trail-graph-method-11 (_type_ int int) trail-node 11) - (debug-draw (_type_) none 12) - (debug-draw-cell (_type_ int) none 13) - (debug-draw-path (_type_ int (pointer uint16) vector vector rgba float) symbol 14) - (do-path (_type_ vector vector) int 15) - (trail-graph-method-16 () none 16) - (get-node-location-by-id (_type_ uint vector) vector 17) - (get-path-to-root (_type_ (pointer uint16) int (pointer int32) (pointer float)) int 18) - (trail-graph-method-19 (_type_ int int) symbol 19) - (try-initialize (_type_) symbol 20) - (update-node-flags-for-conn (_type_ int trail-node-flag trail-node-flag) none 21) - (trail-graph-method-22 (_type_ int) none 22) - (reset-search-state (_type_) none 23) - (get-next-to-explore (_type_) int 24) - (trail-graph-method-25 (_type_ trail-conn-search int int) none 25) - (do-search! (_type_ vector vector trail-cached-search-info) none 26) - (do-some-work (_type_) int 27) - (run-until-done-or-timeout (_type_ int) none 28) + (trail-graph-method-9 (_type_ int) none) + (trail-graph-method-10 (_type_ int) none) + (trail-graph-method-11 (_type_ int int) trail-node) + (debug-draw (_type_) none) + (debug-draw-cell (_type_ int) none) + (debug-draw-path (_type_ int (pointer uint16) vector vector rgba float) symbol) + (do-path (_type_ vector vector) int) + (trail-graph-method-16 () none) + (get-node-location-by-id (_type_ uint vector) vector) + (get-path-to-root (_type_ (pointer uint16) int (pointer int32) (pointer float)) int) + (trail-graph-method-19 (_type_ int int) symbol) + (try-initialize (_type_) symbol) + (update-node-flags-for-conn (_type_ int trail-node-flag trail-node-flag) none) + (trail-graph-method-22 (_type_ int) none) + (reset-search-state (_type_) none) + (get-next-to-explore (_type_) int) + (trail-graph-method-25 (_type_ trail-conn-search int int) none) + (do-search! (_type_ vector vector trail-cached-search-info) none) + (do-some-work (_type_) int) + (run-until-done-or-timeout (_type_ int) none) ) ) diff --git a/goal_src/jak2/levels/city/common/trail.gc b/goal_src/jak2/levels/city/common/trail.gc index 7fe04fe3801..51d3066e097 100644 --- a/goal_src/jak2/levels/city/common/trail.gc +++ b/goal_src/jak2/levels/city/common/trail.gc @@ -8,7 +8,7 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw trail-conn ((this trail-conn) (arg0 trail-graph) (arg1 int)) +(defmethod debug-draw ((this trail-conn) (arg0 trail-graph) (arg1 int)) (let ((a2-3 (-> arg0 node (-> this head-id))) (v1-2 (-> arg0 node (-> this tail-id))) (s4-0 (new 'stack-no-clear 'vector)) @@ -49,7 +49,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw trail-node ((this trail-node) (arg0 int)) +(defmethod debug-draw ((this trail-node) (arg0 int)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'sphere)) ) @@ -75,7 +75,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw-cell trail-graph ((this trail-graph) (arg0 int)) +(defmethod debug-draw-cell ((this trail-graph) (arg0 int)) (local-vars (sv-80 int) (sv-96 (function _varargs_ object))) (let* ((s5-0 (-> this conn-hash)) (s4-0 (-> s5-0 cell arg0)) @@ -144,7 +144,7 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod debug-draw-path trail-graph ((this trail-graph) (arg0 int) (arg1 (pointer uint16)) (arg2 vector) (arg3 vector) (arg4 rgba) (arg5 float)) +(defmethod debug-draw-path ((this trail-graph) (arg0 int) (arg1 (pointer uint16)) (arg2 vector) (arg3 vector) (arg4 rgba) (arg5 float)) (local-vars (sv-48 int)) (let ((s0-0 (new 'stack-no-clear 'inline-array 'vector 2))) (set-vector! (-> s0-0 1) (+ (-> arg2 x) arg5) 53248.0 (+ (-> arg2 z) arg5) 1.0) @@ -178,7 +178,7 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod debug-draw trail-graph ((this trail-graph)) +(defmethod debug-draw ((this trail-graph)) (when (= (-> this mode) 3) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 2))) (set! (-> s5-0 1 quad) (-> this orig-goal-pos quad)) @@ -249,7 +249,7 @@ (none) ) -(defmethod get-position trail-node ((this trail-node) (arg0 vector)) +(defmethod get-position ((this trail-node) (arg0 vector)) "Unpack the position to a vector" (let ((v0-0 arg0)) (set! (-> v0-0 x) (* 4096.0 (the float (-> this x)))) @@ -260,12 +260,12 @@ ) ) -(defmethod get-node-location-by-id trail-graph ((this trail-graph) (arg0 uint) (arg1 vector)) +(defmethod get-node-location-by-id ((this trail-graph) (arg0 uint) (arg1 vector)) "Get the location of the node with the given ID" (get-position (-> this node (the-as int arg0)) arg1) ) -(defmethod get-path-to-root trail-graph ((this trail-graph) (arg0 (pointer uint16)) (arg1 int) (arg2 (pointer int32)) (arg3 (pointer float))) +(defmethod get-path-to-root ((this trail-graph) (arg0 (pointer uint16)) (arg1 int) (arg2 (pointer int32)) (arg3 (pointer float))) "Get the path from goal to root, following parent-id" (set! (-> arg3 0) 0.0) (set! (-> arg2 0) (-> this goal-node-id)) @@ -315,7 +315,7 @@ ) ) -(defmethod try-initialize trail-graph ((this trail-graph)) +(defmethod try-initialize ((this trail-graph)) "Init and verify that constants are good." (let ((a3-0 (shr (+ (-> this node-count) 127) 7))) (when (!= a3-0 6) @@ -336,7 +336,7 @@ #t ) -(defmethod reset-search-state trail-graph ((this trail-graph)) +(defmethod reset-search-state ((this trail-graph)) "Reset the search/goal." (when (nonzero? (-> this mode)) (set! (-> this goal-node-id) -1) @@ -372,7 +372,7 @@ ) ;; WARN: Return type mismatch trail-node-flag vs none. -(defmethod update-node-flags-for-conn trail-graph ((this trail-graph) (arg0 int) (arg1 trail-node-flag) (arg2 trail-node-flag)) +(defmethod update-node-flags-for-conn ((this trail-graph) (arg0 int) (arg1 trail-node-flag) (arg2 trail-node-flag)) "Set arg1, clear arg2" (let* ((v1-0 (lognot arg2)) (a3-2 (-> this conn arg0)) @@ -406,7 +406,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod trail-graph-method-25 trail-graph ((this trail-graph) (arg0 trail-conn-search) (arg1 int) (arg2 int)) +(defmethod trail-graph-method-25 ((this trail-graph) (arg0 trail-conn-search) (arg1 int) (arg2 int)) (let* ((v1-1 (+ (* arg2 16) arg1)) (a0-1 (/ v1-1 8)) (a1-2 (ash 1 (logand v1-1 7))) @@ -469,7 +469,7 @@ (none) ) -(defmethod do-path trail-graph ((this trail-graph) (arg0 vector) (arg1 vector)) +(defmethod do-path ((this trail-graph) (arg0 vector) (arg1 vector)) (let ((v1-0 (-> this conn-hash)) (s5-0 (new 'stack-no-clear 'trail-conn-search)) ) @@ -545,7 +545,7 @@ ) ) -(defmethod trail-graph-method-9 trail-graph ((this trail-graph) (arg0 int)) +(defmethod trail-graph-method-9 ((this trail-graph) (arg0 int)) (let ((s4-0 (-> this node arg0))) (set! (-> s4-0 cost-from-start) (get-dist-score s4-0 (-> this orig-start-pos))) (set! (-> s4-0 cost-to-goal) (get-dist-score s4-0 (-> this orig-goal-pos))) @@ -555,7 +555,7 @@ (none) ) -(defmethod trail-graph-method-10 trail-graph ((this trail-graph) (arg0 int)) +(defmethod trail-graph-method-10 ((this trail-graph) (arg0 int)) (let* ((s5-0 (-> this conn arg0)) (v1-1 (-> s5-0 visgroup-id)) ) @@ -583,7 +583,7 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod trail-graph-method-11 trail-graph ((this trail-graph) (arg0 int) (arg1 int)) +(defmethod trail-graph-method-11 ((this trail-graph) (arg0 int) (arg1 int)) (let ((v1-0 (/ arg0 8)) (a3-1 (ash 1 (logand arg0 7))) ) @@ -628,7 +628,7 @@ ) ) -(defmethod trail-graph-method-22 trail-graph ((this trail-graph) (arg0 int)) +(defmethod trail-graph-method-22 ((this trail-graph) (arg0 int)) (let ((v1-0 (/ arg0 8)) (a2-1 (ash 1 (logand arg0 7))) ) @@ -657,7 +657,7 @@ (none) ) -(defmethod get-next-to-explore trail-graph ((this trail-graph)) +(defmethod get-next-to-explore ((this trail-graph)) (let ((v0-0 (-> this open-head-id))) (when (>= v0-0 0) (let* ((v1-1 (-> this node)) @@ -680,7 +680,7 @@ ) ;; WARN: Return type mismatch int vs uint. -(defmethod get-dist-score trail-node ((this trail-node) (arg0 vector)) +(defmethod get-dist-score ((this trail-node) (arg0 vector)) (let* ((f0-1 (- (-> arg0 x) (* 4096.0 (the float (-> this x))))) (f1-3 (- (-> arg0 z) (* 4096.0 (the float (-> this z))))) (f0-4 (sqrtf (+ (* f0-1 f0-1) (* f1-3 f1-3)))) @@ -689,7 +689,7 @@ ) ) -(defmethod do-some-work trail-graph ((this trail-graph)) +(defmethod do-some-work ((this trail-graph)) (let ((s5-0 (get-next-to-explore this))) (if (< s5-0 0) (return 2) @@ -746,7 +746,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod run-until-done-or-timeout trail-graph ((this trail-graph) (arg0 int)) +(defmethod run-until-done-or-timeout ((this trail-graph) (arg0 int)) (local-vars (v1-1 int)) (let ((v0-0 (the-as int (-> this mode)))) 0 @@ -766,20 +766,17 @@ ) (deftype trail-vis-work (structure) - ((best-count uint32 :offset-assert 0) - (best-dist float :offset-assert 4) - (start-conn-id uint32 :offset-assert 8) - (p0 vector :inline :offset-assert 16) - (p1 vector :inline :offset-assert 32) - (best-node-id uint16 64 :offset-assert 48) + ((best-count uint32) + (best-dist float) + (start-conn-id uint32) + (p0 vector :inline) + (p1 vector :inline) + (best-node-id uint16 64) ) - :method-count-assert 9 - :size-assert #xb0 - :flag-assert #x9000000b0 ) -(defmethod trail-graph-method-19 trail-graph ((this trail-graph) (arg0 int) (arg1 int)) +(defmethod trail-graph-method-19 ((this trail-graph) (arg0 int) (arg1 int)) (local-vars (s4-1 symbol)) (let* ((s4-0 (-> this node)) (v1-2 (-> s4-0 arg1)) @@ -857,7 +854,7 @@ s4-1 ) -(defmethod do-search! trail-graph ((this trail-graph) (arg0 vector) (arg1 vector) (arg2 trail-cached-search-info)) +(defmethod do-search! ((this trail-graph) (arg0 vector) (arg1 vector) (arg2 trail-cached-search-info)) (reset-search-state this) (+! (-> this search-id) 1) (set! (-> this orig-start-pos quad) (-> arg0 quad)) diff --git a/goal_src/jak2/levels/city/ctyport-obs.gc b/goal_src/jak2/levels/city/ctyport-obs.gc index 49ad03f8cb2..83774e0b193 100644 --- a/goal_src/jak2/levels/city/ctyport-obs.gc +++ b/goal_src/jak2/levels/city/ctyport-obs.gc @@ -8,16 +8,14 @@ ;; DECOMP BEGINS (deftype boat-manager (process) - ((mesh basic :offset-assert 128) - (paths path-control 4 :offset-assert 132) + ((mesh basic) + (paths path-control 4) ) - :heap-base #x20 - :method-count-assert 16 - :size-assert #x94 - :flag-assert #x1000200094 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (boat-manager-method-15 (_type_) none 15) + (boat-manager-method-15 (_type_) none) ) ) @@ -121,26 +119,22 @@ ) (deftype boat-base (vehicle) - ((angle float :offset-assert 880) - (y-rot float :offset-assert 884) - (path-num uint32 :offset-assert 888) - (path-index float :offset-assert 892) + ((angle float) + (y-rot float) + (path-num uint32) + (path-index float) ) - :heap-base #x300 - :method-count-assert 149 - :size-assert #x380 - :flag-assert #x9503000380 (:methods - (boat-base-method-144 (_type_ nav-control) none 144) - (boat-base-method-145 (_type_ nav-control) none 145) - (boat-base-method-146 (_type_ nav-control) none 146) - (boat-base-method-147 (_type_ nav-control) none 147) - (boat-base-method-148 (_type_ nav-control) none 148) + (boat-base-method-144 (_type_ nav-control) none) + (boat-base-method-145 (_type_ nav-control) none) + (boat-base-method-146 (_type_ nav-control) none) + (boat-base-method-147 (_type_ nav-control) none) + (boat-base-method-148 (_type_ nav-control) none) ) ) -(defmethod boat-base-method-144 boat-base ((this boat-base) (arg0 nav-control)) +(defmethod boat-base-method-144 ((this boat-base) (arg0 nav-control)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -202,26 +196,26 @@ ) ) -(defmethod boat-base-method-145 boat-base ((this boat-base) (arg0 nav-control)) +(defmethod boat-base-method-145 ((this boat-base) (arg0 nav-control)) (navigate-using-route-portals (-> arg0 state)) 0 0 (none) ) -(defmethod boat-base-method-146 boat-base ((this boat-base) (arg0 nav-control)) +(defmethod boat-base-method-146 ((this boat-base) (arg0 nav-control)) (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg0 state)) 0 (none) ) -(defmethod boat-base-method-147 boat-base ((this boat-base) (arg0 nav-control)) +(defmethod boat-base-method-147 ((this boat-base) (arg0 nav-control)) (update-travel-dir-from-spheres (-> arg0 state)) 0 (none) ) -(defmethod boat-base-method-148 boat-base ((this boat-base) (arg0 nav-control)) +(defmethod boat-base-method-148 ((this boat-base) (arg0 nav-control)) (compute-speed-simple (-> arg0 state)) 0 (none) @@ -345,17 +339,17 @@ ) ) -(defmethod apply-damage boat-base ((this boat-base) (arg0 float) (arg1 rigid-body-impact)) +(defmethod apply-damage ((this boat-base) (arg0 float) (arg1 rigid-body-impact)) 0 (none) ) -(defmethod rigid-body-object-method-47 boat-base ((this boat-base) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) +(defmethod rigid-body-object-method-47 ((this boat-base) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) ((method-of-type vehicle rigid-body-object-method-47) this arg0 arg1 arg2 arg3) #f ) -(defmethod vehicle-method-120 boat-base ((this boat-base)) +(defmethod vehicle-method-120 ((this boat-base)) (let ((t9-0 (method-of-type vehicle vehicle-method-120))) (t9-0 this) ) @@ -446,7 +440,7 @@ (none) ) -(defmethod rigid-body-object-method-29 boat-base ((this boat-base) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this boat-base) (arg0 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -512,17 +506,17 @@ ) ) -(defmethod vehicle-method-96 boat-base ((this boat-base)) +(defmethod vehicle-method-96 ((this boat-base)) 0 (none) ) -(defmethod do-engine-sounds boat-base ((this boat-base)) +(defmethod do-engine-sounds ((this boat-base)) 0 (none) ) -(defmethod vehicle-method-135 boat-base ((this boat-base) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-135 ((this boat-base) (arg0 traffic-object-spawn-params)) (get-nav-control this (-> arg0 nav-mesh)) (set! (-> this nav callback-info) *boat-nav-callback-info*) (logior! (-> this nav flags) (nav-control-flag display-marks limit-rotation-rate update-heading-from-facing)) @@ -561,14 +555,14 @@ (none) ) -(defmethod alloc-and-init-rigid-body-control boat-base ((this boat-base) (arg0 rigid-body-vehicle-constants)) +(defmethod alloc-and-init-rigid-body-control ((this boat-base) (arg0 rigid-body-vehicle-constants)) ((method-of-type vehicle alloc-and-init-rigid-body-control) this arg0) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod vehicle-method-113 boat-base ((this boat-base)) +(defmethod vehicle-method-113 ((this boat-base)) (go (method-of-object this idle)) (none) ) @@ -618,17 +612,13 @@ ) (deftype barge (boat-base) - ((engine sound-id :offset-assert 896) - (bow-wash sound-id :offset-assert 900) + ((engine sound-id) + (bow-wash sound-id) ) - :heap-base #x310 - :method-count-assert 149 - :size-assert #x388 - :flag-assert #x9503100388 ) -(defmethod vehicle-method-120 barge ((this barge)) +(defmethod vehicle-method-120 ((this barge)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -694,7 +684,7 @@ ) ) -(defmethod allocate-and-init-cshape barge ((this barge)) +(defmethod allocate-and-init-cshape ((this barge)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -814,7 +804,7 @@ (none) ) -(defmethod init-skel-and-rigid-body barge ((this barge)) +(defmethod init-skel-and-rigid-body ((this barge)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-barge" (the-as (pointer uint32) #f))) @@ -878,7 +868,7 @@ ) ;; WARN: Return type mismatch process vs boat-manager. -(defmethod relocate boat-manager ((this boat-manager) (arg0 int)) +(defmethod relocate ((this boat-manager) (arg0 int)) (dotimes (v1-0 4) (if (-> this paths v1-0) (&+! (-> this paths v1-0) arg0) @@ -908,7 +898,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! boat-manager ((this boat-manager) (arg0 entity-actor)) +(defmethod init-from-entity! ((this boat-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/city/ctywide-obs-h.gc b/goal_src/jak2/levels/city/ctywide-obs-h.gc index 0e3856af750..fdc738748b3 100644 --- a/goal_src/jak2/levels/city/ctywide-obs-h.gc +++ b/goal_src/jak2/levels/city/ctywide-obs-h.gc @@ -10,38 +10,29 @@ ;; DECOMP BEGINS (deftype city-race-ring-info (structure) - ((pos vector :inline :offset-assert 0) - (angle float :offset 12) - (boost float :offset-assert 16) - (dist float :offset-assert 20) + ((pos vector :inline) + (angle float :overlay-at (-> pos data 3)) + (boost float) + (dist float) ) - :method-count-assert 10 - :size-assert #x18 - :flag-assert #xa00000018 (:methods - (city-race-ring-info-method-9 (_type_ symbol) none 9) + (city-race-ring-info-method-9 (_type_ symbol) none) ) ) (deftype city-ambush-spot (structure) - ((pos vector :inline :offset-assert 0) - (obj-type uint8 :offset-assert 16) + ((pos vector :inline) + (obj-type uint8) ) - :method-count-assert 9 - :size-assert #x11 - :flag-assert #x900000011 ) (deftype city-ambush-info (structure) - ((count int16 :offset-assert 0) - (array (inline-array city-ambush-spot) :offset-assert 4) + ((count int16) + (array (inline-array city-ambush-spot)) ) - :method-count-assert 10 - :size-assert #x8 - :flag-assert #xa00000008 (:methods - (city-ambush-info-method-9 (_type_ traffic-object-spawn-params) none 9) + (city-ambush-info-method-9 (_type_ traffic-object-spawn-params) none) ) ) diff --git a/goal_src/jak2/levels/city/ctywide-obs.gc b/goal_src/jak2/levels/city/ctywide-obs.gc index a904c8016c3..b9e88cc7248 100644 --- a/goal_src/jak2/levels/city/ctywide-obs.gc +++ b/goal_src/jak2/levels/city/ctywide-obs.gc @@ -8,28 +8,26 @@ ;; DECOMP BEGINS (deftype security-wall (process-drawable) - ((root collide-shape :override) - (pass int32 :offset-assert 200) - (incoming-attack-id uint32 :offset-assert 204) - (next-message-time int64 :offset-assert 208) - (message int32 :offset-assert 216) - (plane plane :inline :offset-assert 224) - (color vector :inline :offset-assert 240) - (target-pos vector :inline :offset-assert 256) - (flash float :offset-assert 272) - (touch-count int32 :offset-assert 276) - (breach symbol :offset-assert 280) + ((root collide-shape :override) + (pass int32) + (incoming-attack-id uint32) + (next-message-time int64) + (message int32) + (plane plane :inline) + (color vector :inline) + (target-pos vector :inline) + (flash float) + (touch-count int32) + (breach symbol) ) - :heap-base #xa0 - :method-count-assert 25 - :size-assert #x11c - :flag-assert #x1900a0011c + (:state-methods + idle-open + idle-close + ) (:methods - (idle-open () _type_ :state 20) - (idle-close () _type_ :state 21) - (security-wall-method-22 (_type_ path-control float) vector 22) - (security-wall-method-23 (_type_) none 23) - (security-wall-method-24 (_type_) none 24) + (security-wall-method-22 (_type_ path-control float) vector) + (security-wall-method-23 (_type_) none) + (security-wall-method-24 (_type_) none) ) ) @@ -39,7 +37,7 @@ :bounds (static-spherem 0 0 0 100.1) ) -(defmethod security-wall-method-23 security-wall ((this security-wall)) +(defmethod security-wall-method-23 ((this security-wall)) (when (< (-> this next-message-time) (current-time)) (set! (-> this next-message-time) (the-as int (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) @@ -189,7 +187,7 @@ (none) ) -(defmethod security-wall-method-24 security-wall ((this security-wall)) +(defmethod security-wall-method-24 ((this security-wall)) (let ((s4-0 *target*)) (when s4-0 (let* ((f0-0 (vector-vector-distance-squared (-> this root trans) (-> s4-0 control trans))) @@ -471,7 +469,7 @@ ) ) -(defmethod security-wall-method-22 security-wall ((this security-wall) (arg0 path-control) (arg1 float)) +(defmethod security-wall-method-22 ((this security-wall) (arg0 path-control) (arg1 float)) (let ((s4-0 (new 'static 'vector)) (s3-0 (new 'static 'vector)) ) @@ -530,7 +528,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! security-wall ((this security-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this security-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -587,22 +585,20 @@ This commonly includes things such as: ) (deftype fruit-stand (process-focusable) - ((incoming-attack-id uint32 :offset-assert 204) - (hack-counter uint32 :offset-assert 208) - (count-sparts uint32 :offset-assert 212) - (first-sparts uint32 :offset-assert 216) - (num-sparts uint32 :offset-assert 220) - (sparts-index uint32 4 :offset-assert 224) - (sparts-pos vector 4 :inline :offset-assert 240) + ((incoming-attack-id uint32) + (hack-counter uint32) + (count-sparts uint32) + (first-sparts uint32) + (num-sparts uint32) + (sparts-index uint32 4) + (sparts-pos vector 4 :inline) ) - :heap-base #xb0 - :method-count-assert 30 - :size-assert #x130 - :flag-assert #x1e00b00130 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (fruit-stand-method-28 (_type_) none 28) - (fruit-stand-method-29 (_type_) none 29) + (fruit-stand-method-28 (_type_) none) + (fruit-stand-method-29 (_type_) none) ) ) @@ -952,7 +948,7 @@ This commonly includes things such as: ) ) -(defmethod fruit-stand-method-28 fruit-stand ((this fruit-stand)) +(defmethod fruit-stand-method-28 ((this fruit-stand)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -979,7 +975,7 @@ This commonly includes things such as: (none) ) -(defmethod fruit-stand-method-29 fruit-stand ((this fruit-stand)) +(defmethod fruit-stand-method-29 ((this fruit-stand)) (logior! (-> this mask) (process-mask crate)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 185) this)) 0 @@ -987,7 +983,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fruit-stand ((this fruit-stand) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fruit-stand) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1008,10 +1004,6 @@ This commonly includes things such as: (deftype cty-fruit-stand (fruit-stand) () - :heap-base #xb0 - :method-count-assert 30 - :size-assert #x130 - :flag-assert #x1e00b00130 ) @@ -1263,35 +1255,33 @@ This commonly includes things such as: ) (deftype cty-guard-turret (process-focusable) - ((incoming-attack-id uint32 :offset-assert 204) - (jm-turret joint-mod :offset-assert 208) - (jm-gunsL joint-mod :offset-assert 212) - (jm-gunsR joint-mod :offset-assert 216) - (angle-turret degrees :offset-assert 220) - (angle-guns degrees :offset-assert 224) - (last-no-zero int64 :offset-assert 232) - (next-time-shot time-frame :offset-assert 240) - (num-shots uint32 :offset-assert 248) - (focus focus :inline :offset-assert 256) - (id int32 :offset-assert 268) - (destroyed symbol :offset-assert 272) - (button-down? symbol :offset-assert 276) - (hit-points int32 :offset-assert 280) + ((incoming-attack-id uint32) + (jm-turret joint-mod) + (jm-gunsL joint-mod) + (jm-gunsR joint-mod) + (angle-turret degrees) + (angle-guns degrees) + (last-no-zero int64) + (next-time-shot time-frame) + (num-shots uint32) + (focus focus :inline) + (id int32) + (destroyed symbol) + (button-down? symbol) + (hit-points int32) ) - :heap-base #xa0 - :method-count-assert 36 - :size-assert #x11c - :flag-assert #x2400a0011c + (:state-methods + idle + hostile + explode + wait-for-pushing + pushed + ) (:methods - (idle () _type_ :state 27) - (hostile () _type_ :state 28) - (explode () _type_ :state 29) - (wait-for-pushing () _type_ :state 30) - (pushed () _type_ :state 31) - (cty-guard-turret-method-32 (_type_) none 32) - (cty-guard-turret-method-33 (_type_) none 33) - (cty-guard-turret-method-34 (_type_) none 34) - (cty-guard-turret-method-35 (_type_) quaternion 35) + (cty-guard-turret-method-32 (_type_) none) + (cty-guard-turret-method-33 (_type_) none) + (cty-guard-turret-method-34 (_type_) none) + (cty-guard-turret-method-35 (_type_) quaternion) ) ) @@ -1374,7 +1364,7 @@ This commonly includes things such as: ) ) -(defmethod get-trans cty-guard-turret ((this cty-guard-turret) (arg0 int)) +(defmethod get-trans ((this cty-guard-turret) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (let ((v1-0 (-> this root))) (cond @@ -1391,7 +1381,7 @@ This commonly includes things such as: ) ) -(defmethod get-inv-mass cty-guard-turret ((this cty-guard-turret)) +(defmethod get-inv-mass ((this cty-guard-turret)) 0.01 ) @@ -1740,7 +1730,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod cty-guard-turret-method-34 cty-guard-turret ((this cty-guard-turret)) +(defmethod cty-guard-turret-method-34 ((this cty-guard-turret)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1815,7 +1805,7 @@ This commonly includes things such as: ) ) -(defmethod cty-guard-turret-method-35 cty-guard-turret ((this cty-guard-turret)) +(defmethod cty-guard-turret-method-35 ((this cty-guard-turret)) (local-vars (sv-192 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2019,7 +2009,7 @@ This commonly includes things such as: ) ) -(defmethod relocate cty-guard-turret ((this cty-guard-turret) (arg0 int)) +(defmethod relocate ((this cty-guard-turret) (arg0 int)) (if (nonzero? (-> this jm-turret)) (&+! (-> this jm-turret) arg0) ) @@ -2032,7 +2022,7 @@ This commonly includes things such as: (call-parent-method this arg0) ) -(defmethod cty-guard-turret-method-32 cty-guard-turret ((this cty-guard-turret)) +(defmethod cty-guard-turret-method-32 ((this cty-guard-turret)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2104,14 +2094,14 @@ This commonly includes things such as: (none) ) -(defmethod cty-guard-turret-method-33 cty-guard-turret ((this cty-guard-turret)) +(defmethod cty-guard-turret-method-33 ((this cty-guard-turret)) (logior! (-> this mask) (process-mask enemy)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cty-guard-turret ((this cty-guard-turret) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cty-guard-turret) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2200,26 +2190,24 @@ This commonly includes things such as: ) (deftype parking-spot (process-drawable) - ((vehicle handle :offset-assert 200) - (spawned symbol :offset-assert 208) - (minimap connection-minimap :offset-assert 212) - (test-sphere sphere :inline :offset-assert 224) + ((vehicle handle) + (spawned symbol) + (minimap connection-minimap) + (test-sphere sphere :inline) ) - :heap-base #x70 - :method-count-assert 25 - :size-assert #xf0 - :flag-assert #x19007000f0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (parking-spot-method-21 (_type_) none 21) - (parking-spot-method-22 (_type_) none 22) - (parking-spot-method-23 (_type_ uint) none 23) - (parking-spot-method-24 (_type_) none 24) + (parking-spot-method-21 (_type_) none) + (parking-spot-method-22 (_type_) none) + (parking-spot-method-23 (_type_ uint) none) + (parking-spot-method-24 (_type_) none) ) ) -(defmethod parking-spot-method-24 parking-spot ((this parking-spot)) +(defmethod parking-spot-method-24 ((this parking-spot)) (let ((gp-0 (new 'stack-no-clear 'collide-query-with-2vec))) (set! (-> gp-0 vec quad) (-> this root trans quad)) (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec quad)) @@ -2252,7 +2240,7 @@ This commonly includes things such as: (none) ) -(defmethod parking-spot-method-21 parking-spot ((this parking-spot)) +(defmethod parking-spot-method-21 ((this parking-spot)) (let ((s5-0 (handle->process (-> this vehicle)))) (cond (s5-0 @@ -2285,7 +2273,7 @@ This commonly includes things such as: (none) ) -(defmethod parking-spot-method-23 parking-spot ((this parking-spot) (arg0 uint)) +(defmethod parking-spot-method-23 ((this parking-spot) (arg0 uint)) (let ((v1-0 (new 'stack-no-clear 'inline-array 'collide-query 1))) (let* ((a0-1 (new 'stack-no-clear 'inline-array 'vector 1)) (a1-1 #x813f9) @@ -2325,7 +2313,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! parking-spot ((this parking-spot) (arg0 entity-actor)) +(defmethod init-from-entity! ((this parking-spot) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2390,23 +2378,21 @@ This commonly includes things such as: ) (deftype propa (process-focusable) - ((sound-id sound-id :offset-assert 204) - (sound-index uint32 :offset-assert 208) - (handle handle :offset-assert 216) - (y-rot float :offset-assert 224) - (hit-points int32 :offset-assert 228) - (incoming-attack-id uint32 :offset-assert 232) + ((sound-id sound-id) + (sound-index uint32) + (handle handle) + (y-rot float) + (hit-points int32) + (incoming-attack-id uint32) ) - :heap-base #x70 - :method-count-assert 32 - :size-assert #xec - :flag-assert #x20007000ec + (:state-methods + idle + broken + ) (:methods - (idle () _type_ :state 27) - (broken () _type_ :state 28) - (propa-method-29 (_type_) none 29) - (propa-method-30 (_type_) none 30) - (propa-method-31 (_type_ vector) none 31) + (propa-method-29 (_type_) none) + (propa-method-30 (_type_) none) + (propa-method-31 (_type_ vector) none) ) ) @@ -2748,7 +2734,7 @@ This commonly includes things such as: ) ) -(defmethod propa-method-31 propa ((this propa) (arg0 vector)) +(defmethod propa-method-31 ((this propa) (arg0 vector)) (let ((s5-0 (the-as process-focusable #f))) (let ((f30-0 (the-as float #x7f800000)) (s3-0 (new 'stack-no-clear 'array 'collide-shape 64)) @@ -2800,7 +2786,7 @@ This commonly includes things such as: (none) ) -(defmethod propa-method-29 propa ((this propa)) +(defmethod propa-method-29 ((this propa)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2838,7 +2824,7 @@ This commonly includes things such as: (none) ) -(defmethod propa-method-30 propa ((this propa)) +(defmethod propa-method-30 ((this propa)) (logior! (-> this mask) (process-mask crate)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 170) this)) 0 @@ -2846,7 +2832,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! propa ((this propa) (arg0 entity-actor)) +(defmethod init-from-entity! ((this propa) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2873,12 +2859,8 @@ This commonly includes things such as: (deftype baron-statue (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -2888,7 +2870,7 @@ This commonly includes things such as: :bounds (static-spherem 0 75 0 83) ) -(defmethod run-logic? baron-statue ((this baron-statue)) +(defmethod run-logic? ((this baron-statue)) #t ) @@ -2898,7 +2880,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! baron-statue ((this baron-statue) (arg0 entity-actor)) +(defmethod init-from-entity! ((this baron-statue) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2922,23 +2904,21 @@ This commonly includes things such as: ) (deftype burning-bush (process-focusable) - ((task game-task-control :offset-assert 204) - (part-off sparticle-launch-control :offset-assert 208) - (part-alert sparticle-launch-control :offset-assert 212) - (angle degrees :offset-assert 216) - (time float :offset-assert 220) + ((task game-task-control) + (part-off sparticle-launch-control) + (part-alert sparticle-launch-control) + (angle degrees) + (time float) ) - :heap-base #x60 - :method-count-assert 33 - :size-assert #xe0 - :flag-assert #x21006000e0 + (:state-methods + idle + talking + menu + ) (:methods - (idle () _type_ :state 27) - (talking () _type_ :state 28) - (menu () _type_ :state 29) - (burning-bush-method-30 (_type_) none 30) - (burning-bush-method-31 (_type_) none 31) - (burning-bush-method-32 (_type_) object 32) + (burning-bush-method-30 (_type_) none) + (burning-bush-method-31 (_type_) none) + (burning-bush-method-32 (_type_) object) ) ) @@ -3740,7 +3720,7 @@ This commonly includes things such as: ) ) -(defmethod burning-bush-method-32 burning-bush ((this burning-bush)) +(defmethod burning-bush-method-32 ((this burning-bush)) (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) @@ -3754,7 +3734,7 @@ This commonly includes things such as: ) ) -(defmethod burning-bush-method-30 burning-bush ((this burning-bush)) +(defmethod burning-bush-method-30 ((this burning-bush)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -3781,7 +3761,7 @@ This commonly includes things such as: (none) ) -(defmethod burning-bush-method-31 burning-bush ((this burning-bush)) +(defmethod burning-bush-method-31 ((this burning-bush)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 173) this)) (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 171) this)) (set! (-> this part-alert) (create-launch-control (-> *part-group-id-table* 172) this)) @@ -3790,7 +3770,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-focusable vs burning-bush. -(defmethod relocate burning-bush ((this burning-bush) (arg0 int)) +(defmethod relocate ((this burning-bush) (arg0 int)) (if (nonzero? (-> this task)) (&+! (-> this task) arg0) ) @@ -3803,7 +3783,7 @@ This commonly includes things such as: (the-as burning-bush ((method-of-type process-focusable relocate) this arg0)) ) -(defmethod run-logic? burning-bush ((this burning-bush)) +(defmethod run-logic? ((this burning-bush)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen)) @@ -3818,7 +3798,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! burning-bush ((this burning-bush) (arg0 entity-actor)) +(defmethod init-from-entity! ((this burning-bush) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3855,23 +3835,19 @@ This commonly includes things such as: ) (deftype barons-ship-lores (process-drawable) - ((paths path-control 3 :offset-assert 200) - (sync sync-eased :inline :offset-assert 216) - (current-path int32 :offset-assert 260) - (forward-backward symbol :offset-assert 264) + ((paths path-control 3) + (sync sync-eased :inline) + (current-path int32) + (forward-backward symbol) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x10c - :flag-assert #x150090010c - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! barons-ship-lores ((this barons-ship-lores) (arg0 entity-actor)) +(defmethod init-from-entity! ((this barons-ship-lores) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3920,7 +3896,7 @@ This commonly includes things such as: (none) ) -(defmethod relocate barons-ship-lores ((this barons-ship-lores) (arg0 int)) +(defmethod relocate ((this barons-ship-lores) (arg0 int)) (if (nonzero? (-> this paths 0)) (&+! (-> this paths 0) arg0) ) @@ -3998,7 +3974,7 @@ This commonly includes things such as: :post ja-post ) -(defmethod city-race-ring-info-method-9 city-race-ring-info ((this city-race-ring-info) (arg0 symbol)) +(defmethod city-race-ring-info-method-9 ((this city-race-ring-info) (arg0 symbol)) (format arg0 "(static-race-ring-info~%") (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%" (-> this pos x) (-> this pos y) (-> this pos z)) (let ((f0-3 (-> this pos w))) @@ -4013,7 +3989,7 @@ This commonly includes things such as: (none) ) -(defmethod city-ambush-info-method-9 city-ambush-info ((this city-ambush-info) (arg0 traffic-object-spawn-params)) +(defmethod city-ambush-info-method-9 ((this city-ambush-info) (arg0 traffic-object-spawn-params)) (set! (-> arg0 position quad) (-> this array 0 pos quad)) (set! (-> arg0 nav-mesh) (find-nearest-nav-mesh (-> arg0 position) (the-as float #x7f800000))) (vector-reset! (-> arg0 velocity)) @@ -4035,18 +4011,16 @@ This commonly includes things such as: ) (deftype lurker-pipe-lid (process-focusable) - ((angle degrees :offset-assert 204) - (rot float :offset-assert 208) + ((angle degrees) + (rot float) ) - :heap-base #x60 - :method-count-assert 31 - :size-assert #xd4 - :flag-assert #x1f006000d4 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (lurker-pipe-lid-method-28 (_type_) none 28) - (lurker-pipe-lid-method-29 (_type_) none 29) - (lurker-pipe-lid-method-30 (_type_) none 30) + (lurker-pipe-lid-method-28 (_type_) none) + (lurker-pipe-lid-method-29 (_type_) none) + (lurker-pipe-lid-method-30 (_type_) none) ) ) @@ -4083,7 +4057,7 @@ This commonly includes things such as: ) ) -(defmethod lurker-pipe-lid-method-28 lurker-pipe-lid ((this lurker-pipe-lid)) +(defmethod lurker-pipe-lid-method-28 ((this lurker-pipe-lid)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -4110,14 +4084,14 @@ This commonly includes things such as: (none) ) -(defmethod lurker-pipe-lid-method-29 lurker-pipe-lid ((this lurker-pipe-lid)) +(defmethod lurker-pipe-lid-method-29 ((this lurker-pipe-lid)) (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! lurker-pipe-lid ((this lurker-pipe-lid) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lurker-pipe-lid) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -4141,15 +4115,13 @@ This commonly includes things such as: (deftype ctyn-lamp (process-focusable) () - :heap-base #x50 - :method-count-assert 31 - :size-assert #xcc - :flag-assert #x1f005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (ctyn-lamp-method-29 (_type_) none 29) - (ctyn-lamp-method-30 (_type_) none 30) + (ctyn-lamp-method-29 (_type_) none) + (ctyn-lamp-method-30 (_type_) none) ) ) @@ -4225,7 +4197,7 @@ This commonly includes things such as: :post #f ) -(defmethod ctyn-lamp-method-29 ctyn-lamp ((this ctyn-lamp)) +(defmethod ctyn-lamp-method-29 ((this ctyn-lamp)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -4270,14 +4242,14 @@ This commonly includes things such as: (none) ) -(defmethod ctyn-lamp-method-30 ctyn-lamp ((this ctyn-lamp)) +(defmethod ctyn-lamp-method-30 ((this ctyn-lamp)) (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ctyn-lamp ((this ctyn-lamp) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ctyn-lamp) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/city/ctywide-part.gc b/goal_src/jak2/levels/city/ctywide-part.gc index d4f7e3083a1..3f7158ff9e6 100644 --- a/goal_src/jak2/levels/city/ctywide-part.gc +++ b/goal_src/jak2/levels/city/ctywide-part.gc @@ -9,19 +9,11 @@ (deftype ctywide-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) (deftype citywide-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/ctywide-tasks.gc b/goal_src/jak2/levels/city/ctywide-tasks.gc index fd67185f065..9798b84bc56 100644 --- a/goal_src/jak2/levels/city/ctywide-tasks.gc +++ b/goal_src/jak2/levels/city/ctywide-tasks.gc @@ -672,15 +672,12 @@ ) (deftype city-bb-racepoint-info (structure) - ((bike-pos vector :inline :offset-assert 0) - (end-pos vector :inline :offset-assert 16) - (bike-angle float :offset-assert 32) - (map symbol :offset-assert 36) - (time float :offset-assert 40) + ((bike-pos vector :inline) + (end-pos vector :inline) + (bike-angle float) + (map symbol) + (time float) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) diff --git a/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc b/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc index a515e9c8b7c..f59829a1728 100644 --- a/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc +++ b/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc @@ -879,28 +879,25 @@ ) (deftype shaker (structure) - ((axis vector :inline :offset-assert 0) - (start-time time-frame :offset-assert 16) - (decay-time float :offset-assert 24) - (amplitude float :offset-assert 28) - (freq float :offset-assert 32) - (y-decay-time float :offset-assert 36) - (y-amplitude float :offset-assert 40) - (y-freq float :offset-assert 44) - (shake float :offset-assert 48) - (y-shake float :offset-assert 52) + ((axis vector :inline) + (start-time time-frame) + (decay-time float) + (amplitude float) + (freq float) + (y-decay-time float) + (y-amplitude float) + (y-freq float) + (shake float) + (y-shake float) ) - :method-count-assert 10 - :size-assert #x38 - :flag-assert #xa00000038 (:methods - (shaker-method-9 (_type_) none 9) + (shaker-method-9 (_type_) none) ) ) ;; WARN: Return type mismatch float vs none. -(defmethod shaker-method-9 shaker ((this shaker)) +(defmethod shaker-method-9 ((this shaker)) (let ((s5-0 (- (current-time) (-> this start-time)))) (set! (-> this shake) (* (-> this amplitude) (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this decay-time)) @@ -976,18 +973,16 @@ ) (deftype farm-marrow (process-focusable) - ((shakers shaker 5 :inline :offset-assert 208) - (incoming-attack-id uint32 :offset-assert 528) + ((shakers shaker 5 :inline) + (incoming-attack-id uint32) ) - :heap-base #x1a0 - :method-count-assert 31 - :size-assert #x214 - :flag-assert #x1f01a00214 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-marrow-method-29 (_type_) none 29) - (farm-marrow-method-30 (_type_) none 30) + (farm-marrow-method-29 (_type_) none) + (farm-marrow-method-30 (_type_) none) ) ) @@ -1179,7 +1174,7 @@ ) ) -(defmethod farm-marrow-method-29 farm-marrow ((this farm-marrow)) +(defmethod farm-marrow-method-29 ((this farm-marrow)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1206,14 +1201,14 @@ (none) ) -(defmethod farm-marrow-method-30 farm-marrow ((this farm-marrow)) +(defmethod farm-marrow-method-30 ((this farm-marrow)) (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-marrow ((this farm-marrow) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farm-marrow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1266,18 +1261,16 @@ This commonly includes things such as: ) (deftype farm-beetree (process-focusable) - ((shakers shaker 2 :inline :offset-assert 208) - (incoming-attack-id uint32 :offset-assert 336) + ((shakers shaker 2 :inline) + (incoming-attack-id uint32) ) - :heap-base #xe0 - :method-count-assert 31 - :size-assert #x154 - :flag-assert #x1f00e00154 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-beetree-method-29 (_type_) none 29) - (farm-beetree-method-30 (_type_) none 30) + (farm-beetree-method-29 (_type_) none) + (farm-beetree-method-30 (_type_) none) ) ) @@ -1428,7 +1421,7 @@ This commonly includes things such as: ) ) -(defmethod farm-beetree-method-29 farm-beetree ((this farm-beetree)) +(defmethod farm-beetree-method-29 ((this farm-beetree)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1455,14 +1448,14 @@ This commonly includes things such as: (none) ) -(defmethod farm-beetree-method-30 farm-beetree ((this farm-beetree)) +(defmethod farm-beetree-method-30 ((this farm-beetree)) (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-beetree ((this farm-beetree) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farm-beetree) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1511,18 +1504,16 @@ This commonly includes things such as: ) (deftype farm-cabbage (process-focusable) - ((shakers shaker 2 :inline :offset-assert 208) - (incoming-attack-id uint32 :offset-assert 336) + ((shakers shaker 2 :inline) + (incoming-attack-id uint32) ) - :heap-base #xe0 - :method-count-assert 31 - :size-assert #x154 - :flag-assert #x1f00e00154 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-cabbage-method-29 (_type_) none 29) - (farm-cabbage-method-30 (_type_) none 30) + (farm-cabbage-method-29 (_type_) none) + (farm-cabbage-method-30 (_type_) none) ) ) @@ -1673,7 +1664,7 @@ This commonly includes things such as: ) ) -(defmethod farm-cabbage-method-29 farm-cabbage ((this farm-cabbage)) +(defmethod farm-cabbage-method-29 ((this farm-cabbage)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1700,14 +1691,14 @@ This commonly includes things such as: (none) ) -(defmethod farm-cabbage-method-30 farm-cabbage ((this farm-cabbage)) +(defmethod farm-cabbage-method-30 ((this farm-cabbage)) (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-cabbage ((this farm-cabbage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farm-cabbage) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1758,18 +1749,16 @@ This commonly includes things such as: ) (deftype farm-small-cabbage (process-focusable) - ((shakers shaker 1 :inline :offset-assert 208) - (incoming-attack-id uint32 :offset-assert 272) + ((shakers shaker 1 :inline) + (incoming-attack-id uint32) ) - :heap-base #xa0 - :method-count-assert 31 - :size-assert #x114 - :flag-assert #x1f00a00114 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-small-cabbage-method-29 (_type_) none 29) - (farm-small-cabbage-method-30 (_type_) none 30) + (farm-small-cabbage-method-29 (_type_) none) + (farm-small-cabbage-method-30 (_type_) none) ) ) @@ -1905,7 +1894,7 @@ This commonly includes things such as: ) ) -(defmethod farm-small-cabbage-method-29 farm-small-cabbage ((this farm-small-cabbage)) +(defmethod farm-small-cabbage-method-29 ((this farm-small-cabbage)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1932,14 +1921,14 @@ This commonly includes things such as: (none) ) -(defmethod farm-small-cabbage-method-30 farm-small-cabbage ((this farm-small-cabbage)) +(defmethod farm-small-cabbage-method-30 ((this farm-small-cabbage)) (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-small-cabbage ((this farm-small-cabbage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farm-small-cabbage) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1990,18 +1979,16 @@ This commonly includes things such as: ) (deftype farm-chilirots (process-focusable) - ((shakers shaker 4 :inline :offset-assert 208) - (incoming-attack-id uint32 :offset-assert 464) + ((shakers shaker 4 :inline) + (incoming-attack-id uint32) ) - :heap-base #x160 - :method-count-assert 31 - :size-assert #x1d4 - :flag-assert #x1f016001d4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-chilirots-method-29 (_type_) none 29) - (farm-chilirots-method-30 (_type_) none 30) + (farm-chilirots-method-29 (_type_) none) + (farm-chilirots-method-30 (_type_) none) ) ) @@ -2181,7 +2168,7 @@ This commonly includes things such as: ) ) -(defmethod farm-chilirots-method-29 farm-chilirots ((this farm-chilirots)) +(defmethod farm-chilirots-method-29 ((this farm-chilirots)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2208,14 +2195,14 @@ This commonly includes things such as: (none) ) -(defmethod farm-chilirots-method-30 farm-chilirots ((this farm-chilirots)) +(defmethod farm-chilirots-method-30 ((this farm-chilirots)) (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-chilirots ((this farm-chilirots) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farm-chilirots) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2246,14 +2233,12 @@ This commonly includes things such as: (deftype farm-sprinkler-barrels (process-focusable) () - :heap-base #x50 - :method-count-assert 30 - :size-assert #xcc - :flag-assert #x1e005000cc + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (farm-sprinkler-barrels-method-28 (_type_) none 28) - (farm-sprinkler-barrels-method-29 (_type_) none 29) + (farm-sprinkler-barrels-method-28 (_type_) none) + (farm-sprinkler-barrels-method-29 (_type_) none) ) ) @@ -2275,7 +2260,7 @@ This commonly includes things such as: ) ) -(defmethod farm-sprinkler-barrels-method-28 farm-sprinkler-barrels ((this farm-sprinkler-barrels)) +(defmethod farm-sprinkler-barrels-method-28 ((this farm-sprinkler-barrels)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2315,14 +2300,14 @@ This commonly includes things such as: (none) ) -(defmethod farm-sprinkler-barrels-method-29 farm-sprinkler-barrels ((this farm-sprinkler-barrels)) +(defmethod farm-sprinkler-barrels-method-29 ((this farm-sprinkler-barrels)) (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-sprinkler-barrels ((this farm-sprinkler-barrels) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farm-sprinkler-barrels) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/city/farm/ctyfarma-part.gc b/goal_src/jak2/levels/city/farm/ctyfarma-part.gc index a3a308d2ea5..0ea0fb7cc3b 100644 --- a/goal_src/jak2/levels/city/farm/ctyfarma-part.gc +++ b/goal_src/jak2/levels/city/farm/ctyfarma-part.gc @@ -9,10 +9,6 @@ (deftype ctyfarma-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/farm/ctyfarmb-part.gc b/goal_src/jak2/levels/city/farm/ctyfarmb-part.gc index 16993cd3924..39f5f6ddfc6 100644 --- a/goal_src/jak2/levels/city/farm/ctyfarmb-part.gc +++ b/goal_src/jak2/levels/city/farm/ctyfarmb-part.gc @@ -9,10 +9,6 @@ (deftype ctyfarmb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/farm/yakow.gc b/goal_src/jak2/levels/city/farm/yakow.gc index 8301b08c0f5..90125fe6cae 100644 --- a/goal_src/jak2/levels/city/farm/yakow.gc +++ b/goal_src/jak2/levels/city/farm/yakow.gc @@ -13,15 +13,11 @@ ) (deftype yakow (nav-enemy) - ((incoming-attack-id uint32 :offset-assert 604) - (grazing basic :offset-assert 608) + ((incoming-attack-id uint32) + (grazing basic) ) - :heap-base #x1f0 - :method-count-assert 179 - :size-assert #x264 - :flag-assert #xb301f00264 - (:methods - (kicked () _type_ :state 178) + (:state-methods + kicked ) ) @@ -202,12 +198,12 @@ (set! (-> *yakow-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod damage-amount-from-attack yakow ((this yakow) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this yakow) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) -(defmethod general-event-handler yakow ((this yakow) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this yakow) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -225,13 +221,13 @@ ) ) -(defmethod enemy-method-123 yakow ((this yakow) (arg0 float)) +(defmethod enemy-method-123 ((this yakow) (arg0 float)) "TODO" (>= arg0 (rand-vu)) ) ;; WARN: Function (method 156 yakow) has a return type of none, but the expression builder found a return statement. -(defmethod nav-enemy-method-156 yakow ((this yakow)) +(defmethod nav-enemy-method-156 ((this yakow)) (dotimes (s5-0 16) (let ((f30-1 (* 4096.0 (get-rand-float-range this -10.0 10.0))) (f0-2 (* 4096.0 (get-rand-float-range this -10.0 10.0))) @@ -415,7 +411,7 @@ :post ja-post ) -(defmethod init-enemy-collision! yakow ((this yakow)) +(defmethod init-enemy-collision! ((this yakow)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -461,7 +457,7 @@ (none) ) -(defmethod init-enemy! yakow ((this yakow)) +(defmethod init-enemy! ((this yakow)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/city/generic/ctygena-part.gc b/goal_src/jak2/levels/city/generic/ctygena-part.gc index 80ff75e0f1f..5917ec5acfc 100644 --- a/goal_src/jak2/levels/city/generic/ctygena-part.gc +++ b/goal_src/jak2/levels/city/generic/ctygena-part.gc @@ -9,19 +9,11 @@ (deftype ctygena-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) (deftype citytest-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/generic/ctygenb-part.gc b/goal_src/jak2/levels/city/generic/ctygenb-part.gc index c6d4a697289..5238521676a 100644 --- a/goal_src/jak2/levels/city/generic/ctygenb-part.gc +++ b/goal_src/jak2/levels/city/generic/ctygenb-part.gc @@ -9,10 +9,6 @@ (deftype ctygenb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/generic/ctygenc-part.gc b/goal_src/jak2/levels/city/generic/ctygenc-part.gc index 688bea7f2b6..ac332bbed6e 100644 --- a/goal_src/jak2/levels/city/generic/ctygenc-part.gc +++ b/goal_src/jak2/levels/city/generic/ctygenc-part.gc @@ -9,10 +9,6 @@ (deftype ctygenc-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/generic/neon-praxis-part.gc b/goal_src/jak2/levels/city/generic/neon-praxis-part.gc index 803d21c67b5..161dad0f53f 100644 --- a/goal_src/jak2/levels/city/generic/neon-praxis-part.gc +++ b/goal_src/jak2/levels/city/generic/neon-praxis-part.gc @@ -1028,27 +1028,25 @@ (define *city-neon-praxis-group-ids* (new 'static 'boxed-array :type int32 #x341 #x340)) (deftype city-neon-praxis (process-drawable) - ((rot vector :inline :offset-assert 208) - (master-enable uint32 :offset-assert 224) - (unknown-k1jn23j1n23 uint32 3 :offset-assert 228) - (praxis-mode uint32 :offset-assert 240) - (back-mode uint32 :offset-assert 244) - (praxis-counter int32 :offset-assert 248) - (back-counter int32 :offset-assert 252) - (parts sparticle-launch-control 2 :offset-assert 256) + ((rot vector :inline) + (master-enable uint32) + (unknown-k1jn23j1n23 uint32 3) + (praxis-mode uint32) + (back-mode uint32) + (praxis-counter int32) + (back-counter int32) + (parts sparticle-launch-control 2) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x108 - :flag-assert #x1600900108 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (city-neon-praxis-method-21 (_type_) none 21) + (city-neon-praxis-method-21 (_type_) none) ) ) -(defmethod deactivate city-neon-praxis ((this city-neon-praxis)) +(defmethod deactivate ((this city-neon-praxis)) (dotimes (s5-0 2) (let ((a0-1 (-> this parts s5-0))) (if (nonzero? a0-1) @@ -1061,7 +1059,7 @@ ) ;; WARN: Return type mismatch process-drawable vs city-neon-praxis. -(defmethod relocate city-neon-praxis ((this city-neon-praxis) (arg0 int)) +(defmethod relocate ((this city-neon-praxis) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this parts v1-0)) (&+! (-> this parts v1-0) arg0) @@ -1071,7 +1069,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod city-neon-praxis-method-21 city-neon-praxis ((this city-neon-praxis)) +(defmethod city-neon-praxis-method-21 ((this city-neon-praxis)) (+! (-> this parts 1 state-counter) 1) (when (!= (-> this parts 1 state-mode 0) (-> this praxis-mode)) (set! (-> this parts 1 state-mode 0) (-> this praxis-mode)) @@ -1154,7 +1152,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! city-neon-praxis ((this city-neon-praxis) (arg0 entity-actor)) +(defmethod init-from-entity! ((this city-neon-praxis) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/city/industrial/ctyinda-part.gc b/goal_src/jak2/levels/city/industrial/ctyinda-part.gc index b3943f2e8f5..d39d8efb06f 100644 --- a/goal_src/jak2/levels/city/industrial/ctyinda-part.gc +++ b/goal_src/jak2/levels/city/industrial/ctyinda-part.gc @@ -9,10 +9,6 @@ (deftype ctyinda-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/industrial/ctyindb-part.gc b/goal_src/jak2/levels/city/industrial/ctyindb-part.gc index 2aa91761a17..c513767f9de 100644 --- a/goal_src/jak2/levels/city/industrial/ctyindb-part.gc +++ b/goal_src/jak2/levels/city/industrial/ctyindb-part.gc @@ -9,10 +9,6 @@ (deftype ctyindb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/kiddogescort/crocesc-h.gc b/goal_src/jak2/levels/city/kiddogescort/crocesc-h.gc index e1bae70dbb5..86a7ba0958e 100644 --- a/goal_src/jak2/levels/city/kiddogescort/crocesc-h.gc +++ b/goal_src/jak2/levels/city/kiddogescort/crocesc-h.gc @@ -8,32 +8,30 @@ ;; DECOMP BEGINS (deftype crocadog-escort (bot) - ((travel-anim-interp float :offset-assert 992) - (anim-speed float :offset-assert 996) - (kid-handle handle :offset-assert 1000) - (pad-ki1jn23ikuj1n2 uint32 4 :offset-assert 1008) - (local-seat-pos vector :inline :offset-assert 1024) - (exit-vehicle-dest vector :inline :offset 368) + ((travel-anim-interp float) + (anim-speed float) + (kid-handle handle) + (pad-ki1jn23ikuj1n2 uint32 4) + (local-seat-pos vector :inline) + (exit-vehicle-dest vector :inline :overlay-at event-param-point) ) - :heap-base #x390 - :method-count-assert 239 - :size-assert #x410 - :flag-assert #xef03900410 + (:state-methods + traveling + traveling-blocked + waiting-idle + waiting-turn + move-to-vehicle + board-vehicle + ride-vehicle + exit-vehicle + knocked-off-vehicle + ) (:methods - (traveling () _type_ :state 225) - (traveling-blocked () _type_ :state 226) - (waiting-idle () _type_ :state 227) - (waiting-turn () _type_ :state 228) - (move-to-vehicle () _type_ :state 229) - (board-vehicle () _type_ :state 230) - (ride-vehicle () _type_ :state 231) - (exit-vehicle () _type_ :state 232) - (knocked-off-vehicle () _type_ :state 233) - (want-exit-vehicle? (_type_ vector) symbol 234) - (go-idle-or-move (_type_) none 235) - (go-waiting-turn (_type_) none 236) - (check-vehicle-exit (_type_) none 237) - (play-walk-anim (_type_) none 238) + (want-exit-vehicle? (_type_ vector) symbol) + (go-idle-or-move (_type_) none) + (go-waiting-turn (_type_) none) + (check-vehicle-exit (_type_) none) + (play-walk-anim (_type_) none) ) ) @@ -46,12 +44,9 @@ ) (deftype crocesct-wait-spot (ai-task) - ((check-done (function crocesct-wait-spot crocadog-escort symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function crocesct-wait-spot crocadog-escort symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) diff --git a/goal_src/jak2/levels/city/kiddogescort/crocesc-task.gc b/goal_src/jak2/levels/city/kiddogescort/crocesc-task.gc index c1201a02b01..bfe5a9a47d6 100644 --- a/goal_src/jak2/levels/city/kiddogescort/crocesc-task.gc +++ b/goal_src/jak2/levels/city/kiddogescort/crocesc-task.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod reset-task! crocesct-wait-spot ((this crocesct-wait-spot)) +(defmethod reset-task! ((this crocesct-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -16,7 +16,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 crocesct-wait-spot ((this crocesct-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this crocesct-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) diff --git a/goal_src/jak2/levels/city/kiddogescort/crocesc.gc b/goal_src/jak2/levels/city/kiddogescort/crocesc.gc index c26b6e2ed49..8ee3c0fed22 100644 --- a/goal_src/jak2/levels/city/kiddogescort/crocesc.gc +++ b/goal_src/jak2/levels/city/kiddogescort/crocesc.gc @@ -180,7 +180,7 @@ (set! (-> *crocadog-escort-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler crocadog-escort ((this crocadog-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this crocadog-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -198,7 +198,7 @@ ) ) -(defmethod get-penetrate-info crocadog-escort ((this crocadog-escort)) +(defmethod get-penetrate-info ((this crocadog-escort)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (let ((v1-1 ((method-of-type bot get-penetrate-info) this))) @@ -206,7 +206,7 @@ ) ) -(defmethod bot-method-193 crocadog-escort ((this crocadog-escort)) +(defmethod bot-method-193 ((this crocadog-escort)) (let* ((t9-0 (method-of-type bot bot-method-193)) (v0-0 (t9-0 this)) ) @@ -217,7 +217,7 @@ ) ) -(defmethod enemy-method-79 crocadog-escort ((this crocadog-escort) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this crocadog-escort) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (gp-0 symbol)) (case arg0 ((3) @@ -240,7 +240,7 @@ gp-0 ) -(defmethod want-exit-vehicle? crocadog-escort ((this crocadog-escort) (arg0 vector)) +(defmethod want-exit-vehicle? ((this crocadog-escort) (arg0 vector)) (let ((s3-0 (handle->process (-> this vehicle-handle)))) (if (or (not s3-0) (not (-> this nav))) (return #f) @@ -271,13 +271,13 @@ ) ) -(defmethod run-logic? crocadog-escort ((this crocadog-escort)) +(defmethod run-logic? ((this crocadog-escort)) (or (not (logtest? (process-mask enemy) (-> *setting-control* user-current process-mask))) (logtest? (-> this bot-flags) (bot-flags bf09)) ) ) -(defmethod enemy-method-97 crocadog-escort ((this crocadog-escort)) +(defmethod enemy-method-97 ((this crocadog-escort)) (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -352,7 +352,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? crocadog-escort ((this crocadog-escort)) +(defmethod alive? ((this crocadog-escort)) (let ((t9-0 (method-of-type bot alive?))) (the-as symbol (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'waiting-idle) (= v1-3 'waiting-turn)) @@ -362,7 +362,7 @@ ) ) -(defmethod init-from-entity! crocadog-escort ((this crocadog-escort) (arg0 entity-actor)) +(defmethod init-from-entity! ((this crocadog-escort) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -374,7 +374,7 @@ This commonly includes things such as: (none) ) -(defmethod init-enemy-collision! crocadog-escort ((this crocadog-escort)) +(defmethod init-enemy-collision! ((this crocadog-escort)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -431,7 +431,7 @@ This commonly includes things such as: (none) ) -(defmethod init! crocadog-escort ((this crocadog-escort)) +(defmethod init! ((this crocadog-escort)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) (t9-0 this) @@ -451,7 +451,7 @@ This commonly includes things such as: (none) ) -(defmethod init-enemy! crocadog-escort ((this crocadog-escort)) +(defmethod init-enemy! ((this crocadog-escort)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (initialize-skeleton @@ -480,11 +480,11 @@ This commonly includes things such as: (none) ) -(defmethod bot-method-214 crocadog-escort ((this crocadog-escort)) +(defmethod bot-method-214 ((this crocadog-escort)) #f ) -(defmethod check-vehicle-exit crocadog-escort ((this crocadog-escort)) +(defmethod check-vehicle-exit ((this crocadog-escort)) (local-vars (v1-22 enemy-flag)) (when (focus-test? this pilot) (let ((v1-4 (handle->process (-> this vehicle-handle)))) @@ -527,7 +527,7 @@ This commonly includes things such as: (none) ) -(defmethod go-hostile crocadog-escort ((this crocadog-escort)) +(defmethod go-hostile ((this crocadog-escort)) (cond ((logtest? (bot-flags bf17) (-> this bot-flags)) (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) @@ -547,19 +547,19 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus crocadog-escort ((this crocadog-escort)) +(defmethod react-to-focus ((this crocadog-escort)) "@TODO - flesh out docs" (go-idle-or-move this) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-waiting-turn crocadog-escort ((this crocadog-escort)) +(defmethod go-waiting-turn ((this crocadog-escort)) (go (method-of-object this waiting-turn)) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle-or-move crocadog-escort ((this crocadog-escort)) +(defmethod go-idle-or-move ((this crocadog-escort)) (if (logtest? (-> this bot-flags) (bot-flags bf15)) (go (method-of-object this move-to-vehicle)) (go (method-of-object this waiting-idle)) @@ -567,7 +567,7 @@ This commonly includes things such as: (none) ) -(defmethod play-walk-anim crocadog-escort ((this crocadog-escort)) +(defmethod play-walk-anim ((this crocadog-escort)) (with-pp (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 9011.2 28672.0))) @@ -624,16 +624,16 @@ This commonly includes things such as: ) ) -(defmethod damage-amount-from-attack crocadog-escort ((this crocadog-escort) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this crocadog-escort) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) -(defmethod bot-method-190 crocadog-escort ((this crocadog-escort)) +(defmethod bot-method-190 ((this crocadog-escort)) #t ) -(defmethod enemy-method-78 crocadog-escort ((this crocadog-escort) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this crocadog-escort) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -648,7 +648,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle crocadog-escort ((this crocadog-escort)) +(defmethod go-idle ((this crocadog-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) (cleanup-for-death this) diff --git a/goal_src/jak2/levels/city/kiddogescort/hal4-course.gc b/goal_src/jak2/levels/city/kiddogescort/hal4-course.gc index 5d8f956adaa..e0b8c91314b 100644 --- a/goal_src/jak2/levels/city/kiddogescort/hal4-course.gc +++ b/goal_src/jak2/levels/city/kiddogescort/hal4-course.gc @@ -8,46 +8,39 @@ ;; DECOMP BEGINS (deftype hal4-course (bot-course) - ((defend-speeches bot-speech-list-shuffle :offset-assert 48) + ((defend-speeches bot-speech-list-shuffle) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) (deftype hal-escort (hal) - ((hal4-course hal4-course :offset 652) - (arrow-handle handle :offset 1032) - (arrestor-handle handle :offset-assert 1040) - (arrestor-time time-frame :offset-assert 1048) - (locked-player-time time-frame :offset-assert 1056) - (dont-fail-until time-frame :offset-assert 1064) - (played-defend-time time-frame :offset-assert 1072) - (played-get-in-time time-frame :offset-assert 1080) - (notice-plane plane :inline :offset-assert 1088) + ((hal4-course hal4-course :overlay-at course) + (arrow-handle handle :offset 1032) + (arrestor-handle handle) + (arrestor-time time-frame) + (locked-player-time time-frame) + (dont-fail-until time-frame) + (played-defend-time time-frame) + (played-get-in-time time-frame) + (notice-plane plane :inline) ) - :heap-base #x3d0 - :method-count-assert 237 - :size-assert #x450 - :flag-assert #xed03d00450 (:methods - (hal-escort-method-227 (_type_) symbol 227) - (hal-escort-method-228 (_type_) symbol 228) - (try-enter-vehicle (_type_) int 229) - (hal-escort-method-230 (_type_) symbol 230) - (init-traffic-params! (_type_ symbol) none 231) - (hal-escort-method-232 (_type_) none 232) - (set-traffic-danger! (_type_) none 233) - (hal-escort-method-234 (_type_ nav-mesh) process 234) - (hal-escort-method-235 (_type_) none 235) - (vehicle-destroyed? (_type_) symbol 236) + (hal-escort-method-227 (_type_) symbol) + (hal-escort-method-228 (_type_) symbol) + (try-enter-vehicle (_type_) int) + (hal-escort-method-230 (_type_) symbol) + (init-traffic-params! (_type_ symbol) none) + (hal-escort-method-232 (_type_) none) + (set-traffic-danger! (_type_) none) + (hal-escort-method-234 (_type_ nav-mesh) process) + (hal-escort-method-235 (_type_) none) + (vehicle-destroyed? (_type_) symbol) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle hal-escort ((this hal-escort)) +(defmethod go-idle ((this hal-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) (cleanup-for-death this) @@ -60,7 +53,7 @@ (none) ) -(defmethod init! hal-escort ((this hal-escort)) +(defmethod init! ((this hal-escort)) "Set defaults for various fields." (let ((t9-0 (method-of-type hal init!))) (t9-0 this) @@ -77,7 +70,7 @@ (none) ) -(defmethod general-event-handler hal-escort ((this hal-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this hal-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -101,7 +94,7 @@ ) ) -(defmethod init-enemy! hal-escort ((this hal-escort)) +(defmethod init-enemy! ((this hal-escort)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type hal init-enemy!))) (t9-0 this) @@ -111,7 +104,7 @@ (none) ) -(defmethod hal-escort-method-235 hal-escort ((this hal-escort)) +(defmethod hal-escort-method-235 ((this hal-escort)) (let* ((s5-0 (handle->process (-> this arrestor-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 @@ -154,13 +147,13 @@ (none) ) -(defmethod vehicle-destroyed? hal-escort ((this hal-escort)) +(defmethod vehicle-destroyed? ((this hal-escort)) (let ((v1-1 (handle->process (-> this vehicle-handle)))) (or (not v1-1) (logtest? (-> (the-as vehicle v1-1) flags) (rigid-body-object-flag dead))) ) ) -(defmethod hal-escort-method-227 hal-escort ((this hal-escort)) +(defmethod hal-escort-method-227 ((this hal-escort)) (let ((s5-0 *target*)) (when (focus-test? s5-0 pilot-riding pilot) (let* ((a0-2 (-> this actor-group 0 data 1 actor)) @@ -201,7 +194,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod hal-escort-method-228 hal-escort ((this hal-escort)) +(defmethod hal-escort-method-228 ((this hal-escort)) (let* ((v1-3 (-> this actor-group 0 data 1 actor)) (a0-1 (when v1-3 (let ((s5-0 (-> v1-3 extra process))) @@ -230,7 +223,7 @@ ) ) -(defmethod hal-escort-method-234 hal-escort ((this hal-escort) (arg0 nav-mesh)) +(defmethod hal-escort-method-234 ((this hal-escort) (arg0 nav-mesh)) (let ((s2-0 (the-as process #f))) (let* ((v1-3 (-> this actor-group 0 data 1 actor)) (gp-0 (when v1-3 @@ -298,7 +291,7 @@ ) ) -(defmethod try-enter-vehicle hal-escort ((this hal-escort)) +(defmethod try-enter-vehicle ((this hal-escort)) "Returns seat index" (let* ((gp-0 (handle->process (-> this vehicle-handle))) (v1-6 (-> this actor-group 0 data 1 actor)) @@ -329,7 +322,7 @@ ) ) -(defmethod hal-escort-method-232 hal-escort ((this hal-escort)) +(defmethod hal-escort-method-232 ((this hal-escort)) (let* ((target *target*) (v1-3 (-> this actor-group 0 data 1 actor)) (s5-0 (when v1-3 @@ -385,7 +378,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-traffic-params! hal-escort ((this hal-escort) (arg0 symbol)) +(defmethod init-traffic-params! ((this hal-escort) (arg0 symbol)) (let ((gp-0 *traffic-manager*)) (send-event gp-0 'deactivate-all) (send-event gp-0 'set-guard-multi-focus #t) @@ -421,7 +414,7 @@ (none) ) -(defmethod set-traffic-danger! hal-escort ((this hal-escort)) +(defmethod set-traffic-danger! ((this hal-escort)) (let ((a0-1 *target*)) (when a0-1 (let ((gp-0 (new 'stack-no-clear 'traffic-danger-info))) @@ -441,7 +434,7 @@ (none) ) -(defmethod hal-escort-method-230 hal-escort ((this hal-escort)) +(defmethod hal-escort-method-230 ((this hal-escort)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -569,7 +562,7 @@ ) ) -(defmethod play-too-far-warn-speech hal-escort ((this hal-escort)) +(defmethod play-too-far-warn-speech ((this hal-escort)) (when (not (channel-active? this (the-as uint 0))) (let ((s5-0 0)) (let* ((v1-5 (-> this actor-group 0 data 1 actor)) diff --git a/goal_src/jak2/levels/city/kiddogescort/kidesc-h.gc b/goal_src/jak2/levels/city/kiddogescort/kidesc-h.gc index ad43d23edb5..1960c2317c6 100644 --- a/goal_src/jak2/levels/city/kiddogescort/kidesc-h.gc +++ b/goal_src/jak2/levels/city/kiddogescort/kidesc-h.gc @@ -8,32 +8,30 @@ ;; DECOMP BEGINS (deftype kid-escort (bot) - ((travel-anim-interp float :offset-assert 992) - (arrest-attempt-time time-frame :offset-assert 1000) - (arrestor-handle handle :offset-assert 1008) - (crocadog-handle handle :offset-assert 1016) - (exit-vehicle-dest vector :inline :offset 368) + ((travel-anim-interp float) + (arrest-attempt-time time-frame) + (arrestor-handle handle) + (crocadog-handle handle) + (exit-vehicle-dest vector :inline :overlay-at event-param-point) ) - :heap-base #x380 - :method-count-assert 240 - :size-assert #x400 - :flag-assert #xf003800400 + (:state-methods + traveling + traveling-blocked + waiting-idle + waiting-turn + move-to-vehicle + board-vehicle + ride-vehicle + exit-vehicle + knocked-off-vehicle + arrested + ) (:methods - (traveling () _type_ :state 225) - (traveling-blocked () _type_ :state 226) - (waiting-idle () _type_ :state 227) - (waiting-turn () _type_ :state 228) - (move-to-vehicle () _type_ :state 229) - (board-vehicle () _type_ :state 230) - (ride-vehicle () _type_ :state 231) - (exit-vehicle () _type_ :state 232) - (knocked-off-vehicle () _type_ :state 233) - (arrested () _type_ :state 234) - (want-exit-vehicle? (_type_ vector) symbol 235) - (check-arrest (_type_) none 236) - (go-waiting-turn (_type_) none 237) - (check-vehicle-exit (_type_) none 238) - (play-walk-anim (_type_) none 239) + (want-exit-vehicle? (_type_ vector) symbol) + (check-arrest (_type_) none) + (go-waiting-turn (_type_) none) + (check-vehicle-exit (_type_) none) + (play-walk-anim (_type_) none) ) ) @@ -46,12 +44,9 @@ ) (deftype kidesct-wait-spot (ai-task) - ((check-done (function kidesct-wait-spot kid-escort symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function kidesct-wait-spot kid-escort symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) diff --git a/goal_src/jak2/levels/city/kiddogescort/kidesc-task.gc b/goal_src/jak2/levels/city/kiddogescort/kidesc-task.gc index 7c46f8a656c..7e4f08112d1 100644 --- a/goal_src/jak2/levels/city/kiddogescort/kidesc-task.gc +++ b/goal_src/jak2/levels/city/kiddogescort/kidesc-task.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod reset-task! kidesct-wait-spot ((this kidesct-wait-spot)) +(defmethod reset-task! ((this kidesct-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -16,7 +16,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 kidesct-wait-spot ((this kidesct-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this kidesct-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) diff --git a/goal_src/jak2/levels/city/kiddogescort/kidesc.gc b/goal_src/jak2/levels/city/kiddogescort/kidesc.gc index 691699f8f3d..787ce201157 100644 --- a/goal_src/jak2/levels/city/kiddogescort/kidesc.gc +++ b/goal_src/jak2/levels/city/kiddogescort/kidesc.gc @@ -180,7 +180,7 @@ (set! (-> *kid-escort-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler kid-escort ((this kid-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this kid-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -234,13 +234,13 @@ ) ) -(defmethod run-logic? kid-escort ((this kid-escort)) +(defmethod run-logic? ((this kid-escort)) (or (not (logtest? (process-mask enemy) (-> *setting-control* user-current process-mask))) (logtest? (-> this bot-flags) (bot-flags bf09)) ) ) -(defmethod enemy-method-97 kid-escort ((this kid-escort)) +(defmethod enemy-method-97 ((this kid-escort)) (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -358,7 +358,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? kid-escort ((this kid-escort)) +(defmethod alive? ((this kid-escort)) (let ((t9-0 (method-of-type bot alive?))) (the-as symbol (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'waiting-idle) (= v1-3 'waiting-turn)) @@ -368,7 +368,7 @@ ) ) -(defmethod init-from-entity! kid-escort ((this kid-escort) (arg0 entity-actor)) +(defmethod init-from-entity! ((this kid-escort) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -380,7 +380,7 @@ This commonly includes things such as: (none) ) -(defmethod init-enemy-collision! kid-escort ((this kid-escort)) +(defmethod init-enemy-collision! ((this kid-escort)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -453,7 +453,7 @@ This commonly includes things such as: (none) ) -(defmethod init! kid-escort ((this kid-escort)) +(defmethod init! ((this kid-escort)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) (t9-0 this) @@ -472,7 +472,7 @@ This commonly includes things such as: (none) ) -(defmethod init-enemy! kid-escort ((this kid-escort)) +(defmethod init-enemy! ((this kid-escort)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (initialize-skeleton @@ -501,24 +501,24 @@ This commonly includes things such as: (none) ) -(defmethod bot-method-214 kid-escort ((this kid-escort)) +(defmethod bot-method-214 ((this kid-escort)) #f ) ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus kid-escort ((this kid-escort)) +(defmethod react-to-focus ((this kid-escort)) "@TODO - flesh out docs" (check-arrest this) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-waiting-turn kid-escort ((this kid-escort)) +(defmethod go-waiting-turn ((this kid-escort)) (go (method-of-object this waiting-turn)) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod check-arrest kid-escort ((this kid-escort)) +(defmethod check-arrest ((this kid-escort)) (let ((s5-0 (handle->process (-> this arrestor-handle)))) (cond ((if (type? s5-0 process-focusable) @@ -537,7 +537,7 @@ This commonly includes things such as: (none) ) -(defmethod play-walk-anim kid-escort ((this kid-escort)) +(defmethod play-walk-anim ((this kid-escort)) (with-pp (let ((f30-0 (-> this nav state speed)) (v1-5 (if (> (-> this skel active-channels) 0) @@ -573,16 +573,16 @@ This commonly includes things such as: ) ) -(defmethod damage-amount-from-attack kid-escort ((this kid-escort) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this kid-escort) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) -(defmethod bot-method-190 kid-escort ((this kid-escort)) +(defmethod bot-method-190 ((this kid-escort)) #t ) -(defmethod enemy-method-78 kid-escort ((this kid-escort) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this kid-escort) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -597,7 +597,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! kid-escort ((this kid-escort) (arg0 vector)) +(defmethod set-cam-height! ((this kid-escort) (arg0 vector)) (the-as meters (cond @@ -615,7 +615,7 @@ This commonly includes things such as: ) ) -(defmethod get-penetrate-info kid-escort ((this kid-escort)) +(defmethod get-penetrate-info ((this kid-escort)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (let ((v1-1 ((method-of-type bot get-penetrate-info) this))) @@ -623,7 +623,7 @@ This commonly includes things such as: ) ) -(defmethod bot-method-193 kid-escort ((this kid-escort)) +(defmethod bot-method-193 ((this kid-escort)) (let* ((t9-0 (method-of-type bot bot-method-193)) (v0-0 (t9-0 this)) ) @@ -634,7 +634,7 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-79 kid-escort ((this kid-escort) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this kid-escort) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (gp-0 symbol)) (case arg0 ((3) @@ -657,7 +657,7 @@ This commonly includes things such as: gp-0 ) -(defmethod want-exit-vehicle? kid-escort ((this kid-escort) (arg0 vector)) +(defmethod want-exit-vehicle? ((this kid-escort) (arg0 vector)) (let ((s3-0 (handle->process (-> this vehicle-handle)))) (if (or (not s3-0) (not (-> this nav))) (return #f) @@ -688,7 +688,7 @@ This commonly includes things such as: ) ) -(defmethod check-vehicle-exit kid-escort ((this kid-escort)) +(defmethod check-vehicle-exit ((this kid-escort)) (local-vars (v1-25 enemy-flag)) (when (focus-test? this pilot) (let ((s5-0 (handle->process (-> this vehicle-handle)))) @@ -731,7 +731,7 @@ This commonly includes things such as: (none) ) -(defmethod go-hostile kid-escort ((this kid-escort)) +(defmethod go-hostile ((this kid-escort)) (cond ((logtest? (bot-flags bf17) (-> this bot-flags)) (logior! (-> this bot-flags) (bot-flags bf09)) @@ -751,7 +751,7 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-102 kid-escort ((this kid-escort)) +(defmethod enemy-method-102 ((this kid-escort)) (if (logtest? (bot-flags bf19) (-> this bot-flags)) #f ((method-of-type bot enemy-method-102) this) @@ -759,7 +759,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle kid-escort ((this kid-escort)) +(defmethod go-idle ((this kid-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) (cleanup-for-death this) diff --git a/goal_src/jak2/levels/city/kiosk/kiosk-part.gc b/goal_src/jak2/levels/city/kiosk/kiosk-part.gc index 0b8b597f17b..c0de051a7b6 100644 --- a/goal_src/jak2/levels/city/kiosk/kiosk-part.gc +++ b/goal_src/jak2/levels/city/kiosk/kiosk-part.gc @@ -11,10 +11,6 @@ (deftype kiosk-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/market/ashelin/ash4-course.gc b/goal_src/jak2/levels/city/market/ashelin/ash4-course.gc index 91aad3d0943..7d3d2bb25c6 100644 --- a/goal_src/jak2/levels/city/market/ashelin/ash4-course.gc +++ b/goal_src/jak2/levels/city/market/ashelin/ash4-course.gc @@ -8,20 +8,16 @@ ;; DECOMP BEGINS (deftype ashelin-tanker (ashelin) - ((suppress traffic-suppression-params :inline :offset-assert 1040) + ((suppress traffic-suppression-params :inline) ) - :heap-base #x3c0 - :method-count-assert 252 - :size-assert #x439 - :flag-assert #xfc03c00439 (:methods - (suppress-traffic (_type_) none 251) + (suppress-traffic (_type_) none) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle ashelin-tanker ((this ashelin-tanker)) +(defmethod go-idle ((this ashelin-tanker)) (cond ((task-node-closed? (game-task-node city-intercept-tanker-resolution)) (cleanup-for-death this) @@ -35,7 +31,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod init! ashelin-tanker ((this ashelin-tanker)) +(defmethod init! ((this ashelin-tanker)) "Set defaults for various fields." (let ((t9-0 (method-of-type ashelin init!))) (t9-0 this) @@ -54,7 +50,7 @@ (none) ) -(defmethod suppress-traffic ashelin-tanker ((this ashelin-tanker)) +(defmethod suppress-traffic ((this ashelin-tanker)) (when *traffic-manager* (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> (new 'static 'vector :x 1837465.6 :y 34406.4 :z 1868103.6 :w 225280.0) quad)) diff --git a/goal_src/jak2/levels/city/market/ashelin/ctyasha-obs.gc b/goal_src/jak2/levels/city/market/ashelin/ctyasha-obs.gc index 10622150231..6fb4c791161 100644 --- a/goal_src/jak2/levels/city/market/ashelin/ctyasha-obs.gc +++ b/goal_src/jak2/levels/city/market/ashelin/ctyasha-obs.gc @@ -851,16 +851,12 @@ ) (deftype tanker-grunt (grunt) - ((expensive-gnd-collide? symbol :offset 692) + ((expensive-gnd-collide? symbol :offset 692) ) - :heap-base #x240 - :method-count-assert 186 - :size-assert #x2b8 - :flag-assert #xba024002b8 ) -(defmethod general-event-handler tanker-grunt ((this tanker-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this tanker-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -897,7 +893,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod init-enemy! tanker-grunt ((this tanker-grunt)) +(defmethod init-enemy! ((this tanker-grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (set! (-> this expensive-gnd-collide?) #t) (let ((t9-0 (method-of-type grunt init-enemy!))) @@ -908,7 +904,7 @@ ) ;; WARN: Return type mismatch uint vs collide-spec. -(defmethod enemy-method-124 tanker-grunt ((this tanker-grunt)) +(defmethod enemy-method-124 ((this tanker-grunt)) "TODO" (let ((t9-0 (method-of-type grunt enemy-method-124))) (t9-0 this) @@ -922,7 +918,7 @@ ) ) -(defmethod go-hostile tanker-grunt ((this tanker-grunt)) +(defmethod go-hostile ((this tanker-grunt)) (set! (-> this expensive-gnd-collide?) #f) (enemy-method-124 this) ((method-of-type grunt go-hostile) this) @@ -954,16 +950,12 @@ ) (deftype tanker-juicer (juicer) - ((expensive-gnd-collide? symbol :offset-assert 848) + ((expensive-gnd-collide? symbol) ) - :heap-base #x2e0 - :method-count-assert 185 - :size-assert #x354 - :flag-assert #xb902e00354 ) -(defmethod general-event-handler tanker-juicer ((this tanker-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this tanker-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -999,7 +991,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod init-enemy! tanker-juicer ((this tanker-juicer)) +(defmethod init-enemy! ((this tanker-juicer)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (set! (-> this expensive-gnd-collide?) #t) (let ((t9-0 (method-of-type juicer init-enemy!))) @@ -1010,7 +1002,7 @@ ) ;; WARN: Return type mismatch uint vs collide-spec. -(defmethod enemy-method-124 tanker-juicer ((this tanker-juicer)) +(defmethod enemy-method-124 ((this tanker-juicer)) "TODO" (let ((t9-0 (method-of-type juicer enemy-method-124))) (t9-0 this) @@ -1024,7 +1016,7 @@ ) ) -(defmethod go-hostile tanker-juicer ((this tanker-juicer)) +(defmethod go-hostile ((this tanker-juicer)) (set! (-> this expensive-gnd-collide?) #f) (enemy-method-124 this) ((method-of-type juicer go-hostile) this) @@ -1056,22 +1048,20 @@ ) (deftype tanker-container (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc8 - :flag-assert #x17005000c8 + (:state-methods + dormant + idle + ) (:methods - (dormant () _type_ :state 20) - (idle () _type_ :state 21) - (tanker-container-method-22 (_type_) none 22) + (tanker-container-method-22 (_type_) none) ) ) ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod tanker-container-method-22 tanker-container ((this tanker-container)) +(defmethod tanker-container-method-22 ((this tanker-container)) (process-spawn simple-nav-sphere #x46733333 @@ -1238,7 +1228,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tanker-container ((this tanker-container) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tanker-container) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1315,15 +1305,11 @@ This commonly includes things such as: ) (deftype tanker-crash (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (dormant () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + dormant + idle ) ) @@ -1359,7 +1345,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tanker-crash ((this tanker-crash) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tanker-crash) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1430,24 +1416,20 @@ This commonly includes things such as: ) (deftype tanker-deadly (process-drawable) - ((root collide-shape :override) - (track-joint int32 :offset-assert 200) - (attack-id uint32 :offset-assert 204) - (die-time time-frame :offset-assert 208) - (prev-pos vector :inline :offset-assert 224) + ((root collide-shape :override) + (track-joint int32) + (attack-id uint32) + (die-time time-frame) + (prev-pos vector :inline) ) - :heap-base #x70 - :method-count-assert 22 - :size-assert #xf0 - :flag-assert #x16007000f0 - (:methods - (active () _type_ :state 20) - (die-fast () _type_ :state 21) + (:state-methods + active + die-fast ) ) -(defmethod run-logic? tanker-deadly ((this tanker-deadly)) +(defmethod run-logic? ((this tanker-deadly)) #t ) diff --git a/goal_src/jak2/levels/city/market/ctymark-obs.gc b/goal_src/jak2/levels/city/market/ctymark-obs.gc index 455a599bd24..b5cc1a642a9 100644 --- a/goal_src/jak2/levels/city/market/ctymark-obs.gc +++ b/goal_src/jak2/levels/city/market/ctymark-obs.gc @@ -980,16 +980,12 @@ ) (deftype market-object (process-focusable) - ((part-explode basic :offset-assert 204) - (explode-matrix matrix :inline :offset-assert 208) + ((part-explode basic) + (explode-matrix matrix :inline) ) - :heap-base #x90 - :method-count-assert 29 - :size-assert #x110 - :flag-assert #x1d00900110 - (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) + (:state-methods + idle + die ) ) @@ -1061,10 +1057,6 @@ (deftype market-basket-a (market-object) () - :heap-base #x90 - :method-count-assert 29 - :size-assert #x110 - :flag-assert #x1d00900110 ) @@ -1076,7 +1068,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-basket-a ((this market-basket-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this market-basket-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1141,10 +1133,6 @@ This commonly includes things such as: (deftype market-basket-b (market-object) () - :heap-base #x90 - :method-count-assert 29 - :size-assert #x110 - :flag-assert #x1d00900110 ) @@ -1156,7 +1144,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-basket-b ((this market-basket-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this market-basket-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1221,10 +1209,6 @@ This commonly includes things such as: (deftype market-crate (market-object) () - :heap-base #x90 - :method-count-assert 29 - :size-assert #x110 - :flag-assert #x1d00900110 ) @@ -1236,7 +1220,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-crate ((this market-crate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this market-crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1301,10 +1285,6 @@ This commonly includes things such as: (deftype market-sack-a (market-object) () - :heap-base #x90 - :method-count-assert 29 - :size-assert #x110 - :flag-assert #x1d00900110 ) @@ -1316,7 +1296,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-sack-a ((this market-sack-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this market-sack-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1381,10 +1361,6 @@ This commonly includes things such as: (deftype market-sack-b (market-object) () - :heap-base #x90 - :method-count-assert 29 - :size-assert #x110 - :flag-assert #x1d00900110 ) @@ -1396,7 +1372,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-sack-b ((this market-sack-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this market-sack-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/city/market/ctymarka-part.gc b/goal_src/jak2/levels/city/market/ctymarka-part.gc index 24f13aa2c1c..98d51aeeb1a 100644 --- a/goal_src/jak2/levels/city/market/ctymarka-part.gc +++ b/goal_src/jak2/levels/city/market/ctymarka-part.gc @@ -9,10 +9,6 @@ (deftype ctymarka-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/market/ctymarkb-part.gc b/goal_src/jak2/levels/city/market/ctymarkb-part.gc index 0c1400d7b3f..b0e42f1ea43 100644 --- a/goal_src/jak2/levels/city/market/ctymarkb-part.gc +++ b/goal_src/jak2/levels/city/market/ctymarkb-part.gc @@ -9,10 +9,6 @@ (deftype ctymarkb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/meet-brutter/meet-brutter.gc b/goal_src/jak2/levels/city/meet-brutter/meet-brutter.gc index 4f7c4a66826..389188ea1de 100644 --- a/goal_src/jak2/levels/city/meet-brutter/meet-brutter.gc +++ b/goal_src/jak2/levels/city/meet-brutter/meet-brutter.gc @@ -15,7 +15,7 @@ ;; DECOMP BEGINS -(defmethod draw hud-lurker ((this hud-lurker)) +(defmethod draw ((this hud-lurker)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -28,14 +28,14 @@ (none) ) -(defmethod update-values hud-lurker ((this hud-lurker)) +(defmethod update-values ((this hud-lurker)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-lurker ((this hud-lurker)) +(defmethod init-callback ((this hud-lurker)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -245,16 +245,12 @@ ) (deftype paddywagon (vehicle-guard) - ((current-level symbol :offset-assert 1076) + ((current-level symbol) ) - :heap-base #x3c0 - :method-count-assert 159 - :size-assert #x438 - :flag-assert #x9f03c00438 ) -(defmethod allocate-and-init-cshape paddywagon ((this paddywagon)) +(defmethod allocate-and-init-cshape ((this paddywagon)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -310,15 +306,12 @@ ) (deftype pw-iter-seg (structure) - ((self paddywagon :offset-assert 0) - (desired-dir vector :inline :offset-assert 16) - (score float :offset-assert 32) - (seg nav-segment :offset-assert 36) - (level symbol :offset-assert 40) + ((self paddywagon) + (desired-dir vector :inline) + (score float) + (seg nav-segment) + (level symbol) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) @@ -439,7 +432,7 @@ ) ) -(defmethod init-skel-and-rigid-body paddywagon ((this paddywagon)) +(defmethod init-skel-and-rigid-body ((this paddywagon)) (with-pp (set! (-> pp level) (level-get *level* 'lmeetbrt)) (initialize-skeleton @@ -458,7 +451,7 @@ ) ) -(defmethod vehicle-method-120 paddywagon ((this paddywagon)) +(defmethod vehicle-method-120 ((this paddywagon)) (let ((t9-0 (method-of-type vehicle-guard vehicle-method-120))) (t9-0 this) ) @@ -471,7 +464,7 @@ (none) ) -(defmethod vehicle-method-128 paddywagon ((this paddywagon)) +(defmethod vehicle-method-128 ((this paddywagon)) (let ((t9-0 (method-of-type vehicle vehicle-method-128))) (t9-0 this) ) @@ -480,19 +473,19 @@ (none) ) -(defmethod vehicle-method-127 paddywagon ((this paddywagon)) +(defmethod vehicle-method-127 ((this paddywagon)) ((method-of-type vehicle vehicle-method-127) this) 0 (none) ) -(defmethod vehicle-method-129 paddywagon ((this paddywagon)) +(defmethod vehicle-method-129 ((this paddywagon)) ((method-of-type vehicle vehicle-method-129) this) 0 (none) ) -(defmethod vehicle-method-134 paddywagon ((this paddywagon) (arg0 process)) +(defmethod vehicle-method-134 ((this paddywagon) (arg0 process)) "Stubbed" (logior! (-> this controller flags) (vehicle-controller-flag ignore-others)) (set! (-> this controller target-speed-offset) 81920.0) @@ -507,7 +500,7 @@ (none) ) -(defmethod vehicle-method-108 paddywagon ((this paddywagon)) +(defmethod vehicle-method-108 ((this paddywagon)) (set! (-> this flags) (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> this flags))) ) @@ -748,26 +741,22 @@ (set! (-> *city-lurker-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (deftype city-lurker (civilian) - ((nav-mesh-aid uint32 :offset-assert 1060) - (index uint32 :offset-assert 1064) - (left-right-interp float :offset-assert 1068) - (front-back-interp float :offset-assert 1072) - (v-speed vector :inline :offset-assert 1088) - (end-pos vector :inline :offset-assert 1104) - (task-done? symbol :offset-assert 1120) - (task-node game-task-node :offset-assert 1124) - (jump-in-pipe? symbol :offset-assert 1128) - (pipe-name string :offset-assert 1132) - (coming-from-pw symbol :offset-assert 1136) + ((nav-mesh-aid uint32) + (index uint32) + (left-right-interp float) + (front-back-interp float) + (v-speed vector :inline) + (end-pos vector :inline) + (task-done? symbol) + (task-node game-task-node) + (jump-in-pipe? symbol) + (pipe-name string) + (coming-from-pw symbol) ) - :heap-base #x400 - :method-count-assert 221 - :size-assert #x474 - :flag-assert #xdd04000474 - (:methods - (go-at-end () _type_ :state 218) - (go-at-pipe () _type_ :state 219) - (wait-at-end () _type_ :state 220) + (:state-methods + go-at-end + go-at-pipe + wait-at-end ) ) @@ -975,7 +964,7 @@ ) ) -(defmethod get-inv-mass city-lurker ((this city-lurker)) +(defmethod get-inv-mass ((this city-lurker)) 0.25 ) @@ -1607,7 +1596,7 @@ ) ) -(defmethod enemy-method-86 city-lurker ((this city-lurker)) +(defmethod enemy-method-86 ((this city-lurker)) (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) (when (and (< (-> gp-0 trans y) (+ 8192.0 (-> this end-pos y))) (-> this jump-in-pipe?)) @@ -1620,16 +1609,16 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 city-lurker ((this city-lurker)) +(defmethod enemy-method-93 ((this city-lurker)) (go (method-of-object this inactive)) (none) ) -(defmethod enemy-method-89 city-lurker ((this city-lurker) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this city-lurker) (arg0 enemy-jump-info)) #f ) -(defmethod enemy-method-87 city-lurker ((this city-lurker) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this city-lurker) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -1645,7 +1634,7 @@ #t ) -(defmethod enemy-method-88 city-lurker ((this city-lurker) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this city-lurker) (arg0 enemy-jump-info)) #f ) @@ -1707,12 +1696,12 @@ ) ) -(defmethod coin-flip? city-lurker ((this city-lurker)) +(defmethod coin-flip? ((this city-lurker)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod damage-amount-from-attack city-lurker ((this city-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this city-lurker) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) @@ -1887,7 +1876,7 @@ ) ) -(defmethod set-behavior! city-lurker ((this city-lurker) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! ((this city-lurker) (arg0 traffic-object-spawn-params)) (format #t "go-traffic-startup ~D~%" (-> arg0 behavior)) (let ((v1-0 (-> arg0 behavior))) (cond @@ -1917,7 +1906,7 @@ (none) ) -(defmethod citizen-init! city-lurker ((this city-lurker)) +(defmethod citizen-init! ((this city-lurker)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) (t9-0 this) @@ -1929,7 +1918,7 @@ (none) ) -(defmethod init-enemy-collision! city-lurker ((this city-lurker)) +(defmethod init-enemy-collision! ((this city-lurker)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1993,7 +1982,7 @@ (none) ) -(defmethod init-enemy! city-lurker ((this city-lurker)) +(defmethod init-enemy! ((this city-lurker)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -2018,7 +2007,7 @@ (none) ) -(defmethod general-event-handler city-lurker ((this city-lurker) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this city-lurker) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -2084,14 +2073,11 @@ ) (deftype city-meet-brutter-info (structure) - ((pos vector :inline :offset-assert 0) - (level symbol :offset-assert 16) - (nav-mesh-id uint32 :offset-assert 20) - (end-pos vector :inline :offset-assert 32) + ((pos vector :inline) + (level symbol) + (nav-mesh-id uint32) + (end-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) @@ -2622,15 +2608,12 @@ ) (deftype city-save-lurkers-info (structure) - ((pos vector :inline :offset-assert 0) - (level symbol :offset-assert 16) - (nav-mesh-id uint32 :offset-assert 20) - (end-pos vector :inline :offset-assert 32) - (pipe-name string :offset-assert 48) + ((pos vector :inline) + (level symbol) + (nav-mesh-id uint32) + (end-pos vector :inline) + (pipe-name string) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) diff --git a/goal_src/jak2/levels/city/onintent/onin-game.gc b/goal_src/jak2/levels/city/onintent/onin-game.gc index aec326186ea..7cb4373fd7e 100644 --- a/goal_src/jak2/levels/city/onintent/onin-game.gc +++ b/goal_src/jak2/levels/city/onintent/onin-game.gc @@ -8,19 +8,16 @@ ;; DECOMP BEGINS (deftype onin-game-event (structure) - ((min-count uint16 :offset-assert 0) - (max-count uint16 :offset-assert 2) - (min-event uint16 :offset-assert 4) - (max-event uint16 :offset-assert 6) - (wave-delay uint16 :offset-assert 8) - (min-wave uint16 :offset-assert 10) - (max-wave uint16 :offset-assert 12) - (gravity meters :offset-assert 16) + ((min-count uint16) + (max-count uint16) + (min-event uint16) + (max-event uint16) + (wave-delay uint16) + (min-wave uint16) + (max-wave uint16) + (gravity meters) ) :pack-me - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -1760,20 +1757,16 @@ ) (deftype onin-game-bubble (process-drawable) - ((bubble-type int32 :offset-assert 200) - (bubble-start-time time-frame :offset-assert 208) - (gravity meters :offset-assert 216) - (dead? symbol :offset-assert 220) - (angle float :offset-assert 224) - (height float :offset-assert 228) + ((bubble-type int32) + (bubble-start-time time-frame) + (gravity meters) + (dead? symbol) + (angle float) + (height float) ) - :heap-base #x70 - :method-count-assert 22 - :size-assert #xe8 - :flag-assert #x16007000e8 - (:methods - (idle () _type_ :state 20) - (fall () _type_ :state 21) + (:state-methods + idle + fall ) ) @@ -2033,41 +2026,39 @@ ) (deftype onin-game (process-drawable) - ((wave int32 :offset-assert 200) - (event int32 :offset-assert 204) - (wave-time time-frame :offset-assert 208) - (wave-delay-time time-frame :offset-assert 216) - (wave-length uint64 :offset-assert 224) - (event-time time-frame :offset-assert 232) - (event-length uint64 :offset-assert 240) - (hud-score handle :offset-assert 248) - (hud-goal handle :offset-assert 256) - (hud-miss handle :offset-assert 264) - (score float :offset-assert 272) - (score-time time-frame :offset-assert 280) - (game (inline-array onin-game-event) :offset-assert 288) - (miss-max int32 :offset-assert 292) - (miss-count int32 :offset-assert 296) - (point-win float :offset-assert 300) - (game-start-time time-frame :offset-assert 304) - (last-type int32 :offset-assert 312) - (current-bonus float :offset-assert 316) - (last-angle float :offset-assert 320) - (wave-start-miss int32 :offset-assert 324) + ((wave int32) + (event int32) + (wave-time time-frame) + (wave-delay-time time-frame) + (wave-length uint64) + (event-time time-frame) + (event-length uint64) + (hud-score handle) + (hud-goal handle) + (hud-miss handle) + (score float) + (score-time time-frame) + (game (inline-array onin-game-event)) + (miss-max int32) + (miss-count int32) + (point-win float) + (game-start-time time-frame) + (last-type int32) + (current-bonus float) + (last-angle float) + (wave-start-miss int32) ) - :heap-base #xd0 - :method-count-assert 28 - :size-assert #x148 - :flag-assert #x1c00d00148 + (:state-methods + hide + wait-for-start + (active symbol) + (lose symbol) + win + ) (:methods - (hide () _type_ :state 20) - (wait-for-start () _type_ :state 21) - (active (symbol) _type_ :state 22) - (lose (symbol) _type_ :state 23) - (win () _type_ :state 24) - (onin-game-method-25 (_type_) none 25) - (onin-game-method-26 (_type_) none 26) - (onin-game-method-27 (_type_ int) none 27) + (onin-game-method-25 (_type_) none) + (onin-game-method-26 (_type_) none) + (onin-game-method-27 (_type_ int) none) ) ) @@ -2080,7 +2071,7 @@ ;; ERROR: Stack slot load at 112 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 112 mismatch: defined as size 4, got size 16 -(defmethod onin-game-method-25 onin-game ((this onin-game)) +(defmethod onin-game-method-25 ((this onin-game)) (local-vars (v0-18 int) (sv-32 process) @@ -2233,7 +2224,7 @@ (none) ) -(defmethod onin-game-method-26 onin-game ((this onin-game)) +(defmethod onin-game-method-26 ((this onin-game)) (cond ((>= (-> *game-info* score) (-> this score)) (set! (-> *game-info* score) (-> this score)) @@ -2250,7 +2241,7 @@ ) ;; WARN: Return type mismatch number vs none. -(defmethod onin-game-method-27 onin-game ((this onin-game) (arg0 int)) +(defmethod onin-game-method-27 ((this onin-game) (arg0 int)) "TODO - bubble type" (let ((s4-0 (the-as onin-game-bubble #f))) (let ((s3-0 0) diff --git a/goal_src/jak2/levels/city/onintent/onintent-part.gc b/goal_src/jak2/levels/city/onintent/onintent-part.gc index 4c49248529c..86123f3ba00 100644 --- a/goal_src/jak2/levels/city/onintent/onintent-part.gc +++ b/goal_src/jak2/levels/city/onintent/onintent-part.gc @@ -9,10 +9,6 @@ (deftype onintent-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/oracle/oracle-part.gc b/goal_src/jak2/levels/city/oracle/oracle-part.gc index f7e403e003b..910e4496173 100644 --- a/goal_src/jak2/levels/city/oracle/oracle-part.gc +++ b/goal_src/jak2/levels/city/oracle/oracle-part.gc @@ -9,10 +9,6 @@ (deftype oracle-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/oracle/oracle-scenes.gc b/goal_src/jak2/levels/city/oracle/oracle-scenes.gc index a9ed7df24c6..25fe08eee92 100644 --- a/goal_src/jak2/levels/city/oracle/oracle-scenes.gc +++ b/goal_src/jak2/levels/city/oracle/oracle-scenes.gc @@ -818,14 +818,10 @@ (deftype oracle-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod init-art! oracle-npc ((this oracle-npc)) +(defmethod init-art! ((this oracle-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -836,7 +832,7 @@ (none) ) -(defmethod get-art-elem oracle-npc ((this oracle-npc)) +(defmethod get-art-elem ((this oracle-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (logior! (-> this draw status) (draw-control-status no-draw-bounds)) diff --git a/goal_src/jak2/levels/city/package/delivery-task.gc b/goal_src/jak2/levels/city/package/delivery-task.gc index a6f0df3d87f..b58609b1df7 100644 --- a/goal_src/jak2/levels/city/package/delivery-task.gc +++ b/goal_src/jak2/levels/city/package/delivery-task.gc @@ -13,29 +13,27 @@ ) (deftype krew-package (process-drawable) - ((attach-object handle :offset-assert 200) - (scale float :offset-assert 208) + ((attach-object handle) + (scale float) ) - :heap-base #x60 - :method-count-assert 24 - :size-assert #xd4 - :flag-assert #x18006000d4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (krew-package-method-22 (_type_) none 22) - (krew-package-method-23 (_type_) none 23) + (krew-package-method-22 (_type_) none) + (krew-package-method-23 (_type_) none) ) ) -(defmethod krew-package-method-22 krew-package ((this krew-package)) +(defmethod krew-package-method-22 ((this krew-package)) (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) -(defmethod krew-package-method-23 krew-package ((this krew-package)) +(defmethod krew-package-method-23 ((this krew-package)) (with-pp (set! (-> pp level) (level-get *level* 'lpackage)) (initialize-skeleton @@ -89,7 +87,7 @@ ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! krew-package ((this krew-package) (arg0 entity-actor)) +(defmethod init-from-entity! ((this krew-package) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/city/palace/ctypal-obs.gc b/goal_src/jak2/levels/city/palace/ctypal-obs.gc index 4b351347da3..0077572206e 100644 --- a/goal_src/jak2/levels/city/palace/ctypal-obs.gc +++ b/goal_src/jak2/levels/city/palace/ctypal-obs.gc @@ -9,10 +9,6 @@ (deftype water-anim-ctypal (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) @@ -43,7 +39,7 @@ ) ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-ctypal ((this water-anim-ctypal)) +(defmethod init-water! ((this water-anim-ctypal)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) (t9-0 this) @@ -71,15 +67,11 @@ (deftype palace-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! palace-door ((this palace-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this palace-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -136,15 +128,11 @@ This commonly includes things such as: ) (deftype ctypal-broke-wall (process-drawable) - ((ent basic :offset-assert 200) + ((ent basic) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16005000cc - (:methods - (idle () _type_ :state 20) - (done () _type_ :state 21) + (:state-methods + idle + done ) ) @@ -178,7 +166,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ctypal-broke-wall ((this ctypal-broke-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ctypal-broke-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -224,12 +212,8 @@ This commonly includes things such as: (deftype ctypal-baron-statue-broken (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -239,7 +223,7 @@ This commonly includes things such as: :bounds (static-spherem 0 5 0 72) ) -(defmethod run-logic? ctypal-baron-statue-broken ((this ctypal-baron-statue-broken)) +(defmethod run-logic? ((this ctypal-baron-statue-broken)) #t ) @@ -249,7 +233,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ctypal-baron-statue-broken ((this ctypal-baron-statue-broken) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ctypal-baron-statue-broken) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/city/palace/ctypal-part.gc b/goal_src/jak2/levels/city/palace/ctypal-part.gc index edc79ff3323..9142345154a 100644 --- a/goal_src/jak2/levels/city/palace/ctypal-part.gc +++ b/goal_src/jak2/levels/city/palace/ctypal-part.gc @@ -9,10 +9,6 @@ (deftype ctypal-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/port/ctyport-part.gc b/goal_src/jak2/levels/city/port/ctyport-part.gc index 5a9d17fb1e9..ae95b259450 100644 --- a/goal_src/jak2/levels/city/port/ctyport-part.gc +++ b/goal_src/jak2/levels/city/port/ctyport-part.gc @@ -9,10 +9,6 @@ (deftype ctyport-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) @@ -3356,25 +3352,23 @@ (define *hiphog-exterior-marquee-daxter-group-ids* (new 'static 'boxed-array :type int32 #x3c8)) (deftype hiphog-exterior-marquee (process-drawable) - ((rot vector :inline :offset-assert 208) - (master-enable uint32 :offset-assert 224) - (pad-ih12nb312 uint32 3 :offset-assert 228) - (mode uint32 :offset-assert 240) - (counter int32 :offset-assert 244) - (parts sparticle-launch-control 1 :offset-assert 248) + ((rot vector :inline) + (master-enable uint32) + (pad-ih12nb312 uint32 3) + (mode uint32) + (counter int32) + (parts sparticle-launch-control 1) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xfc - :flag-assert #x16008000fc + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (hiphog-exterior-marquee-method-21 (_type_) none 21) + (hiphog-exterior-marquee-method-21 (_type_) none) ) ) -(defmethod deactivate hiphog-exterior-marquee ((this hiphog-exterior-marquee)) +(defmethod deactivate ((this hiphog-exterior-marquee)) (dotimes (s5-0 1) (let ((a0-1 (-> this parts s5-0))) (if (nonzero? a0-1) @@ -3387,7 +3381,7 @@ ) ;; WARN: Return type mismatch process-drawable vs hiphog-exterior-marquee. -(defmethod relocate hiphog-exterior-marquee ((this hiphog-exterior-marquee) (arg0 int)) +(defmethod relocate ((this hiphog-exterior-marquee) (arg0 int)) (dotimes (v1-0 1) (if (nonzero? (-> this parts v1-0)) (&+! (-> this parts v1-0) arg0) @@ -3397,7 +3391,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod hiphog-exterior-marquee-method-21 hiphog-exterior-marquee ((this hiphog-exterior-marquee)) +(defmethod hiphog-exterior-marquee-method-21 ((this hiphog-exterior-marquee)) (+! (-> this parts 0 state-counter) 1) (when (!= (-> this parts 0 state-mode 0) (-> this mode)) (set! (-> this parts 0 state-mode 0) (-> this mode)) @@ -3444,7 +3438,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hiphog-exterior-marquee ((this hiphog-exterior-marquee) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hiphog-exterior-marquee) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3519,12 +3513,8 @@ This commonly includes things such as: (deftype farthy (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -3561,7 +3551,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farthy ((this farthy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farthy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/city/port/portrun/portrun.gc b/goal_src/jak2/levels/city/port/portrun/portrun.gc index b2402f0fee1..8b47a3f200c 100644 --- a/goal_src/jak2/levels/city/port/portrun/portrun.gc +++ b/goal_src/jak2/levels/city/port/portrun/portrun.gc @@ -185,7 +185,7 @@ :init-specs ((:r 32.0) (:g 32.0 16.0) (:b 48.0 16.0)) ) -(defmethod draw hud-cargo ((this hud-cargo)) +(defmethod draw ((this hud-cargo)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -198,14 +198,14 @@ (none) ) -(defmethod update-values hud-cargo ((this hud-cargo)) +(defmethod update-values ((this hud-cargo)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-cargo ((this hud-cargo)) +(defmethod init-callback ((this hud-cargo)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -246,24 +246,21 @@ ) (deftype city-port-run-mine-info (structure) - ((handle handle :offset-assert 0) - (pos1-x float :offset-assert 8) - (pos1-y float :offset-assert 12) - (pos1-z float :offset-assert 16) - (type uint32 :offset-assert 20) - (pos2-x float :offset-assert 24) - (pos2-y float :offset-assert 28) - (pos2-z float :offset-assert 32) - (speed float :offset-assert 36) - (offset float :offset-assert 40) - (center-x float :offset 8) - (center-y float :offset 12) - (center-z float :offset 16) - (radius float :offset 24) + ((handle handle) + (pos1-x float) + (pos1-y float) + (pos1-z float) + (type uint32) + (pos2-x float) + (pos2-y float) + (pos2-z float) + (speed float) + (offset float) + (center-x float :overlay-at pos1-x) + (center-y float :overlay-at pos1-y) + (center-z float :overlay-at pos1-z) + (radius float :overlay-at pos2-x) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) @@ -838,34 +835,32 @@ ) (deftype ctyport-mine (process-drawable) - ((root collide-shape-moving :override) - (info city-port-run-mine-info :offset-assert 200) - (base-height float :offset-assert 204) - (center vector :inline :offset-assert 208) - (time-skew uint64 :offset-assert 224) - (period float :offset-assert 232) - (trans-y float :offset-assert 236) - (speed-y float :offset-assert 240) - (acc-y float :offset-assert 244) - (beep basic :offset-assert 248) - (beep-time time-frame :offset-assert 256) - (beep-color vector :inline :offset-assert 272) + ((root collide-shape-moving :override) + (info city-port-run-mine-info) + (base-height float) + (center vector :inline) + (time-skew uint64) + (period float) + (trans-y float) + (speed-y float) + (acc-y float) + (beep basic) + (beep-time time-frame) + (beep-color vector :inline) ) - :heap-base #xa0 - :method-count-assert 24 - :size-assert #x120 - :flag-assert #x1800a00120 + (:state-methods + idle + die + fall + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (fall () _type_ :state 22) - (ctyport-mine-method-23 (_type_) none 23) + (ctyport-mine-method-23 (_type_) none) ) ) ;; WARN: Return type mismatch float vs none. -(defmethod ctyport-mine-method-23 ctyport-mine ((this ctyport-mine)) +(defmethod ctyport-mine-method-23 ((this ctyport-mine)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1175,14 +1170,10 @@ ) (deftype ctyport-spy (process-drawable) - ((trans-y float :offset-assert 200) + ((trans-y float) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xcc - :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1269,19 +1260,17 @@ ) (deftype ctyport-cargo (process-focusable) - ((minimap connection-minimap :offset-assert 204) - (trans-y float :offset-assert 208) - (speed-y float :offset-assert 212) + ((minimap connection-minimap) + (trans-y float) + (speed-y float) ) - :heap-base #x60 - :method-count-assert 31 - :size-assert #xd8 - :flag-assert #x1f006000d8 + (:state-methods + idle + focus-camera + die + ) (:methods - (idle () _type_ :state 27) - (focus-camera () _type_ :state 28) - (die () _type_ :state 29) - (ctyport-cargo-method-30 (_type_) none 30) + (ctyport-cargo-method-30 (_type_) none) ) ) @@ -1437,7 +1426,7 @@ :post transform-post ) -(defmethod ctyport-cargo-method-30 ctyport-cargo ((this ctyport-cargo)) +(defmethod ctyport-cargo-method-30 ((this ctyport-cargo)) (send-event *camera* 'change-target this) (let ((gp-0 (new 'stack 'transformq))) (vector+! (-> gp-0 trans) (-> this root trans) (new 'static 'vector :y 16384.0 :z 28672.0 :w 1.0)) @@ -1568,11 +1557,8 @@ ) (deftype city-port-run-cargo-info (structure) - ((pos vector :inline :offset-assert 0) + ((pos vector :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) diff --git a/goal_src/jak2/levels/city/port/race/errol-chal.gc b/goal_src/jak2/levels/city/port/race/errol-chal.gc index da95e455313..9cf31e41e68 100644 --- a/goal_src/jak2/levels/city/port/race/errol-chal.gc +++ b/goal_src/jak2/levels/city/port/race/errol-chal.gc @@ -390,12 +390,8 @@ (set! (-> *race-bike-b-constants* explosion) *bike-explosion-info*) (deftype errol-racer (vehicle-rider) - ((minimap connection-minimap :offset-assert 224) + ((minimap connection-minimap) ) - :heap-base #x70 - :method-count-assert 36 - :size-assert #xe4 - :flag-assert #x24007000e4 ) @@ -404,7 +400,7 @@ :bounds (static-spherem 0 2 0 3) ) -(defmethod initialize-collision errol-racer ((this errol-racer)) +(defmethod initialize-collision ((this errol-racer)) (set! (-> this level) (level-get *level* 'lerlchal)) (stack-size-set! (-> this main-thread) 256) (when (not (-> this level)) @@ -416,7 +412,7 @@ (none) ) -(defmethod vehicle-rider-method-32 errol-racer ((this errol-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 ((this errol-racer) (arg0 traffic-object-spawn-params)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-errol-racer" (the-as (pointer uint32) #f))) @@ -479,20 +475,16 @@ (deftype vehicle-city-racer (vehicle-racer) () - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3f8 - :flag-assert #x9c038003f8 ) -(defmethod vehicle-method-117 vehicle-city-racer ((this vehicle-city-racer) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 ((this vehicle-city-racer) (arg0 vector) (arg1 int) (arg2 int)) ((method-of-type vehicle vehicle-method-117) this arg0 arg1 arg2) 0 (none) ) -(defmethod vehicle-method-137 vehicle-city-racer ((this vehicle-city-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-137 ((this vehicle-city-racer) (arg0 traffic-object-spawn-params)) (let ((t9-0 vehicle-rider-spawn) (v1-0 (-> arg0 user-data)) ) @@ -509,7 +501,7 @@ (none) ) -(defmethod vehicle-racer-method-154 vehicle-city-racer ((this vehicle-city-racer)) +(defmethod vehicle-racer-method-154 ((this vehicle-city-racer)) (cond ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) (let ((f0-0 368640.0)) @@ -546,19 +538,15 @@ (deftype race-bike-a (vehicle-city-racer) () - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3f8 - :flag-assert #x9c038003f8 ) ;; WARN: Return type mismatch vehicle-city-racer vs race-bike-a. -(defmethod relocate race-bike-a ((this race-bike-a) (arg0 int)) +(defmethod relocate ((this race-bike-a) (arg0 int)) (the-as race-bike-a ((method-of-type vehicle-city-racer relocate) this arg0)) ) -(defmethod allocate-and-init-cshape race-bike-a ((this race-bike-a)) +(defmethod allocate-and-init-cshape ((this race-bike-a)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -611,7 +599,7 @@ (none) ) -(defmethod init-skel-and-rigid-body race-bike-a ((this race-bike-a)) +(defmethod init-skel-and-rigid-body ((this race-bike-a)) (lwide-entity-hack) (initialize-skeleton this @@ -626,19 +614,15 @@ (deftype race-bike-b (vehicle-city-racer) () - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3f8 - :flag-assert #x9c038003f8 ) ;; WARN: Return type mismatch vehicle-racer vs race-bike-b. -(defmethod relocate race-bike-b ((this race-bike-b) (arg0 int)) +(defmethod relocate ((this race-bike-b) (arg0 int)) (the-as race-bike-b ((method-of-type vehicle-racer relocate) this arg0)) ) -(defmethod allocate-and-init-cshape race-bike-b ((this race-bike-b)) +(defmethod allocate-and-init-cshape ((this race-bike-b)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -691,7 +675,7 @@ (none) ) -(defmethod init-skel-and-rigid-body race-bike-b ((this race-bike-b)) +(defmethod init-skel-and-rigid-body ((this race-bike-b)) (lwide-entity-hack) (initialize-skeleton this @@ -705,27 +689,25 @@ ) (deftype turbo-ring (process-drawable) - ((root collide-shape :override) - (touch-time time-frame :offset-assert 200) - (minimap connection-minimap :offset-assert 208) - (player-got symbol :offset-assert 212) - (persistent symbol :offset-assert 216) - (id int8 :offset-assert 220) - (boost float :offset-assert 224) - (plane vector :inline :offset-assert 240) - (part-track handle :offset-assert 256) - (mat matrix :inline :offset-assert 272) + ((root collide-shape :override) + (touch-time time-frame) + (minimap connection-minimap) + (player-got symbol) + (persistent symbol) + (id int8) + (boost float) + (plane vector :inline) + (part-track handle) + (mat matrix :inline) ) - :heap-base #xd0 - :method-count-assert 25 - :size-assert #x150 - :flag-assert #x1900d00150 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (turbo-ring-method-22 (_type_) none 22) - (turbo-ring-method-23 (_type_) none 23) - (turbo-ring-method-24 (_type_) none 24) + (turbo-ring-method-22 (_type_) none) + (turbo-ring-method-23 (_type_) none) + (turbo-ring-method-24 (_type_) none) ) ) @@ -819,7 +801,7 @@ ) ) -(defmethod turbo-ring-method-22 turbo-ring ((this turbo-ring)) +(defmethod turbo-ring-method-22 ((this turbo-ring)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrate-using) (the-as penetrate -1)) (set! (-> s5-0 penetrated-by) (the-as penetrate -1)) @@ -841,7 +823,7 @@ (none) ) -(defmethod turbo-ring-method-23 turbo-ring ((this turbo-ring)) +(defmethod turbo-ring-method-23 ((this turbo-ring)) (let ((s5-0 (-> this mat))) (let ((s4-0 (new 'stack-no-clear 'quaternion))) (quaternion-rotate-local-y! s4-0 (-> this root quat) 16384.0) diff --git a/goal_src/jak2/levels/city/power/ctypower.gc b/goal_src/jak2/levels/city/power/ctypower.gc index 10eb04d3cba..c7660ac1c70 100644 --- a/goal_src/jak2/levels/city/power/ctypower.gc +++ b/goal_src/jak2/levels/city/power/ctypower.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod draw hud-turret ((this hud-turret)) +(defmethod draw ((this hud-turret)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -20,14 +20,14 @@ (none) ) -(defmethod update-values hud-turret ((this hud-turret)) +(defmethod update-values ((this hud-turret)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-turret ((this hud-turret)) +(defmethod init-callback ((this hud-turret)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) diff --git a/goal_src/jak2/levels/city/protect/protect.gc b/goal_src/jak2/levels/city/protect/protect.gc index 406c10af3cd..ec7fc501e2a 100644 --- a/goal_src/jak2/levels/city/protect/protect.gc +++ b/goal_src/jak2/levels/city/protect/protect.gc @@ -13,30 +13,28 @@ ) (deftype seal-of-mar (process-drawable) - ((attach-object uint64 :offset-assert 200) - (scale float :offset-assert 208) - (trans-y float :offset-assert 212) + ((attach-object uint64) + (scale float) + (trans-y float) ) - :heap-base #x60 - :method-count-assert 24 - :size-assert #xd8 - :flag-assert #x18006000d8 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (seal-of-mar-method-22 (_type_) none 22) - (seal-of-mar-method-23 (_type_) none 23) + (seal-of-mar-method-22 (_type_) none) + (seal-of-mar-method-23 (_type_) none) ) ) -(defmethod seal-of-mar-method-22 seal-of-mar ((this seal-of-mar)) +(defmethod seal-of-mar-method-22 ((this seal-of-mar)) (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) -(defmethod seal-of-mar-method-23 seal-of-mar ((this seal-of-mar)) +(defmethod seal-of-mar-method-23 ((this seal-of-mar)) (with-pp (set! (-> pp level) (level-get *level* 'lprotect)) (initialize-skeleton @@ -69,7 +67,7 @@ ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! seal-of-mar ((this seal-of-mar) (arg0 entity-actor)) +(defmethod init-from-entity! ((this seal-of-mar) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -102,17 +100,14 @@ This commonly includes things such as: ) (deftype city-slums-transport-info (structure) - ((id uint32 :offset-assert 0) - (spawned basic :offset-assert 4) - (plane-pos vector :inline :offset-assert 16) - (plane-quat quaternion :inline :offset-assert 32) - (t-pos vector :inline :offset-assert 48) - (t-quat quaternion :inline :offset-assert 64) - (num-guard uint32 :offset-assert 80) + ((id uint32) + (spawned basic) + (plane-pos vector :inline) + (plane-quat quaternion :inline) + (t-pos vector :inline) + (t-quat quaternion :inline) + (num-guard uint32) ) - :method-count-assert 9 - :size-assert #x54 - :flag-assert #x900000054 ) diff --git a/goal_src/jak2/levels/city/sack/collection-task.gc b/goal_src/jak2/levels/city/sack/collection-task.gc index ca79f16ba17..b171603a837 100644 --- a/goal_src/jak2/levels/city/sack/collection-task.gc +++ b/goal_src/jak2/levels/city/sack/collection-task.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod draw hud-moneybag ((this hud-moneybag)) +(defmethod draw ((this hud-moneybag)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 462.0 (* 130.0 (-> this offset)))) @@ -20,14 +20,14 @@ (none) ) -(defmethod update-values hud-moneybag ((this hud-moneybag)) +(defmethod update-values ((this hud-moneybag)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-moneybag ((this hud-moneybag)) +(defmethod init-callback ((this hud-moneybag)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -52,19 +52,17 @@ (deftype krew-collection-item (process-drawable) () - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc8 - :flag-assert #x17005000c8 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (find-ground (_type_) symbol 22) + (find-ground (_type_) symbol) ) ) -(defmethod find-ground krew-collection-item ((this krew-collection-item)) +(defmethod find-ground ((this krew-collection-item)) "TODO - understand the collision query stuff more @returns whether or not the [[self]] is above the ground" (let ((on-ground? #f)) diff --git a/goal_src/jak2/levels/city/shuttle/shuttle.gc b/goal_src/jak2/levels/city/shuttle/shuttle.gc index a0c082bd037..76b20655d64 100644 --- a/goal_src/jak2/levels/city/shuttle/shuttle.gc +++ b/goal_src/jak2/levels/city/shuttle/shuttle.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod draw hud-citizen ((this hud-citizen)) +(defmethod draw ((this hud-citizen)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 452.0 (* 130.0 (-> this offset)))) @@ -20,14 +20,14 @@ (none) ) -(defmethod update-values hud-citizen ((this hud-citizen)) +(defmethod update-values ((this hud-citizen)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-citizen ((this hud-citizen)) +(defmethod init-callback ((this hud-citizen)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -247,21 +247,17 @@ (set! (-> *citizen-rebel-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (deftype citizen-rebel (citizen-norm) - ((nav-mesh-aid actor-id :offset-assert 1060) - (done? symbol :offset-assert 1064) - (task-node uint16 :offset-assert 1068) - (end-pos vector :inline :offset-assert 1072) - (index uint32 :offset-assert 1088) - (gui-id sound-id :offset-assert 1092) + ((nav-mesh-aid actor-id) + (done? symbol) + (task-node uint16) + (end-pos vector :inline) + (index uint32) + (gui-id sound-id) ) - :heap-base #x3d0 - :method-count-assert 219 - :size-assert #x448 - :flag-assert #xdb03d00448 ) -(defmethod cleanup-for-death citizen-rebel ((this citizen-rebel)) +(defmethod cleanup-for-death ((this citizen-rebel)) (with-pp (when (and (zero? (-> this hit-points)) (not (-> this done?))) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -643,7 +639,7 @@ ) ;; WARN: disable def twice: 51. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler citizen-rebel ((this citizen-rebel) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this citizen-rebel) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -691,7 +687,7 @@ ) ) -(defmethod enemy-method-58 citizen-rebel ((this citizen-rebel) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 ((this citizen-rebel) (arg0 process) (arg1 event-message-block)) (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) (v0-0 (t9-0 this arg0 arg1)) ) @@ -702,7 +698,7 @@ ) ) -(defmethod get-penetrate-info citizen-rebel ((this citizen-rebel)) +(defmethod get-penetrate-info ((this citizen-rebel)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (let ((v1-1 ((method-of-type nav-enemy get-penetrate-info) this))) @@ -764,7 +760,7 @@ ) ) -(defmethod init-enemy! citizen-rebel ((this citizen-rebel)) +(defmethod init-enemy! ((this citizen-rebel)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -849,7 +845,7 @@ (none) ) -(defmethod init-enemy-collision! citizen-rebel ((this citizen-rebel)) +(defmethod init-enemy-collision! ((this citizen-rebel)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -913,7 +909,7 @@ (none) ) -(defmethod citizen-init! citizen-rebel ((this citizen-rebel)) +(defmethod citizen-init! ((this citizen-rebel)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) (t9-0 this) @@ -956,14 +952,11 @@ ) (deftype city-shuttle-info (structure) - ((pos vector :inline :offset-assert 0) - (level symbol :offset-assert 16) - (nav-mesh-id uint32 :offset-assert 20) - (time time-frame :offset-assert 24) + ((pos vector :inline) + (level symbol) + (nav-mesh-id uint32) + (time time-frame) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) diff --git a/goal_src/jak2/levels/city/slums/ctysluma-part.gc b/goal_src/jak2/levels/city/slums/ctysluma-part.gc index a41727ba81b..363cf5bdff6 100644 --- a/goal_src/jak2/levels/city/slums/ctysluma-part.gc +++ b/goal_src/jak2/levels/city/slums/ctysluma-part.gc @@ -11,10 +11,6 @@ (deftype ctysluma-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/slums/ctyslumb-part.gc b/goal_src/jak2/levels/city/slums/ctyslumb-part.gc index 7e38b482452..ec02990739b 100644 --- a/goal_src/jak2/levels/city/slums/ctyslumb-part.gc +++ b/goal_src/jak2/levels/city/slums/ctyslumb-part.gc @@ -11,10 +11,6 @@ (deftype ctyslumb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/slums/ctyslumc-part.gc b/goal_src/jak2/levels/city/slums/ctyslumc-part.gc index 18c705a06ca..16b5bb16da1 100644 --- a/goal_src/jak2/levels/city/slums/ctyslumc-part.gc +++ b/goal_src/jak2/levels/city/slums/ctyslumc-part.gc @@ -9,10 +9,6 @@ (deftype ctyslumc-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/slums/kor/hal3-course.gc b/goal_src/jak2/levels/city/slums/kor/hal3-course.gc index 2835429706a..b53a6e82538 100644 --- a/goal_src/jak2/levels/city/slums/kor/hal3-course.gc +++ b/goal_src/jak2/levels/city/slums/kor/hal3-course.gc @@ -10,9 +10,6 @@ (deftype hal3-course (bot-course) ((transport handle :offset-assert 48) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) @@ -21,18 +18,14 @@ (alley-bbox bounding-box :inline :offset-assert 1040) (suppress traffic-suppression-params 2 :inline :offset-assert 1072) ) - :heap-base #x410 - :method-count-assert 229 - :size-assert #x490 - :flag-assert #xe504100490 (:methods - (hal-help-kid-method-227 (_type_) none 227) - (hal-help-kid-method-228 (_type_ vector) none 228) + (hal-help-kid-method-227 (_type_) none) + (hal-help-kid-method-228 (_type_ vector) none) ) ) -(defmethod init! hal-help-kid ((obj hal-help-kid)) +(defmethod init! ((obj hal-help-kid)) "Set defaults for various fields." (let ((t9-0 (method-of-type hal init!))) (t9-0 obj) @@ -61,7 +54,7 @@ (none) ) -(defmethod hal-help-kid-method-228 hal-help-kid ((obj hal-help-kid) (arg0 vector)) +(defmethod hal-help-kid-method-228 ((obj hal-help-kid) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> v1-0 sphere quad) (-> arg0 quad)) (set! (-> v1-0 sphere r) 32768.0) @@ -76,7 +69,7 @@ (none) ) -(defmethod general-event-handler hal-help-kid ((obj hal-help-kid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((obj hal-help-kid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v0-0 object)) @@ -104,7 +97,7 @@ ) ) -(defmethod hal-help-kid-method-227 hal-help-kid ((obj hal-help-kid)) +(defmethod hal-help-kid-method-227 ((obj hal-help-kid)) (let ((s4-0 (-> obj suppress)) (gp-0 (-> obj suppress 1)) ) @@ -127,7 +120,7 @@ ) ;; WARN: Return type mismatch nav-mesh vs none. -(defmethod init-enemy! hal-help-kid ((obj hal-help-kid)) +(defmethod init-enemy! ((obj hal-help-kid)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type hal init-enemy!))) (t9-0 obj) diff --git a/goal_src/jak2/levels/city/slums/kor/kid-h.gc b/goal_src/jak2/levels/city/slums/kor/kid-h.gc index 20ab67bc4fd..2d7f7648097 100644 --- a/goal_src/jak2/levels/city/slums/kor/kid-h.gc +++ b/goal_src/jak2/levels/city/slums/kor/kid-h.gc @@ -8,25 +8,23 @@ ;; DECOMP BEGINS (deftype kid (bot) - ((travel-anim-interp float :offset-assert 992) - (arrest-attempt-time time-frame :offset-assert 1000) - (arrestor-handle handle :offset-assert 1008) + ((travel-anim-interp float) + (arrest-attempt-time time-frame) + (arrestor-handle handle) ) - :heap-base #x380 - :method-count-assert 235 - :size-assert #x3f8 - :flag-assert #xeb038003f8 + (:state-methods + traveling + traveling-blocked + waiting-with-kor + waiting-idle + waiting-turn + scared-idle + arrested + ) (:methods - (traveling () _type_ :state 225) - (traveling-blocked () _type_ :state 226) - (waiting-with-kor () _type_ :state 227) - (waiting-idle () _type_ :state 228) - (waiting-turn () _type_ :state 229) - (scared-idle () _type_ :state 230) - (arrested () _type_ :state 231) - (kid-method-232 (_type_) none 232) - (kid-method-233 (_type_) none 233) - (kid-method-234 (_type_) none 234) + (kid-method-232 (_type_) none) + (kid-method-233 (_type_) none) + (kid-method-234 (_type_) none) ) ) @@ -39,12 +37,9 @@ ) (deftype kidt-wait-spot (ai-task) - ((check-done (function kidt-wait-spot kid symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function kidt-wait-spot kid symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) diff --git a/goal_src/jak2/levels/city/slums/kor/kid-task.gc b/goal_src/jak2/levels/city/slums/kor/kid-task.gc index 680d11bf9cd..ec45aebe775 100644 --- a/goal_src/jak2/levels/city/slums/kor/kid-task.gc +++ b/goal_src/jak2/levels/city/slums/kor/kid-task.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod reset-task! kidt-wait-spot ((this kidt-wait-spot)) +(defmethod reset-task! ((this kidt-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -16,7 +16,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 kidt-wait-spot ((this kidt-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this kidt-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) diff --git a/goal_src/jak2/levels/city/slums/kor/kid.gc b/goal_src/jak2/levels/city/slums/kor/kid.gc index 08a193e34b7..721de7fb132 100644 --- a/goal_src/jak2/levels/city/slums/kor/kid.gc +++ b/goal_src/jak2/levels/city/slums/kor/kid.gc @@ -180,7 +180,7 @@ (set! (-> *kid-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler kid ((this kid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this kid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -228,7 +228,7 @@ ) ) -(defmethod enemy-method-97 kid ((this kid)) +(defmethod enemy-method-97 ((this kid)) (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -345,7 +345,7 @@ ) ) -(defmethod alive? kid ((this kid)) +(defmethod alive? ((this kid)) (let ((t9-0 (method-of-type bot alive?))) (and (t9-0 this) (not (and (-> this next-state) (let ((v1-4 (-> this next-state name))) @@ -358,7 +358,7 @@ ) ) -(defmethod init-enemy-collision! kid ((this kid)) +(defmethod init-enemy-collision! ((this kid)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -431,7 +431,7 @@ (none) ) -(defmethod init! kid ((this kid)) +(defmethod init! ((this kid)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) (t9-0 this) @@ -449,7 +449,7 @@ (none) ) -(defmethod init-enemy! kid ((this kid)) +(defmethod init-enemy! ((this kid)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (initialize-skeleton @@ -473,29 +473,29 @@ (none) ) -(defmethod bot-method-214 kid ((this kid)) +(defmethod bot-method-214 ((this kid)) #f ) ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile kid ((this kid)) +(defmethod go-hostile ((this kid)) (kid-method-232 this) ) ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus kid ((this kid)) +(defmethod react-to-focus ((this kid)) "@TODO - flesh out docs" (kid-method-232 this) ) ;; WARN: Return type mismatch object vs none. -(defmethod kid-method-233 kid ((this kid)) +(defmethod kid-method-233 ((this kid)) (go (method-of-object this waiting-turn)) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod kid-method-232 kid ((this kid)) +(defmethod kid-method-232 ((this kid)) (let ((s5-0 (handle->process (-> this arrestor-handle)))) (cond ((if (type? s5-0 process-focusable) @@ -514,7 +514,7 @@ (none) ) -(defmethod kid-method-234 kid ((this kid)) +(defmethod kid-method-234 ((this kid)) (with-pp (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 6144.0 22528.0))) @@ -571,7 +571,7 @@ ) ) -(defmethod damage-amount-from-attack kid ((this kid) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this kid) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (if (= (-> this course course-id) 7) 0 @@ -579,11 +579,11 @@ ) ) -(defmethod bot-method-190 kid ((this kid)) +(defmethod bot-method-190 ((this kid)) #t ) -(defmethod enemy-method-78 kid ((this kid) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this kid) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -598,7 +598,7 @@ ) ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! kid ((this kid) (arg0 vector)) +(defmethod set-cam-height! ((this kid) (arg0 vector)) (the-as meters (cond @@ -616,7 +616,7 @@ ) ) -(defmethod enemy-method-102 kid ((this kid)) +(defmethod enemy-method-102 ((this kid)) (if (logtest? (bot-flags bf20) (-> this bot-flags)) #f ((method-of-type bot enemy-method-102) this) @@ -624,7 +624,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle kid ((this kid)) +(defmethod go-idle ((this kid)) (cond ((= (-> this course course-id) 7) (cond diff --git a/goal_src/jak2/levels/city/slums/kor/kor-h.gc b/goal_src/jak2/levels/city/slums/kor/kor-h.gc index 56660f3335f..a9970f2099b 100644 --- a/goal_src/jak2/levels/city/slums/kor/kor-h.gc +++ b/goal_src/jak2/levels/city/slums/kor/kor-h.gc @@ -8,25 +8,23 @@ ;; DECOMP BEGINS (deftype kor (bot) - ((travel-anim-interp float :offset-assert 992) - (arrest-attempt-time time-frame :offset-assert 1000) - (arrestor-handle handle :offset-assert 1008) + ((travel-anim-interp float) + (arrest-attempt-time time-frame) + (arrestor-handle handle) ) - :heap-base #x380 - :method-count-assert 235 - :size-assert #x3f8 - :flag-assert #xeb038003f8 + (:state-methods + traveling + traveling-blocked + waiting-with-kid + waiting-idle + waiting-turn + scared-idle + arrested + ) (:methods - (traveling () _type_ :state 225) - (traveling-blocked () _type_ :state 226) - (waiting-with-kid () _type_ :state 227) - (waiting-idle () _type_ :state 228) - (waiting-turn () _type_ :state 229) - (scared-idle () _type_ :state 230) - (arrested () _type_ :state 231) - (kor-method-232 (_type_) none 232) - (kor-method-233 (_type_) none 233) - (kor-method-234 (_type_) none 234) + (kor-method-232 (_type_) none) + (kor-method-233 (_type_) none) + (kor-method-234 (_type_) none) ) ) @@ -39,12 +37,9 @@ ) (deftype kort-wait-spot (ai-task) - ((check-done (function kort-wait-spot kor symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function kort-wait-spot kor symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) diff --git a/goal_src/jak2/levels/city/slums/kor/kor-task.gc b/goal_src/jak2/levels/city/slums/kor/kor-task.gc index d52c76b74e1..69ca495abc4 100644 --- a/goal_src/jak2/levels/city/slums/kor/kor-task.gc +++ b/goal_src/jak2/levels/city/slums/kor/kor-task.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod reset-task! kort-wait-spot ((this kort-wait-spot)) +(defmethod reset-task! ((this kort-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -16,7 +16,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 kort-wait-spot ((this kort-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this kort-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) diff --git a/goal_src/jak2/levels/city/slums/kor/kor.gc b/goal_src/jak2/levels/city/slums/kor/kor.gc index 491a8f36557..dd006da53a3 100644 --- a/goal_src/jak2/levels/city/slums/kor/kor.gc +++ b/goal_src/jak2/levels/city/slums/kor/kor.gc @@ -8,11 +8,8 @@ ;; DECOMP BEGINS (deftype kor-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) @@ -189,7 +186,7 @@ (set! (-> *kor-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler kor ((this kor) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this kor) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -232,7 +229,7 @@ ) ) -(defmethod enemy-method-97 kor ((this kor)) +(defmethod enemy-method-97 ((this kor)) (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -349,7 +346,7 @@ ) ) -(defmethod alive? kor ((this kor)) +(defmethod alive? ((this kor)) (let ((t9-0 (method-of-type bot alive?))) (and (t9-0 this) (not (and (-> this next-state) (let ((v1-4 (-> this next-state name))) @@ -362,7 +359,7 @@ ) ) -(defmethod init-enemy-collision! kor ((this kor)) +(defmethod init-enemy-collision! ((this kor)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -435,7 +432,7 @@ (none) ) -(defmethod init! kor ((this kor)) +(defmethod init! ((this kor)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) (t9-0 this) @@ -453,7 +450,7 @@ (none) ) -(defmethod init-enemy! kor ((this kor)) +(defmethod init-enemy! ((this kor)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (initialize-skeleton @@ -477,29 +474,29 @@ (none) ) -(defmethod bot-method-214 kor ((this kor)) +(defmethod bot-method-214 ((this kor)) #f ) ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile kor ((this kor)) +(defmethod go-hostile ((this kor)) (kor-method-232 this) ) ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus kor ((this kor)) +(defmethod react-to-focus ((this kor)) "@TODO - flesh out docs" (kor-method-232 this) ) ;; WARN: Return type mismatch object vs none. -(defmethod kor-method-233 kor ((this kor)) +(defmethod kor-method-233 ((this kor)) (go (method-of-object this waiting-turn)) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod kor-method-232 kor ((this kor)) +(defmethod kor-method-232 ((this kor)) (let ((s5-0 (handle->process (-> this arrestor-handle)))) (cond ((if (type? s5-0 process-focusable) @@ -518,7 +515,7 @@ (none) ) -(defmethod kor-method-234 kor ((this kor)) +(defmethod kor-method-234 ((this kor)) (with-pp (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 6144.0 20889.6))) @@ -575,16 +572,16 @@ ) ) -(defmethod damage-amount-from-attack kor ((this kor) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this kor) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) -(defmethod bot-method-190 kor ((this kor)) +(defmethod bot-method-190 ((this kor)) #t ) -(defmethod enemy-method-78 kor ((this kor) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this kor) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -599,7 +596,7 @@ ) ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! kor ((this kor) (arg0 vector)) +(defmethod set-cam-height! ((this kor) (arg0 vector)) (the-as meters (cond @@ -617,7 +614,7 @@ ) ) -(defmethod enemy-method-102 kor ((this kor)) +(defmethod enemy-method-102 ((this kor)) (if (logtest? (bot-flags bf20) (-> this bot-flags)) #f ((method-of-type bot enemy-method-102) this) @@ -625,7 +622,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle kor ((this kor)) +(defmethod go-idle ((this kor)) (cond ((= (-> this course course-id) 8) (cond diff --git a/goal_src/jak2/levels/city/slums/neon-baron-part.gc b/goal_src/jak2/levels/city/slums/neon-baron-part.gc index b45037d1268..eeed6ae6032 100644 --- a/goal_src/jak2/levels/city/slums/neon-baron-part.gc +++ b/goal_src/jak2/levels/city/slums/neon-baron-part.gc @@ -3160,27 +3160,25 @@ (define *city-baron-group-ids* (new 'static 'boxed-array :type int32 #x369)) (deftype neon-baron (process) - ((flags int64 :offset-assert 128) - (master-enable int64 :offset-assert 136) - (mode int64 :offset-assert 144) - (sign (array object) :offset-assert 152) - (parts sparticle-launch-control 1 :offset-assert 156) - (state-time time-frame :offset-assert 160) - (mat matrix :inline :offset-assert 176) + ((flags int64) + (master-enable int64) + (mode int64) + (sign (array object)) + (parts sparticle-launch-control 1) + (state-time time-frame) + (mat matrix :inline) ) - :heap-base #x70 - :method-count-assert 17 - :size-assert #xf0 - :flag-assert #x11007000f0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (spawn-parts (_type_) none 15) - (update-mode (_type_) none 16) + (spawn-parts (_type_) none) + (update-mode (_type_) none) ) ) -(defmethod deactivate neon-baron ((this neon-baron)) +(defmethod deactivate ((this neon-baron)) (dotimes (s5-0 1) (let ((a0-1 (-> this parts s5-0))) (if (nonzero? a0-1) @@ -3193,7 +3191,7 @@ ) ;; WARN: Return type mismatch process vs neon-baron. -(defmethod relocate neon-baron ((this neon-baron) (arg0 int)) +(defmethod relocate ((this neon-baron) (arg0 int)) (dotimes (v1-0 1) (if (nonzero? (-> this parts v1-0)) (&+! (-> this parts v1-0) arg0) @@ -3203,7 +3201,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod spawn-parts neon-baron ((this neon-baron)) +(defmethod spawn-parts ((this neon-baron)) (+! (-> this parts 0 state-counter) 1) (when (!= (-> this parts 0 state-mode 0) (-> this flags)) (set! (-> this parts 0 state-mode 0) (the-as uint (-> this flags))) @@ -3221,7 +3219,7 @@ (none) ) -(defmethod update-mode neon-baron ((this neon-baron)) +(defmethod update-mode ((this neon-baron)) (set! (-> this mode) (rand-vu-int-count-excluding 12 (ash 1 (-> this mode)))) (none) ) @@ -3468,7 +3466,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! neon-baron ((this neon-baron) (arg0 entity-actor)) +(defmethod init-from-entity! ((this neon-baron) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3498,15 +3496,11 @@ This commonly includes things such as: (deftype hide-door-a (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hide-door-a ((this hide-door-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hide-door-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-chick.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-chick.gc index baf1d3a93a0..893b0f797a1 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-chick.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-chick.gc @@ -40,10 +40,6 @@ (deftype citizen-chick (civilian) () - :heap-base #x3b0 - :method-count-assert 218 - :size-assert #x424 - :flag-assert #xda03b00424 ) @@ -219,11 +215,11 @@ (set! (-> *citizen-chick-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod get-inv-mass citizen-chick ((this citizen-chick)) +(defmethod get-inv-mass ((this citizen-chick)) 0.5 ) -(defmethod enemy-method-51 citizen-chick ((this citizen-chick)) +(defmethod enemy-method-51 ((this citizen-chick)) (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) @@ -283,7 +279,7 @@ ) ) -(defmethod enemy-method-79 citizen-chick ((this citizen-chick) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this citizen-chick) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((1) (case (-> this incoming knocked-type) @@ -333,7 +329,7 @@ ) ) -(defmethod enemy-method-77 citizen-chick ((this citizen-chick) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this citizen-chick) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.01)) @@ -410,7 +406,7 @@ #t ) -(defmethod enemy-method-78 citizen-chick ((this citizen-chick) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this citizen-chick) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) @@ -510,7 +506,7 @@ ) ) -(defmethod init-enemy-collision! citizen-chick ((this citizen-chick)) +(defmethod init-enemy-collision! ((this citizen-chick)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -568,7 +564,7 @@ (none) ) -(defmethod init-enemy! citizen-chick ((this citizen-chick)) +(defmethod init-enemy! ((this citizen-chick)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -653,7 +649,7 @@ (none) ) -(defmethod citizen-init! citizen-chick ((this citizen-chick)) +(defmethod citizen-init! ((this citizen-chick)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) (t9-0 this) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-enemy.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-enemy.gc index 52d02cd4b1f..d96523eae12 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-enemy.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-enemy.gc @@ -8,21 +8,17 @@ ;; DECOMP BEGINS (deftype citizen-enemy (citizen) - ((next-update-target time-frame :offset-assert 968) - (minimap connection-minimap :offset-assert 976) + ((next-update-target time-frame) + (minimap connection-minimap) ) - :heap-base #x360 - :method-count-assert 203 - :size-assert #x3d4 - :flag-assert #xcb036003d4 (:methods - (traffic-danger-init! (_type_) none 201) - (citizen-enemy-method-202 (_type_) none 202) + (traffic-danger-init! (_type_) none) + (citizen-enemy-method-202 (_type_) none) ) ) -(defmethod track-target! citizen-enemy ((this citizen-enemy)) +(defmethod track-target! ((this citizen-enemy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -48,7 +44,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 citizen-enemy ((this citizen-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 ((this citizen-enemy) (arg0 process) (arg1 event-message-block)) (the-as symbol (cond @@ -105,7 +101,7 @@ ) ) -(defmethod general-event-handler citizen-enemy ((this citizen-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this citizen-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -146,7 +142,7 @@ ) ) -(defmethod traffic-danger-init! citizen-enemy ((this citizen-enemy)) +(defmethod traffic-danger-init! ((this citizen-enemy)) (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) @@ -163,7 +159,7 @@ (none) ) -(defmethod citizen-enemy-method-202 citizen-enemy ((this citizen-enemy)) +(defmethod citizen-enemy-method-202 ((this citizen-enemy)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> this root trans quad)) (set! (-> s5-0 w) 122880.0) @@ -255,7 +251,7 @@ ) ) -(defmethod citizen-init! citizen-enemy ((this citizen-enemy)) +(defmethod citizen-init! ((this citizen-enemy)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen citizen-init!))) (t9-0 this) @@ -292,17 +288,17 @@ (none) ) -(defmethod kill-prefer-falling citizen-enemy ((this citizen-enemy)) +(defmethod kill-prefer-falling ((this citizen-enemy)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" ((method-of-type nav-enemy kill-prefer-falling) this) ) -(defmethod go-hostile citizen-enemy ((this citizen-enemy)) +(defmethod go-hostile ((this citizen-enemy)) (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) (go (method-of-object this hostile)) ) ) -(defmethod go-stare citizen-enemy ((this citizen-enemy)) +(defmethod go-stare ((this citizen-enemy)) (go (method-of-object this active)) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-fat.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-fat.gc index 06d1f6e9044..181c6ab5dfb 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-fat.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-fat.gc @@ -40,10 +40,6 @@ (deftype citizen-fat (civilian) () - :heap-base #x3b0 - :method-count-assert 218 - :size-assert #x424 - :flag-assert #xda03b00424 ) @@ -219,11 +215,11 @@ (set! (-> *citizen-fat-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod get-inv-mass citizen-fat ((this citizen-fat)) +(defmethod get-inv-mass ((this citizen-fat)) 0.5 ) -(defmethod enemy-method-51 citizen-fat ((this citizen-fat)) +(defmethod enemy-method-51 ((this citizen-fat)) (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) @@ -283,7 +279,7 @@ ) ) -(defmethod enemy-method-79 citizen-fat ((this citizen-fat) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this citizen-fat) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((1) (case (-> this incoming knocked-type) @@ -333,7 +329,7 @@ ) ) -(defmethod enemy-method-77 citizen-fat ((this citizen-fat) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this citizen-fat) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.01)) @@ -410,7 +406,7 @@ #t ) -(defmethod enemy-method-78 citizen-fat ((this citizen-fat) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this citizen-fat) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) @@ -547,7 +543,7 @@ ) ) -(defmethod init-enemy-collision! citizen-fat ((this citizen-fat)) +(defmethod init-enemy-collision! ((this citizen-fat)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -605,7 +601,7 @@ (none) ) -(defmethod init-enemy! citizen-fat ((this citizen-fat)) +(defmethod init-enemy! ((this citizen-fat)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -687,7 +683,7 @@ (none) ) -(defmethod citizen-init! citizen-fat ((this citizen-fat)) +(defmethod citizen-init! ((this citizen-fat)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) (t9-0 this) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-h.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-h.gc index 23971e78073..b92391dcc63 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-h.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-h.gc @@ -31,64 +31,62 @@ ;; DECOMP BEGINS (deftype citizen (nav-enemy) - ((flags citizen-flag :offset-assert 604) - (traffic-id int8 :offset-assert 606) - (hit-by-player-count int8 :offset-assert 607) - (gnd-height float :offset-assert 608) - (speed-scale float :offset-assert 612) - (controller vehicle-controller :inline :offset-assert 624) - (danger-pos sphere :inline :offset-assert 768) - (vehicle handle :offset-assert 784) - (anim-shuffle int32 :offset-assert 792) - (dist-walk-anim float :offset-assert 796) - (speed-walk float :offset-assert 800) - (anim-walk int32 :offset-assert 804) - (dist-run-anim float :offset-assert 808) - (speed-run float :offset-assert 812) - (anim-run int32 :offset-assert 816) - (water-anim int32 :offset-assert 820) - (interp float :offset-assert 824) - (last-danger-time time-frame :offset-assert 832) - (next-time-look-at time-frame :offset-assert 840) - (stop-time-look-at time-frame :offset-assert 848) - (wait-return-state (state citizen) :offset-assert 856) - (wait-time time-frame :offset-assert 864) - (cp-valid? symbol :offset-assert 872) - (cp-sphere sphere :inline :offset-assert 880) - (cp-vec vector :inline :offset-assert 896) - (cp-next-time time-frame :offset-assert 912) - (cp-exit-time time-frame :offset-assert 920) - (cp-force vector :inline :offset-assert 928) - (cp-plane plane :inline :offset-assert 944) - (cp-factor float :offset-assert 960) + ((flags citizen-flag) + (traffic-id int8) + (hit-by-player-count int8) + (gnd-height float) + (speed-scale float) + (controller vehicle-controller :inline) + (danger-pos sphere :inline) + (vehicle handle) + (anim-shuffle int32) + (dist-walk-anim float) + (speed-walk float) + (anim-walk int32) + (dist-run-anim float) + (speed-run float) + (anim-run int32) + (water-anim int32) + (interp float) + (last-danger-time time-frame) + (next-time-look-at time-frame) + (stop-time-look-at time-frame) + (wait-return-state (state citizen)) + (wait-time time-frame) + (cp-valid? symbol) + (cp-sphere sphere :inline) + (cp-vec vector :inline) + (cp-next-time time-frame) + (cp-exit-time time-frame) + (cp-force vector :inline) + (cp-plane plane :inline) + (cp-factor float) ) - :heap-base #x350 - :method-count-assert 201 - :size-assert #x3c4 - :flag-assert #xc9035003c4 + (:state-methods + wait + inactive + in-ditch + ) (:methods - (wait () _type_ :state 178) - (inactive () _type_ :state 179) - (in-ditch () _type_ :state 180) - (citizen-init! (_type_) none 181) - (citizen-nav-init! (_type_) none 182) - (go-inactive (_type_) none 183) - (find-segment (_type_ vector vector) nav-segment 184) - (nav-segment-callback (_type_ vector traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none 185) - (citizen-method-186 (_type_ nav-segment) none 186) - (citizen-method-187 (_type_) symbol 187) - (citizen-method-188 (_type_ vector) none 188) - (calc-danger-vec (_type_ vector vector) none 189) - (citizen-method-190 (_type_ vector) none 190) - (gen-clear-path (_type_) nav-segment 191) - (citizen-method-192 (_type_) none 192) - (throw-off-vehicle (_type_) none 193) - (gen-new-dir (_type_ vector float) nav-segment 194) - (citizen-method-195 (_type_ vector) symbol 195) - (get-run-anim (_type_) int 196) - (trigger-alert (_type_ int target) none 197) - (decrease-alert (_type_ object) none 198) - (set-behavior! (_type_ traffic-object-spawn-params) none 199) - (citizen-method-200 (_type_) none 200) + (citizen-init! (_type_) none) + (citizen-nav-init! (_type_) none) + (go-inactive (_type_) none) + (find-segment (_type_ vector vector) nav-segment) + (nav-segment-callback (_type_ vector traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) + (citizen-method-186 (_type_ nav-segment) none) + (citizen-method-187 (_type_) symbol) + (citizen-method-188 (_type_ vector) none) + (calc-danger-vec (_type_ vector vector) none) + (citizen-method-190 (_type_ vector) none) + (gen-clear-path (_type_) nav-segment) + (citizen-method-192 (_type_) none) + (throw-off-vehicle (_type_) none) + (gen-new-dir (_type_ vector float) nav-segment) + (citizen-method-195 (_type_ vector) symbol) + (get-run-anim (_type_) int) + (trigger-alert (_type_ int target) none) + (decrease-alert (_type_ object) none) + (set-behavior! (_type_ traffic-object-spawn-params) none) + (citizen-method-200 (_type_) none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc index f216136855c..82fa8246395 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc @@ -44,12 +44,8 @@ (deftype citizen-norm (civilian) () - :heap-base #x3b0 - :method-count-assert 219 - :size-assert #x424 - :flag-assert #xdb03b00424 - (:methods - (knocked-off-vehicle () _type_ :state 218) + (:state-methods + knocked-off-vehicle ) ) @@ -228,7 +224,7 @@ (set! (-> *citizen-norm-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod enemy-method-51 citizen-norm ((this citizen-norm)) +(defmethod enemy-method-51 ((this citizen-norm)) (cond ((logtest? (-> this flags) (citizen-flag knocked-out-car knocked-out-bike)) ((method-of-type nav-enemy enemy-method-51) this) @@ -295,7 +291,7 @@ ) ) -(defmethod enemy-method-79 citizen-norm ((this citizen-norm) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this citizen-norm) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((1) (case (-> this incoming knocked-type) @@ -345,7 +341,7 @@ ) ) -(defmethod enemy-method-77 citizen-norm ((this citizen-norm) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this citizen-norm) (arg0 (pointer float))) (local-vars (v1-36 knocked-type)) (cond ((logtest? (-> this flags) (citizen-flag knocked-out-car)) @@ -454,7 +450,7 @@ #t ) -(defmethod enemy-method-78 citizen-norm ((this citizen-norm) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this citizen-norm) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (set! (-> arg0 0) 1.0) (let ((a0-2 (-> this skel root-channel 0))) @@ -592,7 +588,7 @@ ) ) -(defmethod set-behavior! citizen-norm ((this citizen-norm) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! ((this citizen-norm) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((11) (speech-control-method-12 *speech-control* this (speech-type speech-type-22)) @@ -686,7 +682,7 @@ ) ) -(defmethod init-enemy-collision! citizen-norm ((this citizen-norm)) +(defmethod init-enemy-collision! ((this citizen-norm)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -750,7 +746,7 @@ (none) ) -(defmethod init-enemy! citizen-norm ((this citizen-norm)) +(defmethod init-enemy! ((this citizen-norm)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -832,7 +828,7 @@ (none) ) -(defmethod citizen-init! citizen-norm ((this citizen-norm)) +(defmethod citizen-init! ((this citizen-norm)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) (t9-0 this) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen.gc index e8d19cc5dd3..09d1432fd98 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen.gc @@ -9,7 +9,7 @@ (define *citizen-debug* #f) -(defmethod citizen-nav-init! citizen ((this citizen)) +(defmethod citizen-nav-init! ((this citizen)) "Initialize nav related fields." (let ((v1-0 (-> this nav))) (logclear! (-> v1-0 flags) (nav-control-flag limit-rotation-rate output-sphere-hash)) @@ -38,7 +38,7 @@ (none) ) -(defmethod citizen-init! citizen ((this citizen)) +(defmethod citizen-init! ((this citizen)) "Initialize [[citizen]] defaults." (logior! (-> this fact enemy-options) (enemy-option knocked-into-water)) (if (-> this skel effect) @@ -95,7 +95,7 @@ ) ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! citizen ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod update-target-awareness! ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! @TODO - flesh out docs @returns the value that sets `aware`" @@ -111,44 +111,44 @@ (the-as enemy-aware 3) ) -(defmethod enemy-method-61 citizen ((this citizen) (arg0 int)) +(defmethod enemy-method-61 ((this citizen) (arg0 int)) 3 ) -(defmethod go-stare citizen ((this citizen)) +(defmethod go-stare ((this citizen)) (go (method-of-object this flee)) ) ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile citizen ((this citizen)) +(defmethod go-hostile ((this citizen)) (go-inactive this) ) -(defmethod go-flee citizen ((this citizen)) +(defmethod go-flee ((this citizen)) (go (method-of-object this flee)) ) -(defmethod react-to-focus citizen ((this citizen)) +(defmethod react-to-focus ((this citizen)) "@TODO - flesh out docs" (go (method-of-object this active)) ) ;; WARN: Return type mismatch none vs object. -(defmethod kill-prefer-falling citizen ((this citizen)) +(defmethod kill-prefer-falling ((this citizen)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (logclear! (-> this flags) (citizen-flag persistent)) (send-event (ppointer->process (-> this parent)) 'child-killed) (go-inactive this) ) -(defmethod cleanup-for-death citizen ((this citizen)) +(defmethod cleanup-for-death ((this citizen)) (logclear! (-> this flags) (citizen-flag persistent)) (send-event (ppointer->process (-> this parent)) 'child-killed) (go-inactive this) (none) ) -(defmethod go-inactive citizen ((this citizen)) +(defmethod go-inactive ((this citizen)) (vehicle-controller-method-11 (-> this controller)) (logior! (-> this focus-status) (focus-status inactive)) (set! (-> this event-hook) (-> (method-of-object this inactive) event)) @@ -157,7 +157,7 @@ (none) ) -(defmethod trigger-alert citizen ((this citizen) (arg0 int) (arg1 target)) +(defmethod trigger-alert ((this citizen) (arg0 int) (arg1 target)) (let ((a0-1 (-> this controller traffic))) (when (and (nonzero? a0-1) arg1) (if #t @@ -169,7 +169,7 @@ (none) ) -(defmethod decrease-alert citizen ((this citizen) (arg0 object)) +(defmethod decrease-alert ((this citizen) (arg0 object)) (let ((a0-1 (-> this controller traffic))) (if (nonzero? a0-1) (decrease-alert-level a0-1 (the-as int arg0)) @@ -179,32 +179,32 @@ (none) ) -(defmethod get-inv-mass citizen ((this citizen)) +(defmethod get-inv-mass ((this citizen)) 1.0 ) -(defmethod find-segment citizen ((this citizen) (arg0 vector) (arg1 vector)) +(defmethod find-segment ((this citizen) (arg0 vector) (arg1 vector)) (find-best-segment (-> this controller traffic) arg0 arg1 1) ) -(defmethod nav-segment-callback citizen ((this citizen) - (arg0 vector) - (arg1 traffic-find-segment-struct) - (arg2 (function traffic-find-segment-struct nav-segment none)) - ) +(defmethod nav-segment-callback ((this citizen) + (arg0 vector) + (arg1 traffic-find-segment-struct) + (arg2 (function traffic-find-segment-struct nav-segment none)) + ) (callback-on-nav-segments-in-sphere (-> this controller traffic) arg0 1 arg1 arg2) 0 (none) ) -(defmethod citizen-method-186 citizen ((this citizen) (arg0 nav-segment)) +(defmethod citizen-method-186 ((this citizen) (arg0 nav-segment)) (vehicle-controller-method-11 (-> this controller)) (vehicle-controller-method-13 (-> this controller) (-> arg0 branch) (the-as vector (-> arg0 vertex))) 0 (none) ) -(defmethod citizen-method-187 citizen ((this citizen)) +(defmethod citizen-method-187 ((this citizen)) (let* ((v1-0 (-> this controller)) (gp-1 (vector-! (new 'stack-no-clear 'vector) (-> v1-0 turn-exit-point) (-> v1-0 path-prev-point))) (s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> v1-0 turn-exit-point))) @@ -216,7 +216,7 @@ ) ) -(defmethod set-behavior! citizen ((this citizen) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! ((this citizen) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) @@ -237,7 +237,7 @@ (none) ) -(defmethod general-event-handler citizen ((this citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -329,7 +329,7 @@ ) ) -(defmethod citizen-method-200 citizen ((this citizen)) +(defmethod citizen-method-200 ((this citizen)) (set! (-> this root transv x) 0.0) (set! (-> this root transv z) 0.0) (when (-> this enemy-info move-to-ground) @@ -355,7 +355,7 @@ (none) ) -(defmethod track-target! citizen ((this citizen)) +(defmethod track-target! ((this citizen)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -439,7 +439,7 @@ (none) ) -(defmethod enemy-method-128 citizen ((this citizen) (arg0 vector) (arg1 move-above-ground-params)) +(defmethod enemy-method-128 ((this citizen) (arg0 vector) (arg1 move-above-ground-params)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -567,7 +567,7 @@ ) ) -(defmethod nav-enemy-method-142 citizen ((this citizen) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this citizen) (arg0 nav-control)) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) (set! (-> s3-0 quad) (-> a1-1 heading quad)) @@ -591,7 +591,7 @@ (none) ) -(defmethod nav-enemy-method-176 citizen ((this citizen)) +(defmethod nav-enemy-method-176 ((this citizen)) (nav-enemy-method-177 this) (let ((a0-2 this)) (when (logtest? (enemy-flag enemy-flag36) (-> a0-2 enemy-flags)) @@ -614,13 +614,13 @@ (none) ) -(defmethod go-idle citizen ((this citizen)) +(defmethod go-idle ((this citizen)) (go (method-of-object this active)) 0 (none) ) -(defmethod init-enemy-behaviour-and-stats! citizen ((this citizen) (arg0 nav-enemy-info)) +(defmethod init-enemy-behaviour-and-stats! ((this citizen) (arg0 nav-enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-behaviour-and-stats!))) @@ -639,7 +639,7 @@ ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! citizen ((this citizen) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citizen) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -672,7 +672,7 @@ This commonly includes things such as: (none) ) -(defmethod get-run-anim citizen ((this citizen)) +(defmethod get-run-anim ((this citizen)) (-> this anim-run) ) @@ -777,7 +777,7 @@ This commonly includes things such as: #f ) -(defmethod citizen-method-188 citizen ((this citizen) (arg0 vector)) +(defmethod citizen-method-188 ((this citizen) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) @@ -821,7 +821,7 @@ This commonly includes things such as: (none) ) -(defmethod calc-danger-vec citizen ((this citizen) (arg0 vector) (arg1 vector)) +(defmethod calc-danger-vec ((this citizen) (arg0 vector) (arg1 vector)) (let ((s2-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -883,7 +883,7 @@ This commonly includes things such as: (none) ) -(defmethod citizen-method-190 citizen ((this citizen) (arg0 vector)) +(defmethod citizen-method-190 ((this citizen) (arg0 vector)) (local-vars (sv-288 nav-poly) (sv-304 clamp-travel-vector-to-mesh-return-info) (sv-320 vector)) (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (the-as vector (-> this cp-sphere)))) (s4-0 (new 'stack-no-clear 'vector)) @@ -961,15 +961,12 @@ This commonly includes things such as: ) (deftype iter-seg (structure) - ((self citizen :offset-assert 0) - (score float :offset-assert 4) - (seg nav-segment :offset-assert 8) - (cp-plane plane :inline :offset-assert 16) - (desired-dir vector :inline :offset-assert 32) + ((self citizen) + (score float) + (seg nav-segment) + (cp-plane plane :inline) + (desired-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) @@ -1061,7 +1058,7 @@ This commonly includes things such as: ) ) -(defmethod gen-clear-path citizen ((this citizen)) +(defmethod gen-clear-path ((this citizen)) (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'iter-seg)) ) @@ -1107,7 +1104,7 @@ This commonly includes things such as: ) ) -(defmethod citizen-method-192 citizen ((this citizen)) +(defmethod citizen-method-192 ((this citizen)) (when (-> this cp-valid?) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> this cp-force quad)) @@ -1165,7 +1162,7 @@ This commonly includes things such as: (none) ) -(defmethod gen-new-dir citizen ((this citizen) (arg0 vector) (arg1 float)) +(defmethod gen-new-dir ((this citizen) (arg0 vector) (arg1 float)) (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'iter-seg)) ) @@ -1201,7 +1198,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch int vs symbol. -(defmethod citizen-method-195 citizen ((this citizen) (arg0 vector)) +(defmethod citizen-method-195 ((this citizen) (arg0 vector)) (dotimes (s4-0 6) (let ((a1-2 (gen-new-dir this arg0 (* 81920.0 (the float (+ s4-0 1)))))) (when a1-2 @@ -1213,7 +1210,7 @@ This commonly includes things such as: (the-as symbol 0) ) -(defmethod throw-off-vehicle citizen ((this citizen)) +(defmethod throw-off-vehicle ((this citizen)) (let ((s4-0 (handle->process (-> this vehicle)))) (let ((v1-4 (-> this root root-prim))) (set! (-> v1-4 prim-core collide-as) (-> this root backup-collide-as)) diff --git a/goal_src/jak2/levels/city/traffic/citizen/civilian.gc b/goal_src/jak2/levels/city/traffic/citizen/civilian.gc index 9043a8648d8..f783ea287fc 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/civilian.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/civilian.gc @@ -8,107 +8,99 @@ ;; DECOMP BEGINS (deftype civilian-anim-info (structure) - ((anim-index int32 2 :offset-assert 0) - (anim-index-front int32 :offset 0) - (anim-index-back int32 :offset 4) + ((anim-index int32 2) + (anim-index-front int32 :overlay-at (-> anim-index 0)) + (anim-index-back int32 :overlay-at (-> anim-index 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype civilian-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (knocked int32 2 :offset-assert 8) - (anim-knocked-front int32 :offset 8) - (anim-knocked-back int32 :offset 12) - (knocked-land int32 2 :offset-assert 16) - (anim-knocked-front-land int32 :offset 16) - (anim-knocked-back-land int32 :offset 20) - (yellow-hit-anim civilian-anim-info 1 :inline :offset-assert 24) - (blue-hit-anim civilian-anim-info 3 :inline :offset-assert 32) - (anim-cover-head-start int32 :offset-assert 56) - (anim-cover-head-loop int32 :offset-assert 60) - (anim-cover-head-end int32 :offset-assert 64) - (car-stance-anim int32 :offset-assert 68) - (bike-stance-anim int32 :offset-assert 72) - (get-in-car-anim int32 :offset-assert 76) - (get-on-bike-anim int32 :offset-assert 80) - (seat-flag uint8 :offset-assert 84) - (speech-ambient int8 :offset-assert 85) - (speech-alert int8 :offset-assert 86) - (speech-cower int8 :offset-assert 87) - (speech-touched-by-player int8 :offset-assert 88) - (speech-shot-by-player int8 :offset-assert 89) - (speech-avoiding-player-vehicle int8 :offset-assert 90) - (speech-hit-by-player-vehicle int8 :offset-assert 91) - (speech-player-stealing-vehicle int8 :offset-assert 92) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (knocked int32 2) + (anim-knocked-front int32 :overlay-at (-> knocked 0)) + (anim-knocked-back int32 :overlay-at (-> knocked 1)) + (knocked-land int32 2) + (anim-knocked-front-land int32 :overlay-at (-> knocked-land 0)) + (anim-knocked-back-land int32 :overlay-at (-> knocked-land 1)) + (yellow-hit-anim civilian-anim-info 1 :inline) + (blue-hit-anim civilian-anim-info 3 :inline) + (anim-cover-head-start int32) + (anim-cover-head-loop int32) + (anim-cover-head-end int32) + (car-stance-anim int32) + (bike-stance-anim int32) + (get-in-car-anim int32) + (get-on-bike-anim int32) + (seat-flag uint8) + (speech-ambient int8) + (speech-alert int8) + (speech-cower int8) + (speech-touched-by-player int8) + (speech-shot-by-player int8) + (speech-avoiding-player-vehicle int8) + (speech-hit-by-player-vehicle int8) + (speech-player-stealing-vehicle int8) ) - :method-count-assert 9 - :size-assert #x5d - :flag-assert #x90000005d ) (deftype civilian (citizen) - ((info civilian-global-info :offset-assert 964) - (anim-panic-run int32 :offset-assert 968) - (anim-on-ground int32 :offset-assert 972) - (anim-dive int32 :offset-assert 976) - (anim-get-up-front int32 :offset-assert 980) - (anim-get-up-back int32 :offset-assert 984) - (last-second-pos vector :inline :offset-assert 992) - (last-distance float :offset-assert 1008) - (next-time time-frame :offset-assert 1016) - (dive-target-point vector :inline :offset-assert 1024) - (dive-reaction float :offset-assert 1040) - (allow-dive symbol :offset-assert 1044) - (dive-finished? symbol :offset-assert 1048) - (hit-face uint32 :offset-assert 1052) - (seat int32 :offset-assert 1056) + ((info civilian-global-info) + (anim-panic-run int32) + (anim-on-ground int32) + (anim-dive int32) + (anim-get-up-front int32) + (anim-get-up-back int32) + (last-second-pos vector :inline) + (last-distance float) + (next-time time-frame) + (dive-target-point vector :inline) + (dive-reaction float) + (allow-dive symbol) + (dive-finished? symbol) + (hit-face uint32) + (seat int32) ) - :heap-base #x3b0 - :method-count-assert 218 - :size-assert #x424 - :flag-assert #xda03b00424 + (:state-methods + avoid-danger + clear-path + on-ground + dive + get-up-front + get-up-back + cower-ground + wait-for-ride + move-to-vehicle + board-vehicle + ride + exit-vehicle + wait-at-dest + ) (:methods - (avoid-danger () _type_ :state 201) - (clear-path () _type_ :state 202) - (on-ground () _type_ :state 203) - (dive () _type_ :state 204) - (get-up-front () _type_ :state 205) - (get-up-back () _type_ :state 206) - (cower-ground () _type_ :state 207) - (wait-for-ride () _type_ :state 208) - (move-to-vehicle () _type_ :state 209) - (board-vehicle () _type_ :state 210) - (ride () _type_ :state 211) - (exit-vehicle () _type_ :state 212) - (wait-at-dest () _type_ :state 213) - (civilian-method-214 (_type_ nav-branch int vector float) float 214) - (civilian-method-215 (_type_ vector) none 215) - (go-dive (_type_) none 216) - (civilian-method-217 (_type_ vector) symbol 217) + (civilian-method-214 (_type_ nav-branch int vector float) float) + (civilian-method-215 (_type_ vector) none) + (go-dive (_type_) none) + (civilian-method-217 (_type_ vector) symbol) ) ) -(defmethod get-run-anim civilian ((this civilian)) +(defmethod get-run-anim ((this civilian)) (if (and (-> this next-state) (= (-> this next-state name) 'flee)) (-> this anim-panic-run) (-> this anim-run) ) ) -(defmethod enemy-method-81 civilian ((this civilian)) +(defmethod enemy-method-81 ((this civilian)) #f ) ;; WARN: Return type mismatch object vs none. -(defmethod cleanup-for-death civilian ((this civilian)) +(defmethod cleanup-for-death ((this civilian)) (cond ((zero? (-> this hit-points)) (logclear! (-> this flags) (citizen-flag persistent)) @@ -148,7 +140,7 @@ (none) ) -(defmethod damage-amount-from-attack civilian ((this civilian) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this civilian) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (cond ;; og:preserve-this constant @@ -191,22 +183,22 @@ ) ) -(defmethod enemy-method-108 civilian ((this civilian) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 ((this civilian) (arg0 enemy) (arg1 event-message-block)) 0 ) ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile civilian ((this civilian)) +(defmethod go-hostile ((this civilian)) (cleanup-for-death this) ) ;; WARN: Return type mismatch none vs object. -(defmethod kill-prefer-falling civilian ((this civilian)) +(defmethod kill-prefer-falling ((this civilian)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cleanup-for-death this) ) -(defmethod set-behavior! civilian ((this civilian) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! ((this civilian) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) @@ -231,7 +223,7 @@ (none) ) -(defmethod citizen-init! civilian ((this civilian)) +(defmethod citizen-init! ((this civilian)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen citizen-init!))) (t9-0 this) @@ -247,7 +239,7 @@ ) ;; WARN: Return type mismatch nav-segment vs none. -(defmethod civilian-method-215 civilian ((this civilian) (arg0 vector)) +(defmethod civilian-method-215 ((this civilian) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> this root trans quad)) (set! (-> v1-0 w) 81920.0) @@ -260,7 +252,7 @@ (none) ) -(defmethod general-event-handler civilian ((this civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -373,7 +365,7 @@ ) ) -(defmethod civilian-method-214 civilian ((this civilian) (arg0 nav-branch) (arg1 int) (arg2 vector) (arg3 float)) +(defmethod civilian-method-214 ((this civilian) (arg0 nav-branch) (arg1 int) (arg2 vector) (arg3 float)) (when (nonzero? arg1) (-> arg0 src-node) (let* ((s3-0 (-> arg0 dest-node)) @@ -976,7 +968,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-dive civilian ((this civilian)) +(defmethod go-dive ((this civilian)) (if (< (-> this nav state speed) 8192.0) (go (method-of-object this on-ground)) (go (method-of-object this dive)) @@ -1478,7 +1470,7 @@ ) ) -(defmethod civilian-method-217 civilian ((this civilian) (arg0 vector)) +(defmethod civilian-method-217 ((this civilian) (arg0 vector)) (let ((s3-0 (handle->process (-> this vehicle))) (s4-0 (new 'stack 'collide-query)) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/guard.gc b/goal_src/jak2/levels/city/traffic/citizen/guard.gc index 55adf9e4d83..ca86e8aa237 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/guard.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/guard.gc @@ -15,45 +15,36 @@ ) (deftype guard-anim-info (structure) - ((anim-index int32 2 :offset-assert 0) - (anim-index-front int32 :offset 0) - (anim-index-back int32 :offset 4) + ((anim-index int32 2) + (anim-index-front int32 :overlay-at (-> anim-index 0)) + (anim-index-back int32 :overlay-at (-> anim-index 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype guard-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (knocked int32 2 :offset-assert 8) - (knocked-land int32 2 :offset-assert 16) - (anim-knocked-front int32 :offset 8) - (anim-knocked-back int32 :offset 12) - (anim-knocked-front-land int32 :offset 16) - (anim-knocked-back-land int32 :offset 20) - (yellow-hit-anim guard-anim-info 2 :inline :offset-assert 24) - (yellow-land-anim guard-anim-info 2 :inline :offset-assert 40) - (blue-hit-anim int32 :offset-assert 56) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (knocked int32 2) + (knocked-land int32 2) + (anim-knocked-front int32 :overlay-at (-> knocked 0)) + (anim-knocked-back int32 :overlay-at (-> knocked 1)) + (anim-knocked-front-land int32 :overlay-at (-> knocked-land 0)) + (anim-knocked-back-land int32 :overlay-at (-> knocked-land 1)) + (yellow-hit-anim guard-anim-info 2 :inline) + (yellow-land-anim guard-anim-info 2 :inline) + (blue-hit-anim int32) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) (deftype guard-shoot-info (structure) - ((anim-index int32 :offset-assert 0) - (start float :offset-assert 4) - (end float :offset-assert 8) + ((anim-index int32) + (start float) + (end float) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -251,80 +242,78 @@ (set! (-> *crimson-guard-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (deftype crimson-guard (citizen) - ((info guard-global-info :offset-assert 964) - (hit-face uint32 :offset-assert 968) - (anim-get-up-front int32 :offset-assert 972) - (anim-get-up-back int32 :offset-assert 976) - (small-hit int32 :offset-assert 980) - (yellow-anim uint32 :offset-assert 984) - (guard-type uint8 :offset-assert 988) - (settings traffic-guard-type-settings :offset-assert 992) - (next-time time-frame :offset-assert 1000) - (last-time-see-target time-frame :offset-assert 1008) - (joint joint-mod :offset-assert 1016) - (joint-enable symbol :offset-assert 1020) - (already-shot symbol :offset-assert 1024) - (miss-amount float :offset-assert 1028) - (l-control lightning-control :offset-assert 1032) - (next-shot int64 :offset-assert 1040) - (anim-shoot guard-shoot-info 3 :inline :offset-assert 1048) - (transport handle :offset-assert 1088) - (transport-side uint32 :offset-assert 1096) - (target-flags uint8 :offset-assert 1100) - (target-pos vector :inline :offset-assert 1104) - (target-pos-predict vector :inline :offset-assert 1120) - (target-pos-predict-miss vector :inline :offset-assert 1136) - (target-vel-vec vector :inline :offset-assert 1152) - (target-vel float :offset-assert 1168) - (target-self vector :inline :offset-assert 1184) - (target-self-xz vector :inline :offset-assert 1200) - (target-self-dist float :offset-assert 1216) - (target-self-xz-dist float :offset-assert 1220) - (target-y-angle degrees :offset-assert 1224) - (last-visible-target-pos vector :inline :offset-assert 1232) - (lazer-sound sound-id :offset-assert 1248) - (move-position vector :inline :offset-assert 1264) - (move-index int32 :offset-assert 1280) - (traffic-target-status traffic-target-status :inline :offset-assert 1296) - (minimap connection-minimap :offset-assert 1376) - (other-side symbol :offset-assert 1380) + ((info guard-global-info) + (hit-face uint32) + (anim-get-up-front int32) + (anim-get-up-back int32) + (small-hit int32) + (yellow-anim uint32) + (guard-type uint8) + (settings traffic-guard-type-settings) + (next-time time-frame) + (last-time-see-target time-frame) + (joint joint-mod) + (joint-enable symbol) + (already-shot symbol) + (miss-amount float) + (l-control lightning-control) + (next-shot int64) + (anim-shoot guard-shoot-info 3 :inline) + (transport handle) + (transport-side uint32) + (target-flags uint8) + (target-pos vector :inline) + (target-pos-predict vector :inline) + (target-pos-predict-miss vector :inline) + (target-vel-vec vector :inline) + (target-vel float) + (target-self vector :inline) + (target-self-xz vector :inline) + (target-self-dist float) + (target-self-xz-dist float) + (target-y-angle degrees) + (last-visible-target-pos vector :inline) + (lazer-sound sound-id) + (move-position vector :inline) + (move-index int32) + (traffic-target-status traffic-target-status :inline) + (minimap connection-minimap) + (other-side symbol) ) - :heap-base #x4f0 - :method-count-assert 227 - :size-assert #x568 - :flag-assert #xe304f00568 + (:state-methods + get-up-front + get-up-back + search + attack + arrest + gun-shoot + exit-transport + waiting-ambush + close-attack + knocked-off-vehicle + roll-right + roll-left + close-attack-active + ) (:methods - (get-up-front () _type_ :state 201) - (get-up-back () _type_ :state 202) - (search () _type_ :state 203) - (attack () _type_ :state 204) - (arrest () _type_ :state 205) - (gun-shoot () _type_ :state 206) - (exit-transport () _type_ :state 207) - (waiting-ambush () _type_ :state 208) - (close-attack () _type_ :state 209) - (knocked-off-vehicle () _type_ :state 210) - (roll-right () _type_ :state 211) - (roll-left () _type_ :state 212) - (close-attack-active () _type_ :state 213) - (crimson-guard-method-214 (_type_) none 214) - (crimson-guard-method-215 (_type_) symbol 215) - (crimson-guard-method-216 (_type_) symbol 216) - (crimson-guard-method-217 (_type_ vector vector vector) int 217) - (crimson-guard-method-218 (_type_ vector) none 218) - (crimson-guard-method-219 (_type_) none 219) - (crimson-guard-method-220 (_type_) none 220) - (crimson-guard-method-221 (_type_) none 221) - (crimson-guard-method-222 (_type_) none 222) - (crimson-guard-method-223 (_type_ float) none 223) - (crimson-guard-method-224 (_type_ vector) float 224) - (crimson-guard-method-225 (_type_ uint symbol) none 225) - (crimson-guard-method-226 (_type_) none 226) + (crimson-guard-method-214 (_type_) none) + (crimson-guard-method-215 (_type_) symbol) + (crimson-guard-method-216 (_type_) symbol) + (crimson-guard-method-217 (_type_ vector vector vector) int) + (crimson-guard-method-218 (_type_ vector) none) + (crimson-guard-method-219 (_type_) none) + (crimson-guard-method-220 (_type_) none) + (crimson-guard-method-221 (_type_) none) + (crimson-guard-method-222 (_type_) none) + (crimson-guard-method-223 (_type_ float) none) + (crimson-guard-method-224 (_type_ vector) float) + (crimson-guard-method-225 (_type_ uint symbol) none) + (crimson-guard-method-226 (_type_) none) ) ) -(defmethod crimson-guard-method-218 crimson-guard ((this crimson-guard) (arg0 vector)) +(defmethod crimson-guard-method-218 ((this crimson-guard) (arg0 vector)) (local-vars (sv-240 vector) (sv-256 (function vector vector vector)) @@ -454,7 +443,7 @@ ) ) -(defmethod crimson-guard-method-219 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-219 ((this crimson-guard)) (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) *unity-quaternion* (seconds-per-frame)) 0 (none) @@ -462,7 +451,7 @@ (define *guard-min-id-hack* 255) -(defmethod track-target! crimson-guard ((this crimson-guard)) +(defmethod track-target! ((this crimson-guard)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -481,12 +470,12 @@ (none) ) -(defmethod kill-prefer-falling crimson-guard ((this crimson-guard)) +(defmethod kill-prefer-falling ((this crimson-guard)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" ((method-of-type nav-enemy kill-prefer-falling) this) ) -(defmethod react-to-focus crimson-guard ((this crimson-guard)) +(defmethod react-to-focus ((this crimson-guard)) "@TODO - flesh out docs" (if (not (logtest? (-> this flags) (citizen-flag hostile))) (go (method-of-object this active)) @@ -494,7 +483,7 @@ ) ) -(defmethod damage-amount-from-attack crimson-guard ((this crimson-guard) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this crimson-guard) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let ((v0-0 ((method-of-type nav-enemy damage-amount-from-attack) this arg0 arg1))) (-> arg1 param 1) @@ -503,7 +492,7 @@ ) ;; WARN: disable def twice: 122. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler crimson-guard ((this crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -691,7 +680,7 @@ ) ) -(defmethod get-inv-mass crimson-guard ((this crimson-guard)) +(defmethod get-inv-mass ((this crimson-guard)) 0.6666667 ) @@ -868,7 +857,7 @@ ) ) -(defmethod enemy-method-77 crimson-guard ((this crimson-guard) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this crimson-guard) (arg0 (pointer float))) (cond ((logtest? (-> this flags) (citizen-flag knocked-out-car)) (ja-channel-push! 1 (seconds 0.1)) @@ -1007,7 +996,7 @@ #t ) -(defmethod enemy-method-78 crimson-guard ((this crimson-guard) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this crimson-guard) (arg0 (pointer float))) (cond ((<= (-> this hit-points) 0) (ja-channel-push! 1 (seconds 0.1)) @@ -1101,7 +1090,7 @@ ) ) -(defmethod set-behavior! crimson-guard ((this crimson-guard) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! ((this crimson-guard) (arg0 traffic-object-spawn-params)) (let ((a1-1 (-> arg0 guard-type))) (if (or (and (!= a1-1 7) (!= a1-1 (-> this guard-type))) (= (-> arg0 behavior) 11)) (crimson-guard-method-225 this a1-1 (= (-> arg0 behavior) 11)) @@ -1194,7 +1183,7 @@ ) ;; WARN: Return type mismatch int vs object. -(defmethod go-hostile crimson-guard ((this crimson-guard)) +(defmethod go-hostile ((this crimson-guard)) (cond ((handle->process (-> this focus handle)) (logior! (-> this flags) (citizen-flag hostile)) @@ -1219,7 +1208,7 @@ 0 ) -(defmethod crimson-guard-method-214 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-214 ((this crimson-guard)) (let* ((s4-0 (-> this target-pos-predict-miss)) (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) @@ -1360,7 +1349,7 @@ ) ) -(defmethod crimson-guard-method-217 crimson-guard ((this crimson-guard) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod crimson-guard-method-217 ((this crimson-guard) (arg0 vector) (arg1 vector) (arg2 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1469,7 +1458,7 @@ ) ) -(defmethod crimson-guard-method-220 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-220 ((this crimson-guard)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1596,7 +1585,7 @@ ) ) -(defmethod crimson-guard-method-221 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-221 ((this crimson-guard)) (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) @@ -1611,7 +1600,7 @@ (none) ) -(defmethod crimson-guard-method-215 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-215 ((this crimson-guard)) (let ((s5-0 (get-trans this 3)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -1623,7 +1612,7 @@ ) ) -(defmethod crimson-guard-method-216 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-216 ((this crimson-guard)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> this target-pos-predict-miss quad)) (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) @@ -2212,7 +2201,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-method-226 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-226 ((this crimson-guard)) (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (-> this root)) (s3-0 (lambda ((arg0 crimson-guard) (arg1 collide-shape-moving) (arg2 vector)) @@ -2745,7 +2734,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-method-222 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-222 ((this crimson-guard)) (local-vars (sv-800 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -3238,7 +3227,7 @@ ) ) -(defmethod crimson-guard-method-223 crimson-guard ((this crimson-guard) (arg0 float)) +(defmethod crimson-guard-method-223 ((this crimson-guard) (arg0 float)) (let* ((s3-0 (handle->process (-> this transport))) (s4-0 (if (type? s3-0 process-focusable) (the-as process-focusable s3-0) @@ -3272,7 +3261,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod crimson-guard-method-224 crimson-guard ((this crimson-guard) (arg0 vector)) +(defmethod crimson-guard-method-224 ((this crimson-guard) (arg0 vector)) (local-vars (f0-8 float) (sv-768 vector) @@ -3392,7 +3381,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 crimson-guard ((this crimson-guard)) +(defmethod enemy-method-93 ((this crimson-guard)) (let ((s5-0 (-> this nav state)) (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) @@ -3418,11 +3407,11 @@ (none) ) -(defmethod enemy-method-89 crimson-guard ((this crimson-guard) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this crimson-guard) (arg0 enemy-jump-info)) #f ) -(defmethod enemy-method-87 crimson-guard ((this crimson-guard) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this crimson-guard) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -3438,7 +3427,7 @@ #t ) -(defmethod enemy-method-88 crimson-guard ((this crimson-guard) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this crimson-guard) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -3454,7 +3443,7 @@ #t ) -(defmethod enemy-method-90 crimson-guard ((this crimson-guard) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 ((this crimson-guard) (arg0 int) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond @@ -3609,7 +3598,7 @@ ) ) -(defmethod init-enemy-collision! crimson-guard ((this crimson-guard)) +(defmethod init-enemy-collision! ((this crimson-guard)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -3681,7 +3670,7 @@ (none) ) -(defmethod relocate crimson-guard ((this crimson-guard) (arg0 int)) +(defmethod relocate ((this crimson-guard) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -3691,7 +3680,7 @@ (call-parent-method this arg0) ) -(defmethod init-enemy! crimson-guard ((this crimson-guard)) +(defmethod init-enemy! ((this crimson-guard)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -3724,7 +3713,7 @@ (none) ) -(defmethod crimson-guard-method-225 crimson-guard ((this crimson-guard) (arg0 uint) (arg1 symbol)) +(defmethod crimson-guard-method-225 ((this crimson-guard) (arg0 uint) (arg1 symbol)) (set! (-> this guard-type) arg0) (set! (-> this settings) (get-traffic-guard-type-settings (-> this controller traffic) (the-as int (-> this guard-type))) @@ -3784,7 +3773,7 @@ (none) ) -(defmethod citizen-init! crimson-guard ((this crimson-guard)) +(defmethod citizen-init! ((this crimson-guard)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen citizen-init!))) (t9-0 this) diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc index e8bf1b7ad53..dcaa8df61a7 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc @@ -8,29 +8,27 @@ ;; DECOMP BEGINS (deftype metalhead-flitter (citizen-enemy) - ((move-angle float :offset-assert 980) - (heading symbol :offset-assert 984) - (change-dir-time time-frame :offset-assert 992) - (last-change-dir uint64 :offset-assert 1000) - (off-screen-timer uint64 :offset-assert 1008) - (amb-sound-timer uint64 :offset-assert 1016) - (attack-time time-frame :offset-assert 1024) - (target-pos vector :inline :offset-assert 1040) - (attack-pos vector :inline :offset-assert 1056) - (base-height float :offset-assert 1072) + ((move-angle float) + (heading symbol) + (change-dir-time time-frame) + (last-change-dir uint64) + (off-screen-timer uint64) + (amb-sound-timer uint64) + (attack-time time-frame) + (target-pos vector :inline) + (attack-pos vector :inline) + (base-height float) ) - :heap-base #x3c0 - :method-count-assert 210 - :size-assert #x434 - :flag-assert #xd203c00434 + (:state-methods + attack + ambush-jumping + ) (:methods - (attack () _type_ :state 203) - (ambush-jumping () _type_ :state 204) - (metalhead-flitter-method-205 (_type_) none 205) - (metalhead-flitter-method-206 (_type_) none 206) - (metalhead-flitter-method-207 (_type_ process-focusable) symbol 207) - (metalhead-flitter-method-208 (_type_ symbol) none 208) - (metalhead-flitter-method-209 (_type_) float 209) + (metalhead-flitter-method-205 (_type_) none) + (metalhead-flitter-method-206 (_type_) none) + (metalhead-flitter-method-207 (_type_ process-focusable) symbol) + (metalhead-flitter-method-208 (_type_ symbol) none) + (metalhead-flitter-method-209 (_type_) float) ) ) @@ -189,7 +187,7 @@ (set! (-> *metalhead-flitter-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod metalhead-flitter-method-207 metalhead-flitter ((this metalhead-flitter) (arg0 process-focusable)) +(defmethod metalhead-flitter-method-207 ((this metalhead-flitter) (arg0 process-focusable)) (and (logtest? (-> this draw status) (draw-control-status on-screen)) (let ((s4-0 (camera-matrix))) (camera-pos) @@ -203,7 +201,7 @@ ) ) -(defmethod enemy-method-77 metalhead-flitter ((this metalhead-flitter) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this metalhead-flitter) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (let ((a0-2 (-> this skel root-channel 0))) @@ -245,7 +243,7 @@ ) ) -(defmethod enemy-method-78 metalhead-flitter ((this metalhead-flitter) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this metalhead-flitter) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -267,7 +265,7 @@ ) ) -(defmethod go-stare2 metalhead-flitter ((this metalhead-flitter)) +(defmethod go-stare2 ((this metalhead-flitter)) (if (and (= (-> this focus aware) (enemy-aware enemy-aware-2)) (not (nav-enemy-method-163 this))) (go (method-of-object this pacing)) (go (method-of-object this stare)) @@ -515,11 +513,11 @@ :post nav-enemy-falling-post ) -(defmethod enemy-method-99 metalhead-flitter ((this metalhead-flitter) (arg0 process-focusable)) +(defmethod enemy-method-99 ((this metalhead-flitter) (arg0 process-focusable)) (focus-test? arg0 mech) ) -(defmethod metalhead-flitter-method-205 metalhead-flitter ((this metalhead-flitter)) +(defmethod metalhead-flitter-method-205 ((this metalhead-flitter)) (let* ((s5-0 (handle->process (-> this focus handle))) (s3-0 (if (type? s5-0 process-focusable) s5-0 @@ -589,7 +587,7 @@ ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod metalhead-flitter-method-206 metalhead-flitter ((this metalhead-flitter)) +(defmethod metalhead-flitter-method-206 ((this metalhead-flitter)) (when (time-elapsed? (the-as int (-> this amb-sound-timer)) (the int (* 300.0 (rand-vu-float-range 1.5 3.0)))) (sound-play "flitter-amb" :position (-> this root trans)) (set! (-> this amb-sound-timer) (the-as uint (current-time))) @@ -749,7 +747,7 @@ ) ) -(defmethod metalhead-flitter-method-209 metalhead-flitter ((this metalhead-flitter)) +(defmethod metalhead-flitter-method-209 ((this metalhead-flitter)) (lerp-scale 0.0 1.0 (- (-> this attack-pos y) (-> this root trans y)) 13926.4 25600.0) ) @@ -998,7 +996,7 @@ ) ) -(defmethod metalhead-flitter-method-208 metalhead-flitter ((this metalhead-flitter) (arg0 symbol)) +(defmethod metalhead-flitter-method-208 ((this metalhead-flitter) (arg0 symbol)) (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) @@ -1013,7 +1011,7 @@ (none) ) -(defmethod init-enemy-collision! metalhead-flitter ((this metalhead-flitter)) +(defmethod init-enemy-collision! ((this metalhead-flitter)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1067,7 +1065,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod init-enemy! metalhead-flitter ((this metalhead-flitter)) +(defmethod init-enemy! ((this metalhead-flitter)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1105,7 +1103,7 @@ (none) ) -(defmethod citizen-init! metalhead-flitter ((this metalhead-flitter)) +(defmethod citizen-init! ((this metalhead-flitter)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen-enemy citizen-init!))) (t9-0 this) diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-grunt.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-grunt.gc index 84b9c286afb..21846843947 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-grunt.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-grunt.gc @@ -219,42 +219,40 @@ (set! (-> *metalhead-grunt-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (deftype metalhead-grunt (citizen-enemy) - ((patrol-anim grunt-anim-info :offset-assert 980) - (charge-anim grunt-anim-info :offset-assert 984) - (attack-anim grunt-anim-info :offset-assert 988) - (knocked-anim grunt-anim-info :offset-assert 992) - (yellow-hit-anim grunt-anim-info :offset-assert 996) - (blue-hit-anim grunt-anim-info :offset-assert 1000) - (intro-path path-control :offset-assert 1004) - (pad-jh1b23jhb13 uint32 :offset-assert 1008) - (use-charge-anim-index int8 :offset-assert 1012) - (knocked-anim-index int8 :offset-assert 1013) - (jumping-ambush-path-pt int8 :offset-assert 1014) - (grunt-flags uint8 :offset-assert 1015) - (state-timeout2 uint64 :offset-assert 1016) - (next-warn-time time-frame :offset-assert 1024) - (dest vector :inline :offset-assert 1040) - (pad-kj1n23kj1n23 uint32 4 :offset-assert 1056) + ((patrol-anim grunt-anim-info) + (charge-anim grunt-anim-info) + (attack-anim grunt-anim-info) + (knocked-anim grunt-anim-info) + (yellow-hit-anim grunt-anim-info) + (blue-hit-anim grunt-anim-info) + (intro-path path-control) + (pad-jh1b23jhb13 uint32) + (use-charge-anim-index int8) + (knocked-anim-index int8) + (jumping-ambush-path-pt int8) + (grunt-flags uint8) + (state-timeout2 uint64) + (next-warn-time time-frame) + (dest vector :inline) + (pad-kj1n23kj1n23 uint32 4) ) - :heap-base #x3b0 - :method-count-assert 212 - :size-assert #x430 - :flag-assert #xd403b00430 + (:state-methods + attack + falling-ambush + jumping-ambush + jumping-ambush-cont + wait-for-focus + spin-attack + ) (:methods - (attack () _type_ :state 203) - (falling-ambush () _type_ :state 204) - (jumping-ambush () _type_ :state 205) - (jumping-ambush-cont () _type_ :state 206) - (wait-for-focus () _type_ :state 207) - (spin-attack () _type_ :state 208) - (metalhead-grunt-method-209 (_type_ float) process-focusable 209) - (get-nav-info (_type_) nav-enemy-info 210) - (metalhead-grunt-method-211 (_type_) none 211) + (metalhead-grunt-method-209 (_type_ float) process-focusable) + (get-nav-info (_type_) nav-enemy-info) + (metalhead-grunt-method-211 (_type_) none) ) ) -(defmethod general-event-handler metalhead-grunt ((this metalhead-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this metalhead-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -313,7 +311,7 @@ ) ) -(defmethod go-ambush metalhead-grunt ((this metalhead-grunt)) +(defmethod go-ambush ((this metalhead-grunt)) (cond ((logtest? (-> this fact enemy-options) (enemy-option user10)) (go (method-of-object this falling-ambush)) @@ -379,7 +377,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 metalhead-grunt ((this metalhead-grunt)) +(defmethod enemy-method-93 ((this metalhead-grunt)) (case (-> this jump-why) ((2) (go (method-of-object this jumping-ambush-cont)) @@ -568,7 +566,7 @@ ) ) -(defmethod metalhead-grunt-method-209 metalhead-grunt ((this metalhead-grunt) (arg0 float)) +(defmethod metalhead-grunt-method-209 ((this metalhead-grunt) (arg0 float)) (local-vars (v1-5 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -918,7 +916,7 @@ ) ) -(defmethod enemy-method-77 metalhead-grunt ((this metalhead-grunt) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this metalhead-grunt) (arg0 (pointer float))) (local-vars (v1-72 int) (a2-3 int) (a2-5 int)) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) @@ -1062,7 +1060,7 @@ ) ) -(defmethod enemy-method-78 metalhead-grunt ((this metalhead-grunt) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this metalhead-grunt) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (or (logtest? (-> this grunt-flags) 2) (let ((v1-7 (if (> (-> this skel active-channels) 0) @@ -1161,20 +1159,20 @@ :post (-> (method-of-type nav-enemy idle) post) ) -(defmethod metalhead-grunt-method-211 metalhead-grunt ((this metalhead-grunt)) +(defmethod metalhead-grunt-method-211 ((this metalhead-grunt)) 0 (none) ) ;; WARN: Return type mismatch citizen-enemy vs metalhead-grunt. -(defmethod relocate metalhead-grunt ((this metalhead-grunt) (arg0 int)) +(defmethod relocate ((this metalhead-grunt) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) ) (the-as metalhead-grunt ((method-of-type citizen-enemy relocate) this arg0)) ) -(defmethod init-enemy-collision! metalhead-grunt ((this metalhead-grunt)) +(defmethod init-enemy-collision! ((this metalhead-grunt)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1269,11 +1267,11 @@ (none) ) -(defmethod get-nav-info metalhead-grunt ((this metalhead-grunt)) +(defmethod get-nav-info ((this metalhead-grunt)) *metalhead-grunt-nav-enemy-info* ) -(defmethod init-enemy! metalhead-grunt ((this metalhead-grunt)) +(defmethod init-enemy! ((this metalhead-grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc index 86468937439..42d5a416e05 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc @@ -9,15 +9,11 @@ (deftype metalhead-predator-shot (metalhead-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound metalhead-predator-shot ((this metalhead-predator-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this metalhead-predator-shot) (arg0 projectile-options)) (case arg0 (((projectile-options lose-altitude)) (sound-play "pred-shot-hit") @@ -35,7 +31,7 @@ (none) ) -(defmethod init-proj-collision! metalhead-predator-shot ((this metalhead-predator-shot)) +(defmethod init-proj-collision! ((this metalhead-predator-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -87,7 +83,7 @@ (none) ) -(defmethod init-proj-settings! metalhead-predator-shot ((this metalhead-predator-shot)) +(defmethod init-proj-settings! ((this metalhead-predator-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'predator-shot) @@ -280,31 +276,29 @@ (set! (-> *metalhead-predator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (deftype metalhead-predator (citizen-enemy) - ((los los-control :inline :offset-assert 992) - (want-stop symbol :offset-assert 1140) - (target-pos vector :inline :offset-assert 1152) - (curr-node int32 :offset-assert 1168) - (hide-pos vector :inline :offset-assert 1184) - (next-change int64 :offset-assert 1200) - (shoot-angle degrees :offset-assert 1208) - (miss-amount float :offset-assert 1212) - (ambient-sound-id sound-id :offset-assert 1216) - (shock-effect-time time-frame :offset-assert 1224) - (shock-effect-end int64 :offset-assert 1232) - (fade float :offset-assert 1240) - (dest-fade float :offset-assert 1244) + ((los los-control :inline) + (want-stop symbol) + (target-pos vector :inline) + (curr-node int32) + (hide-pos vector :inline) + (next-change int64) + (shoot-angle degrees) + (miss-amount float) + (ambient-sound-id sound-id) + (shock-effect-time time-frame) + (shock-effect-end int64) + (fade float) + (dest-fade float) ) - :heap-base #x460 - :method-count-assert 209 - :size-assert #x4e0 - :flag-assert #xd1046004e0 + (:state-methods + fire + close-attack + ) (:methods - (fire () _type_ :state 203) - (close-attack () _type_ :state 204) - (metalhead-predator-method-205 (_type_ symbol) none 205) - (metalhead-predator-method-206 (_type_ int float) none 206) - (metalhead-predator-method-207 (_type_ vector vector vector) symbol 207) - (metalhead-predator-method-208 (_type_) none 208) + (metalhead-predator-method-205 (_type_ symbol) none) + (metalhead-predator-method-206 (_type_ int float) none) + (metalhead-predator-method-207 (_type_ vector vector vector) symbol) + (metalhead-predator-method-208 (_type_) none) ) ) @@ -330,7 +324,7 @@ ) ) -(defmethod metalhead-predator-method-208 metalhead-predator ((this metalhead-predator)) +(defmethod metalhead-predator-method-208 ((this metalhead-predator)) (cond ((< (-> this hit-points) 2) (when (!= (-> this dest-fade) 128.0) @@ -384,7 +378,7 @@ (none) ) -(defmethod track-target! metalhead-predator ((this metalhead-predator)) +(defmethod track-target! ((this metalhead-predator)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -399,7 +393,7 @@ ) ;; WARN: disable def twice: 21. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler metalhead-predator ((this metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -418,7 +412,7 @@ ) ) -(defmethod enemy-method-77 metalhead-predator ((this metalhead-predator) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this metalhead-predator) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (case (-> this incoming knocked-type) @@ -510,7 +504,7 @@ ) ) -(defmethod enemy-method-78 metalhead-predator ((this metalhead-predator) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this metalhead-predator) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (case (-> this incoming knocked-type) @@ -585,11 +579,11 @@ ) ) -(defmethod get-inv-mass metalhead-predator ((this metalhead-predator)) +(defmethod get-inv-mass ((this metalhead-predator)) 0.5 ) -(defmethod metalhead-predator-method-207 metalhead-predator ((this metalhead-predator) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod metalhead-predator-method-207 ((this metalhead-predator) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f0-0 1228.8) (f30-0 6144.0) @@ -659,7 +653,7 @@ ) ) -(defmethod metalhead-predator-method-206 metalhead-predator ((this metalhead-predator) (arg0 int) (arg1 float)) +(defmethod metalhead-predator-method-206 ((this metalhead-predator) (arg0 int) (arg1 float)) (local-vars (sv-240 vector) (sv-256 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1001,7 +995,7 @@ :post nav-enemy-chase-post ) -(defmethod metalhead-predator-method-205 metalhead-predator ((this metalhead-predator) (arg0 symbol)) +(defmethod metalhead-predator-method-205 ((this metalhead-predator) (arg0 symbol)) (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (+ (-> v1-1 specific 0) -2))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child (+ a0-1 2)))) @@ -1016,7 +1010,7 @@ (none) ) -(defmethod init-enemy-collision! metalhead-predator ((this metalhead-predator)) +(defmethod init-enemy-collision! ((this metalhead-predator)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1096,11 +1090,11 @@ (none) ) -(defmethod relocate metalhead-predator ((this metalhead-predator) (arg0 int)) +(defmethod relocate ((this metalhead-predator) (arg0 int)) (call-parent-method this arg0) ) -(defmethod init-enemy! metalhead-predator ((this metalhead-predator)) +(defmethod init-enemy! ((this metalhead-predator)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1137,7 +1131,7 @@ (none) ) -(defmethod citizen-init! metalhead-predator ((this metalhead-predator)) +(defmethod citizen-init! ((this metalhead-predator)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen-enemy citizen-init!))) (t9-0 this) diff --git a/goal_src/jak2/levels/city/traffic/traffic-engine-h.gc b/goal_src/jak2/levels/city/traffic/traffic-engine-h.gc index dea232324f3..38ba2af5979 100644 --- a/goal_src/jak2/levels/city/traffic/traffic-engine-h.gc +++ b/goal_src/jak2/levels/city/traffic/traffic-engine-h.gc @@ -87,414 +87,360 @@ ;; DECOMP BEGINS (deftype nav-segment (structure) - ((vertex vector 2 :inline :offset-assert 0) - (length float :offset 12) - (spawn-spacing float :offset 28) - (branch nav-branch :offset-assert 32) - (nav-mesh-id uint32 :offset-assert 36) - (id uint16 :offset-assert 40) - (cell-id uint16 :offset-assert 42) - (from-cell-id uint16 :offset-assert 44) - (tracker-id int8 :offset-assert 46) - (pad0 int8 :offset-assert 47) + ((vertex vector 2 :inline) + (length float :overlay-at (-> vertex 0 data 3)) + (spawn-spacing float :offset 28) + (branch nav-branch) + (nav-mesh-id uint32) + (id uint16) + (cell-id uint16) + (from-cell-id uint16) + (tracker-id int8) + (pad0 int8) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype vis-cell (structure) - ((sphere sphere :inline :offset-assert 0) - (segment-array (inline-array nav-segment) :offset-assert 16) - (vis-id uint16 :offset-assert 20) - (id uint16 :offset-assert 22) - (incoming-segment-count int8 :offset-assert 24) - (segment-count int8 :offset-assert 25) - (flags vis-cell-flag :offset-assert 26) - (alloc-segment-count int8 :offset 26) - (prev-flags vis-cell-flag :offset-assert 27) - (pad0 uint32 :offset 28) + ((sphere sphere :inline) + (segment-array (inline-array nav-segment)) + (vis-id uint16) + (id uint16) + (incoming-segment-count int8) + (segment-count int8) + (flags vis-cell-flag) + (alloc-segment-count int8 :overlay-at flags) + (prev-flags vis-cell-flag) + (pad0 uint32 :offset 28) ) - :method-count-assert 11 - :size-assert #x20 - :flag-assert #xb00000020 (:methods - (reset-segment-counts (_type_) none 9) - (debug-draw (_type_) none 10) + (reset-segment-counts (_type_) none) + (debug-draw (_type_) none) ) ) (deftype vis-grid-pos (structure) - ((data int8 3 :offset-assert 0) - (x int8 :offset 0) - (y int8 :offset 1) - (z int8 :offset 2) + ((data int8 3) + (x int8 :overlay-at (-> data 0)) + (y int8 :overlay-at (-> data 1)) + (z int8 :overlay-at (-> data 2)) ) :pack-me - :method-count-assert 9 - :size-assert #x3 - :flag-assert #x900000003 ) (deftype vis-grid-box (structure) - ((min vis-grid-pos :inline :offset-assert 0) - (max vis-grid-pos :inline :offset-assert 3) + ((min vis-grid-pos :inline) + (max vis-grid-pos :inline) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) (deftype vis-ray (structure) - ((pos vector :inline :offset-assert 0) - (dir vector :inline :offset-assert 16) - (dest-pos vector :inline :offset-assert 32) - (plane plane :inline :offset-assert 48) - (grid-pos vis-grid-pos :inline :offset-assert 64) - (len float :offset-assert 68) - (cell vis-cell :offset-assert 72) + ((pos vector :inline) + (dir vector :inline) + (dest-pos vector :inline) + (plane plane :inline) + (grid-pos vis-grid-pos :inline) + (len float) + (cell vis-cell) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) (deftype grid-info (structure) - ((axis-scale float 3 :offset-assert 0) - (dimension-array int8 3 :offset-assert 12) - (pad0 uint8 1 :offset-assert 15) - (box bounding-box :inline :offset-assert 16) - (cell-size vector :inline :offset-assert 48) + ((axis-scale float 3) + (dimension-array int8 3) + (pad0 uint8 1) + (box bounding-box :inline) + (cell-size vector :inline) ) - :method-count-assert 14 - :size-assert #x40 - :flag-assert #xe00000040 (:methods - (setup-grid-from-bounding-box (_type_ (pointer bounding-box) int int) none 9) - (lookup-cell-for-point (_type_ vis-grid-pos vector) none 10) - (lookup-box-for-sphere (_type_ vis-grid-box vector) none 11) - (debug-draw-grid (_type_ rgba) none 12) - (debug-draw-cell (_type_ vis-grid-pos rgba) none 13) + (setup-grid-from-bounding-box (_type_ (pointer bounding-box) int int) none) + (lookup-cell-for-point (_type_ vis-grid-pos vector) none) + (lookup-box-for-sphere (_type_ vis-grid-box vector) none) + (debug-draw-grid (_type_ rgba) none) + (debug-draw-cell (_type_ vis-grid-pos rgba) none) ) ) (deftype city-level-info (structure) - ((grid-info grid-info :inline :offset-assert 0) - (cell-array (inline-array vis-cell) :offset-assert 64) - (segment-count int16 :offset-assert 68) - (cell-count uint16 :offset-assert 70) - (segment-array (inline-array nav-segment) :offset-assert 72) - (nav-graph nav-graph :offset-assert 76) - (camera-ceiling meters :offset-assert 80) - (pad-array int8 56 :offset-assert 84) + ((grid-info grid-info :inline) + (cell-array (inline-array vis-cell)) + (segment-count int16) + (cell-count uint16) + (segment-array (inline-array nav-segment)) + (nav-graph nav-graph) + (camera-ceiling meters) + (pad-array int8 56) ) - :method-count-assert 19 - :size-assert #x8c - :flag-assert #x130000008c (:methods - (city-level-info-method-9 (_type_) symbol 9) - (init-vis-ray (_type_ vis-ray vector vector) none 10) - (city-level-info-method-11 (_type_ vis-ray) none 11) - (city-level-info-method-12 (_type_ vector nav-branch vector) vector 12) - (lookup-cell-by-position (_type_ vector) vis-cell 13) - (get-first-cell-in-box (_type_ vis-grid-box) vis-cell 14) - (sphere-in-grid? (_type_ vector int) symbol 15) - (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none 16) - (update-suppressions-from-traffic-engine (_type_ traffic-engine) none 17) - (city-level-info-method-18 (_type_) none 18) + (city-level-info-method-9 (_type_) symbol) + (init-vis-ray (_type_ vis-ray vector vector) none) + (city-level-info-method-11 (_type_ vis-ray) none) + (city-level-info-method-12 (_type_ vector nav-branch vector) vector) + (lookup-cell-by-position (_type_ vector) vis-cell) + (get-first-cell-in-box (_type_ vis-grid-box) vis-cell) + (sphere-in-grid? (_type_ vector int) symbol) + (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) + (update-suppressions-from-traffic-engine (_type_ traffic-engine) none) + (city-level-info-method-18 (_type_) none) ) ) (deftype traffic-level-data (structure) - ((city-info city-level-info :offset-assert 0) - (active-cell-count uint8 :offset-assert 4) - (newly-active-cell-count uint8 :offset-assert 5) - (active-cell-list vis-cell 255 :offset-assert 8) - (newly-active-cell-list vis-cell 255 :offset-assert 1028) - (active-cell-box bounding-box :inline :offset-assert 2048) + ((city-info city-level-info) + (active-cell-count uint8) + (newly-active-cell-count uint8) + (active-cell-list vis-cell 255) + (newly-active-cell-list vis-cell 255) + (active-cell-box bounding-box :inline) ) - :method-count-assert 15 - :size-assert #x820 - :flag-assert #xf00000820 (:methods - (reset (_type_) none 9) - (add-active-cell (_type_ vis-cell) none 10) - (remove-active-cell (_type_ int) none 11) - (add-newly-active-cell (_type_ vis-cell) none 12) - (per-frame-cell-update (_type_) none 13) - (debug-draw (_type_) none 14) + (reset (_type_) none) + (add-active-cell (_type_ vis-cell) none) + (remove-active-cell (_type_ int) none) + (add-newly-active-cell (_type_ vis-cell) none) + (per-frame-cell-update (_type_) none) + (debug-draw (_type_) none) ) ) (deftype traffic-suppression-box (structure) - ((data uint8 32 :offset-assert 0) - (bbox bounding-box :inline :offset 0) - (flags traffic-suppression-box-flags :offset 12) - (duration uint32 :offset 28) + ((data uint8 32) + (bbox bounding-box :inline :overlay-at (-> data 0)) + (flags traffic-suppression-box-flags :overlay-at (-> data 12)) + (duration uint32 :overlay-at (-> data 28)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype traffic-guard-type-info (structure) - ((object-type traffic-type :offset-assert 0) - (max-target-count int8 :offset-assert 1) - (min-target-count int8 :offset-assert 2) - (target-count int8 :offset-assert 3) - (count int8 :offset-assert 4) - (change-to-type uint8 :offset-assert 5) + ((object-type traffic-type) + (max-target-count int8) + (min-target-count int8) + (target-count int8) + (count int8) + (change-to-type uint8) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) (deftype traffic-guard-type-settings (structure) - ((target-count int8 :offset-assert 0) - (inaccuracy float :offset-assert 4) - (acquire-delay uint16 :offset-assert 8) - (shot-delay uint16 :offset-assert 10) - (burst-delay uint16 :offset-assert 12) - (shot-count int8 :offset-assert 14) - (rand-shot-count int8 :offset-assert 15) + ((target-count int8) + (inaccuracy float) + (acquire-delay uint16) + (shot-delay uint16) + (burst-delay uint16) + (shot-count int8) + (rand-shot-count int8) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype traffic-alert-state-settings (structure) - ((guard-settings-array traffic-guard-type-settings 6 :inline :offset-assert 0) - (ped-tazer traffic-guard-type-settings :inline :offset 0) - (ped-rifle traffic-guard-type-settings :inline :offset 16) - (ped-grenade traffic-guard-type-settings :inline :offset 32) - (ped-roboguard traffic-guard-type-settings :inline :offset 48) - (bike-turret traffic-guard-type-settings :inline :offset 64) - (hellcat-turret traffic-guard-type-settings :inline :offset 80) + ((guard-settings-array traffic-guard-type-settings 6 :inline) + (ped-tazer traffic-guard-type-settings :inline :overlay-at (-> guard-settings-array 0)) + (ped-rifle traffic-guard-type-settings :inline :overlay-at (-> guard-settings-array 1)) + (ped-grenade traffic-guard-type-settings :inline :overlay-at (-> guard-settings-array 2)) + (ped-roboguard traffic-guard-type-settings :inline :overlay-at (-> guard-settings-array 3)) + (bike-turret traffic-guard-type-settings :inline :overlay-at (-> guard-settings-array 4)) + (hellcat-turret traffic-guard-type-settings :inline :overlay-at (-> guard-settings-array 5)) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) (deftype traffic-target-status (structure) - ((flags traffic-target-flag :offset-assert 0) - (handle handle :offset-assert 8) - (last-seen-time time-frame :offset-assert 16) - (position vector :inline :offset-assert 32) - (velocity vector :inline :offset-assert 48) - (move-position vector :inline :offset-assert 64) + ((flags traffic-target-flag) + (handle handle) + (last-seen-time time-frame) + (position vector :inline) + (velocity vector :inline) + (move-position vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype traffic-alert-state (structure) - ((flags traffic-alert-flag :offset-assert 0) - (level uint8 :offset-assert 1) - (max-level uint8 :offset-assert 2) - (guards-in-sight-of-target int8 :offset-assert 3) - (guard-aim-count int8 :offset-assert 4) - (guard-inaccuracy-factor float :offset-assert 8) - (guard-target-level float :offset-assert 12) - (duration uint32 :offset-assert 16) - (start-time time-frame :offset-assert 24) - (notify-time time-frame :offset-assert 32) - (alarm-sound-id sound-id :offset-assert 40) - (target-status-array traffic-target-status 3 :inline :offset-assert 48) - (settings traffic-alert-state-settings :inline :offset-assert 288) - (guard-type-info-array traffic-guard-type-info 6 :inline :offset-assert 384) - (guard-type-mask-from-object-type uint32 126 :offset-assert 480) + ((flags traffic-alert-flag) + (level uint8) + (max-level uint8) + (guards-in-sight-of-target int8) + (guard-aim-count int8) + (guard-inaccuracy-factor float) + (guard-target-level float) + (duration uint32) + (start-time time-frame) + (notify-time time-frame) + (alarm-sound-id sound-id) + (target-status-array traffic-target-status 3 :inline) + (settings traffic-alert-state-settings :inline) + (guard-type-info-array traffic-guard-type-info 6 :inline) + (guard-type-mask-from-object-type uint32 126) ) - :method-count-assert 10 - :size-assert #x3d8 - :flag-assert #xa000003d8 (:methods - (reset (_type_) none 9) + (reset (_type_) none) ) ) (deftype traffic-object-type-info (structure) - ((flags traffic-type-flags :offset-assert 0) - (target-count int8 :offset-assert 1) - (active-count int8 :offset-assert 2) - (inactive-count int8 :offset-assert 3) - (reserve-count uint16 :offset-assert 4) - (killed-count uint16 :offset-assert 6) - (want-count int8 :offset-assert 8) - (tracker-index uint8 :offset-assert 9) - (parking-spot-prob uint8 :offset-assert 10) - (guard-type uint8 :offset-assert 11) - (array (pointer handle) :offset-assert 12) - (level symbol :offset-assert 16) + ((flags traffic-type-flags) + (target-count int8) + (active-count int8) + (inactive-count int8) + (reserve-count uint16) + (killed-count uint16) + (want-count int8) + (tracker-index uint8) + (parking-spot-prob uint8) + (guard-type uint8) + (array (pointer handle)) + (level symbol) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype traffic-suppressor (structure) - ((flags traffic-suppression-flags :offset-assert 0) - (bbox bounding-box :inline :offset-assert 16) - (array traffic-suppression-box 16 :inline :offset-assert 48) + ((flags traffic-suppression-flags) + (bbox bounding-box :inline) + (array traffic-suppression-box 16 :inline) ) - :method-count-assert 14 - :size-assert #x230 - :flag-assert #xe00000230 (:methods - (reset-boxes (_type_) none 9) - (add-new-supression-box (_type_ traffic-suppression-params) none 10) - (remove-box-by-id (_type_ int) none 11) - (update-box-from-params (_type_ traffic-suppression-params) none 12) - (debug-draw (_type_) none 13) + (reset-boxes (_type_) none) + (add-new-supression-box (_type_ traffic-suppression-params) none) + (remove-box-by-id (_type_ int) none) + (update-box-from-params (_type_ traffic-suppression-params) none) + (debug-draw (_type_) none) ) ) (deftype traffic-tracker (structure) - ((traffic traffic-engine :offset-assert 0) - (object-hash spatial-hash :offset-assert 4) - (rand float :offset-assert 8) - (id uint8 :offset-assert 12) - (active-object-count uint8 :offset-assert 13) - (inactive-object-count int8 :offset-assert 14) - (active-object-list handle 126 :offset-assert 16) - (active-object-type-list traffic-type 126 :offset-assert 1024) + ((traffic traffic-engine) + (object-hash spatial-hash) + (rand float) + (id uint8) + (active-object-count uint8) + (inactive-object-count int8) + (active-object-list handle 126) + (active-object-type-list traffic-type 126) ) - :method-count-assert 27 - :size-assert #x47e - :flag-assert #x1b0000047e (:methods - (traffic-tracker-method-9 (_type_) none 9) - (traffic-tracker-method-10 (_type_) none 10) - (traffic-tracker-method-11 (_type_) none 11) - (add-active-process (_type_ traffic-type handle) none 12) - (remove-active-process (_type_ int) handle 13) - (add-reserved-process (_type_ traffic-type handle) none 14) - (get-from-inactive-by-type (_type_ traffic-type) handle 15) - (get-from-inactive-by-handle (_type_ traffic-type handle) handle 16) - (deactivate-object (_type_ int symbol) none 17) - (set-process-to-killed (_type_ process) none 18) - (deactivate-all (_type_ symbol) none 19) - (deactivate-all-of-type (_type_ traffic-type symbol) none 20) - (activate-from-params (_type_ traffic-object-spawn-params) none 21) - (activate-by-type (_type_ traffic-type nav-segment float) none 22) - (activate-by-handle (_type_ traffic-object-spawn-params) none 23) - (reset (_type_ uint traffic-engine) none 24) - (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none 25) - (for-all-active-processes-of-type (_type_ traffic-type (function process-focusable traffic-object-type-info none)) none 26) + (traffic-tracker-method-9 (_type_) none) + (traffic-tracker-method-10 (_type_) none) + (traffic-tracker-method-11 (_type_) none) + (add-active-process (_type_ traffic-type handle) none) + (remove-active-process (_type_ int) handle) + (add-reserved-process (_type_ traffic-type handle) none) + (get-from-inactive-by-type (_type_ traffic-type) handle) + (get-from-inactive-by-handle (_type_ traffic-type handle) handle) + (deactivate-object (_type_ int symbol) none) + (set-process-to-killed (_type_ process) none) + (deactivate-all (_type_ symbol) none) + (deactivate-all-of-type (_type_ traffic-type symbol) none) + (activate-from-params (_type_ traffic-object-spawn-params) none) + (activate-by-type (_type_ traffic-type nav-segment float) none) + (activate-by-handle (_type_ traffic-object-spawn-params) none) + (reset (_type_ uint traffic-engine) none) + (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none) + (for-all-active-processes-of-type (_type_ traffic-type (function process-focusable traffic-object-type-info none)) none) ) ) (deftype traffic-engine (basic) - ((object-hash spatial-hash :offset-assert 4) - (manager handle :offset-assert 8) - (inv-density-factor float :offset-assert 16) - (sync-clock uint8 :offset-assert 20) - (sync-mask-8 uint8 :offset-assert 21) - (sync-mask-16 uint16 :offset-assert 22) - (sync-mask-32 uint32 :offset-assert 24) - (sync-array uint8 4 :offset-assert 28) - (flags uint8 :offset-assert 32) - (alert-state traffic-alert-state :inline :offset-assert 48) - (level-data-array traffic-level-data 2 :inline :offset-assert 1040) - (object-type-info-array traffic-object-type-info 21 :inline :offset-assert 5200) - (tracker-array traffic-tracker 2 :inline :offset-assert 5872) - (citizen-tracker-array traffic-tracker :inline :offset 5872) - (vehicle-tracker-array traffic-tracker :inline :offset 7024) - (inactive-object-array handle 420 :offset-assert 8176) - (suppressor traffic-suppressor :inline :offset-assert 11536) - (danger-sphere-count int8 :offset-assert 12096) - (pad int8 15 :offset-assert 12097) - (danger-sphere-array traffic-danger-info 4 :inline :offset-assert 12112) + ((object-hash spatial-hash) + (manager handle) + (inv-density-factor float) + (sync-clock uint8) + (sync-mask-8 uint8) + (sync-mask-16 uint16) + (sync-mask-32 uint32) + (sync-array uint8 4) + (flags uint8) + (alert-state traffic-alert-state :inline) + (level-data-array traffic-level-data 2 :inline) + (object-type-info-array traffic-object-type-info 21 :inline) + (tracker-array traffic-tracker 2 :inline) + (citizen-tracker-array traffic-tracker :inline :overlay-at (-> tracker-array 0)) + (vehicle-tracker-array traffic-tracker :inline :offset 7024) + (inactive-object-array handle 420) + (suppressor traffic-suppressor :inline) + (danger-sphere-count int8) + (pad int8 15) + (danger-sphere-array traffic-danger-info 4 :inline) ) - :method-count-assert 74 - :size-assert #x3050 - :flag-assert #x4a00003050 (:methods - (new (symbol type) _type_ 0) - (update-traffic (_type_) none 9) - (reset-and-init-from-manager (_type_ process) none 10) - (stop-alarm-sound (_type_) none 11) - (debug-unused (_type_) none 12) - (add-object (_type_ traffic-type process) none 13) - (sphere-in-loaded-city-infos? (_type_ vector int) symbol 14) - (activate-one-citizen (_type_ nav-segment float) none 15) - (activate-one-vehicle (_type_ nav-segment float) none 16) - (can-dest-be-used? (_type_ nav-branch) symbol 17) - (child-killed (_type_ process) none 18) - (deactivate-all-from-level (_type_ symbol) none 19) - (find-best-segment (_type_ vector vector int) nav-segment 20) - (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none 21) - (add-danger (_type_ traffic-danger-info) none 22) - (guard-count (_type_) int 23) - (set-target-level (_type_ float) none 24) - (set-guard-target-level (_type_ float) none 25) - (deactivate-all (_type_) none 26) - (deactivate-by-type (_type_ traffic-type) none 27) - (maybe-increase-guard-aim-count (_type_) symbol 28) - (restore-default-settings (_type_) none 29) - (increase-alert-level (_type_ int target) none 30) - (decrease-alert-level (_type_ int) none 31) - (set-alert-level (_type_ int) none 32) - (set-max-alert-level (_type_ int) none 33) - (set-alert-duration (_type_ time-frame) none 34) - (get-alert-level (_type_) int 35) - (get-target (_type_) target 36) - (set-object-target-level (_type_ int float) none 37) - (set-object-target-count (_type_ int int) none 38) - (set-object-reserve-count (_type_ int uint) none 39) - (get-object-reserve-count (_type_ int) int 40) - (get-object-remaining-count (_type_ int) int 41) - (activate-object (_type_ traffic-object-spawn-params) none 42) - (activate-by-handle (_type_ traffic-object-spawn-params) none 43) - (set-parking-spot-prob (_type_ int float) none 44) - (get-random-parking-spot-type (_type_) traffic-type 45) - (new-suppression-box (_type_ traffic-suppression-params) none 46) - (remove-suppression-box (_type_ traffic-suppression-params) none 47) - (update-suppression-box (_type_ traffic-suppression-params) none 48) - (traffic-engine-method-49 (_type_ vector int traffic-target-status) traffic-target-status 49) - (find-closest-to-with-collide-lists (_type_ process-drawable collide-spec) process-focusable 50) - (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none 51) - (send-alert-events (_type_) none 52) - (end-pursuit-by-type (_type_ traffic-type) none 53) - (get-traffic-guard-type-settings (_type_ int) traffic-guard-type-settings 54) - (get-guard-type-for-traffic-obj (_type_ int) uint 55) - (get-traffic-guard-change-to-type (_type_ int) uint 56) - (set-guard-target-count-range (_type_ int int int) none 57) - (set-object-auto-activate (_type_ int object) none 58) - (debug-check-proc-in-tracker (_type_ process int) none 59) - (kill-traffic-sphere (_type_ sphere) none 60) - (level-link (_type_ level) none 61) - (level-unlink (_type_ level) none 62) - (traffic-engine-method-63 (_type_) none 63) - (traffic-engine-method-64 (_type_) none 64) - (handle-new-vis-cell (_type_ vis-cell) none 65) - (update-sync-from-frame-counter (_type_) none 66) - (update-guards (_type_) none 67) - (update-traffic-amount (_type_) none 68) - (update-danger (_type_) none 69) - (update-danger-from-target (_type_) none 70) - (update-alert-state (_type_) none 71) - (update-suppressor (_type_) none 72) - (recompute-supressions (_type_) none 73) + (new (symbol type) _type_) + (update-traffic (_type_) none) + (reset-and-init-from-manager (_type_ process) none) + (stop-alarm-sound (_type_) none) + (debug-unused (_type_) none) + (add-object (_type_ traffic-type process) none) + (sphere-in-loaded-city-infos? (_type_ vector int) symbol) + (activate-one-citizen (_type_ nav-segment float) none) + (activate-one-vehicle (_type_ nav-segment float) none) + (can-dest-be-used? (_type_ nav-branch) symbol) + (child-killed (_type_ process) none) + (deactivate-all-from-level (_type_ symbol) none) + (find-best-segment (_type_ vector vector int) nav-segment) + (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) + (add-danger (_type_ traffic-danger-info) none) + (guard-count (_type_) int) + (set-target-level (_type_ float) none) + (set-guard-target-level (_type_ float) none) + (deactivate-all (_type_) none) + (deactivate-by-type (_type_ traffic-type) none) + (maybe-increase-guard-aim-count (_type_) symbol) + (restore-default-settings (_type_) none) + (increase-alert-level (_type_ int target) none) + (decrease-alert-level (_type_ int) none) + (set-alert-level (_type_ int) none) + (set-max-alert-level (_type_ int) none) + (set-alert-duration (_type_ time-frame) none) + (get-alert-level (_type_) int) + (get-target (_type_) target) + (set-object-target-level (_type_ int float) none) + (set-object-target-count (_type_ int int) none) + (set-object-reserve-count (_type_ int uint) none) + (get-object-reserve-count (_type_ int) int) + (get-object-remaining-count (_type_ int) int) + (activate-object (_type_ traffic-object-spawn-params) none) + (activate-by-handle (_type_ traffic-object-spawn-params) none) + (set-parking-spot-prob (_type_ int float) none) + (get-random-parking-spot-type (_type_) traffic-type) + (new-suppression-box (_type_ traffic-suppression-params) none) + (remove-suppression-box (_type_ traffic-suppression-params) none) + (update-suppression-box (_type_ traffic-suppression-params) none) + (traffic-engine-method-49 (_type_ vector int traffic-target-status) traffic-target-status) + (find-closest-to-with-collide-lists (_type_ process-drawable collide-spec) process-focusable) + (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none) + (send-alert-events (_type_) none) + (end-pursuit-by-type (_type_ traffic-type) none) + (get-traffic-guard-type-settings (_type_ int) traffic-guard-type-settings) + (get-guard-type-for-traffic-obj (_type_ int) uint) + (get-traffic-guard-change-to-type (_type_ int) uint) + (set-guard-target-count-range (_type_ int int int) none) + (set-object-auto-activate (_type_ int object) none) + (debug-check-proc-in-tracker (_type_ process int) none) + (kill-traffic-sphere (_type_ sphere) none) + (level-link (_type_ level) none) + (level-unlink (_type_ level) none) + (traffic-engine-method-63 (_type_) none) + (traffic-engine-method-64 (_type_) none) + (handle-new-vis-cell (_type_ vis-cell) none) + (update-sync-from-frame-counter (_type_) none) + (update-guards (_type_) none) + (update-traffic-amount (_type_) none) + (update-danger (_type_) none) + (update-danger-from-target (_type_) none) + (update-alert-state (_type_) none) + (update-suppressor (_type_) none) + (recompute-supressions (_type_) none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/traffic-engine.gc b/goal_src/jak2/levels/city/traffic/traffic-engine.gc index bd537ac7e91..66a0149ee43 100644 --- a/goal_src/jak2/levels/city/traffic/traffic-engine.gc +++ b/goal_src/jak2/levels/city/traffic/traffic-engine.gc @@ -37,7 +37,7 @@ (none) ) -(defmethod debug-draw vis-cell ((this vis-cell)) +(defmethod debug-draw ((this vis-cell)) (dotimes (s5-0 (-> this segment-count)) (let ((s4-0 (-> this segment-array s5-0))) (add-debug-line @@ -56,14 +56,14 @@ (none) ) -(defmethod reset-segment-counts vis-cell ((this vis-cell)) +(defmethod reset-segment-counts ((this vis-cell)) (set! (-> this incoming-segment-count) 0) (set! (-> this segment-count) 0) 0 (none) ) -(defmethod setup-grid-from-bounding-box grid-info ((this grid-info) (arg0 (pointer bounding-box)) (arg1 int) (arg2 int)) +(defmethod setup-grid-from-bounding-box ((this grid-info) (arg0 (pointer bounding-box)) (arg1 int) (arg2 int)) "Set up a grid which fills the given bounding box" (mem-copy! (the-as pointer (-> this box)) arg0 32) (let ((v1-0 (new 'stack-no-clear 'vector))) @@ -103,31 +103,31 @@ (none) ) -(defmethod lookup-cell-for-point grid-info ((this grid-info) (arg0 vis-grid-pos) (arg1 vector)) +(defmethod lookup-cell-for-point ((this grid-info) (arg0 vis-grid-pos) (arg1 vector)) "Get the grid cell containing the point (or closest, if outside the grid)" - (set! (-> arg0 x) - (max - 0 - (min (the int (* (- (-> arg1 x) (-> this box min x)) (-> this axis-scale 0))) (+ (-> this dimension-array 0) -1)) - ) + (set! (-> arg0 x) (max 0 (min + (the int (* (- (-> arg1 x) (-> this box min x)) (-> this axis-scale 0))) + (+ (-> this dimension-array 0) -1) + ) + ) ) - (set! (-> arg0 y) - (max - 0 - (min (the int (* (- (-> arg1 y) (-> this box min y)) (-> this axis-scale 1))) (+ (-> this dimension-array 1) -1)) - ) + (set! (-> arg0 y) (max 0 (min + (the int (* (- (-> arg1 y) (-> this box min y)) (-> this axis-scale 1))) + (+ (-> this dimension-array 1) -1) + ) + ) ) - (set! (-> arg0 z) - (max - 0 - (min (the int (* (- (-> arg1 z) (-> this box min z)) (-> this axis-scale 2))) (+ (-> this dimension-array 2) -1)) - ) + (set! (-> arg0 z) (max 0 (min + (the int (* (- (-> arg1 z) (-> this box min z)) (-> this axis-scale 2))) + (+ (-> this dimension-array 2) -1) + ) + ) ) 0 (none) ) -(defmethod lookup-box-for-sphere grid-info ((this grid-info) (arg0 vis-grid-box) (arg1 vector)) +(defmethod lookup-box-for-sphere ((this grid-info) (arg0 vis-grid-box) (arg1 vector)) "Get the box of cells containing the given sphere" (rlet ((vf0 :class vf) (vf4 :class vf) @@ -166,7 +166,7 @@ ) ) -(defmethod debug-draw-cell grid-info ((this grid-info) (arg0 vis-grid-pos) (arg1 rgba)) +(defmethod debug-draw-cell ((this grid-info) (arg0 vis-grid-pos) (arg1 rgba)) (let ((v1-0 (new 'stack-no-clear 'bounding-box))) (dotimes (a3-0 3) (set! (-> v1-0 min data a3-0) @@ -180,13 +180,13 @@ (none) ) -(defmethod debug-draw-grid grid-info ((this grid-info) (arg0 rgba)) +(defmethod debug-draw-grid ((this grid-info) (arg0 rgba)) (draw-grid (the-as vector (-> this box)) (-> this box max) (-> this dimension-array) arg0) 0 (none) ) -(defmethod try-creating-new-suppression-box traffic-suppression-params ((this traffic-suppression-params)) +(defmethod try-creating-new-suppression-box ((this traffic-suppression-params)) "Try getting new suppression box, return if it succeeded. ID is stored in the params." (cond ((= (-> this id) -1) @@ -199,7 +199,7 @@ ) ) -(defmethod create-or-update-suppression-box traffic-suppression-params ((this traffic-suppression-params)) +(defmethod create-or-update-suppression-box ((this traffic-suppression-params)) "If the params are already associated with a box, update. Otherwise, attempt to create a new one." (cond ((= (-> this id) -1) @@ -213,7 +213,7 @@ ) ) -(defmethod kill-suppression-box traffic-suppression-params ((this traffic-suppression-params)) +(defmethod kill-suppression-box ((this traffic-suppression-params)) "Kill a suppression box, and inform the traffic manager by setting duration to 0." (when (!= (-> this id) -1) (let ((s5-0 (-> this duration))) @@ -226,7 +226,7 @@ (none) ) -(defmethod reset-boxes traffic-suppressor ((this traffic-suppressor)) +(defmethod reset-boxes ((this traffic-suppressor)) "Clears some flags, mark all boxes as disabled." (logclear! (-> this flags) (traffic-suppression-flags tfs0 needs-update)) (dotimes (v1-2 16) @@ -238,7 +238,7 @@ (none) ) -(defmethod add-new-supression-box traffic-suppressor ((this traffic-suppressor) (arg0 traffic-suppression-params)) +(defmethod add-new-supression-box ((this traffic-suppressor) (arg0 traffic-suppression-params)) "Create a suppression box for these params. The param object is updated with the ID of the box and can be later used with update-box-from-params." (set! (-> arg0 id) -1) @@ -262,7 +262,7 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod remove-box-by-id traffic-suppressor ((this traffic-suppressor) (arg0 int)) +(defmethod remove-box-by-id ((this traffic-suppressor) (arg0 int)) "Remove a box that was previously added, by its ID." (when (!= arg0 -1) (logior! (-> this flags) (traffic-suppression-flags needs-update)) @@ -274,7 +274,7 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod update-box-from-params traffic-suppressor ((this traffic-suppressor) (arg0 traffic-suppression-params)) +(defmethod update-box-from-params ((this traffic-suppressor) (arg0 traffic-suppression-params)) "Update a box that was previously added" (let ((v1-0 (-> arg0 id))) (when (!= v1-0 -1) @@ -292,7 +292,7 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod debug-draw traffic-suppressor ((this traffic-suppressor)) +(defmethod debug-draw ((this traffic-suppressor)) (let ((s5-0 (new 'stack-no-clear 'bounding-box))) (new 'stack-no-clear 'vector4w) (let ((s4-0 *color-red*)) @@ -313,7 +313,7 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod for-all-active-processes traffic-tracker ((this traffic-tracker) (arg0 (function process-focusable traffic-object-type-info none))) +(defmethod for-all-active-processes ((this traffic-tracker) (arg0 (function process-focusable traffic-object-type-info none))) "Call the given function on all active processes." (let ((s4-0 (-> this traffic))) (countdown (s3-0 (-> this active-object-count)) @@ -330,7 +330,7 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod for-all-active-processes-of-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 (function process-focusable traffic-object-type-info none))) +(defmethod for-all-active-processes-of-type ((this traffic-tracker) (arg0 traffic-type) (arg1 (function process-focusable traffic-object-type-info none))) "Call the given function on all active processes matching the given type." (let ((s3-0 (-> this traffic))) (countdown (s2-0 (-> this active-object-count)) @@ -351,7 +351,7 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod add-active-process traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) +(defmethod add-active-process ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) "Add a process as active." (let ((v1-0 (-> this active-object-count))) (when (< v1-0 (the-as uint 126)) @@ -367,7 +367,7 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod remove-active-process traffic-tracker ((this traffic-tracker) (arg0 int)) +(defmethod remove-active-process ((this traffic-tracker) (arg0 int)) "Remove a process from the tracking list." (let ((v0-0 (-> this active-object-list arg0))) (let ((v1-3 (-> this active-object-type-list arg0)) @@ -386,7 +386,7 @@ The param object is updated with the ID of the box and can be later used with up ) ) -(defmethod add-reserved-process traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) +(defmethod add-reserved-process ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) "Add a process to the reserve list for a type. This process is allocated, but not yet activated." (let* ((v1-2 (-> this traffic object-type-info-array arg0)) (a1-2 (-> v1-2 inactive-count)) @@ -402,7 +402,7 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod get-from-inactive-by-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type)) +(defmethod get-from-inactive-by-type ((this traffic-tracker) (arg0 traffic-type)) "Get any handle from the inactive list of this type, and remove it from the list." (let ((v1-2 (-> this traffic object-type-info-array arg0)) (a1-2 0) @@ -421,7 +421,7 @@ The param object is updated with the ID of the box and can be later used with up ) ) -(defmethod get-from-inactive-by-handle traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) +(defmethod get-from-inactive-by-handle ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) "Remove the given handle from the inactive list of the given type." (let ((v1-2 (-> this traffic object-type-info-array arg0)) (v0-0 (the-as handle #f)) @@ -443,7 +443,7 @@ The param object is updated with the ID of the box and can be later used with up ) ) -(defmethod deactivate-object traffic-tracker ((this traffic-tracker) (arg0 int) (arg1 symbol)) +(defmethod deactivate-object ((this traffic-tracker) (arg0 int) (arg1 symbol)) "Send a traffic-off event (or traffic-off-force) to deactivate an object, specified by index in active object array. Process is recycled and moved to reserved, if it deactivates." (with-pp @@ -486,7 +486,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod set-process-to-killed traffic-tracker ((this traffic-tracker) (arg0 process)) +(defmethod set-process-to-killed ((this traffic-tracker) (arg0 process)) "Move from active to killed. Separate from reserve." (let ((v1-0 -1)) (let ((a0-1 (process->ppointer arg0))) @@ -528,7 +528,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod deactivate-all-of-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 symbol)) +(defmethod deactivate-all-of-type ((this traffic-tracker) (arg0 traffic-type) (arg1 symbol)) "Deactivate all processes of given type" (countdown (s3-0 (-> this active-object-count)) (if (= (-> this active-object-type-list s3-0) arg0) @@ -539,7 +539,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod deactivate-all traffic-tracker ((this traffic-tracker) (arg0 symbol)) +(defmethod deactivate-all ((this traffic-tracker) (arg0 symbol)) "Deactivate all processes that are tracked" (countdown (s4-0 (-> this active-object-count)) (deactivate-object this (the-as int s4-0) arg0) @@ -548,7 +548,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod activate-from-params traffic-tracker ((this traffic-tracker) (arg0 traffic-object-spawn-params)) +(defmethod activate-from-params ((this traffic-tracker) (arg0 traffic-object-spawn-params)) "Get a reserved process, and activate with the given params." (local-vars (sv-16 handle)) (let ((gp-0 (-> arg0 object-type))) @@ -578,7 +578,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod activate-by-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 nav-segment) (arg2 float)) +(defmethod activate-by-type ((this traffic-tracker) (arg0 traffic-type) (arg1 nav-segment) (arg2 float)) "If possible, activate a process of the given type." (let ((v1-2 (-> this traffic object-type-info-array arg0))) (when (and (> (-> v1-2 inactive-count) 0) @@ -611,8 +611,9 @@ Process is recycled and moved to reserved, if it deactivates." (+! (-> s4-0 params position z) (* (-> s4-0 vector 0 x) f0-6)) ) ) - (set! (-> s4-0 vector 2 y) - (+ (* 0.5 (-> s4-0 vector 2 x)) (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing))) + (set! (-> s4-0 vector 2 y) (+ (* 0.5 (-> s4-0 vector 2 x)) + (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing)) + ) ) (vector-float*! (-> s4-0 params velocity) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 x)) (vector-float*! (-> s4-0 vector 1) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 y)) @@ -638,7 +639,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod activate-by-handle traffic-tracker ((this traffic-tracker) (arg0 traffic-object-spawn-params)) +(defmethod activate-by-handle ((this traffic-tracker) (arg0 traffic-object-spawn-params)) "Activate, using the handle in the params." (local-vars (sv-16 handle)) (let ((gp-0 (-> arg0 object-type))) @@ -666,7 +667,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod reset traffic-level-data ((this traffic-level-data)) +(defmethod reset ((this traffic-level-data)) (set! (-> this city-info) (the-as city-level-info 0)) (set! (-> this active-cell-count) (the-as uint 0)) (set! (-> this newly-active-cell-count) (the-as uint 0)) @@ -674,7 +675,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod reset traffic-tracker ((this traffic-tracker) (arg0 uint) (arg1 traffic-engine)) +(defmethod reset ((this traffic-tracker) (arg0 uint) (arg1 traffic-engine)) (set! (-> this traffic) arg1) (set! (-> this object-hash) (-> arg1 object-hash)) (set! (-> this rand) 0.5) @@ -685,7 +686,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod reset traffic-alert-state ((this traffic-alert-state)) +(defmethod reset ((this traffic-alert-state)) (set! (-> this flags) (traffic-alert-flag)) (set! (-> this level) (the-as uint 0)) (set! (-> this duration) (the-as uint 9000)) @@ -717,7 +718,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod reset-and-init-from-manager traffic-engine ((this traffic-engine) (arg0 process)) +(defmethod reset-and-init-from-manager ((this traffic-engine) (arg0 process)) "Reset the traffic engine" (set! (-> this manager) (process->handle arg0)) (set! (-> this flags) (the-as uint 0)) @@ -791,13 +792,13 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod stop-alarm-sound traffic-engine ((this traffic-engine)) +(defmethod stop-alarm-sound ((this traffic-engine)) (sound-stop (-> this alert-state alarm-sound-id)) 0 (none) ) -(defmethod level-link traffic-engine ((this traffic-engine) (arg0 level)) +(defmethod level-link ((this traffic-engine) (arg0 level)) "Call after loading a level to patch the data in the bsp" (format #t "traffic-engine: level birth ~S~%" (-> arg0 nickname)) (cond @@ -929,7 +930,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod level-unlink traffic-engine ((this traffic-engine) (arg0 level)) +(defmethod level-unlink ((this traffic-engine) (arg0 level)) "Call after removing a level. Kills processes and unlinks nav" (let ((s4-0 (-> arg0 bsp city-level-info nav-graph))) (dotimes (v1-2 2) @@ -979,7 +980,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod for-all-active-processes traffic-engine ((this traffic-engine) (arg0 (function process-focusable traffic-object-type-info none))) +(defmethod for-all-active-processes ((this traffic-engine) (arg0 (function process-focusable traffic-object-type-info none))) (dotimes (s4-0 2) (for-all-active-processes (-> this tracker-array s4-0) arg0) ) @@ -987,7 +988,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod add-object traffic-engine ((this traffic-engine) (arg0 traffic-type) (arg1 process)) +(defmethod add-object ((this traffic-engine) (arg0 traffic-type) (arg1 process)) (add-reserved-process (-> this tracker-array (-> this object-type-info-array arg0 tracker-index)) arg0 @@ -997,7 +998,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod child-killed traffic-engine ((this traffic-engine) (arg0 process)) +(defmethod child-killed ((this traffic-engine) (arg0 process)) "handle killing a child process" (cond ((type? arg0 citizen) @@ -1014,7 +1015,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod activate-one-citizen traffic-engine ((this traffic-engine) (arg0 nav-segment) (arg1 float)) +(defmethod activate-one-citizen ((this traffic-engine) (arg0 nav-segment) (arg1 float)) (let ((a1-1 (+ (rand-vu-int-count 10) 11))) (activate-by-type (-> this citizen-tracker-array) (the-as traffic-type a1-1) arg0 arg1) ) @@ -1022,7 +1023,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod activate-one-vehicle traffic-engine ((this traffic-engine) (arg0 nav-segment) (arg1 float)) +(defmethod activate-one-vehicle ((this traffic-engine) (arg0 nav-segment) (arg1 float)) (let ((a1-1 0)) (dotimes (v1-0 11) (if (zero? (-> this object-type-info-array v1-0 inactive-count)) @@ -1037,7 +1038,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod handle-new-vis-cell traffic-engine ((this traffic-engine) (arg0 vis-cell)) +(defmethod handle-new-vis-cell ((this traffic-engine) (arg0 vis-cell)) (dotimes (s4-0 (-> arg0 segment-count)) (let* ((s3-0 (-> arg0 segment-array s4-0)) (s1-0 (-> s3-0 tracker-id)) @@ -1045,8 +1046,8 @@ Process is recycled and moved to reserved, if it deactivates." (when (and (logtest? (logxor (-> arg0 flags) (the-as uint (-> arg0 prev-flags))) (ash 1 s1-0)) (and (not (logtest? (-> arg0 flags) (vis-cell-flag suppress))) (not (or (can-dest-be-used? this (-> s3-0 branch)) (let ((a0-7 (-> s3-0 branch))) - (>= (-> a0-7 user-count) (-> a0-7 max-user-count)) - ) + (>= (-> a0-7 user-count) (-> a0-7 max-user-count)) + ) ) ) ) @@ -1083,7 +1084,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod debug-draw traffic-level-data ((this traffic-level-data)) +(defmethod debug-draw ((this traffic-level-data)) (local-vars (sv-16 nav-node) (sv-20 nav-branch) (sv-80 nav-node) (sv-84 vector) (sv-88 vector) (sv-92 vector)) (when (and (nonzero? (-> this city-info)) (nonzero? (-> this city-info nav-graph))) (let ((s5-0 (-> this city-info nav-graph))) @@ -1155,7 +1156,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod debug-unused traffic-engine ((this traffic-engine)) +(defmethod debug-unused ((this traffic-engine)) (dotimes (v1-0 (-> *level* length)) (let ((a0-4 (-> *level* level v1-0))) (when (= (-> a0-4 status) 'active) @@ -1170,7 +1171,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod sphere-in-loaded-city-infos? traffic-engine ((this traffic-engine) (arg0 vector) (arg1 int)) +(defmethod sphere-in-loaded-city-infos? ((this traffic-engine) (arg0 vector) (arg1 int)) (dotimes (s3-0 2) (let ((v1-3 (-> this level-data-array s3-0))) (when (nonzero? (-> v1-3 city-info)) @@ -1183,7 +1184,7 @@ Process is recycled and moved to reserved, if it deactivates." #f ) -(defmethod can-dest-be-used? traffic-engine ((this traffic-engine) (arg0 nav-branch)) +(defmethod can-dest-be-used? ((this traffic-engine) (arg0 nav-branch)) (let ((v1-0 (-> arg0 src-node))) (or (logtest? (-> arg0 flags) (nav-branch-flags nabflags-0)) (logtest? (-> v1-0 flags) (nav-node-flag-byte blocked)) @@ -1193,7 +1194,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod update-sync-from-frame-counter traffic-engine ((this traffic-engine)) +(defmethod update-sync-from-frame-counter ((this traffic-engine)) (+! (-> this sync-clock) 1) (set! (-> this sync-mask-8) (the-as uint (ash 1 (logand (-> this sync-clock) 7)))) (set! (-> this sync-mask-16) (the-as uint (ash 1 (logand (-> this sync-clock) 15)))) @@ -1202,74 +1203,74 @@ Process is recycled and moved to reserved, if it deactivates." (set! (-> this sync-array 0) (the-as uint 255)) (let ((a1-12 (mod v1-10 20))) (set! (-> this sync-array 1) (the-as uint (cond - ((>= 6 a1-12) - 1 - ) - ((>= 9 a1-12) - 2 - ) - ((>= 16 a1-12) - 4 - ) - (else - 8 + ((>= 6 a1-12) + 1 ) - ) - ) + ((>= 9 a1-12) + 2 + ) + ((>= 16 a1-12) + 4 + ) + (else + 8 + ) + ) + ) ) ) (let ((a1-15 (mod v1-10 30))) (set! (-> this sync-array 2) (the-as uint (cond - ((>= 6 a1-15) - 1 - ) - ((>= 9 a1-15) - 2 - ) - ((>= 16 a1-15) - 4 - ) - ((>= 19 a1-15) - 8 - ) - ((>= 26 a1-15) - 16 - ) - (else - 32 + ((>= 6 a1-15) + 1 ) - ) - ) + ((>= 9 a1-15) + 2 + ) + ((>= 16 a1-15) + 4 + ) + ((>= 19 a1-15) + 8 + ) + ((>= 26 a1-15) + 16 + ) + (else + 32 + ) + ) + ) ) ) (let ((v1-11 (mod v1-10 40))) (set! (-> this sync-array 3) (the-as uint (cond - ((>= 6 v1-11) - 1 - ) - ((>= 9 v1-11) - 2 - ) - ((>= 16 v1-11) - 4 - ) - ((>= 19 v1-11) - 8 - ) - ((>= 26 v1-11) - 16 - ) - ((>= 29 v1-11) - 32 - ) - ((>= 36 v1-11) - 64 - ) - (else - 128 + ((>= 6 v1-11) + 1 ) - ) - ) + ((>= 9 v1-11) + 2 + ) + ((>= 16 v1-11) + 4 + ) + ((>= 19 v1-11) + 8 + ) + ((>= 26 v1-11) + 16 + ) + ((>= 29 v1-11) + 32 + ) + ((>= 36 v1-11) + 64 + ) + (else + 128 + ) + ) + ) ) ) ) @@ -1277,7 +1278,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod update-danger-from-target traffic-engine ((this traffic-engine)) +(defmethod update-danger-from-target ((this traffic-engine)) "make people run away from jak when he is dangerous." (local-vars (v1-20 float) (v1-32 float)) (rlet ((acc :class vf) @@ -1452,7 +1453,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod update-danger traffic-engine ((this traffic-engine)) +(defmethod update-danger ((this traffic-engine)) "see what's dangerous and make people avoid it." (update-danger-from-target this) (dotimes (s5-0 (-> this danger-sphere-count)) @@ -1493,7 +1494,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod add-danger traffic-engine ((this traffic-engine) (arg0 traffic-danger-info)) +(defmethod add-danger ((this traffic-engine) (arg0 traffic-danger-info)) "Add a danger sphere and suppression box." (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1540,7 +1541,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod kill-traffic-sphere traffic-engine ((this traffic-engine) (arg0 sphere)) +(defmethod kill-traffic-sphere ((this traffic-engine) (arg0 sphere)) "Kill everything in the sphere with a traffic-off-force." (let ((gp-0 (new 'stack-no-clear 'array 'collide-shape 64))) (countdown (s5-0 (fill-actor-list-for-sphere *actor-hash* arg0 gp-0 64)) @@ -1560,7 +1561,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod update-traffic-amount traffic-engine ((this traffic-engine)) +(defmethod update-traffic-amount ((this traffic-engine)) "kills inactive traffic and spawns more if needed." (local-vars (sv-48 int) (sv-64 nav-segment)) (set! (-> this object-hash object-count) 0) @@ -1724,7 +1725,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod update-traffic traffic-engine ((this traffic-engine)) +(defmethod update-traffic ((this traffic-engine)) (update-sync-from-frame-counter this) (update-suppressor this) (let ((s5-0 (new 'stack-no-clear 'bounding-box))) @@ -1762,12 +1763,12 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod callback-on-nav-segments-in-sphere traffic-engine ((this traffic-engine) - (arg0 vector) - (arg1 int) - (arg2 traffic-find-segment-struct) - (arg3 (function traffic-find-segment-struct nav-segment none)) - ) +(defmethod callback-on-nav-segments-in-sphere ((this traffic-engine) + (arg0 vector) + (arg1 int) + (arg2 traffic-find-segment-struct) + (arg3 (function traffic-find-segment-struct nav-segment none)) + ) (dotimes (s1-0 2) (let ((v1-3 (-> this level-data-array s1-0))) (if (nonzero? (-> v1-3 city-info)) @@ -1780,17 +1781,14 @@ Process is recycled and moved to reserved, if it deactivates." ) (deftype traffic-find-segment-struct (structure) - ((best-seg nav-segment :offset-assert 0) - (best-rating float :offset-assert 4) - (dir vector :inline :offset-assert 16) + ((best-seg nav-segment) + (best-rating float) + (dir vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) -(defmethod find-best-segment traffic-engine ((this traffic-engine) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod find-best-segment ((this traffic-engine) (arg0 vector) (arg1 vector) (arg2 int)) (let ((gp-0 (new 'stack-no-clear 'traffic-find-segment-struct))) (set! (-> gp-0 dir quad) (-> arg1 quad)) (set! (-> gp-0 best-rating) -10000000000000000000000000000000000000.0) @@ -1823,20 +1821,20 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod maybe-increase-guard-aim-count traffic-engine ((this traffic-engine)) +(defmethod maybe-increase-guard-aim-count ((this traffic-engine)) (when (< (-> this alert-state guard-aim-count) 2) (+! (-> this alert-state guard-aim-count) 1) #t ) ) -(defmethod increase-alert-level traffic-engine ((this traffic-engine) (arg0 int) (arg1 target)) +(defmethod increase-alert-level ((this traffic-engine) (arg0 int) (arg1 target)) (when (and (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) (logtest? (-> arg1 mask) (process-mask target)) ) (let ((v1-6 (min arg0 (the-as int (-> this alert-state max-level))))) (when #t - (set! (-> this alert-state start-time) (current-time)) + (set-time! (-> this alert-state start-time)) (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) ) (set! (-> this alert-state level) (the-as uint (max (the-as int (-> this alert-state level)) v1-6))) @@ -1846,7 +1844,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod decrease-alert-level traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod decrease-alert-level ((this traffic-engine) (arg0 int)) (if (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) (set! (-> this alert-state level) (the-as uint (min (the-as int (-> this alert-state level)) arg0))) ) @@ -1854,15 +1852,15 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod set-alert-level traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod set-alert-level ((this traffic-engine) (arg0 int)) (set! (-> this alert-state level) (the-as uint arg0)) - (set! (-> this alert-state start-time) (current-time)) + (set-time! (-> this alert-state start-time)) (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) 0 (none) ) -(defmethod set-max-alert-level traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod set-max-alert-level ((this traffic-engine) (arg0 int)) (set! (-> this alert-state max-level) (the-as uint arg0)) (set! (-> this alert-state level) (the-as uint (min (the-as int (-> this alert-state level)) arg0))) 0 @@ -1870,11 +1868,11 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; WARN: Return type mismatch uint vs int. -(defmethod get-alert-level traffic-engine ((this traffic-engine)) +(defmethod get-alert-level ((this traffic-engine)) (the-as int (-> this alert-state level)) ) -(defmethod get-target traffic-engine ((this traffic-engine)) +(defmethod get-target ((this traffic-engine)) "@returns [[*target*]]" *target* ) @@ -2027,7 +2025,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod find-closest-to-with-collide-lists traffic-engine ((this traffic-engine) (arg0 process-drawable) (arg1 collide-spec)) +(defmethod find-closest-to-with-collide-lists ((this traffic-engine) (arg0 process-drawable) (arg1 collide-spec)) "Iterate through collide lists, find the closest thing to the given process." (let ((gp-0 (the-as process-focusable #f))) (let ((f30-0 (the-as float #x7f800000))) @@ -2131,7 +2129,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod traffic-engine-method-49 traffic-engine ((this traffic-engine) (los vector) (arg2 int) (target-status traffic-target-status)) +(defmethod traffic-engine-method-49 ((this traffic-engine) (los vector) (arg2 int) (target-status traffic-target-status)) (local-vars ;; og:preserve-this stack array -> pointer (guards (pointer crimson-guard)) @@ -2157,12 +2155,12 @@ Process is recycled and moved to reserved, if it deactivates." (cond ((or (logtest? (-> s1-1 0 flags) (traffic-target-flag force-visible)) (traffic-los-clear? los target-pos)) (logior! (-> s1-1 0 flags) (traffic-target-flag visible-now visible-recently visible-ever)) - (set! (-> s1-1 0 last-seen-time) (current-time)) + (set-time! (-> s1-1 0 last-seen-time)) (set! (-> s1-1 0 position quad) (-> target-pos quad)) (set! (-> s1-1 0 velocity quad) (-> (get-transv (the-as process-focusable target-proc)) quad)) ) (else - (if (>= (- (current-time) (-> s1-1 0 last-seen-time)) (seconds 2)) + (if (time-elapsed? (-> s1-1 0 last-seen-time) (seconds 2)) (logclear! (-> s1-1 0 flags) (traffic-target-flag visible-recently)) ) ) @@ -2173,7 +2171,7 @@ Process is recycled and moved to reserved, if it deactivates." ) (else (logior! (-> target-status flags) (traffic-target-flag visible-now visible-recently visible-ever)) - (set! (-> target-status last-seen-time) (current-time)) + (set-time! (-> target-status last-seen-time)) (set! (-> target-status position quad) (-> target-pos quad)) (set! (-> target-status velocity quad) (-> (get-transv (the-as process-focusable target-proc)) quad)) ) @@ -2279,13 +2277,13 @@ Process is recycled and moved to reserved, if it deactivates." target-status ) -(defmethod set-alert-duration traffic-engine ((this traffic-engine) (arg0 time-frame)) +(defmethod set-alert-duration ((this traffic-engine) (arg0 time-frame)) (set! (-> this alert-state duration) (the-as uint arg0)) 0 (none) ) -(defmethod guard-count traffic-engine ((this traffic-engine)) +(defmethod guard-count ((this traffic-engine)) (let ((v0-0 0)) (dotimes (v1-0 6) (+! v0-0 (-> this alert-state guard-type-info-array v1-0 count)) @@ -2294,7 +2292,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod end-pursuit-by-type traffic-engine ((this traffic-engine) (arg0 traffic-type)) +(defmethod end-pursuit-by-type ((this traffic-engine) (arg0 traffic-type)) (for-all-active-processes-of-type (-> this tracker-array (-> this object-type-info-array arg0 tracker-index)) arg0 @@ -2307,7 +2305,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod set-target-level traffic-engine ((this traffic-engine) (arg0 float)) +(defmethod set-target-level ((this traffic-engine) (arg0 float)) (set! (-> this alert-state guard-target-level) arg0) (dotimes (v1-0 21) (let ((a2-2 (-> this object-type-info-array v1-0))) @@ -2318,7 +2316,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod set-guard-target-level traffic-engine ((this traffic-engine) (arg0 float)) +(defmethod set-guard-target-level ((this traffic-engine) (arg0 float)) (set! (-> this alert-state guard-target-level) arg0) 0 (none) @@ -2578,22 +2576,22 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod get-traffic-guard-type-settings traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod get-traffic-guard-type-settings ((this traffic-engine) (arg0 int)) "TODO - guard-type should be an enum" (-> this alert-state settings guard-settings-array arg0) ) -(defmethod get-guard-type-for-traffic-obj traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod get-guard-type-for-traffic-obj ((this traffic-engine) (arg0 int)) "TODO - guard-type should be an enum" (-> this object-type-info-array arg0 guard-type) ) -(defmethod get-traffic-guard-change-to-type traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod get-traffic-guard-change-to-type ((this traffic-engine) (arg0 int)) "TODO - guard-type should be an enum" (-> this alert-state guard-type-info-array arg0 change-to-type) ) -(defmethod update-guards traffic-engine ((this traffic-engine)) +(defmethod update-guards ((this traffic-engine)) (dotimes (v1-0 6) (set! (-> this alert-state guard-type-info-array v1-0 count) 0) ) @@ -2724,7 +2722,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod update-alert-state traffic-engine ((this traffic-engine)) +(defmethod update-alert-state ((this traffic-engine)) (if (and (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) *target*) (set! (-> this alert-state target-status-array 0 handle) (process->handle *target*)) ) @@ -2792,7 +2790,7 @@ Process is recycled and moved to reserved, if it deactivates." (when *traffic-alert-level-force* (set! (-> this alert-state level) (the-as uint 3)) (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) - (set! (-> this alert-state start-time) (current-time)) + (set-time! (-> this alert-state start-time)) ) (when (>= (-> this alert-state level) (the-as uint 1)) (set! s5-0 #t) @@ -2800,10 +2798,10 @@ Process is recycled and moved to reserved, if it deactivates." ((logtest? (-> this alert-state flags) (traffic-alert-flag alert-ending)) (cond ((> (guard-count this) 0) - (set! (-> this alert-state start-time) (current-time)) + (set-time! (-> this alert-state start-time)) ) (else - (when (>= (- (current-time) (-> this alert-state start-time)) (seconds 3)) + (when (time-elapsed? (-> this alert-state start-time) (seconds 3)) (set! s5-0 #f) (set! (-> this alert-state level) (the-as uint 0)) (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) @@ -2888,8 +2886,8 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod send-alert-events traffic-engine ((this traffic-engine)) - (set! (-> this alert-state notify-time) (current-time)) +(defmethod send-alert-events ((this traffic-engine)) + (set-time! (-> this alert-state notify-time)) (cond ((> (-> this alert-state level) 0) (if (and (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) @@ -2897,21 +2895,21 @@ Process is recycled and moved to reserved, if it deactivates." *target* ) (for-all-active-processes this (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) - (if (logtest? (-> arg1 flags) (traffic-type-flags trtflags-0)) - (send-event arg0 'alert-begin *target*) - ) - (none) - ) + (if (logtest? (-> arg1 flags) (traffic-type-flags trtflags-0)) + (send-event arg0 'alert-begin *target*) + ) + (none) + ) ) ) ) (else (for-all-active-processes this (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) - (if (logtest? (-> arg1 flags) (traffic-type-flags trtflags-0)) - (send-event arg0 'alert-end) - ) - (none) - ) + (if (logtest? (-> arg1 flags) (traffic-type-flags trtflags-0)) + (send-event arg0 'alert-end) + ) + (none) + ) ) ) ) @@ -2919,7 +2917,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod restore-default-settings traffic-engine ((this traffic-engine)) +(defmethod restore-default-settings ((this traffic-engine)) (restore-city-speeches) (logclear! (-> this alert-state flags) @@ -2994,14 +2992,14 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod deactivate-all traffic-engine ((this traffic-engine)) +(defmethod deactivate-all ((this traffic-engine)) (deactivate-all (-> this citizen-tracker-array) #t) (deactivate-all (-> this vehicle-tracker-array) #t) 0 (none) ) -(defmethod deactivate-by-type traffic-engine ((this traffic-engine) (arg0 traffic-type)) +(defmethod deactivate-by-type ((this traffic-engine) (arg0 traffic-type)) (let ((a2-0 (-> this object-type-info-array arg0))) (deactivate-all-of-type (-> this tracker-array (-> a2-0 tracker-index)) arg0 #t) ) @@ -3009,7 +3007,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod deactivate-all-from-level traffic-engine ((this traffic-engine) (arg0 symbol)) +(defmethod deactivate-all-from-level ((this traffic-engine) (arg0 symbol)) (local-vars (v1-6 nav-branch)) (countdown (s4-0 (-> this citizen-tracker-array active-object-count)) (let ((v1-3 (handle->process (-> this citizen-tracker-array active-object-list s4-0)))) @@ -3043,7 +3041,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod set-object-auto-activate traffic-engine ((this traffic-engine) (arg0 int) (arg1 object)) +(defmethod set-object-auto-activate ((this traffic-engine) (arg0 int) (arg1 object)) (let ((v1-2 (-> this object-type-info-array arg0))) (if arg1 (logior! (-> v1-2 flags) (traffic-type-flags trtflags-2)) @@ -3054,7 +3052,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod set-object-target-level traffic-engine ((this traffic-engine) (arg0 int) (arg1 float)) +(defmethod set-object-target-level ((this traffic-engine) (arg0 int) (arg1 float)) (let ((v1-2 (-> this object-type-info-array arg0))) (set! (-> v1-2 target-count) (the int (* arg1 (the float (max 0 (+ (-> v1-2 want-count) -1)))))) ) @@ -3062,13 +3060,13 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod set-object-target-count traffic-engine ((this traffic-engine) (arg0 int) (arg1 int)) +(defmethod set-object-target-count ((this traffic-engine) (arg0 int) (arg1 int)) (set! (-> this object-type-info-array arg0 target-count) arg1) 0 (none) ) -(defmethod set-guard-target-count-range traffic-engine ((this traffic-engine) (arg0 int) (arg1 int) (arg2 int)) +(defmethod set-guard-target-count-range ((this traffic-engine) (arg0 int) (arg1 int) (arg2 int)) (let ((v1-2 (-> this alert-state guard-type-info-array arg0))) (set! (-> v1-2 min-target-count) (max 0 (min 127 arg1))) (set! (-> v1-2 max-target-count) (max 0 (min 127 arg2))) @@ -3077,24 +3075,24 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod set-object-reserve-count traffic-engine ((this traffic-engine) (arg0 int) (arg1 uint)) +(defmethod set-object-reserve-count ((this traffic-engine) (arg0 int) (arg1 uint)) (set! (-> this object-type-info-array arg0 reserve-count) arg1) 0 (none) ) ;; WARN: Return type mismatch uint vs int. -(defmethod get-object-reserve-count traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod get-object-reserve-count ((this traffic-engine) (arg0 int)) (the-as int (-> this object-type-info-array arg0 reserve-count)) ) -(defmethod get-object-remaining-count traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod get-object-remaining-count ((this traffic-engine) (arg0 int)) (let ((a0-1 (-> this object-type-info-array arg0))) (+ (-> a0-1 active-count) (-> a0-1 reserve-count)) ) ) -(defmethod set-parking-spot-prob traffic-engine ((this traffic-engine) (arg0 int) (arg1 float)) +(defmethod set-parking-spot-prob ((this traffic-engine) (arg0 int) (arg1 float)) (let ((v1-2 (-> this object-type-info-array arg0))) (set! (-> v1-2 parking-spot-prob) (the-as uint (min 255 (the int (* 256.0 arg1))))) ) @@ -3103,7 +3101,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; WARN: Return type mismatch int vs traffic-type. -(defmethod get-random-parking-spot-type traffic-engine ((this traffic-engine)) +(defmethod get-random-parking-spot-type ((this traffic-engine)) (let ((s5-0 11)) (let ((s4-0 (the int (* 256.0 (rand-vu)))) (s3-0 0) @@ -3126,7 +3124,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod activate-object traffic-engine ((this traffic-engine) (arg0 traffic-object-spawn-params)) +(defmethod activate-object ((this traffic-engine) (arg0 traffic-object-spawn-params)) (let ((a2-0 (-> this object-type-info-array (-> arg0 object-type)))) (activate-from-params (-> this tracker-array (-> a2-0 tracker-index)) arg0) ) @@ -3134,7 +3132,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod activate-by-handle traffic-engine ((this traffic-engine) (arg0 traffic-object-spawn-params)) +(defmethod activate-by-handle ((this traffic-engine) (arg0 traffic-object-spawn-params)) (let ((a2-0 (-> this object-type-info-array (-> arg0 object-type)))) (activate-by-handle (-> this tracker-array (-> a2-0 tracker-index)) arg0) ) @@ -3142,22 +3140,22 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod new-suppression-box traffic-engine ((this traffic-engine) (arg0 traffic-suppression-params)) +(defmethod new-suppression-box ((this traffic-engine) (arg0 traffic-suppression-params)) (add-new-supression-box (-> this suppressor) arg0) (none) ) -(defmethod remove-suppression-box traffic-engine ((this traffic-engine) (arg0 traffic-suppression-params)) +(defmethod remove-suppression-box ((this traffic-engine) (arg0 traffic-suppression-params)) (remove-box-by-id (-> this suppressor) (the-as int arg0)) (none) ) -(defmethod update-suppression-box traffic-engine ((this traffic-engine) (arg0 traffic-suppression-params)) +(defmethod update-suppression-box ((this traffic-engine) (arg0 traffic-suppression-params)) (update-box-from-params (-> this suppressor) arg0) (none) ) -(defmethod update-suppressor traffic-engine ((this traffic-engine)) +(defmethod update-suppressor ((this traffic-engine)) (let ((v1-3 (- (-> *display* game-clock frame-counter) (-> *display* game-clock old-frame-counter)))) (dotimes (a1-3 16) (let ((a2-2 (-> this suppressor array a1-3))) @@ -3185,7 +3183,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod recompute-supressions traffic-engine ((this traffic-engine)) +(defmethod recompute-supressions ((this traffic-engine)) (dotimes (s5-0 2) (let ((v1-3 (-> this level-data-array s5-0))) (if (nonzero? (-> v1-3 city-info)) @@ -3204,7 +3202,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod get-first-cell-in-box city-level-info ((this city-level-info) (arg0 vis-grid-box)) +(defmethod get-first-cell-in-box ((this city-level-info) (arg0 vis-grid-box)) (-> this cell-array (+ (-> arg0 min x) @@ -3214,7 +3212,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod sphere-in-grid? city-level-info ((this city-level-info) (arg0 vector) (arg1 int)) +(defmethod sphere-in-grid? ((this city-level-info) (arg0 vector) (arg1 int)) (let ((gp-0 #f)) (let ((s3-0 (new 'stack-no-clear 'vis-grid-box)) (s2-0 (new 'stack-no-clear 'vis-grid-box)) @@ -3275,12 +3273,12 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod callback-on-nav-segments-in-sphere city-level-info ((this city-level-info) - (arg0 vector) - (arg1 int) - (arg2 traffic-find-segment-struct) - (arg3 (function traffic-find-segment-struct nav-segment none)) - ) +(defmethod callback-on-nav-segments-in-sphere ((this city-level-info) + (arg0 vector) + (arg1 int) + (arg2 traffic-find-segment-struct) + (arg3 (function traffic-find-segment-struct nav-segment none)) + ) (local-vars (sv-16 city-level-info) (sv-20 vector) @@ -3336,7 +3334,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod update-suppressions-from-traffic-engine city-level-info ((this city-level-info) (arg0 traffic-engine)) +(defmethod update-suppressions-from-traffic-engine ((this city-level-info) (arg0 traffic-engine)) (let ((v1-0 (-> this cell-count))) (dotimes (a0-1 (the-as int v1-0)) (let ((a1-2 (-> this cell-array a0-1))) @@ -3383,7 +3381,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod add-active-cell traffic-level-data ((this traffic-level-data) (arg0 vis-cell)) +(defmethod add-active-cell ((this traffic-level-data) (arg0 vis-cell)) (let ((v1-0 (-> this active-cell-count))) (when (< v1-0 (the-as uint 255)) (set! (-> this active-cell-list v1-0) arg0) @@ -3394,7 +3392,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod remove-active-cell traffic-level-data ((this traffic-level-data) (arg0 int)) +(defmethod remove-active-cell ((this traffic-level-data) (arg0 int)) (let ((v1-1 (+ (-> this active-cell-count) -1))) (when (>= v1-1 0) (set! (-> this active-cell-list arg0) (-> this active-cell-list v1-1)) @@ -3405,7 +3403,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod add-newly-active-cell traffic-level-data ((this traffic-level-data) (arg0 vis-cell)) +(defmethod add-newly-active-cell ((this traffic-level-data) (arg0 vis-cell)) (let ((v1-0 (-> this newly-active-cell-count))) (when (< v1-0 (the-as uint 255)) (set! (-> this newly-active-cell-list v1-0) arg0) @@ -3416,7 +3414,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod per-frame-cell-update traffic-level-data ((this traffic-level-data)) +(defmethod per-frame-cell-update ((this traffic-level-data)) (set! (-> this newly-active-cell-count) (the-as uint 0)) (dotimes (v1-0 (the-as int (-> this active-cell-count))) (let ((a0-3 (-> this active-cell-list v1-0))) @@ -3503,7 +3501,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod lookup-cell-by-position city-level-info ((this city-level-info) (arg0 vector)) +(defmethod lookup-cell-by-position ((this city-level-info) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'vis-grid-pos))) (lookup-cell-for-point (-> this grid-info) s5-0 arg0) (-> this @@ -3516,7 +3514,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod init-vis-ray city-level-info ((this city-level-info) (arg0 vis-ray) (arg1 vector) (arg2 vector)) +(defmethod init-vis-ray ((this city-level-info) (arg0 vis-ray) (arg1 vector) (arg2 vector)) (set! (-> arg0 pos quad) (-> arg1 quad)) (set! (-> arg0 dest-pos quad) (-> arg2 quad)) (let ((v1-2 (new 'stack-no-clear 'vector))) @@ -3534,7 +3532,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod city-level-info-method-11 city-level-info ((this city-level-info) (arg0 vis-ray)) +(defmethod city-level-info-method-11 ((this city-level-info) (arg0 vis-ray)) (local-vars (a3-3 int)) (let ((f0-0 (-> arg0 len)) (s4-0 -1) @@ -3601,7 +3599,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod city-level-info-method-12 city-level-info ((this city-level-info) (arg0 vector) (arg1 nav-branch) (arg2 vector)) +(defmethod city-level-info-method-12 ((this city-level-info) (arg0 vector) (arg1 nav-branch) (arg2 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -3719,7 +3717,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod city-level-info-method-18 city-level-info ((this city-level-info)) +(defmethod city-level-info-method-18 ((this city-level-info)) (local-vars (sv-48 int)) (let ((gp-0 (new 'stack-no-clear 'bounding-box)) (s5-0 (-> this nav-graph)) @@ -3763,7 +3761,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; WARN: Return type mismatch object vs symbol. -(defmethod city-level-info-method-9 city-level-info ((this city-level-info)) +(defmethod city-level-info-method-9 ((this city-level-info)) (local-vars (sv-96 (inline-array nav-node)) (sv-100 int) @@ -3973,7 +3971,7 @@ Process is recycled and moved to reserved, if it deactivates." (the-as symbol 0) ) -(defmethod debug-check-proc-in-tracker traffic-engine ((this traffic-engine) (arg0 process) (arg1 int)) +(defmethod debug-check-proc-in-tracker ((this traffic-engine) (arg0 process) (arg1 int)) (let ((v1-3 (-> this tracker-array arg1)) (a0-3 (process->handle arg0)) (a3-4 0) diff --git a/goal_src/jak2/levels/city/traffic/traffic-manager.gc b/goal_src/jak2/levels/city/traffic/traffic-manager.gc index 9e9b6363720..c0b0c00a856 100644 --- a/goal_src/jak2/levels/city/traffic/traffic-manager.gc +++ b/goal_src/jak2/levels/city/traffic/traffic-manager.gc @@ -12,24 +12,22 @@ (define *traffic-fast-spawn* #f) (deftype traffic-manager (process) - ((traffic-engine traffic-engine :offset-assert 128) - (fast-spawn symbol :offset-assert 132) - (dark-guard-ratio int32 :offset-assert 136) - (spawn-params traffic-object-spawn-params :inline :offset-assert 144) + ((traffic-engine traffic-engine) + (fast-spawn symbol) + (dark-guard-ratio int32) + (spawn-params traffic-object-spawn-params :inline) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf8 - :flag-assert #x16008000f8 + (:state-methods + idle + active + ) (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (update (_type_) none 16) - (spawn-all (_type_) none 17) - (kill-excess-once (_type_) none 18) - (kill-all-inactive (_type_) none 19) - (reset-and-init (_type_) none 20) - (init-params (_type_) none 21) + (update (_type_) none) + (spawn-all (_type_) none) + (kill-excess-once (_type_) none) + (kill-all-inactive (_type_) none) + (reset-and-init (_type_) none) + (init-params (_type_) none) ) ) @@ -54,7 +52,7 @@ (none) ) -(defmethod update traffic-manager ((this traffic-manager)) +(defmethod update ((this traffic-manager)) (update-traffic (-> this traffic-engine)) (kill-excess-once this) (spawn-all this) @@ -75,7 +73,7 @@ (none) ) -(defmethod kill-excess-once traffic-manager ((this traffic-manager)) +(defmethod kill-excess-once ((this traffic-manager)) (let ((type-i 0)) (while (< (the-as uint type-i) (the-as uint 21)) (let ((traffic (-> this traffic-engine object-type-info-array type-i))) @@ -104,7 +102,7 @@ (none) ) -(defmethod kill-all-inactive traffic-manager ((this traffic-manager)) +(defmethod kill-all-inactive ((this traffic-manager)) (let ((s5-0 0)) (while (< (the-as uint s5-0) (the-as uint 21)) (let ((s4-0 (-> this traffic-engine object-type-info-array s5-0))) @@ -129,9 +127,9 @@ (none) ) -(defmethod spawn-all traffic-manager ((this traffic-manager)) +(defmethod spawn-all ((this traffic-manager)) - ;; rewritten to remove asm branches + ;; og:preserve-this rewritten to remove asm branches ;; (let ((s5-0 0)) ;; (b! #t cfg-4 :delay (nop!)) @@ -424,7 +422,7 @@ ) ) -(defmethod reset-and-init traffic-manager ((this traffic-manager)) +(defmethod reset-and-init ((this traffic-manager)) (set! (-> this traffic-engine) *traffic-engine*) (reset-and-init-from-manager (-> this traffic-engine) this) (restore-city-speeches) @@ -433,7 +431,7 @@ ) ;; WARN: Return type mismatch process vs traffic-manager. -(defmethod relocate traffic-manager ((this traffic-manager) (arg0 int)) +(defmethod relocate ((this traffic-manager) (arg0 int)) (set! *traffic-manager* this) (if *traffic-manager* (set! *traffic-manager* (&+ *traffic-manager* arg0)) @@ -441,7 +439,7 @@ (the-as traffic-manager ((method-of-type process relocate) this arg0)) ) -(defmethod deactivate traffic-manager ((this traffic-manager)) +(defmethod deactivate ((this traffic-manager)) (stop-alarm-sound (-> this traffic-engine)) (set! *traffic-manager* #f) (remove-setting *setting-control* this 'task-mask) @@ -451,7 +449,7 @@ (none) ) -(defmethod init-params traffic-manager ((this traffic-manager)) +(defmethod init-params ((this traffic-manager)) (let ((traffic-want-counts (new 'stack-no-clear 'array 'int8 21))) (set! (-> traffic-want-counts 11) 8) (set! (-> traffic-want-counts 12) 8) @@ -501,9 +499,9 @@ (set! (-> params id) (the-as uint 1)) ) (set! (-> this dark-guard-ratio) (if (task-node-closed? (game-task-node tomb-boss-resolution)) - 5 - 0 - ) + 5 + 0 + ) ) (restore-default-settings (-> this traffic-engine)) (set! *traffic-manager* this) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/bike.gc b/goal_src/jak2/levels/city/traffic/vehicle/bike.gc index c681da46de6..1acbaff8c6a 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/bike.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/bike.gc @@ -912,14 +912,10 @@ (deftype bike-base (vehicle) () - :heap-base #x2f0 - :method-count-assert 144 - :size-assert #x370 - :flag-assert #x9002f00370 ) -(defmethod do-engine-sounds bike-base ((this bike-base)) +(defmethod do-engine-sounds ((this bike-base)) (call-parent-method this) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (if (zero? (-> this roll-sound-id)) @@ -951,7 +947,7 @@ (none) ) -(defmethod draw-thrusters bike-base ((this bike-base)) +(defmethod draw-thrusters ((this bike-base)) (call-parent-method this) (when (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'matrix 3))) @@ -1010,22 +1006,18 @@ ) (deftype bikea (bike-base) - ((fin-fl joint-mod-rotate-local :offset-assert 880) - (fin-fr joint-mod-rotate-local :offset-assert 884) - (fin-rl joint-mod-rotate-local :offset-assert 888) - (fin-rr joint-mod-rotate-local :offset-assert 892) - (rudder joint-mod-rotate-local :offset-assert 896) - (brake-l joint-mod-rotate-local :offset-assert 900) - (brake-r joint-mod-rotate-local :offset-assert 904) + ((fin-fl joint-mod-rotate-local) + (fin-fr joint-mod-rotate-local) + (fin-rl joint-mod-rotate-local) + (fin-rr joint-mod-rotate-local) + (rudder joint-mod-rotate-local) + (brake-l joint-mod-rotate-local) + (brake-r joint-mod-rotate-local) ) - :heap-base #x310 - :method-count-assert 144 - :size-assert #x38c - :flag-assert #x900310038c ) -(defmethod relocate bikea ((this bikea) (arg0 int)) +(defmethod relocate ((this bikea) (arg0 int)) (if (nonzero? (-> this fin-fl)) (&+! (-> this fin-fl) arg0) ) @@ -1050,7 +1042,7 @@ (call-parent-method this arg0) ) -(defmethod allocate-and-init-cshape bikea ((this bikea)) +(defmethod allocate-and-init-cshape ((this bikea)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1103,7 +1095,7 @@ (none) ) -(defmethod update-joint-mods bikea ((this bikea)) +(defmethod update-joint-mods ((this bikea)) (let ((f30-0 (* 5461.3335 (-> this controls steering))) (f26-0 (* -5461.3335 (-> this controls lean-z))) (f28-0 (* -13653.333 (-> this controls brake))) @@ -1121,7 +1113,7 @@ (none) ) -(defmethod init-skel-and-rigid-body bikea ((this bikea)) +(defmethod init-skel-and-rigid-body ((this bikea)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikea" (the-as (pointer uint32) #f))) @@ -1140,23 +1132,19 @@ ) (deftype bikeb (bike-base) - ((fin-rl joint-mod-rotate-local :offset-assert 880) - (fin-rr joint-mod-rotate-local :offset-assert 884) - (rudder joint-mod-rotate-local :offset-assert 888) - (rudder-f joint-mod-rotate-local :offset-assert 892) - (brake-l joint-mod-rotate-local :offset-assert 896) - (brake-r joint-mod-rotate-local :offset-assert 900) - (flap-l joint-mod-rotate-local :offset-assert 904) - (flap-r joint-mod-rotate-local :offset-assert 908) + ((fin-rl joint-mod-rotate-local) + (fin-rr joint-mod-rotate-local) + (rudder joint-mod-rotate-local) + (rudder-f joint-mod-rotate-local) + (brake-l joint-mod-rotate-local) + (brake-r joint-mod-rotate-local) + (flap-l joint-mod-rotate-local) + (flap-r joint-mod-rotate-local) ) - :heap-base #x310 - :method-count-assert 144 - :size-assert #x390 - :flag-assert #x9003100390 ) -(defmethod relocate bikeb ((this bikeb) (arg0 int)) +(defmethod relocate ((this bikeb) (arg0 int)) (if (nonzero? (-> this fin-rl)) (&+! (-> this fin-rl) arg0) ) @@ -1184,7 +1172,7 @@ (call-parent-method this arg0) ) -(defmethod allocate-and-init-cshape bikeb ((this bikeb)) +(defmethod allocate-and-init-cshape ((this bikeb)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1237,7 +1225,7 @@ (none) ) -(defmethod update-joint-mods bikeb ((this bikeb)) +(defmethod update-joint-mods ((this bikeb)) (let ((f30-0 (* 5461.3335 (-> this controls steering))) (f26-0 (* -5461.3335 (-> this controls lean-z))) (f28-0 (* 13653.333 (-> this controls brake))) @@ -1256,7 +1244,7 @@ (none) ) -(defmethod init-skel-and-rigid-body bikeb ((this bikeb)) +(defmethod init-skel-and-rigid-body ((this bikeb)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikeb" (the-as (pointer uint32) #f))) @@ -1276,26 +1264,22 @@ ) (deftype bikec (bike-base) - ((fin-fl joint-mod-rotate-local :offset-assert 880) - (fin-fr joint-mod-rotate-local :offset-assert 884) - (fin-rl joint-mod-rotate-local :offset-assert 888) - (fin-rr joint-mod-rotate-local :offset-assert 892) - (fin2-fl joint-mod-rotate-local :offset-assert 896) - (fin2-fr joint-mod-rotate-local :offset-assert 900) - (rudder joint-mod-rotate-local :offset-assert 904) - (brake-l joint-mod-rotate-local :offset-assert 908) - (brake-r joint-mod-rotate-local :offset-assert 912) - (spoiler-l joint-mod-rotate-local :offset-assert 916) - (spoiler-r joint-mod-rotate-local :offset-assert 920) + ((fin-fl joint-mod-rotate-local) + (fin-fr joint-mod-rotate-local) + (fin-rl joint-mod-rotate-local) + (fin-rr joint-mod-rotate-local) + (fin2-fl joint-mod-rotate-local) + (fin2-fr joint-mod-rotate-local) + (rudder joint-mod-rotate-local) + (brake-l joint-mod-rotate-local) + (brake-r joint-mod-rotate-local) + (spoiler-l joint-mod-rotate-local) + (spoiler-r joint-mod-rotate-local) ) - :heap-base #x320 - :method-count-assert 144 - :size-assert #x39c - :flag-assert #x900320039c ) -(defmethod relocate bikec ((this bikec) (arg0 int)) +(defmethod relocate ((this bikec) (arg0 int)) (if (nonzero? (-> this fin-fl)) (&+! (-> this fin-fl) arg0) ) @@ -1332,7 +1316,7 @@ (call-parent-method this arg0) ) -(defmethod allocate-and-init-cshape bikec ((this bikec)) +(defmethod allocate-and-init-cshape ((this bikec)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1385,7 +1369,7 @@ (none) ) -(defmethod update-joint-mods bikec ((this bikec)) +(defmethod update-joint-mods ((this bikec)) (let ((f30-0 (* 5461.3335 (-> this controls steering))) (f26-0 (* -5461.3335 (-> this controls lean-z))) (f28-0 (* 13653.333 (-> this controls brake))) @@ -1407,7 +1391,7 @@ (none) ) -(defmethod init-skel-and-rigid-body bikec ((this bikec)) +(defmethod init-skel-and-rigid-body ((this bikec)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikec" (the-as (pointer uint32) #f))) @@ -1451,23 +1435,19 @@ ) (deftype guard-bike (vehicle-guard) - ((turret-jm joint-mod-rotate-local :offset-assert 1076) + ((turret-jm joint-mod-rotate-local) ) - :heap-base #x3c0 - :method-count-assert 159 - :size-assert #x438 - :flag-assert #x9f03c00438 ) -(defmethod relocate guard-bike ((this guard-bike) (arg0 int)) +(defmethod relocate ((this guard-bike) (arg0 int)) (if (nonzero? (-> this turret-jm)) (&+! (-> this turret-jm) arg0) ) (call-parent-method this arg0) ) -(defmethod start-jump guard-bike ((this guard-bike)) +(defmethod start-jump ((this guard-bike)) (when (not (logtest? (rigid-body-object-flag jump-sound) (-> this flags))) (logior! (-> this flags) (rigid-body-object-flag jump-sound)) (sound-play "bike-hop") @@ -1477,7 +1457,7 @@ (none) ) -(defmethod allocate-and-init-cshape guard-bike ((this guard-bike)) +(defmethod allocate-and-init-cshape ((this guard-bike)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1530,13 +1510,13 @@ (none) ) -(defmethod update-joint-mods guard-bike ((this guard-bike)) +(defmethod update-joint-mods ((this guard-bike)) (update-joint-mod (-> this turret) (-> this turret-jm)) 0 (none) ) -(defmethod init-skel-and-rigid-body guard-bike ((this guard-bike)) +(defmethod init-skel-and-rigid-body ((this guard-bike)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-guard-bike" (the-as (pointer uint32) #f))) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/car.gc b/goal_src/jak2/levels/city/traffic/vehicle/car.gc index 115fb619ed9..419e4dbda07 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/car.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/car.gc @@ -1105,16 +1105,12 @@ (set! (-> *hellcat-constants* explosion) *car-explosion-info*) (deftype car-base (vehicle) - ((rider-hand-joint-array int8 2 :offset-assert 880) + ((rider-hand-joint-array int8 2) ) - :heap-base #x300 - :method-count-assert 144 - :size-assert #x372 - :flag-assert #x9003000372 ) -(defmethod vehicle-method-117 car-base ((this car-base) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 ((this car-base) (arg0 vector) (arg1 int) (arg2 int)) (vector-matrix*! arg0 (-> this info rider-hand-offset arg2) @@ -1125,24 +1121,20 @@ ) (deftype cara (car-base) - ((steering-wheel-l joint-mod-rotate-local :offset-assert 884) - (steering-wheel-r joint-mod-rotate-local :offset-assert 888) - (fin-fl joint-mod-rotate-local :offset-assert 892) - (fin-fr joint-mod-rotate-local :offset-assert 896) - (fin-rl joint-mod-rotate-local :offset-assert 900) - (fin-rr joint-mod-rotate-local :offset-assert 904) - (rudder-l joint-mod-rotate-local :offset-assert 908) - (rudder-r joint-mod-rotate-local :offset-assert 912) - (rudder joint-mod-rotate-local :offset-assert 916) + ((steering-wheel-l joint-mod-rotate-local) + (steering-wheel-r joint-mod-rotate-local) + (fin-fl joint-mod-rotate-local) + (fin-fr joint-mod-rotate-local) + (fin-rl joint-mod-rotate-local) + (fin-rr joint-mod-rotate-local) + (rudder-l joint-mod-rotate-local) + (rudder-r joint-mod-rotate-local) + (rudder joint-mod-rotate-local) ) - :heap-base #x320 - :method-count-assert 144 - :size-assert #x398 - :flag-assert #x9003200398 ) -(defmethod relocate cara ((this cara) (arg0 int)) +(defmethod relocate ((this cara) (arg0 int)) (if (nonzero? (-> this steering-wheel-l)) (&+! (-> this steering-wheel-l) arg0) ) @@ -1173,7 +1165,7 @@ (call-parent-method this arg0) ) -(defmethod allocate-and-init-cshape cara ((this cara)) +(defmethod allocate-and-init-cshape ((this cara)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1236,7 +1228,7 @@ (none) ) -(defmethod update-joint-mods cara ((this cara)) +(defmethod update-joint-mods ((this cara)) (let ((f30-0 (* 3640.889 (-> this controls steering))) (f26-0 (* 9102.223 (-> this controls steering))) (f28-0 (* -3640.889 (-> this controls lean-z))) @@ -1254,7 +1246,7 @@ (none) ) -(defmethod init-skel-and-rigid-body cara ((this cara)) +(defmethod init-skel-and-rigid-body ((this cara)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-cara" (the-as (pointer uint32) #f))) @@ -1277,21 +1269,17 @@ ) (deftype carb (car-base) - ((steering-wheel-l joint-mod-rotate-local :offset-assert 884) - (steering-wheel-r joint-mod-rotate-local :offset-assert 888) - (fin-fl joint-mod-rotate-local :offset-assert 892) - (fin-fr joint-mod-rotate-local :offset-assert 896) - (fin-rl joint-mod-rotate-local :offset-assert 900) - (fin-rr joint-mod-rotate-local :offset-assert 904) + ((steering-wheel-l joint-mod-rotate-local) + (steering-wheel-r joint-mod-rotate-local) + (fin-fl joint-mod-rotate-local) + (fin-fr joint-mod-rotate-local) + (fin-rl joint-mod-rotate-local) + (fin-rr joint-mod-rotate-local) ) - :heap-base #x310 - :method-count-assert 144 - :size-assert #x38c - :flag-assert #x900310038c ) -(defmethod relocate carb ((this carb) (arg0 int)) +(defmethod relocate ((this carb) (arg0 int)) (if (nonzero? (-> this steering-wheel-l)) (&+! (-> this steering-wheel-l) arg0) ) @@ -1313,7 +1301,7 @@ (call-parent-method this arg0) ) -(defmethod allocate-and-init-cshape carb ((this carb)) +(defmethod allocate-and-init-cshape ((this carb)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1376,7 +1364,7 @@ (none) ) -(defmethod update-joint-mods carb ((this carb)) +(defmethod update-joint-mods ((this carb)) (let ((f30-0 (* -5461.3335 (-> this controls lean-z))) (f28-0 (* 9102.223 (-> this controls steering))) (gp-0 (new 'static 'vector :x 1.0 :w 1.0)) @@ -1392,7 +1380,7 @@ (none) ) -(defmethod init-skel-and-rigid-body carb ((this carb)) +(defmethod init-skel-and-rigid-body ((this carb)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-carb" (the-as (pointer uint32) #f))) @@ -1412,22 +1400,18 @@ ) (deftype carc (car-base) - ((steering-wheel joint-mod-rotate-local :offset-assert 884) - (fin-fl joint-mod-rotate-local :offset-assert 888) - (fin-fr joint-mod-rotate-local :offset-assert 892) - (fin-rl joint-mod-rotate-local :offset-assert 896) - (fin-rr joint-mod-rotate-local :offset-assert 900) - (fin2-rl joint-mod-rotate-local :offset-assert 904) - (fin2-rr joint-mod-rotate-local :offset-assert 908) + ((steering-wheel joint-mod-rotate-local) + (fin-fl joint-mod-rotate-local) + (fin-fr joint-mod-rotate-local) + (fin-rl joint-mod-rotate-local) + (fin-rr joint-mod-rotate-local) + (fin2-rl joint-mod-rotate-local) + (fin2-rr joint-mod-rotate-local) ) - :heap-base #x310 - :method-count-assert 144 - :size-assert #x390 - :flag-assert #x9003100390 ) -(defmethod relocate carc ((this carc) (arg0 int)) +(defmethod relocate ((this carc) (arg0 int)) (if (nonzero? (-> this steering-wheel)) (&+! (-> this steering-wheel) arg0) ) @@ -1452,7 +1436,7 @@ (call-parent-method this arg0) ) -(defmethod allocate-and-init-cshape carc ((this carc)) +(defmethod allocate-and-init-cshape ((this carc)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1510,7 +1494,7 @@ (none) ) -(defmethod update-joint-mods carc ((this carc)) +(defmethod update-joint-mods ((this carc)) (let ((f30-0 (* -5461.3335 (-> this controls steering))) (f28-0 (* -5461.3335 (-> this controls lean-z))) (f0-3 (* 9102.223 (-> this controls steering))) @@ -1528,7 +1512,7 @@ (none) ) -(defmethod init-skel-and-rigid-body carc ((this carc)) +(defmethod init-skel-and-rigid-body ((this carc)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-carc" (the-as (pointer uint32) #f))) @@ -1569,23 +1553,19 @@ ) (deftype hellcat (vehicle-guard) - ((turret-jm joint-mod-rotate-local :offset-assert 1076) + ((turret-jm joint-mod-rotate-local) ) - :heap-base #x3c0 - :method-count-assert 159 - :size-assert #x438 - :flag-assert #x9f03c00438 ) -(defmethod relocate hellcat ((this hellcat) (arg0 int)) +(defmethod relocate ((this hellcat) (arg0 int)) (if (nonzero? (-> this turret-jm)) (&+! (-> this turret-jm) arg0) ) (call-parent-method this arg0) ) -(defmethod allocate-and-init-cshape hellcat ((this hellcat)) +(defmethod allocate-and-init-cshape ((this hellcat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1647,13 +1627,13 @@ (none) ) -(defmethod update-joint-mods hellcat ((this hellcat)) +(defmethod update-joint-mods ((this hellcat)) (update-joint-mod (-> this turret) (-> this turret-jm)) 0 (none) ) -(defmethod init-skel-and-rigid-body hellcat ((this hellcat)) +(defmethod init-skel-and-rigid-body ((this hellcat)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-hellcat" (the-as (pointer uint32) #f))) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/test-bike.gc b/goal_src/jak2/levels/city/traffic/vehicle/test-bike.gc index bd5bb3230a0..c670bfdac23 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/test-bike.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/test-bike.gc @@ -9,10 +9,6 @@ (deftype test-bike (bikec) () - :heap-base #x320 - :method-count-assert 144 - :size-assert #x39c - :flag-assert #x900320039c ) @@ -223,7 +219,7 @@ ) ) -(defmethod init-skel-and-rigid-body test-bike ((this test-bike)) +(defmethod init-skel-and-rigid-body ((this test-bike)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikec" (the-as (pointer uint32) #f))) @@ -247,10 +243,6 @@ (deftype evan-test-bike (bikea) () - :heap-base #x310 - :method-count-assert 144 - :size-assert #x38c - :flag-assert #x900310038c ) @@ -459,7 +451,7 @@ ) ) -(defmethod init-skel-and-rigid-body evan-test-bike ((this evan-test-bike)) +(defmethod init-skel-and-rigid-body ((this evan-test-bike)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikea" (the-as (pointer uint32) #f))) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/test-car.gc b/goal_src/jak2/levels/city/traffic/vehicle/test-car.gc index 603b35119f3..6f7582ceaa5 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/test-car.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/test-car.gc @@ -9,10 +9,6 @@ (deftype test-car (cara) () - :heap-base #x320 - :method-count-assert 144 - :size-assert #x398 - :flag-assert #x9003200398 ) @@ -267,7 +263,7 @@ ) ) -(defmethod init-skel-and-rigid-body test-car ((this test-car)) +(defmethod init-skel-and-rigid-body ((this test-car)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-cara" (the-as (pointer uint32) #f))) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/transport.gc b/goal_src/jak2/levels/city/traffic/vehicle/transport.gc index ad7e77ed114..c77837dc699 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/transport.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/transport.gc @@ -27,24 +27,22 @@ ) (deftype vehicle-turret (process-focusable) - ((turret-jm joint-mod :offset-assert 204) - (turret turret-control :inline :offset-assert 208) - (target handle :offset-assert 288) + ((turret-jm joint-mod) + (turret turret-control :inline) + (target handle) ) - :heap-base #xb0 - :method-count-assert 31 - :size-assert #x128 - :flag-assert #x1f00b00128 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (vehicle-turret-method-28 (_type_) none 28) - (vehicle-turret-method-29 (_type_) none 29) - (vehicle-turret-method-30 (_type_) none 30) + (vehicle-turret-method-28 (_type_) none) + (vehicle-turret-method-29 (_type_) none) + (vehicle-turret-method-30 (_type_) none) ) ) -(defmethod vehicle-turret-method-29 vehicle-turret ((this vehicle-turret)) +(defmethod vehicle-turret-method-29 ((this vehicle-turret)) (let* ((s4-0 (ppointer->process (-> this parent))) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -89,7 +87,7 @@ :post transform-post ) -(defmethod vehicle-turret-method-28 vehicle-turret ((this vehicle-turret)) +(defmethod vehicle-turret-method-28 ((this vehicle-turret)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -117,14 +115,14 @@ (none) ) -(defmethod relocate vehicle-turret ((this vehicle-turret) (arg0 int)) +(defmethod relocate ((this vehicle-turret) (arg0 int)) (if (nonzero? (-> this turret-jm)) (&+! (-> this turret-jm) arg0) ) (call-parent-method this arg0) ) -(defmethod vehicle-turret-method-30 vehicle-turret ((this vehicle-turret)) +(defmethod vehicle-turret-method-30 ((this vehicle-turret)) (set! (-> this turret-jm) (the-as joint-mod (new 'process 'joint-mod-rotate-local this (-> this turret info joint-index) #t)) ) @@ -174,47 +172,42 @@ ) (deftype transport-params (structure) - ((spawn-pos vector :inline :offset-assert 0) - (quat quaternion :inline :offset-assert 16) - (nav-mesh nav-mesh :offset-assert 32) - (max-guard uint32 :offset-assert 36) - (max-time float :offset-assert 40) - (turret? symbol :offset-assert 44) - (speeches? symbol :offset-assert 48) + ((spawn-pos vector :inline) + (quat quaternion :inline) + (nav-mesh nav-mesh) + (max-guard uint32) + (max-time float) + (turret? symbol) + (speeches? symbol) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) (deftype transport (process-focusable) - ((y-dest float :offset-assert 204) - (last-guard-spawn-time time-frame :offset-assert 208) - (nav-mesh nav-mesh :offset-assert 216) - (spawn-side uint32 :offset-assert 220) - (spawn? symbol :offset-assert 224) - (leave-time time-frame :offset-assert 232) - (max-guard uint32 :offset-assert 240) - (count-guard uint32 :offset-assert 244) - (max-time float :offset-assert 248) - (ambient-sound-id sound-id :offset-assert 252) - (turret handle :offset-assert 256) + ((y-dest float) + (last-guard-spawn-time time-frame) + (nav-mesh nav-mesh) + (spawn-side uint32) + (spawn? symbol) + (leave-time time-frame) + (max-guard uint32) + (count-guard uint32) + (max-time float) + (ambient-sound-id sound-id) + (turret handle) ) - :heap-base #x90 - :method-count-assert 36 - :size-assert #x108 - :flag-assert #x2400900108 + (:state-methods + come-down + idle + leave + die-fast + ) (:methods - (come-down () _type_ :state 27) - (idle () _type_ :state 28) - (leave () _type_ :state 29) - (die-fast () _type_ :state 30) - (transport-method-31 (_type_) none 31) - (transport-method-32 (_type_) none 32) - (transport-method-33 (_type_) none 33) - (transport-method-34 (_type_ process) none 34) - (transport-method-35 (_type_) none 35) + (transport-method-31 (_type_) none) + (transport-method-32 (_type_) none) + (transport-method-33 (_type_) none) + (transport-method-34 (_type_ process) none) + (transport-method-35 (_type_) none) ) ) @@ -248,11 +241,11 @@ ) ) -(defmethod run-logic? transport ((this transport)) +(defmethod run-logic? ((this transport)) #t ) -(defmethod transport-method-35 transport ((this transport)) +(defmethod transport-method-35 ((this transport)) (let ((f30-0 (lerp-scale 0.0 2.0 (fabs (-> this root transv y)) 0.0 122880.0)) (f0-4 (lerp-scale 0.0 1.0 (- (-> this root trans y) (-> this y-dest)) 143360.0 20480.0)) (a0-3 (static-sound-spec "transport" :volume 0.0 :mask (pitch reg0))) @@ -265,7 +258,7 @@ (none) ) -(defmethod deactivate transport ((this transport)) +(defmethod deactivate ((this transport)) (sound-stop (-> this ambient-sound-id)) (call-parent-method this) (none) @@ -400,7 +393,7 @@ ) ) -(defmethod transport-method-33 transport ((this transport)) +(defmethod transport-method-33 ((this transport)) (when (>= (- (current-time) (-> this last-guard-spawn-time)) 0) (let ((s5-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> s5-0 object-type) (traffic-type crimson-guard-1)) @@ -437,7 +430,7 @@ (none) ) -(defmethod transport-method-34 transport ((this transport) (arg0 process)) +(defmethod transport-method-34 ((this transport) (arg0 process)) (let ((v1-1 (handle->process (-> this turret)))) (if v1-1 (set! (-> (the-as vehicle-turret v1-1) target) (process->handle arg0)) @@ -447,7 +440,7 @@ (none) ) -(defmethod transport-method-31 transport ((this transport)) +(defmethod transport-method-31 ((this transport)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -488,7 +481,7 @@ (none) ) -(defmethod transport-method-32 transport ((this transport)) +(defmethod transport-method-32 ((this transport)) (set! (-> this spawn-side) (the-as uint 0)) 0 (none) @@ -526,7 +519,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! transport ((this transport) (arg0 entity-actor)) +(defmethod init-from-entity! ((this transport) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-control.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-control.gc index 867641b48f4..55d45525934 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-control.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-control.gc @@ -9,7 +9,7 @@ (define *vehicle-control-debug-obj* (the-as object #f)) -(defmethod vehicle-controller-method-21 vehicle-controller ((this vehicle-controller)) +(defmethod vehicle-controller-method-21 ((this vehicle-controller)) (when (logtest? (-> this flags) (vehicle-controller-flag attached)) (let ((v1-3 (-> this branch))) (when (or (not v1-3) (zero? v1-3)) @@ -36,7 +36,7 @@ (none) ) -(defmethod vehicle-controller-method-20 vehicle-controller ((this vehicle-controller) (arg0 object) (arg1 float)) +(defmethod vehicle-controller-method-20 ((this vehicle-controller) (arg0 object) (arg1 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -94,7 +94,7 @@ ) ) -(defmethod vehicle-controller-method-19 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 object) (arg2 vector) (arg3 vector)) +(defmethod vehicle-controller-method-19 ((this vehicle-controller) (arg0 vector) (arg1 object) (arg2 vector) (arg3 vector)) (set! (-> this path-prev-point quad) (-> arg0 quad)) (vector-vector-distance arg0 arg2) (set! (-> this target-speed) (vector-length arg3)) @@ -108,7 +108,7 @@ (none) ) -(defmethod vehicle-controller-method-13 vehicle-controller ((this vehicle-controller) (arg0 nav-branch) (arg1 vector)) +(defmethod vehicle-controller-method-13 ((this vehicle-controller) (arg0 nav-branch) (arg1 vector)) (vehicle-controller-method-10 this (the-as traffic-tracker arg0)) (set! (-> this path-prev-point quad) (-> arg1 quad)) (set! (-> this branch) arg0) @@ -142,7 +142,7 @@ (none) ) -(defmethod vehicle-controller-method-15 vehicle-controller ((this vehicle-controller)) +(defmethod vehicle-controller-method-15 ((this vehicle-controller)) (let ((gp-0 (the-as nav-branch #f))) (let* ((s5-0 (-> this branch dest-node)) (s4-0 (-> s5-0 branch-count)) @@ -182,7 +182,7 @@ ) ) -(defmethod vehicle-controller-method-14 vehicle-controller ((this vehicle-controller) (arg0 vehicle)) +(defmethod vehicle-controller-method-14 ((this vehicle-controller) (arg0 vehicle)) (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-0 ((-> this choose-branch-callback) this arg0)) ) @@ -195,7 +195,7 @@ ) ) -(defmethod vehicle-controller-method-16 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 vector)) +(defmethod vehicle-controller-method-16 ((this vehicle-controller) (arg0 vector) (arg1 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -285,7 +285,7 @@ ) ) -(defmethod vehicle-controller-method-18 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 vector) (arg2 vehicle) (arg3 float)) +(defmethod vehicle-controller-method-18 ((this vehicle-controller) (arg0 vector) (arg1 vector) (arg2 vehicle) (arg3 float)) (local-vars (v1-24 float) (v1-88 float) @@ -559,7 +559,7 @@ ) ) -(defmethod vehicle-controller-method-10 vehicle-controller ((this vehicle-controller) (arg0 traffic-tracker)) +(defmethod vehicle-controller-method-10 ((this vehicle-controller) (arg0 traffic-tracker)) (when (not (logtest? (-> this flags) (vehicle-controller-flag attached))) (logior! (-> this flags) (vehicle-controller-flag attached)) (+! (-> arg0 active-object-count) 1) @@ -568,7 +568,7 @@ (none) ) -(defmethod vehicle-controller-method-11 vehicle-controller ((this vehicle-controller)) +(defmethod vehicle-controller-method-11 ((this vehicle-controller)) (when (logtest? (-> this flags) (vehicle-controller-flag attached)) (logclear! (-> this flags) (vehicle-controller-flag attached)) (let ((v1-5 (-> this branch))) @@ -589,13 +589,13 @@ (none) ) -(defmethod vehicle-controller-method-12 vehicle-controller ((this vehicle-controller) - (arg0 rigid-body-vehicle-constants) - (arg1 vector) - (arg2 float) - (arg3 int) - (arg4 float) - ) +(defmethod vehicle-controller-method-12 ((this vehicle-controller) + (arg0 rigid-body-vehicle-constants) + (arg1 vector) + (arg2 float) + (arg3 int) + (arg4 float) + ) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 quad) (-> arg1 quad)) (set! (-> s3-0 y) 0.0) @@ -623,7 +623,7 @@ (none) ) -(defmethod draw-debug-info vehicle-controller ((this vehicle-controller)) +(defmethod draw-debug-info ((this vehicle-controller)) (add-debug-sphere #t (bucket-id debug2) (-> this dest-circle) (-> this dest-circle w) *color-green*) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this target-point) *color-white*) (add-debug-vector @@ -660,7 +660,7 @@ (none) ) -(defmethod vehicle-controller-method-9 vehicle-controller ((this vehicle-controller)) +(defmethod vehicle-controller-method-9 ((this vehicle-controller)) (set! (-> this traffic) *traffic-engine*) (set! (-> this choose-branch-callback) (the-as (function vehicle-controller vehicle nav-branch) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc index f267c127b01..9b4d8fb7be2 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod do-engine-sounds vehicle ((this vehicle)) +(defmethod do-engine-sounds ((this vehicle)) (local-vars (v1-36 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -219,7 +219,7 @@ ) ) -(defmethod draw-thruster vehicle ((this vehicle) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod draw-thruster ((this vehicle) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -308,7 +308,7 @@ ) ) -(defmethod draw-thrusters vehicle ((this vehicle)) +(defmethod draw-thrusters ((this vehicle)) (local-vars (sv-272 sparticle-launcher) (sv-276 sparticle-launcher)) (when (= (-> this controller traffic sync-mask-32) (ash 1 (logand (-> this traffic-priority-id) 31))) (let ((f0-1 diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc index 936461bb10b..73010238d1d 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc @@ -47,83 +47,74 @@ ;; DECOMP BEGINS (deftype turret-barrel-info (structure) - ((local-pos vector :inline :offset-assert 0) - (local-dir vector :inline :offset-assert 16) + ((local-pos vector :inline) + (local-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype turret-control-info (structure) - ((joint-index int8 :offset-assert 0) - (barrel-count int8 :offset-assert 1) - (shot-speed float :offset-assert 4) - (attack-range float :offset-assert 8) - (rot-min float 2 :offset-assert 12) - (rot-max float 2 :offset-assert 20) - (rot-x-min float :offset 12) - (rot-x-max float :offset 20) - (rot-y-min float :offset 16) - (rot-y-max float :offset 24) - (local-pos vector :inline :offset-assert 32) - (local-dir vector :inline :offset-assert 48) - (barrel-array turret-barrel-info 4 :inline :offset-assert 64) + ((joint-index int8) + (barrel-count int8) + (shot-speed float) + (attack-range float) + (rot-min float 2) + (rot-max float 2) + (rot-x-min float :overlay-at (-> rot-min 0)) + (rot-x-max float :overlay-at (-> rot-max 0)) + (rot-y-min float :overlay-at (-> rot-min 1)) + (rot-y-max float :overlay-at (-> rot-max 1)) + (local-pos vector :inline) + (local-dir vector :inline) + (barrel-array turret-barrel-info 4 :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) (deftype turret-control (structure) - ((info turret-control-info :offset-assert 0) - (guard-settings traffic-guard-type-settings :offset-assert 4) - (flags turret-flag :offset-assert 8) - (shot-count int8 :offset-assert 9) - (burst-count int16 :offset-assert 10) - (target-dist float :offset-assert 12) - (inaccuracy float :offset-assert 16) - (aim-offset-angle degrees :offset-assert 20) - (aim-rot float 2 :offset-assert 24) - (aim-rot-vel float 2 :offset-assert 32) - (aim-rot-offset float 2 :offset-assert 40) - (aim-rot-x float :offset 24) - (aim-rot-y float :offset 28) - (aim-rot-vel-x float :offset 32) - (aim-rot-vel-y float :offset 36) - (target-in-sight-time time-frame :offset-assert 48) - (aim-acquire-time time-frame :offset-assert 56) - (shoot-time time-frame :offset-assert 64) - (owner-handle handle :offset-assert 72) + ((info turret-control-info) + (guard-settings traffic-guard-type-settings) + (flags turret-flag) + (shot-count int8) + (burst-count int16) + (target-dist float) + (inaccuracy float) + (aim-offset-angle degrees) + (aim-rot float 2) + (aim-rot-vel float 2) + (aim-rot-offset float 2) + (aim-rot-x float :overlay-at (-> aim-rot 0)) + (aim-rot-y float :overlay-at (-> aim-rot 1)) + (aim-rot-vel-x float :overlay-at (-> aim-rot-vel 0)) + (aim-rot-vel-y float :overlay-at (-> aim-rot-vel 1)) + (target-in-sight-time time-frame) + (aim-acquire-time time-frame) + (shoot-time time-frame) + (owner-handle handle) ) :pack-me - :method-count-assert 18 - :size-assert #x50 - :flag-assert #x1200000050 (:methods - (turret-control-method-9 (_type_ vehicle vector vector) none 9) - (turret-control-method-10 (_type_ vehicle) none 10) - (turret-control-method-11 (_type_ object object vector) none 11) - (update-joint-mod (_type_ joint-mod-rotate-local) none 12) - (turret-control-method-13 (_type_) none 13) - (turret-control-method-14 (_type_) none 14) - (set-info (_type_ turret-control-info) none 15) - (turret-control-method-16 (_type_ float float) none 16) - (turret-control-method-17 (_type_ vehicle) none 17) + (turret-control-method-9 (_type_ vehicle vector vector) none) + (turret-control-method-10 (_type_ vehicle) none) + (turret-control-method-11 (_type_ object object vector) none) + (update-joint-mod (_type_ joint-mod-rotate-local) none) + (turret-control-method-13 (_type_) none) + (turret-control-method-14 (_type_) none) + (set-info (_type_ turret-control-info) none) + (turret-control-method-16 (_type_ float float) none) + (turret-control-method-17 (_type_ vehicle) none) ) ) -(defmethod set-info turret-control ((this turret-control) (arg0 turret-control-info)) +(defmethod set-info ((this turret-control) (arg0 turret-control-info)) (set! (-> this info) arg0) (set! (-> this owner-handle) (the-as handle #f)) 0 (none) ) -(defmethod update-joint-mod turret-control ((this turret-control) (arg0 joint-mod-rotate-local)) +(defmethod update-joint-mod ((this turret-control) (arg0 joint-mod-rotate-local)) (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 x) (- (-> this aim-rot-x))) (set! (-> v1-0 y) (-> this aim-rot-y)) @@ -134,7 +125,7 @@ (none) ) -(defmethod turret-control-method-13 turret-control ((this turret-control)) +(defmethod turret-control-method-13 ((this turret-control)) (let ((f30-0 (/ (* 298261630.0 (-> this inaccuracy) (-> this guard-settings inaccuracy)) (fmax 40960.0 (-> this target-dist)) ) @@ -148,7 +139,7 @@ (none) ) -(defmethod turret-control-method-14 turret-control ((this turret-control)) +(defmethod turret-control-method-14 ((this turret-control)) (logclear! (-> this flags) (turret-flag firing aiming)) (set! (-> this burst-count) 0) (set! (-> this aim-offset-angle) (* 65536.0 (rand-vu))) @@ -272,7 +263,7 @@ (none) ) -(defmethod turret-control-method-9 turret-control ((this turret-control) (arg0 vehicle) (arg1 vector) (arg2 vector)) +(defmethod turret-control-method-9 ((this turret-control) (arg0 vehicle) (arg1 vector) (arg2 vector)) (let ((gp-0 (new 'stack-no-clear 'turret-unknown-stack-structure))) (set! (-> gp-0 vec-12 x) (seconds-per-frame)) (let* ((v1-1 (-> gp-0 mat-1)) @@ -422,7 +413,7 @@ (none) ) -(defmethod turret-control-method-10 turret-control ((this turret-control) (arg0 vehicle)) +(defmethod turret-control-method-10 ((this turret-control) (arg0 vehicle)) (cond ((logtest? (-> this flags) (turret-flag should-shoot)) (cond @@ -461,7 +452,7 @@ (none) ) -(defmethod turret-control-method-11 turret-control ((this turret-control) (arg0 object) (arg1 object) (arg2 vector)) +(defmethod turret-control-method-11 ((this turret-control) (arg0 object) (arg1 object) (arg2 vector)) (when (nonzero? (-> this info)) (set! (-> this inaccuracy) (* 0.000012207031 (+ 20480.0 (vector-length arg2)))) (turret-control-method-9 this (the-as vehicle arg0) (the-as vector arg1) arg2) @@ -471,7 +462,7 @@ (none) ) -(defmethod turret-control-method-17 turret-control ((this turret-control) (arg0 vehicle)) +(defmethod turret-control-method-17 ((this turret-control) (arg0 vehicle)) (let ((s4-0 (new 'stack-no-clear 'turret-unknown-stack-structure2))) (set! (-> s4-0 proj-params ent) (-> arg0 entity)) (set! (-> s4-0 proj-params charge) 1.0) @@ -512,7 +503,7 @@ (none) ) -(defmethod turret-control-method-16 turret-control ((this turret-control) (arg0 float) (arg1 float)) +(defmethod turret-control-method-16 ((this turret-control) (arg0 float) (arg1 float)) (let ((f0-0 (seconds-per-frame))) (set! (-> this aim-rot-vel-x) arg1) (set! (-> this aim-rot-vel-y) arg0) @@ -537,63 +528,58 @@ ) (deftype vehicle-guard-target-data (structure) - ((tpos vector :inline :offset-assert 0) - (spos vector :inline :offset-assert 16) - (tvel vector :inline :offset-assert 32) - (svel vector :inline :offset-assert 48) - (tdir vector :inline :offset-assert 64) - (sdir vector :inline :offset-assert 80) - (to-target vector :inline :offset-assert 96) - (to-target-dir vector :inline :offset-assert 112) - (temp vector :inline :offset-assert 128) - (target target :offset-assert 144) - (dist float :offset-assert 148) - (inv-dist float :offset-assert 152) - (attack-range float :offset-assert 156) + ((tpos vector :inline) + (spos vector :inline) + (tvel vector :inline) + (svel vector :inline) + (tdir vector :inline) + (sdir vector :inline) + (to-target vector :inline) + (to-target-dir vector :inline) + (temp vector :inline) + (target target) + (dist float) + (inv-dist float) + (attack-range float) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) (deftype vehicle-guard (vehicle) - ((ai-hook (function vehicle-guard none) :offset-assert 880) - (turret turret-control :inline :offset-assert 888) - (target-flags turret-flag :offset-assert 968) - (target-in-sight-time time-frame :offset-assert 976) - (minimap connection-minimap :offset-assert 984) - (vehicle-guard-pad-k1jn23k1 uint32 :offset-assert 988) - (traffic-target-status traffic-target-status :offset-assert 992) - (pursuit-target handle :offset-assert 1000) - (vehicle-guard-pad-1kjh2nb3k1 uint32 16 :offset-assert 1008) - (lod2 symbol :offset-assert 1072) + ((ai-hook (function vehicle-guard none)) + (turret turret-control :inline) + (target-flags turret-flag) + (target-in-sight-time time-frame) + (minimap connection-minimap) + (vehicle-guard-pad-k1jn23k1 uint32) + (traffic-target-status traffic-target-status) + (pursuit-target handle) + (vehicle-guard-pad-1kjh2nb3k1 uint32 16) + (lod2 symbol) ) - :heap-base #x3c0 - :method-count-assert 159 - :size-assert #x434 - :flag-assert #x9f03c00434 + (:state-methods + hostile + stop-and-shoot + slow-pursuit + vehicle-guard-state-147 + vehicle-guard-state-148 + waiting-ambush + ) (:methods - (hostile () _type_ :state 144) - (stop-and-shoot () _type_ :state 145) - (slow-pursuit () _type_ :state 146) - (vehicle-guard-method-147 () none 147) - (vehicle-guard-method-148 () none 148) - (waiting-ambush () _type_ :state 149) - (vehicle-guard-method-150 (_type_) none 150) - (vehicle-guard-method-151 (_type_ vehicle-guard-target-data) none 151) - (vehicle-guard-method-152 (_type_ vehicle-guard-target-data) none 152) - (vehicle-guard-method-153 (_type_ target) none 153) - (vehicle-guard-method-154 (_type_) none 154) - (vehicle-guard-method-155 (_type_ vector vector) none 155) - (vehicle-guard-method-156 (_type_) none 156) - (vehicle-guard-method-157 (_type_ vehicle-guard-target-data) symbol 157) - (vehicle-guard-method-158 (_type_) none 158) + (vehicle-guard-method-150 (_type_) none) + (vehicle-guard-method-151 (_type_ vehicle-guard-target-data) none) + (vehicle-guard-method-152 (_type_ vehicle-guard-target-data) none) + (vehicle-guard-method-153 (_type_ target) none) + (vehicle-guard-method-154 (_type_) none) + (vehicle-guard-method-155 (_type_ vector vector) none) + (vehicle-guard-method-156 (_type_) none) + (vehicle-guard-method-157 (_type_ vehicle-guard-target-data) symbol) + (vehicle-guard-method-158 (_type_) none) ) ) -(defmethod vehicle-guard-method-153 vehicle-guard ((this vehicle-guard) (arg0 target)) +(defmethod vehicle-guard-method-153 ((this vehicle-guard) (arg0 target)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> (get-trans arg0 3) quad)) (turret-control-method-11 (-> this turret) this s5-0 (-> arg0 control transv)) @@ -602,7 +588,7 @@ (none) ) -(defmethod vehicle-guard-method-151 vehicle-guard ((this vehicle-guard) (arg0 vehicle-guard-target-data)) +(defmethod vehicle-guard-method-151 ((this vehicle-guard) (arg0 vehicle-guard-target-data)) (let ((s5-0 (handle->process (-> this pursuit-target)))) (set! (-> arg0 target) (the-as target s5-0)) (when s5-0 @@ -633,7 +619,7 @@ (none) ) -(defmethod vehicle-guard-method-152 vehicle-guard ((this vehicle-guard) (arg0 vehicle-guard-target-data)) +(defmethod vehicle-guard-method-152 ((this vehicle-guard) (arg0 vehicle-guard-target-data)) (let ((s4-0 (handle->process (-> this pursuit-target)))) (cond ((logtest? (rigid-body-object-flag target-in-sight) (-> this flags)) @@ -686,7 +672,7 @@ (none) ) -(defmethod vehicle-guard-method-150 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-guard-method-150 ((this vehicle-guard)) (cond ((handle->process (-> this pursuit-target)) (let ((v1-3 (new 'stack-no-clear 'vehicle-control-point))) @@ -739,7 +725,7 @@ (none) ) -(defmethod vehicle-guard-method-155 vehicle-guard ((this vehicle-guard) (arg0 vector) (arg1 vector)) +(defmethod vehicle-guard-method-155 ((this vehicle-guard) (arg0 vector) (arg1 vector)) (cond (#f (let ((s5-0 (new 'stack-no-clear 'traj3d-params))) @@ -811,7 +797,7 @@ (none) ) -(defmethod vehicle-method-134 vehicle-guard ((this vehicle-guard) (arg0 process)) +(defmethod vehicle-method-134 ((this vehicle-guard) (arg0 process)) "Stubbed" (set! (-> this pursuit-target) (process->handle arg0)) (logior! (-> this flags) (rigid-body-object-flag alert)) @@ -821,7 +807,7 @@ ) ;; WARN: disable def twice: 112. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod rigid-body-object-method-46 vehicle-guard ((this vehicle-guard) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 ((this vehicle-guard) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('impact-impulse) (let ((s5-1 (the-as matrix (-> arg3 param 0)))) @@ -901,7 +887,7 @@ ) ) -(defmethod vehicle-method-137 vehicle-guard ((this vehicle-guard) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-137 ((this vehicle-guard) (arg0 traffic-object-spawn-params)) (vehicle-rider-spawn this crimson-guard-rider arg0) 0 (none) @@ -948,7 +934,7 @@ ) ) -(defmethod alloc-and-init-rigid-body-control vehicle-guard ((this vehicle-guard) (arg0 rigid-body-vehicle-constants)) +(defmethod alloc-and-init-rigid-body-control ((this vehicle-guard) (arg0 rigid-body-vehicle-constants)) (let ((t9-0 (method-of-type vehicle alloc-and-init-rigid-body-control))) (t9-0 this arg0) ) @@ -962,7 +948,7 @@ ) ;; WARN: Return type mismatch traffic-guard-type-settings vs none. -(defmethod vehicle-method-82 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-method-82 ((this vehicle-guard)) (let ((t9-0 (method-of-type vehicle vehicle-method-82))) (t9-0 this) ) @@ -972,7 +958,7 @@ (none) ) -(defmethod vehicle-method-128 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-method-128 ((this vehicle-guard)) (if (not (-> this minimap)) (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 14) (the-as int #f) (the-as vector #t) 0)) ) @@ -980,7 +966,7 @@ (none) ) -(defmethod vehicle-method-127 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-method-127 ((this vehicle-guard)) (when (-> this minimap) (logior! (-> this minimap flags) (minimap-flag fade-out)) (set! (-> this minimap) #f) @@ -989,7 +975,7 @@ (none) ) -(defmethod vehicle-method-129 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-method-129 ((this vehicle-guard)) (when (-> this minimap) (logior! (-> this minimap flags) (minimap-flag fade-out)) (set! (-> this minimap) #f) @@ -999,7 +985,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod vehicle-method-130 vehicle-guard ((this vehicle-guard) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-130 ((this vehicle-guard) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((9) (vehicle-method-128 this) @@ -1014,7 +1000,7 @@ (none) ) -(defmethod vehicle-guard-method-157 vehicle-guard ((this vehicle-guard) (arg0 vehicle-guard-target-data)) +(defmethod vehicle-guard-method-157 ((this vehicle-guard) (arg0 vehicle-guard-target-data)) (local-vars (v1-11 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1046,7 +1032,7 @@ ) ) -(defmethod vehicle-guard-method-156 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-guard-method-156 ((this vehicle-guard)) (let ((f30-0 (seconds-per-frame))) (seek! (-> this controls throttle) 0.0 (* 4.0 f30-0)) (+! (-> this controls brake) (* (- 1.0 (-> this controls brake)) (fmin 1.0 (* 8.0 f30-0)))) @@ -1079,7 +1065,7 @@ (none) ) -(defmethod vehicle-guard-method-154 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-guard-method-154 ((this vehicle-guard)) (if (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) (rigid-body-object-method-38 this) ) @@ -1105,7 +1091,7 @@ (none) ) -(defmethod vehicle-guard-method-158 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-guard-method-158 ((this vehicle-guard)) (vehicle-guard-method-150 this) (let ((s5-0 (new 'stack-no-clear 'vehicle-guard-target-data))) (vehicle-guard-method-151 this s5-0) @@ -1134,7 +1120,7 @@ (none) ) -(defmethod vehicle-method-94 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-method-94 ((this vehicle-guard)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-h.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-h.gc index 5705a27afc3..10d93b5bdb2 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-h.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-h.gc @@ -58,416 +58,387 @@ ;; DECOMP BEGINS (deftype vehicle-lookup-info (structure) - ((turn-radius meters :offset-assert 0) - (throttle-turning float :offset-assert 4) - (throttle-straight float :offset-assert 8) + ((turn-radius meters) + (throttle-turning float) + (throttle-straight float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype vehicle-control-point (structure) - ((local-pos vector :inline :offset-assert 0) - (normal vector :inline :offset-assert 16) + ((local-pos vector :inline) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype vehicle-section-info (structure) - ((damage-seg-array uint64 3 :offset-assert 0) - (damage-seg-count int8 :offset-assert 24) + ((damage-seg-array uint64 3) + (damage-seg-count int8) ) - :method-count-assert 9 - :size-assert #x19 - :flag-assert #x900000019 ) (deftype vehicle-seat-info (structure) - ((data uint8 16 :offset-assert 0) - (position vector :inline :offset 0) - (pos-x float :offset 0) - (pos-y float :offset 4) - (pos-z float :offset 8) - (angle int16 :offset 12) - (flags uint8 :offset 14) + ((data uint8 16) + (position vector :inline :overlay-at (-> data 0)) + (pos-x float :overlay-at (-> data 0)) + (pos-y float :overlay-at (-> data 4)) + (pos-z float :overlay-at (-> data 8)) + (angle int16 :overlay-at (-> data 12)) + (flags uint8 :overlay-at (-> data 14)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype vehicle-explosion-info (joint-exploder-static-params) - ((skel skeleton-group :offset-assert 16) - (skel-name string :offset-assert 20) - (anim int32 :offset-assert 24) + ((skel skeleton-group) + (skel-name string) + (anim int32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype vehicle-grab-rail-info (structure) - ((local-pos vector 2 :inline :offset-assert 0) - (normal vector :inline :offset-assert 32) + ((local-pos vector 2 :inline) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype rigid-body-vehicle-constants (rigid-body-object-constants) - ((flags uint32 :offset-assert 208) - (object-type uint8 :offset-assert 212) - (guard-type uint8 :offset-assert 213) - (max-engine-thrust meters :offset-assert 216) - (inv-max-engine-thrust float :offset-assert 220) - (engine-response-rate float :offset-assert 224) - (engine-intake-factor float :offset-assert 228) - (brake-factor float :offset-assert 232) - (turbo-boost-factor float :offset-assert 236) - (max-xz-speed meters :offset-assert 240) - (ground-probe-distance meters :offset-assert 244) - (ground-probe-offset meters :offset-assert 248) - (cos-ground-effect-angle float :offset-assert 252) - (spring-lift-factor float :offset-assert 256) - (air-steering-factor float :offset-assert 260) - (air-drag-factor float :offset-assert 264) - (steering-fin-angle float :offset-assert 268) - (steering-thruster-factor float :offset-assert 272) - (steering-thruster-max-gain float :offset-assert 276) - (steering-thruster-half-gain-speed meters :offset-assert 280) - (tire-steering-angle float :offset-assert 284) - (tire-friction-factor float :offset-assert 288) - (tire-static-friction float :offset-assert 292) - (tire-static-friction-speed meters :offset-assert 296) - (tire-dynamic-friction float :offset-assert 300) - (tire-dynamic-friction-speed meters :offset-assert 304) - (tire-inv-max-friction-speed float :offset-assert 308) - (airfoil-factor float :offset-assert 312) - (drag-force-factor float :offset-assert 316) - (speed-scrubbing-drag float :offset-assert 320) - (speed-limiting-drag float :offset-assert 324) - (pitch-control-factor float :offset-assert 328) - (roll-control-factor float :offset-assert 332) - (roll-angle float :offset-assert 336) - (jump-thrust-factor float :offset-assert 340) - (buoyancy-factor float :offset-assert 344) - (player-weight float :offset-assert 348) - (player-shift-x meters :offset-assert 352) - (player-shift-z meters :offset-assert 356) - (target-speed-offset meters :offset-assert 360) - (turning-accel meters :offset-assert 364) - (toughness-factor float :offset-assert 368) - (damage-factor float :offset-assert 372) - (camera-string-min-height meters :offset-assert 376) - (camera-string-max-height meters :offset-assert 380) - (camera-string-min-length meters :offset-assert 384) - (camera-string-max-length meters :offset-assert 388) - (camera-min-fov float :offset-assert 392) - (camera-max-fov float :offset-assert 396) - (camera-head-offset float :offset-assert 400) - (camera-foot-offset float :offset-assert 404) - (camera-normal-max-angle-offset float :offset-assert 408) - (camera-air-max-angle-offset float :offset-assert 412) - (camera-max-lookaround-speed float :offset-assert 416) - (seat-count int8 :offset-assert 420) - (section-count int8 :offset-assert 421) - (rider-stance uint8 :offset-assert 422) - (grab-rail-count int8 :offset-assert 423) - (grab-rail-array (inline-array vehicle-grab-rail-info) :offset-assert 424) - (seat-array vehicle-seat-info 4 :inline :offset-assert 432) - (rider-hand-offset vector 2 :inline :offset-assert 496) - (section-array vehicle-section-info 4 :inline :offset-assert 528) - (section-bike-front vehicle-section-info :inline :offset 528) - (section-bike-rear vehicle-section-info :inline :offset 560) - (section-car-front-left vehicle-section-info :inline :offset 528) - (section-car-rear-left vehicle-section-info :inline :offset 560) - (section-car-front-right vehicle-section-info :inline :offset 592) - (section-car-rear-right vehicle-section-info :inline :offset 624) - (explosion vehicle-explosion-info :offset-assert 656) - (engine-pitch-scale float :offset-assert 660) - (engine-pitch-offset float :offset-assert 664) - (engine-pitch-mod-amp float :offset-assert 668) - (engine-sound-select int8 :offset-assert 672) - (engine-sound sound-name :offset-assert 688) - (thrust-sound sound-name :offset-assert 704) - (scrape-sound sound-name :offset-assert 720) - (glance-sound sound-name :offset-assert 736) - (impact-sound sound-name :offset-assert 752) - (extra-sound sound-name :offset-assert 768) - (explosion-part int32 :offset-assert 784) - (headlight-count int8 :offset-assert 788) - (taillight-count int8 :offset-assert 789) - (thruster-flame-width meters :offset-assert 792) - (thruster-flame-length meters :offset-assert 796) - (thruster-local-pos vector 2 :inline :offset-assert 800) - (exhaust-local-pos vector 2 :inline :offset-assert 832) - (exhaust-local-dir vector 2 :inline :offset-assert 864) - (smoke-local-pos vector 2 :inline :offset-assert 896) - (smoke-local-vel vector 2 :inline :offset-assert 928) - (headlight-local-pos vector 3 :inline :offset-assert 960) - (taillight-local-pos vector 2 :inline :offset-assert 1008) - (lift-thruster-count int8 :offset-assert 1040) - (roll-thruster-count int8 :offset-assert 1041) - (steering-thruster-count int8 :offset-assert 1042) - (stabilizer-count int8 :offset-assert 1043) - (inv-lift-thruster-count float :offset-assert 1044) - (pad int8 8 :offset-assert 1048) - (lift-thruster-array vehicle-control-point 2 :inline :offset-assert 1056) - (roll-thruster-array vehicle-control-point 2 :inline :offset-assert 1120) - (steering-thruster-array vehicle-control-point 2 :inline :offset-assert 1184) - (stabilizer-array vehicle-control-point 6 :inline :offset-assert 1248) - (engine-thrust-local-pos vector :inline :offset-assert 1440) - (brake-local-pos vector :inline :offset-assert 1456) - (particle-system-2d basic :offset-assert 1472) - (particle-system-3d basic :offset-assert 1476) - (part-thruster basic :offset-assert 1480) - (part-thruster-scale-x sp-field-init-spec :offset-assert 1484) - (part-thruster-scale-y sp-field-init-spec :offset-assert 1488) - (part-quat quaternion :offset-assert 1492) - (part-vel vector :offset-assert 1496) - (color-option-count int8 :offset-assert 1500) - (color-option-select int8 :offset-assert 1501) - (color-option-array (inline-array vector) :offset-assert 1504) - (sample-dir vector :inline :offset-assert 1520) - (sample-time time-frame :offset-assert 1536) - (sample-index int32 :offset-assert 1544) + ((flags uint32) + (object-type uint8) + (guard-type uint8) + (max-engine-thrust meters) + (inv-max-engine-thrust float) + (engine-response-rate float) + (engine-intake-factor float) + (brake-factor float) + (turbo-boost-factor float) + (max-xz-speed meters) + (ground-probe-distance meters) + (ground-probe-offset meters) + (cos-ground-effect-angle float) + (spring-lift-factor float) + (air-steering-factor float) + (air-drag-factor float) + (steering-fin-angle float) + (steering-thruster-factor float) + (steering-thruster-max-gain float) + (steering-thruster-half-gain-speed meters) + (tire-steering-angle float) + (tire-friction-factor float) + (tire-static-friction float) + (tire-static-friction-speed meters) + (tire-dynamic-friction float) + (tire-dynamic-friction-speed meters) + (tire-inv-max-friction-speed float) + (airfoil-factor float) + (drag-force-factor float) + (speed-scrubbing-drag float) + (speed-limiting-drag float) + (pitch-control-factor float) + (roll-control-factor float) + (roll-angle float) + (jump-thrust-factor float) + (buoyancy-factor float) + (player-weight float) + (player-shift-x meters) + (player-shift-z meters) + (target-speed-offset meters) + (turning-accel meters) + (toughness-factor float) + (damage-factor float) + (camera-string-min-height meters) + (camera-string-max-height meters) + (camera-string-min-length meters) + (camera-string-max-length meters) + (camera-min-fov float) + (camera-max-fov float) + (camera-head-offset float) + (camera-foot-offset float) + (camera-normal-max-angle-offset float) + (camera-air-max-angle-offset float) + (camera-max-lookaround-speed float) + (seat-count int8) + (section-count int8) + (rider-stance uint8) + (grab-rail-count int8) + (grab-rail-array (inline-array vehicle-grab-rail-info)) + (seat-array vehicle-seat-info 4 :inline) + (rider-hand-offset vector 2 :inline) + (section-array vehicle-section-info 4 :inline) + (section-bike-front vehicle-section-info :inline :overlay-at (-> section-array 0)) + (section-bike-rear vehicle-section-info :inline :offset 560) + (section-car-front-left vehicle-section-info :inline :overlay-at (-> section-array 0)) + (section-car-rear-left vehicle-section-info :inline :overlay-at section-bike-rear) + (section-car-front-right vehicle-section-info :inline :offset 592) + (section-car-rear-right vehicle-section-info :inline :offset 624) + (explosion vehicle-explosion-info) + (engine-pitch-scale float) + (engine-pitch-offset float) + (engine-pitch-mod-amp float) + (engine-sound-select int8) + (engine-sound sound-name) + (thrust-sound sound-name) + (scrape-sound sound-name) + (glance-sound sound-name) + (impact-sound sound-name) + (extra-sound sound-name) + (explosion-part int32) + (headlight-count int8) + (taillight-count int8) + (thruster-flame-width meters) + (thruster-flame-length meters) + (thruster-local-pos vector 2 :inline) + (exhaust-local-pos vector 2 :inline) + (exhaust-local-dir vector 2 :inline) + (smoke-local-pos vector 2 :inline) + (smoke-local-vel vector 2 :inline) + (headlight-local-pos vector 3 :inline) + (taillight-local-pos vector 2 :inline) + (lift-thruster-count int8) + (roll-thruster-count int8) + (steering-thruster-count int8) + (stabilizer-count int8) + (inv-lift-thruster-count float) + (pad int8 8) + (lift-thruster-array vehicle-control-point 2 :inline) + (roll-thruster-array vehicle-control-point 2 :inline) + (steering-thruster-array vehicle-control-point 2 :inline) + (stabilizer-array vehicle-control-point 6 :inline) + (engine-thrust-local-pos vector :inline) + (brake-local-pos vector :inline) + (particle-system-2d basic) + (particle-system-3d basic) + (part-thruster basic) + (part-thruster-scale-x sp-field-init-spec) + (part-thruster-scale-y sp-field-init-spec) + (part-quat quaternion) + (part-vel vector) + (color-option-count int8) + (color-option-select int8) + (color-option-array (inline-array vector)) + (sample-dir vector :inline) + (sample-time time-frame) + (sample-index int32) ) - :method-count-assert 11 - :size-assert #x60c - :flag-assert #xb0000060c (:methods - (rigid-body-vehicle-constants-method-9 (_type_) none 9) - (rigid-body-vehicle-constants-method-10 () none 10) + (rigid-body-vehicle-constants-method-9 (_type_) none) + (rigid-body-vehicle-constants-method-10 (_type_) none) ) ) (deftype vehicle-controller (structure) - ((flags vehicle-controller-flag :offset-assert 0) - (traffic traffic-engine :offset-assert 4) - (branch nav-branch :offset-assert 8) - (target-speed-offset meters :offset-assert 12) - (target-speed meters :offset-assert 16) - (choose-branch-callback (function vehicle-controller vehicle nav-branch) :offset-assert 20) - (turn-accel meters :offset-assert 24) - (max-turn-speed meters :offset-assert 28) - (path-prev-point vector :inline :offset-assert 32) - (turn-enter-point vector :inline :offset-assert 48) - (turn-exit-point vector :inline :offset-assert 64) - (path-dest-point vector :inline :offset 64) - (turn-enter-dir vector :inline :offset-assert 80) - (turn-exit-dir vector :inline :offset-assert 96) - (dest-circle vector :inline :offset-assert 112) - (target-point vector :inline :offset-assert 128) + ((flags vehicle-controller-flag) + (traffic traffic-engine) + (branch nav-branch) + (target-speed-offset meters) + (target-speed meters) + (choose-branch-callback (function vehicle-controller vehicle nav-branch)) + (turn-accel meters) + (max-turn-speed meters) + (path-prev-point vector :inline) + (turn-enter-point vector :inline) + (turn-exit-point vector :inline) + (path-dest-point vector :inline :overlay-at turn-exit-point) + (turn-enter-dir vector :inline) + (turn-exit-dir vector :inline) + (dest-circle vector :inline) + (target-point vector :inline) ) - :method-count-assert 22 - :size-assert #x90 - :flag-assert #x1600000090 (:methods - (vehicle-controller-method-9 (_type_) none 9) - (vehicle-controller-method-10 (_type_ traffic-tracker) none 10) - (vehicle-controller-method-11 (_type_) none 11) - (vehicle-controller-method-12 (_type_ rigid-body-vehicle-constants vector float int float) none :behavior vehicle 12) - (vehicle-controller-method-13 (_type_ nav-branch vector) none 13) - (vehicle-controller-method-14 (_type_ vehicle) nav-branch 14) - (vehicle-controller-method-15 (_type_) nav-branch 15) - (vehicle-controller-method-16 (_type_ vector vector) none 16) - (draw-debug-info (_type_) none 17) - (vehicle-controller-method-18 (_type_ vector vector vehicle float) none 18) - (vehicle-controller-method-19 (_type_ vector object vector vector) none 19) - (vehicle-controller-method-20 (_type_ object float) none 20) - (vehicle-controller-method-21 (_type_) none 21) + (vehicle-controller-method-9 (_type_) none) + (vehicle-controller-method-10 (_type_ traffic-tracker) none) + (vehicle-controller-method-11 (_type_) none) + (vehicle-controller-method-12 (_type_ rigid-body-vehicle-constants vector float int float) none :behavior vehicle) + (vehicle-controller-method-13 (_type_ nav-branch vector) none) + (vehicle-controller-method-14 (_type_ vehicle) nav-branch) + (vehicle-controller-method-15 (_type_) nav-branch) + (vehicle-controller-method-16 (_type_ vector vector) none) + (draw-debug-info (_type_) none) + (vehicle-controller-method-18 (_type_ vector vector vehicle float) none) + (vehicle-controller-method-19 (_type_ vector object vector vector) none) + (vehicle-controller-method-20 (_type_ object float) none) + (vehicle-controller-method-21 (_type_) none) ) ) (deftype vehicle-section (structure) - ((damage float :offset-assert 0) + ((damage float) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype vehicle (rigid-body-object) - ((self vehicle :override) - (info rigid-body-vehicle-constants :override) - (pad uint32 2 :offset-assert 272) - (vehicle-jkhn1b23jn1 int64 :offset-assert 280) - (controls vehicle-controls :inline :offset-assert 288) - (prev-controls vehicle-controls :inline :offset-assert 304) - (up-dir vector :inline :offset-assert 320) - (jump-time float :offset-assert 336) - (jump-thrust float :offset-assert 340) - (engine-thrust float :offset-assert 344) - (engine-power-factor float :offset-assert 348) - (force-scale float :offset-assert 352) - (target-distance2 meters :offset-assert 356) - (pad0 uint32 :offset-assert 360) - (target-acceleration vector :inline :offset-assert 368) - (impact-pos vector :inline :offset-assert 384) - (lin-acceleration vector :inline :offset-assert 400) - (hit-points float :offset-assert 416) - (damage-factor float :offset-assert 420) - (crash-level int8 :offset-assert 424) - (force-level int8 :offset-assert 425) - (traffic-hash-id int8 :offset-assert 426) - (traffic-priority-id int8 :offset-assert 427) - (power-fluctuation-factor float :offset-assert 428) - (power-level float :offset-assert 432) - (flight-level-index int8 :offset-assert 436) - (flight-level-index-prev int8 :offset-assert 437) - (overlap-player-counter uint8 :offset-assert 438) - (physics-counter uint8 :offset-assert 439) - (flight-level float :offset-assert 440) - (brake-factor float :offset-assert 444) - (cam-speed-interp float :offset-assert 448) - (camera-dist2 float :offset-assert 452) - (player-dist2 float :offset-assert 456) - (bound-radius float :offset-assert 460) - (rider-array handle 4 :offset-assert 464) - (lift-thrust float 2 :offset-assert 496) - (roll-thrust float 2 :offset-assert 504) - (sent-attack-time time-frame :offset-assert 512) - (air-time time-frame :offset-assert 520) - (turn-time time-frame :offset-assert 528) - (crash-time time-frame :offset-assert 536) - (transition-time time-frame :offset-assert 544) - (transition-end-time time-frame :offset-assert 552) - (turbo-boost-time time-frame :offset-assert 560) - (crash-duration uint16 :offset-assert 568) - (turbo-boost-duration uint16 :offset-assert 570) - (turbo-boost-factor float :offset-assert 572) - (crash-impulse float :offset-assert 576) - (water-height float :offset-assert 580) - (lights-factor float :offset-assert 584) - (outgoing-attack-id uint32 :offset-assert 588) - (scrape-sound-id sound-id :offset-assert 592) - (engine-sound-id sound-id :offset-assert 596) - (thrust-sound-id sound-id :offset-assert 600) - (roll-sound-id sound-id :offset-assert 604) - (damage-pop-sound-id sound-id :offset-assert 608) - (damage-zap-sound-id sound-id :offset-assert 612) - (extra-sound-id sound-id :offset-assert 616) - (fog-fade float :offset-assert 620) - (scrape-sound-envelope float :offset-assert 624) - (engine-sound-envelope float :offset-assert 628) - (engine-sound-factor float :offset-assert 632) - (sputter-sound-envelope float :offset-assert 636) - (rudder-sound-envelope float :offset-assert 640) - (fins-sound-envelope float :offset-assert 644) - (exhaust-part-accum basic 2 :offset-assert 648) - (smoke-part-accum basic 2 :offset-assert 656) - (controller vehicle-controller :inline :offset-assert 672) - (section-array vehicle-section 4 :inline :offset-assert 816) + ((self vehicle :override) + (info rigid-body-vehicle-constants :override) + (pad uint32 2) + (vehicle-jkhn1b23jn1 int64) + (controls vehicle-controls :inline) + (prev-controls vehicle-controls :inline) + (up-dir vector :inline) + (jump-time float) + (jump-thrust float) + (engine-thrust float) + (engine-power-factor float) + (force-scale float) + (target-distance2 meters) + (pad0 uint32) + (target-acceleration vector :inline) + (impact-pos vector :inline) + (lin-acceleration vector :inline) + (hit-points float) + (damage-factor float) + (crash-level int8) + (force-level int8) + (traffic-hash-id int8) + (traffic-priority-id int8) + (power-fluctuation-factor float) + (power-level float) + (flight-level-index int8) + (flight-level-index-prev int8) + (overlap-player-counter uint8) + (physics-counter uint8) + (flight-level float) + (brake-factor float) + (cam-speed-interp float) + (camera-dist2 float) + (player-dist2 float) + (bound-radius float) + (rider-array handle 4) + (lift-thrust float 2) + (roll-thrust float 2) + (sent-attack-time time-frame) + (air-time time-frame) + (turn-time time-frame) + (crash-time time-frame) + (transition-time time-frame) + (transition-end-time time-frame) + (turbo-boost-time time-frame) + (crash-duration uint16) + (turbo-boost-duration uint16) + (turbo-boost-factor float) + (crash-impulse float) + (water-height float) + (lights-factor float) + (outgoing-attack-id uint32) + (scrape-sound-id sound-id) + (engine-sound-id sound-id) + (thrust-sound-id sound-id) + (roll-sound-id sound-id) + (damage-pop-sound-id sound-id) + (damage-zap-sound-id sound-id) + (extra-sound-id sound-id) + (fog-fade float) + (scrape-sound-envelope float) + (engine-sound-envelope float) + (engine-sound-factor float) + (sputter-sound-envelope float) + (rudder-sound-envelope float) + (fins-sound-envelope float) + (exhaust-part-accum basic 2) + (smoke-part-accum basic 2) + (controller vehicle-controller :inline) + (section-array vehicle-section 4 :inline) ) - :heap-base #x2f0 - :method-count-assert 144 - :size-assert #x370 - :flag-assert #x9002f00370 + (:state-methods + inactive + waiting + vehicle-state-55 + vehicle-state-56 + player-control + crash + explode + die + measure-control-parameters + ) (:methods - (alloc-and-init-rigid-body-control (_type_ rigid-body-vehicle-constants) none :replace 31) - (inactive () _type_ :state 53) - (waiting () _type_ :state 54) - (vehicle-method-55 () _type_ :state 55) - (vehicle-method-56 () _type_ :state 56) - (player-control () _type_ :state 57) - (crash () _type_ :state 58) - (explode () _type_ :state 59) - (die () _type_ :state 60) - (measure-control-parameters () _type_ :state 61) - (vehicle-method-62 (_type_ float) none 62) - (vehicle-method-63 (_type_ float) none 63) - (vehicle-method-64 () none 64) - (start-jump (_type_) none 65) - (vehicle-method-66 (_type_) none 66) - (get-seat-count (_type_) int 67) - (compute-seat-position (_type_ vector int) none 68) - (get-rider-in-seat (_type_ int) process 69) - (vehicle-method-70 (_type_) process 70) - (put-rider-in-seat (_type_ int process-focusable) none 71) - (vehicle-method-72 (_type_) uint 72) - (get-best-seat-for-vehicle (_type_ vector int int) int 73) - (remove-rider (_type_ process) none 74) - (vehicle-method-75 (_type_) float 75) - (vehicle-method-76 (_type_ int uint) none 76) - (vehicle-method-77 (_type_) none 77) - (vehicle-method-78 (_type_ int) none 78) - (vehicle-method-79 (_type_) none 79) - (vehicle-method-80 (_type_) none 80) - (vehicle-method-81 (_type_) none 81) - (vehicle-method-82 (_type_) none 82) - (vehicle-method-83 (_type_) none 83) - (draw-thruster (_type_ vector vector float float) none 84) - (draw-thrusters (_type_) none 85) - (update-joint-mods (_type_) none 86) - (vehicle-method-87 (_type_) none 87) - (vehicle-method-88 (_type_) none 88) - (vehicle-method-89 (_type_) none 89) - (vehicle-method-90 (_type_) none 90) - (vehicle-method-91 (_type_) none 91) - (vehicle-method-92 (_type_) none 92) - (vehicle-method-93 (_type_) none 93) - (vehicle-method-94 (_type_) none 94) - (vehicle-method-95 (_type_ vector) none 95) - (vehicle-method-96 (_type_) none 96) - (vehicle-method-97 (_type_) none 97) - (vehicle-method-98 (_type_ float) none 98) - (vehicle-method-99 (_type_ float) none 99) - (vehicle-method-100 (_type_ float vehicle-physics-work) none 100) - (vehicle-method-101 (_type_) none 101) - (vehicle-method-102 (_type_) none 102) - (vehicle-method-103 (_type_) none 103) - (vehicle-method-104 (_type_) none 104) - (vehicle-method-105 (_type_) symbol 105) - (vehicle-method-106 (_type_) none 106) - (vehicle-method-107 (_type_) none 107) - (vehicle-method-108 (_type_) none 108) - (vehicle-method-109 (_type_) none 109) - (vehicle-method-110 (_type_) none 110) - (vehicle-method-111 (_type_ object target) none 111) - (decrease-traffic-alert-level (_type_ int) int 112) - (vehicle-method-113 (_type_) none 113) - (vehicle-method-114 (_type_) none 114) - (vehicle-method-115 (_type_ vector) none 115) - (vehicle-method-116 (_type_ (pointer vehicle-controls)) none 116) - (vehicle-method-117 (_type_ vector int int) none 117) - (vehicle-method-118 (_type_ int) none 118) - (vehicle-method-119 (_type_) none 119) - (vehicle-method-120 (_type_) none 120) - (vehicle-method-121 (_type_) none 121) - (vehicle-method-122 (_type_) none 122) - (vehicle-method-123 (_type_) none 123) - (vehicle-method-124 (_type_) none 124) - (vehicle-method-125 (_type_ float) none 125) - (vehicle-method-126 (_type_ float) none 126) - (vehicle-method-127 (_type_) none 127) - (vehicle-method-128 (_type_) none 128) - (vehicle-method-129 (_type_) none 129) - (vehicle-method-130 (_type_ traffic-object-spawn-params) none 130) - (vehicle-method-131 (_type_) none 131) - (vehicle-method-132 (_type_) none 132) - (check-player-get-on (_type_) none 133) - (vehicle-method-134 (_type_ process) none 134) - (vehicle-method-135 (_type_ traffic-object-spawn-params) none 135) - (vehicle-method-136 (_type_ traffic-object-spawn-params) none 136) - (vehicle-method-137 (_type_ traffic-object-spawn-params) none 137) - (vehicle-method-138 (_type_) none 138) - (vehicle-method-139 (_type_) none 139) - (vehicle-method-140 (_type_) none 140) - (vehicle-method-141 (_type_) none 141) - (vehicle-method-142 (_type_) none 142) - (vehicle-method-143 (_type_) none 143) + (alloc-and-init-rigid-body-control (_type_ rigid-body-vehicle-constants) none :replace) + (vehicle-method-62 (_type_ float) none) + (vehicle-method-63 (_type_ float) none) + (vehicle-method-64 () none) + (start-jump (_type_) none) + (vehicle-method-66 (_type_) none) + (get-seat-count (_type_) int) + (compute-seat-position (_type_ vector int) none) + (get-rider-in-seat (_type_ int) process) + (vehicle-method-70 (_type_) process) + (put-rider-in-seat (_type_ int process-focusable) none) + (vehicle-method-72 (_type_) uint) + (get-best-seat-for-vehicle (_type_ vector int int) int) + (remove-rider (_type_ process) none) + (vehicle-method-75 (_type_) float) + (vehicle-method-76 (_type_ int uint) none) + (vehicle-method-77 (_type_) none) + (vehicle-method-78 (_type_ int) none) + (vehicle-method-79 (_type_) none) + (vehicle-method-80 (_type_) none) + (vehicle-method-81 (_type_) none) + (vehicle-method-82 (_type_) none) + (vehicle-method-83 (_type_) none) + (draw-thruster (_type_ vector vector float float) none) + (draw-thrusters (_type_) none) + (update-joint-mods (_type_) none) + (vehicle-method-87 (_type_) none) + (vehicle-method-88 (_type_) none) + (vehicle-method-89 (_type_) none) + (vehicle-method-90 (_type_) none) + (vehicle-method-91 (_type_) none) + (vehicle-method-92 (_type_) none) + (vehicle-method-93 (_type_) none) + (vehicle-method-94 (_type_) none) + (vehicle-method-95 (_type_ vector) none) + (vehicle-method-96 (_type_) none) + (vehicle-method-97 (_type_) none) + (vehicle-method-98 (_type_ float) none) + (vehicle-method-99 (_type_ float) none) + (vehicle-method-100 (_type_ float vehicle-physics-work) none) + (vehicle-method-101 (_type_) none) + (vehicle-method-102 (_type_) none) + (vehicle-method-103 (_type_) none) + (vehicle-method-104 (_type_) none) + (vehicle-method-105 (_type_) symbol) + (vehicle-method-106 (_type_) none) + (vehicle-method-107 (_type_) none) + (vehicle-method-108 (_type_) none) + (vehicle-method-109 (_type_) none) + (vehicle-method-110 (_type_) none) + (vehicle-method-111 (_type_ object target) none) + (decrease-traffic-alert-level (_type_ int) int) + (vehicle-method-113 (_type_) none) + (vehicle-method-114 (_type_) none) + (vehicle-method-115 (_type_ vector) none) + (vehicle-method-116 (_type_ (pointer vehicle-controls)) none) + (vehicle-method-117 (_type_ vector int int) none) + (vehicle-method-118 (_type_ int) none) + (vehicle-method-119 (_type_) none) + (vehicle-method-120 (_type_) none) + (vehicle-method-121 (_type_) none) + (vehicle-method-122 (_type_) none) + (vehicle-method-123 (_type_) none) + (vehicle-method-124 (_type_) none) + (vehicle-method-125 (_type_ float) none) + (vehicle-method-126 (_type_ float) none) + (vehicle-method-127 (_type_) none) + (vehicle-method-128 (_type_) none) + (vehicle-method-129 (_type_) none) + (vehicle-method-130 (_type_ traffic-object-spawn-params) none) + (vehicle-method-131 (_type_) none) + (vehicle-method-132 (_type_) none) + (check-player-get-on (_type_) none) + (vehicle-method-134 (_type_ process) none) + (vehicle-method-135 (_type_ traffic-object-spawn-params) none) + (vehicle-method-136 (_type_ traffic-object-spawn-params) none) + (vehicle-method-137 (_type_ traffic-object-spawn-params) none) + (vehicle-method-138 (_type_) none) + (vehicle-method-139 (_type_) none) + (vehicle-method-140 (_type_) none) + (vehicle-method-141 (_type_) none) + (vehicle-method-142 (_type_) none) + (vehicle-method-143 (_type_) none) ) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc index aeda59fddb3..a4da63f9572 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod vehicle-method-99 vehicle ((this vehicle) (arg0 float)) +(defmethod vehicle-method-99 ((this vehicle) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'vehicle-grab-rail-info)) (s3-0 (-> this root root-prim)) (s2-0 1) @@ -83,51 +83,45 @@ ) (deftype vehicle-probe-work (structure) - ((local-pos vector :inline :offset-assert 0) - (local-normal vector :inline :offset-assert 16) - (world-pos vector :inline :offset-assert 32) - (world-normal vector :inline :offset-assert 48) - (probe-pos vector :inline :offset-assert 64) - (ground-pos vector :inline :offset-assert 80) - (ground-normal vector :inline :offset-assert 96) - (velocity vector :inline :offset-assert 112) - (tire-force vector :inline :offset-assert 128) - (wheel-axis vector :inline :offset-assert 144) + ((local-pos vector :inline) + (local-normal vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (probe-pos vector :inline) + (ground-pos vector :inline) + (ground-normal vector :inline) + (velocity vector :inline) + (tire-force vector :inline) + (wheel-axis vector :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) (deftype vehicle-physics-work (structure) - ((mat matrix :inline :offset-assert 0) - (force vector :inline :offset-assert 64) - (velocity vector :inline :offset-assert 80) - (world-pos vector :inline :offset-assert 96) - (world-normal vector :inline :offset-assert 112) - (local-pos vector :inline :offset-assert 128) - (steering-axis vector :inline :offset-assert 144) - (lift-dir vector :inline :offset-assert 160) - (normal vector :inline :offset-assert 176) - (tmp vector :inline :offset-assert 192) - (p-body vector :inline :offset-assert 208) - (axis vector :inline :offset-assert 224) - (dir vector :inline :offset-assert 240) - (ground-normal vector :inline :offset-assert 256) - (impulse float :offset-assert 272) - (vel-dot-norm float :offset-assert 276) - (friction-coef float :offset-assert 280) - (speed-factor float :offset-assert 284) - (probe-work-array vehicle-probe-work 2 :inline :offset-assert 288) + ((mat matrix :inline) + (force vector :inline) + (velocity vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (local-pos vector :inline) + (steering-axis vector :inline) + (lift-dir vector :inline) + (normal vector :inline) + (tmp vector :inline) + (p-body vector :inline) + (axis vector :inline) + (dir vector :inline) + (ground-normal vector :inline) + (impulse float) + (vel-dot-norm float) + (friction-coef float) + (speed-factor float) + (probe-work-array vehicle-probe-work 2 :inline) ) - :method-count-assert 9 - :size-assert #x260 - :flag-assert #x900000260 ) -(defmethod vehicle-method-100 vehicle ((this vehicle) (arg0 float) (arg1 vehicle-physics-work)) +(defmethod vehicle-method-100 ((this vehicle) (arg0 float) (arg1 vehicle-physics-work)) (local-vars (v1-81 float) (v1-184 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -476,7 +470,7 @@ ) ) -(defmethod rigid-body-object-method-29 vehicle ((this vehicle) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this vehicle) (arg0 float)) (local-vars (sv-624 float) (sv-720 float) (sv-724 float)) (rlet ((vf0 :class vf)) (init-vf0-vector) @@ -806,12 +800,12 @@ ) ) -(defmethod vehicle-method-125 vehicle ((this vehicle) (arg0 float)) +(defmethod vehicle-method-125 ((this vehicle) (arg0 float)) (rigid-body-object-method-29 this arg0) (none) ) -(defmethod vehicle-method-126 vehicle ((this vehicle) (arg0 float)) +(defmethod vehicle-method-126 ((this vehicle) (arg0 float)) (rigid-body-object-method-29 this arg0) (none) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc index b597fe7c9b7..72c0db0b5e7 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc @@ -8,37 +8,35 @@ ;; DECOMP BEGINS (deftype vehicle-rider (process-focusable) - ((parent (pointer vehicle) :override) - (flags uint8 :offset-assert 204) - (riding-anim int32 :offset-assert 208) - (anim-t float :offset-assert 212) - (anim-speed float :offset-assert 216) - (seat-index int8 :offset-assert 220) + ((parent (pointer vehicle) :override) + (flags uint8) + (riding-anim int32) + (anim-t float) + (anim-speed float) + (seat-index int8) ) - :heap-base #x60 - :method-count-assert 36 - :size-assert #xdd - :flag-assert #x24006000dd + (:state-methods + inactive + active + taunt + got-passed + ) (:methods - (inactive () _type_ :state 27) - (active () _type_ :state 28) - (taunt () _type_ :state 29) - (got-passed () _type_ :state 30) - (initialize-collision (_type_) none 31) - (vehicle-rider-method-32 (_type_ traffic-object-spawn-params) none 32) - (vehicle-rider-method-33 (_type_) none 33) - (vehicle-rider-method-34 (_type_) none 34) - (vehicle-rider-method-35 (_type_) none 35) + (initialize-collision (_type_) none) + (vehicle-rider-method-32 (_type_ traffic-object-spawn-params) none) + (vehicle-rider-method-33 (_type_) none) + (vehicle-rider-method-34 (_type_) none) + (vehicle-rider-method-35 (_type_) none) ) ) -(defmethod get-trans vehicle-rider ((this vehicle-rider) (arg0 int)) +(defmethod get-trans ((this vehicle-rider) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (-> this root trans) ) -(defmethod vehicle-rider-method-33 vehicle-rider ((this vehicle-rider)) +(defmethod vehicle-rider-method-33 ((this vehicle-rider)) (let* ((s4-0 (ppointer->process (-> this parent))) (s5-0 (if (type? s4-0 vehicle) s4-0 @@ -56,7 +54,7 @@ (none) ) -(defmethod vehicle-rider-method-35 vehicle-rider ((this vehicle-rider)) +(defmethod vehicle-rider-method-35 ((this vehicle-rider)) (logior! (-> this draw status) (draw-control-status no-draw)) (put-rider-in-seat (the-as vehicle (ppointer->process (-> this parent))) @@ -68,7 +66,7 @@ (none) ) -(defmethod initialize-collision vehicle-rider ((this vehicle-rider)) +(defmethod initialize-collision ((this vehicle-rider)) (stack-size-set! (-> this main-thread) 16) (lwide-entity-hack) (when (not (-> this entity)) @@ -81,7 +79,7 @@ (none) ) -(defmethod vehicle-rider-method-32 vehicle-rider ((this vehicle-rider) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 ((this vehicle-rider) (arg0 traffic-object-spawn-params)) (logior! (-> this flags) 1) (set! (-> this draw lod-set lod 0 dist) 40960.0) (set! (-> this draw lod-set lod 1 dist) 122880.0) @@ -94,7 +92,7 @@ (none) ) -(defmethod vehicle-rider-method-34 vehicle-rider ((this vehicle-rider)) +(defmethod vehicle-rider-method-34 ((this vehicle-rider)) (let ((a0-1 (ppointer->process (-> this parent)))) (when a0-1 (+! (-> this anim-t) (* 41870.223 (-> this anim-speed) (seconds-per-frame))) @@ -230,7 +228,7 @@ ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! vehicle-rider ((this vehicle-rider) (arg0 entity-actor)) +(defmethod init-from-entity! ((this vehicle-rider) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -282,10 +280,6 @@ This commonly includes things such as: (deftype citizen-norm-rider (vehicle-rider) () - :heap-base #x60 - :method-count-assert 36 - :size-assert #xdd - :flag-assert #x24006000dd ) @@ -294,7 +288,7 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 3) ) -(defmethod vehicle-rider-method-33 citizen-norm-rider ((this citizen-norm-rider)) +(defmethod vehicle-rider-method-33 ((this citizen-norm-rider)) (call-parent-method this) (setup-masks (-> this draw) 0 -1) (setup-masks (-> this draw) 32 0) @@ -365,7 +359,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-rider-method-32 citizen-norm-rider ((this citizen-norm-rider) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 ((this citizen-norm-rider) (arg0 traffic-object-spawn-params)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-norm-rider" (the-as (pointer uint32) #f))) @@ -381,10 +375,6 @@ This commonly includes things such as: (deftype crimson-guard-rider (vehicle-rider) () - :heap-base #x60 - :method-count-assert 36 - :size-assert #xdd - :flag-assert #x24006000dd ) @@ -393,7 +383,7 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 3) ) -(defmethod vehicle-rider-method-33 crimson-guard-rider ((this crimson-guard-rider)) +(defmethod vehicle-rider-method-33 ((this crimson-guard-rider)) (call-parent-method this) (setup-masks (-> this draw) 0 28) (setup-masks (-> this draw) 3 0) @@ -405,7 +395,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-rider-method-32 crimson-guard-rider ((this crimson-guard-rider) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 ((this crimson-guard-rider) (arg0 traffic-object-spawn-params)) (initialize-skeleton this (the-as diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc index 6cd8b67b1f3..9d0a7179d2f 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod rigid-body-vehicle-constants-method-9 rigid-body-vehicle-constants ((this rigid-body-vehicle-constants)) +(defmethod rigid-body-vehicle-constants-method-9 ((this rigid-body-vehicle-constants)) (set! (-> this particle-system-2d) *sp-particle-system-2d*) (set! (-> this particle-system-3d) *sp-particle-system-3d*) (set! (-> this part-quat) *particle-quat*) @@ -19,40 +19,34 @@ (none) ) -(defmethod rigid-body-vehicle-constants-method-10 rigid-body-vehicle-constants () +(defmethod rigid-body-vehicle-constants-method-10 ((this rigid-body-vehicle-constants)) 0 (none) ) (deftype vehicle-hud-request (structure) - ((handle handle :offset-assert 0) - (hack-handle-init basic :offset 0) - (priority float :offset-assert 8) + ((handle handle) + (hack-handle-init basic :overlay-at handle) + (priority float) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype vehicle-hud-requests (structure) - ((time time-frame :offset-assert 0) - (requests vehicle-hud-request 4 :inline :offset-assert 8) + ((time time-frame) + (requests vehicle-hud-request 4 :inline) ) :pack-me - :method-count-assert 12 - :size-assert #x48 - :flag-assert #xc00000048 (:methods - (vehicle-hud-requests-method-9 (_type_) none 9) - (vehicle-hud-requests-method-10 (_type_) vehicle-hud-request 10) - (vehicle-hud-requests-method-11 (_type_) vehicle-hud-request 11) + (vehicle-hud-requests-method-9 (_type_) none) + (vehicle-hud-requests-method-10 (_type_) vehicle-hud-request) + (vehicle-hud-requests-method-11 (_type_) vehicle-hud-request) ) ) -(defmethod vehicle-hud-requests-method-9 vehicle-hud-requests ((this vehicle-hud-requests)) +(defmethod vehicle-hud-requests-method-9 ((this vehicle-hud-requests)) (dotimes (v1-0 4) (let ((a1-2 (-> this requests v1-0))) (set! (-> a1-2 handle) (the-as handle #f)) @@ -63,7 +57,7 @@ (none) ) -(defmethod vehicle-hud-requests-method-10 vehicle-hud-requests ((this vehicle-hud-requests)) +(defmethod vehicle-hud-requests-method-10 ((this vehicle-hud-requests)) (let ((v1-0 0)) (let ((f0-0 0.0)) (countdown (a1-0 4) @@ -79,7 +73,7 @@ ) ) -(defmethod vehicle-hud-requests-method-11 vehicle-hud-requests ((this vehicle-hud-requests)) +(defmethod vehicle-hud-requests-method-11 ((this vehicle-hud-requests)) (let ((v1-0 0)) (let ((f0-0 (the-as float #x7f800000)) (a1-1 4) @@ -107,19 +101,16 @@ ) (deftype vehicle-hud-chooser (structure) - ((cur vehicle-hud-requests :inline :offset-assert 0) - (last vehicle-hud-requests :inline :offset-assert 72) + ((cur vehicle-hud-requests :inline) + (last vehicle-hud-requests :inline) ) - :method-count-assert 10 - :size-assert #x90 - :flag-assert #xa00000090 (:methods - (vehicle-hud-chooser-method-9 (_type_ handle float) symbol 9) + (vehicle-hud-chooser-method-9 (_type_ handle float) symbol) ) ) -(defmethod vehicle-hud-chooser-method-9 vehicle-hud-chooser ((this vehicle-hud-chooser) (arg0 handle) (arg1 float)) +(defmethod vehicle-hud-chooser-method-9 ((this vehicle-hud-chooser) (arg0 handle) (arg1 float)) (let ((s3-0 (current-time))) (when (!= s3-0 (-> this cur time)) (if (zero? (-> this cur time)) @@ -150,14 +141,14 @@ (define *pilot-edge-grab-info* (new 'static 'pilot-edge-grab-info)) -(defmethod deactivate vehicle ((this vehicle)) +(defmethod deactivate ((this vehicle)) (vehicle-method-110 this) (call-parent-method this) (none) ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! vehicle ((this vehicle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this vehicle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -168,7 +159,7 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-35 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-35 ((this vehicle)) (let ((t9-0 (method-of-type rigid-body-object rigid-body-object-method-35))) (t9-0 this) ) @@ -184,7 +175,7 @@ This commonly includes things such as: (none) ) -(defmethod check-player-get-on vehicle ((this vehicle)) +(defmethod check-player-get-on ((this vehicle)) (with-pp (let ((f0-0 (-> this player-dist2)) (f1-0 102400.0) @@ -397,7 +388,7 @@ This commonly includes things such as: ) ) -(defmethod vehicle-method-110 vehicle ((this vehicle)) +(defmethod vehicle-method-110 ((this vehicle)) (sound-stop (-> this scrape-sound-id)) (sound-stop (-> this engine-sound-id)) (sound-stop (-> this thrust-sound-id)) @@ -407,7 +398,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-62 vehicle ((this vehicle) (arg0 float)) +(defmethod vehicle-method-62 ((this vehicle) (arg0 float)) (if (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> this flags))) (set! (-> this controls steering) (fmax -1.0 (fmin 1.0 arg0))) ) @@ -415,7 +406,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-63 vehicle ((this vehicle) (arg0 float)) +(defmethod vehicle-method-63 ((this vehicle) (arg0 float)) (if (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> this flags))) (set! (-> this controls throttle) (fmax -0.5 (fmin 1.0 arg0))) ) @@ -423,7 +414,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-98 vehicle ((this vehicle) (arg0 float)) +(defmethod vehicle-method-98 ((this vehicle) (arg0 float)) (let* ((v1-1 (-> this rbody state lin-velocity)) (f0-4 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) (f0-6 (/ (- arg0 f0-4) arg0)) @@ -435,7 +426,7 @@ This commonly includes things such as: (none) ) -(defmethod start-jump vehicle ((this vehicle)) +(defmethod start-jump ((this vehicle)) (when (logtest? (-> this info flags) 16) (when (not (logtest? (rigid-body-object-flag jump-sound) (-> this flags))) (logior! (-> this flags) (rigid-body-object-flag jump-sound)) @@ -447,16 +438,16 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-66 vehicle ((this vehicle)) +(defmethod vehicle-method-66 ((this vehicle)) 0 (none) ) -(defmethod get-seat-count vehicle ((this vehicle)) +(defmethod get-seat-count ((this vehicle)) (-> this info seat-count) ) -(defmethod compute-seat-position vehicle ((this vehicle) (arg0 vector) (arg1 int)) +(defmethod compute-seat-position ((this vehicle) (arg0 vector) (arg1 int)) (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> this info seat-array arg1 position quad)) (set! (-> v1-0 w) 1.0) @@ -466,7 +457,7 @@ This commonly includes things such as: (none) ) -(defmethod get-rider-in-seat vehicle ((this vehicle) (arg0 int)) +(defmethod get-rider-in-seat ((this vehicle) (arg0 int)) (let ((v0-0 (the-as process #f))) (if (< arg0 (-> this info seat-count)) (set! v0-0 (handle->process (-> this rider-array arg0))) @@ -475,7 +466,7 @@ This commonly includes things such as: ) ) -(defmethod vehicle-method-70 vehicle ((this vehicle)) +(defmethod vehicle-method-70 ((this vehicle)) (let ((gp-0 (the-as process #f))) (countdown (s4-0 (-> this info seat-count)) (when (logtest? (-> this info seat-array s4-0 flags) 1) @@ -490,7 +481,7 @@ This commonly includes things such as: ) ) -(defmethod get-best-seat-for-vehicle vehicle ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod get-best-seat-for-vehicle ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) (let ((gp-0 -1)) (let ((f30-0 (the-as float #x7f800000)) (s1-0 (new 'stack-no-clear 'vector)) @@ -528,7 +519,7 @@ This commonly includes things such as: ) ) -(defmethod remove-rider vehicle ((this vehicle) (arg0 process)) +(defmethod remove-rider ((this vehicle) (arg0 process)) (let ((v1-1 (-> this info seat-count))) (dotimes (a2-0 v1-1) (if (= arg0 (handle->process (-> this rider-array a2-0))) @@ -540,7 +531,7 @@ This commonly includes things such as: (none) ) -(defmethod put-rider-in-seat vehicle ((this vehicle) (arg0 int) (arg1 process-focusable)) +(defmethod put-rider-in-seat ((this vehicle) (arg0 int) (arg1 process-focusable)) (if (< arg0 (-> this info seat-count)) (set! (-> this rider-array arg0) (process->handle arg1)) ) @@ -548,7 +539,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-117 vehicle ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector+! v1-0 (-> this info seat-array arg1 position) (-> this info rider-hand-offset arg2)) (vector-matrix*! arg0 v1-0 (-> this node-list data 0 bone transform)) @@ -557,27 +548,27 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-72 vehicle ((this vehicle)) +(defmethod vehicle-method-72 ((this vehicle)) (-> this info rider-stance) ) -(defmethod vehicle-method-75 vehicle ((this vehicle)) +(defmethod vehicle-method-75 ((this vehicle)) (-> this controls steering) ) -(defmethod vehicle-method-115 vehicle ((this vehicle) (arg0 vector)) +(defmethod vehicle-method-115 ((this vehicle) (arg0 vector)) (set! (-> arg0 quad) (-> this lin-acceleration quad)) 0 (none) ) -(defmethod vehicle-method-116 vehicle ((this vehicle) (arg0 (pointer vehicle-controls))) +(defmethod vehicle-method-116 ((this vehicle) (arg0 (pointer vehicle-controls))) (mem-copy! arg0 (the-as pointer (-> this controls)) 16) 0 (none) ) -(defmethod apply-damage vehicle ((this vehicle) (arg0 float) (arg1 rigid-body-impact)) +(defmethod apply-damage ((this vehicle) (arg0 float) (arg1 rigid-body-impact)) (cond (#f ) @@ -589,7 +580,7 @@ This commonly includes things such as: ) ) (#when PC_PORT - ;; vehicle invuln cheats + ;; og:preserve-this vehicle invuln cheats (when (and (pc-cheats? (-> *pc-settings* cheats) vehicle-invuln) *target* (focus-test? *target* pilot) @@ -620,7 +611,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-118 vehicle ((this vehicle) (arg0 int)) +(defmethod vehicle-method-118 ((this vehicle) (arg0 int)) (let* ((v1-2 (-> this section-array arg0)) (s4-0 (-> this info section-array arg0)) (s5-1 @@ -653,7 +644,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-82 vehicle ((this vehicle)) +(defmethod vehicle-method-82 ((this vehicle)) (set! (-> this flags) (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag disturbed damaged @@ -719,19 +710,19 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-101 vehicle ((this vehicle)) +(defmethod vehicle-method-101 ((this vehicle)) (set! (-> this hit-points) 1.0) 0 (none) ) -(defmethod vehicle-method-134 vehicle ((this vehicle) (arg0 process)) +(defmethod vehicle-method-134 ((this vehicle) (arg0 process)) "Stubbed" 0 (none) ) -(defmethod vehicle-method-76 vehicle ((this vehicle) (arg0 int) (arg1 uint)) +(defmethod vehicle-method-76 ((this vehicle) (arg0 int) (arg1 uint)) (when (< (-> this crash-level) arg0) (set! (-> this crash-level) arg0) (set! (-> this crash-duration) arg1) @@ -752,13 +743,13 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-77 vehicle ((this vehicle)) +(defmethod vehicle-method-77 ((this vehicle)) (set! (-> this crash-level) 0) 0 (none) ) -(defmethod vehicle-method-78 vehicle ((this vehicle) (arg0 int)) +(defmethod vehicle-method-78 ((this vehicle) (arg0 int)) (set! (-> this flight-level-index-prev) (-> this flight-level-index)) (set! (-> this flight-level-index) arg0) (logior! (-> this flags) (rigid-body-object-flag flight-level-transition camera-rapid-track-mode)) @@ -769,7 +760,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-79 vehicle ((this vehicle)) +(defmethod vehicle-method-79 ((this vehicle)) (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition)) (logior! (-> this flags) (rigid-body-object-flag flight-level-transition-ending)) (set-time! (-> this transition-end-time)) @@ -777,7 +768,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-131 vehicle ((this vehicle)) +(defmethod vehicle-method-131 ((this vehicle)) (if (not (logtest? (rigid-body-object-flag lights-dead) (-> this flags))) (set! (-> this flags) (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-on lights-update) (-> this flags))) @@ -787,7 +778,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-132 vehicle ((this vehicle)) +(defmethod vehicle-method-132 ((this vehicle)) (set! (-> this flags) (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag lights-on))) ) @@ -798,7 +789,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-139 vehicle ((this vehicle)) +(defmethod vehicle-method-139 ((this vehicle)) (when (not (logtest? (rigid-body-object-flag ignition) (-> this flags))) (logior! (-> this flags) (rigid-body-object-flag ignition)) (sound-play "vehicl-ignition") @@ -835,7 +826,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-140 vehicle ((this vehicle)) +(defmethod vehicle-method-140 ((this vehicle)) (if (logtest? (rigid-body-object-flag ignition) (-> this flags)) (logclear! (-> this flags) (rigid-body-object-flag ignition)) ) @@ -843,7 +834,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-141 vehicle ((this vehicle)) +(defmethod vehicle-method-141 ((this vehicle)) (let ((a0-2 (find-nearest-nav-mesh (-> this root trans) (the-as float #x7f800000)))) (when a0-2 (add-process-drawable-to-navmesh a0-2 this #t) @@ -854,7 +845,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-142 vehicle ((this vehicle)) +(defmethod vehicle-method-142 ((this vehicle)) (let ((v1-0 (-> this nav))) (when v1-0 (remove-process-drawable (-> v1-0 state mesh) this) @@ -865,7 +856,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-143 vehicle ((this vehicle)) +(defmethod vehicle-method-143 ((this vehicle)) (let ((v1-2 (or (logtest? (-> this flags) (rigid-body-object-flag dead waiting-for-player)) (and (logtest? (rigid-body-object-flag player-driving ai-driving) (-> this flags)) (not (logtest? (-> this flags) (rigid-body-object-flag on-flight-level))) @@ -904,7 +895,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-87 vehicle ((this vehicle)) +(defmethod vehicle-method-87 ((this vehicle)) (when (not (logtest? (rigid-body-object-flag camera) (-> this flags))) (logior! (-> this flags) (rigid-body-object-flag camera)) (set! (-> this cam-speed-interp) 0.0) @@ -933,7 +924,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-88 vehicle ((this vehicle)) +(defmethod vehicle-method-88 ((this vehicle)) (when (logtest? (rigid-body-object-flag camera) (-> this flags)) (vehicle-method-92 this) (vehicle-method-90 this) @@ -968,7 +959,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-89 vehicle ((this vehicle)) +(defmethod vehicle-method-89 ((this vehicle)) (when (not (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags))) (logior! (-> this flags) (rigid-body-object-flag camera-bike-mode)) (set-setting! 'bike-mode #f 0.0 0) @@ -977,7 +968,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-90 vehicle ((this vehicle)) +(defmethod vehicle-method-90 ((this vehicle)) (when (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags)) (logclear! (-> this flags) (rigid-body-object-flag camera-bike-mode)) (remove-setting! 'bike-mode) @@ -986,7 +977,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-91 vehicle ((this vehicle)) +(defmethod vehicle-method-91 ((this vehicle)) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (logior! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode)) (set-setting! 'rapid-tracking #f 0.0 0) @@ -995,7 +986,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-92 vehicle ((this vehicle)) +(defmethod vehicle-method-92 ((this vehicle)) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (logclear! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode)) (remove-setting! 'rapid-tracking) @@ -1004,7 +995,7 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-40 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-40 ((this vehicle)) (logior! (-> this flags) (rigid-body-object-flag enable-collision)) (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (-> this root backup-collide-as)) @@ -1014,7 +1005,7 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-41 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-41 ((this vehicle)) (logclear! (-> this flags) (rigid-body-object-flag enable-collision)) (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) @@ -1025,7 +1016,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-102 vehicle ((this vehicle)) +(defmethod vehicle-method-102 ((this vehicle)) (let ((v1-1 (-> this draw shadow-ctrl))) (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) @@ -1034,7 +1025,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-103 vehicle ((this vehicle)) +(defmethod vehicle-method-103 ((this vehicle)) (let ((v1-1 (-> this draw shadow-ctrl))) (logior! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) @@ -1043,7 +1034,7 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-38 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-38 ((this vehicle)) (when (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) (logior! (-> this rbody state flags) (rigid-body-flag enable-physics)) (rigid-body-method-26 (-> this rbody state) (-> this root trans) (-> this root quat)) @@ -1055,7 +1046,7 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-39 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-39 ((this vehicle)) (set! (-> this force-scale) 1.0) (logclear! (-> this rbody state flags) (rigid-body-flag enable-physics)) (vehicle-method-110 this) @@ -1063,7 +1054,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-111 vehicle ((this vehicle) (arg0 object) (arg1 target)) +(defmethod vehicle-method-111 ((this vehicle) (arg0 object) (arg1 target)) (let ((a0-1 (-> this controller traffic))) (when (and (nonzero? a0-1) arg1) (if #t @@ -1075,12 +1066,12 @@ This commonly includes things such as: (none) ) -(defmethod decrease-traffic-alert-level vehicle ((this vehicle) (arg0 int)) +(defmethod decrease-traffic-alert-level ((this vehicle) (arg0 int)) (decrease-alert-level (-> this controller traffic) arg0) 0 ) -(defmethod vehicle-method-80 vehicle ((this vehicle)) +(defmethod vehicle-method-80 ((this vehicle)) (when (and (logtest? (-> this info flags) 64) (< (-> this flight-level-index) 1)) 1 (cond @@ -1097,7 +1088,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-81 vehicle ((this vehicle)) +(defmethod vehicle-method-81 ((this vehicle)) (when (and (logtest? (-> this info flags) 64) (> (-> this flight-level-index) 0)) (sound-play "bike-down") (vehicle-method-78 this 0) @@ -1106,7 +1097,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-83 vehicle ((this vehicle)) +(defmethod vehicle-method-83 ((this vehicle)) (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition)) (vehicle-method-92 this) (set! (-> this flight-level-index) 0) @@ -1114,7 +1105,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-108 vehicle ((this vehicle)) +(defmethod vehicle-method-108 ((this vehicle)) (vehicle-controller-method-11 (-> this controller)) (set! (-> this flags) (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> this flags))) @@ -1124,7 +1115,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-109 vehicle ((this vehicle)) +(defmethod vehicle-method-109 ((this vehicle)) (set! (-> this flags) (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag in-pursuit))) ) @@ -1134,7 +1125,7 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-42 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-42 ((this vehicle)) (if (and (not (focus-test? this inactive)) (not (and (-> this next-state) (= (-> this next-state name) 'explode))) ) @@ -1144,7 +1135,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-113 vehicle ((this vehicle)) +(defmethod vehicle-method-113 ((this vehicle)) (vehicle-method-127 this) (logior! (-> this focus-status) (focus-status inactive)) (set! (-> this event-hook) (-> (method-of-object this inactive) event)) @@ -1153,7 +1144,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-114 vehicle ((this vehicle)) +(defmethod vehicle-method-114 ((this vehicle)) (if (focus-test? this inactive) (vehicle-method-128 this) ) @@ -1162,20 +1153,20 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-43 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-43 ((this vehicle)) (go (method-of-object this waiting)) 0 (none) ) -(defmethod vehicle-method-138 vehicle ((this vehicle)) +(defmethod vehicle-method-138 ((this vehicle)) (go (method-of-object this player-control)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod vehicle-method-130 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-130 ((this vehicle) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) @@ -1205,7 +1196,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-136 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-136 ((this vehicle) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((= v1-0 1) @@ -1227,7 +1218,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-127 vehicle ((this vehicle)) +(defmethod vehicle-method-127 ((this vehicle)) (let ((s5-0 (-> this child))) (while s5-0 (send-event (ppointer->process s5-0) 'traffic-off) @@ -1244,7 +1235,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-128 vehicle ((this vehicle)) +(defmethod vehicle-method-128 ((this vehicle)) (vehicle-method-82 this) (set! (-> this root trans y) (-> this flight-level)) (logior! (-> this flags) (rigid-body-object-flag ignition ai-driving)) @@ -1258,7 +1249,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-129 vehicle ((this vehicle)) +(defmethod vehicle-method-129 ((this vehicle)) (if (= this *debug-actor*) (format #t "hook-dead~%") ) @@ -1278,17 +1269,17 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-137 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-137 ((this vehicle) (arg0 traffic-object-spawn-params)) (vehicle-rider-spawn this citizen-norm-rider arg0) 0 (none) ) -(defmethod vehicle-method-105 vehicle ((this vehicle)) +(defmethod vehicle-method-105 ((this vehicle)) (logtest? (rigid-body-object-flag disturbed player-touching player-driving in-pursuit) (-> this flags)) ) -(defmethod vehicle-method-106 vehicle ((this vehicle)) +(defmethod vehicle-method-106 ((this vehicle)) (local-vars (v1-13 float) (v1-25 float) (v1-30 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1359,13 +1350,13 @@ This commonly includes things such as: ) ) -(defmethod update-joint-mods vehicle ((this vehicle)) +(defmethod update-joint-mods ((this vehicle)) 0 (none) ) ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. -(defmethod vehicle-method-107 vehicle ((this vehicle)) +(defmethod vehicle-method-107 ((this vehicle)) (logclear! (-> this controller flags) (vehicle-controller-flag ignore-others direct-mode)) (let ((s5-0 (new 'stack-no-clear 'vehicle-control-point))) (set! (-> s5-0 local-pos quad) (-> this root trans quad)) @@ -1390,7 +1381,7 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-119 vehicle ((this vehicle)) +(defmethod vehicle-method-119 ((this vehicle)) (dotimes (s5-0 (-> this info seat-count)) (let ((s4-0 (handle->process (-> this rider-array s5-0)))) (when (and s4-0 (focus-test? (the-as vehicle-rider s4-0) pilot-riding)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc index 7280b4e3203..4afc90e4e89 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc @@ -40,14 +40,11 @@ ) (deftype debug-vehicle-work (basic) - ((impact-time time-frame :offset-assert 8) - (impact rigid-body-impact :inline :offset-assert 16) - (prim-sphere1 sphere :inline :offset-assert 80) - (prim-sphere2 sphere :inline :offset-assert 96) + ((impact-time time-frame) + (impact rigid-body-impact :inline) + (prim-sphere1 sphere :inline) + (prim-sphere2 sphere :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) @@ -78,7 +75,7 @@ ) ) -(defmethod rigid-body-object-method-45 vehicle ((this vehicle) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 ((this vehicle) (arg0 rigid-body-impact)) (local-vars (v1-63 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -188,7 +185,7 @@ ) ) -(defmethod vehicle-method-104 vehicle ((this vehicle)) +(defmethod vehicle-method-104 ((this vehicle)) (when (= (-> this controller traffic sync-mask-8) (ash 1 (logand (-> this traffic-priority-id) 7))) (let ((a1-0 (-> this root trans))) (set! (-> this flight-level) (get-height-at-point *traffic-height-map* a1-0)) @@ -230,7 +227,7 @@ (none) ) -(defmethod vehicle-method-93 vehicle ((this vehicle)) +(defmethod vehicle-method-93 ((this vehicle)) (let ((s5-0 (new 'stack-no-clear 'matrix))) (set! (-> s5-0 vector 2 quad) (-> this rbody state matrix quad 0)) (set! (-> s5-0 trans quad) (-> this rbody state matrix vector 2 quad)) @@ -286,7 +283,7 @@ (none) ) -(defmethod vehicle-method-95 vehicle ((this vehicle) (arg0 vector)) +(defmethod vehicle-method-95 ((this vehicle) (arg0 vector)) (seek! (-> this controls steering) (-> arg0 x) (* 8.0 (seconds-per-frame))) (seek! (-> this controls lean-z) (-> arg0 w) (* 8.0 (seconds-per-frame))) (logclear! (-> this flags) (rigid-body-object-flag slide)) @@ -351,7 +348,7 @@ (none) ) -(defmethod vehicle-method-94 vehicle ((this vehicle)) +(defmethod vehicle-method-94 ((this vehicle)) (cond ((or (logtest? (rigid-body-object-flag player-grabbed) (-> this flags)) (and *target* (focus-test? *target* dead grabbed)) @@ -397,7 +394,7 @@ (none) ) -(defmethod vehicle-method-96 vehicle ((this vehicle)) +(defmethod vehicle-method-96 ((this vehicle)) (when (and *target* (logtest? (rigid-body-object-flag ignition) (-> this flags))) (when (and (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (zero? (-> this root num-riders)) @@ -557,7 +554,7 @@ (none) ) -(defmethod vehicle-method-97 vehicle ((this vehicle)) +(defmethod vehicle-method-97 ((this vehicle)) (local-vars (v1-88 float) (v1-98 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -705,7 +702,7 @@ ) ) -(defmethod vehicle-method-120 vehicle ((this vehicle)) +(defmethod vehicle-method-120 ((this vehicle)) (let ((s5-0 (-> this draw shadow-ctrl))) (when (!= *vehicle-shadow-control-disabled* s5-0) (let ((f30-0 (vector-vector-xz-distance (camera-pos) (-> this root trans)))) @@ -780,7 +777,7 @@ (none) ) -(defmethod rigid-body-object-method-51 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-51 ((this vehicle)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f30-0 -4096000.0)) (set! (-> s5-0 start-pos quad) (-> this rbody state position quad)) @@ -847,7 +844,7 @@ (none) ) -(defmethod rigid-body-object-method-52 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-52 ((this vehicle)) (with-pp (let ((v1-0 (new 'stack-no-clear 'vehicle-control-point))) (set! (-> v1-0 local-pos quad) (-> this root transv quad)) @@ -938,7 +935,7 @@ ) ) -(defmethod vehicle-method-121 vehicle ((this vehicle)) +(defmethod vehicle-method-121 ((this vehicle)) (if (time-elapsed? (-> this player-touch-time) (seconds 0.1)) (logclear! (-> this flags) (rigid-body-object-flag player-touching player-edge-grabbing player-standing-on)) ) @@ -958,7 +955,7 @@ (none) ) -(defmethod rigid-body-object-method-37 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-37 ((this vehicle)) (local-vars (a0-14 int) (a0-16 int) (a0-19 int) (a0-21 int)) (let* ((v1-1 (-> *perf-stats* data 37)) (a0-1 (-> v1-1 ctrl)) @@ -1047,7 +1044,7 @@ (none) ) -(defmethod vehicle-method-123 vehicle ((this vehicle)) +(defmethod vehicle-method-123 ((this vehicle)) (local-vars (v1-4 symbol) (a0-21 int) (a0-23 int)) (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) @@ -1149,7 +1146,7 @@ (none) ) -(defmethod vehicle-method-122 vehicle ((this vehicle)) +(defmethod vehicle-method-122 ((this vehicle)) (local-vars (a0-23 int) (a0-25 int) (a0-35 int) (a0-37 int) (a0-40 int) (a0-42 int)) (let* ((v1-1 (-> *perf-stats* data 37)) (a0-1 (-> v1-1 ctrl)) @@ -1304,7 +1301,7 @@ (none) ) -(defmethod vehicle-method-124 vehicle ((this vehicle)) +(defmethod vehicle-method-124 ((this vehicle)) ;; og:preserve-this vehicle hp display cheat (#when PC_PORT (when (pc-cheats? (-> *pc-settings* cheats) vehicle-health-bars) @@ -1335,7 +1332,7 @@ (none) ) -(defmethod alloc-and-init-rigid-body-control vehicle ((this vehicle) (arg0 rigid-body-vehicle-constants)) +(defmethod alloc-and-init-rigid-body-control ((this vehicle) (arg0 rigid-body-vehicle-constants)) (if (logtest? (-> arg0 flags) 8) (iterate-prims (-> this root) @@ -1468,7 +1465,7 @@ (none) ) -(defmethod rigid-body-object-method-47 vehicle ((this vehicle) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) +(defmethod rigid-body-object-method-47 ((this vehicle) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) (local-vars (f0-2 float) (sv-96 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1619,7 +1616,7 @@ ) ) -(defmethod rigid-body-object-method-48 vehicle ((this vehicle) (arg0 process-focusable) (arg1 touching-shapes-entry)) +(defmethod rigid-body-object-method-48 ((this vehicle) (arg0 process-focusable) (arg1 touching-shapes-entry)) (local-vars (v1-2 symbol) (v1-30 symbol) (a0-19 object)) (with-pp (b! @@ -1740,7 +1737,7 @@ ) ) -(defmethod rigid-body-object-method-46 vehicle ((this vehicle) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 ((this vehicle) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (and (= arg2 'touched) arg0 (logtest? (process-mask bit18) (-> arg0 mask))) (dotimes (s1-0 4) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -1860,7 +1857,7 @@ ) ) -(defmethod vehicle-method-135 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-135 ((this vehicle) (arg0 traffic-object-spawn-params)) 0 (none) ) diff --git a/goal_src/jak2/levels/city/vinroom/vinroom-obs.gc b/goal_src/jak2/levels/city/vinroom/vinroom-obs.gc index b5bc0528560..467cbdfc73d 100644 --- a/goal_src/jak2/levels/city/vinroom/vinroom-obs.gc +++ b/goal_src/jak2/levels/city/vinroom/vinroom-obs.gc @@ -8,18 +8,14 @@ ;; DECOMP BEGINS (deftype vin-turbine (process-drawable) - ((dont-draw-outside? symbol :offset-assert 200) - (lightning-timer uint64 :offset-assert 208) - (outside-plane plane :inline :offset-assert 224) - (lightning-plane plane :inline :offset-assert 240) + ((dont-draw-outside? symbol) + (lightning-timer uint64) + (outside-plane plane :inline) + (lightning-plane plane :inline) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #x100 - :flag-assert #x1600800100 - (:methods - (idle () _type_ :state 20) - (dormant () _type_ :state 21) + (:state-methods + idle + dormant ) ) @@ -192,7 +188,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vin-turbine ((this vin-turbine) (arg0 entity-actor)) +(defmethod init-from-entity! ((this vin-turbine) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -229,15 +225,11 @@ This commonly includes things such as: (deftype vin-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vin-door ((this vin-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this vin-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/city/vinroom/vinroom-part.gc b/goal_src/jak2/levels/city/vinroom/vinroom-part.gc index 0f7ca1063b6..fe5b09ba0f6 100644 --- a/goal_src/jak2/levels/city/vinroom/vinroom-part.gc +++ b/goal_src/jak2/levels/city/vinroom/vinroom-part.gc @@ -9,10 +9,6 @@ (deftype vinroom-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/city/vinroom/vinroom-scenes.gc b/goal_src/jak2/levels/city/vinroom/vinroom-scenes.gc index da723dfe1af..40b6bdb039e 100644 --- a/goal_src/jak2/levels/city/vinroom/vinroom-scenes.gc +++ b/goal_src/jak2/levels/city/vinroom/vinroom-scenes.gc @@ -9,10 +9,6 @@ (deftype vin-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) @@ -24,7 +20,7 @@ ) ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-art! vin-npc ((this vin-npc)) +(defmethod init-art! ((this vin-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this diff --git a/goal_src/jak2/levels/common/ai/ai-task-h.gc b/goal_src/jak2/levels/common/ai/ai-task-h.gc index 8eaeedd1c90..01874cff2bb 100644 --- a/goal_src/jak2/levels/common/ai/ai-task-h.gc +++ b/goal_src/jak2/levels/common/ai/ai-task-h.gc @@ -11,79 +11,70 @@ ;; DECOMP BEGINS (deftype ai-task (basic) - ((next ai-task :offset-assert 4) - (prev ai-task :offset-assert 8) - (pool ai-task-pool :offset-assert 12) - (unique-id uint32 :offset-assert 16) - (bytes int8 16 :offset 32) + ((next ai-task) + (prev ai-task) + (pool ai-task-pool) + (unique-id uint32) + (bytes int8 16 :offset 32) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 (:methods - (reset-task! (_type_) none 9) - (ai-task-method-10 (_type_ bot) none 10) - (ai-task-method-11 (_type_ bot) none 11) + (reset-task! (_type_) none) + (ai-task-method-10 (_type_ bot) none) + (ai-task-method-11 (_type_ bot) none) ) ) (deftype ai-task-pool (basic) - ((anchor ai-task :offset-assert 4) - (tasks (pointer uint32) :offset-assert 8) - (tasks-length uint32 :offset-assert 12) - (unique-id uint32 :offset-assert 16) + ((anchor ai-task) + (tasks (pointer uint32)) + (tasks-length uint32) + (unique-id uint32) ) - :method-count-assert 12 - :size-assert #x14 - :flag-assert #xc00000014 (:methods - (assign-ids! (_type_ type) ai-task 9) - (set-next-task! (_type_ ai-task) none 10) - (ai-task-pool-method-11 (_type_) ai-task 11) + (assign-ids! (_type_ type) ai-task) + (set-next-task! (_type_ ai-task) none) + (ai-task-pool-method-11 (_type_) ai-task) ) ) (deftype ai-task-control (basic) - ((anchor ai-task :offset-assert 4) - (pool ai-task-pool :offset-assert 8) + ((anchor ai-task) + (pool ai-task-pool) ) - :method-count-assert 18 - :size-assert #xc - :flag-assert #x120000000c (:methods - (new (symbol type ai-task-pool) _type_ 0) - (ai-task-control-method-9 (_type_) none 9) - (ai-task-control-method-10 (_type_ bot) none 10) - (get-task-by-type (_type_ type bot) ai-task 11) - (ai-task-control-method-12 (_type_ bot) symbol 12) - (ai-task-control-method-13 (_type_ ai-task bot) ai-task 13) - (ai-task-control-method-14 (_type_ ai-task bot) none 14) - (init-task! (_type_ type bot) ai-task 15) - (set-next-task-for-pool! (_type_ ai-task) none 16) - (set-next-task! (_type_ ai-task) none 17) + (new (symbol type ai-task-pool) _type_) + (ai-task-control-method-9 (_type_) none) + (ai-task-control-method-10 (_type_ bot) none) + (get-task-by-type (_type_ type bot) ai-task) + (ai-task-control-method-12 (_type_ bot) symbol) + (ai-task-control-method-13 (_type_ ai-task bot) ai-task) + (ai-task-control-method-14 (_type_ ai-task bot) none) + (init-task! (_type_ type bot) ai-task) + (set-next-task-for-pool! (_type_ ai-task) none) + (set-next-task! (_type_ ai-task) none) ) ) -(defmethod ai-task-method-11 ai-task ((this ai-task) (arg0 bot)) +(defmethod ai-task-method-11 ((this ai-task) (arg0 bot)) 0 (none) ) -(defmethod ai-task-method-10 ai-task ((this ai-task) (arg0 bot)) +(defmethod ai-task-method-10 ((this ai-task) (arg0 bot)) 0 (none) ) -(defmethod reset-task! ai-task ((this ai-task)) +(defmethod reset-task! ((this ai-task)) 0 (none) ) ;; WARN: Return type mismatch (pointer uint32) vs ai-task. -(defmethod ai-task-pool-method-11 ai-task-pool ((this ai-task-pool)) +(defmethod ai-task-pool-method-11 ((this ai-task-pool)) (set! (-> this unique-id) (the-as uint 0)) (let ((t0-0 (the-as (pointer uint32) #f)) (a1-0 (the-as (pointer uint32) #f)) @@ -109,7 +100,7 @@ ) ) -(defmethod assign-ids! ai-task-pool ((this ai-task-pool) (arg0 type)) +(defmethod assign-ids! ((this ai-task-pool) (arg0 type)) "Assign unique IDs to the [[ai-task-pool]] and its `anchor`s `next`" (let ((v1-1 (-> this anchor next))) (when v1-1 @@ -137,7 +128,7 @@ ) ;; WARN: Return type mismatch ai-task vs none. -(defmethod set-next-task! ai-task-pool ((this ai-task-pool) (arg0 ai-task)) +(defmethod set-next-task! ((this ai-task-pool) (arg0 ai-task)) "Set the next task in the [[ai-task-pool]] to the specified [[ai-task]]." (let* ((v1-0 (-> this anchor)) (v0-0 (-> v1-0 next)) @@ -157,7 +148,7 @@ ) ) -(defmethod ai-task-control-method-12 ai-task-control ((this ai-task-control) (arg0 bot)) +(defmethod ai-task-control-method-12 ((this ai-task-control) (arg0 bot)) (let ((gp-0 (-> this anchor))) (let ((s3-0 (-> this anchor next))) (while s3-0 @@ -177,7 +168,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-control-method-9 ai-task-control ((this ai-task-control)) +(defmethod ai-task-control-method-9 ((this ai-task-control)) (ai-task-control-method-12 this (the-as bot #f)) (let ((a1-1 (-> this anchor))) (when a1-1 @@ -188,7 +179,7 @@ (none) ) -(defmethod init-task! ai-task-control ((this ai-task-control) (arg0 type) (arg1 bot)) +(defmethod init-task! ((this ai-task-control) (arg0 type) (arg1 bot)) "Initialize a task of the given type in the [[ai-task-control]]'s pool." (let ((s5-0 (assign-ids! (-> this pool) arg0))) (if s5-0 @@ -199,7 +190,7 @@ ) ;; WARN: Return type mismatch ai-task vs none. -(defmethod set-next-task! ai-task-control ((this ai-task-control) (arg0 ai-task)) +(defmethod set-next-task! ((this ai-task-control) (arg0 ai-task)) "Set `next` of this [[ai-task-control]]'s `anchor` to the given [[ai-task]]." (let* ((v1-0 (-> this anchor)) (a0-1 (-> v1-0 next)) @@ -211,12 +202,12 @@ (none) ) -(defmethod set-next-task-for-pool! ai-task-control ((this ai-task-control) (arg0 ai-task)) +(defmethod set-next-task-for-pool! ((this ai-task-control) (arg0 ai-task)) (set-next-task! (-> this pool) arg0) (none) ) -(defmethod get-task-by-type ai-task-control ((this ai-task-control) (arg0 type) (arg1 bot)) +(defmethod get-task-by-type ((this ai-task-control) (arg0 type) (arg1 bot)) (let ((s5-0 (init-task! this arg0 arg1))) (if s5-0 (set-next-task! this s5-0) @@ -225,7 +216,7 @@ ) ) -(defmethod ai-task-control-method-13 ai-task-control ((this ai-task-control) (arg0 ai-task) (arg1 bot)) +(defmethod ai-task-control-method-13 ((this ai-task-control) (arg0 ai-task) (arg1 bot)) (let ((gp-0 (-> arg0 prev)) (s5-0 (-> arg0 next)) ) @@ -243,7 +234,7 @@ ) ) -(defmethod ai-task-control-method-10 ai-task-control ((this ai-task-control) (arg0 bot)) +(defmethod ai-task-control-method-10 ((this ai-task-control) (arg0 bot)) (let ((a0-1 (-> this anchor next))) (if a0-1 (ai-task-method-11 a0-1 arg0) @@ -252,7 +243,7 @@ (none) ) -(defmethod ai-task-control-method-14 ai-task-control ((this ai-task-control) (arg0 ai-task) (arg1 bot)) +(defmethod ai-task-control-method-14 ((this ai-task-control) (arg0 ai-task) (arg1 bot)) (let ((a0-1 (ai-task-control-method-13 this arg0 arg1))) (if a0-1 (ai-task-method-11 a0-1 arg1) diff --git a/goal_src/jak2/levels/common/ai/ashelin/ash-h.gc b/goal_src/jak2/levels/common/ai/ashelin/ash-h.gc index 3d6645a29c3..18ddf6b71e1 100644 --- a/goal_src/jak2/levels/common/ai/ashelin/ash-h.gc +++ b/goal_src/jak2/levels/common/ai/ashelin/ash-h.gc @@ -8,55 +8,50 @@ ;; DECOMP BEGINS (deftype ashelin-course (bot-course) - ((ouch-speeches bot-speech-list-shuffle :offset-assert 48) - (victory-speeches bot-speech-list-shuffle :offset-assert 52) + ((ouch-speeches bot-speech-list-shuffle) + (victory-speeches bot-speech-list-shuffle) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) (deftype ashelin (bot) - ((ash-course ashelin-course :offset 652) - (knocked-anim art-joint-anim :offset-assert 992) - (travel-anim-interp float :offset-assert 996) - (fired-gun-count uint32 :offset-assert 1000) - (last-fire-time time-frame :offset-assert 1008) - (victory-speech-time time-frame :offset-assert 1016) - (frontline plane :inline :offset-assert 1024) + ((ash-course ashelin-course :overlay-at course) + (knocked-anim art-joint-anim) + (travel-anim-interp float) + (fired-gun-count uint32) + (last-fire-time time-frame) + (victory-speech-time time-frame) + (frontline plane :inline) ) - :heap-base #x390 - :method-count-assert 251 - :size-assert #x410 - :flag-assert #xfb03900410 + (:state-methods + back-spring + cartwheel-left + tumble-right + chase + traveling + traveling-blocked + waiting-idle + standing-idle + standing-turn + standing-blast + ) (:methods - (back-spring () _type_ :state 225) - (cartwheel-left () _type_ :state 226) - (tumble-right () _type_ :state 227) - (chase () _type_ :state 228) - (traveling () _type_ :state 229) - (traveling-blocked () _type_ :state 230) - (waiting-idle () _type_ :state 231) - (standing-idle () _type_ :state 232) - (standing-turn () _type_ :state 233) - (standing-blast () _type_ :state 234) - (ashelin-method-235 (_type_ symbol) symbol 235) - (ashelin-method-236 (_type_ vector float float float float) symbol 236) - (fire-projectile (_type_ vector) none 237) - (ashelin-method-238 (_type_ symbol symbol) symbol 238) - (ashelin-method-239 (_type_) none 239) - (ashelin-method-240 (_type_ int) none 240) - (ashelin-method-241 (_type_) int 241) - (ashelin-method-242 (_type_) int 242) - (ashelin-method-243 (_type_ float) int 243) - (ashelin-method-244 (_type_) none 244) - (ashelin-method-245 (_type_) none 245) - (ashelin-method-246 (_type_) int 246) - (ashelin-method-247 (_type_) symbol 247) - (ashelin-method-248 (_type_) symbol 248) - (ashelin-method-249 (_type_) none 249) - (ashelin-method-250 (_type_ symbol) none 250) + (ashelin-method-235 (_type_ symbol) symbol) + (ashelin-method-236 (_type_ vector float float float float) symbol) + (fire-projectile (_type_ vector) none) + (ashelin-method-238 (_type_ symbol symbol) symbol) + (ashelin-method-239 (_type_) none) + (ashelin-method-240 (_type_ int) none) + (ashelin-method-241 (_type_) int) + (ashelin-method-242 (_type_) int) + (ashelin-method-243 (_type_ float) int) + (ashelin-method-244 (_type_) none) + (ashelin-method-245 (_type_) none) + (ashelin-method-246 (_type_) int) + (ashelin-method-247 (_type_) symbol) + (ashelin-method-248 (_type_) symbol) + (ashelin-method-249 (_type_) none) + (ashelin-method-250 (_type_ symbol) none) ) ) @@ -69,20 +64,14 @@ ) (deftype asht-wait-spot (ai-task) - ((check-done (function asht-wait-spot ashelin symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function asht-wait-spot ashelin symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype asht-fight-focus (ai-task) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) diff --git a/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc b/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc index 511562af9e5..0e900dc6083 100644 --- a/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc +++ b/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc @@ -245,24 +245,20 @@ ) (deftype ashelin-shot (projectile) - ((tail-pos vector :inline :offset-assert 480) - (hit-pos vector :inline :offset-assert 496) + ((tail-pos vector :inline) + (hit-pos vector :inline) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x200 - :flag-assert #x2801800200 ) -(defmethod draw-laser-sight ashelin-shot ((this ashelin-shot)) +(defmethod draw-laser-sight ((this ashelin-shot)) "TODO - confirm If applicable, draw the laser sight particles" (draw-beam (-> *part-id-table* 675) (-> this tail-pos) (-> this starting-dir) #f #t) 0 (none) ) -(defmethod spawn-impact-particles ashelin-shot ((this ashelin-shot)) +(defmethod spawn-impact-particles ((this ashelin-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -317,7 +313,7 @@ ) ) -(defmethod spawn-shell-particles ashelin-shot ((this ashelin-shot)) +(defmethod spawn-shell-particles ((this ashelin-shot)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -359,7 +355,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod play-impact-sound ashelin-shot ((this ashelin-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this ashelin-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -376,7 +372,7 @@ (none) ) -(defmethod made-impact? ashelin-shot ((this ashelin-shot)) +(defmethod made-impact? ((this ashelin-shot)) "TODO - queries the collision cache, return true/false" (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) @@ -421,7 +417,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod init-proj-collision! ashelin-shot ((this ashelin-shot)) +(defmethod init-proj-collision! ((this ashelin-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -492,7 +488,7 @@ (none) ) -(defmethod init-proj-settings! ashelin-shot ((this ashelin-shot)) +(defmethod init-proj-settings! ((this ashelin-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'eco-yellow) diff --git a/goal_src/jak2/levels/common/ai/ashelin/ash.gc b/goal_src/jak2/levels/common/ai/ashelin/ash.gc index eb1c4bcc9cf..990c0138d14 100644 --- a/goal_src/jak2/levels/common/ai/ashelin/ash.gc +++ b/goal_src/jak2/levels/common/ai/ashelin/ash.gc @@ -8,23 +8,17 @@ ;; DECOMP BEGINS (deftype ashelin-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype ashelin-global-info (basic) - ((prev-blue-hit int8 :offset-assert 4) - (blue-hit-anim int32 6 :offset-assert 8) - (blue-hit-land-anim int32 6 :offset-assert 32) + ((prev-blue-hit int8) + (blue-hit-anim int32 6) + (blue-hit-land-anim int32 6) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) @@ -209,7 +203,7 @@ (set! (-> *ashelin-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod get-penetrate-info ashelin ((this ashelin)) +(defmethod get-penetrate-info ((this ashelin)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (let* ((t9-0 (method-of-type bot get-penetrate-info)) @@ -223,7 +217,7 @@ ) ;; WARN: Return type mismatch penetrate vs none. -(defmethod ashelin-method-250 ashelin ((this ashelin) (arg0 symbol)) +(defmethod ashelin-method-250 ((this ashelin) (arg0 symbol)) (if arg0 (logior! (-> this bot-flags) (bot-flags bf22)) (logclear! (-> this bot-flags) (bot-flags bf22)) @@ -232,7 +226,7 @@ (none) ) -(defmethod bot-method-193 ashelin ((this ashelin)) +(defmethod bot-method-193 ((this ashelin)) (let* ((t9-0 (method-of-type bot bot-method-193)) (v0-0 (t9-0 this)) ) @@ -246,7 +240,7 @@ ) ) -(defmethod enemy-method-106 ashelin ((this ashelin) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 ((this ashelin) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type bot enemy-method-106))) (t9-0 this arg0 arg1 arg2 arg3) ) @@ -256,7 +250,7 @@ (none) ) -(defmethod enemy-method-104 ashelin ((this ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ((this ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (if (and (= (-> arg0 type) target) (-> this next-state) (let ((v1-4 (-> this next-state name))) @@ -268,7 +262,7 @@ ) ) -(defmethod enemy-method-97 ashelin ((this ashelin)) +(defmethod enemy-method-97 ((this ashelin)) (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 @@ -367,7 +361,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? ashelin ((this ashelin)) +(defmethod alive? ((this ashelin)) (let ((t9-0 (method-of-type bot alive?))) (the-as symbol @@ -379,7 +373,7 @@ ) ) -(defmethod init-enemy-collision! ashelin ((this ashelin)) +(defmethod init-enemy-collision! ((this ashelin)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -434,7 +428,7 @@ (none) ) -(defmethod init-enemy! ashelin ((this ashelin)) +(defmethod init-enemy! ((this ashelin)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (set! (-> this channel) (the-as uint 22)) @@ -464,7 +458,7 @@ ) ;; WARN: disable def twice: 25. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod ashelin-method-238 ashelin ((this ashelin) (arg0 symbol) (arg1 symbol)) +(defmethod ashelin-method-238 ((this ashelin) (arg0 symbol) (arg1 symbol)) (cond ((and (logtest? (-> this bot-flags) (bot-flags attacked)) (= (-> this focus-info fproc type) target)) #t @@ -487,13 +481,13 @@ ) ) -(defmethod ashelin-method-235 ashelin ((this ashelin) (arg0 symbol)) +(defmethod ashelin-method-235 ((this ashelin) (arg0 symbol)) (and (time-elapsed? (-> this last-fire-time) (seconds 1)) (and (>= 8556.089 (fabs (-> this focus-info ry-diff))) (ashelin-method-238 this arg0 #t)) ) ) -(defmethod ashelin-method-243 ashelin ((this ashelin) (arg0 float)) +(defmethod ashelin-method-243 ((this ashelin) (arg0 float)) (let ((f30-0 (deg- arg0 (-> this focus-info my-facing-ry)))) (when (>= 16384.0 (fabs f30-0)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -521,7 +515,7 @@ 0 ) -(defmethod ashelin-method-246 ashelin ((this ashelin)) +(defmethod ashelin-method-246 ((this ashelin)) (when (>= 32768.0 (-> this focus-info bullseye-xz-dist)) (let ((f0-1 (-> this focus-info bullseye-ry))) (return (ashelin-method-243 this f0-1)) @@ -538,7 +532,7 @@ 0 ) -(defmethod ashelin-method-241 ashelin ((this ashelin)) +(defmethod ashelin-method-241 ((this ashelin)) (let* ((v1-0 (target-pos 0)) (a1-0 (-> this root trans)) (f30-0 (atan (- (-> a1-0 x) (-> v1-0 x)) (- (-> a1-0 z) (-> v1-0 z)))) @@ -585,7 +579,7 @@ ) ) -(defmethod ashelin-method-242 ashelin ((this ashelin)) +(defmethod ashelin-method-242 ((this ashelin)) (let ((s5-0 0)) (cond ((zero? (get-rand-int this 2)) @@ -614,7 +608,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod ashelin-method-240 ashelin ((this ashelin) (arg0 int)) +(defmethod ashelin-method-240 ((this ashelin) (arg0 int)) (case arg0 ((3) (go (method-of-object this cartwheel-left)) @@ -629,7 +623,7 @@ (none) ) -(defmethod ashelin-method-247 ashelin ((this ashelin)) +(defmethod ashelin-method-247 ((this ashelin)) (cond ((logtest? (bot-flags bf20) (-> this bot-flags)) (set! (-> this root trans w) 1.0) @@ -667,7 +661,7 @@ ) ) -(defmethod ashelin-method-248 ashelin ((this ashelin)) +(defmethod ashelin-method-248 ((this ashelin)) (when (logtest? (bot-flags bf20) (-> this bot-flags)) (set! (-> this root trans w) 1.0) (set! (-> this focus-info bullseye w) 1.0) @@ -686,7 +680,7 @@ ) ) -(defmethod go-hostile ashelin ((this ashelin)) +(defmethod go-hostile ((this ashelin)) (bot-method-223 this #t) (cond ((not (bot-method-214 this)) @@ -704,7 +698,7 @@ ) ) -(defmethod react-to-focus ashelin ((this ashelin)) +(defmethod react-to-focus ((this ashelin)) "@TODO - flesh out docs" (if (bot-method-214 this) (go-hostile this) @@ -713,7 +707,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod ashelin-method-239 ashelin ((this ashelin)) +(defmethod ashelin-method-239 ((this ashelin)) (if (bot-method-214 this) (go (method-of-object this standing-idle)) (go (method-of-object this waiting-idle)) @@ -722,13 +716,13 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle ashelin ((this ashelin)) +(defmethod go-idle ((this ashelin)) (go (method-of-object this hidden)) (none) ) ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod fire-projectile ashelin ((this ashelin) (arg0 vector)) +(defmethod fire-projectile ((this ashelin) (arg0 vector)) (set-time! (-> this last-fire-time)) (+! (-> this fired-gun-count) 1) (let ((s4-0 (new 'stack-no-clear 'projectile-init-by-other-params))) @@ -754,7 +748,7 @@ (none) ) -(defmethod ashelin-method-249 ashelin ((this ashelin)) +(defmethod ashelin-method-249 ((this ashelin)) (with-pp (let* ((f30-0 (-> this nav state speed)) (f0-1 (lerp-scale 0.0 2.0 f30-0 12288.0 40960.0)) @@ -880,7 +874,7 @@ ) ) -(defmethod enemy-method-51 ashelin ((this ashelin)) +(defmethod enemy-method-51 ((this ashelin)) (local-vars (v1-36 art-element)) (let ((f28-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) @@ -941,7 +935,7 @@ ) ) -(defmethod enemy-method-77 ashelin ((this ashelin) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this ashelin) (arg0 (pointer float))) (local-vars (a2-0 int)) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) @@ -1008,7 +1002,7 @@ ) ) -(defmethod enemy-method-78 ashelin ((this ashelin) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this ashelin) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((v1-1 *ashelin-global-info*) @@ -1094,7 +1088,7 @@ ) ) -(defmethod enemy-method-79 ashelin ((this ashelin) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this ashelin) (arg0 int) (arg1 enemy-knocked-info)) (cond ((= arg0 3) (let ((s5-0 (ja-done? 0))) @@ -1207,7 +1201,7 @@ ) ) -(defmethod ashelin-method-236 ashelin ((this ashelin) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) +(defmethod ashelin-method-236 ((this ashelin) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) (local-vars (v1-23 float) (sv-272 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1265,7 +1259,7 @@ ) ) -(defmethod nav-enemy-method-142 ashelin ((this ashelin) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this ashelin) (arg0 nav-control)) (if (not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'back-spring) (= v1-3 'cartwheel-left) (= v1-3 'tumble-right)) ) @@ -1276,13 +1270,13 @@ (none) ) -(defmethod bot-method-216 ashelin ((this ashelin)) +(defmethod bot-method-216 ((this ashelin)) (set! (-> this health-handle) (ppointer->handle (process-spawn hud-ashelin :init hud-init-by-other :to this))) 0 (none) ) -(defmethod play-attacked-speech ashelin ((this ashelin)) +(defmethod play-attacked-speech ((this ashelin)) (local-vars (v1-3 int) (a3-0 int)) (when (not (channel-active? this (the-as uint 0))) (let ((v1-2 0)) @@ -1311,7 +1305,7 @@ (none) ) -(defmethod ashelin-method-244 ashelin ((this ashelin)) +(defmethod ashelin-method-244 ((this ashelin)) (when (not (channel-active? this (the-as uint 0))) (let ((a1-2 (bot-speech-list-method-9 (-> this ash-course ouch-speeches) @@ -1329,7 +1323,7 @@ (none) ) -(defmethod ashelin-method-245 ashelin ((this ashelin)) +(defmethod ashelin-method-245 ((this ashelin)) (when (and (not (channel-active? this (the-as uint 0))) (>= (current-time) (-> this victory-speech-time))) (let ((s5-0 (bot-speech-list-method-9 (-> this ash-course victory-speeches) @@ -1350,7 +1344,7 @@ (none) ) -(defmethod enemy-method-136 ashelin ((this ashelin)) +(defmethod enemy-method-136 ((this ashelin)) (when (time-elapsed? (-> this hit-focus-time) (seconds 2)) (let ((v0-0 (logclear (-> this enemy-flags) (enemy-flag look-at-focus)))) (set! (-> this enemy-flags) v0-0) @@ -1360,7 +1354,7 @@ ) ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod play-speech ashelin ((this ashelin) (arg0 int)) +(defmethod play-speech ((this ashelin) (arg0 int)) (let ((t9-0 (method-of-type bot play-speech))) (t9-0 this arg0) ) @@ -1368,7 +1362,7 @@ (none) ) -(defmethod draw hud-ashelin ((this hud-ashelin)) +(defmethod draw ((this hud-ashelin)) (set-hud-piece-position! (-> this sprites 2) (the int (+ 30.0 (* -130.0 (-> this offset)))) @@ -1383,14 +1377,14 @@ (none) ) -(defmethod update-values hud-ashelin ((this hud-ashelin)) +(defmethod update-values ((this hud-ashelin)) (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-ashelin ((this hud-ashelin)) +(defmethod init-callback ((this hud-ashelin)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/goal_src/jak2/levels/common/ai/bot-h.gc b/goal_src/jak2/levels/common/ai/bot-h.gc index b0432a7862d..d1dbebc00c4 100644 --- a/goal_src/jak2/levels/common/ai/bot-h.gc +++ b/goal_src/jak2/levels/common/ai/bot-h.gc @@ -99,225 +99,202 @@ ;; DECOMP BEGINS (deftype bot-focus-info (structure) - ((max-los-dist float :offset-assert 0) - (fproc process-focusable :offset-assert 4) - (bullseye-xz-dist float :offset-assert 8) - (ry-diff float :offset-assert 12) - (my-facing-ry float :offset-assert 16) - (bullseye-ry float :offset-assert 20) - (los int8 :offset-assert 24) - (update-time time-frame :offset-assert 32) - (bullseye vector :inline :offset-assert 48) - (pos vector :inline :offset-assert 64) - (my-facing-xz-dir vector :inline :offset-assert 80) - (bullseye-xz-dir vector :inline :offset-assert 96) + ((max-los-dist float) + (fproc process-focusable) + (bullseye-xz-dist float) + (ry-diff float) + (my-facing-ry float) + (bullseye-ry float) + (los int8) + (update-time time-frame) + (bullseye vector :inline) + (pos vector :inline) + (my-facing-xz-dir vector :inline) + (bullseye-xz-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) (deftype bot-turn-info (structure) - ((facing-ry float :offset-assert 0) - (targ-ry float :offset-assert 4) - (ry-diff float :offset-assert 8) - (predicted-ry-diff float :offset-assert 12) - (predicted-targ-ry float :offset-assert 16) - (facing-dir vector :inline :offset-assert 32) - (targ-pos vector :inline :offset-assert 48) - (predicted-targ-pos vector :inline :offset-assert 64) - (src-quat quaternion :inline :offset-assert 80) + ((facing-ry float) + (targ-ry float) + (ry-diff float) + (predicted-ry-diff float) + (predicted-targ-ry float) + (facing-dir vector :inline) + (targ-pos vector :inline) + (predicted-targ-pos vector :inline) + (src-quat quaternion :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) (deftype bot-speech-tuning (structure) - ((fo-min int32 :offset-assert 0) - (fo-max int32 :offset-assert 4) - (fo-curve int8 :offset-assert 8) - (trans? symbol :offset-assert 12) + ((fo-min int32) + (fo-max int32) + (fo-curve int8) + (trans? symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype bot-speech-info (structure) - ((flags speech-flags :offset-assert 0) - (hold-time uint16 :offset-assert 2) - (slave-id int8 :offset-assert 4) - (tuning-id int8 :offset-assert 5) - (name string :offset-assert 8) + ((flags speech-flags) + (hold-time uint16) + (slave-id int8) + (tuning-id int8) + (name string) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype bot-spot (structure) - ((center vector :inline :offset-assert 0) - (center-x float :offset 0) - (center-y float :offset 4) - (center-z float :offset 8) - (inside-xz-dist float :offset 12) - (blocked-xz-dist float :offset-assert 16) + ((center vector :inline) + (center-x float :overlay-at (-> center data 0)) + (center-y float :overlay-at (-> center data 1)) + (center-z float :overlay-at (-> center data 2)) + (inside-xz-dist float :overlay-at (-> center data 3)) + (blocked-xz-dist float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype bot-waypoint (basic) - ((waypoint-id int16 :offset-assert 4) - (nav-mesh-index int8 :offset-assert 6) - (skip-to int8 :offset-assert 7) - (on-set (function bot none) :offset-assert 8) - (on-update (function bot none) :offset-assert 12) - (on-skipping-here (function bot none) :offset-assert 16) - (check-too-far symbol :offset-assert 20) - (warn-dist float :offset-assert 24) - (fail-dist-delta float :offset-assert 28) + ((waypoint-id int16) + (nav-mesh-index int8) + (skip-to int8) + (on-set (function bot none)) + (on-update (function bot none)) + (on-skipping-here (function bot none)) + (check-too-far symbol) + (warn-dist float) + (fail-dist-delta float) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype bot-course (basic) - ((course-id uint8 :offset-assert 4) - (speech-count uint16 :offset-assert 6) - (spot-count uint16 :offset-assert 8) - (retry-cookie uint8 :offset-assert 10) - (too-far-warn-speeches bot-speech-list-shuffle :offset-assert 12) - (too-far-fail-speeches bot-speech-list :offset-assert 16) - (attack-player-speeches bot-speech-list :offset-assert 20) - (default-check-too-far symbol :offset-assert 24) - (waypoints (array bot-waypoint) :offset-assert 28) - (speeches (inline-array bot-speech-info) :offset-assert 32) - (speech-tunings (inline-array bot-speech-tuning) :offset-assert 36) - (dirs (inline-array vector) :offset-assert 40) - (spots (inline-array bot-spot) :offset-assert 44) + ((course-id uint8) + (speech-count uint16) + (spot-count uint16) + (retry-cookie uint8) + (too-far-warn-speeches bot-speech-list-shuffle) + (too-far-fail-speeches bot-speech-list) + (attack-player-speeches bot-speech-list) + (default-check-too-far symbol) + (waypoints (array bot-waypoint)) + (speeches (inline-array bot-speech-info)) + (speech-tunings (inline-array bot-speech-tuning)) + (dirs (inline-array vector)) + (spots (inline-array bot-spot)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype bot (nav-enemy) - ((bot-flags bot-flags :offset-assert 604) - (min-speed float :offset-assert 608) - (max-speed float :offset-assert 612) - (follow-offset float :offset-assert 616) - (too-far-warn-dist float :offset-assert 620) - (too-far-fail-dist-delta float :offset-assert 624) - (too-far-warn-dist-default float :offset-assert 628) - (too-far-fail-dist-delta-default float :offset-assert 632) - (travel-prev-ry float :offset-assert 636) - (travel-prev-ry1 float :offset-assert 640) - (player-blocking float :offset-assert 644) - (ai-ctrl ai-task-control :offset-assert 648) - (course bot-course :offset-assert 652) - (waypoint bot-waypoint :offset-assert 656) - (waypoint-bits waypoint-bits :offset-assert 660) - (waypoint-int32a int32 :offset-assert 664) - (bot-task-bits bot-task-bits :offset-assert 668) - (hit-invuln-ignore-me-delay uint32 :offset-assert 672) - (hit-invuln-focus-disable-delay uint32 :offset-assert 676) - (warn-to-fail-timeout uint32 :offset-assert 680) - (warn-min-delay uint32 :offset-assert 684) - (warn-max-delay uint32 :offset-assert 688) - (spot-color uint32 :offset-assert 692) - (waypoint-request int16 :offset-assert 696) - (hit-by-enemy-count uint16 :offset-assert 698) - (hit-by-player-count uint16 :offset-assert 700) - (notice-enemy-dist float :offset-assert 704) - (channel uint8 :offset-assert 708) - (focus-mode int8 :offset-assert 709) - (nav-mesh-index int8 :offset-assert 710) - (delay-too-far-check int8 :offset-assert 711) - (slave-id int8 :offset-assert 712) - (vehicle-seat-index int8 :offset-assert 713) - (bot-health-index int8 :offset-assert 714) - (task game-task-control :offset-assert 716) - (swivel-joint-mod joint-mod :offset-assert 720) - (health-handle handle :offset-assert 728) - (poi-handle handle :offset-assert 736) - (my-simple-focus (pointer simple-focus) :offset-assert 744) - (attacker-handle handle :offset-assert 752) - (scene-player-handle handle :offset-assert 760) - (master-handle handle :offset-assert 768) - (vehicle-handle handle :offset-assert 776) - (hit-invuln-starting-time time-frame :offset-assert 784) - (danger-time time-frame :offset-assert 792) - (attacker-time time-frame :offset-assert 800) - (started-warning-time time-frame :offset-assert 808) - (waypoint-time0 time-frame :offset-assert 816) - (next-too-far-warn-time time-frame :offset-assert 824) - (spot bot-spot :inline :offset-assert 832) - (follow-dir vector :inline :offset-assert 864) - (focus-info bot-focus-info :inline :offset-assert 880) + ((bot-flags bot-flags) + (min-speed float) + (max-speed float) + (follow-offset float) + (too-far-warn-dist float) + (too-far-fail-dist-delta float) + (too-far-warn-dist-default float) + (too-far-fail-dist-delta-default float) + (travel-prev-ry float) + (travel-prev-ry1 float) + (player-blocking float) + (ai-ctrl ai-task-control) + (course bot-course) + (waypoint bot-waypoint) + (waypoint-bits waypoint-bits) + (waypoint-int32a int32) + (bot-task-bits bot-task-bits) + (hit-invuln-ignore-me-delay uint32) + (hit-invuln-focus-disable-delay uint32) + (warn-to-fail-timeout uint32) + (warn-min-delay uint32) + (warn-max-delay uint32) + (spot-color uint32) + (waypoint-request int16) + (hit-by-enemy-count uint16) + (hit-by-player-count uint16) + (notice-enemy-dist float) + (channel uint8) + (focus-mode int8) + (nav-mesh-index int8) + (delay-too-far-check int8) + (slave-id int8) + (vehicle-seat-index int8) + (bot-health-index int8) + (task game-task-control) + (swivel-joint-mod joint-mod) + (health-handle handle) + (poi-handle handle) + (my-simple-focus (pointer simple-focus)) + (attacker-handle handle) + (scene-player-handle handle) + (master-handle handle) + (vehicle-handle handle) + (hit-invuln-starting-time time-frame) + (danger-time time-frame) + (attacker-time time-frame) + (started-warning-time time-frame) + (waypoint-time0 time-frame) + (next-too-far-warn-time time-frame) + (spot bot-spot :inline) + (follow-dir vector :inline) + (focus-info bot-focus-info :inline) ) - :heap-base #x360 - :method-count-assert 225 - :size-assert #x3e0 - :flag-assert #xe1036003e0 + (:state-methods + failed + hidden + ) (:methods - (failed () _type_ :state 178) - (hidden () _type_ :state 179) - (clear-poi-and-focus! (_type_) none 180) - (bot-method-181 (_type_ vector vector vector vector vector float) none 181) - (turn-to-target (_type_ bot-turn-info process-focusable float) none 182) - (alive? (_type_) symbol 183) - (bot-debug-draw-spot-id (_type_) none 184) - (bot-debug-draw-sphere (_type_ vector rgba) none 185) - (bot-debug-draw-spot-sphere (_type_ int (pointer uint) int) none 186) - (reset-attacker! (_type_) none 187) - (scene-release? (_type_) symbol 188) - (select-focus! (_type_) process 189) - (bot-method-190 (_type_) symbol 190) - (bot-method-191 (_type_) none 191) - (bot-method-192 (_type_) none 192) - (bot-method-193 (_type_) symbol 193) - (outside-spot-radius? (_type_ bot-spot vector symbol) symbol 194) - (attacked-by-player? (_type_ process-focusable) symbol 195) - (bot-method-196 (_type_) none 196) - (fail-mission! (_type_) none 197) - (set-cam-height! (_type_ vector) meters 198) - (cam-move-to-bot (_type_) none 199) - (fail-falling (_type_) none 200) - (set-next-focus! (_type_ enemy enemy-best-focus) none 201) - (choose-spot (_type_ int (pointer uint)) int 202) - (play-attacked-speech (_type_) none 203) - (play-too-far-warn-speech (_type_) symbol 204) - (scene-play (_type_ string symbol) symbol 205) - (play-speech (_type_ int) none 206) - (play-death-sound (_type_ string) none 207) - (bot-method-208 (_type_) symbol 208) - (channel-active? (_type_ uint) symbol 209) - (init! (_type_) none 210) - (clear-speech-flags! (_type_) none 211) - (reset-warn-time! (_type_) none 212) - (go-to-waypoint! (_type_ int symbol) object 213) - (bot-method-214 (_type_) symbol 214) - (skip-waypoint (_type_) none 215) - (bot-method-216 (_type_) none 216) - (speech-ended? (_type_ int) symbol 217) - (speech-playing? (_type_ int) symbol 218) - (player-blocking-spot? (_type_ bot-spot) symbol 219) - (stop-speech (_type_ uint symbol) none 220) - (bot-method-221 (_type_) quaternion 221) - (bot-method-222 (_type_ vector) none 222) - (bot-method-223 (_type_ symbol) none 223) - (bot-check-too-far (_type_) symbol 224) + (clear-poi-and-focus! (_type_) none) + (bot-method-181 (_type_ vector vector vector vector vector float) none) + (turn-to-target (_type_ bot-turn-info process-focusable float) none) + (alive? (_type_) symbol) + (bot-debug-draw-spot-id (_type_) none) + (bot-debug-draw-sphere (_type_ vector rgba) none) + (bot-debug-draw-spot-sphere (_type_ int (pointer uint) int) none) + (reset-attacker! (_type_) none) + (scene-release? (_type_) symbol) + (select-focus! (_type_) process) + (bot-method-190 (_type_) symbol) + (bot-method-191 (_type_) none) + (bot-method-192 (_type_) none) + (bot-method-193 (_type_) symbol) + (outside-spot-radius? (_type_ bot-spot vector symbol) symbol) + (attacked-by-player? (_type_ process-focusable) symbol) + (bot-method-196 (_type_) none) + (fail-mission! (_type_) none) + (set-cam-height! (_type_ vector) meters) + (cam-move-to-bot (_type_) none) + (fail-falling (_type_) none) + (set-next-focus! (_type_ enemy enemy-best-focus) none) + (choose-spot (_type_ int (pointer uint)) int) + (play-attacked-speech (_type_) none) + (play-too-far-warn-speech (_type_) symbol) + (scene-play (_type_ string symbol) symbol) + (play-speech (_type_ int) none) + (play-death-sound (_type_ string) none) + (bot-method-208 (_type_) symbol) + (channel-active? (_type_ uint) symbol) + (init! (_type_) none) + (clear-speech-flags! (_type_) none) + (reset-warn-time! (_type_) none) + (go-to-waypoint! (_type_ int symbol) object) + (bot-method-214 (_type_) symbol) + (skip-waypoint (_type_) none) + (bot-method-216 (_type_) none) + (speech-ended? (_type_ int) symbol) + (speech-playing? (_type_ int) symbol) + (player-blocking-spot? (_type_ bot-spot) symbol) + (stop-speech (_type_ uint symbol) none) + (bot-method-221 (_type_) quaternion) + (bot-method-222 (_type_ vector) none) + (bot-method-223 (_type_ symbol) none) + (bot-check-too-far (_type_) symbol) ) ) @@ -573,22 +550,19 @@ (ai-task-pool-method-11 *bot-task-pool*) (deftype bot-speech-list (basic) - ((flags uint8 :offset-assert 4) - (retry-cookie uint8 :offset-assert 5) - (last-local-index int16 :offset-assert 6) - (speech-indexes (array int16) :offset-assert 8) + ((flags uint8) + (retry-cookie uint8) + (last-local-index int16) + (speech-indexes (array int16)) ) - :method-count-assert 11 - :size-assert #xc - :flag-assert #xb0000000c (:methods - (bot-speech-list-method-9 (_type_ bot (inline-array bot-speech-info) speech-flags) int 9) - (reset-index (_type_ symbol) none 10) + (bot-speech-list-method-9 (_type_ bot (inline-array bot-speech-info) speech-flags) int) + (reset-index (_type_ symbol) none) ) ) -(defmethod reset-index bot-speech-list ((this bot-speech-list) (arg0 symbol)) +(defmethod reset-index ((this bot-speech-list) (arg0 symbol)) (if arg0 (logand! (-> this flags) -2) ) @@ -597,7 +571,7 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod bot-speech-list-method-9 bot-speech-list ((sp-list bot-speech-list) (bot bot) (sp-info (inline-array bot-speech-info)) (arg3 speech-flags)) +(defmethod bot-speech-list-method-9 ((sp-list bot-speech-list) (bot bot) (sp-info (inline-array bot-speech-info)) (arg3 speech-flags)) (let ((v1-1 (-> bot course retry-cookie))) (when (!= v1-1 (-> sp-list retry-cookie)) (set! (-> sp-list retry-cookie) (-> bot course retry-cookie)) @@ -645,16 +619,13 @@ ) (deftype bot-speech-list-shuffle (bot-speech-list) - ((history-mask uint64 :offset-assert 16) - (history-mask-full uint64 :offset-assert 24) + ((history-mask uint64) + (history-mask-full uint64) ) - :method-count-assert 11 - :size-assert #x20 - :flag-assert #xb00000020 ) -(defmethod reset-index bot-speech-list-shuffle ((this bot-speech-list-shuffle) (arg0 symbol)) +(defmethod reset-index ((this bot-speech-list-shuffle) (arg0 symbol)) (let ((t9-0 (method-of-type bot-speech-list reset-index))) (t9-0 this arg0) ) @@ -674,7 +645,7 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod bot-speech-list-method-9 bot-speech-list-shuffle ((this bot-speech-list-shuffle) (bot bot) (sp-info (inline-array bot-speech-info)) (sp-flags speech-flags)) +(defmethod bot-speech-list-method-9 ((this bot-speech-list-shuffle) (bot bot) (sp-info (inline-array bot-speech-info)) (sp-flags speech-flags)) (local-vars (sv-16 int)) (let ((course-cookie (-> bot course retry-cookie))) (when (!= course-cookie (-> this retry-cookie)) @@ -728,11 +699,8 @@ ) (deftype bot-course-table (basic) - ((course bot-course 18 :offset-assert 4) + ((course bot-course 18) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) diff --git a/goal_src/jak2/levels/common/ai/bot.gc b/goal_src/jak2/levels/common/ai/bot.gc index 7bf9222cabb..fe4463731f2 100644 --- a/goal_src/jak2/levels/common/ai/bot.gc +++ b/goal_src/jak2/levels/common/ai/bot.gc @@ -7,18 +7,18 @@ ;; DECOMP BEGINS -(defmethod run-logic? bot ((this bot)) +(defmethod run-logic? ((this bot)) #t ) ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-debug-draw-sphere bot ((this bot) (arg0 vector) (arg1 rgba)) +(defmethod bot-debug-draw-sphere ((this bot) (arg0 vector) (arg1 rgba)) (add-debug-sphere #t (bucket-id debug2) (the-as vector (&-> arg0 x)) (-> arg0 w) arg1) (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-debug-draw-spot-sphere bot ((this bot) (arg0 int) (arg1 (pointer uint)) (arg2 int)) +(defmethod bot-debug-draw-spot-sphere ((this bot) (arg0 int) (arg1 (pointer uint)) (arg2 int)) (let* ((s2-0 (-> this spot-color)) (s1-0 s2-0) ) @@ -44,7 +44,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-debug-draw-spot-id bot ((this bot)) +(defmethod bot-debug-draw-spot-id ((this bot)) (let ((course (-> this course))) (countdown (i (-> course spot-count)) (let ((spot (-> course spots i))) @@ -66,7 +66,7 @@ (none) ) -(defmethod outside-spot-radius? bot ((this bot) (spot bot-spot) (bot-trans vector) (arg3 symbol)) +(defmethod outside-spot-radius? ((this bot) (spot bot-spot) (bot-trans vector) (arg3 symbol)) "Are we outside of the given [[bot-spot]] radius?" (if (not spot) (set! spot (-> this spot)) @@ -82,13 +82,13 @@ ) ) -(defmethod player-blocking-spot? bot ((this bot) (spot bot-spot)) +(defmethod player-blocking-spot? ((this bot) (spot bot-spot)) (let ((f0-0 (-> spot blocked-xz-dist))) (and (!= f0-0 0.0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> spot center)))) ) ) -(defmethod choose-spot bot ((this bot) (num-spots int) (spot-indices (pointer uint))) +(defmethod choose-spot ((this bot) (num-spots int) (spot-indices (pointer uint))) "Choose the closest [[bot-spot]] that is not blocked by the player." (let ((spot-idx 0)) (let ((f30-0 -1.0) @@ -111,12 +111,12 @@ ) ) -(defmethod enemy-method-108 bot ((this bot) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 ((this bot) (arg0 enemy) (arg1 event-message-block)) 0 ) ;; WARN: Return type mismatch symbol vs none. -(defmethod reset-attacker! bot ((this bot)) +(defmethod reset-attacker! ((this bot)) (logclear! (-> this bot-flags) (bot-flags attacked)) (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-5 (if (type? s5-0 process-focusable) @@ -131,7 +131,7 @@ (none) ) -(defmethod bot-method-193 bot ((this bot)) +(defmethod bot-method-193 ((this bot)) (let ((gp-0 #f)) (let ((v1-0 (-> this incoming penetrate-using))) (cond @@ -162,7 +162,7 @@ ) ) -(defmethod bot-method-190 bot ((this bot)) +(defmethod bot-method-190 ((this bot)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -295,7 +295,7 @@ ) ) -(defmethod enemy-method-106 bot ((this bot) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 ((this bot) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) (t9-0 this arg0 arg1 arg2 arg3) ) @@ -347,7 +347,7 @@ (none) ) -(defmethod damage-amount-from-attack bot ((this bot) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this bot) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let* ((t9-0 (method-of-type nav-enemy damage-amount-from-attack)) (v0-0 (t9-0 this arg0 arg1)) @@ -373,7 +373,7 @@ ) ) -(defmethod enemy-method-58 bot ((this bot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 ((this bot) (arg0 process) (arg1 event-message-block)) (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) (v0-0 (t9-0 this arg0 arg1)) ) @@ -384,7 +384,7 @@ ) ) -(defmethod clear-poi-and-focus! bot ((this bot)) +(defmethod clear-poi-and-focus! ((this bot)) "Clear our point of interest and focus handles." (let* ((s4-0 (handle->process (-> this poi-handle))) (s5-0 (if (type? s4-0 process-focusable) @@ -409,7 +409,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod attacked-by-player? bot ((this bot) (fproc process-focusable)) +(defmethod attacked-by-player? ((this bot) (fproc process-focusable)) "Were we attacked by the player?" (the-as symbol @@ -422,19 +422,19 @@ ) ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! bot ((this bot) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod update-target-awareness! ((this bot) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! @TODO - flesh out docs @returns the value that sets `aware`" (the-as enemy-aware 3) ) -(defmethod enemy-method-61 bot ((this bot) (arg0 int)) +(defmethod enemy-method-61 ((this bot) (arg0 int)) 3 ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-129 bot ((this bot)) +(defmethod enemy-method-129 ((this bot)) (local-vars (s5-1 process)) (let ((s5-0 (-> this focus))) (cond @@ -464,7 +464,7 @@ (none) ) -(defmethod enemy-method-97 bot ((this bot)) +(defmethod enemy-method-97 ((this bot)) (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 @@ -564,7 +564,7 @@ ) ) -(defmethod select-focus! bot ((this bot)) +(defmethod select-focus! ((this bot)) "Find enemies around our `notice-enemy-dist` and choose a target." (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) @@ -696,7 +696,7 @@ ) ;; WARN: Return type mismatch enemy vs none. -(defmethod set-next-focus! bot ((this bot) (enemy enemy) (arg2 enemy-best-focus)) +(defmethod set-next-focus! ((this bot) (enemy enemy) (arg2 enemy-best-focus)) (let ((enemy-dist (new 'stack-no-clear 'vector))) (vector-! enemy-dist (-> enemy root trans) (-> this root trans)) (let ((rating (vector-length enemy-dist))) @@ -712,12 +712,12 @@ (none) ) -(defmethod alive? bot ((this bot)) +(defmethod alive? ((this bot)) (and (not (focus-test? this dead grabbed)) (nonzero? (-> this hit-points)) (zero? (-> this fated-time))) ) ;; WARN: disable def twice: 280. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler bot ((this bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v0-0 object)) @@ -919,7 +919,7 @@ ) ) -(defmethod enemy-method-104 bot ((this bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ((this bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (cond ((and (= (-> arg0 type) target) (not (logtest? (-> this bot-flags) (bot-flags attacked)))) (when (send-event @@ -949,7 +949,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 bot ((this bot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 ((this bot) (arg0 process) (arg1 event-message-block)) (the-as symbol (cond @@ -1022,7 +1022,7 @@ ) ) -(defmethod play-too-far-warn-speech bot ((this bot)) +(defmethod play-too-far-warn-speech ((this bot)) (when (not (channel-active? this (the-as uint 0))) (let ((idx (bot-speech-list-method-9 (-> this course too-far-warn-speeches) @@ -1046,7 +1046,7 @@ ) ;; WARN: Using new Jak 2 rtype-of -(defmethod bot-check-too-far bot ((this bot)) +(defmethod bot-check-too-far ((this bot)) "Call the current [[bot-waypoint]]'s `check-too-far` function if available, otherwise use the default `course` one. If the player is too far, play a warning speech." (let ((result 0)) @@ -1103,7 +1103,7 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod reset-warn-time! bot ((this bot)) +(defmethod reset-warn-time! ((this bot)) (set! (-> this started-warning-time) 0) (set! (-> this next-too-far-warn-time) (+ (current-time) @@ -1113,7 +1113,7 @@ If the player is too far, play a warning speech." (none) ) -(defmethod track-target! bot ((this bot)) +(defmethod track-target! ((this bot)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1171,7 +1171,7 @@ If the player is too far, play a warning speech." (none) ) -(defmethod scene-play bot ((this bot) (scene string) (grab? symbol)) +(defmethod scene-play ((this bot) (scene string) (grab? symbol)) "Spawn a [[scene-player]] process for the given scene." (when (and (process-grab? this #t) (or grab? (process-grab? *target* #t))) (process-grab? this #f) @@ -1185,7 +1185,7 @@ If the player is too far, play a warning speech." ) ) -(defmethod scene-release? bot ((this bot)) +(defmethod scene-release? ((this bot)) (when (not (handle->process (-> this scene-player-handle))) (process-release? this) #t @@ -1193,7 +1193,7 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch symbol vs none. -(defmethod clear-speech-flags! bot ((this bot)) +(defmethod clear-speech-flags! ((this bot)) "Clear the `playing` flag for all of our speeches." (let ((speeches (-> this course speeches))) (countdown (i (-> this course speech-count)) @@ -1206,7 +1206,7 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch gui-connection vs none. -(defmethod play-speech bot ((this bot) (idx int)) +(defmethod play-speech ((this bot) (idx int)) (let* ((course (-> this course)) (speech (-> course speeches idx)) ) @@ -1239,7 +1239,7 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-death-sound bot ((this bot) (sound string)) +(defmethod play-death-sound ((this bot) (sound string)) "Play one of our death sounds." (add-process *gui-control* @@ -1253,7 +1253,7 @@ If the player is too far, play a warning speech." (none) ) -(defmethod speech-ended? bot ((this bot) (idx int)) +(defmethod speech-ended? ((this bot) (idx int)) "Is the given speech active?" (let ((speech (-> this course speeches idx))) (= (get-status @@ -1265,14 +1265,14 @@ If the player is too far, play a warning speech." ) ) -(defmethod speech-playing? bot ((this bot) (idx int)) +(defmethod speech-playing? ((this bot) (idx int)) "Is the given speech playing?" (let ((v1-2 (-> this course speeches idx))) (logtest? (-> v1-2 flags) (speech-flags playing)) ) ) -(defmethod channel-active? bot ((this bot) (channel uint)) +(defmethod channel-active? ((this bot) (channel uint)) "Is the given [[gui-channel]] active?" (if (zero? channel) (set! channel (-> this channel)) @@ -1284,7 +1284,7 @@ If the player is too far, play a warning speech." ) ) -(defmethod stop-speech bot ((this bot) (channel uint) (arg1 symbol)) +(defmethod stop-speech ((this bot) (channel uint) (arg1 symbol)) (if (zero? channel) (set! channel (-> this channel)) ) @@ -1327,7 +1327,7 @@ If the player is too far, play a warning speech." (none) ) -(defmethod go-to-waypoint! bot ((this bot) (id int) (skipped? symbol)) +(defmethod go-to-waypoint! ((this bot) (id int) (skipped? symbol)) "Start moving to the given [[bot-waypoint]]." (let* ((course (-> this course)) (waypoint-count (-> course waypoints length)) @@ -1368,7 +1368,7 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch object vs none. -(defmethod skip-waypoint bot ((this bot)) +(defmethod skip-waypoint ((this bot)) (let ((skip-id (-> this waypoint skip-to))) (when (>= skip-id 0) (stop-speech this (the-as uint 0) #f) @@ -1380,7 +1380,7 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch nav-enemy vs bot. -(defmethod relocate bot ((this bot) (arg0 int)) +(defmethod relocate ((this bot) (arg0 int)) (if (nonzero? (-> this ai-ctrl)) (&+! (-> this ai-ctrl) arg0) ) @@ -1393,7 +1393,7 @@ If the player is too far, play a warning speech." (the-as bot ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod deactivate bot ((this bot)) +(defmethod deactivate ((this bot)) (send-event (handle->process (-> this health-handle)) 'hide-and-die) (if (nonzero? (-> this ai-ctrl)) (ai-task-control-method-9 (-> this ai-ctrl)) @@ -1402,7 +1402,7 @@ If the player is too far, play a warning speech." (none) ) -(defmethod init! bot ((this bot)) +(defmethod init! ((this bot)) "Set defaults for various fields." (set! (-> this master-handle) (the-as handle #f)) (set! (-> this health-handle) (the-as handle #f)) @@ -1428,7 +1428,7 @@ If the player is too far, play a warning speech." (none) ) -(defmethod init-enemy! bot ((this bot)) +(defmethod init-enemy! ((this bot)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (process-entity-status! this (entity-perm-status bit-4) #t) (set! (-> this ai-ctrl) (new 'process 'ai-task-control *bot-task-pool*)) @@ -1473,7 +1473,7 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch object vs symbol. -(defmethod bot-method-214 bot ((this bot)) +(defmethod bot-method-214 ((this bot)) (the-as symbol (when (logtest? (-> this bot-flags) (bot-flags bf00)) (let ((fproc (handle->process (-> this focus handle)))) (and fproc @@ -1486,7 +1486,7 @@ If the player is too far, play a warning speech." ) ) -(defmethod bot-method-223 bot ((this bot) (arg0 symbol)) +(defmethod bot-method-223 ((this bot) (arg0 symbol)) (let ((focus (-> this focus-info)) (timer (current-time)) (focus-proc (handle->process (-> this focus handle))) @@ -1570,7 +1570,7 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch float vs none. -(defmethod turn-to-target bot ((this bot) (turn-info bot-turn-info) (proc process-focusable) (arg3 float)) +(defmethod turn-to-target ((this bot) (turn-info bot-turn-info) (proc process-focusable) (arg3 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1614,7 +1614,7 @@ If the player is too far, play a warning speech." ) ) -(defmethod bot-method-208 bot ((this bot)) +(defmethod bot-method-208 ((this bot)) (let ((s5-0 #f)) (when *target* (let ((target-trans (-> *target* control trans)) @@ -1645,7 +1645,7 @@ If the player is too far, play a warning speech." ) ) -(defmethod enemy-method-82 bot ((this bot) (arg0 enemy-jump-info)) +(defmethod enemy-method-82 ((this bot) (arg0 enemy-jump-info)) "@abstract" (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) @@ -1654,7 +1654,7 @@ If the player is too far, play a warning speech." ) ) -(defmethod bot-method-222 bot ((this bot) (arg0 vector)) +(defmethod bot-method-222 ((this bot) (arg0 vector)) (let ((s1-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) (v1-0 (new 'stack-no-clear 'vector)) @@ -1686,7 +1686,7 @@ If the player is too far, play a warning speech." (none) ) -(defmethod bot-method-221 bot ((this bot)) +(defmethod bot-method-221 ((this bot)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-identity! gp-0) (quaternion-pseudo-seek @@ -1698,7 +1698,7 @@ If the player is too far, play a warning speech." ) ) -(defmethod play-attacked-speech bot ((this bot)) +(defmethod play-attacked-speech ((this bot)) (when (not (channel-active? this (the-as uint 0))) (let ((idx (bot-speech-list-method-9 (-> this course attack-player-speeches) @@ -1717,13 +1717,13 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch bot-flags vs none. -(defmethod bot-method-196 bot ((this bot)) +(defmethod bot-method-196 ((this bot)) (logior! (-> this bot-flags) (bot-flags too-far-fail)) (none) ) ;; WARN: Return type mismatch bot-flags vs none. -(defmethod fail-mission! bot ((this bot)) +(defmethod fail-mission! ((this bot)) (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) (logclear! (-> this mask) (process-mask collectable)) (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) @@ -1761,7 +1761,7 @@ If the player is too far, play a warning speech." (none) ) -(defmethod fail-falling bot ((this bot)) +(defmethod fail-falling ((this bot)) (if (logtest? (-> this bot-flags) (bot-flags failed)) (cam-move-to-bot this) ) @@ -1769,7 +1769,7 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch object vs none. -(defmethod cam-move-to-bot bot ((this bot)) +(defmethod cam-move-to-bot ((this bot)) (cond ((logtest? (-> this bot-flags) (bot-flags bf13)) (logclear! (-> this bot-flags) (bot-flags bf13)) @@ -1799,7 +1799,7 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! bot ((this bot) (arg0 vector)) +(defmethod set-cam-height! ((this bot) (arg0 vector)) (set-vector! arg0 0.0 12288.0 28672.0 1.0) (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) (the-as @@ -1811,7 +1811,7 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch focus-status vs none. -(defmethod bot-method-191 bot ((this bot)) +(defmethod bot-method-191 ((this bot)) (logior! (-> this bot-flags) (bot-flags bf02)) (set-time! (-> this hit-invuln-starting-time)) (logclear! (-> this enemy-flags) (enemy-flag enable-on-active)) @@ -1825,7 +1825,7 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch bot-flags vs none. -(defmethod bot-method-192 bot ((this bot)) +(defmethod bot-method-192 ((this bot)) (local-vars (a2-7 enemy-flag)) (let ((a1-0 (-> this hit-invuln-starting-time)) (v1-0 #t) @@ -1879,17 +1879,17 @@ If the player is too far, play a warning speech." (none) ) -(defmethod bot-method-216 bot ((this bot)) +(defmethod bot-method-216 ((this bot)) 0 (none) ) -(defmethod coin-flip? bot ((this bot)) +(defmethod coin-flip? ((this bot)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod bot-method-181 bot ((this bot) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) +(defmethod bot-method-181 ((this bot) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) diff --git a/goal_src/jak2/levels/common/ai/halt/hal-h.gc b/goal_src/jak2/levels/common/ai/halt/hal-h.gc index bad063c9525..ae2d51b8ef3 100644 --- a/goal_src/jak2/levels/common/ai/halt/hal-h.gc +++ b/goal_src/jak2/levels/common/ai/halt/hal-h.gc @@ -8,27 +8,20 @@ ;; DECOMP BEGINS (deftype hal (bot) - ((handle-failed-slave-id int8 :offset-assert 992) - (slave-handle handle 3 :offset-assert 1000) + ((handle-failed-slave-id int8) + (slave-handle handle 3) ) - :heap-base #x380 - :method-count-assert 227 - :size-assert #x400 - :flag-assert #xe303800400 (:methods - (hal-method-225 (_type_) symbol 225) - (hal-method-226 (_type_) symbol 226) + (hal-method-225 (_type_) symbol) + (hal-method-226 (_type_) symbol) ) ) (deftype halt-wait-spot (ai-task) - ((check-done (function halt-wait-spot hal symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function halt-wait-spot hal symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) diff --git a/goal_src/jak2/levels/common/ai/halt/hal-task.gc b/goal_src/jak2/levels/common/ai/halt/hal-task.gc index 89191fdb752..a6c3247c8df 100644 --- a/goal_src/jak2/levels/common/ai/halt/hal-task.gc +++ b/goal_src/jak2/levels/common/ai/halt/hal-task.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod reset-task! halt-wait-spot ((this halt-wait-spot)) +(defmethod reset-task! ((this halt-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) 0) (set! (-> this num-spots) (the-as uint 1)) @@ -15,7 +15,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 halt-wait-spot ((this halt-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this halt-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere diff --git a/goal_src/jak2/levels/common/ai/halt/hal.gc b/goal_src/jak2/levels/common/ai/halt/hal.gc index e9e19e729f3..cdc6dde7997 100644 --- a/goal_src/jak2/levels/common/ai/halt/hal.gc +++ b/goal_src/jak2/levels/common/ai/halt/hal.gc @@ -136,7 +136,7 @@ ) ) -(defmethod stop-speech hal ((this hal) (arg0 uint) (arg1 symbol)) +(defmethod stop-speech ((this hal) (arg0 uint) (arg1 symbol)) (cond ((zero? arg0) (let ((t9-0 (method-of-type bot stop-speech))) @@ -160,7 +160,7 @@ ) ;; WARN: Return type mismatch gui-connection vs none. -(defmethod play-speech hal ((this hal) (arg0 int)) +(defmethod play-speech ((this hal) (arg0 int)) (let ((v1-2 (-> this course speeches arg0))) (logior! (-> v1-2 flags) (speech-flags playing)) (let ((a1-4 (-> v1-2 slave-id)) @@ -205,7 +205,7 @@ (none) ) -(defmethod channel-active? hal ((this hal) (arg0 uint)) +(defmethod channel-active? ((this hal) (arg0 uint)) "Is the given [[gui-channel]] active?" (cond ((zero? arg0) @@ -233,7 +233,7 @@ ) ) -(defmethod hal-method-226 hal ((this hal)) +(defmethod hal-method-226 ((this hal)) (countdown (s5-0 3) (let ((a0-2 (handle->process (-> this slave-handle s5-0)))) (when a0-2 @@ -246,7 +246,7 @@ #t ) -(defmethod hal-method-225 hal ((this hal)) +(defmethod hal-method-225 ((this hal)) (countdown (v1-0 3) (if (handle->process (-> this slave-handle v1-0)) (return #f) @@ -256,7 +256,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-method-196 hal ((this hal)) +(defmethod bot-method-196 ((this hal)) (when (not (logtest? (-> this bot-flags) (bot-flags too-far-fail))) (let ((t9-0 (method-of-type bot bot-method-196))) (t9-0 this) @@ -272,7 +272,7 @@ (none) ) -(defmethod init-enemy-collision! hal ((this hal)) +(defmethod init-enemy-collision! ((this hal)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -297,7 +297,7 @@ (none) ) -(defmethod init! hal ((this hal)) +(defmethod init! ((this hal)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) (t9-0 this) @@ -311,7 +311,7 @@ (none) ) -(defmethod init-enemy! hal ((this hal)) +(defmethod init-enemy! ((this hal)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (initialize-skeleton @@ -342,7 +342,7 @@ (none) ) -(defmethod scene-play hal ((this hal) (arg0 string) (arg1 symbol)) +(defmethod scene-play ((this hal) (arg0 string) (arg1 symbol)) "Spawn a [[scene-player]] process for the given scene." (when (and (process-grab? this #t) (or arg1 (process-grab? *target* #t))) (countdown (s3-0 3) @@ -370,7 +370,7 @@ ) ) -(defmethod scene-release? hal ((this hal)) +(defmethod scene-release? ((this hal)) (when (not (handle->process (-> this scene-player-handle))) (process-release? this) (countdown (s5-0 3) @@ -384,7 +384,7 @@ ) ) -(defmethod general-event-handler hal ((this hal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this hal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 diff --git a/goal_src/jak2/levels/common/ai/ruffian/ruf-h.gc b/goal_src/jak2/levels/common/ai/ruffian/ruf-h.gc index 43d079c38b3..66fd5925b12 100644 --- a/goal_src/jak2/levels/common/ai/ruffian/ruf-h.gc +++ b/goal_src/jak2/levels/common/ai/ruffian/ruf-h.gc @@ -8,95 +8,78 @@ ;; DECOMP BEGINS (deftype ruffian-course (bot-course) - ((ouch-speeches bot-speech-list-shuffle :offset-assert 48) + ((ouch-speeches bot-speech-list-shuffle) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) (deftype ruffian (bot) - ((ruf-course ruffian-course :offset 652) - (travel-anim-interp float :offset-assert 992) - (fired-gun-count uint32 :offset-assert 996) - (next-fire-time time-frame :offset-assert 1000) + ((ruf-course ruffian-course :overlay-at course) + (travel-anim-interp float) + (fired-gun-count uint32) + (next-fire-time time-frame) ) - :heap-base #x370 - :method-count-assert 246 - :size-assert #x3f0 - :flag-assert #xf6037003f0 + (:state-methods + kick + blast + alert-idle + alert-turn + traveling + traveling-blocked + waiting-idle + waiting-turn + scared-idle + scared-turn + plant-bomb + bomb-recoil + ) (:methods - (kick () _type_ :state 225) - (blast () _type_ :state 226) - (alert-idle () _type_ :state 227) - (alert-turn () _type_ :state 228) - (traveling () _type_ :state 229) - (traveling-blocked () _type_ :state 230) - (waiting-idle () _type_ :state 231) - (waiting-turn () _type_ :state 232) - (scared-idle () _type_ :state 233) - (scared-turn () _type_ :state 234) - (plant-bomb () _type_ :state 235) - (bomb-recoil () _type_ :state 236) - (ruffian-method-237 (_type_) symbol 237) - (ruffian-method-238 (_type_) symbol 238) - (fire-gun (_type_ vector) none 239) - (ruffian-method-240 (_type_) none 240) - (ruffian-method-241 (_type_) none 241) - (ruffian-method-242 (_type_) none 242) - (ruffian-method-243 (_type_) symbol 243) - (ruffian-method-244 (_type_) none 244) - (ruffian-method-245 (_type_) none 245) + (ruffian-method-237 (_type_) symbol) + (ruffian-method-238 (_type_) symbol) + (fire-gun (_type_ vector) none) + (ruffian-method-240 (_type_) none) + (ruffian-method-241 (_type_) none) + (ruffian-method-242 (_type_) none) + (ruffian-method-243 (_type_) symbol) + (ruffian-method-244 (_type_) none) + (ruffian-method-245 (_type_) none) ) ) (deftype ruft-wait-spot (ai-task) - ((check-done (function ruft-wait-spot ruffian symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function ruft-wait-spot ruffian symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype ruft-choose-jump (ai-task) - ((check-done (function ruft-choose-jump ruffian symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (src-spot-indexes uint8 4 :offset 38) - (dest-spot-indexes uint8 4 :offset 42) + ((check-done (function ruft-choose-jump ruffian symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (src-spot-indexes uint8 4 :overlay-at (-> bytes 6)) + (dest-spot-indexes uint8 4 :overlay-at (-> bytes 10)) ) - :method-count-assert 14 - :size-assert #x30 - :flag-assert #xe00000030 (:methods - (ruft-choose-jump-method-12 (_type_ ruffian) symbol 12) - (ruft-choose-jump-method-13 (_type_ ruffian) int 13) + (ruft-choose-jump-method-12 (_type_ ruffian) symbol) + (ruft-choose-jump-method-13 (_type_ ruffian) int) ) ) (deftype ruft-fight-focus (ai-task) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype ruft-plant-bomb (ai-task) - ((check-done (function ruft-plant-bomb ruffian symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (stand-spot-indexes uint8 2 :offset 38) - (face-spot-indexes uint8 2 :offset 40) + ((check-done (function ruft-plant-bomb ruffian symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (stand-spot-indexes uint8 2 :overlay-at (-> bytes 6)) + (face-spot-indexes uint8 2 :overlay-at (-> bytes 8)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) diff --git a/goal_src/jak2/levels/common/ai/ruffian/ruf-task.gc b/goal_src/jak2/levels/common/ai/ruffian/ruf-task.gc index 17f6502733f..b24a6ab5eb9 100644 --- a/goal_src/jak2/levels/common/ai/ruffian/ruf-task.gc +++ b/goal_src/jak2/levels/common/ai/ruffian/ruf-task.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod reset-task! ruft-wait-spot ((this ruft-wait-spot)) +(defmethod reset-task! ((this ruft-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -15,7 +15,7 @@ (none) ) -(defmethod ai-task-method-11 ruft-wait-spot ((this ruft-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this ruft-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) @@ -58,7 +58,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod ai-task-method-11 ruft-fight-focus ((this ruft-fight-focus) (arg0 bot)) +(defmethod ai-task-method-11 ((this ruft-fight-focus) (arg0 bot)) (let ((a1-1 (handle->process (-> arg0 focus handle)))) (if (and a1-1 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) @@ -73,12 +73,12 @@ ) ;; WARN: Return type mismatch bot-flags vs none. -(defmethod ai-task-method-10 ruft-fight-focus ((this ruft-fight-focus) (arg0 bot)) +(defmethod ai-task-method-10 ((this ruft-fight-focus) (arg0 bot)) (logclear! (-> arg0 bot-flags) (bot-flags bf00)) (none) ) -(defmethod ruft-choose-jump-method-13 ruft-choose-jump ((this ruft-choose-jump) (arg0 ruffian)) +(defmethod ruft-choose-jump-method-13 ((this ruft-choose-jump) (arg0 ruffian)) (let ((gp-0 0)) (let ((f30-0 -1.0) (s3-0 (-> arg0 root trans)) @@ -102,7 +102,7 @@ ) ) -(defmethod ruft-choose-jump-method-12 ruft-choose-jump ((this ruft-choose-jump) (arg0 ruffian)) +(defmethod ruft-choose-jump-method-12 ((this ruft-choose-jump) (arg0 ruffian)) (let ((a1-5 (-> arg0 ruf-course spots (-> this src-spot-indexes (-> this which-spot)))) (s5-0 (-> arg0 ruf-course spots (-> this dest-spot-indexes (-> this which-spot)))) ) @@ -120,7 +120,7 @@ ) ) -(defmethod reset-task! ruft-choose-jump ((this ruft-choose-jump)) +(defmethod reset-task! ((this ruft-choose-jump)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -129,7 +129,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 ruft-choose-jump ((this ruft-choose-jump) (arg0 bot)) +(defmethod ai-task-method-11 ((this ruft-choose-jump) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (or (< s4-0 0) (player-blocking-spot? arg0 (-> arg0 course spots (-> this src-spot-indexes s4-0))) @@ -168,12 +168,12 @@ (none) ) -(defmethod ai-task-method-10 ruft-choose-jump ((this ruft-choose-jump) (arg0 bot)) +(defmethod ai-task-method-10 ((this ruft-choose-jump) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) -(defmethod reset-task! ruft-plant-bomb ((this ruft-plant-bomb)) +(defmethod reset-task! ((this ruft-plant-bomb)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -181,7 +181,7 @@ (none) ) -(defmethod ai-task-method-11 ruft-plant-bomb ((this ruft-plant-bomb) (arg0 bot)) +(defmethod ai-task-method-11 ((this ruft-plant-bomb) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this stand-spot-indexes s4-0)))) @@ -245,7 +245,7 @@ (none) ) -(defmethod ai-task-method-10 ruft-plant-bomb ((this ruft-plant-bomb) (arg0 bot)) +(defmethod ai-task-method-10 ((this ruft-plant-bomb) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) diff --git a/goal_src/jak2/levels/common/ai/sig/sig-h.gc b/goal_src/jak2/levels/common/ai/sig/sig-h.gc index 6a0fe994f75..8c27242b416 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig-h.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig-h.gc @@ -23,111 +23,100 @@ ;; DECOMP BEGINS (deftype sig-plasma (structure) - ((flags plasma-flags :offset-assert 0) - (level float :offset-assert 4) - (min-level float :offset-assert 8) - (charge-speed float :offset-assert 12) - (powerup-sound-id sound-id :offset-assert 16) - (plasma-sound-id sound-id :offset-assert 20) + ((flags plasma-flags) + (level float) + (min-level float) + (charge-speed float) + (powerup-sound-id sound-id) + (plasma-sound-id sound-id) ) :pack-me - :method-count-assert 15 - :size-assert #x18 - :flag-assert #xf00000018 (:methods - (sig-plasma-method-9 (_type_) none 9) - (sig-plasma-method-10 (_type_) symbol 10) - (sig-plasma-method-11 (_type_ symbol) none 11) - (sig-plasma-method-12 (_type_) none 12) - (sig-plasma-method-13 (_type_) symbol 13) - (sig-plasma-method-14 (_type_ process-focusable) none 14) + (sig-plasma-method-9 (_type_) none) + (sig-plasma-method-10 (_type_) symbol) + (sig-plasma-method-11 (_type_ symbol) none) + (sig-plasma-method-12 (_type_) none) + (sig-plasma-method-13 (_type_) symbol) + (sig-plasma-method-14 (_type_ process-focusable) none) ) ) (deftype sig-path-sample (structure) - ((bytes uint8 32 :offset-assert 0) - (pos vector :inline :offset-assert 32) - (quat quaternion :inline :offset-assert 48) - (flags uint8 :offset 12) - (pos-x float :offset 32) - (pos-y float :offset 36) - (pos-z float :offset 40) - (quat-x float :offset 48) - (quat-y float :offset 52) - (quat-z float :offset 56) - (quat-w float :offset 60) + ((bytes uint8 32) + (pos vector :inline) + (quat quaternion :inline) + (flags uint8 :overlay-at (-> bytes 12)) + (pos-x float :overlay-at (-> pos data 0)) + (pos-y float :overlay-at (-> pos data 1)) + (pos-z float :overlay-at (-> pos data 2)) + (quat-x float :overlay-at (-> quat data 0)) + (quat-y float :overlay-at (-> quat data 1)) + (quat-z float :overlay-at (-> quat data 2)) + (quat-w float :overlay-at (-> quat data 3)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; ERROR: failed type prop at 14: add failed: sig-path-sample (deftype sig-path (basic) - ((sample-count int32 :offset-assert 4) - (samples (inline-array sig-path-sample) :offset-assert 8) + ((sample-count int32) + (samples (inline-array sig-path-sample)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype sig (bot) - ((fired-gun-count uint32 :offset-assert 992) - (sig-path sig-path :offset-assert 996) - (sig-path-clock clock :offset-assert 1000) - (travel-anim-interp float :offset-assert 1004) - (platform-index uint8 :offset-assert 1008) - (played-unjam-time time-frame :offset-assert 1016) - (sig-path-start-time time-frame :offset-assert 1024) - (sig-path-cur-time time-frame :offset-assert 1032) - (sig-path-prev-time time-frame :offset-assert 1040) - (plasma sig-plasma :inline :offset 1048) - (sig-path-prev-pos vector :inline :offset 368) + ((fired-gun-count uint32) + (sig-path sig-path) + (sig-path-clock clock) + (travel-anim-interp float) + (platform-index uint8) + (played-unjam-time time-frame) + (sig-path-start-time time-frame) + (sig-path-cur-time time-frame) + (sig-path-prev-time time-frame) + (plasma sig-plasma :inline :offset 1048) + (sig-path-prev-pos vector :inline :overlay-at event-param-point) ) - :heap-base #x3b0 - :method-count-assert 259 - :size-assert #x430 - :flag-assert #x10303b00430 + (:state-methods + whip + blast + chase + chase-attack + traveling + traveling-blocked + waiting-far + waiting-close + waiting-turn + waiting-crouched + charge-plasma + gun-jam + repair-gun + clean-gun + sig-path-run + sig-path-jump + sig-path-jump-land + sig-path-shoot-jump + sig-path-shoot-jump-land + sig-path-idle + ) (:methods - (whip () _type_ :state 225) - (blast () _type_ :state 226) - (chase () _type_ :state 227) - (chase-attack () _type_ :state 228) - (traveling () _type_ :state 229) - (traveling-blocked () _type_ :state 230) - (waiting-far () _type_ :state 231) - (waiting-close () _type_ :state 232) - (waiting-turn () _type_ :state 233) - (waiting-crouched () _type_ :state 234) - (charge-plasma () _type_ :state 235) - (gun-jam () _type_ :state 236) - (repair-gun () _type_ :state 237) - (clean-gun () _type_ :state 238) - (sig-path-run () _type_ :state 239) - (sig-path-jump () _type_ :state 240) - (sig-path-jump-land () _type_ :state 241) - (sig-path-shoot-jump () _type_ :state 242) - (sig-path-shoot-jump-land () _type_ :state 243) - (sig-path-idle () _type_ :state 244) - (sig-method-245 (_type_) symbol 245) - (sig-method-246 (_type_) symbol 246) - (fire-gun (_type_ vector) (pointer process) 247) - (sig-method-248 (_type_ sig-path-sample) none 248) - (sig-method-249 (_type_ sig-path) none 249) - (sig-method-250 (_type_) symbol 250) - (sig-method-251 (_type_) symbol 251) - (sig-method-252 (_type_) symbol 252) - (sig-method-253 (_type_) none 253) - (sig-method-254 (_type_) symbol 254) - (sig-method-255 (_type_) symbol 255) - (sig-method-256 (_type_) none 256) - (sig-method-257 (_type_) symbol 257) - (sig-method-258 (_type_) none 258) + (sig-method-245 (_type_) symbol) + (sig-method-246 (_type_) symbol) + (fire-gun (_type_ vector) (pointer process)) + (sig-method-248 (_type_ sig-path-sample) none) + (sig-method-249 (_type_ sig-path) none) + (sig-method-250 (_type_) symbol) + (sig-method-251 (_type_) symbol) + (sig-method-252 (_type_) symbol) + (sig-method-253 (_type_) none) + (sig-method-254 (_type_) symbol) + (sig-method-255 (_type_) symbol) + (sig-method-256 (_type_) none) + (sig-method-257 (_type_) symbol) + (sig-method-258 (_type_) none) ) ) @@ -140,74 +129,56 @@ ) (deftype sigt-wait-spot (ai-task) - ((check-done (function sigt-wait-spot sig symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function sigt-wait-spot sig symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype sigt-choose-piston (ai-task) - ((check-done (function sigt-choose-piston sig symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 4 :offset 38) - (actor-indexes uint8 4 :offset 42) + ((check-done (function sigt-choose-piston sig symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 4 :overlay-at (-> bytes 6)) + (actor-indexes uint8 4 :overlay-at (-> bytes 10)) ) - :method-count-assert 15 - :size-assert #x30 - :flag-assert #xf00000030 (:methods - (sigt-choose-piston-method-12 (_type_ sig) symbol 12) - (sigt-choose-piston-method-13 (_type_ sig) none 13) - (sigt-choose-piston-method-14 (_type_ sig int) symbol 14) + (sigt-choose-piston-method-12 (_type_ sig) symbol) + (sigt-choose-piston-method-13 (_type_ sig) none) + (sigt-choose-piston-method-14 (_type_ sig int) symbol) ) ) (deftype sigt-riding-piston (ai-task) - ((check-done (function sigt-riding-piston sig symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 4 :offset 38) + ((check-done (function sigt-riding-piston sig symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 4 :overlay-at (-> bytes 6)) ) - :method-count-assert 13 - :size-assert #x30 - :flag-assert #xd00000030 (:methods - (sigt-riding-piston-method-12 (_type_ sig) symbol 12) + (sigt-riding-piston-method-12 (_type_ sig) symbol) ) ) (deftype sigt-charge-plasma (ai-task) - ((check-done (function sigt-charge-plasma sig symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 4 :offset 38) - (actor-index uint8 :offset 42) + ((check-done (function sigt-charge-plasma sig symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 4 :overlay-at (-> bytes 6)) + (actor-index uint8 :overlay-at (-> bytes 10)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype sigt-fight-focus (ai-task) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) (deftype sigt-repair-gun (ai-task) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) diff --git a/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc b/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc index 307f85bc05c..6bc4ad94d72 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc @@ -142,7 +142,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod sig-plasma-method-14 sig-plasma ((this sig-plasma) (arg0 process-focusable)) +(defmethod sig-plasma-method-14 ((this sig-plasma) (arg0 process-focusable)) (let* ((f0-0 (-> this level)) (f30-0 (cond ((logtest? (-> this flags) (plasma-flags pf01)) @@ -227,7 +227,7 @@ ) ;; WARN: Return type mismatch plasma-flags vs none. -(defmethod sig-plasma-method-12 sig-plasma ((this sig-plasma)) +(defmethod sig-plasma-method-12 ((this sig-plasma)) (let ((f0-0 (-> this level))) (-> this min-level) (when (>= f0-0 1.0) @@ -241,7 +241,7 @@ ) ;; WARN: Return type mismatch plasma-flags vs none. -(defmethod sig-plasma-method-11 sig-plasma ((this sig-plasma) (arg0 symbol)) +(defmethod sig-plasma-method-11 ((this sig-plasma) (arg0 symbol)) (set! (-> this min-level) 0.0) (cond (arg0 @@ -258,15 +258,15 @@ ) ;; WARN: Return type mismatch plasma-flags vs none. -(defmethod sig-plasma-method-9 sig-plasma ((this sig-plasma)) +(defmethod sig-plasma-method-9 ((this sig-plasma)) (logior! (-> this flags) (plasma-flags pf03)) (none) ) -(defmethod sig-plasma-method-10 sig-plasma ((this sig-plasma)) +(defmethod sig-plasma-method-10 ((this sig-plasma)) (logtest? (-> this flags) (plasma-flags pf02)) ) -(defmethod sig-plasma-method-13 sig-plasma ((this sig-plasma)) +(defmethod sig-plasma-method-13 ((this sig-plasma)) (and (logtest? (-> this flags) (plasma-flags pf03)) (logtest? (-> this flags) (plasma-flags pf04))) ) diff --git a/goal_src/jak2/levels/common/ai/sig/sig-shot.gc b/goal_src/jak2/levels/common/ai/sig/sig-shot.gc index ad3c9da628d..fe82e656fc4 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig-shot.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig-shot.gc @@ -245,24 +245,20 @@ ) (deftype sig-shot (projectile) - ((tail-pos vector :inline :offset-assert 480) - (hit-pos vector :inline :offset-assert 496) + ((tail-pos vector :inline) + (hit-pos vector :inline) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x200 - :flag-assert #x2801800200 ) -(defmethod draw-laser-sight sig-shot ((this sig-shot)) +(defmethod draw-laser-sight ((this sig-shot)) "TODO - confirm If applicable, draw the laser sight particles" (draw-beam (-> *part-id-table* 655) (-> this tail-pos) (-> this starting-dir) #f #t) 0 (none) ) -(defmethod spawn-impact-particles sig-shot ((this sig-shot)) +(defmethod spawn-impact-particles ((this sig-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -317,7 +313,7 @@ ) ) -(defmethod spawn-shell-particles sig-shot ((this sig-shot)) +(defmethod spawn-shell-particles ((this sig-shot)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -358,7 +354,7 @@ (none) ) -(defmethod play-impact-sound sig-shot ((this sig-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this sig-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -373,7 +369,7 @@ (none) ) -(defmethod made-impact? sig-shot ((this sig-shot)) +(defmethod made-impact? ((this sig-shot)) "TODO - queries the collision cache, return true/false" (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) @@ -417,7 +413,7 @@ (none) ) -(defmethod init-proj-collision! sig-shot ((this sig-shot)) +(defmethod init-proj-collision! ((this sig-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -488,7 +484,7 @@ (none) ) -(defmethod init-proj-settings! sig-shot ((this sig-shot)) +(defmethod init-proj-settings! ((this sig-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'eco-yellow) diff --git a/goal_src/jak2/levels/common/ai/sig/sig-task.gc b/goal_src/jak2/levels/common/ai/sig/sig-task.gc index edd13f0f62c..81fae1f2b51 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig-task.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig-task.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod reset-task! sigt-wait-spot ((this sigt-wait-spot)) +(defmethod reset-task! ((this sigt-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -15,7 +15,7 @@ (none) ) -(defmethod ai-task-method-11 sigt-wait-spot ((this sigt-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this sigt-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) @@ -63,7 +63,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod ai-task-method-11 sigt-fight-focus ((this sigt-fight-focus) (arg0 bot)) +(defmethod ai-task-method-11 ((this sigt-fight-focus) (arg0 bot)) (let ((a1-1 (handle->process (-> arg0 focus handle)))) (if (and a1-1 (attacked-by-player? arg0 (the-as process-focusable a1-1)) @@ -77,12 +77,12 @@ ) ;; WARN: Return type mismatch bot-flags vs none. -(defmethod ai-task-method-10 sigt-fight-focus ((this sigt-fight-focus) (arg0 bot)) +(defmethod ai-task-method-10 ((this sigt-fight-focus) (arg0 bot)) (logclear! (-> arg0 bot-flags) (bot-flags bf00)) (none) ) -(defmethod ai-task-method-11 sigt-repair-gun ((this sigt-repair-gun) (arg0 bot)) +(defmethod ai-task-method-11 ((this sigt-repair-gun) (arg0 bot)) (cond ((not (logtest? (bot-flags bf19) (-> arg0 bot-flags))) (ai-task-control-method-14 (-> arg0 ai-ctrl) this arg0) @@ -102,7 +102,7 @@ (none) ) -(defmethod sigt-choose-piston-method-14 sigt-choose-piston ((this sigt-choose-piston) (arg0 sig) (arg1 int)) +(defmethod sigt-choose-piston-method-14 ((this sigt-choose-piston) (arg0 sig) (arg1 int)) (let* ((v1-2 (-> arg0 course spots (-> this spot-indexes arg1))) (a0-6 (-> arg0 actor-group 0 data (-> this actor-indexes arg1) actor)) (gp-0 (if a0-6 @@ -118,7 +118,7 @@ ) ) -(defmethod sigt-choose-piston-method-13 sigt-choose-piston ((this sigt-choose-piston) (arg0 sig)) +(defmethod sigt-choose-piston-method-13 ((this sigt-choose-piston) (arg0 sig)) (let ((s4-0 0)) (let ((f30-0 -1.0) (s3-0 (-> arg0 root trans)) @@ -154,7 +154,7 @@ (none) ) -(defmethod sigt-choose-piston-method-12 sigt-choose-piston ((this sigt-choose-piston) (arg0 sig)) +(defmethod sigt-choose-piston-method-12 ((this sigt-choose-piston) (arg0 sig)) (with-pp (when (and (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) (not (sigt-choose-piston-method-14 this arg0 (-> this which-spot))) @@ -205,7 +205,7 @@ ) ) -(defmethod reset-task! sigt-choose-piston ((this sigt-choose-piston)) +(defmethod reset-task! ((this sigt-choose-piston)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -213,7 +213,7 @@ (none) ) -(defmethod ai-task-method-11 sigt-choose-piston ((this sigt-choose-piston) (arg0 bot)) +(defmethod ai-task-method-11 ((this sigt-choose-piston) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (cond ((< s4-0 0) @@ -246,12 +246,12 @@ (none) ) -(defmethod ai-task-method-10 sigt-choose-piston ((this sigt-choose-piston) (arg0 bot)) +(defmethod ai-task-method-10 ((this sigt-choose-piston) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) -(defmethod sigt-riding-piston-method-12 sigt-riding-piston ((this sigt-riding-piston) (arg0 sig)) +(defmethod sigt-riding-piston-method-12 ((this sigt-riding-piston) (arg0 sig)) (with-pp (when (not (player-blocking-spot? arg0 (-> arg0 course spots (-> this spot-indexes (-> this which-spot))))) (let* ((v1-9 (-> arg0 actor-group 0 data (-> arg0 platform-index) actor)) @@ -293,7 +293,7 @@ ) ) -(defmethod reset-task! sigt-riding-piston ((this sigt-riding-piston)) +(defmethod reset-task! ((this sigt-riding-piston)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -302,7 +302,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 sigt-riding-piston ((this sigt-riding-piston) (arg0 bot)) +(defmethod ai-task-method-11 ((this sigt-riding-piston) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (or (< s4-0 0) (player-blocking-spot? arg0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) @@ -327,12 +327,12 @@ (none) ) -(defmethod ai-task-method-10 sigt-riding-piston ((this sigt-riding-piston) (arg0 bot)) +(defmethod ai-task-method-10 ((this sigt-riding-piston) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) -(defmethod reset-task! sigt-charge-plasma ((this sigt-charge-plasma)) +(defmethod reset-task! ((this sigt-charge-plasma)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -340,7 +340,7 @@ (none) ) -(defmethod ai-task-method-11 sigt-charge-plasma ((this sigt-charge-plasma) (arg0 bot)) +(defmethod ai-task-method-11 ((this sigt-charge-plasma) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> (the-as sig arg0) course spots (-> this spot-indexes s4-0)))) @@ -420,7 +420,7 @@ (none) ) -(defmethod ai-task-method-10 sigt-charge-plasma ((this sigt-charge-plasma) (arg0 bot)) +(defmethod ai-task-method-10 ((this sigt-charge-plasma) (arg0 bot)) (clear-poi-and-focus! (the-as sig arg0)) (logclear! (-> (the-as sig arg0) plasma flags) (plasma-flags pf00)) (set! (-> (the-as sig arg0) focus-mode) 0) diff --git a/goal_src/jak2/levels/common/ai/sig/sig.gc b/goal_src/jak2/levels/common/ai/sig/sig.gc index 07bcc7dee87..ed3ac8ff3bb 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig.gc @@ -8,22 +8,16 @@ ;; DECOMP BEGINS (deftype sig-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype sig-global-info (basic) - ((prev-blue-hit int8 :offset-assert 4) - (blue-hit-anim sig-anim-info 3 :inline :offset-assert 8) + ((prev-blue-hit int8) + (blue-hit-anim sig-anim-info 3 :inline) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) @@ -234,7 +228,7 @@ ) ) -(defmethod enemy-method-97 sig ((this sig)) +(defmethod enemy-method-97 ((this sig)) (let* ((s5-0 (handle->process (-> this attacker-handle))) (s4-0 (if (type? s5-0 process-focusable) s5-0 @@ -351,7 +345,7 @@ ) ) -(defmethod general-event-handler sig ((this sig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this sig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -372,7 +366,7 @@ ) ) -(defmethod track-target! sig ((this sig)) +(defmethod track-target! ((this sig)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -437,13 +431,13 @@ (none) ) -(defmethod go-to-waypoint! sig ((this sig) (arg0 int) (arg1 symbol)) +(defmethod go-to-waypoint! ((this sig) (arg0 int) (arg1 symbol)) "Start moving to the given [[bot-waypoint]]." (set! (-> this plasma charge-speed) 0.125) ((method-of-type bot go-to-waypoint!) this arg0 arg1) ) -(defmethod deactivate sig ((this sig)) +(defmethod deactivate ((this sig)) (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-param)) (set! (-> v1-0 id) (-> this plasma powerup-sound-id)) @@ -467,7 +461,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod enemy-method-46 sig ((this sig) (arg0 int)) +(defmethod enemy-method-46 ((this sig) (arg0 int)) "@abstract" (let ((v1-0 arg0)) (cond @@ -523,7 +517,7 @@ (none) ) -(defmethod init-enemy-collision! sig ((this sig)) +(defmethod init-enemy-collision! ((this sig)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -613,7 +607,7 @@ (none) ) -(defmethod init-enemy! sig ((this sig)) +(defmethod init-enemy! ((this sig)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (set! (-> this channel) (the-as uint 21)) @@ -655,7 +649,7 @@ ) ;; WARN: Return type mismatch sound-id vs enemy-flag. -(defmethod enemy-method-105 sig ((this sig) (arg0 process)) +(defmethod enemy-method-105 ((this sig) (arg0 process)) (let ((t9-0 (method-of-type bot enemy-method-105))) (t9-0 this arg0) ) @@ -665,27 +659,27 @@ ) ) -(defmethod sig-method-251 sig ((this sig)) +(defmethod sig-method-251 ((this sig)) (logtest? (-> this plasma flags) (plasma-flags pf00)) ) -(defmethod sig-method-254 sig ((this sig)) +(defmethod sig-method-254 ((this sig)) (logtest? (bot-flags bf22) (-> this bot-flags)) ) -(defmethod sig-method-252 sig ((this sig)) +(defmethod sig-method-252 ((this sig)) (logtest? (bot-flags bf20) (-> this bot-flags)) ) -(defmethod sig-method-255 sig ((this sig)) +(defmethod sig-method-255 ((this sig)) (logtest? (bot-flags bf19) (-> this bot-flags)) ) -(defmethod sig-method-246 sig ((this sig)) +(defmethod sig-method-246 ((this sig)) (>= 16384.0 (-> this focus-info bullseye-xz-dist)) ) -(defmethod sig-method-245 sig ((this sig)) +(defmethod sig-method-245 ((this sig)) (and (or (and (logtest? (-> this bot-flags) (bot-flags attacked)) (= (-> this focus-info fproc type) target)) (and (>= 40960.0 (-> this focus-info bullseye-xz-dist)) (= (-> this focus-info los) 1)) ) @@ -693,7 +687,7 @@ ) ) -(defmethod go-hostile sig ((this sig)) +(defmethod go-hostile ((this sig)) (bot-method-223 this #t) (cond ((not (bot-method-214 this)) @@ -711,7 +705,7 @@ ) ) -(defmethod react-to-focus sig ((this sig)) +(defmethod react-to-focus ((this sig)) "@TODO - flesh out docs" (cond ((bot-method-214 this) @@ -742,12 +736,12 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sig ((this sig)) +(defmethod go-idle ((this sig)) (go (method-of-object this waiting-far)) (none) ) -(defmethod fire-gun sig ((this sig) (arg0 vector)) +(defmethod fire-gun ((this sig) (arg0 vector)) "Increase gun fired counter and spawn projectile." (+! (-> this fired-gun-count) 1) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) @@ -772,7 +766,7 @@ ) ) -(defmethod sig-method-258 sig ((this sig)) +(defmethod sig-method-258 ((this sig)) (with-pp (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 16384.0 28672.0))) @@ -829,7 +823,7 @@ ) ) -(defmethod enemy-method-77 sig ((this sig) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this sig) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((v1-3 (enemy-method-120 this 3 (ash 1 (-> *sig-global-info* prev-blue-hit)))) @@ -911,7 +905,7 @@ ) ) -(defmethod enemy-method-78 sig ((this sig) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this sig) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -948,7 +942,7 @@ ) ) -(defmethod enemy-method-84 sig ((this sig) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 ((this sig) (arg0 enemy-jump-info)) (logclear! (-> this bot-flags) (bot-flags bf23)) (let ((f1-0 (vector-vector-xz-distance (-> arg0 dest-pos) (-> arg0 start-pos))) (f2-1 (- (-> arg0 dest-pos y) (-> arg0 start-pos y))) @@ -981,7 +975,7 @@ (none) ) -(defmethod enemy-method-86 sig ((this sig)) +(defmethod enemy-method-86 ((this sig)) (let* ((t9-0 (method-of-type bot enemy-method-86)) (v0-0 (t9-0 this)) ) @@ -1023,7 +1017,7 @@ ) ;; WARN: Return type mismatch object vs float. -(defmethod enemy-method-85 sig ((this sig)) +(defmethod enemy-method-85 ((this sig)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((t9-0 (method-of-type bot enemy-method-85))) @@ -1076,7 +1070,7 @@ ) ;; WARN: Return type mismatch int vs symbol. -(defmethod enemy-method-89 sig ((this sig) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this sig) (arg0 enemy-jump-info)) (the-as symbol (when (logtest? (bot-flags bf23) (-> this bot-flags)) @@ -1099,7 +1093,7 @@ ) ;; WARN: Return type mismatch int vs symbol. -(defmethod enemy-method-88 sig ((this sig) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this sig) (arg0 enemy-jump-info)) (the-as symbol (when (logtest? (bot-flags bf23) (-> this bot-flags)) @@ -1122,7 +1116,7 @@ ) ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! sig ((this sig) (arg0 vector)) +(defmethod set-cam-height! ((this sig) (arg0 vector)) (cond ((and (-> this next-state) (= (-> this next-state name) 'failed)) (set-vector! arg0 0.0 4096.0 28672.0 1.0) @@ -1143,14 +1137,14 @@ ) ) -(defmethod bot-method-216 sig ((this sig)) +(defmethod bot-method-216 ((this sig)) (set! (-> this health-handle) (ppointer->handle (process-spawn hud-sig :init hud-init-by-other :to this))) 0 (none) ) ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod sig-method-249 sig ((this sig) (arg0 sig-path)) +(defmethod sig-method-249 ((this sig) (arg0 sig-path)) (set! (-> this sig-path) arg0) (set! (-> this sig-path-clock) (-> *display* user0-clock)) (set! (-> this sig-path-start-time) (-> this sig-path-clock frame-counter)) @@ -1161,7 +1155,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod sig-method-248 sig ((this sig) (arg0 sig-path-sample)) +(defmethod sig-method-248 ((this sig) (arg0 sig-path-sample)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -1231,7 +1225,7 @@ ) ) -(defmethod sig-method-256 sig ((this sig)) +(defmethod sig-method-256 ((this sig)) (let* ((v1-3 (the int (* 0.05 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time)))))) (v1-4 (- (+ (-> this sig-path sample-count) -1) v1-3)) ) @@ -1243,13 +1237,13 @@ (none) ) -(defmethod sig-method-257 sig ((this sig)) +(defmethod sig-method-257 ((this sig)) (>= (the int (* 0.05 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time))))) (+ (-> this sig-path sample-count) -1) ) ) -(defmethod sig-method-250 sig ((this sig)) +(defmethod sig-method-250 ((this sig)) (local-vars (a2-7 float) (a2-14 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -1399,7 +1393,7 @@ ) ) -(defmethod draw hud-sig ((this hud-sig)) +(defmethod draw ((this hud-sig)) (set-hud-piece-position! (-> this sprites 2) (the int (+ 30.0 (* -130.0 (-> this offset)))) @@ -1414,14 +1408,14 @@ (none) ) -(defmethod update-values hud-sig ((this hud-sig)) +(defmethod update-values ((this hud-sig)) (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-sig ((this hud-sig)) +(defmethod init-callback ((this hud-sig)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/goal_src/jak2/levels/common/airlock.gc b/goal_src/jak2/levels/common/airlock.gc index cda2f660af7..ae9a7730070 100644 --- a/goal_src/jak2/levels/common/airlock.gc +++ b/goal_src/jak2/levels/common/airlock.gc @@ -8,63 +8,61 @@ ;; DECOMP BEGINS (deftype com-airlock (process-drawable) - ((root collide-shape :override) - (level-name pair :offset-assert 200) - (open-test pair :offset-assert 204) - (were-behind? symbol :offset-assert 208) - (inner? symbol :offset-assert 212) - (sound-behind? symbol :offset-assert 216) - (visible-move? symbol :offset-assert 220) - (saw-pilot? handle :offset-assert 224) - (last-distance meters :offset-assert 232) - (y-height vector :offset-assert 236) - (pre-open-speed float :offset-assert 240) - (latch-closed-time time-frame :offset-assert 248) - (latch-open-time time-frame :offset-assert 256) - (gear joint-mod :offset-assert 264) - (gear-rot degrees :offset-assert 268) - (gear-rotv degrees :offset-assert 272) - (open-frame float :offset-assert 276) - (pre-open-frame float :offset-assert 280) - (lock-frame float :offset-assert 284) - (open-distance meters :offset-assert 288) - (active-distance meters :offset-assert 292) - (sound-id sound-id :offset-assert 296) - (gear-sound-id sound-id :offset-assert 300) - (sound-gear sound-spec :offset-assert 304) - (sound-pre-open sound-spec :offset-assert 308) - (sound-pre-open-stop sound-spec :offset-assert 312) - (sound-lock-loop sound-spec :offset-assert 316) - (sound-lock-stop sound-spec :offset-assert 320) - (sound-open sound-spec :offset-assert 324) - (sound-open-loop sound-spec :offset-assert 328) - (sound-open-stop sound-spec :offset-assert 332) - (sound-close sound-spec :offset-assert 336) - (sound-close-loop sound-spec :offset-assert 340) - (sound-close-stop sound-spec :offset-assert 344) - (sound-post-close sound-spec :offset-assert 348) - (sound-post-close-stop sound-spec :offset-assert 352) - (spool-sound-time time-frame :offset-assert 360) - (door-radius meters :offset-assert 368) + ((root collide-shape :override) + (level-name pair) + (open-test pair) + (were-behind? symbol) + (inner? symbol) + (sound-behind? symbol) + (visible-move? symbol) + (saw-pilot? handle) + (last-distance meters) + (y-height vector) + (pre-open-speed float) + (latch-closed-time time-frame) + (latch-open-time time-frame) + (gear joint-mod) + (gear-rot degrees) + (gear-rotv degrees) + (open-frame float) + (pre-open-frame float) + (lock-frame float) + (open-distance meters) + (active-distance meters) + (sound-id sound-id) + (gear-sound-id sound-id) + (sound-gear sound-spec) + (sound-pre-open sound-spec) + (sound-pre-open-stop sound-spec) + (sound-lock-loop sound-spec) + (sound-lock-stop sound-spec) + (sound-open sound-spec) + (sound-open-loop sound-spec) + (sound-open-stop sound-spec) + (sound-close sound-spec) + (sound-close-loop sound-spec) + (sound-close-stop sound-spec) + (sound-post-close sound-spec) + (sound-post-close-stop sound-spec) + (spool-sound-time time-frame) + (door-radius meters) ) - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 + (:state-methods + (open symbol) + (close symbol) + ) (:methods - (open (symbol) _type_ :state 20) - (close (symbol) _type_ :state 21) - (init-airlock! (_type_) _type_ 22) - (want-cross-airlock? (_type_) symbol :behavior com-airlock 23) - (destination-loaded? (_type_ symbol) symbol 24) - (check-crossing-distance (_type_ vector symbol) float :behavior com-airlock 25) - (rotate-gear! (_type_ float) degrees :behavior com-airlock 26) - (play-city-voice-sound (_type_ symbol) none :behavior com-airlock 27) + (init-airlock! (_type_) _type_) + (want-cross-airlock? (_type_) symbol :behavior com-airlock) + (destination-loaded? (_type_ symbol) symbol) + (check-crossing-distance (_type_ vector symbol) float :behavior com-airlock) + (rotate-gear! (_type_ float) degrees :behavior com-airlock) + (play-city-voice-sound (_type_ symbol) none :behavior com-airlock) ) ) -(defmethod deactivate com-airlock ((this com-airlock)) +(defmethod deactivate ((this com-airlock)) (process-entity-status! this (entity-perm-status subtask-complete) #f) (if (nonzero? (-> this sound-id)) (sound-stop (-> this sound-id)) @@ -77,14 +75,14 @@ ) ;; WARN: Return type mismatch process-drawable vs com-airlock. -(defmethod relocate com-airlock ((this com-airlock) (arg0 int)) +(defmethod relocate ((this com-airlock) (arg0 int)) (if (nonzero? (-> this gear)) (&+! (-> this gear) arg0) ) (the-as com-airlock ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod init-airlock! com-airlock ((this com-airlock)) +(defmethod init-airlock! ((this com-airlock)) (process-entity-status! this (entity-perm-status subtask-complete) #f) (process-drawable-from-entity! this (-> this entity)) (logclear! (-> this mask) (process-mask actor-pause)) @@ -133,7 +131,7 @@ this ) -(defmethod check-crossing-distance com-airlock ((this com-airlock) (arg0 vector) (arg1 symbol)) +(defmethod check-crossing-distance ((this com-airlock) (arg0 vector) (arg1 symbol)) (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans))) ) @@ -167,7 +165,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod want-cross-airlock? com-airlock ((this com-airlock)) +(defmethod want-cross-airlock? ((this com-airlock)) (local-vars (a0-12 entity-actor)) (let* ((tgt (target-pos 0)) (f30-0 (check-crossing-distance this tgt #t)) @@ -177,8 +175,8 @@ symbol (and (or s5-0 (< (vector-vector-xz-distance (-> this root trans) tgt) (-> this active-distance))) (or s5-0 (not (-> this y-height)) (and (>= (-> tgt y) (- (-> this root trans y) (-> this y-height y))) - (< (-> tgt y) (+ (-> this root trans y) (-> this y-height x))) - ) + (< (-> tgt y) (+ (-> this root trans y) (-> this y-height x))) + ) ) (begin (if (and (not (-> this were-behind?)) (and (< f30-0 0.0) (-> this inner?))) @@ -218,7 +216,7 @@ ) ) -(defmethod destination-loaded? com-airlock ((this com-airlock) (display? symbol)) +(defmethod destination-loaded? ((this com-airlock) (display? symbol)) (let ((level-list (the-as pair (script-eval (-> this level-name)))) (borrow-lev-name #f) ) @@ -292,7 +290,7 @@ ) ) -(defmethod rotate-gear! com-airlock ((this com-airlock) (arg0 float)) +(defmethod rotate-gear! ((this com-airlock) (arg0 float)) (when (nonzero? (-> this gear)) (if (and (zero? (-> this gear-sound-id)) (-> this sound-gear) @@ -308,7 +306,7 @@ (-> this gear-rotv) ) -(defmethod play-city-voice-sound com-airlock ((this com-airlock) (arg0 symbol)) +(defmethod play-city-voice-sound ((this com-airlock) (arg0 symbol)) (let ((gp-0 (the-as (array string) #f))) (case arg0 (('enter) @@ -319,8 +317,8 @@ ) ) (cond - ((and gp-0 (>= (- (current-time) (-> this spool-sound-time)) (seconds 2))) - (set! (-> this spool-sound-time) (current-time)) + ((and gp-0 (time-elapsed? (-> this spool-sound-time) (seconds 2))) + (set-time! (-> this spool-sound-time)) (add-process *gui-control* this @@ -769,15 +767,11 @@ (deftype com-airlock-outer (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! com-airlock-outer ((this com-airlock-outer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this com-airlock-outer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -841,15 +835,11 @@ This commonly includes things such as: (deftype com-airlock-inner (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! com-airlock-inner ((this com-airlock-inner) (arg0 entity-actor)) +(defmethod init-from-entity! ((this com-airlock-inner) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -900,7 +890,10 @@ This commonly includes things such as: (set! (-> this open-frame) 75.0) (set! (-> this gear) (new 'process 'joint-mod (joint-mod-mode rotate) this 12)) (set! (-> this inner?) - (logtest? (the-as int (res-lump-value (-> this entity) 'options uint128 :default (the-as uint128 1) :time -1000000000.0)) + (logtest? (the-as + int + (res-lump-value (-> this entity) 'options uint128 :default (the-as uint128 1) :time -1000000000.0) + ) 1 ) ) @@ -926,15 +919,11 @@ This commonly includes things such as: (deftype fort-entry-gate (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-entry-gate ((this fort-entry-gate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-entry-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -995,15 +984,11 @@ This commonly includes things such as: (deftype hip-door-a (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-door-a ((this hip-door-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-door-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1066,15 +1051,11 @@ This commonly includes things such as: (deftype tomb-mar-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-mar-door ((this tomb-mar-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-mar-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1117,10 +1098,6 @@ This commonly includes things such as: (deftype cas-front-door (com-airlock-outer) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) @@ -1132,15 +1109,11 @@ This commonly includes things such as: (deftype pal-throne-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-throne-door ((this pal-throne-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-throne-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1202,15 +1175,11 @@ This commonly includes things such as: (deftype vin-door-ctyinda (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vin-door-ctyinda ((this vin-door-ctyinda) (arg0 entity-actor)) +(defmethod init-from-entity! ((this vin-door-ctyinda) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1272,15 +1241,11 @@ This commonly includes things such as: (deftype under-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-door ((this under-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1342,15 +1307,11 @@ This commonly includes things such as: (deftype oracle-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! oracle-door ((this oracle-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this oracle-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/common/battle.gc b/goal_src/jak2/levels/common/battle.gc index 7b61072b6d4..721ee97a3b0 100644 --- a/goal_src/jak2/levels/common/battle.gc +++ b/goal_src/jak2/levels/common/battle.gc @@ -25,157 +25,134 @@ ;; DECOMP BEGINS (deftype battle-info (basic) - ((id int8 :offset-assert 4) - (notice-spec uint64 :offset-assert 8) - (pick-logic int8 :offset-assert 16) - (notice-distance float :offset-assert 20) - (dont-spawn-initial-until-notice? symbol :offset-assert 24) - (play-battle-music symbol :offset-assert 28) - (min-battle-spawn-delay uint32 :offset-assert 32) - (max-battle-spawn-delay uint32 :offset-assert 36) - (min-spawner-notice-attack-delay uint32 :offset-assert 40) - (max-spawner-notice-attack-delay uint32 :offset-assert 44) - (spawner-blocked-by-player-xz float :offset-assert 48) - (spawner-blocked-by-collide-radius float :offset-assert 52) - (pick-spawner-max-dist float :offset-assert 56) - (max-count uint32 :offset-assert 60) - (desired-alive-count uint8 :offset-assert 64) - (spawner-collide-with collide-spec :offset-assert 68) + ((id int8) + (notice-spec uint64) + (pick-logic int8) + (notice-distance float) + (dont-spawn-initial-until-notice? symbol) + (play-battle-music symbol) + (min-battle-spawn-delay uint32) + (max-battle-spawn-delay uint32) + (min-spawner-notice-attack-delay uint32) + (max-spawner-notice-attack-delay uint32) + (spawner-blocked-by-player-xz float) + (spawner-blocked-by-collide-radius float) + (pick-spawner-max-dist float) + (max-count uint32) + (desired-alive-count uint8) + (spawner-collide-with collide-spec) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) (deftype battle-ally (structure) - ((entity entity-actor :offset-assert 0) + ((entity entity-actor) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype battle-ally-array (inline-array-class) - ((data battle-ally :inline :dynamic :offset-assert 16) + ((data battle-ally :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> battle-ally-array heap-base) (the-as uint 16)) (deftype battle-breed (structure) - ((breed-type type :offset-assert 0) - (percent float :offset-assert 4) + ((breed-type type) + (percent float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype battle-breed-array (inline-array-class) - ((data battle-breed :inline :dynamic :offset-assert 16) + ((data battle-breed :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> battle-breed-array heap-base) (the-as uint 16)) (deftype battle-spawner (structure) - ((flags battle-spawner-flags :offset-assert 0) - (entity entity-actor :offset-assert 8) - (breeds battle-breed-array :offset-assert 12) - (creature-index int8 :offset-assert 16) - (ready-index int8 :offset-assert 17) - (attack-index int8 :offset-assert 18) - (mode uint8 :offset-assert 19) - (intro-path path-control :offset-assert 20) - (notice-attack-delay uint32 :offset-assert 24) - (creature handle :offset-assert 32) - (last-spawn-time time-frame :offset-assert 40) - (noticed-attack-time time-frame :offset-assert 48) - (attack-pos vector :inline :offset-assert 64) + ((flags battle-spawner-flags) + (entity entity-actor) + (breeds battle-breed-array) + (creature-index int8) + (ready-index int8) + (attack-index int8) + (mode uint8) + (intro-path path-control) + (notice-attack-delay uint32) + (creature handle) + (last-spawn-time time-frame) + (noticed-attack-time time-frame) + (attack-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) (deftype battle-spawner-array (inline-array-class) - ((data battle-spawner :inline :dynamic :offset-assert 16) + ((data battle-spawner :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> battle-spawner-array heap-base) (the-as uint 80)) (deftype battle (process-drawable) - ((info battle-info :offset-assert 200) - (flags battle-flags :offset-assert 204) - (spawn-initial-creatures? symbol :offset-assert 208) - (next-spawn-delay uint32 :offset-assert 212) - (on-notice basic :offset-assert 216) - (on-hostile basic :offset-assert 220) - (on-beaten basic :offset-assert 224) - (max-count uint32 :offset-assert 228) - (count uint32 :offset-assert 232) - (die-count uint32 :offset-assert 236) - (stat-child-count uint16 :offset-assert 240) - (cant-spawn-time time-frame :offset-assert 248) - (jammed-starting-time time-frame :offset-assert 256) - (spawners battle-spawner-array :offset-assert 264) - (allies battle-ally-array :offset-assert 268) + ((info battle-info) + (flags battle-flags) + (spawn-initial-creatures? symbol) + (next-spawn-delay uint32) + (on-notice basic) + (on-hostile basic) + (on-beaten basic) + (max-count uint32) + (count uint32) + (die-count uint32) + (stat-child-count uint16) + (cant-spawn-time time-frame) + (jammed-starting-time time-frame) + (spawners battle-spawner-array) + (allies battle-ally-array) ) - :heap-base #x90 - :method-count-assert 53 - :size-assert #x110 - :flag-assert #x3500900110 + (:state-methods + idle + battle-state-21 + notice + hostile + beaten + ) (:methods - (idle () _type_ :state 20) - (battle-method-21 () none 21) - (notice () _type_ :state 22) - (hostile () _type_ :state 23) - (beaten () _type_ :state 24) - (spawner-blocked? (_type_ battle-spawner) symbol 25) - (spawner-blocked-by-collide? (_type_ battle-spawner) symbol 26) - (draw-battle-marks (_type_) none 27) - (initialize-enemy-lists (_type_) none 28) - (initialize-spawner-breeds (_type_ battle-spawner entity-actor) none 29) - (get-spawner-for-enemy (_type_ process) battle-spawner 30) - (initialize-ally (_type_ battle-ally entity-actor) none 31) - (initialize-spawner (_type_ battle-spawner entity-actor) none 32) - (initialize-battle (_type_) none 33) - (init-go (_type_) int 34) - (get-spawn-delay (_type_) int 35) - (get-best-spawner (_type_) battle-spawner 36) - (spawner-free? (_type_ battle-spawner) symbol 37) - (spawn-from-breed (_type_ battle-breed enemy-init-by-other-params) handle 38) - (spawn-from-spawner (_type_ battle-spawner symbol) none 39) - (spawn-initial-creatures (_type_) none 40) - (get-random-breed (_type_ battle-spawner) battle-breed 41) - (spawner-hit (_type_ battle-spawner process) symbol 42) - (spawner-try-jump (_type_ battle-spawner enemy) symbol 43) - (spawner-do-jump (_type_ battle-spawner) int 44) - (spawner-hittable? (_type_ battle-spawner) symbol 45) - (spawner-in-intro? (_type_ battle-spawner) symbol 46) - (set-battle-music (_type_) none 47) - (unset-battle-music (_type_) none 48) - (update-allies-list (_type_) int :behavior battle 49) - (beaten? (_type_) symbol 50) - (spawner-active? (_type_ battle-spawner symbol) symbol :behavior battle 51) - (spawner-active-count (_type_) int 52) + (spawner-blocked? (_type_ battle-spawner) symbol) + (spawner-blocked-by-collide? (_type_ battle-spawner) symbol) + (draw-battle-marks (_type_) none) + (initialize-enemy-lists (_type_) none) + (initialize-spawner-breeds (_type_ battle-spawner entity-actor) none) + (get-spawner-for-enemy (_type_ process) battle-spawner) + (initialize-ally (_type_ battle-ally entity-actor) none) + (initialize-spawner (_type_ battle-spawner entity-actor) none) + (initialize-battle (_type_) none) + (init-go (_type_) int) + (get-spawn-delay (_type_) int) + (get-best-spawner (_type_) battle-spawner) + (spawner-free? (_type_ battle-spawner) symbol) + (spawn-from-breed (_type_ battle-breed enemy-init-by-other-params) handle) + (spawn-from-spawner (_type_ battle-spawner symbol) none) + (spawn-initial-creatures (_type_) none) + (get-random-breed (_type_ battle-spawner) battle-breed) + (spawner-hit (_type_ battle-spawner process) symbol) + (spawner-try-jump (_type_ battle-spawner enemy) symbol) + (spawner-do-jump (_type_ battle-spawner) int) + (spawner-hittable? (_type_ battle-spawner) symbol) + (spawner-in-intro? (_type_ battle-spawner) symbol) + (set-battle-music (_type_) none) + (unset-battle-music (_type_) none) + (update-allies-list (_type_) int :behavior battle) + (beaten? (_type_) symbol) + (spawner-active? (_type_ battle-spawner symbol) symbol :behavior battle) + (spawner-active-count (_type_) int) ) ) @@ -813,7 +790,7 @@ ) ) -(defmethod draw-battle-marks battle ((this battle)) +(defmethod draw-battle-marks ((this battle)) (local-vars (sv-16 string) (sv-32 string)) (let ((s4-0 (-> this root trans)) (s5-0 (the-as int (-> this max-count))) @@ -883,7 +860,7 @@ (none) ) -(defmethod spawner-blocked-by-collide? battle ((this battle) (arg0 battle-spawner)) +(defmethod spawner-blocked-by-collide? ((this battle) (arg0 battle-spawner)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -998,7 +975,7 @@ ) ) -(defmethod spawner-blocked? battle ((this battle) (arg0 battle-spawner)) +(defmethod spawner-blocked? ((this battle) (arg0 battle-spawner)) (when (not (logtest? (-> this flags) (battle-flags no-spawner-block))) (let ((f0-0 (-> this info spawner-blocked-by-player-xz))) (if (and (< 0.0 f0-0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 attack-pos)))) @@ -1014,13 +991,13 @@ #f ) -(defmethod spawner-free? battle ((this battle) (arg0 battle-spawner)) +(defmethod spawner-free? ((this battle) (arg0 battle-spawner)) (and (not (handle->process (-> arg0 creature))) (or (>= (-> arg0 ready-index) 0) (not (spawner-blocked? this arg0))) ) ) -(defmethod get-best-spawner battle ((this battle)) +(defmethod get-best-spawner ((this battle)) (let ((s5-0 (-> this spawners length)) (v1-2 (-> this info pick-logic)) ) @@ -1067,7 +1044,7 @@ (the-as battle-spawner #f) ) -(defmethod get-random-breed battle ((this battle) (arg0 battle-spawner)) +(defmethod get-random-breed ((this battle) (arg0 battle-spawner)) (let ((f0-0 (rand-vu)) (v1-0 0) ) @@ -1086,7 +1063,7 @@ ) ;; WARN: Return type mismatch int vs handle. -(defmethod spawn-from-breed battle ((this battle) (arg0 battle-breed) (arg1 enemy-init-by-other-params)) +(defmethod spawn-from-breed ((this battle) (arg0 battle-breed) (arg1 enemy-init-by-other-params)) (let* ((s3-0 (-> arg0 breed-type)) (s4-0 (get-process *default-dead-pool* s3-0 #x4000)) (v1-1 (when s4-0 @@ -1107,7 +1084,7 @@ ) ;; WARN: Return type mismatch handle vs none. -(defmethod spawn-from-spawner battle ((this battle) (arg0 battle-spawner) (arg1 symbol)) +(defmethod spawn-from-spawner ((this battle) (arg0 battle-spawner) (arg1 symbol)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'quaternion)) (s2-0 (-> arg0 intro-path)) @@ -1167,7 +1144,7 @@ (none) ) -(defmethod get-spawner-for-enemy battle ((this battle) (arg0 process)) +(defmethod get-spawner-for-enemy ((this battle) (arg0 process)) (let ((v1-0 (if (type? arg0 nav-enemy) (the-as nav-enemy arg0) ) @@ -1192,7 +1169,7 @@ (the-as battle-spawner #f) ) -(defmethod spawner-active? battle ((this battle) (arg0 battle-spawner) (arg1 symbol)) +(defmethod spawner-active? ((this battle) (arg0 battle-spawner) (arg1 symbol)) (when (and (logtest? (-> this flags) (battle-flags active)) (not (logtest? (-> this flags) (battle-flags beaten)))) (let ((v1-5 (-> arg0 noticed-attack-time))) (cond @@ -1240,7 +1217,7 @@ #f ) -(defmethod spawner-in-intro? battle ((this battle) (arg0 battle-spawner)) +(defmethod spawner-in-intro? ((this battle) (arg0 battle-spawner)) (when (-> arg0 intro-path) (let ((v1-1 (-> arg0 creature-index)) (a0-1 (-> arg0 attack-index)) @@ -1250,7 +1227,7 @@ ) ) -(defmethod spawner-try-jump battle ((this battle) (arg0 battle-spawner) (arg1 enemy)) +(defmethod spawner-try-jump ((this battle) (arg0 battle-spawner) (arg1 enemy)) (let ((s3-0 (+ (-> arg0 creature-index) 1)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -1274,7 +1251,7 @@ ) ) -(defmethod spawner-hittable? battle ((this battle) (arg0 battle-spawner)) +(defmethod spawner-hittable? ((this battle) (arg0 battle-spawner)) (when (logtest? (-> arg0 flags) (battle-spawner-flags hit)) (if (-> arg0 intro-path) (>= (-> arg0 creature-index) (-> arg0 attack-index)) @@ -1283,7 +1260,7 @@ ) ) -(defmethod spawner-hit battle ((this battle) (arg0 battle-spawner) (arg1 process)) +(defmethod spawner-hit ((this battle) (arg0 battle-spawner) (arg1 process)) (let ((s5-0 (-> arg0 creature))) (set! (-> arg0 creature) (the-as handle #f)) (cond @@ -1298,7 +1275,7 @@ ) ) -(defmethod spawner-do-jump battle ((this battle) (arg0 battle-spawner)) +(defmethod spawner-do-jump ((this battle) (arg0 battle-spawner)) (when (= (-> arg0 mode) 2) (+! (-> arg0 creature-index) 1) (set! (-> arg0 mode) (the-as uint 0)) @@ -1307,7 +1284,7 @@ 0 ) -(defmethod spawner-active-count battle ((this battle)) +(defmethod spawner-active-count ((this battle)) (let ((gp-0 0)) (dotimes (s4-0 (-> this spawners length)) (if (spawner-active? this (-> this spawners data s4-0) #t) @@ -1318,7 +1295,7 @@ ) ) -(defmethod spawn-initial-creatures battle ((this battle)) +(defmethod spawn-initial-creatures ((this battle)) (set! (-> this spawn-initial-creatures?) #f) (let ((s5-0 (-> this spawners))) (dotimes (s4-0 (-> s5-0 length)) @@ -1338,7 +1315,7 @@ (none) ) -(defmethod get-spawn-delay battle ((this battle)) +(defmethod get-spawn-delay ((this battle)) (let ((v1-0 (-> this info))) (rand-vu-int-range (the-as int (-> v1-0 min-battle-spawn-delay)) @@ -1412,7 +1389,7 @@ ) ) -(defmethod update-allies-list battle ((this battle)) +(defmethod update-allies-list ((this battle)) (let ((v1-0 (-> this allies)) (gp-0 (-> this allies length)) ) @@ -1440,7 +1417,7 @@ ) ) -(defmethod beaten? battle ((this battle)) +(defmethod beaten? ((this battle)) (let ((s5-0 (spawner-active-count this)) (v1-2 (update-allies-list this)) (a1-0 (-> this child)) @@ -1556,7 +1533,7 @@ ) ;; WARN: Return type mismatch battle-flags vs none. -(defmethod set-battle-music battle ((this battle)) +(defmethod set-battle-music ((this battle)) (let ((a3-0 (-> this info play-battle-music))) (when (and a3-0 (not (logtest? (-> this flags) (battle-flags battle-music-set)))) (case a3-0 @@ -1573,7 +1550,7 @@ (none) ) -(defmethod unset-battle-music battle ((this battle)) +(defmethod unset-battle-music ((this battle)) (when (logtest? (-> this flags) (battle-flags battle-music-set)) (remove-setting! 'sound-mode) (remove-setting! 'music) @@ -1582,7 +1559,7 @@ (none) ) -(defmethod relocate battle-spawner-array ((this battle-spawner-array) (arg0 int)) +(defmethod relocate ((this battle-spawner-array) (arg0 int)) (dotimes (v1-0 (-> this length)) (let ((a2-3 (-> this data v1-0))) (&+! (-> a2-3 breeds) arg0) @@ -1594,13 +1571,13 @@ this ) -(defmethod relocate battle ((this battle) (arg0 int)) +(defmethod relocate ((this battle) (arg0 int)) (&+! (-> this spawners) arg0) (&+! (-> this allies) arg0) (call-parent-method this arg0) ) -(defmethod initialize-spawner-breeds battle ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) +(defmethod initialize-spawner-breeds ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) (let ((s2-0 0) (s5-0 0) @@ -1685,7 +1662,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod initialize-spawner battle ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) +(defmethod initialize-spawner ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) (set! (-> arg0 flags) (battle-spawner-flags)) (set! (-> arg0 entity) arg1) (set! (-> arg0 creature-index) 0) @@ -1729,13 +1706,13 @@ (none) ) -(defmethod initialize-ally battle ((this battle) (arg0 battle-ally) (arg1 entity-actor)) +(defmethod initialize-ally ((this battle) (arg0 battle-ally) (arg1 entity-actor)) (set! (-> arg0 entity) arg1) 0 (none) ) -(defmethod initialize-enemy-lists battle ((this battle)) +(defmethod initialize-enemy-lists ((this battle)) (local-vars (v0-4 battle-ally-array) (sv-16 res-tag) (sv-32 entity)) (set! sv-16 (new 'static 'res-tag)) (let ((v0-0 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) @@ -1800,7 +1777,7 @@ (none) ) -(defmethod initialize-battle battle ((this battle)) +(defmethod initialize-battle ((this battle)) (set! (-> this spawn-initial-creatures?) #t) (set! (-> this count) (the-as uint 0)) (set! (-> this die-count) (the-as uint 0)) @@ -1839,7 +1816,7 @@ (none) ) -(defmethod init-go battle ((this battle)) +(defmethod init-go ((this battle)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) (go (method-of-object this beaten)) (go (method-of-object this idle)) @@ -1847,7 +1824,7 @@ 0 ) -(defmethod init-from-entity! battle ((this battle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this battle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/common/elec-gate.gc b/goal_src/jak2/levels/common/elec-gate.gc index 3bf51e543b1..226279a06e5 100644 --- a/goal_src/jak2/levels/common/elec-gate.gc +++ b/goal_src/jak2/levels/common/elec-gate.gc @@ -8,73 +8,62 @@ ;; DECOMP BEGINS (deftype elec-gate-params (structure) - ((bolt-spec lightning-spec :offset-assert 0) - (ring-spec lightning-spec :offset-assert 4) - (ring-radius-min float :offset-assert 8) - (ring-radius-max float :offset-assert 12) - (speed-mult float :offset-assert 16) + ((bolt-spec lightning-spec) + (ring-spec lightning-spec) + (ring-radius-min float) + (ring-radius-max float) + (speed-mult float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype elec-gate-bolt (structure) - ((ring lightning-control 2 :offset-assert 0) - (bolt lightning-control :offset-assert 8) - (ring-radius float :offset-assert 12) - (pos float :offset-assert 16) + ((ring lightning-control 2) + (bolt lightning-control) + (ring-radius float) + (pos float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype elec-wall (structure) - ((pos vector :inline :offset-assert 0) - (dir vector :inline :offset-assert 16) + ((pos vector :inline) + (dir vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype elec-gate (process-drawable) - ((params elec-gate-params :offset-assert 200) - (path-l path-control :offset 152) - (path-r path-control :offset-assert 204) - (l-bolt elec-gate-bolt 5 :inline :offset-assert 208) - (part-on sparticle-launch-control :offset 168) - (part-off sparticle-launch-control :offset-assert 368) - (part-spawner-left part-spawner :offset-assert 372) - (part-spawner-right part-spawner :offset-assert 376) - (on-start pair :offset-assert 380) - (on-stop pair :offset-assert 384) - (dividing-wall elec-wall :inline :offset-assert 400) - (plane elec-wall 2 :inline :offset-assert 432) - (wall-y float :offset-assert 496) - (wall-xz float :offset-assert 500) - (lightning-quality float :offset-assert 504) - (quality-enabled? symbol :offset-assert 508) + ((params elec-gate-params) + (path-l path-control :overlay-at path) + (path-r path-control) + (l-bolt elec-gate-bolt 5 :inline) + (part-on sparticle-launch-control :overlay-at part) + (part-off sparticle-launch-control) + (part-spawner-left part-spawner) + (part-spawner-right part-spawner) + (on-start pair) + (on-stop pair) + (dividing-wall elec-wall :inline) + (plane elec-wall 2 :inline) + (wall-y float) + (wall-xz float) + (lightning-quality float) + (quality-enabled? symbol) ) - :heap-base #x180 - :method-count-assert 30 - :size-assert #x200 - :flag-assert #x1e01800200 + (:state-methods + idle + active + shutdown + ) (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (shutdown () _type_ :state 22) - (get-params (_type_) elec-gate-params 23) - (elec-gate-method-24 (_type_) none 24) - (set-palette! (_type_) none 25) - (set-state! (_type_) none 26) - (spawn-particles (_type_ sparticle-launch-control) none 27) - (set-elec-scale-if-close! (_type_ float) none 28) - (set-elec-scale! (_type_ float) none 29) + (get-params (_type_) elec-gate-params) + (elec-gate-method-24 (_type_) none) + (set-palette! (_type_) none) + (set-state! (_type_) none) + (spawn-particles (_type_ sparticle-launch-control) none) + (set-elec-scale-if-close! (_type_ float) none) + (set-elec-scale! (_type_ float) none) ) ) @@ -710,7 +699,7 @@ ) ) -(defmethod set-elec-scale-if-close! elec-gate ((this elec-gate) (arg0 float)) +(defmethod set-elec-scale-if-close! ((this elec-gate) (arg0 float)) "If [[target]]'s position is within `80` [[meters]], set the scale to the value provided @see [[elec-gate::29]]" ;; og:preserve-this changed for PC port so we can render it at any distance @@ -722,7 +711,7 @@ (none) ) -(defmethod spawn-particles elec-gate ((this elec-gate) (sparticle-lc sparticle-launch-control)) +(defmethod spawn-particles ((this elec-gate) (sparticle-lc sparticle-launch-control)) "TODO - Calls [[sparticle-launch-control::11]] on `part-spawner-left` and `part-spawner-right` if they are defined" (if (-> this part-spawner-left) (spawn sparticle-lc (the-as vector (&-> (-> this part-spawner-left child) 8))) @@ -735,7 +724,7 @@ ) ;; WARN: Return type mismatch process-drawable vs elec-gate. -(defmethod relocate elec-gate ((this elec-gate) (new-addr int)) +(defmethod relocate ((this elec-gate) (new-addr int)) (dotimes (bolt-idx 5) (let ((left-bolt (-> this l-bolt bolt-idx))) (if (nonzero? (-> left-bolt bolt)) @@ -760,29 +749,29 @@ (the-as elec-gate ((method-of-type process-drawable relocate) this new-addr)) ) -(defmethod deactivate elec-gate ((this elec-gate)) +(defmethod deactivate ((this elec-gate)) (set-elec-scale-if-close! this 0.0) (call-parent-method this) (none) ) -(defmethod get-params elec-gate ((this elec-gate)) +(defmethod get-params ((this elec-gate)) "@returns [[*default-elec-gate-params*]] by default" *default-elec-gate-params* ) -(defmethod elec-gate-method-24 elec-gate ((this elec-gate)) +(defmethod elec-gate-method-24 ((this elec-gate)) 0 (none) ) -(defmethod set-palette! elec-gate ((this elec-gate)) +(defmethod set-palette! ((this elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" 0 (none) ) -(defmethod set-state! elec-gate ((this elec-gate)) +(defmethod set-state! ((this elec-gate)) "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed make the gate `idle`. @@ -797,7 +786,7 @@ Otherwise, the gate will be `active`." (none) ) -(defmethod init-from-entity! elec-gate ((this elec-gate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this elec-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -878,16 +867,12 @@ This commonly includes things such as: ) (deftype fort-elec-gate (elec-gate) - ((palette-id int32 :offset-assert 512) + ((palette-id int32) ) - :heap-base #x190 - :method-count-assert 30 - :size-assert #x204 - :flag-assert #x1e01900204 ) -(defmethod set-elec-scale! fort-elec-gate ((this fort-elec-gate) (scale float)) +(defmethod set-elec-scale! ((this fort-elec-gate) (scale float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" @@ -898,7 +883,7 @@ This commonly includes things such as: (none) ) -(defmethod set-palette! fort-elec-gate ((this fort-elec-gate)) +(defmethod set-palette! ((this fort-elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 @@ -906,16 +891,12 @@ This commonly includes things such as: ) (deftype drill-elec-gate (elec-gate) - ((palette-id int32 :offset-assert 512) + ((palette-id int32) ) - :heap-base #x190 - :method-count-assert 30 - :size-assert #x204 - :flag-assert #x1e01900204 ) -(defmethod set-elec-scale! drill-elec-gate ((this drill-elec-gate) (arg0 float)) +(defmethod set-elec-scale! ((this drill-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" @@ -924,7 +905,7 @@ This commonly includes things such as: (none) ) -(defmethod set-palette! drill-elec-gate ((this drill-elec-gate)) +(defmethod set-palette! ((this drill-elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 @@ -933,23 +914,15 @@ This commonly includes things such as: (deftype caspad-elec-gate (elec-gate) () - :heap-base #x180 - :method-count-assert 30 - :size-assert #x200 - :flag-assert #x1e01800200 ) (deftype castle-elec-gate (elec-gate) () - :heap-base #x180 - :method-count-assert 30 - :size-assert #x200 - :flag-assert #x1e01800200 ) -(defmethod set-elec-scale! castle-elec-gate ((this castle-elec-gate) (arg0 float)) +(defmethod set-elec-scale! ((this castle-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" @@ -959,7 +932,7 @@ This commonly includes things such as: ) ;; og:preserve-this -(defmethod set-elec-scale! caspad-elec-gate ((this caspad-elec-gate) (arg0 float)) +(defmethod set-elec-scale! ((this caspad-elec-gate) (arg0 float)) "Added, original game did not define this and would crash on call." 0 (none) @@ -1009,22 +982,18 @@ This commonly includes things such as: ) ) -(defmethod get-params caspad-elec-gate ((this caspad-elec-gate)) +(defmethod get-params ((this caspad-elec-gate)) "@returns [[*default-elec-gate-params*]] by default" *caspad-elec-gate-params* ) (deftype palroof-elec-gate (elec-gate) - ((palette-id int32 :offset-assert 512) + ((palette-id int32) ) - :heap-base #x190 - :method-count-assert 30 - :size-assert #x204 - :flag-assert #x1e01900204 ) -(defmethod set-elec-scale! palroof-elec-gate ((this palroof-elec-gate) (arg0 float)) +(defmethod set-elec-scale! ((this palroof-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" @@ -1033,7 +1002,7 @@ This commonly includes things such as: (none) ) -(defmethod set-palette! palroof-elec-gate ((this palroof-elec-gate)) +(defmethod set-palette! ((this palroof-elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 diff --git a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc index 8ec6aa61481..e0e0418ba28 100644 --- a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc +++ b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc @@ -21,36 +21,30 @@ ;; DECOMP BEGINS (deftype amphibian-tongue-attack-info (structure) - ((targ-dist float :offset-assert 0) - (max-length float :offset-assert 4) - (start-pos vector :inline :offset-assert 16) - (base-dir vector :inline :offset-assert 32) - (base-rot vector :inline :offset-assert 48) - (targ-pos vector :inline :offset-assert 64) - (targ-dir vector :inline :offset-assert 80) - (targ-rot vector :inline :offset-assert 96) - (clamped-pos vector :inline :offset-assert 112) - (clamped-dir vector :inline :offset-assert 128) - (clamped-rot vector :inline :offset-assert 144) + ((targ-dist float) + (max-length float) + (start-pos vector :inline) + (base-dir vector :inline) + (base-rot vector :inline) + (targ-pos vector :inline) + (targ-dir vector :inline) + (targ-rot vector :inline) + (clamped-pos vector :inline) + (clamped-dir vector :inline) + (clamped-rot vector :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) (deftype amphibian-joint-mod (basic) - ((joint-index int32 :offset-assert 4) - (proc process-drawable :offset-assert 8) - (max-length float :offset-assert 12) - (target vector :inline :offset-assert 16) + ((joint-index int32) + (proc process-drawable) + (max-length float) + (target vector :inline) ) - :method-count-assert 10 - :size-assert #x20 - :flag-assert #xa00000020 (:methods - (new (symbol type process-drawable int) _type_ 0) - (amphibian-joint-mod-method-9 (_type_) none 9) + (new (symbol type process-drawable int) _type_) + (amphibian-joint-mod-method-9 (_type_) none) ) ) @@ -62,58 +56,50 @@ ) (deftype amphibian-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype amphibian-global-info (basic) - ((prev-blue-hit int8 :offset-assert 4) - (prev-knocked int8 :offset-assert 5) - (notice-anim int32 2 :offset-assert 8) - (run-anim int32 2 :offset-assert 16) - (knocked-anim int32 3 :offset-assert 24) - (knocked-land-anim int32 3 :offset-assert 36) - (blue-hit-anim int32 3 :offset-assert 48) - (jump-wind-up-anim int32 2 :offset-assert 60) - (jump-in-air-anim int32 2 :offset-assert 68) - (jump-land-anim int32 2 :offset-assert 76) + ((prev-blue-hit int8) + (prev-knocked int8) + (notice-anim int32 2) + (run-anim int32 2) + (knocked-anim int32 3) + (knocked-land-anim int32 3) + (blue-hit-anim int32 3) + (jump-wind-up-anim int32 2) + (jump-in-air-anim int32 2) + (jump-land-anim int32 2) ) - :method-count-assert 9 - :size-assert #x54 - :flag-assert #x900000054 ) (deftype amphibian (nav-enemy) - ((tongue-scale float :offset-assert 604) - (flags amphibian-flags :offset-assert 608) - (knocked-anim-index int8 :offset-assert 609) - (jump-anim-index int8 :offset-assert 610) - (tongue-mode uint64 :offset-assert 616) - (tongue-mod amphibian-joint-mod :offset-assert 624) - (attacker-handle handle :offset-assert 632) - (prev-ry float :offset-assert 640) - (prev-ry1 float :offset-assert 644) + ((tongue-scale float) + (flags amphibian-flags) + (knocked-anim-index int8) + (jump-anim-index int8) + (tongue-mode uint64) + (tongue-mod amphibian-joint-mod) + (attacker-handle handle) + (prev-ry float) + (prev-ry1 float) ) - :heap-base #x210 - :method-count-assert 188 - :size-assert #x288 - :flag-assert #xbc02100288 + (:state-methods + attack-forward + attack-forward-lunge + attack-forward-end + attack-spin + stare-idle + tongue-attack + ) (:methods - (attack-forward () _type_ :state 178) - (attack-forward-lunge () _type_ :state 179) - (attack-forward-end () _type_ :state 180) - (attack-spin () _type_ :state 181) - (stare-idle () _type_ :state 182) - (tongue-attack () _type_ :state 183) - (amphibian-method-184 (_type_ vector vector) vector 184) - (amphibian-method-185 (_type_ amphibian-tongue-attack-info) none 185) - (amphibian-method-186 (_type_ vector vector) symbol 186) - (amphibian-method-187 (_type_) none 187) + (amphibian-method-184 (_type_ vector vector) vector) + (amphibian-method-185 (_type_ amphibian-tongue-attack-info) none) + (amphibian-method-186 (_type_ vector vector) symbol) + (amphibian-method-187 (_type_) none) ) ) @@ -270,12 +256,12 @@ (set! (-> *amphibian-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod relocate amphibian-joint-mod ((this amphibian-joint-mod) (arg0 int)) +(defmethod relocate ((this amphibian-joint-mod) (arg0 int)) (&+! (-> this proc) arg0) this ) -(defmethod general-event-handler amphibian ((this amphibian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this amphibian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -351,7 +337,7 @@ ) ;; WARN: Return type mismatch amphibian-joint-mod vs none. -(defmethod amphibian-joint-mod-method-9 amphibian-joint-mod ((this amphibian-joint-mod)) +(defmethod amphibian-joint-mod-method-9 ((this amphibian-joint-mod)) (let ((v1-3 (-> this proc node-list data (-> this joint-index)))) (set! (-> v1-3 param0) amphibian-joint-mod-callback) (set! (-> v1-3 param1) this) @@ -367,7 +353,7 @@ ) ) -(defmethod enemy-method-106 amphibian ((this amphibian) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 ((this amphibian) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) (t9-0 this arg0 arg1 arg2 arg3) ) @@ -381,7 +367,7 @@ (none) ) -(defmethod damage-amount-from-attack amphibian ((this amphibian) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this amphibian) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let* ((t9-0 (method-of-type nav-enemy damage-amount-from-attack)) (v0-0 (t9-0 this arg0 arg1)) @@ -395,7 +381,7 @@ ) ) -(defmethod enemy-method-51 amphibian ((this amphibian)) +(defmethod enemy-method-51 ((this amphibian)) (local-vars (f0-1 float)) 0.0 (set! f0-1 @@ -420,7 +406,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 amphibian ((this amphibian) (arg0 vector)) +(defmethod enemy-method-52 ((this amphibian) (arg0 vector)) (cond ((and (nonzero? (-> this hit-points)) (zero? (-> this fated-time)) (!= (-> this incoming knocked-type) 6)) (enemy-method-50 this arg0) @@ -436,7 +422,7 @@ (none) ) -(defmethod enemy-method-77 amphibian ((this amphibian) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this amphibian) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((v1-3 (enemy-method-120 this 3 (ash 1 (-> *amphibian-global-info* prev-blue-hit)))) @@ -478,7 +464,7 @@ #t ) -(defmethod enemy-method-78 amphibian ((this amphibian) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this amphibian) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -517,7 +503,7 @@ ) ) -(defmethod enemy-method-89 amphibian ((this amphibian) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this amphibian) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -538,7 +524,7 @@ #t ) -(defmethod enemy-method-87 amphibian ((this amphibian) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this amphibian) (arg0 enemy-jump-info)) (let ((s4-0 (-> this draw art-group data (-> *amphibian-global-info* jump-in-air-anim (-> this jump-anim-index))))) (ja-channel-push! 1 (seconds 0.07)) (let ((a0-6 (-> this skel root-channel 0))) @@ -552,7 +538,7 @@ #t ) -(defmethod enemy-method-88 amphibian ((this amphibian) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this amphibian) (arg0 enemy-jump-info)) (let ((s4-0 (-> this draw art-group data (-> *amphibian-global-info* jump-land-anim (-> this jump-anim-index))))) (if (zero? (-> this jump-anim-index)) (ja-channel-push! 1 (seconds 0.07)) @@ -570,7 +556,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-90 amphibian ((this amphibian) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 ((this amphibian) (arg0 int) (arg1 enemy-jump-info)) (when (or (= (-> this jump-why) 3) (= (-> this jump-why) 2)) (cond ((zero? arg0) @@ -693,7 +679,7 @@ ) ) -(defmethod amphibian-method-184 amphibian ((this amphibian) (arg0 vector) (arg1 vector)) +(defmethod amphibian-method-184 ((this amphibian) (arg0 vector) (arg1 vector)) (vector<-cspace! arg0 (-> this node-list data 13)) (vector-! arg1 (-> this tongue-mod target) arg0) (vector-normalize! @@ -704,7 +690,7 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod amphibian-method-185 amphibian ((this amphibian) (arg0 amphibian-tongue-attack-info)) +(defmethod amphibian-method-185 ((this amphibian) (arg0 amphibian-tongue-attack-info)) (let ((a0-1 (-> this node-list data 11 bone transform))) (set! (-> arg0 base-dir quad) (-> a0-1 vector 2 quad)) ) @@ -766,7 +752,7 @@ (none) ) -(defmethod amphibian-method-186 amphibian ((this amphibian) (arg0 vector) (arg1 vector)) +(defmethod amphibian-method-186 ((this amphibian) (arg0 vector) (arg1 vector)) (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -811,7 +797,7 @@ ) ;; WARN: Return type mismatch int vs symbol. -(defmethod enemy-method-76 amphibian ((this amphibian) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 ((this amphibian) (arg0 process) (arg1 event-message-block)) (let ((t9-0 (method-of-type nav-enemy enemy-method-76))) (t9-0 this (the-as process-focusable arg0) arg1) ) @@ -829,7 +815,7 @@ ) ) -(defmethod go-stare amphibian ((this amphibian)) +(defmethod go-stare ((this amphibian)) (let ((s5-0 (-> this focus aware))) (cond ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) @@ -853,7 +839,7 @@ ) ) -(defmethod go-hostile amphibian ((this amphibian)) +(defmethod go-hostile ((this amphibian)) (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -871,7 +857,7 @@ (go (method-of-object this hostile)) ) -(defmethod track-target! amphibian ((this amphibian)) +(defmethod track-target! ((this amphibian)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -882,7 +868,7 @@ (none) ) -(defmethod amphibian-method-187 amphibian ((this amphibian)) +(defmethod amphibian-method-187 ((this amphibian)) (with-pp (let* ((f30-0 (-> this nav state speed)) (f26-0 0.0) @@ -1678,14 +1664,14 @@ ) ;; WARN: Return type mismatch nav-enemy vs amphibian. -(defmethod relocate amphibian ((this amphibian) (arg0 int)) +(defmethod relocate ((this amphibian) (arg0 int)) (if (nonzero? (-> this tongue-mod)) (&+! (-> this tongue-mod) arg0) ) (the-as amphibian ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod init-enemy-collision! amphibian ((this amphibian)) +(defmethod init-enemy-collision! ((this amphibian)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1763,7 +1749,7 @@ (none) ) -(defmethod init-enemy! amphibian ((this amphibian)) +(defmethod init-enemy! ((this amphibian)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (set! (-> this attacker-handle) (the-as handle #f)) (initialize-skeleton diff --git a/goal_src/jak2/levels/common/enemy/bouncer.gc b/goal_src/jak2/levels/common/enemy/bouncer.gc index 5465a3e7ee5..c8088fee7ae 100644 --- a/goal_src/jak2/levels/common/enemy/bouncer.gc +++ b/goal_src/jak2/levels/common/enemy/bouncer.gc @@ -8,20 +8,18 @@ ;; DECOMP BEGINS (deftype bouncer (process-drawable) - ((spring-height meters :offset-assert 200) - (smush float :offset-assert 204) - (mods basic :offset-assert 208) + ((spring-height meters) + (smush float) + (mods basic) ) - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd4 - :flag-assert #x19006000d4 + (:state-methods + idle + fire + smush + ) (:methods - (idle () _type_ :state 20) - (fire () _type_ :state 21) - (smush () _type_ :state 22) - (init-skeleton! (_type_) none 23) - (bouncer-method-24 (_type_) none 24) + (init-skeleton! (_type_) none) + (bouncer-method-24 (_type_) none) ) ) @@ -186,7 +184,7 @@ :post transform-post ) -(defmethod init-skeleton! bouncer ((this bouncer)) +(defmethod init-skeleton! ((this bouncer)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bouncer" (the-as (pointer uint32) #f))) @@ -196,7 +194,7 @@ (none) ) -(defmethod bouncer-method-24 bouncer ((this bouncer)) +(defmethod bouncer-method-24 ((this bouncer)) "TODO - collision stuff" (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) @@ -220,7 +218,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! bouncer ((this bouncer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bouncer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/common/enemy/centurion.gc b/goal_src/jak2/levels/common/enemy/centurion.gc index d11f5c8e685..ee694c80408 100644 --- a/goal_src/jak2/levels/common/enemy/centurion.gc +++ b/goal_src/jak2/levels/common/enemy/centurion.gc @@ -143,14 +143,10 @@ (deftype centurion-shot (metalhead-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) -(defmethod play-impact-sound centurion-shot ((this centurion-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this centurion-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -168,7 +164,7 @@ (none) ) -(defmethod init-proj-settings! centurion-shot ((this centurion-shot)) +(defmethod init-proj-settings! ((this centurion-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (call-parent-method this) (set! (-> this max-speed) 327680.0) @@ -177,29 +173,27 @@ ) (deftype centurion (nav-enemy) - ((los los-control :inline :offset-assert 608) - (target-pos vector :inline :offset-assert 768) - (can-shoot? basic :offset-assert 784) - (incoming-attack-id uint32 :offset-assert 788) - (can-take-damage? symbol :offset-assert 792) - (first-shoot? symbol :offset-assert 796) - (shoot-dir vector :inline :offset-assert 800) - (tar-pos vector :inline :offset-assert 816) - (joint joint-mod :offset-assert 832) - (joint-enable symbol :offset-assert 836) - (victory-sound sound-id :offset-assert 840) - (shield-shot uint32 :offset-assert 844) + ((los los-control :inline) + (target-pos vector :inline) + (can-shoot? basic) + (incoming-attack-id uint32) + (can-take-damage? symbol) + (first-shoot? symbol) + (shoot-dir vector :inline) + (tar-pos vector :inline) + (joint joint-mod) + (joint-enable symbol) + (victory-sound sound-id) + (shield-shot uint32) ) - :heap-base #x2d0 - :method-count-assert 183 - :size-assert #x350 - :flag-assert #xb702d00350 + (:state-methods + attack + fire + ) (:methods - (attack () _type_ :state 178) - (fire () _type_ :state 179) - (centurion-method-180 (_type_) none 180) - (centurion-method-181 (_type_ vector) int 181) - (centurion-method-182 (_type_ vector) symbol 182) + (centurion-method-180 (_type_) none) + (centurion-method-181 (_type_ vector) int) + (centurion-method-182 (_type_ vector) symbol) ) ) @@ -211,24 +205,18 @@ ) (deftype centurion-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype centurion-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (yellow-hit-anim int32 1 :offset-assert 8) - (blue-hit-anim int32 3 :offset-assert 12) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (yellow-hit-anim int32 1) + (blue-hit-anim int32 3) ) :pack-me - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) @@ -417,7 +405,7 @@ (set! (-> *centurion-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler centurion ((this centurion) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this centurion) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -527,7 +515,7 @@ ) ) -(defmethod centurion-method-181 centurion ((this centurion) (arg0 vector)) +(defmethod centurion-method-181 ((this centurion) (arg0 vector)) (local-vars (sv-224 vector) (sv-240 vector) (sv-256 vector)) (if (not (-> this joint-enable)) (return (the-as int #f)) @@ -632,7 +620,7 @@ ) ) -(defmethod go-stare centurion ((this centurion)) +(defmethod go-stare ((this centurion)) (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) (go (method-of-object this hostile)) ) @@ -663,7 +651,7 @@ :post nav-enemy-simple-post ) -(defmethod centurion-method-180 centurion ((this centurion)) +(defmethod centurion-method-180 ((this centurion)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -884,14 +872,14 @@ :post enemy-simple-post ) -(defmethod dispose! centurion ((this centurion)) +(defmethod dispose! ((this centurion)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (play-communicator-speech! (-> *talker-speech* 58)) (call-parent-method this) (none) ) -(defmethod track-target! centurion ((this centurion)) +(defmethod track-target! ((this centurion)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1043,12 +1031,12 @@ ) ) -(defmethod nav-enemy-method-142 centurion ((this centurion) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this centurion) (arg0 nav-control)) 0 (none) ) -(defmethod centurion-method-182 centurion ((this centurion) (arg0 vector)) +(defmethod centurion-method-182 ((this centurion) (arg0 vector)) (local-vars (sv-96 int) (sv-112 int)) (when (nonzero? (-> this path)) (let ((s5-0 (-> this path)) @@ -1275,7 +1263,7 @@ :post nav-enemy-travel-post ) -(defmethod enemy-method-77 centurion ((this centurion) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this centurion) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) @@ -1346,7 +1334,7 @@ ) ) -(defmethod enemy-method-78 centurion ((this centurion) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this centurion) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) @@ -1395,13 +1383,13 @@ ) ) -(defmethod coin-flip? centurion ((this centurion)) +(defmethod coin-flip? ((this centurion)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 centurion ((this centurion) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this centurion) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) (the-as symbol (if (t9-0 this arg0 arg1) (set-dst-proc! (-> this los) (-> this focus handle)) @@ -1410,7 +1398,7 @@ ) ) -(defmethod init-enemy-collision! centurion ((this centurion)) +(defmethod init-enemy-collision! ((this centurion)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1486,14 +1474,14 @@ (none) ) -(defmethod relocate centurion ((this centurion) (arg0 int)) +(defmethod relocate ((this centurion) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) (call-parent-method this arg0) ) -(defmethod init-enemy! centurion ((this centurion)) +(defmethod init-enemy! ((this centurion)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (stack-size-set! (-> this main-thread) 256) (initialize-skeleton diff --git a/goal_src/jak2/levels/common/enemy/flitter.gc b/goal_src/jak2/levels/common/enemy/flitter.gc index 2546ab88c3a..ea23353651c 100644 --- a/goal_src/jak2/levels/common/enemy/flitter.gc +++ b/goal_src/jak2/levels/common/enemy/flitter.gc @@ -343,29 +343,27 @@ ) (deftype flitter (nav-enemy) - ((move-angle float :offset-assert 604) - (heading basic :offset-assert 608) - (change-dir-time time-frame :offset-assert 616) - (last-change-dir uint64 :offset-assert 624) - (off-screen-timer uint64 :offset-assert 632) - (amb-sound-timer uint64 :offset-assert 640) - (attack-time time-frame :offset-assert 648) - (target-pos vector :inline :offset-assert 656) - (attack-pos vector :inline :offset-assert 672) - (base-height float :offset-assert 688) - (minimap connection-minimap :offset-assert 692) + ((move-angle float) + (heading basic) + (change-dir-time time-frame) + (last-change-dir uint64) + (off-screen-timer uint64) + (amb-sound-timer uint64) + (attack-time time-frame) + (target-pos vector :inline) + (attack-pos vector :inline) + (base-height float) + (minimap connection-minimap) ) - :heap-base #x240 - :method-count-assert 184 - :size-assert #x2b8 - :flag-assert #xb8024002b8 + (:state-methods + attack + ambush-jumping + ) (:methods - (attack () _type_ :state 178) - (ambush-jumping () _type_ :state 179) - (flitter-method-180 (_type_) none 180) - (flitter-method-181 (_type_) none 181) - (flitter-method-182 (_type_ process-focusable) symbol 182) - (flitter-method-183 (_type_) float 183) + (flitter-method-180 (_type_) none) + (flitter-method-181 (_type_) none) + (flitter-method-182 (_type_ process-focusable) symbol) + (flitter-method-183 (_type_) float) ) ) @@ -531,7 +529,7 @@ (set! (-> *flitter-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod flitter-method-182 flitter ((this flitter) (arg0 process-focusable)) +(defmethod flitter-method-182 ((this flitter) (arg0 process-focusable)) (and (logtest? (-> this draw status) (draw-control-status on-screen)) (let ((s4-0 (camera-matrix))) (camera-pos) @@ -545,7 +543,7 @@ ) ) -(defmethod enemy-method-77 flitter ((this flitter) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this flitter) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (let ((a0-2 (-> this skel root-channel 0))) @@ -587,7 +585,7 @@ ) ) -(defmethod enemy-method-78 flitter ((this flitter) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this flitter) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -609,7 +607,7 @@ ) ) -(defmethod go-stare2 flitter ((this flitter)) +(defmethod go-stare2 ((this flitter)) (if (and (= (-> this focus aware) (enemy-aware enemy-aware-2)) (not (nav-enemy-method-163 this)) (not (and (-> this next-state) (= (-> this next-state name) 'pacing))) @@ -820,11 +818,11 @@ :post nav-enemy-falling-post ) -(defmethod enemy-method-99 flitter ((this flitter) (arg0 process-focusable)) +(defmethod enemy-method-99 ((this flitter) (arg0 process-focusable)) (focus-test? arg0 mech) ) -(defmethod flitter-method-180 flitter ((this flitter)) +(defmethod flitter-method-180 ((this flitter)) (let* ((s5-0 (handle->process (-> this focus handle))) (s3-0 (if (type? s5-0 process-focusable) (the-as process-focusable s5-0) @@ -894,7 +892,7 @@ ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod flitter-method-181 flitter ((this flitter)) +(defmethod flitter-method-181 ((this flitter)) (when (time-elapsed? (the-as int (-> this amb-sound-timer)) (the int (* 300.0 (rand-vu-float-range 1.5 3.0)))) (sound-play "flitter-amb" :position (-> this root trans)) (set! (-> this amb-sound-timer) (the-as uint (current-time))) @@ -1122,7 +1120,7 @@ ) ) -(defmethod flitter-method-183 flitter ((this flitter)) +(defmethod flitter-method-183 ((this flitter)) (lerp-scale 0.0 1.0 (- (-> this attack-pos y) (-> this root trans y)) 13926.4 25600.0) ) @@ -1242,7 +1240,7 @@ ) ) -(defmethod dispose! flitter ((this flitter)) +(defmethod dispose! ((this flitter)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (when (-> this minimap) (logior! (-> this minimap flags) (minimap-flag fade-out)) @@ -1252,7 +1250,7 @@ (none) ) -(defmethod init-enemy-collision! flitter ((this flitter)) +(defmethod init-enemy-collision! ((this flitter)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1305,7 +1303,7 @@ ) ;; WARN: Return type mismatch connection-minimap vs none. -(defmethod init-enemy! flitter ((this flitter)) +(defmethod init-enemy! ((this flitter)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc index 5c4baddd6b5..7945b518ef8 100644 --- a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc +++ b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc @@ -15,47 +15,37 @@ ) (deftype fodder-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype fodder-global-info (basic) - ((prev-blue-hit int8 :offset-assert 4) - (blue-hit-anim fodder-anim-info 3 :inline :offset-assert 8) + ((prev-blue-hit int8) + (blue-hit-anim fodder-anim-info 3 :inline) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype fodder (nav-enemy) - ((left-eye joint-mod :offset-assert 604) - (right-eye joint-mod :offset-assert 608) - (look-at-other handle :offset-assert 616) - (neck-away-from symbol :offset-assert 624) - (look-at-other-time time-frame :offset-assert 632) - (pad-iuj1n23i1 uint32 3 :offset-assert 640) - (slow-timer time-frame :offset-assert 656) - (fast-timer time-frame :offset-assert 664) - (attack-type uint64 :offset-assert 672) - (test-vec vector :inline :offset-assert 688) + ((left-eye joint-mod) + (right-eye joint-mod) + (look-at-other handle) + (neck-away-from symbol) + (look-at-other-time time-frame) + (pad-iuj1n23i1 uint32 3) + (slow-timer time-frame) + (fast-timer time-frame) + (attack-type uint64) + (test-vec vector :inline) ) - :heap-base #x240 - :method-count-assert 183 - :size-assert #x2c0 - :flag-assert #xb7024002c0 (:methods - (fodder-method-178 (_type_) none 178) - (look-at-position! (_type_ vector) float 179) - (fodder-method-180 (_type_) symbol 180) - (fodder-method-181 (_type_ symbol) none 181) - (fodder-method-182 (_type_) float 182) + (fodder-method-178 (_type_) none) + (look-at-position! (_type_ vector) float) + (fodder-method-180 (_type_) symbol) + (fodder-method-181 (_type_ symbol) none) + (fodder-method-182 (_type_) float) ) ) @@ -209,7 +199,7 @@ (set! (-> *fodder-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod look-at-target! fodder ((this fodder) (arg0 enemy-flag)) +(defmethod look-at-target! ((this fodder) (arg0 enemy-flag)) "Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available @param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details" (let ((parent-method (method-of-type nav-enemy look-at-target!))) @@ -225,7 +215,7 @@ (none) ) -(defmethod stop-looking-at-target! fodder ((this fodder)) +(defmethod stop-looking-at-target! ((this fodder)) "Will unset [[enemy-flag::death-start]] and [[enemy-flag::lock-focus]] and call [[joint-mod::shut-down]] if applicable" (let ((parent-method (method-of-type nav-enemy stop-looking-at-target!))) (parent-method this) @@ -240,7 +230,7 @@ (none) ) -(defmethod look-at-position! fodder ((this fodder) (position vector)) +(defmethod look-at-position! ((this fodder) (position vector)) "Adjusts the eyes to look at particular position, or the focused target @param position If this is provided, it will be used with [[joint-mod::target-set!]] to adjust the eyes, otherwise the `focus` position is used @return TODO - unsure what the return value is, but it seems to make the eyes more lazy" @@ -268,7 +258,7 @@ ) ) -(defmethod fodder-method-180 fodder ((this fodder)) +(defmethod fodder-method-180 ((this fodder)) "@TODO no idea, never seems to do anything because the actor-group-count is always 0" (when (time-elapsed? (-> this look-at-other-time) (seconds 0.25)) (dotimes (group-idx (-> this actor-group-count)) @@ -325,7 +315,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod track-target! fodder ((this fodder)) +(defmethod track-target! ((this fodder)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -549,7 +539,7 @@ ) ) -(defmethod fodder-method-182 fodder ((this fodder)) +(defmethod fodder-method-182 ((this fodder)) (ja-channel-push! 2 (seconds 0.2)) (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! @@ -883,7 +873,7 @@ ) ) -(defmethod enemy-method-77 fodder ((this fodder) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this fodder) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((a2-0 (ash 1 (-> *fodder-global-info* prev-blue-hit))) @@ -926,7 +916,7 @@ #t ) -(defmethod enemy-method-78 fodder ((this fodder) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this fodder) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) #f @@ -946,7 +936,7 @@ ) ) -(defmethod fodder-method-181 fodder ((this fodder) (arg0 symbol)) +(defmethod fodder-method-181 ((this fodder) (arg0 symbol)) (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 @@ -963,12 +953,12 @@ (none) ) -(defmethod coin-flip? fodder ((this fodder)) +(defmethod coin-flip? ((this fodder)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod init-enemy-collision! fodder ((this fodder)) +(defmethod init-enemy-collision! ((this fodder)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1032,7 +1022,7 @@ (none) ) -(defmethod relocate fodder ((this fodder) (arg0 int)) +(defmethod relocate ((this fodder) (arg0 int)) (if (nonzero? (-> this left-eye)) (&+! (-> this left-eye) arg0) ) @@ -1055,7 +1045,7 @@ (set! (-> arg0 ignore-angle) 30947.555) ) -(defmethod init-enemy! fodder ((this fodder)) +(defmethod init-enemy! ((this fodder)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (stack-size-set! (-> this main-thread) 256) (initialize-skeleton @@ -1093,6 +1083,6 @@ (none) ) -(defmethod enemy-method-99 fodder ((this fodder) (arg0 process-focusable)) +(defmethod enemy-method-99 ((this fodder) (arg0 process-focusable)) (focus-test? arg0 mech) ) diff --git a/goal_src/jak2/levels/common/enemy/grenadier.gc b/goal_src/jak2/levels/common/enemy/grenadier.gc index 7b9b8fbf6bc..c12c2f6510b 100644 --- a/goal_src/jak2/levels/common/enemy/grenadier.gc +++ b/goal_src/jak2/levels/common/enemy/grenadier.gc @@ -60,39 +60,34 @@ ) (deftype bank-info (structure) - ((circle sphere :inline :offset-assert 0) - (tangent-pos vector :inline :offset-assert 16) - (final-pos vector :inline :offset-assert 32) - (final-dir vector :inline :offset-assert 48) + ((circle sphere :inline) + (tangent-pos vector :inline) + (final-pos vector :inline) + (final-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype grenadier (nav-enemy) - ((shot-trajectory trajectory :inline :offset-assert 608) - (hostile-path path-control :offset-assert 648) - (bank bank-info :inline :offset-assert 656) - (joint joint-mod-blend-world :offset-assert 720) - (heading symbol :offset-assert 724) - (move-pos vector :inline :offset-assert 736) - (move-angle float :offset-assert 752) - (status-flags grenadier-flags :offset-assert 760) - (suppress-knockaside-timer time-frame :offset-assert 768) + ((shot-trajectory trajectory :inline) + (hostile-path path-control) + (bank bank-info :inline) + (joint joint-mod-blend-world) + (heading symbol) + (move-pos vector :inline) + (move-angle float) + (status-flags grenadier-flags) + (suppress-knockaside-timer time-frame) ) - :heap-base #x290 - :method-count-assert 184 - :size-assert #x308 - :flag-assert #xb802900308 + (:state-methods + attack + backup + spin-kick + ) (:methods - (attack () _type_ :state 178) - (backup () _type_ :state 179) - (spin-kick () _type_ :state 180) - (grenadier-method-181 (_type_) none 181) - (grenadier-method-182 (_type_ vector) none 182) - (grenadier-method-183 (_type_) none 183) + (grenadier-method-181 (_type_) none) + (grenadier-method-182 (_type_ vector) none) + (grenadier-method-183 (_type_) none) ) ) @@ -292,7 +287,7 @@ (set! (-> *grenadier-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler grenadier ((this grenadier) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this grenadier) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -346,7 +341,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod grenadier-method-182 grenadier ((this grenadier) (arg0 vector)) +(defmethod grenadier-method-182 ((this grenadier) (arg0 vector)) (cloest-point-on-mesh (-> this nav) arg0 arg0 (the-as nav-poly #f)) (set! (-> this bank final-pos quad) (-> arg0 quad)) (set! (-> this bank tangent-pos quad) (-> arg0 quad)) @@ -354,7 +349,7 @@ (none) ) -(defmethod grenadier-method-181 grenadier ((this grenadier)) +(defmethod grenadier-method-181 ((this grenadier)) (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 (cond @@ -707,7 +702,7 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. -(defmethod enemy-method-78 grenadier ((this grenadier) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this grenadier) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -1055,7 +1050,7 @@ ) ) -(defmethod go-hostile grenadier ((this grenadier)) +(defmethod go-hostile ((this grenadier)) (if (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) (and (logtest? (-> this status-flags) (grenadier-flags grflags-0)) (handle->process (-> this focus handle)) @@ -1096,7 +1091,7 @@ ) ) -(defmethod nav-enemy-method-142 grenadier ((this grenadier) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this grenadier) (arg0 nav-control)) (local-vars (a0-4 int) (a0-6 int)) (b! (logtest? (-> this status-flags) (grenadier-flags grflags-1)) cfg-6 :delay (empty-form)) (let ((v1-3 (new 'stack-no-clear 'vector)) @@ -1144,7 +1139,7 @@ (none) ) -(defmethod track-target! grenadier ((this grenadier)) +(defmethod track-target! ((this grenadier)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1158,7 +1153,7 @@ (none) ) -(defmethod init-enemy-collision! grenadier ((this grenadier)) +(defmethod init-enemy-collision! ((this grenadier)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1245,7 +1240,7 @@ (none) ) -(defmethod relocate grenadier ((this grenadier) (arg0 int)) +(defmethod relocate ((this grenadier) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -1257,7 +1252,7 @@ (call-parent-method this arg0) ) -(defmethod init-enemy! grenadier ((this grenadier)) +(defmethod init-enemy! ((this grenadier)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/common/enemy/grunt.gc b/goal_src/jak2/levels/common/enemy/grunt.gc index 8bf3f444b5e..cac59b3bc70 100644 --- a/goal_src/jak2/levels/common/enemy/grunt.gc +++ b/goal_src/jak2/levels/common/enemy/grunt.gc @@ -15,68 +15,60 @@ ) (deftype grunt-anim-info (structure) - ((anim-index int32 :offset-assert 0) - (travel-speed meters :offset-assert 4) + ((anim-index int32) + (travel-speed meters) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype grunt-global-info (basic) - ((prev-knocked-anim-index int32 :offset-assert 4) - (prev-yellow-hit-anim-index int32 :offset-assert 8) - (prev-blue-hit-anim-index int32 :offset-assert 12) - (patrol-anim grunt-anim-info 4 :inline :offset-assert 16) - (charge-anim grunt-anim-info 3 :inline :offset-assert 48) - (attack-anim grunt-anim-info 2 :inline :offset-assert 72) - (knocked-anim grunt-anim-info 4 :inline :offset-assert 88) - (knocked-land-anim grunt-anim-info 4 :inline :offset-assert 120) - (yellow-hit-anim grunt-anim-info 4 :inline :offset-assert 152) - (blue-hit-anim grunt-anim-info 6 :inline :offset-assert 184) + ((prev-knocked-anim-index int32) + (prev-yellow-hit-anim-index int32) + (prev-blue-hit-anim-index int32) + (patrol-anim grunt-anim-info 4 :inline) + (charge-anim grunt-anim-info 3 :inline) + (attack-anim grunt-anim-info 2 :inline) + (knocked-anim grunt-anim-info 4 :inline) + (knocked-land-anim grunt-anim-info 4 :inline) + (yellow-hit-anim grunt-anim-info 4 :inline) + (blue-hit-anim grunt-anim-info 6 :inline) ) - :method-count-assert 9 - :size-assert #xe8 - :flag-assert #x9000000e8 ) (deftype grunt (nav-enemy) - ((patrol-anim grunt-anim-info :offset-assert 604) - (charge-anim grunt-anim-info :offset-assert 608) - (attack-anim grunt-anim-info :offset-assert 612) - (knocked-anim grunt-anim-info :offset-assert 616) - (yellow-hit-anim grunt-anim-info :offset-assert 620) - (blue-hit-anim grunt-anim-info :offset-assert 624) - (intro-path path-control :offset-assert 628) - (use-charge-anim-index int8 :offset-assert 632) - (knocked-anim-index int8 :offset-assert 633) - (jumping-ambush-path-pt int8 :offset-assert 634) - (grunt-flags uint8 :offset-assert 635) - (unknown-byte-n1k2n3 int8 :offset 636) - (unknown-byte-m2j342 int8 :offset 637) - (unknown-byte-1ji2n3 int8 :offset 638) - (unknown-byte-n123n int8 :offset 639) - (state-timeout2 uint64 :offset-assert 640) - (next-warn-time time-frame :offset-assert 648) - (dest vector :inline :offset-assert 656) - (minimap connection-minimap :offset 688) + ((patrol-anim grunt-anim-info) + (charge-anim grunt-anim-info) + (attack-anim grunt-anim-info) + (knocked-anim grunt-anim-info) + (yellow-hit-anim grunt-anim-info) + (blue-hit-anim grunt-anim-info) + (intro-path path-control) + (use-charge-anim-index int8) + (knocked-anim-index int8) + (jumping-ambush-path-pt int8) + (grunt-flags uint8) + (unknown-byte-n1k2n3 int8 :offset 636) + (unknown-byte-m2j342 int8 :offset 637) + (unknown-byte-1ji2n3 int8 :offset 638) + (unknown-byte-n123n int8 :offset 639) + (state-timeout2 uint64) + (next-warn-time time-frame) + (dest vector :inline) + (minimap connection-minimap :offset 688) ) - :heap-base #x240 - :method-count-assert 186 - :size-assert #x2b4 - :flag-assert #xba024002b4 + (:state-methods + attack + falling-ambush + jumping-ambush + jumping-ambush-cont + wait-for-focus + spin-attack + ) (:methods - (attack () _type_ :state 178) - (falling-ambush () _type_ :state 179) - (jumping-ambush () _type_ :state 180) - (jumping-ambush-cont () _type_ :state 181) - (wait-for-focus () _type_ :state 182) - (spin-attack () _type_ :state 183) - (grunt-method-184 (_type_ float) process-focusable 184) - (get-enemy-info (_type_) nav-enemy-info 185) + (grunt-method-184 (_type_ float) process-focusable) + (get-enemy-info (_type_) nav-enemy-info) ) ) @@ -337,7 +329,7 @@ (set! (-> *grunt-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler grunt ((this grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -396,7 +388,7 @@ ) ) -(defmethod go-ambush grunt ((this grunt)) +(defmethod go-ambush ((this grunt)) (cond ((logtest? (-> this fact enemy-options) (enemy-option user10)) (go (method-of-object this falling-ambush)) @@ -486,7 +478,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 grunt ((this grunt)) +(defmethod enemy-method-93 ((this grunt)) (case (-> this jump-why) ((2) (go (method-of-object this jumping-ambush-cont)) @@ -675,7 +667,7 @@ ) ) -(defmethod grunt-method-184 grunt ((this grunt) (arg0 float)) +(defmethod grunt-method-184 ((this grunt) (arg0 float)) (local-vars (v1-5 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1160,7 +1152,7 @@ ) ) -(defmethod enemy-method-77 grunt ((this grunt) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this grunt) (arg0 (pointer float))) (local-vars (v1-72 int) (a2-3 int) (a2-5 int)) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) @@ -1304,7 +1296,7 @@ ) ) -(defmethod enemy-method-78 grunt ((this grunt) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this grunt) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (or (logtest? (-> this stack 511) 2) (let ((v1-7 (if (> (-> this skel active-channels) 0) @@ -1403,7 +1395,7 @@ :post (-> (method-of-type nav-enemy idle) post) ) -(defmethod dispose! grunt ((this grunt)) +(defmethod dispose! ((this grunt)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (when (-> this minimap) (logior! (-> this minimap flags) (minimap-flag fade-out)) @@ -1414,14 +1406,14 @@ ) ;; WARN: Return type mismatch nav-enemy vs grunt. -(defmethod relocate grunt ((this grunt) (arg0 int)) +(defmethod relocate ((this grunt) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) ) (the-as grunt ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod init-enemy-collision! grunt ((this grunt)) +(defmethod init-enemy-collision! ((this grunt)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1517,12 +1509,12 @@ (none) ) -(defmethod get-enemy-info grunt ((this grunt)) +(defmethod get-enemy-info ((this grunt)) "@returns the [[nav-enemy-info]] associated with this type of grunt" *grunt-nav-enemy-info* ) -(defmethod init-enemy! grunt ((this grunt)) +(defmethod init-enemy! ((this grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1576,7 +1568,7 @@ (none) ) -(defmethod go-idle grunt ((this grunt)) +(defmethod go-idle ((this grunt)) (if (logtest? (-> this fact enemy-options) (enemy-option user9)) (go (method-of-object this wait-for-focus)) (go (method-of-object this idle)) diff --git a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc index 430e7c496ec..8d9eed0b3c0 100644 --- a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc +++ b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc @@ -17,47 +17,38 @@ ) (deftype guard-level-anim-info (structure) - ((anim-index int32 2 :offset-assert 0) - (anim-index-front int32 :offset 0) - (anim-index-back int32 :offset 4) - (unsigned-anim-index-front uint32 :offset 0) - (unsigned-anim-index-back uint32 :offset 4) + ((anim-index int32 2) + (anim-index-front int32 :overlay-at (-> anim-index 0)) + (anim-index-back int32 :overlay-at (-> anim-index 1)) + (unsigned-anim-index-front uint32 :overlay-at (-> anim-index 0)) + (unsigned-anim-index-back uint32 :overlay-at (-> anim-index 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype guard-level-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (knocked guard-level-anim-info :inline :offset-assert 8) - (anim-knocked-front int32 :offset 8) - (anim-knocked-back int32 :offset 12) - (knocked-land guard-level-anim-info :inline :offset-assert 16) - (anim-knocked-front-land int32 :offset 16) - (anim-knocked-back-land int32 :offset 20) - (yellow-hit-anim guard-level-anim-info 2 :inline :offset-assert 24) - (yellow-land-anim guard-level-anim-info 2 :inline :offset-assert 40) - (blue-hit-anim guard-level-anim-info 1 :inline :offset-assert 56) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (knocked guard-level-anim-info :inline) + (anim-knocked-front int32 :overlay-at (-> knocked anim-index 0)) + (anim-knocked-back int32 :overlay-at (-> knocked anim-index 1)) + (knocked-land guard-level-anim-info :inline) + (anim-knocked-front-land int32 :overlay-at (-> knocked-land anim-index 0)) + (anim-knocked-back-land int32 :overlay-at (-> knocked-land anim-index 1)) + (yellow-hit-anim guard-level-anim-info 2 :inline) + (yellow-land-anim guard-level-anim-info 2 :inline) + (blue-hit-anim guard-level-anim-info 1 :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype guard-level-shoot-info (structure) - ((anim-index int32 :offset-assert 0) - (start float :offset-assert 4) - (end float :offset-assert 8) + ((anim-index int32) + (start float) + (end float) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -965,80 +956,78 @@ (set! (-> *crimson-guard-level-tazer-info* fact-defaults) *crimson-guard-fact*) (deftype crimson-guard-level (nav-enemy) - ((info guard-level-global-info :offset-assert 604) - (hit-face uint32 :offset-assert 608) - (anim-get-up-front int32 :offset-assert 612) - (anim-get-up-back int32 :offset-assert 616) - (small-hit int32 :offset-assert 620) - (yellow-anim guard-level-anim-info :inline :offset-assert 624) - (flags int64 :offset-assert 632) - (weapon int32 :offset-assert 640) - (pad-kjh1n23 int32 :offset-assert 644) - (last-time-see-target int64 :offset-assert 648) - (joint joint-mod :offset-assert 656) - (joint-enable symbol :offset-assert 660) - (l-control lightning-control :offset-assert 664) - (already-shot uint32 :offset-assert 668) - (miss-amount float :offset-assert 672) - (pad-k1jh2n3 int32 :offset-assert 676) - (next-shot int64 :offset-assert 680) - (anim-shoot guard-level-shoot-info 3 :inline :offset-assert 688) - (target-pos vector :inline :offset-assert 736) - (target-pos-predict vector :inline :offset-assert 752) - (target-pos-predict-miss vector :inline :offset-assert 768) - (target-vel-vec vector :inline :offset-assert 784) - (target-vel float :offset-assert 800) - (target-self vector :inline :offset-assert 816) - (target-self-xz vector :inline :offset-assert 832) - (target-self-dist float :offset-assert 848) - (target-self-xz-dist float :offset-assert 852) - (target-y-angle float :offset-assert 856) - (lazer-sound sound-id :offset-assert 860) - (transport handle :offset-assert 864) - (transport-side uint32 :offset-assert 872) - (other-side uint32 :offset-assert 876) - (start-target-pos vector :inline :offset-assert 880) - (start-target-vel vector :inline :offset-assert 896) - (trigger symbol :offset-assert 912) - (reachable-target-pos vector :inline :offset-assert 928) + ((info guard-level-global-info) + (hit-face uint32) + (anim-get-up-front int32) + (anim-get-up-back int32) + (small-hit int32) + (yellow-anim guard-level-anim-info :inline) + (flags int64) + (weapon int32) + (pad-kjh1n23 int32) + (last-time-see-target int64) + (joint joint-mod) + (joint-enable symbol) + (l-control lightning-control) + (already-shot uint32) + (miss-amount float) + (pad-k1jh2n3 int32) + (next-shot int64) + (anim-shoot guard-level-shoot-info 3 :inline) + (target-pos vector :inline) + (target-pos-predict vector :inline) + (target-pos-predict-miss vector :inline) + (target-vel-vec vector :inline) + (target-vel float) + (target-self vector :inline) + (target-self-xz vector :inline) + (target-self-dist float) + (target-self-xz-dist float) + (target-y-angle float) + (lazer-sound sound-id) + (transport handle) + (transport-side uint32) + (other-side uint32) + (start-target-pos vector :inline) + (start-target-vel vector :inline) + (trigger symbol) + (reachable-target-pos vector :inline) ) - :heap-base #x330 - :method-count-assert 205 - :size-assert #x3b0 - :flag-assert #xcd033003b0 + (:state-methods + gun-shoot + attack + get-up-front + get-up-back + close-attack + grenade-attack + exit-transport + blast-hostile + grenade-hostile + tazer-hostile + roll-right + roll-left + arrest + ) (:methods - (gun-shoot () _type_ :state 178) - (attack () _type_ :state 179) - (get-up-front () _type_ :state 180) - (get-up-back () _type_ :state 181) - (close-attack () _type_ :state 182) - (grenade-attack () _type_ :state 183) - (exit-transport () _type_ :state 184) - (blast-hostile () _type_ :state 185) - (grenade-hostile () _type_ :state 186) - (tazer-hostile () _type_ :state 187) - (roll-right () _type_ :state 188) - (roll-left () _type_ :state 189) - (arrest () _type_ :state 190) - (crimson-guard-level-method-191 (_type_) (pointer process) 191) - (crimson-guard-level-method-192 (_type_) none 192) - (crimson-guard-level-method-193 (_type_) symbol 193) - (crimson-guard-level-method-194 (_type_) symbol 194) - (crimson-guard-level-method-195 (_type_ vector vector vector) int 195) - (crimson-guard-level-method-196 (_type_ vector) none 196) - (crimson-guard-level-method-197 (_type_) quaternion 197) - (crimson-guard-level-method-198 (_type_) none 198) - (crimson-guard-level-method-199 (_type_ vector vector vector float) symbol 199) - (crimson-guard-level-method-200 (_type_) float 200) - (crimson-guard-level-method-201 (_type_ float) none 201) - (crimson-guard-level-method-202 (_type_ vector) float 202) - (crimson-guard-level-method-203 (_type_ int) none 203) - (crimson-guard-level-method-204 (_type_) none 204) + (crimson-guard-level-method-191 (_type_) (pointer process)) + (crimson-guard-level-method-192 (_type_) none) + (crimson-guard-level-method-193 (_type_) symbol) + (crimson-guard-level-method-194 (_type_) symbol) + (crimson-guard-level-method-195 (_type_ vector vector vector) int) + (crimson-guard-level-method-196 (_type_ vector) none) + (crimson-guard-level-method-197 (_type_) quaternion) + (crimson-guard-level-method-198 (_type_) none) + (crimson-guard-level-method-199 (_type_ vector vector vector float) symbol) + (crimson-guard-level-method-200 (_type_) float) + (crimson-guard-level-method-201 (_type_ float) none) + (crimson-guard-level-method-202 (_type_ vector) float) + (crimson-guard-level-method-203 (_type_ int) none) + (crimson-guard-level-method-204 (_type_) none) ) ) -(defmethod react-to-focus crimson-guard-level ((this crimson-guard-level)) +(defmethod react-to-focus ((this crimson-guard-level)) "@TODO - flesh out docs" (let ((s5-0 (-> this focus aware))) (cond @@ -1114,7 +1103,7 @@ ) ) -(defmethod general-event-handler crimson-guard-level ((this crimson-guard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this crimson-guard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -1168,7 +1157,7 @@ ) ) -(defmethod crimson-guard-level-method-191 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-191 ((this crimson-guard-level)) (let* ((s4-0 (-> this target-pos-predict-miss)) (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) @@ -1195,7 +1184,7 @@ ) ) -(defmethod crimson-guard-level-method-195 crimson-guard-level ((this crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod crimson-guard-level-method-195 ((this crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1306,7 +1295,7 @@ ) ) -(defmethod crimson-guard-level-method-193 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-193 ((this crimson-guard-level)) (let ((s5-0 (get-trans this 3)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -1318,7 +1307,7 @@ ) ) -(defmethod crimson-guard-level-method-194 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-194 ((this crimson-guard-level)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> this target-pos-predict-miss quad)) (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) @@ -1333,7 +1322,7 @@ ) ) -(defmethod crimson-guard-level-method-196 crimson-guard-level ((this crimson-guard-level) (arg0 vector)) +(defmethod crimson-guard-level-method-196 ((this crimson-guard-level) (arg0 vector)) (local-vars (sv-240 vector) (sv-256 (function vector vector vector)) @@ -1463,12 +1452,12 @@ ) ) -(defmethod crimson-guard-level-method-197 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-197 ((this crimson-guard-level)) (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) *unity-quaternion* (seconds-per-frame)) ) ;; WARN: Return type mismatch object vs none. -(defmethod track-target! crimson-guard-level ((this crimson-guard-level)) +(defmethod track-target! ((this crimson-guard-level)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1490,7 +1479,7 @@ (none) ) -(defmethod crimson-guard-level-method-200 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-200 ((this crimson-guard-level)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -2182,7 +2171,7 @@ ) ) -(defmethod crimson-guard-level-method-199 crimson-guard-level ((this crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod crimson-guard-level-method-199 ((this crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (sv-672 vector) (sv-688 vector) (sv-704 vector) (sv-720 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2344,7 +2333,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-level-method-198 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-198 ((this crimson-guard-level)) (local-vars (sv-784 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2624,7 +2613,7 @@ ) ) -(defmethod crimson-guard-level-method-192 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-192 ((this crimson-guard-level)) (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14)))) (new 'stack-no-clear 'vector) (let ((s5-0 (new 'stack-no-clear 'traj3d-params))) @@ -3088,7 +3077,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-level-method-204 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-204 ((this crimson-guard-level)) (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (-> this root)) (s3-0 (lambda ((arg0 crimson-guard-level) (arg1 collide-shape-moving) (arg2 vector)) @@ -3360,7 +3349,7 @@ ) ) -(defmethod enemy-method-77 crimson-guard-level ((this crimson-guard-level) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this crimson-guard-level) (arg0 (pointer float))) (let ((v1-1 (-> this root transv))) (cond ((< (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 57344.0) @@ -3457,7 +3446,7 @@ #t ) -(defmethod go-hostile crimson-guard-level ((this crimson-guard-level)) +(defmethod go-hostile ((this crimson-guard-level)) (let ((v1-0 (-> this hit-face))) (cond ((zero? v1-0) @@ -3482,7 +3471,7 @@ ) ) -(defmethod enemy-method-78 crimson-guard-level ((this crimson-guard-level) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this crimson-guard-level) (arg0 (pointer float))) (cond ((<= (-> this hit-points) 0) (let ((a1-1 (-> this draw art-group data (-> this info knocked-land anim-index (-> this hit-face)))) @@ -3683,7 +3672,7 @@ ) ) -(defmethod crimson-guard-level-method-201 crimson-guard-level ((this crimson-guard-level) (arg0 float)) +(defmethod crimson-guard-level-method-201 ((this crimson-guard-level) (arg0 float)) (let* ((s3-0 (handle->process (-> this transport))) (s4-0 (if (type? s3-0 process-focusable) (the-as process-focusable s3-0) @@ -3717,7 +3706,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod crimson-guard-level-method-202 crimson-guard-level ((this crimson-guard-level) (arg0 vector)) +(defmethod crimson-guard-level-method-202 ((this crimson-guard-level) (arg0 vector)) (local-vars (f0-8 float) (sv-768 vector) @@ -3837,7 +3826,7 @@ ) ) -(defmethod enemy-method-93 crimson-guard-level ((this crimson-guard-level)) +(defmethod enemy-method-93 ((this crimson-guard-level)) (let ((s5-0 (-> this nav state)) (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) @@ -3859,11 +3848,11 @@ (none) ) -(defmethod enemy-method-89 crimson-guard-level ((this crimson-guard-level) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this crimson-guard-level) (arg0 enemy-jump-info)) #f ) -(defmethod enemy-method-87 crimson-guard-level ((this crimson-guard-level) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this crimson-guard-level) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -3879,7 +3868,7 @@ #t ) -(defmethod enemy-method-88 crimson-guard-level ((this crimson-guard-level) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this crimson-guard-level) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -3895,7 +3884,7 @@ #t ) -(defmethod enemy-method-90 crimson-guard-level ((this crimson-guard-level) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 ((this crimson-guard-level) (arg0 int) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond @@ -4049,7 +4038,7 @@ ) ) -(defmethod init-enemy-collision! crimson-guard-level ((this crimson-guard-level)) +(defmethod init-enemy-collision! ((this crimson-guard-level)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -4127,7 +4116,7 @@ (none) ) -(defmethod relocate crimson-guard-level ((this crimson-guard-level) (arg0 int)) +(defmethod relocate ((this crimson-guard-level) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -4138,7 +4127,7 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod crimson-guard-level-method-203 crimson-guard-level ((this crimson-guard-level) (arg0 int)) +(defmethod crimson-guard-level-method-203 ((this crimson-guard-level) (arg0 int)) "TODO - probably a flag" (cond ((= arg0 1) @@ -4161,7 +4150,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-enemy-method-156 crimson-guard-level ((this crimson-guard-level)) +(defmethod nav-enemy-method-156 ((this crimson-guard-level)) (cond ((logtest? (-> this flags) 36) (let ((v1-3 (-> this nav state)) @@ -4180,7 +4169,7 @@ (none) ) -(defmethod init-enemy! crimson-guard-level ((this crimson-guard-level)) +(defmethod init-enemy! ((this crimson-guard-level)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 int)) (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) @@ -4335,17 +4324,14 @@ ) (deftype crimson-guard-level-params (structure) - ((pos vector :inline :offset-assert 0) - (quat quaternion :inline :offset-assert 16) - (nav-mesh nav-mesh :offset-assert 32) - (handle uint64 :offset-assert 40) - (transport-side uint32 :offset-assert 48) - (weapon int32 :offset-assert 52) - (proc process :offset-assert 56) + ((pos vector :inline) + (quat quaternion :inline) + (nav-mesh nav-mesh) + (handle uint64) + (transport-side uint32) + (weapon int32) + (proc process) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) diff --git a/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc b/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc index 42dc358287c..70d917e82af 100644 --- a/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc +++ b/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc @@ -8,31 +8,22 @@ ;; DECOMP BEGINS (deftype gconv-speech (basic) - ((name0 basic :offset-assert 4) - (name1 basic :offset-assert 8) - (hold-time uint32 :offset-assert 12) + ((name0 basic) + (name1 basic) + (hold-time uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype gconv-dialogue (basic) - ((speeches (array gconv-speech) :offset-assert 4) + ((speeches (array gconv-speech)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype gconv-dialogues (basic) - ((dialogues (array gconv-dialogue) :offset-assert 4) + ((dialogues (array gconv-dialogue)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -180,28 +171,26 @@ ) (deftype guard-conversation (process-drawable) - ((triggered? symbol :offset-assert 200) - (actor-group actor-group :offset-assert 204) - (actor-count int8 :offset-assert 208) - (remaining int8 :offset-assert 209) - (skip-mask uint32 :offset-assert 212) - (last-playing-time time-frame :offset-assert 216) + ((triggered? symbol) + (actor-group actor-group) + (actor-count int8) + (remaining int8) + (skip-mask uint32) + (last-playing-time time-frame) ) - :heap-base #x60 - :method-count-assert 25 - :size-assert #xe0 - :flag-assert #x19006000e0 + (:state-methods + dormant + active + notice + die + ) (:methods - (dormant () _type_ :state 20) - (active () _type_ :state 21) - (notice () _type_ :state 22) - (die () _type_ :state 23) - (guard-conversation-method-24 (_type_) symbol 24) + (guard-conversation-method-24 (_type_) symbol) ) ) -(defmethod guard-conversation-method-24 guard-conversation ((this guard-conversation)) +(defmethod guard-conversation-method-24 ((this guard-conversation)) (let ((v1-0 (-> this remaining))) (when (> v1-0 0) (set! (-> this remaining) (+ v1-0 -1)) @@ -364,7 +353,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! guard-conversation ((this guard-conversation) (arg0 entity-actor)) +(defmethod init-from-entity! ((this guard-conversation) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/common/enemy/guards/transport-level.gc b/goal_src/jak2/levels/common/enemy/guards/transport-level.gc index 85ff01825ce..003e5334723 100644 --- a/goal_src/jak2/levels/common/enemy/guards/transport-level.gc +++ b/goal_src/jak2/levels/common/enemy/guards/transport-level.gc @@ -8,33 +8,31 @@ ;; DECOMP BEGINS (deftype transport-level (process-focusable) - ((y-dest float :offset-assert 204) - (last-guard-spawn-time time-frame :offset-assert 208) - (nav-mesh nav-mesh :offset-assert 216) - (spawn-side uint32 :offset-assert 220) - (spawn? symbol :offset-assert 224) - (leave-time time-frame :offset-assert 232) - (max-guard uint32 :offset-assert 240) - (count-guard uint32 :offset-assert 244) - (max-time float :offset-assert 248) - (spawn-time time-frame :offset-assert 256) - (ambient-sound-id sound-id :offset-assert 264) - (num-wanted-guards uint32 :offset-assert 268) - (guards handle 8 :offset-assert 272) + ((y-dest float) + (last-guard-spawn-time time-frame) + (nav-mesh nav-mesh) + (spawn-side uint32) + (spawn? symbol) + (leave-time time-frame) + (max-guard uint32) + (count-guard uint32) + (max-time float) + (spawn-time time-frame) + (ambient-sound-id sound-id) + (num-wanted-guards uint32) + (guards handle 8) ) - :heap-base #xd0 - :method-count-assert 35 - :size-assert #x150 - :flag-assert #x2300d00150 + (:state-methods + come-down + idle + leave + die-fast + ) (:methods - (come-down () _type_ :state 27) - (idle () _type_ :state 28) - (leave () _type_ :state 29) - (die-fast () _type_ :state 30) - (transport-level-method-31 (_type_) none 31) - (transport-level-method-32 (_type_) none 32) - (transport-level-method-33 (_type_) uint 33) - (transport-level-method-34 (_type_) none 34) + (transport-level-method-31 (_type_) none) + (transport-level-method-32 (_type_) none) + (transport-level-method-33 (_type_) uint) + (transport-level-method-34 (_type_) none) ) ) @@ -90,7 +88,7 @@ ) ) -(defmethod transport-level-method-34 transport-level ((this transport-level)) +(defmethod transport-level-method-34 ((this transport-level)) (let ((f30-0 (lerp-scale 0.0 2.0 (fabs (-> this root transv y)) 0.0 122880.0)) (f0-4 (lerp-scale 0.0 1.0 (- (-> this root trans y) (-> this y-dest)) 143360.0 20480.0)) (a0-3 (static-sound-spec "transport" :volume 0.0 :mask (pitch reg0))) @@ -231,7 +229,7 @@ ) ) -(defmethod transport-level-method-33 transport-level ((this transport-level)) +(defmethod transport-level-method-33 ((this transport-level)) (let ((v1-0 0)) (dotimes (a0-1 8) (if (handle->process (-> this guards a0-1)) @@ -274,7 +272,7 @@ ) ) -(defmethod transport-level-method-31 transport-level ((this transport-level)) +(defmethod transport-level-method-31 ((this transport-level)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -315,14 +313,14 @@ (none) ) -(defmethod transport-level-method-32 transport-level ((this transport-level)) +(defmethod transport-level-method-32 ((this transport-level)) (set! (-> this spawn-side) (the-as uint 0)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! transport-level ((this transport-level) (arg0 entity-actor)) +(defmethod init-from-entity! ((this transport-level) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/common/enemy/hopper.gc b/goal_src/jak2/levels/common/enemy/hopper.gc index 7ac20a23dc0..036a118d6eb 100644 --- a/goal_src/jak2/levels/common/enemy/hopper.gc +++ b/goal_src/jak2/levels/common/enemy/hopper.gc @@ -8,33 +8,29 @@ ;; DECOMP BEGINS (deftype hopper (nav-enemy) - ((speed-y float :offset-assert 604) - (accel-y float :offset-assert 608) - (next-jump-time int32 :offset-assert 612) - (path-intro path-control :offset-assert 616) - (can-go-knocked? symbol :offset-assert 620) - (land-anim-index int32 :offset-assert 624) - (step-num int32 :offset-assert 628) - (best-point vector :inline :offset-assert 640) - (best-score float :offset-assert 656) - (origin vector :inline :offset-assert 672) - (direction vector :inline :offset-assert 688) - (jump-dist float :offset-assert 704) - (side float :offset-assert 708) - (jump-start-anim uint32 :offset-assert 712) - (jump-air-anim uint32 :offset-assert 716) - (jump-land-anim uint32 :offset-assert 720) - (jump-height-min float :offset-assert 724) - (jump-anim-start-frame float :offset-assert 728) - (minimap connection-minimap :offset-assert 732) + ((speed-y float) + (accel-y float) + (next-jump-time int32) + (path-intro path-control) + (can-go-knocked? symbol) + (land-anim-index int32) + (step-num int32) + (best-point vector :inline) + (best-score float) + (origin vector :inline) + (direction vector :inline) + (jump-dist float) + (side float) + (jump-start-anim uint32) + (jump-air-anim uint32) + (jump-land-anim uint32) + (jump-height-min float) + (jump-anim-start-frame float) + (minimap connection-minimap) ) - :heap-base #x260 - :method-count-assert 180 - :size-assert #x2e0 - :flag-assert #xb4026002e0 (:methods - (hopper-method-178 (_type_) symbol 178) - (hopper-method-179 (_type_) none 179) + (hopper-method-178 (_type_) symbol) + (hopper-method-179 (_type_) none) ) ) @@ -46,25 +42,19 @@ ) (deftype hopper-anim-info (structure) - ((hit-anim-index int32 :offset-assert 0) - (land-anim-index int32 :offset-assert 4) + ((hit-anim-index int32) + (land-anim-index int32) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype hopper-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (yellow-hit-anim hopper-anim-info 3 :inline :offset-assert 8) - (blue-hit-anim hopper-anim-info 3 :inline :offset-assert 32) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (yellow-hit-anim hopper-anim-info 3 :inline) + (blue-hit-anim hopper-anim-info 3 :inline) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) @@ -82,7 +72,7 @@ ) ) -(defmethod enemy-method-77 hopper ((this hopper) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this hopper) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((a2-0 (ash 1 (-> *hopper-global-info* prev-blue-hit))) @@ -120,7 +110,7 @@ #t ) -(defmethod enemy-method-78 hopper ((this hopper) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this hopper) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -343,7 +333,7 @@ (set! (-> *hopper-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod kill-prefer-falling hopper ((this hopper)) +(defmethod kill-prefer-falling ((this hopper)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cond ((-> this can-go-knocked?) @@ -356,7 +346,7 @@ ) ) -(defmethod enemy-method-90 hopper ((this hopper) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 ((this hopper) (arg0 int) (arg1 enemy-jump-info)) (when (= (-> this jump-why) 2) (cond ((zero? arg0) @@ -436,7 +426,7 @@ ((method-of-type nav-enemy enemy-method-90) this arg0 arg1) ) -(defmethod enemy-method-89 hopper ((this hopper) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this hopper) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump-start-anim))) (a0-4 (-> this skel root-channel 0)) @@ -450,7 +440,7 @@ #t ) -(defmethod enemy-method-87 hopper ((this hopper) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this hopper) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump-air-anim))) (a0-4 (-> this skel root-channel 0)) @@ -464,7 +454,7 @@ #t ) -(defmethod enemy-method-88 hopper ((this hopper) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this hopper) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.075)) (let ((a1-2 (-> this draw art-group data (-> this jump-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -521,7 +511,7 @@ ) ) -(defmethod hopper-method-178 hopper ((this hopper)) +(defmethod hopper-method-178 ((this hopper)) (local-vars (sv-752 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -913,7 +903,7 @@ ) ) -(defmethod dispose! hopper ((this hopper)) +(defmethod dispose! ((this hopper)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (when (-> this minimap) (logior! (-> this minimap flags) (minimap-flag fade-out)) @@ -923,14 +913,14 @@ (none) ) -(defmethod relocate hopper ((this hopper) (arg0 int)) +(defmethod relocate ((this hopper) (arg0 int)) (if (nonzero? (-> this path-intro)) (&+! (-> this path-intro) arg0) ) (call-parent-method this arg0) ) -(defmethod init-enemy-collision! hopper ((this hopper)) +(defmethod init-enemy-collision! ((this hopper)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -994,7 +984,7 @@ (none) ) -(defmethod init-enemy! hopper ((this hopper)) +(defmethod init-enemy! ((this hopper)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (stack-size-set! (-> this main-thread) 256) (initialize-skeleton diff --git a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc index 971ebeaf15d..bc6b46af062 100644 --- a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc +++ b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc @@ -422,14 +422,10 @@ (deftype crimson-guard-hover-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) -(defmethod play-impact-sound crimson-guard-hover-shot ((this crimson-guard-hover-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this crimson-guard-hover-shot) (arg0 projectile-options)) (cond ((zero? arg0) ) @@ -442,40 +438,38 @@ ) (deftype crimson-guard-hover (hover-enemy) - ((gun-jmod joint-mod :offset-assert 784) - (hips-jmod joint-mod :offset-assert 788) - (entity-group actor-group :offset-assert 792) - (los los-control :inline :offset-assert 800) - (smoke-part sparticle-launch-control :offset-assert 948) - (engine-part sparticle-launch-control :offset-assert 952) - (last-fire-time time-frame :offset-assert 960) - (gun-x-angle float :offset-assert 968) - (gun-x-angle-final float :offset-assert 972) - (path-u float :offset-assert 976) - (path-du float :offset-assert 980) - (path-du-final float :offset-assert 984) - (path-dest float :offset-assert 988) - (sound-id sound-id :offset-assert 992) - (knocked-recover-anim int32 :offset-assert 996) - (attack-wait-min float :offset-assert 1000) - (attack-wait-max float :offset-assert 1004) - (attack-miss-dist-min float :offset-assert 1008) - (attack-miss-dist-max float :offset-assert 1012) - (attack-miss-dist-curr float :offset-assert 1016) - (shots-fired int32 :offset-assert 1020) + ((gun-jmod joint-mod) + (hips-jmod joint-mod) + (entity-group actor-group) + (los los-control :inline) + (smoke-part sparticle-launch-control) + (engine-part sparticle-launch-control) + (last-fire-time time-frame) + (gun-x-angle float) + (gun-x-angle-final float) + (path-u float) + (path-du float) + (path-du-final float) + (path-dest float) + (sound-id sound-id) + (knocked-recover-anim int32) + (attack-wait-min float) + (attack-wait-max float) + (attack-miss-dist-min float) + (attack-miss-dist-max float) + (attack-miss-dist-curr float) + (shots-fired int32) ) - :heap-base #x380 - :method-count-assert 163 - :size-assert #x400 - :flag-assert #xa303800400 + (:state-methods + ambush-fly + ambush-attack + kick-attack + attack + die-now + ) (:methods - (ambush-fly () _type_ :state 156) - (ambush-attack () _type_ :state 157) - (kick-attack () _type_ :state 158) - (attack () _type_ :state 159) - (die-now () _type_ :state 160) - (shoot (_type_ vector projectile-init-by-other-params int int float) none 161) - (crimson-guard-hover-method-162 (_type_ process-focusable) symbol 162) + (shoot (_type_ vector projectile-init-by-other-params int int float) none) + (crimson-guard-hover-method-162 (_type_ process-focusable) symbol) ) ) @@ -590,7 +584,7 @@ ) ;; WARN: Return type mismatch int vs sound-id. -(defmethod enemy-method-135 crimson-guard-hover ((this crimson-guard-hover) (arg0 int)) +(defmethod enemy-method-135 ((this crimson-guard-hover) (arg0 int)) (if (and (zero? arg0) (logtest? #x4000000 (-> this incoming penetrate-using))) (sound-play "hover-take-hit") (call-parent-method this arg0) @@ -1098,7 +1092,7 @@ ) ) -(defmethod general-event-handler crimson-guard-hover ((this crimson-guard-hover) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this crimson-guard-hover) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-15 enemy-flag)) @@ -1173,7 +1167,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod crimson-guard-hover-method-162 crimson-guard-hover ((this crimson-guard-hover) (arg0 process-focusable)) +(defmethod crimson-guard-hover-method-162 ((this crimson-guard-hover) (arg0 process-focusable)) (let* ((v1-1 (vector+! (new 'stack-no-clear 'vector) (-> this root trans) (-> this root transv))) (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this focus-pos))) (f30-0 (vector-length s5-1)) @@ -1208,7 +1202,7 @@ ) ) -(defmethod hover-enemy-method-145 crimson-guard-hover ((this crimson-guard-hover) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod hover-enemy-method-145 ((this crimson-guard-hover) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) @@ -1232,7 +1226,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 crimson-guard-hover ((this crimson-guard-hover) (arg0 vector)) +(defmethod enemy-method-52 ((this crimson-guard-hover) (arg0 vector)) (let ((s4-0 (-> this root))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-2)) @@ -1269,7 +1263,7 @@ (none) ) -(defmethod enemy-method-77 crimson-guard-hover ((this crimson-guard-hover) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this crimson-guard-hover) (arg0 (pointer float))) (ja-channel-push! 1 0) (case (-> this incoming knocked-type) (((knocked-type knocked-type-5)) @@ -1300,7 +1294,7 @@ #t ) -(defmethod enemy-method-78 crimson-guard-hover ((this crimson-guard-hover) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this crimson-guard-hover) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.4)) @@ -1321,7 +1315,7 @@ ) ) -(defmethod track-target! crimson-guard-hover ((this crimson-guard-hover)) +(defmethod track-target! ((this crimson-guard-hover)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1360,7 +1354,7 @@ (none) ) -(defmethod hover-enemy-method-142 crimson-guard-hover ((this crimson-guard-hover)) +(defmethod hover-enemy-method-142 ((this crimson-guard-hover)) (let ((s5-0 (-> this main-joint-acc)) (s4-0 (-> this main-joint-vel)) (gp-0 @@ -1467,7 +1461,7 @@ (none) ) -(defmethod hover-enemy-method-143 crimson-guard-hover ((this crimson-guard-hover) (arg0 int) (arg1 float)) +(defmethod hover-enemy-method-143 ((this crimson-guard-hover) (arg0 int) (arg1 float)) (let* ((s2-0 (-> this node-list data arg0)) (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) s2-0)) (s5-0 (new 'stack-no-clear 'matrix)) @@ -1505,13 +1499,13 @@ (none) ) -(defmethod shoot crimson-guard-hover ((this crimson-guard-hover) - (arg0 vector) - (arg1 projectile-init-by-other-params) - (arg2 int) - (arg3 int) - (arg4 float) - ) +(defmethod shoot ((this crimson-guard-hover) + (arg0 vector) + (arg1 projectile-init-by-other-params) + (arg2 int) + (arg3 int) + (arg4 float) + ) (vector<-cspace! (-> arg1 pos) (-> this node-list data arg2)) (let ((s2-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) @@ -1538,7 +1532,7 @@ (none) ) -(defmethod kill-prefer-falling crimson-guard-hover ((this crimson-guard-hover)) +(defmethod kill-prefer-falling ((this crimson-guard-hover)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cond ((and (-> this next-state) (= (-> this next-state name) 'knocked)) @@ -1554,7 +1548,7 @@ ) ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 crimson-guard-hover ((this crimson-guard-hover) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this crimson-guard-hover) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) (the-as symbol (if (t9-0 (the-as nav-enemy this) arg0 arg1) (set-dst-proc! (-> this los) (-> this focus handle)) @@ -1563,7 +1557,7 @@ ) ) -(defmethod hover-enemy-method-149 crimson-guard-hover ((this crimson-guard-hover)) +(defmethod hover-enemy-method-149 ((this crimson-guard-hover)) (initialize-skeleton this (the-as @@ -1576,7 +1570,7 @@ (none) ) -(defmethod init-enemy-collision! crimson-guard-hover ((this crimson-guard-hover)) +(defmethod init-enemy-collision! ((this crimson-guard-hover)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1674,11 +1668,11 @@ (none) ) -(defmethod hover-enemy-method-150 crimson-guard-hover ((this crimson-guard-hover)) +(defmethod hover-enemy-method-150 ((this crimson-guard-hover)) *crimson-guard-hover-enemy-info* ) -(defmethod hover-enemy-method-151 crimson-guard-hover ((this crimson-guard-hover)) +(defmethod hover-enemy-method-151 ((this crimson-guard-hover)) (new 'static 'hover-enemy-info :fly-forward-anim 7 :fly-backward-anim 8 @@ -1694,12 +1688,12 @@ ) ) -(defmethod hover-enemy-method-152 crimson-guard-hover ((this crimson-guard-hover)) +(defmethod hover-enemy-method-152 ((this crimson-guard-hover)) (new 'static 'hover-nav-params :max-speed 102400.0 :max-acceleration 143360.0 :friction 0.05) ) ;; WARN: Return type mismatch hover-enemy vs crimson-guard-hover. -(defmethod relocate crimson-guard-hover ((this crimson-guard-hover) (arg0 int)) +(defmethod relocate ((this crimson-guard-hover) (arg0 int)) (if (nonzero? (-> this gun-jmod)) (&+! (-> this gun-jmod) arg0) ) @@ -1715,7 +1709,7 @@ (the-as crimson-guard-hover ((method-of-type hover-enemy relocate) this arg0)) ) -(defmethod deactivate crimson-guard-hover ((this crimson-guard-hover)) +(defmethod deactivate ((this crimson-guard-hover)) (if (nonzero? (-> this smoke-part)) (kill-and-free-particles (-> this smoke-part)) ) @@ -1727,7 +1721,7 @@ (none) ) -(defmethod init-enemy! crimson-guard-hover ((this crimson-guard-hover)) +(defmethod init-enemy! ((this crimson-guard-hover)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) (hover-enemy-method-149 this) diff --git a/goal_src/jak2/levels/common/enemy/hover/flamer.gc b/goal_src/jak2/levels/common/enemy/hover/flamer.gc index 1f8ca433774..3180f2a4ec6 100644 --- a/goal_src/jak2/levels/common/enemy/hover/flamer.gc +++ b/goal_src/jak2/levels/common/enemy/hover/flamer.gc @@ -9,59 +9,53 @@ (deftype flying-formation (hover-formation) () - :heap-base #x10 - :method-count-assert 16 - :size-assert #x90 - :flag-assert #x1000100090 ) (deftype flamer (nav-enemy) - ((shot-trajectory trajectory :inline :offset-assert 608) - (last-fire-time time-frame :offset-assert 648) - (sync-off uint32 :offset-assert 656) - (base-pos vector :inline :offset-assert 672) - (idle-pos vector :inline :offset-assert 688) - (offset vector :inline :offset-assert 704) - (dest-pos vector :inline :offset-assert 720) - (zone-to-world matrix :inline :offset-assert 736) - (world-to-zone matrix :inline :offset-assert 800) - (formation-entity entity-actor :offset-assert 864) - (flit-joint joint-mod :offset-assert 868) - (flit-angle float :offset-assert 872) - (flit-timer time-frame :offset-assert 880) - (path-pos float :offset-assert 888) - (sound-volume float :offset-assert 892) - (scale float :offset-assert 896) - (hit-surface? symbol :offset-assert 900) - (ground-mode int8 :offset-assert 904) - (init-quat quaternion :inline :offset-assert 912) - (surface-normal vector :inline :offset-assert 928) - (main-joint-pos vector :inline :offset-assert 944) - (main-joint-vel vector :inline :offset-assert 960) - (main-joint-acc vector :inline :offset-assert 976) - (main-acceleration float :offset-assert 992) - (fly-dir vector :inline :offset-assert 1008) + ((shot-trajectory trajectory :inline) + (last-fire-time time-frame) + (sync-off uint32) + (base-pos vector :inline) + (idle-pos vector :inline) + (offset vector :inline) + (dest-pos vector :inline) + (zone-to-world matrix :inline) + (world-to-zone matrix :inline) + (formation-entity entity-actor) + (flit-joint joint-mod) + (flit-angle float) + (flit-timer time-frame) + (path-pos float) + (sound-volume float) + (scale float) + (hit-surface? symbol) + (ground-mode int8) + (init-quat quaternion :inline) + (surface-normal vector :inline) + (main-joint-pos vector :inline) + (main-joint-vel vector :inline) + (main-joint-acc vector :inline) + (main-acceleration float) + (fly-dir vector :inline) ) - :heap-base #x380 - :method-count-assert 192 - :size-assert #x400 - :flag-assert #xc003800400 + (:state-methods + attack + wait-for-formation + exit-ambush + exit-ambush-path + ) (:methods - (attack () _type_ :state 178) - (wait-for-formation () _type_ :state 179) - (exit-ambush () _type_ :state 180) - (exit-ambush-path () _type_ :state 181) - (flamer-method-182 (_type_ vector process-focusable) none 182) - (flamer-method-183 (_type_) symbol 183) - (flamer-method-184 (_type_) none 184) - (flamer-method-185 (_type_) none 185) - (flamer-method-186 (_type_ float) vector 186) - (flamer-method-187 (_type_) none 187) - (flamer-method-188 (_type_ int float int int) none 188) - (flamer-method-189 (_type_) none 189) - (flamer-method-190 (_type_) none 190) - (flamer-method-191 (_type_) none 191) + (flamer-method-182 (_type_ vector process-focusable) none) + (flamer-method-183 (_type_) symbol) + (flamer-method-184 (_type_) none) + (flamer-method-185 (_type_) none) + (flamer-method-186 (_type_ float) vector) + (flamer-method-187 (_type_) none) + (flamer-method-188 (_type_ int float int int) none) + (flamer-method-189 (_type_) none) + (flamer-method-190 (_type_) none) + (flamer-method-191 (_type_) none) ) ) @@ -216,7 +210,7 @@ (set! (-> *flamer-nav-enemy-info* fact-defaults) *flamer-fact-defaults*) -(defmethod general-event-handler flamer ((this flamer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this flamer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -248,7 +242,7 @@ ) ) -(defmethod flamer-method-189 flamer ((this flamer)) +(defmethod flamer-method-189 ((this flamer)) (with-pp (let ((v1-0 (-> this formation-entity))) (when (if v1-0 @@ -276,7 +270,7 @@ ) ) -(defmethod flamer-method-190 flamer ((this flamer)) +(defmethod flamer-method-190 ((this flamer)) (with-pp (let ((v1-0 (-> this formation-entity))) (when (if v1-0 @@ -304,7 +298,7 @@ ) ) -(defmethod nav-enemy-method-142 flamer ((this flamer) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this flamer) (arg0 nav-control)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 (target-pos 0) (-> this root trans)) (seek-toward-heading-vec! (-> this root) gp-0 131072.0 (seconds 0.5)) @@ -314,7 +308,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod flamer-method-182 flamer ((this flamer) (arg0 vector) (arg1 process-focusable)) +(defmethod flamer-method-182 ((this flamer) (arg0 vector) (arg1 process-focusable)) (with-pp (set! arg0 (cond ((and *target* (-> this next-state) (let ((v1-4 (-> this next-state name))) @@ -439,7 +433,7 @@ ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 22. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. ;; WARN: disable def twice: 45. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod flamer-method-183 flamer ((this flamer)) +(defmethod flamer-method-183 ((this flamer)) (with-pp (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) @@ -481,7 +475,7 @@ ) ) -(defmethod flamer-method-188 flamer ((this flamer) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod flamer-method-188 ((this flamer) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) @@ -501,7 +495,7 @@ (none) ) -(defmethod flamer-method-187 flamer ((this flamer)) +(defmethod flamer-method-187 ((this flamer)) (local-vars (at-0 int) (at-1 int)) (with-pp (rlet ((vf0 :class vf) @@ -554,7 +548,7 @@ ) ) -(defmethod track-target! flamer ((this flamer)) +(defmethod track-target! ((this flamer)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -566,7 +560,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod flamer-method-191 flamer ((this flamer)) +(defmethod flamer-method-191 ((this flamer)) (cond ((and (-> this draw shadow) (zero? (-> this draw cur-lod)) @@ -675,7 +669,7 @@ #f ) -(defmethod flamer-method-184 flamer ((this flamer)) +(defmethod flamer-method-184 ((this flamer)) (let ((v1-0 (-> this ground-mode))) (cond ((= v1-0 1) @@ -727,7 +721,7 @@ (none) ) -(defmethod go-stare flamer ((this flamer)) +(defmethod go-stare ((this flamer)) (go-hostile this) ) @@ -1125,7 +1119,7 @@ :post flamer-attack-post ) -(defmethod enemy-method-46 flamer ((this flamer) (arg0 int)) +(defmethod enemy-method-46 ((this flamer) (arg0 int)) "@abstract" (let ((v1-0 arg0)) (cond @@ -1161,7 +1155,7 @@ ;; WARN: Return type mismatch object vs symbol. ;; WARN: Using new Jak 2 rtype-of -(defmethod enemy-method-77 flamer ((this flamer) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this flamer) (arg0 (pointer float))) (let ((v1-0 (-> this incoming knocked-type))) (the-as symbol @@ -1290,7 +1284,7 @@ ) ) -(defmethod dispose! flamer ((this flamer)) +(defmethod dispose! ((this flamer)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (let ((s5-1 (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags)))) (let ((t9-0 (method-of-type nav-enemy dispose!))) @@ -1303,7 +1297,7 @@ (none) ) -(defmethod flamer-method-186 flamer ((this flamer) (arg0 float)) +(defmethod flamer-method-186 ((this flamer) (arg0 float)) (let ((f0-1 (* (-> this scale) arg0)) (v0-0 (-> this root scale)) ) @@ -1315,12 +1309,12 @@ ) ) -(defmethod coin-flip? flamer ((this flamer)) +(defmethod coin-flip? ((this flamer)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod init-enemy-collision! flamer ((this flamer)) +(defmethod init-enemy-collision! ((this flamer)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1395,14 +1389,14 @@ (none) ) -(defmethod relocate flamer ((this flamer) (arg0 int)) +(defmethod relocate ((this flamer) (arg0 int)) (if (nonzero? (-> this flit-joint)) (&+! (-> this flit-joint) arg0) ) (call-parent-method this arg0) ) -(defmethod init-enemy! flamer ((this flamer)) +(defmethod init-enemy! ((this flamer)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1478,7 +1472,7 @@ (none) ) -(defmethod go-idle flamer ((this flamer)) +(defmethod go-idle ((this flamer)) (if (-> this formation-entity) (go (method-of-object this wait-for-formation)) (go (method-of-object this idle)) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc b/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc index 158e8121edb..ebcff71007c 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc @@ -11,38 +11,33 @@ ;; DECOMP BEGINS (deftype hover-enemy-battle-command (structure) - ((command symbol :offset-assert 0) - (wave uint16 :offset-assert 4) - (time time-frame :offset-assert 8) - (alive-count int32 :offset-assert 16) + ((command symbol) + (wave uint16) + (time time-frame) + (alive-count int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype hover-enemy-manager (process) - ((command-table (array hover-enemy-battle-command) :offset-assert 128) - (path path-control :offset-assert 132) - (formation hover-formation-control :offset-assert 136) - (actor-group (pointer actor-group) :offset-assert 140) - (actor-group-count int32 :offset-assert 144) - (total-to-spawn int32 :offset-assert 148) - (num-spawned int32 :offset-assert 152) - (alive-count int32 :offset-assert 156) - (formation-timer time-frame :offset-assert 160) + ((command-table (array hover-enemy-battle-command)) + (path path-control) + (formation hover-formation-control) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (total-to-spawn int32) + (num-spawned int32) + (alive-count int32) + (formation-timer time-frame) ) - :heap-base #x30 - :method-count-assert 19 - :size-assert #xa8 - :flag-assert #x13003000a8 + (:state-methods + idle + spawning + die + ) (:methods - (idle () _type_ :state 14) - (spawning () _type_ :state 15) - (die () _type_ :state 16) - (hover-enemy-manager-init! (_type_ (array hover-enemy-battle-command)) none 17) - (spawn-enemy (_type_ uint) none 18) + (hover-enemy-manager-init! (_type_ (array hover-enemy-battle-command)) none) + (spawn-enemy (_type_ uint) none) ) ) @@ -216,7 +211,7 @@ ) ) -(defmethod spawn-enemy hover-enemy-manager ((this hover-enemy-manager) (arg0 uint)) +(defmethod spawn-enemy ((this hover-enemy-manager) (arg0 uint)) (when (< arg0 (the-as uint (-> this actor-group-count))) (dotimes (s4-0 (-> this actor-group arg0 length)) (let* ((s1-0 (-> this actor-group arg0 data s4-0 actor)) @@ -247,7 +242,7 @@ (none) ) -(defmethod relocate hover-enemy-manager ((this hover-enemy-manager) (arg0 int)) +(defmethod relocate ((this hover-enemy-manager) (arg0 int)) (when (-> this formation) (if (nonzero? (-> this formation)) (&+! (-> this formation) arg0) @@ -259,7 +254,7 @@ (call-parent-method this arg0) ) -(defmethod hover-enemy-manager-init! hover-enemy-manager ((this hover-enemy-manager) (arg0 (array hover-enemy-battle-command))) +(defmethod hover-enemy-manager-init! ((this hover-enemy-manager) (arg0 (array hover-enemy-battle-command))) "Initialize this [[hover-enemy-manager]]." (local-vars (sv-16 res-tag)) (set! (-> this command-table) arg0) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-enemy-h.gc b/goal_src/jak2/levels/common/enemy/hover/hover-enemy-h.gc index ea555b95a63..5c63543714f 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-enemy-h.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-enemy-h.gc @@ -8,75 +8,70 @@ ;; DECOMP BEGINS (deftype hover-enemy-info (structure) - ((fly-forward-anim int32 :offset-assert 0) - (fly-backward-anim int32 :offset-assert 4) - (fly-left-anim int32 :offset-assert 8) - (fly-right-anim int32 :offset-assert 12) - (shoot-anim int32 :offset-assert 16) - (main-joint int32 :offset-assert 20) - (gun-base int32 :offset-assert 24) - (engine-left int32 :offset-assert 28) - (engine-right int32 :offset-assert 32) - (thrust-rotate-left float :offset-assert 36) - (thrust-rotate-right float :offset-assert 40) + ((fly-forward-anim int32) + (fly-backward-anim int32) + (fly-left-anim int32) + (fly-right-anim int32) + (shoot-anim int32) + (main-joint int32) + (gun-base int32) + (engine-left int32) + (engine-right int32) + (thrust-rotate-left float) + (thrust-rotate-right float) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) (deftype hover-enemy (enemy) - ((hover hover-nav-control :offset-assert 532) - (hover-info hover-enemy-info :offset-assert 536) - (formation-entity entity :offset-assert 540) - (fly-anim-speed float :offset-assert 544) - (restart-fly-anims symbol :offset-assert 548) - (main-joint-acc vector :inline :offset-assert 560) - (main-joint-vel vector :inline :offset-assert 576) - (main-joint-pos vector :inline :offset-assert 592) - (thrust float 2 :offset-assert 608) - (rotation-vec vector :inline :offset-assert 624) - (dest-pos vector :inline :offset-assert 640) - (offset vector :inline :offset-assert 656) - (surface-normal vector :inline :offset-assert 672) - (local-dir vector :inline :offset-assert 688) - (scale float :offset-assert 704) - (scale-timer uint64 :offset-assert 712) - (hit-surface? symbol :offset-assert 720) - (knocked-start-level float :offset-assert 724) - (knocked-fall-dist float :offset-assert 728) - (flying-death-anim int32 :offset-assert 732) - (flying-death-transv vector :inline :offset-assert 736) - (flying-death-engine int32 :offset-assert 752) - (flying-death-thrust-rotate float :offset-assert 756) - (flying-death-spin float :offset-assert 760) - (flying-death-spin-dest float :offset-assert 764) - (flying-death-spin-axis vector :inline :offset-assert 768) + ((hover hover-nav-control) + (hover-info hover-enemy-info) + (formation-entity entity) + (fly-anim-speed float) + (restart-fly-anims symbol) + (main-joint-acc vector :inline) + (main-joint-vel vector :inline) + (main-joint-pos vector :inline) + (thrust float 2) + (rotation-vec vector :inline) + (dest-pos vector :inline) + (offset vector :inline) + (surface-normal vector :inline) + (local-dir vector :inline) + (scale float) + (scale-timer uint64) + (hit-surface? symbol) + (knocked-start-level float) + (knocked-fall-dist float) + (flying-death-anim int32) + (flying-death-transv vector :inline) + (flying-death-engine int32) + (flying-death-thrust-rotate float) + (flying-death-spin float) + (flying-death-spin-dest float) + (flying-death-spin-axis vector :inline) ) - :heap-base #x290 - :method-count-assert 156 - :size-assert #x310 - :flag-assert #x9c02900310 + (:state-methods + knocked-recover + flying-death + flying-death-explode + ) (:methods - (knocked-recover () _type_ :state 137) - (flying-death () _type_ :state 138) - (flying-death-explode () _type_ :state 139) - (hover-enemy-method-140 (_type_ symbol) none 140) - (hover-enemy-method-141 (_type_ float) none 141) - (hover-enemy-method-142 (_type_) none 142) - (hover-enemy-method-143 (_type_ int float) none 143) - (hover-enemy-method-144 (_type_) none 144) - (hover-enemy-method-145 (_type_ int float int int) none 145) - (hover-enemy-method-146 (_type_) none 146) - (hover-enemy-method-147 (_type_) none 147) - (hover-enemy-method-148 (_type_) none 148) - (hover-enemy-method-149 (_type_) none 149) - (hover-enemy-method-150 (_type_) enemy-info 150) - (hover-enemy-method-151 (_type_) hover-enemy-info 151) - (hover-enemy-method-152 (_type_) hover-nav-params 152) - (hover-enemy-method-153 (_type_) none 153) - (hover-enemy-method-154 (_type_) none 154) - (hover-enemy-method-155 (_type_) none 155) + (hover-enemy-method-140 (_type_ symbol) none) + (hover-enemy-method-141 (_type_ float) none) + (hover-enemy-method-142 (_type_) none) + (hover-enemy-method-143 (_type_ int float) none) + (hover-enemy-method-144 (_type_) none) + (hover-enemy-method-145 (_type_ int float int int) none) + (hover-enemy-method-146 (_type_) none) + (hover-enemy-method-147 (_type_) none) + (hover-enemy-method-148 (_type_) none) + (hover-enemy-method-149 (_type_) none) + (hover-enemy-method-150 (_type_) enemy-info) + (hover-enemy-method-151 (_type_) hover-enemy-info) + (hover-enemy-method-152 (_type_) hover-nav-params) + (hover-enemy-method-153 (_type_) none) + (hover-enemy-method-154 (_type_) none) + (hover-enemy-method-155 (_type_) none) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc b/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc index 42fd06991d7..15b53b13461 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod general-event-handler hover-enemy ((this hover-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this hover-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-41 float)) @@ -203,12 +203,12 @@ (none) ) -(defmethod hover-enemy-method-142 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-142 ((this hover-enemy)) 0 (none) ) -(defmethod hover-enemy-method-153 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-153 ((this hover-enemy)) (let* ((v1-0 (-> this formation-entity)) (a0-1 (if v1-0 (-> v1-0 extra process) @@ -223,7 +223,7 @@ (none) ) -(defmethod hover-enemy-method-154 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-154 ((this hover-enemy)) (let* ((v1-0 (-> this formation-entity)) (a0-1 (if v1-0 (-> v1-0 extra process) @@ -238,12 +238,12 @@ (none) ) -(defmethod coin-flip? hover-enemy ((this hover-enemy)) +(defmethod coin-flip? ((this hover-enemy)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod hover-enemy-method-144 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-144 ((this hover-enemy)) (set! (-> this main-joint-pos quad) (-> this root trans quad)) (set! (-> this main-joint-vel quad) (the-as uint128 0)) (set! (-> this main-joint-acc quad) (the-as uint128 0)) @@ -253,7 +253,7 @@ (none) ) -(defmethod hover-enemy-method-145 hover-enemy ((this hover-enemy) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod hover-enemy-method-145 ((this hover-enemy) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) @@ -274,7 +274,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod enemy-method-129 hover-enemy ((this hover-enemy)) +(defmethod enemy-method-129 ((this hover-enemy)) (local-vars (s5-0 vector)) (let ((t9-0 (method-of-type enemy enemy-method-129))) (t9-0 this) @@ -290,7 +290,7 @@ (none) ) -(defmethod track-target! hover-enemy ((this hover-enemy)) +(defmethod track-target! ((this hover-enemy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -304,7 +304,7 @@ (none) ) -(defmethod hover-enemy-method-148 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-148 ((this hover-enemy)) (cond ((and (-> this draw shadow) (logtest? (-> this draw status) (draw-control-status on-screen))) (new 'stack-no-clear 'vector) @@ -829,16 +829,16 @@ ) ) -(defmethod go-stare hover-enemy ((this hover-enemy)) +(defmethod go-stare ((this hover-enemy)) (go-hostile this) ) -(defmethod go-stare2 hover-enemy ((this hover-enemy)) +(defmethod go-stare2 ((this hover-enemy)) (go-hostile this) ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod hover-enemy-method-146 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-146 ((this hover-enemy)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (matrix-rotate-zxy! gp-0 (-> this rotation-vec)) (matrix->quaternion (-> this root quat) gp-0) @@ -847,7 +847,7 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod hover-enemy-method-147 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-147 ((this hover-enemy)) (let ((s5-0 (-> this root quat)) (gp-0 (-> this rotation-vec)) ) @@ -858,7 +858,7 @@ (none) ) -(defmethod hover-enemy-method-140 hover-enemy ((this hover-enemy) (arg0 symbol)) +(defmethod hover-enemy-method-140 ((this hover-enemy) (arg0 symbol)) (let ((v1-0 0) (a0-2 (-> this root root-prim)) ) @@ -874,14 +874,14 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod hover-enemy-method-141 hover-enemy ((this hover-enemy) (arg0 float)) +(defmethod hover-enemy-method-141 ((this hover-enemy) (arg0 float)) (let ((f0-1 (* (-> this scale) arg0))) (set-vector! (-> this root scale) (* 1.2 f0-1) (* 0.9 f0-1) f0-1 1.0) ) (none) ) -(defmethod dispose! hover-enemy ((this hover-enemy)) +(defmethod dispose! ((this hover-enemy)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) (process-entity-status! this (entity-perm-status subtask-complete) #t) @@ -892,21 +892,21 @@ (none) ) -(defmethod deactivate hover-enemy ((this hover-enemy)) +(defmethod deactivate ((this hover-enemy)) (hover-nav-control-method-9 (-> this hover)) ((method-of-type enemy deactivate) this) (none) ) ;; WARN: Return type mismatch enemy vs hover-enemy. -(defmethod relocate hover-enemy ((this hover-enemy) (arg0 int)) +(defmethod relocate ((this hover-enemy) (arg0 int)) (if (nonzero? (-> this hover)) (&+! (-> this hover) arg0) ) (the-as hover-enemy ((method-of-type enemy relocate) this arg0)) ) -(defmethod hover-enemy-method-155 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-155 ((this hover-enemy)) (set! (-> this hover-info) (hover-enemy-method-151 this)) (set! (-> this fly-anim-speed) (get-rand-float-range this 0.8 1.2)) (vector-reset! (-> this rotation-vec)) @@ -942,43 +942,41 @@ ) (deftype wasp (hover-enemy) - ((gun-jmod joint-mod :offset-assert 784) - (entity-group actor-group :offset-assert 788) - (smoke-part sparticle-launch-control :offset-assert 792) - (engine-part sparticle-launch-control :offset-assert 796) - (old-gravity float :offset 804) - (knocked-anim int32 :offset-assert 808) - (knocked-recover-anim int32 :offset-assert 812) - (last-fire-time time-frame :offset-assert 816) - (bridge-index int32 :offset-assert 824) - (gun-x-angle float :offset-assert 828) - (gun-x-angle-final float :offset-assert 832) - (path-u float :offset-assert 836) - (path-du float :offset-assert 840) - (path-du-final float :offset-assert 844) - (path-dest float :offset-assert 848) - (plat-pos vector :inline :offset-assert 864) - (sound-id sound-id :offset-assert 880) - (attack-wait-min float :offset-assert 884) - (attack-wait-max float :offset-assert 888) - (attack-miss-dist-min float :offset-assert 892) - (attack-miss-dist-max float :offset-assert 896) - (attack-miss-dist-curr float :offset-assert 900) + ((gun-jmod joint-mod) + (entity-group actor-group) + (smoke-part sparticle-launch-control) + (engine-part sparticle-launch-control) + (old-gravity float :offset 804) + (knocked-anim int32) + (knocked-recover-anim int32) + (last-fire-time time-frame) + (bridge-index int32) + (gun-x-angle float) + (gun-x-angle-final float) + (path-u float) + (path-du float) + (path-du-final float) + (path-dest float) + (plat-pos vector :inline) + (sound-id sound-id) + (attack-wait-min float) + (attack-wait-max float) + (attack-miss-dist-min float) + (attack-miss-dist-max float) + (attack-miss-dist-curr float) ) - :heap-base #x310 - :method-count-assert 166 - :size-assert #x388 - :flag-assert #xa603100388 + (:state-methods + shoot-bridge-wait + shoot-bridge-intro + shoot-bridge-hold + shoot-bridge-hostile + shoot-bridge-attack + shoot-bridge-outro + attack + die-now + die-explode + ) (:methods - (shoot-bridge-wait () _type_ :state 156) - (shoot-bridge-intro () _type_ :state 157) - (shoot-bridge-hold () _type_ :state 158) - (shoot-bridge-hostile () _type_ :state 159) - (shoot-bridge-attack () _type_ :state 160) - (shoot-bridge-outro () _type_ :state 161) - (attack () _type_ :state 162) - (die-now () _type_ :state 163) - (die-explode () _type_ :state 164) - (spawn-wasp-shot (_type_ projectile-init-by-other-params int float float) none 165) + (spawn-wasp-shot (_type_ projectile-init-by-other-params int float float) none) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-formation-h.gc b/goal_src/jak2/levels/common/enemy/hover/hover-formation-h.gc index d5d7a033989..27efc7f2616 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-formation-h.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-formation-h.gc @@ -18,79 +18,68 @@ ;; DECOMP BEGINS (deftype form-search-info (structure) - ((form uint32 :offset-assert 0) - (count int32 :offset-assert 4) - (pos-table (inline-array vector) :offset-assert 8) - (actor-position vector 16 :inline :offset-assert 16) - (actor-valid? symbol 16 :offset-assert 272) - (index-table uint32 16 :offset-assert 336) - (dest-pos-table vector 16 :inline :offset-assert 400) - (best-mapping uint32 16 :offset-assert 656) - (best-cost float :offset-assert 720) + ((form uint32) + (count int32) + (pos-table (inline-array vector)) + (actor-position vector 16 :inline) + (actor-valid? symbol 16) + (index-table uint32 16) + (dest-pos-table vector 16 :inline) + (best-mapping uint32 16) + (best-cost float) ) - :method-count-assert 9 - :size-assert #x2d4 - :flag-assert #x9000002d4 ) (deftype hover-actor (structure) - ((handle handle :offset-assert 0) - (offset vector :inline :offset-assert 16) + ((handle handle) + (offset vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype hover-formation-control (basic) - ((search-info form-search-info :inline :offset-assert 16) - (entity entity :offset-assert 740) - (anchor-proc handle :offset-assert 744) - (actor-table handle 16 :offset-assert 752) - (flags uint16 :offset-assert 880) - (formation-type formation-type :offset-assert 888) - (center vector :inline :offset-assert 896) - (zone-to-world matrix :inline :offset-assert 912) - (world-to-zone matrix :inline :offset-assert 976) - (offset vector :inline :offset-assert 1040) - (focus-quat quaternion :inline :offset-assert 1056) - (notice-dist meters :offset-assert 1072) - (rotation-inc float :offset-assert 1076) + ((search-info form-search-info :inline) + (entity entity) + (anchor-proc handle) + (actor-table handle 16) + (flags uint16) + (formation-type formation-type) + (center vector :inline) + (zone-to-world matrix :inline) + (world-to-zone matrix :inline) + (offset vector :inline) + (focus-quat quaternion :inline) + (notice-dist meters) + (rotation-inc float) ) - :method-count-assert 21 - :size-assert #x438 - :flag-assert #x1500000438 (:methods - (new (symbol type object entity float vector float handle) _type_ 0) - (set-anchor-proc (_type_ handle) int 9) - (hover-formation-control-method-10 (_type_ vector vector float) symbol 10) - (hover-formation-control-method-11 (_type_) int 11) - (is-formation-type-in-range (_type_) symbol 12) - (hover-formation-control-method-13 (_type_ vector) vector 13) - (hover-formation-control-method-14 (_type_) none 14) - (hover-formation-control-method-15 (_type_ vector vector) vector 15) - (hover-formation-control-method-16 (_type_) object 16) - (hover-formation-control-method-17 (_type_ process) int 17) - (hover-formation-control-method-18 (_type_ process) int 18) - (try-update-formation-type (_type_ formation-type) int 19) - (hover-formation-control-method-20 (_type_ object object) none 20) + (new (symbol type object entity float vector float handle) _type_) + (set-anchor-proc (_type_ handle) int) + (hover-formation-control-method-10 (_type_ vector vector float) symbol) + (hover-formation-control-method-11 (_type_) int) + (is-formation-type-in-range (_type_) symbol) + (hover-formation-control-method-13 (_type_ vector) vector) + (hover-formation-control-method-14 (_type_) none) + (hover-formation-control-method-15 (_type_ vector vector) vector) + (hover-formation-control-method-16 (_type_) object) + (hover-formation-control-method-17 (_type_ process) int) + (hover-formation-control-method-18 (_type_ process) int) + (try-update-formation-type (_type_ formation-type) int) + (hover-formation-control-method-20 (_type_ object object) none) ) ) (deftype hover-formation (process) - ((formation hover-formation-control :offset-assert 128) - (path path-control :offset-assert 132) - (formation-timer uint64 :offset-assert 136) + ((formation hover-formation-control) + (path path-control) + (formation-timer uint64) ) - :heap-base #x10 - :method-count-assert 16 - :size-assert #x90 - :flag-assert #x1000100090 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (hover-formation-method-15 (_type_ vector vector) int 15) + (hover-formation-method-15 (_type_ vector vector) int) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc b/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc index f85a2273cf6..e6780002cc6 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod is-formation-type-in-range hover-formation-control ((this hover-formation-control)) +(defmethod is-formation-type-in-range ((this hover-formation-control)) (case (-> this formation-type) (((formation-type unknown-2) (formation-type unknown-3) (formation-type unknown-0)) #f @@ -18,7 +18,7 @@ ) ) -(defmethod hover-formation-control-method-16 hover-formation-control ((this hover-formation-control)) +(defmethod hover-formation-control-method-16 ((this hover-formation-control)) (let ((gp-0 (hover-formation-control-method-13 this (new 'stack-no-clear 'vector))) (s4-0 (cond ((-> this anchor-proc) @@ -41,12 +41,12 @@ ) ) -(defmethod set-anchor-proc hover-formation-control ((this hover-formation-control) (arg0 handle)) +(defmethod set-anchor-proc ((this hover-formation-control) (arg0 handle)) (set! (-> this anchor-proc) arg0) 0 ) -(defmethod hover-formation-control-method-13 hover-formation-control ((this hover-formation-control) (arg0 vector)) +(defmethod hover-formation-control-method-13 ((this hover-formation-control) (arg0 vector)) (with-pp (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) @@ -97,7 +97,7 @@ ) ) -(defmethod hover-formation-control-method-14 hover-formation-control ((this hover-formation-control)) +(defmethod hover-formation-control-method-14 ((this hover-formation-control)) (with-pp (when (not (logtest? (-> this flags) 4)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -174,7 +174,7 @@ ) ) -(defmethod hover-formation-control-method-15 hover-formation-control ((this hover-formation-control) (arg0 vector) (arg1 vector)) +(defmethod hover-formation-control-method-15 ((this hover-formation-control) (arg0 vector) (arg1 vector)) (vector-matrix*! arg0 (hover-formation-control-method-13 this (new 'stack-no-clear 'vector)) @@ -193,13 +193,10 @@ ) (deftype gen-perms-context (structure) - ((num int32 :offset-assert 0) - (table uint32 :offset-assert 4) - (iterate-count int32 :offset-assert 8) + ((num int32) + (table uint32) + (iterate-count int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) @@ -287,7 +284,7 @@ ) ;; WARN: disable def twice: 148. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod hover-formation-control-method-10 hover-formation-control ((this hover-formation-control) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod hover-formation-control-method-10 ((this hover-formation-control) (arg0 vector) (arg1 vector) (arg2 float)) (vector-rotate-y! arg0 arg1 arg2) (cond ((logtest? (-> this flags) 2) @@ -367,7 +364,7 @@ ) ) -(defmethod hover-formation-control-method-11 hover-formation-control ((this hover-formation-control)) +(defmethod hover-formation-control-method-11 ((this hover-formation-control)) (let ((s5-0 (-> this search-info))) (set! (-> s5-0 form) (the-as uint this)) (let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 16))) @@ -485,7 +482,7 @@ 0 ) -(defmethod hover-formation-control-method-17 hover-formation-control ((this hover-formation-control) (arg0 process)) +(defmethod hover-formation-control-method-17 ((this hover-formation-control) (arg0 process)) (let ((v1-2 (process->handle arg0)) (a2-0 -1) (a1-4 -1) @@ -517,7 +514,7 @@ 0 ) -(defmethod hover-formation-control-method-18 hover-formation-control ((this hover-formation-control) (arg0 process)) +(defmethod hover-formation-control-method-18 ((this hover-formation-control) (arg0 process)) (let ((v1-2 (process->handle arg0))) (dotimes (a1-4 16) (when (= v1-2 (-> this actor-table a1-4)) @@ -532,7 +529,7 @@ 0 ) -(defmethod try-update-formation-type hover-formation-control ((this hover-formation-control) (arg0 formation-type)) +(defmethod try-update-formation-type ((this hover-formation-control) (arg0 formation-type)) (when (!= (-> this formation-type) arg0) (set! (-> this formation-type) arg0) (hover-formation-control-method-11 this) @@ -648,7 +645,7 @@ ) ) -(defmethod relocate hover-formation ((this hover-formation) (arg0 int)) +(defmethod relocate ((this hover-formation) (arg0 int)) (if (nonzero? (-> this formation)) (&+! (-> this formation) arg0) ) @@ -658,12 +655,12 @@ (call-parent-method this arg0) ) -(defmethod hover-formation-method-15 hover-formation ((this hover-formation) (arg0 vector) (arg1 vector)) +(defmethod hover-formation-method-15 ((this hover-formation) (arg0 vector) (arg1 vector)) 0 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hover-formation ((this hover-formation) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hover-formation) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc index 84bb4f5adc0..1a30770631a 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc @@ -33,249 +33,210 @@ ;; DECOMP BEGINS (deftype nav-network-adjacency (structure) - ((index int32 :offset-assert 0) - (dist float :offset-assert 4) + ((index int32) + (dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype nav-network-adjacency-array (inline-array-class) - ((data nav-network-adjacency :inline :dynamic :offset-assert 16) + ((data nav-network-adjacency :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> nav-network-adjacency-array heap-base) (the-as uint 16)) (deftype list-node (structure) - ((next list-node :offset-assert 0) - (prev list-node :offset-assert 4) + ((next list-node) + (prev list-node) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype nav-network-path-node (list-node) - ((row-index int32 :offset-assert 8) - (status net-path-node-status :offset-assert 12) - (parent nav-network-path-node :offset-assert 16) - (cost-to-start float :offset-assert 20) - (cost-to-end float :offset-assert 24) + ((row-index int32) + (status net-path-node-status) + (parent nav-network-path-node) + (cost-to-start float) + (cost-to-end float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype nav-network-info (structure) - ((index int32 :offset-assert 0) - (pos vector :inline :offset-assert 16) - (path-node nav-network-path-node :inline :offset-assert 32) - (count int32 :offset-assert 60) - (adjacency (inline-array nav-network-adjacency) :offset-assert 64) + ((index int32) + (pos vector :inline) + (path-node nav-network-path-node :inline) + (count int32) + (adjacency (inline-array nav-network-adjacency)) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) (deftype nav-network-info-array (inline-array-class) - ((data nav-network-info :inline :dynamic :offset-assert 16) + ((data nav-network-info :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> nav-network-info-array heap-base) (the-as uint 80)) (deftype hover-nav-sphere (list-node) - ((sphere sphere :inline :offset-assert 16) - (handle handle :offset-assert 32) - (timer time-frame :offset-assert 40) + ((sphere sphere :inline) + (handle handle) + (timer time-frame) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype hover-nav-path-segment (list-node) - ((curve-matrix matrix :inline :offset-assert 16) - (pos-index float 2 :offset-assert 80) - (dist float :offset-assert 88) - (du float :offset-assert 92) + ((curve-matrix matrix :inline) + (pos-index float 2) + (dist float) + (du float) ) - :method-count-assert 10 - :size-assert #x60 - :flag-assert #xa00000060 (:methods - (hover-nav-path-segment-method-9 (_type_ float) none 9) + (hover-nav-path-segment-method-9 (_type_ float) none) ) ) -(defmethod hover-nav-path-segment-method-9 hover-nav-path-segment ((this hover-nav-path-segment) (arg0 float)) +(defmethod hover-nav-path-segment-method-9 ((this hover-nav-path-segment) (arg0 float)) (set! (-> this du) (/ arg0 (-> this dist))) 0 (none) ) (deftype hover-nav-path-info (structure) - ((segment-list hover-nav-path-segment :offset-assert 0) - (tail-segment hover-nav-path-segment :offset-assert 4) - (curr-segment hover-nav-path-segment :offset-assert 8) - (curr-u float :offset-assert 12) + ((segment-list hover-nav-path-segment) + (tail-segment hover-nav-path-segment) + (curr-segment hover-nav-path-segment) + (curr-u float) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (hover-nav-path-info-method-9 (_type_) none 9) + (hover-nav-path-info-method-9 (_type_) none) ) ) (deftype path-index-array (inline-array-class) - ((data hover-nav-path-info :inline :dynamic :offset-assert 16) + ((data hover-nav-path-info :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> path-index-array heap-base) (the-as uint 4)) (deftype nav-network (basic) - ((network (array nav-network-info) :offset-assert 4) - (dummy nav-network-info :inline :offset-assert 16) - (control-handle handle :offset-assert 88) - (list-table list-node 5 :offset-assert 96) - (open-list nav-network-path-node :offset 96) - (closed-list nav-network-path-node :offset 100) - (sphere-list hover-nav-sphere :offset 108) - (free-segment-list hover-nav-path-segment :offset 104) - (free-sphere-list hover-nav-sphere :offset 112) - (segment-pool (pointer hover-nav-path-segment) :offset-assert 116) - (sphere-pool (pointer hover-nav-sphere) :offset-assert 120) + ((network (array nav-network-info)) + (dummy nav-network-info :inline) + (control-handle handle) + (list-table list-node 5) + (open-list nav-network-path-node :overlay-at (-> list-table 0)) + (closed-list nav-network-path-node :overlay-at (-> list-table 1)) + (sphere-list hover-nav-sphere :overlay-at (-> list-table 3)) + (free-segment-list hover-nav-path-segment :overlay-at (-> list-table 2)) + (free-sphere-list hover-nav-sphere :overlay-at (-> list-table 4)) + (segment-pool (pointer hover-nav-path-segment)) + (sphere-pool (pointer hover-nav-sphere)) ) - :method-count-assert 33 - :size-assert #x7c - :flag-assert #x210000007c (:methods - (new (symbol type) _type_ 0) - (nav-network-method-9 (_type_) none 9) - (nav-network-method-10 (_type_ level (array nav-network-info)) none 10) - (nav-network-method-11 (_type_) none 11) - (nav-network-method-12 (_type_) none 12) - (nav-network-method-13 (_type_ int nav-network-path-node) none 13) - (nav-network-method-14 (_type_ int nav-network-path-node) object 14) - (nav-network-method-15 (_type_ nav-network-path-node) object 15) - (nav-network-method-16 (_type_ nav-network-path-node) none 16) - (nav-network-method-17 (_type_) nav-network-path-node 17) - (nav-network-method-18 (_type_ nav-network-path-node) none 18) - (nav-network-method-19 (_type_ nav-network-path-node) none 19) - (nav-network-method-20 (_type_ nav-network-path-node vector) none 20) - (nav-network-method-21 (_type_ object int int) none 21) - (nav-network-method-22 (_type_ hover-nav-path-info vector vector int int) hover-nav-path-segment 22) - (nav-network-method-23 (_type_ hover-nav-path-info) none 23) - (nav-network-method-24 (_type_ hover-nav-path-info int int int) symbol 24) - (nav-network-method-25 (_type_ process collide-prim-core) none 25) - (nav-network-method-26 (_type_ vector process vector vector float) vector 26) - (nav-network-method-27 (_type_) none 27) - (nav-network-method-28 (_type_) none 28) - (nav-network-method-29 (_type_) symbol 29) - (get-network (_type_) (array nav-network-info) 30) - (nav-network-method-31 (_type_ bounding-box) none 31) - (nav-network-method-32 (_type_ string) none 32) + (new (symbol type) _type_) + (nav-network-method-9 (_type_) none) + (nav-network-method-10 (_type_ level (array nav-network-info)) none) + (nav-network-method-11 (_type_) none) + (nav-network-method-12 (_type_) none) + (nav-network-method-13 (_type_ int nav-network-path-node) none) + (nav-network-method-14 (_type_ int nav-network-path-node) object) + (nav-network-method-15 (_type_ nav-network-path-node) object) + (nav-network-method-16 (_type_ nav-network-path-node) none) + (nav-network-method-17 (_type_) nav-network-path-node) + (nav-network-method-18 (_type_ nav-network-path-node) none) + (nav-network-method-19 (_type_ nav-network-path-node) none) + (nav-network-method-20 (_type_ nav-network-path-node vector) none) + (nav-network-method-21 (_type_ object int int) none) + (nav-network-method-22 (_type_ hover-nav-path-info vector vector int int) hover-nav-path-segment) + (nav-network-method-23 (_type_ hover-nav-path-info) none) + (nav-network-method-24 (_type_ hover-nav-path-info int int int) symbol) + (nav-network-method-25 (_type_ process collide-prim-core) none) + (nav-network-method-26 (_type_ vector process vector vector float) vector) + (nav-network-method-27 (_type_) none) + (nav-network-method-28 (_type_) none) + (nav-network-method-29 (_type_) symbol) + (get-network (_type_) (array nav-network-info)) + (nav-network-method-31 (_type_ bounding-box) none) + (nav-network-method-32 (_type_ string) none) ) ) -(defmethod get-network nav-network ((this nav-network)) +(defmethod get-network ((this nav-network)) (-> this network) ) (deftype hover-nav-params (structure) - ((max-speed float :offset-assert 0) - (max-acceleration float :offset-assert 4) - (friction float :offset-assert 8) - (nav-collide-prim-index int32 :offset-assert 12) + ((max-speed float) + (max-acceleration float) + (friction float) + (nav-collide-prim-index int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype hover-nav-control (basic) - ((root collide-shape-moving :offset-assert 4) - (nav nav-network :offset-assert 8) - (flags hover-nav-flags :offset-assert 12) - (params hover-nav-params :offset-assert 16) - (path-timer time-frame :offset-assert 24) - (transvv vector :inline :offset-assert 32) - (dest-pos vector :inline :offset-assert 48) - (dest-vel vector :inline :offset-assert 64) - (dest-move-dir vector :inline :offset-assert 80) - (dest-offset vector :inline :offset-assert 96) - (move-dir vector :inline :offset-assert 112) - (nav-collide-impulse vector :inline :offset-assert 128) - (nav-collide-impulse-len float :offset-assert 144) - (dest-speed float :offset-assert 148) - (local-dist float :offset-assert 152) - (speed float :offset-assert 156) - (max-los-speed float :offset-assert 160) - (target-speed float :offset-assert 164) - (target-acceleration float :offset-assert 168) - (speed-dest float :offset-assert 172) - (path-info hover-nav-path-info :inline :offset-assert 176) - (curr-dest-pt int32 :offset-assert 192) - (los-obstruction-distance float :offset-assert 196) - (los-last-clear-time time-frame :offset-assert 200) - (max-speed-multiplier float :offset-assert 208) - (max-acceleration-multiplier float :offset-assert 212) + ((root collide-shape-moving) + (nav nav-network) + (flags hover-nav-flags) + (params hover-nav-params) + (path-timer time-frame) + (transvv vector :inline) + (dest-pos vector :inline) + (dest-vel vector :inline) + (dest-move-dir vector :inline) + (dest-offset vector :inline) + (move-dir vector :inline) + (nav-collide-impulse vector :inline) + (nav-collide-impulse-len float) + (dest-speed float) + (local-dist float) + (speed float) + (max-los-speed float) + (target-speed float) + (target-acceleration float) + (speed-dest float) + (path-info hover-nav-path-info :inline) + (curr-dest-pt int32) + (los-obstruction-distance float) + (los-last-clear-time time-frame) + (max-speed-multiplier float) + (max-acceleration-multiplier float) ) - :method-count-assert 32 - :size-assert #xd8 - :flag-assert #x20000000d8 (:methods - (new (symbol type process collide-shape-moving hover-nav-params) _type_ 0) - (hover-nav-control-method-9 (_type_) none 9) - (hover-nav-control-method-10 (_type_ vector vector vector) none 10) - (hover-nav-control-method-11 (_type_ vector) none 11) - (hover-nav-control-method-12 (_type_) none 12) - (hover-nav-control-method-13 (_type_) none 13) - (hover-nav-control-method-14 (_type_ float float) none 14) - (hover-nav-control-method-15 (_type_ vector) none 15) - (hover-nav-control-method-16 (_type_ vector) vector 16) - (hover-nav-control-method-17 (_type_) collide-prim-core 17) - (hover-nav-control-method-18 (_type_ path-control int int) none 18) - (hover-nav-control-method-19 (_type_ (inline-array vector) int) none 19) - (hover-nav-control-method-20 (_type_) none 20) - (hover-nav-control-method-21 (_type_) none 21) - (hover-nav-control-method-22 (_type_) hover-nav-path-segment 22) - (hover-nav-control-method-23 (_type_) object 23) - (hover-nav-control-method-24 (_type_) none 24) - (hover-nav-control-method-25 (_type_) none 25) - (hover-nav-control-method-26 (_type_ vector vector float) symbol 26) - (hover-nav-control-method-27 (_type_ vector vector) int 27) - (hover-nav-control-method-28 (_type_ vector vector) none 28) - (hover-nav-control-method-29 (_type_ vector) none 29) - (hover-nav-control-method-30 (_type_) float 30) - (hover-nav-control-method-31 (_type_) float 31) + (new (symbol type process collide-shape-moving hover-nav-params) _type_) + (hover-nav-control-method-9 (_type_) none) + (hover-nav-control-method-10 (_type_ vector vector vector) none) + (hover-nav-control-method-11 (_type_ vector) none) + (hover-nav-control-method-12 (_type_) none) + (hover-nav-control-method-13 (_type_) none) + (hover-nav-control-method-14 (_type_ float float) none) + (hover-nav-control-method-15 (_type_ vector) none) + (hover-nav-control-method-16 (_type_ vector) vector) + (hover-nav-control-method-17 (_type_) collide-prim-core) + (hover-nav-control-method-18 (_type_ path-control int int) none) + (hover-nav-control-method-19 (_type_ (inline-array vector) int) none) + (hover-nav-control-method-20 (_type_) none) + (hover-nav-control-method-21 (_type_) none) + (hover-nav-control-method-22 (_type_) hover-nav-path-segment) + (hover-nav-control-method-23 (_type_) object) + (hover-nav-control-method-24 (_type_) none) + (hover-nav-control-method-25 (_type_) none) + (hover-nav-control-method-26 (_type_ vector vector float) symbol) + (hover-nav-control-method-27 (_type_ vector vector) int) + (hover-nav-control-method-28 (_type_ vector vector) none) + (hover-nav-control-method-29 (_type_ vector) none) + (hover-nav-control-method-30 (_type_) float) + (hover-nav-control-method-31 (_type_) float) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc index 7c267ba2de6..7314e1f99c2 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc @@ -10,14 +10,10 @@ (define *debug-hover* #f) (deftype nav-network-control (process) - ((nav-network nav-network :offset-assert 128) + ((nav-network nav-network) ) - :heap-base #x10 - :method-count-assert 15 - :size-assert #x84 - :flag-assert #xf00100084 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) @@ -59,7 +55,7 @@ ) ) -(defmethod nav-network-method-9 nav-network ((this nav-network)) +(defmethod nav-network-method-9 ((this nav-network)) (set! (-> this segment-pool) (the-as (pointer hover-nav-path-segment) (malloc 'loading-level #x6000))) (set! (-> this free-segment-list) #f) (dotimes (v1-0 256) @@ -138,7 +134,7 @@ (none) ) -(defmethod nav-network-method-10 nav-network ((this nav-network) (arg0 level) (arg1 (array nav-network-info))) +(defmethod nav-network-method-10 ((this nav-network) (arg0 level) (arg1 (array nav-network-info))) (set! (-> this network) arg1) (while (-> this sphere-list) (let ((v1-0 (-> this sphere-list))) @@ -197,7 +193,7 @@ (none) ) -(defmethod nav-network-method-12 nav-network ((this nav-network)) +(defmethod nav-network-method-12 ((this nav-network)) (set! (-> this open-list) #f) (set! (-> this closed-list) #f) (let ((v1-0 (-> this network))) @@ -216,7 +212,7 @@ (none) ) -(defmethod nav-network-method-28 nav-network ((this nav-network)) +(defmethod nav-network-method-28 ((this nav-network)) (dotimes (s5-0 2) (format #t "list ~d: ~%" s5-0) (let ((a0-2 (-> this list-table s5-0))) @@ -232,7 +228,7 @@ (none) ) -(defmethod nav-network-method-29 nav-network ((this nav-network)) +(defmethod nav-network-method-29 ((this nav-network)) (when *display-nav-network* (let ((gp-0 (-> this network))) (when gp-0 @@ -268,7 +264,7 @@ ) ) -(defmethod nav-network-method-15 nav-network ((this nav-network) (arg0 nav-network-path-node)) +(defmethod nav-network-method-15 ((this nav-network) (arg0 nav-network-path-node)) (local-vars (a2-4 list-node)) (when (nonzero? (-> arg0 status)) (break!) @@ -392,7 +388,7 @@ ) ;; WARN: Return type mismatch nav-network-path-node vs none. -(defmethod nav-network-method-13 nav-network ((this nav-network) (arg0 int) (arg1 nav-network-path-node)) +(defmethod nav-network-method-13 ((this nav-network) (arg0 int) (arg1 nav-network-path-node)) (when (nonzero? (-> arg1 status)) (break!) 0 @@ -430,7 +426,7 @@ (none) ) -(defmethod nav-network-method-14 nav-network ((this nav-network) (arg0 int) (arg1 nav-network-path-node)) +(defmethod nav-network-method-14 ((this nav-network) (arg0 int) (arg1 nav-network-path-node)) (let ((v1-0 arg1)) (let ((a3-1 (the-as list-node (&+ (-> this list-table) (* arg0 4))))) (if (= (-> a3-1 next) v1-0) @@ -469,12 +465,12 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-network-method-16 nav-network ((this nav-network) (arg0 nav-network-path-node)) +(defmethod nav-network-method-16 ((this nav-network) (arg0 nav-network-path-node)) (nav-network-method-14 this 0 arg0) (none) ) -(defmethod nav-network-method-17 nav-network ((this nav-network)) +(defmethod nav-network-method-17 ((this nav-network)) (let ((gp-0 (-> this open-list))) (if gp-0 (nav-network-method-16 this gp-0) @@ -485,19 +481,19 @@ ) ;; WARN: Return type mismatch net-path-node-status vs none. -(defmethod nav-network-method-18 nav-network ((this nav-network) (arg0 nav-network-path-node)) +(defmethod nav-network-method-18 ((this nav-network) (arg0 nav-network-path-node)) (nav-network-method-13 this 1 arg0) (logior! (-> arg0 status) (net-path-node-status closed)) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-network-method-19 nav-network ((this nav-network) (arg0 nav-network-path-node)) +(defmethod nav-network-method-19 ((this nav-network) (arg0 nav-network-path-node)) (nav-network-method-14 this 1 arg0) (none) ) -(defmethod nav-network-method-20 nav-network ((this nav-network) (arg0 nav-network-path-node) (arg1 vector)) +(defmethod nav-network-method-20 ((this nav-network) (arg0 nav-network-path-node) (arg1 vector)) (let* ((s3-0 (-> this network)) (s2-0 (-> s3-0 (-> arg0 row-index))) ) @@ -537,7 +533,7 @@ (none) ) -(defmethod nav-network-method-22 nav-network ((this nav-network) (arg0 hover-nav-path-info) (arg1 vector) (arg2 vector) (arg3 int) (arg4 int)) +(defmethod nav-network-method-22 ((this nav-network) (arg0 hover-nav-path-info) (arg1 vector) (arg2 vector) (arg3 int) (arg4 int)) (-> this network) (let ((gp-0 (-> this free-segment-list))) (cond @@ -608,14 +604,14 @@ ) ;; WARN: Return type mismatch hover-nav-path-segment vs none. -(defmethod nav-network-method-21 nav-network ((this nav-network) (arg0 object) (arg1 int) (arg2 int)) +(defmethod nav-network-method-21 ((this nav-network) (arg0 object) (arg1 int) (arg2 int)) (let ((t0-0 (-> this network))) (nav-network-method-22 this (the-as hover-nav-path-info arg0) (-> t0-0 arg1 pos) (-> t0-0 arg2 pos) arg1 arg2) ) (none) ) -(defmethod nav-network-method-23 nav-network ((this nav-network) (arg0 hover-nav-path-info)) +(defmethod nav-network-method-23 ((this nav-network) (arg0 hover-nav-path-info)) (while (-> arg0 segment-list) (let ((v1-0 (-> arg0 segment-list))) (let ((a2-0 v1-0)) @@ -671,7 +667,7 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod nav-network-method-24 nav-network ((this nav-network) (arg0 hover-nav-path-info) (arg1 int) (arg2 int) (arg3 int)) +(defmethod nav-network-method-24 ((this nav-network) (arg0 hover-nav-path-info) (arg1 int) (arg2 int) (arg3 int)) (local-vars (s3-1 nav-network-path-node)) (nav-network-method-12 this) (let ((s4-0 (-> this network))) @@ -710,7 +706,7 @@ #t ) -(defmethod nav-network-method-25 nav-network ((this nav-network) (arg0 process) (arg1 collide-prim-core)) +(defmethod nav-network-method-25 ((this nav-network) (arg0 process) (arg1 collide-prim-core)) (local-vars (a3-2 hover-nav-sphere)) (let ((a1-4 (process->handle arg0))) (let ((v1-2 (-> this sphere-list))) @@ -791,7 +787,7 @@ (none) ) -(defmethod nav-network-method-26 nav-network ((this nav-network) (arg0 vector) (arg1 process) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-network-method-26 ((this nav-network) (arg0 vector) (arg1 process) (arg2 vector) (arg3 vector) (arg4 float)) (local-vars (sv-48 vector) (sv-64 sphere)) (vector-reset! arg0) (let ((s1-0 (process->handle arg1)) @@ -822,7 +818,7 @@ ) ) -(defmethod nav-network-method-27 nav-network ((this nav-network)) +(defmethod nav-network-method-27 ((this nav-network)) (with-pp (let ((v1-0 (the-as list-node (-> this sphere-list)))) (while v1-0 @@ -911,7 +907,7 @@ ) ) -(defmethod nav-network-method-31 nav-network ((this nav-network) (arg0 bounding-box)) +(defmethod nav-network-method-31 ((this nav-network) (arg0 bounding-box)) (set-to-point! arg0 (-> this network 0 pos)) (let* ((s4-0 (-> this network length)) (s3-0 0) @@ -927,7 +923,7 @@ (none) ) -(defmethod nav-network-method-32 nav-network ((this nav-network) (arg0 string)) +(defmethod nav-network-method-32 ((this nav-network) (arg0 string)) (let ((gp-0 (new 'stack-no-clear 'bounding-box)) (s5-0 (entity-by-name arg0)) ) @@ -954,7 +950,7 @@ (define *nav-network* (the-as nav-network 0)) -(defmethod hover-nav-control-method-26 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod hover-nav-control-method-26 ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) (set! (-> gp-0 start-pos quad) (-> arg0 quad)) @@ -974,7 +970,7 @@ ) ) -(defmethod hover-nav-control-method-27 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector)) +(defmethod hover-nav-control-method-27 ((this hover-nav-control) (arg0 vector) (arg1 vector)) (let ((s2-0 (-> this nav network)) (gp-0 (the-as int #f)) ) @@ -1000,22 +996,22 @@ ) ) -(defmethod hover-nav-control-method-22 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-22 ((this hover-nav-control)) (-> this path-info curr-segment) ) -(defmethod hover-nav-control-method-23 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-23 ((this hover-nav-control)) (and (-> this path-info curr-segment) (>= (-> this path-info curr-u) 1.0)) ) -(defmethod hover-nav-control-method-21 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-21 ((this hover-nav-control)) (nav-network-method-23 (-> this nav) (-> this path-info)) (set! (-> this curr-dest-pt) -1) 0 (none) ) -(defmethod hover-nav-control-method-28 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector)) +(defmethod hover-nav-control-method-28 ((this hover-nav-control) (arg0 vector) (arg1 vector)) (local-vars (v0-15 symbol) (sv-32 int) (sv-48 (function hover-nav-control vector vector int))) (let ((s4-0 (-> this nav network)) (s5-0 (-> this path-info)) @@ -1094,7 +1090,7 @@ (none) ) -(defmethod hover-nav-control-method-29 hover-nav-control ((this hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-29 ((this hover-nav-control) (arg0 vector)) (let ((a0-1 (the-as list-node #f)) (s4-0 (the-as list-node (-> this path-info segment-list))) ) @@ -1146,22 +1142,22 @@ (none) ) -(defmethod hover-nav-control-method-30 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-30 ((this hover-nav-control)) (* (-> this max-speed-multiplier) (-> this params max-speed)) ) -(defmethod hover-nav-control-method-31 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-31 ((this hover-nav-control)) (* (-> this max-acceleration-multiplier) (-> this params max-acceleration)) ) -(defmethod hover-nav-control-method-14 hover-nav-control ((this hover-nav-control) (arg0 float) (arg1 float)) +(defmethod hover-nav-control-method-14 ((this hover-nav-control) (arg0 float) (arg1 float)) (set! (-> this max-speed-multiplier) arg0) (set! (-> this max-acceleration-multiplier) arg1) 0 (none) ) -(defmethod hover-nav-control-method-18 hover-nav-control ((this hover-nav-control) (arg0 path-control) (arg1 int) (arg2 int)) +(defmethod hover-nav-control-method-18 ((this hover-nav-control) (arg0 path-control) (arg1 int) (arg2 int)) (hover-nav-control-method-21 this) (set! arg2 (cond ((= arg2 -1) @@ -1195,7 +1191,7 @@ (none) ) -(defmethod hover-nav-control-method-19 hover-nav-control ((this hover-nav-control) (arg0 (inline-array vector)) (arg1 int)) +(defmethod hover-nav-control-method-19 ((this hover-nav-control) (arg0 (inline-array vector)) (arg1 int)) (hover-nav-control-method-21 this) (let ((s4-1 (+ arg1 -2))) (while (>= s4-1 0) @@ -1213,14 +1209,14 @@ (none) ) -(defmethod hover-nav-control-method-20 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-20 ((this hover-nav-control)) (hover-nav-control-method-21 this) (logclear! (-> this flags) (hover-nav-flags honflags-0)) 0 (none) ) -(defmethod hover-nav-control-method-17 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-17 ((this hover-nav-control)) (-> (the-as collide-shape-prim-group (-> this root root-prim)) child (-> this params nav-collide-prim-index) @@ -1229,7 +1225,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod hover-nav-control-method-15 hover-nav-control ((this hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-15 ((this hover-nav-control) (arg0 vector)) (local-vars (sv-32 vector) (sv-36 collide-shape-moving)) (set! sv-32 (new 'stack-no-clear 'vector)) (set! sv-36 (-> this root)) @@ -1238,14 +1234,14 @@ (none) ) -(defmethod hover-nav-control-method-16 hover-nav-control ((this hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-16 ((this hover-nav-control) (arg0 vector)) (local-vars (sv-32 vector)) (set! sv-32 (new 'stack-no-clear 'vector)) (vector-inv-orient-by-quat! sv-32 (-> this transvv) (-> this root quat)) (vector-float*! arg0 sv-32 (/ 1.0 (hover-nav-control-method-31 this))) ) -(defmethod hover-nav-control-method-10 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod hover-nav-control-method-10 ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) (set! (-> this dest-pos quad) (-> arg0 quad)) (cond ;; og:preserve-this condition has been changed from `arg2` because some places call this method with #t as arg2 @@ -1263,7 +1259,7 @@ (none) ) -(defmethod hover-nav-control-method-24 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-24 ((this hover-nav-control)) (when (not (logtest? (-> this flags) (hover-nav-flags honflags-0))) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (-> this params) @@ -1293,7 +1289,7 @@ (logior! (-> this flags) (hover-nav-flags honflags-1)) ) (else - (set! (-> this los-last-clear-time) (current-time)) + (set-time! (-> this los-last-clear-time)) (logclear! (-> this flags) (hover-nav-flags honflags-1)) ) ) @@ -1306,7 +1302,7 @@ (none) ) -(defmethod hover-nav-control-method-11 hover-nav-control ((this hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-11 ((this hover-nav-control) (arg0 vector)) (local-vars (sv-288 vector) (sv-304 vector) (sv-320 vector) (sv-336 vector) (sv-352 int)) (with-pp (when *debug-hover* @@ -1333,12 +1329,12 @@ (hover-nav-control-method-21 this) ) ) - ((or (>= (- (current-time) (-> this los-last-clear-time)) (seconds 1)) (not (-> this path-info curr-segment))) + ((or (time-elapsed? (-> this los-last-clear-time) (seconds 1)) (not (-> this path-info curr-segment))) (hover-nav-control-method-21 this) (when arg0 (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> this root transv quad)) - (if (>= (- (current-time) (-> this los-last-clear-time)) (seconds 1)) + (if (time-elapsed? (-> this los-last-clear-time) (seconds 1)) (vector-normalize! s4-0 (fmin (vector-length s4-0) (-> this los-obstruction-distance))) ) (hover-nav-control-method-28 @@ -1446,7 +1442,7 @@ ) ) -(defmethod hover-nav-control-method-25 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-25 ((this hover-nav-control)) (let ((s5-0 (new 'stack-no-clear 'hover-nav-path-segment)) (f28-0 (hover-nav-control-method-31 this)) (f30-0 (hover-nav-control-method-30 this)) @@ -1524,7 +1520,7 @@ (none) ) -(defmethod hover-nav-control-method-12 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-12 ((this hover-nav-control)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -1576,7 +1572,7 @@ ;; ERROR: Stack slot load at 128 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 144 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 -(defmethod hover-nav-control-method-13 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-13 ((this hover-nav-control)) (local-vars (sv-112 float) (sv-128 float) (sv-144 float) (sv-160 float)) (let* ((s5-0 (-> this root)) (s3-0 (hover-nav-control-method-17 this)) @@ -1672,13 +1668,13 @@ (-> arg0 status) ) -(defmethod hover-nav-control-method-9 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-9 ((this hover-nav-control)) (hover-nav-control-method-21 this) 0 (none) ) -(defmethod relocate hover-nav-control ((this hover-nav-control) (arg0 int)) +(defmethod relocate ((this hover-nav-control) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) @@ -1710,7 +1706,7 @@ (set! (-> s5-0 speed-dest) 0.0) (set! (-> s5-0 curr-dest-pt) -1) (set! (-> s5-0 los-obstruction-distance) 0.0) - (set! (-> s5-0 los-last-clear-time) (current-time)) + (set-time! (-> s5-0 los-last-clear-time)) (hover-nav-control-method-14 s5-0 1.0 1.0) (nav-network-method-25 (-> s5-0 nav) arg0 (the-as collide-prim-core #f)) s5-0 diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc index 805c75ffcf7..77e8a473321 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc @@ -194,14 +194,11 @@ ) (deftype hover-nav-bsp-point (list-node) - ((index int32 :offset-assert 8) - (pos vector :inline :offset-assert 16) + ((index int32) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) @@ -221,18 +218,15 @@ ) (deftype hover-nav-bsp-node (structure) - ((split-plane vector :inline :offset-assert 0) - (point-list hover-nav-bsp-point :offset-assert 16) - (left hover-nav-bsp-node :offset-assert 20) - (right hover-nav-bsp-node :offset-assert 24) + ((split-plane vector :inline) + (point-list hover-nav-bsp-point) + (left hover-nav-bsp-node) + (right hover-nav-bsp-node) ) - :method-count-assert 11 - :size-assert #x1c - :flag-assert #xb0000001c (:methods - (new (symbol type) _type_ 0) - (hover-nav-bsp-node-method-9 (_type_) none 9) - (hover-nav-bsp-node-method-10 (_type_ int) none 10) + (new (symbol type) _type_) + (hover-nav-bsp-node-method-9 (_type_) none) + (hover-nav-bsp-node-method-10 (_type_ int) none) ) ) @@ -253,15 +247,12 @@ ) (deftype hover-nav-bsp (structure) - ((root hover-nav-bsp-node :offset-assert 0) + ((root hover-nav-bsp-node) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) -(defmethod hover-nav-bsp-node-method-9 hover-nav-bsp-node ((this hover-nav-bsp-node)) +(defmethod hover-nav-bsp-node-method-9 ((this hover-nav-bsp-node)) (let ((v1-0 (-> this split-plane))) (format #t "((~,,1f ~,,1f ~,,1f ~m)~% " (-> v1-0 x) (-> v1-0 y) (-> v1-0 z) (-> v1-0 w)) ) @@ -291,7 +282,7 @@ (none) ) -(defmethod hover-nav-bsp-node-method-10 hover-nav-bsp-node ((this hover-nav-bsp-node) (arg0 int)) +(defmethod hover-nav-bsp-node-method-10 ((this hover-nav-bsp-node) (arg0 int)) (when (-> this point-list) (format 0 "build-bsp: ") (let ((s4-0 (new 'stack-no-clear 'vector)) diff --git a/goal_src/jak2/levels/common/enemy/hover/wasp.gc b/goal_src/jak2/levels/common/enemy/hover/wasp.gc index d8971c637ae..d5bbfd26384 100644 --- a/goal_src/jak2/levels/common/enemy/hover/wasp.gc +++ b/goal_src/jak2/levels/common/enemy/hover/wasp.gc @@ -297,14 +297,10 @@ (deftype wasp-shot (metalhead-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) -(defmethod play-impact-sound wasp-shot ((this wasp-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this wasp-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -319,7 +315,7 @@ (none) ) -(defmethod init-proj-settings! wasp-shot ((this wasp-shot)) +(defmethod init-proj-settings! ((this wasp-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'wasp-shot) @@ -440,7 +436,7 @@ (set! (-> *wasp-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler wasp ((this wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -470,7 +466,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 wasp ((this wasp) (arg0 vector)) +(defmethod enemy-method-52 ((this wasp) (arg0 vector)) (let ((s4-0 (-> this root))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-2)) @@ -508,7 +504,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle wasp ((this wasp)) +(defmethod go-idle ((this wasp)) (cond ((logtest? (-> this fact enemy-options) (enemy-option user0)) (go (method-of-object this shoot-bridge-wait)) @@ -523,17 +519,17 @@ (none) ) -(defmethod go-hostile wasp ((this wasp)) +(defmethod go-hostile ((this wasp)) (go (method-of-object this hostile)) ) -(defmethod react-to-focus wasp ((this wasp)) +(defmethod react-to-focus ((this wasp)) "@TODO - flesh out docs" (go-hostile this) ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-129 wasp ((this wasp)) +(defmethod enemy-method-129 ((this wasp)) (if (logtest? (-> this fact enemy-options) (enemy-option user0)) (set! (-> this focus-pos quad) (-> this plat-pos quad)) ((method-of-type hover-enemy enemy-method-129) this) @@ -541,7 +537,7 @@ (none) ) -(defmethod track-target! wasp ((this wasp)) +(defmethod track-target! ((this wasp)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1069,7 +1065,7 @@ ) ;; WARN: Return type mismatch process vs process-focusable. -(defmethod get-enemy-target wasp ((this wasp)) +(defmethod get-enemy-target ((this wasp)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" (let ((s5-0 (handle->process (-> this focus handle)))) (the-as @@ -1096,7 +1092,7 @@ ) ) -(defmethod enemy-method-77 wasp ((this wasp) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this wasp) (arg0 (pointer float))) (cond ((rng-hit? this 0.5) (set! (-> this knocked-anim) 10) @@ -1120,7 +1116,7 @@ #t ) -(defmethod enemy-method-78 wasp ((this wasp) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this wasp) (arg0 (pointer float))) (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-3 (-> this skel root-channel 0)) ) @@ -1133,16 +1129,16 @@ #t ) -(defmethod enemy-method-80 wasp ((this wasp) (arg0 enemy-knocked-info)) +(defmethod enemy-method-80 ((this wasp) (arg0 enemy-knocked-info)) (-> this root) (>= (-> arg0 on-surface-count) 1) ) -(defmethod enemy-method-81 wasp ((this wasp)) +(defmethod enemy-method-81 ((this wasp)) #f ) -(defmethod kill-prefer-falling wasp ((this wasp)) +(defmethod kill-prefer-falling ((this wasp)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cond ((and (-> this next-state) (= (-> this next-state name) 'knocked)) @@ -1157,7 +1153,7 @@ ) ) -(defmethod spawn-wasp-shot wasp ((this wasp) (arg0 projectile-init-by-other-params) (arg1 int) (arg2 float) (arg3 float)) +(defmethod spawn-wasp-shot ((this wasp) (arg0 projectile-init-by-other-params) (arg1 int) (arg2 float) (arg3 float)) (vector<-cspace! (-> arg0 pos) (-> this node-list data arg1)) (let ((s3-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) @@ -1184,7 +1180,7 @@ (none) ) -(defmethod hover-enemy-method-142 wasp ((this wasp)) +(defmethod hover-enemy-method-142 ((this wasp)) (let ((s5-0 (-> this main-joint-acc)) (s4-0 (-> this main-joint-vel)) (gp-0 @@ -1294,7 +1290,7 @@ (none) ) -(defmethod init-enemy-collision! wasp ((this wasp)) +(defmethod init-enemy-collision! ((this wasp)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1404,7 +1400,7 @@ (none) ) -(defmethod deactivate wasp ((this wasp)) +(defmethod deactivate ((this wasp)) (if (nonzero? (-> this smoke-part)) (kill-and-free-particles (-> this smoke-part)) ) @@ -1417,7 +1413,7 @@ ) ;; WARN: Return type mismatch hover-enemy vs wasp. -(defmethod relocate wasp ((this wasp) (arg0 int)) +(defmethod relocate ((this wasp) (arg0 int)) (if (nonzero? (-> this gun-jmod)) (&+! (-> this gun-jmod) arg0) ) @@ -1430,7 +1426,7 @@ (the-as wasp ((method-of-type hover-enemy relocate) this arg0)) ) -(defmethod hover-enemy-method-149 wasp ((this wasp)) +(defmethod hover-enemy-method-149 ((this wasp)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-wasp" (the-as (pointer uint32) #f))) @@ -1440,11 +1436,11 @@ (none) ) -(defmethod hover-enemy-method-150 wasp ((this wasp)) +(defmethod hover-enemy-method-150 ((this wasp)) *wasp-enemy-info* ) -(defmethod hover-enemy-method-151 wasp ((this wasp)) +(defmethod hover-enemy-method-151 ((this wasp)) (new 'static 'hover-enemy-info :fly-forward-anim 7 :fly-backward-anim 8 @@ -1460,11 +1456,11 @@ ) ) -(defmethod hover-enemy-method-152 wasp ((this wasp)) +(defmethod hover-enemy-method-152 ((this wasp)) (new 'static 'hover-nav-params :max-speed 73728.0 :max-acceleration 122880.0 :friction 0.05) ) -(defmethod init-enemy! wasp ((this wasp)) +(defmethod init-enemy! ((this wasp)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) (hover-enemy-method-149 this) diff --git a/goal_src/jak2/levels/common/enemy/metalmonk.gc b/goal_src/jak2/levels/common/enemy/metalmonk.gc index eec7024413a..43d1584fe00 100644 --- a/goal_src/jak2/levels/common/enemy/metalmonk.gc +++ b/goal_src/jak2/levels/common/enemy/metalmonk.gc @@ -15,50 +15,42 @@ ) (deftype metalmonk-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype metalmonk-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (idle-anim int32 3 :offset-assert 8) - (patrol-anim int32 2 :offset-assert 20) - (notice-anim int32 2 :offset-assert 28) - (charge-anim int32 2 :offset-assert 36) - (attack-anim int32 2 :offset-assert 44) - (knocked-anim int32 2 :offset-assert 52) - (celebrate-anim int32 2 :offset-assert 60) - (yellow-hit-anim int32 4 :offset-assert 68) - (blue-hit-anim int32 3 :offset-assert 84) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (idle-anim int32 3) + (patrol-anim int32 2) + (notice-anim int32 2) + (charge-anim int32 2) + (attack-anim int32 2) + (knocked-anim int32 2) + (celebrate-anim int32 2) + (yellow-hit-anim int32 4) + (blue-hit-anim int32 3) ) :pack-me - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) (deftype metalmonk (nav-enemy) - ((new-facing vector :inline :offset 624) - (old-facing vector :inline :offset 640) - (high-time time-frame :offset 656) - (intro-path path-control :offset-assert 664) + ((new-facing vector :inline :offset 624) + (old-facing vector :inline :offset 640) + (high-time time-frame :offset 656) + (intro-path path-control) ) - :heap-base #x220 - :method-count-assert 183 - :size-assert #x29c - :flag-assert #xb70220029c + (:state-methods + attack + ) (:methods - (attack () _type_ :state 178) - (metalmonk-method-179 (_type_ vector) none 179) - (metalmonk-method-180 (_type_ symbol) none 180) - (metalmonk-method-181 (_type_ float float) none 181) - (metalmonk-method-182 (_type_ float float) none 182) + (metalmonk-method-179 (_type_ vector) none) + (metalmonk-method-180 (_type_ symbol) none) + (metalmonk-method-181 (_type_ float float) none) + (metalmonk-method-182 (_type_ float float) none) ) ) @@ -254,14 +246,14 @@ (set! (-> *metalmonk-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; WARN: Return type mismatch vector vs none. -(defmethod metalmonk-method-179 metalmonk ((this metalmonk) (arg0 vector)) +(defmethod metalmonk-method-179 ((this metalmonk) (arg0 vector)) (set! (-> arg0 quad) (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)) vector 2 quad) ) (none) ) -(defmethod metalmonk-method-181 metalmonk ((this metalmonk) (arg0 float) (arg1 float)) +(defmethod metalmonk-method-181 ((this metalmonk) (arg0 float) (arg1 float)) (let ((f28-0 (vector-dot (-> this new-facing) (-> this old-facing))) (f30-1 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) ) @@ -315,7 +307,7 @@ (none) ) -(defmethod metalmonk-method-182 metalmonk ((this metalmonk) (arg0 float) (arg1 float)) +(defmethod metalmonk-method-182 ((this metalmonk) (arg0 float) (arg1 float)) (let ((f28-0 (vector-dot (-> this new-facing) (-> this old-facing))) (f30-1 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) ) @@ -368,7 +360,7 @@ (none) ) -(defmethod track-target! metalmonk ((this metalmonk)) +(defmethod track-target! ((this metalmonk)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -382,7 +374,7 @@ (none) ) -(defmethod general-event-handler metalmonk ((this metalmonk) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this metalmonk) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -441,7 +433,7 @@ ) ) -(defmethod enemy-method-104 metalmonk ((this metalmonk) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ((this metalmonk) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (let* ((s3-0 arg0) (a0-2 (if (type? s3-0 process-focusable) s3-0 @@ -483,7 +475,7 @@ ) ) -(defmethod enemy-method-84 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 ((this metalmonk) (arg0 enemy-jump-info)) (let* ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos))) (f1-1 (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0))) (f0-3 (fmax (-> arg0 start-pos y) (-> arg0 dest-pos y))) @@ -494,11 +486,11 @@ (none) ) -(defmethod enemy-method-89 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this metalmonk) (arg0 enemy-jump-info)) #f ) -(defmethod enemy-method-87 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this metalmonk) (arg0 enemy-jump-info)) (let ((s5-0 (-> this draw art-group data (-> this enemy-info run-anim))) (v1-6 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) @@ -519,11 +511,11 @@ #t ) -(defmethod enemy-method-88 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this metalmonk) (arg0 enemy-jump-info)) #f ) -(defmethod enemy-method-90 metalmonk ((this metalmonk) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 ((this metalmonk) (arg0 int) (arg1 enemy-jump-info)) (case arg0 ((3) (let ((a0-1 (-> this skel root-channel 0))) @@ -899,7 +891,7 @@ ) ) -(defmethod enemy-method-77 metalmonk ((this metalmonk) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this metalmonk) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 0) @@ -966,7 +958,7 @@ #t ) -(defmethod enemy-method-78 metalmonk ((this metalmonk) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this metalmonk) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -1021,7 +1013,7 @@ ) ) -(defmethod metalmonk-method-180 metalmonk ((this metalmonk) (arg0 symbol)) +(defmethod metalmonk-method-180 ((this metalmonk) (arg0 symbol)) (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 1) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) @@ -1036,7 +1028,7 @@ (none) ) -(defmethod init-enemy-collision! metalmonk ((this metalmonk)) +(defmethod init-enemy-collision! ((this metalmonk)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1145,19 +1137,19 @@ (none) ) -(defmethod coin-flip? metalmonk ((this metalmonk)) +(defmethod coin-flip? ((this metalmonk)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod relocate metalmonk ((this metalmonk) (arg0 int)) +(defmethod relocate ((this metalmonk) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) ) (call-parent-method this arg0) ) -(defmethod init-enemy! metalmonk ((this metalmonk)) +(defmethod init-enemy! ((this metalmonk)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (stack-size-set! (-> this main-thread) 256) (initialize-skeleton diff --git a/goal_src/jak2/levels/common/enemy/spyder.gc b/goal_src/jak2/levels/common/enemy/spyder.gc index 97018b4dc05..e80ea8a254f 100644 --- a/goal_src/jak2/levels/common/enemy/spyder.gc +++ b/goal_src/jak2/levels/common/enemy/spyder.gc @@ -21,14 +21,10 @@ (deftype spyder-shot (metalhead-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) -(defmethod play-impact-sound spyder-shot ((this spyder-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this spyder-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -43,7 +39,7 @@ (none) ) -(defmethod init-proj-settings! spyder-shot ((this spyder-shot)) +(defmethod init-proj-settings! ((this spyder-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (call-parent-method this) (set! (-> this max-speed) 307200.0) @@ -59,35 +55,33 @@ ) (deftype spyder (nav-enemy) - ((los los-control :inline :offset-assert 608) - (joint joint-mod :offset-assert 756) - (start-pos vector :inline :offset-assert 768) - (face-pos vector :inline :offset 800) - (my-up-vector vector :inline :offset-assert 816) - (status-flags spyder-flags :offset-assert 832) - (change-dir-timer time-frame :offset-assert 840) - (fire-info vector 2 :inline :offset-assert 848) - (joint-ik joint-mod-ik 4 :offset 880) - (delta-y-ik float 4 :offset-assert 896) - (predator-effect? symbol :offset-assert 912) - (shock-effect-time time-frame :offset-assert 920) - (shock-effect-end time-frame :offset-assert 928) - (fade float :offset-assert 936) - (dest-fade float :offset-assert 940) + ((los los-control :inline) + (joint joint-mod) + (start-pos vector :inline) + (face-pos vector :inline :offset 800) + (my-up-vector vector :inline) + (status-flags spyder-flags) + (change-dir-timer time-frame) + (fire-info vector 2 :inline) + (joint-ik joint-mod-ik 4 :offset 880) + (delta-y-ik float 4) + (predator-effect? symbol) + (shock-effect-time time-frame) + (shock-effect-end time-frame) + (fade float) + (dest-fade float) ) - :heap-base #x330 - :method-count-assert 186 - :size-assert #x3b0 - :flag-assert #xba033003b0 + (:state-methods + attack + backup + ) (:methods - (attack () _type_ :state 178) - (backup () _type_ :state 179) - (spyder-method-180 (_type_) none 180) - (spyder-method-181 (_type_) none 181) - (spyder-method-182 (_type_) none 182) - (spyder-method-183 (_type_ matrix float) none 183) - (spyder-method-184 (_type_ vector) none 184) - (spyder-method-185 (_type_) none 185) + (spyder-method-180 (_type_) none) + (spyder-method-181 (_type_) none) + (spyder-method-182 (_type_) none) + (spyder-method-183 (_type_ matrix float) none) + (spyder-method-184 (_type_ vector) none) + (spyder-method-185 (_type_) none) ) ) @@ -271,7 +265,7 @@ (set! (-> *spyder-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler spyder ((this spyder) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this spyder) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -348,7 +342,7 @@ ) ) -(defmethod spyder-method-180 spyder ((this spyder)) +(defmethod spyder-method-180 ((this spyder)) (seek! (-> this fade) (-> this dest-fade) (* 500.0 (seconds-per-frame))) (set! (-> this draw force-fade) (the-as uint (the int (-> this fade)))) (cond @@ -389,7 +383,7 @@ (none) ) -(defmethod spyder-method-181 spyder ((this spyder)) +(defmethod spyder-method-181 ((this spyder)) (let ((a0-2 (handle->process (-> this focus handle)))) (when a0-2 (let* ((s5-0 (-> this root trans)) @@ -433,7 +427,7 @@ ) ;; WARN: Using new Jak 2 rtype-of -(defmethod enemy-method-77 spyder ((this spyder) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this spyder) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (let ((a0-2 (-> this skel root-channel 0))) @@ -502,7 +496,7 @@ ) ) -(defmethod enemy-method-78 spyder ((this spyder) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this spyder) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (cond @@ -535,7 +529,7 @@ ) ) -(defmethod enemy-method-87 spyder ((this spyder) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this spyder) (arg0 enemy-jump-info)) (let ((s5-0 (-> this draw art-group data (-> this enemy-info jump-in-air-anim)))) (let ((v1-6 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) @@ -598,7 +592,7 @@ (none) ) -(defmethod spyder-method-182 spyder ((this spyder)) +(defmethod spyder-method-182 ((this spyder)) (cond ((and (logtest? (-> this status-flags) (spyder-flags spflags-2)) (!= (-> this joint scale z) 1.0)) (seek! (-> this joint scale z) 1.0 (* 0.8 (seconds-per-frame))) @@ -645,7 +639,7 @@ (none) ) -(defmethod spyder-method-184 spyder ((this spyder) (arg0 vector)) +(defmethod spyder-method-184 ((this spyder) (arg0 vector)) (when (not (logtest? (-> this status-flags) (spyder-flags spflags-0))) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> *up-vector* quad)) @@ -665,7 +659,7 @@ (none) ) -(defmethod track-target! spyder ((this spyder)) +(defmethod track-target! ((this spyder)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -689,12 +683,9 @@ ) (deftype ik-setup (structure) - ((elbow-index int32 :offset-assert 0) - (hand-dist float :offset-assert 4) + ((elbow-index int32) + (hand-dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -735,7 +726,7 @@ ) ) -(defmethod spyder-method-185 spyder ((this spyder)) +(defmethod spyder-method-185 ((this spyder)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -961,7 +952,7 @@ ) ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod spyder-method-183 spyder ((this spyder) (arg0 matrix) (arg1 float)) +(defmethod spyder-method-183 ((this spyder) (arg0 matrix) (arg1 float)) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((v1-0 (-> arg0 vector)) (a1-1 (-> arg0 vector 1)) @@ -1127,7 +1118,7 @@ ) ) -(defmethod go-hostile spyder ((this spyder)) +(defmethod go-hostile ((this spyder)) (if (and (not (logtest? (-> this status-flags) (spyder-flags spflags-1))) (-> this next-state) (let ((v1-5 (-> this next-state name))) @@ -1177,7 +1168,7 @@ ) ) -(defmethod nav-enemy-method-142 spyder ((this spyder) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this spyder) (arg0 nav-control)) (let ((t9-0 (method-of-object this spyder-method-184)) (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) @@ -1189,13 +1180,13 @@ (none) ) -(defmethod coin-flip? spyder ((this spyder)) +(defmethod coin-flip? ((this spyder)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 spyder ((this spyder) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this spyder) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) (the-as symbol (if (t9-0 this arg0 arg1) (set-dst-proc! (-> this los) (-> this focus handle)) @@ -1204,7 +1195,7 @@ ) ) -(defmethod init-enemy-collision! spyder ((this spyder)) +(defmethod init-enemy-collision! ((this spyder)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1304,7 +1295,7 @@ (none) ) -(defmethod relocate spyder ((this spyder) (arg0 int)) +(defmethod relocate ((this spyder) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -1316,7 +1307,7 @@ (call-parent-method this arg0) ) -(defmethod init-enemy! spyder ((this spyder)) +(defmethod init-enemy! ((this spyder)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/common/entities/com-elevator.gc b/goal_src/jak2/levels/common/entities/com-elevator.gc index a31e259cc41..36ab2d3771d 100644 --- a/goal_src/jak2/levels/common/entities/com-elevator.gc +++ b/goal_src/jak2/levels/common/entities/com-elevator.gc @@ -8,16 +8,12 @@ ;; DECOMP BEGINS (deftype com-elevator (elevator) - ((camera-startup vector 2 :inline :offset-assert 368) - (use-camera-startup? symbol 2 :offset-assert 400) - (sound-id sound-id :offset-assert 408) + ((camera-startup vector 2 :inline) + (use-camera-startup? symbol 2) + (sound-id sound-id) ) - :heap-base #x120 - :method-count-assert 50 - :size-assert #x19c - :flag-assert #x320120019c (:methods - (com-elevator-method-49 (_type_ symbol) none 49) + (com-elevator-method-49 (_type_ symbol) none) ) ) @@ -27,12 +23,12 @@ :bounds (static-spherem 0 0 5.6 9.2) ) -(defmethod get-art-group com-elevator ((this com-elevator)) +(defmethod get-art-group ((this com-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-com-elevator" (the-as (pointer uint32) #f)) ) -(defmethod move-between-points com-elevator ((this com-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this com-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -51,7 +47,7 @@ ) ) -(defmethod commited-to-ride? com-elevator ((this com-elevator)) +(defmethod commited-to-ride? ((this com-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) @@ -77,7 +73,7 @@ ) ) -(defmethod com-elevator-method-49 com-elevator ((this com-elevator) (arg0 symbol)) +(defmethod com-elevator-method-49 ((this com-elevator) (arg0 symbol)) (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 @@ -162,7 +158,7 @@ ) ) -(defmethod activate-elevator com-elevator ((this com-elevator)) +(defmethod activate-elevator ((this com-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (cond ((logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) @@ -177,14 +173,14 @@ ) ) -(defmethod deactivate com-elevator ((this com-elevator)) +(defmethod deactivate ((this com-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! com-elevator ((this com-elevator)) +(defmethod init-plat! ((this com-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (dotimes (s5-0 (-> this path curve num-cverts)) @@ -204,7 +200,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod init-plat-collision! com-elevator ((this com-elevator)) +(defmethod init-plat-collision! ((this com-elevator)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -246,12 +242,8 @@ For example for an elevator pre-compute the distance between the first and last ) (deftype tomb-trans-elevator (com-elevator) - ((unknown-gijh1bn2i3hb1 int32 :offset-assert 412) + ((unknown-gijh1bn2i3hb1 int32) ) - :heap-base #x120 - :method-count-assert 50 - :size-assert #x1a0 - :flag-assert #x32012001a0 ) @@ -310,14 +302,14 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod deactivate tomb-trans-elevator ((this tomb-trans-elevator)) +(defmethod deactivate ((this tomb-trans-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! tomb-trans-elevator ((this tomb-trans-elevator)) +(defmethod init-plat! ((this tomb-trans-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (call-parent-method this) diff --git a/goal_src/jak2/levels/common/entities/cty-guard-turret-button.gc b/goal_src/jak2/levels/common/entities/cty-guard-turret-button.gc index 4d619775567..8a0625be031 100644 --- a/goal_src/jak2/levels/common/entities/cty-guard-turret-button.gc +++ b/goal_src/jak2/levels/common/entities/cty-guard-turret-button.gc @@ -14,17 +14,13 @@ (deftype cty-guard-turret-button (basebutton) () - :heap-base #xa0 - :method-count-assert 40 - :size-assert #x120 - :flag-assert #x2800a00120 - (:methods - (pop-up () _type_ :state 39) + (:state-methods + pop-up ) ) -(defmethod basebutton-method-33 cty-guard-turret-button ((this cty-guard-turret-button)) +(defmethod basebutton-method-33 ((this cty-guard-turret-button)) "TODO - joint stuff" (initialize-skeleton this @@ -64,7 +60,7 @@ ) ;; WARN: Return type mismatch collide-shape vs none. -(defmethod basebutton-method-34 cty-guard-turret-button ((this cty-guard-turret-button)) +(defmethod basebutton-method-34 ((this cty-guard-turret-button)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -101,7 +97,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod prepare-trigger-event! cty-guard-turret-button ((this cty-guard-turret-button)) +(defmethod prepare-trigger-event! ((this cty-guard-turret-button)) "Sets `event-going-down` to `'trigger`" (logior! (-> this button-status) (button-status button-status-4)) (set! (-> this event-going-down) 'trigger) @@ -124,7 +120,7 @@ ) ) -(defmethod idle-state-transition cty-guard-turret-button ((this cty-guard-turret-button)) +(defmethod idle-state-transition ((this cty-guard-turret-button)) "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" (setup-masks (-> this draw) 0 -1) (cond diff --git a/goal_src/jak2/levels/common/entities/fort-floor-spike.gc b/goal_src/jak2/levels/common/entities/fort-floor-spike.gc index 42675b664ea..5f1f7096e52 100644 --- a/goal_src/jak2/levels/common/entities/fort-floor-spike.gc +++ b/goal_src/jak2/levels/common/entities/fort-floor-spike.gc @@ -8,44 +8,36 @@ ;; DECOMP BEGINS (deftype spike-row-info (structure) - ((sync sync-linear :inline :offset-assert 0) - (table-ptr (inline-array vector) :offset-assert 16) - (on-ratio float :offset-assert 20) - (state int32 :offset-assert 24) + ((sync sync-linear :inline) + (table-ptr (inline-array vector)) + (on-ratio float) + (state int32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype spike-row-info-array (inline-array-class) - ((data spike-row-info :inline :dynamic :offset-assert 16) + ((data spike-row-info :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> spike-row-info-array heap-base) (the-as uint 32)) (deftype fort-floor-spike (process-drawable) - ((pos-table (inline-array vector) :offset-assert 200) - (spike-row spike-row-info-array :offset-assert 204) - (spike-dim int32 2 :offset-assert 208) - (attack-id int32 :offset-assert 216) - (no-overlap-timer uint64 :offset-assert 224) + ((pos-table (inline-array vector)) + (spike-row spike-row-info-array) + (spike-dim int32 2) + (attack-id int32) + (no-overlap-timer uint64) ) - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe8 - :flag-assert #x18007000e8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (init-spike-joints! (_type_) none 21) - (init-spike-collision! (_type_) collide-shape-moving 22) - (init-periodic-animation! (_type_) symbol 23) + (init-spike-joints! (_type_) none) + (init-spike-collision! (_type_) collide-shape-moving) + (init-periodic-animation! (_type_) symbol) ) ) @@ -65,20 +57,20 @@ (none) ) -(defmethod init-spike-joints! fort-floor-spike ((this fort-floor-spike)) +(defmethod init-spike-joints! ((this fort-floor-spike)) "Initializes the skeleton and joints for the spike" 0 (none) ) ;; WARN: Return type mismatch int vs collide-shape-moving. -(defmethod init-spike-collision! fort-floor-spike ((this fort-floor-spike)) +(defmethod init-spike-collision! ((this fort-floor-spike)) "Initializes the collision for the particular spike" (the-as collide-shape-moving 0) ) ;; WARN: Return type mismatch int vs symbol. -(defmethod init-periodic-animation! fort-floor-spike ((this fort-floor-spike)) +(defmethod init-periodic-animation! ((this fort-floor-spike)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (the-as symbol 0) ) @@ -168,7 +160,7 @@ ) ;; WARN: Return type mismatch process-drawable vs fort-floor-spike. -(defmethod relocate fort-floor-spike ((this fort-floor-spike) (arg0 int)) +(defmethod relocate ((this fort-floor-spike) (arg0 int)) (if (nonzero? (-> this spike-row)) (&+! (-> this spike-row) arg0) ) @@ -176,7 +168,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-floor-spike ((this fort-floor-spike) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-floor-spike) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -220,14 +212,10 @@ This commonly includes things such as: (deftype fort-floor-spike-a (fort-floor-spike) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe8 - :flag-assert #x18007000e8 ) -(defmethod init-spike-joints! fort-floor-spike-a ((this fort-floor-spike-a)) +(defmethod init-spike-joints! ((this fort-floor-spike-a)) "Initializes the skeleton and joints for the spike" (initialize-skeleton this @@ -247,7 +235,7 @@ This commonly includes things such as: (none) ) -(defmethod init-spike-collision! fort-floor-spike-a ((this fort-floor-spike-a)) +(defmethod init-spike-collision! ((this fort-floor-spike-a)) "Initializes the collision for the particular spike" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape-moving)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -301,7 +289,7 @@ This commonly includes things such as: ) ) -(defmethod init-periodic-animation! fort-floor-spike-a ((this fort-floor-spike-a)) +(defmethod init-periodic-animation! ((this fort-floor-spike-a)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (local-vars (sv-64 cspace)) (let ((s5-0 2) @@ -362,14 +350,10 @@ This commonly includes things such as: (deftype fort-floor-spike-b (fort-floor-spike) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe8 - :flag-assert #x18007000e8 ) -(defmethod init-spike-joints! fort-floor-spike-b ((this fort-floor-spike-b)) +(defmethod init-spike-joints! ((this fort-floor-spike-b)) "Initializes the skeleton and joints for the spike" (initialize-skeleton this @@ -389,7 +373,7 @@ This commonly includes things such as: (none) ) -(defmethod init-spike-collision! fort-floor-spike-b ((this fort-floor-spike-b)) +(defmethod init-spike-collision! ((this fort-floor-spike-b)) "Initializes the collision for the particular spike" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape-moving)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -454,7 +438,7 @@ This commonly includes things such as: ) ) -(defmethod init-periodic-animation! fort-floor-spike-b ((this fort-floor-spike-b)) +(defmethod init-periodic-animation! ((this fort-floor-spike-b)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (local-vars (sv-64 cspace)) (let ((s5-0 2) @@ -517,14 +501,10 @@ This commonly includes things such as: (deftype fort-floor-spike-c (fort-floor-spike) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe8 - :flag-assert #x18007000e8 ) -(defmethod init-spike-joints! fort-floor-spike-c ((this fort-floor-spike-c)) +(defmethod init-spike-joints! ((this fort-floor-spike-c)) "Initializes the skeleton and joints for the spike" (initialize-skeleton this @@ -544,7 +524,7 @@ This commonly includes things such as: (none) ) -(defmethod init-spike-collision! fort-floor-spike-c ((this fort-floor-spike-c)) +(defmethod init-spike-collision! ((this fort-floor-spike-c)) "Initializes the collision for the particular spike" (local-vars (prim-mesh collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape-moving)) (let ((cshape-moving (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -614,7 +594,7 @@ This commonly includes things such as: ) ) -(defmethod init-periodic-animation! fort-floor-spike-c ((this fort-floor-spike-c)) +(defmethod init-periodic-animation! ((this fort-floor-spike-c)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (local-vars (sv-64 cspace)) (let ((s5-0 3) diff --git a/goal_src/jak2/levels/common/entities/gun-buoy.gc b/goal_src/jak2/levels/common/entities/gun-buoy.gc index 90b903245c4..48ee53d288d 100644 --- a/goal_src/jak2/levels/common/entities/gun-buoy.gc +++ b/goal_src/jak2/levels/common/entities/gun-buoy.gc @@ -27,14 +27,10 @@ (deftype gun-buoy-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) -(defmethod play-impact-sound gun-buoy-shot ((this gun-buoy-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this gun-buoy-shot) (arg0 projectile-options)) (if (zero? arg0) (sound-play "buoy-shot") ) @@ -116,7 +112,7 @@ ) ) -(defmethod init-proj-collision! gun-buoy-shot ((this gun-buoy-shot)) +(defmethod init-proj-collision! ((this gun-buoy-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -163,7 +159,7 @@ (none) ) -(defmethod init-proj-settings! gun-buoy-shot ((this gun-buoy-shot)) +(defmethod init-proj-settings! ((this gun-buoy-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this hit-actor?) #f) (set! (-> this tail-pos quad) (-> this root trans quad)) @@ -285,36 +281,34 @@ (set! (-> *gun-buoy-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (deftype gun-buoy (nav-enemy) - ((gun-elev-jmod joint-mod :offset-assert 604) - (start-pos vector :inline :offset-assert 608) - (aim-dir vector :inline :offset-assert 624) - (banking-quat quaternion :inline :offset 656) - (offset-from-player vector :inline :offset-assert 672) - (offset-y-angular float :offset-assert 688) - (elev-angle float :offset-assert 692) - (y-final float :offset-assert 696) - (y-offset float :offset-assert 700) - (y-bob float :offset-assert 704) - (y-speed float :offset-assert 708) - (warning-interval time-frame :offset-assert 712) - (warning-timer time-frame :offset-assert 720) - (splash-timer time-frame :offset-assert 728) - (stare-down-timer time-frame :offset-assert 736) - (warning-id sound-id :offset-assert 744) - (voice-id sound-id :offset-assert 748) - (flags gun-buoy-flags :offset-assert 752) + ((gun-elev-jmod joint-mod) + (start-pos vector :inline) + (aim-dir vector :inline) + (banking-quat quaternion :inline :offset 656) + (offset-from-player vector :inline) + (offset-y-angular float) + (elev-angle float) + (y-final float) + (y-offset float) + (y-bob float) + (y-speed float) + (warning-interval time-frame) + (warning-timer time-frame) + (splash-timer time-frame) + (stare-down-timer time-frame) + (warning-id sound-id) + (voice-id sound-id) + (flags gun-buoy-flags) ) - :heap-base #x280 - :method-count-assert 184 - :size-assert #x2f2 - :flag-assert #xb8028002f2 + (:state-methods + attack + exit-ambush + warning + stare-down + open-guns + ) (:methods - (attack () _type_ :state 178) - (exit-ambush () _type_ :state 179) - (warning () _type_ :state 180) - (stare-down () _type_ :state 181) - (open-guns () _type_ :state 182) - (gun-buoy-method-183 (_type_ process-focusable) none 183) + (gun-buoy-method-183 (_type_ process-focusable) none) ) ) @@ -879,7 +873,7 @@ ) ) -(defmethod general-event-handler gun-buoy ((this gun-buoy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this gun-buoy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -892,7 +886,7 @@ ) ) -(defmethod track-target! gun-buoy ((this gun-buoy)) +(defmethod track-target! ((this gun-buoy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -964,20 +958,20 @@ (none) ) -(defmethod go-hostile gun-buoy ((this gun-buoy)) +(defmethod go-hostile ((this gun-buoy)) (if (logtest? (-> this flags) (gun-buoy-flags gubflags-1)) (go (method-of-object this hostile)) (go (method-of-object this warning)) ) ) -(defmethod enemy-method-61 gun-buoy ((this gun-buoy) (arg0 int)) +(defmethod enemy-method-61 ((this gun-buoy) (arg0 int)) arg0 ) ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 40. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod in-aggro-range? gun-buoy ((this gun-buoy) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this gun-buoy) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -1046,7 +1040,7 @@ ) ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod gun-buoy-method-183 gun-buoy ((this gun-buoy) (arg0 process-focusable)) +(defmethod gun-buoy-method-183 ((this gun-buoy) (arg0 process-focusable)) (let ((s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8))) (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 10))) (s4-0 (new 'stack-no-clear 'projectile-init-by-other-params)) @@ -1080,7 +1074,7 @@ (none) ) -(defmethod nav-enemy-method-142 gun-buoy ((this gun-buoy) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this gun-buoy) (arg0 nav-control)) (local-vars (a0-19 int) (a0-21 int)) (let* ((v1-1 (-> *perf-stats* data 33)) (a0-1 (-> v1-1 ctrl)) @@ -1148,7 +1142,7 @@ ) ;; WARN: Return type mismatch nav-enemy vs gun-buoy. -(defmethod relocate gun-buoy ((this gun-buoy) (arg0 int)) +(defmethod relocate ((this gun-buoy) (arg0 int)) (if (nonzero? (-> this gun-elev-jmod)) (&+! (-> this gun-elev-jmod) arg0) ) @@ -1156,7 +1150,7 @@ ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! gun-buoy ((this gun-buoy)) +(defmethod init-enemy-collision! ((this gun-buoy)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1210,7 +1204,7 @@ (none) ) -(defmethod init-enemy! gun-buoy ((this gun-buoy)) +(defmethod init-enemy! ((this gun-buoy)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/common/entities/spydroid.gc b/goal_src/jak2/levels/common/entities/spydroid.gc index 29c863bca6d..bffa5604738 100644 --- a/goal_src/jak2/levels/common/entities/spydroid.gc +++ b/goal_src/jak2/levels/common/entities/spydroid.gc @@ -495,20 +495,16 @@ ) (deftype spydroid (nav-enemy) - ((old-y-deg float :offset-assert 604) - (diff-angle float :offset-assert 608) - (desire-turn symbol :offset-assert 612) - (hit-target basic :offset-assert 616) - (lightning lightning-control 4 :offset-assert 620) - (floor float :offset-assert 636) - (explode-part sparticle-launch-control :offset-assert 640) + ((old-y-deg float) + (diff-angle float) + (desire-turn symbol) + (hit-target basic) + (lightning lightning-control 4) + (floor float) + (explode-part sparticle-launch-control) ) - :heap-base #x210 - :method-count-assert 179 - :size-assert #x284 - :flag-assert #xb302100284 - (:methods - (attack () _type_ :state 178) + (:state-methods + attack ) ) @@ -624,7 +620,7 @@ (set! (-> *spydroid-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod track-target! spydroid ((this spydroid)) +(defmethod track-target! ((this spydroid)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -722,7 +718,7 @@ (none) ) -(defmethod general-event-handler spydroid ((this spydroid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this spydroid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-6 vector) (sv-144 vector)) @@ -1249,7 +1245,7 @@ ) ) -(defmethod init-enemy-collision! spydroid ((this spydroid)) +(defmethod init-enemy-collision! ((this spydroid)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1295,12 +1291,12 @@ (none) ) -(defmethod coin-flip? spydroid ((this spydroid)) +(defmethod coin-flip? ((this spydroid)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod deactivate spydroid ((this spydroid)) +(defmethod deactivate ((this spydroid)) (if (nonzero? (-> this explode-part)) (kill-and-free-particles (-> this explode-part)) ) @@ -1309,7 +1305,7 @@ ) ;; WARN: Return type mismatch nav-enemy vs spydroid. -(defmethod relocate spydroid ((this spydroid) (arg0 int)) +(defmethod relocate ((this spydroid) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this lightning v1-0)) (&+! (-> this lightning v1-0) arg0) @@ -1323,7 +1319,7 @@ (the-as spydroid ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod init-enemy! spydroid ((this spydroid)) +(defmethod init-enemy! ((this spydroid)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/common/guard-projectile.gc b/goal_src/jak2/levels/common/guard-projectile.gc index f56dc9733a3..eb98f7facdc 100644 --- a/goal_src/jak2/levels/common/guard-projectile.gc +++ b/goal_src/jak2/levels/common/guard-projectile.gc @@ -311,17 +311,13 @@ ) (deftype guard-shot (projectile) - ((hit-actor? symbol :offset-assert 472) - (tail-pos vector :inline :offset-assert 480) + ((hit-actor? symbol) + (tail-pos vector :inline) ) - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) -(defmethod deal-damage! guard-shot ((this guard-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! ((this guard-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((t9-0 (method-of-type projectile deal-damage!))) (when (t9-0 this arg0 arg1) @@ -331,7 +327,7 @@ ) ) -(defmethod draw-laser-sight guard-shot ((this guard-shot)) +(defmethod draw-laser-sight ((this guard-shot)) "TODO - confirm If applicable, draw the laser sight particles" (draw-beam (-> *part-id-table* 610) (-> this tail-pos) (-> this starting-dir) #f #t) (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) @@ -348,7 +344,7 @@ (none) ) -(defmethod spawn-impact-particles guard-shot ((this guard-shot)) +(defmethod spawn-impact-particles ((this guard-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -405,7 +401,7 @@ ) ) -(defmethod spawn-shell-particles guard-shot ((this guard-shot)) +(defmethod spawn-shell-particles ((this guard-shot)) "TODO - confirm" (let* ((s4-0 (-> this root)) (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) @@ -494,7 +490,7 @@ (none) ) -(defmethod play-impact-sound guard-shot ((this guard-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this guard-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -557,7 +553,7 @@ (none) ) -(defmethod made-impact? guard-shot ((this guard-shot)) +(defmethod made-impact? ((this guard-shot)) "TODO - queries the collision cache, return true/false" (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) @@ -579,7 +575,7 @@ ) ) -(defmethod init-proj-collision! guard-shot ((this guard-shot)) +(defmethod init-proj-collision! ((this guard-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -632,7 +628,7 @@ (none) ) -(defmethod init-proj-settings! guard-shot ((this guard-shot)) +(defmethod init-proj-settings! ((this guard-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this hit-actor?) #f) (set! (-> this tail-pos quad) (-> this root trans quad)) @@ -647,12 +643,8 @@ ) (deftype vehicle-grenade (projectile-bounce) - ((blast-radius float :offset-assert 496) + ((blast-radius float) ) - :heap-base #x180 - :method-count-assert 42 - :size-assert #x1f4 - :flag-assert #x2a018001f4 ) @@ -662,7 +654,7 @@ :texture-level 6 ) -(defmethod play-impact-sound vehicle-grenade ((this vehicle-grenade) (arg0 projectile-options)) +(defmethod play-impact-sound ((this vehicle-grenade) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -677,7 +669,7 @@ (none) ) -(defmethod init-proj-collision! vehicle-grenade ((this vehicle-grenade)) +(defmethod init-proj-collision! ((this vehicle-grenade)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -712,7 +704,7 @@ (none) ) -(defmethod init-proj-settings! vehicle-grenade ((this vehicle-grenade)) +(defmethod init-proj-settings! ((this vehicle-grenade)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this attack-mode) 'eco-dark) (initialize-skeleton @@ -731,7 +723,7 @@ (none) ) -(defmethod spawn-impact-particles vehicle-grenade ((this vehicle-grenade)) +(defmethod spawn-impact-particles ((this vehicle-grenade)) "Spawns associated particles with the projectile if applicable" (spawn (-> this part) (-> this root trans)) (ja-post) @@ -739,7 +731,7 @@ (none) ) -(defmethod noop vehicle-grenade ((this vehicle-grenade)) +(defmethod noop ((this vehicle-grenade)) "Does nothing" (spawn (-> this part) (-> this root trans)) 0 @@ -747,7 +739,7 @@ ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound! vehicle-grenade ((this vehicle-grenade)) +(defmethod play-impact-sound! ((this vehicle-grenade)) "Plays impact sound" (let* ((a2-0 (-> this root)) (v1-0 (-> a2-0 status)) @@ -886,10 +878,6 @@ (deftype guard-lazer-shot (projectile) () - :heap-base #x160 - :method-count-assert 40 - :size-assert #x1d8 - :flag-assert #x28016001d8 ) @@ -900,7 +888,7 @@ ) ) -(defmethod made-impact? guard-lazer-shot ((this guard-lazer-shot)) +(defmethod made-impact? ((this guard-lazer-shot)) "TODO - queries the collision cache, return true/false" (let ((gp-0 (-> this root)) (s5-0 (new 'stack-no-clear 'collide-query)) @@ -934,7 +922,7 @@ (none) ) -(defmethod init-proj-collision! guard-lazer-shot ((this guard-lazer-shot)) +(defmethod init-proj-collision! ((this guard-lazer-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -981,7 +969,7 @@ (none) ) -(defmethod init-proj-settings! guard-lazer-shot ((this guard-lazer-shot)) +(defmethod init-proj-settings! ((this guard-lazer-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this attack-mode) 'shock) (set! (-> this max-speed) 131072.0) diff --git a/goal_src/jak2/levels/common/metalhead-projectile.gc b/goal_src/jak2/levels/common/metalhead-projectile.gc index 10ca964c3ed..f787bbe16d1 100644 --- a/goal_src/jak2/levels/common/metalhead-projectile.gc +++ b/goal_src/jak2/levels/common/metalhead-projectile.gc @@ -309,16 +309,12 @@ ) (deftype metalhead-shot (projectile) - ((tail-pos vector :inline :offset-assert 480) + ((tail-pos vector :inline) ) - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) -(defmethod draw-laser-sight metalhead-shot ((this metalhead-shot)) +(defmethod draw-laser-sight ((this metalhead-shot)) "TODO - confirm If applicable, draw the laser sight particles" (draw-beam (-> *part-id-table* 624) (-> this tail-pos) (-> this starting-dir) #f #t) (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) @@ -335,7 +331,7 @@ (none) ) -(defmethod spawn-impact-particles metalhead-shot ((this metalhead-shot)) +(defmethod spawn-impact-particles ((this metalhead-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -391,7 +387,7 @@ ) ) -(defmethod spawn-shell-particles metalhead-shot ((this metalhead-shot)) +(defmethod spawn-shell-particles ((this metalhead-shot)) "TODO - confirm" (let* ((s5-0 (-> this root)) (v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s5-0 trans)) 2048.0)) @@ -440,7 +436,7 @@ ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound metalhead-shot ((this metalhead-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this metalhead-shot) (arg0 projectile-options)) (with-pp (case arg0 (((projectile-options lose-altitude proj-options-2)) @@ -491,7 +487,7 @@ (none) ) -(defmethod init-proj-collision! metalhead-shot ((this metalhead-shot)) +(defmethod init-proj-collision! ((this metalhead-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -543,7 +539,7 @@ (none) ) -(defmethod init-proj-settings! metalhead-shot ((this metalhead-shot)) +(defmethod init-proj-settings! ((this metalhead-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'metalhead-shot) @@ -661,17 +657,13 @@ ) (deftype metalhead-grenade-shot (projectile) - ((tumble-quat quaternion :inline :offset-assert 480) - (blast-radius float :offset-assert 496) + ((tumble-quat quaternion :inline) + (blast-radius float) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x1f4 - :flag-assert #x28018001f4 ) -(defmethod spawn-shell-particles metalhead-grenade-shot ((this metalhead-grenade-shot)) +(defmethod spawn-shell-particles ((this metalhead-grenade-shot)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -707,7 +699,7 @@ (none) ) -(defmethod play-impact-sound metalhead-grenade-shot ((this metalhead-grenade-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this metalhead-grenade-shot) (arg0 projectile-options)) (case arg0 (((projectile-options lose-altitude)) (sound-play "gren-shot-hit") @@ -800,7 +792,7 @@ ) ) -(defmethod spawn-impact-particles metalhead-grenade-shot ((this metalhead-grenade-shot)) +(defmethod spawn-impact-particles ((this metalhead-grenade-shot)) "Spawns associated particles with the projectile if applicable" (spawn (-> this part) (-> this root trans)) 0 @@ -843,7 +835,7 @@ (none) ) -(defmethod init-proj-collision! metalhead-grenade-shot ((this metalhead-grenade-shot)) +(defmethod init-proj-collision! ((this metalhead-grenade-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -880,7 +872,7 @@ ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-proj-settings! metalhead-grenade-shot ((this metalhead-grenade-shot)) +(defmethod init-proj-settings! ((this metalhead-grenade-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this attack-mode) 'eco-yellow) (set! (-> this blast-radius) 4096.0) diff --git a/goal_src/jak2/levels/common/race/race-h.gc b/goal_src/jak2/levels/common/race/race-h.gc index 1820681cc94..c53af1b52e0 100644 --- a/goal_src/jak2/levels/common/race/race-h.gc +++ b/goal_src/jak2/levels/common/race/race-h.gc @@ -61,196 +61,176 @@ (all-dead) ) +(deftype mystery-race-manager-type (structure) + "stack slot 16 in race-state::initialize" + ((mat matrix :inline) + (vec0 vector :inline) + (vec1 vector :inline) + (word int32) + ) + ) + ;; DECOMP BEGINS (deftype race-turbo-pad (structure) - ((position vector :inline :offset-assert 0) - (handle handle :offset-assert 16) + ((position vector :inline) + (handle handle) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype race-decision-point (structure) - ((pos float :offset-assert 0) - (decision-type uint8 :offset-assert 4) - (shortcuts uint8 :offset-assert 5) - (safe-paths uint8 :offset-assert 6) + ((pos float) + (decision-type uint8) + (shortcuts uint8) + (safe-paths uint8) ) - :method-count-assert 9 - :size-assert #x7 - :flag-assert #x900000007 ) (deftype race-racer-info (structure) - ((rider uint8 :offset-assert 0) - (vehicle uint8 :offset-assert 1) - (flags racer-info-flags :offset-assert 2) - (seek-offset int8 :offset-assert 3) + ((rider uint8) + (vehicle uint8) + (flags racer-info-flags) + (seek-offset int8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype race-info (basic) - ((race-mesh-name string :offset-assert 4) - (path-group-name string :offset-assert 8) - (task-node game-task-node :offset-assert 12) - (mesh race-mesh :offset-assert 16) - (ai-min-speed-factor float :offset-assert 20) - (ai-max-speed-factor float :offset-assert 24) - (ai-spread-factor float :offset-assert 28) - (start-sphere sphere :inline :offset-assert 32) - (start-dir vector :inline :offset-assert 48) - (finish-sphere sphere :inline :offset-assert 64) - (finish-dir vector :inline :offset-assert 80) - (player-intro-pos vector :inline :offset-assert 96) - (flags race-info-flags :offset-assert 112) - (score uint8 :offset-assert 113) - (lap-count int8 :offset-assert 114) - (racer-count int8 :offset-assert 115) - (turbo-pad-count int8 :offset-assert 116) - (map-index int8 :offset-assert 117) - (decision-point-count int8 :offset-assert 118) - (safe-paths uint8 :offset-assert 119) - (turbo-pad-array (inline-array race-turbo-pad) :offset-assert 120) - (racer-array (inline-array race-racer-info) :offset-assert 124) - (decision-point-array (inline-array race-decision-point) :offset-assert 128) - (level symbol :offset-assert 132) - (borrow-level symbol :offset-assert 136) - (borrow pair :offset-assert 140) - (manager handle :offset-assert 144) - (manager-handle-init-hack basic :offset 144) - (hatch-actor-name string :offset-assert 152) - (countdown-scene string :offset-assert 156) - (complete-continue string :offset-assert 160) - (start-camera string :offset-assert 164) - (go-speech uint16 :offset-assert 168) + ((race-mesh-name string) + (path-group-name string) + (task-node game-task-node) + (mesh race-mesh) + (ai-min-speed-factor float) + (ai-max-speed-factor float) + (ai-spread-factor float) + (start-sphere sphere :inline) + (start-dir vector :inline) + (finish-sphere sphere :inline) + (finish-dir vector :inline) + (player-intro-pos vector :inline) + (flags race-info-flags) + (score uint8) + (lap-count int8) + (racer-count int8) + (turbo-pad-count int8) + (map-index int8) + (decision-point-count int8) + (safe-paths uint8) + (turbo-pad-array (inline-array race-turbo-pad)) + (racer-array (inline-array race-racer-info)) + (decision-point-array (inline-array race-decision-point)) + (level symbol) + (borrow-level symbol) + (borrow pair) + (manager handle) + (manager-handle-init-hack basic :overlay-at manager) + (hatch-actor-name string) + (countdown-scene string) + (complete-continue string) + (start-camera string) + (go-speech uint16) ) - :method-count-assert 10 - :size-assert #xaa - :flag-assert #xa000000aa (:methods - (initialize-mesh (_type_) none 9) + (initialize-mesh (_type_) none) ) ) (deftype racer-state (structure) - ((position vector :inline :offset-assert 0) - (racer handle :offset-assert 16) - (flags racer-flags :offset-assert 24) - (rank int8 :offset-assert 25) - (finish-count int8 :offset-assert 26) - (lap-count int8 :offset-assert 27) - (lap-quadrant int8 :offset-assert 28) - (rider uint8 :offset-assert 29) - (lap-distance float :offset-assert 32) - (lap-distance-prev float :offset-assert 36) - (pos float :offset-assert 40) - (target-pos-offset float :offset-assert 44) - (speed-factor float :offset-assert 48) - (finish-time uint32 :offset-assert 52) - (lap-start uint32 :offset-assert 56) - (best-lap-time uint32 :offset-assert 60) - (lap-time-array float 5 :offset-assert 64) - (start-position vector :inline :offset-assert 96) + ((position vector :inline) + (racer handle) + (flags racer-flags) + (rank int8) + (finish-count int8) + (lap-count int8) + (lap-quadrant int8) + (rider uint8) + (lap-distance float) + (lap-distance-prev float) + (pos float) + (target-pos-offset float) + (speed-factor float) + (finish-time uint32) + (lap-start uint32) + (best-lap-time uint32) + (lap-time-array float 5) + (start-position vector :inline) ) - :method-count-assert 14 - :size-assert #x70 - :flag-assert #xe00000070 (:methods - (update-lap-distance (_type_ race-state) none 9) - (begin-lap (_type_ race-state) none 10) - (end-lap (_type_ race-state) none 11) - (print-laps (_type_ race-state string) none 12) - (init-racer! (_type_ process-drawable) none 13) + (update-lap-distance (_type_ race-state) none) + (begin-lap (_type_ race-state) none) + (end-lap (_type_ race-state) none) + (print-laps (_type_ race-state string) none) + (init-racer! (_type_ process-drawable) none) ) ) (deftype race-state (structure) - ((info race-info :offset-assert 0) - (flags race-flags :offset-assert 4) - (state race-state-enum :offset-assert 5) - (racer-count int8 :offset-assert 6) - (finished-count int8 :offset-assert 7) - (i-player int8 :offset-assert 8) - (i-countdown int8 :offset-assert 9) - (manager handle :offset-assert 16) - (scene-player handle :offset-assert 24) - (race-signal handle :offset-assert 32) - (arrow handle :offset-assert 40) - (hud-timer handle :offset-assert 48) - (hud-lap-counter handle :offset-assert 56) - (hud-turbo-counter handle :offset-assert 64) - (hud-position handle :offset-assert 72) - (current-time uint32 :offset-assert 80) - (countdown-start-time uint32 :offset-assert 84) - (race-start-time uint32 :offset-assert 88) - (rankings int8 10 :offset-assert 92) - (target-pos float :offset-assert 104) - (suck-factor float :offset-assert 108) - (racer-array racer-state 10 :inline :offset-assert 112) - (player-intro-curve cubic-curve :inline :offset-assert 1232) + ((info race-info) + (flags race-flags) + (state race-state-enum) + (racer-count int8) + (finished-count int8) + (i-player int8) + (i-countdown int8) + (manager handle) + (scene-player handle) + (race-signal handle) + (arrow handle) + (hud-timer handle) + (hud-lap-counter handle) + (hud-turbo-counter handle) + (hud-position handle) + (current-time uint32) + (countdown-start-time uint32) + (race-start-time uint32) + (rankings int8 10) + (target-pos float) + (suck-factor float) + (racer-array racer-state 10 :inline) + (player-intro-curve cubic-curve :inline) ) - :method-count-assert 19 - :size-assert #x510 - :flag-assert #x1300000510 (:methods - (init-racers! (_type_ process-drawable) none 9) - (begin-race (_type_) none 10) - (update (_type_) none 11) - (update-rankings (_type_) none 12) - (debug-print-rankings (_type_) none 13) - (update-racers (_type_) none 14) - (spawn-race-signal (_type_) none 15) - (initialize (_type_ process race-info) none 16) - (set-speech-tables! (_type_) none 17) - (setup-race (_type_) none 18) + (init-racers! (_type_ process-drawable) none) + (begin-race (_type_) none) + (update (_type_) none) + (update-rankings (_type_) none) + (debug-print-rankings (_type_) none) + (update-racers (_type_) none) + (spawn-race-signal (_type_) none) + (initialize (_type_ process race-info) none) + (set-speech-tables! (_type_) none) + (setup-race (_type_) none) ) ) (deftype race-manager (process) - ((race-state race-state :offset-assert 128) - (state-time time-frame :offset-assert 136) - (player-on-track-time time-frame :offset-assert 144) - (message-id sound-id :offset-assert 152) - (finish-sound-id sound-id :offset-assert 156) + ((race-state race-state) + (state-time time-frame) + (player-on-track-time time-frame) + (message-id sound-id) + (finish-sound-id sound-id) ) - :heap-base #x20 - :method-count-assert 28 - :size-assert #xa0 - :flag-assert #x1c002000a0 + (:state-methods + idle + active + fail + win + lose + die + ) (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (fail () _type_ :state 16) - (win () _type_ :state 17) - (lose () _type_ :state 18) - (die () _type_ :state 19) - (update (_type_) int 20) - (initialize-state (_type_) none 21) - (race-manager-method-22 (_type_) none 22) - (initialize-race-state (_type_) none 23) - (draw-message-continue (_type_) none 24) - (draw-message-retry (_type_) none 25) - (save-score (_type_ float) none 26) - (stop-speech (_type_) none 27) + (update (_type_) int) + (initialize-state (_type_) none) + (race-manager-method-22 (_type_) none) + (initialize-race-state (_type_) none) + (draw-message-continue (_type_) none) + (draw-message-retry (_type_) none) + (save-score (_type_ float) none) + (stop-speech (_type_) none) ) - ) - -(deftype mystery-race-manager-type (structure) - "stack slot 16 in race-state::initialize" - ((mat matrix :inline) - (vec0 vector :inline) - (vec1 vector :inline) - (word int32) - ) ) \ No newline at end of file diff --git a/goal_src/jak2/levels/common/race/race-hud.gc b/goal_src/jak2/levels/common/race/race-hud.gc index 183053b8e4e..dcc9b08598e 100644 --- a/goal_src/jak2/levels/common/race/race-hud.gc +++ b/goal_src/jak2/levels/common/race/race-hud.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod draw hud-race-timer ((this hud-race-timer)) +(defmethod draw ((this hud-race-timer)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 0 @@ -35,7 +35,7 @@ (none) ) -(defmethod update-values hud-race-timer ((this hud-race-timer)) +(defmethod update-values ((this hud-race-timer)) (set! (-> this values 0 target) (/ (the-as int (-> *game-info* race-timer)) (seconds 60))) (set! (-> this values 1 target) (/ (mod (the-as int (-> *game-info* race-timer)) (seconds 60)) (seconds 1))) ;(set! (-> this values 2 target) (/ (mod (mod (the-as int (-> *game-info* race-timer)) (seconds 60)) (seconds 1)) (/ (seconds 1) 60))) @@ -47,7 +47,7 @@ (none) ) -(defmethod init-callback hud-race-timer ((this hud-race-timer)) +(defmethod init-callback ((this hud-race-timer)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) @@ -71,7 +71,7 @@ (none) ) -(defmethod draw hud-race-lap-counter ((this hud-race-lap-counter)) +(defmethod draw ((this hud-race-lap-counter)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 504 @@ -87,7 +87,7 @@ (none) ) -(defmethod update-values hud-race-lap-counter ((this hud-race-lap-counter)) +(defmethod update-values ((this hud-race-lap-counter)) (set! (-> this values 0 target) (-> *game-info* race-current-lap-count)) (set! (-> this values 1 target) (-> *game-info* race-total-lap-count)) (logclear! (-> this flags) (hud-flags disable)) @@ -96,7 +96,7 @@ (none) ) -(defmethod init-callback hud-race-lap-counter ((this hud-race-lap-counter)) +(defmethod init-callback ((this hud-race-lap-counter)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -112,7 +112,7 @@ (none) ) -(defmethod draw hud-race-turbo-counter ((this hud-race-turbo-counter)) +(defmethod draw ((this hud-race-turbo-counter)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 224 @@ -152,7 +152,7 @@ (none) ) -(defmethod update-values hud-race-turbo-counter ((this hud-race-turbo-counter)) +(defmethod update-values ((this hud-race-turbo-counter)) (set! (-> this values 0 target) (-> *game-info* race-number-turbos)) (logclear! (-> this flags) (hud-flags disable)) ((method-of-type hud update-values) this) @@ -160,7 +160,7 @@ (none) ) -(defmethod init-callback hud-race-turbo-counter ((this hud-race-turbo-counter)) +(defmethod init-callback ((this hud-race-turbo-counter)) (set! (-> this level) (level-get *level* 'stadium)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) @@ -176,7 +176,7 @@ (none) ) -(defmethod draw hud-race-position ((this hud-race-position)) +(defmethod draw ((this hud-race-position)) (local-vars (s5-0 int)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) @@ -238,7 +238,7 @@ (none) ) -(defmethod update-values hud-race-position ((this hud-race-position)) +(defmethod update-values ((this hud-race-position)) (set! (-> this values 0 target) (-> *game-info* race-position)) (logclear! (-> this flags) (hud-flags disable)) ((method-of-type hud update-values) this) @@ -246,7 +246,7 @@ (none) ) -(defmethod init-callback hud-race-position ((this hud-race-position)) +(defmethod init-callback ((this hud-race-position)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-lower-left) (gui-action hidden) (-> this name) 81920.0 0) @@ -284,7 +284,7 @@ (/ (mod (mod arg0 #x4650) 300) 5) ) -(defmethod draw hud-race-final-stats ((this hud-race-final-stats)) +(defmethod draw ((this hud-race-final-stats)) (local-vars (s0-0 int) (sv-112 (function string font-context symbol int bucket-id float)) @@ -438,14 +438,14 @@ (none) ) -(defmethod update-values hud-race-final-stats ((this hud-race-final-stats)) +(defmethod update-values ((this hud-race-final-stats)) (logclear! (-> this flags) (hud-flags disable)) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-race-final-stats ((this hud-race-final-stats)) +(defmethod init-callback ((this hud-race-final-stats)) (set! (-> this level) (level-get *level* 'stadium)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) diff --git a/goal_src/jak2/levels/common/race/race-info.gc b/goal_src/jak2/levels/common/race/race-info.gc index bd771632036..9a5b8701701 100644 --- a/goal_src/jak2/levels/common/race/race-info.gc +++ b/goal_src/jak2/levels/common/race/race-info.gc @@ -662,7 +662,7 @@ ) ) -(defmethod set-speech-tables! race-state ((this race-state)) +(defmethod set-speech-tables! ((this race-state)) (speech-table-set! *speech-control* (speech-type speech-type-30) diff --git a/goal_src/jak2/levels/common/race/race-manager.gc b/goal_src/jak2/levels/common/race/race-manager.gc index 92a34828c09..30a74a248a3 100644 --- a/goal_src/jak2/levels/common/race/race-manager.gc +++ b/goal_src/jak2/levels/common/race/race-manager.gc @@ -60,7 +60,7 @@ ) ) -(defmethod initialize-mesh race-info ((this race-info)) +(defmethod initialize-mesh ((this race-info)) (let ((v1-0 (entity-by-name (-> this race-mesh-name)))) (cond (v1-0 @@ -109,7 +109,7 @@ (none) ) -(defmethod begin-lap racer-state ((this racer-state) (arg0 race-state)) +(defmethod begin-lap ((this racer-state) (arg0 race-state)) (format #t "begin-lap racer ~d~%" (-> this rank)) (set! (-> this lap-start) (-> arg0 current-time)) (logior! (-> this flags) (racer-flags in-race)) @@ -117,7 +117,7 @@ (none) ) -(defmethod end-lap racer-state ((this racer-state) (arg0 race-state)) +(defmethod end-lap ((this racer-state) (arg0 race-state)) (+! (-> this lap-count) 1) (format #t "end-lap ~d racer ~d~%" (-> this lap-count) (-> this rank)) (let ((v1-2 4) @@ -194,7 +194,7 @@ (none) ) -(defmethod update-lap-distance racer-state ((this racer-state) (arg0 race-state)) +(defmethod update-lap-distance ((this racer-state) (arg0 race-state)) (local-vars (a0-29 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -309,7 +309,7 @@ ) ) -(defmethod print-laps racer-state ((this racer-state) (arg0 race-state) (arg1 string)) +(defmethod print-laps ((this racer-state) (arg0 race-state) (arg1 string)) (let ((s4-0 (- (-> arg0 current-time) (-> this lap-start)))) (format arg1 "lap count ~d~%" (-> this lap-count)) (format arg1 "best lap ") @@ -332,7 +332,7 @@ (none) ) -(defmethod init-racer! racer-state ((this racer-state) (arg0 process-drawable)) +(defmethod init-racer! ((this racer-state) (arg0 process-drawable)) (set! (-> this racer) (process->handle arg0)) (set! (-> this position quad) (-> arg0 root trans quad)) (set! (-> this flags) (racer-flags unknown)) @@ -349,7 +349,7 @@ (none) ) -(defmethod init-racers! race-state ((this race-state) (arg0 process-drawable)) +(defmethod init-racers! ((this race-state) (arg0 process-drawable)) (let ((v1-0 (-> this racer-count))) (when (< v1-0 10) (+! (-> this racer-count) 1) @@ -360,7 +360,7 @@ (none) ) -(defmethod begin-race race-state ((this race-state)) +(defmethod begin-race ((this race-state)) (format #t "begin-race~%") (when (not (logtest? (-> this flags) (race-flags begun))) (logior! (-> this flags) (race-flags begun)) @@ -406,7 +406,7 @@ (none) ) -(defmethod update-rankings race-state ((this race-state)) +(defmethod update-rankings ((this race-state)) (let ((v1-0 (new 'stack-no-clear 'array 'float 10))) (dotimes (a0-1 (-> this racer-count)) (let ((a1-3 (-> this racer-array a0-1))) @@ -457,7 +457,7 @@ (none) ) -(defmethod debug-print-rankings race-state ((this race-state)) +(defmethod debug-print-rankings ((this race-state)) (dotimes (s5-0 (-> this racer-count)) (let* ((s4-0 (-> this rankings s5-0)) (s3-0 (-> this racer-array s4-0)) @@ -500,7 +500,7 @@ (none) ) -(defmethod update-racers race-state ((this race-state)) +(defmethod update-racers ((this race-state)) (let ((s5-0 0)) (dotimes (s4-0 (-> this racer-count)) (let ((s3-0 (-> this racer-array s4-0))) @@ -519,7 +519,7 @@ (none) ) -(defmethod setup-race race-state ((this race-state)) +(defmethod setup-race ((this race-state)) (set-setting! 'allow-progress #f 0.0 0) (send-event (handle->process (-> this arrow)) 'leave) (when (logtest? (-> this info flags) (race-info-flags borrow)) @@ -558,7 +558,7 @@ (none) ) -(defmethod update race-state ((this race-state)) +(defmethod update ((this race-state)) (set! (-> this current-time) (the-as uint (current-time))) (case (-> this state) (((race-state-enum idle)) @@ -740,7 +740,7 @@ (none) ) -(defmethod spawn-race-signal race-state ((this race-state)) +(defmethod spawn-race-signal ((this race-state)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -788,7 +788,7 @@ ) ) -(defmethod initialize race-state ((this race-state) (arg0 process) (arg1 race-info)) +(defmethod initialize ((this race-state) (arg0 process) (arg1 race-info)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -893,7 +893,7 @@ (define *race-rigid-body-queue* (new 'static 'rigid-body-queue)) -(defmethod update race-manager ((this race-manager)) +(defmethod update ((this race-manager)) (let ((s5-0 *display-race-marks*)) (when (logtest? s5-0 (race-marks-controls rmc2040)) (let ((a0-3 (entity-by-name (-> *race-info-array* *select-race* race-mesh-name)))) @@ -931,12 +931,12 @@ 0 ) -(defmethod race-manager-method-22 race-manager ((this race-manager)) +(defmethod race-manager-method-22 ((this race-manager)) 0 (none) ) -(defmethod initialize-race-state race-manager ((this race-manager)) +(defmethod initialize-race-state ((this race-manager)) (let ((s5-0 (-> this race-state info))) (initialize-mesh s5-0) (initialize (-> this race-state) this s5-0) @@ -954,7 +954,7 @@ ) ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod initialize-state race-manager ((this race-manager)) +(defmethod initialize-state ((this race-manager)) (local-vars (v1-0 int) (sv-352 task-arrow-params) @@ -1127,7 +1127,7 @@ (none) ) -(defmethod save-score race-manager ((this race-manager) (arg0 float)) +(defmethod save-score ((this race-manager) (arg0 float)) (local-vars (sv-32 int)) (let* ((s5-0 (-> this race-state info score)) (s3-0 0) @@ -1195,7 +1195,7 @@ (none) ) -(defmethod stop-speech race-manager ((this race-manager)) +(defmethod stop-speech ((this race-manager)) (set-action! *gui-control* (gui-action stop) @@ -1220,7 +1220,7 @@ (none) ) -(defmethod draw-message-continue race-manager ((this race-manager)) +(defmethod draw-message-continue ((this race-manager)) (when (= (get-status *gui-control* (-> this message-id)) (gui-status active)) (let ((gp-1 (new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning)) @@ -1248,7 +1248,7 @@ (none) ) -(defmethod draw-message-retry race-manager ((this race-manager)) +(defmethod draw-message-retry ((this race-manager)) (when (= (get-status *gui-control* (-> this message-id)) (gui-status active)) (let ((gp-1 (new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning)) @@ -1563,7 +1563,7 @@ (define *race-manager* (the-as (pointer race-manager) #f)) -(defmethod deactivate race-manager ((this race-manager)) +(defmethod deactivate ((this race-manager)) (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.0 0) (send-event *traffic-manager* 'restore-default-settings) (call-parent-method this) diff --git a/goal_src/jak2/levels/common/race/race-mesh.gc b/goal_src/jak2/levels/common/race/race-mesh.gc index d84225f1985..091fb01fc0c 100644 --- a/goal_src/jak2/levels/common/race/race-mesh.gc +++ b/goal_src/jak2/levels/common/race/race-mesh.gc @@ -22,169 +22,136 @@ ;; DECOMP BEGINS (deftype race-mesh-hash-search (structure) - ((best-dist float :offset-assert 0) - (debug-cells-searched int32 :offset-assert 4) - (debug-slices-searched int32 :offset-assert 8) - (bounds bounding-box4w :inline :offset-assert 16) - (cell-quads vector 2 :inline :offset-assert 48) - (slice-quads vector 4 :inline :offset-assert 80) - (cell-bits vector16ub 2 :inline :offset 48) - (slice-bits vector16ub 4 :inline :offset 80) + ((best-dist float) + (debug-cells-searched int32) + (debug-slices-searched int32) + (bounds bounding-box4w :inline) + (cell-quads vector 2 :inline) + (slice-quads vector 4 :inline) + (cell-bits vector16ub 2 :inline :overlay-at cell-quads) + (slice-bits vector16ub 4 :inline :overlay-at slice-quads) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) (deftype race-mesh-slice-query (structure) - ((slice-id int16 :offset-assert 0) - (lap-dist float :offset-assert 4) - (pt-on-slice vector :inline :offset-assert 16) - (slice-corners vector 4 :inline :offset-assert 32) - (search-sphere sphere :inline :offset-assert 96) + ((slice-id int16) + (lap-dist float) + (pt-on-slice vector :inline) + (slice-corners vector 4 :inline) + (search-sphere sphere :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) (deftype race-path-edge-info (structure) - ((sample-t float :offset-assert 0) + ((sample-t float) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype race-path-sample (structure) - ((bytes uint8 32 :offset-assert 0) - (pos vector :inline :offset 0) - (quat quaternion :inline :offset 16) - (stick-x int8 :offset 12) - (stick-y int8 :offset 13) - (throttle uint8 :offset 14) - (flags uint8 :offset 15) + ((bytes uint8 32) + (pos vector :inline :overlay-at (-> bytes 0)) + (quat quaternion :inline :overlay-at (-> bytes 16)) + (stick-x int8 :overlay-at (-> bytes 12)) + (stick-y int8 :overlay-at (-> bytes 13)) + (throttle uint8 :overlay-at (-> bytes 14)) + (flags uint8 :overlay-at (-> bytes 15)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype race-path (structure) - ((sample-count uint16 :offset-assert 0) - (record-id int8 :offset-assert 2) - (pad uint8 :offset-assert 3) - (samples (inline-array race-path-sample) :offset-assert 4) - (edge-infos (inline-array race-path-edge-info) :offset-assert 8) + ((sample-count uint16) + (record-id int8) + (pad uint8) + (samples (inline-array race-path-sample)) + (edge-infos (inline-array race-path-edge-info)) ) - :method-count-assert 13 - :size-assert #xc - :flag-assert #xd0000000c (:methods - (draw-path-debug (_type_ rgba rgba) none 9) - (race-path-method-10 (_type_ vector float float) none 10) - (race-path-method-11 (_type_ race-path-sample vector float) none 11) - (race-path-method-12 (_type_ vector float float) float 12) + (draw-path-debug (_type_ rgba rgba) none) + (race-path-method-10 (_type_ vector float float) none) + (race-path-method-11 (_type_ race-path-sample vector float) none) + (race-path-method-12 (_type_ vector float float) float) ) ) (deftype race-path-group (structure) - ((name string :offset-assert 0) - (path-count int8 :offset-assert 4) - (pad uint8 3 :offset-assert 5) - (paths (inline-array race-path) :offset-assert 8) + ((name string) + (path-count int8) + (pad uint8 3) + (paths (inline-array race-path)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype race-mesh-edge (structure) - ((left vector :inline :offset-assert 0) - (right vector :inline :offset-assert 16) - (lap-dist float :offset 12) + ((left vector :inline) + (right vector :inline) + (lap-dist float :overlay-at (-> left data 3)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype race-mesh-slice (structure) - ((edge-index-array uint16 2 :offset-assert 0) - (start-edge int16 :offset 0) - (end-edge int16 :offset 2) + ((edge-index-array uint16 2) + (start-edge int16 :overlay-at (-> edge-index-array 0)) + (end-edge int16 :overlay-at (-> edge-index-array 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype race-mesh-hash-cell (structure) - ((first-slice int16 :offset-assert 0) - (slice-count uint8 :offset-assert 2) - (pad uint8 :offset-assert 3) + ((first-slice int16) + (slice-count uint8) + (pad uint8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype race-mesh-hash (structure) - ((cells-wide int8 :offset-assert 0) - (cells-tall int8 :offset-assert 1) - (cell-length float :offset-assert 4) - (cells (inline-array race-mesh-hash-cell) :offset-assert 8) - (slice-table (inline-array race-mesh-slice) :offset-assert 12) - (origin vector :inline :offset-assert 16) + ((cells-wide int8) + (cells-tall int8) + (cell-length float) + (cells (inline-array race-mesh-hash-cell)) + (slice-table (inline-array race-mesh-slice)) + (origin vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype race-mesh (basic) - ((version uint8 :offset-assert 4) - (path-group-count uint8 :offset-assert 5) - (flags race-mesh-flags :offset-assert 6) - (pad uint8 1 :offset-assert 7) - (slice-count int16 :offset-assert 8) - (edge-count int16 :offset-assert 10) - (slices (inline-array race-mesh-slice) :offset-assert 12) - (edges (inline-array race-mesh-edge) :offset-assert 16) - (hash race-mesh-hash :offset-assert 20) - (path-groups (inline-array race-path-group) :offset-assert 24) + ((version uint8) + (path-group-count uint8) + (flags race-mesh-flags) + (pad uint8 1) + (slice-count int16) + (edge-count int16) + (slices (inline-array race-mesh-slice)) + (edges (inline-array race-mesh-edge)) + (hash race-mesh-hash) + (path-groups (inline-array race-path-group)) ) - :method-count-assert 20 - :size-assert #x1c - :flag-assert #x140000001c (:methods - (debug-draw-path (_type_ int int rgba rgba) none 9) - (debug-draw-path-from-history (_type_ int int) symbol 10) - (debug-draw-slice (_type_ int) none 11) - (debug-draw-edges (_type_) none 12) - (race-mesh-method-13 (_type_ race-mesh-slice-query) none 13) - (race-mesh-method-14 (_type_ race-mesh-slice-query) none 14) - (race-mesh-method-15 (_type_ int race-mesh-slice-query) none 15) - (race-mesh-method-16 (_type_ race-mesh-slice-query) none 16) - (race-mesh-method-17 (_type_ race-mesh-slice-query) symbol 17) - (race-mesh-method-18 (_type_ race-mesh-hash-search int int race-mesh-slice-query) none 18) - (race-mesh-method-19 (_type_ int race-mesh-slice-query) symbol 19) + (debug-draw-path (_type_ int int rgba rgba) none) + (debug-draw-path-from-history (_type_ int int) symbol) + (debug-draw-slice (_type_ int) none) + (debug-draw-edges (_type_) none) + (race-mesh-method-13 (_type_ race-mesh-slice-query) none) + (race-mesh-method-14 (_type_ race-mesh-slice-query) none) + (race-mesh-method-15 (_type_ int race-mesh-slice-query) none) + (race-mesh-method-16 (_type_ race-mesh-slice-query) none) + (race-mesh-method-17 (_type_ race-mesh-slice-query) symbol) + (race-mesh-method-18 (_type_ race-mesh-hash-search int int race-mesh-slice-query) none) + (race-mesh-method-19 (_type_ int race-mesh-slice-query) symbol) ) ) -(defmethod race-path-method-10 race-path ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod race-path-method-10 ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) (let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 4)) (a3-1 (the int arg1)) ) @@ -198,7 +165,7 @@ (none) ) -(defmethod race-path-method-11 race-path ((this race-path) (arg0 race-path-sample) (arg1 vector) (arg2 float)) +(defmethod race-path-method-11 ((this race-path) (arg0 race-path-sample) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'race-path-sample 6))) (let ((f0-1 (the float (-> this sample-count)))) (if (< f0-1 arg2) @@ -246,7 +213,7 @@ (none) ) -(defmethod race-path-method-12 race-path ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod race-path-method-12 ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) (local-vars (v1-15 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -298,7 +265,7 @@ ) ) -(defmethod draw-path-debug race-path ((this race-path) (arg0 rgba) (arg1 rgba)) +(defmethod draw-path-debug ((this race-path) (arg0 rgba) (arg1 rgba)) (let ((s1-0 0) (s3-0 1) (s2-0 (+ (-> this sample-count) -1)) @@ -326,7 +293,7 @@ (none) ) -(defmethod debug-draw-path race-mesh ((this race-mesh) (arg0 int) (arg1 int) (arg2 rgba) (arg3 rgba)) +(defmethod debug-draw-path ((this race-mesh) (arg0 int) (arg1 int) (arg2 rgba) (arg3 rgba)) (when (< arg1 (the-as int (-> this path-group-count))) (let ((v1-2 (-> this path-groups arg1))) (if (< arg0 (-> v1-2 path-count)) @@ -337,7 +304,7 @@ (none) ) -(defmethod debug-draw-path-from-history race-mesh ((this race-mesh) (arg0 int) (arg1 int)) +(defmethod debug-draw-path-from-history ((this race-mesh) (arg0 int) (arg1 int)) (when (< arg1 (the-as int (-> this path-group-count))) (let ((v1-2 (-> this path-groups arg1))) (countdown (a2-1 (-> v1-2 path-count)) @@ -376,7 +343,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw-slice race-mesh ((this race-mesh) (arg0 int)) +(defmethod debug-draw-slice ((this race-mesh) (arg0 int)) (let* ((v1-1 (-> this slices arg0)) (s3-0 (-> this edges (-> v1-1 start-edge))) (s4-0 (-> this edges (-> v1-1 end-edge))) @@ -434,7 +401,7 @@ (none) ) -(defmethod debug-draw-edges race-mesh ((this race-mesh)) +(defmethod debug-draw-edges ((this race-mesh)) (let ((idx 0) (slice-cnt (+ (-> this slice-count) -1)) ) @@ -487,7 +454,7 @@ (none) ) -(defmethod race-mesh-method-19 race-mesh ((this race-mesh) (arg0 int) (arg1 race-mesh-slice-query)) +(defmethod race-mesh-method-19 ((this race-mesh) (arg0 int) (arg1 race-mesh-slice-query)) (set! (-> arg1 slice-id) -1) (let* ((v1-2 (-> this slices arg0)) (a1-3 (-> this edges (-> v1-2 start-edge))) @@ -542,7 +509,7 @@ #t ) -(defmethod race-mesh-method-17 race-mesh ((this race-mesh) (slice-query race-mesh-slice-query)) +(defmethod race-mesh-method-17 ((this race-mesh) (slice-query race-mesh-slice-query)) (set! (-> slice-query slice-id) -1) (let* ((race-hash (-> this hash)) (v1-2 @@ -593,7 +560,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod race-mesh-method-15 race-mesh ((this race-mesh) (id int) (slice-query race-mesh-slice-query)) +(defmethod race-mesh-method-15 ((this race-mesh) (id int) (slice-query race-mesh-slice-query)) (local-vars (v1-8 symbol)) (set! (-> slice-query slice-id) id) (let* ((v1-1 (-> this slices id)) @@ -677,7 +644,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod race-mesh-method-18 race-mesh ((this race-mesh) (arg0 race-mesh-hash-search) (arg1 int) (arg2 int) (arg3 race-mesh-slice-query)) +(defmethod race-mesh-method-18 ((this race-mesh) (arg0 race-mesh-hash-search) (arg1 int) (arg2 int) (arg3 race-mesh-slice-query)) (let* ((v1-3 (+ (* arg2 (-> this hash cells-wide)) arg1)) (a0-1 (/ v1-3 8)) (a1-2 (ash 1 (logand v1-3 7))) @@ -720,7 +687,7 @@ (none) ) -(defmethod race-mesh-method-16 race-mesh ((this race-mesh) (arg0 race-mesh-slice-query)) +(defmethod race-mesh-method-16 ((this race-mesh) (arg0 race-mesh-slice-query)) (set! (-> arg0 slice-id) -1) (let ((s4-0 (-> this hash)) (s3-0 (new 'stack-no-clear 'race-mesh-hash-search)) @@ -800,7 +767,7 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod race-mesh-method-14 race-mesh ((this race-mesh) (arg0 race-mesh-slice-query)) +(defmethod race-mesh-method-14 ((this race-mesh) (arg0 race-mesh-slice-query)) (let* ((f30-0 (vector-line-distance-point! (-> arg0 pt-on-slice) (the-as vector (-> arg0 slice-corners)) @@ -825,7 +792,7 @@ (none) ) -(defmethod race-mesh-method-13 race-mesh ((this race-mesh) (arg0 race-mesh-slice-query)) +(defmethod race-mesh-method-13 ((this race-mesh) (arg0 race-mesh-slice-query)) (race-mesh-method-17 this arg0) (if (and (= (-> arg0 slice-id) -1) (< 0.0 (-> arg0 search-sphere r))) (race-mesh-method-16 this arg0) diff --git a/goal_src/jak2/levels/common/race/race-obs.gc b/goal_src/jak2/levels/common/race/race-obs.gc index 92bca4221b3..b3554fc68fc 100644 --- a/goal_src/jak2/levels/common/race/race-obs.gc +++ b/goal_src/jak2/levels/common/race/race-obs.gc @@ -19,12 +19,8 @@ (deftype race-signal-banner (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -75,34 +71,32 @@ ) (deftype race-signal (process-drawable) - ((pos vector :inline :offset-assert 208) - (y-offset float :offset-assert 224) - (dest-y-offset float :offset-assert 228) - (bob-time time-frame :offset-assert 232) - (start-time time-frame :offset-assert 240) - (banner handle :offset-assert 248) - (curve cubic-curve :inline :offset-assert 256) + ((pos vector :inline) + (y-offset float) + (dest-y-offset float) + (bob-time time-frame) + (start-time time-frame) + (banner handle) + (curve cubic-curve :inline) ) - :heap-base #xc0 - :method-count-assert 30 - :size-assert #x140 - :flag-assert #x1e00c00140 + (:state-methods + spawn-banner + idle + count-3 + count-2 + count-1 + count-go + die + test + ) (:methods - (spawn-banner () _type_ :state 20) - (idle () _type_ :state 21) - (count-3 () _type_ :state 22) - (count-2 () _type_ :state 23) - (count-1 () _type_ :state 24) - (count-go () _type_ :state 25) - (die () _type_ :state 26) - (test () _type_ :state 27) - (race-signal-method-28 (_type_) none 28) - (race-signal-method-29 (_type_) none 29) + (race-signal-method-28 (_type_) none) + (race-signal-method-29 (_type_) none) ) ) -(defmethod race-signal-method-29 race-signal ((this race-signal)) +(defmethod race-signal-method-29 ((this race-signal)) (+! (-> this y-offset) (* (- (-> this dest-y-offset) (-> this y-offset)) (fmin 1.0 (* 2.0 (seconds-per-frame)))) ) @@ -377,12 +371,8 @@ ) (deftype stadium-racer (vehicle-rider) - ((rider-type uint8 :offset-assert 221) + ((rider-type uint8) ) - :heap-base #x60 - :method-count-assert 36 - :size-assert #xde - :flag-assert #x24006000de ) @@ -391,7 +381,7 @@ :bounds (static-spherem 0 2 0 3) ) -(defmethod vehicle-rider-method-33 stadium-racer ((this stadium-racer)) +(defmethod vehicle-rider-method-33 ((this stadium-racer)) (let ((t9-0 (method-of-type vehicle-rider vehicle-rider-method-33))) (t9-0 this) ) @@ -518,7 +508,7 @@ (none) ) -(defmethod initialize-collision stadium-racer ((this stadium-racer)) +(defmethod initialize-collision ((this stadium-racer)) (set! (-> this level) (level-get *level* 'lracelit)) (stack-size-set! (-> this main-thread) 256) (when (not (-> this level)) @@ -530,7 +520,7 @@ (none) ) -(defmethod vehicle-rider-method-32 stadium-racer ((this stadium-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 ((this stadium-racer) (arg0 traffic-object-spawn-params)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-stadium-racer" (the-as (pointer uint32) #f))) @@ -578,10 +568,6 @@ (deftype errol-rider (stadium-racer) () - :heap-base #x60 - :method-count-assert 36 - :size-assert #xde - :flag-assert #x24006000de ) @@ -601,7 +587,7 @@ ) ) -(defmethod vehicle-rider-method-33 errol-rider ((this errol-rider)) +(defmethod vehicle-rider-method-33 ((this errol-rider)) (let ((t9-0 (method-of-type vehicle-rider vehicle-rider-method-33))) (t9-0 this) ) @@ -615,22 +601,20 @@ ) (deftype turbo-pickup (process-drawable) - ((root collide-shape-moving :override) - (available symbol :offset-assert 200) + ((root collide-shape-moving :override) + (available symbol) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xcc - :flag-assert #x17005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (find-ground (_type_) symbol 22) + (find-ground (_type_) symbol) ) ) -(defmethod find-ground turbo-pickup ((this turbo-pickup)) +(defmethod find-ground ((this turbo-pickup)) (let ((s4-0 #f)) (let ((gp-0 (new 'stack-no-clear 'do-push-aways-work))) (set! (-> gp-0 push-vel quad) (-> this root trans quad)) diff --git a/goal_src/jak2/levels/common/race/vehicle-racer.gc b/goal_src/jak2/levels/common/race/vehicle-racer.gc index 777d4e99756..9768ef58d77 100644 --- a/goal_src/jak2/levels/common/race/vehicle-racer.gc +++ b/goal_src/jak2/levels/common/race/vehicle-racer.gc @@ -10,30 +10,27 @@ ;; DECOMP BEGINS (deftype race-control (structure) - ((state race-state :offset-assert 0) - (mesh race-mesh :offset-assert 4) - (path-select int8 :offset-assert 8) - (path-group race-path-group :offset-assert 12) - (path race-path :offset-assert 16) - (path-t float :offset-assert 20) - (racer-state racer-state :offset-assert 24) - (path-sample race-path-sample :inline :offset-assert 32) - (lin-velocity vector :inline :offset-assert 64) - (ang-velocity vector :inline :offset-assert 80) + ((state race-state) + (mesh race-mesh) + (path-select int8) + (path-group race-path-group) + (path race-path) + (path-t float) + (racer-state racer-state) + (path-sample race-path-sample :inline) + (lin-velocity vector :inline) + (ang-velocity vector :inline) ) - :method-count-assert 13 - :size-assert #x60 - :flag-assert #xd00000060 (:methods - (race-control-method-9 (_type_ int vector) none 9) - (race-control-method-10 (_type_ race-state racer-state) none 10) - (race-control-method-11 (_type_ float) none 11) - (race-control-method-12 (_type_ vector) none 12) + (race-control-method-9 (_type_ int vector) none) + (race-control-method-10 (_type_ race-state racer-state) none) + (race-control-method-11 (_type_ float) none) + (race-control-method-12 (_type_ vector) none) ) ) -(defmethod race-control-method-12 race-control ((this race-control) (arg0 vector)) +(defmethod race-control-method-12 ((this race-control) (arg0 vector)) (let* ((f0-0 (-> this path-t)) (f0-2 (race-path-method-12 (-> this path) arg0 (+ -1.0 f0-0) (+ 1.0 f0-0))) ) @@ -44,7 +41,7 @@ (none) ) -(defmethod race-control-method-11 race-control ((this race-control) (arg0 float)) +(defmethod race-control-method-11 ((this race-control) (arg0 float)) (let ((f0-1 (+ (-> this path-t) (* 15.0 arg0)))) (set! f0-1 (cond ((logtest? (-> this mesh flags) (race-mesh-flags racemeshflag-0)) @@ -68,7 +65,7 @@ (none) ) -(defmethod race-control-method-9 race-control ((this race-control) (arg0 int) (arg1 vector)) +(defmethod race-control-method-9 ((this race-control) (arg0 int) (arg1 vector)) (let ((v1-1 (-> this path-group path-count))) (if (>= arg0 v1-1) (set! arg0 0) @@ -109,7 +106,7 @@ (none) ) -(defmethod race-control-method-10 race-control ((this race-control) (arg0 race-state) (arg1 racer-state)) +(defmethod race-control-method-10 ((this race-control) (arg0 race-state) (arg1 racer-state)) (set! (-> this state) arg0) (set! (-> this mesh) (-> arg0 info mesh)) (if (-> this mesh) @@ -121,37 +118,35 @@ ) (deftype vehicle-racer (vehicle) - ((race race-control :inline :offset-assert 880) - (ai-controls vehicle-controls :inline :offset-assert 976) - (rider-hand-joint int8 :offset-assert 992) - (turbo-pickup-count int8 :offset-assert 993) - (minimap connection-minimap :offset-assert 996) - (shortcut-speed-factor float :offset-assert 1000) - (path-deviation float :offset-assert 1004) - (shortcut-time time-frame :offset-assert 1008) + ((race race-control :inline) + (ai-controls vehicle-controls :inline) + (rider-hand-joint int8) + (turbo-pickup-count int8) + (minimap connection-minimap) + (shortcut-speed-factor float) + (path-deviation float) + (shortcut-time time-frame) ) - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3f8 - :flag-assert #x9c038003f8 + (:state-methods + waiting-race + waiting-for-start + racing + race-finished + ) (:methods - (waiting-race () _type_ :state 144) - (waiting-for-start () _type_ :state 145) - (racing () _type_ :state 146) - (race-finished () _type_ :state 147) - (vehicle-racer-method-148 (_type_ race-path race-mesh-slice) none 148) - (vehicle-racer-method-149 (_type_) none 149) - (select-path-randomly-from-mask (_type_ uint) none 150) - (vehicle-racer-method-151 (_type_) none 151) - (vehicle-racer-method-152 (_type_) none 152) - (physics-post (_type_) none 153) - (vehicle-racer-method-154 (_type_) none 154) - (vehicle-racer-method-155 (_type_) none 155) + (vehicle-racer-method-148 (_type_ race-path race-mesh-slice) none) + (vehicle-racer-method-149 (_type_) none) + (select-path-randomly-from-mask (_type_ uint) none) + (vehicle-racer-method-151 (_type_) none) + (vehicle-racer-method-152 (_type_) none) + (physics-post (_type_) none) + (vehicle-racer-method-154 (_type_) none) + (vehicle-racer-method-155 (_type_) none) ) ) -(defmethod vehicle-method-117 vehicle-racer ((this vehicle-racer) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 ((this vehicle-racer) (arg0 vector) (arg1 int) (arg2 int)) (vector-matrix*! arg0 (-> this info rider-hand-offset arg2) @@ -161,7 +156,7 @@ (none) ) -(defmethod vehicle-method-137 vehicle-racer ((this vehicle-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-137 ((this vehicle-racer) (arg0 traffic-object-spawn-params)) (let ((t9-0 vehicle-rider-spawn) (v1-0 (-> arg0 user-data)) ) @@ -179,7 +174,7 @@ ) ;; WARN: Return type mismatch number vs none. -(defmethod vehicle-racer-method-148 vehicle-racer ((this vehicle-racer) (arg0 race-path) (arg1 race-mesh-slice)) +(defmethod vehicle-racer-method-148 ((this vehicle-racer) (arg0 race-path) (arg1 race-mesh-slice)) (let ((f26-0 (the-as number 0.0)) (gp-0 (new 'stack-no-clear 'vehicle-physics-work)) (f30-0 (-> (the-as (pointer float) (+ (* (-> arg1 start-edge) 4) (the-as int (-> arg0 edge-infos)))))) @@ -240,7 +235,7 @@ (none) ) -(defmethod vehicle-method-120 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-method-120 ((this vehicle-racer)) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (set! (-> *game-info* race-number-turbos) (-> this turbo-pickup-count)) 0 @@ -262,7 +257,7 @@ (none) ) -(defmethod vehicle-method-66 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-method-66 ((this vehicle-racer)) (when (and (not (logtest? (rigid-body-object-flag turbo-boost) (-> this flags))) (> (-> this turbo-pickup-count) 0)) (+! (-> this turbo-pickup-count) -1) (set-time! (-> this turbo-boost-time)) @@ -277,7 +272,7 @@ (none) ) -(defmethod vehicle-method-136 vehicle-racer ((this vehicle-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-136 ((this vehicle-racer) (arg0 traffic-object-spawn-params)) (set! (-> this draw lod-set lod 1 dist) 819200.0) (set! (-> this draw lod-set lod 2 dist) 1228800.0) (let* ((a1-1 *race-state*) @@ -323,7 +318,7 @@ (none) ) -(defmethod vehicle-method-138 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-method-138 ((this vehicle-racer)) (if (focus-test? this grabbed) (go (method-of-object this waiting-for-start)) (go (method-of-object this player-control)) @@ -333,7 +328,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod rigid-body-object-method-45 vehicle-racer ((this vehicle-racer) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 ((this vehicle-racer) (arg0 rigid-body-impact)) (let ((t9-0 (method-of-type vehicle rigid-body-object-method-45))) (t9-0 this arg0) ) @@ -358,7 +353,7 @@ ) ;; WARN: disable def twice: 12. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod rigid-body-object-method-46 vehicle-racer ((this vehicle-racer) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 ((this vehicle-racer) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('test-ready) (and (and (-> this next-state) (= (-> this next-state name) 'waiting-for-start)) @@ -479,7 +474,7 @@ ) ) -(defmethod select-path-randomly-from-mask vehicle-racer ((this vehicle-racer) (arg0 uint)) +(defmethod select-path-randomly-from-mask ((this vehicle-racer) (arg0 uint)) (let ((a0-1 0) (v1-0 0) (s5-0 (new 'stack-no-clear 'array 'int8 12)) @@ -503,7 +498,7 @@ (none) ) -(defmethod vehicle-racer-method-151 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-racer-method-151 ((this vehicle-racer)) (local-vars (v1-18 float) (v1-28 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -659,7 +654,7 @@ ) ) -(defmethod physics-post vehicle-racer ((this vehicle-racer)) +(defmethod physics-post ((this vehicle-racer)) (local-vars (v1-35 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -793,7 +788,7 @@ ) ) -(defmethod vehicle-racer-method-154 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-racer-method-154 ((this vehicle-racer)) (cond ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) (if (and (logtest? (-> this flags) (rigid-body-object-flag on-ground)) @@ -833,7 +828,7 @@ (none) ) -(defmethod vehicle-racer-method-152 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-racer-method-152 ((this vehicle-racer)) (let ((s5-0 (new 'stack-no-clear 'matrix3))) (set! (-> s5-0 vector 0 quad) (-> this rbody state position quad)) (set! (-> this camera-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (camera-pos))) @@ -851,7 +846,7 @@ (none) ) -(defmethod vehicle-racer-method-155 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-racer-method-155 ((this vehicle-racer)) (let ((s5-0 (new 'stack-no-clear 'matrix3))) (set! (-> s5-0 vector 0 quad) (-> this rbody state position quad)) (set! (-> this camera-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (camera-pos))) @@ -872,7 +867,7 @@ (none) ) -(defmethod vehicle-method-124 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-method-124 ((this vehicle-racer)) (cond ((and (logtest? (rigid-body-object-flag player-grabbed) (-> this flags)) (-> this race path)) (vehicle-racer-method-155 this) diff --git a/goal_src/jak2/levels/common/scene-actor.gc b/goal_src/jak2/levels/common/scene-actor.gc index a9c104125d2..af0faa8d0e3 100644 --- a/goal_src/jak2/levels/common/scene-actor.gc +++ b/goal_src/jak2/levels/common/scene-actor.gc @@ -275,14 +275,10 @@ (deftype kor-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod get-art-elem kor-npc ((this kor-npc)) +(defmethod get-art-elem ((this kor-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -295,7 +291,7 @@ ) ) -(defmethod init-art! kor-npc ((this kor-npc)) +(defmethod init-art! ((this kor-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -309,12 +305,8 @@ (deftype metalkor-highres (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -335,7 +327,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! metalkor-highres ((this metalkor-highres) (arg0 entity-actor)) +(defmethod init-from-entity! ((this metalkor-highres) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -401,14 +393,10 @@ This commonly includes things such as: (deftype tess-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod get-art-elem tess-npc ((this tess-npc)) +(defmethod get-art-elem ((this tess-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -445,7 +433,7 @@ This commonly includes things such as: ) ) -(defmethod init-art! tess-npc ((this tess-npc)) +(defmethod init-art! ((this tess-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -459,14 +447,10 @@ This commonly includes things such as: (deftype keira-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod get-art-elem keira-npc ((this keira-npc)) +(defmethod get-art-elem ((this keira-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -479,7 +463,7 @@ This commonly includes things such as: ) ) -(defmethod init-art! keira-npc ((this keira-npc)) +(defmethod init-art! ((this keira-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -493,20 +477,16 @@ This commonly includes things such as: (deftype krew-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod get-art-elem krew-npc ((this krew-npc)) +(defmethod get-art-elem ((this krew-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (-> this draw art-group data 4) ) -(defmethod init-art! krew-npc ((this krew-npc)) +(defmethod init-art! ((this krew-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -520,14 +500,10 @@ This commonly includes things such as: (deftype kid-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod init-art! kid-npc ((this kid-npc)) +(defmethod init-art! ((this kid-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -539,7 +515,7 @@ This commonly includes things such as: (none) ) -(defmethod get-art-elem kid-npc ((this kid-npc)) +(defmethod get-art-elem ((this kid-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -560,14 +536,10 @@ This commonly includes things such as: (deftype crocadog-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod get-art-elem crocadog-npc ((this crocadog-npc)) +(defmethod get-art-elem ((this crocadog-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -583,7 +555,7 @@ This commonly includes things such as: ) ) -(defmethod init-art! crocadog-npc ((this crocadog-npc)) +(defmethod init-art! ((this crocadog-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -597,14 +569,10 @@ This commonly includes things such as: (deftype torn-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod init-art! torn-npc ((this torn-npc)) +(defmethod init-art! ((this torn-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -616,7 +584,7 @@ This commonly includes things such as: (none) ) -(defmethod get-art-elem torn-npc ((this torn-npc)) +(defmethod get-art-elem ((this torn-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (cond @@ -632,7 +600,7 @@ This commonly includes things such as: ) ) -(defmethod get-trans torn-npc ((this torn-npc) (arg0 int)) +(defmethod get-trans ((this torn-npc) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (let ((v1-0 (-> this root))) (if (= arg0 2) @@ -644,14 +612,10 @@ This commonly includes things such as: (deftype youngsamos-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod init-art! youngsamos-npc ((this youngsamos-npc)) +(defmethod init-art! ((this youngsamos-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -665,7 +629,7 @@ This commonly includes things such as: (none) ) -(defmethod process-taskable-method-32 youngsamos-npc ((this youngsamos-npc)) +(defmethod process-taskable-method-32 ((this youngsamos-npc)) (case (-> this task actor) (((game-task-actor youngsamos-forest)) (when (not (task-node-closed? (game-task-node forest-protect-resolution))) @@ -692,7 +656,7 @@ This commonly includes things such as: (none) ) -(defmethod get-art-elem youngsamos-npc ((this youngsamos-npc)) +(defmethod get-art-elem ((this youngsamos-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -722,14 +686,10 @@ This commonly includes things such as: (deftype samos-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod init-art! samos-npc ((this samos-npc)) +(defmethod init-art! ((this samos-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -741,7 +701,7 @@ This commonly includes things such as: (none) ) -(defmethod get-art-elem samos-npc ((this samos-npc)) +(defmethod get-art-elem ((this samos-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -759,14 +719,10 @@ This commonly includes things such as: (deftype onin-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod init-art! onin-npc ((this onin-npc)) +(defmethod init-art! ((this onin-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -778,7 +734,7 @@ This commonly includes things such as: (none) ) -(defmethod get-art-elem onin-npc ((this onin-npc)) +(defmethod get-art-elem ((this onin-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (let ((v1-1 (get-current-task-event (-> this task)))) @@ -829,14 +785,10 @@ This commonly includes things such as: (deftype pecker-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod init-art! pecker-npc ((this pecker-npc)) +(defmethod init-art! ((this pecker-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -848,7 +800,7 @@ This commonly includes things such as: (none) ) -(defmethod get-art-elem pecker-npc ((this pecker-npc)) +(defmethod get-art-elem ((this pecker-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (local-vars (s5-0 art-joint-anim) (f30-0 float)) @@ -896,14 +848,10 @@ This commonly includes things such as: (deftype brutter-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod init-art! brutter-npc ((this brutter-npc)) +(defmethod init-art! ((this brutter-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -917,14 +865,10 @@ This commonly includes things such as: (deftype ashelin-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod init-art! ashelin-npc ((this ashelin-npc)) +(defmethod init-art! ((this ashelin-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -936,7 +880,7 @@ This commonly includes things such as: (none) ) -(defmethod get-art-elem ashelin-npc ((this ashelin-npc)) +(defmethod get-art-elem ((this ashelin-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -954,14 +898,10 @@ This commonly includes things such as: (deftype daxter-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod init-art! daxter-npc ((this daxter-npc)) +(defmethod init-art! ((this daxter-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -973,7 +913,7 @@ This commonly includes things such as: (none) ) -(defmethod get-art-elem daxter-npc ((this daxter-npc)) +(defmethod get-art-elem ((this daxter-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (-> this draw art-group data 3) diff --git a/goal_src/jak2/levels/common/scene-looper.gc b/goal_src/jak2/levels/common/scene-looper.gc index ae1e3e4d24d..d7a31b3de31 100644 --- a/goal_src/jak2/levels/common/scene-looper.gc +++ b/goal_src/jak2/levels/common/scene-looper.gc @@ -11,14 +11,10 @@ (declare-file (debug)) (deftype scene-looper (process) - ((scene-name symbol :offset-assert 128) + ((scene-name symbol) ) - :heap-base #x10 - :method-count-assert 15 - :size-assert #x84 - :flag-assert #xf00100084 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) diff --git a/goal_src/jak2/levels/common/warp-gate.gc b/goal_src/jak2/levels/common/warp-gate.gc index 9f0567467de..9b4304ac0b9 100644 --- a/goal_src/jak2/levels/common/warp-gate.gc +++ b/goal_src/jak2/levels/common/warp-gate.gc @@ -450,34 +450,32 @@ ) (deftype warp-gate (process-drawable) - ((root collide-shape :override) - (level-name uint32 :offset-assert 200) - (on-notice pair :offset-assert 204) - (on-activate pair :offset-assert 208) - (on-close pair :offset-assert 212) - (wait-for pair :offset-assert 216) - (continue continue-point :offset-assert 220) - (distance meters :offset-assert 224) - (anim-speed float :offset-assert 228) - (test-time time-frame :offset-assert 232) - (center vector :inline :offset-assert 240) + ((root collide-shape :override) + (level-name uint32) + (on-notice pair) + (on-activate pair) + (on-close pair) + (wait-for pair) + (continue continue-point) + (distance meters) + (anim-speed float) + (test-time time-frame) + (center vector :inline) ) - :heap-base #x80 - :method-count-assert 26 - :size-assert #x100 - :flag-assert #x1a00800100 + (:state-methods + idle + (use continue-point) + hidden + ) (:methods - (idle () _type_ :state 20) - (use (continue-point) _type_ :state 21) - (hidden () _type_ :state 22) - (init-skel-and-collide (_type_) none 23) - (setup-fields (_type_) none 24) - (handle-notice (_type_) continue-point 25) + (init-skel-and-collide (_type_) none) + (setup-fields (_type_) none) + (handle-notice (_type_) continue-point) ) ) -(defmethod handle-notice warp-gate ((this warp-gate)) +(defmethod handle-notice ((this warp-gate)) (let ((s5-0 (script-eval (-> this on-notice)))) (cond ((= s5-0 'hide) @@ -709,7 +707,7 @@ ) ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-skel-and-collide warp-gate ((this warp-gate)) +(defmethod init-skel-and-collide ((this warp-gate)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -736,7 +734,7 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod setup-fields warp-gate ((this warp-gate)) +(defmethod setup-fields ((this warp-gate)) (set! (-> this level-name) (the-as uint (-> this level name))) (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice pair)) (set! (-> this on-activate) #f) @@ -781,7 +779,7 @@ (none) ) -(defmethod init-from-entity! warp-gate ((this warp-gate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this warp-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1087,22 +1085,18 @@ This commonly includes things such as: (deftype air-train (warp-gate) "NOTE - I guess this is why sometimes the air-train makes the warp-gate sound" - ((part-exhaust-left sparticle-launch-control :offset-assert 256) - (part-exhaust-right sparticle-launch-control :offset-assert 260) - (part-dust sparticle-launch-control :offset-assert 264) - (dust-y float :offset-assert 268) - (hover-sound sound-id :offset-assert 272) - (base-pos vector :inline :offset-assert 288) + ((part-exhaust-left sparticle-launch-control) + (part-exhaust-right sparticle-launch-control) + (part-dust sparticle-launch-control) + (dust-y float) + (hover-sound sound-id) + (base-pos vector :inline) ) - :heap-base #xb0 - :method-count-assert 26 - :size-assert #x130 - :flag-assert #x1a00b00130 ) ;; WARN: Return type mismatch warp-gate vs air-train. -(defmethod relocate air-train ((this air-train) (arg0 int)) +(defmethod relocate ((this air-train) (arg0 int)) (if (nonzero? (-> this part-exhaust-left)) (&+! (-> this part-exhaust-left) arg0) ) @@ -1115,7 +1109,7 @@ This commonly includes things such as: (the-as air-train ((method-of-type warp-gate relocate) this arg0)) ) -(defmethod deactivate air-train ((this air-train)) +(defmethod deactivate ((this air-train)) (sound-stop (-> this hover-sound)) (if (nonzero? (-> this part-exhaust-left)) (kill-and-free-particles (-> this part-exhaust-left)) @@ -1131,7 +1125,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-skel-and-collide air-train ((this air-train)) +(defmethod init-skel-and-collide ((this air-train)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1178,7 +1172,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod setup-fields air-train ((this air-train)) +(defmethod setup-fields ((this air-train)) (let ((t9-0 (method-of-type warp-gate setup-fields))) (t9-0 this) ) diff --git a/goal_src/jak2/levels/consite/consite-obs.gc b/goal_src/jak2/levels/consite/consite-obs.gc index 50dbe19fdeb..20db6023884 100644 --- a/goal_src/jak2/levels/consite/consite-obs.gc +++ b/goal_src/jak2/levels/consite/consite-obs.gc @@ -16,12 +16,8 @@ (deftype consite-break-scaffold (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -32,7 +28,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-break-scaffold ((this consite-break-scaffold) (arg0 entity-actor)) +(defmethod init-from-entity! ((this consite-break-scaffold) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -65,12 +61,8 @@ This commonly includes things such as: (deftype consite-bomb-elevator-hinges (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -97,7 +89,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-bomb-elevator-hinges ((this consite-bomb-elevator-hinges) (arg0 entity-actor)) +(defmethod init-from-entity! ((this consite-bomb-elevator-hinges) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -136,12 +128,8 @@ This commonly includes things such as: (deftype consite-bomb-elevator (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -168,7 +156,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-bomb-elevator ((this consite-bomb-elevator) (arg0 entity-actor)) +(defmethod init-from-entity! ((this consite-bomb-elevator) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -214,12 +202,8 @@ This commonly includes things such as: (deftype consite-silo-doors (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -246,7 +230,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-silo-doors ((this consite-silo-doors) (arg0 entity-actor)) +(defmethod init-from-entity! ((this consite-silo-doors) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -301,14 +285,10 @@ This commonly includes things such as: (deftype baron-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod get-art-elem baron-npc ((this baron-npc)) +(defmethod get-art-elem ((this baron-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -321,7 +301,7 @@ This commonly includes things such as: ) ) -(defmethod init-art! baron-npc ((this baron-npc)) +(defmethod init-art! ((this baron-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this diff --git a/goal_src/jak2/levels/consite/consite-part.gc b/goal_src/jak2/levels/consite/consite-part.gc index e45dab110fa..b7b44986f08 100644 --- a/goal_src/jak2/levels/consite/consite-part.gc +++ b/goal_src/jak2/levels/consite/consite-part.gc @@ -9,10 +9,6 @@ (deftype consite-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/consite/consiteb-part.gc b/goal_src/jak2/levels/consite/consiteb-part.gc index 13846b26ac5..827f66a6ecf 100644 --- a/goal_src/jak2/levels/consite/consiteb-part.gc +++ b/goal_src/jak2/levels/consite/consiteb-part.gc @@ -9,10 +9,6 @@ (deftype consiteb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/demo/demo-obs.gc b/goal_src/jak2/levels/demo/demo-obs.gc index 2ee1d32b947..9038f72802d 100644 --- a/goal_src/jak2/levels/demo/demo-obs.gc +++ b/goal_src/jak2/levels/demo/demo-obs.gc @@ -11,30 +11,26 @@ ;; DECOMP BEGINS (deftype demo-control (process) - ((selected int32 :offset-assert 128) - (sprites hud-sprite 2 :inline :offset-assert 144) - (sprite-pos vector :inline :offset-assert 272) - (sprite-draw uint32 :offset-assert 288) - (buffer external-art-buffer 2 :offset-assert 292) - (want int32 2 :offset-assert 300) - (have int32 2 :offset-assert 308) - (draw int32 :offset-assert 316) - (active symbol :offset-assert 320) - (spark-time time-frame :offset-assert 328) - (gui-id sound-id :offset-assert 336) + ((selected int32) + (sprites hud-sprite 2 :inline) + (sprite-pos vector :inline) + (sprite-draw uint32) + (buffer external-art-buffer 2) + (want int32 2) + (have int32 2) + (draw int32) + (active symbol) + (spark-time time-frame) + (gui-id sound-id) ) - :heap-base #xe0 - :method-count-assert 15 - :size-assert #x154 - :flag-assert #xf00e00154 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) ;; WARN: Return type mismatch process vs demo-control. -(defmethod relocate demo-control ((this demo-control) (arg0 int)) +(defmethod relocate ((this demo-control) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this buffer v1-0)) (&+! (-> this buffer v1-0) arg0) @@ -43,7 +39,7 @@ (the-as demo-control ((method-of-type process relocate) this arg0)) ) -(defmethod deactivate demo-control ((this demo-control)) +(defmethod deactivate ((this demo-control)) (dotimes (s5-0 2) (set-pending-file (-> this buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) diff --git a/goal_src/jak2/levels/dig/dig-digger.gc b/goal_src/jak2/levels/dig/dig-digger.gc index 54e198cdc71..3fc7f371dd5 100644 --- a/goal_src/jak2/levels/dig/dig-digger.gc +++ b/goal_src/jak2/levels/dig/dig-digger.gc @@ -483,7 +483,7 @@ ) ) -(defmethod draw hud-dig-clasp ((this hud-dig-clasp)) +(defmethod draw ((this hud-dig-clasp)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -496,14 +496,14 @@ (none) ) -(defmethod update-values hud-dig-clasp ((this hud-dig-clasp)) +(defmethod update-values ((this hud-dig-clasp)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-dig-clasp ((this hud-dig-clasp)) +(defmethod init-callback ((this hud-dig-clasp)) (set! (-> this level) (level-get *level* 'dig1)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -521,18 +521,16 @@ ) (deftype dig-clasp (process-drawable) - ((b basic :offset-assert 200) - (conn connection-minimap :offset-assert 204) + ((b basic) + (conn connection-minimap) ) - :heap-base #x50 - :method-count-assert 24 - :size-assert #xd0 - :flag-assert #x18005000d0 + (:state-methods + broken + break-it + idle + ) (:methods - (broken () _type_ :state 20) - (break-it () _type_ :state 21) - (idle () _type_ :state 22) - (dig-clasp-method-23 (_type_ vector) vector 23) + (dig-clasp-method-23 (_type_ vector) vector) ) ) @@ -565,7 +563,7 @@ ) ) -(defmethod dig-clasp-method-23 dig-clasp ((this dig-clasp) (arg0 vector)) +(defmethod dig-clasp-method-23 ((this dig-clasp) (arg0 vector)) (if (-> this b) (vector<-cspace! arg0 (-> this node-list data 3)) (vector<-cspace! arg0 (-> this node-list data 6)) @@ -676,7 +674,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-clasp ((this dig-clasp) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-clasp) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -718,15 +716,11 @@ This commonly includes things such as: (deftype dig-clasp-b (dig-clasp) () - :heap-base #x50 - :method-count-assert 24 - :size-assert #xd0 - :flag-assert #x18005000d0 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-clasp-b ((this dig-clasp-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-clasp-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -769,41 +763,36 @@ This commonly includes things such as: ) (deftype dig-tether-chain (structure) - ((position vector :inline :offset-assert 0) - (velocity vector :inline :offset-assert 16) - (joint-mod joint-mod :offset-assert 32) + ((position vector :inline) + (velocity vector :inline) + (joint-mod joint-mod) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) (deftype dig-tether (process-drawable) - ((clasp entity-actor :offset-assert 200) - (clasp-info-ok symbol :offset-assert 204) - (clasp-pos vector :inline :offset-assert 208) - (digger-pos vector :inline :offset-assert 224) - (digger-vertical vector :inline :offset-assert 240) - (frame oscillating-float :inline :offset-assert 256) - (frame-kicker delayed-rand-float :inline :offset-assert 280) - (old-dist float :offset-assert 308) - (chain-joints dig-tether-chain 8 :inline :offset-assert 320) - (chain-offset-rand delayed-rand-vector :inline :offset-assert 704) - (chain-offset oscillating-vector :inline :offset-assert 752) - (joint-one joint-mod :offset-assert 812) - (snapped-look lod-set :inline :offset-assert 816) + ((clasp entity-actor) + (clasp-info-ok symbol) + (clasp-pos vector :inline) + (digger-pos vector :inline) + (digger-vertical vector :inline) + (frame oscillating-float :inline) + (frame-kicker delayed-rand-float :inline) + (old-dist float) + (chain-joints dig-tether-chain 8 :inline) + (chain-offset-rand delayed-rand-vector :inline) + (chain-offset oscillating-vector :inline) + (joint-one joint-mod) + (snapped-look lod-set :inline) ) - :heap-base #x2f0 - :method-count-assert 25 - :size-assert #x361 - :flag-assert #x1902f00361 + (:state-methods + broken + idle + ) (:methods - (broken () _type_ :state 20) - (idle () _type_ :state 21) - (dig-tether-method-22 (_type_) none 22) - (dig-tether-method-23 (_type_) none 23) - (dig-tether-method-24 (_type_) none 24) + (dig-tether-method-22 (_type_) none) + (dig-tether-method-23 (_type_) none) + (dig-tether-method-24 (_type_) none) ) ) @@ -818,7 +807,7 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 80) ) -(defmethod dig-tether-method-22 dig-tether ((this dig-tether)) +(defmethod dig-tether-method-22 ((this dig-tether)) (with-pp (when (-> this clasp) (let* ((s4-0 (-> this clasp extra process)) @@ -849,7 +838,7 @@ This commonly includes things such as: ) ) -(defmethod dig-tether-method-23 dig-tether ((this dig-tether)) +(defmethod dig-tether-method-23 ((this dig-tether)) (set-params! (-> this chain-offset-rand) 75 150 2048.0 204.8) (set-params! (-> this chain-offset) (the-as vector #f) 4.096 20.48 0.9) (mode-set! (-> this joint-one) (joint-mod-mode joint-set-world)) @@ -877,7 +866,7 @@ This commonly includes things such as: (none) ) -(defmethod dig-tether-method-24 dig-tether ((this dig-tether)) +(defmethod dig-tether-method-24 ((this dig-tether)) (local-vars (sv-144 dig-tether-chain) (sv-160 vector)) (update-with-delay! (-> this chain-offset-rand)) (update! (-> this chain-offset) (-> this chain-offset-rand value)) @@ -1037,7 +1026,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs dig-tether. -(defmethod relocate dig-tether ((this dig-tether) (arg0 int)) +(defmethod relocate ((this dig-tether) (arg0 int)) (if (nonzero? (-> this joint-one)) (&+! (-> this joint-one) arg0) ) @@ -1081,46 +1070,41 @@ This commonly includes things such as: ) (deftype dig-digger-tether-info (structure) - ((rp int32 :offset-assert 0) - (handle handle :offset-assert 8) - (broken-x float :offset-assert 16) - (broken-z float :offset-assert 20) + ((rp int32) + (handle handle) + (broken-x float) + (broken-z float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype dig-digger (process-drawable) - ((actor-group (pointer actor-group) :offset-assert 200) - (actor-group-count int32 :offset-assert 204) - (tethers dig-digger-tether-info 24 :inline :offset-assert 208) - (vertical oscillating-vector :inline :offset-assert 976) - (vertical-rand delayed-rand-vector :inline :offset-assert 1040) - (start-y float :offset-assert 1088) - (y-offset bouncing-float :inline :offset-assert 1092) - (y-offset-kicker delayed-rand-float :inline :offset-assert 1136) - (twist oscillating-float :inline :offset-assert 1164) - (twist-kicker delayed-rand-float :inline :offset-assert 1192) - (smoke-part sparticle-launch-control :offset-assert 1220) - (motor-sound sound-id :offset-assert 1224) - (bit-sound sound-id :offset-assert 1228) - (movie-handle handle :offset-assert 1232) - (hud-counter handle :offset-assert 1240) - (speech-time time-frame :offset-assert 1248) - (speech-count int32 :offset-assert 1256) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (tethers dig-digger-tether-info 24 :inline) + (vertical oscillating-vector :inline) + (vertical-rand delayed-rand-vector :inline) + (start-y float) + (y-offset bouncing-float :inline) + (y-offset-kicker delayed-rand-float :inline) + (twist oscillating-float :inline) + (twist-kicker delayed-rand-float :inline) + (smoke-part sparticle-launch-control) + (motor-sound sound-id) + (bit-sound sound-id) + (movie-handle handle) + (hud-counter handle) + (speech-time time-frame) + (speech-count int32) ) - :heap-base #x470 - :method-count-assert 25 - :size-assert #x4ec - :flag-assert #x19047004ec + (:state-methods + idle + hidden + ) (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) - (dig-digger-method-22 (_type_ int) entity 22) - (dig-digger-method-23 (_type_) none 23) - (dig-digger-method-24 (_type_) none 24) + (dig-digger-method-22 (_type_ int) entity) + (dig-digger-method-23 (_type_) none) + (dig-digger-method-24 (_type_) none) ) ) @@ -1131,14 +1115,14 @@ This commonly includes things such as: :origin-joint-index 3 ) -(defmethod dig-digger-method-22 dig-digger ((this dig-digger) (arg0 int)) +(defmethod dig-digger-method-22 ((this dig-digger) (arg0 int)) (if (and (> (-> this actor-group-count) 0) (< arg0 (-> this actor-group 0 length))) (-> this actor-group 0 data arg0 actor) (the-as entity #f) ) ) -(defmethod dig-digger-method-23 dig-digger ((this dig-digger)) +(defmethod dig-digger-method-23 ((this dig-digger)) (dotimes (s5-0 24) (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this tethers s5-0 rp)))) (s3-0 (dig-digger-method-22 this s5-0)) @@ -1152,7 +1136,7 @@ This commonly includes things such as: (none) ) -(defmethod dig-digger-method-24 dig-digger ((this dig-digger)) +(defmethod dig-digger-method-24 ((this dig-digger)) (set! (-> this vertical target x) 0.0) (set! (-> this vertical target z) 0.0) (let ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> this vertical)) 1.0)) @@ -1354,7 +1338,7 @@ This commonly includes things such as: :code sleep-code ) -(defmethod deactivate dig-digger ((this dig-digger)) +(defmethod deactivate ((this dig-digger)) (if (nonzero? (-> this smoke-part)) (kill-and-free-particles (-> this smoke-part)) ) @@ -1363,7 +1347,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs dig-digger. -(defmethod relocate dig-digger ((this dig-digger) (arg0 int)) +(defmethod relocate ((this dig-digger) (arg0 int)) (when (nonzero? (-> this smoke-part)) (if (nonzero? (-> this smoke-part)) (&+! (-> this smoke-part) arg0) @@ -1373,7 +1357,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-digger ((this dig-digger) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-digger) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/dig/dig-obs.gc b/goal_src/jak2/levels/dig/dig-obs.gc index ab01a2138d9..c9dbcb46673 100644 --- a/goal_src/jak2/levels/dig/dig-obs.gc +++ b/goal_src/jak2/levels/dig/dig-obs.gc @@ -8,19 +8,15 @@ ;; DECOMP BEGINS (deftype dig-sinking-plat (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 384) - (sync sync-linear :inline :offset-assert 400) - (last-ridden-time time-frame :offset-assert 416) - (prev-pos float :offset-assert 424) - (path-pos float :offset-assert 428) - (surface-height float :offset-assert 432) - (once basic :offset-assert 436) - (bubbling-sound-id sound-id :offset-assert 440) + ((anchor-point vector :inline) + (sync sync-linear :inline) + (last-ridden-time time-frame) + (prev-pos float) + (path-pos float) + (surface-height float) + (once basic) + (bubbling-sound-id sound-id) ) - :heap-base #x140 - :method-count-assert 57 - :size-assert #x1bc - :flag-assert #x39014001bc ) @@ -29,14 +25,14 @@ :bounds (static-spherem 0 -2 0 5.25) ) -(defmethod rigid-body-object-method-29 dig-sinking-plat ((this dig-sinking-plat) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this dig-sinking-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) ) -(defmethod allocate-and-init-cshape dig-sinking-plat ((this dig-sinking-plat)) +(defmethod allocate-and-init-cshape ((this dig-sinking-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -98,11 +94,11 @@ ) ) -(defmethod rigid-body-platform-method-53 dig-sinking-plat ((this dig-sinking-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-53 ((this dig-sinking-plat) (arg0 vector)) (-> this surface-height) ) -(defmethod rigid-body-object-method-37 dig-sinking-plat ((this dig-sinking-plat)) +(defmethod rigid-body-object-method-37 ((this dig-sinking-plat)) (when (not (logtest? (-> this path flags) (path-control-flag not-found))) (set! (-> this prev-pos) (-> this path-pos)) (set! (-> this path-pos) (get-norm! (-> this sync) 0)) @@ -195,7 +191,7 @@ (none) ) -(defmethod rigid-body-platform-method-56 dig-sinking-plat ((this dig-sinking-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-56 ((this dig-sinking-plat) (arg0 vector)) (when (not (logtest? (-> this path flags) (path-control-flag not-found))) (let ((v1-4 (new 'stack-no-clear 'vector))) (cond @@ -247,7 +243,7 @@ :event (-> (method-of-type dig-sinking-plat idle) event) ) -(defmethod init-skel-and-rigid-body dig-sinking-plat ((this dig-sinking-plat)) +(defmethod init-skel-and-rigid-body ((this dig-sinking-plat)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-sinking-plat" (the-as (pointer uint32) #f))) @@ -422,12 +418,9 @@ ) (deftype dig-log-button-info (basic) - ((cam-ret-mode symbol :offset-assert 4) - (cam-ret-dir vector :inline :offset-assert 16) + ((cam-ret-mode symbol) + (cam-ret-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) @@ -462,21 +455,19 @@ ) (deftype dig-log (process-drawable) - ((pressed-count int8 :offset-assert 200) - (total-buttons int8 :offset-assert 201) - (last-button-id int8 :offset-assert 202) - (base-y float :offset-assert 204) - (hud-handle handle :offset-assert 208) - (pad-ihj1bn234i1b int32 2 :offset-assert 216) + ((pressed-count int8) + (total-buttons int8) + (last-button-id int8) + (base-y float) + (hud-handle handle) + (pad-ihj1bn234i1b int32 2) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xe0 - :flag-assert #x17006000e0 + (:state-methods + idle + moving + ) (:methods - (idle () _type_ :state 20) - (moving () _type_ :state 21) - (dig-log-method-22 (_type_ symbol) symbol 22) + (dig-log-method-22 (_type_ symbol) symbol) ) ) @@ -510,13 +501,13 @@ ) ) -(defmethod run-logic? dig-log ((this dig-log)) +(defmethod run-logic? ((this dig-log)) #t ) ;; WARN: Return type mismatch int vs symbol. ;; WARN: disable def twice: 16. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod dig-log-method-22 dig-log ((this dig-log) (arg0 symbol)) +(defmethod dig-log-method-22 ((this dig-log) (arg0 symbol)) (the-as symbol (cond @@ -657,7 +648,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-log ((this dig-log) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-log) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -731,16 +722,12 @@ This commonly includes things such as: ) (deftype dig-button (process-drawable) - ((down-y float :offset-assert 200) + ((down-y float) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xcc - :flag-assert #x17005000cc - (:methods - (idle-up () _type_ :state 20) - (going-down () _type_ :state 21) - (idle-down () _type_ :state 22) + (:state-methods + idle-up + going-down + idle-down ) ) @@ -750,7 +737,7 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 3) ) -(defmethod run-logic? dig-button ((this dig-button)) +(defmethod run-logic? ((this dig-button)) #t ) @@ -807,7 +794,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-button ((this dig-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -848,7 +835,7 @@ This commonly includes things such as: (none) ) -(defmethod draw hud-dig-button ((this hud-dig-button)) +(defmethod draw ((this hud-dig-button)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 487.0 (* 130.0 (-> this offset)))) @@ -861,14 +848,14 @@ This commonly includes things such as: (none) ) -(defmethod update-values hud-dig-button ((this hud-dig-button)) +(defmethod update-values ((this hud-dig-button)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-dig-button ((this hud-dig-button)) +(defmethod init-callback ((this hud-dig-button)) (set! (-> this level) (level-get *level* 'dig3a)) (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd21))) (set! (-> this gui-id) diff --git a/goal_src/jak2/levels/dig/dig-part.gc b/goal_src/jak2/levels/dig/dig-part.gc index cdab7024431..6715c6d88bc 100644 --- a/goal_src/jak2/levels/dig/dig-part.gc +++ b/goal_src/jak2/levels/dig/dig-part.gc @@ -9,10 +9,6 @@ (deftype dig-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/dig/dig1-obs.gc b/goal_src/jak2/levels/dig/dig1-obs.gc index 12336e58fc4..5eddf092271 100644 --- a/goal_src/jak2/levels/dig/dig1-obs.gc +++ b/goal_src/jak2/levels/dig/dig1-obs.gc @@ -9,10 +9,6 @@ (deftype dig-conveyor (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) @@ -23,7 +19,7 @@ :origin-joint-index 3 ) -(defmethod init! dig-conveyor ((this dig-conveyor)) +(defmethod init! ((this dig-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (set! (-> this speed) 30720.0) (set! (-> this belt-radius) 15974.4) @@ -32,7 +28,7 @@ (none) ) -(defmethod get-art-group dig-conveyor ((this dig-conveyor)) +(defmethod get-art-group ((this dig-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-dig-conveyor" (the-as (pointer uint32) #f)) ) @@ -333,29 +329,22 @@ ) (deftype dig-bomb-crate-cylinder (rigid-body-object) - ((flash-counter int8 :offset-assert 272) - (attack-id uint32 :offset-assert 276) - (wait-time time-frame :offset-assert 280) + ((flash-counter int8) + (attack-id uint32) + (wait-time time-frame) ) - :heap-base #xa0 - :method-count-assert 54 - :size-assert #x120 - :flag-assert #x3600a00120 - (:methods - (die () _type_ :state 53) + (:state-methods + die ) ) (deftype dig-bomb-crate-cylinder-spawn-params (structure) - ((pos vector :inline :offset-assert 0) - (vel vector :inline :offset-assert 16) - (avel vector :inline :offset-assert 32) - (quat quaternion :inline :offset-assert 48) + ((pos vector :inline) + (vel vector :inline) + (avel vector :inline) + (quat quaternion :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) @@ -549,7 +538,7 @@ ) ) -(defmethod rigid-body-object-method-46 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 ((this dig-bomb-crate-cylinder) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('track) #t @@ -561,12 +550,12 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod rigid-body-object-method-47 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder) - (arg0 process-drawable) - (arg1 attack-info) - (arg2 touching-shapes-entry) - (arg3 penetrate) - ) +(defmethod rigid-body-object-method-47 ((this dig-bomb-crate-cylinder) + (arg0 process-drawable) + (arg1 attack-info) + (arg2 touching-shapes-entry) + (arg3 penetrate) + ) (the-as symbol (cond @@ -586,7 +575,7 @@ ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod rigid-body-object-method-45 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 ((this dig-bomb-crate-cylinder) (arg0 rigid-body-impact)) (let* ((f0-0 (-> arg0 impulse)) (f1-0 28672.0) (f30-0 (* f0-0 (/ 1.0 f1-0) (-> this info info inv-mass))) @@ -606,7 +595,7 @@ (none) ) -(defmethod rigid-body-object-method-37 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) +(defmethod rigid-body-object-method-37 ((this dig-bomb-crate-cylinder)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) (set! (-> a1-0 start-pos quad) (-> this rbody state position quad)) (vector-float*! (-> a1-0 move-dist) (-> this rbody state lin-velocity) (seconds-per-frame)) @@ -638,7 +627,7 @@ (none) ) -(defmethod allocate-and-init-cshape dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) +(defmethod allocate-and-init-cshape ((this dig-bomb-crate-cylinder)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -687,7 +676,7 @@ (none) ) -(defmethod init-skel-and-rigid-body dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) +(defmethod init-skel-and-rigid-body ((this dig-bomb-crate-cylinder)) (initialize-skeleton this (the-as @@ -725,14 +714,12 @@ (deftype dig-bomb-crate (process-focusable) () - :heap-base #x50 - :method-count-assert 30 - :size-assert #xcc - :flag-assert #x1e005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (dig-bomb-crate-method-29 (_type_ vector) none 29) + (dig-bomb-crate-method-29 (_type_ vector) none) ) ) @@ -779,7 +766,7 @@ ) ) -(defmethod dig-bomb-crate-method-29 dig-bomb-crate ((this dig-bomb-crate) (arg0 vector)) +(defmethod dig-bomb-crate-method-29 ((this dig-bomb-crate) (arg0 vector)) (let ((s4-0 (-> this root trans))) (dotimes (s3-0 8) (let ((a0-2 (-> *dig-bomb-crate-array* s3-0)) @@ -805,7 +792,7 @@ (none) ) -(defmethod get-trans dig-bomb-crate ((this dig-bomb-crate) (arg0 int)) +(defmethod get-trans ((this dig-bomb-crate) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (local-vars (v0-0 vector)) (let ((v1-0 (-> this root))) @@ -899,7 +886,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-bomb-crate ((this dig-bomb-crate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-bomb-crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -961,14 +948,10 @@ This commonly includes things such as: (deftype dig-jump-pad (bouncer) () - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd4 - :flag-assert #x19006000d4 ) -(defmethod init-skeleton! dig-jump-pad ((this dig-jump-pad)) +(defmethod init-skeleton! ((this dig-jump-pad)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-jump-pad" (the-as (pointer uint32) #f))) @@ -978,7 +961,7 @@ This commonly includes things such as: (none) ) -(defmethod bouncer-method-24 dig-jump-pad ((this dig-jump-pad)) +(defmethod bouncer-method-24 ((this dig-jump-pad)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) diff --git a/goal_src/jak2/levels/dig/dig2-obs.gc b/goal_src/jak2/levels/dig/dig2-obs.gc index 4a92aa76b3b..0ccb6883184 100644 --- a/goal_src/jak2/levels/dig/dig2-obs.gc +++ b/goal_src/jak2/levels/dig/dig2-obs.gc @@ -8,16 +8,12 @@ ;; DECOMP BEGINS (deftype dig-breakable-door (process-focusable) - ((anim basic :offset-assert 204) - (art-name basic :offset-assert 208) - (collide-mesh int32 :offset-assert 212) + ((anim basic) + (art-name basic) + (collide-mesh int32) ) - :heap-base #x60 - :method-count-assert 28 - :size-assert #xd8 - :flag-assert #x1c006000d8 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) @@ -41,7 +37,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-breakable-door ((this dig-breakable-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-breakable-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/dig/dig3-obs.gc b/goal_src/jak2/levels/dig/dig3-obs.gc index de520a2077a..717e656d1f5 100644 --- a/goal_src/jak2/levels/dig/dig3-obs.gc +++ b/goal_src/jak2/levels/dig/dig3-obs.gc @@ -239,19 +239,15 @@ ) (deftype dig-spikey-step (process-drawable) - ((smush smush-control :inline :offset-assert 200) - (init-quat quaternion :inline :offset-assert 240) - (shudder-angle float :offset-assert 256) - (rot-angle float :offset-assert 260) - (cycle-time float :offset-assert 264) - (cycle-offset float :offset-assert 268) + ((smush smush-control :inline) + (init-quat quaternion :inline) + (shudder-angle float) + (rot-angle float) + (cycle-time float) + (cycle-offset float) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x110 - :flag-assert #x1500900110 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -331,7 +327,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-spikey-step ((this dig-spikey-step) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-spikey-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -382,13 +378,9 @@ This commonly includes things such as: ) (deftype dig-spikey-sphere (projectile-bounce) - ((death-height float :offset-assert 496) - (pad-i1hb23h1b float :offset-assert 500) + ((death-height float) + (pad-i1hb23h1b float) ) - :heap-base #x180 - :method-count-assert 42 - :size-assert #x1f8 - :flag-assert #x2a018001f8 ) @@ -477,7 +469,7 @@ This commonly includes things such as: (-> arg0 status) ) -(defmethod init-proj-collision! dig-spikey-sphere ((this dig-spikey-sphere)) +(defmethod init-proj-collision! ((this dig-spikey-sphere)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -515,7 +507,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod play-impact-sound! dig-spikey-sphere ((this dig-spikey-sphere)) +(defmethod play-impact-sound! ((this dig-spikey-sphere)) "Plays impact sound" (let* ((a0-1 (-> this root)) (s5-0 (-> a0-1 status)) @@ -609,7 +601,7 @@ This commonly includes things such as: (none) ) -(defmethod init-proj-settings! dig-spikey-sphere ((this dig-spikey-sphere)) +(defmethod init-proj-settings! ((this dig-spikey-sphere)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this attack-mode) 'eco-dark) (initialize-skeleton @@ -645,16 +637,12 @@ This commonly includes things such as: ) (deftype dig-spikey-sphere-door (process-drawable) - ((sync sync-linear :inline :offset-assert 200) - (prev-sync float :offset-assert 216) + ((sync sync-linear :inline) + (prev-sync float) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xdc - :flag-assert #x16006000dc - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) + (:state-methods + idle + active ) ) @@ -728,7 +716,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-spikey-sphere-door ((this dig-spikey-sphere-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-spikey-sphere-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -777,45 +765,39 @@ This commonly includes things such as: ) (deftype dig-balloon-lurker (process-drawable) - ((init-quat quaternion :inline :offset-assert 208) - (sync sync-eased :inline :offset-assert 224) - (swing-sync sync-linear :inline :offset-assert 272) - (smush smush-control :inline :offset-assert 288) - (pov-cam-offset vector :inline :offset-assert 320) - (options int32 :offset-assert 336) - (bouncing basic :offset-assert 340) - (bounce-scale meters :offset-assert 344) - (bob-counter float :offset-assert 348) - (forward-backward basic :offset-assert 352) - (grabbed basic :offset-assert 356) - (trapeze-grabbed basic :offset-assert 360) - (pedal-anim-frame float :offset-assert 364) - (pedal-anim-speed float :offset-assert 368) - (pedal-sound-id sound-id :offset-assert 372) + ((init-quat quaternion :inline) + (sync sync-eased :inline) + (swing-sync sync-linear :inline) + (smush smush-control :inline) + (pov-cam-offset vector :inline) + (options int32) + (bouncing basic) + (bounce-scale meters) + (bob-counter float) + (forward-backward basic) + (grabbed basic) + (trapeze-grabbed basic) + (pedal-anim-frame float) + (pedal-anim-speed float) + (pedal-sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 21 - :size-assert #x178 - :flag-assert #x1501000178 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype dig-balloon-lurker-trapeze (process-drawable) - ((parent-ptr (pointer dig-balloon-lurker) :offset 16) - (swing-type float :offset-assert 200) - (swing-pole (pointer swingpole) :offset-assert 204) - (swing-anim-frame float :offset-assert 208) + ((parent-ptr (pointer dig-balloon-lurker) :overlay-at parent) + (swing-type float) + (swing-pole (pointer swingpole)) + (swing-anim-frame float) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xd4 - :flag-assert #x16006000d4 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (dig-balloon-lurker-trapeze-method-21 (_type_) none 21) + (dig-balloon-lurker-trapeze-method-21 (_type_) none) ) ) @@ -898,7 +880,7 @@ This commonly includes things such as: :post ja-post ) -(defmethod dig-balloon-lurker-trapeze-method-21 dig-balloon-lurker-trapeze ((this dig-balloon-lurker-trapeze)) +(defmethod dig-balloon-lurker-trapeze-method-21 ((this dig-balloon-lurker-trapeze)) (cond ((and (-> this draw shadow) (zero? (-> this draw cur-lod)) @@ -958,7 +940,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-balloon-lurker ((this dig-balloon-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-balloon-lurker) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1063,7 +1045,7 @@ This commonly includes things such as: (none) ) -(defmethod deactivate dig-balloon-lurker ((this dig-balloon-lurker)) +(defmethod deactivate ((this dig-balloon-lurker)) (sound-stop (-> this pedal-sound-id)) ((method-of-type process-drawable deactivate) this) (none) @@ -1182,15 +1164,11 @@ This commonly includes things such as: ) (deftype dig-wheel-step (process-drawable) - ((anim-speed float :offset-assert 200) - (wheel-sound-id sound-id :offset-assert 204) + ((anim-speed float) + (wheel-sound-id sound-id) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1219,14 +1197,14 @@ This commonly includes things such as: :post rider-post ) -(defmethod deactivate dig-wheel-step ((this dig-wheel-step)) +(defmethod deactivate ((this dig-wheel-step)) (sound-stop (-> this wheel-sound-id)) ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-wheel-step ((this dig-wheel-step) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-wheel-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1300,15 +1278,11 @@ This commonly includes things such as: ) (deftype dig-tipping-rock (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 384) - (last-ridden-time time-frame :offset-assert 400) - (surface-height float :offset-assert 408) - (bubbling-sound-id sound-id :offset-assert 412) + ((anchor-point vector :inline) + (last-ridden-time time-frame) + (surface-height float) + (bubbling-sound-id sound-id) ) - :heap-base #x120 - :method-count-assert 57 - :size-assert #x1a0 - :flag-assert #x39012001a0 ) @@ -1351,7 +1325,7 @@ This commonly includes things such as: :origin-joint-index 3 ) -(defmethod rigid-body-object-method-37 dig-tipping-rock ((this dig-tipping-rock)) +(defmethod rigid-body-object-method-37 ((this dig-tipping-rock)) (let ((t9-0 (method-of-type rigid-body-platform rigid-body-object-method-37))) (t9-0 this) ) @@ -1402,14 +1376,14 @@ This commonly includes things such as: :event (-> (method-of-type dig-tipping-rock idle) event) ) -(defmethod rigid-body-object-method-29 dig-tipping-rock ((this dig-tipping-rock) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this dig-tipping-rock) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) ) -(defmethod allocate-and-init-cshape dig-tipping-rock ((this dig-tipping-rock)) +(defmethod allocate-and-init-cshape ((this dig-tipping-rock)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1437,11 +1411,11 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-platform-method-53 dig-tipping-rock ((this dig-tipping-rock) (arg0 vector)) +(defmethod rigid-body-platform-method-53 ((this dig-tipping-rock) (arg0 vector)) (-> this surface-height) ) -(defmethod init-skel-and-rigid-body dig-tipping-rock ((this dig-tipping-rock)) +(defmethod init-skel-and-rigid-body ((this dig-tipping-rock)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-tipping-rock" (the-as (pointer uint32) #f))) @@ -1489,14 +1463,10 @@ This commonly includes things such as: (deftype dig-wall-bouncer (bouncer) () - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd4 - :flag-assert #x19006000d4 ) -(defmethod init-skeleton! dig-wall-bouncer ((this dig-wall-bouncer)) +(defmethod init-skeleton! ((this dig-wall-bouncer)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-wall-bouncer" (the-as (pointer uint32) #f))) @@ -1506,7 +1476,7 @@ This commonly includes things such as: (none) ) -(defmethod bouncer-method-24 dig-wall-bouncer ((this dig-wall-bouncer)) +(defmethod bouncer-method-24 ((this dig-wall-bouncer)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) @@ -1565,16 +1535,12 @@ This commonly includes things such as: ) (deftype dig-stomp-block (rigid-body-object) - ((desty float :offset-assert 272) - (flag basic :offset-assert 276) + ((desty float) + (flag basic) ) - :heap-base #xa0 - :method-count-assert 55 - :size-assert #x118 - :flag-assert #x3700a00118 - (:methods - (waiting () _type_ :state 53) - (hit () _type_ :state 54) + (:state-methods + waiting + hit ) ) @@ -1683,7 +1649,7 @@ This commonly includes things such as: ) ) -(defmethod rigid-body-object-method-37 dig-stomp-block ((this dig-stomp-block)) +(defmethod rigid-body-object-method-37 ((this dig-stomp-block)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) (set! (-> a1-0 start-pos quad) (-> this rbody state position quad)) (vector-float*! (-> a1-0 move-dist) (-> this rbody state lin-velocity) (seconds-per-frame)) @@ -1727,7 +1693,7 @@ This commonly includes things such as: (none) ) -(defmethod allocate-and-init-cshape dig-stomp-block ((this dig-stomp-block)) +(defmethod allocate-and-init-cshape ((this dig-stomp-block)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1822,7 +1788,7 @@ This commonly includes things such as: (none) ) -(defmethod init-skel-and-rigid-body dig-stomp-block ((this dig-stomp-block)) +(defmethod init-skel-and-rigid-body ((this dig-stomp-block)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-stomp-block" (the-as (pointer uint32) #f))) @@ -1850,15 +1816,11 @@ This commonly includes things such as: ) (deftype dig-stomp-block-controller (process-drawable) - ((stomp-blocks (pointer dig-stomp-block) 4 :offset-assert 200) - (played-fall? symbol :offset-assert 216) + ((stomp-blocks (pointer dig-stomp-block) 4) + (played-fall? symbol) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xdc - :flag-assert #x15006000dc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1931,7 +1893,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-stomp-block-controller ((this dig-stomp-block-controller) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-stomp-block-controller) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1947,12 +1909,8 @@ This commonly includes things such as: (deftype dig-totem (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1962,7 +1920,7 @@ This commonly includes things such as: :bounds (static-spherem 0 13 0 14.5) ) -(defmethod run-logic? dig-totem ((this dig-totem)) +(defmethod run-logic? ((this dig-totem)) #t ) @@ -1972,7 +1930,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-totem ((this dig-totem) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-totem) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/drill/drill-baron.gc b/goal_src/jak2/levels/drill/drill-baron.gc index 368b0f20e7b..fb5761d8b87 100644 --- a/goal_src/jak2/levels/drill/drill-baron.gc +++ b/goal_src/jak2/levels/drill/drill-baron.gc @@ -643,82 +643,71 @@ ) (deftype drill-barons-ship (process-drawable) - ((root collide-shape-moving :override) - (init-quat quaternion :inline :offset-assert 208) - (next-to-shoot-idx int32 :offset-assert 224) - (current-y-position float :offset-assert 228) - (from-y float :offset-assert 232) - (inc-y float :offset-assert 236) - (ease-y float :offset-assert 240) - (x-offset-angle float :offset-assert 244) - (pass int32 :offset-assert 248) - (end-of-pass symbol :offset-assert 252) - (rock-angle float :offset-assert 256) - (soundid uint32 :offset-assert 260) + ((root collide-shape-moving :override) + (init-quat quaternion :inline) + (next-to-shoot-idx int32) + (current-y-position float) + (from-y float) + (inc-y float) + (ease-y float) + (x-offset-angle float) + (pass int32) + (end-of-pass symbol) + (rock-angle float) + (soundid uint32) ) - :heap-base #x90 - :method-count-assert 23 - :size-assert #x108 - :flag-assert #x1700900108 + (:state-methods + idle + hidden + ) (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) - (drill-barons-ship-method-22 (_type_) none 22) + (drill-barons-ship-method-22 (_type_) none) ) ) (deftype drill-barons-ship-explode (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype barons-ship-turret-info (structure) - ((init-y-angle float :offset-assert 0) - (twist-y-max float :offset-assert 4) - (joint-idx int32 :offset-assert 8) - (mesh int32 :offset-assert 12) - (ship-y-offset float :offset-assert 16) - (alive symbol :offset-assert 20) - (next-to-shoot basic :offset-assert 24) + ((init-y-angle float) + (twist-y-max float) + (joint-idx int32) + (mesh int32) + (ship-y-offset float) + (alive symbol) + (next-to-shoot basic) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) (deftype drill-barons-ship-turret (process-drawable) - ((root collide-shape-moving :override) - (info barons-ship-turret-info :offset-assert 200) - (shot-timer time-frame :offset-assert 208) - (shot-counter int32 :offset-assert 216) - (jmod joint-mod :offset-assert 220) - (jmod-left joint-mod :offset-assert 224) - (jmod-right joint-mod :offset-assert 228) - (anim-frame float :offset-assert 232) - (error-y-angle float :offset-assert 236) - (error-y-angle-dest float :offset-assert 240) - (hit-count int32 :offset-assert 244) - (soundid sound-id :offset-assert 248) + ((root collide-shape-moving :override) + (info barons-ship-turret-info) + (shot-timer time-frame) + (shot-counter int32) + (jmod joint-mod) + (jmod-left joint-mod) + (jmod-right joint-mod) + (anim-frame float) + (error-y-angle float) + (error-y-angle-dest float) + (hit-count int32) + (soundid sound-id) ) - :heap-base #x80 - :method-count-assert 25 - :size-assert #xfc - :flag-assert #x19008000fc + (:state-methods + idle + attack + dead + going-down + ) (:methods - (idle () _type_ :state 20) - (attack () _type_ :state 21) - (dead () _type_ :state 22) - (going-down () _type_ :state 23) - (drill-barons-ship-turret-method-24 (_type_) none 24) + (drill-barons-ship-turret-method-24 (_type_) none) ) ) @@ -977,7 +966,7 @@ (none) ) -(defmethod relocate drill-barons-ship-turret ((this drill-barons-ship-turret) (arg0 int)) +(defmethod relocate ((this drill-barons-ship-turret) (arg0 int)) (when (-> this jmod) (if (nonzero? (-> this jmod)) (&+! (-> this jmod) arg0) @@ -997,7 +986,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-barons-ship ((this drill-barons-ship) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-barons-ship) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1089,14 +1078,10 @@ This commonly includes things such as: (deftype drill-ship-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) -(defmethod deal-damage! drill-ship-shot ((this drill-ship-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! ((this drill-ship-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (if (not (and (-> (the-as drill-barons-ship (-> this parent 0)) next-state) (= (-> (the-as drill-barons-ship (-> this parent 0)) next-state name) 'hidden) @@ -1113,7 +1098,7 @@ This commonly includes things such as: (none) ) -(defmethod init-proj-settings! drill-ship-shot ((this drill-ship-shot)) +(defmethod init-proj-settings! ((this drill-ship-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (call-parent-method this) (set! (-> this attack-mode) 'drill-ship-shot) @@ -1362,7 +1347,7 @@ This commonly includes things such as: ) ) -(defmethod drill-barons-ship-method-22 drill-barons-ship ((this drill-barons-ship)) +(defmethod drill-barons-ship-method-22 ((this drill-barons-ship)) (with-pp (quaternion-rotate-local-x! (-> this root quat) @@ -1416,7 +1401,7 @@ This commonly includes things such as: ) ) -(defmethod drill-barons-ship-turret-method-24 drill-barons-ship-turret ((this drill-barons-ship-turret)) +(defmethod drill-barons-ship-turret-method-24 ((this drill-barons-ship-turret)) (vector<-cspace! (-> this root trans) (-> (the-as drill-barons-ship (-> this parent 0)) node-list data (-> this info joint-idx)) diff --git a/goal_src/jak2/levels/drill/drill-mech-master.gc b/goal_src/jak2/levels/drill/drill-mech-master.gc index c0efd1e29d4..eeedb626f02 100644 --- a/goal_src/jak2/levels/drill/drill-mech-master.gc +++ b/goal_src/jak2/levels/drill/drill-mech-master.gc @@ -9,7 +9,7 @@ ;; DECOMP BEGINS -(defmethod draw hud-cpanel ((this hud-cpanel)) +(defmethod draw ((this hud-cpanel)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 502.0 (* 130.0 (-> this offset)))) @@ -22,14 +22,14 @@ (none) ) -(defmethod update-values hud-cpanel ((this hud-cpanel)) +(defmethod update-values ((this hud-cpanel)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-cpanel ((this hud-cpanel)) +(defmethod init-callback ((this hud-cpanel)) (set! (-> this level) (level-get *level* 'drillmid)) (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #xb1e))) (set! (-> this gui-id) @@ -47,38 +47,36 @@ ) (deftype drill-mech-master (process) - ((cpanel-count int8 :offset-assert 128) - (alarm-sound-id sound-id :offset-assert 132) - (explosion-sound-id sound-id :offset-assert 136) - (exited? symbol :offset-assert 140) - (killed-jak? symbol :offset-assert 144) - (part-doom sparticle-launch-control :offset-assert 148) - (hud-cpanel handle :offset-assert 152) - (hud-timer handle :offset-assert 160) - (scene-player-handle handle :offset-assert 168) - (state-time time-frame :offset-assert 176) - (next-warn-time time-frame :offset-assert 184) - (total-countdown-time time-frame :offset-assert 192) - (started-timer-time time-frame :offset-assert 200) + ((cpanel-count int8) + (alarm-sound-id sound-id) + (explosion-sound-id sound-id) + (exited? symbol) + (killed-jak? symbol) + (part-doom sparticle-launch-control) + (hud-cpanel handle) + (hud-timer handle) + (scene-player-handle handle) + (state-time time-frame) + (next-warn-time time-frame) + (total-countdown-time time-frame) + (started-timer-time time-frame) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14005000d0 + (:state-methods + idle + active + hostile + failed + victory + ) (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (hostile () _type_ :state 16) - (failed () _type_ :state 17) - (victory () _type_ :state 18) - (spawn-hud-panel (_type_ symbol) none 19) + (spawn-hud-panel (_type_ symbol) none) ) ) (define *drill-mech-master* (the-as (pointer drill-mech-master) #f)) -(defmethod deactivate drill-mech-master ((this drill-mech-master)) +(defmethod deactivate ((this drill-mech-master)) (set! *drill-mech-master* (the-as (pointer drill-mech-master) #f)) (if (nonzero? (-> this alarm-sound-id)) (sound-stop (-> this alarm-sound-id)) @@ -91,7 +89,7 @@ ) ;; WARN: Return type mismatch process vs drill-mech-master. -(defmethod relocate drill-mech-master ((this drill-mech-master) (arg0 int)) +(defmethod relocate ((this drill-mech-master) (arg0 int)) (if (nonzero? (-> this part-doom)) (&+! (-> this part-doom) arg0) ) @@ -126,7 +124,7 @@ ) ) -(defmethod spawn-hud-panel drill-mech-master ((this drill-mech-master) (arg0 symbol)) +(defmethod spawn-hud-panel ((this drill-mech-master) (arg0 symbol)) "Spawn the hud panel for the drill-mech mission." (cond ((and arg0 (nonzero? (-> this cpanel-count))) diff --git a/goal_src/jak2/levels/drill/drill-obs.gc b/goal_src/jak2/levels/drill/drill-obs.gc index ee22267e75b..d1befd03437 100644 --- a/goal_src/jak2/levels/drill/drill-obs.gc +++ b/goal_src/jak2/levels/drill/drill-obs.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod draw hud-gruntegg ((this hud-gruntegg)) +(defmethod draw ((this hud-gruntegg)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 462.0 (* 130.0 (-> this offset)))) @@ -20,14 +20,14 @@ (none) ) -(defmethod update-values hud-gruntegg ((this hud-gruntegg)) +(defmethod update-values ((this hud-gruntegg)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-gruntegg ((this hud-gruntegg)) +(defmethod init-callback ((this hud-gruntegg)) (set! (-> this level) (level-get *level* 'drillmid)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-lower-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -44,7 +44,7 @@ (none) ) -(defmethod draw hud-crimsonhover ((this hud-crimsonhover)) +(defmethod draw ((this hud-crimsonhover)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 462.0 (* 130.0 (-> this offset)))) @@ -57,14 +57,14 @@ (none) ) -(defmethod update-values hud-crimsonhover ((this hud-crimsonhover)) +(defmethod update-values ((this hud-crimsonhover)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-crimsonhover ((this hud-crimsonhover)) +(defmethod init-callback ((this hud-crimsonhover)) (set! (-> this level) (level-get *level* 'drillmid)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-lower-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -82,15 +82,11 @@ ) (deftype drill-plat-falling (base-plat) - ((init-quat quaternion :inline :offset-assert 272) + ((init-quat quaternion :inline) ) - :heap-base #xa0 - :method-count-assert 36 - :size-assert #x120 - :flag-assert #x2400a00120 - (:methods - (idle () _type_ :state 34) - (falling () _type_ :state 35) + (:state-methods + idle + falling ) ) @@ -101,7 +97,7 @@ :longest-edge (meters 5.0046) ) -(defmethod start-bouncing! drill-plat-falling ((this drill-plat-falling)) +(defmethod start-bouncing! ((this drill-plat-falling)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" @@ -170,7 +166,7 @@ and translate the platform via the `smush` ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-plat-falling ((this drill-plat-falling) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-plat-falling) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -210,28 +206,22 @@ This commonly includes things such as: ) (deftype drill-elevator-shaft (process-drawable) - ((extent vector 2 :inline :offset-assert 208) - (length float :offset-assert 240) + ((extent vector 2 :inline) + (length float) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf4 - :flag-assert #x16008000f4 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (set-extent! (_type_ vector) none 21) + (set-extent! (_type_ vector) none) ) ) (deftype drill-elevator (elevator) - ((shaft (pointer drill-elevator-shaft) :offset-assert 368) - (sound-id sound-id :offset-assert 372) + ((shaft (pointer drill-elevator-shaft)) + (sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 49 - :size-assert #x178 - :flag-assert #x3101000178 ) @@ -240,12 +230,12 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 7) ) -(defmethod get-art-group drill-elevator ((this drill-elevator)) +(defmethod get-art-group ((this drill-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-drill-elevator" (the-as (pointer uint32) #f)) ) -(defmethod init-plat-collision! drill-elevator ((this drill-elevator)) +(defmethod init-plat-collision! ((this drill-elevator)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -369,7 +359,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch vector vs none. -(defmethod set-extent! drill-elevator-shaft ((this drill-elevator-shaft) (arg0 vector)) +(defmethod set-extent! ((this drill-elevator-shaft) (arg0 vector)) (set! (-> this extent 1 quad) (-> arg0 quad)) (none) ) @@ -439,7 +429,7 @@ This commonly includes things such as: (none) ) -(defmethod move-between-points drill-elevator ((this drill-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this drill-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -458,20 +448,20 @@ This commonly includes things such as: ) ) -(defmethod deactivate drill-elevator ((this drill-elevator)) +(defmethod deactivate ((this drill-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod set-ambient-sound! drill-elevator ((this drill-elevator)) +(defmethod set-ambient-sound! ((this drill-elevator)) "Sets the elevator's [[ambient-sound]] up" (set! (-> this sound-id) (new-sound-id)) (none) ) -(defmethod activate-elevator drill-elevator ((this drill-elevator)) +(defmethod activate-elevator ((this drill-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (if (or (not (task-node-closed? (game-task-node drill-ship-introduction))) (task-node-closed? (game-task-node nest-boss-resolution)) @@ -481,7 +471,7 @@ This commonly includes things such as: ) ) -(defmethod init-plat! drill-elevator ((this drill-elevator)) +(defmethod init-plat! ((this drill-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this shaft) @@ -492,12 +482,8 @@ For example for an elevator pre-compute the distance between the first and last ) (deftype drill-mech-elevator (drill-elevator) - ((running-sound-id sound-id :offset-assert 376) + ((running-sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 49 - :size-assert #x17c - :flag-assert #x310100017c ) @@ -550,7 +536,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod commited-to-ride? drill-mech-elevator ((this drill-mech-elevator)) +(defmethod commited-to-ride? ((this drill-mech-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (when (= (-> this move-pos 1) (-> this bottom-top 0)) (let* ((s5-0 *target*) @@ -571,7 +557,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod move-to-next-point! drill-mech-elevator ((this drill-mech-elevator)) +(defmethod move-to-next-point! ((this drill-mech-elevator)) "If the [[*target*]] is in a valid state and there is a point to transition to in the elevator's path do so. @see [[elevator::47]]" @@ -599,7 +585,7 @@ do so. (none) ) -(defmethod deactivate drill-mech-elevator ((this drill-mech-elevator)) +(defmethod deactivate ((this drill-mech-elevator)) (if (nonzero? (-> this running-sound-id)) (sound-stop (-> this running-sound-id)) ) @@ -607,7 +593,7 @@ do so. (none) ) -(defmethod init-plat! drill-mech-elevator ((this drill-mech-elevator)) +(defmethod init-plat! ((this drill-mech-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this running-sound-id) (new 'static 'sound-id)) @@ -615,34 +601,32 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod activate-elevator drill-mech-elevator ((this drill-mech-elevator)) +(defmethod activate-elevator ((this drill-mech-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (go (method-of-object this waiting)) ) (deftype fire-floor (process-drawable) - ((root collide-shape-moving :override) - (part-off sparticle-launch-control :offset-assert 200) - (size float 2 :offset-assert 204) - (attack-id uint32 :offset-assert 212) - (sound-id sound-id :offset-assert 216) - (sound-playing symbol :offset-assert 220) - (deadly-width float :offset-assert 224) - (deadly-length float :offset-assert 228) - (flames-end-tt float :offset-assert 232) - (generous float :offset-assert 236) - (no-collision-timer time-frame :offset-assert 240) - (local-to-world matrix :inline :offset-assert 256) - (world-to-local matrix :inline :offset-assert 320) - (sync sync-linear :inline :offset-assert 384) + ((root collide-shape-moving :override) + (part-off sparticle-launch-control) + (size float 2) + (attack-id uint32) + (sound-id sound-id) + (sound-playing symbol) + (deadly-width float) + (deadly-length float) + (flames-end-tt float) + (generous float) + (no-collision-timer time-frame) + (local-to-world matrix :inline) + (world-to-local matrix :inline) + (sync sync-linear :inline) ) - :heap-base #x110 - :method-count-assert 22 - :size-assert #x190 - :flag-assert #x1601100190 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (set-part (_type_) none 21) + (set-part (_type_) none) ) ) @@ -801,7 +785,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod set-part fire-floor ((this fire-floor)) +(defmethod set-part ((this fire-floor)) "Set the particle launch controls for the on/off states." (set! (-> this part) (create-launch-control (-> *part-group-id-table* 399) this)) (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 398) this)) @@ -809,14 +793,14 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod relocate fire-floor ((this fire-floor) (arg0 int)) +(defmethod relocate ((this fire-floor) (arg0 int)) (if (nonzero? (-> this part-off)) (&+! (-> this part-off) arg0) ) (call-parent-method this arg0) ) -(defmethod deactivate fire-floor ((this fire-floor)) +(defmethod deactivate ((this fire-floor)) (sound-stop (-> this sound-id)) (if (nonzero? (-> this part-off)) (kill-and-free-particles (-> this part-off)) @@ -826,7 +810,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fire-floor ((this fire-floor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fire-floor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -928,14 +912,10 @@ This commonly includes things such as: (deftype fire-floor-a (fire-floor) () - :heap-base #x110 - :method-count-assert 22 - :size-assert #x190 - :flag-assert #x1601100190 ) -(defmethod set-part fire-floor-a ((this fire-floor-a)) +(defmethod set-part ((this fire-floor-a)) "Set the particle launch controls for the on/off states." (set! (-> this part) (create-launch-control (-> *part-group-id-table* 401) this)) (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 400) this)) @@ -994,16 +974,12 @@ This commonly includes things such as: ) (deftype drill-switch (basebutton) - ((green-part sparticle-launch-control :offset-assert 288) - (down-frame float :offset-assert 292) + ((green-part sparticle-launch-control) + (down-frame float) ) - :heap-base #xb0 - :method-count-assert 41 - :size-assert #x128 - :flag-assert #x2900b00128 (:methods - (drill-switch-method-39 (_type_) none 39) - (set-switch-color (_type_ symbol) none 40) + (drill-switch-method-39 (_type_) none) + (set-switch-color (_type_ symbol) none) ) ) @@ -1014,14 +990,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch basebutton vs drill-switch. -(defmethod relocate drill-switch ((this drill-switch) (arg0 int)) +(defmethod relocate ((this drill-switch) (arg0 int)) (if (nonzero? (-> this green-part)) (&+! (-> this green-part) arg0) ) (the-as drill-switch ((method-of-type basebutton relocate) this arg0)) ) -(defmethod deactivate drill-switch ((this drill-switch)) +(defmethod deactivate ((this drill-switch)) (if (nonzero? (-> this green-part)) (kill-and-free-particles (-> this green-part)) ) @@ -1029,7 +1005,7 @@ This commonly includes things such as: (none) ) -(defmethod set-switch-color drill-switch ((this drill-switch) (arg0 symbol)) +(defmethod set-switch-color ((this drill-switch) (arg0 symbol)) "Set the switch color based on its state." (when (or arg0 (not (logtest? (current-time) 64))) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -1046,7 +1022,7 @@ This commonly includes things such as: (none) ) -(defmethod basebutton-method-34 drill-switch ((this drill-switch)) +(defmethod basebutton-method-34 ((this drill-switch)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1249,7 +1225,7 @@ This commonly includes things such as: ) ) -(defmethod press! drill-switch ((this drill-switch) (arg0 symbol)) +(defmethod press! ((this drill-switch) (arg0 symbol)) (if arg0 (logior! (-> this button-status) (button-status pressed)) (logclear! (-> this button-status) (button-status pressed)) @@ -1262,7 +1238,7 @@ This commonly includes things such as: ) ) -(defmethod basebutton-method-33 drill-switch ((this drill-switch)) +(defmethod basebutton-method-33 ((this drill-switch)) "TODO - joint stuff" (initialize-skeleton this @@ -1283,7 +1259,7 @@ This commonly includes things such as: (none) ) -(defmethod prepare-trigger-event! drill-switch ((this drill-switch)) +(defmethod prepare-trigger-event! ((this drill-switch)) "Sets `event-going-down` to `'trigger`" (set! (-> this down-frame) 2.0) (logior! (-> this button-status) (button-status button-status-3)) @@ -1359,23 +1335,19 @@ This commonly includes things such as: ) (deftype drill-laser (process-drawable) - ((speed float :offset-assert 200) - (offset float :offset-assert 204) - (pause float :offset-assert 208) - (firing? symbol :offset-assert 212) - (hit-sound-id sound-id :offset-assert 216) + ((speed float) + (offset float) + (pause float) + (firing? symbol) + (hit-sound-id sound-id) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xdc - :flag-assert #x15006000dc - (:methods - (drill-laser-idle () _type_ :state 20) + (:state-methods + drill-laser-idle ) ) -(defmethod deactivate drill-laser ((this drill-laser)) +(defmethod deactivate ((this drill-laser)) (sound-stop (-> this hit-sound-id)) ((method-of-type process-drawable deactivate) this) (none) @@ -1481,7 +1453,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-laser ((this drill-laser) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-laser) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/drill/drill-obs2.gc b/goal_src/jak2/levels/drill/drill-obs2.gc index 26805c9d53f..17985079e2a 100644 --- a/goal_src/jak2/levels/drill/drill-obs2.gc +++ b/goal_src/jak2/levels/drill/drill-obs2.gc @@ -9,17 +9,15 @@ (deftype drill-flip-step (base-plat) () - :heap-base #x90 - :method-count-assert 40 - :size-assert #x110 - :flag-assert #x2800900110 + (:state-methods + down + up + swing-down + swing-up + ) (:methods - (down () _type_ :state 34) - (up () _type_ :state 35) - (swing-down () _type_ :state 36) - (swing-up () _type_ :state 37) - (get-skel (_type_) art-group 38) - (set-flipped-state (_type_) none 39) + (get-skel (_type_) art-group) + (set-flipped-state (_type_) none) ) ) @@ -127,7 +125,7 @@ :post plat-post ) -(defmethod init-plat-collision! drill-flip-step ((this drill-flip-step)) +(defmethod init-plat-collision! ((this drill-flip-step)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) @@ -173,11 +171,11 @@ (none) ) -(defmethod get-skel drill-flip-step ((this drill-flip-step)) +(defmethod get-skel ((this drill-flip-step)) (art-group-get-by-name *level* "skel-drill-flip-step" (the-as (pointer uint32) #f)) ) -(defmethod set-flipped-state drill-flip-step ((this drill-flip-step)) +(defmethod set-flipped-state ((this drill-flip-step)) "Set the state of the platform based on the completion of the drill-mech task." (if (and (= (-> this entity extra perm task) (game-task drill-mech)) (task-node-closed? (game-task-node drill-mech-smash-consoles)) @@ -192,7 +190,7 @@ (none) ) -(defmethod init-from-entity! drill-flip-step ((this drill-flip-step) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-flip-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -212,18 +210,14 @@ This commonly includes things such as: ) (deftype drill-falling-door (process-drawable) - ((root collide-shape-moving :override) - (hit-state int32 :offset-assert 200) - (next-hit-state int32 :offset-assert 204) + ((root collide-shape-moving :override) + (hit-state int32) + (next-hit-state int32) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xd0 - :flag-assert #x17005000d0 - (:methods - (idle () _type_ :state 20) - (hit () _type_ :state 21) - (fall (symbol) _type_ :state 22) + (:state-methods + idle + hit + (fall symbol) ) ) @@ -349,7 +343,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-falling-door ((this drill-falling-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-falling-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -410,13 +404,9 @@ This commonly includes things such as: (deftype drill-sliding-door (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) + (:state-methods + idle + open ) ) @@ -457,7 +447,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-sliding-door ((this drill-sliding-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-sliding-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -515,10 +505,6 @@ This commonly includes things such as: (deftype drill-accelerator-floor (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) @@ -527,12 +513,12 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 9) ) -(defmethod get-art-group drill-accelerator-floor ((this drill-accelerator-floor)) +(defmethod get-art-group ((this drill-accelerator-floor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-drill-accelerator-floor" (the-as (pointer uint32) #f)) ) -(defmethod init! drill-accelerator-floor ((this drill-accelerator-floor)) +(defmethod init! ((this drill-accelerator-floor)) "Initializes defaults for things like the `speed` and `belt-radius`" (set! (-> this speed) 7372.8) (set! (-> this belt-radius) 11878.4) @@ -541,7 +527,7 @@ This commonly includes things such as: (none) ) -(defmethod reset-root! drill-accelerator-floor ((this drill-accelerator-floor)) +(defmethod reset-root! ((this drill-accelerator-floor)) "Re-initializes the `root` [[trsqv]]" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -589,12 +575,8 @@ This commonly includes things such as: (deftype drill-breakable-barrel (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -620,7 +602,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-breakable-barrel ((this drill-breakable-barrel) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-breakable-barrel) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -658,20 +640,18 @@ This commonly includes things such as: ) (deftype drill-metalhead-eggs (process-drawable) - ((root collide-shape-moving :override) - (actor-group actor-group :offset-assert 200) - (notify-actor entity-actor :offset-assert 204) + ((root collide-shape-moving :override) + (actor-group actor-group) + (notify-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 25 - :size-assert #xd0 - :flag-assert #x19005000d0 + (:state-methods + idle + die + die-fast + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (die-fast () _type_ :state 22) - (skel-init! (_type_) none 23) - (init-collision! (_type_) none 24) + (skel-init! (_type_) none) + (init-collision! (_type_) none) ) ) @@ -836,7 +816,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-metalhead-eggs ((this drill-metalhead-eggs) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-metalhead-eggs) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -879,28 +859,16 @@ This commonly includes things such as: (deftype drill-metalhead-eggs-a (drill-metalhead-eggs) () - :heap-base #x50 - :method-count-assert 25 - :size-assert #xd0 - :flag-assert #x19005000d0 ) (deftype drill-metalhead-eggs-b (drill-metalhead-eggs) () - :heap-base #x50 - :method-count-assert 25 - :size-assert #xd0 - :flag-assert #x19005000d0 ) (deftype drill-metalhead-eggs-c (drill-metalhead-eggs) () - :heap-base #x50 - :method-count-assert 25 - :size-assert #xd0 - :flag-assert #x19005000d0 ) @@ -919,7 +887,7 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0.3 2) ) -(defmethod skel-init! drill-metalhead-eggs-a ((this drill-metalhead-eggs-a)) +(defmethod skel-init! ((this drill-metalhead-eggs-a)) "Initialize the skeleton and animations for this object." (initialize-skeleton this @@ -938,7 +906,7 @@ This commonly includes things such as: (none) ) -(defmethod init-collision! drill-metalhead-eggs-a ((this drill-metalhead-eggs-a)) +(defmethod init-collision! ((this drill-metalhead-eggs-a)) "Define the collision for this object." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -961,7 +929,7 @@ This commonly includes things such as: (none) ) -(defmethod skel-init! drill-metalhead-eggs-b ((this drill-metalhead-eggs-b)) +(defmethod skel-init! ((this drill-metalhead-eggs-b)) "Initialize the skeleton and animations for this object." (initialize-skeleton this @@ -980,7 +948,7 @@ This commonly includes things such as: (none) ) -(defmethod init-collision! drill-metalhead-eggs-b ((this drill-metalhead-eggs-b)) +(defmethod init-collision! ((this drill-metalhead-eggs-b)) "Define the collision for this object." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1003,7 +971,7 @@ This commonly includes things such as: (none) ) -(defmethod skel-init! drill-metalhead-eggs-c ((this drill-metalhead-eggs-c)) +(defmethod skel-init! ((this drill-metalhead-eggs-c)) "Initialize the skeleton and animations for this object." (initialize-skeleton this @@ -1022,7 +990,7 @@ This commonly includes things such as: (none) ) -(defmethod init-collision! drill-metalhead-eggs-c ((this drill-metalhead-eggs-c)) +(defmethod init-collision! ((this drill-metalhead-eggs-c)) "Define the collision for this object." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1046,17 +1014,13 @@ This commonly includes things such as: ) (deftype drill-bridge-shot (process-drawable) - ((root collide-shape-moving :override) - (anim art-joint-anim :offset-assert 200) - (art-name string :offset-assert 204) + ((root collide-shape-moving :override) + (anim art-joint-anim) + (art-name string) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (die (symbol) _type_ :state 21) + (:state-methods + idle + (die symbol) ) ) @@ -1179,7 +1143,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-bridge-shot ((this drill-bridge-shot) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-bridge-shot) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1240,12 +1204,8 @@ This commonly includes things such as: (deftype drill-drill (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1271,7 +1231,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-drill ((this drill-drill) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-drill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1291,13 +1251,9 @@ This commonly includes things such as: ) (deftype drill-drop-plat (drill-flip-step) - ((ridden? symbol :offset-assert 272) - (not-ridden-timer time-frame :offset-assert 280) + ((ridden? symbol) + (not-ridden-timer time-frame) ) - :heap-base #xa0 - :method-count-assert 40 - :size-assert #x120 - :flag-assert #x2800a00120 ) @@ -1358,11 +1314,11 @@ This commonly includes things such as: ) ) -(defmethod get-skel drill-drop-plat ((this drill-drop-plat)) +(defmethod get-skel ((this drill-drop-plat)) (art-group-get-by-name *level* "skel-drill-drop-plat" (the-as (pointer uint32) #f)) ) -(defmethod set-flipped-state drill-drop-plat ((this drill-drop-plat)) +(defmethod set-flipped-state ((this drill-drop-plat)) "Set the state of the platform." (set-time! (-> this not-ridden-timer)) (go (method-of-object this up)) @@ -1370,7 +1326,7 @@ This commonly includes things such as: (none) ) -(defmethod init-plat-collision! drill-drop-plat ((this drill-drop-plat)) +(defmethod init-plat-collision! ((this drill-drop-plat)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) diff --git a/goal_src/jak2/levels/drill/drill-panel.gc b/goal_src/jak2/levels/drill/drill-panel.gc index b8583bc0d3f..a18eeb5d334 100644 --- a/goal_src/jak2/levels/drill/drill-panel.gc +++ b/goal_src/jak2/levels/drill/drill-panel.gc @@ -23,35 +23,33 @@ ) (deftype drill-control-panel (process-focusable) - ((id int8 :offset-assert 204) - (idle-sound-id sound-id :offset-assert 208) - (debris-part sparticle-launch-control :offset-assert 212) - (next-warn-time time-frame :offset 224) + ((id int8) + (idle-sound-id sound-id) + (debris-part sparticle-launch-control) + (next-warn-time time-frame :offset 224) ) - :heap-base #x70 - :method-count-assert 33 - :size-assert #xe8 - :flag-assert #x21007000e8 + (:state-methods + idle + (hit symbol) + ) (:methods - (idle () _type_ :state 27) - (hit (symbol) _type_ :state 28) - (init-collision! (_type_) none 29) - (init-panel (_type_) none 30) - (spawn-shock-part (_type_) none 31) - (spawn-explode-part (_type_) none 32) + (init-collision! (_type_) none) + (init-panel (_type_) none) + (spawn-shock-part (_type_) none) + (spawn-explode-part (_type_) none) ) ) ;; WARN: Return type mismatch process-drawable vs drill-control-panel. -(defmethod relocate drill-control-panel ((this drill-control-panel) (arg0 int)) +(defmethod relocate ((this drill-control-panel) (arg0 int)) (if (nonzero? (-> this debris-part)) (&+! (-> this debris-part) arg0) ) (the-as drill-control-panel ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate drill-control-panel ((this drill-control-panel)) +(defmethod deactivate ((this drill-control-panel)) (sound-stop (-> this idle-sound-id)) (if (nonzero? (-> this debris-part)) (kill-and-free-particles (-> this debris-part)) @@ -501,7 +499,7 @@ (none) ) -(defmethod spawn-explode-part drill-control-panel ((this drill-control-panel)) +(defmethod spawn-explode-part ((this drill-control-panel)) "Spawn explosion particles." (let ((v1-0 (-> this id))) (if (or (zero? v1-0) (= v1-0 1)) @@ -512,7 +510,7 @@ (none) ) -(defmethod spawn-shock-part drill-control-panel ((this drill-control-panel)) +(defmethod spawn-shock-part ((this drill-control-panel)) "Spawn shock particles." (let ((v1-0 (-> this id))) (cond @@ -677,7 +675,7 @@ ) ) -(defmethod init-collision! drill-control-panel ((this drill-control-panel)) +(defmethod init-collision! ((this drill-control-panel)) "Define the collision for the panel." (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -705,7 +703,7 @@ (none) ) -(defmethod init-panel drill-control-panel ((this drill-control-panel)) +(defmethod init-panel ((this drill-control-panel)) "Init some parameters for the panel." (set! (-> this idle-sound-id) (new-sound-id)) (logior! (-> this mask) (process-mask crate)) @@ -715,7 +713,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-control-panel ((this drill-control-panel) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-control-panel) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -751,15 +749,11 @@ This commonly includes things such as: (deftype drill-control-panel-a (drill-control-panel) () - :heap-base #x70 - :method-count-assert 33 - :size-assert #xe8 - :flag-assert #x21007000e8 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-control-panel-a ((this drill-control-panel-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-control-panel-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -825,8 +819,4 @@ This commonly includes things such as: (deftype drill-control-panel-b (drill-control-panel-a) () - :heap-base #x70 - :method-count-assert 33 - :size-assert #xe8 - :flag-assert #x21007000e8 ) diff --git a/goal_src/jak2/levels/drill/drill-part.gc b/goal_src/jak2/levels/drill/drill-part.gc index 1950f9122b7..882d852a8ee 100644 --- a/goal_src/jak2/levels/drill/drill-part.gc +++ b/goal_src/jak2/levels/drill/drill-part.gc @@ -9,10 +9,6 @@ (deftype drill-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/drill/drill-spool.gc b/goal_src/jak2/levels/drill/drill-spool.gc index 5fd4166e54e..8c48e06163f 100644 --- a/goal_src/jak2/levels/drill/drill-spool.gc +++ b/goal_src/jak2/levels/drill/drill-spool.gc @@ -722,17 +722,13 @@ ) (deftype drill-wall (process-focusable) - ((anim spool-anim :offset-assert 204) - (art-name string :offset-assert 208) - (egg-group actor-group :offset-assert 212) + ((anim spool-anim) + (art-name string) + (egg-group actor-group) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd8 - :flag-assert #x1d006000d8 - (:methods - (idle () _type_ :state 27) - (hit (symbol) _type_ :state 28) + (:state-methods + idle + (hit symbol) ) ) @@ -860,7 +856,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-wall ((this drill-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -946,17 +942,13 @@ This commonly includes things such as: ) (deftype drill-crane (process-focusable) - ((anim spool-anim :offset-assert 204) - (art-name string :offset-assert 208) - (egg-group actor-group :offset-assert 212) + ((anim spool-anim) + (art-name string) + (egg-group actor-group) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd8 - :flag-assert #x1d006000d8 - (:methods - (idle () _type_ :state 27) - (hit (symbol) _type_ :state 28) + (:state-methods + idle + (hit symbol) ) ) @@ -1136,7 +1128,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-crane ((this drill-crane) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-crane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/drill/drillmid-obs.gc b/goal_src/jak2/levels/drill/drillmid-obs.gc index 764571d0c93..6270e30cfc0 100644 --- a/goal_src/jak2/levels/drill/drillmid-obs.gc +++ b/goal_src/jak2/levels/drill/drillmid-obs.gc @@ -14,15 +14,11 @@ (deftype drill-elevator-doors (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-elevator-doors ((this drill-elevator-doors) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-elevator-doors) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -82,14 +78,10 @@ This commonly includes things such as: ) (deftype drill-lift (elevator) - ((sound-id sound-id :offset-assert 368) + ((sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 50 - :size-assert #x174 - :flag-assert #x3201000174 (:methods - (set-collide-spec! (_type_ symbol) none 49) + (set-collide-spec! (_type_ symbol) none) ) ) @@ -99,12 +91,12 @@ This commonly includes things such as: :bounds (static-spherem 0 0 6 10) ) -(defmethod get-art-group drill-lift ((this drill-lift)) +(defmethod get-art-group ((this drill-lift)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-drill-lift" (the-as (pointer uint32) #f)) ) -(defmethod move-between-points drill-lift ((this drill-lift) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this drill-lift) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -123,7 +115,7 @@ This commonly includes things such as: ) ) -(defmethod commited-to-ride? drill-lift ((this drill-lift)) +(defmethod commited-to-ride? ((this drill-lift)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) @@ -142,7 +134,7 @@ This commonly includes things such as: ) ) -(defmethod set-collide-spec! drill-lift ((this drill-lift) (arg0 symbol)) +(defmethod set-collide-spec! ((this drill-lift) (arg0 symbol)) (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 @@ -207,7 +199,7 @@ This commonly includes things such as: ) ) -(defmethod init-plat-collision! drill-lift ((this drill-lift)) +(defmethod init-plat-collision! ((this drill-lift)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -250,10 +242,6 @@ This commonly includes things such as: (deftype drill-moving-staircase (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) @@ -262,13 +250,13 @@ This commonly includes things such as: :bounds (static-spherem 7 -2 -3.8 11) ) -(defmethod get-art-group drill-moving-staircase ((this drill-moving-staircase)) +(defmethod get-art-group ((this drill-moving-staircase)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-drill-moving-staircase" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch float vs none. -(defmethod init! drill-moving-staircase ((this drill-moving-staircase)) +(defmethod init! ((this drill-moving-staircase)) "Initializes defaults for things like the `speed` and `belt-radius`" (set! (-> this speed) 38912.0) (set! (-> this belt-radius) 11878.4) @@ -277,7 +265,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod reset-root! drill-moving-staircase ((this drill-moving-staircase)) +(defmethod reset-root! ((this drill-moving-staircase)) "Re-initializes the `root` [[trsqv]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) diff --git a/goal_src/jak2/levels/drill/ginsu.gc b/goal_src/jak2/levels/drill/ginsu.gc index 79de2f1e822..850eba8bd1d 100644 --- a/goal_src/jak2/levels/drill/ginsu.gc +++ b/goal_src/jak2/levels/drill/ginsu.gc @@ -115,51 +115,43 @@ ) (deftype ginsu-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype ginsu-global-info (basic) - ((prev-blue-hit int8 :offset-assert 4) - (blue-hit-anim int32 3 :offset-assert 8) + ((prev-blue-hit int8) + (blue-hit-anim int32 3) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) (deftype ginsu (nav-enemy) - ((blade-jm joint-mod :offset-assert 604) - (blade-speed cam-float-seeker :inline :offset-assert 608) - (blade-angle float :offset-assert 632) - (desired-distance float :offset-assert 636) - (spiral-time time-frame :offset-assert 640) - (blade-part sparticle-launch-control :offset-assert 648) - (ambush-path path-control :offset-assert 652) - (path-pos float :offset-assert 656) - (ambush-started symbol :offset-assert 660) - (blade-sound sound-id :offset-assert 664) - (blade-sound-playing symbol :offset-assert 668) - (grind-sound sound-id :offset-assert 672) - (grind-sound-playing symbol :offset-assert 676) - (grind-timer time-frame :offset-assert 680) + ((blade-jm joint-mod) + (blade-speed cam-float-seeker :inline) + (blade-angle float) + (desired-distance float) + (spiral-time time-frame) + (blade-part sparticle-launch-control) + (ambush-path path-control) + (path-pos float) + (ambush-started symbol) + (blade-sound sound-id) + (blade-sound-playing symbol) + (grind-sound sound-id) + (grind-sound-playing symbol) + (grind-timer time-frame) ) - :heap-base #x230 - :method-count-assert 184 - :size-assert #x2b0 - :flag-assert #xb8023002b0 + (:state-methods + anticipate-attack + attack + ) (:methods - (anticipate-attack () _type_ :state 178) - (attack () _type_ :state 179) - (ginsu-method-180 (_type_) none 180) - (ginsu-method-181 (_type_ vector) vector 181) - (ginsu-method-182 (_type_) none 182) - (ginsu-method-183 (_type_ symbol) none 183) + (ginsu-method-180 (_type_) none) + (ginsu-method-181 (_type_ vector) vector) + (ginsu-method-182 (_type_) none) + (ginsu-method-183 (_type_ symbol) none) ) ) @@ -307,7 +299,7 @@ (set! (-> *ginsu-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod ginsu-method-180 ginsu ((this ginsu)) +(defmethod ginsu-method-180 ((this ginsu)) (let ((v1-2 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) ) @@ -343,7 +335,7 @@ (none) ) -(defmethod ginsu-method-181 ginsu ((this ginsu) (arg0 vector)) +(defmethod ginsu-method-181 ((this ginsu) (arg0 vector)) (vector-reset! arg0) (let ((a0-2 (handle->process (-> this focus handle)))) (if a0-2 @@ -354,7 +346,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod track-target! ginsu ((this ginsu)) +(defmethod track-target! ((this ginsu)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -414,7 +406,7 @@ (none) ) -(defmethod ginsu-method-182 ginsu ((this ginsu)) +(defmethod ginsu-method-182 ((this ginsu)) (local-vars (s5-1 art-element)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'matrix)) @@ -482,7 +474,7 @@ (none) ) -(defmethod nav-enemy-method-142 ginsu ((this ginsu) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this ginsu) (arg0 nav-control)) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((a0-2 (handle->process (-> this focus handle)))) (cond @@ -518,7 +510,7 @@ ) ;; WARN: disable def twice: 11. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler ginsu ((this ginsu) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this ginsu) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v0-1 object)) @@ -880,7 +872,7 @@ ) ) -(defmethod go-hostile ginsu ((this ginsu)) +(defmethod go-hostile ((this ginsu)) (cond ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) (nav-enemy-method-163 this) @@ -901,7 +893,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle ginsu ((this ginsu)) +(defmethod go-idle ((this ginsu)) (if (not (logtest? (-> this ambush-path flags) (path-control-flag not-found))) (go (method-of-object this ambush)) (go (method-of-object this idle)) @@ -909,7 +901,7 @@ (none) ) -(defmethod deactivate ginsu ((this ginsu)) +(defmethod deactivate ((this ginsu)) (if (nonzero? (-> this blade-part)) (kill-and-free-particles (-> this blade-part)) ) @@ -924,7 +916,7 @@ ) ;; WARN: Return type mismatch nav-enemy vs ginsu. -(defmethod relocate ginsu ((this ginsu) (arg0 int)) +(defmethod relocate ((this ginsu) (arg0 int)) (if (nonzero? (-> this blade-jm)) (&+! (-> this blade-jm) arg0) ) @@ -937,7 +929,7 @@ (the-as ginsu ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod ginsu-method-183 ginsu ((this ginsu) (arg0 symbol)) +(defmethod ginsu-method-183 ((this ginsu) (arg0 symbol)) (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 @@ -954,7 +946,7 @@ (none) ) -(defmethod enemy-method-46 ginsu ((this ginsu) (arg0 int)) +(defmethod enemy-method-46 ((this ginsu) (arg0 int)) "@abstract" (case arg0 ((1) @@ -970,7 +962,7 @@ (none) ) -(defmethod init-enemy-collision! ginsu ((this ginsu)) +(defmethod init-enemy-collision! ((this ginsu)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1036,7 +1028,7 @@ (none) ) -(defmethod init-enemy! ginsu ((this ginsu)) +(defmethod init-enemy! ((this ginsu)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (stack-size-set! (-> this main-thread) 256) (initialize-skeleton diff --git a/goal_src/jak2/levels/forest/fish.gc b/goal_src/jak2/levels/forest/fish.gc index 7684a2e66bc..45eca9ea13c 100644 --- a/goal_src/jak2/levels/forest/fish.gc +++ b/goal_src/jak2/levels/forest/fish.gc @@ -25,12 +25,8 @@ (deftype minnow (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -82,30 +78,23 @@ ) (deftype fish (structure) - ((pos vector :inline :offset-assert 0) - (vel vector :inline :offset-assert 16) - (border-f vector :inline :offset-assert 32) - (avoid-d vector :inline :offset-assert 48) - (wander float :offset-assert 64) - (max-speed float :offset-assert 68) - (speed float :offset-assert 72) - (handle handle :offset-assert 80) + ((pos vector :inline) + (vel vector :inline) + (border-f vector :inline) + (avoid-d vector :inline) + (wander float) + (max-speed float) + (speed float) + (handle handle) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) (deftype fish-manager (process-drawable) - ((fishes fish 12 :inline :offset-assert 208) + ((fishes fish 12 :inline) ) - :heap-base #x4d0 - :method-count-assert 21 - :size-assert #x550 - :flag-assert #x1504d00550 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -459,7 +448,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fish-manager ((this fish-manager) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fish-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/forest/forest-obs.gc b/goal_src/jak2/levels/forest/forest-obs.gc index 2713b693953..1ce51d8cb2f 100644 --- a/goal_src/jak2/levels/forest/forest-obs.gc +++ b/goal_src/jak2/levels/forest/forest-obs.gc @@ -18,17 +18,13 @@ ) (deftype forest-hover-manager (hover-enemy-manager) - ((transport-actor entity-actor 2 :offset-assert 168) + ((transport-actor entity-actor 2) ) - :heap-base #x30 - :method-count-assert 19 - :size-assert #xb0 - :flag-assert #x13003000b0 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! forest-hover-manager ((this forest-hover-manager) (arg0 entity-actor)) +(defmethod init-from-entity! ((this forest-hover-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -58,26 +54,22 @@ This commonly includes things such as: ) (deftype forest-youngsamos (process-focusable) - ((root collide-shape-moving :override) - (init-quat quaternion :inline :offset-assert 208) - (desired-pos vector :inline :offset-assert 224) - (hit-dir vector :inline :offset-assert 240) - (hit-points float :offset-assert 256) - (incoming-attack-id uint32 :offset-assert 260) - (falling? basic :offset-assert 264) - (focus-disable-timer uint64 :offset-assert 272) - (hud handle :offset-assert 280) - (sound-id sound-id :offset-assert 288) + ((root collide-shape-moving :override) + (init-quat quaternion :inline) + (desired-pos vector :inline) + (hit-dir vector :inline) + (hit-points float) + (incoming-attack-id uint32) + (falling? basic) + (focus-disable-timer uint64) + (hud handle) + (sound-id sound-id) ) - :heap-base #xb0 - :method-count-assert 31 - :size-assert #x124 - :flag-assert #x1f00b00124 - (:methods - (idle () _type_ :state 27) - (hit () _type_ :state 28) - (die () _type_ :state 29) - (dormant () _type_ :state 30) + (:state-methods + idle + hit + die + dormant ) ) @@ -393,7 +385,7 @@ This commonly includes things such as: (-> arg0 status) ) -(defmethod deactivate forest-youngsamos ((this forest-youngsamos)) +(defmethod deactivate ((this forest-youngsamos)) (if (valid? (-> this hud) (the-as type #f) "" #t 0) (send-event (handle->process (-> this hud)) 'hide-and-die) ) @@ -403,7 +395,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! forest-youngsamos ((this forest-youngsamos) (arg0 entity-actor)) +(defmethod init-from-entity! ((this forest-youngsamos) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/forest/forest-part.gc b/goal_src/jak2/levels/forest/forest-part.gc index c7571cc6b3a..9d12e11e3ed 100644 --- a/goal_src/jak2/levels/forest/forest-part.gc +++ b/goal_src/jak2/levels/forest/forest-part.gc @@ -9,10 +9,6 @@ (deftype forest-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/forest/pegasus.gc b/goal_src/jak2/levels/forest/pegasus.gc index 305bd994704..f433390ad83 100644 --- a/goal_src/jak2/levels/forest/pegasus.gc +++ b/goal_src/jak2/levels/forest/pegasus.gc @@ -8,52 +8,45 @@ ;; DECOMP BEGINS (deftype pegasus-path-info (structure) - ((num-data int32 :offset-assert 0) - (path-data curve-control :offset-assert 4) - (control-data (pointer float) :offset-assert 8) + ((num-data int32) + (path-data curve-control) + (control-data (pointer float)) ) :allow-misaligned - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) (deftype pegasus (enemy) - ((curve-position float :offset-assert 532) - (speed float :offset-assert 536) - (facing vector :inline :offset-assert 544) - (tangent vector :inline :offset-assert 560) - (run-blend-interp float :offset-assert 576) - (near-timer int32 :offset-assert 580) - (far-time time-frame :offset-assert 584) - (y-offset float :offset-assert 592) - (y-offset-desired float :offset-assert 596) - (y-vel float :offset-assert 600) - (water-height float :offset-assert 604) - (timeout uint64 :offset-assert 608) - (ambient-possible uint64 :offset-assert 616) - (ambient-expire uint64 :offset-assert 624) - (can-run symbol :offset-assert 632) - (on-ground symbol :offset-assert 636) - (over-ground symbol :offset-assert 640) - (allow-idle symbol :offset-assert 644) - (path-info pegasus-path-info 20 :inline :offset-assert 648) - (previous-path int32 :offset 968) - (current-path int32 :offset 972) - (num-paths int32 :offset 976) - (display-path int32 :offset 980) - (targetted-timer time-frame :offset 984) + ((curve-position float) + (speed float) + (facing vector :inline) + (tangent vector :inline) + (run-blend-interp float) + (near-timer int32) + (far-time time-frame) + (y-offset float) + (y-offset-desired float) + (y-vel float) + (water-height float) + (timeout uint64) + (ambient-possible uint64) + (ambient-expire uint64) + (can-run symbol) + (on-ground symbol) + (over-ground symbol) + (allow-idle symbol) + (path-info pegasus-path-info 20 :inline) + (previous-path int32 :offset 968) + (current-path int32 :offset 972) + (num-paths int32 :offset 976) + (display-path int32 :offset 980) + (targetted-timer time-frame :offset 984) ) - :heap-base #x360 - :method-count-assert 138 - :size-assert #x3e0 - :flag-assert #x8a036003e0 (:methods - (run-logic? (_type_) symbol :replace 12) - (damage-amount-from-attack (_type_ process event-message-block) int :replace 56) - (update-target-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware :replace 57) - (track-how-long-aimed-at! (_type_) none 137) + (run-logic? (_type_) symbol :replace) + (damage-amount-from-attack (_type_ process event-message-block) int :replace) + (update-target-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware :replace) + (track-how-long-aimed-at! (_type_) none) ) (:states pegasus-debug @@ -153,7 +146,7 @@ (set! (-> *pegasus-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod run-logic? pegasus ((this pegasus)) +(defmethod run-logic? ((this pegasus)) "Calls [[process-tree::12]] if we are considered in-range of the [[pegasus]], otherwise returns [[#t]]" (let ((min-distance 491520.0)) (if (< (* min-distance min-distance) (vector-vector-distance-squared (-> this root trans) (camera-pos))) @@ -163,7 +156,7 @@ ) ) -(defmethod track-how-long-aimed-at! pegasus ((this pegasus)) +(defmethod track-how-long-aimed-at! ((this pegasus)) "Updates `targetted-timer` with the `frame-counter` while Jak is aiming at the [[pegasus]]" (let ((target *target*)) (when (and target (-> target gun active?)) @@ -192,7 +185,7 @@ ) ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! pegasus ((this pegasus) (proc process-focusable) (focus enemy-best-focus)) +(defmethod update-target-awareness! ((this pegasus) (proc process-focusable) (focus enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targetted for more than 5 [[seconds]] @returns the value from [[enemy::57]], otherwise [[enemy-aware::4]]" @@ -203,7 +196,7 @@ For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targett ) ) -(defmethod general-event-handler pegasus ((this pegasus) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) +(defmethod general-event-handler ((this pegasus) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case event-type @@ -242,7 +235,7 @@ For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targett ) ) -(defmethod damage-amount-from-attack pegasus ((this pegasus) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this pegasus) (arg0 process) (arg1 event-message-block)) "Only attacks from the jetboard will deal max damage (6), but by default it will return `1`. This is why the scouts are technically killable by other means @returns the amount of damage taken from an attack. Also updates the `targetted-timer`. @@ -695,7 +688,7 @@ The faster it's moving the fast it flaps it's wings, etc ) ) -(defmethod track-target! pegasus ((this pegasus)) +(defmethod track-target! ((this pegasus)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -706,7 +699,7 @@ The faster it's moving the fast it flaps it's wings, etc (none) ) -(defmethod enemy-method-99 pegasus ((this pegasus) (arg0 process-focusable)) +(defmethod enemy-method-99 ((this pegasus) (arg0 process-focusable)) #t ) @@ -1195,7 +1188,7 @@ The faster it's moving the fast it flaps it's wings, etc ) ) -(defmethod init-enemy-collision! pegasus ((this pegasus)) +(defmethod init-enemy-collision! ((this pegasus)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" ;; og:preserve-this added (stack-size-set! (-> this main-thread) 512) @@ -1250,17 +1243,17 @@ The faster it's moving the fast it flaps it's wings, etc (none) ) -(defmethod coin-flip? pegasus ((this pegasus)) +(defmethod coin-flip? ((this pegasus)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod enemy-method-108 pegasus ((this pegasus) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 ((this pegasus) (arg0 enemy) (arg1 event-message-block)) 0 ) ;; WARN: Return type mismatch enemy vs pegasus. -(defmethod relocate pegasus ((this pegasus) (arg0 int)) +(defmethod relocate ((this pegasus) (arg0 int)) (countdown (v1-0 20) (if (-> this path-info v1-0 path-data) (&+! (-> this path-info v1-0 path-data) arg0) @@ -1269,7 +1262,7 @@ The faster it's moving the fast it flaps it's wings, etc (the-as pegasus ((method-of-type enemy relocate) this arg0)) ) -(defmethod init-enemy! pegasus ((this pegasus)) +(defmethod init-enemy! ((this pegasus)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (tag res-tag)) (initialize-skeleton diff --git a/goal_src/jak2/levels/forest/predator-h.gc b/goal_src/jak2/levels/forest/predator-h.gc index 89231a12a33..47f4d3e7ee9 100644 --- a/goal_src/jak2/levels/forest/predator-h.gc +++ b/goal_src/jak2/levels/forest/predator-h.gc @@ -26,41 +26,32 @@ ;; DECOMP BEGINS (deftype predator-node (structure) - ((position vector :inline :offset-assert 0) - (nav-mesh-id uint32 :offset-assert 16) - (edge-index int16 :offset-assert 20) - (edge-count int16 :offset-assert 22) - (radius float :offset-assert 24) - (flags predator-node-flag :offset-assert 28) - (points uint32 :offset-assert 32) - (pos-x float :offset 0) - (pos-y float :offset 4) - (pos-z float :offset 8) + ((position vector :inline) + (nav-mesh-id uint32) + (edge-index int16) + (edge-count int16) + (radius float) + (flags predator-node-flag) + (points uint32) + (pos-x float :overlay-at (-> position data 0)) + (pos-y float :overlay-at (-> position data 1)) + (pos-z float :overlay-at (-> position data 2)) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) (deftype predator-edge (structure) - ((dest-node-id uint16 :offset-assert 0) - (flags predator-edge-flag :offset-assert 2) + ((dest-node-id uint16) + (flags predator-edge-flag) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype predator-graph (structure) - ((node-count uint16 :offset-assert 0) - (edge-count uint16 :offset-assert 2) - (node (inline-array predator-node) :offset-assert 4) - (edge (inline-array predator-edge) :offset-assert 8) + ((node-count uint16) + (edge-count uint16) + (node (inline-array predator-node)) + (edge (inline-array predator-edge)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) diff --git a/goal_src/jak2/levels/forest/predator.gc b/goal_src/jak2/levels/forest/predator.gc index 00c4ec9fac1..82bec632ac6 100644 --- a/goal_src/jak2/levels/forest/predator.gc +++ b/goal_src/jak2/levels/forest/predator.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod draw hud-predator ((this hud-predator)) +(defmethod draw ((this hud-predator)) (set-hud-piece-position! (-> this sprites 1) (the int (+ 480.0 (* 130.0 (-> this offset)))) 205) (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -44 0) (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) @@ -17,14 +17,14 @@ (none) ) -(defmethod update-values hud-predator ((this hud-predator)) +(defmethod update-values ((this hud-predator)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-predator ((this hud-predator)) +(defmethod init-callback ((this hud-predator)) (set! (-> this level) (level-get *level* 'forest)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -45,7 +45,7 @@ (none) ) -(defmethod draw hud-pegasus ((this hud-pegasus)) +(defmethod draw ((this hud-pegasus)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 472.0 (* 130.0 (-> this offset)))) @@ -59,14 +59,14 @@ (none) ) -(defmethod update-values hud-pegasus ((this hud-pegasus)) +(defmethod update-values ((this hud-pegasus)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-pegasus ((this hud-pegasus)) +(defmethod init-callback ((this hud-pegasus)) (set! (-> this level) (level-get *level* 'forest)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -101,15 +101,11 @@ (deftype predator-shot (metalhead-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound predator-shot ((this predator-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this predator-shot) (arg0 projectile-options)) (case arg0 (((projectile-options lose-altitude)) (sound-play "pred-shot-hit") @@ -127,7 +123,7 @@ (none) ) -(defmethod init-proj-collision! predator-shot ((this predator-shot)) +(defmethod init-proj-collision! ((this predator-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -179,7 +175,7 @@ (none) ) -(defmethod init-proj-settings! predator-shot ((this predator-shot)) +(defmethod init-proj-settings! ((this predator-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'predator-shot) @@ -198,36 +194,34 @@ ) (deftype predator (nav-enemy) - ((los los-control :inline :offset-assert 608) - (want-stop symbol :offset-assert 756) - (target-pos vector :inline :offset-assert 768) - (curr-node int32 :offset-assert 784) - (hide-pos vector :inline :offset-assert 800) - (next-change uint64 :offset-assert 816) - (shoot-angle float :offset-assert 824) - (miss-amount float :offset-assert 828) - (ambient-sound-id sound-id :offset-assert 832) - (shock-effect-time time-frame :offset-assert 840) - (shock-effect-end uint64 :offset-assert 848) - (fade float :offset-assert 856) - (dest-fade float :offset-assert 860) + ((los los-control :inline) + (want-stop symbol) + (target-pos vector :inline) + (curr-node int32) + (hide-pos vector :inline) + (next-change uint64) + (shoot-angle float) + (miss-amount float) + (ambient-sound-id sound-id) + (shock-effect-time time-frame) + (shock-effect-end uint64) + (fade float) + (dest-fade float) ) - :heap-base #x2e0 - :method-count-assert 189 - :size-assert #x360 - :flag-assert #xbd02e00360 + (:state-methods + close-attack + fire + hide + hidden + ) (:methods - (close-attack () _type_ :state 178) - (fire () _type_ :state 179) - (hide () _type_ :state 180) - (hidden () _type_ :state 181) - (set-dangerous! (_type_ symbol) symbol 182) - (predator-method-183 (_type_) none 183) - (predator-method-184 (_type_ int float) none 184) - (predator-method-185 (_type_) none 185) - (predator-method-186 (_type_) none 186) - (predator-method-187 (_type_) symbol 187) - (predator-method-188 (_type_ vector vector vector) none 188) + (set-dangerous! (_type_ symbol) symbol) + (predator-method-183 (_type_) none) + (predator-method-184 (_type_ int float) none) + (predator-method-185 (_type_) none) + (predator-method-186 (_type_) none) + (predator-method-187 (_type_) symbol) + (predator-method-188 (_type_ vector vector vector) none) ) ) @@ -409,7 +403,7 @@ (set! (-> *predator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler predator ((this predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -431,7 +425,7 @@ ) ) -(defmethod enemy-method-77 predator ((this predator) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this predator) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (case (-> this incoming knocked-type) @@ -523,7 +517,7 @@ ) ) -(defmethod enemy-method-78 predator ((this predator) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this predator) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (case (-> this incoming knocked-type) @@ -599,7 +593,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod predator-method-188 predator ((this predator) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod predator-method-188 ((this predator) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f0-0 1228.8) (f30-0 6144.0) @@ -669,7 +663,7 @@ (none) ) -(defmethod predator-method-184 predator ((this predator) (arg0 int) (arg1 float)) +(defmethod predator-method-184 ((this predator) (arg0 int) (arg1 float)) (local-vars (sv-224 vector) (sv-240 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -808,7 +802,7 @@ ) ) -(defmethod predator-method-183 predator ((this predator)) +(defmethod predator-method-183 ((this predator)) (cond ((< (-> this hit-points) 2) (when (!= (-> this dest-fade) 128.0) @@ -1217,7 +1211,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod predator-method-186 predator ((this predator)) +(defmethod predator-method-186 ((this predator)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1264,7 +1258,7 @@ ) ) -(defmethod predator-method-185 predator ((this predator)) +(defmethod predator-method-185 ((this predator)) (let ((f30-0 0.0) (s5-0 -1) ) @@ -1286,7 +1280,7 @@ (none) ) -(defmethod predator-method-187 predator ((this predator)) +(defmethod predator-method-187 ((this predator)) (let* ((s5-0 (-> *predator-graph* node (-> this curr-node))) (s4-0 (rand-vu-int-count (-> s5-0 edge-count))) ) @@ -1314,7 +1308,7 @@ #f ) -(defmethod track-target! predator ((this predator)) +(defmethod track-target! ((this predator)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1331,7 +1325,7 @@ (none) ) -(defmethod set-dangerous! predator ((this predator) (arg0 symbol)) +(defmethod set-dangerous! ((this predator) (arg0 symbol)) (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) @@ -1345,7 +1339,7 @@ #f ) -(defmethod init-enemy-collision! predator ((this predator)) +(defmethod init-enemy-collision! ((this predator)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1422,11 +1416,11 @@ (none) ) -(defmethod relocate predator ((this predator) (arg0 int)) +(defmethod relocate ((this predator) (arg0 int)) (call-parent-method this arg0) ) -(defmethod nav-enemy-method-167 predator ((this predator)) +(defmethod nav-enemy-method-167 ((this predator)) (let ((v1-0 (-> this nav))) (set! (-> v1-0 target-speed) 0.0) ) @@ -1439,12 +1433,12 @@ (none) ) -(defmethod run-logic? predator ((this predator)) +(defmethod run-logic? ((this predator)) #t ) ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 predator ((this predator) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this predator) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) (the-as symbol (if (t9-0 this arg0 arg1) (set-dst-proc! (-> this los) (-> this focus handle)) @@ -1454,7 +1448,7 @@ ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! predator ((this predator) (arg0 entity-actor)) +(defmethod init-from-entity! ((this predator) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1465,7 +1459,7 @@ This commonly includes things such as: (none) ) -(defmethod init-enemy-behaviour-and-stats! predator ((this predator) (arg0 nav-enemy-info)) +(defmethod init-enemy-behaviour-and-stats! ((this predator) (arg0 nav-enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-behaviour-and-stats!))) @@ -1477,7 +1471,7 @@ This commonly includes things such as: (none) ) -(defmethod init-enemy! predator ((this predator)) +(defmethod init-enemy! ((this predator)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1521,20 +1515,18 @@ This commonly includes things such as: ) (deftype predator-manager (process) - ((predator-count uint32 :offset-assert 128) - (predator-h handle 32 :offset-assert 136) - (hud-counter handle :offset-assert 392) - (actor-group (pointer actor-group) :offset-assert 400) - (actor-group-count int32 :offset-assert 404) + ((predator-count uint32) + (predator-h handle 32) + (hud-counter handle) + (actor-group (pointer actor-group)) + (actor-group-count int32) ) - :heap-base #x120 - :method-count-assert 17 - :size-assert #x198 - :flag-assert #x1101200198 + (:state-methods + idle + closed + ) (:methods - (idle () _type_ :state 14) - (closed () _type_ :state 15) - (predator-manager-method-16 (_type_) none 16) + (predator-manager-method-16 (_type_) none) ) ) @@ -1542,7 +1534,7 @@ This commonly includes things such as: (define *predator-manager* (the-as predator-manager #f)) ;; WARN: Return type mismatch process vs predator-manager. -(defmethod relocate predator-manager ((this predator-manager) (arg0 int)) +(defmethod relocate ((this predator-manager) (arg0 int)) (set! *predator-manager* this) (if *predator-manager* (set! *predator-manager* (&+ *predator-manager* arg0)) @@ -1550,7 +1542,7 @@ This commonly includes things such as: (the-as predator-manager ((method-of-type process relocate) this arg0)) ) -(defmethod predator-manager-method-16 predator-manager ((this predator-manager)) +(defmethod predator-manager-method-16 ((this predator-manager)) 0 (none) ) @@ -1600,7 +1592,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. ;; WARN: new jak 2 until loop case, check carefully -(defmethod init-from-entity! predator-manager ((this predator-manager) (arg0 entity-actor)) +(defmethod init-from-entity! ((this predator-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/forest/wren.gc b/goal_src/jak2/levels/forest/wren.gc index d81d0a6a3bd..24d287ac0c4 100644 --- a/goal_src/jak2/levels/forest/wren.gc +++ b/goal_src/jak2/levels/forest/wren.gc @@ -21,34 +21,32 @@ ;; DECOMP BEGINS (deftype wren (process-drawable) - ((move-dest vector :inline :offset-assert 208) - (fly-curve curve-control 2 :offset-assert 224) - (fly-index uint32 :offset-assert 232) - (fly-speed float :offset-assert 236) - (fly-y-rate float :offset-assert 240) - (fly-interp float :offset-assert 244) - (path-u float :offset-assert 248) - (path-du float :offset-assert 252) - (path-du-mod float :offset-assert 256) - (bob-level float :offset-assert 260) - (bob-level-seek float :offset-assert 264) - (bank-angle float :offset-assert 268) - (peck-timer uint64 :offset-assert 272) - (flags wren-flags :offset-assert 280) + ((move-dest vector :inline) + (fly-curve curve-control 2) + (fly-index uint32) + (fly-speed float) + (fly-y-rate float) + (fly-interp float) + (path-u float) + (path-du float) + (path-du-mod float) + (bob-level float) + (bob-level-seek float) + (bank-angle float) + (peck-timer uint64) + (flags wren-flags) ) - :heap-base #xa0 - :method-count-assert 28 - :size-assert #x11a - :flag-assert #x1c00a0011a + (:state-methods + hunt + peck + fly + land + on-branch + die + ) (:methods - (hunt () _type_ :state 20) - (peck () _type_ :state 21) - (fly () _type_ :state 22) - (land () _type_ :state 23) - (on-branch () _type_ :state 24) - (die () _type_ :state 25) - (spooked? (_type_) symbol 26) - (debug-draw-path (_type_) symbol 27) + (spooked? (_type_) symbol) + (debug-draw-path (_type_) symbol) ) ) @@ -58,7 +56,7 @@ :bounds (static-spherem 0 0 0 4) ) -(defmethod debug-draw-path wren ((this wren)) +(defmethod debug-draw-path ((this wren)) "Draws the associated [[curve-control]]s associated with this wren" (dotimes (s5-0 2) (if (-> this fly-curve s5-0) @@ -126,7 +124,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod spooked? wren ((this wren)) +(defmethod spooked? ((this wren)) "@returns a [[symbol]] indicating if Jak is considered close enough to the wren to spook it. If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (let* ((gp-0 *target*) @@ -429,7 +427,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) -(defmethod relocate wren ((this wren) (arg0 int)) +(defmethod relocate ((this wren) (arg0 int)) (dotimes (v1-0 2) (when (-> this fly-curve v1-0) (if (nonzero? (-> this fly-curve v1-0)) @@ -441,7 +439,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! wren ((this wren) (arg0 entity-actor)) +(defmethod init-from-entity! ((this wren) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc b/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc index 5e6ec102476..731baf8c6a5 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc @@ -8,21 +8,17 @@ ;; DECOMP BEGINS (deftype fort-elec-switch (process-drawable) - ((root collide-shape :override) - (l-bolt lightning-control :offset-assert 200) - (notify-actor entity-actor :offset-assert 204) - (tank-actor entity-actor :offset-assert 208) - (switch-group (pointer actor-group) :offset-assert 212) - (switch-group-count int32 :offset-assert 216) + ((root collide-shape :override) + (l-bolt lightning-control) + (notify-actor entity-actor) + (tank-actor entity-actor) + (switch-group (pointer actor-group)) + (switch-group-count int32) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17006000dc - (:methods - (idle () _type_ :state 20) - (play-hint () _type_ :state 21) - (die () _type_ :state 22) + (:state-methods + idle + play-hint + die ) ) @@ -227,7 +223,7 @@ ) ;; WARN: Return type mismatch process-drawable vs fort-elec-switch. -(defmethod relocate fort-elec-switch ((this fort-elec-switch) (arg0 int)) +(defmethod relocate ((this fort-elec-switch) (arg0 int)) (if (nonzero? (-> this l-bolt)) (&+! (-> this l-bolt) arg0) ) @@ -235,7 +231,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-elec-switch ((this fort-elec-switch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-elec-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -329,21 +325,19 @@ This commonly includes things such as: ) (deftype fort-fence (process-drawable) - ((root collide-shape :override) - (anim spool-anim :offset-assert 200) - (exit-anim basic :offset-assert 204) - (loading? symbol :offset-assert 208) - (tank handle :offset-assert 216) + ((root collide-shape :override) + (anim spool-anim) + (exit-anim basic) + (loading? symbol) + (tank handle) ) - :heap-base #x60 - :method-count-assert 24 - :size-assert #xe0 - :flag-assert #x18006000e0 + (:state-methods + idle + breaking + ) (:methods - (idle () _type_ :state 20) - (breaking () _type_ :state 21) - (fort-fence-method-22 (_type_) none 22) - (fort-fence-method-23 (_type_) none 23) + (fort-fence-method-22 (_type_) none) + (fort-fence-method-23 (_type_) none) ) ) @@ -358,12 +352,12 @@ This commonly includes things such as: :bounds (static-spherem 0 11 0 18) ) -(defmethod fort-fence-method-22 fort-fence ((this fort-fence)) +(defmethod fort-fence-method-22 ((this fort-fence)) 0 (none) ) -(defmethod fort-fence-method-23 fort-fence ((this fort-fence)) +(defmethod fort-fence-method-23 ((this fort-fence)) 0 (none) ) @@ -451,7 +445,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-fence ((this fort-fence) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-fence) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -485,23 +479,15 @@ This commonly includes things such as: (deftype fort-fence-a (fort-fence) () - :heap-base #x60 - :method-count-assert 24 - :size-assert #xe0 - :flag-assert #x18006000e0 ) (deftype fort-fence-b (fort-fence) () - :heap-base #x60 - :method-count-assert 24 - :size-assert #xe0 - :flag-assert #x18006000e0 ) -(defmethod fort-fence-method-22 fort-fence-a ((this fort-fence-a)) +(defmethod fort-fence-method-22 ((this fort-fence-a)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-fence-a" (the-as (pointer uint32) #f))) @@ -515,7 +501,7 @@ This commonly includes things such as: (none) ) -(defmethod fort-fence-method-22 fort-fence-b ((this fort-fence-b)) +(defmethod fort-fence-method-22 ((this fort-fence-b)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-fence-b" (the-as (pointer uint32) #f))) @@ -529,7 +515,7 @@ This commonly includes things such as: (none) ) -(defmethod fort-fence-method-23 fort-fence-a ((this fort-fence-a)) +(defmethod fort-fence-method-23 ((this fort-fence-a)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -561,7 +547,7 @@ This commonly includes things such as: (none) ) -(defmethod fort-fence-method-23 fort-fence-b ((this fort-fence-b)) +(defmethod fort-fence-method-23 ((this fort-fence-b)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) diff --git a/goal_src/jak2/levels/fortress/dump/fordumpa-part.gc b/goal_src/jak2/levels/fortress/dump/fordumpa-part.gc index 551fce25d83..5c383a8fceb 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpa-part.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpa-part.gc @@ -9,10 +9,6 @@ (deftype fordumpa-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) @@ -1439,7 +1435,7 @@ ) ) -(defmethod elec-gate-method-24 fort-elec-gate ((this fort-elec-gate)) +(defmethod elec-gate-method-24 ((this fort-elec-gate)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 551) this)) (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 552) this)) 0 diff --git a/goal_src/jak2/levels/fortress/dump/fordumpb-obs.gc b/goal_src/jak2/levels/fortress/dump/fordumpb-obs.gc index bdcee84da39..d5b7de92e48 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpb-obs.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpb-obs.gc @@ -8,14 +8,10 @@ ;; DECOMP BEGINS (deftype fort-plat-orbit (process-drawable) - ((sync sync-linear :inline :offset-assert 200) + ((sync sync-linear :inline) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15006000d8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -54,7 +50,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-plat-orbit ((this fort-plat-orbit) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-plat-orbit) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -155,15 +151,11 @@ This commonly includes things such as: ) (deftype fort-plat-shuttle-plat (process-drawable) - ((path-pos float :offset-assert 200) - (path-speed float :offset-assert 204) + ((path-pos float) + (path-speed float) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -251,17 +243,15 @@ This commonly includes things such as: ) (deftype fort-plat-shuttle (process-drawable) - ((next-spawn-time time-frame :offset-assert 200) - (sync sync-linear :inline :offset-assert 208) + ((next-spawn-time time-frame) + (sync sync-linear :inline) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xe0 - :flag-assert #x17006000e0 + (:state-methods + dormant + idle + ) (:methods - (dormant () _type_ :state 20) - (idle () _type_ :state 21) - (fort-plat-shuttle-method-22 (_type_) symbol 22) + (fort-plat-shuttle-method-22 (_type_) symbol) ) ) @@ -293,7 +283,7 @@ This commonly includes things such as: :code sleep-code ) -(defmethod fort-plat-shuttle-method-22 fort-plat-shuttle ((this fort-plat-shuttle)) +(defmethod fort-plat-shuttle-method-22 ((this fort-plat-shuttle)) (let* ((f28-0 (total-distance (-> this path))) (s5-0 (-> this sync)) (f26-0 81.92) @@ -313,7 +303,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-plat-shuttle ((this fort-plat-shuttle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-plat-shuttle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -366,10 +356,6 @@ This commonly includes things such as: (deftype fort-conveyor (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) @@ -378,13 +364,13 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 36) ) -(defmethod get-art-group fort-conveyor ((this fort-conveyor)) +(defmethod get-art-group ((this fort-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-fort-conveyor" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod reset-root! fort-conveyor ((this fort-conveyor)) +(defmethod reset-root! ((this fort-conveyor)) "Re-initializes the `root` [[trsqv]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -414,7 +400,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch vector vs none. -(defmethod init! fort-conveyor ((this fort-conveyor)) +(defmethod init! ((this fort-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (set! (-> this belt-radius) 24576.0) (set! (-> this pull-y-threshold) 16384.0) @@ -431,7 +417,7 @@ This commonly includes things such as: (none) ) -(defmethod set-and-get-ambient-sound! fort-conveyor ((this fort-conveyor)) +(defmethod set-and-get-ambient-sound! ((this fort-conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" (let* ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) diff --git a/goal_src/jak2/levels/fortress/dump/fordumpb-part.gc b/goal_src/jak2/levels/fortress/dump/fordumpb-part.gc index aaec82ea11f..16be7516375 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpb-part.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpb-part.gc @@ -9,10 +9,6 @@ (deftype fordumpb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc b/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc index a3f6f45bc1d..d16272ad63f 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod draw hud-rocketsensor ((this hud-rocketsensor)) +(defmethod draw ((this hud-rocketsensor)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -20,14 +20,14 @@ (none) ) -(defmethod update-values hud-rocketsensor ((this hud-rocketsensor)) +(defmethod update-values ((this hud-rocketsensor)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-rocketsensor ((this hud-rocketsensor)) +(defmethod init-callback ((this hud-rocketsensor)) (set! (-> this level) (level-get *level* 'fordumpc)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -45,15 +45,11 @@ ) (deftype fort-dump-bomb-a (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) @@ -148,7 +144,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-dump-bomb-a ((this fort-dump-bomb-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-dump-bomb-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -190,17 +186,13 @@ This commonly includes things such as: ) (deftype fort-missile-target (process-drawable) - ((root collide-shape-moving :override) - (part-mat matrix 2 :inline :offset-assert 208) - (sound-id uint32 :offset-assert 336) + ((root collide-shape-moving :override) + (part-mat matrix 2 :inline) + (sound-id uint32) ) - :heap-base #xe0 - :method-count-assert 22 - :size-assert #x154 - :flag-assert #x1600e00154 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) @@ -378,7 +370,7 @@ This commonly includes things such as: ) ) -(defmethod deactivate fort-missile-target ((this fort-missile-target)) +(defmethod deactivate ((this fort-missile-target)) (sound-stop (the-as sound-id (-> this sound-id))) (call-parent-method this) (none) @@ -452,27 +444,23 @@ This commonly includes things such as: ) (deftype fort-missile (process-drawable) - ((root collide-shape :override) - (part-doom sparticle-launch-control :offset-assert 200) - (hud handle :offset-assert 208) - (door-actor entity-actor 2 :offset-assert 216) - (tank-actor entity-actor :offset-assert 224) - (bomb handle 4 :offset-assert 232) - (bomb-count uint32 :offset-assert 264) - (attack-id uint32 :offset-assert 268) - (explosion-sound-id sound-id :offset-assert 272) - (alarm-sound-id sound-id :offset-assert 276) + ((root collide-shape :override) + (part-doom sparticle-launch-control) + (hud handle) + (door-actor entity-actor 2) + (tank-actor entity-actor) + (bomb handle 4) + (bomb-count uint32) + (attack-id uint32) + (explosion-sound-id sound-id) + (alarm-sound-id sound-id) ) - :heap-base #xa0 - :method-count-assert 25 - :size-assert #x118 - :flag-assert #x1900a00118 - (:methods - (idle () _type_ :state 20) - (targets-active () _type_ :state 21) - (missile-countdown () _type_ :state 22) - (die () _type_ :state 23) - (dormant () _type_ :state 24) + (:state-methods + idle + targets-active + missile-countdown + die + dormant ) ) @@ -910,7 +898,7 @@ This commonly includes things such as: :code sleep-code ) -(defmethod deactivate fort-missile ((this fort-missile)) +(defmethod deactivate ((this fort-missile)) (set-fordumpc-light-flag! #f) (send-event (handle->process (-> this hud)) 'hide-and-die) (if (nonzero? (-> this part-doom)) @@ -921,7 +909,7 @@ This commonly includes things such as: (none) ) -(defmethod relocate fort-missile ((this fort-missile) (arg0 int)) +(defmethod relocate ((this fort-missile) (arg0 int)) (if (nonzero? (-> this part-doom)) (&+! (-> this part-doom) arg0) ) @@ -929,7 +917,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-missile ((this fort-missile) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-missile) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/fortress/dump/fordumpc-part.gc b/goal_src/jak2/levels/fortress/dump/fordumpc-part.gc index 898ebde2360..1ce95ba4077 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpc-part.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpc-part.gc @@ -9,10 +9,6 @@ (deftype fordumpc-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc index db8d5e4b0d0..df38111f81f 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc @@ -31,85 +31,77 @@ ;; DECOMP BEGINS (deftype fort-robotank-turret (process-focusable) - ((los los-control :inline :offset-assert 208) - (reticle handle :offset-assert 360) - (screen handle :offset-assert 368) - (tank-quat quaternion :inline :offset-assert 384) - (tank-quat-vibe-only quaternion :inline :offset-assert 400) - (rotate-quat quaternion :inline :offset-assert 416) - (rotate-rate float :offset-assert 432) - (rotate-mult float :offset-assert 436) - (shot-range float :offset-assert 440) - (fov-mult float :offset-assert 444) - (offset vector :inline :offset-assert 448) - (sight-pos vector :inline :offset-assert 464) - (firing-sight-pos vector :inline :offset-assert 480) - (aim-pos vector 3 :inline :offset-assert 496) - (aim-pos-2 vector :inline :offset 512) - (aim-pos-1 vector :inline :offset 528) - (gun-timer time-frame :offset-assert 544) - (gun-elev-jmod joint-mod-set-local :offset-assert 552) - (gun-elev float :offset-assert 556) - (gun-elev-cam float :offset-assert 560) - (gun-joint-l int32 2 :offset-assert 564) - (gun-joint-r int32 2 :offset-assert 572) - (gun-spread float :offset-assert 580) - (gun-index int32 :offset-assert 584) - (flags robotank-turret-flags :offset-assert 588) - (turn-sound-id sound-id :offset-assert 592) + ((los los-control :inline) + (reticle handle) + (screen handle) + (tank-quat quaternion :inline) + (tank-quat-vibe-only quaternion :inline) + (rotate-quat quaternion :inline) + (rotate-rate float) + (rotate-mult float) + (shot-range float) + (fov-mult float) + (offset vector :inline) + (sight-pos vector :inline) + (firing-sight-pos vector :inline) + (aim-pos vector 3 :inline) + (aim-pos-2 vector :inline :overlay-at (-> aim-pos 1)) + (aim-pos-1 vector :inline :overlay-at (-> aim-pos 2)) + (gun-timer time-frame) + (gun-elev-jmod joint-mod-set-local) + (gun-elev float) + (gun-elev-cam float) + (gun-joint-l int32 2) + (gun-joint-r int32 2) + (gun-spread float) + (gun-index int32) + (flags robotank-turret-flags) + (turn-sound-id sound-id) ) - :heap-base #x1e0 - :method-count-assert 35 - :size-assert #x254 - :flag-assert #x2301e00254 + (:state-methods + idle + ready + fire + die + ) (:methods - (idle () _type_ :state 27) - (ready () _type_ :state 28) - (fire () _type_ :state 29) - (die () _type_ :state 30) - (fort-robotank-turret-method-31 (_type_ vector vector) none 31) - (fort-robotank-turret-method-32 (_type_ (inline-array vector)) (pointer process) 32) - (fort-robotank-turret-method-33 (_type_) none 33) - (fort-robotank-turret-method-34 (_type_ vector float) symbol 34) + (fort-robotank-turret-method-31 (_type_ vector vector) none) + (fort-robotank-turret-method-32 (_type_ (inline-array vector)) (pointer process)) + (fort-robotank-turret-method-33 (_type_) none) + (fort-robotank-turret-method-34 (_type_ vector float) symbol) ) ) (deftype fort-robotank-reticle (process-drawable) - ((shadow-jmod joint-mod :offset-assert 200) - (sight-jmod joint-mod :offset-assert 204) - (ring-jmod joint-mod 3 :offset-assert 208) - (ring-timer time-frame :offset-assert 224) - (sight-scale vector :inline :offset-assert 240) - (collide-dist float :offset-assert 256) + ((shadow-jmod joint-mod) + (sight-jmod joint-mod) + (ring-jmod joint-mod 3) + (ring-timer time-frame) + (sight-scale vector :inline) + (collide-dist float) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x104 - :flag-assert #x1600900104 - (:methods - (idle () _type_ :state 20) - (lock () _type_ :state 21) + (:state-methods + idle + lock ) ) (deftype fort-roboscreen (process-drawable) - ((anim-frame float :offset-assert 200) - (transition float :offset-assert 204) - (gui-id-1 sound-id :offset-assert 208) - (gui-id-2 sound-id :offset-assert 212) + ((anim-frame float) + (transition float) + (gui-id-1 sound-id) + (gui-id-2 sound-id) ) - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd8 - :flag-assert #x19006000d8 + (:state-methods + idle + active + deactive + die + ) (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (deactive () _type_ :state 22) - (die () _type_ :state 23) - (fort-roboscreen-method-24 (_type_) none 24) + (fort-roboscreen-method-24 (_type_) none) ) ) @@ -258,7 +250,7 @@ ) ) -(defmethod fort-roboscreen-method-24 fort-roboscreen ((this fort-roboscreen)) +(defmethod fort-roboscreen-method-24 ((this fort-roboscreen)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -323,7 +315,7 @@ (none) ) -(defmethod deactivate fort-roboscreen ((this fort-roboscreen)) +(defmethod deactivate ((this fort-roboscreen)) (disable *screen-filter*) (set-roboscreen-alpha! 0.0) (call-parent-method this) @@ -545,7 +537,7 @@ ) ;; WARN: Return type mismatch process-drawable vs fort-robotank-reticle. -(defmethod relocate fort-robotank-reticle ((this fort-robotank-reticle) (arg0 int)) +(defmethod relocate ((this fort-robotank-reticle) (arg0 int)) (if (nonzero? (-> this shadow-jmod)) (&+! (-> this shadow-jmod) arg0) ) @@ -605,14 +597,10 @@ (deftype fort-robotank-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) -(defmethod play-impact-sound fort-robotank-shot ((this fort-robotank-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this fort-robotank-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -627,7 +615,7 @@ (none) ) -(defmethod init-proj-collision! fort-robotank-shot ((this fort-robotank-shot)) +(defmethod init-proj-collision! ((this fort-robotank-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -678,7 +666,7 @@ (none) ) -(defmethod init-proj-settings! fort-robotank-shot ((this fort-robotank-shot)) +(defmethod init-proj-settings! ((this fort-robotank-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'fort-robotank-shot) @@ -721,7 +709,7 @@ ;; WARN: Return type mismatch pointer vs symbol. ;; ERROR: Failed load: (set! t0-6 (l.d (+ a0-28 8))) at op 170 -(defmethod fort-robotank-turret-method-32 fort-robotank-turret ((this fort-robotank-turret) (arg0 (inline-array vector))) +(defmethod fort-robotank-turret-method-32 ((this fort-robotank-turret) (arg0 (inline-array vector))) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((v1-0 (-> arg0 0)) (a0-1 (-> arg0 1)) @@ -748,7 +736,7 @@ ) ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod fort-robotank-turret-method-33 fort-robotank-turret ((this fort-robotank-turret)) +(defmethod fort-robotank-turret-method-33 ((this fort-robotank-turret)) (local-vars (sv-144 vector) (sv-160 vector)) (let ((s3-0 (new 'stack-no-clear 'inline-array 'vector 2)) (s5-0 (new 'stack-no-clear 'inline-array 'vector 4)) @@ -792,7 +780,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod fort-robotank-turret-method-31 fort-robotank-turret ((this fort-robotank-turret) (arg0 vector) (arg1 vector)) +(defmethod fort-robotank-turret-method-31 ((this fort-robotank-turret) (arg0 vector) (arg1 vector)) (let ((s3-0 (new 'stack-no-clear 'collide-query)) (f30-0 307200.0) ) @@ -850,7 +838,7 @@ ) ;; WARN: Return type mismatch collide-prim-core vs vector. -(defmethod get-trans fort-robotank-turret ((this fort-robotank-turret) (arg0 int)) +(defmethod get-trans ((this fort-robotank-turret) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (the-as vector (-> this root root-prim prim-core)) ) @@ -1099,7 +1087,7 @@ ) ) -(defmethod fort-robotank-turret-method-34 fort-robotank-turret ((this fort-robotank-turret) (arg0 vector) (arg1 float)) +(defmethod fort-robotank-turret-method-34 ((this fort-robotank-turret) (arg0 vector) (arg1 float)) (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans))) (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) @@ -1278,7 +1266,7 @@ ) ) -(defmethod deactivate fort-robotank-turret ((this fort-robotank-turret)) +(defmethod deactivate ((this fort-robotank-turret)) (logclear! (-> this flags) (robotank-turret-flags rotflags-6)) (sound-stop (-> this turn-sound-id)) (let ((a0-4 (handle->process (-> this screen)))) @@ -1291,7 +1279,7 @@ ) ;; WARN: Return type mismatch process-focusable vs fort-robotank-turret. -(defmethod relocate fort-robotank-turret ((this fort-robotank-turret) (arg0 int)) +(defmethod relocate ((this fort-robotank-turret) (arg0 int)) (if (nonzero? (-> this gun-elev-jmod)) (&+! (-> this gun-elev-jmod) arg0) ) diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc index 1aa7808ed65..95b92880655 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc @@ -72,123 +72,103 @@ ) (deftype fort-robotank-segment-event (structure) - ((source handle :offset-assert 0) - (event-type symbol :offset-assert 8) - (actor string :offset-assert 12) - (pos-norm float :offset-assert 16) - (param-obj object :offset-assert 20) - (param-func (function fort-robotank none) :offset 20) - (param-sym symbol :offset 20) + ((source handle) + (event-type symbol) + (actor string) + (pos-norm float) + (param-obj object) + (param-func (function fort-robotank none) :overlay-at param-obj) + (param-sym symbol :overlay-at param-obj) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype fort-robotank-segment (structure) - ((flags uint16 :offset-assert 0) - (max-speed float :offset-assert 4) - (next-segment int32 :offset-assert 8) - (next-segment-start float :offset-assert 12) - (event-count int32 :offset-assert 16) - (event-tbl (inline-array fort-robotank-segment-event) :offset-assert 20) + ((flags uint16) + (max-speed float) + (next-segment int32) + (next-segment-start float) + (event-count int32) + (event-tbl (inline-array fort-robotank-segment-event)) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype fort-robotank-path-info (structure) - ((path path-control :offset-assert 0) - (dir vector :inline :offset-assert 16) - (u float :offset-assert 32) - (du float :offset-assert 36) - (du-final float :offset-assert 40) - (prev-u float :offset-assert 44) - (max-speed float :offset-assert 48) - (dist float :offset-assert 52) - (dir-y-angle float :offset-assert 56) - (start-y-angle float :offset-assert 60) + ((path path-control) + (dir vector :inline) + (u float) + (du float) + (du-final float) + (prev-u float) + (max-speed float) + (dist float) + (dir-y-angle float) + (start-y-angle float) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype fort-robotank-path-info-array (inline-array-class) - ((data fort-robotank-path-info :inline :dynamic :offset-assert 16) + ((data fort-robotank-path-info :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (set! (-> fort-robotank-path-info-array heap-base) (the-as uint 64)) (deftype fort-robotank-wheel-info (structure) - ((jmod joint-mod-spinner :offset-assert 0) - (radius float :offset-assert 4) + ((jmod joint-mod-spinner) + (radius float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype fort-robotank-tread-info (structure) - ((wheel fort-robotank-wheel-info 7 :inline :offset-assert 0) - (texture texture-anim :offset-assert 112) - (locator-joint int32 :offset-assert 116) - (pos vector :inline :offset-assert 128) + ((wheel fort-robotank-wheel-info 7 :inline) + (texture texture-anim) + (locator-joint int32) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) (deftype fort-robotank (process-drawable) - ((root collide-shape-moving :override) - (barrel-part sparticle-launch-control :offset-assert 200) - (roller-jmod joint-mod :offset-assert 204) - (vibe-jmod joint-mod :offset-assert 208) - (tread fort-robotank-tread-info 2 :inline :offset-assert 224) - (path-info fort-robotank-path-info-array :offset-assert 512) - (segment-table (inline-array fort-robotank-segment) :offset-assert 516) - (flags robotank-flags :offset-assert 520) - (pov-cam-offset vector 2 :inline :offset-assert 528) - (turret handle :offset-assert 560) - (no-collision-timer time-frame :offset-assert 568) - (buzz-timer time-frame :offset-assert 576) - (player-u float :offset-assert 584) - (player-prev-u float :offset-assert 588) - (roller-spin-rate float :offset-assert 592) - (engine-vibe-rate float :offset-assert 596) - (engine-vibe-amp float :offset-assert 600) - (attack-id uint32 :offset-assert 604) - (path-index int32 :offset-assert 608) - (path-count int32 :offset-assert 612) - (continue-index int32 :offset-assert 616) - (idle-sound ambient-sound :offset-assert 620) - (barrel-sound ambient-sound :offset-assert 624) + ((root collide-shape-moving :override) + (barrel-part sparticle-launch-control) + (roller-jmod joint-mod) + (vibe-jmod joint-mod) + (tread fort-robotank-tread-info 2 :inline) + (path-info fort-robotank-path-info-array) + (segment-table (inline-array fort-robotank-segment)) + (flags robotank-flags) + (pov-cam-offset vector 2 :inline) + (turret handle) + (no-collision-timer time-frame) + (buzz-timer time-frame) + (player-u float) + (player-prev-u float) + (roller-spin-rate float) + (engine-vibe-rate float) + (engine-vibe-amp float) + (attack-id uint32) + (path-index int32) + (path-count int32) + (continue-index int32) + (idle-sound ambient-sound) + (barrel-sound ambient-sound) ) - :heap-base #x200 - :method-count-assert 28 - :size-assert #x274 - :flag-assert #x1c02000274 + (:state-methods + idle + turning + moving + pause + die + ) (:methods - (idle () _type_ :state 20) - (turning () _type_ :state 21) - (moving () _type_ :state 22) - (pause () _type_ :state 23) - (die () _type_ :state 24) - (fort-robotank-method-25 (_type_) event-message-block 25) - (fort-robotank-method-26 (_type_ int float float) symbol 26) - (fort-robotank-method-27 (_type_) none 27) + (fort-robotank-method-25 (_type_) event-message-block) + (fort-robotank-method-26 (_type_ int float float) symbol) + (fort-robotank-method-27 (_type_) none) ) ) @@ -289,7 +269,7 @@ :origin-joint-index 3 ) -(defmethod fort-robotank-method-25 fort-robotank ((this fort-robotank)) +(defmethod fort-robotank-method-25 ((this fort-robotank)) (with-pp (let ((v1-0 (-> this root))) (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) @@ -555,7 +535,7 @@ ) ) -(defmethod fort-robotank-method-26 fort-robotank ((this fort-robotank) (arg0 int) (arg1 float) (arg2 float)) +(defmethod fort-robotank-method-26 ((this fort-robotank) (arg0 int) (arg1 float) (arg2 float)) (local-vars (sv-96 fort-robotank-segment-event) (sv-112 (function process-tree event-message-block object)) @@ -643,7 +623,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod fort-robotank-method-27 fort-robotank ((this fort-robotank)) +(defmethod fort-robotank-method-27 ((this fort-robotank)) (let ((s5-0 (-> this segment-table (-> this path-index) flags))) (send-event (handle->process (-> this turret)) 'use-los (if (logtest? s5-0 16) #t @@ -933,14 +913,14 @@ :post pusher-post ) -(defmethod deactivate fort-robotank ((this fort-robotank)) +(defmethod deactivate ((this fort-robotank)) (stop! (-> this idle-sound)) (stop! (-> this barrel-sound)) ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod relocate fort-robotank ((this fort-robotank) (arg0 int)) +(defmethod relocate ((this fort-robotank) (arg0 int)) (if (nonzero? (-> this barrel-part)) (&+! (-> this barrel-part) arg0) ) @@ -992,7 +972,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-robotank ((this fort-robotank) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-robotank) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/fortress/exit/forexita-obs.gc b/goal_src/jak2/levels/fortress/exit/forexita-obs.gc index c0d9a2d3df7..41e7082f35d 100644 --- a/goal_src/jak2/levels/fortress/exit/forexita-obs.gc +++ b/goal_src/jak2/levels/fortress/exit/forexita-obs.gc @@ -8,15 +8,11 @@ ;; DECOMP BEGINS (deftype fort-lift-plat (plat) - ((sound-time time-frame :offset-assert 328) - (last-val float :offset-assert 336) + ((sound-time time-frame) + (last-val float) ) - :heap-base #xe0 - :method-count-assert 38 - :size-assert #x154 - :flag-assert #x2600e00154 - (:methods - (plat-anim-active () _type_ :state 37) + (:state-methods + plat-anim-active ) ) @@ -26,13 +22,13 @@ :bounds (static-spherem 0 -2 -8 15) ) -(defmethod get-art-group fort-lift-plat ((this fort-lift-plat)) +(defmethod get-art-group ((this fort-lift-plat)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-fort-lift-plat" (the-as (pointer uint32) #f)) ) ;; og:preserve-this -;; (defmethod base-plat-method-32 fort-lift-plat ((obj fort-lift-plat)) +;; (defmethod base-plat-method-32 ((obj fort-lift-plat)) ;; 0 ;; (none) ;; ) @@ -110,7 +106,7 @@ ) ) -(defmethod execute-effects fort-lift-plat ((this fort-lift-plat)) +(defmethod execute-effects ((this fort-lift-plat)) "Executes various ancillary tasks with the platform, such as spawning particles or playing the associated sound" (if (nonzero? (-> this part)) (spawn-with-cspace (-> this part) (-> this node-list data 6)) @@ -123,7 +119,7 @@ ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-plat-collision! fort-lift-plat ((this fort-lift-plat)) +(defmethod init-plat-collision! ((this fort-lift-plat)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -187,13 +183,13 @@ ) ;; WARN: Return type mismatch sparticle-launch-control vs none. -(defmethod base-plat-method-32 fort-lift-plat ((this fort-lift-plat)) +(defmethod base-plat-method-32 ((this fort-lift-plat)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 618) this)) (none) ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! fort-lift-plat ((this fort-lift-plat)) +(defmethod init-plat! ((this fort-lift-plat)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this root pause-adjust-distance) 327680.0) @@ -201,13 +197,13 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod deactivate fort-lift-plat ((this fort-lift-plat)) +(defmethod deactivate ((this fort-lift-plat)) (sound-stop (-> this sound-id)) ((method-of-type plat deactivate) this) (none) ) -(defmethod plat-path-sync fort-lift-plat ((this fort-lift-plat)) +(defmethod plat-path-sync ((this fort-lift-plat)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @@ -236,16 +232,12 @@ otherwise, [[plat::34]] ) (deftype fort-claw (process-drawable) - ((path-u float :offset-assert 200) - (path-dest float :offset-assert 204) + ((path-u float) + (path-dest float) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (pause () _type_ :state 21) + (:state-methods + idle + pause ) ) @@ -287,7 +279,7 @@ otherwise, [[plat::34]] ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-claw ((this fort-claw) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-claw) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/fortress/exit/forexita-part.gc b/goal_src/jak2/levels/fortress/exit/forexita-part.gc index 3e1c9fd1d3c..cd6e0e2afe9 100644 --- a/goal_src/jak2/levels/fortress/exit/forexita-part.gc +++ b/goal_src/jak2/levels/fortress/exit/forexita-part.gc @@ -11,10 +11,6 @@ (deftype forexita-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/fortress/exit/forexitb-part.gc b/goal_src/jak2/levels/fortress/exit/forexitb-part.gc index b0b43e1c9f7..e31acbe3de4 100644 --- a/goal_src/jak2/levels/fortress/exit/forexitb-part.gc +++ b/goal_src/jak2/levels/fortress/exit/forexitb-part.gc @@ -9,10 +9,6 @@ (deftype forexitb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/fortress/fort-turret.gc b/goal_src/jak2/levels/fortress/fort-turret.gc index a579e741207..477f93a9023 100644 --- a/goal_src/jak2/levels/fortress/fort-turret.gc +++ b/goal_src/jak2/levels/fortress/fort-turret.gc @@ -389,36 +389,34 @@ ) (deftype fort-turret (enemy) - ((gun-tilt-jm joint-mod :offset-assert 532) - (gun-shadow-jm joint-mod :offset-assert 536) - (aim-pos vector :inline :offset-assert 544) - (target-bullseye vector :inline :offset-assert 560) - (gun-twist float :offset-assert 576) - (gun-tilt float :offset-assert 580) - (desired-twist float :offset-assert 584) - (desired-tilt float :offset-assert 588) - (los-clear symbol :offset-assert 592) - (flash-state basic :offset-assert 596) - (flash-index uint32 :offset-assert 600) - (can-shoot symbol :offset-assert 604) - (last-hit-time time-frame :offset-assert 608) - (init-mat matrix :inline :offset-assert 624) - (target-timeout uint64 :offset-assert 688) - (beam-intersect basic :offset-assert 696) - (sync sync-linear :inline :offset-assert 704) - (invincible symbol :offset-assert 720) + ((gun-tilt-jm joint-mod) + (gun-shadow-jm joint-mod) + (aim-pos vector :inline) + (target-bullseye vector :inline) + (gun-twist float) + (gun-tilt float) + (desired-twist float) + (desired-tilt float) + (los-clear symbol) + (flash-state basic) + (flash-index uint32) + (can-shoot symbol) + (last-hit-time time-frame) + (init-mat matrix :inline) + (target-timeout uint64) + (beam-intersect basic) + (sync sync-linear :inline) + (invincible symbol) ) - :heap-base #x260 - :method-count-assert 143 - :size-assert #x2d4 - :flag-assert #x8f026002d4 + (:state-methods + attack + sweep + ) (:methods - (attack () _type_ :state 137) - (sweep () _type_ :state 138) - (fort-turret-method-139 (_type_) none 139) - (fort-turret-method-140 (_type_ float float) quaternion 140) - (fort-turret-method-141 (_type_) vector 141) - (fort-turret-method-142 (_type_ symbol int) symbol 142) + (fort-turret-method-139 (_type_) none) + (fort-turret-method-140 (_type_ float float) quaternion) + (fort-turret-method-141 (_type_) vector) + (fort-turret-method-142 (_type_ symbol int) symbol) ) ) @@ -505,7 +503,7 @@ (set! (-> *fort-turret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod track-target! fort-turret ((this fort-turret)) +(defmethod track-target! ((this fort-turret)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -535,7 +533,7 @@ ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod fort-turret-method-139 fort-turret ((this fort-turret)) +(defmethod fort-turret-method-139 ((this fort-turret)) (let ((a0-2 (handle->process (-> this focus handle)))) (if a0-2 (set! (-> this aim-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) @@ -585,7 +583,7 @@ (none) ) -(defmethod fort-turret-method-140 fort-turret ((this fort-turret) (arg0 float) (arg1 float)) +(defmethod fort-turret-method-140 ((this fort-turret) (arg0 float) (arg1 float)) (rider-trans) (let ((s3-0 (new 'stack-no-clear 'matrix))) (+! (-> this gun-twist) (fmax (- arg1) (fmin arg1 (* arg0 (- (-> this desired-twist) (-> this gun-twist)))))) @@ -597,7 +595,7 @@ (quaternion-axis-angle! (-> this gun-tilt-jm quat) 1.0 0.0 0.0 (-> this gun-tilt)) ) -(defmethod fort-turret-method-141 fort-turret ((this fort-turret)) +(defmethod fort-turret-method-141 ((this fort-turret)) (let* ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 12))) (v1-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 12 bone transform vector 2) 1.0) @@ -659,7 +657,7 @@ ) ) -(defmethod fort-turret-method-142 fort-turret ((this fort-turret) (arg0 symbol) (arg1 int)) +(defmethod fort-turret-method-142 ((this fort-turret) (arg0 symbol) (arg1 int)) (let ((v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg1))) (s4-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) @@ -855,7 +853,7 @@ ) ) -(defmethod general-event-handler fort-turret ((this fort-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this fort-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (if (and (= arg2 'notify) (< 1 arg1) (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) *target*)) @@ -942,19 +940,19 @@ ) ) -(defmethod coin-flip? fort-turret ((this fort-turret)) +(defmethod coin-flip? ((this fort-turret)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch int vs penetrate. -(defmethod get-penetrate-info fort-turret ((this fort-turret)) +(defmethod get-penetrate-info ((this fort-turret)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (the-as penetrate 0) ) -(defmethod init-enemy-collision! fort-turret ((this fort-turret)) +(defmethod init-enemy-collision! ((this fort-turret)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (stack-size-set! (-> this main-thread) 512) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -1006,8 +1004,14 @@ (none) ) +;; og:preserve-this +;; (defmethod coin-flip? ((this fort-turret)) +;; "@returns The result of a 50/50 RNG roll" +;; #f +;; ) + ;; WARN: Return type mismatch enemy vs fort-turret. -(defmethod relocate fort-turret ((this fort-turret) (arg0 int)) +(defmethod relocate ((this fort-turret) (arg0 int)) (if (nonzero? (-> this gun-tilt-jm)) (&+! (-> this gun-tilt-jm) arg0) ) @@ -1017,7 +1021,7 @@ (the-as fort-turret ((method-of-type enemy relocate) this arg0)) ) -(defmethod init-enemy! fort-turret ((this fort-turret)) +(defmethod init-enemy! ((this fort-turret)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/fortress/fortress-obs.gc b/goal_src/jak2/levels/fortress/fortress-obs.gc index 8c3181ea23b..ae1d3ab44e9 100644 --- a/goal_src/jak2/levels/fortress/fortress-obs.gc +++ b/goal_src/jak2/levels/fortress/fortress-obs.gc @@ -8,16 +8,12 @@ ;; DECOMP BEGINS (deftype fort-trap-door (process-drawable) - ((root collide-shape-moving :override) - (notify-actor entity-actor :offset-assert 200) + ((root collide-shape-moving :override) + (notify-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16005000cc - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) @@ -146,7 +142,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-trap-door ((this fort-trap-door) (entity entity-actor)) +(defmethod init-from-entity! ((this fort-trap-door) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -194,10 +190,6 @@ This commonly includes things such as: (deftype water-anim-fortress (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) @@ -215,7 +207,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-fortress ((this water-anim-fortress)) +(defmethod init-water! ((this water-anim-fortress)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((parent-method (method-of-type water-anim init-water!))) (parent-method this) diff --git a/goal_src/jak2/levels/fortress/prison/prison-obs.gc b/goal_src/jak2/levels/fortress/prison/prison-obs.gc index 733a72aba38..e3adf0bcd57 100644 --- a/goal_src/jak2/levels/fortress/prison/prison-obs.gc +++ b/goal_src/jak2/levels/fortress/prison/prison-obs.gc @@ -207,15 +207,11 @@ ) (deftype prsn-hang-cell (process-drawable) - ((path-u float :offset-assert 200) - (path-du float :offset-assert 204) + ((path-u float) + (path-du float) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -252,7 +248,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-hang-cell ((this prsn-hang-cell) (arg0 entity-actor)) +(defmethod init-from-entity! ((this prsn-hang-cell) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -321,15 +317,11 @@ This commonly includes things such as: (deftype warp-gate-b (warp-gate) () - :heap-base #x80 - :method-count-assert 26 - :size-assert #x100 - :flag-assert #x1a00800100 ) ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-skel-and-collide warp-gate-b ((this warp-gate-b)) +(defmethod init-skel-and-collide ((this warp-gate-b)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -356,15 +348,11 @@ This commonly includes things such as: ) (deftype prsn-cell-door (process-drawable) - ((frame float :offset-assert 200) - (desired float :offset-assert 204) + ((frame float) + (desired float) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -409,7 +397,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-cell-door ((this prsn-cell-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this prsn-cell-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -448,12 +436,8 @@ This commonly includes things such as: (deftype prsn-vent-fan (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -480,7 +464,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-vent-fan ((this prsn-vent-fan) (arg0 entity-actor)) +(defmethod init-from-entity! ((this prsn-vent-fan) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -501,12 +485,8 @@ This commonly includes things such as: (deftype prsn-torture (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -530,7 +510,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-torture ((this prsn-torture) (arg0 entity-actor)) +(defmethod init-from-entity! ((this prsn-torture) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/fortress/prison/prison-part.gc b/goal_src/jak2/levels/fortress/prison/prison-part.gc index 784f53e56be..bf18a560b90 100644 --- a/goal_src/jak2/levels/fortress/prison/prison-part.gc +++ b/goal_src/jak2/levels/fortress/prison/prison-part.gc @@ -9,10 +9,6 @@ (deftype prison-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc index c30cf59fe35..61ae287dcc0 100644 --- a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc @@ -26,14 +26,10 @@ ) (deftype fort-elec-button (cty-guard-turret-button) - ((start-up? symbol :offset-assert 288) + ((start-up? symbol) ) - :heap-base #xb0 - :method-count-assert 41 - :size-assert #x124 - :flag-assert #x2900b00124 - (:methods - (waiting () _type_ :state 40) + (:state-methods + waiting ) ) @@ -55,7 +51,7 @@ :code sleep-code ) -(defmethod basebutton-method-33 fort-elec-button ((this fort-elec-button)) +(defmethod basebutton-method-33 ((this fort-elec-button)) "TODO - joint stuff" (initialize-skeleton this @@ -86,7 +82,7 @@ ) ;; WARN: Return type mismatch process-mask vs none. -(defmethod prepare-trigger-event! fort-elec-button ((this fort-elec-button)) +(defmethod prepare-trigger-event! ((this fort-elec-button)) "Sets `event-going-down` to `'trigger`" (set! (-> this start-up?) (= 1 (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0))) (set! (-> this event-going-down) 'trigger) @@ -95,7 +91,7 @@ (none) ) -(defmethod idle-state-transition fort-elec-button ((this fort-elec-button)) +(defmethod idle-state-transition ((this fort-elec-button)) "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" (cond ((-> this start-up?) @@ -116,15 +112,11 @@ ) (deftype fort-led (process-drawable) - ((button-actor entity-actor :offset-assert 200) + ((button-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16005000cc - (:methods - (red () _type_ :state 20) - (green () _type_ :state 21) + (:state-methods + red + green ) ) @@ -167,7 +159,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-led ((this fort-led) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-led) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -192,17 +184,15 @@ This commonly includes things such as: ) (deftype elec-lock-gate (fort-elec-gate) - ((actor-group (pointer actor-group) :offset-assert 516) - (actor-group-count int32 :offset-assert 520) - (all-gone? symbol :offset-assert 524) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (all-gone? symbol) ) - :heap-base #x190 - :method-count-assert 32 - :size-assert #x210 - :flag-assert #x2001900210 + (:state-methods + pre-shutdown + ) (:methods - (pre-shutdown () _type_ :state 30) - (elec-lock-gate-method-31 (_type_ symbol) symbol 31) + (elec-lock-gate-method-31 (_type_ symbol) symbol) ) ) @@ -354,7 +344,7 @@ This commonly includes things such as: ) ) -(defmethod elec-lock-gate-method-31 elec-lock-gate ((this elec-lock-gate) (arg0 symbol)) +(defmethod elec-lock-gate-method-31 ((this elec-lock-gate) (arg0 symbol)) (dotimes (v1-0 (-> this actor-group-count)) (dotimes (a2-0 (-> this actor-group v1-0 length)) (when (or (not arg0) (let ((a3-5 (-> this actor-group v1-0 data a2-0 actor))) @@ -376,7 +366,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod set-state! elec-lock-gate ((this elec-lock-gate)) +(defmethod set-state! ((this elec-lock-gate)) "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed make the gate `idle`. @@ -388,7 +378,7 @@ Otherwise, the gate will be `active`." (none) ) -(defmethod set-palette! elec-lock-gate ((this elec-lock-gate)) +(defmethod set-palette! ((this elec-lock-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" (local-vars (sv-16 res-tag)) (let ((t9-0 (method-of-type fort-elec-gate set-palette!))) diff --git a/goal_src/jak2/levels/fortress/rescue/forresca-part.gc b/goal_src/jak2/levels/fortress/rescue/forresca-part.gc index 7409b179e69..bcc7f50f713 100644 --- a/goal_src/jak2/levels/fortress/rescue/forresca-part.gc +++ b/goal_src/jak2/levels/fortress/rescue/forresca-part.gc @@ -9,10 +9,6 @@ (deftype forresca-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) @@ -1469,7 +1465,7 @@ ) ) -(defmethod elec-gate-method-24 fort-elec-gate ((this fort-elec-gate)) +(defmethod elec-gate-method-24 ((this fort-elec-gate)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 653) this)) (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 654) this)) 0 diff --git a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc index 04ea89ac05d..81579755d84 100644 --- a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc @@ -8,15 +8,11 @@ ;; DECOMP BEGINS (deftype fort-twist-rail (process-drawable) - ((sync sync-eased :inline :offset-assert 200) - (init-quat quaternion :inline :offset-assert 256) + ((sync sync-eased :inline) + (init-quat quaternion :inline) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x110 - :flag-assert #x1500900110 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -39,7 +35,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-twist-rail ((this fort-twist-rail) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-twist-rail) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -118,22 +114,18 @@ This commonly includes things such as: ) (deftype fort-elec-belt-inst (process-drawable) - ((l-spec lightning-spec :offset-assert 200) - (l-bolt lightning-control :offset-assert 204) - (points vector 17 :inline :offset-assert 208) - (path-u float :offset-assert 480) - (path-du float :offset-assert 484) - (attack-id uint32 :offset-assert 488) - (sound-id sound-id :offset-assert 492) + ((l-spec lightning-spec) + (l-bolt lightning-control) + (points vector 17 :inline) + (path-u float) + (path-du float) + (attack-id uint32) + (sound-id sound-id) ) - :heap-base #x170 - :method-count-assert 23 - :size-assert #x1f0 - :flag-assert #x17017001f0 - (:methods - (idle () _type_ :state 20) - (running () _type_ :state 21) - (die () _type_ :state 22) + (:state-methods + idle + running + die ) ) @@ -382,14 +374,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs fort-elec-belt-inst. -(defmethod relocate fort-elec-belt-inst ((this fort-elec-belt-inst) (arg0 int)) +(defmethod relocate ((this fort-elec-belt-inst) (arg0 int)) (if (nonzero? (-> this l-bolt)) (&+! (-> this l-bolt) arg0) ) (the-as fort-elec-belt-inst ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate fort-elec-belt-inst ((this fort-elec-belt-inst)) +(defmethod deactivate ((this fort-elec-belt-inst)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -439,21 +431,19 @@ This commonly includes things such as: ) (deftype fort-elec-belt (process) - ((l-spec lightning-spec :offset-assert 128) - (next-spawn-time time-frame :offset-assert 136) - (path path-control :offset-assert 144) - (init-quat quaternion :inline :offset-assert 160) - (sync sync-linear :inline :offset-assert 176) - (attack-id uint32 :offset-assert 192) - (path-du float :offset-assert 196) + ((l-spec lightning-spec) + (next-spawn-time time-frame) + (path path-control) + (init-quat quaternion :inline) + (sync sync-linear :inline) + (attack-id uint32) + (path-du float) ) - :heap-base #x50 - :method-count-assert 16 - :size-assert #xc8 - :flag-assert #x10005000c8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (fort-elec-belt-method-15 (_type_) none 15) + (fort-elec-belt-method-15 (_type_) none) ) ) @@ -491,7 +481,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch symbol vs none. -(defmethod fort-elec-belt-method-15 fort-elec-belt ((this fort-elec-belt)) +(defmethod fort-elec-belt-method-15 ((this fort-elec-belt)) (let* ((f28-0 (total-distance (-> this path))) (s5-0 (-> this sync)) (f26-0 81.92) @@ -519,7 +509,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process vs fort-elec-belt. -(defmethod relocate fort-elec-belt ((this fort-elec-belt) (arg0 int)) +(defmethod relocate ((this fort-elec-belt) (arg0 int)) (if (nonzero? (-> this path)) (&+! (-> this path) arg0) ) @@ -527,7 +517,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-elec-belt ((this fort-elec-belt) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-elec-belt) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -597,10 +587,6 @@ This commonly includes things such as: (deftype fort-conveyor (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) @@ -609,13 +595,13 @@ This commonly includes things such as: :bounds (static-spherem 0 0 16 16.5) ) -(defmethod get-art-group fort-conveyor ((this fort-conveyor)) +(defmethod get-art-group ((this fort-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-fort-conveyor" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod reset-root! fort-conveyor ((this fort-conveyor)) +(defmethod reset-root! ((this fort-conveyor)) "Re-initializes the `root` [[trsqv]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -644,7 +630,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch vector vs none. -(defmethod init! fort-conveyor ((this fort-conveyor)) +(defmethod init! ((this fort-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (set! (-> this speed) -47104.0) (set! (-> this belt-radius) 24576.0) @@ -655,7 +641,7 @@ This commonly includes things such as: (none) ) -(defmethod set-and-get-ambient-sound! fort-conveyor ((this fort-conveyor)) +(defmethod set-and-get-ambient-sound! ((this fort-conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" (let* ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) diff --git a/goal_src/jak2/levels/fortress/rescue/forrescb-part.gc b/goal_src/jak2/levels/fortress/rescue/forrescb-part.gc index be1db3c28d0..20fb3df8067 100644 --- a/goal_src/jak2/levels/fortress/rescue/forrescb-part.gc +++ b/goal_src/jak2/levels/fortress/rescue/forrescb-part.gc @@ -9,10 +9,6 @@ (deftype forrescb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/gungame/gun-dummy.gc b/goal_src/jak2/levels/gungame/gun-dummy.gc index 2b59594be9a..c80af8c5859 100644 --- a/goal_src/jak2/levels/gungame/gun-dummy.gc +++ b/goal_src/jak2/levels/gungame/gun-dummy.gc @@ -1500,73 +1500,65 @@ ) (deftype tpath-control-frame (structure) - ((time float :offset-assert 0) - (path-pos uint8 :offset-assert 4) - (command tpath-command :offset-assert 5) - (move-type uint8 :offset-assert 6) - (path-num uint8 :offset-assert 7) + ((time float) + (path-pos uint8) + (command tpath-command) + (move-type uint8) + (path-num uint8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype tpath-info (structure) - ((s-time float :offset-assert 0) - (num uint16 :offset-assert 4) - (ref-time-num int16 :offset-assert 6) - (score int16 :offset-assert 8) - (flags tpath-flags :offset-assert 10) - (num-anims uint8 :offset-assert 11) - (bonus-time float :offset-assert 12) - (list (array int32) :offset-assert 16) - (anims (inline-array tpath-control-frame) 3 :offset-assert 20) - (anim1 (inline-array tpath-control-frame) :offset 20) - (anim2 (inline-array tpath-control-frame) :offset 24) - (anim3 (inline-array tpath-control-frame) :offset 28) + ((s-time float) + (num uint16) + (ref-time-num int16) + (score int16) + (flags tpath-flags) + (num-anims uint8) + (bonus-time float) + (list (array int32)) + (anims (inline-array tpath-control-frame) 3) + (anim1 (inline-array tpath-control-frame) :overlay-at (-> anims 0)) + (anim2 (inline-array tpath-control-frame) :overlay-at (-> anims 1)) + (anim3 (inline-array tpath-control-frame) :overlay-at (-> anims 2)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype gun-dummy (process-focusable) - ((incoming-attack-id uint32 :offset-assert 204) - (train-man handle :offset-assert 208) - (info tpath-info :offset-assert 216) - (y-offset float :offset-assert 220) - (rot-y-offset float :offset-assert 224) - (quat quaternion :inline :offset-assert 240) - (hit-points int32 :offset-assert 256) - (score float :offset-assert 260) - (path-num uint32 :offset-assert 264) - (next-spark int64 :offset-assert 272) - (inout-percent float :offset-assert 280) - (quat-ground quaternion :inline :offset-assert 288) - (path-pos float :offset-assert 304) - (score-speed float :offset-assert 308) - (first-time-command symbol :offset-assert 312) - (current (inline-array tpath-control-frame) :offset-assert 316) - (impact vector :inline :offset-assert 320) - (done? symbol :inline :offset-assert 336) - (move-sound sound-id :offset-assert 340) - (turn-sound sound-id :offset-assert 344) - (spin-sound sound-id :offset-assert 348) - (last-combo-time time-frame :offset-assert 352) + ((incoming-attack-id uint32) + (train-man handle) + (info tpath-info) + (y-offset float) + (rot-y-offset float) + (quat quaternion :inline) + (hit-points int32) + (score float) + (path-num uint32) + (next-spark int64) + (inout-percent float) + (quat-ground quaternion :inline) + (path-pos float) + (score-speed float) + (first-time-command symbol) + (current (inline-array tpath-control-frame)) + (impact vector :inline) + (done? symbol :inline) + (move-sound sound-id) + (turn-sound sound-id) + (spin-sound sound-id) + (last-combo-time time-frame) ) - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (init-dummy-collison! (_type_) none 28) - (path-playing? (_type_) symbol 29) - (path-time-elapsed (_type_) float 30) - (init-tpath-info! (_type_ tpath-info) none 31) - (break-dummy (_type_) none 32) + (init-dummy-collison! (_type_) none) + (path-playing? (_type_) symbol) + (path-time-elapsed (_type_) float) + (init-tpath-info! (_type_ tpath-info) none) + (break-dummy (_type_) none) ) ) @@ -1890,13 +1882,13 @@ ) ) -(defmethod break-dummy gun-dummy ((this gun-dummy)) +(defmethod break-dummy ((this gun-dummy)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" 0 (none) ) -(defmethod path-time-elapsed gun-dummy ((this gun-dummy)) +(defmethod path-time-elapsed ((this gun-dummy)) "@returns Calculates the combined total time across all control frames in the path" (let ((total-time 0.0)) (let ((curr-frame (the-as tpath-control-frame (-> this current)))) @@ -1935,7 +1927,7 @@ ) ) -(defmethod path-playing? gun-dummy ((this gun-dummy)) +(defmethod path-playing? ((this gun-dummy)) "Core functionality for playing back the dummy's path. Does things like: - calculates the score in case the dummy is hit based on the time elapsed - moves around the dummy @@ -2159,7 +2151,7 @@ ) ) -(defmethod get-trans gun-dummy ((this gun-dummy) (arg0 int)) +(defmethod get-trans ((this gun-dummy) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (let ((root (-> this root))) (case arg0 @@ -2313,7 +2305,7 @@ ) ) -(defmethod init-dummy-collison! gun-dummy ((this gun-dummy)) +(defmethod init-dummy-collison! ((this gun-dummy)) "Initializes the collision related stuff for the dummy" (let ((cshape-moving (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape-moving dynam) (copy *standard-dynamics* 'process)) @@ -2342,12 +2334,12 @@ ) ;; WARN: Return type mismatch process-focusable vs gun-dummy. -(defmethod relocate gun-dummy ((this gun-dummy) (arg0 int)) +(defmethod relocate ((this gun-dummy) (arg0 int)) (the-as gun-dummy ((method-of-type process-focusable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gun-dummy ((this gun-dummy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gun-dummy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2367,7 +2359,7 @@ This commonly includes things such as: (none) ) -(defmethod init-tpath-info! gun-dummy ((this gun-dummy) (arg0 tpath-info)) +(defmethod init-tpath-info! ((this gun-dummy) (arg0 tpath-info)) "Given a [[tpath-info]] use it to initialize the dummy with any relevant data or flags" (logior! (-> this mask) (process-mask enemy)) (logior! (-> this mask) (process-mask collectable)) @@ -2408,95 +2400,55 @@ This commonly includes things such as: (deftype gun-dummy-a (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) (deftype gun-dummy-b (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) (deftype gun-dummy-c (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) (deftype gun-dummy-big (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) (deftype gun-dummy-gold (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) (deftype gun-dummy-peace (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) (deftype gun-cit-a (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) (deftype gun-cit-b (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) (deftype gun-cit-c (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) (deftype gun-cit-d (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) -(defmethod break-dummy gun-dummy-a ((this gun-dummy-a)) +(defmethod break-dummy ((this gun-dummy-a)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2534,7 +2486,7 @@ This commonly includes things such as: (none) ) -(defmethod break-dummy gun-dummy-b ((this gun-dummy-b)) +(defmethod break-dummy ((this gun-dummy-b)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2570,7 +2522,7 @@ This commonly includes things such as: (none) ) -(defmethod break-dummy gun-dummy-c ((this gun-dummy-c)) +(defmethod break-dummy ((this gun-dummy-c)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2606,7 +2558,7 @@ This commonly includes things such as: (none) ) -(defmethod break-dummy gun-dummy-big ((this gun-dummy-big)) +(defmethod break-dummy ((this gun-dummy-big)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2642,7 +2594,7 @@ This commonly includes things such as: (none) ) -(defmethod break-dummy gun-dummy-gold ((this gun-dummy-gold)) +(defmethod break-dummy ((this gun-dummy-gold)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2678,7 +2630,7 @@ This commonly includes things such as: (none) ) -(defmethod break-dummy gun-dummy-peace ((this gun-dummy-peace)) +(defmethod break-dummy ((this gun-dummy-peace)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2714,7 +2666,7 @@ This commonly includes things such as: (none) ) -(defmethod break-dummy gun-cit-a ((this gun-cit-a)) +(defmethod break-dummy ((this gun-cit-a)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2752,7 +2704,7 @@ This commonly includes things such as: (none) ) -(defmethod break-dummy gun-cit-b ((this gun-cit-b)) +(defmethod break-dummy ((this gun-cit-b)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2790,7 +2742,7 @@ This commonly includes things such as: (none) ) -(defmethod break-dummy gun-cit-c ((this gun-cit-c)) +(defmethod break-dummy ((this gun-cit-c)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2828,7 +2780,7 @@ This commonly includes things such as: (none) ) -(defmethod break-dummy gun-cit-d ((this gun-cit-d)) +(defmethod break-dummy ((this gun-cit-d)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) diff --git a/goal_src/jak2/levels/gungame/gungame-data.gc b/goal_src/jak2/levels/gungame/gungame-data.gc index a0a6a732dfe..6ca69b85926 100644 --- a/goal_src/jak2/levels/gungame/gungame-data.gc +++ b/goal_src/jak2/levels/gungame/gungame-data.gc @@ -13,17 +13,14 @@ "Describes the contents and position of the crates in the gungame `num` is the amount of TOTAL ammo to spawn (not pickups) For example `20` would mean 4 red gun pickups, or 2 yellow gun pickups" - ((pos vector :inline :offset-assert 0) - (pos-x float :offset 0) - (pos-y float :offset 4) - (pos-z float :offset 8) - (angle float :offset 12) - (ammo pickup-type :offset-assert 16) - (num uint32 :offset-assert 20) + ((pos vector :inline) + (pos-x float :overlay-at (-> pos data 0)) + (pos-y float :overlay-at (-> pos data 1)) + (pos-z float :overlay-at (-> pos data 2)) + (angle float :overlay-at (-> pos data 3)) + (ammo pickup-type) + (num uint32) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) diff --git a/goal_src/jak2/levels/gungame/gungame-obs.gc b/goal_src/jak2/levels/gungame/gungame-obs.gc index 039de6932c2..4596f924c46 100644 --- a/goal_src/jak2/levels/gungame/gungame-obs.gc +++ b/goal_src/jak2/levels/gungame/gungame-obs.gc @@ -8,76 +8,70 @@ ;; DECOMP BEGINS (deftype training-path (process-drawable) - ((num uint32 :offset-assert 200) + ((num uint32) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xcc - :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype training-manager (process) - ((actor-group (pointer actor-group) :offset-assert 128) - (actor-group-count int32 :offset-assert 132) - (start-time time-frame :offset-assert 136) - (score int32 :offset-assert 144) - (first-enemy-shown? symbol :offset-assert 148) - (first-citizen-shown? symbol :offset-assert 152) - (open-end? symbol :offset-assert 156) - (entrance-crates handle 32 :offset-assert 160) - (course-crates handle 32 :offset-assert 416) - (course (array tpath-info) :offset-assert 672) - (end-door uint32 :offset-assert 676) - (total-target uint32 :offset-assert 680) - (total-target-destroyed uint32 :offset-assert 684) - (total-bonus uint32 :offset-assert 688) - (total-bonus-destroyed uint32 :offset-assert 692) - (total-civilian uint32 :offset-assert 696) - (hud-score handle :offset-assert 704) - (hud-goal handle :offset-assert 712) - (in-out uint32 :offset-assert 720) - (combo-done? symbol :offset-assert 724) - (voicebox handle :offset-assert 728) - (last-sound-id sound-id :offset-assert 736) - (dummies handle 2 :offset-assert 744) - (task-gold uint16 :offset-assert 760) - (task-silver uint16 :offset-assert 762) - (task-bronze uint16 :offset-assert 764) - (game-score uint8 :offset-assert 766) - (training-goal float :offset-assert 768) - (training? symbol :offset-assert 772) - (egg-count int32 :offset-assert 776) - (medal int32 :offset-assert 780) - (gui-id sound-id :offset-assert 784) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (start-time time-frame) + (score int32) + (first-enemy-shown? symbol) + (first-citizen-shown? symbol) + (open-end? symbol) + (entrance-crates handle 32) + (course-crates handle 32) + (course (array tpath-info)) + (end-door uint32) + (total-target uint32) + (total-target-destroyed uint32) + (total-bonus uint32) + (total-bonus-destroyed uint32) + (total-civilian uint32) + (hud-score handle) + (hud-goal handle) + (in-out uint32) + (combo-done? symbol) + (voicebox handle) + (last-sound-id sound-id) + (dummies handle 2) + (task-gold uint16) + (task-silver uint16) + (task-bronze uint16) + (game-score uint8) + (training-goal float) + (training? symbol) + (egg-count int32) + (medal int32) + (gui-id sound-id) ) - :heap-base #x2a0 - :method-count-assert 33 - :size-assert #x314 - :flag-assert #x2102a00314 + (:state-methods + wait + course + end-course + red-training-intro + red-training + red-yellow-training + yellow-training-intro + ) (:methods - (wait () _type_ :state 14) - (course () _type_ :state 15) - (end-course () _type_ :state 16) - (red-training-intro () _type_ :state 17) - (red-training () _type_ :state 18) - (red-yellow-training () _type_ :state 19) - (yellow-training-intro () _type_ :state 20) - (training-manager-method-21 (_type_ handle) entity 21) - (training-manager-method-22 (_type_ symbol) symbol 22) - (training-manager-method-23 (_type_ (array gungame-crate)) symbol 23) - (training-manager-method-24 (_type_) symbol 24) - (training-manager-method-25 (_type_) symbol 25) - (training-manager-method-26 (_type_) int 26) - (training-manager-method-27 (_type_ (array tpath-info)) symbol 27) - (training-manager-method-28 (_type_) none 28) - (training-manager-method-29 (_type_ vector) vector 29) - (render-text (_type_ text-id) float 30) - (training-manager-method-31 (_type_) none 31) - (training-manager-method-32 (_type_) none 32) + (training-manager-method-21 (_type_ handle) entity) + (training-manager-method-22 (_type_ symbol) symbol) + (training-manager-method-23 (_type_ (array gungame-crate)) symbol) + (training-manager-method-24 (_type_) symbol) + (training-manager-method-25 (_type_) symbol) + (training-manager-method-26 (_type_) int) + (training-manager-method-27 (_type_ (array tpath-info)) symbol) + (training-manager-method-28 (_type_) none) + (training-manager-method-29 (_type_ vector) vector) + (render-text (_type_ text-id) float) + (training-manager-method-31 (_type_) none) + (training-manager-method-32 (_type_) none) ) (:states yellow-training @@ -85,7 +79,7 @@ ) -(defmethod training-manager-method-32 training-manager ((this training-manager)) +(defmethod training-manager-method-32 ((this training-manager)) (when (handle->process (-> this voicebox)) (if (= (get-status *gui-control* (-> this last-sound-id)) (gui-status unknown)) (send-event (handle->process (-> this voicebox)) 'speak-effect #f) @@ -143,7 +137,7 @@ ) ) -(defmethod deactivate training-manager ((this training-manager)) +(defmethod deactivate ((this training-manager)) (if (handle->process (-> this voicebox)) (send-event (handle->process (-> this voicebox)) 'die) ) @@ -154,7 +148,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! training-path ((this training-path) (arg0 entity-actor)) +(defmethod init-from-entity! ((this training-path) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -197,7 +191,7 @@ This commonly includes things such as: (none) ) -(defmethod training-manager-method-31 training-manager ((this training-manager)) +(defmethod training-manager-method-31 ((this training-manager)) (cond ((= (-> (level-get-target-inside *level*) name) 'gungame) (when (or (zero? (-> this in-out)) (= (-> this in-out) 1)) @@ -219,7 +213,7 @@ This commonly includes things such as: (none) ) -(defmethod render-text training-manager ((this training-manager) (arg0 text-id)) +(defmethod render-text ((this training-manager) (arg0 text-id)) (when (= (get-status *gui-control* (-> this gui-id)) (gui-status active)) (let ((s5-1 (new 'stack 'font-context *font-default-matrix* 32 290 0.0 (font-color default) (font-flags shadow kerning)) @@ -1862,7 +1856,7 @@ This commonly includes things such as: ) ) -(defmethod training-manager-method-21 training-manager ((this training-manager) (arg0 handle)) +(defmethod training-manager-method-21 ((this training-manager) (arg0 handle)) (let ((s4-0 0) (v1-3 (+ (length (-> this actor-group 0)) -1)) ) @@ -1892,7 +1886,7 @@ This commonly includes things such as: (the-as entity #f) ) -(defmethod training-manager-method-26 training-manager ((this training-manager)) +(defmethod training-manager-method-26 ((this training-manager)) (local-vars (s3-0 object)) (let ((gp-0 0)) (dotimes (s4-0 (-> *entrance-gungame-crates-pos* length)) @@ -1922,7 +1916,7 @@ This commonly includes things such as: ) ) -(defmethod training-manager-method-29 training-manager ((this training-manager) (arg0 vector)) +(defmethod training-manager-method-29 ((this training-manager) (arg0 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1964,7 +1958,7 @@ This commonly includes things such as: ) ) -(defmethod training-manager-method-22 training-manager ((this training-manager) (arg0 symbol)) +(defmethod training-manager-method-22 ((this training-manager) (arg0 symbol)) (local-vars (v1-28 symbol) (a0-18 symbol) (sv-48 process) (sv-64 process) (sv-80 process)) (let ((s4-0 (new 'static 'fact-info :pickup-type (pickup-type ammo-red) :pickup-spawn-amount 20.0)) (s3-0 (new 'stack-no-clear 'vector)) @@ -2028,7 +2022,7 @@ This commonly includes things such as: #f ) -(defmethod training-manager-method-25 training-manager ((this training-manager)) +(defmethod training-manager-method-25 ((this training-manager)) (dotimes (s5-0 (-> *entrance-gungame-crates-pos* length)) (when (handle->process (-> this entrance-crates s5-0)) (deactivate (-> this entrance-crates s5-0 process 0)) @@ -2038,7 +2032,7 @@ This commonly includes things such as: #f ) -(defmethod training-manager-method-24 training-manager ((this training-manager)) +(defmethod training-manager-method-24 ((this training-manager)) (dotimes (s5-0 32) (when (handle->process (-> this course-crates s5-0)) (deactivate (-> this course-crates s5-0 process 0)) @@ -2048,7 +2042,7 @@ This commonly includes things such as: #f ) -(defmethod training-manager-method-23 training-manager ((this training-manager) (arg0 (array gungame-crate))) +(defmethod training-manager-method-23 ((this training-manager) (arg0 (array gungame-crate))) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'static 'fact-info)) ) @@ -2078,7 +2072,7 @@ This commonly includes things such as: #f ) -(defmethod training-manager-method-27 training-manager ((this training-manager) (arg0 (array tpath-info))) +(defmethod training-manager-method-27 ((this training-manager) (arg0 (array tpath-info))) (dotimes (s5-0 (length arg0)) (let ((v1-2 (-> arg0 s5-0))) 0 @@ -2122,7 +2116,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod training-manager-method-28 training-manager ((this training-manager)) +(defmethod training-manager-method-28 ((this training-manager)) (cond ((task-node-open? (game-task-node city-red-gun-training-introduction)) (go (method-of-object this red-training-intro)) @@ -2146,7 +2140,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! training-manager ((this training-manager) (arg0 entity-actor)) +(defmethod init-from-entity! ((this training-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2192,23 +2186,21 @@ This commonly includes things such as: ) (deftype gungame-door (process-drawable) - ((open-side symbol :offset-assert 200) - (close-sound sound-id :offset-assert 204) - (train handle :offset-assert 208) - (last-player-dist float :offset-assert 216) - (last-camera-dist float :offset-assert 220) - (close-state uint32 :offset-assert 224) + ((open-side symbol) + (close-sound sound-id) + (train handle) + (last-player-dist float) + (last-camera-dist float) + (close-state uint32) ) - :heap-base #x70 - :method-count-assert 25 - :size-assert #xe4 - :flag-assert #x19007000e4 + (:state-methods + idle + open + close + ) (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) - (close () _type_ :state 22) - (gungame-door-method-23 (_type_) symbol 23) - (gungame-door-method-24 (_type_) symbol 24) + (gungame-door-method-23 (_type_) symbol) + (gungame-door-method-24 (_type_) symbol) ) ) @@ -2295,7 +2287,7 @@ This commonly includes things such as: :post transform-post ) -(defmethod gungame-door-method-23 gungame-door ((this gungame-door)) +(defmethod gungame-door-method-23 ((this gungame-door)) (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) (f26-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) (f30-0 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) @@ -2355,7 +2347,7 @@ This commonly includes things such as: ) ;; WARN: disable def twice: 41. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod gungame-door-method-24 gungame-door ((this gungame-door)) +(defmethod gungame-door-method-24 ((this gungame-door)) (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) @@ -2418,7 +2410,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gungame-door ((this gungame-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gungame-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/gungame/gungame-part.gc b/goal_src/jak2/levels/gungame/gungame-part.gc index e4f611b8035..0d59374c573 100644 --- a/goal_src/jak2/levels/gungame/gungame-part.gc +++ b/goal_src/jak2/levels/gungame/gungame-part.gc @@ -9,10 +9,6 @@ (deftype gungame-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/hideout/hideout-obs.gc b/goal_src/jak2/levels/hideout/hideout-obs.gc index 17f510dd594..94642cfebdd 100644 --- a/goal_src/jak2/levels/hideout/hideout-obs.gc +++ b/goal_src/jak2/levels/hideout/hideout-obs.gc @@ -15,15 +15,11 @@ (deftype hide-door-b (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hide-door-b ((this hide-door-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hide-door-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -81,12 +77,8 @@ This commonly includes things such as: (deftype hide-light (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -153,7 +145,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hide-light ((this hide-light) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hide-light) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/hideout/hideout-part.gc b/goal_src/jak2/levels/hideout/hideout-part.gc index 5ccd079430b..9afa848b9ce 100644 --- a/goal_src/jak2/levels/hideout/hideout-part.gc +++ b/goal_src/jak2/levels/hideout/hideout-part.gc @@ -11,10 +11,6 @@ (deftype hide-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/hiphog/hiphog-obs.gc b/goal_src/jak2/levels/hiphog/hiphog-obs.gc index 1fdac3af94d..419134d4294 100644 --- a/goal_src/jak2/levels/hiphog/hiphog-obs.gc +++ b/goal_src/jak2/levels/hiphog/hiphog-obs.gc @@ -9,12 +9,8 @@ (deftype hip-trophy-a (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -31,7 +27,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-a ((this hip-trophy-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -56,12 +52,8 @@ This commonly includes things such as: (deftype hip-trophy-d (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -78,7 +70,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-d ((this hip-trophy-d) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-d) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -103,12 +95,8 @@ This commonly includes things such as: (deftype hip-trophy-f (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -125,7 +113,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-f ((this hip-trophy-f) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-f) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -150,12 +138,8 @@ This commonly includes things such as: (deftype hip-trophy-g (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -172,7 +156,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-g ((this hip-trophy-g) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-g) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -197,12 +181,8 @@ This commonly includes things such as: (deftype hip-trophy-i (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -219,7 +199,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-i ((this hip-trophy-i) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-i) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -244,12 +224,8 @@ This commonly includes things such as: (deftype hip-trophy-j (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -266,7 +242,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-j ((this hip-trophy-j) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-j) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -291,12 +267,8 @@ This commonly includes things such as: (deftype hip-trophy-n (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -313,7 +285,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-n ((this hip-trophy-n) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-n) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -338,12 +310,8 @@ This commonly includes things such as: (deftype hip-trophy-m (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -360,7 +328,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-m ((this hip-trophy-m) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-m) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/hiphog/hiphog-part.gc b/goal_src/jak2/levels/hiphog/hiphog-part.gc index f357a78391b..201113b9f7b 100644 --- a/goal_src/jak2/levels/hiphog/hiphog-part.gc +++ b/goal_src/jak2/levels/hiphog/hiphog-part.gc @@ -9,10 +9,6 @@ (deftype hiphog-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) @@ -1491,12 +1487,9 @@ Every real second is 1/60th of a second in Jak's time of day" (deftype hiphog-mirror-wf-pt (structure) "@unused seemingly not used, but probably stood for hiphog-mirror-waveform-point" - ((x float :offset-assert 0) - (y float :offset-assert 4) + ((x float) + (y float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) diff --git a/goal_src/jak2/levels/hiphog/hiphog-scenes.gc b/goal_src/jak2/levels/hiphog/hiphog-scenes.gc index bc612071552..cbabad52c7e 100644 --- a/goal_src/jak2/levels/hiphog/hiphog-scenes.gc +++ b/goal_src/jak2/levels/hiphog/hiphog-scenes.gc @@ -17,15 +17,11 @@ (deftype hip-door-b (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-door-b ((this hip-door-b) (entiy entity-actor)) +(defmethod init-from-entity! ((this hip-door-b) (entiy entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -88,10 +84,6 @@ This commonly includes things such as: (deftype hip-whack-a-metal (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) @@ -106,7 +98,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-art! hip-whack-a-metal ((this hip-whack-a-metal)) +(defmethod init-art! ((this hip-whack-a-metal)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -116,7 +108,7 @@ This commonly includes things such as: (none) ) -(defmethod get-art-elem hip-whack-a-metal ((this hip-whack-a-metal)) +(defmethod get-art-elem ((this hip-whack-a-metal)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> (get-current-task-event (-> this task)) action) @@ -157,12 +149,8 @@ This commonly includes things such as: (deftype hip-mirror (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -186,7 +174,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-mirror ((this hip-mirror) (entity entity-actor)) +(defmethod init-from-entity! ((this hip-mirror) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -357,14 +345,10 @@ This commonly includes things such as: (deftype sig-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) -(defmethod get-art-elem sig-npc ((this sig-npc)) +(defmethod get-art-elem ((this sig-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (if (task-node-open? (game-task-node forest-hunt-introduction)) @@ -373,7 +357,7 @@ This commonly includes things such as: ) ) -(defmethod init-art! sig-npc ((this sig-npc)) +(defmethod init-art! ((this sig-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this diff --git a/goal_src/jak2/levels/hiphog/whack.gc b/goal_src/jak2/levels/hiphog/whack.gc index 38bfa15c5f2..7a141cec617 100644 --- a/goal_src/jak2/levels/hiphog/whack.gc +++ b/goal_src/jak2/levels/hiphog/whack.gc @@ -697,13 +697,10 @@ ) (deftype hip-mole-event (structure) - ((min-time uint16 :offset 0) - (max-time uint16 :offset 2) - (mode uint8 :offset 4) + ((min-time uint16 :offset 0) + (max-time uint16 :offset 2) + (mode uint8 :offset 4) ) - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) @@ -1427,19 +1424,15 @@ ) (deftype hip-mole (process-drawable) - ((cabinet handle :offset-assert 200) - (index int32 :offset-assert 208) - (mode uint8 :offset-assert 212) - (sound-id sound-id :offset-assert 216) - (abort? symbol :offset-assert 220) + ((cabinet handle) + (index int32) + (mode uint8) + (sound-id sound-id) + (abort? symbol) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xe0 - :flag-assert #x16006000e0 - (:methods - (idle () _type_ :state 20) - (active (time-frame uint) _type_ :state 21) + (:state-methods + idle + (active time-frame uint) ) ) @@ -1652,46 +1645,44 @@ ) (deftype whack-a-metal (process-drawable) - ((cabinet handle :offset-assert 200) - (bopper (pointer process) :offset-assert 208) - (mole (pointer hip-mole) 8 :offset-assert 212) - (score-part sparticle-launch-control 2 :offset-assert 244) - (wave int32 :offset-assert 252) - (event int32 :offset-assert 256) - (event-time time-frame :offset-assert 264) - (event-length time-frame :offset-assert 272) - (hud-score handle :offset-assert 280) - (hud-goal handle :offset-assert 288) - (score float :offset-assert 296) - (score-time time-frame :offset-assert 304) - (dizzy? symbol :offset-assert 312) - (miss-count int32 :offset-assert 316) - (air-attack-count int32 :offset-assert 320) - (slot-buffer int32 4 :offset-assert 324) - (speech-time time-frame :offset-assert 344) - (speech-count int32 :offset-assert 352) - (speech-last int32 4 :offset-assert 356) + ((cabinet handle) + (bopper (pointer process)) + (mole (pointer hip-mole) 8) + (score-part sparticle-launch-control 2) + (wave int32) + (event int32) + (event-time time-frame) + (event-length time-frame) + (hud-score handle) + (hud-goal handle) + (score float) + (score-time time-frame) + (dizzy? symbol) + (miss-count int32) + (air-attack-count int32) + (slot-buffer int32 4) + (speech-time time-frame) + (speech-count int32) + (speech-last int32 4) ) - :heap-base #x100 - :method-count-assert 30 - :size-assert #x174 - :flag-assert #x1e01000174 + (:state-methods + hide + wait-for-start + (active symbol) + (attack int) + lose + win + ) (:methods - (hide () _type_ :state 20) - (wait-for-start () _type_ :state 21) - (active (symbol int) _type_ :state 22) - (attack (int) _type_ :state 23) - (lose () _type_ :state 24) - (win () _type_ :state 25) - (whack-a-metal-method-26 (_type_) integer 26) - (whack-a-metal-method-27 (_type_) none 27) - (whack-a-metal-method-28 (_type_) none 28) - (whack-a-metal-method-29 (_type_ int int) int 29) + (whack-a-metal-method-26 (_type_) integer) + (whack-a-metal-method-27 (_type_) none) + (whack-a-metal-method-28 (_type_) none) + (whack-a-metal-method-29 (_type_ int int) int) ) ) -(defmethod deactivate whack-a-metal ((this whack-a-metal)) +(defmethod deactivate ((this whack-a-metal)) (dotimes (s5-0 2) (if (nonzero? (-> this score-part s5-0)) (kill-and-free-particles (-> this score-part s5-0)) @@ -1701,7 +1692,7 @@ (none) ) -(defmethod relocate whack-a-metal ((this whack-a-metal) (arg0 int)) +(defmethod relocate ((this whack-a-metal) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this score-part v1-0)) (&+! (-> this score-part v1-0) arg0) @@ -1710,7 +1701,7 @@ (call-parent-method this arg0) ) -(defmethod whack-a-metal-method-29 whack-a-metal ((this whack-a-metal) (arg0 int) (arg1 int)) +(defmethod whack-a-metal-method-29 ((this whack-a-metal) (arg0 int) (arg1 int)) (let ((v0-1 (mod (+ (-> this speech-last arg0) (rand-vu-int-range 1 2)) arg1))) (set! (-> this speech-last arg0) v0-1) v0-1 @@ -1718,7 +1709,7 @@ ) ;; WARN: Return type mismatch int vs integer. -(defmethod whack-a-metal-method-26 whack-a-metal ((this whack-a-metal)) +(defmethod whack-a-metal-method-26 ((this whack-a-metal)) (if (or (-> this dizzy?) (>= (-> this miss-count) 20)) (return (the-as integer -1)) ) @@ -1802,7 +1793,7 @@ ) ) -(defmethod whack-a-metal-method-27 whack-a-metal ((this whack-a-metal)) +(defmethod whack-a-metal-method-27 ((this whack-a-metal)) (let ((s4-0 (-> *mole-data* (-> this wave) (-> this event))) (s5-0 #t) ) @@ -1996,7 +1987,7 @@ (none) ) -(defmethod whack-a-metal-method-28 whack-a-metal ((this whack-a-metal)) +(defmethod whack-a-metal-method-28 ((this whack-a-metal)) (cond ((>= (-> *game-info* score) (-> this score)) (set! (-> *game-info* score) (-> this score)) @@ -2050,14 +2041,8 @@ (while (or (not *target*) (not (process-grab? *target* #f))) (suspend) ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) (process->ppointer self)) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'draw) - (set! (-> a1-1 param 0) (the-as uint #f)) - (send-event-function *target* a1-1) - (go-virtual active #t (the-as int a1-1)) - ) + (send-event *target* 'draw #f) + (go-virtual active #t) ) ) @@ -2073,7 +2058,7 @@ ) ) ) - :enter (behavior ((arg0 symbol) (arg1 int)) + :enter (behavior ((arg0 symbol)) (when arg0 (set! (-> *game-info* score) 0.0) (sound-play "whack-start") @@ -2157,7 +2142,7 @@ (pad-buttons up right down left l1 r1 triangle circle x square) ) ) - :code (behavior ((arg0 symbol) (arg1 int)) + :code (behavior ((arg0 symbol)) (local-vars (sv-48 whack-a-metal) (sv-64 (function vector cspace vector)) @@ -2207,13 +2192,13 @@ (set! sv-48 self) (set! sv-64 vector<-cspace!) (set! sv-80 (new 'stack-no-clear 'vector)) - (let ((a1-9 (-> self node-list data (rand-vu-int-range 3 (+ (-> self node-list length) -1))))) - (set! sv-96 (sv-64 sv-80 a1-9)) + (let ((a1-8 (-> self node-list data (rand-vu-int-range 3 (+ (-> self node-list length) -1))))) + (set! sv-96 (sv-64 sv-80 a1-8)) ) (set! sv-112 vector<-cspace!) (set! sv-128 (new 'stack-no-clear 'vector)) - (let* ((a1-11 (-> self node-list data (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (t3-0 (sv-112 sv-128 a1-11)) + (let* ((a1-10 (-> self node-list data (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (t3-0 (sv-112 sv-128 a1-10)) ) ((the-as (function object object object object object object object object none) s5-1) s4-0 @@ -2379,119 +2364,50 @@ ) (set! (-> self dizzy?) #t) (+! (-> self miss-count) 2) - (let* ((a0-18 self) - (t9-7 (method-of-object a0-18 whack-a-metal-method-29)) - (a1-9 (the-as object 2)) - ) - (let ((v1-22 (t9-7 a0-18 (the-as int a1-9) 12))) - (cond - ((zero? v1-22) - (let ((gp-1 talker-spawn-func) - (s5-2 (-> *talker-speech* 418)) - ) - (set! a1-9 *entity-pool*) - (gp-1 s5-2 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 1) - (let ((gp-2 talker-spawn-func) - (s5-3 (-> *talker-speech* 419)) - ) - (set! a1-9 *entity-pool*) - (gp-2 s5-3 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 2) - (let ((gp-3 talker-spawn-func) - (s5-4 (-> *talker-speech* 420)) - ) - (set! a1-9 *entity-pool*) - (gp-3 s5-4 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 3) - (let ((gp-4 talker-spawn-func) - (s5-5 (-> *talker-speech* 421)) - ) - (set! a1-9 *entity-pool*) - (gp-4 s5-5 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 4) - (let ((gp-5 talker-spawn-func) - (s5-6 (-> *talker-speech* 422)) - ) - (set! a1-9 *entity-pool*) - (gp-5 s5-6 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 5) - (let ((gp-6 talker-spawn-func) - (s5-7 (-> *talker-speech* 423)) - ) - (set! a1-9 *entity-pool*) - (gp-6 s5-7 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 6) - (let ((gp-7 talker-spawn-func) - (s5-8 (-> *talker-speech* 424)) - ) - (set! a1-9 *entity-pool*) - (gp-7 s5-8 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 7) - (let ((gp-8 talker-spawn-func) - (s5-9 (-> *talker-speech* 425)) - ) - (set! a1-9 *entity-pool*) - (gp-8 s5-9 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 8) - (let ((gp-9 talker-spawn-func) - (s5-10 (-> *talker-speech* 426)) - ) - (set! a1-9 *entity-pool*) - (gp-9 s5-10 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 9) - (let ((gp-10 talker-spawn-func) - (s5-11 (-> *talker-speech* 427)) - ) - (set! a1-9 *entity-pool*) - (gp-10 s5-11 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 10) - (let ((gp-11 talker-spawn-func) - (s5-12 (-> *talker-speech* 428)) - ) - (set! a1-9 *entity-pool*) - (gp-11 s5-12 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 11) - (let ((gp-12 talker-spawn-func) - (s5-13 (-> *talker-speech* 429)) - ) - (set! a1-9 *entity-pool*) - (gp-12 s5-13 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ) - ) - (dotimes (gp-13 8) - (set! a1-9 (new 'stack-no-clear 'event-message-block)) - (set! (-> (the-as event-message-block a1-9) from) (process->ppointer self)) - (set! (-> (the-as event-message-block a1-9) num-params) 0) - (set! (-> (the-as event-message-block a1-9) message) 'abort) - (send-event-function (ppointer->process (-> self mole gp-13)) (the-as event-message-block a1-9)) + (let ((v1-22 (whack-a-metal-method-29 self 2 12))) + (cond + ((zero? v1-22) + (talker-spawn-func (-> *talker-speech* 418) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 1) + (talker-spawn-func (-> *talker-speech* 419) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 2) + (talker-spawn-func (-> *talker-speech* 420) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 3) + (talker-spawn-func (-> *talker-speech* 421) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 4) + (talker-spawn-func (-> *talker-speech* 422) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 5) + (talker-spawn-func (-> *talker-speech* 423) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 6) + (talker-spawn-func (-> *talker-speech* 424) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 7) + (talker-spawn-func (-> *talker-speech* 425) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 8) + (talker-spawn-func (-> *talker-speech* 426) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 9) + (talker-spawn-func (-> *talker-speech* 427) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 10) + (talker-spawn-func (-> *talker-speech* 428) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 11) + (talker-spawn-func (-> *talker-speech* 429) *entity-pool* (target-pos 0) (the-as region #f)) + ) ) - (go-virtual active #f (the-as int a1-9)) ) + (dotimes (gp-13 8) + (send-event (ppointer->process (-> self mole gp-13)) 'abort) + ) + (go-virtual active #f) ) ((#f) (sound-play "whack-miss") @@ -2561,27 +2477,19 @@ ) arg0 ) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group frames num-frames) -1))) - (set! (-> a0-28 param 1) 1.0) - (let ((t9-13 joint-control-channel-group!) - (a1-9 #f) - ) - (t9-13 a0-28 (the-as art-joint-anim a1-9) num-func-seek!) - (while (not (ja-done? 0)) - (let ((gp-1 (whack-a-metal-method-26 self))) - (when (>= (the-as int gp-1) 0) - (if (>= (ja-aframe-num 0) 12.0) - (go-virtual attack (the-as int gp-1)) - ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (let ((gp-1 (whack-a-metal-method-26 self))) + (when (>= (the-as int gp-1) 0) + (if (>= (ja-aframe-num 0) 12.0) + (go-virtual attack (the-as int gp-1)) ) - ) - (suspend) - (ja-eval) ) - (go-virtual active #f (the-as int a1-9)) ) + (suspend) + (ja-eval) ) + (go-virtual active #f) ) :post (-> (method-of-type whack-a-metal active) post) ) diff --git a/goal_src/jak2/levels/intro/intro-obs.gc b/goal_src/jak2/levels/intro/intro-obs.gc index 00a1500328c..ef53a2f8e94 100644 --- a/goal_src/jak2/levels/intro/intro-obs.gc +++ b/goal_src/jak2/levels/intro/intro-obs.gc @@ -8,26 +8,24 @@ ;; DECOMP BEGINS (deftype intro-flamer (process-drawable) - ((up-dir vector :inline :offset-assert 208) - (average-dir vector :inline :offset-assert 224) - (id int32 :offset-assert 240) - (path-u float :offset-assert 244) - (path-du float :offset-assert 248) - (z-rot float :offset-assert 252) - (flit-prev-offset vector :inline :offset-assert 256) - (flit-next-offset vector :inline :offset-assert 272) - (flit-factor float :offset-assert 288) - (flit-timer uint64 :offset-assert 296) - (flit-interval uint64 :offset-assert 304) + ((up-dir vector :inline) + (average-dir vector :inline) + (id int32) + (path-u float) + (path-du float) + (z-rot float) + (flit-prev-offset vector :inline) + (flit-next-offset vector :inline) + (flit-factor float) + (flit-timer uint64) + (flit-interval uint64) ) - :heap-base #xc0 - :method-count-assert 23 - :size-assert #x138 - :flag-assert #x1700c00138 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (intro-flamer-method-22 (_type_) path-control 22) + (intro-flamer-method-22 (_type_) path-control) ) ) @@ -196,12 +194,12 @@ ) ;; WARN: Return type mismatch object vs path-control. -(defmethod intro-flamer-method-22 intro-flamer ((this intro-flamer)) +(defmethod intro-flamer-method-22 ((this intro-flamer)) (the-as path-control (send-event (ppointer->process (-> this parent)) 'path (-> this id))) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! intro-flamer ((this intro-flamer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this intro-flamer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -254,18 +252,14 @@ This commonly includes things such as: ) (deftype metalhead-spawner (process) - ((path-tbl path-control 19 :offset-assert 128) - (init-pos vector :inline :offset-assert 208) - (average-dir vector :inline :offset-assert 224) + ((path-tbl path-control 19) + (init-pos vector :inline) + (average-dir vector :inline) ) - :heap-base #x70 - :method-count-assert 17 - :size-assert #xf0 - :flag-assert #x11007000f0 - (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (die () _type_ :state 16) + (:state-methods + idle + active + die ) ) @@ -347,7 +341,7 @@ This commonly includes things such as: ) ) -(defmethod relocate metalhead-spawner ((this metalhead-spawner) (arg0 int)) +(defmethod relocate ((this metalhead-spawner) (arg0 int)) (dotimes (v1-0 19) (if (nonzero? (-> this path-tbl v1-0)) (&+! (-> this path-tbl v1-0) arg0) @@ -357,7 +351,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! metalhead-spawner ((this metalhead-spawner) (arg0 entity-actor)) +(defmethod init-from-entity! ((this metalhead-spawner) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -386,12 +380,8 @@ This commonly includes things such as: (deftype vil-windmill-sail (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -417,7 +407,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vil-windmill-sail ((this vil-windmill-sail) (arg0 entity-actor)) +(defmethod init-from-entity! ((this vil-windmill-sail) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/intro/vortex-data.gc b/goal_src/jak2/levels/intro/vortex-data.gc index 2539b7016ff..4df7978bd84 100644 --- a/goal_src/jak2/levels/intro/vortex-data.gc +++ b/goal_src/jak2/levels/intro/vortex-data.gc @@ -8,38 +8,29 @@ ;; DECOMP BEGINS (deftype vortex-vertex (structure) - ((pos vector :inline :offset-assert 0) - (stq vector :inline :offset-assert 16) + ((pos vector :inline) + (stq vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype vortex-vert-array (structure) - ((data vortex-vertex 306 :inline :offset-assert 0) + ((data vortex-vertex 306 :inline) ) - :method-count-assert 9 - :size-assert #x2640 - :flag-assert #x900002640 ) (deftype vortex-work (basic) - ((giftag dma-gif :inline :offset-assert 16) - (off-s-0 uint16 :offset-assert 32) - (off-t-0 uint16 :offset-assert 34) - (off-s-1 uint16 :offset-assert 36) - (off-t-1 uint16 :offset-assert 38) - (off-s-2 uint16 :offset-assert 40) - (off-t-2 uint16 :offset-assert 42) - (off-s-3 uint16 :offset-assert 44) - (off-t-3 uint16 :offset-assert 46) + ((giftag dma-gif :inline) + (off-s-0 uint16) + (off-t-0 uint16) + (off-s-1 uint16) + (off-t-1 uint16) + (off-s-2 uint16) + (off-t-2 uint16) + (off-s-3 uint16) + (off-t-3 uint16) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) diff --git a/goal_src/jak2/levels/mountain/canyon/mincan-obs.gc b/goal_src/jak2/levels/mountain/canyon/mincan-obs.gc index 663c94aaacf..6a106674bec 100644 --- a/goal_src/jak2/levels/mountain/canyon/mincan-obs.gc +++ b/goal_src/jak2/levels/mountain/canyon/mincan-obs.gc @@ -11,10 +11,6 @@ (deftype water-anim-mincan (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) @@ -31,7 +27,7 @@ ) ) -(defmethod init-water! water-anim-mincan ((this water-anim-mincan)) +(defmethod init-water! ((this water-anim-mincan)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((func (method-of-type water-anim init-water!))) (func this) @@ -50,13 +46,9 @@ (deftype mincan-lighthouse-lens (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (erect () _type_ :state 21) + (:state-methods + idle + erect ) ) @@ -104,7 +96,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-lighthouse-lens ((this mincan-lighthouse-lens) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mincan-lighthouse-lens) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -144,13 +136,9 @@ This commonly includes things such as: (deftype mincan-lighthouse (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (erect () _type_ :state 21) + (:state-methods + idle + erect ) ) @@ -199,7 +187,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-lighthouse ((this mincan-lighthouse) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mincan-lighthouse) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -220,13 +208,9 @@ This commonly includes things such as: (deftype mincan-lens (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (closed () _type_ :state 20) - (open () _type_ :state 21) + (:state-methods + closed + open ) ) @@ -275,7 +259,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-lens ((this mincan-lens) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mincan-lens) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -359,12 +343,8 @@ This commonly includes things such as: (deftype mincan-cogs (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -391,7 +371,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-cogs ((this mincan-cogs) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mincan-cogs) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/mountain/mountain-obs.gc b/goal_src/jak2/levels/mountain/mountain-obs.gc index 8bd8a494085..923b7a18e6e 100644 --- a/goal_src/jak2/levels/mountain/mountain-obs.gc +++ b/goal_src/jak2/levels/mountain/mountain-obs.gc @@ -59,14 +59,10 @@ (deftype mtn-dice-button (basebutton) () - :heap-base #xa0 - :method-count-assert 39 - :size-assert #x120 - :flag-assert #x2700a00120 ) -(defmethod basebutton-method-33 mtn-dice-button ((this mtn-dice-button)) +(defmethod basebutton-method-33 ((this mtn-dice-button)) "TODO - joint stuff" (initialize-skeleton this @@ -102,7 +98,7 @@ (none) ) -(defmethod basebutton-method-34 mtn-dice-button ((this mtn-dice-button)) +(defmethod basebutton-method-34 ((this mtn-dice-button)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -126,7 +122,7 @@ (none) ) -(defmethod prepare-trigger-event! mtn-dice-button ((this mtn-dice-button)) +(defmethod prepare-trigger-event! ((this mtn-dice-button)) "Sets `event-going-down` to `'trigger`" (logior! (-> this button-status) (button-status button-status-4)) (logior! (-> this button-status) (button-status pressed)) @@ -278,38 +274,36 @@ ) (deftype mtn-dice (process-drawable) - ((root collide-shape-moving :override) - (incoming-attack-id uint32 :offset-assert 200) - (watervol entity-actor :offset-assert 204) - (face-matrix matrix 6 :inline :offset-assert 208) - (face-matrix-back matrix 6 :inline :offset-assert 592) - (face-status int32 6 :offset-assert 976) - (time-anim float :offset-assert 1000) - (speed-anim float :offset-assert 1004) - (rot-axis vector :inline :offset-assert 1008) - (rot-org vector :inline :offset-assert 1024) - (first uint32 :offset-assert 1040) - (active uint32 :offset-assert 1044) - (free-face uint32 :offset-assert 1048) - (color vector :inline :offset-assert 1056) - (punch-anim symbol :offset-assert 1072) - (first-touch-time time-frame :offset-assert 1080) - (curtime time-frame :offset-assert 1088) - (hint-count float :offset-assert 1096) + ((root collide-shape-moving :override) + (incoming-attack-id uint32) + (watervol entity-actor) + (face-matrix matrix 6 :inline) + (face-matrix-back matrix 6 :inline) + (face-status int32 6) + (time-anim float) + (speed-anim float) + (rot-axis vector :inline) + (rot-org vector :inline) + (first uint32) + (active uint32) + (free-face uint32) + (color vector :inline) + (punch-anim symbol) + (first-touch-time time-frame) + (curtime time-frame) + (hint-count float) ) - :heap-base #x3d0 - :method-count-assert 28 - :size-assert #x44c - :flag-assert #x1c03d0044c + (:state-methods + idle + idle-done + animate + fall + restart + ) (:methods - (idle () _type_ :state 20) - (idle-done () _type_ :state 21) - (animate () _type_ :state 22) - (fall () _type_ :state 23) - (restart () _type_ :state 24) - (mtn-dice-method-25 (_type_ int) none 25) - (mtn-dice-method-26 (_type_ process-focusable touching-shapes-entry) touching-prims-entry 26) - (mtn-dice-method-27 (_type_ collide-shape process-focusable touching-shapes-entry) none 27) + (mtn-dice-method-25 (_type_ int) none) + (mtn-dice-method-26 (_type_ process-focusable touching-shapes-entry) touching-prims-entry) + (mtn-dice-method-27 (_type_ collide-shape process-focusable touching-shapes-entry) none) ) ) @@ -319,7 +313,7 @@ :bounds (static-spherem 0 0 0 100) ) -(defmethod mtn-dice-method-25 mtn-dice ((this mtn-dice) (arg0 int)) +(defmethod mtn-dice-method-25 ((this mtn-dice) (arg0 int)) (let ((s4-0 (-> this face-matrix arg0))) (dotimes (s3-0 6) (let* ((v1-4 (-> this face-matrix s3-0)) @@ -414,7 +408,7 @@ :post transform-post ) -(defmethod mtn-dice-method-26 mtn-dice ((this mtn-dice) (arg0 process-focusable) (arg1 touching-shapes-entry)) +(defmethod mtn-dice-method-26 ((this mtn-dice) (arg0 process-focusable) (arg1 touching-shapes-entry)) (local-vars (sv-96 vector) (sv-112 vector) (sv-128 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -537,7 +531,7 @@ ) ) -(defmethod mtn-dice-method-27 mtn-dice ((this mtn-dice) (arg0 collide-shape) (arg1 process-focusable) (arg2 touching-shapes-entry)) +(defmethod mtn-dice-method-27 ((this mtn-dice) (arg0 collide-shape) (arg1 process-focusable) (arg2 touching-shapes-entry)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -607,11 +601,8 @@ ) (deftype mtn-dice-info (structure) - ((mat float 12 :offset-assert 0) + ((mat float 12) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) @@ -1294,7 +1285,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-dice ((this mtn-dice) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-dice) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1442,10 +1433,6 @@ This commonly includes things such as: (deftype mtn-plat-elevator (elevator) () - :heap-base #xf0 - :method-count-assert 49 - :size-assert #x170 - :flag-assert #x3100f00170 ) @@ -1454,12 +1441,12 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 7) ) -(defmethod get-art-group mtn-plat-elevator ((this mtn-plat-elevator)) +(defmethod get-art-group ((this mtn-plat-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-mtn-plat-elevator" (the-as (pointer uint32) #f)) ) -(defmethod set-ambient-sound! mtn-plat-elevator ((this mtn-plat-elevator)) +(defmethod set-ambient-sound! ((this mtn-plat-elevator)) "Sets the elevator's [[ambient-sound]] up" (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "mtn-elevator-lp" :fo-max 70) (-> this root trans)) @@ -1468,7 +1455,7 @@ This commonly includes things such as: (none) ) -(defmethod move-between-points mtn-plat-elevator ((this mtn-plat-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this mtn-plat-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -1484,7 +1471,7 @@ This commonly includes things such as: ) ) -(defmethod init-plat-collision! mtn-plat-elevator ((this mtn-plat-elevator)) +(defmethod init-plat-collision! ((this mtn-plat-elevator)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1509,16 +1496,12 @@ This commonly includes things such as: ) (deftype mtn-plat-updown (base-plat) - ((sync sync-eased :inline :offset-assert 272) - (path-pos float :offset-assert 316) + ((sync sync-eased :inline) + (path-pos float) ) - :heap-base #xc0 - :method-count-assert 36 - :size-assert #x140 - :flag-assert #x2400c00140 - (:methods - (idle () _type_ :state 34) - (active () _type_ :state 35) + (:state-methods + idle + active ) ) @@ -1555,7 +1538,7 @@ This commonly includes things such as: :post plat-post ) -(defmethod init-plat-collision! mtn-plat-updown ((this mtn-plat-updown)) +(defmethod init-plat-collision! ((this mtn-plat-updown)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1580,7 +1563,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-updown ((this mtn-plat-updown) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-plat-updown) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1647,16 +1630,14 @@ This commonly includes things such as: ) (deftype mtn-plat-eject (process-drawable) - ((dest-pos vector :inline :offset-assert 208) + ((dest-pos vector :inline) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xe0 - :flag-assert #x17006000e0 + (:state-methods + wait + eject + ) (:methods - (wait () _type_ :state 20) - (eject () _type_ :state 21) - (mtn-plat-eject-method-22 (_type_) none 22) + (mtn-plat-eject-method-22 (_type_) none) ) ) @@ -1695,7 +1676,7 @@ This commonly includes things such as: ) ) -(defmethod mtn-plat-eject-method-22 mtn-plat-eject ((this mtn-plat-eject)) +(defmethod mtn-plat-eject-method-22 ((this mtn-plat-eject)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -1718,7 +1699,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-eject ((this mtn-plat-eject) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-plat-eject) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1749,14 +1730,10 @@ This commonly includes things such as: ) (deftype mtn-plat-long (base-plat) - ((sync sync-linear :inline :offset-assert 272) + ((sync sync-linear :inline) ) - :heap-base #xa0 - :method-count-assert 35 - :size-assert #x120 - :flag-assert #x2300a00120 - (:methods - (idle () _type_ :state 34) + (:state-methods + idle ) ) @@ -1789,7 +1766,7 @@ This commonly includes things such as: :post plat-post ) -(defmethod init-plat-collision! mtn-plat-long ((this mtn-plat-long)) +(defmethod init-plat-collision! ((this mtn-plat-long)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1814,7 +1791,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-long ((this mtn-plat-long) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-plat-long) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1853,13 +1830,9 @@ This commonly includes things such as: (deftype mtn-gate (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) + (:state-methods + idle + open ) ) @@ -1912,7 +1885,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-gate ((this mtn-gate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1969,25 +1942,21 @@ This commonly includes things such as: ) (deftype mtn-aval-rocks (process-drawable) - ((art-name symbol :offset-assert 200) - (anim spool-anim :offset-assert 204) - (rock-data vector-array :offset-assert 208) - (loop-id sound-id :offset-assert 212) - (volume float :offset-assert 216) + ((art-name symbol) + (anim spool-anim) + (rock-data vector-array) + (loop-id sound-id) + (volume float) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xdc - :flag-assert #x16006000dc - (:methods - (fall () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + fall + idle ) ) ;; WARN: Return type mismatch process-drawable vs mtn-aval-rocks. -(defmethod relocate mtn-aval-rocks ((this mtn-aval-rocks) (arg0 int)) +(defmethod relocate ((this mtn-aval-rocks) (arg0 int)) (if (nonzero? (-> this rock-data)) (&+! (-> this rock-data) arg0) ) @@ -1995,16 +1964,12 @@ This commonly includes things such as: ) (deftype mtn-aval-rocks-shadow (process-drawable) - ((parent-ptr (pointer mtn-aval-rocks) :offset 16) - (parent-joint int32 :offset-assert 200) - (update-time time-frame :offset-assert 208) + ((parent-ptr (pointer mtn-aval-rocks) :overlay-at parent) + (parent-joint int32) + (update-time time-frame) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15006000d8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -2371,7 +2336,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-aval-rocks ((this mtn-aval-rocks) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-aval-rocks) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2510,21 +2475,19 @@ This commonly includes things such as: ) (deftype mtn-plat-return (base-plat) - ((ride-timer time-frame :offset-assert 272) - (flags mtn-plat-flags :offset-assert 280) - (path-pos float :offset-assert 284) - (dest-pos float :offset-assert 288) - (path-speed float :offset-assert 292) + ((ride-timer time-frame) + (flags mtn-plat-flags) + (path-pos float) + (dest-pos float) + (path-speed float) ) - :heap-base #xb0 - :method-count-assert 38 - :size-assert #x128 - :flag-assert #x2600b00128 + (:state-methods + waiting + running + waiting-for-no-player + ) (:methods - (waiting () _type_ :state 34) - (running () _type_ :state 35) - (waiting-for-no-player () _type_ :state 36) - (mtn-plat-return-method-37 (_type_) none 37) + (mtn-plat-return-method-37 (_type_) none) ) ) @@ -2649,12 +2612,12 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod mtn-plat-return-method-37 mtn-plat-return ((this mtn-plat-return)) +(defmethod mtn-plat-return-method-37 ((this mtn-plat-return)) (go (method-of-object this waiting)) (none) ) -(defmethod init-plat-collision! mtn-plat-return ((this mtn-plat-return)) +(defmethod init-plat-collision! ((this mtn-plat-return)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -2678,7 +2641,7 @@ This commonly includes things such as: (none) ) -(defmethod init-from-entity! mtn-plat-return ((this mtn-plat-return) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-plat-return) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2714,10 +2677,6 @@ This commonly includes things such as: (deftype mtn-plat-gap (mtn-plat-return) () - :heap-base #xb0 - :method-count-assert 38 - :size-assert #x128 - :flag-assert #x2600b00128 ) @@ -2767,17 +2726,13 @@ This commonly includes things such as: ) (deftype mtn-button (process-drawable) - ((on-activate symbol :offset-assert 200) + ((on-activate symbol) ) - :heap-base #x50 - :method-count-assert 24 - :size-assert #xcc - :flag-assert #x18005000cc - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) - (waiting () _type_ :state 22) - (pressed (symbol) _type_ :state 23) + (:state-methods + idle + open + waiting + (pressed symbol) ) ) @@ -2853,7 +2808,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-button ((this mtn-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2914,13 +2869,9 @@ This commonly includes things such as: (deftype mtn-gear-device (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (idle-collapsed () _type_ :state 21) + (:state-methods + idle + idle-collapsed ) ) @@ -2960,7 +2911,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-gear-device ((this mtn-gear-device) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-gear-device) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3106,10 +3057,6 @@ This commonly includes things such as: (deftype water-anim-mountain (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) @@ -3126,7 +3073,7 @@ This commonly includes things such as: ) ) -(defmethod init-water! water-anim-mountain ((this water-anim-mountain)) +(defmethod init-water! ((this water-anim-mountain)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) (t9-0 this) @@ -3145,12 +3092,8 @@ This commonly includes things such as: (deftype trans-plat (mtn-plat-return) () - :heap-base #xb0 - :method-count-assert 39 - :size-assert #x128 - :flag-assert #x2700b00128 - (:methods - (rising () _type_ :state 38) + (:state-methods + rising ) ) @@ -3258,13 +3201,13 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod mtn-plat-return-method-37 trans-plat ((this trans-plat)) +(defmethod mtn-plat-return-method-37 ((this trans-plat)) (go (method-of-object this rising)) (none) ) ;; WARN: Return type mismatch float vs none. -(defmethod init-plat! trans-plat ((this trans-plat)) +(defmethod init-plat! ((this trans-plat)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (logior! (-> this flags) (mtn-plat-flags mtpflags-1)) diff --git a/goal_src/jak2/levels/mountain/mountain-obs2.gc b/goal_src/jak2/levels/mountain/mountain-obs2.gc index 6c429f330bf..8176e0a5164 100644 --- a/goal_src/jak2/levels/mountain/mountain-obs2.gc +++ b/goal_src/jak2/levels/mountain/mountain-obs2.gc @@ -8,15 +8,11 @@ ;; DECOMP BEGINS (deftype mtn-iris-door (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (open () _type_ :state 20) - (close () _type_ :state 21) + (:state-methods + open + close ) ) @@ -65,7 +61,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-iris-door ((this mtn-iris-door) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-iris-door) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -100,22 +96,18 @@ This commonly includes things such as: ) (deftype mtn-plat-shoot (plat) - ((incoming-attack-id uint32 :offset-assert 324) - (angle-flip float :offset-assert 328) - (angle-flip-vel float :offset-assert 332) - (axe-flip vector :inline :offset-assert 336) - (state-flip uint32 :offset-assert 352) - (hit-time time-frame :offset-assert 360) - (time-flip float :offset-assert 368) - (disable-track-under basic :offset-assert 372) - (dest-angle float :offset-assert 376) - (on-shake symbol :offset-assert 380) - (hint-count float :offset-assert 384) + ((incoming-attack-id uint32) + (angle-flip float) + (angle-flip-vel float) + (axe-flip vector :inline) + (state-flip uint32) + (hit-time time-frame) + (time-flip float) + (disable-track-under basic) + (dest-angle float) + (on-shake symbol) + (hint-count float) ) - :heap-base #x110 - :method-count-assert 37 - :size-assert #x184 - :flag-assert #x2501100184 ) @@ -124,12 +116,12 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 5.1) ) -(defmethod get-art-group mtn-plat-shoot ((this mtn-plat-shoot)) +(defmethod get-art-group ((this mtn-plat-shoot)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-mtn-plat-shoot" (the-as (pointer uint32) #f)) ) -(defmethod init-plat-collision! mtn-plat-shoot ((this mtn-plat-shoot)) +(defmethod init-plat-collision! ((this mtn-plat-shoot)) "TODO - collision stuff for setting up the platform" (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) @@ -153,12 +145,12 @@ This commonly includes things such as: (none) ) -(defmethod base-plat-method-32 mtn-plat-shoot ((this mtn-plat-shoot)) +(defmethod base-plat-method-32 ((this mtn-plat-shoot)) 0 (none) ) -(defmethod init-plat! mtn-plat-shoot ((this mtn-plat-shoot)) +(defmethod init-plat! ((this mtn-plat-shoot)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/goal_src/jak2/levels/mountain/mountain-part.gc b/goal_src/jak2/levels/mountain/mountain-part.gc index adfb29a45a9..82287e861bf 100644 --- a/goal_src/jak2/levels/mountain/mountain-part.gc +++ b/goal_src/jak2/levels/mountain/mountain-part.gc @@ -9,10 +9,6 @@ (deftype mountain-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/mountain/mountain-scenes.gc b/goal_src/jak2/levels/mountain/mountain-scenes.gc index 690b102ad6e..2ddab734a53 100644 --- a/goal_src/jak2/levels/mountain/mountain-scenes.gc +++ b/goal_src/jak2/levels/mountain/mountain-scenes.gc @@ -1628,15 +1628,11 @@ ) (deftype mtn-plat-buried-rocks (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (done (symbol) _type_ :state 21) + (:state-methods + idle + (done symbol) ) ) @@ -1692,7 +1688,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-buried-rocks ((this mtn-plat-buried-rocks) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-plat-buried-rocks) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1739,14 +1735,10 @@ This commonly includes things such as: ) (deftype mtn-plat-buried (plat) - ((incoming-attack-id uint32 :offset-assert 324) - (offset float :offset-assert 328) - (options actor-option :offset-assert 336) + ((incoming-attack-id uint32) + (offset float) + (options actor-option) ) - :heap-base #xe0 - :method-count-assert 37 - :size-assert #x158 - :flag-assert #x2500e00158 ) @@ -1755,12 +1747,12 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 4.8) ) -(defmethod get-art-group mtn-plat-buried ((this mtn-plat-buried)) +(defmethod get-art-group ((this mtn-plat-buried)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-mtn-plat-buried" (the-as (pointer uint32) #f)) ) -(defmethod init-plat-collision! mtn-plat-buried ((this mtn-plat-buried)) +(defmethod init-plat-collision! ((this mtn-plat-buried)) "TODO - collision stuff for setting up the platform" (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) @@ -1793,7 +1785,7 @@ This commonly includes things such as: (none) ) -(defmethod plat-path-sync mtn-plat-buried ((this mtn-plat-buried)) +(defmethod plat-path-sync ((this mtn-plat-buried)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @@ -2902,12 +2894,8 @@ otherwise, [[plat::34]] (deftype mtn-lens (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -2919,7 +2907,7 @@ otherwise, [[plat::34]] ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-lens ((this mtn-lens) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-lens) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2940,12 +2928,8 @@ This commonly includes things such as: (deftype mtn-lens-base (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -2957,7 +2941,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-lens-base ((this mtn-lens-base) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-lens-base) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2980,13 +2964,9 @@ This commonly includes things such as: (deftype mtn-lens-floor (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (idle-no-beam () _type_ :state 21) + (:state-methods + idle + idle-no-beam ) ) @@ -3005,7 +2985,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-lens-floor ((this mtn-lens-floor) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-lens-floor) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3046,12 +3026,8 @@ This commonly includes things such as: (deftype mtn-shard (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -3063,7 +3039,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-shard ((this mtn-shard) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-shard) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3084,15 +3060,11 @@ This commonly includes things such as: (deftype mtn-step-plat-rocks-a (mtn-plat-buried-rocks) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-step-plat-rocks-a ((this mtn-step-plat-rocks-a) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-step-plat-rocks-a) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3168,15 +3140,11 @@ This commonly includes things such as: (deftype mtn-step-plat-rocks-b (mtn-plat-buried-rocks) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-step-plat-rocks-b ((this mtn-step-plat-rocks-b) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-step-plat-rocks-b) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3270,15 +3238,11 @@ This commonly includes things such as: (deftype mtn-step-plat-rocks-c (mtn-plat-buried-rocks) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-step-plat-rocks-c ((this mtn-step-plat-rocks-c) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-step-plat-rocks-c) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/mountain/rhino-wall.gc b/goal_src/jak2/levels/mountain/rhino-wall.gc index 7c90c3d904f..3cb3e539f3c 100644 --- a/goal_src/jak2/levels/mountain/rhino-wall.gc +++ b/goal_src/jak2/levels/mountain/rhino-wall.gc @@ -8,19 +8,17 @@ ;; DECOMP BEGINS (deftype rhino-wall (process-focusable) - ((anim spool-anim :offset-assert 204) - (art-name string :offset-assert 208) - (id int8 :offset-assert 212) + ((anim spool-anim) + (art-name string) + (id int8) ) - :heap-base #x60 - :method-count-assert 31 - :size-assert #xd5 - :flag-assert #x1f006000d5 + (:state-methods + unbroken + hit + broken + ) (:methods - (unbroken () _type_ :state 27) - (hit () _type_ :state 28) - (broken () _type_ :state 29) - (rhino-wall-method-30 (_type_) none 30) + (rhino-wall-method-30 (_type_) none) ) ) @@ -36,7 +34,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod rhino-wall-method-30 rhino-wall ((this rhino-wall)) +(defmethod rhino-wall-method-30 ((this rhino-wall)) (let ((v1-1 (-> this root root-prim))) (countdown (a1-0 (-> v1-1 specific 0)) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a1-0))) @@ -131,7 +129,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! rhino-wall ((this rhino-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this rhino-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/mountain/rhino.gc b/goal_src/jak2/levels/mountain/rhino.gc index 68e6e1bba62..b0748e50dae 100644 --- a/goal_src/jak2/levels/mountain/rhino.gc +++ b/goal_src/jak2/levels/mountain/rhino.gc @@ -105,38 +105,36 @@ ) (deftype rhino (nav-enemy) - ((wall rhino-wall :offset-assert 604) - (path-intro path-control :offset-assert 608) - (charge-aware uint64 :offset-assert 616) - (anim-skid-left int32 :offset-assert 624) - (anim-skid-right int32 :offset-assert 628) - (anim-victory-hit int32 :offset-assert 632) - (circle-backward? symbol :offset-assert 636) - (skid-speed float :offset 672) - (angle float :offset-assert 676) - (angle-speed float :offset-assert 680) - (dest vector :inline :offset-assert 688) - (charge-straight symbol :offset-assert 704) - (in-stop-run symbol :offset-assert 708) - (smush-target smush-control :offset-assert 712) - (num-hit-flinch int32 :offset-assert 716) - (frame-die-smush float :offset-assert 720) - (quat quaternion :inline :offset-assert 736) - (can-hit? symbol :offset-assert 752) - (interest int32 :offset-assert 756) - (victory-count uint32 :offset-assert 760) - (stomach-touched-once? symbol :offset-assert 764) + ((wall rhino-wall) + (path-intro path-control) + (charge-aware uint64) + (anim-skid-left int32) + (anim-skid-right int32) + (anim-victory-hit int32) + (circle-backward? symbol) + (skid-speed float :offset 672) + (angle float) + (angle-speed float) + (dest vector :inline) + (charge-straight symbol) + (in-stop-run symbol) + (smush-target smush-control) + (num-hit-flinch int32) + (frame-die-smush float) + (quat quaternion :inline) + (can-hit? symbol) + (interest int32) + (victory-count uint32) + (stomach-touched-once? symbol) ) - :heap-base #x280 - :method-count-assert 183 - :size-assert #x300 - :flag-assert #xb702800300 + (:state-methods + attack + stop-run + run-away + charge + ) (:methods - (attack () _type_ :state 178) - (stop-run () _type_ :state 179) - (run-away () _type_ :state 180) - (charge () _type_ :state 181) - (rhino-method-182 (_type_ process event-message-block) symbol 182) + (rhino-method-182 (_type_ process event-message-block) symbol) ) ) @@ -322,7 +320,7 @@ (set! (-> *rhino-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod rhino-method-182 rhino ((this rhino) (arg0 process) (arg1 event-message-block)) +(defmethod rhino-method-182 ((this rhino) (arg0 process) (arg1 event-message-block)) (let* ((gp-0 (-> arg1 param 0)) (s5-0 arg0) (s2-0 (if (type? s5-0 process-drawable) @@ -357,7 +355,7 @@ ) ) -(defmethod enemy-method-58 rhino ((this rhino) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 ((this rhino) (arg0 process) (arg1 event-message-block)) (let ((t9-0 (method-of-type nav-enemy enemy-method-58))) (t9-0 this arg0 arg1) ) @@ -367,7 +365,7 @@ ) ) -(defmethod general-event-handler rhino ((this rhino) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this rhino) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars @@ -707,7 +705,7 @@ ) ) -(defmethod damage-amount-from-attack rhino ((this rhino) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this rhino) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (-> arg1 param 1) (let ((f30-0 (the float (penetrate-using->damage (the-as penetrate (-> this incoming penetrate-using)))))) @@ -735,7 +733,7 @@ ) ;; WARN: Return type mismatch symbol vs object. -(defmethod enemy-method-75 rhino ((this rhino) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-75 ((this rhino) (arg0 process) (arg1 event-message-block)) (let* ((touch-entry (the-as touching-shapes-entry (-> arg1 param 0))) (s3-0 arg0) (v1-0 (if (type? s3-0 process-focusable) @@ -779,7 +777,7 @@ ) ) -(defmethod enemy-method-104 rhino ((this rhino) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ((this rhino) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (if (and (-> this next-state) (= (-> this next-state name) 'victory)) 'attack-or-shove 'attack @@ -1221,7 +1219,7 @@ :post nav-enemy-travel-post ) -(defmethod nav-enemy-method-142 rhino ((this rhino) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this rhino) (arg0 nav-control)) (if (-> this in-stop-run) (quaternion*! (-> this root quat) @@ -1549,7 +1547,7 @@ ) ) -(defmethod init-enemy-collision! rhino ((this rhino)) +(defmethod init-enemy-collision! ((this rhino)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1621,14 +1619,14 @@ (none) ) -(defmethod relocate rhino ((this rhino) (arg0 int)) +(defmethod relocate ((this rhino) (arg0 int)) (if (nonzero? (-> this path-intro)) (&+! (-> this path-intro) arg0) ) (call-parent-method this arg0) ) -(defmethod init-enemy! rhino ((this rhino)) +(defmethod init-enemy! ((this rhino)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (stack-size-set! (-> this main-thread) 256) (initialize-skeleton diff --git a/goal_src/jak2/levels/nest/boss/metalkor-extras.gc b/goal_src/jak2/levels/nest/boss/metalkor-extras.gc index 9e238aab138..e76299908e0 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-extras.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-extras.gc @@ -275,7 +275,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod init-proj-settings! metalkor-shot ((this metalkor-shot)) +(defmethod init-proj-settings! ((this metalkor-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'metalhead-shot) @@ -287,7 +287,7 @@ (none) ) -(defmethod spawn-shell-particles metalkor-shot ((this metalkor-shot)) +(defmethod spawn-shell-particles ((this metalkor-shot)) "TODO - confirm" (local-vars (sv-224 (function vector entity-actor skeleton-group vector object none :behavior manipy)) @@ -456,7 +456,7 @@ (none) ) -(defmethod get-trans metalkor-legs ((this metalkor-legs) (arg0 int)) +(defmethod get-trans ((this metalkor-legs) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (cond ((or (= arg0 2) (= arg0 3)) @@ -475,7 +475,7 @@ ) ;; WARN: Return type mismatch process-focusable vs metalkor-legs. -(defmethod relocate metalkor-legs ((this metalkor-legs) (arg0 int)) +(defmethod relocate ((this metalkor-legs) (arg0 int)) (dotimes (v1-0 6) (if (nonzero? (-> this joint-ik v1-0)) (&+! (-> this joint-ik v1-0) arg0) @@ -781,7 +781,7 @@ ) ) -(defmethod apply-gravity metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity ((this metalkor-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (local-vars (f0-16 float) (f0-31 float)) (cond ((zero? arg1) @@ -1114,17 +1114,17 @@ (none) ) -(defmethod chain-physics-method-16 metalkor-chain-physics ((this metalkor-chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 ((this metalkor-chain-physics) (arg0 int)) 10922.667 ) -(defmethod chain-physics-method-14 metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 ((this metalkor-chain-physics) (arg0 vector) (arg1 int)) (vector-reset! arg0) 0 (none) ) -(defmethod clamp-length metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) +(defmethod clamp-length ((this metalkor-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) ((method-of-type chain-physics clamp-length) this arg0 arg1 arg2 arg3) (when (< 5 (the-as int arg2)) (let ((a0-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg3 node-list data 3))) @@ -1140,7 +1140,7 @@ ) ) -(defmethod gravity-update metalkor-chain-physics ((this metalkor-chain-physics) (arg0 process-drawable)) +(defmethod gravity-update ((this metalkor-chain-physics) (arg0 process-drawable)) (let ((t9-0 (method-of-type chain-physics gravity-update))) (t9-0 this arg0) ) @@ -1168,7 +1168,7 @@ (none) ) -(defmethod chain-physics-method-17 metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-17 ((this metalkor-chain-physics) (arg0 vector) (arg1 int)) (local-vars (v1-26 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1235,7 +1235,7 @@ ) ;; WARN: Return type mismatch process-focusable vs metalkor-lowtorso. -(defmethod relocate metalkor-lowtorso ((this metalkor-lowtorso) (arg0 int)) +(defmethod relocate ((this metalkor-lowtorso) (arg0 int)) (if (nonzero? (-> this tail)) (&+! (-> this tail) arg0) ) @@ -1448,20 +1448,16 @@ (deftype nestb-formation (hover-formation) () - :heap-base #x10 - :method-count-assert 16 - :size-assert #x90 - :flag-assert #x1000100090 ) -(defmethod hover-formation-method-15 nestb-formation ((this nestb-formation) (arg0 vector) (arg1 vector)) +(defmethod hover-formation-method-15 ((this nestb-formation) (arg0 vector) (arg1 vector)) (logior! (-> this formation flags) 2) 0 ) ;; WARN: Return type mismatch symbol vs none. -(defmethod init-enemy! metalkor-flitter ((this metalkor-flitter)) +(defmethod init-enemy! ((this metalkor-flitter)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1500,7 +1496,7 @@ (none) ) -(defmethod dispose! metalkor-flitter ((this metalkor-flitter)) +(defmethod dispose! ((this metalkor-flitter)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (with-pp (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) @@ -1545,7 +1541,7 @@ ) ) -(defmethod dispose! metalkor-wasp ((this metalkor-wasp)) +(defmethod dispose! ((this metalkor-wasp)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (with-pp (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) @@ -1596,17 +1592,13 @@ ) (deftype rift-ring-ingame (process-drawable) - ((anim-speed delayed-rand-float :inline :offset-assert 200) - (stutter symbol :offset-assert 228) - (spin-sound sound-id :offset-assert 232) - (spin-sound-playing symbol :offset-assert 236) + ((anim-speed delayed-rand-float :inline) + (stutter symbol) + (spin-sound sound-id) + (spin-sound-playing symbol) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xf0 - :flag-assert #x15007000f0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1643,7 +1635,7 @@ ) ) -(defmethod deactivate rift-ring-ingame ((this rift-ring-ingame)) +(defmethod deactivate ((this rift-ring-ingame)) (if (-> this spin-sound-playing) (sound-stop (-> this spin-sound)) ) @@ -1652,7 +1644,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! rift-ring-ingame ((this rift-ring-ingame) (arg0 entity-actor)) +(defmethod init-from-entity! ((this rift-ring-ingame) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1676,7 +1668,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch vector vs none. -(defmethod apply-gravity metalkor-spinner-chain-physics ((this metalkor-spinner-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity ((this metalkor-spinner-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (vector-float*! arg0 (-> this gravity) (-> this gravity-mult)) (vector+float*! arg0 @@ -1687,14 +1679,14 @@ This commonly includes things such as: (none) ) -(defmethod chain-physics-method-14 metalkor-spinner-chain-physics ((this metalkor-spinner-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 ((this metalkor-spinner-chain-physics) (arg0 vector) (arg1 int)) (vector-reset! arg0) 0 (none) ) ;; WARN: Return type mismatch process-drawable vs metalkor-spinner. -(defmethod relocate metalkor-spinner ((this metalkor-spinner) (arg0 int)) +(defmethod relocate ((this metalkor-spinner) (arg0 int)) (if (nonzero? (-> this chain)) (&+! (-> this chain) arg0) ) @@ -1868,13 +1860,9 @@ This commonly includes things such as: (deftype nest-break-precipice (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) @@ -1897,7 +1885,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-break-precipice ((this nest-break-precipice) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nest-break-precipice) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1922,7 +1910,7 @@ This commonly includes things such as: (none) ) -(defmethod draw hud-metalkor ((this hud-metalkor)) +(defmethod draw ((this hud-metalkor)) (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 1)) -62 14) @@ -1958,7 +1946,7 @@ This commonly includes things such as: (none) ) -(defmethod init-callback hud-metalkor ((this hud-metalkor)) +(defmethod init-callback ((this hud-metalkor)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -2065,12 +2053,8 @@ This commonly includes things such as: (deftype metalkor-rays (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -2326,7 +2310,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs metalkor-bomb. -(defmethod relocate metalkor-bomb ((this metalkor-bomb) (arg0 int)) +(defmethod relocate ((this metalkor-bomb) (arg0 int)) (dotimes (v1-0 (min 49 (-> *metalkor-bomb-probe-joints* length))) (when (nonzero? (-> this joint-mods v1-0)) (if (nonzero? (-> this joint-mods v1-0)) diff --git a/goal_src/jak2/levels/nest/boss/metalkor-setup.gc b/goal_src/jak2/levels/nest/boss/metalkor-setup.gc index 0059c3d10f6..3c9bf740409 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-setup.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-setup.gc @@ -83,30 +83,22 @@ ) (deftype metalkor-bomb (process-drawable) - ((root collide-shape-moving :override) - (joint-mods joint-mod 49 :offset-assert 200) + ((root collide-shape-moving :override) + (joint-mods joint-mod 49) ) - :heap-base #x110 - :method-count-assert 21 - :size-assert #x18c - :flag-assert #x150110018c - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype gem-tracker (process) - ((gems handle 10 :offset-assert 128) - (gems-collected int8 :offset-assert 208) - (perm-byte-index int8 :offset-assert 209) + ((gems handle 10) + (gems-collected int8) + (perm-byte-index int8) ) - :heap-base #x60 - :method-count-assert 15 - :size-assert #xd2 - :flag-assert #xf006000d2 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) @@ -183,114 +175,76 @@ (deftype flitter-gem-tracker (gem-tracker) () - :heap-base #x60 - :method-count-assert 15 - :size-assert #xd2 - :flag-assert #xf006000d2 ) (deftype wasp-gem-tracker (gem-tracker) () - :heap-base #x60 - :method-count-assert 15 - :size-assert #xd2 - :flag-assert #xf006000d2 ) (deftype rift-occlude (process-drawable) - ((original-trans vector :inline :offset-assert 208) + ((original-trans vector :inline) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xe0 - :flag-assert #x15006000e0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype metalkor-distort (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype metalkor-explode (process-drawable) - ((ring handle :offset-assert 200) + ((ring handle) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype metalkor-kid (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype nestb-tail-bound (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype metalkor-ja-float-info (structure) - ((float-anim art-joint-anim :offset-assert 0) - (channel-index int8 :offset-assert 4) + ((float-anim art-joint-anim) + (channel-index int8) ) :pack-me - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) (deftype metalkor-spinner-info (structure) - ((joint-index int8 :offset-assert 0) - (launch-angle float :offset-assert 4) + ((joint-index int8) + (launch-angle float) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype metalkor-shot (metalhead-shot) - ((old-transv vector :inline :offset-assert 496) + ((old-transv vector :inline) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x200 - :flag-assert #x2801800200 ) @@ -397,233 +351,192 @@ (deftype metalkor-flitter (flitter) () - :heap-base #x240 - :method-count-assert 184 - :size-assert #x2b8 - :flag-assert #xb8024002b8 ) (deftype metalkor-wasp (wasp) () - :heap-base #x310 - :method-count-assert 166 - :size-assert #x388 - :flag-assert #xa603100388 ) (deftype metalkor-spinner-chain-physics (chain-physics) - ((gravity-mult float :offset-assert 1392) - (velocity-mult float :offset-assert 1396) + ((gravity-mult float) + (velocity-mult float) ) - :method-count-assert 18 - :size-assert #x578 - :flag-assert #x1200000578 ) (deftype metalkor-spinner (process-drawable) - ((parent-joint-index int8 :offset-assert 200) - (target-pos vector :inline :offset-assert 208) - (chain metalkor-spinner-chain-physics :offset-assert 224) - (anim-speed float :offset-assert 228) + ((parent-joint-index int8) + (target-pos vector :inline) + (chain metalkor-spinner-chain-physics) + (anim-speed float) ) - :heap-base #x70 - :method-count-assert 23 - :size-assert #xe8 - :flag-assert #x17007000e8 - (:methods - (break-it () _type_ :state 20) - (idle () _type_ :state 21) - (shoot-out () _type_ :state 22) + (:state-methods + break-it + idle + shoot-out ) ) (deftype metalkor-egg (process-focusable) - ((last-hit-normal vector :inline :offset-assert 208) - (sticky-time time-frame :offset-assert 224) - (flitter-slot int8 :offset-assert 232) + ((last-hit-normal vector :inline) + (sticky-time time-frame) + (flitter-slot int8) ) - :heap-base #x70 - :method-count-assert 31 - :size-assert #xe9 - :flag-assert #x1f007000e9 - (:methods - (egg-pop () _type_ :state 27) - (fall () _type_ :state 28) - (hatch () _type_ :state 29) - (idle () _type_ :state 30) + (:state-methods + egg-pop + fall + hatch + idle ) ) (deftype metalkor-wings (process-drawable) - ((prefix string :offset-assert 200) + ((prefix string) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xcc - :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype metalkor-foot-lock (structure) - ((lock cam-float-seeker :inline :offset-assert 0) - (old-position vector :inline :offset-assert 32) - (initialized symbol :offset-assert 48) + ((lock cam-float-seeker :inline) + (old-position vector :inline) + (initialized symbol) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) (deftype metalkor-legs (process-focusable) - ((prefix string :offset-assert 204) - (trackable symbol :offset-assert 208) - (joint-ik joint-mod-ik 6 :offset-assert 212) - (ja-float-info metalkor-ja-float-info 3 :inline :offset-assert 236) - (foot-locks metalkor-foot-lock 6 :inline :offset 288) + ((prefix string) + (trackable symbol) + (joint-ik joint-mod-ik 6) + (ja-float-info metalkor-ja-float-info 3 :inline) + (foot-locks metalkor-foot-lock 6 :inline :offset 288) ) - :heap-base #x220 - :method-count-assert 28 - :size-assert #x2a0 - :flag-assert #x1c022002a0 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) (deftype metalkor-chain-physics (chain-physics) - ((prev-rotation float :offset-assert 1392) - (prev-y-rotation float :offset-assert 1396) - (osc-z oscillating-float :inline :offset-assert 1400) - (osc-y oscillating-float :inline :offset-assert 1424) - (rand-z delayed-rand-float :inline :offset-assert 1448) - (rand-y delayed-rand-float :inline :offset-assert 1480) - (move-with-parent symbol :offset-assert 1508) + ((prev-rotation float) + (prev-y-rotation float) + (osc-z oscillating-float :inline) + (osc-y oscillating-float :inline) + (rand-z delayed-rand-float :inline) + (rand-y delayed-rand-float :inline) + (move-with-parent symbol) ) - :method-count-assert 18 - :size-assert #x5e8 - :flag-assert #x12000005e8 ) (deftype metalkor-lowtorso (process-focusable) - ((prefix string :offset-assert 204) - (tail metalkor-chain-physics :offset-assert 208) - (tail-initialized symbol :offset-assert 212) - (spinners handle 4 :offset-assert 216) - (ja-float-info metalkor-ja-float-info 3 :inline :offset-assert 248) - (no-collision-timer time-frame :offset 296) - (egg-toss-joint-1 joint-mod :offset-assert 304) - (egg-toss-joint-2 joint-mod :offset-assert 308) - (egg-toss-joint-3 joint-mod :offset-assert 312) - (egg-toss-joint-angle oscillating-float :inline :offset-assert 316) + ((prefix string) + (tail metalkor-chain-physics) + (tail-initialized symbol) + (spinners handle 4) + (ja-float-info metalkor-ja-float-info 3 :inline) + (no-collision-timer time-frame :offset 296) + (egg-toss-joint-1 joint-mod) + (egg-toss-joint-2 joint-mod) + (egg-toss-joint-3 joint-mod) + (egg-toss-joint-angle oscillating-float :inline) ) - :heap-base #xe0 - :method-count-assert 28 - :size-assert #x154 - :flag-assert #x1c00e00154 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) (deftype metalkor (process-focusable) - ((trackable symbol :offset-assert 204) - (flitters handle 10 :offset-assert 208) - (flitter-gem-tracker handle :offset-assert 288) - (wasps handle 3 :offset-assert 296) - (wasp-gem-tracker handle :offset-assert 320) - (last-flitter-launched int8 :offset-assert 328) - (last-wasp-launched int8 :offset-assert 329) - (live-flitters int8 :offset-assert 330) - (live-wasps int8 :offset-assert 331) - (shoot-timer time-frame :offset-assert 336) - (target-angle float :offset-assert 344) - (wave-timer time-frame :offset-assert 352) - (in-wave symbol :offset-assert 360) - (flitter-timer time-frame :offset-assert 368) - (wasp-timer time-frame :offset-assert 376) - (launching-flitters symbol :offset-assert 384) - (launching-wasps symbol :offset-assert 388) - (egg-timer time-frame :offset-assert 392) - (last-close-attack int8 :offset-assert 400) - (last-standing-attack int8 :offset-assert 401) - (stage int8 :offset-assert 402) - (next-stage-timer time-frame :offset-assert 408) - (initial-y float :offset-assert 416) - (shots-fired int16 :offset-assert 420) - (stage-hit-points float :offset-assert 424) - (hud handle :offset-assert 432) - (lowtorso handle :offset-assert 440) - (legs handle :offset-assert 448) - (wings handle :offset-assert 456) - (kid handle :offset-assert 464) - (explode handle :offset-assert 472) - (rift-occlude handle :offset-assert 480) - (last-attack-id uint32 :offset-assert 488) - (current-nav-poly nav-poly :offset-assert 492) - (shot-anticipate sparticle-launch-control :offset-assert 496) - (spinners handle 4 :offset-assert 504) - (neck joint-mod :offset-assert 536) - (previous-flat-travel vector :inline :offset-assert 544) - (previous-flat-travel-timer time-frame :offset-assert 560) - (previous-flat-travel-long-timer time-frame :offset-assert 568) - (min-state-hit-points float :offset-assert 576) - (countdown-to-roar int8 :offset-assert 580) - (for-back-interp cam-float-seeker :inline :offset-assert 584) - (run-walk-interp cam-float-seeker :inline :offset-assert 608) - (left-right-interp cam-float-seeker :inline :offset-assert 632) - (walk-turn-interp cam-float-seeker :inline :offset-assert 656) - (idle-interp cam-float-seeker :inline :offset-assert 680) - (tmp-hit-points float :offset-assert 704) - (reps-till-idle-alt int8 :offset-assert 708) - (last-rotation float :offset-assert 712) - (no-collision-timer time-frame :offset-assert 720) - (egg-angle float :offset 736) - (arm-frame float :offset-assert 740) - (been-to-entity symbol :offset-assert 744) - (flying-speed cam-float-seeker :inline :offset-assert 748) - (wing-sound sound-id :offset-assert 772) - (wing-sound-playing symbol :offset-assert 776) - (explode-sound sound-id :offset-assert 780) - (bomb-sound sound-id :offset-assert 784) - (stop-bomb-sound symbol :offset-assert 788) - (hit-ring-trans vector :inline :offset-assert 800) - (hit-ring-offset vector :inline :offset-assert 816) - (ring-cam-pos cam-float-seeker :inline :offset-assert 832) - (need-teleport symbol :offset-assert 856) + ((trackable symbol) + (flitters handle 10) + (flitter-gem-tracker handle) + (wasps handle 3) + (wasp-gem-tracker handle) + (last-flitter-launched int8) + (last-wasp-launched int8) + (live-flitters int8) + (live-wasps int8) + (shoot-timer time-frame) + (target-angle float) + (wave-timer time-frame) + (in-wave symbol) + (flitter-timer time-frame) + (wasp-timer time-frame) + (launching-flitters symbol) + (launching-wasps symbol) + (egg-timer time-frame) + (last-close-attack int8) + (last-standing-attack int8) + (stage int8) + (next-stage-timer time-frame) + (initial-y float) + (shots-fired int16) + (stage-hit-points float) + (hud handle) + (lowtorso handle) + (legs handle) + (wings handle) + (kid handle) + (explode handle) + (rift-occlude handle) + (last-attack-id uint32) + (current-nav-poly nav-poly) + (shot-anticipate sparticle-launch-control) + (spinners handle 4) + (neck joint-mod) + (previous-flat-travel vector :inline) + (previous-flat-travel-timer time-frame) + (previous-flat-travel-long-timer time-frame) + (min-state-hit-points float) + (countdown-to-roar int8) + (for-back-interp cam-float-seeker :inline) + (run-walk-interp cam-float-seeker :inline) + (left-right-interp cam-float-seeker :inline) + (walk-turn-interp cam-float-seeker :inline) + (idle-interp cam-float-seeker :inline) + (tmp-hit-points float) + (reps-till-idle-alt int8) + (last-rotation float) + (no-collision-timer time-frame) + (egg-angle float :offset 736) + (arm-frame float) + (been-to-entity symbol) + (flying-speed cam-float-seeker :inline) + (wing-sound sound-id) + (wing-sound-playing symbol) + (explode-sound sound-id) + (bomb-sound sound-id) + (stop-bomb-sound symbol) + (hit-ring-trans vector :inline) + (hit-ring-offset vector :inline) + (ring-cam-pos cam-float-seeker :inline) + (need-teleport symbol) ) - :heap-base #x2e0 - :method-count-assert 43 - :size-assert #x35c - :flag-assert #x2b02e0035c - (:methods - (beaten (symbol) _type_ :state 27) - (explode () _type_ :state 28) - (fly-to-ring () _type_ :state 29) - (last-gasp () _type_ :state 30) - (overload-recover () _type_ :state 31) - (fall-down () _type_ :state 32) - (tail-attack () _type_ :state 33) - (foot-attack () _type_ :state 34) - (get-close () _type_ :state 35) - (standing-shot () _type_ :state 36) - (chase-target () _type_ :state 37) - (play-drop-movie () _type_ :state 38) - (start-second-stage () _type_ :state 39) - (hang-shoot-n-launch () _type_ :state 40) - (hidden () _type_ :state 41) - (test () _type_ :state 42) + (:state-methods + (beaten symbol) + explode + fly-to-ring + last-gasp + overload-recover + fall-down + tail-attack + foot-attack + get-close + standing-shot + chase-target + play-drop-movie + start-second-stage + hang-shoot-n-launch + hidden + test ) ) @@ -711,7 +624,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nestb-tail-bound ((this nestb-tail-bound) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nestb-tail-bound) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1090,12 +1003,9 @@ This commonly includes things such as: ) (deftype metalkor-ik-setup (structure) - ((elbow-index int32 :offset-assert 0) - (hand-dist float :offset-assert 4) + ((elbow-index int32) + (hand-dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -1550,7 +1460,7 @@ This commonly includes things such as: (none) ) -(defmethod init-from-entity! metalkor ((this metalkor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this metalkor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/nest/boss/metalkor-states.gc b/goal_src/jak2/levels/nest/boss/metalkor-states.gc index d5e332cd38c..fa2fe0da708 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-states.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-states.gc @@ -294,7 +294,7 @@ (none) ) -(defmethod deactivate metalkor ((this metalkor)) +(defmethod deactivate ((this metalkor)) (if (-> this wing-sound-playing) (sound-stop (-> this wing-sound)) ) @@ -303,7 +303,7 @@ ) ;; WARN: Return type mismatch process-focusable vs metalkor. -(defmethod relocate metalkor ((this metalkor) (arg0 int)) +(defmethod relocate ((this metalkor) (arg0 int)) (if (nonzero? (-> this shot-anticipate)) (&+! (-> this shot-anticipate) arg0) ) @@ -313,7 +313,7 @@ (the-as metalkor ((method-of-type process-focusable relocate) this arg0)) ) -(defmethod get-trans metalkor ((this metalkor) (arg0 int)) +(defmethod get-trans ((this metalkor) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (local-vars (s5-0 vector)) (cond diff --git a/goal_src/jak2/levels/nest/boss/nestb-part.gc b/goal_src/jak2/levels/nest/boss/nestb-part.gc index e9744520648..0a992db8186 100644 --- a/goal_src/jak2/levels/nest/boss/nestb-part.gc +++ b/goal_src/jak2/levels/nest/boss/nestb-part.gc @@ -9,8 +9,4 @@ (deftype nestb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc index 3abe96b8845..e29ad32473c 100644 --- a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc +++ b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc @@ -1608,12 +1608,8 @@ (deftype nest-gun-parts (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1640,7 +1636,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-gun-parts ((this nest-gun-parts) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nest-gun-parts) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1661,12 +1657,8 @@ This commonly includes things such as: (deftype nest-unbroken-rocks (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1693,7 +1685,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-unbroken-rocks ((this nest-unbroken-rocks) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nest-unbroken-rocks) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/nest/flying-spider.gc b/goal_src/jak2/levels/nest/flying-spider.gc index 2079412f8e8..69882641b3f 100644 --- a/goal_src/jak2/levels/nest/flying-spider.gc +++ b/goal_src/jak2/levels/nest/flying-spider.gc @@ -11,15 +11,11 @@ (deftype flying-spider-shot (metalhead-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; WARN: Return type mismatch object vs none. -(defmethod play-impact-sound flying-spider-shot ((this flying-spider-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this flying-spider-shot) (arg0 projectile-options)) (if (zero? arg0) (sound-play "fly-spider-shot") (call-parent-method this arg0) @@ -51,23 +47,21 @@ ) (deftype flying-spider (nav-enemy) - ((my-up-vector vector :inline :offset-assert 608) - (gspot-normal vector :inline :offset-assert 624) - (gspot-timer time-frame :offset-assert 640) - (focus-dir uint16 :offset-assert 648) - (path-u float :offset-assert 652) - (path-du float :offset-assert 656) + ((my-up-vector vector :inline) + (gspot-normal vector :inline) + (gspot-timer time-frame) + (focus-dir uint16) + (path-u float) + (path-du float) ) - :heap-base #x220 - :method-count-assert 183 - :size-assert #x294 - :flag-assert #xb702200294 + (:state-methods + ambush-falling + attack + attack-fire + turn-to-focus + ) (:methods - (ambush-falling () _type_ :state 178) - (attack () _type_ :state 179) - (attack-fire () _type_ :state 180) - (turn-to-focus () _type_ :state 181) - (flying-spider-method-182 (_type_ vector) none 182) + (flying-spider-method-182 (_type_ vector) none) ) ) @@ -534,7 +528,7 @@ :post enemy-simple-post ) -(defmethod general-event-handler flying-spider ((this flying-spider) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this flying-spider) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -601,7 +595,7 @@ ) ) -(defmethod track-target! flying-spider ((this flying-spider)) +(defmethod track-target! ((this flying-spider)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -611,7 +605,7 @@ ) ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod enemy-method-125 flying-spider ((this flying-spider) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 ((this flying-spider) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (the-as pat-surface (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) @@ -656,7 +650,7 @@ ) ) -(defmethod flying-spider-method-182 flying-spider ((this flying-spider) (arg0 vector)) +(defmethod flying-spider-method-182 ((this flying-spider) (arg0 vector)) (cond ((= (-> this root gspot-pos y) -40959590.0) (set! (-> arg0 y) 0.0) @@ -686,7 +680,7 @@ (none) ) -(defmethod nav-enemy-method-142 flying-spider ((this flying-spider) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this flying-spider) (arg0 nav-control)) (let ((t9-0 (method-of-object this flying-spider-method-182)) (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) @@ -698,7 +692,7 @@ (none) ) -(defmethod look-at-target! flying-spider ((this flying-spider) (arg0 enemy-flag)) +(defmethod look-at-target! ((this flying-spider) (arg0 enemy-flag)) "Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available @param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details" 0 @@ -706,23 +700,23 @@ ) ;; WARN: Return type mismatch int vs penetrate. -(defmethod get-penetrate-info flying-spider ((this flying-spider)) +(defmethod get-penetrate-info ((this flying-spider)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (the-as penetrate 0) ) -(defmethod enemy-method-51 flying-spider ((this flying-spider)) +(defmethod enemy-method-51 ((this flying-spider)) (quaternion-y-angle (-> this root quat)) ) -(defmethod coin-flip? flying-spider ((this flying-spider)) +(defmethod coin-flip? ((this flying-spider)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! flying-spider ((this flying-spider)) +(defmethod init-enemy-collision! ((this flying-spider)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -785,7 +779,7 @@ (none) ) -(defmethod init-enemy! flying-spider ((this flying-spider)) +(defmethod init-enemy! ((this flying-spider)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/nest/mammoth.gc b/goal_src/jak2/levels/nest/mammoth.gc index 5268848096c..5af7829dcaa 100644 --- a/goal_src/jak2/levels/nest/mammoth.gc +++ b/goal_src/jak2/levels/nest/mammoth.gc @@ -8,49 +8,47 @@ ;; DECOMP BEGINS (deftype mammoth (nav-enemy) - ((joint-ik joint-mod-ik 4 :offset-assert 604) - (ik-handle-pos vector 4 :inline :offset-assert 624) - (ik-handle-y float 4 :offset-assert 688) - (heel-lerp float 4 :offset-assert 704) - (foot-flags uint16 :offset-assert 720) - (old-foot-flags uint16 :offset-assert 722) - (y-level float :offset-assert 724) - (foot-pos vector 4 :inline :offset-assert 736) - (my-up-vector vector :inline :offset-assert 800) - (my-up-quat quaternion :inline :offset-assert 816) - (move-pos vector 2 :inline :offset-assert 832) - (travel-dest vector :inline :offset-assert 864) - (tilt-quat quaternion :inline :offset-assert 880) - (path-index int32 :offset-assert 896) - (path-index-dir int32 :offset-assert 900) - (path-pos float :offset-assert 904) - (turn-angle float :offset-assert 908) - (gspot-timer time-frame :offset-assert 912) - (gspot-normal vector :inline :offset-assert 928) - (attack-timer time-frame :offset-assert 944) - (lightning-timer time-frame :offset-assert 952) - (lightning-attack-timer time-frame :offset-assert 960) - (spawn-timer time-frame :offset-assert 968) - (turn-anim-start int32 :offset-assert 976) - (turn-anim int32 :offset-assert 980) - (turn-anim-end int32 :offset-assert 984) - (turn-move-start float :offset-assert 988) - (turn-move-end float :offset-assert 992) - (feet-ik-init-timer time-frame :offset-assert 1000) + ((joint-ik joint-mod-ik 4) + (ik-handle-pos vector 4 :inline) + (ik-handle-y float 4) + (heel-lerp float 4) + (foot-flags uint16) + (old-foot-flags uint16) + (y-level float) + (foot-pos vector 4 :inline) + (my-up-vector vector :inline) + (my-up-quat quaternion :inline) + (move-pos vector 2 :inline) + (travel-dest vector :inline) + (tilt-quat quaternion :inline) + (path-index int32) + (path-index-dir int32) + (path-pos float) + (turn-angle float) + (gspot-timer time-frame) + (gspot-normal vector :inline) + (attack-timer time-frame) + (lightning-timer time-frame) + (lightning-attack-timer time-frame) + (spawn-timer time-frame) + (turn-anim-start int32) + (turn-anim int32) + (turn-anim-end int32) + (turn-move-start float) + (turn-move-end float) + (feet-ik-init-timer time-frame) ) - :heap-base #x370 - :method-count-assert 186 - :size-assert #x3f0 - :flag-assert #xba037003f0 + (:state-methods + waiting + wait-to-walk + walking + walking-attack + turning + ) (:methods - (waiting () _type_ :state 178) - (wait-to-walk () _type_ :state 179) - (walking () _type_ :state 180) - (walking-attack () _type_ :state 181) - (turning () _type_ :state 182) - (mammoth-method-183 (_type_) none 183) - (mammoth-method-184 (_type_) none 184) - (mammoth-method-185 (_type_ vector int) none 185) + (mammoth-method-183 (_type_) none) + (mammoth-method-184 (_type_) none) + (mammoth-method-185 (_type_ vector int) none) ) ) @@ -172,14 +170,11 @@ (define *mammoth-lightning-joint-tbl* (new 'static 'boxed-array :type int32 50 51 52 53 54 55)) (deftype mammoth-ik-setup (structure) - ((elbow-index int32 :offset-assert 0) - (hand-dist float :offset-assert 4) - (ground-dist float :offset-assert 8) - (foot-flag uint16 :offset-assert 12) + ((elbow-index int32) + (hand-dist float) + (ground-dist float) + (foot-flag uint16) ) - :method-count-assert 9 - :size-assert #xe - :flag-assert #x90000000e ) @@ -686,7 +681,7 @@ :post mammoth-walk-post ) -(defmethod general-event-handler mammoth ((this mammoth) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this mammoth) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -711,7 +706,7 @@ ) ) -(defmethod mammoth-method-185 mammoth ((this mammoth) (arg0 vector) (arg1 int)) +(defmethod mammoth-method-185 ((this mammoth) (arg0 vector) (arg1 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -781,22 +776,22 @@ ) ) -(defmethod go-stare mammoth ((this mammoth)) +(defmethod go-stare ((this mammoth)) (go (method-of-object this walking)) ) -(defmethod go-hostile mammoth ((this mammoth)) +(defmethod go-hostile ((this mammoth)) (go (method-of-object this walking)) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle mammoth ((this mammoth)) +(defmethod go-idle ((this mammoth)) (go (method-of-object this waiting)) (none) ) ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod enemy-method-125 mammoth ((this mammoth) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 ((this mammoth) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (the-as pat-surface (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) @@ -848,7 +843,7 @@ ) ) -(defmethod mammoth-method-183 mammoth ((this mammoth)) +(defmethod mammoth-method-183 ((this mammoth)) (cond ((= (-> this root gspot-pos y) -40959590.0) (quaternion-copy! (-> this tilt-quat) *unity-quaternion*) @@ -1215,7 +1210,7 @@ ) ) -(defmethod mammoth-method-184 mammoth ((this mammoth)) +(defmethod mammoth-method-184 ((this mammoth)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1336,7 +1331,7 @@ ) ) -(defmethod track-target! mammoth ((this mammoth)) +(defmethod track-target! ((this mammoth)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1485,12 +1480,12 @@ (none) ) -(defmethod coin-flip? mammoth ((this mammoth)) +(defmethod coin-flip? ((this mammoth)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod relocate mammoth ((this mammoth) (arg0 int)) +(defmethod relocate ((this mammoth) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this joint-ik v1-0)) (&+! (-> this joint-ik v1-0) arg0) @@ -1499,7 +1494,7 @@ (call-parent-method this arg0) ) -(defmethod init-enemy-collision! mammoth ((this mammoth)) +(defmethod init-enemy-collision! ((this mammoth)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1594,7 +1589,7 @@ (none) ) -(defmethod init-enemy! mammoth ((this mammoth)) +(defmethod init-enemy! ((this mammoth)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/nest/mantis.gc b/goal_src/jak2/levels/nest/mantis.gc index 802d1619400..f661bd214a1 100644 --- a/goal_src/jak2/levels/nest/mantis.gc +++ b/goal_src/jak2/levels/nest/mantis.gc @@ -230,52 +230,47 @@ ) (deftype mantis-jump-info (structure) - ((distance float :offset-assert 0) - (search-step uint32 :offset-assert 4) - (destination vector :inline :offset-assert 16) - (direction uint16 :offset-assert 32) - (start-anim uint32 :offset-assert 36) - (air-anim uint32 :offset-assert 40) - (land-anim uint32 :offset-assert 44) + ((distance float) + (search-step uint32) + (destination vector :inline) + (direction uint16) + (start-anim uint32) + (air-anim uint32) + (land-anim uint32) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) (deftype mantis (nav-enemy) - ((base-height float :offset-assert 604) - (flags mantis-flag :offset-assert 608) - (attack-timer time-frame :offset-assert 616) - (track-timer time-frame :offset-assert 624) - (gspot-timer time-frame :offset-assert 632) - (gspot-normal vector :inline :offset-assert 640) - (my-up-vector vector :inline :offset-assert 656) - (jump mantis-jump-info :inline :offset-assert 672) + ((base-height float) + (flags mantis-flag) + (attack-timer time-frame) + (track-timer time-frame) + (gspot-timer time-frame) + (gspot-normal vector :inline) + (my-up-vector vector :inline) + (jump mantis-jump-info :inline) ) - :heap-base #x250 - :method-count-assert 195 - :size-assert #x2d0 - :flag-assert #xc3025002d0 + (:state-methods + crawl + attack0 + attack1 + ambush-crawling + ambush-jumping + mantis-state-183 + roll-right + roll-left + hop-away + ) (:methods - (crawl () _type_ :state 178) - (attack0 () _type_ :state 179) - (attack1 () _type_ :state 180) - (ambush-crawling () _type_ :state 181) - (ambush-jumping () _type_ :state 182) - (mantis-method-183 () none 183) - (roll-right () _type_ :state 184) - (roll-left () _type_ :state 185) - (hop-away () _type_ :state 186) - (mantis-method-187 (_type_) none 187) - (mantis-method-188 (_type_) none 188) - (mantis-method-189 (_type_ vector vector) symbol 189) - (mantis-method-190 (_type_ vector vector) none 190) - (mantis-method-191 (_type_ vector vector) int 191) - (mantis-method-192 (_type_ vector vector) none 192) - (mantis-method-193 (_type_ vector) none 193) - (mantis-method-194 (_type_) symbol 194) + (mantis-method-187 (_type_) none) + (mantis-method-188 (_type_) none) + (mantis-method-189 (_type_ vector vector) symbol) + (mantis-method-190 (_type_ vector vector) none) + (mantis-method-191 (_type_ vector vector) int) + (mantis-method-192 (_type_ vector vector) none) + (mantis-method-193 (_type_ vector) none) + (mantis-method-194 (_type_) symbol) ) ) @@ -1189,7 +1184,7 @@ :post nav-enemy-face-focus-post ) -(defmethod general-event-handler mantis ((this mantis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this mantis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -1261,7 +1256,7 @@ ) ) -(defmethod enemy-method-77 mantis ((this mantis) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this mantis) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.02)) @@ -1292,7 +1287,7 @@ ) ) -(defmethod enemy-method-78 mantis ((this mantis) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this mantis) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.1)) @@ -1338,7 +1333,7 @@ ) ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod enemy-method-125 mantis ((this mantis) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 ((this mantis) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (the-as pat-surface (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) @@ -1384,7 +1379,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod mantis-method-194 mantis ((this mantis)) +(defmethod mantis-method-194 ((this mantis)) (let ((a0-2 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 1)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -1396,7 +1391,7 @@ ) ) -(defmethod mantis-method-193 mantis ((this mantis) (arg0 vector)) +(defmethod mantis-method-193 ((this mantis) (arg0 vector)) (cond ((= (-> this root gspot-pos y) -40959590.0) (set! (-> arg0 y) 0.0) @@ -1425,7 +1420,7 @@ (none) ) -(defmethod nav-enemy-method-142 mantis ((this mantis) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this mantis) (arg0 nav-control)) (let ((t9-0 (method-of-object this mantis-method-193)) (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) @@ -1438,7 +1433,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod track-target! mantis ((this mantis)) +(defmethod track-target! ((this mantis)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1460,7 +1455,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod mantis-method-187 mantis ((this mantis)) +(defmethod mantis-method-187 ((this mantis)) (let ((s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s4-0 (-> this root)) (s5-0 (lambda ((arg0 mantis) (arg1 collide-shape-moving) (arg2 vector)) @@ -1523,7 +1518,7 @@ (none) ) -(defmethod mantis-method-188 mantis ((this mantis)) +(defmethod mantis-method-188 ((this mantis)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1560,7 +1555,7 @@ ) ) -(defmethod go-stare mantis ((this mantis)) +(defmethod go-stare ((this mantis)) (let ((a0-2 (handle->process (-> this focus handle)))) (if (and a0-2 (and (< 81920.0 (vector-vector-xz-distance (-> this root trans) (get-trans (the-as process-focusable a0-2) 0))) @@ -1573,7 +1568,7 @@ (go (method-of-object this hop-away)) ) -(defmethod mantis-method-190 mantis ((this mantis) (arg0 vector) (arg1 vector)) +(defmethod mantis-method-190 ((this mantis) (arg0 vector) (arg1 vector)) (let ((s5-0 (-> this jump))) (let* ((f0-0 (vector-length arg1)) (f0-1 (if (< 102400.0 f0-0) @@ -1597,7 +1592,7 @@ (none) ) -(defmethod mantis-method-191 mantis ((this mantis) (arg0 vector) (arg1 vector)) +(defmethod mantis-method-191 ((this mantis) (arg0 vector) (arg1 vector)) (let ((s5-0 (-> this jump))) (vector-length arg1) (vector-normalize! arg1 1.0) @@ -1619,7 +1614,7 @@ 0 ) -(defmethod mantis-method-192 mantis ((this mantis) (arg0 vector) (arg1 vector)) +(defmethod mantis-method-192 ((this mantis) (arg0 vector) (arg1 vector)) (let ((s5-0 (-> this jump))) (vector-length arg1) (vector-normalize! arg1 1.0) @@ -1642,7 +1637,7 @@ (none) ) -(defmethod mantis-method-189 mantis ((this mantis) (arg0 vector) (arg1 vector)) +(defmethod mantis-method-189 ((this mantis) (arg0 vector) (arg1 vector)) (let* ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0)) (f30-0 (vector-length arg1)) (f28-0 3640.889) @@ -1711,7 +1706,7 @@ ) ) -(defmethod enemy-method-89 mantis ((this mantis) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this mantis) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump start-anim))) (a0-4 (-> this skel root-channel 0)) @@ -1725,7 +1720,7 @@ #t ) -(defmethod enemy-method-87 mantis ((this mantis) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this mantis) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump air-anim))) (a0-4 (-> this skel root-channel 0)) @@ -1740,7 +1735,7 @@ ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod enemy-method-92 mantis ((this mantis) (arg0 int) (arg1 nav-poly)) +(defmethod enemy-method-92 ((this mantis) (arg0 int) (arg1 nav-poly)) "TODO - nav-poly is a guess @abstract" (let ((v1-0 arg0)) @@ -1773,7 +1768,7 @@ (none) ) -(defmethod enemy-method-88 mantis ((this mantis) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this mantis) (arg0 enemy-jump-info)) (cond ((zero? (-> this jump land-anim)) #f @@ -1794,13 +1789,13 @@ ) ) -(defmethod coin-flip? mantis ((this mantis)) +(defmethod coin-flip? ((this mantis)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! mantis ((this mantis)) +(defmethod init-enemy-collision! ((this mantis)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1903,7 +1898,7 @@ (none) ) -(defmethod init-enemy! mantis ((this mantis)) +(defmethod init-enemy! ((this mantis)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/nest/nest-obs.gc b/goal_src/jak2/levels/nest/nest-obs.gc index 87cef9c0d5f..6c904eecdc7 100644 --- a/goal_src/jak2/levels/nest/nest-obs.gc +++ b/goal_src/jak2/levels/nest/nest-obs.gc @@ -8,19 +8,15 @@ ;; DECOMP BEGINS (deftype nest-switch (process-drawable) - ((set-camera symbol :offset-assert 200) - (notify-actor entity-actor :offset-assert 204) - (y-start float :offset-assert 208) - (y-delta float :offset-assert 212) - (y-rot-rate float :offset-assert 216) + ((set-camera symbol) + (notify-actor entity-actor) + (y-start float) + (y-delta float) + (y-rot-rate float) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xdc - :flag-assert #x16006000dc - (:methods - (up () _type_ :state 20) - (down () _type_ :state 21) + (:state-methods + up + down ) ) @@ -120,7 +116,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-switch ((this nest-switch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nest-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -177,16 +173,12 @@ This commonly includes things such as: ) (deftype nest-piston (process-drawable) - ((y-level float :offset-assert 200) - (y-offset float :offset-assert 204) + ((y-level float) + (y-offset float) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (up () _type_ :state 21) + (:state-methods + idle + up ) ) @@ -229,7 +221,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-piston ((this nest-piston) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nest-piston) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/nest/nest-part.gc b/goal_src/jak2/levels/nest/nest-part.gc index 4b7389fe5d4..a4bb7953cc1 100644 --- a/goal_src/jak2/levels/nest/nest-part.gc +++ b/goal_src/jak2/levels/nest/nest-part.gc @@ -9,10 +9,6 @@ (deftype nest-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/nest/nest-scenes.gc b/goal_src/jak2/levels/nest/nest-scenes.gc index 924e84e7e9e..a05acad5bae 100644 --- a/goal_src/jak2/levels/nest/nest-scenes.gc +++ b/goal_src/jak2/levels/nest/nest-scenes.gc @@ -63,14 +63,10 @@ ) (deftype canyon-lightning-thingy (process-drawable) - ((lightning lightning-control 5 :offset-assert 200) + ((lightning lightning-control 5) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xdc - :flag-assert #x15006000dc - (:methods - (zap () _type_ :state 20) + (:state-methods + zap ) ) @@ -169,7 +165,7 @@ ) ;; WARN: Return type mismatch process-drawable vs canyon-lightning-thingy. -(defmethod relocate canyon-lightning-thingy ((this canyon-lightning-thingy) (arg0 int)) +(defmethod relocate ((this canyon-lightning-thingy) (arg0 int)) (dotimes (index 5) (if (nonzero? (-> this lightning index)) (&+! (-> this lightning index) arg0) diff --git a/goal_src/jak2/levels/palace/boss/squid-extras.gc b/goal_src/jak2/levels/palace/boss/squid-extras.gc index bf350a628c8..4fdadfd720e 100644 --- a/goal_src/jak2/levels/palace/boss/squid-extras.gc +++ b/goal_src/jak2/levels/palace/boss/squid-extras.gc @@ -209,14 +209,14 @@ ) ) -(defmethod play-impact-sound! squid-grenade ((this squid-grenade)) +(defmethod play-impact-sound! ((this squid-grenade)) "Plays impact sound" (ja-post) 0 (none) ) -(defmethod init-proj-collision! squid-grenade ((this squid-grenade)) +(defmethod init-proj-collision! ((this squid-grenade)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -286,7 +286,7 @@ (none) ) -(defmethod init-proj-settings! squid-grenade ((this squid-grenade)) +(defmethod init-proj-settings! ((this squid-grenade)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1120) this)) (set! (-> this attack-mode) 'squid-grenade) @@ -416,7 +416,7 @@ :code sleep-code ) -(defmethod deactivate squid-whirlwind ((this squid-whirlwind)) +(defmethod deactivate ((this squid-whirlwind)) (if (-> this whirl-sound-playing) (sound-stop (-> this whirl-sound)) ) @@ -455,7 +455,7 @@ (none) ) -(defmethod draw hud-squid ((this hud-squid)) +(defmethod draw ((this hud-squid)) (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) -96 0) @@ -502,7 +502,7 @@ (none) ) -(defmethod init-callback hud-squid ((this hud-squid)) +(defmethod init-callback ((this hud-squid)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/goal_src/jak2/levels/palace/boss/squid-setup.gc b/goal_src/jak2/levels/palace/boss/squid-setup.gc index 4902ca1c1f6..7fb04feafd8 100644 --- a/goal_src/jak2/levels/palace/boss/squid-setup.gc +++ b/goal_src/jak2/levels/palace/boss/squid-setup.gc @@ -14,233 +14,203 @@ ;; DECOMP BEGINS (deftype squid-whirlwind (process-drawable) - ((center vector :inline :offset-assert 208) - (center-vel vector :inline :offset-assert 224) - (current-nav-poly nav-poly :offset-assert 240) - (duration time-frame :offset-assert 248) - (whirl-sound sound-id :offset-assert 256) - (whirl-sound-playing symbol :offset-assert 260) + ((center vector :inline) + (center-vel vector :inline) + (current-nav-poly nav-poly) + (duration time-frame) + (whirl-sound sound-id) + (whirl-sound-playing symbol) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x108 - :flag-assert #x1500900108 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype squid-collision (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype squid-driver (process-drawable) - ((prefix string :offset-assert 200) - (run-free symbol :offset-assert 204) + ((prefix string) + (run-free symbol) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype squid-baron (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype squid-tentacle-chain (structure) - ((position vector :inline :offset-assert 0) - (velocity vector :inline :offset-assert 16) - (old-x vector :inline :offset-assert 32) - (joint-mod joint-mod :offset-assert 48) + ((position vector :inline) + (velocity vector :inline) + (old-x vector :inline) + (joint-mod joint-mod) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) (deftype squid-tentacle (process-drawable) - ((root collide-shape-moving :override) - (chain-joints squid-tentacle-chain 11 :inline :offset-assert 208) - (gravity vector :inline :offset-assert 912) - (gravity-target vector :inline :offset-assert 928) - (stretch-vel float :offset-assert 944) - (center vector :inline :offset-assert 960) - (avoid-center symbol :offset-assert 976) - (wrap symbol :offset-assert 980) - (num-bg-collisions int32 :offset-assert 984) - (max-movement float :offset-assert 988) + ((root collide-shape-moving :override) + (chain-joints squid-tentacle-chain 11 :inline) + (gravity vector :inline) + (gravity-target vector :inline) + (stretch-vel float) + (center vector :inline) + (avoid-center symbol) + (wrap symbol) + (num-bg-collisions int32) + (max-movement float) ) - :heap-base #x360 - :method-count-assert 24 - :size-assert #x3e0 - :flag-assert #x18036003e0 + (:state-methods + test + idle + ) (:methods - (test () _type_ :state 20) - (idle () _type_ :state 21) - (joint-setup (_type_) none 22) - (squid-tentacle-method-23 (_type_) none 23) + (joint-setup (_type_) none) + (squid-tentacle-method-23 (_type_) none) ) ) (deftype squid-grenade-holder (structure) - ((target-position vector :inline :offset-assert 0) - (show-it symbol :offset-assert 16) - (grenade handle :offset-assert 24) - (marker handle :offset-assert 32) + ((target-position vector :inline) + (show-it symbol) + (grenade handle) + (marker handle) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) (deftype squid-grenade (projectile) - ((traj trajectory :inline :offset-assert 480) - (traj-dest vector :inline :offset-assert 528) - (traj-timer time-frame :offset-assert 544) - (traj-duration float :offset-assert 552) - (fly-sound sound-id :offset-assert 556) + ((traj trajectory :inline) + (traj-dest vector :inline) + (traj-timer time-frame) + (traj-duration float) + (fly-sound sound-id) ) - :heap-base #x1b0 - :method-count-assert 40 - :size-assert #x230 - :flag-assert #x2801b00230 ) (deftype squid (process-focusable) - ((quat quaternion :inline :offset-assert 208) - (trans vector :inline :offset-assert 224) - (residual-velocity vector :inline :offset-assert 240) - (residual-accumulator-1 float :offset-assert 256) - (residual-accumulator-2 float :offset-assert 260) - (force-onto-mesh symbol :offset-assert 264) - (mesh-forced symbol :offset-assert 268) - (hit-reaction oscillating-vector :inline :offset-assert 272) - (traj trajectory :inline :offset-assert 336) - (traj-src vector :inline :offset-assert 384) - (traj-dest vector :inline :offset-assert 400) - (traj-timer time-frame :offset-assert 416) - (traj-duration float :offset-assert 424) - (current-nav-poly nav-poly :offset-assert 428) - (tentacles handle 6 :offset-assert 432) - (baron squid-baron :offset-assert 480) - (driver (pointer squid-driver) :offset-assert 484) - (driver-blend cam-float-seeker :inline :offset-assert 488) - (blink-time time-frame :offset-assert 512) - (blink-mask int32 :offset-assert 520) - (thruster-part sparticle-launch-control :offset-assert 524) - (gun-tilt-left-jm joint-mod :offset-assert 528) - (gun-tilt-right-jm joint-mod :offset-assert 532) - (gun-tilt float :offset-assert 536) - (next-gun int8 :offset-assert 540) - (fire-aft symbol :offset-assert 544) - (gun-high-to-low symbol :offset-assert 548) - (grenade squid-grenade-holder 10 :inline :offset-assert 560) - (first-path path-control :offset-assert 1040) - (second-path path-control :offset-assert 1044) - (third-path path-control :offset-assert 1048) - (shield-timer time-frame :offset-assert 1056) - (shield-color vector :inline :offset-assert 1072) - (shield-shattered symbol :offset-assert 1088) - (shield-hit-points float :offset-assert 1092) - (hit-points int32 :offset-assert 1096) - (invincible-timer time-frame :offset-assert 1104) - (stage int32 :offset-assert 1112) - (collision-actor (pointer squid-collision) :offset-assert 1116) - (tentacle-base-jm joint-mod :offset-assert 1120) - (tentacle-base-rotation float :offset-assert 1124) - (tentacle-base-rotation-speed cam-float-seeker :inline :offset-assert 1128) - (stage-2-go-status int32 :offset-assert 1152) - (gate-intact symbol :offset-assert 1156) - (hud handle :offset-assert 1160) - (desired-rotate-to-vector-angle degrees :offset-assert 1168) - (allowed-rotate-to-vector-angle degrees :offset-assert 1172) - (stop-shooting symbol :offset-assert 1176) - (attack-id uint32 :offset-assert 1180) - (rush-sound sound-id :offset-assert 1184) - (rush-sound-playing symbol :offset-assert 1188) - (rush-end-time time-frame :offset-assert 1192) - (jet-sound sound-id :offset-assert 1200) - (jet-sound-playing symbol :offset-assert 1204) - (jet-pitch int64 :offset-assert 1208) - (negate-jet-pitch symbol :offset-assert 1216) - (jet-volume int64 :offset-assert 1224) - (can-play-squid-boost symbol :offset-assert 1232) - (tentacle-sound sound-id :offset-assert 1236) - (tentacle-sound-playing symbol :offset-assert 1240) - (spin-sound sound-id :offset-assert 1244) - (spin-sound-playing symbol :offset-assert 1248) - (reload-played symbol :offset-assert 1252) - (max-plane int32 :offset-assert 1256) - (debug-timer time-frame :offset-assert 1264) - (debug-on symbol :offset-assert 1272) - (last-damaged-talker int8 :offset-assert 1276) - (last-shield-hit-talker int8 :offset-assert 1277) - (last-no-energy-talker int8 :offset-assert 1278) - (last-shooting-talker int8 :offset-assert 1279) - (last-headbutting-talker int8 :offset-assert 1280) - (last-general-talker int8 :offset-assert 1281) - (last-start-recharging-talker int8 :offset-assert 1282) - (last-done-recharging-talker int8 :offset-assert 1283) - (suck float :offset-assert 1284) + ((quat quaternion :inline) + (trans vector :inline) + (residual-velocity vector :inline) + (residual-accumulator-1 float) + (residual-accumulator-2 float) + (force-onto-mesh symbol) + (mesh-forced symbol) + (hit-reaction oscillating-vector :inline) + (traj trajectory :inline) + (traj-src vector :inline) + (traj-dest vector :inline) + (traj-timer time-frame) + (traj-duration float) + (current-nav-poly nav-poly) + (tentacles handle 6) + (baron squid-baron) + (driver (pointer squid-driver)) + (driver-blend cam-float-seeker :inline) + (blink-time time-frame) + (blink-mask int32) + (thruster-part sparticle-launch-control) + (gun-tilt-left-jm joint-mod) + (gun-tilt-right-jm joint-mod) + (gun-tilt float) + (next-gun int8) + (fire-aft symbol) + (gun-high-to-low symbol) + (grenade squid-grenade-holder 10 :inline) + (first-path path-control) + (second-path path-control) + (third-path path-control) + (shield-timer time-frame) + (shield-color vector :inline) + (shield-shattered symbol) + (shield-hit-points float) + (hit-points int32) + (invincible-timer time-frame) + (stage int32) + (collision-actor (pointer squid-collision)) + (tentacle-base-jm joint-mod) + (tentacle-base-rotation float) + (tentacle-base-rotation-speed cam-float-seeker :inline) + (stage-2-go-status int32) + (gate-intact symbol) + (hud handle) + (desired-rotate-to-vector-angle degrees) + (allowed-rotate-to-vector-angle degrees) + (stop-shooting symbol) + (attack-id uint32) + (rush-sound sound-id) + (rush-sound-playing symbol) + (rush-end-time time-frame) + (jet-sound sound-id) + (jet-sound-playing symbol) + (jet-pitch int64) + (negate-jet-pitch symbol) + (jet-volume int64) + (can-play-squid-boost symbol) + (tentacle-sound sound-id) + (tentacle-sound-playing symbol) + (spin-sound sound-id) + (spin-sound-playing symbol) + (reload-played symbol) + (max-plane int32) + (debug-timer time-frame) + (debug-on symbol) + (last-damaged-talker int8) + (last-shield-hit-talker int8) + (last-no-energy-talker int8) + (last-shooting-talker int8) + (last-headbutting-talker int8) + (last-general-talker int8) + (last-start-recharging-talker int8) + (last-done-recharging-talker int8) + (suck float) ) - :heap-base #x490 - :method-count-assert 54 - :size-assert #x508 - :flag-assert #x3604900508 + (:state-methods + test + beaten + wait-around-corner + wait-beside-building + flee + pre-flee + recharge + fly-to-post + headbut + fire-whirlwind + fire-grenades + fire + fly-to-shoot-spot + idle + hidden + ) (:methods - (test () _type_ :state 27) - (beaten () _type_ :state 28) - (wait-around-corner () _type_ :state 29) - (wait-beside-building () _type_ :state 30) - (flee () _type_ :state 31) - (pre-flee () _type_ :state 32) - (recharge () _type_ :state 33) - (fly-to-post () _type_ :state 34) - (headbut () _type_ :state 35) - (fire-whirlwind () _type_ :state 36) - (fire-grenades () _type_ :state 37) - (fire () _type_ :state 38) - (fly-to-shoot-spot () _type_ :state 39) - (idle () _type_ :state 40) - (hidden () _type_ :state 41) - (squid-method-42 (_type_ vector) vector 42) - (squid-method-43 (_type_ vector float float) none 43) - (squid-method-44 (_type_ vector vector) symbol 44) - (move-to-spot (_type_ vector symbol) none 45) - (set-traj-towards-vec (_type_ vector vector vector) none 46) - (float-sin-clamp (_type_ float) float 47) - (squid-method-48 (_type_) float 48) - (setup-part-engine (_type_ symbol) none 49) - (squid-post (_type_) none 50) - (spawn-whirlwind (_type_) (pointer squid-whirlwind) 51) - (spawn-grenade (_type_ int squid-grenade-holder float) none 52) - (squid-method-53 (_type_ int) none 53) + (squid-method-42 (_type_ vector) vector) + (squid-method-43 (_type_ vector float float) none) + (squid-method-44 (_type_ vector vector) symbol) + (move-to-spot (_type_ vector symbol) none) + (set-traj-towards-vec (_type_ vector vector vector) none) + (float-sin-clamp (_type_ float) float) + (squid-method-48 (_type_) float) + (setup-part-engine (_type_ symbol) none) + (squid-post (_type_) none) + (spawn-whirlwind (_type_) (pointer squid-whirlwind)) + (spawn-grenade (_type_ int squid-grenade-holder float) none) + (squid-method-53 (_type_ int) none) ) ) @@ -632,7 +602,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod joint-setup squid-tentacle ((this squid-tentacle)) +(defmethod joint-setup ((this squid-tentacle)) (dotimes (s5-0 11) (let ((s4-0 (-> this chain-joints s5-0))) (vector<-cspace! (-> s4-0 position) (-> s4-0 joint-mod joint)) @@ -644,7 +614,7 @@ (none) ) -(defmethod squid-tentacle-method-23 squid-tentacle ((this squid-tentacle)) +(defmethod squid-tentacle-method-23 ((this squid-tentacle)) (local-vars (v1-134 float) (v1-162 float) @@ -1094,7 +1064,7 @@ ) ;; WARN: Return type mismatch process-drawable vs squid-tentacle. -(defmethod relocate squid-tentacle ((this squid-tentacle) (arg0 int)) +(defmethod relocate ((this squid-tentacle) (arg0 int)) (dotimes (v1-0 11) (if (nonzero? (-> this chain-joints v1-0 joint-mod)) (&+! (-> this chain-joints v1-0 joint-mod) arg0) @@ -1528,7 +1498,7 @@ ) ) -(defmethod deactivate squid ((this squid)) +(defmethod deactivate ((this squid)) (if (nonzero? (-> this thruster-part)) (kill-and-free-particles (-> this thruster-part)) ) @@ -1549,7 +1519,7 @@ ) ;; WARN: Return type mismatch process-drawable vs squid. -(defmethod relocate squid ((this squid) (arg0 int)) +(defmethod relocate ((this squid) (arg0 int)) (if (nonzero? (-> this thruster-part)) (&+! (-> this thruster-part) arg0) ) @@ -1575,7 +1545,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! squid ((this squid) (arg0 entity-actor)) +(defmethod init-from-entity! ((this squid) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1884,7 +1854,7 @@ This commonly includes things such as: (none) ) -(defmethod squid-method-42 squid ((this squid) (arg0 vector)) +(defmethod squid-method-42 ((this squid) (arg0 vector)) (set! (-> arg0 quad) (-> (if *target* (get-trans *target* 3) (-> this nav state mesh bounds) @@ -1895,7 +1865,7 @@ This commonly includes things such as: arg0 ) -(defmethod squid-method-43 squid ((this squid) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod squid-method-43 ((this squid) (arg0 vector) (arg1 float) (arg2 float)) (let ((s4-0 (new 'stack-no-clear 'matrix)) (s5-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this quat))) ) @@ -1928,7 +1898,7 @@ This commonly includes things such as: (none) ) -(defmethod squid-method-44 squid ((this squid) (arg0 vector) (arg1 vector)) +(defmethod squid-method-44 ((this squid) (arg0 vector) (arg1 vector)) (let ((v1-0 (new 'stack-no-clear 'collide-query))) (set! (-> v1-0 start-pos quad) (-> arg0 quad)) (vector-! (-> v1-0 move-dist) arg1 arg0) @@ -1944,7 +1914,7 @@ This commonly includes things such as: ) ) -(defmethod move-to-spot squid ((this squid) (arg0 vector) (arg1 symbol)) +(defmethod move-to-spot ((this squid) (arg0 vector) (arg1 symbol)) (local-vars (sv-656 vector) (sv-672 vector) @@ -2117,7 +2087,7 @@ This commonly includes things such as: ) ) -(defmethod set-traj-towards-vec squid ((this squid) (src vector) (arg2 vector) (dest vector)) +(defmethod set-traj-towards-vec ((this squid) (src vector) (arg2 vector) (dest vector)) "Set up the [[trajectory]] towards `dest`." (set-time! (-> this traj-timer)) (set! (-> this traj-src quad) (-> src quad)) @@ -2136,11 +2106,11 @@ This commonly includes things such as: (none) ) -(defmethod float-sin-clamp squid ((this squid) (arg0 float)) +(defmethod float-sin-clamp ((this squid) (arg0 float)) (parameter-ease-sin-clamp (* 0.6366198 arg0)) ) -(defmethod squid-method-48 squid ((this squid)) +(defmethod squid-method-48 ((this squid)) (when (< 0.00001 (-> this residual-accumulator-1)) (set! (-> this residual-accumulator-1) (* 0.95 (-> this residual-accumulator-1))) (+! (-> this residual-accumulator-2) (-> this residual-accumulator-1)) @@ -2197,7 +2167,7 @@ This commonly includes things such as: ) ) -(defmethod setup-part-engine squid ((this squid) (arg0 symbol)) +(defmethod setup-part-engine ((this squid) (arg0 symbol)) (when (>= (- (current-time) (-> this blink-time)) 0) (set! (-> this blink-mask) 0) (dotimes (s5-0 10) @@ -2357,7 +2327,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch float vs none. -(defmethod squid-post squid ((this squid)) +(defmethod squid-post ((this squid)) (local-vars (v0-33 object) (s5-9 int) @@ -2710,7 +2680,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch (pointer process) vs (pointer squid-whirlwind). -(defmethod spawn-whirlwind squid ((this squid)) +(defmethod spawn-whirlwind ((this squid)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s4-0 (squid-method-42 this (new 'stack-no-clear 'vector))) ) @@ -2740,7 +2710,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch symbol vs none. -(defmethod spawn-grenade squid ((this squid) (arg0 int) (arg1 squid-grenade-holder) (arg2 float)) +(defmethod spawn-grenade ((this squid) (arg0 int) (arg1 squid-grenade-holder) (arg2 float)) (squid-increment-shield (+ -0.001 (/ -1.0 (* 2.0 (the float (* (squid-num-grenades-to-shoot) 2)))))) (let ((s4-1 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0))) @@ -2770,14 +2740,10 @@ This commonly includes things such as: (deftype squid-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) -(defmethod play-impact-sound squid-shot ((this squid-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this squid-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -2815,7 +2781,7 @@ This commonly includes things such as: (none) ) -(defmethod init-proj-settings! squid-shot ((this squid-shot)) +(defmethod init-proj-settings! ((this squid-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this hit-actor?) #f) (set! (-> this tail-pos quad) (-> this root trans quad)) @@ -2831,7 +2797,7 @@ This commonly includes things such as: (none) ) -(defmethod draw-laser-sight squid-shot ((this squid-shot)) +(defmethod draw-laser-sight ((this squid-shot)) "TODO - confirm If applicable, draw the laser sight particles" (draw-beam (-> *part-id-table* 4861) (-> this tail-pos) (-> this starting-dir) #f #t) (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) @@ -2848,7 +2814,7 @@ This commonly includes things such as: (none) ) -(defmethod spawn-impact-particles squid-shot ((this squid-shot)) +(defmethod spawn-impact-particles ((this squid-shot)) "Spawns associated particles with the projectile if applicable" (let* ((gp-0 (-> this root trans)) (a1-0 (-> this tail-pos)) @@ -2882,7 +2848,7 @@ This commonly includes things such as: (none) ) -(defmethod spawn-shell-particles squid-shot ((this squid-shot)) +(defmethod spawn-shell-particles ((this squid-shot)) "TODO - confirm" (let* ((s3-0 (-> this root)) (s4-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s3-0 trans)) 2048.0)) diff --git a/goal_src/jak2/levels/palace/cable/palcab-obs.gc b/goal_src/jak2/levels/palace/cable/palcab-obs.gc index 4cfc4177430..961cde7a975 100644 --- a/goal_src/jak2/levels/palace/cable/palcab-obs.gc +++ b/goal_src/jak2/levels/palace/cable/palcab-obs.gc @@ -8,44 +8,34 @@ ;; DECOMP BEGINS (deftype pal-fan-ring (structure) - ((lightning lightning-control :offset-assert 0) - (radius float :offset-assert 4) - (dist float :offset-assert 8) - (local-z-rotate float :offset-assert 12) + ((lightning lightning-control) + (radius float) + (dist float) + (local-z-rotate float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) (deftype pal-fan-pole (structure) - ((rings pal-fan-ring 6 :inline :offset-assert 0) - (z-rotate float :offset 96) + ((rings pal-fan-ring 6 :inline) + (z-rotate float :offset 96) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x64 - :flag-assert #x900000064 ) (deftype pal-electric-fan (process-drawable) - ((root collide-shape-moving :override) - (poles pal-fan-pole 3 :inline :offset-assert 200) - (no-collision-timer time-frame :offset 536) - (sound-timer time-frame :offset-assert 544) - (rotate-speed float :offset-assert 552) - (attack-id uint32 :offset-assert 556) - (sound-id sound-id :offset-assert 560) + ((root collide-shape-moving :override) + (poles pal-fan-pole 3 :inline) + (no-collision-timer time-frame :offset 536) + (sound-timer time-frame) + (rotate-speed float) + (attack-id uint32) + (sound-id sound-id) ) - :heap-base #x1c0 - :method-count-assert 21 - :size-assert #x234 - :flag-assert #x1501c00234 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -199,7 +189,7 @@ ) ;; WARN: Return type mismatch process-drawable vs pal-electric-fan. -(defmethod relocate pal-electric-fan ((this pal-electric-fan) (arg0 int)) +(defmethod relocate ((this pal-electric-fan) (arg0 int)) (dotimes (v1-0 3) (dotimes (a2-0 6) (if (nonzero? (-> (the-as pal-electric-fan (&+ this (* 112 v1-0))) poles 0 rings a2-0 lightning)) @@ -211,7 +201,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-electric-fan ((this pal-electric-fan) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-electric-fan) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -370,19 +360,15 @@ This commonly includes things such as: ) (deftype pal-cable-nut (process-drawable) - ((root collide-shape-moving :override) - (sync sync-linear :inline :offset-assert 200) - (init-quat quaternion :inline :offset-assert 224) - (sound-played? symbol 2 :offset-assert 240) - (hold-percentage float :offset-assert 248) - (wiggle-percentage float :offset-assert 252) + ((root collide-shape-moving :override) + (sync sync-linear :inline) + (init-quat quaternion :inline) + (sound-played? symbol 2) + (hold-percentage float) + (wiggle-percentage float) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #x100 - :flag-assert #x1500800100 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -443,7 +429,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-cable-nut ((this pal-cable-nut) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-cable-nut) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -531,14 +517,10 @@ This commonly includes things such as: (deftype pal-rot-gun-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) -(defmethod spawn-impact-particles pal-rot-gun-shot ((this pal-rot-gun-shot)) +(defmethod spawn-impact-particles ((this pal-rot-gun-shot)) "Spawns associated particles with the projectile if applicable" (let* ((gp-0 (-> this root trans)) (a1-0 (-> this tail-pos)) @@ -586,7 +568,7 @@ This commonly includes things such as: (none) ) -(defmethod spawn-shell-particles pal-rot-gun-shot ((this pal-rot-gun-shot)) +(defmethod spawn-shell-particles ((this pal-rot-gun-shot)) "TODO - confirm" (let* ((s3-0 (-> this root)) (s5-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s3-0 trans)) 2048.0)) @@ -647,7 +629,7 @@ This commonly includes things such as: (none) ) -(defmethod play-impact-sound pal-rot-gun-shot ((this pal-rot-gun-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this pal-rot-gun-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -689,7 +671,7 @@ This commonly includes things such as: (none) ) -(defmethod init-proj-collision! pal-rot-gun-shot ((this pal-rot-gun-shot)) +(defmethod init-proj-collision! ((this pal-rot-gun-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -723,7 +705,7 @@ This commonly includes things such as: (none) ) -(defmethod init-proj-settings! pal-rot-gun-shot ((this pal-rot-gun-shot)) +(defmethod init-proj-settings! ((this pal-rot-gun-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'pal-rot-gun-shot) @@ -735,24 +717,22 @@ This commonly includes things such as: ) (deftype pal-rot-gun (process-drawable) - ((init-quat quaternion :inline :offset-assert 208) - (fire-timer time-frame :offset-assert 224) - (gun-index int32 :offset-assert 232) - (spin-rate float :offset-assert 236) - (spin-rate-final float :offset-assert 240) - (sound-id sound-id :offset-assert 244) - (shot-sound-id sound-id :offset-assert 248) - (prev-z-rot float :offset-assert 252) + ((init-quat quaternion :inline) + (fire-timer time-frame) + (gun-index int32) + (spin-rate float) + (spin-rate-final float) + (sound-id sound-id) + (shot-sound-id sound-id) + (prev-z-rot float) ) - :heap-base #x80 - :method-count-assert 24 - :size-assert #x100 - :flag-assert #x1800800100 + (:state-methods + idle + spin + spin-down + ) (:methods - (idle () _type_ :state 20) - (spin () _type_ :state 21) - (spin-down () _type_ :state 22) - (pal-rot-gun-method-23 (_type_ matrix) none 23) + (pal-rot-gun-method-23 (_type_ matrix) none) ) ) @@ -884,7 +864,7 @@ This commonly includes things such as: ) ) -(defmethod pal-rot-gun-method-23 pal-rot-gun ((this pal-rot-gun) (arg0 matrix)) +(defmethod pal-rot-gun-method-23 ((this pal-rot-gun) (arg0 matrix)) (let ((v1-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((a2-0 (-> arg0 vector)) (a1-1 (-> arg0 vector 1)) @@ -910,7 +890,7 @@ This commonly includes things such as: (none) ) -(defmethod deactivate pal-rot-gun ((this pal-rot-gun)) +(defmethod deactivate ((this pal-rot-gun)) (sound-stop (-> this sound-id)) (sound-stop (-> this shot-sound-id)) (call-parent-method this) @@ -918,7 +898,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-rot-gun ((this pal-rot-gun) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-rot-gun) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -955,12 +935,8 @@ This commonly includes things such as: (deftype pal-windmill (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -987,7 +963,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-windmill ((this pal-windmill) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-windmill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1008,16 +984,12 @@ This commonly includes things such as: ) (deftype pal-flip-step (process-drawable) - ((task-node game-task-node-info :offset-assert 200) + ((task-node game-task-node-info) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xcc - :flag-assert #x17005000cc - (:methods - (idle () _type_ :state 20) - (fall () _type_ :state 21) - (fallen () _type_ :state 22) + (:state-methods + idle + fall + fallen ) ) @@ -1066,7 +1038,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-flip-step ((this pal-flip-step) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-flip-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/palace/cable/palcab-part.gc b/goal_src/jak2/levels/palace/cable/palcab-part.gc index dceb6ab4697..c75458a9f78 100644 --- a/goal_src/jak2/levels/palace/cable/palcab-part.gc +++ b/goal_src/jak2/levels/palace/cable/palcab-part.gc @@ -9,10 +9,6 @@ (deftype palcab-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/palace/pal-obs.gc b/goal_src/jak2/levels/palace/pal-obs.gc index 6be0dac463e..dffb30a8ea6 100644 --- a/goal_src/jak2/levels/palace/pal-obs.gc +++ b/goal_src/jak2/levels/palace/pal-obs.gc @@ -8,15 +8,11 @@ ;; DECOMP BEGINS (deftype pal-falling-plat (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (fall () _type_ :state 21) + (:state-methods + idle + fall ) ) @@ -89,7 +85,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-falling-plat ((this pal-falling-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-falling-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -164,15 +160,11 @@ This commonly includes things such as: (deftype pal-ent-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-ent-door ((this pal-ent-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-ent-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -215,17 +207,15 @@ This commonly includes things such as: ) (deftype pal-grind-ring-center (process-focusable) - ((speed-y float :offset-assert 204) - (hit-sound-played? basic :offset-assert 208) + ((speed-y float) + (hit-sound-played? basic) ) - :heap-base #x60 - :method-count-assert 30 - :size-assert #xd4 - :flag-assert #x1e006000d4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (pal-grind-ring-center-method-29 (_type_) none 29) + (pal-grind-ring-center-method-29 (_type_) none) ) ) @@ -325,7 +315,7 @@ This commonly includes things such as: :post #f ) -(defmethod pal-grind-ring-center-method-29 pal-grind-ring-center ((this pal-grind-ring-center)) +(defmethod pal-grind-ring-center-method-29 ((this pal-grind-ring-center)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -352,7 +342,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-grind-ring-center ((this pal-grind-ring-center) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-grind-ring-center) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -381,17 +371,15 @@ This commonly includes things such as: ) (deftype pal-grind-ring (process-focusable) - ((speed-y float :offset-assert 204) - (hit-sound-played? basic :offset-assert 208) + ((speed-y float) + (hit-sound-played? basic) ) - :heap-base #x60 - :method-count-assert 30 - :size-assert #xd4 - :flag-assert #x1e006000d4 + (:state-methods + idle + fall + ) (:methods - (idle () _type_ :state 27) - (fall () _type_ :state 28) - (pal-grind-ring-method-29 (_type_) none 29) + (pal-grind-ring-method-29 (_type_) none) ) ) @@ -496,7 +484,7 @@ This commonly includes things such as: :post transform-post ) -(defmethod pal-grind-ring-method-29 pal-grind-ring ((this pal-grind-ring)) +(defmethod pal-grind-ring-method-29 ((this pal-grind-ring)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -524,7 +512,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-grind-ring ((this pal-grind-ring) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-grind-ring) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -586,15 +574,13 @@ This commonly includes things such as: (deftype pal-ent-glass (process-focusable) () - :heap-base #x50 - :method-count-assert 31 - :size-assert #xcc - :flag-assert #x1f005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (pal-ent-glass-method-29 (_type_) none 29) - (pal-ent-glass-method-30 (_type_) none 30) + (pal-ent-glass-method-29 (_type_) none) + (pal-ent-glass-method-30 (_type_) none) ) ) @@ -655,7 +641,7 @@ This commonly includes things such as: ) ) -(defmethod pal-ent-glass-method-29 pal-ent-glass ((this pal-ent-glass)) +(defmethod pal-ent-glass-method-29 ((this pal-ent-glass)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -682,14 +668,14 @@ This commonly includes things such as: (none) ) -(defmethod pal-ent-glass-method-30 pal-ent-glass ((this pal-ent-glass)) +(defmethod pal-ent-glass-method-30 ((this pal-ent-glass)) (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-ent-glass ((this pal-ent-glass) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-ent-glass) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -711,14 +697,10 @@ This commonly includes things such as: (deftype palent-turret-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) -(defmethod play-impact-sound palent-turret-shot ((this palent-turret-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this palent-turret-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -739,15 +721,13 @@ This commonly includes things such as: ) (deftype palent-turret (process-focusable) - ((next-shoot uint64 :offset-assert 208) + ((next-shoot uint64) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd8 - :flag-assert #x1d006000d8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (palent-turret-method-28 (_type_) none 28) + (palent-turret-method-28 (_type_) none) ) ) @@ -819,7 +799,7 @@ This commonly includes things such as: ) ) -(defmethod palent-turret-method-28 palent-turret ((this palent-turret)) +(defmethod palent-turret-method-28 ((this palent-turret)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -867,7 +847,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! palent-turret ((this palent-turret) (arg0 entity-actor)) +(defmethod init-from-entity! ((this palent-turret) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -941,15 +921,13 @@ This commonly includes things such as: (deftype pal-breakable-window (process-focusable) () - :heap-base #x50 - :method-count-assert 31 - :size-assert #xcc - :flag-assert #x1f005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (pal-breakable-window-method-29 (_type_) none 29) - (pal-breakable-window-method-30 (_type_) none 30) + (pal-breakable-window-method-29 (_type_) none) + (pal-breakable-window-method-30 (_type_) none) ) ) @@ -1008,7 +986,7 @@ This commonly includes things such as: ) ) -(defmethod pal-breakable-window-method-29 pal-breakable-window ((this pal-breakable-window)) +(defmethod pal-breakable-window-method-29 ((this pal-breakable-window)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1035,14 +1013,14 @@ This commonly includes things such as: (none) ) -(defmethod pal-breakable-window-method-30 pal-breakable-window ((this pal-breakable-window)) +(defmethod pal-breakable-window-method-30 ((this pal-breakable-window)) (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-breakable-window ((this pal-breakable-window) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-breakable-window) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/palace/palent-part.gc b/goal_src/jak2/levels/palace/palent-part.gc index f85a536141c..a1ccd4dd3af 100644 --- a/goal_src/jak2/levels/palace/palent-part.gc +++ b/goal_src/jak2/levels/palace/palent-part.gc @@ -9,10 +9,6 @@ (deftype palent-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/palace/roof/palroof-obs.gc b/goal_src/jak2/levels/palace/roof/palroof-obs.gc index fc8e10b14ea..77f6a2c7151 100644 --- a/goal_src/jak2/levels/palace/roof/palroof-obs.gc +++ b/goal_src/jak2/levels/palace/roof/palroof-obs.gc @@ -9,10 +9,6 @@ (deftype pal-lowrez-throne (med-res-level) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd4 - :flag-assert #x15006000d4 ) @@ -78,16 +74,12 @@ ) (deftype pal-prong (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc8 - :flag-assert #x17005000c8 - (:methods - (idle () _type_ :state 20) - (break-it () _type_ :state 21) - (broken () _type_ :state 22) + (:state-methods + idle + break-it + broken ) ) @@ -121,7 +113,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-prong ((this pal-prong) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-prong) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/palace/roof/palroof-part.gc b/goal_src/jak2/levels/palace/roof/palroof-part.gc index 84d83c1e66b..6b6c8e8bdc3 100644 --- a/goal_src/jak2/levels/palace/roof/palroof-part.gc +++ b/goal_src/jak2/levels/palace/roof/palroof-part.gc @@ -9,10 +9,6 @@ (deftype palroof-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/palace/shaft/palshaft-part.gc b/goal_src/jak2/levels/palace/shaft/palshaft-part.gc index 7533da8be31..958ac489e00 100644 --- a/goal_src/jak2/levels/palace/shaft/palshaft-part.gc +++ b/goal_src/jak2/levels/palace/shaft/palshaft-part.gc @@ -9,10 +9,6 @@ (deftype palshaft-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/palace/throne/palace-scenes.gc b/goal_src/jak2/levels/palace/throne/palace-scenes.gc index c1808f20720..1fc5b05b8a7 100644 --- a/goal_src/jak2/levels/palace/throne/palace-scenes.gc +++ b/goal_src/jak2/levels/palace/throne/palace-scenes.gc @@ -9,12 +9,8 @@ (deftype throne-throne (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -40,7 +36,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! throne-throne ((this throne-throne) (entity entity-actor)) +(defmethod init-from-entity! ((this throne-throne) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/palace/throne/throne-part.gc b/goal_src/jak2/levels/palace/throne/throne-part.gc index 508c3cc734b..679bc6a2882 100644 --- a/goal_src/jak2/levels/palace/throne/throne-part.gc +++ b/goal_src/jak2/levels/palace/throne/throne-part.gc @@ -9,10 +9,6 @@ (deftype throne-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/ruins/breakable-wall.gc b/goal_src/jak2/levels/ruins/breakable-wall.gc index 5609d22bde7..8aec76ecf72 100644 --- a/goal_src/jak2/levels/ruins/breakable-wall.gc +++ b/goal_src/jak2/levels/ruins/breakable-wall.gc @@ -56,28 +56,22 @@ ) (deftype rbw-side (basic) - ((break-anim string :offset-assert 4) - (end-anim string :offset-assert 8) - (break-prim-mask uint8 :offset-assert 12) - (break-root-prim-joint int16 :offset-assert 14) - (break-bounds-joint int16 :offset-assert 16) - (break-root-prim-sphere sphere :inline :offset-assert 32) - (break-bounds-sphere sphere :inline :offset-assert 48) + ((break-anim string) + (end-anim string) + (break-prim-mask uint8) + (break-root-prim-joint int16) + (break-bounds-joint int16) + (break-root-prim-sphere sphere :inline) + (break-bounds-sphere sphere :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype rbw-info (basic) - ((skel-group string :offset-assert 4) - (anim spool-anim :offset-assert 8) - (sides (array rbw-side) :offset-assert 12) + ((skel-group string) + (anim spool-anim) + (sides (array rbw-side)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -203,25 +197,23 @@ ) (deftype ruins-breakable-wall (process-focusable) - ((info rbw-info :offset-assert 204) - (side rbw-side :offset-assert 208) - (nav-mesh nav-mesh :offset-assert 212) + ((info rbw-info) + (side rbw-side) + (nav-mesh nav-mesh) ) - :heap-base #x60 - :method-count-assert 31 - :size-assert #xd8 - :flag-assert #x1f006000d8 + (:state-methods + unbroken + hit + broken + ) (:methods - (unbroken () _type_ :state 27) - (hit () _type_ :state 28) - (broken () _type_ :state 29) - (ruins-breakable-wall-method-30 (_type_ symbol) none 30) + (ruins-breakable-wall-method-30 (_type_ symbol) none) ) ) ;; WARN: Return type mismatch float vs none. -(defmethod ruins-breakable-wall-method-30 ruins-breakable-wall ((this ruins-breakable-wall) (arg0 symbol)) +(defmethod ruins-breakable-wall-method-30 ((this ruins-breakable-wall) (arg0 symbol)) (case arg0 (('hit) (-> this draw bounds w) @@ -415,7 +407,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-breakable-wall ((this ruins-breakable-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ruins-breakable-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/ruins/mechtest-obs.gc b/goal_src/jak2/levels/ruins/mechtest-obs.gc index 287741ab43d..9c5108adaca 100644 --- a/goal_src/jak2/levels/ruins/mechtest-obs.gc +++ b/goal_src/jak2/levels/ruins/mechtest-obs.gc @@ -8,25 +8,21 @@ ;; DECOMP BEGINS (deftype mechblock (process-drawable) - ((root collide-shape-moving :override) - (origin vector :inline :offset-assert 208) - (drop-point vector :inline :offset 256) - (allow-drag? symbol :offset-assert 272) - (reset-on-land? symbol :offset-assert 276) - (hit-something? symbol :offset-assert 280) - (attack-id uint32 :offset-assert 284) - (next-entity entity :offset-assert 288) + ((root collide-shape-moving :override) + (origin vector :inline) + (drop-point vector :inline :offset 256) + (allow-drag? symbol) + (reset-on-land? symbol) + (hit-something? symbol) + (attack-id uint32) + (next-entity entity) ) - :heap-base #xb0 - :method-count-assert 25 - :size-assert #x124 - :flag-assert #x1900b00124 - (:methods - (idle () _type_ :state 20) - (carry () _type_ :state 21) - (drag () _type_ :state 22) - (fall () _type_ :state 23) - (wait () _type_ :state 24) + (:state-methods + idle + carry + drag + fall + wait ) ) @@ -427,10 +423,6 @@ (deftype throwblock (mechblock) () - :heap-base #xb0 - :method-count-assert 25 - :size-assert #x124 - :flag-assert #x1900b00124 ) @@ -440,7 +432,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! throwblock ((this throwblock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this throwblock) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -506,10 +498,6 @@ This commonly includes things such as: (deftype pushblock (mechblock) () - :heap-base #xb0 - :method-count-assert 25 - :size-assert #x124 - :flag-assert #x1900b00124 ) @@ -519,7 +507,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pushblock ((this pushblock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pushblock) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/ruins/pillar-collapse.gc b/goal_src/jak2/levels/ruins/pillar-collapse.gc index bbdd062863d..e8bcc676e00 100644 --- a/goal_src/jak2/levels/ruins/pillar-collapse.gc +++ b/goal_src/jak2/levels/ruins/pillar-collapse.gc @@ -8,25 +8,21 @@ ;; DECOMP BEGINS (deftype ruins-pillar-collapse (process-drawable) - ((root collide-shape-moving :override) - (player-attack-id int32 :offset-assert 200) - (fall-anim-index int32 :offset-assert 204) - (hit-points int8 :offset-assert 208) - (mesh-trans uint8 3 :offset-assert 209) - (mesh-joint joint 2 :offset-assert 212) - (deadly? symbol :offset 216) - (art-name string :offset 220) - (anim spool-anim :offset 224) + ((root collide-shape-moving :override) + (player-attack-id int32) + (fall-anim-index int32) + (hit-points int8) + (mesh-trans uint8 3) + (mesh-joint joint 2) + (deadly? symbol :overlay-at (-> mesh-joint 1)) + (art-name string :offset 220) + (anim spool-anim :offset 224) ) - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe4 - :flag-assert #x18007000e4 - (:methods - (idle () _type_ :state 20) - (bump () _type_ :state 21) - (hit () _type_ :state 22) - (fall (symbol) _type_ :state 23) + (:state-methods + idle + bump + hit + (fall symbol) ) ) @@ -232,7 +228,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-pillar-collapse ((this ruins-pillar-collapse) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ruins-pillar-collapse) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/ruins/rapid-gunner.gc b/goal_src/jak2/levels/ruins/rapid-gunner.gc index 9135acaa954..95eeb7b4d10 100644 --- a/goal_src/jak2/levels/ruins/rapid-gunner.gc +++ b/goal_src/jak2/levels/ruins/rapid-gunner.gc @@ -18,40 +18,38 @@ ;; DECOMP BEGINS (deftype rapid-gunner (nav-enemy) - ((los los-control :inline :offset-assert 608) - (joint joint-mod :offset-assert 756) - (joint-blend float :offset-assert 760) - (joint-enable symbol :offset-assert 764) - (shot-timer uint64 :offset-assert 768) - (predict-timer uint64 :offset-assert 776) - (target-prev-pos vector :inline :offset-assert 784) - (target-next-pos vector :inline :offset-assert 800) - (focus-dir vector :inline :offset-assert 816) - (y-diff float :offset-assert 832) - (shots-fired uint32 :offset-assert 836) - (spin-up-angle float :offset-assert 840) - (spin-up-timer time-frame :offset-assert 848) - (shoot-anim-index int32 :offset-assert 856) - (status-flags rapid-gunner-flags :offset-assert 864) - (start-pos vector :inline :offset-assert 880) - (dest-pos vector :inline :offset-assert 896) - (hop-dir vector :inline :offset-assert 912) - (roam-radius float :offset-assert 928) + ((los los-control :inline) + (joint joint-mod) + (joint-blend float) + (joint-enable symbol) + (shot-timer uint64) + (predict-timer uint64) + (target-prev-pos vector :inline) + (target-next-pos vector :inline) + (focus-dir vector :inline) + (y-diff float) + (shots-fired uint32) + (spin-up-angle float) + (spin-up-timer time-frame) + (shoot-anim-index int32) + (status-flags rapid-gunner-flags) + (start-pos vector :inline) + (dest-pos vector :inline) + (hop-dir vector :inline) + (roam-radius float) ) - :heap-base #x330 - :method-count-assert 187 - :size-assert #x3a4 - :flag-assert #xbb033003a4 + (:state-methods + attack + spin-attack + hop + hop-turn + cool-down + reload + ) (:methods - (attack () _type_ :state 178) - (spin-attack () _type_ :state 179) - (hop () _type_ :state 180) - (hop-turn () _type_ :state 181) - (cool-down () _type_ :state 182) - (reload () _type_ :state 183) - (rapid-gunner-method-184 (_type_ float) symbol 184) - (rapid-gunner-method-185 (_type_ vector float) none 185) - (rapid-gunner-method-186 (_type_ int float int int) none 186) + (rapid-gunner-method-184 (_type_ float) symbol) + (rapid-gunner-method-185 (_type_ vector float) none) + (rapid-gunner-method-186 (_type_ int float int int) none) ) ) @@ -240,7 +238,7 @@ (set! (-> *rapid-gunner-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler rapid-gunner ((this rapid-gunner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this rapid-gunner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -274,7 +272,7 @@ ;; WARN: Return type mismatch object vs symbol. ;; WARN: Using new Jak 2 rtype-of ;; WARN: Using new Jak 2 rtype-of -(defmethod enemy-method-77 rapid-gunner ((this rapid-gunner) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this rapid-gunner) (arg0 (pointer float))) (let ((v1-0 (-> this incoming knocked-type))) (the-as symbol @@ -395,7 +393,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 rapid-gunner ((this rapid-gunner) (arg0 vector)) +(defmethod enemy-method-52 ((this rapid-gunner) (arg0 vector)) (cond ((> (-> this hit-points) 0) (-> this enemy-info) @@ -415,7 +413,7 @@ (none) ) -(defmethod enemy-method-78 rapid-gunner ((this rapid-gunner) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this rapid-gunner) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -465,7 +463,7 @@ ) ) -(defmethod in-aggro-range? rapid-gunner ((this rapid-gunner) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this rapid-gunner) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -481,7 +479,7 @@ ) ;; WARN: Function (method 185 rapid-gunner) has a return type of none, but the expression builder found a return statement. -(defmethod rapid-gunner-method-185 rapid-gunner ((this rapid-gunner) (arg0 vector) (arg1 float)) +(defmethod rapid-gunner-method-185 ((this rapid-gunner) (arg0 vector) (arg1 float)) (if (not (-> this joint-enable)) (return #f) ) @@ -567,7 +565,7 @@ (none) ) -(defmethod track-target! rapid-gunner ((this rapid-gunner)) +(defmethod track-target! ((this rapid-gunner)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -580,11 +578,11 @@ (none) ) -(defmethod enemy-method-96 rapid-gunner ((this rapid-gunner) (arg0 float) (arg1 symbol)) +(defmethod enemy-method-96 ((this rapid-gunner) (arg0 float) (arg1 symbol)) (enemy-method-95 this (-> this target-next-pos) arg0) ) -(defmethod rapid-gunner-method-184 rapid-gunner ((this rapid-gunner) (arg0 float)) +(defmethod rapid-gunner-method-184 ((this rapid-gunner) (arg0 float)) (let* ((s4-0 (-> this node-list data 18)) (v1-1 (vector<-cspace! (new 'stack-no-clear 'vector) s4-0)) (s5-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this target-next-pos) v1-1) 1.0)) @@ -598,7 +596,7 @@ ) ) -(defmethod go-stare rapid-gunner ((this rapid-gunner)) +(defmethod go-stare ((this rapid-gunner)) (go (method-of-object this hostile)) ) @@ -836,7 +834,7 @@ ) ;; WARN: Return type mismatch art-element vs none. -(defmethod rapid-gunner-method-186 rapid-gunner ((this rapid-gunner) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod rapid-gunner-method-186 ((this rapid-gunner) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) @@ -1319,13 +1317,13 @@ :post nav-enemy-simple-post ) -(defmethod nav-enemy-method-142 rapid-gunner ((this rapid-gunner) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this rapid-gunner) (arg0 nav-control)) 0 (none) ) ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 rapid-gunner ((this rapid-gunner) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this rapid-gunner) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) (the-as symbol (if (t9-0 this arg0 arg1) (set-dst-proc! (-> this los) (-> this focus handle)) @@ -1334,7 +1332,7 @@ ) ) -(defmethod init-enemy-collision! rapid-gunner ((this rapid-gunner)) +(defmethod init-enemy-collision! ((this rapid-gunner)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1413,14 +1411,14 @@ (none) ) -(defmethod relocate rapid-gunner ((this rapid-gunner) (arg0 int)) +(defmethod relocate ((this rapid-gunner) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) (call-parent-method this arg0) ) -(defmethod init-enemy! rapid-gunner ((this rapid-gunner)) +(defmethod init-enemy! ((this rapid-gunner)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-48 int)) (rlet ((acc :class vf) @@ -1507,8 +1505,4 @@ (deftype shield-gunner (rapid-gunner) () - :heap-base #x330 - :method-count-assert 187 - :size-assert #x3a4 - :flag-assert #xbb033003a4 ) diff --git a/goal_src/jak2/levels/ruins/ruins-obs.gc b/goal_src/jak2/levels/ruins/ruins-obs.gc index 5bac446c456..a7ac6817714 100644 --- a/goal_src/jak2/levels/ruins/ruins-obs.gc +++ b/goal_src/jak2/levels/ruins/ruins-obs.gc @@ -8,12 +8,8 @@ ;; DECOMP BEGINS (deftype sinking-plat (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 384) + ((anchor-point vector :inline) ) - :heap-base #x110 - :method-count-assert 57 - :size-assert #x190 - :flag-assert #x3901100190 ) @@ -22,14 +18,14 @@ :bounds (static-spherem 0 1 0 4) ) -(defmethod rigid-body-object-method-29 sinking-plat ((this sinking-plat) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this sinking-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) ) -(defmethod allocate-and-init-cshape sinking-plat ((this sinking-plat)) +(defmethod allocate-and-init-cshape ((this sinking-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -90,7 +86,7 @@ ) ) -(defmethod init-skel-and-rigid-body sinking-plat ((this sinking-plat)) +(defmethod init-skel-and-rigid-body ((this sinking-plat)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-sinking-plat" (the-as (pointer uint32) #f))) @@ -137,13 +133,9 @@ (deftype beam (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (collapse () _type_ :state 21) + (:state-methods + idle + collapse ) ) @@ -184,7 +176,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! beam ((this beam) (arg0 entity-actor)) +(defmethod init-from-entity! ((this beam) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -214,10 +206,6 @@ This commonly includes things such as: (deftype ruins-bridge (drop-plat) () - :heap-base #xc0 - :method-count-assert 36 - :size-assert #x140 - :flag-assert #x2400c00140 ) @@ -226,7 +214,7 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 7) ) -(defmethod start-bouncing! ruins-bridge ((this ruins-bridge)) +(defmethod start-bouncing! ((this ruins-bridge)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" @@ -287,7 +275,7 @@ and translate the platform via the `smush` ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-bridge ((this ruins-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ruins-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -365,10 +353,6 @@ This commonly includes things such as: (deftype ruins-drop-plat (drop-plat) () - :heap-base #xc0 - :method-count-assert 36 - :size-assert #x140 - :flag-assert #x2400c00140 ) @@ -420,7 +404,7 @@ This commonly includes things such as: :origin-joint-index 3 ) -(defmethod start-bouncing! ruins-drop-plat ((this ruins-drop-plat)) +(defmethod start-bouncing! ((this ruins-drop-plat)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" @@ -512,7 +496,7 @@ and translate the platform via the `smush` ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-drop-plat ((this ruins-drop-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ruins-drop-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/ruins/ruins-part.gc b/goal_src/jak2/levels/ruins/ruins-part.gc index ac85e4a2af9..32c3edf8525 100644 --- a/goal_src/jak2/levels/ruins/ruins-part.gc +++ b/goal_src/jak2/levels/ruins/ruins-part.gc @@ -11,10 +11,6 @@ (deftype ruins-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/ruins/ruins-scenes.gc b/goal_src/jak2/levels/ruins/ruins-scenes.gc index 734868a35d5..5526acb6781 100644 --- a/goal_src/jak2/levels/ruins/ruins-scenes.gc +++ b/goal_src/jak2/levels/ruins/ruins-scenes.gc @@ -1311,12 +1311,8 @@ TODO - first arg type?" "The flag in the ruins mission. The scale will be linearly-interpolated based on the distance from the camera" () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1343,7 +1339,7 @@ The scale will be linearly-interpolated based on the distance from the camera" ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! flag ((this flag) (arg0 entity-actor)) +(defmethod init-from-entity! ((this flag) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1367,14 +1363,10 @@ This commonly includes things such as: (deftype ruins-precipice (process-drawable) "The edge of the ruins tower that the flag stands on Touching it flips the `play?` field which will trigger the cutscene" - ((play? symbol :offset-assert 200) + ((play? symbol) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xcc - :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1435,7 +1427,7 @@ Touching it flips the `play?` field which will trigger the cutscene" ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-precipice ((this ruins-precipice) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ruins-precipice) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/sewer/escort/grim-h.gc b/goal_src/jak2/levels/sewer/escort/grim-h.gc index 309593c8f2e..712e05c3b86 100644 --- a/goal_src/jak2/levels/sewer/escort/grim-h.gc +++ b/goal_src/jak2/levels/sewer/escort/grim-h.gc @@ -9,8 +9,4 @@ (deftype grim (jinx) () - :heap-base #x380 - :method-count-assert 246 - :size-assert #x400 - :flag-assert #xf603800400 ) diff --git a/goal_src/jak2/levels/sewer/escort/grim.gc b/goal_src/jak2/levels/sewer/escort/grim.gc index ef63a0f0c64..48e81bbbdbc 100644 --- a/goal_src/jak2/levels/sewer/escort/grim.gc +++ b/goal_src/jak2/levels/sewer/escort/grim.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod init-enemy-collision! grim ((this grim)) +(defmethod init-enemy-collision! ((this grim)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -80,7 +80,7 @@ (none) ) -(defmethod init-enemy! grim ((this grim)) +(defmethod init-enemy! ((this grim)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type jinx init-enemy!))) (t9-0 this) @@ -95,7 +95,7 @@ (none) ) -(defmethod ruffian-method-244 grim ((this grim)) +(defmethod ruffian-method-244 ((this grim)) (with-pp (ruffian-method-245 this) (let ((f30-0 (-> this nav state speed))) diff --git a/goal_src/jak2/levels/sewer/escort/jinx-bomb.gc b/goal_src/jak2/levels/sewer/escort/jinx-bomb.gc index 164555bb9d0..893e8fa1d6e 100644 --- a/goal_src/jak2/levels/sewer/escort/jinx-bomb.gc +++ b/goal_src/jak2/levels/sewer/escort/jinx-bomb.gc @@ -10,18 +10,14 @@ ;; DECOMP BEGINS (deftype jinx-bomb (process-focusable) - ((fuse-delay uint32 :offset-assert 204) - (attack-id uint32 :offset-assert 208) - (shake-screen? symbol :offset-assert 212) - (explode-func (function jinx-bomb none) :offset-assert 216) + ((fuse-delay uint32) + (attack-id uint32) + (shake-screen? symbol) + (explode-func (function jinx-bomb none)) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xdc - :flag-assert #x1d006000dc - (:methods - (idle () _type_ :state 27) - (explode () _type_ :state 28) + (:state-methods + idle + explode ) ) diff --git a/goal_src/jak2/levels/sewer/escort/jinx-h.gc b/goal_src/jak2/levels/sewer/escort/jinx-h.gc index 0acc9053064..de12e6be895 100644 --- a/goal_src/jak2/levels/sewer/escort/jinx-h.gc +++ b/goal_src/jak2/levels/sewer/escort/jinx-h.gc @@ -8,14 +8,10 @@ ;; DECOMP BEGINS (deftype jinx (ruffian) - ((bomb-handle handle :offset-assert 1008) - (bomb-func function :offset-assert 1016) - (bomb-fuse-delay uint32 :offset-assert 1020) + ((bomb-handle handle) + (bomb-func function) + (bomb-fuse-delay uint32) ) - :heap-base #x380 - :method-count-assert 246 - :size-assert #x400 - :flag-assert #xf603800400 ) diff --git a/goal_src/jak2/levels/sewer/escort/jinx.gc b/goal_src/jak2/levels/sewer/escort/jinx.gc index fb5998bb765..6707eb7f83a 100644 --- a/goal_src/jak2/levels/sewer/escort/jinx.gc +++ b/goal_src/jak2/levels/sewer/escort/jinx.gc @@ -8,27 +8,21 @@ ;; DECOMP BEGINS (deftype jinx-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) (deftype jinx-global-info (basic) - ((prev-blue-hit-front int8 :offset-assert 4) - (prev-blue-hit-back int8 :offset-assert 5) - (blue-hit-front-anim int32 3 :offset-assert 8) - (blue-hit-back-anim int32 3 :offset-assert 20) - (kick-anim int32 2 :offset-assert 32) - (scared-idle-anim int32 5 :offset-assert 40) - (bomb-recoil-anim int32 2 :offset-assert 60) + ((prev-blue-hit-front int8) + (prev-blue-hit-back int8) + (blue-hit-front-anim int32 3) + (blue-hit-back-anim int32 3) + (kick-anim int32 2) + (scared-idle-anim int32 5) + (bomb-recoil-anim int32 2) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) @@ -215,7 +209,7 @@ (set! (-> *jinx-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler jinx ((this jinx) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this jinx) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -242,7 +236,7 @@ ) ) -(defmethod init-enemy-collision! jinx ((this jinx)) +(defmethod init-enemy-collision! ((this jinx)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -315,7 +309,7 @@ (none) ) -(defmethod init-enemy! jinx ((this jinx)) +(defmethod init-enemy! ((this jinx)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (set! (-> this min-speed) 24576.0) @@ -352,7 +346,7 @@ ) ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod fire-gun jinx ((this jinx) (arg0 vector)) +(defmethod fire-gun ((this jinx) (arg0 vector)) (set! (-> this next-fire-time) (+ (current-time) (get-rand-int-range this 150 600))) (+! (-> this fired-gun-count) 1) (let ((s4-1 (new 'stack-no-clear 'projectile-init-by-other-params))) @@ -378,7 +372,7 @@ (none) ) -(defmethod ruffian-method-244 jinx ((this jinx)) +(defmethod ruffian-method-244 ((this jinx)) (with-pp (ruffian-method-245 this) (let ((f30-0 (-> this nav state speed))) @@ -436,7 +430,7 @@ ) ) -(defmethod enemy-method-77 jinx ((this jinx) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this jinx) (arg0 (pointer float))) (let ((v1-0 (-> this incoming knocked-type))) (cond ((= v1-0 (knocked-type knocked-type-6)) @@ -552,7 +546,7 @@ #t ) -(defmethod enemy-method-78 jinx ((this jinx) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this jinx) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -643,7 +637,7 @@ ) ) -(defmethod enemy-method-79 jinx ((this jinx) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this jinx) (arg0 int) (arg1 enemy-knocked-info)) (let ((f30-0 -1.0)) (when (and (= arg0 3) (logtest? (-> this bot-flags) (bot-flags attacked))) (let ((v1-7 (if (> (-> this skel active-channels) 0) @@ -701,7 +695,7 @@ ) ) -(defmethod enemy-method-84 jinx ((this jinx) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 ((this jinx) (arg0 enemy-jump-info)) (let ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos)))) (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0)) ) @@ -711,7 +705,7 @@ (none) ) -(defmethod bot-method-216 jinx ((this jinx)) +(defmethod bot-method-216 ((this jinx)) (set! (-> this health-handle) (ppointer->handle (process-spawn hud-ruffians :init hud-init-by-other :to this)) ) @@ -719,7 +713,7 @@ (none) ) -(defmethod draw hud-ruffians ((this hud-ruffians)) +(defmethod draw ((this hud-ruffians)) (set-hud-piece-position! (-> this sprites 2) (the int (+ 20.0 (* -130.0 (-> this offset)))) @@ -752,7 +746,7 @@ (none) ) -(defmethod update-values hud-ruffians ((this hud-ruffians)) +(defmethod update-values ((this hud-ruffians)) (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) (set! (-> this values 1 target) (the int (* 100.0 (-> *game-info* bot-health 1)))) (set! (-> this values 2 target) (the int (* 100.0 (-> *game-info* bot-health 2)))) @@ -761,7 +755,7 @@ (none) ) -(defmethod init-callback hud-ruffians ((this hud-ruffians)) +(defmethod init-callback ((this hud-ruffians)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/goal_src/jak2/levels/sewer/escort/mog-h.gc b/goal_src/jak2/levels/sewer/escort/mog-h.gc index 5057110bb29..23fb3c4d88a 100644 --- a/goal_src/jak2/levels/sewer/escort/mog-h.gc +++ b/goal_src/jak2/levels/sewer/escort/mog-h.gc @@ -9,8 +9,4 @@ (deftype mog (jinx) () - :heap-base #x380 - :method-count-assert 246 - :size-assert #x400 - :flag-assert #xf603800400 ) diff --git a/goal_src/jak2/levels/sewer/escort/mog.gc b/goal_src/jak2/levels/sewer/escort/mog.gc index 44e876892fe..cadf27bf4f7 100644 --- a/goal_src/jak2/levels/sewer/escort/mog.gc +++ b/goal_src/jak2/levels/sewer/escort/mog.gc @@ -197,7 +197,7 @@ 0 ) -(defmethod init-enemy-collision! mog ((this mog)) +(defmethod init-enemy-collision! ((this mog)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -270,7 +270,7 @@ (none) ) -(defmethod init-enemy! mog ((this mog)) +(defmethod init-enemy! ((this mog)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type jinx init-enemy!))) (t9-0 this) @@ -288,7 +288,7 @@ (none) ) -(defmethod ruffian-method-244 mog ((this mog)) +(defmethod ruffian-method-244 ((this mog)) (with-pp (ruffian-method-245 this) (let ((f30-0 (-> this nav state speed))) diff --git a/goal_src/jak2/levels/sewer/gator.gc b/goal_src/jak2/levels/sewer/gator.gc index de0204a4b95..823664c742e 100644 --- a/goal_src/jak2/levels/sewer/gator.gc +++ b/goal_src/jak2/levels/sewer/gator.gc @@ -14,21 +14,19 @@ (deftype gator (nav-enemy) "Cannot take damage due to it overriding [[enemy::56]]" - ((ocean-y float :offset-assert 604) - (lock-nav-target symbol :offset-assert 608) - (new-facing vector :inline :offset-assert 624) - (old-facing vector :inline :offset-assert 640) - (turn-time time-frame :offset-assert 656) + ((ocean-y float) + (lock-nav-target symbol) + (new-facing vector :inline) + (old-facing vector :inline) + (turn-time time-frame) ) - :heap-base #x220 - :method-count-assert 182 - :size-assert #x298 - :flag-assert #xb602200298 + (:state-methods + attack-forward + ) (:methods - (attack-forward () _type_ :state 178) - (adjust-depth! (_type_) float 179) - (update-facing! (_type_ vector) vector 180) - (encircle-target! (_type_ float float symbol) time-frame 181) + (adjust-depth! (_type_) float) + (update-facing! (_type_ vector) vector) + (encircle-target! (_type_ float float symbol) time-frame) ) ) @@ -144,7 +142,7 @@ (set! (-> *gator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler gator ((this gator) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) +(defmethod general-event-handler ((this gator) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case event-type @@ -164,14 +162,14 @@ ) ) -(defmethod adjust-depth! gator ((this gator)) +(defmethod adjust-depth! ((this gator)) "Changes the height based on the ocean depth @see [[get-height]]" (set! (-> this ocean-y) (get-height *ocean* (-> this root trans) #t)) (set! (-> this root trans y) (+ -10240.0 (-> this ocean-y))) ) -(defmethod update-facing! gator ((this gator) (arg0 vector)) +(defmethod update-facing! ((this gator) (arg0 vector)) "Updates the `new-facing` vector" (let ((matrix (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)))) (set! (-> arg0 quad) (-> matrix vector 2 quad)) @@ -179,7 +177,7 @@ arg0 ) -(defmethod encircle-target! gator ((this gator) (arg0 float) (arg1 float) (arg2 symbol)) +(defmethod encircle-target! ((this gator) (arg0 float) (arg1 float) (arg2 symbol)) "Core movement for the [[gator]], circles the target, charges at the target, etc @params TODO - not sure, they all dont seem to do very much and this method is a mess" (local-vars (v1-17 object) (a0-5 object)) @@ -276,7 +274,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod track-target! gator ((this gator)) +(defmethod track-target! ((this gator)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -290,16 +288,16 @@ (none) ) -(defmethod damage-amount-from-attack gator ((this gator) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this gator) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) -(defmethod go-hostile gator ((this gator)) +(defmethod go-hostile ((this gator)) (go (method-of-object this hostile)) ) -(defmethod get-enemy-target gator ((this gator)) +(defmethod get-enemy-target ((this gator)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" (let ((enemy-target ((method-of-type nav-enemy get-enemy-target) this))) (if (and enemy-target @@ -311,7 +309,7 @@ ) ) -(defmethod in-aggro-range? gator ((this gator) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this gator) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -511,12 +509,12 @@ ) ) -(defmethod coin-flip? gator ((this gator)) +(defmethod coin-flip? ((this gator)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod init-enemy-collision! gator ((this gator)) +(defmethod init-enemy-collision! ((this gator)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) @@ -589,7 +587,7 @@ (none) ) -(defmethod init-enemy! gator ((this gator)) +(defmethod init-enemy! ((this gator)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/sewer/grim2-course.gc b/goal_src/jak2/levels/sewer/grim2-course.gc index 6fd9cc8b196..bc0e17f2af0 100644 --- a/goal_src/jak2/levels/sewer/grim2-course.gc +++ b/goal_src/jak2/levels/sewer/grim2-course.gc @@ -9,15 +9,11 @@ (deftype grim-sewer (grim) () - :heap-base #x380 - :method-count-assert 246 - :size-assert #x400 - :flag-assert #xf603800400 ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle grim-sewer ((this grim-sewer)) +(defmethod go-idle ((this grim-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) (cleanup-for-death this) diff --git a/goal_src/jak2/levels/sewer/hal2-course.gc b/goal_src/jak2/levels/sewer/hal2-course.gc index 35ad420549a..ea468e43947 100644 --- a/goal_src/jak2/levels/sewer/hal2-course.gc +++ b/goal_src/jak2/levels/sewer/hal2-course.gc @@ -8,38 +8,31 @@ ;; DECOMP BEGINS (deftype hal2-course (bot-course) - ((sentries1-reminders (array int16) :offset-assert 48) - (sentries2-reminders (array int16) :offset-assert 52) - (bomb2-reminders bot-speech-list :offset-assert 56) + ((sentries1-reminders (array int16)) + (sentries2-reminders (array int16)) + (bomb2-reminders bot-speech-list) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) (deftype hal-sewer (hal) - ((hal2-course hal2-course :offset 652) - (sentries1-reminder-index int8 :offset-assert 1024) - (sentries2-reminder-index int8 :offset-assert 1025) - (test-plane plane :inline :offset 1040) + ((hal2-course hal2-course :overlay-at course) + (sentries1-reminder-index int8) + (sentries2-reminder-index int8) + (test-plane plane :inline :offset 1040) ) - :heap-base #x3a0 - :method-count-assert 232 - :size-assert #x420 - :flag-assert #xe803a00420 (:methods - (hal-sewer-method-227 (_type_) symbol 227) - (hal-sewer-method-228 (_type_) none 228) - (hal-sewer-method-229 (_type_) symbol 229) - (hal-sewer-method-230 (_type_ process-focusable process-focusable) symbol 230) - (hal-sewer-method-231 (_type_ int) symbol 231) + (hal-sewer-method-227 (_type_) symbol) + (hal-sewer-method-228 (_type_) none) + (hal-sewer-method-229 (_type_) symbol) + (hal-sewer-method-230 (_type_ process-focusable process-focusable) symbol) + (hal-sewer-method-231 (_type_ int) symbol) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle hal-sewer ((this hal-sewer)) +(defmethod go-idle ((this hal-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) (cleanup-for-death this) @@ -53,7 +46,7 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod init! hal-sewer ((this hal-sewer)) +(defmethod init! ((this hal-sewer)) "Set defaults for various fields." (let ((t9-0 (method-of-type hal init!))) (t9-0 this) @@ -63,7 +56,7 @@ (none) ) -(defmethod general-event-handler hal-sewer ((this hal-sewer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this hal-sewer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -173,7 +166,7 @@ ) ) -(defmethod hal-sewer-method-229 hal-sewer ((this hal-sewer)) +(defmethod hal-sewer-method-229 ((this hal-sewer)) (let ((a0-1 *target*)) (when a0-1 (let ((v1-1 (get-trans a0-1 0))) @@ -187,7 +180,7 @@ ) ) -(defmethod hal-sewer-method-231 hal-sewer ((this hal-sewer) (arg0 int)) +(defmethod hal-sewer-method-231 ((this hal-sewer) (arg0 int)) (countdown (v1-0 3) (let* ((a2-4 (-> this actor-group 0 data (+ arg0 v1-0) actor)) (a3-2 (if a2-4 @@ -203,7 +196,7 @@ #t ) -(defmethod hal-sewer-method-230 hal-sewer ((this hal-sewer) (arg0 process-focusable) (arg1 process-focusable)) +(defmethod hal-sewer-method-230 ((this hal-sewer) (arg0 process-focusable) (arg1 process-focusable)) (when (and arg0 arg1) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set! (-> gp-0 start-pos quad) (-> arg0 root trans quad)) @@ -222,7 +215,7 @@ ) ) -(defmethod hal-sewer-method-227 hal-sewer ((this hal-sewer)) +(defmethod hal-sewer-method-227 ((this hal-sewer)) (let* ((a0-1 (-> this actor-group 0 data 1 actor)) (v1-3 (if a0-1 (-> a0-1 extra process) @@ -273,7 +266,7 @@ ) ;; WARN: Return type mismatch bot-flags vs none. -(defmethod hal-sewer-method-228 hal-sewer ((this hal-sewer)) +(defmethod hal-sewer-method-228 ((this hal-sewer)) (with-pp (let ((s5-0 (-> this actor-group 0 data 18))) (cond diff --git a/goal_src/jak2/levels/sewer/hosehead-fake.gc b/goal_src/jak2/levels/sewer/hosehead-fake.gc index 4609447827b..568452f7b33 100644 --- a/goal_src/jak2/levels/sewer/hosehead-fake.gc +++ b/goal_src/jak2/levels/sewer/hosehead-fake.gc @@ -11,46 +11,41 @@ ;; DECOMP BEGINS (deftype hosehead-fake-spawn-info (basic) - ((id int32 :offset-assert 4) - (walk-dist float :offset-assert 8) - (handle handle :offset-assert 16) - (trans vector :inline :offset-assert 32) - (quat quaternion :inline :offset-assert 48) - (trans-x float :offset 32) - (trans-y float :offset 36) - (trans-z float :offset 40) - (trans-w float :offset 44) - (quat-x float :offset 48) - (quat-y float :offset 52) - (quat-z float :offset 56) - (quat-w float :offset 60) + ((id int32) + (walk-dist float) + (handle handle) + (trans vector :inline) + (quat quaternion :inline) + (trans-x float :overlay-at (-> trans data 0)) + (trans-y float :overlay-at (-> trans data 1)) + (trans-z float :overlay-at (-> trans data 2)) + (trans-w float :overlay-at (-> trans data 3)) + (quat-x float :overlay-at (-> quat data 0)) + (quat-y float :overlay-at (-> quat data 1)) + (quat-z float :overlay-at (-> quat data 2)) + (quat-w float :overlay-at (-> quat data 3)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype hosehead-fake (process-drawable) - ((info hosehead-fake-spawn-info :offset-assert 200) - (id int32 :offset-assert 204) - (walk-dest vector :inline :offset-assert 208) + ((info hosehead-fake-spawn-info) + (id int32) + (walk-dest vector :inline) ) - :heap-base #x60 - :method-count-assert 25 - :size-assert #xe0 - :flag-assert #x19006000e0 + (:state-methods + die-fast + idle + walk + ) (:methods - (die-fast () _type_ :state 20) - (idle () _type_ :state 21) - (walk () _type_ :state 22) - (debug-draw (_type_) none 23) - (print-def (_type_) none 24) + (debug-draw (_type_) none) + (print-def (_type_) none) ) ) -(defmethod print-def hosehead-fake ((this hosehead-fake)) +(defmethod print-def ((this hosehead-fake)) (let ((s5-0 (-> this root))) (format #t "~%") (format #t "(def-hosehead-fake~%") @@ -78,7 +73,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw hosehead-fake ((this hosehead-fake)) +(defmethod debug-draw ((this hosehead-fake)) (let ((a2-0 (-> this info))) (when a2-0 (if (!= (-> a2-0 walk-dist) 0.0) diff --git a/goal_src/jak2/levels/sewer/hosehead.gc b/goal_src/jak2/levels/sewer/hosehead.gc index e08c7648435..95150f97e50 100644 --- a/goal_src/jak2/levels/sewer/hosehead.gc +++ b/goal_src/jak2/levels/sewer/hosehead.gc @@ -59,55 +59,53 @@ ) (deftype hosehead (nav-enemy) - ((on-wall? symbol :offset-assert 604) - (sentry? symbol :offset-assert 608) - (shot-by-ruffian? symbol :offset-assert 612) - (on-stop-sentry function :offset-assert 616) - (jump-point vector :inline :offset-assert 624) - (last-time-dist-changed time-frame :offset-assert 640) - (next-lazer-time time-frame :offset-assert 648) - (fire-beam? symbol :offset-assert 656) - (head-angle degrees :offset-assert 660) - (head-angle-inc degrees :offset-assert 664) - (target-pos vector :inline :offset-assert 672) - (come-from-notice symbol :offset-assert 688) - (allow-head symbol :offset-assert 692) - (head-joint-mod joint-mod :offset-assert 696) - (joint-ik joint-mod-ik 4 :offset-assert 700) - (delta-y-ik float 4 :offset-assert 716) - (lazer-dist float :offset 740) - (lazer-pos-sound vector :inline :offset-assert 752) - (lazer-sound sound-id :offset-assert 768) - (lazer-sound2 sound-id :offset-assert 772) - (sync sync-eased :inline :offset-assert 776) - (angle-sentry degrees :offset-assert 820) - (lazer-length float :offset-assert 824) + ((on-wall? symbol) + (sentry? symbol) + (shot-by-ruffian? symbol) + (on-stop-sentry function) + (jump-point vector :inline) + (last-time-dist-changed time-frame) + (next-lazer-time time-frame) + (fire-beam? symbol) + (head-angle degrees) + (head-angle-inc degrees) + (target-pos vector :inline) + (come-from-notice symbol) + (allow-head symbol) + (head-joint-mod joint-mod) + (joint-ik joint-mod-ik 4) + (delta-y-ik float 4) + (lazer-dist float :offset 740) + (lazer-pos-sound vector :inline) + (lazer-sound sound-id) + (lazer-sound2 sound-id) + (sync sync-eased :inline) + (angle-sentry degrees) + (lazer-length float) ) - :heap-base #x2c0 - :method-count-assert 198 - :size-assert #x33c - :flag-assert #xc602c0033c + (:state-methods + ambush-land + idle-sentry + active-wall + notice-wall + hostile-sentry + fire + attack + ) (:methods - (ambush-land () _type_ :state 178) - (idle-sentry () _type_ :state 179) - (active-wall () _type_ :state 180) - (notice-wall () _type_ :state 181) - (hostile-sentry () _type_ :state 182) - (fire () _type_ :state 183) - (attack () _type_ :state 184) - (hosehead-method-185 (_type_) none 185) - (hosehead-method-186 (_type_) none 186) - (hosehead-method-187 (_type_ vector) none 187) - (hosehead-method-188 (_type_) none 188) - (hosehead-method-189 (_type_) none 189) - (hosehead-method-190 (_type_) symbol 190) - (hosehead-method-191 (_type_ vector vector) none 191) - (hosehead-method-192 (_type_ vector) symbol 192) - (hosehead-method-193 (_type_) none 193) - (hosehead-method-194 (_type_) none 194) - (hosehead-method-195 (_type_) symbol 195) - (hosehead-method-196 (_type_) none 196) - (hosehead-method-197 (_type_) none 197) + (hosehead-method-185 (_type_) none) + (hosehead-method-186 (_type_) none) + (hosehead-method-187 (_type_ vector) none) + (hosehead-method-188 (_type_) none) + (hosehead-method-189 (_type_) none) + (hosehead-method-190 (_type_) symbol) + (hosehead-method-191 (_type_ vector vector) none) + (hosehead-method-192 (_type_ vector) symbol) + (hosehead-method-193 (_type_) none) + (hosehead-method-194 (_type_) none) + (hosehead-method-195 (_type_) symbol) + (hosehead-method-196 (_type_) none) + (hosehead-method-197 (_type_) none) ) ) @@ -309,7 +307,7 @@ (set! (-> *hosehead-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod init-enemy-collision! hosehead ((this hosehead)) +(defmethod init-enemy-collision! ((this hosehead)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -381,12 +379,9 @@ ) (deftype ik-setup (structure) - ((elbow-index int32 :offset-assert 0) - (hand-dist float :offset-assert 4) + ((elbow-index int32) + (hand-dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -399,27 +394,21 @@ ) (deftype hosehead-anim-info (structure) - ((hit-index int32 :offset-assert 0) - (land-index int32 :offset-assert 4) + ((hit-index int32) + (land-index int32) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) (deftype hosehead-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (prev-knocked int8 :offset-assert 6) - (yellow-hit-anim hosehead-anim-info 2 :inline :offset-assert 8) - (blue-hit-anim hosehead-anim-info 3 :inline :offset 24) - (knocked-anim hosehead-anim-info 2 :inline :offset 48) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (prev-knocked int8) + (yellow-hit-anim hosehead-anim-info 2 :inline) + (blue-hit-anim hosehead-anim-info 3 :inline :offset 24) + (knocked-anim hosehead-anim-info 2 :inline :offset 48) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) @@ -440,7 +429,7 @@ ) ) -(defmethod enemy-method-77 hosehead ((this hosehead) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this hosehead) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) @@ -510,7 +499,7 @@ ) ) -(defmethod enemy-method-78 hosehead ((this hosehead) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this hosehead) (arg0 (pointer float))) (local-vars (v1-15 knocked-type)) (cond ((zero? (-> this hit-points)) @@ -560,7 +549,7 @@ ) ) -(defmethod hosehead-method-189 hosehead ((this hosehead)) +(defmethod hosehead-method-189 ((this hosehead)) (let ((a0-2 (handle->process (-> this focus handle)))) (when a0-2 (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -574,7 +563,7 @@ (none) ) -(defmethod hosehead-method-190 hosehead ((this hosehead)) +(defmethod hosehead-method-190 ((this hosehead)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -664,7 +653,7 @@ ) ) -(defmethod hosehead-method-197 hosehead ((this hosehead)) +(defmethod hosehead-method-197 ((this hosehead)) (let ((s2-0 (new 'stack-no-clear 'matrix))) (let* ((a2-0 (-> this node-list data 12 bone transform)) (v1-2 (-> a2-0 quad 0)) @@ -755,7 +744,7 @@ (none) ) -(defmethod enemy-method-88 hosehead ((this hosehead) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this hosehead) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.075)) (let ((a1-2 (-> this draw art-group data (-> this enemy-info jump-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -769,7 +758,7 @@ #t ) -(defmethod general-event-handler hosehead ((this hosehead) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this hosehead) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -805,7 +794,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod hosehead-method-186 hosehead ((this hosehead)) +(defmethod hosehead-method-186 ((this hosehead)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -921,7 +910,7 @@ ) ) -(defmethod hosehead-method-185 hosehead ((this hosehead)) +(defmethod hosehead-method-185 ((this hosehead)) (countdown (s5-0 (length (-> this actor-group 1))) (let* ((v1-5 (-> this actor-group 1 data s5-0 actor)) (a0-4 (if v1-5 @@ -1089,7 +1078,7 @@ ) ) -(defmethod hosehead-method-192 hosehead ((this hosehead) (arg0 vector)) +(defmethod hosehead-method-192 ((this hosehead) (arg0 vector)) (local-vars (a2-7 float) (a2-14 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -1211,7 +1200,7 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod hosehead-method-191 hosehead ((this hosehead) (arg0 vector) (arg1 vector)) +(defmethod hosehead-method-191 ((this hosehead) (arg0 vector) (arg1 vector)) (cond ((logtest? (-> this fact enemy-options) (enemy-option user10)) (countdown (s3-0 8) @@ -1403,7 +1392,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod hosehead-method-196 hosehead ((this hosehead)) +(defmethod hosehead-method-196 ((this hosehead)) (local-vars (sv-768 nav-control) (sv-784 vector) (sv-800 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1661,7 +1650,7 @@ ) ) -(defmethod hosehead-method-195 hosehead ((this hosehead)) +(defmethod hosehead-method-195 ((this hosehead)) (= *target* (handle->process (-> this focus handle))) ) @@ -1958,7 +1947,7 @@ ) ) -(defmethod hosehead-method-187 hosehead ((this hosehead) (arg0 vector)) +(defmethod hosehead-method-187 ((this hosehead) (arg0 vector)) (local-vars (sv-128 vector)) (set! sv-128 (new 'stack-no-clear 'vector)) (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -1992,7 +1981,7 @@ ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod hosehead-method-188 hosehead ((this hosehead)) +(defmethod hosehead-method-188 ((this hosehead)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-identity! gp-0) (quaternion-pseudo-seek (-> this head-joint-mod quat) (-> this head-joint-mod quat) gp-0 (seconds-per-frame)) @@ -2000,7 +1989,7 @@ (none) ) -(defmethod track-target! hosehead ((this hosehead)) +(defmethod track-target! ((this hosehead)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -2021,7 +2010,7 @@ (none) ) -(defmethod hosehead-method-194 hosehead ((this hosehead)) +(defmethod hosehead-method-194 ((this hosehead)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -2155,7 +2144,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod enemy-method-106 hosehead ((this hosehead) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 ((this hosehead) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) (t9-0 this arg0 arg1 arg2 arg3) ) @@ -2168,7 +2157,7 @@ (none) ) -(defmethod damage-amount-from-attack hosehead ((this hosehead) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this hosehead) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let* ((t9-0 (method-of-type nav-enemy damage-amount-from-attack)) (v0-0 (t9-0 this arg0 arg1)) @@ -2180,7 +2169,7 @@ ) ) -(defmethod enemy-method-58 hosehead ((this hosehead) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 ((this hosehead) (arg0 process) (arg1 event-message-block)) (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) (v0-0 (t9-0 this arg0 arg1)) ) @@ -2191,7 +2180,7 @@ ) ) -(defmethod relocate hosehead ((this hosehead) (arg0 int)) +(defmethod relocate ((this hosehead) (arg0 int)) (if (nonzero? (-> this head-joint-mod)) (&+! (-> this head-joint-mod) arg0) ) @@ -2203,7 +2192,7 @@ (call-parent-method this arg0) ) -(defmethod init-enemy! hosehead ((this hosehead)) +(defmethod init-enemy! ((this hosehead)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 res-tag) (sv-32 res-tag)) (stack-size-set! (-> this main-thread) 256) @@ -2320,11 +2309,11 @@ (none) ) -(defmethod go-ambush hosehead ((this hosehead)) +(defmethod go-ambush ((this hosehead)) (go (method-of-object this ambush)) ) -(defmethod go-hostile hosehead ((this hosehead)) +(defmethod go-hostile ((this hosehead)) (if (-> this sentry?) (go (method-of-object this hostile-sentry)) (go (method-of-object this hostile)) @@ -2332,7 +2321,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle hosehead ((this hosehead)) +(defmethod go-idle ((this hosehead)) (if (-> this sentry?) (go (method-of-object this idle-sentry)) (go (method-of-object this idle)) diff --git a/goal_src/jak2/levels/sewer/jinx2-course.gc b/goal_src/jak2/levels/sewer/jinx2-course.gc index 6cfe8df56b7..2f2d5941baa 100644 --- a/goal_src/jak2/levels/sewer/jinx2-course.gc +++ b/goal_src/jak2/levels/sewer/jinx2-course.gc @@ -9,15 +9,11 @@ (deftype jinx-sewer (jinx) () - :heap-base #x380 - :method-count-assert 246 - :size-assert #x400 - :flag-assert #xf603800400 ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle jinx-sewer ((this jinx-sewer)) +(defmethod go-idle ((this jinx-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) (cleanup-for-death this) diff --git a/goal_src/jak2/levels/sewer/mog2-course.gc b/goal_src/jak2/levels/sewer/mog2-course.gc index eb934c036ff..a149351bf4a 100644 --- a/goal_src/jak2/levels/sewer/mog2-course.gc +++ b/goal_src/jak2/levels/sewer/mog2-course.gc @@ -9,15 +9,11 @@ (deftype mog-sewer (mog) () - :heap-base #x380 - :method-count-assert 246 - :size-assert #x400 - :flag-assert #xf603800400 ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle mog-sewer ((this mog-sewer)) +(defmethod go-idle ((this mog-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) (cleanup-for-death this) diff --git a/goal_src/jak2/levels/sewer/sew-gunturret.gc b/goal_src/jak2/levels/sewer/sew-gunturret.gc index 9381a2fef25..61303520589 100644 --- a/goal_src/jak2/levels/sewer/sew-gunturret.gc +++ b/goal_src/jak2/levels/sewer/sew-gunturret.gc @@ -396,49 +396,42 @@ ) (deftype gun-turret-params (structure) - ((normal-sg skeleton-group :offset-assert 0) - (explode-sg skeleton-group :offset-assert 4) - (enemy-info enemy-info :offset-assert 8) - (idle-anim int32 :offset-assert 12) - (shoot-anim int32 :offset-assert 16) - (track-joint int32 :offset-assert 20) - (barrel-joint int32 :offset-assert 24) - (gun-joint int32 :offset-assert 28) - (hole-joints int32 8 :offset-assert 32) + ((normal-sg skeleton-group) + (explode-sg skeleton-group) + (enemy-info enemy-info) + (idle-anim int32) + (shoot-anim int32) + (track-joint int32) + (barrel-joint int32) + (gun-joint int32) + (hole-joints int32 8) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) (deftype sew-gunturret (enemy) - ((gun-tilt-jm joint-mod :offset-assert 532) - (params gun-turret-params :offset-assert 536) - (aim-pos vector :inline :offset-assert 544) - (gun-twist float :offset-assert 560) - (gun-tilt float :offset-assert 564) - (desired-twist float :offset-assert 568) - (desired-tilt float :offset-assert 572) - (los-clear symbol :offset-assert 576) - (smoke-part sparticle-launch-control :offset-assert 580) - (casing-part sparticle-launch-control :offset-assert 584) - (flash-state symbol :offset-assert 588) - (can-shoot symbol :offset-assert 592) - (last-hit-time time-frame :offset-assert 600) - (init-mat matrix :inline :offset-assert 608) - (activate-distance float :offset-assert 672) + ((gun-tilt-jm joint-mod) + (params gun-turret-params) + (aim-pos vector :inline) + (gun-twist float) + (gun-tilt float) + (desired-twist float) + (desired-tilt float) + (los-clear symbol) + (smoke-part sparticle-launch-control) + (casing-part sparticle-launch-control) + (flash-state symbol) + (can-shoot symbol) + (last-hit-time time-frame) + (init-mat matrix :inline) + (activate-distance float) ) - :heap-base #x230 - :method-count-assert 142 - :size-assert #x2a4 - :flag-assert #x8e023002a4 (:methods - (aim-turret! (_type_ symbol) none 137) - (update-collision! (_type_) none 138) - (set-aim-at-default! (_type_) none 139) - (fire-turret! (_type_ symbol) none 140) - (init-turret-params! (_type_) none 141) + (aim-turret! (_type_ symbol) none) + (update-collision! (_type_) none) + (set-aim-at-default! (_type_) none) + (fire-turret! (_type_ symbol) none) + (init-turret-params! (_type_) none) ) ) @@ -525,7 +518,7 @@ (set! (-> *sew-gunturret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod aim-turret! sew-gunturret ((this sew-gunturret) (aim-at-target? symbol)) +(defmethod aim-turret! ((this sew-gunturret) (aim-at-target? symbol)) "Calculates the angle and tilt for the turret to either aim at the target, or it's default direction @param aim-at-target? Whether or not the turret should aim at the target, will ignore the target if #f" (cond @@ -601,7 +594,7 @@ (none) ) -(defmethod update-collision! sew-gunturret ((this sew-gunturret)) +(defmethod update-collision! ((this sew-gunturret)) "Updates the collision for the turret based on it's aiming direction" (let ((target-proc (handle->process (-> this focus handle)))) (if target-proc @@ -640,14 +633,14 @@ (none) ) -(defmethod set-aim-at-default! sew-gunturret ((this sew-gunturret)) +(defmethod set-aim-at-default! ((this sew-gunturret)) "Aims the turret at it's default direction. Sets `aim-pos` accordingly" (vector+float*! (-> this aim-pos) (-> this root trans) (-> this init-mat vector 2) 163840.0) 0 (none) ) -(defmethod fire-turret! sew-gunturret ((this sew-gunturret) (fire-sound? symbol)) +(defmethod fire-turret! ((this sew-gunturret) (fire-sound? symbol)) "Actually fires the turret, sets `flash-state` to [[#t]] @param fire-sound? Whether to play the fire sound effect or not" (let ((v1-4 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params gun-joint)))) @@ -794,7 +787,7 @@ ) ) -(defmethod general-event-handler sew-gunturret ((this sew-gunturret) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) +(defmethod general-event-handler ((this sew-gunturret) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (if (and (= event-type 'notify) (< 1 arg2) (= (-> event param 0) 'attack) (= (-> event param 1) *target*)) @@ -883,7 +876,7 @@ ) ) -(defmethod init-enemy-collision! sew-gunturret ((this sew-gunturret)) +(defmethod init-enemy-collision! ((this sew-gunturret)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) @@ -943,7 +936,7 @@ (none) ) -(defmethod in-aggro-range? sew-gunturret ((this sew-gunturret) (proc process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this sew-gunturret) (proc process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -967,7 +960,7 @@ (the-as symbol 0) ) -(defmethod deactivate sew-gunturret ((this sew-gunturret)) +(defmethod deactivate ((this sew-gunturret)) (if (nonzero? (-> this smoke-part)) (kill-and-free-particles (-> this smoke-part)) ) @@ -978,13 +971,13 @@ (none) ) -(defmethod coin-flip? sew-gunturret ((this sew-gunturret)) +(defmethod coin-flip? ((this sew-gunturret)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch enemy vs sew-gunturret. -(defmethod relocate sew-gunturret ((this sew-gunturret) (arg0 int)) +(defmethod relocate ((this sew-gunturret) (arg0 int)) (if (nonzero? (-> this gun-tilt-jm)) (&+! (-> this gun-tilt-jm) arg0) ) @@ -997,7 +990,7 @@ (the-as sew-gunturret ((method-of-type enemy relocate) this arg0)) ) -(defmethod init-turret-params! sew-gunturret ((this sew-gunturret)) +(defmethod init-turret-params! ((this sew-gunturret)) (let ((turret-params (new 'static 'gun-turret-params :idle-anim 2 @@ -1025,7 +1018,7 @@ (none) ) -(defmethod init-enemy! sew-gunturret ((this sew-gunturret)) +(defmethod init-enemy! ((this sew-gunturret)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init-turret-params! this) (initialize-skeleton this (-> this params normal-sg) (the-as pair 0)) @@ -1053,7 +1046,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sew-gunturret ((this sew-gunturret)) +(defmethod go-idle ((this sew-gunturret)) (cond ((task-node-closed? (game-task-node sewer-enemy-blow-up-turrets)) (cleanup-for-death this) @@ -1160,29 +1153,25 @@ (deftype pal-gun-turret (sew-gunturret) () - :heap-base #x230 - :method-count-assert 142 - :size-assert #x2a4 - :flag-assert #x8e023002a4 (:methods - (fire-turret! (_type_ symbol) float :replace 140) + (fire-turret! (_type_ symbol) float :replace) ) ) -(defmethod fire-turret! pal-gun-turret ((this pal-gun-turret) (arg0 symbol)) +(defmethod fire-turret! ((this pal-gun-turret) (arg0 symbol)) "@overrides Calls [[sew-gunturret::140]] but also customizes the turret flash via [[set-palcab-turret-flash!]]" (call-parent-method this arg0) (set-palcab-turret-flash! 1.0) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle pal-gun-turret ((this pal-gun-turret)) +(defmethod go-idle ((this pal-gun-turret)) (go (method-of-object this idle)) (none) ) -(defmethod init-turret-params! pal-gun-turret ((this pal-gun-turret)) +(defmethod init-turret-params! ((this pal-gun-turret)) (let ((turret-params (new 'static 'gun-turret-params :idle-anim 2 diff --git a/goal_src/jak2/levels/sewer/sewer-obs.gc b/goal_src/jak2/levels/sewer/sewer-obs.gc index ed485cc6ad0..b5139f5f5d6 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs.gc @@ -8,24 +8,20 @@ ;; DECOMP BEGINS (deftype sew-blade (process-drawable) - ((y-min float :offset-assert 200) - (y-max float :offset-assert 204) - (snd-water sound-name :offset-assert 208) - (snd-no-water sound-name :offset-assert 224) - (last-sound int32 :offset-assert 240) - (attack-id uint32 :offset-assert 244) + ((y-min float) + (y-max float) + (snd-water sound-name) + (snd-no-water sound-name) + (last-sound int32) + (attack-id uint32) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #xf8 - :flag-assert #x15008000f8 (:methods - (update-sound! (_type_) none 20) + (update-sound! (_type_) none) ) ) -(defmethod update-sound! sew-blade ((this sew-blade)) +(defmethod update-sound! ((this sew-blade)) "Updates the sound of the [[sew-blade]] based on if it's under or above the water" (when (nonzero? (-> this sound)) (let ((f30-0 (+ (-> this root trans y) (-> this y-max))) @@ -58,14 +54,10 @@ ) (deftype sew-single-blade (sew-blade) - ((quat quaternion :inline :offset-assert 256) + ((quat quaternion :inline) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x110 - :flag-assert #x1600900110 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) @@ -122,7 +114,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-single-blade ((this sew-single-blade) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sew-single-blade) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -179,16 +171,12 @@ This commonly includes things such as: ) (deftype sew-tri-blade (sew-blade) - ((anim-time float :offset-assert 248) - (anim-offset float :offset-assert 252) - (switch-state int32 :offset-assert 256) + ((anim-time float) + (anim-offset float) + (switch-state int32) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x104 - :flag-assert #x1600900104 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) @@ -309,7 +297,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-tri-blade ((this sew-tri-blade) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-tri-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -393,12 +381,8 @@ This commonly includes things such as: (deftype sew-arm-blade (sew-blade) () - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf8 - :flag-assert #x16008000f8 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) @@ -448,7 +432,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-arm-blade ((this sew-arm-blade) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-arm-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -505,12 +489,8 @@ This commonly includes things such as: (deftype sew-multi-blade (sew-blade) () - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf8 - :flag-assert #x16008000f8 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) @@ -567,7 +547,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-multi-blade ((this sew-multi-blade) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-multi-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -623,15 +603,11 @@ This commonly includes things such as: ) (deftype sew-twist-blade (sew-blade) - ((root-overide collide-shape-moving :offset 128) - (no-collision-timer uint64 :offset-assert 248) + ((root-overide collide-shape-moving :overlay-at root) + (no-collision-timer uint64) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #x100 - :flag-assert #x1600800100 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) @@ -715,7 +691,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-twist-blade ((this sew-twist-blade) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-twist-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -771,37 +747,33 @@ This commonly includes things such as: ) (deftype sew-light-switch (process-drawable) - ((light-state symbol :offset-assert 200) - (actor-group (pointer actor-group) :offset-assert 204) - (actor-group-count int32 :offset-assert 208) + ((light-state symbol) + (actor-group (pointer actor-group)) + (actor-group-count int32) ) - :heap-base #x60 - :method-count-assert 24 - :size-assert #xd4 - :flag-assert #x18006000d4 + (:state-methods + idle + pressed + ) (:methods - (idle () _type_ :state 20) - (pressed () _type_ :state 21) - (init-switch-collision! (_type_) none 22) - (broadcast-to-actors (_type_ symbol) none 23) + (init-switch-collision! (_type_) none) + (broadcast-to-actors (_type_ symbol) none) ) ) (deftype sew-light-control (process) - ((search-switches basic :offset-assert 128) - (search-turrets basic :offset-assert 132) - (switch-ent entity-actor :offset-assert 136) - (turret-ent entity-actor :offset-assert 140) + ((search-switches basic) + (search-turrets basic) + (switch-ent entity-actor) + (turret-ent entity-actor) ) - :heap-base #x10 - :method-count-assert 17 - :size-assert #x90 - :flag-assert #x1100100090 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (press! (_type_ symbol symbol) float 15) - (sew-light-control-method-16 (_type_ object vector float) symbol 16) + (press! (_type_ symbol symbol) float) + (sew-light-control-method-16 (_type_ object vector float) symbol) ) ) @@ -875,7 +847,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-switch-collision! sew-light-switch ((this sew-light-switch)) +(defmethod init-switch-collision! ((this sew-light-switch)) "Initializes the collision on the switch" (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) @@ -903,7 +875,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod broadcast-to-actors sew-light-switch ((this sew-light-switch) (event-type symbol)) +(defmethod broadcast-to-actors ((this sew-light-switch) (event-type symbol)) "Broadcast event to all associated [[entity]]s via the `actor-group`s @param `event-type` the symbol to broadcast" (with-pp @@ -936,7 +908,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-light-switch ((this sew-light-switch) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-light-switch) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1045,7 +1017,7 @@ This commonly includes things such as: ) ) -(defmethod press! sew-light-control ((this sew-light-control) (switched-on? symbol) (should-turret-flash? symbol)) +(defmethod press! ((this sew-light-control) (switched-on? symbol) (should-turret-flash? symbol)) "Turns the lights on (or off) @param switched-on? Should the sewer lights be turned on or off? @param should-turret-flash? Should the turret have it's `flash` set as well" diff --git a/goal_src/jak2/levels/sewer/sewer-obs2.gc b/goal_src/jak2/levels/sewer/sewer-obs2.gc index 4ca8b909c09..9e0393f5fed 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs2.gc @@ -8,14 +8,10 @@ ;; DECOMP BEGINS (deftype sew-elevator (elevator) - ((sound-id sound-id :offset-assert 368) + ((sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 50 - :size-assert #x174 - :flag-assert #x3201000174 (:methods - (configure-collision (_type_ symbol) none 49) + (configure-collision (_type_ symbol) none) ) ) @@ -25,12 +21,12 @@ :bounds (static-spherem 0 0 5.6 9.2) ) -(defmethod get-art-group sew-elevator ((this sew-elevator)) +(defmethod get-art-group ((this sew-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-sew-elevator" (the-as (pointer uint32) #f)) ) -(defmethod move-between-points sew-elevator ((this sew-elevator) (arg1 vector) (point-a float) (point-b float)) +(defmethod move-between-points ((this sew-elevator) (arg1 vector) (point-a float) (point-b float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -49,7 +45,7 @@ ) ) -(defmethod commited-to-ride? sew-elevator ((this sew-elevator)) +(defmethod commited-to-ride? ((this sew-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((target *target*) (target-proc (if (type? target process-focusable) @@ -71,7 +67,7 @@ ) ) -(defmethod configure-collision sew-elevator ((this sew-elevator) (collide-with-jak? symbol)) +(defmethod configure-collision ((this sew-elevator) (collide-with-jak? symbol)) "Appropriately sets the collision on the elevator @param collide-with-jak? If set, the elevator will collide with Jak" (let ((prim-group (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) @@ -134,13 +130,13 @@ ) ) -(defmethod deactivate sew-elevator ((this sew-elevator)) +(defmethod deactivate ((this sew-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) ) -(defmethod init-plat! sew-elevator ((this sew-elevator)) +(defmethod init-plat! ((this sew-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this sound-id) (new-sound-id)) @@ -148,7 +144,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod init-defaults! sew-elevator ((this sew-elevator)) +(defmethod init-defaults! ((this sew-elevator)) "Initializes default settings related to the [[elevator]]: - `elevator-xz-threshold` - `elevator-y-threshold` @@ -174,7 +170,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod init-plat-collision! sew-elevator ((this sew-elevator)) +(defmethod init-plat-collision! ((this sew-elevator)) "TODO - collision stuff for setting up the platform" (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) @@ -216,20 +212,16 @@ For example for an elevator pre-compute the distance between the first and last ) (deftype sew-valve (process-drawable) - ((joint joint-mod-rotate-local :offset-assert 200) - (actor-group (pointer actor-group) :offset-assert 204) - (actor-group-count int32 :offset-assert 208) - (water-height float :offset-assert 212) - (spin float :offset-assert 216) - (spin-rate float :offset-assert 220) + ((joint joint-mod-rotate-local) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (water-height float) + (spin float) + (spin-rate float) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xe0 - :flag-assert #x16006000e0 - (:methods - (idle () _type_ :state 20) - (turn () _type_ :state 21) + (:state-methods + idle + turn ) ) @@ -313,7 +305,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod relocate sew-valve ((this sew-valve) (arg0 int)) +(defmethod relocate ((this sew-valve) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -321,7 +313,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-valve ((this sew-valve) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-valve) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -380,39 +372,27 @@ This commonly includes things such as: (deftype sew-mar-statue-debris (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype sew-mar-statue-debris-b (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype sew-mar-statue (process-drawable) - ((root collide-shape :override) - (spawned-debris? symbol :offset-assert 200) + ((root collide-shape :override) + (spawned-debris? symbol) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16005000cc - (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) + (:state-methods + idle + hidden ) ) @@ -545,7 +525,7 @@ This commonly includes things such as: ) ) -(defmethod run-logic? sew-mar-statue ((this sew-mar-statue)) +(defmethod run-logic? ((this sew-mar-statue)) #t ) @@ -576,7 +556,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-mar-statue ((this sew-mar-statue) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-mar-statue) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -625,10 +605,6 @@ This commonly includes things such as: (deftype sew-catwalk (drop-plat) () - :heap-base #xc0 - :method-count-assert 36 - :size-assert #x140 - :flag-assert #x2400c00140 ) @@ -638,7 +614,7 @@ This commonly includes things such as: :origin-joint-index 3 ) -(defmethod start-bouncing! sew-catwalk ((this sew-catwalk)) +(defmethod start-bouncing! ((this sew-catwalk)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" @@ -682,7 +658,7 @@ and translate the platform via the `smush` ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-catwalk ((this sew-catwalk) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-catwalk) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -774,17 +750,15 @@ This commonly includes things such as: ) (deftype sew-mine (process-drawable) - ((root collide-shape-moving :override) - (last-time time-frame :offset-assert 200) + ((root collide-shape-moving :override) + (last-time time-frame) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xd0 - :flag-assert #x17005000d0 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (init-mine! (_type_) none 22) + (init-mine! (_type_) none) ) ) @@ -893,7 +867,7 @@ This commonly includes things such as: ) ) -(defmethod init-mine! sew-mine ((this sew-mine)) +(defmethod init-mine! ((this sew-mine)) "Initializes the mine's particles and sets `last-time` to `0`" (set! (-> this part) (create-launch-control (-> *part-group-id-table* 345) this)) (set! (-> this last-time) 0) @@ -903,10 +877,6 @@ This commonly includes things such as: (deftype sew-mine-a (sew-mine) () - :heap-base #x50 - :method-count-assert 23 - :size-assert #xd0 - :flag-assert #x17005000d0 ) @@ -916,7 +886,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-mine-a ((this sew-mine-a) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-mine-a) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -953,15 +923,11 @@ This commonly includes things such as: ) (deftype sew-mine-b (sew-mine) - ((base-height float :offset-assert 208) - (center vector :inline :offset-assert 224) - (time-skew uint64 :offset-assert 240) - (period float :offset-assert 248) + ((base-height float) + (center vector :inline) + (time-skew uint64) + (period float) ) - :heap-base #x80 - :method-count-assert 23 - :size-assert #xfc - :flag-assert #x17008000fc ) @@ -1000,7 +966,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-mine-b ((this sew-mine-b) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-mine-b) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1054,21 +1020,19 @@ This commonly includes things such as: ) (deftype sew-wall (process-focusable) - ((deadly-radius float :offset-assert 204) - (prev-deadly-radius float :offset-assert 208) - (attack-id uint32 :offset-assert 212) - (first-wall? symbol :offset-assert 216) - (anim spool-anim :offset-assert 220) - (art-name string :offset-assert 224) + ((deadly-radius float) + (prev-deadly-radius float) + (attack-id uint32) + (first-wall? symbol) + (anim spool-anim) + (art-name string) ) - :heap-base #x70 - :method-count-assert 30 - :size-assert #xe4 - :flag-assert #x1e007000e4 + (:state-methods + idle + (hit symbol) + ) (:methods - (idle () _type_ :state 27) - (hit (symbol) _type_ :state 28) - (attack-target! (_type_) none 29) + (attack-target! (_type_) none) ) ) @@ -1080,7 +1044,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch float vs none. -(defmethod attack-target! sew-wall ((this sew-wall)) +(defmethod attack-target! ((this sew-wall)) "If the target is close enough to the wall, hit it!" (let ((target *target*)) (when target @@ -1226,7 +1190,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-wall ((this sew-wall) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-wall) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1343,12 +1307,8 @@ This commonly includes things such as: (deftype sew-grill (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1374,7 +1334,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-grill ((this sew-grill) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-grill) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1393,18 +1353,14 @@ This commonly includes things such as: ) (deftype sew-scare-grunt (grunt) - ((anim spool-anim :offset-assert 692) - (manipy (pointer manipy) :offset-assert 696) - (spooled-sound-id sound-id :offset-assert 700) - (grill-actor entity-actor :offset-assert 704) + ((anim spool-anim) + (manipy (pointer manipy)) + (spooled-sound-id sound-id) + (grill-actor entity-actor) ) - :heap-base #x250 - :method-count-assert 188 - :size-assert #x2c4 - :flag-assert #xbc025002c4 - (:methods - (waiting () _type_ :state 186) - (scare () _type_ :state 187) + (:state-methods + waiting + scare ) ) @@ -1680,12 +1636,12 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sew-scare-grunt ((this sew-scare-grunt)) +(defmethod go-idle ((this sew-scare-grunt)) (go (method-of-object this waiting)) (none) ) -(defmethod init-enemy-collision! sew-scare-grunt ((this sew-scare-grunt)) +(defmethod init-enemy-collision! ((this sew-scare-grunt)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (stack-size-set! (-> this main-thread) 512) (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -1773,13 +1729,13 @@ This commonly includes things such as: (none) ) -(defmethod get-enemy-info sew-scare-grunt ((this sew-scare-grunt)) +(defmethod get-enemy-info ((this sew-scare-grunt)) "@returns the [[nav-enemy-info]] associated with this type of grunt" *sew-scare-grunt-nav-enemy-info* ) ;; WARN: Return type mismatch float vs none. -(defmethod init-enemy! sew-scare-grunt ((this sew-scare-grunt)) +(defmethod init-enemy! ((this sew-scare-grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (set! (-> this anim) (new 'static 'spool-anim :name "sew-scare-grunt" :anim-name "sew-scare-grunt" :parts 2 :command-list '()) diff --git a/goal_src/jak2/levels/sewer/sewer-part.gc b/goal_src/jak2/levels/sewer/sewer-part.gc index dbd506f024a..03ec950e0c7 100644 --- a/goal_src/jak2/levels/sewer/sewer-part.gc +++ b/goal_src/jak2/levels/sewer/sewer-part.gc @@ -9,10 +9,6 @@ (deftype sewer-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/sewer/sewer-scenes.gc b/goal_src/jak2/levels/sewer/sewer-scenes.gc index 29cbb60735d..f57a9aca6a6 100644 --- a/goal_src/jak2/levels/sewer/sewer-scenes.gc +++ b/goal_src/jak2/levels/sewer/sewer-scenes.gc @@ -940,11 +940,8 @@ ) (deftype fake-jinx-bomb-info (basic) - ((handle handle :offset-assert 8) + ((handle handle) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) @@ -1208,7 +1205,7 @@ ) ) -(defmethod draw hud-gunturret ((this hud-gunturret)) +(defmethod draw ((this hud-gunturret)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -1221,14 +1218,14 @@ (none) ) -(defmethod update-values hud-gunturret ((this hud-gunturret)) +(defmethod update-values ((this hud-gunturret)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-gunturret ((this hud-gunturret)) +(defmethod init-callback ((this hud-gunturret)) (set! (-> this level) (level-get *level* 'sewerb)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) diff --git a/goal_src/jak2/levels/stadium/racebike.gc b/goal_src/jak2/levels/stadium/racebike.gc index 0122e0cea37..c65555a856c 100644 --- a/goal_src/jak2/levels/stadium/racebike.gc +++ b/goal_src/jak2/levels/stadium/racebike.gc @@ -758,23 +758,19 @@ (set! (-> *race-bike-e-constants* explosion) *bike-explosion-info*) (deftype vehicle-race-bike (vehicle-racer) - ((steering-wheel joint-mod :offset-assert 1016) + ((steering-wheel joint-mod) ) - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3fc - :flag-assert #x9c038003fc ) -(defmethod relocate vehicle-race-bike ((this vehicle-race-bike) (arg0 int)) +(defmethod relocate ((this vehicle-race-bike) (arg0 int)) (if (nonzero? (-> this steering-wheel)) (&+! (-> this steering-wheel) arg0) ) (call-parent-method this arg0) ) -(defmethod update-joint-mods vehicle-race-bike ((this vehicle-race-bike)) +(defmethod update-joint-mods ((this vehicle-race-bike)) (let ((f0-1 (* -5461.3335 (-> this controls steering))) (a1-0 (new 'static 'vector :z 1.0 :w 1.0)) ) @@ -786,14 +782,10 @@ (deftype race-bike-d (vehicle-race-bike) () - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3fc - :flag-assert #x9c038003fc ) -(defmethod allocate-and-init-cshape race-bike-d ((this race-bike-d)) +(defmethod allocate-and-init-cshape ((this race-bike-d)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -838,7 +830,7 @@ (none) ) -(defmethod init-skel-and-rigid-body race-bike-d ((this race-bike-d)) +(defmethod init-skel-and-rigid-body ((this race-bike-d)) (race-vehicle-entity-hack) (initialize-skeleton this @@ -857,14 +849,10 @@ (deftype race-bike-e (vehicle-race-bike) () - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3fc - :flag-assert #x9c038003fc ) -(defmethod allocate-and-init-cshape race-bike-e ((this race-bike-e)) +(defmethod allocate-and-init-cshape ((this race-bike-e)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -909,7 +897,7 @@ (none) ) -(defmethod init-skel-and-rigid-body race-bike-e ((this race-bike-e)) +(defmethod init-skel-and-rigid-body ((this race-bike-e)) (race-vehicle-entity-hack) (initialize-skeleton this diff --git a/goal_src/jak2/levels/stadium/skate/skatea-obs.gc b/goal_src/jak2/levels/stadium/skate/skatea-obs.gc index 8970b8e119d..5f58b031272 100644 --- a/goal_src/jak2/levels/stadium/skate/skatea-obs.gc +++ b/goal_src/jak2/levels/stadium/skate/skatea-obs.gc @@ -8,60 +8,58 @@ ;; DECOMP BEGINS (deftype hoverboard-training-manager (process) - ((actor-group (pointer actor-group) :offset-assert 128) - (actor-group-count int32 :offset-assert 132) - (trick-type board-tricks :offset-assert 136) - (board-picked-up symbol :offset-assert 140) - (boost symbol :offset-assert 144) - (grind symbol :offset-assert 148) - (text symbol :offset-assert 152) - (score float :offset-assert 156) - (challenge-done symbol :offset-assert 160) - (arrow handle :offset-assert 168) - (minimap connection-minimap :offset-assert 176) - (hud-score handle :offset-assert 184) - (hud-goal handle :offset-assert 192) - (voicebox handle :offset-assert 200) - (last-sound-id sound-id :offset-assert 208) - (combo-done? symbol :offset-assert 212) - (task-gold uint16 :offset-assert 216) - (task-silver uint16 :offset-assert 218) - (task-bronze uint16 :offset-assert 220) - (game-score uint8 :offset-assert 222) - (training? symbol :offset-assert 224) - (training-goal float :offset-assert 228) - (egg-count int32 :offset-assert 232) - (medal int32 :offset-assert 236) - (gui-id sound-id :offset-assert 240) - (hint-time time-frame :offset-assert 248) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (trick-type board-tricks) + (board-picked-up symbol) + (boost symbol) + (grind symbol) + (text symbol) + (score float) + (challenge-done symbol) + (arrow handle) + (minimap connection-minimap) + (hud-score handle) + (hud-goal handle) + (voicebox handle) + (last-sound-id sound-id) + (combo-done? symbol) + (task-gold uint16) + (task-silver uint16) + (task-bronze uint16) + (game-score uint8) + (training? symbol) + (training-goal float) + (egg-count int32) + (medal int32) + (gui-id sound-id) + (hint-time time-frame) ) - :heap-base #x80 - :method-count-assert 31 - :size-assert #x100 - :flag-assert #x1f00800100 + (:state-methods + wait-for-pickup + wait-for-pickup-training + wait-for-board + wait + jump + duck-jump + boost-jump + grind + spin + flip + trick + game + idle + idle-training + ) (:methods - (wait-for-pickup () _type_ :state 14) - (wait-for-pickup-training () _type_ :state 15) - (wait-for-board () _type_ :state 16) - (wait () _type_ :state 17) - (jump () _type_ :state 18) - (duck-jump () _type_ :state 19) - (boost-jump () _type_ :state 20) - (grind () _type_ :state 21) - (spin () _type_ :state 22) - (flip () _type_ :state 23) - (trick () _type_ :state 24) - (game () _type_ :state 25) - (idle () _type_ :state 26) - (idle-training () _type_ :state 27) - (render-text (_type_ text-id) float 28) - (hoverboard-training-manager-method-29 (_type_) none 29) - (hoverboard-training-manager-method-30 (_type_) none 30) + (render-text (_type_ text-id) float) + (hoverboard-training-manager-method-29 (_type_) none) + (hoverboard-training-manager-method-30 (_type_) none) ) ) -(defmethod render-text hoverboard-training-manager ((this hoverboard-training-manager) (arg0 text-id)) +(defmethod render-text ((this hoverboard-training-manager) (arg0 text-id)) (when (= (get-status *gui-control* (-> this gui-id)) (gui-status active)) (let ((s5-1 (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) @@ -661,7 +659,7 @@ ) ) -(defmethod hoverboard-training-manager-method-29 hoverboard-training-manager ((this hoverboard-training-manager)) +(defmethod hoverboard-training-manager-method-29 ((this hoverboard-training-manager)) (let ((s5-0 (get-game-score-ref *game-info* (the-as int (-> this game-score)))) (gp-0 (handle->process (-> this hud-goal))) ) @@ -830,7 +828,7 @@ (none) ) -(defmethod hoverboard-training-manager-method-30 hoverboard-training-manager ((this hoverboard-training-manager)) +(defmethod hoverboard-training-manager-method-30 ((this hoverboard-training-manager)) (set! (-> this egg-count) 0) (set! (-> this medal) 0) (let ((s5-0 (get-game-score-ref *game-info* (the-as int (-> this game-score))))) @@ -1311,14 +1309,14 @@ ) ) -(defmethod deactivate hoverboard-training-manager ((this hoverboard-training-manager)) +(defmethod deactivate ((this hoverboard-training-manager)) (send-event *traffic-manager* 'restore-default-settings) (call-parent-method this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hoverboard-training-manager ((this hoverboard-training-manager) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hoverboard-training-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1398,15 +1396,13 @@ This commonly includes things such as: ) (deftype skate-training-ramp (process-focusable) - ((onoff symbol :offset-assert 204) + ((onoff symbol) ) - :heap-base #x50 - :method-count-assert 29 - :size-assert #xd0 - :flag-assert #x1d005000d0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (skate-training-ramp-method-28 (_type_) collide-shape-moving 28) + (skate-training-ramp-method-28 (_type_) collide-shape-moving) ) ) @@ -1450,7 +1446,7 @@ This commonly includes things such as: ) ) -(defmethod skate-training-ramp-method-28 skate-training-ramp ((this skate-training-ramp)) +(defmethod skate-training-ramp-method-28 ((this skate-training-ramp)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1492,7 +1488,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! skate-training-ramp ((this skate-training-ramp) (arg0 entity-actor)) +(defmethod init-from-entity! ((this skate-training-ramp) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1523,16 +1519,14 @@ This commonly includes things such as: ) (deftype skate-gate (process-focusable) - ((onoff symbol :offset-assert 204) + ((onoff symbol) ) - :heap-base #x50 - :method-count-assert 30 - :size-assert #xd0 - :flag-assert #x1e005000d0 + (:state-methods + idle + open + ) (:methods - (idle () _type_ :state 27) - (open () _type_ :state 28) - (skate-gate-method-29 (_type_) collide-shape-moving 29) + (skate-gate-method-29 (_type_) collide-shape-moving) ) ) @@ -1587,7 +1581,7 @@ This commonly includes things such as: :code sleep-code ) -(defmethod skate-gate-method-29 skate-gate ((this skate-gate)) +(defmethod skate-gate-method-29 ((this skate-gate)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1615,7 +1609,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! skate-gate ((this skate-gate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this skate-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1666,14 +1660,10 @@ This commonly includes things such as: (deftype skatea-jump-pad (bouncer) () - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd4 - :flag-assert #x19006000d4 ) -(defmethod init-skeleton! skatea-jump-pad ((this skatea-jump-pad)) +(defmethod init-skeleton! ((this skatea-jump-pad)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-skatea-jump-pad" (the-as (pointer uint32) #f))) @@ -1683,7 +1673,7 @@ This commonly includes things such as: (none) ) -(defmethod bouncer-method-24 skatea-jump-pad ((this skatea-jump-pad)) +(defmethod bouncer-method-24 ((this skatea-jump-pad)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1774,16 +1764,14 @@ This commonly includes things such as: ) (deftype skatea-floating-ring (process-focusable) - ((pos-y float :offset-assert 204) - (offset float :offset-assert 208) + ((pos-y float) + (offset float) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd4 - :flag-assert #x1d006000d4 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (skatea-floating-ring-method-28 (_type_) none 28) + (skatea-floating-ring-method-28 (_type_) none) ) ) @@ -1835,7 +1823,7 @@ This commonly includes things such as: ) ) -(defmethod skatea-floating-ring-method-28 skatea-floating-ring ((this skatea-floating-ring)) +(defmethod skatea-floating-ring-method-28 ((this skatea-floating-ring)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1863,7 +1851,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! skatea-floating-ring ((this skatea-floating-ring) (arg0 entity-actor)) +(defmethod init-from-entity! ((this skatea-floating-ring) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/stadium/skate/skatea-part.gc b/goal_src/jak2/levels/stadium/skate/skatea-part.gc index 8c3b8d33b97..87df61b5afe 100644 --- a/goal_src/jak2/levels/stadium/skate/skatea-part.gc +++ b/goal_src/jak2/levels/stadium/skate/skatea-part.gc @@ -9,10 +9,6 @@ (deftype skatea-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/stadium/stadium-obs.gc b/goal_src/jak2/levels/stadium/stadium-obs.gc index 64892f733d6..1b315e171a4 100644 --- a/goal_src/jak2/levels/stadium/stadium-obs.gc +++ b/goal_src/jak2/levels/stadium/stadium-obs.gc @@ -11,10 +11,6 @@ (deftype water-anim-stadium (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) @@ -32,7 +28,7 @@ ) ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-stadium ((this water-anim-stadium)) +(defmethod init-water! ((this water-anim-stadium)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) (t9-0 this) @@ -50,12 +46,8 @@ (deftype dummy-vehicle (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -72,7 +64,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dummy-vehicle ((this dummy-vehicle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dummy-vehicle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -158,12 +150,8 @@ This commonly includes things such as: (deftype gar-curtain (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -184,7 +172,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gar-curtain ((this gar-curtain) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gar-curtain) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -252,29 +240,25 @@ This commonly includes things such as: ) (deftype rift-rider (rigid-body-object) - ((escort-actor entity-actor 2 :offset-assert 272) - (escort-force vector 2 :inline :offset-assert 288) - (brutter-balloon-actor entity-actor :offset-assert 320) - (path-pos float :offset-assert 324) - (dest-pos vector :inline :offset-assert 336) - (speed float :offset-assert 352) - (height float :offset-assert 356) - (init-height float :offset-assert 360) - (battle-entity-triggered int32 :offset-assert 364) - (battle-info-index int32 :offset-assert 368) - (sound-id sound-id :offset-assert 372) - (hover-volume float :offset-assert 376) + ((escort-actor entity-actor 2) + (escort-force vector 2 :inline) + (brutter-balloon-actor entity-actor) + (path-pos float) + (dest-pos vector :inline) + (speed float) + (height float) + (init-height float) + (battle-entity-triggered int32) + (battle-info-index int32) + (sound-id sound-id) + (hover-volume float) ) - :heap-base #x100 - :method-count-assert 58 - :size-assert #x17c - :flag-assert #x3a0100017c - (:methods - (defend-stadium-move () _type_ :state 53) - (defend-stadium-die () _type_ :state 54) - (defend-stadium-explode () _type_ :state 55) - (defend-stadium-land () _type_ :state 56) - (defend-stadium-complete () _type_ :state 57) + (:state-methods + defend-stadium-move + defend-stadium-die + defend-stadium-explode + defend-stadium-land + defend-stadium-complete ) (:states defend-stadium-wait @@ -321,12 +305,9 @@ This commonly includes things such as: ) (deftype rift-rider-battle-info (structure) - ((path-pos float :offset-assert 0) - (entity-index int32 :offset-assert 4) + ((path-pos float) + (entity-index int32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) @@ -568,7 +549,7 @@ This commonly includes things such as: (-> arg0 status) ) -(defmethod rigid-body-object-method-29 rift-rider ((this rift-rider) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this rift-rider) (arg0 float)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -941,7 +922,7 @@ This commonly includes things such as: ) ) -(defmethod rigid-body-object-method-45 rift-rider ((this rift-rider) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 ((this rift-rider) (arg0 rigid-body-impact)) (if (< 40960.0 (-> arg0 impulse)) (sound-play "rift-fall") ) @@ -950,7 +931,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod rigid-body-object-method-34 rift-rider ((this rift-rider)) +(defmethod rigid-body-object-method-34 ((this rift-rider)) (cond ((nonzero? (-> this path)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 902) this)) @@ -964,7 +945,7 @@ This commonly includes things such as: (none) ) -(defmethod allocate-and-init-cshape rift-rider ((this rift-rider)) +(defmethod allocate-and-init-cshape ((this rift-rider)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1010,13 +991,13 @@ This commonly includes things such as: (none) ) -(defmethod deactivate rift-rider ((this rift-rider)) +(defmethod deactivate ((this rift-rider)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) ) -(defmethod init-skel-and-rigid-body rift-rider ((this rift-rider)) +(defmethod init-skel-and-rigid-body ((this rift-rider)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-rift-rider-no-lift" (the-as (pointer uint32) #f))) @@ -1056,12 +1037,8 @@ This commonly includes things such as: (deftype spotlight (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1082,7 +1059,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! spotlight ((this spotlight) (arg0 entity-actor)) +(defmethod init-from-entity! ((this spotlight) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1108,15 +1085,11 @@ This commonly includes things such as: (deftype gar-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gar-door ((this gar-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gar-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1286,50 +1259,48 @@ This commonly includes things such as: (define *stad-samos-lightning-joint-tbl* (new 'static 'boxed-array :type int32 14 15 16 18 19 20 22 23)) (deftype stad-samos (process-focusable) - ((root collide-shape-moving :override) - (rift-rider-actor entity-actor :offset-assert 204) - (lightning handle 4 :offset-assert 208) - (speed float :offset-assert 240) - (observed-speed float :offset-assert 244) - (cquery-timer time-frame :offset-assert 248) - (hit-dir vector :inline :offset-assert 256) - (hit-points float :offset-assert 272) - (max-hit-points float :offset-assert 276) - (incoming-attack-id uint32 :offset-assert 280) - (falling? symbol :offset-assert 284) - (lightning-on? symbol :offset-assert 288) - (enable-move? symbol :offset-assert 292) - (focus-disable-timer time-frame :offset-assert 296) - (stand-anim int32 :offset-assert 304) - (walk-anim int32 :offset-assert 308) - (raise-ship-anim int32 :offset-assert 312) - (knocked-back-anim int32 :offset-assert 316) - (knocked-back-land-anim int32 :offset-assert 320) - (knocked-forward-anim int32 :offset-assert 324) - (knocked-forward-land-anim int32 :offset-assert 328) - (death-anim int32 :offset-assert 332) - (death-end-anim int32 :offset-assert 336) - (knocked-anim int32 :offset-assert 340) - (knocked-land-anim int32 :offset-assert 344) - (hud handle :offset-assert 352) - (hud-bot-index int32 :offset-assert 360) - (rift-rider-joint-offset int32 :offset-assert 364) - (hand-joint int32 :offset-assert 368) + ((root collide-shape-moving :override) + (rift-rider-actor entity-actor) + (lightning handle 4) + (speed float) + (observed-speed float) + (cquery-timer time-frame) + (hit-dir vector :inline) + (hit-points float) + (max-hit-points float) + (incoming-attack-id uint32) + (falling? symbol) + (lightning-on? symbol) + (enable-move? symbol) + (focus-disable-timer time-frame) + (stand-anim int32) + (walk-anim int32) + (raise-ship-anim int32) + (knocked-back-anim int32) + (knocked-back-land-anim int32) + (knocked-forward-anim int32) + (knocked-forward-land-anim int32) + (death-anim int32) + (death-end-anim int32) + (knocked-anim int32) + (knocked-land-anim int32) + (hud handle) + (hud-bot-index int32) + (rift-rider-joint-offset int32) + (hand-joint int32) ) - :heap-base #x100 - :method-count-assert 36 - :size-assert #x174 - :flag-assert #x2401000174 + (:state-methods + idle + raise-rift-rider + move-rift-rider + hit + die + ) (:methods - (idle () _type_ :state 27) - (raise-rift-rider () _type_ :state 28) - (move-rift-rider () _type_ :state 29) - (hit () _type_ :state 30) - (die () _type_ :state 31) - (init! (_type_) none 32) - (get-position (_type_) symbol 33) - (spawn-lightning (_type_) none 34) - (kill-lightning (_type_) none 35) + (init! (_type_) none) + (get-position (_type_) symbol) + (spawn-lightning (_type_) none) + (kill-lightning (_type_) none) ) ) @@ -1917,12 +1888,12 @@ This commonly includes things such as: :post stad-samos-post ) -(defmethod get-position stad-samos ((this stad-samos)) +(defmethod get-position ((this stad-samos)) 'right ) ;; WARN: Return type mismatch symbol vs none. -(defmethod spawn-lightning stad-samos ((this stad-samos)) +(defmethod spawn-lightning ((this stad-samos)) (let* ((v1-0 (-> this rift-rider-actor)) (s5-0 (if v1-0 (-> v1-0 extra process) @@ -1955,7 +1926,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch symbol vs none. -(defmethod kill-lightning stad-samos ((this stad-samos)) +(defmethod kill-lightning ((this stad-samos)) (dotimes (s5-0 4) (send-event (handle->process (-> this lightning s5-0)) 'die) ) @@ -1963,7 +1934,7 @@ This commonly includes things such as: (none) ) -(defmethod deactivate stad-samos ((this stad-samos)) +(defmethod deactivate ((this stad-samos)) (if (valid? (-> this hud) (the-as type #f) "" #t 0) (send-event (handle->process (-> this hud)) 'hide-and-die) ) @@ -1973,7 +1944,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-samos ((this stad-samos) (arg0 entity-actor)) +(defmethod init-from-entity! ((this stad-samos) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2067,7 +2038,7 @@ This commonly includes things such as: :shadow samos-shadow-mg ) -(defmethod init! stad-samos ((this stad-samos)) +(defmethod init! ((this stad-samos)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-samos" (the-as (pointer uint32) #f))) @@ -2092,10 +2063,6 @@ This commonly includes things such as: (deftype stad-youngsamos (stad-samos) () - :heap-base #x100 - :method-count-assert 36 - :size-assert #x174 - :flag-assert #x2401000174 ) @@ -2168,7 +2135,7 @@ This commonly includes things such as: ) ) -(defmethod init! stad-youngsamos ((this stad-youngsamos)) +(defmethod init! ((this stad-youngsamos)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-youngsamos" (the-as (pointer uint32) #f))) @@ -2190,7 +2157,7 @@ This commonly includes things such as: (none) ) -(defmethod get-position stad-youngsamos ((this stad-youngsamos)) +(defmethod get-position ((this stad-youngsamos)) 'left ) @@ -2200,31 +2167,29 @@ This commonly includes things such as: ) (deftype stadium-barrier (process-drawable) - ((color vector :inline :offset-assert 208) - (flash vector :inline :offset-assert 224) - (flashf float :offset-assert 240) - (colorf float :offset-assert 244) + ((color vector :inline) + (flash vector :inline) + (flashf float) + (colorf float) ) - :heap-base #x80 - :method-count-assert 24 - :size-assert #xf8 - :flag-assert #x18008000f8 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (stadium-barrier-method-22 (_type_) none 22) - (stadium-barrier-method-23 (_type_) none 23) + (stadium-barrier-method-22 (_type_) none) + (stadium-barrier-method-23 (_type_) none) ) ) -(defmethod stadium-barrier-method-22 stadium-barrier ((this stadium-barrier)) +(defmethod stadium-barrier-method-22 ((this stadium-barrier)) (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) -(defmethod stadium-barrier-method-23 stadium-barrier ((this stadium-barrier)) +(defmethod stadium-barrier-method-23 ((this stadium-barrier)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-stadium-barrier" (the-as (pointer uint32) #f))) @@ -2268,7 +2233,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! stadium-barrier ((this stadium-barrier) (arg0 entity-actor)) +(defmethod init-from-entity! ((this stadium-barrier) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2313,25 +2278,23 @@ This commonly includes things such as: ) (deftype stad-force-field (process-focusable) - ((incoming-attack-id uint32 :offset-assert 204) - (plane plane :inline :offset-assert 208) - (field handle :offset-assert 224) - (ripple handle :offset-assert 232) - (next-message-time time-frame :offset-assert 240) + ((incoming-attack-id uint32) + (plane plane :inline) + (field handle) + (ripple handle) + (next-message-time time-frame) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xf8 - :flag-assert #x1e008000f8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (stad-force-field-method-28 (_type_) none 28) - (stad-force-field-method-29 (_type_ touching-shapes-entry) int 29) + (stad-force-field-method-28 (_type_) none) + (stad-force-field-method-29 (_type_ touching-shapes-entry) int) ) ) -(defmethod stad-force-field-method-29 stad-force-field ((this stad-force-field) (arg0 touching-shapes-entry)) +(defmethod stad-force-field-method-29 ((this stad-force-field) (arg0 touching-shapes-entry)) (local-vars (sv-256 entity-actor) (sv-272 collide-tri-result) @@ -2558,11 +2521,11 @@ This commonly includes things such as: :code sleep-code ) -(defmethod run-logic? stad-force-field ((this stad-force-field)) +(defmethod run-logic? ((this stad-force-field)) #t ) -(defmethod stad-force-field-method-28 stad-force-field ((this stad-force-field)) +(defmethod stad-force-field-method-28 ((this stad-force-field)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2605,7 +2568,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-force-field ((this stad-force-field) (arg0 entity-actor)) +(defmethod init-from-entity! ((this stad-force-field) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2634,15 +2597,11 @@ This commonly includes things such as: (deftype stad-c-force-field (stad-force-field) () - :heap-base #x80 - :method-count-assert 30 - :size-assert #xf8 - :flag-assert #x1e008000f8 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-c-force-field ((this stad-c-force-field) (arg0 entity-actor)) +(defmethod init-from-entity! ((this stad-c-force-field) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2671,15 +2630,11 @@ This commonly includes things such as: (deftype stad-d-force-field (stad-force-field) () - :heap-base #x80 - :method-count-assert 30 - :size-assert #xf8 - :flag-assert #x1e008000f8 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-d-force-field ((this stad-d-force-field) (arg0 entity-actor)) +(defmethod init-from-entity! ((this stad-d-force-field) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2703,12 +2658,8 @@ This commonly includes things such as: (deftype stad-keira (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -2799,12 +2750,8 @@ This commonly includes things such as: (deftype stad-brutter (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -2893,12 +2840,8 @@ This commonly includes things such as: (deftype brutter-balloon (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -2915,7 +2858,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! brutter-balloon ((this brutter-balloon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this brutter-balloon) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3138,7 +3081,7 @@ This commonly includes things such as: ) ) -(defmethod draw hud-samos-old ((this hud-samos-old)) +(defmethod draw ((this hud-samos-old)) (set-hud-piece-position! (-> this sprites 2) (the int (+ 30.0 (* -130.0 (-> this offset)))) @@ -3153,14 +3096,14 @@ This commonly includes things such as: (none) ) -(defmethod update-values hud-samos-old ((this hud-samos-old)) +(defmethod update-values ((this hud-samos-old)) (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 1)))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-samos-old ((this hud-samos-old)) +(defmethod init-callback ((this hud-samos-old)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-center-left) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/goal_src/jak2/levels/stadium/stadium-part.gc b/goal_src/jak2/levels/stadium/stadium-part.gc index 816cbc397bb..5c736f63fa4 100644 --- a/goal_src/jak2/levels/stadium/stadium-part.gc +++ b/goal_src/jak2/levels/stadium/stadium-part.gc @@ -9,10 +9,6 @@ (deftype stadium-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/stadium/stadium-race-obs.gc b/goal_src/jak2/levels/stadium/stadium-race-obs.gc index efce1d1712f..6384ce6fad4 100644 --- a/goal_src/jak2/levels/stadium/stadium-race-obs.gc +++ b/goal_src/jak2/levels/stadium/stadium-race-obs.gc @@ -8,17 +8,15 @@ ;; DECOMP BEGINS (deftype stdmb-race-hatch (process-drawable) - ((tt float :offset-assert 200) - (tt-target float :offset-assert 204) + ((tt float) + (tt-target float) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xd0 - :flag-assert #x17005000d0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (stdmb-race-hatch-method-21 (_type_) none 21) - (stdmb-race-hatch-method-22 (_type_) none 22) + (stdmb-race-hatch-method-21 (_type_) none) + (stdmb-race-hatch-method-22 (_type_) none) ) ) @@ -55,7 +53,7 @@ ) ) -(defmethod stdmb-race-hatch-method-21 stdmb-race-hatch ((this stdmb-race-hatch)) +(defmethod stdmb-race-hatch-method-21 ((this stdmb-race-hatch)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -96,7 +94,7 @@ (none) ) -(defmethod stdmb-race-hatch-method-22 stdmb-race-hatch ((this stdmb-race-hatch)) +(defmethod stdmb-race-hatch-method-22 ((this stdmb-race-hatch)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-stdmb-race-hatch" (the-as (pointer uint32) #f))) @@ -116,7 +114,7 @@ (none) ) -(defmethod init-from-entity! stdmb-race-hatch ((this stdmb-race-hatch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this stdmb-race-hatch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -139,8 +137,4 @@ This commonly includes things such as: (deftype stdmb-platform (stdmb-race-hatch) () - :heap-base #x50 - :method-count-assert 23 - :size-assert #xd0 - :flag-assert #x17005000d0 ) diff --git a/goal_src/jak2/levels/stadium/stadium-scenes.gc b/goal_src/jak2/levels/stadium/stadium-scenes.gc index ca4f0efdaf9..6f3d7b88857 100644 --- a/goal_src/jak2/levels/stadium/stadium-scenes.gc +++ b/goal_src/jak2/levels/stadium/stadium-scenes.gc @@ -3157,15 +3157,11 @@ (deftype keira-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-art! keira-npc ((this keira-npc)) +(defmethod init-art! ((this keira-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -3175,7 +3171,7 @@ (none) ) -(defmethod get-art-elem keira-npc ((this keira-npc)) +(defmethod get-art-elem ((this keira-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) diff --git a/goal_src/jak2/levels/stadium/stadiumb-part.gc b/goal_src/jak2/levels/stadium/stadiumb-part.gc index 0886350c0a9..b19aece84a5 100644 --- a/goal_src/jak2/levels/stadium/stadiumb-part.gc +++ b/goal_src/jak2/levels/stadium/stadiumb-part.gc @@ -9,28 +9,16 @@ (deftype stadiumb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) (deftype stadiumc-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) (deftype stadiumd-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/strip/chaincrate.gc b/goal_src/jak2/levels/strip/chaincrate.gc index 79a4ff30a0b..214f787685e 100644 --- a/goal_src/jak2/levels/strip/chaincrate.gc +++ b/goal_src/jak2/levels/strip/chaincrate.gc @@ -77,20 +77,18 @@ ) (deftype strip-chain-crate-slave (process-drawable) - ((part2 sparticle-launch-control :offset-assert 200) - (path-u float :offset-assert 204) - (path-speed float :offset-assert 208) - (guide-sound-mask uint32 :offset-assert 212) - (guide-num int8 :offset-assert 216) + ((part2 sparticle-launch-control) + (path-u float) + (path-speed float) + (guide-sound-mask uint32) + (guide-num int8) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xd9 - :flag-assert #x17006000d9 + (:state-methods + die-fast + moving + ) (:methods - (die-fast () _type_ :state 20) - (moving () _type_ :state 21) - (strip-chain-crate-slave-method-22 (_type_) none 22) + (strip-chain-crate-slave-method-22 (_type_) none) ) ) @@ -113,7 +111,7 @@ ) ;; WARN: Return type mismatch rgbaf vs none. -(defmethod strip-chain-crate-slave-method-22 strip-chain-crate-slave ((this strip-chain-crate-slave)) +(defmethod strip-chain-crate-slave-method-22 ((this strip-chain-crate-slave)) (let ((f0-0 (-> this path-u))) (cond ((>= 0.09 f0-0) @@ -245,7 +243,7 @@ (none) ) -(defmethod deactivate strip-chain-crate-slave ((this strip-chain-crate-slave)) +(defmethod deactivate ((this strip-chain-crate-slave)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -254,7 +252,7 @@ ) ;; WARN: Return type mismatch process-drawable vs strip-chain-crate-slave. -(defmethod relocate strip-chain-crate-slave ((this strip-chain-crate-slave) (arg0 int)) +(defmethod relocate ((this strip-chain-crate-slave) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -262,26 +260,24 @@ ) (deftype strip-chain-crate (process-drawable) - ((spawn-pos vector :inline :offset-assert 208) - (next-spawn-time time-frame :offset-assert 224) - (spawn-delay uint32 :offset-assert 232) - (spawn-offset uint32 :offset-assert 236) - (dist-apart float :offset-assert 240) - (crate-speed float :offset-assert 244) + ((spawn-pos vector :inline) + (next-spawn-time time-frame) + (spawn-delay uint32) + (spawn-offset uint32) + (dist-apart float) + (crate-speed float) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf8 - :flag-assert #x16008000f8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (strip-chain-crate-method-21 (_type_) none 21) + (strip-chain-crate-method-21 (_type_) none) ) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod strip-chain-crate-method-21 strip-chain-crate ((this strip-chain-crate)) +(defmethod strip-chain-crate-method-21 ((this strip-chain-crate)) (let ((f30-0 (total-distance (-> this path))) (f28-0 (* (/ (the float @@ -318,7 +314,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! strip-chain-crate ((this strip-chain-crate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this strip-chain-crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/strip/strip-drop.gc b/goal_src/jak2/levels/strip/strip-drop.gc index 81f37b4c3d1..0781e8361a5 100644 --- a/goal_src/jak2/levels/strip/strip-drop.gc +++ b/goal_src/jak2/levels/strip/strip-drop.gc @@ -195,17 +195,15 @@ ) (deftype strip-game-crate (process-drawable) - ((local-offset vector :inline :offset-assert 208) - (swing-angle vector :inline :offset-assert 224) + ((local-offset vector :inline) + (swing-angle vector :inline) ) - :heap-base #x70 - :method-count-assert 23 - :size-assert #xf0 - :flag-assert #x17007000f0 + (:state-methods + idle + final-position + ) (:methods - (idle () _type_ :state 20) - (final-position () _type_ :state 21) - (strip-game-crate-method-22 (_type_ vector quaternion) none 22) + (strip-game-crate-method-22 (_type_ vector quaternion) none) ) ) @@ -253,7 +251,7 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod strip-game-crate-method-22 strip-game-crate ((this strip-game-crate) (arg0 vector) (arg1 quaternion)) +(defmethod strip-game-crate-method-22 ((this strip-game-crate) (arg0 vector) (arg1 quaternion)) (set! (-> this root trans quad) (-> arg0 quad)) (let ((s4-0 (new 'stack-no-clear 'quaternion))) (quaternion-rotate-z! s4-0 arg1 (-> this swing-angle z)) @@ -305,25 +303,21 @@ ) (deftype crane (process-drawable) - ((angle-vel float :offset-assert 200) - (angle float :offset-assert 204) - (init-quat quaternion :inline :offset-assert 208) - (final-quat quaternion :inline :offset-assert 224) - (crate (pointer strip-game-crate) :offset-assert 240) + ((angle-vel float) + (angle float) + (init-quat quaternion :inline) + (final-quat quaternion :inline) + (crate (pointer strip-game-crate)) ) - :heap-base #x80 - :method-count-assert 23 - :size-assert #xf4 - :flag-assert #x17008000f4 - (:methods - (idle () _type_ :state 20) - (swinging () _type_ :state 21) - (final-position () _type_ :state 22) + (:state-methods + idle + swinging + final-position ) ) -(defmethod deactivate crane ((this crane)) +(defmethod deactivate ((this crane)) (if (-> this crate) (deactivate (-> this crate 0)) ) @@ -414,7 +408,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! crane ((this crane) (arg0 entity-actor)) +(defmethod init-from-entity! ((this crane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -444,16 +438,12 @@ This commonly includes things such as: ) (deftype cranecrate (process-drawable) - ((root collide-shape :override) - (unknown-pad-n12jn3123123 int32 52 :offset-assert 200) + ((root collide-shape :override) + (unknown-pad-n12jn3123123 int32 52) ) - :heap-base #x120 - :method-count-assert 22 - :size-assert #x198 - :flag-assert #x1601200198 - (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) + (:state-methods + idle + hidden ) ) @@ -491,7 +481,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cranecrate ((this cranecrate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cranecrate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -542,18 +532,16 @@ This commonly includes things such as: ) (deftype grunt-egg (process-drawable) - ((idle-anim-player idle-control :inline :offset-assert 208) - (attack-id uint32 :offset-assert 224) + ((idle-anim-player idle-control :inline) + (attack-id uint32) ) - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe4 - :flag-assert #x18007000e4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (grunt-egg-method-22 (_type_) none 22) - (grunt-egg-method-23 (_type_) vector4w-2 23) + (grunt-egg-method-22 (_type_) none) + (grunt-egg-method-23 (_type_) vector4w-2) ) ) @@ -661,7 +649,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! grunt-egg ((this grunt-egg) (arg0 entity-actor)) +(defmethod init-from-entity! ((this grunt-egg) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -719,42 +707,26 @@ This commonly includes things such as: (deftype grunt-egg-a (grunt-egg) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe4 - :flag-assert #x18007000e4 ) (deftype grunt-egg-b (grunt-egg) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe4 - :flag-assert #x18007000e4 ) (deftype grunt-egg-c (grunt-egg) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe4 - :flag-assert #x18007000e4 ) (deftype grunt-egg-d (grunt-egg) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe4 - :flag-assert #x18007000e4 ) ;; WARN: Return type mismatch draw-control vs none. -(defmethod grunt-egg-method-22 grunt-egg-a ((this grunt-egg-a)) +(defmethod grunt-egg-method-22 ((this grunt-egg-a)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-a" (the-as (pointer uint32) #f))) @@ -763,12 +735,12 @@ This commonly includes things such as: (none) ) -(defmethod grunt-egg-method-23 grunt-egg-a ((this grunt-egg-a)) +(defmethod grunt-egg-method-23 ((this grunt-egg-a)) *grunt-egg-a-script* ) ;; WARN: Return type mismatch connection vs none. -(defmethod grunt-egg-method-22 grunt-egg-b ((this grunt-egg-b)) +(defmethod grunt-egg-method-22 ((this grunt-egg-b)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-b" (the-as (pointer uint32) #f))) @@ -779,12 +751,12 @@ This commonly includes things such as: (none) ) -(defmethod grunt-egg-method-23 grunt-egg-b ((this grunt-egg-b)) +(defmethod grunt-egg-method-23 ((this grunt-egg-b)) *grunt-egg-b-script* ) ;; WARN: Return type mismatch connection vs none. -(defmethod grunt-egg-method-22 grunt-egg-c ((this grunt-egg-c)) +(defmethod grunt-egg-method-22 ((this grunt-egg-c)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-c" (the-as (pointer uint32) #f))) @@ -794,12 +766,12 @@ This commonly includes things such as: (none) ) -(defmethod grunt-egg-method-23 grunt-egg-c ((this grunt-egg-c)) +(defmethod grunt-egg-method-23 ((this grunt-egg-c)) *grunt-egg-c-script* ) ;; WARN: Return type mismatch connection vs none. -(defmethod grunt-egg-method-22 grunt-egg-d ((this grunt-egg-d)) +(defmethod grunt-egg-method-22 ((this grunt-egg-d)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-d" (the-as (pointer uint32) #f))) @@ -809,6 +781,6 @@ This commonly includes things such as: (none) ) -(defmethod grunt-egg-method-23 grunt-egg-d ((this grunt-egg-d)) +(defmethod grunt-egg-method-23 ((this grunt-egg-d)) *grunt-egg-d-script* ) diff --git a/goal_src/jak2/levels/strip/strip-obs.gc b/goal_src/jak2/levels/strip/strip-obs.gc index af03c8cef00..4ad27901c27 100644 --- a/goal_src/jak2/levels/strip/strip-obs.gc +++ b/goal_src/jak2/levels/strip/strip-obs.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod draw hud-plasmite ((this hud-plasmite)) +(defmethod draw ((this hud-plasmite)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -20,14 +20,14 @@ (none) ) -(defmethod update-values hud-plasmite ((this hud-plasmite)) +(defmethod update-values ((this hud-plasmite)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-plasmite ((this hud-plasmite)) +(defmethod init-callback ((this hud-plasmite)) (set! (-> this level) (level-get *level* 'strip)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -45,18 +45,14 @@ ) (deftype strip-hazard (process-drawable) - ((root collide-shape-moving :override) - (sync sync-linear :inline :offset-assert 200) - (shove-vec vector :inline :offset-assert 224) - (no-collision-timer uint64 :offset-assert 240) - (attack-id uint32 :offset-assert 248) + ((root collide-shape-moving :override) + (sync sync-linear :inline) + (shove-vec vector :inline) + (no-collision-timer uint64) + (attack-id uint32) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #xfc - :flag-assert #x15008000fc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -150,7 +146,7 @@ :post transform-post ) -(defmethod init-from-entity! strip-hazard ((this strip-hazard) (arg0 entity-actor)) +(defmethod init-from-entity! ((this strip-hazard) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -194,15 +190,11 @@ This commonly includes things such as: ) (deftype fencespikes (strip-hazard) - ((start-quat quaternion :inline :offset-assert 256) - (spin float :offset-assert 272) - (offset float :offset-assert 276) - (sparks-group uint32 :offset-assert 280) + ((start-quat quaternion :inline) + (spin float) + (offset float) + (sparks-group uint32) ) - :heap-base #xa0 - :method-count-assert 21 - :size-assert #x11c - :flag-assert #x1500a0011c ) @@ -238,7 +230,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fencespikes ((this fencespikes) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fencespikes) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -306,12 +298,8 @@ This commonly includes things such as: ) (deftype pitspikes (strip-hazard) - ((spinner basic :offset-assert 252) + ((spinner basic) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #x100 - :flag-assert #x1500800100 ) @@ -371,7 +359,7 @@ This commonly includes things such as: ) ) -(defmethod relocate pitspikes ((this pitspikes) (arg0 int)) +(defmethod relocate ((this pitspikes) (arg0 int)) (if (nonzero? (-> this spinner)) (&+! (-> this spinner) arg0) ) @@ -379,7 +367,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pitspikes ((this pitspikes) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pitspikes) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -432,10 +420,6 @@ This commonly includes things such as: (deftype curtainsaw (strip-hazard) () - :heap-base #x80 - :method-count-assert 21 - :size-assert #xfc - :flag-assert #x15008000fc ) @@ -480,7 +464,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! curtainsaw ((this curtainsaw) (arg0 entity-actor)) +(defmethod init-from-entity! ((this curtainsaw) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -531,32 +515,28 @@ This commonly includes things such as: ) (deftype grenade-point (process-drawable) - ((root collide-shape :override) - (camera-name string :offset-assert 200) - (parented? symbol :offset-assert 204) - (lightning-time time-frame :offset-assert 208) - (strike-table (array vector) :offset-assert 216) - (last-strike-index int32 :offset-assert 220) - (speed meters :offset-assert 224) - (part2 sparticle-launch-control :offset-assert 228) - (part3 sparticle-launch-control :offset-assert 232) - (part-lightning-hit sparticle-launch-control :offset-assert 236) - (enter-time time-frame :offset-assert 240) - (minimap connection-minimap :offset-assert 248) + ((root collide-shape :override) + (camera-name string) + (parented? symbol) + (lightning-time time-frame) + (strike-table (array vector)) + (last-strike-index int32) + (speed meters) + (part2 sparticle-launch-control) + (part3 sparticle-launch-control) + (part-lightning-hit sparticle-launch-control) + (enter-time time-frame) + (minimap connection-minimap) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xfc - :flag-assert #x16008000fc - (:methods - (idle () _type_ :state 20) - (die (symbol) _type_ :state 21) + (:state-methods + idle + (die symbol) ) ) ;; WARN: Return type mismatch process-drawable vs grenade-point. -(defmethod relocate grenade-point ((this grenade-point) (arg0 int)) +(defmethod relocate ((this grenade-point) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -569,7 +549,7 @@ This commonly includes things such as: (the-as grenade-point ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate grenade-point ((this grenade-point)) +(defmethod deactivate ((this grenade-point)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -864,7 +844,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! grenade-point ((this grenade-point) (arg0 entity-actor)) +(defmethod init-from-entity! ((this grenade-point) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -923,17 +903,13 @@ This commonly includes things such as: ) (deftype grenade (projectile) - ((tumble-quat quaternion :inline :offset-assert 480) - (blast-radius float :offset-assert 496) - (end-target handle :offset-assert 504) + ((tumble-quat quaternion :inline) + (blast-radius float) + (end-target handle) ) - :heap-base #x180 - :method-count-assert 42 - :size-assert #x200 - :flag-assert #x2a01800200 (:methods - (grenade-method-40 (_type_) none 40) - (grenade-method-41 (_type_) none 41) + (grenade-method-40 (_type_) none) + (grenade-method-41 (_type_) none) ) ) @@ -1109,7 +1085,7 @@ This commonly includes things such as: ) ) -(defmethod draw-laser-sight grenade ((this grenade)) +(defmethod draw-laser-sight ((this grenade)) "TODO - confirm If applicable, draw the laser sight particles" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -1150,7 +1126,7 @@ This commonly includes things such as: (none) ) -(defmethod spawn-impact-particles grenade ((this grenade)) +(defmethod spawn-impact-particles ((this grenade)) "Spawns associated particles with the projectile if applicable" ((method-of-type projectile spawn-impact-particles) this) (ja-post) @@ -1158,7 +1134,7 @@ This commonly includes things such as: (none) ) -(defmethod spawn-shell-particles grenade ((this grenade)) +(defmethod spawn-shell-particles ((this grenade)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -1199,7 +1175,7 @@ This commonly includes things such as: (none) ) -(defmethod play-impact-sound grenade ((this grenade) (arg0 projectile-options)) +(defmethod play-impact-sound ((this grenade) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -1297,7 +1273,7 @@ This commonly includes things such as: ) ) -(defmethod grenade-method-40 grenade ((this grenade)) +(defmethod grenade-method-40 ((this grenade)) (let ((s5-0 (the-as process-drawable (-> this end-target process 0)))) (when s5-0 (set! (-> this root transv x) (* 4.0 (- (-> s5-0 root trans x) (-> this root trans x)))) @@ -1319,7 +1295,7 @@ This commonly includes things such as: (none) ) -(defmethod grenade-method-41 grenade ((this grenade)) +(defmethod grenade-method-41 ((this grenade)) (quaternion*! (-> this root quat) (-> this root quat) (-> this tumble-quat)) (projectile-move-fill-all-dirs this) (set-setting! 'point-of-interest 'abs (-> this root trans) 0) @@ -1328,7 +1304,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-proj-collision! grenade ((this grenade)) +(defmethod init-proj-collision! ((this grenade)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1359,7 +1335,7 @@ This commonly includes things such as: (none) ) -(defmethod init-proj-settings! grenade ((this grenade)) +(defmethod init-proj-settings! ((this grenade)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (with-pp (initialize-skeleton @@ -1554,24 +1530,20 @@ This commonly includes things such as: ) (deftype drill-plat (strip-hazard) - ((plat-sound ambient-sound :offset-assert 252) + ((plat-sound ambient-sound) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #x100 - :flag-assert #x1500800100 ) ;; WARN: Return type mismatch process-drawable vs drill-plat. -(defmethod relocate drill-plat ((this drill-plat) (arg0 int)) +(defmethod relocate ((this drill-plat) (arg0 int)) (if (nonzero? (-> this plat-sound)) (&+! (-> this plat-sound) arg0) ) (the-as drill-plat ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate drill-plat ((this drill-plat)) +(defmethod deactivate ((this drill-plat)) (if (nonzero? (-> this plat-sound)) (stop! (-> this plat-sound)) ) @@ -1640,7 +1612,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-plat ((this drill-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/strip/strip-part.gc b/goal_src/jak2/levels/strip/strip-part.gc index ef1dc3d17fa..df37cd8d880 100644 --- a/goal_src/jak2/levels/strip/strip-part.gc +++ b/goal_src/jak2/levels/strip/strip-part.gc @@ -9,10 +9,6 @@ (deftype strip-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/strip/strip-rescue.gc b/goal_src/jak2/levels/strip/strip-rescue.gc index dbcfbaa85de..3fc7f0e45d2 100644 --- a/goal_src/jak2/levels/strip/strip-rescue.gc +++ b/goal_src/jak2/levels/strip/strip-rescue.gc @@ -13,16 +13,12 @@ ) (deftype cntrlrm-door (process-drawable) - ((root collide-shape :override) - (unknown-pad-k1jhb2n3k1j int32 52 :offset-assert 200) + ((root collide-shape :override) + (unknown-pad-k1jhb2n3k1j int32 52) ) - :heap-base #x120 - :method-count-assert 22 - :size-assert #x198 - :flag-assert #x1601200198 - (:methods - (idle () _type_ :state 20) - (opened () _type_ :state 21) + (:state-methods + idle + opened ) ) @@ -51,7 +47,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cntrlrm-door ((this cntrlrm-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cntrlrm-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -115,15 +111,11 @@ This commonly includes things such as: ) (deftype cntrlrm-button (process-drawable) - ((root collide-shape :override) - (unknown-pad-n12jn3123123 int32 52 :offset-assert 200) + ((root collide-shape :override) + (unknown-pad-n12jn3123123 int32 52) ) - :heap-base #x120 - :method-count-assert 21 - :size-assert #x198 - :flag-assert #x1501200198 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -140,7 +132,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cntrlrm-button ((this cntrlrm-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cntrlrm-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/title/title-obs.gc b/goal_src/jak2/levels/title/title-obs.gc index 3c109110bc4..cef2f30c8cf 100644 --- a/goal_src/jak2/levels/title/title-obs.gc +++ b/goal_src/jak2/levels/title/title-obs.gc @@ -11,35 +11,31 @@ ;; DECOMP BEGINS (deftype title-control (process) - ((selected int32 :offset-assert 128) - (sprites hud-sprite 2 :inline :offset-assert 144) - (sprite-pos vector :inline :offset-assert 272) - (sprite-draw uint32 :offset-assert 288) - (buffer external-art-buffer 2 :offset-assert 292) - (want int32 2 :offset-assert 300) - (want-name string 2 :offset-assert 308) - (have int32 2 :offset-assert 316) - (draw int32 :offset-assert 324) - (draw-name string :offset-assert 328) - (active symbol :offset-assert 332) - (spark-time time-frame :offset-assert 336) - (gui-id sound-id :offset-assert 344) + ((selected int32) + (sprites hud-sprite 2 :inline) + (sprite-pos vector :inline) + (sprite-draw uint32) + (buffer external-art-buffer 2) + (want int32 2) + (want-name string 2) + (have int32 2) + (draw int32) + (draw-name string) + (active symbol) + (spark-time time-frame) + (gui-id sound-id) ) - :heap-base #xe0 - :method-count-assert 18 - :size-assert #x15c - :flag-assert #x1200e0015c - (:methods - (startup () _type_ :state 14) - (wait () _type_ :state 15) - (idle () _type_ :state 16) - (scrap-book (int) _type_ :state 17) + (:state-methods + startup + wait + idle + (scrap-book int) ) ) ;; WARN: Return type mismatch process vs title-control. -(defmethod relocate title-control ((this title-control) (arg0 int)) +(defmethod relocate ((this title-control) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this buffer v1-0)) (&+! (-> this buffer v1-0) arg0) @@ -48,7 +44,7 @@ (the-as title-control ((method-of-type process relocate) this arg0)) ) -(defmethod deactivate title-control ((this title-control)) +(defmethod deactivate ((this title-control)) (dotimes (s5-0 2) (set-pending-file (-> this buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) diff --git a/goal_src/jak2/levels/tomb/monster-frog.gc b/goal_src/jak2/levels/tomb/monster-frog.gc index 675f66a8a94..b6c280f01b8 100644 --- a/goal_src/jak2/levels/tomb/monster-frog.gc +++ b/goal_src/jak2/levels/tomb/monster-frog.gc @@ -16,14 +16,10 @@ (deftype monster-frog (nav-enemy) () - :heap-base #x1e0 - :method-count-assert 181 - :size-assert #x25c - :flag-assert #xb501e0025c - (:methods - (attack (vector) _type_ :state 178) - (attack-recover () _type_ :state 179) - (turn () _type_ :state 180) + (:state-methods + (attack vector) + attack-recover + turn ) ) @@ -748,7 +744,7 @@ :post nav-enemy-simple-post ) -(defmethod enemy-method-77 monster-frog ((this monster-frog) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this monster-frog) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 0) @@ -808,7 +804,7 @@ ) ) -(defmethod enemy-method-78 monster-frog ((this monster-frog) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this monster-frog) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.17)) @@ -868,7 +864,7 @@ ) ) -(defmethod track-target! monster-frog ((this monster-frog)) +(defmethod track-target! ((this monster-frog)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -878,7 +874,7 @@ (none) ) -(defmethod init-enemy-collision! monster-frog ((this monster-frog)) +(defmethod init-enemy-collision! ((this monster-frog)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -941,7 +937,7 @@ (none) ) -(defmethod init-enemy! monster-frog ((this monster-frog)) +(defmethod init-enemy! ((this monster-frog)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/tomb/target-indax.gc b/goal_src/jak2/levels/tomb/target-indax.gc index 0cc5525e0e0..283dc995e0e 100644 --- a/goal_src/jak2/levels/tomb/target-indax.gc +++ b/goal_src/jak2/levels/tomb/target-indax.gc @@ -33,13 +33,10 @@ ;; DECOMP BEGINS (deftype indax-info (basic) - ((indax-start-time time-frame :offset-assert 8) - (indax-time time-frame :offset-assert 16) - (art-group-backup art-group :offset-assert 24) + ((indax-start-time time-frame) + (indax-time time-frame) + (art-group-backup art-group) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) diff --git a/goal_src/jak2/levels/tomb/tomb-baby-spider.gc b/goal_src/jak2/levels/tomb/tomb-baby-spider.gc index ea915ed4e9b..4789cb55151 100644 --- a/goal_src/jak2/levels/tomb/tomb-baby-spider.gc +++ b/goal_src/jak2/levels/tomb/tomb-baby-spider.gc @@ -9,13 +9,9 @@ (deftype tomb-baby-spider (nav-enemy) () - :heap-base #x1e0 - :method-count-assert 180 - :size-assert #x25c - :flag-assert #xb401e0025c - (:methods - (attack () _type_ :state 178) - (attack-stop () _type_ :state 179) + (:state-methods + attack + attack-stop ) ) @@ -431,7 +427,7 @@ ) ) -(defmethod enemy-method-77 tomb-baby-spider ((this tomb-baby-spider) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this tomb-baby-spider) (arg0 (pointer float))) (let* ((a2-0 (the-as collide-shape-prim-group (-> this root root-prim))) (v1-2 (-> a2-0 child 3)) ) @@ -475,7 +471,7 @@ ) ) -(defmethod enemy-method-78 tomb-baby-spider ((this tomb-baby-spider) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this tomb-baby-spider) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let ((v1-3 (-> this skel root-channel 0))) @@ -507,7 +503,7 @@ ) ) -(defmethod enemy-method-79 tomb-baby-spider ((this tomb-baby-spider) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this tomb-baby-spider) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((3) (let ((s4-0 (ja-done? 0))) @@ -574,7 +570,7 @@ ) ) -(defmethod enemy-method-104 tomb-baby-spider ((this tomb-baby-spider) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ((this tomb-baby-spider) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (let* ((s1-0 arg0) (s2-0 (if (type? s1-0 process-focusable) s1-0 @@ -609,7 +605,7 @@ ) ) -(defmethod init-enemy-collision! tomb-baby-spider ((this tomb-baby-spider)) +(defmethod init-enemy-collision! ((this tomb-baby-spider)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -683,7 +679,7 @@ (none) ) -(defmethod init-enemy! tomb-baby-spider ((this tomb-baby-spider)) +(defmethod init-enemy! ((this tomb-baby-spider)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -696,8 +692,4 @@ (deftype dig-spider (tomb-baby-spider) () - :heap-base #x1e0 - :method-count-assert 180 - :size-assert #x25c - :flag-assert #xb401e0025c ) diff --git a/goal_src/jak2/levels/tomb/tomb-beetle.gc b/goal_src/jak2/levels/tomb/tomb-beetle.gc index 328c04fc434..384f950f957 100644 --- a/goal_src/jak2/levels/tomb/tomb-beetle.gc +++ b/goal_src/jak2/levels/tomb/tomb-beetle.gc @@ -14,45 +14,40 @@ ) (deftype tomb-beetle-fly-info (structure) - ((dst vector :inline :offset-assert 0) - (dst-quat quaternion :inline :offset-assert 16) - (dist meters :offset-assert 32) - (threshold meters :offset-assert 36) + ((dst vector :inline) + (dst-quat quaternion :inline) + (dist meters) + (threshold meters) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) (deftype tomb-beetle (nav-enemy) - ((src-quat quaternion :inline :offset-assert 608) - (fly-info tomb-beetle-fly-info 2 :inline :offset-assert 624) - (speed meters :offset-assert 720) - (init-height meters :offset-assert 724) - (flags uint16 :offset-assert 728) - (dest-index int32 :offset-assert 732) - (round uint32 :offset-assert 736) - (flying? symbol :offset-assert 740) - (fly-away-radius float :offset-assert 744) - (fly-away-ry float :offset-assert 748) - (fly-away-ry-speed float :offset-assert 752) - (fly-away-acc float :offset-assert 756) - (fly-away-dir vector :inline :offset-assert 768) + ((src-quat quaternion :inline) + (fly-info tomb-beetle-fly-info 2 :inline) + (speed meters) + (init-height meters) + (flags uint16) + (dest-index int32) + (round uint32) + (flying? symbol) + (fly-away-radius float) + (fly-away-ry float) + (fly-away-ry-speed float) + (fly-away-acc float) + (fly-away-dir vector :inline) ) - :heap-base #x290 - :method-count-assert 186 - :size-assert #x310 - :flag-assert #xba02900310 + (:state-methods + tomb-beetle-state-178 + explode + fly-away + go-to-door + key + land + stand + ) (:methods - (tomb-beetle-method-178 (_type_) none 178) - (explode () _type_ :state 179) - (fly-away () _type_ :state 180) - (go-to-door () _type_ :state 181) - (key () _type_ :state 182) - (land () _type_ :state 183) - (stand () _type_ :state 184) - (tomb-beetle-method-185 (_type_) none 185) + (tomb-beetle-method-185 (_type_) none) ) ) @@ -190,7 +185,7 @@ (set! (-> *tomb-beetle-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler tomb-beetle ((this tomb-beetle) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this tomb-beetle) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (let ((v1-0 (new 'static 'array int64 2 -1 0))) @@ -235,7 +230,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod tomb-beetle-method-185 tomb-beetle ((this tomb-beetle)) +(defmethod tomb-beetle-method-185 ((this tomb-beetle)) (cond ((-> this draw shadow) (new 'stack-no-clear 'vector) @@ -936,7 +931,7 @@ ) ) -(defmethod init-enemy-collision! tomb-beetle ((this tomb-beetle)) +(defmethod init-enemy-collision! ((this tomb-beetle)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -984,7 +979,7 @@ (none) ) -(defmethod init-enemy! tomb-beetle ((this tomb-beetle)) +(defmethod init-enemy! ((this tomb-beetle)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/goal_src/jak2/levels/tomb/tomb-boulder.gc b/goal_src/jak2/levels/tomb/tomb-boulder.gc index 2a2e238e912..8632cc7c0ab 100644 --- a/goal_src/jak2/levels/tomb/tomb-boulder.gc +++ b/goal_src/jak2/levels/tomb/tomb-boulder.gc @@ -101,12 +101,8 @@ (deftype tomb-spider (process-drawable) ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -186,14 +182,10 @@ (deftype tomb-boulder-stop (process-drawable) ((root collide-shape-moving :override) - (prefix string :offset-assert 200) + (prefix string) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xcc - :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -257,15 +249,11 @@ ) (deftype tomb-boulder-pillar (process-drawable) - ((root collide-shape-moving :override) - (prefix string :offset-assert 200) + ((root collide-shape-moving :override) + (prefix string) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xcc - :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -326,40 +314,36 @@ ) (deftype tomb-boulder (process-drawable) - ((root collide-shape-moving :override) - (art-name string :offset-assert 200) - (anim spool-anim :offset-assert 204) - (loop-id sound-id :offset-assert 208) - (spider (pointer tomb-spider) :offset-assert 212) - (explode (pointer process) :offset-assert 216) - (stick basic :offset-assert 220) - (wing-door (pointer tomb-wing-door) :offset-assert 224) - (stop (pointer tomb-boulder-stop) 2 :offset-assert 228) - (pillar (pointer tomb-boulder-pillar) 4 :offset-assert 236) - (mode uint32 :offset-assert 252) - (sub-mode uint32 :offset-assert 256) - (gui-id sound-id :offset-assert 260) - (target-pause symbol :offset-assert 264) - (current-pause symbol :offset-assert 268) - (previous-y-vel float :offset-assert 272) - (previous-y float :offset-assert 276) - (target-speed float :offset-assert 280) - (current-speed float :offset-assert 284) - (distance meters :offset-assert 288) - (distance-target meters :offset-assert 292) - (distance-offset float :offset-assert 296) - (speed-time time-frame :offset-assert 304) - (trans vector 2 :inline :offset-assert 320) - (dir vector :inline :offset-assert 352) - (distance-adjust (array float) :offset-assert 368) + ((root collide-shape-moving :override) + (art-name string) + (anim spool-anim) + (loop-id sound-id) + (spider (pointer tomb-spider)) + (explode (pointer process)) + (stick basic) + (wing-door (pointer tomb-wing-door)) + (stop (pointer tomb-boulder-stop) 2) + (pillar (pointer tomb-boulder-pillar) 4) + (mode uint32) + (sub-mode uint32) + (gui-id sound-id) + (target-pause symbol) + (current-pause symbol) + (previous-y-vel float) + (previous-y float) + (target-speed float) + (current-speed float) + (distance meters) + (distance-target meters) + (distance-offset float) + (speed-time time-frame) + (trans vector 2 :inline) + (dir vector :inline) + (distance-adjust (array float)) ) - :heap-base #x100 - :method-count-assert 22 - :size-assert #x174 - :flag-assert #x1601000174 - (:methods - (chase (spool-anim) _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + (chase spool-anim) + idle ) ) @@ -1014,7 +998,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boulder ((obj tomb-boulder) (arg0 entity-actor)) +(defmethod init-from-entity! ((obj tomb-boulder) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1176,20 +1160,18 @@ This commonly includes things such as: (deftype spider-eyes (process-drawable) ((root collide-shape-moving :override) - (node-index uint32 :offset-assert 200) + (node-index uint32) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16005000cc + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (spider-eyes-method-21 (_type_) none 21) + (spider-eyes-method-21 (_type_) none) ) ) -(defmethod spider-eyes-method-21 spider-eyes ((obj spider-eyes)) +(defmethod spider-eyes-method-21 ((obj spider-eyes)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) diff --git a/goal_src/jak2/levels/tomb/tomb-obs.gc b/goal_src/jak2/levels/tomb/tomb-obs.gc index cf883df5aa0..9d43df73e3c 100644 --- a/goal_src/jak2/levels/tomb/tomb-obs.gc +++ b/goal_src/jak2/levels/tomb/tomb-obs.gc @@ -17,13 +17,9 @@ ;; DECOMP BEGINS (deftype tomb-plat-wall (plat) - ((position vector :inline :offset-assert 336) - (last-pos float :offset-assert 352) + ((position vector :inline) + (last-pos float) ) - :heap-base #xf0 - :method-count-assert 37 - :size-assert #x164 - :flag-assert #x2500f00164 ) @@ -33,7 +29,7 @@ :origin-joint-index 3 ) -(defmethod get-art-group tomb-plat-wall ((this tomb-plat-wall)) +(defmethod get-art-group ((this tomb-plat-wall)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-plat-wall" (the-as (pointer uint32) #f)) ) @@ -108,12 +104,12 @@ :post plat-post ) -(defmethod base-plat-method-32 tomb-plat-wall ((this tomb-plat-wall)) +(defmethod base-plat-method-32 ((this tomb-plat-wall)) 0 (none) ) -(defmethod init-plat-collision! tomb-plat-wall ((this tomb-plat-wall)) +(defmethod init-plat-collision! ((this tomb-plat-wall)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -138,7 +134,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-plat-wall ((this tomb-plat-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-plat-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -181,14 +177,10 @@ This commonly includes things such as: ) (deftype tomb-stair-block-spikes (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -320,36 +312,29 @@ This commonly includes things such as: ) (deftype tomb-stair-block-spike-info (structure) - ((spike handle :offset-assert 0) - (joint int32 :offset-assert 8) - (y-offset float :offset-assert 12) - (up basic :offset-assert 16) - (sounded basic :offset-assert 20) + ((spike handle) + (joint int32) + (y-offset float) + (up basic) + (sounded basic) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) (deftype tomb-stair-block (process-drawable) - ((root collide-shape-moving :override) - (initial-y float :offset-assert 200) - (spike-info tomb-stair-block-spike-info 4 :inline :offset 208) - (camera-state int32 :offset 336) - (sink-sound sound-id :offset 340) - (rise-sound sound-id :offset 344) + ((root collide-shape-moving :override) + (initial-y float) + (spike-info tomb-stair-block-spike-info 4 :inline :offset 208) + (camera-state int32 :offset 336) + (sink-sound sound-id :offset 340) + (rise-sound sound-id :offset 344) ) - :heap-base #xe0 - :method-count-assert 25 - :size-assert #x15c - :flag-assert #x1900e0015c - (:methods - (wait-for-pools () _type_ :state 20) - (idle () _type_ :state 21) - (moving () _type_ :state 22) - (sink () _type_ :state 23) - (sunk () _type_ :state 24) + (:state-methods + wait-for-pools + idle + moving + sink + sunk ) ) @@ -753,7 +738,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-stair-block ((this tomb-stair-block) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-stair-block) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -881,14 +866,10 @@ This commonly includes things such as: (deftype tomb-bounce-web (bouncer) () - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd4 - :flag-assert #x19006000d4 ) -(defmethod init-skeleton! tomb-bounce-web ((this tomb-bounce-web)) +(defmethod init-skeleton! ((this tomb-bounce-web)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-bounce-web" (the-as (pointer uint32) #f))) @@ -899,7 +880,7 @@ This commonly includes things such as: (none) ) -(defmethod bouncer-method-24 tomb-bounce-web ((this tomb-bounce-web)) +(defmethod bouncer-method-24 ((this tomb-bounce-web)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) @@ -952,10 +933,6 @@ This commonly includes things such as: (deftype tomb-plat-pillar (plat) () - :heap-base #xd0 - :method-count-assert 37 - :size-assert #x144 - :flag-assert #x2500d00144 ) @@ -964,18 +941,18 @@ This commonly includes things such as: :bounds (static-spherem 0 -7 0 8) ) -(defmethod get-art-group tomb-plat-pillar ((this tomb-plat-pillar)) +(defmethod get-art-group ((this tomb-plat-pillar)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-plat-pillar" (the-as (pointer uint32) #f)) ) -(defmethod base-plat-method-32 tomb-plat-pillar ((this tomb-plat-pillar)) +(defmethod base-plat-method-32 ((this tomb-plat-pillar)) 0 (none) ) ;; WARN: Return type mismatch collide-shape vs none. -(defmethod init-plat-collision! tomb-plat-pillar ((this tomb-plat-pillar)) +(defmethod init-plat-collision! ((this tomb-plat-pillar)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -999,13 +976,9 @@ This commonly includes things such as: ) (deftype tomb-elevator (elevator) - ((last-pos vector :inline :offset-assert 368) - (speed float :offset-assert 384) + ((last-pos vector :inline) + (speed float) ) - :heap-base #x110 - :method-count-assert 49 - :size-assert #x184 - :flag-assert #x3101100184 ) @@ -1048,7 +1021,7 @@ This commonly includes things such as: ) ) -(defmethod init-defaults! tomb-elevator ((this tomb-elevator)) +(defmethod init-defaults! ((this tomb-elevator)) "Initializes default settings related to the [[elevator]]: - `elevator-xz-threshold` - `elevator-y-threshold` @@ -1063,13 +1036,13 @@ This commonly includes things such as: (none) ) -(defmethod get-art-group tomb-elevator ((this tomb-elevator)) +(defmethod get-art-group ((this tomb-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-elevator" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch collide-shape vs none. -(defmethod init-plat-collision! tomb-elevator ((this tomb-elevator)) +(defmethod init-plat-collision! ((this tomb-elevator)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) @@ -1092,7 +1065,7 @@ This commonly includes things such as: (none) ) -(defmethod set-ambient-sound! tomb-elevator ((this tomb-elevator)) +(defmethod set-ambient-sound! ((this tomb-elevator)) "Sets the elevator's [[ambient-sound]] up" (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "tomb-elevator" :fo-max 70) (-> this root trans)) @@ -1109,15 +1082,11 @@ This commonly includes things such as: (deftype tomb-boss-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-door ((this tomb-boss-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-boss-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1170,10 +1139,6 @@ This commonly includes things such as: (deftype water-anim-tomb (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) @@ -1191,7 +1156,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-tomb ((this water-anim-tomb)) +(defmethod init-water! ((this water-anim-tomb)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) (t9-0 this) @@ -1214,15 +1179,11 @@ This commonly includes things such as: (deftype tomb-wing-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-wing-door ((this tomb-wing-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-wing-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1290,15 +1251,11 @@ This commonly includes things such as: ) (deftype tomb-boulder-door (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (open () _type_ :state 20) - (close () _type_ :state 21) + (:state-methods + open + close ) ) @@ -1339,7 +1296,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boulder-door ((this tomb-boulder-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-boulder-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1377,24 +1334,20 @@ This commonly includes things such as: ) (deftype tomb-plat-return (base-plat) - ((intro-path path-control :offset-assert 272) - (ride-timer time-frame :offset-assert 280) - (flags tomb-plat-flags :offset-assert 288) - (path-pos float :offset-assert 292) - (dest-pos float :offset-assert 296) - (path-speed float :offset-assert 300) - (sound-id sound-id :offset-assert 304) + ((intro-path path-control) + (ride-timer time-frame) + (flags tomb-plat-flags) + (path-pos float) + (dest-pos float) + (path-speed float) + (sound-id sound-id) ) - :heap-base #xc0 - :method-count-assert 39 - :size-assert #x134 - :flag-assert #x2700c00134 - (:methods - (hidden () _type_ :state 34) - (run-intro () _type_ :state 35) - (waiting () _type_ :state 36) - (running () _type_ :state 37) - (waiting-for-no-player () _type_ :state 38) + (:state-methods + hidden + run-intro + waiting + running + waiting-for-no-player ) ) @@ -1566,20 +1519,20 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs tomb-plat-return. -(defmethod relocate tomb-plat-return ((this tomb-plat-return) (arg0 int)) +(defmethod relocate ((this tomb-plat-return) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) ) (the-as tomb-plat-return ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate tomb-plat-return ((this tomb-plat-return)) +(defmethod deactivate ((this tomb-plat-return)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) ) -(defmethod init-plat-collision! tomb-plat-return ((this tomb-plat-return)) +(defmethod init-plat-collision! ((this tomb-plat-return)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1604,7 +1557,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-plat-return ((this tomb-plat-return) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-plat-return) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1724,19 +1677,15 @@ This commonly includes things such as: ) (deftype tomb-sphinx (process-drawable) - ((root collide-shape-moving :override) - (target-actor entity-actor :offset-assert 200) - (sound-id sound-id :offset-assert 204) - (move-dir float :offset 216) + ((root collide-shape-moving :override) + (target-actor entity-actor) + (sound-id sound-id) + (move-dir float :offset 216) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17006000dc - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (doors-open () _type_ :state 22) + (:state-methods + idle + active + doors-open ) ) @@ -1910,18 +1859,18 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs tomb-sphinx. -(defmethod relocate tomb-sphinx ((this tomb-sphinx) (arg0 int)) +(defmethod relocate ((this tomb-sphinx) (arg0 int)) (the-as tomb-sphinx ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate tomb-sphinx ((this tomb-sphinx)) +(defmethod deactivate ((this tomb-sphinx)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-sphinx ((this tomb-sphinx) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-sphinx) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/tomb/tomb-part.gc b/goal_src/jak2/levels/tomb/tomb-part.gc index ac1422578bf..237137bf6bd 100644 --- a/goal_src/jak2/levels/tomb/tomb-part.gc +++ b/goal_src/jak2/levels/tomb/tomb-part.gc @@ -9,10 +9,6 @@ (deftype tomb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/tomb/tomb-water.gc b/goal_src/jak2/levels/tomb/tomb-water.gc index c34a7065d0a..49325adb8a1 100644 --- a/goal_src/jak2/levels/tomb/tomb-water.gc +++ b/goal_src/jak2/levels/tomb/tomb-water.gc @@ -33,16 +33,12 @@ ;; DECOMP BEGINS (deftype tomb-door (process-drawable) - ((notify-actor entity :offset-assert 200) - (round uint32 :offset-assert 204) + ((notify-actor entity) + (round uint32) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (open (time-frame) _type_ :state 21) + (:state-methods + idle + (open time-frame) ) ) @@ -144,7 +140,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-door ((this tomb-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -206,20 +202,16 @@ This commonly includes things such as: ) (deftype tomb-beetle-door (process-drawable) - ((offset vector 3 :inline :offset-assert 208) - (offset-index int32 :offset-assert 256) - (key-index int32 :offset-assert 260) - (beetle handle 3 :offset-assert 264) - (actor-group (pointer actor-group) :offset-assert 288) - (actor-group-count int32 :offset-assert 292) + ((offset vector 3 :inline) + (offset-index int32) + (key-index int32) + (beetle handle 3) + (actor-group (pointer actor-group)) + (actor-group-count int32) ) - :heap-base #xb0 - :method-count-assert 22 - :size-assert #x128 - :flag-assert #x1600b00128 - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) + (:state-methods + idle + open ) ) @@ -317,7 +309,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-beetle-door ((this tomb-beetle-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-beetle-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -402,14 +394,10 @@ This commonly includes things such as: (deftype tomb-button (basebutton) () - :heap-base #xa0 - :method-count-assert 39 - :size-assert #x120 - :flag-assert #x2700a00120 ) -(defmethod basebutton-method-33 tomb-button ((this tomb-button)) +(defmethod basebutton-method-33 ((this tomb-button)) "TODO - joint stuff" (initialize-skeleton this @@ -446,7 +434,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch collide-shape vs none. -(defmethod basebutton-method-34 tomb-button ((this tomb-button)) +(defmethod basebutton-method-34 ((this tomb-button)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -470,7 +458,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch float vs none. -(defmethod prepare-trigger-event! tomb-button ((this tomb-button)) +(defmethod prepare-trigger-event! ((this tomb-button)) "Sets `event-going-down` to `'trigger`" (logior! (-> this button-status) (button-status button-status-4)) (set! (-> this event-going-down) 'cue-chase) @@ -479,21 +467,17 @@ This commonly includes things such as: ) (deftype tomb-beetle-button (tomb-button) - ((round uint32 :offset-assert 288) - (speech-mask uint32 :offset-assert 292) - (speech-timer time-frame :offset-assert 296) + ((round uint32) + (speech-mask uint32) + (speech-timer time-frame) ) - :heap-base #xb0 - :method-count-assert 40 - :size-assert #x130 - :flag-assert #x2800b00130 (:methods - (tomb-beetle-button-method-39 (_type_) none 39) + (tomb-beetle-button-method-39 (_type_) none) ) ) -(defmethod tomb-beetle-button-method-39 tomb-beetle-button ((this tomb-beetle-button)) +(defmethod tomb-beetle-button-method-39 ((this tomb-beetle-button)) (when (time-elapsed? (-> this speech-timer) (seconds 6)) (let ((s5-0 (rand-vu-int-count-excluding 4 (the-as int (-> this speech-mask))))) (let* ((v1-4 s5-0) @@ -656,7 +640,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch symbol vs none. -(defmethod send-event! tomb-beetle-button ((this tomb-beetle-button) (arg0 symbol)) +(defmethod send-event! ((this tomb-beetle-button) (arg0 symbol)) "Prepares an [[event-message-block]] using the provided type to send an event to: - the `notify-actor` - every [[entity-actor]] in the `actor-group` array @@ -701,7 +685,7 @@ This commonly includes things such as: (none) ) -(defmethod prepare-trigger-event! tomb-beetle-button ((this tomb-beetle-button)) +(defmethod prepare-trigger-event! ((this tomb-beetle-button)) "Sets `event-going-down` to `'trigger`" (let ((t9-0 (method-of-type tomb-button prepare-trigger-event!))) (t9-0 this) @@ -719,54 +703,50 @@ This commonly includes things such as: ) (deftype tomb-simon-block (base-plat) - ((sound-show sound-name :offset-assert 272) - (color vector :inline :offset-assert 288) - (my-idx int32 :offset-assert 304) - (next-idx int32 :offset-assert 308) - (flags simon-block-flags :offset-assert 312) - (blink-timer time-frame 2 :offset-assert 320) - (ride-timer time-frame :offset-assert 336) - (order int32 :offset-assert 344) - (base-height float :offset-assert 348) - (move-rate float :offset-assert 352) + ((sound-show sound-name) + (color vector :inline) + (my-idx int32) + (next-idx int32) + (flags simon-block-flags) + (blink-timer time-frame 2) + (ride-timer time-frame) + (order int32) + (base-height float) + (move-rate float) ) - :heap-base #xf0 - :method-count-assert 42 - :size-assert #x164 - :flag-assert #x2a00f00164 + (:state-methods + idle + ready + ridden + temporary + dangerous + wobble-die + die + ) (:methods - (idle () _type_ :state 34) - (ready () _type_ :state 35) - (ridden () _type_ :state 36) - (temporary () _type_ :state 37) - (dangerous () _type_ :state 38) - (wobble-die () _type_ :state 39) - (die () _type_ :state 40) - (set-blink-timers! (_type_) none 41) + (set-blink-timers! (_type_) none) ) ) (deftype tomb-plat-simon (process-drawable) - ((plat (array handle) :offset-assert 200) - (plat-seq (pointer uint32) :offset-assert 204) - (plat-count int32 :offset-assert 208) - (plat-seq-count int32 :offset-assert 212) - (plat-idx int32 :offset-assert 216) - (button-handle handle :offset-assert 224) - (notify-actor entity :offset-assert 232) - (flags uint16 :offset-assert 236) + ((plat (array handle)) + (plat-seq (pointer uint32)) + (plat-count int32) + (plat-seq-count int32) + (plat-idx int32) + (button-handle handle) + (notify-actor entity) + (flags uint16) ) - :heap-base #x70 - :method-count-assert 25 - :size-assert #xee - :flag-assert #x19007000ee + (:state-methods + dormant + appear + show-sequence + idle + ) (:methods - (dormant () _type_ :state 20) - (appear () _type_ :state 21) - (show-sequence () _type_ :state 22) - (idle () _type_ :state 23) - (tomb-plat-simon-method-24 (_type_ int) none 24) + (tomb-plat-simon-method-24 (_type_ int) none) ) ) @@ -1024,7 +1004,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod tomb-plat-simon-method-24 tomb-plat-simon ((this tomb-plat-simon) (arg0 int)) +(defmethod tomb-plat-simon-method-24 ((this tomb-plat-simon) (arg0 int)) (let ((a0-3 (handle->process (-> this plat arg0)))) (send-event a0-3 'ready) ) @@ -1032,7 +1012,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs tomb-plat-simon. -(defmethod relocate tomb-plat-simon ((this tomb-plat-simon) (arg0 int)) +(defmethod relocate ((this tomb-plat-simon) (arg0 int)) (if (nonzero? (-> this plat)) (&+! (-> this plat) arg0) ) @@ -1040,7 +1020,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-plat-simon ((this tomb-plat-simon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-plat-simon) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1444,20 +1424,20 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod set-blink-timers! tomb-simon-block ((this tomb-simon-block)) +(defmethod set-blink-timers! ((this tomb-simon-block)) (logior! (-> this flags) (simon-block-flags blink blink-on)) (set-time! (-> this blink-timer 0)) (set-time! (-> this blink-timer 1)) (none) ) -(defmethod get-art-group tomb-simon-block ((this tomb-simon-block)) +(defmethod get-art-group ((this tomb-simon-block)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-simon-block" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch collide-shape vs none. -(defmethod init-plat-collision! tomb-simon-block ((this tomb-simon-block)) +(defmethod init-plat-collision! ((this tomb-simon-block)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1506,20 +1486,16 @@ This commonly includes things such as: ) (deftype tomb-simon-button (process-drawable) - ((notify-actor entity :offset-assert 200) - (on-notice (function none) :offset-assert 204) - (on-activate (function none) :offset-assert 208) + ((notify-actor entity) + (on-notice (function none)) + (on-activate (function none)) ) - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd4 - :flag-assert #x19006000d4 - (:methods - (idle () _type_ :state 20) - (open (symbol) _type_ :state 21) - (waiting () _type_ :state 22) - (pressed (symbol) _type_ :state 23) - (unpress () _type_ :state 24) + (:state-methods + idle + (open symbol) + waiting + (pressed symbol) + unpress ) ) @@ -1666,7 +1642,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-simon-button ((this tomb-simon-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-simon-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1765,27 +1741,23 @@ This commonly includes things such as: ) (deftype tomb-vibe (process-drawable) - ((spawn-pos vector :inline :offset-assert 208) - (pat-tbl (pointer int32) :offset-assert 224) - (pat-count int32 :offset-assert 228) - (pat-index int32 :offset-assert 232) - (pat-entry-index int32 :offset-assert 236) - (pat-timer time-frame :offset-assert 240) - (pat-duration time-frame :offset-assert 248) - (actor-group (pointer actor-group) :offset-assert 256) - (actor-group-count int32 :offset-assert 260) - (flags tomb-vibe-flags :offset-assert 264) - (on-activate basic :offset-assert 268) + ((spawn-pos vector :inline) + (pat-tbl (pointer int32)) + (pat-count int32) + (pat-index int32) + (pat-entry-index int32) + (pat-timer time-frame) + (pat-duration time-frame) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (flags tomb-vibe-flags) + (on-activate basic) ) - :heap-base #x90 - :method-count-assert 24 - :size-assert #x110 - :flag-assert #x1800900110 - (:methods - (get-pattern () _type_ :state 20) - (idle () _type_ :state 21) - (vibrate () _type_ :state 22) - (die (symbol) _type_ :state 23) + (:state-methods + get-pattern + idle + vibrate + (die symbol) ) ) @@ -2078,7 +2050,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-vibe ((this tomb-vibe) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-vibe) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2203,28 +2175,26 @@ This commonly includes things such as: ) (deftype tomb-water-trap (process-drawable) - ((bbox bounding-box :inline :offset-assert 208) - (run-bbox bounding-box :inline :offset-assert 240) - (sync sync-linear :inline :offset-assert 272) - (on-duration time-frame :offset-assert 288) - (harmless-time time-frame :offset-assert 296) - (l-spec lightning-spec :offset-assert 304) - (l-count uint32 :offset-assert 308) - (l-index (array uint32) :offset-assert 312) - (attack-id uint32 :offset-assert 316) - (volume float :offset-assert 320) - (can-exit-running? symbol :offset-assert 324) + ((bbox bounding-box :inline) + (run-bbox bounding-box :inline) + (sync sync-linear :inline) + (on-duration time-frame) + (harmless-time time-frame) + (l-spec lightning-spec) + (l-count uint32) + (l-index (array uint32)) + (attack-id uint32) + (volume float) + (can-exit-running? symbol) ) - :heap-base #xd0 - :method-count-assert 25 - :size-assert #x148 - :flag-assert #x1900d00148 + (:state-methods + idle + running + ) (:methods - (idle () _type_ :state 20) - (running () _type_ :state 21) - (tomb-water-trap-method-22 (_type_) none 22) - (tomb-water-trap-method-23 (_type_ vector vector) none 23) - (tomb-water-trap-method-24 (_type_ vector vector int) none 24) + (tomb-water-trap-method-22 (_type_) none) + (tomb-water-trap-method-23 (_type_ vector vector) none) + (tomb-water-trap-method-24 (_type_ vector vector int) none) ) ) @@ -2360,7 +2330,7 @@ This commonly includes things such as: ) ) -(defmethod tomb-water-trap-method-22 tomb-water-trap ((this tomb-water-trap)) +(defmethod tomb-water-trap-method-22 ((this tomb-water-trap)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set! (-> gp-0 collide-with) (collide-spec jak bot player-list)) (set! (-> gp-0 ignore-process0) this) @@ -2374,7 +2344,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod tomb-water-trap-method-23 tomb-water-trap ((this tomb-water-trap) (arg0 vector) (arg1 vector)) +(defmethod tomb-water-trap-method-23 ((this tomb-water-trap) (arg0 vector) (arg1 vector)) (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) ) @@ -2420,7 +2390,7 @@ This commonly includes things such as: (none) ) -(defmethod tomb-water-trap-method-24 tomb-water-trap ((this tomb-water-trap) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod tomb-water-trap-method-24 ((this tomb-water-trap) (arg0 vector) (arg1 vector) (arg2 int)) (let ((v1-1 (process-spawn lightning-tracker :init lightning-tracker-init @@ -2454,7 +2424,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs tomb-water-trap. -(defmethod relocate tomb-water-trap ((this tomb-water-trap) (arg0 int)) +(defmethod relocate ((this tomb-water-trap) (arg0 int)) (if (nonzero? (-> this l-index)) (&+! (-> this l-index) arg0) ) @@ -2462,7 +2432,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-water-trap ((this tomb-water-trap) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-water-trap) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2554,17 +2524,13 @@ This commonly includes things such as: ) (deftype tomb-smash-door (process-drawable) - ((timeout time-frame :offset-assert 200) - (button handle :offset-assert 208) + ((timeout time-frame) + (button handle) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xd8 - :flag-assert #x17006000d8 - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) - (close () _type_ :state 22) + (:state-methods + idle + open + close ) ) @@ -2649,7 +2615,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-smash-door ((this tomb-smash-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-smash-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/tomb/widow-baron.gc b/goal_src/jak2/levels/tomb/widow-baron.gc index 5683c5c50bc..103f573e41b 100644 --- a/goal_src/jak2/levels/tomb/widow-baron.gc +++ b/goal_src/jak2/levels/tomb/widow-baron.gc @@ -11,28 +11,25 @@ ;; DECOMP BEGINS (deftype widow-float-seeker (structure) - ((target float :offset-assert 0) - (value float :offset-assert 4) - (vel float :offset-assert 8) - (accel float :offset-assert 12) - (max-vel float :offset-assert 16) - (max-partial float :offset-assert 20) - (bounce-high float :offset-assert 24) + ((target float) + (value float) + (vel float) + (accel float) + (max-vel float) + (max-partial float) + (bounce-high float) ) :allow-misaligned - :method-count-assert 13 - :size-assert #x1c - :flag-assert #xd0000001c (:methods - (widow-float-seeker-method-9 (_type_ float float float float float) none 9) - (widow-float-seeker-method-10 (_type_ (pointer float)) none 10) - (widow-float-seeker-method-11 (_type_ float) none 11) - (widow-float-seeker-method-12 (_type_ float) none 12) + (widow-float-seeker-method-9 (_type_ float float float float float) none) + (widow-float-seeker-method-10 (_type_ (pointer float)) none) + (widow-float-seeker-method-11 (_type_ float) none) + (widow-float-seeker-method-12 (_type_ float) none) ) ) -(defmethod widow-float-seeker-method-9 widow-float-seeker ((this widow-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) +(defmethod widow-float-seeker-method-9 ((this widow-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) (set! (-> this target) arg0) (set! (-> this value) arg0) (set! (-> this vel) 0.0) @@ -44,7 +41,7 @@ (none) ) -(defmethod widow-float-seeker-method-10 widow-float-seeker ((this widow-float-seeker) (arg0 (pointer float))) +(defmethod widow-float-seeker-method-10 ((this widow-float-seeker) (arg0 (pointer float))) (set! (-> this target) (-> arg0 0)) (set! (-> this value) (-> arg0 1)) (set! (-> this vel) (-> arg0 2)) @@ -56,7 +53,7 @@ (none) ) -(defmethod widow-float-seeker-method-11 widow-float-seeker ((this widow-float-seeker) (arg0 float)) +(defmethod widow-float-seeker-method-11 ((this widow-float-seeker) (arg0 float)) (with-pp 0.0 0.0 @@ -90,7 +87,7 @@ ) ) -(defmethod widow-float-seeker-method-12 widow-float-seeker ((this widow-float-seeker) (arg0 float)) +(defmethod widow-float-seeker-method-12 ((this widow-float-seeker) (arg0 float)) (set! (-> this value) (+ (-> this target) arg0)) (set! (-> this vel) 0.0) 0 @@ -98,24 +95,21 @@ ) (deftype widow-rand-vector (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (xz-max float :offset-assert 8) - (y-max float :offset-assert 12) - (timer int32 :offset-assert 16) - (value vector :inline :offset-assert 32) + ((min-time int32) + (max-time int32) + (xz-max float) + (y-max float) + (timer int32) + (value vector :inline) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (init (_type_ int int float float) none 9) - (widow-rand-vector-method-10 (_type_) none 10) + (init (_type_ int int float float) none) + (widow-rand-vector-method-10 (_type_) none) ) ) -(defmethod init widow-rand-vector ((this widow-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) +(defmethod init ((this widow-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) (set! (-> this xz-max) (* 0.5 arg2)) @@ -126,7 +120,7 @@ (none) ) -(defmethod widow-rand-vector-method-10 widow-rand-vector ((this widow-rand-vector)) +(defmethod widow-rand-vector-method-10 ((this widow-rand-vector)) (with-pp (set! (-> this timer) (- (the-as time-frame (-> this timer)) (- (current-time) (-> pp clock old-frame-counter))) @@ -143,24 +137,21 @@ ) (deftype widow-oscillator (structure) - ((target vector :inline :offset-assert 0) - (value vector :inline :offset-assert 16) - (vel vector :inline :offset-assert 32) - (accel float :offset-assert 48) - (max-vel float :offset-assert 52) - (damping float :offset-assert 56) + ((target vector :inline) + (value vector :inline) + (vel vector :inline) + (accel float) + (max-vel float) + (damping float) ) - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (widow-oscillator-method-9 (_type_ vector float float float) none 9) - (widow-oscillator-method-10 (_type_ vector) none 10) + (widow-oscillator-method-9 (_type_ vector float float float) none) + (widow-oscillator-method-10 (_type_ vector) none) ) ) -(defmethod widow-oscillator-method-9 widow-oscillator ((this widow-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod widow-oscillator-method-9 ((this widow-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 (set! (-> this target quad) (-> arg0 quad)) @@ -179,7 +170,7 @@ (none) ) -(defmethod widow-oscillator-method-10 widow-oscillator ((this widow-oscillator) (arg0 vector)) +(defmethod widow-oscillator-method-10 ((this widow-oscillator) (arg0 vector)) (with-pp (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((f30-0 (fmax (-> this max-vel) (vector-length (-> this vel))))) @@ -218,136 +209,128 @@ (deftype widow-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) (deftype widow (process-drawable) - ((bomb handle 8 :offset-assert 200) - (next-launch int32 :offset-assert 264) - (launch-dest vector :inline :offset-assert 272) - (next-jumper int32 :offset-assert 288) - (ammos handle 2 :offset-assert 296) - (ammo-timers time-frame 2 :offset-assert 312) - (bomb-hits int32 :offset-assert 328) - (circle-center vector :inline :offset-assert 336) - (theta cam-float-seeker :inline :offset-assert 352) - (traj trajectory :inline :offset-assert 384) - (osc widow-oscillator :inline :offset-assert 432) - (noise-osc widow-oscillator :inline :offset-assert 496) - (rand-vec widow-rand-vector :inline :offset-assert 560) - (attack-from-high-deg symbol :offset-assert 608) - (which-gun int32 :offset-assert 612) - (which-pod int32 :offset-assert 616) - (left-cover-angle widow-float-seeker :inline :offset 620) - (right-cover-angle widow-float-seeker :inline :offset 648) - (left-cover-jm joint-mod :offset-assert 676) - (right-cover-jm joint-mod :offset-assert 680) - (drill-speed cam-float-seeker :inline :offset-assert 684) - (drill-angle float :offset-assert 708) - (left-drill-jm joint-mod :offset-assert 712) - (right-drill-jm joint-mod :offset-assert 716) - (flying symbol :offset-assert 720) - (previous-anim int32 :offset-assert 724) - (launched-a-bomb symbol :offset-assert 728) - (old-bomb-hits int32 :offset-assert 732) - (catwalk handle 8 :offset-assert 736) - (heart handle :offset-assert 800) - (pod handle :offset-assert 808) - (baron (pointer manipy) :offset-assert 816) - (drill-spark-part sparticle-launch-control :offset-assert 820) - (drill-spark-part-alt sparticle-launch-control :offset-assert 824) - (extract-stone-time time-frame :offset-assert 832) - (extract-stone-part sparticle-launch-control :offset-assert 840) - (insert-stone-time time-frame :offset-assert 848) - (insert-stone-part sparticle-launch-control :offset-assert 856) - (land-part sparticle-launch-control :offset-assert 860) - (green-charge-part sparticle-launch-control :offset-assert 864) - (green-fire-part sparticle-launch-control :offset-assert 868) - (lightning lightning-control 5 :offset-assert 872) - (stop-catwalk-sound symbol :offset-assert 892) - (catwalk-sound sound-id :offset-assert 896) - (drill-sound sound-id :offset-assert 900) - (drill-sound-playing symbol :offset-assert 904) - (drill-sweeten-sound sound-id :offset-assert 908) - (drill-sweeten-sound-playing symbol :offset-assert 912) - (movie-handle handle :offset-assert 920) - (tilt cam-float-seeker :inline :offset-assert 928) - (targetted-catwalk int32 :offset-assert 952) - (hover-sound sound-id :offset-assert 956) - (hover-sound-playing symbol :offset-assert 960) - (shake-sound sound-id :offset-assert 964) - (shake-sound-playing symbol :offset-assert 968) - (hud handle :offset-assert 976) - (last-want-stone-talker int8 :offset-assert 984) - (last-general-flying-talker int8 :offset-assert 985) - (last-launch-droids-talker int8 :offset-assert 986) - (last-launch-bombs-talker int8 :offset-assert 987) - (last-shoot-gun-talker int8 :offset-assert 988) - (last-stone-charge-up-talker int8 :offset-assert 989) - (last-after-stone-shot-talker int8 :offset-assert 990) - (last-leave-perch-talker int8 :offset-assert 991) - (last-damaged-talker int8 :offset-assert 992) - (kicked-bombs int8 :offset-assert 993) - (launch-stages-completed int8 :offset-assert 994) - (current-shoot-stage int16 :offset-assert 996) - (last-gun-hit-stage int16 :offset-assert 998) - (gun-hits int16 :offset-assert 1000) - (last-attack-id uint32 :offset-assert 1004) + ((bomb handle 8) + (next-launch int32) + (launch-dest vector :inline) + (next-jumper int32) + (ammos handle 2) + (ammo-timers time-frame 2) + (bomb-hits int32) + (circle-center vector :inline) + (theta cam-float-seeker :inline) + (traj trajectory :inline) + (osc widow-oscillator :inline) + (noise-osc widow-oscillator :inline) + (rand-vec widow-rand-vector :inline) + (attack-from-high-deg symbol) + (which-gun int32) + (which-pod int32) + (left-cover-angle widow-float-seeker :inline :offset 620) + (right-cover-angle widow-float-seeker :inline :offset 648) + (left-cover-jm joint-mod) + (right-cover-jm joint-mod) + (drill-speed cam-float-seeker :inline) + (drill-angle float) + (left-drill-jm joint-mod) + (right-drill-jm joint-mod) + (flying symbol) + (previous-anim int32) + (launched-a-bomb symbol) + (old-bomb-hits int32) + (catwalk handle 8) + (heart handle) + (pod handle) + (baron (pointer manipy)) + (drill-spark-part sparticle-launch-control) + (drill-spark-part-alt sparticle-launch-control) + (extract-stone-time time-frame) + (extract-stone-part sparticle-launch-control) + (insert-stone-time time-frame) + (insert-stone-part sparticle-launch-control) + (land-part sparticle-launch-control) + (green-charge-part sparticle-launch-control) + (green-fire-part sparticle-launch-control) + (lightning lightning-control 5) + (stop-catwalk-sound symbol) + (catwalk-sound sound-id) + (drill-sound sound-id) + (drill-sound-playing symbol) + (drill-sweeten-sound sound-id) + (drill-sweeten-sound-playing symbol) + (movie-handle handle) + (tilt cam-float-seeker :inline) + (targetted-catwalk int32) + (hover-sound sound-id) + (hover-sound-playing symbol) + (shake-sound sound-id) + (shake-sound-playing symbol) + (hud handle) + (last-want-stone-talker int8) + (last-general-flying-talker int8) + (last-launch-droids-talker int8) + (last-launch-bombs-talker int8) + (last-shoot-gun-talker int8) + (last-stone-charge-up-talker int8) + (last-after-stone-shot-talker int8) + (last-leave-perch-talker int8) + (last-damaged-talker int8) + (kicked-bombs int8) + (launch-stages-completed int8) + (current-shoot-stage int16) + (last-gun-hit-stage int16) + (gun-hits int16) + (last-attack-id uint32) ) - :heap-base #x370 - :method-count-assert 47 - :size-assert #x3f0 - :flag-assert #x2f037003f0 + (:state-methods + beaten + kaboom + hover-low-stage-3 + hover-shooting-stage-3 + hover-launch-bombs-stage-3 + hover-big-blast-stage-3 + hover-rise-stage-3 + hover-jump-down-stage-3 + big-reaction-stage-2 + watch-bombs-stage-2 + launch-bombs-stage-2 + back-to-perch-stage-2 + hover-low-stage-2 + hover-shooting-stage-2 + hover-rise-stage-2 + hover-seek-under-stage-2 + hover-jump-down-stage-2 + launch-droids-stage-2 + big-reaction-stage-1 + watch-bombs-stage-1 + launch-bombs-stage-1 + watch-droids-stage-1 + launch-droids-stage-1 + hidden + ) (:methods - (beaten () _type_ :state 20) - (kaboom () _type_ :state 21) - (hover-low-stage-3 () _type_ :state 22) - (hover-shooting-stage-3 () _type_ :state 23) - (hover-launch-bombs-stage-3 () _type_ :state 24) - (hover-big-blast-stage-3 () _type_ :state 25) - (hover-rise-stage-3 () _type_ :state 26) - (hover-jump-down-stage-3 () _type_ :state 27) - (big-reaction-stage-2 () _type_ :state 28) - (watch-bombs-stage-2 () _type_ :state 29) - (launch-bombs-stage-2 () _type_ :state 30) - (back-to-perch-stage-2 () _type_ :state 31) - (hover-low-stage-2 () _type_ :state 32) - (hover-shooting-stage-2 () _type_ :state 33) - (hover-rise-stage-2 () _type_ :state 34) - (hover-seek-under-stage-2 () _type_ :state 35) - (hover-jump-down-stage-2 () _type_ :state 36) - (launch-droids-stage-2 () _type_ :state 37) - (big-reaction-stage-1 () _type_ :state 38) - (watch-bombs-stage-1 () _type_ :state 39) - (launch-bombs-stage-1 () _type_ :state 40) - (watch-droids-stage-1 () _type_ :state 41) - (launch-droids-stage-1 () _type_ :state 42) - (hidden () _type_ :state 43) - (widow-method-44 (_type_ vector vector) symbol 44) - (widow-method-45 (_type_ vector vector vector) none 45) - (widow-method-46 (_type_ vector int) none 46) + (widow-method-44 (_type_ vector vector) symbol) + (widow-method-45 (_type_ vector vector vector) none) + (widow-method-46 (_type_ vector int) none) ) ) (deftype baron-pod (process-drawable) - ((red-tip-change-time time-frame :offset-assert 200) - (alt-red-tip-on symbol :offset-assert 208) - (blink-time time-frame :offset-assert 216) - (blink-mask int32 :offset-assert 224) - (has-stone symbol :offset-assert 228) + ((red-tip-change-time time-frame) + (alt-red-tip-on symbol) + (blink-time time-frame) + (blink-mask int32) + (has-stone symbol) ) - :heap-base #x70 - :method-count-assert 22 - :size-assert #xe8 - :flag-assert #x16007000e8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (baron-pod-method-21 (_type_ symbol) none 21) + (baron-pod-method-21 (_type_ symbol) none) ) ) @@ -359,7 +342,7 @@ :origin-joint-index 3 ) -(defmethod baron-pod-method-21 baron-pod ((this baron-pod) (arg0 symbol)) +(defmethod baron-pod-method-21 ((this baron-pod) (arg0 symbol)) (when (>= (- (current-time) (-> this red-tip-change-time)) 0) (set! (-> this alt-red-tip-on) (not (-> this alt-red-tip-on))) (set! (-> this red-tip-change-time) (+ (current-time) (seconds 0.5))) @@ -513,12 +496,8 @@ (deftype tomb-boss-bridge (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -535,7 +514,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-bridge ((this tomb-boss-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-boss-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/tomb/widow-extras.gc b/goal_src/jak2/levels/tomb/widow-extras.gc index 501403e1a04..d148ca79f70 100644 --- a/goal_src/jak2/levels/tomb/widow-extras.gc +++ b/goal_src/jak2/levels/tomb/widow-extras.gc @@ -8,17 +8,15 @@ ;; DECOMP BEGINS (deftype tomb-boss-catwalk (process-drawable) - ((root collide-shape-moving :override) - (which-look int32 :offset-assert 200) + ((root collide-shape-moving :override) + (which-look int32) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xcc - :flag-assert #x17005000cc + (:state-methods + shatter + idle + ) (:methods - (shatter () _type_ :state 20) - (idle () _type_ :state 21) - (tomb-boss-catwalk-method-22 (_type_ vector int) none 22) + (tomb-boss-catwalk-method-22 (_type_ vector int) none) ) ) @@ -201,7 +199,7 @@ :code sleep-code ) -(defmethod tomb-boss-catwalk-method-22 tomb-boss-catwalk ((this tomb-boss-catwalk) (arg0 vector) (arg1 int)) +(defmethod tomb-boss-catwalk-method-22 ((this tomb-boss-catwalk) (arg0 vector) (arg1 int)) (case arg1 ((1) (let ((s3-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -511,7 +509,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-catwalk ((this tomb-boss-catwalk) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-boss-catwalk) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -538,45 +536,39 @@ This commonly includes things such as: (deftype tomb-boss-catwalk-main (tomb-boss-catwalk) () - :heap-base #x50 - :method-count-assert 23 - :size-assert #xcc - :flag-assert #x17005000cc ) (deftype widow-bomb (process-focusable) - ((traj trajectory :inline :offset-assert 208) - (explode-part sparticle-launch-control :offset-assert 248) - (trail-part sparticle-launch-control :offset-assert 252) - (warning-glow-part sparticle-launch-control :offset-assert 256) - (warning-spark-part sparticle-launch-control :offset-assert 260) - (impact impact-control :inline :offset-assert 272) - (which-trajectory int32 :offset-assert 352) - (next-countdown-tick time-frame :offset-assert 360) - (skid-part sparticle-launch-control :offset-assert 368) - (x-rotate float :offset-assert 372) - (y-rotate float :offset-assert 376) - (spin-jm joint-mod :offset-assert 380) - (firework-sound-played symbol :offset-assert 384) - (steam-sound sound-id :offset-assert 388) - (launch vector :inline :offset-assert 400) - (launch-pos vector :inline :offset-assert 416) - (fizzle-timer time-frame :offset-assert 432) + ((traj trajectory :inline) + (explode-part sparticle-launch-control) + (trail-part sparticle-launch-control) + (warning-glow-part sparticle-launch-control) + (warning-spark-part sparticle-launch-control) + (impact impact-control :inline) + (which-trajectory int32) + (next-countdown-tick time-frame) + (skid-part sparticle-launch-control) + (x-rotate float) + (y-rotate float) + (spin-jm joint-mod) + (firework-sound-played symbol) + (steam-sound sound-id) + (launch vector :inline) + (launch-pos vector :inline) + (fizzle-timer time-frame) ) - :heap-base #x140 - :method-count-assert 35 - :size-assert #x1b8 - :flag-assert #x23014001b8 + (:state-methods + freefall + back-atcha + explode + smoke + idle + ) (:methods - (freefall () _type_ :state 27) - (back-atcha () _type_ :state 28) - (explode () _type_ :state 29) - (smoke () _type_ :state 30) - (idle () _type_ :state 31) - (widow-bomb-method-32 (_type_) none 32) - (widow-bomb-method-33 (_type_) none 33) - (widow-bomb-method-34 (_type_) none 34) + (widow-bomb-method-32 (_type_) none) + (widow-bomb-method-33 (_type_) none) + (widow-bomb-method-34 (_type_) none) ) ) @@ -592,7 +584,7 @@ This commonly includes things such as: ;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 -(defmethod widow-bomb-method-34 widow-bomb ((this widow-bomb)) +(defmethod widow-bomb-method-34 ((this widow-bomb)) (local-vars (sv-48 float) (sv-64 float)) (let ((s5-0 (new 'stack-no-clear 'quaternion)) (gp-0 (new 'stack-no-clear 'quaternion)) @@ -905,7 +897,7 @@ This commonly includes things such as: :post ja-post ) -(defmethod widow-bomb-method-32 widow-bomb ((this widow-bomb)) +(defmethod widow-bomb-method-32 ((this widow-bomb)) (spawn-with-cspace (-> this part) (-> this node-list data 3)) (sound-play "w-bomb-steam" :id (-> this steam-sound) :position (-> this root trans)) (let ((s5-0 (the-as int (- (current-time) (-> this state-time))))) @@ -974,7 +966,7 @@ This commonly includes things such as: :post ja-post ) -(defmethod widow-bomb-method-33 widow-bomb ((this widow-bomb)) +(defmethod widow-bomb-method-33 ((this widow-bomb)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (set-vector! (-> gp-0 vector 1) 0.0 1.0 0.0 1.0) (vector-! (-> gp-0 vector 2) (the-as vector (-> this impact trans)) (-> this impact trans 1)) @@ -1177,7 +1169,7 @@ This commonly includes things such as: ) ) -(defmethod deactivate widow-bomb ((this widow-bomb)) +(defmethod deactivate ((this widow-bomb)) (if (nonzero? (-> this explode-part)) (kill-and-free-particles (-> this explode-part)) ) @@ -1197,7 +1189,7 @@ This commonly includes things such as: (none) ) -(defmethod relocate widow-bomb ((this widow-bomb) (arg0 int)) +(defmethod relocate ((this widow-bomb) (arg0 int)) (if (nonzero? (-> this explode-part)) (&+! (-> this explode-part) arg0) ) @@ -1297,14 +1289,10 @@ This commonly includes things such as: ) (deftype heart-mar (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1376,19 +1364,15 @@ This commonly includes things such as: ) (deftype tomb-boss-pillar (process-drawable) - ((root collide-shape-moving :override) - (explode-part sparticle-launch-control :offset-assert 200) - (segs-shot int32 :offset-assert 204) - (last-pillar-hit time-frame :offset-assert 208) + ((root collide-shape-moving :override) + (explode-part sparticle-launch-control) + (segs-shot int32) + (last-pillar-hit time-frame) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xd8 - :flag-assert #x17006000d8 - (:methods - (idle () _type_ :state 20) - (break-it () _type_ :state 21) - (broken () _type_ :state 22) + (:state-methods + idle + break-it + broken ) ) @@ -1560,7 +1544,7 @@ This commonly includes things such as: :code sleep-code ) -(defmethod deactivate tomb-boss-pillar ((this tomb-boss-pillar)) +(defmethod deactivate ((this tomb-boss-pillar)) (if (nonzero? (-> this explode-part)) (kill-and-free-particles (-> this explode-part)) ) @@ -1568,7 +1552,7 @@ This commonly includes things such as: (none) ) -(defmethod relocate tomb-boss-pillar ((this tomb-boss-pillar) (arg0 int)) +(defmethod relocate ((this tomb-boss-pillar) (arg0 int)) (if (nonzero? (-> this explode-part)) (&+! (-> this explode-part) arg0) ) @@ -1576,7 +1560,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-pillar ((this tomb-boss-pillar) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-boss-pillar) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1636,16 +1620,12 @@ This commonly includes things such as: ) (deftype tomb-boss-firepot (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc8 - :flag-assert #x17005000c8 - (:methods - (idle () _type_ :state 20) - (break-it () _type_ :state 21) - (broken () _type_ :state 22) + (:state-methods + idle + break-it + broken ) ) @@ -1785,7 +1765,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-firepot ((this tomb-boss-firepot) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-boss-firepot) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1838,7 +1818,7 @@ This commonly includes things such as: (none) ) -(defmethod draw hud-widow ((this hud-widow)) +(defmethod draw ((this hud-widow)) (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 1)) -62 14) @@ -1888,7 +1868,7 @@ This commonly includes things such as: (none) ) -(defmethod init-callback hud-widow ((this hud-widow)) +(defmethod init-callback ((this hud-widow)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/goal_src/jak2/levels/tomb/widow-more-extras.gc b/goal_src/jak2/levels/tomb/widow-more-extras.gc index 229b63ee49e..aa935d677bc 100644 --- a/goal_src/jak2/levels/tomb/widow-more-extras.gc +++ b/goal_src/jak2/levels/tomb/widow-more-extras.gc @@ -8,20 +8,16 @@ ;; DECOMP BEGINS (deftype tomb-boss-debris (process-drawable) - ((root collide-shape-moving :override) - (y-velocity float :offset-assert 200) - (floor float :offset-assert 204) - (sound-floor float :offset-assert 208) - (rot quaternion :inline :offset-assert 224) - (look int32 :offset-assert 240) + ((root collide-shape-moving :override) + (y-velocity float) + (floor float) + (sound-floor float) + (rot quaternion :inline) + (look int32) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf4 - :flag-assert #x16008000f4 - (:methods - (die () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + die + idle ) ) @@ -418,15 +414,11 @@ ) (deftype cave-in-master (process-drawable) - ((prev-points int32 100 :offset-assert 200) + ((prev-points int32 100) ) - :heap-base #x1e0 - :method-count-assert 22 - :size-assert #x258 - :flag-assert #x1601e00258 - (:methods - (idle () _type_ :state 20) - (wait () _type_ :state 21) + (:state-methods + idle + wait ) ) @@ -482,7 +474,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cave-in-master ((this cave-in-master) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cave-in-master) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/tomb/widow2.gc b/goal_src/jak2/levels/tomb/widow2.gc index 820944ae6cd..bf36654e0c8 100644 --- a/goal_src/jak2/levels/tomb/widow2.gc +++ b/goal_src/jak2/levels/tomb/widow2.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod deal-damage! widow-shot ((this widow-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! ((this widow-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((t9-0 (method-of-type projectile deal-damage!))) (when (t9-0 this arg0 arg1) @@ -20,7 +20,7 @@ ) ) -(defmethod widow-method-44 widow ((this widow) (arg0 vector) (arg1 vector)) +(defmethod widow-method-44 ((this widow) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set! (-> gp-0 start-pos quad) (-> arg0 quad)) (vector-normalize-copy! (-> gp-0 move-dist) arg1 81920.0) @@ -40,7 +40,7 @@ ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod widow-method-45 widow ((this widow) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod widow-method-45 ((this widow) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((f30-0 (/ 2013265900.0 (vector-length arg2))) (s3-0 (new 'stack-no-clear 'vector)) @@ -77,7 +77,7 @@ (none) ) -(defmethod widow-method-46 widow ((this widow) (arg0 vector) (arg1 int)) +(defmethod widow-method-46 ((this widow) (arg0 vector) (arg1 int)) (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg1))) (s3-0 (new 'stack-no-clear 'vector)) ) @@ -90,7 +90,7 @@ (none) ) -(defmethod deactivate widow ((this widow)) +(defmethod deactivate ((this widow)) (if (nonzero? (-> this drill-spark-part)) (kill-and-free-particles (-> this drill-spark-part)) ) @@ -129,7 +129,7 @@ ) ;; WARN: Return type mismatch process-drawable vs widow. -(defmethod relocate widow ((this widow) (arg0 int)) +(defmethod relocate ((this widow) (arg0 int)) (if (nonzero? (-> this left-cover-jm)) (&+! (-> this left-cover-jm) arg0) ) @@ -172,7 +172,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! widow ((this widow) (arg0 entity-actor)) +(defmethod init-from-entity! ((this widow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/under/centipede.gc b/goal_src/jak2/levels/under/centipede.gc index 4966e54f3f6..cc95506bd77 100644 --- a/goal_src/jak2/levels/under/centipede.gc +++ b/goal_src/jak2/levels/under/centipede.gc @@ -8,53 +8,48 @@ ;; DECOMP BEGINS (deftype centipede-cam (structure) - ((init? symbol :offset-assert 0) - (trans vector :inline :offset-assert 16) - (dir vector :inline :offset-assert 32) - (track-focus-tilt float :offset-assert 48) + ((init? symbol) + (trans vector :inline) + (dir vector :inline) + (track-focus-tilt float) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) (deftype centipede (nav-enemy) - ((id int8 :offset-assert 604) - (anim-ctr int8 :offset-assert 605) - (focus-pos-hist-count int8 :offset-assert 606) - (legs-sound ambient-sound :offset-assert 608) - (grabbed-focus? symbol :offset-assert 612) - (using-chan1-effects? symbol :offset-assert 616) - (set-camera-mode? symbol :offset-assert 620) - (talking-volume float :offset-assert 624) - (desired-talking-volume float :offset-assert 628) - (legs-volume float :offset-assert 632) - (focus-gnd-height float :offset-assert 636) - (track-focus-tilt float :offset-assert 640) - (bobbing-intensity float :offset-assert 644) - (bobbing trsqv :offset-assert 648) - (src-quat quaternion :inline :offset-assert 656) - (dest-quat quaternion :inline :offset-assert 672) - (cam centipede-cam :inline :offset-assert 688) - (focus-pos-hist vector 15 :inline :offset-assert 752) + ((id int8) + (anim-ctr int8) + (focus-pos-hist-count int8) + (legs-sound ambient-sound) + (grabbed-focus? symbol) + (using-chan1-effects? symbol) + (set-camera-mode? symbol) + (talking-volume float) + (desired-talking-volume float) + (legs-volume float) + (focus-gnd-height float) + (track-focus-tilt float) + (bobbing-intensity float) + (bobbing trsqv) + (src-quat quaternion :inline) + (dest-quat quaternion :inline) + (cam centipede-cam :inline) + (focus-pos-hist vector 15 :inline) ) - :heap-base #x360 - :method-count-assert 189 - :size-assert #x3e0 - :flag-assert #xbd036003e0 + (:state-methods + attack + attack-failed + hidden + grab-cam + thru-grating + ) (:methods - (attack () _type_ :state 178) - (attack-failed () _type_ :state 179) - (hidden () _type_ :state 180) - (grab-cam () _type_ :state 181) - (thru-grating () _type_ :state 182) - (centipede-method-183 (_type_) none 183) - (set-chan1-effects (_type_) none 184) - (target-close? (_type_) symbol 185) - (centipede-method-186 (_type_) none 186) - (centipede-method-187 (_type_) none 187) - (centipede-method-188 (_type_) none 188) + (centipede-method-183 (_type_) none) + (set-chan1-effects (_type_) none) + (target-close? (_type_) symbol) + (centipede-method-186 (_type_) none) + (centipede-method-187 (_type_) none) + (centipede-method-188 (_type_) none) ) ) @@ -176,7 +171,7 @@ (set! (-> *centipede-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler centipede ((this centipede) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this centipede) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -190,7 +185,7 @@ ) ;; WARN: Return type mismatch nav-enemy vs centipede. -(defmethod relocate centipede ((this centipede) (arg0 int)) +(defmethod relocate ((this centipede) (arg0 int)) (if (nonzero? (-> this bobbing)) (&+! (-> this bobbing) arg0) ) @@ -200,7 +195,7 @@ (the-as centipede ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod deactivate centipede ((this centipede)) +(defmethod deactivate ((this centipede)) (when (-> this set-camera-mode?) (set! (-> this set-camera-mode?) #f) (remove-setting-by-arg0 *setting-control* 'mode-name) @@ -213,7 +208,7 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod centipede-method-187 centipede ((this centipede)) +(defmethod centipede-method-187 ((this centipede)) (let ((centipede-cam (-> this cam))) (let ((cam-dir (new 'stack-no-clear 'vector))) (set! (-> cam-dir quad) (-> centipede-cam dir quad)) @@ -313,7 +308,7 @@ (none) ) -(defmethod centipede-method-188 centipede ((this centipede)) +(defmethod centipede-method-188 ((this centipede)) (local-vars (s5-0 art-element)) (let ((janim (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) @@ -431,7 +426,7 @@ (none) ) -(defmethod set-chan1-effects centipede ((this centipede)) +(defmethod set-chan1-effects ((this centipede)) (when (-> this using-chan1-effects?) (set! (-> this using-chan1-effects?) #f) (let ((v1-2 (-> this skel effect))) @@ -443,7 +438,7 @@ ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod nav-enemy-method-142 centipede ((this centipede) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this centipede) (arg0 nav-control)) (let ((t9-0 (method-of-type nav-enemy nav-enemy-method-142))) (t9-0 this arg0) ) @@ -507,12 +502,12 @@ (none) ) -(defmethod coin-flip? centipede ((this centipede)) +(defmethod coin-flip? ((this centipede)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod in-aggro-range? centipede ((this centipede) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this centipede) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -543,7 +538,7 @@ ) ;; WARN: Return type mismatch process vs process-focusable. -(defmethod get-enemy-target centipede ((this centipede)) +(defmethod get-enemy-target ((this centipede)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" (let ((v0-0 (handle->process (-> this focus handle)))) (if (and v0-0 (focus-test? (the-as process-focusable v0-0) disable dead grabbed)) @@ -553,7 +548,7 @@ ) ) -(defmethod target-close? centipede ((this centipede)) +(defmethod target-close? ((this centipede)) "Is the target close enough to attack?" (let ((targ (get-enemy-target this))) (when targ @@ -569,7 +564,7 @@ ) ) -(defmethod centipede-method-183 centipede ((this centipede)) +(defmethod centipede-method-183 ((this centipede)) (when (not (and (-> this next-state) (= (-> this next-state name) 'thru-grating))) (centipede-method-187 this) (when (= (-> this id) 2) @@ -614,7 +609,7 @@ (none) ) -(defmethod track-target! centipede ((this centipede)) +(defmethod track-target! ((this centipede)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -694,7 +689,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle centipede ((this centipede)) +(defmethod go-idle ((this centipede)) (case (-> this id) ((1) (cond @@ -982,7 +977,7 @@ ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod centipede-method-186 centipede ((this centipede)) +(defmethod centipede-method-186 ((this centipede)) (let ((proc (handle->process (-> this focus handle)))) (when proc (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable proc) 0) quad)) @@ -1171,7 +1166,7 @@ ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! centipede ((this centipede)) +(defmethod init-enemy-collision! ((this centipede)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1262,7 +1257,7 @@ (none) ) -(defmethod init-enemy! centipede ((this centipede)) +(defmethod init-enemy! ((this centipede)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (set! (-> this id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) (set! (-> this cam init?) #t) diff --git a/goal_src/jak2/levels/under/jellyfish.gc b/goal_src/jak2/levels/under/jellyfish.gc index 86bdc6a929d..eb025b570fc 100644 --- a/goal_src/jak2/levels/under/jellyfish.gc +++ b/goal_src/jak2/levels/under/jellyfish.gc @@ -9,27 +9,20 @@ (deftype jellyfish-formation (hover-formation) () - :heap-base #x10 - :method-count-assert 16 - :size-assert #x90 - :flag-assert #x1000100090 ) -(defmethod hover-formation-method-15 jellyfish-formation ((this jellyfish-formation) (arg0 vector) (arg1 vector)) +(defmethod hover-formation-method-15 ((this jellyfish-formation) (arg0 vector) (arg1 vector)) (logior! (-> this formation flags) 2) 0 ) (deftype jellyfish-chain-physics (chain-physics) () - :method-count-assert 18 - :size-assert #x570 - :flag-assert #x1200000570 ) -(defmethod apply-gravity jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity ((this jellyfish-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (vector-float*! arg0 (-> this gravity) @@ -40,7 +33,7 @@ (none) ) -(defmethod chain-physics-method-14 jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 ((this jellyfish-chain-physics) (arg0 vector) (arg1 int)) (vector-float*! arg0 (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 1) 64))) @@ -50,14 +43,14 @@ (none) ) -(defmethod chain-physics-method-16 jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 ((this jellyfish-chain-physics) (arg0 int)) (if (zero? arg0) 0.0 5461.3335 ) ) -(defmethod gravity-update jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 process-drawable)) +(defmethod gravity-update ((this jellyfish-chain-physics) (arg0 process-drawable)) ((method-of-type chain-physics gravity-update) this arg0) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((s5-0 (new 'stack-no-clear 'bounding-box))) @@ -85,7 +78,7 @@ (none) ) -(defmethod chain-physics-method-17 jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-17 ((this jellyfish-chain-physics) (arg0 vector) (arg1 int)) (local-vars (v1-26 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -152,43 +145,41 @@ ) (deftype jellyfish (hover-enemy) - ((los los-control :inline :offset-assert 784) - (sync sync-eased :inline :offset-assert 936) - (sound-id sound-id :offset-assert 980) - (path-player-u float :offset-assert 984) - (path-my-u float :offset-assert 988) - (path-y-offset float :offset-assert 992) - (path-stare-u float :offset-assert 996) - (tentacle-clock float :offset-assert 1000) - (tentacle-blend float :offset-assert 1004) - (last-attack-time time-frame :offset-assert 1008) - (last-fire-time time-frame :offset-assert 1016) - (charge-path-timer time-frame :offset-assert 1024) - (tentacles jellyfish-chain-physics 5 :offset-assert 1032) - (tentacles-initialized symbol :offset-assert 1052) - (stare-pos vector :inline :offset-assert 1056) - (charge-pos vector :inline :offset-assert 1072) - (grab-front symbol :offset-assert 1088) - (grab-offset vector :inline :offset-assert 1104) - (grab-start-pos vector :inline :offset-assert 1120) - (grab-start-quat quaternion :inline :offset-assert 1136) - (focus-rot quaternion :inline :offset-assert 1152) - (attach-lerp float :offset-assert 1168) + ((los los-control :inline) + (sync sync-eased :inline) + (sound-id sound-id) + (path-player-u float) + (path-my-u float) + (path-y-offset float) + (path-stare-u float) + (tentacle-clock float) + (tentacle-blend float) + (last-attack-time time-frame) + (last-fire-time time-frame) + (charge-path-timer time-frame) + (tentacles jellyfish-chain-physics 5) + (tentacles-initialized symbol) + (stare-pos vector :inline) + (charge-pos vector :inline) + (grab-front symbol) + (grab-offset vector :inline) + (grab-start-pos vector :inline) + (grab-start-quat quaternion :inline) + (focus-rot quaternion :inline) + (attach-lerp float) ) - :heap-base #x420 - :method-count-assert 165 - :size-assert #x494 - :flag-assert #xa504200494 + (:state-methods + jellyfish-state-156 + threaten + charge-attack + grab-mech + die-now + ) (:methods - (jellyfish-method-156 () none 156) - (threaten () _type_ :state 157) - (charge-attack () _type_ :state 158) - (grab-mech () _type_ :state 159) - (die-now () _type_ :state 160) - (jellyfish-method-161 (_type_ vector float) vector 161) - (jellyfish-method-162 (_type_) symbol 162) - (jellyfish-method-163 (_type_ process-focusable) symbol 163) - (jellyfish-method-164 (_type_ process-focusable) symbol 164) + (jellyfish-method-161 (_type_ vector float) vector) + (jellyfish-method-162 (_type_) symbol) + (jellyfish-method-163 (_type_ process-focusable) symbol) + (jellyfish-method-164 (_type_ process-focusable) symbol) ) ) @@ -196,14 +187,11 @@ (define *jellyfish-mech-reserved* #f) (deftype jellyfish-joint-mod-tentacle-info (structure) - ((axis vector :inline :offset-assert 0) - (angle float :offset-assert 16) - (period float :offset-assert 20) - (offset float :offset-assert 24) + ((axis vector :inline) + (angle float) + (period float) + (offset float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) @@ -335,7 +323,7 @@ (set! (-> *jellyfish-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod hover-enemy-method-151 jellyfish ((this jellyfish)) +(defmethod hover-enemy-method-151 ((this jellyfish)) (new 'static 'hover-enemy-info :fly-forward-anim 2 :fly-backward-anim 2 @@ -349,7 +337,7 @@ ) ) -(defmethod hover-enemy-method-152 jellyfish ((this jellyfish)) +(defmethod hover-enemy-method-152 ((this jellyfish)) (new 'static 'hover-nav-params :max-speed 32768.0 :max-acceleration 24576.0 :friction 0.8) ) @@ -797,7 +785,7 @@ ) ) -(defmethod general-event-handler jellyfish ((this jellyfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this jellyfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -824,14 +812,14 @@ ) ) -(defmethod jellyfish-method-161 jellyfish ((this jellyfish) (arg0 vector) (arg1 float)) +(defmethod jellyfish-method-161 ((this jellyfish) (arg0 vector) (arg1 float)) (get-point-in-path! (-> this path) arg0 arg1 'interp) (+! (-> arg0 y) (-> this path-y-offset)) arg0 ) ;; WARN: Return type mismatch object vs symbol. -(defmethod jellyfish-method-164 jellyfish ((this jellyfish) (arg0 process-focusable)) +(defmethod jellyfish-method-164 ((this jellyfish) (arg0 process-focusable)) (local-vars (v1-10 object)) (jellyfish-method-161 this (new 'stack-no-clear 'vector) (get-norm! (-> this sync) 0)) (let ((s5-1 (jellyfish-method-161 this (new 'stack-no-clear 'vector) (-> this path-player-u))) @@ -879,7 +867,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod jellyfish-method-163 jellyfish ((this jellyfish) (arg0 process-focusable)) +(defmethod jellyfish-method-163 ((this jellyfish) (arg0 process-focusable)) (local-vars (v1-8 object)) (jellyfish-method-161 this (new 'stack-no-clear 'vector) (-> this path-stare-u)) (let ((s5-0 (-> this focus-pos))) @@ -924,7 +912,7 @@ ) ) -(defmethod jellyfish-method-162 jellyfish ((this jellyfish)) +(defmethod jellyfish-method-162 ((this jellyfish)) (local-vars (sv-624 int)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1025,7 +1013,7 @@ (none) ) -(defmethod track-target! jellyfish ((this jellyfish)) +(defmethod track-target! ((this jellyfish)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1067,12 +1055,12 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle jellyfish ((this jellyfish)) +(defmethod go-idle ((this jellyfish)) (go (method-of-object this active)) (none) ) -(defmethod hover-enemy-method-149 jellyfish ((this jellyfish)) +(defmethod hover-enemy-method-149 ((this jellyfish)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-jellyfish" (the-as (pointer uint32) #f))) @@ -1082,11 +1070,11 @@ (none) ) -(defmethod hover-enemy-method-150 jellyfish ((this jellyfish)) +(defmethod hover-enemy-method-150 ((this jellyfish)) *jellyfish-enemy-info* ) -(defmethod init-enemy-collision! jellyfish ((this jellyfish)) +(defmethod init-enemy-collision! ((this jellyfish)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1158,7 +1146,7 @@ ) ;; WARN: Return type mismatch hover-enemy vs jellyfish. -(defmethod relocate jellyfish ((this jellyfish) (arg0 int)) +(defmethod relocate ((this jellyfish) (arg0 int)) (dotimes (v1-0 5) (if (nonzero? (-> this tentacles v1-0)) (&+! (-> this tentacles v1-0) arg0) @@ -1167,13 +1155,13 @@ (the-as jellyfish ((method-of-type hover-enemy relocate) this arg0)) ) -(defmethod deactivate jellyfish ((this jellyfish)) +(defmethod deactivate ((this jellyfish)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) ) -(defmethod init-enemy! jellyfish ((this jellyfish)) +(defmethod init-enemy! ((this jellyfish)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (hover-enemy-method-149 this) (init-enemy-behaviour-and-stats! this (hover-enemy-method-150 this)) diff --git a/goal_src/jak2/levels/under/pipe-grunt.gc b/goal_src/jak2/levels/under/pipe-grunt.gc index ac327719ee0..37a401012d0 100644 --- a/goal_src/jak2/levels/under/pipe-grunt.gc +++ b/goal_src/jak2/levels/under/pipe-grunt.gc @@ -8,24 +8,20 @@ ;; DECOMP BEGINS (deftype pipe-grunt (grunt) - ((pipe-front vector :inline :offset-assert 704) - (pipe-dir vector :inline :offset-assert 720) + ((pipe-front vector :inline) + (pipe-dir vector :inline) ) - :heap-base #x260 - :method-count-assert 187 - :size-assert #x2e0 - :flag-assert #xbb026002e0 (:methods - (pipe-grunt-method-186 (_type_) vector 186) + (pipe-grunt-method-186 (_type_) vector) ) ) -(defmethod go-ambush pipe-grunt ((this pipe-grunt)) +(defmethod go-ambush ((this pipe-grunt)) (go (method-of-object this ambush)) ) -(defmethod pipe-grunt-method-186 pipe-grunt ((this pipe-grunt)) +(defmethod pipe-grunt-method-186 ((this pipe-grunt)) (let ((gp-0 (new 'static 'vector :x -1187061.8 :y -278487.03 :z 8090870.0 :w 1.0))) (let ((v1-0 (new 'static 'vector :x -1148026.9 :y -278487.03 :z 8112414.5 :w 1.0)) (s3-0 (new 'stack-no-clear 'vector)) diff --git a/goal_src/jak2/levels/under/sig5-course.gc b/goal_src/jak2/levels/under/sig5-course.gc index d504c15a0a8..c0fd3747e80 100644 --- a/goal_src/jak2/levels/under/sig5-course.gc +++ b/goal_src/jak2/levels/under/sig5-course.gc @@ -8,39 +8,34 @@ ;; DECOMP BEGINS (deftype sig5-course (bot-course) - ((chase-speeches bot-speech-list-shuffle :offset-assert 48) + ((chase-speeches bot-speech-list-shuffle) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) (deftype sig-under (sig) - ((sig5-course sig5-course :offset 652) - (shot-at-growls-index int8 :offset-assert 1072) - (growls handle 2 :offset-assert 1080) - (next-chase-play-time time-frame :offset 1096) - (grating-broken-time time-frame :offset 1096) - (test-plane plane :inline :offset-assert 1104) + ((sig5-course sig5-course :overlay-at course) + (shot-at-growls-index int8) + (growls handle 2) + (next-chase-play-time time-frame :offset 1096) + (grating-broken-time time-frame :overlay-at next-chase-play-time) + (test-plane plane :inline) ) - :heap-base #x3e0 - :method-count-assert 265 - :size-assert #x460 - :flag-assert #x10903e00460 + (:state-methods + intro-shooting + ) (:methods - (intro-shooting () _type_ :state 259) - (sig-under-method-260 (_type_) symbol 260) - (sig-under-method-261 (_type_ vector vector symbol) symbol 261) - (sig-under-method-262 (_type_ symbol) symbol 262) - (sig-under-method-263 (_type_) none 263) - (sig-under-method-264 (_type_) symbol 264) + (sig-under-method-260 (_type_) symbol) + (sig-under-method-261 (_type_ vector vector symbol) symbol) + (sig-under-method-262 (_type_ symbol) symbol) + (sig-under-method-263 (_type_) none) + (sig-under-method-264 (_type_) symbol) ) ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod sig-under-method-263 sig-under ((this sig-under)) +(defmethod sig-under-method-263 ((this sig-under)) (let ((s5-0 (current-time))) (when (and (>= s5-0 (-> this next-chase-play-time)) (not (channel-active? this (the-as uint 0))) @@ -65,7 +60,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod attacked-by-player? sig-under ((this sig-under) (arg0 process-focusable)) +(defmethod attacked-by-player? ((this sig-under) (arg0 process-focusable)) "Were we attacked by the player?" (the-as symbol @@ -77,7 +72,7 @@ ) ) -(defmethod enemy-method-86 sig-under ((this sig-under)) +(defmethod enemy-method-86 ((this sig-under)) (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) (let ((a1-0 (new 'stack-no-clear 'collide-query))) @@ -89,7 +84,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 sig-under ((this sig-under) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 ((this sig-under) (arg0 process) (arg1 event-message-block)) (the-as symbol (cond @@ -105,7 +100,7 @@ ) ) -(defmethod general-event-handler sig-under ((this sig-under) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this sig-under) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (with-pp @@ -161,7 +156,7 @@ ) ;; WARN: disable def twice: 39. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod sig-under-method-262 sig-under ((this sig-under) (arg0 symbol)) +(defmethod sig-under-method-262 ((this sig-under) (arg0 symbol)) (when (or (logtest? (-> this bot-task-bits) (bot-task-bits botbits-1)) (and arg0 (let ((f0-0 81920.0)) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans))) @@ -181,14 +176,14 @@ ) ) -(defmethod sig-under-method-264 sig-under ((this sig-under)) +(defmethod sig-under-method-264 ((this sig-under)) (and (logtest? (-> this bot-task-bits) (bot-task-bits botbits-3)) (not (channel-active? this (the-as uint 0))) (scene-play this "under-get-sig-out-res" #f) ) ) -(defmethod sig-under-method-260 sig-under ((this sig-under)) +(defmethod sig-under-method-260 ((this sig-under)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -299,7 +294,7 @@ ) ) -(defmethod sig-under-method-261 sig-under ((this sig-under) (arg0 vector) (arg1 vector) (arg2 symbol)) +(defmethod sig-under-method-261 ((this sig-under) (arg0 vector) (arg1 vector) (arg2 symbol)) (set! (-> arg0 w) (- (+ (* (-> arg0 x) (-> this root trans x)) (* (-> arg0 z) (-> this root trans z))))) (let ((v1-2 (new 'stack-no-clear 'vector))) (set! (-> v1-2 quad) (-> arg1 quad)) @@ -420,12 +415,12 @@ :post nav-enemy-simple-post ) -(defmethod alive? sig-under ((this sig-under)) +(defmethod alive? ((this sig-under)) ((method-of-type bot alive?) this) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod init! sig-under ((this sig-under)) +(defmethod init! ((this sig-under)) "Set defaults for various fields." (let ((t9-0 (method-of-type sig init!))) (t9-0 this) @@ -439,7 +434,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sig-under ((this sig-under)) +(defmethod go-idle ((this sig-under)) (cond ((task-node-closed? (game-task-node under-sig-resolution)) (cleanup-for-death this) diff --git a/goal_src/jak2/levels/under/under-laser.gc b/goal_src/jak2/levels/under/under-laser.gc index 27ea68b1f13..24a57794221 100644 --- a/goal_src/jak2/levels/under/under-laser.gc +++ b/goal_src/jak2/levels/under/under-laser.gc @@ -8,16 +8,13 @@ ;; DECOMP BEGINS (deftype under-laser-info (basic) - ((options uint8 :offset-assert 4) - (laser-radius float :offset-assert 8) - (laser-move-dist float :offset-assert 12) - (shadow-top-y float :offset-assert 16) - (shadow-height float :offset-assert 20) - (shadow-radius-adjust float :offset-assert 24) + ((options uint8) + (laser-radius float) + (laser-move-dist float) + (shadow-top-y float) + (shadow-height float) + (shadow-radius-adjust float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) @@ -70,53 +67,43 @@ ) (deftype under-laser-shadow (process-drawable) - ((root collide-shape-moving :override) - (info under-laser-info :offset-assert 200) - (trans-xz-offset vector :inline :offset-assert 208) + ((root collide-shape-moving :override) + (info under-laser-info) + (trans-xz-offset vector :inline) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xe0 - :flag-assert #x15006000e0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype under-laser-slave (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) (deftype under-laser (process-drawable) - ((root collide-shape-moving :override) - (info under-laser-info :offset-assert 200) - (id int8 :offset-assert 204) - (lightning lightning-control :offset-assert 208) - (draw-test-script script-context :offset-assert 212) - (sync sync-eased :inline :offset-assert 216) - (laser-dir vector :inline :offset-assert 272) - (slave-trans-offset vector :inline :offset-assert 288) - (zero-pos vector :inline :offset-assert 304) - (one-pos vector :inline :offset-assert 320) + ((root collide-shape-moving :override) + (info under-laser-info) + (id int8) + (lightning lightning-control) + (draw-test-script script-context) + (sync sync-eased :inline) + (laser-dir vector :inline) + (slave-trans-offset vector :inline) + (zero-pos vector :inline) + (one-pos vector :inline) ) - :heap-base #xd0 - :method-count-assert 23 - :size-assert #x150 - :flag-assert #x1700d00150 + (:state-methods + dormant + idle + ) (:methods - (dormant () _type_ :state 20) - (idle () _type_ :state 21) - (under-laser-method-22 (_type_) none 22) + (under-laser-method-22 (_type_) none) ) ) @@ -238,7 +225,7 @@ ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod under-laser-method-22 under-laser ((this under-laser)) +(defmethod under-laser-method-22 ((this under-laser)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (set! (-> s5-0 start-pos quad) (-> this root trans quad)) (set! (-> s5-0 move-dist quad) (-> this slave-trans-offset quad)) @@ -363,7 +350,7 @@ ) ;; WARN: Return type mismatch process-drawable vs under-laser. -(defmethod relocate under-laser ((this under-laser) (arg0 int)) +(defmethod relocate ((this under-laser) (arg0 int)) (if (nonzero? (-> this lightning)) (&+! (-> this lightning) arg0) ) @@ -371,7 +358,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-laser ((this under-laser) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-laser) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/under/under-obs.gc b/goal_src/jak2/levels/under/under-obs.gc index a4aed8bde47..8b5544ac205 100644 --- a/goal_src/jak2/levels/under/under-obs.gc +++ b/goal_src/jak2/levels/under/under-obs.gc @@ -284,17 +284,13 @@ ) (deftype bubbler (process-drawable) - ((rod-of-god-scale float :offset-assert 200) - (ambient-id sound-id :offset-assert 204) - (last-recharge-time time-frame :offset-assert 208) + ((rod-of-god-scale float) + (ambient-id sound-id) + (last-recharge-time time-frame) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xd8 - :flag-assert #x16006000d8 - (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) + (:state-methods + idle + hidden ) ) @@ -358,14 +354,14 @@ :code sleep-code ) -(defmethod deactivate bubbler ((this bubbler)) +(defmethod deactivate ((this bubbler)) (sound-stop (-> this ambient-id)) ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! bubbler ((this bubbler) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bubbler) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -382,27 +378,23 @@ This commonly includes things such as: ) (deftype under-rise-plat (process-drawable) - ((up-y float :offset-assert 200) - (down-y float :offset-assert 204) - (delta-y float :offset-assert 208) - (up-threshold float :offset-assert 212) - (down-threshold float :offset-assert 216) - (last-ridden time-frame :offset-assert 224) - (ridden symbol :offset-assert 232) - (rider-started basic :offset-assert 236) - (extra-id int32 :offset-assert 240) + ((up-y float) + (down-y float) + (delta-y float) + (up-threshold float) + (down-threshold float) + (last-ridden time-frame) + (ridden symbol) + (rider-started basic) + (extra-id int32) ) - :heap-base #x80 - :method-count-assert 26 - :size-assert #xf4 - :flag-assert #x1a008000f4 - (:methods - (idle-up () _type_ :state 20) - (wait-up () _type_ :state 21) - (going-down () _type_ :state 22) - (idle-down () _type_ :state 23) - (wait-down () _type_ :state 24) - (going-up () _type_ :state 25) + (:state-methods + idle-up + wait-up + going-down + idle-down + wait-down + going-up ) ) @@ -590,7 +582,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-rise-plat ((this under-rise-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-rise-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -649,16 +641,12 @@ This commonly includes things such as: ) (deftype under-buoy-base (process-drawable) - ((release symbol :offset-assert 200) - (open-anim-frame float :offset-assert 204) + ((release symbol) + (open-anim-frame float) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (opened () _type_ :state 21) + (:state-methods + idle + opened ) ) @@ -777,12 +765,8 @@ This commonly includes things such as: (deftype under-buoy-chain (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -844,18 +828,14 @@ This commonly includes things such as: ) (deftype under-buoy-plat (rigid-body-platform) - ((orig-trans vector :inline :offset-assert 384) - (surface-height float :offset-assert 400) - (anchor-point vector :inline :offset-assert 416) - (base (pointer under-buoy-base) :offset-assert 432) + ((orig-trans vector :inline) + (surface-height float) + (anchor-point vector :inline) + (base (pointer under-buoy-base)) ) - :heap-base #x140 - :method-count-assert 59 - :size-assert #x1b4 - :flag-assert #x3b014001b4 - (:methods - (waiting () _type_ :state 57) - (running () _type_ :state 58) + (:state-methods + waiting + running ) ) @@ -865,14 +845,14 @@ This commonly includes things such as: :bounds (static-spherem 0 2 0 5) ) -(defmethod rigid-body-object-method-29 under-buoy-plat ((this under-buoy-plat) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this under-buoy-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this orig-trans)) 0 (none) ) -(defmethod allocate-and-init-cshape under-buoy-plat ((this under-buoy-plat)) +(defmethod allocate-and-init-cshape ((this under-buoy-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -935,11 +915,11 @@ This commonly includes things such as: ) ) -(defmethod rigid-body-platform-method-53 under-buoy-plat ((this under-buoy-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-53 ((this under-buoy-plat) (arg0 vector)) -220341.05 ) -(defmethod rigid-body-platform-method-56 under-buoy-plat ((this under-buoy-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-56 ((this under-buoy-plat) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> this rbody state position)) (set! (-> v1-0 y) 0.0) @@ -956,7 +936,7 @@ This commonly includes things such as: (none) ) -(defmethod init-skel-and-rigid-body under-buoy-plat ((this under-buoy-plat)) +(defmethod init-skel-and-rigid-body ((this under-buoy-plat)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-buoy-plat" (the-as (pointer uint32) #f))) @@ -987,7 +967,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod rigid-body-object-method-34 under-buoy-plat ((this under-buoy-plat)) +(defmethod rigid-body-object-method-34 ((this under-buoy-plat)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) (go (method-of-object this running)) (go (method-of-object this waiting)) @@ -1056,13 +1036,10 @@ This commonly includes things such as: (deftype under-mine-chain-physics (chain-physics) () - :method-count-assert 18 - :size-assert #x570 - :flag-assert #x1200000570 ) -(defmethod apply-gravity under-mine-chain-physics ((this under-mine-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity ((this under-mine-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (local-vars (v1-7 vector) (v1-11 vector) (a0-17 float) (a0-26 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1132,14 +1109,14 @@ This commonly includes things such as: ) ) -(defmethod chain-physics-method-14 under-mine-chain-physics ((this under-mine-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 ((this under-mine-chain-physics) (arg0 vector) (arg1 int)) (vector-reset! arg0) 0 (none) ) ;; WARN: Return type mismatch int vs vector. -(defmethod clamp-length under-mine-chain-physics ((this under-mine-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) +(defmethod clamp-length ((this under-mine-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> arg3 entity trans quad)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -1155,24 +1132,20 @@ This commonly includes things such as: (the-as vector 0) ) -(defmethod chain-physics-method-16 under-mine-chain-physics ((this under-mine-chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 ((this under-mine-chain-physics) (arg0 int)) 21845.334 ) (deftype under-mine (process-drawable) - ((root collide-shape-moving :override) - (chain under-mine-chain-physics :offset-assert 200) - (chain-initialized symbol :offset-assert 204) - (main-mod joint-mod :offset-assert 208) - (head-mod joint-mod :offset-assert 212) + ((root collide-shape-moving :override) + (chain under-mine-chain-physics) + (chain-initialized symbol) + (main-mod joint-mod) + (head-mod joint-mod) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xd8 - :flag-assert #x16006000d8 - (:methods - (explode () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + explode + idle ) ) @@ -1371,7 +1344,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs under-mine. -(defmethod relocate under-mine ((this under-mine) (arg0 int)) +(defmethod relocate ((this under-mine) (arg0 int)) (if (nonzero? (-> this main-mod)) (&+! (-> this main-mod) arg0) ) @@ -1385,7 +1358,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-mine ((this under-mine) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-mine) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1440,14 +1413,10 @@ This commonly includes things such as: ) (deftype under-lift (elevator) - ((sound-id sound-id :offset-assert 368) + ((sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 50 - :size-assert #x174 - :flag-assert #x3201000174 (:methods - (under-lift-method-49 (_type_ symbol) none 49) + (under-lift-method-49 (_type_ symbol) none) ) ) @@ -1457,12 +1426,12 @@ This commonly includes things such as: :bounds (static-spherem 0 0 5.6 9.2) ) -(defmethod get-art-group under-lift ((this under-lift)) +(defmethod get-art-group ((this under-lift)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-under-lift" (the-as (pointer uint32) #f)) ) -(defmethod move-between-points under-lift ((this under-lift) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this under-lift) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -1481,7 +1450,7 @@ This commonly includes things such as: ) ) -(defmethod commited-to-ride? under-lift ((this under-lift)) +(defmethod commited-to-ride? ((this under-lift)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) @@ -1500,7 +1469,7 @@ This commonly includes things such as: ) ) -(defmethod under-lift-method-49 under-lift ((this under-lift) (arg0 symbol)) +(defmethod under-lift-method-49 ((this under-lift) (arg0 symbol)) (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 @@ -1561,13 +1530,13 @@ This commonly includes things such as: ) ) -(defmethod deactivate under-lift ((this under-lift)) +(defmethod deactivate ((this under-lift)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) ) -(defmethod init-plat! under-lift ((this under-lift)) +(defmethod init-plat! ((this under-lift)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this sound-id) (new-sound-id)) @@ -1576,7 +1545,7 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod init-plat-collision! under-lift ((this under-lift)) +(defmethod init-plat-collision! ((this under-lift)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1618,17 +1587,13 @@ For example for an elevator pre-compute the distance between the first and last ) (deftype under-break-door (process-focusable) - ((anim art-joint-anim :offset-assert 204) - (art-name string :offset-assert 208) - (collide-mesh int32 :offset-assert 212) + ((anim art-joint-anim) + (art-name string) + (collide-mesh int32) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd8 - :flag-assert #x1d006000d8 - (:methods - (hit (symbol) _type_ :state 27) - (idle () _type_ :state 28) + (:state-methods + (hit symbol) + idle ) ) @@ -1720,7 +1685,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-door ((this under-break-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-break-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1817,12 +1782,8 @@ This commonly includes things such as: (deftype under-seaweed-a (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1851,7 +1812,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-a ((this under-seaweed-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-seaweed-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1917,12 +1878,8 @@ This commonly includes things such as: (deftype under-seaweed-b (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -1951,7 +1908,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-b ((this under-seaweed-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-seaweed-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1971,12 +1928,8 @@ This commonly includes things such as: (deftype under-seaweed-c (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -2005,7 +1958,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-c ((this under-seaweed-c) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-seaweed-c) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2025,12 +1978,8 @@ This commonly includes things such as: (deftype under-seaweed-d (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) @@ -2059,7 +2008,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-d ((this under-seaweed-d) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-seaweed-d) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2077,7 +2026,7 @@ This commonly includes things such as: (none) ) -(defmethod draw hud-mech-air-tank ((this hud-mech-air-tank)) +(defmethod draw ((this hud-mech-air-tank)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 472.0 (* 100.0 (-> this offset)))) @@ -2099,7 +2048,7 @@ This commonly includes things such as: (none) ) -(defmethod update-values hud-mech-air-tank ((this hud-mech-air-tank)) +(defmethod update-values ((this hud-mech-air-tank)) (set! (-> this values 0 target) (the int (-> *game-info* air-supply))) (logclear! (-> this flags) (hud-flags disable)) ((method-of-type hud update-values) this) @@ -2107,7 +2056,7 @@ This commonly includes things such as: (none) ) -(defmethod init-callback hud-mech-air-tank ((this hud-mech-air-tank)) +(defmethod init-callback ((this hud-mech-air-tank)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/goal_src/jak2/levels/under/under-part.gc b/goal_src/jak2/levels/under/under-part.gc index 00a8fb9704f..545eb32839d 100644 --- a/goal_src/jak2/levels/under/under-part.gc +++ b/goal_src/jak2/levels/under/under-part.gc @@ -9,10 +9,6 @@ (deftype under-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) diff --git a/goal_src/jak2/levels/under/under-shoot-block.gc b/goal_src/jak2/levels/under/under-shoot-block.gc index 74fd3b48502..60611c179a6 100644 --- a/goal_src/jak2/levels/under/under-shoot-block.gc +++ b/goal_src/jak2/levels/under/under-shoot-block.gc @@ -15,47 +15,38 @@ ;; DECOMP BEGINS (deftype under-block-spawner (basic) - ((col int8 :offset-assert 4) - (row int8 :offset-assert 5) - (active-handle handle :offset-assert 8) - (waiting-handle handle :offset-assert 16) - (exploded-time time-frame :offset-assert 24) + ((col int8) + (row int8) + (active-handle handle) + (waiting-handle handle) + (exploded-time time-frame) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) (deftype under-block-slot (basic) - ((col int8 :offset-assert 4) - (row int8 :offset-assert 5) + ((col int8) + (row int8) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) (deftype under-block-puzzle (basic) - ((auto-unlock? symbol :offset-assert 4) - (cells-wide int8 :offset-assert 8) - (cells-tall int8 :offset-assert 9) - (last-block-id int8 :offset-assert 10) - (slot-mask uint8 :offset-assert 11) - (slot-mask-full uint8 :offset-assert 12) - (prev-special-attack-id uint32 :offset-assert 16) - (orient-ry float :offset-assert 20) - (spawners (array under-block-spawner) :offset-assert 24) - (slots (array under-block-slot) :offset-assert 28) - (cells (pointer int32) :offset-assert 32) - (pulse-ops (pointer int8) :offset-assert 36) - (origin vector :inline :offset-assert 48) - (local-to-world matrix :inline :offset-assert 64) + ((auto-unlock? symbol) + (cells-wide int8) + (cells-tall int8) + (last-block-id int8) + (slot-mask uint8) + (slot-mask-full uint8) + (prev-special-attack-id uint32) + (orient-ry float) + (spawners (array under-block-spawner)) + (slots (array under-block-slot)) + (cells (pointer int32)) + (pulse-ops (pointer int8)) + (origin vector :inline) + (local-to-world matrix :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) @@ -622,77 +613,73 @@ ) (deftype under-block (process-focusable) - ((puzzle under-block-puzzle :offset-assert 204) - (my-parent (pointer process) :offset-assert 208) - (prev-attack-id uint32 :offset-assert 212) - (spawner-id int8 :offset-assert 216) - (my-id int8 :offset-assert 217) - (col int8 :offset-assert 218) - (row int8 :offset-assert 219) - (prev-col int8 :offset-assert 220) - (prev-row int8 :offset-assert 221) - (move-dir-x int8 :offset-assert 222) - (move-dir-z int8 :offset-assert 223) - (pulse-op int8 :offset-assert 224) - (pulse-pc int8 :offset-assert 225) - (pulse-ctr int8 :offset-assert 226) - (flags under-block-flags :offset-assert 232) - (activated-time time-frame :offset-assert 240) - (rot-axis vector :inline :offset-assert 256) - (away-from-focal-pt vector :inline :offset-assert 272) + ((puzzle under-block-puzzle) + (my-parent (pointer process)) + (prev-attack-id uint32) + (spawner-id int8) + (my-id int8) + (col int8) + (row int8) + (prev-col int8) + (prev-row int8) + (move-dir-x int8) + (move-dir-z int8) + (pulse-op int8) + (pulse-pc int8) + (pulse-ctr int8) + (flags under-block-flags) + (activated-time time-frame) + (rot-axis vector :inline) + (away-from-focal-pt vector :inline) ) - :heap-base #xa0 - :method-count-assert 51 - :size-assert #x120 - :flag-assert #x3300a00120 + (:state-methods + waiting + rise-up + follow + idle + active + flip + rock + sink-partially + sunk-partially + victory + beaten + fall + explode + die-fast + ) (:methods - (waiting () _type_ :state 27) - (rise-up () _type_ :state 28) - (follow () _type_ :state 29) - (idle () _type_ :state 30) - (active () _type_ :state 31) - (flip () _type_ :state 32) - (rock () _type_ :state 33) - (sink-partially () _type_ :state 34) - (sunk-partially () _type_ :state 35) - (victory () _type_ :state 36) - (beaten () _type_ :state 37) - (fall () _type_ :state 38) - (explode () _type_ :state 39) - (die-fast () _type_ :state 40) - (under-block-method-41 (_type_ symbol) none 41) - (under-block-method-42 (_type_) none 42) - (under-block-method-43 (_type_ int int) symbol 43) - (under-block-method-44 (_type_) symbol 44) - (under-block-method-45 (_type_) none 45) - (under-block-method-46 (_type_ int int) none 46) - (under-block-method-47 (_type_ int int) int 47) - (under-block-method-48 (_type_ int int) symbol 48) - (under-block-method-49 (_type_ int int) symbol 49) - (under-block-method-50 (_type_) none 50) + (under-block-method-41 (_type_ symbol) none) + (under-block-method-42 (_type_) none) + (under-block-method-43 (_type_ int int) symbol) + (under-block-method-44 (_type_) symbol) + (under-block-method-45 (_type_) none) + (under-block-method-46 (_type_ int int) none) + (under-block-method-47 (_type_ int int) int) + (under-block-method-48 (_type_ int int) symbol) + (under-block-method-49 (_type_ int int) symbol) + (under-block-method-50 (_type_) none) ) ) (deftype under-shoot-block (process-drawable) - ((puzzle under-block-puzzle :offset-assert 200) - (actor-group (pointer actor-group) :offset-assert 204) - (allow-unlock? symbol :offset-assert 208) + ((puzzle under-block-puzzle) + (actor-group (pointer actor-group)) + (allow-unlock? symbol) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd4 - :flag-assert #x1d006000d4 + (:state-methods + idle + victory-locked + victory + beaten + ) (:methods - (idle () _type_ :state 20) - (victory-locked () _type_ :state 21) - (victory () _type_ :state 22) - (beaten () _type_ :state 23) - (under-shoot-block-method-24 (_type_ int int) none 24) - (under-shoot-block-method-25 (_type_ int int float int) none 25) - (under-shoot-block-method-26 (_type_) none 26) - (under-shoot-block-method-27 (_type_ symbol) none 27) - (under-shoot-block-method-28 (_type_) int 28) + (under-shoot-block-method-24 (_type_ int int) none) + (under-shoot-block-method-25 (_type_ int int float int) none) + (under-shoot-block-method-26 (_type_) none) + (under-shoot-block-method-27 (_type_ symbol) none) + (under-shoot-block-method-28 (_type_) int) ) ) @@ -795,7 +782,7 @@ ) ) -(defmethod under-block-method-48 under-block ((this under-block) (arg0 int) (arg1 int)) +(defmethod under-block-method-48 ((this under-block) (arg0 int) (arg1 int)) (let ((v1-0 (-> this puzzle))) (when (and (>= arg0 0) (< arg0 (-> v1-0 cells-wide)) (>= arg1 0) (< arg1 (-> v1-0 cells-tall))) (let* ((a1-1 (+ (* arg1 (-> v1-0 cells-wide)) arg0)) @@ -811,7 +798,7 @@ ) ) -(defmethod under-block-method-46 under-block ((this under-block) (arg0 int) (arg1 int)) +(defmethod under-block-method-46 ((this under-block) (arg0 int) (arg1 int)) (let ((v1-0 (-> this puzzle))) (when (and (>= arg0 0) (< arg0 (-> v1-0 cells-wide)) (>= arg1 0) (< arg1 (-> v1-0 cells-tall))) (let ((a1-1 (+ (* arg1 (-> v1-0 cells-wide)) arg0))) @@ -825,7 +812,7 @@ (none) ) -(defmethod under-block-method-47 under-block ((this under-block) (arg0 int) (arg1 int)) +(defmethod under-block-method-47 ((this under-block) (arg0 int) (arg1 int)) (let ((v1-0 (-> this puzzle)) (v0-0 -1) ) @@ -838,17 +825,17 @@ ) ) -(defmethod under-block-method-43 under-block ((this under-block) (arg0 int) (arg1 int)) +(defmethod under-block-method-43 ((this under-block) (arg0 int) (arg1 int)) (let ((v1-3 (under-block-method-47 this (+ (-> this col) arg0) (+ (-> this row) arg1)))) (or (zero? v1-3) (= v1-3 -2) (= v1-3 (-> this my-id))) ) ) -(defmethod under-block-method-49 under-block ((this under-block) (arg0 int) (arg1 int)) +(defmethod under-block-method-49 ((this under-block) (arg0 int) (arg1 int)) (= (under-block-method-47 this (+ (-> this col) arg0) (+ (-> this row) arg1)) -1) ) -(defmethod under-block-method-44 under-block ((this under-block)) +(defmethod under-block-method-44 ((this under-block)) (let ((v1-0 (-> this puzzle)) (a2-0 (-> this puzzle slots)) ) @@ -864,7 +851,7 @@ #f ) -(defmethod under-block-method-42 under-block ((this under-block)) +(defmethod under-block-method-42 ((this under-block)) (set-time! (-> this activated-time)) (logior! (-> this flags) (under-block-flags unbflags-1)) (set! (-> this pulse-pc) 0) @@ -875,7 +862,7 @@ ;; WARN: Return type mismatch object vs none. ;; WARN: Function (method 45 under-block) has a return type of none, but the expression builder found a return statement. -(defmethod under-block-method-45 under-block ((this under-block)) +(defmethod under-block-method-45 ((this under-block)) (let ((v1-0 (-> this puzzle))) (when (logtest? (-> this flags) (under-block-flags unbflags-1)) (cond @@ -937,7 +924,7 @@ (none) ) -(defmethod under-block-method-41 under-block ((this under-block) (arg0 symbol)) +(defmethod under-block-method-41 ((this under-block) (arg0 symbol)) (let ((v1-1 (-> this root root-prim))) (case arg0 (('active) @@ -1191,7 +1178,7 @@ :init-specs ((:scalevel-x (meters 0)) (:scalevel-y :copy scalevel-x) (:fade-a -0.128)) ) -(defmethod under-block-method-50 under-block ((this under-block)) +(defmethod under-block-method-50 ((this under-block)) (with-pp (let ((s5-0 (new @@ -1795,7 +1782,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod under-shoot-block-method-25 under-shoot-block ((this under-shoot-block) (arg0 int) (arg1 int) (arg2 float) (arg3 int)) +(defmethod under-shoot-block-method-25 ((this under-shoot-block) (arg0 int) (arg1 int) (arg2 float) (arg3 int)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (set-vector! (-> gp-0 vector 0) -8192.0 0.0 -8192.0 1.0) (set-vector! (-> gp-0 vector 1) -8192.0 0.0 8192.0 1.0) @@ -1861,7 +1848,7 @@ (none) ) -(defmethod under-shoot-block-method-24 under-shoot-block ((this under-shoot-block) (arg0 int) (arg1 int)) +(defmethod under-shoot-block-method-24 ((this under-shoot-block) (arg0 int) (arg1 int)) (local-vars (v1-11 symbol) (v1-20 symbol)) (let ((a0-1 (-> this puzzle))) (if (>= (-> (the-as (pointer int8) (&+ (-> a0-1 cells) (+ (* arg1 (-> a0-1 cells-wide)) arg0)))) 0) @@ -1903,7 +1890,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod under-shoot-block-method-26 under-shoot-block ((this under-shoot-block)) +(defmethod under-shoot-block-method-26 ((this under-shoot-block)) (countdown (s5-0 (-> this puzzle cells-tall)) (countdown (s4-0 (-> this puzzle cells-wide)) (under-shoot-block-method-24 this s4-0 s5-0) @@ -1912,7 +1899,7 @@ (none) ) -(defmethod under-shoot-block-method-28 under-shoot-block ((this under-shoot-block)) +(defmethod under-shoot-block-method-28 ((this under-shoot-block)) (let* ((v1-0 (-> this puzzle)) (v0-0 (+ (-> v1-0 last-block-id) 1)) ) @@ -1925,7 +1912,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod under-shoot-block-method-27 under-shoot-block ((this under-shoot-block) (arg0 symbol)) +(defmethod under-shoot-block-method-27 ((this under-shoot-block) (arg0 symbol)) (local-vars (sv-16 process) (sv-32 (function int int symbol (pointer process) none :behavior under-block)) @@ -2195,7 +2182,7 @@ :code sleep-code ) -(defmethod deactivate under-shoot-block ((this under-shoot-block)) +(defmethod deactivate ((this under-shoot-block)) (let ((s5-0 (-> this puzzle spawners))) (countdown (s4-0 (-> s5-0 length)) (let ((s3-0 (-> s5-0 s4-0))) @@ -2209,7 +2196,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-shoot-block ((this under-shoot-block) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-shoot-block) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/goal_src/jak2/levels/under/under-sig-obs.gc b/goal_src/jak2/levels/under/under-sig-obs.gc index ae896053a71..7b050b7057f 100644 --- a/goal_src/jak2/levels/under/under-sig-obs.gc +++ b/goal_src/jak2/levels/under/under-sig-obs.gc @@ -8,27 +8,23 @@ ;; DECOMP BEGINS (deftype under-plat-shoot (plat) - ((draw-test-script script-context :offset-assert 324) - (incoming-attack-id uint32 :offset-assert 328) - (angle-flip float :offset-assert 332) - (angle-flip-vel float :offset-assert 336) - (state-flip uint32 :offset-assert 340) - (time-flip uint32 :offset-assert 344) - (disable-track-under basic :offset-assert 348) - (dest-angle float :offset-assert 352) - (on-shake basic :offset-assert 356) - (hint-count float :offset-assert 360) - (hit-time time-frame :offset-assert 368) - (knocked-sound-time time-frame :offset-assert 376) - (axe-flip vector :inline :offset-assert 384) + ((draw-test-script script-context) + (incoming-attack-id uint32) + (angle-flip float) + (angle-flip-vel float) + (state-flip uint32) + (time-flip uint32) + (disable-track-under basic) + (dest-angle float) + (on-shake basic) + (hint-count float) + (hit-time time-frame) + (knocked-sound-time time-frame) + (axe-flip vector :inline) ) - :heap-base #x110 - :method-count-assert 39 - :size-assert #x190 - :flag-assert #x2701100190 - (:methods - (die-falling () _type_ :state 37) - (dormant () _type_ :state 38) + (:state-methods + die-falling + dormant ) ) @@ -38,7 +34,7 @@ :bounds (static-spherem 0 0 0 5.1) ) -(defmethod get-art-group under-plat-shoot ((this under-plat-shoot)) +(defmethod get-art-group ((this under-plat-shoot)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-under-plat-shoot" (the-as (pointer uint32) #f)) ) @@ -57,7 +53,7 @@ ) ) -(defmethod init-plat-collision! under-plat-shoot ((this under-plat-shoot)) +(defmethod init-plat-collision! ((this under-plat-shoot)) "TODO - collision stuff for setting up the platform" (set! (-> this clock) (-> *display* user0-clock)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -104,12 +100,12 @@ (none) ) -(defmethod base-plat-method-32 under-plat-shoot ((this under-plat-shoot)) +(defmethod base-plat-method-32 ((this under-plat-shoot)) 0 (none) ) -(defmethod init-plat! under-plat-shoot ((this under-plat-shoot)) +(defmethod init-plat! ((this under-plat-shoot)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (logclear! (-> this mask) (process-mask actor-pause)) @@ -405,7 +401,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod plat-path-sync under-plat-shoot ((this under-plat-shoot)) +(defmethod plat-path-sync ((this under-plat-shoot)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @@ -423,16 +419,12 @@ otherwise, [[plat::34]] ) (deftype under-break-floor (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc8 - :flag-assert #x17005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (die-fast () _type_ :state 22) + (:state-methods + idle + die + die-fast ) ) @@ -535,7 +527,7 @@ otherwise, [[plat::34]] ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-floor ((this under-break-floor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-break-floor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -596,13 +588,9 @@ This commonly includes things such as: (deftype under-break-wall (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) @@ -630,7 +618,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-wall ((this under-break-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-break-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -691,17 +679,13 @@ This commonly includes things such as: ) (deftype under-break-bridge (process-drawable) - ((root collide-shape-moving :override) - (bridge-id int8 :offset-assert 200) + ((root collide-shape-moving :override) + (bridge-id int8) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc9 - :flag-assert #x17005000c9 - (:methods - (idle () _type_ :state 20) - (broken () _type_ :state 21) - (die () _type_ :state 22) + (:state-methods + idle + broken + die ) ) @@ -752,7 +736,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-bridge ((this under-break-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-break-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -833,14 +817,10 @@ This commonly includes things such as: (deftype under-int-door (process-drawable) () - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc8 - :flag-assert #x17005000c8 - (:methods - (idle-closed () _type_ :state 20) - (open () _type_ :state 21) - (idle-open () _type_ :state 22) + (:state-methods + idle-closed + open + idle-open ) ) @@ -885,7 +865,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-int-door ((this under-int-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-int-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -979,16 +959,12 @@ This commonly includes things such as: ) (deftype under-plat-long (base-plat) - ((sync sync-eased :inline :offset-assert 272) - (move-start vector :inline :offset-assert 320) - (move-end vector :inline :offset-assert 336) + ((sync sync-eased :inline) + (move-start vector :inline) + (move-end vector :inline) ) - :heap-base #xe0 - :method-count-assert 35 - :size-assert #x160 - :flag-assert #x2300e00160 - (:methods - (idle () _type_ :state 34) + (:state-methods + idle ) ) @@ -1010,7 +986,7 @@ This commonly includes things such as: :post plat-post ) -(defmethod init-plat-collision! under-plat-long ((this under-plat-long)) +(defmethod init-plat-collision! ((this under-plat-long)) "TODO - collision stuff for setting up the platform" (set! (-> this clock) (-> *display* user0-clock)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -1036,7 +1012,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-plat-long ((this under-plat-long) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-plat-long) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1106,18 +1082,14 @@ This commonly includes things such as: ) (deftype under-plat-wall (process-drawable) - ((root collide-shape-moving :override) - (extended-amount float :offset-assert 200) - (in-trans vector :inline :offset-assert 208) - (out-trans vector :inline :offset-assert 224) - (sync sync-paused :inline :offset-assert 240) + ((root collide-shape-moving :override) + (extended-amount float) + (in-trans vector :inline) + (out-trans vector :inline) + (sync sync-paused :inline) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x108 - :flag-assert #x1500900108 - (:methods - (active () _type_ :state 20) + (:state-methods + active ) ) @@ -1176,7 +1148,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-plat-wall ((this under-plat-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-plat-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1253,20 +1225,16 @@ This commonly includes things such as: ) (deftype under-pipe-growls (process-drawable) - ((volume float :offset-assert 200) - (desired-volume float :offset-assert 204) - (volume-seek-speed float :offset-assert 208) - (approach-sound-id sound-id :offset-assert 212) - (approach-play-time time-frame :offset-assert 216) + ((volume float) + (desired-volume float) + (volume-seek-speed float) + (approach-sound-id sound-id) + (approach-play-time time-frame) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xe0 - :flag-assert #x17006000e0 - (:methods - (block-puzzle () _type_ :state 20) - (block-puzzle-fade () _type_ :state 21) - (intro-shooting () _type_ :state 22) + (:state-methods + block-puzzle + block-puzzle-fade + intro-shooting ) ) diff --git a/goal_src/jak2/levels/under/underb-master.gc b/goal_src/jak2/levels/under/underb-master.gc index 8639e34360d..b167374587a 100644 --- a/goal_src/jak2/levels/under/underb-master.gc +++ b/goal_src/jak2/levels/under/underb-master.gc @@ -18,16 +18,14 @@ ;; DECOMP BEGINS (deftype under-warp (process-drawable) - ((interp float :offset-assert 200) + ((interp float) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xcc - :flag-assert #x17005000cc + (:state-methods + idle + die-fast + ) (:methods - (idle () _type_ :state 20) - (die-fast () _type_ :state 21) - (under-warp-method-22 (_type_) none 22) + (under-warp-method-22 (_type_) none) ) ) @@ -76,7 +74,7 @@ :code nothing ) -(defmethod under-warp-method-22 under-warp ((this under-warp)) +(defmethod under-warp-method-22 ((this under-warp)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -142,41 +140,39 @@ ) (deftype underb-master (process) - ((warp-handle handle :offset-assert 128) - (tank-handle handle :offset-assert 136) - (underwater-time time-frame :offset-assert 144) - (last-air-beep-time time-frame :offset-assert 152) - (ambient-sound-id sound-id :offset-assert 160) - (air-supply float :offset-assert 164) - (air-charge-up? symbol :offset-assert 168) - (under-water-pitch-mod float :offset-assert 172) - (big-room-entered symbol :offset-assert 176) - (big-room-timer time-frame :offset-assert 184) - (under-plat-player-on symbol :offset-assert 192) - (under-plat-is-up symbol :offset-assert 196) + ((warp-handle handle) + (tank-handle handle) + (underwater-time time-frame) + (last-air-beep-time time-frame) + (ambient-sound-id sound-id) + (air-supply float) + (air-charge-up? symbol) + (under-water-pitch-mod float) + (big-room-entered symbol) + (big-room-timer time-frame) + (under-plat-player-on symbol) + (under-plat-is-up symbol) ) - :heap-base #x50 - :method-count-assert 24 - :size-assert #xc8 - :flag-assert #x18005000c8 + (:state-methods + idle + big-room-player-under + big-room-player-plat + underb-master-state-17 + big-room-player-above + big-room-player-falling + big-room-player-exiting + big-room-player-done + ) (:methods - (idle () _type_ :state 14) - (big-room-player-under () _type_ :state 15) - (big-room-player-plat () _type_ :state 16) - (underb-master-method-17 () none 17) - (big-room-player-above () _type_ :state 18) - (big-room-player-falling () _type_ :state 19) - (big-room-player-exiting () _type_ :state 20) - (big-room-player-done () _type_ :state 21) - (under-warp-check (_type_) symbol 22) - (spawn-air-tank-hud (_type_ symbol) none 23) + (under-warp-check (_type_) symbol) + (spawn-air-tank-hud (_type_ symbol) none) ) ) (define *underb-master* (the-as (pointer underb-master) #f)) -(defmethod deactivate underb-master ((this underb-master)) +(defmethod deactivate ((this underb-master)) (sound-stop (-> this ambient-sound-id)) (send-event (handle->process (-> this warp-handle)) 'die-fast) (set! *underb-master* (the-as (pointer underb-master) #f)) @@ -323,7 +319,7 @@ ) ) -(defmethod under-warp-check underb-master ((this underb-master)) +(defmethod under-warp-check ((this underb-master)) "Used to check whether the underwater warp effect should be drawn." (let ((target-pos (target-pos 0)) (tpos-offset (new 'stack-no-clear 'vector)) @@ -341,7 +337,7 @@ ) ) -(defmethod spawn-air-tank-hud underb-master ((this underb-master) (arg0 symbol)) +(defmethod spawn-air-tank-hud ((this underb-master) (arg0 symbol)) "Spawns or hides the air tank HUD bar." (cond (arg0 @@ -603,39 +599,35 @@ ) (deftype under-locking (process-drawable) - ((id int8 :offset-assert 200) - (up-y float :offset-assert 204) - (down-y float :offset-assert 208) - (mode under-locking-mode :offset-assert 216) - (which-reminder? symbol :offset-assert 224) - (spooled-sound-id sound-id :offset-assert 228) - (draining-part sparticle-launch-control :offset-assert 232) - (actor-group (pointer actor-group) :offset-assert 236) - (spooled-sound-delay int32 :offset-assert 240) - (last-reminder-time time-frame :offset 256) + ((id int8) + (up-y float) + (down-y float) + (mode under-locking-mode) + (which-reminder? symbol) + (spooled-sound-id sound-id) + (draining-part sparticle-launch-control) + (actor-group (pointer actor-group)) + (spooled-sound-delay int32) + (last-reminder-time time-frame :offset 256) ) - :heap-base #x90 - :method-count-assert 24 - :size-assert #x108 - :flag-assert #x1800900108 - (:methods - (startup () _type_ :state 20) - (active () _type_ :state 21) - (filling () _type_ :state 22) - (draining () _type_ :state 23) + (:state-methods + startup + active + filling + draining ) ) ;; WARN: Return type mismatch process-drawable vs under-locking. -(defmethod relocate under-locking ((this under-locking) (arg0 int)) +(defmethod relocate ((this under-locking) (arg0 int)) (if (nonzero? (-> this draining-part)) (&+! (-> this draining-part) arg0) ) (the-as under-locking ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate under-locking ((this under-locking)) +(defmethod deactivate ((this under-locking)) (if (nonzero? (-> this draining-part)) (kill-and-free-particles (-> this draining-part)) ) @@ -1045,7 +1037,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-locking ((this under-locking) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-locking) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1082,10 +1074,6 @@ This commonly includes things such as: (deftype water-anim-under (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) @@ -1102,7 +1090,7 @@ This commonly includes things such as: ) ) -(defmethod init-water! water-anim-under ((this water-anim-under)) +(defmethod init-water! ((this water-anim-under)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) (t9-0 this) diff --git a/goal_src/jak2/pc/damage-number.gc b/goal_src/jak2/pc/damage-number.gc index 4d6adb25d47..8faba8f3992 100644 --- a/goal_src/jak2/pc/damage-number.gc +++ b/goal_src/jak2/pc/damage-number.gc @@ -27,8 +27,10 @@ (font font-context) (y-ofs float) ) + (:state-methods + active + ) (:methods - (active () _type_ :state 14) (initialize-font (_type_) font-context)) ) @@ -75,14 +77,14 @@ ) ) -(defmethod relocate damage-number ((obj damage-number) (diff int)) - (if (nonzero? (-> obj font)) - (&+! (-> obj font) diff) +(defmethod relocate ((this damage-number) (diff int)) + (if (nonzero? (-> this font)) + (&+! (-> this font) diff) ) - (the-as damage-number ((the-as (function process int process) (find-parent-method damage-number 7)) obj diff)) + (call-parent-method this diff) ) -(defmethod initialize-font damage-number ((self damage-number)) +(defmethod initialize-font ((self damage-number)) "create the font that will be used used." (if (zero? (-> self font)) @@ -241,15 +243,16 @@ (prev-bar (pointer health-bar)) (next-bar (pointer health-bar)) ) - (:methods - (idle () _type_ :state 14)) + (:state-methods + idle + ) ) -(defmethod relocate health-bar ((obj health-bar) (diff int)) - (if (nonzero? (-> obj font)) - (&+! (-> obj font) diff) +(defmethod relocate health-bar ((this health-bar) (diff int)) + (if (nonzero? (-> this font)) + (&+! (-> this font) diff) ) - (the-as health-bar ((the-as (function process int process) (find-parent-method health-bar 7)) obj diff)) + (call-parent-method this diff) ) @@ -269,37 +272,37 @@ (defmethod new health-bar-manager ((allocation symbol) (type-to-make type)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj head) #f) - (set! (-> obj tail) #f) - obj) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this head) #f) + (set! (-> this tail) #f) + this) ) -(defmethod append-to-list health-bar-manager ((obj health-bar-manager) (bar-ptr (pointer health-bar))) +(defmethod append-to-list ((this health-bar-manager) (bar-ptr (pointer health-bar))) "add a health bar to the end of the linked list" - (set! (-> bar-ptr 0 prev-bar) (-> obj tail)) + (set! (-> bar-ptr 0 prev-bar) (-> this tail)) (cond - ((-> obj tail) + ((-> this tail) ;; list has stuff - (set! (-> obj tail 0 next-bar) bar-ptr) + (set! (-> this tail 0 next-bar) bar-ptr) ) (else ;; no tail means list is empty. fill head. - (set! (-> obj head) bar-ptr) + (set! (-> this head) bar-ptr) ) ) - (set! (-> obj tail) bar-ptr) + (set! (-> this tail) bar-ptr) bar-ptr) -(defmethod remove-from-list health-bar-manager ((obj health-bar-manager) (bar-ptr (pointer health-bar))) +(defmethod remove-from-list ((this health-bar-manager) (bar-ptr (pointer health-bar))) "remove a health bar from the linked list. call this when deactivating it" - (if (= (-> obj head) bar-ptr) - (set! (-> obj head) (-> bar-ptr 0 next-bar))) - (if (= (-> obj tail) bar-ptr) - (set! (-> obj tail) (-> bar-ptr 0 prev-bar))) + (if (= (-> this head) bar-ptr) + (set! (-> this head) (-> bar-ptr 0 next-bar))) + (if (= (-> this tail) bar-ptr) + (set! (-> this tail) (-> bar-ptr 0 prev-bar))) (if (-> bar-ptr 0 next-bar) (set! (-> bar-ptr 0 next-bar 0 prev-bar) (-> bar-ptr 0 prev-bar))) (if (-> bar-ptr 0 prev-bar) @@ -308,10 +311,10 @@ bar-ptr) -(defmethod get-bar-for-process health-bar-manager ((obj health-bar-manager) (proc process-drawable)) +(defmethod get-bar-for-process ((this health-bar-manager) (proc process-drawable)) "return the health bar associated with that process. #f = not found" - (let ((cur-bar (-> obj head))) + (let ((cur-bar (-> this head))) (while cur-bar (if (= (handle->process (-> cur-bar 0 owner)) proc) (return cur-bar)) @@ -374,7 +377,7 @@ ) -(defmethod deactivate health-bar ((self health-bar)) +(defmethod deactivate ((self health-bar)) (remove-from-list *health-bar-manager* (process->ppointer self)) @@ -416,9 +419,9 @@ -(defmethod send-damage-to-bar health-bar-manager ((obj health-bar-manager) (from process-drawable) (damage int) (hit-points-old int)) +(defmethod send-damage-to-bar ((this health-bar-manager) (from process-drawable) (damage int) (hit-points-old int)) "send damage and hit point information of an enemy to its health bar. creates one if needed." - (let ((the-bar (get-bar-for-process obj from))) + (let ((the-bar (get-bar-for-process this from))) (cond (the-bar (send-event (ppointer->process the-bar) 'damage damage) @@ -430,10 +433,10 @@ the-bar) ) -(defmethod set-proc-bar-hit-points health-bar-manager ((obj health-bar-manager) (proc process-drawable) (hit-points int)) +(defmethod set-proc-bar-hit-points ((this health-bar-manager) (proc process-drawable) (hit-points int)) "simply set the hit points (not max hit points) of a process's health bar" - (let ((the-bar (get-bar-for-process obj proc))) + (let ((the-bar (get-bar-for-process this proc))) (send-event (ppointer->process the-bar) 'set-hit-points hit-points) the-bar) ) diff --git a/goal_src/jak2/pc/debug/anim-tester-x.gc b/goal_src/jak2/pc/debug/anim-tester-x.gc index 6b96cbc9755..8aa11a6bece 100644 --- a/goal_src/jak2/pc/debug/anim-tester-x.gc +++ b/goal_src/jak2/pc/debug/anim-tester-x.gc @@ -40,7 +40,7 @@ (mgeo merc-ctrl :overlay-at extra) ) (:methods - (new (symbol type string basic) _type_ 0) + (new (symbol type string basic) _type_) ) ) @@ -94,7 +94,7 @@ (mg-list atx-list :inline) ) (:methods - (new (symbol type string art-group) _type_ 0) + (new (symbol type string art-group) _type_) ) ) diff --git a/goal_src/jak2/pc/features/autosplit.gc b/goal_src/jak2/pc/features/autosplit.gc index 02ae27c4ffa..9005a45fba7 100644 --- a/goal_src/jak2/pc/features/autosplit.gc +++ b/goal_src/jak2/pc/features/autosplit.gc @@ -16,7 +16,7 @@ "Given a field name in the autosplitter struct, and a [[game-task]] name to check, sets either a 0 or a 1" `(set! (-> this ,field-name) (if (task-complete? *game-info* (game-task ,task-name)) 1 0))) -(defmethod update! autosplit-info ((this autosplit-info)) +(defmethod update! ((this autosplit-info)) ;; general statistics (set! (-> this num-orbs) (the int (-> *game-info* skill-total))) (set! (-> this num-skullgems) (the int (-> *game-info* gem-total))) @@ -130,6 +130,6 @@ (none)) -(defmethod reset! autosplit-info ((this autosplit-info)) +(defmethod reset! ((this autosplit-info)) (set! (-> this game-hash) (pc-get-unix-timestamp)) (none)) diff --git a/goal_src/jak2/pc/features/speedruns.gc b/goal_src/jak2/pc/features/speedruns.gc index 01fc1289527..af58fde1ab2 100644 --- a/goal_src/jak2/pc/features/speedruns.gc +++ b/goal_src/jak2/pc/features/speedruns.gc @@ -3,11 +3,11 @@ (define *speedrun-info* (new 'static 'speedrun-info)) -(defmethod set-category! speedrun-info ((this speedrun-info) (category speedrun-category)) +(defmethod set-category! ((this speedrun-info) (category speedrun-category)) (set! (-> this category) category) (none)) -(defmethod start-run! speedrun-info ((this speedrun-info)) +(defmethod start-run! ((this speedrun-info)) ;; randomize game id so the autosplitter knows to restart (reset! *autosplit-info-jak2*) ;; turn on speedrun verification display @@ -22,17 +22,17 @@ (initialize! *game-info* 'game (the-as game-save #f) "game-start-hero"))) (none)) -(defmethod enforce-settings! speedrun-info ((this speedrun-info)) +(defmethod enforce-settings! ((this speedrun-info)) (set! (-> *pc-settings* ps2-actor-vis?) #t) ;; force PS2 actor visibility (set-frame-rate! *pc-settings* 60 #t) ;; force FPS to `60` (set! (-> *pc-settings* cheats) (the-as pc-cheats #x0)) ;; disable any active cheats (none)) -(defmethod hide-run-info! speedrun-info ((this speedrun-info)) +(defmethod hide-run-info! ((this speedrun-info)) (set! (-> this display-run-info?) #f) (none)) -(defmethod update! speedrun-info ((this speedrun-info)) +(defmethod update! ((this speedrun-info)) "A per frame update for speedrunning related stuff" ;; Ensure the speedrunner menu process is enabled or destroyed (when (and (-> *pc-settings* speedrunner-mode?) @@ -55,7 +55,7 @@ (enforce-settings! this)) (none)) -(defmethod draw-run-info! speedrun-info ((this speedrun-info)) +(defmethod draw-run-info! ((this speedrun-info)) "Draw speedrun related settings in the bottom left corner" (when (and (-> *pc-settings* speedrunner-mode?) (-> this display-run-info?)) @@ -97,7 +97,7 @@ (go idle) (none)) -(defmethod deactivate speedrun-menu ((this speedrun-menu)) +(defmethod deactivate ((this speedrun-menu)) (set! *speedrun-menu* (the-as (pointer speedrun-menu) #f)) ((method-of-type process-drawable deactivate) this) (none)) @@ -123,7 +123,7 @@ :post (behavior () (none))) -(defmethod draw! speedrun-menu ((this speedrun-menu)) +(defmethod draw! ((this speedrun-menu)) ;; handle opening and closing the menu ;; allow the menu to be toggled again once one of the currents is released (when (and (-> this ignore-menu-toggle?) diff --git a/goal_src/jak2/pc/pckernel-impl.gc b/goal_src/jak2/pc/pckernel-impl.gc index a61e4515c7c..cf11877d816 100644 --- a/goal_src/jak2/pc/pckernel-impl.gc +++ b/goal_src/jak2/pc/pckernel-impl.gc @@ -130,7 +130,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod reset-misc pc-settings-jak2 ((obj pc-settings-jak2) (call-handlers symbol)) +(defmethod reset-misc ((obj pc-settings-jak2) (call-handlers symbol)) "Set the default misc settings" ((method-of-type pc-settings reset-misc) obj call-handlers) @@ -143,7 +143,7 @@ (true! (-> obj hires-clouds?)) 0) -(defmethod reset-extra pc-settings-jak2 ((obj pc-settings-jak2) (call-handlers symbol)) +(defmethod reset-extra ((obj pc-settings-jak2) (call-handlers symbol)) "Set the default goodies settings" ((method-of-type pc-settings reset-extra) obj call-handlers) @@ -157,7 +157,7 @@ (set! (-> obj flava-unlocked i) #f)) 0) -(defmethod reset-input pc-settings-jak2 ((obj pc-settings-jak2) (device symbol) (call-handlers symbol)) +(defmethod reset-input ((obj pc-settings-jak2) (device symbol) (call-handlers symbol)) "Set the default input settings" ((method-of-type pc-settings reset-input) obj device call-handlers) diff --git a/goal_src/jak2/pc/pckernel.gc b/goal_src/jak2/pc/pckernel.gc index 952b76915cd..a9eee44ec17 100644 --- a/goal_src/jak2/pc/pckernel.gc +++ b/goal_src/jak2/pc/pckernel.gc @@ -95,7 +95,7 @@ ) ) -(defmethod enable led-fader-state ((this led-fader-state) (start-from vector)) +(defmethod enable ((this led-fader-state) (start-from vector)) "begin transition." (when (-> this enable?) @@ -106,7 +106,7 @@ (true! (-> this enable?)) 0) -(defmethod disable led-fader-state ((this led-fader-state)) +(defmethod disable ((this led-fader-state)) "disable transition." (set! (-> this amount) 0.0) @@ -150,7 +150,7 @@ ) ) -(defmethod update led-fader-state ((this led-fader-state) (to float) (duration float)) +(defmethod update ((this led-fader-state) (to float) (duration float)) "disable transition." (when (-> this enable?) @@ -176,14 +176,14 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod initialize pc-settings-jak2 ((obj pc-settings-jak2)) +(defmethod initialize ((obj pc-settings-jak2)) "initial initialize method to be run after allocating" (set! (-> obj music-unlocked) (new 'global 'bit-array (-> *music-player-tracks* length))) ((method-of-type pc-settings initialize) obj) obj) -(defmethod set-game-setting! pc-settings-jak2 ((obj pc-settings-jak2) (setting symbol) (value symbol)) +(defmethod set-game-setting! ((obj pc-settings-jak2) (setting symbol) (value symbol)) (case setting (('video-mode) (set! (-> *setting-control* user-current video-mode) #f) @@ -197,7 +197,7 @@ ) ) -(defmethod get-game-setting pc-settings-jak2 ((obj pc-settings-jak2) (setting symbol)) +(defmethod get-game-setting ((obj pc-settings-jak2) (setting symbol)) (case setting (('video-mode) (-> *setting-control* user-default video-mode) @@ -211,16 +211,16 @@ ) ) -(defmethod set-game-language! pc-settings-jak2 ((obj pc-settings-jak2) (lang language-enum)) +(defmethod set-game-language! ((obj pc-settings-jak2) (lang language-enum)) (set! (-> *setting-control* user-default language) lang) ) -(defmethod get-game-language pc-settings-jak2 ((obj pc-settings-jak2)) +(defmethod get-game-language ((obj pc-settings-jak2)) (get-current-language) ) -(defmethod update pc-settings-jak2 ((obj pc-settings-jak2)) +(defmethod update ((obj pc-settings-jak2)) "Set the default misc settings" ((method-of-type pc-settings update) obj) @@ -238,7 +238,7 @@ "are we in an actual cutscene and should letterbox the view?" (and (!= #f *scene-player*) (nonzero? movie?) (movie?))) -(defmethod update-discord-rpc pc-settings-jak2 ((obj pc-settings-jak2)) +(defmethod update-discord-rpc ((obj pc-settings-jak2)) "update discord rpc module" (let ((info (new 'stack 'discord-info))) (set! (-> info orb-count) (-> *game-info* skill-total)) @@ -266,7 +266,7 @@ ) (none)) -(defmethod update-speedrun pc-settings-jak2 ((obj pc-settings-jak2)) +(defmethod update-speedrun ((obj pc-settings-jak2)) "update speedrun module" ;; TODO - update to new with-profiler syntax ;; (with-profiler "speedrun-update" @@ -274,7 +274,7 @@ ;;) (none)) -(defmethod update-video-hacks pc-settings-jak2 ((obj pc-settings-jak2)) +(defmethod update-video-hacks ((obj pc-settings-jak2)) "update the graphics hacks used for the progress menu. ugh." (set! (-> (get-video-params) relative-x-scale) (-> obj aspect-ratio-reciprocal)) @@ -282,32 +282,32 @@ ) -(defmethod eligible-for-fast-elevator? pc-settings-jak2 ((obj pc-settings-jak2) (proc process)) +(defmethod eligible-for-fast-elevator? ((obj pc-settings-jak2) (proc process)) "is this a valid process for a fast elevator?" (and (-> obj fast-elevator?) (not (or (string= (-> proc name) "drill-lift-1") (string= (-> proc name) "drill-lift-2")))) ) -(defmethod get-airlock-speed pc-settings-jak2 ((obj pc-settings-jak2)) +(defmethod get-airlock-speed ((obj pc-settings-jak2)) "return the current speed modifier for airlocks" (if (-> obj fast-airlock?) (-> *pc-cheat-state* airlock-speed) 1.0)) -(defmethod get-airlock-close-speed pc-settings-jak2 ((obj pc-settings-jak2)) +(defmethod get-airlock-close-speed ((obj pc-settings-jak2)) "return the current closing speed modifier for airlocks" (if (-> obj fast-airlock?) (-> *pc-cheat-state* airlock-close-speed) 1.0)) -(defmethod led-enabled? pc-settings-jak2 ((obj pc-settings-jak2)) +(defmethod led-enabled? ((obj pc-settings-jak2)) "should the controller led be set?" (or (-> obj controller-led-hp?) (-> obj controller-led-status?) )) -(defmethod update-led pc-settings-jak2 ((obj pc-settings-jak2)) +(defmethod update-led ((obj pc-settings-jak2)) "set the controller led color by modifying the controller-led-color vector" ;; default color is just blue. @@ -441,7 +441,7 @@ `(-> *pc-settings* flava-unlocked ,flava)) -(defmethod update-cheats pc-settings-jak2 ((obj pc-settings-jak2)) +(defmethod update-cheats ((obj pc-settings-jak2)) "run cheats." ;; run cheats here. @@ -497,7 +497,7 @@ 0) -(defmethod update-music-log pc-settings-jak2 ((obj pc-settings-jak2)) +(defmethod update-music-log ((obj pc-settings-jak2)) "update the music log" (dotimes (i (-> *music-player-tracks* length)) @@ -547,7 +547,7 @@ val) ) -(defmethod handle-input-settings pc-settings-jak2 ((obj pc-settings-jak2) (file file-stream)) +(defmethod handle-input-settings ((obj pc-settings-jak2) (file file-stream)) "handle the text parsing input for the 'settings' group" ((method-of-type pc-settings handle-input-settings) obj file) @@ -576,7 +576,7 @@ ) 0) -(defmethod handle-output-settings pc-settings-jak2 ((obj pc-settings-jak2) (file file-stream)) +(defmethod handle-output-settings ((obj pc-settings-jak2) (file file-stream)) "handle the text writing output for the 'settings' group" ((method-of-type pc-settings handle-output-settings) obj file) diff --git a/goal_src/jak2/pc/progress/progress-draw-pc.gc b/goal_src/jak2/pc/progress/progress-draw-pc.gc index 4cb2fb7b554..5de2c6fdfc3 100644 --- a/goal_src/jak2/pc/progress/progress-draw-pc.gc +++ b/goal_src/jak2/pc/progress/progress-draw-pc.gc @@ -422,7 +422,7 @@ (inc! external-index))))) -1.0)) -(defmethod draw-option menu-highscores-option ((this menu-highscores-option) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) +(defmethod draw-option ((this menu-highscores-option) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) (let ((alpha (fmax 0.0 (* 2.0 (- 0.5 (-> progress menu-transition))))) (padding 20.0) (icon-scale 0.22) @@ -642,7 +642,7 @@ (none)) -(defmethod draw-option menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((obj menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-48 int) (sv-64 int) @@ -926,7 +926,7 @@ ) ;; TODO - some naming is bad here in a few spots, cleanup once i understand it more -(defmethod draw-option menu-missions-option ((obj menu-missions-option) (progress progress) (font-ctx font-context) (arg3 int) (arg4 symbol)) +(defmethod draw-option ((obj menu-missions-option) (progress progress) (font-ctx font-context) (arg3 int) (arg4 symbol)) (local-vars (f0-50 float) (font-alpha float) @@ -1309,7 +1309,7 @@ `(if (not (-> *pc-settings* use-vis?)) (adjust-game-x (the float ,x)) ,x)) -(defmethod draw-option menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-16 float) (sv-20 int) @@ -1734,7 +1734,7 @@ ) -(defmethod draw-option menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) (s2-0 (the int (+ -1.0 (-> arg1 origin y)))) (s1-0 22) @@ -1910,7 +1910,7 @@ -(defmethod draw-option menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((obj menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.5) @@ -1981,7 +1981,7 @@ -(defmethod draw-option menu-aspect-ratio-pc-option ((obj menu-aspect-ratio-pc-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((obj menu-aspect-ratio-pc-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (max! alpha 0.0) (set! (-> arg1 alpha) alpha) @@ -2045,7 +2045,7 @@ ) -(defmethod draw-option menu-display-mode-option ((obj menu-display-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((obj menu-display-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (max! alpha 0.0) (set! (-> arg1 alpha) alpha) @@ -2108,7 +2108,7 @@ ) -(defmethod draw-option menu-on-off-vsync-option ((obj menu-on-off-vsync-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((obj menu-on-off-vsync-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (max! alpha 0.0) (set! (-> arg1 alpha) alpha) @@ -2262,7 +2262,7 @@ (else #f)))) -(defmethod draw-option menu-aspect-ratio-custom-option ((obj menu-aspect-ratio-custom-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((obj menu-aspect-ratio-custom-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let* ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition)))) (middle-pad 15.0) (middle-pad-uncorrected middle-pad) @@ -2364,7 +2364,7 @@ (none) ) -(defmethod draw-option menu-frame-rate-option ((obj menu-frame-rate-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((obj menu-frame-rate-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (set-scale! arg1 0.65) (max! alpha 0.0) @@ -2600,7 +2600,7 @@ ))) -(defmethod draw-option menu-music-player-option ((obj menu-music-player-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((obj menu-music-player-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let* ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition)))) (y-pad-top 11) diff --git a/goal_src/jak2/pc/progress/progress-generic-draw-pc.gc b/goal_src/jak2/pc/progress/progress-generic-draw-pc.gc index 1489edb2574..def0892c6a4 100644 --- a/goal_src/jak2/pc/progress/progress-generic-draw-pc.gc +++ b/goal_src/jak2/pc/progress/progress-generic-draw-pc.gc @@ -133,7 +133,7 @@ (bucket-id debug-no-zbuf2)) (draw-sprite2d-xy buf 0 y-coord 512 1 (static-rgba #xff #xff #xff #x40)))) -(defmethod draw-option menu-generic-scrolling-page ((obj menu-generic-scrolling-page) (progress progress) (font-ctx font-context) (arg3 int) (arg4 symbol)) +(defmethod draw-option ((obj menu-generic-scrolling-page) (progress progress) (font-ctx font-context) (arg3 int) (arg4 symbol)) (when (or (zero? (-> obj mounted?)) (not (-> obj mounted?))) (on-mount! obj)) ;; the list has a total of 200px of y-height @@ -206,7 +206,7 @@ (draw-sprite2d-xy buffer x-pos y-pos width height (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a (the int (* 64.0 alpha))))))) -(defmethod draw-option menu-generic-boolean-option ((obj menu-generic-boolean-option) (arg0 progress) (font-ctx font-context) (option-index int) (selected? symbol)) +(defmethod draw-option ((obj menu-generic-boolean-option) (arg0 progress) (font-ctx font-context) (option-index int) (selected? symbol)) (when (not (-> obj mounted?)) (on-mount! obj)) (let ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition)))) @@ -251,7 +251,7 @@ (print-game-text *temp-string* font-ctx #f 44 (bucket-id progress))) (none)) -(defmethod draw-option menu-generic-carousel-option ((obj menu-generic-carousel-option) +(defmethod draw-option ((obj menu-generic-carousel-option) (progress progress) (font-ctx font-context) (option-index int) @@ -316,13 +316,13 @@ (print-game-text str font-ctx #f 44 (bucket-id progress))) (none)) -(defmethod draw-option menu-generic-link-option ((obj menu-generic-link-option) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) +(defmethod draw-option ((obj menu-generic-link-option) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) (when (not (-> obj mounted?)) (on-mount! obj)) (draw-generic-simple-string-option obj progress font-ctx option-index (lookup-text! *common-text* (-> obj name) #f)) (none)) -(defmethod draw-option menu-generic-confirm-option ((obj menu-generic-confirm-option) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) +(defmethod draw-option ((obj menu-generic-confirm-option) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) (when (not (-> obj mounted?)) (on-mount! obj)) ;; drawn different depending on whether or not the confirmation prompt is open @@ -372,7 +372,7 @@ (draw-generic-simple-string-option obj progress font-ctx option-index (lookup-text! *common-text* (-> obj name) #f)))) (none)) -(defmethod draw-option menu-generic-slider-option ((obj menu-generic-slider-option) (arg0 progress) (font-ctx font-context) (option-index int) (selected? symbol)) +(defmethod draw-option ((obj menu-generic-slider-option) (arg0 progress) (font-ctx font-context) (option-index int) (selected? symbol)) (when (not (-> obj mounted?)) (on-mount! obj)) (let ((alpha (max 0.0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) @@ -458,7 +458,7 @@ ) (none)) -(defmethod draw-option menu-generic-details-page ((obj menu-generic-details-page) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) +(defmethod draw-option ((obj menu-generic-details-page) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) (when (or (zero? (-> obj mounted?)) (not (-> obj mounted?))) (on-mount! obj)) ;; the list has a total of 200px of y-height @@ -515,7 +515,7 @@ (draw-scrolling-page-up-down-arrows font-ctx draw-up-arrow? draw-down-arrow?)))) (none)) -(defmethod draw-option menu-generic-details-keybind-entry ((obj menu-generic-details-keybind-entry) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) +(defmethod draw-option ((obj menu-generic-details-keybind-entry) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) (when (or (zero? (-> obj mounted?)) (not (-> obj mounted?))) (on-mount! obj)) ;; TODO - implement `should-disable?` if it's ever relevant (its not right now) @@ -554,7 +554,7 @@ (print-game-text *pc-cpp-temp-string* font-ctx #f 44 (bucket-id progress)))))) (none)) -(defmethod draw-option menu-generic-details-confirm-entry ((obj menu-generic-details-confirm-entry) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) +(defmethod draw-option ((obj menu-generic-details-confirm-entry) (progress progress) (font-ctx font-context) (option-index int) (selected? symbol)) (when (or (zero? (-> obj mounted?)) (not (-> obj mounted?))) (on-mount! obj)) ;; TODO - implement `should-disable?` if it's ever relevant (its not right now) diff --git a/goal_src/jak2/pc/progress/progress-generic-pc.gc b/goal_src/jak2/pc/progress/progress-generic-pc.gc index 4fc3907bb85..e54aa520add 100644 --- a/goal_src/jak2/pc/progress/progress-generic-pc.gc +++ b/goal_src/jak2/pc/progress/progress-generic-pc.gc @@ -1,58 +1,58 @@ ;;-*-Lisp-*- (in-package goal) -(defmethod call-on-load generic-progress-state-entry ((this generic-progress-state-entry)) +(defmethod call-on-load ((this generic-progress-state-entry)) (when (and (nonzero? (-> this on-load)) (!= (-> this on-load) #f)) ((-> this on-load))) (none)) -(defmethod call-get-value-fn menu-generic-boolean-option ((this menu-generic-boolean-option)) +(defmethod call-get-value-fn ((this menu-generic-boolean-option)) (if (and (nonzero? (-> this get-value-fn)) (!= (-> this get-value-fn) #f)) ((-> this get-value-fn)) #f)) -(defmethod call-on-confirm menu-generic-boolean-option ((this menu-generic-boolean-option) (val symbol)) +(defmethod call-on-confirm ((this menu-generic-boolean-option) (val symbol)) (when (and (nonzero? (-> this on-confirm)) (!= (-> this on-confirm) #f)) ((-> this on-confirm) val)) (none)) -(defmethod call-get-item-index-fn menu-generic-carousel-option ((this menu-generic-carousel-option)) +(defmethod call-get-item-index-fn ((this menu-generic-carousel-option)) (if (and (nonzero? (-> this get-item-index-fn)) (!= (-> this get-item-index-fn) #f)) ((-> this get-item-index-fn)) 0)) -(defmethod call-on-confirm menu-generic-carousel-option ((this menu-generic-carousel-option) (val int)) +(defmethod call-on-confirm ((this menu-generic-carousel-option) (val int)) (when (and (nonzero? (-> this on-confirm)) (!= (-> this on-confirm) #f)) ((-> this on-confirm) val)) (none)) -(defmethod call-on-confirm menu-generic-confirm-option ((this menu-generic-confirm-option)) +(defmethod call-on-confirm ((this menu-generic-confirm-option)) (when (and (nonzero? (-> this on-confirm)) (!= (-> this on-confirm) #f)) ((-> this on-confirm))) (none)) -(defmethod call-get-value-fn menu-generic-slider-option ((this menu-generic-slider-option)) +(defmethod call-get-value-fn ((this menu-generic-slider-option)) (if (and (nonzero? (-> this get-value-fn)) (!= (-> this get-value-fn) #f)) ((-> this get-value-fn)) 0.0)) -(defmethod call-on-confirm menu-generic-slider-option ((this menu-generic-slider-option) (val float)) +(defmethod call-on-confirm ((this menu-generic-slider-option) (val float)) (when (and (nonzero? (-> this on-confirm)) (!= (-> this on-confirm) #f)) ((-> this on-confirm) val)) (none)) -(defmethod init! progress-pc-generic-store ((this progress-pc-generic-store)) +(defmethod init! ((this progress-pc-generic-store)) (set! (-> this clear-screen?) #f) (set! (-> this keybind-select-time) 0) (set! (-> this current-highscore-page-index) 0) (none)) -(defmethod call-on-confirm menu-generic-details-confirm-entry ((this menu-generic-details-confirm-entry)) +(defmethod call-on-confirm ((this menu-generic-details-confirm-entry)) (when (and (nonzero? (-> this on-confirm)) (!= (-> this on-confirm) #f)) ((-> this on-confirm))) (none)) -(defmethod navigate! progress-pc-generic-store ((this progress-pc-generic-store) (progress progress) (target menu-option-list) (on-load (function none))) +(defmethod navigate! ((this progress-pc-generic-store) (progress progress) (target menu-option-list) (on-load (function none))) (when (< (-> this history-stack-index) 9) ;; hard-coded length ;; if this is the first history entry, we push the current page as well ;; if it's not, then we update the current entry before proceeding to the next page @@ -79,17 +79,17 @@ (set! (-> progress selected-option) #f)) (none)) -(defmethod back! progress-pc-generic-store ((this progress-pc-generic-store) (progress progress)) +(defmethod back! ((this progress-pc-generic-store) (progress progress)) (set! (-> this history-stack-index) (max 0 (dec (-> this history-stack-index)))) (set! (-> this clear-screen?) #t) (set! (-> progress next) 'generic-menu) (set! (-> progress selected-option) #f) (none)) -(defmethod has-history? progress-pc-generic-store ((this progress-pc-generic-store)) +(defmethod has-history? ((this progress-pc-generic-store)) (> (-> this history-stack-index) 0)) -(defmethod clear-history-if-empty! progress-pc-generic-store ((this progress-pc-generic-store)) +(defmethod clear-history-if-empty! ((this progress-pc-generic-store)) "if we have no history, just reset the entry. This is so we don't preserve state after completely exiting the menu" (when (not (has-history? this)) (set! (-> this history-stack-index) 0) @@ -102,34 +102,34 @@ (set! (-> stack-entry progress-id) #f))) (none)) -(defmethod clear-history! progress-pc-generic-store ((this progress-pc-generic-store)) +(defmethod clear-history! ((this progress-pc-generic-store)) (set! (-> this history-stack-index) 0) (set! (-> this clear-screen?) #t) (set! (-> this current-menu-hover-index) 0) (none)) -(defmethod on-mount! menu-generic-option ((this menu-generic-option)) +(defmethod on-mount! ((this menu-generic-option)) (set! (-> this mounted?) #t) (none)) ;; TODO - call the parent methods, when there is an elegant way to do so (not having to know the ID) -(defmethod on-mount! menu-generic-carousel-option ((this menu-generic-carousel-option)) +(defmethod on-mount! ((this menu-generic-carousel-option)) (set! (-> this mounted?) #t) (set! (-> this item-index) 0) (none)) -(defmethod on-mount! menu-generic-scrolling-page ((this menu-generic-scrolling-page)) +(defmethod on-mount! ((this menu-generic-scrolling-page)) (set! (-> this mounted?) #t) (set! (-> this selected-option-index) -1) (none)) -(defmethod on-mount! menu-generic-details-page ((this menu-generic-details-page)) +(defmethod on-mount! ((this menu-generic-details-page)) (set! (-> this mounted?) #t) (set! (-> this selected-entry-index) -1) (none)) -(defmethod on-mount! menu-generic-confirm-option ((this menu-generic-confirm-option)) +(defmethod on-mount! ((this menu-generic-confirm-option)) (set! (-> this mounted?) #t) (set! (-> this confirmed?) #f) (none)) @@ -146,7 +146,7 @@ (((controller-keybind r-analog-right)) 2) (else (the int bind)))) -(defmethod on-mount! menu-generic-details-keybind-entry ((this menu-generic-details-keybind-entry)) +(defmethod on-mount! ((this menu-generic-details-keybind-entry)) (set! (-> this mounted?) #t) (set! (-> this bind-info port) 0) ;; always port 0 for now (set! (-> this bind-info device-type) (the int (-> this device-type))) @@ -164,7 +164,7 @@ ;; Progress Code Overrides -(defmethod respond-to-cpad progress ((obj progress)) +(defmethod respond-to-cpad ((obj progress)) (mc-get-slot-info 0 *progress-save-info*) ;; ND originally did this...called this every frame in the game options, looked like a hack ;; there's probably a way to consistently do it synchronously @@ -257,7 +257,7 @@ ;; - input handling -(defmethod respond-progress menu-generic-scrolling-page ((obj menu-generic-scrolling-page) (progress progress) (selected? symbol)) +(defmethod respond-progress ((obj menu-generic-scrolling-page) (progress progress) (selected? symbol)) "Handle progress menu navigation logic." (let ((selected-item? #f)) (if (= (-> obj selected-option-index) -1) @@ -316,7 +316,7 @@ (respond-progress (-> obj menu-options (-> *progress-pc-generic-store* current-menu-hover-index)) progress (or selected? selected-item?)))) 0) -(defmethod respond-progress menu-generic-boolean-option ((obj menu-generic-boolean-option) (progress progress) (selected? symbol)) +(defmethod respond-progress ((obj menu-generic-boolean-option) (progress progress) (selected? symbol)) (if selected? (cond ((cpad-pressed? 0 left l-analog-left right l-analog-right) @@ -334,7 +334,7 @@ (set! (-> obj value) (call-get-value-fn obj))))) 0) -(defmethod respond-progress menu-generic-carousel-option ((obj menu-generic-carousel-option) (progress progress) (selected? symbol)) +(defmethod respond-progress ((obj menu-generic-carousel-option) (progress progress) (selected? symbol)) (if selected? (cond ((cpad-pressed? 0 left l-analog-left) @@ -357,14 +357,14 @@ (set! (-> obj item-index) (call-get-item-index-fn obj))))) 0) -(defmethod respond-progress menu-generic-link-option ((obj menu-generic-link-option) (progress progress) (selected? symbol)) +(defmethod respond-progress ((obj menu-generic-link-option) (progress progress) (selected? symbol)) (when (and selected? (cpad-pressed? 0 confirm)) (navigate! *progress-pc-generic-store* progress (-> obj target) (-> obj on-load)) (set! (-> progress selected-option) #f) (sound-play "score-slide")) 0) -(defmethod respond-progress menu-generic-confirm-option ((obj menu-generic-confirm-option) (progress progress) (selected? symbol)) +(defmethod respond-progress ((obj menu-generic-confirm-option) (progress progress) (selected? symbol)) (if selected? (cond ((cpad-pressed? 0 left l-analog-left right l-analog-right) @@ -380,7 +380,7 @@ (set! (-> obj confirmed?) #f)))) 0) -(defmethod respond-progress menu-generic-slider-option ((obj menu-generic-slider-option) (progress progress) (selected? symbol)) +(defmethod respond-progress ((obj menu-generic-slider-option) (progress progress) (selected? symbol)) (if selected? (cond ((and (> (-> obj value) (-> obj min-value)) @@ -407,7 +407,7 @@ (set! (-> obj value) (call-get-value-fn obj))))) 0) -(defmethod respond-progress menu-generic-details-page ((obj menu-generic-details-page) (progress progress) (selected? symbol)) +(defmethod respond-progress ((obj menu-generic-details-page) (progress progress) (selected? symbol)) (if (= (-> obj selected-entry-index) -1) (cond ((or (cpad-pressed? 0 down l-analog-down) @@ -463,7 +463,7 @@ (respond-progress (-> obj entries (-> *progress-pc-generic-store* current-menu-hover-index)) progress selected?)) 0) -(defmethod respond-progress menu-generic-details-keybind-entry ((obj menu-generic-details-keybind-entry) (progress progress) (selected? symbol)) +(defmethod respond-progress ((obj menu-generic-details-keybind-entry) (progress progress) (selected? symbol)) (when (not selected?) (cond ((cpad-pressed? 0 confirm) @@ -472,7 +472,7 @@ (set! (-> *progress-pc-generic-store* keybind-select-time) (current-time))))) 0) -(defmethod respond-progress menu-generic-details-confirm-entry ((obj menu-generic-details-confirm-entry) (progress progress) (selected? symbol)) +(defmethod respond-progress ((obj menu-generic-details-confirm-entry) (progress progress) (selected? symbol)) (if selected? (cond ((cpad-pressed? 0 left l-analog-left right l-analog-right) @@ -490,7 +490,7 @@ ;; - rest of component logic -(defmethod num-items menu-generic-carousel-option ((this menu-generic-carousel-option)) +(defmethod num-items ((this menu-generic-carousel-option)) "Get the number of items in the carousel" (if (and (nonzero? (-> this items)) (!= (-> this items) #f)) (-> this items length) @@ -499,7 +499,7 @@ ((-> this get-max-size-fn)) 0))) -(defmethod get-item-label menu-generic-carousel-option ((this menu-generic-carousel-option) (item-index int)) +(defmethod get-item-label ((this menu-generic-carousel-option) (item-index int)) "Gets the string label of the currently choosen item, preferring the `items` array if it exists" (if (and (nonzero? (-> this items)) (!= (-> this items) #f)) (lookup-text! *common-text* (-> this items item-index) #f) @@ -508,7 +508,7 @@ "#ERROR"))) ;; TODO - it could be possible to map certain controllers to buttons (ie. dualshock controllers could have nice mappings instead of SDL named ones) -(defmethod get-keybind-string menu-generic-details-keybind-entry ((this menu-generic-details-keybind-entry)) +(defmethod get-keybind-string ((this menu-generic-details-keybind-entry)) (case (-> this keybind) (((controller-keybind cross)) "~Y~22L<~Z~Y~27L*~Z~Y~1L>~Z~Y~23L[~Z~+26H Cross") diff --git a/goal_src/jak2/pc/progress/progress-pc.gc b/goal_src/jak2/pc/progress/progress-pc.gc index a7788f79277..8eee6395e33 100644 --- a/goal_src/jak2/pc/progress/progress-pc.gc +++ b/goal_src/jak2/pc/progress/progress-pc.gc @@ -81,7 +81,7 @@ ) -(defmethod init-defaults progress ((obj progress)) +(defmethod init-defaults ((obj progress)) "Initialize default menu settings." (set! (-> *progress-state* aspect-ratio-choice) (get-aspect-ratio)) (set! (-> *progress-state* video-mode-choice) (get-video-mode)) @@ -187,7 +187,7 @@ ((19) (pc-fetch-external-speedrun-times "anyorbs")) ((20) (pc-fetch-external-speedrun-times "anyhero"))))) -(defmethod set-menu-options progress ((obj progress) (arg0 symbol)) +(defmethod set-menu-options ((obj progress) (arg0 symbol)) "Set the menu options for the menu state specified by arg0." (set! (-> obj current-options) #f) (case arg0 @@ -419,7 +419,7 @@ -(defmethod respond-progress menu-aspect-ratio-pc-option ((obj menu-aspect-ratio-pc-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((obj menu-aspect-ratio-pc-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when arg1 @@ -470,7 +470,7 @@ ) -(defmethod respond-progress menu-display-mode-option ((obj menu-display-mode-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((obj menu-display-mode-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when arg1 @@ -503,7 +503,7 @@ ) -(defmethod respond-progress menu-aspect-ratio-custom-option ((obj menu-aspect-ratio-custom-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((obj menu-aspect-ratio-custom-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((aspect-custom-val-ptr (case (-> *progress-state-pc* aspect-ratio-ratio-index) @@ -557,7 +557,7 @@ 0 ) -(defmethod respond-progress menu-frame-rate-option ((obj menu-frame-rate-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((obj menu-frame-rate-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when arg1 @@ -657,7 +657,7 @@ -1) -(defmethod respond-progress menu-music-player-option ((obj menu-music-player-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((obj menu-music-player-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (if (= 0.0 (-> obj max-scroll)) diff --git a/goal_src/jak2/pc/subtitle2-h.gc b/goal_src/jak2/pc/subtitle2-h.gc index ffb6124818b..9f64fbf3d2d 100644 --- a/goal_src/jak2/pc/subtitle2-h.gc +++ b/goal_src/jak2/pc/subtitle2-h.gc @@ -147,7 +147,7 @@ `(logtest? (-> ,sub flags) (pc-subtitle2-flags ,@flags))) -(defmethod inspect subtitle2-text-info ((obj subtitle2-text-info)) +(defmethod inspect ((obj subtitle2-text-info)) (if (not obj) (return (the subtitle2-text-info #f))) (format #t "[~8x] ~A~%" obj (-> obj type)) @@ -299,12 +299,12 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod length subtitle2-text-info ((obj subtitle2-text-info)) +(defmethod length ((obj subtitle2-text-info)) "Get the length (number of subtitle2 scenes) in a subtitle2-text-info." (-> obj length) ) -(defmethod length subtitle2-scene ((obj subtitle2-scene)) +(defmethod length ((obj subtitle2-scene)) "Get the length (number of subtitle2 lines) in a subtitle2-scene." (-> obj length) ) diff --git a/goal_src/jak2/pc/subtitle2.gc b/goal_src/jak2/pc/subtitle2.gc index ed9686637f0..c9529619de8 100644 --- a/goal_src/jak2/pc/subtitle2.gc +++ b/goal_src/jak2/pc/subtitle2.gc @@ -44,14 +44,14 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod get-speaker subtitle2-text-info ((obj subtitle2-text-info) (speaker pc-subtitle2-speaker)) +(defmethod get-speaker ((obj subtitle2-text-info) (speaker pc-subtitle2-speaker)) "get the translated string for that speaker" (if (and (> speaker (pc-subtitle2-speaker none)) (< speaker (-> obj speaker-length))) (-> obj speaker-names speaker) (the string #f)) ) -(defmethod get-scene-by-name subtitle2-text-info ((obj subtitle2-text-info) (name string)) +(defmethod get-scene-by-name ((obj subtitle2-text-info) (name string)) "get a subtitle scene info with the corresponding name. #f = none found" ;; invalid name so return invalid scene. @@ -77,7 +77,7 @@ (the subtitle2-scene #f)) -(defmethod get-line-at-pos subtitle2-scene ((obj subtitle2-scene) (pos float) (index int)) +(defmethod get-line-at-pos ((obj subtitle2-scene) (pos float) (index int)) "return the subtitle line at that position. #f = none found index is which line to return, since you can have multiple lines that cover the same position." @@ -220,21 +220,21 @@ ) -(defmethod clear-line subtitle2-queue-element ((obj subtitle2-queue-element)) +(defmethod clear-line ((obj subtitle2-queue-element)) "make this queue element invalid" (set! (-> obj gui) #f) (set! (-> obj id) (new 'static 'sound-id)) 0) -(defmethod clear-queue subtitle2 ((obj subtitle2)) +(defmethod clear-queue ((obj subtitle2)) "mark all slots in the gui queue as available" (dotimes (i PC_SUBTITLE_QUEUE_SIZE) (clear-line (-> obj queue i))) 0) -(defmethod update-gui-connections subtitle2 ((obj subtitle2)) +(defmethod update-gui-connections ((obj subtitle2)) "mark all inactive slots in the gui queue as available" (dotimes (i PC_SUBTITLE_QUEUE_SIZE) @@ -245,7 +245,7 @@ (clear-line (-> obj queue i))))) 0) -(defmethod gui-queued? subtitle2 ((obj subtitle2) (gui gui-connection)) +(defmethod gui-queued? ((obj subtitle2) (gui gui-connection)) "return #t is the gui is in the queue" (dotimes (i PC_SUBTITLE_QUEUE_SIZE) @@ -253,7 +253,7 @@ (return #t))) #f) -(defmethod get-empty-queue subtitle2 ((obj subtitle2)) +(defmethod get-empty-queue ((obj subtitle2)) "return the first available gui queue slot" (dotimes (i PC_SUBTITLE_QUEUE_SIZE) @@ -263,7 +263,7 @@ 0 ) -(defmethod add-to-queue subtitle2 ((obj subtitle2) (gui gui-connection)) +(defmethod add-to-queue ((obj subtitle2) (gui gui-connection)) "add a gui connection to the first empty queue slot available" (let ((slot (get-empty-queue obj))) @@ -272,7 +272,7 @@ gui) -(defmethod set-params! subtitle2-line-queue-element ((obj subtitle2-line-queue-element) (line subtitle2-line) (y float)) +(defmethod set-params! ((obj subtitle2-line-queue-element) (line subtitle2-line) (y float)) "set the parameters for this line queue element" (set! (-> obj line) line) @@ -297,7 +297,7 @@ speaker) -(defmethod get-active-subtitles subtitle2 ((obj subtitle2)) +(defmethod get-active-subtitles ((obj subtitle2)) "collect active subtitles and add them to the queue if a gui connection is already in the queue, it will stay in the same slot when it was first added" @@ -324,7 +324,7 @@ 0) -(defmethod subtitle-format subtitle2 ((obj subtitle2) (line subtitle2-line)) +(defmethod subtitle-format ((obj subtitle2) (line subtitle2-line)) "format the string for a subtitle line to *temp-string*" (when (subtitle2-flags? line merge) @@ -376,7 +376,7 @@ ) -(defmethod draw-subtitles subtitle2 ((self subtitle2)) +(defmethod draw-subtitles ((self subtitle2)) "do the subtitle drawing" ;; check the gui queue for lines to add to the line queue @@ -499,7 +499,7 @@ 0) (when *debug-segment* -(defmethod debug-print-queue subtitle2 ((self subtitle2)) +(defmethod debug-print-queue ((self subtitle2)) "print the queue to *stdcon0*" (format *stdcon0* "q: ~%") @@ -518,7 +518,7 @@ 0) -(defmethod debug-print-speakers subtitle2 ((self subtitle2)) +(defmethod debug-print-speakers ((self subtitle2)) "print all speakers onscreen" (if (not *subtitle2-text*) @@ -542,12 +542,12 @@ 0) ) -(defmethod start-gui subtitle2 ((self subtitle2)) +(defmethod start-gui ((self subtitle2)) "start gui queueing" (set! (-> self gui-id) (add-process *gui-control* self (gui-channel subtitle-pc) (gui-action hidden) "subtitle2" (meters 20) 0)) ) -(defmethod stop-gui subtitle2 ((self subtitle2)) +(defmethod stop-gui ((self subtitle2)) "stop gui queueing" (set-action! *gui-control* (gui-action stop) (-> self gui-id) (gui-channel none) @@ -818,7 +818,7 @@ -(defmethod deactivate subtitle2 ((self subtitle2)) +(defmethod deactivate ((self subtitle2)) (stop-gui self) ;; not sure this works... diff --git a/goal_src/jak2/pc/util/popup-menu.gc b/goal_src/jak2/pc/util/popup-menu.gc index 19bcd54dc71..84fda0d605c 100644 --- a/goal_src/jak2/pc/util/popup-menu.gc +++ b/goal_src/jak2/pc/util/popup-menu.gc @@ -1,10 +1,10 @@ ;;-*-Lisp-*- (in-package goal) -(defmethod draw! popup-menu-entry ((this popup-menu-entry) (font-ctx font-context) (dma-buf dma-buffer)) +(defmethod draw! ((this popup-menu-entry) (font-ctx font-context) (dma-buf dma-buffer)) (none)) -(defmethod draw! popup-menu-button ((this popup-menu-button) (font-ctx font-context) (dma-buf dma-buffer)) +(defmethod draw! ((this popup-menu-button) (font-ctx font-context) (dma-buf dma-buffer)) (let ((old-x (-> font-ctx origin x)) (old-y (-> font-ctx origin y))) (pc-encode-utf8-string (-> this label) *pc-encoded-temp-string*) @@ -13,7 +13,7 @@ (set! (-> font-ctx origin y) old-y)) (none)) -(defmethod draw! popup-menu ((this popup-menu)) +(defmethod draw! ((this popup-menu)) (let ((font-ctx (new 'debug 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning large)))) (set! (-> font-ctx scale) 0.35) (set! (-> font-ctx origin x) 15.0) @@ -39,20 +39,20 @@ ) (none)) -(defmethod move-up! popup-menu ((this popup-menu)) +(defmethod move-up! ((this popup-menu)) (set! (-> this curr-entry-index) (max 0 (dec (-> this curr-entry-index)))) (none)) -(defmethod move-down! popup-menu ((this popup-menu)) +(defmethod move-down! ((this popup-menu)) (set! (-> this curr-entry-index) (min (dec (-> this entries length)) (inc (-> this curr-entry-index)))) (none)) -(defmethod press! popup-menu ((this popup-menu)) +(defmethod press! ((this popup-menu)) (let ((entry (-> this entries (-> this curr-entry-index)))) ((-> entry on-press))) (none)) -(defmethod get-widest-label popup-menu ((this popup-menu) (font-ctx font-context)) +(defmethod get-widest-label ((this popup-menu) (font-ctx font-context)) (let ((max-len 0.0)) (dotimes (i (-> this entries length)) (let ((label-len (-> (get-string-length (-> this entries i label) font-ctx) length))) diff --git a/goalc/compiler/compilation/Type.cpp b/goalc/compiler/compilation/Type.cpp index 5d6da83c932..fb8515714b8 100644 --- a/goalc/compiler/compilation/Type.cpp +++ b/goalc/compiler/compilation/Type.cpp @@ -437,30 +437,39 @@ Val* Compiler::compile_defmethod(const goos::Object& form, const goos::Object& _ auto fe = env->function_env(); auto* rest = &_rest; - auto& method_name = pair_car(*rest); + auto& method_name_obj = pair_car(*rest); rest = &pair_cdr(*rest); - auto& type_name = pair_car(*rest); - rest = &pair_cdr(*rest); - auto& arg_list = pair_car(*rest); - auto body = &pair_cdr(*rest); - - if (!method_name.is_symbol()) { - throw_compiler_error(form, "Method name must be a symbol, got {}", method_name.print()); + if (!method_name_obj.is_symbol()) { + throw_compiler_error(form, "Method name must be a symbol, got {}", method_name_obj.print()); } - if (!type_name.is_symbol()) { - throw_compiler_error(form, "Method type must be a symbol, got {}", method_name.print()); + auto method_name = symbol_string(method_name_obj); + + std::string type_name; + if (!pair_car(*rest).is_pair()) { + auto& type_name_obj = pair_car(*rest); + rest = &pair_cdr(*rest); + if (!type_name_obj.is_symbol()) { + throw_compiler_error(form, "Method type must be a symbol, got {}", type_name_obj.print()); + } + type_name = symbol_string(type_name_obj); } + auto& arg_list = pair_car(*rest); + auto body = &pair_cdr(*rest); + auto place = fe->alloc_val(get_none()->type(), false); auto& lambda = place->lambda; auto lambda_ts = m_ts.make_typespec("function"); - // parse the argument list. todo, we could check the type of the first argument here? + // parse the argument list. type of first argument determines the type the method belongs to. for_each_in_list(arg_list, [&](const goos::Object& o) { if (o.is_symbol()) { // if it has no type, assume object. lambda.params.push_back({symbol_string(o), m_ts.make_typespec("object")}); lambda_ts.add_arg(m_ts.make_typespec("object")); + if (type_name.empty()) { + throw_compiler_error(form, "Method type could not be inferred"); + } } else { // type of argument is specified auto param_args = get_va(o, o); @@ -472,14 +481,21 @@ Val* Compiler::compile_defmethod(const goos::Object& form, const goos::Object& _ // before substituting _type_ lambda_ts.add_arg(parm.type); + if (type_name.empty() && method_name != "new") { + type_name = parm.type.print(); + } + // replace _type_ as needed for inside this function. - parm.type = parm.type.substitute_for_method_call(symbol_string(type_name)); + parm.type = parm.type.substitute_for_method_call(type_name); lambda.params.push_back(parm); } }); + if (type_name.empty()) { + throw_compiler_error(form, "Method type could not be inferred"); + } ASSERT(lambda.params.size() == lambda_ts.arg_count()); // todo, verify argument list types (check that first arg is _type_ for methods that aren't "new") - lambda.debug_name = fmt::format("(method {} {})", method_name.print(), type_name.print()); + lambda.debug_name = fmt::format("(method {} {})", method_name, type_name); std::optional docstring; if (body->as_pair()->car.is_string() && !body->as_pair()->cdr.is_empty_list()) { @@ -492,8 +508,8 @@ Val* Compiler::compile_defmethod(const goos::Object& form, const goos::Object& _ auto new_func_env = std::make_unique(env, lambda.debug_name, &m_goos.reader); new_func_env->set_segment(env->function_env()->segment_for_static_data()); - new_func_env->method_of_type_name = symbol_string(type_name); - auto method_info = m_ts.lookup_method(symbol_string(type_name), symbol_string(method_name)); + new_func_env->method_of_type_name = type_name; + auto method_info = m_ts.lookup_method(type_name, method_name); new_func_env->method_id = method_info.id; new_func_env->method_function_type = method_info.type; @@ -618,14 +634,13 @@ Val* Compiler::compile_defmethod(const goos::Object& form, const goos::Object& _ } place->set_type(lambda_ts); - auto info = m_ts.define_method(symbol_string(type_name), symbol_string(method_name), lambda_ts, - docstring); - auto type_obj = compile_get_symbol_value(form, symbol_string(type_name), env)->to_gpr(form, env); + auto info = m_ts.define_method(type_name, method_name, lambda_ts, docstring); + auto type_obj = compile_get_symbol_value(form, type_name, env)->to_gpr(form, env); auto id_val = compile_integer(info.id, env)->to_gpr(form, env); auto method_val = place->to_gpr(form, env); auto method_set_val = compile_get_symbol_value(form, "method-set!", env)->to_gpr(form, env); - m_symbol_info.add_method(symbol_string(method_name), lambda.params, info, form); + m_symbol_info.add_method(method_name, lambda.params, info, form); return compile_real_function_call(form, method_set_val, {type_obj, id_val, method_val}, env); } diff --git a/test/decompiler/reference/jak1/engine/anim/aligner-h_REF.gc b/test/decompiler/reference/jak1/engine/anim/aligner-h_REF.gc index 4e58102e2ea..61509c2bc27 100644 --- a/test/decompiler/reference/jak1/engine/anim/aligner-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/aligner-h_REF.gc @@ -3,31 +3,28 @@ ;; definition of type align-control (deftype align-control (basic) - ((flags align-flags :offset-assert 4) - (process process-drawable :offset-assert 8) - (frame-group art-joint-anim :offset-assert 12) - (frame-num float :offset-assert 16) - (matrix matrix 2 :inline :offset-assert 32) - (transform transform 2 :inline :offset-assert 160) - (delta transformq :inline :offset-assert 256) - (last-speed meters :offset-assert 304) - (align transformq :inline :offset 160) + ((flags align-flags) + (process process-drawable) + (frame-group art-joint-anim) + (frame-num float) + (matrix matrix 2 :inline) + (transform transform 2 :inline) + (delta transformq :inline) + (last-speed meters) + (align transformq :inline :overlay-at (-> transform 0 trans x)) ) - :method-count-assert 14 - :size-assert #x134 - :flag-assert #xe00000134 (:methods - (new (symbol type process) _type_ :behavior process-drawable 0) - (compute-alignment! (_type_) transformq 9) - (align! (_type_ align-opts float float float) trsqv 10) - (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv 11) - (first-transform (_type_) transform 12) - (snd-transform (_type_) transform 13) + (new (symbol type process-drawable) _type_) + (compute-alignment! (_type_) transformq) + (align! (_type_ align-opts float float float) trsqv) + (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv) + (first-transform (_type_) transform) + (snd-transform (_type_) transform) ) ) ;; definition for method 3 of type align-control -(defmethod inspect align-control ((this align-control)) +(defmethod inspect ((this align-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tflags: #x~X~%" (-> this flags)) (format #t "~Tprocess: ~A~%" (-> this process)) @@ -43,13 +40,13 @@ ;; definition for method 0 of type align-control ;; INFO: Return type mismatch object vs align-control. -(defmethod new align-control ((allocation symbol) (type-to-make type) (arg0 process)) +(defmethod new align-control ((allocation symbol) (type-to-make type) (arg0 process-drawable)) (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (when (zero? this) (go process-drawable-art-error "memory") (return (the-as align-control 0)) ) - (set! (-> this process) (the-as process-drawable arg0)) + (set! (-> this process) arg0) this ) ) diff --git a/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc b/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc index 2c63364b6c2..060df670e93 100644 --- a/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc @@ -5,7 +5,7 @@ ;; INFO: Used lq/sq ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod compute-alignment! align-control ((this align-control)) +(defmethod compute-alignment! ((this align-control)) (local-vars (a0-9 symbol) (s7-0 none) (ra-0 int)) (with-pp (let ((s5-0 (-> this process skel active-channels))) @@ -119,17 +119,17 @@ ;; definition for method 12 of type align-control ;; INFO: Return type mismatch (inline-array transform) vs transform. -(defmethod first-transform align-control ((this align-control)) +(defmethod first-transform ((this align-control)) (the-as transform (-> this transform)) ) ;; definition for method 13 of type align-control -(defmethod snd-transform align-control ((this align-control)) +(defmethod snd-transform ((this align-control)) (-> this transform 1) ) ;; definition for method 10 of type align-control -(defmethod align! align-control ((this align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float)) +(defmethod align! ((this align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float)) (when (not (logtest? (-> this flags) (align-flags disabled))) (let* ((a0-1 (-> this process)) (t9-0 (method-of-object a0-1 apply-alignment)) @@ -147,7 +147,7 @@ ) ;; definition for method 26 of type trsqv -(defmethod set-and-limit-velocity trsqv ((this trsqv) (arg0 int) (arg1 vector) (arg2 float)) +(defmethod set-and-limit-velocity ((this trsqv) (arg0 int) (arg1 vector) (arg2 float)) (let ((gp-0 (-> this transv))) (when (logtest? arg0 4) (set! (-> gp-0 x) (-> arg1 x)) @@ -161,7 +161,7 @@ ) ;; definition for method 11 of type align-control -(defmethod align-vel-and-quat-only! align-control ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) +(defmethod align-vel-and-quat-only! ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) (when (not (logtest? (-> this flags) (align-flags disabled))) (let ((s5-0 (-> this delta))) (let ((s3-0 (-> this process root transv))) diff --git a/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc b/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc index 57bf67736a4..406cce1c798 100644 --- a/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc @@ -3,28 +3,25 @@ ;; definition of type joint-exploder-tuning (deftype joint-exploder-tuning (structure) - ((explosion uint64 :offset-assert 0) - (duration time-frame :offset-assert 8) - (gravity float :offset-assert 16) - (rot-speed float :offset-assert 20) - (fountain-rand-transv-lo vector :inline :offset-assert 32) - (fountain-rand-transv-hi vector :inline :offset-assert 48) - (away-from-focal-pt vector :inline :offset 32) - (away-from-rand-transv-xz-lo float :offset 48) - (away-from-rand-transv-xz-hi float :offset 52) - (away-from-rand-transv-y-lo float :offset 56) - (away-from-rand-transv-y-hi float :offset 60) + ((explosion uint64) + (duration time-frame) + (gravity float) + (rot-speed float) + (fountain-rand-transv-lo vector :inline) + (fountain-rand-transv-hi vector :inline) + (away-from-focal-pt vector :inline :overlay-at fountain-rand-transv-lo) + (away-from-rand-transv-xz-lo float :overlay-at (-> fountain-rand-transv-hi x)) + (away-from-rand-transv-xz-hi float :overlay-at (-> fountain-rand-transv-hi y)) + (away-from-rand-transv-y-lo float :overlay-at (-> fountain-rand-transv-hi z)) + (away-from-rand-transv-y-hi float :overlay-at (-> fountain-rand-transv-hi w)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) ;; definition for method 3 of type joint-exploder-tuning -(defmethod inspect joint-exploder-tuning ((this joint-exploder-tuning)) +(defmethod inspect ((this joint-exploder-tuning)) (format #t "[~8x] ~A~%" this 'joint-exploder-tuning) (format #t "~Texplosion: ~D~%" (-> this explosion)) (format #t "~Tduration: ~D~%" (-> this duration)) @@ -42,16 +39,13 @@ ;; definition of type joint-exploder-static-joint-params (deftype joint-exploder-static-joint-params (structure) - ((joint-index int16 :offset-assert 0) - (parent-joint-index int16 :offset-assert 2) + ((joint-index int16) + (parent-joint-index int16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type joint-exploder-static-joint-params -(defmethod inspect joint-exploder-static-joint-params ((this joint-exploder-static-joint-params)) +(defmethod inspect ((this joint-exploder-static-joint-params)) (format #t "[~8x] ~A~%" this 'joint-exploder-static-joint-params) (format #t "~Tjoint-index: ~D~%" (-> this joint-index)) (format #t "~Tparent-joint-index: ~D~%" (-> this parent-joint-index)) @@ -60,15 +54,12 @@ ;; definition of type joint-exploder-static-params (deftype joint-exploder-static-params (basic) - ((joints (array joint-exploder-static-joint-params) :offset-assert 4) + ((joints (array joint-exploder-static-joint-params)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type joint-exploder-static-params -(defmethod inspect joint-exploder-static-params ((this joint-exploder-static-params)) +(defmethod inspect ((this joint-exploder-static-params)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tjoints: ~A~%" (-> this joints)) this @@ -76,22 +67,19 @@ ;; definition of type joint-exploder-joint (deftype joint-exploder-joint (structure) - ((next int16 :offset-assert 0) - (prev int16 :offset-assert 2) - (joint-index int16 :offset-assert 4) - (rspeed float :offset-assert 8) - (mat matrix :inline :offset-assert 16) - (rmat matrix :inline :offset-assert 80) - (transv vector :inline :offset-assert 144) - (prev-pos vector :inline :offset-assert 160) + ((next int16) + (prev int16) + (joint-index int16) + (rspeed float) + (mat matrix :inline) + (rmat matrix :inline) + (transv vector :inline) + (prev-pos vector :inline) ) - :method-count-assert 9 - :size-assert #xb0 - :flag-assert #x9000000b0 ) ;; definition for method 3 of type joint-exploder-joint -(defmethod inspect joint-exploder-joint ((this joint-exploder-joint)) +(defmethod inspect ((this joint-exploder-joint)) (format #t "[~8x] ~A~%" this 'joint-exploder-joint) (format #t "~Tnext: ~D~%" (-> this next)) (format #t "~Tprev: ~D~%" (-> this prev)) @@ -106,19 +94,16 @@ ;; definition of type joint-exploder-joints (deftype joint-exploder-joints (basic) - ((num-joints int32 :offset-assert 4) - (joint joint-exploder-joint :inline :dynamic :offset 16) + ((num-joints int32) + (joint joint-exploder-joint :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type joint-exploder-static-params) _type_ 0) + (new (symbol type joint-exploder-static-params) _type_) ) ) ;; definition for method 3 of type joint-exploder-joints -(defmethod inspect joint-exploder-joints ((this joint-exploder-joints)) +(defmethod inspect ((this joint-exploder-joints)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tnum-joints: ~D~%" (-> this num-joints)) (format #t "~Tjoint[0] @ #x~X~%" (-> this joint)) @@ -127,18 +112,15 @@ ;; definition of type joint-exploder-list (deftype joint-exploder-list (structure) - ((head int32 :offset-assert 0) - (pre-moved? symbol :offset-assert 4) - (bbox-valid? symbol :offset-assert 8) - (bbox bounding-box :inline :offset-assert 16) + ((head int32) + (pre-moved? symbol) + (bbox-valid? symbol) + (bbox bounding-box :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type joint-exploder-list -(defmethod inspect joint-exploder-list ((this joint-exploder-list)) +(defmethod inspect ((this joint-exploder-list)) (format #t "[~8x] ~A~%" this 'joint-exploder-list) (format #t "~Thead: ~D~%" (-> this head)) (format #t "~Tpre-moved?: ~A~%" (-> this pre-moved?)) @@ -149,30 +131,26 @@ ;; definition of type joint-exploder (deftype joint-exploder (process-drawable) - ((parent-override (pointer process-drawable) :offset 12) - (die-if-below-y float :offset-assert 176) - (die-if-beyond-xz-dist-sqrd float :offset-assert 180) - (joints joint-exploder-joints :offset-assert 184) - (static-params joint-exploder-static-params :offset-assert 188) - (anim art-joint-anim :offset-assert 192) - (scale-vector vector :inline :offset-assert 208) - (tuning joint-exploder-tuning :inline :offset-assert 224) - (lists joint-exploder-list 5 :inline :offset-assert 288) + ((parent-override (pointer process-drawable) :overlay-at parent) + (die-if-below-y float) + (die-if-beyond-xz-dist-sqrd float) + (joints joint-exploder-joints) + (static-params joint-exploder-static-params) + (anim art-joint-anim) + (scale-vector vector :inline) + (tuning joint-exploder-tuning :inline) + (lists joint-exploder-list 5 :inline) ) - :heap-base #x1a0 - :method-count-assert 29 - :size-assert #x210 - :flag-assert #x1d01a00210 (:methods - (joint-exploder-method-20 (_type_ joint-exploder-list int) int 20) - (joint-exploder-method-21 (_type_ joint-exploder-list joint-exploder-joint) none 21) - (joint-exploder-method-22 (_type_ joint-exploder-list) symbol 22) - (joint-exploder-method-23 (_type_) symbol 23) - (joint-exploder-method-24 (_type_ joint-exploder-list int) int 24) - (joint-exploder-method-25 (_type_ joint-exploder-list) symbol 25) - (joint-exploder-method-26 (_type_ joint-exploder-list int) int 26) - (joint-exploder-method-27 (_type_ joint-exploder-list int) joint-exploder-list 27) - (joint-exploder-method-28 (_type_ joint-exploder-list) none 28) + (joint-exploder-method-20 (_type_ joint-exploder-list int) int) + (joint-exploder-method-21 (_type_ joint-exploder-list joint-exploder-joint) none) + (joint-exploder-method-22 (_type_ joint-exploder-list) symbol) + (joint-exploder-method-23 (_type_) symbol) + (joint-exploder-method-24 (_type_ joint-exploder-list int) int) + (joint-exploder-method-25 (_type_ joint-exploder-list) symbol) + (joint-exploder-method-26 (_type_ joint-exploder-list int) int) + (joint-exploder-method-27 (_type_ joint-exploder-list int) joint-exploder-list) + (joint-exploder-method-28 (_type_ joint-exploder-list) none) ) (:states joint-exploder-shatter @@ -180,7 +158,7 @@ ) ;; definition for method 3 of type joint-exploder -(defmethod inspect joint-exploder ((this joint-exploder)) +(defmethod inspect ((this joint-exploder)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -197,7 +175,7 @@ ;; definition for method 5 of type joint-exploder-joints ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of joint-exploder-joints ((this joint-exploder-joints)) +(defmethod asize-of ((this joint-exploder-joints)) (the-as int (+ (-> this type size) (* 176 (-> this num-joints)))) ) @@ -238,7 +216,7 @@ ;; definition for method 24 of type joint-exploder ;; INFO: Used lq/sq -(defmethod joint-exploder-method-24 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod joint-exploder-method-24 ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (let ((v0-0 (joint-exploder-method-26 this arg0 arg1))) (let* ((v1-1 (-> this joints)) (v1-2 (-> v1-1 joint arg1)) @@ -253,7 +231,7 @@ ) ;; definition for method 26 of type joint-exploder -(defmethod joint-exploder-method-26 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod joint-exploder-method-26 ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (let* ((v1-0 (-> this joints)) (a2-1 (-> v1-0 joint arg1)) (a0-4 (-> a2-1 prev)) @@ -285,7 +263,7 @@ ) ;; definition for method 20 of type joint-exploder -(defmethod joint-exploder-method-20 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod joint-exploder-method-20 ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (let* ((v1-0 (-> this joints)) (a3-0 (-> v1-0 joint arg1)) (a0-4 (-> arg0 head)) @@ -303,7 +281,7 @@ ;; definition for method 21 of type joint-exploder ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod joint-exploder-method-21 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) +(defmethod joint-exploder-method-21 ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) (let ((a1-1 (-> arg1 mat vector 3))) (cond ((-> arg0 bbox-valid?) @@ -322,7 +300,7 @@ ;; definition for method 27 of type joint-exploder ;; INFO: Used lq/sq -(defmethod joint-exploder-method-27 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod joint-exploder-method-27 ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (local-vars (sv-16 int) (sv-32 int) (sv-48 int)) (let ((s4-0 (the-as joint-exploder-list #f))) (let ((v1-0 1)) @@ -420,7 +398,7 @@ ) ;; definition for method 28 of type joint-exploder -(defmethod joint-exploder-method-28 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) +(defmethod joint-exploder-method-28 ((this joint-exploder) (arg0 joint-exploder-list)) (when (and (-> arg0 bbox-valid?) (>= (-> arg0 head) 0)) (cond ((< 20480.0 (- (-> arg0 bbox max x) (-> arg0 bbox min x))) @@ -454,7 +432,7 @@ ;; definition for method 25 of type joint-exploder ;; INFO: Used lq/sq -(defmethod joint-exploder-method-25 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) +(defmethod joint-exploder-method-25 ((this joint-exploder) (arg0 joint-exploder-list)) (set! (-> arg0 bbox-valid?) #f) (set! (-> arg0 pre-moved?) #t) (let ((s4-0 (-> this joints)) @@ -499,7 +477,7 @@ ;; definition for method 22 of type joint-exploder ;; INFO: Used lq/sq -(defmethod joint-exploder-method-22 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) +(defmethod joint-exploder-method-22 ((this joint-exploder) (arg0 joint-exploder-list)) (fill-using-bounding-box *collide-cache* (-> arg0 bbox) @@ -622,7 +600,7 @@ ;; definition for method 23 of type joint-exploder ;; INFO: Used lq/sq -(defmethod joint-exploder-method-23 joint-exploder ((this joint-exploder)) +(defmethod joint-exploder-method-23 ((this joint-exploder)) (let ((gp-0 (-> this joints))) (dotimes (s4-0 (-> gp-0 num-joints)) (let ((v1-2 (-> this static-params joints s4-0)) @@ -720,7 +698,7 @@ ;; definition for method 7 of type joint-exploder ;; INFO: Return type mismatch process-drawable vs joint-exploder. -(defmethod relocate joint-exploder ((this joint-exploder) (arg0 int)) +(defmethod relocate ((this joint-exploder) (arg0 int)) (if (nonzero? (-> this joints)) (&+! (-> this joints) arg0) ) diff --git a/test/decompiler/reference/jak1/engine/anim/joint-h_REF.gc b/test/decompiler/reference/jak1/engine/anim/joint-h_REF.gc index becc5fdfa1c..5f9bb50ffc8 100644 --- a/test/decompiler/reference/jak1/engine/anim/joint-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/joint-h_REF.gc @@ -3,29 +3,26 @@ ;; definition of type joint-control-channel (deftype joint-control-channel (structure) - ((parent joint-control :offset-assert 0) - (command symbol :offset-assert 4) - (frame-interp float :offset-assert 8) - (frame-group art-joint-anim :offset-assert 12) - (frame-num float :offset-assert 16) - (num-func (function joint-control-channel float float float) :offset-assert 20) - (param float 2 :offset-assert 24) - (group-sub-index int16 :offset-assert 32) - (group-size int16 :offset-assert 34) - (dist meters :offset-assert 36) - (eval-time uint32 :offset-assert 40) - (inspector-amount float :offset-assert 44) + ((parent joint-control) + (command symbol) + (frame-interp float) + (frame-group art-joint-anim) + (frame-num float) + (num-func (function joint-control-channel float float float)) + (param float 2) + (group-sub-index int16) + (group-size int16) + (dist meters) + (eval-time uint32) + (inspector-amount float) ) - :method-count-assert 10 - :size-assert #x30 - :flag-assert #xa00000030 (:methods - (debug-print-frames (_type_) _type_ 9) + (debug-print-frames (_type_) _type_) ) ) ;; definition for method 3 of type joint-control-channel -(defmethod inspect joint-control-channel ((this joint-control-channel)) +(defmethod inspect ((this joint-control-channel)) (format #t "[~8x] ~A~%" this 'joint-control-channel) (format #t "~Tparent: ~A~%" (-> this parent)) (format #t "~Tcommand: ~A~%" (-> this command)) @@ -44,38 +41,35 @@ ;; definition of type joint-control (deftype joint-control (basic) - ((status janim-status :offset-assert 4) - (allocated-length int16 :offset-assert 6) - (root-channel (inline-array joint-control-channel) :offset 16) - (blend-index int32 :offset-assert 20) - (active-channels int32 :offset-assert 24) - (generate-frame-function (function (inline-array vector) int process-drawable int) :offset-assert 28) - (prebind-function (function pointer int process-drawable none) :offset-assert 32) - (postbind-function (function process-drawable none) :offset-assert 36) - (effect effect-control :offset-assert 40) - (channel joint-control-channel 3 :inline :offset-assert 48) - (frame-group0 art-joint-anim :offset 60) - (frame-num0 float :offset 64) - (frame-interp0 float :offset 56) - (frame-group1 art-joint-anim :offset 108) - (frame-num1 float :offset 112) - (frame-interp1 float :offset 104) - (frame-group2 art-joint-anim :offset 156) - (frame-num2 float :offset 160) - (frame-interp2 float :offset 152) + ((status janim-status) + (allocated-length int16) + (root-channel (inline-array joint-control-channel) :offset 16) + (blend-index int32) + (active-channels int32) + (generate-frame-function (function (inline-array vector) int process-drawable int)) + (prebind-function (function pointer int process-drawable none)) + (postbind-function (function process-drawable none)) + (effect effect-control) + (channel joint-control-channel 3 :inline) + (frame-group0 art-joint-anim :overlay-at (-> channel 0 frame-group)) + (frame-num0 float :overlay-at (-> channel 0 frame-num)) + (frame-interp0 float :overlay-at (-> channel 0 frame-interp)) + (frame-group1 art-joint-anim :offset 108) + (frame-num1 float :offset 112) + (frame-interp1 float :offset 104) + (frame-group2 art-joint-anim :offset 156) + (frame-num2 float :offset 160) + (frame-interp2 float :offset 152) ) - :method-count-assert 11 - :size-assert #xc0 - :flag-assert #xb000000c0 (:methods - (new (symbol type int) _type_ 0) - (current-cycle-distance (_type_) float 9) - (debug-print-channels (_type_ symbol) int 10) + (new (symbol type int) _type_) + (current-cycle-distance (_type_) float) + (debug-print-channels (_type_ symbol) int) ) ) ;; definition for method 3 of type joint-control -(defmethod inspect joint-control ((this joint-control)) +(defmethod inspect ((this joint-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tstatus: ~D~%" (-> this status)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -101,16 +95,13 @@ ;; definition of type matrix-stack (deftype matrix-stack (structure) - ((top matrix :offset-assert 0) - (data matrix 24 :inline :offset-assert 16) + ((top matrix) + (data matrix 24 :inline) ) - :method-count-assert 9 - :size-assert #x610 - :flag-assert #x900000610 ) ;; definition for method 3 of type matrix-stack -(defmethod inspect matrix-stack ((this matrix-stack)) +(defmethod inspect ((this matrix-stack)) (format #t "[~8x] ~A~%" this 'matrix-stack) (format #t "~Ttop: #~%" (-> this top)) (format #t "~Tdata[24] @ #x~X~%" (-> this data)) @@ -119,21 +110,18 @@ ;; definition of type channel-upload-info (deftype channel-upload-info (structure) - ((fixed joint-anim-compressed-fixed :offset-assert 0) - (fixed-qwc int32 :offset-assert 4) - (frame joint-anim-compressed-frame :offset-assert 8) - (frame-qwc int32 :offset-assert 12) - (amount float :offset-assert 16) - (interp float :offset-assert 20) + ((fixed joint-anim-compressed-fixed) + (fixed-qwc int32) + (frame joint-anim-compressed-frame) + (frame-qwc int32) + (amount float) + (interp float) ) :pack-me - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type channel-upload-info -(defmethod inspect channel-upload-info ((this channel-upload-info)) +(defmethod inspect ((this channel-upload-info)) (format #t "[~8x] ~A~%" this 'channel-upload-info) (format #t "~Tfixed: #~%" (-> this fixed)) (format #t "~Tfixed-qwc: ~D~%" (-> this fixed-qwc)) @@ -146,28 +134,25 @@ ;; definition of type joint-work (deftype joint-work (structure) - ((temp-mtx matrix :inline :offset-assert 0) - (joint-stack matrix-stack :inline :offset-assert 64) - (fix-jmp-table (function none) 16 :offset-assert 1616) - (frm-jmp-table (function none) 16 :offset-assert 1680) - (pair-jmp-table (function none) 16 :offset-assert 1744) - (uploads channel-upload-info 24 :inline :offset-assert 1808) - (num-uploads int32 :offset-assert 2384) - (mtx-acc matrix 2 :inline :offset-assert 2400) - (tq-acc transformq 100 :inline :offset-assert 2528) - (jacp-hdr joint-anim-compressed-hdr :inline :offset-assert 7328) - (fixed-data joint-anim-compressed-fixed :inline :offset-assert 7392) - (frame-data joint-anim-compressed-frame 2 :inline :offset-assert 9600) - (flatten-array float 576 :offset 2400) - (flattened vector 24 :inline :offset 2400) + ((temp-mtx matrix :inline) + (joint-stack matrix-stack :inline) + (fix-jmp-table (function none) 16) + (frm-jmp-table (function none) 16) + (pair-jmp-table (function none) 16) + (uploads channel-upload-info 24 :inline) + (num-uploads int32) + (mtx-acc matrix 2 :inline) + (tq-acc transformq 100 :inline) + (jacp-hdr joint-anim-compressed-hdr :inline) + (fixed-data joint-anim-compressed-fixed :inline) + (frame-data joint-anim-compressed-frame 2 :inline) + (flatten-array float 576 :overlay-at mtx-acc) + (flattened vector 24 :inline :overlay-at mtx-acc) ) - :method-count-assert 9 - :size-assert #x3640 - :flag-assert #x900003640 ) ;; definition for method 3 of type joint-work -(defmethod inspect joint-work ((this joint-work)) +(defmethod inspect ((this joint-work)) (format #t "[~8x] ~A~%" this 'joint-work) (format #t "~Ttemp-mtx: #~%" (-> this temp-mtx)) (format #t "~Tjoint-stack: #~%" (-> this joint-stack)) diff --git a/test/decompiler/reference/jak1/engine/anim/joint-mod-h_REF.gc b/test/decompiler/reference/jak1/engine/anim/joint-mod-h_REF.gc index 30437bc16f0..036842cad35 100644 --- a/test/decompiler/reference/jak1/engine/anim/joint-mod-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/joint-mod-h_REF.gc @@ -3,43 +3,40 @@ ;; definition of type joint-mod (deftype joint-mod (basic) - ((mode joint-mod-handler-mode :offset-assert 4) - (process process-drawable :offset-assert 8) - (joint cspace :offset-assert 12) - (target vector :inline :offset-assert 16) - (twist vector :inline :offset-assert 32) - (twist-max vector :inline :offset-assert 48) - (trans vector :inline :offset-assert 64) - (quat quaternion :inline :offset-assert 80) - (scale vector :inline :offset-assert 96) - (notice-time time-frame :offset-assert 112) - (flex-blend float :offset-assert 120) - (blend float :offset-assert 124) - (max-dist meters :offset-assert 128) - (ignore-angle degrees :offset-assert 132) - (up uint8 :offset-assert 136) - (nose uint8 :offset-assert 137) - (ear uint8 :offset-assert 138) - (shutting-down? symbol :offset-assert 140) - (parented-scale? symbol :offset 128) + ((mode joint-mod-handler-mode) + (process process-drawable) + (joint cspace) + (target vector :inline) + (twist vector :inline) + (twist-max vector :inline) + (trans vector :inline) + (quat quaternion :inline) + (scale vector :inline) + (notice-time time-frame) + (flex-blend float) + (blend float) + (max-dist meters) + (ignore-angle degrees) + (up uint8) + (nose uint8) + (ear uint8) + (shutting-down? symbol) + (parented-scale? symbol :overlay-at max-dist) ) - :method-count-assert 16 - :size-assert #x90 - :flag-assert #x1000000090 (:methods - (new (symbol type joint-mod-handler-mode process-drawable int) _type_ 0) - (set-mode! (_type_ joint-mod-handler-mode) _type_ 9) - (set-target! (_type_ vector) none 10) - (look-at-enemy! (_type_ vector symbol process) none 11) - (reset-blend! (_type_) _type_ 12) - (set-twist! (_type_ float float float) vector 13) - (set-trs! (_type_ vector quaternion vector) none 14) - (shut-down! (_type_) none 15) + (new (symbol type joint-mod-handler-mode process-drawable int) _type_) + (set-mode! (_type_ joint-mod-handler-mode) _type_) + (set-target! (_type_ vector) none) + (look-at-enemy! (_type_ vector symbol process) none) + (reset-blend! (_type_) _type_) + (set-twist! (_type_ float float float) vector) + (set-trs! (_type_ vector quaternion vector) none) + (shut-down! (_type_) none) ) ) ;; definition for method 3 of type joint-mod -(defmethod inspect joint-mod ((this joint-mod)) +(defmethod inspect ((this joint-mod)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tmode: ~D~%" (-> this mode)) (format #t "~Tprocess: ~A~%" (-> this process)) @@ -95,7 +92,7 @@ ) ;; definition for method 9 of type joint-mod -(defmethod set-mode! joint-mod ((this joint-mod) (handler-mode joint-mod-handler-mode)) +(defmethod set-mode! ((this joint-mod) (handler-mode joint-mod-handler-mode)) (set! (-> this mode) handler-mode) (let ((joint (-> this joint))) (case handler-mode @@ -153,21 +150,21 @@ ) ;; definition for method 12 of type joint-mod -(defmethod reset-blend! joint-mod ((this joint-mod)) +(defmethod reset-blend! ((this joint-mod)) (set! (-> this blend) 0.0) this ) ;; definition for method 15 of type joint-mod ;; INFO: Return type mismatch float vs none. -(defmethod shut-down! joint-mod ((this joint-mod)) +(defmethod shut-down! ((this joint-mod)) (set! (-> this shutting-down?) #t) (set! (-> this blend) 0.0) (none) ) ;; definition for method 13 of type joint-mod -(defmethod set-twist! joint-mod ((this joint-mod) (x float) (y float) (z float)) +(defmethod set-twist! ((this joint-mod) (x float) (y float) (z float)) (if x (set! (-> this twist x) x) ) @@ -183,7 +180,7 @@ ;; definition for method 14 of type joint-mod ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod set-trs! joint-mod ((this joint-mod) (trans vector) (rot quaternion) (scale vector)) +(defmethod set-trs! ((this joint-mod) (trans vector) (rot quaternion) (scale vector)) (if trans (set! (-> this trans quad) (-> trans quad)) ) @@ -200,7 +197,7 @@ ;; definition for method 10 of type joint-mod ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod set-target! joint-mod ((this joint-mod) (target-trans vector)) +(defmethod set-target! ((this joint-mod) (target-trans vector)) (if (= (-> this mode) (joint-mod-handler-mode reset)) (set-mode! this (joint-mod-handler-mode look-at)) ) @@ -218,17 +215,14 @@ ;; definition of type try-to-look-at-info (deftype try-to-look-at-info (basic) - ((who handle :offset-assert 8) - (horz float :offset-assert 16) - (vert float :offset-assert 20) + ((who handle) + (horz float) + (vert float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type try-to-look-at-info -(defmethod inspect try-to-look-at-info ((this try-to-look-at-info)) +(defmethod inspect ((this try-to-look-at-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Twho: ~D~%" (-> this who)) (format #t "~Thorz: ~f~%" (-> this horz)) @@ -242,7 +236,7 @@ ;; definition for method 11 of type joint-mod ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod look-at-enemy! joint-mod ((this joint-mod) (target-trans vector) (option symbol) (proc process)) +(defmethod look-at-enemy! ((this joint-mod) (target-trans vector) (option symbol) (proc process)) (when (= option 'attacking) (let* ((s3-0 proc) (proc-drawable (if (and (nonzero? s3-0) (type-type? (-> s3-0 type) process-drawable)) @@ -593,22 +587,19 @@ ;; definition of type joint-mod-wheel (deftype joint-mod-wheel (basic) - ((last-position vector :inline :offset-assert 16) - (angle float :offset-assert 32) - (process process-drawable :offset-assert 36) - (wheel-radius float :offset-assert 40) - (wheel-axis int8 :offset-assert 44) + ((last-position vector :inline) + (angle float) + (process process-drawable) + (wheel-radius float) + (wheel-axis int8) ) - :method-count-assert 9 - :size-assert #x2d - :flag-assert #x90000002d (:methods - (new (symbol type process-drawable int float int) _type_ 0) + (new (symbol type process-drawable int float int) _type_) ) ) ;; definition for method 3 of type joint-mod-wheel -(defmethod inspect joint-mod-wheel ((this joint-mod-wheel)) +(defmethod inspect ((this joint-mod-wheel)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlast-position: #~%" (-> this last-position)) (format #t "~Tangle: ~f~%" (-> this angle)) @@ -665,22 +656,19 @@ ;; definition of type joint-mod-set-local (deftype joint-mod-set-local (basic) - ((transform transformq :inline :offset-assert 16) - (set-rotation symbol :offset-assert 64) - (set-scale symbol :offset-assert 68) - (set-translation symbol :offset-assert 72) - (enable symbol :offset-assert 76) + ((transform transformq :inline) + (set-rotation symbol) + (set-scale symbol) + (set-translation symbol) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 (:methods - (new (symbol type process-drawable int symbol symbol symbol) _type_ 0) + (new (symbol type process-drawable int symbol symbol symbol) _type_) ) ) ;; definition for method 3 of type joint-mod-set-local -(defmethod inspect joint-mod-set-local ((this joint-mod-set-local)) +(defmethod inspect ((this joint-mod-set-local)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttransform: #~%" (-> this transform)) (format #t "~Tset-rotation: ~A~%" (-> this set-rotation)) @@ -743,20 +731,17 @@ ;; definition of type joint-mod-set-world (deftype joint-mod-set-world (basic) - ((transform transformq :inline :offset-assert 16) - (node-index int32 :offset-assert 64) - (enable basic :offset-assert 68) + ((transform transformq :inline) + (node-index int32) + (enable basic) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 (:methods - (new (symbol type process-drawable int basic) _type_ 0) + (new (symbol type process-drawable int basic) _type_) ) ) ;; definition for method 3 of type joint-mod-set-world -(defmethod inspect joint-mod-set-world ((this joint-mod-set-world)) +(defmethod inspect ((this joint-mod-set-world)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttransform: #~%" (-> this transform)) (format #t "~Tnode-index: ~D~%" (-> this node-index)) @@ -795,22 +780,19 @@ ;; definition of type joint-mod-blend-local (deftype joint-mod-blend-local (basic) - ((transform transformq :inline :offset-assert 16) - (blend-transform transformq :inline :offset-assert 64) - (node-index int32 :offset-assert 112) - (blend float :offset-assert 116) - (enable basic :offset-assert 120) + ((transform transformq :inline) + (blend-transform transformq :inline) + (node-index int32) + (blend float) + (enable basic) ) - :method-count-assert 9 - :size-assert #x7c - :flag-assert #x90000007c (:methods - (new (symbol type process-drawable int basic) _type_ 0) + (new (symbol type process-drawable int basic) _type_) ) ) ;; definition for method 3 of type joint-mod-blend-local -(defmethod inspect joint-mod-blend-local ((this joint-mod-blend-local)) +(defmethod inspect ((this joint-mod-blend-local)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttransform: #~%" (-> this transform)) (format #t "~Tblend-transform: #~%" (-> this blend-transform)) @@ -863,21 +845,18 @@ ;; definition of type joint-mod-spinner (deftype joint-mod-spinner (basic) - ((spin-axis vector :inline :offset-assert 16) - (angle float :offset-assert 32) - (spin-rate float :offset-assert 36) - (enable basic :offset-assert 40) + ((spin-axis vector :inline) + (angle float) + (spin-rate float) + (enable basic) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c (:methods - (new (symbol type process-drawable int vector float) _type_ 0) + (new (symbol type process-drawable int vector float) _type_) ) ) ;; definition for method 3 of type joint-mod-spinner -(defmethod inspect joint-mod-spinner ((this joint-mod-spinner)) +(defmethod inspect ((this joint-mod-spinner)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tspin-axis: #~%" (-> this spin-axis)) (format #t "~Tangle: ~f~%" (-> this angle)) diff --git a/test/decompiler/reference/jak1/engine/anim/joint_REF.gc b/test/decompiler/reference/jak1/engine/anim/joint_REF.gc index 55d476a9066..f5948f9af8c 100644 --- a/test/decompiler/reference/jak1/engine/anim/joint_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/joint_REF.gc @@ -2,13 +2,13 @@ (in-package goal) ;; definition for method 2 of type joint -(defmethod print joint ((this joint)) +(defmethod print ((this joint)) (format #t "#<~A ~S ~D @ #x~X>" (-> this type) (-> this name) (-> this number) this) this ) ;; definition for method 8 of type joint -(defmethod mem-usage joint ((this joint) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this joint) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 66 (-> arg0 length))) (set! (-> arg0 data 65 name) "joint") (+! (-> arg0 data 65 count) 1) @@ -20,18 +20,18 @@ ) ;; definition for method 2 of type joint-anim -(defmethod print joint-anim ((this joint-anim)) +(defmethod print ((this joint-anim)) (format #t "#<~A ~S ~D [~D] @ #x~X>" (-> this type) (-> this name) (-> this number) (-> this length) this) this ) ;; definition for method 4 of type joint-anim -(defmethod length joint-anim ((this joint-anim)) +(defmethod length ((this joint-anim)) (-> this length) ) ;; definition for method 3 of type joint-anim-matrix -(defmethod inspect joint-anim-matrix ((this joint-anim-matrix)) +(defmethod inspect ((this joint-anim-matrix)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tnumber: ~D~%" (-> this number)) @@ -41,12 +41,12 @@ ;; definition for method 5 of type joint-anim-matrix ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-matrix ((this joint-anim-matrix)) +(defmethod asize-of ((this joint-anim-matrix)) (the-as int (+ (-> joint-anim-matrix size) (* (-> this length) 64))) ) ;; definition for method 3 of type joint-anim-transformq -(defmethod inspect joint-anim-transformq ((this joint-anim-transformq)) +(defmethod inspect ((this joint-anim-transformq)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tnumber: ~D~%" (-> this number)) @@ -59,13 +59,13 @@ ;; definition for method 5 of type joint-anim-transformq ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-transformq ((this joint-anim-transformq)) +(defmethod asize-of ((this joint-anim-transformq)) (the-as int (+ (-> joint-anim-transformq size) (* 48 (-> this length)))) ) ;; definition for method 5 of type joint-anim-drawable ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-drawable ((this joint-anim-drawable)) +(defmethod asize-of ((this joint-anim-drawable)) (the-as int (+ (-> joint-anim-drawable size) (* (-> this length) 4))) ) @@ -95,7 +95,7 @@ ) ;; definition for method 8 of type joint-anim-drawable -(defmethod mem-usage joint-anim-drawable ((this joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 77 (-> arg0 length))) (set! (-> arg0 data 76 name) "joint-anim-drawable") (+! (-> arg0 data 76 count) 1) @@ -138,7 +138,7 @@ ) ;; definition for method 2 of type joint-control-channel -(defmethod print joint-control-channel ((this joint-control-channel)) +(defmethod print ((this joint-control-channel)) (format #t "#" @@ -152,7 +152,7 @@ ;; definition for method 5 of type joint-control ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of joint-control ((this joint-control)) +(defmethod asize-of ((this joint-control)) (the-as int (+ (-> this type size) (* 48 (-> this allocated-length)))) ) @@ -175,7 +175,7 @@ ) ;; definition for method 9 of type joint-control-channel -(defmethod debug-print-frames joint-control-channel ((this joint-control-channel)) +(defmethod debug-print-frames ((this joint-control-channel)) (let ((s5-0 (-> this frame-group)) (f30-0 (-> this frame-num)) ) @@ -188,7 +188,7 @@ ) ;; definition for method 10 of type joint-control -(defmethod debug-print-channels joint-control ((this joint-control) (arg0 symbol)) +(defmethod debug-print-channels ((this joint-control) (arg0 symbol)) (dotimes (s4-0 (-> this active-channels)) (let* ((v1-6 (if (and (-> this channel s4-0 frame-group) (nonzero? (-> this channel s4-0 frame-group))) (-> this channel s4-0 frame-group) @@ -246,35 +246,35 @@ ) ;; definition for method 12 of type art -(defmethod needs-link? art ((this art)) +(defmethod needs-link? ((this art)) #f ) ;; definition for method 10 of type art ;; INFO: Return type mismatch symbol vs joint. -(defmethod lookup-art art ((this art) (arg0 string) (arg1 type)) +(defmethod lookup-art ((this art) (arg0 string) (arg1 type)) (the-as joint #f) ) ;; definition for method 11 of type art ;; INFO: Return type mismatch symbol vs int. -(defmethod lookup-idx-of-art art ((this art) (arg0 string) (arg1 type)) +(defmethod lookup-idx-of-art ((this art) (arg0 string) (arg1 type)) (the-as int #f) ) ;; definition for method 2 of type art -(defmethod print art ((this art)) +(defmethod print ((this art)) (format #t "#<~A ~S :length ~D @ #x~X>" (-> this type) (-> this name) (-> this length) this) this ) ;; definition for method 4 of type art -(defmethod length art ((this art)) +(defmethod length ((this art)) (-> this length) ) ;; definition for method 9 of type art -(defmethod login art ((this art)) +(defmethod login ((this art)) (if (and (-> this extra) (zero? (-> this extra tag))) (set! (-> this extra tag) (&+ (the-as (pointer res-tag) (-> this extra)) 28)) ) @@ -282,7 +282,7 @@ ) ;; definition for method 8 of type art-mesh-anim -(defmethod mem-usage art-mesh-anim ((this art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 72 (-> arg0 length))) (set! (-> arg0 data 71 name) "art-mesh-anim") (+! (-> arg0 data 71 count) 1) @@ -302,12 +302,12 @@ ;; definition for method 5 of type art-joint-anim ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of art-joint-anim ((this art-joint-anim)) +(defmethod asize-of ((this art-joint-anim)) (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 3 of type art-joint-anim -(defmethod inspect art-joint-anim ((this art-joint-anim)) +(defmethod inspect ((this art-joint-anim)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tname: ~A~%" (-> this name)) @@ -326,7 +326,7 @@ ) ;; definition for method 8 of type art-joint-anim -(defmethod mem-usage art-joint-anim ((this art-joint-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-joint-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 75 (-> arg0 length))) (set! (-> arg0 data 74 name) "art-joint-anim") (+! (-> arg0 data 74 count) 1) @@ -362,12 +362,12 @@ ;; definition for method 5 of type art-joint-anim ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of art-joint-anim ((this art-joint-anim)) +(defmethod asize-of ((this art-joint-anim)) (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 3 of type art-group -(defmethod inspect art-group ((this art-group)) +(defmethod inspect ((this art-group)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tinfo: ~A~%" (-> this info)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -385,7 +385,7 @@ ;; definition for method 12 of type art-group ;; INFO: Return type mismatch object vs symbol. -(defmethod needs-link? art-group ((this art-group)) +(defmethod needs-link? ((this art-group)) (the-as symbol (and (-> this length) (type-type? (-> this data 0 type) art-joint-anim) (!= (-> this name) (-> (the-as art-joint-anim (-> this data 0)) master-art-group-name)) @@ -395,7 +395,7 @@ ;; definition for method 10 of type art-group ;; INFO: Return type mismatch art-element vs joint. -(defmethod lookup-art art-group ((this art-group) (arg0 string) (arg1 type)) +(defmethod lookup-art ((this art-group) (arg0 string) (arg1 type)) (the-as joint (cond @@ -425,7 +425,7 @@ ) ;; definition for method 11 of type art-group -(defmethod lookup-idx-of-art art-group ((this art-group) (arg0 string) (arg1 type)) +(defmethod lookup-idx-of-art ((this art-group) (arg0 string) (arg1 type)) (cond (arg1 (let ((s3-0 (+ (length (-> this name)) 1))) @@ -452,7 +452,7 @@ ) ;; definition for method 9 of type art-group -(defmethod login art-group ((this art-group)) +(defmethod login ((this art-group)) (dotimes (s5-0 (-> this length)) (if (-> this data s5-0) (set! (-> this data s5-0) (login (-> this data s5-0))) @@ -462,7 +462,7 @@ ) ;; definition for method 8 of type art-group -(defmethod mem-usage art-group ((this art-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 71 (-> arg0 length))) (set! (-> arg0 data 70 name) "art-group") (+! (-> arg0 data 70 count) 1) @@ -483,7 +483,7 @@ ;; definition for method 7 of type art-group ;; INFO: Return type mismatch art-group vs none. -(defmethod relocate art-group ((this art-group) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate ((this art-group) (arg0 kheap) (arg1 (pointer uint8))) (let ((s4-0 (clear *temp-string*))) (string<-charp s4-0 arg1) (set! this (cond @@ -517,12 +517,12 @@ ;; definition for method 5 of type art-mesh-geo ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of art-mesh-geo ((this art-mesh-geo)) +(defmethod asize-of ((this art-mesh-geo)) (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 8 of type art-mesh-geo -(defmethod mem-usage art-mesh-geo ((this art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 73 (-> arg0 length))) (set! (-> arg0 data 72 name) "art-mesh-geo") (+! (-> arg0 data 72 count) 1) @@ -542,7 +542,7 @@ ;; definition for method 9 of type art-mesh-geo ;; ERROR: Type Propagation failed: Failed type prop at op 20 ((set! v1 (l.h (+ s4 6)))): Could not get type of load: (set! v1 (l.h (+ s4 6))). ;; ERROR: Type analysis failed -(defmethod login art-mesh-geo ((a0-0 art-mesh-geo)) +(defmethod login ((a0-0 art-mesh-geo)) (local-vars (v0-0 none) (v0-1 art-mesh-geo) @@ -592,7 +592,7 @@ ) ;; definition for method 9 of type art-joint-anim -(defmethod login art-joint-anim ((this art-joint-anim)) +(defmethod login ((this art-joint-anim)) (if (and (-> this extra) (zero? (-> this extra tag))) (set! (-> this extra tag) (&+ (the-as (pointer res-tag) (-> this extra)) 28)) ) @@ -601,12 +601,12 @@ ;; definition for method 5 of type art-joint-geo ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of art-joint-geo ((this art-joint-geo)) +(defmethod asize-of ((this art-joint-geo)) (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 10 of type art-joint-geo -(defmethod lookup-art art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) +(defmethod lookup-art ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 (dotimes (s3-0 (-> this length)) @@ -628,7 +628,7 @@ ) ;; definition for method 11 of type art-joint-geo -(defmethod lookup-idx-of-art art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) +(defmethod lookup-idx-of-art ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 (dotimes (s3-0 (-> this length)) @@ -650,7 +650,7 @@ ) ;; definition for method 8 of type art-joint-geo -(defmethod mem-usage art-joint-geo ((this art-joint-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-joint-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 74 (-> arg0 length))) (set! (-> arg0 data 73 name) "art-joint-geo") (+! (-> arg0 data 73 count) 1) @@ -1128,7 +1128,7 @@ ) ;; definition for method 9 of type cspace -(defmethod reset-and-assign-geo! cspace ((this cspace) (arg0 basic)) +(defmethod reset-and-assign-geo! ((this cspace) (arg0 basic)) (set! (-> this parent) #f) (set! (-> this joint) #f) (set! (-> this geo) arg0) diff --git a/test/decompiler/reference/jak1/engine/anim/mspace-h_REF.gc b/test/decompiler/reference/jak1/engine/anim/mspace-h_REF.gc index 5a3529cb55a..b6e42ec253e 100644 --- a/test/decompiler/reference/jak1/engine/anim/mspace-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/mspace-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type joint (deftype joint (basic) - ((name string :offset-assert 4) - (number int32 :offset-assert 8) - (parent joint :offset-assert 12) - (bind-pose matrix :inline :offset-assert 16) + ((name string) + (number int32) + (parent joint) + (bind-pose matrix :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type joint -(defmethod inspect joint ((this joint)) +(defmethod inspect ((this joint)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tnumber: ~D~%" (-> this number)) @@ -25,18 +22,15 @@ ;; definition of type bone-cache (deftype bone-cache (structure) - ((bone-matrix uint32 :offset-assert 0) - (parent-matrix uint32 :offset-assert 4) - (dummy uint32 :offset-assert 8) - (frame uint32 :offset-assert 12) + ((bone-matrix uint32) + (parent-matrix uint32) + (dummy uint32) + (frame uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type bone-cache -(defmethod inspect bone-cache ((this bone-cache)) +(defmethod inspect ((this bone-cache)) (format #t "[~8x] ~A~%" this 'bone-cache) (format #t "~Tbone-matrix: ~D~%" (-> this bone-matrix)) (format #t "~Tparent-matrix: ~D~%" (-> this parent-matrix)) @@ -47,18 +41,15 @@ ;; definition of type bone (deftype bone (structure) - ((transform matrix :inline :offset-assert 0) - (position vector :inline :offset 48) - (scale vector :inline :offset-assert 64) - (cache bone-cache :inline :offset-assert 80) + ((transform matrix :inline) + (position vector :inline :overlay-at (-> transform vector 3)) + (scale vector :inline) + (cache bone-cache :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type bone -(defmethod inspect bone ((this bone)) +(defmethod inspect ((this bone)) (format #t "[~8x] ~A~%" this 'bone) (format #t "~Ttransform: #~%" (-> this transform)) (format #t "~Tposition: #~%" (-> this transform vector 3)) @@ -69,15 +60,12 @@ ;; definition of type skeleton (deftype skeleton (inline-array-class) - ((bones bone :inline :dynamic :offset-assert 16) + ((bones bone :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type skeleton -(defmethod inspect skeleton ((this skeleton)) +(defmethod inspect ((this skeleton)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -90,26 +78,23 @@ ;; definition of type cspace (deftype cspace (structure) - ((parent cspace :offset-assert 0) - (joint joint :offset-assert 4) - (joint-num int16 :offset-assert 8) - (geo basic :offset-assert 12) - (bone bone :offset-assert 16) - (param0 function :offset-assert 20) - (param1 basic :offset-assert 24) - (param2 basic :offset-assert 28) + ((parent cspace) + (joint joint) + (joint-num int16) + (geo basic) + (bone bone) + (param0 function) + (param1 basic) + (param2 basic) ) - :method-count-assert 10 - :size-assert #x20 - :flag-assert #xa00000020 (:methods - (new (symbol type basic) _type_ 0) - (reset-and-assign-geo! (_type_ basic) _type_ 9) + (new (symbol type basic) _type_) + (reset-and-assign-geo! (_type_ basic) _type_) ) ) ;; definition for method 3 of type cspace -(defmethod inspect cspace ((this cspace)) +(defmethod inspect ((this cspace)) (format #t "[~8x] ~A~%" this 'cspace) (format #t "~Tparent: #~%" (-> this parent)) (format #t "~Tjoint: ~A~%" (-> this joint)) @@ -124,15 +109,12 @@ ;; definition of type cspace-array (deftype cspace-array (inline-array-class) - ((data cspace :inline :dynamic :offset-assert 16) + ((data cspace :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type cspace-array -(defmethod inspect cspace-array ((this cspace-array)) +(defmethod inspect ((this cspace-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -144,7 +126,7 @@ (set! (-> cspace-array heap-base) (the-as uint 32)) ;; definition for method 2 of type cspace -(defmethod print cspace ((this cspace)) +(defmethod print ((this cspace)) (format #t "#" diff --git a/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc index 669a8b00007..c6ea4d3bf3b 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc @@ -9,20 +9,17 @@ ;; definition of type cam-layout-bank (deftype cam-layout-bank (basic) - ((spline-t float :offset-assert 4) - (spline-step float :offset-assert 8) - (intro-t float :offset-assert 12) - (intro-step float :offset-assert 16) - (debug-t float :offset-assert 20) - (debug-step float :offset-assert 24) + ((spline-t float) + (spline-step float) + (intro-t float) + (intro-step float) + (debug-t float) + (debug-step float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type cam-layout-bank -(defmethod inspect cam-layout-bank ((this cam-layout-bank)) +(defmethod inspect ((this cam-layout-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tspline-t: ~f~%" (-> this spline-t)) (format #t "~Tspline-step: ~f~%" (-> this spline-step)) @@ -50,34 +47,28 @@ ;; definition of type clm-basic (deftype clm-basic (basic) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type clm-basic -(defmethod inspect clm-basic ((this clm-basic)) +(defmethod inspect ((this clm-basic)) (format #t "[~8x] ~A~%" this (-> this type)) this ) ;; definition of type clm-item-action (deftype clm-item-action (structure) - ((button uint64 :offset-assert 0) - (options uint64 :offset-assert 8) - (func symbol :offset-assert 16) - (parm0 int32 :offset 20) - (parm0-basic basic :offset 20) - (parm1-basic basic :offset 24) - (parm1 symbol :offset 24) + ((button uint64) + (options uint64) + (func symbol) + (parm0 int32 :offset 20) + (parm0-basic basic :overlay-at parm0) + (parm1-basic basic :offset 24) + (parm1 symbol :overlay-at parm1-basic) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type clm-item-action -(defmethod inspect clm-item-action ((this clm-item-action)) +(defmethod inspect ((this clm-item-action)) (format #t "[~8x] ~A~%" this 'clm-item-action) (format #t "~Tbutton: ~D~%" (-> this button)) (format #t "~Toptions: ~D~%" (-> this options)) @@ -89,17 +80,14 @@ ;; definition of type clm-item (deftype clm-item (clm-basic) - ((description string :offset-assert 4) - (button-symbol symbol :offset-assert 8) - (action clm-item-action :inline :offset-assert 16) + ((description string) + (button-symbol symbol) + (action clm-item-action :inline) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type clm-item -(defmethod inspect clm-item ((this clm-item)) +(defmethod inspect ((this clm-item)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tdescription: ~A~%" (-> this description)) (format #t "~Tbutton-symbol: ~A~%" (-> this button-symbol)) @@ -109,22 +97,19 @@ ;; definition of type clm-list-item (deftype clm-list-item (basic) - ((description string :offset-assert 4) - (track-val symbol :offset-assert 8) - (val-func symbol :offset-assert 12) - (val-parm0 int32 :offset 16) - (val-parm0-basic basic :offset 16) - (val-parm1-basic basic :offset 20) - (val-parm1 symbol :offset 20) - (actions (array clm-item-action) :offset-assert 24) + ((description string) + (track-val symbol) + (val-func symbol) + (val-parm0 int32 :offset 16) + (val-parm0-basic basic :overlay-at val-parm0) + (val-parm1-basic basic :offset 20) + (val-parm1 symbol :overlay-at val-parm1-basic) + (actions (array clm-item-action)) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type clm-list-item -(defmethod inspect clm-list-item ((this clm-list-item)) +(defmethod inspect ((this clm-list-item)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tdescription: ~A~%" (-> this description)) (format #t "~Ttrack-val: ~A~%" (-> this track-val)) @@ -137,17 +122,14 @@ ;; definition of type clm-list (deftype clm-list (clm-basic) - ((tracker symbol :offset-assert 4) - (cur-list-item int32 :offset-assert 8) - (items (array clm-list-item) :offset-assert 12) + ((tracker symbol) + (cur-list-item int32) + (items (array clm-list-item)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type clm-list -(defmethod inspect clm-list ((this clm-list)) +(defmethod inspect ((this clm-list)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttracker: ~A~%" (-> this tracker)) (format #t "~Tcur-list-item: ~D~%" (-> this cur-list-item)) @@ -157,16 +139,13 @@ ;; definition of type clm (deftype clm (basic) - ((title string :offset-assert 4) - (items (array clm-basic) :offset-assert 8) + ((title string) + (items (array clm-basic)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type clm -(defmethod inspect clm ((this clm)) +(defmethod inspect ((this clm)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttitle: ~A~%" (-> this title)) (format #t "~Titems: ~A~%" (-> this items)) @@ -187,15 +166,12 @@ ;; definition of type volume-descriptor-array (deftype volume-descriptor-array (inline-array-class) - ((data plane-volume :inline :dynamic :offset 16) + ((data plane-volume :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type volume-descriptor-array -(defmethod inspect volume-descriptor-array ((this volume-descriptor-array)) +(defmethod inspect ((this volume-descriptor-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -214,26 +190,23 @@ ;; definition of type cam-layout (deftype cam-layout (process) - ((cam-entity entity-camera :offset-assert 112) - (num-entities int32 :offset-assert 116) - (cur-entity int32 :offset-assert 120) - (num-volumes int32 :offset-assert 124) - (cur-volume int32 :offset-assert 128) - (first-pvol int32 :offset-assert 132) - (first-cutoutvol int32 :offset-assert 136) - (res-key float :offset-assert 140) + ((cam-entity entity-camera) + (num-entities int32) + (cur-entity int32) + (num-volumes int32) + (cur-volume int32) + (first-pvol int32) + (first-cutoutvol int32) + (res-key float) ) :heap-base #x200 - :method-count-assert 14 - :size-assert #x90 - :flag-assert #xe02000090 (:states cam-layout-active ) ) ;; definition for method 3 of type cam-layout -(defmethod inspect cam-layout ((this cam-layout)) +(defmethod inspect ((this cam-layout)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -553,20 +526,17 @@ ;; definition of type interp-test-info (deftype interp-test-info (structure) - ((from vector :inline :offset-assert 0) - (to vector :inline :offset-assert 16) - (origin vector :inline :offset-assert 32) - (color vector4w :offset-assert 48) - (axis vector :offset-assert 52) - (disp string :offset-assert 56) + ((from vector :inline) + (to vector :inline) + (origin vector :inline) + (color vector4w) + (axis vector) + (disp string) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) ;; definition for method 3 of type interp-test-info -(defmethod inspect interp-test-info ((this interp-test-info)) +(defmethod inspect ((this interp-test-info)) (format #t "[~8x] ~A~%" this 'interp-test-info) (format #t "~Tfrom: #~%" (-> this from)) (format #t "~Tto: #~%" (-> this to)) @@ -2416,17 +2386,14 @@ ;; definition of type clmf-cam-flag-toggle-info (deftype clmf-cam-flag-toggle-info (structure) - ((key float :offset-assert 0) - (force-on int32 :offset-assert 4) - (force-off int32 :offset-assert 8) + ((key float) + (force-on int32) + (force-off int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type clmf-cam-flag-toggle-info -(defmethod inspect clmf-cam-flag-toggle-info ((this clmf-cam-flag-toggle-info)) +(defmethod inspect ((this clmf-cam-flag-toggle-info)) (format #t "[~8x] ~A~%" this 'clmf-cam-flag-toggle-info) (format #t "~Tkey: ~f~%" (-> this key)) (format #t "~Tforce-on: ~D~%" (-> this force-on)) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc index 37a980793b5..1bbc961d292 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc @@ -3,22 +3,19 @@ ;; definition of type camera-master-bank (deftype camera-master-bank (basic) - ((onscreen-head-height meters :offset-assert 4) - (onscreen-foot-height meters :offset-assert 8) - (target-height meters :offset-assert 12) - (up-move-to-pitch-ratio-in-air float :offset-assert 16) - (down-move-to-pitch-ratio-in-air float :offset-assert 20) - (up-move-to-pitch-on-ground float :offset-assert 24) - (down-move-to-pitch-on-ground float :offset-assert 28) - (pitch-off-blend float :offset-assert 32) + ((onscreen-head-height meters) + (onscreen-foot-height meters) + (target-height meters) + (up-move-to-pitch-ratio-in-air float) + (down-move-to-pitch-ratio-in-air float) + (up-move-to-pitch-on-ground float) + (down-move-to-pitch-on-ground float) + (pitch-off-blend float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type camera-master-bank -(defmethod inspect camera-master-bank ((this camera-master-bank)) +(defmethod inspect ((this camera-master-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tonscreen-head-height: (meters ~m)~%" (-> this onscreen-head-height)) (format #t "~Tonscreen-foot-height: (meters ~m)~%" (-> this onscreen-foot-height)) @@ -915,16 +912,12 @@ ;; definition of type list-keeper (deftype list-keeper (process) - ((dummy float :offset-assert 112) + ((dummy float) ) - :heap-base #x10 - :method-count-assert 14 - :size-assert #x74 - :flag-assert #xe00100074 ) ;; definition for method 3 of type list-keeper -(defmethod inspect list-keeper ((this list-keeper)) +(defmethod inspect ((this list-keeper)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc index 7178ab15c58..eb78ff1cb94 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc @@ -3,16 +3,13 @@ ;; definition of type cam-point-watch-bank (deftype cam-point-watch-bank (basic) - ((speed float :offset-assert 4) - (rot-speed degrees :offset-assert 8) + ((speed float) + (rot-speed degrees) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type cam-point-watch-bank -(defmethod inspect cam-point-watch-bank ((this cam-point-watch-bank)) +(defmethod inspect ((this cam-point-watch-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tspeed: ~f~%" (-> this speed)) (format #t "~Trot-speed: (deg ~r)~%" (-> this rot-speed)) @@ -92,16 +89,13 @@ ;; definition of type cam-free-bank (deftype cam-free-bank (basic) - ((speed float :offset-assert 4) - (rot-speed degrees :offset-assert 8) + ((speed float) + (rot-speed degrees) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type cam-free-bank -(defmethod inspect cam-free-bank ((this cam-free-bank)) +(defmethod inspect ((this cam-free-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tspeed: ~f~%" (-> this speed)) (format #t "~Trot-speed: (deg ~r)~%" (-> this rot-speed)) @@ -354,18 +348,15 @@ ;; definition of type camera-free-floating-move-info (deftype camera-free-floating-move-info (structure) - ((rv vector :inline :offset-assert 0) - (tv vector :inline :offset-assert 16) - (up vector :inline :offset-assert 32) - (tm matrix :inline :offset-assert 48) + ((rv vector :inline) + (tv vector :inline) + (up vector :inline) + (tm matrix :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type camera-free-floating-move-info -(defmethod inspect camera-free-floating-move-info ((this camera-free-floating-move-info)) +(defmethod inspect ((this camera-free-floating-move-info)) (format #t "[~8x] ~A~%" this 'camera-free-floating-move-info) (format #t "~Trv: #~%" (-> this rv)) (format #t "~Ttv: #~%" (-> this tv)) @@ -451,19 +442,16 @@ ;; definition of type camera-orbit-info (deftype camera-orbit-info (structure) - ((radius float :offset-assert 0) - (rot float :offset-assert 4) - (target-off vector :inline :offset-assert 16) - (orbit-off vector :inline :offset-assert 32) - (radius-lerp float :offset-assert 48) + ((radius float) + (rot float) + (target-off vector :inline) + (orbit-off vector :inline) + (radius-lerp float) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type camera-orbit-info -(defmethod inspect camera-orbit-info ((this camera-orbit-info)) +(defmethod inspect ((this camera-orbit-info)) (format #t "[~8x] ~A~%" this 'camera-orbit-info) (format #t "~Tradius: ~f~%" (-> this radius)) (format #t "~Trot: ~f~%" (-> this rot)) @@ -475,18 +463,15 @@ ;; definition of type CAM_ORBIT-bank (deftype CAM_ORBIT-bank (basic) - ((RADIUS_MAX float :offset-assert 4) - (RADIUS_MIN float :offset-assert 8) - (TARGET_OFF_ADJUST float :offset-assert 12) - (ORBIT_OFF_ADJUST float :offset-assert 16) + ((RADIUS_MAX float) + (RADIUS_MIN float) + (TARGET_OFF_ADJUST float) + (ORBIT_OFF_ADJUST float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type CAM_ORBIT-bank -(defmethod inspect CAM_ORBIT-bank ((this CAM_ORBIT-bank)) +(defmethod inspect ((this CAM_ORBIT-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~TRADIUS_MAX: ~f~%" (-> this RADIUS_MAX)) (format #t "~TRADIUS_MIN: ~f~%" (-> this RADIUS_MIN)) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc index bc53bdeedcc..546f8258b5c 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc @@ -377,18 +377,15 @@ ;; definition of type cam-eye-bank (deftype cam-eye-bank (basic) - ((rot-speed float :offset-assert 4) - (max-degrees float :offset-assert 8) - (max-fov float :offset-assert 12) - (min-fov float :offset-assert 16) + ((rot-speed float) + (max-degrees float) + (max-fov float) + (min-fov float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type cam-eye-bank -(defmethod inspect cam-eye-bank ((this cam-eye-bank)) +(defmethod inspect ((this cam-eye-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Trot-speed: ~f~%" (-> this rot-speed)) (format #t "~Tmax-degrees: ~f~%" (-> this max-degrees)) @@ -558,16 +555,13 @@ ;; definition of type cam-billy-bank (deftype cam-billy-bank (basic) - ((rot-speed float :offset-assert 4) - (tilt-degrees float :offset-assert 8) + ((rot-speed float) + (tilt-degrees float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type cam-billy-bank -(defmethod inspect cam-billy-bank ((this cam-billy-bank)) +(defmethod inspect ((this cam-billy-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Trot-speed: ~f~%" (-> this rot-speed)) (format #t "~Ttilt-degrees: ~f~%" (-> this tilt-degrees)) @@ -1199,16 +1193,13 @@ ;; definition of type cam-string-bank (deftype cam-string-bank (basic) - ((los-coll-rad meters :offset-assert 4) - (los-coll-rad2 meters :offset-assert 8) + ((los-coll-rad meters) + (los-coll-rad2 meters) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type cam-string-bank -(defmethod inspect cam-string-bank ((this cam-string-bank)) +(defmethod inspect ((this cam-string-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlos-coll-rad: (meters ~m)~%" (-> this los-coll-rad)) (format #t "~Tlos-coll-rad2: (meters ~m)~%" (-> this los-coll-rad2)) @@ -1317,17 +1308,14 @@ ;; definition of type los-dist (deftype los-dist (structure) - ((par-dist float :offset-assert 0) - (lat-dist float :offset-assert 4) - (vert-dist float :offset-assert 8) + ((par-dist float) + (lat-dist float) + (vert-dist float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type los-dist -(defmethod inspect los-dist ((this los-dist)) +(defmethod inspect ((this los-dist)) (format #t "[~8x] ~A~%" this 'los-dist) (format #t "~Tpar-dist: ~f~%" (-> this par-dist)) (format #t "~Tlat-dist: ~f~%" (-> this lat-dist)) @@ -1337,23 +1325,20 @@ ;; definition of type collide-los-dist-info (deftype collide-los-dist-info (structure) - ((min-par float :offset-assert 0) - (max-par float :offset-assert 4) - (min-lat float :offset-assert 8) - (max-lat float :offset-assert 12) - (min-vp float :offset-assert 16) - (max-vp float :offset-assert 20) - (min-vn float :offset-assert 24) - (max-vn float :offset-assert 28) - (count int32 :offset-assert 32) + ((min-par float) + (max-par float) + (min-lat float) + (max-lat float) + (min-vp float) + (max-vp float) + (min-vn float) + (max-vn float) + (count int32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type collide-los-dist-info -(defmethod inspect collide-los-dist-info ((this collide-los-dist-info)) +(defmethod inspect ((this collide-los-dist-info)) (format #t "[~8x] ~A~%" this 'collide-los-dist-info) (format #t "~Tmin-par: ~f~%" (-> this min-par)) (format #t "~Tmax-par: ~f~%" (-> this max-par)) @@ -1474,19 +1459,16 @@ ;; definition of type collide-los-result (deftype collide-los-result (structure) - ((lateral vector :inline :offset-assert 0) - (cw collide-los-dist-info :inline :offset-assert 16) - (ccw collide-los-dist-info :inline :offset-assert 64) - (straddle collide-los-dist-info :inline :offset-assert 112) - (lateral-valid symbol :offset-assert 148) + ((lateral vector :inline) + (cw collide-los-dist-info :inline) + (ccw collide-los-dist-info :inline) + (straddle collide-los-dist-info :inline) + (lateral-valid symbol) ) - :method-count-assert 9 - :size-assert #x98 - :flag-assert #x900000098 ) ;; definition for method 3 of type collide-los-result -(defmethod inspect collide-los-result ((this collide-los-result)) +(defmethod inspect ((this collide-los-result)) (format #t "[~8x] ~A~%" this 'collide-los-result) (format #t "~Tlateral: ~`vector`P~%" (-> this lateral)) (format #t "~Tcw: #~%" (-> this cw)) @@ -3013,18 +2995,15 @@ ;; definition of type cam-stick-bank (deftype cam-stick-bank (basic) - ((max-z meters :offset-assert 4) - (min-z meters :offset-assert 8) - (max-y meters :offset-assert 12) - (min-y meters :offset-assert 16) + ((max-z meters) + (min-z meters) + (max-y meters) + (min-y meters) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type cam-stick-bank -(defmethod inspect cam-stick-bank ((this cam-stick-bank)) +(defmethod inspect ((this cam-stick-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tmax-z: (meters ~m)~%" (-> this max-z)) (format #t "~Tmin-z: (meters ~m)~%" (-> this min-z)) @@ -3252,18 +3231,15 @@ ;; definition of type cam-bike-bank (deftype cam-bike-bank (basic) - ((max-z meters :offset-assert 4) - (min-z meters :offset-assert 8) - (max-y meters :offset-assert 12) - (min-y meters :offset-assert 16) + ((max-z meters) + (min-z meters) + (max-y meters) + (min-y meters) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type cam-bike-bank -(defmethod inspect cam-bike-bank ((this cam-bike-bank)) +(defmethod inspect ((this cam-bike-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tmin-z: (meters ~m)~%" (-> this max-z)) (format #t "~Tmax-z: (meters ~m)~%" (-> this min-z)) diff --git a/test/decompiler/reference/jak1/engine/camera/camera-h_REF.gc b/test/decompiler/reference/jak1/engine/camera/camera-h_REF.gc index 33eb8a33c12..b5b02a01cfc 100644 --- a/test/decompiler/reference/jak1/engine/camera/camera-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/camera-h_REF.gc @@ -3,24 +3,21 @@ ;; definition of type camera-bank (deftype camera-bank (basic) - ((collide-move-rad float :offset-assert 4) - (joypad uint32 :offset-assert 8) - (min-detectable-velocity float :offset-assert 12) - (attack-timeout time-frame :offset-assert 16) - (default-string-max-y meters :offset-assert 24) - (default-string-min-y meters :offset-assert 28) - (default-string-max-z meters :offset-assert 32) - (default-string-min-z meters :offset-assert 36) - (default-string-push-z meters :offset-assert 40) - (default-tilt-adjust degrees :offset-assert 44) + ((collide-move-rad float) + (joypad uint32) + (min-detectable-velocity float) + (attack-timeout time-frame) + (default-string-max-y meters) + (default-string-min-y meters) + (default-string-max-z meters) + (default-string-min-z meters) + (default-string-push-z meters) + (default-tilt-adjust degrees) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type camera-bank -(defmethod inspect camera-bank ((this camera-bank)) +(defmethod inspect ((this camera-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tcollide-move-rad: ~f~%" (-> this collide-move-rad)) (format #t "~Tjoypad: ~D~%" (-> this joypad)) @@ -51,20 +48,17 @@ ;; definition of type cam-index (deftype cam-index (structure) - ((flags cam-index-options :offset-assert 0) - (vec vector 2 :inline :offset 16) + ((flags cam-index-options) + (vec vector 2 :inline :offset 16) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (cam-index-method-9 (_type_ symbol entity vector curve) symbol 9) - (cam-index-method-10 (_type_ vector) float 10) + (cam-index-method-9 (_type_ symbol entity vector curve) symbol) + (cam-index-method-10 (_type_ vector) float) ) ) ;; definition for method 3 of type cam-index -(defmethod inspect cam-index ((this cam-index)) +(defmethod inspect ((this cam-index)) (format #t "[~8x] ~A~%" this 'cam-index) (format #t "~Tflags: ~D~%" (-> this flags)) (format #t "~Tvec[2] @ #x~X~%" (-> this vec)) @@ -73,19 +67,16 @@ ;; definition of type tracking-point (deftype tracking-point (structure) - ((position vector :inline :offset-assert 0) - (direction vector :inline :offset-assert 16) - (tp-length float :offset-assert 32) - (next int32 :offset-assert 36) - (incarnation int32 :offset-assert 40) + ((position vector :inline) + (direction vector :inline) + (tp-length float) + (next int32) + (incarnation int32) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type tracking-point -(defmethod inspect tracking-point ((this tracking-point)) +(defmethod inspect ((this tracking-point)) (format #t "[~8x] ~A~%" this 'tracking-point) (format #t "~Tposition: #~%" (-> this position)) (format #t "~Tdirection: #~%" (-> this direction)) @@ -97,16 +88,13 @@ ;; definition of type tracking-spline-sampler (deftype tracking-spline-sampler (structure) - ((cur-pt int32 :offset-assert 0) - (partial-pt float :offset-assert 4) + ((cur-pt int32) + (partial-pt float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type tracking-spline-sampler -(defmethod inspect tracking-spline-sampler ((this tracking-spline-sampler)) +(defmethod inspect ((this tracking-spline-sampler)) (format #t "[~8x] ~A~%" this 'tracking-spline-sampler) (format #t "~Tcur-pt: ~D~%" (-> this cur-pt)) (format #t "~Tpartial-pt: ~f~%" (-> this partial-pt)) @@ -115,45 +103,42 @@ ;; definition of type tracking-spline (deftype tracking-spline (structure) - ((point tracking-point 32 :inline :offset-assert 0) - (summed-len float :offset-assert 1536) - (free-point int32 :offset-assert 1540) - (used-point int32 :offset-assert 1544) - (partial-point float :offset-assert 1548) - (end-point int32 :offset-assert 1552) - (next-to-last-point int32 :offset-assert 1556) - (max-move float :offset-assert 1560) - (sample-len float :offset-assert 1564) - (used-count int32 :offset-assert 1568) - (old-position vector :inline :offset-assert 1584) - (debug-old-position vector :inline :offset-assert 1600) - (debug-out-position vector :inline :offset-assert 1616) - (debug-last-point int32 :offset-assert 1632) + ((point tracking-point 32 :inline) + (summed-len float) + (free-point int32) + (used-point int32) + (partial-point float) + (end-point int32) + (next-to-last-point int32) + (max-move float) + (sample-len float) + (used-count int32) + (old-position vector :inline) + (debug-old-position vector :inline) + (debug-out-position vector :inline) + (debug-last-point int32) ) - :method-count-assert 24 - :size-assert #x664 - :flag-assert #x1800000664 (:methods - (tracking-spline-method-9 (_type_) none 9) - (tracking-spline-method-10 (_type_ vector) none 10) - (print-nth-point (_type_ int) none 11) - (tracking-spline-method-12 (_type_) none 12) - (tracking-spline-method-13 (_type_ int) none 13) - (tracking-spline-method-14 (_type_ tracking-spline-sampler) none 14) - (tracking-spline-method-15 (_type_) none 15) - (tracking-spline-method-16 (_type_ float) none 16) - (tracking-spline-method-17 (_type_ vector float float symbol) int 17) - (tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector 18) - (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector 19) - (tracking-spline-method-20 (_type_ vector int) none 20) - (tracking-spline-method-21 (_type_ vector float float) vector 21) - (tracking-spline-method-22 (_type_ float) none 22) - (tracking-spline-method-23 (_type_) none 23) + (tracking-spline-method-9 (_type_) none) + (tracking-spline-method-10 (_type_ vector) none) + (print-nth-point (_type_ int) none) + (tracking-spline-method-12 (_type_) none) + (tracking-spline-method-13 (_type_ int) none) + (tracking-spline-method-14 (_type_ tracking-spline-sampler) none) + (tracking-spline-method-15 (_type_) none) + (tracking-spline-method-16 (_type_ float) none) + (tracking-spline-method-17 (_type_ vector float float symbol) int) + (tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector) + (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector) + (tracking-spline-method-20 (_type_ vector int) none) + (tracking-spline-method-21 (_type_ vector float float) vector) + (tracking-spline-method-22 (_type_ float) none) + (tracking-spline-method-23 (_type_) none) ) ) ;; definition for method 3 of type tracking-spline -(defmethod inspect tracking-spline ((this tracking-spline)) +(defmethod inspect ((this tracking-spline)) (format #t "[~8x] ~A~%" this 'tracking-spline) (format #t "~Tpoint[32] @ #x~X~%" (-> this point)) (format #t "~Tsummed-len: ~f~%" (-> this summed-len)) @@ -174,27 +159,24 @@ ;; definition of type cam-float-seeker (deftype cam-float-seeker (structure) - ((target float :offset-assert 0) - (value float :offset-assert 4) - (vel float :offset-assert 8) - (accel float :offset-assert 12) - (max-vel float :offset-assert 16) - (max-partial float :offset-assert 20) + ((target float) + (value float) + (vel float) + (accel float) + (max-vel float) + (max-partial float) ) :pack-me - :method-count-assert 13 - :size-assert #x18 - :flag-assert #xd00000018 (:methods - (init-cam-float-seeker (_type_ float float float float) none 9) - (copy-cam-float-seeker (_type_ _type_) none 10) - (update! (_type_ float) none 11) - (jump-to-target! (_type_ float) float 12) + (init-cam-float-seeker (_type_ float float float float) none) + (copy-cam-float-seeker (_type_ _type_) none) + (update! (_type_ float) none) + (jump-to-target! (_type_ float) float) ) ) ;; definition for method 3 of type cam-float-seeker -(defmethod inspect cam-float-seeker ((this cam-float-seeker)) +(defmethod inspect ((this cam-float-seeker)) (format #t "[~8x] ~A~%" this 'cam-float-seeker) (format #t "~Ttarget: ~f~%" (-> this target)) (format #t "~Tvalue: ~f~%" (-> this value)) @@ -207,7 +189,7 @@ ;; definition for method 9 of type cam-float-seeker ;; INFO: Return type mismatch int vs none. -(defmethod init-cam-float-seeker cam-float-seeker ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init-cam-float-seeker ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (set! (-> this target) arg0) (set! (-> this value) arg0) (set! (-> this vel) 0.0) @@ -220,7 +202,7 @@ ;; definition for method 10 of type cam-float-seeker ;; INFO: Return type mismatch int vs none. -(defmethod copy-cam-float-seeker cam-float-seeker ((this cam-float-seeker) (arg0 cam-float-seeker)) +(defmethod copy-cam-float-seeker ((this cam-float-seeker) (arg0 cam-float-seeker)) (set! (-> this target) (-> arg0 target)) (set! (-> this value) (-> arg0 value)) (set! (-> this vel) (-> arg0 vel)) @@ -233,7 +215,7 @@ ;; definition for method 11 of type cam-float-seeker ;; INFO: Return type mismatch int vs none. -(defmethod update! cam-float-seeker ((this cam-float-seeker) (offset float)) +(defmethod update! ((this cam-float-seeker) (offset float)) 0.0 0.0 (let* ((pos-error (- (+ (-> this target) offset) (-> this value))) @@ -258,31 +240,28 @@ ) ;; definition for method 12 of type cam-float-seeker -(defmethod jump-to-target! cam-float-seeker ((this cam-float-seeker) (arg0 float)) +(defmethod jump-to-target! ((this cam-float-seeker) (arg0 float)) (set! (-> this value) (+ (-> this target) arg0)) (set! (-> this vel) 0.0) ) ;; definition of type cam-vector-seeker (deftype cam-vector-seeker (structure) - ((target vector :inline :offset-assert 0) - (value vector :inline :offset-assert 16) - (vel vector :inline :offset-assert 32) - (accel float :offset-assert 48) - (max-vel float :offset-assert 52) - (max-partial float :offset-assert 56) + ((target vector :inline) + (value vector :inline) + (vel vector :inline) + (accel float) + (max-vel float) + (max-partial float) ) - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (init! (_type_ vector float float float) none 9) - (update! (_type_ vector) none 10) + (init! (_type_ vector float float float) none) + (update! (_type_ vector) none) ) ) ;; definition for method 3 of type cam-vector-seeker -(defmethod inspect cam-vector-seeker ((this cam-vector-seeker)) +(defmethod inspect ((this cam-vector-seeker)) (format #t "[~8x] ~A~%" this 'cam-vector-seeker) (format #t "~Ttarget: #~%" (-> this target)) (format #t "~Tvalue: #~%" (-> this value)) @@ -296,7 +275,7 @@ ;; definition for method 9 of type cam-vector-seeker ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod init! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init! ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 (set! (-> this target quad) (-> arg0 quad)) @@ -317,7 +296,7 @@ ;; definition for method 10 of type cam-vector-seeker ;; INFO: Return type mismatch int vs none. -(defmethod update! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector)) +(defmethod update! ((this cam-vector-seeker) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) 0.0 (cond @@ -349,24 +328,21 @@ ;; definition of type cam-rotation-tracker (deftype cam-rotation-tracker (structure) - ((inv-mat matrix :inline :offset-assert 0) - (no-follow basic :offset-assert 64) - (follow-pt vector :inline :offset-assert 80) - (follow-off vector :inline :offset-assert 96) - (follow-blend float :offset-assert 112) - (tilt-adjust cam-float-seeker :inline :offset-assert 116) - (use-point-of-interest basic :offset-assert 140) - (point-of-interest vector :inline :offset-assert 144) - (point-of-interest-blend cam-float-seeker :inline :offset-assert 160) - (underwater-blend cam-float-seeker :inline :offset-assert 184) + ((inv-mat matrix :inline) + (no-follow basic) + (follow-pt vector :inline) + (follow-off vector :inline) + (follow-blend float) + (tilt-adjust cam-float-seeker :inline) + (use-point-of-interest basic) + (point-of-interest vector :inline) + (point-of-interest-blend cam-float-seeker :inline) + (underwater-blend cam-float-seeker :inline) ) - :method-count-assert 9 - :size-assert #xd0 - :flag-assert #x9000000d0 ) ;; definition for method 3 of type cam-rotation-tracker -(defmethod inspect cam-rotation-tracker ((this cam-rotation-tracker)) +(defmethod inspect ((this cam-rotation-tracker)) (format #t "[~8x] ~A~%" this 'cam-rotation-tracker) (format #t "~Tinv-mat: ~`matrix`P~%" (-> this inv-mat)) (format #t "~Tno-follow: ~A~%" (-> this no-follow)) @@ -383,30 +359,26 @@ ;; definition of type camera-combiner (deftype camera-combiner (process) - ((trans vector :inline :offset-assert 112) - (inv-camera-rot matrix :inline :offset-assert 128) - (fov float :offset-assert 192) - (interp-val float :offset-assert 196) - (interp-step float :offset-assert 200) - (dist-from-src float :offset-assert 204) - (dist-from-dest float :offset-assert 208) - (flip-control-axis vector :inline :offset-assert 224) - (velocity vector :inline :offset-assert 240) - (tracking-status uint64 :offset-assert 256) - (tracking-options int32 :offset-assert 264) - (tracking cam-rotation-tracker :inline :offset-assert 272) + ((trans vector :inline) + (inv-camera-rot matrix :inline) + (fov float) + (interp-val float) + (interp-step float) + (dist-from-src float) + (dist-from-dest float) + (flip-control-axis vector :inline) + (velocity vector :inline) + (tracking-status uint64) + (tracking-options int32) + (tracking cam-rotation-tracker :inline) ) - :heap-base #x170 - :method-count-assert 14 - :size-assert #x1e0 - :flag-assert #xe017001e0 (:states cam-combiner-active ) ) ;; definition for method 3 of type camera-combiner -(defmethod inspect camera-combiner ((this camera-combiner)) +(defmethod inspect ((this camera-combiner)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -427,62 +399,58 @@ ;; definition of type camera-slave (deftype camera-slave (process) - ((trans vector :inline :offset-assert 112) - (fov float :offset-assert 128) - (fov0 float :offset-assert 132) - (fov1 float :offset-assert 136) - (fov-index cam-index :inline :offset-assert 144) - (tracking cam-rotation-tracker :inline :offset-assert 192) - (view-off-param float :offset-assert 400) - (unknown-symbol symbol :offset 412) - (view-off vector :inline :offset-assert 416) - (min-z-override float :offset-assert 432) - (view-flat vector :inline :offset-assert 448) - (string-vel-dir uint32 :offset-assert 464) - (string-trans vector :inline :offset-assert 480) - (position-spline tracking-spline :inline :offset-assert 496) - (pivot-pt vector :inline :offset-assert 2144) - (pivot-rad float :offset-assert 2160) - (circular-follow vector :inline :offset-assert 2176) - (max-angle-offset float :offset-assert 2192) - (max-angle-curr float :offset-assert 2196) - (options uint32 :offset-assert 2200) - (cam-entity entity :offset-assert 2204) - (velocity vector :inline :offset-assert 2208) - (desired-pos vector :inline :offset-assert 2224) - (time-dist-too-far uint32 :offset-assert 2240) - (los-state slave-los-state :offset-assert 2244) - (good-point vector :inline :offset-assert 2256) - (los-tgt-spline-pt int32 :offset-assert 2272) - (los-tgt-spline-pt-incarnation int32 :offset-assert 2276) - (los-last-pos vector :inline :offset-assert 2288) - (intro-curve curve :inline :offset-assert 2304) - (intro-offset vector :inline :offset-assert 2336) - (intro-t float :offset-assert 2352) - (intro-t-step float :offset-assert 2356) - (outro-exit-value float :offset-assert 2360) - (spline-exists basic :offset-assert 2364) - (spline-curve curve :inline :offset-assert 2368) - (spline-offset vector :inline :offset-assert 2400) - (index cam-index :inline :offset-assert 2416) - (saved-pt vector :inline :offset-assert 2464) - (spline-tt float :offset-assert 2480) - (spline-follow-dist float :offset-assert 2484) - (change-event-from (pointer process-drawable) :offset-assert 2488) - (enter-has-run symbol :offset-assert 2492) - (blend-from-type uint64 :offset-assert 2496) - (blend-to-type uint64 :offset-assert 2504) - (have-phony-joystick basic :offset-assert 2512) - (phony-joystick-x float :offset-assert 2516) - (phony-joystick-y float :offset-assert 2520) - (string-min-val vector :inline :offset-assert 2528) - (string-max-val vector :inline :offset-assert 2544) - (string-val-locked basic :offset-assert 2560) + ((trans vector :inline) + (fov float) + (fov0 float) + (fov1 float) + (fov-index cam-index :inline) + (tracking cam-rotation-tracker :inline) + (view-off-param float) + (unknown-symbol symbol :offset 412) + (view-off vector :inline) + (min-z-override float) + (view-flat vector :inline) + (string-vel-dir uint32) + (string-trans vector :inline) + (position-spline tracking-spline :inline) + (pivot-pt vector :inline) + (pivot-rad float) + (circular-follow vector :inline) + (max-angle-offset float) + (max-angle-curr float) + (options uint32) + (cam-entity entity) + (velocity vector :inline) + (desired-pos vector :inline) + (time-dist-too-far uint32) + (los-state slave-los-state) + (good-point vector :inline) + (los-tgt-spline-pt int32) + (los-tgt-spline-pt-incarnation int32) + (los-last-pos vector :inline) + (intro-curve curve :inline) + (intro-offset vector :inline) + (intro-t float) + (intro-t-step float) + (outro-exit-value float) + (spline-exists basic) + (spline-curve curve :inline) + (spline-offset vector :inline) + (index cam-index :inline) + (saved-pt vector :inline) + (spline-tt float) + (spline-follow-dist float) + (change-event-from (pointer process-drawable)) + (enter-has-run symbol) + (blend-from-type uint64) + (blend-to-type uint64) + (have-phony-joystick basic) + (phony-joystick-x float) + (phony-joystick-y float) + (string-min-val vector :inline) + (string-max-val vector :inline) + (string-val-locked basic) ) - :heap-base #x9a0 - :method-count-assert 14 - :size-assert #xa04 - :flag-assert #xe09a00a04 (:states *camera-base-mode* cam-bike @@ -514,7 +482,7 @@ ) ;; definition for method 3 of type camera-slave -(defmethod inspect camera-slave ((this camera-slave)) +(defmethod inspect ((this camera-slave)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -573,64 +541,60 @@ ;; definition of type camera-master (deftype camera-master (process) - ((master-options uint32 :offset-assert 112) - (num-slaves int32 :offset-assert 116) - (slave (pointer camera-slave) 2 :offset-assert 120) - (slave-options uint32 :offset-assert 128) - (view-off-param-save float :offset-assert 132) - (changer uint32 :offset-assert 136) - (cam-entity entity :offset-assert 140) - (stringMinLength float :offset-assert 144) - (stringMaxLength float :offset-assert 148) - (stringMinHeight float :offset-assert 152) - (stringMaxHeight float :offset-assert 156) - (string-min cam-vector-seeker :inline :offset-assert 160) - (string-max cam-vector-seeker :inline :offset-assert 224) - (string-push-z float :offset-assert 284) - (stringCliffHeight float :offset-assert 288) - (no-intro uint32 :offset-assert 292) - (force-blend uint32 :offset-assert 296) - (force-blend-time uint32 :offset-assert 300) - (local-down vector :inline :offset-assert 304) - (drawable-target handle :offset-assert 320) - (which-bone int32 :offset-assert 328) - (pov-handle handle :offset-assert 336) - (pov-bone int32 :offset-assert 344) - (being-attacked symbol :offset-assert 348) - (attack-start time-frame :offset-assert 352) - (on-ground symbol :offset-assert 360) - (under-water int32 :offset-assert 364) - (on-pole symbol :offset-assert 368) - (tgt-rot-mat matrix :inline :offset-assert 384) - (tgt-face-mat matrix :inline :offset-assert 448) - (tpos-old vector :inline :offset-assert 512) - (tpos-curr vector :inline :offset-assert 528) - (target-height float :offset-assert 544) - (tpos-old-adj vector :inline :offset-assert 560) - (tpos-curr-adj vector :inline :offset-assert 576) - (tpos-tgt vector :inline :offset-assert 592) - (upspeed float :offset-assert 608) - (pitch-off vector :inline :offset-assert 624) - (foot-offset float :offset-assert 640) - (head-offset float :offset-assert 644) - (target-spline tracking-spline :inline :offset-assert 656) - (ease-from vector :inline :offset-assert 2304) - (ease-t float :offset-assert 2320) - (ease-step float :offset-assert 2324) - (ease-to vector :inline :offset-assert 2336) - (outro-curve curve :inline :offset-assert 2352) - (outro-t float :offset-assert 2372) - (outro-t-step float :offset-assert 2376) - (outro-exit-value float :offset-assert 2380) - (water-drip-time time-frame :offset-assert 2384) - (water-drip sparticle-launch-control :offset-assert 2392) - (water-drip-mult float :offset-assert 2396) - (water-drip-speed float :offset-assert 2400) + ((master-options uint32) + (num-slaves int32) + (slave (pointer camera-slave) 2) + (slave-options uint32) + (view-off-param-save float) + (changer uint32) + (cam-entity entity) + (stringMinLength float) + (stringMaxLength float) + (stringMinHeight float) + (stringMaxHeight float) + (string-min cam-vector-seeker :inline) + (string-max cam-vector-seeker :inline) + (string-push-z float) + (stringCliffHeight float) + (no-intro uint32) + (force-blend uint32) + (force-blend-time uint32) + (local-down vector :inline) + (drawable-target handle) + (which-bone int32) + (pov-handle handle) + (pov-bone int32) + (being-attacked symbol) + (attack-start time-frame) + (on-ground symbol) + (under-water int32) + (on-pole symbol) + (tgt-rot-mat matrix :inline) + (tgt-face-mat matrix :inline) + (tpos-old vector :inline) + (tpos-curr vector :inline) + (target-height float) + (tpos-old-adj vector :inline) + (tpos-curr-adj vector :inline) + (tpos-tgt vector :inline) + (upspeed float) + (pitch-off vector :inline) + (foot-offset float) + (head-offset float) + (target-spline tracking-spline :inline) + (ease-from vector :inline) + (ease-t float) + (ease-step float) + (ease-to vector :inline) + (outro-curve curve :inline) + (outro-t float) + (outro-t-step float) + (outro-exit-value float) + (water-drip-time time-frame) + (water-drip sparticle-launch-control) + (water-drip-mult float) + (water-drip-speed float) ) - :heap-base #x900 - :method-count-assert 14 - :size-assert #x964 - :flag-assert #xe09000964 (:states cam-master-active list-keeper-active @@ -638,7 +602,7 @@ ) ;; definition for method 3 of type camera-master -(defmethod inspect camera-master ((this camera-master)) +(defmethod inspect ((this camera-master)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/engine/camera/camera_REF.gc b/test/decompiler/reference/jak1/engine/camera/camera_REF.gc index 1a751876416..6cfb68ceedb 100644 --- a/test/decompiler/reference/jak1/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/camera_REF.gc @@ -357,7 +357,7 @@ ;; definition for method 9 of type cam-index ;; INFO: Used lq/sq -(defmethod cam-index-method-9 cam-index ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) +(defmethod cam-index-method-9 ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) (local-vars (sv-32 (function _varargs_ object))) (format (clear *cam-res-string*) "~S-flags" arg0) (set! (-> this flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *res-key-string*)))) @@ -435,7 +435,7 @@ ;; definition for method 10 of type cam-index ;; INFO: Used lq/sq -(defmethod cam-index-method-10 cam-index ((this cam-index) (arg0 vector)) +(defmethod cam-index-method-10 ((this cam-index) (arg0 vector)) (let ((s5-0 (new-stack-vector0))) 0.0 (vector-! s5-0 arg0 (the-as vector (-> this vec))) @@ -457,7 +457,7 @@ ;; definition for method 10 of type tracking-spline ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-10 tracking-spline ((this tracking-spline) (arg0 vector)) +(defmethod tracking-spline-method-10 ((this tracking-spline) (arg0 vector)) (set! (-> this point 0 position quad) (-> arg0 quad)) (set! (-> this point 0 next) -134250495) (set! (-> this summed-len) 0.0) @@ -483,7 +483,7 @@ ;; definition for method 13 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-13 tracking-spline ((this tracking-spline) (arg0 int)) +(defmethod tracking-spline-method-13 ((this tracking-spline) (arg0 int)) (let ((v1-3 (-> this point arg0 next))) (cond ((= v1-3 -134250495) @@ -518,7 +518,7 @@ ;; definition for method 14 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-14 tracking-spline ((this tracking-spline) (arg0 tracking-spline-sampler)) +(defmethod tracking-spline-method-14 ((this tracking-spline) (arg0 tracking-spline-sampler)) (let ((v1-0 (-> this used-point))) (set! (-> this partial-point) (-> arg0 partial-pt)) (when (= (-> this next-to-last-point) v1-0) @@ -559,7 +559,7 @@ ;; definition for method 15 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-15 tracking-spline ((this tracking-spline)) +(defmethod tracking-spline-method-15 ((this tracking-spline)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'tracking-point))) (set! (-> s5-0 cur-pt) (-> this used-point)) @@ -607,7 +607,7 @@ ;; definition for method 16 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-16 tracking-spline ((this tracking-spline) (arg0 float)) +(defmethod tracking-spline-method-16 ((this tracking-spline) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 cur-pt) (-> this used-point)) @@ -647,7 +647,7 @@ ;; definition for method 17 of type tracking-spline ;; INFO: Used lq/sq -(defmethod tracking-spline-method-17 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) +(defmethod tracking-spline-method-17 ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) (let ((s3-0 (-> this free-point)) (s2-0 (-> this end-point)) ) @@ -689,7 +689,7 @@ ) ;; definition for method 18 of type tracking-spline -(defmethod tracking-spline-method-18 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-18 ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (local-vars (f0-4 float)) (when (not arg2) (set! arg2 (new 'stack-no-clear 'tracking-spline-sampler)) @@ -732,7 +732,7 @@ ) ;; definition for method 19 of type tracking-spline -(defmethod tracking-spline-method-19 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-19 ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (vector-reset! arg1) (tracking-spline-method-18 this arg0 arg1 arg2) arg1 @@ -740,7 +740,7 @@ ;; definition for method 20 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-20 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 int)) +(defmethod tracking-spline-method-20 ((this tracking-spline) (arg0 vector) (arg1 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-! s3-0 @@ -830,7 +830,7 @@ ;; definition for method 21 of type tracking-spline ;; INFO: Used lq/sq -(defmethod tracking-spline-method-21 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod tracking-spline-method-21 ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float)) (let ((v1-0 (-> this used-point)) (f0-0 (-> this partial-point)) ) @@ -880,7 +880,7 @@ ;; definition for method 22 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-22 tracking-spline ((this tracking-spline) (arg0 float)) +(defmethod tracking-spline-method-22 ((this tracking-spline) (arg0 float)) (when (< arg0 (-> this summed-len)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) @@ -897,7 +897,7 @@ ;; definition for method 9 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-9 tracking-spline ((this tracking-spline)) +(defmethod tracking-spline-method-9 ((this tracking-spline)) (let ((v1-0 (-> this used-point)) (s4-0 0) (s5-0 0) diff --git a/test/decompiler/reference/jak1/engine/camera/pov-camera-h_REF.gc b/test/decompiler/reference/jak1/engine/camera/pov-camera-h_REF.gc index f21e2492900..f5d5c2252a9 100644 --- a/test/decompiler/reference/jak1/engine/camera/pov-camera-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/pov-camera-h_REF.gc @@ -3,36 +3,34 @@ ;; definition of type pov-camera (deftype pov-camera (process-drawable) - ((cspace-array cspace-array :offset 112) - (flags pov-camera-flag :offset-assert 176) - (debounce-start-time time-frame :offset-assert 184) - (notify-handle handle :offset-assert 192) - (anim-name string :offset-assert 200) - (command-list pair :offset-assert 204) - (mask-to-clear process-mask :offset-assert 208) - (music-volume-movie float :offset-assert 212) - (sfx-volume-movie float :offset-assert 216) + ((cspace-array cspace-array :overlay-at root) + (flags pov-camera-flag) + (debounce-start-time time-frame) + (notify-handle handle) + (anim-name string) + (command-list pair) + (mask-to-clear process-mask) + (music-volume-movie float) + (sfx-volume-movie float) ) - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc + (:state-methods + pov-camera-abort + pov-camera-done-playing + pov-camera-playing + pov-camera-start-playing + pov-camera-startup + ) (:methods - (pov-camera-abort () _type_ :state 20) - (pov-camera-done-playing () _type_ :state 21) - (pov-camera-playing () _type_ :state 22) - (pov-camera-start-playing () _type_ :state 23) - (pov-camera-startup () _type_ :state 24) - (check-for-abort (_type_) symbol 25) - (target-grabbed? (_type_) symbol 26) - (pre-startup-callback (_type_) none 27) - (target-released? () symbol 28) - (set-stack-size! (_type_) none 29) + (check-for-abort (_type_) symbol) + (target-grabbed? (_type_) symbol) + (pre-startup-callback (_type_) none) + (target-released? (_type_) symbol) + (set-stack-size! (_type_) none) ) ) ;; definition for method 3 of type pov-camera -(defmethod inspect pov-camera ((this pov-camera)) +(defmethod inspect ((this pov-camera)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/engine/camera/pov-camera_REF.gc b/test/decompiler/reference/jak1/engine/camera/pov-camera_REF.gc index 5f2ce1bfd2e..0eb7ffe065a 100644 --- a/test/decompiler/reference/jak1/engine/camera/pov-camera_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/pov-camera_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 25 of type pov-camera -(defmethod check-for-abort pov-camera ((this pov-camera)) +(defmethod check-for-abort ((this pov-camera)) (when (or (and (time-elapsed? (-> this debounce-start-time) (seconds 0.2)) (cpad-pressed? 0 triangle)) (logtest? (-> this flags) (pov-camera-flag allow-abort)) ) @@ -16,12 +16,12 @@ ) ;; definition for method 26 of type pov-camera -(defmethod target-grabbed? pov-camera ((this pov-camera)) +(defmethod target-grabbed? ((this pov-camera)) (or (not *target*) (process-grab? *target*)) ) ;; definition for method 28 of type pov-camera -(defmethod target-released? pov-camera () +(defmethod target-released? ((this pov-camera)) (or (not *target*) (process-release? *target*)) ) @@ -152,7 +152,7 @@ (defstate pov-camera-done-playing (pov-camera) :virtual #t :code (behavior () - (while (begin self (not ((method-of-object self target-released?)))) + (while (not (target-released? self)) (suspend) ) (send-event (handle->process (-> self notify-handle)) 'notify 'die) @@ -165,14 +165,14 @@ ;; definition for method 27 of type pov-camera ;; INFO: Return type mismatch int vs none. -(defmethod pre-startup-callback pov-camera ((this pov-camera)) +(defmethod pre-startup-callback ((this pov-camera)) 0 (none) ) ;; definition for method 29 of type pov-camera ;; INFO: Return type mismatch symbol vs none. -(defmethod set-stack-size! pov-camera ((this pov-camera)) +(defmethod set-stack-size! ((this pov-camera)) (none) ) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-cache-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-cache-h_REF.gc index fd733d9b287..b06a2b1d852 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-cache-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-cache-h_REF.gc @@ -3,20 +3,17 @@ ;; definition of type collide-using-spheres-params (deftype collide-using-spheres-params (structure) - ((spheres (inline-array sphere) :offset-assert 0) - (num-spheres uint32 :offset-assert 4) - (collide-with collide-kind :offset-assert 8) - (proc process-drawable :offset-assert 16) - (ignore-pat pat-surface :offset-assert 20) - (solid-only basic :offset-assert 24) + ((spheres (inline-array sphere)) + (num-spheres uint32) + (collide-with collide-kind) + (proc process-drawable) + (ignore-pat pat-surface) + (solid-only basic) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type collide-using-spheres-params -(defmethod inspect collide-using-spheres-params ((this collide-using-spheres-params)) +(defmethod inspect ((this collide-using-spheres-params)) (format #t "[~8x] ~A~%" this 'collide-using-spheres-params) (format #t "~Tspheres: #x~X~%" (-> this spheres)) (format #t "~Tnum-spheres: ~D~%" (-> this num-spheres)) @@ -29,16 +26,13 @@ ;; definition of type collide-puss-sphere (deftype collide-puss-sphere (structure) - ((bsphere sphere :inline :offset-assert 0) - (bbox4w bounding-box4w :inline :offset-assert 16) + ((bsphere sphere :inline) + (bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type collide-puss-sphere -(defmethod inspect collide-puss-sphere ((this collide-puss-sphere)) +(defmethod inspect ((this collide-puss-sphere)) (format #t "[~8x] ~A~%" this 'collide-puss-sphere) (format #t "~Tbsphere: #~%" (-> this bsphere)) (format #t "~Tbbox4w: #~%" (-> this bbox4w)) @@ -47,23 +41,20 @@ ;; definition of type collide-puss-work (deftype collide-puss-work (structure) - ((closest-pt vector :inline :offset-assert 0) - (tri-normal vector :inline :offset-assert 16) - (tri-bbox4w bounding-box4w :inline :offset-assert 32) - (spheres-bbox4w bounding-box4w :inline :offset-assert 64) - (spheres collide-puss-sphere 64 :inline :offset-assert 96) + ((closest-pt vector :inline) + (tri-normal vector :inline) + (tri-bbox4w bounding-box4w :inline) + (spheres-bbox4w bounding-box4w :inline) + (spheres collide-puss-sphere 64 :inline) ) - :method-count-assert 11 - :size-assert #xc60 - :flag-assert #xb00000c60 (:methods - (collide-puss-work-method-9 (_type_ object object) symbol 9) - (collide-puss-work-method-10 (_type_ object object) symbol 10) + (collide-puss-work-method-9 (_type_ object object) symbol) + (collide-puss-work-method-10 (_type_ object object) symbol) ) ) ;; definition for method 3 of type collide-puss-work -(defmethod inspect collide-puss-work ((this collide-puss-work)) +(defmethod inspect ((this collide-puss-work)) (format #t "[~8x] ~A~%" this 'collide-puss-work) (format #t "~Tclosest-pt: #~%" (-> this closest-pt)) (format #t "~Ttri-normal: #~%" (-> this tri-normal)) @@ -75,19 +66,16 @@ ;; definition of type collide-puyp-work (deftype collide-puyp-work (structure) - ((best-u float :offset-assert 0) - (ignore-pat pat-surface :offset-assert 4) - (tri-out collide-tri-result :offset-assert 8) - (start-pos vector :inline :offset-assert 16) - (move-dist vector :inline :offset-assert 32) + ((best-u float) + (ignore-pat pat-surface) + (tri-out collide-tri-result) + (start-pos vector :inline) + (move-dist vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type collide-puyp-work -(defmethod inspect collide-puyp-work ((this collide-puyp-work)) +(defmethod inspect ((this collide-puyp-work)) (format #t "[~8x] ~A~%" this 'collide-puyp-work) (format #t "~Tbest-u: ~f~%" (-> this best-u)) (format #t "~Tignore-pat: ~D~%" (-> this ignore-pat)) @@ -99,20 +87,17 @@ ;; definition of type collide-cache-tri (deftype collide-cache-tri (structure) - ((vertex vector 3 :inline :offset-assert 0) - (extra-quad uint128 :offset 48) - (pat pat-surface :offset 48) - (prim-index uint16 :offset 52) - (user16 uint16 :offset 54) - (user32 uint32 2 :offset 56) + ((vertex vector 3 :inline) + (extra-quad uint128 :offset 48) + (pat pat-surface :overlay-at extra-quad) + (prim-index uint16 :offset 52) + (user16 uint16 :offset 54) + (user32 uint32 2 :offset 56) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type collide-cache-tri -(defmethod inspect collide-cache-tri ((this collide-cache-tri)) +(defmethod inspect ((this collide-cache-tri)) (format #t "[~8x] ~A~%" this 'collide-cache-tri) (format #t "~Tvertex[3] @ #x~X~%" (-> this vertex)) (format #t "~Textra-quad[16] @ #x~X~%" (&-> this extra-quad)) @@ -125,30 +110,27 @@ ;; definition of type collide-cache-prim (deftype collide-cache-prim (structure) - ((prim-core collide-prim-core :inline :offset-assert 0) - (extra-quad uint128 :offset-assert 32) - (ccache collide-cache :offset 32) - (prim collide-shape-prim :offset 36) - (first-tri uint16 :offset 40) - (num-tris uint16 :offset 42) - (unused uint8 4 :offset 44) - (world-sphere vector :inline :offset 0) - (collide-as collide-kind :offset 16) - (action collide-action :offset 24) - (offense collide-offense :offset 28) - (prim-type int8 :offset 29) + ((prim-core collide-prim-core :inline) + (extra-quad uint128) + (ccache collide-cache :overlay-at extra-quad) + (prim collide-shape-prim :offset 36) + (first-tri uint16 :offset 40) + (num-tris uint16 :offset 42) + (unused uint8 4 :offset 44) + (world-sphere vector :inline :overlay-at (-> prim-core world-sphere)) + (collide-as collide-kind :overlay-at (-> prim-core collide-as)) + (action collide-action :overlay-at (-> prim-core action)) + (offense collide-offense :overlay-at (-> prim-core offense)) + (prim-type int8 :overlay-at (-> prim-core prim-type)) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float 9) - (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float 10) + (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float) + (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float) ) ) ;; definition for method 3 of type collide-cache-prim -(defmethod inspect collide-cache-prim ((this collide-cache-prim)) +(defmethod inspect ((this collide-cache-prim)) (format #t "[~8x] ~A~%" this 'collide-cache-prim) (format #t "~Tprim-core: #~%" (-> this prim-core)) (format #t "~Textra-quad[16] @ #x~X~%" (&-> this extra-quad)) @@ -167,50 +149,47 @@ ;; definition of type collide-cache (deftype collide-cache (basic) - ((num-tris int32 :offset-assert 4) - (num-prims int32 :offset-assert 8) - (num-prims-u uint32 :offset 8) - (ignore-mask pat-surface :offset-assert 12) - (proc process-drawable :offset-assert 16) - (collide-box bounding-box :inline :offset-assert 32) - (collide-box4w bounding-box4w :inline :offset-assert 64) - (collide-with collide-kind :offset-assert 96) - (prims collide-cache-prim 100 :inline :offset-assert 112) - (tris collide-cache-tri 461 :inline :offset-assert 4912) + ((num-tris int32) + (num-prims int32) + (num-prims-u uint32 :overlay-at num-prims) + (ignore-mask pat-surface) + (proc process-drawable) + (collide-box bounding-box :inline) + (collide-box4w bounding-box4w :inline) + (collide-with collide-kind) + (prims collide-cache-prim 100 :inline) + (tris collide-cache-tri 461 :inline) ) - :method-count-assert 33 - :size-assert #x8670 - :flag-assert #x2100008670 (:methods - (debug-draw (_type_) none 9) - (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float 10) - (fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol 11) - (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float 12) - (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none 13) - (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none 14) - (fill-using-spheres (_type_ collide-using-spheres-params) none 15) - (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none 16) - (initialize (_type_) none 17) - (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float 18) - (probe-using-spheres (_type_ collide-using-spheres-params) symbol 19) - (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20) - (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21) - (fill-from-foreground-using-box (_type_) none 22) - (fill-from-foreground-using-line-sphere (_type_) none 23) - (fill-from-foreground-using-y-probe (_type_) none 24) - (fill-from-water (_type_ water-control) none 25) - (load-mesh-from-spad-in-box (_type_ collide-frag-mesh) none 26) - (collide-cache-method-27 (_type_) none 27) - (collide-cache-method-28 (_type_) none 28) - (collide-cache-method-29 (_type_ collide-frag-mesh) none 29) - (puyp-mesh (_type_ collide-puyp-work collide-cache-prim) none 30) - (puyp-sphere (_type_ collide-puyp-work collide-cache-prim) vector 31) - (unpack-background-collide-mesh (_type_ object object object) none 32) + (debug-draw (_type_) none) + (fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result pat-surface) float) + (fill-and-probe-using-spheres (_type_ collide-using-spheres-params) symbol) + (fill-and-probe-using-y-probe (_type_ vector float collide-kind process-drawable collide-tri-result pat-surface) float) + (fill-using-bounding-box (_type_ bounding-box collide-kind process-drawable pat-surface) none) + (fill-using-line-sphere (_type_ vector vector float collide-kind process-drawable pat-surface) none) + (fill-using-spheres (_type_ collide-using-spheres-params) none) + (fill-using-y-probe (_type_ vector float collide-kind process-drawable pat-surface) none) + (initialize (_type_) none) + (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float) + (probe-using-spheres (_type_ collide-using-spheres-params) symbol) + (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float) + (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none) + (fill-from-foreground-using-box (_type_) none) + (fill-from-foreground-using-line-sphere (_type_) none) + (fill-from-foreground-using-y-probe (_type_) none) + (fill-from-water (_type_ water-control) none) + (load-mesh-from-spad-in-box (_type_ collide-frag-mesh) none) + (collide-cache-method-27 (_type_) none) + (collide-cache-method-28 (_type_) none) + (collide-cache-method-29 (_type_ collide-frag-mesh) none) + (puyp-mesh (_type_ collide-puyp-work collide-cache-prim) none) + (puyp-sphere (_type_ collide-puyp-work collide-cache-prim) vector) + (unpack-background-collide-mesh (_type_ object object object) none) ) ) ;; definition for method 3 of type collide-cache -(defmethod inspect collide-cache ((this collide-cache)) +(defmethod inspect ((this collide-cache)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tnum-tris: ~D~%" (-> this num-tris)) (format #t "~Tnum-prims: ~D~%" (-> this num-prims)) @@ -226,16 +205,13 @@ ;; definition of type collide-list-item (deftype collide-list-item (structure) - ((mesh collide-frag-mesh :offset-assert 0) - (inst basic :offset-assert 4) + ((mesh collide-frag-mesh) + (inst basic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type collide-list-item -(defmethod inspect collide-list-item ((this collide-list-item)) +(defmethod inspect ((this collide-list-item)) (format #t "[~8x] ~A~%" this 'collide-list-item) (format #t "~Tmesh: ~A~%" (-> this mesh)) (format #t "~Tinst: ~A~%" (-> this inst)) @@ -244,16 +220,13 @@ ;; definition of type collide-list (deftype collide-list (structure) - ((num-items int32 :offset-assert 0) - (items collide-list-item 256 :inline :offset-assert 16) + ((num-items int32) + (items collide-list-item 256 :inline) ) - :method-count-assert 9 - :size-assert #x1010 - :flag-assert #x900001010 ) ;; definition for method 3 of type collide-list -(defmethod inspect collide-list ((this collide-list)) +(defmethod inspect ((this collide-list)) (format #t "[~8x] ~A~%" this 'collide-list) (format #t "~Tnum-items: ~D~%" (-> this num-items)) (format #t "~Titems[256] @ #x~X~%" (-> this items)) @@ -262,17 +235,14 @@ ;; definition of type collide-work (deftype collide-work (structure) - ((collide-sphere-neg-r sphere :inline :offset-assert 0) - (collide-box4w bounding-box4w :inline :offset-assert 16) - (inv-mat matrix :inline :offset-assert 48) + ((collide-sphere-neg-r sphere :inline) + (collide-box4w bounding-box4w :inline) + (inv-mat matrix :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type collide-work -(defmethod inspect collide-work ((this collide-work)) +(defmethod inspect ((this collide-work)) (format #t "[~8x] ~A~%" this 'collide-work) (format #t "~Tcollide-sphere-neg-r: #~%" (-> this collide-sphere-neg-r)) (format #t "~Tcollide-box4w: #~%" (-> this collide-box4w)) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-edge-grab-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-edge-grab-h_REF.gc index ce42f52d35d..ce41753081b 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-edge-grab-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-edge-grab-h_REF.gc @@ -3,30 +3,27 @@ ;; definition of type edge-grab-info (deftype edge-grab-info (structure) - ((world-vertex vector 6 :inline :offset-assert 0) - (local-vertex vector 6 :inline :offset-assert 96) - (actor-cshape-prim-offset int32 :offset-assert 192) - (actor-handle handle :offset-assert 200) - (hanging-matrix matrix :inline :offset-assert 208) - (edge-vertex vector 2 :inline :offset 0) - (center-hold vector :inline :offset 32) - (tri-vertex vector 3 :inline :offset 48) - (left-hand-hold vector :inline :offset-assert 272) - (right-hand-hold vector :inline :offset-assert 288) - (center-hold-old vector :inline :offset-assert 304) - (edge-tri-pat uint32 :offset-assert 320) + ((world-vertex vector 6 :inline) + (local-vertex vector 6 :inline) + (actor-cshape-prim-offset int32) + (actor-handle handle) + (hanging-matrix matrix :inline) + (edge-vertex vector 2 :inline :overlay-at (-> world-vertex 0)) + (center-hold vector :inline :overlay-at (-> world-vertex 2)) + (tri-vertex vector 3 :inline :overlay-at (-> world-vertex 3)) + (left-hand-hold vector :inline) + (right-hand-hold vector :inline) + (center-hold-old vector :inline) + (edge-tri-pat uint32) ) - :method-count-assert 11 - :size-assert #x144 - :flag-assert #xb00000144 (:methods - (edge-grab-info-method-9 (_type_) symbol 9) - (debug-draw (_type_) symbol 10) + (edge-grab-info-method-9 (_type_) symbol) + (debug-draw (_type_) symbol) ) ) ;; definition for method 3 of type edge-grab-info -(defmethod inspect edge-grab-info ((this edge-grab-info)) +(defmethod inspect ((this edge-grab-info)) (format #t "[~8x] ~A~%" this 'edge-grab-info) (format #t "~Tworld-vertex[6] @ #x~X~%" (-> this world-vertex)) (format #t "~Tlocal-vertex[6] @ #x~X~%" (-> this local-vertex)) @@ -45,16 +42,13 @@ ;; definition of type collide-edge-tri (deftype collide-edge-tri (structure) - ((ctri collide-cache-tri :offset-assert 0) - (normal vector :inline :offset-assert 16) + ((ctri collide-cache-tri) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type collide-edge-tri -(defmethod inspect collide-edge-tri ((this collide-edge-tri)) +(defmethod inspect ((this collide-edge-tri)) (format #t "[~8x] ~A~%" this 'collide-edge-tri) (format #t "~Tctri: #~%" (-> this ctri)) (format #t "~Tnormal: #~%" (-> this normal)) @@ -63,19 +57,16 @@ ;; definition of type collide-edge-edge (deftype collide-edge-edge (structure) - ((ignore basic :offset-assert 0) - (etri collide-edge-tri :offset-assert 4) - (vertex-ptr (inline-array vector) 2 :offset-assert 8) - (outward vector :inline :offset-assert 16) - (edge-vec-norm vector :inline :offset-assert 32) + ((ignore basic) + (etri collide-edge-tri) + (vertex-ptr (inline-array vector) 2) + (outward vector :inline) + (edge-vec-norm vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type collide-edge-edge -(defmethod inspect collide-edge-edge ((this collide-edge-edge)) +(defmethod inspect ((this collide-edge-edge)) (format #t "[~8x] ~A~%" this 'collide-edge-edge) (format #t "~Tignore: ~A~%" (-> this ignore)) (format #t "~Tetri: #~%" (-> this etri)) @@ -87,20 +78,17 @@ ;; definition of type collide-edge-hold-item (deftype collide-edge-hold-item (structure) - ((next collide-edge-hold-item :offset-assert 0) - (rating float :offset-assert 4) - (split int8 :offset-assert 8) - (edge collide-edge-edge :offset-assert 12) - (center-pt vector :inline :offset-assert 16) - (outward-pt vector :inline :offset-assert 32) + ((next collide-edge-hold-item) + (rating float) + (split int8) + (edge collide-edge-edge) + (center-pt vector :inline) + (outward-pt vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type collide-edge-hold-item -(defmethod inspect collide-edge-hold-item ((this collide-edge-hold-item)) +(defmethod inspect ((this collide-edge-hold-item)) (format #t "[~8x] ~A~%" this 'collide-edge-hold-item) (format #t "~Tnext: #~%" (-> this next)) (format #t "~Trating: ~f~%" (-> this rating)) @@ -113,23 +101,20 @@ ;; definition of type collide-edge-hold-list (deftype collide-edge-hold-list (structure) - ((num-allocs uint32 :offset-assert 0) - (num-attempts uint32 :offset-assert 4) - (head collide-edge-hold-item :offset-assert 8) - (items collide-edge-hold-item 32 :inline :offset-assert 16) - (attempts qword 32 :inline :offset-assert 1552) + ((num-allocs uint32) + (num-attempts uint32) + (head collide-edge-hold-item) + (items collide-edge-hold-item 32 :inline) + (attempts qword 32 :inline) ) - :method-count-assert 11 - :size-assert #x810 - :flag-assert #xb00000810 (:methods - (debug-draw (_type_) object 9) - (add-to-list! (_type_ collide-edge-hold-item) none 10) + (debug-draw (_type_) object) + (add-to-list! (_type_ collide-edge-hold-item) none) ) ) ;; definition for method 3 of type collide-edge-hold-list -(defmethod inspect collide-edge-hold-list ((this collide-edge-hold-list)) +(defmethod inspect ((this collide-edge-hold-list)) (format #t "[~8x] ~A~%" this 'collide-edge-hold-list) (format #t "~Tnum-allocs: ~D~%" (-> this num-allocs)) (format #t "~Tnum-attempts: ~D~%" (-> this num-attempts)) @@ -141,53 +126,50 @@ ;; definition of type collide-edge-work (deftype collide-edge-work (structure) - ((ccache collide-cache :offset-assert 0) - (cshape collide-shape :offset-assert 4) - (num-verts uint32 :offset-assert 8) - (num-edges uint32 :offset-assert 12) - (num-tris uint32 :offset-assert 16) - (cache-fill-box bounding-box :inline :offset-assert 32) - (within-reach-box bounding-box :inline :offset-assert 64) - (within-reach-box4w bounding-box4w :inline :offset-assert 96) - (search-pt vector :inline :offset-assert 128) - (search-dir-vec vector :inline :offset-assert 144) - (max-dist-sqrd-to-outward-pt float :offset-assert 160) - (max-dir-cosa-delta float :offset-assert 164) - (split-dists float 2 :offset-assert 168) - (outward-offset vector :inline :offset-assert 176) - (local-cache-fill-box bounding-box :inline :offset-assert 192) - (local-within-reach-box bounding-box :inline :offset-assert 224) - (local-player-spheres sphere 12 :inline :offset-assert 256) - (world-player-spheres sphere 12 :inline :offset-assert 448) - (local-player-hanging-spheres sphere 6 :inline :offset 256) - (world-player-hanging-spheres sphere 6 :inline :offset 448) - (local-player-leap-up-spheres sphere 6 :inline :offset 352) - (world-player-leap-up-spheres sphere 6 :inline :offset 544) - (verts vector 64 :inline :offset-assert 640) - (edges collide-edge-edge 96 :inline :offset-assert 1664) - (tris collide-edge-tri 48 :inline :offset-assert 6272) - (hold-list collide-edge-hold-list :inline :offset-assert 7808) + ((ccache collide-cache) + (cshape collide-shape) + (num-verts uint32) + (num-edges uint32) + (num-tris uint32) + (cache-fill-box bounding-box :inline) + (within-reach-box bounding-box :inline) + (within-reach-box4w bounding-box4w :inline) + (search-pt vector :inline) + (search-dir-vec vector :inline) + (max-dist-sqrd-to-outward-pt float) + (max-dir-cosa-delta float) + (split-dists float 2) + (outward-offset vector :inline) + (local-cache-fill-box bounding-box :inline) + (local-within-reach-box bounding-box :inline) + (local-player-spheres sphere 12 :inline) + (world-player-spheres sphere 12 :inline) + (local-player-hanging-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 0)) + (world-player-hanging-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 0)) + (local-player-leap-up-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 6)) + (world-player-leap-up-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 6)) + (verts vector 64 :inline) + (edges collide-edge-edge 96 :inline) + (tris collide-edge-tri 48 :inline) + (hold-list collide-edge-hold-list :inline) ) - :method-count-assert 20 - :size-assert #x2690 - :flag-assert #x1400002690 (:methods - (search-for-edges (_type_ collide-edge-hold-list) symbol 9) - (debug-draw-edges (_type_) object 10) - (debug-draw-tris (_type_) none 11) - (debug-draw-sphere (_type_) symbol 12) - (compute-center-point! (_type_ collide-edge-edge vector) float 13) - (collide-edge-work-method-14 (_type_ vector vector int) float 14) - (find-grabbable-edges! (_type_) none 15) - (find-grabbable-tris! (_type_) none 16) - (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol 17) - (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol 18) - (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol 19) + (search-for-edges (_type_ collide-edge-hold-list) symbol) + (debug-draw-edges (_type_) object) + (debug-draw-tris (_type_) none) + (debug-draw-sphere (_type_) symbol) + (compute-center-point! (_type_ collide-edge-edge vector) float) + (collide-edge-work-method-14 (_type_ vector vector int) float) + (find-grabbable-edges! (_type_) none) + (find-grabbable-tris! (_type_) none) + (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol) + (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol) + (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol) ) ) ;; definition for method 3 of type collide-edge-work -(defmethod inspect collide-edge-work ((this collide-edge-work)) +(defmethod inspect ((this collide-edge-work)) (format #t "[~8x] ~A~%" this 'collide-edge-work) (format #t "~Tccache: ~A~%" (-> this ccache)) (format #t "~Tcshape: ~A~%" (-> this cshape)) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-edge-grab_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-edge-grab_REF.gc index 43e5cce67c0..4f5e67820a7 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-edge-grab_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-edge-grab_REF.gc @@ -4,7 +4,7 @@ ;; definition for method 20 of type target ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs object. -(defmethod find-edge-grabs! target ((this target) (arg0 collide-cache)) +(defmethod find-edge-grabs! ((this target) (arg0 collide-cache)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -72,7 +72,7 @@ ) ;; definition for method 9 of type collide-edge-work -(defmethod search-for-edges collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-list)) +(defmethod search-for-edges ((this collide-edge-work) (arg0 collide-edge-hold-list)) (set! (-> arg0 num-allocs) (the-as uint 0)) (set! (-> arg0 num-attempts) (the-as uint 0)) (set! (-> arg0 head) #f) @@ -104,18 +104,15 @@ ;; definition of type pbhp-stack-vars (deftype pbhp-stack-vars (structure) - ((edge collide-edge-edge :offset-assert 0) - (allocated basic :offset-assert 4) - (neg-hold-pt vector :inline :offset-assert 16) - (split-vec vector :inline :offset-assert 32) + ((edge collide-edge-edge) + (allocated basic) + (neg-hold-pt vector :inline) + (split-vec vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type pbhp-stack-vars -(defmethod inspect pbhp-stack-vars ((this pbhp-stack-vars)) +(defmethod inspect ((this pbhp-stack-vars)) (format #t "[~8x] ~A~%" this 'pbhp-stack-vars) (format #t "~Tedge: #~%" (-> this edge)) (format #t "~Tallocated: ~A~%" (-> this allocated)) @@ -130,7 +127,7 @@ ;; definition for method 19 of type collide-edge-work ;; INFO: Used lq/sq -(defmethod check-grab-for-collisions collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) +(defmethod check-grab-for-collisions ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) (local-vars (sv-144 (function vector vector vector float vector)) (sv-160 vector) (sv-176 vector)) (let* ((s3-0 (-> arg0 edge)) (s1-0 (-> s3-0 etri ctri)) @@ -225,7 +222,7 @@ ;; definition for method 9 of type edge-grab-info ;; INFO: Used lq/sq -(defmethod edge-grab-info-method-9 edge-grab-info ((this edge-grab-info)) +(defmethod edge-grab-info-method-9 ((this edge-grab-info)) (local-vars (v0-0 symbol) (v1-14 float)) (rlet ((acc :class vf) (Q :class vf) @@ -366,7 +363,7 @@ ;; definition for method 14 of type collide-edge-work ;; INFO: Used lq/sq -(defmethod collide-edge-work-method-14 collide-edge-work ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod collide-edge-work-method-14 ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) (let ((f30-0 -1.0)) (let ((s2-0 (new 'stack-no-clear 'vector))) (dotimes (s1-0 (the-as int (-> this num-edges))) @@ -390,7 +387,7 @@ ;; definition for method 17 of type collide-edge-work ;; INFO: Used lq/sq -(defmethod should-add-to-list? collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 collide-edge-edge)) +(defmethod should-add-to-list? ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 collide-edge-edge)) (local-vars (v1-1 uint128) (v1-2 uint128) @@ -483,7 +480,7 @@ ) ;; definition for method 13 of type collide-edge-work -(defmethod compute-center-point! collide-edge-work ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) +(defmethod compute-center-point! ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) (local-vars (v0-0 float) (v1-1 float) (v1-2 float) (v1-3 float)) (rlet ((Q :class vf) (vf0 :class vf) @@ -552,7 +549,7 @@ ;; definition for method 10 of type edge-grab-info ;; INFO: Return type mismatch object vs symbol. -(defmethod debug-draw edge-grab-info ((this edge-grab-info)) +(defmethod debug-draw ((this edge-grab-info)) (add-debug-line #t (bucket-id debug-no-zbuf) @@ -606,7 +603,7 @@ ) ;; definition for method 10 of type collide-edge-work -(defmethod debug-draw-edges collide-edge-work ((this collide-edge-work)) +(defmethod debug-draw-edges ((this collide-edge-work)) (let ((gp-0 0)) (dotimes (s4-0 (the-as int (-> this num-edges))) (let* ((s3-0 (-> this edges s4-0)) @@ -656,7 +653,7 @@ ) ;; definition for method 12 of type collide-edge-work -(defmethod debug-draw-sphere collide-edge-work ((this collide-edge-work)) +(defmethod debug-draw-sphere ((this collide-edge-work)) (dotimes (s5-0 (the-as int (-> this num-verts))) (let ((a2-0 (-> this verts s5-0))) (add-debug-sphere #t (bucket-id debug-no-zbuf) a2-0 819.2 (new 'static 'rgba :r #xff :g #xff :a #x80)) @@ -667,7 +664,7 @@ ;; definition for method 9 of type collide-edge-hold-list ;; INFO: Used lq/sq -(defmethod debug-draw collide-edge-hold-list ((this collide-edge-hold-list)) +(defmethod debug-draw ((this collide-edge-hold-list)) (let ((s4-0 (-> this head)) (s5-0 0) ) @@ -721,7 +718,7 @@ ;; definition for method 11 of type collide-edge-work ;; INFO: Return type mismatch symbol vs none. -(defmethod debug-draw-tris collide-edge-work ((this collide-edge-work)) +(defmethod debug-draw-tris ((this collide-edge-work)) (dotimes (s5-0 (the-as int (-> this num-tris))) (let* ((v1-3 (-> this tris s5-0 ctri)) (t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-3 pat mode) color) a 64)) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-frag-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-frag-h_REF.gc index 4f32f940dd7..e9fb7033e1b 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-frag-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-frag-h_REF.gc @@ -4,14 +4,11 @@ ;; definition of type collide-frag-vertex (deftype collide-frag-vertex (vector) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type collide-frag-vertex ;; INFO: Used lq/sq -(defmethod inspect collide-frag-vertex ((this collide-frag-vertex)) +(defmethod inspect ((this collide-frag-vertex)) (format #t "[~8x] ~A~%" this 'collide-frag-vertex) (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) (format #t "~Tx: ~f~%" (-> this x)) @@ -24,23 +21,20 @@ ;; definition of type collide-frag-mesh (deftype collide-frag-mesh (basic) - ((packed-data uint32 :offset-assert 4) - (pat-array uint32 :offset-assert 8) - (strip-data-len uint16 :offset-assert 12) - (poly-count uint16 :offset-assert 14) - (base-trans vector :inline :offset-assert 16) - (vertex-count uint8 :offset 28) - (vertex-data-qwc uint8 :offset 29) - (total-qwc uint8 :offset 30) - (unused uint8 :offset 31) + ((packed-data uint32) + (pat-array uint32) + (strip-data-len uint16) + (poly-count uint16) + (base-trans vector :inline) + (vertex-count uint8 :overlay-at (-> base-trans w)) + (vertex-data-qwc uint8 :offset 29) + (total-qwc uint8 :offset 30) + (unused uint8 :offset 31) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type collide-frag-mesh -(defmethod inspect collide-frag-mesh ((this collide-frag-mesh)) +(defmethod inspect ((this collide-frag-mesh)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tpacked-data: #x~X~%" (-> this packed-data)) (format #t "~Tpat-array: #x~X~%" (-> this pat-array)) @@ -56,15 +50,12 @@ ;; definition of type collide-fragment (deftype collide-fragment (drawable) - ((mesh collide-frag-mesh :offset 8) + ((mesh collide-frag-mesh :offset 8) ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 ) ;; definition for method 3 of type collide-fragment -(defmethod inspect collide-fragment ((this collide-fragment)) +(defmethod inspect ((this collide-fragment)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) @@ -74,16 +65,13 @@ ;; definition of type drawable-inline-array-collide-fragment (deftype drawable-inline-array-collide-fragment (drawable-inline-array) - ((data collide-fragment 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 64) + ((data collide-fragment 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x44 - :flag-assert #x1200000044 ) ;; definition for method 3 of type drawable-inline-array-collide-fragment -(defmethod inspect drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment)) +(defmethod inspect ((this drawable-inline-array-collide-fragment)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) @@ -94,11 +82,8 @@ ;; definition of type drawable-tree-collide-fragment (deftype drawable-tree-collide-fragment (drawable-tree) - ((data-override drawable-inline-array :offset 32) + ((data-override drawable-inline-array :overlay-at (-> data 0)) ) - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/collide/collide-frag_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-frag_REF.gc index bc7d252f3e2..53440715c00 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-frag_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-frag_REF.gc @@ -2,13 +2,13 @@ (in-package goal) ;; definition for method 9 of type drawable-tree-collide-fragment -(defmethod login drawable-tree-collide-fragment ((this drawable-tree-collide-fragment)) +(defmethod login ((this drawable-tree-collide-fragment)) this ) ;; definition for method 10 of type drawable-tree-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) (when *display-render-collision* (dotimes (s4-0 (-> this length)) (draw (-> this data s4-0) (-> this data s4-0) arg1) @@ -19,13 +19,13 @@ ) ;; definition for method 16 of type drawable-tree-collide-fragment -(defmethod unpack-vis drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) ;; definition for method 11 of type drawable-tree-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-with-box (-> this data-override) (-> this length) arg1) 0 (none) @@ -33,7 +33,7 @@ ;; definition for method 12 of type drawable-tree-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-y-probe (-> this data-override) (-> this length) arg1) 0 (none) @@ -41,7 +41,7 @@ ;; definition for method 13 of type drawable-tree-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-ray (-> this data-override) (-> this length) arg1) 0 (none) @@ -49,7 +49,7 @@ ;; definition for method 8 of type collide-fragment ;; INFO: Return type mismatch int vs collide-fragment. -(defmethod mem-usage collide-fragment ((this collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-fragment) (arg0 memory-usage-block) (arg1 int)) (let ((s5-0 (if (logtest? arg1 1) 53 50 @@ -82,23 +82,23 @@ ) ;; definition for method 9 of type drawable-inline-array-collide-fragment -(defmethod login drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment)) +(defmethod login ((this drawable-inline-array-collide-fragment)) this ) ;; definition for method 10 of type collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod draw collide-fragment ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) +(defmethod draw ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) 0 (none) ) ;; definition for method 10 of type drawable-inline-array-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) - (arg0 drawable-inline-array-collide-fragment) - (arg1 display-frame) - ) +(defmethod draw ((this drawable-inline-array-collide-fragment) + (arg0 drawable-inline-array-collide-fragment) + (arg1 display-frame) + ) (dotimes (s4-0 (-> this length)) (let ((s3-0 (-> this data s4-0))) (if (sphere-cull (-> s3-0 bsphere)) @@ -112,7 +112,7 @@ ;; definition for method 11 of type drawable-inline-array-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-with-box (the-as collide-fragment (-> this data)) (-> this length) arg1) 0 (none) @@ -120,7 +120,7 @@ ;; definition for method 12 of type drawable-inline-array-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-y-probe (the-as collide-fragment (-> this data)) (-> this length) arg1) 0 (none) @@ -128,14 +128,14 @@ ;; definition for method 13 of type drawable-inline-array-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) (collide-ray (the-as collide-fragment (-> this data)) (-> this length) arg1) 0 (none) ) ;; definition for method 8 of type drawable-inline-array-collide-fragment -(defmethod mem-usage drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-mesh-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-mesh-h_REF.gc index bbe7561f002..612548290a4 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-mesh-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-mesh-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type collide-tri-result (deftype collide-tri-result (structure) - ((vertex vector 3 :inline :offset-assert 0) - (intersect vector :inline :offset-assert 48) - (normal vector :inline :offset-assert 64) - (pat pat-surface :offset-assert 80) + ((vertex vector 3 :inline) + (intersect vector :inline) + (normal vector :inline) + (pat pat-surface) ) - :method-count-assert 9 - :size-assert #x54 - :flag-assert #x900000054 ) ;; definition for method 3 of type collide-tri-result -(defmethod inspect collide-tri-result ((this collide-tri-result)) +(defmethod inspect ((this collide-tri-result)) (format #t "[~8x] ~A~%" this 'collide-tri-result) (format #t "~Tvertex[3] @ #x~X~%" (-> this vertex)) (format #t "~Tintersect: ~`vector`P~%" (-> this intersect)) @@ -25,18 +22,15 @@ ;; definition of type collide-mesh-tri (deftype collide-mesh-tri (structure) - ((vertex-index uint8 3 :offset-assert 0) - (unused uint8 :offset-assert 3) - (pat pat-surface :offset-assert 4) + ((vertex-index uint8 3) + (unused uint8) + (pat pat-surface) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type collide-mesh-tri -(defmethod inspect collide-mesh-tri ((this collide-mesh-tri)) +(defmethod inspect ((this collide-mesh-tri)) (format #t "[~8x] ~A~%" this 'collide-mesh-tri) (format #t "~Tvertex-index[3] @ #x~X~%" (-> this vertex-index)) (format #t "~Tunused: ~D~%" (-> this unused)) @@ -46,28 +40,25 @@ ;; definition of type collide-mesh (deftype collide-mesh (basic) - ((joint-id int32 :offset-assert 4) - (num-tris uint32 :offset-assert 8) - (num-verts uint32 :offset-assert 12) - (vertex-data (inline-array vector) :offset-assert 16) - (tris collide-mesh-tri 1 :inline :offset 32) + ((joint-id int32) + (num-tris uint32) + (num-verts uint32) + (vertex-data (inline-array vector)) + (tris collide-mesh-tri 1 :inline :offset 32) ) - :method-count-assert 16 - :size-assert #x28 - :flag-assert #x1000000028 (:methods - (debug-draw-tris (_type_ process-drawable int) none 9) - (overlap-test (_type_ collide-mesh-cache-tri vector) symbol 10) - (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 11) - (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 12) - (populate-cache! (_type_ collide-mesh-cache-tri matrix) none 13) - (collide-mesh-math-1 (_type_ object object) none 14) - (collide-mesh-math-2 (_type_ object object object) none 15) + (debug-draw-tris (_type_ process-drawable int) none) + (overlap-test (_type_ collide-mesh-cache-tri vector) symbol) + (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (populate-cache! (_type_ collide-mesh-cache-tri matrix) none) + (collide-mesh-math-1 (_type_ object object) none) + (collide-mesh-math-2 (_type_ object object object) none) ) ) ;; definition for method 3 of type collide-mesh -(defmethod inspect collide-mesh ((this collide-mesh)) +(defmethod inspect ((this collide-mesh)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tjoint-id: ~D~%" (-> this joint-id)) (format #t "~Tnum-tris: ~D~%" (-> this num-tris)) @@ -79,23 +70,20 @@ ;; definition of type collide-mesh-cache (deftype collide-mesh-cache (basic) - ((used-size uint32 :offset-assert 4) - (max-size uint32 :offset-assert 8) - (id uint64 :offset-assert 16) - (data uint8 40960 :offset 32) + ((used-size uint32) + (max-size uint32) + (id uint64) + (data uint8 40960 :offset 32) ) - :method-count-assert 12 - :size-assert #xa020 - :flag-assert #xc0000a020 (:methods - (allocate! (_type_ int) int 9) - (is-id? (_type_ int) symbol 10) - (next-id! (_type_) uint 11) + (allocate! (_type_ int) int) + (is-id? (_type_ int) symbol) + (next-id! (_type_) uint) ) ) ;; definition for method 3 of type collide-mesh-cache -(defmethod inspect collide-mesh-cache ((this collide-mesh-cache)) +(defmethod inspect ((this collide-mesh-cache)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tused-size: ~D~%" (-> this used-size)) (format #t "~Tmax-size: ~D~%" (-> this max-size)) @@ -108,24 +96,21 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for method 10 of type collide-mesh-cache -(defmethod is-id? collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) +(defmethod is-id? ((this collide-mesh-cache) (arg0 int)) (= (-> this id) arg0) ) ;; definition of type collide-mesh-cache-tri (deftype collide-mesh-cache-tri (structure) - ((vertex vector 3 :inline :offset-assert 0) - (normal vector :inline :offset-assert 48) - (bbox4w bounding-box4w :inline :offset-assert 64) - (pat pat-surface :offset 60) + ((vertex vector 3 :inline) + (normal vector :inline) + (bbox4w bounding-box4w :inline) + (pat pat-surface :overlay-at (-> normal w)) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type collide-mesh-cache-tri -(defmethod inspect collide-mesh-cache-tri ((this collide-mesh-cache-tri)) +(defmethod inspect ((this collide-mesh-cache-tri)) (format #t "[~8x] ~A~%" this 'collide-mesh-cache-tri) (format #t "~Tvertex[3] @ #x~X~%" (-> this vertex)) (format #t "~Tnormal: ~`vector`P~%" (-> this normal)) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-mesh_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-mesh_REF.gc index 05fcd634d48..3b9bcc9287f 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-mesh_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-mesh_REF.gc @@ -3,13 +3,13 @@ ;; definition for method 5 of type collide-mesh ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of collide-mesh ((this collide-mesh)) +(defmethod asize-of ((this collide-mesh)) (the-as int (+ (-> collide-mesh size) (* (+ (-> this num-tris) -1) 8))) ) ;; definition for method 8 of type collide-mesh ;; INFO: Return type mismatch int vs collide-mesh. -(defmethod mem-usage collide-mesh ((this collide-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 79 (-> arg0 length))) (set! (-> arg0 data 78 name) "collide-mesh") (+! (-> arg0 data 78 count) 1) @@ -29,7 +29,7 @@ ;; definition for method 9 of type collide-mesh ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw-tris collide-mesh ((this collide-mesh) (arg0 process-drawable) (arg1 int)) +(defmethod debug-draw-tris ((this collide-mesh) (arg0 process-drawable) (arg1 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -85,16 +85,13 @@ ;; definition of type sopt-work (deftype sopt-work (structure) - ((intersect vector :inline :offset-assert 0) - (sphere-bbox4w bounding-box4w :inline :offset-assert 16) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type sopt-work -(defmethod inspect sopt-work ((this sopt-work)) +(defmethod inspect ((this sopt-work)) (format #t "[~8x] ~A~%" this 'sopt-work) (format #t "~Tintersect: #~%" (-> this intersect)) (format #t "~Tsphere-bbox4w: #~%" (-> this sphere-bbox4w)) @@ -107,16 +104,13 @@ ;; definition of type spat-work (deftype spat-work (structure) - ((intersect vector :inline :offset-assert 0) - (sphere-bbox4w bounding-box4w :inline :offset-assert 16) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type spat-work -(defmethod inspect spat-work ((this spat-work)) +(defmethod inspect ((this spat-work)) (format #t "[~8x] ~A~%" this 'spat-work) (format #t "~Tintersect: #~%" (-> this intersect)) (format #t "~Tsphere-bbox4w: #~%" (-> this sphere-bbox4w)) @@ -137,7 +131,7 @@ ;; definition for method 9 of type collide-mesh-cache ;; INFO: Return type mismatch (pointer uint8) vs int. -(defmethod allocate! collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) +(defmethod allocate! ((this collide-mesh-cache) (arg0 int)) (local-vars (a1-2 int) (a2-2 int)) (let* ((v1-0 (+ arg0 15)) (a1-1 (-> this used-size)) @@ -174,7 +168,7 @@ ;; definition for method 13 of type collide-mesh ;; INFO: Return type mismatch int vs none. ;; ERROR: Failed load: (set! vf1 (l.vf t0-4)) at op 77 -(defmethod populate-cache! collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 matrix)) +(defmethod populate-cache! ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 matrix)) (local-vars (t0-2 uint)) (rlet ((acc :class vf) (Q :class vf) @@ -344,16 +338,13 @@ ;; definition of type oot-work (deftype oot-work (structure) - ((intersect vector :inline :offset-assert 0) - (sphere-bbox4w bounding-box4w :inline :offset-assert 16) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type oot-work -(defmethod inspect oot-work ((this oot-work)) +(defmethod inspect ((this oot-work)) (format #t "[~8x] ~A~%" this 'oot-work) (format #t "~Tintersect: #~%" (-> this intersect)) (format #t "~Tsphere-bbox4w: #~%" (-> this sphere-bbox4w)) @@ -362,7 +353,7 @@ ;; definition for method 10 of type collide-mesh ;; INFO: Used lq/sq -(defmethod overlap-test collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) +(defmethod overlap-test ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) (local-vars (v1-0 uint128) (a0-1 uint128) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-probe_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-probe_REF.gc index 6d620e269d5..26f1c6c4efe 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-probe_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-probe_REF.gc @@ -114,16 +114,13 @@ ;; definition of type collide-probe-stack-elem (deftype collide-probe-stack-elem (structure) - ((child uint32 :offset-assert 0) - (count uint32 :offset-assert 4) + ((child uint32) + (count uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type collide-probe-stack-elem -(defmethod inspect collide-probe-stack-elem ((this collide-probe-stack-elem)) +(defmethod inspect ((this collide-probe-stack-elem)) (format #t "[~8x] ~A~%" this 'collide-probe-stack-elem) (format #t "~Tchild: #x~X~%" (-> this child)) (format #t "~Tcount: ~D~%" (-> this count)) @@ -132,15 +129,12 @@ ;; definition of type collide-probe-stack (deftype collide-probe-stack (structure) - ((data collide-probe-stack-elem 1024 :inline :offset-assert 0) + ((data collide-probe-stack-elem 1024 :inline) ) - :method-count-assert 9 - :size-assert #x4000 - :flag-assert #x900004000 ) ;; definition for method 3 of type collide-probe-stack -(defmethod inspect collide-probe-stack ((this collide-probe-stack)) +(defmethod inspect ((this collide-probe-stack)) (format #t "[~8x] ~A~%" this 'collide-probe-stack) (format #t "~Tdata[1024] @ #x~X~%" (-> this data)) this diff --git a/test/decompiler/reference/jak1/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-shape-h_REF.gc index 9eca2c82463..2f4e3ee89a9 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-shape-h_REF.gc @@ -3,21 +3,18 @@ ;; definition of type collide-sticky-rider (deftype collide-sticky-rider (structure) - ((rider-handle handle :offset-assert 0) - (sticky-prim collide-shape-prim :offset-assert 8) - (prim-ry float :offset-assert 12) - (rider-local-pos vector :inline :offset-assert 16) + ((rider-handle handle) + (sticky-prim collide-shape-prim) + (prim-ry float) + (rider-local-pos vector :inline) ) - :method-count-assert 10 - :size-assert #x20 - :flag-assert #xa00000020 (:methods - (set-rider! (_type_ handle) symbol 9) + (set-rider! (_type_ handle) symbol) ) ) ;; definition for method 3 of type collide-sticky-rider -(defmethod inspect collide-sticky-rider ((this collide-sticky-rider)) +(defmethod inspect ((this collide-sticky-rider)) (format #t "[~8x] ~A~%" this 'collide-sticky-rider) (format #t "~Trider-handle: ~D~%" (-> this rider-handle)) (format #t "~Tsticky-prim: ~A~%" (-> this sticky-prim)) @@ -27,7 +24,7 @@ ) ;; definition for method 9 of type collide-sticky-rider -(defmethod set-rider! collide-sticky-rider ((this collide-sticky-rider) (arg0 handle)) +(defmethod set-rider! ((this collide-sticky-rider) (arg0 handle)) (set! (-> this rider-handle) arg0) (set! (-> this sticky-prim) #f) #f @@ -35,22 +32,19 @@ ;; definition of type collide-sticky-rider-group (deftype collide-sticky-rider-group (basic) - ((num-riders int32 :offset-assert 4) - (allocated-riders int32 :offset-assert 8) - (rider collide-sticky-rider 1 :inline :offset-assert 16) + ((num-riders int32) + (allocated-riders int32) + (rider collide-sticky-rider 1 :inline) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (new (symbol type int) _type_ 0) - (add-rider! (_type_ process-drawable) collide-sticky-rider 9) - (reset! (_type_) int 10) + (new (symbol type int) _type_) + (add-rider! (_type_ process-drawable) collide-sticky-rider) + (reset! (_type_) int) ) ) ;; definition for method 3 of type collide-sticky-rider-group -(defmethod inspect collide-sticky-rider-group ((this collide-sticky-rider-group)) +(defmethod inspect ((this collide-sticky-rider-group)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tnum-riders: ~D~%" (-> this num-riders)) (format #t "~Tallocated-riders: ~D~%" (-> this allocated-riders)) @@ -59,25 +53,22 @@ ) ;; definition for method 10 of type collide-sticky-rider-group -(defmethod reset! collide-sticky-rider-group ((this collide-sticky-rider-group)) +(defmethod reset! ((this collide-sticky-rider-group)) (set! (-> this num-riders) 0) 0 ) ;; definition of type pull-rider-info (deftype pull-rider-info (structure) - ((rider collide-sticky-rider :offset-assert 0) - (rider-cshape collide-shape-moving :offset-assert 4) - (rider-delta-ry float :offset-assert 8) - (rider-dest vector :inline :offset-assert 16) + ((rider collide-sticky-rider) + (rider-cshape collide-shape-moving) + (rider-delta-ry float) + (rider-dest vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type pull-rider-info -(defmethod inspect pull-rider-info ((this pull-rider-info)) +(defmethod inspect ((this pull-rider-info)) (format #t "[~8x] ~A~%" this 'pull-rider-info) (format #t "~Trider: #~%" (-> this rider)) (format #t "~Trider-cshape: ~A~%" (-> this rider-cshape)) @@ -88,22 +79,19 @@ ;; definition of type collide-shape-intersect (deftype collide-shape-intersect (basic) - ((move-vec vector :inline :offset-assert 16) - (best-u float :offset-assert 32) - (best-tri collide-tri-result :inline :offset-assert 48) - (best-from-prim collide-shape-prim :offset-assert 132) - (best-to-prim collide-shape-prim :offset-assert 136) + ((move-vec vector :inline) + (best-u float) + (best-tri collide-tri-result :inline) + (best-from-prim collide-shape-prim) + (best-to-prim collide-shape-prim) ) - :method-count-assert 10 - :size-assert #x8c - :flag-assert #xa0000008c (:methods - (init! (_type_ vector) symbol 9) + (init! (_type_ vector) symbol) ) ) ;; definition for method 3 of type collide-shape-intersect -(defmethod inspect collide-shape-intersect ((this collide-shape-intersect)) +(defmethod inspect ((this collide-shape-intersect)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tmove-vec: ~`vector`P~%" (-> this move-vec)) (format #t "~Tbest-u: ~f~%" (-> this best-u)) @@ -115,21 +103,18 @@ ;; definition of type collide-overlap-result (deftype collide-overlap-result (structure) - ((best-dist float :offset-assert 0) - (best-from-prim collide-shape-prim :offset-assert 4) - (best-to-prim collide-shape-prim :offset-assert 8) - (best-from-tri collide-tri-result :inline :offset-assert 16) + ((best-dist float) + (best-from-prim collide-shape-prim) + (best-to-prim collide-shape-prim) + (best-from-tri collide-tri-result :inline) ) - :method-count-assert 10 - :size-assert #x64 - :flag-assert #xa00000064 (:methods - (reset! (_type_) none 9) + (reset! (_type_) none) ) ) ;; definition for method 3 of type collide-overlap-result -(defmethod inspect collide-overlap-result ((this collide-overlap-result)) +(defmethod inspect ((this collide-overlap-result)) (format #t "[~8x] ~A~%" this 'collide-overlap-result) (format #t "~Tbest-dist: ~f~%" (-> this best-dist)) (format #t "~Tbest-from-prim: ~A~%" (-> this best-from-prim)) @@ -140,7 +125,7 @@ ;; definition for method 9 of type collide-overlap-result ;; INFO: Return type mismatch symbol vs none. -(defmethod reset! collide-overlap-result ((this collide-overlap-result)) +(defmethod reset! ((this collide-overlap-result)) (set! (-> this best-dist) 0.0) (set! (-> this best-from-prim) #f) (set! (-> this best-to-prim) #f) @@ -149,16 +134,13 @@ ;; definition of type overlaps-others-params (deftype overlaps-others-params (structure) - ((options uint32 :offset-assert 0) - (tlist touching-list :offset-assert 4) + ((options uint32) + (tlist touching-list) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type overlaps-others-params -(defmethod inspect overlaps-others-params ((this overlaps-others-params)) +(defmethod inspect ((this overlaps-others-params)) (format #t "[~8x] ~A~%" this 'overlaps-others-params) (format #t "~Toptions: ~D~%" (-> this options)) (format #t "~Ttlist: ~A~%" (-> this tlist)) @@ -179,21 +161,18 @@ ;; definition of type collide-prim-core (deftype collide-prim-core (structure) - ((world-sphere vector :inline :offset-assert 0) - (collide-as collide-kind :offset-assert 16) - (action collide-action :offset-assert 24) - (offense collide-offense :offset-assert 28) - (prim-type int8 :offset-assert 29) - (extra uint8 2 :offset-assert 30) - (quad uint128 2 :offset 0) + ((world-sphere vector :inline) + (collide-as collide-kind) + (action collide-action) + (offense collide-offense) + (prim-type int8) + (extra uint8 2) + (quad uint128 2 :overlay-at (-> world-sphere quad)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type collide-prim-core -(defmethod inspect collide-prim-core ((this collide-prim-core)) +(defmethod inspect ((this collide-prim-core)) (format #t "[~8x] ~A~%" this 'collide-prim-core) (format #t "~Tworld-sphere: ~`vector`P~%" (-> this world-sphere)) (format #t "~Tcollide-as: ~D~%" (-> this collide-as)) @@ -207,48 +186,45 @@ ;; definition of type collide-shape-prim (deftype collide-shape-prim (basic) - ((cshape collide-shape :offset-assert 4) - (prim-id uint32 :offset-assert 8) - (transform-index int8 :offset-assert 12) - (prim-core collide-prim-core :inline :offset-assert 16) - (local-sphere vector :inline :offset-assert 48) - (collide-with collide-kind :offset-assert 64) - (world-sphere vector :inline :offset 16) - (collide-as collide-kind :offset 32) - (action collide-action :offset 40) - (offense collide-offense :offset 44) - (prim-type int8 :offset 45) - (radius meters :offset 60) + ((cshape collide-shape) + (prim-id uint32) + (transform-index int8) + (prim-core collide-prim-core :inline) + (local-sphere vector :inline) + (collide-with collide-kind) + (world-sphere vector :inline :overlay-at (-> prim-core world-sphere)) + (collide-as collide-kind :overlay-at (-> prim-core collide-as)) + (action collide-action :overlay-at (-> prim-core action)) + (offense collide-offense :overlay-at (-> prim-core offense)) + (prim-type int8 :overlay-at (-> prim-core prim-type)) + (radius meters :overlay-at (-> local-sphere w)) ) - :method-count-assert 28 - :size-assert #x48 - :flag-assert #x1c00000048 (:methods - (new (symbol type collide-shape uint int) _type_ 0) - (move-by-vector! (_type_ vector) none 9) - (find-prim-by-id (_type_ uint) collide-shape-prim 10) - (debug-draw-world-sphere (_type_) symbol 11) - (add-fg-prim-using-box (_type_ collide-cache) none 12) - (add-fg-prim-using-line-sphere (_type_ collide-cache) none 13) - (add-fg-prim-using-y-probe (_type_ collide-cache) none 14) - (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 15) - (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 16) - (unused-17 () none 17) - (collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none 18) - (collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none 19) - (add-to-bounding-box (_type_ collide-kind) symbol 20) - (num-mesh (_type_ collide-shape-prim) int 21) - (on-platform-test (_type_ collide-shape-prim collide-overlap-result float) none 22) - (should-push-away-test (_type_ collide-shape-prim collide-overlap-result) none 23) - (should-push-away-reverse-test (_type_ collide-shape-prim-group collide-overlap-result) none 24) - (update-transforms! (_type_ process-drawable) symbol 25) - (set-collide-as! (_type_ collide-kind) none 26) - (set-collide-with! (_type_ collide-kind) none 27) + (new (symbol type collide-shape uint int) _type_) + (move-by-vector! (_type_ vector) none) + (find-prim-by-id (_type_ uint) collide-shape-prim) + (debug-draw-world-sphere (_type_) symbol) + (add-fg-prim-using-box (_type_ collide-cache) none) + (add-fg-prim-using-line-sphere (_type_ collide-cache) none) + (add-fg-prim-using-y-probe (_type_ collide-cache) none) + (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol) + (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol) + (unused-17 () none) + (collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none) + (collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none) + (add-to-bounding-box (_type_ collide-kind) symbol) + (num-mesh (_type_ collide-shape-prim) int) + (on-platform-test (_type_ collide-shape-prim collide-overlap-result float) none) + (should-push-away-test (_type_ collide-shape-prim collide-overlap-result) none) + (should-push-away-reverse-test (_type_ collide-shape-prim-group collide-overlap-result) none) + (update-transforms! (_type_ process-drawable) symbol) + (set-collide-as! (_type_ collide-kind) none) + (set-collide-with! (_type_ collide-kind) none) ) ) ;; definition for method 3 of type collide-shape-prim -(defmethod inspect collide-shape-prim ((this collide-shape-prim)) +(defmethod inspect ((this collide-shape-prim)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tcshape: ~A~%" (-> this cshape)) (format #t "~Tprim-id: #x~X~%" (-> this prim-id)) @@ -267,18 +243,15 @@ ;; definition of type collide-shape-prim-sphere (deftype collide-shape-prim-sphere (collide-shape-prim) - ((pat pat-surface :offset-assert 72) + ((pat pat-surface) ) - :method-count-assert 28 - :size-assert #x4c - :flag-assert #x1c0000004c (:methods - (new (symbol type collide-shape uint) _type_ 0) + (new (symbol type collide-shape uint) _type_) ) ) ;; definition for method 3 of type collide-shape-prim-sphere -(defmethod inspect collide-shape-prim-sphere ((this collide-shape-prim-sphere)) +(defmethod inspect ((this collide-shape-prim-sphere)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tcshape: ~A~%" (-> this cshape)) (format #t "~Tprim-id: #x~X~%" (-> this prim-id)) @@ -298,22 +271,19 @@ ;; definition of type collide-shape-prim-mesh (deftype collide-shape-prim-mesh (collide-shape-prim) - ((mesh collide-mesh :offset-assert 72) - (mesh-id int32 :offset-assert 76) - (mesh-cache-id uint64 :offset-assert 80) - (mesh-cache-tris (inline-array collide-mesh-cache-tri) :offset-assert 88) + ((mesh collide-mesh) + (mesh-id int32) + (mesh-cache-id uint64) + (mesh-cache-tris (inline-array collide-mesh-cache-tri)) ) - :method-count-assert 29 - :size-assert #x5c - :flag-assert #x1d0000005c (:methods - (new (symbol type collide-shape uint uint) _type_ 0) - (change-mesh (_type_ int) none 28) + (new (symbol type collide-shape uint uint) _type_) + (change-mesh (_type_ int) none) ) ) ;; definition for method 3 of type collide-shape-prim-mesh -(defmethod inspect collide-shape-prim-mesh ((this collide-shape-prim-mesh)) +(defmethod inspect ((this collide-shape-prim-mesh)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tcshape: ~A~%" (-> this cshape)) (format #t "~Tprim-id: #x~X~%" (-> this prim-id)) @@ -336,24 +306,21 @@ ;; definition of type collide-shape-prim-group (deftype collide-shape-prim-group (collide-shape-prim) - ((num-prims int32 :offset-assert 72) - (num-prims-u uint32 :offset 72) - (allocated-prims int32 :offset-assert 76) - (prim collide-shape-prim 1 :offset-assert 80) - (prims collide-shape-prim :dynamic :offset 80) + ((num-prims int32) + (num-prims-u uint32 :overlay-at num-prims) + (allocated-prims int32) + (prim collide-shape-prim 1) + (prims collide-shape-prim :dynamic :overlay-at (-> prim 0)) ) - :method-count-assert 30 - :size-assert #x54 - :flag-assert #x1e00000054 (:methods - (new (symbol type collide-shape uint int) _type_ 0) - (append-prim (_type_ collide-shape-prim) none 28) - (add-to-non-empty-bounding-box (_type_ collide-kind) none 29) + (new (symbol type collide-shape uint int) _type_) + (append-prim (_type_ collide-shape-prim) none) + (add-to-non-empty-bounding-box (_type_ collide-kind) none) ) ) ;; definition for method 3 of type collide-shape-prim-group -(defmethod inspect collide-shape-prim-group ((this collide-shape-prim-group)) +(defmethod inspect ((this collide-shape-prim-group)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tcshape: ~A~%" (-> this cshape)) (format #t "~Tprim-id: #x~X~%" (-> this prim-id)) @@ -375,56 +342,53 @@ ;; definition of type collide-shape (deftype collide-shape (trsqv) - ((process process-drawable :offset-assert 140) - (max-iteration-count uint8 :offset-assert 144) - (nav-flags nav-flags :offset-assert 145) - (pad-byte uint8 2 :offset-assert 146) - (pat-ignore-mask pat-surface :offset-assert 148) - (event-self symbol :offset-assert 152) - (event-other symbol :offset-assert 156) - (root-prim collide-shape-prim :offset-assert 160) - (riders collide-sticky-rider-group :offset-assert 164) - (backup-collide-as collide-kind :offset-assert 168) - (backup-collide-with collide-kind :offset-assert 176) + ((process process-drawable) + (max-iteration-count uint8) + (nav-flags nav-flags) + (pad-byte uint8 2) + (pat-ignore-mask pat-surface) + (event-self symbol) + (event-other symbol) + (root-prim collide-shape-prim) + (riders collide-sticky-rider-group) + (backup-collide-as collide-kind) + (backup-collide-with collide-kind) ) - :method-count-assert 56 - :size-assert #xb8 - :flag-assert #x38000000b8 (:methods - (new (symbol type process-drawable collide-list-enum) _type_ 0) - (move-by-vector! (_type_ vector) none 28) - (alloc-riders (_type_ int) none 29) - (move-to-point! (_type_ vector) none 30) - (debug-draw (_type_) none 31) - (fill-cache-for-shape! (_type_ float collide-kind) none 32) - (fill-cache-integrate-and-collide! (_type_ vector collide-kind) none 33) - (find-prim-by-id (_type_ uint) collide-shape-prim 34) - (detect-riders! (_type_) symbol 35) - (build-bounding-box-for-shape (_type_ bounding-box float collide-kind) symbol 36) - (integrate-and-collide! (_type_ vector) none 37) - (find-collision-meshes (_type_) symbol 38) - (on-platform (_type_ collide-shape collide-overlap-result) symbol 39) - (find-overlapping-shapes (_type_ overlaps-others-params) symbol 40) - (calc-shove-up (_type_ attack-info float) vector 41) - (should-push-away (_type_ collide-shape collide-overlap-result) symbol 42) - (pull-rider! (_type_ pull-rider-info) none 43) - (pull-riders! (_type_) symbol 44) - (do-push-aways! (_type_) symbol 45) - (set-root-prim! (_type_ collide-shape-prim) collide-shape-prim 46) - (update-transforms! (_type_) symbol 47) - (clear-collide-with-as (_type_) none 48) - (restore-collide-with-as (_type_) none 49) - (backup-collide-with-as (_type_) none 50) - (set-root-prim-collide-with! (_type_ collide-kind) none 51) - (set-root-prim-collide-as! (_type_ collide-kind) none 52) - (set-collide-kinds (_type_ int collide-kind collide-kind) none 53) - (set-collide-offense (_type_ int collide-offense) none 54) - (send-shove-back (_type_ process touching-shapes-entry float float float) none 55) + (new (symbol type process-drawable collide-list-enum) _type_) + (move-by-vector! (_type_ vector) none) + (alloc-riders (_type_ int) none) + (move-to-point! (_type_ vector) none) + (debug-draw (_type_) none) + (fill-cache-for-shape! (_type_ float collide-kind) none) + (fill-cache-integrate-and-collide! (_type_ vector collide-kind) none) + (find-prim-by-id (_type_ uint) collide-shape-prim) + (detect-riders! (_type_) symbol) + (build-bounding-box-for-shape (_type_ bounding-box float collide-kind) symbol) + (integrate-and-collide! (_type_ vector) none) + (find-collision-meshes (_type_) symbol) + (on-platform (_type_ collide-shape collide-overlap-result) symbol) + (find-overlapping-shapes (_type_ overlaps-others-params) symbol) + (calc-shove-up (_type_ attack-info float) vector) + (should-push-away (_type_ collide-shape collide-overlap-result) symbol) + (pull-rider! (_type_ pull-rider-info) none) + (pull-riders! (_type_) symbol) + (do-push-aways! (_type_) symbol) + (set-root-prim! (_type_ collide-shape-prim) collide-shape-prim) + (update-transforms! (_type_) symbol) + (clear-collide-with-as (_type_) none) + (restore-collide-with-as (_type_) none) + (backup-collide-with-as (_type_) none) + (set-root-prim-collide-with! (_type_ collide-kind) none) + (set-root-prim-collide-as! (_type_ collide-kind) none) + (set-collide-kinds (_type_ int collide-kind collide-kind) none) + (set-collide-offense (_type_ int collide-offense) none) + (send-shove-back (_type_ process touching-shapes-entry float float float) none) ) ) ;; definition for method 3 of type collide-shape -(defmethod inspect collide-shape ((this collide-shape)) +(defmethod inspect ((this collide-shape)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) (format #t "~Trot: ~`vector`P~%" (-> this quat)) @@ -454,50 +418,47 @@ ;; definition of type collide-shape-moving (deftype collide-shape-moving (collide-shape) - ((rider-time time-frame :offset-assert 184) - (rider-last-move vector :inline :offset-assert 192) - (trans-old vector 3 :inline :offset-assert 208) - (poly-pat pat-surface :offset-assert 256) - (cur-pat pat-surface :offset-assert 260) - (ground-pat pat-surface :offset-assert 264) - (status cshape-moving-flags :offset-assert 272) - (old-status cshape-moving-flags :offset-assert 280) - (prev-status cshape-moving-flags :offset-assert 288) - (reaction-flag cshape-reaction-flags :offset-assert 296) - (reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags) :offset-assert 300) - (no-reaction (function collide-shape-moving collide-shape-intersect vector vector none) :offset-assert 304) - (local-normal vector :inline :offset-assert 320) - (surface-normal vector :inline :offset-assert 336) - (poly-normal vector :inline :offset-assert 352) - (ground-poly-normal vector :inline :offset-assert 368) - (ground-touch-point vector :inline :offset-assert 384) - (shadow-pos vector :inline :offset-assert 400) - (ground-impact-vel meters :offset-assert 416) - (surface-angle float :offset-assert 420) - (poly-angle float :offset-assert 424) - (touch-angle float :offset-assert 428) - (coverage float :offset-assert 432) - (dynam dynamics :offset-assert 436) - (surf surface :offset-assert 440) + ((rider-time time-frame) + (rider-last-move vector :inline) + (trans-old vector 3 :inline) + (poly-pat pat-surface) + (cur-pat pat-surface) + (ground-pat pat-surface) + (status cshape-moving-flags) + (old-status cshape-moving-flags) + (prev-status cshape-moving-flags) + (reaction-flag cshape-reaction-flags) + (reaction (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags)) + (no-reaction (function collide-shape-moving collide-shape-intersect vector vector none)) + (local-normal vector :inline) + (surface-normal vector :inline) + (poly-normal vector :inline) + (ground-poly-normal vector :inline) + (ground-touch-point vector :inline) + (shadow-pos vector :inline) + (ground-impact-vel meters) + (surface-angle float) + (poly-angle float) + (touch-angle float) + (coverage float) + (dynam dynamics) + (surf surface) ) - :method-count-assert 65 - :size-assert #x1bc - :flag-assert #x41000001bc (:methods - (set-and-handle-pat! (_type_ pat-surface) none 56) - (integrate-no-collide! (_type_ vector) none 57) - (collide-shape-moving-method-58 (_type_ vector) symbol 58) - (integrate-for-enemy-with-move-to-ground! (_type_ vector collide-kind float symbol symbol symbol) none 59) - (move-to-ground (_type_ float float symbol collide-kind) symbol 60) - (move-to-ground-point! (_type_ vector vector vector) none 61) - (compute-acc-due-to-gravity (_type_ vector float) vector 62) - (step-collison! (_type_ vector vector float) float 63) - (move-to-tri! (_type_ collide-tri-result vector) none 64) + (set-and-handle-pat! (_type_ pat-surface) none) + (integrate-no-collide! (_type_ vector) none) + (collide-shape-moving-method-58 (_type_ vector) symbol) + (integrate-for-enemy-with-move-to-ground! (_type_ vector collide-kind float symbol symbol symbol) none) + (move-to-ground (_type_ float float symbol collide-kind) symbol) + (move-to-ground-point! (_type_ vector vector vector) none) + (compute-acc-due-to-gravity (_type_ vector float) vector) + (step-collison! (_type_ vector vector float) float) + (move-to-tri! (_type_ collide-tri-result vector) none) ) ) ;; definition for method 3 of type collide-shape-moving -(defmethod inspect collide-shape-moving ((this collide-shape-moving)) +(defmethod inspect ((this collide-shape-moving)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) (format #t "~Trot: ~`vector`P~%" (-> this quat)) @@ -623,13 +584,13 @@ ) ;; definition for method 4 of type collide-shape-prim-group -(defmethod length collide-shape-prim-group ((this collide-shape-prim-group)) +(defmethod length ((this collide-shape-prim-group)) (-> this num-prims) ) ;; definition for method 5 of type collide-shape-prim-group ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of collide-shape-prim-group ((this collide-shape-prim-group)) +(defmethod asize-of ((this collide-shape-prim-group)) (the-as int (+ (-> this type size) (* (+ (-> this allocated-prims) -1) 4))) ) @@ -685,13 +646,13 @@ ) ;; definition for method 4 of type collide-sticky-rider-group -(defmethod length collide-sticky-rider-group ((this collide-sticky-rider-group)) +(defmethod length ((this collide-sticky-rider-group)) (-> this num-riders) ) ;; definition for method 5 of type collide-sticky-rider-group ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of collide-sticky-rider-group ((this collide-sticky-rider-group)) +(defmethod asize-of ((this collide-sticky-rider-group)) (the-as int (+ (-> this type size) (* (+ (-> this allocated-riders) -1) 32))) ) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-shape-rider_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-shape-rider_REF.gc index f7ead6a8f3d..29a3e2d6d10 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-shape-rider_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-shape-rider_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 39 of type collide-shape -(defmethod on-platform collide-shape ((this collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result)) +(defmethod on-platform ((this collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result)) (let ((v1-0 arg1)) (set! (-> v1-0 best-dist) 0.0) (set! (-> v1-0 best-from-prim) #f) @@ -34,14 +34,14 @@ ;; definition for method 22 of type collide-shape-prim ;; INFO: Return type mismatch object vs none. -(defmethod on-platform-test collide-shape-prim ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) +(defmethod on-platform-test ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) (format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%") (none) ) ;; definition for method 22 of type collide-shape-prim-group ;; INFO: Return type mismatch symbol vs none. -(defmethod on-platform-test collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) +(defmethod on-platform-test ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) (let ((s3-0 (-> arg0 prim-core collide-as))) (dotimes (s2-0 (-> this num-prims)) (let ((s1-0 (-> this prims s2-0))) @@ -70,7 +70,7 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch pat-surface vs none. ;; WARN: Function (method 22 collide-shape-prim-mesh) has a return type of none, but the expression builder found a return statement. -(defmethod on-platform-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) +(defmethod on-platform-test ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) (case (-> arg0 type) ((collide-shape-prim-group) (let ((s3-0 (-> this collide-with))) @@ -148,7 +148,7 @@ ) ;; definition for method 9 of type collide-sticky-rider-group -(defmethod add-rider! collide-sticky-rider-group ((this collide-sticky-rider-group) (arg0 process-drawable)) +(defmethod add-rider! ((this collide-sticky-rider-group) (arg0 process-drawable)) (let ((gp-0 (the-as collide-sticky-rider #f))) (cond ((< (-> this num-riders) (-> this allocated-riders)) @@ -168,7 +168,7 @@ ) ;; definition for method 35 of type collide-shape -(defmethod detect-riders! collide-shape ((this collide-shape)) +(defmethod detect-riders! ((this collide-shape)) (let ((s5-0 (-> this riders))) (when s5-0 (let* ((v1-0 *collide-mesh-cache*) @@ -368,7 +368,7 @@ ) ;; definition for method 44 of type collide-shape -(defmethod pull-riders! collide-shape ((this collide-shape)) +(defmethod pull-riders! ((this collide-shape)) (let ((s5-0 (-> this riders))) (when s5-0 (let ((s4-0 (new 'stack-no-clear 'pull-rider-info))) @@ -405,7 +405,7 @@ ;; definition for method 43 of type collide-shape ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod pull-rider! collide-shape ((this collide-shape) (arg0 pull-rider-info)) +(defmethod pull-rider! ((this collide-shape) (arg0 pull-rider-info)) (local-vars (at-0 int) (sv-160 (function collide-shape-moving float collide-kind none))) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -481,7 +481,7 @@ ;; definition for method 29 of type collide-shape ;; INFO: Return type mismatch object vs none. -(defmethod alloc-riders collide-shape ((this collide-shape) (arg0 int)) +(defmethod alloc-riders ((this collide-shape) (arg0 int)) (if (-> this riders) (format 0 "ERROR: colide-shape::alloc-riders is being called multiple times!~%") (set! (-> this riders) (new 'process 'collide-sticky-rider-group arg0)) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-target-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-target-h_REF.gc index 30801379faa..9837646992e 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-target-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-target-h_REF.gc @@ -3,27 +3,24 @@ ;; definition of type collide-history (deftype collide-history (structure) - ((intersect vector :inline :offset-assert 0) - (trans vector :inline :offset-assert 16) - (transv vector :inline :offset-assert 32) - (transv-out vector :inline :offset-assert 48) - (local-normal vector :inline :offset-assert 64) - (surface-normal vector :inline :offset-assert 80) - (time time-frame :offset-assert 96) - (status cshape-moving-flags :offset-assert 104) - (pat pat-surface :offset-assert 112) - (reaction-flag cshape-reaction-flags :offset-assert 116) + ((intersect vector :inline) + (trans vector :inline) + (transv vector :inline) + (transv-out vector :inline) + (local-normal vector :inline) + (surface-normal vector :inline) + (time time-frame) + (status cshape-moving-flags) + (pat pat-surface) + (reaction-flag cshape-reaction-flags) ) - :method-count-assert 10 - :size-assert #x78 - :flag-assert #xa00000078 (:methods - (update! (_type_ collide-shape-moving vector vector vector) _type_ 9) + (update! (_type_ collide-shape-moving vector vector vector) _type_) ) ) ;; definition for method 3 of type collide-history -(defmethod inspect collide-history ((this collide-history)) +(defmethod inspect ((this collide-history)) (format #t "[~8x] ~A~%" this 'collide-history) (format #t "~Tintersect: ~`vector`P~%" (-> this intersect)) (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) @@ -40,175 +37,172 @@ ;; definition of type control-info (deftype control-info (collide-shape-moving) - ((unknown-vector00 vector :inline :offset 448) - (unknown-vector01 vector :inline :offset 464) - (unknown-vector02 vector :inline :offset 480) - (unknown-quaternion00 quaternion :inline :offset 496) - (unknown-quaternion01 quaternion :inline :offset 512) - (unknown-float00 float :offset 528) - (unknown-float01 float :offset 532) - (unknown-float02 float :offset 536) - (unknown-vector10 vector :inline :offset 544) - (unknown-vector11 vector :inline :offset 560) - (unknown-vector12 vector :inline :offset 576) - (unknown-vector13 vector :inline :offset 592) - (unknown-vector14 vector :inline :offset 608) - (unknown-vector15 vector :inline :offset 624) - (unknown-vector16 vector :inline :offset 640) - (unknown-dynamics00 dynamics :offset 656) - (unknown-surface00 surface :offset 660) - (unknown-surface01 surface :offset 664) - (unknown-cpad-info00 cpad-info :offset 668) - (unknown-float10 float :offset 672) - (unknown-float11 float :offset 676) - (unknown-float12 float :offset 680) - (unknown-float13 float :offset 684) - (unknown-vector20 vector :inline :offset 688) - (unknown-vector21 vector :inline :offset 704) - (unknown-vector22 vector :inline :offset 720) - (unknown-vector23 vector :inline :offset 736) - (unknown-vector-array00 vector 7 :inline :offset 752) - (unknown-vector30 vector :inline :offset 880) - (unknown-vector31 vector :inline :offset 896) - (unknown-float20 float :offset 912) - (unknown-float21 float :offset 916) - (unknown-dword00 uint64 :offset 920) - (unknown-matrix00 matrix :inline :offset 928) - (unknown-matrix01 matrix :inline :offset 992) - (unknown-matrix02 matrix :inline :offset 1056) - (unknown-qword00 uint128 :offset 1136) - (unknown-float30 float :offset 1140) - (unknown-vector40 vector :inline :offset 1152) - (unknown-float40 float :offset 1172) - (unknown-float41 float :offset 1176) - (unknown-int00 int32 :offset 1180) - (unknown-float50 float :offset 1168) - (unknown-vector50 vector :inline :offset 1184) - (unknown-vector51 vector :inline :offset 1200) - (unknown-vector52 vector :inline :offset 1216) - (unknown-vector53 vector :inline :offset 1232) - (last-known-safe-ground vector :inline :offset 1248) - (unknown-vector55 vector :inline :offset 1264) - (unknown-dword10 time-frame :offset 1280) - (unknown-dword11 time-frame :offset 1288) - (unknown-float60 float :offset 1300) - (unknown-float61 float :offset 1304) - (unknown-float62 float :offset 1308) - (unknown-float63 float :offset 1312) - (unknown-float64 float :offset 1316) - (unknown-dword20 time-frame :offset 1320) - (unknown-dword21 time-frame :offset 1328) - (unknown-dword-coverage int64 :offset 1336) - (unknown-float-coverage-0 float :offset 1344) - (unknown-float-coverage-1 float :offset 1348) - (unknown-float-coverage-2 float :offset 1352) - (unknown-u32-coverage-0 uint32 :offset 1356) - (unknown-vector-coverage-0 vector :inline :offset 1376) - (unknown-vector-coverage-1 vector :inline :offset 1392) - (unknown-vector-coverage-2 vector :inline :offset 1440) - (unknown-vector-coverage-3 vector :inline :offset 1472) - (unknown-vector60 vector :inline :offset 1456) - (unknown-vector61 vector :inline :offset 1504) - (unknown-float70 float :offset 1520) - (unknown-float71 float :offset 1524) - (unknown-vector70 vector :inline :offset 1536) - (unknown-vector71 vector :inline :offset 1552) - (unknown-vector72 vector :inline :offset 1568) - (unknown-vector73 vector :inline :offset 1584) - (unknown-handle00 handle :offset 1600) - (unknown-sphere-array00 collide-shape-prim-sphere 3 :offset 1608) - (unknown-sphere00 collide-shape-prim-sphere :offset 1632) - (unknown-sphere01 collide-shape-prim-sphere :offset 1636) - (unknown-sphere02 collide-shape-prim-sphere :offset 1640) - (unknown-int50 int32 :offset 1656) - (unknown-dword30 time-frame :offset 1664) - (unknown-dword31 time-frame :offset 1672) - (unknown-dword32 time-frame :offset 1680) - (unknown-dword33 time-frame :offset 1688) - (unknown-dword34 time-frame :offset 1696) - (unknown-dword35 time-frame :offset 1704) - (unknown-dword36 time-frame :offset 1712) - (unknown-float80 float :offset 1724) - (unknown-float81 float :offset 1728) - (unknown-float82 float :offset 1732) - (unknown-vector80 vector :inline :offset 1744) - (unknown-cspace00 cspace :inline :offset 1760) - (unknown-vector90 vector :inline :offset 1776) - (unknown-vector91 vector :inline :offset 1792) - (unknown-vector92 vector :inline :offset 1824) - (unknown-cspace10 cspace :inline :offset 1808) - (unknown-symbol00 symbol :offset 1840) - (unknown-float90 float :offset 1844) - (unknown-float91 float :offset 1848) - (unknown-vector-array10 vector 16 :inline :offset 1856) - (unknown-float100 float :offset 2112) - (unknown-int10 int32 :offset 2116) - (unknown-float110 float :offset 2120) - (unknown-vector100 vector :inline :offset 2128) - (unknown-vector101 vector :inline :offset 2144) - (unknown-dword40 time-frame :offset 2160) - (unknown-dword41 time-frame :offset 2168) - (unknown-handle10 handle :offset 2176) - (unknown-uint20 uint32 :offset 2184) - (unknown-spoolanim00 spool-anim :offset 2184) - (unknown-int20 int32 :offset 2184) - (unknown-symbol20 symbol :offset 2184) - (unknown-float120 float :offset 2184) - (unknown-int21 int32 :offset 2188) - (unknown-uint30 uint32 :offset 2188) - (unknown-float121 float :offset 2188) - (unknown-uint31 uint32 :offset 2192) - (unknown-int37 int32 :offset 2192) - (unknown-float122 float :offset 2196) - (unknown-float123 float :offset 2200) - (unknown-float124 float :offset 2204) - (unknown-vector102 vector :inline :offset 2224) - (unknown-vector103 vector :inline :offset 2240) - (unknown-quaternion02 quaternion :inline :offset 2256) - (unknown-quaternion03 quaternion :inline :offset 2272) - (unknown-smush00 smush-control :inline :offset 2288) - (unknown-vector110 vector :inline :offset 2320) - (unknown-vector111 vector :inline :offset 2336) - (unknown-symbol30 symbol :offset 2384) - (unknown-int31 uint32 :offset 2384) - (unknown-dword50 int64 :offset 2392) - (unknown-dword51 int64 :offset 2400) - (unknown-pointer00 pointer :offset 2416) - (unknown-symbol40 symbol :offset 2428) - (unknown-dword60 int64 :offset 2432) - (unknown-dword61 int64 :offset 2440) - (unknown-dword62 int64 :offset 2448) - (unknown-dword63 int64 :offset 2456) - (unknown-halfword00 int16 :offset 2488) - (history-length int16 :offset 2490) - (history-data collide-history 128 :inline :offset-assert 2496) - (unknown-float140 float :offset 18944) - (unknown-dword70 time-frame :offset 18952) - (unknown-int40 int32 :offset 18880) - (unknown-dword80 time-frame :offset 18888) - (unknown-dword81 time-frame :offset 18896) - (unknown-float130 float :offset 18904) - (unknown-float131 float :offset 18908) - (unknown-dword82 time-frame :offset 18912) - (unknown-vector120 vector :inline :offset 18928) - (unknown-float150 float :offset 18944) - (unknown-vector121 vector :inline :offset 18960) - (wall-pat pat-surface :offset 18976) - (unknown-soundid00 sound-id :offset 18980) - (unknown-float141 float :offset 18984) - (unknown-soundid01 sound-id :offset 18988) - (unknown-int34 int32 :offset 18992) - (unknown-int35 int32 :offset 18996) - (unknown-int36 int32 :offset 19000) + ((unknown-vector00 vector :inline :offset 448) + (unknown-vector01 vector :inline :offset 464) + (unknown-vector02 vector :inline :offset 480) + (unknown-quaternion00 quaternion :inline :offset 496) + (unknown-quaternion01 quaternion :inline :offset 512) + (unknown-float00 float :offset 528) + (unknown-float01 float :offset 532) + (unknown-float02 float :offset 536) + (unknown-vector10 vector :inline :offset 544) + (unknown-vector11 vector :inline :offset 560) + (unknown-vector12 vector :inline :offset 576) + (unknown-vector13 vector :inline :offset 592) + (unknown-vector14 vector :inline :offset 608) + (unknown-vector15 vector :inline :offset 624) + (unknown-vector16 vector :inline :offset 640) + (unknown-dynamics00 dynamics :offset 656) + (unknown-surface00 surface :offset 660) + (unknown-surface01 surface :offset 664) + (unknown-cpad-info00 cpad-info :offset 668) + (unknown-float10 float :offset 672) + (unknown-float11 float :offset 676) + (unknown-float12 float :offset 680) + (unknown-float13 float :offset 684) + (unknown-vector20 vector :inline :offset 688) + (unknown-vector21 vector :inline :offset 704) + (unknown-vector22 vector :inline :offset 720) + (unknown-vector23 vector :inline :offset 736) + (unknown-vector-array00 vector 7 :inline :offset 752) + (unknown-vector30 vector :inline :offset 880) + (unknown-vector31 vector :inline :offset 896) + (unknown-float20 float :offset 912) + (unknown-float21 float :offset 916) + (unknown-dword00 uint64 :offset 920) + (unknown-matrix00 matrix :inline :offset 928) + (unknown-matrix01 matrix :inline :offset 992) + (unknown-matrix02 matrix :inline :offset 1056) + (unknown-qword00 uint128 :offset 1136) + (unknown-float30 float :offset 1140) + (unknown-vector40 vector :inline :offset 1152) + (unknown-float40 float :offset 1172) + (unknown-float41 float :offset 1176) + (unknown-int00 int32 :offset 1180) + (unknown-float50 float :offset 1168) + (unknown-vector50 vector :inline :offset 1184) + (unknown-vector51 vector :inline :offset 1200) + (unknown-vector52 vector :inline :offset 1216) + (unknown-vector53 vector :inline :offset 1232) + (last-known-safe-ground vector :inline :offset 1248) + (unknown-vector55 vector :inline :offset 1264) + (unknown-dword10 time-frame :offset 1280) + (unknown-dword11 time-frame :offset 1288) + (unknown-float60 float :offset 1300) + (unknown-float61 float :offset 1304) + (unknown-float62 float :offset 1308) + (unknown-float63 float :offset 1312) + (unknown-float64 float :offset 1316) + (unknown-dword20 time-frame :offset 1320) + (unknown-dword21 time-frame :offset 1328) + (unknown-dword-coverage int64 :offset 1336) + (unknown-float-coverage-0 float :offset 1344) + (unknown-float-coverage-1 float :offset 1348) + (unknown-float-coverage-2 float :offset 1352) + (unknown-u32-coverage-0 uint32 :offset 1356) + (unknown-vector-coverage-0 vector :inline :offset 1376) + (unknown-vector-coverage-1 vector :inline :offset 1392) + (unknown-vector-coverage-2 vector :inline :offset 1440) + (unknown-vector-coverage-3 vector :inline :offset 1472) + (unknown-vector60 vector :inline :offset 1456) + (unknown-vector61 vector :inline :offset 1504) + (unknown-float70 float :offset 1520) + (unknown-float71 float :offset 1524) + (unknown-vector70 vector :inline :offset 1536) + (unknown-vector71 vector :inline :offset 1552) + (unknown-vector72 vector :inline :offset 1568) + (unknown-vector73 vector :inline :offset 1584) + (unknown-handle00 handle :offset 1600) + (unknown-sphere-array00 collide-shape-prim-sphere 3 :offset 1608) + (unknown-sphere00 collide-shape-prim-sphere :offset 1632) + (unknown-sphere01 collide-shape-prim-sphere :offset 1636) + (unknown-sphere02 collide-shape-prim-sphere :offset 1640) + (unknown-int50 int32 :offset 1656) + (unknown-dword30 time-frame :offset 1664) + (unknown-dword31 time-frame :offset 1672) + (unknown-dword32 time-frame :offset 1680) + (unknown-dword33 time-frame :offset 1688) + (unknown-dword34 time-frame :offset 1696) + (unknown-dword35 time-frame :offset 1704) + (unknown-dword36 time-frame :offset 1712) + (unknown-float80 float :offset 1724) + (unknown-float81 float :offset 1728) + (unknown-float82 float :offset 1732) + (unknown-vector80 vector :inline :offset 1744) + (unknown-cspace00 cspace :inline :offset 1760) + (unknown-vector90 vector :inline :offset 1776) + (unknown-vector91 vector :inline :offset 1792) + (unknown-vector92 vector :inline :offset 1824) + (unknown-cspace10 cspace :inline :offset 1808) + (unknown-symbol00 symbol :offset 1840) + (unknown-float90 float :offset 1844) + (unknown-float91 float :offset 1848) + (unknown-vector-array10 vector 16 :inline :offset 1856) + (unknown-float100 float :offset 2112) + (unknown-int10 int32 :offset 2116) + (unknown-float110 float :offset 2120) + (unknown-vector100 vector :inline :offset 2128) + (unknown-vector101 vector :inline :offset 2144) + (unknown-dword40 time-frame :offset 2160) + (unknown-dword41 time-frame :offset 2168) + (unknown-handle10 handle :offset 2176) + (unknown-uint20 uint32 :offset 2184) + (unknown-spoolanim00 spool-anim :overlay-at unknown-uint20) + (unknown-int20 int32 :overlay-at unknown-spoolanim00) + (unknown-symbol20 symbol :overlay-at unknown-int20) + (unknown-float120 float :overlay-at unknown-symbol20) + (unknown-int21 int32 :offset 2188) + (unknown-uint30 uint32 :overlay-at unknown-int21) + (unknown-float121 float :overlay-at unknown-uint30) + (unknown-uint31 uint32 :offset 2192) + (unknown-int37 int32 :overlay-at unknown-uint31) + (unknown-float122 float :offset 2196) + (unknown-float123 float :offset 2200) + (unknown-float124 float :offset 2204) + (unknown-vector102 vector :inline :offset 2224) + (unknown-vector103 vector :inline :offset 2240) + (unknown-quaternion02 quaternion :inline :offset 2256) + (unknown-quaternion03 quaternion :inline :offset 2272) + (unknown-smush00 smush-control :inline :offset 2288) + (unknown-vector110 vector :inline :offset 2320) + (unknown-vector111 vector :inline :offset 2336) + (unknown-symbol30 symbol :offset 2384) + (unknown-int31 uint32 :overlay-at unknown-symbol30) + (unknown-dword50 int64 :offset 2392) + (unknown-dword51 int64 :offset 2400) + (unknown-pointer00 pointer :offset 2416) + (unknown-symbol40 symbol :offset 2428) + (unknown-dword60 int64 :offset 2432) + (unknown-dword61 int64 :offset 2440) + (unknown-dword62 int64 :offset 2448) + (unknown-dword63 int64 :offset 2456) + (unknown-halfword00 int16 :offset 2488) + (history-length int16 :offset 2490) + (history-data collide-history 128 :inline) + (unknown-float140 float :offset 18944) + (unknown-dword70 time-frame :offset 18952) + (unknown-int40 int32 :offset 18880) + (unknown-dword80 time-frame :offset 18888) + (unknown-dword81 time-frame :offset 18896) + (unknown-float130 float :offset 18904) + (unknown-float131 float :offset 18908) + (unknown-dword82 time-frame :offset 18912) + (unknown-vector120 vector :inline :offset 18928) + (unknown-float150 float :overlay-at unknown-float140) + (unknown-vector121 vector :inline :offset 18960) + (wall-pat pat-surface :offset 18976) + (unknown-soundid00 sound-id :offset 18980) + (unknown-float141 float :offset 18984) + (unknown-soundid01 sound-id :offset 18988) + (unknown-int34 int32 :offset 18992) + (unknown-int35 int32 :offset 18996) + (unknown-int36 int32 :offset 19000) ) - :method-count-assert 65 - :size-assert #x4a3c - :flag-assert #x4100004a3c ) ;; definition for method 9 of type collide-history ;; INFO: Used lq/sq -(defmethod update! collide-history ((this collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector)) +(defmethod update! ((this collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector)) (set! (-> this intersect quad) (-> xs quad)) (set! (-> this transv quad) (-> transv quad)) (set! (-> this transv-out quad) (-> transv-out quad)) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-touch-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-touch-h_REF.gc index fd904555000..f3942dc2d36 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-touch-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-touch-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type touching-prim (deftype touching-prim (structure) - ((cprim collide-shape-prim :offset-assert 0) - (has-tri? symbol :offset-assert 4) - (tri collide-tri-result :inline :offset-assert 16) + ((cprim collide-shape-prim) + (has-tri? symbol) + (tri collide-tri-result :inline) ) - :method-count-assert 9 - :size-assert #x64 - :flag-assert #x900000064 ) ;; definition for method 3 of type touching-prim -(defmethod inspect touching-prim ((this touching-prim)) +(defmethod inspect ((this touching-prim)) (format #t "[~8x] ~A~%" this 'touching-prim) (format #t "~Tcprim: ~A~%" (-> this cprim)) (format #t "~Thas-tri?: ~A~%" (-> this has-tri?)) @@ -23,26 +20,23 @@ ;; definition of type touching-prims-entry (deftype touching-prims-entry (structure) - ((next touching-prims-entry :offset-assert 0) - (prev touching-prims-entry :offset-assert 4) - (allocated? symbol :offset-assert 8) - (u float :offset-assert 12) - (prim1 touching-prim :inline :offset-assert 16) - (prim2 touching-prim :inline :offset-assert 128) + ((next touching-prims-entry) + (prev touching-prims-entry) + (allocated? symbol) + (u float) + (prim1 touching-prim :inline) + (prim2 touching-prim :inline) ) - :method-count-assert 13 - :size-assert #xe4 - :flag-assert #xd000000e4 (:methods - (get-touched-prim (_type_ trsqv touching-shapes-entry) collide-shape-prim 9) - (touching-prims-entry-method-10 () none 10) - (get-middle-of-bsphere-overlap (_type_ vector) vector 11) - (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result 12) + (get-touched-prim (_type_ trsqv touching-shapes-entry) collide-shape-prim) + (touching-prims-entry-method-10 () none) + (get-middle-of-bsphere-overlap (_type_ vector) vector) + (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result) ) ) ;; definition for method 3 of type touching-prims-entry -(defmethod inspect touching-prims-entry ((this touching-prims-entry)) +(defmethod inspect ((this touching-prims-entry)) (format #t "[~8x] ~A~%" this 'touching-prims-entry) (format #t "~Tnext: #~%" (-> this next)) (format #t "~Tprev: #~%" (-> this prev)) @@ -55,23 +49,20 @@ ;; definition of type touching-prims-entry-pool (deftype touching-prims-entry-pool (structure) - ((head touching-prims-entry :offset-assert 0) - (nodes touching-prims-entry 64 :inline :offset-assert 16) + ((head touching-prims-entry) + (nodes touching-prims-entry 64 :inline) ) - :method-count-assert 13 - :size-assert #x3c10 - :flag-assert #xd00003c10 (:methods - (new (symbol type) _type_ 0) - (alloc-node (_type_) touching-prims-entry 9) - (get-free-node-count (_type_) int 10) - (init-list! (_type_) none 11) - (free-node (_type_ touching-prims-entry) touching-prims-entry 12) + (new (symbol type) _type_) + (alloc-node (_type_) touching-prims-entry) + (get-free-node-count (_type_) int) + (init-list! (_type_) none) + (free-node (_type_ touching-prims-entry) touching-prims-entry) ) ) ;; definition for method 3 of type touching-prims-entry-pool -(defmethod inspect touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod inspect ((this touching-prims-entry-pool)) (format #t "[~8x] ~A~%" this 'touching-prims-entry-pool) (format #t "~Thead: #~%" (-> this head)) (format #t "~Tnodes[64] @ #x~X~%" (-> this nodes)) @@ -80,7 +71,7 @@ ;; definition for method 11 of type touching-prims-entry-pool ;; INFO: Return type mismatch symbol vs none. -(defmethod init-list! touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod init-list! ((this touching-prims-entry-pool)) (let ((prev (the-as touching-prims-entry #f))) (let ((current (the-as touching-prims-entry (-> this nodes)))) (set! (-> this head) current) @@ -115,30 +106,27 @@ ;; definition of type touching-shapes-entry (deftype touching-shapes-entry (structure) - ((cshape1 collide-shape :offset-assert 0) - (cshape2 collide-shape :offset-assert 4) - (resolve-u int8 :offset-assert 8) - (head touching-prims-entry :offset-assert 12) + ((cshape1 collide-shape) + (cshape2 collide-shape) + (resolve-u int8) + (head touching-prims-entry) ) :allow-misaligned - :method-count-assert 18 - :size-assert #x10 - :flag-assert #x1200000010 (:methods - (touching-shapes-entry-method-9 (_type_) none 9) - (get-touched-shape (_type_ collide-shape) collide-shape 10) - (touching-shapes-entry-method-11 () none 11) - (prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry 12) - (prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry 13) - (touching-shapes-entry-method-14 () none 14) - (free-touching-prims-list (_type_) symbol 15) - (get-head (_type_) touching-prims-entry 16) - (get-next (_type_ touching-prims-entry) touching-prims-entry 17) + (touching-shapes-entry-method-9 (_type_) none) + (get-touched-shape (_type_ collide-shape) collide-shape) + (touching-shapes-entry-method-11 () none) + (prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry) + (prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry) + (touching-shapes-entry-method-14 () none) + (free-touching-prims-list (_type_) symbol) + (get-head (_type_) touching-prims-entry) + (get-next (_type_ touching-prims-entry) touching-prims-entry) ) ) ;; definition for method 3 of type touching-shapes-entry -(defmethod inspect touching-shapes-entry ((this touching-shapes-entry)) +(defmethod inspect ((this touching-shapes-entry)) (format #t "[~8x] ~A~%" this 'touching-shapes-entry) (format #t "~Tcshape1: ~A~%" (-> this cshape1)) (format #t "~Tcshape2: ~A~%" (-> this cshape2)) @@ -149,26 +137,23 @@ ;; definition of type touching-list (deftype touching-list (structure) - ((num-touching-shapes int32 :offset-assert 0) - (resolve-u int8 :offset-assert 4) - (touching-shapes touching-shapes-entry 32 :inline :offset-assert 8) + ((num-touching-shapes int32) + (resolve-u int8) + (touching-shapes touching-shapes-entry 32 :inline) ) - :method-count-assert 15 - :size-assert #x208 - :flag-assert #xf00000208 (:methods - (new (symbol type) _type_ 0) - (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none 9) - (touching-list-method-10 () none 10) - (update-from-step-size (_type_ float) none 11) - (send-events-for-touching-shapes (_type_) none 12) - (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry 13) - (free-all-prim-nodes (_type_) none 14) + (new (symbol type) _type_) + (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none) + (touching-list-method-10 () none) + (update-from-step-size (_type_ float) none) + (send-events-for-touching-shapes (_type_) none) + (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry) + (free-all-prim-nodes (_type_) none) ) ) ;; definition for method 3 of type touching-list -(defmethod inspect touching-list ((this touching-list)) +(defmethod inspect ((this touching-list)) (format #t "[~8x] ~A~%" this 'touching-list) (format #t "~Tnum-touching-shapes: ~D~%" (-> this num-touching-shapes)) (format #t "~Tresolve-u: ~D~%" (-> this resolve-u)) @@ -192,12 +177,12 @@ ) ;; definition for method 16 of type touching-shapes-entry -(defmethod get-head touching-shapes-entry ((this touching-shapes-entry)) +(defmethod get-head ((this touching-shapes-entry)) (-> this head) ) ;; definition for method 17 of type touching-shapes-entry -(defmethod get-next touching-shapes-entry ((this touching-shapes-entry) (arg0 touching-prims-entry)) +(defmethod get-next ((this touching-shapes-entry) (arg0 touching-prims-entry)) (-> arg0 next) ) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc index c86284463ab..c2902cf90f5 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 10 of type touching-prims-entry-pool -(defmethod get-free-node-count touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod get-free-node-count ((this touching-prims-entry-pool)) (let ((v0-0 0)) (let ((v1-0 (-> this head))) (while v1-0 @@ -18,7 +18,7 @@ ) ;; definition for method 9 of type touching-prims-entry-pool -(defmethod alloc-node touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod alloc-node ((this touching-prims-entry-pool)) (let ((gp-0 (-> this head))) (cond (gp-0 @@ -41,7 +41,7 @@ ) ;; definition for method 12 of type touching-prims-entry-pool -(defmethod free-node touching-prims-entry-pool ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) +(defmethod free-node ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) (when (-> arg0 allocated?) (set! (-> arg0 allocated?) #f) (let ((v1-1 (-> this head))) @@ -57,7 +57,7 @@ ) ;; definition for method 15 of type touching-shapes-entry -(defmethod free-touching-prims-list touching-shapes-entry ((this touching-shapes-entry)) +(defmethod free-touching-prims-list ((this touching-shapes-entry)) (when (-> this cshape1) (set! (-> this cshape1) #f) (let ((gp-0 (-> this head))) @@ -79,7 +79,7 @@ ;; definition for method 14 of type touching-list ;; INFO: Return type mismatch int vs none. -(defmethod free-all-prim-nodes touching-list ((this touching-list)) +(defmethod free-all-prim-nodes ((this touching-list)) (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) (countdown (s4-0 (-> this num-touching-shapes)) (free-touching-prims-list s5-0) @@ -94,7 +94,7 @@ ;; definition for method 13 of type touching-list ;; INFO: Return type mismatch object vs touching-shapes-entry. -(defmethod get-shapes-entry touching-list ((this touching-list) (arg0 collide-shape) (arg1 collide-shape)) +(defmethod get-shapes-entry ((this touching-list) (arg0 collide-shape) (arg1 collide-shape)) (let ((v0-0 (the-as touching-shapes-entry (-> this touching-shapes)))) (let ((v1-0 (the-as touching-shapes-entry #f))) (countdown (a3-0 (-> this num-touching-shapes)) @@ -139,16 +139,13 @@ ;; definition of type add-prims-touching-work (deftype add-prims-touching-work (structure) - ((tri1 collide-tri-result :offset-assert 0) - (tri2 collide-tri-result :offset-assert 4) + ((tri1 collide-tri-result) + (tri2 collide-tri-result) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type add-prims-touching-work -(defmethod inspect add-prims-touching-work ((this add-prims-touching-work)) +(defmethod inspect ((this add-prims-touching-work)) (format #t "[~8x] ~A~%" this 'add-prims-touching-work) (format #t "~Ttri1: #~%" (-> this tri1)) (format #t "~Ttri2: #~%" (-> this tri2)) @@ -158,13 +155,13 @@ ;; definition for method 9 of type touching-list ;; INFO: Return type mismatch int vs none. ;; WARN: Function (method 9 touching-list) has a return type of none, but the expression builder found a return statement. -(defmethod add-touching-prims touching-list ((this touching-list) - (arg0 collide-shape-prim) - (arg1 collide-shape-prim) - (arg2 float) - (arg3 collide-tri-result) - (arg4 collide-tri-result) - ) +(defmethod add-touching-prims ((this touching-list) + (arg0 collide-shape-prim) + (arg1 collide-shape-prim) + (arg2 float) + (arg3 collide-tri-result) + (arg4 collide-tri-result) + ) (let ((gp-0 (new 'stack-no-clear 'add-prims-touching-work))) (set! (-> gp-0 tri1) arg3) (set! (-> gp-0 tri2) arg4) @@ -267,7 +264,7 @@ ;; definition for method 11 of type touching-list ;; INFO: Return type mismatch int vs none. -(defmethod update-from-step-size touching-list ((this touching-list) (arg0 float)) +(defmethod update-from-step-size ((this touching-list) (arg0 float)) (when (nonzero? (-> this resolve-u)) (set! (-> this resolve-u) 0) (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) @@ -328,7 +325,7 @@ ;; definition for method 12 of type touching-list ;; INFO: Return type mismatch int vs none. -(defmethod send-events-for-touching-shapes touching-list ((this touching-list)) +(defmethod send-events-for-touching-shapes ((this touching-list)) (let ((entry (the-as touching-shapes-entry (-> this touching-shapes)))) (countdown (i (-> this num-touching-shapes)) (let ((c1 (-> entry cshape1))) @@ -371,7 +368,7 @@ ) ;; definition for method 12 of type touching-shapes-entry -(defmethod prims-touching? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape-moving) (arg1 uint)) +(defmethod prims-touching? ((this touching-shapes-entry) (arg0 collide-shape-moving) (arg1 uint)) (cond ((= (-> this cshape1) arg0) (let ((v1-1 (-> this head))) @@ -401,7 +398,7 @@ ) ;; definition for method 13 of type touching-shapes-entry -(defmethod prims-touching-action? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) +(defmethod prims-touching-action? ((this touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) (cond ((= (-> this cshape1) arg0) (let ((v1-1 (-> this head))) @@ -435,7 +432,7 @@ ) ;; definition for method 10 of type touching-shapes-entry -(defmethod get-touched-shape touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape)) +(defmethod get-touched-shape ((this touching-shapes-entry) (arg0 collide-shape)) (cond ((= (-> this cshape1) arg0) (return (-> this cshape2)) @@ -448,7 +445,7 @@ ) ;; definition for method 9 of type touching-prims-entry -(defmethod get-touched-prim touching-prims-entry ((this touching-prims-entry) (arg0 trsqv) (arg1 touching-shapes-entry)) +(defmethod get-touched-prim ((this touching-prims-entry) (arg0 trsqv) (arg1 touching-shapes-entry)) (cond ((= (-> arg1 cshape1) arg0) (return (-> this prim1 cprim)) @@ -461,7 +458,7 @@ ) ;; definition for method 12 of type touching-prims-entry -(defmethod get-touched-tri touching-prims-entry ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) +(defmethod get-touched-tri ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) (let ((v0-0 (the-as collide-tri-result #f))) (cond ((= (-> arg1 cshape1) arg0) @@ -484,7 +481,7 @@ ) ;; definition for method 11 of type touching-prims-entry -(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((this touching-prims-entry) (arg0 vector)) +(defmethod get-middle-of-bsphere-overlap ((this touching-prims-entry) (arg0 vector)) (let* ((s4-0 (-> this prim1 cprim)) (s3-0 (-> this prim2 cprim)) (gp-1 (vector-! diff --git a/test/decompiler/reference/jak1/engine/collide/pat-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/pat-h_REF.gc index ab8fc3dbf6b..02ffa85c1c0 100644 --- a/test/decompiler/reference/jak1/engine/collide/pat-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/pat-h_REF.gc @@ -14,13 +14,10 @@ (nolineofsight uint8 :offset 12 :size 1) (unknown-bit uint8 :offset 15 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type pat-surface -(defmethod inspect pat-surface ((this pat-surface)) +(defmethod inspect ((this pat-surface)) (format #t "[~8x] ~A~%" this 'pat-surface) (format #t "~Tskip: ~D~%" (-> this skip)) (format #t "~Tmode: ~D~%" (-> this mode)) @@ -162,18 +159,15 @@ ;; definition of type pat-mode-info (deftype pat-mode-info (structure) - ((name string :offset-assert 0) - (wall-angle float :offset-assert 4) - (color rgba :offset-assert 8) - (hilite-color rgba :offset-assert 12) + ((name string) + (wall-angle float) + (color rgba) + (hilite-color rgba) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type pat-mode-info -(defmethod inspect pat-mode-info ((this pat-mode-info)) +(defmethod inspect ((this pat-mode-info)) (format #t "[~8x] ~A~%" this 'pat-mode-info) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Twall-angle: ~f~%" (-> this wall-angle)) diff --git a/test/decompiler/reference/jak1/engine/collide/surface-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/surface-h_REF.gc index dc4faa2b7e7..b89eb85233d 100644 --- a/test/decompiler/reference/jak1/engine/collide/surface-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/surface-h_REF.gc @@ -3,46 +3,43 @@ ;; definition of type surface (deftype surface (basic) - ((name symbol :offset-assert 4) - (turnv float :offset-assert 8) - (turnvv float :offset-assert 12) - (tiltv float :offset-assert 16) - (tiltvv float :offset-assert 20) - (transv-max float :offset-assert 24) - (target-speed float :offset-assert 28) - (seek0 float :offset-assert 32) - (seek90 float :offset-assert 36) - (seek180 float :offset-assert 40) - (fric float :offset-assert 44) - (nonlin-fric-dist float :offset-assert 48) - (slip-factor float :offset-assert 52) - (slide-factor float :offset-assert 56) - (slope-up-factor float :offset-assert 60) - (slope-down-factor float :offset-assert 64) - (slope-slip-angle float :offset-assert 68) - (impact-fric float :offset-assert 72) - (bend-factor float :offset-assert 76) - (bend-speed float :offset-assert 80) - (alignv float :offset-assert 84) - (slope-up-traction float :offset-assert 88) - (align-speed float :offset-assert 92) - (active-hook (function none) :offset 128) - (touch-hook (function none) :offset-assert 132) - (impact-hook function :offset-assert 136) - (mult-hook (function surface surface surface int none) :offset-assert 140) - (mode symbol :offset-assert 144) - (flags surface-flags :offset-assert 148) - (data float 30 :offset 8) - (hook function 4 :offset 128) - (dataw uint32 2 :offset 144) + ((name symbol) + (turnv float) + (turnvv float) + (tiltv float) + (tiltvv float) + (transv-max float) + (target-speed float) + (seek0 float) + (seek90 float) + (seek180 float) + (fric float) + (nonlin-fric-dist float) + (slip-factor float) + (slide-factor float) + (slope-up-factor float) + (slope-down-factor float) + (slope-slip-angle float) + (impact-fric float) + (bend-factor float) + (bend-speed float) + (alignv float) + (slope-up-traction float) + (align-speed float) + (active-hook (function none) :offset 128) + (touch-hook (function none)) + (impact-hook function) + (mult-hook (function surface surface surface int none)) + (mode symbol) + (flags surface-flags) + (data float 30 :overlay-at turnv) + (hook function 4 :overlay-at active-hook) + (dataw uint32 2 :overlay-at mode) ) - :method-count-assert 9 - :size-assert #x98 - :flag-assert #x900000098 ) ;; definition for method 3 of type surface -(defmethod inspect surface ((this surface)) +(defmethod inspect ((this surface)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tdata[30] @ #x~X~%" (&-> this turnv)) @@ -99,7 +96,7 @@ ) ;; definition for method 2 of type surface -(defmethod print surface ((this surface)) +(defmethod print ((this surface)) (format #t "# s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -299,7 +295,7 @@ ;; definition for method 48 of type babak ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 babak ((this babak)) +(defmethod nav-enemy-method-48 ((this babak)) (initialize-skeleton this *babak-sg* '()) (init-defaults! this *babak-nav-enemy-info*) (set! (-> this neck up) (the-as uint 0)) @@ -311,7 +307,7 @@ ;; definition for method 59 of type babak ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-59 babak ((this babak)) +(defmethod nav-enemy-method-59 ((this babak)) (cond ((and (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (logtest? (-> this enemy-info options) (fact-options has-power-cell)) diff --git a/test/decompiler/reference/jak1/engine/common-obs/basebutton_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/basebutton_REF.gc index 690469502f6..2ca2108695d 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/basebutton_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/basebutton_REF.gc @@ -3,43 +3,41 @@ ;; definition of type basebutton (deftype basebutton (process-drawable) - ((root-override collide-shape-moving :offset 112) - (down? symbol :offset-assert 176) - (spawned-by-other? symbol :offset-assert 180) - (move-to? symbol :offset-assert 184) - (notify-actor entity-actor :offset-assert 188) - (timeout float :offset-assert 192) - (button-id int32 :offset-assert 196) - (event-going-down symbol :offset-assert 200) - (event-down symbol :offset-assert 204) - (event-going-up symbol :offset-assert 208) - (event-up symbol :offset-assert 212) - (anim-speed float :offset-assert 216) - (move-to-pos vector :inline :offset-assert 224) - (move-to-quat quaternion :inline :offset-assert 240) + ((root collide-shape-moving :override) + (down? symbol) + (spawned-by-other? symbol) + (move-to? symbol) + (notify-actor entity-actor) + (timeout float) + (button-id int32) + (event-going-down symbol) + (event-down symbol) + (event-going-up symbol) + (event-up symbol) + (anim-speed float) + (move-to-pos vector :inline) + (move-to-quat quaternion :inline) ) - :heap-base #x90 - :method-count-assert 32 - :size-assert #x100 - :flag-assert #x2000900100 + (:state-methods + basebutton-down-idle + basebutton-going-down + basebutton-going-up + basebutton-startup + basebutton-up-idle + ) (:methods - (basebutton-down-idle () _type_ :state 20) - (basebutton-going-down () _type_ :state 21) - (basebutton-going-up () _type_ :state 22) - (basebutton-startup () _type_ :state 23) - (basebutton-up-idle () _type_ :state 24) - (reset! (_type_) float 25) - (basebutton-method-26 (_type_) none 26) - (basebutton-method-27 (_type_) collide-shape-moving 27) - (arm-trigger-event! (_type_) symbol 28) - (basebutton-method-29 (_type_ symbol entity) none 29) - (move-to-vec-or-quat! (_type_ vector quaternion) quaternion 30) - (press! (_type_ symbol) int 31) + (reset! (_type_) float) + (basebutton-method-26 (_type_) none) + (basebutton-method-27 (_type_) collide-shape-moving) + (arm-trigger-event! (_type_) symbol) + (basebutton-method-29 (_type_ symbol entity) none) + (move-to-vec-or-quat! (_type_ vector quaternion) quaternion) + (press! (_type_ symbol) int) ) ) ;; definition for method 3 of type basebutton -(defmethod inspect basebutton ((this basebutton)) +(defmethod inspect ((this basebutton)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -67,15 +65,15 @@ ;; definition for method 30 of type basebutton ;; INFO: Used lq/sq -(defmethod move-to-vec-or-quat! basebutton ((this basebutton) (arg0 vector) (arg1 quaternion)) +(defmethod move-to-vec-or-quat! ((this basebutton) (arg0 vector) (arg1 quaternion)) (set! (-> this move-to?) #t) (if arg0 (set! (-> this move-to-pos quad) (-> arg0 quad)) - (set! (-> this move-to-pos quad) (-> this root-override trans quad)) + (set! (-> this move-to-pos quad) (-> this root trans quad)) ) (if arg1 (quaternion-copy! (-> this move-to-quat) arg1) - (quaternion-copy! (-> this move-to-quat) (-> this root-override quat)) + (quaternion-copy! (-> this move-to-quat) (-> this root quat)) ) ) @@ -125,8 +123,8 @@ :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) - (set! (-> self root-override trans quad) (-> self move-to-pos quad)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (rider-post) ) ) @@ -162,8 +160,8 @@ :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) - (set! (-> self root-override trans quad) (-> self move-to-pos quad)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) ) (rider-post) ) @@ -210,8 +208,8 @@ :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) - (set! (-> self root-override trans quad) (-> self move-to-pos quad)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (rider-post) ) ) @@ -247,15 +245,15 @@ :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) - (set! (-> self root-override trans quad) (-> self move-to-pos quad)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (set! (-> self root trans quad) (-> self move-to-pos quad)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) ) (rider-post) ) ) ;; definition for method 31 of type basebutton -(defmethod press! basebutton ((this basebutton) (arg0 symbol)) +(defmethod press! ((this basebutton) (arg0 symbol)) (set! (-> this down?) arg0) (cond (arg0 @@ -273,7 +271,7 @@ ;; definition for method 29 of type basebutton ;; INFO: Return type mismatch object vs none. -(defmethod basebutton-method-29 basebutton ((this basebutton) (arg0 symbol) (arg1 entity)) +(defmethod basebutton-method-29 ((this basebutton) (arg0 symbol) (arg1 entity)) (with-pp (when arg0 (cond @@ -304,7 +302,7 @@ ) ;; definition for method 25 of type basebutton -(defmethod reset! basebutton ((this basebutton)) +(defmethod reset! ((this basebutton)) (set! (-> this down?) #f) (set! (-> this spawned-by-other?) #t) (set! (-> this move-to?) #f) @@ -318,7 +316,7 @@ ) ;; definition for method 28 of type basebutton -(defmethod arm-trigger-event! basebutton ((this basebutton)) +(defmethod arm-trigger-event! ((this basebutton)) (let ((v0-0 'trigger)) (set! (-> this event-going-down) v0-0) v0-0 @@ -326,7 +324,7 @@ ) ;; definition for method 26 of type basebutton -(defmethod basebutton-method-26 basebutton ((this basebutton)) +(defmethod basebutton-method-26 ((this basebutton)) (initialize-skeleton this *generic-button-sg* '()) (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) @@ -355,13 +353,13 @@ ) ) (set! (-> this anim-speed) 2.0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (ja-post) (none) ) ;; definition for method 27 of type basebutton -(defmethod basebutton-method-27 basebutton ((this basebutton)) +(defmethod basebutton-method-27 ((this basebutton)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -396,14 +394,14 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) ;; definition for method 11 of type basebutton ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! basebutton ((this basebutton) (arg0 entity-actor)) +(defmethod init-from-entity! ((this basebutton) (arg0 entity-actor)) (reset! this) (set! (-> this spawned-by-other?) #f) (set! (-> this button-id) -1) @@ -429,7 +427,7 @@ (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> this timeout) (res-lump-float arg0 'timeout)) (if (not (-> this spawned-by-other?)) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) ) (arm-trigger-event! this) (basebutton-method-26 this) @@ -451,9 +449,9 @@ (set! (-> self entity) arg0) ) (basebutton-method-27 self) - (set! (-> self root-override trans quad) (-> arg1 quad)) - (quaternion-copy! (-> self root-override quat) arg2) - (set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0) + (set! (-> self root trans quad) (-> arg1 quad)) + (quaternion-copy! (-> self root quat) arg2) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (arm-trigger-event! self) (basebutton-method-26 self) (go-virtual basebutton-startup) @@ -472,25 +470,21 @@ ;; definition of type warp-gate (deftype warp-gate (process-drawable) - ((level symbol :offset-assert 176) - (level-slot int32 :offset-assert 180) - (min-slot int32 :offset-assert 184) - (max-slot int32 :offset-assert 188) + ((level symbol) + (level-slot int32) + (min-slot int32) + (max-slot int32) ) - :heap-base #x50 - :method-count-assert 24 - :size-assert #xc0 - :flag-assert #x18005000c0 - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (use (int level) _type_ :state 22) - (hidden () _type_ :state 23) + (:state-methods + idle + active + (use int level) + hidden ) ) ;; definition for method 3 of type warp-gate -(defmethod inspect warp-gate ((this warp-gate)) +(defmethod inspect ((this warp-gate)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/baseplat_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/baseplat_REF.gc index 11e63f4867d..68c692c15c5 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/baseplat_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/baseplat_REF.gc @@ -3,28 +3,24 @@ ;; definition of type baseplat (deftype baseplat (process-drawable) - ((root-override collide-shape-moving :offset 112) - (smush smush-control :inline :offset-assert 176) - (basetrans vector :inline :offset-assert 208) - (bouncing symbol :offset-assert 224) + ((root collide-shape-moving :override) + (smush smush-control :inline) + (basetrans vector :inline) + (bouncing symbol) ) - :heap-base #x80 - :method-count-assert 27 - :size-assert #xe4 - :flag-assert #x1b008000e4 (:methods - (baseplat-method-20 (_type_) none 20) - (baseplat-method-21 (_type_) none 21) - (baseplat-method-22 (_type_) none 22) - (get-unlit-skel (_type_) skeleton-group 23) - (baseplat-method-24 (_type_) none 24) - (baseplat-method-25 (_type_) sparticle-launch-group 25) - (baseplat-method-26 (_type_) none 26) + (baseplat-method-20 (_type_) none) + (baseplat-method-21 (_type_) none) + (baseplat-method-22 (_type_) none) + (get-unlit-skel (_type_) skeleton-group) + (baseplat-method-24 (_type_) none) + (baseplat-method-25 (_type_) sparticle-launch-group) + (baseplat-method-26 (_type_) none) ) ) ;; definition for method 3 of type baseplat -(defmethod inspect baseplat ((this baseplat)) +(defmethod inspect ((this baseplat)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -37,9 +33,9 @@ ;; definition for method 21 of type baseplat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-21 baseplat ((this baseplat)) +(defmethod baseplat-method-21 ((this baseplat)) (logior! (-> this skel status) (janim-status inited)) - (set! (-> this basetrans quad) (-> this root-override trans quad)) + (set! (-> this basetrans quad) (-> this root trans quad)) (set! (-> this bouncing) #f) 0 (none) @@ -47,7 +43,7 @@ ;; definition for method 22 of type baseplat ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-22 baseplat ((this baseplat)) +(defmethod baseplat-method-22 ((this baseplat)) (activate! (-> this smush) -1.0 60 150 1.0 1.0) (set! (-> this bouncing) #t) (logclear! (-> this mask) (process-mask sleep)) @@ -84,14 +80,14 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self basetrans quad)) (+! (-> gp-0 y) (* 819.2 (update! (-> self smush)))) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) (if (not (!= (-> self smush amp) 0.0)) (set! (-> self bouncing) #f) ) ) (else - (move-to-point! (-> self root-override) (-> self basetrans)) + (move-to-point! (-> self root) (-> self basetrans)) ) ) (none) @@ -107,15 +103,15 @@ ;; definition for method 25 of type baseplat ;; INFO: Return type mismatch int vs sparticle-launch-group. -(defmethod baseplat-method-25 baseplat ((this baseplat)) +(defmethod baseplat-method-25 ((this baseplat)) (the-as sparticle-launch-group 0) ) ;; definition for method 20 of type baseplat ;; INFO: Return type mismatch object vs none. -(defmethod baseplat-method-20 baseplat ((this baseplat)) +(defmethod baseplat-method-20 ((this baseplat)) (if (nonzero? (-> this part)) - (spawn (-> this part) (-> this root-override trans)) + (spawn (-> this part) (-> this root trans)) ) (none) ) @@ -132,37 +128,35 @@ ;; definition of type eco-door (deftype eco-door (process-drawable) - ((root-override collide-shape :offset 112) - (speed float :offset-assert 176) - (open-distance float :offset-assert 180) - (close-distance float :offset-assert 184) - (out-dir vector :inline :offset-assert 192) - (open-sound sound-name :offset-assert 208) - (close-sound sound-name :offset-assert 224) - (state-actor entity-actor :offset-assert 240) - (flags eco-door-flags :offset-assert 244) - (locked symbol :offset-assert 248) - (auto-close symbol :offset-assert 252) - (one-way symbol :offset-assert 256) + ((root collide-shape :override) + (speed float) + (open-distance float) + (close-distance float) + (out-dir vector :inline) + (open-sound sound-name) + (close-sound sound-name) + (state-actor entity-actor) + (flags eco-door-flags) + (locked symbol) + (auto-close symbol) + (one-way symbol) ) - :heap-base #xa0 - :method-count-assert 27 - :size-assert #x104 - :flag-assert #x1b00a00104 + (:state-methods + door-closed + door-opening + door-open + door-closing + ) (:methods - (door-closed () _type_ :state 20) - (door-opening () _type_ :state 21) - (door-open () _type_ :state 22) - (door-closing () _type_ :state 23) - (eco-door-method-24 (_type_) none 24) - (eco-door-method-25 (_type_) none 25) - (eco-door-method-26 (_type_) none 26) + (eco-door-method-24 (_type_) none) + (eco-door-method-25 (_type_) none) + (eco-door-method-26 (_type_) none) ) ) ;; definition for method 3 of type eco-door ;; INFO: Used lq/sq -(defmethod inspect eco-door ((this eco-door)) +(defmethod inspect ((this eco-door)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -211,12 +205,11 @@ eco-door-event-handler :code (behavior () (ja :num-func num-func-identity :frame-num 0.0) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (ja-post) (loop - (when (and *target* (>= (-> self open-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (when (and *target* + (>= (-> self open-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (eco-door-method-26 self) (if (and (not (-> self locked)) @@ -246,10 +239,10 @@ eco-door-event-handler ) ) (if gp-0 - (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root trans))) ) (sound-play-by-name (-> self open-sound) (new-sound-id) 1024 0 0 (sound-group sfx) #t) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (until (ja-done? 0) (ja :num! (seek! max (-> self speed))) (if (and gp-0 (rand-vu-percent? 0.5)) @@ -270,20 +263,19 @@ eco-door-event-handler :code (behavior () (set-time! (-> self state-time)) (process-entity-status! self (entity-perm-status complete) #t) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja :num-func num-func-identity :frame-num max) (logior! (-> self draw status) (draw-status hidden)) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (ja-post) (loop (let ((f30-0 (vector4-dot (-> self out-dir) (target-pos 0))) (f28-0 (vector4-dot (-> self out-dir) (camera-pos))) ) (when (and (-> self auto-close) - (or (not *target*) (< (-> self close-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (or (not *target*) + (< (-> self close-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) ) (if (and (>= (* f30-0 f28-0) 0.0) (< 16384.0 (fabs f28-0))) @@ -301,12 +293,12 @@ eco-door-event-handler :virtual #t :event eco-door-event-handler :code (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (logclear! (-> self draw status) (draw-status hidden)) (let ((gp-0 (new 'stack 'overlaps-others-params))) (set! (-> gp-0 options) (the-as uint 1)) (set! (-> gp-0 tlist) #f) - (while (find-overlapping-shapes (-> self root-override) gp-0) + (while (find-overlapping-shapes (-> self root) gp-0) (suspend) ) ) @@ -325,7 +317,7 @@ eco-door-event-handler ;; definition for method 26 of type eco-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-26 eco-door ((this eco-door)) +(defmethod eco-door-method-26 ((this eco-door)) (when (-> this state-actor) (if (logtest? (-> this state-actor extra perm status) (entity-perm-status complete)) (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf01))) @@ -338,7 +330,7 @@ eco-door-event-handler ;; definition for method 24 of type eco-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-24 eco-door ((this eco-door)) +(defmethod eco-door-method-24 ((this eco-door)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -351,7 +343,7 @@ eco-door-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -359,18 +351,18 @@ eco-door-event-handler ;; definition for method 25 of type eco-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-25 eco-door ((this eco-door)) +(defmethod eco-door-method-25 ((this eco-door)) 0 (none) ) ;; definition for method 11 of type eco-door ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! eco-door ((this eco-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-door) (arg0 entity-actor)) (eco-door-method-24 this) (process-drawable-from-entity! this arg0) (let ((f0-0 (res-lump-float (-> this entity) 'scale :default 1.0))) - (set-vector! (-> this root-override scale) f0-0 f0-0 f0-0 1.0) + (set-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0) ) (set! (-> this open-distance) 32768.0) (set! (-> this close-distance) 49152.0) @@ -386,9 +378,9 @@ eco-door-event-handler (eco-door-method-26 this) (set! (-> this auto-close) (logtest? (-> this flags) (eco-door-flags auto-close))) (set! (-> this one-way) (logtest? (-> this flags) (eco-door-flags one-way))) - (vector-z-quaternion! (-> this out-dir) (-> this root-override quat)) - (set! (-> this out-dir w) (- (vector-dot (-> this out-dir) (-> this root-override trans)))) - (update-transforms! (-> this root-override)) + (vector-z-quaternion! (-> this out-dir) (-> this root quat)) + (set! (-> this out-dir w) (- (vector-dot (-> this out-dir) (-> this root trans)))) + (update-transforms! (-> this root)) (eco-door-method-25 this) (if (and (not (-> this auto-close)) (-> this entity) diff --git a/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc index 4d711344dbb..5b1dbbc46a1 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc @@ -6,35 +6,31 @@ ;; definition of type collectable (deftype collectable (process-drawable) - ((root-override collide-shape-moving :offset 112) - (pickup-type pickup-type :offset-assert 176) - (pickup-amount float :offset-assert 180) - (notify-parent basic :offset-assert 184) - (old-base vector :inline :offset-assert 192) - (base vector :inline :offset-assert 208) - (extra-trans vector :inline :offset-assert 224) - (jump-pos vector :inline :offset-assert 240) - (flags collectable-flags :offset-assert 256) - (birth-time time-frame :offset-assert 264) - (collect-timeout time-frame :offset-assert 272) - (fadeout-timeout time-frame :offset-assert 280) - (bob-offset int64 :offset-assert 288) - (bob-amount float :offset-assert 296) - (pickup-handle handle :offset-assert 304) - (actor-pause symbol :offset-assert 312) + ((root collide-shape-moving :override) + (pickup-type pickup-type) + (pickup-amount float) + (notify-parent basic) + (old-base vector :inline) + (base vector :inline) + (extra-trans vector :inline) + (jump-pos vector :inline) + (flags collectable-flags) + (birth-time time-frame) + (collect-timeout time-frame) + (fadeout-timeout time-frame) + (bob-offset int64) + (bob-amount float) + (pickup-handle handle) + (actor-pause symbol) ) - :heap-base #xd0 - :method-count-assert 22 - :size-assert #x13c - :flag-assert #x1600d0013c (:methods - (initialize (_type_) _type_ 20) - (initialize-params (_type_ time-frame float) none 21) + (initialize (_type_) _type_) + (initialize-params (_type_ time-frame float) none) ) ) ;; definition for method 3 of type collectable -(defmethod inspect collectable ((this collectable)) +(defmethod inspect ((this collectable)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -59,21 +55,21 @@ ;; definition for method 21 of type collectable ;; INFO: Used lq/sq ;; INFO: Return type mismatch collectable vs none. -(defmethod initialize-params collectable ((this collectable) (arg0 time-frame) (arg1 float)) +(defmethod initialize-params ((this collectable) (arg0 time-frame) (arg1 float)) (logclear! (-> this mask) (process-mask crate enemy platform ambient)) (logior! (-> this mask) (process-mask collectable)) (set! (-> this flags) (collectable-flags can-collect ignore-blue)) (set! (-> this bob-amount) arg1) - (set! (-> this bob-offset) (+ (the-as int (-> this root-override trans x)) - (the-as int (-> this root-override trans y)) - (the-as int (-> this root-override trans z)) + (set! (-> this bob-offset) (+ (the-as int (-> this root trans x)) + (the-as int (-> this root trans y)) + (the-as int (-> this root trans z)) ) ) (cond - ((or (= (vector-length (-> this root-override transv)) 0.0) + ((or (= (vector-length (-> this root transv)) 0.0) (logtest? (-> this fact options) (fact-options instant-collect)) ) - (vector-reset! (-> this root-override transv)) + (vector-reset! (-> this root transv)) ) (else (logior! (-> this flags) (collectable-flags trans)) @@ -88,8 +84,8 @@ ) (set! (-> this collect-timeout) (seconds 0.33)) (set-time! (-> this birth-time)) - (set! (-> this base quad) (-> this root-override trans quad)) - (set! (-> this old-base quad) (-> this root-override trans quad)) + (set! (-> this base quad) (-> this root trans quad)) + (set! (-> this old-base quad) (-> this root trans quad)) (set! (-> this pickup-handle) (the-as handle #f)) (case (-> this fact pickup-type) (((pickup-type eco-pill) (pickup-type eco-green) (pickup-type money) (pickup-type eco-blue)) @@ -97,46 +93,42 @@ ) ) (if (logtest? (-> this fact options) (fact-options large)) - (set! (-> this root-override root-prim local-sphere w) - (* 2.5 (-> this root-override root-prim local-sphere w)) - ) + (set! (-> this root root-prim local-sphere w) (* 2.5 (-> this root root-prim local-sphere w))) ) (none) ) ;; definition of type eco-collectable (deftype eco-collectable (collectable) - ((eco-effect sparticle-launch-group :offset-assert 316) - (collect-effect sparticle-launch-group :offset-assert 320) - (collect-effect2 sparticle-launch-group :offset-assert 324) - (collect-effect-time time-frame :offset-assert 328) - (respawn-delay time-frame :offset-assert 336) - (sound-name sound-spec :offset-assert 344) - (target handle :offset-assert 352) - (suck-time time-frame :offset-assert 360) - (suck-y-offset float :offset-assert 368) - (speed vector :inline :offset-assert 384) - (movie-pos-index int32 :offset-assert 400) + ((eco-effect sparticle-launch-group) + (collect-effect sparticle-launch-group) + (collect-effect2 sparticle-launch-group) + (collect-effect-time time-frame) + (respawn-delay time-frame) + (sound-name sound-spec) + (target handle) + (suck-time time-frame) + (suck-y-offset float) + (speed vector :inline) + (movie-pos-index int32) ) - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 + (:state-methods + wait + (pickup object handle) + die + jump + (notice-blue handle) + ) (:methods - (wait () _type_ :state 22) - (pickup (object handle) _type_ :state 23) - (die () _type_ :state 24) - (jump () _type_ :state 25) - (notice-blue (handle) _type_ :state 26) - (initialize-effect (_type_ pickup-type) none 27) - (initialize-eco (_type_ entity-actor pickup-type float) object 28) - (animate (_type_) none 29) - (blocked () _type_ :state 30) + (initialize-effect (_type_ pickup-type) none) + (initialize-eco (_type_ entity-actor pickup-type float) object) + (animate (_type_) none) + (blocked () _type_ :state) ) ) ;; definition for method 3 of type eco-collectable -(defmethod inspect eco-collectable ((this eco-collectable)) +(defmethod inspect ((this eco-collectable)) (let ((t9-0 (method-of-type collectable inspect))) (t9-0 this) ) @@ -155,7 +147,7 @@ ) ;; definition for method 20 of type eco-collectable -(defmethod initialize eco-collectable ((this eco-collectable)) +(defmethod initialize ((this eco-collectable)) (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #t) @@ -174,7 +166,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) (if (logtest? (fact-options respawn) (-> this fact options)) @@ -185,7 +177,7 @@ ;; definition for method 27 of type eco-collectable ;; INFO: Return type mismatch ambient-sound vs none. -(defmethod initialize-effect eco-collectable ((this eco-collectable) (arg0 pickup-type)) +(defmethod initialize-effect ((this eco-collectable) (arg0 pickup-type)) (set! (-> this fact pickup-type) arg0) (case (-> this fact pickup-type) (((pickup-type eco-blue) (pickup-type eco-red) (pickup-type eco-green) (pickup-type eco-yellow)) @@ -230,7 +222,7 @@ ) (set! (-> this part) (create-launch-control (-> this eco-effect) this)) (if (-> this sound-name) - (set! (-> this sound) (new 'process 'ambient-sound (-> this sound-name) (-> this root-override trans))) + (set! (-> this sound) (new 'process 'ambient-sound (-> this sound-name) (-> this root trans))) ) (none) ) @@ -249,8 +241,8 @@ (set! (-> self fact pickup-amount) f30-0) ) (set! (-> self fact options) (-> arg2 options)) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set! (-> self root-override transv quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root transv quad) (-> arg1 quad)) (initialize-effect self (-> self fact pickup-type)) (set! (-> self notify-parent) #f) (case (-> self fact pickup-type) @@ -269,7 +261,7 @@ (initialize-params self (seconds 15) (the-as float 1024.0)) ) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (set! (-> self event-hook) (-> (method-of-object self wait) event)) (if (logtest? (fact-options eco-blocked) (-> self fact options)) (go-virtual blocked) @@ -280,14 +272,14 @@ ;; definition for method 28 of type eco-collectable ;; INFO: Used lq/sq -(defmethod initialize-eco eco-collectable ((this eco-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) +(defmethod initialize-eco ((this eco-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) (set! (-> this pickup-amount) arg2) (set! (-> this pickup-type) arg1) (initialize this) - (set! (-> this root-override trans quad) (-> arg0 extra trans quad)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) (initialize-effect this (-> this fact pickup-type)) (initialize-params this 0 (the-as float 1024.0)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (if (logtest? (fact-options eco-blocked) (-> this fact options)) (go (method-of-object this blocked)) ) @@ -296,7 +288,7 @@ ;; definition for method 29 of type eco-collectable ;; INFO: Return type mismatch int vs none. -(defmethod animate eco-collectable ((this eco-collectable)) +(defmethod animate ((this eco-collectable)) 0 (none) ) @@ -336,7 +328,7 @@ ) ) (when v1-3 - (let ((a0-5 (-> self root-override root-prim prim-core)) + (let ((a0-5 (-> self root root-prim prim-core)) (a1-2 (-> (the-as collide-shape v1-3) root-prim prim-core)) ) (if (< (vector-vector-distance (the-as vector a0-5) (the-as vector a1-2)) (-> *FACT-bank* suck-suck-dist)) @@ -366,7 +358,7 @@ ) ) (when v1-6 - (let ((s2-0 (-> self root-override root-prim prim-core)) + (let ((s2-0 (-> self root root-prim prim-core)) (gp-2 (-> v1-6 root-prim prim-core)) ) (if (and arg1 (rand-vu-percent? (the-as float 0.25))) @@ -410,7 +402,7 @@ (go-virtual wait) ) (arg1 - (add-blue-shake (-> self root-override trans) (the-as vector s2-0) (the-as vector gp-2)) + (add-blue-shake (-> self root trans) (the-as vector s2-0) (the-as vector gp-2)) ) ) ) @@ -445,7 +437,7 @@ (set! (-> self base y) (-> self jump-pos y)) (setup-from-to-duration! gp-1 - (-> self root-override trans) + (-> self root trans) (-> self jump-pos) (the-as float 300.0) (the-as float -2.2755556) @@ -453,7 +445,7 @@ (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 1)) (let ((f0-2 (the float (- (current-time) (-> self state-time))))) - (eval-position! gp-1 f0-2 (-> self root-override trans)) + (eval-position! gp-1 f0-2 (-> self root trans)) ) (transform-post) (animate self) @@ -463,10 +455,10 @@ ) ) ) - (set! (-> self root-override trans quad) (-> self jump-pos quad)) - (set! (-> self base quad) (-> self root-override trans quad)) - (vector-reset! (-> self root-override transv)) - (update-transforms! (-> self root-override)) + (set! (-> self root trans quad) (-> self jump-pos quad)) + (set! (-> self base quad) (-> self root trans quad)) + (vector-reset! (-> self root transv)) + (update-transforms! (-> self root)) (logclear! (-> self flags) (collectable-flags trans)) (logior! (-> self flags) (collectable-flags can-collect)) (if (-> self actor-pause) @@ -504,8 +496,8 @@ ) ) ((= message 'trans) - (set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad)) - (update-transforms! (-> self root-override)) + (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) + (update-transforms! (-> self root)) (ja-post) ) ((= message 'jump) @@ -516,7 +508,7 @@ ((= message 'pickup) (when (!= (-> self next-state name) 'pickup) (if (and (> argc 0) (-> block param 0)) - (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (the-as handle #f)) @@ -568,24 +560,24 @@ (cond ((logtest? (-> self flags) (collectable-flags trans)) (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) (the-as float 0.0)) + (-> self root transv) + (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) (the-as float 0.0)) ) - (integrate-no-collide! (-> self root-override) (-> self root-override transv)) - (when (and (>= 0.0 (-> self root-override transv y)) (>= (-> self base y) (-> self root-override trans y))) - (set! (-> self root-override trans y) (-> self base y)) + (integrate-no-collide! (-> self root) (-> self root transv)) + (when (and (>= 0.0 (-> self root transv y)) (>= (-> self base y) (-> self root trans y))) + (set! (-> self root trans y) (-> self base y)) (cond - ((< (-> self root-override transv y) -8192.0) - (set! (-> self root-override transv y) (* -0.5 (-> self root-override transv y))) + ((< (-> self root transv y) -8192.0) + (set! (-> self root transv y) (* -0.5 (-> self root transv y))) ) (else - (vector-reset! (-> self root-override transv)) + (vector-reset! (-> self root transv)) (logclear! (-> self flags) (collectable-flags trans)) (logior! (-> self flags) (collectable-flags can-collect)) (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) - (set! (-> self base quad) (-> self root-override trans quad)) + (set! (-> self base quad) (-> self root trans quad)) (if (and (logtest? (-> self fact options) (fact-options can-collect)) (not (logtest? (-> self flags) (collectable-flags ignore-blue))) ) @@ -605,12 +597,12 @@ (set! (-> self trans-hook) #f) ) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) ) :code (behavior () (loop (let ((gp-0 (-> self part)) - (s5-0 (-> self root-override root-prim prim-core)) + (s5-0 (-> self root root-prim prim-core)) ) (when (and (logtest? (-> self flags) (collectable-flags fade)) (time-elapsed? (-> self birth-time) (-> self fadeout-timeout)) @@ -687,14 +679,14 @@ ) :code (behavior ((arg0 handle)) (loop - (set! (-> self root-override trans quad) (-> self base quad)) + (set! (-> self root trans quad) (-> self base quad)) (add-blue-motion #t #f #t #f) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (if (nonzero? (-> self draw)) (ja-post) ) (let ((a0-5 (-> self part)) - (a1-1 (-> self root-override root-prim prim-core)) + (a1-1 (-> self root root-prim prim-core)) ) (if (nonzero? a0-5) (spawn a0-5 (the-as vector a1-1)) @@ -771,7 +763,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) ) :code (behavior ((arg0 object) (arg1 handle)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (if (not (or (= (-> self fact pickup-type) (pickup-type eco-pill)) (logtest? (-> self fact options) (fact-options powerup)) ) @@ -822,7 +814,7 @@ part-tracker-track-target #f #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to gp-6 ) ) @@ -864,7 +856,7 @@ ) (process->handle self) #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to self ) ) @@ -886,14 +878,10 @@ ;; definition of type eco (deftype eco (eco-collectable) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) ;; definition for method 3 of type eco -(defmethod inspect eco ((this eco)) +(defmethod inspect ((this eco)) (let ((t9-0 (method-of-type eco-collectable inspect))) (t9-0 this) ) @@ -902,9 +890,9 @@ ;; definition for method 29 of type eco ;; INFO: Return type mismatch int vs none. -(defmethod animate eco ((this eco)) +(defmethod animate ((this eco)) (let ((a0-1 (-> this part)) - (a1-0 (-> this root-override root-prim prim-core)) + (a1-0 (-> this root root-prim prim-core)) ) (spawn a0-1 (the-as vector a1-0)) ) @@ -959,8 +947,8 @@ ) ) (set! (-> self base quad) (-> self old-base quad)) - (set! (-> self root-override trans quad) (-> self base quad)) - (restore-collide-with-as (-> self root-override)) + (set! (-> self root trans quad) (-> self base quad)) + (restore-collide-with-as (-> self root)) (go-virtual wait) ) ) @@ -968,14 +956,10 @@ ;; definition of type eco-yellow (deftype eco-yellow (eco) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) ;; definition for method 3 of type eco-yellow -(defmethod inspect eco-yellow ((this eco-yellow)) +(defmethod inspect ((this eco-yellow)) (let ((t9-0 (method-of-type eco inspect))) (t9-0 this) ) @@ -984,7 +968,7 @@ ;; definition for method 11 of type eco-yellow ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! eco-yellow ((this eco-yellow) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -992,14 +976,10 @@ ;; definition of type eco-red (deftype eco-red (eco) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) ;; definition for method 3 of type eco-red -(defmethod inspect eco-red ((this eco-red)) +(defmethod inspect ((this eco-red)) (let ((t9-0 (method-of-type eco inspect))) (t9-0 this) ) @@ -1008,7 +988,7 @@ ;; definition for method 11 of type eco-red ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! eco-red ((this eco-red) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-red) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1016,14 +996,10 @@ ;; definition of type eco-blue (deftype eco-blue (eco) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) ;; definition for method 3 of type eco-blue -(defmethod inspect eco-blue ((this eco-blue)) +(defmethod inspect ((this eco-blue)) (let ((t9-0 (method-of-type eco inspect))) (t9-0 this) ) @@ -1032,7 +1008,7 @@ ;; definition for method 11 of type eco-blue ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! eco-blue ((this eco-blue) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1040,14 +1016,10 @@ ;; definition of type health (deftype health (eco-collectable) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) ;; definition for method 3 of type health -(defmethod inspect health ((this health)) +(defmethod inspect ((this health)) (let ((t9-0 (method-of-type eco-collectable inspect))) (t9-0 this) ) @@ -1056,9 +1028,9 @@ ;; definition for method 29 of type health ;; INFO: Return type mismatch int vs none. -(defmethod animate health ((this health)) +(defmethod animate ((this health)) (let ((a0-1 (-> this part)) - (a1-0 (-> this root-override root-prim prim-core)) + (a1-0 (-> this root root-prim prim-core)) ) (spawn a0-1 (the-as vector a1-0)) ) @@ -1071,7 +1043,7 @@ ;; definition for method 11 of type health ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! health ((this health) (arg0 entity-actor)) +(defmethod init-from-entity! ((this health) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-green) (-> *FACT-bank* health-single-inc)) (none) ) @@ -1079,14 +1051,10 @@ ;; definition of type eco-pill (deftype eco-pill (eco-collectable) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) ;; definition for method 3 of type eco-pill -(defmethod inspect eco-pill ((this eco-pill)) +(defmethod inspect ((this eco-pill)) (let ((t9-0 (method-of-type eco-collectable inspect))) (t9-0 this) ) @@ -1095,9 +1063,9 @@ ;; definition for method 29 of type eco-pill ;; INFO: Return type mismatch int vs none. -(defmethod animate eco-pill ((this eco-pill)) +(defmethod animate ((this eco-pill)) (let ((a0-1 (-> this part)) - (a1-0 (-> this root-override root-prim prim-core)) + (a1-0 (-> this root root-prim prim-core)) ) (spawn a0-1 (the-as vector a1-0)) ) @@ -1110,20 +1078,20 @@ ;; definition for method 11 of type eco-pill ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! eco-pill ((this eco-pill) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-pill) (arg0 entity-actor)) (initialize-eco this arg0 (pickup-type eco-pill) (-> *FACT-bank* health-small-inc)) (none) ) ;; definition for method 10 of type eco-pill -(defmethod deactivate eco-pill ((this eco-pill)) +(defmethod deactivate ((this eco-pill)) (set! *eco-pill-count* (+ *eco-pill-count* -1)) ((method-of-type eco-collectable deactivate) this) (none) ) ;; definition for method 20 of type eco-pill -(defmethod initialize eco-pill ((this eco-pill)) +(defmethod initialize ((this eco-pill)) (set! *eco-pill-count* (+ *eco-pill-count* 1)) (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask actor-pause)) @@ -1143,7 +1111,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) this @@ -1166,14 +1134,10 @@ ;; definition of type money (deftype money (eco-collectable) () - :heap-base #x130 - :method-count-assert 31 - :size-assert #x194 - :flag-assert #x1f01300194 ) ;; definition for method 3 of type money -(defmethod inspect money ((this money)) +(defmethod inspect ((this money)) (let ((t9-0 (method-of-type eco-collectable inspect))) (t9-0 this) ) @@ -1181,12 +1145,12 @@ ) ;; definition for method 12 of type money -(defmethod run-logic? money ((this money)) +(defmethod run-logic? ((this money)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status was-drawn)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root-override pause-adjust-distance)) - (vector-vector-distance (-> this root-override trans) (math-camera-pos)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) ) (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) @@ -1196,7 +1160,7 @@ ) ;; definition for method 10 of type money -(defmethod deactivate money ((this money)) +(defmethod deactivate ((this money)) (when (= (-> this next-state name) 'pickup) (if (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status dead)))) (format #t "money ~A was killed in pickup~%") @@ -1212,14 +1176,10 @@ :virtual #t :code (behavior () (loop - (quaternion-rotate-y! - (-> self root-override quat) - (-> self root-override quat) - (* 40049.777 (seconds-per-frame)) - ) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 40049.777 (seconds-per-frame))) (let ((f30-0 (-> self bob-amount))) (when (< 0.0 f30-0) - (set! (-> self root-override trans y) + (set! (-> self root trans y) (+ (-> self base y) (-> self suck-y-offset) (* f30-0 @@ -1227,7 +1187,7 @@ ) ) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) ) ) (ja-post) @@ -1241,16 +1201,12 @@ :virtual #t :code (behavior ((arg0 handle)) (loop - (quaternion-rotate-y! - (-> self root-override quat) - (-> self root-override quat) - (* 91022.22 (seconds-per-frame)) - ) - (set! (-> self root-override trans quad) (-> self base quad)) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 91022.22 (seconds-per-frame))) + (set! (-> self root trans quad) (-> self base quad)) (add-blue-motion #t #t #t #f) (let ((f30-0 (-> self bob-amount))) (if (< 0.0 f30-0) - (set! (-> self root-override trans y) + (set! (-> self root trans y) (+ (-> self base y) (-> self suck-y-offset) (* f30-0 @@ -1271,14 +1227,14 @@ :virtual #t :code (behavior ((arg0 object) (arg1 handle)) (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (process-entity-status! self (entity-perm-status dead) #t) (convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* money)))) ) ) ;; definition for method 20 of type money -(defmethod initialize money ((this money)) +(defmethod initialize ((this money)) (stack-size-set! (-> this main-thread) 128) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1294,7 +1250,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #t) @@ -1313,7 +1269,7 @@ ) (initialize-skeleton this *money-sg* '()) (if (-> this entity) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) ) (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) @@ -1322,11 +1278,11 @@ ;; definition for method 11 of type money ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! money ((this money) (arg0 entity-actor)) +(defmethod init-from-entity! ((this money) (arg0 entity-actor)) (initialize this) (process-drawable-from-entity! this (-> this entity)) (initialize-params this 0 (the-as float 1024.0)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go (method-of-object this wait)) (none) ) @@ -1347,12 +1303,12 @@ ) (set! (-> self fact options) (-> arg2 options)) (set! (-> self notify-parent) #t) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-identity! (-> self root-override quat)) - (vector-identity! (-> self root-override scale)) - (set! (-> self root-override transv quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self root transv quad) (-> arg1 quad)) (initialize-params self (seconds 15) (the-as float 1024.0)) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (set! (-> self event-hook) (-> (method-of-object self wait) event)) (go-virtual wait) (none) @@ -1369,13 +1325,13 @@ (set! (-> self fact pickup-type) (the-as pickup-type arg2)) (set! (-> self fact pickup-amount) arg3) (set! (-> self notify-parent) #t) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-identity! (-> self root-override quat)) - (vector-identity! (-> self root-override scale)) - (set! (-> self root-override transv quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self root transv quad) (-> arg1 quad)) (initialize-params self (seconds 15) (the-as float 0.0)) (logior! (-> self flags) (collectable-flags ignore-blue)) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (set! (-> self event-hook) (-> (method-of-object self wait) event)) (go-virtual wait) (none) @@ -1386,13 +1342,9 @@ ;; definition of type fuel-cell (deftype fuel-cell (eco-collectable) - ((victory-anim spool-anim :offset-assert 404) - (state-object symbol :offset-assert 408) + ((victory-anim spool-anim) + (state-object symbol) ) - :heap-base #x130 - :method-count-assert 31 - :size-assert #x19c - :flag-assert #x1f0130019c (:states (fuel-cell-clone-anim handle) (fuel-cell-spline-slider handle float float) @@ -1400,7 +1352,7 @@ ) ;; definition for method 3 of type fuel-cell -(defmethod inspect fuel-cell ((this fuel-cell)) +(defmethod inspect ((this fuel-cell)) (let ((t9-0 (method-of-type eco-collectable inspect))) (t9-0 this) ) @@ -1498,14 +1450,14 @@ ) ) (else - (let* ((gp-1 (-> self root-override)) + (let* ((gp-1 (-> self root)) (v1-20 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) gp-1 ) ) (gp-2 (if v1-20 (-> v1-20 root-prim prim-core) - (-> self root-override trans) + (-> self root trans) ) ) ) @@ -1550,14 +1502,14 @@ ) (cond ((= message 'trans) - (set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad)) - (set! (-> self base quad) (-> self root-override trans quad)) - (update-transforms! (-> self root-override)) + (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self base quad) (-> self root trans quad)) + (update-transforms! (-> self root)) ) ((= message 'pickup) (when (!= (-> self next-state name) 'pickup) (if (and (> argc 0) (-> block param 0)) - (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (process->handle *target*)) @@ -1565,8 +1517,8 @@ ) ((= message 'collide-shape) (if (-> block param 0) - (restore-collide-with-as (-> self root-override)) - (clear-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) + (clear-collide-with-as (-> self root)) ) ) ((= message 'movie-pos) @@ -1601,7 +1553,7 @@ (seek f28-0 (the-as float 0.0) (* 3072.0 (seconds-per-frame))) ) ) - (set! (-> self root-override trans y) (+ (-> self base y) (* 2867.2 (sin f28-0)))) + (set! (-> self root trans y) (+ (-> self base y) (* 2867.2 (sin f28-0)))) (let ((f30-1 (lerp-scale (the-as float 0.6) (the-as float 0.5) f30-0 (the-as float 8192.0) (-> *FACT-bank* suck-suck-dist)) ) @@ -1688,7 +1640,7 @@ :code (behavior ((arg0 object) (arg1 handle)) (local-vars (sv-96 res-tag)) (sound-play "pu-powercell") - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) (process-entity-status! self (entity-perm-status dead) #t) @@ -1727,25 +1679,19 @@ ) (cond ((and *debug-segment* (< (-> *fuel-cell-tune-pos* w) 1000000000.0)) - (move-to-point! (-> self root-override) *fuel-cell-tune-pos*) - (set-yaw-angle-clear-roll-pitch! (-> self root-override) (-> *fuel-cell-tune-pos* w)) + (move-to-point! (-> self root) *fuel-cell-tune-pos*) + (set-yaw-angle-clear-roll-pitch! (-> self root) (-> *fuel-cell-tune-pos* w)) ) ((= (-> self movie-pos-index) -1) ) (gp-1 - (move-to-point! (-> self root-override) gp-1) - (set-yaw-angle-clear-roll-pitch! (-> self root-override) (-> gp-1 w)) + (move-to-point! (-> self root) gp-1) + (set-yaw-angle-clear-roll-pitch! (-> self root) (-> gp-1 w)) ) (else - (move-to-point! (-> self root-override) (-> *target* control trans)) - (set-yaw-angle-clear-roll-pitch! (-> self root-override) (y-angle (-> *target* control))) - (move-to-ground - (-> self root-override) - (the-as float 40960.0) - (the-as float 40960.0) - #f - (collide-kind background) - ) + (move-to-point! (-> self root) (-> *target* control trans)) + (set-yaw-angle-clear-roll-pitch! (-> self root) (y-angle (-> *target* control))) + (move-to-ground (-> self root) (the-as float 40960.0) (the-as float 40960.0) #f (collide-kind background)) ) ) ) @@ -2039,14 +1985,14 @@ :post (behavior () (transform-post) (if (-> self state-object) - (spawn (-> self part) (the-as vector (-> self root-override root-prim prim-core))) + (spawn (-> self part) (the-as vector (-> self root root-prim prim-core))) ) ) ) ;; definition for method 20 of type fuel-cell ;; INFO: Used lq/sq -(defmethod initialize fuel-cell ((this fuel-cell)) +(defmethod initialize ((this fuel-cell)) (stack-size-set! (-> this main-thread) 512) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -2063,18 +2009,18 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #t) (set! (-> this notify-parent) #f) (set! (-> this fact) (new 'process 'fact-info this (pickup-type fuel-cell) (the-as float 0.0))) (initialize-skeleton this *fuel-cell-sg* '()) - (set! (-> this base quad) (-> this root-override trans quad)) - (set! (-> this old-base quad) (-> this root-override trans quad)) + (set! (-> this base quad) (-> this root trans quad)) + (set! (-> this old-base quad) (-> this root trans quad)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 63) this)) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "powercell-idle" :fo-max 40) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "powercell-idle" :fo-max 40) (-> this root trans)) ) (set! (-> this victory-anim) (fuel-cell-pick-anim this)) this @@ -2082,12 +2028,12 @@ ;; definition for method 11 of type fuel-cell ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! fuel-cell ((this fuel-cell) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fuel-cell) (arg0 entity-actor)) (initialize this) (process-drawable-from-entity! this (-> this entity)) (initialize-params this 0 (the-as float 1024.0)) (logclear! (-> this fact options) (fact-options can-collect)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go (method-of-object this wait)) (none) ) @@ -2108,13 +2054,13 @@ ) (set! (-> self fact options) (-> arg2 options)) (set! (-> self notify-parent) #t) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-identity! (-> self root-override quat)) - (vector-identity! (-> self root-override scale)) - (set! (-> self root-override transv quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self root transv quad) (-> arg1 quad)) (initialize-params self 0 (the-as float 1024.0)) (logclear! (-> self fact options) (fact-options can-collect)) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (let ((gp-1 (res-lump-struct (-> self entity) 'movie-pos structure :time (the-as float -1000000000.0)))) (cond ((and *debug-segment* (< (-> *fuel-cell-tune-pos* w) 1000000000.0)) @@ -2147,20 +2093,20 @@ (('pickup) (when (!= (-> self next-state name) 'pickup) (if (and (> argc 0) (-> block param 0)) - (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual pickup #f (the-as handle #f)) ) ) (('trans) - (set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad)) - (set! (-> self base quad) (-> self root-override trans quad)) - (update-transforms! (-> self root-override)) + (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self base quad) (-> self root trans quad)) + (update-transforms! (-> self root)) ) (('stop-cloning 'notify) - (set! (-> self root-override trans quad) (-> self draw origin quad)) - (set! (-> self base quad) (-> self root-override trans quad)) + (set! (-> self root trans quad) (-> self draw origin quad)) + (set! (-> self base quad) (-> self root trans quad)) (ja-channel-set! 1) (ja :group! fuel-cell-idle-ja) (logclear! (-> self draw status) (draw-status hidden)) @@ -2182,7 +2128,7 @@ (deactivate self) ) :post (behavior () - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (animate self) ) ) @@ -2210,16 +2156,12 @@ ;; definition of type buzzer (deftype buzzer (eco-collectable) - ((victory-anim spool-anim :offset-assert 404) + ((victory-anim spool-anim) ) - :heap-base #x130 - :method-count-assert 31 - :size-assert #x198 - :flag-assert #x1f01300198 ) ;; definition for method 3 of type buzzer -(defmethod inspect buzzer ((this buzzer)) +(defmethod inspect ((this buzzer)) (let ((t9-0 (method-of-type eco-collectable inspect))) (t9-0 this) ) @@ -2229,17 +2171,13 @@ ;; definition for method 29 of type buzzer ;; INFO: Return type mismatch int vs none. -(defmethod animate buzzer ((this buzzer)) - (quaternion-rotate-y! - (-> this root-override quat) - (-> this root-override quat) - (* 40049.777 (seconds-per-frame)) - ) +(defmethod animate ((this buzzer)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 param 0) 1.0) (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((f0-3 (y-angle (-> this root-override)))) + (let ((f0-3 (y-angle (-> this root)))) (set! (-> *part-id-table* 239 init-specs 4 initial-valuef) (+ 16384.0 f0-3)) (set! (-> *part-id-table* 240 init-specs 4 initial-valuef) (+ 16384.0 f0-3)) ) @@ -2247,7 +2185,7 @@ (if (nonzero? (-> this sound)) (update! (-> this sound)) ) - (if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0)) + (if (and *target* (>= (-> *target* fact buzzer) 6.0)) (spool-push *art-control* (-> this victory-anim name) 0 this (the-as float -99.0)) ) 0 @@ -2313,12 +2251,12 @@ ) ) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) (when (not arg0) - (let ((v1-18 (manipy-spawn (-> self root-override trans) #f *buzzer-sg* #f :to *entity-pool*))) + (let ((v1-18 (manipy-spawn (-> self root trans) #f *buzzer-sg* #f :to *entity-pool*))) (send-event (ppointer->process v1-18) 'become-hud-object (ppointer->process (-> *hud-parts* buzzers))) ) ) @@ -2337,21 +2275,20 @@ ) (logior! (-> self fact options) (fact-options instant-collect skip-jump-anim)) ) - (let ((v1-47 - (birth-pickup-at-point - (vector+! (new 'stack-no-clear 'vector) (-> self root-override trans) (new 'static 'vector :y 4096.0 :w 1.0)) - (pickup-type fuel-cell) - (the float s5-2) - #f - self - (-> self fact) - ) - ) + (let ((v1-47 (birth-pickup-at-point + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 4096.0 :w 1.0)) + (pickup-type fuel-cell) + (the float s5-2) + #f + self + (-> self fact) + ) + ) ) (when v1-47 (send-event (ppointer->process v1-47) 'movie-pos (-> self movie-pos-index)) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (while (-> self child) (suspend) @@ -2382,7 +2319,7 @@ ) ;; definition for method 20 of type buzzer -(defmethod initialize buzzer ((this buzzer)) +(defmethod initialize ((this buzzer)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -2397,7 +2334,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #t) @@ -2406,7 +2343,7 @@ (initialize-skeleton this *buzzer-sg* '()) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 65) this)) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "buzzer" :fo-max 40) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "buzzer" :fo-max 40) (-> this root trans)) ) (set! (-> this victory-anim) (fuel-cell-pick-anim this)) this @@ -2414,13 +2351,13 @@ ;; definition for method 11 of type buzzer ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! buzzer ((this buzzer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this buzzer) (arg0 entity-actor)) (initialize this) (process-drawable-from-entity! this (-> this entity)) (initialize-params this 0 (the-as float 1024.0)) (set! (-> this collect-timeout) (seconds 2)) - (update-transforms! (-> this root-override)) - (update-trans! (-> this sound) (-> this root-override trans)) + (update-transforms! (-> this root)) + (update-trans! (-> this sound) (-> this root trans)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go (method-of-object this wait)) (go (method-of-object this pickup) #t (the-as handle #f)) @@ -2444,20 +2381,20 @@ ) (set! (-> self fact options) (-> arg2 options)) (set! (-> self notify-parent) #t) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-identity! (-> self root-override quat)) - (vector-identity! (-> self root-override scale)) - (set! (-> self root-override transv quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self root transv quad) (-> arg1 quad)) (initialize-params self 0 (the-as float 1024.0)) - (update-transforms! (-> self root-override)) - (update-trans! (-> self sound) (-> self root-override trans)) + (update-transforms! (-> self root)) + (update-trans! (-> self sound) (-> self root trans)) (set! (-> self event-hook) (-> (method-of-object self wait) event)) (go-virtual wait) (none) ) ;; definition for method 11 of type eco -(defmethod init-from-entity! eco ((this eco) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco) (arg0 entity-actor)) (let ((v1-2 (res-lump-value (-> this entity) 'eco-info pickup-type :time (the-as float -1000000000.0)))) (set! (-> this type) (cond ((= v1-2 (pickup-type eco-blue)) @@ -2697,7 +2634,7 @@ ;; definition for method 9 of type fact-info ;; INFO: Used lq/sq -(defmethod drop-pickup fact-info ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) +(defmethod drop-pickup ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) (let ((s3-0 (-> this pickup-type)) (f30-0 (-> this pickup-amount)) ) @@ -2707,17 +2644,11 @@ (set! s3-0 (pickup-type eco-pill)) (set! f30-0 (cond - ((and (= s1-0 1) - *target* - (and (>= 1.0 (-> *target* fact-info-target health)) (rand-vu-percent? (the-as float 0.1))) - ) + ((and (= s1-0 1) *target* (and (>= 1.0 (-> *target* fact health)) (rand-vu-percent? (the-as float 0.1)))) (set! s3-0 (pickup-type eco-green)) 1.0 ) - ((and (< 1 s1-0) - *target* - (and (>= 2.0 (-> *target* fact-info-target health)) (rand-vu-percent? (the-as float 0.05))) - ) + ((and (< 1 s1-0) *target* (and (>= 2.0 (-> *target* fact health)) (rand-vu-percent? (the-as float 0.05)))) (set! s3-0 (pickup-type eco-green)) 1.0 ) @@ -2767,22 +2698,18 @@ ;; definition of type ecovalve (deftype ecovalve (process-drawable) - ((root-override collide-shape-moving :offset 112) - (offset vector :inline :offset-assert 176) - (offset-target vector :inline :offset-assert 192) - (block-func (function vent symbol) :offset-assert 208) + ((root collide-shape-moving :override) + (offset vector :inline) + (offset-target vector :inline) + (block-func (function vent symbol)) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd4 - :flag-assert #x14007000d4 (:states ecovalve-idle ) ) ;; definition for method 3 of type ecovalve -(defmethod inspect ecovalve ((this ecovalve)) +(defmethod inspect ((this ecovalve)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -2811,11 +2738,11 @@ ) (when (!= (-> self offset-target y) (-> self offset y)) (vector-seek! (-> self offset) (-> self offset-target) (* 4096.0 (seconds-per-frame))) - (move-to-point! (-> self root-override) (vector+! - (new 'stack-no-clear 'vector) - (-> (the-as process-drawable (-> self parent 0)) root trans) - (-> self offset) - ) + (move-to-point! (-> self root) (vector+! + (new 'stack-no-clear 'vector) + (-> (the-as process-drawable (-> self parent 0)) root trans) + (-> self offset) + ) ) (transform-post) ) @@ -2846,24 +2773,24 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) ) (set! (-> self block-func) arg0) - (set! (-> self root-override trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) + (set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) (set-vector! (-> self offset-target) 0.0 -2252.8 0.0 1.0) (if (not ((-> self block-func) (the-as vent (ppointer->process (-> self parent))))) (set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0) ) (set! (-> self offset quad) (-> self offset-target quad)) (initialize-skeleton self *ecovalve-sg* '()) - (move-to-point! (-> self root-override) (vector+! - (new 'stack-no-clear 'vector) - (-> (the-as process-drawable (-> self parent 0)) root trans) - (-> self offset) - ) + (move-to-point! (-> self root) (vector+! + (new 'stack-no-clear 'vector) + (-> (the-as process-drawable (-> self parent 0)) root trans) + (-> self offset) + ) ) (go ecovalve-idle) (none) @@ -2871,21 +2798,17 @@ ;; definition of type vent (deftype vent (process-drawable) - ((root-override collide-shape :offset 112) - (show-particles symbol :offset-assert 176) - (collect-effect sparticle-launch-group :offset-assert 180) - (collect-effect2 sparticle-launch-group :offset-assert 184) - (collect-effect-time time-frame :offset-assert 192) - (blocker entity-actor :offset-assert 200) - (block-func (function vent symbol) :offset-assert 204) - (pickup-handle handle :offset-assert 208) + ((root collide-shape :override) + (show-particles symbol) + (collect-effect sparticle-launch-group) + (collect-effect2 sparticle-launch-group) + (collect-effect-time time-frame) + (blocker entity-actor) + (block-func (function vent symbol)) + (pickup-handle handle) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15007000d8 (:methods - (initialize (_type_ entity-actor pickup-type) none 20) + (initialize (_type_ entity-actor pickup-type) none) ) (:states vent-blocked @@ -2895,7 +2818,7 @@ ) ;; definition for method 3 of type vent -(defmethod inspect vent ((this vent)) +(defmethod inspect ((this vent)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -2912,7 +2835,7 @@ ;; definition for method 20 of type vent ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod initialize vent ((this vent) (arg0 entity-actor) (arg1 pickup-type)) +(defmethod initialize ((this vent) (arg0 entity-actor) (arg1 pickup-type)) (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask actor-pause)) (let ((s3-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) @@ -2924,11 +2847,11 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> this root-override) s3-0) + (set! (-> this root) s3-0) ) - (set! (-> this root-override trans quad) (-> arg0 extra trans quad)) - (update-transforms! (-> this root-override)) - (set! (-> this root-override pause-adjust-distance) 409600.0) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (update-transforms! (-> this root)) + (set! (-> this root pause-adjust-distance) 409600.0) (set! (-> this fact) (new 'process 'fact-info this arg1 (-> *FACT-bank* eco-full-inc))) (set! (-> this block-func) (the-as (function vent symbol) true-func)) (case (-> this fact pickup-type) @@ -2936,25 +2859,25 @@ (set! (-> this part) (create-launch-control (-> *part-group-id-table* 44) this)) (set! (-> this collect-effect) (-> *part-group-id-table* 67)) (set! (-> this collect-effect2) (-> *part-group-id-table* 43)) - (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-blue (-> this root-override trans))) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-blue (-> this root trans))) ) (((pickup-type eco-red)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 50) this)) (set! (-> this collect-effect) (-> *part-group-id-table* 69)) (set! (-> this collect-effect2) (-> *part-group-id-table* 49)) - (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-red (-> this root-override trans))) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-red (-> this root trans))) ) (((pickup-type eco-green)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 62) this)) (set! (-> this collect-effect) (-> *part-group-id-table* 66)) (set! (-> this collect-effect2) (-> *part-group-id-table* 61)) - (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-green (-> this root-override trans))) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-green (-> this root trans))) ) (((pickup-type eco-yellow)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 52) this)) (set! (-> this collect-effect) (-> *part-group-id-table* 68)) (set! (-> this collect-effect2) (-> *part-group-id-table* 57)) - (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-yellow (-> this root-override trans))) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-yellow (-> this root trans))) ) ) (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) @@ -3032,7 +2955,7 @@ :code (behavior () (loop (let ((a0-0 (-> self part)) - (a1-0 (-> self root-override trans)) + (a1-0 (-> self root trans)) (gp-0 (-> self sound)) ) (if (and (nonzero? a0-0) (-> self show-particles)) @@ -3105,7 +3028,7 @@ part-tracker-move-to-target #f #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to self ) ) @@ -3121,14 +3044,10 @@ ;; definition of type ventyellow (deftype ventyellow (vent) () - :heap-base #x70 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15007000d8 ) ;; definition for method 3 of type ventyellow -(defmethod inspect ventyellow ((this ventyellow)) +(defmethod inspect ((this ventyellow)) (let ((t9-0 (method-of-type vent inspect))) (t9-0 this) ) @@ -3136,7 +3055,7 @@ ) ;; definition for method 11 of type ventyellow -(defmethod init-from-entity! ventyellow ((this ventyellow) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ventyellow) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-yellow)) (none) ) @@ -3144,14 +3063,10 @@ ;; definition of type ventred (deftype ventred (vent) () - :heap-base #x70 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15007000d8 ) ;; definition for method 3 of type ventred -(defmethod inspect ventred ((this ventred)) +(defmethod inspect ((this ventred)) (let ((t9-0 (method-of-type vent inspect))) (t9-0 this) ) @@ -3159,7 +3074,7 @@ ) ;; definition for method 11 of type ventred -(defmethod init-from-entity! ventred ((this ventred) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ventred) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-red)) (none) ) @@ -3167,14 +3082,10 @@ ;; definition of type ventblue (deftype ventblue (vent) () - :heap-base #x70 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15007000d8 ) ;; definition for method 3 of type ventblue -(defmethod inspect ventblue ((this ventblue)) +(defmethod inspect ((this ventblue)) (let ((t9-0 (method-of-type vent inspect))) (t9-0 this) ) @@ -3182,7 +3093,7 @@ ) ;; definition for method 11 of type ventblue -(defmethod init-from-entity! ventblue ((this ventblue) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ventblue) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-blue)) (none) ) @@ -3190,14 +3101,10 @@ ;; definition of type ecovent (deftype ecovent (vent) () - :heap-base #x70 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15007000d8 ) ;; definition for method 3 of type ecovent -(defmethod inspect ecovent ((this ecovent)) +(defmethod inspect ((this ecovent)) (let ((t9-0 (method-of-type vent inspect))) (t9-0 this) ) @@ -3205,7 +3112,7 @@ ) ;; definition for method 11 of type ecovent -(defmethod init-from-entity! ecovent ((this ecovent) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ecovent) (arg0 entity-actor)) (initialize this arg0 (pickup-type eco-blue)) (none) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc index 01469dd6a8b..b637bc02bb1 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc @@ -48,17 +48,14 @@ ;; definition of type crate-bank (deftype crate-bank (basic) - ((COLLIDE_YOFF float :offset-assert 4) - (COLLIDE_RADIUS float :offset-assert 8) - (DARKECO_EXPLODE_RADIUS float :offset-assert 12) + ((COLLIDE_YOFF float) + (COLLIDE_RADIUS float) + (DARKECO_EXPLODE_RADIUS float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type crate-bank -(defmethod inspect crate-bank ((this crate-bank)) +(defmethod inspect ((this crate-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~TCOLLIDE_YOFF: ~f~%" (-> this COLLIDE_YOFF)) (format #t "~TCOLLIDE_RADIUS: ~f~%" (-> this COLLIDE_RADIUS)) @@ -73,36 +70,34 @@ ;; definition of type crate (deftype crate (process-drawable) - ((root-override collide-shape-moving :offset 112) - (smush smush-control :inline :offset-assert 176) - (base vector :inline :offset-assert 208) - (look symbol :offset-assert 224) - (defense symbol :offset-assert 228) - (incomming-attack-id uint64 :offset-assert 232) - (target handle :offset-assert 240) - (child-count int32 :offset-assert 248) - (victory-anim spool-anim :offset-assert 252) + ((root collide-shape-moving :override) + (smush smush-control :inline) + (base vector :inline) + (look symbol) + (defense symbol) + (incomming-attack-id uint64) + (target handle) + (child-count int32) + (victory-anim spool-anim) ) - :heap-base #x90 - :method-count-assert 30 - :size-assert #x100 - :flag-assert #x1e00900100 + (:state-methods + wait + (die symbol int) + special-contents-die + bounce-on + (notice-blue handle) + ) (:methods - (wait () _type_ :state 20) - (die (symbol int) _type_ :state 21) - (special-contents-die () _type_ :state 22) - (bounce-on () _type_ :state 23) - (notice-blue (handle) _type_ :state 24) - (params-init (_type_ entity) none 25) - (art-init (_type_) crate 26) - (params-set! (_type_ symbol symbol) none 27) - (check-dead (_type_) none 28) - (smush-update! (_type_) none 29) + (params-init (_type_ entity) none) + (art-init (_type_) crate) + (params-set! (_type_ symbol symbol) none) + (check-dead (_type_) none) + (smush-update! (_type_) none) ) ) ;; definition for method 3 of type crate -(defmethod inspect crate ((this crate)) +(defmethod inspect ((this crate)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -541,7 +536,7 @@ (go-virtual die #f (the-as int s5-0)) ) (else - (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root-override trans y) (-> self base y))) + (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root trans y) (-> self base y))) (if (not (and (!= *kernel-boot-message* 'play) (= (-> *setting-control* current language) (language-enum japanese))) ) (level-hint-spawn (text-id training-ironcrate) "sagevb36" (the-as entity #f) *entity-pool* (game-task none)) @@ -595,7 +590,7 @@ (go-virtual die #f (the-as int s5-0)) ) (else - (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root-override trans y) (-> self base y))) + (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root trans y) (-> self base y))) (level-hint-spawn (text-id sidekick-hint-crate-steel) "sksp0006" @@ -677,7 +672,7 @@ ) ) (('bonk) - (when (= (-> self root-override trans y) (-> self base y)) + (when (= (-> self root trans y) (-> self base y)) (activate! (-> self smush) -0.1 75 150 1.0 1.0) (go-virtual bounce-on) ) @@ -691,7 +686,7 @@ (('eco-blue) (if (not (or (= (-> self defense) 'darkeco) (or (= (-> self next-state name) 'notice-blue) (= (-> self next-state name) 'die)) - (!= (-> self root-override trans y) (-> self base y)) + (!= (-> self root trans y) (-> self base y)) ) ) (go-virtual notice-blue (process->handle arg0)) @@ -706,7 +701,7 @@ :event crate-standard-event-handler :code (behavior () (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (logior! (-> self mask) (process-mask sleep)) (loop (suspend) @@ -762,7 +757,7 @@ ) ) (when v1-6 - (let* ((gp-2 (-> self root-override root-prim prim-core)) + (let* ((gp-2 (-> self root root-prim prim-core)) (a1-3 (-> (the-as collide-shape v1-6) root-prim prim-core)) (f30-0 (vector-vector-distance (the-as vector gp-2) (the-as vector a1-3))) ) @@ -840,14 +835,14 @@ :trans (behavior () (case (-> self type) ((crate-buzzer) - (if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0)) + (if (and *target* (>= (-> *target* fact buzzer) 6.0)) (spool-push *art-control* (-> self victory-anim name) 0 self -99.0) ) ) ) ) :code (behavior ((arg0 symbol) (arg1 int)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) @@ -882,16 +877,13 @@ ) (case (-> self defense) (('darkeco) - (let ((f0-0 - (lerp-scale 1.0 0.0 (vector-vector-distance (-> self root-override trans) (target-pos 0)) 8192.0 40960.0) - ) - ) + (let ((f0-0 (lerp-scale 1.0 0.0 (vector-vector-distance (-> self root trans) (target-pos 0)) 8192.0 40960.0))) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 (the int (* 255.0 f0-0)) (seconds 0.3)) ) (process-spawn touch-tracker :init touch-tracker-init - (-> self root-override trans) + (-> self root trans) (-> *CRATE-bank* DARKECO_EXPLODE_RADIUS) 30 :to self @@ -908,7 +900,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) ) @@ -921,7 +913,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) ) @@ -934,7 +926,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) ) @@ -1010,7 +1002,7 @@ ) ) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (logior! (-> self draw status) (draw-status hidden)) (drop-pickup (-> self fact) #t self (the-as fact-info #f) 0) (set! (-> self child-count) (+ (process-count self) -1)) @@ -1033,7 +1025,7 @@ ;; INFO: Used lq/sq (defbehavior crate-init-by-other crate ((arg0 entity) (arg1 vector) (arg2 symbol)) (params-init self arg0) - (set! (-> self root-override trans quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg1 quad)) (set! (-> self look) arg2) (set! (-> self defense) arg2) (art-init self) @@ -1042,7 +1034,7 @@ ) ;; definition for method 11 of type crate -(defmethod init-from-entity! crate ((this crate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this crate) (arg0 entity-actor)) (params-init this arg0) (art-init this) (check-dead this) @@ -1051,7 +1043,7 @@ ;; definition for method 25 of type crate ;; INFO: Return type mismatch crate vs none. -(defmethod params-init crate ((this crate) (arg0 entity)) +(defmethod params-init ((this crate) (arg0 entity)) (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask crate)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -1072,7 +1064,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (set! (-> this fact) (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) @@ -1124,14 +1116,14 @@ ;; definition for method 26 of type crate ;; INFO: Used lq/sq -(defmethod art-init crate ((this crate)) +(defmethod art-init ((this crate)) (case (-> this look) (('iron) - (set! (-> this root-override root-prim prim-core offense) (collide-offense normal-attack)) + (set! (-> this root root-prim prim-core offense) (collide-offense normal-attack)) (initialize-skeleton this *crate-iron-sg* '()) ) (('steel) - (set! (-> this root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> this root root-prim prim-core offense) (collide-offense indestructible)) (initialize-skeleton this *crate-steel-sg* '()) ) (('darkeco) @@ -1163,27 +1155,27 @@ ) (cond ((logtest? (fact-options indestructible) (-> this fact options)) - (set! (-> this root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> this root root-prim prim-core offense) (collide-offense indestructible)) ) ((logtest? (-> this fact options) (fact-options strong-attack)) - (set! (-> this root-override root-prim prim-core offense) (collide-offense strong-attack)) + (set! (-> this root root-prim prim-core offense) (collide-offense strong-attack)) ) ((logtest? (-> this fact options) (fact-options normal-attack)) - (set! (-> this root-override root-prim prim-core offense) (collide-offense normal-attack)) + (set! (-> this root root-prim prim-core offense) (collide-offense normal-attack)) ) ((logtest? (-> this fact options) (fact-options touch)) - (set! (-> this root-override root-prim prim-core offense) (collide-offense touch)) + (set! (-> this root root-prim prim-core offense) (collide-offense touch)) ) ) - (set! (-> this base quad) (-> this root-override trans quad)) + (set! (-> this base quad) (-> this root trans quad)) (crate-post) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) this ) ;; definition for method 27 of type crate ;; INFO: Return type mismatch crate vs none. -(defmethod params-set! crate ((this crate) (arg0 symbol) (arg1 symbol)) +(defmethod params-set! ((this crate) (arg0 symbol) (arg1 symbol)) (if arg0 (set! (-> this look) arg0) ) @@ -1195,7 +1187,7 @@ ;; definition for method 28 of type crate ;; INFO: Return type mismatch int vs none. -(defmethod check-dead crate ((this crate)) +(defmethod check-dead ((this crate)) (if (>= (-> this entity extra perm user-int8 0) 1) (go (method-of-object this die) #t 0) ) @@ -1207,11 +1199,11 @@ ;; definition for method 29 of type crate ;; INFO: Return type mismatch int vs none. -(defmethod smush-update! crate ((this crate)) +(defmethod smush-update! ((this crate)) (let ((f0-0 (update! (-> this smush)))) - (set! (-> this root-override scale x) (+ 1.0 (* -0.5 f0-0))) - (set! (-> this root-override scale y) (+ 1.0 f0-0)) - (set! (-> this root-override scale z) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale y) (+ 1.0 f0-0)) + (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0))) ) 0 (none) @@ -1220,14 +1212,10 @@ ;; definition of type barrel (deftype barrel (crate) () - :heap-base #x90 - :method-count-assert 30 - :size-assert #x100 - :flag-assert #x1e00900100 ) ;; definition for method 3 of type barrel -(defmethod inspect barrel ((this barrel)) +(defmethod inspect ((this barrel)) (let ((t9-0 (method-of-type crate inspect))) (t9-0 this) ) @@ -1236,7 +1224,7 @@ ;; definition for method 25 of type barrel ;; INFO: Return type mismatch barrel vs none. -(defmethod params-init barrel ((this barrel) (arg0 entity)) +(defmethod params-init ((this barrel) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) (t9-0 this arg0) ) @@ -1247,14 +1235,10 @@ ;; definition of type bucket (deftype bucket (crate) () - :heap-base #x90 - :method-count-assert 30 - :size-assert #x100 - :flag-assert #x1e00900100 ) ;; definition for method 3 of type bucket -(defmethod inspect bucket ((this bucket)) +(defmethod inspect ((this bucket)) (let ((t9-0 (method-of-type crate inspect))) (t9-0 this) ) @@ -1263,7 +1247,7 @@ ;; definition for method 25 of type bucket ;; INFO: Return type mismatch bucket vs none. -(defmethod params-init bucket ((this bucket) (arg0 entity)) +(defmethod params-init ((this bucket) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) (t9-0 this arg0) ) @@ -1308,14 +1292,10 @@ ;; definition of type crate-buzzer (deftype crate-buzzer (crate) () - :heap-base #x90 - :method-count-assert 30 - :size-assert #x100 - :flag-assert #x1e00900100 ) ;; definition for method 3 of type crate-buzzer -(defmethod inspect crate-buzzer ((this crate-buzzer)) +(defmethod inspect ((this crate-buzzer)) (let ((t9-0 (method-of-type crate inspect))) (t9-0 this) ) @@ -1324,17 +1304,13 @@ ;; definition for method 26 of type crate-buzzer ;; INFO: Return type mismatch crate-buzzer vs crate. -(defmethod art-init crate-buzzer ((this crate-buzzer)) +(defmethod art-init ((this crate-buzzer)) (let ((t9-0 (method-of-type crate art-init))) (t9-0 this) ) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 74) this)) - (set! (-> this sound) (new - 'process - 'ambient-sound - (static-sound-spec "buzzer" :pitch-mod -762 :fo-max 40) - (-> this root-override trans) - ) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "buzzer" :pitch-mod -762 :fo-max 40) (-> this root trans)) ) (set! (-> this victory-anim) (fuel-cell-pick-anim this)) (the-as crate this) @@ -1344,27 +1320,25 @@ (defstate wait (crate-buzzer) :virtual #t :trans (behavior () - (when (and (and *target* - (>= 327680.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (when (and (and *target* (>= 327680.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (time-elapsed? (-> self state-time) (seconds 1.5)) (rand-vu-percent? 0.03) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (activate! (-> self smush) 0.2 90 150 1.0 1.0) (logclear! (-> self mask) (process-mask sleep-code)) ) (if (nonzero? (-> self sound)) (update! (-> self sound)) ) - (if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0)) + (if (and *target* (>= (-> *target* fact buzzer) 6.0)) (spool-push *art-control* (-> self victory-anim name) 0 self -99.0) ) ) :code (behavior () (set-time! (-> self state-time)) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (loop (set-time! (-> self state-time)) (ja-post) @@ -1374,9 +1348,9 @@ (sound-play "crate-jump") (while (or (!= (-> self smush amp) 0.0) (!= f30-0 0.0)) (+! f30-0 (* -245760.0 (seconds-per-frame))) - (+! (-> self root-override trans y) (* f30-0 (seconds-per-frame))) - (when (< (-> self root-override trans y) (-> self base y)) - (set! (-> self root-override trans y) (-> self base y)) + (+! (-> self root trans y) (* f30-0 (seconds-per-frame))) + (when (< (-> self root trans y) (-> self base y)) + (set! (-> self root trans y) (-> self base y)) (set! f30-0 (* -0.5 f30-0)) (if (< (fabs f30-0) 16384.0) (set! f30-0 0.0) @@ -1387,7 +1361,7 @@ (suspend) ) ) - (set! (-> self root-override trans y) (-> self base y)) + (set! (-> self root trans y) (-> self base y)) ) ) :post #f @@ -1398,7 +1372,7 @@ :virtual #t :code (behavior () (while (!= (-> self smush amp) 0.0) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (suspend) ) (go-virtual wait) @@ -1407,16 +1381,12 @@ ;; definition of type pickup-spawner (deftype pickup-spawner (crate) - ((blocker entity-actor :offset-assert 256) + ((blocker entity-actor) ) - :heap-base #xa0 - :method-count-assert 30 - :size-assert #x104 - :flag-assert #x1e00a00104 ) ;; definition for method 3 of type pickup-spawner -(defmethod inspect pickup-spawner ((this pickup-spawner)) +(defmethod inspect ((this pickup-spawner)) (let ((t9-0 (method-of-type crate inspect))) (t9-0 this) ) @@ -1426,7 +1396,7 @@ ;; definition for method 25 of type pickup-spawner ;; INFO: Return type mismatch pickup-spawner vs none. -(defmethod params-init pickup-spawner ((this pickup-spawner) (arg0 entity)) +(defmethod params-init ((this pickup-spawner) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) (t9-0 this arg0) ) @@ -1440,7 +1410,7 @@ ;; definition for method 28 of type pickup-spawner ;; INFO: Return type mismatch int vs none. -(defmethod check-dead pickup-spawner ((this pickup-spawner)) +(defmethod check-dead ((this pickup-spawner)) (go (method-of-object this wait)) 0 (none) diff --git a/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc index 3bbf67b38d2..5cddc87dd8e 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc @@ -4,14 +4,10 @@ ;; definition of type dark-eco-pool (deftype dark-eco-pool (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) ;; definition for method 3 of type dark-eco-pool -(defmethod inspect dark-eco-pool ((this dark-eco-pool)) +(defmethod inspect ((this dark-eco-pool)) (let ((t9-0 (method-of-type water-anim inspect))) (t9-0 this) ) @@ -93,7 +89,7 @@ ;; definition for method 25 of type dark-eco-pool ;; INFO: Return type mismatch object vs none. -(defmethod water-vol-method-25 dark-eco-pool ((this dark-eco-pool)) +(defmethod water-vol-method-25 ((this dark-eco-pool)) (let ((t9-0 (method-of-type water-anim water-vol-method-25))) (t9-0 this) ) @@ -119,7 +115,7 @@ ;; definition for method 22 of type dark-eco-pool ;; INFO: Return type mismatch ripple-wave-set vs none. -(defmethod water-vol-method-22 dark-eco-pool ((this dark-eco-pool)) +(defmethod water-vol-method-22 ((this dark-eco-pool)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/generic-obs-h_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/generic-obs-h_REF.gc index a9da3b09bbe..0676afeab23 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/generic-obs-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/generic-obs-h_REF.gc @@ -3,33 +3,29 @@ ;; definition of type manipy (deftype manipy (process-drawable) - ((new-trans-hook (function none) :offset-assert 176) - (cur-trans-hook (function none) :offset-assert 180) - (cur-event-hook (function none) :offset-assert 184) - (new-joint-anim art-joint-anim :offset-assert 188) - (new-joint-anim-blend uint64 :offset-assert 192) - (anim-mode symbol :offset-assert 200) - (cur-grab-handle handle :offset-assert 208) - (cur-target-handle handle :offset-assert 216) - (old-grab-pos vector :inline :offset-assert 224) - (joint joint-mod 4 :offset-assert 240) - (new-post-hook (function none) :offset-assert 256) - (cur-post-hook (function none) :offset-assert 260) - (clone-copy-trans symbol :offset-assert 264) - (shadow-backup basic :offset-assert 268) - (draw? symbol :offset-assert 272) + ((new-trans-hook (function none)) + (cur-trans-hook (function none)) + (cur-event-hook (function none)) + (new-joint-anim art-joint-anim) + (new-joint-anim-blend uint64) + (anim-mode symbol) + (cur-grab-handle handle) + (cur-target-handle handle) + (old-grab-pos vector :inline) + (joint joint-mod 4) + (new-post-hook (function none)) + (cur-post-hook (function none)) + (clone-copy-trans symbol) + (shadow-backup basic) + (draw? symbol) ) - :heap-base #xb0 - :method-count-assert 20 - :size-assert #x114 - :flag-assert #x1400b00114 (:states manipy-idle ) ) ;; definition for method 3 of type manipy -(defmethod inspect manipy ((this manipy)) +(defmethod inspect ((this manipy)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -53,17 +49,13 @@ ;; definition of type part-spawner (deftype part-spawner (process-drawable) - ((mode (pointer sparticle-launch-group) :offset-assert 176) - (enable symbol :offset-assert 180) - (radius meters :offset-assert 184) - (world-sphere sphere :inline :offset-assert 192) + ((mode (pointer sparticle-launch-group)) + (enable symbol) + (radius meters) + (world-sphere sphere :inline) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 (:methods - (is-visible? (_type_) symbol 20) + (is-visible? (_type_) symbol) ) (:states part-spawner-active @@ -71,7 +63,7 @@ ) ;; definition for method 3 of type part-spawner -(defmethod inspect part-spawner ((this part-spawner)) +(defmethod inspect ((this part-spawner)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -84,31 +76,27 @@ ;; definition of type part-tracker (deftype part-tracker (process) - ((root trsqv :offset-assert 112) - (part sparticle-launch-control :offset-assert 116) - (target handle :offset-assert 120) - (callback (function part-tracker vector) :offset-assert 128) - (linger-callback (function part-tracker vector) :offset-assert 132) - (duration time-frame :offset-assert 136) - (linger-duration time-frame :offset-assert 144) - (start-time time-frame :offset-assert 152) - (offset vector :inline :offset-assert 160) - (userdata uint64 :offset-assert 176) - (user-time time-frame 2 :offset-assert 184) - (user-vector vector 2 :inline :offset-assert 208) - (user-handle uint32 2 :offset-assert 240) + ((root trsqv) + (part sparticle-launch-control) + (target handle) + (callback (function part-tracker vector)) + (linger-callback (function part-tracker vector)) + (duration time-frame) + (linger-duration time-frame) + (start-time time-frame) + (offset vector :inline) + (userdata uint64) + (user-time time-frame 2) + (user-vector vector 2 :inline) + (user-handle uint32 2) ) - :heap-base #x90 - :method-count-assert 14 - :size-assert #xf8 - :flag-assert #xe009000f8 (:states part-tracker-process ) ) ;; definition for method 3 of type part-tracker -(defmethod inspect part-tracker ((this part-tracker)) +(defmethod inspect ((this part-tracker)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -130,32 +118,28 @@ ;; definition of type camera-tracker (deftype camera-tracker (process) - ((grab-target handle :offset 120) - (grab-event symbol :offset-assert 128) - (release-event symbol :offset-assert 132) - (old-global-mask process-mask :offset-assert 136) - (old-self-mask process-mask :offset-assert 140) - (old-parent-mask process-mask :offset-assert 144) - (look-at-target handle :offset-assert 152) - (pov-target handle :offset-assert 160) - (work-process handle :offset-assert 168) - (anim-process handle :offset-assert 176) - (start-time time-frame :offset-assert 184) - (callback basic :offset-assert 192) - (userdata basic :offset-assert 196) - (message basic :offset-assert 200) - (border-value basic :offset-assert 204) - (mask-to-clear process-mask :offset-assert 208) - (script pair :offset-assert 212) - (script-line pair :offset-assert 216) - (script-func (function none) :offset-assert 220) + ((grab-target handle :offset 120) + (grab-event symbol) + (release-event symbol) + (old-global-mask process-mask) + (old-self-mask process-mask) + (old-parent-mask process-mask) + (look-at-target handle) + (pov-target handle) + (work-process handle) + (anim-process handle) + (start-time time-frame) + (callback basic) + (userdata basic) + (message basic) + (border-value basic) + (mask-to-clear process-mask) + (script pair) + (script-line pair) + (script-func (function none)) ) - :heap-base #x70 - :method-count-assert 15 - :size-assert #xe0 - :flag-assert #xf007000e0 (:methods - (eval (_type_ pair) process 14) + (eval (_type_ pair) process) ) (:states camera-tracker-process @@ -163,7 +147,7 @@ ) ;; definition for method 3 of type camera-tracker -(defmethod inspect camera-tracker ((this camera-tracker)) +(defmethod inspect ((this camera-tracker)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -192,25 +176,21 @@ ;; definition of type touch-tracker (deftype touch-tracker (process-drawable) - ((root-override collide-shape-moving :offset 112) - (duration time-frame :offset-assert 176) - (target handle :offset-assert 184) - (event symbol :offset-assert 192) - (run-function (function object) :offset-assert 196) - (callback (function touch-tracker none) :offset-assert 200) - (event-mode basic :offset-assert 204) + ((root collide-shape-moving :override) + (duration time-frame) + (target handle) + (event symbol) + (run-function (function object)) + (callback (function touch-tracker none)) + (event-mode basic) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14006000d0 (:states touch-tracker-idle ) ) ;; definition for method 3 of type touch-tracker -(defmethod inspect touch-tracker ((this touch-tracker)) +(defmethod inspect ((this touch-tracker)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -225,15 +205,11 @@ ;; definition of type swingpole (deftype swingpole (process) - ((root trsq :offset-assert 112) - (dir vector :inline :offset-assert 128) - (range meters :offset-assert 144) - (edge-length meters :offset-assert 148) + ((root trsq) + (dir vector :inline) + (range meters) + (edge-length meters) ) - :heap-base #x30 - :method-count-assert 14 - :size-assert #x98 - :flag-assert #xe00300098 (:states swingpole-active swingpole-stance @@ -241,7 +217,7 @@ ) ;; definition for method 3 of type swingpole -(defmethod inspect swingpole ((this swingpole)) +(defmethod inspect ((this swingpole)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -254,26 +230,23 @@ ;; definition of type gui-query (deftype gui-query (structure) - ((x-position int32 :offset-assert 0) - (y-position int32 :offset-assert 4) - (message string :offset-assert 8) - (decision symbol :offset-assert 12) - (only-allow-cancel symbol :offset-assert 16) - (no-msg string :offset-assert 20) - (message-space int32 :offset-assert 24) + ((x-position int32) + (y-position int32) + (message string) + (decision symbol) + (only-allow-cancel symbol) + (no-msg string) + (message-space int32) ) :pack-me - :method-count-assert 11 - :size-assert #x1c - :flag-assert #xb0000001c (:methods - (init! (_type_ string int int int symbol string) none 9) - (get-response (_type_) symbol 10) + (init! (_type_ string int int int symbol string) none) + (get-response (_type_) symbol) ) ) ;; definition for method 3 of type gui-query -(defmethod inspect gui-query ((this gui-query)) +(defmethod inspect ((this gui-query)) (format #t "[~8x] ~A~%" this 'gui-query) (format #t "~Tx-position: ~D~%" (-> this x-position)) (format #t "~Ty-position: ~D~%" (-> this y-position)) @@ -287,29 +260,25 @@ ;; definition of type othercam (deftype othercam (process) - ((hand handle :offset-assert 112) - (old-global-mask process-mask :offset-assert 120) - (mask-to-clear process-mask :offset-assert 124) - (cam-joint-index int32 :offset-assert 128) - (old-pos vector :inline :offset-assert 144) - (old-mat-z vector :inline :offset-assert 160) - (had-valid-frame basic :offset-assert 176) - (border-value basic :offset-assert 180) - (die? symbol :offset-assert 184) - (survive-anim-end? symbol :offset-assert 188) - (spooling? symbol :offset-assert 192) + ((hand handle) + (old-global-mask process-mask) + (mask-to-clear process-mask) + (cam-joint-index int32) + (old-pos vector :inline) + (old-mat-z vector :inline) + (had-valid-frame basic) + (border-value basic) + (die? symbol) + (survive-anim-end? symbol) + (spooling? symbol) ) - :heap-base #x60 - :method-count-assert 14 - :size-assert #xc4 - :flag-assert #xe006000c4 (:states othercam-running ) ) ;; definition for method 3 of type othercam -(defmethod inspect othercam ((this othercam)) +(defmethod inspect ((this othercam)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -330,16 +299,13 @@ ;; definition of type process-hidden (deftype process-hidden (process) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 - (:methods - (die () _type_ :state 14) + (:state-methods + die ) ) ;; definition for method 3 of type process-hidden -(defmethod inspect process-hidden ((this process-hidden)) +(defmethod inspect ((this process-hidden)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) diff --git a/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc index b7eb5806f0e..e0185e847c4 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc @@ -127,7 +127,7 @@ ;; definition for method 11 of type swingpole ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swingpole ((this swingpole) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swingpole) (arg0 entity-actor)) "Copy defaults from the entity." (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask actor-pause)) @@ -152,7 +152,7 @@ ;; definition for method 11 of type process-hidden ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! process-hidden ((this process-hidden) (arg0 entity-actor)) +(defmethod init-from-entity! ((this process-hidden) (arg0 entity-actor)) "Copy defaults from the entity." (process-entity-status! this (entity-perm-status dead) #t) (go (method-of-object this die)) @@ -162,13 +162,10 @@ ;; definition of type target-start (deftype target-start (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) ;; definition for method 3 of type target-start -(defmethod inspect target-start ((this target-start)) +(defmethod inspect ((this target-start)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -202,13 +199,10 @@ ;; definition of type camera-start (deftype camera-start (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) ;; definition for method 3 of type camera-start -(defmethod inspect camera-start ((this camera-start)) +(defmethod inspect ((this camera-start)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -599,7 +593,7 @@ ) ;; definition for method 10 of type part-tracker -(defmethod deactivate part-tracker ((this part-tracker)) +(defmethod deactivate ((this part-tracker)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) @@ -970,7 +964,7 @@ ;; definition for method 14 of type camera-tracker ;; INFO: Return type mismatch object vs process. ;; ERROR: Failed load: (set! v1-42 (l.wu (+ a0-22 -4))) at op 159 -(defmethod eval camera-tracker ((this camera-tracker) (arg0 pair)) +(defmethod eval ((this camera-tracker) (arg0 pair)) (with-pp (let ((gp-0 (the-as object #f))) (cond @@ -1253,21 +1247,17 @@ ;; definition of type med-res-level (deftype med-res-level (process-drawable) - ((level symbol :offset-assert 176) - (part-mode basic :offset-assert 180) - (index int32 :offset-assert 184) + ((level symbol) + (part-mode basic) + (index int32) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states med-res-level-idle ) ) ;; definition for method 3 of type med-res-level -(defmethod inspect med-res-level ((this med-res-level)) +(defmethod inspect ((this med-res-level)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1339,7 +1329,7 @@ ;; definition for method 11 of type med-res-level ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! med-res-level ((this med-res-level) (arg0 entity-actor)) +(defmethod init-from-entity! ((this med-res-level) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (stack-size-set! (-> this main-thread) 128) "#f" @@ -1404,7 +1394,7 @@ ) ;; definition for method 20 of type part-spawner -(defmethod is-visible? part-spawner ((this part-spawner)) +(defmethod is-visible? ((this part-spawner)) (sphere<-vector+r! (-> this world-sphere) (-> this root trans) (-> this radius)) (sphere-in-view-frustum? (-> this world-sphere)) ) @@ -1447,7 +1437,7 @@ ;; definition for method 11 of type part-spawner ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! part-spawner ((this part-spawner) (arg0 entity-actor)) +(defmethod init-from-entity! ((this part-spawner) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask ambient)) @@ -1509,18 +1499,14 @@ ;; definition of type launcher (deftype launcher (process-drawable) - ((root-override collide-shape :offset 112) - (spring-height meters :offset-assert 176) - (camera state :offset-assert 180) - (active-distance float :offset-assert 184) - (seek-time time-frame :offset-assert 192) - (dest vector :inline :offset-assert 208) - (sound-id sound-id :offset-assert 224) + ((root collide-shape :override) + (spring-height meters) + (camera state) + (active-distance float) + (seek-time time-frame) + (dest vector :inline) + (sound-id sound-id) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xe4 - :flag-assert #x14008000e4 (:states launcher-active launcher-deactivated @@ -1529,7 +1515,7 @@ ) ;; definition for method 3 of type launcher -(defmethod inspect launcher ((this launcher)) +(defmethod inspect ((this launcher)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1985,15 +1971,14 @@ (go launcher-deactivated) ) (('trans) - (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) - (update-transforms! (-> self root-override)) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) + (update-transforms! (-> self root)) ) ) ) :trans (behavior () - (when (and *target* (>= (-> self active-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (when (and *target* + (>= (-> self active-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (cond ((send-event *target* 'query 'powerup (pickup-type eco-blue)) @@ -2007,7 +1992,7 @@ ) ) ) - (if (and (and *target* (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and (and *target* (>= 32768.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (level-hint-spawn @@ -2035,8 +2020,8 @@ (go launcher-deactivated) ) ((= message 'trans) - (move-to-point! (-> self root-override) (the-as vector (-> block param 0))) - (update-transforms! (-> self root-override)) + (move-to-point! (-> self root) (the-as vector (-> block param 0))) + (update-transforms! (-> self root)) ) ) ) @@ -2052,18 +2037,17 @@ ) ) :trans (behavior () - (if (or (or (not *target*) (< (-> self active-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (or (or (not *target*) + (< (-> self active-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (go launcher-idle) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (sound-play "launch-idle" :id (-> self sound-id)) - (if (and (and *target* (>= (+ 2867.2 (-> self root-override root-prim prim-core world-sphere w)) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + (if (and (and *target* (>= (+ 2867.2 (-> self root root-prim prim-core world-sphere w)) + (vector-vector-distance (-> self root trans) (-> *target* control trans)) ) ) (not (time-elapsed? (-> self state-time) (seconds 0.5))) @@ -2084,7 +2068,7 @@ ;; definition for method 11 of type launcher ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! launcher ((this launcher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this launcher) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -2095,10 +2079,10 @@ ) (set! (-> s4-0 nav-radius) 13926.4) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this active-distance) 409600.0) (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 163840.0)) (let ((s4-1 (res-lump-value arg0 'mode uint128))) @@ -2140,7 +2124,7 @@ ) ) (set! (-> this sound-id) (new-sound-id)) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (go launcher-idle) (none) ) @@ -2159,12 +2143,12 @@ ) (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) (backup-collide-with-as s2-0) - (set! (-> self root-override) s2-0) + (set! (-> self root) s2-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0) - (set-vector! (-> self root-override quat) 0.0 0.0 0.0 1.0) - (update-transforms! (-> self root-override)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + (set-vector! (-> self root quat) 0.0 0.0 0.0 1.0) + (update-transforms! (-> self root)) (set! (-> self spring-height) arg1) (set! (-> self active-distance) arg3) (let ((v1-23 (-> self entity extra level name))) @@ -2319,9 +2303,7 @@ ) ) (if a0-6 - (set! (-> self root-override trans quad) - (-> (the-as collide-shape a0-6) root-prim prim-core world-sphere quad) - ) + (set! (-> self root trans quad) (-> (the-as collide-shape a0-6) root-prim prim-core world-sphere quad)) ) ) ) @@ -2329,15 +2311,15 @@ (if (-> self callback) ((-> self callback) self) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (let ((a1-3 (new 'stack-no-clear 'touching-shapes-entry))) (set! (-> a1-3 cshape1) (the-as collide-shape 2)) (set! (-> a1-3 cshape2) (the-as collide-shape *touching-list*)) - (find-overlapping-shapes (-> self root-override) (the-as overlaps-others-params a1-3)) + (find-overlapping-shapes (-> self root) (the-as overlaps-others-params a1-3)) ) (suspend) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (suspend) 0 ) @@ -2363,9 +2345,9 @@ (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) (set! (-> s4-0 event-self) 'touched) - (set! (-> self root-override) s4-0) + (set! (-> self root) s4-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (set! (-> self duration) arg2) (set! (-> self target) (the-as handle #f)) (set! (-> self event) #f) diff --git a/test/decompiler/reference/jak1/engine/common-obs/nav-enemy-h_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/nav-enemy-h_REF.gc index 5f5ae0538a0..126aef5a627 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/nav-enemy-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/nav-enemy-h_REF.gc @@ -3,65 +3,62 @@ ;; definition of type nav-enemy-info (deftype nav-enemy-info (basic) - ((idle-anim int32 :offset-assert 4) - (walk-anim int32 :offset-assert 8) - (turn-anim int32 :offset-assert 12) - (notice-anim int32 :offset-assert 16) - (run-anim int32 :offset-assert 20) - (jump-anim int32 :offset-assert 24) - (jump-land-anim int32 :offset-assert 28) - (victory-anim int32 :offset-assert 32) - (taunt-anim int32 :offset-assert 36) - (die-anim int32 :offset-assert 40) - (neck-joint int32 :offset-assert 44) - (player-look-at-joint int32 :offset-assert 48) - (run-travel-speed meters :offset-assert 52) - (run-rotate-speed degrees :offset-assert 56) - (run-acceleration meters :offset-assert 60) - (run-turn-time seconds :offset-assert 64) - (walk-travel-speed meters :offset-assert 72) - (walk-rotate-speed degrees :offset-assert 76) - (walk-acceleration meters :offset-assert 80) - (walk-turn-time seconds :offset-assert 88) - (attack-shove-back meters :offset-assert 96) - (attack-shove-up meters :offset-assert 100) - (shadow-size meters :offset-assert 104) - (notice-nav-radius meters :offset-assert 108) - (nav-nearest-y-threshold meters :offset-assert 112) - (notice-distance meters :offset-assert 116) - (proximity-notice-distance meters :offset-assert 120) - (stop-chase-distance meters :offset-assert 124) - (frustration-distance meters :offset-assert 128) - (frustration-time time-frame :offset-assert 136) - (die-anim-hold-frame float :offset-assert 144) - (jump-anim-start-frame float :offset-assert 148) - (jump-land-anim-end-frame float :offset-assert 152) - (jump-height-min meters :offset-assert 156) - (jump-height-factor float :offset-assert 160) - (jump-start-anim-speed float :offset-assert 164) - (shadow-max-y meters :offset-assert 168) - (shadow-min-y meters :offset-assert 172) - (shadow-locus-dist meters :offset-assert 176) - (use-align symbol :offset-assert 180) - (draw-shadow symbol :offset-assert 184) - (move-to-ground symbol :offset-assert 188) - (hover-if-no-ground symbol :offset-assert 192) - (use-momentum symbol :offset-assert 196) - (use-flee symbol :offset-assert 200) - (use-proximity-notice symbol :offset-assert 204) - (use-jump-blocked symbol :offset-assert 208) - (use-jump-patrol symbol :offset-assert 212) - (gnd-collide-with collide-kind :offset-assert 216) - (debug-draw-neck symbol :offset-assert 224) - (debug-draw-jump symbol :offset-assert 228) + ((idle-anim int32) + (walk-anim int32) + (turn-anim int32) + (notice-anim int32) + (run-anim int32) + (jump-anim int32) + (jump-land-anim int32) + (victory-anim int32) + (taunt-anim int32) + (die-anim int32) + (neck-joint int32) + (player-look-at-joint int32) + (run-travel-speed meters) + (run-rotate-speed degrees) + (run-acceleration meters) + (run-turn-time seconds) + (walk-travel-speed meters) + (walk-rotate-speed degrees) + (walk-acceleration meters) + (walk-turn-time seconds) + (attack-shove-back meters) + (attack-shove-up meters) + (shadow-size meters) + (notice-nav-radius meters) + (nav-nearest-y-threshold meters) + (notice-distance meters) + (proximity-notice-distance meters) + (stop-chase-distance meters) + (frustration-distance meters) + (frustration-time time-frame) + (die-anim-hold-frame float) + (jump-anim-start-frame float) + (jump-land-anim-end-frame float) + (jump-height-min meters) + (jump-height-factor float) + (jump-start-anim-speed float) + (shadow-max-y meters) + (shadow-min-y meters) + (shadow-locus-dist meters) + (use-align symbol) + (draw-shadow symbol) + (move-to-ground symbol) + (hover-if-no-ground symbol) + (use-momentum symbol) + (use-flee symbol) + (use-proximity-notice symbol) + (use-jump-blocked symbol) + (use-jump-patrol symbol) + (gnd-collide-with collide-kind) + (debug-draw-neck symbol) + (debug-draw-jump symbol) ) - :method-count-assert 9 - :size-assert #xe8 - :flag-assert #x9000000e8 ) ;; definition for method 3 of type nav-enemy-info -(defmethod inspect nav-enemy-info ((this nav-enemy-info)) +(defmethod inspect ((this nav-enemy-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tidle-anim: ~D~%" (-> this idle-anim)) (format #t "~Twalk-anim: ~D~%" (-> this walk-anim)) @@ -119,99 +116,97 @@ ;; definition of type nav-enemy (deftype nav-enemy (process-drawable) - ((collide-info collide-shape-moving :offset 112) - (enemy-info fact-info-enemy :offset 144) - (hit-from-dir vector :inline :offset-assert 176) - (event-param-point vector :inline :offset-assert 192) - (frustration-point vector :inline :offset-assert 208) - (jump-dest vector :inline :offset-assert 224) - (jump-trajectory trajectory :inline :offset-assert 240) - (jump-time time-frame :offset-assert 280) - (nav-info nav-enemy-info :offset-assert 288) - (target-speed float :offset-assert 292) - (momentum-speed float :offset-assert 296) - (acceleration float :offset-assert 300) - (rotate-speed float :offset-assert 304) - (turn-time time-frame :offset-assert 312) - (frustration-time time-frame :offset-assert 320) - (speed-scale float :offset-assert 328) - (neck joint-mod :offset-assert 332) - (reaction-time time-frame :offset-assert 336) - (notice-time time-frame :offset-assert 344) - (state-timeout time-frame :offset-assert 352) - (free-time time-frame :offset-assert 360) - (touch-time time-frame :offset-assert 368) - (nav-enemy-flags nav-enemy-flags :offset-assert 376) - (incomming-attack-id handle :offset-assert 384) - (jump-return-state (state process) :offset-assert 392) - (rand-gen random-generator :offset-assert 396) + ((collide-info collide-shape-moving :overlay-at root) + (enemy-info fact-info-enemy :overlay-at fact) + (hit-from-dir vector :inline) + (event-param-point vector :inline) + (frustration-point vector :inline) + (jump-dest vector :inline) + (jump-trajectory trajectory :inline) + (jump-time time-frame) + (nav-info nav-enemy-info) + (target-speed float) + (momentum-speed float) + (acceleration float) + (rotate-speed float) + (turn-time time-frame) + (frustration-time time-frame) + (speed-scale float) + (neck joint-mod) + (reaction-time time-frame) + (notice-time time-frame) + (state-timeout time-frame) + (free-time time-frame) + (touch-time time-frame) + (nav-enemy-flags nav-enemy-flags) + (incomming-attack-id handle) + (jump-return-state (state process)) + (rand-gen random-generator) ) - :heap-base #x120 - :method-count-assert 76 - :size-assert #x190 - :flag-assert #x4c01200190 + (:state-methods + nav-enemy-attack + nav-enemy-chase + nav-enemy-flee + nav-enemy-die + nav-enemy-fuel-cell + nav-enemy-give-up + nav-enemy-jump + nav-enemy-jump-land + nav-enemy-idle + nav-enemy-notice + nav-enemy-patrol + nav-enemy-stare + nav-enemy-stop-chase + nav-enemy-victory + ) (:methods - (nav-enemy-attack () _type_ :state 20) - (nav-enemy-chase () _type_ :state 21) - (nav-enemy-flee () _type_ :state 22) - (nav-enemy-die () _type_ :state 23) - (nav-enemy-fuel-cell () _type_ :state 24) - (nav-enemy-give-up () _type_ :state 25) - (nav-enemy-jump () _type_ :state 26) - (nav-enemy-jump-land () _type_ :state 27) - (nav-enemy-idle () _type_ :state 28) - (nav-enemy-notice () _type_ :state 29) - (nav-enemy-patrol () _type_ :state 30) - (nav-enemy-stare () _type_ :state 31) - (nav-enemy-stop-chase () _type_ :state 32) - (nav-enemy-victory () _type_ :state 33) - (nav-enemy-method-34 (_type_) none 34) - (nav-enemy-wait-for-cue () _type_ :state 35) - (nav-enemy-jump-to-point () _type_ :state 36) - (nav-enemy-method-37 (_type_) none 37) - (nav-enemy-method-38 (_type_) none 38) - (common-post (_type_) none 39) - (nav-enemy-method-40 (_type_) none 40) - (nav-enemy-method-41 (_type_) none 41) - (new-patrol-point! (_type_) int 42) - (attack-handler (_type_ process event-message-block) object 43) - (touch-handler (_type_ process event-message-block) object 44) - (init-defaults! (_type_ nav-enemy-info) none 45) - (target-in-range? (_type_ float) basic 46) - (initialize-collision (_type_) none 47) - (nav-enemy-method-48 (_type_) none 48) - (init-jm! (_type_ nav-enemy-info) float 49) - (nav-enemy-method-50 (_type_ vector) symbol 50) - (nav-enemy-method-51 (_type_) none 51) - (nav-enemy-method-52 (_type_ vector) symbol 52) - (nav-enemy-method-53 (_type_) symbol 53) - (nav-enemy-method-54 (_type_ vector) symbol 54) - (nav-enemy-method-55 (_type_) symbol 55) - (set-jump-height-factor! (_type_ int) none 56) - (nav-enemy-method-57 (_type_) none 57) - (nav-enemy-method-58 (_type_) none 58) - (nav-enemy-method-59 (_type_) none 59) - (nav-enemy-method-60 (_type_ symbol) symbol 60) - (snow-bunny-attack () _type_ :state 61) - (snow-bunny-chase-hop () _type_ :state 62) - (snow-bunny-defend () _type_ :state 63) - (nav-enemy-method-64 () _type_ :state 64) - (snow-bunny-lunge () _type_ :state 65) - (snow-bunny-nav-resume () _type_ :state 66) - (snow-bunny-patrol-hop () _type_ :state 67) - (snow-bunny-patrol-idle () _type_ :state 68) - (nav-enemy-method-69 () _type_ :state 69) - (snow-bunny-retreat-hop () _type_ :state 70) - (snow-bunny-tune-spheres () _type_ :state 71) - (nav-enemy-touch-handler (_type_ process event-message-block) object 72) - (nav-enemy-attack-handler (_type_ process event-message-block) object 73) - (nav-enemy-jump-blocked () _type_ :state 74) - (nav-enemy-method-75 () _type_ :state 75) + (nav-enemy-method-34 (_type_) none) + (nav-enemy-wait-for-cue () _type_ :state) + (nav-enemy-jump-to-point () _type_ :state) + (nav-enemy-method-37 (_type_) none) + (nav-enemy-method-38 (_type_) none) + (common-post (_type_) none) + (nav-enemy-method-40 (_type_) none) + (nav-enemy-method-41 (_type_) none) + (new-patrol-point! (_type_) int) + (attack-handler (_type_ process event-message-block) object) + (touch-handler (_type_ process event-message-block) object) + (init-defaults! (_type_ nav-enemy-info) none) + (target-in-range? (_type_ float) basic) + (initialize-collision (_type_) none) + (nav-enemy-method-48 (_type_) none) + (init-jm! (_type_ nav-enemy-info) float) + (nav-enemy-method-50 (_type_ vector) symbol) + (nav-enemy-method-51 (_type_) none) + (nav-enemy-method-52 (_type_ vector) symbol) + (nav-enemy-method-53 (_type_) symbol) + (nav-enemy-method-54 (_type_ vector) symbol) + (nav-enemy-method-55 (_type_) symbol) + (set-jump-height-factor! (_type_ int) none) + (nav-enemy-method-57 (_type_) none) + (nav-enemy-method-58 (_type_) none) + (nav-enemy-method-59 (_type_) none) + (nav-enemy-method-60 (_type_ symbol) symbol) + (snow-bunny-attack () _type_ :state) + (snow-bunny-chase-hop () _type_ :state) + (snow-bunny-defend () _type_ :state) + (nav-enemy-method-64 () _type_ :state) + (snow-bunny-lunge () _type_ :state) + (snow-bunny-nav-resume () _type_ :state) + (snow-bunny-patrol-hop () _type_ :state) + (snow-bunny-patrol-idle () _type_ :state) + (nav-enemy-method-69 () _type_ :state) + (snow-bunny-retreat-hop () _type_ :state) + (snow-bunny-tune-spheres () _type_ :state) + (nav-enemy-touch-handler (_type_ process event-message-block) object) + (nav-enemy-attack-handler (_type_ process event-message-block) object) + (nav-enemy-jump-blocked () _type_ :state) + (nav-enemy-method-75 () _type_ :state) ) ) ;; definition for method 3 of type nav-enemy -(defmethod inspect nav-enemy ((this nav-enemy)) +(defmethod inspect ((this nav-enemy)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc index c09a020e657..c966f54fa99 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc @@ -36,14 +36,15 @@ ) ;; definition for method 9 of type trajectory -(defmethod eval-position! trajectory ((this trajectory) (time float) (result vector)) +;; INFO: this function exists in multiple non-identical object files +(defmethod eval-position! ((this trajectory) (time float) (result vector)) (vector+float*! result (-> this initial-position) (-> this initial-velocity) time) (+! (-> result y) (* 0.5 time time (-> this gravity))) result ) ;; definition for method 7 of type nav-enemy -(defmethod relocate nav-enemy ((this nav-enemy) (arg0 int)) +(defmethod relocate ((this nav-enemy) (arg0 int)) (if (nonzero? (-> this neck)) (set! (-> this neck) (the-as joint-mod (+ (the-as int (-> this neck)) arg0))) ) @@ -54,7 +55,7 @@ ) ;; definition for method 42 of type nav-enemy -(defmethod new-patrol-point! nav-enemy ((this nav-enemy)) +(defmethod new-patrol-point! ((this nav-enemy)) (local-vars (v1-11 symbol)) (if (<= (-> this path curve num-cverts) 0) (go process-drawable-art-error "no path") @@ -76,7 +77,7 @@ ;; definition for method 39 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod common-post nav-enemy ((this nav-enemy)) +(defmethod common-post ((this nav-enemy)) (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf8)) (or (not *target*) (and (not (logtest? (-> *target* state-flags) @@ -117,7 +118,7 @@ ) ;; definition for method 44 of type nav-enemy -(defmethod touch-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this nav-enemy) (arg0 process) (arg1 event-message-block)) (if (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) @@ -130,7 +131,7 @@ ) ;; definition for method 72 of type nav-enemy -(defmethod nav-enemy-touch-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod nav-enemy-touch-handler ((this nav-enemy) (arg0 process) (arg1 event-message-block)) (if (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) @@ -144,7 +145,7 @@ ;; definition for method 73 of type nav-enemy ;; INFO: Return type mismatch symbol vs object. -(defmethod nav-enemy-attack-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod nav-enemy-attack-handler ((this nav-enemy) (arg0 process) (arg1 event-message-block)) (send-event arg0 'get-attack-count 1) (logclear! (-> this mask) (process-mask actor-pause attackable)) (go (method-of-object this nav-enemy-die)) @@ -152,7 +153,7 @@ ) ;; definition for method 43 of type nav-enemy -(defmethod attack-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this nav-enemy) (arg0 process) (arg1 event-message-block)) (cond ((logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf5)) (send-event arg0 'get-attack-count 1) @@ -282,7 +283,7 @@ nav-enemy-default-event-handler ;; definition for method 40 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-40 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-40 ((this nav-enemy)) (nav-control-method-11 (-> this nav) (-> this nav target-pos)) 0 (none) @@ -291,7 +292,7 @@ nav-enemy-default-event-handler ;; definition for method 41 of type nav-enemy ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-41 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-41 ((this nav-enemy)) (cond ((-> this nav-info use-align) (align-vel-and-quat-only! @@ -343,7 +344,7 @@ nav-enemy-default-event-handler ;; definition for method 37 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-37 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-37 ((this nav-enemy)) (when (logtest? (-> this nav-enemy-flags) (nav-enemy-flags enable-travel)) (if (or (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf7)) (logtest? (nav-control-flags navcf19) (-> this nav flags)) @@ -368,7 +369,7 @@ nav-enemy-default-event-handler ;; definition for method 38 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-38 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-38 ((this nav-enemy)) (if (-> this nav-info move-to-ground) (integrate-for-enemy-with-move-to-ground! (-> this collide-info) @@ -551,7 +552,7 @@ nav-enemy-default-event-handler ) ;; definition for method 46 of type nav-enemy -(defmethod target-in-range? nav-enemy ((this nav-enemy) (arg0 float)) +(defmethod target-in-range? ((this nav-enemy) (arg0 float)) (and *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) @@ -801,7 +802,7 @@ nav-enemy-default-event-handler ) ;; definition for method 12 of type nav-enemy -(defmethod run-logic? nav-enemy ((this nav-enemy)) +(defmethod run-logic? ((this nav-enemy)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (and (>= (+ (-> *ACTOR-bank* pause-dist) (-> this collide-info pause-adjust-distance)) @@ -1753,7 +1754,7 @@ nav-enemy-default-event-handler ;; definition for method 45 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod init-defaults! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) +(defmethod init-defaults! ((this nav-enemy) (arg0 nav-enemy-info)) (set! (-> this rand-gen) (new 'process 'random-generator)) (set! (-> this rand-gen seed) (the-as uint #x666edd1e)) (set! (-> this mask) (the-as process-mask (logior (process-mask enemy) (-> this mask)))) @@ -1790,7 +1791,7 @@ nav-enemy-default-event-handler ) ;; definition for method 49 of type nav-enemy -(defmethod init-jm! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) +(defmethod init-jm! ((this nav-enemy) (arg0 nav-enemy-info)) (set! (-> this nav-info) arg0) (set! (-> this rotate-speed) (-> this nav-info walk-rotate-speed)) (set! (-> this turn-time) (-> this nav-info walk-turn-time)) @@ -1831,21 +1832,21 @@ nav-enemy-default-event-handler ;; definition for method 47 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision nav-enemy ((this nav-enemy)) +(defmethod initialize-collision ((this nav-enemy)) 0 (none) ) ;; definition for method 48 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-48 ((this nav-enemy)) 0 (none) ) ;; definition for method 59 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-59 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-59 ((this nav-enemy)) (go (method-of-object this nav-enemy-idle)) 0 (none) @@ -1853,7 +1854,7 @@ nav-enemy-default-event-handler ;; definition for method 11 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod init-from-entity! nav-enemy ((this nav-enemy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nav-enemy) (arg0 entity-actor)) (initialize-collision this) (process-drawable-from-entity! this arg0) (nav-enemy-method-48 this) @@ -1864,7 +1865,7 @@ nav-enemy-default-event-handler ;; definition for method 50 of type nav-enemy ;; INFO: Used lq/sq -(defmethod nav-enemy-method-50 nav-enemy ((this nav-enemy) (arg0 vector)) +(defmethod nav-enemy-method-50 ((this nav-enemy) (arg0 vector)) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> this collide-info trans quad)) (set! (-> this collide-info trans quad) (-> arg0 quad)) diff --git a/test/decompiler/reference/jak1/engine/common-obs/orb-cache_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/orb-cache_REF.gc index fef4d404ebe..bff1942a9d7 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/orb-cache_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/orb-cache_REF.gc @@ -3,23 +3,19 @@ ;; definition of type orb-cache-top (deftype orb-cache-top (baseplat) - ((active-distance float :offset-assert 228) - (inactive-distance float :offset-assert 232) - (money-list handle 60 :offset-assert 240) - (money-pos-list float 60 :offset-assert 720) - (money-pos-actual float 60 :offset-assert 960) - (platform-pos float :offset-assert 1200) - (root-pos float :offset-assert 1204) - (money int32 :offset-assert 1208) - (activated symbol :offset-assert 1212) + ((active-distance float) + (inactive-distance float) + (money-list handle 60) + (money-pos-list float 60) + (money-pos-actual float 60) + (platform-pos float) + (root-pos float) + (money int32) + (activated symbol) ) - :heap-base #x450 - :method-count-assert 29 - :size-assert #x4c0 - :flag-assert #x1d045004c0 (:methods - (pos-logic (_type_ symbol) symbol 27) - (calculate-pos (_type_ symbol) none 28) + (pos-logic (_type_ symbol) symbol) + (calculate-pos (_type_ symbol) none) ) (:states (orb-cache-top-activate symbol) @@ -29,7 +25,7 @@ ) ;; definition for method 3 of type orb-cache-top -(defmethod inspect orb-cache-top ((this orb-cache-top)) +(defmethod inspect ((this orb-cache-top)) (let ((t9-0 (method-of-type baseplat inspect))) (t9-0 this) ) @@ -69,7 +65,7 @@ ) ) :trans (behavior () - (if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (level-hint-spawn @@ -101,7 +97,7 @@ ;; definition for method 22 of type orb-cache-top ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-22 orb-cache-top ((this orb-cache-top)) +(defmethod baseplat-method-22 ((this orb-cache-top)) (if (< 4096.0 (- (-> this basetrans y) (-> this root-pos))) (activate! (-> this smush) -1.0 60 150 1.0 1.0) (activate! (-> this smush) -0.5 60 150 1.0 1.0) @@ -114,7 +110,7 @@ ;; definition for method 28 of type orb-cache-top ;; INFO: Return type mismatch int vs none. -(defmethod calculate-pos orb-cache-top ((this orb-cache-top) (arg0 symbol)) +(defmethod calculate-pos ((this orb-cache-top) (arg0 symbol)) (let ((f0-0 0.0)) (when arg0 (set! f0-0 (+ 10240.0 (* 6144.0 (the float (+ (-> this money) -1))))) @@ -136,7 +132,7 @@ ;; definition for method 27 of type orb-cache-top ;; INFO: Used lq/sq -(defmethod pos-logic orb-cache-top ((this orb-cache-top) (arg0 symbol)) +(defmethod pos-logic ((this orb-cache-top) (arg0 symbol)) (dotimes (s4-0 (-> this money)) (when (not (handle->process (-> this money-list s4-0))) (dotimes (v1-6 (-> this money)) @@ -166,7 +162,7 @@ (set! s3-0 #t) ) (when (and (< f30-0 15155.2) - (and *target* (>= 16384.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans)))) + (and *target* (>= 16384.0 (vector-vector-distance (-> this root trans) (-> *target* control trans)))) (< (-> (target-pos 0) y) (-> this basetrans y)) ) (set! f30-0 (if (< 14131.2 f28-0) @@ -232,18 +228,16 @@ ) (loop (calculate-pos self #t) - (while (not (or (not *target*) (< (-> self inactive-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) + (while (not (or (not *target*) + (< (-> self inactive-distance) (vector-vector-xz-distance (-> self root trans) (-> *target* control trans))) ) ) (pos-logic self #t) (suspend) ) (calculate-pos self #f) - (while (and (not (and (and *target* (>= (-> self active-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) + (while (and (not (and (and *target* + (>= (-> self active-distance) (vector-vector-xz-distance (-> self root trans) (-> *target* control trans))) ) (let ((a1-11 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-11 from) self) @@ -259,9 +253,8 @@ ) (suspend) ) - (if (not (and (and *target* (>= (-> self active-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (not (and (and *target* + (>= (-> self active-distance) (vector-vector-xz-distance (-> self root trans) (-> *target* control trans))) ) (let ((a1-14 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-14 from) self) @@ -298,7 +291,7 @@ ;; definition for method 11 of type orb-cache-top ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! orb-cache-top ((this orb-cache-top) (arg0 entity-actor)) +(defmethod init-from-entity! ((this orb-cache-top) (arg0 entity-actor)) (let ((a0-1 (-> this entity))) (if (when a0-1 (let ((a0-2 (-> a0-1 extra perm task))) @@ -328,13 +321,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton this *orb-cache-top-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (baseplat-method-21 this) (set! (-> this money) (res-lump-value (-> this entity) 'orb-cache-count int :default (the-as uint128 20))) (set! (-> this active-distance) 61440.0) diff --git a/test/decompiler/reference/jak1/engine/common-obs/plat-button_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/plat-button_REF.gc index 2c582a1f79c..f7fa84317b2 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/plat-button_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/plat-button_REF.gc @@ -3,40 +3,38 @@ ;; definition of type plat-button (deftype plat-button (process-drawable) - ((root-override collide-shape-moving :offset 112) - (go-back-if-lost-player? symbol :offset-assert 176) - (grab-player? symbol :offset-assert 180) - (should-grab-player? symbol :offset-assert 184) - (path-pos float :offset-assert 188) - (bidirectional? symbol :offset-assert 192) - (allow-auto-kill symbol :offset-assert 196) - (sound-id sound-id :offset-assert 200) - (trans-off vector :inline :offset-assert 208) - (spawn-pos vector :inline :offset-assert 224) + ((root collide-shape-moving :override) + (go-back-if-lost-player? symbol) + (grab-player? symbol) + (should-grab-player? symbol) + (path-pos float) + (bidirectional? symbol) + (allow-auto-kill symbol) + (sound-id sound-id) + (trans-off vector :inline) + (spawn-pos vector :inline) ) - :heap-base #x80 - :method-count-assert 33 - :size-assert #xf0 - :flag-assert #x21008000f0 + (:state-methods + plat-button-at-end + plat-button-idle + plat-button-pressed + plat-button-move-downward + plat-button-move-upward + plat-button-teleport-to-other-end + ) (:methods - (plat-button-at-end () _type_ :state 20) - (plat-button-idle () _type_ :state 21) - (plat-button-pressed () _type_ :state 22) - (plat-button-move-downward () _type_ :state 23) - (plat-button-move-upward () _type_ :state 24) - (plat-button-teleport-to-other-end () _type_ :state 25) - (can-activate? (_type_) symbol 26) - (plat-button-method-27 (_type_) none 27) - (plat-button-method-28 (_type_) collide-shape-moving 28) - (can-target-move? (_type_) none 29) - (should-teleport? (_type_) symbol 30) - (plat-button-method-31 (_type_) none 31) - (plat-button-method-32 (_type_) none 32) + (can-activate? (_type_) symbol) + (plat-button-method-27 (_type_) none) + (plat-button-method-28 (_type_) collide-shape-moving) + (can-target-move? (_type_) none) + (should-teleport? (_type_) symbol) + (plat-button-method-31 (_type_) none) + (plat-button-method-32 (_type_) none) ) ) ;; definition for method 3 of type plat-button -(defmethod inspect plat-button ((this plat-button)) +(defmethod inspect ((this plat-button)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -59,12 +57,12 @@ ) ;; definition for method 30 of type plat-button -(defmethod should-teleport? plat-button ((this plat-button)) +(defmethod should-teleport? ((this plat-button)) #f ) ;; definition for method 26 of type plat-button -(defmethod can-activate? plat-button ((this plat-button)) +(defmethod can-activate? ((this plat-button)) (or (= (-> this path-pos) 0.0) (and (-> this bidirectional?) (= (-> this path-pos) 1.0))) ) @@ -77,7 +75,7 @@ (when (can-activate? self) (if (and ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) (or (not (-> self should-grab-player?)) (set! (-> self grab-player?) (process-grab? *target*))) @@ -133,7 +131,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> self path) gp-0 f0-0 'interp) (vector+! gp-0 gp-0 (-> self trans-off)) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) ) (ja-post) @@ -223,18 +221,18 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> self path) gp-0 f0-4 'interp) (vector+! gp-0 gp-0 (-> self trans-off)) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) ) (sound-play "elev-loop" :id (-> self sound-id)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (-> self sound-id)) - (let ((a1-6 (-> self root-override trans))) + (let ((a1-6 (-> self root trans))) (let ((s5-0 self)) (when (= a1-6 #t) - (if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> s5-0 root-override))) - (set! a1-6 (-> s5-0 root-override trans)) + (if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> s5-0 root))) + (set! a1-6 (-> s5-0 root trans)) (set! a1-6 (the-as vector #f)) ) ) @@ -294,18 +292,18 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> self path) gp-0 f0-4 'interp) (vector+! gp-0 gp-0 (-> self trans-off)) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) ) (sound-play "elev-loop" :id (-> self sound-id)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (-> self sound-id)) - (let ((a1-6 (-> self root-override trans))) + (let ((a1-6 (-> self root trans))) (let ((s5-0 self)) (when (= a1-6 #t) - (if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> s5-0 root-override))) - (set! a1-6 (-> s5-0 root-override trans)) + (if (and s5-0 (type-type? (-> s5-0 type) process-drawable) (nonzero? (-> s5-0 root))) + (set! a1-6 (-> s5-0 root trans)) (set! a1-6 (the-as vector #f)) ) ) @@ -333,9 +331,7 @@ (sound-stop (-> self sound-id)) (sound-play "elev-land") (loop - (if (or (not *target*) - (< 268435460.0 (vector-vector-xz-distance-squared (-> self root-override trans) (target-pos 0))) - ) + (if (or (not *target*) (< 268435460.0 (vector-vector-xz-distance-squared (-> self root trans) (target-pos 0)))) (go-virtual plat-button-idle) ) (suspend) @@ -344,7 +340,7 @@ ) ;; definition for method 28 of type plat-button -(defmethod plat-button-method-28 plat-button ((this plat-button)) +(defmethod plat-button-method-28 ((this plat-button)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -380,21 +376,21 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) ;; definition for method 29 of type plat-button ;; INFO: Return type mismatch int vs none. -(defmethod can-target-move? plat-button ((this plat-button)) +(defmethod can-target-move? ((this plat-button)) 0 (none) ) ;; definition for method 27 of type plat-button ;; INFO: Return type mismatch symbol vs none. -(defmethod plat-button-method-27 plat-button ((this plat-button)) +(defmethod plat-button-method-27 ((this plat-button)) (ja-channel-set! 1) (cond ((can-activate? this) @@ -421,13 +417,13 @@ ) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (none) ) ;; definition for method 31 of type plat-button ;; INFO: Return type mismatch int vs none. -(defmethod plat-button-method-31 plat-button ((this plat-button)) +(defmethod plat-button-method-31 ((this plat-button)) (initialize-skeleton this *plat-button-sg* '()) 0 (none) @@ -435,7 +431,7 @@ ;; definition for method 32 of type plat-button ;; INFO: Return type mismatch int vs none. -(defmethod plat-button-method-32 plat-button ((this plat-button)) +(defmethod plat-button-method-32 ((this plat-button)) (go (method-of-object this plat-button-idle)) 0 (none) @@ -443,7 +439,7 @@ ;; definition for method 11 of type plat-button ;; INFO: Used lq/sq -(defmethod init-from-entity! plat-button ((this plat-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this plat-button) (arg0 entity-actor)) (set! (-> this go-back-if-lost-player?) #f) (set! (-> this grab-player?) #f) (set! (-> this should-grab-player?) #f) @@ -466,11 +462,11 @@ (logclear! (-> this mask) (process-mask actor-pause)) (plat-button-method-31 this) (logior! (-> this skel status) (janim-status inited)) - (set! (-> this spawn-pos quad) (-> this root-override trans quad)) + (set! (-> this spawn-pos quad) (-> this root trans quad)) (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (set! (-> this path-pos) 0.0) - (let ((s5-1 (-> this root-override trans))) + (let ((s5-1 (-> this root trans))) (eval-path-curve! (-> this path) s5-1 (-> this path-pos) 'interp) (vector+! s5-1 s5-1 (-> this trans-off)) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc index 7032a84ec27..c04ab7821a1 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc @@ -3,25 +3,21 @@ ;; definition of type plat-eco (deftype plat-eco (plat) - ((notice-dist float :offset-assert 264) - (sync-offset-dest float :offset-assert 268) - (sync-offset-faux float :offset-assert 272) - (sync-linear-val float :offset-assert 276) - (target handle :offset-assert 280) - (unlit-look lod-set :inline :offset-assert 288) - (lit-look lod-set :inline :offset-assert 324) + ((notice-dist float) + (sync-offset-dest float) + (sync-offset-faux float) + (sync-linear-val float) + (target handle) + (unlit-look lod-set :inline) + (lit-look lod-set :inline) ) - :heap-base #x100 - :method-count-assert 33 - :size-assert #x165 - :flag-assert #x2101000165 (:methods - (notice-blue (handle) _type_ :replace :state 29) + (notice-blue (handle) _type_ :state :overlay-at wad) ) ) ;; definition for method 3 of type plat-eco -(defmethod inspect plat-eco ((this plat-eco)) +(defmethod inspect ((this plat-eco)) (let ((t9-0 (method-of-type plat inspect))) (t9-0 this) ) @@ -71,7 +67,7 @@ ) :trans (behavior () (when (and (and *target* - (>= (-> self notice-dist) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + (>= (-> self notice-dist) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) @@ -79,14 +75,14 @@ (go-virtual plat-path-active (the-as plat #f)) ) (if (and *target* - (>= (-> self notice-dist) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + (>= (-> self notice-dist) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (level-hint-spawn (text-id misty-eco-plat) "sksp0073" (the-as entity #f) *entity-pool* (game-task none)) ) ) :code (behavior () (ja-post) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (anim-loop) ) :post ja-post @@ -98,7 +94,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('wake) - (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root trans))) (go-virtual plat-path-active (the-as plat #f)) ) (('ridden 'edge-grabbed) @@ -141,7 +137,7 @@ ) ) (when v1-6 - (let* ((s5-0 (-> self root-override root-prim prim-core)) + (let* ((s5-0 (-> self root root-prim prim-core)) (a1-3 (-> (the-as collide-shape v1-6) root-prim prim-core)) (f30-0 (vector-vector-distance (the-as vector s5-0) (the-as vector a1-3))) ) @@ -230,7 +226,7 @@ ;; definition for method 24 of type plat-eco ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 plat-eco ((this plat-eco)) +(defmethod baseplat-method-24 ((this plat-eco)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -249,25 +245,25 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 23 of type plat-eco -(defmethod get-unlit-skel plat-eco ((this plat-eco)) +(defmethod get-unlit-skel ((this plat-eco)) *plat-eco-unlit-sg* ) ;; definition for method 27 of type plat-eco -(defmethod get-lit-skel plat-eco ((this plat-eco)) +(defmethod get-lit-skel ((this plat-eco)) *plat-eco-lit-sg* ) ;; definition for method 11 of type plat-eco ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! plat-eco ((this plat-eco) (arg0 entity-actor)) +(defmethod init-from-entity! ((this plat-eco) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (set! (-> this notice-dist) (res-lump-float arg0 'notice-dist :default -1.0)) (set! (-> this link) (new 'process 'actor-link-info this)) @@ -281,7 +277,7 @@ (setup-lods! (-> this lit-look) s5-1 (-> this draw art-group) (-> this entity)) ) (logclear! (-> this mask) (process-mask actor-pause)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 107) this)) (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) @@ -294,7 +290,7 @@ (sync-now! (-> this sync) (-> this sync-linear-val)) (set! (-> this sync-offset-faux) (-> this sync offset)) (set! (-> this path-pos) (get-current-phase-with-mirror (-> this sync))) - (eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp) + (eval-path-curve! (-> this path) (-> this root trans) (-> this path-pos) 'interp) (set! (-> this sound-id) (new-sound-id)) (baseplat-method-26 this) (baseplat-method-21 this) diff --git a/test/decompiler/reference/jak1/engine/common-obs/plat_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/plat_REF.gc index 204cb19bdee..468d04f5811 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/plat_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/plat_REF.gc @@ -53,26 +53,22 @@ ;; definition of type plat (deftype plat (baseplat) - ((path-pos float :offset-assert 228) - (sync sync-info-eased :inline :offset-assert 232) - (sound-id sound-id :offset-assert 260) + ((path-pos float) + (sync sync-info-eased :inline) + (sound-id sound-id) ) - :heap-base #xa0 - :method-count-assert 33 - :size-assert #x108 - :flag-assert #x2100a00108 (:methods - (get-lit-skel (_type_) skeleton-group 27) - (plat-method-28 () none 28) - (wad () _type_ :state 29) - (plat-startup (plat) _type_ :state 30) - (plat-idle () _type_ :state 31) - (plat-path-active (plat) _type_ :state 32) + (get-lit-skel (_type_) skeleton-group) + (plat-method-28 () none) + (wad () _type_ :state) + (plat-startup (plat) _type_ :state) + (plat-idle () _type_ :state) + (plat-path-active (plat) _type_ :state) ) ) ;; definition for method 3 of type plat -(defmethod inspect plat ((this plat)) +(defmethod inspect ((this plat)) (let ((t9-0 (method-of-type baseplat inspect))) (t9-0 this) ) @@ -101,7 +97,7 @@ ) ;; definition for method 23 of type plat -(defmethod get-unlit-skel plat ((this plat)) +(defmethod get-unlit-skel ((this plat)) (cond ((= (-> (if (-> this entity) (-> this entity extra level) @@ -140,7 +136,7 @@ ;; definition for method 24 of type plat ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 plat ((this plat)) +(defmethod baseplat-method-24 ((this plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -159,7 +155,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -167,14 +163,14 @@ ;; definition for method 26 of type plat ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-26 plat ((this plat)) +(defmethod baseplat-method-26 ((this plat)) 0 (none) ) ;; definition for method 25 of type plat ;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group. -(defmethod baseplat-method-25 plat ((this plat)) +(defmethod baseplat-method-25 ((this plat)) (the-as sparticle-launch-group (when (!= (-> (if (-> this entity) (-> this entity extra level) (-> *level* level-default) @@ -251,8 +247,8 @@ ) ) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) + (if (< (vector-vector-distance (-> self root trans) (ear-trans)) 81920.0) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root trans))) ) (plat-trans) ) @@ -262,13 +258,13 @@ ;; definition for method 11 of type plat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! plat ((this plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this plat) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (baseplat-method-24 this) (process-drawable-from-entity! this arg0) (initialize-skeleton this (get-unlit-skel this) '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (baseplat-method-21 this) (baseplat-method-25 this) (load-params! (-> this sync) this (the-as uint 0) 0.0 0.15 0.15) @@ -292,7 +288,7 @@ (get-current-phase-with-mirror (-> this sync)) ) ) - (eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp) + (eval-path-curve! (-> this path) (-> this root trans) (-> this path-pos) 'interp) (let ((a0-18 this)) (baseplat-method-26 a0-18) (go (method-of-object this plat-startup) a0-18) @@ -300,7 +296,7 @@ ) (else (set! (-> this path-pos) 0.0) - (eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp) + (eval-path-curve! (-> this path) (-> this root trans) (-> this path-pos) 'interp) (let ((a0-20 this)) (baseplat-method-26 a0-20) (go (method-of-object this plat-startup) a0-20) diff --git a/test/decompiler/reference/jak1/engine/common-obs/process-taskable_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/process-taskable_REF.gc index 72a4574cf71..3a64fe35848 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/process-taskable_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/process-taskable_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 52 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-52 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-52 ((this process-taskable)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) @@ -19,7 +19,7 @@ ;; definition for method 9 of type gui-query ;; INFO: Return type mismatch int vs none. -(defmethod init! gui-query ((this gui-query) (arg0 string) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol) (arg5 string)) +(defmethod init! ((this gui-query) (arg0 string) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol) (arg5 string)) (set! (-> this x-position) arg1) (set! (-> this y-position) arg2) (set! (-> this message-space) arg3) @@ -32,7 +32,7 @@ ) ;; definition for method 10 of type gui-query -(defmethod get-response gui-query ((this gui-query)) +(defmethod get-response ((this gui-query)) (kill-current-level-hint '() '(sidekick voicebox stinger) 'exit) (level-hint-surpress!) (hide-hud) @@ -145,20 +145,17 @@ ;; definition for method 7 of type process-taskable ;; INFO: Return type mismatch process-drawable vs process-taskable. -(defmethod relocate process-taskable ((this process-taskable) (arg0 int)) +(defmethod relocate ((this process-taskable) (arg0 int)) (the-as process-taskable ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 46 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-46 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-46 ((this process-taskable)) (when (nonzero? (-> this sound-flava)) - (let ((s5-1 (vector-! - (new 'stack-no-clear 'vector) - (target-pos 0) - (the-as vector (-> this root-override root-prim prim-core)) - ) - ) + (let ((s5-1 + (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (the-as vector (-> this root root-prim prim-core))) + ) ) (set! (-> s5-1 y) (* 4.0 (-> s5-1 y))) (cond @@ -176,12 +173,9 @@ ) ) (when (-> this music) - (let ((s5-3 (vector-! - (new 'stack-no-clear 'vector) - (target-pos 0) - (the-as vector (-> this root-override root-prim prim-core)) - ) - ) + (let ((s5-3 + (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (the-as vector (-> this root root-prim prim-core))) + ) ) (set! (-> s5-3 y) (* 4.0 (-> s5-3 y))) (cond @@ -204,7 +198,7 @@ ;; definition for method 31 of type process-taskable ;; INFO: Return type mismatch art-joint-anim vs art-element. -(defmethod get-art-elem process-taskable ((this process-taskable)) +(defmethod get-art-elem ((this process-taskable)) (the-as art-element (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) ) @@ -213,13 +207,13 @@ ;; definition for method 32 of type process-taskable ;; INFO: Return type mismatch symbol vs basic. -(defmethod play-anim! process-taskable ((this process-taskable) (arg0 symbol)) +(defmethod play-anim! ((this process-taskable) (arg0 symbol)) (the-as basic #f) ) ;; definition for method 33 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-33 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-33 ((this process-taskable)) (let ((s5-0 (play-anim! this #f))) (if (type-type? (-> s5-0 type) spool-anim) (spool-push *art-control* (-> (the-as spool-anim s5-0) name) 0 this -99.0) @@ -230,7 +224,7 @@ ) ;; definition for method 51 of type process-taskable -(defmethod close-anim-file! process-taskable ((this process-taskable)) +(defmethod close-anim-file! ((this process-taskable)) (let* ((gp-0 (play-anim! this #f)) (v1-2 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) spool-anim)) gp-0 @@ -245,13 +239,13 @@ ;; definition for method 34 of type process-taskable ;; INFO: Return type mismatch symbol vs spool-anim. -(defmethod get-accept-anim process-taskable ((this process-taskable) (arg0 symbol)) +(defmethod get-accept-anim ((this process-taskable) (arg0 symbol)) (the-as spool-anim #f) ) ;; definition for method 35 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod push-accept-anim process-taskable ((this process-taskable)) +(defmethod push-accept-anim ((this process-taskable)) (let ((s5-0 (get-accept-anim this #f))) (if (type-type? (-> s5-0 type) spool-anim) (spool-push *art-control* (-> s5-0 name) 0 this -99.0) @@ -263,13 +257,13 @@ ;; definition for method 36 of type process-taskable ;; INFO: Return type mismatch symbol vs spool-anim. -(defmethod get-reject-anim process-taskable ((this process-taskable) (arg0 symbol)) +(defmethod get-reject-anim ((this process-taskable) (arg0 symbol)) (the-as spool-anim #f) ) ;; definition for method 37 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod push-reject-anim process-taskable ((this process-taskable)) +(defmethod push-reject-anim ((this process-taskable)) (let ((s5-0 (get-reject-anim this #f))) (if (type-type? (-> s5-0 type) spool-anim) (spool-push *art-control* (-> s5-0 name) 0 this -99.0) @@ -281,7 +275,7 @@ ;; definition for method 38 of type process-taskable ;; INFO: Return type mismatch object vs none. -(defmethod process-taskable-method-38 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-38 ((this process-taskable)) (if (nonzero? (-> this cell-for-task)) (go (method-of-object this give-cell)) ) @@ -365,9 +359,7 @@ ) :trans (behavior () (if (and (time-elapsed? (-> self state-time) (seconds 5)) - (or (not *target*) - (< 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (or (not *target*) (< 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) ) (go-virtual idle) ) @@ -651,7 +643,7 @@ ) ;; definition for method 39 of type process-taskable -(defmethod should-display? process-taskable ((this process-taskable)) +(defmethod should-display? ((this process-taskable)) #t ) @@ -681,7 +673,7 @@ ) 0 (process-taskable-clean-up-after-talking) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-channel-set! 0) (the-as int (ja-post)) ) @@ -696,7 +688,7 @@ (else (ja-channel-set! 1) (ja :group! (get-art-elem self)) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (process-entity-status! self (entity-perm-status bit-3) #t) (let ((v1-7 (-> self draw shadow-ctrl))) (logclear! (-> v1-7 settings flags) (shadow-flags disable-draw)) @@ -728,13 +720,11 @@ ;; definition for method 50 of type process-taskable ;; WARN: disable def twice: 4. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod process-taskable-method-50 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-50 ((this process-taskable)) (if *target* - (or (not *target*) - (< 245760.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans))) - ) + (or (not *target*) (< 245760.0 (vector-vector-distance (-> this root trans) (-> *target* control trans)))) (< 60397978000.0 - (vector-vector-distance-squared (the-as vector (-> this root-override root-prim prim-core)) (camera-pos)) + (vector-vector-distance-squared (the-as vector (-> this root root-prim prim-core)) (camera-pos)) ) ) ) @@ -816,7 +806,7 @@ (logior! (-> self mask) (process-mask actor-pause)) (let ((v1-6 (-> self entity extra trans))) (if v1-6 - (set! (-> self root-override trans quad) (-> v1-6 quad)) + (set! (-> self root trans quad) (-> v1-6 quad)) ) ) (ja-channel-set! 0) @@ -833,7 +823,7 @@ ) ;; definition for method 47 of type process-taskable -(defmethod target-above-threshold? process-taskable ((this process-taskable)) +(defmethod target-above-threshold? ((this process-taskable)) #t ) @@ -856,15 +846,10 @@ ) ) (('touch) - (the-as symbol (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> block param 0)) - 0.7 - 6144.0 - 16384.0 - ) - ) + (the-as + symbol + (send-shove-back (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) + ) ) (('clone) (the-as symbol (go-virtual be-clone (the-as handle (-> block param 0)))) @@ -921,10 +906,8 @@ (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) - (< (-> (target-pos 0) y) (+ 8192.0 (-> self root-override root-prim prim-core world-sphere y))) - (< (vector-vector-distance (target-pos 0) (the-as vector (-> self root-override root-prim prim-core))) - 32768.0 - ) + (< (-> (target-pos 0) y) (+ 8192.0 (-> self root root-prim prim-core world-sphere y))) + (< (vector-vector-distance (target-pos 0) (the-as vector (-> self root root-prim prim-core))) 32768.0) (= (-> *level* loading-level) (-> *level* level-default)) (not (movie?)) (not (level-hint-displayed?)) @@ -1007,7 +990,7 @@ ;; definition for method 41 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision process-taskable ((this process-taskable) (arg0 int) (arg1 vector)) +(defmethod initialize-collision ((this process-taskable) (arg0 int) (arg1 vector)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) @@ -1020,7 +1003,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1028,14 +1011,14 @@ ;; definition for method 40 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-40 process-taskable ((this process-taskable) (arg0 object) (arg1 skeleton-group) (arg2 int) (arg3 int) (arg4 vector) (arg5 int)) +(defmethod process-taskable-method-40 ((this process-taskable) (arg0 object) (arg1 skeleton-group) (arg2 int) (arg3 int) (arg4 vector) (arg5 int)) (stack-size-set! (-> this main-thread) 512) (initialize-collision this arg2 arg4) (process-drawable-from-entity! this (the-as entity-actor arg0)) (initialize-skeleton this arg1 '()) (set! (-> this shadow-backup) (-> this draw shadow)) (logior! (-> this skel status) (janim-status eye)) - (set! (-> this root-override pause-adjust-distance) -122880.0) + (set! (-> this root pause-adjust-distance) -122880.0) (set! (-> this fuel-cell-anim) (fuel-cell-pick-anim this)) (set! (-> this draw origin-joint-index) (the-as uint arg2)) (set! (-> this draw shadow-joint-index) (the-as uint arg2)) @@ -1065,7 +1048,7 @@ ;; definition for method 42 of type process-taskable ;; INFO: Return type mismatch object vs none. -(defmethod process-taskable-method-42 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-42 ((this process-taskable)) (cond ((not (should-display? this)) (go (method-of-object this hidden)) @@ -1082,20 +1065,20 @@ ;; definition for method 43 of type process-taskable ;; INFO: Return type mismatch int vs symbol. -(defmethod process-taskable-method-43 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-43 ((this process-taskable)) (the-as symbol 0) ) ;; definition for method 9 of type ambient-control ;; INFO: Return type mismatch int vs none. -(defmethod ambient-control-method-9 ambient-control ((this ambient-control)) +(defmethod ambient-control-method-9 ((this ambient-control)) (set! (-> this last-ambient-time) (-> *display* game-frame-counter)) 0 (none) ) ;; definition for method 10 of type ambient-control -(defmethod ambient-control-method-10 ambient-control ((this ambient-control) (arg0 vector) (arg1 time-frame) (arg2 float) (arg3 process-drawable)) +(defmethod ambient-control-method-10 ((this ambient-control) (arg0 vector) (arg1 time-frame) (arg2 float) (arg3 process-drawable)) (when (< (- (-> *display* game-frame-counter) (-> this last-ambient-time)) arg1) (set! arg0 (the-as vector #f)) (goto cfg-6) @@ -1110,7 +1093,7 @@ ) ;; definition for method 11 of type ambient-control -(defmethod play-ambient ambient-control ((this ambient-control) (arg0 string) (arg1 symbol) (arg2 vector)) +(defmethod play-ambient ((this ambient-control) (arg0 string) (arg1 symbol) (arg2 vector)) (when (and (not (string= arg0 (-> this last-ambient))) (or arg1 (can-hint-be-played? (text-id one) (the-as entity #f) (the-as string #f))) (= (-> *level* loading-level) (-> *level* level-default)) @@ -1220,7 +1203,7 @@ (format #t "ERROR: othercam parent invalid~%") (deactivate self) ) - (set! (-> *camera-other-root* quad) (-> (the-as process-taskable s2-0) root-override trans quad)) + (set! (-> *camera-other-root* quad) (-> (the-as process-taskable s2-0) root trans quad)) (let ((s4-0 (-> (the-as process-taskable s2-0) node-list data (-> self cam-joint-index) bone transform)) (s3-0 (-> (the-as process-taskable s2-0) node-list data (-> self cam-joint-index) bone scale)) (gp-0 (new 'stack-no-clear 'vector)) @@ -1304,7 +1287,7 @@ ;; definition for method 48 of type process-taskable ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow process-taskable ((this process-taskable)) +(defmethod draw-npc-shadow ((this process-taskable)) (let ((gp-0 (-> this draw shadow-ctrl))) (cond ((and (-> this draw shadow) diff --git a/test/decompiler/reference/jak1/engine/common-obs/rigid-body-h_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/rigid-body-h_REF.gc index e42595c7417..ea94a86a6bd 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/rigid-body-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/rigid-body-h_REF.gc @@ -3,49 +3,46 @@ ;; definition of type rigid-body (deftype rigid-body (structure) - ((mass float :offset-assert 0) - (inv-mass float :offset-assert 4) - (lin-momentum-damping-factor float :offset-assert 8) - (ang-momentum-damping-factor float :offset-assert 12) - (inertial-tensor matrix :inline :offset-assert 16) - (inv-inertial-tensor matrix :inline :offset-assert 80) - (cm-offset-joint vector :inline :offset-assert 144) - (position vector :inline :offset-assert 160) - (rotation quaternion :inline :offset-assert 176) - (lin-momentum vector :inline :offset-assert 192) - (ang-momentum vector :inline :offset-assert 208) - (lin-velocity vector :inline :offset-assert 224) - (ang-velocity vector :inline :offset-assert 240) - (inv-i-world matrix :inline :offset-assert 256) - (matrix matrix :inline :offset-assert 320) - (force vector :inline :offset-assert 384) - (torque vector :inline :offset-assert 400) - (max-ang-momentum float :offset-assert 416) - (max-ang-velocity float :offset-assert 420) + ((mass float) + (inv-mass float) + (lin-momentum-damping-factor float) + (ang-momentum-damping-factor float) + (inertial-tensor matrix :inline) + (inv-inertial-tensor matrix :inline) + (cm-offset-joint vector :inline) + (position vector :inline) + (rotation quaternion :inline) + (lin-momentum vector :inline) + (ang-momentum vector :inline) + (lin-velocity vector :inline) + (ang-velocity vector :inline) + (inv-i-world matrix :inline) + (matrix matrix :inline) + (force vector :inline) + (torque vector :inline) + (max-ang-momentum float) + (max-ang-velocity float) ) - :method-count-assert 23 - :size-assert #x1a8 - :flag-assert #x17000001a8 (:methods - (rigid-body-method-9 (_type_ float float float float) none 9) - (rigid-body-method-10 (_type_ float) none 10) - (clear-force-torque! (_type_) none 11) - (clear-momentum! (_type_) none 12) - (rigid-body-method-13 (_type_ vector vector) none 13) - (rigid-body-method-14 (_type_ vector vector) none 14) - (rigid-body-method-15 (_type_ vector) none 15) - (rigid-body-method-16 (_type_ vector vector float) none 16) - (rigid-body-method-17 (_type_ vector vector) vector 17) - (rigid-body-method-18 (_type_ vector) vector 18) - (print-stats (_type_) none 19) - (rigid-body-method-20 (_type_) none 20) - (rigid-body-method-21 (_type_) none 21) - (rigid-body-method-22 (_type_ vector quaternion float float) none 22) + (rigid-body-method-9 (_type_ float float float float) none) + (rigid-body-method-10 (_type_ float) none) + (clear-force-torque! (_type_) none) + (clear-momentum! (_type_) none) + (rigid-body-method-13 (_type_ vector vector) none) + (rigid-body-method-14 (_type_ vector vector) none) + (rigid-body-method-15 (_type_ vector) none) + (rigid-body-method-16 (_type_ vector vector float) none) + (rigid-body-method-17 (_type_ vector vector) vector) + (rigid-body-method-18 (_type_ vector) vector) + (print-stats (_type_) none) + (rigid-body-method-20 (_type_) none) + (rigid-body-method-21 (_type_) none) + (rigid-body-method-22 (_type_ vector quaternion float float) none) ) ) ;; definition for method 3 of type rigid-body -(defmethod inspect rigid-body ((this rigid-body)) +(defmethod inspect ((this rigid-body)) (format #t "[~8x] ~A~%" this 'rigid-body) (format #t "~Tmass: ~f~%" (-> this mass)) (format #t "~Tinv-mass: ~f~%" (-> this inv-mass)) @@ -71,17 +68,14 @@ ;; definition of type rigid-body-control-point (deftype rigid-body-control-point (structure) - ((local-pos vector :inline :offset-assert 0) - (world-pos vector :inline :offset-assert 16) - (velocity vector :inline :offset-assert 32) + ((local-pos vector :inline) + (world-pos vector :inline) + (velocity vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type rigid-body-control-point -(defmethod inspect rigid-body-control-point ((this rigid-body-control-point)) +(defmethod inspect ((this rigid-body-control-point)) (format #t "[~8x] ~A~%" this 'rigid-body-control-point) (format #t "~Tlocal-pos: #~%" (-> this local-pos)) (format #t "~Tworld-pos: #~%" (-> this world-pos)) diff --git a/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc index 7534c56ad5b..de0588c0797 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc @@ -4,7 +4,7 @@ ;; definition for method 11 of type rigid-body ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod clear-force-torque! rigid-body ((this rigid-body)) +(defmethod clear-force-torque! ((this rigid-body)) (set! (-> this force quad) (-> *null-vector* quad)) (set! (-> this torque quad) (-> *null-vector* quad)) 0 @@ -14,7 +14,7 @@ ;; definition for method 12 of type rigid-body ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod clear-momentum! rigid-body ((this rigid-body)) +(defmethod clear-momentum! ((this rigid-body)) (set! (-> this lin-momentum quad) (-> *null-vector* quad)) (set! (-> this ang-momentum quad) (-> *null-vector* quad)) 0 @@ -23,7 +23,7 @@ ;; definition for method 21 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-21 rigid-body ((this rigid-body)) +(defmethod rigid-body-method-21 ((this rigid-body)) (quaternion->matrix (-> this matrix) (-> this rotation)) (rigid-body-method-18 this (-> this matrix vector 3)) 0 @@ -33,7 +33,7 @@ ;; definition for method 22 of type rigid-body ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-22 rigid-body ((this rigid-body) (arg0 vector) (arg1 quaternion) (arg2 float) (arg3 float)) +(defmethod rigid-body-method-22 ((this rigid-body) (arg0 vector) (arg1 quaternion) (arg2 float) (arg3 float)) (clear-force-torque! this) (clear-momentum! this) (vector+! (-> this position) arg0 (-> this cm-offset-joint)) @@ -56,7 +56,7 @@ ;; definition for method 9 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-9 rigid-body ((this rigid-body) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) +(defmethod rigid-body-method-9 ((this rigid-body) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (set! (-> this mass) arg0) (let ((f0-1 arg0)) (set! (-> this inv-mass) (/ 1.0 f0-1)) @@ -100,7 +100,7 @@ ) ;; definition for method 17 of type rigid-body -(defmethod rigid-body-method-17 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-17 ((this rigid-body) (arg0 vector) (arg1 vector)) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position)))) (vector-cross! arg1 (-> this ang-velocity) v1-1) ) @@ -131,7 +131,7 @@ ;; definition for method 10 of type rigid-body ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-10 rigid-body ((this rigid-body) (arg0 float)) +(defmethod rigid-body-method-10 ((this rigid-body) (arg0 float)) (vector+*! (-> this lin-momentum) (-> this lin-momentum) (-> this force) arg0) (vector+*! (-> this ang-momentum) (-> this ang-momentum) (-> this torque) arg0) (vector-float*! (-> this lin-momentum) (-> this lin-momentum) (-> this lin-momentum-damping-factor)) @@ -160,7 +160,7 @@ ;; definition for method 13 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-13 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-13 ((this rigid-body) (arg0 vector) (arg1 vector)) (vector+! (-> this force) (-> this force) arg1) (let* ((v1-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position))) (a1-2 (vector-cross! (new 'stack-no-clear 'vector) v1-2 arg1)) @@ -173,7 +173,7 @@ ;; definition for method 16 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-16 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod rigid-body-method-16 ((this rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) (vector+! (-> this force) (-> this force) arg1) (let* ((a0-3 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position))) (s4-1 (vector-cross! (new 'stack-no-clear 'vector) a0-3 arg1)) @@ -191,7 +191,7 @@ ;; definition for method 14 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-14 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-14 ((this rigid-body) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -206,14 +206,14 @@ ;; definition for method 15 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-15 rigid-body ((this rigid-body) (arg0 vector)) +(defmethod rigid-body-method-15 ((this rigid-body) (arg0 vector)) (vector+! (-> this force) (-> this force) arg0) 0 (none) ) ;; definition for method 18 of type rigid-body -(defmethod rigid-body-method-18 rigid-body ((this rigid-body) (arg0 vector)) +(defmethod rigid-body-method-18 ((this rigid-body) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-rotate*! gp-0 (-> this cm-offset-joint) (-> this matrix)) (vector-! arg0 (-> this position) gp-0) @@ -223,7 +223,7 @@ ;; definition for method 19 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod print-stats rigid-body ((this rigid-body)) +(defmethod print-stats ((this rigid-body)) (format #t " force ~M ~M ~M" (-> this force x) (-> this force y) (-> this force z)) (format #t " torque ~f ~f ~f~%" (-> this torque x) (-> this torque y) (-> this torque z)) (format #t " position ~M ~M ~M" (-> this position x) (-> this position y) (-> this position z)) @@ -245,7 +245,7 @@ ;; definition for method 20 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-20 rigid-body ((this rigid-body)) +(defmethod rigid-body-method-20 ((this rigid-body)) (format #t " force ~M ~M ~M" (-> this force x) (-> this force y) (-> this force z)) (format #t " torque ~f ~f ~f~%" (-> this torque x) (-> this torque y) (-> this torque z)) 0 @@ -254,39 +254,36 @@ ;; definition of type rigid-body-platform-constants (deftype rigid-body-platform-constants (structure) - ((drag-factor float :offset-assert 0) - (buoyancy-factor float :offset-assert 4) - (max-buoyancy-depth meters :offset-assert 8) - (gravity-factor float :offset-assert 12) - (gravity meters :offset-assert 16) - (player-weight meters :offset-assert 20) - (player-bonk-factor float :offset-assert 24) - (player-dive-factor float :offset-assert 28) - (player-force-distance meters :offset-assert 32) - (player-force-clamp meters :offset-assert 36) - (player-force-timeout time-frame :offset-assert 40) - (explosion-force meters :offset-assert 48) - (linear-damping float :offset-assert 52) - (angular-damping float :offset-assert 56) - (control-point-count int32 :offset-assert 60) - (mass float :offset-assert 64) - (inertial-tensor-x meters :offset-assert 68) - (inertial-tensor-y meters :offset-assert 72) - (inertial-tensor-z meters :offset-assert 76) - (cm-joint-x meters :offset-assert 80) - (cm-joint-y meters :offset-assert 84) - (cm-joint-z meters :offset-assert 88) - (idle-distance meters :offset-assert 92) - (platform symbol :offset-assert 96) - (sound-name string :offset-assert 100) + ((drag-factor float) + (buoyancy-factor float) + (max-buoyancy-depth meters) + (gravity-factor float) + (gravity meters) + (player-weight meters) + (player-bonk-factor float) + (player-dive-factor float) + (player-force-distance meters) + (player-force-clamp meters) + (player-force-timeout time-frame) + (explosion-force meters) + (linear-damping float) + (angular-damping float) + (control-point-count int32) + (mass float) + (inertial-tensor-x meters) + (inertial-tensor-y meters) + (inertial-tensor-z meters) + (cm-joint-x meters) + (cm-joint-y meters) + (cm-joint-z meters) + (idle-distance meters) + (platform symbol) + (sound-name string) ) - :method-count-assert 9 - :size-assert #x68 - :flag-assert #x900000068 ) ;; definition for method 3 of type rigid-body-platform-constants -(defmethod inspect rigid-body-platform-constants ((this rigid-body-platform-constants)) +(defmethod inspect ((this rigid-body-platform-constants)) (format #t "[~8x] ~A~%" this 'rigid-body-platform-constants) (format #t "~Tdrag-factor: ~f~%" (-> this drag-factor)) (format #t "~Tbuoyancy-factor: ~f~%" (-> this buoyancy-factor)) @@ -318,15 +315,12 @@ ;; definition of type rigid-body-control-point-inline-array (deftype rigid-body-control-point-inline-array (inline-array-class) - ((data rigid-body-control-point :inline :dynamic :offset 16) + ((data rigid-body-control-point :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type rigid-body-control-point-inline-array -(defmethod inspect rigid-body-control-point-inline-array ((this rigid-body-control-point-inline-array)) +(defmethod inspect ((this rigid-body-control-point-inline-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -339,47 +333,45 @@ ;; definition of type rigid-body-platform (deftype rigid-body-platform (process-drawable) - ((root-overlay collide-shape-moving :offset 112) - (info rigid-body-platform-constants :offset-assert 176) - (rbody rigid-body :inline :offset-assert 192) - (control-point-array rigid-body-control-point-inline-array :offset-assert 616) - (player-velocity vector :inline :offset-assert 624) - (player-velocity-prev vector :inline :offset-assert 640) - (player-force-position vector :inline :offset-assert 656) - (player-force vector :inline :offset-assert 672) - (sim-time-remaining float :offset-assert 688) - (float-height-offset float :offset-assert 692) - (player-attack-id int32 :offset-assert 696) - (player-bonk-timeout time-frame :offset-assert 704) - (water-anim water-anim :offset-assert 712) - (player-contact basic :offset-assert 716) - (player-impulse collide-shape-prim-mesh :offset-assert 720) + ((root-overlay collide-shape-moving :overlay-at root) + (info rigid-body-platform-constants) + (rbody rigid-body :inline) + (control-point-array rigid-body-control-point-inline-array) + (player-velocity vector :inline) + (player-velocity-prev vector :inline) + (player-force-position vector :inline) + (player-force vector :inline) + (sim-time-remaining float) + (float-height-offset float) + (player-attack-id int32) + (player-bonk-timeout time-frame) + (water-anim water-anim) + (player-contact basic) + (player-impulse collide-shape-prim-mesh) ) - :heap-base #x270 - :method-count-assert 35 - :size-assert #x2d4 - :flag-assert #x23027002d4 + (:state-methods + rigid-body-platform-idle + rigid-body-platform-float + ) (:methods - (rigid-body-platform-idle () _type_ :state 20) - (rigid-body-platform-float () _type_ :state 21) - (rigid-body-platform-method-22 (_type_ vector float) float 22) - (rigid-body-platform-method-23 (_type_ float) none 23) - (rigid-body-platform-method-24 (_type_ rigid-body-control-point float) none 24) - (rigid-body-platform-method-25 (_type_) none 25) - (rigid-body-platform-method-26 (_type_) none 26) - (rigid-body-platform-method-27 (_type_ vector) none 27) - (rigid-body-platform-method-28 (_type_) none 28) - (rigid-body-platform-method-29 (_type_ rigid-body-platform-constants) none 29) - (rigid-body-platform-method-30 (_type_) none 30) - (rigid-body-platform-method-31 (_type_) none 31) - (rigid-body-platform-method-32 (_type_) sound-id 32) - (rigid-body-platform-method-33 (_type_) object 33) - (rigid-body-platform-method-34 (_type_) none 34) + (rigid-body-platform-method-22 (_type_ vector float) float) + (rigid-body-platform-method-23 (_type_ float) none) + (rigid-body-platform-method-24 (_type_ rigid-body-control-point float) none) + (rigid-body-platform-method-25 (_type_) none) + (rigid-body-platform-method-26 (_type_) none) + (rigid-body-platform-method-27 (_type_ vector) none) + (rigid-body-platform-method-28 (_type_) none) + (rigid-body-platform-method-29 (_type_ rigid-body-platform-constants) none) + (rigid-body-platform-method-30 (_type_) none) + (rigid-body-platform-method-31 (_type_) none) + (rigid-body-platform-method-32 (_type_) sound-id) + (rigid-body-platform-method-33 (_type_) object) + (rigid-body-platform-method-34 (_type_) none) ) ) ;; definition for method 3 of type rigid-body-platform -(defmethod inspect rigid-body-platform ((this rigid-body-platform)) +(defmethod inspect ((this rigid-body-platform)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -401,7 +393,7 @@ ) ;; definition for method 7 of type rigid-body-platform -(defmethod relocate rigid-body-platform ((this rigid-body-platform) (arg0 int)) +(defmethod relocate ((this rigid-body-platform) (arg0 int)) (if (nonzero? (-> this control-point-array)) (set! (-> this control-point-array) (the-as rigid-body-control-point-inline-array (+ (the-as int (-> this control-point-array)) arg0)) @@ -411,7 +403,7 @@ ) ;; definition for method 22 of type rigid-body-platform -(defmethod rigid-body-platform-method-22 rigid-body-platform ((this rigid-body-platform) (arg0 vector) (arg1 float)) +(defmethod rigid-body-platform-method-22 ((this rigid-body-platform) (arg0 vector) (arg1 float)) (let ((v1-0 (-> this water-anim))) 0.0 (+ (the-as float (cond @@ -440,7 +432,7 @@ ;; definition for method 24 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-24 rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-control-point) (arg1 float)) +(defmethod rigid-body-platform-method-24 ((this rigid-body-platform) (arg0 rigid-body-control-point) (arg1 float)) (set! (-> arg0 world-pos w) (rigid-body-platform-method-22 this (-> arg0 world-pos) arg1)) (let* ((s4-0 (new 'stack-no-clear 'vector)) (f0-2 (- (-> arg0 world-pos w) (-> arg0 world-pos y))) @@ -466,7 +458,7 @@ ;; definition for method 25 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-25 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-25 ((this rigid-body-platform)) (when (or (-> this player-impulse) (-> this player-contact)) (set! (-> this player-impulse) #f) (rigid-body-method-16 @@ -482,7 +474,7 @@ ;; definition for method 26 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-26 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-26 ((this rigid-body-platform)) (let ((a1-0 (new 'stack-no-clear 'vector))) (vector-float*! a1-0 @@ -497,7 +489,7 @@ ;; definition for method 27 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-27 rigid-body-platform ((this rigid-body-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-27 ((this rigid-body-platform) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 arg0 (-> this rbody position)) (set! (-> gp-0 y) 0.0) @@ -516,7 +508,7 @@ ;; definition for method 23 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 rigid-body-platform ((this rigid-body-platform) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this rigid-body-platform) (arg0 float)) (let ((s4-0 (-> this rbody matrix))) (dotimes (s3-0 (-> this info control-point-count)) (let ((s2-0 (-> this control-point-array data s3-0))) @@ -535,7 +527,7 @@ ;; definition for method 28 of type rigid-body-platform ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-28 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-28 ((this rigid-body-platform)) (if (-> this info platform) (detect-riders! (-> this root-overlay)) ) @@ -754,7 +746,7 @@ ;; definition for method 29 of type rigid-body-platform ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-29 rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-platform-constants)) +(defmethod rigid-body-platform-method-29 ((this rigid-body-platform) (arg0 rigid-body-platform-constants)) (set! (-> this info) arg0) (set! (-> this control-point-array) (new 'process 'rigid-body-control-point-inline-array (-> this info control-point-count)) @@ -795,7 +787,7 @@ ;; definition for method 30 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-30 ((this rigid-body-platform)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -849,7 +841,7 @@ ;; definition for method 34 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-34 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-34 ((this rigid-body-platform)) (go (method-of-object this rigid-body-platform-idle)) 0 (none) @@ -857,7 +849,7 @@ ;; definition for method 31 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-31 ((this rigid-body-platform)) (set! (-> this float-height-offset) 0.0) (rigid-body-platform-method-29 this *rigid-body-platform-constants*) (let ((s5-0 (-> this info control-point-count))) @@ -878,7 +870,7 @@ ;; definition for method 11 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod init-from-entity! rigid-body-platform ((this rigid-body-platform) (arg0 entity-actor)) +(defmethod init-from-entity! ((this rigid-body-platform) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (rigid-body-platform-method-30 this) (process-drawable-from-entity! this arg0) diff --git a/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc index c0c72a543ff..07fc68ab5cb 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc @@ -3,33 +3,30 @@ ;; definition of type ropebridge-tuning (deftype ropebridge-tuning (structure) - ((num-springs int32 :offset-assert 0) - (num-spring-points int32 :offset-assert 4) - (col-mesh-indexes (pointer uint8) :offset-assert 8) - (view-frustum-radius float :offset-assert 12) - (root-prim-radius float :offset-assert 16) - (desired-spring-len float :offset-assert 20) - (gravity float :offset-assert 24) - (spring-coefficient float :offset-assert 28) - (spring-mass float :offset-assert 32) - (friction float :offset-assert 36) - (max-influence-dist float :offset-assert 40) - (rider-max-gravity float :offset-assert 44) - (max-bonk-influence-dist float :offset-assert 48) - (rider-bonk-force float :offset-assert 52) - (rider-bonk-min float :offset-assert 56) - (rider-bonk-max float :offset-assert 60) - (normal-board-len float :offset-assert 64) - (bridge-end-to-end-len float :offset-assert 68) - (rest-state symbol :offset-assert 72) + ((num-springs int32) + (num-spring-points int32) + (col-mesh-indexes (pointer uint8)) + (view-frustum-radius float) + (root-prim-radius float) + (desired-spring-len float) + (gravity float) + (spring-coefficient float) + (spring-mass float) + (friction float) + (max-influence-dist float) + (rider-max-gravity float) + (max-bonk-influence-dist float) + (rider-bonk-force float) + (rider-bonk-min float) + (rider-bonk-max float) + (normal-board-len float) + (bridge-end-to-end-len float) + (rest-state symbol) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) ;; definition for method 3 of type ropebridge-tuning -(defmethod inspect ropebridge-tuning ((this ropebridge-tuning)) +(defmethod inspect ((this ropebridge-tuning)) (format #t "[~8x] ~A~%" this 'ropebridge-tuning) (format #t "~Tnum-springs: ~D~%" (-> this num-springs)) (format #t "~Tnum-spring-points: ~D~%" (-> this num-spring-points)) @@ -483,18 +480,15 @@ ;; definition of type ropebridge-spring-point (deftype ropebridge-spring-point (structure) - ((local-pos vector :inline :offset-assert 0) - (vel vector :inline :offset-assert 16) - (extra-force vector :inline :offset-assert 32) + ((local-pos vector :inline) + (vel vector :inline) + (extra-force vector :inline) ) :pack-me - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type ropebridge-spring-point -(defmethod inspect ropebridge-spring-point ((this ropebridge-spring-point)) +(defmethod inspect ((this ropebridge-spring-point)) (format #t "[~8x] ~A~%" this 'ropebridge-spring-point) (format #t "~Tlocal-pos: #~%" (-> this local-pos)) (format #t "~Tvel: #~%" (-> this vel)) @@ -504,35 +498,31 @@ ;; definition of type ropebridge (deftype ropebridge (process-drawable) - ((root-override collide-shape :offset 112) - (subtype uint64 :offset-assert 176) - (subtype-name string :offset-assert 184) - (agitated-time-stamp time-frame :offset-assert 192) - (bonk-time-stamp time-frame :offset-assert 200) - (attack-flop-time-stamp time-frame :offset-assert 208) - (player-attack-id uint64 :offset-assert 216) - (sleep-dist float :offset-assert 224) - (do-physics? basic :offset-assert 228) - (tuning ropebridge-tuning :offset-assert 232) - (world-matrix matrix :inline :offset-assert 240) - (inv-world-matrix matrix :inline :offset-assert 304) - (extra-trans vector :inline :offset-assert 368) - (spring-point ropebridge-spring-point 36 :inline :offset-assert 384) + ((root collide-shape :override) + (subtype uint64) + (subtype-name string) + (agitated-time-stamp time-frame) + (bonk-time-stamp time-frame) + (attack-flop-time-stamp time-frame) + (player-attack-id uint64) + (sleep-dist float) + (do-physics? basic) + (tuning ropebridge-tuning) + (world-matrix matrix :inline) + (inv-world-matrix matrix :inline) + (extra-trans vector :inline) + (spring-point ropebridge-spring-point 36 :inline) ) - :heap-base #x7d0 - :method-count-assert 29 - :size-assert #x840 - :flag-assert #x1d07d00840 (:methods - (set-vel-from-impact (_type_ uint vector int float) none 20) - (set-vel-from-riders (_type_) none 21) - (set-vel-from-rider (_type_ uint vector int) none 22) - (clear-spring-forces (_type_) none 23) - (debug-draw (_type_) none 24) - (set-to-rest-state (_type_) none 25) - (add-collision-meshes (_type_) none 26) - (do-integration (_type_) none 27) - (ropebridge-method-28 (_type_) none 28) + (set-vel-from-impact (_type_ uint vector int float) none) + (set-vel-from-riders (_type_) none) + (set-vel-from-rider (_type_ uint vector int) none) + (clear-spring-forces (_type_) none) + (debug-draw (_type_) none) + (set-to-rest-state (_type_) none) + (add-collision-meshes (_type_) none) + (do-integration (_type_) none) + (ropebridge-method-28 (_type_) none) ) (:states ropebridge-idle @@ -540,7 +530,7 @@ ) ;; definition for method 3 of type ropebridge -(defmethod inspect ropebridge ((this ropebridge)) +(defmethod inspect ((this ropebridge)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -634,7 +624,7 @@ ) (gp-0 (the-as object (-> block param 0))) (a0-7 (-> (the-as touching-shapes-entry gp-0) head)) - (s4-0 (-> self root-override)) + (s4-0 (-> self root)) (s5-0 (get-touched-prim a0-7 s4-0 (the-as touching-shapes-entry gp-0))) (v1-33 ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s4-0)) (gp-1 (new 'stack-no-clear 'vector)) @@ -655,7 +645,7 @@ :code (behavior () (loop (suspend) - (detect-riders! (-> self root-override)) + (detect-riders! (-> self root)) (when (-> self do-physics?) (clear-spring-forces self) (set-vel-from-riders self) @@ -665,7 +655,7 @@ ) :post (behavior () (ja-post) - (let ((gp-0 (-> self root-override))) + (let ((gp-0 (-> self root))) (update-transforms! gp-0) (when (-> self do-physics?) (pull-riders! gp-0) @@ -679,7 +669,7 @@ ;; definition for method 20 of type ropebridge ;; INFO: Return type mismatch symbol vs none. ;; WARN: Function (method 20 ropebridge) has a return type of none, but the expression builder found a return statement. -(defmethod set-vel-from-impact ropebridge ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int) (arg3 float)) +(defmethod set-vel-from-impact ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int) (arg3 float)) (loop (let ((f0-2 (fabs (- (-> arg1 z) (-> this spring-point (the-as int arg0) local-pos z))))) (if (< (-> this tuning max-bonk-influence-dist) f0-2) @@ -705,7 +695,7 @@ ;; definition for method 23 of type ropebridge ;; INFO: Used lq/sq ;; INFO: Return type mismatch symbol vs none. -(defmethod clear-spring-forces ropebridge ((this ropebridge)) +(defmethod clear-spring-forces ((this ropebridge)) (let ((v1-0 (the-as ropebridge-spring-point (-> this spring-point)))) (countdown (a0-2 (-> this tuning num-spring-points)) (set! (-> v1-0 extra-force quad) (the-as uint128 0)) @@ -719,8 +709,8 @@ ;; definition for method 21 of type ropebridge ;; INFO: Return type mismatch symbol vs none. -(defmethod set-vel-from-riders ropebridge ((this ropebridge)) - (let ((v1-1 (-> this root-override riders))) +(defmethod set-vel-from-riders ((this ropebridge)) + (let ((v1-1 (-> this root riders))) (when v1-1 (let ((s5-0 (the-as collide-sticky-rider (-> v1-1 rider)))) (countdown (s4-0 (-> v1-1 num-riders)) @@ -753,7 +743,7 @@ ;; definition for method 22 of type ropebridge ;; INFO: Return type mismatch symbol vs none. ;; WARN: Function (method 22 ropebridge) has a return type of none, but the expression builder found a return statement. -(defmethod set-vel-from-rider ropebridge ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int)) +(defmethod set-vel-from-rider ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int)) (loop (let ((f0-0 (vector-vector-distance arg1 (the-as vector (-> this spring-point (the-as int arg0)))))) (if (< (-> this tuning max-influence-dist) f0-0) @@ -776,7 +766,7 @@ ;; definition for method 27 of type ropebridge ;; INFO: Return type mismatch int vs none. -(defmethod do-integration ropebridge ((this ropebridge)) +(defmethod do-integration ((this ropebridge)) (local-vars (a2-1 float) (a3-0 float)) (rlet ((Q :class vf) (vf0 :class vf) @@ -901,7 +891,7 @@ ;; definition for method 24 of type ropebridge ;; INFO: Return type mismatch symbol vs none. -(defmethod debug-draw ropebridge ((this ropebridge)) +(defmethod debug-draw ((this ropebridge)) (let ((gp-0 (-> this node-list data 0 bone transform)) (s5-0 (the-as ropebridge-spring-point (-> this spring-point))) (s4-0 (new 'stack-no-clear 'vector)) @@ -917,7 +907,7 @@ ;; definition for method 25 of type ropebridge ;; INFO: Return type mismatch symbol vs none. -(defmethod set-to-rest-state ropebridge ((this ropebridge)) +(defmethod set-to-rest-state ((this ropebridge)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -1007,8 +997,8 @@ ;; definition for method 26 of type ropebridge ;; INFO: Return type mismatch symbol vs none. -(defmethod add-collision-meshes ropebridge ((this ropebridge)) - (let* ((s5-0 (-> this root-override)) +(defmethod add-collision-meshes ((this ropebridge)) + (let* ((s5-0 (-> this root)) (s3-0 (-> this tuning)) (s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint (-> s3-0 num-springs)) 0)) ) @@ -1038,10 +1028,10 @@ ) ;; definition for method 12 of type ropebridge -(defmethod run-logic? ropebridge ((this ropebridge)) +(defmethod run-logic? ((this ropebridge)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (not (time-elapsed? (-> this agitated-time-stamp) (seconds 5))) - (or (>= (-> this sleep-dist) (vector-vector-distance (-> this root-override trans) (math-camera-pos))) + (or (>= (-> this sleep-dist) (vector-vector-distance (-> this root trans) (math-camera-pos))) (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) @@ -1050,14 +1040,14 @@ ;; definition for method 28 of type ropebridge ;; INFO: Return type mismatch int vs none. -(defmethod ropebridge-method-28 ropebridge ((this ropebridge)) +(defmethod ropebridge-method-28 ((this ropebridge)) 0 (none) ) ;; definition for method 11 of type ropebridge ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ropebridge ((this ropebridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ropebridge) (arg0 entity-actor)) (let ((s4-0 (res-lump-struct (-> this entity) 'art-name structure))) (if (not s4-0) (set! s4-0 "ropebridge-32") @@ -1099,7 +1089,7 @@ (set-vector! (-> this extra-trans) 0.0 0.0 (- (* 0.5 (-> this tuning bridge-end-to-end-len))) 1.0) (set! (-> this do-physics?) #t) (let ((a0-13 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) - (set! (-> this root-override) a0-13) + (set! (-> this root) a0-13) (alloc-riders a0-13 3) ) (add-collision-meshes this) @@ -1116,7 +1106,7 @@ (set! (-> this skel postbind-function) ropebridge-joint-callback) (matrix<-transformq+trans! (-> this world-matrix) - (the-as transformq (-> this root-override trans)) + (the-as transformq (-> this root trans)) (-> this extra-trans) ) (matrix-4x4-inverse! (-> this inv-world-matrix) (-> this world-matrix)) diff --git a/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc index 6446fff52b6..f81b699a368 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc @@ -29,30 +29,26 @@ ;; definition of type sharkey (deftype sharkey (nav-enemy) - ((dir vector :inline :offset-assert 400) - (spawn-point vector :inline :offset-assert 416) - (scale float :offset-assert 432) - (anim-speed float :offset-assert 436) - (y-max meters :offset-assert 440) - (y-min meters :offset-assert 444) - (attack-time float :offset-assert 448) - (player-water-time time-frame :offset-assert 456) - (player-in-water basic :offset-assert 464) - (last-y float :offset-assert 468) - (spawn-distance meters :offset-assert 472) - (chase-speed meters :offset-assert 476) - (y-speed meters :offset-assert 480) - (sound-id sound-id :offset-assert 484) - (enable-patrol basic :offset-assert 488) + ((dir vector :inline) + (spawn-point vector :inline) + (scale float) + (anim-speed float) + (y-max meters) + (y-min meters) + (attack-time float) + (player-water-time time-frame) + (player-in-water basic) + (last-y float) + (spawn-distance meters) + (chase-speed meters) + (y-speed meters) + (sound-id sound-id) + (enable-patrol basic) ) - :heap-base #x180 - :method-count-assert 76 - :size-assert #x1ec - :flag-assert #x4c018001ec ) ;; definition for method 3 of type sharkey -(defmethod inspect sharkey ((this sharkey)) +(defmethod inspect ((this sharkey)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -82,13 +78,13 @@ ;; definition for method 44 of type sharkey ;; INFO: Return type mismatch symbol vs object. -(defmethod touch-handler sharkey ((this sharkey) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this sharkey) (arg0 process) (arg1 event-message-block)) #t ) ;; definition for method 43 of type sharkey ;; INFO: Return type mismatch symbol vs object. -(defmethod attack-handler sharkey ((this sharkey) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this sharkey) (arg0 process) (arg1 event-message-block)) #t ) @@ -96,7 +92,7 @@ nav-enemy-default-event-handler ;; definition for method 12 of type sharkey -(defmethod run-logic? sharkey ((this sharkey)) +(defmethod run-logic? ((this sharkey)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> this collide-info pause-adjust-distance)) (vector-vector-distance (-> this collide-info trans) (math-camera-pos)) @@ -109,7 +105,7 @@ nav-enemy-default-event-handler ;; definition for method 40 of type sharkey ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-40 sharkey ((this sharkey)) +(defmethod nav-enemy-method-40 ((this sharkey)) (nav-control-method-11 (-> this nav) (-> this nav target-pos)) (let* ((f0-0 (vector-vector-xz-distance (-> this collide-info trans) (-> this nav target-pos))) (f30-0 (/ (- (fmin (-> this y-max) (-> this nav target-pos y)) (-> this collide-info trans y)) f0-0)) @@ -122,7 +118,7 @@ nav-enemy-default-event-handler ;; definition for method 37 of type sharkey ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-37 sharkey ((this sharkey)) +(defmethod nav-enemy-method-37 ((this sharkey)) (let ((s5-0 (new 'stack-no-clear 'vector))) (when (< 8192.0 (vector-length (-> this nav travel))) (vector-normalize-copy! s5-0 (-> this nav travel) 1.0) @@ -137,7 +133,7 @@ nav-enemy-default-event-handler ;; definition for method 41 of type sharkey ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-41 sharkey ((this sharkey)) +(defmethod nav-enemy-method-41 ((this sharkey)) (let* ((f0-1 (- (-> this target-speed) (-> this momentum-speed))) (f1-3 (fmin (* (-> this acceleration) (seconds-per-frame)) (fabs f0-1))) ) @@ -161,7 +157,7 @@ nav-enemy-default-event-handler ;; definition for method 39 of type sharkey ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod common-post sharkey ((this sharkey)) +(defmethod common-post ((this sharkey)) (let ((f30-0 (-> this water height)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -656,7 +652,7 @@ nav-enemy-default-event-handler ;; definition for method 11 of type sharkey ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! sharkey ((this sharkey) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sharkey) (arg0 entity-actor)) (set! (-> this scale) (res-lump-float arg0 'scale :default 1.0)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) diff --git a/test/decompiler/reference/jak1/engine/common-obs/ticky_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/ticky_REF.gc index 2e3f8accfff..cacb8f33011 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/ticky_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/ticky_REF.gc @@ -3,23 +3,20 @@ ;; definition of type ticky (deftype ticky (structure) - ((delay-til-ramp time-frame :offset-assert 0) - (delay-til-timeout time-frame :offset-assert 8) - (starting-time time-frame :offset-assert 16) - (last-tick-time time-frame :offset-assert 24) + ((delay-til-ramp time-frame) + (delay-til-timeout time-frame) + (starting-time time-frame) + (last-tick-time time-frame) ) - :method-count-assert 12 - :size-assert #x20 - :flag-assert #xc00000020 (:methods - (sleep (_type_ time-frame) none 9) - (reached-delay? (_type_ time-frame) symbol 10) - (completed? (_type_) symbol 11) + (sleep (_type_ time-frame) none) + (reached-delay? (_type_ time-frame) symbol) + (completed? (_type_) symbol) ) ) ;; definition for method 3 of type ticky -(defmethod inspect ticky ((this ticky)) +(defmethod inspect ((this ticky)) (format #t "[~8x] ~A~%" this 'ticky) (format #t "~Tdelay-til-ramp: ~D~%" (-> this delay-til-ramp)) (format #t "~Tdelay-til-timeout: ~D~%" (-> this delay-til-timeout)) @@ -30,7 +27,7 @@ ;; definition for method 9 of type ticky ;; INFO: Return type mismatch int vs none. -(defmethod sleep ticky ((this ticky) (arg0 time-frame)) +(defmethod sleep ((this ticky) (arg0 time-frame)) (set-time! (-> this starting-time)) (set! (-> this delay-til-timeout) arg0) (set! (-> this delay-til-ramp) (max 0 (+ arg0 (seconds -4)))) @@ -40,7 +37,7 @@ ) ;; definition for method 11 of type ticky -(defmethod completed? ticky ((this ticky)) +(defmethod completed? ((this ticky)) (let ((gp-0 #f)) (let ((v1-2 (- (current-time) (-> this starting-time)))) (cond @@ -68,6 +65,6 @@ ) ;; definition for method 10 of type ticky -(defmethod reached-delay? ticky ((this ticky) (arg0 time-frame)) +(defmethod reached-delay? ((this ticky) (arg0 time-frame)) (time-elapsed? (-> this starting-time) arg0) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/tippy_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/tippy_REF.gc index ac2ff7e6f59..0f0fe3b9263 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/tippy_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/tippy_REF.gc @@ -3,24 +3,21 @@ ;; definition of type tippy (deftype tippy (structure) - ((axis vector :inline :offset-assert 0) - (angle float :offset-assert 16) - (orig quaternion :inline :offset-assert 32) - (dist-ratio float :offset-assert 48) - (damping float :offset-assert 52) - (1-damping float :offset-assert 56) + ((axis vector :inline) + (angle float) + (orig quaternion :inline) + (dist-ratio float) + (damping float) + (1-damping float) ) - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (reset! (_type_ process-drawable float float) none 9) - (tippy-method-10 (_type_ process-drawable vector) symbol 10) + (reset! (_type_ process-drawable float float) none) + (tippy-method-10 (_type_ process-drawable vector) symbol) ) ) ;; definition for method 3 of type tippy -(defmethod inspect tippy ((this tippy)) +(defmethod inspect ((this tippy)) (format #t "[~8x] ~A~%" this 'tippy) (format #t "~Taxis: #~%" (-> this axis)) (format #t "~Tangle: ~f~%" (-> this angle)) @@ -33,7 +30,7 @@ ;; definition for method 9 of type tippy ;; INFO: Return type mismatch int vs none. -(defmethod reset! tippy ((this tippy) (arg0 process-drawable) (arg1 float) (arg2 float)) +(defmethod reset! ((this tippy) (arg0 process-drawable) (arg1 float) (arg2 float)) (set-vector! (-> this axis) 0.0 0.0 0.0 1.0) (set! (-> this angle) 0.0) (quaternion-copy! (-> this orig) (-> arg0 root quat)) @@ -45,7 +42,7 @@ ) ;; definition for method 10 of type tippy -(defmethod tippy-method-10 tippy ((this tippy) (arg0 process-drawable) (arg1 vector)) +(defmethod tippy-method-10 ((this tippy) (arg0 process-drawable) (arg1 vector)) (let ((s4-0 #t)) (cond (arg1 diff --git a/test/decompiler/reference/jak1/engine/common-obs/voicebox_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/voicebox_REF.gc index 34a8fc249f2..c77d14794c7 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/voicebox_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/voicebox_REF.gc @@ -4,17 +4,13 @@ ;; definition of type camera-voicebox (deftype camera-voicebox (camera-slave) () - :heap-base #x9a0 - :method-count-assert 14 - :size-assert #xa04 - :flag-assert #xe09a00a04 (:states cam-voicebox ) ) ;; definition for method 3 of type camera-voicebox -(defmethod inspect camera-voicebox ((this camera-voicebox)) +(defmethod inspect ((this camera-voicebox)) (let ((t9-0 (method-of-type camera-slave inspect))) (t9-0 this) ) @@ -23,26 +19,22 @@ ;; definition of type voicebox (deftype voicebox (process-drawable) - ((parent-override (pointer camera-voicebox) :offset 12) - (base-trans vector :inline :offset-assert 176) - (seeker cam-float-seeker :inline :offset-assert 192) - (blend float :offset-assert 216) - (twist float :offset-assert 220) - (hint handle :offset-assert 224) + ((parent-override (pointer camera-voicebox) :overlay-at parent) + (base-trans vector :inline) + (seeker cam-float-seeker :inline) + (blend float) + (twist float) + (hint handle) ) - :heap-base #x80 - :method-count-assert 23 - :size-assert #xe8 - :flag-assert #x17008000e8 - (:methods - (enter () _type_ :state 20) - (idle () _type_ :state 21) - (exit () _type_ :state 22) + (:state-methods + enter + idle + exit ) ) ;; definition for method 3 of type voicebox -(defmethod inspect voicebox ((this voicebox)) +(defmethod inspect ((this voicebox)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/water-anim_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/water-anim_REF.gc index 9ac6137d374..a0774effcd8 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/water-anim_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/water-anim_REF.gc @@ -3,18 +3,14 @@ ;; definition of type water-anim (deftype water-anim (water-vol) - ((ppointer-water-anim (pointer water-anim) :offset 24) - (look int32 :offset-assert 212) - (play-ambient-sound? symbol :offset-assert 216) + ((ppointer-water-anim (pointer water-anim) :overlay-at ppointer) + (look int32) + (play-ambient-sound? symbol) ) - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) ;; definition for method 3 of type water-anim -(defmethod inspect water-anim ((this water-anim)) +(defmethod inspect ((this water-anim)) (let ((t9-0 (method-of-type water-vol inspect))) (t9-0 this) ) @@ -313,17 +309,14 @@ ;; definition of type water-anim-look (deftype water-anim-look (structure) - ((skel-group symbol :offset-assert 0) - (anim int32 :offset-assert 4) - (ambient-sound-spec sound-spec :offset-assert 8) + ((skel-group symbol) + (anim int32) + (ambient-sound-spec sound-spec) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type water-anim-look -(defmethod inspect water-anim-look ((this water-anim-look)) +(defmethod inspect ((this water-anim-look)) (format #t "[~8x] ~A~%" this 'water-anim-look) (format #t "~Tskel-group: ~A~%" (-> this skel-group)) (format #t "~Tanim: ~D~%" (-> this anim)) @@ -575,20 +568,20 @@ ) ;; definition for method 28 of type water-anim -(defmethod get-ripple-height water-anim ((this water-anim) (arg0 vector)) +(defmethod get-ripple-height ((this water-anim) (arg0 vector)) (ripple-find-height this 0 arg0) ) ;; definition for method 24 of type water-anim ;; INFO: Return type mismatch symbol vs none. -(defmethod set-stack-size! water-anim ((this water-anim)) +(defmethod set-stack-size! ((this water-anim)) (none) ) ;; definition for method 25 of type water-anim ;; INFO: Used lq/sq ;; INFO: Return type mismatch quaternion vs none. -(defmethod water-vol-method-25 water-anim ((this water-anim)) +(defmethod water-vol-method-25 ((this water-anim)) (local-vars (sv-16 res-tag)) (set! (-> this play-ambient-sound?) #t) (set! (-> this look) (res-lump-value (-> this entity) 'look int :default (the-as uint128 -1))) @@ -609,7 +602,7 @@ ) ;; definition for method 22 of type water-anim -(defmethod water-vol-method-22 water-anim ((this water-anim)) +(defmethod water-vol-method-22 ((this water-anim)) (let ((s5-0 (-> this look))) (if (or (< s5-0 0) (>= s5-0 (-> *water-anim-look* length))) (go process-drawable-art-error "skel group") diff --git a/test/decompiler/reference/jak1/engine/common-obs/water-h_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/water-h_REF.gc index 99e211133e5..51841bb32f3 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/water-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/water-h_REF.gc @@ -3,59 +3,56 @@ ;; definition of type water-control (deftype water-control (basic) - ((flags water-flags :offset-assert 4) - (process process-drawable :offset-assert 8) - (joint-index int32 :offset-assert 12) - (top-y-offset float :offset-assert 16) - (ripple-size meters :offset-assert 20) - (enter-water-time time-frame :offset-assert 24) - (wade-time time-frame :offset-assert 32) - (on-water-time time-frame :offset-assert 40) - (enter-swim-time time-frame :offset-assert 48) - (swim-time time-frame :offset-assert 56) - (base-height meters :offset-assert 64) - (wade-height meters :offset-assert 68) - (swim-height meters :offset-assert 72) - (surface-height meters :offset-assert 76) - (bottom-height meters :offset-assert 80) - (height meters :offset-assert 84) - (height-offset float 4 :offset-assert 88) - (real-ocean-offset meters :offset 88) - (ocean-offset meters :offset 92) - (bob-offset meters :offset 96) - (align-offset meters :offset 100) - (swim-depth meters :offset-assert 104) - (bob smush-control :inline :offset-assert 112) - (volume handle :offset-assert 144) - (bottom vector 2 :inline :offset-assert 160) - (top vector 2 :inline :offset-assert 192) - (enter-water-pos vector :inline :offset-assert 224) - (drip-old-pos vector :inline :offset-assert 240) - (drip-joint-index int32 :offset-assert 256) - (drip-wetness float :offset-assert 260) - (drip-time time-frame :offset-assert 264) - (drip-speed float :offset-assert 272) - (drip-height meters :offset-assert 276) - (drip-mult float :offset-assert 280) + ((flags water-flags) + (process process-drawable) + (joint-index int32) + (top-y-offset float) + (ripple-size meters) + (enter-water-time time-frame) + (wade-time time-frame) + (on-water-time time-frame) + (enter-swim-time time-frame) + (swim-time time-frame) + (base-height meters) + (wade-height meters) + (swim-height meters) + (surface-height meters) + (bottom-height meters) + (height meters) + (height-offset float 4) + (real-ocean-offset meters :overlay-at (-> height-offset 0)) + (ocean-offset meters :overlay-at (-> height-offset 1)) + (bob-offset meters :overlay-at (-> height-offset 2)) + (align-offset meters :overlay-at (-> height-offset 3)) + (swim-depth meters) + (bob smush-control :inline) + (volume handle) + (bottom vector 2 :inline) + (top vector 2 :inline) + (enter-water-pos vector :inline) + (drip-old-pos vector :inline) + (drip-joint-index int32) + (drip-wetness float) + (drip-time time-frame) + (drip-speed float) + (drip-height meters) + (drip-mult float) ) - :method-count-assert 17 - :size-assert #x11c - :flag-assert #x110000011c (:methods - (new (symbol type process int float float float) _type_ 0) - (water-control-method-9 (_type_) none 9) - (water-control-method-10 (_type_) none 10) - (start-bobbing! (_type_ float int int) none 11) - (distance-from-surface (_type_) float 12) - (create-splash (_type_ float vector int vector) none 13) - (display-water-marks? (_type_) symbol 14) - (water-control-method-15 (_type_) none 15) - (water-control-method-16 (_type_) none 16) + (new (symbol type process int float float float) _type_) + (water-control-method-9 (_type_) none) + (water-control-method-10 (_type_) none) + (start-bobbing! (_type_ float int int) none) + (distance-from-surface (_type_) float) + (create-splash (_type_ float vector int vector) none) + (display-water-marks? (_type_) symbol) + (water-control-method-15 (_type_) none) + (water-control-method-16 (_type_) none) ) ) ;; definition for method 3 of type water-control -(defmethod inspect water-control ((this water-control)) +(defmethod inspect ((this water-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tflags: #x~X~%" (-> this flags)) (format #t "~Tprocess: ~A~%" (-> this process)) @@ -95,7 +92,7 @@ ) ;; definition for method 14 of type water-control -(defmethod display-water-marks? water-control ((this water-control)) +(defmethod display-water-marks? ((this water-control)) (and *display-water-marks* (logtest? (-> this flags) (water-flags wt00))) ) @@ -116,40 +113,38 @@ ) ;; definition for method 12 of type water-control -(defmethod distance-from-surface water-control ((this water-control)) +(defmethod distance-from-surface ((this water-control)) (- (-> this top 0 y) (-> this height)) ) ;; definition of type water-vol (deftype water-vol (process-drawable) - ((water-height meters :offset-assert 176) - (wade-height meters :offset-assert 180) - (swim-height meters :offset-assert 184) - (bottom-height meters :offset-assert 188) - (attack-event symbol :offset-assert 192) - (target handle :offset-assert 200) - (flags water-flags :offset-assert 208) + ((water-height meters) + (wade-height meters) + (swim-height meters) + (bottom-height meters) + (attack-event symbol) + (target handle) + (flags water-flags) ) - :heap-base #x70 - :method-count-assert 30 - :size-assert #xd4 - :flag-assert #x1e007000d4 + (:state-methods + water-vol-idle + water-vol-startup + ) (:methods - (water-vol-idle () _type_ :state 20) - (water-vol-startup () _type_ :state 21) - (water-vol-method-22 (_type_) none 22) - (reset-root! (_type_) none 23) - (set-stack-size! (_type_) none 24) - (water-vol-method-25 (_type_) none 25) - (update! (_type_) none 26) - (on-exit-water (_type_) none 27) - (get-ripple-height (_type_ vector) float 28) - (init! (_type_) none 29) + (water-vol-method-22 (_type_) none) + (reset-root! (_type_) none) + (set-stack-size! (_type_) none) + (water-vol-method-25 (_type_) none) + (update! (_type_) none) + (on-exit-water (_type_) none) + (get-ripple-height (_type_ vector) float) + (init! (_type_) none) ) ) ;; definition for method 3 of type water-vol -(defmethod inspect water-vol ((this water-vol)) +(defmethod inspect ((this water-vol)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc index 51bb91b56a2..204b3c285d4 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc @@ -660,7 +660,7 @@ ;; definition for method 9 of type water-control ;; INFO: Return type mismatch int vs none. -(defmethod water-control-method-9 water-control ((this water-control)) +(defmethod water-control-method-9 ((this water-control)) 0 (none) ) @@ -668,7 +668,7 @@ ;; definition for method 10 of type water-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod water-control-method-10 water-control ((this water-control)) +(defmethod water-control-method-10 ((this water-control)) (with-pp (let ((s5-0 (-> this flags))) (cond @@ -1016,7 +1016,7 @@ ;; definition for method 11 of type water-control ;; INFO: Return type mismatch int vs none. -(defmethod start-bobbing! water-control ((this water-control) (arg0 float) (arg1 int) (arg2 int)) +(defmethod start-bobbing! ((this water-control) (arg0 float) (arg1 int) (arg2 int)) (activate! (-> this bob) (- arg0) arg1 arg2 0.9 1.0) 0 (none) @@ -1117,7 +1117,7 @@ ;; definition for method 15 of type water-control ;; INFO: Return type mismatch int vs none. -(defmethod water-control-method-15 water-control ((this water-control)) +(defmethod water-control-method-15 ((this water-control)) (with-pp (logior! (-> this flags) (water-flags wt09)) (logclear! (-> this flags) (water-flags wt16)) @@ -1149,7 +1149,7 @@ ;; definition for method 16 of type water-control ;; INFO: Return type mismatch int vs none. -(defmethod water-control-method-16 water-control ((this water-control)) +(defmethod water-control-method-16 ((this water-control)) (logclear! (-> this flags) (water-flags wt09)) (set-zero! (-> this bob)) (if (logtest? (water-flags wt17) (-> this flags)) @@ -1182,7 +1182,7 @@ ;; definition for method 13 of type water-control ;; INFO: Return type mismatch int vs none. -(defmethod create-splash water-control ((this water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector)) +(defmethod create-splash ((this water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector)) (when (and (logtest? (-> this flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> this flags))) (let ((a1-3 (vector+float*! (new 'stack-no-clear 'vector) arg1 arg3 0.05))) (set! (-> a1-3 y) (-> this surface-height)) @@ -1195,7 +1195,7 @@ ;; definition for method 27 of type water-vol ;; INFO: Return type mismatch int vs none. -(defmethod on-exit-water water-vol ((this water-vol)) +(defmethod on-exit-water ((this water-vol)) (when (handle->process (-> this target)) (let ((v1-7 (-> (the-as target (-> this target process 0)) water))) (logclear! (-> v1-7 flags) (water-flags wt01 wt02 wt03 wt08 wt17 wt18 wt19 wt20 wt21 wt23 wt24 wt25 wt26)) @@ -1220,7 +1220,7 @@ ;; definition for method 26 of type water-vol ;; INFO: Return type mismatch int vs none. -(defmethod update! water-vol ((this water-vol)) +(defmethod update! ((this water-vol)) (cond ((handle->process (-> this target)) (cond @@ -1314,21 +1314,21 @@ ) ;; definition for method 24 of type water-vol -(defmethod set-stack-size! water-vol ((this water-vol)) +(defmethod set-stack-size! ((this water-vol)) (stack-size-set! (-> this main-thread) 128) (none) ) ;; definition for method 23 of type water-vol ;; INFO: Return type mismatch trsqv vs none. -(defmethod reset-root! water-vol ((this water-vol)) +(defmethod reset-root! ((this water-vol)) (set! (-> this root) (new 'process 'trsqv)) (none) ) ;; definition for method 25 of type water-vol ;; INFO: Return type mismatch int vs none. -(defmethod water-vol-method-25 water-vol ((this water-vol)) +(defmethod water-vol-method-25 ((this water-vol)) 0 (none) ) @@ -1336,7 +1336,7 @@ ;; definition for method 29 of type water-vol ;; INFO: Used lq/sq ;; INFO: Return type mismatch water-flags vs none. -(defmethod init! water-vol ((this water-vol)) +(defmethod init! ((this water-vol)) (local-vars (sv-16 res-tag)) (set! (-> this attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) (-> this entity) @@ -1398,7 +1398,7 @@ ;; definition for method 22 of type water-vol ;; INFO: Return type mismatch int vs none. -(defmethod water-vol-method-22 water-vol ((this water-vol)) +(defmethod water-vol-method-22 ((this water-vol)) 0 (none) ) @@ -1418,7 +1418,7 @@ ;; definition for method 11 of type water-vol ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! water-vol ((this water-vol) (arg0 entity-actor)) +(defmethod init-from-entity! ((this water-vol) (arg0 entity-actor)) (set-stack-size! this) (reset-root! this) (init! this) diff --git a/test/decompiler/reference/jak1/engine/data/art-h_REF.gc b/test/decompiler/reference/jak1/engine/data/art-h_REF.gc index 81c71330aca..f610c430dba 100644 --- a/test/decompiler/reference/jak1/engine/data/art-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/data/art-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type joint-anim (deftype joint-anim (basic) - ((name string :offset-assert 4) - (number int16 :offset-assert 8) - (length int16 :offset-assert 10) + ((name string) + (number int16) + (length int16) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type joint-anim -(defmethod inspect joint-anim ((this joint-anim)) +(defmethod inspect ((this joint-anim)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tnumber: ~D~%" (-> this number)) @@ -23,33 +20,24 @@ ;; definition of type joint-anim-matrix (deftype joint-anim-matrix (joint-anim) - ((data matrix :inline :dynamic :offset 16) + ((data matrix :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition of type joint-anim-transformq (deftype joint-anim-transformq (joint-anim) - ((data transformq :inline :dynamic :offset 16) + ((data transformq :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition of type joint-anim-drawable (deftype joint-anim-drawable (joint-anim) - ((data drawable :dynamic :offset-assert 12) + ((data drawable :dynamic) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type joint-anim-drawable -(defmethod inspect joint-anim-drawable ((this joint-anim-drawable)) +(defmethod inspect ((this joint-anim-drawable)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tnumber: ~D~%" (-> this number)) @@ -60,15 +48,12 @@ ;; definition of type joint-anim-compressed (deftype joint-anim-compressed (joint-anim) - ((data uint32 :dynamic :offset-assert 12) + ((data uint32 :dynamic) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type joint-anim-compressed -(defmethod inspect joint-anim-compressed ((this joint-anim-compressed)) +(defmethod inspect ((this joint-anim-compressed)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tnumber: ~D~%" (-> this number)) @@ -78,19 +63,16 @@ ;; definition of type joint-anim-frame (deftype joint-anim-frame (structure) - ((matrices matrix 2 :inline :offset-assert 0) - (data matrix :inline :dynamic :offset-assert 128) + ((matrices matrix 2 :inline) + (data matrix :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) ;; definition for method 3 of type joint-anim-frame -(defmethod inspect joint-anim-frame ((this joint-anim-frame)) +(defmethod inspect ((this joint-anim-frame)) (format #t "[~8x] ~A~%" this 'joint-anim-frame) (format #t "~Tmatrices[2] @ #x~X~%" (-> this matrices)) (format #t "~Tdata[0] @ #x~X~%" (-> this data)) @@ -110,17 +92,14 @@ ;; definition of type joint-anim-compressed-hdr (deftype joint-anim-compressed-hdr (structure) - ((control-bits uint32 14 :offset-assert 0) - (num-joints uint32 :offset-assert 56) - (matrix-bits uint32 :offset-assert 60) + ((control-bits uint32 14) + (num-joints uint32) + (matrix-bits uint32) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type joint-anim-compressed-hdr -(defmethod inspect joint-anim-compressed-hdr ((this joint-anim-compressed-hdr)) +(defmethod inspect ((this joint-anim-compressed-hdr)) (format #t "[~8x] ~A~%" this 'joint-anim-compressed-hdr) (format #t "~Tcontrol-bits[14] @ #x~X~%" (-> this control-bits)) (format #t "~Tnum-joints: ~D~%" (-> this num-joints)) @@ -130,20 +109,17 @@ ;; definition of type joint-anim-compressed-fixed (deftype joint-anim-compressed-fixed (structure) - ((hdr joint-anim-compressed-hdr :inline :offset-assert 0) - (offset-64 uint32 :offset-assert 64) - (offset-32 uint32 :offset-assert 68) - (offset-16 uint32 :offset-assert 72) - (reserved uint32 :offset-assert 76) - (data vector 133 :inline :offset-assert 80) + ((hdr joint-anim-compressed-hdr :inline) + (offset-64 uint32) + (offset-32 uint32) + (offset-16 uint32) + (reserved uint32) + (data vector 133 :inline) ) - :method-count-assert 9 - :size-assert #x8a0 - :flag-assert #x9000008a0 ) ;; definition for method 3 of type joint-anim-compressed-fixed -(defmethod inspect joint-anim-compressed-fixed ((this joint-anim-compressed-fixed)) +(defmethod inspect ((this joint-anim-compressed-fixed)) (format #t "[~8x] ~A~%" this 'joint-anim-compressed-fixed) (format #t "~Thdr: #~%" (-> this hdr)) (format #t "~Toffset-64: ~D~%" (-> this offset-64)) @@ -156,19 +132,16 @@ ;; definition of type joint-anim-compressed-frame (deftype joint-anim-compressed-frame (structure) - ((offset-64 uint32 :offset-assert 0) - (offset-32 uint32 :offset-assert 4) - (offset-16 uint32 :offset-assert 8) - (reserved uint32 :offset-assert 12) - (data vector 133 :inline :offset-assert 16) + ((offset-64 uint32) + (offset-32 uint32) + (offset-16 uint32) + (reserved uint32) + (data vector 133 :inline) ) - :method-count-assert 9 - :size-assert #x860 - :flag-assert #x900000860 ) ;; definition for method 3 of type joint-anim-compressed-frame -(defmethod inspect joint-anim-compressed-frame ((this joint-anim-compressed-frame)) +(defmethod inspect ((this joint-anim-compressed-frame)) (format #t "[~8x] ~A~%" this 'joint-anim-compressed-frame) (format #t "~Toffset-64: ~D~%" (-> this offset-64)) (format #t "~Toffset-32: ~D~%" (-> this offset-32)) @@ -180,19 +153,16 @@ ;; definition of type joint-anim-compressed-control (deftype joint-anim-compressed-control (structure) - ((num-frames uint32 :offset-assert 0) - (fixed-qwc uint32 :offset-assert 4) - (frame-qwc uint32 :offset-assert 8) - (fixed joint-anim-compressed-fixed :offset-assert 12) - (data joint-anim-compressed-frame 1 :offset-assert 16) + ((num-frames uint32) + (fixed-qwc uint32) + (frame-qwc uint32) + (fixed joint-anim-compressed-fixed) + (data joint-anim-compressed-frame 1) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type joint-anim-compressed-control -(defmethod inspect joint-anim-compressed-control ((this joint-anim-compressed-control)) +(defmethod inspect ((this joint-anim-compressed-control)) (format #t "[~8x] ~A~%" this 'joint-anim-compressed-control) (format #t "~Tnum-frames: ~D~%" (-> this num-frames)) (format #t "~Tfixed-qwc: ~D~%" (-> this fixed-qwc)) @@ -204,23 +174,20 @@ ;; definition of type art (deftype art (basic) - ((name string :offset 8) - (length int32 :offset-assert 12) - (extra res-lump :offset-assert 16) + ((name string :offset 8) + (length int32) + (extra res-lump) ) - :method-count-assert 13 - :size-assert #x14 - :flag-assert #xd00000014 (:methods - (login (_type_) _type_ 9) - (lookup-art (_type_ string type) joint 10) - (lookup-idx-of-art (_type_ string type) int 11) - (needs-link? (_type_) symbol 12) + (login (_type_) _type_) + (lookup-art (_type_ string type) joint) + (lookup-idx-of-art (_type_ string type) int) + (needs-link? (_type_) symbol) ) ) ;; definition for method 3 of type art -(defmethod inspect art ((this art)) +(defmethod inspect ((this art)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -230,15 +197,12 @@ ;; definition of type art-element (deftype art-element (art) - ((pad uint8 12 :offset-assert 20) + ((pad uint8 12) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) ;; definition for method 3 of type art-element -(defmethod inspect art-element ((this art-element)) +(defmethod inspect ((this art-element)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -248,87 +212,69 @@ ;; definition of type art-mesh-anim (deftype art-mesh-anim (art-element) - ((data basic :dynamic :offset-assert 32) + ((data basic :dynamic) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) ;; definition of type art-joint-anim (deftype art-joint-anim (art-element) - ((eye-anim-data merc-eye-anim-block :offset 4) - (speed float :offset 20) - (artist-base float :offset 24) - (artist-step float :offset 28) - (master-art-group-name string :offset 32) - (master-art-group-index int32 :offset 36) - (blerc-data (pointer uint8) :offset 40) - (frames joint-anim-compressed-control :offset 44) - (data joint-anim-compressed :dynamic :offset-assert 48) + ((eye-anim-data merc-eye-anim-block :offset 4) + (speed float :overlay-at (-> pad 0)) + (artist-base float :overlay-at (-> pad 4)) + (artist-step float :overlay-at (-> pad 8)) + (master-art-group-name string :offset 32) + (master-art-group-index int32 :offset 36) + (blerc-data (pointer uint8) :offset 40) + (frames joint-anim-compressed-control :offset 44) + (data joint-anim-compressed :dynamic) ) - :method-count-assert 13 - :size-assert #x30 - :flag-assert #xd00000030 ) ;; definition of type art-group (deftype art-group (art) - ((info file-info :offset 4) - (data art-element :dynamic :offset 32) + ((info file-info :offset 4) + (data art-element :dynamic :offset 32) ) - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (link-art! (_type_) art-group 13) - (unlink-art! (_type_) int 14) + (relocate (_type_ kheap (pointer uint8)) none :replace) + (link-art! (_type_) art-group) + (unlink-art! (_type_) int) ) ) ;; definition of type art-mesh-geo (deftype art-mesh-geo (art-element) - ((data basic :dynamic :offset-assert 32) + ((data basic :dynamic) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) ;; definition of type art-joint-geo (deftype art-joint-geo (art-element) - ((data joint :dynamic :offset-assert 32) + ((data joint :dynamic) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) ;; definition of type skeleton-group (deftype skeleton-group (basic) - ((art-group-name string :offset-assert 4) - (jgeo int32 :offset-assert 8) - (janim int32 :offset-assert 12) - (bounds vector :inline :offset-assert 16) - (radius meters :offset 28) - (mgeo int16 4 :offset-assert 32) - (max-lod int32 :offset-assert 40) - (lod-dist float 4 :offset-assert 44) - (longest-edge meters :offset-assert 60) - (texture-level int8 :offset-assert 64) - (version int8 :offset-assert 65) - (shadow int8 :offset-assert 66) - (sort int8 :offset-assert 67) - (_pad uint8 4 :offset-assert 68) + ((art-group-name string) + (jgeo int32) + (janim int32) + (bounds vector :inline) + (radius meters :overlay-at (-> bounds w)) + (mgeo int16 4) + (max-lod int32) + (lod-dist float 4) + (longest-edge meters) + (texture-level int8) + (version int8) + (shadow int8) + (sort int8) + (_pad uint8 4) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) ;; definition for method 3 of type skeleton-group -(defmethod inspect skeleton-group ((this skeleton-group)) +(defmethod inspect ((this skeleton-group)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tart-group-name: ~A~%" (-> this art-group-name)) (format #t "~Tjgeo: ~D~%" (-> this jgeo)) @@ -348,17 +294,14 @@ ;; definition of type lod-group (deftype lod-group (structure) - ((geo merc-ctrl :offset-assert 0) - (dist meters :offset-assert 4) + ((geo merc-ctrl) + (dist meters) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type lod-group -(defmethod inspect lod-group ((this lod-group)) +(defmethod inspect ((this lod-group)) (format #t "[~8x] ~A~%" this 'lod-group) (format #t "~Tgeo: ~A~%" (-> this geo)) (format #t "~Tdist: (meters ~m)~%" (-> this dist)) @@ -367,20 +310,17 @@ ;; definition of type lod-set (deftype lod-set (structure) - ((lod lod-group 4 :inline :offset-assert 0) - (max-lod int8 :offset-assert 32) + ((lod lod-group 4 :inline) + (max-lod int8) ) :pack-me - :method-count-assert 10 - :size-assert #x21 - :flag-assert #xa00000021 (:methods - (setup-lods! (_type_ skeleton-group art-group entity) _type_ 9) + (setup-lods! (_type_ skeleton-group art-group entity) _type_) ) ) ;; definition for method 3 of type lod-set -(defmethod inspect lod-set ((this lod-set)) +(defmethod inspect ((this lod-set)) (format #t "[~8x] ~A~%" this 'lod-set) (format #t "~Tlod[4] @ #x~X~%" (-> this lod)) (format #t "~Tmax-lod: ~D~%" (-> this max-lod)) @@ -389,60 +329,57 @@ ;; definition of type draw-control (deftype draw-control (basic) - ((status draw-status :offset-assert 4) - (matrix-type uint8 :offset-assert 5) - (data-format uint8 :offset-assert 6) - (global-effect draw-effect :offset-assert 7) - (art-group art-group :offset-assert 8) - (jgeo art-joint-geo :offset-assert 12) - (mgeo merc-ctrl :offset-assert 16) - (dma-add-func (function process-drawable draw-control symbol object none) :offset-assert 20) - (skeleton skeleton :offset-assert 24) - (lod-set lod-set :inline :offset-assert 28) - (lod lod-group 4 :inline :offset 28) - (max-lod int8 :offset 60) - (force-lod int8 :offset-assert 61) - (cur-lod int8 :offset-assert 62) - (desired-lod int8 :offset-assert 63) - (ripple ripple-control :offset-assert 64) - (longest-edge meters :offset-assert 68) - (longest-edge? uint32 :offset 68) - (light-index uint8 :offset-assert 72) - (dummy uint8 2 :offset-assert 73) - (death-draw-overlap uint8 :offset-assert 75) - (death-timer uint8 :offset-assert 76) - (death-timer-org uint8 :offset-assert 77) - (death-vertex-skip uint16 :offset-assert 78) - (death-effect uint32 :offset-assert 80) - (sink-group dma-foreground-sink-group :offset-assert 84) - (process process :offset-assert 88) - (shadow shadow-geo :offset-assert 92) - (shadow-ctrl shadow-control :offset-assert 96) - (origin vector :inline :offset-assert 112) - (bounds vector :inline :offset-assert 128) - (radius meters :offset 140) - (color-mult rgbaf :inline :offset-assert 144) - (color-emissive rgbaf :inline :offset-assert 160) - (secondary-interp float :offset-assert 176) - (current-secondary-interp float :offset-assert 180) - (shadow-mask uint8 :offset-assert 184) - (level-index uint8 :offset-assert 185) - (origin-joint-index uint8 :offset-assert 186) - (shadow-joint-index uint8 :offset-assert 187) + ((status draw-status) + (matrix-type uint8) + (data-format uint8) + (global-effect draw-effect) + (art-group art-group) + (jgeo art-joint-geo) + (mgeo merc-ctrl) + (dma-add-func (function process-drawable draw-control symbol object none)) + (skeleton skeleton) + (lod-set lod-set :inline) + (lod lod-group 4 :inline :overlay-at (-> lod-set lod 0)) + (max-lod int8 :overlay-at (-> lod-set max-lod)) + (force-lod int8) + (cur-lod int8) + (desired-lod int8) + (ripple ripple-control) + (longest-edge meters) + (longest-edge? uint32 :overlay-at longest-edge) + (light-index uint8) + (dummy uint8 2) + (death-draw-overlap uint8) + (death-timer uint8) + (death-timer-org uint8) + (death-vertex-skip uint16) + (death-effect uint32) + (sink-group dma-foreground-sink-group) + (process process) + (shadow shadow-geo) + (shadow-ctrl shadow-control) + (origin vector :inline) + (bounds vector :inline) + (radius meters :overlay-at (-> bounds w)) + (color-mult rgbaf :inline) + (color-emissive rgbaf :inline) + (secondary-interp float) + (current-secondary-interp float) + (shadow-mask uint8) + (level-index uint8) + (origin-joint-index uint8) + (shadow-joint-index uint8) ) - :method-count-assert 12 - :size-assert #xbc - :flag-assert #xc000000bc (:methods - (new (symbol type process art-joint-geo) _type_ 0) - (get-skeleton-origin (_type_) vector 9) - (lod-set! (_type_ int) none 10) - (lods-assign! (_type_ lod-set) none 11) + (new (symbol type process art-joint-geo) _type_) + (get-skeleton-origin (_type_) vector) + (lod-set! (_type_ int) none) + (lods-assign! (_type_ lod-set) none) ) ) ;; definition for method 3 of type draw-control -(defmethod inspect draw-control ((this draw-control)) +(defmethod inspect ((this draw-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tstatus: ~D~%" (-> this status)) (format #t "~Tmatrix-type: ~D~%" (-> this matrix-type)) @@ -488,7 +425,7 @@ ) ;; definition for method 9 of type draw-control -(defmethod get-skeleton-origin draw-control ((this draw-control)) +(defmethod get-skeleton-origin ((this draw-control)) (-> this skeleton bones 0 transform vector 3) ) diff --git a/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc b/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc index 95931c5053c..8bdcea0e0b5 100644 --- a/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc @@ -6,36 +6,33 @@ ;; definition of type list-control (deftype list-control (structure) - ((listfunc (function int list-control symbol) :offset-assert 0) - (list-owner uint32 :offset-assert 4) - (top int32 :offset-assert 8) - (left int32 :offset-assert 12) - (list glst-list :offset-assert 16) - (the-node glst-node :offset-assert 20) - (top-index int32 :offset-assert 24) - (the-index int32 :offset-assert 28) - (the-disp-line int32 :offset-assert 32) - (highlight-index int32 :offset-assert 36) - (current-index int32 :offset-assert 40) - (numlines int32 :offset-assert 44) - (lines-to-disp int32 :offset-assert 48) - (charswide int32 :offset-assert 52) - (highlight-disp-line int32 :offset-assert 56) - (field-id int32 :offset-assert 60) - (xpos int32 :offset-assert 64) - (ypos int32 :offset-assert 68) - (user-info int32 :offset-assert 72) - (user-info-u uint32 :offset 72) - (return-int int32 :offset-assert 76) + ((listfunc (function int list-control symbol)) + (list-owner uint32) + (top int32) + (left int32) + (list glst-list) + (the-node glst-node) + (top-index int32) + (the-index int32) + (the-disp-line int32) + (highlight-index int32) + (current-index int32) + (numlines int32) + (lines-to-disp int32) + (charswide int32) + (highlight-disp-line int32) + (field-id int32) + (xpos int32) + (ypos int32) + (user-info int32) + (user-info-u uint32 :overlay-at user-info) + (return-int int32) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type list-control -(defmethod inspect list-control ((this list-control)) +(defmethod inspect ((this list-control)) (format #t "[~8x] ~A~%" this 'list-control) (format #t "~Tlistfunc: ~A~%" (-> this listfunc)) (format #t "~Tlist-owner: #x~X~%" (-> this list-owner)) @@ -62,16 +59,13 @@ ;; definition of type list-field (deftype list-field (structure) - ((left int32 :offset-assert 0) - (width int32 :offset-assert 4) + ((left int32) + (width int32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type list-field -(defmethod inspect list-field ((this list-field)) +(defmethod inspect ((this list-field)) (format #t "[~8x] ~A~%" this 'list-field) (format #t "~Tleft: ~D~%" (-> this left)) (format #t "~Twidth: ~D~%" (-> this width)) @@ -80,25 +74,22 @@ ;; definition of type DISP_LIST-bank (deftype DISP_LIST-bank (basic) - ((TV_SPACING int32 :offset-assert 4) - (BORDER_WIDTH int32 :offset-assert 8) - (BORDER_HEIGHT int32 :offset-assert 12) - (MAX_LINES int32 :offset-assert 16) - (CHAR_WIDTH int32 :offset-assert 20) - (INC_DELAY int32 :offset-assert 24) - (BORDER_LINES int32 :offset-assert 28) - (CXOFF int32 :offset-assert 32) - (CYOFF int32 :offset-assert 36) - (BXOFF int32 :offset-assert 40) - (BYOFF int32 :offset-assert 44) + ((TV_SPACING int32) + (BORDER_WIDTH int32) + (BORDER_HEIGHT int32) + (MAX_LINES int32) + (CHAR_WIDTH int32) + (INC_DELAY int32) + (BORDER_LINES int32) + (CXOFF int32) + (CYOFF int32) + (BXOFF int32) + (BYOFF int32) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type DISP_LIST-bank -(defmethod inspect DISP_LIST-bank ((this DISP_LIST-bank)) +(defmethod inspect ((this DISP_LIST-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~TV_SPACING: ~D~%" (-> this TV_SPACING)) (format #t "~TBORDER_WIDTH: ~D~%" (-> this BORDER_WIDTH)) @@ -384,30 +375,27 @@ ;; definition of type anim-tester-bank (deftype anim-tester-bank (basic) - ((ANIM_SPEED float :offset-assert 4) - (BLEND float :offset-assert 8) - (OBJECT_LIST_X int32 :offset-assert 12) - (OBJECT_LIST_Y int32 :offset-assert 16) - (OBJECT_LIST_MIN_WIDTH int32 :offset-assert 20) - (ANIM_LIST_X int32 :offset-assert 24) - (ANIM_LIST_Y int32 :offset-assert 28) - (ANIM_LIST_MIN_WIDTH int32 :offset-assert 32) - (PICK_LIST_X int32 :offset-assert 36) - (PICK_LIST_Y int32 :offset-assert 40) - (PICK_LIST_MIN_WIDTH int32 :offset-assert 44) - (EDIT_LIST_X int32 :offset-assert 48) - (EDIT_LIST_Y int32 :offset-assert 52) - (EDIT_STATS_X int32 :offset-assert 56) - (EDIT_LIST_MIN_WIDTH int32 :offset-assert 60) - (EDIT_PICK_X int32 :offset-assert 64) + ((ANIM_SPEED float) + (BLEND float) + (OBJECT_LIST_X int32) + (OBJECT_LIST_Y int32) + (OBJECT_LIST_MIN_WIDTH int32) + (ANIM_LIST_X int32) + (ANIM_LIST_Y int32) + (ANIM_LIST_MIN_WIDTH int32) + (PICK_LIST_X int32) + (PICK_LIST_Y int32) + (PICK_LIST_MIN_WIDTH int32) + (EDIT_LIST_X int32) + (EDIT_LIST_Y int32) + (EDIT_STATS_X int32) + (EDIT_LIST_MIN_WIDTH int32) + (EDIT_PICK_X int32) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) ;; definition for method 3 of type anim-tester-bank -(defmethod inspect anim-tester-bank ((this anim-tester-bank)) +(defmethod inspect ((this anim-tester-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~TANIM_SPEED: ~f~%" (-> this ANIM_SPEED)) (format #t "~TBLEND: ~f~%" (-> this BLEND)) @@ -451,26 +439,22 @@ ;; definition of type anim-tester (deftype anim-tester (process-drawable) - ((flags anim-tester-flags :offset-assert 176) - (obj-list glst-list :inline :offset-assert 180) - (current-obj string :offset-assert 196) - (speed int32 :offset-assert 200) - (list-con list-control :inline :offset-assert 204) - (pick-con list-control :inline :offset-assert 284) - (item-field int64 :offset-assert 368) - (inc-delay int32 :offset-assert 376) - (inc-timer int32 :offset-assert 380) - (edit-mode int32 :offset-assert 384) - (old-mode int32 :offset-assert 388) - (anim-speed float :offset-assert 392) - (anim-gspeed float :offset-assert 396) - (anim-first float :offset-assert 400) - (anim-last float :offset-assert 404) + ((flags anim-tester-flags) + (obj-list glst-list :inline) + (current-obj string) + (speed int32) + (list-con list-control :inline) + (pick-con list-control :inline) + (item-field int64) + (inc-delay int32) + (inc-timer int32) + (edit-mode int32) + (old-mode int32) + (anim-speed float) + (anim-gspeed float) + (anim-first float) + (anim-last float) ) - :heap-base #x130 - :method-count-assert 20 - :size-assert #x198 - :flag-assert #x1401300198 (:states anim-tester-process ) @@ -478,7 +462,7 @@ ;; definition for method 3 of type anim-tester ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect anim-tester ((this anim-tester)) +(defmethod inspect ((this anim-tester)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -522,28 +506,25 @@ ;; definition of type anim-test-obj (deftype anim-test-obj (glst-named-node) - ((obj-art-group art-group :offset-assert 12) - (seq-list glst-list :inline :offset-assert 16) - (flags int32 :offset-assert 32) - (mesh-geo merc-ctrl :offset-assert 36) - (joint-geo art-joint-geo :offset-assert 40) - (list-con list-control :inline :offset-assert 44) - (parent uint32 :offset-assert 124) - (anim-index int32 :offset-assert 128) - (anim-hindex int32 :offset-assert 132) - (seq-index int32 :offset-assert 136) - (seq-hindex int32 :offset-assert 140) + ((obj-art-group art-group) + (seq-list glst-list :inline) + (flags int32) + (mesh-geo merc-ctrl) + (joint-geo art-joint-geo) + (list-con list-control :inline) + (parent uint32) + (anim-index int32) + (anim-hindex int32) + (seq-index int32) + (seq-hindex int32) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 (:methods - (new (symbol type int string basic) _type_ 0) + (new (symbol type int string basic) _type_) ) ) ;; definition for method 3 of type anim-test-obj -(defmethod inspect anim-test-obj ((this anim-test-obj)) +(defmethod inspect ((this anim-test-obj)) (format #t "[~8x] ~A~%" this 'anim-test-obj) (format #t "~Tnext: #~%" (-> this next)) (format #t "~Tprev: #~%" (-> this prev)) @@ -599,22 +580,19 @@ ;; definition of type anim-test-sequence (deftype anim-test-sequence (glst-named-node) - ((item-list glst-list :inline :offset-assert 12) - (playing-item int32 :offset-assert 28) - (flags int32 :offset-assert 32) - (list-con list-control :inline :offset-assert 36) - (parent anim-test-obj :offset-assert 116) + ((item-list glst-list :inline) + (playing-item int32) + (flags int32) + (list-con list-control :inline) + (parent anim-test-obj) ) - :method-count-assert 9 - :size-assert #x78 - :flag-assert #x900000078 (:methods - (new (symbol type int string) _type_ 0) + (new (symbol type int string) _type_) ) ) ;; definition for method 3 of type anim-test-sequence -(defmethod inspect anim-test-sequence ((this anim-test-sequence)) +(defmethod inspect ((this anim-test-sequence)) (format #t "[~8x] ~A~%" this 'anim-test-sequence) (format #t "~Tnext: #~%" (-> this next)) (format #t "~Tprev: #~%" (-> this prev)) @@ -655,25 +633,22 @@ ;; definition of type anim-test-seq-item (deftype anim-test-seq-item (glst-named-node) - ((speed int32 :offset-assert 12) - (blend int32 :offset-assert 16) - (first-frame float :offset-assert 20) - (last-frame float :offset-assert 24) - (num-frames float :offset-assert 28) - (artist-base float :offset-assert 32) - (flags int32 :offset-assert 36) - (parent anim-test-sequence :offset-assert 40) + ((speed int32) + (blend int32) + (first-frame float) + (last-frame float) + (num-frames float) + (artist-base float) + (flags int32) + (parent anim-test-sequence) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c (:methods - (new (symbol type int string) _type_ 0) + (new (symbol type int string) _type_) ) ) ;; definition for method 3 of type anim-test-seq-item -(defmethod inspect anim-test-seq-item ((this anim-test-seq-item)) +(defmethod inspect ((this anim-test-seq-item)) (format #t "[~8x] ~A~%" this 'anim-test-seq-item) (format #t "~Tnext: #~%" (-> this next)) (format #t "~Tprev: #~%" (-> this prev)) @@ -728,7 +703,7 @@ ;; definition for method 3 of type anim-tester ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch object vs anim-tester. -(defmethod inspect anim-tester ((this anim-tester)) +(defmethod inspect ((this anim-tester)) (format #t "--anim-tester--~%") (let ((v1-0 (-> this obj-list))) "return the start of the list" diff --git a/test/decompiler/reference/jak1/engine/debug/assert-h_REF.gc b/test/decompiler/reference/jak1/engine/debug/assert-h_REF.gc index 2386f305b5a..f892f53214a 100644 --- a/test/decompiler/reference/jak1/engine/debug/assert-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/assert-h_REF.gc @@ -3,21 +3,18 @@ ;; definition of type __assert-info-private-struct (deftype __assert-info-private-struct (structure) - ((filename string :offset-assert 0) - (line-num uint16 :offset-assert 4) - (column-num uint16 :offset-assert 6) + ((filename string) + (line-num uint16) + (column-num uint16) ) - :method-count-assert 11 - :size-assert #x8 - :flag-assert #xb00000008 (:methods - (set-pos (_type_ string uint uint) int 9) - (print-pos (_type_) int 10) + (set-pos (_type_ string uint uint) int) + (print-pos (_type_) int) ) ) ;; definition for method 3 of type __assert-info-private-struct -(defmethod inspect __assert-info-private-struct ((this __assert-info-private-struct)) +(defmethod inspect ((this __assert-info-private-struct)) (format #t "[~8x] ~A~%" this '__assert-info-private-struct) (format #t "~Tfilename: ~A~%" (-> this filename)) (format #t "~Tline-num: ~D~%" (-> this line-num)) @@ -26,7 +23,7 @@ ) ;; definition for method 9 of type __assert-info-private-struct -(defmethod set-pos __assert-info-private-struct ((this __assert-info-private-struct) (filename string) (line-num uint) (column-num uint)) +(defmethod set-pos ((this __assert-info-private-struct) (filename string) (line-num uint) (column-num uint)) (set! (-> this filename) filename) (set! (-> this line-num) line-num) (set! (-> this column-num) column-num) @@ -34,7 +31,7 @@ ) ;; definition for method 10 of type __assert-info-private-struct -(defmethod print-pos __assert-info-private-struct ((this __assert-info-private-struct)) +(defmethod print-pos ((this __assert-info-private-struct)) (format #t "file ~S.gc, line ~D, col ~D.~%" (-> this filename) (-> this line-num) (-> this column-num)) 0 ) diff --git a/test/decompiler/reference/jak1/engine/debug/debug-h_REF.gc b/test/decompiler/reference/jak1/engine/debug/debug-h_REF.gc index 74beb53191b..06852767b3c 100644 --- a/test/decompiler/reference/jak1/engine/debug/debug-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/debug-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type pos-history (deftype pos-history (structure) - ((points (inline-array vector) :offset-assert 0) - (num-points int32 :offset-assert 4) - (h-first int32 :offset-assert 8) - (h-last int32 :offset-assert 12) + ((points (inline-array vector)) + (num-points int32) + (h-first int32) + (h-last int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type pos-history -(defmethod inspect pos-history ((this pos-history)) +(defmethod inspect ((this pos-history)) (format #t "[~8x] ~A~%" this 'pos-history) (format #t "~Tpoints: #x~X~%" (-> this points)) (format #t "~Tnum-points: ~D~%" (-> this num-points)) @@ -25,18 +22,15 @@ ;; definition of type debug-vertex (deftype debug-vertex (structure) - ((trans vector4w :inline :offset-assert 0) - (normal vector3h :inline :offset-assert 16) - (st vector2h :inline :offset-assert 22) - (color uint32 :offset-assert 28) + ((trans vector4w :inline) + (normal vector3h :inline) + (st vector2h :inline) + (color uint32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type debug-vertex -(defmethod inspect debug-vertex ((this debug-vertex)) +(defmethod inspect ((this debug-vertex)) (format #t "[~8x] ~A~%" this 'debug-vertex) (format #t "~Ttrans: ~`vector4w`P~%" (-> this trans)) (format #t "~Tnormal: ~`vector3h`P~%" (-> this normal)) @@ -47,17 +41,15 @@ ;; definition of type debug-vertex-stats (deftype debug-vertex-stats (basic) - ((length int32 :offset-assert 4) - (pos-count int32 :offset-assert 8) - (vertex debug-vertex 600 :inline :offset-assert 16) + ((length int32) + (pos-count int32) + (vertex debug-vertex 600 :inline) ) - :method-count-assert 9 - :size-assert #x4b10 - :flag-assert #x900004b10 ) ;; definition for method 3 of type debug-vertex-stats -(defmethod inspect debug-vertex-stats ((this debug-vertex-stats)) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this debug-vertex-stats)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tpos-count: ~D~%" (-> this pos-count)) diff --git a/test/decompiler/reference/jak1/engine/debug/debug-sphere_REF.gc b/test/decompiler/reference/jak1/engine/debug/debug-sphere_REF.gc index ee25e0ce366..9486e8bca9a 100644 --- a/test/decompiler/reference/jak1/engine/debug/debug-sphere_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/debug-sphere_REF.gc @@ -3,15 +3,12 @@ ;; definition of type debug-sphere-table (deftype debug-sphere-table (basic) - ((point vector 300 :inline :offset-assert 16) + ((point vector 300 :inline) ) - :method-count-assert 9 - :size-assert #x12d0 - :flag-assert #x9000012d0 ) ;; definition for method 3 of type debug-sphere-table -(defmethod inspect debug-sphere-table ((this debug-sphere-table)) +(defmethod inspect ((this debug-sphere-table)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tpoint[300] @ #x~X~%" (-> this point)) this diff --git a/test/decompiler/reference/jak1/engine/debug/debug_REF.gc b/test/decompiler/reference/jak1/engine/debug/debug_REF.gc index f809c08bf55..75a698bf7cf 100644 --- a/test/decompiler/reference/jak1/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/debug_REF.gc @@ -483,21 +483,18 @@ (when *debug-segment* ;; definition of type debug-line (deftype debug-line (structure) - ((flags int32 :offset-assert 0) - (bucket bucket-id :offset-assert 4) - (v1 vector :inline :offset-assert 16) - (v2 vector :inline :offset-assert 32) - (color rgba :offset-assert 48) - (mode symbol :offset-assert 52) - (color2 rgba :offset-assert 56) + ((flags int32) + (bucket bucket-id) + (v1 vector :inline) + (v2 vector :inline) + (color rgba) + (mode symbol) + (color2 rgba) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) ;; definition for method 3 of type debug-line -(defmethod inspect debug-line ((this debug-line)) +(defmethod inspect ((this debug-line)) (format #t "[~8x] ~A~%" this 'debug-line) (format #t "~Tflags: ~D~%" (-> this flags)) (format #t "~Tbucket: ~D~%" (-> this bucket)) @@ -511,20 +508,17 @@ ;; definition of type debug-text-3d (deftype debug-text-3d (structure) - ((flags int32 :offset-assert 0) - (bucket bucket-id :offset-assert 4) - (pos vector :inline :offset-assert 16) - (color font-color :offset-assert 32) - (offset vector2h :inline :offset-assert 40) - (str string :offset-assert 44) + ((flags int32) + (bucket bucket-id) + (pos vector :inline) + (color font-color) + (offset vector2h :inline) + (str string) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type debug-text-3d -(defmethod inspect debug-text-3d ((this debug-text-3d)) +(defmethod inspect ((this debug-text-3d)) (format #t "[~8x] ~A~%" this 'debug-text-3d) (format #t "~Tflags: ~D~%" (-> this flags)) (format #t "~Tbucket: ~D~%" (-> this bucket)) @@ -537,16 +531,13 @@ ;; definition of type debug-tracking-thang (deftype debug-tracking-thang (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) + ((length int32) + (allocated-length int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type debug-tracking-thang -(defmethod inspect debug-tracking-thang ((this debug-tracking-thang)) +(defmethod inspect ((this debug-tracking-thang)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -1345,7 +1336,8 @@ ) ;; definition for method 3 of type debug-vertex-stats -(defmethod inspect debug-vertex-stats ((this debug-vertex-stats)) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this debug-vertex-stats)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tpos-count: ~D~%" (-> this pos-count)) diff --git a/test/decompiler/reference/jak1/engine/debug/memory-usage-h_REF.gc b/test/decompiler/reference/jak1/engine/debug/memory-usage-h_REF.gc index 2a6d6c6870b..d1a31a39451 100644 --- a/test/decompiler/reference/jak1/engine/debug/memory-usage-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/memory-usage-h_REF.gc @@ -6,18 +6,15 @@ ;; definition of type memory-usage-info (deftype memory-usage-info (structure) - ((name string :offset-assert 0) - (count int32 :offset-assert 4) - (used int32 :offset-assert 8) - (total int32 :offset-assert 12) + ((name string) + (count int32) + (used int32) + (total int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type memory-usage-info -(defmethod inspect memory-usage-info ((this memory-usage-info)) +(defmethod inspect ((this memory-usage-info)) (format #t "[~8x] ~A~%" this 'memory-usage-info) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tcount: ~D~%" (-> this count)) @@ -28,22 +25,20 @@ ;; definition of type memory-usage-block (deftype memory-usage-block (basic) - ((work-bsp basic :offset-assert 4) - (length int32 :offset-assert 8) - (data memory-usage-info 109 :inline :offset-assert 16) + ((work-bsp basic) + (length int32) + (data memory-usage-info 109 :inline) ) - :method-count-assert 12 - :size-assert #x6e0 - :flag-assert #xc000006e0 (:methods - (reset! (_type_) _type_ 9) - (calculate-total (_type_) int 10) - (print-mem-usage (_type_ level object) none 11) + (reset! (_type_) _type_) + (calculate-total (_type_) int) + (print-mem-usage (_type_ level object) none) ) ) ;; definition for method 3 of type memory-usage-block -(defmethod inspect memory-usage-block ((this memory-usage-block)) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this memory-usage-block)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Twork-bsp: ~A~%" (-> this work-bsp)) (format #t "~Tlength: ~D~%" (-> this length)) diff --git a/test/decompiler/reference/jak1/engine/debug/memory-usage_REF.gc b/test/decompiler/reference/jak1/engine/debug/memory-usage_REF.gc index 13efb33290f..85369e1dbd8 100644 --- a/test/decompiler/reference/jak1/engine/debug/memory-usage_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/memory-usage_REF.gc @@ -5,7 +5,8 @@ (declare-file (debug)) ;; definition for method 3 of type memory-usage-block -(defmethod inspect memory-usage-block ((this memory-usage-block)) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this memory-usage-block)) (format #t "-------------------------------------------------------------~%") (format #t " # name count bytes used aligned bytes~%") (format #t "-------------------------------------------------------------~%") @@ -34,7 +35,7 @@ ) ;; definition for method 8 of type object -(defmethod mem-usage object ((this object) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this object) (arg0 memory-usage-block) (arg1 int)) (if this (format #t "WARNING: mem-usage called on object, probably not what was wanted for ~A~%" this) ) @@ -42,7 +43,7 @@ ) ;; definition for method 10 of type memory-usage-block -(defmethod calculate-total memory-usage-block ((this memory-usage-block)) +(defmethod calculate-total ((this memory-usage-block)) (let ((v0-0 0)) (dotimes (v1-0 (-> this length)) (+! v0-0 (-> this data v1-0 total)) @@ -52,7 +53,7 @@ ) ;; definition for method 9 of type memory-usage-block -(defmethod reset! memory-usage-block ((this memory-usage-block)) +(defmethod reset! ((this memory-usage-block)) (set! (-> this length) 0) (dotimes (v1-0 109) (set! (-> this data v1-0 used) 0) @@ -74,7 +75,7 @@ ) ;; definition for method 14 of type level -(defmethod compute-memory-usage level ((this level) (arg0 object)) +(defmethod compute-memory-usage ((this level) (arg0 object)) (if (zero? (-> this mem-usage-block)) (set! (-> this mem-usage-block) (new 'debug 'memory-usage-block)) ) @@ -87,7 +88,7 @@ ) ;; definition for method 8 of type process-tree -(defmethod mem-usage process-tree ((this process-tree) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this process-tree) (arg0 memory-usage-block) (arg1 int)) (let ((v1-0 87)) (let* ((a0-1 *dead-pool-list*) (a3-0 (car a0-1)) @@ -304,7 +305,7 @@ ;; definition for method 11 of type memory-usage-block ;; INFO: Used lq/sq ;; INFO: Return type mismatch memory-usage-block vs none. -(defmethod print-mem-usage memory-usage-block ((this memory-usage-block) (arg0 level) (arg1 object)) +(defmethod print-mem-usage ((this memory-usage-block) (arg0 level) (arg1 object)) (local-vars (sv-16 object) (sv-32 string) (sv-48 symbol) (sv-64 int) (sv-80 int)) (let ((s3-0 (&- (-> arg0 heap current) (the-as uint (-> arg0 heap base))))) (let ((v1-2 (+ (-> this data 59 total) (-> this data 60 total)))) diff --git a/test/decompiler/reference/jak1/engine/debug/menu_REF.gc b/test/decompiler/reference/jak1/engine/debug/menu_REF.gc index b493cf1b64e..7ff49f31f9c 100644 --- a/test/decompiler/reference/jak1/engine/debug/menu_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/menu_REF.gc @@ -6,25 +6,22 @@ ;; definition of type debug-menu-context (deftype debug-menu-context (basic) - ((is-active symbol :offset-assert 4) - (sel-length int32 :offset-assert 8) - (sel-menu debug-menu 8 :offset-assert 12) - (root-menu debug-menu :offset-assert 44) - (joypad-func (function basic none) :offset-assert 48) - (joypad-item basic :offset-assert 52) - (font font-context :offset-assert 56) - (is-hidden symbol :offset-assert 60) + ((is-active symbol) + (sel-length int32) + (sel-menu debug-menu 8) + (root-menu debug-menu) + (joypad-func (function basic none)) + (joypad-item basic) + (font font-context) + (is-hidden symbol) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type debug-menu-context -(defmethod inspect debug-menu-context ((this debug-menu-context)) +(defmethod inspect ((this debug-menu-context)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tis-active: ~A~%" (-> this is-active)) (format #t "~Tsel-length: ~D~%" (-> this sel-length)) @@ -55,18 +52,15 @@ ;; definition of type debug-menu-node (deftype debug-menu-node (basic) - ((name string :offset-assert 4) - (parent debug-menu :offset-assert 8) - (refresh-delay int32 :offset-assert 12) - (refresh-ctr int32 :offset-assert 16) + ((name string) + (parent debug-menu) + (refresh-delay int32) + (refresh-ctr int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type debug-menu-node -(defmethod inspect debug-menu-node ((this debug-menu-node)) +(defmethod inspect ((this debug-menu-node)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tparent: ~A~%" (-> this parent)) @@ -76,29 +70,26 @@ ) ;; definition for method 2 of type debug-menu-node -(defmethod print debug-menu-node ((this debug-menu-node)) +(defmethod print ((this debug-menu-node)) (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) this ) ;; definition of type debug-menu (deftype debug-menu (debug-menu-node) - ((context debug-menu-context :offset-assert 20) - (selected-item debug-menu-item :offset-assert 24) - (pix-width int32 :offset-assert 28) - (pix-height int32 :offset-assert 32) - (items pair :offset-assert 36) + ((context debug-menu-context) + (selected-item debug-menu-item) + (pix-width int32) + (pix-height int32) + (items pair) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 (:methods - (new (symbol type debug-menu-context string) _type_ 0) + (new (symbol type debug-menu-context string) _type_) ) ) ;; definition for method 3 of type debug-menu -(defmethod inspect debug-menu ((this debug-menu)) +(defmethod inspect ((this debug-menu)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tparent: ~A~%" (-> this parent)) @@ -126,15 +117,12 @@ ;; definition of type debug-menu-item (deftype debug-menu-item (debug-menu-node) - ((id int32 :offset-assert 20) + ((id int32) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type debug-menu-item -(defmethod inspect debug-menu-item ((this debug-menu-item)) +(defmethod inspect ((this debug-menu-item)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tparent: ~A~%" (-> this parent)) @@ -146,18 +134,15 @@ ;; definition of type debug-menu-item-submenu (deftype debug-menu-item-submenu (debug-menu-item) - ((submenu debug-menu :offset-assert 24) + ((submenu debug-menu) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c (:methods - (new (symbol type string debug-menu) _type_ 0) + (new (symbol type string debug-menu) _type_) ) ) ;; definition for method 3 of type debug-menu-item-submenu -(defmethod inspect debug-menu-item-submenu ((this debug-menu-item-submenu)) +(defmethod inspect ((this debug-menu-item-submenu)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tparent: ~A~%" (-> this parent)) @@ -183,19 +168,16 @@ ;; definition of type debug-menu-item-function (deftype debug-menu-item-function (debug-menu-item) - ((activate-func (function object object) :offset-assert 24) - (hilite-timer int8 :offset-assert 28) + ((activate-func (function object object)) + (hilite-timer int8) ) - :method-count-assert 9 - :size-assert #x1d - :flag-assert #x90000001d (:methods - (new (symbol type string object (function object object)) _type_ 0) + (new (symbol type string object (function object object)) _type_) ) ) ;; definition for method 3 of type debug-menu-item-function -(defmethod inspect debug-menu-item-function ((this debug-menu-item-function)) +(defmethod inspect ((this debug-menu-item-function)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tparent: ~A~%" (-> this parent)) @@ -223,19 +205,16 @@ ;; definition of type debug-menu-item-flag (deftype debug-menu-item-flag (debug-menu-item) - ((activate-func (function object debug-menu-msg object) :offset-assert 24) - (is-on object :offset-assert 28) + ((activate-func (function object debug-menu-msg object)) + (is-on object) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 (:methods - (new (symbol type string object (function object debug-menu-msg object)) _type_ 0) + (new (symbol type string object (function object debug-menu-msg object)) _type_) ) ) ;; definition for method 3 of type debug-menu-item-flag -(defmethod inspect debug-menu-item-flag ((this debug-menu-item-flag)) +(defmethod inspect ((this debug-menu-item-flag)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tparent: ~A~%" (-> this parent)) @@ -268,43 +247,40 @@ ;; definition of type debug-menu-item-var (deftype debug-menu-item-var (debug-menu-item) - ((display-str string :offset-assert 24) - (grabbed-joypad-p symbol :offset-assert 28) - (float-p symbol :offset-assert 32) - (range-p symbol :offset-assert 36) - (show-len int32 :offset-assert 40) - (inc-delay int32 :offset-assert 44) - (inc-delay-ctr int32 :offset-assert 48) - (step-delay-ctr int32 :offset-assert 52) - (inc-dir int32 :offset-assert 56) - (fval float :offset-assert 60) - (fundo-val float :offset-assert 64) - (frange-min float :offset-assert 68) - (frange-max float :offset-assert 72) - (fstart-inc float :offset-assert 76) - (fstep float :offset-assert 80) - (fprecision int32 :offset-assert 84) - (factivate-func (function int debug-menu-msg float float float) :offset-assert 88) - (ival int32 :offset 60) - (iundo-val int32 :offset 64) - (irange-min int32 :offset 68) - (irange-max int32 :offset 72) - (istart-inc int32 :offset 76) - (istep int32 :offset 80) - (ihex-p symbol :offset-assert 92) - (iactivate-func (function int debug-menu-msg int int int) :offset 88) - (ifloat-p symbol :offset-assert 96) + ((display-str string) + (grabbed-joypad-p symbol) + (float-p symbol) + (range-p symbol) + (show-len int32) + (inc-delay int32) + (inc-delay-ctr int32) + (step-delay-ctr int32) + (inc-dir int32) + (fval float) + (fundo-val float) + (frange-min float) + (frange-max float) + (fstart-inc float) + (fstep float) + (fprecision int32) + (factivate-func (function int debug-menu-msg float float float)) + (ival int32 :overlay-at fval) + (iundo-val int32 :overlay-at fundo-val) + (irange-min int32 :overlay-at frange-min) + (irange-max int32 :overlay-at frange-max) + (istart-inc int32 :overlay-at fstart-inc) + (istep int32 :overlay-at fstep) + (ihex-p symbol) + (iactivate-func (function int debug-menu-msg int int int) :overlay-at factivate-func) + (ifloat-p symbol) ) - :method-count-assert 9 - :size-assert #x64 - :flag-assert #x900000064 (:methods - (new (symbol type string int int) _type_ 0) + (new (symbol type string int int) _type_) ) ) ;; definition for method 3 of type debug-menu-item-var -(defmethod inspect debug-menu-item-var ((this debug-menu-item-var)) +(defmethod inspect ((this debug-menu-item-var)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tparent: ~A~%" (-> this parent)) @@ -477,14 +453,14 @@ ) ;; definition for function debug-menu-context-grab-joypad -(defun debug-menu-context-grab-joypad ((menu debug-menu-context) (callback-arg basic) (callback-func (function basic none))) +(defun debug-menu-context-grab-joypad ((ctxt debug-menu-context) (callback-arg basic) (callback-func (function basic none))) (cond - ((-> menu joypad-func) + ((-> ctxt joypad-func) #f ) (else - (set! (-> menu joypad-func) callback-func) - (set! (-> menu joypad-item) callback-arg) + (set! (-> ctxt joypad-func) callback-func) + (set! (-> ctxt joypad-item) callback-arg) #t ) ) @@ -1058,32 +1034,32 @@ ) ;; definition for function debug-menu-item-render -(defun debug-menu-item-render ((arg0 debug-menu-item) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) - (when (> (-> arg0 refresh-delay) 0) - (+! (-> arg0 refresh-ctr) -1) - (when (<= (-> arg0 refresh-ctr) 0) - (set! (-> arg0 refresh-ctr) (-> arg0 refresh-delay)) - (debug-menu-item-send-msg arg0 (debug-menu-msg update)) +(defun debug-menu-item-render ((item debug-menu-item) (x int) (y int) (submenus int) (selected symbol)) + (when (> (-> item refresh-delay) 0) + (+! (-> item refresh-ctr) -1) + (when (<= (-> item refresh-ctr) 0) + (set! (-> item refresh-ctr) (-> item refresh-delay)) + (debug-menu-item-send-msg item (debug-menu-msg update)) ) ) (cond - ((= (-> arg0 type) debug-menu-item-submenu) - (debug-menu-item-submenu-render (the-as debug-menu-item-submenu arg0) arg1 arg2 arg3 arg4) + ((= (-> item type) debug-menu-item-submenu) + (debug-menu-item-submenu-render (the-as debug-menu-item-submenu item) x y submenus selected) ) - ((= (-> arg0 type) debug-menu-item-function) - (debug-menu-item-function-render (the-as debug-menu-item-function arg0) arg1 arg2 arg3 arg4) + ((= (-> item type) debug-menu-item-function) + (debug-menu-item-function-render (the-as debug-menu-item-function item) x y submenus selected) ) - ((= (-> arg0 type) debug-menu-item-flag) - (debug-menu-item-flag-render (the-as debug-menu-item-flag arg0) arg1 arg2 arg3 arg4) + ((= (-> item type) debug-menu-item-flag) + (debug-menu-item-flag-render (the-as debug-menu-item-flag item) x y submenus selected) ) - ((= (-> arg0 type) debug-menu-item-var) - (debug-menu-item-var-render (the-as debug-menu-item-var arg0) arg1 arg2 arg3 arg4) + ((= (-> item type) debug-menu-item-var) + (debug-menu-item-var-render (the-as debug-menu-item-var item) x y submenus selected) ) (else (format 0 "ERROR: Found unknown item type!~%") ) ) - arg0 + item ) ;; definition for function debug-menu-render @@ -1175,13 +1151,13 @@ ;; definition for function debug-menu-context-render (defun debug-menu-context-render ((arg0 debug-menu-context)) - (let ((s4-0 6)) - (dotimes (s5-0 (-> arg0 sel-length)) - (let ((s3-0 (-> arg0 sel-menu s5-0))) - (let ((a3-0 (-> s3-0 selected-item))) - (debug-menu-render s3-0 s4-0 28 a3-0 (+ (- -1 s5-0) (-> arg0 sel-length))) + (let ((x-pos 6)) + (dotimes (stack-idx (-> arg0 sel-length)) + (let ((menu (-> arg0 sel-menu stack-idx))) + (let ((selection (-> menu selected-item))) + (debug-menu-render menu x-pos 28 selection (+ (- -1 stack-idx) (-> arg0 sel-length))) ) - (set! s4-0 (+ s4-0 3 (-> s3-0 pix-width))) + (set! x-pos (+ x-pos 3 (-> menu pix-width))) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/debug/part-tester_REF.gc b/test/decompiler/reference/jak1/engine/debug/part-tester_REF.gc index fb5bd5d5313..6f7d1c4c153 100644 --- a/test/decompiler/reference/jak1/engine/debug/part-tester_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/part-tester_REF.gc @@ -9,18 +9,15 @@ ;; definition of type part-tester (deftype part-tester (process) - ((root trsqv :offset-assert 112) - (part sparticle-launch-control :offset-assert 116) - (old-group sparticle-launch-group :offset-assert 120) + ((root trsqv) + (part sparticle-launch-control) + (old-group sparticle-launch-group) ) :heap-base #x100 - :method-count-assert 14 - :size-assert #x7c - :flag-assert #xe0100007c ) ;; definition for method 3 of type part-tester -(defmethod inspect part-tester ((this part-tester)) +(defmethod inspect ((this part-tester)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -34,7 +31,7 @@ (define *part-tester-name* (the-as string #f)) ;; definition for method 10 of type part-tester -(defmethod deactivate part-tester ((this part-tester)) +(defmethod deactivate ((this part-tester)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) diff --git a/test/decompiler/reference/jak1/engine/debug/stats-h_REF.gc b/test/decompiler/reference/jak1/engine/debug/stats-h_REF.gc index 410ff00a339..73f78643642 100644 --- a/test/decompiler/reference/jak1/engine/debug/stats-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/stats-h_REF.gc @@ -3,20 +3,17 @@ ;; definition of type tr-stat (deftype tr-stat (structure) - ((groups uint16 :offset-assert 0) - (fragments uint16 :offset-assert 2) - (tris uint32 :offset-assert 4) - (dverts uint32 :offset-assert 8) - (instances uint16 :offset-assert 12) - (pad uint16 :offset-assert 14) + ((groups uint16) + (fragments uint16) + (tris uint32) + (dverts uint32) + (instances uint16) + (pad uint16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type tr-stat -(defmethod inspect tr-stat ((this tr-stat)) +(defmethod inspect ((this tr-stat)) (format #t "[~8x] ~A~%" this 'tr-stat) (format #t "~Tgroups: ~D~%" (-> this groups)) (format #t "~Tfragments: ~D~%" (-> this fragments)) @@ -29,16 +26,13 @@ ;; definition of type merc-global-stats (deftype merc-global-stats (structure) - ((merc tr-stat :inline :offset-assert 0) - (mercneric tr-stat :inline :offset-assert 16) + ((merc tr-stat :inline) + (mercneric tr-stat :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type merc-global-stats -(defmethod inspect merc-global-stats ((this merc-global-stats)) +(defmethod inspect ((this merc-global-stats)) (format #t "[~8x] ~A~%" this 'merc-global-stats) (format #t "~Tmerc: #~%" (-> this merc)) (format #t "~Tmercneric: #~%" (-> this mercneric)) @@ -47,35 +41,32 @@ ;; definition of type perf-stat (deftype perf-stat (structure) - ((frame-number uint32 :offset-assert 0) - (count uint32 :offset-assert 4) - (cycles uint32 :offset-assert 8) - (instructions uint32 :offset-assert 12) - (icache uint32 :offset-assert 16) - (dcache uint32 :offset-assert 20) - (select uint32 :offset-assert 24) - (ctrl uint32 :offset-assert 28) - (accum0 uint32 :offset-assert 32) - (accum1 uint32 :offset-assert 36) - (to-vu0-waits uint32 :offset-assert 40) - (to-spr-waits uint32 :offset-assert 44) - (from-spr-waits uint32 :offset-assert 48) + ((frame-number uint32) + (count uint32) + (cycles uint32) + (instructions uint32) + (icache uint32) + (dcache uint32) + (select uint32) + (ctrl uint32) + (accum0 uint32) + (accum1 uint32) + (to-vu0-waits uint32) + (to-spr-waits uint32) + (from-spr-waits uint32) ) :pack-me - :method-count-assert 14 - :size-assert #x34 - :flag-assert #xe00000034 (:methods - (perf-stat-method-9 (_type_) none 9) - (print-to-stream (_type_ string basic) none 10) - (reset! (_type_) none 11) - (read! (_type_) none 12) - (update-wait-stats (_type_ uint uint uint) none 13) + (perf-stat-method-9 (_type_) none) + (print-to-stream (_type_ string basic) none) + (reset! (_type_) none) + (read! (_type_) none) + (update-wait-stats (_type_ uint uint uint) none) ) ) ;; definition for method 3 of type perf-stat -(defmethod inspect perf-stat ((this perf-stat)) +(defmethod inspect ((this perf-stat)) (format #t "[~8x] ~A~%" this 'perf-stat) (format #t "~Tframe-number: ~D~%" (-> this frame-number)) (format #t "~Tcount: ~D~%" (-> this count)) @@ -95,15 +86,12 @@ ;; definition of type perf-stat-array (deftype perf-stat-array (inline-array-class) - ((data perf-stat :inline :dynamic :offset-assert 16) + ((data perf-stat :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type perf-stat-array -(defmethod inspect perf-stat-array ((this perf-stat-array)) +(defmethod inspect ((this perf-stat-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -116,7 +104,7 @@ ;; definition for method 11 of type perf-stat ;; INFO: Return type mismatch int vs none. -(defmethod reset! perf-stat ((this perf-stat)) +(defmethod reset! ((this perf-stat)) (let ((v1-0 (-> this ctrl))) (+! (-> this count) 1) (b! (zero? v1-0) cfg-2 :delay (nop!)) @@ -138,7 +126,7 @@ ;; definition for method 12 of type perf-stat ;; INFO: Return type mismatch int vs none. -(defmethod read! perf-stat ((this perf-stat)) +(defmethod read! ((this perf-stat)) (local-vars (v1-1 int) (v1-3 int)) (b! (zero? (-> this ctrl)) cfg-2 :delay (nop!)) (.mtc0 Perf 0) @@ -155,7 +143,7 @@ ;; definition for method 13 of type perf-stat ;; INFO: Return type mismatch int vs none. -(defmethod update-wait-stats perf-stat ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) +(defmethod update-wait-stats ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) (when (nonzero? (-> this ctrl)) (+! (-> this to-vu0-waits) arg0) (+! (-> this to-spr-waits) arg1) diff --git a/test/decompiler/reference/jak1/engine/debug/viewer_REF.gc b/test/decompiler/reference/jak1/engine/debug/viewer_REF.gc index 475f4ac9b20..6b2f84528d0 100644 --- a/test/decompiler/reference/jak1/engine/debug/viewer_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/viewer_REF.gc @@ -10,19 +10,15 @@ ;; definition of type viewer (deftype viewer (process-drawable) - ((janim art-joint-anim :offset-assert 176) + ((janim art-joint-anim) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states viewer-process ) ) ;; definition for method 3 of type viewer -(defmethod inspect viewer ((this viewer)) +(defmethod inspect ((this viewer)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -184,7 +180,7 @@ ;; definition for method 11 of type viewer ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! viewer ((this viewer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this viewer) (arg0 entity-actor)) (set! *viewer* this) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) diff --git a/test/decompiler/reference/jak1/engine/dma/dma-buffer_REF.gc b/test/decompiler/reference/jak1/engine/dma/dma-buffer_REF.gc index e1d5519281b..b7f2b36cce7 100644 --- a/test/decompiler/reference/jak1/engine/dma/dma-buffer_REF.gc +++ b/test/decompiler/reference/jak1/engine/dma/dma-buffer_REF.gc @@ -3,19 +3,16 @@ ;; definition of type dma-packet (deftype dma-packet (structure) - ((dma dma-tag :offset-assert 0) - (vif0 vif-tag :offset-assert 8) - (vif1 vif-tag :offset-assert 12) - (quad uint128 :offset 0) + ((dma dma-tag) + (vif0 vif-tag) + (vif1 vif-tag) + (quad uint128 :overlay-at dma) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type dma-packet ;; INFO: Used lq/sq -(defmethod inspect dma-packet ((this dma-packet)) +(defmethod inspect ((this dma-packet)) (format #t "[~8x] ~A~%" this 'dma-packet) (format #t "~Tdma: #x~X~%" (-> this dma)) (format #t "~Tvif0: #x~X~%" (-> this vif0)) @@ -27,13 +24,10 @@ ;; definition of type dma-packet-array (deftype dma-packet-array (inline-array-class) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type dma-packet-array -(defmethod inspect dma-packet-array ((this dma-packet-array)) +(defmethod inspect ((this dma-packet-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -46,19 +40,16 @@ ;; definition of type dma-gif-packet (deftype dma-gif-packet (structure) - ((dma-vif dma-packet :inline :offset-assert 0) - (gif uint64 2 :offset-assert 16) - (gif0 uint64 :offset 16) - (gif1 uint64 :offset 24) - (quad uint128 2 :offset 0) + ((dma-vif dma-packet :inline) + (gif uint64 2) + (gif0 uint64 :overlay-at (-> gif 0)) + (gif1 uint64 :overlay-at (-> gif 1)) + (quad uint128 2 :overlay-at (-> dma-vif dma)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type dma-gif-packet -(defmethod inspect dma-gif-packet ((this dma-gif-packet)) +(defmethod inspect ((this dma-gif-packet)) (format #t "[~8x] ~A~%" this 'dma-gif-packet) (format #t "~Tdma-vif: #~%" (-> this dma-vif)) (format #t "~Tgif[2] @ #x~X~%" (&-> this gif0)) @@ -68,22 +59,19 @@ ;; definition of type dma-buffer (deftype dma-buffer (basic) - ((allocated-length int32 :offset-assert 4) - (base pointer :offset-assert 8) - (end pointer :offset-assert 12) - (data uint64 1 :offset-assert 16) - (data-buffer uint8 :dynamic :offset 16) + ((allocated-length int32) + (base pointer) + (end pointer) + (data uint64 1) + (data-buffer uint8 :dynamic :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) ;; definition for method 3 of type dma-buffer -(defmethod inspect dma-buffer ((this dma-buffer)) +(defmethod inspect ((this dma-buffer)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) (format #t "~Tbase: #x~X~%" (-> this base)) @@ -109,12 +97,12 @@ ) ;; definition for method 4 of type dma-buffer -(defmethod length dma-buffer ((this dma-buffer)) +(defmethod length ((this dma-buffer)) (-> this allocated-length) ) ;; definition for method 5 of type dma-buffer -(defmethod asize-of dma-buffer ((this dma-buffer)) +(defmethod asize-of ((this dma-buffer)) (+ (-> this allocated-length) -4 (-> dma-buffer size)) ) diff --git a/test/decompiler/reference/jak1/engine/dma/dma-disasm_REF.gc b/test/decompiler/reference/jak1/engine/dma/dma-disasm_REF.gc index 139b6f45a04..5c0f788ca50 100644 --- a/test/decompiler/reference/jak1/engine/dma/dma-disasm_REF.gc +++ b/test/decompiler/reference/jak1/engine/dma/dma-disasm_REF.gc @@ -6,20 +6,17 @@ ;; definition of type vif-disasm-element (deftype vif-disasm-element (structure) - ((mask uint32 :offset-assert 0) - (tag vif-cmd-32 :offset-assert 4) - (val uint32 :offset-assert 8) - (print uint32 :offset-assert 12) - (string1 string :offset-assert 16) - (string2 string :offset-assert 20) + ((mask uint32) + (tag vif-cmd-32) + (val uint32) + (print uint32) + (string1 string) + (string2 string) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type vif-disasm-element -(defmethod inspect vif-disasm-element ((this vif-disasm-element)) +(defmethod inspect ((this vif-disasm-element)) (format #t "[~8x] ~A~%" this 'vif-disasm-element) (format #t "~Tmask: ~D~%" (-> this mask)) (format #t "~Ttag: ~D~%" (-> this tag)) diff --git a/test/decompiler/reference/jak1/engine/dma/dma-h_REF.gc b/test/decompiler/reference/jak1/engine/dma/dma-h_REF.gc index 4e320744cdd..5bba3012593 100644 --- a/test/decompiler/reference/jak1/engine/dma/dma-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/dma/dma-h_REF.gc @@ -11,13 +11,10 @@ (str uint8 :offset 8 :size 1) (tag uint16 :offset 16 :size 16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type dma-chcr -(defmethod inspect dma-chcr ((this dma-chcr)) +(defmethod inspect ((this dma-chcr)) (format #t "[~8x] ~A~%" this 'dma-chcr) (format #t "~Tdir: ~D~%" (-> this dir)) (format #t "~Tmod: ~D~%" (-> this mod)) @@ -31,17 +28,14 @@ ;; definition of type dma-bank (deftype dma-bank (structure) - ((chcr dma-chcr :offset 0) - (madr uint32 :offset 16) - (qwc uint32 :offset 32) + ((chcr dma-chcr :offset 0) + (madr uint32 :offset 16) + (qwc uint32 :offset 32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type dma-bank -(defmethod inspect dma-bank ((this dma-bank)) +(defmethod inspect ((this dma-bank)) (format #t "[~8x] ~A~%" this 'dma-bank) (format #t "~Tchcr: #x~X~%" (-> this chcr)) (format #t "~Tmadr: #x~X~%" (-> this madr)) @@ -51,15 +45,12 @@ ;; definition of type dma-bank-source (deftype dma-bank-source (dma-bank) - ((tadr uint32 :offset 48) + ((tadr uint32 :offset 48) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type dma-bank-source -(defmethod inspect dma-bank-source ((this dma-bank-source)) +(defmethod inspect ((this dma-bank-source)) (format #t "[~8x] ~A~%" this 'dma-bank-source) (format #t "~Tchcr: #x~X~%" (-> this chcr)) (format #t "~Tmadr: #x~X~%" (-> this madr)) @@ -70,16 +61,13 @@ ;; definition of type dma-bank-vif (deftype dma-bank-vif (dma-bank-source) - ((as0 uint32 :offset 64) - (as1 uint32 :offset 80) + ((as0 uint32 :offset 64) + (as1 uint32 :offset 80) ) - :method-count-assert 9 - :size-assert #x54 - :flag-assert #x900000054 ) ;; definition for method 3 of type dma-bank-vif -(defmethod inspect dma-bank-vif ((this dma-bank-vif)) +(defmethod inspect ((this dma-bank-vif)) (format #t "[~8x] ~A~%" this 'dma-bank-vif) (format #t "~Tchcr: #x~X~%" (-> this chcr)) (format #t "~Tmadr: #x~X~%" (-> this madr)) @@ -92,15 +80,12 @@ ;; definition of type dma-bank-spr (deftype dma-bank-spr (dma-bank-source) - ((sadr uint32 :offset 128) + ((sadr uint32 :offset 128) ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) ;; definition for method 3 of type dma-bank-spr -(defmethod inspect dma-bank-spr ((this dma-bank-spr)) +(defmethod inspect ((this dma-bank-spr)) (format #t "[~8x] ~A~%" this 'dma-bank-spr) (format #t "~Tchcr: #x~X~%" (-> this chcr)) (format #t "~Tmadr: #x~X~%" (-> this madr)) @@ -119,18 +104,12 @@ (std uint8 :offset 6 :size 2) (rcyc uint8 :offset 8 :size 3) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type dma-enable (deftype dma-enable (uint32) ((cpnd uint8 :offset 16 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type dma-sqwc @@ -138,30 +117,24 @@ ((sqwc uint8 :offset 0 :size 8) (tqwc uint8 :offset 16 :size 8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type dma-bank-control (deftype dma-bank-control (structure) - ((ctrl dma-ctrl :offset 0) - (stat uint32 :offset 16) - (pcr uint32 :offset 32) - (sqwc dma-sqwc :offset 48) - (rbsr uint32 :offset 64) - (rbor uint32 :offset 80) - (stadr uint32 :offset 96) - (enabler uint32 :offset 5408) - (enablew uint32 :offset 5520) + ((ctrl dma-ctrl :offset 0) + (stat uint32 :offset 16) + (pcr uint32 :offset 32) + (sqwc dma-sqwc :offset 48) + (rbsr uint32 :offset 64) + (rbor uint32 :offset 80) + (stadr uint32 :offset 96) + (enabler uint32 :offset 5408) + (enablew uint32 :offset 5520) ) - :method-count-assert 9 - :size-assert #x1594 - :flag-assert #x900001594 ) ;; definition for method 3 of type dma-bank-control -(defmethod inspect dma-bank-control ((this dma-bank-control)) +(defmethod inspect ((this dma-bank-control)) (format #t "[~8x] ~A~%" this 'dma-bank-control) (format #t "~Tctrl: #x~X~%" (-> this ctrl)) (format #t "~Tstat: #x~X~%" (-> this stat)) @@ -177,18 +150,15 @@ ;; definition of type vu-code-block (deftype vu-code-block (basic) - ((name basic :offset-assert 4) - (code uint32 :offset-assert 8) - (size int32 :offset-assert 12) - (dest-address uint32 :offset-assert 16) + ((name basic) + (code uint32) + (size int32) + (dest-address uint32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type vu-code-block -(defmethod inspect vu-code-block ((this vu-code-block)) +(defmethod inspect ((this vu-code-block)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tcode: #x~X~%" (-> this code)) @@ -200,9 +170,6 @@ ;; definition of type vu-stat (deftype vu-stat (uint64) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type dma-tag @@ -214,13 +181,10 @@ (addr uint32 :offset 32 :size 31) (spr uint8 :offset 63 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type dma-tag -(defmethod inspect dma-tag ((this dma-tag)) +(defmethod inspect ((this dma-tag)) (format #t "[~8x] ~A~%" this 'dma-tag) (format #t "~Tqwc: ~D~%" (-> this qwc)) (format #t "~Tpce: ~D~%" (-> this pce)) @@ -233,18 +197,15 @@ ;; definition of type dma-bucket (deftype dma-bucket (structure) - ((tag dma-tag :offset-assert 0) - (last (pointer dma-tag) :offset-assert 8) - (dummy uint32 :offset-assert 12) - (next uint32 :offset 4) + ((tag dma-tag) + (last (pointer dma-tag)) + (dummy uint32) + (next uint32 :offset 4) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type dma-bucket -(defmethod inspect dma-bucket ((this dma-bucket)) +(defmethod inspect ((this dma-bucket)) (format #t "[~8x] ~A~%" this 'dma-bucket) (format #t "~Ttag: ~D~%" (-> this tag)) (format #t "~Tlast: #x~X~%" (-> this last)) @@ -272,9 +233,6 @@ (m14 uint8 :offset 28 :size 2) (m15 uint8 :offset 30 :size 2) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type vif-stcycl-imm @@ -282,9 +240,6 @@ ((cl uint8 :offset 0 :size 8) (wl uint8 :offset 8 :size 8) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition of type vif-unpack-imm @@ -293,9 +248,6 @@ (usn uint8 :offset 14 :size 1) (flg uint8 :offset 15 :size 1) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition of type vif-tag @@ -306,13 +258,10 @@ (irq uint8 :offset 31 :size 1) (msk uint8 :offset 28 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type vif-tag -(defmethod inspect vif-tag ((this vif-tag)) +(defmethod inspect ((this vif-tag)) (format #t "[~8x] ~A~%" this 'vif-tag) (format #t "~Timm: #x~X~%" (-> this imm)) (format #t "~Tnum: ~D~%" (-> this num)) diff --git a/test/decompiler/reference/jak1/engine/draw/draw-node-h_REF.gc b/test/decompiler/reference/jak1/engine/draw/draw-node-h_REF.gc index d0a51198beb..1547769d301 100644 --- a/test/decompiler/reference/jak1/engine/draw/draw-node-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/draw-node-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type draw-node (deftype draw-node (drawable) - ((child-count uint8 :offset 6) - (flags uint8 :offset 7) - (child drawable :offset 8) - (distance float :offset 12) + ((child-count uint8 :offset 6) + (flags uint8 :offset 7) + (child drawable :offset 8) + (distance float :offset 12) ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 ) ;; definition for method 3 of type draw-node -(defmethod inspect draw-node ((this draw-node)) +(defmethod inspect ((this draw-node)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) @@ -27,26 +24,20 @@ ;; definition of type drawable-inline-array-node (deftype drawable-inline-array-node (drawable-inline-array) - ((data draw-node 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 64) + ((data draw-node 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x44 - :flag-assert #x1200000044 ) ;; definition of type draw-node-dma (deftype draw-node-dma (structure) - ((banka draw-node 32 :inline :offset-assert 0) - (bankb draw-node 32 :inline :offset-assert 1024) + ((banka draw-node 32 :inline) + (bankb draw-node 32 :inline) ) - :method-count-assert 9 - :size-assert #x800 - :flag-assert #x900000800 ) ;; definition for method 3 of type draw-node-dma -(defmethod inspect draw-node-dma ((this draw-node-dma)) +(defmethod inspect ((this draw-node-dma)) (format #t "[~8x] ~A~%" this 'draw-node-dma) (format #t "~Tbanka[32] @ #x~X~%" (-> this banka)) (format #t "~Tbankb[32] @ #x~X~%" (-> this bankb)) diff --git a/test/decompiler/reference/jak1/engine/draw/draw-node_REF.gc b/test/decompiler/reference/jak1/engine/draw/draw-node_REF.gc index 620fea0cbb9..b4dbaafab77 100644 --- a/test/decompiler/reference/jak1/engine/draw/draw-node_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/draw-node_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 11 of type draw-node ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box draw-node ((this draw-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this draw-node) (arg0 int) (arg1 collide-list)) (dotimes (s3-0 arg0) (if (collide-cache-using-box-test (-> this bsphere)) (collide-with-box (-> this child) (the-as int (-> this child-count)) arg1) @@ -16,7 +16,7 @@ ;; definition for method 12 of type draw-node ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe draw-node ((this draw-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this draw-node) (arg0 int) (arg1 collide-list)) (dotimes (s3-0 arg0) (if (collide-cache-using-y-probe-test (-> this bsphere)) (collide-y-probe (-> this child) (the-as int (-> this child-count)) arg1) @@ -29,7 +29,7 @@ ;; definition for method 13 of type draw-node ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray draw-node ((this draw-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this draw-node) (arg0 int) (arg1 collide-list)) (dotimes (s3-0 arg0) (if (collide-cache-using-line-sphere-test (-> this bsphere)) (collide-ray (-> this child) (the-as int (-> this child-count)) arg1) @@ -42,7 +42,7 @@ ;; definition for method 17 of type draw-node ;; INFO: Return type mismatch int vs none. -(defmethod collect-ambients draw-node ((this draw-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients ((this draw-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (dotimes (s2-0 arg1) (if (spheres-overlap? arg0 (the-as sphere (-> this bsphere))) (collect-ambients (-> this child) arg0 (the-as int (-> this child-count)) arg2) @@ -54,7 +54,7 @@ ) ;; definition for method 3 of type drawable-inline-array-node -(defmethod inspect drawable-inline-array-node ((this drawable-inline-array-node)) +(defmethod inspect ((this drawable-inline-array-node)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) @@ -65,7 +65,7 @@ ) ;; definition for method 8 of type drawable-inline-array-node -(defmethod mem-usage drawable-inline-array-node ((this drawable-inline-array-node) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-node) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 62 (-> arg0 length))) (set! (-> arg0 data 61 name) "draw-node") (+! (-> arg0 data 61 count) (-> this length)) @@ -78,13 +78,13 @@ ;; definition for method 5 of type drawable-inline-array-node ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of drawable-inline-array-node ((this drawable-inline-array-node)) +(defmethod asize-of ((this drawable-inline-array-node)) (the-as int (+ (-> drawable-inline-array-node size) (* (+ (-> this length) -1) 32))) ) ;; definition for method 11 of type drawable-inline-array-node ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable-inline-array-node ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) (collide-with-box (the-as drawable (-> this data)) (-> this length) arg1) 0 (none) @@ -92,7 +92,7 @@ ;; definition for method 12 of type drawable-inline-array-node ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable-inline-array-node ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) (collide-y-probe (the-as drawable (-> this data)) (-> this length) arg1) 0 (none) @@ -100,7 +100,7 @@ ;; definition for method 13 of type drawable-inline-array-node ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable-inline-array-node ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) (collide-ray (the-as drawable (-> this data)) (-> this length) arg1) 0 (none) @@ -108,7 +108,7 @@ ;; definition for method 17 of type drawable-inline-array-node ;; INFO: Return type mismatch int vs none. -(defmethod collect-ambients drawable-inline-array-node ((this drawable-inline-array-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients ((this drawable-inline-array-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (collect-ambients (the-as drawable (-> this data)) arg0 (-> this length) arg2) 0 (none) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-actor-h_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-actor-h_REF.gc index d74bdb44ad1..104da2d2a17 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-actor-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-actor-h_REF.gc @@ -3,15 +3,12 @@ ;; definition of type drawable-actor (deftype drawable-actor (drawable) - ((actor entity-actor :offset 8) + ((actor entity-actor :offset 8) ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 ) ;; definition for method 3 of type drawable-actor -(defmethod inspect drawable-actor ((this drawable-actor)) +(defmethod inspect ((this drawable-actor)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) @@ -22,24 +19,18 @@ ;; definition of type drawable-tree-actor (deftype drawable-tree-actor (drawable-tree) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; definition of type drawable-inline-array-actor (deftype drawable-inline-array-actor (drawable-inline-array) - ((data drawable-actor 1 :inline :offset-assert 32) - (pad uint8 4 :offset-assert 64) + ((data drawable-actor 1 :inline) + (pad uint8 4) ) - :method-count-assert 18 - :size-assert #x44 - :flag-assert #x1200000044 ) ;; definition for method 10 of type drawable-tree-actor ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-tree-actor ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) 0 (none) ) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-ambient-h_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-ambient-h_REF.gc index 62672b2d8bd..acff0597b4a 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-ambient-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-ambient-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type drawable-ambient (deftype drawable-ambient (drawable) - ((ambient entity-ambient :offset 8) + ((ambient entity-ambient :offset 8) ) - :method-count-assert 19 - :size-assert #x20 - :flag-assert #x1300000020 (:methods - (execute-ambient (_type_ vector) none 18) + (execute-ambient (_type_ vector) none) ) ) ;; definition for method 3 of type drawable-ambient -(defmethod inspect drawable-ambient ((this drawable-ambient)) +(defmethod inspect ((this drawable-ambient)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) @@ -25,52 +22,42 @@ ;; definition of type drawable-tree-ambient (deftype drawable-tree-ambient (drawable-tree) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; definition of type drawable-inline-array-ambient (deftype drawable-inline-array-ambient (drawable-inline-array) - ((data drawable-ambient 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 64) + ((data drawable-ambient 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x44 - :flag-assert #x1200000044 ) ;; definition for method 10 of type drawable-tree-ambient ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-tree-ambient ((this drawable-tree-ambient) (arg0 drawable-tree-ambient) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-ambient) (arg0 drawable-tree-ambient) (arg1 display-frame)) 0 (none) ) ;; definition for method 16 of type drawable-tree-ambient -(defmethod unpack-vis drawable-tree-ambient ((this drawable-tree-ambient) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree-ambient) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) ;; definition of type level-hint (deftype level-hint (process) - ((text-id-to-display text-id :offset-assert 112) - (sound-to-play string :offset-assert 116) - (trans vector :offset-assert 120) - (sound-id sound-id :offset-assert 124) - (mode symbol :offset-assert 128) - (total-time time-frame :offset-assert 136) - (total-off-time time-frame :offset-assert 144) - (last-time time-frame :offset-assert 152) - (voicebox handle :offset-assert 160) + ((text-id-to-display text-id) + (sound-to-play string) + (trans vector) + (sound-id sound-id) + (mode symbol) + (total-time time-frame) + (total-off-time time-frame) + (last-time time-frame) + (voicebox handle) ) - :heap-base #x40 - :method-count-assert 16 - :size-assert #xa8 - :flag-assert #x10004000a8 (:methods - (print-text (_type_) none 14) - (appeared-for-long-enough? (_type_) symbol 15) + (print-text (_type_) none) + (appeared-for-long-enough? (_type_) symbol) ) (:states (level-hint-ambient-sound string) @@ -82,7 +69,7 @@ ) ;; definition for method 3 of type level-hint -(defmethod inspect level-hint ((this level-hint)) +(defmethod inspect ((this level-hint)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -100,16 +87,13 @@ ;; definition of type ambient-list (deftype ambient-list (structure) - ((num-items int32 :offset-assert 0) - (items drawable-ambient 2048 :offset-assert 4) + ((num-items int32) + (items drawable-ambient 2048) ) - :method-count-assert 9 - :size-assert #x2004 - :flag-assert #x900002004 ) ;; definition for method 3 of type ambient-list -(defmethod inspect ambient-list ((this ambient-list)) +(defmethod inspect ((this ambient-list)) (format #t "[~8x] ~A~%" this 'ambient-list) (format #t "~Tnum-items: ~D~%" (-> this num-items)) (format #t "~Titems[2048] @ #x~X~%" (-> this items)) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-group-h_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-group-h_REF.gc index faaa7100980..93c27518fc5 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-group-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-group-h_REF.gc @@ -3,14 +3,11 @@ ;; definition of type drawable-group (deftype drawable-group (drawable) - ((length int16 :offset 6) - (data drawable 1 :offset-assert 32) + ((length int16 :offset 6) + (data drawable 1) ) - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-group_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-group_REF.gc index 10ebe29d1d4..f04b2c521ad 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-group_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-group_REF.gc @@ -10,7 +10,7 @@ ) ;; definition for method 3 of type drawable-group -(defmethod inspect drawable-group ((this drawable-group)) +(defmethod inspect ((this drawable-group)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -22,7 +22,7 @@ ) ;; definition for method 2 of type drawable-group -(defmethod print drawable-group ((this drawable-group)) +(defmethod print ((this drawable-group)) (format #t "#<~A @ #x~X [~D]" (-> this type) this (-> this length)) (dotimes (s5-0 (-> this length)) (format #t " ~A" (-> this data s5-0)) @@ -32,18 +32,18 @@ ) ;; definition for method 4 of type drawable-group -(defmethod length drawable-group ((this drawable-group)) +(defmethod length ((this drawable-group)) (-> this length) ) ;; definition for method 5 of type drawable-group ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of drawable-group ((this drawable-group)) +(defmethod asize-of ((this drawable-group)) (the-as int (+ (-> drawable-group size) (* (+ (-> this length) -1) 4))) ) ;; definition for method 8 of type drawable-group -(defmethod mem-usage drawable-group ((this drawable-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) "drawable-group") (+! (-> arg0 data 0 count) 1) @@ -58,7 +58,7 @@ ) ;; definition for method 9 of type drawable-group -(defmethod login drawable-group ((this drawable-group)) +(defmethod login ((this drawable-group)) (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) ) @@ -67,7 +67,7 @@ ;; definition for method 10 of type drawable-group ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-group ((this drawable-group) (arg0 drawable-group) (arg1 display-frame)) +(defmethod draw ((this drawable-group) (arg0 drawable-group) (arg1 display-frame)) (when (vis-cull (-> this id)) (when (sphere-cull (-> this bsphere)) (dotimes (s3-0 (-> this length)) @@ -81,7 +81,7 @@ ;; definition for method 14 of type drawable-group ;; INFO: Return type mismatch int vs none. -(defmethod collect-stats drawable-group ((this drawable-group)) +(defmethod collect-stats ((this drawable-group)) (when (vis-cull (-> this id)) (when (sphere-cull (-> this bsphere)) (dotimes (s5-0 (-> this length)) @@ -95,7 +95,7 @@ ;; definition for method 15 of type drawable-group ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw drawable-group ((this drawable-group) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-group) (arg0 drawable) (arg1 display-frame)) (when (vis-cull (-> this id)) (when (sphere-cull (-> this bsphere)) (dotimes (s3-0 (-> this length)) @@ -108,7 +108,7 @@ ) ;; definition for method 16 of type drawable-group -(defmethod unpack-vis drawable-group ((this drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) (dotimes (s4-0 (-> this length)) (set! arg1 (unpack-vis (-> this data s4-0) arg0 arg1)) ) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-h_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-h_REF.gc index 7813314b519..b153e908810 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-h_REF.gc @@ -3,27 +3,24 @@ ;; definition of type drawable (deftype drawable (basic) - ((id int16 :offset-assert 4) - (bsphere vector :inline :offset-assert 16) + ((id int16) + (bsphere vector :inline) ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 (:methods - (login (_type_) _type_ 9) - (draw (_type_ _type_ display-frame) none 10) - (collide-with-box (_type_ int collide-list) none 11) - (collide-y-probe (_type_ int collide-list) none 12) - (collide-ray (_type_ int collide-list) none 13) - (collect-stats (_type_) none 14) - (debug-draw (_type_ drawable display-frame) none 15) - (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 16) - (collect-ambients (_type_ sphere int ambient-list) none 17) + (login (_type_) _type_) + (draw (_type_ _type_ display-frame) none) + (collide-with-box (_type_ int collide-list) none) + (collide-y-probe (_type_ int collide-list) none) + (collide-ray (_type_ int collide-list) none) + (collect-stats (_type_) none) + (debug-draw (_type_ drawable display-frame) none) + (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8)) + (collect-ambients (_type_ sphere int ambient-list) none) ) ) ;; definition for method 3 of type drawable -(defmethod inspect drawable ((this drawable)) +(defmethod inspect ((this drawable)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) @@ -32,15 +29,12 @@ ;; definition of type drawable-error (deftype drawable-error (drawable) - ((name string :offset-assert 32) + ((name string) ) - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; definition for method 3 of type drawable-error -(defmethod inspect drawable-error ((this drawable-error)) +(defmethod inspect ((this drawable-error)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-inline-array-h_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-inline-array-h_REF.gc index 3c7d5d1959e..5234d7e1a34 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-inline-array-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-inline-array-h_REF.gc @@ -3,15 +3,12 @@ ;; definition of type drawable-inline-array (deftype drawable-inline-array (drawable) - ((length int16 :offset 6) + ((length int16 :offset 6) ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 ) ;; definition for method 3 of type drawable-inline-array -(defmethod inspect drawable-inline-array ((this drawable-inline-array)) +(defmethod inspect ((this drawable-inline-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-inline-array_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-inline-array_REF.gc index 8f43719f0f9..6d316e2d025 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-inline-array_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-inline-array_REF.gc @@ -2,32 +2,32 @@ (in-package goal) ;; definition for method 4 of type drawable-inline-array -(defmethod length drawable-inline-array ((this drawable-inline-array)) +(defmethod length ((this drawable-inline-array)) (-> this length) ) ;; definition for method 9 of type drawable-inline-array -(defmethod login drawable-inline-array ((this drawable-inline-array)) +(defmethod login ((this drawable-inline-array)) this ) ;; definition for method 10 of type drawable-inline-array ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) +(defmethod draw ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) 0 (none) ) ;; definition for method 14 of type drawable-inline-array ;; INFO: Return type mismatch int vs none. -(defmethod collect-stats drawable-inline-array ((this drawable-inline-array)) +(defmethod collect-stats ((this drawable-inline-array)) 0 (none) ) ;; definition for method 15 of type drawable-inline-array ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame)) 0 (none) ) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-tree-h_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-tree-h_REF.gc index dcf77bbf123..bb769311146 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-tree-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-tree-h_REF.gc @@ -4,18 +4,12 @@ ;; definition of type drawable-tree (deftype drawable-tree (drawable-group) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; definition of type drawable-tree-array (deftype drawable-tree-array (drawable-group) - ((trees drawable-tree 1 :offset 32) + ((trees drawable-tree 1 :overlay-at (-> data 0)) ) - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-tree_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-tree_REF.gc index cea567be586..170c86193ae 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-tree_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-tree_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 10 of type drawable-tree-array ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) (let ((v1-1 (-> (the-as terrain-context #x70000000) bsp lev-index))) (case (-> *level* level v1-1 display?) (('special 'special-vis #f) @@ -21,7 +21,7 @@ ;; definition for method 14 of type drawable-tree-array ;; INFO: Return type mismatch int vs none. -(defmethod collect-stats drawable-tree-array ((this drawable-tree-array)) +(defmethod collect-stats ((this drawable-tree-array)) (dotimes (s5-0 (-> this length)) (collect-stats (-> this trees s5-0)) ) @@ -31,7 +31,7 @@ ;; definition for method 15 of type drawable-tree-array ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-array) (arg0 drawable) (arg1 display-frame)) (dotimes (s3-0 (-> this length)) (debug-draw (-> this trees s3-0) (-> (the-as drawable-tree-array arg0) trees s3-0) arg1) ) @@ -40,7 +40,7 @@ ) ;; definition for method 16 of type drawable-tree -(defmethod unpack-vis drawable-tree ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) (local-vars (t5-1 int)) (let* ((v1-0 (the-as drawable-inline-array-node (-> this data 0))) (a3-1 (/ (-> v1-0 data 0 id) 8)) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc index 0993b1dbdc6..dd9abd688fc 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc @@ -178,68 +178,68 @@ ) ;; definition for method 9 of type drawable -(defmethod login drawable ((this drawable)) +(defmethod login ((this drawable)) this ) ;; definition for method 10 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod draw ((this drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) ;; definition for method 11 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable ((this drawable) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) ;; definition for method 12 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable ((this drawable) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) ;; definition for method 13 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable ((this drawable) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) ;; definition for method 17 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod collect-ambients drawable ((this drawable) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients ((this drawable) (arg0 sphere) (arg1 int) (arg2 ambient-list)) 0 (none) ) ;; definition for method 14 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod collect-stats drawable ((this drawable)) +(defmethod collect-stats ((this drawable)) 0 (none) ) ;; definition for method 15 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) ;; definition for method 10 of type drawable-error ;; INFO: Return type mismatch drawable-error vs none. -(defmethod draw drawable-error ((this drawable-error) (arg0 drawable-error) (arg1 display-frame)) +(defmethod draw ((this drawable-error) (arg0 drawable-error) (arg1 display-frame)) (error-sphere arg0 (-> arg0 name)) (none) ) ;; definition for method 16 of type drawable -(defmethod unpack-vis drawable ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) diff --git a/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc b/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc index 18590e1de96..fd3f3540e14 100644 --- a/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc @@ -87,7 +87,7 @@ ;; definition for method 10 of type draw-control ;; INFO: Return type mismatch int vs none. -(defmethod lod-set! draw-control ((this draw-control) (arg0 int)) +(defmethod lod-set! ((this draw-control) (arg0 int)) (let ((v1-1 (max 0 (min arg0 (-> this lod-set max-lod))))) (set! (-> this desired-lod) v1-1) (when (!= (-> this cur-lod) v1-1) @@ -101,7 +101,7 @@ ;; definition for method 11 of type draw-control ;; INFO: Return type mismatch int vs none. -(defmethod lods-assign! draw-control ((this draw-control) (arg0 lod-set)) +(defmethod lods-assign! ((this draw-control) (arg0 lod-set)) (mem-copy! (the-as pointer (-> this lod-set)) (the-as pointer arg0) 33) (let ((a1-2 (min (-> this cur-lod) (-> this lod-set max-lod)))) (set! (-> this cur-lod) -1) @@ -113,7 +113,7 @@ ;; definition for method 9 of type lod-set ;; INFO: Used lq/sq -(defmethod setup-lods! lod-set ((this lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity)) +(defmethod setup-lods! ((this lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity)) (local-vars (sv-16 res-tag)) (let ((s4-0 arg0) (s5-0 arg1) @@ -282,7 +282,7 @@ ;; definition for method 17 of type process-drawable ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod do-joint-math! process-drawable ((this process-drawable)) +(defmethod do-joint-math! ((this process-drawable)) (cond ((logtest? (-> this draw status) (draw-status hidden no-anim)) ) @@ -362,7 +362,7 @@ ;; definition for method 18 of type process-drawable ;; INFO: Return type mismatch int vs none. -(defmethod cleanup-for-death process-drawable ((this process-drawable)) +(defmethod cleanup-for-death ((this process-drawable)) (if (type-type? (-> this root type) collide-shape) (clear-collide-with-as (the-as collide-shape (-> this root))) ) @@ -385,7 +385,7 @@ ) ;; definition for method 10 of type process-drawable -(defmethod deactivate process-drawable ((this process-drawable)) +(defmethod deactivate ((this process-drawable)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) @@ -427,7 +427,7 @@ ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Stack slot offset 20 signed mismatch ;; INFO: Return type mismatch draw-control vs none. -(defmethod initialize-skeleton process-drawable ((this process-drawable) (arg0 skeleton-group) (arg1 pair)) +(defmethod initialize-skeleton ((this process-drawable) (arg0 skeleton-group) (arg1 pair)) (local-vars (s3-0 draw-control) (sv-16 art-element) (sv-20 int)) (let ((s1-0 (cond ((= (-> arg0 texture-level) 2) @@ -579,7 +579,7 @@ ) ;; definition for method 15 of type process-drawable -(defmethod initialize-skeleton-by-name process-drawable ((this process-drawable) (arg0 string) (arg1 object)) +(defmethod initialize-skeleton-by-name ((this process-drawable) (arg0 string) (arg1 object)) (let ((s3-0 string->symbol)) (format (clear *temp-string*) "*~S-sg*" arg0) (let ((s3-1 (-> (s3-0 *temp-string*) value))) @@ -594,7 +594,7 @@ ;; definition for method 16 of type process-drawable ;; INFO: Return type mismatch trsqv vs collide-shape. -(defmethod apply-alignment process-drawable ((this process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment ((this process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) (let* ((body-T-world (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) (world-T-body (matrix-transpose! (new 'stack-no-clear 'matrix) body-T-world)) @@ -904,7 +904,7 @@ ;; INFO: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod evaluate-joint-control process-drawable ((this process-drawable)) +(defmethod evaluate-joint-control ((this process-drawable)) (local-vars (s7-0 none) (ra-0 int)) (let ((gp-0 (-> this skel))) (label cfg-1) @@ -997,7 +997,7 @@ ) ;; definition for method 9 of type joint-control -(defmethod current-cycle-distance joint-control ((this joint-control)) +(defmethod current-cycle-distance ((this joint-control)) (cond ((< (the-as int (-> this root-channel)) (the-as int (-> this channel (-> this active-channels)))) (let ((s5-0 (-> this root-channel (-> this root-channel 0 group-size))) diff --git a/test/decompiler/reference/jak1/engine/engine/connect_REF.gc b/test/decompiler/reference/jak1/engine/engine/connect_REF.gc index c0d38ed5a59..7d5569f030b 100644 --- a/test/decompiler/reference/jak1/engine/engine/connect_REF.gc +++ b/test/decompiler/reference/jak1/engine/engine/connect_REF.gc @@ -3,18 +3,15 @@ ;; definition of type connectable (deftype connectable (structure) - ((next0 connectable :offset-assert 0) - (prev0 connectable :offset-assert 4) - (next1 connectable :offset-assert 8) - (prev1 connectable :offset-assert 12) + ((next0 connectable) + (prev0 connectable) + (next1 connectable) + (prev1 connectable) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type connectable -(defmethod inspect connectable ((this connectable)) +(defmethod inspect ((this connectable)) (format #t "[~8x] ~A~%" this 'connectable) (format #t "~Tnext0: ~`connectable`P~%" (-> this next0)) (format #t "~Tprev0: ~`connectable`P~%" (-> this prev0)) @@ -25,26 +22,23 @@ ;; definition of type connection (deftype connection (connectable) - ((param0 basic :offset-assert 16) - (param1 int32 :offset-assert 20) - (param2 int32 :offset-assert 24) - (param3 int32 :offset-assert 28) - (quad uint128 2 :offset 0) + ((param0 basic) + (param1 int32) + (param2 int32) + (param3 int32) + (quad uint128 2 :overlay-at next0) ) - :method-count-assert 14 - :size-assert #x20 - :flag-assert #xe00000020 (:methods - (get-engine (connection) engine 9) - (get-process (connection) process 10) - (belongs-to-engine? (connection engine) symbol 11) - (belongs-to-process? (connection process) symbol 12) - (move-to-dead (connection) connection 13) + (get-engine (connection) engine) + (get-process (connection) process) + (belongs-to-engine? (connection engine) symbol) + (belongs-to-process? (connection process) symbol) + (move-to-dead (connection) connection) ) ) ;; definition for method 3 of type connection -(defmethod inspect connection ((this connection)) +(defmethod inspect ((this connection)) (format #t "[~8x] ~A~%" this 'connection) (format #t "~Tnext0: ~`connectable`P~%" (-> this next0)) (format #t "~Tprev0: ~`connectable`P~%" (-> this prev0)) @@ -60,46 +54,43 @@ ;; definition of type engine (deftype engine (basic) - ((name basic :offset-assert 4) - (length int16 :offset-assert 8) - (allocated-length int16 :offset-assert 10) - (engine-time time-frame :offset-assert 16) - (alive-list connectable :inline :offset-assert 32) - (alive-list-end connectable :inline :offset-assert 48) - (dead-list connectable :inline :offset-assert 64) - (dead-list-end connectable :inline :offset-assert 80) - (data connection 1 :inline :offset-assert 96) + ((name basic) + (length int16) + (allocated-length int16) + (engine-time time-frame) + (alive-list connectable :inline) + (alive-list-end connectable :inline) + (dead-list connectable :inline) + (dead-list-end connectable :inline) + (data connection 1 :inline) ) - :method-count-assert 24 - :size-assert #x80 - :flag-assert #x1800000080 (:methods - (new (symbol type basic int) _type_ 0) - (inspect-all-connections (engine) engine 9) - (apply-to-connections (engine (function connectable none)) int 10) - (apply-to-connections-reverse (engine (function connectable none)) int 11) - (execute-connections (engine object) int 12) - (execute-connections-and-move-to-dead (engine object) int 13) - (execute-connections-if-needed (engine object) int 14) - (add-connection (engine process object object object object) connection 15) - (remove-from-process (engine process) int 16) - (remove-matching (engine (function connection engine symbol)) int 17) - (remove-all (engine) int 18) - (remove-by-param1 (engine object) int 19) - (remove-by-param2 (engine int) int 20) - (get-first-connectable (engine) connectable 21) - (get-last-connectable (engine) connectable 22) - (unknown-1 (engine (pointer uint32)) uint 23) + (new (symbol type basic int) _type_) + (inspect-all-connections (engine) engine) + (apply-to-connections (engine (function connectable none)) int) + (apply-to-connections-reverse (engine (function connectable none)) int) + (execute-connections (engine object) int) + (execute-connections-and-move-to-dead (engine object) int) + (execute-connections-if-needed (engine object) int) + (add-connection (engine process object object object object) connection) + (remove-from-process (engine process) int) + (remove-matching (engine (function connection engine symbol)) int) + (remove-all (engine) int) + (remove-by-param1 (engine object) int) + (remove-by-param2 (engine int) int) + (get-first-connectable (engine) connectable) + (get-last-connectable (engine) connectable) + (unknown-1 (engine (pointer uint32)) uint) ) ) ;; definition for method 12 of type connection -(defmethod belongs-to-process? connection ((this connection) (arg0 process)) +(defmethod belongs-to-process? ((this connection) (arg0 process)) (= arg0 (get-process this)) ) ;; definition for method 2 of type connection -(defmethod print connection ((this connection)) +(defmethod print ((this connection)) (format #t "#" @@ -114,7 +105,7 @@ ;; definition for method 9 of type connection ;; INFO: Return type mismatch pointer vs engine. -(defmethod get-engine connection ((this connection)) +(defmethod get-engine ((this connection)) (while (-> (the-as connectable this) prev0) (nop!) (nop!) @@ -125,7 +116,7 @@ ;; definition for method 10 of type connection ;; INFO: Return type mismatch pointer vs process. -(defmethod get-process connection ((this connection)) +(defmethod get-process ((this connection)) (while (-> (the-as connectable this) prev1) (nop!) (nop!) @@ -135,24 +126,24 @@ ) ;; definition for method 11 of type connection -(defmethod belongs-to-engine? connection ((this connection) (arg0 engine)) +(defmethod belongs-to-engine? ((this connection) (arg0 engine)) (and (< (the-as int arg0) (the-as int this)) (< (the-as int this) (the-as int (-> arg0 data (-> arg0 allocated-length)))) ) ) ;; definition for method 21 of type engine -(defmethod get-first-connectable engine ((this engine)) +(defmethod get-first-connectable ((this engine)) (-> this alive-list next0) ) ;; definition for method 22 of type engine -(defmethod get-last-connectable engine ((this engine)) +(defmethod get-last-connectable ((this engine)) (-> this alive-list-end) ) ;; definition for method 23 of type engine -(defmethod unknown-1 engine ((this engine) (arg0 (pointer uint32))) +(defmethod unknown-1 ((this engine) (arg0 (pointer uint32))) (-> arg0 0) ) @@ -201,13 +192,13 @@ ) ;; definition for method 2 of type engine -(defmethod print engine ((this engine)) +(defmethod print ((this engine)) (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) this ) ;; definition for method 3 of type engine -(defmethod inspect engine ((this engine)) +(defmethod inspect ((this engine)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tengine-time: ~D~%" (-> this engine-time)) @@ -242,18 +233,18 @@ ) ;; definition for method 4 of type engine -(defmethod length engine ((this engine)) +(defmethod length ((this engine)) (-> this length) ) ;; definition for method 5 of type engine ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of engine ((this engine)) +(defmethod asize-of ((this engine)) (the-as int (+ (-> engine size) (* (+ (-> this allocated-length) -1) 32))) ) ;; definition for method 10 of type engine -(defmethod apply-to-connections engine ((this engine) (f (function connectable none))) +(defmethod apply-to-connections ((this engine) (f (function connectable none))) (let* ((current (-> this alive-list next0)) (next (-> current next0)) ) @@ -267,7 +258,7 @@ ) ;; definition for method 11 of type engine -(defmethod apply-to-connections-reverse engine ((this engine) (f (function connectable none))) +(defmethod apply-to-connections-reverse ((this engine) (f (function connectable none))) (let ((iter (-> this alive-list-end prev0))) (while (!= iter (-> this alive-list)) (f iter) @@ -278,7 +269,7 @@ ) ;; definition for method 12 of type engine -(defmethod execute-connections engine ((this engine) (arg0 object)) +(defmethod execute-connections ((this engine) (arg0 object)) (set! (-> this engine-time) (-> *display* real-frame-counter)) (let ((ct (the-as connection (-> this alive-list-end prev0)))) (while (!= ct (-> this alive-list)) @@ -295,7 +286,7 @@ ) ;; definition for method 13 of type engine -(defmethod execute-connections-and-move-to-dead engine ((this engine) (arg0 object)) +(defmethod execute-connections-and-move-to-dead ((this engine) (arg0 object)) (set! (-> this engine-time) (-> *display* real-frame-counter)) (let ((ct (the-as connection (-> this alive-list-end prev0)))) (while (!= ct (-> this alive-list)) @@ -318,7 +309,7 @@ ) ;; definition for method 14 of type engine -(defmethod execute-connections-if-needed engine ((this engine) (arg0 object)) +(defmethod execute-connections-if-needed ((this engine) (arg0 object)) (if (!= (-> *display* real-frame-counter) (-> this engine-time)) (execute-connections this arg0) ) @@ -339,13 +330,13 @@ ) ;; definition for method 9 of type engine -(defmethod inspect-all-connections engine ((this engine)) +(defmethod inspect-all-connections ((this engine)) (apply-to-connections this (the-as (function connectable none) (method-of-type connection inspect))) this ) ;; definition for method 15 of type engine -(defmethod add-connection engine ((this engine) (proc process) (func object) (p1 object) (p2 object) (p3 object)) +(defmethod add-connection ((this engine) (proc process) (func object) (p1 object) (p2 object) (p3 object)) (let ((con (the-as connection (-> this dead-list next0)))) (when (not (or (not proc) (= con (-> this dead-list-end)))) (set! (-> con param0) (the-as basic func)) @@ -371,7 +362,7 @@ ) ;; definition for method 13 of type connection -(defmethod move-to-dead connection ((this connection)) +(defmethod move-to-dead ((this connection)) (let ((v1-1 (get-engine this))) (set! (-> this prev0 next0) (-> this next0)) (set! (-> this next0 prev0) (-> this prev0)) @@ -402,7 +393,7 @@ ) ;; definition for method 16 of type engine -(defmethod remove-from-process engine ((this engine) (arg0 process)) +(defmethod remove-from-process ((this engine) (arg0 process)) (when arg0 (let ((s5-0 (-> arg0 connection-list next1))) (while s5-0 @@ -417,7 +408,7 @@ ) ;; definition for method 17 of type engine -(defmethod remove-matching engine ((this engine) (arg0 (function connection engine symbol))) +(defmethod remove-matching ((this engine) (arg0 (function connection engine symbol))) (let* ((s4-0 (-> this alive-list next0)) (s3-0 (-> s4-0 next0)) ) @@ -433,7 +424,7 @@ ) ;; definition for method 18 of type engine -(defmethod remove-all engine ((this engine)) +(defmethod remove-all ((this engine)) (let* ((a0-1 (-> this alive-list next0)) (s5-0 (-> a0-1 next0)) ) @@ -447,7 +438,7 @@ ) ;; definition for method 19 of type engine -(defmethod remove-by-param1 engine ((this engine) (p1-value object)) +(defmethod remove-by-param1 ((this engine) (p1-value object)) (let* ((current (-> this alive-list next0)) (next (-> current next0)) ) @@ -463,7 +454,7 @@ ) ;; definition for method 20 of type engine -(defmethod remove-by-param2 engine ((this engine) (p2-value int)) +(defmethod remove-by-param2 ((this engine) (p2-value int)) (let* ((current (-> this alive-list next0)) (next (-> current next0)) ) diff --git a/test/decompiler/reference/jak1/engine/entity/actor-link-h_REF.gc b/test/decompiler/reference/jak1/engine/entity/actor-link-h_REF.gc index 75575433e81..812d4621fbe 100644 --- a/test/decompiler/reference/jak1/engine/entity/actor-link-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/actor-link-h_REF.gc @@ -34,37 +34,34 @@ ;; definition of type actor-link-info (deftype actor-link-info (basic) - ((process process :offset-assert 4) - (next entity-actor :offset-assert 8) - (prev entity-actor :offset-assert 12) + ((process process) + (next entity-actor) + (prev entity-actor) ) - :method-count-assert 26 - :size-assert #x10 - :flag-assert #x1a00000010 (:methods - (new (symbol type process) _type_ 0) - (get-matching-actor-type-mask (_type_ type) int 9) - (actor-count-before (_type_) int 10) - (link-to-next-and-prev-actor (_type_) entity-actor 11) - (get-next (_type_) entity-actor 12) - (get-prev (_type_) entity-actor 13) - (get-next-process (_type_) process 14) - (get-prev-process (_type_) process 15) - (apply-function-forward (_type_ (function entity-actor object object) object) int 16) - (apply-function-reverse (_type_ (function entity-actor object object) object) int 17) - (apply-all (_type_ (function entity-actor object object) object) int 18) - (send-to-all (_type_ symbol) none 19) - (send-to-all-after (_type_ symbol) object 20) - (send-to-all-before (_type_ symbol) object 21) - (send-to-next-and-prev (_type_ symbol) none 22) - (send-to-next (_type_ symbol) none 23) - (send-to-prev (_type_ symbol) none 24) - (actor-count (_type_) int 25) + (new (symbol type process) _type_) + (get-matching-actor-type-mask (_type_ type) int) + (actor-count-before (_type_) int) + (link-to-next-and-prev-actor (_type_) entity-actor) + (get-next (_type_) entity-actor) + (get-prev (_type_) entity-actor) + (get-next-process (_type_) process) + (get-prev-process (_type_) process) + (apply-function-forward (_type_ (function entity-actor object object) object) int) + (apply-function-reverse (_type_ (function entity-actor object object) object) int) + (apply-all (_type_ (function entity-actor object object) object) int) + (send-to-all (_type_ symbol) none) + (send-to-all-after (_type_ symbol) object) + (send-to-all-before (_type_ symbol) object) + (send-to-next-and-prev (_type_ symbol) none) + (send-to-next (_type_ symbol) none) + (send-to-prev (_type_ symbol) none) + (actor-count (_type_) int) ) ) ;; definition for method 3 of type actor-link-info -(defmethod inspect actor-link-info ((this actor-link-info)) +(defmethod inspect ((this actor-link-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tprocess: ~A~%" (-> this process)) (format #t "~Tnext: ~A~%" (-> this next)) @@ -73,12 +70,12 @@ ) ;; definition for method 27 of type entity-actor -(defmethod next-actor entity-actor ((this entity-actor)) +(defmethod next-actor ((this entity-actor)) (entity-actor-lookup this 'next-actor 0) ) ;; definition for method 28 of type entity-actor -(defmethod prev-actor entity-actor ((this entity-actor)) +(defmethod prev-actor ((this entity-actor)) (entity-actor-lookup this 'prev-actor 0) ) @@ -97,29 +94,29 @@ ) ;; definition for method 12 of type actor-link-info -(defmethod get-next actor-link-info ((this actor-link-info)) +(defmethod get-next ((this actor-link-info)) (-> this next) ) ;; definition for method 13 of type actor-link-info -(defmethod get-prev actor-link-info ((this actor-link-info)) +(defmethod get-prev ((this actor-link-info)) (-> this prev) ) ;; definition for method 14 of type actor-link-info ;; INFO: Return type mismatch basic vs process. -(defmethod get-next-process actor-link-info ((this actor-link-info)) +(defmethod get-next-process ((this actor-link-info)) (the-as process (and (-> this next) (-> (the-as entity-links (-> this next extra)) process))) ) ;; definition for method 15 of type actor-link-info ;; INFO: Return type mismatch basic vs process. -(defmethod get-prev-process actor-link-info ((this actor-link-info)) +(defmethod get-prev-process ((this actor-link-info)) (the-as process (and (-> this prev) (-> (the-as entity-links (-> this prev extra)) process))) ) ;; definition for method 11 of type actor-link-info -(defmethod link-to-next-and-prev-actor actor-link-info ((this actor-link-info)) +(defmethod link-to-next-and-prev-actor ((this actor-link-info)) (let ((a0-1 (-> this process entity))) (set! (-> this next) (entity-actor-lookup a0-1 'next-actor 0)) ) @@ -130,7 +127,7 @@ ) ;; definition for method 16 of type actor-link-info -(defmethod apply-function-forward actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) +(defmethod apply-function-forward ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) (let ((s3-0 (-> this next))) (while s3-0 (if (arg0 s3-0 arg1) @@ -143,7 +140,7 @@ ) ;; definition for method 17 of type actor-link-info -(defmethod apply-function-reverse actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) +(defmethod apply-function-reverse ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) (let ((s3-0 (-> this prev))) (while s3-0 (if (arg0 s3-0 arg1) @@ -156,7 +153,7 @@ ) ;; definition for method 18 of type actor-link-info -(defmethod apply-all actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) +(defmethod apply-all ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) (let ((s4-0 (-> this process entity))) (while (let ((a0-2 s4-0)) (entity-actor-lookup a0-2 'prev-actor 0) @@ -176,7 +173,7 @@ ) ;; definition for method 20 of type actor-link-info -(defmethod send-to-all-after actor-link-info ((this actor-link-info) (message symbol)) +(defmethod send-to-all-after ((this actor-link-info) (message symbol)) (with-pp (let ((iter (-> this next)) (result (the-as object #f)) @@ -200,7 +197,7 @@ ) ;; definition for method 21 of type actor-link-info -(defmethod send-to-all-before actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-all-before ((this actor-link-info) (arg0 symbol)) (with-pp (let ((s4-0 (-> this prev)) (s5-0 (the-as object #f)) @@ -225,7 +222,7 @@ ;; definition for method 23 of type actor-link-info ;; INFO: Return type mismatch int vs none. -(defmethod send-to-next actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-next ((this actor-link-info) (arg0 symbol)) (let ((a0-1 (-> this next))) (when a0-1 (let ((a0-2 (-> (the-as entity-links (-> a0-1 extra)) process))) @@ -241,7 +238,7 @@ ;; definition for method 24 of type actor-link-info ;; INFO: Return type mismatch int vs none. -(defmethod send-to-prev actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-prev ((this actor-link-info) (arg0 symbol)) (let ((a0-1 (-> this prev))) (when a0-1 (let ((a0-2 (-> (the-as entity-links (-> a0-1 extra)) process))) @@ -256,7 +253,7 @@ ) ;; definition for method 22 of type actor-link-info -(defmethod send-to-next-and-prev actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-next-and-prev ((this actor-link-info) (arg0 symbol)) (send-to-next this arg0) (send-to-prev this arg0) (none) @@ -264,14 +261,14 @@ ;; definition for method 19 of type actor-link-info ;; INFO: Return type mismatch object vs none. -(defmethod send-to-all actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-all ((this actor-link-info) (arg0 symbol)) (send-to-all-after this arg0) (send-to-all-before this arg0) (none) ) ;; definition for method 25 of type actor-link-info -(defmethod actor-count actor-link-info ((this actor-link-info)) +(defmethod actor-count ((this actor-link-info)) (let ((actor (-> this process entity)) (count 0) ) @@ -291,7 +288,7 @@ ) ;; definition for method 9 of type actor-link-info -(defmethod get-matching-actor-type-mask actor-link-info ((this actor-link-info) (matching-type type)) +(defmethod get-matching-actor-type-mask ((this actor-link-info) (matching-type type)) (let ((actor (-> this process entity)) (mask 0) ) @@ -316,7 +313,7 @@ ) ;; definition for method 10 of type actor-link-info -(defmethod actor-count-before actor-link-info ((this actor-link-info)) +(defmethod actor-count-before ((this actor-link-info)) (let* ((this-actor (-> this process entity)) (actor this-actor) (count 0) diff --git a/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc b/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc index cda8e60e359..c3042932930 100644 --- a/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 8 of type drawable-ambient ;; INFO: Return type mismatch int vs drawable-ambient. -(defmethod mem-usage drawable-ambient ((this drawable-ambient) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-ambient) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 50 (-> arg0 length))) (set! (-> arg0 data 49 name) "ambient") (+! (-> arg0 data 49 count) 1) @@ -17,7 +17,7 @@ ;; definition for method 8 of type drawable-inline-array-ambient ;; INFO: Return type mismatch int vs drawable-inline-array-ambient. -(defmethod mem-usage drawable-inline-array-ambient ((this drawable-inline-array-ambient) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-ambient) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -376,7 +376,7 @@ ;; definition for method 14 of type level-hint ;; INFO: Return type mismatch int vs none. -(defmethod print-text level-hint ((this level-hint)) +(defmethod print-text ((this level-hint)) (when (!= *common-text* #f) (let ((s5-0 (new 'stack 'font-context *font-default-matrix* 56 160 0.0 (font-color default) (font-flags shadow kerning)) @@ -397,7 +397,7 @@ ) ;; definition for method 15 of type level-hint -(defmethod appeared-for-long-enough? level-hint ((this level-hint)) +(defmethod appeared-for-long-enough? ((this level-hint)) (and (!= (-> this next-state name) 'level-hint-sidekick) (< (seconds 5) (-> this total-time))) ) @@ -971,7 +971,7 @@ ;; definition for method 17 of type drawable-ambient ;; INFO: Return type mismatch int vs none. -(defmethod collect-ambients drawable-ambient ((this drawable-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients ((this drawable-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (dotimes (s2-0 arg1) (when (spheres-overlap? arg0 (the-as sphere (-> this bsphere))) (set! (-> arg2 items (-> arg2 num-items)) this) @@ -985,7 +985,7 @@ ;; definition for method 17 of type drawable-inline-array-ambient ;; INFO: Return type mismatch int vs none. -(defmethod collect-ambients drawable-inline-array-ambient ((this drawable-inline-array-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients ((this drawable-inline-array-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (collect-ambients (the-as drawable-ambient (-> this data)) arg0 (-> this length) arg2) 0 (none) @@ -993,7 +993,7 @@ ;; definition for method 17 of type drawable-tree-ambient ;; INFO: Return type mismatch int vs none. -(defmethod collect-ambients drawable-tree-ambient ((this drawable-tree-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients ((this drawable-tree-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (collect-ambients (-> this data 0) arg0 (-> this length) arg2) 0 (none) @@ -1002,7 +1002,7 @@ ;; definition for method 28 of type entity-ambient ;; INFO: Used lq/sq ;; INFO: Return type mismatch entity-ambient vs none. -(defmethod birth-ambient! entity-ambient ((this entity-ambient)) +(defmethod birth-ambient! ((this entity-ambient)) (set! (-> this ambient-data quad) (the-as uint128 0)) (set! (-> this ambient-data function) ambient-type-error) (case (res-lump-struct this 'type structure) @@ -1101,7 +1101,7 @@ ;; definition for method 18 of type drawable-ambient ;; INFO: Return type mismatch int vs none. -(defmethod execute-ambient drawable-ambient ((this drawable-ambient) (arg0 vector)) +(defmethod execute-ambient ((this drawable-ambient) (arg0 vector)) ((-> this ambient ambient-data function) this arg0) 0 (none) @@ -1113,7 +1113,7 @@ ;; definition for method 27 of type entity-ambient ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod draw-debug entity-ambient ((this entity-ambient)) +(defmethod draw-debug ((this entity-ambient)) (local-vars (sv-16 uint128)) (let ((gp-0 (-> this trans)) (s5-0 (res-lump-struct this 'type symbol)) diff --git a/test/decompiler/reference/jak1/engine/entity/entity-h_REF.gc b/test/decompiler/reference/jak1/engine/entity/entity-h_REF.gc index d60490f0734..8a3cc3b9230 100644 --- a/test/decompiler/reference/jak1/engine/entity/entity-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/entity-h_REF.gc @@ -12,33 +12,30 @@ ;; definition of type entity-perm (deftype entity-perm (structure) - ((user-object object 2 :offset-assert 0) - (user-uint64 uint64 :offset 0) - (user-float float 2 :offset 0) - (user-int32 int32 2 :offset 0) - (user-uint32 uint32 2 :offset 0) - (user-int16 int16 4 :offset 0) - (user-uint16 uint16 4 :offset 0) - (user-int8 int8 8 :offset 0) - (user-uint8 uint8 8 :offset 0) - (status entity-perm-status :offset-assert 8) - (dummy uint8 1 :offset-assert 10) - (task game-task :offset-assert 11) - (aid actor-id :offset-assert 12) - (quad uint128 :offset 0) + ((user-object object 2) + (user-uint64 uint64 :overlay-at (-> user-object 0)) + (user-float float 2 :overlay-at (-> user-object 0)) + (user-int32 int32 2 :overlay-at (-> user-object 0)) + (user-uint32 uint32 2 :overlay-at (-> user-object 0)) + (user-int16 int16 4 :overlay-at (-> user-object 0)) + (user-uint16 uint16 4 :overlay-at (-> user-object 0)) + (user-int8 int8 8 :overlay-at (-> user-object 0)) + (user-uint8 uint8 8 :overlay-at (-> user-object 0)) + (status entity-perm-status) + (dummy uint8 1) + (task game-task) + (aid actor-id) + (quad uint128 :overlay-at (-> user-object 0)) ) :pack-me - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (update-perm! (_type_ symbol entity-perm-status) _type_ 9) + (update-perm! (_type_ symbol entity-perm-status) _type_) ) ) ;; definition for method 3 of type entity-perm ;; INFO: Used lq/sq -(defmethod inspect entity-perm ((this entity-perm)) +(defmethod inspect ((this entity-perm)) (format #t "[~8x] ~A~%" this 'entity-perm) (format #t "~Tuser-object[2] @ #x~X~%" (-> this user-object)) (format #t "~Tuser-uint64: ~D~%" (-> this user-uint64)) @@ -59,28 +56,25 @@ ;; definition of type entity-links (deftype entity-links (structure) - ((prev-link entity-links :offset-assert 0) - (next-link entity-links :offset-assert 4) - (entity entity :offset-assert 8) - (process process :offset-assert 12) - (level level :offset-assert 16) - (vis-id int32 :offset-assert 20) - (trans vector :inline :offset-assert 32) - (perm entity-perm :inline :offset-assert 48) - (status uint16 :offset 56) - (aid actor-id :offset 60) - (task game-task :offset 59) + ((prev-link entity-links) + (next-link entity-links) + (entity entity) + (process process) + (level level) + (vis-id int32) + (trans vector :inline) + (perm entity-perm :inline) + (status uint16 :overlay-at (-> perm status)) + (aid actor-id :overlay-at (-> perm aid)) + (task game-task :overlay-at (-> perm task)) ) - :method-count-assert 10 - :size-assert #x40 - :flag-assert #xa00000040 (:methods - (birth? (_type_ vector) symbol 9) + (birth? (_type_ vector) symbol) ) ) ;; definition for method 3 of type entity-links -(defmethod inspect entity-links ((this entity-links)) +(defmethod inspect ((this entity-links)) (format #t "[~8x] ~A~%" this 'entity-links) (format #t "~Tprev-link: #~%" (-> this prev-link)) (format #t "~Tnext-link: #~%" (-> this next-link)) @@ -98,15 +92,12 @@ ;; definition of type entity-perm-array (deftype entity-perm-array (inline-array-class) - ((data entity-perm :inline :dynamic :offset-assert 16) + ((data entity-perm :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type entity-perm-array -(defmethod inspect entity-perm-array ((this entity-perm-array)) +(defmethod inspect ((this entity-perm-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -119,15 +110,12 @@ ;; definition of type entity-links-array (deftype entity-links-array (inline-array-class) - ((data entity-links :inline :dynamic :offset-assert 16) + ((data entity-links :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type entity-links-array -(defmethod inspect entity-links-array ((this entity-links-array)) +(defmethod inspect ((this entity-links-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -140,52 +128,43 @@ ;; definition of type entity (deftype entity (res-lump) - ((trans vector :inline :offset-assert 32) - (aid uint32 :offset-assert 48) + ((trans vector :inline) + (aid uint32) ) - :method-count-assert 27 - :size-assert #x34 - :flag-assert #x1b00000034 (:methods - (birth! (_type_) _type_ 22) - (kill! (_type_) _type_ 23) - (add-to-level! (_type_ level-group level actor-id) none 24) - (remove-from-level! (_type_ level-group) _type_ 25) - (get-level (_type_) level 26) + (birth! (_type_) _type_) + (kill! (_type_) _type_) + (add-to-level! (_type_ level-group level actor-id) none) + (remove-from-level! (_type_ level-group) _type_) + (get-level (_type_) level) ) ) ;; definition of type entity-camera (deftype entity-camera (entity) - ((connect connectable :inline :offset-assert 64) + ((connect connectable :inline) ) - :method-count-assert 27 - :size-assert #x50 - :flag-assert #x1b00000050 ) ;; definition of type entity-ambient-data (deftype entity-ambient-data (structure) - ((user-object object 3 :offset-assert 0) - (function (function drawable-ambient vector none) :offset-assert 12) - (quad uint128 :offset 0) - (user-uint64 uint64 1 :offset 0) - (user-float float 3 :offset 0) - (user-int32 int32 3 :offset 0) - (user-uint32 uint32 3 :offset 0) - (user-int16 int16 6 :offset 0) - (user-uint16 uint16 6 :offset 0) - (user-int8 int8 12 :offset 0) - (user-uint8 uint8 12 :offset 0) + ((user-object object 3) + (function (function drawable-ambient vector none)) + (quad uint128 :overlay-at (-> user-object 0)) + (user-uint64 uint64 1 :overlay-at (-> user-object 0)) + (user-float float 3 :overlay-at (-> user-object 0)) + (user-int32 int32 3 :overlay-at (-> user-object 0)) + (user-uint32 uint32 3 :overlay-at (-> user-object 0)) + (user-int16 int16 6 :overlay-at (-> user-object 0)) + (user-uint16 uint16 6 :overlay-at (-> user-object 0)) + (user-int8 int8 12 :overlay-at (-> user-object 0)) + (user-uint8 uint8 12 :overlay-at (-> user-object 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type entity-ambient-data ;; INFO: Used lq/sq -(defmethod inspect entity-ambient-data ((this entity-ambient-data)) +(defmethod inspect ((this entity-ambient-data)) (format #t "[~8x] ~A~%" this 'entity-ambient-data) (format #t "~Tuser-object[3] @ #x~X~%" (&-> this quad)) (format #t "~Tfunction: ~A~%" (-> this function)) @@ -203,15 +182,12 @@ ;; definition of type entity-ambient-data-array (deftype entity-ambient-data-array (inline-array-class) - ((data entity-ambient-data :inline :dynamic :offset-assert 16) + ((data entity-ambient-data :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type entity-ambient-data-array -(defmethod inspect entity-ambient-data-array ((this entity-ambient-data-array)) +(defmethod inspect ((this entity-ambient-data-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -224,52 +200,43 @@ ;; definition of type entity-ambient (deftype entity-ambient (entity) - ((ambient-data entity-ambient-data :offset 24) + ((ambient-data entity-ambient-data :overlay-at extra) ) - :method-count-assert 29 - :size-assert #x34 - :flag-assert #x1d00000034 (:methods - (draw-debug (_type_) none 27) - (birth-ambient! (_type_) none 28) + (draw-debug (_type_) none) + (birth-ambient! (_type_) none) ) ) ;; definition of type entity-actor (deftype entity-actor (entity) - ((nav-mesh nav-mesh :offset-assert 52) - (etype type :offset-assert 56) - (task game-task :offset-assert 60) - (vis-id uint16 :offset-assert 62) - (vis-id-signed int16 :offset 62) - (quat quaternion :inline :offset-assert 64) + ((nav-mesh nav-mesh) + (etype type) + (task game-task) + (vis-id uint16) + (vis-id-signed int16 :overlay-at vis-id) + (quat quaternion :inline) ) - :method-count-assert 31 - :size-assert #x50 - :flag-assert #x1f00000050 (:methods - (next-actor (_type_) entity-actor 27) - (prev-actor (_type_) entity-actor 28) - (debug-print (_type_ symbol type) none 29) - (set-or-clear-status! (_type_ entity-perm-status symbol) none 30) + (next-actor (_type_) entity-actor) + (prev-actor (_type_) entity-actor) + (debug-print (_type_ symbol type) none) + (set-or-clear-status! (_type_ entity-perm-status symbol) none) ) ) ;; definition of type entity-info (deftype entity-info (basic) - ((ptype type :offset-assert 4) - (package basic :offset-assert 8) - (art-group pair :offset-assert 12) - (pool basic :offset-assert 16) - (heap-size int32 :offset-assert 20) + ((ptype type) + (package basic) + (art-group pair) + (pool basic) + (heap-size int32) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type entity-info -(defmethod inspect entity-info ((this entity-info)) +(defmethod inspect ((this entity-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tptype: ~A~%" (-> this ptype)) (format #t "~Tpackage: ~A~%" (-> this package)) @@ -286,17 +253,14 @@ ;; definition of type actor-bank (deftype actor-bank (basic) - ((pause-dist float :offset-assert 4) - (birth-dist float :offset-assert 8) - (birth-max int32 :offset-assert 12) + ((pause-dist float) + (birth-dist float) + (birth-max int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type actor-bank -(defmethod inspect actor-bank ((this actor-bank)) +(defmethod inspect ((this actor-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tpause-dist: ~f~%" (-> this pause-dist)) (format #t "~Tbirth-dist: ~f~%" (-> this birth-dist)) diff --git a/test/decompiler/reference/jak1/engine/entity/entity_REF.gc b/test/decompiler/reference/jak1/engine/entity/entity_REF.gc index 714d8f61224..ecbfc057332 100644 --- a/test/decompiler/reference/jak1/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/entity_REF.gc @@ -12,7 +12,7 @@ ;; definition for method 8 of type drawable-actor ;; INFO: Return type mismatch int vs drawable-actor. -(defmethod mem-usage drawable-actor ((this drawable-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 44 (-> arg0 length))) (set! (-> arg0 data 43 name) "entity") (+! (-> arg0 data 43 count) 1) @@ -26,7 +26,7 @@ ;; definition for method 8 of type drawable-inline-array-actor ;; INFO: Return type mismatch int vs drawable-inline-array-actor. -(defmethod mem-usage drawable-inline-array-actor ((this drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -41,13 +41,13 @@ ) ;; definition for method 2 of type entity-links -(defmethod print entity-links ((this entity-links)) +(defmethod print ((this entity-links)) (format #t "#" (-> this process) this) this ) ;; definition for method 2 of type entity-perm -(defmethod print entity-perm ((this entity-perm)) +(defmethod print ((this entity-perm)) (format #t "#" @@ -61,25 +61,25 @@ ) ;; definition for method 22 of type entity -(defmethod birth! entity ((this entity)) +(defmethod birth! ((this entity)) (format #t "birth ~A~%" this) this ) ;; definition for method 23 of type entity -(defmethod kill! entity ((this entity)) +(defmethod kill! ((this entity)) (format #t "kill ~A~%" this) this ) ;; definition for method 2 of type entity -(defmethod print entity ((this entity)) +(defmethod print ((this entity)) (format #t "#<~A :name ~S @ #x~X>" (-> this type) (res-lump-struct this 'name structure) this) this ) ;; definition for method 26 of type entity -(defmethod get-level entity ((this entity)) +(defmethod get-level ((this entity)) (dotimes (v1-0 (-> *level* length)) (let ((a1-3 (-> *level* level v1-0))) (when (= (-> a1-3 status) 'active) @@ -373,7 +373,8 @@ ) ;; definition for method 2 of type process -(defmethod print process ((this process)) +;; INFO: this function exists in multiple non-identical object files +(defmethod print ((this process)) (format #t "#<~A ~S ~A :state ~S :flags " @@ -398,7 +399,7 @@ ) ;; definition for method 3 of type entity -(defmethod inspect entity ((this entity)) +(defmethod inspect ((this entity)) ((the-as (function entity entity) (find-parent-method entity 3)) this) (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) (format #t "~Taid: ~A~%" (-> this aid)) @@ -406,7 +407,7 @@ ) ;; definition for method 3 of type entity-actor -(defmethod inspect entity-actor ((this entity-actor)) +(defmethod inspect ((this entity-actor)) ((the-as (function entity-actor entity-actor) (find-parent-method entity-actor 3)) this) (format #t "~Tnav-mesh: ~A~%" (-> this nav-mesh)) (format #t "~Tetype: ~A~%" (-> this etype)) @@ -418,7 +419,7 @@ ;; definition for method 29 of type entity-actor ;; INFO: Return type mismatch entity-actor vs none. -(defmethod debug-print entity-actor ((this entity-actor) (mode symbol) (expected-type type)) +(defmethod debug-print ((this entity-actor) (mode symbol) (expected-type type)) (let ((s4-0 (-> this etype))) (when (or (not expected-type) (and s4-0 (valid? s4-0 type #f #f 0) (type-type? s4-0 expected-type))) (format #t "~5D #x~8X ~-21S" (-> this extra vis-id) this (res-lump-struct this 'name structure)) @@ -492,7 +493,7 @@ ;; definition for method 13 of type level-group ;; INFO: Return type mismatch int vs none. -(defmethod debug-print-entities level-group ((this level-group) (mode symbol) (expected-type type)) +(defmethod debug-print-entities ((this level-group) (mode symbol) (expected-type type)) (format #t " id address name aid tsk lev status x y z address name state heap flags~%" @@ -528,7 +529,7 @@ ;; definition for method 24 of type entity ;; INFO: Used lq/sq ;; INFO: Return type mismatch entity vs none. -(defmethod add-to-level! entity ((this entity) (lev-group level-group) (lev level) (aid actor-id)) +(defmethod add-to-level! ((this entity) (lev-group level-group) (lev level) (aid actor-id)) (let ((level-link (-> lev entity data (-> lev entity length)))) (+! (-> lev entity length) 1) (set! (-> level-link process) #f) @@ -570,7 +571,7 @@ ) ;; definition for method 25 of type entity -(defmethod remove-from-level! entity ((this entity) (arg0 level-group)) +(defmethod remove-from-level! ((this entity) (arg0 level-group)) (let ((v1-0 (-> this extra))) (cond ((= (-> v1-0 next-link) v1-0) @@ -610,7 +611,7 @@ ;; definition for method 22 of type level-group ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod update-vis-volumes level-group ((this level-group)) +(defmethod update-vis-volumes ((this level-group)) (local-vars (v1-10 symbol) (sv-16 process) @@ -667,7 +668,7 @@ ;; definition for method 23 of type level-group ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod update-vis-volumes-from-nav-mesh level-group ((this level-group)) +(defmethod update-vis-volumes-from-nav-mesh ((this level-group)) (local-vars (sv-16 entity) (sv-32 entity)) (dotimes (s5-0 (-> this length)) (let ((v1-3 (-> this level s5-0))) @@ -724,7 +725,7 @@ ;; definition for method 24 of type level-group ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod print-volume-sizes level-group ((this level-group)) +(defmethod print-volume-sizes ((this level-group)) (local-vars (sv-16 type) (sv-32 (function _varargs_ object)) (sv-48 symbol) (sv-64 string) (sv-80 entity)) (dotimes (s5-0 (-> this length)) (let ((v1-3 (-> this level s5-0))) @@ -812,7 +813,7 @@ ;; definition for method 14 of type level-group ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw-actors level-group ((this level-group) (arg0 symbol)) +(defmethod debug-draw-actors ((this level-group) (arg0 symbol)) (local-vars (sv-48 (function symbol bucket-id string vector font-color vector2h symbol)) (sv-64 symbol) @@ -1209,13 +1210,13 @@ ) ;; definition for method 22 of type entity-camera -(defmethod birth! entity-camera ((this entity-camera)) +(defmethod birth! ((this entity-camera)) (add-connection *camera-engine* *camera* nothing this #f #f) this ) ;; definition for method 23 of type entity-camera -(defmethod kill! entity-camera ((this entity-camera)) +(defmethod kill! ((this entity-camera)) (remove-by-param1 *camera-engine* this) this ) @@ -1236,7 +1237,7 @@ ) ;; definition for method 22 of type entity-actor -(defmethod birth! entity-actor ((this entity-actor)) +(defmethod birth! ((this entity-actor)) (let* ((entity-type (-> this etype)) (info (entity-info-lookup entity-type)) (entity-process (get-process *default-dead-pool* entity-type (if info @@ -1280,7 +1281,7 @@ ) ;; definition for method 23 of type entity-actor -(defmethod kill! entity-actor ((this entity-actor)) +(defmethod kill! ((this entity-actor)) (let ((a0-1 (-> this extra process))) (if a0-1 (deactivate a0-1) @@ -1294,7 +1295,7 @@ ;; INFO: Return type mismatch bsp-header vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 s5, Count] ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod birth bsp-header ((this bsp-header)) +(defmethod birth ((this bsp-header)) (local-vars (v1-71 int) (s5-0 int)) (.mfc0 s5-0 Count) (let ((actor-count (if (nonzero? (-> this actors)) @@ -1381,7 +1382,7 @@ ;; definition for method 19 of type bsp-header ;; INFO: Return type mismatch bsp-header vs none. -(defmethod deactivate-entities bsp-header ((this bsp-header)) +(defmethod deactivate-entities ((this bsp-header)) (let ((s5-0 (-> this actors))) (when (nonzero? s5-0) (dotimes (s4-0 (-> s5-0 length)) @@ -1479,7 +1480,7 @@ ) ;; definition for method 9 of type entity-perm -(defmethod update-perm! entity-perm ((this entity-perm) (arg0 symbol) (arg1 entity-perm-status)) +(defmethod update-perm! ((this entity-perm) (arg0 symbol) (arg1 entity-perm-status)) (cond ((= arg0 'game) (logclear! (-> this status) arg1) @@ -1592,7 +1593,7 @@ ) ;; definition for method 12 of type process-drawable -(defmethod run-logic? process-drawable ((this process-drawable)) +(defmethod run-logic? ((this process-drawable)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) (vector-vector-distance (-> this root trans) (math-camera-pos)) @@ -1604,7 +1605,7 @@ ) ;; definition for method 9 of type entity-links -(defmethod birth? entity-links ((this entity-links) (arg0 vector)) +(defmethod birth? ((this entity-links) (arg0 vector)) (and (not (logtest? (-> this perm status) (entity-perm-status bit-0 dead))) (< (vector-vector-distance (-> this trans) arg0) (-> *ACTOR-bank* birth-dist)) ) @@ -1613,7 +1614,7 @@ ;; definition for method 15 of type level-group ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs object. -(defmethod actors-update level-group ((this level-group)) +(defmethod actors-update ((this level-group)) (local-vars (sv-16 vector) (sv-24 int) (sv-32 entity-links) (sv-48 int) (sv-64 string) (sv-80 int)) (when *compact-actors* (if (and (= *compact-actors* 'debug) (= (-> *nk-dead-pool* alive-list prev) (-> *nk-dead-pool* first-gap))) @@ -1843,7 +1844,7 @@ ;; definition for method 30 of type entity-actor ;; INFO: Return type mismatch entity-perm-status vs none. -(defmethod set-or-clear-status! entity-actor ((this entity-actor) (arg0 entity-perm-status) (arg1 symbol)) +(defmethod set-or-clear-status! ((this entity-actor) (arg0 entity-perm-status) (arg1 symbol)) (let ((v1-0 (-> this extra))) (if arg1 (logior! (-> v1-0 perm status) arg0) diff --git a/test/decompiler/reference/jak1/engine/entity/relocate_REF.gc b/test/decompiler/reference/jak1/engine/entity/relocate_REF.gc index 7195dd86d4e..299c6222b57 100644 --- a/test/decompiler/reference/jak1/engine/entity/relocate_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/relocate_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 7 of type process -(defmethod relocate process ((this process) (arg0 int)) +(defmethod relocate ((this process) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -89,14 +89,14 @@ ) ;; definition for method 7 of type cpu-thread -(defmethod relocate cpu-thread ((this cpu-thread) (arg0 int)) +(defmethod relocate ((this cpu-thread) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type process-drawable ;; INFO: Return type mismatch process vs process-drawable. -(defmethod relocate process-drawable ((this process-drawable) (arg0 int)) +(defmethod relocate ((this process-drawable) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -148,7 +148,7 @@ ) ;; definition for method 7 of type collide-shape -(defmethod relocate collide-shape ((this collide-shape) (arg0 int)) +(defmethod relocate ((this collide-shape) (arg0 int)) (&+! (-> this process) arg0) (&+! (-> this root-prim) arg0) (if (-> this riders) @@ -159,7 +159,7 @@ ;; definition for method 7 of type collide-shape-moving ;; INFO: Return type mismatch collide-shape vs collide-shape-moving. -(defmethod relocate collide-shape-moving ((this collide-shape-moving) (arg0 int)) +(defmethod relocate ((this collide-shape-moving) (arg0 int)) (if (-> this dynam) (&+! (-> this dynam) arg0) ) @@ -167,7 +167,7 @@ ) ;; definition for method 7 of type collide-sticky-rider-group -(defmethod relocate collide-sticky-rider-group ((this collide-sticky-rider-group) (arg0 int)) +(defmethod relocate ((this collide-sticky-rider-group) (arg0 int)) (countdown (v1-0 (-> this num-riders)) (let ((a2-2 (-> this rider v1-0))) (if (-> a2-2 sticky-prim) @@ -179,13 +179,13 @@ ) ;; definition for method 7 of type collide-shape-prim -(defmethod relocate collide-shape-prim ((this collide-shape-prim) (arg0 int)) +(defmethod relocate ((this collide-shape-prim) (arg0 int)) (&+! (-> this cshape) arg0) this ) ;; definition for method 7 of type collide-shape-prim-group -(defmethod relocate collide-shape-prim-group ((this collide-shape-prim-group) (arg0 int)) +(defmethod relocate ((this collide-shape-prim-group) (arg0 int)) (&+! (-> this cshape) arg0) (countdown (v1-2 (-> this num-prims)) (&+! (-> this prims v1-2) arg0) @@ -194,13 +194,13 @@ ) ;; definition for method 7 of type fact-info -(defmethod relocate fact-info ((this fact-info) (arg0 int)) +(defmethod relocate ((this fact-info) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type draw-control -(defmethod relocate draw-control ((this draw-control) (arg0 int)) +(defmethod relocate ((this draw-control) (arg0 int)) (&+! (-> this skeleton) arg0) (&+! (-> this process) arg0) (when (-> this ripple) @@ -220,7 +220,7 @@ ) ;; definition for method 7 of type joint-control -(defmethod relocate joint-control ((this joint-control) (arg0 int)) +(defmethod relocate ((this joint-control) (arg0 int)) (if (-> this effect) (&+! (-> this effect) arg0) ) @@ -232,7 +232,7 @@ ) ;; definition for method 7 of type cspace-array -(defmethod relocate cspace-array ((this cspace-array) (arg0 int)) +(defmethod relocate ((this cspace-array) (arg0 int)) (countdown (v1-0 (-> this length)) (let ((a2-2 (-> this data v1-0))) (if (-> a2-2 parent) @@ -259,63 +259,63 @@ ) ;; definition for method 7 of type nav-control -(defmethod relocate nav-control ((this nav-control) (arg0 int)) +(defmethod relocate ((this nav-control) (arg0 int)) (&+! (-> this process) arg0) (&+! (-> this shape) arg0) this ) ;; definition for method 7 of type path-control -(defmethod relocate path-control ((this path-control) (arg0 int)) +(defmethod relocate ((this path-control) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type vol-control -(defmethod relocate vol-control ((this vol-control) (arg0 int)) +(defmethod relocate ((this vol-control) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type water-control -(defmethod relocate water-control ((this water-control) (arg0 int)) +(defmethod relocate ((this water-control) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type actor-link-info -(defmethod relocate actor-link-info ((this actor-link-info) (arg0 int)) +(defmethod relocate ((this actor-link-info) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type align-control -(defmethod relocate align-control ((this align-control) (arg0 int)) +(defmethod relocate ((this align-control) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type joint-mod -(defmethod relocate joint-mod ((this joint-mod) (arg0 int)) +(defmethod relocate ((this joint-mod) (arg0 int)) (&+! (-> this process) arg0) (&+! (-> this joint) arg0) this ) ;; definition for method 7 of type joint-mod-wheel -(defmethod relocate joint-mod-wheel ((this joint-mod-wheel) (arg0 int)) +(defmethod relocate ((this joint-mod-wheel) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type effect-control -(defmethod relocate effect-control ((this effect-control) (arg0 int)) +(defmethod relocate ((this effect-control) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type sparticle-launch-control -(defmethod relocate sparticle-launch-control ((this sparticle-launch-control) (arg0 int)) +(defmethod relocate ((this sparticle-launch-control) (arg0 int)) (&+! (-> this proc) arg0) (countdown (v1-2 (-> this length)) (let* ((a0-3 (-> this data v1-2)) @@ -348,7 +348,7 @@ ;; definition for method 7 of type camera-master ;; INFO: Return type mismatch process vs camera-master. -(defmethod relocate camera-master ((this camera-master) (arg0 int)) +(defmethod relocate ((this camera-master) (arg0 int)) (if (nonzero? (-> this water-drip)) (&+! (-> this water-drip) arg0) ) @@ -357,7 +357,7 @@ ;; definition for method 7 of type time-of-day-proc ;; INFO: Return type mismatch process vs time-of-day-proc. -(defmethod relocate time-of-day-proc ((this time-of-day-proc) (arg0 int)) +(defmethod relocate ((this time-of-day-proc) (arg0 int)) (if (nonzero? (-> this stars)) (&+! (-> this stars) arg0) ) @@ -375,7 +375,7 @@ ;; definition for method 7 of type swingpole ;; INFO: Return type mismatch process vs swingpole. -(defmethod relocate swingpole ((this swingpole) (arg0 int)) +(defmethod relocate ((this swingpole) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) @@ -384,7 +384,7 @@ ;; definition for method 7 of type part-tracker ;; INFO: Return type mismatch process vs part-tracker. -(defmethod relocate part-tracker ((this part-tracker) (arg0 int)) +(defmethod relocate ((this part-tracker) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) @@ -396,7 +396,7 @@ ;; definition for method 7 of type manipy ;; INFO: Return type mismatch process-drawable vs manipy. -(defmethod relocate manipy ((this manipy) (arg0 int)) +(defmethod relocate ((this manipy) (arg0 int)) (if (nonzero? (-> this joint 0)) (&+! (-> this joint 0) arg0) ) diff --git a/test/decompiler/reference/jak1/engine/entity/res-h_REF.gc b/test/decompiler/reference/jak1/engine/entity/res-h_REF.gc index a77a06e2703..57e0de9c113 100644 --- a/test/decompiler/reference/jak1/engine/entity/res-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/res-h_REF.gc @@ -10,45 +10,39 @@ (elt-count uint32 :offset 112 :size 15) (inlined? uint8 :offset 127 :size 1) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition of type res-lump (deftype res-lump (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (data-base pointer :offset-assert 12) - (data-top pointer :offset-assert 16) - (data-size int32 :offset-assert 20) - (extra entity-links :offset-assert 24) - (tag (pointer res-tag) :offset-assert 28) + ((length int32) + (allocated-length int32) + (data-base pointer) + (data-top pointer) + (data-size int32) + (extra entity-links) + (tag (pointer res-tag)) ) - :method-count-assert 22 - :size-assert #x20 - :flag-assert #x1600000020 (:methods - (new (symbol type int int) _type_ 0) - (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual 9) - (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual 10) - (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual 11) - (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual 12) - (get-tag-index-data (_type_ int) pointer 13) - (get-tag-data (_type_ res-tag) pointer 14) - (allocate-data-memory-for-tag! (_type_ res-tag) res-tag 15) - (sort! (_type_) _type_ 16) - (add-data! (_type_ res-tag pointer) res-lump 17) - (add-32bit-data! (_type_ res-tag object) res-lump 18) - (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual 19) - (make-property-data (_type_ float res-tag-pair pointer) pointer 20) - (get-curve-data! (_type_ curve symbol symbol float) symbol 21) + (new (symbol type int int) _type_) + (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual) + (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual) + (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual) + (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual) + (get-tag-index-data (_type_ int) pointer) + (get-tag-data (_type_ res-tag) pointer) + (allocate-data-memory-for-tag! (_type_ res-tag) res-tag) + (sort! (_type_) _type_) + (add-data! (_type_ res-tag pointer) res-lump) + (add-32bit-data! (_type_ res-tag object) res-lump) + (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual) + (make-property-data (_type_ float res-tag-pair pointer) pointer) + (get-curve-data! (_type_ curve symbol symbol float) symbol) ) ) ;; definition for method 3 of type res-lump ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect res-lump ((this res-lump)) +(defmethod inspect ((this res-lump)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) diff --git a/test/decompiler/reference/jak1/engine/entity/res_REF.gc b/test/decompiler/reference/jak1/engine/entity/res_REF.gc index f7ae03befa7..702ac0a0025 100644 --- a/test/decompiler/reference/jak1/engine/entity/res_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/res_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 2 of type res-tag -(defmethod print res-tag ((this res-tag)) +(defmethod print ((this res-tag)) (if (zero? (-> this inlined?)) (format #t @@ -26,7 +26,7 @@ ;; definition for method 4 of type res-tag ;; INFO: Return type mismatch uint vs int. -(defmethod length res-tag ((this res-tag)) +(defmethod length ((this res-tag)) (the-as int (if (zero? (-> this inlined?)) (* (-> this elt-count) 4) (* (-> this elt-count) (-> this elt-type size)) @@ -36,12 +36,12 @@ ;; definition for method 13 of type res-lump ;; INFO: Used lq/sq -(defmethod get-tag-index-data res-lump ((this res-lump) (arg0 int)) +(defmethod get-tag-index-data ((this res-lump) (arg0 int)) (&+ (-> this data-base) (-> this tag arg0 data-offset)) ) ;; definition for method 14 of type res-lump -(defmethod get-tag-data res-lump ((this res-lump) (arg0 res-tag)) +(defmethod get-tag-data ((this res-lump) (arg0 res-tag)) (&+ (-> this data-base) (-> arg0 data-offset)) ) @@ -64,20 +64,20 @@ ) ;; definition for method 4 of type res-lump -(defmethod length res-lump ((this res-lump)) +(defmethod length ((this res-lump)) (-> this length) ) ;; definition for method 5 of type res-lump ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of res-lump ((this res-lump)) +(defmethod asize-of ((this res-lump)) (the-as int (+ (-> this type psize) (* (-> this allocated-length) 16) (-> this data-size))) ) ;; definition for method 3 of type res-lump ;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -(defmethod inspect res-lump ((this res-lump)) +(defmethod inspect ((this res-lump)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Textra: ~A~%" (-> this extra)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -119,7 +119,7 @@ ;; definition for method 19 of type res-lump ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs res-tag-pair. -(defmethod lookup-tag-idx res-lump ((this res-lump) (name-sym symbol) (mode symbol) (time float)) +(defmethod lookup-tag-idx ((this res-lump) (name-sym symbol) (mode symbol) (time float)) (local-vars (tag-idx int)) (when (or (= name-sym 'id) (= name-sym 'aid) @@ -219,7 +219,7 @@ ;; definition for method 20 of type res-lump ;; INFO: Used lq/sq -(defmethod make-property-data res-lump ((this res-lump) (time float) (result res-tag-pair) (buf pointer)) +(defmethod make-property-data ((this res-lump) (time float) (result res-tag-pair) (buf pointer)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -401,14 +401,14 @@ ;; definition for method 9 of type res-lump ;; INFO: Used lq/sq -(defmethod get-property-data res-lump ((this res-lump) - (name symbol) - (mode symbol) - (time float) - (default pointer) - (tag-addr (pointer res-tag)) - (buf-addr pointer) - ) +(defmethod get-property-data ((this res-lump) + (name symbol) + (mode symbol) + (time float) + (default pointer) + (tag-addr (pointer res-tag)) + (buf-addr pointer) + ) (let ((tag-pair (lookup-tag-idx this name mode time))) (cond ((< (the-as int tag-pair) 0) @@ -428,14 +428,14 @@ ;; definition for method 10 of type res-lump ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs structure. -(defmethod get-property-struct res-lump ((this res-lump) - (name symbol) - (mode symbol) - (time float) - (default structure) - (tag-addr (pointer res-tag)) - (buf-addr pointer) - ) +(defmethod get-property-struct ((this res-lump) + (name symbol) + (mode symbol) + (time float) + (default structure) + (tag-addr (pointer res-tag)) + (buf-addr pointer) + ) (let ((tag-pair (lookup-tag-idx this name mode time))) (cond ((< (the-as int tag-pair) 0) @@ -461,14 +461,14 @@ ;; definition for method 11 of type res-lump ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs uint128. -(defmethod get-property-value res-lump ((this res-lump) - (name symbol) - (mode symbol) - (time float) - (default uint128) - (tag-addr (pointer res-tag)) - (buf-addr pointer) - ) +(defmethod get-property-value ((this res-lump) + (name symbol) + (mode symbol) + (time float) + (default uint128) + (tag-addr (pointer res-tag)) + (buf-addr pointer) + ) (let ((tag-pair (lookup-tag-idx this name mode time))) (cond ((< (the-as int tag-pair) 0) @@ -538,14 +538,14 @@ ;; definition for method 12 of type res-lump ;; INFO: Used lq/sq -(defmethod get-property-value-float res-lump ((this res-lump) - (name symbol) - (mode symbol) - (time float) - (default float) - (tag-addr (pointer res-tag)) - (buf-addr pointer) - ) +(defmethod get-property-value-float ((this res-lump) + (name symbol) + (mode symbol) + (time float) + (default float) + (tag-addr (pointer res-tag)) + (buf-addr pointer) + ) (local-vars (v1-8 uint) (v1-11 int)) (let ((tag-pair (lookup-tag-idx this name mode time))) (cond @@ -618,7 +618,7 @@ ;; definition for method 16 of type res-lump ;; INFO: Used lq/sq -(defmethod sort! res-lump ((this res-lump)) +(defmethod sort! ((this res-lump)) (let ((tags-sorted -1)) (while (nonzero? tags-sorted) (set! tags-sorted 0) @@ -647,7 +647,7 @@ ;; definition for method 15 of type res-lump ;; INFO: Used lq/sq -(defmethod allocate-data-memory-for-tag! res-lump ((this res-lump) (arg0 res-tag)) +(defmethod allocate-data-memory-for-tag! ((this res-lump) (arg0 res-tag)) (local-vars (resource-mem pointer)) (let* ((tag-pair (lookup-tag-idx this (-> arg0 name) 'exact (-> arg0 key-frame))) (existing-tag (-> this tag (-> tag-pair lo))) @@ -711,7 +711,7 @@ ) ;; definition for method 17 of type res-lump -(defmethod add-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 pointer)) +(defmethod add-data! ((this res-lump) (arg0 res-tag) (arg1 pointer)) (let ((new-tag (allocate-data-memory-for-tag! this arg0))) (when new-tag (let* ((v1-2 this) @@ -736,7 +736,7 @@ ) ;; definition for method 18 of type res-lump -(defmethod add-32bit-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 object)) +(defmethod add-32bit-data! ((this res-lump) (arg0 res-tag) (arg1 object)) (local-vars (sv-16 object)) (set! sv-16 arg1) (let* ((v1-0 arg0) @@ -748,7 +748,7 @@ ;; definition for method 21 of type res-lump ;; INFO: Used lq/sq -(defmethod get-curve-data! res-lump ((this res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) +(defmethod get-curve-data! ((this res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) (let ((s5-0 #f)) (set! sv-16 (new 'static 'res-tag)) @@ -803,7 +803,7 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs res-lump. ;; ERROR: Failed load: (set! v1-72 (l.wu (+ a0-58 -4))) at op 206 -(defmethod mem-usage res-lump ((this res-lump) (block memory-usage-block) (flags int)) +(defmethod mem-usage ((this res-lump) (block memory-usage-block) (flags int)) (local-vars (sv-16 int)) (let ((mem-use-id 48) (mem-use-name "res") diff --git a/test/decompiler/reference/jak1/engine/game/effect-control-h_REF.gc b/test/decompiler/reference/jak1/engine/game/effect-control-h_REF.gc index 6d8be20d6f9..5f613e2960e 100644 --- a/test/decompiler/reference/jak1/engine/game/effect-control-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/effect-control-h_REF.gc @@ -3,31 +3,28 @@ ;; definition of type effect-control (deftype effect-control (basic) - ((process process-drawable :offset-assert 4) - (flags uint32 :offset-assert 8) - (last-frame-group art-joint-anim :offset-assert 12) - (last-frame-num float :offset-assert 16) - (channel-offset int32 :offset-assert 20) - (res res-lump :offset-assert 24) - (name (pointer res-tag) :offset-assert 28) - (param uint32 :offset-assert 32) + ((process process-drawable) + (flags uint32) + (last-frame-group art-joint-anim) + (last-frame-num float) + (channel-offset int32) + (res res-lump) + (name (pointer res-tag)) + (param uint32) ) - :method-count-assert 15 - :size-assert #x24 - :flag-assert #xf00000024 (:methods - (new (symbol type process-drawable) _type_ 0) - (effect-control-method-9 (_type_) none 9) - (effect-control-method-10 (_type_ symbol float int) object 10) - (effect-control-method-11 (_type_ symbol float int basic pat-surface) none 11) - (effect-control-method-12 (_type_ symbol float int basic sound-name) int 12) - (set-channel-offset! (_type_ int) none 13) - (effect-control-method-14 (_type_ float float float) none 14) + (new (symbol type process-drawable) _type_) + (effect-control-method-9 (_type_) none) + (effect-control-method-10 (_type_ symbol float int) object) + (effect-control-method-11 (_type_ symbol float int basic pat-surface) none) + (effect-control-method-12 (_type_ symbol float int basic sound-name) int) + (set-channel-offset! (_type_ int) none) + (effect-control-method-14 (_type_ float float float) none) ) ) ;; definition for method 3 of type effect-control -(defmethod inspect effect-control ((this effect-control)) +(defmethod inspect ((this effect-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tprocess: ~A~%" (-> this process)) (format #t "~Tflags: #x~X~%" (-> this flags)) @@ -58,7 +55,7 @@ ;; definition for method 13 of type effect-control ;; INFO: Return type mismatch int vs none. -(defmethod set-channel-offset! effect-control ((this effect-control) (arg0 int)) +(defmethod set-channel-offset! ((this effect-control) (arg0 int)) (set! (-> this channel-offset) arg0) 0 (none) diff --git a/test/decompiler/reference/jak1/engine/game/effect-control_REF.gc b/test/decompiler/reference/jak1/engine/game/effect-control_REF.gc index 2446a8bca3d..ca1dc697690 100644 --- a/test/decompiler/reference/jak1/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/effect-control_REF.gc @@ -130,7 +130,7 @@ ;; definition for method 9 of type effect-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod effect-control-method-9 effect-control ((this effect-control)) +(defmethod effect-control-method-9 ((this effect-control)) (let* ((a0-1 (-> this process skel)) (v1-3 (if (< (-> this channel-offset) (-> a0-1 active-channels)) (-> a0-1 root-channel (-> this channel-offset)) @@ -234,7 +234,7 @@ ;; definition for method 14 of type effect-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod effect-control-method-14 effect-control ((this effect-control) (arg0 float) (arg1 float) (arg2 float)) +(defmethod effect-control-method-14 ((this effect-control) (arg0 float) (arg1 float) (arg2 float)) (let ((s2-0 (-> this name))) (while (= (-> s2-0 0 name) 'effect-name) (let ((f0-0 (-> s2-0 0 key-frame))) @@ -263,7 +263,7 @@ ;; definition for method 10 of type effect-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs object. -(defmethod effect-control-method-10 effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) +(defmethod effect-control-method-10 ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) (local-vars (sv-160 int) (sv-176 symbol) @@ -536,7 +536,7 @@ ;; definition for method 11 of type effect-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod effect-control-method-11 effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) +(defmethod effect-control-method-11 ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) (local-vars (sv-48 (function sparticle-system sparticle-launcher vector sparticle-launch-state sparticle-launch-control float none) @@ -1057,7 +1057,7 @@ ;; definition for method 12 of type effect-control ;; INFO: Used lq/sq -(defmethod effect-control-method-12 effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) +(defmethod effect-control-method-12 ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) (local-vars (sv-112 res-tag) (sv-128 sound-name) (sv-144 basic) (sv-160 (function vector vector float))) (set! sv-144 arg3) (let ((s0-0 arg4) diff --git a/test/decompiler/reference/jak1/engine/game/fact-h_REF.gc b/test/decompiler/reference/jak1/engine/game/fact-h_REF.gc index 17c16c33300..d3f669d87d4 100644 --- a/test/decompiler/reference/jak1/engine/game/fact-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/fact-h_REF.gc @@ -3,29 +3,26 @@ ;; definition of type fact-bank (deftype fact-bank (basic) - ((eco-level-max float :offset-assert 4) - (eco-single-inc float :offset-assert 8) - (eco-full-inc float :offset-assert 12) - (eco-single-timeout seconds :offset-assert 16) - (eco-full-timeout seconds :offset-assert 24) - (dummy seconds :offset-assert 32) - (health-max-default float :offset-assert 40) - (health-single-inc float :offset-assert 44) - (eco-pill-max-default float :offset-assert 48) - (health-small-inc float :offset-assert 52) - (buzzer-max-default float :offset-assert 56) - (buzzer-single-inc float :offset-assert 60) - (suck-bounce-dist meters :offset-assert 64) - (suck-suck-dist meters :offset-assert 68) - (default-pill-inc float :offset-assert 72) + ((eco-level-max float) + (eco-single-inc float) + (eco-full-inc float) + (eco-single-timeout seconds) + (eco-full-timeout seconds) + (dummy seconds) + (health-max-default float) + (health-single-inc float) + (eco-pill-max-default float) + (health-small-inc float) + (buzzer-max-default float) + (buzzer-single-inc float) + (suck-bounce-dist meters) + (suck-suck-dist meters) + (default-pill-inc float) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) ;; definition for method 3 of type fact-bank -(defmethod inspect fact-bank ((this fact-bank)) +(defmethod inspect ((this fact-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Teco-level-max: ~f~%" (-> this eco-level-max)) (format #t "~Teco-single-inc: ~f~%" (-> this eco-single-inc)) @@ -105,26 +102,23 @@ ;; definition of type fact-info (deftype fact-info (basic) - ((process process-drawable :offset-assert 4) - (pickup-type pickup-type :offset-assert 8) - (pickup-amount float :offset-assert 12) - (pickup-spawn-amount float :offset-assert 16) - (options fact-options :offset-assert 24) - (fade-time time-frame :offset-assert 32) + ((process process-drawable) + (pickup-type pickup-type) + (pickup-amount float) + (pickup-spawn-amount float) + (options fact-options) + (fade-time time-frame) ) - :method-count-assert 12 - :size-assert #x28 - :flag-assert #xc00000028 (:methods - (new (symbol type process-drawable pickup-type float) _type_ 0) - (drop-pickup (_type_ symbol process-tree fact-info int) (pointer process) 9) - (reset! (_type_ symbol) none 10) - (pickup-collectable! (_type_ pickup-type float handle) float 11) + (new (symbol type process-drawable pickup-type float) _type_) + (drop-pickup (_type_ symbol process-tree fact-info int) (pointer process)) + (reset! (_type_ symbol) none) + (pickup-collectable! (_type_ pickup-type float handle) float) ) ) ;; definition for method 3 of type fact-info -(defmethod inspect fact-info ((this fact-info)) +(defmethod inspect ((this fact-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tprocess: ~A~%" (-> this process)) (format #t "~Tpickup-type: ~D~%" (-> this pickup-type)) @@ -137,34 +131,31 @@ ;; definition of type fact-info-target (deftype fact-info-target (fact-info) - ((eco-type pickup-type :offset-assert 40) - (eco-level float :offset-assert 44) - (eco-pickup-time time-frame :offset-assert 48) - (eco-timeout seconds :offset-assert 56) - (health float :offset-assert 64) - (health-max float :offset-assert 68) - (buzzer float :offset-assert 72) - (buzzer-max float :offset-assert 76) - (eco-pill float :offset-assert 80) - (eco-pill-max float :offset-assert 84) - (health-pickup-time time-frame :offset-assert 88) - (eco-source handle :offset-assert 96) - (eco-source-time time-frame :offset-assert 104) - (money-pickup-time time-frame :offset-assert 112) - (buzzer-pickup-time time-frame :offset-assert 120) - (fuel-cell-pickup-time time-frame :offset-assert 128) - (eco-pill-pickup-time time-frame :offset-assert 136) + ((eco-type pickup-type) + (eco-level float) + (eco-pickup-time time-frame) + (eco-timeout seconds) + (health float) + (health-max float) + (buzzer float) + (buzzer-max float) + (eco-pill float) + (eco-pill-max float) + (health-pickup-time time-frame) + (eco-source handle) + (eco-source-time time-frame) + (money-pickup-time time-frame) + (buzzer-pickup-time time-frame) + (fuel-cell-pickup-time time-frame) + (eco-pill-pickup-time time-frame) ) - :method-count-assert 12 - :size-assert #x90 - :flag-assert #xc00000090 (:methods - (new (symbol type process-drawable pickup-type float) _type_ 0) + (new (symbol type process-drawable pickup-type float) _type_) ) ) ;; definition for method 3 of type fact-info-target -(defmethod inspect fact-info-target ((this fact-info-target)) +(defmethod inspect ((this fact-info-target)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tprocess: ~A~%" (-> this process)) (format #t "~Tpickup-type: ~D~%" (-> this pickup-type)) @@ -194,24 +185,21 @@ ;; definition of type fact-info-enemy (deftype fact-info-enemy (fact-info) - ((speed float :offset-assert 40) - (idle-distance meters :offset-assert 44) - (notice-top meters :offset-assert 48) - (notice-bottom meters :offset-assert 52) - (cam-horz meters :offset-assert 56) - (cam-vert meters :offset-assert 60) - (cam-notice-dist meters :offset-assert 64) + ((speed float) + (idle-distance meters) + (notice-top meters) + (notice-bottom meters) + (cam-horz meters) + (cam-vert meters) + (cam-notice-dist meters) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 (:methods - (new (symbol type process-drawable pickup-type float) _type_ 0) + (new (symbol type process-drawable pickup-type float) _type_) ) ) ;; definition for method 3 of type fact-info-enemy -(defmethod inspect fact-info-enemy ((this fact-info-enemy)) +(defmethod inspect ((this fact-info-enemy)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tprocess: ~A~%" (-> this process)) (format #t "~Tpickup-type: ~D~%" (-> this pickup-type)) @@ -277,7 +265,7 @@ ) ;; definition for method 11 of type fact-info -(defmethod pickup-collectable! fact-info ((this fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) +(defmethod pickup-collectable! ((this fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) 0.0 ) diff --git a/test/decompiler/reference/jak1/engine/game/game-h_REF.gc b/test/decompiler/reference/jak1/engine/game/game-h_REF.gc index 1d4ad66504f..967dcea6270 100644 --- a/test/decompiler/reference/jak1/engine/game/game-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/game-h_REF.gc @@ -3,33 +3,29 @@ ;; definition of type process-drawable (deftype process-drawable (process) - ((root trsqv :offset-assert 112) - (node-list cspace-array :offset-assert 116) - (draw draw-control :offset-assert 120) - (skel joint-control :offset-assert 124) - (nav nav-control :offset-assert 128) - (align align-control :offset-assert 132) - (path path-control :offset-assert 136) - (vol vol-control :offset-assert 140) - (fact fact-info :offset-assert 144) - (link actor-link-info :offset-assert 148) - (part sparticle-launch-control :offset-assert 152) - (water water-control :offset-assert 156) - (sound ambient-sound :offset-assert 160) - (state-flags state-flags :offset-assert 164) - (state-time time-frame :offset-assert 168) + ((root trsqv) + (node-list cspace-array) + (draw draw-control) + (skel joint-control) + (nav nav-control) + (align align-control) + (path path-control) + (vol vol-control) + (fact fact-info) + (link actor-link-info) + (part sparticle-launch-control) + (water water-control) + (sound ambient-sound) + (state-flags state-flags) + (state-time time-frame) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:methods - (initialize-skeleton (_type_ skeleton-group pair) none 14) - (initialize-skeleton-by-name (_type_ string object) _type_ 15) - (apply-alignment (_type_ align-opts transformq vector) collide-shape 16) - (do-joint-math! (_type_) none 17) - (cleanup-for-death (_type_) none 18) - (evaluate-joint-control (_type_) none 19) + (initialize-skeleton (_type_ skeleton-group pair) none) + (initialize-skeleton-by-name (_type_ string object) _type_) + (apply-alignment (_type_ align-opts transformq vector) collide-shape) + (do-joint-math! (_type_) none) + (cleanup-for-death (_type_) none) + (evaluate-joint-control (_type_) none) ) (:states (process-drawable-art-error string) @@ -38,7 +34,7 @@ ) ;; definition for method 3 of type process-drawable -(defmethod inspect process-drawable ((this process-drawable)) +(defmethod inspect ((this process-drawable)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -63,59 +59,55 @@ ;; definition of type process-drawable-reserved (deftype process-drawable-reserved (process-drawable) () - :heap-base #x40 - :method-count-assert 63 - :size-assert #xb0 - :flag-assert #x3f004000b0 (:methods - (process-drawable-reserved-method-20 () none 20) - (process-drawable-reserved-method-21 () none 21) - (process-drawable-reserved-method-22 () none 22) - (process-drawable-reserved-method-23 () none 23) - (process-drawable-reserved-method-24 () none 24) - (process-drawable-reserved-method-25 () none 25) - (process-drawable-reserved-method-26 () none 26) - (process-drawable-reserved-method-27 () none 27) - (process-drawable-reserved-method-28 () none 28) - (process-drawable-reserved-method-29 () none 29) - (process-drawable-reserved-method-30 () none 30) - (process-drawable-reserved-method-31 () none 31) - (process-drawable-reserved-method-32 () none 32) - (process-drawable-reserved-method-33 () none 33) - (process-drawable-reserved-method-34 () none 34) - (process-drawable-reserved-method-35 () none 35) - (process-drawable-reserved-method-36 () none 36) - (process-drawable-reserved-method-37 () none 37) - (process-drawable-reserved-method-38 () none 38) - (process-drawable-reserved-method-39 () none 39) - (process-drawable-reserved-method-40 () none 40) - (process-drawable-reserved-method-41 () none 41) - (process-drawable-reserved-method-42 () none 42) - (process-drawable-reserved-method-43 () none 43) - (process-drawable-reserved-method-44 () none 44) - (process-drawable-reserved-method-45 () none 45) - (process-drawable-reserved-method-46 () none 46) - (process-drawable-reserved-method-47 () none 47) - (process-drawable-reserved-method-48 () none 48) - (process-drawable-reserved-method-49 () none 49) - (process-drawable-reserved-method-50 () none 50) - (process-drawable-reserved-method-51 () none 51) - (process-drawable-reserved-method-52 () none 52) - (process-drawable-reserved-method-53 () none 53) - (process-drawable-reserved-method-54 () none 54) - (process-drawable-reserved-method-55 () none 55) - (process-drawable-reserved-method-56 () none 56) - (process-drawable-reserved-method-57 () none 57) - (process-drawable-reserved-method-58 () none 58) - (process-drawable-reserved-method-59 () none 59) - (process-drawable-reserved-method-60 () none 60) - (process-drawable-reserved-method-61 () none 61) - (process-drawable-reserved-method-62 () none 62) + (process-drawable-reserved-method-20 () none) + (process-drawable-reserved-method-21 () none) + (process-drawable-reserved-method-22 () none) + (process-drawable-reserved-method-23 () none) + (process-drawable-reserved-method-24 () none) + (process-drawable-reserved-method-25 () none) + (process-drawable-reserved-method-26 () none) + (process-drawable-reserved-method-27 () none) + (process-drawable-reserved-method-28 () none) + (process-drawable-reserved-method-29 () none) + (process-drawable-reserved-method-30 () none) + (process-drawable-reserved-method-31 () none) + (process-drawable-reserved-method-32 () none) + (process-drawable-reserved-method-33 () none) + (process-drawable-reserved-method-34 () none) + (process-drawable-reserved-method-35 () none) + (process-drawable-reserved-method-36 () none) + (process-drawable-reserved-method-37 () none) + (process-drawable-reserved-method-38 () none) + (process-drawable-reserved-method-39 () none) + (process-drawable-reserved-method-40 () none) + (process-drawable-reserved-method-41 () none) + (process-drawable-reserved-method-42 () none) + (process-drawable-reserved-method-43 () none) + (process-drawable-reserved-method-44 () none) + (process-drawable-reserved-method-45 () none) + (process-drawable-reserved-method-46 () none) + (process-drawable-reserved-method-47 () none) + (process-drawable-reserved-method-48 () none) + (process-drawable-reserved-method-49 () none) + (process-drawable-reserved-method-50 () none) + (process-drawable-reserved-method-51 () none) + (process-drawable-reserved-method-52 () none) + (process-drawable-reserved-method-53 () none) + (process-drawable-reserved-method-54 () none) + (process-drawable-reserved-method-55 () none) + (process-drawable-reserved-method-56 () none) + (process-drawable-reserved-method-57 () none) + (process-drawable-reserved-method-58 () none) + (process-drawable-reserved-method-59 () none) + (process-drawable-reserved-method-60 () none) + (process-drawable-reserved-method-61 () none) + (process-drawable-reserved-method-62 () none) ) ) ;; definition for method 3 of type process-drawable-reserved -(defmethod inspect process-drawable-reserved ((this process-drawable-reserved)) +(defmethod inspect ((this process-drawable-reserved)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -124,32 +116,29 @@ ;; definition of type attack-info (deftype attack-info (structure) - ((trans vector :inline :offset-assert 0) - (vector vector :inline :offset-assert 16) - (intersection vector :inline :offset-assert 32) - (attacker handle :offset-assert 48) - (invinc-time time-frame :offset-assert 56) - (mask attack-mask :offset-assert 64) - (mode symbol :offset-assert 68) - (shove-back meters :offset-assert 72) - (shove-up meters :offset-assert 76) - (speed meters :offset-assert 80) - (dist meters :offset-assert 84) - (control float :offset-assert 88) - (angle symbol :offset-assert 92) - (rotate-to degrees :offset-assert 96) - (prev-state state :offset-assert 100) + ((trans vector :inline) + (vector vector :inline) + (intersection vector :inline) + (attacker handle) + (invinc-time time-frame) + (mask attack-mask) + (mode symbol) + (shove-back meters) + (shove-up meters) + (speed meters) + (dist meters) + (control float) + (angle symbol) + (rotate-to degrees) + (prev-state state) ) - :method-count-assert 10 - :size-assert #x68 - :flag-assert #xa00000068 (:methods - (combine! (_type_ attack-info) none 9) + (combine! (_type_ attack-info) none) ) ) ;; definition for method 3 of type attack-info -(defmethod inspect attack-info ((this attack-info)) +(defmethod inspect ((this attack-info)) (format #t "[~8x] ~A~%" this 'attack-info) (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) (format #t "~Tvector: ~`vector`P~%" (-> this vector)) @@ -174,17 +163,14 @@ ;; definition of type ground-tween-info (deftype ground-tween-info (structure) - ((chan uint8 3 :offset-assert 0) - (blend float 3 :offset-assert 4) - (group uint32 5 :offset-assert 16) + ((chan uint8 3) + (blend float 3) + (group uint32 5) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type ground-tween-info -(defmethod inspect ground-tween-info ((this ground-tween-info)) +(defmethod inspect ((this ground-tween-info)) (format #t "[~8x] ~A~%" this 'ground-tween-info) (format #t "~Tchan[3] @ #x~X~%" (-> this chan)) (format #t "~Tblend[3] @ #x~X~%" (-> this blend)) diff --git a/test/decompiler/reference/jak1/engine/game/game-info-h_REF.gc b/test/decompiler/reference/jak1/engine/game/game-info-h_REF.gc index a111d1f78e0..a5e6724e79d 100644 --- a/test/decompiler/reference/jak1/engine/game/game-info-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/game-info-h_REF.gc @@ -5,19 +5,16 @@ ;; definition of type game-bank (deftype game-bank (basic) - ((life-max-default float :offset-assert 4) - (life-start-default float :offset-assert 8) - (life-single-inc float :offset-assert 12) - (money-task-inc float :offset-assert 16) - (money-oracle-inc float :offset-assert 20) + ((life-max-default float) + (life-start-default float) + (life-single-inc float) + (money-task-inc float) + (money-oracle-inc float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type game-bank -(defmethod inspect game-bank ((this game-bank)) +(defmethod inspect ((this game-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlife-max-default: ~f~%" (-> this life-max-default)) (format #t "~Tlife-start-default: ~f~%" (-> this life-start-default)) @@ -40,26 +37,20 @@ ;; definition of type actor-id (deftype actor-id (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type level-buffer-state (deftype level-buffer-state (structure) - ((name symbol :offset-assert 0) - (display? symbol :offset-assert 4) - (force-vis? symbol :offset-assert 8) - (force-inside? symbol :offset-assert 12) + ((name symbol) + (display? symbol) + (force-vis? symbol) + (force-inside? symbol) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type level-buffer-state -(defmethod inspect level-buffer-state ((this level-buffer-state)) +(defmethod inspect ((this level-buffer-state)) (format #t "[~8x] ~A~%" this 'level-buffer-state) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tdisplay?: ~A~%" (-> this display?)) @@ -70,34 +61,31 @@ ;; definition of type load-state (deftype load-state (basic) - ((want level-buffer-state 2 :inline :offset-assert 4) - (vis-nick symbol :offset-assert 36) - (command-list pair :offset-assert 40) - (object-name symbol 256 :offset-assert 44) - (object-status basic 256 :offset-assert 1068) + ((want level-buffer-state 2 :inline) + (vis-nick symbol) + (command-list pair) + (object-name symbol 256) + (object-status basic 256) ) - :method-count-assert 21 - :size-assert #x82c - :flag-assert #x150000082c (:methods - (new (symbol type) _type_ 0) - (reset! (_type_) _type_ 9) - (update! (_type_) int 10) - (want-levels (_type_ symbol symbol) int 11) - (want-display-level (_type_ symbol symbol) int 12) - (want-vis (_type_ symbol) int 13) - (want-force-vis (_type_ symbol symbol) int 14) - (execute-command (_type_ pair) none 15) - (execute-commands-up-to (_type_ float) int 16) - (backup-load-state-and-set-cmds (_type_ pair) int 17) - (restore-load-state-and-cleanup (_type_) int 18) - (restore-load-state (_type_) int 19) - (set-force-inside! (_type_ symbol symbol) none 20) + (new (symbol type) _type_) + (reset! (_type_) _type_) + (update! (_type_) int) + (want-levels (_type_ symbol symbol) int) + (want-display-level (_type_ symbol symbol) int) + (want-vis (_type_ symbol) int) + (want-force-vis (_type_ symbol symbol) int) + (execute-command (_type_ pair) none) + (execute-commands-up-to (_type_ float) int) + (backup-load-state-and-set-cmds (_type_ pair) int) + (restore-load-state-and-cleanup (_type_) int) + (restore-load-state (_type_) int) + (set-force-inside! (_type_ symbol symbol) none) ) ) ;; definition for method 3 of type load-state -(defmethod inspect load-state ((this load-state)) +(defmethod inspect ((this load-state)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Twant[2] @ #x~X~%" (-> this want)) (format #t "~Tvis-nick: ~A~%" (-> this vis-nick)) @@ -114,30 +102,27 @@ ;; definition of type continue-point (deftype continue-point (basic) - ((name string :offset-assert 4) - (level symbol :offset-assert 8) - (flags continue-flags :offset-assert 12) - (trans vector :inline :offset-assert 16) - (quat quaternion :inline :offset-assert 32) - (camera-trans vector :inline :offset-assert 48) - (camera-rot float 9 :offset-assert 64) - (load-commands pair :offset-assert 100) - (vis-nick symbol :offset-assert 104) - (lev0 symbol :offset-assert 108) - (disp0 symbol :offset-assert 112) - (lev1 symbol :offset-assert 116) - (disp1 symbol :offset-assert 120) + ((name string) + (level symbol) + (flags continue-flags) + (trans vector :inline) + (quat quaternion :inline) + (camera-trans vector :inline) + (camera-rot float 9) + (load-commands pair) + (vis-nick symbol) + (lev0 symbol) + (disp0 symbol) + (lev1 symbol) + (disp1 symbol) ) - :method-count-assert 10 - :size-assert #x7c - :flag-assert #xa0000007c (:methods - (debug-draw! (_type_) none 9) + (debug-draw! (_type_) none) ) ) ;; definition for method 3 of type continue-point -(defmethod inspect continue-point ((this continue-point)) +(defmethod inspect ((this continue-point)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tlevel: ~A~%" (-> this level)) @@ -157,80 +142,77 @@ ;; definition of type game-info (deftype game-info (basic) - ((mode symbol :offset-assert 4) - (save-name basic :offset-assert 8) - (life float :offset-assert 12) - (life-max float :offset-assert 16) - (money float :offset-assert 20) - (money-total float :offset-assert 24) - (money-per-level uint8 32 :offset-assert 28) - (deaths-per-level uint8 32 :offset-assert 60) - (buzzer-total float :offset-assert 92) - (fuel float :offset-assert 96) - (perm-list entity-perm-array :offset-assert 100) - (task-perm-list entity-perm-array :offset-assert 104) - (current-continue continue-point :offset-assert 108) - (text-ids-seen bit-array :offset-assert 112) - (level-opened uint8 32 :offset-assert 116) - (hint-control (array level-hint-control) :offset-assert 148) - (task-hint-control (array task-hint-control-group) :offset-assert 152) - (total-deaths int32 :offset-assert 156) - (continue-deaths int32 :offset-assert 160) - (fuel-cell-deaths int32 :offset-assert 164) - (game-start-time time-frame :offset-assert 168) - (continue-time time-frame :offset-assert 176) - (death-time time-frame :offset-assert 184) - (hit-time time-frame :offset-assert 192) - (fuel-cell-pickup-time time-frame :offset-assert 200) - (fuel-cell-time (array time-frame) :offset-assert 208) - (enter-level-time (array time-frame) :offset-assert 212) - (in-level-time (array time-frame) :offset-assert 216) - (blackout-time time-frame :offset-assert 224) - (letterbox-time time-frame :offset-assert 232) - (hint-play-time time-frame :offset-assert 240) - (display-text-time time-frame :offset-assert 248) - (display-text-handle handle :offset-assert 256) - (death-movie-tick int32 :offset-assert 264) - (want-auto-save symbol :offset-assert 268) - (auto-save-proc handle :offset-assert 272) - (auto-save-status mc-status-code :offset-assert 280) - (auto-save-card int32 :offset-assert 284) - (auto-save-which int32 :offset-assert 288) - (pov-camera-handle handle :offset-assert 296) - (other-camera-handle handle :offset-assert 304) - (death-pos vector-array :offset-assert 312) - (dummy basic :offset-assert 316) - (auto-save-count int32 :offset-assert 320) + ((mode symbol) + (save-name basic) + (life float) + (life-max float) + (money float) + (money-total float) + (money-per-level uint8 32) + (deaths-per-level uint8 32) + (buzzer-total float) + (fuel float) + (perm-list entity-perm-array) + (task-perm-list entity-perm-array) + (current-continue continue-point) + (text-ids-seen bit-array) + (level-opened uint8 32) + (hint-control (array level-hint-control)) + (task-hint-control (array task-hint-control-group)) + (total-deaths int32) + (continue-deaths int32) + (fuel-cell-deaths int32) + (game-start-time time-frame) + (continue-time time-frame) + (death-time time-frame) + (hit-time time-frame) + (fuel-cell-pickup-time time-frame) + (fuel-cell-time (array time-frame)) + (enter-level-time (array time-frame)) + (in-level-time (array time-frame)) + (blackout-time time-frame) + (letterbox-time time-frame) + (hint-play-time time-frame) + (display-text-time time-frame) + (display-text-handle handle) + (death-movie-tick int32) + (want-auto-save symbol) + (auto-save-proc handle) + (auto-save-status mc-status-code) + (auto-save-card int32) + (auto-save-which int32) + (pov-camera-handle handle) + (other-camera-handle handle) + (death-pos vector-array) + (dummy basic) + (auto-save-count int32) ) - :method-count-assert 29 - :size-assert #x144 - :flag-assert #x1d00000144 (:methods - (initialize! (_type_ symbol game-save string) _type_ 9) - (adjust (_type_ symbol float handle) float 10) - (task-complete? (_type_ game-task) symbol 11) - (lookup-entity-perm-by-aid (_type_ actor-id) entity-perm 12) - (get-entity-task-perm (_type_ game-task) entity-perm 13) - (copy-perms-from-level! (_type_ level) none 14) - (copy-perms-to-level! (_type_ level) none 15) - (debug-print (_type_ symbol) _type_ 16) - (get-or-create-continue! (_type_) continue-point 17) - (get-continue-by-name (_type_ string) continue-point 18) - (set-continue! (_type_ basic) continue-point 19) - (buzzer-count (_type_ game-task) int 20) - (seen-text? (_type_ text-id) symbol 21) - (mark-text-as-seen (_type_ text-id) none 22) - (got-buzzer? (_type_ game-task int) symbol 23) - (save-game! (_type_ game-save string) none 24) - (load-game! (_type_ game-save) game-save 25) - (clear-text-seen! (_type_ text-id) none 26) - (get-death-count (_type_ symbol) int 27) - (get-health-percent-lost (_type_ symbol) float 28) + (initialize! (_type_ symbol game-save string) _type_) + (adjust (_type_ symbol float handle) float) + (task-complete? (_type_ game-task) symbol) + (lookup-entity-perm-by-aid (_type_ actor-id) entity-perm) + (get-entity-task-perm (_type_ game-task) entity-perm) + (copy-perms-from-level! (_type_ level) none) + (copy-perms-to-level! (_type_ level) none) + (debug-print (_type_ symbol) _type_) + (get-or-create-continue! (_type_) continue-point) + (get-continue-by-name (_type_ string) continue-point) + (set-continue! (_type_ basic) continue-point) + (buzzer-count (_type_ game-task) int) + (seen-text? (_type_ text-id) symbol) + (mark-text-as-seen (_type_ text-id) none) + (got-buzzer? (_type_ game-task int) symbol) + (save-game! (_type_ game-save string) none) + (load-game! (_type_ game-save) game-save) + (clear-text-seen! (_type_ text-id) none) + (get-death-count (_type_ symbol) int) + (get-health-percent-lost (_type_ symbol) float) ) ) ;; definition for method 3 of type game-info -(defmethod inspect game-info ((this game-info)) +(defmethod inspect ((this game-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tmode: ~A~%" (-> this mode)) (format #t "~Tsave-name: ~A~%" (-> this save-name)) diff --git a/test/decompiler/reference/jak1/engine/game/game-info_REF.gc b/test/decompiler/reference/jak1/engine/game/game-info_REF.gc index 579830dfb9b..6691a674edf 100644 --- a/test/decompiler/reference/jak1/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/game-info_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type border-plane ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw! border-plane ((this border-plane)) +(defmethod debug-draw! ((this border-plane)) (let* ((v1-0 (-> this action)) (s5-0 (if (= v1-0 'load) (new 'static 'rgba :g #xff :a #x80) @@ -26,12 +26,12 @@ ) ;; definition for method 10 of type border-plane -(defmethod point-past-plane? border-plane ((this border-plane) (arg0 vector)) +(defmethod point-past-plane? ((this border-plane) (arg0 vector)) (>= (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) (-> this normal)) 0.0) ) ;; definition for method 11 of type game-info -(defmethod task-complete? game-info ((this game-info) (arg0 game-task)) +(defmethod task-complete? ((this game-info) (arg0 game-task)) (logtest? (-> this task-perm-list data arg0 status) (entity-perm-status real-complete)) ) @@ -52,7 +52,7 @@ ) ;; definition for method 17 of type game-info -(defmethod get-or-create-continue! game-info ((this game-info)) +(defmethod get-or-create-continue! ((this game-info)) (cond ((and (= (-> this mode) 'play) (-> this current-continue)) (-> this current-continue) @@ -74,7 +74,7 @@ ;; definition for method 18 of type game-info ;; INFO: Return type mismatch object vs continue-point. -(defmethod get-continue-by-name game-info ((this game-info) (arg0 string)) +(defmethod get-continue-by-name ((this game-info) (arg0 string)) (let ((s5-0 *level-load-list*)) (while (not (null? s5-0)) (let ((s4-0 (-> (the-as level-load-info (-> (the-as symbol (car s5-0)) value)) continues))) @@ -94,7 +94,7 @@ ) ;; definition for method 19 of type game-info -(defmethod set-continue! game-info ((this game-info) (arg0 basic)) +(defmethod set-continue! ((this game-info) (arg0 basic)) (let ((s5-0 (-> this current-continue))) (if (null? arg0) (set! arg0 #f) @@ -132,13 +132,13 @@ ) ;; definition for method 13 of type game-info -(defmethod get-entity-task-perm game-info ((this game-info) (arg0 game-task)) +(defmethod get-entity-task-perm ((this game-info) (arg0 game-task)) (-> this task-perm-list data arg0) ) ;; definition for method 9 of type game-info ;; INFO: Used lq/sq -(defmethod initialize! game-info ((this game-info) (cause symbol) (save-to-load game-save) (continue-point-override string)) +(defmethod initialize! ((this game-info) (cause symbol) (save-to-load game-save) (continue-point-override string)) (local-vars (v0-0 int) (sv-96 symbol)) (case cause (('dead) @@ -296,7 +296,7 @@ ) ;; definition for method 10 of type game-info -(defmethod adjust game-info ((this game-info) (item symbol) (amount float) (source handle)) +(defmethod adjust ((this game-info) (item symbol) (amount float) (source handle)) (case item (('life) (if (>= amount 0.0) @@ -378,12 +378,12 @@ ) ;; definition for method 23 of type game-info -(defmethod got-buzzer? game-info ((this game-info) (arg0 game-task) (arg1 int)) +(defmethod got-buzzer? ((this game-info) (arg0 game-task) (arg1 int)) (logtest? (get-reminder (get-task-control arg0) 0) (ash 1 arg1)) ) ;; definition for method 20 of type game-info -(defmethod buzzer-count game-info ((this game-info) (arg0 game-task)) +(defmethod buzzer-count ((this game-info) (arg0 game-task)) (let ((v1-1 (get-reminder (get-task-control arg0) 0)) (v0-2 0) ) @@ -397,13 +397,13 @@ ) ;; definition for method 21 of type game-info -(defmethod seen-text? game-info ((this game-info) (arg0 text-id)) +(defmethod seen-text? ((this game-info) (arg0 text-id)) (get-bit (-> this text-ids-seen) (the-as int arg0)) ) ;; definition for method 22 of type game-info ;; INFO: Return type mismatch int vs none. -(defmethod mark-text-as-seen game-info ((this game-info) (arg0 text-id)) +(defmethod mark-text-as-seen ((this game-info) (arg0 text-id)) (if (and (< (the-as uint arg0) (the-as uint 4095)) (> (the-as uint arg0) 0)) (set-bit (-> this text-ids-seen) (the-as int arg0)) ) @@ -413,7 +413,7 @@ ;; definition for method 26 of type game-info ;; INFO: Return type mismatch int vs none. -(defmethod clear-text-seen! game-info ((this game-info) (arg0 text-id)) +(defmethod clear-text-seen! ((this game-info) (arg0 text-id)) (clear-bit (-> this text-ids-seen) (the-as int arg0)) 0 (none) @@ -421,7 +421,7 @@ ;; definition for method 10 of type fact-info-target ;; INFO: Return type mismatch float vs none. -(defmethod reset! fact-info-target ((this fact-info-target) (arg0 symbol)) +(defmethod reset! ((this fact-info-target) (arg0 symbol)) (when (or (not arg0) (= arg0 'eco)) (set! (-> this eco-timeout) 0) (set! (-> this eco-level) 0.0) @@ -444,7 +444,7 @@ ) ;; definition for method 11 of type fact-info-target -(defmethod pickup-collectable! fact-info-target ((this fact-info-target) (kind pickup-type) (amount float) (source-handle handle)) +(defmethod pickup-collectable! ((this fact-info-target) (kind pickup-type) (amount float) (source-handle handle)) (case kind (((pickup-type eco-green)) (cond @@ -662,7 +662,7 @@ ) ;; definition for method 12 of type game-info -(defmethod lookup-entity-perm-by-aid game-info ((this game-info) (arg0 actor-id)) +(defmethod lookup-entity-perm-by-aid ((this game-info) (arg0 actor-id)) (let ((v1-0 (-> this perm-list))) (countdown (a0-1 (-> v1-0 length)) (if (= arg0 (-> v1-0 data a0-1 aid)) @@ -676,7 +676,7 @@ ;; definition for method 14 of type game-info ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod copy-perms-from-level! game-info ((this game-info) (lev level)) +(defmethod copy-perms-from-level! ((this game-info) (lev level)) (let ((perms (-> this perm-list)) (lev-entities (-> lev bsp level entity)) ) @@ -705,7 +705,7 @@ ;; definition for method 15 of type game-info ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod copy-perms-to-level! game-info ((this game-info) (lev level)) +(defmethod copy-perms-to-level! ((this game-info) (lev level)) (let ((lev-entities (-> lev bsp level entity))) (dotimes (lev-entity-idx (-> lev-entities length)) (let* ((lev-entity-perm (-> lev-entities data lev-entity-idx entity extra perm)) @@ -727,7 +727,7 @@ ) ;; definition for method 2 of type continue-point -(defmethod print continue-point ((this continue-point)) +(defmethod print ((this continue-point)) (format #t "#<~A ~S @ #x~X>" (-> this type) (-> this name) this) this ) @@ -735,7 +735,7 @@ ;; definition for method 9 of type continue-point ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw! continue-point ((this continue-point)) +(defmethod debug-draw! ((this continue-point)) (add-debug-x #t (bucket-id debug-no-zbuf) (-> this trans) (new 'static 'rgba :r #xff :a #x80)) (add-debug-text-3d #t @@ -1164,7 +1164,7 @@ ) ;; definition for method 16 of type game-info -(defmethod debug-print game-info ((this game-info) (arg0 symbol)) +(defmethod debug-print ((this game-info) (arg0 symbol)) (inspect this) (when (or (not arg0) (= arg0 'game-task)) (format #t "~Tgame-task:~%") @@ -1225,7 +1225,7 @@ ) ;; definition for method 27 of type game-info -(defmethod get-death-count game-info ((this game-info) (arg0 symbol)) +(defmethod get-death-count ((this game-info) (arg0 symbol)) (let ((v1-13 (if (and arg0 *target* (>= (-> *level-task-data-remap* length) (-> *target* current-level info index))) (the-as @@ -1242,6 +1242,6 @@ ) ;; definition for method 28 of type game-info -(defmethod get-health-percent-lost game-info ((this game-info) (arg0 symbol)) +(defmethod get-health-percent-lost ((this game-info) (arg0 symbol)) (* 0.25 (the float (get-death-count this #f))) ) diff --git a/test/decompiler/reference/jak1/engine/game/game-save_REF.gc b/test/decompiler/reference/jak1/engine/game/game-save_REF.gc index 4dc9efde68a..af4fb7482db 100644 --- a/test/decompiler/reference/jak1/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/game-save_REF.gc @@ -3,29 +3,26 @@ ;; definition of type game-save-tag (deftype game-save-tag (structure) - ((user-object object 2 :offset-assert 0) - (user-uint64 uint64 :offset 0) - (user-float0 float :offset 0) - (user-float float 2 :offset 0) - (user-int32 int32 2 :offset 0) - (user-uint32 uint32 2 :offset 0) - (user-int16 int16 4 :offset 0) - (user-uint16 uint16 4 :offset 0) - (user-int8 int8 8 :offset 0) - (user-int80 int8 :offset 0) - (user-int81 int8 :offset 1) - (user-uint8 uint8 8 :offset 0) - (elt-count int32 :offset-assert 8) - (elt-size uint16 :offset-assert 12) - (elt-type game-save-elt :offset-assert 14) + ((user-object object 2) + (user-uint64 uint64 :overlay-at (-> user-object 0)) + (user-float0 float :overlay-at (-> user-object 0)) + (user-float float 2 :overlay-at (-> user-object 0)) + (user-int32 int32 2 :overlay-at (-> user-object 0)) + (user-uint32 uint32 2 :overlay-at (-> user-object 0)) + (user-int16 int16 4 :overlay-at (-> user-object 0)) + (user-uint16 uint16 4 :overlay-at (-> user-object 0)) + (user-int8 int8 8 :overlay-at (-> user-object 0)) + (user-int80 int8 :overlay-at (-> user-object 0)) + (user-int81 int8 :overlay-at (-> user-int8 1)) + (user-uint8 uint8 8 :overlay-at (-> user-object 0)) + (elt-count int32) + (elt-size uint16) + (elt-type game-save-elt) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type game-save-tag -(defmethod inspect game-save-tag ((this game-save-tag)) +(defmethod inspect ((this game-save-tag)) (format #t "[~8x] ~A~%" this 'game-save-tag) (format #t "~Tuser-object[2] @ #x~X~%" (-> this user-object)) (format #t "~Tuser-uint64: ~D~%" (-> this user-uint64)) @@ -47,39 +44,36 @@ ;; definition of type game-save (deftype game-save (basic) - ((version int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (length int32 :offset-assert 12) - (info-int32 int32 16 :offset-assert 16) - (info-int8 int8 64 :offset 16) - (level-index int32 :offset 16) - (fuel-cell-count float :offset 20) - (money-count float :offset 24) - (buzzer-count float :offset 28) - (completion-percentage float :offset 32) - (minute uint8 :offset 36) - (hour uint8 :offset 37) - (week uint8 :offset 38) - (day uint8 :offset 39) - (month uint8 :offset 40) - (year uint8 :offset 41) - (new-game int32 :offset 44) - (tag game-save-tag :inline :dynamic :offset-assert 80) + ((version int32) + (allocated-length int32) + (length int32) + (info-int32 int32 16) + (info-int8 int8 64 :overlay-at (-> info-int32 0)) + (level-index int32 :overlay-at (-> info-int32 0)) + (fuel-cell-count float :overlay-at (-> info-int32 1)) + (money-count float :overlay-at (-> info-int32 2)) + (buzzer-count float :overlay-at (-> info-int32 3)) + (completion-percentage float :overlay-at (-> info-int32 4)) + (minute uint8 :overlay-at (-> info-int32 5)) + (hour uint8 :overlay-at (-> info-int8 21)) + (week uint8 :overlay-at (-> info-int8 22)) + (day uint8 :overlay-at (-> info-int8 23)) + (month uint8 :overlay-at (-> info-int32 6)) + (year uint8 :overlay-at (-> info-int8 25)) + (new-game int32 :overlay-at (-> info-int32 7)) + (tag game-save-tag :inline :dynamic) ) - :method-count-assert 12 - :size-assert #x50 - :flag-assert #xc00000050 (:methods - (new (symbol type int) _type_ 0) - (save-to-file (_type_ string) _type_ 9) - (load-from-file! (_type_ string) _type_ 10) - (debug-print (_type_ symbol) _type_ 11) + (new (symbol type int) _type_) + (save-to-file (_type_ string) _type_) + (load-from-file! (_type_ string) _type_) + (debug-print (_type_ symbol) _type_) ) ) ;; definition for method 3 of type game-save ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect game-save ((this game-save)) +(defmethod inspect ((this game-save)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tversion: ~D~%" (-> this version)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -104,7 +98,7 @@ ;; definition for method 5 of type game-save ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of game-save ((this game-save)) +(defmethod asize-of ((this game-save)) (the-as int (+ (-> game-save size) (-> this allocated-length))) ) @@ -265,7 +259,7 @@ ;; definition for method 11 of type game-save ;; INFO: Used lq/sq -(defmethod debug-print game-save ((this game-save) (detail symbol)) +(defmethod debug-print ((this game-save) (detail symbol)) (local-vars (sv-16 int)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tversion: ~D~%" (-> this version)) @@ -384,13 +378,13 @@ ;; definition for method 3 of type game-save ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect game-save ((this game-save)) +(defmethod inspect ((this game-save)) (debug-print this #f) ) ;; definition for method 24 of type game-info ;; INFO: Return type mismatch game-save vs none. -(defmethod save-game! game-info ((this game-info) (arg0 game-save) (arg1 string)) +(defmethod save-game! ((this game-info) (arg0 game-save) (arg1 string)) (dotimes (s3-0 (-> *level* length)) (let ((a1-1 (-> *level* level s3-0))) (if (= (-> a1-1 status) 'active) @@ -849,7 +843,7 @@ ) ;; definition for method 25 of type game-info -(defmethod load-game! game-info ((this game-info) (save game-save)) +(defmethod load-game! ((this game-info) (save game-save)) (let ((save-data (the-as game-save-tag (-> save tag)))) (while (< (the-as int save-data) (the-as int (&-> save tag 0 user-int8 (-> save length)))) (case (-> save-data elt-type) @@ -1110,7 +1104,7 @@ ) ;; definition for method 9 of type game-save -(defmethod save-to-file game-save ((this game-save) (arg0 string)) +(defmethod save-to-file ((this game-save) (arg0 string)) (let ((s5-0 (new 'stack 'file-stream arg0 'write))) (file-stream-write s5-0 (&-> this type) (+ (-> this type size) (-> this length))) (file-stream-close s5-0) @@ -1119,7 +1113,7 @@ ) ;; definition for method 10 of type game-save -(defmethod load-from-file! game-save ((this game-save) (filename string)) +(defmethod load-from-file! ((this game-save) (filename string)) (let ((stream (new 'stack 'file-stream filename 'read))) (let ((in-size (file-stream-length stream)) (my-size (-> this allocated-length)) @@ -1187,37 +1181,33 @@ ;; definition of type auto-save (deftype auto-save (process) - ((card int32 :offset-assert 112) - (slot int32 :offset-assert 116) - (which int32 :offset-assert 120) - (buffer kheap :offset-assert 124) - (mode basic :offset-assert 128) - (result mc-status-code :offset-assert 132) - (save game-save :offset-assert 136) - (info mc-slot-info :inline :offset-assert 140) - (notify handle :offset-assert 440) - (state-time time-frame :offset-assert 448) - (part sparticle-launch-control :offset-assert 456) + ((card int32) + (slot int32) + (which int32) + (buffer kheap) + (mode basic) + (result mc-status-code) + (save game-save) + (info mc-slot-info :inline) + (notify handle) + (state-time time-frame) + (part sparticle-launch-control) ) - :heap-base #x160 - :method-count-assert 23 - :size-assert #x1cc - :flag-assert #x17016001cc - (:methods - (get-heap () _type_ :state 14) - (get-card () _type_ :state 15) - (format-card () _type_ :state 16) - (create-file () _type_ :state 17) - (save () _type_ :state 18) - (restore () _type_ :state 19) - (error (mc-status-code) _type_ :state 20) - (done () _type_ :state 21) - (unformat-card () _type_ :state 22) + (:state-methods + get-heap + get-card + format-card + create-file + save + restore + (error mc-status-code) + done + unformat-card ) ) ;; definition for method 3 of type auto-save -(defmethod inspect auto-save ((this auto-save)) +(defmethod inspect ((this auto-save)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -1236,7 +1226,7 @@ ) ;; definition for method 10 of type auto-save -(defmethod deactivate auto-save ((this auto-save)) +(defmethod deactivate ((this auto-save)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) @@ -1246,7 +1236,7 @@ ;; definition for method 7 of type auto-save ;; INFO: Return type mismatch process vs auto-save. -(defmethod relocate auto-save ((this auto-save) (arg0 int)) +(defmethod relocate ((this auto-save) (arg0 int)) (if (nonzero? (-> this part)) (&+! (-> this part) arg0) ) diff --git a/test/decompiler/reference/jak1/engine/game/main-h_REF.gc b/test/decompiler/reference/jak1/engine/game/main-h_REF.gc index f60b4a3aed0..5d9b36d2622 100644 --- a/test/decompiler/reference/jak1/engine/game/main-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/main-h_REF.gc @@ -285,16 +285,13 @@ ;; definition of type frame-stats (deftype frame-stats (structure) - ((field-time time-frame 2 :offset-assert 0) - (field int32 :offset-assert 16) + ((field-time time-frame 2) + (field int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type frame-stats -(defmethod inspect frame-stats ((this frame-stats)) +(defmethod inspect ((this frame-stats)) (format #t "[~8x] ~A~%" this 'frame-stats) (format #t "~Tfield-time[2] @ #x~X~%" (-> this field-time)) (format #t "~Tfield: ~D~%" (-> this field)) @@ -306,19 +303,16 @@ ;; definition of type screen-filter (deftype screen-filter (basic) - ((draw? basic :offset-assert 4) - (color rgba :offset-assert 8) + ((draw? basic) + (color rgba) ) - :method-count-assert 10 - :size-assert #xc - :flag-assert #xa0000000c (:methods - (draw (_type_) none 9) + (draw (_type_) none) ) ) ;; definition for method 3 of type screen-filter -(defmethod inspect screen-filter ((this screen-filter)) +(defmethod inspect ((this screen-filter)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tdraw?: ~A~%" (-> this draw?)) (format #t "~Tcolor: ~D~%" (-> this color)) diff --git a/test/decompiler/reference/jak1/engine/game/main_REF.gc b/test/decompiler/reference/jak1/engine/game/main_REF.gc index a447a4f0424..e065c4fc346 100644 --- a/test/decompiler/reference/jak1/engine/game/main_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/main_REF.gc @@ -249,7 +249,7 @@ ;; definition for method 9 of type screen-filter ;; INFO: Return type mismatch pointer vs none. -(defmethod draw screen-filter ((this screen-filter)) +(defmethod draw ((this screen-filter)) (let* ((buf (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-0 (-> buf base)) ) diff --git a/test/decompiler/reference/jak1/engine/game/powerups_REF.gc b/test/decompiler/reference/jak1/engine/game/powerups_REF.gc index c7d59946c86..d612ce66702 100644 --- a/test/decompiler/reference/jak1/engine/game/powerups_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/powerups_REF.gc @@ -612,18 +612,18 @@ (set! (-> a0-33 settings shadow-dir y) (-> v1-67 y)) (set! (-> a0-33 settings shadow-dir z) (-> v1-67 z)) ) - (when (and (!= (-> self fact-info-target eco-level) 0.0) - (>= (- (-> *display* game-frame-counter) (-> self fact-info-target eco-pickup-time)) - (the-as time-frame (-> self fact-info-target eco-timeout)) + (when (and (!= (-> self fact eco-level) 0.0) + (>= (- (-> *display* game-frame-counter) (-> self fact eco-pickup-time)) + (the-as time-frame (-> self fact eco-timeout)) ) ) - (set! (-> self fact-info-target eco-level) 0.0) - (set! (-> self fact-info-target eco-timeout) 0) + (set! (-> self fact eco-level) 0.0) + (set! (-> self fact eco-timeout) 0) (logclear! (-> self state-flags) (state-flags invuln-powerup)) (send-event self 'reset-collide) (stop! (-> self sound)) ) - (when (and (< 0.0 (-> self fact-info-target eco-level)) + (when (and (< 0.0 (-> self fact eco-level)) (not (logtest? (-> self state-flags) (state-flags first-person-mode))) (not (logtest? (-> self draw status) (draw-status hidden no-anim))) (not (movie?)) @@ -631,8 +631,8 @@ (lerp-scale 0.0 1.0 - (the float (- (-> self fact-info-target eco-timeout) - (the-as uint (- (-> *display* game-frame-counter) (-> self fact-info-target eco-pickup-time))) + (the float (- (-> self fact eco-timeout) + (the-as uint (- (-> *display* game-frame-counter) (-> self fact eco-pickup-time))) ) ) 0.0 @@ -640,7 +640,7 @@ ) ) ) - (case (-> self fact-info-target eco-type) + (case (-> self fact eco-type) (((pickup-type eco-yellow)) (change-sound! (-> self sound) (static-sound-name "yel-eco-jak")) (let ((s4-0 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) diff --git a/test/decompiler/reference/jak1/engine/game/projectiles-h_REF.gc b/test/decompiler/reference/jak1/engine/game/projectiles-h_REF.gc index 50cfd842987..e2faa7146d0 100644 --- a/test/decompiler/reference/jak1/engine/game/projectiles-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/projectiles-h_REF.gc @@ -3,49 +3,47 @@ ;; definition of type projectile (deftype projectile (process-drawable) - ((root-override collide-shape-moving :offset 112) - (base-trans vector :inline :offset-assert 176) - (target vector :inline :offset-assert 192) - (target-base vector :inline :offset-assert 208) - (parent-base vector :inline :offset-assert 224) - (parent-quat vector :inline :offset-assert 240) - (base-vector vector :inline :offset-assert 256) - (timeout time-frame :offset-assert 272) - (options uint64 :offset-assert 280) - (last-target handle :offset-assert 288) - (notify-handle handle :offset-assert 296) - (max-speed float :offset-assert 304) - (max-turn float :offset-assert 308) - (old-dist float 16 :offset-assert 312) - (old-dist-count int32 :offset-assert 376) - (hits int32 :offset-assert 380) - (max-hits int32 :offset-assert 384) - (tween float :offset-assert 388) - (attack-mode symbol :offset-assert 392) - (update-velocity (function projectile none) :offset-assert 396) - (counter int32 :offset-assert 400) - (target-count int32 :offset-assert 404) - (sound-id sound-id :offset-assert 408) + ((root collide-shape-moving :override) + (base-trans vector :inline) + (target vector :inline) + (target-base vector :inline) + (parent-base vector :inline) + (parent-quat vector :inline) + (base-vector vector :inline) + (timeout time-frame) + (options uint64) + (last-target handle) + (notify-handle handle) + (max-speed float) + (max-turn float) + (old-dist float 16) + (old-dist-count int32) + (hits int32) + (max-hits int32) + (tween float) + (attack-mode symbol) + (update-velocity (function projectile none)) + (counter int32) + (target-count int32) + (sound-id sound-id) ) - :heap-base #x130 - :method-count-assert 29 - :size-assert #x19c - :flag-assert #x1d0130019c + (:state-methods + projectile-die + projectile-dissipate + projectile-impact + projectile-moving + ) (:methods - (projectile-die () _type_ :state 20) - (projectile-dissipate () _type_ :state 21) - (projectile-impact () _type_ :state 22) - (projectile-moving () _type_ :state 23) - (projectile-method-24 (_type_) none 24) - (projectile-method-25 (_type_) none 25) - (projectile-method-26 (_type_) none 26) - (projectile-method-27 (_type_) none 27) - (projectile-method-28 (_type_) none 28) + (projectile-method-24 (_type_) none) + (projectile-method-25 (_type_) none) + (projectile-method-26 (_type_) none) + (projectile-method-27 (_type_) none) + (projectile-method-28 (_type_) none) ) ) ;; definition for method 3 of type projectile -(defmethod inspect projectile ((this projectile)) +(defmethod inspect ((this projectile)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -76,17 +74,13 @@ ;; definition of type projectile-yellow (deftype projectile-yellow (projectile) - ((mode int32 :offset-assert 412) - (angle float :offset-assert 416) + ((mode int32) + (angle float) ) - :heap-base #x140 - :method-count-assert 29 - :size-assert #x1a4 - :flag-assert #x1d014001a4 ) ;; definition for method 3 of type projectile-yellow -(defmethod inspect projectile-yellow ((this projectile-yellow)) +(defmethod inspect ((this projectile-yellow)) (let ((t9-0 (method-of-type projectile inspect))) (t9-0 this) ) @@ -97,17 +91,13 @@ ;; definition of type projectile-blue (deftype projectile-blue (projectile) - ((mode int32 :offset-assert 412) - (joint-num int32 :offset-assert 416) + ((mode int32) + (joint-num int32) ) - :heap-base #x140 - :method-count-assert 29 - :size-assert #x1a4 - :flag-assert #x1d014001a4 ) ;; definition for method 3 of type projectile-blue -(defmethod inspect projectile-blue ((this projectile-blue)) +(defmethod inspect ((this projectile-blue)) (let ((t9-0 (method-of-type projectile inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc b/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc index 036097521c7..06deb6d08a1 100644 --- a/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc @@ -3,25 +3,22 @@ ;; definition of type search-info (deftype search-info (structure) - ((point vector :inline :offset-assert 0) - (best-point vector :inline :offset-assert 16) - (match-handle handle :offset-assert 32) - (match projectile :offset-assert 40) - (best float :offset-assert 44) - (radius float :offset-assert 48) - (rating uint32 :offset-assert 52) - (require uint32 :offset-assert 56) - (mask uint32 :offset-assert 60) - (rot-base vector :inline :offset-assert 64) - (rot-range float :offset-assert 80) + ((point vector :inline) + (best-point vector :inline) + (match-handle handle) + (match projectile) + (best float) + (radius float) + (rating uint32) + (require uint32) + (mask uint32) + (rot-base vector :inline) + (rot-range float) ) - :method-count-assert 9 - :size-assert #x54 - :flag-assert #x900000054 ) ;; definition for method 3 of type search-info -(defmethod inspect search-info ((this search-info)) +(defmethod inspect ((this search-info)) (format #t "[~8x] ~A~%" this 'search-info) (format #t "~Tpoint: ~`vector`P~%" (-> this point)) (format #t "~Tbest-point: ~`vector`P~%" (-> this best-point)) @@ -69,7 +66,7 @@ ) ) (when s5-0 - (let* ((s3-0 (-> s5-0 root-override)) + (let* ((s3-0 (-> s5-0 root)) (s4-1 (if (and (nonzero? s3-0) (type-type? (-> s3-0 type) collide-shape)) s3-0 ) @@ -627,15 +624,15 @@ ;; definition for method 24 of type projectile ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-24 projectile ((this projectile)) - (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) +(defmethod projectile-method-24 ((this projectile)) + (spawn (-> this part) (the-as vector (-> this root root-prim prim-core))) 0 (none) ) ;; definition for method 28 of type projectile ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-28 projectile ((this projectile)) +(defmethod projectile-method-28 ((this projectile)) 0 (none) ) @@ -700,7 +697,7 @@ ((-> self update-velocity) self) (when (logtest? (-> self options) 2) (seek! (-> self tween) 1.0 (* 0.5 (seconds-per-frame))) - (let ((f0-6 (vector-vector-distance (-> self root-override trans) (-> self target)))) + (let ((f0-6 (vector-vector-distance (-> self root trans) (-> self target)))) (cond ((< f0-6 20480.0) (seek! (-> self tween) 1.0 (* 3.0 (seconds-per-frame))) @@ -712,14 +709,10 @@ ) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> self root-override trans quad)) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (-> self root-override root-prim collide-with) - ) + (set! (-> s3-0 quad) (-> self root trans quad)) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (-> self root root-prim collide-with)) (set! (-> self old-dist (-> self old-dist-count)) - (* 0.0625 (vector-vector-distance s3-0 (-> self root-override trans))) + (* 0.0625 (vector-vector-distance s3-0 (-> self root trans))) ) ) (set! (-> self old-dist-count) (logand (+ (-> self old-dist-count) 1) 15)) @@ -727,9 +720,7 @@ (countdown (v1-35 16) (+! f0-16 (-> self old-dist v1-35)) ) - (if (or (and (logtest? (-> self root-override status) (cshape-moving-flags twall)) (< f0-16 2048.0)) - (< f0-16 204.8) - ) + (if (or (and (logtest? (-> self root status) (cshape-moving-flags twall)) (< f0-16 2048.0)) (< f0-16 204.8)) (set! gp-0 #t) ) ) @@ -748,13 +739,13 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. (defun projectile-update-velocity-space-wars ((arg0 projectile)) - (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target) (-> arg0 root-override trans)))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target) (-> arg0 root trans)))) (let ((s4-0 (new 'stack-no-clear 'vector)) - (s3-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) - (f30-0 (vector-length (-> arg0 root-override transv))) + (s3-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root transv) 1.0)) + (f30-0 (vector-length (-> arg0 root transv))) ) - (if (logtest? (-> arg0 root-override status) (cshape-moving-flags tsurf)) - (vector-flatten! s5-1 s5-1 (-> arg0 root-override local-normal)) + (if (logtest? (-> arg0 root status) (cshape-moving-flags tsurf)) + (vector-flatten! s5-1 s5-1 (-> arg0 root local-normal)) ) (vector-normalize-copy! s4-0 s5-1 1.0) (if (and (or (not (handle->process (-> arg0 last-target))) @@ -764,20 +755,17 @@ ) (go (method-of-object arg0 projectile-dissipate)) ) - (vector-deg-slerp (-> arg0 root-override transv) s3-0 s4-0 (-> arg0 tween)) - (vector-normalize! (-> arg0 root-override transv) f30-0) + (vector-deg-slerp (-> arg0 root transv) s3-0 s4-0 (-> arg0 tween)) + (vector-normalize! (-> arg0 root transv) f30-0) ) - (vector+! (-> arg0 root-override transv) (-> arg0 root-override transv) s5-1) - ) - (vector-v++! - (-> arg0 root-override transv) - (compute-acc-due-to-gravity (-> arg0 root-override) (new-stack-vector0) 0.0) + (vector+! (-> arg0 root transv) (-> arg0 root transv) s5-1) ) - (if (< (-> arg0 max-speed) (vector-length (-> arg0 root-override transv))) - (vector-normalize! (-> arg0 root-override transv) (-> arg0 max-speed)) + (vector-v++! (-> arg0 root transv) (compute-acc-due-to-gravity (-> arg0 root) (new-stack-vector0) 0.0)) + (if (< (-> arg0 max-speed) (vector-length (-> arg0 root transv))) + (vector-normalize! (-> arg0 root transv) (-> arg0 max-speed)) ) (if (logtest? (-> arg0 options) 1) - (set! (-> arg0 root-override transv y) -40960.0) + (set! (-> arg0 root transv y) -40960.0) ) 0 (none) @@ -795,7 +783,7 @@ #f #f #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to *entity-pool* ) (if (nonzero? (-> self sound-id)) @@ -819,7 +807,7 @@ #f #f #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to *entity-pool* ) (if (nonzero? (-> self sound-id)) @@ -833,14 +821,14 @@ ;; definition for method 27 of type projectile ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-27 projectile ((this projectile)) +(defmethod projectile-method-27 ((this projectile)) 0 (none) ) ;; definition for method 26 of type projectile ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-26 projectile ((this projectile)) +(defmethod projectile-method-26 ((this projectile)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) @@ -859,7 +847,7 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -867,7 +855,7 @@ ;; definition for method 25 of type projectile ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-25 projectile ((this projectile)) +(defmethod projectile-method-25 ((this projectile)) (go (method-of-object this projectile-moving)) 0 (none) @@ -887,7 +875,7 @@ ) ;; definition for method 10 of type projectile -(defmethod deactivate projectile ((this projectile)) +(defmethod deactivate ((this projectile)) (if (nonzero? (-> this sound-id)) (sound-stop (-> this sound-id)) ) @@ -913,21 +901,21 @@ (set! (-> self old-dist v1-4) 4095996000.0) ) (projectile-method-26 self) - (set! (-> self root-override dynam gravity y) 1228800.0) - (set! (-> self root-override dynam gravity-length) 1228800.0) - (set! (-> self root-override dynam gravity-max) 1228800.0) - (set! (-> self root-override trans quad) (-> arg1 quad)) + (set! (-> self root dynam gravity y) 1228800.0) + (set! (-> self root dynam gravity-length) 1228800.0) + (set! (-> self root dynam gravity-max) 1228800.0) + (set! (-> self root trans quad) (-> arg1 quad)) (set! (-> self base-trans quad) (-> arg1 quad)) (set! (-> self parent-base quad) (-> arg1 quad)) - (quaternion-copy! (-> self root-override quat) (-> (the-as process-drawable (-> self parent 0)) root quat)) + (quaternion-copy! (-> self root quat) (-> (the-as process-drawable (-> self parent 0)) root quat)) (quaternion-copy! (the-as quaternion (-> self parent-quat)) (-> (the-as process-drawable (-> self parent 0)) root quat) ) - (vector-identity! (-> self root-override scale)) - (set! (-> self root-override transv quad) (-> arg2 quad)) + (vector-identity! (-> self root scale)) + (set! (-> self root transv quad) (-> arg2 quad)) (vector-normalize-copy! (-> self base-vector) arg2 1.0) - (vector+float*! (-> self target) (-> self root-override trans) (-> self root-override transv) 2.0) + (vector+float*! (-> self target) (-> self root trans) (-> self root transv) 2.0) (set! (-> self target-base quad) (-> self target quad)) (projectile-method-27 self) (projectile-method-24 self) @@ -935,7 +923,7 @@ (let ((a1-8 (new 'stack-no-clear 'collide-edge-hold-list))) (set! (-> a1-8 num-allocs) (the-as uint 1)) (set! (-> a1-8 num-attempts) (the-as uint *touching-list*)) - (find-overlapping-shapes (-> self root-override) (the-as overlaps-others-params a1-8)) + (find-overlapping-shapes (-> self root) (the-as overlaps-others-params a1-8)) ) ) (set! (-> self event-hook) (-> (method-of-object self projectile-moving) event)) @@ -946,21 +934,21 @@ ;; definition for method 27 of type projectile-yellow ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-27 projectile-yellow ((this projectile-yellow)) +(defmethod projectile-method-27 ((this projectile-yellow)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (set! (-> this attack-mode) 'eco-yellow) (set! (-> this mode) 1) - (set! (-> this max-speed) (vector-length (-> this root-override transv))) + (set! (-> this max-speed) (vector-length (-> this root transv))) (set! (-> this update-velocity) projectile-update-velocity-space-wars) - (set! (-> this angle) (vector-y-angle (-> this root-override transv))) + (set! (-> this angle) (vector-y-angle (-> this root transv))) (set! (-> this tween) 0.05) (logior! (-> this options) 2) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root-override trans quad)) - (+! (-> this root-override trans y) -5324.8) - (vector+float*! (-> this target) (-> this root-override trans) (-> this root-override transv) 2.0) + (set! (-> s5-0 quad) (-> this root trans quad)) + (+! (-> this root trans y) -5324.8) + (vector+float*! (-> this target) (-> this root trans) (-> this root transv) 2.0) (set! (-> this target-base quad) (-> this target quad)) - (let ((f30-0 (the float (sar (shl (the int (y-angle (-> this root-override))) 48) 48)))) + (let ((f30-0 (the float (sar (shl (the int (y-angle (-> this root))) 48) 48)))) (set! (-> this mask) (the-as process-mask (logior (process-mask projectile) (-> this mask)))) (if (logtest? (-> this options) 16) (set! (-> this max-hits) 1) @@ -990,22 +978,22 @@ 10240.0 ) ) - (logior! (-> this root-override root-prim collide-with) (collide-kind water)) + (logior! (-> this root root-prim collide-with) (collide-kind water)) ) (('ogre) (when (not (logtest? (-> this options) 128)) (set! (-> this water) (new 'process 'water-control this 0 0.0 8192.0 2048.0)) (set! (-> this water flags) (water-flags wt01 wt04 wt07)) (set! (-> this water height) 129024.0) - (logior! (-> this root-override root-prim collide-with) (collide-kind water)) + (logior! (-> this root root-prim collide-with) (collide-kind water)) ) ) (('finalboss) - (+! (-> this root-override trans y) 4096.0) + (+! (-> this root trans y) 4096.0) (set! (-> this water) (new 'process 'water-control this 0 0.0 8192.0 2048.0)) (set! (-> this water flags) (water-flags wt01 wt04 wt07)) (set! (-> this water height) 1977958.4) - (logior! (-> this root-override root-prim collide-with) (collide-kind water)) + (logior! (-> this root root-prim collide-with) (collide-kind water)) ) ) ) @@ -1015,31 +1003,31 @@ ;; definition for method 26 of type projectile-yellow ;; INFO: Return type mismatch collide-kind vs none. -(defmethod projectile-method-26 projectile-yellow ((this projectile-yellow)) +(defmethod projectile-method-26 ((this projectile-yellow)) (let ((t9-0 (method-of-type projectile projectile-method-26))) (t9-0 this) ) - (logior! (-> this root-override root-prim collide-with) (collide-kind mother-spider)) + (logior! (-> this root root-prim collide-with) (collide-kind mother-spider)) (none) ) ;; definition for method 24 of type projectile-yellow ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-24 projectile-yellow ((this projectile-yellow)) +(defmethod projectile-method-24 ((this projectile-yellow)) (with-pp (find-ground-and-draw-shadow - (-> this root-override trans) - (-> this root-override shadow-pos) + (-> this root trans) + (-> this root shadow-pos) 8192.0 (collide-kind background) (the-as process-drawable #f) 12288.0 81920.0 ) - (if (< (-> this root-override trans y) (-> this root-override shadow-pos y)) - (set! (-> this root-override trans y) (+ 1228.8 (-> this root-override shadow-pos y))) + (if (< (-> this root trans y) (-> this root shadow-pos y)) + (set! (-> this root trans y) (+ 1228.8 (-> this root shadow-pos y))) ) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> *part-id-table* 353 init-specs 16 initial-valuef) (the-as float 30)) (set! (-> *part-id-table* 353 init-specs 16 random-rangef) (the-as float 300)) (cond @@ -1050,17 +1038,17 @@ (set! (-> *part-id-table* 353 init-specs 16 random-rangef) (the-as float 0)) 0 ) - (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) + (spawn (-> this part) (the-as vector (-> this root root-prim prim-core))) ) ) (else - (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) + (spawn (-> this part) (the-as vector (-> this root root-prim prim-core))) ) ) (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) (set! (-> s5-0 id) (-> this sound-id)) - (let ((a1-3 (-> this root-override trans))) + (let ((a1-3 (-> this root trans))) (let ((gp-1 pp)) (when (= a1-3 #t) (if (and gp-1 (type-type? (-> gp-1 type) process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root))) @@ -1082,7 +1070,7 @@ ;; definition for method 28 of type projectile-yellow ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-28 projectile-yellow ((this projectile-yellow)) +(defmethod projectile-method-28 ((this projectile-yellow)) (cond ((or (not (handle->process (-> this last-target))) (zero? (-> (the-as target (handle->process (-> this last-target))) control root-prim prim-core collide-as)) @@ -1133,7 +1121,7 @@ ) (set! (-> this last-target) (process->handle s5-0)) (when s5-0 - (set! (-> this target quad) (-> s5-0 root-override root-prim prim-core world-sphere quad)) + (set! (-> this target quad) (-> s5-0 root root-prim prim-core world-sphere quad)) (if (= (-> s5-0 type symbol) 'mother-spider) (logand! (-> this options) -2) ) @@ -1149,8 +1137,8 @@ (let ((a1-8 (handle->process (-> this last-target)))) (set! (-> this target quad) (-> (the-as target a1-8) control root-prim prim-core world-sphere quad)) ) - (if (and (< (vector-vector-xz-distance (-> this root-override trans) (-> this target)) 20480.0) - (< 24576.0 (fabs (- (-> this target y) (-> this root-override trans y)))) + (if (and (< (vector-vector-xz-distance (-> this root trans) (-> this target)) 20480.0) + (< 24576.0 (fabs (- (-> this target y) (-> this root trans y)))) ) (set! (-> this last-target) (the-as handle #f)) ) @@ -1164,18 +1152,18 @@ ;; definition for method 27 of type projectile-blue ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-27 projectile-blue ((this projectile-blue)) +(defmethod projectile-method-27 ((this projectile-blue)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (sound-play "blue-eco-on") (set! (-> this mode) 2) (set! (-> this max-speed) (-> *TARGET-bank* yellow-projectile-speed)) (set! (-> this update-velocity) projectile-update-velocity-space-wars) - (+! (-> this root-override trans y) -5324.8) - (vector+float*! (-> this target) (-> this root-override trans) (-> this root-override transv) 2.0) + (+! (-> this root trans y) -5324.8) + (vector+float*! (-> this target) (-> this root trans) (-> this root transv) 2.0) (set! (-> this target-base quad) (-> this target quad)) (set! (-> this mask) (the-as process-mask (logior (process-mask ambient) (-> this mask)))) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 42) this)) - (set! (-> this root-override root-prim collide-with) (collide-kind background)) + (set! (-> this root root-prim collide-with) (collide-kind background)) (let* ((s5-1 (handle->process (-> this last-target))) (v1-20 (if (and (nonzero? s5-1) (type-type? (-> s5-1 type) process-drawable)) s5-1 @@ -1192,7 +1180,7 @@ ;; definition for method 26 of type projectile-blue ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-26 projectile-blue ((this projectile-blue)) +(defmethod projectile-method-26 ((this projectile-blue)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) @@ -1211,7 +1199,7 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1271,7 +1259,7 @@ ;; definition for method 28 of type projectile-blue ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-28 projectile-blue ((this projectile-blue)) +(defmethod projectile-method-28 ((this projectile-blue)) (let* ((s5-0 (handle->process (-> this last-target))) (v1-4 (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) process-drawable)) s5-0 @@ -1282,7 +1270,7 @@ (vector<-cspace! (-> this target) (-> (the-as process-drawable v1-4) node-list data (-> this joint-num))) ) ) - (if (< (vector-vector-distance (-> this target) (-> this root-override trans)) 4096.0) + (if (< (vector-vector-distance (-> this target) (-> this root trans)) 4096.0) (go (method-of-object this projectile-impact)) ) 0 @@ -1291,9 +1279,9 @@ ;; definition for method 24 of type projectile-blue ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-24 projectile-blue ((this projectile-blue)) +(defmethod projectile-method-24 ((this projectile-blue)) (if (rand-vu-percent? 0.75) - (eco-blue-glow (the-as vector (-> this root-override root-prim prim-core))) + (eco-blue-glow (the-as vector (-> this root root-prim prim-core))) ) 0 (none) diff --git a/test/decompiler/reference/jak1/engine/game/settings-h_REF.gc b/test/decompiler/reference/jak1/engine/game/settings-h_REF.gc index 7e2010005ae..0cce0804545 100644 --- a/test/decompiler/reference/jak1/engine/game/settings-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/settings-h_REF.gc @@ -3,55 +3,52 @@ ;; definition of type setting-data (deftype setting-data (structure) - ((border-mode symbol :offset-assert 0) - (sfx-volume float :offset-assert 4) - (music-volume float :offset-assert 8) - (dialog-volume float :offset-assert 12) - (process-mask process-mask :offset-assert 16) - (common-page int32 :offset-assert 20) - (language language-enum :offset-assert 24) - (screenx int32 :offset-assert 32) - (screeny int32 :offset-assert 36) - (vibration symbol :offset-assert 40) - (play-hints symbol :offset-assert 44) - (movie (pointer process) :offset-assert 48) - (talking (pointer process) :offset-assert 52) - (spooling (pointer process) :offset-assert 56) - (hint (pointer process) :offset-assert 60) - (ambient (pointer process) :offset-assert 64) - (video-mode symbol :offset-assert 68) - (aspect-ratio symbol :offset-assert 72) - (sound-flava uint8 :offset-assert 76) - (auto-save symbol :offset-assert 80) - (music-volume-movie float :offset-assert 84) - (sfx-volume-movie float :offset-assert 88) - (music symbol :offset-assert 92) - (bg-r float :offset-assert 96) - (bg-g float :offset-assert 100) - (bg-b float :offset-assert 104) - (bg-a float :offset-assert 108) - (bg-a-speed float :offset-assert 112) - (bg-a-force float :offset-assert 116) - (allow-progress symbol :offset-assert 120) - (allow-pause symbol :offset-assert 124) - (sound-flava-priority float :offset-assert 128) - (ocean-off symbol :offset-assert 132) - (allow-look-around symbol :offset-assert 136) - (ambient-volume float :offset-assert 140) - (ambient-volume-movie float :offset-assert 144) - (dialog-volume-hint float :offset-assert 148) - (dummy uint32 11 :offset-assert 152) + ((border-mode symbol) + (sfx-volume float) + (music-volume float) + (dialog-volume float) + (process-mask process-mask) + (common-page int32) + (language language-enum) + (screenx int32) + (screeny int32) + (vibration symbol) + (play-hints symbol) + (movie (pointer process)) + (talking (pointer process)) + (spooling (pointer process)) + (hint (pointer process)) + (ambient (pointer process)) + (video-mode symbol) + (aspect-ratio symbol) + (sound-flava uint8) + (auto-save symbol) + (music-volume-movie float) + (sfx-volume-movie float) + (music symbol) + (bg-r float) + (bg-g float) + (bg-b float) + (bg-a float) + (bg-a-speed float) + (bg-a-force float) + (allow-progress symbol) + (allow-pause symbol) + (sound-flava-priority float) + (ocean-off symbol) + (allow-look-around symbol) + (ambient-volume float) + (ambient-volume-movie float) + (dialog-volume-hint float) + (dummy uint32 11) ) - :method-count-assert 10 - :size-assert #xc4 - :flag-assert #xa000000c4 (:methods - (update-from-engine (_type_ engine) setting-data 9) + (update-from-engine (_type_ engine) setting-data) ) ) ;; definition for method 3 of type setting-data -(defmethod inspect setting-data ((this setting-data)) +(defmethod inspect ((this setting-data)) (format #t "[~8x] ~A~%" this 'setting-data) (format #t "~Tborder-mode: ~A~%" (-> this border-mode)) (format #t "~Tsfx-volume: ~f~%" (-> this sfx-volume)) @@ -96,26 +93,23 @@ ;; definition of type setting-control (deftype setting-control (basic) - ((current setting-data :inline :offset-assert 16) - (target setting-data :inline :offset-assert 224) - (default setting-data :inline :offset-assert 432) - (engine engine :offset-assert 628) + ((current setting-data :inline) + (target setting-data :inline) + (default setting-data :inline) + (engine engine) ) - :method-count-assert 14 - :size-assert #x278 - :flag-assert #xe00000278 (:methods - (new (symbol type int) _type_ 0) - (add-setting (_type_ process symbol object object object) none 9) - (set-setting (_type_ process symbol object object object) none 10) - (remove-setting (_type_ process symbol) none 11) - (apply-settings (_type_) setting-data 12) - (update (_type_) setting-data 13) + (new (symbol type int) _type_) + (add-setting (_type_ process symbol object object object) none) + (set-setting (_type_ process symbol object object object) none) + (remove-setting (_type_ process symbol) none) + (apply-settings (_type_) setting-data) + (update (_type_) setting-data) ) ) ;; definition for method 3 of type setting-control -(defmethod inspect setting-control ((this setting-control)) +(defmethod inspect ((this setting-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tcurrent: #~%" (-> this current)) (format #t "~Ttarget: #~%" (-> this target)) @@ -134,22 +128,19 @@ ;; definition of type scf-time (deftype scf-time (structure) - ((stat uint8 :offset-assert 0) - (second uint8 :offset-assert 1) - (minute uint8 :offset-assert 2) - (hour uint8 :offset-assert 3) - (week uint8 :offset-assert 4) - (day uint8 :offset-assert 5) - (month uint8 :offset-assert 6) - (year uint8 :offset-assert 7) + ((stat uint8) + (second uint8) + (minute uint8) + (hour uint8) + (week uint8) + (day uint8) + (month uint8) + (year uint8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type scf-time -(defmethod inspect scf-time ((this scf-time)) +(defmethod inspect ((this scf-time)) (format #t "[~8x] ~A~%" this 'scf-time) (format #t "~Tstat: ~D~%" (-> this stat)) (format #t "~Tsecond: #x~X~%" (-> this second)) diff --git a/test/decompiler/reference/jak1/engine/game/settings_REF.gc b/test/decompiler/reference/jak1/engine/game/settings_REF.gc index 59523637378..beeb2e3983f 100644 --- a/test/decompiler/reference/jak1/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/settings_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 9 of type setting-data -(defmethod update-from-engine setting-data ((this setting-data) (arg0 engine)) +(defmethod update-from-engine ((this setting-data) (arg0 engine)) (let ((conn (the-as connection (-> arg0 alive-list-end))) (s4-0 (-> arg0 alive-list-end prev0)) ) @@ -194,7 +194,7 @@ ;; definition for method 9 of type setting-control ;; INFO: Return type mismatch int vs none. -(defmethod add-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) +(defmethod add-setting ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 (none) @@ -202,7 +202,7 @@ ;; definition for method 10 of type setting-control ;; INFO: Return type mismatch int vs none. -(defmethod set-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) +(defmethod set-setting ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) (remove-setting this arg0 arg1) (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 @@ -211,7 +211,7 @@ ;; definition for method 11 of type setting-control ;; INFO: Return type mismatch int vs none. -(defmethod remove-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol)) +(defmethod remove-setting ((this setting-control) (arg0 process) (arg1 symbol)) (when arg0 (let ((s5-0 (-> this engine)) (s4-0 (-> arg0 connection-list next1)) @@ -231,7 +231,7 @@ ) ;; definition for method 12 of type setting-control -(defmethod apply-settings setting-control ((this setting-control)) +(defmethod apply-settings ((this setting-control)) (let ((gp-0 (-> this current))) (let ((s5-0 (-> this target))) (mem-copy! (the-as pointer s5-0) (the-as pointer (-> this default)) 196) @@ -263,7 +263,7 @@ ) ;; definition for method 13 of type setting-control -(defmethod update setting-control ((this setting-control)) +(defmethod update ((this setting-control)) (apply-settings this) (let ((gp-0 (-> this current))) (let ((s5-1 (-> this target))) diff --git a/test/decompiler/reference/jak1/engine/game/task/hint-control-h_REF.gc b/test/decompiler/reference/jak1/engine/game/task/hint-control-h_REF.gc index 7c1a7000bd7..ab9bec7f11e 100644 --- a/test/decompiler/reference/jak1/engine/game/task/hint-control-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/task/hint-control-h_REF.gc @@ -3,22 +3,19 @@ ;; definition of type level-hint-control (deftype level-hint-control (structure) - ((delay-before-playing time-frame :offset-assert 0) - (id text-id :offset-assert 8) - (num-attempts-before-playing int8 :offset-assert 12) - (num-success-before-killing int8 :offset-assert 13) - (num-attempts int8 :offset-assert 14) - (num-success int8 :offset-assert 15) - (start-time time-frame :offset-assert 16) - (last-time-called time-frame :offset-assert 24) + ((delay-before-playing time-frame) + (id text-id) + (num-attempts-before-playing int8) + (num-success-before-killing int8) + (num-attempts int8) + (num-success int8) + (start-time time-frame) + (last-time-called time-frame) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type level-hint-control -(defmethod inspect level-hint-control ((this level-hint-control)) +(defmethod inspect ((this level-hint-control)) (format #t "[~8x] ~A~%" this 'level-hint-control) (format #t "~Tdelay-before-playing: ~D~%" (-> this delay-before-playing)) (format #t "~Tid: ~D~%" (-> this id)) @@ -33,16 +30,13 @@ ;; definition of type task-hint-control (deftype task-hint-control (structure) - ((task game-task :offset-assert 0) - (delay time-frame :offset-assert 8) + ((task game-task) + (delay time-frame) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type task-hint-control -(defmethod inspect task-hint-control ((this task-hint-control)) +(defmethod inspect ((this task-hint-control)) (format #t "[~8x] ~A~%" this 'task-hint-control) (format #t "~Ttask: ~D~%" (-> this task)) (format #t "~Tdelay: ~D~%" (-> this delay)) @@ -51,15 +45,12 @@ ;; definition of type task-hint-control-group (deftype task-hint-control-group (structure) - ((tasks (array task-hint-control) :offset-assert 0) + ((tasks (array task-hint-control)) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type task-hint-control-group -(defmethod inspect task-hint-control-group ((this task-hint-control-group)) +(defmethod inspect ((this task-hint-control-group)) (format #t "[~8x] ~A~%" this 'task-hint-control-group) (format #t "~Ttasks: ~A~%" (-> this tasks)) this diff --git a/test/decompiler/reference/jak1/engine/game/task/task-control-h_REF.gc b/test/decompiler/reference/jak1/engine/game/task/task-control-h_REF.gc index d7b08e17461..f9d586011ec 100644 --- a/test/decompiler/reference/jak1/engine/game/task/task-control-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/task/task-control-h_REF.gc @@ -3,27 +3,24 @@ ;; definition of type task-cstage (deftype task-cstage (structure) - ((game-task game-task :offset-assert 0) - (status task-status :offset-assert 8) - (flags task-flags :offset-assert 16) - (condition (function task-control symbol) :offset-assert 20) + ((game-task game-task) + (status task-status) + (flags task-flags) + (condition (function task-control symbol)) ) - :method-count-assert 16 - :size-assert #x18 - :flag-assert #x1000000018 (:methods - (get-task (_type_) game-task 9) - (get-status (_type_) task-status 10) - (task-available? (_type_ task-control) symbol 11) - (closed? (_type_) symbol 12) - (closed-by-default? (_type_) symbol 13) - (close-task! (_type_) int 14) - (open-task! (_type_) int 15) + (get-task (_type_) game-task) + (get-status (_type_) task-status) + (task-available? (_type_ task-control) symbol) + (closed? (_type_) symbol) + (closed-by-default? (_type_) symbol) + (close-task! (_type_) int) + (open-task! (_type_) int) ) ) ;; definition for method 3 of type task-cstage -(defmethod inspect task-cstage ((this task-cstage)) +(defmethod inspect ((this task-cstage)) (format #t "[~8x] ~A~%" this 'task-cstage) (format #t "~Tgame-task: ~D~%" (-> this game-task)) (format #t "~Tstatus: ~D~%" (-> this status)) @@ -34,28 +31,25 @@ ;; definition of type task-control (deftype task-control (basic) - ((current-stage int16 :offset-assert 4) - (stage (array task-cstage) :offset-assert 8) + ((current-stage int16) + (stage (array task-cstage)) ) - :method-count-assert 19 - :size-assert #xc - :flag-assert #x130000000c (:methods - (current-task (_type_) game-task 9) - (current-status (_type_) task-status 10) - (close-current! (_type_) game-task 11) - (close-status! (_type_ task-status) game-task 12) - (first-any (_type_ symbol) game-task 13) - (reset! (_type_ symbol symbol) int 14) - (closed? (_type_ game-task task-status) symbol 15) - (get-reminder (_type_ int) int 16) - (save-reminder (_type_ int int) int 17) - (exists? (_type_ game-task task-status) symbol 18) + (current-task (_type_) game-task) + (current-status (_type_) task-status) + (close-current! (_type_) game-task) + (close-status! (_type_ task-status) game-task) + (first-any (_type_ symbol) game-task) + (reset! (_type_ symbol symbol) int) + (closed? (_type_ game-task task-status) symbol) + (get-reminder (_type_ int) int) + (save-reminder (_type_ int int) int) + (exists? (_type_ game-task task-status) symbol) ) ) ;; definition for method 3 of type task-control -(defmethod inspect task-control ((this task-control)) +(defmethod inspect ((this task-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tcurrent-stage: ~D~%" (-> this current-stage)) (format #t "~Tstage: ~A~%" (-> this stage)) @@ -64,23 +58,20 @@ ;; definition of type ambient-control (deftype ambient-control (structure) - ((last-ambient-time time-frame :offset-assert 0) - (last-ambient string :offset-assert 8) - (last-ambient-id sound-id :offset-assert 12) + ((last-ambient-time time-frame) + (last-ambient string) + (last-ambient-id sound-id) ) :pack-me - :method-count-assert 12 - :size-assert #x10 - :flag-assert #xc00000010 (:methods - (ambient-control-method-9 (_type_) none 9) - (ambient-control-method-10 (_type_ vector time-frame float process-drawable) vector 10) - (play-ambient (_type_ string symbol vector) symbol 11) + (ambient-control-method-9 (_type_) none) + (ambient-control-method-10 (_type_ vector time-frame float process-drawable) vector) + (play-ambient (_type_ string symbol vector) symbol) ) ) ;; definition for method 3 of type ambient-control -(defmethod inspect ambient-control ((this ambient-control)) +(defmethod inspect ((this ambient-control)) (format #t "[~8x] ~A~%" this 'ambient-control) (format #t "~Tlast-ambient-time: ~D~%" (-> this last-ambient-time)) (format #t "~Tlast-ambient: ~A~%" (-> this last-ambient)) @@ -90,76 +81,74 @@ ;; definition of type process-taskable (deftype process-taskable (process-drawable) - ((root-override collide-shape :offset 112) - (tasks task-control :offset-assert 176) - (query gui-query :inline :offset-assert 180) - (old-target-pos transformq :inline :offset-assert 208) - (cell-for-task game-task :offset-assert 256) - (cell-x handle :offset-assert 264) - (cam-joint-index int32 :offset-assert 272) - (skippable symbol :offset-assert 276) - (blend-on-exit art-joint-anim :offset-assert 280) - (camera handle :offset-assert 288) - (will-talk symbol :offset-assert 296) - (talk-message text-id :offset-assert 300) - (last-talk time-frame :offset-assert 304) - (bounce-away symbol :offset-assert 312) - (ambient ambient-control :inline :offset-assert 320) - (center-joint-index int32 :offset-assert 336) - (draw-bounds-y-offset float :offset-assert 340) - (neck-joint-index int32 :offset-assert 344) - (fuel-cell-anim spool-anim :offset-assert 348) - (sound-flava music-flava :offset-assert 352) - (have-flava symbol :offset-assert 356) - (music symbol :offset-assert 360) - (have-music symbol :offset-assert 364) - (been-kicked symbol :offset-assert 368) - (cur-trans-hook (function none) :offset-assert 372) - (shadow-backup shadow-geo :offset-assert 376) + ((root collide-shape :override) + (tasks task-control) + (query gui-query :inline) + (old-target-pos transformq :inline) + (cell-for-task game-task) + (cell-x handle) + (cam-joint-index int32) + (skippable symbol) + (blend-on-exit art-joint-anim) + (camera handle) + (will-talk symbol) + (talk-message text-id) + (last-talk time-frame) + (bounce-away symbol) + (ambient ambient-control :inline) + (center-joint-index int32) + (draw-bounds-y-offset float) + (neck-joint-index int32) + (fuel-cell-anim spool-anim) + (sound-flava music-flava) + (have-flava symbol) + (music symbol) + (have-music symbol) + (been-kicked symbol) + (cur-trans-hook (function none)) + (shadow-backup shadow-geo) ) - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c + (:state-methods + release + give-cell + lose + enter-playing + play-accept + play-reject + query + play-anim + hidden + (be-clone handle) + idle + ) (:methods - (release () _type_ :state 20) - (give-cell () _type_ :state 21) - (lose () _type_ :state 22) - (enter-playing () _type_ :state 23) - (play-accept () _type_ :state 24) - (play-reject () _type_ :state 25) - (query () _type_ :state 26) - (play-anim () _type_ :state 27) - (hidden () _type_ :state 28) - (be-clone (handle) _type_ :state 29) - (idle () _type_ :state 30) - (get-art-elem (_type_) art-element 31) - (play-anim! (_type_ symbol) basic 32) - (process-taskable-method-33 (_type_) none 33) - (get-accept-anim (_type_ symbol) spool-anim 34) - (push-accept-anim (_type_) none 35) - (get-reject-anim (_type_ symbol) spool-anim 36) - (push-reject-anim (_type_) none 37) - (process-taskable-method-38 (_type_) none 38) - (should-display? (_type_) symbol 39) - (process-taskable-method-40 (_type_ object skeleton-group int int vector int) none 40) - (initialize-collision (_type_ int vector) none 41) - (process-taskable-method-42 (_type_) none 42) - (process-taskable-method-43 (_type_) symbol 43) - (play-reminder (_type_) symbol 44) - (process-taskable-method-45 (_type_) symbol 45) - (process-taskable-method-46 (_type_) none 46) - (target-above-threshold? (_type_) symbol 47) - (draw-npc-shadow (_type_) none 48) - (hidden-other () _type_ :state 49) - (process-taskable-method-50 (_type_) symbol 50) - (close-anim-file! (_type_) symbol 51) - (process-taskable-method-52 (_type_) none 52) + (get-art-elem (_type_) art-element) + (play-anim! (_type_ symbol) basic) + (process-taskable-method-33 (_type_) none) + (get-accept-anim (_type_ symbol) spool-anim) + (push-accept-anim (_type_) none) + (get-reject-anim (_type_ symbol) spool-anim) + (push-reject-anim (_type_) none) + (process-taskable-method-38 (_type_) none) + (should-display? (_type_) symbol) + (process-taskable-method-40 (_type_ object skeleton-group int int vector int) none) + (initialize-collision (_type_ int vector) none) + (process-taskable-method-42 (_type_) none) + (process-taskable-method-43 (_type_) symbol) + (play-reminder (_type_) symbol) + (process-taskable-method-45 (_type_) symbol) + (process-taskable-method-46 (_type_) none) + (target-above-threshold? (_type_) symbol) + (draw-npc-shadow (_type_) none) + (hidden-other () _type_ :state) + (process-taskable-method-50 (_type_) symbol) + (close-anim-file! (_type_) symbol) + (process-taskable-method-52 (_type_) none) ) ) ;; definition for method 3 of type process-taskable -(defmethod inspect process-taskable ((this process-taskable)) +(defmethod inspect ((this process-taskable)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/engine/game/task/task-control_REF.gc b/test/decompiler/reference/jak1/engine/game/task/task-control_REF.gc index 2500354c433..c389f8ec0a8 100644 --- a/test/decompiler/reference/jak1/engine/game/task/task-control_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/task/task-control_REF.gc @@ -35,27 +35,27 @@ ) ;; definition for method 9 of type task-cstage -(defmethod get-task task-cstage ((this task-cstage)) +(defmethod get-task ((this task-cstage)) (-> this game-task) ) ;; definition for method 10 of type task-cstage -(defmethod get-status task-cstage ((this task-cstage)) +(defmethod get-status ((this task-cstage)) (-> this status) ) ;; definition for method 12 of type task-cstage -(defmethod closed? task-cstage ((this task-cstage)) +(defmethod closed? ((this task-cstage)) (logtest? (-> this flags) (task-flags closed)) ) ;; definition for method 13 of type task-cstage -(defmethod closed-by-default? task-cstage ((this task-cstage)) +(defmethod closed-by-default? ((this task-cstage)) (logtest? (-> this flags) (task-flags closed-by-default)) ) ;; definition for method 11 of type task-cstage -(defmethod task-available? task-cstage ((this task-cstage) (arg0 task-control)) +(defmethod task-available? ((this task-cstage) (arg0 task-control)) (let ((a0-1 this)) (cond ((logtest? (-> a0-1 flags) (task-flags closed)) @@ -79,7 +79,7 @@ ) ;; definition for method 14 of type task-cstage -(defmethod close-task! task-cstage ((this task-cstage)) +(defmethod close-task! ((this task-cstage)) (if (= (-> this game-task) (game-task none)) (return (the-as int #f)) ) @@ -96,7 +96,7 @@ ) ;; definition for method 15 of type task-cstage -(defmethod open-task! task-cstage ((this task-cstage)) +(defmethod open-task! ((this task-cstage)) (logclear! (-> this flags) (task-flags closed)) 0 ) @@ -108,7 +108,7 @@ ;; definition for method 9 of type task-control ;; INFO: Return type mismatch int vs game-task. -(defmethod current-task task-control ((this task-control)) +(defmethod current-task ((this task-control)) (the-as game-task (cond ((= this *null-task-control*) (format 0 "ERROR: current-task received *null-task-control*~%") @@ -126,7 +126,7 @@ ;; definition for method 10 of type task-control ;; INFO: Return type mismatch int vs task-status. -(defmethod current-status task-control ((this task-control)) +(defmethod current-status ((this task-control)) (the-as task-status (cond ((= this *null-task-control*) (format 0 "ERROR: current-status received self of *null-task-control*~%~%") @@ -143,7 +143,7 @@ ) ;; definition for method 11 of type task-control -(defmethod close-current! task-control ((this task-control)) +(defmethod close-current! ((this task-control)) (cond ((= this *null-task-control*) (format 0 "ERROR: close-current! received self of *null-task-control*~%~%") @@ -159,7 +159,7 @@ ;; definition for method 12 of type task-control ;; INFO: Return type mismatch int vs game-task. -(defmethod close-status! task-control ((this task-control) (arg0 task-status)) +(defmethod close-status! ((this task-control) (arg0 task-status)) (let ((a0-2 (current-task this))) (dotimes (v1-1 (-> this stage length)) (when (and (= a0-2 (-> this stage v1-1 game-task)) (= arg0 (-> this stage v1-1 status))) @@ -179,7 +179,7 @@ ;; definition for method 13 of type task-control ;; INFO: Return type mismatch int vs game-task. -(defmethod first-any task-control ((this task-control) (arg0 symbol)) +(defmethod first-any ((this task-control) (arg0 symbol)) (when (= this *null-task-control*) (if arg0 (format 0 "ERROR: first-any received self of *null-task-control*~%~%") @@ -197,7 +197,7 @@ ) ;; definition for method 14 of type task-control -(defmethod reset! task-control ((this task-control) (arg0 symbol) (arg1 symbol)) +(defmethod reset! ((this task-control) (arg0 symbol) (arg1 symbol)) (when (= this *null-task-control*) (if arg1 (format 0 "ERROR: reset! received self of *null-task-control*~%~%") @@ -221,7 +221,7 @@ ) ;; definition for method 15 of type task-control -(defmethod closed? task-control ((this task-control) (arg0 game-task) (arg1 task-status)) +(defmethod closed? ((this task-control) (arg0 game-task) (arg1 task-status)) (when (= this *null-task-control*) (format 0 "ERROR: closed? received self of *null-task-control*~%~%") (return #f) @@ -243,7 +243,7 @@ ) ;; definition for method 18 of type task-control -(defmethod exists? task-control ((this task-control) (arg0 game-task) (arg1 task-status)) +(defmethod exists? ((this task-control) (arg0 game-task) (arg1 task-status)) (when (= this *null-task-control*) (format 0 "ERROR: exists? received self of *null-task-control*~%~%") (return #f) @@ -257,7 +257,7 @@ ) ;; definition for method 16 of type task-control -(defmethod get-reminder task-control ((this task-control) (arg0 int)) +(defmethod get-reminder ((this task-control) (arg0 int)) (when (= this *null-task-control*) (format 0 "ERROR: get-reminder received self of *null-task-control*~%~%") (return 0) @@ -268,7 +268,7 @@ ) ;; definition for method 17 of type task-control -(defmethod save-reminder task-control ((this task-control) (arg0 int) (arg1 int)) +(defmethod save-reminder ((this task-control) (arg0 int) (arg1 int)) (when (= this *null-task-control*) (format 0 "ERROR: save-reminder received self of *null-task-control*~%~%") (return 0) diff --git a/test/decompiler/reference/jak1/engine/geometry/bounding-box-h_REF.gc b/test/decompiler/reference/jak1/engine/geometry/bounding-box-h_REF.gc index 529c9392240..b3f294a5870 100644 --- a/test/decompiler/reference/jak1/engine/geometry/bounding-box-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/bounding-box-h_REF.gc @@ -3,25 +3,22 @@ ;; definition of type bounding-box (deftype bounding-box (structure) - ((min vector :inline :offset-assert 0) - (max vector :inline :offset-assert 16) + ((min vector :inline) + (max vector :inline) ) - :method-count-assert 16 - :size-assert #x20 - :flag-assert #x1000000020 (:methods - (add-spheres! (_type_ (inline-array sphere) int) int 9) - (add-point! (_type_ vector3s) int 10) - (set-from-point-offset! (_type_ vector3s vector3s) int 11) - (set-from-point-offset-pad! (_type_ vector3s vector3s float) int 12) - (set-from-sphere! (_type_ sphere) int 13) - (set-from-spheres! (_type_ (inline-array sphere) int) int 14) - (add-box! (_type_ bounding-box) int 15) + (add-spheres! (_type_ (inline-array sphere) int) int) + (add-point! (_type_ vector3s) int) + (set-from-point-offset! (_type_ vector3s vector3s) int) + (set-from-point-offset-pad! (_type_ vector3s vector3s float) int) + (set-from-sphere! (_type_ sphere) int) + (set-from-spheres! (_type_ (inline-array sphere) int) int) + (add-box! (_type_ bounding-box) int) ) ) ;; definition for method 3 of type bounding-box -(defmethod inspect bounding-box ((this bounding-box)) +(defmethod inspect ((this bounding-box)) (format #t "[~8x] ~A~%" this 'bounding-box) (format #t "~Tmin: ~`vector`P~%" (-> this min)) (format #t "~Tmax: ~`vector`P~%" (-> this max)) @@ -30,16 +27,13 @@ ;; definition of type bounding-box4w (deftype bounding-box4w (structure) - ((min vector4w :inline :offset-assert 0) - (max vector4w :inline :offset-assert 16) + ((min vector4w :inline) + (max vector4w :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type bounding-box4w -(defmethod inspect bounding-box4w ((this bounding-box4w)) +(defmethod inspect ((this bounding-box4w)) (format #t "[~8x] ~A~%" this 'bounding-box4w) (format #t "~Tmin: ~`vector4w`P~%" (-> this min)) (format #t "~Tmax: ~`vector4w`P~%" (-> this max)) @@ -48,16 +42,13 @@ ;; definition of type bounding-box-both (deftype bounding-box-both (structure) - ((box bounding-box :inline :offset-assert 0) - (box4w bounding-box4w :inline :offset-assert 32) + ((box bounding-box :inline) + (box4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type bounding-box-both -(defmethod inspect bounding-box-both ((this bounding-box-both)) +(defmethod inspect ((this bounding-box-both)) (format #t "[~8x] ~A~%" this 'bounding-box-both) (format #t "~Tbox: #~%" (-> this box)) (format #t "~Tbox4w: #~%" (-> this box4w)) diff --git a/test/decompiler/reference/jak1/engine/geometry/bounding-box_REF.gc b/test/decompiler/reference/jak1/engine/geometry/bounding-box_REF.gc index 2775681f508..10d85bd05a8 100644 --- a/test/decompiler/reference/jak1/engine/geometry/bounding-box_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/bounding-box_REF.gc @@ -25,7 +25,7 @@ ;; definition for method 11 of type bounding-box ;; ERROR: Failed load: (set! vf3 (l.vf a2-0)) at op 0 -(defmethod set-from-point-offset! bounding-box ((this bounding-box) (arg0 vector3s) (arg1 vector3s)) +(defmethod set-from-point-offset! ((this bounding-box) (arg0 vector3s) (arg1 vector3s)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -49,7 +49,7 @@ ;; definition for method 10 of type bounding-box ;; ERROR: Failed load: (set! vf3 (l.vf a1-0)) at op 2 -(defmethod add-point! bounding-box ((this bounding-box) (arg0 vector3s)) +(defmethod add-point! ((this bounding-box) (arg0 vector3s)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -66,7 +66,7 @@ ) ;; definition for method 15 of type bounding-box -(defmethod add-box! bounding-box ((this bounding-box) (arg0 bounding-box)) +(defmethod add-box! ((this bounding-box) (arg0 bounding-box)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -86,7 +86,7 @@ ;; definition for method 12 of type bounding-box ;; ERROR: Failed load: (set! vf4 (l.vf a2-0)) at op 0 -(defmethod set-from-point-offset-pad! bounding-box ((this bounding-box) (arg0 vector3s) (arg1 vector3s) (arg2 float)) +(defmethod set-from-point-offset-pad! ((this bounding-box) (arg0 vector3s) (arg1 vector3s) (arg2 float)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -113,7 +113,7 @@ ) ;; definition for method 13 of type bounding-box -(defmethod set-from-sphere! bounding-box ((this bounding-box) (arg0 sphere)) +(defmethod set-from-sphere! ((this bounding-box) (arg0 sphere)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) diff --git a/test/decompiler/reference/jak1/engine/geometry/cylinder_REF.gc b/test/decompiler/reference/jak1/engine/geometry/cylinder_REF.gc index 4e65f7d95e4..d55c867fcd4 100644 --- a/test/decompiler/reference/jak1/engine/geometry/cylinder_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/cylinder_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 10 of type cylinder -(defmethod ray-capsule-intersect cylinder ((this cylinder) (probe-origin vector) (probe-dir vector)) +(defmethod ray-capsule-intersect ((this cylinder) (probe-origin vector) (probe-dir vector)) (let ((t2-0 (new 'stack-no-clear 'vector)) (end-pt (new 'stack-no-clear 'vector)) ) @@ -37,15 +37,12 @@ ;; definition of type cylinder-verts (deftype cylinder-verts (structure) - ((vert vector 24 :inline :offset-assert 0) + ((vert vector 24 :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;; definition for method 3 of type cylinder-verts -(defmethod inspect cylinder-verts ((this cylinder-verts)) +(defmethod inspect ((this cylinder-verts)) (format #t "[~8x] ~A~%" this 'cylinder-verts) (format #t "~Tvert[24] @ #x~X~%" (-> this vert)) this @@ -54,7 +51,7 @@ ;; definition for method 9 of type cylinder ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw cylinder ((this cylinder) (arg0 vector4w)) +(defmethod debug-draw ((this cylinder) (arg0 vector4w)) (local-vars (sv-896 matrix) (sv-912 int) @@ -185,7 +182,7 @@ ;; definition for method 10 of type cylinder-flat ;; INFO: Used lq/sq -(defmethod ray-flat-cyl-intersect cylinder-flat ((this cylinder-flat) (probe-origin vector) (probe-dir vector)) +(defmethod ray-flat-cyl-intersect ((this cylinder-flat) (probe-origin vector) (probe-dir vector)) (let ((gp-0 (new 'stack-no-clear 'vector)) (end-pt (new 'stack-no-clear 'vector)) ) @@ -226,15 +223,12 @@ ;; definition of type cylinder-flat-verts (deftype cylinder-flat-verts (structure) - ((vert vector 10 :inline :offset-assert 0) + ((vert vector 10 :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type cylinder-flat-verts -(defmethod inspect cylinder-flat-verts ((this cylinder-flat-verts)) +(defmethod inspect ((this cylinder-flat-verts)) (format #t "[~8x] ~A~%" this 'cylinder-flat-verts) (format #t "~Tvert[10] @ #x~X~%" (-> this vert)) this @@ -243,7 +237,7 @@ ;; definition for method 9 of type cylinder-flat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw cylinder-flat ((this cylinder-flat) (arg0 vector4w)) +(defmethod debug-draw ((this cylinder-flat) (arg0 vector4w)) (local-vars (sv-448 vector) (sv-464 int)) (rlet ((vf0 :class vf) (vf4 :class vf) diff --git a/test/decompiler/reference/jak1/engine/geometry/geometry-h_REF.gc b/test/decompiler/reference/jak1/engine/geometry/geometry-h_REF.gc index 6694687ed68..543263d1111 100644 --- a/test/decompiler/reference/jak1/engine/geometry/geometry-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/geometry-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type curve (deftype curve (structure) - ((cverts (inline-array vector) :offset-assert 0) - (num-cverts int32 :offset-assert 4) - (knots (pointer float) :offset-assert 8) - (num-knots int32 :offset-assert 12) - (length float :offset-assert 16) + ((cverts (inline-array vector)) + (num-cverts int32) + (knots (pointer float)) + (num-knots int32) + (length float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type curve -(defmethod inspect curve ((this curve)) +(defmethod inspect ((this curve)) (format #t "[~8x] ~A~%" this 'curve) (format #t "~Tcverts: #x~X~%" (-> this cverts)) (format #t "~Tnum-cverts: ~D~%" (-> this num-cverts)) @@ -27,23 +24,20 @@ ;; definition of type border-plane (deftype border-plane (basic) - ((name symbol :offset-assert 4) - (action basic :offset-assert 8) - (slot int8 :offset-assert 12) - (trans vector :inline :offset-assert 16) - (normal vector :inline :offset-assert 32) + ((name symbol) + (action basic) + (slot int8) + (trans vector :inline) + (normal vector :inline) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (debug-draw! (_type_) none 9) - (point-past-plane? (_type_ vector) symbol 10) + (debug-draw! (_type_) none) + (point-past-plane? (_type_ vector) symbol) ) ) ;; definition for method 3 of type border-plane -(defmethod inspect border-plane ((this border-plane)) +(defmethod inspect ((this border-plane)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Taction: ~A~%" (-> this action)) diff --git a/test/decompiler/reference/jak1/engine/geometry/path-h_REF.gc b/test/decompiler/reference/jak1/engine/geometry/path-h_REF.gc index 1e3e94b69f2..0b3e8972e5e 100644 --- a/test/decompiler/reference/jak1/engine/geometry/path-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/path-h_REF.gc @@ -3,35 +3,32 @@ ;; definition of type path-control (deftype path-control (basic) - ((flags path-control-flag :offset-assert 4) - (name symbol :offset-assert 8) - (process process-drawable :offset-assert 12) - (curve curve :inline :offset-assert 16) - (num-cverts int32 :offset 20) - (cverts (inline-array vector) :offset 16) + ((flags path-control-flag) + (name symbol) + (process process-drawable) + (curve curve :inline) + (num-cverts int32 :overlay-at (-> curve num-cverts)) + (cverts (inline-array vector) :overlay-at (-> curve cverts)) ) - :method-count-assert 21 - :size-assert #x24 - :flag-assert #x1500000024 (:methods - (new (symbol type process symbol float) _type_ 0) - (debug-draw (_type_) none 9) - (eval-path-curve-div! (_type_ vector float symbol) vector 10) - (get-random-point (_type_ vector) vector 11) - (path-control-method-12 (_type_ vector float) vector 12) - (eval-path-curve! (_type_ vector float symbol) vector 13) - (path-control-method-14 (_type_ vector float) vector 14) - (length-as-float (_type_) float 15) - (path-distance (_type_) float 16) - (get-num-verts (_type_) int 17) - (should-display? (_type_) symbol 18) - (path-control-method-19 (_type_) float 19) - (path-control-method-20 (_type_) float 20) + (new (symbol type process symbol float) _type_) + (debug-draw (_type_) none) + (eval-path-curve-div! (_type_ vector float symbol) vector) + (get-random-point (_type_ vector) vector) + (path-control-method-12 (_type_ vector float) vector) + (eval-path-curve! (_type_ vector float symbol) vector) + (path-control-method-14 (_type_ vector float) vector) + (length-as-float (_type_) float) + (path-distance (_type_) float) + (get-num-verts (_type_) int) + (should-display? (_type_) symbol) + (path-control-method-19 (_type_) float) + (path-control-method-20 (_type_) float) ) ) ;; definition for method 3 of type path-control -(defmethod inspect path-control ((this path-control)) +(defmethod inspect ((this path-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tflags: #x~X~%" (-> this flags)) (format #t "~Tname: ~A~%" (-> this name)) @@ -45,16 +42,13 @@ ;; definition of type curve-control (deftype curve-control (path-control) () - :method-count-assert 21 - :size-assert #x24 - :flag-assert #x1500000024 (:methods - (new (symbol type process symbol float) _type_ 0) + (new (symbol type process symbol float) _type_) ) ) ;; definition for method 3 of type curve-control -(defmethod inspect curve-control ((this curve-control)) +(defmethod inspect ((this curve-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tflags: #x~X~%" (-> this flags)) (format #t "~Tname: ~A~%" (-> this name)) @@ -108,17 +102,17 @@ ) ;; definition for method 18 of type path-control -(defmethod should-display? path-control ((this path-control)) +(defmethod should-display? ((this path-control)) (and *display-path-marks* (logtest? (-> this flags) (path-control-flag display))) ) ;; definition for method 15 of type path-control -(defmethod length-as-float path-control ((this path-control)) +(defmethod length-as-float ((this path-control)) (the float (+ (-> this curve num-cverts) -1)) ) ;; definition for method 17 of type path-control -(defmethod get-num-verts path-control ((this path-control)) +(defmethod get-num-verts ((this path-control)) (-> this curve num-cverts) ) diff --git a/test/decompiler/reference/jak1/engine/geometry/path_REF.gc b/test/decompiler/reference/jak1/engine/geometry/path_REF.gc index d7685ea3027..7433d428988 100644 --- a/test/decompiler/reference/jak1/engine/geometry/path_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/path_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type path-control ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw path-control ((this path-control)) +(defmethod debug-draw ((this path-control)) (cond ((logtest? (-> this flags) (path-control-flag not-found)) (when (and (type-type? (-> this process type) process-drawable) *display-entity-errors*) @@ -60,7 +60,7 @@ ) ;; definition for method 16 of type path-control -(defmethod path-distance path-control ((this path-control)) +(defmethod path-distance ((this path-control)) (let ((f30-0 0.0)) (dotimes (s5-0 (+ (-> this curve num-cverts) -1)) (+! f30-0 (vector-vector-distance (-> this cverts s5-0) (-> this cverts (+ s5-0 1)))) @@ -70,7 +70,7 @@ ) ;; definition for method 16 of type curve-control -(defmethod path-distance curve-control ((this curve-control)) +(defmethod path-distance ((this curve-control)) (let ((f0-0 (-> this curve length))) (when (= f0-0 0.0) (set! f0-0 (curve-length (the-as curve (&-> this cverts)))) @@ -82,7 +82,7 @@ ;; definition for method 10 of type path-control ;; INFO: Used lq/sq -(defmethod eval-path-curve-div! path-control ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod eval-path-curve-div! ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) (let ((a1-1 (-> this curve num-cverts)) (f0-3 (the float (the int arg1))) ) @@ -106,7 +106,7 @@ ;; definition for method 11 of type path-control ;; INFO: Used lq/sq -(defmethod get-random-point path-control ((this path-control) (arg0 vector)) +(defmethod get-random-point ((this path-control) (arg0 vector)) (with-pp (cond ((> (-> this curve num-cverts) 0) @@ -131,13 +131,13 @@ ) ;; definition for method 13 of type path-control -(defmethod eval-path-curve! path-control ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod eval-path-curve! ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) (eval-path-curve-div! this arg0 (* arg1 (the float (+ (-> this curve num-cverts) -1))) arg2) ) ;; definition for method 13 of type curve-control ;; INFO: Return type mismatch object vs vector. -(defmethod eval-path-curve! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod eval-path-curve! ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) (the-as vector (if (logtest? (-> this flags) (path-control-flag not-found)) 0.0 (curve-evaluate! @@ -154,7 +154,7 @@ ;; definition for method 10 of type curve-control ;; INFO: Return type mismatch object vs vector. -(defmethod eval-path-curve-div! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod eval-path-curve-div! ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) (the-as vector (if (logtest? (-> this flags) (path-control-flag not-found)) 0.0 (curve-evaluate! @@ -170,7 +170,7 @@ ) ;; definition for method 12 of type path-control -(defmethod path-control-method-12 path-control ((this path-control) (arg0 vector) (arg1 float)) +(defmethod path-control-method-12 ((this path-control) (arg0 vector) (arg1 float)) (when (not (logtest? (-> this flags) (path-control-flag not-found))) (let ((v1-3 (-> this curve num-cverts)) (f0-3 (the float (the int arg1))) @@ -193,12 +193,12 @@ ) ;; definition for method 14 of type path-control -(defmethod path-control-method-14 path-control ((this path-control) (arg0 vector) (arg1 float)) +(defmethod path-control-method-14 ((this path-control) (arg0 vector) (arg1 float)) (path-control-method-12 this arg0 (* arg1 (the float (+ (-> this curve num-cverts) -1)))) ) ;; definition for method 14 of type curve-control -(defmethod path-control-method-14 curve-control ((this curve-control) (arg0 vector) (arg1 float)) +(defmethod path-control-method-14 ((this curve-control) (arg0 vector) (arg1 float)) (when (not (logtest? (-> this flags) (path-control-flag not-found))) (let ((s4-0 (new 'stack-no-clear 'vector))) (curve-evaluate! @@ -239,13 +239,13 @@ ) ;; definition for method 12 of type curve-control -(defmethod path-control-method-12 curve-control ((this curve-control) (arg0 vector) (arg1 float)) +(defmethod path-control-method-12 ((this curve-control) (arg0 vector) (arg1 float)) (path-control-method-14 this arg0 (/ arg1 (the float (+ (-> this curve num-cverts) -1)))) ) ;; definition for method 19 of type path-control ;; INFO: Used lq/sq -(defmethod path-control-method-19 path-control ((this path-control)) +(defmethod path-control-method-19 ((this path-control)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) @@ -276,13 +276,13 @@ ) ;; definition for method 20 of type path-control -(defmethod path-control-method-20 path-control ((this path-control)) +(defmethod path-control-method-20 ((this path-control)) (/ (path-control-method-19 this) (the float (+ (-> this curve num-cverts) -1))) ) ;; definition for method 9 of type curve-control ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw curve-control ((this curve-control)) +(defmethod debug-draw ((this curve-control)) (cond ((logtest? (-> this flags) (path-control-flag not-found)) (when (and (type-type? (-> this process type) process-drawable) *display-entity-errors*) diff --git a/test/decompiler/reference/jak1/engine/geometry/vol-h_REF.gc b/test/decompiler/reference/jak1/engine/geometry/vol-h_REF.gc index 7e7ff6321d4..5f85e4465e2 100644 --- a/test/decompiler/reference/jak1/engine/geometry/vol-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/vol-h_REF.gc @@ -3,27 +3,24 @@ ;; definition of type plane-volume (deftype plane-volume (structure) - ((volume-type symbol :offset-assert 0) - (point-count int16 :offset-assert 4) - (normal-count int16 :offset-assert 6) - (first-point (pointer vector) :offset-assert 8) - (first-normal (pointer vector) :offset-assert 12) - (num-planes int32 :offset-assert 16) - (plane (inline-array plane) :offset-assert 20) + ((volume-type symbol) + (point-count int16) + (normal-count int16) + (first-point (pointer vector)) + (first-normal (pointer vector)) + (num-planes int32) + (plane (inline-array plane)) ) :pack-me - :method-count-assert 12 - :size-assert #x18 - :flag-assert #xc00000018 (:methods - (init-vol! (_type_ symbol vector-array vector-array) symbol 9) - (debug-draw (_type_) none 10) - (point-in-vol? (_type_ vector float) symbol 11) + (init-vol! (_type_ symbol vector-array vector-array) symbol) + (debug-draw (_type_) none) + (point-in-vol? (_type_ vector float) symbol) ) ) ;; definition for method 3 of type plane-volume -(defmethod inspect plane-volume ((this plane-volume)) +(defmethod inspect ((this plane-volume)) (format #t "[~8x] ~A~%" this 'plane-volume) (format #t "~Tvolume-type: ~A~%" (-> this volume-type)) (format #t "~Tpoint-count: ~D~%" (-> this point-count)) @@ -37,28 +34,25 @@ ;; definition of type vol-control (deftype vol-control (basic) - ((flags uint32 :offset-assert 4) - (process process-drawable :offset-assert 8) - (pos-vol-count int32 :offset-assert 12) - (pos-vol plane-volume 32 :inline :offset-assert 16) - (neg-vol-count int32 :offset-assert 784) - (neg-vol plane-volume 32 :inline :offset-assert 788) - (debug-point vector-array :offset-assert 1556) - (debug-normal vector-array :offset-assert 1560) + ((flags uint32) + (process process-drawable) + (pos-vol-count int32) + (pos-vol plane-volume 32 :inline) + (neg-vol-count int32) + (neg-vol plane-volume 32 :inline) + (debug-point vector-array) + (debug-normal vector-array) ) - :method-count-assert 12 - :size-assert #x61c - :flag-assert #xc0000061c (:methods - (new (symbol type process-drawable) _type_ 0) - (init! (_type_) symbol 9) - (point-in-vol? (_type_ vector) symbol 10) - (vol-control-method-11 (_type_) symbol 11) + (new (symbol type process-drawable) _type_) + (init! (_type_) symbol) + (point-in-vol? (_type_ vector) symbol) + (vol-control-method-11 (_type_) symbol) ) ) ;; definition for method 3 of type vol-control -(defmethod inspect vol-control ((this vol-control)) +(defmethod inspect ((this vol-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tflags: #x~X~%" (-> this flags)) (format #t "~Tprocess: ~A~%" (-> this process)) @@ -132,6 +126,6 @@ ) ;; definition for method 11 of type vol-control -(defmethod vol-control-method-11 vol-control ((this vol-control)) +(defmethod vol-control-method-11 ((this vol-control)) (and *display-vol-marks* (logtest? (-> this flags) 1)) ) diff --git a/test/decompiler/reference/jak1/engine/geometry/vol_REF.gc b/test/decompiler/reference/jak1/engine/geometry/vol_REF.gc index 950738b1b7f..fa974003f38 100644 --- a/test/decompiler/reference/jak1/engine/geometry/vol_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/vol_REF.gc @@ -26,7 +26,7 @@ ;; WARN: Stack slot offset 148 signed mismatch ;; WARN: Stack slot offset 148 signed mismatch ;; WARN: Stack slot offset 148 signed mismatch -(defmethod init-vol! plane-volume ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) +(defmethod init-vol! ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) (local-vars (sv-144 vector) (sv-148 float) @@ -169,7 +169,7 @@ ;; definition for method 10 of type plane-volume ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw plane-volume ((this plane-volume)) +(defmethod debug-draw ((this plane-volume)) (let* ((v1-0 (-> this volume-type)) (s5-0 (cond ((= v1-0 'vol) @@ -203,7 +203,7 @@ ) ;; definition for method 11 of type plane-volume -(defmethod point-in-vol? plane-volume ((this plane-volume) (arg0 vector) (arg1 float)) +(defmethod point-in-vol? ((this plane-volume) (arg0 vector) (arg1 float)) (dotimes (v1-0 (-> this num-planes)) (if (< arg1 (- (vector-dot arg0 (the-as vector (-> this plane v1-0))) (the-as float (-> this plane v1-0 w)))) (return #f) @@ -214,7 +214,7 @@ ;; definition for method 9 of type vol-control ;; INFO: Return type mismatch int vs symbol. -(defmethod init! vol-control ((this vol-control)) +(defmethod init! ((this vol-control)) (with-pp (let ((a0-1 this)) (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) 1)) (logtest? (-> this flags) 2)) @@ -255,7 +255,7 @@ ) ;; definition for method 10 of type vol-control -(defmethod point-in-vol? vol-control ((this vol-control) (arg0 vector)) +(defmethod point-in-vol? ((this vol-control) (arg0 vector)) (dotimes (s4-0 (-> this neg-vol-count)) (if (point-in-vol? (-> this neg-vol s4-0) arg0 0.0) (return #f) diff --git a/test/decompiler/reference/jak1/engine/gfx/background/background-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/background/background-h_REF.gc index 0c4915f38ab..1330173eaf9 100644 --- a/test/decompiler/reference/jak1/engine/gfx/background/background-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/background/background-h_REF.gc @@ -3,40 +3,37 @@ ;; definition of type background-work (deftype background-work (basic) - ((tfrag-tree-count int32 :offset-assert 4) - (tfrag-trees drawable-tree-tfrag 8 :offset-assert 8) - (tfrag-levels level 8 :offset-assert 40) - (trans-tfrag-tree-count int32 :offset-assert 72) - (trans-tfrag-trees drawable-tree-trans-tfrag 8 :offset-assert 76) - (trans-tfrag-levels level 8 :offset-assert 108) - (dirt-tfrag-tree-count int32 :offset-assert 140) - (dirt-tfrag-trees drawable-tree-dirt-tfrag 8 :offset-assert 144) - (dirt-tfrag-levels level 8 :offset-assert 176) - (ice-tfrag-tree-count int32 :offset-assert 208) - (ice-tfrag-trees drawable-tree-ice-tfrag 8 :offset-assert 212) - (ice-tfrag-levels level 8 :offset-assert 244) - (lowres-tfrag-tree-count int32 :offset-assert 276) - (lowres-tfrag-trees drawable-tree-lowres-tfrag 8 :offset-assert 280) - (lowres-tfrag-levels level 8 :offset-assert 312) - (lowres-trans-tfrag-tree-count int32 :offset-assert 344) - (lowres-trans-tfrag-trees drawable-tree-trans-tfrag 8 :offset-assert 348) - (lowres-trans-tfrag-levels level 8 :offset-assert 380) - (shrub-tree-count int32 :offset-assert 412) - (shrub-trees drawable-tree-instance-shrub 8 :offset-assert 416) - (shrub-levels level 8 :offset-assert 448) - (tie-tree-count int32 :offset-assert 480) - (tie-trees drawable-tree-instance-tie 8 :offset-assert 484) - (tie-levels level 8 :offset-assert 516) - (tie-generic basic 8 :offset-assert 548) - (wait-to-vu0 uint32 :offset-assert 580) + ((tfrag-tree-count int32) + (tfrag-trees drawable-tree-tfrag 8) + (tfrag-levels level 8) + (trans-tfrag-tree-count int32) + (trans-tfrag-trees drawable-tree-trans-tfrag 8) + (trans-tfrag-levels level 8) + (dirt-tfrag-tree-count int32) + (dirt-tfrag-trees drawable-tree-dirt-tfrag 8) + (dirt-tfrag-levels level 8) + (ice-tfrag-tree-count int32) + (ice-tfrag-trees drawable-tree-ice-tfrag 8) + (ice-tfrag-levels level 8) + (lowres-tfrag-tree-count int32) + (lowres-tfrag-trees drawable-tree-lowres-tfrag 8) + (lowres-tfrag-levels level 8) + (lowres-trans-tfrag-tree-count int32) + (lowres-trans-tfrag-trees drawable-tree-trans-tfrag 8) + (lowres-trans-tfrag-levels level 8) + (shrub-tree-count int32) + (shrub-trees drawable-tree-instance-shrub 8) + (shrub-levels level 8) + (tie-tree-count int32) + (tie-trees drawable-tree-instance-tie 8) + (tie-levels level 8) + (tie-generic basic 8) + (wait-to-vu0 uint32) ) - :method-count-assert 9 - :size-assert #x248 - :flag-assert #x900000248 ) ;; definition for method 3 of type background-work -(defmethod inspect background-work ((this background-work)) +(defmethod inspect ((this background-work)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttfrag-tree-count: ~D~%" (-> this tfrag-tree-count)) (format #t "~Ttfrag-trees[8] @ #x~X~%" (-> this tfrag-trees)) diff --git a/test/decompiler/reference/jak1/engine/gfx/background/prototype-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/background/prototype-h_REF.gc index c895eafe13a..84df2bbf860 100644 --- a/test/decompiler/reference/jak1/engine/gfx/background/prototype-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/background/prototype-h_REF.gc @@ -3,38 +3,35 @@ ;; definition of type prototype-bucket (deftype prototype-bucket (basic) - ((name string :offset-assert 4) - (flags uint32 :offset-assert 8) - (in-level uint16 :offset-assert 12) - (utextures uint16 :offset-assert 14) - (geometry drawable 4 :offset-assert 16) - (dists vector :inline :offset-assert 32) - (rdists vector :inline :offset-assert 48) - (next uint32 4 :offset-assert 64) - (count uint16 4 :offset-assert 80) - (near-plane meters :offset 32) - (near-stiff meters :offset 36) - (mid-plane meters :offset 40) - (far-plane meters :offset 44) - (rlength-near float :offset 48) - (rlength-stiff float :offset 52) - (rlength-mid float :offset 56) - (stiffness float :offset 60) - (next-clear uint128 :offset 64) - (next-clear-1 int32 :offset 64) - (next-clear-2 int32 :offset 68) - (next-clear-3 int32 :offset 72) - (next-clear-4 int32 :offset 76) - (count-clear uint64 :offset 80) + ((name string) + (flags uint32) + (in-level uint16) + (utextures uint16) + (geometry drawable 4) + (dists vector :inline) + (rdists vector :inline) + (next uint32 4) + (count uint16 4) + (near-plane meters :overlay-at (-> dists x)) + (near-stiff meters :overlay-at (-> dists y)) + (mid-plane meters :overlay-at (-> dists z)) + (far-plane meters :overlay-at (-> dists w)) + (rlength-near float :overlay-at (-> rdists x)) + (rlength-stiff float :overlay-at (-> rdists y)) + (rlength-mid float :overlay-at (-> rdists z)) + (stiffness float :overlay-at (-> rdists w)) + (next-clear uint128 :overlay-at (-> next 0)) + (next-clear-1 int32 :overlay-at (-> next 0)) + (next-clear-2 int32 :overlay-at (-> next 1)) + (next-clear-3 int32 :overlay-at (-> next 2)) + (next-clear-4 int32 :overlay-at (-> next 3)) + (count-clear uint64 :overlay-at (-> count 0)) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) ;; definition for method 3 of type prototype-bucket ;; INFO: Used lq/sq -(defmethod inspect prototype-bucket ((this prototype-bucket)) +(defmethod inspect ((this prototype-bucket)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tflags: ~D~%" (-> this flags)) @@ -60,19 +57,16 @@ ;; definition of type prototype-bucket-shrub (deftype prototype-bucket-shrub (prototype-bucket) - ((mod-count uint16 4 :offset-assert 88) - (last dma-packet 4 :offset-assert 96) - (count-clear-qword uint128 :offset 80) - (last-clear uint128 :offset 96) + ((mod-count uint16 4) + (last dma-packet 4) + (count-clear-qword uint128 :overlay-at (-> count 0)) + (last-clear uint128 :overlay-at (-> last 0)) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type prototype-bucket-shrub ;; INFO: Used lq/sq -(defmethod inspect prototype-bucket-shrub ((this prototype-bucket-shrub)) +(defmethod inspect ((this prototype-bucket-shrub)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tflags: ~D~%" (-> this flags)) @@ -101,17 +95,14 @@ ;; definition of type prototype-inline-array-shrub (deftype prototype-inline-array-shrub (drawable) - ((length int16 :offset 6) - (data prototype-bucket-shrub 1 :inline :offset 32) - (_pad uint32 :offset-assert 144) + ((length int16 :offset 6) + (data prototype-bucket-shrub 1 :inline :offset 32) + (_pad uint32) ) - :method-count-assert 18 - :size-assert #x94 - :flag-assert #x1200000094 ) ;; definition for method 3 of type prototype-inline-array-shrub -(defmethod inspect prototype-inline-array-shrub ((this prototype-inline-array-shrub)) +(defmethod inspect ((this prototype-inline-array-shrub)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) @@ -122,16 +113,13 @@ ;; definition of type prototype-array-shrub-info (deftype prototype-array-shrub-info (basic) - ((prototype-inline-array-shrub prototype-inline-array-shrub :offset-assert 4) - (wind-vectors uint32 :offset-assert 8) + ((prototype-inline-array-shrub prototype-inline-array-shrub) + (wind-vectors uint32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type prototype-array-shrub-info -(defmethod inspect prototype-array-shrub-info ((this prototype-array-shrub-info)) +(defmethod inspect ((this prototype-array-shrub-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tprototype-inline-array-shrub: ~A~%" (-> this prototype-inline-array-shrub)) (format #t "~Twind-vectors: #x~X~%" (-> this wind-vectors)) @@ -140,30 +128,27 @@ ;; definition of type prototype-bucket-tie (deftype prototype-bucket-tie (prototype-bucket) - ((generic-count uint16 4 :offset-assert 88) - (generic-next uint32 4 :offset-assert 96) - (frag-count uint8 4 :offset-assert 112) - (index-start uint8 4 :offset-assert 116) - (base-qw uint16 4 :offset-assert 120) - (envmap-rfade float :offset-assert 128) - (envmap-fade-far float :offset-assert 132) - (envmap-shader adgif-shader :offset-assert 136) - (collide-frag drawable-inline-array-collide-fragment :offset-assert 140) - (tie-colors time-of-day-palette :offset-assert 144) - (data uint32 :dynamic :offset-assert 148) - (color-index-qwc uint32 :dynamic :offset-assert 148) - (generic-next-clear uint128 :offset 96) - (generic-count-clear uint128 :offset 80) - (geometry-override prototype-tie 4 :offset 16) + ((generic-count uint16 4) + (generic-next uint32 4) + (frag-count uint8 4) + (index-start uint8 4) + (base-qw uint16 4) + (envmap-rfade float) + (envmap-fade-far float) + (envmap-shader adgif-shader) + (collide-frag drawable-inline-array-collide-fragment) + (tie-colors time-of-day-palette) + (data uint32 :dynamic) + (color-index-qwc uint32 :dynamic) + (generic-next-clear uint128 :overlay-at (-> generic-next 0)) + (generic-count-clear uint128 :overlay-at (-> count 0)) + (geometry-override prototype-tie 4 :overlay-at (-> geometry 0)) ) - :method-count-assert 9 - :size-assert #x94 - :flag-assert #x900000094 ) ;; definition for method 3 of type prototype-bucket-tie ;; INFO: Used lq/sq -(defmethod inspect prototype-bucket-tie ((this prototype-bucket-tie)) +(defmethod inspect ((this prototype-bucket-tie)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tflags: ~D~%" (-> this flags)) @@ -203,18 +188,15 @@ ;; definition of type prototype-array-tie (deftype prototype-array-tie (array) - ((array-data prototype-bucket-tie :dynamic :offset 16) + ((array-data prototype-bucket-tie :dynamic :offset 16) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (login (_type_) none 9) + (login (_type_) none) ) ) ;; definition for method 3 of type prototype-array-tie -(defmethod inspect prototype-array-tie ((this prototype-array-tie)) +(defmethod inspect ((this prototype-array-tie)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttype: ~A~%" (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -225,16 +207,13 @@ ;; definition of type proxy-prototype-array-tie (deftype proxy-prototype-array-tie (basic) - ((prototype-array-tie prototype-array-tie :offset-assert 4) - (wind-vectors uint32 :offset-assert 8) + ((prototype-array-tie prototype-array-tie) + (wind-vectors uint32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type proxy-prototype-array-tie -(defmethod inspect proxy-prototype-array-tie ((this proxy-prototype-array-tie)) +(defmethod inspect ((this proxy-prototype-array-tie)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tprototype-array-tie: ~A~%" (-> this prototype-array-tie)) (format #t "~Twind-vectors: #x~X~%" (-> this wind-vectors)) @@ -243,19 +222,16 @@ ;; definition of type instance (deftype instance (drawable) - ((bucket-index uint16 :offset 6) - (error (pointer drawable-error) :offset 8) - (origin matrix4h :inline :offset-assert 32) - (unknown-vector vector :inline :offset 32) - (wind-index uint16 :offset 62) + ((bucket-index uint16 :offset 6) + (error (pointer drawable-error) :offset 8) + (origin matrix4h :inline) + (unknown-vector vector :inline :overlay-at (-> origin data 0)) + (wind-index uint16 :overlay-at (-> origin data 15)) ) - :method-count-assert 18 - :size-assert #x40 - :flag-assert #x1200000040 ) ;; definition for method 3 of type instance -(defmethod inspect instance ((this instance)) +(defmethod inspect ((this instance)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) diff --git a/test/decompiler/reference/jak1/engine/gfx/background/prototype_REF.gc b/test/decompiler/reference/jak1/engine/gfx/background/prototype_REF.gc index 8027205ad99..ba0c808b208 100644 --- a/test/decompiler/reference/jak1/engine/gfx/background/prototype_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/background/prototype_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type prototype-array-tie ;; INFO: Return type mismatch prototype-array-tie vs none. -(defmethod login prototype-array-tie ((this prototype-array-tie)) +(defmethod login ((this prototype-array-tie)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this array-data s5-0))) (dotimes (s3-0 4) @@ -32,7 +32,7 @@ ) ;; definition for method 9 of type prototype-inline-array-shrub -(defmethod login prototype-inline-array-shrub ((this prototype-inline-array-shrub)) +(defmethod login ((this prototype-inline-array-shrub)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this data s5-0))) (dotimes (s3-0 4) @@ -48,7 +48,7 @@ ) ;; definition for method 8 of type prototype-array-tie -(defmethod mem-usage prototype-array-tie ((this prototype-array-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-array-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -63,7 +63,7 @@ ) ;; definition for method 8 of type prototype-bucket-tie -(defmethod mem-usage prototype-bucket-tie ((this prototype-bucket-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-bucket-tie) (arg0 memory-usage-block) (arg1 int)) (dotimes (s3-0 4) (let ((a0-1 (-> this geometry-override s3-0))) (if (nonzero? a0-1) @@ -94,7 +94,7 @@ ) ;; definition for method 8 of type prototype-inline-array-shrub -(defmethod mem-usage prototype-inline-array-shrub ((this prototype-inline-array-shrub) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-inline-array-shrub) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -109,7 +109,7 @@ ) ;; definition for method 8 of type prototype-bucket-shrub -(defmethod mem-usage prototype-bucket-shrub ((this prototype-bucket-shrub) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-bucket-shrub) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 25 (-> arg0 length))) (set! (-> arg0 data 24 name) "prototype-bucket-shrub") (+! (-> arg0 data 24 count) 1) diff --git a/test/decompiler/reference/jak1/engine/gfx/background/subdivide-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/background/subdivide-h_REF.gc index 51d7e05b0d1..165a062a09a 100644 --- a/test/decompiler/reference/jak1/engine/gfx/background/subdivide-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/background/subdivide-h_REF.gc @@ -3,21 +3,18 @@ ;; definition of type subdivide-settings (deftype subdivide-settings (basic) - ((dist float 5 :offset-assert 4) - (meters float 5 :offset-assert 24) - (close float 4 :offset-assert 44) - (far float 4 :offset-assert 60) + ((dist float 5) + (meters float 5) + (close float 4) + (far float 4) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c (:methods - (new (symbol type meters meters) _type_ 0) + (new (symbol type meters meters) _type_) ) ) ;; definition for method 3 of type subdivide-settings -(defmethod inspect subdivide-settings ((this subdivide-settings)) +(defmethod inspect ((this subdivide-settings)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tdist[5] @ #x~X~%" (-> this dist)) (format #t "~Tmeters[5] @ #x~X~%" (-> this meters)) @@ -39,18 +36,15 @@ ;; definition of type subdivide-dists (deftype subdivide-dists (structure) - ((data uint32 32 :offset 0) - (vector vector 8 :inline :offset 0) - (k0s uint128 4 :offset 0) - (k1s uint128 4 :offset 64) + ((data uint32 32 :offset 0) + (vector vector 8 :inline :overlay-at (-> data 0)) + (k0s uint128 4 :overlay-at vector) + (k1s uint128 4 :overlay-at (-> data 16)) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type subdivide-dists -(defmethod inspect subdivide-dists ((this subdivide-dists)) +(defmethod inspect ((this subdivide-dists)) (format #t "[~8x] ~A~%" this 'subdivide-dists) (format #t "~Tdata[32] @ #x~X~%" (-> this data)) (format #t "~Tvector[8] @ #x~X~%" (-> this data)) @@ -61,19 +55,16 @@ ;; definition of type gs-packed-rgba (deftype gs-packed-rgba (structure) - ((data int32 4 :offset-assert 0) - (red int32 :offset 0) - (green int32 :offset 4) - (blue int32 :offset 8) - (alpha int32 :offset 12) + ((data int32 4) + (red int32 :overlay-at (-> data 0)) + (green int32 :overlay-at (-> data 1)) + (blue int32 :overlay-at (-> data 2)) + (alpha int32 :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gs-packed-rgba -(defmethod inspect gs-packed-rgba ((this gs-packed-rgba)) +(defmethod inspect ((this gs-packed-rgba)) (format #t "[~8x] ~A~%" this 'gs-packed-rgba) (format #t "~Tdata[4] @ #x~X~%" (-> this data)) (format #t "~Tred: ~D~%" (-> this red)) @@ -85,21 +76,18 @@ ;; definition of type gs-packed-xyzw (deftype gs-packed-xyzw (structure) - ((data int32 4 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) - (z int32 :offset 8) - (w int32 :offset 12) - (quad uint128 :offset 0) + ((data int32 4) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) + (z int32 :overlay-at (-> data 2)) + (w int32 :overlay-at (-> data 3)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gs-packed-xyzw ;; INFO: Used lq/sq -(defmethod inspect gs-packed-xyzw ((this gs-packed-xyzw)) +(defmethod inspect ((this gs-packed-xyzw)) (format #t "[~8x] ~A~%" this 'gs-packed-xyzw) (format #t "~Tdata[4] @ #x~X~%" (-> this data)) (format #t "~Tx: ~D~%" (-> this x)) @@ -112,20 +100,17 @@ ;; definition of type gs-packed-stq (deftype gs-packed-stq (structure) - ((data float 4 :offset-assert 0) - (tex-s float :offset 0) - (tex-t float :offset 4) - (tex-q float :offset 8) - (quad uint128 :offset 0) + ((data float 4) + (tex-s float :overlay-at (-> data 0)) + (tex-t float :overlay-at (-> data 1)) + (tex-q float :overlay-at (-> data 2)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gs-packed-stq ;; INFO: Used lq/sq -(defmethod inspect gs-packed-stq ((this gs-packed-stq)) +(defmethod inspect ((this gs-packed-stq)) (format #t "[~8x] ~A~%" this 'gs-packed-stq) (format #t "~Tdata[4] @ #x~X~%" (-> this data)) (format #t "~Ttex-s: ~f~%" (-> this tex-s)) @@ -137,17 +122,14 @@ ;; definition of type gs-packed-gt (deftype gs-packed-gt (structure) - ((stq gs-packed-stq :inline :offset-assert 0) - (rgba gs-packed-rgba :inline :offset-assert 16) - (xyzw gs-packed-xyzw :inline :offset-assert 32) + ((stq gs-packed-stq :inline) + (rgba gs-packed-rgba :inline) + (xyzw gs-packed-xyzw :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type gs-packed-gt -(defmethod inspect gs-packed-gt ((this gs-packed-gt)) +(defmethod inspect ((this gs-packed-gt)) (format #t "[~8x] ~A~%" this 'gs-packed-gt) (format #t "~Tstq: #~%" (-> this stq)) (format #t "~Trgba: #~%" (-> this rgba)) @@ -157,15 +139,12 @@ ;; definition of type gs-packed-gt4 (deftype gs-packed-gt4 (structure) - ((data gs-packed-gt 4 :inline :offset-assert 0) + ((data gs-packed-gt 4 :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) ;; definition for method 3 of type gs-packed-gt4 -(defmethod inspect gs-packed-gt4 ((this gs-packed-gt4)) +(defmethod inspect ((this gs-packed-gt4)) (format #t "[~8x] ~A~%" this 'gs-packed-gt4) (format #t "~Tdata[4] @ #x~X~%" (-> this data)) this @@ -173,16 +152,13 @@ ;; definition of type terrain-bsp (deftype terrain-bsp (structure) - ((lev-index int32 :offset-assert 0) - (mood basic :offset-assert 4) + ((lev-index int32) + (mood basic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type terrain-bsp -(defmethod inspect terrain-bsp ((this terrain-bsp)) +(defmethod inspect ((this terrain-bsp)) (format #t "[~8x] ~A~%" this 'terrain-bsp) (format #t "~Tlev-index: ~D~%" (-> this lev-index)) (format #t "~Tmood: ~A~%" (-> this mood)) @@ -191,30 +167,27 @@ ;; definition of type terrain-stats (deftype terrain-stats (structure) - ((pris tr-stat :inline :offset-assert 0) - (tie-generic tr-stat :inline :offset-assert 16) - (tie tr-stat :inline :offset-assert 32) - (tie-near tr-stat :inline :offset-assert 48) - (shrub-near tr-stat :inline :offset-assert 64) - (shrub tr-stat :inline :offset-assert 80) - (tfrag-near tr-stat :inline :offset-assert 96) - (tfrag tr-stat :inline :offset-assert 112) - (billboard tr-stat :inline :offset-assert 128) - (trans-tfrag tr-stat :inline :offset-assert 144) - (trans-tfrag-near tr-stat :inline :offset-assert 160) - (trans-pris tr-stat :inline :offset-assert 176) - (trans-shrub tr-stat :inline :offset-assert 192) - (ocean-mid tr-stat :inline :offset-assert 208) - (ocean-near tr-stat :inline :offset-assert 224) - (total tr-stat :inline :offset-assert 240) + ((pris tr-stat :inline) + (tie-generic tr-stat :inline) + (tie tr-stat :inline) + (tie-near tr-stat :inline) + (shrub-near tr-stat :inline) + (shrub tr-stat :inline) + (tfrag-near tr-stat :inline) + (tfrag tr-stat :inline) + (billboard tr-stat :inline) + (trans-tfrag tr-stat :inline) + (trans-tfrag-near tr-stat :inline) + (trans-pris tr-stat :inline) + (trans-shrub tr-stat :inline) + (ocean-mid tr-stat :inline) + (ocean-near tr-stat :inline) + (total tr-stat :inline) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; definition for method 3 of type terrain-stats -(defmethod inspect terrain-stats ((this terrain-stats)) +(defmethod inspect ((this terrain-stats)) (format #t "[~8x] ~A~%" this 'terrain-stats) (format #t "~Tpris: #~%" (-> this pris)) (format #t "~Ttie-generic: #~%" (-> this tie-generic)) @@ -237,22 +210,19 @@ ;; definition of type dma-area (deftype dma-area (structure) - ((draw-node-dma draw-node-dma :inline :offset 0) - (tfrag-dma tfrag-dma :inline :offset 0) - (instance-shrub-dma instance-shrub-dma :inline :offset 0) - (instance-tie-dma instance-tie-dma :inline :offset 0) - (prototype-tie-dma prototype-tie-dma :inline :offset 0) - (time-of-day-dma time-of-day-dma :inline :offset 0) - (decomp-work decomp-work :inline :offset 0) - (ocean-vertex ocean-vertex 4 :inline :offset 0) + ((draw-node-dma draw-node-dma :inline :offset 0) + (tfrag-dma tfrag-dma :inline :offset 0) + (instance-shrub-dma instance-shrub-dma :inline :offset 0) + (instance-tie-dma instance-tie-dma :inline :offset 0) + (prototype-tie-dma prototype-tie-dma :inline :offset 0) + (time-of-day-dma time-of-day-dma :inline :offset 0) + (decomp-work decomp-work :inline :offset 0) + (ocean-vertex ocean-vertex 4 :inline :offset 0) ) - :method-count-assert 9 - :size-assert #x38a0 - :flag-assert #x9000038a0 ) ;; definition for method 3 of type dma-area -(defmethod inspect dma-area ((this dma-area)) +(defmethod inspect ((this dma-area)) (format #t "[~8x] ~A~%" this 'dma-area) (format #t "~Tdraw-node-dma: #~%" (-> this draw-node-dma)) (format #t "~Ttfrag-dma: #~%" (-> this draw-node-dma)) @@ -267,16 +237,13 @@ ;; definition of type background-area (deftype background-area (structure) - ((dma-area dma-area :inline :offset-assert 0) - (vis-list uint8 2048 :offset-assert 14496) + ((dma-area dma-area :inline) + (vis-list uint8 2048) ) - :method-count-assert 9 - :size-assert #x40a0 - :flag-assert #x9000040a0 ) ;; definition for method 3 of type background-area -(defmethod inspect background-area ((this background-area)) +(defmethod inspect ((this background-area)) (format #t "[~8x] ~A~%" this 'background-area) (format #t "~Tdma-area: #~%" (-> this dma-area)) (format #t "~Tvis-list[2048] @ #x~X~%" (-> this vis-list)) @@ -285,18 +252,15 @@ ;; definition of type foreground-area (deftype foreground-area (structure) - ((joint-work joint-work :inline :offset-assert 0) - (generic-work generic-work :inline :offset 0) - (bone-mem bone-memory :inline :offset 0) - (shadow-work shadow-work :inline :offset 0) + ((joint-work joint-work :inline) + (generic-work generic-work :inline :overlay-at (-> joint-work temp-mtx data 0)) + (bone-mem bone-memory :inline :overlay-at (-> joint-work temp-mtx data 0)) + (shadow-work shadow-work :inline :overlay-at (-> joint-work temp-mtx data 0)) ) - :method-count-assert 9 - :size-assert #x3fd0 - :flag-assert #x900003fd0 ) ;; definition for method 3 of type foreground-area -(defmethod inspect foreground-area ((this foreground-area)) +(defmethod inspect ((this foreground-area)) (format #t "[~8x] ~A~%" this 'foreground-area) (format #t "~Tjoint-work: #~%" (-> this joint-work)) (format #t "~Tgeneric-work: #~%" (-> this joint-work)) @@ -307,15 +271,12 @@ ;; definition of type ambient-area (deftype ambient-area (structure) - ((ambient-list ambient-list :inline :offset-assert 0) + ((ambient-list ambient-list :inline) ) - :method-count-assert 9 - :size-assert #x2004 - :flag-assert #x900002004 ) ;; definition for method 3 of type ambient-area -(defmethod inspect ambient-area ((this ambient-area)) +(defmethod inspect ((this ambient-area)) (format #t "[~8x] ~A~%" this 'ambient-area) (format #t "~Tambient-list: #~%" (-> this ambient-list)) this @@ -323,17 +284,14 @@ ;; definition of type work-area (deftype work-area (structure) - ((background background-area :inline :offset-assert 0) - (foreground foreground-area :inline :offset 0) - (ambient ambient-area :inline :offset 0) + ((background background-area :inline) + (foreground foreground-area :inline :offset 0) + (ambient ambient-area :inline :offset 0) ) - :method-count-assert 9 - :size-assert #x40a0 - :flag-assert #x9000040a0 ) ;; definition for method 3 of type work-area -(defmethod inspect work-area ((this work-area)) +(defmethod inspect ((this work-area)) (format #t "[~8x] ~A~%" this 'work-area) (format #t "~Tbackground: #~%" (-> this background)) (format #t "~Tforeground: #~%" (-> this background)) @@ -343,16 +301,13 @@ ;; definition of type terrain-context (deftype terrain-context (structure) - ((bsp terrain-bsp :inline :offset-assert 0) - (work work-area :inline :offset-assert 16) + ((bsp terrain-bsp :inline) + (work work-area :inline) ) - :method-count-assert 9 - :size-assert #x40b0 - :flag-assert #x9000040b0 ) ;; definition for method 3 of type terrain-context -(defmethod inspect terrain-context ((this terrain-context)) +(defmethod inspect ((this terrain-context)) (format #t "[~8x] ~A~%" this 'terrain-context) (format #t "~Tbsp: #~%" (-> this bsp)) (format #t "~Twork: #~%" (-> this work)) diff --git a/test/decompiler/reference/jak1/engine/gfx/background/subdivide_REF.gc b/test/decompiler/reference/jak1/engine/gfx/background/subdivide_REF.gc index 56e7d912ba4..4ee2cb83d19 100644 --- a/test/decompiler/reference/jak1/engine/gfx/background/subdivide_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/background/subdivide_REF.gc @@ -184,7 +184,7 @@ ;; definition for method 10 of type perf-stat ;; INFO: Return type mismatch perf-stat vs none. -(defmethod print-to-stream perf-stat ((this perf-stat) (arg0 string) (arg1 basic)) +(defmethod print-to-stream ((this perf-stat) (arg0 string) (arg1 basic)) (format *stdcon* "~3d ~8d ~8d ~6d ~6d" diff --git a/test/decompiler/reference/jak1/engine/gfx/background/wind-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/background/wind-h_REF.gc index a4176bf0e40..d79606ec684 100644 --- a/test/decompiler/reference/jak1/engine/gfx/background/wind-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/background/wind-h_REF.gc @@ -3,16 +3,13 @@ ;; definition of type wind-vector (deftype wind-vector (structure) - ((wind-pos vector2w :inline :offset-assert 0) - (wind-vel vector2w :inline :offset-assert 8) + ((wind-pos vector2w :inline) + (wind-vel vector2w :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type wind-vector -(defmethod inspect wind-vector ((this wind-vector)) +(defmethod inspect ((this wind-vector)) (format #t "[~8x] ~A~%" this 'wind-vector) (format #t "~Twind-pos: #~%" (-> this wind-pos)) (format #t "~Twind-vel: #~%" (-> this wind-vel)) @@ -58,19 +55,16 @@ ;; definition of type wind-work (deftype wind-work (basic) - ((wind-array vector 64 :inline :offset-assert 16) - (wind-normal vector :inline :offset-assert 1040) - (wind-temp vector :inline :offset-assert 1056) - (wind-force float 64 :offset-assert 1072) - (wind-time uint32 :offset-assert 1328) + ((wind-array vector 64 :inline) + (wind-normal vector :inline) + (wind-temp vector :inline) + (wind-force float 64) + (wind-time uint32) ) - :method-count-assert 9 - :size-assert #x534 - :flag-assert #x900000534 ) ;; definition for method 3 of type wind-work -(defmethod inspect wind-work ((this wind-work)) +(defmethod inspect ((this wind-work)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Twind-array[64] @ #x~X~%" (-> this wind-array)) (format #t "~Twind-normal: ~`vector`P~%" (-> this wind-normal)) diff --git a/test/decompiler/reference/jak1/engine/gfx/depth-cue-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/depth-cue-h_REF.gc index ad4ef4f7cd9..fbd701a860e 100644 --- a/test/decompiler/reference/jak1/engine/gfx/depth-cue-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/depth-cue-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type depth-cue-data (deftype depth-cue-data (structure) - ((data vector :inline :offset-assert 0) - (sharpness float :offset 0) - (alpha float :offset 4) - (distance float :offset 8) - (w float :offset 12) + ((data vector :inline) + (sharpness float :overlay-at (-> data x)) + (alpha float :overlay-at (-> data y)) + (distance float :overlay-at (-> data z)) + (w float :overlay-at (-> data w)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type depth-cue-data -(defmethod inspect depth-cue-data ((this depth-cue-data)) +(defmethod inspect ((this depth-cue-data)) (format #t "[~8x] ~A~%" this 'depth-cue-data) (format #t "~Tdata: #~%" (-> this data)) (format #t "~Tsharpness: ~f~%" (-> this data x)) @@ -27,22 +24,19 @@ ;; definition of type depth-cue-work (deftype depth-cue-work (structure) - ((texture-strip-tmpl dma-gif-packet :inline :offset-assert 0) - (temp-strip-tmpl dma-gif-packet :inline :offset-assert 32) - (stencil-tmpl dma-gif-packet :inline :offset-assert 64) - (clear-color vector4w :inline :offset-assert 96) - (set-color vector4w :inline :offset-assert 112) - (draw-color vector4w :inline :offset-assert 128) - (depth depth-cue-data :offset-assert 144) - (front depth-cue-data :offset-assert 148) + ((texture-strip-tmpl dma-gif-packet :inline) + (temp-strip-tmpl dma-gif-packet :inline) + (stencil-tmpl dma-gif-packet :inline) + (clear-color vector4w :inline) + (set-color vector4w :inline) + (draw-color vector4w :inline) + (depth depth-cue-data) + (front depth-cue-data) ) - :method-count-assert 9 - :size-assert #x98 - :flag-assert #x900000098 ) ;; definition for method 3 of type depth-cue-work -(defmethod inspect depth-cue-work ((this depth-cue-work)) +(defmethod inspect ((this depth-cue-work)) (format #t "[~8x] ~A~%" this 'depth-cue-work) (format #t "~Ttexture-strip-tmpl: #~%" (-> this texture-strip-tmpl)) (format #t "~Ttemp-strip-tmpl: #~%" (-> this temp-strip-tmpl)) diff --git a/test/decompiler/reference/jak1/engine/gfx/font-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/font-h_REF.gc index ac7842af7c5..dcef9bed57b 100644 --- a/test/decompiler/reference/jak1/engine/gfx/font-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/font-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type char-verts (deftype char-verts (structure) - ((pos vector 4 :inline :offset-assert 0) - (color vector 4 :inline :offset-assert 64) - (tex-st vector 4 :inline :offset-assert 128) + ((pos vector 4 :inline) + (color vector 4 :inline) + (tex-st vector 4 :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) ;; definition for method 3 of type char-verts -(defmethod inspect char-verts ((this char-verts)) +(defmethod inspect ((this char-verts)) (format #t "[~8x] ~A~%" this 'char-verts) (format #t "~Tpos[4] @ #x~X~%" (-> this pos)) (format #t "~Tcolor[4] @ #x~X~%" (-> this color)) @@ -23,15 +20,12 @@ ;; definition of type char-color (deftype char-color (structure) - ((color rgba 4 :offset-assert 0) + ((color rgba 4) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type char-color -(defmethod inspect char-color ((this char-color)) +(defmethod inspect ((this char-color)) (format #t "[~8x] ~A~%" this 'char-color) (format #t "~Tcolor[4] @ #x~X~%" (-> this color)) this @@ -49,41 +43,38 @@ ;; definition of type font-context (deftype font-context (basic) - ((origin vector :inline :offset-assert 16) - (strip-gif vector :inline :offset-assert 32) - (width float :offset-assert 48) - (height float :offset-assert 52) - (projection float :offset-assert 56) - (context-vec vector :inline :offset 48) - (color font-color :offset-assert 64) - (color-s32 int32 :offset 64) - (flags font-flags :offset-assert 72) - (flags-signed int32 :offset 72) - (mat matrix :offset-assert 76) - (start-line uint32 :offset-assert 80) - (scale float :offset-assert 84) + ((origin vector :inline) + (strip-gif vector :inline) + (width float) + (height float) + (projection float) + (context-vec vector :inline :overlay-at width) + (color font-color) + (color-s32 int32 :overlay-at color) + (flags font-flags) + (flags-signed int32 :overlay-at flags) + (mat matrix) + (start-line uint32) + (scale float) ) - :method-count-assert 20 - :size-assert #x58 - :flag-assert #x1400000058 (:methods - (new (symbol type matrix int int float font-color font-flags) _type_ 0) - (set-mat! (font-context matrix) font-context 9) - (set-origin! (font-context int int) font-context 10) - (set-depth! (font-context int) font-context 11) - (set-w! (font-context float) font-context 12) - (set-width! (font-context int) font-context 13) - (set-height! (font-context int) font-context 14) - (set-projection! (font-context float) font-context 15) - (set-color! (font-context font-color) font-context 16) - (set-flags! (font-context font-flags) font-context 17) - (set-start-line! (font-context uint) font-context 18) - (set-scale! (font-context float) font-context 19) + (new (symbol type matrix int int float font-color font-flags) _type_) + (set-mat! (font-context matrix) font-context) + (set-origin! (font-context int int) font-context) + (set-depth! (font-context int) font-context) + (set-w! (font-context float) font-context) + (set-width! (font-context int) font-context) + (set-height! (font-context int) font-context) + (set-projection! (font-context float) font-context) + (set-color! (font-context font-color) font-context) + (set-flags! (font-context font-flags) font-context) + (set-start-line! (font-context uint) font-context) + (set-scale! (font-context float) font-context) ) ) ;; definition for method 3 of type font-context -(defmethod inspect font-context ((this font-context)) +(defmethod inspect ((this font-context)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Torigin: #~%" (-> this origin)) (format #t "~Tstrip-gif: #~%" (-> this strip-gif)) @@ -99,68 +90,68 @@ ) ;; definition for method 9 of type font-context -(defmethod set-mat! font-context ((this font-context) (mat matrix)) +(defmethod set-mat! ((this font-context) (mat matrix)) (set! (-> this mat) mat) this ) ;; definition for method 10 of type font-context -(defmethod set-origin! font-context ((this font-context) (x int) (y int)) +(defmethod set-origin! ((this font-context) (x int) (y int)) (set! (-> this origin x) (the float x)) (set! (-> this origin y) (the float y)) this ) ;; definition for method 11 of type font-context -(defmethod set-depth! font-context ((this font-context) (z int)) +(defmethod set-depth! ((this font-context) (z int)) (set! (-> this origin z) (the float z)) this ) ;; definition for method 12 of type font-context -(defmethod set-w! font-context ((this font-context) (w float)) +(defmethod set-w! ((this font-context) (w float)) (set! (-> this origin w) w) this ) ;; definition for method 13 of type font-context -(defmethod set-width! font-context ((this font-context) (width int)) +(defmethod set-width! ((this font-context) (width int)) (set! (-> this width) (the float width)) this ) ;; definition for method 14 of type font-context -(defmethod set-height! font-context ((this font-context) (height int)) +(defmethod set-height! ((this font-context) (height int)) (set! (-> this height) (the float height)) this ) ;; definition for method 15 of type font-context -(defmethod set-projection! font-context ((this font-context) (proj float)) +(defmethod set-projection! ((this font-context) (proj float)) (set! (-> this projection) proj) this ) ;; definition for method 16 of type font-context -(defmethod set-color! font-context ((this font-context) (color font-color)) +(defmethod set-color! ((this font-context) (color font-color)) (set! (-> this color) color) this ) ;; definition for method 17 of type font-context -(defmethod set-flags! font-context ((this font-context) (flags font-flags)) +(defmethod set-flags! ((this font-context) (flags font-flags)) (set! (-> this flags) flags) this ) ;; definition for method 18 of type font-context -(defmethod set-start-line! font-context ((this font-context) (start-line uint)) +(defmethod set-start-line! ((this font-context) (start-line uint)) (set! (-> this start-line) start-line) this ) ;; definition for method 19 of type font-context -(defmethod set-scale! font-context ((this font-context) (scale float)) +(defmethod set-scale! ((this font-context) (scale float)) (set! (-> this scale) scale) this ) @@ -219,52 +210,49 @@ ;; definition of type font-work (deftype font-work (structure) - ((font-tmpl dma-gif-packet :inline :offset-assert 0) - (char-tmpl dma-gif-packet :inline :offset-assert 32) - (tex1-tmpl uint64 2 :offset-assert 64) - (small-font-lo-tmpl uint64 2 :offset-assert 80) - (small-font-lo-tmpl-qw uint128 :offset 80) - (small-font-hi-tmpl uint64 2 :offset-assert 96) - (small-font-hi-tmpl-qw uint128 :offset 96) - (large-font-lo-tmpl uint64 2 :offset-assert 112) - (large-font-lo-tmpl-qw uint128 :offset 112) - (large-font-hi-tmpl uint64 2 :offset-assert 128) - (large-font-hi-tmpl-qw uint128 :offset 128) - (size1-small vector :inline :offset-assert 144) - (size2-small vector :inline :offset-assert 160) - (size3-small vector :inline :offset-assert 176) - (size1-large vector :inline :offset-assert 192) - (size2-large vector :inline :offset-assert 208) - (size3-large vector :inline :offset-assert 224) - (size-st1 vector :inline :offset-assert 240) - (size-st2 vector :inline :offset-assert 256) - (size-st3 vector :inline :offset-assert 272) - (save vector :inline :offset-assert 288) - (save-color vector 4 :inline :offset-assert 304) - (current-verts char-verts :inline :offset-assert 368) - (src-verts char-verts :inline :offset-assert 560) - (dest-verts char-verts :inline :offset-assert 752) - (justify vector 64 :inline :offset-assert 944) - (color-shadow vector4w :inline :offset-assert 1968) - (color-table char-color 64 :inline :offset-assert 1984) - (last-color font-color :offset-assert 3008) - (last-color-32 int32 :offset 3008) - (save-last-color font-color :offset-assert 3016) - (save-last-color-32 int32 :offset 3016) - (buf basic :offset-assert 3024) - (str-ptr uint32 :offset-assert 3028) - (str-ptr-signed (pointer uint8) :offset 3028) - (flags font-flags :offset-assert 3032) - (flags-signed int32 :offset 3032) - (reg-save uint32 5 :offset-assert 3036) + ((font-tmpl dma-gif-packet :inline) + (char-tmpl dma-gif-packet :inline) + (tex1-tmpl uint64 2) + (small-font-lo-tmpl uint64 2) + (small-font-lo-tmpl-qw uint128 :overlay-at (-> small-font-lo-tmpl 0)) + (small-font-hi-tmpl uint64 2) + (small-font-hi-tmpl-qw uint128 :overlay-at (-> small-font-hi-tmpl 0)) + (large-font-lo-tmpl uint64 2) + (large-font-lo-tmpl-qw uint128 :overlay-at (-> large-font-lo-tmpl 0)) + (large-font-hi-tmpl uint64 2) + (large-font-hi-tmpl-qw uint128 :overlay-at (-> large-font-hi-tmpl 0)) + (size1-small vector :inline) + (size2-small vector :inline) + (size3-small vector :inline) + (size1-large vector :inline) + (size2-large vector :inline) + (size3-large vector :inline) + (size-st1 vector :inline) + (size-st2 vector :inline) + (size-st3 vector :inline) + (save vector :inline) + (save-color vector 4 :inline) + (current-verts char-verts :inline) + (src-verts char-verts :inline) + (dest-verts char-verts :inline) + (justify vector 64 :inline) + (color-shadow vector4w :inline) + (color-table char-color 64 :inline) + (last-color font-color) + (last-color-32 int32 :overlay-at last-color) + (save-last-color font-color) + (save-last-color-32 int32 :overlay-at save-last-color) + (buf basic) + (str-ptr uint32) + (str-ptr-signed (pointer uint8) :overlay-at str-ptr) + (flags font-flags) + (flags-signed int32 :overlay-at flags) + (reg-save uint32 5) ) - :method-count-assert 9 - :size-assert #xbf0 - :flag-assert #x900000bf0 ) ;; definition for method 3 of type font-work -(defmethod inspect font-work ((this font-work)) +(defmethod inspect ((this font-work)) (format #t "[~8x] ~A~%" this 'font-work) (format #t "~Tfont-tmpl: #~%" (-> this font-tmpl)) (format #t "~Tchar-tmpl: #~%" (-> this char-tmpl)) diff --git a/test/decompiler/reference/jak1/engine/gfx/foreground/bones-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/foreground/bones-h_REF.gc index 6e802a87502..33b7207dfa7 100644 --- a/test/decompiler/reference/jak1/engine/gfx/foreground/bones-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/foreground/bones-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type bone-buffer (deftype bone-buffer (structure) - ((joint joint-anim-compressed-hdr 16 :inline :offset-assert 0) - (bone bone 16 :inline :offset-assert 1024) - (_pad uint8 2048 :offset-assert 2560) + ((joint joint-anim-compressed-hdr 16 :inline) + (bone bone 16 :inline) + (_pad uint8 2048) ) - :method-count-assert 9 - :size-assert #x1200 - :flag-assert #x900001200 ) ;; definition for method 3 of type bone-buffer -(defmethod inspect bone-buffer ((this bone-buffer)) +(defmethod inspect ((this bone-buffer)) (format #t "[~8x] ~A~%" this 'bone-buffer) (format #t "~Tjoint[16] @ #x~X~%" (-> this joint)) (format #t "~Tbone[16] @ #x~X~%" (-> this bone)) @@ -23,19 +20,16 @@ ;; definition of type bone-layout (deftype bone-layout (structure) - ((joint joint 2 :offset-assert 0) - (bone bone 2 :offset-assert 8) - (data uint16 8 :offset 0) - (output uint32 2 :offset-assert 16) - (cache uint32 2 :offset-assert 24) + ((joint joint 2) + (bone bone 2) + (data uint16 8 :overlay-at (-> joint 0)) + (output uint32 2) + (cache uint32 2) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type bone-layout -(defmethod inspect bone-layout ((this bone-layout)) +(defmethod inspect ((this bone-layout)) (format #t "[~8x] ~A~%" this 'bone-layout) (format #t "~Tdata[8] @ #x~X~%" (-> this joint)) (format #t "~Tjoint[2] @ #x~X~%" (-> this joint)) @@ -47,17 +41,14 @@ ;; definition of type bone-regs (deftype bone-regs (structure) - ((joint-ptr (inline-array joint) :offset-assert 0) - (bone-ptr (inline-array bone) :offset-assert 4) - (num-bones uint32 :offset-assert 8) + ((joint-ptr (inline-array joint)) + (bone-ptr (inline-array bone)) + (num-bones uint32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type bone-regs -(defmethod inspect bone-regs ((this bone-regs)) +(defmethod inspect ((this bone-regs)) (format #t "[~8x] ~A~%" this 'bone-regs) (format #t "~Tjoint-ptr: #x~X~%" (-> this joint-ptr)) (format #t "~Tbone-ptr: #x~X~%" (-> this bone-ptr)) @@ -67,28 +58,25 @@ ;; definition of type bone-work (deftype bone-work (structure) - ((layout bone-layout :inline :offset-assert 0) - (bounds sphere :inline :offset-assert 32) - (lights vu-lights :inline :offset-assert 48) - (distance vector :inline :offset-assert 160) - (next-tag dma-packet :inline :offset-assert 176) - (dma-buf dma-buffer :offset-assert 192) - (sink-group dma-foreground-sink-group :offset-assert 196) - (next-pris dma-packet :offset-assert 200) - (next-merc dma-packet :offset-assert 204) - (wait-count uint32 :offset-assert 208) - (in-count uint32 :offset-assert 212) - (sp-size uint32 :offset-assert 216) - (sp-bufnum uint32 :offset-assert 220) - (regs bone-regs :inline :offset-assert 224) + ((layout bone-layout :inline) + (bounds sphere :inline) + (lights vu-lights :inline) + (distance vector :inline) + (next-tag dma-packet :inline) + (dma-buf dma-buffer) + (sink-group dma-foreground-sink-group) + (next-pris dma-packet) + (next-merc dma-packet) + (wait-count uint32) + (in-count uint32) + (sp-size uint32) + (sp-bufnum uint32) + (regs bone-regs :inline) ) - :method-count-assert 9 - :size-assert #xec - :flag-assert #x9000000ec ) ;; definition for method 3 of type bone-work -(defmethod inspect bone-work ((this bone-work)) +(defmethod inspect ((this bone-work)) (format #t "[~8x] ~A~%" this 'bone-work) (format #t "~Tlayout: #~%" (-> this layout)) (format #t "~Tbounds: #~%" (-> this bounds)) @@ -109,16 +97,13 @@ ;; definition of type bone-debug (deftype bone-debug (structure) - ((time-ctr uint32 :offset-assert 0) - (timing uint32 360 :offset-assert 4) + ((time-ctr uint32) + (timing uint32 360) ) - :method-count-assert 9 - :size-assert #x5a4 - :flag-assert #x9000005a4 ) ;; definition for method 3 of type bone-debug -(defmethod inspect bone-debug ((this bone-debug)) +(defmethod inspect ((this bone-debug)) (format #t "[~8x] ~A~%" this 'bone-debug) (format #t "~Ttime-ctr: ~D~%" (-> this time-ctr)) (format #t "~Ttiming[360] @ #x~X~%" (-> this timing)) @@ -127,17 +112,14 @@ ;; definition of type bone-memory (deftype bone-memory (structure) - ((work bone-work :inline :offset-assert 0) - (buffer bone-buffer 2 :inline :offset-assert 240) - (dma-list dma-packet :inline :offset 240) + ((work bone-work :inline) + (buffer bone-buffer 2 :inline) + (dma-list dma-packet :inline :overlay-at (-> buffer 0 joint 0 control-bits 0)) ) - :method-count-assert 9 - :size-assert #x24f0 - :flag-assert #x9000024f0 ) ;; definition for method 3 of type bone-memory -(defmethod inspect bone-memory ((this bone-memory)) +(defmethod inspect ((this bone-memory)) (format #t "[~8x] ~A~%" this 'bone-memory) (format #t "~Twork: #~%" (-> this work)) (format #t "~Tbuffer[2] @ #x~X~%" (-> this buffer)) @@ -159,18 +141,15 @@ ;; definition of type merc-globals (deftype merc-globals (structure) - ((first uint32 :offset-assert 0) - (next (pointer uint32) :offset-assert 4) - (sink generic-dma-foreground-sink :offset-assert 8) + ((first uint32) + (next (pointer uint32)) + (sink generic-dma-foreground-sink) ) :allow-misaligned - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type merc-globals -(defmethod inspect merc-globals ((this merc-globals)) +(defmethod inspect ((this merc-globals)) (format #t "[~8x] ~A~%" this 'merc-globals) (format #t "~Tfirst: #x~X~%" (-> this first)) (format #t "~Tnext: #x~X~%" (-> this next)) @@ -180,16 +159,13 @@ ;; definition of type merc-global-array (deftype merc-global-array (structure) - ((count uint32 :offset-assert 0) - (globals merc-globals 8 :inline :offset-assert 4) + ((count uint32) + (globals merc-globals 8 :inline) ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) ;; definition for method 3 of type merc-global-array -(defmethod inspect merc-global-array ((this merc-global-array)) +(defmethod inspect ((this merc-global-array)) (format #t "[~8x] ~A~%" this 'merc-global-array) (format #t "~Tcount: ~D~%" (-> this count)) (format #t "~Tglobals[8] @ #x~X~%" (-> this globals)) @@ -201,19 +177,16 @@ ;; definition of type shadow-dma-packet (deftype shadow-dma-packet (structure) - ((tag generic-merc-tag :inline :offset-assert 0) - (settings shadow-settings :inline :offset-assert 16) - (geo-ref dma-packet :inline :offset-assert 96) - (mtx-ref dma-packet :inline :offset-assert 112) - (end-tag dma-packet :inline :offset-assert 128) + ((tag generic-merc-tag :inline) + (settings shadow-settings :inline) + (geo-ref dma-packet :inline) + (mtx-ref dma-packet :inline) + (end-tag dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) ;; definition for method 3 of type shadow-dma-packet -(defmethod inspect shadow-dma-packet ((this shadow-dma-packet)) +(defmethod inspect ((this shadow-dma-packet)) (format #t "[~8x] ~A~%" this 'shadow-dma-packet) (format #t "~Ttag: #~%" (-> this tag)) (format #t "~Tsettings: #~%" (-> this settings)) diff --git a/test/decompiler/reference/jak1/engine/gfx/foreground/eye-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/foreground/eye-h_REF.gc index f30f1112416..3b7f323ac3a 100644 --- a/test/decompiler/reference/jak1/engine/gfx/foreground/eye-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/foreground/eye-h_REF.gc @@ -3,21 +3,18 @@ ;; definition of type eye (deftype eye (structure) - ((data vector 2 :inline :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (lid float :offset 8) - (iris-scale float :offset 16) - (pupil-scale float :offset 20) - (lid-scale float :offset 24) + ((data vector 2 :inline) + (x float :overlay-at (-> data 0 x)) + (y float :overlay-at (-> data 0 y)) + (lid float :overlay-at (-> data 0 z)) + (iris-scale float :offset 16) + (pupil-scale float :offset 20) + (lid-scale float :offset 24) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type eye -(defmethod inspect eye ((this eye)) +(defmethod inspect ((this eye)) (format #t "[~8x] ~A~%" this 'eye) (format #t "~Tdata[2] @ #x~X~%" (-> this data)) (format #t "~Tx: ~f~%" (-> this data 0 x)) @@ -31,21 +28,18 @@ ;; definition of type eye-control (deftype eye-control (structure) - ((process handle :offset-assert 0) - (random-time uint16 :offset-assert 8) - (level uint16 :offset-assert 10) - (blink float :offset-assert 12) - (shaders (inline-array adgif-shader) :offset-assert 16) - (left eye :inline :offset-assert 32) - (right eye :inline :offset-assert 64) + ((process handle) + (random-time uint16) + (level uint16) + (blink float) + (shaders (inline-array adgif-shader)) + (left eye :inline) + (right eye :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type eye-control -(defmethod inspect eye-control ((this eye-control)) +(defmethod inspect ((this eye-control)) (format #t "[~8x] ~A~%" this 'eye-control) (format #t "~Tprocess: ~D~%" (-> this process)) (format #t "~Trandom-time: ~D~%" (-> this random-time)) @@ -59,15 +53,12 @@ ;; definition of type eye-control-array (deftype eye-control-array (basic) - ((data eye-control 11 :inline :offset-assert 16) + ((data eye-control 11 :inline) ) - :method-count-assert 9 - :size-assert #x430 - :flag-assert #x900000430 ) ;; definition for method 3 of type eye-control-array -(defmethod inspect eye-control-array ((this eye-control-array)) +(defmethod inspect ((this eye-control-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tdata[11] @ #x~X~%" (-> this data)) this @@ -75,18 +66,15 @@ ;; definition of type eye-work (deftype eye-work (structure) - ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) - (sprite-tmpl2 dma-gif-packet :inline :offset-assert 32) - (adgif-tmpl dma-gif-packet :inline :offset-assert 64) - (blink-table float 10 :offset-assert 96) + ((sprite-tmpl dma-gif-packet :inline) + (sprite-tmpl2 dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (blink-table float 10) ) - :method-count-assert 9 - :size-assert #x88 - :flag-assert #x900000088 ) ;; definition for method 3 of type eye-work -(defmethod inspect eye-work ((this eye-work)) +(defmethod inspect ((this eye-work)) (format #t "[~8x] ~A~%" this 'eye-work) (format #t "~Tsprite-tmpl: #~%" (-> this sprite-tmpl)) (format #t "~Tsprite-tmpl2: #~%" (-> this sprite-tmpl2)) diff --git a/test/decompiler/reference/jak1/engine/gfx/foreground/ripple_REF.gc b/test/decompiler/reference/jak1/engine/gfx/foreground/ripple_REF.gc index f5f1a4d058c..0a1b4f4ccc4 100644 --- a/test/decompiler/reference/jak1/engine/gfx/foreground/ripple_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/foreground/ripple_REF.gc @@ -3,17 +3,14 @@ ;; definition of type ripple-request (deftype ripple-request (structure) - ((waveform ripple-wave :offset-assert 0) - (effect merc-effect :offset-assert 4) + ((waveform ripple-wave) + (effect merc-effect) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type ripple-request -(defmethod inspect ripple-request ((this ripple-request)) +(defmethod inspect ((this ripple-request)) (format #t "[~8x] ~A~%" this 'ripple-request) (format #t "~Twaveform: ~A~%" (-> this waveform)) (format #t "~Teffect: #~%" (-> this effect)) @@ -22,16 +19,13 @@ ;; definition of type ripple-globals (deftype ripple-globals (structure) - ((count int32 :offset-assert 0) - (requests ripple-request 16 :inline :offset-assert 4) + ((count int32) + (requests ripple-request 16 :inline) ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) ;; definition for method 3 of type ripple-globals -(defmethod inspect ripple-globals ((this ripple-globals)) +(defmethod inspect ((this ripple-globals)) (format #t "[~8x] ~A~%" this 'ripple-globals) (format #t "~Tcount: ~D~%" (-> this count)) (format #t "~Trequests[16] @ #x~X~%" (-> this requests)) diff --git a/test/decompiler/reference/jak1/engine/gfx/generic/generic-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/generic/generic-h_REF.gc index 5dabde5697d..c9c58262e11 100644 --- a/test/decompiler/reference/jak1/engine/gfx/generic/generic-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/generic/generic-h_REF.gc @@ -3,26 +3,23 @@ ;; definition of type gsf-vertex (deftype gsf-vertex (structure) - ((data uint32 8 :offset-assert 0) - (byte uint8 32 :offset 0) - (quad uint128 2 :offset 0) - (vt qword :inline :offset 0) - (pos vector3s :inline :offset 0) - (tex vector2uh :inline :offset 12) - (nrm vector3s :inline :offset 16) - (nc qword :inline :offset 16) - (clr vector4ub :inline :offset 28) - (dtex vector2uh :inline :offset 16) - (dclr vector4ub :inline :offset 20) + ((data uint32 8) + (byte uint8 32 :overlay-at (-> data 0)) + (quad uint128 2 :overlay-at (-> data 0)) + (vt qword :inline :overlay-at (-> data 0)) + (pos vector3s :inline :overlay-at (-> data 0)) + (tex vector2uh :inline :overlay-at (-> data 3)) + (nrm vector3s :inline :overlay-at (-> data 4)) + (nc qword :inline :overlay-at (-> data 4)) + (clr vector4ub :inline :overlay-at (-> data 7)) + (dtex vector2uh :inline :overlay-at (-> data 4)) + (dclr vector4ub :inline :overlay-at (-> data 5)) ) :pack-me - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type gsf-vertex -(defmethod inspect gsf-vertex ((this gsf-vertex)) +(defmethod inspect ((this gsf-vertex)) (format #t "[~8x] ~A~%" this 'gsf-vertex) (format #t "~Tdata[8] @ #x~X~%" (-> this data)) (format #t "~Tbyte[32] @ #x~X~%" (-> this data)) @@ -40,15 +37,12 @@ ;; definition of type gsf-vertex-array (deftype gsf-vertex-array (structure) - ((vtx gsf-vertex :dynamic :offset-assert 0) + ((vtx gsf-vertex :dynamic) ) - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) ;; definition for method 3 of type gsf-vertex-array -(defmethod inspect gsf-vertex-array ((this gsf-vertex-array)) +(defmethod inspect ((this gsf-vertex-array)) (format #t "[~8x] ~A~%" this 'gsf-vertex-array) (format #t "~Tvtx[0] @ #x~X~%" (-> this vtx)) this @@ -56,16 +50,13 @@ ;; definition of type gsf-fx-vertex (deftype gsf-fx-vertex (structure) - ((clr vector4ub :inline :offset-assert 0) - (tex vector2uh :inline :offset-assert 4) + ((clr vector4ub :inline) + (tex vector2uh :inline) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type gsf-fx-vertex -(defmethod inspect gsf-fx-vertex ((this gsf-fx-vertex)) +(defmethod inspect ((this gsf-fx-vertex)) (format #t "[~8x] ~A~%" this 'gsf-fx-vertex) (format #t "~Tclr: #~%" (-> this clr)) (format #t "~Ttex: #~%" (-> this tex)) @@ -74,15 +65,12 @@ ;; definition of type gsf-fx-vertex-array (deftype gsf-fx-vertex-array (structure) - ((data gsf-fx-vertex :dynamic :offset-assert 0) + ((data gsf-fx-vertex :dynamic) ) - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) ;; definition for method 3 of type gsf-fx-vertex-array -(defmethod inspect gsf-fx-vertex-array ((this gsf-fx-vertex-array)) +(defmethod inspect ((this gsf-fx-vertex-array)) (format #t "[~8x] ~A~%" this 'gsf-fx-vertex-array) (format #t "~Tdata[0] @ #x~X~%" (-> this data)) this @@ -90,19 +78,16 @@ ;; definition of type gsf-header (deftype gsf-header (structure) - ((num-strips uint8 :offset-assert 0) - (expanded uint8 :offset-assert 1) - (num-dps uint16 :offset-assert 2) - (num-vtxs uint16 :offset-assert 4) - (strip-table uint8 10 :offset-assert 6) + ((num-strips uint8) + (expanded uint8) + (num-dps uint16) + (num-vtxs uint16) + (strip-table uint8 10) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gsf-header -(defmethod inspect gsf-header ((this gsf-header)) +(defmethod inspect ((this gsf-header)) (format #t "[~8x] ~A~%" this 'gsf-header) (format #t "~Tnum-strips: ~D~%" (-> this num-strips)) (format #t "~Texpanded: ~D~%" (-> this expanded)) @@ -114,16 +99,13 @@ ;; definition of type gsf-ik (deftype gsf-ik (structure) - ((index uint8 :offset-assert 0) - (no-kick uint8 :offset-assert 1) + ((index uint8) + (no-kick uint8) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition for method 3 of type gsf-ik -(defmethod inspect gsf-ik ((this gsf-ik)) +(defmethod inspect ((this gsf-ik)) (format #t "[~8x] ~A~%" this 'gsf-ik) (format #t "~Tindex: ~D~%" (-> this index)) (format #t "~Tno-kick: ~D~%" (-> this no-kick)) @@ -132,18 +114,15 @@ ;; definition of type gsf-info (deftype gsf-info (structure) - ((ptr-iks uint32 :offset-assert 0) - (ptr-verts uint32 :offset-assert 4) - (ptr-fx uint32 :offset-assert 8) - (dummy2 uint32 :offset-assert 12) + ((ptr-iks uint32) + (ptr-verts uint32) + (ptr-fx uint32) + (dummy2 uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gsf-info -(defmethod inspect gsf-info ((this gsf-info)) +(defmethod inspect ((this gsf-info)) (format #t "[~8x] ~A~%" this 'gsf-info) (format #t "~Tptr-iks: #x~X~%" (-> this ptr-iks)) (format #t "~Tptr-verts: #x~X~%" (-> this ptr-verts)) @@ -154,18 +133,15 @@ ;; definition of type gsf-buffer (deftype gsf-buffer (structure) - ((data uint8 8192 :offset-assert 0) - (info gsf-info :inline :offset 0) - (header gsf-header :inline :offset 16) - (work-area uint8 :dynamic :offset 32) + ((data uint8 8192) + (info gsf-info :inline :overlay-at (-> data 0)) + (header gsf-header :inline :overlay-at (-> data 16)) + (work-area uint8 :dynamic :overlay-at (-> data 32)) ) - :method-count-assert 9 - :size-assert #x2000 - :flag-assert #x900002000 ) ;; definition for method 3 of type gsf-buffer -(defmethod inspect gsf-buffer ((this gsf-buffer)) +(defmethod inspect ((this gsf-buffer)) (format #t "[~8x] ~A~%" this 'gsf-buffer) (format #t "~Tdata[8192] @ #x~X~%" (-> this data)) (format #t "~Tinfo: #~%" (-> this data)) @@ -176,16 +152,13 @@ ;; definition of type generic-frag (deftype generic-frag (structure) - ((start-pos uint16 :offset-assert 0) - (end-pos uint16 :offset-assert 2) + ((start-pos uint16) + (end-pos uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type generic-frag -(defmethod inspect generic-frag ((this generic-frag)) +(defmethod inspect ((this generic-frag)) (format #t "[~8x] ~A~%" this 'generic-frag) (format #t "~Tstart-pos: ~D~%" (-> this start-pos)) (format #t "~Tend-pos: ~D~%" (-> this end-pos)) @@ -194,16 +167,13 @@ ;; definition of type generic-strip (deftype generic-strip (structure) - ((pos uint16 :offset-assert 0) - (len uint16 :offset-assert 2) + ((pos uint16) + (len uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type generic-strip -(defmethod inspect generic-strip ((this generic-strip)) +(defmethod inspect ((this generic-strip)) (format #t "[~8x] ~A~%" this 'generic-strip) (format #t "~Tpos: ~D~%" (-> this pos)) (format #t "~Tlen: ~D~%" (-> this len)) @@ -212,17 +182,14 @@ ;; definition of type generic-envmap-saves (deftype generic-envmap-saves (structure) - ((index-mask vector4w :inline :offset-assert 0) - (verts uint128 12 :offset-assert 16) - (kicks uint128 4 :offset-assert 208) + ((index-mask vector4w :inline) + (verts uint128 12) + (kicks uint128 4) ) - :method-count-assert 9 - :size-assert #x110 - :flag-assert #x900000110 ) ;; definition for method 3 of type generic-envmap-saves -(defmethod inspect generic-envmap-saves ((this generic-envmap-saves)) +(defmethod inspect ((this generic-envmap-saves)) (format #t "[~8x] ~A~%" this 'generic-envmap-saves) (format #t "~Tindex-mask: #~%" (-> this index-mask)) (format #t "~Tverts[12] @ #x~X~%" (-> this verts)) @@ -232,22 +199,19 @@ ;; definition of type generic-interp-job (deftype generic-interp-job (structure) - ((job-type uint16 :offset-assert 0) - (num uint16 :offset-assert 2) - (first uint16 :offset-assert 4) - (pad uint16 :offset-assert 6) - (ptr-data uint32 :offset-assert 8) - (morph-z uint16 :offset-assert 12) - (morph-w uint16 :offset-assert 14) + ((job-type uint16) + (num uint16) + (first uint16) + (pad uint16) + (ptr-data uint32) + (morph-z uint16) + (morph-w uint16) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type generic-interp-job -(defmethod inspect generic-interp-job ((this generic-interp-job)) +(defmethod inspect ((this generic-interp-job)) (format #t "[~8x] ~A~%" this 'generic-interp-job) (format #t "~Tjob-type: ~D~%" (-> this job-type)) (format #t "~Tnum: ~D~%" (-> this num)) @@ -261,39 +225,36 @@ ;; definition of type generic-saves (deftype generic-saves (structure) - ((ptr-dma uint32 :offset-assert 0) - (ptr-vtxs uint32 :offset-assert 4) - (ptr-clrs uint32 :offset-assert 8) - (ptr-texs uint32 :offset-assert 12) - (ptr-env-clrs uint32 :offset-assert 16) - (ptr-env-texs uint32 :offset-assert 20) - (cur-outbuf uint32 :offset-assert 24) - (ptr-fx-buf uint32 :offset-assert 28) - (xor-outbufs uint32 :offset-assert 32) - (num-dps uint32 :offset-assert 36) - (qwc uint32 :offset-assert 40) - (gsf-buf gsf-buffer :offset-assert 44) - (ptr-shaders uint32 :offset-assert 48) - (ptr-env-shader uint32 :offset-assert 52) - (is-envmap uint32 :offset-assert 56) - (basep uint32 :offset-assert 60) - (ptr-interp-job generic-interp-job :offset-assert 64) - (gifbuf-adr uint32 :offset-assert 68) - (inbuf-adr uint32 :offset-assert 72) - (fade-val uint32 :offset-assert 76) - (time-of-day-color rgba :offset-assert 80) - (to-vu0-waits uint32 :offset-assert 84) - (to-spr-waits uint32 :offset-assert 88) - (from-spr-waits uint32 :offset-assert 92) - (envmap generic-envmap-saves :inline :offset-assert 96) + ((ptr-dma uint32) + (ptr-vtxs uint32) + (ptr-clrs uint32) + (ptr-texs uint32) + (ptr-env-clrs uint32) + (ptr-env-texs uint32) + (cur-outbuf uint32) + (ptr-fx-buf uint32) + (xor-outbufs uint32) + (num-dps uint32) + (qwc uint32) + (gsf-buf gsf-buffer) + (ptr-shaders uint32) + (ptr-env-shader uint32) + (is-envmap uint32) + (basep uint32) + (ptr-interp-job generic-interp-job) + (gifbuf-adr uint32) + (inbuf-adr uint32) + (fade-val uint32) + (time-of-day-color rgba) + (to-vu0-waits uint32) + (to-spr-waits uint32) + (from-spr-waits uint32) + (envmap generic-envmap-saves :inline) ) - :method-count-assert 9 - :size-assert #x170 - :flag-assert #x900000170 ) ;; definition for method 3 of type generic-saves -(defmethod inspect generic-saves ((this generic-saves)) +(defmethod inspect ((this generic-saves)) (format #t "[~8x] ~A~%" this 'generic-saves) (format #t "~Tptr-dma: #x~X~%" (-> this ptr-dma)) (format #t "~Tptr-vtxs: #x~X~%" (-> this ptr-vtxs)) @@ -325,20 +286,17 @@ ;; definition of type generic-gif-tag (deftype generic-gif-tag (structure) - ((data uint32 4 :offset-assert 0) - (qword qword :inline :offset 0) - (fan-prim uint32 :offset 0) - (str-prim uint32 :offset 4) - (regs uint32 :offset 8) - (num-strips uint32 :offset 12) + ((data uint32 4) + (qword qword :inline :overlay-at (-> data 0)) + (fan-prim uint32 :overlay-at (-> data 0)) + (str-prim uint32 :overlay-at (-> data 1)) + (regs uint32 :overlay-at (-> data 2)) + (num-strips uint32 :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type generic-gif-tag -(defmethod inspect generic-gif-tag ((this generic-gif-tag)) +(defmethod inspect ((this generic-gif-tag)) (format #t "[~8x] ~A~%" this 'generic-gif-tag) (format #t "~Tdata[4] @ #x~X~%" (&-> this fan-prim)) (format #t "~Tqword: #~%" (&-> this fan-prim)) @@ -351,24 +309,21 @@ ;; definition of type ad-cmd (deftype ad-cmd (structure) - ((word uint32 4 :offset-assert 0) - (quad uint128 :offset 0) - (data uint64 :offset 0) - (cmds uint64 :offset 8) - (cmd gs-reg :offset 8) - (x uint32 :offset 0) - (y uint32 :offset 4) - (z uint32 :offset 8) - (w uint32 :offset 12) + ((word uint32 4) + (quad uint128 :overlay-at (-> word 0)) + (data uint64 :overlay-at (-> word 0)) + (cmds uint64 :overlay-at (-> word 2)) + (cmd gs-reg :overlay-at (-> word 2)) + (x uint32 :overlay-at (-> word 0)) + (y uint32 :overlay-at (-> word 1)) + (z uint32 :overlay-at (-> word 2)) + (w uint32 :overlay-at (-> word 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type ad-cmd ;; INFO: Used lq/sq -(defmethod inspect ad-cmd ((this ad-cmd)) +(defmethod inspect ((this ad-cmd)) (format #t "[~8x] ~A~%" this 'ad-cmd) (format #t "~Tword[4] @ #x~X~%" (&-> this data)) (format #t "~Tquad: ~D~%" (-> this quad)) @@ -384,18 +339,15 @@ ;; definition of type generic-envmap-consts (deftype generic-envmap-consts (structure) - ((consts vector :inline :offset-assert 0) - (strgif generic-gif-tag :inline :offset-assert 16) - (colors vector4w :inline :offset-assert 32) - (shader adgif-shader :inline :offset-assert 48) + ((consts vector :inline) + (strgif generic-gif-tag :inline) + (colors vector4w :inline) + (shader adgif-shader :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type generic-envmap-consts -(defmethod inspect generic-envmap-consts ((this generic-envmap-consts)) +(defmethod inspect ((this generic-envmap-consts)) (format #t "[~8x] ~A~%" this 'generic-envmap-consts) (format #t "~Tconsts: #~%" (-> this consts)) (format #t "~Tstrgif: #~%" (-> this strgif)) @@ -406,38 +358,35 @@ ;; definition of type generic-consts (deftype generic-consts (structure) - ((dma-header dma-packet :inline :offset-assert 0) - (vif-header uint32 4 :offset-assert 16) - (dma-ref-vtxs dma-packet :inline :offset-assert 32) - (dma-cnt-call dma-packet :inline :offset-assert 48) - (matrix matrix :inline :offset-assert 64) - (base-strgif generic-gif-tag :inline :offset-assert 128) - (alpha-opaque ad-cmd :inline :offset-assert 144) - (alpha-translucent ad-cmd :inline :offset-assert 160) - (ztest-normal ad-cmd :inline :offset-assert 176) - (ztest-opaque ad-cmd :inline :offset-assert 192) - (adcmd-offsets uint8 16 :offset-assert 208) - (adcmds ad-cmd 4 :offset 144) - (stcycle-tag uint32 :offset-assert 224) - (unpack-vtx-tag uint32 :offset-assert 228) - (unpack-clr-tag uint32 :offset-assert 232) - (unpack-tex-tag uint32 :offset-assert 236) - (mscal-tag uint32 :offset-assert 240) - (flush-tag uint32 :offset-assert 244) - (reset-cycle-tag uint32 :offset-assert 248) - (dummy0 uint32 :offset-assert 252) - (dma-tag-cnt uint64 :offset-assert 256) - (envmap generic-envmap-consts :inline :offset-assert 272) - (light-consts vector :inline :offset-assert 400) - (texture-offset uint16 8 :offset-assert 416) + ((dma-header dma-packet :inline) + (vif-header uint32 4) + (dma-ref-vtxs dma-packet :inline) + (dma-cnt-call dma-packet :inline) + (matrix matrix :inline) + (base-strgif generic-gif-tag :inline) + (alpha-opaque ad-cmd :inline) + (alpha-translucent ad-cmd :inline) + (ztest-normal ad-cmd :inline) + (ztest-opaque ad-cmd :inline) + (adcmd-offsets uint8 16) + (adcmds ad-cmd 4 :overlay-at alpha-opaque) + (stcycle-tag uint32) + (unpack-vtx-tag uint32) + (unpack-clr-tag uint32) + (unpack-tex-tag uint32) + (mscal-tag uint32) + (flush-tag uint32) + (reset-cycle-tag uint32) + (dummy0 uint32) + (dma-tag-cnt uint64) + (envmap generic-envmap-consts :inline) + (light-consts vector :inline) + (texture-offset uint16 8) ) - :method-count-assert 9 - :size-assert #x1b0 - :flag-assert #x9000001b0 ) ;; definition for method 3 of type generic-consts -(defmethod inspect generic-consts ((this generic-consts)) +(defmethod inspect ((this generic-consts)) (format #t "[~8x] ~A~%" this 'generic-consts) (format #t "~Tdma-header: #~%" (-> this dma-header)) (format #t "~Tvif-header[4] @ #x~X~%" (-> this vif-header)) @@ -468,15 +417,12 @@ ;; definition of type generic-storage (deftype generic-storage (structure) - ((data uint128 16 :offset-assert 0) + ((data uint128 16) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; definition for method 3 of type generic-storage -(defmethod inspect generic-storage ((this generic-storage)) +(defmethod inspect ((this generic-storage)) (format #t "[~8x] ~A~%" this 'generic-storage) (format #t "~Tdata[16] @ #x~X~%" (-> this data)) this diff --git a/test/decompiler/reference/jak1/engine/gfx/generic/generic-merc_REF.gc b/test/decompiler/reference/jak1/engine/gfx/generic/generic-merc_REF.gc index d698b4045f0..828931128e4 100644 --- a/test/decompiler/reference/jak1/engine/gfx/generic/generic-merc_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/generic/generic-merc_REF.gc @@ -6,18 +6,15 @@ ;; definition of type invinitdata (deftype invinitdata (structure) - ((count uint8 :offset-assert 0) - (init-data uint8 :offset-assert 1) - (init-addr uint16 :offset-assert 2) + ((count uint8) + (init-data uint8) + (init-addr uint16) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type invinitdata -(defmethod inspect invinitdata ((this invinitdata)) +(defmethod inspect ((this invinitdata)) (format #t "[~8x] ~A~%" this 'invinitdata) (format #t "~Tcount: ~D~%" (-> this count)) (format #t "~Tinit-data: ~D~%" (-> this init-data)) diff --git a/test/decompiler/reference/jak1/engine/gfx/generic/generic-vu1-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/generic/generic-vu1-h_REF.gc index d6a093b1ae5..c5f06471edb 100644 --- a/test/decompiler/reference/jak1/engine/gfx/generic/generic-vu1-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/generic/generic-vu1-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type pris-mtx (deftype pris-mtx (structure) - ((data float 32 :offset 0) - (vector vector 8 :inline :offset 0) - (t-mtx matrix :inline :offset 0) - (n-mtx matrix3 :inline :offset 64) - (scale vector :inline :offset 112) + ((data float 32 :offset 0) + (vector vector 8 :inline :overlay-at (-> data 0)) + (t-mtx matrix :inline :overlay-at (-> data 0)) + (n-mtx matrix3 :inline :overlay-at (-> data 16)) + (scale vector :inline :overlay-at (-> vector 7)) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type pris-mtx -(defmethod inspect pris-mtx ((this pris-mtx)) +(defmethod inspect ((this pris-mtx)) (format #t "[~8x] ~A~%" this 'pris-mtx) (format #t "~Tdata[32] @ #x~X~%" (-> this t-mtx)) (format #t "~Tvector[8] @ #x~X~%" (-> this t-mtx)) @@ -27,17 +24,14 @@ ;; definition of type generic-pris-mtx-save (deftype generic-pris-mtx-save (structure) - ((loc-mtx pris-mtx :inline :offset-assert 0) - (par-mtx pris-mtx :inline :offset-assert 128) - (dif-mtx pris-mtx :inline :offset-assert 256) + ((loc-mtx pris-mtx :inline) + (par-mtx pris-mtx :inline) + (dif-mtx pris-mtx :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;; definition for method 3 of type generic-pris-mtx-save -(defmethod inspect generic-pris-mtx-save ((this generic-pris-mtx-save)) +(defmethod inspect ((this generic-pris-mtx-save)) (format #t "[~8x] ~A~%" this 'generic-pris-mtx-save) (format #t "~Tloc-mtx: #~%" (-> this loc-mtx)) (format #t "~Tpar-mtx: #~%" (-> this par-mtx)) @@ -47,24 +41,21 @@ ;; definition of type generic-constants (deftype generic-constants (structure) - ((fog vector :inline :offset-assert 0) - (adgif gs-gif-tag :inline :offset-assert 16) - (giftag gs-gif-tag :inline :offset-assert 32) - (hvdf-offset vector :inline :offset-assert 48) - (hmge-scale vector :inline :offset-assert 64) - (invh-scale vector :inline :offset-assert 80) - (guard vector :inline :offset-assert 96) - (adnop qword :inline :offset-assert 112) - (flush qword :inline :offset-assert 128) - (stores qword :inline :offset-assert 144) + ((fog vector :inline) + (adgif gs-gif-tag :inline) + (giftag gs-gif-tag :inline) + (hvdf-offset vector :inline) + (hmge-scale vector :inline) + (invh-scale vector :inline) + (guard vector :inline) + (adnop qword :inline) + (flush qword :inline) + (stores qword :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type generic-constants -(defmethod inspect generic-constants ((this generic-constants)) +(defmethod inspect ((this generic-constants)) (format #t "[~8x] ~A~%" this 'generic-constants) (format #t "~Tfog: #~%" (-> this fog)) (format #t "~Tadgif: #~%" (-> this adgif)) diff --git a/test/decompiler/reference/jak1/engine/gfx/generic/generic-work-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/generic/generic-work-h_REF.gc index 4f90407f062..855c93b24a3 100644 --- a/test/decompiler/reference/jak1/engine/gfx/generic/generic-work-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/generic/generic-work-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type generic-input-buffer (deftype generic-input-buffer (structure) - ((merc generic-merc-work :inline :offset 0) - (tie generic-tie-work :inline :offset 0) - (data uint128 472 :offset 0) + ((merc generic-merc-work :inline :offset 0) + (tie generic-tie-work :inline :offset 0) + (data uint128 472 :offset 0) ) - :method-count-assert 9 - :size-assert #x1d80 - :flag-assert #x900001d80 ) ;; definition for method 3 of type generic-input-buffer -(defmethod inspect generic-input-buffer ((this generic-input-buffer)) +(defmethod inspect ((this generic-input-buffer)) (format #t "[~8x] ~A~%" this 'generic-input-buffer) (format #t "~Tdata[472] @ #x~X~%" (-> this merc)) (format #t "~Tmerc: #~%" (-> this merc)) @@ -23,21 +20,18 @@ ;; definition of type generic-debug (deftype generic-debug (structure) - ((locks uint32 4 :offset-assert 0) - (timer uint32 32 :offset-assert 16) - (count uint32 32 :offset-assert 144) - (vps uint32 32 :offset-assert 272) - (buffer int32 :offset-assert 400) - (start-addr int32 :offset-assert 404) - (lock int32 :offset-assert 408) + ((locks uint32 4) + (timer uint32 32) + (count uint32 32) + (vps uint32 32) + (buffer int32) + (start-addr int32) + (lock int32) ) - :method-count-assert 9 - :size-assert #x19c - :flag-assert #x90000019c ) ;; definition for method 3 of type generic-debug -(defmethod inspect generic-debug ((this generic-debug)) +(defmethod inspect ((this generic-debug)) (format #t "[~8x] ~A~%" this 'generic-debug) (format #t "~Tlocks[4] @ #x~X~%" (-> this locks)) (format #t "~Ttimer[32] @ #x~X~%" (-> this timer)) @@ -51,22 +45,19 @@ ;; definition of type generic-vu1-header (deftype generic-vu1-header (structure) - ((matrix matrix :inline :offset-assert 0) - (strgif generic-gif-tag :inline :offset-assert 64) - (adnop1 ad-cmd :inline :offset-assert 80) - (adnop2 ad-cmd :inline :offset-assert 96) - (adcmds ad-cmd 2 :inline :offset 80) - (dps uint16 :offset 92) - (kickoff uint16 :offset 108) - (strips uint16 :offset 76) + ((matrix matrix :inline) + (strgif generic-gif-tag :inline) + (adnop1 ad-cmd :inline) + (adnop2 ad-cmd :inline) + (adcmds ad-cmd 2 :inline :overlay-at adnop1) + (dps uint16 :overlay-at (-> adnop1 word 3)) + (kickoff uint16 :overlay-at (-> adnop2 word 3)) + (strips uint16 :overlay-at (-> strgif data 3)) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type generic-vu1-header -(defmethod inspect generic-vu1-header ((this generic-vu1-header)) +(defmethod inspect ((this generic-vu1-header)) (format #t "[~8x] ~A~%" this 'generic-vu1-header) (format #t "~Tmatrix: #~%" (-> this matrix)) (format #t "~Tstrgif: #~%" (-> this strgif)) @@ -81,16 +72,13 @@ ;; definition of type generic-vu1-texbuf (deftype generic-vu1-texbuf (structure) - ((header generic-vu1-header :inline :offset-assert 0) - (shader uint32 :dynamic :offset-assert 112) + ((header generic-vu1-header :inline) + (shader uint32 :dynamic) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type generic-vu1-texbuf -(defmethod inspect generic-vu1-texbuf ((this generic-vu1-texbuf)) +(defmethod inspect ((this generic-vu1-texbuf)) (format #t "[~8x] ~A~%" this 'generic-vu1-texbuf) (format #t "~Theader: #~%" (-> this header)) (format #t "~Tshader[0] @ #x~X~%" (-> this shader)) @@ -99,17 +87,14 @@ ;; definition of type generic-texbuf (deftype generic-texbuf (structure) - ((tag dma-packet :inline :offset-assert 0) - (header generic-vu1-header :inline :offset-assert 16) - (shader uint32 :dynamic :offset-assert 128) + ((tag dma-packet :inline) + (header generic-vu1-header :inline) + (shader uint32 :dynamic) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type generic-texbuf -(defmethod inspect generic-texbuf ((this generic-texbuf)) +(defmethod inspect ((this generic-texbuf)) (format #t "[~8x] ~A~%" this 'generic-texbuf) (format #t "~Ttag: #~%" (-> this tag)) (format #t "~Theader: #~%" (-> this header)) @@ -119,18 +104,15 @@ ;; definition of type generic-effect-work (deftype generic-effect-work (structure) - ((consts generic-consts :inline :offset-assert 0) - (storage generic-storage :inline :offset-assert 432) - (storage2 generic-storage :inline :offset-assert 688) - (lights vu-lights :inline :offset-assert 944) + ((consts generic-consts :inline) + (storage generic-storage :inline) + (storage2 generic-storage :inline) + (lights vu-lights :inline) ) - :method-count-assert 9 - :size-assert #x420 - :flag-assert #x900000420 ) ;; definition for method 3 of type generic-effect-work -(defmethod inspect generic-effect-work ((this generic-effect-work)) +(defmethod inspect ((this generic-effect-work)) (format #t "[~8x] ~A~%" this 'generic-effect-work) (format #t "~Tconsts: #~%" (-> this consts)) (format #t "~Tstorage: #~%" (-> this storage)) @@ -141,17 +123,14 @@ ;; definition of type generic-effect-buffer (deftype generic-effect-buffer (structure) - ((outbuf-0 uint8 3552 :offset-assert 0) - (work generic-effect-work :inline :offset-assert 3552) - (outbuf-1 uint8 3552 :offset-assert 4608) + ((outbuf-0 uint8 3552) + (work generic-effect-work :inline) + (outbuf-1 uint8 3552) ) - :method-count-assert 9 - :size-assert #x1fe0 - :flag-assert #x900001fe0 ) ;; definition for method 3 of type generic-effect-buffer -(defmethod inspect generic-effect-buffer ((this generic-effect-buffer)) +(defmethod inspect ((this generic-effect-buffer)) (format #t "[~8x] ~A~%" this 'generic-effect-buffer) (format #t "~Toutbuf-0[3552] @ #x~X~%" (-> this outbuf-0)) (format #t "~Twork: #~%" (-> this work)) @@ -161,18 +140,15 @@ ;; definition of type generic-work (deftype generic-work (structure) - ((saves generic-saves :inline :offset-assert 0) - (storage generic-storage :inline :offset-assert 368) - (in-buf generic-input-buffer :inline :offset-assert 624) - (fx-buf generic-effect-buffer :inline :offset-assert 8176) + ((saves generic-saves :inline) + (storage generic-storage :inline) + (in-buf generic-input-buffer :inline) + (fx-buf generic-effect-buffer :inline) ) - :method-count-assert 9 - :size-assert #x3fd0 - :flag-assert #x900003fd0 ) ;; definition for method 3 of type generic-work -(defmethod inspect generic-work ((this generic-work)) +(defmethod inspect ((this generic-work)) (format #t "[~8x] ~A~%" this 'generic-work) (format #t "~Tsaves: #~%" (-> this saves)) (format #t "~Tstorage: #~%" (-> this storage)) diff --git a/test/decompiler/reference/jak1/engine/gfx/hw/display-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/hw/display-h_REF.gc index bd88bf5d80a..29bac2eed36 100644 --- a/test/decompiler/reference/jak1/engine/gfx/hw/display-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/hw/display-h_REF.gc @@ -3,20 +3,17 @@ ;; definition of type display-env (deftype display-env (structure) - ((pmode gs-pmode :offset-assert 0) - (smode2 gs-smode2 :offset-assert 8) - (dspfb gs-display-fb :offset-assert 16) - (display gs-display :offset-assert 24) - (bgcolor gs-bgcolor :offset-assert 32) + ((pmode gs-pmode) + (smode2 gs-smode2) + (dspfb gs-display-fb) + (display gs-display) + (bgcolor gs-bgcolor) ) :pack-me - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; definition for method 3 of type display-env -(defmethod inspect display-env ((this display-env)) +(defmethod inspect ((this display-env)) (format #t "[~8x] ~A~%" this 'display-env) (format #t "~Tpmode: #x~X~%" (-> this pmode)) (format #t "~Tsmode2: #x~X~%" (-> this smode2)) @@ -28,30 +25,27 @@ ;; definition of type draw-env (deftype draw-env (structure) - ((frame1 gs-frame :offset-assert 0) - (frame1addr gs-reg64 :offset-assert 8) - (zbuf1 gs-zbuf :offset-assert 16) - (zbuf1addr gs-reg64 :offset-assert 24) - (xyoffset1 gs-xy-offset :offset-assert 32) - (xyoffset1addr gs-reg64 :offset-assert 40) - (scissor1 gs-scissor :offset-assert 48) - (scissor1addr gs-reg64 :offset-assert 56) - (prmodecont gs-prmode-cont :offset-assert 64) - (prmodecontaddr gs-reg64 :offset-assert 72) - (colclamp gs-color-clamp :offset-assert 80) - (colclampaddr gs-reg64 :offset-assert 88) - (dthe gs-dthe :offset-assert 96) - (dtheaddr gs-reg64 :offset-assert 104) - (test1 gs-test :offset-assert 112) - (test1addr gs-reg64 :offset-assert 120) + ((frame1 gs-frame) + (frame1addr gs-reg64) + (zbuf1 gs-zbuf) + (zbuf1addr gs-reg64) + (xyoffset1 gs-xy-offset) + (xyoffset1addr gs-reg64) + (scissor1 gs-scissor) + (scissor1addr gs-reg64) + (prmodecont gs-prmode-cont) + (prmodecontaddr gs-reg64) + (colclamp gs-color-clamp) + (colclampaddr gs-reg64) + (dthe gs-dthe) + (dtheaddr gs-reg64) + (test1 gs-test) + (test1addr gs-reg64) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type draw-env -(defmethod inspect draw-env ((this draw-env)) +(defmethod inspect ((this draw-env)) (format #t "[~8x] ~A~%" this 'draw-env) (format #t "~Tframe1: #x~X~%" (-> this frame1)) (format #t "~Tframe1addr: #x~X~%" (-> this frame1addr)) @@ -81,25 +75,22 @@ ;; definition of type display-frame (deftype display-frame (basic) - ((calc-buf dma-buffer :offset 8) - (vu1-buf dma-buffer :offset 8) - (debug-buf dma-buffer :offset 36) - (global-buf dma-buffer :offset 40) - (bucket-group (inline-array dma-bucket) :offset 44) - (buffer dma-buffer 11 :offset 4) - (profile-bar profile-bar 2 :offset 48) - (run-time int64 :offset 56) + ((calc-buf dma-buffer :offset 8) + (vu1-buf dma-buffer :overlay-at calc-buf) + (debug-buf dma-buffer :offset 36) + (global-buf dma-buffer :offset 40) + (bucket-group (inline-array dma-bucket) :offset 44) + (buffer dma-buffer 11 :offset 4) + (profile-bar profile-bar 2 :offset 48) + (run-time int64 :offset 56) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type display-frame -(defmethod inspect display-frame ((this display-frame)) +(defmethod inspect ((this display-frame)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tbuffer[11] @ #x~X~%" (-> this buffer)) (format #t "~Tcalc-buf: ~A~%" (-> this calc-buf)) @@ -128,20 +119,17 @@ ;; definition of type virtual-frame (deftype virtual-frame (structure) - ((display display-env :offset-assert 0) - (display-last display-env :offset-assert 4) - (gif pointer :offset-assert 8) - (draw draw-env :offset-assert 12) - (frame display-frame :offset-assert 16) + ((display display-env) + (display-last display-env) + (gif pointer) + (draw draw-env) + (frame display-frame) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type virtual-frame -(defmethod inspect virtual-frame ((this virtual-frame)) +(defmethod inspect ((this virtual-frame)) (format #t "[~8x] ~A~%" this 'virtual-frame) (format #t "~Tdisplay: #~%" (-> this display)) (format #t "~Tdisplay-last: #~%" (-> this display-last)) @@ -153,53 +141,50 @@ ;; definition of type display (deftype display (basic) - ((display-env0 display-env :inline :offset-assert 8) - (display-env1 display-env :inline :offset-assert 48) - (display-env2 display-env :inline :offset-assert 88) - (gif-tag0 gs-gif-tag :inline :offset-assert 128) - (draw0 draw-env :inline :offset-assert 144) - (gif-tag1 gs-gif-tag :inline :offset-assert 272) - (draw1 draw-env :inline :offset-assert 288) - (gif-tag2 gs-gif-tag :inline :offset-assert 416) - (draw2 draw-env :inline :offset-assert 432) - (on-screen int32 :offset-assert 560) - (last-screen int32 :offset-assert 564) - (frames virtual-frame 6 :inline :offset-assert 568) - (bg-clear-color rgba 4 :offset-assert 760) - (real-frame-counter time-frame :offset-assert 776) - (base-frame-counter time-frame :offset-assert 784) - (game-frame-counter time-frame :offset-assert 792) - (integral-frame-counter time-frame :offset-assert 800) - (real-integral-frame-counter time-frame :offset-assert 808) - (actual-frame-counter time-frame :offset-assert 816) - (real-actual-frame-counter time-frame :offset-assert 824) - (part-frame-counter time-frame :offset-assert 832) - (old-real-frame-counter time-frame :offset-assert 840) - (old-base-frame-counter time-frame :offset-assert 848) - (old-game-frame-counter time-frame :offset-assert 856) - (old-integral-frame-counter time-frame :offset-assert 864) - (old-real-integral-frame-counter time-frame :offset-assert 872) - (old-actual-frame-counter time-frame :offset-assert 880) - (old-real-actual-frame-counter time-frame :offset-assert 888) - (old-part-frame-counter time-frame :offset-assert 896) - (time-ratio float :offset-assert 904) - (seconds-per-frame float :offset-assert 908) - (frames-per-second float :offset-assert 912) - (time-factor float :offset-assert 916) - (time-adjust-ratio float :offset-assert 920) + ((display-env0 display-env :inline) + (display-env1 display-env :inline) + (display-env2 display-env :inline) + (gif-tag0 gs-gif-tag :inline) + (draw0 draw-env :inline) + (gif-tag1 gs-gif-tag :inline) + (draw1 draw-env :inline) + (gif-tag2 gs-gif-tag :inline) + (draw2 draw-env :inline) + (on-screen int32) + (last-screen int32) + (frames virtual-frame 6 :inline) + (bg-clear-color rgba 4) + (real-frame-counter time-frame) + (base-frame-counter time-frame) + (game-frame-counter time-frame) + (integral-frame-counter time-frame) + (real-integral-frame-counter time-frame) + (actual-frame-counter time-frame) + (real-actual-frame-counter time-frame) + (part-frame-counter time-frame) + (old-real-frame-counter time-frame) + (old-base-frame-counter time-frame) + (old-game-frame-counter time-frame) + (old-integral-frame-counter time-frame) + (old-real-integral-frame-counter time-frame) + (old-actual-frame-counter time-frame) + (old-real-actual-frame-counter time-frame) + (old-part-frame-counter time-frame) + (time-ratio float) + (seconds-per-frame float) + (frames-per-second float) + (time-factor float) + (time-adjust-ratio float) ) - :method-count-assert 10 - :size-assert #x39c - :flag-assert #xa0000039c (:methods - (new (symbol type int int int int int) _type_ 0) - (set-time-ratios (_type_ float) float 9) + (new (symbol type int int int int int) _type_) + (set-time-ratios (_type_ float) float) ) ) ;; definition for method 3 of type display ;; INFO: Used lq/sq -(defmethod inspect display ((this display)) +(defmethod inspect ((this display)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tdisplay-env0: #~%" (-> this display-env0)) (format #t "~Tdisplay-env1: #~%" (-> this display-env1)) diff --git a/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc b/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc index 811d0a4dc4a..f43f81ca874 100644 --- a/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc @@ -12,7 +12,7 @@ ) ;; definition for method 9 of type display -(defmethod set-time-ratios display ((this display) (slowdown float)) +(defmethod set-time-ratios ((this display) (slowdown float)) (let ((ratio (fmin 4.0 slowdown))) (set! (-> this time-ratio) ratio) (case (get-video-mode) @@ -205,7 +205,7 @@ ) ;; definition for method 11 of type profile-bar -(defmethod add-frame profile-bar ((this profile-bar) (name symbol) (color rgba)) +(defmethod add-frame ((this profile-bar) (name symbol) (color rgba)) (when *debug-segment* (let ((new-frame (-> this data (-> this profile-frame-count)))) (+! (-> this profile-frame-count) 1) @@ -218,14 +218,14 @@ ) ;; definition for method 10 of type profile-bar -(defmethod reset profile-bar ((this profile-bar)) +(defmethod reset ((this profile-bar)) (set! (-> this profile-frame-count) 0) (add-frame this 'start (new 'static 'rgba :r #x40 :b #x40 :a #x80)) this ) ;; definition for method 12 of type profile-bar -(defmethod add-end-frame profile-bar ((this profile-bar) (name symbol) (color rgba)) +(defmethod add-end-frame ((this profile-bar) (name symbol) (color rgba)) (let ((new-frame (-> this data (-> this profile-frame-count)))) (+! (-> this profile-frame-count) 1) (set! (-> new-frame name) name) @@ -251,7 +251,7 @@ (define *profile-ticks* #f) ;; definition for method 13 of type profile-bar -(defmethod draw profile-bar ((this profile-bar) (buf dma-buffer) (bar-pos int)) +(defmethod draw ((this profile-bar) (buf dma-buffer) (bar-pos int)) (let ((height (the int (* 8.0 (-> *video-parms* relative-y-scale))))) (set! *profile-y* (+ (-> *video-parms* screen-miny) height)) (set! *profile-h* height) diff --git a/test/decompiler/reference/jak1/engine/gfx/hw/gs_REF.gc b/test/decompiler/reference/jak1/engine/gfx/hw/gs_REF.gc index 5c5fd09d22a..6e27452d0f7 100644 --- a/test/decompiler/reference/jak1/engine/gfx/hw/gs_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/hw/gs_REF.gc @@ -11,9 +11,6 @@ (slbg uint8 :offset 7 :size 1) (alp uint8 :offset 8 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-smode2 @@ -22,9 +19,6 @@ (ffmd uint8 :offset 1 :size 1) (dpms uint8 :offset 2 :size 2) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for function psm-size @@ -119,9 +113,6 @@ (dbx uint16 :offset 32 :size 11) (dby uint16 :offset 43 :size 11) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-display @@ -133,9 +124,6 @@ (dw uint16 :offset 32 :size 12) (dh uint16 :offset 44 :size 11) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-bgcolor @@ -144,9 +132,6 @@ (g uint8 :offset 8 :size 8) (b uint8 :offset 16 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-csr @@ -164,34 +149,28 @@ (rev uint8 :offset 16 :size 8) (id uint8 :offset 24 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-bank (deftype gs-bank (structure) - ((pmode gs-pmode :offset-assert 0) - (smode2 gs-smode2 :offset 32) - (dspfb1 gs-display-fb :offset 112) - (display1 gs-display :offset 128) - (dspfb2 gs-display-fb :offset 144) - (display2 gs-display :offset 160) - (extbuf uint64 :offset 176) - (extdata uint64 :offset 192) - (extwrite uint64 :offset 208) - (bgcolor gs-bgcolor :offset 224) - (csr gs-csr :offset 4096) - (imr uint64 :offset 4112) - (busdir uint64 :offset 4160) - ) - :method-count-assert 9 - :size-assert #x1048 - :flag-assert #x900001048 + ((pmode gs-pmode) + (smode2 gs-smode2 :offset 32) + (dspfb1 gs-display-fb :offset 112) + (display1 gs-display :offset 128) + (dspfb2 gs-display-fb :offset 144) + (display2 gs-display :offset 160) + (extbuf uint64 :offset 176) + (extdata uint64 :offset 192) + (extwrite uint64 :offset 208) + (bgcolor gs-bgcolor :offset 224) + (csr gs-csr :offset 4096) + (imr uint64 :offset 4112) + (busdir uint64 :offset 4160) + ) ) ;; definition for method 3 of type gs-bank -(defmethod inspect gs-bank ((this gs-bank)) +(defmethod inspect ((this gs-bank)) (format #t "[~8x] ~A~%" this 'gs-bank) (format #t "~Tpmode: #x~X~%" (-> this pmode)) (format #t "~Tsmode2: #x~X~%" (-> this smode2)) @@ -216,9 +195,6 @@ (psm gs-psm :offset 24 :size 6) (fbmsk uint32 :offset 32 :size 32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-zbuf @@ -227,9 +203,6 @@ (psm gs-psm :offset 24 :size 4) (zmsk uint8 :offset 32 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-xy-offset @@ -237,9 +210,6 @@ ((ofx uint16 :offset 0 :size 16) (ofy uint16 :offset 32 :size 16) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-scissor @@ -249,36 +219,24 @@ (scay0 uint16 :offset 32 :size 11) (scay1 uint16 :offset 48 :size 11) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-prmode-cont (deftype gs-prmode-cont (uint64) ((ac uint8 :offset 0 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-color-clamp (deftype gs-color-clamp (uint64) ((clamp uint8 :offset 0 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-dthe (deftype gs-dthe (uint64) ((dthe uint8 :offset 0 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-test @@ -292,9 +250,6 @@ (zte uint8 :offset 16 :size 1) (ztst gs-ztest :offset 17 :size 2) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-prim @@ -309,9 +264,6 @@ (ctxt uint8 :offset 9 :size 1) (fix uint8 :offset 10 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-rgbaq @@ -322,9 +274,6 @@ (a uint8 :offset 24 :size 8) (q float :offset 32 :size 32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-xyz @@ -333,9 +282,6 @@ (y uint16 :offset 16 :size 16) (z uint32 :offset 32 :size 32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-uv @@ -343,9 +289,6 @@ ((u uint16 :offset 0 :size 14) (v uint16 :offset 16 :size 14) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-st @@ -353,9 +296,6 @@ ((s float :offset 0 :size 32) (t float :offset 32 :size 32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-xyzf @@ -365,9 +305,6 @@ (z uint32 :offset 32 :size 24) (f uint8 :offset 56 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-trxpos @@ -378,9 +315,6 @@ (dsay uint16 :offset 48 :size 11) (dir uint8 :offset 59 :size 2) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-trxreg @@ -388,18 +322,12 @@ ((rrw uint16 :offset 0 :size 12) (rrh uint16 :offset 32 :size 12) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-trxdir (deftype gs-trxdir (uint64) ((xdir uint8 :offset 0 :size 2) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-bitbltbuf @@ -411,9 +339,6 @@ (dbw uint8 :offset 48 :size 6) (dpsm uint8 :offset 56 :size 6) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-tex0 @@ -431,9 +356,6 @@ (csa uint8 :offset 56 :size 5) (cld uint8 :offset 61 :size 3) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-tex1 @@ -446,9 +368,6 @@ (l uint8 :offset 19 :size 2) (k int16 :offset 32 :size 12) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-texa @@ -457,9 +376,6 @@ (aem uint8 :offset 15 :size 1) (ta1 uint8 :offset 32 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-texclut @@ -468,9 +384,6 @@ (cou uint8 :offset 6 :size 6) (cov uint16 :offset 12 :size 10) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-miptbp @@ -482,9 +395,6 @@ (tbp3 uint16 :offset 40 :size 14) (tbw3 uint8 :offset 54 :size 6) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-alpha @@ -495,13 +405,10 @@ (d uint8 :offset 6 :size 2) (fix uint8 :offset 32 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type gs-alpha -(defmethod inspect gs-alpha ((this gs-alpha)) +(defmethod inspect ((this gs-alpha)) (format #t "[~8x] ~A~%" this 'gs-alpha) (format #t "~Ta: ~D~%" (-> this a)) (format #t "~Tb: ~D~%" (-> this b)) @@ -520,22 +427,16 @@ (minv uint16 :offset 24 :size 10) (maxv uint16 :offset 34 :size 10) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-fog (deftype gs-fog (uint64) ((f uint8 :offset 56 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type gs-fog -(defmethod inspect gs-fog ((this gs-fog)) +(defmethod inspect ((this gs-fog)) (format #t "[~8x] ~A~%" this 'gs-fog) (format #t "~Tf: ~D~%" (-> this f)) this @@ -547,13 +448,10 @@ (fcg uint8 :offset 8 :size 8) (fcb uint8 :offset 16 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type gs-fogcol -(defmethod inspect gs-fogcol ((this gs-fogcol)) +(defmethod inspect ((this gs-fogcol)) (format #t "[~8x] ~A~%" this 'gs-fogcol) (format #t "~Tr: ~D~%" (-> this fcr)) (format #t "~Tg: ~D~%" (-> this fcg)) @@ -566,9 +464,6 @@ ((rst uint8 :offset 0 :size 1) (pse uint8 :offset 3 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-mode @@ -576,9 +471,6 @@ ((m3r uint8 :offset 0 :size 1) (imt uint8 :offset 2 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-stat @@ -596,9 +488,6 @@ (dir uint8 :offset 12 :size 1) (fqc uint8 :offset 24 :size 5) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-cnt @@ -607,18 +496,12 @@ (regcnt uint8 :offset 16 :size 4) (vuaddr uint16 :offset 20 :size 10) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-p3cnt (deftype gif-p3cnt (uint32) ((p3cnt uint16 :offset 0 :size 15) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-p3tag @@ -626,31 +509,25 @@ ((loopcnt uint16 :offset 0 :size 15) (eop uint8 :offset 15 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-bank (deftype gif-bank (structure) - ((ctrl gif-ctrl :offset 0) - (mode gif-mode :offset 16) - (stat gif-stat :offset 32) - (tag0 uint32 :offset 64) - (tag1 uint32 :offset 80) - (tag2 uint32 :offset 96) - (tag3 uint32 :offset 112) - (cnt gif-cnt :offset 128) - (p3cnt gif-p3cnt :offset 144) - (p3tag gif-p3tag :offset 160) - ) - :method-count-assert 9 - :size-assert #xa4 - :flag-assert #x9000000a4 + ((ctrl gif-ctrl :offset 0) + (mode gif-mode :offset 16) + (stat gif-stat :offset 32) + (tag0 uint32 :offset 64) + (tag1 uint32 :offset 80) + (tag2 uint32 :offset 96) + (tag3 uint32 :offset 112) + (cnt gif-cnt :offset 128) + (p3cnt gif-p3cnt :offset 144) + (p3tag gif-p3tag :offset 160) + ) ) ;; definition for method 3 of type gif-bank -(defmethod inspect gif-bank ((this gif-bank)) +(defmethod inspect ((this gif-bank)) (format #t "[~8x] ~A~%" this 'gif-bank) (format #t "~Tctrl: #x~X~%" (-> this ctrl)) (format #t "~Tmode: #x~X~%" (-> this mode)) @@ -668,17 +545,11 @@ ;; definition of type gif-tag-prim (deftype gif-tag-prim (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-tag-count (deftype gif-tag-count (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-tag64 @@ -691,9 +562,6 @@ (flg gif-flag :offset 58 :size 2) (nreg uint8 :offset 60 :size 4) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gif-tag @@ -722,26 +590,20 @@ (regs14 gif-reg-id :offset 120 :size 4) (regs15 gif-reg-id :offset 124 :size 4) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition of type gs-gif-tag (deftype gs-gif-tag (structure) - ((qword uint128 :offset-assert 0) - (tag gif-tag64 :offset 0) - (regs gif-tag-regs :offset 8) - (dword uint64 2 :offset 0) - (word uint32 4 :offset 0) + ((qword uint128) + (tag gif-tag64 :overlay-at qword) + (regs gif-tag-regs :offset 8) + (dword uint64 2 :overlay-at qword) + (word uint32 4 :overlay-at qword) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gs-gif-tag -(defmethod inspect gs-gif-tag ((this gs-gif-tag)) +(defmethod inspect ((this gs-gif-tag)) (format #t "[~8x] ~A~%" this 'gs-gif-tag) (format #t "~Tqword: #~%" (&-> this tag)) (format #t "~Tdword[2] @ #x~X~%" (&-> this tag)) @@ -753,7 +615,7 @@ ;; definition for method 3 of type gif-tag ;; INFO: Return type mismatch object vs gif-tag. -(defmethod inspect gif-tag ((this gif-tag)) +(defmethod inspect ((this gif-tag)) (format #t "[~8x] gif-tag~%" this) (format #t "~Tnloop: ~4d~%" (-> this nloop)) (format #t "~Teop : ~4d~%" (-> this eop)) @@ -851,22 +713,19 @@ ;; definition of type gif-packet (deftype gif-packet (basic) - ((reg-count int32 :offset-assert 4) - (gif-tag gs-gif-tag :inline :offset-assert 16) - (gif-tag0 uint128 :offset 16) - (args uint64 1 :offset-assert 32) - ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 + ((reg-count int32) + (gif-tag gs-gif-tag :inline) + (gif-tag0 uint128 :overlay-at (-> gif-tag qword)) + (args uint64 1) + ) (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) ;; definition for method 3 of type gif-packet ;; INFO: Used lq/sq -(defmethod inspect gif-packet ((this gif-packet)) +(defmethod inspect ((this gif-packet)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Treg-count: ~D~%" (-> this reg-count)) (format #t "~Tgif-tag0: #x~X~%" (-> this gif-tag0)) @@ -907,23 +766,20 @@ ;; definition of type draw-context (deftype draw-context (basic) - ((orgx int32 :offset-assert 4) - (orgy int32 :offset-assert 8) - (orgz int32 :offset-assert 12) - (width int32 :offset-assert 16) - (height int32 :offset-assert 20) - (color rgba 4 :offset-assert 24) - ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 + ((orgx int32) + (orgy int32) + (orgz int32) + (width int32) + (height int32) + (color rgba 4) + ) (:methods - (new (symbol type int int int int rgba) _type_ 0) + (new (symbol type int int int int rgba) _type_) ) ) ;; definition for method 3 of type draw-context -(defmethod inspect draw-context ((this draw-context)) +(defmethod inspect ((this draw-context)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Torgx: ~D~%" (-> this orgx)) (format #t "~Torgy: ~D~%" (-> this orgy)) diff --git a/test/decompiler/reference/jak1/engine/gfx/hw/video-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/hw/video-h_REF.gc index 52c10375f38..9ba384d5252 100644 --- a/test/decompiler/reference/jak1/engine/gfx/hw/video-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/hw/video-h_REF.gc @@ -3,30 +3,27 @@ ;; definition of type video-parms (deftype video-parms (structure) - ((set-video-mode basic :offset-assert 0) - (reset-video-mode basic :offset-assert 4) - (screen-sy int32 :offset-assert 8) - (screen-hy int32 :offset-assert 12) - (screen-miny int32 :offset-assert 16) - (screen-maxy int32 :offset-assert 20) - (screen-masky int32 :offset-assert 24) - (display-dx int32 :offset-assert 28) - (display-dy int32 :offset-assert 32) - (screen-pages-high int32 :offset-assert 36) - (_pad int64 :offset-assert 40) - (relative-x-scale float :offset-assert 48) - (relative-y-scale float :offset-assert 52) - (_pad2 int64 :offset-assert 56) - (relative-x-scale-reciprical float :offset-assert 64) - (relative-y-scale-reciprical float :offset-assert 68) + ((set-video-mode basic) + (reset-video-mode basic) + (screen-sy int32) + (screen-hy int32) + (screen-miny int32) + (screen-maxy int32) + (screen-masky int32) + (display-dx int32) + (display-dy int32) + (screen-pages-high int32) + (_pad int64) + (relative-x-scale float) + (relative-y-scale float) + (_pad2 int64) + (relative-x-scale-reciprical float) + (relative-y-scale-reciprical float) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) ;; definition for method 3 of type video-parms -(defmethod inspect video-parms ((this video-parms)) +(defmethod inspect ((this video-parms)) (format #t "[~8x] ~A~%" this 'video-parms) (format #t "~Tset-video-mode: ~A~%" (-> this set-video-mode)) (format #t "~Treset-video-mode: ~A~%" (-> this reset-video-mode)) diff --git a/test/decompiler/reference/jak1/engine/gfx/lights-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/lights-h_REF.gc index 24eebd03b47..182df62a045 100644 --- a/test/decompiler/reference/jak1/engine/gfx/lights-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/lights-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type vu-lights (deftype vu-lights (structure) - ((direction vector 3 :inline :offset-assert 0) - (color vector 3 :inline :offset-assert 48) - (ambient vector :inline :offset-assert 96) + ((direction vector 3 :inline) + (color vector 3 :inline) + (ambient vector :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type vu-lights -(defmethod inspect vu-lights ((this vu-lights)) +(defmethod inspect ((this vu-lights)) (format #t "[~8x] ~A~%" this 'vu-lights) (format #t "~Tdirection[3] @ #x~X~%" (-> this direction)) (format #t "~Tcolor[3] @ #x~X~%" (-> this color)) @@ -23,19 +20,16 @@ ;; definition of type light (deftype light (structure) - ((direction vector :inline :offset-assert 0) - (color rgbaf :inline :offset-assert 16) - (levels vector :inline :offset-assert 32) - (level float :offset 32) - (sort-level float :offset 36) + ((direction vector :inline) + (color rgbaf :inline) + (levels vector :inline) + (level float :overlay-at (-> levels x)) + (sort-level float :overlay-at (-> levels y)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type light -(defmethod inspect light ((this light)) +(defmethod inspect ((this light)) (format #t "[~8x] ~A~%" this 'light) (format #t "~Tdirection: #~%" (-> this direction)) (format #t "~Tcolor: #~%" (-> this color)) @@ -47,22 +41,19 @@ ;; definition of type light-ellipse (deftype light-ellipse (structure) - ((matrix matrix :inline :offset-assert 0) - (color rgbaf :inline :offset-assert 64) - (name basic :offset 12) - (decay-start float :offset 28) - (ambient-point-ratio float :offset 44) - (level float :offset 60) - (func-symbol basic :offset 76) - (func basic :offset 76) + ((matrix matrix :inline) + (color rgbaf :inline) + (name basic :overlay-at (-> matrix data 3)) + (decay-start float :overlay-at (-> matrix data 7)) + (ambient-point-ratio float :overlay-at (-> matrix data 11)) + (level float :overlay-at (-> matrix data 15)) + (func-symbol basic :overlay-at (-> color a)) + (func basic :overlay-at (-> color a)) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type light-ellipse -(defmethod inspect light-ellipse ((this light-ellipse)) +(defmethod inspect ((this light-ellipse)) (format #t "[~8x] ~A~%" this 'light-ellipse) (format #t "~Tmatrix: #~%" (-> this matrix)) (format #t "~Tcolor: #~%" (-> this color)) @@ -78,13 +69,10 @@ ;; definition of type light-array (deftype light-array (array) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type light-array -(defmethod inspect light-array ((this light-array)) +(defmethod inspect ((this light-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttype: ~A~%" (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -95,15 +83,12 @@ ;; definition of type light-volume (deftype light-volume (basic) - ((light-array light-array :offset-assert 4) + ((light-array light-array) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type light-volume -(defmethod inspect light-volume ((this light-volume)) +(defmethod inspect ((this light-volume)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlight-array: ~A~%" (-> this light-array)) this @@ -111,15 +96,12 @@ ;; definition of type light-volume-sphere (deftype light-volume-sphere (light-volume) - ((bsphere sphere :inline :offset-assert 16) + ((bsphere sphere :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type light-volume-sphere -(defmethod inspect light-volume-sphere ((this light-volume-sphere)) +(defmethod inspect ((this light-volume-sphere)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlight-array: ~A~%" (-> this light-array)) (format #t "~Tbsphere: #~%" (-> this bsphere)) @@ -128,15 +110,12 @@ ;; definition of type light-volume-planes (deftype light-volume-planes (light-volume) - ((planes vertical-planes :offset-assert 8) + ((planes vertical-planes) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type light-volume-planes -(defmethod inspect light-volume-planes ((this light-volume-planes)) +(defmethod inspect ((this light-volume-planes)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlight-array: ~A~%" (-> this light-array)) (format #t "~Tplanes: #~%" (-> this planes)) @@ -146,13 +125,10 @@ ;; definition of type light-volume-array (deftype light-volume-array (array) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type light-volume-array -(defmethod inspect light-volume-array ((this light-volume-array)) +(defmethod inspect ((this light-volume-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttype: ~A~%" (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -162,7 +138,7 @@ ) ;; definition for method 2 of type light -(defmethod print light ((this light)) +(defmethod print ((this light)) (format #t "# this dir0)) (format #t "~Tdir1: ~`light`P~%" (-> this dir1)) diff --git a/test/decompiler/reference/jak1/engine/gfx/math-camera-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/math-camera-h_REF.gc index 6d520a74af4..9dd616b876e 100644 --- a/test/decompiler/reference/jak1/engine/gfx/math-camera-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/math-camera-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type vis-gif-tag (deftype vis-gif-tag (structure) - ((fog0 uint32 :offset-assert 0) - (strip uint32 :offset-assert 4) - (regs uint32 :offset-assert 8) - (fan uint32 :offset-assert 12) + ((fog0 uint32) + (strip uint32) + (regs uint32) + (fan uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vis-gif-tag -(defmethod inspect vis-gif-tag ((this vis-gif-tag)) +(defmethod inspect ((this vis-gif-tag)) (format #t "[~8x] ~A~%" this 'vis-gif-tag) (format #t "~Tfog0: ~D~%" (-> this fog0)) (format #t "~Tstrip: ~D~%" (-> this strip)) @@ -25,31 +22,28 @@ ;; definition of type cull-info (deftype cull-info (structure) - ((x-fact float :offset-assert 0) - (y-fact float :offset-assert 4) - (z-fact float :offset-assert 8) - (cam-radius float :offset-assert 12) - (cam-x float :offset-assert 16) - (cam-y float :offset-assert 20) - (xz-dir-ax float :offset-assert 24) - (xz-dir-az float :offset-assert 28) - (xz-dir-bx float :offset-assert 32) - (xz-dir-bz float :offset-assert 36) - (xz-cross-ab float :offset-assert 40) - (yz-dir-ay float :offset-assert 44) - (yz-dir-az float :offset-assert 48) - (yz-dir-by float :offset-assert 52) - (yz-dir-bz float :offset-assert 56) - (yz-cross-ab float :offset-assert 60) + ((x-fact float) + (y-fact float) + (z-fact float) + (cam-radius float) + (cam-x float) + (cam-y float) + (xz-dir-ax float) + (xz-dir-az float) + (xz-dir-bx float) + (xz-dir-bz float) + (xz-cross-ab float) + (yz-dir-ay float) + (yz-dir-az float) + (yz-dir-by float) + (yz-dir-bz float) + (yz-cross-ab float) ) :pack-me - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type cull-info -(defmethod inspect cull-info ((this cull-info)) +(defmethod inspect ((this cull-info)) (format #t "[~8x] ~A~%" this 'cull-info) (format #t "~Tx-fact: ~f~%" (-> this x-fact)) (format #t "~Ty-fact: ~f~%" (-> this y-fact)) @@ -72,66 +66,63 @@ ;; definition of type math-camera (deftype math-camera (basic) - ((d meters :offset-assert 4) - (f meters :offset-assert 8) - (fov degrees :offset-assert 12) - (x-ratio float :offset-assert 16) - (y-ratio float :offset-assert 20) - (x-pix float :offset-assert 24) - (x-clip float :offset-assert 28) - (x-clip-ratio-in float :offset-assert 32) - (x-clip-ratio-over float :offset-assert 36) - (y-pix float :offset-assert 40) - (y-clip float :offset-assert 44) - (y-clip-ratio-in float :offset-assert 48) - (y-clip-ratio-over float :offset-assert 52) - (cull-info cull-info :inline :offset-assert 56) - (fog-start meters :offset-assert 120) - (fog-end meters :offset-assert 124) - (fog-max float :offset-assert 128) - (fog-min float :offset-assert 132) - (reset int32 :offset-assert 136) - (smooth-step float :offset-assert 140) - (smooth-t float :offset-assert 144) - (perspective matrix :inline :offset-assert 160) - (isometric matrix :inline :offset-assert 224) - (sprite-2d matrix :inline :offset-assert 288) - (sprite-2d-hvdf vector :inline :offset-assert 352) - (camera-rot matrix :inline :offset-assert 368) - (inv-camera-rot matrix :inline :offset-assert 432) - (inv-camera-rot-smooth matrix :inline :offset-assert 496) - (inv-camera-rot-smooth-from quaternion :inline :offset-assert 560) - (camera-temp matrix :inline :offset-assert 576) - (prev-camera-temp matrix :inline :offset-assert 640) - (hmge-scale vector :inline :offset-assert 704) - (inv-hmge-scale vector :inline :offset-assert 720) - (hvdf-off vector :inline :offset-assert 736) - (guard vector :inline :offset-assert 752) - (vis-gifs vis-gif-tag 4 :inline :offset-assert 768) - (vis-gifs-quads uint128 4 :offset 768) - (giftex vis-gif-tag :offset 768) - (gifgr vis-gif-tag :offset 784) - (giftex-trans vis-gif-tag :offset 800) - (gifgr-trans vis-gif-tag :offset 816) - (pfog0 float :offset-assert 832) - (pfog1 float :offset-assert 836) - (trans vector :inline :offset-assert 848) - (plane plane 4 :inline :offset-assert 864) - (guard-plane plane 4 :inline :offset-assert 928) - (shrub-mat matrix :inline :offset-assert 992) - (fov-correction-factor float :offset-assert 1056) + ((d meters) + (f meters) + (fov degrees) + (x-ratio float) + (y-ratio float) + (x-pix float) + (x-clip float) + (x-clip-ratio-in float) + (x-clip-ratio-over float) + (y-pix float) + (y-clip float) + (y-clip-ratio-in float) + (y-clip-ratio-over float) + (cull-info cull-info :inline) + (fog-start meters) + (fog-end meters) + (fog-max float) + (fog-min float) + (reset int32) + (smooth-step float) + (smooth-t float) + (perspective matrix :inline) + (isometric matrix :inline) + (sprite-2d matrix :inline) + (sprite-2d-hvdf vector :inline) + (camera-rot matrix :inline) + (inv-camera-rot matrix :inline) + (inv-camera-rot-smooth matrix :inline) + (inv-camera-rot-smooth-from quaternion :inline) + (camera-temp matrix :inline) + (prev-camera-temp matrix :inline) + (hmge-scale vector :inline) + (inv-hmge-scale vector :inline) + (hvdf-off vector :inline) + (guard vector :inline) + (vis-gifs vis-gif-tag 4 :inline) + (vis-gifs-quads uint128 4 :overlay-at vis-gifs) + (giftex vis-gif-tag :overlay-at (-> vis-gifs 0)) + (gifgr vis-gif-tag :overlay-at (-> vis-gifs 1)) + (giftex-trans vis-gif-tag :overlay-at (-> vis-gifs 2)) + (gifgr-trans vis-gif-tag :overlay-at (-> vis-gifs 3)) + (pfog0 float) + (pfog1 float) + (trans vector :inline) + (plane plane 4 :inline) + (guard-plane plane 4 :inline) + (shrub-mat matrix :inline) + (fov-correction-factor float) ) - :method-count-assert 9 - :size-assert #x424 - :flag-assert #x900000424 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type math-camera ;; INFO: Used lq/sq -(defmethod inspect math-camera ((this math-camera)) +(defmethod inspect ((this math-camera)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Td: (meters ~m)~%" (-> this d)) (format #t "~Tf: (meters ~m)~%" (-> this f)) diff --git a/test/decompiler/reference/jak1/engine/gfx/math-camera_REF.gc b/test/decompiler/reference/jak1/engine/gfx/math-camera_REF.gc index 1cf45f5f91e..af246fe3626 100644 --- a/test/decompiler/reference/jak1/engine/gfx/math-camera_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/math-camera_REF.gc @@ -3,16 +3,13 @@ ;; definition of type fog-corrector (deftype fog-corrector (structure) - ((fog-end float :offset-assert 0) - (fog-start float :offset-assert 4) + ((fog-end float) + (fog-start float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type fog-corrector -(defmethod inspect fog-corrector ((this fog-corrector)) +(defmethod inspect ((this fog-corrector)) (format #t "[~8x] ~A~%" this 'fog-corrector) (format #t "~Tfog-end: ~f~%" (-> this fog-end)) (format #t "~Tfog-start: ~f~%" (-> this fog-start)) diff --git a/test/decompiler/reference/jak1/engine/gfx/merc/generic-merc-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/merc/generic-merc-h_REF.gc index 8bce94b05f0..ba15930c311 100644 --- a/test/decompiler/reference/jak1/engine/gfx/merc/generic-merc-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/merc/generic-merc-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type merc-matrix (deftype merc-matrix (structure) - ((quad uint128 8 :offset-assert 0) - (vector vector 8 :inline :offset 0) - (tag uint64 :offset 0) + ((quad uint128 8) + (vector vector 8 :inline :overlay-at (-> quad 0)) + (tag uint64 :overlay-at (-> quad 0)) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type merc-matrix -(defmethod inspect merc-matrix ((this merc-matrix)) +(defmethod inspect ((this merc-matrix)) (format #t "[~8x] ~A~%" this 'merc-matrix) (format #t "~Tquad[8] @ #x~X~%" (-> this quad)) (format #t "~Tvector[8] @ #x~X~%" (-> this quad)) @@ -23,17 +20,14 @@ ;; definition of type generic-merc-tag (deftype generic-merc-tag (dma-packet) - ((next-ptr uint32 :offset 12) - (size uint32 :offset 8) + ((next-ptr uint32 :overlay-at vif1) + (size uint32 :overlay-at vif0) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type generic-merc-tag ;; INFO: Used lq/sq -(defmethod inspect generic-merc-tag ((this generic-merc-tag)) +(defmethod inspect ((this generic-merc-tag)) (format #t "[~8x] ~A~%" this 'generic-merc-tag) (format #t "~Tdma: #x~X~%" (-> this dma)) (format #t "~Tvif0: #x~X~%" (-> this vif0)) @@ -46,18 +40,15 @@ ;; definition of type generic-merc-ctrl (deftype generic-merc-ctrl (structure) - ((tag generic-merc-tag :inline :offset-assert 0) - (lights vu-lights :inline :offset-assert 16) - (header merc-ctrl-header :inline :offset-assert 128) - (effect merc-effect :inline :offset-assert 208) + ((tag generic-merc-tag :inline) + (lights vu-lights :inline) + (header merc-ctrl-header :inline) + (effect merc-effect :inline) ) - :method-count-assert 9 - :size-assert #xf0 - :flag-assert #x9000000f0 ) ;; definition for method 3 of type generic-merc-ctrl -(defmethod inspect generic-merc-ctrl ((this generic-merc-ctrl)) +(defmethod inspect ((this generic-merc-ctrl)) (format #t "[~8x] ~A~%" this 'generic-merc-ctrl) (format #t "~Ttag: #~%" (-> this tag)) (format #t "~Tlights: #~%" (-> this lights)) @@ -68,15 +59,12 @@ ;; definition of type generic-merc-ctrl-with-sfx (deftype generic-merc-ctrl-with-sfx (generic-merc-ctrl) - ((sfx-data uint128 11 :offset-assert 240) + ((sfx-data uint128 11) ) - :method-count-assert 9 - :size-assert #x1a0 - :flag-assert #x9000001a0 ) ;; definition for method 3 of type generic-merc-ctrl-with-sfx -(defmethod inspect generic-merc-ctrl-with-sfx ((this generic-merc-ctrl-with-sfx)) +(defmethod inspect ((this generic-merc-ctrl-with-sfx)) (format #t "[~8x] ~A~%" this 'generic-merc-ctrl-with-sfx) (format #t "~Ttag: #~%" (-> this tag)) (format #t "~Tlights: #~%" (-> this lights)) @@ -88,21 +76,18 @@ ;; definition of type generic-merc-input (deftype generic-merc-input (structure) - ((geo-tag generic-merc-tag :inline :offset-assert 0) - (geo-block uint8 1296 :offset-assert 16) - (byte-header merc-byte-header :inline :offset 16) - (matrix merc-matrix 9 :inline :offset-assert 1312) - (control generic-merc-ctrl-with-sfx :inline :offset-assert 2464) - (end-tag generic-merc-tag :inline :offset-assert 2880) - (shader adgif-shader :inline :offset-assert 2896) + ((geo-tag generic-merc-tag :inline) + (geo-block uint8 1296) + (byte-header merc-byte-header :inline :overlay-at (-> geo-block 0)) + (matrix merc-matrix 9 :inline) + (control generic-merc-ctrl-with-sfx :inline) + (end-tag generic-merc-tag :inline) + (shader adgif-shader :inline) ) - :method-count-assert 9 - :size-assert #xba0 - :flag-assert #x900000ba0 ) ;; definition for method 3 of type generic-merc-input -(defmethod inspect generic-merc-input ((this generic-merc-input)) +(defmethod inspect ((this generic-merc-input)) (format #t "[~8x] ~A~%" this 'generic-merc-input) (format #t "~Tgeo-tag: #~%" (-> this geo-tag)) (format #t "~Tgeo-block[1296] @ #x~X~%" (-> this geo-block)) @@ -116,20 +101,17 @@ ;; definition of type generic-merc-output (deftype generic-merc-output (structure) - ((info gsf-info :inline :offset-assert 0) - (header gsf-header :inline :offset-assert 16) - (index-kick-table uint16 80 :offset-assert 32) - (index-table uint8 160 :offset 32) - (inverse-table uint8 256 :offset-assert 192) - (vertex-table gsf-vertex 72 :inline :offset-assert 448) + ((info gsf-info :inline) + (header gsf-header :inline) + (index-kick-table uint16 80) + (index-table uint8 160 :overlay-at (-> index-kick-table 0)) + (inverse-table uint8 256) + (vertex-table gsf-vertex 72 :inline) ) - :method-count-assert 9 - :size-assert #xac0 - :flag-assert #x900000ac0 ) ;; definition for method 3 of type generic-merc-output -(defmethod inspect generic-merc-output ((this generic-merc-output)) +(defmethod inspect ((this generic-merc-output)) (format #t "[~8x] ~A~%" this 'generic-merc-output) (format #t "~Tinfo: #~%" (-> this info)) (format #t "~Theader: #~%" (-> this header)) @@ -142,20 +124,17 @@ ;; definition of type generic-merc-dcache (deftype generic-merc-dcache (structure) - ((output-a generic-merc-output :inline :offset-assert 0) - (output-b generic-merc-output :inline :offset-assert 2752) - (inv-table-1 uint8 544 :offset-assert 5504) - (inv-table-7 uint8 544 :offset-assert 6048) - (inv-safety uint8 16 :offset-assert 6592) - (effect-data uint8 1584 :offset-assert 6608) + ((output-a generic-merc-output :inline) + (output-b generic-merc-output :inline) + (inv-table-1 uint8 544) + (inv-table-7 uint8 544) + (inv-safety uint8 16) + (effect-data uint8 1584) ) - :method-count-assert 9 - :size-assert #x2000 - :flag-assert #x900002000 ) ;; definition for method 3 of type generic-merc-dcache -(defmethod inspect generic-merc-dcache ((this generic-merc-dcache)) +(defmethod inspect ((this generic-merc-dcache)) (format #t "[~8x] ~A~%" this 'generic-merc-dcache) (format #t "~Toutput-a: #~%" (-> this output-a)) (format #t "~Toutput-b: #~%" (-> this output-b)) @@ -168,38 +147,35 @@ ;; definition of type gm-shadow (deftype gm-shadow (structure) - ((perspective matrix :inline :offset-assert 0) - (isometric matrix :inline :offset-assert 64) - (inv-camera-rot matrix :inline :offset-assert 128) - (envmap-shader adgif-shader :inline :offset-assert 192) - (current-chain uint32 :offset-assert 272) - (next-chain uint32 :offset-assert 276) - (buf-index uint32 :offset-assert 280) - (fragment-count uint32 :offset-assert 284) - (write-limit pointer :offset-assert 288) - (indexed-input-base generic-merc-input :offset-assert 292) - (other-input-base generic-merc-input :offset-assert 296) - (indexed-output-base generic-merc-output :offset-assert 300) - (other-output-base generic-merc-output :offset-assert 304) - (p-input uint32 :offset-assert 308) - (gsf-buf generic-merc-dcache :offset-assert 312) - (p-fheader merc-fp-header :offset-assert 316) - (mercneric-convert basic :offset-assert 320) - (generic-prepare-dma-single basic :offset-assert 324) - (generic-prepare-dma-double basic :offset-assert 328) - (generic-light-proc basic :offset-assert 332) - (generic-envmap-proc basic :offset-assert 336) - (high-speed-reject basic :offset-assert 340) - (hsr-xmult vector :inline :offset-assert 352) - (hsr-ymult vector :inline :offset-assert 368) + ((perspective matrix :inline) + (isometric matrix :inline) + (inv-camera-rot matrix :inline) + (envmap-shader adgif-shader :inline) + (current-chain uint32) + (next-chain uint32) + (buf-index uint32) + (fragment-count uint32) + (write-limit pointer) + (indexed-input-base generic-merc-input) + (other-input-base generic-merc-input) + (indexed-output-base generic-merc-output) + (other-output-base generic-merc-output) + (p-input uint32) + (gsf-buf generic-merc-dcache) + (p-fheader merc-fp-header) + (mercneric-convert basic) + (generic-prepare-dma-single basic) + (generic-prepare-dma-double basic) + (generic-light-proc basic) + (generic-envmap-proc basic) + (high-speed-reject basic) + (hsr-xmult vector :inline) + (hsr-ymult vector :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;; definition for method 3 of type gm-shadow -(defmethod inspect gm-shadow ((this gm-shadow)) +(defmethod inspect ((this gm-shadow)) (format #t "[~8x] ~A~%" this 'gm-shadow) (format #t "~Tperspective: #~%" (-> this perspective)) (format #t "~Tisometric: #~%" (-> this isometric)) @@ -230,19 +206,16 @@ ;; definition of type generic-merc-work (deftype generic-merc-work (structure) - ((input-a generic-merc-input :inline :offset-assert 0) - (input-b generic-merc-input :inline :offset-assert 2976) - (ctrl generic-merc-ctrl-with-sfx :inline :offset-assert 5952) - (shadow gm-shadow :inline :offset-assert 6368) - (stack uint128 16 :offset-assert 6752) + ((input-a generic-merc-input :inline) + (input-b generic-merc-input :inline) + (ctrl generic-merc-ctrl-with-sfx :inline) + (shadow gm-shadow :inline) + (stack uint128 16) ) - :method-count-assert 9 - :size-assert #x1b60 - :flag-assert #x900001b60 ) ;; definition for method 3 of type generic-merc-work -(defmethod inspect generic-merc-work ((this generic-merc-work)) +(defmethod inspect ((this generic-merc-work)) (format #t "[~8x] ~A~%" this 'generic-merc-work) (format #t "~Tinput-a: #~%" (-> this input-a)) (format #t "~Tinput-b: #~%" (-> this input-b)) diff --git a/test/decompiler/reference/jak1/engine/gfx/merc/merc-death_REF.gc b/test/decompiler/reference/jak1/engine/gfx/merc/merc-death_REF.gc index 5c852d6b5b1..ac255b4c563 100644 --- a/test/decompiler/reference/jak1/engine/gfx/merc/merc-death_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/merc/merc-death_REF.gc @@ -6,19 +6,16 @@ ;; definition of type death-info (deftype death-info (basic) - ((vertex-skip uint16 :offset-assert 4) - (timer uint8 :offset-assert 6) - (overlap uint8 :offset-assert 7) - (effect uint32 :offset-assert 8) - (sound symbol :offset-assert 12) + ((vertex-skip uint16) + (timer uint8) + (overlap uint8) + (effect uint32) + (sound symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type death-info -(defmethod inspect death-info ((this death-info)) +(defmethod inspect ((this death-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tvertex-skip: ~D~%" (-> this vertex-skip)) (format #t "~Ttimer: ~D~%" (-> this timer)) diff --git a/test/decompiler/reference/jak1/engine/gfx/merc/merc-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/merc/merc-h_REF.gc index b14bd864750..f1be0aa6db5 100644 --- a/test/decompiler/reference/jak1/engine/gfx/merc/merc-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/merc/merc-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type ripple-merc-query (deftype ripple-merc-query (inline-array-class) - ((start-vertex int32 :offset-assert 16) - (vertex-skip int32 :offset-assert 20) - (vertex-count int32 :offset-assert 24) - (current-loc int32 :offset-assert 28) - (data vector :inline :dynamic :offset-assert 32) + ((start-vertex int32) + (vertex-skip int32) + (vertex-count int32) + (current-loc int32) + (data vector :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type ripple-merc-query -(defmethod inspect ripple-merc-query ((this ripple-merc-query)) +(defmethod inspect ((this ripple-merc-query)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -32,28 +29,25 @@ ;; definition of type merc-byte-header (deftype merc-byte-header (structure) - ((srcdest-off uint8 :offset-assert 0) - (rgba-off uint8 :offset-assert 1) - (lump-off uint8 :offset-assert 2) - (fp-off uint8 :offset-assert 3) - (mat1-cnt uint8 :offset-assert 4) - (mat2-cnt uint8 :offset-assert 5) - (mat3-cnt uint8 :offset-assert 6) - (samecopy-cnt uint8 :offset-assert 7) - (crosscopy-cnt uint8 :offset-assert 8) - (strip-len uint8 :offset-assert 9) - (mm-quadword-fp-off uint8 :offset-assert 10) - (mm-quadword-size uint8 :offset-assert 11) - (perc-off uint8 :offset-assert 12) - (mat-slot uint8 10 :offset-assert 13) + ((srcdest-off uint8) + (rgba-off uint8) + (lump-off uint8) + (fp-off uint8) + (mat1-cnt uint8) + (mat2-cnt uint8) + (mat3-cnt uint8) + (samecopy-cnt uint8) + (crosscopy-cnt uint8) + (strip-len uint8) + (mm-quadword-fp-off uint8) + (mm-quadword-size uint8) + (perc-off uint8) + (mat-slot uint8 10) ) - :method-count-assert 9 - :size-assert #x17 - :flag-assert #x900000017 ) ;; definition for method 3 of type merc-byte-header -(defmethod inspect merc-byte-header ((this merc-byte-header)) +(defmethod inspect ((this merc-byte-header)) (format #t "[~8x] ~A~%" this 'merc-byte-header) (format #t "~Tsrcdest-off: ~D~%" (-> this srcdest-off)) (format #t "~Trgba-off: ~D~%" (-> this rgba-off)) @@ -74,19 +68,16 @@ ;; definition of type merc-fragment (deftype merc-fragment (structure) - ((header merc-byte-header :inline :offset-assert 0) - (rest uint8 1 :offset-assert 23) + ((header merc-byte-header :inline) + (rest uint8 1) ) - :method-count-assert 10 - :size-assert #x18 - :flag-assert #xa00000018 (:methods - (login-adgifs (_type_) none 9) + (login-adgifs (_type_) none) ) ) ;; definition for method 3 of type merc-fragment -(defmethod inspect merc-fragment ((this merc-fragment)) +(defmethod inspect ((this merc-fragment)) (format #t "[~8x] ~A~%" this 'merc-fragment) (format #t "~Theader: #~%" (-> this header)) (format #t "~Trest[1] @ #x~X~%" (-> this rest)) @@ -95,26 +86,23 @@ ;; definition of type merc-vtx (deftype merc-vtx (structure) - ((mat-0 uint8 :offset-assert 0) - (mat-1 uint8 :offset-assert 1) - (nrm-x uint8 :offset-assert 2) - (pos-x uint8 :offset-assert 3) - (dst-0 uint8 :offset-assert 4) - (dst-1 uint8 :offset-assert 5) - (nrm-y uint8 :offset-assert 6) - (pos-y uint8 :offset-assert 7) - (tex-s uint8 :offset-assert 8) - (tex-t uint8 :offset-assert 9) - (nrm-z uint8 :offset-assert 10) - (pos-z uint8 :offset-assert 11) + ((mat-0 uint8) + (mat-1 uint8) + (nrm-x uint8) + (pos-x uint8) + (dst-0 uint8) + (dst-1 uint8) + (nrm-y uint8) + (pos-y uint8) + (tex-s uint8) + (tex-t uint8) + (nrm-z uint8) + (pos-z uint8) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type merc-vtx -(defmethod inspect merc-vtx ((this merc-vtx)) +(defmethod inspect ((this merc-vtx)) (format #t "[~8x] ~A~%" this 'merc-vtx) (format #t "~Tmat-0: ~D~%" (-> this mat-0)) (format #t "~Tmat-1: ~D~%" (-> this mat-1)) @@ -133,21 +121,18 @@ ;; definition of type merc-fp-header (deftype merc-fp-header (structure) - ((x-add float :offset-assert 0) - (y-add float :offset-assert 4) - (z-add float :offset-assert 8) - (shader-cnt uint8 :offset-assert 12) - (kick-info-offset uint8 :offset-assert 13) - (kick-info-step uint8 :offset-assert 14) - (hword-cnt uint8 :offset-assert 15) + ((x-add float) + (y-add float) + (z-add float) + (shader-cnt uint8) + (kick-info-offset uint8) + (kick-info-step uint8) + (hword-cnt uint8) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type merc-fp-header -(defmethod inspect merc-fp-header ((this merc-fp-header)) +(defmethod inspect ((this merc-fp-header)) (format #t "[~8x] ~A~%" this 'merc-fp-header) (format #t "~Tx-add: ~f~%" (-> this x-add)) (format #t "~Ty-add: ~f~%" (-> this y-add)) @@ -167,17 +152,14 @@ ;; definition of type merc-mat-dest (deftype merc-mat-dest (structure) - ((matrix-number uint8 :offset-assert 0) - (matrix-dest uint8 :offset-assert 1) + ((matrix-number uint8) + (matrix-dest uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition for method 3 of type merc-mat-dest -(defmethod inspect merc-mat-dest ((this merc-mat-dest)) +(defmethod inspect ((this merc-mat-dest)) (format #t "[~8x] ~A~%" this 'merc-mat-dest) (format #t "~Tmatrix-number: ~D~%" (-> this matrix-number)) (format #t "~Tmatrix-dest: ~D~%" (-> this matrix-dest)) @@ -186,19 +168,17 @@ ;; definition of type merc-fragment-control (deftype merc-fragment-control (structure) - ((unsigned-four-count uint8 :offset-assert 0) - (lump-four-count uint8 :offset-assert 1) - (fp-qwc uint8 :offset-assert 2) - (mat-xfer-count uint8 :offset-assert 3) - (mat-dest-data merc-mat-dest :inline :dynamic :offset-assert 4) + ((unsigned-four-count uint8) + (lump-four-count uint8) + (fp-qwc uint8) + (mat-xfer-count uint8) + (mat-dest-data merc-mat-dest :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type merc-fragment-control -(defmethod inspect merc-fragment-control ((this merc-fragment-control)) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this merc-fragment-control)) (format #t "[~8x] ~A~%" this 'merc-fragment-control) (format #t "~Tunsigned-four-count: ~D~%" (-> this unsigned-four-count)) (format #t "~Tlump-four-count: ~D~%" (-> this lump-four-count)) @@ -210,15 +190,12 @@ ;; definition of type merc-blend-data (deftype merc-blend-data (structure) - ((int8-data int8 :dynamic :offset-assert 0) + ((int8-data int8 :dynamic) ) - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) ;; definition for method 3 of type merc-blend-data -(defmethod inspect merc-blend-data ((this merc-blend-data)) +(defmethod inspect ((this merc-blend-data)) (format #t "[~8x] ~A~%" this 'merc-blend-data) (format #t "~Tint8-data[0] @ #x~X~%" (-> this int8-data)) this @@ -226,17 +203,14 @@ ;; definition of type merc-blend-ctrl (deftype merc-blend-ctrl (structure) - ((blend-vtx-count uint8 :offset-assert 0) - (nonzero-index-count uint8 :offset-assert 1) - (bt-index uint8 :dynamic :offset-assert 2) + ((blend-vtx-count uint8) + (nonzero-index-count uint8) + (bt-index uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition for method 3 of type merc-blend-ctrl -(defmethod inspect merc-blend-ctrl ((this merc-blend-ctrl)) +(defmethod inspect ((this merc-blend-ctrl)) (format #t "[~8x] ~A~%" this 'merc-blend-ctrl) (format #t "~Tblend-vtx-count: ~D~%" (-> this blend-vtx-count)) (format #t "~Tnonzero-index-count: ~D~%" (-> this nonzero-index-count)) @@ -246,18 +220,15 @@ ;; definition of type mei-envmap-tint (deftype mei-envmap-tint (structure) - ((fade0 float :offset-assert 0) - (fade1 float :offset-assert 4) - (tint uint32 :offset-assert 8) - (dummy int32 :offset-assert 12) + ((fade0 float) + (fade1 float) + (tint uint32) + (dummy int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type mei-envmap-tint -(defmethod inspect mei-envmap-tint ((this mei-envmap-tint)) +(defmethod inspect ((this mei-envmap-tint)) (format #t "[~8x] ~A~%" this 'mei-envmap-tint) (format #t "~Tfade0: ~f~%" (-> this fade0)) (format #t "~Tfade1: ~f~%" (-> this fade1)) @@ -268,21 +239,18 @@ ;; definition of type mei-texture-scroll (deftype mei-texture-scroll (structure) - ((max-dist float :offset-assert 0) - (st-int-scale uint8 :offset-assert 4) - (time-factor uint8 :offset-assert 5) - (scroll-dir uint8 :offset-assert 6) - (cached-time uint8 :offset-assert 7) - (time-delta uint8 :offset-assert 8) - (dummy uint8 7 :offset-assert 9) + ((max-dist float) + (st-int-scale uint8) + (time-factor uint8) + (scroll-dir uint8) + (cached-time uint8) + (time-delta uint8) + (dummy uint8 7) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type mei-texture-scroll -(defmethod inspect mei-texture-scroll ((this mei-texture-scroll)) +(defmethod inspect ((this mei-texture-scroll)) (format #t "[~8x] ~A~%" this 'mei-texture-scroll) (format #t "~Tmax-dist: ~f~%" (-> this max-dist)) (format #t "~Tst-int-scale: ~D~%" (-> this st-int-scale)) @@ -296,18 +264,15 @@ ;; definition of type mei-ripple (deftype mei-ripple (structure) - ((x-base float :offset-assert 0) - (z-base float :offset-assert 4) - (grid-size float :offset-assert 8) - (angle float :offset-assert 12) + ((x-base float) + (z-base float) + (grid-size float) + (angle float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type mei-ripple -(defmethod inspect mei-ripple ((this mei-ripple)) +(defmethod inspect ((this mei-ripple)) (format #t "[~8x] ~A~%" this 'mei-ripple) (format #t "~Tx-base: ~f~%" (-> this x-base)) (format #t "~Tz-base: ~f~%" (-> this z-base)) @@ -318,19 +283,16 @@ ;; definition of type merc-extra-info (deftype merc-extra-info (structure) - ((envmap-tint-offset uint8 :offset-assert 0) - (shader-offset uint8 :offset-assert 1) - (texture-scroll-offset uint8 :offset-assert 2) - (ripple-offset uint8 :offset-assert 3) - (dummy uint8 12 :offset-assert 4) + ((envmap-tint-offset uint8) + (shader-offset uint8) + (texture-scroll-offset uint8) + (ripple-offset uint8) + (dummy uint8 12) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type merc-extra-info -(defmethod inspect merc-extra-info ((this merc-extra-info)) +(defmethod inspect ((this merc-extra-info)) (format #t "[~8x] ~A~%" this 'merc-extra-info) (format #t "~Tenvmap-tint-offset: ~D~%" (-> this envmap-tint-offset)) (format #t "~Tshader-offset: ~D~%" (-> this shader-offset)) @@ -342,31 +304,28 @@ ;; definition of type merc-effect (deftype merc-effect (structure) - ((frag-geo merc-fragment :offset-assert 0) - (frag-ctrl merc-fragment-control :offset-assert 4) - (blend-data merc-blend-data :offset-assert 8) - (blend-ctrl merc-blend-ctrl :offset-assert 12) - (dummy0 uint8 :offset-assert 16) - (effect-bits uint8 :offset-assert 17) - (frag-count uint16 :offset-assert 18) - (blend-frag-count uint16 :offset-assert 20) - (tri-count uint16 :offset-assert 22) - (dvert-count uint16 :offset-assert 24) - (dummy1 uint8 :offset-assert 26) - (envmap-usage uint8 :offset-assert 27) - (extra-info merc-extra-info :offset-assert 28) - (data uint64 4 :offset 0) + ((frag-geo merc-fragment) + (frag-ctrl merc-fragment-control) + (blend-data merc-blend-data) + (blend-ctrl merc-blend-ctrl) + (dummy0 uint8) + (effect-bits uint8) + (frag-count uint16) + (blend-frag-count uint16) + (tri-count uint16) + (dvert-count uint16) + (dummy1 uint8) + (envmap-usage uint8) + (extra-info merc-extra-info) + (data uint64 4 :overlay-at frag-geo) ) - :method-count-assert 10 - :size-assert #x20 - :flag-assert #xa00000020 (:methods - (login-adgifs (_type_) none 9) + (login-adgifs (_type_) none) ) ) ;; definition for method 3 of type merc-effect -(defmethod inspect merc-effect ((this merc-effect)) +(defmethod inspect ((this merc-effect)) (format #t "[~8x] ~A~%" this 'merc-effect) (format #t "~Tfrag-geo: #~%" (-> this frag-geo)) (format #t "~Tfrag-ctrl: #~%" (-> this frag-ctrl)) @@ -386,21 +345,18 @@ ;; definition of type merc-eye-ctrl (deftype merc-eye-ctrl (structure) - ((eye-slot int8 :offset-assert 0) - (shader-offset int8 :offset-assert 1) - (shader-count int8 :offset-assert 2) - (iris-shader adgif-shader :inline :offset-assert 16) - (pupil-shader adgif-shader :inline :offset-assert 96) - (lid-shader adgif-shader :inline :offset-assert 176) - (shader adgif-shader 3 :inline :offset 16) + ((eye-slot int8) + (shader-offset int8) + (shader-count int8) + (shader adgif-shader 3 :inline) + (iris-shader adgif-shader :inline :overlay-at (-> shader 0)) + (pupil-shader adgif-shader :inline :overlay-at (-> shader 1)) + (lid-shader adgif-shader :inline :overlay-at (-> shader 2)) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; definition for method 3 of type merc-eye-ctrl -(defmethod inspect merc-eye-ctrl ((this merc-eye-ctrl)) +(defmethod inspect ((this merc-eye-ctrl)) (format #t "[~8x] ~A~%" this 'merc-eye-ctrl) (format #t "~Teye-slot: ~D~%" (-> this eye-slot)) (format #t "~Tshader-offset: ~D~%" (-> this shader-offset)) @@ -414,22 +370,19 @@ ;; definition of type merc-eye-anim-frame (deftype merc-eye-anim-frame (structure) - ((pupil-trans-x int8 :offset-assert 0) - (pupil-trans-y int8 :offset-assert 1) - (blink int8 :offset-assert 2) - (iris-scale int8 :offset 4) - (pupil-scale int8 :offset-assert 5) - (lid-scale int8 :offset-assert 6) - (dword uint64 :offset 0) + ((pupil-trans-x int8) + (pupil-trans-y int8) + (blink int8) + (iris-scale int8 :offset 4) + (pupil-scale int8) + (lid-scale int8) + (dword uint64 :overlay-at pupil-trans-x) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type merc-eye-anim-frame -(defmethod inspect merc-eye-anim-frame ((this merc-eye-anim-frame)) +(defmethod inspect ((this merc-eye-anim-frame)) (format #t "[~8x] ~A~%" this 'merc-eye-anim-frame) (format #t "~Tpupil-trans-x: ~D~%" (-> this pupil-trans-x)) (format #t "~Tpupil-trans-y: ~D~%" (-> this pupil-trans-y)) @@ -443,16 +396,13 @@ ;; definition of type merc-eye-anim-block (deftype merc-eye-anim-block (structure) - ((max-frame int16 :offset-assert 0) - (data merc-eye-anim-frame :inline :dynamic :offset 8) + ((max-frame int16) + (data merc-eye-anim-frame :inline :dynamic :offset 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type merc-eye-anim-block -(defmethod inspect merc-eye-anim-block ((this merc-eye-anim-block)) +(defmethod inspect ((this merc-eye-anim-block)) (format #t "[~8x] ~A~%" this 'merc-eye-anim-block) (format #t "~Tmax-frame: ~D~%" (-> this max-frame)) (format #t "~Tdata[0] @ #x~X~%" (-> this data)) @@ -461,54 +411,51 @@ ;; definition of type merc-ctrl-header (deftype merc-ctrl-header (structure) - ((xyz-scale float :offset-assert 0) - (st-magic uint32 :offset-assert 4) - (st-out-a uint32 :offset-assert 8) - (st-out-b uint32 :offset-assert 12) - (st-vif-add uint32 :offset-assert 16) - (st-int-off uint16 :offset-assert 20) - (st-int-scale uint16 :offset-assert 22) - (effect-count uint32 :offset-assert 24) - (blend-target-count uint32 :offset-assert 28) - (fragment-count uint16 :offset-assert 32) - (tri-count uint16 :offset-assert 34) - (matrix-count uint8 :offset-assert 36) - (shader-count uint8 :offset-assert 37) - (transform-vertex-count uint16 :offset-assert 38) - (dvert-count uint16 :offset-assert 40) - (one-mat-count uint16 :offset-assert 42) - (two-mat-count uint16 :offset-assert 44) - (two-mat-reuse-count uint16 :offset-assert 46) - (three-mat-count uint16 :offset-assert 48) - (three-mat-reuse-count uint16 :offset-assert 50) - (shader-upload-count uint8 :offset-assert 52) - (matrix-upload-count uint8 :offset-assert 53) - (same-copy-count uint16 :offset-assert 54) - (cross-copy-count uint16 :offset-assert 56) - (num-verts uint16 :offset-assert 58) - (longest-edge float :offset-assert 60) - (eye-ctrl merc-eye-ctrl :offset-assert 64) - (masks uint32 3 :offset-assert 68) - (dummy-bytes uint8 48 :offset 32) - (envmap-tint uint32 :offset 32) - (query basic :offset 36) - (needs-clip uint8 :offset 40) - (use-isometric uint8 :offset 41) - (use-attached-shader uint8 :offset 42) - (display-triangles uint8 :offset 43) - (death-vertex-skip uint16 :offset 44) - (death-start-vertex uint16 :offset 46) - (death-effect uint32 :offset 48) - (use-translucent uint8 :offset 52) - (display-this-fragment uint8 :offset 53) + ((xyz-scale float) + (st-magic uint32) + (st-out-a uint32) + (st-out-b uint32) + (st-vif-add uint32) + (st-int-off uint16) + (st-int-scale uint16) + (effect-count uint32) + (blend-target-count uint32) + (fragment-count uint16) + (tri-count uint16) + (matrix-count uint8) + (shader-count uint8) + (transform-vertex-count uint16) + (dvert-count uint16) + (one-mat-count uint16) + (two-mat-count uint16) + (two-mat-reuse-count uint16) + (three-mat-count uint16) + (three-mat-reuse-count uint16) + (shader-upload-count uint8) + (matrix-upload-count uint8) + (same-copy-count uint16) + (cross-copy-count uint16) + (num-verts uint16) + (longest-edge float) + (eye-ctrl merc-eye-ctrl) + (masks uint32 3) + (dummy-bytes uint8 48 :overlay-at fragment-count) + (envmap-tint uint32 :overlay-at fragment-count) + (query basic :overlay-at matrix-count) + (needs-clip uint8 :overlay-at dvert-count) + (use-isometric uint8 :overlay-at (-> dummy-bytes 9)) + (use-attached-shader uint8 :overlay-at one-mat-count) + (display-triangles uint8 :overlay-at (-> dummy-bytes 11)) + (death-vertex-skip uint16 :overlay-at two-mat-count) + (death-start-vertex uint16 :overlay-at two-mat-reuse-count) + (death-effect uint32 :overlay-at three-mat-count) + (use-translucent uint8 :overlay-at shader-upload-count) + (display-this-fragment uint8 :overlay-at matrix-upload-count) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type merc-ctrl-header -(defmethod inspect merc-ctrl-header ((this merc-ctrl-header)) +(defmethod inspect ((this merc-ctrl-header)) (format #t "[~8x] ~A~%" this 'merc-ctrl-header) (format #t "~Txyz-scale: #x~X~%" (-> this xyz-scale)) (format #t "~Tst-magic: #x~X~%" (-> this st-magic)) @@ -555,17 +502,15 @@ ;; definition of type merc-ctrl (deftype merc-ctrl (art-element) - ((num-joints int32 :offset 20) - (header merc-ctrl-header :inline :offset-assert 32) - (effect merc-effect :inline :dynamic :offset-assert 112) + ((num-joints int32 :overlay-at (-> pad 0)) + (header merc-ctrl-header :inline) + (effect merc-effect :inline :dynamic) ) - :method-count-assert 13 - :size-assert #x70 - :flag-assert #xd00000070 ) ;; definition for method 3 of type merc-ctrl -(defmethod inspect merc-ctrl ((this merc-ctrl)) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this merc-ctrl)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -578,19 +523,16 @@ ;; definition of type merc-vu1-low-mem (deftype merc-vu1-low-mem (structure) - ((tri-strip-gif gs-gif-tag :inline :offset-assert 0) - (ad-gif gs-gif-tag :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (perspective uint128 4 :offset-assert 48) - (fog vector :inline :offset-assert 112) + ((tri-strip-gif gs-gif-tag :inline) + (ad-gif gs-gif-tag :inline) + (hvdf-offset vector :inline) + (perspective uint128 4) + (fog vector :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type merc-vu1-low-mem -(defmethod inspect merc-vu1-low-mem ((this merc-vu1-low-mem)) +(defmethod inspect ((this merc-vu1-low-mem)) (format #t "[~8x] ~A~%" this 'merc-vu1-low-mem) (format #t "~Ttri-strip-gif: #~%" (-> this tri-strip-gif)) (format #t "~Tad-gif: #~%" (-> this ad-gif)) @@ -602,23 +544,20 @@ ;; definition of type ripple-wave (deftype ripple-wave (structure) - ((scale float :offset-assert 0) - (offs float :offset-assert 4) - (xdiv int16 :offset-assert 8) - (zdiv int16 :offset-assert 10) - (speed float :offset-assert 12) - (xmul float :offset-assert 16) - (zmul float :offset-assert 20) - (delta float :offset-assert 24) + ((scale float) + (offs float) + (xdiv int16) + (zdiv int16) + (speed float) + (xmul float) + (zmul float) + (delta float) ) :pack-me - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type ripple-wave -(defmethod inspect ripple-wave ((this ripple-wave)) +(defmethod inspect ((this ripple-wave)) (format #t "[~8x] ~A~%" this 'ripple-wave) (format #t "~Tscale: ~f~%" (-> this scale)) (format #t "~Toffs: ~f~%" (-> this offs)) @@ -633,19 +572,16 @@ ;; definition of type ripple-wave-set (deftype ripple-wave-set (basic) - ((count int32 :offset-assert 4) - (converted basic :offset-assert 8) - (frame-save uint32 :offset-assert 12) - (normal-scale float :offset-assert 16) - (wave ripple-wave 4 :inline :offset-assert 20) + ((count int32) + (converted basic) + (frame-save uint32) + (normal-scale float) + (wave ripple-wave 4 :inline) ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) ;; definition for method 3 of type ripple-wave-set -(defmethod inspect ripple-wave-set ((this ripple-wave-set)) +(defmethod inspect ((this ripple-wave-set)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tcount: ~D~%" (-> this count)) (format #t "~Tconverted: ~A~%" (-> this converted)) @@ -657,26 +593,23 @@ ;; definition of type ripple-control (deftype ripple-control (basic) - ((global-scale float :offset-assert 4) - (last-frame-scale float :offset-assert 8) - (close-fade-dist float :offset-assert 12) - (far-fade-dist float :offset-assert 16) - (faded-scale float :offset-assert 20) - (individual-normal-scale float :offset-assert 24) - (waveform ripple-wave-set :offset-assert 28) - (send-query symbol :offset-assert 32) - (query ripple-merc-query :offset-assert 36) + ((global-scale float) + (last-frame-scale float) + (close-fade-dist float) + (far-fade-dist float) + (faded-scale float) + (individual-normal-scale float) + (waveform ripple-wave-set) + (send-query symbol) + (query ripple-merc-query) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type ripple-control -(defmethod inspect ripple-control ((this ripple-control)) +(defmethod inspect ((this ripple-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tglobal-scale: ~f~%" (-> this global-scale)) (format #t "~Tlast-frame-scale: ~f~%" (-> this last-frame-scale)) diff --git a/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc b/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc index 0511eef0603..30813209842 100644 --- a/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc @@ -6,13 +6,13 @@ ;; definition for method 5 of type merc-fragment ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of merc-fragment ((this merc-fragment)) +(defmethod asize-of ((this merc-fragment)) (the-as int (* (-> this header mm-quadword-size) 16)) ) ;; definition for method 9 of type merc-fragment ;; INFO: Return type mismatch merc-fragment vs none. -(defmethod login-adgifs merc-fragment ((this merc-fragment)) +(defmethod login-adgifs ((this merc-fragment)) (let* ((fp-data (merc-fragment-fp-data this)) (eye-ctrl (if (nonzero? (-> *merc-ctrl-header* eye-ctrl)) (-> *merc-ctrl-header* eye-ctrl) @@ -71,12 +71,13 @@ ;; definition for method 5 of type merc-fragment-control ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of merc-fragment-control ((this merc-fragment-control)) +(defmethod asize-of ((this merc-fragment-control)) (the-as int (+ (* (-> this mat-xfer-count) 2) 4)) ) ;; definition for method 3 of type merc-fragment-control -(defmethod inspect merc-fragment-control ((this merc-fragment-control)) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this merc-fragment-control)) (format #t "[~8x] ~A~%" this 'merc-fragment-control) (format #t "~Tunsigned-four-count: ~D~%" (-> this unsigned-four-count)) (format #t "~Tlump-four-count: ~D~%" (-> this lump-four-count)) @@ -92,7 +93,7 @@ ;; definition for method 9 of type merc-effect ;; INFO: Return type mismatch merc-effect vs none. -(defmethod login-adgifs merc-effect ((this merc-effect)) +(defmethod login-adgifs ((this merc-effect)) (let ((data (-> this extra-info))) (when (nonzero? data) (when (nonzero? (-> data shader-offset)) @@ -123,7 +124,8 @@ ) ;; definition for method 3 of type merc-ctrl -(defmethod inspect merc-ctrl ((this merc-ctrl)) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this merc-ctrl)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -137,7 +139,7 @@ ) ;; definition for method 8 of type merc-ctrl -(defmethod mem-usage merc-ctrl ((this merc-ctrl) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this merc-ctrl) (arg0 memory-usage-block) (arg1 int)) (if (-> this extra) (mem-usage (-> this extra) arg0 arg1) ) @@ -203,7 +205,7 @@ ) ;; definition for method 9 of type merc-ctrl -(defmethod login merc-ctrl ((this merc-ctrl)) +(defmethod login ((this merc-ctrl)) (set! *merc-ctrl-header* (-> this header)) (dotimes (v1-1 3) (set! (-> *merc-ctrl-header* masks v1-1) (the-as uint 0)) diff --git a/test/decompiler/reference/jak1/engine/gfx/mood/mood-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/mood/mood-h_REF.gc index fc784025218..7efaefbecb8 100644 --- a/test/decompiler/reference/jak1/engine/gfx/mood/mood-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/mood/mood-h_REF.gc @@ -3,21 +3,18 @@ ;; definition of type mood-fog (deftype mood-fog (structure) - ((fog-color vector :inline :offset-assert 0) - (fog-dists vector :inline :offset-assert 16) - (fog-start meters :offset 16) - (fog-end meters :offset 20) - (fog-max float :offset 24) - (fog-min float :offset 28) - (erase-color vector :inline :offset-assert 32) + ((fog-color vector :inline) + (fog-dists vector :inline) + (fog-start meters :overlay-at (-> fog-dists x)) + (fog-end meters :overlay-at (-> fog-dists y)) + (fog-max float :overlay-at (-> fog-dists z)) + (fog-min float :overlay-at (-> fog-dists w)) + (erase-color vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type mood-fog -(defmethod inspect mood-fog ((this mood-fog)) +(defmethod inspect ((this mood-fog)) (format #t "[~8x] ~A~%" this 'mood-fog) (format #t "~Tfog-color: #~%" (-> this fog-color)) (format #t "~Tfog-dists: #~%" (-> this fog-dists)) @@ -31,15 +28,12 @@ ;; definition of type mood-fog-table (deftype mood-fog-table (structure) - ((data mood-fog 8 :inline :offset-assert 0) + ((data mood-fog 8 :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;; definition for method 3 of type mood-fog-table -(defmethod inspect mood-fog-table ((this mood-fog-table)) +(defmethod inspect ((this mood-fog-table)) (format #t "[~8x] ~A~%" this 'mood-fog-table) (format #t "~Tdata[8] @ #x~X~%" (-> this data)) this @@ -47,19 +41,16 @@ ;; definition of type mood-lights (deftype mood-lights (structure) - ((direction vector :inline :offset-assert 0) - (lgt-color vector :inline :offset-assert 16) - (prt-color vector :inline :offset-assert 32) - (amb-color vector :inline :offset-assert 48) - (shadow vector :inline :offset-assert 64) + ((direction vector :inline) + (lgt-color vector :inline) + (prt-color vector :inline) + (amb-color vector :inline) + (shadow vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type mood-lights -(defmethod inspect mood-lights ((this mood-lights)) +(defmethod inspect ((this mood-lights)) (format #t "[~8x] ~A~%" this 'mood-lights) (format #t "~Tdirection: #~%" (-> this direction)) (format #t "~Tlgt-color: #~%" (-> this lgt-color)) @@ -71,15 +62,12 @@ ;; definition of type mood-lights-table (deftype mood-lights-table (structure) - ((data mood-lights 8 :inline :offset-assert 0) + ((data mood-lights 8 :inline) ) - :method-count-assert 9 - :size-assert #x280 - :flag-assert #x900000280 ) ;; definition for method 3 of type mood-lights-table -(defmethod inspect mood-lights-table ((this mood-lights-table)) +(defmethod inspect ((this mood-lights-table)) (format #t "[~8x] ~A~%" this 'mood-lights-table) (format #t "~Tdata[8] @ #x~X~%" (-> this data)) this @@ -87,16 +75,13 @@ ;; definition of type mood-sun (deftype mood-sun (structure) - ((sun-color vector :inline :offset-assert 0) - (env-color vector :inline :offset-assert 16) + ((sun-color vector :inline) + (env-color vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type mood-sun -(defmethod inspect mood-sun ((this mood-sun)) +(defmethod inspect ((this mood-sun)) (format #t "[~8x] ~A~%" this 'mood-sun) (format #t "~Tsun-color: #~%" (-> this sun-color)) (format #t "~Tenv-color: #~%" (-> this env-color)) @@ -105,15 +90,12 @@ ;; definition of type mood-sun-table (deftype mood-sun-table (structure) - ((data mood-sun 8 :inline :offset-assert 0) + ((data mood-sun 8 :inline) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; definition for method 3 of type mood-sun-table -(defmethod inspect mood-sun-table ((this mood-sun-table)) +(defmethod inspect ((this mood-sun-table)) (format #t "[~8x] ~A~%" this 'mood-sun-table) (format #t "~Tdata[8] @ #x~X~%" (-> this data)) this @@ -121,35 +103,32 @@ ;; definition of type mood-context (deftype mood-context (basic) - ((mood-fog-table mood-fog-table :offset-assert 4) - (mood-lights-table mood-lights-table :offset-assert 8) - (mood-sun-table mood-sun-table :offset-assert 12) - (fog-interp sky-color-day :offset-assert 16) - (palette-interp sky-color-day :offset-assert 20) - (sky-texture-interp sky-color-day :offset-assert 24) - (current-fog mood-fog :inline :offset-assert 32) - (current-sun mood-sun :inline :offset-assert 80) - (current-prt-color vector :inline :offset-assert 112) - (current-shadow vector :inline :offset-assert 128) - (current-shadow-color vector :inline :offset-assert 144) - (light-group light-group 8 :inline :offset-assert 160) - (times vector 8 :inline :offset-assert 1696) - (sky-times float 8 :offset-assert 1824) - (itimes vector4w 4 :inline :offset-assert 1856) - (state uint8 16 :offset-assert 1920) - (num-stars float :offset-assert 1936) - (some-byte uint8 :offset 1939) + ((mood-fog-table mood-fog-table) + (mood-lights-table mood-lights-table) + (mood-sun-table mood-sun-table) + (fog-interp sky-color-day) + (palette-interp sky-color-day) + (sky-texture-interp sky-color-day) + (current-fog mood-fog :inline) + (current-sun mood-sun :inline) + (current-prt-color vector :inline) + (current-shadow vector :inline) + (current-shadow-color vector :inline) + (light-group light-group 8 :inline) + (times vector 8 :inline) + (sky-times float 8) + (itimes vector4w 4 :inline) + (state uint8 16) + (num-stars float) + (some-byte uint8 :offset 1939) ) - :method-count-assert 9 - :size-assert #x794 - :flag-assert #x900000794 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type mood-context -(defmethod inspect mood-context ((this mood-context)) +(defmethod inspect ((this mood-context)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tmood-fog-table: #~%" (-> this mood-fog-table)) (format #t "~Tmood-lights-table: #~%" (-> this mood-lights-table)) diff --git a/test/decompiler/reference/jak1/engine/gfx/mood/mood_REF.gc b/test/decompiler/reference/jak1/engine/gfx/mood/mood_REF.gc index aea73b143f5..270346a4d69 100644 --- a/test/decompiler/reference/jak1/engine/gfx/mood/mood_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/mood/mood_REF.gc @@ -451,18 +451,15 @@ ;; definition of type flames-state (deftype flames-state (structure) - ((index uint8 :offset-assert 0) - (time uint8 :offset-assert 1) - (length uint8 :offset-assert 2) - (height uint8 :offset-assert 3) + ((index uint8) + (time uint8) + (length uint8) + (height uint8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type flames-state -(defmethod inspect flames-state ((this flames-state)) +(defmethod inspect ((this flames-state)) (format #t "[~8x] ~A~%" this 'flames-state) (format #t "~Tindex: ~D~%" (-> this index)) (format #t "~Ttime: ~D~%" (-> this time)) @@ -601,16 +598,13 @@ ;; definition of type lightning-state (deftype lightning-state (structure) - ((val uint8 :offset-assert 0) + ((val uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x1 - :flag-assert #x900000001 ) ;; definition for method 3 of type lightning-state -(defmethod inspect lightning-state ((this lightning-state)) +(defmethod inspect ((this lightning-state)) (format #t "[~8x] ~A~%" this 'lightning-state) (format #t "~Tval: ~D~%" (-> this val)) this @@ -794,16 +788,13 @@ ;; definition of type light-time-state (deftype light-time-state (structure) - ((time uint8 :offset-assert 0) + ((time uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x1 - :flag-assert #x900000001 ) ;; definition for method 3 of type light-time-state -(defmethod inspect light-time-state ((this light-time-state)) +(defmethod inspect ((this light-time-state)) (format #t "[~8x] ~A~%" this 'light-time-state) (format #t "~Ttime: ~D~%" (-> this time)) this @@ -811,16 +802,13 @@ ;; definition of type light-state (deftype light-state (structure) - ((fade uint8 :offset-assert 0) + ((fade uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x1 - :flag-assert #x900000001 ) ;; definition for method 3 of type light-state -(defmethod inspect light-state ((this light-state)) +(defmethod inspect ((this light-state)) (format #t "[~8x] ~A~%" this 'light-state) (format #t "~Tfade: ~D~%" (-> this fade)) this @@ -877,18 +865,15 @@ ;; definition of type lava-state (deftype lava-state (structure) - ((scale float 4 :offset-assert 0) - (time uint8 :offset-assert 16) - (last-index uint8 :offset-assert 17) + ((scale float 4) + (time uint8) + (last-index uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x12 - :flag-assert #x900000012 ) ;; definition for method 3 of type lava-state -(defmethod inspect lava-state ((this lava-state)) +(defmethod inspect ((this lava-state)) (format #t "[~8x] ~A~%" this 'lava-state) (format #t "~Tscale[4] @ #x~X~%" (-> this scale)) (format #t "~Ttime: ~D~%" (-> this time)) @@ -967,19 +952,16 @@ ;; definition of type misty-states (deftype misty-states (structure) - ((flames flames-state :inline :offset-assert 0) - (light0 light-state :inline :offset-assert 4) - (light1 light-state :inline :offset-assert 5) - (time0 light-time-state :inline :offset-assert 6) - (time1 light-time-state :inline :offset-assert 7) + ((flames flames-state :inline) + (light0 light-state :inline) + (light1 light-state :inline) + (time0 light-time-state :inline) + (time1 light-time-state :inline) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type misty-states -(defmethod inspect misty-states ((this misty-states)) +(defmethod inspect ((this misty-states)) (format #t "[~8x] ~A~%" this 'misty-states) (format #t "~Tflames: #~%" (-> this flames)) (format #t "~Tlight0: #~%" (-> this light0)) @@ -1040,16 +1022,13 @@ ;; definition of type swamp-village2-states (deftype swamp-village2-states (structure) - ((flames flames-state :inline :offset-assert 0) - (lightning lightning-state :inline :offset-assert 4) + ((flames flames-state :inline) + (lightning lightning-state :inline) ) - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type swamp-village2-states -(defmethod inspect swamp-village2-states ((this swamp-village2-states)) +(defmethod inspect ((this swamp-village2-states)) (format #t "[~8x] ~A~%" this 'swamp-village2-states) (format #t "~Tflames: #~%" (-> this flames)) (format #t "~Tlightning: #~%" (-> this lightning)) @@ -1199,15 +1178,12 @@ ;; definition of type village1-states (deftype village1-states (structure) - ((flames flames-state :inline :offset-assert 0) + ((flames flames-state :inline) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type village1-states -(defmethod inspect village1-states ((this village1-states)) +(defmethod inspect ((this village1-states)) (format #t "[~8x] ~A~%" this 'village1-states) (format #t "~Tflames: #~%" (-> this flames)) this @@ -1345,17 +1321,14 @@ ;; definition of type jungle-states (deftype jungle-states (structure) - ((light light-state :inline :offset-assert 0) - (time light-time-state :inline :offset-assert 1) - (one-shot uint8 :offset-assert 2) + ((light light-state :inline) + (time light-time-state :inline) + (one-shot uint8) ) - :method-count-assert 9 - :size-assert #x3 - :flag-assert #x900000003 ) ;; definition for method 3 of type jungle-states -(defmethod inspect jungle-states ((this jungle-states)) +(defmethod inspect ((this jungle-states)) (format #t "[~8x] ~A~%" this 'jungle-states) (format #t "~Tlight: #~%" (-> this light)) (format #t "~Ttime: #~%" (-> this time)) @@ -1593,16 +1566,13 @@ ;; definition of type sunken-states (deftype sunken-states (structure) - ((light light-state :inline :offset-assert 0) - (time light-time-state :inline :offset-assert 1) + ((light light-state :inline) + (time light-time-state :inline) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition for method 3 of type sunken-states -(defmethod inspect sunken-states ((this sunken-states)) +(defmethod inspect ((this sunken-states)) (format #t "[~8x] ~A~%" this 'sunken-states) (format #t "~Tlight: #~%" (-> this light)) (format #t "~Ttime: #~%" (-> this time)) @@ -1703,20 +1673,17 @@ ;; definition of type rolling-states (deftype rolling-states (structure) - ((light0 light-state :inline :offset-assert 0) - (light1 light-state :inline :offset-assert 1) - (light2 light-state :inline :offset-assert 2) - (light3 light-state :inline :offset-assert 3) - (time light-time-state :inline :offset-assert 4) - (lightning lightning-state :inline :offset-assert 5) + ((light0 light-state :inline) + (light1 light-state :inline) + (light2 light-state :inline) + (light3 light-state :inline) + (time light-time-state :inline) + (lightning lightning-state :inline) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) ;; definition for method 3 of type rolling-states -(defmethod inspect rolling-states ((this rolling-states)) +(defmethod inspect ((this rolling-states)) (format #t "[~8x] ~A~%" this 'rolling-states) (format #t "~Tlight0: #~%" (-> this light0)) (format #t "~Tlight1: #~%" (-> this light1)) @@ -1891,15 +1858,12 @@ ;; definition of type firecanyon-states (deftype firecanyon-states (structure) - ((lava lava-state :inline :offset-assert 0) + ((lava lava-state :inline) ) - :method-count-assert 9 - :size-assert #x12 - :flag-assert #x900000012 ) ;; definition for method 3 of type firecanyon-states -(defmethod inspect firecanyon-states ((this firecanyon-states)) +(defmethod inspect ((this firecanyon-states)) (format #t "[~8x] ~A~%" this 'firecanyon-states) (format #t "~Tlava: #~%" (-> this lava)) this @@ -1922,16 +1886,13 @@ ;; definition of type training-states (deftype training-states (structure) - ((light light-state :inline :offset-assert 0) - (time light-time-state :inline :offset-assert 1) + ((light light-state :inline) + (time light-time-state :inline) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition for method 3 of type training-states -(defmethod inspect training-states ((this training-states)) +(defmethod inspect ((this training-states)) (format #t "[~8x] ~A~%" this 'training-states) (format #t "~Tlight: #~%" (-> this light)) (format #t "~Ttime: #~%" (-> this time)) @@ -1958,15 +1919,12 @@ ;; definition of type maincave-states (deftype maincave-states (structure) - ((flames flames-state :inline :offset-assert 0) + ((flames flames-state :inline) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type maincave-states -(defmethod inspect maincave-states ((this maincave-states)) +(defmethod inspect ((this maincave-states)) (format #t "[~8x] ~A~%" this 'maincave-states) (format #t "~Tflames: #~%" (-> this flames)) this @@ -2078,15 +2036,12 @@ ;; definition of type robocave-states (deftype robocave-states (structure) - ((flames flames-state :inline :offset-assert 0) + ((flames flames-state :inline) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type robocave-states -(defmethod inspect robocave-states ((this robocave-states)) +(defmethod inspect ((this robocave-states)) (format #t "[~8x] ~A~%" this 'robocave-states) (format #t "~Tflames: #~%" (-> this flames)) this @@ -2108,19 +2063,16 @@ ;; definition of type snow-states (deftype snow-states (structure) - ((flames flames-state :inline :offset-assert 0) - (light light-state :inline :offset-assert 4) - (time light-time-state :inline :offset-assert 5) - (one-shot uint8 :offset-assert 6) - (interp float :offset-assert 8) + ((flames flames-state :inline) + (light light-state :inline) + (time light-time-state :inline) + (one-shot uint8) + (interp float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type snow-states -(defmethod inspect snow-states ((this snow-states)) +(defmethod inspect ((this snow-states)) (format #t "[~8x] ~A~%" this 'snow-states) (format #t "~Tflames: #~%" (-> this flames)) (format #t "~Tlight: #~%" (-> this light)) @@ -2195,19 +2147,16 @@ ;; definition of type village3-states (deftype village3-states (structure) - ((flames flames-state :inline :offset-assert 0) - (scale float :offset-assert 4) - (lava lava-state :inline :offset-assert 8) - (lava-time float :offset-assert 28) - (time uint8 :offset-assert 32) + ((flames flames-state :inline) + (scale float) + (lava lava-state :inline) + (lava-time float) + (time uint8) ) - :method-count-assert 9 - :size-assert #x21 - :flag-assert #x900000021 ) ;; definition for method 3 of type village3-states -(defmethod inspect village3-states ((this village3-states)) +(defmethod inspect ((this village3-states)) (format #t "[~8x] ~A~%" this 'village3-states) (format #t "~Tflames: #~%" (-> this flames)) (format #t "~Tscale: ~f~%" (-> this scale)) @@ -2420,17 +2369,14 @@ ;; definition of type lavatube-states (deftype lavatube-states (structure) - ((lava lava-state :inline :offset-assert 0) - (light light-state :inline :offset-assert 18) - (time light-time-state :inline :offset-assert 19) + ((lava lava-state :inline) + (light light-state :inline) + (time light-time-state :inline) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type lavatube-states -(defmethod inspect lavatube-states ((this lavatube-states)) +(defmethod inspect ((this lavatube-states)) (format #t "[~8x] ~A~%" this 'lavatube-states) (format #t "~Tlava: #~%" (-> this lava)) (format #t "~Tlight: #~%" (-> this light)) @@ -2462,18 +2408,15 @@ ;; definition of type ogre-states (deftype ogre-states (structure) - ((lava lava-state :inline :offset-assert 0) - (lightning lightning-state :inline :offset-assert 18) - (lava-time float :offset-assert 20) - (lava-fade float :offset-assert 24) + ((lava lava-state :inline) + (lightning lightning-state :inline) + (lava-time float) + (lava-fade float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type ogre-states -(defmethod inspect ogre-states ((this ogre-states)) +(defmethod inspect ((this ogre-states)) (format #t "[~8x] ~A~%" this 'ogre-states) (format #t "~Tlava: #~%" (-> this lava)) (format #t "~Tlightning: #~%" (-> this lightning)) @@ -2668,16 +2611,13 @@ ;; definition of type finalboss-states (deftype finalboss-states (structure) - ((start-time time-frame :offset-assert 0) - (secret-time time-frame :offset-assert 8) + ((start-time time-frame) + (secret-time time-frame) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type finalboss-states -(defmethod inspect finalboss-states ((this finalboss-states)) +(defmethod inspect ((this finalboss-states)) (format #t "[~8x] ~A~%" this 'finalboss-states) (format #t "~Tstart-time: ~D~%" (-> this start-time)) (format #t "~Tsecret-time: ~D~%" (-> this secret-time)) @@ -2856,20 +2796,17 @@ ;; definition of type citadel-states (deftype citadel-states (structure) - ((flames flames-state :inline :offset-assert 0) - (light light-state :inline :offset-assert 4) - (time light-time-state :inline :offset-assert 5) - (flicker-off uint8 :offset-assert 6) - (flicker-on uint8 :offset-assert 7) - (shield-fade float :offset-assert 8) + ((flames flames-state :inline) + (light light-state :inline) + (time light-time-state :inline) + (flicker-off uint8) + (flicker-on uint8) + (shield-fade float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type citadel-states -(defmethod inspect citadel-states ((this citadel-states)) +(defmethod inspect ((this citadel-states)) (format #t "[~8x] ~A~%" this 'citadel-states) (format #t "~Tflames: #~%" (-> this flames)) (format #t "~Tlight: #~%" (-> this light)) diff --git a/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day-h_REF.gc index 9da9dda010b..decf911e5df 100644 --- a/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type palette-fade-control (deftype palette-fade-control (structure) - ((trans vector :inline :offset-assert 0) - (fade float :offset-assert 16) - (actor-dist float :offset-assert 20) + ((trans vector :inline) + (fade float) + (actor-dist float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type palette-fade-control -(defmethod inspect palette-fade-control ((this palette-fade-control)) +(defmethod inspect ((this palette-fade-control)) (format #t "[~8x] ~A~%" this 'palette-fade-control) (format #t "~Ttrans: #~%" (-> this trans)) (format #t "~Tfade: ~f~%" (-> this fade)) @@ -23,19 +20,16 @@ ;; definition of type palette-fade-controls (deftype palette-fade-controls (basic) - ((control palette-fade-control 8 :inline :offset-assert 16) + ((control palette-fade-control 8 :inline) ) - :method-count-assert 11 - :size-assert #x110 - :flag-assert #xb00000110 (:methods - (reset! (_type_) symbol 9) - (set-fade! (_type_ int float float vector) object 10) + (reset! (_type_) symbol) + (set-fade! (_type_ int float float vector) object) ) ) ;; definition for method 3 of type palette-fade-controls -(defmethod inspect palette-fade-controls ((this palette-fade-controls)) +(defmethod inspect ((this palette-fade-controls)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tcontrol[8] @ #x~X~%" (-> this control)) this @@ -46,36 +40,32 @@ ;; definition of type time-of-day-proc (deftype time-of-day-proc (process) - ((year int32 :offset-assert 112) - (month int32 :offset-assert 116) - (week int32 :offset-assert 120) - (day int32 :offset-assert 124) - (hour int32 :offset-assert 128) - (minute int32 :offset-assert 132) - (second int32 :offset-assert 136) - (frame int32 :offset-assert 140) - (time-of-day float :offset-assert 144) - (time-ratio float :offset-assert 148) - (star-count int32 :offset-assert 152) - (stars sparticle-launch-control :offset-assert 156) - (sun-count int32 :offset-assert 160) - (sun sparticle-launch-control :offset-assert 164) - (green-sun-count int32 :offset-assert 168) - (green-sun sparticle-launch-control :offset-assert 172) - (moon-count int32 :offset-assert 176) - (moon sparticle-launch-control :offset-assert 180) + ((year int32) + (month int32) + (week int32) + (day int32) + (hour int32) + (minute int32) + (second int32) + (frame int32) + (time-of-day float) + (time-ratio float) + (star-count int32) + (stars sparticle-launch-control) + (sun-count int32) + (sun sparticle-launch-control) + (green-sun-count int32) + (green-sun sparticle-launch-control) + (moon-count int32) + (moon sparticle-launch-control) ) - :heap-base #x50 - :method-count-assert 14 - :size-assert #xb8 - :flag-assert #xe005000b8 (:states time-of-day-tick ) ) ;; definition for method 3 of type time-of-day-proc -(defmethod inspect time-of-day-proc ((this time-of-day-proc)) +(defmethod inspect ((this time-of-day-proc)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -102,18 +92,15 @@ ;; definition of type time-of-day-palette (deftype time-of-day-palette (basic) - ((width int32 :offset-assert 4) - (height int32 :offset-assert 8) - (pad int32 :offset-assert 12) - (data int32 1 :offset-assert 16) + ((width int32) + (height int32) + (pad int32) + (data int32 1) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type time-of-day-palette -(defmethod inspect time-of-day-palette ((this time-of-day-palette)) +(defmethod inspect ((this time-of-day-palette)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Twidth: ~D~%" (-> this width)) (format #t "~Theight: ~D~%" (-> this height)) @@ -124,35 +111,32 @@ ;; definition of type time-of-day-context (deftype time-of-day-context (basic) - ((active-count uint32 :offset-assert 4) - (interp float :offset-assert 8) - (current-interp float :offset-assert 12) - (moods mood-context 2 :offset-assert 16) - (current-fog mood-fog :inline :offset-assert 32) - (current-sun mood-sun :inline :offset-assert 80) - (current-prt-color vector :inline :offset-assert 112) - (current-shadow vector :inline :offset-assert 128) - (current-shadow-color vector :inline :offset-assert 144) - (light-group light-group 9 :inline :offset-assert 160) - (title-light-group light-group :inline :offset-assert 1888) - (time float :offset-assert 2080) - (target-interp float :offset-assert 2084) - (erase-color rgba :offset-assert 2088) - (num-stars float :offset-assert 2092) - (light-masks-0 uint8 2 :offset-assert 2096) - (light-masks-1 uint8 2 :offset-assert 2098) - (light-interp float 2 :offset-assert 2100) - (sky symbol :offset-assert 2108) - (sun-fade float :offset-assert 2112) - (title-updated symbol :offset-assert 2116) + ((active-count uint32) + (interp float) + (current-interp float) + (moods mood-context 2) + (current-fog mood-fog :inline) + (current-sun mood-sun :inline) + (current-prt-color vector :inline) + (current-shadow vector :inline) + (current-shadow-color vector :inline) + (light-group light-group 9 :inline) + (title-light-group light-group :inline) + (time float) + (target-interp float) + (erase-color rgba) + (num-stars float) + (light-masks-0 uint8 2) + (light-masks-1 uint8 2) + (light-interp float 2) + (sky symbol) + (sun-fade float) + (title-updated symbol) ) - :method-count-assert 9 - :size-assert #x848 - :flag-assert #x900000848 ) ;; definition for method 3 of type time-of-day-context -(defmethod inspect time-of-day-context ((this time-of-day-context)) +(defmethod inspect ((this time-of-day-context)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tactive-count: ~D~%" (-> this active-count)) (format #t "~Tinterp: ~f~%" (-> this interp)) @@ -180,18 +164,15 @@ ;; definition of type time-of-day-dma (deftype time-of-day-dma (structure) - ((outa uint32 256 :offset-assert 0) - (outb uint32 256 :offset-assert 1024) - (banka uint32 256 :offset-assert 2048) - (bankb uint32 256 :offset-assert 3072) + ((outa uint32 256) + (outb uint32 256) + (banka uint32 256) + (bankb uint32 256) ) - :method-count-assert 9 - :size-assert #x1000 - :flag-assert #x900001000 ) ;; definition for method 3 of type time-of-day-dma -(defmethod inspect time-of-day-dma ((this time-of-day-dma)) +(defmethod inspect ((this time-of-day-dma)) (format #t "[~8x] ~A~%" this 'time-of-day-dma) (format #t "~Touta[256] @ #x~X~%" (-> this outa)) (format #t "~Toutb[256] @ #x~X~%" (-> this outb)) diff --git a/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc b/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc index dc3fe61b959..2276c1528f8 100644 --- a/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 5 of type time-of-day-palette ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of time-of-day-palette ((this time-of-day-palette)) +(defmethod asize-of ((this time-of-day-palette)) (the-as int (+ (-> this type size) (* (* (-> this height) (-> this width)) 4))) ) @@ -562,7 +562,7 @@ ;; definition for method 10 of type palette-fade-controls ;; INFO: Used lq/sq -(defmethod set-fade! palette-fade-controls ((this palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) +(defmethod set-fade! ((this palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) (cond ((and (>= arg0 0) (< arg0 8)) (let ((v1-3 (-> this control arg0))) @@ -582,7 +582,7 @@ ) ;; definition for method 9 of type palette-fade-controls -(defmethod reset! palette-fade-controls ((this palette-fade-controls)) +(defmethod reset! ((this palette-fade-controls)) (countdown (v1-0 8) (let ((a1-2 (-> this control v1-0))) (set! (-> a1-2 fade) 0.0) diff --git a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-h_REF.gc index ae397fe94b5..a5f32b65cd6 100644 --- a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type ocean-corner (deftype ocean-corner (structure) - ((bsphere sphere :inline :offset-assert 0) - (start-corner vector :inline :offset-assert 16) - (y-scales vector :inline :offset-assert 32) - (alphas vector :inline :offset-assert 48) - (colors uint32 4 :offset-assert 64) + ((bsphere sphere :inline) + (start-corner vector :inline) + (y-scales vector :inline) + (alphas vector :inline) + (colors uint32 4) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type ocean-corner -(defmethod inspect ocean-corner ((this ocean-corner)) +(defmethod inspect ((this ocean-corner)) (format #t "[~8x] ~A~%" this 'ocean-corner) (format #t "~Tbsphere: #~%" (-> this bsphere)) (format #t "~Tstart-corner: #~%" (-> this start-corner)) @@ -27,22 +24,19 @@ ;; definition of type ocean-wave-info (deftype ocean-wave-info (structure) - ((frequency float :offset-assert 0) - (amplitude float :offset-assert 4) - (wave-speed float :offset-assert 8) - (angle float :offset-assert 12) - (kx float :offset-assert 16) - (ky float :offset-assert 20) - (w float :offset-assert 24) - (flags int32 :offset-assert 28) + ((frequency float) + (amplitude float) + (wave-speed float) + (angle float) + (kx float) + (ky float) + (w float) + (flags int32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type ocean-wave-info -(defmethod inspect ocean-wave-info ((this ocean-wave-info)) +(defmethod inspect ((this ocean-wave-info)) (format #t "[~8x] ~A~%" this 'ocean-wave-info) (format #t "~Tfrequency: ~f~%" (-> this frequency)) (format #t "~Tamplitude: ~f~%" (-> this amplitude)) @@ -57,17 +51,14 @@ ;; definition of type ocean-vertex (deftype ocean-vertex (structure) - ((pos vector :inline :offset-assert 0) - (stq vector :inline :offset-assert 16) - (col vector :inline :offset-assert 32) + ((pos vector :inline) + (stq vector :inline) + (col vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type ocean-vertex -(defmethod inspect ocean-vertex ((this ocean-vertex)) +(defmethod inspect ((this ocean-vertex)) (format #t "[~8x] ~A~%" this 'ocean-vertex) (format #t "~Tpos: #~%" (-> this pos)) (format #t "~Tstq: #~%" (-> this stq)) @@ -77,15 +68,12 @@ ;; definition of type ocean-spheres (deftype ocean-spheres (structure) - ((spheres sphere 36 :inline :offset-assert 0) + ((spheres sphere 36 :inline) ) - :method-count-assert 9 - :size-assert #x240 - :flag-assert #x900000240 ) ;; definition for method 3 of type ocean-spheres -(defmethod inspect ocean-spheres ((this ocean-spheres)) +(defmethod inspect ((this ocean-spheres)) (format #t "[~8x] ~A~%" this 'ocean-spheres) (format #t "~Tspheres[36] @ #x~X~%" (-> this spheres)) this @@ -93,15 +81,12 @@ ;; definition of type ocean-colors (deftype ocean-colors (structure) - ((colors rgba 2548 :offset-assert 0) + ((colors rgba 2548) ) - :method-count-assert 9 - :size-assert #x27d0 - :flag-assert #x9000027d0 ) ;; definition for method 3 of type ocean-colors -(defmethod inspect ocean-colors ((this ocean-colors)) +(defmethod inspect ((this ocean-colors)) (format #t "[~8x] ~A~%" this 'ocean-colors) (format #t "~Tcolors[2548] @ #x~X~%" (-> this colors)) this @@ -109,17 +94,14 @@ ;; definition of type ocean-mid-mask (deftype ocean-mid-mask (structure) - ((mask uint8 8 :offset-assert 0) - (dword uint64 :offset 0) + ((mask uint8 8) + (dword uint64 :overlay-at (-> mask 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type ocean-mid-mask -(defmethod inspect ocean-mid-mask ((this ocean-mid-mask)) +(defmethod inspect ((this ocean-mid-mask)) (format #t "[~8x] ~A~%" this 'ocean-mid-mask) (format #t "~Tmask[8] @ #x~X~%" (-> this mask)) (format #t "~Tdword: #x~X~%" (-> this dword)) @@ -128,15 +110,12 @@ ;; definition of type ocean-mid-indices (deftype ocean-mid-indices (basic) - ((data uint16 36 :offset-assert 4) + ((data uint16 36) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) ;; definition for method 3 of type ocean-mid-indices -(defmethod inspect ocean-mid-indices ((this ocean-mid-indices)) +(defmethod inspect ((this ocean-mid-indices)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tdata[36] @ #x~X~%" (-> this data)) this @@ -144,16 +123,13 @@ ;; definition of type ocean-mid-masks (deftype ocean-mid-masks (basic) - ((data (inline-array ocean-mid-mask) :offset-assert 4) + ((data (inline-array ocean-mid-mask)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type ocean-mid-masks -(defmethod inspect ocean-mid-masks ((this ocean-mid-masks)) +(defmethod inspect ((this ocean-mid-masks)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tdata: #x~X~%" (-> this data)) this @@ -161,17 +137,14 @@ ;; definition of type ocean-trans-mask (deftype ocean-trans-mask (structure) - ((mask uint8 4 :offset-assert 0) - (word uint64 :offset 0) + ((mask uint8 4) + (word uint64 :overlay-at (-> mask 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type ocean-trans-mask -(defmethod inspect ocean-trans-mask ((this ocean-trans-mask)) +(defmethod inspect ((this ocean-trans-mask)) (format #t "[~8x] ~A~%" this 'ocean-trans-mask) (format #t "~Tmask[4] @ #x~X~%" (-> this mask)) (format #t "~Tword: #x~X~%" (-> this word)) @@ -180,17 +153,14 @@ ;; definition of type ocean-trans-index (deftype ocean-trans-index (structure) - ((parent int16 :offset-assert 0) - (child int16 :offset-assert 2) + ((parent int16) + (child int16) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type ocean-trans-index -(defmethod inspect ocean-trans-index ((this ocean-trans-index)) +(defmethod inspect ((this ocean-trans-index)) (format #t "[~8x] ~A~%" this 'ocean-trans-index) (format #t "~Tparent: ~D~%" (-> this parent)) (format #t "~Tchild: ~D~%" (-> this child)) @@ -199,15 +169,12 @@ ;; definition of type ocean-trans-indices (deftype ocean-trans-indices (basic) - ((data ocean-trans-index 2304 :inline :offset-assert 4) + ((data ocean-trans-index 2304 :inline) ) - :method-count-assert 9 - :size-assert #x2404 - :flag-assert #x900002404 ) ;; definition for method 3 of type ocean-trans-indices -(defmethod inspect ocean-trans-indices ((this ocean-trans-indices)) +(defmethod inspect ((this ocean-trans-indices)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tdata[2304] @ #x~X~%" (-> this data)) this @@ -215,15 +182,12 @@ ;; definition of type ocean-near-index (deftype ocean-near-index (structure) - ((data uint16 16 :offset-assert 0) + ((data uint16 16) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type ocean-near-index -(defmethod inspect ocean-near-index ((this ocean-near-index)) +(defmethod inspect ((this ocean-near-index)) (format #t "[~8x] ~A~%" this 'ocean-near-index) (format #t "~Tdata[16] @ #x~X~%" (-> this data)) this @@ -231,15 +195,12 @@ ;; definition of type ocean-near-indices (deftype ocean-near-indices (basic) - ((data (inline-array ocean-near-index) :offset-assert 4) + ((data (inline-array ocean-near-index)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type ocean-near-indices -(defmethod inspect ocean-near-indices ((this ocean-near-indices)) +(defmethod inspect ((this ocean-near-indices)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tdata: #x~X~%" (-> this data)) this @@ -247,18 +208,15 @@ ;; definition of type ocean-near-colors (deftype ocean-near-colors (structure) - ((color0 vector :inline :offset-assert 0) - (color1 vector :inline :offset-assert 16) - (color2 vector :inline :offset-assert 32) - (color3 vector :inline :offset-assert 48) + ((color0 vector :inline) + (color1 vector :inline) + (color2 vector :inline) + (color3 vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type ocean-near-colors -(defmethod inspect ocean-near-colors ((this ocean-near-colors)) +(defmethod inspect ((this ocean-near-colors)) (format #t "[~8x] ~A~%" this 'ocean-near-colors) (format #t "~Tcolor0: #~%" (-> this color0)) (format #t "~Tcolor1: #~%" (-> this color1)) @@ -269,22 +227,19 @@ ;; definition of type ocean-map (deftype ocean-map (basic) - ((start-corner vector :inline :offset-assert 16) - (far-color vector :inline :offset-assert 32) - (ocean-spheres ocean-spheres :offset-assert 48) - (ocean-colors ocean-colors :offset-assert 52) - (ocean-mid-indices ocean-mid-indices :offset-assert 56) - (ocean-trans-indices ocean-trans-indices :offset-assert 60) - (ocean-near-indices ocean-near-indices :offset-assert 64) - (ocean-mid-masks ocean-mid-masks :offset-assert 68) + ((start-corner vector :inline) + (far-color vector :inline) + (ocean-spheres ocean-spheres) + (ocean-colors ocean-colors) + (ocean-mid-indices ocean-mid-indices) + (ocean-trans-indices ocean-trans-indices) + (ocean-near-indices ocean-near-indices) + (ocean-mid-masks ocean-mid-masks) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) ;; definition for method 3 of type ocean-map -(defmethod inspect ocean-map ((this ocean-map)) +(defmethod inspect ((this ocean-map)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tstart-corner: #~%" (-> this start-corner)) (format #t "~Tfar-color: #~%" (-> this far-color)) @@ -299,15 +254,12 @@ ;; definition of type ocean-trans-strip (deftype ocean-trans-strip (structure) - ((verts uint128 10 :offset-assert 0) + ((verts uint128 10) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type ocean-trans-strip -(defmethod inspect ocean-trans-strip ((this ocean-trans-strip)) +(defmethod inspect ((this ocean-trans-strip)) (format #t "[~8x] ~A~%" this 'ocean-trans-strip) (format #t "~Tverts[10] @ #x~X~%" (-> this verts)) this @@ -315,15 +267,12 @@ ;; definition of type ocean-trans-strip-array (deftype ocean-trans-strip-array (structure) - ((data ocean-trans-strip 4 :inline :offset-assert 0) + ((data ocean-trans-strip 4 :inline) ) - :method-count-assert 9 - :size-assert #x280 - :flag-assert #x900000280 ) ;; definition for method 3 of type ocean-trans-strip-array -(defmethod inspect ocean-trans-strip-array ((this ocean-trans-strip-array)) +(defmethod inspect ((this ocean-trans-strip-array)) (format #t "[~8x] ~A~%" this 'ocean-trans-strip-array) (format #t "~Tdata[4] @ #x~X~%" (-> this data)) this @@ -331,15 +280,12 @@ ;; definition of type ocean-wave-data (deftype ocean-wave-data (structure) - ((data uint8 1024 :offset-assert 0) + ((data uint8 1024) ) - :method-count-assert 9 - :size-assert #x400 - :flag-assert #x900000400 ) ;; definition for method 3 of type ocean-wave-data -(defmethod inspect ocean-wave-data ((this ocean-wave-data)) +(defmethod inspect ((this ocean-wave-data)) (format #t "[~8x] ~A~%" this 'ocean-wave-data) (format #t "~Tdata[1024] @ #x~X~%" (-> this data)) this @@ -347,15 +293,12 @@ ;; definition of type ocean-wave-frames (deftype ocean-wave-frames (structure) - ((frame ocean-wave-data 64 :inline :offset-assert 0) + ((frame ocean-wave-data 64 :inline) ) - :method-count-assert 9 - :size-assert #x10000 - :flag-assert #x900000000 ) ;; definition for method 3 of type ocean-wave-frames -(defmethod inspect ocean-wave-frames ((this ocean-wave-frames)) +(defmethod inspect ((this ocean-wave-frames)) (format #t "[~8x] ~A~%" this 'ocean-wave-frames) (format #t "~Tframe[64] @ #x~X~%" (-> this frame)) this @@ -363,39 +306,36 @@ ;; definition of type ocean-work (deftype ocean-work (basic) - ((deltas vector :inline :offset-assert 16) - (map-min vector :inline :offset-assert 32) - (map-max vector :inline :offset-assert 48) - (interp vector :inline :offset-assert 64) - (corner-array ocean-corner 25 :inline :offset-assert 80) - (corner-count int32 :offset-assert 2080) - (temp-vecs vector 4 :inline :offset-assert 2096) - (mid-mask-ptrs (pointer int64) 36 :offset-assert 2160) - (mid-camera-masks uint64 36 :offset-assert 2304) - (trans-mask-ptrs (pointer int32) 64 :offset-assert 2592) - (trans-camera-masks ocean-trans-mask 16 :inline :offset-assert 2848) - (trans-temp-masks ocean-trans-mask 16 :inline :offset-assert 2976) - (near-mask-indices uint16 16 :offset-assert 3104) - (mid-minx uint8 :offset-assert 3136) - (mid-maxx uint8 :offset-assert 3137) - (mid-minz uint8 :offset-assert 3138) - (mid-maxz uint8 :offset-assert 3139) - (near-minx uint8 :offset-assert 3140) - (near-maxx uint8 :offset-assert 3141) - (near-minz uint8 :offset-assert 3142) - (near-maxz uint8 :offset-assert 3143) - (temp-minx uint8 :offset-assert 3144) - (temp-maxx uint8 :offset-assert 3145) - (temp-minz uint8 :offset-assert 3146) - (temp-maxz uint8 :offset-assert 3147) - ) - :method-count-assert 9 - :size-assert #xc4c - :flag-assert #x900000c4c + ((deltas vector :inline) + (map-min vector :inline) + (map-max vector :inline) + (interp vector :inline) + (corner-array ocean-corner 25 :inline) + (corner-count int32) + (temp-vecs vector 4 :inline) + (mid-mask-ptrs (pointer int64) 36) + (mid-camera-masks uint64 36) + (trans-mask-ptrs (pointer int32) 64) + (trans-camera-masks ocean-trans-mask 16 :inline) + (trans-temp-masks ocean-trans-mask 16 :inline) + (near-mask-indices uint16 16) + (mid-minx uint8) + (mid-maxx uint8) + (mid-minz uint8) + (mid-maxz uint8) + (near-minx uint8) + (near-maxx uint8) + (near-minz uint8) + (near-maxz uint8) + (temp-minx uint8) + (temp-maxx uint8) + (temp-minz uint8) + (temp-maxz uint8) + ) ) ;; definition for method 3 of type ocean-work -(defmethod inspect ocean-work ((this ocean-work)) +(defmethod inspect ((this ocean-work)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tdeltas: #~%" (-> this deltas)) (format #t "~Tmap-min: #~%" (-> this map-min)) @@ -448,19 +388,16 @@ ;; definition of type ocean-vu0-work (deftype ocean-vu0-work (structure) - ((scales vector :inline :offset-assert 0) - (mask-hi vector4w :inline :offset-assert 16) - (mask-lo vector4w :inline :offset-assert 32) - (lights vu-lights :inline :offset-assert 48) - (wait-to-vu0 uint32 :offset-assert 160) + ((scales vector :inline) + (mask-hi vector4w :inline) + (mask-lo vector4w :inline) + (lights vu-lights :inline) + (wait-to-vu0 uint32) ) - :method-count-assert 9 - :size-assert #xa4 - :flag-assert #x9000000a4 ) ;; definition for method 3 of type ocean-vu0-work -(defmethod inspect ocean-vu0-work ((this ocean-vu0-work)) +(defmethod inspect ((this ocean-vu0-work)) (format #t "[~8x] ~A~%" this 'ocean-vu0-work) (format #t "~Tscales: #~%" (-> this scales)) (format #t "~Tmask-hi: #~%" (-> this mask-hi)) @@ -472,21 +409,18 @@ ;; definition of type ocean-texture-constants (deftype ocean-texture-constants (structure) - ((giftag gs-gif-tag :inline :offset-assert 0) - (buffers vector4w :inline :offset-assert 16) - (dests vector4w :inline :offset-assert 32) - (start vector :inline :offset-assert 48) - (offsets vector :inline :offset-assert 64) - (constants vector :inline :offset-assert 80) - (cam-nrm vector :inline :offset-assert 96) + ((giftag gs-gif-tag :inline) + (buffers vector4w :inline) + (dests vector4w :inline) + (start vector :inline) + (offsets vector :inline) + (constants vector :inline) + (cam-nrm vector :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type ocean-texture-constants -(defmethod inspect ocean-texture-constants ((this ocean-texture-constants)) +(defmethod inspect ((this ocean-texture-constants)) (format #t "[~8x] ~A~%" this 'ocean-texture-constants) (format #t "~Tgiftag: #~%" (-> this giftag)) (format #t "~Tbuffers: #~%" (-> this buffers)) @@ -500,17 +434,14 @@ ;; definition of type ocean-texture-work (deftype ocean-texture-work (structure) - ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) - (sprite-tmpl2 dma-gif-packet :inline :offset-assert 32) - (adgif-tmpl dma-gif-packet :inline :offset-assert 64) + ((sprite-tmpl dma-gif-packet :inline) + (sprite-tmpl2 dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type ocean-texture-work -(defmethod inspect ocean-texture-work ((this ocean-texture-work)) +(defmethod inspect ((this ocean-texture-work)) (format #t "[~8x] ~A~%" this 'ocean-texture-work) (format #t "~Tsprite-tmpl: #~%" (-> this sprite-tmpl)) (format #t "~Tsprite-tmpl2: #~%" (-> this sprite-tmpl2)) @@ -520,17 +451,14 @@ ;; definition of type ocean-mid-vertex (deftype ocean-mid-vertex (structure) - ((stq vector :inline :offset-assert 0) - (col vector :inline :offset-assert 16) - (pos vector :inline :offset-assert 32) + ((stq vector :inline) + (col vector :inline) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type ocean-mid-vertex -(defmethod inspect ocean-mid-vertex ((this ocean-mid-vertex)) +(defmethod inspect ((this ocean-mid-vertex)) (format #t "[~8x] ~A~%" this 'ocean-mid-vertex) (format #t "~Tstq: #~%" (-> this stq)) (format #t "~Tcol: #~%" (-> this col)) @@ -540,35 +468,32 @@ ;; definition of type ocean-mid-constants (deftype ocean-mid-constants (structure) - ((hmge-scale vector :inline :offset-assert 0) - (inv-hmge-scale vector :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (fog vector :inline :offset-assert 48) - (constants vector :inline :offset-assert 64) - (constants2 vector :inline :offset-assert 80) - (drw-fan gs-gif-tag :inline :offset-assert 96) - (env-fan gs-gif-tag :inline :offset-assert 112) - (drw-adgif gs-gif-tag :inline :offset-assert 128) - (drw-texture adgif-shader :inline :offset-assert 144) - (drw-strip-0 gs-gif-tag :inline :offset-assert 224) - (drw-strip-1 gs-gif-tag :inline :offset-assert 240) - (env-adgif gs-gif-tag :inline :offset-assert 256) - (env-texture adgif-shader :inline :offset-assert 272) - (env-strip gs-gif-tag :inline :offset-assert 352) - (env-color vector :inline :offset-assert 368) - (index-table vector4w 8 :inline :offset-assert 384) - (pos0 vector :inline :offset-assert 512) - (pos1 vector :inline :offset-assert 528) - (pos2 vector :inline :offset-assert 544) - (pos3 vector :inline :offset-assert 560) - ) - :method-count-assert 9 - :size-assert #x240 - :flag-assert #x900000240 + ((hmge-scale vector :inline) + (inv-hmge-scale vector :inline) + (hvdf-offset vector :inline) + (fog vector :inline) + (constants vector :inline) + (constants2 vector :inline) + (drw-fan gs-gif-tag :inline) + (env-fan gs-gif-tag :inline) + (drw-adgif gs-gif-tag :inline) + (drw-texture adgif-shader :inline) + (drw-strip-0 gs-gif-tag :inline) + (drw-strip-1 gs-gif-tag :inline) + (env-adgif gs-gif-tag :inline) + (env-texture adgif-shader :inline) + (env-strip gs-gif-tag :inline) + (env-color vector :inline) + (index-table vector4w 8 :inline) + (pos0 vector :inline) + (pos1 vector :inline) + (pos2 vector :inline) + (pos3 vector :inline) + ) ) ;; definition for method 3 of type ocean-mid-constants -(defmethod inspect ocean-mid-constants ((this ocean-mid-constants)) +(defmethod inspect ((this ocean-mid-constants)) (format #t "[~8x] ~A~%" this 'ocean-mid-constants) (format #t "~Thmge-scale: #~%" (-> this hmge-scale)) (format #t "~Tinv-hmge-scale: #~%" (-> this inv-hmge-scale)) @@ -596,18 +521,15 @@ ;; definition of type ocean-mid-upload (deftype ocean-mid-upload (structure) - ((rot matrix :inline :offset-assert 0) - (matrix matrix :inline :offset-assert 64) - (colors uint128 108 :offset-assert 128) - (masks uint128 2 :offset-assert 1856) + ((rot matrix :inline) + (matrix matrix :inline) + (colors uint128 108) + (masks uint128 2) ) - :method-count-assert 9 - :size-assert #x760 - :flag-assert #x900000760 ) ;; definition for method 3 of type ocean-mid-upload -(defmethod inspect ocean-mid-upload ((this ocean-mid-upload)) +(defmethod inspect ((this ocean-mid-upload)) (format #t "[~8x] ~A~%" this 'ocean-mid-upload) (format #t "~Trot: #~%" (-> this rot)) (format #t "~Tmatrix: #~%" (-> this matrix)) @@ -618,26 +540,23 @@ ;; definition of type ocean-mid-upload2 (deftype ocean-mid-upload2 (structure) - ((rot matrix :inline :offset-assert 0) - (matrix matrix :inline :offset-assert 64) - (count vector4w :inline :offset-assert 128) - (tex0 vector :inline :offset-assert 144) - (tex1 vector :inline :offset-assert 160) - (tex2 vector :inline :offset-assert 176) - (tex3 vector :inline :offset-assert 192) - (clr0 vector :inline :offset-assert 208) - (clr1 vector :inline :offset-assert 224) - (clr2 vector :inline :offset-assert 240) - (clr3 vector :inline :offset-assert 256) - (verts uint128 18 :offset-assert 272) - ) - :method-count-assert 9 - :size-assert #x230 - :flag-assert #x900000230 + ((rot matrix :inline) + (matrix matrix :inline) + (count vector4w :inline) + (tex0 vector :inline) + (tex1 vector :inline) + (tex2 vector :inline) + (tex3 vector :inline) + (clr0 vector :inline) + (clr1 vector :inline) + (clr2 vector :inline) + (clr3 vector :inline) + (verts uint128 18) + ) ) ;; definition for method 3 of type ocean-mid-upload2 -(defmethod inspect ocean-mid-upload2 ((this ocean-mid-upload2)) +(defmethod inspect ((this ocean-mid-upload2)) (format #t "[~8x] ~A~%" this 'ocean-mid-upload2) (format #t "~Trot: #~%" (-> this rot)) (format #t "~Tmatrix: #~%" (-> this matrix)) @@ -656,21 +575,18 @@ ;; definition of type ocean-mid-work (deftype ocean-mid-work (structure) - ((env0 vector :inline :offset-assert 0) - (env1 vector :inline :offset-assert 16) - (env2 vector :inline :offset-assert 32) - (hmg0 vector :inline :offset-assert 48) - (hmg1 vector :inline :offset-assert 64) - (hmg2 vector :inline :offset-assert 80) - (indices uint128 16 :offset-assert 96) + ((env0 vector :inline) + (env1 vector :inline) + (env2 vector :inline) + (hmg0 vector :inline) + (hmg1 vector :inline) + (hmg2 vector :inline) + (indices uint128 16) ) - :method-count-assert 9 - :size-assert #x160 - :flag-assert #x900000160 ) ;; definition for method 3 of type ocean-mid-work -(defmethod inspect ocean-mid-work ((this ocean-mid-work)) +(defmethod inspect ((this ocean-mid-work)) (format #t "[~8x] ~A~%" this 'ocean-mid-work) (format #t "~Tenv0: #~%" (-> this env0)) (format #t "~Tenv1: #~%" (-> this env1)) @@ -684,39 +600,36 @@ ;; definition of type ocean-near-constants (deftype ocean-near-constants (structure) - ((hmge-scale vector :inline :offset-assert 0) - (inv-hmge-scale vector :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (fog vector :inline :offset-assert 48) - (constants vector :inline :offset-assert 64) - (constants2 vector :inline :offset-assert 80) - (constants3 vector :inline :offset-assert 96) - (constants4 vector :inline :offset-assert 112) - (drw-fan gs-gif-tag :inline :offset-assert 128) - (drw2-fan gs-gif-tag :inline :offset-assert 144) - (env-fan gs-gif-tag :inline :offset-assert 160) - (drw-adgif gs-gif-tag :inline :offset-assert 176) - (drw-texture adgif-shader :inline :offset-assert 192) - (drw-strip gs-gif-tag :inline :offset-assert 272) - (env-adgif gs-gif-tag :inline :offset-assert 288) - (env-texture adgif-shader :inline :offset-assert 304) - (env-strip gs-gif-tag :inline :offset-assert 384) - (env-color vector :inline :offset-assert 400) - (drw2-adgif gs-gif-tag :inline :offset-assert 416) - (drw2-tex0 qword :inline :offset-assert 432) - (drw2-frame qword :inline :offset-assert 448) - (drw2-strip gs-gif-tag :inline :offset-assert 464) - (drw3-adgif gs-gif-tag :inline :offset-assert 480) - (drw3-frame qword :inline :offset-assert 496) - (index-table vector4w 4 :inline :offset-assert 512) - ) - :method-count-assert 9 - :size-assert #x240 - :flag-assert #x900000240 + ((hmge-scale vector :inline) + (inv-hmge-scale vector :inline) + (hvdf-offset vector :inline) + (fog vector :inline) + (constants vector :inline) + (constants2 vector :inline) + (constants3 vector :inline) + (constants4 vector :inline) + (drw-fan gs-gif-tag :inline) + (drw2-fan gs-gif-tag :inline) + (env-fan gs-gif-tag :inline) + (drw-adgif gs-gif-tag :inline) + (drw-texture adgif-shader :inline) + (drw-strip gs-gif-tag :inline) + (env-adgif gs-gif-tag :inline) + (env-texture adgif-shader :inline) + (env-strip gs-gif-tag :inline) + (env-color vector :inline) + (drw2-adgif gs-gif-tag :inline) + (drw2-tex0 qword :inline) + (drw2-frame qword :inline) + (drw2-strip gs-gif-tag :inline) + (drw3-adgif gs-gif-tag :inline) + (drw3-frame qword :inline) + (index-table vector4w 4 :inline) + ) ) ;; definition for method 3 of type ocean-near-constants -(defmethod inspect ocean-near-constants ((this ocean-near-constants)) +(defmethod inspect ((this ocean-near-constants)) (format #t "[~8x] ~A~%" this 'ocean-near-constants) (format #t "~Thmge-scale: #~%" (-> this hmge-scale)) (format #t "~Tinv-hmge-scale: #~%" (-> this inv-hmge-scale)) @@ -748,20 +661,17 @@ ;; definition of type ocean-near-upload (deftype ocean-near-upload (structure) - ((rot matrix :inline :offset-assert 0) - (matrix matrix :inline :offset-assert 64) - (masks uint128 2 :offset-assert 128) - (start-height vector4w :inline :offset-assert 160) - (start-st vector :inline :offset-assert 176) - (near-colors ocean-near-colors :inline :offset-assert 192) + ((rot matrix :inline) + (matrix matrix :inline) + (masks uint128 2) + (start-height vector4w :inline) + (start-st vector :inline) + (near-colors ocean-near-colors :inline) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; definition for method 3 of type ocean-near-upload -(defmethod inspect ocean-near-upload ((this ocean-near-upload)) +(defmethod inspect ((this ocean-near-upload)) (format #t "[~8x] ~A~%" this 'ocean-near-upload) (format #t "~Trot: #~%" (-> this rot)) (format #t "~Tmatrix: #~%" (-> this matrix)) @@ -774,17 +684,14 @@ ;; definition of type ocean-near-vertex (deftype ocean-near-vertex (structure) - ((stq vector :inline :offset-assert 0) - (clr vector :inline :offset-assert 16) - (pos vector :inline :offset-assert 32) + ((stq vector :inline) + (clr vector :inline) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type ocean-near-vertex -(defmethod inspect ocean-near-vertex ((this ocean-near-vertex)) +(defmethod inspect ((this ocean-near-vertex)) (format #t "[~8x] ~A~%" this 'ocean-near-vertex) (format #t "~Tstq: #~%" (-> this stq)) (format #t "~Tclr: #~%" (-> this clr)) @@ -794,16 +701,13 @@ ;; definition of type ocean-near-work (deftype ocean-near-work (structure) - ((verts-ptr vector :inline :offset-assert 0) - (indices uint128 16 :offset-assert 16) + ((verts-ptr vector :inline) + (indices uint128 16) ) - :method-count-assert 9 - :size-assert #x110 - :flag-assert #x900000110 ) ;; definition for method 3 of type ocean-near-work -(defmethod inspect ocean-near-work ((this ocean-near-work)) +(defmethod inspect ((this ocean-near-work)) (format #t "[~8x] ~A~%" this 'ocean-near-work) (format #t "~Tverts-ptr: #~%" (-> this verts-ptr)) (format #t "~Tindices[16] @ #x~X~%" (-> this indices)) diff --git a/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-h_REF.gc index 5f6dd2e8929..83191ec051a 100644 --- a/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-h_REF.gc @@ -3,23 +3,20 @@ ;; definition of type fake-shadow (deftype fake-shadow (structure) - ((px float :offset-assert 0) - (py float :offset-assert 4) - (pz float :offset-assert 8) - (scale float :offset-assert 12) - (qx float :offset-assert 16) - (qy float :offset-assert 20) - (qz float :offset-assert 24) - (flags int32 :offset-assert 28) + ((px float) + (py float) + (pz float) + (scale float) + (qx float) + (qy float) + (qz float) + (flags int32) ) :pack-me - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type fake-shadow -(defmethod inspect fake-shadow ((this fake-shadow)) +(defmethod inspect ((this fake-shadow)) (format #t "[~8x] ~A~%" this 'fake-shadow) (format #t "~Tpx: ~f~%" (-> this px)) (format #t "~Tpy: ~f~%" (-> this py)) @@ -34,16 +31,13 @@ ;; definition of type fake-shadow-buffer (deftype fake-shadow-buffer (basic) - ((num-shadows int32 :offset-assert 4) - (data fake-shadow 32 :inline :offset-assert 8) + ((num-shadows int32) + (data fake-shadow 32 :inline) ) - :method-count-assert 9 - :size-assert #x408 - :flag-assert #x900000408 ) ;; definition for method 3 of type fake-shadow-buffer -(defmethod inspect fake-shadow-buffer ((this fake-shadow-buffer)) +(defmethod inspect ((this fake-shadow-buffer)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tnum-shadows: ~D~%" (-> this num-shadows)) (format #t "~Tdata[32] @ #x~X~%" (-> this data)) diff --git a/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-vu1_REF.gc b/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-vu1_REF.gc index 89b0a085ebf..24fbeab372d 100644 --- a/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-vu1_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-vu1_REF.gc @@ -3,26 +3,23 @@ ;; definition of type shadow-vu1-constants (deftype shadow-vu1-constants (structure) - ((hmgescale vector :inline :offset-assert 0) - (invhscale vector :inline :offset-assert 16) - (texoffset vector :inline :offset-assert 32) - (texscale vector :inline :offset-assert 48) - (hvdfoff vector :inline :offset-assert 64) - (fog vector :inline :offset-assert 80) - (clrs vector 2 :inline :offset-assert 96) - (adgif gs-gif-tag :inline :offset-assert 128) - (texflush ad-cmd :inline :offset-assert 144) - (flush ad-cmd :inline :offset-assert 160) - (trigif gs-gif-tag :inline :offset-assert 176) - (quadgif gs-gif-tag :inline :offset-assert 192) + ((hmgescale vector :inline) + (invhscale vector :inline) + (texoffset vector :inline) + (texscale vector :inline) + (hvdfoff vector :inline) + (fog vector :inline) + (clrs vector 2 :inline) + (adgif gs-gif-tag :inline) + (texflush ad-cmd :inline) + (flush ad-cmd :inline) + (trigif gs-gif-tag :inline) + (quadgif gs-gif-tag :inline) ) - :method-count-assert 9 - :size-assert #xd0 - :flag-assert #x9000000d0 ) ;; definition for method 3 of type shadow-vu1-constants -(defmethod inspect shadow-vu1-constants ((this shadow-vu1-constants)) +(defmethod inspect ((this shadow-vu1-constants)) (format #t "[~8x] ~A~%" this 'shadow-vu1-constants) (format #t "~Thmgescale: #~%" (-> this hmgescale)) (format #t "~Tinvhscale: #~%" (-> this invhscale)) @@ -41,19 +38,16 @@ ;; definition of type shadow-vu1-gifbuf-template (deftype shadow-vu1-gifbuf-template (structure) - ((adgif gs-gif-tag :inline :offset-assert 0) - (ad ad-cmd :inline :offset-assert 16) - (flush ad-cmd :inline :offset-assert 32) - (trigif gs-gif-tag :inline :offset-assert 48) - (quadgif gs-gif-tag :inline :offset-assert 64) + ((adgif gs-gif-tag :inline) + (ad ad-cmd :inline) + (flush ad-cmd :inline) + (trigif gs-gif-tag :inline) + (quadgif gs-gif-tag :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type shadow-vu1-gifbuf-template -(defmethod inspect shadow-vu1-gifbuf-template ((this shadow-vu1-gifbuf-template)) +(defmethod inspect ((this shadow-vu1-gifbuf-template)) (format #t "[~8x] ~A~%" this 'shadow-vu1-gifbuf-template) (format #t "~Tadgif: #~%" (-> this adgif)) (format #t "~Tad: #~%" (-> this ad)) diff --git a/test/decompiler/reference/jak1/engine/gfx/shrub/shrubbery-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/shrub/shrubbery-h_REF.gc index b8ce3524015..9886bcdd6f1 100644 --- a/test/decompiler/reference/jak1/engine/gfx/shrub/shrubbery-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/shrub/shrubbery-h_REF.gc @@ -3,15 +3,12 @@ ;; definition of type billboard (deftype billboard (drawable) - ((flat adgif-shader :inline :offset-assert 32) + ((flat adgif-shader :inline) ) - :method-count-assert 18 - :size-assert #x70 - :flag-assert #x1200000070 ) ;; definition for method 3 of type billboard -(defmethod inspect billboard ((this billboard)) +(defmethod inspect ((this billboard)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) @@ -21,26 +18,23 @@ ;; definition of type shrub-view-data (deftype shrub-view-data (structure) - ((data uint128 3 :offset-assert 0) - (texture-giftag gs-gif-tag :inline :offset 0) - (consts vector :inline :offset 16) - (fog-clamp vector :inline :offset 32) - (tex-start-ptr int32 :offset 16) - (gifbufsum float :offset 16) - (mtx-buf-ptr int32 :offset 20) - (exp23 float :offset 20) - (fog-0 float :offset 24) - (fog-1 float :offset 28) - (fog-min float :offset 32) - (fog-max float :offset 36) + ((data uint128 3) + (texture-giftag gs-gif-tag :inline :overlay-at (-> data 0)) + (consts vector :inline :overlay-at (-> data 1)) + (fog-clamp vector :inline :overlay-at (-> data 2)) + (tex-start-ptr int32 :overlay-at (-> data 1)) + (gifbufsum float :overlay-at (-> data 1)) + (mtx-buf-ptr int32 :overlay-at (-> consts y)) + (exp23 float :overlay-at mtx-buf-ptr) + (fog-0 float :overlay-at (-> consts z)) + (fog-1 float :overlay-at (-> consts w)) + (fog-min float :overlay-at (-> data 2)) + (fog-max float :overlay-at (-> fog-clamp y)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type shrub-view-data -(defmethod inspect shrub-view-data ((this shrub-view-data)) +(defmethod inspect ((this shrub-view-data)) (format #t "[~8x] ~A~%" this 'shrub-view-data) (format #t "~Tdata[3] @ #x~X~%" (-> this data)) (format #t "~Ttexture-giftag: #~%" (-> this data)) @@ -59,24 +53,21 @@ ;; definition of type shrubbery (deftype shrubbery (drawable) - ((textures (inline-array adgif-shader) :offset 4) - (header qword :offset 8) - (obj-qwc uint8 :offset 12) - (vtx-qwc uint8 :offset 13) - (col-qwc uint8 :offset 14) - (stq-qwc uint8 :offset 15) - (obj uint32 :offset 16) - (vtx uint32 :offset 20) - (col uint32 :offset 24) - (stq uint32 :offset 28) + ((textures (inline-array adgif-shader) :overlay-at id) + (header qword :offset 8) + (obj-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (obj uint32 :overlay-at (-> bsphere x)) + (vtx uint32 :overlay-at (-> bsphere y)) + (col uint32 :overlay-at (-> bsphere z)) + (stq uint32 :overlay-at (-> bsphere w)) ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 ) ;; definition for method 3 of type shrubbery -(defmethod inspect shrubbery ((this shrubbery)) +(defmethod inspect ((this shrubbery)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (&-> this obj)) @@ -95,18 +86,15 @@ ;; definition of type instance-shrubbery (deftype instance-shrubbery (instance) - ((color-indices uint32 :offset 8) - (flat-normal vector :inline :offset-assert 64) - (flat-hwidth float :offset 76) - (color uint32 :offset 8) + ((color-indices uint32 :overlay-at error) + (flat-normal vector :inline) + (flat-hwidth float :overlay-at (-> flat-normal w)) + (color uint32 :overlay-at color-indices) ) - :method-count-assert 18 - :size-assert #x50 - :flag-assert #x1200000050 ) ;; definition for method 3 of type instance-shrubbery -(defmethod inspect instance-shrubbery ((this instance-shrubbery)) +(defmethod inspect ((this instance-shrubbery)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) @@ -121,44 +109,35 @@ ;; definition of type drawable-inline-array-instance-shrub (deftype drawable-inline-array-instance-shrub (drawable-inline-array) - ((data instance-shrubbery 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 112) + ((data instance-shrubbery 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x74 - :flag-assert #x1200000074 ) ;; definition of type drawable-tree-instance-shrub (deftype drawable-tree-instance-shrub (drawable-tree) - ((info prototype-array-shrub-info :offset 8) - (colors-added time-of-day-palette :offset 12) + ((info prototype-array-shrub-info :offset 8) + (colors-added time-of-day-palette :offset 12) ) - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; definition of type generic-shrub-fragment (deftype generic-shrub-fragment (drawable) - ((textures (inline-array adgif-shader) :offset 4) - (vtx-cnt uint32 :offset 8) - (cnt-qwc uint8 :offset 12) - (vtx-qwc uint8 :offset 13) - (col-qwc uint8 :offset 14) - (stq-qwc uint8 :offset 15) - (cnt uint32 :offset 16) - (vtx uint32 :offset 20) - (col uint32 :offset 24) - (stq uint32 :offset 28) + ((textures (inline-array adgif-shader) :overlay-at id) + (vtx-cnt uint32 :offset 8) + (cnt-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (cnt uint32 :overlay-at (-> bsphere x)) + (vtx uint32 :overlay-at (-> bsphere y)) + (col uint32 :overlay-at (-> bsphere z)) + (stq uint32 :overlay-at (-> bsphere w)) ) - :method-count-assert 18 - :size-assert #x20 - :flag-assert #x1200000020 ) ;; definition for method 3 of type generic-shrub-fragment -(defmethod inspect generic-shrub-fragment ((this generic-shrub-fragment)) +(defmethod inspect ((this generic-shrub-fragment)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (&-> this cnt)) @@ -177,42 +156,30 @@ ;; definition of type prototype-shrubbery (deftype prototype-shrubbery (drawable-inline-array) - ((data shrubbery 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 64) + ((data shrubbery 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x44 - :flag-assert #x1200000044 ) ;; definition of type prototype-trans-shrubbery (deftype prototype-trans-shrubbery (prototype-shrubbery) () - :method-count-assert 18 - :size-assert #x44 - :flag-assert #x1200000044 ) ;; definition of type prototype-generic-shrub (deftype prototype-generic-shrub (drawable-group) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; definition of type shrubbery-matrix (deftype shrubbery-matrix (structure) - ((mat matrix :inline :offset-assert 0) - (color qword :inline :offset-assert 64) + ((mat matrix :inline) + (color qword :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type shrubbery-matrix -(defmethod inspect shrubbery-matrix ((this shrubbery-matrix)) +(defmethod inspect ((this shrubbery-matrix)) (format #t "[~8x] ~A~%" this 'shrubbery-matrix) (format #t "~Tmat: #~%" (-> this mat)) (format #t "~Tcolor: #~%" (-> this color)) @@ -258,22 +225,19 @@ ;; definition of type shrub-near-packet (deftype shrub-near-packet (structure) - ((matrix-tmpl dma-packet :inline :offset-assert 0) - (header-tmpl dma-packet :inline :offset-assert 16) - (stq-tmpl dma-packet :inline :offset-assert 32) - (color-tmpl dma-packet :inline :offset-assert 48) - (vertex-tmpl dma-packet :inline :offset-assert 64) - (mscal-tmpl dma-packet :inline :offset-assert 80) - (init-tmpl dma-packet :inline :offset-assert 96) - (init-data uint32 8 :offset-assert 112) + ((matrix-tmpl dma-packet :inline) + (header-tmpl dma-packet :inline) + (stq-tmpl dma-packet :inline) + (color-tmpl dma-packet :inline) + (vertex-tmpl dma-packet :inline) + (mscal-tmpl dma-packet :inline) + (init-tmpl dma-packet :inline) + (init-data uint32 8) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) ;; definition for method 3 of type shrub-near-packet -(defmethod inspect shrub-near-packet ((this shrub-near-packet)) +(defmethod inspect ((this shrub-near-packet)) (format #t "[~8x] ~A~%" this 'shrub-near-packet) (format #t "~Tmatrix-tmpl: #~%" (-> this matrix-tmpl)) (format #t "~Theader-tmpl: #~%" (-> this header-tmpl)) @@ -288,74 +252,71 @@ ;; definition of type instance-shrub-work (deftype instance-shrub-work (structure) - ((dummy qword 3 :inline :offset-assert 0) - (chaina qword 8 :inline :offset-assert 48) - (chainb qword 8 :inline :offset-assert 176) - (colors rgba 1024 :offset-assert 304) - (matrix-tmpl qword 20 :inline :offset-assert 4400) - (count-tmpl vector4w 20 :inline :offset-assert 4720) - (mscalf-tmpl dma-packet :inline :offset-assert 5040) - (mscalf-ret-tmpl dma-packet :inline :offset-assert 5056) - (adgif-tmpl dma-gif-packet :inline :offset-assert 5072) - (billboard-tmpl dma-gif-packet :inline :offset-assert 5104) - (billboard-const vector :inline :offset-assert 5136) - (shrub-near-packets shrub-near-packet 6 :inline :offset-assert 5152) - (dma-ref dma-packet :inline :offset-assert 6016) - (dma-end dma-packet :inline :offset-assert 6032) - (wind-const vector :inline :offset-assert 6048) - (constants vector :inline :offset-assert 6064) - (color-constant vector4w :inline :offset-assert 6080) - (hmge-d vector :inline :offset-assert 6096) - (hvdf-offset vector :inline :offset-assert 6112) - (wind-force vector :inline :offset-assert 6128) - (color vector :inline :offset-assert 6144) - (bb-color vector :inline :offset-assert 6160) - (min-dist vector :inline :offset-assert 6176) - (temp-vec vector :inline :offset-assert 6192) - (guard-plane plane 4 :inline :offset-assert 6208) - (plane plane 4 :inline :offset-assert 6272) - (last uint32 4 :offset-assert 6336) - (next uint32 4 :offset-assert 6352) - (count uint16 4 :offset-assert 6368) - (mod-count uint16 4 :offset-assert 6376) - (wind-vectors uint32 :offset-assert 6384) - (instance-ptr uint32 :offset-assert 6388) - (chain-ptr uint32 :offset-assert 6392) - (chain-ptr-next uint32 :offset-assert 6396) - (stack-ptr uint32 :offset-assert 6400) - (bucket-ptr uint32 :offset-assert 6404) - (src-ptr uint32 :offset-assert 6408) - (to-spr uint32 :offset-assert 6412) - (from-spr uint32 :offset-assert 6416) - (shrub-count uint32 :offset-assert 6420) - (node uint32 6 :offset 6428) - (length uint32 6 :offset-assert 6452) - (prototypes uint32 :offset-assert 6476) - (start-bank uint8 20 :offset 6484) - (buffer-index uint32 :offset-assert 6504) - (current-spr uint32 :offset-assert 6508) - (current-mem uint32 :offset-assert 6512) - (current-shrub-near-packet uint32 :offset-assert 6516) - (dma-buffer basic :offset 6524) - (near-last uint32 :offset-assert 6528) - (near-next uint32 :offset-assert 6532) - (near-count uint32 :offset-assert 6536) - (last-shrubs uint32 :offset-assert 6540) - (chains uint32 :offset-assert 6544) - (flags uint32 :offset-assert 6548) - (paused basic :offset-assert 6552) - (node-count uint32 :offset-assert 6556) - (inst-count uint32 :offset-assert 6560) - (wait-from-spr uint32 :offset-assert 6564) - (wait-to-spr uint32 :offset-assert 6568) + ((dummy qword 3 :inline) + (chaina qword 8 :inline) + (chainb qword 8 :inline) + (colors rgba 1024) + (matrix-tmpl qword 20 :inline) + (count-tmpl vector4w 20 :inline) + (mscalf-tmpl dma-packet :inline) + (mscalf-ret-tmpl dma-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (billboard-tmpl dma-gif-packet :inline) + (billboard-const vector :inline) + (shrub-near-packets shrub-near-packet 6 :inline) + (dma-ref dma-packet :inline) + (dma-end dma-packet :inline) + (wind-const vector :inline) + (constants vector :inline) + (color-constant vector4w :inline) + (hmge-d vector :inline) + (hvdf-offset vector :inline) + (wind-force vector :inline) + (color vector :inline) + (bb-color vector :inline) + (min-dist vector :inline) + (temp-vec vector :inline) + (guard-plane plane 4 :inline) + (plane plane 4 :inline) + (last uint32 4) + (next uint32 4) + (count uint16 4) + (mod-count uint16 4) + (wind-vectors uint32) + (instance-ptr uint32) + (chain-ptr uint32) + (chain-ptr-next uint32) + (stack-ptr uint32) + (bucket-ptr uint32) + (src-ptr uint32) + (to-spr uint32) + (from-spr uint32) + (shrub-count uint32) + (node uint32 6 :offset 6428) + (length uint32 6) + (prototypes uint32) + (start-bank uint8 20 :offset 6484) + (buffer-index uint32) + (current-spr uint32) + (current-mem uint32) + (current-shrub-near-packet uint32) + (dma-buffer basic :offset 6524) + (near-last uint32) + (near-next uint32) + (near-count uint32) + (last-shrubs uint32) + (chains uint32) + (flags uint32) + (paused basic) + (node-count uint32) + (inst-count uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) ) - :method-count-assert 9 - :size-assert #x19ac - :flag-assert #x9000019ac ) ;; definition for method 3 of type instance-shrub-work -(defmethod inspect instance-shrub-work ((this instance-shrub-work)) +(defmethod inspect ((this instance-shrub-work)) (format #t "[~8x] ~A~%" this 'instance-shrub-work) (format #t "~Tdummy[3] @ #x~X~%" (-> this dummy)) (format #t "~Tchaina[8] @ #x~X~%" (-> this chaina)) @@ -425,18 +386,15 @@ ;; definition of type instance-shrub-dma (deftype instance-shrub-dma (structure) - ((instancea uint128 325 :offset-assert 0) - (instanceb uint128 325 :offset-assert 5200) - (outa uint128 128 :offset-assert 10400) - (outb uint128 128 :offset-assert 12448) + ((instancea uint128 325) + (instanceb uint128 325) + (outa uint128 128) + (outb uint128 128) ) - :method-count-assert 9 - :size-assert #x38a0 - :flag-assert #x9000038a0 ) ;; definition for method 3 of type instance-shrub-dma -(defmethod inspect instance-shrub-dma ((this instance-shrub-dma)) +(defmethod inspect ((this instance-shrub-dma)) (format #t "[~8x] ~A~%" this 'instance-shrub-dma) (format #t "~Tinstancea[325] @ #x~X~%" (-> this instancea)) (format #t "~Tinstanceb[325] @ #x~X~%" (-> this instanceb)) diff --git a/test/decompiler/reference/jak1/engine/gfx/sky/sky-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sky/sky-h_REF.gc index 0eff26d5c50..54e3ccf8138 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sky/sky-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sky/sky-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type sky-color-hour (deftype sky-color-hour (structure) - ((snapshot1 int32 :offset-assert 0) - (snapshot2 int32 :offset-assert 4) - (morph-start float :offset-assert 8) - (morph-end float :offset-assert 12) + ((snapshot1 int32) + (snapshot2 int32) + (morph-start float) + (morph-end float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type sky-color-hour -(defmethod inspect sky-color-hour ((this sky-color-hour)) +(defmethod inspect ((this sky-color-hour)) (format #t "[~8x] ~A~%" this 'sky-color-hour) (format #t "~Tsnapshot1: ~D~%" (-> this snapshot1)) (format #t "~Tsnapshot2: ~D~%" (-> this snapshot2)) @@ -25,15 +22,12 @@ ;; definition of type sky-color-day (deftype sky-color-day (structure) - ((hour sky-color-hour 24 :inline :offset-assert 0) + ((hour sky-color-hour 24 :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;; definition for method 3 of type sky-color-day -(defmethod inspect sky-color-day ((this sky-color-day)) +(defmethod inspect ((this sky-color-day)) (format #t "[~8x] ~A~%" this 'sky-color-day) (format #t "~Thour[24] @ #x~X~%" (-> this hour)) this @@ -41,15 +35,12 @@ ;; definition of type sky-circle-data (deftype sky-circle-data (structure) - ((data vector 17 :inline :offset-assert 0) + ((data vector 17 :inline) ) - :method-count-assert 9 - :size-assert #x110 - :flag-assert #x900000110 ) ;; definition for method 3 of type sky-circle-data -(defmethod inspect sky-circle-data ((this sky-circle-data)) +(defmethod inspect ((this sky-circle-data)) (format #t "[~8x] ~A~%" this 'sky-circle-data) (format #t "~Tdata[17] @ #x~X~%" (-> this data)) this @@ -57,25 +48,22 @@ ;; definition of type sky-sun-data (deftype sky-sun-data (structure) - ((data uint128 4 :offset-assert 0) - (pos vector :inline :offset 0) - (r-sun float :offset 16) - (r-halo float :offset 20) - (r-aurora float :offset 24) - (c-sun-start rgba :offset 32) - (c-sun-end rgba :offset 48) - (c-halo-start rgba :offset 36) - (c-halo-end rgba :offset 52) - (c-aurora-start rgba :offset 40) - (c-aurora-end rgba :offset 56) + ((data uint128 4) + (pos vector :inline :overlay-at (-> data 0)) + (r-sun float :overlay-at (-> data 1)) + (r-halo float :offset 20) + (r-aurora float :offset 24) + (c-sun-start rgba :overlay-at (-> data 2)) + (c-sun-end rgba :overlay-at (-> data 3)) + (c-halo-start rgba :offset 36) + (c-halo-end rgba :offset 52) + (c-aurora-start rgba :offset 40) + (c-aurora-end rgba :offset 56) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type sky-sun-data -(defmethod inspect sky-sun-data ((this sky-sun-data)) +(defmethod inspect ((this sky-sun-data)) (format #t "[~8x] ~A~%" this 'sky-sun-data) (format #t "~Tdata[4] @ #x~X~%" (-> this data)) (format #t "~Tpos: #~%" (-> this data)) @@ -93,17 +81,14 @@ ;; definition of type sky-moon-data (deftype sky-moon-data (structure) - ((data uint128 2 :offset-assert 0) - (pos vector :inline :offset 0) - (scale vector :inline :offset 16) + ((data uint128 2) + (pos vector :inline :overlay-at (-> data 0)) + (scale vector :inline :overlay-at (-> data 1)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sky-moon-data -(defmethod inspect sky-moon-data ((this sky-moon-data)) +(defmethod inspect ((this sky-moon-data)) (format #t "[~8x] ~A~%" this 'sky-moon-data) (format #t "~Tdata[2] @ #x~X~%" (-> this data)) (format #t "~Tpos: #~%" (-> this data)) @@ -113,21 +98,18 @@ ;; definition of type sky-orbit (deftype sky-orbit (structure) - ((high-noon float :offset-assert 0) - (tilt float :offset-assert 4) - (rise float :offset-assert 8) - (dist float :offset-assert 12) - (min-halo float :offset-assert 16) - (max-halo float :offset-assert 20) + ((high-noon float) + (tilt float) + (rise float) + (dist float) + (min-halo float) + (max-halo float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type sky-orbit -(defmethod inspect sky-orbit ((this sky-orbit)) +(defmethod inspect ((this sky-orbit)) (format #t "[~8x] ~A~%" this 'sky-orbit) (format #t "~Thigh-noon: ~f~%" (-> this high-noon)) (format #t "~Ttilt: ~f~%" (-> this tilt)) @@ -140,18 +122,15 @@ ;; definition of type sky-upload-data (deftype sky-upload-data (basic) - ((circle sky-circle-data :inline :offset-assert 16) - (sun sky-sun-data 2 :inline :offset-assert 288) - (moon sky-moon-data :inline :offset-assert 416) - (data uint128 27 :offset 16) + ((circle sky-circle-data :inline) + (sun sky-sun-data 2 :inline) + (moon sky-moon-data :inline) + (data uint128 27 :overlay-at (-> circle data)) ) - :method-count-assert 9 - :size-assert #x1c0 - :flag-assert #x9000001c0 ) ;; definition for method 3 of type sky-upload-data -(defmethod inspect sky-upload-data ((this sky-upload-data)) +(defmethod inspect ((this sky-upload-data)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tdata[27] @ #x~X~%" (-> this circle)) (format #t "~Tcircle: #~%" (-> this circle)) @@ -162,23 +141,20 @@ ;; definition of type sky-parms (deftype sky-parms (basic) - ((orbit sky-orbit 3 :inline :offset-assert 4) - (upload-data sky-upload-data :inline :offset-assert 112) - (sun-lights light-group :inline :offset-assert 560) - (moon-lights light-group :inline :offset-assert 752) - (default-lights light-group :inline :offset-assert 944) - (default-vu-lights vu-lights :inline :offset-assert 1136) + ((orbit sky-orbit 3 :inline) + (upload-data sky-upload-data :inline) + (sun-lights light-group :inline) + (moon-lights light-group :inline) + (default-lights light-group :inline) + (default-vu-lights vu-lights :inline) ) - :method-count-assert 9 - :size-assert #x4e0 - :flag-assert #x9000004e0 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type sky-parms -(defmethod inspect sky-parms ((this sky-parms)) +(defmethod inspect ((this sky-parms)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Torbit[3] @ #x~X~%" (-> this orbit)) (format #t "~Tupload-data: #~%" (-> this upload-data)) @@ -215,24 +191,21 @@ ;; definition of type sky-tng-data (deftype sky-tng-data (basic) - ((giftag-base gs-gif-tag :inline :offset-assert 16) - (giftag-roof gs-gif-tag :inline :offset-assert 32) - (giftag-ocean gs-gif-tag :inline :offset-assert 48) - (fog vector :inline :offset-assert 64) - (sky uint32 8 :offset-assert 80) - (time float :offset-assert 112) - (off-s-0 uint16 :offset-assert 116) - (off-t-0 uint16 :offset-assert 118) - (off-s-1 uint16 :offset-assert 120) - (off-t-1 uint16 :offset-assert 122) + ((giftag-base gs-gif-tag :inline) + (giftag-roof gs-gif-tag :inline) + (giftag-ocean gs-gif-tag :inline) + (fog vector :inline) + (sky uint32 8) + (time float) + (off-s-0 uint16) + (off-t-0 uint16) + (off-s-1 uint16) + (off-t-1 uint16) ) - :method-count-assert 9 - :size-assert #x7c - :flag-assert #x90000007c ) ;; definition for method 3 of type sky-tng-data -(defmethod inspect sky-tng-data ((this sky-tng-data)) +(defmethod inspect ((this sky-tng-data)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tgiftag-base: #~%" (-> this giftag-base)) (format #t "~Tgiftag-roof: #~%" (-> this giftag-roof)) @@ -249,19 +222,16 @@ ;; definition of type sky-work (deftype sky-work (structure) - ((adgif-tmpl dma-gif-packet :inline :offset-assert 0) - (draw-tmpl dma-gif-packet :inline :offset-assert 32) - (blend-tmpl dma-gif-packet :inline :offset-assert 64) - (sky-data qword 5 :inline :offset-assert 96) - (cloud-data qword 5 :inline :offset-assert 176) + ((adgif-tmpl dma-gif-packet :inline) + (draw-tmpl dma-gif-packet :inline) + (blend-tmpl dma-gif-packet :inline) + (sky-data qword 5 :inline) + (cloud-data qword 5 :inline) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; definition for method 3 of type sky-work -(defmethod inspect sky-work ((this sky-work)) +(defmethod inspect ((this sky-work)) (format #t "[~8x] ~A~%" this 'sky-work) (format #t "~Tadgif-tmpl: #~%" (-> this adgif-tmpl)) (format #t "~Tdraw-tmpl: #~%" (-> this draw-tmpl)) @@ -273,17 +243,15 @@ ;; definition of type sky-vertex (deftype sky-vertex (structure) - ((pos vector :inline :offset-assert 0) - (stq vector :inline :offset-assert 16) - (col vector :inline :offset-assert 32) + ((pos vector :inline) + (stq vector :inline) + (col vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type sky-vertex -(defmethod inspect sky-vertex ((this sky-vertex)) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this sky-vertex)) (format #t "[~8x] ~A~%" this 'sky-vertex) (format #t "~Tpos: #~%" (-> this pos)) (format #t "~Tstq: #~%" (-> this stq)) diff --git a/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc index 0bb7a3446a0..35a459c1265 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc @@ -123,7 +123,8 @@ (init-sky-tng-data *sky-tng-data*) ;; definition for method 3 of type sky-vertex -(defmethod inspect sky-vertex ((this sky-vertex)) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this sky-vertex)) (format #t "sky-vertex [~X]:~%" this) (format #t "~TPos: [~F ~F ~F ~F]~%" (-> this pos x) (-> this pos y) (-> this pos z) (-> this pos w)) (format #t "~TSTQ: [~F ~F ~F ~F]~%" (-> this stq x) (-> this stq y) (-> this stq z) (-> this stq w)) diff --git a/test/decompiler/reference/jak1/engine/gfx/sky/sky_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sky/sky_REF.gc index 93ca413333e..b80ea5a6f06 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sky/sky_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sky/sky_REF.gc @@ -83,29 +83,26 @@ ;; definition of type sky-frame-data (deftype sky-frame-data (structure) - ((data uint128 18 :offset-assert 0) - (world-homo-matrix matrix :inline :offset 0) - (hmge-scale vector :inline :offset 64) - (hvdf-offset vector :inline :offset 80) - (consts vector :inline :offset 96) - (pfog0 float :offset 96) - (radius float :offset 100) - (nokick float :offset 108) - (strip-giftag qword :inline :offset 112) - (col-adgif qword :inline :offset 128) - (save uint128 5 :offset 144) - (sun-fan-giftag qword :inline :offset 224) - (sun-strip-giftag qword :inline :offset 240) - (sun-alpha qword :inline :offset 256) - (sun-alpha-giftag qword :inline :offset 272) + ((data uint128 18) + (world-homo-matrix matrix :inline :overlay-at (-> data 0)) + (hmge-scale vector :inline :overlay-at (-> data 4)) + (hvdf-offset vector :inline :overlay-at (-> data 5)) + (consts vector :inline :overlay-at (-> data 6)) + (pfog0 float :overlay-at (-> data 6)) + (radius float :overlay-at (-> consts y)) + (nokick float :overlay-at (-> consts w)) + (strip-giftag qword :inline :overlay-at (-> data 7)) + (col-adgif qword :inline :overlay-at (-> data 8)) + (save uint128 5 :overlay-at (-> data 9)) + (sun-fan-giftag qword :inline :overlay-at (-> data 14)) + (sun-strip-giftag qword :inline :overlay-at (-> data 15)) + (sun-alpha qword :inline :overlay-at (-> data 16)) + (sun-alpha-giftag qword :inline :overlay-at (-> data 17)) ) - :method-count-assert 9 - :size-assert #x120 - :flag-assert #x900000120 ) ;; definition for method 3 of type sky-frame-data -(defmethod inspect sky-frame-data ((this sky-frame-data)) +(defmethod inspect ((this sky-frame-data)) (format #t "[~8x] ~A~%" this 'sky-frame-data) (format #t "~Tdata[18] @ #x~X~%" (-> this data)) (format #t "~Tworld-homo-matrix: #~%" (-> this data)) diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-h_REF.gc index f792a70081d..f272c937433 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-h_REF.gc @@ -12,45 +12,42 @@ ;; definition of type sparticle-cpuinfo (deftype sparticle-cpuinfo (structure) - ((sprite sprite-vec-data-2d :offset-assert 0) - (adgif adgif-shader :offset-assert 4) - (radius float :offset-assert 8) - (omega float :offset-assert 12) - (vel-sxvel vector :inline :offset-assert 16) - (rot-syvel vector :inline :offset-assert 32) - (fade rgbaf :inline :offset-assert 48) - (acc vector :inline :offset-assert 64) - (rotvel3d quaternion :inline :offset-assert 80) - (vel vector3s :inline :offset 16) - (accel vector3s :inline :offset 64) - (scalevelx float :offset 28) - (scalevely float :offset 44) - (friction float :offset-assert 96) - (timer int32 :offset-assert 100) - (flags sp-cpuinfo-flag :offset-assert 104) - (user-int32 int32 :offset-assert 108) - (user-uint32 uint32 :offset 108) - (user-float float :offset 108) - (user-pntr uint32 :offset 108) - (user-sprite sprite-vec-data-2d :offset 108) - (func basic :offset-assert 112) - (next-time uint32 :offset-assert 116) - (next-launcher basic :offset-assert 120) - (cache-alpha float :offset-assert 124) - (valid symbol :offset-assert 128) - (key sparticle-launch-control :offset-assert 132) - (binding sparticle-launch-state :offset-assert 136) - (data uint32 1 :offset 12) - (dataf float 1 :offset 12) - (datac uint8 1 :offset 12) + ((sprite sprite-vec-data-2d) + (adgif adgif-shader) + (radius float) + (omega float) + (vel-sxvel vector :inline) + (rot-syvel vector :inline) + (fade rgbaf :inline) + (acc vector :inline) + (rotvel3d quaternion :inline) + (vel vector3s :inline :overlay-at (-> vel-sxvel x)) + (accel vector3s :inline :overlay-at (-> acc x)) + (scalevelx float :overlay-at (-> vel-sxvel w)) + (scalevely float :overlay-at (-> rot-syvel w)) + (friction float) + (timer int32) + (flags sp-cpuinfo-flag) + (user-int32 int32) + (user-uint32 uint32 :overlay-at user-int32) + (user-float float :overlay-at user-int32) + (user-pntr uint32 :overlay-at user-int32) + (user-sprite sprite-vec-data-2d :overlay-at user-int32) + (func basic) + (next-time uint32) + (next-launcher basic) + (cache-alpha float) + (valid symbol) + (key sparticle-launch-control) + (binding sparticle-launch-state) + (data uint32 1 :overlay-at omega) + (dataf float 1 :overlay-at omega) + (datac uint8 1 :overlay-at omega) ) - :method-count-assert 9 - :size-assert #x8c - :flag-assert #x90000008c ) ;; definition for method 3 of type sparticle-cpuinfo -(defmethod inspect sparticle-cpuinfo ((this sparticle-cpuinfo)) +(defmethod inspect ((this sparticle-cpuinfo)) (format #t "[~8x] ~A~%" this 'sparticle-cpuinfo) (format #t "~Tsprite: #~%" (-> this sprite)) (format #t "~Tadgif: #~%" (-> this adgif)) @@ -88,19 +85,16 @@ ;; definition of type sparticle-launchinfo (deftype sparticle-launchinfo (structure) - ((launchrot vector :inline :offset-assert 0) - (conerot vector :inline :offset-assert 16) - (coneradius float :offset-assert 32) - (rotate-y float :offset-assert 36) - (data uint8 1 :offset 0) + ((launchrot vector :inline) + (conerot vector :inline) + (coneradius float) + (rotate-y float) + (data uint8 1 :overlay-at (-> launchrot x)) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; definition for method 3 of type sparticle-launchinfo -(defmethod inspect sparticle-launchinfo ((this sparticle-launchinfo)) +(defmethod inspect ((this sparticle-launchinfo)) (format #t "[~8x] ~A~%" this 'sparticle-launchinfo) (format #t "~Tlaunchrot: #~%" (-> this launchrot)) (format #t "~Tconerot: #~%" (-> this conerot)) @@ -112,26 +106,23 @@ ;; definition of type sparticle-system (deftype sparticle-system (basic) - ((blocks int32 2 :offset-assert 4) - (length int32 2 :offset-assert 12) - (num-alloc int32 2 :offset-assert 20) - (is-3d basic :offset-assert 28) - (flags uint32 :offset-assert 32) - (alloc-table (pointer uint64) :offset-assert 36) - (cpuinfo-table (inline-array sparticle-cpuinfo) :offset-assert 40) - (vecdata-table pointer :offset-assert 44) - (adgifdata-table (inline-array adgif-shader) :offset-assert 48) + ((blocks int32 2) + (length int32 2) + (num-alloc int32 2) + (is-3d basic) + (flags uint32) + (alloc-table (pointer uint64)) + (cpuinfo-table (inline-array sparticle-cpuinfo)) + (vecdata-table pointer) + (adgifdata-table (inline-array adgif-shader)) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 (:methods - (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_ 0) + (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_) ) ) ;; definition for method 3 of type sparticle-system -(defmethod inspect sparticle-system ((this sparticle-system)) +(defmethod inspect ((this sparticle-system)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tblocks[2] @ #x~X~%" (-> this blocks)) (format #t "~Tlength[2] @ #x~X~%" (-> this length)) diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h_REF.gc index 11da02f884a..765336ca4c9 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h_REF.gc @@ -3,27 +3,24 @@ ;; definition of type sp-field-init-spec (deftype sp-field-init-spec (structure) - ((field sp-field-id :offset-assert 0) - (flags sp-flag :offset-assert 2) - (initial-valuef float :offset-assert 4) - (random-rangef float :offset-assert 8) - (random-multf float :offset-assert 12) - (initial-value int32 :offset 4) - (random-range int32 :offset 8) - (random-mult int32 :offset 12) - (func symbol :offset 4) - (tex texture-id :offset 4) - (pntr pointer :offset 4) - (sym symbol :offset 4) - (sound sound-spec :offset 4) + ((field sp-field-id) + (flags sp-flag) + (initial-valuef float) + (random-rangef float) + (random-multf float) + (initial-value int32 :overlay-at initial-valuef) + (random-range int32 :overlay-at random-rangef) + (random-mult int32 :overlay-at random-multf) + (func symbol :overlay-at initial-valuef) + (tex texture-id :overlay-at initial-valuef) + (pntr pointer :overlay-at initial-valuef) + (sym symbol :overlay-at initial-valuef) + (sound sound-spec :overlay-at initial-valuef) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type sp-field-init-spec -(defmethod inspect sp-field-init-spec ((this sp-field-init-spec)) +(defmethod inspect ((this sp-field-init-spec)) (format #t "[~8x] ~A~%" this 'sp-field-init-spec) (format #t "~Tfield: ~D~%" (-> this field)) (format #t "~Tflags: ~D~%" (-> this flags)) @@ -43,17 +40,15 @@ ;; definition of type sparticle-launcher (deftype sparticle-launcher (basic) - ((birthaccum float :offset-assert 4) - (soundaccum float :offset-assert 8) - (init-specs (inline-array sp-field-init-spec) :offset-assert 12) + ((birthaccum float) + (soundaccum float) + (init-specs (inline-array sp-field-init-spec)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type sparticle-launcher -(defmethod inspect sparticle-launcher ((this sparticle-launcher)) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this sparticle-launcher)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tbirthaccum: ~f~%" (-> this birthaccum)) (format #t "~Tsoundaccum: ~f~%" (-> this soundaccum)) @@ -63,23 +58,20 @@ ;; definition of type sparticle-group-item (deftype sparticle-group-item (structure) - ((launcher uint32 :offset-assert 0) - (fade-after meters :offset-assert 4) - (falloff-to meters :offset-assert 8) - (flags sp-group-item-flag :offset-assert 12) - (period uint16 :offset-assert 14) - (length uint16 :offset-assert 16) - (offset uint16 :offset-assert 18) - (hour-mask uint32 :offset-assert 20) - (binding uint32 :offset-assert 24) + ((launcher uint32) + (fade-after meters) + (falloff-to meters) + (flags sp-group-item-flag) + (period uint16) + (length uint16) + (offset uint16) + (hour-mask uint32) + (binding uint32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type sparticle-group-item -(defmethod inspect sparticle-group-item ((this sparticle-group-item)) +(defmethod inspect ((this sparticle-group-item)) (format #t "[~8x] ~A~%" this 'sparticle-group-item) (format #t "~Tlauncher: ~D~%" (-> this launcher)) (format #t "~Tfade-after: (meters ~m)~%" (-> this fade-after)) @@ -95,28 +87,25 @@ ;; definition of type sparticle-launch-state (deftype sparticle-launch-state (structure) - ((group-item sparticle-group-item :offset-assert 0) - (flags sp-launch-state-flags :offset-assert 4) - (randomize uint16 :offset-assert 6) - (origin vector :offset-assert 8) - (sprite3d sprite-vec-data-3d :offset-assert 12) - (sprite sparticle-cpuinfo :offset-assert 16) - (offset uint32 :offset-assert 20) - (accum float :offset-assert 24) - (spawn-time uint32 :offset-assert 28) - (swarm basic :offset 20) - (seed uint32 :offset 24) - (time uint32 :offset 28) - (spec basic :offset 16) - (id uint32 :offset 12) + ((group-item sparticle-group-item) + (flags sp-launch-state-flags) + (randomize uint16) + (origin vector) + (sprite3d sprite-vec-data-3d) + (sprite sparticle-cpuinfo) + (offset uint32) + (accum float) + (spawn-time uint32) + (swarm basic :overlay-at offset) + (seed uint32 :overlay-at accum) + (time uint32 :overlay-at spawn-time) + (spec basic :overlay-at sprite) + (id uint32 :overlay-at sprite3d) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sparticle-launch-state -(defmethod inspect sparticle-launch-state ((this sparticle-launch-state)) +(defmethod inspect ((this sparticle-launch-state)) (format #t "[~8x] ~A~%" this 'sparticle-launch-state) (format #t "~Tgroup-item: #~%" (-> this group-item)) (format #t "~Tflags: ~D~%" (-> this flags)) @@ -137,24 +126,21 @@ ;; definition of type sparticle-launch-group (deftype sparticle-launch-group (basic) - ((length int16 :offset-assert 4) - (duration uint16 :offset-assert 6) - (linger-duration uint16 :offset-assert 8) - (flags sp-group-flag :offset-assert 10) - (name string :offset-assert 12) - (launcher (inline-array sparticle-group-item) :offset-assert 16) - (bounds sphere :inline :offset-assert 32) + ((length int16) + (duration uint16) + (linger-duration uint16) + (flags sp-group-flag) + (name string) + (launcher (inline-array sparticle-group-item)) + (bounds sphere :inline) ) - :method-count-assert 10 - :size-assert #x30 - :flag-assert #xa00000030 (:methods - (create-launch-control (_type_ process) sparticle-launch-control 9) + (create-launch-control (_type_ process) sparticle-launch-control) ) ) ;; definition for method 3 of type sparticle-launch-group -(defmethod inspect sparticle-launch-group ((this sparticle-launch-group)) +(defmethod inspect ((this sparticle-launch-group)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tduration: ~D~%" (-> this duration)) @@ -168,30 +154,27 @@ ;; definition of type sparticle-launch-control (deftype sparticle-launch-control (inline-array-class) - ((group sparticle-launch-group :offset-assert 16) - (proc process :offset-assert 20) - (local-clock int32 :offset-assert 24) - (fade float :offset-assert 28) - (matrix int32 :offset-assert 32) - (last-spawn-frame int32 :offset-assert 36) - (last-spawn-time int32 :offset-assert 40) - (center vector :inline :offset-assert 48) - (data sparticle-launch-state :inline :dynamic :offset-assert 64) + ((group sparticle-launch-group) + (proc process) + (local-clock int32) + (fade float) + (matrix int32) + (last-spawn-frame int32) + (last-spawn-time int32) + (center vector :inline) + (data sparticle-launch-state :inline :dynamic) ) - :method-count-assert 14 - :size-assert #x40 - :flag-assert #xe00000040 (:methods - (initialize (_type_ sparticle-launch-group process) none 9) - (is-visible? (_type_ vector) symbol 10) - (spawn (_type_ vector) object 11) - (kill-and-free-particles (_type_) none 12) - (kill-particles (_type_) none 13) + (initialize (_type_ sparticle-launch-group process) none) + (is-visible? (_type_ vector) symbol) + (spawn (_type_ vector) object) + (kill-and-free-particles (_type_) none) + (kill-particles (_type_) none) ) ) ;; definition for method 3 of type sparticle-launch-control -(defmethod inspect sparticle-launch-control ((this sparticle-launch-control)) +(defmethod inspect ((this sparticle-launch-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher_REF.gc index 578b0470636..d92b49e0cf2 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher_REF.gc @@ -6,23 +6,20 @@ ;; definition of type sparticle-birthinfo (deftype sparticle-birthinfo (structure) - ((sprite uint32 :offset-assert 0) - (anim int32 :offset-assert 4) - (anim-speed float :offset-assert 8) - (birth-func basic :offset-assert 12) - (joint-ppoint int32 :offset-assert 16) - (num-to-birth float :offset-assert 20) - (sound basic :offset-assert 24) - (dataf float 1 :offset 0) - (data uint32 1 :offset 0) + ((sprite uint32) + (anim int32) + (anim-speed float) + (birth-func basic) + (joint-ppoint int32) + (num-to-birth float) + (sound basic) + (dataf float 1 :overlay-at sprite) + (data uint32 1 :overlay-at sprite) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type sparticle-birthinfo -(defmethod inspect sparticle-birthinfo ((this sparticle-birthinfo)) +(defmethod inspect ((this sparticle-birthinfo)) (format #t "[~8x] ~A~%" this 'sparticle-birthinfo) (format #t "~Tsprite: ~D~%" (-> this sprite)) (format #t "~Tanim: ~D~%" (-> this anim)) @@ -37,8 +34,9 @@ ) ;; definition for method 3 of type sparticle-launcher +;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs sparticle-launcher. -(defmethod inspect sparticle-launcher ((this sparticle-launcher)) +(defmethod inspect ((this sparticle-launcher)) (format #t "~X: sparticle-launcher~%" this) (let ((s5-0 0)) (while (!= (-> this init-specs s5-0 field) (sp-field-id spt-end)) @@ -343,17 +341,14 @@ ;; definition of type sp-queued-launch-particles (deftype sp-queued-launch-particles (structure) - ((sp-system sparticle-system :offset-assert 0) - (sp-launcher sparticle-launcher :offset-assert 4) - (pos vector :inline :offset-assert 16) + ((sp-system sparticle-system) + (sp-launcher sparticle-launcher) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sp-queued-launch-particles -(defmethod inspect sp-queued-launch-particles ((this sp-queued-launch-particles)) +(defmethod inspect ((this sp-queued-launch-particles)) (format #t "[~8x] ~A~%" this 'sp-queued-launch-particles) (format #t "~Tsp-system: ~A~%" (-> this sp-system)) (format #t "~Tsp-launcher: ~A~%" (-> this sp-launcher)) @@ -363,16 +358,13 @@ ;; definition of type sp-launch-queue (deftype sp-launch-queue (basic) - ((in-use int32 :offset-assert 4) - (queue sp-queued-launch-particles 32 :inline :offset-assert 16) + ((in-use int32) + (queue sp-queued-launch-particles 32 :inline) ) - :method-count-assert 9 - :size-assert #x410 - :flag-assert #x900000410 ) ;; definition for method 3 of type sp-launch-queue -(defmethod inspect sp-launch-queue ((this sp-launch-queue)) +(defmethod inspect ((this sp-launch-queue)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tin-use: ~D~%" (-> this in-use)) (format #t "~Tqueue[32] @ #x~X~%" (-> this queue)) @@ -411,19 +403,16 @@ ;; definition of type particle-adgif-cache (deftype particle-adgif-cache (basic) - ((used int32 :offset-assert 4) - (last uint16 :offset-assert 8) - (lastgif adgif-shader :offset-assert 12) - (tidhash uint16 80 :offset-assert 16) - (spadgif adgif-shader 80 :inline :offset-assert 176) + ((used int32) + (last uint16) + (lastgif adgif-shader) + (tidhash uint16 80) + (spadgif adgif-shader 80 :inline) ) - :method-count-assert 9 - :size-assert #x19b0 - :flag-assert #x9000019b0 ) ;; definition for method 3 of type particle-adgif-cache -(defmethod inspect particle-adgif-cache ((this particle-adgif-cache)) +(defmethod inspect ((this particle-adgif-cache)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tused: ~D~%" (-> this used)) (format #t "~Tlast: ~D~%" (-> this last)) @@ -885,7 +874,7 @@ ;; definition for method 9 of type sparticle-launch-control ;; INFO: Return type mismatch int vs none. -(defmethod initialize sparticle-launch-control ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) +(defmethod initialize ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) (let ((s5-0 0)) (set! (-> this group) arg0) (set! (-> this proc) arg1) @@ -938,7 +927,7 @@ ;; definition for method 9 of type sparticle-launch-group ;; INFO: Return type mismatch object vs sparticle-launch-control. -(defmethod create-launch-control sparticle-launch-group ((this sparticle-launch-group) (arg0 process)) +(defmethod create-launch-control ((this sparticle-launch-group) (arg0 process)) (let ((gp-0 (the-as object (new 'process 'sparticle-launch-control (-> this length))))) (when (zero? (the-as sparticle-launch-control gp-0)) (go process-drawable-art-error "memory") @@ -953,7 +942,7 @@ ;; definition for method 12 of type sparticle-launch-control ;; INFO: Return type mismatch int vs none. -(defmethod kill-and-free-particles sparticle-launch-control ((this sparticle-launch-control)) +(defmethod kill-and-free-particles ((this sparticle-launch-control)) (countdown (v1-0 (-> this length)) (let ((a0-3 (-> this data v1-0))) (logclear! (-> a0-3 flags) (sp-launch-state-flags particles-active)) @@ -971,14 +960,14 @@ ;; definition for method 13 of type sparticle-launch-control ;; INFO: Return type mismatch int vs none. -(defmethod kill-particles sparticle-launch-control ((this sparticle-launch-control)) +(defmethod kill-particles ((this sparticle-launch-control)) (kill-all-particles-with-key this) 0 (none) ) ;; definition for method 10 of type sparticle-launch-control -(defmethod is-visible? sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) +(defmethod is-visible? ((this sparticle-launch-control) (arg0 vector)) (let* ((v1-0 (-> this group)) (f0-0 (-> v1-0 bounds w)) ) @@ -1005,7 +994,7 @@ ;; definition for method 11 of type sparticle-launch-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs object. -(defmethod spawn sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) +(defmethod spawn ((this sparticle-launch-control) (arg0 vector)) (set! (-> this center quad) (-> arg0 quad)) (if (not (or (is-visible? this arg0) (logtest? (-> this group flags) (sp-group-flag always-draw screen-space)))) (return (the-as object 0)) diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle_REF.gc index 3ac271ef20e..e577d18fcda 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 2 of type sparticle-cpuinfo ;; INFO: Return type mismatch object vs sparticle-cpuinfo. -(defmethod print sparticle-cpuinfo ((this sparticle-cpuinfo)) +(defmethod print ((this sparticle-cpuinfo)) (format #t "~%") (dotimes (s5-0 16) (format #t "~D:~F~%" s5-0 (the-as float (-> this data s5-0))) diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-distort_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-distort_REF.gc index 8c2b95aa334..29849fcc0ae 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-distort_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-distort_REF.gc @@ -3,20 +3,17 @@ ;; definition of type sprite-distorter-sine-tables (deftype sprite-distorter-sine-tables (basic) - ((aspx float :offset-assert 4) - (aspy float :offset-assert 8) - (entry vector 128 :inline :offset-assert 16) - (ientry qword 9 :inline :offset-assert 2064) - (giftag gs-gif-tag :inline :offset-assert 2208) - (color qword :inline :offset-assert 2224) + ((aspx float) + (aspy float) + (entry vector 128 :inline) + (ientry qword 9 :inline) + (giftag gs-gif-tag :inline) + (color qword :inline) ) - :method-count-assert 9 - :size-assert #x8c0 - :flag-assert #x9000008c0 ) ;; definition for method 3 of type sprite-distorter-sine-tables -(defmethod inspect sprite-distorter-sine-tables ((this sprite-distorter-sine-tables)) +(defmethod inspect ((this sprite-distorter-sine-tables)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Taspx: ~f~%" (-> this aspx)) (format #t "~Taspy: ~f~%" (-> this aspy)) @@ -33,67 +30,73 @@ ;; definition for function sprite-distorter-generate-tables ;; INFO: Return type mismatch int vs none. (defun sprite-distorter-generate-tables () - (let ((gp-0 *sprite-distorter-sine-tables*)) - (let ((s3-0 0) - (s5-0 0) - (s4-0 3) - (f28-0 (- (-> *math-camera* perspective vector 0 x))) - (f30-0 (- (-> *math-camera* perspective vector 1 y))) + (let ((tables *sprite-distorter-sine-tables*)) + (let ((entry-index 0) + (ientry-index 0) + (iterations 3) + (cam-aspx (- (-> *math-camera* perspective vector 0 x))) + (cam-aspy (- (-> *math-camera* perspective vector 1 y))) ) - (when (or (!= f28-0 (-> gp-0 aspx)) (!= f30-0 (-> gp-0 aspy))) - (set! (-> gp-0 aspx) f28-0) - (set! (-> gp-0 aspy) f30-0) - (while (< s4-0 12) - (set! (-> gp-0 ientry s5-0 vector4w x) (+ s3-0 352)) - (+! s5-0 1) - (dotimes (s2-0 s4-0) - (let ((f26-0 (* 65536.0 (/ (the float s2-0) (the float s4-0))))) - (set-vector! (-> gp-0 entry s3-0) (* (sin f26-0) f28-0) (* (cos f26-0) f30-0) 0.0 0.0) - (let ((s3-1 (+ s3-0 1))) - (set-vector! (-> gp-0 entry s3-1) (* 0.001953125 f28-0 (sin f26-0)) (* 0.00390625 f30-0 (cos f26-0)) 0.0 0.0) - (set! s3-0 (+ s3-1 1)) + (when (or (!= cam-aspx (-> tables aspx)) (!= cam-aspy (-> tables aspy))) + (set! (-> tables aspx) cam-aspx) + (set! (-> tables aspy) cam-aspy) + (while (< iterations 12) + (set! (-> tables ientry ientry-index vector4w x) (+ entry-index 352)) + (+! ientry-index 1) + (dotimes (i iterations) + (let ((f26-0 (* 65536.0 (/ (the float i) (the float iterations))))) + (set-vector! (-> tables entry entry-index) (* (sin f26-0) cam-aspx) (* (cos f26-0) cam-aspy) 0.0 0.0) + (let ((s3-1 (+ entry-index 1))) + (set-vector! + (-> tables entry s3-1) + (* 0.001953125 cam-aspx (sin f26-0)) + (* 0.00390625 cam-aspy (cos f26-0)) + 0.0 + 0.0 + ) + (set! entry-index (+ s3-1 1)) ) ) ) - (+! s4-0 1) + (+! iterations 1) ) - (set-vector! (-> gp-0 entry s3-0) 0.0 f30-0 0.0 0.0) - (let ((v1-17 (+ s3-0 1))) - (set-vector! (-> gp-0 entry v1-17) 0.0 (* 0.00390625 f30-0) 0.0 0.0) + (set-vector! (-> tables entry entry-index) 0.0 cam-aspy 0.0 0.0) + (let ((v1-17 (+ entry-index 1))) + (set-vector! (-> tables entry v1-17) 0.0 (* 0.00390625 cam-aspy) 0.0 0.0) (+ v1-17 1) ) ) ) - (set! (-> gp-0 giftag tag) (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :tme #x1) - :nreg #xf - ) + (set! (-> tables giftag tag) (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :tme #x1) + :nreg #xf + ) ) - (set! (-> gp-0 giftag regs) (new 'static 'gif-tag-regs - :regs0 (gif-reg-id st) - :regs1 (gif-reg-id rgbaq) - :regs2 (gif-reg-id xyzf2) - :regs3 (gif-reg-id st) - :regs4 (gif-reg-id rgbaq) - :regs5 (gif-reg-id xyzf2) - :regs6 (gif-reg-id st) - :regs7 (gif-reg-id rgbaq) - :regs8 (gif-reg-id xyzf2) - :regs9 (gif-reg-id st) - :regs10 (gif-reg-id rgbaq) - :regs11 (gif-reg-id xyzf2) - :regs12 (gif-reg-id st) - :regs13 (gif-reg-id rgbaq) - :regs14 (gif-reg-id xyzf2) - ) + (set! (-> tables giftag regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id st) + :regs1 (gif-reg-id rgbaq) + :regs2 (gif-reg-id xyzf2) + :regs3 (gif-reg-id st) + :regs4 (gif-reg-id rgbaq) + :regs5 (gif-reg-id xyzf2) + :regs6 (gif-reg-id st) + :regs7 (gif-reg-id rgbaq) + :regs8 (gif-reg-id xyzf2) + :regs9 (gif-reg-id st) + :regs10 (gif-reg-id rgbaq) + :regs11 (gif-reg-id xyzf2) + :regs12 (gif-reg-id st) + :regs13 (gif-reg-id rgbaq) + :regs14 (gif-reg-id xyzf2) + ) ) - (set! (-> gp-0 color vector4w x) 128) - (set! (-> gp-0 color vector4w y) 128) - (set! (-> gp-0 color vector4w z) 128) - (set! (-> gp-0 color vector4w w) 128) + (set! (-> tables color vector4w x) 128) + (set! (-> tables color vector4w y) 128) + (set! (-> tables color vector4w z) 128) + (set! (-> tables color vector4w w) 128) ) 0 (none) diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-h_REF.gc index 75925efd109..6b3d12c139a 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-h_REF.gc @@ -3,34 +3,31 @@ ;; definition of type sprite-vec-data-2d (deftype sprite-vec-data-2d (structure) - ((x-y-z-sx vector :inline :offset-assert 0) - (flag-rot-sy vector :inline :offset-assert 16) - (r-g-b-a vector :inline :offset-assert 32) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (sx float :offset 12) - (sy float :offset 28) - (rot float :offset 24) - (flag int32 :offset 16) - (matrix int32 :offset 20) - (warp-turns int32 :offset 16) - (r float :offset 32) - (g float :offset 36) - (b float :offset 40) - (a float :offset 44) - (trans vector3s :inline :offset 0) - (color rgbaf :inline :offset 32) - (data uint128 1 :offset 0) - (data64 uint64 6 :offset 0) + ((x-y-z-sx vector :inline) + (flag-rot-sy vector :inline) + (r-g-b-a vector :inline) + (x float :overlay-at (-> x-y-z-sx x)) + (y float :overlay-at (-> x-y-z-sx y)) + (z float :overlay-at (-> x-y-z-sx z)) + (sx float :overlay-at (-> x-y-z-sx w)) + (sy float :overlay-at (-> flag-rot-sy w)) + (rot float :overlay-at (-> flag-rot-sy z)) + (flag int32 :overlay-at (-> flag-rot-sy x)) + (matrix int32 :overlay-at (-> flag-rot-sy y)) + (warp-turns int32 :overlay-at (-> flag-rot-sy x)) + (r float :overlay-at (-> r-g-b-a x)) + (g float :overlay-at (-> r-g-b-a y)) + (b float :overlay-at (-> r-g-b-a z)) + (a float :overlay-at (-> r-g-b-a w)) + (trans vector3s :inline :overlay-at (-> x-y-z-sx x)) + (color rgbaf :inline :overlay-at (-> r-g-b-a x)) + (data uint128 1 :overlay-at (-> x-y-z-sx quad)) + (data64 uint64 6 :overlay-at (-> x-y-z-sx x)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type sprite-vec-data-2d -(defmethod inspect sprite-vec-data-2d ((this sprite-vec-data-2d)) +(defmethod inspect ((this sprite-vec-data-2d)) (format #t "[~8x] ~A~%" this 'sprite-vec-data-2d) (format #t "~Tx-y-z-sx: #~%" (&-> this x)) (format #t "~Tflag-rot-sy: #~%" (&-> this flag)) @@ -57,23 +54,20 @@ ;; definition of type sprite-array-2d (deftype sprite-array-2d (basic) - ((num-sprites int32 2 :offset-assert 4) - (num-valid int32 2 :offset-assert 12) - (vec-data pointer :offset-assert 20) - (adgif-data (inline-array adgif-shader) :offset-assert 24) - (pad uint128 4 :offset-assert 32) - (data uint128 1 :offset-assert 96) + ((num-sprites int32 2) + (num-valid int32 2) + (vec-data pointer) + (adgif-data (inline-array adgif-shader)) + (pad uint128 4) + (data uint128 1) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 (:methods - (new (symbol type int int) _type_ 0) + (new (symbol type int int) _type_) ) ) ;; definition for method 3 of type sprite-array-2d -(defmethod inspect sprite-array-2d ((this sprite-array-2d)) +(defmethod inspect ((this sprite-array-2d)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tnum-sprites[2] @ #x~X~%" (-> this num-sprites)) (format #t "~Tnum-valid[2] @ #x~X~%" (-> this num-valid)) @@ -86,33 +80,30 @@ ;; definition of type sprite-vec-data-3d (deftype sprite-vec-data-3d (structure) - ((x-y-z-sx vector :inline :offset-assert 0) - (qx-qy-qz-sy vector :inline :offset-assert 16) - (r-g-b-a vector :inline :offset-assert 32) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (sx float :offset 12) - (sy float :offset 28) - (qx float :offset 16) - (qy float :offset 20) - (qz float :offset 24) - (r float :offset 32) - (g float :offset 36) - (b float :offset 40) - (a float :offset 44) - (trans vector3s :inline :offset 0) - (rot vector3s :inline :offset 16) - (color rgbaf :inline :offset 32) - (data uint128 1 :offset 0) + ((x-y-z-sx vector :inline) + (qx-qy-qz-sy vector :inline) + (r-g-b-a vector :inline) + (x float :overlay-at (-> x-y-z-sx x)) + (y float :overlay-at (-> x-y-z-sx y)) + (z float :overlay-at (-> x-y-z-sx z)) + (sx float :overlay-at (-> x-y-z-sx w)) + (sy float :overlay-at (-> qx-qy-qz-sy w)) + (qx float :overlay-at (-> qx-qy-qz-sy x)) + (qy float :overlay-at (-> qx-qy-qz-sy y)) + (qz float :overlay-at (-> qx-qy-qz-sy z)) + (r float :overlay-at (-> r-g-b-a x)) + (g float :overlay-at (-> r-g-b-a y)) + (b float :overlay-at (-> r-g-b-a z)) + (a float :overlay-at (-> r-g-b-a w)) + (trans vector3s :inline :overlay-at (-> x-y-z-sx x)) + (rot vector3s :inline :overlay-at (-> qx-qy-qz-sy x)) + (color rgbaf :inline :overlay-at (-> r-g-b-a x)) + (data uint128 1 :overlay-at (-> x-y-z-sx quad)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type sprite-vec-data-3d -(defmethod inspect sprite-vec-data-3d ((this sprite-vec-data-3d)) +(defmethod inspect ((this sprite-vec-data-3d)) (format #t "[~8x] ~A~%" this 'sprite-vec-data-3d) (format #t "~Tx-y-z-sx: #~%" (-> this x-y-z-sx)) (format #t "~Tqx-qy-qz-sy: #~%" (-> this qx-qy-qz-sy)) @@ -138,22 +129,19 @@ ;; definition of type sprite-array-3d (deftype sprite-array-3d (basic) - ((num-sprites int32 2 :offset-assert 4) - (num-valid int32 2 :offset-assert 12) - (vec-data pointer :offset-assert 20) - (adgif-data (inline-array adgif-shader) :offset-assert 24) - (data uint128 1 :offset-assert 32) + ((num-sprites int32 2) + (num-valid int32 2) + (vec-data pointer) + (adgif-data (inline-array adgif-shader)) + (data uint128 1) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 (:methods - (new (symbol type int int) _type_ 0) + (new (symbol type int int) _type_) ) ) ;; definition for method 3 of type sprite-array-3d -(defmethod inspect sprite-array-3d ((this sprite-array-3d)) +(defmethod inspect ((this sprite-array-3d)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tnum-sprites[2] @ #x~X~%" (-> this num-sprites)) (format #t "~Tnum-valid[2] @ #x~X~%" (-> this num-valid)) diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite_REF.gc index 6888f8832a8..f2f267a6050 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite_REF.gc @@ -3,16 +3,13 @@ ;; definition of type sprite-header (deftype sprite-header (structure) - ((header qword 1 :inline :offset-assert 0) - (num-sprites int32 :offset 0) + ((header qword 1 :inline) + (num-sprites int32 :overlay-at (-> header 0 data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type sprite-header -(defmethod inspect sprite-header ((this sprite-header)) +(defmethod inspect ((this sprite-header)) (format #t "[~8x] ~A~%" this 'sprite-header) (format #t "~Theader[1] @ #x~X~%" (-> this header)) (format #t "~Tnum-sprites: ~D~%" (-> this num-sprites)) @@ -28,15 +25,12 @@ ;; definition of type sprite-hvdf-data (deftype sprite-hvdf-data (structure) - ((data qword 76 :inline :offset-assert 0) + ((data qword 76 :inline) ) - :method-count-assert 9 - :size-assert #x4c0 - :flag-assert #x9000004c0 ) ;; definition for method 3 of type sprite-hvdf-data -(defmethod inspect sprite-hvdf-data ((this sprite-hvdf-data)) +(defmethod inspect ((this sprite-hvdf-data)) (format #t "[~8x] ~A~%" this 'sprite-hvdf-data) (format #t "~Tdata[76] @ #x~X~%" (-> this data)) this @@ -44,15 +38,12 @@ ;; definition of type sprite-hvdf-control (deftype sprite-hvdf-control (structure) - ((alloc int8 76 :offset-assert 0) + ((alloc int8 76) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) ;; definition for method 3 of type sprite-hvdf-control -(defmethod inspect sprite-hvdf-control ((this sprite-hvdf-control)) +(defmethod inspect ((this sprite-hvdf-control)) (format #t "[~8x] ~A~%" this 'sprite-hvdf-control) (format #t "~Talloc[76] @ #x~X~%" (-> this alloc)) this @@ -74,21 +65,18 @@ ;; definition of type sprite-aux-list (deftype sprite-aux-list (basic) - ((num-entries int32 :offset-assert 4) - (entry int32 :offset-assert 8) - (data sprite-vec-data-2d 1 :offset-assert 12) + ((num-entries int32) + (entry int32) + (data sprite-vec-data-2d 1) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) ;; definition for method 3 of type sprite-aux-list ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect sprite-aux-list ((this sprite-aux-list)) +(defmethod inspect ((this sprite-aux-list)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tnum-entries: ~D~%" (-> this num-entries)) (format #t "~Tentry: ~D~%" (-> this entry)) @@ -108,7 +96,7 @@ ;; definition for method 3 of type sprite-aux-list ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch symbol vs sprite-aux-list. -(defmethod inspect sprite-aux-list ((this sprite-aux-list)) +(defmethod inspect ((this sprite-aux-list)) (format #t "[~X] sprite-aux-list:~%" this) (format #t "~Tnum-entries: ~D~%" (-> this num-entries)) (format #t "~Tentry: ~D~%" (-> this entry)) @@ -145,43 +133,40 @@ ;; definition of type sprite-frame-data (deftype sprite-frame-data (structure) - ((cdata vector 16 :inline :offset-assert 0) - (hmge-scale vector :inline :offset 256) - (consts vector :inline :offset-assert 272) - (pfog0 float :offset 272) - (deg-to-rad float :offset 276) - (min-scale float :offset 280) - (inv-area float :offset 284) - (adgif-giftag gs-gif-tag :inline :offset-assert 288) - (sprite-2d-giftag gs-gif-tag :inline :offset-assert 304) - (sprite-2d-giftag-2 gs-gif-tag :inline :offset-assert 320) - (sincos-01 vector :inline :offset-assert 336) - (sincos-23 vector :inline :offset-assert 352) - (sincos-45 vector :inline :offset-assert 368) - (sincos-67 vector :inline :offset-assert 384) - (sincos-89 vector :inline :offset-assert 400) - (basis-x vector :inline :offset-assert 416) - (basis-y vector :inline :offset-assert 432) - (sprite-3d-giftag gs-gif-tag :inline :offset-assert 448) - (screen-shader adgif-shader :inline :offset-assert 464) - (clipped-giftag gs-gif-tag :inline :offset-assert 544) - (inv-hmge-scale vector :inline :offset-assert 560) - (stq-offset vector :inline :offset-assert 576) - (stq-scale vector :inline :offset-assert 592) - (rgba-plain qword :inline :offset-assert 608) - (warp-giftag gs-gif-tag :inline :offset-assert 624) - (fog-clamp vector :inline :offset-assert 640) - (fog-min float :offset 640) - (fog-max float :offset 644) - (max-scale float :offset 648) + ((cdata vector 16 :inline) + (hmge-scale vector :inline) + (consts vector :inline) + (pfog0 float :overlay-at (-> consts x)) + (deg-to-rad float :overlay-at (-> consts y)) + (min-scale float :overlay-at (-> consts z)) + (inv-area float :overlay-at (-> consts w)) + (adgif-giftag gs-gif-tag :inline) + (sprite-2d-giftag gs-gif-tag :inline) + (sprite-2d-giftag-2 gs-gif-tag :inline) + (sincos-01 vector :inline) + (sincos-23 vector :inline) + (sincos-45 vector :inline) + (sincos-67 vector :inline) + (sincos-89 vector :inline) + (basis-x vector :inline) + (basis-y vector :inline) + (sprite-3d-giftag gs-gif-tag :inline) + (screen-shader adgif-shader :inline) + (clipped-giftag gs-gif-tag :inline) + (inv-hmge-scale vector :inline) + (stq-offset vector :inline) + (stq-scale vector :inline) + (rgba-plain qword :inline) + (warp-giftag gs-gif-tag :inline) + (fog-clamp vector :inline) + (fog-min float :overlay-at (-> fog-clamp x)) + (fog-max float :overlay-at (-> fog-clamp y)) + (max-scale float :overlay-at (-> fog-clamp z)) ) - :method-count-assert 9 - :size-assert #x290 - :flag-assert #x900000290 ) ;; definition for method 3 of type sprite-frame-data -(defmethod inspect sprite-frame-data ((this sprite-frame-data)) +(defmethod inspect ((this sprite-frame-data)) (format #t "[~8x] ~A~%" this 'sprite-frame-data) (format #t "~Tdata[41] @ #x~X~%" (-> this cdata)) (format #t "~Tcdata[16] @ #x~X~%" (-> this cdata)) diff --git a/test/decompiler/reference/jak1/engine/gfx/texture/texture-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/texture/texture-h_REF.gc index 0f990b0e8f7..9966423dcb2 100644 --- a/test/decompiler/reference/jak1/engine/gfx/texture/texture-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/texture/texture-h_REF.gc @@ -12,13 +12,10 @@ ((index uint16 :offset 8 :size 12) (page uint16 :offset 20 :size 12) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type texture-id -(defmethod inspect texture-id ((this texture-id)) +(defmethod inspect ((this texture-id)) (format #t "[~8x] ~A~%" this 'texture-id) (format #t "~Tindex: ~D~%" (-> this index)) (format #t "~Tpage: ~D~%" (-> this page)) @@ -27,17 +24,14 @@ ;; definition of type texture-pool-segment (deftype texture-pool-segment (structure) - ((dest uint32 :offset-assert 0) - (size uint32 :offset-assert 4) + ((dest uint32) + (size uint32) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type texture-pool-segment -(defmethod inspect texture-pool-segment ((this texture-pool-segment)) +(defmethod inspect ((this texture-pool-segment)) (format #t "[~8x] ~A~%" this 'texture-pool-segment) (format #t "~Tdest: #x~X~%" (-> this dest)) (format #t "~Tsize: #x~X~%" (-> this size)) @@ -46,48 +40,45 @@ ;; definition of type texture-pool (deftype texture-pool (basic) - ((top int32 :offset-assert 4) - (cur int32 :offset-assert 8) - (allocate-func (function texture-pool texture-page kheap int texture-page) :offset-assert 12) - (font-palette int32 :offset-assert 16) - (segment-near texture-pool-segment :inline :offset-assert 20) - (segment-common texture-pool-segment :inline :offset-assert 28) - (segment texture-pool-segment 4 :inline :offset 20) - (common-page texture-page 32 :offset-assert 52) - (common-page-mask int32 :offset-assert 180) - (ids uint32 126 :offset-assert 184) + ((top int32) + (cur int32) + (allocate-func (function texture-pool texture-page kheap int texture-page)) + (font-palette int32) + (segment texture-pool-segment 4 :inline) + (segment-near texture-pool-segment :inline :overlay-at (-> segment 0)) + (segment-common texture-pool-segment :inline :overlay-at (-> segment 1)) + (common-page texture-page 32) + (common-page-mask int32) + (ids uint32 126) ) - :method-count-assert 23 - :size-assert #x2b0 - :flag-assert #x17000002b0 (:methods - (new (symbol type) _type_ 0) - (initialize! (_type_) _type_ 9) - (print-usage (_type_) _type_ 10) - (setup-font-texture! (_type_) none 11) - (allocate-defaults! (_type_) none 12) - (login-level-textures (_type_ level int (pointer texture-id)) none 13) - (add-tex-to-dma! (_type_ level int) none 14) - (allocate-vram-words! (_type_ int) int 15) - (allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment 16) - (unused-17 () none 17) - (unused-18 () none 18) - (unused-19 () none 19) - (unload! (_type_ texture-page) int 20) - (upload-one-common! (_type_ level) symbol 21) - (lookup-boot-common-id (_type_ int) int 22) + (new (symbol type) _type_) + (initialize! (_type_) _type_) + (print-usage (_type_) _type_) + (setup-font-texture! (_type_) none) + (allocate-defaults! (_type_) none) + (login-level-textures (_type_ level int (pointer texture-id)) none) + (add-tex-to-dma! (_type_ level int) none) + (allocate-vram-words! (_type_ int) int) + (allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment) + (unused-17 () none) + (unused-18 () none) + (unused-19 () none) + (unload! (_type_ texture-page) int) + (upload-one-common! (_type_ level) symbol) + (lookup-boot-common-id (_type_ int) int) ) ) ;; definition for method 3 of type texture-pool -(defmethod inspect texture-pool ((this texture-pool)) +(defmethod inspect ((this texture-pool)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttop: #x~X~%" (-> this top)) (format #t "~Tcur: #x~X~%" (-> this cur)) (format #t "~Tallocate-func: ~A~%" (-> this allocate-func)) (format #t "~Tfont-palette: ~D~%" (-> this font-palette)) - (format #t "~Tsegment[4] @ #x~X~%" (-> this segment-near)) - (format #t "~Tsegment-near: #~%" (-> this segment-near)) + (format #t "~Tsegment[4] @ #x~X~%" (-> this segment)) + (format #t "~Tsegment-near: #~%" (-> this segment)) (format #t "~Tsegment-common: #~%" (-> this segment-common)) (format #t "~Tcommon-page[32] @ #x~X~%" (-> this common-page)) (format #t "~Tcommon-page-mask: ~D~%" (-> this common-page-mask)) @@ -97,30 +88,27 @@ ;; definition of type texture (deftype texture (basic) - ((w int16 :offset-assert 4) - (wu uint16 :offset 4) - (h int16 :offset-assert 6) - (hu uint16 :offset 6) - (num-mips uint8 :offset-assert 8) - (tex1-control uint8 :offset-assert 9) - (psm gs-psm :offset-assert 10) - (mip-shift uint8 :offset-assert 11) - (clutpsm uint16 :offset-assert 12) - (dest uint16 7 :offset-assert 14) - (clutdest uint16 :offset-assert 28) - (width uint8 7 :offset-assert 30) - (name string :offset-assert 40) - (size uint32 :offset-assert 44) - (uv-dist float :offset-assert 48) - (masks uint32 3 :offset-assert 52) + ((w int16) + (wu uint16 :overlay-at w) + (h int16) + (hu uint16 :overlay-at h) + (num-mips uint8) + (tex1-control uint8) + (psm gs-psm) + (mip-shift uint8) + (clutpsm uint16) + (dest uint16 7) + (clutdest uint16) + (width uint8 7) + (name string) + (size uint32) + (uv-dist float) + (masks uint32 3) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type texture -(defmethod inspect texture ((this texture)) +(defmethod inspect ((this texture)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tw: ~D~%" (-> this w)) (format #t "~Th: ~D~%" (-> this h)) @@ -141,18 +129,15 @@ ;; definition of type texture-page-segment (deftype texture-page-segment (structure) - ((block-data pointer :offset-assert 0) - (size uint32 :offset-assert 4) - (dest uint32 :offset-assert 8) + ((block-data pointer) + (size uint32) + (dest uint32) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type texture-page-segment -(defmethod inspect texture-page-segment ((this texture-page-segment)) +(defmethod inspect ((this texture-page-segment)) (format #t "[~8x] ~A~%" this 'texture-page-segment) (format #t "~Tblock-data: #x~X~%" (-> this block-data)) (format #t "~Tsize: #x~X~%" (-> this size)) @@ -170,32 +155,29 @@ ;; definition of type texture-page (deftype texture-page (basic) - ((info file-info :offset-assert 4) - (name basic :offset-assert 8) - (id uint32 :offset-assert 12) - (length int32 :offset-assert 16) - (mip0-size uint32 :offset-assert 20) - (size uint32 :offset-assert 24) - (segment texture-page-segment 3 :inline :offset-assert 28) - (pad uint32 16 :offset-assert 64) - (data texture :dynamic :offset-assert 128) + ((info file-info) + (name basic) + (id uint32) + (length int32) + (mip0-size uint32) + (size uint32) + (segment texture-page-segment 3 :inline) + (pad uint32 16) + (data texture :dynamic) ) - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (remove-from-heap (_type_ kheap) _type_ 9) - (get-leftover-block-count (_type_ int int) int 10) - (unused-11 () none 11) - (relocate-dests! (_type_ int int) none 12) - (add-to-dma-buffer (_type_ dma-buffer int) int 13) - (upload-now! (_type_ int) none 14) + (relocate (_type_ kheap (pointer uint8)) none :replace) + (remove-from-heap (_type_ kheap) _type_) + (get-leftover-block-count (_type_ int int) int) + (unused-11 () none) + (relocate-dests! (_type_ int int) none) + (add-to-dma-buffer (_type_ dma-buffer int) int) + (upload-now! (_type_ int) none) ) ) ;; definition for method 3 of type texture-page -(defmethod inspect texture-page ((this texture-page)) +(defmethod inspect ((this texture-page)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tinfo: ~A~%" (-> this info)) (format #t "~Tname: ~A~%" (-> this name)) @@ -213,22 +195,16 @@ (deftype shader-ptr (uint32) ((shader uint32 :offset 8 :size 24) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type texture-link (deftype texture-link (structure) - ((next shader-ptr 1 :offset-assert 0) + ((next shader-ptr 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type texture-link -(defmethod inspect texture-link ((this texture-link)) +(defmethod inspect ((this texture-link)) (format #t "[~8x] ~A~%" this 'texture-link) (format #t "~Tnext: #x~X~%" (-> this next 0)) this @@ -236,19 +212,16 @@ ;; definition of type texture-page-dir-entry (deftype texture-page-dir-entry (structure) - ((length int16 :offset-assert 0) - (status uint16 :offset-assert 2) - (page texture-page :offset-assert 4) - (link texture-link :offset-assert 8) + ((length int16) + (status uint16) + (page texture-page) + (link texture-link) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type texture-page-dir-entry -(defmethod inspect texture-page-dir-entry ((this texture-page-dir-entry)) +(defmethod inspect ((this texture-page-dir-entry)) (format #t "[~8x] ~A~%" this 'texture-page-dir-entry) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tstatus: ~D~%" (-> this status)) @@ -259,34 +232,28 @@ ;; definition of type texture-page-dir (deftype texture-page-dir (basic) - ((length int32 :offset-assert 4) - (entries texture-page-dir-entry 1 :inline :offset-assert 8) + ((length int32) + (entries texture-page-dir-entry 1 :inline) ) - :method-count-assert 10 - :size-assert #x14 - :flag-assert #xa00000014 (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (unlink-textures-in-heap! (_type_ kheap) int 9) + (relocate (_type_ kheap (pointer uint8)) none :replace) + (unlink-textures-in-heap! (_type_ kheap) int) ) ) ;; definition of type texture-relocate-later (deftype texture-relocate-later (basic) - ((memcpy symbol :offset-assert 4) - (dest uint32 :offset-assert 8) - (source uint32 :offset-assert 12) - (move uint32 :offset-assert 16) - (entry texture-page-dir-entry :offset-assert 20) - (page texture-page :offset-assert 24) + ((memcpy symbol) + (dest uint32) + (source uint32) + (move uint32) + (entry texture-page-dir-entry) + (page texture-page) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type texture-relocate-later -(defmethod inspect texture-relocate-later ((this texture-relocate-later)) +(defmethod inspect ((this texture-relocate-later)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tmemcpy: ~A~%" (-> this memcpy)) (format #t "~Tdest: ~D~%" (-> this dest)) @@ -308,26 +275,23 @@ ;; definition of type adgif-shader (deftype adgif-shader (structure) - ((quad qword 5 :inline :offset 0) - (prims gs-reg64 10 :offset 0) - (tex0 gs-tex0 :offset 0) - (tex1 gs-tex1 :offset 16) - (miptbp1 gs-miptbp :offset 32) - (clamp gs-clamp :offset 48) - (clamp-reg gs-reg64 :offset 56) - (alpha gs-alpha :offset 64) - (alpha-as-miptb2 gs-miptbp :offset 64) - (link-test link-test-flags :offset 8) - (texture-id texture-id :offset 24) - (next shader-ptr :offset 40) + ((quad qword 5 :inline :offset 0) + (prims gs-reg64 10 :overlay-at quad) + (tex0 gs-tex0 :overlay-at (-> prims 0)) + (tex1 gs-tex1 :overlay-at (-> prims 2)) + (miptbp1 gs-miptbp :overlay-at (-> prims 4)) + (clamp gs-clamp :overlay-at (-> prims 6)) + (clamp-reg gs-reg64 :overlay-at (-> prims 7)) + (alpha gs-alpha :overlay-at (-> prims 8)) + (alpha-as-miptb2 gs-miptbp :overlay-at alpha) + (link-test link-test-flags :overlay-at (-> prims 1)) + (texture-id texture-id :overlay-at (-> prims 3)) + (next shader-ptr :overlay-at (-> prims 5)) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type adgif-shader -(defmethod inspect adgif-shader ((this adgif-shader)) +(defmethod inspect ((this adgif-shader)) (format #t "[~8x] ~A~%" this 'adgif-shader) (format #t "~Tquad[5] @ #x~X~%" (&-> this tex0)) (format #t "~Tprims[10] @ #x~X~%" (&-> this tex0)) @@ -345,15 +309,12 @@ ;; definition of type adgif-shader-array (deftype adgif-shader-array (inline-array-class) - ((data adgif-shader :inline :dynamic :offset 16) + ((data adgif-shader :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type adgif-shader-array -(defmethod inspect adgif-shader-array ((this adgif-shader-array)) +(defmethod inspect ((this adgif-shader-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) diff --git a/test/decompiler/reference/jak1/engine/gfx/texture/texture_REF.gc b/test/decompiler/reference/jak1/engine/gfx/texture/texture_REF.gc index ca815b954ef..f95d2181bfe 100644 --- a/test/decompiler/reference/jak1/engine/gfx/texture/texture_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/texture/texture_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 2 of type texture-page -(defmethod print texture-page ((this texture-page)) +(defmethod print ((this texture-page)) (format #t "#" @@ -16,18 +16,18 @@ ) ;; definition for method 4 of type texture-page -(defmethod length texture-page ((this texture-page)) +(defmethod length ((this texture-page)) (-> this length) ) ;; definition for method 5 of type texture-page ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of texture-page ((this texture-page)) +(defmethod asize-of ((this texture-page)) (the-as int (+ (-> this type size) (* (-> this length) 4))) ) ;; definition for method 8 of type texture-page -(defmethod mem-usage texture-page ((this texture-page) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this texture-page) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 80 (-> arg0 length))) (set! (-> arg0 data 79 name) "texture") (+! (-> arg0 data 79 count) (-> this length)) @@ -122,7 +122,7 @@ ) ;; definition for method 2 of type texture -(defmethod print texture ((this texture)) +(defmethod print ((this texture)) (format #t "# this cur))) (+! (-> this cur) word-count) v0-0 @@ -602,7 +602,7 @@ ) ;; definition for method 22 of type texture-pool -(defmethod lookup-boot-common-id texture-pool ((this texture-pool) (tpage-id int)) +(defmethod lookup-boot-common-id ((this texture-pool) (tpage-id int)) (case tpage-id ((1032) 0 @@ -671,7 +671,7 @@ ) ;; definition for method 9 of type texture-pool -(defmethod initialize! texture-pool ((this texture-pool)) +(defmethod initialize! ((this texture-pool)) (set! (-> this cur) 0) (set! (-> this top) (-> this cur)) (set! (-> this allocate-func) texture-page-default-allocate) @@ -688,7 +688,7 @@ ) ;; definition for method 10 of type texture-page -(defmethod get-leftover-block-count texture-page ((this texture-page) (segment-count int) (additional-size int)) +(defmethod get-leftover-block-count ((this texture-page) (segment-count int) (additional-size int)) (let ((v1-0 additional-size)) (dotimes (a2-1 segment-count) (+! v1-0 (-> this segment a2-1 size)) @@ -698,7 +698,7 @@ ) ;; definition for method 10 of type texture-pool -(defmethod print-usage texture-pool ((this texture-pool)) +(defmethod print-usage ((this texture-pool)) (format #t "--------------------~%") (format #t @@ -713,7 +713,7 @@ ) ;; definition for method 16 of type texture-pool -(defmethod allocate-segment! texture-pool ((this texture-pool) (segment texture-pool-segment) (size int)) +(defmethod allocate-segment! ((this texture-pool) (segment texture-pool-segment) (size int)) (set! (-> segment size) (the-as uint size)) (set! (-> segment dest) (the-as uint (allocate-vram-words! this size))) segment @@ -721,9 +721,9 @@ ;; definition for method 12 of type texture-pool ;; INFO: Return type mismatch int vs none. -(defmethod allocate-defaults! texture-pool ((this texture-pool)) +(defmethod allocate-defaults! ((this texture-pool)) (allocate-segment! this (-> this segment-common) #x1c000) - (allocate-segment! this (-> this segment-near) #x62000) + (allocate-segment! this (the-as texture-pool-segment (-> this segment)) #x62000) (set! *sky-base-vram-word* (allocate-vram-words! this #x7000)) (set! *sky-base-block* (/ *sky-base-vram-word* 64)) (set! *sky-base-page* (sar *sky-base-vram-word* 11)) @@ -741,7 +741,7 @@ ) ;; definition for method 9 of type texture-page -(defmethod remove-from-heap texture-page ((this texture-page) (seg kheap)) +(defmethod remove-from-heap ((this texture-page) (seg kheap)) (set! (-> seg current) (-> this segment 0 block-data)) this ) @@ -1116,7 +1116,7 @@ ) ) (upload-now! page 2) - (update-vram-pages pool (-> pool segment-near) page 2) + (update-vram-pages pool (the-as texture-pool-segment (-> pool segment)) page 2) (let ((page-seg-2-size (logand -4096 (+ (-> page segment 2 size) 4095)))) (cond ((< (the-as uint #x24000) page-seg-2-size) @@ -1156,7 +1156,7 @@ ) ) (upload-now! page 2) - (update-vram-pages pool (-> pool segment-near) page 2) + (update-vram-pages pool (the-as texture-pool-segment (-> pool segment)) page 2) (cond ((< (the-as uint #x24000) seg2-size) (set! (-> page segment 2 size) (+ -147456 seg2-size)) @@ -1305,7 +1305,7 @@ ;; definition for method 13 of type texture-pool ;; INFO: Return type mismatch int vs none. -(defmethod login-level-textures texture-pool ((this texture-pool) (level level) (max-page-kind int) (id-array (pointer texture-id))) +(defmethod login-level-textures ((this texture-pool) (level level) (max-page-kind int) (id-array (pointer texture-id))) (dotimes (page-idx 9) (set! (-> level texture-page page-idx) #f) ) @@ -1366,7 +1366,7 @@ ;; definition for method 14 of type texture-pool ;; INFO: Return type mismatch int vs none. -(defmethod add-tex-to-dma! texture-pool ((this texture-pool) (level level) (tex-page-kind int)) +(defmethod add-tex-to-dma! ((this texture-pool) (level level) (tex-page-kind int)) (when (zero? tex-page-kind) (let ((tfrag-page (-> level texture-page 0)) (tfrag-bucket (if (zero? (-> level index)) @@ -1390,8 +1390,13 @@ (when tfrag-page (set! (-> level upload-size 0) 0) (if (< distance 81920.0) - (+! (-> level upload-size 0) - (upload-vram-pages this (-> this segment-near) tfrag-page 2 (the-as bucket-id tfrag-bucket)) + (+! (-> level upload-size 0) (upload-vram-pages + this + (the-as texture-pool-segment (-> this segment)) + tfrag-page + 2 + (the-as bucket-id tfrag-bucket) + ) ) ) (cond @@ -1529,7 +1534,7 @@ ) ;; definition for method 21 of type texture-pool -(defmethod upload-one-common! texture-pool ((this texture-pool) (arg0 level)) +(defmethod upload-one-common! ((this texture-pool) (arg0 level)) (dotimes (v1-0 32) (let ((a2-0 (-> this common-page v1-0))) (when (and (nonzero? a2-0) (logtest? (-> this common-page-mask) (ash 1 v1-0))) @@ -1543,7 +1548,7 @@ ;; definition for method 11 of type level ;; INFO: Return type mismatch int vs none. -(defmethod add-irq-to-tex-buckets! level ((this level)) +(defmethod add-irq-to-tex-buckets! ((this level)) (cond ((zero? (-> this index)) (let* ((v1-4 (-> *display* frames (-> *display* on-screen) frame global-buf)) @@ -1767,7 +1772,7 @@ ;; definition for method 14 of type texture-page ;; INFO: Return type mismatch int vs none. -(defmethod upload-now! texture-page ((this texture-page) (arg0 int)) +(defmethod upload-now! ((this texture-page) (arg0 int)) (let ((gp-0 *txt-dma-list*)) (let ((v1-0 gp-0)) (set! (-> v1-0 base) (-> v1-0 data)) @@ -1810,7 +1815,7 @@ ) ;; definition for method 13 of type texture-page -(defmethod add-to-dma-buffer texture-page ((this texture-page) (dma-buff dma-buffer) (mode int)) +(defmethod add-to-dma-buffer ((this texture-page) (dma-buff dma-buffer) (mode int)) (local-vars (total-size int)) (let ((v1-0 mode)) (set! total-size (cond @@ -2019,7 +2024,7 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; INFO: Return type mismatch int vs none. -(defmethod setup-font-texture! texture-pool ((this texture-pool)) +(defmethod setup-font-texture! ((this texture-pool)) (local-vars (heap-before-font-tex int) (clut-dest-addr int)) (let ((font-clut (-> this font-palette))) (set! heap-before-font-tex (-> this cur)) @@ -2136,25 +2141,25 @@ ;; definition for method 5 of type texture-page-dir ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of texture-page-dir ((this texture-page-dir)) +(defmethod asize-of ((this texture-page-dir)) (the-as int (+ (-> texture-page-dir size) (* 12 (+ (-> this length) -1)))) ) ;; definition for method 4 of type texture-page-dir -(defmethod length texture-page-dir ((this texture-page-dir)) +(defmethod length ((this texture-page-dir)) (-> this length) ) ;; definition for method 7 of type texture-page-dir ;; INFO: Return type mismatch texture-page-dir vs none. -(defmethod relocate texture-page-dir ((this texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate ((this texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) (set! *texture-page-dir* this) (none) ) ;; definition for method 12 of type texture-page ;; INFO: Return type mismatch texture-page vs none. -(defmethod relocate-dests! texture-page ((this texture-page) (new-dest int) (seg-id int)) +(defmethod relocate-dests! ((this texture-page) (new-dest int) (seg-id int)) (let ((v1-0 (shr new-dest 6)) (dst-block (shr (-> this segment seg-id dest) 6)) ) @@ -2191,7 +2196,7 @@ ;; definition for method 7 of type texture-page ;; INFO: Return type mismatch texture-page vs none. -(defmethod relocate texture-page ((this texture-page) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate ((this texture-page) (arg0 kheap) (arg1 (pointer uint8))) (local-vars (s4-0 texture-page-dir-entry)) (cond ((or (not this) (not (file-info-correct-version? (-> this info) (file-kind tpage) 0))) @@ -2281,7 +2286,7 @@ ) ;; definition for method 20 of type texture-pool -(defmethod unload! texture-pool ((this texture-pool) (arg0 texture-page)) +(defmethod unload! ((this texture-pool) (arg0 texture-page)) (local-vars (a0-2 int)) (let ((v1-0 *texture-page-dir*)) (dotimes (a0-1 (-> v1-0 length)) @@ -2323,7 +2328,7 @@ ) ;; definition for method 9 of type texture-page-dir -(defmethod unlink-textures-in-heap! texture-page-dir ((this texture-page-dir) (heap kheap)) +(defmethod unlink-textures-in-heap! ((this texture-page-dir) (heap kheap)) (local-vars (dist-past-end uint)) (let ((mem-start (-> heap base)) (mem-end (-> heap top-base)) @@ -2592,7 +2597,7 @@ ) ;; definition for method 3 of type texture-page-dir -(defmethod inspect texture-page-dir ((this texture-page-dir)) +(defmethod inspect ((this texture-page-dir)) (texture-page-dir-inspect this #f) this ) diff --git a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-h_REF.gc index 3dd51cb4e4a..6fdd25f9641 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-h_REF.gc @@ -3,16 +3,13 @@ ;; definition of type tfragment-stats (deftype tfragment-stats (structure) - ((num-tris uint16 4 :offset-assert 0) - (num-dverts uint16 4 :offset-assert 8) + ((num-tris uint16 4) + (num-dverts uint16 4) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type tfragment-stats -(defmethod inspect tfragment-stats ((this tfragment-stats)) +(defmethod inspect ((this tfragment-stats)) (format #t "[~8x] ~A~%" this 'tfragment-stats) (format #t "~Tnum-tris[4] @ #x~X~%" (-> this num-tris)) (format #t "~Tnum-dverts[4] @ #x~X~%" (-> this num-dverts)) @@ -21,16 +18,13 @@ ;; definition of type tfragment-debug-data (deftype tfragment-debug-data (structure) - ((stats tfragment-stats :inline :offset-assert 0) - (debug-lines (array vector-array) :offset-assert 16) + ((stats tfragment-stats :inline) + (debug-lines (array vector-array)) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type tfragment-debug-data -(defmethod inspect tfragment-debug-data ((this tfragment-debug-data)) +(defmethod inspect ((this tfragment-debug-data)) (format #t "[~8x] ~A~%" this 'tfragment-debug-data) (format #t "~Tstats: #~%" (-> this stats)) (format #t "~Tdebug-lines: ~A~%" (-> this debug-lines)) @@ -39,15 +33,12 @@ ;; definition of type generic-tfragment (deftype generic-tfragment (structure) - ((dummy int32 :offset-assert 0) + ((dummy int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type generic-tfragment -(defmethod inspect generic-tfragment ((this generic-tfragment)) +(defmethod inspect ((this generic-tfragment)) (format #t "[~8x] ~A~%" this 'generic-tfragment) (format #t "~Tdummy: ~D~%" (-> this dummy)) this @@ -55,35 +46,32 @@ ;; definition of type tfragment (deftype tfragment (drawable) - ((color-index uint16 :offset 6) - (debug-data tfragment-debug-data :offset 8) - (color-indices uint32 :offset 12) - (colors uint32 :offset 12) - (dma-chain uint32 3 :offset-assert 32) - (dma-common uint32 :offset 32) - (dma-level-0 uint32 :offset 32) - (dma-base uint32 :offset 36) - (dma-level-1 uint32 :offset 40) - (dma-qwc uint8 4 :offset 44) - (shader (inline-array adgif-shader) :offset 48) - (num-shaders uint8 :offset 52) - (num-base-colors uint8 :offset 53) - (num-level0-colors uint8 :offset 54) - (num-level1-colors uint8 :offset 55) - (color-offset uint8 :offset 56) - (color-count uint8 :offset 57) - (pad0 uint8 :offset 58) - (pad1 uint8 :offset 59) - (generic generic-tfragment :offset-assert 60) - (generic-u32 uint32 :offset 60) + ((color-index uint16 :offset 6) + (debug-data tfragment-debug-data :offset 8) + (color-indices uint32 :offset 12) + (colors uint32 :overlay-at color-indices) + (dma-chain uint32 3) + (dma-common uint32 :overlay-at (-> dma-chain 0)) + (dma-level-0 uint32 :overlay-at (-> dma-chain 0)) + (dma-base uint32 :overlay-at (-> dma-chain 1)) + (dma-level-1 uint32 :overlay-at (-> dma-chain 2)) + (dma-qwc uint8 4 :offset 44) + (shader (inline-array adgif-shader) :offset 48) + (num-shaders uint8 :offset 52) + (num-base-colors uint8 :offset 53) + (num-level0-colors uint8 :offset 54) + (num-level1-colors uint8 :offset 55) + (color-offset uint8 :offset 56) + (color-count uint8 :offset 57) + (pad0 uint8 :offset 58) + (pad1 uint8 :offset 59) + (generic generic-tfragment) + (generic-u32 uint32 :overlay-at generic) ) - :method-count-assert 18 - :size-assert #x40 - :flag-assert #x1200000040 ) ;; definition for method 3 of type tfragment -(defmethod inspect tfragment ((this tfragment)) +(defmethod inspect ((this tfragment)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) @@ -112,88 +100,61 @@ ;; definition of type drawable-inline-array-tfrag (deftype drawable-inline-array-tfrag (drawable-inline-array) - ((data tfragment 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 96) + ((data tfragment 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x64 - :flag-assert #x1200000064 ) ;; definition of type drawable-inline-array-trans-tfrag (deftype drawable-inline-array-trans-tfrag (drawable-inline-array-tfrag) - ((data2 tfragment 1 :inline :offset-assert 112) - (pad2 uint32 :offset-assert 176) + ((data2 tfragment 1 :inline) + (pad2 uint32) ) - :method-count-assert 18 - :size-assert #xb4 - :flag-assert #x12000000b4 ) ;; definition of type drawable-tree-tfrag (deftype drawable-tree-tfrag (drawable-tree) - ((time-of-day-pal time-of-day-palette :offset 12) - (arrays drawable-inline-array 1 :offset 32) + ((time-of-day-pal time-of-day-palette :offset 12) + (arrays drawable-inline-array 1 :overlay-at (-> data 0)) ) - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; definition of type drawable-tree-trans-tfrag (deftype drawable-tree-trans-tfrag (drawable-tree-tfrag) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; definition of type drawable-tree-dirt-tfrag (deftype drawable-tree-dirt-tfrag (drawable-tree-tfrag) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; definition of type drawable-tree-ice-tfrag (deftype drawable-tree-ice-tfrag (drawable-tree-tfrag) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; definition of type drawable-tree-lowres-tfrag (deftype drawable-tree-lowres-tfrag (drawable-tree-tfrag) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; definition of type drawable-tree-lowres-trans-tfrag (deftype drawable-tree-lowres-trans-tfrag (drawable-tree-trans-tfrag) () - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; definition of type tfrag-dists (deftype tfrag-dists (structure) - ((data uint32 16 :offset-assert 0) - (vector vector 4 :inline :offset 0) - (k0s vector 2 :inline :offset 0) - (k1s vector 2 :inline :offset 32) + ((data uint32 16) + (vector vector 4 :inline :overlay-at (-> data 0)) + (k0s vector 2 :inline :overlay-at (-> data 0)) + (k1s vector 2 :inline :overlay-at (-> data 8)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type tfrag-dists -(defmethod inspect tfrag-dists ((this tfrag-dists)) +(defmethod inspect ((this tfrag-dists)) (format #t "[~8x] ~A~%" this 'tfrag-dists) (format #t "~Tdata[16] @ #x~X~%" (-> this k0s)) (format #t "~Tvector[4] @ #x~X~%" (-> this k0s)) @@ -204,29 +165,26 @@ ;; definition of type tfrag-data (deftype tfrag-data (structure) - ((data uint32 56 :offset 0) - (vector vector 14 :inline :offset 0) - (fog vector :inline :offset 0) - (val vector :inline :offset 16) - (strgif gs-gif-tag :inline :offset 32) - (fangif gs-gif-tag :inline :offset 48) - (adgif gs-gif-tag :inline :offset 64) - (hvdf-offset vector :inline :offset 80) - (hmge-scale vector :inline :offset 96) - (invh-scale vector :inline :offset 112) - (ambient vector :inline :offset 128) - (guard vector :inline :offset 144) - (dists tfrag-dists :inline :offset 160) - (k0s uint128 2 :offset 160) - (k1s uint128 2 :offset 192) + ((data uint32 56 :offset 0) + (vector vector 14 :inline :overlay-at (-> data 0)) + (fog vector :inline :overlay-at (-> vector 0)) + (val vector :inline :overlay-at (-> vector 1)) + (strgif gs-gif-tag :inline :overlay-at (-> data 8)) + (fangif gs-gif-tag :inline :overlay-at (-> data 12)) + (adgif gs-gif-tag :inline :overlay-at (-> data 16)) + (hvdf-offset vector :inline :overlay-at (-> vector 5)) + (hmge-scale vector :inline :overlay-at (-> vector 6)) + (invh-scale vector :inline :overlay-at (-> vector 7)) + (ambient vector :inline :overlay-at (-> vector 8)) + (guard vector :inline :overlay-at (-> vector 9)) + (dists tfrag-dists :inline :overlay-at (-> data 40)) + (k0s uint128 2 :overlay-at (-> data 40)) + (k1s uint128 2 :overlay-at (-> data 48)) ) - :method-count-assert 9 - :size-assert #xe0 - :flag-assert #x9000000e0 ) ;; definition for method 3 of type tfrag-data -(defmethod inspect tfrag-data ((this tfrag-data)) +(defmethod inspect ((this tfrag-data)) (format #t "[~8x] ~A~%" this 'tfrag-data) (format #t "~Tdata[56] @ #x~X~%" (-> this fog)) (format #t "~Tvector[14] @ #x~X~%" (-> this fog)) @@ -248,34 +206,31 @@ ;; definition of type tfrag-control (deftype tfrag-control (structure) - ((num-base-points uint32 :offset-assert 0) - (num-shared-base-points uint32 :offset-assert 4) - (num-level0-points uint32 :offset-assert 8) - (num-shared-level0-points uint32 :offset-assert 12) - (num-level1-points uint32 :offset-assert 16) - (num-shared-level1-points uint32 :offset-assert 20) - (ptr-vtxdata uint32 :offset-assert 24) - (ptr-base-points uint32 :offset-assert 28) - (ptr-shared-base-points uint32 :offset-assert 32) - (ptr-level0-points uint32 :offset-assert 36) - (ptr-shared-level0-points uint32 :offset-assert 40) - (ptr-level1-points uint32 :offset-assert 44) - (ptr-shared-level1-points uint32 :offset-assert 48) - (ptr-draw-points uint32 :offset-assert 52) - (ptr-interpolated-0 uint32 :offset-assert 56) - (ptr-shared-interpolated-0 uint32 :offset-assert 60) - (ptr-interpolated1 uint32 :offset-assert 64) - (ptr-shared-interpolated1 uint32 :offset-assert 68) - (ptr-strip-data uint32 :offset-assert 72) - (ptr-texture-data uint32 :offset-assert 76) + ((num-base-points uint32) + (num-shared-base-points uint32) + (num-level0-points uint32) + (num-shared-level0-points uint32) + (num-level1-points uint32) + (num-shared-level1-points uint32) + (ptr-vtxdata uint32) + (ptr-base-points uint32) + (ptr-shared-base-points uint32) + (ptr-level0-points uint32) + (ptr-shared-level0-points uint32) + (ptr-level1-points uint32) + (ptr-shared-level1-points uint32) + (ptr-draw-points uint32) + (ptr-interpolated-0 uint32) + (ptr-shared-interpolated-0 uint32) + (ptr-interpolated1 uint32) + (ptr-shared-interpolated1 uint32) + (ptr-strip-data uint32) + (ptr-texture-data uint32) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type tfrag-control -(defmethod inspect tfrag-control ((this tfrag-control)) +(defmethod inspect ((this tfrag-control)) (format #t "[~8x] ~A~%" this 'tfrag-control) (format #t "~Tnum-base-points: ~D~%" (-> this num-base-points)) (format #t "~Tnum-shared-base-points: ~D~%" (-> this num-shared-base-points)) @@ -302,30 +257,27 @@ ;; definition of type tfrag-stats (deftype tfrag-stats (structure) - ((from int32 :offset-assert 0) - (to int32 :offset-assert 4) - (cnt int32 :offset-assert 8) - (tris int32 :offset-assert 12) - (tfaces int32 :offset-assert 16) - (tfrags int32 :offset-assert 20) - (dtris int32 :offset-assert 24) - (base-verts int32 :offset-assert 28) - (level0-verts int32 :offset-assert 32) - (level1-verts int32 :offset-assert 36) - (dma-cnt int32 :offset-assert 40) - (dma-dta int32 :offset-assert 44) - (dma-tex int32 :offset-assert 48) - (strips int32 :offset-assert 52) - (drawpoints int32 :offset-assert 56) - (vif int32 :offset-assert 60) + ((from int32) + (to int32) + (cnt int32) + (tris int32) + (tfaces int32) + (tfrags int32) + (dtris int32) + (base-verts int32) + (level0-verts int32) + (level1-verts int32) + (dma-cnt int32) + (dma-dta int32) + (dma-tex int32) + (strips int32) + (drawpoints int32) + (vif int32) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type tfrag-stats -(defmethod inspect tfrag-stats ((this tfrag-stats)) +(defmethod inspect ((this tfrag-stats)) (format #t "[~8x] ~A~%" this 'tfrag-stats) (format #t "~Tfrom: ~D~%" (-> this from)) (format #t "~Tto: ~D~%" (-> this to)) @@ -348,15 +300,12 @@ ;; definition of type tfrag-packet (deftype tfrag-packet (structure) - ((tag uint128 2 :offset-assert 0) + ((tag uint128 2) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type tfrag-packet -(defmethod inspect tfrag-packet ((this tfrag-packet)) +(defmethod inspect ((this tfrag-packet)) (format #t "[~8x] ~A~%" this 'tfrag-packet) (format #t "~Ttag[2] @ #x~X~%" (-> this tag)) this @@ -364,37 +313,34 @@ ;; definition of type tfrag-work (deftype tfrag-work (structure) - ((base-tmpl dma-packet :inline :offset-assert 0) - (level-0-tmpl dma-packet :inline :offset-assert 16) - (common-tmpl dma-packet :inline :offset-assert 32) - (level-1-tmpl dma-packet :inline :offset-assert 48) - (color-tmpl dma-packet :inline :offset-assert 64) - (frag-dists vector :inline :offset-assert 80) - (max-dist vector :inline :offset-assert 96) - (min-dist vector :inline :offset-assert 112) - (color-ptr vector4w :inline :offset-assert 128) - (tr-stat-tfrag tr-stat :offset-assert 144) - (tr-stat-tfrag-near tr-stat :offset-assert 148) - (vu1-enable-tfrag int32 :offset-assert 152) - (vu1-enable-tfrag-near int32 :offset-assert 156) - (cur-vis-bits uint32 :offset-assert 160) - (end-vis-bits uint32 :offset-assert 164) - (src-ptr uint32 :offset-assert 168) - (last-call uint32 :offset-assert 172) - (dma-buffer basic :offset-assert 176) - (test-id uint32 :offset-assert 180) - (wait-from-spr uint32 :offset-assert 184) - (wait-to-spr uint32 :offset-assert 188) - (near-wait-from-spr uint32 :offset-assert 192) - (near-wait-to-spr uint32 :offset-assert 196) + ((base-tmpl dma-packet :inline) + (level-0-tmpl dma-packet :inline) + (common-tmpl dma-packet :inline) + (level-1-tmpl dma-packet :inline) + (color-tmpl dma-packet :inline) + (frag-dists vector :inline) + (max-dist vector :inline) + (min-dist vector :inline) + (color-ptr vector4w :inline) + (tr-stat-tfrag tr-stat) + (tr-stat-tfrag-near tr-stat) + (vu1-enable-tfrag int32) + (vu1-enable-tfrag-near int32) + (cur-vis-bits uint32) + (end-vis-bits uint32) + (src-ptr uint32) + (last-call uint32) + (dma-buffer basic) + (test-id uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (near-wait-from-spr uint32) + (near-wait-to-spr uint32) ) - :method-count-assert 9 - :size-assert #xc8 - :flag-assert #x9000000c8 ) ;; definition for method 3 of type tfrag-work -(defmethod inspect tfrag-work ((this tfrag-work)) +(defmethod inspect ((this tfrag-work)) (format #t "[~8x] ~A~%" this 'tfrag-work) (format #t "~Tbase-tmpl: #~%" (-> this base-tmpl)) (format #t "~Tlevel-0-tmpl: #~%" (-> this level-0-tmpl)) @@ -424,19 +370,16 @@ ;; definition of type tfrag-dma (deftype tfrag-dma (structure) - ((banka tfragment 16 :inline :offset-assert 0) - (bankb tfragment 16 :inline :offset-assert 1024) - (outa uint128 128 :offset-assert 2048) - (outb uint128 128 :offset-assert 4096) - (colors rgba 2047 :offset-assert 6144) + ((banka tfragment 16 :inline) + (bankb tfragment 16 :inline) + (outa uint128 128) + (outb uint128 128) + (colors rgba 2047) ) - :method-count-assert 9 - :size-assert #x37fc - :flag-assert #x9000037fc ) ;; definition for method 3 of type tfrag-dma -(defmethod inspect tfrag-dma ((this tfrag-dma)) +(defmethod inspect ((this tfrag-dma)) (format #t "[~8x] ~A~%" this 'tfrag-dma) (format #t "~Tbanka[16] @ #x~X~%" (-> this banka)) (format #t "~Tbankb[16] @ #x~X~%" (-> this bankb)) diff --git a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-methods_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-methods_REF.gc index ca4b12fe5f1..bc7ea3b0169 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-methods_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-methods_REF.gc @@ -731,7 +731,7 @@ ;; definition for method 10 of type drawable-tree-tfrag ;; INFO: Return type mismatch drawable-tree-tfrag vs none. -(defmethod draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* tfrag-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) @@ -745,7 +745,7 @@ ;; definition for method 10 of type drawable-tree-trans-tfrag ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. -(defmethod draw drawable-tree-trans-tfrag ((this drawable-tree-trans-tfrag) (arg0 drawable-tree-trans-tfrag) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-trans-tfrag) (arg0 drawable-tree-trans-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* trans-tfrag-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) @@ -759,7 +759,7 @@ ;; definition for method 10 of type drawable-tree-dirt-tfrag ;; INFO: Return type mismatch drawable-tree-dirt-tfrag vs none. -(defmethod draw drawable-tree-dirt-tfrag ((this drawable-tree-dirt-tfrag) (arg0 drawable-tree-dirt-tfrag) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-dirt-tfrag) (arg0 drawable-tree-dirt-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* dirt-tfrag-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) @@ -773,7 +773,7 @@ ;; definition for method 10 of type drawable-tree-ice-tfrag ;; INFO: Return type mismatch drawable-tree-ice-tfrag vs none. -(defmethod draw drawable-tree-ice-tfrag ((this drawable-tree-ice-tfrag) (arg0 drawable-tree-ice-tfrag) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-ice-tfrag) (arg0 drawable-tree-ice-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* ice-tfrag-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) @@ -787,7 +787,7 @@ ;; definition for method 10 of type drawable-tree-lowres-tfrag ;; INFO: Return type mismatch drawable-tree-lowres-tfrag vs none. -(defmethod draw drawable-tree-lowres-tfrag ((this drawable-tree-lowres-tfrag) (arg0 drawable-tree-lowres-tfrag) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-lowres-tfrag) (arg0 drawable-tree-lowres-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* lowres-tfrag-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) @@ -801,7 +801,7 @@ ;; definition for method 10 of type drawable-tree-lowres-trans-tfrag ;; INFO: Return type mismatch drawable-tree-lowres-trans-tfrag vs none. -(defmethod draw drawable-tree-lowres-trans-tfrag ((this drawable-tree-lowres-trans-tfrag) (arg0 drawable-tree-lowres-trans-tfrag) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-lowres-trans-tfrag) (arg0 drawable-tree-lowres-trans-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* lowres-trans-tfrag-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) @@ -814,7 +814,7 @@ ) ;; definition for method 14 of type tfragment -(defmethod collect-stats tfragment ((this tfragment)) +(defmethod collect-stats ((this tfragment)) (stats-tfrag-asm this) (none) ) @@ -822,7 +822,7 @@ ;; definition for method 14 of type drawable-tree-tfrag ;; INFO: Used lq/sq ;; INFO: Return type mismatch drawable-tree-tfrag vs none. -(defmethod collect-stats drawable-tree-tfrag ((this drawable-tree-tfrag)) +(defmethod collect-stats ((this drawable-tree-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) @@ -843,7 +843,7 @@ ;; definition for method 14 of type drawable-tree-lowres-tfrag ;; INFO: Used lq/sq ;; INFO: Return type mismatch drawable-tree-lowres-tfrag vs none. -(defmethod collect-stats drawable-tree-lowres-tfrag ((this drawable-tree-lowres-tfrag)) +(defmethod collect-stats ((this drawable-tree-lowres-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) @@ -864,7 +864,7 @@ ;; definition for method 14 of type drawable-tree-trans-tfrag ;; INFO: Used lq/sq ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. -(defmethod collect-stats drawable-tree-trans-tfrag ((this drawable-tree-trans-tfrag)) +(defmethod collect-stats ((this drawable-tree-trans-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) @@ -887,7 +887,7 @@ ;; definition for method 14 of type drawable-tree-lowres-trans-tfrag ;; INFO: Used lq/sq ;; INFO: Return type mismatch drawable-tree-lowres-trans-tfrag vs none. -(defmethod collect-stats drawable-tree-lowres-trans-tfrag ((this drawable-tree-lowres-trans-tfrag)) +(defmethod collect-stats ((this drawable-tree-lowres-trans-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) @@ -910,7 +910,7 @@ ;; definition for method 14 of type drawable-tree-dirt-tfrag ;; INFO: Used lq/sq ;; INFO: Return type mismatch drawable-tree-dirt-tfrag vs none. -(defmethod collect-stats drawable-tree-dirt-tfrag ((this drawable-tree-dirt-tfrag)) +(defmethod collect-stats ((this drawable-tree-dirt-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) @@ -933,7 +933,7 @@ ;; definition for method 14 of type drawable-tree-ice-tfrag ;; INFO: Used lq/sq ;; INFO: Return type mismatch drawable-tree-ice-tfrag vs none. -(defmethod collect-stats drawable-tree-ice-tfrag ((this drawable-tree-ice-tfrag)) +(defmethod collect-stats ((this drawable-tree-ice-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) @@ -955,7 +955,7 @@ ;; definition for method 14 of type drawable-inline-array-tfrag ;; INFO: Return type mismatch drawable-inline-array-tfrag vs none. -(defmethod collect-stats drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) +(defmethod collect-stats ((this drawable-inline-array-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this data s5-0))) @@ -970,7 +970,7 @@ ;; definition for method 14 of type drawable-inline-array-trans-tfrag ;; INFO: Return type mismatch drawable-inline-array-trans-tfrag vs none. -(defmethod collect-stats drawable-inline-array-trans-tfrag ((this drawable-inline-array-trans-tfrag)) +(defmethod collect-stats ((this drawable-inline-array-trans-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this data s5-0))) @@ -985,7 +985,7 @@ ;; definition for method 15 of type drawable-tree-tfrag ;; INFO: Return type mismatch drawable-tree-tfrag vs none. -(defmethod debug-draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (dotimes (s4-0 (-> this length)) (let ((a1-1 (-> this arrays s4-0))) @@ -998,7 +998,7 @@ ;; definition for method 15 of type drawable-tree-trans-tfrag ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. -(defmethod debug-draw drawable-tree-trans-tfrag ((this drawable-tree-trans-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-trans-tfrag) (arg0 drawable) (arg1 display-frame)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (dotimes (s4-0 (-> this length)) (let ((a1-1 (-> this arrays s4-0))) @@ -1011,7 +1011,7 @@ ;; definition for method 15 of type drawable-inline-array-tfrag ;; INFO: Return type mismatch drawable-inline-array-tfrag vs none. -(defmethod debug-draw drawable-inline-array-tfrag ((this drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) (dotimes (s4-0 (-> this length)) (let ((s3-0 (-> this data s4-0))) (if (vis-cull (-> s3-0 id)) @@ -1023,7 +1023,7 @@ ) ;; definition for method 15 of type tfragment -(defmethod debug-draw tfragment ((this tfragment) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this tfragment) (arg0 drawable) (arg1 display-frame)) (-> arg1 global-buf) (edge-debug-lines (-> this debug-data debug-lines)) (none) diff --git a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag_REF.gc index 5c3c251c702..afdd2f13d3d 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 9 of type tfragment -(defmethod login tfragment ((this tfragment)) +(defmethod login ((this tfragment)) (dotimes (s5-0 (the-as int (-> this num-shaders))) (adgif-shader-login-no-remap (-> this shader s5-0)) ) @@ -10,7 +10,7 @@ ) ;; definition for method 8 of type tfragment -(defmethod mem-usage tfragment ((this tfragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this tfragment) (arg0 memory-usage-block) (arg1 int)) (when (logtest? arg1 2) (+! (-> arg0 data 19 count) 1) (let ((v1-6 (+ (-> this num-base-colors) (-> this num-level0-colors) (-> this num-level1-colors)))) @@ -89,7 +89,7 @@ ) ;; definition for method 3 of type drawable-inline-array-tfrag -(defmethod inspect drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) +(defmethod inspect ((this drawable-inline-array-tfrag)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) @@ -100,7 +100,7 @@ ) ;; definition for method 9 of type drawable-inline-array-tfrag -(defmethod login drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) +(defmethod login ((this drawable-inline-array-tfrag)) (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) ) @@ -108,7 +108,7 @@ ) ;; definition for method 8 of type drawable-inline-array-tfrag -(defmethod mem-usage drawable-inline-array-tfrag ((this drawable-inline-array-tfrag) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-tfrag) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -123,7 +123,7 @@ ) ;; definition for method 8 of type drawable-tree-tfrag -(defmethod mem-usage drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-tree-tfrag) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) "drawable-group") (+! (-> arg0 data 0 count) 1) @@ -148,7 +148,7 @@ ;; definition for method 5 of type drawable-inline-array-tfrag ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) +(defmethod asize-of ((this drawable-inline-array-tfrag)) (the-as int (+ (-> drawable-inline-array-tfrag size) (* (+ (-> this length) -1) 64))) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/tie/generic-tie-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tie/generic-tie-h_REF.gc index 41d516a1609..a623e27a926 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tie/generic-tie-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tie/generic-tie-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type generic-tie-instance (deftype generic-tie-instance (structure) - ((matrix-tag dma-packet :inline :offset-assert 0) - (matrix-data vector 6 :inline :offset-assert 16) - (index-tag dma-packet :inline :offset-assert 112) - (indices uint8 224 :offset-assert 128) - (end-tag dma-packet :inline :offset-assert 352) + ((matrix-tag dma-packet :inline) + (matrix-data vector 6 :inline) + (index-tag dma-packet :inline) + (indices uint8 224) + (end-tag dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x170 - :flag-assert #x900000170 ) ;; definition for method 3 of type generic-tie-instance -(defmethod inspect generic-tie-instance ((this generic-tie-instance)) +(defmethod inspect ((this generic-tie-instance)) (format #t "[~8x] ~A~%" this 'generic-tie-instance) (format #t "~Tmatrix-tag: #~%" (-> this matrix-tag)) (format #t "~Tmatrix-data[6] @ #x~X~%" (-> this matrix-data)) @@ -27,23 +24,20 @@ ;; definition of type generic-tie-input (deftype generic-tie-input (structure) - ((palette-tag dma-packet :inline :offset-assert 0) - (palette rgba 128 :offset-assert 16) - (model-tag dma-packet :inline :offset-assert 528) - (model vector 146 :inline :offset-assert 544) - (matrix-tag dma-packet :inline :offset-assert 2880) - (matrix-data vector 6 :inline :offset-assert 2896) - (index-tag dma-packet :inline :offset-assert 2992) - (indices uint8 224 :offset-assert 3008) - (end-tag dma-packet :inline :offset-assert 3232) + ((palette-tag dma-packet :inline) + (palette rgba 128) + (model-tag dma-packet :inline) + (model vector 146 :inline) + (matrix-tag dma-packet :inline) + (matrix-data vector 6 :inline) + (index-tag dma-packet :inline) + (indices uint8 224) + (end-tag dma-packet :inline) ) - :method-count-assert 9 - :size-assert #xcb0 - :flag-assert #x900000cb0 ) ;; definition for method 3 of type generic-tie-input -(defmethod inspect generic-tie-input ((this generic-tie-input)) +(defmethod inspect ((this generic-tie-input)) (format #t "[~8x] ~A~%" this 'generic-tie-input) (format #t "~Tpalette-tag: #~%" (-> this palette-tag)) (format #t "~Tpalette[128] @ #x~X~%" (-> this palette)) @@ -59,26 +53,23 @@ ;; definition of type generic-tie-run-control (deftype generic-tie-run-control (structure) - ((skip-bp2 uint8 :offset-assert 0) - (skip-ips uint8 :offset-assert 1) - (gifbuf-skip uint8 :offset-assert 2) - (strips uint8 :offset-assert 3) - (target-bp1 uint8 :offset-assert 4) - (target-bp2 uint8 :offset-assert 5) - (target-ip1 uint8 :offset-assert 6) - (target-ip2 uint8 :offset-assert 7) - (target-bps uint8 :offset-assert 8) - (target-ips uint8 :offset-assert 9) - (is-generic uint8 :offset-assert 10) - (reserved uint8 :offset-assert 11) + ((skip-bp2 uint8) + (skip-ips uint8) + (gifbuf-skip uint8) + (strips uint8) + (target-bp1 uint8) + (target-bp2 uint8) + (target-ip1 uint8) + (target-ip2 uint8) + (target-bps uint8) + (target-ips uint8) + (is-generic uint8) + (reserved uint8) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type generic-tie-run-control -(defmethod inspect generic-tie-run-control ((this generic-tie-run-control)) +(defmethod inspect ((this generic-tie-run-control)) (format #t "[~8x] ~A~%" this 'generic-tie-run-control) (format #t "~Tskip-bp2: ~D~%" (-> this skip-bp2)) (format #t "~Tskip-ips: ~D~%" (-> this skip-ips)) @@ -97,27 +88,24 @@ ;; definition of type generic-tie-base-point (deftype generic-tie-base-point (structure) - ((x int16 :offset-assert 0) - (y int16 :offset-assert 2) - (z int16 :offset-assert 4) - (d0 int16 :offset-assert 6) - (vtx uint64 :offset 0) - (u int16 :offset-assert 8) - (v int16 :offset-assert 10) - (tex uint32 :offset 8) - (w int16 :offset-assert 12) - (d1 int16 :offset-assert 14) - (data uint16 8 :offset 0) - (quad uint128 :offset 0) + ((x int16) + (y int16) + (z int16) + (d0 int16) + (vtx uint64 :overlay-at x) + (u int16) + (v int16) + (tex uint32 :overlay-at u) + (w int16) + (d1 int16) + (data uint16 8 :overlay-at x) + (quad uint128 :overlay-at x) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type generic-tie-base-point ;; INFO: Used lq/sq -(defmethod inspect generic-tie-base-point ((this generic-tie-base-point)) +(defmethod inspect ((this generic-tie-base-point)) (format #t "[~8x] ~A~%" this 'generic-tie-base-point) (format #t "~Tdata[8] @ #x~X~%" (&-> this x)) (format #t "~Tquad: ~D~%" (-> this quad)) @@ -136,15 +124,12 @@ ;; definition of type generic-tie-bps (deftype generic-tie-bps (structure) - ((bp generic-tie-base-point 4 :inline :offset-assert 0) + ((bp generic-tie-base-point 4 :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type generic-tie-bps -(defmethod inspect generic-tie-bps ((this generic-tie-bps)) +(defmethod inspect ((this generic-tie-bps)) (format #t "[~8x] ~A~%" this 'generic-tie-bps) (format #t "~Tbp[4] @ #x~X~%" (-> this bp)) this @@ -152,32 +137,29 @@ ;; definition of type generic-tie-interp-point (deftype generic-tie-interp-point (structure) - ((x int16 :offset-assert 0) - (y int16 :offset-assert 2) - (z int16 :offset-assert 4) - (d0 int16 :offset-assert 6) - (vtx0 uint64 :offset 0) - (dx int16 :offset-assert 8) - (dy int16 :offset-assert 10) - (dz int16 :offset-assert 12) - (unused int16 :offset-assert 14) - (vtx1 uint64 :offset 8) - (u int16 :offset-assert 16) - (v int16 :offset-assert 18) - (tex uint32 :offset 16) - (w int16 :offset-assert 20) - (d1 int16 :offset-assert 22) - (data uint16 12 :offset 0) + ((x int16) + (y int16) + (z int16) + (d0 int16) + (vtx0 uint64 :overlay-at x) + (dx int16) + (dy int16) + (dz int16) + (unused int16) + (vtx1 uint64 :overlay-at dx) + (u int16) + (v int16) + (tex uint32 :overlay-at u) + (w int16) + (d1 int16) + (data uint16 12 :overlay-at x) ) :pack-me - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type generic-tie-interp-point ;; INFO: Used lq/sq -(defmethod inspect generic-tie-interp-point ((this generic-tie-interp-point)) +(defmethod inspect ((this generic-tie-interp-point)) (format #t "[~8x] ~A~%" this 'generic-tie-interp-point) (format #t "~Tdata[12] @ #x~X~%" (&-> this x)) (format #t "~Tquad: ~D~%" (-> (the-as (pointer uint128) this) 0)) @@ -201,15 +183,12 @@ ;; definition of type generic-tie-ips (deftype generic-tie-ips (structure) - ((ip generic-tie-interp-point 2 :inline :offset-assert 0) + ((ip generic-tie-interp-point 2 :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type generic-tie-ips -(defmethod inspect generic-tie-ips ((this generic-tie-ips)) +(defmethod inspect ((this generic-tie-ips)) (format #t "[~8x] ~A~%" this 'generic-tie-ips) (format #t "~Tip[2] @ #x~X~%" (-> this ip)) this @@ -217,24 +196,21 @@ ;; definition of type generic-tie-header (deftype generic-tie-header (structure) - ((effect uint8 :offset-assert 0) - (interp-table-size uint8 :offset-assert 1) - (num-bps uint8 :offset-assert 2) - (num-ips uint8 :offset-assert 3) - (tint-color uint32 :offset-assert 4) - (index-table-offset uint16 :offset-assert 8) - (kick-table-offset uint16 :offset-assert 10) - (normal-table-offset uint16 :offset-assert 12) - (interp-table-offset uint16 :offset-assert 14) - (gsf-header gsf-header :inline :offset-assert 16) + ((effect uint8) + (interp-table-size uint8) + (num-bps uint8) + (num-ips uint8) + (tint-color uint32) + (index-table-offset uint16) + (kick-table-offset uint16) + (normal-table-offset uint16) + (interp-table-offset uint16) + (gsf-header gsf-header :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type generic-tie-header -(defmethod inspect generic-tie-header ((this generic-tie-header)) +(defmethod inspect ((this generic-tie-header)) (format #t "[~8x] ~A~%" this 'generic-tie-header) (format #t "~Teffect: ~D~%" (-> this effect)) (format #t "~Tinterp-table-size: ~D~%" (-> this interp-table-size)) @@ -251,17 +227,14 @@ ;; definition of type generic-tie-matrix (deftype generic-tie-matrix (structure) - ((matrix matrix :inline :offset-assert 0) - (morph vector :inline :offset-assert 64) - (fog qword :inline :offset-assert 80) + ((matrix matrix :inline) + (morph vector :inline) + (fog qword :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type generic-tie-matrix -(defmethod inspect generic-tie-matrix ((this generic-tie-matrix)) +(defmethod inspect ((this generic-tie-matrix)) (format #t "[~8x] ~A~%" this 'generic-tie-matrix) (format #t "~Tmatrix: #~%" (-> this matrix)) (format #t "~Tmorph: #~%" (-> this morph)) @@ -271,18 +244,15 @@ ;; definition of type generic-tie-normal (deftype generic-tie-normal (structure) - ((x int8 :offset-assert 0) - (y int8 :offset-assert 1) - (z int8 :offset-assert 2) - (dummy int8 :offset-assert 3) + ((x int8) + (y int8) + (z int8) + (dummy int8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type generic-tie-normal -(defmethod inspect generic-tie-normal ((this generic-tie-normal)) +(defmethod inspect ((this generic-tie-normal)) (format #t "[~8x] ~A~%" this 'generic-tie-normal) (format #t "~Tx: ~D~%" (-> this x)) (format #t "~Ty: ~D~%" (-> this y)) @@ -293,29 +263,26 @@ ;; definition of type generic-tie-control (deftype generic-tie-control (structure) - ((ptr-palette uint32 :offset-assert 0) - (ptr-shaders uint32 :offset-assert 4) - (ptr-runctrl generic-tie-run-control :offset-assert 8) - (ptr-verts uint32 :offset-assert 12) - (ptr-generic generic-tie-header :offset-assert 16) - (ptr-dps uint32 :offset-assert 20) - (ptr-kicks uint32 :offset-assert 24) - (ptr-normals uint32 :offset-assert 28) - (ptr-interp uint32 :offset-assert 32) - (ptr-mtxs generic-tie-matrix :offset-assert 36) - (ptr-cinds uint32 :offset-assert 40) - (next-instance uint32 :offset-assert 44) - (next-model uint32 :offset-assert 48) - (next-is-model uint32 :offset-assert 52) - (tie-type uint32 :offset-assert 56) + ((ptr-palette uint32) + (ptr-shaders uint32) + (ptr-runctrl generic-tie-run-control) + (ptr-verts uint32) + (ptr-generic generic-tie-header) + (ptr-dps uint32) + (ptr-kicks uint32) + (ptr-normals uint32) + (ptr-interp uint32) + (ptr-mtxs generic-tie-matrix) + (ptr-cinds uint32) + (next-instance uint32) + (next-model uint32) + (next-is-model uint32) + (tie-type uint32) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) ;; definition for method 3 of type generic-tie-control -(defmethod inspect generic-tie-control ((this generic-tie-control)) +(defmethod inspect ((this generic-tie-control)) (format #t "[~8x] ~A~%" this 'generic-tie-control) (format #t "~Tptr-palette: #x~X~%" (-> this ptr-palette)) (format #t "~Tptr-shaders: #x~X~%" (-> this ptr-shaders)) @@ -337,23 +304,20 @@ ;; definition of type generic-tie-stats (deftype generic-tie-stats (structure) - ((num-bps uint32 :offset-assert 0) - (num-ips uint32 :offset-assert 4) - (num-dps uint32 :offset-assert 8) - (num-shaders uint32 :offset-assert 12) - (num-models uint32 :offset-assert 16) - (num-instances uint32 :offset-assert 20) - (num-waits uint32 :offset-assert 24) - (num-qwc uint32 :offset-assert 28) - (max-qwc uint32 :offset-assert 32) + ((num-bps uint32) + (num-ips uint32) + (num-dps uint32) + (num-shaders uint32) + (num-models uint32) + (num-instances uint32) + (num-waits uint32) + (num-qwc uint32) + (max-qwc uint32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type generic-tie-stats -(defmethod inspect generic-tie-stats ((this generic-tie-stats)) +(defmethod inspect ((this generic-tie-stats)) (format #t "[~8x] ~A~%" this 'generic-tie-stats) (format #t "~Tnum-bps: ~D~%" (-> this num-bps)) (format #t "~Tnum-ips: ~D~%" (-> this num-ips)) @@ -369,19 +333,16 @@ ;; definition of type generic-tie-calls (deftype generic-tie-calls (structure) - ((generic-prepare-dma-double basic :offset-assert 0) - (generic-envmap-dproc basic :offset-assert 4) - (generic-interp-dproc basic :offset-assert 8) - (generic-no-light-dproc basic :offset-assert 12) + ((generic-prepare-dma-double basic) + (generic-envmap-dproc basic) + (generic-interp-dproc basic) + (generic-no-light-dproc basic) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type generic-tie-calls -(defmethod inspect generic-tie-calls ((this generic-tie-calls)) +(defmethod inspect ((this generic-tie-calls)) (format #t "[~8x] ~A~%" this 'generic-tie-calls) (format #t "~Tgeneric-prepare-dma-double: ~A~%" (-> this generic-prepare-dma-double)) (format #t "~Tgeneric-envmap-dproc: ~A~%" (-> this generic-envmap-dproc)) @@ -392,24 +353,21 @@ ;; definition of type generic-tie-shadow (deftype generic-tie-shadow (structure) - ((out-buf gsf-buffer :offset-assert 0) - (cur-buf uint32 :offset-assert 4) - (tie-type int32 :offset-assert 8) - (ptr-inst uint32 :offset-assert 12) - (ptr-buf uint32 :offset-assert 16) - (inst-xor int32 :offset-assert 20) - (end-of-chain uint32 :offset-assert 24) - (write-limit uint32 :offset-assert 28) - (calls generic-tie-calls :inline :offset-assert 32) + ((out-buf gsf-buffer) + (cur-buf uint32) + (tie-type int32) + (ptr-inst uint32) + (ptr-buf uint32) + (inst-xor int32) + (end-of-chain uint32) + (write-limit uint32) + (calls generic-tie-calls :inline) ) :pack-me - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type generic-tie-shadow -(defmethod inspect generic-tie-shadow ((this generic-tie-shadow)) +(defmethod inspect ((this generic-tie-shadow)) (format #t "[~8x] ~A~%" this 'generic-tie-shadow) (format #t "~Tout-buf: #~%" (-> this out-buf)) (format #t "~Tcur-buf: #x~X~%" (-> this cur-buf)) @@ -425,21 +383,18 @@ ;; definition of type generic-tie-work (deftype generic-tie-work (structure) - ((control generic-tie-control :inline :offset-assert 0) - (interp-job generic-interp-job :inline :offset-assert 60) - (shadow generic-tie-shadow :inline :offset-assert 76) - (input-a generic-tie-input :inline :offset-assert 128) - (input-b generic-tie-input :inline :offset-assert 3376) - (inst-buf generic-tie-instance :inline :offset-assert 6624) - (palette-buf rgba 128 :offset-assert 6992) + ((control generic-tie-control :inline) + (interp-job generic-interp-job :inline) + (shadow generic-tie-shadow :inline) + (input-a generic-tie-input :inline) + (input-b generic-tie-input :inline) + (inst-buf generic-tie-instance :inline) + (palette-buf rgba 128) ) - :method-count-assert 9 - :size-assert #x1d50 - :flag-assert #x900001d50 ) ;; definition for method 3 of type generic-tie-work -(defmethod inspect generic-tie-work ((this generic-tie-work)) +(defmethod inspect ((this generic-tie-work)) (format #t "[~8x] ~A~%" this 'generic-tie-work) (format #t "~Tcontrol: #~%" (-> this control)) (format #t "~Tinterp-job: #~%" (-> this interp-job)) diff --git a/test/decompiler/reference/jak1/engine/gfx/tie/tie-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tie/tie-h_REF.gc index 3aadec52316..9cfe73041a5 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tie/tie-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tie/tie-h_REF.gc @@ -3,29 +3,26 @@ ;; definition of type tie-fragment (deftype tie-fragment (drawable) - ((gif-ref (inline-array adgif-shader) :offset 4) - (point-ref uint32 :offset 8) - (color-index uint16 :offset 12) - (base-colors uint8 :offset 14) - (tex-count uint16 :offset-assert 32) - (gif-count uint16 :offset-assert 34) - (vertex-count uint16 :offset-assert 36) - (color-count uint16 :offset-assert 38) - (num-tris uint16 :offset-assert 40) - (num-dverts uint16 :offset-assert 42) - (dp-ref uint32 :offset-assert 44) - (dp-qwc uint32 :offset-assert 48) - (generic-ref uint32 :offset-assert 52) - (generic-count uint32 :offset-assert 56) - (debug-lines (array vector-array) :offset-assert 60) + ((gif-ref (inline-array adgif-shader) :overlay-at id) + (point-ref uint32 :offset 8) + (color-index uint16 :offset 12) + (base-colors uint8 :offset 14) + (tex-count uint16) + (gif-count uint16) + (vertex-count uint16) + (color-count uint16) + (num-tris uint16) + (num-dverts uint16) + (dp-ref uint32) + (dp-qwc uint32) + (generic-ref uint32) + (generic-count uint32) + (debug-lines (array vector-array)) ) - :method-count-assert 18 - :size-assert #x40 - :flag-assert #x1200000040 ) ;; definition for method 3 of type tie-fragment -(defmethod inspect tie-fragment ((this tie-fragment)) +(defmethod inspect ((this tie-fragment)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) @@ -49,18 +46,15 @@ ;; definition of type instance-tie (deftype instance-tie (instance) - ((color-indices uint32 :offset 8) - (bucket-ptr prototype-bucket-tie :offset 12) - (max-scale uint16 :offset 38) - (flags uint16 :offset 46) + ((color-indices uint32 :overlay-at error) + (bucket-ptr prototype-bucket-tie :offset 12) + (max-scale uint16 :overlay-at (-> origin data 3)) + (flags uint16 :overlay-at (-> origin data 7)) ) - :method-count-assert 18 - :size-assert #x40 - :flag-assert #x1200000040 ) ;; definition for method 3 of type instance-tie -(defmethod inspect instance-tie ((this instance-tie)) +(defmethod inspect ((this instance-tie)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) @@ -76,25 +70,19 @@ ;; definition of type drawable-inline-array-instance-tie (deftype drawable-inline-array-instance-tie (drawable-inline-array) - ((data instance-tie 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 96) + ((data instance-tie 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x64 - :flag-assert #x1200000064 ) ;; definition of type drawable-tree-instance-tie (deftype drawable-tree-instance-tie (drawable-tree) - ((prototypes proxy-prototype-array-tie :offset 8) + ((prototypes proxy-prototype-array-tie :offset 8) ) - :method-count-assert 18 - :size-assert #x24 - :flag-assert #x1200000024 ) ;; definition for method 3 of type drawable-tree-instance-tie -(defmethod inspect drawable-tree-instance-tie ((this drawable-tree-instance-tie)) +(defmethod inspect ((this drawable-tree-instance-tie)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) @@ -106,27 +94,21 @@ ;; definition of type prototype-tie (deftype prototype-tie (drawable-inline-array) - ((data tie-fragment 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 96) + ((data tie-fragment 1 :inline) + (pad uint32) ) - :method-count-assert 18 - :size-assert #x64 - :flag-assert #x1200000064 ) ;; definition of type tie-matrix (deftype tie-matrix (structure) - ((mat matrix :inline :offset-assert 0) - (morph qword :inline :offset-assert 64) - (fog qword :inline :offset-assert 80) + ((mat matrix :inline) + (morph qword :inline) + (fog qword :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type tie-matrix -(defmethod inspect tie-matrix ((this tie-matrix)) +(defmethod inspect ((this tie-matrix)) (format #t "[~8x] ~A~%" this 'tie-matrix) (format #t "~Tmat: #~%" (-> this mat)) (format #t "~Tmorph: #~%" (-> this morph)) @@ -136,48 +118,45 @@ ;; definition of type instance-tie-work (deftype instance-tie-work (structure) - ((wind-const vector :inline :offset-assert 0) - (hmge-d vector :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (wind-force vector :inline :offset-assert 48) - (constant vector :inline :offset-assert 64) - (far-morph vector :inline :offset-assert 80) - (dist-test vector :inline :offset-assert 96) - (min-dist vector :inline :offset-assert 112) - (guard-plane plane 4 :inline :offset-assert 128) - (upload-color-0 dma-packet :inline :offset-assert 192) - (upload-color-1 dma-packet :inline :offset-assert 208) - (upload-color-2 dma-packet :inline :offset-assert 224) - (upload-color-ret dma-packet :inline :offset-assert 240) - (upload-color-temp dma-packet :inline :offset-assert 256) - (generic-color-0 dma-packet :inline :offset-assert 272) - (generic-color-1 dma-packet :inline :offset-assert 288) - (generic-color-end dma-packet :inline :offset-assert 304) - (tie-near-perspective-matrix matrix :inline :offset-assert 320) - (wind-vectors uint32 :offset-assert 384) - (test-id uint32 :offset-assert 388) - (test-id2 uint32 :offset-assert 392) - (dma-buffer basic :offset-assert 396) - (to-spr uint32 :offset-assert 400) - (from-spr uint32 :offset-assert 404) - (wind-work uint32 :offset-assert 408) - (cur-vis-bits uint32 :offset-assert 412) - (end-vis-bits uint32 :offset-assert 416) - (first-generic-prototype uint32 :offset-assert 420) - (refl-fade-fac float :offset-assert 424) - (refl-fade-end float :offset-assert 428) - (flags uint32 :offset-assert 432) - (paused basic :offset-assert 436) - (wait-from-spr uint32 :offset-assert 440) - (wait-to-spr uint32 :offset-assert 444) + ((wind-const vector :inline) + (hmge-d vector :inline) + (hvdf-offset vector :inline) + (wind-force vector :inline) + (constant vector :inline) + (far-morph vector :inline) + (dist-test vector :inline) + (min-dist vector :inline) + (guard-plane plane 4 :inline) + (upload-color-0 dma-packet :inline) + (upload-color-1 dma-packet :inline) + (upload-color-2 dma-packet :inline) + (upload-color-ret dma-packet :inline) + (upload-color-temp dma-packet :inline) + (generic-color-0 dma-packet :inline) + (generic-color-1 dma-packet :inline) + (generic-color-end dma-packet :inline) + (tie-near-perspective-matrix matrix :inline) + (wind-vectors uint32) + (test-id uint32) + (test-id2 uint32) + (dma-buffer basic) + (to-spr uint32) + (from-spr uint32) + (wind-work uint32) + (cur-vis-bits uint32) + (end-vis-bits uint32) + (first-generic-prototype uint32) + (refl-fade-fac float) + (refl-fade-end float) + (flags uint32) + (paused basic) + (wait-from-spr uint32) + (wait-to-spr uint32) ) - :method-count-assert 9 - :size-assert #x1c0 - :flag-assert #x9000001c0 ) ;; definition for method 3 of type instance-tie-work -(defmethod inspect instance-tie-work ((this instance-tie-work)) +(defmethod inspect ((this instance-tie-work)) (format #t "[~8x] ~A~%" this 'instance-tie-work) (format #t "~Twind-const: #~%" (-> this wind-const)) (format #t "~Thmge-d: #~%" (-> this hmge-d)) @@ -218,19 +197,16 @@ ;; definition of type instance-tie-dma (deftype instance-tie-dma (structure) - ((banka instance-tie 32 :inline :offset-assert 0) - (bankb instance-tie 32 :inline :offset-assert 2048) - (outa uint128 256 :offset-assert 4096) - (outb uint128 256 :offset-assert 8192) - (work instance-tie-work :dynamic :offset-assert 12288) + ((banka instance-tie 32 :inline) + (bankb instance-tie 32 :inline) + (outa uint128 256) + (outb uint128 256) + (work instance-tie-work :dynamic) ) - :method-count-assert 9 - :size-assert #x3000 - :flag-assert #x900003000 ) ;; definition for method 3 of type instance-tie-dma -(defmethod inspect instance-tie-dma ((this instance-tie-dma)) +(defmethod inspect ((this instance-tie-dma)) (format #t "[~8x] ~A~%" this 'instance-tie-dma) (format #t "~Tbanka[32] @ #x~X~%" (-> this banka)) (format #t "~Tbankb[32] @ #x~X~%" (-> this bankb)) @@ -242,39 +218,36 @@ ;; definition of type prototype-tie-work (deftype prototype-tie-work (structure) - ((upload-palette-0 dma-packet :inline :offset-assert 0) - (upload-palette-1 dma-packet :inline :offset-assert 16) - (upload-model-0 dma-packet :inline :offset-assert 32) - (upload-model-1 dma-packet :inline :offset-assert 48) - (upload-model-2 dma-packet :inline :offset-assert 64) - (upload-model-3 dma-packet :inline :offset-assert 80) - (upload-model-near-0 dma-packet :inline :offset-assert 96) - (upload-model-near-1 dma-packet :inline :offset-assert 112) - (upload-model-near-2 dma-packet :inline :offset-assert 128) - (upload-model-near-3 dma-packet :inline :offset-assert 144) - (upload-model-near-4 dma-packet :inline :offset-assert 160) - (generic-envmap-shader dma-packet :inline :offset-assert 176) - (generic-palette dma-packet :inline :offset-assert 192) - (generic-model-0 dma-packet :inline :offset-assert 208) - (generic-model-1 dma-packet :inline :offset-assert 224) - (generic-model-2 dma-packet :inline :offset-assert 240) - (generic-model-next dma-packet :inline :offset-assert 256) - (clamp uint64 :offset-assert 272) - (prototype-array basic :offset-assert 280) - (generic-wait-from-spr uint32 :offset-assert 284) - (generic-wait-to-spr uint32 :offset-assert 288) - (wait-from-spr uint32 :offset-assert 292) - (wait-to-spr uint32 :offset-assert 296) - (near-wait-from-spr uint32 :offset-assert 300) - (near-wait-to-spr uint32 :offset-assert 304) + ((upload-palette-0 dma-packet :inline) + (upload-palette-1 dma-packet :inline) + (upload-model-0 dma-packet :inline) + (upload-model-1 dma-packet :inline) + (upload-model-2 dma-packet :inline) + (upload-model-3 dma-packet :inline) + (upload-model-near-0 dma-packet :inline) + (upload-model-near-1 dma-packet :inline) + (upload-model-near-2 dma-packet :inline) + (upload-model-near-3 dma-packet :inline) + (upload-model-near-4 dma-packet :inline) + (generic-envmap-shader dma-packet :inline) + (generic-palette dma-packet :inline) + (generic-model-0 dma-packet :inline) + (generic-model-1 dma-packet :inline) + (generic-model-2 dma-packet :inline) + (generic-model-next dma-packet :inline) + (clamp uint64) + (prototype-array basic) + (generic-wait-from-spr uint32) + (generic-wait-to-spr uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (near-wait-from-spr uint32) + (near-wait-to-spr uint32) ) - :method-count-assert 9 - :size-assert #x134 - :flag-assert #x900000134 ) ;; definition for method 3 of type prototype-tie-work -(defmethod inspect prototype-tie-work ((this prototype-tie-work)) +(defmethod inspect ((this prototype-tie-work)) (format #t "[~8x] ~A~%" this 'prototype-tie-work) (format #t "~Tupload-palette-0: #~%" (-> this upload-palette-0)) (format #t "~Tupload-palette-1: #~%" (-> this upload-palette-1)) @@ -306,24 +279,21 @@ ;; definition of type prototype-tie-dma (deftype prototype-tie-dma (structure) - ((colora rgba 256 :offset-assert 0) - (colorb rgba 256 :offset-assert 1024) - (outa uint128 256 :offset-assert 2048) - (outb uint128 256 :offset-assert 6144) - (length uint32 :offset-assert 10240) - (dma-buffer basic :offset-assert 10244) - (this-frag-count uint32 :offset-assert 10248) - (next uint32 4 :offset 10256) - (geometry uint32 4 :offset-assert 10272) - (frag-count uint8 4 :offset-assert 10288) + ((colora rgba 256) + (colorb rgba 256) + (outa uint128 256) + (outb uint128 256) + (length uint32) + (dma-buffer basic) + (this-frag-count uint32) + (next uint32 4 :offset 10256) + (geometry uint32 4) + (frag-count uint8 4) ) - :method-count-assert 9 - :size-assert #x2834 - :flag-assert #x900002834 ) ;; definition for method 3 of type prototype-tie-dma -(defmethod inspect prototype-tie-dma ((this prototype-tie-dma)) +(defmethod inspect ((this prototype-tie-dma)) (format #t "[~8x] ~A~%" this 'prototype-tie-dma) (format #t "~Tcolora[256] @ #x~X~%" (-> this colora)) (format #t "~Tcolorb[256] @ #x~X~%" (-> this colorb)) diff --git a/test/decompiler/reference/jak1/engine/gfx/tie/tie-methods_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tie/tie-methods_REF.gc index 8f8ec1d1f7b..83d58bda2f6 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tie/tie-methods_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tie/tie-methods_REF.gc @@ -178,16 +178,13 @@ ;; definition of type tie-instance-debug (deftype tie-instance-debug (structure) - ((max-instance uint32 :offset-assert 0) - (min-instance uint32 :offset-assert 4) + ((max-instance uint32) + (min-instance uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type tie-instance-debug -(defmethod inspect tie-instance-debug ((this tie-instance-debug)) +(defmethod inspect ((this tie-instance-debug)) (format #t "[~8x] ~A~%" this 'tie-instance-debug) (format #t "~Tmax-instance: ~D~%" (-> this max-instance)) (format #t "~Tmin-instance: ~D~%" (-> this min-instance)) @@ -236,7 +233,7 @@ ;; definition for method 9 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files -(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) +(defmethod login ((this drawable-tree-instance-tie)) (if (nonzero? (-> this prototypes prototype-array-tie)) (login (-> this prototypes prototype-array-tie)) ) @@ -591,7 +588,7 @@ ;; definition for method 10 of type drawable-tree-instance-tie ;; INFO: Return type mismatch drawable-tree-instance-tie vs none. -(defmethod draw drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 drawable-tree-instance-tie) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-instance-tie) (arg0 drawable-tree-instance-tie) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* tie-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) @@ -605,7 +602,7 @@ ;; definition for method 14 of type drawable-tree-instance-tie ;; INFO: Return type mismatch symbol vs none. -(defmethod collect-stats drawable-tree-instance-tie ((this drawable-tree-instance-tie)) +(defmethod collect-stats ((this drawable-tree-instance-tie)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tie-near tie generic)) (-> this data (+ (-> this length) -1)) (let ((v1-8 (-> this prototypes prototype-array-tie))) @@ -706,7 +703,7 @@ ;; definition for method 15 of type drawable-tree-instance-tie ;; INFO: Return type mismatch symbol vs none. -(defmethod debug-draw drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-instance-tie) (arg0 drawable) (arg1 display-frame)) (-> this data (+ (-> this length) -1)) (let* ((s5-0 (-> this prototypes prototype-array-tie)) (s4-0 (-> s5-0 length)) @@ -723,7 +720,7 @@ ;; definition for method 11 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) (collide-with-box (-> this data 0) (-> this length) arg1) 0 (none) @@ -732,7 +729,7 @@ ;; definition for method 12 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) (collide-y-probe (-> this data 0) (-> this length) arg1) 0 (none) @@ -741,7 +738,7 @@ ;; definition for method 13 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) (collide-ray (-> this data 0) (-> this length) arg1) 0 (none) @@ -750,7 +747,7 @@ ;; definition for method 11 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) (collide-with-box (-> this data 0) (-> this length) arg1) 0 (none) @@ -759,7 +756,7 @@ ;; definition for method 12 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) (collide-y-probe (-> this data 0) (-> this length) arg1) 0 (none) @@ -768,7 +765,7 @@ ;; definition for method 13 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) (collide-ray (-> this data 0) (-> this length) arg1) 0 (none) @@ -776,7 +773,7 @@ ;; definition for method 11 of type drawable-inline-array-instance-tie ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) (collide-with-box (the-as instance-tie (-> this data)) (-> this length) arg1) 0 (none) @@ -784,7 +781,7 @@ ;; definition for method 12 of type drawable-inline-array-instance-tie ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) (collide-y-probe (the-as instance-tie (-> this data)) (-> this length) arg1) 0 (none) @@ -792,7 +789,7 @@ ;; definition for method 13 of type drawable-inline-array-instance-tie ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) (collide-ray (the-as instance-tie (-> this data)) (-> this length) arg1) 0 (none) diff --git a/test/decompiler/reference/jak1/engine/gfx/tie/tie-near_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tie/tie-near_REF.gc index a1d00da744d..d78f845a77d 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tie/tie-near_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tie/tie-near_REF.gc @@ -3,26 +3,23 @@ ;; definition of type tie-near-consts (deftype tie-near-consts (structure) - ((extra qword :inline :offset-assert 0) - (gifbufs qword :inline :offset-assert 16) - (clrbufs qword :inline :offset-assert 32) - (adgif gs-gif-tag :inline :offset-assert 48) - (strgif gs-gif-tag :inline :offset-assert 64) - (fangif gs-gif-tag :inline :offset-assert 80) - (hvdfoffs vector :inline :offset-assert 96) - (invhscale vector :inline :offset-assert 112) - (guard vector :inline :offset-assert 128) - (atest ad-cmd 2 :inline :offset-assert 144) - (atest-tra ad-cmd :inline :offset 144) - (atest-def ad-cmd :inline :offset 160) + ((extra qword :inline) + (gifbufs qword :inline) + (clrbufs qword :inline) + (adgif gs-gif-tag :inline) + (strgif gs-gif-tag :inline) + (fangif gs-gif-tag :inline) + (hvdfoffs vector :inline) + (invhscale vector :inline) + (guard vector :inline) + (atest ad-cmd 2 :inline) + (atest-tra ad-cmd :inline :overlay-at (-> atest 0)) + (atest-def ad-cmd :inline :overlay-at (-> atest 1)) ) - :method-count-assert 9 - :size-assert #xb0 - :flag-assert #x9000000b0 ) ;; definition for method 3 of type tie-near-consts -(defmethod inspect tie-near-consts ((this tie-near-consts)) +(defmethod inspect ((this tie-near-consts)) (format #t "[~8x] ~A~%" this 'tie-near-consts) (format #t "~Textra: #~%" (-> this extra)) (format #t "~Tgifbufs: #~%" (-> this gifbufs)) diff --git a/test/decompiler/reference/jak1/engine/gfx/tie/tie_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tie/tie_REF.gc index 23884832853..8d768a71d28 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tie/tie_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tie/tie_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 9 of type tie-fragment -(defmethod login tie-fragment ((this tie-fragment)) +(defmethod login ((this tie-fragment)) (let ((s5-0 (-> this gif-ref)) (s4-0 (/ (-> this tex-count) (the-as uint 5))) ) @@ -14,7 +14,7 @@ ) ;; definition for method 3 of type drawable-inline-array-instance-tie -(defmethod inspect drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) +(defmethod inspect ((this drawable-inline-array-instance-tie)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) @@ -26,20 +26,20 @@ ;; definition for method 5 of type drawable-inline-array-instance-tie ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) +(defmethod asize-of ((this drawable-inline-array-instance-tie)) (the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> this length) -1) 64))) ) ;; definition for method 9 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files -(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) +(defmethod login ((this drawable-tree-instance-tie)) this ) ;; definition for method 9 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch symbol vs drawable-tree-instance-tie. -(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) +(defmethod login ((this drawable-tree-instance-tie)) (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) ) @@ -47,7 +47,7 @@ ) ;; definition for method 3 of type prototype-tie -(defmethod inspect prototype-tie ((this prototype-tie)) +(defmethod inspect ((this prototype-tie)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) @@ -58,7 +58,7 @@ ) ;; definition for method 9 of type prototype-tie -(defmethod login prototype-tie ((this prototype-tie)) +(defmethod login ((this prototype-tie)) (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) ) @@ -66,7 +66,7 @@ ) ;; definition for method 8 of type drawable-tree-instance-tie -(defmethod mem-usage drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -82,7 +82,7 @@ ) ;; definition for method 8 of type tie-fragment -(defmethod mem-usage tie-fragment ((this tie-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this tie-fragment) (arg0 memory-usage-block) (arg1 int)) (when (logtest? arg1 2) (let ((v1-3 (* (-> this color-count) 4)) (a0-2 (cond @@ -153,7 +153,7 @@ ) ;; definition for method 8 of type instance-tie -(defmethod mem-usage instance-tie ((this instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 19 (-> arg0 length))) (set! (-> arg0 data 18 name) "instance-tie") (+! (-> arg0 data 18 count) 1) @@ -207,7 +207,7 @@ ) ;; definition for method 8 of type drawable-inline-array-instance-tie -(defmethod mem-usage drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -222,7 +222,7 @@ ) ;; definition for method 8 of type prototype-tie -(defmethod mem-usage prototype-tie ((this prototype-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -238,33 +238,30 @@ ;; definition for method 5 of type prototype-tie ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of prototype-tie ((this prototype-tie)) +(defmethod asize-of ((this prototype-tie)) (the-as int (+ (-> prototype-tie size) (* (+ (-> this length) -1) 64))) ) ;; definition of type tie-consts (deftype tie-consts (structure) - ((data uint32 24 :offset-assert 0) - (vector vector 6 :inline :offset 0) - (quads uint128 6 :offset 0) - (adgif gs-gif-tag :inline :offset 0) - (strgif gs-gif-tag :inline :offset 16) - (extra vector :inline :offset 32) - (gifbufs vector :inline :offset 48) - (clrbufs qword :inline :offset 64) - (misc qword :inline :offset 80) - (atestgif gs-gif-tag :inline :offset 96) - (atest ad-cmd 2 :inline :offset 112) - (atest-tra ad-cmd :inline :offset 112) - (atest-def ad-cmd :inline :offset 128) + ((data uint32 24) + (vector vector 6 :inline :overlay-at (-> data 0)) + (quads uint128 6 :overlay-at (-> data 0)) + (adgif gs-gif-tag :inline :overlay-at (-> data 0)) + (strgif gs-gif-tag :inline :overlay-at (-> data 4)) + (extra vector :inline :overlay-at (-> data 8)) + (gifbufs vector :inline :overlay-at (-> data 12)) + (clrbufs qword :inline :overlay-at (-> data 16)) + (misc qword :inline :overlay-at (-> data 20)) + (atestgif gs-gif-tag :inline :offset 96) + (atest ad-cmd 2 :inline :offset 112) + (atest-tra ad-cmd :inline :overlay-at (-> atest 0)) + (atest-def ad-cmd :inline :overlay-at (-> atest 1)) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) ;; definition for method 3 of type tie-consts -(defmethod inspect tie-consts ((this tie-consts)) +(defmethod inspect ((this tie-consts)) (format #t "[~8x] ~A~%" this 'tie-consts) (format #t "~Tdata[24] @ #x~X~%" (-> this data)) (format #t "~Tvector[6] @ #x~X~%" (-> this data)) diff --git a/test/decompiler/reference/jak1/engine/gfx/vu1-user-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/vu1-user-h_REF.gc index 2b35df913e8..b19dd2d0e0b 100644 --- a/test/decompiler/reference/jak1/engine/gfx/vu1-user-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/vu1-user-h_REF.gc @@ -29,18 +29,15 @@ ;; definition of type dma-foreground-sink (deftype dma-foreground-sink (basic) - ((bucket bucket-id :offset-assert 4) - (foreground-texture-page int8 :offset-assert 8) - (foreground-texture-level int8 :offset-assert 9) - (foreground-output-bucket int8 :offset-assert 10) + ((bucket bucket-id) + (foreground-texture-page int8) + (foreground-texture-level int8) + (foreground-output-bucket int8) ) - :method-count-assert 9 - :size-assert #xb - :flag-assert #x90000000b ) ;; definition for method 3 of type dma-foreground-sink -(defmethod inspect dma-foreground-sink ((this dma-foreground-sink)) +(defmethod inspect ((this dma-foreground-sink)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tbucket: ~D~%" (-> this bucket)) (format #t "~Tforeground-texture-page: ~D~%" (-> this foreground-texture-page)) @@ -51,17 +48,14 @@ ;; definition of type generic-bucket-state (deftype generic-bucket-state (structure) - ((gifbuf-adr uint32 :offset-assert 0) - (inbuf-adr uint32 :offset-assert 4) + ((gifbuf-adr uint32) + (inbuf-adr uint32) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type generic-bucket-state -(defmethod inspect generic-bucket-state ((this generic-bucket-state)) +(defmethod inspect ((this generic-bucket-state)) (format #t "[~8x] ~A~%" this 'generic-bucket-state) (format #t "~Tgifbuf-adr: ~D~%" (-> this gifbuf-adr)) (format #t "~Tinbuf-adr: ~D~%" (-> this inbuf-adr)) @@ -70,15 +64,12 @@ ;; definition of type generic-dma-foreground-sink (deftype generic-dma-foreground-sink (dma-foreground-sink) - ((state generic-bucket-state :inline :offset-assert 12) + ((state generic-bucket-state :inline) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type generic-dma-foreground-sink -(defmethod inspect generic-dma-foreground-sink ((this generic-dma-foreground-sink)) +(defmethod inspect ((this generic-dma-foreground-sink)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tbucket: ~D~%" (-> this bucket)) (format #t "~Tforeground-texture-page: ~D~%" (-> this foreground-texture-page)) @@ -90,18 +81,15 @@ ;; definition of type dma-foreground-sink-group (deftype dma-foreground-sink-group (basic) - ((sink dma-foreground-sink 3 :offset-assert 4) - (merc-sink dma-foreground-sink :offset 4) - (generic-sink generic-dma-foreground-sink :offset 8) - (level level :offset-assert 16) + ((sink dma-foreground-sink 3) + (merc-sink dma-foreground-sink :overlay-at (-> sink 0)) + (generic-sink generic-dma-foreground-sink :overlay-at (-> sink 1)) + (level level) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type dma-foreground-sink-group -(defmethod inspect dma-foreground-sink-group ((this dma-foreground-sink-group)) +(defmethod inspect ((this dma-foreground-sink-group)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tsink[3] @ #x~X~%" (-> this sink)) (format #t "~Tmerc-sink: ~A~%" (-> this merc-sink)) diff --git a/test/decompiler/reference/jak1/engine/level/bsp-h_REF.gc b/test/decompiler/reference/jak1/engine/level/bsp-h_REF.gc index a4b8d46309e..9b82d57927d 100644 --- a/test/decompiler/reference/jak1/engine/level/bsp-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/bsp-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type bsp-node (deftype bsp-node (structure) - ((front int32 :offset-assert 0) - (back int32 :offset-assert 4) - (front-flags uint32 :offset-assert 8) - (back-flags uint32 :offset-assert 12) - (plane vector :inline :offset-assert 16) + ((front int32) + (back int32) + (front-flags uint32) + (back-flags uint32) + (plane vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type bsp-node -(defmethod inspect bsp-node ((this bsp-node)) +(defmethod inspect ((this bsp-node)) (format #t "[~8x] ~A~%" this 'bsp-node) (format #t "~Tfront: ~D~%" (-> this front)) (format #t "~Tback: ~D~%" (-> this back)) @@ -27,57 +24,51 @@ ;; definition of type bsp-header (deftype bsp-header (drawable) - ((info file-info :offset 4) - (all-visible-list (pointer uint16) :offset-assert 32) - (visible-list-length int32 :offset-assert 36) - (drawable-trees drawable-tree-array :offset-assert 40) - (pat pointer :offset-assert 44) - (pat-length int32 :offset-assert 48) - (texture-remap-table (pointer uint64) :offset-assert 52) - (texture-remap-table-len int32 :offset-assert 56) - (texture-ids (pointer texture-id) :offset-assert 60) - (texture-page-count int32 :offset-assert 64) - (unk-zero-0 basic :offset-assert 68) - (name symbol :offset-assert 72) - (nickname symbol :offset-assert 76) - (vis-info level-vis-info 8 :offset-assert 80) - (actors drawable-inline-array-actor :offset-assert 112) - (cameras (array entity-camera) :offset-assert 116) - (nodes (inline-array bsp-node) :offset-assert 120) - (level level :offset-assert 124) - (current-leaf-idx uint16 :offset-assert 128) - (unk-data-2 uint16 9 :offset-assert 130) - (boxes box8s-array :offset-assert 148) - (current-bsp-back-flags uint32 :offset-assert 152) - (ambients drawable-inline-array-ambient :offset-assert 156) - (unk-data-4 float :offset-assert 160) - (unk-data-5 float :offset-assert 164) - (adgifs adgif-shader-array :offset-assert 168) - (actor-birth-order (pointer uint32) :offset-assert 172) - (split-box-indices (pointer uint16) :offset-assert 176) - (unk-data-8 uint32 55 :offset-assert 180) + ((info file-info :overlay-at id) + (all-visible-list (pointer uint16)) + (visible-list-length int32) + (drawable-trees drawable-tree-array) + (pat pointer) + (pat-length int32) + (texture-remap-table (pointer uint64)) + (texture-remap-table-len int32) + (texture-ids (pointer texture-id)) + (texture-page-count int32) + (unk-zero-0 basic) + (name symbol) + (nickname symbol) + (vis-info level-vis-info 8) + (actors drawable-inline-array-actor) + (cameras (array entity-camera)) + (nodes (inline-array bsp-node)) + (level level) + (current-leaf-idx uint16) + (unk-data-2 uint16 9) + (boxes box8s-array) + (current-bsp-back-flags uint32) + (ambients drawable-inline-array-ambient) + (unk-data-4 float) + (unk-data-5 float) + (adgifs adgif-shader-array) + (actor-birth-order (pointer uint32)) + (split-box-indices (pointer uint16)) + (unk-data-8 uint32 55) ) - :method-count-assert 20 - :size-assert #x190 - :flag-assert #x1400000190 (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (birth (_type_) none 18) - (deactivate-entities (_type_) none 19) + (relocate (_type_ kheap (pointer uint8)) none :replace) + (birth (_type_) none) + (deactivate-entities (_type_) none) ) ) ;; definition of type game-level (deftype game-level (basic) - ((master-bsp basic :offset-assert 4) + ((master-bsp basic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type game-level -(defmethod inspect game-level ((this game-level)) +(defmethod inspect ((this game-level)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tmaster-bsp: ~A~%" (-> this master-bsp)) this @@ -85,22 +76,19 @@ ;; definition of type view-frustum (deftype view-frustum (structure) - ((hither-top-left vector :inline :offset-assert 0) - (hither-top-right vector :inline :offset-assert 16) - (hither-bottom-left vector :inline :offset-assert 32) - (hither-bottom-right vector :inline :offset-assert 48) - (yon-top-left vector :inline :offset-assert 64) - (yon-top-right vector :inline :offset-assert 80) - (yon-bottom-left vector :inline :offset-assert 96) - (yon-bottom-right vector :inline :offset-assert 112) + ((hither-top-left vector :inline) + (hither-top-right vector :inline) + (hither-bottom-left vector :inline) + (hither-bottom-right vector :inline) + (yon-top-left vector :inline) + (yon-top-right vector :inline) + (yon-bottom-left vector :inline) + (yon-bottom-right vector :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type view-frustum -(defmethod inspect view-frustum ((this view-frustum)) +(defmethod inspect ((this view-frustum)) (format #t "[~8x] ~A~%" this 'view-frustum) (format #t "~Thither-top-left: #~%" (-> this hither-top-left)) (format #t "~Thither-top-right: #~%" (-> this hither-top-right)) @@ -114,7 +102,7 @@ ) ;; definition for method 3 of type bsp-header -(defmethod inspect bsp-header ((this bsp-header)) +(defmethod inspect ((this bsp-header)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tall-visible-list: #x~X~%" (-> this all-visible-list)) (format #t "~Tvisible-list-length: ~D~%" (-> this visible-list-length)) @@ -173,18 +161,15 @@ ;; definition of type cl-stat (deftype cl-stat (structure) - ((fragments uint32 :offset-assert 0) - (tris uint32 :offset-assert 4) - (output uint32 :offset-assert 8) + ((fragments uint32) + (tris uint32) + (output uint32) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type cl-stat -(defmethod inspect cl-stat ((this cl-stat)) +(defmethod inspect ((this cl-stat)) (format #t "[~8x] ~A~%" this 'cl-stat) (format #t "~Tfragments: ~D~%" (-> this fragments)) (format #t "~Ttris: ~D~%" (-> this tris)) @@ -194,22 +179,19 @@ ;; definition of type collide-stats (deftype collide-stats (structure) - ((other cl-stat :inline :offset-assert 0) - (total cl-stat :inline :offset-assert 12) - (nodes uint32 :offset-assert 24) - (calls uint32 :offset-assert 28) - (total-target stopwatch :inline :offset-assert 32) - (target-cache-fill stopwatch :inline :offset-assert 64) - (target-ray-poly stopwatch :inline :offset-assert 96) - (pad uint32 :offset-assert 124) + ((other cl-stat :inline) + (total cl-stat :inline) + (nodes uint32) + (calls uint32) + (total-target stopwatch :inline) + (target-cache-fill stopwatch :inline) + (target-ray-poly stopwatch :inline) + (pad uint32) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type collide-stats -(defmethod inspect collide-stats ((this collide-stats)) +(defmethod inspect ((this collide-stats)) (format #t "[~8x] ~A~%" this 'collide-stats) (format #t "~Tother: #~%" (-> this other)) (format #t "~Ttotal: #~%" (-> this total)) diff --git a/test/decompiler/reference/jak1/engine/level/bsp_REF.gc b/test/decompiler/reference/jak1/engine/level/bsp_REF.gc index a04c512c05b..f78297cf14c 100644 --- a/test/decompiler/reference/jak1/engine/level/bsp_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/bsp_REF.gc @@ -25,7 +25,7 @@ ) ;; definition for method 8 of type bsp-header -(defmethod mem-usage bsp-header ((this bsp-header) (mem-use memory-usage-block) (flags int)) +(defmethod mem-usage ((this bsp-header) (mem-use memory-usage-block) (flags int)) (set! (-> mem-use work-bsp) this) (when (nonzero? (-> this info)) (set! (-> mem-use length) (max 82 (-> mem-use length))) @@ -134,7 +134,7 @@ ) ;; definition for method 9 of type bsp-header -(defmethod login bsp-header ((this bsp-header)) +(defmethod login ((this bsp-header)) (if (nonzero? (-> this drawable-trees)) (login (-> this drawable-trees)) ) @@ -153,7 +153,7 @@ ;; definition for method 10 of type bsp-header ;; INFO: Used lq/sq -(defmethod draw bsp-header ((this bsp-header) (other-draw bsp-header) (disp-frame display-frame)) +(defmethod draw ((this bsp-header) (other-draw bsp-header) (disp-frame display-frame)) (local-vars (a3-4 uint128) (a3-5 uint128)) (rlet ((vf16 :class vf) (vf17 :class vf) @@ -268,7 +268,7 @@ ;; definition for method 15 of type bsp-header ;; INFO: Return type mismatch profile-frame vs none. -(defmethod debug-draw bsp-header ((this bsp-header) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this bsp-header) (arg0 drawable) (arg1 display-frame)) (rlet ((vf16 :class vf) (vf17 :class vf) (vf18 :class vf) @@ -341,7 +341,7 @@ ) ;; definition for method 14 of type bsp-header -(defmethod collect-stats bsp-header ((this bsp-header)) +(defmethod collect-stats ((this bsp-header)) (rlet ((vf16 :class vf) (vf17 :class vf) (vf18 :class vf) @@ -429,7 +429,7 @@ ;; definition for method 11 of type bsp-header ;; INFO: Return type mismatch symbol vs none. -(defmethod collide-with-box bsp-header ((this bsp-header) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box ((this bsp-header) (arg0 int) (arg1 collide-list)) (+! (-> *collide-stats* calls) 1) (let ((s4-0 (-> this drawable-trees))) (dotimes (s3-0 (-> s4-0 length)) @@ -441,7 +441,7 @@ ;; definition for method 12 of type bsp-header ;; INFO: Return type mismatch symbol vs none. -(defmethod collide-y-probe bsp-header ((this bsp-header) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe ((this bsp-header) (arg0 int) (arg1 collide-list)) (+! (-> *collide-stats* calls) 1) (let ((s4-0 (-> this drawable-trees))) (dotimes (s3-0 (-> s4-0 length)) @@ -453,7 +453,7 @@ ;; definition for method 13 of type bsp-header ;; INFO: Return type mismatch symbol vs none. -(defmethod collide-ray bsp-header ((this bsp-header) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray ((this bsp-header) (arg0 int) (arg1 collide-list)) (+! (-> *collide-stats* calls) 1) (let ((s4-0 (-> this drawable-trees))) (dotimes (s3-0 (-> s4-0 length)) @@ -465,7 +465,7 @@ ;; definition for method 17 of type bsp-header ;; INFO: Return type mismatch symbol vs none. -(defmethod collect-ambients bsp-header ((this bsp-header) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients ((this bsp-header) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (let ((s3-0 (-> this drawable-trees))) (dotimes (s2-0 (-> s3-0 length)) (collect-ambients (-> s3-0 trees s2-0) arg0 arg1 arg2) diff --git a/test/decompiler/reference/jak1/engine/level/level-h_REF.gc b/test/decompiler/reference/jak1/engine/level/level-h_REF.gc index 193df4c723e..8f697fa08e1 100644 --- a/test/decompiler/reference/jak1/engine/level/level-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/level-h_REF.gc @@ -3,27 +3,24 @@ ;; definition of type level-vis-info (deftype level-vis-info (basic) - ((level symbol :offset-assert 4) - (from-level symbol :offset-assert 8) - (from-bsp bsp-header :offset-assert 12) - (flags uint32 :offset-assert 16) - (length uint32 :offset-assert 20) - (allocated-length uint32 :offset-assert 24) - (dictionary-length uint32 :offset-assert 28) - (dictionary uint32 :offset-assert 32) - (string-block uint32 :offset-assert 36) - (ramdisk uint32 :offset-assert 40) - (vis-bits pointer :offset-assert 44) - (current-vis-string uint32 :offset-assert 48) - (vis-string uint32 :dynamic :offset-assert 52) + ((level symbol) + (from-level symbol) + (from-bsp bsp-header) + (flags uint32) + (length uint32) + (allocated-length uint32) + (dictionary-length uint32) + (dictionary uint32) + (string-block uint32) + (ramdisk uint32) + (vis-bits pointer) + (current-vis-string uint32) + (vis-string uint32 :dynamic) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type level-vis-info -(defmethod inspect level-vis-info ((this level-vis-info)) +(defmethod inspect ((this level-vis-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlevel: ~A~%" (-> this level)) (format #t "~Tfrom-level: ~A~%" (-> this from-level)) @@ -43,47 +40,44 @@ ;; definition for method 5 of type level-vis-info ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of level-vis-info ((this level-vis-info)) +(defmethod asize-of ((this level-vis-info)) (the-as int (+ (-> level-vis-info size) (-> this dictionary-length))) ) ;; definition of type level-load-info (deftype level-load-info (basic) - ((name-list symbol 3 :offset-assert 4) - (index int32 :offset-assert 16) - (name symbol :offset 4) - (visname symbol :offset 8) - (nickname symbol :offset 12) - (packages pair :offset-assert 20) - (sound-banks pair :offset-assert 24) - (music-bank symbol :offset-assert 28) - (ambient-sounds pair :offset-assert 32) - (mood symbol :offset-assert 36) - (mood-func symbol :offset-assert 40) - (ocean symbol :offset-assert 44) - (sky symbol :offset-assert 48) - (sun-fade float :offset-assert 52) - (continues pair :offset-assert 56) - (tasks pair :offset-assert 60) - (priority int32 :offset-assert 64) - (load-commands pair :offset-assert 68) - (alt-load-commands pair :offset-assert 72) - (bsp-mask uint64 :offset-assert 80) - (bsphere sphere :offset-assert 88) - (buzzer int32 :offset-assert 92) - (bottom-height meters :offset-assert 96) - (run-packages pair :offset-assert 100) - (prev-level basic :offset-assert 104) - (next-level basic :offset-assert 108) - (wait-for-load symbol :offset-assert 112) + ((name-list symbol 3) + (index int32) + (name symbol :overlay-at (-> name-list 0)) + (visname symbol :overlay-at (-> name-list 1)) + (nickname symbol :overlay-at (-> name-list 2)) + (packages pair) + (sound-banks pair) + (music-bank symbol) + (ambient-sounds pair) + (mood symbol) + (mood-func symbol) + (ocean symbol) + (sky symbol) + (sun-fade float) + (continues pair) + (tasks pair) + (priority int32) + (load-commands pair) + (alt-load-commands pair) + (bsp-mask uint64) + (bsphere sphere) + (buzzer int32) + (bottom-height meters) + (run-packages pair) + (prev-level basic) + (next-level basic) + (wait-for-load symbol) ) - :method-count-assert 9 - :size-assert #x74 - :flag-assert #x900000074 ) ;; definition for method 3 of type level-load-info -(defmethod inspect level-load-info ((this level-load-info)) +(defmethod inspect ((this level-load-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname-list[3] @ #x~X~%" (&-> this name)) (format #t "~Tindex: ~D~%" (-> this index)) @@ -117,18 +111,15 @@ ;; definition of type login-state (deftype login-state (basic) - ((state int32 :offset-assert 4) - (pos uint32 :offset-assert 8) - (elts uint32 :offset-assert 12) - (elt drawable 16 :offset-assert 16) + ((state int32) + (pos uint32) + (elts uint32) + (elt drawable 16) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type login-state -(defmethod inspect login-state ((this login-state)) +(defmethod inspect ((this login-state)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tstate: ~D~%" (-> this state)) (format #t "~Tpos: ~D~%" (-> this pos)) @@ -139,80 +130,77 @@ ;; definition of type level (deftype level (basic) - ((name symbol :offset-assert 4) - (load-name symbol :offset-assert 8) - (nickname symbol :offset-assert 12) - (index int32 :offset-assert 16) - (status symbol :offset-assert 20) - (other level :offset-assert 24) - (heap kheap :inline :offset-assert 32) - (bsp bsp-header :offset-assert 48) - (art-group load-dir-art-group :offset-assert 52) - (info level-load-info :offset-assert 56) - (texture-page texture-page 9 :offset-assert 60) - (loaded-texture-page texture-page 16 :offset-assert 96) - (loaded-texture-page-count int32 :offset-assert 160) - (tfrag-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 176) - (pris-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 208) - (water-tex-foreground-sink-group dma-foreground-sink-group :inline :offset-assert 240) - (foreground-sink-group dma-foreground-sink-group 3 :inline :offset 176) - (foreground-draw-engine engine 3 :offset-assert 272) - (entity entity-links-array :offset-assert 284) - (ambient entity-ambient-data-array :offset-assert 288) - (closest-object float 9 :offset-assert 292) - (upload-size int32 9 :offset-assert 328) - (level-distance meters :offset-assert 364) - (inside-sphere? symbol :offset-assert 368) - (inside-boxes? symbol :offset-assert 372) - (display? symbol :offset-assert 376) - (meta-inside? symbol :offset-assert 380) - (mood mood-context :offset-assert 384) - (mood-func (function mood-context float int none) :offset-assert 388) - (vis-bits pointer :offset-assert 392) - (all-visible? symbol :offset-assert 396) - (force-all-visible? symbol :offset-assert 400) - (linking basic :offset-assert 404) - (vis-info level-vis-info 8 :offset-assert 408) - (vis-self-index int32 :offset-assert 440) - (vis-adj-index int32 :offset-assert 444) - (vis-buffer uint8 2048 :offset-assert 448) - (mem-usage-block memory-usage-block :offset-assert 2496) - (mem-usage int32 :offset-assert 2500) - (code-memory-start pointer :offset-assert 2504) - (code-memory-end pointer :offset-assert 2508) - (texture-mask uint32 9 :offset-assert 2512) - (force-inside? symbol :offset-assert 2548) - (pad uint8 56 :offset-assert 2552) + ((name symbol) + (load-name symbol) + (nickname symbol) + (index int32) + (status symbol) + (other level) + (heap kheap :inline) + (bsp bsp-header) + (art-group load-dir-art-group) + (info level-load-info) + (texture-page texture-page 9) + (loaded-texture-page texture-page 16) + (loaded-texture-page-count int32) + (tfrag-tex-foreground-sink-group dma-foreground-sink-group :inline) + (pris-tex-foreground-sink-group dma-foreground-sink-group :inline) + (water-tex-foreground-sink-group dma-foreground-sink-group :inline) + (foreground-sink-group dma-foreground-sink-group 3 :inline :overlay-at tfrag-tex-foreground-sink-group) + (foreground-draw-engine engine 3) + (entity entity-links-array) + (ambient entity-ambient-data-array) + (closest-object float 9) + (upload-size int32 9) + (level-distance meters) + (inside-sphere? symbol) + (inside-boxes? symbol) + (display? symbol) + (meta-inside? symbol) + (mood mood-context) + (mood-func (function mood-context float int none)) + (vis-bits pointer) + (all-visible? symbol) + (force-all-visible? symbol) + (linking basic) + (vis-info level-vis-info 8) + (vis-self-index int32) + (vis-adj-index int32) + (vis-buffer uint8 2048) + (mem-usage-block memory-usage-block) + (mem-usage int32) + (code-memory-start pointer) + (code-memory-end pointer) + (texture-mask uint32 9) + (force-inside? symbol) + (pad uint8 56) ) - :method-count-assert 29 - :size-assert #xa30 - :flag-assert #x1d00000a30 (:methods - (deactivate (_type_) _type_ 9) - (is-object-visible? (_type_ int) symbol 10) - (add-irq-to-tex-buckets! (_type_) none 11) - (unload! (_type_) _type_ 12) - (bsp-name (_type_) symbol 13) - (compute-memory-usage (_type_ object) memory-usage-block 14) - (point-in-boxes? (_type_ vector) symbol 15) - (update-vis! (_type_ level-vis-info uint uint) symbol 16) - (load-continue (_type_) _type_ 17) - (load-begin (_type_) _type_ 18) - (login-begin (_type_) _type_ 19) - (vis-load (_type_) uint 20) - (unused-21 (_type_) none 21) - (birth (_type_) _type_ 22) - (level-status-set! (_type_ symbol) _type_ 23) - (load-required-packages (_type_) _type_ 24) - (init-vis (_type_) int 25) - (vis-clear (_type_) int 26) - (debug-print-splitbox (_type_ vector string) none 27) - (art-group-get-by-name (_type_ string) art-group 28) + (deactivate (_type_) _type_) + (is-object-visible? (_type_ int) symbol) + (add-irq-to-tex-buckets! (_type_) none) + (unload! (_type_) _type_) + (bsp-name (_type_) symbol) + (compute-memory-usage (_type_ object) memory-usage-block) + (point-in-boxes? (_type_ vector) symbol) + (update-vis! (_type_ level-vis-info uint uint) symbol) + (load-continue (_type_) _type_) + (load-begin (_type_) _type_) + (login-begin (_type_) _type_) + (vis-load (_type_) uint) + (unused-21 (_type_) none) + (birth (_type_) _type_) + (level-status-set! (_type_ symbol) _type_) + (load-required-packages (_type_) _type_) + (init-vis (_type_) int) + (vis-clear (_type_) int) + (debug-print-splitbox (_type_ vector string) none) + (art-group-get-by-name (_type_ string) art-group) ) ) ;; definition for method 3 of type level -(defmethod inspect level ((this level)) +(defmethod inspect ((this level)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tload-name: ~A~%" (-> this load-name)) @@ -259,51 +247,48 @@ ;; definition of type level-group (deftype level-group (basic) - ((length int32 :offset-assert 4) - (log-in-level-bsp bsp-header :offset-assert 8) - (loading-level level :offset-assert 12) - (entity-link entity-links :offset-assert 16) - (border? basic :offset-assert 20) - (vis? basic :offset-assert 24) - (want-level basic :offset-assert 28) - (receiving-level basic :offset-assert 32) - (load-commands pair :offset-assert 36) - (play? symbol :offset-assert 40) - (_hack-pad uint8 :offset 90) - (level0 level :inline :offset-assert 96) - (level1 level :inline :offset-assert 2704) - (level-default level :inline :offset-assert 5312) - (level level 3 :inline :offset 96) - (data level 3 :inline :offset 96) - (pad uint32 :offset-assert 7920) + ((length int32) + (log-in-level-bsp bsp-header) + (loading-level level) + (entity-link entity-links) + (border? basic) + (vis? basic) + (want-level basic) + (receiving-level basic) + (load-commands pair) + (play? symbol) + (_hack-pad uint8 :offset 90) + (level0 level :inline) + (level1 level :inline) + (level-default level :inline) + (level level 3 :inline :overlay-at level0) + (data level 3 :inline :overlay-at level0) + (pad uint32) ) - :method-count-assert 27 - :size-assert #x1ef4 - :flag-assert #x1b00001ef4 (:methods - (level-get (_type_ symbol) level 9) - (level-get-with-status (_type_ symbol) level 10) - (level-get-for-use (_type_ symbol symbol) level 11) - (activate-levels! (_type_) int 12) - (debug-print-entities (_type_ symbol type) none 13) - (debug-draw-actors (_type_ symbol) none 14) - (actors-update (_type_) object 15) - (level-update (_type_) int 16) - (level-get-target-inside (_type_) level 17) - (alloc-levels! (_type_ symbol) int 18) - (load-commands-set! (_type_ pair) pair 19) - (art-group-get-by-name (_type_ string) art-group 20) - (load-command-get-index (_type_ symbol int) pair 21) - (update-vis-volumes (_type_) none 22) - (update-vis-volumes-from-nav-mesh (_type_) none 23) - (print-volume-sizes (_type_) none 24) - (level-status (_type_ symbol) symbol 25) - (level-get-most-disposable (_type_) level 26) + (level-get (_type_ symbol) level) + (level-get-with-status (_type_ symbol) level) + (level-get-for-use (_type_ symbol symbol) level) + (activate-levels! (_type_) int) + (debug-print-entities (_type_ symbol type) none) + (debug-draw-actors (_type_ symbol) none) + (actors-update (_type_) object) + (level-update (_type_) int) + (level-get-target-inside (_type_) level) + (alloc-levels! (_type_ symbol) int) + (load-commands-set! (_type_ pair) pair) + (art-group-get-by-name (_type_ string) art-group) + (load-command-get-index (_type_ symbol int) pair) + (update-vis-volumes (_type_) none) + (update-vis-volumes-from-nav-mesh (_type_) none) + (print-volume-sizes (_type_) none) + (level-status (_type_ symbol) symbol) + (level-get-most-disposable (_type_) level) ) ) ;; definition for method 3 of type level-group -(defmethod inspect level-group ((this level-group)) +(defmethod inspect ((this level-group)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tentity-link: ~`entity-links`P~%" (-> this entity-link)) diff --git a/test/decompiler/reference/jak1/engine/level/level_REF.gc b/test/decompiler/reference/jak1/engine/level/level_REF.gc index c0ec3627311..eaaea8eb63a 100644 --- a/test/decompiler/reference/jak1/engine/level/level_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/level_REF.gc @@ -21,7 +21,7 @@ ;; definition for method 21 of type level-group ;; INFO: Return type mismatch object vs pair. -(defmethod load-command-get-index level-group ((this level-group) (name symbol) (cmd-idx int)) +(defmethod load-command-get-index ((this level-group) (name symbol) (cmd-idx int)) (let ((cmd-lst (-> (lookup-level-info name) alt-load-commands))) (while (nonzero? cmd-idx) (+! cmd-idx -1) @@ -43,7 +43,7 @@ ) ;; definition for method 28 of type level -(defmethod art-group-get-by-name level ((this level) (arg0 string)) +(defmethod art-group-get-by-name ((this level) (arg0 string)) (countdown (s4-0 (-> this art-group art-group-array length)) (if (name= (-> this art-group art-group-array s4-0 name) arg0) (return (-> this art-group art-group-array s4-0)) @@ -53,7 +53,7 @@ ) ;; definition for method 13 of type level -(defmethod bsp-name level ((this level)) +(defmethod bsp-name ((this level)) (if (and (!= (-> this status) 'inactive) (-> this bsp) (nonzero? (-> this bsp name))) (-> this bsp name) (-> this name) @@ -70,14 +70,14 @@ ) ;; definition for method 2 of type level -(defmethod print level ((this level)) +(defmethod print ((this level)) (format #t "#<~A ~A ~S @ #x~X>" (-> this type) (-> this status) (-> this name) this) this ) ;; definition for method 7 of type bsp-header ;; INFO: Return type mismatch bsp-header vs none. -(defmethod relocate bsp-header ((this bsp-header) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate ((this bsp-header) (arg0 kheap) (arg1 (pointer uint8))) (let ((s5-0 (-> *level* loading-level))) (if s5-0 (set! this (cond @@ -118,7 +118,7 @@ ) ;; definition for method 24 of type level -(defmethod load-required-packages level ((this level)) +(defmethod load-required-packages ((this level)) (when (not (or (not (-> this bsp)) (= *kernel-boot-mode* 'debug-boot))) (if (not (null? (-> this info packages))) (load-package "common" global) @@ -129,7 +129,7 @@ ;; definition for method 26 of type level ;; INFO: Used lq/sq -(defmethod vis-clear level ((this level)) +(defmethod vis-clear ((this level)) (countdown (v1-0 8) (nop!) (set! (-> this vis-info v1-0) #f) @@ -143,7 +143,7 @@ ;; definition for method 20 of type level ;; INFO: Used lq/sq -(defmethod vis-load level ((this level)) +(defmethod vis-load ((this level)) (when (zero? (-> this vis-info (-> this vis-self-index) ramdisk)) (let ((v1-10 (-> this other vis-info (-> this other vis-self-index)))) (when (and v1-10 (nonzero? (-> v1-10 ramdisk))) @@ -182,7 +182,7 @@ ) ;; definition for method 25 of type level -(defmethod init-vis level ((this level)) +(defmethod init-vis ((this level)) (when (not (or (= (-> this status) 'inactive) (not (-> this bsp)))) (set! (-> this all-visible?) 'loading) (let ((s5-0 (-> this bsp vis-info 0))) @@ -227,7 +227,7 @@ ) ;; definition for method 11 of type level-group -(defmethod level-get-for-use level-group ((this level-group) (arg0 symbol) (arg1 symbol)) +(defmethod level-get-for-use ((this level-group) (arg0 symbol) (arg1 symbol)) (local-vars (s5-1 level)) (alloc-levels! this #f) (let* ((s3-0 (lookup-level-info arg0)) @@ -268,7 +268,7 @@ ) ;; definition for method 25 of type level-group -(defmethod level-status level-group ((this level-group) (arg0 symbol)) +(defmethod level-status ((this level-group) (arg0 symbol)) (let ((v1-1 (level-get *level* arg0))) (if v1-1 (-> v1-1 status) @@ -277,7 +277,7 @@ ) ;; definition for method 23 of type level -(defmethod level-status-set! level ((this level) (arg0 symbol)) +(defmethod level-status-set! ((this level) (arg0 symbol)) (case arg0 (('inactive) (-> this status) @@ -348,7 +348,7 @@ (define *print-login* #t) ;; definition for method 17 of type level -(defmethod load-continue level ((this level)) +(defmethod load-continue ((this level)) (local-vars (sv-16 symbol)) (when (-> this linking) (when (nonzero? (link-resume)) @@ -422,7 +422,7 @@ ) ;; definition for method 18 of type level -(defmethod load-begin level ((this level)) +(defmethod load-begin ((this level)) (set! loading-level (-> this heap)) (set! (-> *level* loading-level) this) (set! (-> *level* log-in-level-bsp) #f) @@ -452,7 +452,7 @@ ) ;; definition for method 19 of type level -(defmethod login-begin level ((this level)) +(defmethod login-begin ((this level)) (set! (-> *texture-pool* allocate-func) texture-page-default-allocate) (cond ((-> this bsp) @@ -669,7 +669,7 @@ ) ;; definition for method 22 of type level -(defmethod birth level ((this level)) +(defmethod birth ((this level)) (case (-> this status) (('loaded) (let ((s5-0 loading-level) @@ -695,7 +695,7 @@ ;; definition for method 9 of type level ;; INFO: Used lq/sq -(defmethod deactivate level ((this level)) +(defmethod deactivate ((this level)) (case (-> this status) (('active 'alive) (format 0 "----------- kill ~A (status ~A)~%" this (-> this status)) @@ -731,7 +731,7 @@ ;; definition for method 12 of type level ;; ERROR: Failed load: (set! v1-52 (l.wu (+ a0-29 -4))) at op 146 -(defmethod unload! level ((this level)) +(defmethod unload! ((this level)) (deactivate this) (when (!= (-> this status) 'inactive) (when (or (= (-> this status) 'loaded) @@ -807,7 +807,7 @@ ;; definition for method 10 of type level ;; ERROR: Unsupported inline assembly instruction kind - [addiu a0, a0, 56] -(defmethod is-object-visible? level ((this level) (arg0 int)) +(defmethod is-object-visible? ((this level) (arg0 int)) (local-vars (a0-1 int) (a0-3 int)) (let ((v1-0 (-> this vis-bits))) (shift-arith-right-32 a0-1 arg0 3) @@ -822,7 +822,7 @@ ;; definition for method 15 of type level ;; INFO: Return type mismatch object vs symbol. -(defmethod point-in-boxes? level ((this level) (arg0 vector)) +(defmethod point-in-boxes? ((this level) (arg0 vector)) (the-as symbol (cond ((or (not (-> this bsp)) (zero? (-> this bsp boxes))) #f @@ -855,7 +855,7 @@ ;; definition for method 27 of type level ;; INFO: Return type mismatch int vs none. -(defmethod debug-print-splitbox level ((this level) (arg0 vector) (arg1 string)) +(defmethod debug-print-splitbox ((this level) (arg0 vector) (arg1 string)) (cond ((or (not (-> this bsp)) (zero? (-> this bsp boxes)) (zero? (-> this bsp split-box-indices))) ) @@ -883,7 +883,7 @@ ) ;; definition for method 8 of type level -(defmethod mem-usage level ((this level) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this level) (arg0 memory-usage-block) (arg1 int)) (when (= (-> this status) 'active) (set! (-> arg0 length) (max 65 (-> arg0 length))) (set! (-> arg0 data 64 name) "entity-links") @@ -942,7 +942,7 @@ ) ;; definition for method 18 of type level-group -(defmethod alloc-levels! level-group ((this level-group) (arg0 symbol)) +(defmethod alloc-levels! ((this level-group) (arg0 symbol)) (when (zero? (-> *level* level0 heap base)) (when (nmember "game" *kernel-packages*) (set! *kernel-packages* (cons "art" *kernel-packages*)) @@ -972,7 +972,7 @@ ) ;; definition for method 10 of type level-group -(defmethod level-get-with-status level-group ((this level-group) (arg0 symbol)) +(defmethod level-get-with-status ((this level-group) (arg0 symbol)) (dotimes (v1-0 (-> this length)) (if (= (-> this level v1-0 status) arg0) (return (-> this level v1-0)) @@ -982,7 +982,7 @@ ) ;; definition for method 26 of type level-group -(defmethod level-get-most-disposable level-group ((this level-group)) +(defmethod level-get-most-disposable ((this level-group)) (dotimes (v1-0 (-> this length)) (case (-> this level v1-0 status) (('inactive) @@ -1021,7 +1021,7 @@ ) ;; definition for method 9 of type level-group -(defmethod level-get level-group ((this level-group) (arg0 symbol)) +(defmethod level-get ((this level-group) (arg0 symbol)) (dotimes (v1-0 (-> this length)) (if (and (!= (-> this level v1-0 status) 'inactive) (or (= (-> this level v1-0 name) arg0) (= (-> this level v1-0 load-name) arg0)) @@ -1033,7 +1033,7 @@ ) ;; definition for method 20 of type level-group -(defmethod art-group-get-by-name level-group ((this level-group) (arg0 string)) +(defmethod art-group-get-by-name ((this level-group) (arg0 string)) (countdown (s4-0 3) (let ((s3-0 (-> this level s4-0))) (countdown (s2-0 (-> s3-0 art-group art-group-array length)) @@ -1047,7 +1047,7 @@ ) ;; definition for method 12 of type level-group -(defmethod activate-levels! level-group ((this level-group)) +(defmethod activate-levels! ((this level-group)) (dotimes (s5-0 (-> this length)) (level-status-set! (-> this level s5-0) 'active) ) @@ -1055,7 +1055,7 @@ ) ;; definition for method 17 of type level-group -(defmethod level-get-target-inside level-group ((this level-group)) +(defmethod level-get-target-inside ((this level-group)) (let ((s5-0 (target-pos 0))) (let ((v1-2 (-> *game-info* current-continue level))) (dotimes (a0-2 (-> this length)) @@ -1113,13 +1113,13 @@ ) ;; definition for method 19 of type level-group -(defmethod load-commands-set! level-group ((this level-group) (arg0 pair)) +(defmethod load-commands-set! ((this level-group) (arg0 pair)) (set! (-> this load-commands) arg0) arg0 ) ;; definition for method 8 of type level-group -(defmethod mem-usage level-group ((this level-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this level-group) (arg0 memory-usage-block) (arg1 int)) (dotimes (s3-0 (-> this length)) (mem-usage (-> this level s3-0) arg0 arg1) ) @@ -1341,7 +1341,7 @@ ) ;; definition for method 10 of type load-state -(defmethod update! load-state ((this load-state)) +(defmethod update! ((this load-state)) (update-sound-banks) (let ((v1-0 #f)) (dotimes (s5-0 2) @@ -1502,7 +1502,7 @@ ) ;; definition for method 16 of type level-group -(defmethod level-update level-group ((this level-group)) +(defmethod level-update ((this level-group)) (camera-pos) (new 'static 'boxed-array :type symbol :length 0 :allocated-length 2) (update *setting-control*) diff --git a/test/decompiler/reference/jak1/engine/level/load-boundary-h_REF.gc b/test/decompiler/reference/jak1/engine/level/load-boundary-h_REF.gc index be225afec60..de1d8c1e5b2 100644 --- a/test/decompiler/reference/jak1/engine/level/load-boundary-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/load-boundary-h_REF.gc @@ -3,24 +3,21 @@ ;; definition of type lbvtx (deftype lbvtx (structure) - ((x float :offset-assert 0) - (y float :offset-assert 4) - (z float :offset-assert 8) - (v0 uint8 :offset-assert 12) - (v1 uint8 :offset-assert 13) - (v2 uint8 :offset-assert 14) - (ix uint8 :offset-assert 15) - (quad uint128 :offset 0) - (v vector :inline :offset 0) + ((x float) + (y float) + (z float) + (v0 uint8) + (v1 uint8) + (v2 uint8) + (ix uint8) + (quad uint128 :overlay-at x) + (v vector :inline :overlay-at x) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type lbvtx ;; INFO: Used lq/sq -(defmethod inspect lbvtx ((this lbvtx)) +(defmethod inspect ((this lbvtx)) (format #t "[~8x] ~A~%" this 'lbvtx) (format #t "~Tx: ~f~%" (-> this x)) (format #t "~Ty: ~f~%" (-> this y)) @@ -36,26 +33,23 @@ ;; definition of type load-boundary-crossing-command (deftype load-boundary-crossing-command (structure) - ((cmd load-boundary-cmd :offset-assert 0) - (bparm uint8 3 :offset-assert 1) - (parm uint32 2 :offset-assert 4) - (lev0 basic :offset 4) - (lev1 basic :offset 8) - (displev basic :offset 4) - (dispcmd basic :offset 8) - (nick basic :offset 4) - (forcelev basic :offset 4) - (forceonoff basic :offset 8) - (checkname basic :offset 4) + ((cmd load-boundary-cmd) + (bparm uint8 3) + (parm uint32 2) + (lev0 basic :overlay-at (-> parm 0)) + (lev1 basic :overlay-at (-> parm 1)) + (displev basic :overlay-at (-> parm 0)) + (dispcmd basic :overlay-at (-> parm 1)) + (nick basic :overlay-at (-> parm 0)) + (forcelev basic :overlay-at (-> parm 0)) + (forceonoff basic :overlay-at (-> parm 1)) + (checkname basic :overlay-at (-> parm 0)) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type load-boundary-crossing-command -(defmethod inspect load-boundary-crossing-command ((this load-boundary-crossing-command)) +(defmethod inspect ((this load-boundary-crossing-command)) (format #t "[~8x] ~A~%" this 'load-boundary-crossing-command) (format #t "~Tcmd: ~D~%" (-> this cmd)) (format #t "~Tbparm[3] @ #x~X~%" (-> this bparm)) @@ -73,28 +67,25 @@ ;; definition of type load-boundary (deftype load-boundary (basic) - ((num-points uint16 :offset-assert 4) - (flags load-boundary-flags :offset-assert 6) - (top-plane float :offset-assert 8) - (bot-plane float :offset-assert 12) - (tri-cnt int32 :offset-assert 16) - (next load-boundary :offset-assert 20) - (cmd-fwd load-boundary-crossing-command :inline :offset-assert 24) - (cmd-bwd load-boundary-crossing-command :inline :offset-assert 36) - (rejector vector :inline :offset-assert 48) - (data lbvtx 1 :inline :offset-assert 64) - (data2 lbvtx :inline :dynamic :offset 64) + ((num-points uint16) + (flags load-boundary-flags) + (top-plane float) + (bot-plane float) + (tri-cnt int32) + (next load-boundary) + (cmd-fwd load-boundary-crossing-command :inline) + (cmd-bwd load-boundary-crossing-command :inline) + (rejector vector :inline) + (data lbvtx 1 :inline) + (data2 lbvtx :inline :dynamic :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 (:methods - (new (symbol type int symbol symbol) _type_ 0) + (new (symbol type int symbol symbol) _type_) ) ) ;; definition for method 3 of type load-boundary -(defmethod inspect load-boundary ((this load-boundary)) +(defmethod inspect ((this load-boundary)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tnum-points: ~D~%" (-> this num-points)) (format #t "~Tflags: ~D~%" (-> this flags)) diff --git a/test/decompiler/reference/jak1/engine/level/load-boundary_REF.gc b/test/decompiler/reference/jak1/engine/level/load-boundary_REF.gc index ab5454491c9..5c550491771 100644 --- a/test/decompiler/reference/jak1/engine/level/load-boundary_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/load-boundary_REF.gc @@ -3,18 +3,15 @@ ;; definition of type lb-editor-parms (deftype lb-editor-parms (basic) - ((boundary load-boundary :offset-assert 4) - (vertex int32 :offset-assert 8) - (x-origin float :offset-assert 12) - (z-origin float :offset-assert 16) + ((boundary load-boundary) + (vertex int32) + (x-origin float) + (z-origin float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type lb-editor-parms -(defmethod inspect lb-editor-parms ((this lb-editor-parms)) +(defmethod inspect ((this lb-editor-parms)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tboundary: ~A~%" (-> this boundary)) (format #t "~Tvertex: ~D~%" (-> this vertex)) @@ -1540,7 +1537,7 @@ ) ;; definition for method 9 of type load-state -(defmethod reset! load-state ((this load-state)) +(defmethod reset! ((this load-state)) (set! (-> this want 0 name) #f) (set! (-> this want 0 display?) #f) (set! (-> this want 0 force-vis?) #f) @@ -1558,7 +1555,7 @@ ) ;; definition for method 11 of type load-state -(defmethod want-levels load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-levels ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) (cond ((= (-> this want v1-0 name) arg0) @@ -1598,7 +1595,7 @@ ) ;; definition for method 12 of type load-state -(defmethod want-display-level load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-display-level ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) (when (= (-> this want v1-0 name) arg0) (set! (-> this want v1-0 display?) arg1) @@ -1612,13 +1609,13 @@ ) ;; definition for method 13 of type load-state -(defmethod want-vis load-state ((this load-state) (arg0 symbol)) +(defmethod want-vis ((this load-state) (arg0 symbol)) (set! (-> this vis-nick) arg0) 0 ) ;; definition for method 14 of type load-state -(defmethod want-force-vis load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-force-vis ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) (when (= (-> this want v1-0 name) arg0) (set! (-> this want v1-0 force-vis?) arg1) @@ -1632,7 +1629,7 @@ ;; definition for method 20 of type load-state ;; INFO: Return type mismatch int vs none. ;; WARN: Function (method 20 load-state) has a return type of none, but the expression builder found a return statement. -(defmethod set-force-inside! load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod set-force-inside! ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) (when (= (-> this want v1-0 name) arg0) (set! (-> this want v1-0 force-inside?) arg1) @@ -1671,7 +1668,7 @@ (define *backup-load-state* (new 'global 'load-state)) ;; definition for method 17 of type load-state -(defmethod backup-load-state-and-set-cmds load-state ((this load-state) (arg0 pair)) +(defmethod backup-load-state-and-set-cmds ((this load-state) (arg0 pair)) (dotimes (s4-0 256) (when (-> this object-name s4-0) (format 0 "WARNING: load state somehow aquired object command ~A~%" (-> this object-name s4-0)) @@ -1685,7 +1682,7 @@ ) ;; definition for method 18 of type load-state -(defmethod restore-load-state-and-cleanup load-state ((this load-state)) +(defmethod restore-load-state-and-cleanup ((this load-state)) (execute-commands-up-to this 100000.0) (dotimes (s5-0 256) (when (-> this object-name s5-0) @@ -1703,7 +1700,7 @@ ) ;; definition for method 19 of type load-state -(defmethod restore-load-state load-state ((this load-state)) +(defmethod restore-load-state ((this load-state)) (dotimes (v1-0 256) (if (-> this object-name v1-0) (set! (-> this object-name v1-0) #f) @@ -1788,7 +1785,7 @@ ) ;; definition for method 16 of type load-state -(defmethod execute-commands-up-to load-state ((this load-state) (arg0 float)) +(defmethod execute-commands-up-to ((this load-state) (arg0 float)) (while (not (null? (-> this command-list))) (let ((f0-0 (command-get-float (car (car (-> this command-list))) 0.0)) (s4-0 (cdr (car (-> this command-list)))) @@ -1822,7 +1819,7 @@ ;; definition for method 15 of type load-state ;; INFO: Return type mismatch int vs none. ;; ERROR: Failed load: (set! v1-138 (l.wu (+ a0-142 -4))) at op 648 -(defmethod execute-command load-state ((this load-state) (arg0 pair)) +(defmethod execute-command ((this load-state) (arg0 pair)) (local-vars (v1-26 int) (v1-57 int)) (with-pp (cond diff --git a/test/decompiler/reference/jak1/engine/load/decomp-h_REF.gc b/test/decompiler/reference/jak1/engine/load/decomp-h_REF.gc index d57b5f1dc05..26c5ccc675c 100644 --- a/test/decompiler/reference/jak1/engine/load/decomp-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/decomp-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type decomp-work (deftype decomp-work (structure) - ((buffer0 uint8 2048 :offset-assert 0) - (buffer1 uint8 2048 :offset-assert 2048) - (indices uint16 2048 :offset-assert 4096) - (temp-indices uint16 2048 :offset-assert 8192) + ((buffer0 uint8 2048) + (buffer1 uint8 2048) + (indices uint16 2048) + (temp-indices uint16 2048) ) - :method-count-assert 9 - :size-assert #x3000 - :flag-assert #x900003000 ) ;; definition for method 3 of type decomp-work -(defmethod inspect decomp-work ((this decomp-work)) +(defmethod inspect ((this decomp-work)) (format #t "[~8x] ~A~%" this 'decomp-work) (format #t "~Tbuffer0[2048] @ #x~X~%" (-> this buffer0)) (format #t "~Tbuffer1[2048] @ #x~X~%" (-> this buffer1)) diff --git a/test/decompiler/reference/jak1/engine/load/decomp_REF.gc b/test/decompiler/reference/jak1/engine/load/decomp_REF.gc index 72f286da708..2170fa375ab 100644 --- a/test/decompiler/reference/jak1/engine/load/decomp_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/decomp_REF.gc @@ -42,16 +42,13 @@ ;; definition of type huf-dictionary-node (deftype huf-dictionary-node (structure) - ((zero uint16 :offset-assert 0) - (one uint16 :offset-assert 2) + ((zero uint16) + (one uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type huf-dictionary-node -(defmethod inspect huf-dictionary-node ((this huf-dictionary-node)) +(defmethod inspect ((this huf-dictionary-node)) (format #t "[~8x] ~A~%" this 'huf-dictionary-node) (format #t "~Tzero: ~D~%" (-> this zero)) (format #t "~Tone: ~D~%" (-> this one)) @@ -108,7 +105,7 @@ ;; definition for method 16 of type level ;; INFO: Used lq/sq -(defmethod update-vis! level ((this level) (vis-info level-vis-info) (arg1 uint) (arg2 uint)) +(defmethod update-vis! ((this level) (vis-info level-vis-info) (arg1 uint) (arg2 uint)) (local-vars (t0-3 uint128) (vis-buffer object)) (let* ((cam-leaf-idx (-> vis-info from-bsp current-leaf-idx)) (curr-vis-str (-> vis-info current-vis-string)) diff --git a/test/decompiler/reference/jak1/engine/load/file-io_REF.gc b/test/decompiler/reference/jak1/engine/load/file-io_REF.gc index 953ba7d2dc2..6fe5d51e4d7 100644 --- a/test/decompiler/reference/jak1/engine/load/file-io_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/file-io_REF.gc @@ -3,21 +3,18 @@ ;; definition of type file-stream (deftype file-stream (basic) - ((flags uint32 :offset-assert 4) - (mode symbol :offset-assert 8) - (name string :offset-assert 12) - (file uint32 :offset-assert 16) + ((flags uint32) + (mode symbol) + (name string) + (file uint32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 (:methods - (new (symbol type string symbol) _type_ 0) + (new (symbol type string symbol) _type_) ) ) ;; definition for method 3 of type file-stream -(defmethod inspect file-stream ((this file-stream)) +(defmethod inspect ((this file-stream)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tflags: #x~X~%" (-> this flags)) (format #t "~Tmode: ~A~%" (-> this mode)) @@ -45,21 +42,18 @@ ;; definition of type file-info (deftype file-info (basic) - ((file-type symbol :offset-assert 4) - (file-name basic :offset-assert 8) - (major-version uint32 :offset-assert 12) - (minor-version uint32 :offset-assert 16) - (maya-file-name basic :offset-assert 20) - (tool-debug basic :offset-assert 24) - (mdb-file-name basic :offset-assert 28) + ((file-type symbol) + (file-name basic) + (major-version uint32) + (minor-version uint32) + (maya-file-name basic) + (tool-debug basic) + (mdb-file-name basic) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type file-info -(defmethod inspect file-info ((this file-info)) +(defmethod inspect ((this file-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tfile-type: ~A~%" (-> this file-type)) (format #t "~Tfile-name: ~A~%" (-> this file-name)) @@ -72,7 +66,7 @@ ) ;; definition for method 2 of type file-info -(defmethod print file-info ((this file-info)) +(defmethod print ((this file-info)) (format #t "#<~A ~A :version ~D.~D @ #x~X>" diff --git a/test/decompiler/reference/jak1/engine/load/load-dgo_REF.gc b/test/decompiler/reference/jak1/engine/load/load-dgo_REF.gc index 70c6755091d..509890301ea 100644 --- a/test/decompiler/reference/jak1/engine/load/load-dgo_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/load-dgo_REF.gc @@ -3,23 +3,20 @@ ;; definition of type load-dgo-msg (deftype load-dgo-msg (structure) - ((rsvd uint16 :offset-assert 0) - (result load-msg-result :offset-assert 2) - (b1 pointer :offset-assert 4) - (b2 pointer :offset-assert 8) - (bt pointer :offset-assert 12) - (name uint128 :offset-assert 16) - (name-chars uint8 16 :offset 16) - (address uint32 :offset 4) + ((rsvd uint16) + (result load-msg-result) + (b1 pointer) + (b2 pointer) + (bt pointer) + (name uint128) + (name-chars uint8 16 :overlay-at name) + (address uint32 :overlay-at b1) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type load-dgo-msg ;; INFO: Used lq/sq -(defmethod inspect load-dgo-msg ((this load-dgo-msg)) +(defmethod inspect ((this load-dgo-msg)) (format #t "[~8x] ~A~%" this 'load-dgo-msg) (format #t "~Trsvd: ~D~%" (-> this rsvd)) (format #t "~Tresult: ~D~%" (-> this result)) @@ -33,21 +30,18 @@ ;; definition of type load-chunk-msg (deftype load-chunk-msg (structure) - ((rsvd uint16 :offset-assert 0) - (result load-msg-result :offset-assert 2) - (address pointer :offset-assert 4) - (section uint32 :offset-assert 8) - (maxlen uint32 :offset-assert 12) - (id uint32 :offset 4) - (basename uint8 48 :offset-assert 16) + ((rsvd uint16) + (result load-msg-result) + (address pointer) + (section uint32) + (maxlen uint32) + (id uint32 :overlay-at address) + (basename uint8 48) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type load-chunk-msg -(defmethod inspect load-chunk-msg ((this load-chunk-msg)) +(defmethod inspect ((this load-chunk-msg)) (format #t "[~8x] ~A~%" this 'load-chunk-msg) (format #t "~Trsvd: ~D~%" (-> this rsvd)) (format #t "~Tresult: ~D~%" (-> this result)) @@ -61,17 +55,14 @@ ;; definition of type dgo-header (deftype dgo-header (structure) - ((length uint32 :offset-assert 0) - (rootname uint8 60 :offset-assert 4) - (data uint8 :dynamic :offset-assert 64) + ((length uint32) + (rootname uint8 60) + (data uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type dgo-header -(defmethod inspect dgo-header ((this dgo-header)) +(defmethod inspect ((this dgo-header)) (format #t "[~8x] ~A~%" this 'dgo-header) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Trootname[60] @ #x~X~%" (-> this rootname)) diff --git a/test/decompiler/reference/jak1/engine/load/loader-h_REF.gc b/test/decompiler/reference/jak1/engine/load/loader-h_REF.gc index 9a95be8f316..4c3c4a34df2 100644 --- a/test/decompiler/reference/jak1/engine/load/loader-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/loader-h_REF.gc @@ -3,29 +3,23 @@ ;; definition of type load-dir (deftype load-dir (basic) - ((lev level :offset-assert 4) - (string-array (array string) :offset-assert 8) - (data-array (array basic) :offset-assert 12) + ((lev level) + (string-array (array string)) + (data-array (array basic)) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (new (symbol type int level) _type_ 0) - (load-to-heap-by-name (_type_ string symbol kheap int) art-group 9) - (set-loaded-art (_type_ art-group) art-group 10) + (new (symbol type int level) _type_) + (load-to-heap-by-name (_type_ string symbol kheap int) art-group) + (set-loaded-art (_type_ art-group) art-group) ) ) ;; definition of type load-dir-art-group (deftype load-dir-art-group (load-dir) - ((art-group-array (array art-group) :offset 12) + ((art-group-array (array art-group) :overlay-at data-array) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (new (symbol type int level) _type_ 0) + (new (symbol type int level) _type_) ) ) @@ -54,41 +48,38 @@ ;; definition of type external-art-buffer (deftype external-art-buffer (basic) - ((index int32 :offset-assert 4) - (other external-art-buffer :offset-assert 8) - (status symbol :offset-assert 12) - (locked? symbol :offset-assert 16) - (frame-lock symbol :offset-assert 20) - (heap kheap :inline :offset-assert 32) - (pending-load-file string :offset-assert 48) - (pending-load-file-part int32 :offset-assert 52) - (pending-load-file-owner handle :offset-assert 56) - (pending-load-file-priority float :offset-assert 64) - (load-file string :offset-assert 68) - (load-file-part int32 :offset-assert 72) - (load-file-owner handle :offset-assert 80) - (load-file-priority float :offset-assert 88) - (buf pointer :offset-assert 92) - (len int32 :offset-assert 96) - (art-group art-group :offset-assert 100) + ((index int32) + (other external-art-buffer) + (status symbol) + (locked? symbol) + (frame-lock symbol) + (heap kheap :inline) + (pending-load-file string) + (pending-load-file-part int32) + (pending-load-file-owner handle) + (pending-load-file-priority float) + (load-file string) + (load-file-part int32) + (load-file-owner handle) + (load-file-priority float) + (buf pointer) + (len int32) + (art-group art-group) ) - :method-count-assert 16 - :size-assert #x68 - :flag-assert #x1000000068 (:methods - (new (symbol type int) _type_ 0) - (set-pending-file (_type_ string int handle float) int 9) - (update (_type_) int 10) - (inactive? (_type_) symbol 11) - (file-status (_type_ string int) symbol 12) - (link-file (_type_ art-group) art-group 13) - (unlink-file (_type_ art-group) int 14) - (unlock! (_type_) symbol 15) + (new (symbol type int) _type_) + (set-pending-file (_type_ string int handle float) int) + (update (_type_) int) + (inactive? (_type_) symbol) + (file-status (_type_ string int) symbol) + (link-file (_type_ art-group) art-group) + (unlink-file (_type_ art-group) int) + (unlock! (_type_) symbol) ) ) ;; definition for method 3 of type external-art-buffer -(defmethod inspect external-art-buffer ((this external-art-buffer)) +(defmethod inspect ((this external-art-buffer)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tindex: ~D~%" (-> this index)) (format #t "~Tother: ~A~%" (-> this other)) @@ -132,23 +123,20 @@ ;; definition of type spool-anim (deftype spool-anim (basic) - ((name string :offset 16) - (buf1 external-art-buffer :offset 16) - (index int32 :offset 20) - (buf2 external-art-buffer :offset 20) - (parts int32 :offset-assert 24) - (priority float :offset-assert 28) - (owner handle :offset-assert 32) - (command-list pair :offset-assert 40) + ((name string :offset 16) + (buf1 external-art-buffer :overlay-at name) + (index int32 :offset 20) + (buf2 external-art-buffer :overlay-at index) + (parts int32) + (priority float) + (owner handle) + (command-list pair) ) :pack-me - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type spool-anim -(defmethod inspect spool-anim ((this spool-anim)) +(defmethod inspect ((this spool-anim)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tindex: ~D~%" (-> this index)) @@ -161,34 +149,31 @@ ;; definition of type external-art-control (deftype external-art-control (basic) - ((buffer external-art-buffer 2 :offset-assert 4) - (rec spool-anim 3 :inline :offset-assert 16) - (spool-lock handle :offset-assert 160) - (reserve-buffer external-art-buffer :offset-assert 168) - (reserve-buffer-count int32 :offset-assert 172) - (active-stream string :offset-assert 176) - (preload-stream spool-anim :inline :offset-assert 184) - (last-preload-stream spool-anim :inline :offset-assert 232) - (end-pad uint32 :offset-assert 276) + ((buffer external-art-buffer 2) + (rec spool-anim 3 :inline) + (spool-lock handle) + (reserve-buffer external-art-buffer) + (reserve-buffer-count int32) + (active-stream string) + (preload-stream spool-anim :inline) + (last-preload-stream spool-anim :inline) + (end-pad uint32) ) - :method-count-assert 17 - :size-assert #x118 - :flag-assert #x1100000118 (:methods - (new (symbol type) _type_ 0) - (update (_type_ symbol) int 9) - (clear-rec (_type_) int 10) - (spool-push (_type_ string int process float) int 11) - (file-status (_type_ string int) symbol 12) - (reserve-alloc (_type_) kheap 13) - (reserve-free (_type_ kheap) int 14) - (none-reserved? (_type_) symbol 15) - (try-preload-stream (_type_ string int process float) int 16) + (new (symbol type) _type_) + (update (_type_ symbol) int) + (clear-rec (_type_) int) + (spool-push (_type_ string int process float) int) + (file-status (_type_ string int) symbol) + (reserve-alloc (_type_) kheap) + (reserve-free (_type_ kheap) int) + (none-reserved? (_type_) symbol) + (try-preload-stream (_type_ string int process float) int) ) ) ;; definition for method 3 of type external-art-control -(defmethod inspect external-art-control ((this external-art-control)) +(defmethod inspect ((this external-art-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tbuffer[2] @ #x~X~%" (-> this buffer)) (format #t "~Trec[3] @ #x~X~%" (-> this rec)) diff --git a/test/decompiler/reference/jak1/engine/load/loader_REF.gc b/test/decompiler/reference/jak1/engine/load/loader_REF.gc index 8bb576d6d1c..cbd02a70001 100644 --- a/test/decompiler/reference/jak1/engine/load/loader_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/loader_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 3 of type load-dir ;; INFO: Used lq/sq -(defmethod inspect load-dir ((this load-dir)) +(defmethod inspect ((this load-dir)) (local-vars (sv-16 basic)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlevel: ~A~%" (-> this lev)) @@ -27,7 +27,7 @@ ;; definition for method 8 of type load-dir ;; INFO: Return type mismatch symbol vs load-dir. -(defmethod mem-usage load-dir ((this load-dir) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this load-dir) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 82 (-> arg0 length))) (set! (-> arg0 data 81 name) "array") (+! (-> arg0 data 81 count) 1) @@ -56,7 +56,7 @@ ) ;; definition for method 9 of type load-dir-art-group -(defmethod load-to-heap-by-name load-dir-art-group ((this load-dir-art-group) (art-name string) (do-reload symbol) (heap kheap) (version int)) +(defmethod load-to-heap-by-name ((this load-dir-art-group) (art-name string) (do-reload symbol) (heap kheap) (version int)) (let ((s5-0 (-> this string-array))) (dotimes (s3-0 (-> s5-0 length)) (when (string= art-name (-> s5-0 s3-0)) @@ -83,7 +83,7 @@ ) ;; definition for method 10 of type load-dir-art-group -(defmethod set-loaded-art load-dir-art-group ((this load-dir-art-group) (arg0 art-group)) +(defmethod set-loaded-art ((this load-dir-art-group) (arg0 art-group)) (let ((s4-0 (-> this string-array))) (dotimes (s3-0 (-> s4-0 length)) (when (string= (-> arg0 name) (-> s4-0 s3-0)) @@ -167,7 +167,7 @@ ) ;; definition for method 9 of type external-art-buffer -(defmethod set-pending-file external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) +(defmethod set-pending-file ((this external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) (set! (-> this pending-load-file) arg0) (set! (-> this pending-load-file-part) arg1) (set! (-> this pending-load-file-owner) arg2) @@ -176,18 +176,18 @@ ) ;; definition for method 15 of type external-art-buffer -(defmethod unlock! external-art-buffer ((this external-art-buffer)) +(defmethod unlock! ((this external-art-buffer)) (set! (-> this locked?) #f) #f ) ;; definition for method 11 of type external-art-buffer -(defmethod inactive? external-art-buffer ((this external-art-buffer)) +(defmethod inactive? ((this external-art-buffer)) (!= (-> this status) 'active) ) ;; definition for method 12 of type external-art-buffer -(defmethod file-status external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int)) +(defmethod file-status ((this external-art-buffer) (arg0 string) (arg1 int)) (when (and (name= (-> this pending-load-file) arg0) (= (-> this pending-load-file-part) arg1)) (if (and (name= (-> this load-file) arg0) (= (-> this load-file-part) arg1)) (-> this status) @@ -197,7 +197,7 @@ ) ;; definition for method 13 of type art-group -(defmethod link-art! art-group ((this art-group)) +(defmethod link-art! ((this art-group)) (when this (countdown (s5-0 (-> this length)) (let* ((art-elt (-> this data s5-0)) @@ -245,7 +245,7 @@ ) ;; definition for method 14 of type art-group -(defmethod unlink-art! art-group ((this art-group)) +(defmethod unlink-art! ((this art-group)) (when this (countdown (s5-0 (-> this length)) (let* ((art-elt (-> this data s5-0)) @@ -283,7 +283,7 @@ ) ;; definition for method 13 of type external-art-buffer -(defmethod link-file external-art-buffer ((this external-art-buffer) (arg0 art-group)) +(defmethod link-file ((this external-art-buffer) (arg0 art-group)) (when arg0 (link-art! arg0) (set! (-> this art-group) arg0) @@ -292,7 +292,7 @@ ) ;; definition for method 14 of type external-art-buffer -(defmethod unlink-file external-art-buffer ((this external-art-buffer) (arg0 art-group)) +(defmethod unlink-file ((this external-art-buffer) (arg0 art-group)) (when arg0 (unlink-art! arg0) (set! (-> this art-group) #f) @@ -302,7 +302,7 @@ ;; definition for method 10 of type external-art-buffer ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. -(defmethod update external-art-buffer ((this external-art-buffer)) +(defmethod update ((this external-art-buffer)) (when (or (not (name= (-> this pending-load-file) (-> this load-file))) (!= (-> this pending-load-file-part) (-> this load-file-part)) ) @@ -476,7 +476,7 @@ (define *preload-spool-anims* #t) ;; definition for method 12 of type external-art-control -(defmethod file-status external-art-control ((this external-art-control) (arg0 string) (arg1 int)) +(defmethod file-status ((this external-art-control) (arg0 string) (arg1 int)) (dotimes (s3-0 2) (let ((v1-3 (file-status (-> this buffer s3-0) arg0 arg1))) (if v1-3 @@ -488,7 +488,7 @@ ) ;; definition for method 9 of type external-art-control -(defmethod update external-art-control ((this external-art-control) (arg0 symbol)) +(defmethod update ((this external-art-control) (arg0 symbol)) (if (nonzero? (-> this reserve-buffer-count)) (spool-push this "reserved" 0 *dproc* (if (-> this reserve-buffer) -110.0 @@ -640,12 +640,12 @@ ) ;; definition for method 15 of type external-art-control -(defmethod none-reserved? external-art-control ((this external-art-control)) +(defmethod none-reserved? ((this external-art-control)) (zero? (-> this reserve-buffer-count)) ) ;; definition for method 13 of type external-art-control -(defmethod reserve-alloc external-art-control ((this external-art-control)) +(defmethod reserve-alloc ((this external-art-control)) (set! (-> this reserve-buffer-count) 1) (if (-> this reserve-buffer) (-> this reserve-buffer heap) @@ -653,7 +653,7 @@ ) ;; definition for method 14 of type external-art-control -(defmethod reserve-free external-art-control ((this external-art-control) (arg0 kheap)) +(defmethod reserve-free ((this external-art-control) (arg0 kheap)) (cond ((zero? (-> this reserve-buffer-count)) (format 0 "ERROR: illegal attempt to free a buffer #x~X which had not been reserved (none reserved).~%" arg0) @@ -676,7 +676,7 @@ ) ;; definition for method 10 of type external-art-control -(defmethod clear-rec external-art-control ((this external-art-control)) +(defmethod clear-rec ((this external-art-control)) (cond ((!= *master-mode* 'game) (dotimes (s5-0 3) @@ -716,7 +716,7 @@ ) ;; definition for method 16 of type external-art-control -(defmethod try-preload-stream external-art-control ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) +(defmethod try-preload-stream ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) (when (and (= arg3 -99.0) arg2) (let ((a0-2 (target-pos 0))) (set! arg3 (vector-vector-distance a0-2 (-> (the-as process-drawable arg2) root trans))) @@ -732,7 +732,7 @@ ) ;; definition for method 11 of type external-art-control -(defmethod spool-push external-art-control ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) +(defmethod spool-push ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) (when (and (= arg3 -99.0) arg2) (let ((a0-2 (target-pos 0))) (set! arg3 (vector-vector-distance a0-2 (-> (the-as process-drawable arg2) root trans))) diff --git a/test/decompiler/reference/jak1/engine/load/ramdisk_REF.gc b/test/decompiler/reference/jak1/engine/load/ramdisk_REF.gc index 572c5eb71a7..0fa8907e64d 100644 --- a/test/decompiler/reference/jak1/engine/load/ramdisk_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/ramdisk_REF.gc @@ -3,19 +3,16 @@ ;; definition of type ramdisk-rpc-fill (deftype ramdisk-rpc-fill (structure) - ((rsvd1 int32 :offset-assert 0) - (ee-id int32 :offset-assert 4) - (rsvd2 int32 2 :offset-assert 8) - (filename uint128 :offset-assert 16) + ((rsvd1 int32) + (ee-id int32) + (rsvd2 int32 2) + (filename uint128) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type ramdisk-rpc-fill ;; INFO: Used lq/sq -(defmethod inspect ramdisk-rpc-fill ((this ramdisk-rpc-fill)) +(defmethod inspect ((this ramdisk-rpc-fill)) (format #t "[~8x] ~A~%" this 'ramdisk-rpc-fill) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tee-id: ~D~%" (-> this ee-id)) @@ -26,18 +23,15 @@ ;; definition of type ramdisk-rpc-load (deftype ramdisk-rpc-load (structure) - ((rsvd int32 :offset-assert 0) - (ee-id int32 :offset-assert 4) - (offset uint32 :offset-assert 8) - (length uint32 :offset-assert 12) + ((rsvd int32) + (ee-id int32) + (offset uint32) + (length uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type ramdisk-rpc-load -(defmethod inspect ramdisk-rpc-load ((this ramdisk-rpc-load)) +(defmethod inspect ((this ramdisk-rpc-load)) (format #t "[~8x] ~A~%" this 'ramdisk-rpc-load) (format #t "~Trsvd: ~D~%" (-> this rsvd)) (format #t "~Tee-id: ~D~%" (-> this ee-id)) @@ -48,20 +42,17 @@ ;; definition of type ramdisk-rpc-load-to-ee (deftype ramdisk-rpc-load-to-ee (structure) - ((rsvd int32 :offset-assert 0) - (addr int32 :offset-assert 4) - (offset int32 :offset-assert 8) - (length int32 :offset-assert 12) - (filename uint128 :offset-assert 16) + ((rsvd int32) + (addr int32) + (offset int32) + (length int32) + (filename uint128) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type ramdisk-rpc-load-to-ee ;; INFO: Used lq/sq -(defmethod inspect ramdisk-rpc-load-to-ee ((this ramdisk-rpc-load-to-ee)) +(defmethod inspect ((this ramdisk-rpc-load-to-ee)) (format #t "[~8x] ~A~%" this 'ramdisk-rpc-load-to-ee) (format #t "~Trsvd: ~D~%" (-> this rsvd)) (format #t "~Taddr: ~D~%" (-> this addr)) diff --git a/test/decompiler/reference/jak1/engine/math/euler-h_REF.gc b/test/decompiler/reference/jak1/engine/math/euler-h_REF.gc index a3834136254..b950e1f952b 100644 --- a/test/decompiler/reference/jak1/engine/math/euler-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/euler-h_REF.gc @@ -10,14 +10,11 @@ ;; definition of type euler-angles (deftype euler-angles (vector) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type euler-angles ;; INFO: Used lq/sq -(defmethod inspect euler-angles ((this euler-angles)) +(defmethod inspect ((this euler-angles)) (format #t "[~8x] ~A~%" this 'euler-angles) (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) (format #t "~Tx: ~f~%" (-> this x)) diff --git a/test/decompiler/reference/jak1/engine/math/math_REF.gc b/test/decompiler/reference/jak1/engine/math/math_REF.gc index 17f2f5dd64b..8a42882fec8 100644 --- a/test/decompiler/reference/jak1/engine/math/math_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/math_REF.gc @@ -23,25 +23,16 @@ (b uint8 :offset 16 :size 8) (a uint8 :offset 24 :size 8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type xyzw (deftype xyzw (uint128) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition of type xyzwh (deftype xyzwh (uint128) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for function log2 @@ -195,15 +186,12 @@ ;; definition of type random-generator (deftype random-generator (basic) - ((seed uint32 :offset-assert 4) + ((seed uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type random-generator -(defmethod inspect random-generator ((this random-generator)) +(defmethod inspect ((this random-generator)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tseed: ~D~%" (-> this seed)) this diff --git a/test/decompiler/reference/jak1/engine/math/matrix-h_REF.gc b/test/decompiler/reference/jak1/engine/math/matrix-h_REF.gc index 3cd541df641..e072e7a6416 100644 --- a/test/decompiler/reference/jak1/engine/math/matrix-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/matrix-h_REF.gc @@ -3,21 +3,18 @@ ;; definition of type matrix (deftype matrix (structure) - ((vector vector 4 :inline :offset 0) - (quad uint128 4 :offset 0) - (data float 16 :offset 0) + ((vector vector 4 :inline :offset 0) + (quad uint128 4 :overlay-at vector) + (data float 16 :overlay-at vector) ) - :method-count-assert 10 - :size-assert #x40 - :flag-assert #xa00000040 (:methods - (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none 9) + (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none) ) ) ;; definition for method 3 of type matrix ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect matrix ((this matrix)) +(defmethod inspect ((this matrix)) (format #t "[~8x] ~A~%" this 'matrix) (format #t "~Tdata[16] @ #x~X~%" (-> this vector)) (format #t "~Tvector[4] @ #x~X~%" (-> this vector)) @@ -27,18 +24,15 @@ ;; definition of type matrix3 (deftype matrix3 (structure) - ((data float 12 :offset-assert 0) - (vector vector 3 :inline :offset 0) - (quad uint128 3 :offset 0) + ((data float 12) + (vector vector 3 :inline :overlay-at (-> data 0)) + (quad uint128 3 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type matrix3 ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect matrix3 ((this matrix3)) +(defmethod inspect ((this matrix3)) (format #t "[~8x] ~A~%" this 'matrix3) (format #t "~Tdata[12] @ #x~X~%" (-> this data)) (format #t "~Tvector[3] @ #x~X~%" (-> this data)) @@ -48,17 +42,14 @@ ;; definition of type matrix4h (deftype matrix4h (structure) - ((data int16 16 :offset-assert 0) - (vector4h vector4h 4 :inline :offset 0) - (long int64 4 :offset 0) + ((data int16 16) + (vector4h vector4h 4 :inline :overlay-at (-> data 0)) + (long int64 4 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type matrix4h -(defmethod inspect matrix4h ((this matrix4h)) +(defmethod inspect ((this matrix4h)) (format #t "[~8x] ~A~%" this 'matrix4h) (format #t "~Tdata[16] @ #x~X~%" (-> this data)) (format #t "~Tvector4h[4] @ #x~X~%" (-> this data)) diff --git a/test/decompiler/reference/jak1/engine/math/matrix_REF.gc b/test/decompiler/reference/jak1/engine/math/matrix_REF.gc index 50c7adf5176..03fe446c74b 100644 --- a/test/decompiler/reference/jak1/engine/math/matrix_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/matrix_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 3 of type matrix ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect matrix ((this matrix)) +(defmethod inspect ((this matrix)) (format #t "[~8x] matrix~%" this) (format #t @@ -42,7 +42,7 @@ ;; definition for method 3 of type matrix3 ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect matrix3 ((this matrix3)) +(defmethod inspect ((this matrix3)) (format #t "[~8x] matrix3~%" this) (format #t "~T[~F] [~F] [~F]~%" (-> this data 0) (-> this data 1) (-> this data 2)) (format #t "~T[~F] [~F] [~F]~%" (-> this data 4) (-> this data 5) (-> this data 6)) diff --git a/test/decompiler/reference/jak1/engine/math/quaternion-h_REF.gc b/test/decompiler/reference/jak1/engine/math/quaternion-h_REF.gc index 3c115486f80..147aeaced8c 100644 --- a/test/decompiler/reference/jak1/engine/math/quaternion-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/quaternion-h_REF.gc @@ -3,23 +3,20 @@ ;; definition of type quaternion (deftype quaternion (structure) - ((x float :offset-assert 0) - (y float :offset-assert 4) - (z float :offset-assert 8) - (w float :offset-assert 12) - (data float 4 :offset 0) - (vec vector :inline :offset 0) - (quad uint128 :offset 0) + ((x float) + (y float) + (z float) + (w float) + (data float 4 :overlay-at x) + (vec vector :inline :overlay-at x) + (quad uint128 :overlay-at x) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type quaternion ;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -(defmethod inspect quaternion ((this quaternion)) +(defmethod inspect ((this quaternion)) (format #t "[~8x] ~A~%" this 'quaternion) (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) (format #t "~Tx: ~f~%" (-> this x)) diff --git a/test/decompiler/reference/jak1/engine/math/quaternion_REF.gc b/test/decompiler/reference/jak1/engine/math/quaternion_REF.gc index 2a1a7fe3eed..695ee51f35f 100644 --- a/test/decompiler/reference/jak1/engine/math/quaternion_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/quaternion_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 3 of type quaternion ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect quaternion ((this quaternion)) +(defmethod inspect ((this quaternion)) (format #t "[~8x] quaternion~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w)) (let ((f0-5 (/ 1.0 (sqrtf (+ (* (-> this x) (-> this x)) (* (-> this y) (-> this y)) (* (-> this z) (-> this z)))))) diff --git a/test/decompiler/reference/jak1/engine/math/transform-h_REF.gc b/test/decompiler/reference/jak1/engine/math/transform-h_REF.gc index 0565e6c8abb..6ed92548dbd 100644 --- a/test/decompiler/reference/jak1/engine/math/transform-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/transform-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type transform (deftype transform (structure) - ((trans vector :inline :offset-assert 0) - (rot vector :inline :offset-assert 16) - (scale vector :inline :offset-assert 32) + ((trans vector :inline) + (rot vector :inline) + (scale vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type transform -(defmethod inspect transform ((this transform)) +(defmethod inspect ((this transform)) (format #t "[~8x] ~A~%" this 'transform) (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) (format #t "~Trot: ~`vector`P~%" (-> this rot)) @@ -23,20 +20,17 @@ ;; definition of type trs (deftype trs (basic) - ((trans vector :inline :offset-assert 16) - (rot vector :inline :offset-assert 32) - (scale vector :inline :offset-assert 48) + ((trans vector :inline) + (rot vector :inline) + (scale vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type trs -(defmethod inspect trs ((this trs)) +(defmethod inspect ((this trs)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) (format #t "~Trot: ~`vector`P~%" (-> this rot)) diff --git a/test/decompiler/reference/jak1/engine/math/transform_REF.gc b/test/decompiler/reference/jak1/engine/math/transform_REF.gc index 34b41606a72..38672d428df 100644 --- a/test/decompiler/reference/jak1/engine/math/transform_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/transform_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 2 of type transform -(defmethod print transform ((this transform)) +(defmethod print ((this transform)) (format #t "# this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) (format #t "~T~Trot: ~F ~F ~F ~F ~%" (-> this rot x) (-> this rot y) (-> this rot z) (-> this rot w)) diff --git a/test/decompiler/reference/jak1/engine/math/transformq-h_REF.gc b/test/decompiler/reference/jak1/engine/math/transformq-h_REF.gc index 7e0333723fd..7c37492ef78 100644 --- a/test/decompiler/reference/jak1/engine/math/transformq-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/transformq-h_REF.gc @@ -3,15 +3,12 @@ ;; definition of type transformq (deftype transformq (transform) - ((quat quaternion :inline :offset 16) + ((quat quaternion :inline :overlay-at (-> rot x)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type transformq -(defmethod inspect transformq ((this transformq)) +(defmethod inspect ((this transformq)) (format #t "[~8x] ~A~%" this 'transformq) (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) (format #t "~Trot: ~`vector`P~%" (-> this quat)) @@ -22,15 +19,12 @@ ;; definition of type trsq (deftype trsq (trs) - ((quat quaternion :inline :offset 32) + ((quat quaternion :inline :overlay-at (-> rot x)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type trsq -(defmethod inspect trsq ((this trsq)) +(defmethod inspect ((this trsq)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) (format #t "~Trot: ~`vector`P~%" (-> this quat)) @@ -41,43 +35,40 @@ ;; definition of type trsqv (deftype trsqv (trsq) - ((pause-adjust-distance meters :offset 4) - (nav-radius meters :offset 8) - (transv vector :inline :offset-assert 64) - (rotv vector :inline :offset-assert 80) - (scalev vector :inline :offset-assert 96) - (dir-targ quaternion :inline :offset-assert 112) - (angle-change-time time-frame :offset-assert 128) - (old-y-angle-diff float :offset-assert 136) + ((pause-adjust-distance meters :offset 4) + (nav-radius meters :offset 8) + (transv vector :inline) + (rotv vector :inline) + (scalev vector :inline) + (dir-targ quaternion :inline) + (angle-change-time time-frame) + (old-y-angle-diff float) ) - :method-count-assert 28 - :size-assert #x8c - :flag-assert #x1c0000008c (:methods - (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion 9) - (set-heading-vec! (_type_ vector) quaternion 10) - (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion 11) - (point-toward-point! (_type_ vector) quaternion 12) - (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion 13) - (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion 14) - (set-roll-to-grav! (_type_ float) quaternion 15) - (set-roll-to-grav-2! (_type_ float) quaternion 16) - (rotate-toward-orientation! (_type_ quaternion float float) quaternion 17) - (set-quaternion! (_type_ quaternion) quaternion 18) - (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion 19) - (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion 20) - (rot->dir-targ! (_type_) quaternion 21) - (y-angle (_type_) float 22) - (global-y-angle-to-point (_type_ vector) float 23) - (relative-y-angle-to-point (_type_ vector) float 24) - (roll-relative-to-gravity (_type_) float 25) - (set-and-limit-velocity (_type_ int vector float) trsqv 26) - (get-quaternion (_type_) quaternion 27) + (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion) + (set-heading-vec! (_type_ vector) quaternion) + (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion) + (point-toward-point! (_type_ vector) quaternion) + (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion) + (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion) + (set-roll-to-grav! (_type_ float) quaternion) + (set-roll-to-grav-2! (_type_ float) quaternion) + (rotate-toward-orientation! (_type_ quaternion float float) quaternion) + (set-quaternion! (_type_ quaternion) quaternion) + (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion) + (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion) + (rot->dir-targ! (_type_) quaternion) + (y-angle (_type_) float) + (global-y-angle-to-point (_type_ vector) float) + (relative-y-angle-to-point (_type_ vector) float) + (roll-relative-to-gravity (_type_) float) + (set-and-limit-velocity (_type_ int vector float) trsqv) + (get-quaternion (_type_) quaternion) ) ) ;; definition for method 3 of type trsqv -(defmethod inspect trsqv ((this trsqv)) +(defmethod inspect ((this trsqv)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) (format #t "~Trot: ~`vector`P~%" (-> this quat)) @@ -95,12 +86,12 @@ ) ;; definition for method 23 of type trsqv -(defmethod global-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) +(defmethod global-y-angle-to-point ((this trsqv) (arg0 vector)) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans))) ) ;; definition for method 24 of type trsqv -(defmethod relative-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) +(defmethod relative-y-angle-to-point ((this trsqv) (arg0 vector)) (deg-diff (y-angle this) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)))) ) diff --git a/test/decompiler/reference/jak1/engine/math/transformq_REF.gc b/test/decompiler/reference/jak1/engine/math/transformq_REF.gc index 6521aeaf471..f6aec9d28c4 100644 --- a/test/decompiler/reference/jak1/engine/math/transformq_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/transformq_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 2 of type transformq -(defmethod print transformq ((this transformq)) +(defmethod print ((this transformq)) (format #t "# this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) (format #t "~T~Tquat: ~F ~F ~F ~F ~%" (-> this quat x) (-> this quat y) (-> this quat z) (-> this quat w)) @@ -11,27 +11,27 @@ ) ;; definition for method 27 of type trsqv -(defmethod get-quaternion trsqv ((this trsqv)) +(defmethod get-quaternion ((this trsqv)) (-> this quat) ) ;; definition for method 18 of type trsqv -(defmethod set-quaternion! trsqv ((this trsqv) (arg0 quaternion)) +(defmethod set-quaternion! ((this trsqv) (arg0 quaternion)) (quaternion-copy! (get-quaternion this) arg0) ) ;; definition for method 21 of type trsqv -(defmethod rot->dir-targ! trsqv ((this trsqv)) +(defmethod rot->dir-targ! ((this trsqv)) (quaternion-copy! (-> this dir-targ) (get-quaternion this)) ) ;; definition for method 22 of type trsqv -(defmethod y-angle trsqv ((this trsqv)) +(defmethod y-angle ((this trsqv)) (quaternion-y-angle (get-quaternion this)) ) ;; definition for method 9 of type trsqv -(defmethod seek-toward-heading-vec! trsqv ((this trsqv) (dir vector) (vel float) (frame-count time-frame)) +(defmethod seek-toward-heading-vec! ((this trsqv) (dir vector) (vel float) (frame-count time-frame)) (let* ((yaw-error (deg-diff (quaternion-y-angle (-> this quat)) (vector-y-angle dir))) (yaw-limit (fmin (* vel (seconds-per-frame)) (/ (* 5.0 (fabs yaw-error)) (the float frame-count)))) (saturated-yaw (fmax (fmin yaw-error yaw-limit) (- yaw-limit))) @@ -60,7 +60,7 @@ ) ;; definition for method 10 of type trsqv -(defmethod set-heading-vec! trsqv ((this trsqv) (arg0 vector)) +(defmethod set-heading-vec! ((this trsqv) (arg0 vector)) (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion s3-0 @@ -71,12 +71,12 @@ ) ;; definition for method 11 of type trsqv -(defmethod seek-to-point-toward-point! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) +(defmethod seek-to-point-toward-point! ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) (seek-toward-heading-vec! this (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) arg1 arg2) ) ;; definition for method 12 of type trsqv -(defmethod point-toward-point! trsqv ((this trsqv) (arg0 vector)) +(defmethod point-toward-point! ((this trsqv) (arg0 vector)) (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion s3-0 @@ -87,7 +87,7 @@ ) ;; definition for method 13 of type trsqv -(defmethod seek-toward-yaw-angle! trsqv ((this trsqv) (yaw float) (vel float) (frame-count time-frame)) +(defmethod seek-toward-yaw-angle! ((this trsqv) (yaw float) (vel float) (frame-count time-frame)) (let ((s3-0 (method-of-object this seek-toward-heading-vec!)) (s2-0 (new 'stack-no-clear 'vector)) ) @@ -100,7 +100,7 @@ ) ;; definition for method 14 of type trsqv -(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((this trsqv) (arg0 float)) +(defmethod set-yaw-angle-clear-roll-pitch! ((this trsqv) (arg0 float)) (let ((s5-0 (method-of-object this set-heading-vec-clear-roll-pitch!)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -113,12 +113,12 @@ ) ;; definition for method 15 of type trsqv -(defmethod set-roll-to-grav! trsqv ((this trsqv) (arg0 float)) +(defmethod set-roll-to-grav! ((this trsqv) (arg0 float)) (set-roll-to-grav-2! this arg0) ) ;; definition for method 16 of type trsqv -(defmethod set-roll-to-grav-2! trsqv ((this trsqv) (arg0 float)) +(defmethod set-roll-to-grav-2! ((this trsqv) (arg0 float)) (let* ((quat (get-quaternion this)) (grav (-> *standard-dynamics* gravity-normal)) (rot-mat (quaternion->matrix (new 'stack-no-clear 'matrix) quat)) @@ -135,7 +135,7 @@ ) ;; definition for method 25 of type trsqv -(defmethod roll-relative-to-gravity trsqv ((this trsqv)) +(defmethod roll-relative-to-gravity ((this trsqv)) (let* ((quat (get-quaternion this)) (dir-z (vector-z-quaternion! (new 'stack-no-clear 'vector) quat)) (dir-y (vector-y-quaternion! (new 'stack-no-clear 'vector) quat)) @@ -152,7 +152,7 @@ ;; definition for method 17 of type trsqv ;; INFO: Used lq/sq -(defmethod rotate-toward-orientation! trsqv ((this trsqv) (target quaternion) (y-rate float) (z-rate float)) +(defmethod rotate-toward-orientation! ((this trsqv) (target quaternion) (y-rate float) (z-rate float)) (local-vars (sv-96 vector)) (let ((quat (get-quaternion this))) (let ((temp-quat (new 'stack-no-clear 'quaternion))) @@ -184,7 +184,7 @@ ) ;; definition for method 19 of type trsqv -(defmethod set-heading-vec-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) +(defmethod set-heading-vec-clear-roll-pitch! ((this trsqv) (arg0 vector)) (forward-up->quaternion (get-quaternion this) (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) @@ -193,7 +193,7 @@ ) ;; definition for method 20 of type trsqv -(defmethod point-toward-point-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) +(defmethod point-toward-point-clear-roll-pitch! ((this trsqv) (arg0 vector)) (forward-up->quaternion (get-quaternion this) (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0) diff --git a/test/decompiler/reference/jak1/engine/math/trigonometry_REF.gc b/test/decompiler/reference/jak1/engine/math/trigonometry_REF.gc index 05b6947c641..954cb2bc2a0 100644 --- a/test/decompiler/reference/jak1/engine/math/trigonometry_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/trigonometry_REF.gc @@ -537,9 +537,6 @@ ;; definition of type float-type (deftype float-type (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for symbol exp-slead, type (pointer float) diff --git a/test/decompiler/reference/jak1/engine/math/vector-h_REF.gc b/test/decompiler/reference/jak1/engine/math/vector-h_REF.gc index 49b551f5221..2fa4966c07b 100644 --- a/test/decompiler/reference/jak1/engine/math/vector-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/vector-h_REF.gc @@ -3,25 +3,22 @@ ;; definition of type bit-array (deftype bit-array (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (_pad uint8 :offset-assert 12) - (bytes uint8 :dynamic :offset 12) + ((length int32) + (allocated-length int32) + (_pad uint8) + (bytes uint8 :dynamic :overlay-at _pad) ) - :method-count-assert 13 - :size-assert #xd - :flag-assert #xd0000000d (:methods - (new (symbol type int) _type_ 0) - (get-bit (_type_ int) symbol 9) - (clear-bit (_type_ int) int 10) - (set-bit (_type_ int) int 11) - (clear-all! (_type_) _type_ 12) + (new (symbol type int) _type_) + (get-bit (_type_ int) symbol) + (clear-bit (_type_ int) int) + (set-bit (_type_ int) int) + (clear-all! (_type_) _type_) ) ) ;; definition for method 3 of type bit-array -(defmethod inspect bit-array ((this bit-array)) +(defmethod inspect ((this bit-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -38,37 +35,37 @@ ) ;; definition for method 4 of type bit-array -(defmethod length bit-array ((this bit-array)) +(defmethod length ((this bit-array)) (-> this length) ) ;; definition for method 5 of type bit-array ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of bit-array ((this bit-array)) +(defmethod asize-of ((this bit-array)) (the-as int (+ (-> this type size) (/ (logand -8 (+ (-> this allocated-length) 7)) 8))) ) ;; definition for method 9 of type bit-array -(defmethod get-bit bit-array ((this bit-array) (arg0 int)) +(defmethod get-bit ((this bit-array) (arg0 int)) (let ((v1-2 (-> this bytes (/ arg0 8)))) (logtest? v1-2 (ash 1 (logand arg0 7))) ) ) ;; definition for method 10 of type bit-array -(defmethod clear-bit bit-array ((this bit-array) (arg0 int)) +(defmethod clear-bit ((this bit-array) (arg0 int)) (logclear! (-> this bytes (/ arg0 8)) (ash 1 (logand arg0 7))) 0 ) ;; definition for method 11 of type bit-array -(defmethod set-bit bit-array ((this bit-array) (arg0 int)) +(defmethod set-bit ((this bit-array) (arg0 int)) (logior! (-> this bytes (/ arg0 8)) (ash 1 (logand arg0 7))) 0 ) ;; definition for method 12 of type bit-array -(defmethod clear-all! bit-array ((this bit-array)) +(defmethod clear-all! ((this bit-array)) (countdown (idx (/ (logand -8 (+ (-> this allocated-length) 7)) 8)) (nop!) (nop!) @@ -79,21 +76,18 @@ ;; definition of type vector4ub (deftype vector4ub (structure) - ((data uint8 4 :offset-assert 0) - (x uint8 :offset 0) - (y uint8 :offset 1) - (z uint8 :offset 2) - (w uint8 :offset 3) - (clr uint32 :offset 0) + ((data uint8 4) + (x uint8 :overlay-at (-> data 0)) + (y uint8 :overlay-at (-> data 1)) + (z uint8 :overlay-at (-> data 2)) + (w uint8 :overlay-at (-> data 3)) + (clr uint32 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type vector4ub -(defmethod inspect vector4ub ((this vector4ub)) +(defmethod inspect ((this vector4ub)) (format #t "[~8x] ~A~%" this 'vector4ub) (format #t "~Tdata[4] @ #x~X~%" (-> this data)) (format #t "~Tx: ~D~%" (-> this x)) @@ -106,19 +100,16 @@ ;; definition of type vector4b (deftype vector4b (structure) - ((data int8 4 :offset-assert 0) - (x int8 :offset 0) - (y int8 :offset 1) - (z int8 :offset 2) - (w int8 :offset 3) + ((data int8 4) + (x int8 :overlay-at (-> data 0)) + (y int8 :overlay-at (-> data 1)) + (z int8 :overlay-at (-> data 2)) + (w int8 :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type vector4b -(defmethod inspect vector4b ((this vector4b)) +(defmethod inspect ((this vector4b)) (format #t "[~8x] ~A~%" this 'vector4b) (format #t "~Tdata[4] @ #x~X~%" (-> this data)) (format #t "~Tx: ~D~%" (-> this x)) @@ -130,18 +121,15 @@ ;; definition of type vector2h (deftype vector2h (structure) - ((data int16 2 :offset-assert 0) - (x int16 :offset 0) - (y int16 :offset 2) + ((data int16 2) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type vector2h -(defmethod inspect vector2h ((this vector2h)) +(defmethod inspect ((this vector2h)) (format #t "[~8x] ~A~%" this 'vector2h) (format #t "~Tdata[2] @ #x~X~%" (&-> this x)) (format #t "~Tx: ~D~%" (-> this x)) @@ -151,19 +139,16 @@ ;; definition of type vector2uh (deftype vector2uh (structure) - ((data uint16 2 :offset-assert 0) - (x uint16 :offset 0) - (y uint16 :offset 2) - (val uint32 :offset 0) + ((data uint16 2) + (x uint16 :overlay-at (-> data 0)) + (y uint16 :overlay-at (-> data 1)) + (val uint32 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type vector2uh -(defmethod inspect vector2uh ((this vector2uh)) +(defmethod inspect ((this vector2uh)) (format #t "[~8x] ~A~%" this 'vector2uh) (format #t "~Tdata[2] @ #x~X~%" (-> this data)) (format #t "~Tx: ~D~%" (-> this x)) @@ -174,18 +159,15 @@ ;; definition of type vector3h (deftype vector3h (structure) - ((data int16 2 :offset-assert 0) - (x int16 :offset 0) - (y int16 :offset 2) - (z int16 :offset-assert 4) + ((data int16 2) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) ;; definition for method 3 of type vector3h -(defmethod inspect vector3h ((this vector3h)) +(defmethod inspect ((this vector3h)) (format #t "[~8x] ~A~%" this 'vector3h) (format #t "~Tdata[2] @ #x~X~%" (&-> this x)) (format #t "~Tx: ~D~%" (-> this x)) @@ -196,18 +178,15 @@ ;; definition of type vector2w (deftype vector2w (structure) - ((data int32 2 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) + ((data int32 2) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type vector2w -(defmethod inspect vector2w ((this vector2w)) +(defmethod inspect ((this vector2w)) (format #t "[~8x] ~A~%" this 'vector2w) (format #t "~Tdata[2] @ #x~X~%" (&-> this x)) (format #t "~Tx: ~D~%" (-> this x)) @@ -217,19 +196,16 @@ ;; definition of type vector3w (deftype vector3w (structure) - ((data int32 3 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) - (z int32 :offset 8) + ((data int32 3) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) + (z int32 :overlay-at (-> data 2)) ) :allow-misaligned - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type vector3w -(defmethod inspect vector3w ((this vector3w)) +(defmethod inspect ((this vector3w)) (format #t "[~8x] ~A~%" this 'vector3w) (format #t "~Tdata[3] @ #x~X~%" (&-> this x)) (format #t "~Tx: ~D~%" (-> this x)) @@ -240,22 +216,19 @@ ;; definition of type vector4w (deftype vector4w (structure) - ((data uint32 4 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) - (z int32 :offset 8) - (w int32 :offset 12) - (dword uint64 2 :offset 0) - (quad uint128 :offset 0) + ((data uint32 4) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) + (z int32 :overlay-at (-> data 2)) + (w int32 :overlay-at (-> data 3)) + (dword uint64 2 :overlay-at (-> data 0)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vector4w ;; INFO: Used lq/sq -(defmethod inspect vector4w ((this vector4w)) +(defmethod inspect ((this vector4w)) (format #t "[~8x] ~A~%" this 'vector4w) (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) (format #t "~Tx: ~D~%" (-> this x)) @@ -268,24 +241,21 @@ ) ;; definition for method 2 of type vector4w -(defmethod print vector4w ((this vector4w)) +(defmethod print ((this vector4w)) (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) this ) ;; definition of type vector4w-2 (deftype vector4w-2 (structure) - ((data int32 8 :offset-assert 0) - (quad uint128 2 :offset 0) - (vector vector4w 2 :inline :offset 0) + ((data int32 8) + (quad uint128 2 :overlay-at (-> data 0)) + (vector vector4w 2 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type vector4w-2 -(defmethod inspect vector4w-2 ((this vector4w-2)) +(defmethod inspect ((this vector4w-2)) (format #t "[~8x] ~A~%" this 'vector4w-2) (format #t "~Tdata[8] @ #x~X~%" (-> this quad)) (format #t "~Tquad[2] @ #x~X~%" (-> this quad)) @@ -295,17 +265,14 @@ ;; definition of type vector4w-3 (deftype vector4w-3 (structure) - ((data int32 12 :offset-assert 0) - (quad uint128 3 :offset 0) - (vector vector4w 3 :inline :offset 0) + ((data int32 12) + (quad uint128 3 :overlay-at (-> data 0)) + (vector vector4w 3 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type vector4w-3 -(defmethod inspect vector4w-3 ((this vector4w-3)) +(defmethod inspect ((this vector4w-3)) (format #t "[~8x] ~A~%" this 'vector4w-3) (format #t "~Tdata[12] @ #x~X~%" (-> this vector)) (format #t "~Tquad[3] @ #x~X~%" (-> this vector)) @@ -315,17 +282,14 @@ ;; definition of type vector4w-4 (deftype vector4w-4 (structure) - ((data int32 16 :offset-assert 0) - (quad uint128 4 :offset 0) - (vector vector4w 4 :inline :offset 0) + ((data int32 16) + (quad uint128 4 :overlay-at (-> data 0)) + (vector vector4w 4 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type vector4w-4 -(defmethod inspect vector4w-4 ((this vector4w-4)) +(defmethod inspect ((this vector4w-4)) (format #t "[~8x] ~A~%" this 'vector4w-4) (format #t "~Tdata[16] @ #x~X~%" (-> this quad)) (format #t "~Tquad[4] @ #x~X~%" (-> this quad)) @@ -335,21 +299,18 @@ ;; definition of type vector4h (deftype vector4h (structure) - ((data int16 4 :offset-assert 0) - (x int16 :offset 0) - (y int16 :offset 2) - (z int16 :offset 4) - (w int16 :offset 6) - (long uint64 :offset 0) + ((data int16 4) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) + (w int16 :overlay-at (-> data 3)) + (long uint64 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type vector4h -(defmethod inspect vector4h ((this vector4h)) +(defmethod inspect ((this vector4h)) (format #t "[~8x] ~A~%" this 'vector4h) (format #t "~Tdata[4] @ #x~X~%" (-> this data)) (format #t "~Tx: ~D~%" (-> this x)) @@ -362,17 +323,14 @@ ;; definition of type vector8h (deftype vector8h (structure) - ((data int16 8 :offset-assert 0) - (quad uint128 :offset 0) + ((data int16 8) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vector8h ;; INFO: Used lq/sq -(defmethod inspect vector8h ((this vector8h)) +(defmethod inspect ((this vector8h)) (format #t "[~8x] ~A~%" this 'vector8h) (format #t "~Tdata[8] @ #x~X~%" (-> this data)) (format #t "~Tquad: ~D~%" (-> this quad)) @@ -381,17 +339,14 @@ ;; definition of type vector16b (deftype vector16b (structure) - ((data int8 16 :offset-assert 0) - (quad uint128 :offset 0) + ((data int8 16) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vector16b ;; INFO: Used lq/sq -(defmethod inspect vector16b ((this vector16b)) +(defmethod inspect ((this vector16b)) (format #t "[~8x] ~A~%" this 'vector16b) (format #t "~Tdata[8] @ #x~X~%" (-> this data)) (format #t "~Tquad: ~D~%" (-> this quad)) @@ -400,22 +355,19 @@ ;; definition of type vector (deftype vector (structure) - ((x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (w float :offset 12) - (data float 4 :offset 0) - (quad uint128 :offset 0) + ((x float :offset 0) + (y float :offset 4) + (z float :offset 8) + (w float :offset 12) + (data float 4 :overlay-at x) + (quad uint128 :overlay-at x) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vector ;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -(defmethod inspect vector ((this vector)) +(defmethod inspect ((this vector)) (format #t "[~8x] ~A~%" this 'vector) (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) (format #t "~Tx: ~f~%" (-> this x)) @@ -428,14 +380,14 @@ ;; definition for method 3 of type vector ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect vector ((this vector)) +(defmethod inspect ((this vector)) (format #t "[~8x] vector~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w)) this ) ;; definition for method 2 of type vector -(defmethod print vector ((this vector)) +(defmethod print ((this vector)) (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) this ) @@ -460,17 +412,14 @@ ;; definition of type vector4s-3 (deftype vector4s-3 (structure) - ((data float 12 :offset-assert 0) - (quad uint128 3 :offset 0) - (vector vector 3 :inline :offset 0) + ((data float 12) + (quad uint128 3 :overlay-at (-> data 0)) + (vector vector 3 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type vector4s-3 -(defmethod inspect vector4s-3 ((this vector4s-3)) +(defmethod inspect ((this vector4s-3)) (format #t "[~8x] ~A~%" this 'vector4s-3) (format #t "~Tdata[12] @ #x~X~%" (-> this data)) (format #t "~Tquad[3] @ #x~X~%" (-> this data)) @@ -480,15 +429,12 @@ ;; definition of type vector-array (deftype vector-array (inline-array-class) - ((data vector :inline :dynamic :offset 16) + ((data vector :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vector-array -(defmethod inspect vector-array ((this vector-array)) +(defmethod inspect ((this vector-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -501,19 +447,16 @@ ;; definition of type rgbaf (deftype rgbaf (vector) - ((r float :offset 0) - (g float :offset 4) - (b float :offset 8) - (a float :offset 12) + ((r float :overlay-at x) + (g float :overlay-at y) + (b float :overlay-at z) + (a float :overlay-at w) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type rgbaf ;; INFO: Used lq/sq -(defmethod inspect rgbaf ((this rgbaf)) +(defmethod inspect ((this rgbaf)) (format #t "[~8x] ~A~%" this 'rgbaf) (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) (format #t "~Tx: ~f~%" (-> this x)) @@ -530,19 +473,16 @@ ;; definition of type plane (deftype plane (vector) - ((a float :offset 0) - (b float :offset 4) - (c float :offset 8) - (d float :offset 12) + ((a float :overlay-at x) + (b float :overlay-at y) + (c float :overlay-at z) + (d float :overlay-at w) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type plane ;; INFO: Used lq/sq -(defmethod inspect plane ((this plane)) +(defmethod inspect ((this plane)) (format #t "[~8x] ~A~%" this 'plane) (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) (format #t "~Tx: ~f~%" (-> this x)) @@ -559,16 +499,13 @@ ;; definition of type sphere (deftype sphere (vector) - ((r float :offset 12) + ((r float :overlay-at w) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type sphere ;; INFO: Used lq/sq -(defmethod inspect sphere ((this sphere)) +(defmethod inspect ((this sphere)) (format #t "[~8x] ~A~%" this 'sphere) (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) (format #t "~Tx: ~f~%" (-> this x)) @@ -583,26 +520,20 @@ ;; definition of type isphere (deftype isphere (vec4s) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition of type box8s (deftype box8s (structure) - ((data float 8 :offset-assert 0) - (quad uint128 2 :offset 0) - (vector vector 2 :offset 0) - (min vector :inline :offset 0) - (max vector :inline :offset 16) + ((data float 8) + (quad uint128 2 :overlay-at (-> data 0)) + (vector vector 2 :overlay-at (-> data 0)) + (min vector :inline :overlay-at (-> data 0)) + (max vector :inline :overlay-at (-> data 4)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type box8s -(defmethod inspect box8s ((this box8s)) +(defmethod inspect ((this box8s)) (format #t "[~8x] ~A~%" this 'box8s) (format #t "~Tdata[8] @ #x~X~%" (-> this data)) (format #t "~Tquad[2] @ #x~X~%" (-> this data)) @@ -614,15 +545,12 @@ ;; definition of type box8s-array (deftype box8s-array (inline-array-class) - ((data box8s :inline :dynamic :offset 16) + ((data box8s :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type box8s-array -(defmethod inspect box8s-array ((this box8s-array)) +(defmethod inspect ((this box8s-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -635,22 +563,19 @@ ;; definition of type cylinder (deftype cylinder (structure) - ((origin vector :inline :offset-assert 0) - (axis vector :inline :offset-assert 16) - (radius float :offset-assert 32) - (length float :offset-assert 36) + ((origin vector :inline) + (axis vector :inline) + (radius float) + (length float) ) - :method-count-assert 11 - :size-assert #x28 - :flag-assert #xb00000028 (:methods - (debug-draw (_type_ vector4w) none 9) - (ray-capsule-intersect (_type_ vector vector) float 10) + (debug-draw (_type_ vector4w) none) + (ray-capsule-intersect (_type_ vector vector) float) ) ) ;; definition for method 3 of type cylinder -(defmethod inspect cylinder ((this cylinder)) +(defmethod inspect ((this cylinder)) (format #t "[~8x] ~A~%" this 'cylinder) (format #t "~Torigin: #~%" (-> this origin)) (format #t "~Taxis: #~%" (-> this axis)) @@ -661,22 +586,19 @@ ;; definition of type cylinder-flat (deftype cylinder-flat (structure) - ((origin vector :inline :offset-assert 0) - (axis vector :inline :offset-assert 16) - (radius float :offset-assert 32) - (length float :offset-assert 36) + ((origin vector :inline) + (axis vector :inline) + (radius float) + (length float) ) - :method-count-assert 11 - :size-assert #x28 - :flag-assert #xb00000028 (:methods - (debug-draw (_type_ vector4w) none 9) - (ray-flat-cyl-intersect (_type_ vector vector) float 10) + (debug-draw (_type_ vector4w) none) + (ray-flat-cyl-intersect (_type_ vector vector) float) ) ) ;; definition for method 3 of type cylinder-flat -(defmethod inspect cylinder-flat ((this cylinder-flat)) +(defmethod inspect ((this cylinder-flat)) (format #t "[~8x] ~A~%" this 'cylinder-flat) (format #t "~Torigin: #~%" (-> this origin)) (format #t "~Taxis: #~%" (-> this axis)) @@ -687,15 +609,12 @@ ;; definition of type vertical-planes (deftype vertical-planes (structure) - ((data uint128 4 :offset-assert 0) + ((data uint128 4) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type vertical-planes -(defmethod inspect vertical-planes ((this vertical-planes)) +(defmethod inspect ((this vertical-planes)) (format #t "[~8x] ~A~%" this 'vertical-planes) (format #t "~Tdata[4] @ #x~X~%" (-> this data)) this @@ -703,16 +622,13 @@ ;; definition of type vertical-planes-array (deftype vertical-planes-array (basic) - ((length uint32 :offset-assert 4) - (data vertical-planes :inline :dynamic :offset-assert 16) + ((length uint32) + (data vertical-planes :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vertical-planes-array -(defmethod inspect vertical-planes-array ((this vertical-planes-array)) +(defmethod inspect ((this vertical-planes-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tdata[0] @ #x~X~%" (-> this data)) @@ -721,23 +637,20 @@ ;; definition of type qword (deftype qword (structure) - ((data uint32 4 :offset-assert 0) - (byte uint8 16 :offset 0) - (hword uint16 8 :offset 0) - (word uint32 4 :offset 0) - (dword uint64 2 :offset 0) - (quad uint128 :offset 0) - (vector vector :inline :offset 0) - (vector4w vector4w :inline :offset 0) + ((data uint32 4) + (byte uint8 16 :overlay-at (-> data 0)) + (hword uint16 8 :overlay-at (-> data 0)) + (word uint32 4 :overlay-at (-> data 0)) + (dword uint64 2 :overlay-at (-> data 0)) + (quad uint128 :overlay-at (-> data 0)) + (vector vector :inline :overlay-at (-> data 0)) + (vector4w vector4w :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type qword ;; INFO: Used lq/sq -(defmethod inspect qword ((this qword)) +(defmethod inspect ((this qword)) (format #t "[~8x] ~A~%" this 'qword) (format #t "~Tdata[4] @ #x~X~%" (-> this data)) (format #t "~Tbyte[16] @ #x~X~%" (-> this data)) @@ -752,18 +665,15 @@ ;; definition of type vector3s (deftype vector3s (structure) - ((data float 3 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) + ((data float 3) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) + (z float :overlay-at (-> data 2)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type vector3s -(defmethod inspect vector3s ((this vector3s)) +(defmethod inspect ((this vector3s)) (format #t "[~8x] ~A~%" this 'vector3s) (format #t "~Tdata[3] @ #x~X~%" (-> this data)) (format #t "~Tx: ~f~%" (-> this x)) diff --git a/test/decompiler/reference/jak1/engine/nav/navigate-h_REF.gc b/test/decompiler/reference/jak1/engine/nav/navigate-h_REF.gc index 8a64551e489..e4ffcebf1e9 100644 --- a/test/decompiler/reference/jak1/engine/nav/navigate-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/nav/navigate-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type nav-poly (deftype nav-poly (structure) - ((id uint8 :offset-assert 0) - (vertex uint8 3 :offset-assert 1) - (adj-poly uint8 3 :offset-assert 4) - (pat uint8 :offset-assert 7) + ((id uint8) + (vertex uint8 3) + (adj-poly uint8 3) + (pat uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type nav-poly -(defmethod inspect nav-poly ((this nav-poly)) +(defmethod inspect ((this nav-poly)) (format #t "[~8x] ~A~%" this 'nav-poly) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Tvertex[3] @ #x~X~%" (-> this vertex)) @@ -27,14 +24,11 @@ ;; definition of type nav-vertex (deftype nav-vertex (vector) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type nav-vertex ;; INFO: Used lq/sq -(defmethod inspect nav-vertex ((this nav-vertex)) +(defmethod inspect ((this nav-vertex)) (format #t "[~8x] ~A~%" this 'nav-vertex) (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) (format #t "~Tx: ~f~%" (-> this x)) @@ -47,15 +41,12 @@ ;; definition of type nav-sphere (deftype nav-sphere (structure) - ((trans sphere :inline :offset-assert 0) + ((trans sphere :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type nav-sphere -(defmethod inspect nav-sphere ((this nav-sphere)) +(defmethod inspect ((this nav-sphere)) (format #t "[~8x] ~A~%" this 'nav-sphere) (format #t "~Ttrans: #~%" (-> this trans)) this @@ -63,25 +54,22 @@ ;; definition of type nav-ray (deftype nav-ray (structure) - ((current-pos vector :inline :offset-assert 0) - (dir vector :inline :offset-assert 16) - (dest-pos vector :inline :offset-assert 32) - (current-poly nav-poly :offset-assert 48) - (next-poly nav-poly :offset-assert 52) - (len meters :offset-assert 56) - (last-edge int8 :offset-assert 60) - (terminated symbol :offset-assert 64) - (reached-dest symbol :offset-assert 68) - (hit-boundary symbol :offset-assert 72) - (hit-gap symbol :offset-assert 76) + ((current-pos vector :inline) + (dir vector :inline) + (dest-pos vector :inline) + (current-poly nav-poly) + (next-poly nav-poly) + (len meters) + (last-edge int8) + (terminated symbol) + (reached-dest symbol) + (hit-boundary symbol) + (hit-gap symbol) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type nav-ray -(defmethod inspect nav-ray ((this nav-ray)) +(defmethod inspect ((this nav-ray)) (format #t "[~8x] ~A~%" this 'nav-ray) (format #t "~Tcurrent-pos: #~%" (-> this current-pos)) (format #t "~Tdir: #~%" (-> this dir)) @@ -99,17 +87,14 @@ ;; definition of type nav-route-portal (deftype nav-route-portal (structure) - ((next-poly nav-poly :offset-assert 0) - (vertex nav-vertex 2 :offset-assert 4) - (edge-index int8 :offset-assert 12) + ((next-poly nav-poly) + (vertex nav-vertex 2) + (edge-index int8) ) - :method-count-assert 9 - :size-assert #xd - :flag-assert #x90000000d ) ;; definition for method 3 of type nav-route-portal -(defmethod inspect nav-route-portal ((this nav-route-portal)) +(defmethod inspect ((this nav-route-portal)) (format #t "[~8x] ~A~%" this 'nav-route-portal) (format #t "~Tnext-poly: #~%" (-> this next-poly)) (format #t "~Tvertex[2] @ #x~X~%" (-> this vertex)) @@ -119,26 +104,23 @@ ;; definition of type clip-travel-vector-to-mesh-return-info (deftype clip-travel-vector-to-mesh-return-info (structure) - ((found-boundary symbol :offset-assert 0) - (intersection vector :inline :offset-assert 16) - (boundary-normal vector :inline :offset-assert 32) - (prev-normal vector :inline :offset-assert 48) - (next-normal vector :inline :offset-assert 64) - (poly nav-poly :offset-assert 80) - (gap-poly nav-poly :offset-assert 84) - (edge int32 :offset-assert 88) - (vert-prev vector :inline :offset-assert 96) - (vert-0 vector :inline :offset-assert 112) - (vert-1 vector :inline :offset-assert 128) - (vert-next vector :inline :offset-assert 144) + ((found-boundary symbol) + (intersection vector :inline) + (boundary-normal vector :inline) + (prev-normal vector :inline) + (next-normal vector :inline) + (poly nav-poly) + (gap-poly nav-poly) + (edge int32) + (vert-prev vector :inline) + (vert-0 vector :inline) + (vert-1 vector :inline) + (vert-next vector :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type clip-travel-vector-to-mesh-return-info -(defmethod inspect clip-travel-vector-to-mesh-return-info ((this clip-travel-vector-to-mesh-return-info)) +(defmethod inspect ((this clip-travel-vector-to-mesh-return-info)) (format #t "[~8x] ~A~%" this 'clip-travel-vector-to-mesh-return-info) (format #t "~Tfound-boundary: ~A~%" (-> this found-boundary)) (format #t "~Tintersection: #~%" (-> this intersection)) @@ -157,32 +139,29 @@ ;; definition of type nav-node (deftype nav-node (structure) - ((center-x float :offset-assert 0) - (center-y float :offset-assert 4) - (center-z float :offset-assert 8) - (type uint16 :offset-assert 12) - (parent-offset uint16 :offset-assert 14) - (center vector :inline :offset 0) - (radius-x float :offset-assert 16) - (radius-y float :offset-assert 20) - (radius-z float :offset-assert 24) - (left-offset uint16 :offset-assert 28) - (right-offset uint16 :offset-assert 30) - (num-tris uint32 :offset 28) - (radius vector :inline :offset 16) - (scale-x float :offset-assert 32) - (first-tris uint8 4 :offset-assert 36) - (scale-z float :offset-assert 40) - (last-tris uint8 4 :offset-assert 44) - (scale vector :inline :offset 32) + ((center-x float) + (center-y float) + (center-z float) + (type uint16) + (parent-offset uint16) + (center vector :inline :overlay-at center-x) + (radius-x float) + (radius-y float) + (radius-z float) + (left-offset uint16) + (right-offset uint16) + (num-tris uint32 :overlay-at left-offset) + (radius vector :inline :overlay-at radius-x) + (scale-x float) + (first-tris uint8 4) + (scale-z float) + (last-tris uint8 4) + (scale vector :inline :overlay-at scale-x) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type nav-node -(defmethod inspect nav-node ((this nav-node)) +(defmethod inspect ((this nav-node)) (format #t "[~8x] ~A~%" this 'nav-node) (format #t "~Tcenter-x: ~f~%" (-> this center-x)) (format #t "~Tcenter-y: ~f~%" (-> this center-y)) @@ -207,22 +186,19 @@ ;; definition of type nav-lookup-elem (deftype nav-lookup-elem (structure) - ((vec vector :inline :offset-assert 0) - (y-thresh float :offset 12) - (time uint32 :offset-assert 16) - (node-offset uint32 :offset-assert 20) - (lookup-type uint8 :offset-assert 24) - (poly-ind uint8 :offset-assert 25) - (dummy0 uint16 :offset-assert 26) - (dummy uint32 :offset-assert 28) + ((vec vector :inline) + (y-thresh float :overlay-at (-> vec w)) + (time uint32) + (node-offset uint32) + (lookup-type uint8) + (poly-ind uint8) + (dummy0 uint16) + (dummy uint32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type nav-lookup-elem -(defmethod inspect nav-lookup-elem ((this nav-lookup-elem)) +(defmethod inspect ((this nav-lookup-elem)) (format #t "[~8x] ~A~%" this 'nav-lookup-elem) (format #t "~Tvec: #~%" (-> this vec)) (format #t "~Ty-thresh: ~f~%" (-> this vec w)) @@ -237,52 +213,49 @@ ;; definition of type nav-mesh (deftype nav-mesh (basic) - ((user-list engine :offset-assert 4) - (poly-lookup-history uint8 2 :offset-assert 8) - (debug-time uint8 :offset-assert 10) - (static-sphere-count uint8 :offset-assert 11) - (static-sphere (inline-array nav-sphere) :offset-assert 12) - (bounds sphere :inline :offset-assert 16) - (origin vector :inline :offset-assert 32) - (cache nav-lookup-elem 4 :inline :offset-assert 48) - (node-count int32 :offset-assert 176) - (nodes (inline-array nav-node) :offset-assert 180) - (vertex-count int32 :offset-assert 184) - (vertex (inline-array nav-vertex) :offset-assert 188) - (poly-count int32 :offset-assert 192) - (poly (inline-array nav-poly) :offset-assert 196) - (route (inline-array vector4ub) :offset-assert 200) + ((user-list engine) + (poly-lookup-history uint8 2) + (debug-time uint8) + (static-sphere-count uint8) + (static-sphere (inline-array nav-sphere)) + (bounds sphere :inline) + (origin vector :inline) + (cache nav-lookup-elem 4 :inline) + (node-count int32) + (nodes (inline-array nav-node)) + (vertex-count int32) + (vertex (inline-array nav-vertex)) + (poly-count int32) + (poly (inline-array nav-poly)) + (route (inline-array vector4ub)) ) - :method-count-assert 30 - :size-assert #xcc - :flag-assert #x1e000000cc (:methods - (tri-centroid-world (_type_ nav-poly vector) vector 9) - (tri-centroid-local (_type_ nav-poly vector) vector 10) - (get-adj-poly (_type_ nav-poly nav-poly symbol) nav-poly 11) - (setup-portal (_type_ nav-poly nav-poly nav-route-portal) object 12) - (initialize-mesh! (_type_) none 13) - (move-along-nav-ray! (_type_ nav-ray) none 14) - (try-move-along-ray (_type_ nav-poly vector vector float) meters 15) - (nav-mesh-method-16 (_type_ vector nav-poly vector symbol float clip-travel-vector-to-mesh-return-info) none 16) - (update-route-table (_type_) none 17) - (nav-mesh-method-18 (_type_ int vector int (pointer int8) int) none 18) - (compute-bounding-box (_type_ vector vector) none 19) - (debug-draw-poly (_type_ nav-poly rgba) none 20) - (point-in-poly? (_type_ nav-poly vector) symbol 21) - (find-opposite-vertices (_type_ nav-poly nav-poly) uint 22) - (nav-mesh-method-23 (_type_ nav-poly vector vector vector nav-route-portal) vector 23) - (closest-point-on-boundary (_type_ nav-poly vector vector) vector 24) - (project-point-into-tri-3d (_type_ nav-poly vector vector) none 25) - (project-point-into-tri-2d (_type_ nav-poly vector vector) vector 26) - (find-poly-fast (_type_ vector meters) nav-poly 27) - (find-poly (_type_ vector meters (pointer nav-control-flags)) nav-poly 28) - (is-in-mesh? (_type_ vector float meters) symbol 29) + (tri-centroid-world (_type_ nav-poly vector) vector) + (tri-centroid-local (_type_ nav-poly vector) vector) + (get-adj-poly (_type_ nav-poly nav-poly symbol) nav-poly) + (setup-portal (_type_ nav-poly nav-poly nav-route-portal) object) + (initialize-mesh! (_type_) none) + (move-along-nav-ray! (_type_ nav-ray) none) + (try-move-along-ray (_type_ nav-poly vector vector float) meters) + (nav-mesh-method-16 (_type_ vector nav-poly vector symbol float clip-travel-vector-to-mesh-return-info) none) + (update-route-table (_type_) none) + (nav-mesh-method-18 (_type_ int vector int (pointer int8) int) none) + (compute-bounding-box (_type_ vector vector) none) + (debug-draw-poly (_type_ nav-poly rgba) none) + (point-in-poly? (_type_ nav-poly vector) symbol) + (find-opposite-vertices (_type_ nav-poly nav-poly) uint) + (nav-mesh-method-23 (_type_ nav-poly vector vector vector nav-route-portal) vector) + (closest-point-on-boundary (_type_ nav-poly vector vector) vector) + (project-point-into-tri-3d (_type_ nav-poly vector vector) none) + (project-point-into-tri-2d (_type_ nav-poly vector vector) vector) + (find-poly-fast (_type_ vector meters) nav-poly) + (find-poly (_type_ vector meters (pointer nav-control-flags)) nav-poly) + (is-in-mesh? (_type_ vector float meters) symbol) ) ) ;; definition for method 3 of type nav-mesh -(defmethod inspect nav-mesh ((this nav-mesh)) +(defmethod inspect ((this nav-mesh)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tuser-list: ~A~%" (-> this user-list)) (format #t "~Tpoly-lookup-history[2] @ #x~X~%" (-> this poly-lookup-history)) @@ -304,17 +277,14 @@ ;; definition of type check-vector-collision-with-nav-spheres-info (deftype check-vector-collision-with-nav-spheres-info (structure) - ((u float :offset-assert 0) - (intersect vector :inline :offset-assert 16) - (normal vector :inline :offset-assert 32) + ((u float) + (intersect vector :inline) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type check-vector-collision-with-nav-spheres-info -(defmethod inspect check-vector-collision-with-nav-spheres-info ((this check-vector-collision-with-nav-spheres-info)) +(defmethod inspect ((this check-vector-collision-with-nav-spheres-info)) (format #t "[~8x] ~A~%" this 'check-vector-collision-with-nav-spheres-info) (format #t "~Tu: ~f~%" (-> this u)) (format #t "~Tintersect: #~%" (-> this intersect)) @@ -324,16 +294,13 @@ ;; definition of type nav-gap-info (deftype nav-gap-info (structure) - ((dest vector :inline :offset-assert 0) - (poly nav-poly :offset-assert 16) + ((dest vector :inline) + (poly nav-poly) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type nav-gap-info -(defmethod inspect nav-gap-info ((this nav-gap-info)) +(defmethod inspect ((this nav-gap-info)) (format #t "[~8x] ~A~%" this 'nav-gap-info) (format #t "~Tdest: #~%" (-> this dest)) (format #t "~Tpoly: #~%" (-> this poly)) @@ -342,70 +309,67 @@ ;; definition of type nav-control (deftype nav-control (basic) - ((flags nav-control-flags :offset-assert 4) - (process basic :offset-assert 8) - (shape collide-shape :offset-assert 12) - (mesh nav-mesh :offset-assert 16) - (gap-event basic :offset-assert 20) - (block-event basic :offset-assert 24) - (current-poly nav-poly :offset-assert 28) - (next-poly nav-poly :offset-assert 32) - (target-poly nav-poly :offset-assert 36) - (portal nav-route-portal 2 :offset-assert 40) - (nearest-y-threshold meters :offset-assert 48) - (event-temp vector :inline :offset-assert 64) - (old-travel vector :inline :offset-assert 80) - (blocked-travel vector :inline :offset-assert 96) - (prev-pos vector :inline :offset-assert 112) - (extra-nav-sphere vector :inline :offset-assert 128) - (travel vector :inline :offset-assert 144) - (target-pos vector :inline :offset-assert 160) - (destination-pos vector :inline :offset-assert 176) - (block-time time-frame :offset-assert 192) - (block-count float :offset-assert 200) - (user-poly nav-poly :offset-assert 204) - (nav-cull-radius float :offset-assert 208) - (num-spheres int16 :offset-assert 212) - (max-spheres int16 :offset-assert 214) - (sphere sphere :inline :dynamic :offset-assert 224) + ((flags nav-control-flags) + (process basic) + (shape collide-shape) + (mesh nav-mesh) + (gap-event basic) + (block-event basic) + (current-poly nav-poly) + (next-poly nav-poly) + (target-poly nav-poly) + (portal nav-route-portal 2) + (nearest-y-threshold meters) + (event-temp vector :inline) + (old-travel vector :inline) + (blocked-travel vector :inline) + (prev-pos vector :inline) + (extra-nav-sphere vector :inline) + (travel vector :inline) + (target-pos vector :inline) + (destination-pos vector :inline) + (block-time time-frame) + (block-count float) + (user-poly nav-poly) + (nav-cull-radius float) + (num-spheres int16) + (max-spheres int16) + (sphere sphere :inline :dynamic) ) - :method-count-assert 36 - :size-assert #xe0 - :flag-assert #x24000000e0 (:methods - (new (symbol type collide-shape int float) _type_ 0) - (debug-draw (_type_) none 9) - (point-in-bounds? (_type_ vector) symbol 10) - (nav-control-method-11 (_type_ vector) vector 11) - (nav-control-method-12 (_type_ nav-gap-info) symbol 12) - (nav-control-method-13 (_type_ vector vector) vector 13) - (set-current-poly! (_type_ nav-poly) none 14) - (set-target-pos! (_type_ vector) none 15) - (nav-control-method-16 (_type_ vector) nav-poly 16) - (project-onto-nav-mesh (_type_ vector vector) vector 17) - (find-poly (_type_ vector) nav-poly 18) - (nav-control-method-19 (_type_ vector collide-shape-moving vector float) none 19) - (project-point-into-tri-3d (_type_ nav-poly vector vector) vector 20) - (nav-control-method-21 (_type_ vector) nav-poly 21) - (nav-control-method-22 (_type_ vector float) symbol 22) - (nav-control-method-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23) - (nav-control-method-24 (_type_ float clip-travel-vector-to-mesh-return-info) none 24) - (is-in-mesh? (_type_ vector float) symbol 25) - (nav-control-method-26 (_type_) none 26) - (nav-control-method-27 (_type_) none 27) - (nav-control-method-28 (_type_ collide-kind) none 28) - (should-display? (_type_) symbol 29) - (nav-control-method-30 (_type_ vector vector vector) sphere 30) - (intersect-ray-line-segment? (_type_ vector vector vector vector) symbol 31) - (nav-control-method-32 (_type_ vector vector vector vector float) symbol 32) - (nav-control-method-33 (_type_ vector vector vector vector float) symbol 33) - (nav-control-method-34 () none 34) - (nav-control-method-35 (_type_ vector vector vector vector float) none 35) + (new (symbol type collide-shape int float) _type_) + (debug-draw (_type_) none) + (point-in-bounds? (_type_ vector) symbol) + (nav-control-method-11 (_type_ vector) vector) + (nav-control-method-12 (_type_ nav-gap-info) symbol) + (nav-control-method-13 (_type_ vector vector) vector) + (set-current-poly! (_type_ nav-poly) none) + (set-target-pos! (_type_ vector) none) + (nav-control-method-16 (_type_ vector) nav-poly) + (project-onto-nav-mesh (_type_ vector vector) vector) + (find-poly (_type_ vector) nav-poly) + (nav-control-method-19 (_type_ vector collide-shape-moving vector float) none) + (project-point-into-tri-3d (_type_ nav-poly vector vector) vector) + (nav-control-method-21 (_type_ vector) nav-poly) + (nav-control-method-22 (_type_ vector float) symbol) + (nav-control-method-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float) + (nav-control-method-24 (_type_ float clip-travel-vector-to-mesh-return-info) none) + (is-in-mesh? (_type_ vector float) symbol) + (nav-control-method-26 (_type_) none) + (nav-control-method-27 (_type_) none) + (nav-control-method-28 (_type_ collide-kind) none) + (should-display? (_type_) symbol) + (nav-control-method-30 (_type_ vector vector vector) sphere) + (intersect-ray-line-segment? (_type_ vector vector vector vector) symbol) + (nav-control-method-32 (_type_ vector vector vector vector float) symbol) + (nav-control-method-33 (_type_ vector vector vector vector float) symbol) + (nav-control-method-34 () none) + (nav-control-method-35 (_type_ vector vector vector vector float) none) ) ) ;; definition for method 3 of type nav-control -(defmethod inspect nav-control ((this nav-control)) +(defmethod inspect ((this nav-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tflags: #x~X~%" (-> this flags)) (format #t "~Tprocess: ~A~%" (-> this process)) @@ -517,12 +481,12 @@ ) ;; definition for method 29 of type nav-control -(defmethod should-display? nav-control ((this nav-control)) +(defmethod should-display? ((this nav-control)) (and *display-nav-marks* (logtest? (-> this flags) (nav-control-flags display-marks))) ) ;; definition for method 10 of type nav-control -(defmethod point-in-bounds? nav-control ((this nav-control) (arg0 vector)) +(defmethod point-in-bounds? ((this nav-control) (arg0 vector)) (let ((v1-1 (-> this mesh bounds))) (>= (-> v1-1 w) (vector-vector-distance arg0 v1-1)) ) @@ -531,7 +495,7 @@ ;; definition for method 15 of type nav-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch vector vs none. -(defmethod set-target-pos! nav-control ((this nav-control) (arg0 vector)) +(defmethod set-target-pos! ((this nav-control) (arg0 vector)) (set! (-> this target-pos quad) (-> arg0 quad)) (none) ) diff --git a/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc b/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc index 1c6f7158a1d..ca9356b4a7f 100644 --- a/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc +++ b/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc @@ -163,13 +163,13 @@ ) ;; definition for method 4 of type nav-control -(defmethod length nav-control ((this nav-control)) +(defmethod length ((this nav-control)) (-> this num-spheres) ) ;; definition for method 5 of type nav-control ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of nav-control ((this nav-control)) +(defmethod asize-of ((this nav-control)) (the-as int (+ (-> nav-control size) (* (-> this max-spheres) 16))) ) @@ -213,13 +213,13 @@ ) ;; definition for method 4 of type nav-mesh -(defmethod length nav-mesh ((this nav-mesh)) +(defmethod length ((this nav-mesh)) (-> this poly-count) ) ;; definition for method 20 of type nav-mesh ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw-poly nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) +(defmethod debug-draw-poly ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) (let ((s5-0 (-> this origin)) (s2-0 (-> this vertex)) (gp-0 (new 'stack-no-clear 'vector)) @@ -265,7 +265,7 @@ ;; definition for method 10 of type nav-mesh ;; INFO: Used lq/sq -(defmethod tri-centroid-local nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod tri-centroid-local ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (set! (-> arg1 quad) (-> this vertex (-> arg0 vertex 0) quad)) (vector+! arg1 arg1 (the-as vector (-> this vertex (-> arg0 vertex 1)))) (vector+! arg1 arg1 (the-as vector (-> this vertex (-> arg0 vertex 2)))) @@ -273,7 +273,7 @@ ) ;; definition for method 9 of type nav-mesh -(defmethod tri-centroid-world nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod tri-centroid-world ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (tri-centroid-local this arg0 arg1) (vector+! arg1 arg1 (-> this origin)) ) @@ -365,7 +365,7 @@ ) ;; definition for method 21 of type nav-mesh -(defmethod point-in-poly? nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod point-in-poly? ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (vu-point-triangle-intersection? arg1 (-> this vertex (-> arg0 vertex 0)) @@ -376,7 +376,7 @@ ;; definition for method 24 of type nav-mesh ;; INFO: Used lq/sq -(defmethod closest-point-on-boundary nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod closest-point-on-boundary ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (let ((s2-0 (-> this vertex)) (s1-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) @@ -400,7 +400,7 @@ ;; definition for method 26 of type nav-mesh ;; INFO: Used lq/sq -(defmethod project-point-into-tri-2d nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-tri-2d ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (if (point-in-poly? this arg0 arg2) (set! (-> arg1 quad) (-> arg2 quad)) (closest-point-on-boundary this arg0 arg1 arg2) @@ -544,7 +544,7 @@ ;; definition for method 27 of type nav-mesh ;; INFO: Used lq/sq -(defmethod find-poly-fast nav-mesh ((this nav-mesh) (arg0 vector) (arg1 meters)) +(defmethod find-poly-fast ((this nav-mesh) (arg0 vector) (arg1 meters)) (local-vars (a0-6 symbol) (a2-3 uint128) (a2-4 uint128)) -1 (let ((s2-0 -1) @@ -804,7 +804,7 @@ ;; definition for method 29 of type nav-mesh ;; ERROR: Failed load: (set! vf3 (l.vf a0-4)) at op 42 -(defmethod is-in-mesh? nav-mesh ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 meters)) +(defmethod is-in-mesh? ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 meters)) (local-vars (v1-10 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -886,7 +886,7 @@ ;; definition for method 14 of type nav-mesh ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod move-along-nav-ray! nav-mesh ((this nav-mesh) (arg0 nav-ray)) +(defmethod move-along-nav-ray! ((this nav-mesh) (arg0 nav-ray)) (local-vars (a2-7 int) (a3-3 int)) (let ((v1-0 -1) (f0-1 (- (-> arg0 dest-pos x) (-> arg0 current-pos x))) @@ -991,7 +991,7 @@ ) ;; definition for method 15 of type nav-mesh -(defmethod try-move-along-ray nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod try-move-along-ray ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (v1-2 symbol)) (let ((gp-0 (new 'stack-no-clear 'nav-ray))) (let ((s4-0 0)) @@ -1066,7 +1066,7 @@ ;; definition for method 18 of type nav-mesh ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-mesh-method-18 nav-mesh ((this nav-mesh) (arg0 int) (arg1 vector) (arg2 int) (arg3 (pointer int8)) (arg4 int)) +(defmethod nav-mesh-method-18 ((this nav-mesh) (arg0 int) (arg1 vector) (arg2 int) (arg3 (pointer int8)) (arg4 int)) (local-vars (sv-32 int) (sv-48 uint)) (set! (-> arg3 arg2) 1) (nav-mesh-update-route-table this arg0 arg2 (the-as uint 3)) @@ -1112,7 +1112,7 @@ ;; definition for method 17 of type nav-mesh ;; INFO: Return type mismatch int vs none. -(defmethod update-route-table nav-mesh ((this nav-mesh)) +(defmethod update-route-table ((this nav-mesh)) (when *nav-patch-route-table* (stopwatch-init *nav-timer*) (stopwatch-begin *nav-timer*) @@ -1249,7 +1249,7 @@ ;; definition for method 28 of type nav-mesh ;; INFO: Used lq/sq -(defmethod find-poly nav-mesh ((this nav-mesh) (arg0 vector) (arg1 meters) (arg2 (pointer nav-control-flags))) +(defmethod find-poly ((this nav-mesh) (arg0 vector) (arg1 meters) (arg2 (pointer nav-control-flags))) (local-vars (s3-1 nav-poly)) (let ((v1-1 (find-poly-fast this arg0 arg1))) (when v1-1 @@ -1292,7 +1292,7 @@ ) ;; definition for method 12 of type nav-mesh -(defmethod setup-portal nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) +(defmethod setup-portal ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) (local-vars (t0-6 int) (t1-1 int)) (set! (-> arg2 next-poly) #f) (cond @@ -1333,7 +1333,7 @@ ) ;; definition for method 11 of type nav-mesh -(defmethod get-adj-poly nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 symbol)) +(defmethod get-adj-poly ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 symbol)) (local-vars (v1-12 uint) (t0-6 int) (t1-1 int)) (cond ((and arg0 arg1) @@ -1377,7 +1377,7 @@ ;; definition for method 19 of type nav-mesh ;; INFO: Return type mismatch int vs none. -(defmethod compute-bounding-box nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector)) +(defmethod compute-bounding-box ((this nav-mesh) (arg0 vector) (arg1 vector)) (let ((f0-0 10000000000000000000000000000000000000.0) (f1-0 -10000000000000000000000000000000000000.0) ) @@ -1407,7 +1407,7 @@ ;; definition for method 13 of type nav-mesh ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod initialize-mesh! nav-mesh ((this nav-mesh)) +(defmethod initialize-mesh! ((this nav-mesh)) (local-vars (sv-32 vector) (sv-48 int)) (with-pp (set! sv-32 (new 'stack-no-clear 'vector)) @@ -1481,7 +1481,7 @@ ) ;; definition for method 22 of type nav-mesh -(defmethod find-opposite-vertices nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) +(defmethod find-opposite-vertices ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) (when (!= arg0 arg1) (dotimes (v1-1 3) (dotimes (a0-1 3) @@ -1564,7 +1564,7 @@ ;; definition for method 23 of type nav-mesh ;; INFO: Used lq/sq -(defmethod nav-mesh-method-23 nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 nav-route-portal)) +(defmethod nav-mesh-method-23 ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 nav-route-portal)) (local-vars (v1-32 int) (a0-14 int) (a0-17 int) (a1-10 int) (sv-16 nav-vertex)) (let ((s1-0 (-> this vertex)) (s0-0 -1) @@ -1638,7 +1638,7 @@ ;; definition for method 25 of type nav-mesh ;; INFO: Used lq/sq -(defmethod project-point-into-tri-3d nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-tri-3d ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'matrix)) ) @@ -1656,7 +1656,7 @@ ;; definition for method 17 of type nav-control ;; INFO: Used lq/sq -(defmethod project-onto-nav-mesh nav-control ((this nav-control) (arg0 vector) (arg1 vector)) +(defmethod project-onto-nav-mesh ((this nav-control) (arg0 vector) (arg1 vector)) (local-vars (sv-32 int)) (let ((s5-0 (-> this mesh)) (s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 (-> this mesh origin))) @@ -1678,7 +1678,7 @@ ) ;; definition for method 18 of type nav-control -(defmethod find-poly nav-control ((this nav-control) (arg0 vector)) +(defmethod find-poly ((this nav-control) (arg0 vector)) (find-poly (-> this mesh) (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) @@ -1688,7 +1688,7 @@ ) ;; definition for method 20 of type nav-control -(defmethod project-point-into-tri-3d nav-control ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-tri-3d ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (project-point-into-tri-3d (-> this mesh) arg0 @@ -1700,7 +1700,7 @@ ) ;; definition for method 25 of type nav-control -(defmethod is-in-mesh? nav-control ((this nav-control) (arg0 vector) (arg1 float)) +(defmethod is-in-mesh? ((this nav-control) (arg0 vector) (arg1 float)) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin))) (a1-1 (-> this mesh)) ) @@ -1711,7 +1711,7 @@ ;; definition for method 9 of type nav-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw nav-control ((this nav-control)) +(defmethod debug-draw ((this nav-control)) (local-vars (sv-192 vector) (sv-208 uint) @@ -1955,7 +1955,7 @@ ;; definition for method 8 of type nav-mesh ;; INFO: Return type mismatch int vs nav-mesh. -(defmethod mem-usage nav-mesh ((this nav-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this nav-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) @@ -1989,7 +1989,7 @@ ;; definition for method 14 of type nav-control ;; INFO: Return type mismatch int vs none. -(defmethod set-current-poly! nav-control ((this nav-control) (arg0 nav-poly)) +(defmethod set-current-poly! ((this nav-control) (arg0 nav-poly)) (set! (-> this current-poly) arg0) (logior! (-> this flags) (nav-control-flags navcf9)) 0 @@ -1997,7 +1997,7 @@ ) ;; definition for method 30 of type nav-control -(defmethod nav-control-method-30 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod nav-control-method-30 ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (the-as sphere #f))) (let ((f30-0 -0.000001)) (countdown (s1-0 (-> this num-spheres)) @@ -2017,7 +2017,7 @@ ) ;; definition for method 31 of type nav-control -(defmethod intersect-ray-line-segment? nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod intersect-ray-line-segment? ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (ray-line-segment-intersection? arg0 arg1 arg2 arg3) ) @@ -2091,7 +2091,7 @@ ;; definition for method 28 of type nav-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-control-method-28 nav-control ((this nav-control) (arg0 collide-kind)) +(defmethod nav-control-method-28 ((this nav-control) (arg0 collide-kind)) (local-vars (sv-32 nav-control) (sv-48 sphere) @@ -2241,7 +2241,7 @@ ;; definition for method 35 of type nav-control ;; INFO: Return type mismatch symbol vs none. -(defmethod nav-control-method-35 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-control-method-35 ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg1 (-> this mesh origin)) (nav-control-method-32 this arg0 v1-0 arg2 arg3 arg4) @@ -2251,16 +2251,13 @@ ;; definition of type cfs-travel-vec (deftype cfs-travel-vec (structure) - ((dir vector :inline :offset-assert 0) - (delta-angle float :offset-assert 16) + ((dir vector :inline) + (delta-angle float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type cfs-travel-vec -(defmethod inspect cfs-travel-vec ((this cfs-travel-vec)) +(defmethod inspect ((this cfs-travel-vec)) (format #t "[~8x] ~A~%" this 'cfs-travel-vec) (format #t "~Tdir: #~%" (-> this dir)) (format #t "~Tdelta-angle: ~f~%" (-> this delta-angle)) @@ -2269,27 +2266,24 @@ ;; definition of type cfs-work (deftype cfs-work (structure) - ((desired-travel-dist float :offset-assert 0) - (desired-angle float :offset-assert 4) - (max-dist float :offset-assert 8) - (old-angle float :offset-assert 12) - (modified int32 :offset-assert 16) - (blocked-mask uint64 :offset-assert 24) - (travel vector :inline :offset-assert 32) - (current vector :inline :offset-assert 48) - (new-travel cfs-travel-vec 2 :inline :offset-assert 64) - (temp-travel cfs-travel-vec 2 :inline :offset-assert 128) - (prev-dir vector :inline :offset-assert 192) - (attempt-dir vector :inline :offset-assert 208) - (tangent vector 2 :inline :offset-assert 224) + ((desired-travel-dist float) + (desired-angle float) + (max-dist float) + (old-angle float) + (modified int32) + (blocked-mask uint64) + (travel vector :inline) + (current vector :inline) + (new-travel cfs-travel-vec 2 :inline) + (temp-travel cfs-travel-vec 2 :inline) + (prev-dir vector :inline) + (attempt-dir vector :inline) + (tangent vector 2 :inline) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; definition for method 3 of type cfs-work -(defmethod inspect cfs-work ((this cfs-work)) +(defmethod inspect ((this cfs-work)) (format #t "[~8x] ~A~%" this 'cfs-work) (format #t "~Tdesired-travel-dist: ~f~%" (-> this desired-travel-dist)) (format #t "~Tdesired-angle: ~f~%" (-> this desired-angle)) @@ -2309,33 +2303,30 @@ ;; definition of type nav-control-cfs-work (deftype nav-control-cfs-work (structure) - ((in-dir vector :inline :offset-assert 0) - (right-dir vector :inline :offset-assert 16) - (best-dir vector 2 :inline :offset-assert 32) - (temp-dir vector 2 :inline :offset-assert 64) - (away-dir vector :inline :offset-assert 96) - (best-dir-angle degrees 2 :offset-assert 112) - (ignore-mask uint64 :offset-assert 120) - (initial-ignore-mask uint64 :offset-assert 128) - (i-sphere int32 :offset-assert 136) - (i-first-sphere int32 :offset-assert 140) - (i-inside-sphere int32 :offset-assert 144) - (inside-sphere-dist float :offset-assert 148) - (sign float :offset-assert 152) - (travel-len float :offset-assert 156) - (dist2 float :offset-assert 160) - (inside-dist float :offset-assert 164) - (rand-angle float :offset-assert 168) - (dir-update basic :offset-assert 172) - (debug-offset vector :inline :offset-assert 176) + ((in-dir vector :inline) + (right-dir vector :inline) + (best-dir vector 2 :inline) + (temp-dir vector 2 :inline) + (away-dir vector :inline) + (best-dir-angle degrees 2) + (ignore-mask uint64) + (initial-ignore-mask uint64) + (i-sphere int32) + (i-first-sphere int32) + (i-inside-sphere int32) + (inside-sphere-dist float) + (sign float) + (travel-len float) + (dist2 float) + (inside-dist float) + (rand-angle float) + (dir-update basic) + (debug-offset vector :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) ;; definition for method 3 of type nav-control-cfs-work -(defmethod inspect nav-control-cfs-work ((this nav-control-cfs-work)) +(defmethod inspect ((this nav-control-cfs-work)) (format #t "[~8x] ~A~%" this 'nav-control-cfs-work) (format #t "~Tin-dir: #~%" (-> this in-dir)) (format #t "~Tright-dir: #~%" (-> this right-dir)) @@ -2441,7 +2432,7 @@ ;; definition for method 32 of type nav-control ;; INFO: Used lq/sq -(defmethod nav-control-method-32 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-control-method-32 ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) (local-vars (v0-3 symbol) (v1-38 int) (a0-29 int) (a3-7 int) (sv-208 sphere)) (let ((gp-0 (new 'stack-no-clear 'nav-control-cfs-work))) (set! (-> gp-0 in-dir quad) (-> arg2 quad)) @@ -2601,7 +2592,7 @@ ) ;; definition for method 23 of type nav-control -(defmethod nav-control-method-23 nav-control ((this nav-control) (arg0 vector) (arg1 check-vector-collision-with-nav-spheres-info)) +(defmethod nav-control-method-23 ((this nav-control) (arg0 vector) (arg1 check-vector-collision-with-nav-spheres-info)) (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this shape trans) (-> this mesh origin))) (f30-0 -1.0) ) @@ -2644,7 +2635,7 @@ ;; definition for method 33 of type nav-control ;; INFO: Used lq/sq -(defmethod nav-control-method-33 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-control-method-33 ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) (let ((f30-0 (vector-xz-length (-> this travel)))) (when (nav-control-method-32 this arg0 arg1 arg2 arg3 f30-0) (set! (-> this blocked-travel quad) (-> this travel quad)) @@ -2684,7 +2675,7 @@ ;; definition for method 19 of type nav-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch vector vs none. -(defmethod nav-control-method-19 nav-control ((this nav-control) (arg0 vector) (arg1 collide-shape-moving) (arg2 vector) (arg3 float)) +(defmethod nav-control-method-19 ((this nav-control) (arg0 vector) (arg1 collide-shape-moving) (arg2 vector) (arg3 float)) (local-vars (sv-48 float)) (let ((f30-0 (* arg3 (seconds-per-frame))) (s0-0 arg1) @@ -2723,7 +2714,7 @@ ) ;; definition for method 16 of type nav-control -(defmethod nav-control-method-16 nav-control ((this nav-control) (arg0 vector)) +(defmethod nav-control-method-16 ((this nav-control) (arg0 vector)) (find-poly-fast (-> this mesh) (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) @@ -2732,7 +2723,7 @@ ) ;; definition for method 21 of type nav-control -(defmethod nav-control-method-21 nav-control ((this nav-control) (arg0 vector)) +(defmethod nav-control-method-21 ((this nav-control) (arg0 vector)) (find-poly-fast (-> this mesh) (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) @@ -2742,7 +2733,7 @@ ;; definition for method 22 of type nav-control ;; INFO: Return type mismatch structure vs symbol. -(defmethod nav-control-method-22 nav-control ((this nav-control) (arg0 vector) (arg1 float)) +(defmethod nav-control-method-22 ((this nav-control) (arg0 vector) (arg1 float)) (the-as symbol (and (find-poly-fast (-> this mesh) (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) @@ -2766,7 +2757,7 @@ ;; definition for method 26 of type nav-control ;; INFO: Return type mismatch int vs none. -(defmethod nav-control-method-26 nav-control ((this nav-control)) +(defmethod nav-control-method-26 ((this nav-control)) 0 (none) ) @@ -2774,7 +2765,7 @@ ;; definition for method 27 of type nav-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-control-method-27 nav-control ((this nav-control)) +(defmethod nav-control-method-27 ((this nav-control)) (local-vars (v1-7 symbol)) (cond ((-> this current-poly) @@ -2823,14 +2814,14 @@ ;; definition for method 16 of type nav-mesh ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-mesh-method-16 nav-mesh ((this nav-mesh) - (arg0 vector) - (arg1 nav-poly) - (arg2 vector) - (arg3 symbol) - (arg4 float) - (arg5 clip-travel-vector-to-mesh-return-info) - ) +(defmethod nav-mesh-method-16 ((this nav-mesh) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 symbol) + (arg4 float) + (arg5 clip-travel-vector-to-mesh-return-info) + ) (local-vars (v1-10 symbol) (sv-96 symbol) (sv-112 int) (sv-128 int)) (when arg5 (set! (-> arg5 found-boundary) #f) @@ -2918,7 +2909,7 @@ ;; definition for method 24 of type nav-control ;; INFO: Return type mismatch int vs none. -(defmethod nav-control-method-24 nav-control ((this nav-control) (arg0 float) (arg1 clip-travel-vector-to-mesh-return-info)) +(defmethod nav-control-method-24 ((this nav-control) (arg0 float) (arg1 clip-travel-vector-to-mesh-return-info)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 (-> this shape trans) (-> this mesh origin)) (nav-mesh-method-16 @@ -3043,7 +3034,7 @@ ;; definition for method 13 of type nav-control ;; INFO: Used lq/sq -(defmethod nav-control-method-13 nav-control ((this nav-control) (arg0 vector) (arg1 vector)) +(defmethod nav-control-method-13 ((this nav-control) (arg0 vector) (arg1 vector)) (local-vars (sv-80 vector) (sv-84 vector) @@ -3155,7 +3146,7 @@ ;; definition for method 12 of type nav-control ;; INFO: Used lq/sq -(defmethod nav-control-method-12 nav-control ((this nav-control) (arg0 nav-gap-info)) +(defmethod nav-control-method-12 ((this nav-control) (arg0 nav-gap-info)) (when (and (-> this next-poly) (logtest? (-> this next-poly pat) 1)) (let ((s4-0 (-> this next-poly)) (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this shape trans) (-> this mesh origin))) @@ -3223,7 +3214,7 @@ ;; definition for method 11 of type nav-control ;; INFO: Used lq/sq -(defmethod nav-control-method-11 nav-control ((this nav-control) (arg0 vector)) +(defmethod nav-control-method-11 ((this nav-control) (arg0 vector)) (set! (-> this old-travel quad) (-> this travel quad)) (-> this block-count) (seek! (-> this block-count) 0.0 0.016666668) diff --git a/test/decompiler/reference/jak1/engine/physics/dynamics-h_REF.gc b/test/decompiler/reference/jak1/engine/physics/dynamics-h_REF.gc index 84124d65203..c35d1d1faac 100644 --- a/test/decompiler/reference/jak1/engine/physics/dynamics-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/physics/dynamics-h_REF.gc @@ -3,21 +3,18 @@ ;; definition of type dynamics (deftype dynamics (basic) - ((name basic :offset-assert 4) - (gravity-max meters :offset-assert 8) - (gravity-length meters :offset-assert 12) - (gravity vector :inline :offset-assert 16) - (gravity-normal vector :inline :offset-assert 32) - (walk-distance meters :offset-assert 48) - (run-distance meters :offset-assert 52) + ((name basic) + (gravity-max meters) + (gravity-length meters) + (gravity vector :inline) + (gravity-normal vector :inline) + (walk-distance meters) + (run-distance meters) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) ;; definition for method 3 of type dynamics -(defmethod inspect dynamics ((this dynamics)) +(defmethod inspect ((this dynamics)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tgravity-max: (meters ~m)~%" (-> this gravity-max)) diff --git a/test/decompiler/reference/jak1/engine/physics/trajectory-h_REF.gc b/test/decompiler/reference/jak1/engine/physics/trajectory-h_REF.gc index fa38d0f80c5..0326fb1162c 100644 --- a/test/decompiler/reference/jak1/engine/physics/trajectory-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/physics/trajectory-h_REF.gc @@ -3,27 +3,24 @@ ;; definition of type trajectory (deftype trajectory (structure) - ((initial-position vector :inline :offset-assert 0) - (initial-velocity vector :inline :offset-assert 16) - (time float :offset-assert 32) - (gravity meters :offset-assert 36) + ((initial-position vector :inline) + (initial-velocity vector :inline) + (time float) + (gravity meters) ) - :method-count-assert 16 - :size-assert #x28 - :flag-assert #x1000000028 (:methods - (eval-position! (_type_ float vector) vector 9) - (eval-velocity! (_type_ float vector) vector 10) - (setup-from-to-duration! (_type_ vector vector float float) none 11) - (setup-from-to-xz-vel! (_type_ vector vector float float) none 12) - (setup-from-to-y-vel! (_type_ vector vector float float) none 13) - (setup-from-to-height! (_type_ vector vector float float) none 14) - (debug-draw! (_type_) none 15) + (eval-position! (_type_ float vector) vector) + (eval-velocity! (_type_ float vector) vector) + (setup-from-to-duration! (_type_ vector vector float float) none) + (setup-from-to-xz-vel! (_type_ vector vector float float) none) + (setup-from-to-y-vel! (_type_ vector vector float float) none) + (setup-from-to-height! (_type_ vector vector float float) none) + (debug-draw! (_type_) none) ) ) ;; definition for method 3 of type trajectory -(defmethod inspect trajectory ((this trajectory)) +(defmethod inspect ((this trajectory)) (format #t "[~8x] ~A~%" this 'trajectory) (format #t "~Tinitial-position: ~`vector`P~%" (-> this initial-position)) (format #t "~Tinitial-velocity: ~`vector`P~%" (-> this initial-velocity)) diff --git a/test/decompiler/reference/jak1/engine/physics/trajectory_REF.gc b/test/decompiler/reference/jak1/engine/physics/trajectory_REF.gc index f65670026db..701956321df 100644 --- a/test/decompiler/reference/jak1/engine/physics/trajectory_REF.gc +++ b/test/decompiler/reference/jak1/engine/physics/trajectory_REF.gc @@ -2,8 +2,9 @@ (in-package goal) ;; definition for method 9 of type trajectory +;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -(defmethod eval-position! trajectory ((this trajectory) (time float) (result vector)) +(defmethod eval-position! ((this trajectory) (time float) (result vector)) (set! (-> result quad) (-> this initial-position quad)) (+! (-> result x) (* time (-> this initial-velocity x))) (+! (-> result y) (* time (-> this initial-velocity y))) @@ -14,7 +15,7 @@ ;; definition for method 10 of type trajectory ;; INFO: Used lq/sq -(defmethod eval-velocity! trajectory ((this trajectory) (time float) (result vector)) +(defmethod eval-velocity! ((this trajectory) (time float) (result vector)) (set! (-> result quad) (-> this initial-velocity quad)) (+! (-> result y) (* time (-> this gravity))) result @@ -23,7 +24,7 @@ ;; definition for method 11 of type trajectory ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod setup-from-to-duration! trajectory ((this trajectory) (from vector) (to vector) (duration float) (grav float)) +(defmethod setup-from-to-duration! ((this trajectory) (from vector) (to vector) (duration float) (grav float)) (set! (-> this initial-position quad) (-> from quad)) (set! (-> this gravity) grav) (set! (-> this time) duration) @@ -40,7 +41,7 @@ ;; definition for method 12 of type trajectory ;; INFO: Return type mismatch int vs none. -(defmethod setup-from-to-xz-vel! trajectory ((this trajectory) (from vector) (to vector) (xz-vel float) (grav float)) +(defmethod setup-from-to-xz-vel! ((this trajectory) (from vector) (to vector) (xz-vel float) (grav float)) (let ((duration (/ (vector-vector-xz-distance to from) xz-vel))) (setup-from-to-duration! this from to duration grav) ) @@ -50,7 +51,7 @@ ;; definition for method 13 of type trajectory ;; INFO: Return type mismatch int vs none. -(defmethod setup-from-to-y-vel! trajectory ((this trajectory) (from vector) (to vector) (y-vel float) (grav float)) +(defmethod setup-from-to-y-vel! ((this trajectory) (from vector) (to vector) (y-vel float) (grav float)) (let* ((f0-0 y-vel) (f1-3 (- (* f0-0 f0-0) (* 2.0 (- (-> from y) (-> to y)) grav))) (f0-3 900.0) @@ -68,7 +69,7 @@ ;; definition for method 14 of type trajectory ;; INFO: Return type mismatch int vs none. -(defmethod setup-from-to-height! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-height! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let* ((f1-2 (+ arg2 (fmax (-> arg0 y) (-> arg1 y)))) (f1-5 (* 2.0 (- (-> arg0 y) f1-2) arg3)) (f0-3 4096.0) @@ -85,7 +86,7 @@ ;; definition for method 15 of type trajectory ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw! trajectory ((this trajectory)) +(defmethod debug-draw! ((this trajectory)) (let ((prev-pos (new 'stack-no-clear 'vector)) (pos (new 'stack-no-clear 'vector)) (num-segments 10) diff --git a/test/decompiler/reference/jak1/engine/ps2/memcard-h_REF.gc b/test/decompiler/reference/jak1/engine/ps2/memcard-h_REF.gc index a6f6f5855a6..04aba628501 100644 --- a/test/decompiler/reference/jak1/engine/ps2/memcard-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ps2/memcard-h_REF.gc @@ -4,36 +4,30 @@ ;; definition of type mc-handle (deftype mc-handle (int32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type mc-file-info (deftype mc-file-info (structure) - ((present int32 :offset-assert 0) - (blind-data float 16 :offset-assert 4) - (blind-data-int8 int8 64 :offset 4) - (level-index int32 :offset 4) - (fuel-cell-count float :offset 8) - (money-count float :offset 12) - (buzzer-count float :offset 16) - (completion-percentage float :offset 20) - (minute uint8 :offset 24) - (hour uint8 :offset 25) - (week uint8 :offset 26) - (day uint8 :offset 27) - (month uint8 :offset 28) - (year uint8 :offset 29) + ((present int32) + (blind-data float 16) + (blind-data-int8 int8 64 :overlay-at (-> blind-data 0)) + (level-index int32 :overlay-at (-> blind-data 0)) + (fuel-cell-count float :overlay-at (-> blind-data 1)) + (money-count float :overlay-at (-> blind-data 2)) + (buzzer-count float :overlay-at (-> blind-data 3)) + (completion-percentage float :overlay-at (-> blind-data 4)) + (minute uint8 :overlay-at (-> blind-data 5)) + (hour uint8 :overlay-at (-> blind-data-int8 21)) + (week uint8 :overlay-at (-> blind-data-int8 22)) + (day uint8 :overlay-at (-> blind-data-int8 23)) + (month uint8 :overlay-at (-> blind-data 6)) + (year uint8 :overlay-at (-> blind-data-int8 25)) ) :pack-me - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) ;; definition for method 3 of type mc-file-info -(defmethod inspect mc-file-info ((this mc-file-info)) +(defmethod inspect ((this mc-file-info)) (format #t "[~8x] ~A~%" this 'mc-file-info) (format #t "~Tpresent: ~D~%" (-> this present)) (format #t "~Tblind-data[16] @ #x~X~%" (-> this blind-data)) @@ -54,23 +48,20 @@ ;; definition of type mc-slot-info (deftype mc-slot-info (structure) - ((handle int32 :offset-assert 0) - (known int32 :offset-assert 4) - (formatted int32 :offset-assert 8) - (inited int32 :offset-assert 12) - (last-file int32 :offset-assert 16) - (mem-required int32 :offset-assert 20) - (mem-actual int32 :offset-assert 24) - (file mc-file-info 4 :inline :offset-assert 28) + ((handle int32) + (known int32) + (formatted int32) + (inited int32) + (last-file int32) + (mem-required int32) + (mem-actual int32) + (file mc-file-info 4 :inline) ) :pack-me - :method-count-assert 9 - :size-assert #x12c - :flag-assert #x90000012c ) ;; definition for method 3 of type mc-slot-info -(defmethod inspect mc-slot-info ((this mc-slot-info)) +(defmethod inspect ((this mc-slot-info)) (format #t "[~8x] ~A~%" this 'mc-slot-info) (format #t "~Thandle: ~D~%" (-> this handle)) (format #t "~Tknown: ~D~%" (-> this known)) diff --git a/test/decompiler/reference/jak1/engine/ps2/pad_REF.gc b/test/decompiler/reference/jak1/engine/ps2/pad_REF.gc index 201b70ef43b..e005fb1f2de 100644 --- a/test/decompiler/reference/jak1/engine/ps2/pad_REF.gc +++ b/test/decompiler/reference/jak1/engine/ps2/pad_REF.gc @@ -6,23 +6,20 @@ ;; definition of type hw-cpad (deftype hw-cpad (basic) - ((valid uint8 :offset-assert 4) - (status uint8 :offset-assert 5) - (button0 uint16 :offset-assert 6) - (rightx uint8 :offset-assert 8) - (righty uint8 :offset-assert 9) - (leftx uint8 :offset-assert 10) - (lefty uint8 :offset-assert 11) - (abutton uint8 12 :offset-assert 12) - (dummy uint8 12 :offset-assert 24) + ((valid uint8) + (status uint8) + (button0 uint16) + (rightx uint8) + (righty uint8) + (leftx uint8) + (lefty uint8) + (abutton uint8 12) + (dummy uint8 12) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type hw-cpad -(defmethod inspect hw-cpad ((this hw-cpad)) +(defmethod inspect ((this hw-cpad)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tvalid: #x~X~%" (-> this valid)) (format #t "~Tstatus: #x~X~%" (-> this status)) @@ -38,33 +35,30 @@ ;; definition of type cpad-info (deftype cpad-info (hw-cpad) - ((number int32 :offset-assert 36) - (cpad-file int32 :offset-assert 40) - (button0-abs pad-buttons 3 :offset-assert 44) - (button0-shadow-abs pad-buttons 1 :offset-assert 56) - (button0-rel pad-buttons 3 :offset-assert 60) - (stick0-dir float :offset-assert 72) - (stick0-speed float :offset-assert 76) - (new-pad int32 :offset-assert 80) - (state int32 :offset-assert 84) - (align uint8 6 :offset-assert 88) - (direct uint8 6 :offset-assert 94) - (buzz-val uint8 2 :offset-assert 100) - (buzz-time time-frame 2 :offset-assert 104) - (buzz basic :offset-assert 120) - (buzz-act int32 :offset-assert 124) - (change-time time-frame :offset-assert 128) + ((number int32) + (cpad-file int32) + (button0-abs pad-buttons 3) + (button0-shadow-abs pad-buttons 1) + (button0-rel pad-buttons 3) + (stick0-dir float) + (stick0-speed float) + (new-pad int32) + (state int32) + (align uint8 6) + (direct uint8 6) + (buzz-val uint8 2) + (buzz-time time-frame 2) + (buzz basic) + (buzz-act int32) + (change-time time-frame) ) - :method-count-assert 9 - :size-assert #x88 - :flag-assert #x900000088 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) ;; definition for method 3 of type cpad-info -(defmethod inspect cpad-info ((this cpad-info)) +(defmethod inspect ((this cpad-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tvalid: #x~X~%" (-> this valid)) (format #t "~Tstatus: #x~X~%" (-> this status)) @@ -139,19 +133,16 @@ ;; definition of type cpad-list (deftype cpad-list (basic) - ((num-cpads int32 :offset-assert 4) - (cpads cpad-info 4 :offset-assert 8) + ((num-cpads int32) + (cpads cpad-info 4) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type cpad-list -(defmethod inspect cpad-list ((this cpad-list)) +(defmethod inspect ((this cpad-list)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tnum-cpads: ~D~%" (-> this num-cpads)) (format #t "~Tcpads[2] @ #x~X~%" (-> this cpads)) diff --git a/test/decompiler/reference/jak1/engine/ps2/rpc-h_REF.gc b/test/decompiler/reference/jak1/engine/ps2/rpc-h_REF.gc index dd0eed447f0..9e0a8300a82 100644 --- a/test/decompiler/reference/jak1/engine/ps2/rpc-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ps2/rpc-h_REF.gc @@ -3,23 +3,20 @@ ;; definition of type rpc-buffer (deftype rpc-buffer (basic) - ((elt-size uint32 :offset-assert 4) - (elt-count uint32 :offset-assert 8) - (elt-used uint32 :offset-assert 12) - (busy basic :offset-assert 16) - (base pointer :offset-assert 20) - (data uint8 :dynamic :offset 32) + ((elt-size uint32) + (elt-count uint32) + (elt-used uint32) + (busy basic) + (base pointer) + (data uint8 :dynamic :offset 32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 (:methods - (new (symbol type uint uint) rpc-buffer 0) + (new (symbol type uint uint) rpc-buffer) ) ) ;; definition for method 3 of type rpc-buffer -(defmethod inspect rpc-buffer ((this rpc-buffer)) +(defmethod inspect ((this rpc-buffer)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Telt-size: ~D~%" (-> this elt-size)) (format #t "~Telt-count: ~D~%" (-> this elt-count)) @@ -46,27 +43,24 @@ ;; definition of type rpc-buffer-pair (deftype rpc-buffer-pair (basic) - ((buffer rpc-buffer 2 :offset-assert 4) - (current rpc-buffer :offset-assert 12) - (last-recv-buffer pointer :offset-assert 16) - (rpc-port int32 :offset-assert 20) + ((buffer rpc-buffer 2) + (current rpc-buffer) + (last-recv-buffer pointer) + (rpc-port int32) ) - :method-count-assert 15 - :size-assert #x18 - :flag-assert #xf00000018 (:methods - (new (symbol type uint uint int) rpc-buffer-pair 0) - (call (rpc-buffer-pair uint pointer uint) int 9) - (add-element (rpc-buffer-pair) pointer 10) - (decrement-elt-used (rpc-buffer-pair) int 11) - (sync (rpc-buffer-pair symbol) int 12) - (check-busy (rpc-buffer-pair) symbol 13) - (pop-last-received (rpc-buffer-pair) pointer 14) + (new (symbol type uint uint int) rpc-buffer-pair) + (call (rpc-buffer-pair uint pointer uint) int) + (add-element (rpc-buffer-pair) pointer) + (decrement-elt-used (rpc-buffer-pair) int) + (sync (rpc-buffer-pair symbol) int) + (check-busy (rpc-buffer-pair) symbol) + (pop-last-received (rpc-buffer-pair) pointer) ) ) ;; definition for method 3 of type rpc-buffer-pair -(defmethod inspect rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod inspect ((this rpc-buffer-pair)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tbuffer[2] @ #x~X~%" (-> this buffer)) (format #t "~Tcurrent: ~A~%" (-> this current)) @@ -88,19 +82,19 @@ ) ;; definition for method 12 of type rpc-buffer-pair -(defmethod sync rpc-buffer-pair ((this rpc-buffer-pair) (arg0 symbol)) - (let ((s5-0 (if (= (-> this current) (-> this buffer 0)) - (-> this buffer 1) - (-> this buffer 0) - ) - ) +(defmethod sync ((obj rpc-buffer-pair) (print-stall-warning symbol)) + (let ((active-buffer (if (= (-> obj current) (-> obj buffer 0)) + (-> obj buffer 1) + (-> obj buffer 0) + ) + ) ) - (when (-> s5-0 busy) - (when (nonzero? (rpc-busy? (-> this rpc-port))) - (if arg0 - (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> this rpc-port)) + (when (-> active-buffer busy) + (when (nonzero? (rpc-busy? (-> obj rpc-port))) + (if print-stall-warning + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) ) - (while (nonzero? (rpc-busy? (-> this rpc-port))) + (while (nonzero? (rpc-busy? (-> obj rpc-port))) (nop!) (nop!) (nop!) @@ -111,8 +105,8 @@ (nop!) ) ) - (set! (-> s5-0 busy) #f) - (set! (-> s5-0 elt-used) (the-as uint 0)) + (set! (-> active-buffer busy) #f) + (set! (-> active-buffer elt-used) (the-as uint 0)) 0 ) ) @@ -120,19 +114,19 @@ ) ;; definition for method 13 of type rpc-buffer-pair -(defmethod check-busy rpc-buffer-pair ((this rpc-buffer-pair)) - (let ((gp-0 (if (= (-> this current) (-> this buffer 0)) - (-> this buffer 1) - (-> this buffer 0) - ) - ) +(defmethod check-busy ((this rpc-buffer-pair)) + (let ((active-buffer (if (= (-> this current) (-> this buffer 0)) + (-> this buffer 1) + (-> this buffer 0) + ) + ) ) - (when (-> gp-0 busy) + (when (-> active-buffer busy) (if (nonzero? (rpc-busy? (-> this rpc-port))) (return #t) ) - (set! (-> gp-0 busy) #f) - (set! (-> gp-0 elt-used) (the-as uint 0)) + (set! (-> active-buffer busy) #f) + (set! (-> active-buffer elt-used) (the-as uint 0)) 0 ) ) @@ -140,18 +134,18 @@ ) ;; definition for method 9 of type rpc-buffer-pair -(defmethod call rpc-buffer-pair ((this rpc-buffer-pair) (arg0 uint) (arg1 pointer) (arg2 uint)) - (when (nonzero? (-> this current elt-used)) - (let ((s2-0 (if (= (-> this current) (-> this buffer 0)) - (-> this buffer 1) - (-> this buffer 0) - ) - ) +(defmethod call ((obj rpc-buffer-pair) (fno uint) (recv-buff pointer) (recv-size uint)) + (when (nonzero? (-> obj current elt-used)) + (let ((active-buffer (if (= (-> obj current) (-> obj buffer 0)) + (-> obj buffer 1) + (-> obj buffer 0) + ) + ) ) - (when (-> s2-0 busy) - (when (nonzero? (rpc-busy? (-> this rpc-port))) - (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> this rpc-port)) - (while (nonzero? (rpc-busy? (-> this rpc-port))) + (when (-> active-buffer busy) + (when (nonzero? (rpc-busy? (-> obj rpc-port))) + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) + (while (nonzero? (rpc-busy? (-> obj rpc-port))) (nop!) (nop!) (nop!) @@ -162,56 +156,56 @@ (nop!) ) ) - (set! (-> s2-0 busy) #f) - (set! (-> s2-0 elt-used) (the-as uint 0)) + (set! (-> active-buffer busy) #f) + (set! (-> active-buffer elt-used) (the-as uint 0)) 0 ) - (let ((s1-0 (-> this current))) + (let ((current-buffer (-> obj current))) (rpc-call - (-> this rpc-port) - arg0 + (-> obj rpc-port) + fno (the-as uint 1) - (the-as uint (-> s1-0 base)) - (the-as int (* (-> s1-0 elt-size) (-> s1-0 elt-used))) - (the-as uint arg1) - (the-as int arg2) + (the-as uint (-> current-buffer base)) + (the-as int (* (-> current-buffer elt-size) (-> current-buffer elt-used))) + (the-as uint recv-buff) + (the-as int recv-size) ) - (set! (-> s1-0 busy) #t) + (set! (-> current-buffer busy) #t) ) - (set! (-> this last-recv-buffer) arg1) - (set! (-> this current) s2-0) + (set! (-> obj last-recv-buffer) recv-buff) + (set! (-> obj current) active-buffer) ) ) 0 ) ;; definition for method 14 of type rpc-buffer-pair -(defmethod pop-last-received rpc-buffer-pair ((this rpc-buffer-pair)) - (let ((v0-0 (-> this last-recv-buffer))) +(defmethod pop-last-received ((this rpc-buffer-pair)) + (let ((result (-> this last-recv-buffer))) (set! (-> this last-recv-buffer) (the-as pointer #f)) - v0-0 + result ) ) ;; definition for method 10 of type rpc-buffer-pair -(defmethod add-element rpc-buffer-pair ((this rpc-buffer-pair)) - (let ((v1-0 (-> this current))) - (when (= (-> v1-0 elt-used) (-> v1-0 elt-count)) +(defmethod add-element ((this rpc-buffer-pair)) + (let ((current-buffer (-> this current))) + (when (= (-> current-buffer elt-used) (-> current-buffer elt-count)) (if (zero? (-> this rpc-port)) (format 0 "WARNING: too many sound commands queued~%") ) (call this (the-as uint 0) (the-as pointer 0) (the-as uint 0)) - (set! v1-0 (-> this current)) + (set! current-buffer (-> this current)) ) - (let ((v0-2 (&+ (-> v1-0 base) (* (-> v1-0 elt-used) (-> v1-0 elt-size))))) - (+! (-> v1-0 elt-used) 1) - v0-2 + (let ((result (&+ (-> current-buffer base) (* (-> current-buffer elt-used) (-> current-buffer elt-size))))) + (+! (-> current-buffer elt-used) 1) + result ) ) ) ;; definition for method 11 of type rpc-buffer-pair -(defmethod decrement-elt-used rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod decrement-elt-used ((this rpc-buffer-pair)) (if (> (-> this current elt-used) 0) (+! (-> this current elt-used) -1) ) diff --git a/test/decompiler/reference/jak1/engine/ps2/timer-h_REF.gc b/test/decompiler/reference/jak1/engine/ps2/timer-h_REF.gc index 61f8d2ad413..4f88c797455 100644 --- a/test/decompiler/reference/jak1/engine/ps2/timer-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ps2/timer-h_REF.gc @@ -14,24 +14,18 @@ (equf uint8 :offset 10 :size 1) (ovff uint8 :offset 11 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type timer-bank (deftype timer-bank (structure) - ((count uint32 :offset 0) - (mode timer-mode :offset 16) - (comp uint32 :offset 32) + ((count uint32 :offset 0) + (mode timer-mode :offset 16) + (comp uint32 :offset 32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type timer-bank -(defmethod inspect timer-bank ((this timer-bank)) +(defmethod inspect ((this timer-bank)) (format #t "[~8x] ~A~%" this 'timer-bank) (format #t "~Tcount: #x~X~%" (-> this count)) (format #t "~Tmode: #x~X~%" (-> this mode)) @@ -41,15 +35,12 @@ ;; definition of type timer-hold-bank (deftype timer-hold-bank (timer-bank) - ((hold uint32 :offset 48) + ((hold uint32 :offset 48) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type timer-hold-bank -(defmethod inspect timer-hold-bank ((this timer-hold-bank)) +(defmethod inspect ((this timer-hold-bank)) (format #t "[~8x] ~A~%" this 'timer-hold-bank) (format #t "~Tcount: #x~X~%" (-> this count)) (format #t "~Tmode: #x~X~%" (-> this mode)) @@ -60,17 +51,14 @@ ;; definition of type stopwatch (deftype stopwatch (basic) - ((prev-time-elapsed time-frame :offset-assert 8) - (start-time time-frame :offset-assert 16) - (begin-level int32 :offset-assert 24) + ((prev-time-elapsed time-frame) + (start-time time-frame) + (begin-level int32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type stopwatch -(defmethod inspect stopwatch ((this stopwatch)) +(defmethod inspect ((this stopwatch)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tprev-time-elapsed: ~D~%" (-> this prev-time-elapsed)) (format #t "~Tstart-time: ~D~%" (-> this start-time)) @@ -96,18 +84,15 @@ ;; definition of type profile-frame (deftype profile-frame (structure) - ((name symbol :offset-assert 0) - (time-stamp uint32 :offset-assert 4) - (color rgba :offset-assert 8) + ((name symbol) + (time-stamp uint32) + (color rgba) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type profile-frame ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect profile-frame ((this profile-frame)) +(defmethod inspect ((this profile-frame)) (format #t "[~8x] ~A~%" this 'profile-frame) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Ttime-stamp: ~D~%" (-> this time-stamp)) @@ -117,7 +102,7 @@ ;; definition for method 3 of type profile-frame ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect profile-frame ((this profile-frame)) +(defmethod inspect ((this profile-frame)) (format #t "[~8x] profile-frame~%" this) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Ttime-stamp: ~D~%" (-> this time-stamp)) @@ -127,25 +112,22 @@ ;; definition of type profile-bar (deftype profile-bar (basic) - ((profile-frame-count int32 :offset-assert 4) - (cache-time time-frame :offset-assert 8) - (data profile-frame 1024 :inline :offset-assert 16) + ((profile-frame-count int32) + (cache-time time-frame) + (data profile-frame 1024 :inline) ) - :method-count-assert 14 - :size-assert #x4010 - :flag-assert #xe00004010 (:methods - (new (symbol type) _type_ 0) - (get-last-frame-time-stamp (_type_) uint 9) - (reset (_type_) _type_ 10) - (add-frame (_type_ symbol rgba) profile-frame 11) - (add-end-frame (_type_ symbol rgba) profile-frame 12) - (draw (_type_ dma-buffer int) float 13) + (new (symbol type) _type_) + (get-last-frame-time-stamp (_type_) uint) + (reset (_type_) _type_) + (add-frame (_type_ symbol rgba) profile-frame) + (add-end-frame (_type_ symbol rgba) profile-frame) + (draw (_type_ dma-buffer int) float) ) ) ;; definition for method 3 of type profile-bar -(defmethod inspect profile-bar ((this profile-bar)) +(defmethod inspect ((this profile-bar)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tprofile-frame-count: ~D~%" (-> this profile-frame-count)) (format #t "~Tcache-time: ~D~%" (-> this cache-time)) @@ -154,7 +136,7 @@ ) ;; definition for method 9 of type profile-bar -(defmethod get-last-frame-time-stamp profile-bar ((this profile-bar)) +(defmethod get-last-frame-time-stamp ((this profile-bar)) (-> this data (+ (-> this profile-frame-count) -2) time-stamp) ) diff --git a/test/decompiler/reference/jak1/engine/ps2/vif-h_REF.gc b/test/decompiler/reference/jak1/engine/ps2/vif-h_REF.gc index 7dad2b46e79..857b9709fd8 100644 --- a/test/decompiler/reference/jak1/engine/ps2/vif-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ps2/vif-h_REF.gc @@ -14,13 +14,10 @@ (er1 uint8 :offset 13 :size 1) (fqc uint8 :offset 24 :size 4) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type vif-stat -(defmethod inspect vif-stat ((this vif-stat)) +(defmethod inspect ((this vif-stat)) (format #t "[~8x] ~A~%" this 'vif-stat) (format #t "~Tvps: ~D~%" (-> this vps)) (format #t "~Tvew: ~D~%" (-> this vew)) @@ -42,9 +39,6 @@ (stp uint8 :offset 2 :size 1) (stc uint8 :offset 3 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type vif-err @@ -53,44 +47,38 @@ (me0 uint8 :offset 1 :size 1) (me1 uint8 :offset 2 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type vif-bank (deftype vif-bank (structure) - ((stat uint32 :offset-assert 0) - (fbrst uint32 :offset 16) - (err vif-err :offset 32) - (mark uint32 :offset 48) - (cycle uint32 :offset 64) - (mode uint32 :offset 80) - (num uint32 :offset 96) - (mask uint32 :offset 112) - (code uint32 :offset 128) - (itops uint32 :offset 144) - (base uint32 :offset 160) - (offset uint32 :offset 176) - (tops uint32 :offset 192) - (itop uint32 :offset 208) - (top uint32 :offset 224) - (r0 uint32 :offset 256) - (r1 uint32 :offset 272) - (r2 uint32 :offset 288) - (r3 uint32 :offset 304) - (c0 uint32 :offset 320) - (c1 uint32 :offset 336) - (c2 uint32 :offset 352) - (c3 uint32 :offset 368) + ((stat uint32) + (fbrst uint32 :offset 16) + (err vif-err :offset 32) + (mark uint32 :offset 48) + (cycle uint32 :offset 64) + (mode uint32 :offset 80) + (num uint32 :offset 96) + (mask uint32 :offset 112) + (code uint32 :offset 128) + (itops uint32 :offset 144) + (base uint32 :offset 160) + (offset uint32 :offset 176) + (tops uint32 :offset 192) + (itop uint32 :offset 208) + (top uint32 :offset 224) + (r0 uint32 :offset 256) + (r1 uint32 :offset 272) + (r2 uint32 :offset 288) + (r3 uint32 :offset 304) + (c0 uint32 :offset 320) + (c1 uint32 :offset 336) + (c2 uint32 :offset 352) + (c3 uint32 :offset 368) ) - :method-count-assert 9 - :size-assert #x174 - :flag-assert #x900000174 ) ;; definition for method 3 of type vif-bank -(defmethod inspect vif-bank ((this vif-bank)) +(defmethod inspect ((this vif-bank)) (format #t "[~8x] ~A~%" this 'vif-bank) (format #t "~Tstat: #x~X~%" (-> this stat)) (format #t "~Tfbrst: #x~X~%" (-> this fbrst)) diff --git a/test/decompiler/reference/jak1/engine/sound/gsound-h_REF.gc b/test/decompiler/reference/jak1/engine/sound/gsound-h_REF.gc index 7ef504a8b71..3c840c5bbfa 100644 --- a/test/decompiler/reference/jak1/engine/sound/gsound-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/sound/gsound-h_REF.gc @@ -4,20 +4,14 @@ ;; definition of type sound-id (deftype sound-id (uint32) () - :method-count-assert 10 - :size-assert #x4 - :flag-assert #xa00000004 (:methods - (unused-9 () none 9) + (unused-9 () none) ) ) ;; definition of type sound-bank-id (deftype sound-bank-id (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type sound-name @@ -25,23 +19,17 @@ ((lo uint64 :offset 0 :size 64) (hi uint64 :offset 64 :size 64) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition of type sound-rpc-cmd (deftype sound-rpc-cmd (structure) - ((rsvd1 uint16 :offset-assert 0) - (command sound-command :offset-assert 2) + ((rsvd1 uint16) + (command sound-command) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type sound-rpc-cmd -(defmethod inspect sound-rpc-cmd ((this sound-rpc-cmd)) +(defmethod inspect ((this sound-rpc-cmd)) (format #t "[~8x] ~A~%" this 'sound-rpc-cmd) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -50,25 +38,22 @@ ;; definition of type sound-play-parms (deftype sound-play-parms (structure) - ((mask sound-mask :offset-assert 0) - (pitch-mod int16 :offset-assert 2) - (bend int16 :offset-assert 4) - (fo-min int16 :offset-assert 6) - (fo-max int16 :offset-assert 8) - (fo-curve int8 :offset-assert 10) - (priority int8 :offset-assert 11) - (volume int32 :offset-assert 12) - (trans vector3w :inline :offset-assert 16) - (group sound-group :offset-assert 28) + ((mask sound-mask) + (pitch-mod int16) + (bend int16) + (fo-min int16) + (fo-max int16) + (fo-curve int8) + (priority int8) + (volume int32) + (trans vector3w :inline) + (group sound-group) ) :pack-me - :method-count-assert 9 - :size-assert #x1d - :flag-assert #x90000001d ) ;; definition for method 3 of type sound-play-parms -(defmethod inspect sound-play-parms ((this sound-play-parms)) +(defmethod inspect ((this sound-play-parms)) (format #t "[~8x] ~A~%" this 'sound-play-parms) (format #t "~Tmask: ~D~%" (-> this mask)) (format #t "~Tpitch-mod: ~D~%" (-> this pitch-mod)) @@ -85,16 +70,13 @@ ;; definition of type sound-rpc-bank-cmd (deftype sound-rpc-bank-cmd (sound-rpc-cmd) - ((bank-name sound-name :offset-assert 16) + ((bank-name sound-name) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sound-rpc-bank-cmd ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-bank-cmd ((this sound-rpc-bank-cmd)) +(defmethod inspect ((this sound-rpc-bank-cmd)) (format #t "[~8x] ~A~%" this 'sound-rpc-bank-cmd) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -104,15 +86,12 @@ ;; definition of type sound-rpc-sound-cmd (deftype sound-rpc-sound-cmd (sound-rpc-cmd) - ((id sound-id :offset-assert 4) + ((id sound-id) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type sound-rpc-sound-cmd -(defmethod inspect sound-rpc-sound-cmd ((this sound-rpc-sound-cmd)) +(defmethod inspect ((this sound-rpc-sound-cmd)) (format #t "[~8x] ~A~%" this 'sound-rpc-sound-cmd) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -122,15 +101,12 @@ ;; definition of type sound-rpc-group-cmd (deftype sound-rpc-group-cmd (sound-rpc-cmd) - ((group sound-group :offset-assert 4) + ((group sound-group) ) - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type sound-rpc-group-cmd -(defmethod inspect sound-rpc-group-cmd ((this sound-rpc-group-cmd)) +(defmethod inspect ((this sound-rpc-group-cmd)) (format #t "[~8x] ~A~%" this 'sound-rpc-group-cmd) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -141,14 +117,11 @@ ;; definition of type sound-rpc-load-bank (deftype sound-rpc-load-bank (sound-rpc-bank-cmd) () - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sound-rpc-load-bank ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-load-bank ((this sound-rpc-load-bank)) +(defmethod inspect ((this sound-rpc-load-bank)) (format #t "[~8x] ~A~%" this 'sound-rpc-load-bank) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -159,14 +132,11 @@ ;; definition of type sound-rpc-load-music (deftype sound-rpc-load-music (sound-rpc-bank-cmd) () - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sound-rpc-load-music ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-load-music ((this sound-rpc-load-music)) +(defmethod inspect ((this sound-rpc-load-music)) (format #t "[~8x] ~A~%" this 'sound-rpc-load-music) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -177,14 +147,11 @@ ;; definition of type sound-rpc-unload-bank (deftype sound-rpc-unload-bank (sound-rpc-bank-cmd) () - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sound-rpc-unload-bank ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-unload-bank ((this sound-rpc-unload-bank)) +(defmethod inspect ((this sound-rpc-unload-bank)) (format #t "[~8x] ~A~%" this 'sound-rpc-unload-bank) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -194,17 +161,14 @@ ;; definition of type sound-rpc-play (deftype sound-rpc-play (sound-rpc-sound-cmd) - ((name sound-name :offset-assert 16) - (parms sound-play-parms :inline :offset-assert 32) + ((name sound-name) + (parms sound-play-parms :inline) ) - :method-count-assert 9 - :size-assert #x3d - :flag-assert #x90000003d ) ;; definition for method 3 of type sound-rpc-play ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-play ((this sound-rpc-play)) +(defmethod inspect ((this sound-rpc-play)) (format #t "[~8x] ~A~%" this 'sound-rpc-play) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -217,13 +181,10 @@ ;; definition of type sound-rpc-pause-sound (deftype sound-rpc-pause-sound (sound-rpc-sound-cmd) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type sound-rpc-pause-sound -(defmethod inspect sound-rpc-pause-sound ((this sound-rpc-pause-sound)) +(defmethod inspect ((this sound-rpc-pause-sound)) (format #t "[~8x] ~A~%" this 'sound-rpc-pause-sound) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -234,13 +195,10 @@ ;; definition of type sound-rpc-stop-sound (deftype sound-rpc-stop-sound (sound-rpc-sound-cmd) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type sound-rpc-stop-sound -(defmethod inspect sound-rpc-stop-sound ((this sound-rpc-stop-sound)) +(defmethod inspect ((this sound-rpc-stop-sound)) (format #t "[~8x] ~A~%" this 'sound-rpc-stop-sound) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -251,13 +209,10 @@ ;; definition of type sound-rpc-continue-sound (deftype sound-rpc-continue-sound (sound-rpc-sound-cmd) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type sound-rpc-continue-sound -(defmethod inspect sound-rpc-continue-sound ((this sound-rpc-continue-sound)) +(defmethod inspect ((this sound-rpc-continue-sound)) (format #t "[~8x] ~A~%" this 'sound-rpc-continue-sound) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -267,17 +222,14 @@ ;; definition of type sound-rpc-set-param (deftype sound-rpc-set-param (sound-rpc-sound-cmd) - ((parms sound-play-parms :inline :offset-assert 8) - (auto-time int32 :offset-assert 40) - (auto-from int32 :offset-assert 44) + ((parms sound-play-parms :inline) + (auto-time int32) + (auto-from int32) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type sound-rpc-set-param -(defmethod inspect sound-rpc-set-param ((this sound-rpc-set-param)) +(defmethod inspect ((this sound-rpc-set-param)) (format #t "[~8x] ~A~%" this 'sound-rpc-set-param) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -290,15 +242,12 @@ ;; definition of type sound-rpc-set-master-volume (deftype sound-rpc-set-master-volume (sound-rpc-group-cmd) - ((volume int32 :offset-assert 8) + ((volume int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type sound-rpc-set-master-volume -(defmethod inspect sound-rpc-set-master-volume ((this sound-rpc-set-master-volume)) +(defmethod inspect ((this sound-rpc-set-master-volume)) (format #t "[~8x] ~A~%" this 'sound-rpc-set-master-volume) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -310,13 +259,10 @@ ;; definition of type sound-rpc-pause-group (deftype sound-rpc-pause-group (sound-rpc-group-cmd) () - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type sound-rpc-pause-group -(defmethod inspect sound-rpc-pause-group ((this sound-rpc-pause-group)) +(defmethod inspect ((this sound-rpc-pause-group)) (format #t "[~8x] ~A~%" this 'sound-rpc-pause-group) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -327,13 +273,10 @@ ;; definition of type sound-rpc-stop-group (deftype sound-rpc-stop-group (sound-rpc-group-cmd) () - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type sound-rpc-stop-group -(defmethod inspect sound-rpc-stop-group ((this sound-rpc-stop-group)) +(defmethod inspect ((this sound-rpc-stop-group)) (format #t "[~8x] ~A~%" this 'sound-rpc-stop-group) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -344,13 +287,10 @@ ;; definition of type sound-rpc-continue-group (deftype sound-rpc-continue-group (sound-rpc-group-cmd) () - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type sound-rpc-continue-group -(defmethod inspect sound-rpc-continue-group ((this sound-rpc-continue-group)) +(defmethod inspect ((this sound-rpc-continue-group)) (format #t "[~8x] ~A~%" this 'sound-rpc-continue-group) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -360,17 +300,14 @@ ;; definition of type sound-rpc-get-irx-version (deftype sound-rpc-get-irx-version (sound-rpc-cmd) - ((major uint32 :offset-assert 4) - (minor uint32 :offset-assert 8) - (ee-addr pointer :offset-assert 12) + ((major uint32) + (minor uint32) + (ee-addr pointer) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type sound-rpc-get-irx-version -(defmethod inspect sound-rpc-get-irx-version ((this sound-rpc-get-irx-version)) +(defmethod inspect ((this sound-rpc-get-irx-version)) (format #t "[~8x] ~A~%" this 'sound-rpc-get-irx-version) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -382,15 +319,12 @@ ;; definition of type sound-rpc-set-language (deftype sound-rpc-set-language (sound-rpc-cmd) - ((lang uint32 :offset-assert 4) + ((lang uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type sound-rpc-set-language -(defmethod inspect sound-rpc-set-language ((this sound-rpc-set-language)) +(defmethod inspect ((this sound-rpc-set-language)) (format #t "[~8x] ~A~%" this 'sound-rpc-set-language) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -400,17 +334,14 @@ ;; definition of type sound-rpc-set-falloff-curve (deftype sound-rpc-set-falloff-curve (sound-rpc-cmd) - ((curve int32 :offset-assert 4) - (falloff int32 :offset-assert 8) - (ease int32 :offset-assert 12) + ((curve int32) + (falloff int32) + (ease int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type sound-rpc-set-falloff-curve -(defmethod inspect sound-rpc-set-falloff-curve ((this sound-rpc-set-falloff-curve)) +(defmethod inspect ((this sound-rpc-set-falloff-curve)) (format #t "[~8x] ~A~%" this 'sound-rpc-set-falloff-curve) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -422,19 +353,16 @@ ;; definition of type sound-rpc-set-sound-falloff (deftype sound-rpc-set-sound-falloff (sound-rpc-cmd) - ((name sound-name :offset-assert 16) - (curve int32 :offset-assert 32) - (min int32 :offset-assert 36) - (max int32 :offset-assert 40) + ((name sound-name) + (curve int32) + (min int32) + (max int32) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type sound-rpc-set-sound-falloff ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-set-sound-falloff ((this sound-rpc-set-sound-falloff)) +(defmethod inspect ((this sound-rpc-set-sound-falloff)) (format #t "[~8x] ~A~%" this 'sound-rpc-set-sound-falloff) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -448,13 +376,10 @@ ;; definition of type sound-rpc-reload-info (deftype sound-rpc-reload-info (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type sound-rpc-reload-info -(defmethod inspect sound-rpc-reload-info ((this sound-rpc-reload-info)) +(defmethod inspect ((this sound-rpc-reload-info)) (format #t "[~8x] ~A~%" this 'sound-rpc-reload-info) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -463,18 +388,15 @@ ;; definition of type sound-rpc-set-reverb (deftype sound-rpc-set-reverb (sound-rpc-cmd) - ((core uint8 :offset-assert 4) - (reverb int32 :offset-assert 8) - (left uint32 :offset-assert 12) - (right uint32 :offset-assert 16) + ((core uint8) + (reverb int32) + (left uint32) + (right uint32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type sound-rpc-set-reverb -(defmethod inspect sound-rpc-set-reverb ((this sound-rpc-set-reverb)) +(defmethod inspect ((this sound-rpc-set-reverb)) (format #t "[~8x] ~A~%" this 'sound-rpc-set-reverb) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -487,17 +409,14 @@ ;; definition of type sound-rpc-set-ear-trans (deftype sound-rpc-set-ear-trans (sound-rpc-cmd) - ((ear-trans vector3w :inline :offset-assert 4) - (cam-trans vector3w :inline :offset-assert 16) - (cam-angle int32 :offset-assert 28) + ((ear-trans vector3w :inline) + (cam-trans vector3w :inline) + (cam-angle int32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sound-rpc-set-ear-trans -(defmethod inspect sound-rpc-set-ear-trans ((this sound-rpc-set-ear-trans)) +(defmethod inspect ((this sound-rpc-set-ear-trans)) (format #t "[~8x] ~A~%" this 'sound-rpc-set-ear-trans) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -509,15 +428,12 @@ ;; definition of type sound-rpc-set-flava (deftype sound-rpc-set-flava (sound-rpc-cmd) - ((flava uint8 :offset-assert 4) + ((flava uint8) ) - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type sound-rpc-set-flava -(defmethod inspect sound-rpc-set-flava ((this sound-rpc-set-flava)) +(defmethod inspect ((this sound-rpc-set-flava)) (format #t "[~8x] ~A~%" this 'sound-rpc-set-flava) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -528,13 +444,10 @@ ;; definition of type sound-rpc-shutdown (deftype sound-rpc-shutdown (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type sound-rpc-shutdown -(defmethod inspect sound-rpc-shutdown ((this sound-rpc-shutdown)) +(defmethod inspect ((this sound-rpc-shutdown)) (format #t "[~8x] ~A~%" this 'sound-rpc-shutdown) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -544,13 +457,10 @@ ;; definition of type sound-rpc-list-sounds (deftype sound-rpc-list-sounds (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type sound-rpc-list-sounds -(defmethod inspect sound-rpc-list-sounds ((this sound-rpc-list-sounds)) +(defmethod inspect ((this sound-rpc-list-sounds)) (format #t "[~8x] ~A~%" this 'sound-rpc-list-sounds) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -560,13 +470,10 @@ ;; definition of type sound-rpc-unload-music (deftype sound-rpc-unload-music (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type sound-rpc-unload-music -(defmethod inspect sound-rpc-unload-music ((this sound-rpc-unload-music)) +(defmethod inspect ((this sound-rpc-unload-music)) (format #t "[~8x] ~A~%" this 'sound-rpc-unload-music) (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) (format #t "~Tcommand: ~D~%" (-> this command)) @@ -575,39 +482,36 @@ ;; definition of type sound-rpc-union (deftype sound-rpc-union (structure) - ((data uint32 20 :offset-assert 0) - (load-bank sound-rpc-load-bank :offset 0) - (unload-bank sound-rpc-unload-bank :offset 0) - (play sound-rpc-play :offset 0) - (pause-sound sound-rpc-pause-sound :offset 0) - (stop-sound sound-rpc-stop-sound :offset 0) - (continue-sound sound-rpc-continue-sound :offset 0) - (set-param sound-rpc-set-param :offset 0) - (set-master-volume sound-rpc-set-master-volume :offset 0) - (pause-group sound-rpc-pause-group :offset 0) - (stop-group sound-rpc-stop-group :offset 0) - (continue-group sound-rpc-continue-group :offset 0) - (get-irx-version sound-rpc-get-irx-version :offset 0) - (set-falloff-curve sound-rpc-set-falloff-curve :offset 0) - (set-sound-falloff sound-rpc-set-sound-falloff :offset 0) - (reload-info sound-rpc-reload-info :offset 0) - (set-language sound-rpc-set-language :offset 0) - (set-reverb sound-rpc-set-reverb :offset 0) - (set-ear-trans sound-rpc-set-ear-trans :offset 0) - (set-flava sound-rpc-set-flava :offset 0) - (set-fps sound-rpc-set-fps :offset 0) - (shutdown sound-rpc-shutdown :offset 0) - (list-sounds sound-rpc-list-sounds :offset 0) - (unload-music sound-rpc-unload-music :offset 0) - (mirror-mode sound-rpc-set-mirror-mode :offset 0) + ((data uint32 20) + (load-bank sound-rpc-load-bank :overlay-at (-> data 0)) + (unload-bank sound-rpc-unload-bank :overlay-at (-> data 0)) + (play sound-rpc-play :overlay-at (-> data 0)) + (pause-sound sound-rpc-pause-sound :overlay-at (-> data 0)) + (stop-sound sound-rpc-stop-sound :overlay-at (-> data 0)) + (continue-sound sound-rpc-continue-sound :overlay-at (-> data 0)) + (set-param sound-rpc-set-param :overlay-at (-> data 0)) + (set-master-volume sound-rpc-set-master-volume :overlay-at (-> data 0)) + (pause-group sound-rpc-pause-group :overlay-at (-> data 0)) + (stop-group sound-rpc-stop-group :overlay-at (-> data 0)) + (continue-group sound-rpc-continue-group :overlay-at (-> data 0)) + (get-irx-version sound-rpc-get-irx-version :overlay-at (-> data 0)) + (set-falloff-curve sound-rpc-set-falloff-curve :overlay-at (-> data 0)) + (set-sound-falloff sound-rpc-set-sound-falloff :overlay-at (-> data 0)) + (reload-info sound-rpc-reload-info :overlay-at (-> data 0)) + (set-language sound-rpc-set-language :overlay-at (-> data 0)) + (set-reverb sound-rpc-set-reverb :overlay-at (-> data 0)) + (set-ear-trans sound-rpc-set-ear-trans :overlay-at (-> data 0)) + (set-flava sound-rpc-set-flava :overlay-at (-> data 0)) + (set-fps sound-rpc-set-fps :overlay-at (-> data 0)) + (shutdown sound-rpc-shutdown :overlay-at (-> data 0)) + (list-sounds sound-rpc-list-sounds :overlay-at (-> data 0)) + (unload-music sound-rpc-unload-music :overlay-at (-> data 0)) + (mirror-mode sound-rpc-set-mirror-mode :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type sound-rpc-union -(defmethod inspect sound-rpc-union ((this sound-rpc-union)) +(defmethod inspect ((this sound-rpc-union)) (format #t "[~8x] ~A~%" this 'sound-rpc-union) (format #t "~Tdata[20] @ #x~X~%" (-> this data)) (format #t "~Tload-bank: #~%" (-> this load-bank)) @@ -637,30 +541,27 @@ ;; definition of type sound-spec (deftype sound-spec (basic) - ((mask sound-mask :offset-assert 4) - (num float :offset-assert 8) - (group sound-group :offset-assert 12) - (sound-name-char uint8 16 :offset 16) - (sound-name sound-name :offset 16) - (trans float 4 :offset-assert 32) - (volume int32 :offset-assert 48) - (pitch-mod int32 :offset-assert 52) - (bend int32 :offset-assert 56) - (fo-min int16 :offset-assert 60) - (fo-max int16 :offset-assert 62) - (fo-curve int8 :offset-assert 64) - (priority int8 :offset-assert 65) - (auto-time int32 :offset-assert 68) - (auto-from int32 :offset-assert 72) + ((mask sound-mask) + (num float) + (group sound-group) + (sound-name-char uint8 16 :offset 16) + (sound-name sound-name :overlay-at (-> sound-name-char 0)) + (trans float 4) + (volume int32) + (pitch-mod int32) + (bend int32) + (fo-min int16) + (fo-max int16) + (fo-curve int8) + (priority int8) + (auto-time int32) + (auto-from int32) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) ;; definition for method 3 of type sound-spec ;; INFO: Used lq/sq -(defmethod inspect sound-spec ((this sound-spec)) +(defmethod inspect ((this sound-spec)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tmask: ~D~%" (-> this mask)) (format #t "~Tnum: ~f~%" (-> this num)) @@ -685,39 +586,36 @@ ;; definition of type ambient-sound (deftype ambient-sound (basic) - ((spec sound-spec :offset-assert 4) - (playing-id sound-id :offset-assert 8) - (trans vector :inline :offset-assert 16) - (name sound-name :offset-assert 32) - (play-time time-frame :offset-assert 48) - (time-base time-frame :offset-assert 56) - (time-random time-frame :offset-assert 64) - (volume int32 :offset-assert 72) - (pitch int32 :offset-assert 76) - (falloff-near int32 :offset-assert 80) - (falloff-far int32 :offset-assert 84) - (falloff-mode int32 :offset-assert 88) - (params (pointer float) :offset-assert 92) - (param-count int32 :offset-assert 96) - (entity entity :offset-assert 100) - (sound-count int32 :offset-assert 104) + ((spec sound-spec) + (playing-id sound-id) + (trans vector :inline) + (name sound-name) + (play-time time-frame) + (time-base time-frame) + (time-random time-frame) + (volume int32) + (pitch int32) + (falloff-near int32) + (falloff-far int32) + (falloff-mode int32) + (params (pointer float)) + (param-count int32) + (entity entity) + (sound-count int32) ) - :method-count-assert 14 - :size-assert #x6c - :flag-assert #xe0000006c (:methods - (new (symbol type basic vector) _type_ 0) - (update! (_type_) int 9) - (change-sound! (_type_ sound-name) int 10) - (update-trans! (_type_ vector) int 11) - (update-vol! (_type_ int) int 12) - (stop! (_type_) int 13) + (new (symbol type basic vector) _type_) + (update! (_type_) int) + (change-sound! (_type_ sound-name) int) + (update-trans! (_type_ vector) int) + (update-vol! (_type_ int) int) + (stop! (_type_) int) ) ) ;; definition for method 3 of type ambient-sound ;; INFO: Used lq/sq -(defmethod inspect ambient-sound ((this ambient-sound)) +(defmethod inspect ((this ambient-sound)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tspec: ~A~%" (-> this spec)) (format #t "~Tplaying-id: ~D~%" (-> this playing-id)) diff --git a/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc index 955b41db602..19d34068943 100644 --- a/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc @@ -14,28 +14,25 @@ ;; definition of type sound-iop-info (deftype sound-iop-info (basic) - ((frame uint32 :offset 16) - (strpos int32 :offset-assert 20) - (str-id sound-id :offset-assert 24) - (str-id-sign int32 :offset 24) - (freemem uint32 :offset-assert 28) - (chinfo uint8 48 :offset-assert 32) - (freemem2 uint32 :offset-assert 80) - (nocd uint32 :offset-assert 84) - (dirtycd uint32 :offset-assert 88) - (diskspeed uint32 2 :offset-assert 92) - (lastspeed uint32 :offset-assert 100) - (dupseg int32 :offset-assert 104) - (times uint32 41 :offset-assert 108) - (times-seq uint32 :offset-assert 272) + ((frame uint32 :offset 16) + (strpos int32) + (str-id sound-id) + (str-id-sign int32 :overlay-at str-id) + (freemem uint32) + (chinfo uint8 48) + (freemem2 uint32) + (nocd uint32) + (dirtycd uint32) + (diskspeed uint32 2) + (lastspeed uint32) + (dupseg int32) + (times uint32 41) + (times-seq uint32) ) - :method-count-assert 9 - :size-assert #x114 - :flag-assert #x900000114 ) ;; definition for method 3 of type sound-iop-info -(defmethod inspect sound-iop-info ((this sound-iop-info)) +(defmethod inspect ((this sound-iop-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tframe: ~D~%" (-> this frame)) (format #t "~Tstrpos: ~D~%" (-> this strpos)) @@ -715,7 +712,7 @@ ;; definition for method 9 of type ambient-sound ;; INFO: Used lq/sq -(defmethod update! ambient-sound ((this ambient-sound)) +(defmethod update! ((this ambient-sound)) (with-pp (if (not *ambient-sound-class*) (return (the-as int #f)) @@ -799,14 +796,14 @@ ) ;; definition for method 13 of type ambient-sound -(defmethod stop! ambient-sound ((this ambient-sound)) +(defmethod stop! ((this ambient-sound)) (sound-stop (-> this playing-id)) 0 ) ;; definition for method 11 of type ambient-sound ;; INFO: Used lq/sq -(defmethod update-trans! ambient-sound ((this ambient-sound) (arg0 vector)) +(defmethod update-trans! ((this ambient-sound) (arg0 vector)) (with-pp (set! (-> this trans quad) (-> arg0 quad)) (when (nonzero? (-> this playing-id)) @@ -834,7 +831,7 @@ ) ;; definition for method 12 of type ambient-sound -(defmethod update-vol! ambient-sound ((this ambient-sound) (arg0 int)) +(defmethod update-vol! ((this ambient-sound) (arg0 int)) (when (nonzero? (-> this playing-id)) (let ((cmd (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command set-param)) @@ -850,7 +847,7 @@ ;; definition for method 10 of type ambient-sound ;; INFO: Used lq/sq -(defmethod change-sound! ambient-sound ((this ambient-sound) (arg0 sound-name)) +(defmethod change-sound! ((this ambient-sound) (arg0 sound-name)) (when (not (and (= (the-as uint (-> this name)) (the-as uint arg0)) (= (-> arg0 hi) (-> this name hi)))) (stop! this) (set! (-> this playing-id) (new-sound-id)) @@ -944,17 +941,14 @@ ;; definition of type flava-table-row (deftype flava-table-row (structure) - ((music symbol :offset-assert 0) - (flava uint8 50 :offset-assert 4) + ((music symbol) + (flava uint8 50) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x36 - :flag-assert #x900000036 ) ;; definition for method 3 of type flava-table-row -(defmethod inspect flava-table-row ((this flava-table-row)) +(defmethod inspect ((this flava-table-row)) (format #t "[~8x] ~A~%" this 'flava-table-row) (format #t "~Tmusic: ~A~%" (-> this music)) (format #t "~Tflava[50] @ #x~X~%" (-> this flava)) @@ -963,16 +957,13 @@ ;; definition of type flava-table (deftype flava-table (basic) - ((row flava-table-row 20 :inline :offset-assert 4) - (count int32 :offset-assert 1284) + ((row flava-table-row 20 :inline) + (count int32) ) - :method-count-assert 9 - :size-assert #x508 - :flag-assert #x900000508 ) ;; definition for method 3 of type flava-table -(defmethod inspect flava-table ((this flava-table)) +(defmethod inspect ((this flava-table)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Trow[20] @ #x~X~%" (-> this row)) (format #t "~Tcount: ~D~%" (-> this count)) diff --git a/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc index 95a8440e4d9..48fb98c0756 100644 --- a/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc @@ -5,9 +5,7 @@ ;; INFO: Used lq/sq (defbehavior build-conversions target ((arg0 vector)) (surface-mult! (-> self control unknown-surface01) (-> self control unknown-surface00) (-> self control surf)) - (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-blue)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (and (= (-> self fact eco-type) (pickup-type eco-blue)) (>= (-> self fact eco-level) 1.0)) (or (= (-> self control unknown-surface00 name) 'run) (= (-> self control unknown-surface00 name) 'jump)) ) (+! (-> self control unknown-surface01 target-speed) 20480.0) @@ -2074,7 +2072,7 @@ (set! (-> self control unknown-cspace00 joint) (the-as joint (joint-node-index eichar-lod0-jg rindA))) (set! (-> self control unknown-cspace10 parent) (joint-node-index eichar-lod0-jg LshoulderPad)) (set! (-> self neck) (new 'process 'joint-mod (joint-mod-handler-mode look-at) self 7)) - (set! (-> self fact-info-target) + (set! (-> self fact) (new 'process 'fact-info-target self (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (set! (-> self sound) (new 'process 'ambient-sound 'none (-> self control trans))) @@ -2100,7 +2098,7 @@ ) ;; definition for method 10 of type target -(defmethod deactivate target ((this target)) +(defmethod deactivate ((this target)) (set-zero! *camera-smush-control*) (call-parent-method this) (none) diff --git a/test/decompiler/reference/jak1/engine/target/target-death_REF.gc b/test/decompiler/reference/jak1/engine/target/target-death_REF.gc index f3753bfafe5..8f1fc0ea5b8 100644 --- a/test/decompiler/reference/jak1/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-death_REF.gc @@ -612,7 +612,7 @@ (case (-> arg4 angle) (('jump 'up 'up-forward) (when (and (not (logtest? (-> self control root-prim prim-core action) (collide-action racer flut))) - (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health)))) + (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health)))) ) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) (go target-attack-air #f) @@ -827,7 +827,7 @@ :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control unknown-cpad-info00 number) r2)) - (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) + (pickup-collectable! (-> self fact) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) (go target-stance) ) ) @@ -899,49 +899,34 @@ (go target-stance) ) (else - (pickup-collectable! - (-> self fact-info-target) - (pickup-type eco-green) - (the-as float -1000.0) - (the-as handle #f) - ) + (pickup-collectable! (-> self fact) (pickup-type eco-green) (the-as float -1000.0) (the-as handle #f)) (go target-death (-> gp-0 mode)) ) ) ) (('drown-death 'sharkey 'lava 'dark-eco-pool 'ogreboss-super-boulder 'melt 'instant-death) - (pickup-collectable! - (-> self fact-info-target) - (pickup-type eco-green) - (the-as float -1000.0) - (the-as handle #f) - ) + (pickup-collectable! (-> self fact) (pickup-type eco-green) (the-as float -1000.0) (the-as handle #f)) (if (= (-> self game mode) 'play) (go target-death (-> gp-0 mode)) ) ) (('death) - (pickup-collectable! - (-> self fact-info-target) - (pickup-type eco-green) - (the-as float -1000.0) - (the-as handle #f) - ) + (pickup-collectable! (-> self fact) (pickup-type eco-green) (the-as float -1000.0) (the-as handle #f)) ) (('plant-boss) (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) ) - (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) (go target-death (-> gp-0 mode)) ) ) (else (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) @@ -954,7 +939,7 @@ (target-hit-setup-anim gp-0) (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-falling-anim-trans (the-as float 1.0)) ) - (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) (go target-death (-> gp-0 mode)) ) ) diff --git a/test/decompiler/reference/jak1/engine/target/target-h_REF.gc b/test/decompiler/reference/jak1/engine/target/target-h_REF.gc index 64481803d7d..d16f95f7f42 100644 --- a/test/decompiler/reference/jak1/engine/target/target-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-h_REF.gc @@ -3,40 +3,36 @@ ;; definition of type target (deftype target (process-drawable) - ((self-override target :offset 28) - (control control-info :offset 112) - (fact-info-target fact-info-target :offset 144) - (skel2 basic :offset-assert 176) - (racer racer-info :offset-assert 180) - (game game-info :offset-assert 184) - (neck joint-mod :offset-assert 188) - (state-hook-time time-frame :offset-assert 192) - (state-hook (function none :behavior target) :offset-assert 200) - (cam-user-mode symbol :offset-assert 204) - (sidekick (pointer sidekick) :offset-assert 208) - (manipy (pointer manipy) :offset-assert 212) - (attack-info attack-info :inline :offset-assert 224) - (attack-info-rec attack-info :inline :offset-assert 336) - (anim-seed uint64 :offset-assert 440) - (alt-cam-pos vector :inline :offset-assert 448) - (snowball snowball-info :offset-assert 464) - (tube tube-info :offset-assert 468) - (flut flut-info :offset-assert 472) - (current-level level :offset-assert 476) - (saved-pos transformq :inline :offset-assert 480) - (saved-owner uint64 :offset-assert 528) - (alt-neck-pos vector :inline :offset-assert 544) - (fp-hud handle :offset-assert 560) - (no-load-wait time-frame :offset-assert 568) - (no-look-around-wait time-frame :offset-assert 576) - (burn-proc handle :offset-assert 584) + ((fact fact-info-target :override) + (self-override target :overlay-at self) + (control control-info :overlay-at root) + (skel2 basic) + (racer racer-info) + (game game-info) + (neck joint-mod) + (state-hook-time time-frame) + (state-hook (function none :behavior target)) + (cam-user-mode symbol) + (sidekick (pointer sidekick)) + (manipy (pointer manipy)) + (attack-info attack-info :inline) + (attack-info-rec attack-info :inline) + (anim-seed uint64) + (alt-cam-pos vector :inline) + (snowball snowball-info) + (tube tube-info) + (flut flut-info) + (current-level level) + (saved-pos transformq :inline) + (saved-owner uint64) + (alt-neck-pos vector :inline) + (fp-hud handle) + (no-load-wait time-frame) + (no-look-around-wait time-frame) + (burn-proc handle) ) - :heap-base #x1e0 - :method-count-assert 21 - :size-assert #x250 - :flag-assert #x1501e00250 (:methods - (find-edge-grabs! (_type_ collide-cache) object 20) + (find-edge-grabs! (_type_ collide-cache) object) ) (:states target-attack @@ -149,7 +145,7 @@ ) ;; definition for method 3 of type target -(defmethod inspect target ((this target)) +(defmethod inspect ((this target)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -185,22 +181,18 @@ ;; definition of type sidekick (deftype sidekick (process-drawable) - ((parent-override (pointer target) :offset 12) - (control control-info :offset 112) - (anim-seed uint64 :offset 192) - (shadow-in-movie? symbol :offset-assert 200) + ((parent-override (pointer target) :overlay-at parent) + (control control-info :overlay-at root) + (anim-seed uint64 :offset 192) + (shadow-in-movie? symbol) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xcc - :flag-assert #x14006000cc (:states sidekick-clone ) ) ;; definition for method 3 of type sidekick -(defmethod inspect sidekick ((this sidekick)) +(defmethod inspect ((this sidekick)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc b/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc index 77a42be265b..cce07475339 100644 --- a/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc @@ -11,13 +11,8 @@ (let ((s4-0 (-> arg3 param 0)) (f28-0 (the-as float (-> arg3 param 1))) ) - (if (!= (pickup-collectable! - (-> self fact-info-target) - (the-as pickup-type s4-0) - (the-as float 0.0) - (the-as handle #f) - ) - (pickup-collectable! (-> self fact-info-target) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) + (if (!= (pickup-collectable! (-> self fact) (the-as pickup-type s4-0) (the-as float 0.0) (the-as handle #f)) + (pickup-collectable! (-> self fact) (the-as pickup-type s4-0) f28-0 (process->handle arg0)) ) #t 'full @@ -26,7 +21,7 @@ ) ) (('reset-pickup) - (reset! (-> self fact-info-target) (the-as symbol (-> arg3 param 0))) + (reset! (-> self fact) (the-as symbol (-> arg3 param 0))) ) (('reset-collide) (cond @@ -47,13 +42,9 @@ (let ((s5-1 (-> v1-21 info))) (let ((v1-22 (-> s5-1 buzzer))) (if (zero? v1-22) - (set! (-> self fact-info-target buzzer) 0.0) - (set! (-> self fact-info-target buzzer) (pickup-collectable! - (-> self fact-info-target) - (pickup-type buzzer) - (the float (logior -65536 v1-22)) - (the-as handle #f) - ) + (set! (-> self fact buzzer) 0.0) + (set! (-> self fact buzzer) + (pickup-collectable! (-> self fact) (pickup-type buzzer) (the float (logior -65536 v1-22)) (the-as handle #f)) ) ) ) @@ -79,11 +70,11 @@ (('query) (case (-> arg3 param 0) (('powerup) - (and (= (-> self fact-info-target eco-type) (-> arg3 param 1)) (< 0.0 (-> self fact-info-target eco-level))) + (and (= (-> self fact eco-type) (-> arg3 param 1)) (< 0.0 (-> self fact eco-level))) ) (('pickup) (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (the-as pickup-type (-> arg3 param 1)) (the-as float 0.0) (the-as handle #f) @@ -316,9 +307,7 @@ ((or (logtest? (-> self state-flags) (state-flags invulnerable timed-invulnerable invuln-powerup)) (and (logtest? (-> arg1 mask) (attack-mask mode)) (= (-> arg1 mode) 'darkeco) - (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (and (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (logtest? (state-flags dangerous flop-hit-ground) (-> self state-flags)) ) ) @@ -360,11 +349,11 @@ (cond ((and (logtest? (-> self attack-info-rec mask) (attack-mask mode)) (and (= (-> self attack-info-rec mode) 'damage) - (not (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact-info-target health)))) + (not (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact health)))) ) ) (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) @@ -396,7 +385,7 @@ ) (else (logior! (-> self state-flags) (state-flags being-attacked)) - (if (and (= (-> self game mode) 'play) (and (>= 1.0 (-> self fact-info-target health)) (= arg0 'attack))) + (if (and (= (-> self game mode) 'play) (and (>= 1.0 (-> self fact health)) (= arg0 'attack))) (logior! (-> self state-flags) (state-flags dying)) ) (go arg4 arg0 (-> self attack-info-rec)) diff --git a/test/decompiler/reference/jak1/engine/target/target-util_REF.gc b/test/decompiler/reference/jak1/engine/target/target-util_REF.gc index 9e823671d51..5f3a1707bbd 100644 --- a/test/decompiler/reference/jak1/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-util_REF.gc @@ -24,96 +24,93 @@ ;; definition of type target-bank (deftype target-bank (basic) - ((jump-collide-offset meters :offset-assert 4) - (jump-height-min meters :offset-assert 8) - (jump-height-max meters :offset-assert 12) - (double-jump-height-min meters :offset-assert 16) - (double-jump-height-max meters :offset-assert 20) - (flip-jump-height-min meters :offset-assert 24) - (flip-jump-height-max meters :offset-assert 28) - (duck-jump-height-min meters :offset-assert 32) - (duck-jump-height-max meters :offset-assert 36) - (flop-jump-height-min meters :offset-assert 40) - (flop-jump-height-max meters :offset-assert 44) - (attack-jump-height-min meters :offset-assert 48) - (attack-jump-height-max meters :offset-assert 52) - (edge-grab-jump-height-min meters :offset-assert 56) - (edge-grab-jump-height-max meters :offset-assert 60) - (swim-jump-height-min meters :offset-assert 64) - (swim-jump-height-max meters :offset-assert 68) - (tube-jump-height-min meters :offset-assert 72) - (tube-jump-height-max meters :offset-assert 76) - (wheel-duration time-frame :offset-assert 80) - (wheel-jump-pre-window time-frame :offset-assert 88) - (wheel-jump-post-window time-frame :offset-assert 96) - (wheel-timeout time-frame :offset-assert 104) - (wheel-speed-min meters :offset-assert 112) - (wheel-speed-inc meters :offset-assert 116) - (wheel-flip-duration time-frame :offset-assert 120) - (wheel-flip-height meters :offset-assert 128) - (wheel-flip-dist meters :offset-assert 132) - (wheel-flip-art-height meters :offset-assert 136) - (wheel-flip-art-dist meters :offset-assert 140) - (duck-slide-distance meters :offset-assert 144) - (fall-far meters :offset-assert 148) - (fall-far-inc meters :offset-assert 152) - (attack-timeout time-frame :offset-assert 160) - (ground-timeout time-frame :offset-assert 168) - (slide-down-timeout time-frame :offset-assert 176) - (fall-timeout time-frame :offset-assert 184) - (fall-stumble-threshold meters :offset-assert 192) - (yellow-projectile-speed meters :offset-assert 196) - (hit-invulnerable-timeout time-frame :offset-assert 200) - (run-cycle-length float :offset-assert 208) - (walk-cycle-dist meters :offset-assert 212) - (walk-up-cycle-dist meters :offset-assert 216) - (walk-down-cycle-dist meters :offset-assert 220) - (walk-side-cycle-dist meters :offset-assert 224) - (run-cycle-dist meters :offset-assert 228) - (run-up-cycle-dist meters :offset-assert 232) - (run-down-cycle-dist meters :offset-assert 236) - (run-side-cycle-dist meters :offset-assert 240) - (run-wall-cycle-dist meters :offset-assert 244) - (duck-walk-cycle-dist meters :offset-assert 248) - (wade-shallow-walk-cycle-dist meters :offset-assert 252) - (wade-deep-walk-cycle-dist meters :offset-assert 256) - (smack-surface-dist meters :offset-assert 260) - (smack-surface-height meters :offset-assert 264) - (min-dive-depth meters :offset-assert 268) - (root-radius meters :offset-assert 272) - (root-offset vector :inline :offset-assert 288) - (body-radius meters :offset-assert 304) - (edge-radius meters :offset-assert 308) - (edge-offset vector :inline :offset-assert 320) - (head-radius meters :offset-assert 336) - (head-height meters :offset-assert 340) - (head-offset vector :inline :offset-assert 352) - (spin-radius meters :offset-assert 368) - (spin-offset vector :inline :offset-assert 384) - (duck-spin-radius meters :offset-assert 400) - (duck-spin-offset vector :inline :offset-assert 416) - (punch-radius meters :offset-assert 432) - (punch-offset vector :inline :offset-assert 448) - (uppercut-radius meters :offset-assert 464) - (uppercut0-offset vector :inline :offset-assert 480) - (uppercut1-offset vector :inline :offset-assert 496) - (flop-radius meters :offset-assert 512) - (flop0-offset vector :inline :offset-assert 528) - (flop1-offset vector :inline :offset-assert 544) - (stuck-time seconds :offset-assert 560) - (stuck-timeout seconds :offset-assert 568) - (stuck-distance meters :offset-assert 576) - (tongue-pull-speed-min float :offset-assert 580) - (tongue-pull-speed-max float :offset-assert 584) - (yellow-attack-timeout time-frame :offset-assert 592) + ((jump-collide-offset meters) + (jump-height-min meters) + (jump-height-max meters) + (double-jump-height-min meters) + (double-jump-height-max meters) + (flip-jump-height-min meters) + (flip-jump-height-max meters) + (duck-jump-height-min meters) + (duck-jump-height-max meters) + (flop-jump-height-min meters) + (flop-jump-height-max meters) + (attack-jump-height-min meters) + (attack-jump-height-max meters) + (edge-grab-jump-height-min meters) + (edge-grab-jump-height-max meters) + (swim-jump-height-min meters) + (swim-jump-height-max meters) + (tube-jump-height-min meters) + (tube-jump-height-max meters) + (wheel-duration time-frame) + (wheel-jump-pre-window time-frame) + (wheel-jump-post-window time-frame) + (wheel-timeout time-frame) + (wheel-speed-min meters) + (wheel-speed-inc meters) + (wheel-flip-duration time-frame) + (wheel-flip-height meters) + (wheel-flip-dist meters) + (wheel-flip-art-height meters) + (wheel-flip-art-dist meters) + (duck-slide-distance meters) + (fall-far meters) + (fall-far-inc meters) + (attack-timeout time-frame) + (ground-timeout time-frame) + (slide-down-timeout time-frame) + (fall-timeout time-frame) + (fall-stumble-threshold meters) + (yellow-projectile-speed meters) + (hit-invulnerable-timeout time-frame) + (run-cycle-length float) + (walk-cycle-dist meters) + (walk-up-cycle-dist meters) + (walk-down-cycle-dist meters) + (walk-side-cycle-dist meters) + (run-cycle-dist meters) + (run-up-cycle-dist meters) + (run-down-cycle-dist meters) + (run-side-cycle-dist meters) + (run-wall-cycle-dist meters) + (duck-walk-cycle-dist meters) + (wade-shallow-walk-cycle-dist meters) + (wade-deep-walk-cycle-dist meters) + (smack-surface-dist meters) + (smack-surface-height meters) + (min-dive-depth meters) + (root-radius meters) + (root-offset vector :inline) + (body-radius meters) + (edge-radius meters) + (edge-offset vector :inline) + (head-radius meters) + (head-height meters) + (head-offset vector :inline) + (spin-radius meters) + (spin-offset vector :inline) + (duck-spin-radius meters) + (duck-spin-offset vector :inline) + (punch-radius meters) + (punch-offset vector :inline) + (uppercut-radius meters) + (uppercut0-offset vector :inline) + (uppercut1-offset vector :inline) + (flop-radius meters) + (flop0-offset vector :inline) + (flop1-offset vector :inline) + (stuck-time seconds) + (stuck-timeout seconds) + (stuck-distance meters) + (tongue-pull-speed-min float) + (tongue-pull-speed-max float) + (yellow-attack-timeout time-frame) ) - :method-count-assert 9 - :size-assert #x258 - :flag-assert #x900000258 ) ;; definition for method 3 of type target-bank -(defmethod inspect target-bank ((this target-bank)) +(defmethod inspect ((this target-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tjump-collide-offset: (meters ~m)~%" (-> this jump-collide-offset)) (format #t "~Tjump-height-min: (meters ~m)~%" (-> this jump-height-min)) @@ -725,7 +722,7 @@ ) ;; definition for method 27 of type control-info -(defmethod get-quaternion control-info ((this control-info)) +(defmethod get-quaternion ((this control-info)) (-> this unknown-quaternion00) ) @@ -743,7 +740,7 @@ ;; definition for method 16 of type target ;; INFO: Used lq/sq ;; INFO: Return type mismatch control-info vs collide-shape. -(defmethod apply-alignment target ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg2 quad)) (set! (-> s2-0 z) (target-align-vel-z-adjust (-> s2-0 z))) @@ -960,10 +957,7 @@ ((or (not (cpad-pressed? (-> self control unknown-cpad-info00 number) square)) (or (and (logtest? (-> self state-flags) (state-flags prevent-attack)) (or (not (logtest? (-> self state-flags) (state-flags remove-prevents))) - (not (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) - ) + (not (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0))) ) ) (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) @@ -976,9 +970,7 @@ ) ) (time-elapsed? - (if (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (if (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (-> *TARGET-bank* yellow-attack-timeout) (-> *TARGET-bank* attack-timeout) ) @@ -1108,7 +1100,7 @@ ;; definition for method 9 of type attack-info ;; INFO: Used lq/sq ;; INFO: Return type mismatch attack-info vs none. -(defmethod combine! attack-info ((this attack-info) (arg0 attack-info)) +(defmethod combine! ((this attack-info) (arg0 attack-info)) (with-pp (let ((s4-0 (-> arg0 mask))) (set! (-> this mask) (-> arg0 mask)) diff --git a/test/decompiler/reference/jak1/engine/target/target2_REF.gc b/test/decompiler/reference/jak1/engine/target/target2_REF.gc index 30eb28ccbb7..b874f1adc61 100644 --- a/test/decompiler/reference/jak1/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target2_REF.gc @@ -135,20 +135,16 @@ ;; definition of type first-person-hud (deftype first-person-hud (process) - ((max-nb-of-particles int32 :offset-assert 112) - (nb-of-particles int32 :offset-assert 116) - (particles hud-particle 3 :offset-assert 120) - (in-out-position int32 :offset-assert 132) - (sides-x-scale float :offset-assert 136) - (sides-y-scale float :offset-assert 140) - (x-offset int32 :offset-assert 144) + ((max-nb-of-particles int32) + (nb-of-particles int32) + (particles hud-particle 3) + (in-out-position int32) + (sides-x-scale float) + (sides-y-scale float) + (x-offset int32) ) - :heap-base #x30 - :method-count-assert 15 - :size-assert #x94 - :flag-assert #xf00300094 (:methods - (dumb-15 (_type_) none 14) + (dumb-15 (_type_) none) ) (:states hud-coming-in @@ -159,7 +155,7 @@ ) ;; definition for method 3 of type first-person-hud -(defmethod inspect first-person-hud ((this first-person-hud)) +(defmethod inspect ((this first-person-hud)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -177,7 +173,7 @@ (define *fp-hud-stack* (malloc 'global #x3800)) ;; definition for method 10 of type first-person-hud -(defmethod deactivate first-person-hud ((this first-person-hud)) +(defmethod deactivate ((this first-person-hud)) (dotimes (s5-0 (-> this nb-of-particles)) (kill-and-free-particles (-> this particles s5-0 part)) (set! (-> this particles s5-0 part matrix) -1) @@ -248,7 +244,7 @@ ;; definition for method 7 of type first-person-hud ;; INFO: Return type mismatch process vs first-person-hud. -(defmethod relocate first-person-hud ((this first-person-hud) (arg0 int)) +(defmethod relocate ((this first-person-hud) (arg0 int)) (dotimes (v1-0 (-> this nb-of-particles)) (when (-> this particles v1-0 part) (if (nonzero? (-> this particles v1-0 part)) @@ -261,7 +257,7 @@ ;; definition for method 14 of type first-person-hud ;; INFO: Return type mismatch int vs none. -(defmethod dumb-15 first-person-hud ((this first-person-hud)) +(defmethod dumb-15 ((this first-person-hud)) (dotimes (s5-0 (-> this nb-of-particles)) (set! (-> this particles s5-0 pos x) (+ -256.0 (-> this particles s5-0 init-pos x))) (set! (-> this particles s5-0 pos y) @@ -530,9 +526,7 @@ ) (pad-buttons r2 circle square) ) - (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (time-elapsed? (-> self control unknown-dword82) (seconds 0.5)) (not *pause-lock*) ) @@ -563,7 +557,7 @@ (.lvf vf5 (&-> s5-1 quad)) (.add.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-48 quad) vf6) - (let ((t1-0 (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + (let ((t1-0 (if (>= (-> self fact eco-level) (-> *FACT-bank* eco-level-max)) 56 40 ) @@ -684,9 +678,7 @@ (pad-buttons r2 circle square) ) (time-elapsed? (-> self control unknown-dword82) (seconds 0.45)) - (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (not *pause-lock*) ) (let ((gp-1 (vector-float*! @@ -716,7 +708,7 @@ (.lvf vf5 (&-> s5-1 quad)) (.add.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-48 quad) vf6) - (let ((t1-0 (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + (let ((t1-0 (if (>= (-> self fact eco-level) (-> *FACT-bank* eco-level-max)) 120 104 ) @@ -1391,9 +1383,7 @@ (let ((s5-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)))) (set! (-> s5-2 y) 0.0) (vector-normalize! s5-2 (-> *TARGET-bank* yellow-projectile-speed)) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (let ((gp-1 (get-process *default-dead-pool* projectile-yellow #x4000))) (set! gp-0 (ppointer->handle (when gp-1 @@ -1406,7 +1396,7 @@ (-> self entity) (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node-index eichar-lod0-jg sk_rhand)) s5-2 - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + (if (>= (-> self fact eco-level) (-> *FACT-bank* eco-level-max)) 25 9 ) @@ -1529,7 +1519,7 @@ (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) (the-as float (-> *TARGET-bank* yellow-projectile-speed)) ) - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + (if (>= (-> self fact eco-level) (-> *FACT-bank* eco-level-max)) 16 0 ) @@ -1603,9 +1593,7 @@ (go target-attack-air #f) ) (when (can-hands? #f) - (if (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (if (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (go target-yellow-jump-blast) (go target-running-attack) ) @@ -2179,7 +2167,7 @@ (let ((v1-2 (the-as attack-info (-> block param 1)))) (when (or (not (logtest? (-> v1-2 mask) (attack-mask mode))) (= (-> v1-2 mode) 'generic) (= (-> v1-2 mode) 'drown)) (set! (-> v1-2 mode) 'damage) - (if (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact-info-target health))) + (if (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact health))) (set! (-> v1-2 mode) 'drown-death) ) (logior! (-> v1-2 mask) (attack-mask mode)) @@ -2516,7 +2504,7 @@ (let ((f0-5 (the float (the int (+ 1.0 (/ (- arg0 (-> *TARGET-bank* fall-far)) (-> *TARGET-bank* fall-far-inc)))))) ) (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (* (-> *FACT-bank* health-single-inc) (- (fmax 0.0 f0-5))) (the-as handle #f) @@ -2527,7 +2515,7 @@ ) ) (cond - ((and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + ((and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) (set! (-> self attack-info attacker) (the-as handle #f)) (go target-death 'target-hit-ground-hard) ) diff --git a/test/decompiler/reference/jak1/engine/target/target_REF.gc b/test/decompiler/reference/jak1/engine/target/target_REF.gc index 31ce3e0a2db..9b5eafe39e0 100644 --- a/test/decompiler/reference/jak1/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target_REF.gc @@ -1911,9 +1911,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (effect-control-method-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 74) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) (level-hint-spawn @@ -2006,9 +2004,7 @@ ) ) :enter (behavior () - (if (or (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (if (or (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (not (time-elapsed? (-> self control unknown-dword82) (seconds 1.5))) ) (go target-yellow-blast) @@ -2103,9 +2099,7 @@ (-> self control transv) ) ) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (effect-control-method-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 23) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) (level-hint-spawn @@ -2319,9 +2313,7 @@ (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) ) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (effect-control-method-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 70) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) (level-hint-spawn @@ -2478,9 +2470,7 @@ (go target-attack-air 'uppercut) ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (effect-control-method-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 23) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) ) @@ -2558,9 +2548,7 @@ ) ) :enter (behavior ((arg0 float) (arg1 float) (arg2 float)) - (if (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (if (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (go target-yellow-jump-blast) ) (if (= arg2 0.0) @@ -2615,9 +2603,7 @@ ) (when gp-1 (logior! (-> self control status) (cshape-moving-flags onsurf)) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (effect-control-method-10 (-> self skel effect) 'group-red-eco-strike-ground (ja-frame-num 0) 0) (let ((s5-1 (process-spawn touch-tracker :init touch-tracker-init (-> self control trans) 4096.0 30 :to self))) @@ -2636,9 +2622,7 @@ (go target-flop-hit-ground gp-1) ) ) - (when (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (effect-control-method-10 (-> self skel effect) 'group-red-eco-spinkick @@ -2796,9 +2780,7 @@ (go target-attack-air 'flop) ) ) - (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (and (= (-> self fact eco-type) (pickup-type eco-red)) (>= (-> self fact eco-level) 1.0)) (not (time-elapsed? (-> self state-time) (seconds 0.25))) ) (effect-control-method-10 diff --git a/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc b/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc index 099912eeba7..ed7479d7c55 100644 --- a/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc @@ -127,14 +127,10 @@ ;; definition of type hud-pickups (deftype hud-pickups (hud) () - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x118 - :flag-assert #x1b00b00118 ) ;; definition for method 3 of type hud-pickups -(defmethod inspect hud-pickups ((this hud-pickups)) +(defmethod inspect ((this hud-pickups)) (let ((t9-0 (method-of-type hud inspect))) (t9-0 this) ) @@ -143,7 +139,7 @@ ;; definition for method 15 of type hud-pickups ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud-pickups ((this hud-pickups)) +(defmethod draw-hud ((this hud-pickups)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this) ) @@ -186,9 +182,9 @@ ;; definition for method 19 of type hud-pickups ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-pickups ((this hud-pickups)) +(defmethod hud-update ((this hud-pickups)) (if *target* - (tally-value this (the int (+ 0.5 (-> *target* fact-info-target eco-pill))) 0) + (tally-value this (the int (+ 0.5 (-> *target* fact eco-pill))) 0) ) 0 (none) @@ -196,7 +192,7 @@ ;; definition for method 20 of type hud-pickups ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-pickups ((this hud-pickups) (arg0 int)) +(defmethod init-particles! ((this hud-pickups) (arg0 int)) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) (set! (-> this particles s5-0) (new 'static 'hud-particle)) @@ -296,16 +292,12 @@ ;; definition of type hud-health (deftype hud-health (hud) - ((scale float :offset-assert 280) + ((scale float) ) - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x11c - :flag-assert #x1b00b0011c ) ;; definition for method 3 of type hud-health -(defmethod inspect hud-health ((this hud-health)) +(defmethod inspect ((this hud-health)) (let ((t9-0 (method-of-type hud inspect))) (t9-0 this) ) @@ -321,12 +313,12 @@ (set! (-> arg2 pos x) f0-0) ) (cond - ((and *target* (< (-> *target* fact-info-target health) 1.0)) + ((and *target* (< (-> *target* fact health) 1.0)) (set! (-> arg2 prev-pos x) 32.0) ) (else (let ((f0-3 128.0)) - (when (and *target* (= (-> *target* fact-info-target health) 1.0)) + (when (and *target* (= (-> *target* fact health) 1.0)) (let ((v1-16 (logand (-> *display* integral-frame-counter) 7))) (set! f0-3 (if (not (logtest? (-> *display* integral-frame-counter) 8)) (+ 128.0 (* 18.142857 (the float v1-16))) @@ -353,7 +345,7 @@ (set! (-> arg2 init-pos x) f0-0) (set! (-> arg2 pos x) f0-0) ) - (if (and *target* (< (-> *target* fact-info-target health) 2.0)) + (if (and *target* (< (-> *target* fact health) 2.0)) (set! (-> arg2 prev-pos x) 32.0) (set! (-> arg2 prev-pos x) 128.0) ) @@ -368,7 +360,7 @@ (set! (-> arg2 init-pos x) f0-0) (set! (-> arg2 pos x) f0-0) ) - (if (and *target* (< (-> *target* fact-info-target health) 3.0)) + (if (and *target* (< (-> *target* fact health) 3.0)) (set! (-> arg2 prev-pos x) 32.0) (set! (-> arg2 prev-pos x) 128.0) ) @@ -378,7 +370,7 @@ ;; definition for method 15 of type hud-health ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud-health ((this hud-health)) +(defmethod draw-hud ((this hud-health)) ((method-of-type hud draw-hud) this) 0 (none) @@ -386,13 +378,9 @@ ;; definition for method 19 of type hud-health ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-health ((this hud-health)) +(defmethod hud-update ((this hud-health)) (if *target* - (tally-value - this - (the int (-> *target* fact-info-target health)) - (the-as int (-> *target* fact-info-target health-pickup-time)) - ) + (tally-value this (the int (-> *target* fact health)) (the-as int (-> *target* fact health-pickup-time))) ) 0 (none) @@ -400,7 +388,7 @@ ;; definition for method 20 of type hud-health ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-health ((this hud-health) (arg0 int)) +(defmethod init-particles! ((this hud-health) (arg0 int)) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) (set! (-> this particles s5-0) (new 'static 'hud-particle)) @@ -449,7 +437,7 @@ ;; definition for method 24 of type hud-health ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud-health ((this hud-health) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-health) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> this particles 0 init-pos x) 65.0) @@ -499,21 +487,17 @@ ;; definition of type hud-money-all (deftype hud-money-all (hud) - ((x-scale float :offset-assert 280) - (y-scale float :offset-assert 284) - (y-pos int32 :offset-assert 288) - (total-orbs int32 :offset-assert 292) - (level-index int32 :offset-assert 296) - (start-time time-frame :offset-assert 304) + ((x-scale float) + (y-scale float) + (y-pos int32) + (total-orbs int32) + (level-index int32) + (start-time time-frame) ) - :heap-base #xd0 - :method-count-assert 27 - :size-assert #x138 - :flag-assert #x1b00d00138 ) ;; definition for method 3 of type hud-money-all -(defmethod inspect hud-money-all ((this hud-money-all)) +(defmethod inspect ((this hud-money-all)) (let ((t9-0 (method-of-type hud inspect))) (t9-0 this) ) @@ -528,7 +512,7 @@ ;; definition for method 15 of type hud-money-all ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud-money-all ((this hud-money-all)) +(defmethod draw-hud ((this hud-money-all)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this) ) @@ -617,7 +601,7 @@ ;; definition for method 19 of type hud-money-all ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-money-all ((this hud-money-all)) +(defmethod hud-update ((this hud-money-all)) (when *target* (hide-bottom-hud) (when (!= *master-mode* 'pause) @@ -644,7 +628,7 @@ ;; definition for method 20 of type hud-money-all ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-money-all ((this hud-money-all) (arg0 int)) +(defmethod init-particles! ((this hud-money-all) (arg0 int)) (when (< (-> this nb-of-icons) 6) (let ((s4-0 (-> this nb-of-icons))) (set! (-> this icons s4-0) (new 'static 'hud-icon)) @@ -733,7 +717,7 @@ ;; definition for method 24 of type hud-money-all ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud-money-all ((this hud-money-all) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-money-all) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> this x-scale) 0.01845) @@ -784,18 +768,14 @@ ;; definition of type hud-money (deftype hud-money (hud) - ((x-scale float :offset-assert 280) - (y-scale float :offset-assert 284) - (y-pos int32 :offset-assert 288) + ((x-scale float) + (y-scale float) + (y-pos int32) ) - :heap-base #xc0 - :method-count-assert 27 - :size-assert #x124 - :flag-assert #x1b00c00124 ) ;; definition for method 3 of type hud-money -(defmethod inspect hud-money ((this hud-money)) +(defmethod inspect ((this hud-money)) (let ((t9-0 (method-of-type hud inspect))) (t9-0 this) ) @@ -807,7 +787,7 @@ ;; definition for method 15 of type hud-money ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud-money ((this hud-money)) +(defmethod draw-hud ((this hud-money)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this) ) @@ -850,7 +830,7 @@ ;; definition for method 19 of type hud-money ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-money ((this hud-money)) +(defmethod hud-update ((this hud-money)) (when *target* (when (!= *master-mode* 'pause) (when (and (!= (-> this icons 0) 0) (-> this icons 0 icon)) @@ -873,7 +853,7 @@ ;; definition for method 20 of type hud-money ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-money ((this hud-money) (arg0 int)) +(defmethod init-particles! ((this hud-money) (arg0 int)) (when (< (-> this nb-of-icons) 6) (let ((s5-0 (-> this nb-of-icons))) (set! (-> this icons s5-0) (new 'static 'hud-icon)) @@ -929,7 +909,7 @@ ;; definition for method 24 of type hud-money ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud-money ((this hud-money) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-money) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> this x-scale) 0.0123) @@ -958,22 +938,22 @@ ) ;; definition for method 21 of type hud-money -(defmethod get-icon-pos-x hud-money ((this hud-money)) +(defmethod get-icon-pos-x ((this hud-money)) (-> this icons 0 icon-x) ) ;; definition for method 22 of type hud-money -(defmethod get-icon-pos-y hud-money ((this hud-money)) +(defmethod get-icon-pos-y ((this hud-money)) (-> this icons 0 icon-y) ) ;; definition for method 25 of type hud-money -(defmethod get-icon-scale-x hud-money ((this hud-money)) +(defmethod get-icon-scale-x ((this hud-money)) 0.01 ) ;; definition for method 26 of type hud-money -(defmethod get-icon-scale-y hud-money ((this hud-money)) +(defmethod get-icon-scale-y ((this hud-money)) -0.011 ) @@ -1195,22 +1175,18 @@ ;; definition of type hud-fuel-cell (deftype hud-fuel-cell (hud) - ((scale-starburst-3-x float :offset-assert 280) - (scale-starburst-3-y float :offset-assert 284) - (scale-starburst-4-x float :offset-assert 288) - (scale-starburst-4-y float :offset-assert 292) - (scale-icon float :offset-assert 296) - (scale-center float :offset-assert 300) - (icon-pos-y int32 :offset-assert 304) + ((scale-starburst-3-x float) + (scale-starburst-3-y float) + (scale-starburst-4-x float) + (scale-starburst-4-y float) + (scale-icon float) + (scale-center float) + (icon-pos-y int32) ) - :heap-base #xd0 - :method-count-assert 27 - :size-assert #x134 - :flag-assert #x1b00d00134 ) ;; definition for method 3 of type hud-fuel-cell -(defmethod inspect hud-fuel-cell ((this hud-fuel-cell)) +(defmethod inspect ((this hud-fuel-cell)) (let ((t9-0 (method-of-type hud inspect))) (t9-0 this) ) @@ -1226,7 +1202,7 @@ ;; definition for method 15 of type hud-fuel-cell ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud-fuel-cell ((this hud-fuel-cell)) +(defmethod draw-hud ((this hud-fuel-cell)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this) ) @@ -1321,7 +1297,7 @@ ;; definition for method 19 of type hud-fuel-cell ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-fuel-cell ((this hud-fuel-cell)) +(defmethod hud-update ((this hud-fuel-cell)) (when *target* (when (!= *master-mode* 'pause) (let ((a0-2 (-> this icons 0 icon 0 root))) @@ -1346,7 +1322,7 @@ ;; definition for method 20 of type hud-fuel-cell ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-fuel-cell ((this hud-fuel-cell) (arg0 int)) +(defmethod init-particles! ((this hud-fuel-cell) (arg0 int)) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) (set! (-> this particles s5-0) (new 'static 'hud-particle)) @@ -1407,7 +1383,7 @@ ;; definition for method 24 of type hud-fuel-cell ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud-fuel-cell ((this hud-fuel-cell) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-fuel-cell) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> this scale-starburst-3-x) 10240.0) @@ -1488,17 +1464,13 @@ ;; definition of type hud-buzzers (deftype hud-buzzers (hud) - ((scale float :offset-assert 280) - (text-y-offset int32 :offset-assert 284) + ((scale float) + (text-y-offset int32) ) - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x120 - :flag-assert #x1b00b00120 ) ;; definition for method 3 of type hud-buzzers -(defmethod inspect hud-buzzers ((this hud-buzzers)) +(defmethod inspect ((this hud-buzzers)) (let ((t9-0 (method-of-type hud inspect))) (t9-0 this) ) @@ -1519,7 +1491,7 @@ ;; definition for method 15 of type hud-buzzers ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud-buzzers ((this hud-buzzers)) +(defmethod draw-hud ((this hud-buzzers)) (let ((t9-0 (method-of-type hud draw-hud))) (t9-0 this) ) @@ -1569,9 +1541,9 @@ ;; definition for method 19 of type hud-buzzers ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-buzzers ((this hud-buzzers)) +(defmethod hud-update ((this hud-buzzers)) (if *target* - (tally-value this (the int (+ 0.5 (-> *target* fact-info-target buzzer))) 0) + (tally-value this (the int (+ 0.5 (-> *target* fact buzzer))) 0) ) 0 (none) @@ -1579,7 +1551,7 @@ ;; definition for method 20 of type hud-buzzers ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-buzzers ((this hud-buzzers) (arg0 int)) +(defmethod init-particles! ((this hud-buzzers) (arg0 int)) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) (set! (-> this particles s5-0) (new 'static 'hud-particle)) @@ -1608,12 +1580,12 @@ ) ;; definition for method 21 of type hud-buzzers -(defmethod get-icon-pos-x hud-buzzers ((this hud-buzzers)) +(defmethod get-icon-pos-x ((this hud-buzzers)) (-> this text-x) ) ;; definition for method 22 of type hud-buzzers -(defmethod get-icon-pos-y hud-buzzers ((this hud-buzzers)) +(defmethod get-icon-pos-y ((this hud-buzzers)) (+ (if (= (-> *setting-control* current video-mode) 'pal) (+ (-> this text-y) 120) (+ (-> this text-y) 50) @@ -1623,18 +1595,18 @@ ) ;; definition for method 25 of type hud-buzzers -(defmethod get-icon-scale-x hud-buzzers ((this hud-buzzers)) +(defmethod get-icon-scale-x ((this hud-buzzers)) 0.008 ) ;; definition for method 26 of type hud-buzzers -(defmethod get-icon-scale-y hud-buzzers ((this hud-buzzers)) +(defmethod get-icon-scale-y ((this hud-buzzers)) -0.008 ) ;; definition for method 24 of type hud-buzzers ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud-buzzers ((this hud-buzzers) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-buzzers) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> this scale) 6553.6) @@ -1756,18 +1728,14 @@ ;; definition of type hud-power (deftype hud-power (hud) - ((scale-timer float :offset-assert 280) - (scale-backing float :offset-assert 284) - (scale-blue float :offset-assert 288) + ((scale-timer float) + (scale-backing float) + (scale-blue float) ) - :heap-base #xc0 - :method-count-assert 27 - :size-assert #x124 - :flag-assert #x1b00c00124 ) ;; definition for method 3 of type hud-power -(defmethod inspect hud-power ((this hud-power)) +(defmethod inspect ((this hud-power)) (let ((t9-0 (method-of-type hud inspect))) (t9-0 this) ) @@ -1824,12 +1792,10 @@ (defun part-hud-eco-timer-01-func ((arg0 basic) (arg1 basic) (arg2 hud-particle)) (let ((f0-2 (/ (the float - (the-as - uint - (- (-> *target* fact-info-target eco-timeout) - (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact-info-target eco-pickup-time))) - ) - ) + (the-as uint (- (-> *target* fact eco-timeout) + (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))) + ) + ) ) (the float (the-as uint (-> *FACT-bank* eco-full-timeout))) ) @@ -1838,7 +1804,7 @@ (a3-0 64) (t0-0 128) ) - (case (-> *target* fact-info-target eco-type) + (case (-> *target* fact eco-type) (((pickup-type eco-yellow)) (set! a2-1 128) (set! a3-0 96) @@ -1870,12 +1836,10 @@ (defun part-hud-eco-timer-02-func ((arg0 basic) (arg1 basic) (arg2 hud-particle)) (let ((f0-2 (/ (the float - (the-as - uint - (- (-> *target* fact-info-target eco-timeout) - (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact-info-target eco-pickup-time))) - ) - ) + (the-as uint (- (-> *target* fact eco-timeout) + (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))) + ) + ) ) (the float (the-as uint (-> *FACT-bank* eco-full-timeout))) ) @@ -1884,7 +1848,7 @@ (a3-0 64) (t0-0 128) ) - (case (-> *target* fact-info-target eco-type) + (case (-> *target* fact eco-type) (((pickup-type eco-yellow)) (set! a2-1 128) (set! a3-0 96) @@ -1916,12 +1880,10 @@ (defun part-hud-eco-timer-03-func ((arg0 basic) (arg1 basic) (arg2 hud-particle)) (let ((f0-2 (/ (the float - (the-as - uint - (- (-> *target* fact-info-target eco-timeout) - (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact-info-target eco-pickup-time))) - ) - ) + (the-as uint (- (-> *target* fact eco-timeout) + (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))) + ) + ) ) (the float (the-as uint (-> *FACT-bank* eco-full-timeout))) ) @@ -1930,7 +1892,7 @@ (a3-0 64) (t0-0 128) ) - (case (-> *target* fact-info-target eco-type) + (case (-> *target* fact eco-type) (((pickup-type eco-yellow)) (set! a2-1 128) (set! a3-0 96) @@ -1981,23 +1943,21 @@ ;; definition for method 19 of type hud-power ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-power ((this hud-power)) +(defmethod hud-update ((this hud-power)) (if *target* (tally-value this (max 0 (min - (the-as - int - (- (-> *target* fact-info-target eco-timeout) - (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact-info-target eco-pickup-time))) - ) - ) - (the-as int (-> *target* fact-info-target eco-timeout)) + (the-as int (- (-> *target* fact eco-timeout) + (the-as uint (- (-> *display* game-frame-counter) (-> *target* fact eco-pickup-time))) + ) + ) + (the-as int (-> *target* fact eco-timeout)) ) ) - (the-as int (-> *target* fact-info-target eco-timeout)) + (the-as int (-> *target* fact eco-timeout)) ) ) 0 @@ -2006,7 +1966,7 @@ ;; definition for method 20 of type hud-power ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-power ((this hud-power) (arg0 int)) +(defmethod init-particles! ((this hud-power) (arg0 int)) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) (set! (-> this particles s5-0) (new 'static 'hud-particle)) @@ -2054,7 +2014,7 @@ ;; definition for method 24 of type hud-power ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud-power ((this hud-power) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud-power) (arg0 symbol) (arg1 symbol)) (cond (arg0 (set! (-> this scale-blue) 7168.0) diff --git a/test/decompiler/reference/jak1/engine/ui/hud-h_REF.gc b/test/decompiler/reference/jak1/engine/ui/hud-h_REF.gc index cd588695d51..02487383b61 100644 --- a/test/decompiler/reference/jak1/engine/ui/hud-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/hud-h_REF.gc @@ -3,20 +3,17 @@ ;; definition of type hud-icon (deftype hud-icon (basic) - ((icon (pointer manipy) :offset-assert 4) - (icon-y int32 :offset-assert 8) - (icon-x int32 :offset-assert 12) - (icon-z int32 :offset-assert 16) - (scale-x float :offset-assert 20) - (scale-y float :offset-assert 24) + ((icon (pointer manipy)) + (icon-y int32) + (icon-x int32) + (icon-z int32) + (scale-x float) + (scale-y float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type hud-icon -(defmethod inspect hud-icon ((this hud-icon)) +(defmethod inspect ((this hud-icon)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ticon: #x~X~%" (-> this icon)) (format #t "~Ticon-y: ~D~%" (-> this icon-y)) @@ -29,18 +26,15 @@ ;; definition of type hud-particle (deftype hud-particle (basic) - ((part sparticle-launch-control :offset-assert 4) - (init-pos vector :inline :offset-assert 16) - (pos vector :inline :offset-assert 32) - (prev-pos vector :inline :offset-assert 48) + ((part sparticle-launch-control) + (init-pos vector :inline) + (pos vector :inline) + (prev-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type hud-particle -(defmethod inspect hud-particle ((this hud-particle)) +(defmethod inspect ((this hud-particle)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tpart: ~A~%" (-> this part)) (format #t "~Tinit-pos: #~%" (-> this init-pos)) @@ -51,51 +45,47 @@ ;; definition of type hud (deftype hud (process) - ((value int32 :offset-assert 112) - (value2 int32 :offset-assert 116) - (target-value int32 :offset-assert 120) - (last-increment-time time-frame :offset-assert 128) - (last-target-equal-time time-frame :offset-assert 136) - (offset int32 :offset-assert 144) - (y-offset int32 :offset-assert 148) - (next-y-offset int32 :offset-assert 152) - (x-sgn int32 :offset-assert 156) - (y-sgn int32 :offset-assert 160) - (text-x int32 :offset-assert 164) - (text-y int32 :offset-assert 168) - (friend int32 :offset-assert 172) - (first-init symbol :offset-assert 176) - (increment-on-event symbol :offset-assert 180) - (skip-particle int32 :offset-assert 184) - (disable symbol :offset-assert 188) - (force-on-screen symbol :offset-assert 192) - (deactivate-when-hidden symbol :offset-assert 196) - (trigger-time time-frame :offset-assert 200) - (last-hide-time time-frame :offset-assert 208) - (nb-of-icons int32 :offset-assert 216) - (icons hud-icon 6 :offset-assert 220) - (max-nb-of-particles int32 :offset-assert 244) - (nb-of-particles int32 :offset-assert 248) - (particles hud-particle 7 :offset-assert 252) + ((value int32) + (value2 int32) + (target-value int32) + (last-increment-time time-frame) + (last-target-equal-time time-frame) + (offset int32) + (y-offset int32) + (next-y-offset int32) + (x-sgn int32) + (y-sgn int32) + (text-x int32) + (text-y int32) + (friend int32) + (first-init symbol) + (increment-on-event symbol) + (skip-particle int32) + (disable symbol) + (force-on-screen symbol) + (deactivate-when-hidden symbol) + (trigger-time time-frame) + (last-hide-time time-frame) + (nb-of-icons int32) + (icons hud-icon 6) + (max-nb-of-particles int32) + (nb-of-particles int32) + (particles hud-particle 7) ) - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x118 - :flag-assert #x1b00b00118 (:methods - (hidden? (_type_) symbol 14) - (draw-hud (_type_) none 15) - (tally-value (_type_ int int) none 16) - (draw-icons (_type_) none 17) - (draw-particles (_type_) none 18) - (hud-update (_type_) none 19) - (init-particles! (_type_ int) none 20) - (get-icon-pos-x (_type_) int 21) - (get-icon-pos-y (_type_) int 22) - (hud-method-23 (_type_) none 23) - (set-pos-and-scale (_type_ symbol symbol) none 24) - (get-icon-scale-x (_type_) float 25) - (get-icon-scale-y (_type_) float 26) + (hidden? (_type_) symbol) + (draw-hud (_type_) none) + (tally-value (_type_ int int) none) + (draw-icons (_type_) none) + (draw-particles (_type_) none) + (hud-update (_type_) none) + (init-particles! (_type_ int) none) + (get-icon-pos-x (_type_) int) + (get-icon-pos-y (_type_) int) + (hud-method-23 (_type_) none) + (set-pos-and-scale (_type_ symbol symbol) none) + (get-icon-scale-x (_type_) float) + (get-icon-scale-y (_type_) float) ) (:states hud-arriving @@ -106,7 +96,7 @@ ) ;; definition for method 3 of type hud -(defmethod inspect hud ((this hud)) +(defmethod inspect ((this hud)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -141,24 +131,21 @@ ;; definition of type hud-parts (deftype hud-parts (structure) - ((pickups (pointer hud-pickups) :offset-assert 0) - (money (pointer hud-money) :offset-assert 4) - (fuel-cell (pointer hud-fuel-cell) :offset-assert 8) - (health (pointer hud-health) :offset-assert 12) - (buzzers (pointer hud-buzzers) :offset-assert 16) - (power (pointer hud-power) :offset-assert 20) - (bike-speed (pointer hud-bike-speed) :offset-assert 24) - (bike-heat (pointer hud-bike-heat) :offset-assert 28) - (money-all (pointer hud-money-all) :offset-assert 32) - (parts (pointer hud) 9 :offset 0) + ((pickups (pointer hud-pickups)) + (money (pointer hud-money)) + (fuel-cell (pointer hud-fuel-cell)) + (health (pointer hud-health)) + (buzzers (pointer hud-buzzers)) + (power (pointer hud-power)) + (bike-speed (pointer hud-bike-speed)) + (bike-heat (pointer hud-bike-heat)) + (money-all (pointer hud-money-all)) + (parts (pointer hud) 9 :overlay-at pickups) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type hud-parts -(defmethod inspect hud-parts ((this hud-parts)) +(defmethod inspect ((this hud-parts)) (format #t "[~8x] ~A~%" this 'hud-parts) (format #t "~Tdata[9] @ #x~X~%" (&-> this pickups)) (format #t "~Tpickups: #x~X~%" (-> this pickups)) diff --git a/test/decompiler/reference/jak1/engine/ui/hud_REF.gc b/test/decompiler/reference/jak1/engine/ui/hud_REF.gc index 253a5c3d312..407c4937b90 100644 --- a/test/decompiler/reference/jak1/engine/ui/hud_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/hud_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 7 of type hud ;; INFO: Return type mismatch process vs hud. -(defmethod relocate hud ((this hud) (arg0 int)) +(defmethod relocate ((this hud) (arg0 int)) (dotimes (v1-0 (-> this nb-of-particles)) (if (nonzero? (-> this particles v1-0 part)) (&+! (-> this particles v1-0 part) arg0) @@ -13,7 +13,7 @@ ) ;; definition for method 10 of type hud -(defmethod deactivate hud ((this hud)) +(defmethod deactivate ((this hud)) (dotimes (v1-0 9) (if (and (-> *hud-parts* parts v1-0) (= (ppointer->process (-> *hud-parts* parts v1-0)) this)) (set! (-> *hud-parts* parts v1-0) (the-as (pointer hud) #f)) @@ -29,7 +29,7 @@ ;; definition for method 15 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud ((this hud)) +(defmethod draw-hud ((this hud)) (when (and (not (hidden? this)) (not (paused?))) (dotimes (s5-0 (-> this nb-of-particles)) (when (!= s5-0 (-> this skip-particle)) @@ -45,7 +45,7 @@ ;; definition for method 16 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod tally-value hud ((this hud) (arg0 int) (arg1 int)) +(defmethod tally-value ((this hud) (arg0 int) (arg1 int)) (if (= arg0 (-> this target-value)) (set-time! (-> this last-target-equal-time)) ) @@ -102,7 +102,7 @@ ;; definition for method 17 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod draw-icons hud ((this hud)) +(defmethod draw-icons ((this hud)) (dotimes (v1-0 (-> this nb-of-icons)) (set-vector! (-> this icons v1-0 icon 0 root scale) @@ -133,7 +133,7 @@ ;; definition for method 18 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod draw-particles hud ((this hud)) +(defmethod draw-particles ((this hud)) (dotimes (s5-0 (-> this nb-of-particles)) (when (!= (-> this skip-particle) -2) (set! (-> this particles s5-0 pos x) @@ -168,47 +168,47 @@ ;; definition for method 19 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud ((this hud)) +(defmethod hud-update ((this hud)) 0 (none) ) ;; definition for method 20 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud ((this hud) (arg0 int)) +(defmethod init-particles! ((this hud) (arg0 int)) 0 (none) ) ;; definition for method 21 of type hud -(defmethod get-icon-pos-x hud ((this hud)) +(defmethod get-icon-pos-x ((this hud)) 0 ) ;; definition for method 22 of type hud -(defmethod get-icon-pos-y hud ((this hud)) +(defmethod get-icon-pos-y ((this hud)) 0 ) ;; definition for method 25 of type hud -(defmethod get-icon-scale-x hud ((this hud)) +(defmethod get-icon-scale-x ((this hud)) 0.0 ) ;; definition for method 26 of type hud -(defmethod get-icon-scale-y hud ((this hud)) +(defmethod get-icon-scale-y ((this hud)) 0.0 ) ;; definition for method 24 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud ((this hud) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale ((this hud) (arg0 symbol) (arg1 symbol)) 0 (none) ) ;; definition for method 14 of type hud -(defmethod hidden? hud ((this hud)) +(defmethod hidden? ((this hud)) (= (-> this next-state name) 'hud-hidden) ) diff --git a/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc index 76be18f8db6..86e338be56f 100644 --- a/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc @@ -12,7 +12,7 @@ ;; definition for method 24 of type progress ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod draw-fuel-cell-screen progress ((this progress) (arg0 int)) +(defmethod draw-fuel-cell-screen ((this progress) (arg0 int)) (local-vars (sv-112 int) (sv-128 int) @@ -190,7 +190,7 @@ ;; definition for method 25 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-money-screen progress ((this progress) (arg0 int)) +(defmethod draw-money-screen ((this progress) (arg0 int)) (hide-progress-icons) (let* ((v1-1 (/ (-> this transition-offset) 16)) (s4-0 (if (= (-> this level-transition) 1) @@ -275,7 +275,7 @@ ;; definition for method 26 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-buzzer-screen progress ((this progress) (arg0 int)) +(defmethod draw-buzzer-screen ((this progress) (arg0 int)) (hide-progress-icons) (let* ((v1-2 (-> *level-task-data* arg0)) (a0-3 (/ (-> this transition-offset) 16)) @@ -355,7 +355,7 @@ ;; definition for method 35 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-storage-error progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-storage-error ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.55) ) @@ -425,7 +425,7 @@ ;; definition for method 49 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-format progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-format ((this progress) (arg0 font-context)) (set! (-> arg0 origin y) 35.0) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.55) @@ -474,7 +474,7 @@ ;; definition for method 36 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-data-exists progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-data-exists ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.65) ) @@ -512,7 +512,7 @@ ;; definition for method 37 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-no-data progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-no-data ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.65) ) @@ -548,7 +548,7 @@ ;; definition for method 38 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-accessing progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-accessing ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 1.0) ) @@ -599,7 +599,7 @@ ;; definition for method 39 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-insert progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-insert ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.65) ) @@ -636,7 +636,7 @@ ;; definition for method 40 of type progress ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-file-select progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-file-select ((this progress) (arg0 font-context)) (local-vars (sv-16 (function _varargs_ object)) (sv-32 (function _varargs_ object)) @@ -921,7 +921,7 @@ ;; definition for method 41 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-auto-save-error progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-auto-save-error ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.6) ) @@ -997,7 +997,7 @@ ;; definition for method 42 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-removed progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-removed ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.6) ) @@ -1060,7 +1060,7 @@ ;; definition for method 43 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-error progress ((this progress) (arg0 font-context)) +(defmethod draw-memcard-error ((this progress) (arg0 font-context)) (set! (-> arg0 origin y) 15.0) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.7) @@ -1120,7 +1120,7 @@ ;; definition for method 50 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-auto-save progress ((this progress) (arg0 font-context)) +(defmethod draw-auto-save ((this progress) (arg0 font-context)) (set! (-> arg0 origin x) (the float (- 35 (-> this left-x-offset)))) (set! (-> arg0 origin y) 18.0) (let ((v1-2 arg0)) @@ -1188,7 +1188,7 @@ ;; definition for method 54 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-pal-change-to-60hz progress ((this progress) (arg0 font-context)) +(defmethod draw-pal-change-to-60hz ((this progress) (arg0 font-context)) (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 20.0) (let ((v1-2 arg0)) @@ -1250,7 +1250,7 @@ ;; definition for method 56 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-no-disc progress ((this progress) (arg0 font-context)) +(defmethod draw-no-disc ((this progress) (arg0 font-context)) (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 50.0) (let ((v1-2 arg0)) @@ -1304,7 +1304,7 @@ ;; definition for method 57 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-bad-disc progress ((this progress) (arg0 font-context)) +(defmethod draw-bad-disc ((this progress) (arg0 font-context)) (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 50.0) (let ((v1-2 arg0)) @@ -1356,7 +1356,7 @@ ;; definition for method 58 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-quit progress ((this progress) (arg0 font-context)) +(defmethod draw-quit ((this progress) (arg0 font-context)) (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 70.0) (let ((v1-2 arg0)) @@ -1381,7 +1381,7 @@ ;; definition for method 55 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-pal-now-60hz progress ((this progress) (arg0 font-context)) +(defmethod draw-pal-now-60hz ((this progress) (arg0 font-context)) (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 45.0) (let ((v1-2 arg0)) @@ -1416,7 +1416,7 @@ ;; definition for method 27 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-notice-screen progress ((this progress)) +(defmethod draw-notice-screen ((this progress)) (hide-progress-icons) (when *common-text* (let ((a1-1 (new @@ -1551,7 +1551,7 @@ ;; definition for method 28 of type progress ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod draw-options progress ((this progress) (arg0 int) (arg1 int) (arg2 float)) +(defmethod draw-options ((this progress) (arg0 int) (arg1 int) (arg2 float)) (local-vars (sv-112 font-context) (sv-128 int) @@ -1983,7 +1983,7 @@ ;; definition for method 17 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-progress progress ((this progress)) +(defmethod draw-progress ((this progress)) (let ((f30-0 (+ -409.0 (-> this particles 2 init-pos x) (* 0.8 (the float (-> this left-x-offset))))) (s5-0 (if (or (-> this stat-transition) (nonzero? (-> this level-transition))) 0 @@ -2023,7 +2023,7 @@ ) ) (let ((s2-2 draw-string-xy)) - (format (clear *temp-string*) "~D" (the int (+ 0.5 (-> *target* fact-info-target buzzer)))) + (format (clear *temp-string*) "~D" (the int (+ 0.5 (-> *target* fact buzzer)))) (s2-2 *temp-string* s3-0 diff --git a/test/decompiler/reference/jak1/engine/ui/progress/progress-h_REF.gc b/test/decompiler/reference/jak1/engine/ui/progress/progress-h_REF.gc index ab4fa423c87..9131870addf 100644 --- a/test/decompiler/reference/jak1/engine/ui/progress/progress-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/progress/progress-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type count-info (deftype count-info (structure) - ((money-count int32 :offset-assert 0) - (buzzer-count int32 :offset-assert 4) + ((money-count int32) + (buzzer-count int32) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type count-info -(defmethod inspect count-info ((this count-info)) +(defmethod inspect ((this count-info)) (format #t "[~8x] ~A~%" this 'count-info) (format #t "~Tmoney-count: ~D~%" (-> this money-count)) (format #t "~Tbuzzer-count: ~D~%" (-> this buzzer-count)) @@ -22,16 +19,13 @@ ;; definition of type game-count-info (deftype game-count-info (basic) - ((length int32 :offset-assert 4) - (data count-info :inline :dynamic :offset-assert 8) + ((length int32) + (data count-info :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type game-count-info -(defmethod inspect game-count-info ((this game-count-info)) +(defmethod inspect ((this game-count-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tdata[0] @ #x~X~%" (-> this data)) @@ -40,17 +34,14 @@ ;; definition of type task-info-data (deftype task-info-data (basic) - ((task-id game-task :offset-assert 4) - (task-name text-id 4 :offset-assert 8) - (text-index-when-resolved int32 :offset-assert 24) + ((task-id game-task) + (task-name text-id 4) + (text-index-when-resolved int32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type task-info-data -(defmethod inspect task-info-data ((this task-info-data)) +(defmethod inspect ((this task-info-data)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttask-id: ~D~%" (-> this task-id)) (format #t "~Ttask-name[4] @ #x~X~%" (-> this task-name)) @@ -60,19 +51,16 @@ ;; definition of type level-tasks-info (deftype level-tasks-info (basic) - ((level-name-id text-id :offset-assert 4) - (text-group-index int32 :offset-assert 8) - (nb-of-tasks int32 :offset-assert 12) - (buzzer-task-index int32 :offset-assert 16) - (task-info task-info-data 8 :offset-assert 20) + ((level-name-id text-id) + (text-group-index int32) + (nb-of-tasks int32) + (buzzer-task-index int32) + (task-info task-info-data 8) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type level-tasks-info -(defmethod inspect level-tasks-info ((this level-tasks-info)) +(defmethod inspect ((this level-tasks-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlevel-name-id: ~D~%" (-> this level-name-id)) (format #t "~Ttext-group-index: ~D~%" (-> this text-group-index)) @@ -84,21 +72,18 @@ ;; definition of type game-option (deftype game-option (basic) - ((option-type game-option-type :offset-assert 8) - (name text-id :offset-assert 16) - (scale symbol :offset-assert 20) - (param1 float :offset-assert 24) - (param2 float :offset-assert 28) - (param3 game-option-menu :offset-assert 32) - (value-to-modify pointer :offset-assert 36) + ((option-type game-option-type) + (name text-id) + (scale symbol) + (param1 float) + (param2 float) + (param3 game-option-menu) + (value-to-modify pointer) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; definition for method 3 of type game-option -(defmethod inspect game-option ((this game-option)) +(defmethod inspect ((this game-option)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Toption-type: ~D~%" (-> this option-type)) (format #t "~Tname: ~D~%" (-> this name)) @@ -112,111 +97,107 @@ ;; definition of type progress (deftype progress (process) - ((current-debug-string int32 :offset-assert 112) - (current-debug-language int32 :offset-assert 116) - (current-debug-group int32 :offset-assert 120) - (in-out-position int32 :offset-assert 124) - (display-state progress-screen :offset-assert 128) - (next-display-state progress-screen :offset-assert 136) - (option-index int32 :offset-assert 144) - (selected-option basic :offset-assert 148) - (completion-percentage float :offset-assert 152) - (ready-to-run basic :offset-assert 156) - (display-level-index int32 :offset-assert 160) - (next-level-index int32 :offset-assert 164) - (task-index int32 :offset-assert 168) - (in-transition basic :offset-assert 172) - (last-in-transition basic :offset-assert 176) - (force-transition basic :offset-assert 180) - (stat-transition basic :offset-assert 184) - (level-transition int32 :offset-assert 188) - (language-selection language-enum :offset-assert 192) - (language-direction symbol :offset-assert 200) - (language-transition basic :offset-assert 204) - (language-x-offset int32 :offset-assert 208) - (sides-x-scale float :offset-assert 212) - (sides-y-scale float :offset-assert 216) - (left-x-offset int32 :offset-assert 220) - (right-x-offset int32 :offset-assert 224) - (button-scale float :offset-assert 228) - (slot-scale float :offset-assert 232) - (left-side-x-scale float :offset-assert 236) - (left-side-y-scale float :offset-assert 240) - (right-side-x-scale float :offset-assert 244) - (right-side-y-scale float :offset-assert 248) - (small-orb-y-offset int32 :offset-assert 252) - (big-orb-y-offset int32 :offset-assert 256) - (transition-offset int32 :offset-assert 260) - (transition-offset-invert int32 :offset-assert 264) - (transition-percentage float :offset-assert 268) - (transition-percentage-invert float :offset-assert 272) - (transition-speed float :offset-assert 276) - (total-nb-of-power-cells int32 :offset-assert 280) - (total-nb-of-orbs int32 :offset-assert 284) - (total-nb-of-buzzers int32 :offset-assert 288) - (card-info mc-slot-info :offset-assert 292) - (last-option-index-change time-frame :offset-assert 296) - (video-mode-timeout time-frame :offset-assert 304) - (display-state-stack progress-screen 5 :offset-assert 312) - (option-index-stack int32 5 :offset-assert 352) - (display-state-pos int32 :offset-assert 372) - (nb-of-icons int32 :offset-assert 376) - (icons hud-icon 6 :offset-assert 380) - (max-nb-of-particles int32 :offset-assert 404) - (nb-of-particles int32 :offset-assert 408) - (particles hud-particle 40 :offset-assert 412) - (particle-state int32 40 :offset-assert 572) + ((current-debug-string int32) + (current-debug-language int32) + (current-debug-group int32) + (in-out-position int32) + (display-state progress-screen) + (next-display-state progress-screen) + (option-index int32) + (selected-option basic) + (completion-percentage float) + (ready-to-run basic) + (display-level-index int32) + (next-level-index int32) + (task-index int32) + (in-transition basic) + (last-in-transition basic) + (force-transition basic) + (stat-transition basic) + (level-transition int32) + (language-selection language-enum) + (language-direction symbol) + (language-transition basic) + (language-x-offset int32) + (sides-x-scale float) + (sides-y-scale float) + (left-x-offset int32) + (right-x-offset int32) + (button-scale float) + (slot-scale float) + (left-side-x-scale float) + (left-side-y-scale float) + (right-side-x-scale float) + (right-side-y-scale float) + (small-orb-y-offset int32) + (big-orb-y-offset int32) + (transition-offset int32) + (transition-offset-invert int32) + (transition-percentage float) + (transition-percentage-invert float) + (transition-speed float) + (total-nb-of-power-cells int32) + (total-nb-of-orbs int32) + (total-nb-of-buzzers int32) + (card-info mc-slot-info) + (last-option-index-change time-frame) + (video-mode-timeout time-frame) + (display-state-stack progress-screen 5) + (option-index-stack int32 5) + (display-state-pos int32) + (nb-of-icons int32) + (icons hud-icon 6) + (max-nb-of-particles int32) + (nb-of-particles int32) + (particles hud-particle 40) + (particle-state int32 40) ) - :heap-base #x270 - :method-count-assert 59 - :size-assert #x2dc - :flag-assert #x3b027002dc (:methods - (progress-method-14 (_type_) none 14) - (progress-method-15 (_type_) none 15) - (progress-method-16 (_type_) none 16) - (draw-progress (_type_) none 17) - (progress-method-18 () none 18) - (visible? (_type_) symbol 19) - (hidden? (_type_) symbol 20) - (adjust-sprites (_type_) none 21) - (adjust-icons (_type_) none 22) - (adjust-ratios (_type_ symbol symbol) none 23) - (draw-fuel-cell-screen (_type_ int) none 24) - (draw-money-screen (_type_ int) none 25) - (draw-buzzer-screen (_type_ int) none 26) - (draw-notice-screen (_type_) none 27) - (draw-options (_type_ int int float) none 28) - (respond-common (_type_) none 29) - (respond-progress (_type_) none 30) - (respond-memcard (_type_) none 31) - (can-go-back? (_type_) symbol 32) - (initialize-icons (_type_) none 33) - (initialize-particles (_type_) none 34) - (draw-memcard-storage-error (_type_ font-context) none 35) - (draw-memcard-data-exists (_type_ font-context) none 36) - (draw-memcard-no-data (_type_ font-context) none 37) - (draw-memcard-accessing (_type_ font-context) none 38) - (draw-memcard-insert (_type_ font-context) none 39) - (draw-memcard-file-select (_type_ font-context) none 40) - (draw-memcard-auto-save-error (_type_ font-context) none 41) - (draw-memcard-removed (_type_ font-context) none 42) - (draw-memcard-error (_type_ font-context) none 43) - (progress-method-44 (_type_) none 44) - (push! (_type_) none 45) - (pop! (_type_) none 46) - (progress-method-47 (_type_) none 47) - (enter! (_type_ progress-screen int) none 48) - (draw-memcard-format (_type_ font-context) none 49) - (draw-auto-save (_type_ font-context) none 50) - (set-transition-progress! (_type_ int) none 51) - (set-transition-speed! (_type_) none 52) - (set-memcard-screen (_type_ progress-screen) progress-screen 53) - (draw-pal-change-to-60hz (_type_ font-context) none 54) - (draw-pal-now-60hz (_type_ font-context) none 55) - (draw-no-disc (_type_ font-context) none 56) - (draw-bad-disc (_type_ font-context) none 57) - (draw-quit (_type_ font-context) none 58) + (progress-method-14 (_type_) none) + (progress-method-15 (_type_) none) + (progress-method-16 (_type_) none) + (draw-progress (_type_) none) + (progress-method-18 () none) + (visible? (_type_) symbol) + (hidden? (_type_) symbol) + (adjust-sprites (_type_) none) + (adjust-icons (_type_) none) + (adjust-ratios (_type_ symbol symbol) none) + (draw-fuel-cell-screen (_type_ int) none) + (draw-money-screen (_type_ int) none) + (draw-buzzer-screen (_type_ int) none) + (draw-notice-screen (_type_) none) + (draw-options (_type_ int int float) none) + (respond-common (_type_) none) + (respond-progress (_type_) none) + (respond-memcard (_type_) none) + (can-go-back? (_type_) symbol) + (initialize-icons (_type_) none) + (initialize-particles (_type_) none) + (draw-memcard-storage-error (_type_ font-context) none) + (draw-memcard-data-exists (_type_ font-context) none) + (draw-memcard-no-data (_type_ font-context) none) + (draw-memcard-accessing (_type_ font-context) none) + (draw-memcard-insert (_type_ font-context) none) + (draw-memcard-file-select (_type_ font-context) none) + (draw-memcard-auto-save-error (_type_ font-context) none) + (draw-memcard-removed (_type_ font-context) none) + (draw-memcard-error (_type_ font-context) none) + (progress-method-44 (_type_) none) + (push! (_type_) none) + (pop! (_type_) none) + (progress-method-47 (_type_) none) + (enter! (_type_ progress-screen int) none) + (draw-memcard-format (_type_ font-context) none) + (draw-auto-save (_type_ font-context) none) + (set-transition-progress! (_type_ int) none) + (set-transition-speed! (_type_) none) + (set-memcard-screen (_type_ progress-screen) progress-screen) + (draw-pal-change-to-60hz (_type_ font-context) none) + (draw-pal-now-60hz (_type_ font-context) none) + (draw-no-disc (_type_ font-context) none) + (draw-bad-disc (_type_ font-context) none) + (draw-quit (_type_ font-context) none) ) (:states progress-coming-in @@ -229,7 +210,7 @@ ) ;; definition for method 3 of type progress -(defmethod inspect progress ((this progress)) +(defmethod inspect ((this progress)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/engine/ui/progress/progress-part_REF.gc b/test/decompiler/reference/jak1/engine/ui/progress/progress-part_REF.gc index ef543231800..2c794d4738b 100644 --- a/test/decompiler/reference/jak1/engine/ui/progress/progress-part_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/progress/progress-part_REF.gc @@ -958,7 +958,7 @@ ;; definition for method 34 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod initialize-particles progress ((this progress)) +(defmethod initialize-particles ((this progress)) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) (set! (-> this particles s5-0) (new 'static 'hud-particle)) diff --git a/test/decompiler/reference/jak1/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak1/engine/ui/progress/progress_REF.gc index 87a045eabff..b1bec610339 100644 --- a/test/decompiler/reference/jak1/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/progress/progress_REF.gc @@ -3,27 +3,24 @@ ;; definition of type progress-global-state (deftype progress-global-state (basic) - ((aspect-ratio-choice symbol :offset-assert 4) - (video-mode-choice symbol :offset-assert 8) - (yes-no-choice symbol :offset-assert 12) - (which int32 :offset-assert 16) - (starting-state progress-screen :offset-assert 24) - (last-slot-saved int32 :offset-assert 32) - (slider-backup float :offset-assert 36) - (language-backup language-enum :offset-assert 40) - (on-off-backup symbol :offset-assert 48) - (center-x-backup int32 :offset-assert 52) - (center-y-backup int32 :offset-assert 56) - (aspect-ratio-backup symbol :offset-assert 60) - (last-slider-sound time-frame :offset-assert 64) + ((aspect-ratio-choice symbol) + (video-mode-choice symbol) + (yes-no-choice symbol) + (which int32) + (starting-state progress-screen) + (last-slot-saved int32) + (slider-backup float) + (language-backup language-enum) + (on-off-backup symbol) + (center-x-backup int32) + (center-y-backup int32) + (aspect-ratio-backup symbol) + (last-slider-sound time-frame) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) ;; definition for method 3 of type progress-global-state -(defmethod inspect progress-global-state ((this progress-global-state)) +(defmethod inspect ((this progress-global-state)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Taspect-ratio-choice: ~A~%" (-> this aspect-ratio-choice)) (format #t "~Tvideo-mode-choice: ~A~%" (-> this video-mode-choice)) @@ -342,7 +339,7 @@ ;; definition for method 33 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod initialize-icons progress ((this progress)) +(defmethod initialize-icons ((this progress)) (when (< (-> this nb-of-icons) 6) (let ((s5-0 (-> this nb-of-icons))) (set! (-> this icons s5-0) (new 'static 'hud-icon)) @@ -610,7 +607,7 @@ ;; definition for method 48 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod enter! progress ((this progress) (screen progress-screen) (option int)) +(defmethod enter! ((this progress) (screen progress-screen) (option int)) (when (!= (-> this display-state) screen) (set! (-> *progress-state* yes-no-choice) #f) (set! (-> this selected-option) #f) @@ -650,7 +647,7 @@ ;; definition for method 45 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod push! progress ((this progress)) +(defmethod push! ((this progress)) (let ((v1-0 (-> this display-state-pos))) (cond ((< v1-0 5) @@ -669,7 +666,7 @@ ;; definition for method 46 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod pop! progress ((this progress)) +(defmethod pop! ((this progress)) (let ((v1-0 (-> this display-state-pos))) (cond ((> v1-0 0) @@ -689,7 +686,7 @@ ;; definition for method 51 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod set-transition-progress! progress ((this progress) (arg0 int)) +(defmethod set-transition-progress! ((this progress) (arg0 int)) (set! (-> this transition-offset) arg0) (set! (-> this transition-offset-invert) (- 512 arg0)) (set! (-> this transition-percentage) (* 0.001953125 (the float arg0))) @@ -700,7 +697,7 @@ ;; definition for method 52 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod set-transition-speed! progress ((this progress)) +(defmethod set-transition-speed! ((this progress)) (case (-> this display-state) (((progress-screen fuel-cell) (progress-screen money) @@ -912,14 +909,14 @@ ) ;; definition for method 7 of type game-count-info -(defmethod relocate game-count-info ((this game-count-info) (arg0 int)) +(defmethod relocate ((this game-count-info) (arg0 int)) (set! *game-counts* this) this ) ;; definition for method 7 of type progress ;; INFO: Return type mismatch process vs progress. -(defmethod relocate progress ((this progress) (arg0 int)) +(defmethod relocate ((this progress) (arg0 int)) (dotimes (v1-0 (-> this nb-of-particles)) (when (-> this particles v1-0 part) (if (nonzero? (-> this particles v1-0 part)) @@ -934,7 +931,7 @@ ;; definition for method 21 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod adjust-sprites progress ((this progress)) +(defmethod adjust-sprites ((this progress)) (let ((f0-1 (* 0.00024414062 (the float (-> this in-out-position))))) (set! (-> this particles 2 init-pos x) (the float (+ (-> this right-x-offset) 409 (the int (* 301.5 f0-1))))) (set! (-> this particles 1 init-pos x) (the float (+ (-> this left-x-offset) 59))) @@ -969,7 +966,7 @@ ;; definition for method 22 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod adjust-icons progress ((this progress)) +(defmethod adjust-icons ((this progress)) (dotimes (v1-0 (-> this nb-of-icons)) (when (>= v1-0 4) (set-vector! @@ -995,7 +992,7 @@ ;; definition for method 23 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod adjust-ratios progress ((this progress) (aspect symbol) (video-mode symbol)) +(defmethod adjust-ratios ((this progress) (aspect symbol) (video-mode symbol)) (case aspect (('aspect4x3) (set! (-> this sides-x-scale) 1.0) @@ -1047,7 +1044,7 @@ ) ;; definition for method 32 of type progress -(defmethod can-go-back? progress ((this progress)) +(defmethod can-go-back? ((this progress)) (let ((v1-2 (-> *progress-process* 0 display-state)) (a1-1 (-> *progress-state* starting-state)) ) @@ -1077,12 +1074,12 @@ ;; definition for method 19 of type progress ;; INFO: Return type mismatch object vs symbol. -(defmethod visible? progress ((this progress)) +(defmethod visible? ((this progress)) (the-as symbol (and *progress-process* (zero? (-> *progress-process* 0 in-out-position)))) ) ;; definition for method 20 of type progress -(defmethod hidden? progress ((this progress)) +(defmethod hidden? ((this progress)) (or (not *progress-process*) (= (-> *progress-process* 0 in-out-position) 4096)) ) @@ -1124,7 +1121,7 @@ ) ;; definition for method 53 of type progress -(defmethod set-memcard-screen progress ((this progress) (arg0 progress-screen)) +(defmethod set-memcard-screen ((this progress) (arg0 progress-screen)) (let ((s4-0 (-> this card-info)) (gp-0 arg0) ) @@ -1227,7 +1224,7 @@ ;; definition for method 31 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod respond-memcard progress ((this progress)) +(defmethod respond-memcard ((this progress)) (let ((s5-0 (-> this card-info))) (when (and s5-0 (not (-> this in-transition))) (when (or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) @@ -1418,7 +1415,7 @@ ;; definition for method 29 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod respond-common progress ((this progress)) +(defmethod respond-common ((this progress)) (mc-get-slot-info 0 *progress-save-info*) (set! (-> this card-info) *progress-save-info*) (let ((s5-0 (-> *options-remap* (-> this display-state)))) @@ -1856,7 +1853,7 @@ ;; definition for method 30 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod respond-progress progress ((this progress)) +(defmethod respond-progress ((this progress)) (when (not (-> this in-transition)) (cond ((cpad-pressed? 0 up) diff --git a/test/decompiler/reference/jak1/engine/ui/text-h_REF.gc b/test/decompiler/reference/jak1/engine/ui/text-h_REF.gc index 3e558b334fe..578cfe99f8e 100644 --- a/test/decompiler/reference/jak1/engine/ui/text-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/text-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type game-text (deftype game-text (structure) - ((id text-id :offset-assert 0) - (text string :offset-assert 4) + ((id text-id) + (text string) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type game-text -(defmethod inspect game-text ((this game-text)) +(defmethod inspect ((this game-text)) (format #t "[~8x] ~A~%" this 'game-text) (format #t "~Tid: ~D~%" (-> this id)) (format #t "~Ttext: ~A~%" (-> this text)) @@ -22,21 +19,19 @@ ;; definition of type game-text-info (deftype game-text-info (basic) - ((length int32 :offset-assert 4) - (language-id int32 :offset-assert 8) - (group-name string :offset-assert 12) - (data game-text :inline :dynamic :offset-assert 16) + ((length int32) + (language-id int32) + (group-name string) + (data game-text :inline :dynamic) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (lookup-text! (_type_ text-id symbol) string 9) + (lookup-text! (_type_ text-id symbol) string) ) ) ;; definition for method 3 of type game-text-info -(defmethod inspect game-text-info ((this game-text-info)) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this game-text-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tlanguage-id: ~D~%" (-> this language-id)) diff --git a/test/decompiler/reference/jak1/engine/ui/text_REF.gc b/test/decompiler/reference/jak1/engine/ui/text_REF.gc index 208070c1190..2a9c35a433a 100644 --- a/test/decompiler/reference/jak1/engine/ui/text_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/text_REF.gc @@ -21,18 +21,19 @@ ) ;; definition for method 4 of type game-text-info -(defmethod length game-text-info ((this game-text-info)) +(defmethod length ((this game-text-info)) (-> this length) ) ;; definition for method 5 of type game-text-info ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of game-text-info ((this game-text-info)) +(defmethod asize-of ((this game-text-info)) (the-as int (+ (-> this type size) (* (-> this length) 8))) ) ;; definition for method 3 of type game-text-info -(defmethod inspect game-text-info ((this game-text-info)) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this game-text-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) @@ -43,7 +44,7 @@ ) ;; definition for method 8 of type game-text-info -(defmethod mem-usage game-text-info ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 81 (-> arg0 length))) (set! (-> arg0 data 80 name) "string") (+! (-> arg0 data 80 count) 1) @@ -64,7 +65,7 @@ ) ;; definition for method 9 of type game-text-info -(defmethod lookup-text! game-text-info ((this game-text-info) (arg0 text-id) (arg1 symbol)) +(defmethod lookup-text! ((this game-text-info) (arg0 text-id) (arg1 symbol)) (let* ((a1-1 0) (a3-0 (+ (-> this length) 1)) (v1-2 (/ (+ a1-1 a3-0) 2)) diff --git a/test/decompiler/reference/jak1/engine/util/capture_REF.gc b/test/decompiler/reference/jak1/engine/util/capture_REF.gc index 625bcfcdd1b..edae6e0c622 100644 --- a/test/decompiler/reference/jak1/engine/util/capture_REF.gc +++ b/test/decompiler/reference/jak1/engine/util/capture_REF.gc @@ -6,27 +6,24 @@ ;; definition of type gs-store-image-packet (deftype gs-store-image-packet (structure) - ((vifcode vif-tag 4 :offset-assert 0) - (giftag gif-tag :offset-assert 16) - (bitbltbuf gs-bitbltbuf :offset-assert 32) - (bitbltbuf-addr gs-reg64 :offset-assert 40) - (trxpos gs-trxpos :offset-assert 48) - (trxpos-addr gs-reg64 :offset-assert 56) - (trxreg gs-trxreg :offset-assert 64) - (trxreg-addr gs-reg64 :offset-assert 72) - (finish int64 :offset-assert 80) - (finish-addr gs-reg64 :offset-assert 88) - (trxdir gs-trxdir :offset-assert 96) - (trxdir-addr gs-reg64 :offset-assert 104) + ((vifcode vif-tag 4) + (giftag gif-tag) + (bitbltbuf gs-bitbltbuf) + (bitbltbuf-addr gs-reg64) + (trxpos gs-trxpos) + (trxpos-addr gs-reg64) + (trxreg gs-trxreg) + (trxreg-addr gs-reg64) + (finish int64) + (finish-addr gs-reg64) + (trxdir gs-trxdir) + (trxdir-addr gs-reg64) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type gs-store-image-packet ;; INFO: Used lq/sq -(defmethod inspect gs-store-image-packet ((this gs-store-image-packet)) +(defmethod inspect ((this gs-store-image-packet)) (format #t "[~8x] ~A~%" this 'gs-store-image-packet) (format #t "~Tvifcode[4] @ #x~X~%" (-> this vifcode)) (format #t "~Tgiftag: ~D~%" (-> this giftag)) diff --git a/test/decompiler/reference/jak1/engine/util/glist-h_REF.gc b/test/decompiler/reference/jak1/engine/util/glist-h_REF.gc index e67e95272df..86fb6e11da0 100644 --- a/test/decompiler/reference/jak1/engine/util/glist-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/util/glist-h_REF.gc @@ -6,16 +6,13 @@ ;; definition of type glst-node (deftype glst-node (structure) - ((next glst-node :offset-assert 0) - (prev glst-node :offset-assert 4) + ((next glst-node) + (prev glst-node) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type glst-node -(defmethod inspect glst-node ((this glst-node)) +(defmethod inspect ((this glst-node)) (format #t "[~8x] ~A~%" this 'glst-node) (format #t "~Tnext: #~%" (-> this next)) (format #t "~Tprev: #~%" (-> this prev)) @@ -24,15 +21,12 @@ ;; definition of type glst-named-node (deftype glst-named-node (glst-node) - ((privname string :offset-assert 8) + ((privname string) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type glst-named-node -(defmethod inspect glst-named-node ((this glst-named-node)) +(defmethod inspect ((this glst-named-node)) (format #t "[~8x] ~A~%" this 'glst-named-node) (format #t "~Tnext: #~%" (-> this next)) (format #t "~Tprev: #~%" (-> this prev)) @@ -42,19 +36,16 @@ ;; definition of type glst-list (deftype glst-list (structure) - ((head glst-node :offset-assert 0) - (tail glst-node :offset-assert 4) - (tailpred glst-node :offset-assert 8) - (numelem int32 :offset-assert 12) + ((head glst-node) + (tail glst-node) + (tailpred glst-node) + (numelem int32) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type glst-list -(defmethod inspect glst-list ((this glst-list)) +(defmethod inspect ((this glst-list)) (format #t "[~8x] ~A~%" this 'glst-list) (format #t "~Thead: #~%" (-> this head)) (format #t "~Ttail: #~%" (-> this tail)) diff --git a/test/decompiler/reference/jak1/engine/util/smush-control-h_REF.gc b/test/decompiler/reference/jak1/engine/util/smush-control-h_REF.gc index 0ee0b08b98e..0c6d60b640e 100644 --- a/test/decompiler/reference/jak1/engine/util/smush-control-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/util/smush-control-h_REF.gc @@ -3,30 +3,27 @@ ;; definition of type smush-control (deftype smush-control (structure) - ((start-time time-frame :offset-assert 0) - (period float :offset-assert 8) - (duration float :offset-assert 12) - (amp float :offset-assert 16) - (damp-amp float :offset-assert 20) - (damp-period float :offset-assert 24) - (ticks float :offset-assert 28) + ((start-time time-frame) + (period float) + (duration float) + (amp float) + (damp-amp float) + (damp-period float) + (ticks float) ) :pack-me - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 (:methods - (set-zero! (_type_) _type_ 9) - (update! (_type_) float 10) - (get-no-update (_type_) float 11) - (activate! (_type_ float int int float float) _type_ 12) - (nonzero-amplitude? (_type_) symbol 13) - (die-on-next-update! (_type_) _type_ 14) + (set-zero! (_type_) _type_) + (update! (_type_) float) + (get-no-update (_type_) float) + (activate! (_type_ float int int float float) _type_) + (nonzero-amplitude? (_type_) symbol) + (die-on-next-update! (_type_) _type_) ) ) ;; definition for method 3 of type smush-control -(defmethod inspect smush-control ((this smush-control)) +(defmethod inspect ((this smush-control)) (format #t "[~8x] ~A~%" this 'smush-control) (format #t "~Tstart-time: ~D~%" (-> this start-time)) (format #t "~Tperiod: ~f~%" (-> this period)) @@ -39,12 +36,12 @@ ) ;; definition for method 13 of type smush-control -(defmethod nonzero-amplitude? smush-control ((this smush-control)) +(defmethod nonzero-amplitude? ((this smush-control)) (!= (-> this amp) 0.0) ) ;; definition for method 9 of type smush-control -(defmethod set-zero! smush-control ((this smush-control)) +(defmethod set-zero! ((this smush-control)) (set! (-> this period) 0.0) (set! (-> this duration) 0.0) (set! (-> this amp) 0.0) @@ -55,7 +52,7 @@ ) ;; definition for method 10 of type smush-control -(defmethod update! smush-control ((this smush-control)) +(defmethod update! ((this smush-control)) (cond ((!= (-> this amp) 0.0) (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) @@ -85,7 +82,7 @@ ) ;; definition for method 11 of type smush-control -(defmethod get-no-update smush-control ((this smush-control)) +(defmethod get-no-update ((this smush-control)) (cond ((!= (-> this amp) 0.0) (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) @@ -104,7 +101,7 @@ ) ;; definition for method 14 of type smush-control -(defmethod die-on-next-update! smush-control ((this smush-control)) +(defmethod die-on-next-update! ((this smush-control)) (if (!= (-> this amp) 0.0) (set! (-> this damp-period) -1.0) ) @@ -112,7 +109,7 @@ ) ;; definition for method 12 of type smush-control -(defmethod activate! smush-control ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float)) +(defmethod activate! ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float)) (when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this))) (set! (-> this amp) arg0) (set! (-> this period) (the float arg1)) diff --git a/test/decompiler/reference/jak1/engine/util/sync-info-h_REF.gc b/test/decompiler/reference/jak1/engine/util/sync-info-h_REF.gc index cf87e03a064..287a0d02f0a 100644 --- a/test/decompiler/reference/jak1/engine/util/sync-info-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/util/sync-info-h_REF.gc @@ -3,28 +3,25 @@ ;; definition of type sync-info (deftype sync-info (structure) - ((offset float :offset-assert 0) - (period uint32 :offset-assert 4) + ((offset float) + (period uint32) ) :pack-me - :method-count-assert 18 - :size-assert #x8 - :flag-assert #x1200000008 (:methods - (get-current-value (_type_ float) float 9) - (get-current-phase-no-mod (_type_) float 10) - (get-current-phase (_type_) float 11) - (get-current-value-with-mirror (_type_ float) float 12) - (get-current-phase-with-mirror (_type_) float 13) - (setup-params! (_type_ uint float float float) none 14) - (load-params! (_type_ process uint float float float) symbol 15) - (sync-now! (_type_ float) float 16) - (get-phase-offset (_type_) float 17) + (get-current-value (_type_ float) float) + (get-current-phase-no-mod (_type_) float) + (get-current-phase (_type_) float) + (get-current-value-with-mirror (_type_ float) float) + (get-current-phase-with-mirror (_type_) float) + (setup-params! (_type_ uint float float float) none) + (load-params! (_type_ process uint float float float) symbol) + (sync-now! (_type_ float) float) + (get-phase-offset (_type_) float) ) ) ;; definition for method 3 of type sync-info -(defmethod inspect sync-info ((this sync-info)) +(defmethod inspect ((this sync-info)) (format #t "[~8x] ~A~%" this 'sync-info) (format #t "~Toffset: ~f~%" (-> this offset)) (format #t "~Tperiod: ~D~%" (-> this period)) @@ -33,20 +30,17 @@ ;; definition of type sync-info-eased (deftype sync-info-eased (sync-info) - ((tlo float :offset-assert 8) - (thi float :offset-assert 12) - (ylo float :offset-assert 16) - (m2 float :offset-assert 20) - (yend float :offset-assert 24) + ((tlo float) + (thi float) + (ylo float) + (m2 float) + (yend float) ) :allow-misaligned - :method-count-assert 18 - :size-assert #x1c - :flag-assert #x120000001c ) ;; definition for method 3 of type sync-info-eased -(defmethod inspect sync-info-eased ((this sync-info-eased)) +(defmethod inspect ((this sync-info-eased)) (format #t "[~8x] ~A~%" this 'sync-info-eased) (format #t "~Toffset: ~f~%" (-> this offset)) (format #t "~Tperiod: ~D~%" (-> this period)) @@ -60,17 +54,14 @@ ;; definition of type sync-info-paused (deftype sync-info-paused (sync-info) - ((pause-after-out float :offset-assert 8) - (pause-after-in float :offset-assert 12) + ((pause-after-out float) + (pause-after-in float) ) :pack-me - :method-count-assert 18 - :size-assert #x10 - :flag-assert #x1200000010 ) ;; definition for method 3 of type sync-info-paused -(defmethod inspect sync-info-paused ((this sync-info-paused)) +(defmethod inspect ((this sync-info-paused)) (format #t "[~8x] ~A~%" this 'sync-info-paused) (format #t "~Toffset: ~f~%" (-> this offset)) (format #t "~Tperiod: ~D~%" (-> this period)) @@ -81,25 +72,22 @@ ;; definition of type delayed-rand-float (deftype delayed-rand-float (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (max-val float :offset-assert 8) - (timer int32 :offset-assert 12) - (start-time time-frame :offset-assert 16) - (value float :offset-assert 24) + ((min-time int32) + (max-time int32) + (max-val float) + (timer int32) + (start-time time-frame) + (value float) ) :pack-me - :method-count-assert 11 - :size-assert #x1c - :flag-assert #xb0000001c (:methods - (set-params! (_type_ int int float) float 9) - (update! (_type_) float 10) + (set-params! (_type_ int int float) float) + (update! (_type_) float) ) ) ;; definition for method 3 of type delayed-rand-float -(defmethod inspect delayed-rand-float ((this delayed-rand-float)) +(defmethod inspect ((this delayed-rand-float)) (format #t "[~8x] ~A~%" this 'delayed-rand-float) (format #t "~Tmin-time: ~D~%" (-> this min-time)) (format #t "~Tmax-time: ~D~%" (-> this max-time)) @@ -112,25 +100,22 @@ ;; definition of type oscillating-float (deftype oscillating-float (structure) - ((value float :offset-assert 0) - (target float :offset-assert 4) - (vel float :offset-assert 8) - (max-vel float :offset-assert 12) - (damping float :offset-assert 16) - (accel float :offset-assert 20) + ((value float) + (target float) + (vel float) + (max-vel float) + (damping float) + (accel float) ) :pack-me - :method-count-assert 11 - :size-assert #x18 - :flag-assert #xb00000018 (:methods - (set-params! (_type_ float float float float) float 9) - (update! (_type_ float) float 10) + (set-params! (_type_ float float float float) float) + (update! (_type_ float) float) ) ) ;; definition for method 3 of type oscillating-float -(defmethod inspect oscillating-float ((this oscillating-float)) +(defmethod inspect ((this oscillating-float)) (format #t "[~8x] ~A~%" this 'oscillating-float) (format #t "~Tvalue: ~f~%" (-> this value)) (format #t "~Ttarget: ~f~%" (-> this target)) @@ -143,26 +128,23 @@ ;; definition of type bouncing-float (deftype bouncing-float (structure) - ((osc oscillating-float :inline :offset-assert 0) - (max-value float :offset-assert 24) - (min-value float :offset-assert 28) - (elasticity float :offset-assert 32) - (state int32 :offset-assert 36) + ((osc oscillating-float :inline) + (max-value float) + (min-value float) + (elasticity float) + (state int32) ) :pack-me - :method-count-assert 13 - :size-assert #x28 - :flag-assert #xd00000028 (:methods - (set-params! (_type_ float float float float float float float) float 9) - (update! (_type_ float) float 10) - (at-min? (_type_) symbol 11) - (at-max? (_type_) symbol 12) + (set-params! (_type_ float float float float float float float) float) + (update! (_type_ float) float) + (at-min? (_type_) symbol) + (at-max? (_type_) symbol) ) ) ;; definition for method 3 of type bouncing-float -(defmethod inspect bouncing-float ((this bouncing-float)) +(defmethod inspect ((this bouncing-float)) (format #t "[~8x] ~A~%" this 'bouncing-float) (format #t "~Tosc: #~%" (-> this osc)) (format #t "~Tmax-value: ~f~%" (-> this max-value)) @@ -174,27 +156,24 @@ ;; definition of type delayed-rand-vector (deftype delayed-rand-vector (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (xz-max float :offset-assert 8) - (y-max float :offset-assert 12) - (timer int32 :offset-assert 16) - (start-time time-frame :offset-assert 24) - (value vector :inline :offset-assert 32) + ((min-time int32) + (max-time int32) + (xz-max float) + (y-max float) + (timer int32) + (start-time time-frame) + (value vector :inline) ) - :method-count-assert 13 - :size-assert #x30 - :flag-assert #xd00000030 (:methods - (set-params! (_type_ int int float float) vector 9) - (update-now! (_type_) vector 10) - (update-with-delay! (_type_) vector 11) - (update-with-delay-or-reset! (_type_) vector 12) + (set-params! (_type_ int int float float) vector) + (update-now! (_type_) vector) + (update-with-delay! (_type_) vector) + (update-with-delay-or-reset! (_type_) vector) ) ) ;; definition for method 3 of type delayed-rand-vector -(defmethod inspect delayed-rand-vector ((this delayed-rand-vector)) +(defmethod inspect ((this delayed-rand-vector)) (format #t "[~8x] ~A~%" this 'delayed-rand-vector) (format #t "~Tmin-time: ~D~%" (-> this min-time)) (format #t "~Tmax-time: ~D~%" (-> this max-time)) @@ -208,24 +187,21 @@ ;; definition of type oscillating-vector (deftype oscillating-vector (structure) - ((value vector :inline :offset-assert 0) - (target vector :inline :offset-assert 16) - (vel vector :inline :offset-assert 32) - (max-vel float :offset-assert 48) - (damping float :offset-assert 52) - (accel float :offset-assert 56) + ((value vector :inline) + (target vector :inline) + (vel vector :inline) + (max-vel float) + (damping float) + (accel float) ) - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (set-params! (_type_ vector float float float) vector 9) - (update! (_type_ vector) vector 10) + (set-params! (_type_ vector float float float) vector) + (update! (_type_ vector) vector) ) ) ;; definition for method 3 of type oscillating-vector -(defmethod inspect oscillating-vector ((this oscillating-vector)) +(defmethod inspect ((this oscillating-vector)) (format #t "[~8x] ~A~%" this 'oscillating-vector) (format #t "~Tvalue: #~%" (-> this value)) (format #t "~Ttarget: #~%" (-> this target)) diff --git a/test/decompiler/reference/jak1/engine/util/sync-info_REF.gc b/test/decompiler/reference/jak1/engine/util/sync-info_REF.gc index 0e18d0364a2..d7f6bd674ec 100644 --- a/test/decompiler/reference/jak1/engine/util/sync-info_REF.gc +++ b/test/decompiler/reference/jak1/engine/util/sync-info_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 14 of type sync-info ;; INFO: Return type mismatch int vs none. -(defmethod setup-params! sync-info ((this sync-info) (period uint) (phase float) (arg2 float) (arg3 float)) +(defmethod setup-params! ((this sync-info) (period uint) (phase float) (arg2 float) (arg3 float)) (set! (-> this period) period) (let* ((period-float (the float period)) (value (* phase period-float)) @@ -16,7 +16,7 @@ ;; definition for method 14 of type sync-info-eased ;; INFO: Return type mismatch int vs none. -(defmethod setup-params! sync-info-eased ((this sync-info-eased) (period uint) (phase float) (out-param float) (in-param float)) +(defmethod setup-params! ((this sync-info-eased) (period uint) (phase float) (out-param float) (in-param float)) (set! (-> this period) period) (let* ((period-float (the float period)) (value (* phase period-float)) @@ -61,7 +61,7 @@ ;; definition for method 14 of type sync-info-paused ;; INFO: Return type mismatch int vs none. -(defmethod setup-params! sync-info-paused ((this sync-info-paused) (period uint) (phase float) (out-param float) (in-param float)) +(defmethod setup-params! ((this sync-info-paused) (period uint) (phase float) (out-param float) (in-param float)) (set! (-> this period) period) (let* ((f0-1 (the float period)) (f1-1 (* phase f0-1)) @@ -92,13 +92,13 @@ ;; definition for method 15 of type sync-info ;; INFO: Used lq/sq -(defmethod load-params! sync-info ((this sync-info) - (proc process) - (default-period uint) - (default-phase float) - (default-out float) - (default-in float) - ) +(defmethod load-params! ((this sync-info) + (proc process) + (default-period uint) + (default-phase float) + (default-out float) + (default-in float) + ) (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (res-lump-data (-> proc entity) 'sync pointer :tag-ptr (& sv-16)))) @@ -123,13 +123,13 @@ ;; definition for method 15 of type sync-info-eased ;; INFO: Used lq/sq -(defmethod load-params! sync-info-eased ((this sync-info-eased) - (proc process) - (default-period uint) - (default-phase float) - (default-out float) - (default-in float) - ) +(defmethod load-params! ((this sync-info-eased) + (proc process) + (default-period uint) + (default-phase float) + (default-out float) + (default-in float) + ) (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (res-lump-data (-> proc entity) 'sync pointer :tag-ptr (& sv-16)))) @@ -163,13 +163,13 @@ ;; definition for method 15 of type sync-info-paused ;; INFO: Used lq/sq -(defmethod load-params! sync-info-paused ((this sync-info-paused) - (proc process) - (default-period uint) - (default-phase float) - (default-out float) - (default-in float) - ) +(defmethod load-params! ((this sync-info-paused) + (proc process) + (default-period uint) + (default-phase float) + (default-out float) + (default-in float) + ) (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (res-lump-data (-> proc entity) 'sync pointer :tag-ptr (& sv-16)))) @@ -202,7 +202,7 @@ ) ;; definition for method 10 of type sync-info -(defmethod get-current-phase-no-mod sync-info ((this sync-info)) +(defmethod get-current-phase-no-mod ((this sync-info)) (let* ((period (-> this period)) (period-float (the float period)) (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) @@ -212,12 +212,12 @@ ) ;; definition for method 17 of type sync-info -(defmethod get-phase-offset sync-info ((this sync-info)) +(defmethod get-phase-offset ((this sync-info)) (/ (-> this offset) (the float (-> this period))) ) ;; definition for method 16 of type sync-info -(defmethod sync-now! sync-info ((this sync-info) (user-time-offset float)) +(defmethod sync-now! ((this sync-info) (user-time-offset float)) (let* ((period (-> this period)) (period-float (the float period)) (wrapped-user-offset @@ -238,7 +238,7 @@ ) ;; definition for method 11 of type sync-info -(defmethod get-current-phase sync-info ((this sync-info)) +(defmethod get-current-phase ((this sync-info)) (let* ((period (-> this period)) (period-float (the float period)) (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) @@ -248,7 +248,7 @@ ) ;; definition for method 11 of type sync-info-paused -(defmethod get-current-phase sync-info-paused ((this sync-info-paused)) +(defmethod get-current-phase ((this sync-info-paused)) (let* ((period (-> this period)) (period-float (the float period)) (max-phase 1.0) @@ -262,7 +262,7 @@ ) ;; definition for method 9 of type sync-info -(defmethod get-current-value sync-info ((this sync-info) (max-val float)) +(defmethod get-current-value ((this sync-info) (max-val float)) (let* ((period (-> this period)) (period-float (the float period)) (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) @@ -274,12 +274,12 @@ ) ;; definition for method 9 of type sync-info-paused -(defmethod get-current-value sync-info-paused ((this sync-info-paused) (arg0 float)) +(defmethod get-current-value ((this sync-info-paused) (arg0 float)) (* (get-current-phase this) arg0) ) ;; definition for method 13 of type sync-info -(defmethod get-current-phase-with-mirror sync-info ((this sync-info)) +(defmethod get-current-phase-with-mirror ((this sync-info)) (let* ((period (-> this period)) (period-float (the float period)) (max-val 2.0) @@ -298,7 +298,7 @@ ) ;; definition for method 13 of type sync-info-eased -(defmethod get-current-phase-with-mirror sync-info-eased ((this sync-info-eased)) +(defmethod get-current-phase-with-mirror ((this sync-info-eased)) (let* ((period (-> this period)) (period-float (the float period)) (max-val 2.0) @@ -341,7 +341,7 @@ ) ;; definition for method 13 of type sync-info-paused -(defmethod get-current-phase-with-mirror sync-info-paused ((this sync-info-paused)) +(defmethod get-current-phase-with-mirror ((this sync-info-paused)) (let* ((v1-0 (-> this period)) (f1-0 (the float v1-0)) (f0-1 2.0) @@ -368,7 +368,7 @@ ) ;; definition for method 12 of type sync-info -(defmethod get-current-value-with-mirror sync-info ((this sync-info) (max-out-val float)) +(defmethod get-current-value-with-mirror ((this sync-info) (max-out-val float)) (let* ((period (-> this period)) (period-float (the float period)) (max-val 2.0) @@ -387,17 +387,17 @@ ) ;; definition for method 12 of type sync-info-eased -(defmethod get-current-value-with-mirror sync-info-eased ((this sync-info-eased) (max-out-val float)) +(defmethod get-current-value-with-mirror ((this sync-info-eased) (max-out-val float)) (* (get-current-phase-with-mirror this) max-out-val) ) ;; definition for method 12 of type sync-info-paused -(defmethod get-current-value-with-mirror sync-info-paused ((this sync-info-paused) (max-out-val float)) +(defmethod get-current-value-with-mirror ((this sync-info-paused) (max-out-val float)) (* (get-current-phase-with-mirror this) max-out-val) ) ;; definition for method 9 of type delayed-rand-float -(defmethod set-params! delayed-rand-float ((this delayed-rand-float) (min-tim int) (max-time int) (max-times-two float)) +(defmethod set-params! ((this delayed-rand-float) (min-tim int) (max-time int) (max-times-two float)) (set! (-> this min-time) min-tim) (set! (-> this max-time) max-time) (set! (-> this max-val) (* 0.5 max-times-two)) @@ -408,7 +408,7 @@ ) ;; definition for method 10 of type delayed-rand-float -(defmethod update! delayed-rand-float ((this delayed-rand-float)) +(defmethod update! ((this delayed-rand-float)) (when (time-elapsed? (-> this start-time) (-> this timer)) (set-time! (-> this start-time)) (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) @@ -418,7 +418,7 @@ ) ;; definition for method 9 of type oscillating-float -(defmethod set-params! oscillating-float ((this oscillating-float) (init-val float) (accel float) (max-vel float) (damping float)) +(defmethod set-params! ((this oscillating-float) (init-val float) (accel float) (max-vel float) (damping float)) (set! (-> this value) init-val) (set! (-> this target) init-val) (set! (-> this vel) 0.0) @@ -429,7 +429,7 @@ ) ;; definition for method 10 of type oscillating-float -(defmethod update! oscillating-float ((this oscillating-float) (target-offset float)) +(defmethod update! ((this oscillating-float) (target-offset float)) (let ((acc (* (- (+ (-> this target) target-offset) (-> this value)) (* (-> this accel) (-> *display* time-adjust-ratio)) ) @@ -444,15 +444,15 @@ ) ;; definition for method 9 of type bouncing-float -(defmethod set-params! bouncing-float ((this bouncing-float) - (init-val float) - (max-val float) - (min-val float) - (elast float) - (accel float) - (max-vel float) - (damping float) - ) +(defmethod set-params! ((this bouncing-float) + (init-val float) + (max-val float) + (min-val float) + (elast float) + (accel float) + (max-vel float) + (damping float) + ) (set-params! (-> this osc) init-val accel max-vel damping) (set! (-> this max-value) max-val) (set! (-> this min-value) min-val) @@ -462,7 +462,7 @@ ) ;; definition for method 10 of type bouncing-float -(defmethod update! bouncing-float ((this bouncing-float) (arg0 float)) +(defmethod update! ((this bouncing-float) (arg0 float)) (update! (-> this osc) arg0) (set! (-> this state) 0) (when (>= (-> this osc value) (-> this max-value)) @@ -483,17 +483,17 @@ ) ;; definition for method 11 of type bouncing-float -(defmethod at-min? bouncing-float ((this bouncing-float)) +(defmethod at-min? ((this bouncing-float)) (= (-> this state) -1) ) ;; definition for method 12 of type bouncing-float -(defmethod at-max? bouncing-float ((this bouncing-float)) +(defmethod at-max? ((this bouncing-float)) (= (-> this state) 1) ) ;; definition for method 9 of type delayed-rand-vector -(defmethod set-params! delayed-rand-vector ((this delayed-rand-vector) (min-time int) (max-time int) (xz-range float) (y-range float)) +(defmethod set-params! ((this delayed-rand-vector) (min-time int) (max-time int) (xz-range float) (y-range float)) (set! (-> this min-time) min-time) (set! (-> this max-time) max-time) (set! (-> this xz-max) (* 0.5 xz-range)) @@ -505,7 +505,7 @@ ) ;; definition for method 10 of type delayed-rand-vector -(defmethod update-now! delayed-rand-vector ((this delayed-rand-vector)) +(defmethod update-now! ((this delayed-rand-vector)) (set-time! (-> this start-time)) (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) (set! (-> this value x) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) @@ -515,7 +515,7 @@ ) ;; definition for method 11 of type delayed-rand-vector -(defmethod update-with-delay! delayed-rand-vector ((this delayed-rand-vector)) +(defmethod update-with-delay! ((this delayed-rand-vector)) (if (time-elapsed? (-> this start-time) (-> this timer)) (update-now! this) ) @@ -523,7 +523,7 @@ ) ;; definition for method 12 of type delayed-rand-vector -(defmethod update-with-delay-or-reset! delayed-rand-vector ((this delayed-rand-vector)) +(defmethod update-with-delay-or-reset! ((this delayed-rand-vector)) (if (time-elapsed? (-> this start-time) (-> this timer)) (update-now! this) (vector-reset! (-> this value)) @@ -533,7 +533,7 @@ ;; definition for method 9 of type oscillating-vector ;; INFO: Used lq/sq -(defmethod set-params! oscillating-vector ((this oscillating-vector) (init-val vector) (accel float) (max-vel float) (damping float)) +(defmethod set-params! ((this oscillating-vector) (init-val vector) (accel float) (max-vel float) (damping float)) (cond (init-val (set! (-> this value quad) (-> init-val quad)) @@ -552,7 +552,7 @@ ) ;; definition for method 10 of type oscillating-vector -(defmethod update! oscillating-vector ((this oscillating-vector) (target-offset vector)) +(defmethod update! ((this oscillating-vector) (target-offset vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (cond (target-offset diff --git a/test/decompiler/reference/jak1/engine/util/types-h_REF.gc b/test/decompiler/reference/jak1/engine/util/types-h_REF.gc index 21b630d3445..f0c1fcdf8cf 100644 --- a/test/decompiler/reference/jak1/engine/util/types-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/util/types-h_REF.gc @@ -4,17 +4,11 @@ ;; definition of type time-frame (deftype time-frame (int64) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type part-id (deftype part-id (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/kernel/dgo-h_REF.gc b/test/decompiler/reference/jak1/kernel/dgo-h_REF.gc index aab79fe33cf..77fe42fe336 100644 --- a/test/decompiler/reference/jak1/kernel/dgo-h_REF.gc +++ b/test/decompiler/reference/jak1/kernel/dgo-h_REF.gc @@ -3,16 +3,13 @@ ;; definition of type dgo-entry (deftype dgo-entry (structure) - ((offset uint32 :offset-assert 0) - (length uint32 :offset-assert 4) + ((offset uint32) + (length uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type dgo-entry -(defmethod inspect dgo-entry ((this dgo-entry)) +(defmethod inspect ((this dgo-entry)) (format #t "[~8x] ~A~%" this 'dgo-entry) (format #t "~Toffset: ~D~%" (-> this offset)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -21,18 +18,15 @@ ;; definition of type dgo-file (deftype dgo-file (basic) - ((num-go-files uint32 :offset-assert 4) - (total-length uint32 :offset-assert 8) - (rsvd uint32 :offset-assert 12) - (data uint8 :dynamic :offset-assert 16) + ((num-go-files uint32) + (total-length uint32) + (rsvd uint32) + (data uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type dgo-file -(defmethod inspect dgo-file ((this dgo-file)) +(defmethod inspect ((this dgo-file)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tnum-go-files: ~D~%" (-> this num-go-files)) (format #t "~Ttotal-length: ~D~%" (-> this total-length)) diff --git a/test/decompiler/reference/jak1/kernel/gcommon_REF.gc b/test/decompiler/reference/jak1/kernel/gcommon_REF.gc index c7259d8b9fc..c258cf8c1c1 100644 --- a/test/decompiler/reference/jak1/kernel/gcommon_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gcommon_REF.gc @@ -106,13 +106,10 @@ (z float :offset 64 :size 32) (w float :offset 96 :size 32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vec4s -(defmethod inspect vec4s ((this vec4s)) +(defmethod inspect ((this vec4s)) (format #t "[~8x] ~A~%" this 'vec4s) (format #t "~Tx: ~f~%" (-> this x)) (format #t "~Ty: ~f~%" (-> this y)) @@ -122,36 +119,33 @@ ) ;; definition for method 2 of type vec4s -(defmethod print vec4s ((this vec4s)) +(defmethod print ((this vec4s)) (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) this ) ;; definition of type bfloat (deftype bfloat (basic) - ((data float :offset-assert 4) + ((data float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type bfloat -(defmethod inspect bfloat ((this bfloat)) +(defmethod inspect ((this bfloat)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tdata: ~f~%" (-> this data)) this ) ;; definition for method 2 of type bfloat -(defmethod print bfloat ((this bfloat)) +(defmethod print ((this bfloat)) (format #t "~f" (-> this data)) this ) ;; definition for method 5 of type type ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of type ((this type)) +(defmethod asize-of ((this type)) (the-as int (logand (the-as uint #xfffffff0) (+ (* (-> this allocated-length) 4) 43))) ) @@ -212,7 +206,7 @@ ) ;; definition for method 4 of type pair -(defmethod length pair ((this pair)) +(defmethod length ((this pair)) (local-vars (result int)) (cond ((null? this) @@ -233,7 +227,7 @@ ;; definition for method 5 of type pair ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of pair ((this pair)) +(defmethod asize-of ((this pair)) (the-as int (-> pair size)) ) @@ -433,20 +427,17 @@ ;; definition of type inline-array-class (deftype inline-array-class (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (_data uint8 :dynamic :offset 16) + ((length int32) + (allocated-length int32) + (_data uint8 :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) ;; definition for method 3 of type inline-array-class -(defmethod inspect inline-array-class ((this inline-array-class)) +(defmethod inspect ((this inline-array-class)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -471,13 +462,13 @@ ) ;; definition for method 4 of type inline-array-class -(defmethod length inline-array-class ((this inline-array-class)) +(defmethod length ((this inline-array-class)) (-> this length) ) ;; definition for method 5 of type inline-array-class ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of inline-array-class ((this inline-array-class)) +(defmethod asize-of ((this inline-array-class)) (the-as int (+ (-> this type size) (* (-> this allocated-length) (the-as int (-> this type heap-base))))) ) @@ -505,7 +496,7 @@ ;; definition for method 2 of type array ;; INFO: Used lq/sq -(defmethod print array ((this array)) +(defmethod print ((this array)) (format #t "#(") (cond ((type-type? (-> this content-type) integer) @@ -655,7 +646,7 @@ ;; definition for method 3 of type array ;; INFO: Used lq/sq -(defmethod inspect array ((this array)) +(defmethod inspect ((this array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -731,13 +722,13 @@ ) ;; definition for method 4 of type array -(defmethod length array ((this array)) +(defmethod length ((this array)) (-> this length) ) ;; definition for method 5 of type array ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of array ((this array)) +(defmethod asize-of ((this array)) (the-as int (+ (-> array size) (* (-> this allocated-length) (if (type-type? (-> this content-type) number) (the-as int (-> this content-type size)) 4 diff --git a/test/decompiler/reference/jak1/kernel/gkernel-h_REF.gc b/test/decompiler/reference/jak1/kernel/gkernel-h_REF.gc index bfb29db4d58..5781c3bebd3 100644 --- a/test/decompiler/reference/jak1/kernel/gkernel-h_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gkernel-h_REF.gc @@ -3,25 +3,22 @@ ;; definition of type kernel-context (deftype kernel-context (basic) - ((prevent-from-run process-mask :offset-assert 4) - (require-for-run process-mask :offset-assert 8) - (allow-to-run process-mask :offset-assert 12) - (next-pid int32 :offset-assert 16) - (fast-stack-top pointer :offset-assert 20) - (current-process process :offset-assert 24) - (relocating-process basic :offset-assert 28) - (relocating-min int32 :offset-assert 32) - (relocating-max int32 :offset-assert 36) - (relocating-offset int32 :offset-assert 40) - (low-memory-message symbol :offset-assert 44) + ((prevent-from-run process-mask) + (require-for-run process-mask) + (allow-to-run process-mask) + (next-pid int32) + (fast-stack-top pointer) + (current-process process) + (relocating-process basic) + (relocating-min int32) + (relocating-max int32) + (relocating-offset int32) + (low-memory-message symbol) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type kernel-context -(defmethod inspect kernel-context ((this kernel-context)) +(defmethod inspect ((this kernel-context)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tprevent-from-run: ~D~%" (-> this prevent-from-run)) (format #t "~Trequire-for-run: ~D~%" (-> this require-for-run)) @@ -39,28 +36,25 @@ ;; definition of type thread (deftype thread (basic) - ((name basic :offset-assert 4) - (process process :offset-assert 8) - (previous thread :offset-assert 12) - (suspend-hook (function cpu-thread none) :offset-assert 16) - (resume-hook (function cpu-thread none) :offset-assert 20) - (pc pointer :offset-assert 24) - (sp pointer :offset-assert 28) - (stack-top pointer :offset-assert 32) - (stack-size int32 :offset-assert 36) + ((name basic) + (process process) + (previous thread) + (suspend-hook (function cpu-thread none)) + (resume-hook (function cpu-thread none)) + (pc pointer) + (sp pointer) + (stack-top pointer) + (stack-size int32) ) - :method-count-assert 12 - :size-assert #x28 - :flag-assert #xc00000028 (:methods - (stack-size-set! (_type_ int) none 9) - (thread-suspend (_type_) none 10) - (thread-resume (_type_) none 11) + (stack-size-set! (_type_ int) none) + (thread-suspend (_type_) none) + (thread-resume (_type_) none) ) ) ;; definition for method 3 of type thread -(defmethod inspect thread ((this thread)) +(defmethod inspect ((this thread)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tprocess: ~A~%" (-> this process)) @@ -76,20 +70,17 @@ ;; definition of type cpu-thread (deftype cpu-thread (thread) - ((rreg uint64 7 :offset-assert 40) - (freg float 8 :offset-assert 96) - (stack uint8 :dynamic :offset-assert 128) + ((rreg uint64 7) + (freg float 8) + (stack uint8 :dynamic) ) - :method-count-assert 12 - :size-assert #x80 - :flag-assert #xc00000080 (:methods - (new (symbol type process symbol int pointer) _type_ 0) + (new (symbol type process symbol int pointer) _type_) ) ) ;; definition for method 3 of type cpu-thread -(defmethod inspect cpu-thread ((this cpu-thread)) +(defmethod inspect ((this cpu-thread)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tprocess: ~A~%" (-> this process)) @@ -109,18 +100,15 @@ ;; definition of type dead-pool (deftype dead-pool (process-tree) () - :method-count-assert 16 - :size-assert #x20 - :flag-assert #x1000000020 (:methods - (new (symbol type int int basic) _type_ 0) - (get-process (_type_ type int) process 14) - (return-process (_type_ process) none 15) + (new (symbol type int int basic) _type_) + (get-process (_type_ type int) process) + (return-process (_type_ process) none) ) ) ;; definition for method 3 of type dead-pool -(defmethod inspect dead-pool ((this dead-pool)) +(defmethod inspect ((this dead-pool)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -134,18 +122,15 @@ ;; definition of type dead-pool-heap-rec (deftype dead-pool-heap-rec (structure) - ((process process :offset-assert 0) - (prev dead-pool-heap-rec :offset-assert 4) - (next dead-pool-heap-rec :offset-assert 8) + ((process process) + (prev dead-pool-heap-rec) + (next dead-pool-heap-rec) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type dead-pool-heap-rec -(defmethod inspect dead-pool-heap-rec ((this dead-pool-heap-rec)) +(defmethod inspect ((this dead-pool-heap-rec)) (format #t "[~8x] ~A~%" this 'dead-pool-heap-rec) (format #t "~Tprocess: ~A~%" (-> this process)) (format #t "~Tprev: #~%" (-> this prev)) @@ -155,41 +140,38 @@ ;; definition of type dead-pool-heap (deftype dead-pool-heap (dead-pool) - ((allocated-length int32 :offset-assert 32) - (compact-time uint32 :offset-assert 36) - (compact-count-targ uint32 :offset-assert 40) - (compact-count uint32 :offset-assert 44) - (fill-percent float :offset-assert 48) - (first-gap dead-pool-heap-rec :offset-assert 52) - (first-shrink dead-pool-heap-rec :offset-assert 56) - (heap kheap :inline :offset-assert 64) - (alive-list dead-pool-heap-rec :inline :offset-assert 80) - (last dead-pool-heap-rec :offset 84) - (dead-list dead-pool-heap-rec :inline :offset-assert 92) - (process-list dead-pool-heap-rec :inline :dynamic :offset-assert 104) + ((allocated-length int32) + (compact-time uint32) + (compact-count-targ uint32) + (compact-count uint32) + (fill-percent float) + (first-gap dead-pool-heap-rec) + (first-shrink dead-pool-heap-rec) + (heap kheap :inline) + (alive-list dead-pool-heap-rec :inline) + (last dead-pool-heap-rec :overlay-at (-> alive-list prev)) + (dead-list dead-pool-heap-rec :inline) + (process-list dead-pool-heap-rec :inline :dynamic) ) - :method-count-assert 27 - :size-assert #x68 - :flag-assert #x1b00000068 (:methods - (new (symbol type basic int int) _type_ 0) - (compact (dead-pool-heap int) none 16) - (shrink-heap (dead-pool-heap process) dead-pool-heap 17) - (churn (dead-pool-heap int) none 18) - (memory-used (dead-pool-heap) int 19) - (memory-total (dead-pool-heap) int 20) - (gap-size (dead-pool-heap dead-pool-heap-rec) int 21) - (gap-location (dead-pool-heap dead-pool-heap-rec) pointer 22) - (find-gap (dead-pool-heap dead-pool-heap-rec) dead-pool-heap-rec 23) - (find-gap-by-size (dead-pool-heap int) dead-pool-heap-rec 24) - (memory-free (dead-pool-heap) int 25) - (compact-time (dead-pool-heap) uint 26) + (new (symbol type basic int int) _type_) + (compact (dead-pool-heap int) none) + (shrink-heap (dead-pool-heap process) dead-pool-heap) + (churn (dead-pool-heap int) none) + (memory-used (dead-pool-heap) int) + (memory-total (dead-pool-heap) int) + (gap-size (dead-pool-heap dead-pool-heap-rec) int) + (gap-location (dead-pool-heap dead-pool-heap-rec) pointer) + (find-gap (dead-pool-heap dead-pool-heap-rec) dead-pool-heap-rec) + (find-gap-by-size (dead-pool-heap int) dead-pool-heap-rec) + (memory-free (dead-pool-heap) int) + (compact-time (dead-pool-heap) uint) ) ) ;; definition for method 3 of type dead-pool-heap ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect dead-pool-heap ((this dead-pool-heap)) +(defmethod inspect ((this dead-pool-heap)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -215,21 +197,18 @@ ;; definition of type catch-frame (deftype catch-frame (stack-frame) - ((sp int32 :offset-assert 12) - (ra int32 :offset-assert 16) - (freg float 10 :offset-assert 20) - (rreg uint128 7 :offset-assert 64) + ((sp int32) + (ra int32) + (freg float 10) + (rreg uint128 7) ) - :method-count-assert 9 - :size-assert #xb0 - :flag-assert #x9000000b0 (:methods - (new (symbol type symbol function (pointer uint64)) object 0) + (new (symbol type symbol function (pointer uint64)) object) ) ) ;; definition for method 3 of type catch-frame -(defmethod inspect catch-frame ((this catch-frame)) +(defmethod inspect ((this catch-frame)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tnext: ~A~%" (-> this next)) @@ -242,18 +221,15 @@ ;; definition of type protect-frame (deftype protect-frame (stack-frame) - ((exit (function object) :offset-assert 12) + ((exit (function object)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type (function object)) protect-frame 0) + (new (symbol type (function object)) protect-frame) ) ) ;; definition for method 3 of type protect-frame -(defmethod inspect protect-frame ((this protect-frame)) +(defmethod inspect ((this protect-frame)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tnext: ~A~%" (-> this next)) @@ -267,13 +243,10 @@ (pid int32 :offset 32 :size 32) (u64 uint64 :offset 0 :size 64) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type handle -(defmethod inspect handle ((this handle)) +(defmethod inspect ((this handle)) (format #t "[~8x] ~A~%" this 'handle) (format #t "~Tprocess: #x~X~%" (-> this process)) (format #t "~Tpid: ~D~%" (-> this pid)) @@ -281,7 +254,7 @@ ) ;; definition for method 2 of type handle -(defmethod print handle ((this handle)) +(defmethod print ((this handle)) (if (nonzero? this) (format #t "#" (handle->process this) (-> this pid)) (format #t "#") @@ -291,22 +264,19 @@ ;; definition of type state (deftype state (protect-frame) - ((code function :offset-assert 16) - (trans (function object) :offset-assert 20) - (post function :offset-assert 24) - (enter function :offset-assert 28) - (event (function process int symbol event-message-block object) :offset-assert 32) + ((code function) + (trans (function object)) + (post function) + (enter function) + (event (function process int symbol event-message-block object)) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 (:methods - (new (symbol type symbol function (function object) function (function object) (function process int symbol event-message-block object)) _type_ 0) + (new (symbol type symbol function (function object) function (function object) (function process int symbol event-message-block object)) _type_) ) ) ;; definition for method 3 of type state -(defmethod inspect state ((this state)) +(defmethod inspect ((this state)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tnext: ~A~%" (-> this next)) @@ -321,20 +291,17 @@ ;; definition of type event-message-block (deftype event-message-block (structure) - ((to process :offset-assert 0) - (from process :offset-assert 4) - (num-params int32 :offset-assert 8) - (message symbol :offset-assert 12) - (param uint64 7 :offset-assert 16) + ((to process) + (from process) + (num-params int32) + (message symbol) + (param uint64 7) ) :always-stack-singleton - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) ;; definition for method 3 of type event-message-block -(defmethod inspect event-message-block ((this event-message-block)) +(defmethod inspect ((this event-message-block)) (format #t "[~8x] ~A~%" this 'event-message-block) (format #t "~Tto: ~A~%" (-> this to)) (format #t "~Tfrom: ~A~%" (-> this from)) diff --git a/test/decompiler/reference/jak1/kernel/gkernel_REF.gc b/test/decompiler/reference/jak1/kernel/gkernel_REF.gc index 74179e33aac..786f7de10b0 100644 --- a/test/decompiler/reference/jak1/kernel/gkernel_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gkernel_REF.gc @@ -26,7 +26,7 @@ (define *last-loado-debug-usage* 0) ;; definition for method 7 of type object -(defmethod relocate object ((this object) (arg0 int)) +(defmethod relocate ((this object) (arg0 int)) this ) @@ -75,7 +75,7 @@ ;; definition for method 1 of type thread ;; INFO: Return type mismatch thread vs none. -(defmethod delete thread ((this thread)) +(defmethod delete ((this thread)) (when (= this (-> this process main-thread)) (break!) 0 @@ -85,7 +85,7 @@ ) ;; definition for method 2 of type thread -(defmethod print thread ((this thread)) +(defmethod print ((this thread)) (format #t "#<~A ~S of ~S pc: #x~X @ #x~X>" @@ -100,7 +100,7 @@ ;; definition for method 9 of type thread ;; INFO: Return type mismatch int vs none. -(defmethod stack-size-set! thread ((this thread) (arg0 int)) +(defmethod stack-size-set! ((this thread) (arg0 int)) (let ((a2-0 (-> this process))) (cond ((!= this (-> a2-0 main-thread)) @@ -154,7 +154,7 @@ ;; definition for method 5 of type cpu-thread ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of cpu-thread ((this cpu-thread)) +(defmethod asize-of ((this cpu-thread)) (the-as int (+ (-> this type size) (-> this stack-size))) ) @@ -271,7 +271,7 @@ ) ;; definition for method 3 of type process-tree -(defmethod inspect process-tree ((this process-tree)) +(defmethod inspect ((this process-tree)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~S~%" (-> this name)) (format #t "~Tmask: #x~X~%" (-> this mask)) @@ -333,7 +333,7 @@ ) ;; definition for method 3 of type process -(defmethod inspect process ((this process)) +(defmethod inspect ((this process)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~S~%" (-> this name)) (format #t "~Tmask: #x~X~%" (-> this mask)) @@ -368,13 +368,13 @@ ;; definition for method 5 of type process ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of process ((this process)) +(defmethod asize-of ((this process)) (the-as int (+ (-> process size) (-> this allocated-length))) ) ;; definition for method 2 of type process ;; INFO: this function exists in multiple non-identical object files -(defmethod print process ((this process)) +(defmethod print ((this process)) (format #t "#<~A ~S ~A :state ~S " (-> this type) (-> this name) (-> this status) (if (-> this state) (-> this state name) ) @@ -431,7 +431,7 @@ ) ;; definition for method 14 of type dead-pool -(defmethod get-process dead-pool ((this dead-pool) (arg0 type) (arg1 int)) +(defmethod get-process ((this dead-pool) (arg0 type) (arg1 int)) (let ((s4-0 (the-as object (-> this child)))) (when (and (not (the-as (pointer process-tree) s4-0)) *debug-segment* (!= this *debug-dead-pool*)) (set! s4-0 (get-process *debug-dead-pool* arg0 arg1)) @@ -466,7 +466,7 @@ ;; definition for method 15 of type dead-pool ;; INFO: Return type mismatch process-tree vs none. -(defmethod return-process dead-pool ((this dead-pool) (arg0 process)) +(defmethod return-process ((this dead-pool) (arg0 process)) (change-parent arg0 this) (none) ) @@ -512,7 +512,7 @@ ;; definition for method 22 of type dead-pool-heap ;; INFO: Return type mismatch object vs pointer. -(defmethod gap-location dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod gap-location ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) (the-as pointer (if (-> arg0 process) @@ -523,7 +523,7 @@ ) ;; definition for method 21 of type dead-pool-heap -(defmethod gap-size dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod gap-size ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) (cond ((-> arg0 process) (let ((v1-3 (&+ (&+ (the-as pointer (-> arg0 process)) (-> process size)) (-> arg0 process allocated-length)))) @@ -543,7 +543,7 @@ ) ;; definition for method 23 of type dead-pool-heap -(defmethod find-gap dead-pool-heap ((this dead-pool-heap) (rec dead-pool-heap-rec)) +(defmethod find-gap ((this dead-pool-heap) (rec dead-pool-heap-rec)) (while (and (-> rec next) (zero? (gap-size this rec))) (set! rec (-> rec next)) ) @@ -552,7 +552,7 @@ ;; definition for method 3 of type dead-pool-heap ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect dead-pool-heap ((this dead-pool-heap)) +(defmethod inspect ((this dead-pool-heap)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -597,12 +597,12 @@ ) ;; definition for method 5 of type dead-pool-heap -(defmethod asize-of dead-pool-heap ((this dead-pool-heap)) +(defmethod asize-of ((this dead-pool-heap)) (+ (the-as int (- -4 (the-as int this))) (the-as int (-> this heap top))) ) ;; definition for method 19 of type dead-pool-heap -(defmethod memory-used dead-pool-heap ((this dead-pool-heap)) +(defmethod memory-used ((this dead-pool-heap)) (if (-> this alive-list prev) (- (memory-total this) (gap-size this (-> this alive-list prev))) 0 @@ -610,12 +610,12 @@ ) ;; definition for method 20 of type dead-pool-heap -(defmethod memory-total dead-pool-heap ((this dead-pool-heap)) +(defmethod memory-total ((this dead-pool-heap)) (&- (-> this heap top) (the-as uint (-> this heap base))) ) ;; definition for method 25 of type dead-pool-heap -(defmethod memory-free dead-pool-heap ((this dead-pool-heap)) +(defmethod memory-free ((this dead-pool-heap)) (let ((v1-0 (-> this heap top))) (if (-> this alive-list prev) (gap-size this (-> this alive-list prev)) @@ -625,12 +625,12 @@ ) ;; definition for method 26 of type dead-pool-heap -(defmethod compact-time dead-pool-heap ((this dead-pool-heap)) +(defmethod compact-time ((this dead-pool-heap)) (-> this compact-time) ) ;; definition for method 24 of type dead-pool-heap -(defmethod find-gap-by-size dead-pool-heap ((this dead-pool-heap) (arg0 int)) +(defmethod find-gap-by-size ((this dead-pool-heap) (arg0 int)) (let ((gp-0 (-> this first-gap))) (while (and gp-0 (< (gap-size this gp-0) arg0)) (set! gp-0 (-> gp-0 next)) @@ -640,7 +640,7 @@ ) ;; definition for method 14 of type dead-pool-heap -(defmethod get-process dead-pool-heap ((this dead-pool-heap) (arg0 type) (arg1 int)) +(defmethod get-process ((this dead-pool-heap) (arg0 type) (arg1 int)) (let ((s4-0 (-> this dead-list next)) (s3-0 (the-as process #f)) ) @@ -700,7 +700,7 @@ ;; definition for method 15 of type dead-pool-heap ;; INFO: Return type mismatch int vs none. -(defmethod return-process dead-pool-heap ((this dead-pool-heap) (arg0 process)) +(defmethod return-process ((this dead-pool-heap) (arg0 process)) (if (!= this (-> arg0 pool)) (format 0 "ERROR: process ~A does not belong to dead-pool-heap ~A.~%" arg0 this) ) @@ -733,7 +733,7 @@ ) ;; definition for method 17 of type dead-pool-heap -(defmethod shrink-heap dead-pool-heap ((this dead-pool-heap) (arg0 process)) +(defmethod shrink-heap ((this dead-pool-heap) (arg0 process)) (when arg0 (let ((s5-0 (-> arg0 ppointer))) (when (not (or (logtest? (-> arg0 mask) (process-mask heap-shrunk)) @@ -757,7 +757,7 @@ ;; definition for method 16 of type dead-pool-heap ;; INFO: Return type mismatch int vs none. -(defmethod compact dead-pool-heap ((this dead-pool-heap) (arg0 int)) +(defmethod compact ((this dead-pool-heap) (arg0 int)) (let* ((s4-0 (memory-free this)) (v1-2 (memory-total this)) (f0-2 (/ (the float s4-0) (the float v1-2))) @@ -815,7 +815,7 @@ ;; definition for method 18 of type dead-pool-heap ;; INFO: Return type mismatch int vs none. -(defmethod churn dead-pool-heap ((this dead-pool-heap) (arg0 int)) +(defmethod churn ((this dead-pool-heap) (arg0 int)) (while (nonzero? arg0) (+! arg0 -1) (let ((s4-0 (-> this alive-list next))) @@ -931,7 +931,7 @@ ) ;; definition for method 12 of type process -(defmethod run-logic? process ((this process)) +(defmethod run-logic? ((this process)) #t ) @@ -1290,7 +1290,7 @@ ) ;; definition for method 9 of type process -(defmethod activate process ((this process) (arg0 process-tree) (arg1 basic) (arg2 pointer)) +(defmethod activate ((this process) (arg0 process-tree) (arg1 basic) (arg2 pointer)) (set! (-> this mask) (logclear (-> arg0 mask) (process-mask sleep sleep-code process-tree heap-shrunk))) (set! (-> this status) 'ready) (let ((v1-4 (-> *kernel-context* next-pid))) @@ -1356,7 +1356,7 @@ ;; definition for method 10 of type process-tree ;; INFO: Return type mismatch symbol vs none. -(defmethod deactivate process-tree ((this process-tree)) +(defmethod deactivate ((this process-tree)) (none) ) @@ -1372,7 +1372,7 @@ ;; INFO: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod deactivate process ((this process)) +(defmethod deactivate ((this process)) (local-vars (s7-0 none) (ra-0 int)) (with-pp (when (!= (-> this status) 'dead) diff --git a/test/decompiler/reference/jak1/kernel/gstate_REF.gc b/test/decompiler/reference/jak1/kernel/gstate_REF.gc index c8fd1dd1292..0d4c7724b89 100644 --- a/test/decompiler/reference/jak1/kernel/gstate_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gstate_REF.gc @@ -36,7 +36,7 @@ ) ;; definition for method 2 of type state -(defmethod print state ((this state)) +(defmethod print ((this state)) (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) this ) diff --git a/test/decompiler/reference/jak1/kernel/gstring_REF.gc b/test/decompiler/reference/jak1/kernel/gstring_REF.gc index 866a6849359..f0c3f40da8b 100644 --- a/test/decompiler/reference/jak1/kernel/gstring_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gstring_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 4 of type string -(defmethod length string ((this string)) +(defmethod length ((this string)) (let ((v1-0 (-> this data))) (while (nonzero? (-> v1-0 0)) (nop!) @@ -15,7 +15,7 @@ ) ;; definition for method 5 of type string -(defmethod asize-of string ((this string)) +(defmethod asize-of ((this string)) (+ (-> this allocated-length) 1 (-> string size)) ) diff --git a/test/decompiler/reference/jak1/levels/beach/air-h_REF.gc b/test/decompiler/reference/jak1/levels/beach/air-h_REF.gc index 322b0b1ae81..6244d1a0ab8 100644 --- a/test/decompiler/reference/jak1/levels/beach/air-h_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/air-h_REF.gc @@ -3,22 +3,19 @@ ;; definition of type air-box (deftype air-box (structure) - ((vecs vector 2 :inline :offset-assert 0) - (x-pos float :offset 0) - (height-level float :offset 4) - (z-pos float :offset 8) - (cos-angle float :offset 12) - (x-length float :offset 16) - (z-length float :offset 24) - (sin-angle float :offset 28) + ((vecs vector 2 :inline) + (x-pos float :overlay-at (-> vecs 0 x)) + (height-level float :overlay-at (-> vecs 0 y)) + (z-pos float :overlay-at (-> vecs 0 z)) + (cos-angle float :overlay-at (-> vecs 0 w)) + (x-length float :offset 16) + (z-length float :offset 24) + (sin-angle float :offset 28) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type air-box -(defmethod inspect air-box ((this air-box)) +(defmethod inspect ((this air-box)) (format #t "[~8x] ~A~%" this 'air-box) (format #t "~Tvecs[2] @ #x~X~%" (-> this vecs)) (format #t "~Tx-pos: ~f~%" (the-as float (-> this x-pos))) diff --git a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc index 927306c3219..03c3f32eda4 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc @@ -9,20 +9,16 @@ ;; definition of type windmill-one (deftype windmill-one (process-drawable) - ((root-override collide-shape-moving :offset 112) - (sound-id sound-id :offset-assert 176) + ((root collide-shape-moving :override) + (sound-id sound-id) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states windmill-one-idle ) ) ;; definition for method 3 of type windmill-one -(defmethod inspect windmill-one ((this windmill-one)) +(defmethod inspect ((this windmill-one)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -64,7 +60,7 @@ ;; definition for method 11 of type windmill-one ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! windmill-one ((this windmill-one) (arg0 entity-actor)) +(defmethod init-from-entity! ((this windmill-one) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -101,13 +97,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> this root-override pause-adjust-distance) 409600.0) + (set! (-> this root pause-adjust-distance) 409600.0) (process-drawable-from-entity! this arg0) (initialize-skeleton this *windmill-one-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this sound-id) (new-sound-id)) (go windmill-one-idle) (none) @@ -190,17 +186,13 @@ ;; definition of type grottopole (deftype grottopole (process-drawable) - ((root-override collide-shape :offset 112) - (speed meters :offset-assert 176) - (distance meters :offset-assert 180) - (position int32 :offset-assert 184) - (max-position int32 :offset-assert 188) - (incomming-attack-id uint64 :offset-assert 192) + ((root collide-shape :override) + (speed meters) + (distance meters) + (position int32) + (max-position int32) + (incomming-attack-id uint64) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xc8 - :flag-assert #x14006000c8 (:states grottopole-idle grottopole-moving-down @@ -209,7 +201,7 @@ ) ;; definition for method 3 of type grottopole -(defmethod inspect grottopole ((this grottopole)) +(defmethod inspect ((this grottopole)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -238,11 +230,11 @@ (set! (-> self incomming-attack-id) v1-2) (case (-> block param 1) (('uppercut) - (when (and (< (-> *target* control trans y) (+ -40960.0 (-> self root-override trans y))) + (when (and (< (-> *target* control trans y) (+ -40960.0 (-> self root trans y))) (< (-> self position) (-> self max-position)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 2) ) ) @@ -253,11 +245,11 @@ ) ) (('flop) - (when (and (< (+ -40960.0 (-> self root-override trans y)) (-> *target* control trans y)) + (when (and (< (+ -40960.0 (-> self root trans y)) (-> *target* control trans y)) (> (-> self position) 0) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) ) @@ -303,7 +295,7 @@ (set! s2-0 #t) ) (set! (-> s4-0 y) (* f28-0 arg1)) - (move-by-vector! (-> arg0 root-override) s4-0) + (move-by-vector! (-> arg0 root) s4-0) (+! f30-0 f28-0) ) (set! (-> s3-0 quad) (-> arg0 entity extra trans quad)) @@ -322,7 +314,7 @@ (defun move-grottopole-to-position ((arg0 grottopole)) (let ((a1-0 (new 'stack-no-clear 'vector))) (set-vector! a1-0 0.0 (* (-> arg0 distance) (the float (-> arg0 position))) 0.0 1.0) - (move-by-vector! (-> arg0 root-override) a1-0) + (move-by-vector! (-> arg0 root) a1-0) ) 0 (none) @@ -358,7 +350,7 @@ ;; definition for method 11 of type grottopole ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! grottopole ((this grottopole) (arg0 entity-actor)) +(defmethod init-from-entity! ((this grottopole) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) @@ -396,7 +388,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *grottopole-sg* '()) @@ -413,12 +405,8 @@ ;; definition of type ecoventrock (deftype ecoventrock (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states (ecoventrock-break symbol) ecoventrock-idle @@ -426,7 +414,7 @@ ) ;; definition for method 3 of type ecoventrock -(defmethod inspect ecoventrock ((this ecoventrock)) +(defmethod inspect ((this ecoventrock)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -606,7 +594,7 @@ :code (behavior ((arg0 symbol)) (local-vars (sv-128 symbol)) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (process-entity-status! self (entity-perm-status complete) #t) (let ((v1-2 (entity-actor-lookup (-> self entity) 'alt-actor 0))) @@ -626,10 +614,10 @@ #f #f #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to *entity-pool* ) - (let* ((s5-1 (-> self root-override trans)) + (let* ((s5-1 (-> self root trans)) (v1-14 (target-pos 0)) (f0-1 (- (-> s5-1 x) (-> v1-14 x))) (f1-2 (- (-> s5-1 z) (-> v1-14 z))) @@ -680,19 +668,18 @@ (suspend) ) ) - (let ((gp-1 - (cond - (arg0 - (the-as int #f) - ) - (else - (ambient-hint-spawn "gamcam10" (the-as vector #f) *entity-pool* 'camera) - (ppointer->handle - (process-spawn pov-camera (-> self root-override trans) *beachcam-sg* (-> self name) 0 #f '() :to self) + (let ((gp-1 (cond + (arg0 + (the-as int #f) + ) + (else + (ambient-hint-spawn "gamcam10" (the-as vector #f) *entity-pool* 'camera) + (ppointer->handle + (process-spawn pov-camera (-> self root trans) *beachcam-sg* (-> self name) 0 #f '() :to self) + ) + ) ) ) - ) - ) ) (process-drawable-birth-fuel-cell (the-as entity #f) (the-as vector #f) #f) (while (handle->process (the-as handle gp-1)) @@ -711,7 +698,7 @@ ;; definition for method 11 of type ecoventrock ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ecoventrock ((this ecoventrock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ecoventrock) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -725,13 +712,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *ecoventrock-sg* '()) (set! (-> this link) (new 'process 'actor-link-info this)) (transform-post) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go ecoventrock-break #t) (go ecoventrock-idle) @@ -741,13 +728,9 @@ ;; definition of type flying-rock (deftype flying-rock (process-drawable) - ((root-override collide-shape-moving :offset 112) - (tumble quaternion :inline :offset-assert 176) + ((root collide-shape-moving :override) + (tumble quaternion :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc0 - :flag-assert #x14005000c0 (:states flying-rock-idle flying-rock-rolling @@ -755,7 +738,7 @@ ) ;; definition for method 3 of type flying-rock -(defmethod inspect flying-rock ((this flying-rock)) +(defmethod inspect ((this flying-rock)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -781,7 +764,7 @@ ) (while (< s5-0 2) (cond - ((logtest? (-> self root-override status) (cshape-moving-flags onsurf)) + ((logtest? (-> self root status) (cshape-moving-flags onsurf)) (when (not gp-0) (+! s5-0 1) (set! f30-0 0.8) @@ -795,54 +778,40 @@ ) ) ) - (vector-float*! (-> self root-override transv) (-> self root-override transv) f30-0) - (set! (-> self root-override transv w) 1.0) + (vector-float*! (-> self root transv) (-> self root transv) f30-0) + (set! (-> self root transv w) 1.0) (if (not gp-0) - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0) - ) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 1.0)) ) - (update-transforms! (-> self root-override)) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (collide-kind background) - ) - (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble)) + (update-transforms! (-> self root)) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (collide-kind background)) + (quaternion*! (-> self root quat) (-> self root quat) (-> self tumble)) (suspend) ) ) - (while (< 2048.0 (vector-length (-> self root-override transv))) + (while (< 2048.0 (vector-length (-> self root transv))) (cond - ((logtest? (-> self root-override status) (cshape-moving-flags onsurf)) - (vector-float*! (-> self root-override transv) (-> self root-override transv) 0.8) + ((logtest? (-> self root status) (cshape-moving-flags onsurf)) + (vector-float*! (-> self root transv) (-> self root transv) 0.8) ) (else - (vector-float*! (-> self root-override transv) (-> self root-override transv) 0.99) - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0) - ) + (vector-float*! (-> self root transv) (-> self root transv) 0.99) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 1.0)) ) ) - (set! (-> self root-override transv w) 1.0) - (update-transforms! (-> self root-override)) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (collide-kind background) - ) + (set! (-> self root transv w) 1.0) + (update-transforms! (-> self root)) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (collide-kind background)) (let ((gp-2 (new 'stack-no-clear 'vector)) - (f30-1 (vector-length (-> self root-override transv))) + (f30-1 (vector-length (-> self root transv))) ) - (set-vector! gp-2 (-> self root-override transv z) 0.0 (- (-> self root-override transv x)) 1.0) + (set-vector! gp-2 (-> self root transv z) 0.0 (- (-> self root transv x)) 1.0) (vector-normalize! gp-2 1.0) (let ((f0-12 (* 0.00061035156 (seconds-per-frame) f30-1))) (quaternion-vector-angle! (-> self tumble) gp-2 (* 10430.379 f0-12)) ) ) - (quaternion*! (-> self root-override quat) (-> self tumble) (-> self root-override quat)) + (quaternion*! (-> self root quat) (-> self tumble) (-> self root quat)) (suspend) ) (go flying-rock-idle) @@ -858,11 +827,9 @@ ;; failed to figure out what this is: (defstate flying-rock-idle (flying-rock) :code (behavior () - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (while (or (logtest? (-> self draw status) (draw-status was-drawn)) - (and *target* - (>= 204800.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (and *target* (>= 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) ) (suspend) ) @@ -893,10 +860,10 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set-vector! (-> self root-override scale) arg2 arg2 arg2 1.0) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-vector! (-> self root scale) arg2 arg2 arg2 1.0) (let ((s5-1 (new-stack-vector0))) (set-vector! s5-1 @@ -908,9 +875,9 @@ (vector-normalize! s5-1 1.0) (quaternion-vector-angle! (-> self tumble) s5-1 (rand-vu-float-range 0.0 1820.4445)) ) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (rand-vu-float-range 0.0 65536.0)) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (rand-vu-float-range 0.0 65536.0)) (initialize-skeleton self *kickrock-sg* '()) - (set! (-> self root-override transv quad) (-> arg1 quad)) + (set! (-> self root transv quad) (-> arg1 quad)) (go flying-rock-rolling) (none) ) @@ -925,20 +892,16 @@ ;; definition of type bladeassm (deftype bladeassm (process-drawable) - ((root-override collide-shape-moving :offset 112) - (angle float :offset-assert 176) + ((root collide-shape-moving :override) + (angle float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states bladeassm-idle ) ) ;; definition for method 3 of type bladeassm -(defmethod inspect bladeassm ((this bladeassm)) +(defmethod inspect ((this bladeassm)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -976,7 +939,7 @@ ;; definition for method 11 of type bladeassm ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! bladeassm ((this bladeassm) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bladeassm) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -995,7 +958,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *bladeassm-sg* '()) @@ -1009,24 +972,20 @@ ;; definition of type flutflutegg (deftype flutflutegg (process-drawable) - ((root-override collide-shape-moving :offset 112) - (fall-dist meters :offset-assert 176) - (start vector :inline :offset-assert 192) - (dir vector :inline :offset-assert 208) - (pos float :offset-assert 224) - (vel float :offset-assert 228) - (wobbler wobbler :offset-assert 232) - (last-impulse-time int32 :offset-assert 236) - (incomming-attack-id uint64 :offset-assert 240) - (ambients-played int32 :offset-assert 248) - (ambient ambient-control :inline :offset-assert 256) + ((root collide-shape-moving :override) + (fall-dist meters) + (start vector :inline) + (dir vector :inline) + (pos float) + (vel float) + (wobbler wobbler) + (last-impulse-time int32) + (incomming-attack-id uint64) + (ambients-played int32) + (ambient ambient-control :inline) ) - :heap-base #xa0 - :method-count-assert 21 - :size-assert #x110 - :flag-assert #x1500a00110 (:methods - (flutflutegg-method-20 (_type_ float float float) none 20) + (flutflutegg-method-20 (_type_ float float float) none) ) (:states (flutflutegg-break symbol) @@ -1037,7 +996,7 @@ ) ;; definition for method 3 of type flutflutegg -(defmethod inspect flutflutegg ((this flutflutegg)) +(defmethod inspect ((this flutflutegg)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1067,7 +1026,7 @@ ) ;; definition for method 7 of type flutflutegg -(defmethod relocate flutflutegg ((this flutflutegg) (arg0 int)) +(defmethod relocate ((this flutflutegg) (arg0 int)) (if (nonzero? (-> this wobbler)) (&+! (-> this wobbler) arg0) ) @@ -1077,7 +1036,7 @@ ;; definition for method 20 of type flutflutegg ;; INFO: Return type mismatch int vs none. ;; WARN: Function (method 20 flutflutegg) has a return type of none, but the expression builder found a return statement. -(defmethod flutflutegg-method-20 flutflutegg ((this flutflutegg) (arg0 float) (arg1 float) (arg2 float)) +(defmethod flutflutegg-method-20 ((this flutflutegg) (arg0 float) (arg1 float) (arg2 float)) (if (not (time-elapsed? (the-as time-frame (-> this last-impulse-time)) (seconds 0.5))) (return 0) ) @@ -1118,10 +1077,7 @@ ) (set! (-> self incomming-attack-id) (-> block param 2)) (flutflutegg-hit-sounds) - (let ((s5-1 - (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) - ) - ) + (let ((s5-1 (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root trans)))) (set! (-> s5-1 y) 0.0) (vector-normalize! s5-1 1.0) (let ((f0-2 (vector-dot s5-1 (-> self dir))) @@ -1176,19 +1132,19 @@ ((not (time-elapsed? (-> self ambient last-ambient-time) (seconds 30))) ) ((< 0.8 f30-0) - (play-ambient (-> self ambient) "BIR-AM07" #f (-> self root-override trans)) + (play-ambient (-> self ambient) "BIR-AM07" #f (-> self root trans)) ) ((< 0.6 f30-0) - (play-ambient (-> self ambient) "BIR-AM08" #f (-> self root-override trans)) + (play-ambient (-> self ambient) "BIR-AM08" #f (-> self root trans)) ) ((< 0.4 f30-0) - (play-ambient (-> self ambient) "BIR-AM09" #f (-> self root-override trans)) + (play-ambient (-> self ambient) "BIR-AM09" #f (-> self root trans)) ) ((< 0.2 f30-0) - (play-ambient (-> self ambient) "BIR-AM12" #f (-> self root-override trans)) + (play-ambient (-> self ambient) "BIR-AM12" #f (-> self root trans)) ) (else - (play-ambient (-> self ambient) "BIR-AM13" #f (-> self root-override trans)) + (play-ambient (-> self ambient) "BIR-AM13" #f (-> self root trans)) ) ) ) @@ -1211,10 +1167,7 @@ ) (set! (-> self incomming-attack-id) (-> block param 2)) (flutflutegg-hit-sounds) - (let ((s5-1 - (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) - ) - ) + (let ((s5-1 (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root trans)))) (set! (-> s5-1 y) 0.0) (vector-normalize! s5-1 1.0) (let ((f0-2 (vector-dot s5-1 (-> self dir))) @@ -1237,11 +1190,11 @@ (let ((a1-0 (new 'stack-no-clear 'vector))) (vector-float*! a1-0 (-> self dir) (-> self pos)) (vector+! a1-0 a1-0 (-> self start)) - (move-to-point! (-> self root-override) a1-0) + (move-to-point! (-> self root) a1-0) ) - (wobbler-method-12 (-> self wobbler) (-> self root-override quat)) + (wobbler-method-12 (-> self wobbler) (-> self root quat)) (let ((a2-3 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 -18204.445))) - (quaternion*! (-> self root-override quat) (-> self root-override quat) a2-3) + (quaternion*! (-> self root quat) (-> self root quat) a2-3) ) (suspend) (when (>= (-> self pos) (-> self fall-dist)) @@ -1288,16 +1241,13 @@ ) (close-specific-task! (game-task beach-flutflut) (task-status need-reminder)) (loop - (vector-float*! (-> self root-override transv) (-> self dir) (-> self vel)) + (vector-float*! (-> self root transv) (-> self dir) (-> self vel)) (set-time! (-> self state-time)) (until v1-25 - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) - ) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) (integrate-for-enemy-with-move-to-ground! - (-> self root-override) - (-> self root-override transv) + (-> self root) + (-> self root transv) (collide-kind background) 8192.0 #f @@ -1305,13 +1255,13 @@ #f ) (move! (-> self wobbler)) - (wobbler-method-12 (-> self wobbler) (-> self root-override quat)) + (wobbler-method-12 (-> self wobbler) (-> self root quat)) (let ((a2-6 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 -18204.445))) - (quaternion*! (-> self root-override quat) (-> self root-override quat) a2-6) + (quaternion*! (-> self root quat) (-> self root quat) a2-6) ) (suspend) (set! v1-25 (and (time-elapsed? (-> self state-time) (seconds 0.5)) - (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) + (logtest? (-> self root status) (cshape-moving-flags onsurf)) ) ) ) @@ -1326,11 +1276,11 @@ (defstate flutflutegg-break (flutflutegg) :code (behavior ((arg0 symbol)) (when arg0 - (set-vector! (-> self root-override trans) -231190.94 64559.105 -1164727.5 1.0) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 -18204.445) + (set-vector! (-> self root trans) -231190.94 64559.105 -1164727.5 1.0) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 -18204.445) ) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (when (not arg0) (ja-no-eval :group! flutflutegg-crack-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -1366,8 +1316,8 @@ (suspend) ) (ja-channel-set! 1) - (set-vector! (-> self root-override trans) -231190.94 64559.105 -1164727.5 1.0) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 0.0) + (set-vector! (-> self root trans) -231190.94 64559.105 -1164727.5 1.0) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 0.0) (ja :group! flutflutegg-broke-ja :num! max) (loop (logior! (-> self mask) (process-mask sleep)) @@ -1380,7 +1330,7 @@ ;; definition for method 11 of type flutflutegg ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! flutflutegg ((this flutflutegg) (arg0 entity-actor)) +(defmethod init-from-entity! ((this flutflutegg) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -1413,14 +1363,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *flutflutegg-sg* '()) - (vector-z-quaternion! (-> this dir) (-> this root-override quat)) - (set! (-> this start quad) (-> this root-override trans quad)) + (vector-z-quaternion! (-> this dir) (-> this root quat)) + (set! (-> this start quad) (-> this root trans quad)) (set! (-> this fall-dist) 20480.0) - (set-yaw-angle-clear-roll-pitch! (-> this root-override) (+ -16384.0 (y-angle (-> this root-override)))) + (set-yaw-angle-clear-roll-pitch! (-> this root) (+ -16384.0 (y-angle (-> this root)))) (set! (-> this pos) 0.0) (set! (-> this vel) 0.0) (set! (-> this wobbler) (new 'process 'wobbler)) @@ -1436,13 +1386,9 @@ ;; definition of type harvester (deftype harvester (process-drawable) - ((root-override collide-shape :offset 112) - (alt-actor entity-actor :offset-assert 176) + ((root collide-shape :override) + (alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states harvester-idle (harvester-inflate symbol) @@ -1450,7 +1396,7 @@ ) ;; definition for method 3 of type harvester -(defmethod inspect harvester ((this harvester)) +(defmethod inspect ((this harvester)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1511,7 +1457,7 @@ ;; definition for method 11 of type harvester ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! harvester ((this harvester) (arg0 entity-actor)) +(defmethod init-from-entity! ((this harvester) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) @@ -1569,7 +1515,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *harvester-sg* '()) @@ -1581,13 +1527,10 @@ ;; definition of type beachcam (deftype beachcam (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) ;; definition for method 3 of type beachcam -(defmethod inspect beachcam ((this beachcam)) +(defmethod inspect ((this beachcam)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) diff --git a/test/decompiler/reference/jak1/levels/beach/beach-part_REF.gc b/test/decompiler/reference/jak1/levels/beach/beach-part_REF.gc index 660ceaff61f..657e7c51768 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-part_REF.gc @@ -4,17 +4,13 @@ ;; definition of type beach-part (deftype beach-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 (:states beach-part-grotto-1 ) ) ;; definition for method 3 of type beach-part -(defmethod inspect beach-part ((this beach-part)) +(defmethod inspect ((this beach-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc b/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc index 0e0cfae0ad2..1e11dc6a91a 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc @@ -234,27 +234,23 @@ ;; definition of type beach-rock (deftype beach-rock (process-drawable) - ((root-override collide-shape-moving :offset 112) - (trigger basic :offset-assert 176) - (movie-start time-frame :offset-assert 184) - (part-falling sparticle-launch-control :offset-assert 192) - (part-landing sparticle-launch-control :offset-assert 196) - (prev-frame float :offset-assert 200) + ((root collide-shape-moving :override) + (trigger basic) + (movie-start time-frame) + (part-falling sparticle-launch-control) + (part-landing sparticle-launch-control) + (prev-frame float) ) - :heap-base #x60 - :method-count-assert 24 - :size-assert #xcc - :flag-assert #x18006000cc - (:methods - (idle () _type_ :state 20) - (loading () _type_ :state 21) - (falling () _type_ :state 22) - (fallen () _type_ :state 23) + (:state-methods + idle + loading + falling + fallen ) ) ;; definition for method 3 of type beach-rock -(defmethod inspect beach-rock ((this beach-rock)) +(defmethod inspect ((this beach-rock)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -267,7 +263,7 @@ ) ;; definition for method 7 of type beach-rock -(defmethod relocate beach-rock ((this beach-rock) (arg0 int)) +(defmethod relocate ((this beach-rock) (arg0 int)) (if (nonzero? (-> this part-falling)) (set! (-> this part-falling) (the-as sparticle-launch-control (+ (the-as int (-> this part-falling)) arg0))) ) @@ -278,7 +274,7 @@ ) ;; definition for method 10 of type beach-rock -(defmethod deactivate beach-rock ((this beach-rock)) +(defmethod deactivate ((this beach-rock)) (if (nonzero? (-> this part-falling)) (kill-and-free-particles (-> this part-falling)) ) @@ -336,7 +332,7 @@ (let ((f30-0 (ja-aframe-num 0))) (when (and (< -50.0 f30-0) (< f30-0 158.0)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (spawn (-> self part) gp-0) (+! (-> gp-0 x) 122880.0) (+! (-> gp-0 z) 102400.0) @@ -449,11 +445,11 @@ (ja :group! lrocklrg-fallen-ja) (compute-alignment! (-> self align)) (let ((v1-6 (first-transform (-> self align)))) - (set! (-> self root-override trans quad) (-> self entity extra trans quad)) - (+! (-> self root-override trans y) (-> v1-6 trans y)) + (set! (-> self root trans quad) (-> self entity extra trans quad)) + (+! (-> self root trans y) (-> v1-6 trans y)) ) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (logior! (-> self mask) (process-mask sleep)) (suspend) 0 @@ -463,7 +459,7 @@ ;; definition for method 11 of type beach-rock ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! beach-rock ((this beach-rock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this beach-rock) (arg0 entity-actor)) (set! (-> this link) (new 'process 'actor-link-info this)) (set! (-> this align) (new 'process 'align-control this)) (set! (-> this trigger) #f) @@ -502,14 +498,10 @@ ;; definition of type lrocklrg (deftype lrocklrg (beach-rock) () - :heap-base #x60 - :method-count-assert 24 - :size-assert #xcc - :flag-assert #x18006000cc ) ;; definition for method 3 of type lrocklrg -(defmethod inspect lrocklrg ((this lrocklrg)) +(defmethod inspect ((this lrocklrg)) (let ((t9-0 (method-of-type beach-rock inspect))) (t9-0 this) ) @@ -517,7 +509,7 @@ ) ;; definition for method 11 of type lrocklrg -(defmethod init-from-entity! lrocklrg ((this lrocklrg) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lrocklrg) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -536,7 +528,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lrocklrg-sg* '()) diff --git a/test/decompiler/reference/jak1/levels/beach/bird-lady-beach_REF.gc b/test/decompiler/reference/jak1/levels/beach/bird-lady-beach_REF.gc index ef3a6fc96b9..a1877ba135c 100644 --- a/test/decompiler/reference/jak1/levels/beach/bird-lady-beach_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/bird-lady-beach_REF.gc @@ -3,17 +3,13 @@ ;; definition of type bird-lady-beach (deftype bird-lady-beach (process-taskable) - ((flutflut handle :offset-assert 384) - (egg handle :offset-assert 392) + ((flutflut handle) + (egg handle) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x190 - :flag-assert #x3501200190 ) ;; definition for method 3 of type bird-lady-beach -(defmethod inspect bird-lady-beach ((this bird-lady-beach)) +(defmethod inspect ((this bird-lady-beach)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -51,21 +47,19 @@ ) ;; definition for method 32 of type bird-lady-beach -(defmethod play-anim! bird-lady-beach ((this bird-lady-beach) (arg0 symbol)) +(defmethod play-anim! ((this bird-lady-beach) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (when arg0 (set! (-> this cell-for-task) (current-task (-> this tasks))) (close-current! (-> this tasks)) (set! (-> this flutflut) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *flutflut-naked-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *flutflut-naked-sg* #f :to this)) ) (send-event (handle->process (-> this flutflut)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this flutflut)) 'blend-shape #t) (set! (-> this egg) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *flutflutegg-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *flutflutegg-sg* #f :to this)) ) (send-event (handle->process (-> this egg)) 'anim-mode 'clone-anim) ) @@ -91,17 +85,17 @@ ) ;; definition for method 31 of type bird-lady-beach -(defmethod get-art-elem bird-lady-beach ((this bird-lady-beach)) +(defmethod get-art-elem ((this bird-lady-beach)) (-> this draw art-group data 3) ) ;; definition for method 39 of type bird-lady-beach -(defmethod should-display? bird-lady-beach ((this bird-lady-beach)) +(defmethod should-display? ((this bird-lady-beach)) (= (current-status (-> this tasks)) (task-status need-reward-speech)) ) ;; definition for method 11 of type bird-lady-beach -(defmethod init-from-entity! bird-lady-beach ((this bird-lady-beach) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bird-lady-beach) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *bird-lady-beach-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task beach-flutflut))) (set! (-> this sound-flava) (music-flava birdlady)) diff --git a/test/decompiler/reference/jak1/levels/beach/bird-lady_REF.gc b/test/decompiler/reference/jak1/levels/beach/bird-lady_REF.gc index 96d2c895ab2..dcd108f0172 100644 --- a/test/decompiler/reference/jak1/levels/beach/bird-lady_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/bird-lady_REF.gc @@ -4,14 +4,10 @@ ;; definition of type bird-lady (deftype bird-lady (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type bird-lady -(defmethod inspect bird-lady ((this bird-lady)) +(defmethod inspect ((this bird-lady)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -27,10 +23,10 @@ ;; definition for method 52 of type bird-lady ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 bird-lady ((this bird-lady)) +(defmethod process-taskable-method-52 ((this bird-lady)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -1024.0 f0-0))) ) @@ -48,7 +44,7 @@ ;; definition for method 48 of type bird-lady ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow bird-lady ((this bird-lady)) +(defmethod draw-npc-shadow ((this bird-lady)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -72,7 +68,7 @@ ) ;; definition for method 32 of type bird-lady -(defmethod play-anim! bird-lady ((this bird-lady) (arg0 symbol)) +(defmethod play-anim! ((this bird-lady) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 @@ -137,23 +133,23 @@ ) ;; definition for method 31 of type bird-lady -(defmethod get-art-elem bird-lady ((this bird-lady)) +(defmethod get-art-elem ((this bird-lady)) (-> this draw art-group data 3) ) ;; definition for method 43 of type bird-lady -(defmethod process-taskable-method-43 bird-lady ((this bird-lady)) +(defmethod process-taskable-method-43 ((this bird-lady)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.66 f0-2) - (play-ambient (-> this ambient) "BIR-LO02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIR-LO02" #f (-> this root trans)) ) ((< 0.33 f0-2) - (play-ambient (-> this ambient) "BIR-LO03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIR-LO03" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "BIR-am08" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIR-am08" #f (-> this root trans)) ) ) ) @@ -162,13 +158,13 @@ ;; definition for method 47 of type bird-lady ;; INFO: Return type mismatch basic vs symbol. -(defmethod target-above-threshold? bird-lady ((this bird-lady)) +(defmethod target-above-threshold? ((this bird-lady)) (the-as symbol (and *target* (< (-> (target-pos 0) z) -81920.0))) ) ;; definition for method 11 of type bird-lady ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! bird-lady ((this bird-lady) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bird-lady) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *bird-lady-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task beach-flutflut))) (set! (-> this sound-flava) (music-flava birdlady)) diff --git a/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc b/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc index a98db06df1a..d27440c6c5b 100644 --- a/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc @@ -54,19 +54,15 @@ ;; definition of type lurkercrab (deftype lurkercrab (nav-enemy) - ((orient basic :offset-assert 400) + ((orient basic) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x194 - :flag-assert #x4c01300194 (:states lurkercrab-pushed ) ) ;; definition for method 3 of type lurkercrab -(defmethod inspect lurkercrab ((this lurkercrab)) +(defmethod inspect ((this lurkercrab)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -82,7 +78,7 @@ ;; definition for method 44 of type lurkercrab ;; INFO: Return type mismatch symbol vs object. -(defmethod touch-handler lurkercrab ((this lurkercrab) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this lurkercrab) (arg0 process) (arg1 event-message-block)) (if (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) @@ -107,7 +103,7 @@ ;; definition for method 43 of type lurkercrab ;; INFO: Used lq/sq -(defmethod attack-handler lurkercrab ((this lurkercrab) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this lurkercrab) (arg0 process) (arg1 event-message-block)) (let ((s5-0 (-> this incomming-attack-id))) (set! (-> this incomming-attack-id) (the-as handle (-> arg1 param 2))) (let ((v1-1 (-> arg1 param 1))) @@ -169,7 +165,7 @@ nav-enemy-default-event-handler ;; definition for method 37 of type lurkercrab ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-37 lurkercrab ((this lurkercrab)) +(defmethod nav-enemy-method-37 ((this lurkercrab)) (when (-> this orient) (if (logtest? (nav-control-flags navcf19) (-> this nav flags)) (seek-to-point-toward-point! @@ -199,7 +195,7 @@ nav-enemy-default-event-handler ;; definition for method 38 of type lurkercrab ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-38 lurkercrab ((this lurkercrab)) +(defmethod nav-enemy-method-38 ((this lurkercrab)) (integrate-for-enemy-with-move-to-ground! (-> this collide-info) (-> this collide-info transv) @@ -554,7 +550,7 @@ nav-enemy-default-event-handler ;; definition for method 11 of type lurkercrab ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lurkercrab ((this lurkercrab) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lurkercrab) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) diff --git a/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc b/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc index 6aa74e7d143..0745f1a0e59 100644 --- a/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc @@ -4,14 +4,10 @@ ;; definition of type lurkerpuppy (deftype lurkerpuppy (nav-enemy) () - :heap-base #x120 - :method-count-assert 76 - :size-assert #x190 - :flag-assert #x4c01200190 ) ;; definition for method 3 of type lurkerpuppy -(defmethod inspect lurkerpuppy ((this lurkerpuppy)) +(defmethod inspect ((this lurkerpuppy)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -248,7 +244,7 @@ nav-enemy-default-event-handler ;; definition for method 47 of type lurkerpuppy ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision lurkerpuppy ((this lurkerpuppy)) +(defmethod initialize-collision ((this lurkerpuppy)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -273,7 +269,7 @@ nav-enemy-default-event-handler ;; definition for method 48 of type lurkerpuppy ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 lurkerpuppy ((this lurkerpuppy)) +(defmethod nav-enemy-method-48 ((this lurkerpuppy)) (initialize-skeleton this *lurkerpuppy-sg* '()) (init-defaults! this *lurkerpuppy-nav-enemy-info*) (when (nonzero? (-> this neck)) diff --git a/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc b/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc index 03e7e6c66b7..6b652f81ec2 100644 --- a/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc @@ -3,21 +3,17 @@ ;; definition of type lurkerworm (deftype lurkerworm (process-drawable) - ((root-override collide-shape-moving :offset 112) - (twister twister :offset-assert 176) - (head-tilt float :offset-assert 180) - (strike-count int32 :offset-assert 184) - (angle float :offset-assert 188) - (vulnerable symbol :offset-assert 192) - (part2 sparticle-launch-control :offset-assert 196) + ((root collide-shape-moving :override) + (twister twister) + (head-tilt float) + (strike-count int32) + (angle float) + (vulnerable symbol) + (part2 sparticle-launch-control) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16006000c8 (:methods - (lurkerworm-method-20 (_type_) none 20) - (particle-effect (_type_) none 21) + (lurkerworm-method-20 (_type_) none) + (particle-effect (_type_) none) ) (:states lurkerworm-die @@ -31,7 +27,7 @@ ) ;; definition for method 3 of type lurkerworm -(defmethod inspect lurkerworm ((this lurkerworm)) +(defmethod inspect ((this lurkerworm)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -46,7 +42,7 @@ ;; definition for method 7 of type lurkerworm ;; INFO: Return type mismatch process-drawable vs lurkerworm. -(defmethod relocate lurkerworm ((this lurkerworm) (arg0 int)) +(defmethod relocate ((this lurkerworm) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -57,7 +53,7 @@ ) ;; definition for method 10 of type lurkerworm -(defmethod deactivate lurkerworm ((this lurkerworm)) +(defmethod deactivate ((this lurkerworm)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -224,9 +220,9 @@ ;; definition for method 20 of type lurkerworm ;; INFO: Return type mismatch int vs none. -(defmethod lurkerworm-method-20 lurkerworm ((this lurkerworm)) +(defmethod lurkerworm-method-20 ((this lurkerworm)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (target-pos 0) (-> this root-override trans)) + (vector-! s5-0 (target-pos 0) (-> this root trans)) (set-target! (-> this twister) (atan (-> s5-0 x) (-> s5-0 z))) (twister-method-11 (-> this twister)) (let* ((f0-5 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z))))) @@ -266,7 +262,7 @@ ;; definition for method 21 of type lurkerworm ;; INFO: Return type mismatch int vs none. -(defmethod particle-effect lurkerworm ((this lurkerworm)) +(defmethod particle-effect ((this lurkerworm)) (let ((a2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 5)))) (launch-particles (-> *part-id-table* 661) a2-0) ) @@ -293,7 +289,7 @@ (('touch) (if ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) @@ -328,7 +324,7 @@ lurkerworm-default-post-behavior (loop (if (and (time-elapsed? (-> self state-time) (seconds 1)) *target* - (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (go lurkerworm-spot) ) @@ -348,10 +344,10 @@ lurkerworm-default-post-behavior :code (behavior () (set! (-> self part local-clock) 0) (loop - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (particle-effect self) (when (time-elapsed? (-> self state-time) (seconds 1)) - (if (and *target* (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and *target* (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (go lurkerworm-rise) (go lurkerworm-idle) ) @@ -372,7 +368,7 @@ lurkerworm-default-post-behavior (ja-channel-set! 1) (ja-no-eval :group! lurkerworm-rise-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (particle-effect self) (suspend) (ja :num! (seek!)) @@ -410,13 +406,13 @@ lurkerworm-default-post-behavior (particle-effect self) (when gp-1 (let* ((f0-13 - (- 1.0 (* 0.00009765625 - (+ -16384.0 (if *target* - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - 4096000.0 - ) - ) - ) + (- 1.0 + (* 0.00009765625 (+ -16384.0 (if *target* + (vector-vector-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + ) + ) ) ) (f30-2 (* 0.2 f0-13)) @@ -474,7 +470,7 @@ lurkerworm-default-post-behavior :code (behavior () (ja-no-eval :group! lurkerworm-sink-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (spawn (-> self part2) (-> self root-override trans)) + (spawn (-> self part2) (-> self root trans)) (particle-effect self) (suspend) (ja :num! (seek!)) @@ -489,7 +485,7 @@ lurkerworm-default-post-behavior :event process-drawable-death-event-handler :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (let ((v1-3 (-> self root-override root-prim))) + (let ((v1-3 (-> self root root-prim))) (set! (-> v1-3 collide-with) (collide-kind)) (set! (-> v1-3 prim-core collide-as) (collide-kind)) ) @@ -506,7 +502,7 @@ lurkerworm-default-post-behavior ;; definition for method 11 of type lurkerworm ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lurkerworm ((this lurkerworm) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lurkerworm) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -576,7 +572,7 @@ lurkerworm-default-post-behavior ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lurkerworm-sg* '()) @@ -592,8 +588,8 @@ lurkerworm-default-post-behavior (set! (-> this head-tilt) 0.0) (set! (-> this skel prebind-function) lurkerworm-prebind-function) (set! (-> this skel postbind-function) lurkerworm-joint-callback) - (set! (-> this root-override nav-radius) 12288.0) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this root nav-radius) 12288.0) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (go lurkerworm-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/beach/mayor_REF.gc b/test/decompiler/reference/jak1/levels/beach/mayor_REF.gc index 74deed54571..14dec546ac3 100644 --- a/test/decompiler/reference/jak1/levels/beach/mayor_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/mayor_REF.gc @@ -4,14 +4,10 @@ ;; definition of type mayor (deftype mayor (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type mayor -(defmethod inspect mayor ((this mayor)) +(defmethod inspect ((this mayor)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -27,10 +23,10 @@ ;; definition for method 52 of type mayor ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-52 mayor ((this mayor)) +(defmethod process-taskable-method-52 ((this mayor)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) ) @@ -45,7 +41,7 @@ ;; definition for method 48 of type mayor ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow mayor ((this mayor)) +(defmethod draw-npc-shadow ((this mayor)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -79,7 +75,7 @@ ) ;; definition for method 32 of type mayor -(defmethod play-anim! mayor ((this mayor) (arg0 symbol)) +(defmethod play-anim! ((this mayor) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -641,60 +637,60 @@ ) ;; definition for method 31 of type mayor -(defmethod get-art-elem mayor ((this mayor)) +(defmethod get-art-elem ((this mayor)) (-> this draw art-group data 3) ) ;; definition for method 39 of type mayor -(defmethod should-display? mayor ((this mayor)) +(defmethod should-display? ((this mayor)) (if *target* - (< (- (-> (target-pos 0) z) (-> this root-override trans z)) 57344.0) - (< (- (-> (camera-pos) z) (-> this root-override trans z)) 57344.0) + (< (- (-> (target-pos 0) z) (-> this root trans z)) 57344.0) + (< (- (-> (camera-pos) z) (-> this root trans z)) 57344.0) ) ) ;; definition for method 43 of type mayor -(defmethod process-taskable-method-43 mayor ((this mayor)) +(defmethod process-taskable-method-43 ((this mayor)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8888889 f0-2) (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> this ambient) "CHI-LO01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-LO01" #f (-> this root trans)) ) ) ((< 0.7777778 f0-2) (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> this ambient) "CHI-LO02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-LO02" #f (-> this root trans)) ) ) ((< 0.6666667 f0-2) (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> this ambient) "CHI-AM07" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM07" #f (-> this root trans)) ) ) ((< 0.5555556 f0-2) - (play-ambient (-> this ambient) "CHI-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM06" #f (-> this root trans)) ) ((< 0.44444445 f0-2) - (play-ambient (-> this ambient) "CHI-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM05" #f (-> this root trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> this ambient) "CHI-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM04" #f (-> this root trans)) ) ((< 0.22222222 f0-2) (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> this ambient) "CHI-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM03" #f (-> this root trans)) ) ) ((< 0.11111111 f0-2) (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> this ambient) "CHI-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM02" #f (-> this root trans)) ) ) (else (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> this ambient) "CHI-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "CHI-AM01" #f (-> this root trans)) ) ) ) @@ -717,12 +713,12 @@ ((the-as (function none) t9-0)) ) ) - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) ) ) ;; definition for method 11 of type mayor -(defmethod init-from-entity! mayor ((this mayor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mayor) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *mayor-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) (set! (-> this bounce-away) #f) (set! (-> this tasks) (get-task-control (game-task jungle-lurkerm))) diff --git a/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc b/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc index ab74e7a4c56..246ec8277b9 100644 --- a/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc @@ -3,24 +3,21 @@ ;; definition of type pelican-bank (deftype pelican-bank (basic) - ((circle-speed meters :offset-assert 4) - (dive-time seconds :offset-assert 8) - (to-nest0-time seconds :offset-assert 16) - (to-nest1-time seconds :offset-assert 24) - (land-time seconds :offset-assert 32) - (from-nest-time seconds :offset-assert 40) - (spit-time seconds :offset-assert 48) - (pre-spit-wait-time seconds :offset-assert 56) - (post-spit-wait-time seconds :offset-assert 64) - (run-away-time seconds :offset-assert 72) + ((circle-speed meters) + (dive-time seconds) + (to-nest0-time seconds) + (to-nest1-time seconds) + (land-time seconds) + (from-nest-time seconds) + (spit-time seconds) + (pre-spit-wait-time seconds) + (post-spit-wait-time seconds) + (run-away-time seconds) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type pelican-bank -(defmethod inspect pelican-bank ((this pelican-bank)) +(defmethod inspect ((this pelican-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tcircle-speed: (meters ~m)~%" (-> this circle-speed)) (format #t "~Tdive-time: (seconds ~e)~%" (-> this dive-time)) @@ -52,35 +49,31 @@ ;; definition of type pelican (deftype pelican (process-drawable) - ((root-override collide-shape-moving :offset 112) - (query gui-query :inline :offset-assert 176) - (fuel-cell handle :offset-assert 208) - (cam-tracker handle :offset-assert 216) - (path-data curve-control 8 :offset-assert 224) - (path-circle curve-control :offset 224) - (path-dive0 curve-control :offset 228) - (path-to-nest0 curve-control :offset 232) - (path-from-nest0 curve-control :offset 236) - (path-spit0 curve-control :offset 240) - (path-dive1 curve-control :offset 244) - (path-to-nest1 curve-control :offset 248) - (path-to-nest2 curve-control :offset 252) - (path-cache curve-control :offset-assert 256) - (time-cache time-frame :offset-assert 264) - (path-pos float :offset-assert 272) - (path-speed float :offset-assert 276) - (path-max float :offset-assert 280) - (path-vector vector :inline :offset-assert 288) - (state-vector vector :inline :offset-assert 304) - (state-vector1 vector :inline :offset-assert 320) - (state-float float 2 :offset-assert 336) - (state-object symbol :offset-assert 344) - (neck joint-mod :offset-assert 348) + ((root collide-shape-moving :override) + (query gui-query :inline) + (fuel-cell handle) + (cam-tracker handle) + (path-data curve-control 8) + (path-circle curve-control :overlay-at (-> path-data 0)) + (path-dive0 curve-control :overlay-at (-> path-data 1)) + (path-to-nest0 curve-control :overlay-at (-> path-data 2)) + (path-from-nest0 curve-control :overlay-at (-> path-data 3)) + (path-spit0 curve-control :overlay-at (-> path-data 4)) + (path-dive1 curve-control :overlay-at (-> path-data 5)) + (path-to-nest1 curve-control :overlay-at (-> path-data 6)) + (path-to-nest2 curve-control :overlay-at (-> path-data 7)) + (path-cache curve-control) + (time-cache time-frame) + (path-pos float) + (path-speed float) + (path-max float) + (path-vector vector :inline) + (state-vector vector :inline) + (state-vector1 vector :inline) + (state-float float 2) + (state-object symbol) + (neck joint-mod) ) - :heap-base #xf0 - :method-count-assert 20 - :size-assert #x160 - :flag-assert #x1400f00160 (:states pelican-circle (pelican-dive path-control curve-control time-frame) @@ -95,7 +88,7 @@ ) ;; definition for method 3 of type pelican -(defmethod inspect pelican ((this pelican)) +(defmethod inspect ((this pelican)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -126,7 +119,7 @@ ) ;; definition for method 7 of type pelican -(defmethod relocate pelican ((this pelican) (arg0 int)) +(defmethod relocate ((this pelican) (arg0 int)) (countdown (v1-0 8) (if (nonzero? (-> this path-data v1-0)) (&+! (-> this path-data v1-0) arg0) @@ -158,12 +151,12 @@ ) (eval-path-curve-div! (-> self path) s3-0 f30-0 'interp) (+! (-> s3-0 y) (-> self align align trans y)) - (move-to-point! (-> self root-override) s3-0) + (move-to-point! (-> self root) s3-0) (path-control-method-12 (-> self path) s3-0 f30-0) ) (if arg4 - (set-heading-vec-clear-roll-pitch! (-> self root-override) s3-0) - (seek-toward-heading-vec! (-> self root-override) s3-0 arg0 (the-as time-frame arg1)) + (set-heading-vec-clear-roll-pitch! (-> self root) s3-0) + (seek-toward-heading-vec! (-> self root) s3-0 arg0 (the-as time-frame arg1)) ) ) ) @@ -239,7 +232,7 @@ (('position) (set! (-> self path-pos) (the-as float (-> block param 0))) (let ((a1-3 (path-control-method-12 (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos)))) - (set-heading-vec! (-> self root-override) a1-3) + (set-heading-vec! (-> self root) a1-3) ) ) ) @@ -273,7 +266,7 @@ (set! (-> self path-speed) (/ (* (-> *PELICAN-bank* circle-speed) (-> self path-max)) (path-distance (-> self path))) ) - (set-roll-to-grav-2! (-> self root-override) -2730.6667) + (set-roll-to-grav-2! (-> self root) -2730.6667) ) :trans (behavior () (pelican-path-update 728177.75 30 1.0 (/ (-> self path-max) (path-distance (-> self path))) #f) @@ -370,7 +363,7 @@ (init! (-> self query) (the-as string #f) 40 150 25 #t (the-as string #f)) (set! (-> self state-object) #f) (set-time! (-> self state-time)) - (set-roll-to-grav-2! (-> self root-override) 0.0) + (set-roll-to-grav-2! (-> self root) 0.0) (let ((a0-4 (handle->process (-> self fuel-cell)))) (cond (a0-4 @@ -388,7 +381,7 @@ (set! (-> self path-speed) (/ (* 300.0 (-> self path-max)) (the float (-> *PELICAN-bank* dive-time)))) (let ((gp-1 (new 'stack-no-clear 'vector))) (path-control-method-12 (-> self path) gp-1 (-> self path-pos)) - (set-heading-vec! (-> self root-override) gp-1) + (set-heading-vec! (-> self root) gp-1) ) (set! (-> self draw force-lod) 0) 0 @@ -472,7 +465,7 @@ (('explode) (let ((a0-2 (handle->process (-> self fuel-cell)))) (if a0-2 - (send-event a0-2 'trans (-> self root-override trans)) + (send-event a0-2 'trans (-> self root trans)) ) ) (go pelican-explode #f) @@ -485,7 +478,7 @@ ) ) (f30-0 8192.0) - (gp-1 (-> self root-override)) + (gp-1 (-> self root)) (s4-0 (-> (the-as process-drawable v1-13) root trans)) ) (if (< f30-0 @@ -500,14 +493,7 @@ ) ) (('touch) - (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> block param 0)) - 0.7 - 6144.0 - 16384.0 - ) + (send-shove-back (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) ) ) ) @@ -518,15 +504,14 @@ (set! (-> self path-speed) (/ (* 300.0 (-> self path-max)) (the float (-> *PELICAN-bank* from-nest-time)))) (let ((s5-0 (-> self state-vector))) (eval-path-curve-div! (-> self path) s5-0 (-> self path-pos) 'interp) - (set! (-> self state-float 0) (/ (* 300.0 (vector-vector-distance (-> self root-override trans) s5-0)) - (the float (-> *PELICAN-bank* land-time)) - ) + (set! (-> self state-float 0) + (/ (* 300.0 (vector-vector-distance (-> self root trans) s5-0)) (the float (-> *PELICAN-bank* land-time))) ) ) (path-control-method-12 (-> self path) (-> self path-vector) (-> self path-pos)) (when arg0 - (move-to-point! (-> self root-override) (-> self state-vector)) - (set-heading-vec! (-> self root-override) (-> self path-vector)) + (move-to-point! (-> self root) (-> self state-vector)) + (set-heading-vec! (-> self root) (-> self path-vector)) (let ((a0-7 (handle->process (-> self fuel-cell)))) (if a0-7 (send-event a0-7 'draw #f) @@ -551,12 +536,12 @@ (let ((a1-0 (-> self state-vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (vector-seek! gp-0 a1-0 (* (-> self state-float 0) (seconds-per-frame))) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) - (do-push-aways! (-> self root-override)) - (seek-toward-heading-vec! (-> self root-override) (-> self path-vector) 131072.0 (seconds 1)) + (do-push-aways! (-> self root)) + (seek-toward-heading-vec! (-> self root) (-> self path-vector) 131072.0 (seconds 1)) (spool-push *art-control* "pelican-spit-ext" 0 self -99.0) ) :code (behavior ((arg0 symbol)) @@ -573,7 +558,7 @@ (suspend) (ja :num! (seek!)) ) - (until (vector= (-> self root-override trans) (-> self state-vector)) + (until (vector= (-> self root trans) (-> self state-vector)) (suspend) (ja :num! (loop!)) ) @@ -601,7 +586,7 @@ :post (behavior () (when *target* (if *target* - (look-at-enemy! (-> *target* neck) (the-as vector (-> self root-override root-prim prim-core)) 'nothing self) + (look-at-enemy! (-> *target* neck) (the-as vector (-> self root root-prim prim-core)) 'nothing self) ) (if (nonzero? (-> self neck)) (set-target! (-> self neck) (target-pos 5)) @@ -635,7 +620,7 @@ ) (s5-2 (new 'stack-no-clear 'quaternion)) ) - (quaternion-copy! s5-2 (-> self root-override quat)) + (quaternion-copy! s5-2 (-> self root quat)) (until v1-21 (suspend) (set! v1-21 (or (not *target*) (process-grab? *target*))) @@ -662,7 +647,7 @@ (if (handle->process s4-0) (deactivate (-> s4-0 process 0)) ) - (quaternion-copy! (-> self root-override quat) s5-2) + (quaternion-copy! (-> self root quat) s5-2) ) ) (process-spawn-function @@ -704,7 +689,7 @@ ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (or (= arg2 'touch) (= arg2 'attack)) (let ((v1-7 (birth-pickup-at-point - (-> self root-override trans) + (-> self root trans) (pickup-type fuel-cell) (the float (-> self entity extra perm task)) #f @@ -728,7 +713,7 @@ ) :post (behavior () (if (not (ja-group? pelican-sleep-ja)) - (quaternion-identity! (-> self root-override quat)) + (quaternion-identity! (-> self root quat)) ) (pelican-post) ) @@ -768,11 +753,11 @@ (set! (-> self path-pos) 0.0) (set! (-> self path-max) (the float (+ (-> self path curve num-cverts) -1))) (set! (-> self path-speed) (/ (* 300.0 (-> self path-max)) (the float arg1))) - (set! (-> self state-vector quad) (-> self root-override trans quad)) + (set! (-> self state-vector quad) (-> self root trans quad)) (set! (-> self state-float 0) 0.0) (let ((gp-1 (new 'stack-no-clear 'vector))) (eval-path-curve-div! (-> self path) gp-1 0.0 'interp) - (set! (-> self state-float 1) (* 0.0073242188 (vector-vector-distance (-> self root-override trans) gp-1))) + (set! (-> self state-float 1) (* 0.0073242188 (vector-vector-distance (-> self root trans) gp-1))) ) ) :trans (behavior () @@ -783,12 +768,7 @@ ) (when (not (time-elapsed? (-> self state-time) (the int (-> self state-float 1)))) (set! (-> self state-float 0) (/ (the float (- (current-time) (-> self state-time))) (-> self state-float 1))) - (vector-lerp! - (-> self root-override trans) - (-> self state-vector) - (-> self root-override trans) - (-> self state-float 0) - ) + (vector-lerp! (-> self root trans) (-> self state-vector) (-> self root trans) (-> self state-float 0)) ) ) :code (behavior ((arg0 path-control) (arg1 time-frame)) @@ -828,12 +808,12 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) ) (let ((gp-2 (new-stack-vector0))) - (set! (-> gp-2 quad) (-> self root-override trans quad)) + (set! (-> gp-2 quad) (-> self root trans quad)) (let ((a0-7 (handle->process (-> self fuel-cell)))) (when a0-7 (set! (-> gp-2 quad) (-> (the-as process-drawable a0-7) root trans quad)) @@ -856,7 +836,7 @@ ) ) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-channel-set! 0) (anim-loop) ) @@ -865,7 +845,7 @@ ;; definition for method 11 of type pelican ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! pelican ((this pelican) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pelican) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -883,7 +863,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *pelican-sg* '()) @@ -915,14 +895,9 @@ (go pelican-wait-at-nest #t) ) ((2) - (let ((s5-2 (manipy-spawn - (-> this root-override trans) - (-> this entity) - *fuel-cell-sg* - (new 'static 'vector :w 4915.2) - :to this - ) - ) + (let ((s5-2 + (manipy-spawn (-> this root trans) (-> this entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to this) + ) ) (set! (-> this fuel-cell) (if s5-2 (ppointer->handle s5-2) diff --git a/test/decompiler/reference/jak1/levels/beach/sculptor_REF.gc b/test/decompiler/reference/jak1/levels/beach/sculptor_REF.gc index 3c120107441..5dafa3f88dc 100644 --- a/test/decompiler/reference/jak1/levels/beach/sculptor_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/sculptor_REF.gc @@ -3,16 +3,12 @@ ;; definition of type sculptor (deftype sculptor (process-taskable) - ((muse handle :offset-assert 384) + ((muse handle) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x188 - :flag-assert #x3501200188 ) ;; definition for method 3 of type sculptor -(defmethod inspect sculptor ((this sculptor)) +(defmethod inspect ((this sculptor)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -35,10 +31,10 @@ ;; definition for method 52 of type sculptor ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-52 sculptor ((this sculptor)) +(defmethod process-taskable-method-52 ((this sculptor)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) ) @@ -53,7 +49,7 @@ ;; definition for method 48 of type sculptor ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow sculptor ((this sculptor)) +(defmethod draw-npc-shadow ((this sculptor)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -103,7 +99,7 @@ ) ;; definition for method 32 of type sculptor -(defmethod play-anim! sculptor ((this sculptor) (arg0 symbol)) +(defmethod play-anim! ((this sculptor) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 @@ -142,9 +138,7 @@ (set! (-> this cell-for-task) (current-task (-> this tasks))) (close-current! (-> this tasks)) (set! (-> this muse) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *sculptor-muse-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *sculptor-muse-sg* #f :to this)) ) (let ((v1-18 (handle->process (-> this muse)))) (if v1-18 @@ -176,7 +170,7 @@ ) ;; definition for method 31 of type sculptor -(defmethod get-art-elem sculptor ((this sculptor)) +(defmethod get-art-elem ((this sculptor)) (case (current-status (-> this tasks)) (((task-status invalid) (task-status need-resolution)) (-> this draw art-group data 11) @@ -188,30 +182,30 @@ ) ;; definition for method 43 of type sculptor -(defmethod process-taskable-method-43 sculptor ((this sculptor)) +(defmethod process-taskable-method-43 ((this sculptor)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) - (play-ambient (-> this ambient) "SCU-LO01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-LO01" #f (-> this root trans)) ) ((< 0.71428573 f0-2) - (play-ambient (-> this ambient) "SCU-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-AM05" #f (-> this root trans)) ) ((< 0.5714286 f0-2) - (play-ambient (-> this ambient) "SCU-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-AM06" #f (-> this root trans)) ) ((< 0.42857143 f0-2) - (play-ambient (-> this ambient) "SCU-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-AM03" #f (-> this root trans)) ) ((< 0.2857143 f0-2) - (play-ambient (-> this ambient) "SCU-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-AM04" #f (-> this root trans)) ) ((< 0.14285715 f0-2) - (play-ambient (-> this ambient) "SCU-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-AM01" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "SCU-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SCU-AM02" #f (-> this root trans)) ) ) ) @@ -360,7 +354,7 @@ ) ;; definition for method 11 of type sculptor -(defmethod init-from-entity! sculptor ((this sculptor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sculptor) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sculptor-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task misty-muse))) (set! (-> this muse) (the-as handle #f)) diff --git a/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc b/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc index 5247acd10e7..82f9a95a9e8 100644 --- a/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc @@ -29,34 +29,30 @@ ;; definition of type seagull (deftype seagull (process-drawable) - ((root-override collide-shape-moving :offset 112) - (index int32 :offset-assert 176) - (flock (pointer seagullflock) :offset-assert 180) - (heading float :offset-assert 184) - (tilt float :offset-assert 188) - (max-tilt float :offset-assert 192) - (angletan float :offset-assert 196) - (target-dist float :offset-assert 200) - (scared int32 :offset-assert 204) - (temp-heading float :offset-assert 208) - (temp-heading-time int32 :offset-assert 212) - (part-time time-frame :offset-assert 216) - (thrust float :offset-assert 224) - (teleport symbol :offset-assert 228) + ((root collide-shape-moving :override) + (index int32) + (flock (pointer seagullflock)) + (heading float) + (tilt float) + (max-tilt float) + (angletan float) + (target-dist float) + (scared int32) + (temp-heading float) + (temp-heading-time int32) + (part-time time-frame) + (thrust float) + (teleport symbol) ) - :heap-base #x80 - :method-count-assert 28 - :size-assert #xe8 - :flag-assert #x1c008000e8 (:methods - (move-vertically! (_type_ symbol) none 20) - (adjust-heading-around-point-slow! (_type_ float) none 21) - (seagull-method-22 (_type_) none 22) - (adjust-heading-around-point! (_type_ float) none 23) - (seagull-method-24 (_type_) none 24) - (seagull-method-25 (_type_ float) none 25) - (seagull-method-26 (_type_) symbol 26) - (seagull-method-27 (_type_) none 27) + (move-vertically! (_type_ symbol) none) + (adjust-heading-around-point-slow! (_type_ float) none) + (seagull-method-22 (_type_) none) + (adjust-heading-around-point! (_type_ float) none) + (seagull-method-24 (_type_) none) + (seagull-method-25 (_type_ float) none) + (seagull-method-26 (_type_) symbol) + (seagull-method-27 (_type_) none) ) (:states seagull-flying @@ -68,7 +64,7 @@ ) ;; definition for method 3 of type seagull -(defmethod inspect seagull ((this seagull)) +(defmethod inspect ((this seagull)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -90,31 +86,27 @@ ;; definition of type seagullflock (deftype seagullflock (process) - ((self-override seagullflock :offset 28) - (path path-control :offset-assert 112) - (trans vector :inline :offset-assert 128) - (bird (pointer seagull) 64 :offset-assert 144) - (birds int32 :offset-assert 400) - (link actor-link-info :offset-assert 404) - (bird-at-waterfall uint64 :offset-assert 408) - (birds-at-waterfall int32 :offset-assert 416) - (target vector :inline :offset-assert 432) - (targetnum int32 :offset-assert 448) - (alert-time time-frame :offset-assert 456) - (teleport-frames int32 :offset-assert 464) - (cam-tracker uint64 :offset-assert 472) - (state-time time-frame :offset-assert 480) - (squall ambient-sound :offset-assert 488) - (max-lift float :offset-assert 492) + ((self-override seagullflock :overlay-at self) + (path path-control) + (trans vector :inline) + (bird (pointer seagull) 64) + (birds int32) + (link actor-link-info) + (bird-at-waterfall uint64) + (birds-at-waterfall int32) + (target vector :inline) + (targetnum int32) + (alert-time time-frame) + (teleport-frames int32) + (cam-tracker uint64) + (state-time time-frame) + (squall ambient-sound) + (max-lift float) ) - :heap-base #x180 - :method-count-assert 17 - :size-assert #x1f0 - :flag-assert #x11018001f0 (:methods - (spawn-bird (_type_ vector) (pointer process) 14) - (play-hint (_type_ int) none 15) - (seagullflock-method-16 (_type_ seagull) float 16) + (spawn-bird (_type_ vector) (pointer process)) + (play-hint (_type_ int) none) + (seagullflock-method-16 (_type_ seagull) float) ) (:states seagullflock-at-waterfall @@ -123,7 +115,7 @@ ) ;; definition for method 3 of type seagullflock -(defmethod inspect seagullflock ((this seagullflock)) +(defmethod inspect ((this seagullflock)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -147,7 +139,7 @@ ;; definition for method 7 of type seagullflock ;; INFO: Return type mismatch process vs seagullflock. -(defmethod relocate seagullflock ((this seagullflock) (arg0 int)) +(defmethod relocate ((this seagullflock) (arg0 int)) (if (nonzero? (-> this path)) (&+! (-> this path) arg0) ) @@ -161,7 +153,7 @@ ) ;; definition for method 10 of type seagullflock -(defmethod deactivate seagullflock ((this seagullflock)) +(defmethod deactivate ((this seagullflock)) (if (nonzero? (-> this squall)) (stop! (-> this squall)) ) @@ -233,7 +225,7 @@ ;; definition for method 25 of type seagull ;; INFO: Return type mismatch int vs none. -(defmethod seagull-method-25 seagull ((this seagull) (arg0 float)) +(defmethod seagull-method-25 ((this seagull) (arg0 float)) (let ((f1-1 (the float (sar (shl (the int (- arg0 (-> this heading))) 48) 48))) (f0-5 (- (-> this tilt))) ) @@ -269,9 +261,9 @@ ;; definition for method 24 of type seagull ;; INFO: Return type mismatch int vs none. -(defmethod seagull-method-24 seagull ((this seagull)) +(defmethod seagull-method-24 ((this seagull)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (-> this flock 0 target) (-> this root-override trans)) + (vector-! s5-0 (-> this flock 0 target) (-> this root trans)) (when (< (vector-dot s5-0 s5-0) 6710886400.0) (let ((v1-5 (ash 1 (-> this index)))) (when (not (logtest? v1-5 (-> this flock 0 bird-at-waterfall))) @@ -367,7 +359,7 @@ ) (quaternion-axis-angle! s5-0 0.0 0.0 1.0 (-> self tilt)) (quaternion-axis-angle! gp-0 0.0 1.0 0.0 (-> self heading)) - (quaternion*! (-> self root-override quat) gp-0 s5-0) + (quaternion*! (-> self root quat) gp-0 s5-0) ) (transform-post) 0 @@ -397,12 +389,12 @@ (when (nonzero? (-> self scared)) (+! (-> self scared) -1) (when (zero? (-> self scared)) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (go seagull-takeoff) ) ) (when *target* - (let ((v1-12 (vector-! (new 'stack-no-clear 'vector) (-> *target* control trans) (-> self root-override trans)))) + (let ((v1-12 (vector-! (new 'stack-no-clear 'vector) (-> *target* control trans) (-> self root trans)))) (when (< (vector-dot v1-12 v1-12) 1677721600.0) (let ((v1-14 (-> self flock))) (play-hint @@ -417,10 +409,10 @@ ) ) :code (behavior () - (+! (-> self root-override trans y) 20480.0) - (move-to-ground (-> self root-override) 40960.0 40960.0 #t (collide-kind background)) - (update-transforms! (-> self root-override)) - (clear-collide-with-as (-> self root-override)) + (+! (-> self root trans y) 20480.0) + (move-to-ground (-> self root) 40960.0 40960.0 #t (collide-kind background)) + (update-transforms! (-> self root)) + (clear-collide-with-as (-> self root)) (ja :group! seagull-idle-ja :num! (identity (ja-aframe 0.0 0))) (loop (let* ((f30-0 4.0) @@ -503,8 +495,8 @@ ;; definition for method 20 of type seagull ;; INFO: Return type mismatch int vs none. -(defmethod move-vertically! seagull ((this seagull) (arg0 symbol)) - (let ((f0-0 (-> this root-override transv y))) +(defmethod move-vertically! ((this seagull) (arg0 symbol)) + (let ((f0-0 (-> this root transv y))) (set! f0-0 (cond (arg0 (if (< f0-0 (-> this flock 0 max-lift)) @@ -517,14 +509,14 @@ ) ) ) - (set! (-> this root-override transv y) f0-0) + (set! (-> this root transv y) f0-0) ) 0 (none) ) ;; definition for method 26 of type seagull -(defmethod seagull-method-26 seagull ((this seagull)) +(defmethod seagull-method-26 ((this seagull)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((f30-0 -4096.0) (f28-0 8192.0) @@ -541,9 +533,9 @@ ) (set! (-> s5-0 z) (+ f30-2 (* f28-2 (rand-float-gen)) (-> this flock 0 target z))) ) - (vector-! s5-0 s5-0 (-> this root-override trans)) + (vector-! s5-0 s5-0 (-> this root trans)) (vector-float*! s5-0 s5-0 0.9) - (move-by-vector! (-> this root-override) s5-0) + (move-by-vector! (-> this root) s5-0) ) (set! (-> this teleport) #f) #f @@ -551,12 +543,12 @@ ;; definition for method 21 of type seagull ;; INFO: Return type mismatch int vs none. -(defmethod adjust-heading-around-point-slow! seagull ((this seagull) (arg0 float)) +(defmethod adjust-heading-around-point-slow! ((this seagull) (arg0 float)) (let ((f30-1 (* arg0 (sin (-> this heading)))) (f0-4 (* arg0 (cos (-> this heading)))) ) - (set! (-> this root-override transv x) (+ (* 0.8 (-> this root-override transv x)) (* 0.2 f30-1))) - (set! (-> this root-override transv z) (+ (* 0.8 (-> this root-override transv z)) (* 0.2 f0-4))) + (set! (-> this root transv x) (+ (* 0.8 (-> this root transv x)) (* 0.2 f30-1))) + (set! (-> this root transv z) (+ (* 0.8 (-> this root transv z)) (* 0.2 f0-4))) ) 0 (none) @@ -564,12 +556,12 @@ ;; definition for method 23 of type seagull ;; INFO: Return type mismatch int vs none. -(defmethod adjust-heading-around-point! seagull ((this seagull) (arg0 float)) +(defmethod adjust-heading-around-point! ((this seagull) (arg0 float)) (let ((f30-1 (* arg0 (sin (-> this heading)))) (f0-4 (* arg0 (cos (-> this heading)))) ) - (set! (-> this root-override transv x) f30-1) - (set! (-> this root-override transv z) f0-4) + (set! (-> this root transv x) f30-1) + (set! (-> this root transv z) f0-4) ) 0 (none) @@ -577,14 +569,14 @@ ;; definition for method 22 of type seagull ;; INFO: Return type mismatch int vs none. -(defmethod seagull-method-22 seagull ((this seagull)) - (set! (-> this root-override transv y) -8192.0) +(defmethod seagull-method-22 ((this seagull)) + (set! (-> this root transv y) -8192.0) 0 (none) ) ;; definition for method 27 of type seagull -(defmethod seagull-method-27 seagull ((this seagull)) +(defmethod seagull-method-27 ((this seagull)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -592,8 +584,8 @@ ) (init-vf0-vector) (let ((v1-0 (new 'stack-no-clear 'vector)) - (a0-2 (-> this root-override trans)) - (s5-0 (-> this root-override transv)) + (a0-2 (-> this root trans)) + (s5-0 (-> this root transv)) (a1-1 (new 'stack-no-clear 'vector)) ) (let ((a2-0 v1-0)) @@ -608,8 +600,8 @@ ) (vector+! a1-1 a0-2 v1-0) (if (points-in-air? a0-2 a1-1 *seagull-boxes* 10) - (integrate-no-collide! (-> this root-override) (-> this root-override transv)) - (fill-cache-integrate-and-collide! (-> this root-override) s5-0 (collide-kind background)) + (integrate-no-collide! (-> this root) (-> this root transv)) + (fill-cache-integrate-and-collide! (-> this root) s5-0 (collide-kind background)) ) ) (none) @@ -621,7 +613,7 @@ :trans (behavior () (when (< (+ (current-time) (seconds -2)) (-> self part-time)) (-> self part) - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) ) ) :code (behavior () @@ -631,7 +623,7 @@ (when (and (>= (ja-frame-num 0) (ja-aframe 2.0 0)) (>= (ja-aframe 3.0 0) (ja-frame-num 0))) (let* ((v1-13 self) (a0-7 #t) - (f0-5 (-> v1-13 root-override transv y)) + (f0-5 (-> v1-13 root transv y)) ) (set! f0-5 (cond (a0-7 @@ -645,7 +637,7 @@ ) ) ) - (set! (-> v1-13 root-override transv y) f0-5) + (set! (-> v1-13 root transv y) f0-5) ) 0 (let* ((gp-1 self) @@ -653,8 +645,8 @@ (f30-2 (* f28-0 (sin (-> gp-1 heading)))) (f0-10 (* f28-0 (cos (-> gp-1 heading)))) ) - (set! (-> gp-1 root-override transv x) (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-2))) - (set! (-> gp-1 root-override transv z) (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-10))) + (set! (-> gp-1 root transv x) (+ (* 0.8 (-> gp-1 root transv x)) (* 0.2 f30-2))) + (set! (-> gp-1 root transv z) (+ (* 0.8 (-> gp-1 root transv z)) (* 0.2 f0-10))) ) 0 ) @@ -674,7 +666,7 @@ :trans (behavior () (when (< (+ (current-time) (seconds -2)) (-> self part-time)) (-> self part) - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) ) ) :code (behavior () @@ -692,7 +684,7 @@ (let ((s5-0 self) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector-! s4-0 (-> s5-0 flock 0 target) (-> s5-0 root-override trans)) + (vector-! s4-0 (-> s5-0 flock 0 target) (-> s5-0 root trans)) (when (< (vector-dot s4-0 s4-0) 6710886400.0) (let ((v1-24 (ash 1 (-> s5-0 index)))) (when (not (logtest? v1-24 (-> s5-0 flock 0 bird-at-waterfall))) @@ -782,7 +774,7 @@ ((and v1-42 (>= (ja-aframe 9.0 0) (ja-frame-num 0))) (let* ((v1-44 self) (a0-49 #t) - (f0-38 (-> v1-44 root-override transv y)) + (f0-38 (-> v1-44 root transv y)) ) (set! f0-38 (cond (a0-49 @@ -796,14 +788,14 @@ ) ) ) - (set! (-> v1-44 root-override transv y) f0-38) + (set! (-> v1-44 root transv y) f0-38) ) 0 ) (else (let* ((v1-48 self) (a0-55 #f) - (f0-39 (-> v1-48 root-override transv y)) + (f0-39 (-> v1-48 root transv y)) ) (set! f0-39 (cond (a0-55 @@ -817,7 +809,7 @@ ) ) ) - (set! (-> v1-48 root-override transv y) f0-39) + (set! (-> v1-48 root transv y) f0-39) ) 0 ) @@ -828,8 +820,8 @@ (f30-2 (* f28-0 (sin (-> s5-1 heading)))) (f0-44 (* f28-0 (cos (-> s5-1 heading)))) ) - (set! (-> s5-1 root-override transv x) (+ (* 0.8 (-> s5-1 root-override transv x)) (* 0.2 f30-2))) - (set! (-> s5-1 root-override transv z) (+ (* 0.8 (-> s5-1 root-override transv z)) (* 0.2 f0-44))) + (set! (-> s5-1 root transv x) (+ (* 0.8 (-> s5-1 root transv x)) (* 0.2 f30-2))) + (set! (-> s5-1 root transv z) (+ (* 0.8 (-> s5-1 root transv z)) (* 0.2 f0-44))) ) 0 (seagull-method-27 self) @@ -839,10 +831,10 @@ (+! gp-0 1) (when (>= gp-0 0) (when (>= (-> self angletan) 0.1) - (if (< 204800.0 (-> self root-override trans y)) + (if (< 204800.0 (-> self root trans y)) (go seagull-soaring) ) - (when (< 57344.0 (-> self root-override trans y)) + (when (< 57344.0 (-> self root trans y)) (let* ((f30-3 0.8) (v1-77 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-78 (the-as number (logior #x3f800000 v1-77))) @@ -865,7 +857,7 @@ :trans (behavior () (when (< (+ (current-time) (seconds -2)) (-> self part-time)) (-> self part) - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) ) ) :code (behavior () @@ -883,7 +875,7 @@ (let ((gp-0 self) (s5-0 (new 'stack-no-clear 'vector)) ) - (vector-! s5-0 (-> gp-0 flock 0 target) (-> gp-0 root-override trans)) + (vector-! s5-0 (-> gp-0 flock 0 target) (-> gp-0 root trans)) (when (< (vector-dot s5-0 s5-0) 6710886400.0) (let ((v1-26 (ash 1 (-> gp-0 index)))) (when (not (logtest? v1-26 (-> gp-0 flock 0 bird-at-waterfall))) @@ -969,7 +961,7 @@ ) 0 (let ((v1-44 self)) - (set! (-> v1-44 root-override transv y) -8192.0) + (set! (-> v1-44 root transv y) -8192.0) ) 0 (let* ((gp-1 self) @@ -977,16 +969,16 @@ (f30-0 (* f28-0 (sin (-> gp-1 heading)))) (f0-41 (* f28-0 (cos (-> gp-1 heading)))) ) - (set! (-> gp-1 root-override transv x) (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-0))) - (set! (-> gp-1 root-override transv z) (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-41))) + (set! (-> gp-1 root transv x) (+ (* 0.8 (-> gp-1 root transv x)) (* 0.2 f30-0))) + (set! (-> gp-1 root transv z) (+ (* 0.8 (-> gp-1 root transv z)) (* 0.2 f0-41))) ) 0 (seagull-method-27 self) (when (< (-> self angletan) 0.2) - (if (< (-> self root-override trans y) 40960.0) + (if (< (-> self root trans y) 40960.0) (go seagull-flying) ) - (when (< (-> self root-override trans y) 204800.0) + (when (< (-> self root trans y) 204800.0) (if (and (time-elapsed? (-> self state-time) (seconds 0.5)) (let* ((f30-1 0.99) (v1-67 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -1026,11 +1018,11 @@ (let ((s5-0 (new 'stack 'collide-tri-result))) 0.0 (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> self root-override transv y) (* 4096.0 (- arg0))) - (set! (-> gp-0 quad) (-> self root-override transv quad)) + (set! (-> self root transv y) (* 4096.0 (- arg0))) + (set! (-> gp-0 quad) (-> self root transv quad)) (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* - (-> self root-override trans) + (-> self root trans) gp-0 409.6 (collide-kind background) @@ -1045,15 +1037,11 @@ (go seagull-soaring) ) (vector-float*! gp-0 gp-0 f30-0) - (vector+! gp-0 gp-0 (-> self root-override trans)) + (vector+! gp-0 gp-0 (-> self root trans)) (while (< 0.5 f30-0) (suspend) (set! f30-0 (- f30-0 (seconds-per-frame))) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (collide-kind background) - ) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (collide-kind background)) (let* ((v1-21 self) (f1-3 (the float (sar (shl (the int (- (-> self heading) (-> v1-21 heading))) 48) 48))) (f0-12 (- (-> v1-21 tilt))) @@ -1093,11 +1081,7 @@ (suspend) (ja :num! (seek!)) (set! f30-0 (- f30-0 (seconds-per-frame))) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (collide-kind background) - ) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (collide-kind background)) (let* ((v1-48 self) (f1-13 (the float (sar (shl (the int (- (-> self heading) (-> v1-48 heading))) 48) 48))) (f0-32 (- (-> v1-48 tilt))) @@ -1221,9 +1205,9 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *seagull-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self index) arg1) @@ -1242,7 +1226,7 @@ ;; definition for method 15 of type seagullflock ;; INFO: Return type mismatch time-frame vs none. -(defmethod play-hint seagullflock ((this seagullflock) (arg0 int)) +(defmethod play-hint ((this seagullflock) (arg0 int)) (when (time-elapsed? (-> this alert-time) (seconds 5)) (eval-path-curve-div! (-> this path) (-> this target) (the float (-> this targetnum)) 'interp) (let ((f0-2 4096.0) @@ -1300,10 +1284,10 @@ ) ;; definition for method 16 of type seagullflock -(defmethod seagullflock-method-16 seagullflock ((this seagullflock) (arg0 seagull)) +(defmethod seagullflock-method-16 ((this seagullflock) (arg0 seagull)) (let ((gp-0 (new 'stack-no-clear 'vector))) (eval-path-curve-div! (-> this path) gp-0 (the float (-> this targetnum)) 'interp) - (vector-! gp-0 gp-0 (-> arg0 root-override trans)) + (vector-! gp-0 gp-0 (-> arg0 root trans)) (atan (-> gp-0 x) (-> gp-0 z)) ) ) @@ -1384,7 +1368,7 @@ ;; definition for method 11 of type seagullflock ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! seagullflock ((this seagullflock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this seagullflock) (arg0 entity-actor)) (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) @@ -1429,7 +1413,7 @@ ) ;; definition for method 14 of type seagullflock -(defmethod spawn-bird seagullflock ((this seagullflock) (arg0 vector)) +(defmethod spawn-bird ((this seagullflock) (arg0 vector)) (if (= (-> this birds) 64) (return (the-as (pointer process) #f)) ) diff --git a/test/decompiler/reference/jak1/levels/beach/twister_REF.gc b/test/decompiler/reference/jak1/levels/beach/twister_REF.gc index 878664486f4..90a4d41fdfb 100644 --- a/test/decompiler/reference/jak1/levels/beach/twister_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/twister_REF.gc @@ -3,17 +3,14 @@ ;; definition of type twist-joint (deftype twist-joint (structure) - ((ry float :offset-assert 0) - (max-dry float :offset-assert 4) + ((ry float) + (max-dry float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type twist-joint -(defmethod inspect twist-joint ((this twist-joint)) +(defmethod inspect ((this twist-joint)) (format #t "[~8x] ~A~%" this 'twist-joint) (format #t "~Try: ~f~%" (-> this ry)) (format #t "~Tmax-dry: ~f~%" (-> this max-dry)) @@ -22,32 +19,29 @@ ;; definition of type twister (deftype twister (basic) - ((num-joints int32 :offset-assert 4) - (first-joint int32 :offset-assert 8) - (last-joint int32 :offset-assert 12) - (something uint16 :offset 12) - (max-speed float :offset-assert 16) - (smoothing float :offset-assert 20) - (min-dist float :offset-assert 24) - (target float :offset-assert 28) - (ry float :offset-assert 32) - (max-speed-ry float :offset-assert 36) - (data twist-joint :inline :dynamic :offset-assert 40) + ((num-joints int32) + (first-joint int32) + (last-joint int32) + (something uint16 :overlay-at last-joint) + (max-speed float) + (smoothing float) + (min-dist float) + (target float) + (ry float) + (max-speed-ry float) + (data twist-joint :inline :dynamic) ) - :method-count-assert 13 - :size-assert #x28 - :flag-assert #xd00000028 (:methods - (new (symbol type int int float float float float) _type_ 0) - (twister-method-9 (_type_ int int float) none 9) - (set-target! (_type_ float) none 10) - (twister-method-11 (_type_) none 11) - (twister-method-12 (_type_ process-drawable) none 12) + (new (symbol type int int float float float float) _type_) + (twister-method-9 (_type_ int int float) none) + (set-target! (_type_ float) none) + (twister-method-11 (_type_) none) + (twister-method-12 (_type_ process-drawable) none) ) ) ;; definition for method 3 of type twister -(defmethod inspect twister ((this twister)) +(defmethod inspect ((this twister)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tnum-joints: ~D~%" (-> this num-joints)) (format #t "~Tfirst-joint: ~D~%" (-> this first-joint)) @@ -93,13 +87,13 @@ ) ;; definition for method 5 of type twister -(defmethod asize-of twister ((this twister)) +(defmethod asize-of ((this twister)) (+ (* (-> this num-joints) 16) 40) ) ;; definition for method 9 of type twister ;; INFO: Return type mismatch int vs none. -(defmethod twister-method-9 twister ((this twister) (arg0 int) (arg1 int) (arg2 float)) +(defmethod twister-method-9 ((this twister) (arg0 int) (arg1 int) (arg2 float)) (let ((v1-1 (- arg0 (-> this first-joint))) (a1-2 (- arg1 (-> this first-joint))) ) @@ -114,7 +108,7 @@ ;; definition for method 10 of type twister ;; INFO: Return type mismatch int vs none. -(defmethod set-target! twister ((this twister) (arg0 float)) +(defmethod set-target! ((this twister) (arg0 float)) (set! (-> this target) arg0) 0 (none) @@ -122,7 +116,7 @@ ;; definition for method 11 of type twister ;; INFO: Return type mismatch int vs none. -(defmethod twister-method-11 twister ((this twister)) +(defmethod twister-method-11 ((this twister)) (let* ((s5-0 (+ (-> this num-joints) -1)) (s4-0 (-> this data s5-0)) ) @@ -164,7 +158,7 @@ ;; definition for method 12 of type twister ;; INFO: Return type mismatch int vs none. -(defmethod twister-method-12 twister ((this twister) (arg0 process-drawable)) +(defmethod twister-method-12 ((this twister) (arg0 process-drawable)) (let ((s4-0 (new 'stack-no-clear 'matrix))) (dotimes (s3-0 (-> this num-joints)) (let ((s2-0 (-> arg0 node-list data (+ (-> this first-joint) s3-0) bone transform))) diff --git a/test/decompiler/reference/jak1/levels/beach/wobbler_REF.gc b/test/decompiler/reference/jak1/levels/beach/wobbler_REF.gc index 92c273bcc76..3f91a9bf6be 100644 --- a/test/decompiler/reference/jak1/levels/beach/wobbler_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/wobbler_REF.gc @@ -3,27 +3,24 @@ ;; definition of type wobbler (deftype wobbler (basic) - ((posx float :offset-assert 4) - (posy float :offset-assert 8) - (velx float :offset-assert 12) - (vely float :offset-assert 16) - (spring float :offset-assert 20) - (damping float :offset-assert 24) - (height float :offset-assert 28) + ((posx float) + (posy float) + (velx float) + (vely float) + (spring float) + (damping float) + (height float) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 (:methods - (reset! (_type_ float float float) none 9) - (inc-xy-vel! (_type_ float float) none 10) - (move! (_type_) none 11) - (wobbler-method-12 (_type_ quaternion) none 12) + (reset! (_type_ float float float) none) + (inc-xy-vel! (_type_ float float) none) + (move! (_type_) none) + (wobbler-method-12 (_type_ quaternion) none) ) ) ;; definition for method 3 of type wobbler -(defmethod inspect wobbler ((this wobbler)) +(defmethod inspect ((this wobbler)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tposx: ~f~%" (-> this posx)) (format #t "~Tposy: ~f~%" (-> this posy)) @@ -37,7 +34,7 @@ ;; definition for method 9 of type wobbler ;; INFO: Return type mismatch int vs none. -(defmethod reset! wobbler ((this wobbler) (arg0 float) (arg1 float) (arg2 float)) +(defmethod reset! ((this wobbler) (arg0 float) (arg1 float) (arg2 float)) (set! (-> this posx) 0.0) (set! (-> this posy) 0.0) (set! (-> this velx) 0.0) @@ -51,7 +48,7 @@ ;; definition for method 10 of type wobbler ;; INFO: Return type mismatch int vs none. -(defmethod inc-xy-vel! wobbler ((this wobbler) (arg0 float) (arg1 float)) +(defmethod inc-xy-vel! ((this wobbler) (arg0 float) (arg1 float)) (+! (-> this velx) arg0) (+! (-> this vely) arg1) 0 @@ -60,7 +57,7 @@ ;; definition for method 11 of type wobbler ;; INFO: Return type mismatch int vs none. -(defmethod move! wobbler ((this wobbler)) +(defmethod move! ((this wobbler)) (+! (-> this posx) (* (-> this velx) (seconds-per-frame))) (+! (-> this posy) (* (-> this vely) (seconds-per-frame))) (set! (-> this velx) (* (-> this velx) (-> this damping))) @@ -73,7 +70,7 @@ ;; definition for method 12 of type wobbler ;; INFO: Return type mismatch int vs none. -(defmethod wobbler-method-12 wobbler ((this wobbler) (arg0 quaternion)) +(defmethod wobbler-method-12 ((this wobbler) (arg0 quaternion)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 x) (-> this posy)) (set! (-> s5-0 y) 0.0) diff --git a/test/decompiler/reference/jak1/levels/citadel/assistant-citadel_REF.gc b/test/decompiler/reference/jak1/levels/citadel/assistant-citadel_REF.gc index cc2ace69640..f447d9d4d21 100644 --- a/test/decompiler/reference/jak1/levels/citadel/assistant-citadel_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/assistant-citadel_REF.gc @@ -4,14 +4,10 @@ ;; definition of type assistant-lavatube-end (deftype assistant-lavatube-end (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type assistant-lavatube-end -(defmethod inspect assistant-lavatube-end ((this assistant-lavatube-end)) +(defmethod inspect ((this assistant-lavatube-end)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -26,7 +22,7 @@ ) ;; definition for method 32 of type assistant-lavatube-end -(defmethod play-anim! assistant-lavatube-end ((this assistant-lavatube-end) (arg0 symbol)) +(defmethod play-anim! ((this assistant-lavatube-end) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status unknown) (task-status need-hint)) (new 'static 'spool-anim :name "assistant-lavatube-end-resolution" :index 4 :parts 11 :command-list '()) @@ -70,7 +66,7 @@ ) ;; definition for method 31 of type assistant-lavatube-end -(defmethod get-art-elem assistant-lavatube-end ((this assistant-lavatube-end)) +(defmethod get-art-elem ((this assistant-lavatube-end)) (-> this draw art-group data 3) ) @@ -80,7 +76,7 @@ :trans (behavior () (process-taskable-method-33 self) ((-> (method-of-type process-taskable hidden) trans)) - (when (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (not (closed? (-> self tasks) (game-task village4-button) (task-status need-reward-speech))) ) ) @@ -114,7 +110,7 @@ ) ;; definition for method 39 of type assistant-lavatube-end -(defmethod should-display? assistant-lavatube-end ((this assistant-lavatube-end)) +(defmethod should-display? ((this assistant-lavatube-end)) (first-any (-> this tasks) #t) (let ((v1-3 (current-status (-> this tasks)))) (and (or (= v1-3 (task-status need-reward-speech)) (= v1-3 (task-status invalid))) @@ -124,7 +120,7 @@ ) ;; definition for method 11 of type assistant-lavatube-end -(defmethod init-from-entity! assistant-lavatube-end ((this assistant-lavatube-end) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant-lavatube-end) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-lavatube-end-sg* 3 29 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task village4-button))) (first-any (-> this tasks) #t) diff --git a/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc index f32fb800ab0..066eced8644 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc @@ -3,25 +3,21 @@ ;; definition of type citb-arm-section (deftype citb-arm-section (process-drawable) - ((sync sync-info :inline :offset-assert 176) - (cull-dir-local vector :inline :offset-assert 192) - (cull-dot float :offset-assert 208) - (rot-scale float :offset-assert 212) - (y-angle float :offset-assert 216) + ((sync sync-info :inline) + (cull-dir-local vector :inline) + (cull-dot float) + (rot-scale float) + (y-angle float) ) - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc (:methods - (init-root! (_type_) none 20) - (setup-new-process! (_type_) none 21) - (idle () _type_ :state 22) + (init-root! (_type_) none) + (setup-new-process! (_type_) none) + (idle () _type_ :state) ) ) ;; definition for method 3 of type citb-arm-section -(defmethod inspect citb-arm-section ((this citb-arm-section)) +(defmethod inspect ((this citb-arm-section)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -113,7 +109,7 @@ ;; definition for method 20 of type citb-arm-section ;; INFO: Return type mismatch int vs none. -(defmethod init-root! citb-arm-section ((this citb-arm-section)) +(defmethod init-root! ((this citb-arm-section)) (set! (-> this root) (new 'process 'trsqv)) 0 (none) @@ -121,7 +117,7 @@ ;; definition for method 21 of type citb-arm-section ;; INFO: Return type mismatch int vs none. -(defmethod setup-new-process! citb-arm-section ((this citb-arm-section)) +(defmethod setup-new-process! ((this citb-arm-section)) (logclear! (-> this mask) (process-mask actor-pause)) (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (cond @@ -144,7 +140,7 @@ ;; definition for method 11 of type citb-arm-section ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-arm-section ((this citb-arm-section) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-arm-section) (arg0 entity-actor)) (init-root! this) (process-drawable-from-entity! this arg0) (setup-new-process! this) @@ -154,16 +150,12 @@ ;; definition of type citb-arm (deftype citb-arm (citb-arm-section) - ((root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) ) - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) ;; definition for method 3 of type citb-arm -(defmethod inspect citb-arm ((this citb-arm)) +(defmethod inspect ((this citb-arm)) (let ((t9-0 (method-of-type citb-arm-section inspect))) (t9-0 this) ) @@ -176,8 +168,8 @@ :trans rider-trans :post (behavior () (if (logtest? (-> self draw status) (draw-status hidden)) - (clear-collide-with-as (-> self root-override)) - (restore-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) + (restore-collide-with-as (-> self root)) ) (rider-post) ) @@ -185,7 +177,7 @@ ;; definition for method 20 of type citb-arm ;; INFO: Return type mismatch int vs none. -(defmethod init-root! citb-arm ((this citb-arm)) +(defmethod init-root! ((this citb-arm)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -204,7 +196,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -212,7 +204,7 @@ ;; definition for method 21 of type citb-arm ;; INFO: Return type mismatch int vs none. -(defmethod setup-new-process! citb-arm ((this citb-arm)) +(defmethod setup-new-process! ((this citb-arm)) (call-parent-method this) (set! (-> this draw origin-joint-index) (the-as uint 4)) (set-vector! (-> this cull-dir-local) 0.0 0.0 -1.0 1.0) @@ -224,14 +216,10 @@ ;; definition of type citb-arm-shoulder (deftype citb-arm-shoulder (citb-arm-section) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) ;; definition for method 3 of type citb-arm-shoulder -(defmethod inspect citb-arm-shoulder ((this citb-arm-shoulder)) +(defmethod inspect ((this citb-arm-shoulder)) (let ((t9-0 (method-of-type citb-arm-section inspect))) (t9-0 this) ) @@ -240,7 +228,7 @@ ;; definition for method 21 of type citb-arm-shoulder ;; INFO: Return type mismatch int vs none. -(defmethod setup-new-process! citb-arm-shoulder ((this citb-arm-shoulder)) +(defmethod setup-new-process! ((this citb-arm-shoulder)) (call-parent-method this) (set! (-> this draw origin-joint-index) (the-as uint 4)) (set-vector! (-> this cull-dir-local) 1.0 0.0 1.0 1.0) @@ -252,14 +240,10 @@ ;; definition of type citb-arm-a (deftype citb-arm-a (citb-arm) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) ;; definition for method 3 of type citb-arm-a -(defmethod inspect citb-arm-a ((this citb-arm-a)) +(defmethod inspect ((this citb-arm-a)) (let ((t9-0 (method-of-type citb-arm inspect))) (t9-0 this) ) @@ -269,14 +253,10 @@ ;; definition of type citb-arm-b (deftype citb-arm-b (citb-arm) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) ;; definition for method 3 of type citb-arm-b -(defmethod inspect citb-arm-b ((this citb-arm-b)) +(defmethod inspect ((this citb-arm-b)) (let ((t9-0 (method-of-type citb-arm inspect))) (t9-0 this) ) @@ -286,14 +266,10 @@ ;; definition of type citb-arm-c (deftype citb-arm-c (citb-arm) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) ;; definition for method 3 of type citb-arm-c -(defmethod inspect citb-arm-c ((this citb-arm-c)) +(defmethod inspect ((this citb-arm-c)) (let ((t9-0 (method-of-type citb-arm inspect))) (t9-0 this) ) @@ -303,14 +279,10 @@ ;; definition of type citb-arm-d (deftype citb-arm-d (citb-arm) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) ;; definition for method 3 of type citb-arm-d -(defmethod inspect citb-arm-d ((this citb-arm-d)) +(defmethod inspect ((this citb-arm-d)) (let ((t9-0 (method-of-type citb-arm inspect))) (t9-0 this) ) @@ -320,14 +292,10 @@ ;; definition of type citb-arm-shoulder-a (deftype citb-arm-shoulder-a (citb-arm-shoulder) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) ;; definition for method 3 of type citb-arm-shoulder-a -(defmethod inspect citb-arm-shoulder-a ((this citb-arm-shoulder-a)) +(defmethod inspect ((this citb-arm-shoulder-a)) (let ((t9-0 (method-of-type citb-arm-shoulder inspect))) (t9-0 this) ) @@ -337,14 +305,10 @@ ;; definition of type citb-arm-shoulder-b (deftype citb-arm-shoulder-b (citb-arm-shoulder) () - :heap-base #x70 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17007000dc ) ;; definition for method 3 of type citb-arm-shoulder-b -(defmethod inspect citb-arm-shoulder-b ((this citb-arm-shoulder-b)) +(defmethod inspect ((this citb-arm-shoulder-b)) (let ((t9-0 (method-of-type citb-arm-shoulder inspect))) (t9-0 this) ) @@ -353,47 +317,47 @@ ;; definition for method 21 of type citb-arm-a ;; INFO: Return type mismatch int vs none. -(defmethod setup-new-process! citb-arm-a ((this citb-arm-a)) +(defmethod setup-new-process! ((this citb-arm-a)) (initialize-skeleton this *citb-arm-a-sg* '()) (call-parent-method this) - (set! (-> this root-override root-prim local-sphere z) -184320.0) + (set! (-> this root root-prim local-sphere z) -184320.0) 0 (none) ) ;; definition for method 21 of type citb-arm-b ;; INFO: Return type mismatch int vs none. -(defmethod setup-new-process! citb-arm-b ((this citb-arm-b)) +(defmethod setup-new-process! ((this citb-arm-b)) (initialize-skeleton this *citb-arm-b-sg* '()) (call-parent-method this) - (set! (-> this root-override root-prim local-sphere z) -225280.0) + (set! (-> this root root-prim local-sphere z) -225280.0) 0 (none) ) ;; definition for method 21 of type citb-arm-c ;; INFO: Return type mismatch int vs none. -(defmethod setup-new-process! citb-arm-c ((this citb-arm-c)) +(defmethod setup-new-process! ((this citb-arm-c)) (initialize-skeleton this *citb-arm-c-sg* '()) (call-parent-method this) - (set! (-> this root-override root-prim local-sphere z) -266240.0) + (set! (-> this root root-prim local-sphere z) -266240.0) 0 (none) ) ;; definition for method 21 of type citb-arm-d ;; INFO: Return type mismatch int vs none. -(defmethod setup-new-process! citb-arm-d ((this citb-arm-d)) +(defmethod setup-new-process! ((this citb-arm-d)) (initialize-skeleton this *citb-arm-d-sg* '()) (call-parent-method this) - (set! (-> this root-override root-prim local-sphere z) -307200.0) + (set! (-> this root root-prim local-sphere z) -307200.0) 0 (none) ) ;; definition for method 21 of type citb-arm-shoulder-a ;; INFO: Return type mismatch int vs none. -(defmethod setup-new-process! citb-arm-shoulder-a ((this citb-arm-shoulder-a)) +(defmethod setup-new-process! ((this citb-arm-shoulder-a)) (initialize-skeleton this *citb-arm-shoulder-a-sg* '()) (call-parent-method this) 0 @@ -402,7 +366,7 @@ ;; definition for method 21 of type citb-arm-shoulder-b ;; INFO: Return type mismatch int vs none. -(defmethod setup-new-process! citb-arm-shoulder-b ((this citb-arm-shoulder-b)) +(defmethod setup-new-process! ((this citb-arm-shoulder-b)) (initialize-skeleton this *citb-arm-shoulder-b-sg* '()) (call-parent-method this) 0 @@ -439,17 +403,13 @@ ;; definition of type citb-disc (deftype citb-disc (process-drawable) - ((root-override collide-shape-moving :offset 112) - (sync sync-info :inline :offset-assert 176) - (rot-scale float :offset-assert 184) + ((root collide-shape-moving :override) + (sync sync-info :inline) + (rot-scale float) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xbc - :flag-assert #x16005000bc (:methods - (init! (_type_) none 20) - (citb-disc-method-21 (_type_) none 21) + (init! (_type_) none) + (citb-disc-method-21 (_type_) none) ) (:states citb-disc-idle @@ -457,7 +417,7 @@ ) ;; definition for method 3 of type citb-disc -(defmethod inspect citb-disc ((this citb-disc)) +(defmethod inspect ((this citb-disc)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -481,7 +441,7 @@ (loop (update! (-> self sound)) (quaternion-axis-angle! - (-> self root-override quat) + (-> self root quat) 0.0 1.0 0.0 @@ -495,7 +455,7 @@ ;; definition for method 20 of type citb-disc ;; INFO: Return type mismatch int vs none. -(defmethod init! citb-disc ((this citb-disc)) +(defmethod init! ((this citb-disc)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -514,7 +474,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -522,14 +482,14 @@ ;; definition for method 21 of type citb-disc ;; INFO: Return type mismatch int vs none. -(defmethod citb-disc-method-21 citb-disc ((this citb-disc)) +(defmethod citb-disc-method-21 ((this citb-disc)) 0 (none) ) ;; definition for method 11 of type citb-disc ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-disc ((this citb-disc) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-disc) (arg0 entity-actor)) (init! this) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -547,7 +507,7 @@ ) (citb-disc-method-21 this) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> this root trans)) ) (logior! (-> this skel status) (janim-status inited)) (go citb-disc-idle) @@ -557,14 +517,10 @@ ;; definition of type citb-disc-a (deftype citb-disc-a (citb-disc) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xbc - :flag-assert #x16005000bc ) ;; definition for method 3 of type citb-disc-a -(defmethod inspect citb-disc-a ((this citb-disc-a)) +(defmethod inspect ((this citb-disc-a)) (let ((t9-0 (method-of-type citb-disc inspect))) (t9-0 this) ) @@ -574,14 +530,10 @@ ;; definition of type citb-disc-b (deftype citb-disc-b (citb-disc) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xbc - :flag-assert #x16005000bc ) ;; definition for method 3 of type citb-disc-b -(defmethod inspect citb-disc-b ((this citb-disc-b)) +(defmethod inspect ((this citb-disc-b)) (let ((t9-0 (method-of-type citb-disc inspect))) (t9-0 this) ) @@ -591,14 +543,10 @@ ;; definition of type citb-disc-c (deftype citb-disc-c (citb-disc) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xbc - :flag-assert #x16005000bc ) ;; definition for method 3 of type citb-disc-c -(defmethod inspect citb-disc-c ((this citb-disc-c)) +(defmethod inspect ((this citb-disc-c)) (let ((t9-0 (method-of-type citb-disc inspect))) (t9-0 this) ) @@ -608,14 +556,10 @@ ;; definition of type citb-disc-d (deftype citb-disc-d (citb-disc) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xbc - :flag-assert #x16005000bc ) ;; definition for method 3 of type citb-disc-d -(defmethod inspect citb-disc-d ((this citb-disc-d)) +(defmethod inspect ((this citb-disc-d)) (let ((t9-0 (method-of-type citb-disc inspect))) (t9-0 this) ) @@ -624,7 +568,7 @@ ;; definition for method 21 of type citb-disc-a ;; INFO: Return type mismatch int vs none. -(defmethod citb-disc-method-21 citb-disc-a ((this citb-disc-a)) +(defmethod citb-disc-method-21 ((this citb-disc-a)) (initialize-skeleton this *citb-disc-a-sg* '()) 0 (none) @@ -632,7 +576,7 @@ ;; definition for method 21 of type citb-disc-b ;; INFO: Return type mismatch int vs none. -(defmethod citb-disc-method-21 citb-disc-b ((this citb-disc-b)) +(defmethod citb-disc-method-21 ((this citb-disc-b)) (initialize-skeleton this *citb-disc-b-sg* '()) 0 (none) @@ -640,7 +584,7 @@ ;; definition for method 21 of type citb-disc-c ;; INFO: Return type mismatch int vs none. -(defmethod citb-disc-method-21 citb-disc-c ((this citb-disc-c)) +(defmethod citb-disc-method-21 ((this citb-disc-c)) (initialize-skeleton this *citb-disc-c-sg* '()) 0 (none) @@ -648,7 +592,7 @@ ;; definition for method 21 of type citb-disc-d ;; INFO: Return type mismatch int vs none. -(defmethod citb-disc-method-21 citb-disc-d ((this citb-disc-d)) +(defmethod citb-disc-method-21 ((this citb-disc-d)) (initialize-skeleton this *citb-disc-d-sg* '()) 0 (none) @@ -657,14 +601,10 @@ ;; definition of type citb-iris-door (deftype citb-iris-door (eco-door) () - :heap-base #xa0 - :method-count-assert 27 - :size-assert #x104 - :flag-assert #x1b00a00104 ) ;; definition for method 3 of type citb-iris-door -(defmethod inspect citb-iris-door ((this citb-iris-door)) +(defmethod inspect ((this citb-iris-door)) (let ((t9-0 (method-of-type eco-door inspect))) (t9-0 this) ) @@ -679,7 +619,7 @@ ;; definition for method 24 of type citb-iris-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-24 citb-iris-door ((this citb-iris-door)) +(defmethod eco-door-method-24 ((this citb-iris-door)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -692,7 +632,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -700,13 +640,13 @@ ;; definition for method 25 of type citb-iris-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-25 citb-iris-door ((this citb-iris-door)) +(defmethod eco-door-method-25 ((this citb-iris-door)) (initialize-skeleton this *citb-iris-door-sg* '()) (set! (-> this open-distance) 32768.0) (set! (-> this close-distance) 49152.0) (set! (-> this auto-close) #t) (process-entity-status! this (entity-perm-status complete) #t) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) 0 (none) ) @@ -720,14 +660,10 @@ ;; definition of type citb-button (deftype citb-button (basebutton) () - :heap-base #x90 - :method-count-assert 32 - :size-assert #x100 - :flag-assert #x2000900100 ) ;; definition for method 3 of type citb-button -(defmethod inspect citb-button ((this citb-button)) +(defmethod inspect ((this citb-button)) (let ((t9-0 (method-of-type basebutton inspect))) (t9-0 this) ) @@ -736,7 +672,7 @@ ;; definition for method 27 of type citb-button ;; INFO: Return type mismatch int vs collide-shape-moving. -(defmethod basebutton-method-27 citb-button ((this citb-button)) +(defmethod basebutton-method-27 ((this citb-button)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -754,13 +690,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (the-as collide-shape-moving 0) ) ;; definition for method 26 of type citb-button -(defmethod basebutton-method-26 citb-button ((this citb-button)) +(defmethod basebutton-method-26 ((this citb-button)) (initialize-skeleton this *citb-button-sg* '()) (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) @@ -790,23 +726,19 @@ ) (set! (-> this anim-speed) 2.0) (set! (-> this timeout) 1.0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (ja-post) (none) ) ;; definition of type citb-launcher (deftype citb-launcher (plat) - ((launcher (pointer launcher) :offset-assert 264) + ((launcher (pointer launcher)) ) - :heap-base #xa0 - :method-count-assert 33 - :size-assert #x10c - :flag-assert #x2100a0010c ) ;; definition for method 3 of type citb-launcher -(defmethod inspect citb-launcher ((this citb-launcher)) +(defmethod inspect ((this citb-launcher)) (let ((t9-0 (method-of-type plat inspect))) (t9-0 this) ) @@ -834,19 +766,19 @@ ) ;; definition for method 23 of type citb-launcher -(defmethod get-unlit-skel citb-launcher ((this citb-launcher)) +(defmethod get-unlit-skel ((this citb-launcher)) *citb-launcher-sg* ) ;; definition for method 26 of type citb-launcher ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-26 citb-launcher ((this citb-launcher)) +(defmethod baseplat-method-26 ((this citb-launcher)) (let ((f30-0 (res-lump-float (-> this entity) 'spring-height :default 163840.0)) (s5-0 (res-lump-value (-> this entity) 'mode uint128)) ) - (set! (-> this launcher) (process-spawn launcher (-> this root-override trans) f30-0 s5-0 81920.0 :to this)) + (set! (-> this launcher) (process-spawn launcher (-> this root trans) f30-0 s5-0 81920.0 :to this)) ) - (set! (-> this root-override root-prim local-sphere w) 18432.0) + (set! (-> this root root-prim local-sphere w) 18432.0) (logclear! (-> this mask) (process-mask actor-pause)) 0 (none) @@ -916,13 +848,9 @@ ;; definition of type citb-robotboss (deftype citb-robotboss (process-drawable) - ((root-override collide-shape :offset 112) - (shield-on symbol :offset-assert 176) + ((root collide-shape :override) + (shield-on symbol) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states citb-robotboss-die citb-robotboss-idle @@ -930,7 +858,7 @@ ) ;; definition for method 3 of type citb-robotboss -(defmethod inspect citb-robotboss ((this citb-robotboss)) +(defmethod inspect ((this citb-robotboss)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -988,58 +916,51 @@ ) ) :code (behavior () - (let ((gp-0 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-nose-sg* #f :to self))) + (let ((gp-0 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-nose-sg* #f :to self))) (send-event (ppointer->process gp-0) 'anim-mode 'loop) (send-event (ppointer->process gp-0) 'art-joint-anim "citb-robotboss-nose-idle" 0) (send-event (ppointer->process gp-0) 'draw #t) ) - (let ((gp-1 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-head-sg* #f :to self))) + (let ((gp-1 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-head-sg* #f :to self))) (send-event (ppointer->process gp-1) 'anim-mode 'loop) (send-event (ppointer->process gp-1) 'art-joint-anim "citb-robotboss-head-idle" 0) (send-event (ppointer->process gp-1) 'draw #t) ) - (let ((gp-2 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-gun-sg* #f :to self))) + (let ((gp-2 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-gun-sg* #f :to self))) (send-event (ppointer->process gp-2) 'anim-mode 'loop) (send-event (ppointer->process gp-2) 'art-joint-anim "citb-robotboss-gun-idle" 0) (send-event (ppointer->process gp-2) 'draw #t) ) - (let ((gp-3 - (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-leftshoulder-sg* #f :to self) - ) - ) + (let ((gp-3 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-leftshoulder-sg* #f :to self))) (send-event (ppointer->process gp-3) 'anim-mode 'loop) (send-event (ppointer->process gp-3) 'art-joint-anim "citb-robotboss-leftshoulder-idle" 0) (send-event (ppointer->process gp-3) 'draw #t) ) - (let ((gp-4 - (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-rightshoulder-sg* #f :to self) - ) - ) + (let ((gp-4 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-rightshoulder-sg* #f :to self))) (send-event (ppointer->process gp-4) 'anim-mode 'loop) (send-event (ppointer->process gp-4) 'art-joint-anim "citb-robotboss-rightshoulder-idle" 0) (send-event (ppointer->process gp-4) 'draw #t) ) - (let ((gp-5 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-leftarm-sg* #f :to self))) + (let ((gp-5 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-leftarm-sg* #f :to self))) (send-event (ppointer->process gp-5) 'anim-mode 'loop) (send-event (ppointer->process gp-5) 'art-joint-anim "citb-robotboss-leftarm-idle" 0) (send-event (ppointer->process gp-5) 'draw #t) ) - (let ((gp-6 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-rightarm-sg* #f :to self)) - ) + (let ((gp-6 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-rightarm-sg* #f :to self))) (send-event (ppointer->process gp-6) 'anim-mode 'loop) (send-event (ppointer->process gp-6) 'art-joint-anim "citb-robotboss-rightarm-idle" 0) (send-event (ppointer->process gp-6) 'draw #t) ) - (let ((gp-7 (manipy-spawn (-> self root-override trans) (-> self entity) *citb-robotboss-belly-sg* #f :to self))) + (let ((gp-7 (manipy-spawn (-> self root trans) (-> self entity) *citb-robotboss-belly-sg* #f :to self))) (send-event (ppointer->process gp-7) 'anim-mode 'loop) (send-event (ppointer->process gp-7) 'art-joint-anim "citb-robotboss-belly-idle" 0) (send-event (ppointer->process gp-7) 'draw #t) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (loop (when (-> self shield-on) (update! (-> self sound)) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (set! (-> *palette-fade-controls* control 7 fade) 1.0) ) (suspend) @@ -1058,7 +979,7 @@ ;; definition for method 11 of type citb-robotboss ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-robotboss ((this citb-robotboss) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-robotboss) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object)) @@ -1071,7 +992,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *citb-robotboss-sg* '()) @@ -1079,7 +1000,7 @@ (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this shield-on) #t) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "robotcage-lp" :fo-max 150) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "robotcage-lp" :fo-max 150) (-> this root trans)) ) (if (= (get-task-status (-> this entity extra perm task)) (task-status invalid)) (go citb-robotboss-die) @@ -1096,12 +1017,8 @@ ;; definition of type citb-coil (deftype citb-coil (process-drawable) - ((part-off sparticle-launch-control :offset-assert 176) + ((part-off sparticle-launch-control) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states citb-coil-break citb-coil-broken @@ -1110,7 +1027,7 @@ ) ;; definition for method 3 of type citb-coil -(defmethod inspect citb-coil ((this citb-coil)) +(defmethod inspect ((this citb-coil)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1120,7 +1037,7 @@ ;; definition for method 7 of type citb-coil ;; INFO: Return type mismatch process-drawable vs citb-coil. -(defmethod relocate citb-coil ((this citb-coil) (arg0 int)) +(defmethod relocate ((this citb-coil) (arg0 int)) (if (nonzero? (-> this part-off)) (&+! (-> this part-off) arg0) ) @@ -1128,7 +1045,7 @@ ) ;; definition for method 10 of type citb-coil -(defmethod deactivate citb-coil ((this citb-coil)) +(defmethod deactivate ((this citb-coil)) (if (nonzero? (-> this part-off)) (kill-and-free-particles (-> this part-off)) ) @@ -1193,7 +1110,7 @@ ;; definition for method 11 of type citb-coil ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-coil ((this citb-coil) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-coil) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *citb-coil-sg* '()) @@ -1220,10 +1137,6 @@ ;; definition of type citb-hose (deftype citb-hose (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states citb-hose-die citb-hose-idle @@ -1232,7 +1145,7 @@ ) ;; definition for method 3 of type citb-hose -(defmethod inspect citb-hose ((this citb-hose)) +(defmethod inspect ((this citb-hose)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1299,7 +1212,7 @@ ;; definition for method 11 of type citb-hose ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-hose ((this citb-hose) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-hose) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *citb-hose-sg* '()) @@ -1318,13 +1231,10 @@ ;; definition of type citb-chains (deftype citb-chains (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) ;; definition for method 3 of type citb-chains -(defmethod inspect citb-chains ((this citb-chains)) +(defmethod inspect ((this citb-chains)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -1369,23 +1279,19 @@ ;; definition of type citb-generator (deftype citb-generator (process-drawable) - ((root-override collide-shape :offset 112) - (normal-look lod-set :inline :offset-assert 176) - (broken-look lod-set :inline :offset-assert 212) - (mushroom-pos vector :inline :offset-assert 256) - (mushroom symbol :offset-assert 272) - (birth-fuel-cell symbol :offset-assert 276) - (trigger-others symbol :offset-assert 280) - (part-broken sparticle-launch-control :offset-assert 284) - (part-mushroom sparticle-launch-control :offset-assert 288) + ((root collide-shape :override) + (normal-look lod-set :inline) + (broken-look lod-set :inline) + (mushroom-pos vector :inline) + (mushroom symbol) + (birth-fuel-cell symbol) + (trigger-others symbol) + (part-broken sparticle-launch-control) + (part-mushroom sparticle-launch-control) ) - :heap-base #xc0 - :method-count-assert 22 - :size-assert #x124 - :flag-assert #x1600c00124 (:methods - (init! (_type_) none 20) - (citb-generator-method-21 (_type_) none 21) + (init! (_type_) none) + (citb-generator-method-21 (_type_) none) ) (:states citb-generator-break @@ -1395,7 +1301,7 @@ ) ;; definition for method 3 of type citb-generator -(defmethod inspect citb-generator ((this citb-generator)) +(defmethod inspect ((this citb-generator)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1412,7 +1318,7 @@ ;; definition for method 7 of type citb-generator ;; INFO: Return type mismatch process-drawable vs citb-generator. -(defmethod relocate citb-generator ((this citb-generator) (arg0 int)) +(defmethod relocate ((this citb-generator) (arg0 int)) (if (nonzero? (-> this part-broken)) (&+! (-> this part-broken) arg0) ) @@ -1423,7 +1329,7 @@ ) ;; definition for method 10 of type citb-generator -(defmethod deactivate citb-generator ((this citb-generator)) +(defmethod deactivate ((this citb-generator)) (if (nonzero? (-> this part-broken)) (kill-and-free-particles (-> this part-broken)) ) @@ -1532,9 +1438,9 @@ ) :code (behavior () (lods-assign! (-> self draw) (-> self normal-look)) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (loop - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (update! (-> self sound)) (if (-> self mushroom) (spawn (-> self part-mushroom) (-> self mushroom-pos)) @@ -1542,7 +1448,7 @@ (if (not (-> self mushroom)) (+! (-> *palette-fade-controls* control 3 fade) 0.3333) ) - (when (and *target* (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and *target* (>= 32768.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (if (-> self mushroom) (level-hint-spawn (text-id citadel-generator) "sksp0381" (the-as entity #f) *entity-pool* (game-task none)) (level-hint-spawn @@ -1603,7 +1509,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (sound-play "sagecage-open") @@ -1616,7 +1522,7 @@ (defstate citb-generator-broken (citb-generator) :code (behavior () (lods-assign! (-> self draw) (-> self broken-look)) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (cond ((-> self birth-fuel-cell) (process-drawable-birth-fuel-cell (the-as entity #f) (the-as vector #f) #t) @@ -1634,14 +1540,14 @@ (anim-loop) ) :post (behavior () - (spawn (-> self part-broken) (-> self root-override trans)) + (spawn (-> self part-broken) (-> self root trans)) (ja-post) ) ) ;; definition for method 20 of type citb-generator ;; INFO: Return type mismatch int vs none. -(defmethod init! citb-generator ((this citb-generator)) +(defmethod init! ((this citb-generator)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) @@ -1653,7 +1559,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1662,14 +1568,14 @@ ;; definition for method 21 of type citb-generator ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod citb-generator-method-21 citb-generator ((this citb-generator)) +(defmethod citb-generator-method-21 ((this citb-generator)) (initialize-skeleton this *citb-generator-sg* '()) (setup-lods! (-> this normal-look) *citb-generator-sg* (-> this draw art-group) (-> this entity)) (setup-lods! (-> this broken-look) *citb-generator-broken-sg* (-> this draw art-group) (-> this entity)) (set! (-> this link) (new 'process 'actor-link-info this)) (set! (-> this birth-fuel-cell) (< (the-as uint 1) (the-as uint (-> this entity extra perm task)))) (set! (-> this trigger-others) #f) - (set! (-> this mushroom-pos quad) (-> this root-override trans quad)) + (set! (-> this mushroom-pos quad) (-> this root trans quad)) (let ((f30-0 0.0)) (cond ((name= (-> this name) "citb-generator-1") @@ -1701,7 +1607,7 @@ (set! (-> this part-broken) (create-launch-control (-> *part-group-id-table* 597) this)) (set! (-> this part-mushroom) (create-launch-control (-> *part-group-id-table* 599) this)) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "mushroom-gen" :fo-max 20) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "mushroom-gen" :fo-max 20) (-> this root trans)) ) 0 (none) @@ -1709,7 +1615,7 @@ ;; definition for method 11 of type citb-generator ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-generator ((this citb-generator) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-generator) (arg0 entity-actor)) (init! this) (process-drawable-from-entity! this arg0) (citb-generator-method-21 this) @@ -1734,10 +1640,6 @@ ;; definition of type citadelcam (deftype citadelcam (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states citadelcam-idle citadelcam-stair-plats @@ -1745,7 +1647,7 @@ ) ;; definition for method 3 of type citadelcam -(defmethod inspect citadelcam ((this citadelcam)) +(defmethod inspect ((this citadelcam)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1824,7 +1726,7 @@ ;; definition for method 11 of type citadelcam ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citadelcam ((this citadelcam) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citadelcam) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1835,14 +1737,10 @@ ;; definition of type citb-battlecontroller (deftype citb-battlecontroller (battlecontroller) () - :heap-base #x210 - :method-count-assert 29 - :size-assert #x27c - :flag-assert #x1d0210027c ) ;; definition for method 3 of type citb-battlecontroller -(defmethod inspect citb-battlecontroller ((this citb-battlecontroller)) +(defmethod inspect ((this citb-battlecontroller)) (let ((t9-0 (method-of-type battlecontroller inspect))) (t9-0 this) ) @@ -1893,7 +1791,7 @@ ;; definition for method 27 of type citb-battlecontroller ;; INFO: Return type mismatch int vs none. -(defmethod battlecontroller-method-27 citb-battlecontroller ((this citb-battlecontroller)) +(defmethod battlecontroller-method-27 ((this citb-battlecontroller)) (call-parent-method this) (set! (-> this activate-distance) 143360.0) 0 diff --git a/test/decompiler/reference/jak1/levels/citadel/citadel-part_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citadel-part_REF.gc index 2a2897dc2e8..9ae13506d87 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citadel-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citadel-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type citb-part (deftype citb-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type citb-part -(defmethod inspect citb-part ((this citb-part)) +(defmethod inspect ((this citb-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc index 4c5849e020b..d3775dfddda 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc @@ -9,20 +9,16 @@ ;; definition of type citb-sagecage (deftype citb-sagecage (process-drawable) - ((parent-override (pointer citb-sage) :offset 12) - (root-override collide-shape-moving :offset 112) - (bar-array vector 12 :inline :offset-assert 176) - (angle-offset float :offset-assert 368) - (bars-on symbol :offset-assert 372) - (cloning symbol :offset-assert 376) + ((root collide-shape-moving :override) + (parent-override (pointer citb-sage) :overlay-at parent) + (bar-array vector 12 :inline) + (angle-offset float) + (bars-on symbol) + (cloning symbol) ) - :heap-base #x110 - :method-count-assert 22 - :size-assert #x17c - :flag-assert #x160110017c (:methods - (citb-sagecage-method-20 (_type_) none 20) - (citb-sagecage-method-21 (_type_) none 21) + (citb-sagecage-method-20 (_type_) none) + (citb-sagecage-method-21 (_type_) none) ) (:states citb-sagecage-idle @@ -30,7 +26,7 @@ ) ;; definition for method 3 of type citb-sagecage -(defmethod inspect citb-sagecage ((this citb-sagecage)) +(defmethod inspect ((this citb-sagecage)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -51,7 +47,7 @@ (let ((s4-0 (new 'stack-no-clear 'quaternion))) (let ((s3-0 (new 'stack-no-clear 'vector))) (matrix->quaternion s4-0 gp-0) - (vector-! s3-0 (camera-pos) (-> self root-override trans)) + (vector-! s3-0 (camera-pos) (-> self root trans)) (let ((v1-7 (-> gp-0 vector 2))) (set! (-> self angle-offset) (- (atan (-> v1-7 x) (-> v1-7 z)))) ) @@ -79,10 +75,10 @@ ;; definition for function citb-sagecage-update-collision ;; INFO: Return type mismatch int vs none. (defbehavior citb-sagecage-update-collision citb-sagecage () - (change-mesh (the-as collide-shape-prim-mesh (-> self root-override root-prim)) (if (-> self bars-on) - 0 - 1 - ) + (change-mesh (the-as collide-shape-prim-mesh (-> self root root-prim)) (if (-> self bars-on) + 0 + 1 + ) ) 0 (none) @@ -155,7 +151,7 @@ ;; definition for method 20 of type citb-sagecage ;; INFO: Return type mismatch int vs none. -(defmethod citb-sagecage-method-20 citb-sagecage ((this citb-sagecage)) +(defmethod citb-sagecage-method-20 ((this citb-sagecage)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -174,7 +170,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -182,10 +178,10 @@ ;; definition for method 21 of type citb-sagecage ;; INFO: Return type mismatch int vs none. -(defmethod citb-sagecage-method-21 citb-sagecage ((this citb-sagecage)) +(defmethod citb-sagecage-method-21 ((this citb-sagecage)) (initialize-skeleton this *citb-sagecage-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (set! (-> this root-override pause-adjust-distance) 409600.0) + (set! (-> this root pause-adjust-distance) 409600.0) (let ((f0-1 20766.72) (f4-0 14745.6) (f1-0 -14745.6) @@ -207,7 +203,7 @@ (set-vector! (-> this bar-array 11) f2-0 f0-1 f1-0 1.0) ) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "sagecage-gen" :fo-max 20) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "sagecage-gen" :fo-max 20) (-> this root trans)) ) (set! (-> this bars-on) (not (task-complete? *game-info* (-> this entity extra perm task)))) (citb-sagecage-update-collision) @@ -221,9 +217,9 @@ ;; INFO: Return type mismatch object vs none. (defbehavior citb-sagecage-init-by-other citb-sagecage ((arg0 citb-sage)) (citb-sagecage-method-20 self) - (mem-copy! (the-as pointer (-> self root-override trans)) (the-as pointer (-> arg0 root-override trans)) 16) - (mem-copy! (the-as pointer (-> self root-override quat)) (the-as pointer (-> arg0 root-override quat)) 16) - (mem-copy! (the-as pointer (-> self root-override scale)) (the-as pointer (-> arg0 root-override scale)) 16) + (mem-copy! (the-as pointer (-> self root trans)) (the-as pointer (-> arg0 root trans)) 16) + (mem-copy! (the-as pointer (-> self root quat)) (the-as pointer (-> arg0 root quat)) 16) + (mem-copy! (the-as pointer (-> self root scale)) (the-as pointer (-> arg0 root scale)) 16) (citb-sagecage-method-21 self) (go citb-sagecage-idle) (none) @@ -273,31 +269,27 @@ ;; definition of type citb-sage (deftype citb-sage (process-taskable) - ((spawn-pos vector :inline :offset-assert 384) - (target-pos vector :inline :offset-assert 400) - (dir vector :inline :offset-assert 416) - (rot-y float :offset-assert 432) - (rot-x float :offset-assert 436) - (idle-anim int32 :offset-assert 440) - (attack-start-anim int32 :offset-assert 444) - (attack-anim int32 :offset-assert 448) - (beam-joint int32 :offset-assert 452) - (cage handle :offset-assert 456) - (part-impact sparticle-launch-control :offset-assert 464) - (beam-on symbol :offset-assert 468) - (resolution-anim spool-anim :offset-assert 472) - (sound-name string :offset-assert 476) - (sound-id sound-id :offset-assert 480) - (alt-actor entity-actor :offset-assert 484) + ((spawn-pos vector :inline) + (target-pos vector :inline) + (dir vector :inline) + (rot-y float) + (rot-x float) + (idle-anim int32) + (attack-start-anim int32) + (attack-anim int32) + (beam-joint int32) + (cage handle) + (part-impact sparticle-launch-control) + (beam-on symbol) + (resolution-anim spool-anim) + (sound-name string) + (sound-id sound-id) + (alt-actor entity-actor) ) - :heap-base #x180 - :method-count-assert 53 - :size-assert #x1e8 - :flag-assert #x35018001e8 ) ;; definition for method 3 of type citb-sage -(defmethod inspect citb-sage ((this citb-sage)) +(defmethod inspect ((this citb-sage)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -322,7 +314,7 @@ ;; definition for method 7 of type citb-sage ;; INFO: Return type mismatch process-taskable vs citb-sage. -(defmethod relocate citb-sage ((this citb-sage) (arg0 int)) +(defmethod relocate ((this citb-sage) (arg0 int)) (if (nonzero? (-> this part-impact)) (&+! (-> this part-impact) arg0) ) @@ -330,7 +322,7 @@ ) ;; definition for method 10 of type citb-sage -(defmethod deactivate citb-sage ((this citb-sage)) +(defmethod deactivate ((this citb-sage)) (if (nonzero? (-> this part-impact)) (kill-and-free-particles (-> this part-impact)) ) @@ -342,8 +334,8 @@ ;; definition for method 44 of type citb-sage ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs symbol. -(defmethod play-reminder citb-sage ((this citb-sage)) - (set! (-> this root-override pause-adjust-distance) 409600.0) +(defmethod play-reminder ((this citb-sage)) + (set! (-> this root pause-adjust-distance) 409600.0) (set! (-> this cage) (ppointer->handle (process-spawn citb-sagecage this :to this))) (set! (-> this beam-on) #f) (set! (-> this sound-id) (new-sound-id)) @@ -358,7 +350,7 @@ (set! v1-9 (entity-by-name "citb-robotboss-1")) ) (set! (-> this alt-actor) (the-as entity-actor v1-9)) - (set! (-> this spawn-pos quad) (-> this root-override trans quad)) + (set! (-> this spawn-pos quad) (-> this root trans quad)) (set! (-> s5-1 quad) (-> v1-9 extra trans quad)) (+! (-> s5-1 y) 81920.0) (vector-! s4-0 (-> this spawn-pos) s5-1) @@ -378,14 +370,14 @@ ;; definition for method 45 of type citb-sage ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs symbol. -(defmethod process-taskable-method-45 citb-sage ((this citb-sage)) - (set! (-> this spawn-pos quad) (-> this root-override trans quad)) +(defmethod process-taskable-method-45 ((this citb-sage)) + (set! (-> this spawn-pos quad) (-> this root trans quad)) (the-as symbol 0) ) ;; definition for method 42 of type citb-sage ;; INFO: Return type mismatch object vs none. -(defmethod process-taskable-method-42 citb-sage ((this citb-sage)) +(defmethod process-taskable-method-42 ((this citb-sage)) (if (not (should-display? this)) (go (method-of-object this hidden)) (go (method-of-object this idle)) @@ -395,12 +387,12 @@ ;; definition for method 32 of type citb-sage ;; INFO: Return type mismatch spool-anim vs basic. -(defmethod play-anim! citb-sage ((this citb-sage) (arg0 symbol)) +(defmethod play-anim! ((this citb-sage) (arg0 symbol)) (the-as basic (-> this resolution-anim)) ) ;; definition for method 31 of type citb-sage -(defmethod get-art-elem citb-sage ((this citb-sage)) +(defmethod get-art-elem ((this citb-sage)) (cond ((= (current-status (-> this tasks)) (task-status invalid)) (set! (-> this beam-on) #t) @@ -413,7 +405,7 @@ ) ;; definition for method 39 of type citb-sage -(defmethod should-display? citb-sage ((this citb-sage)) +(defmethod should-display? ((this citb-sage)) (!= (get-task-status (game-task citadel-sage-green)) (task-status invalid)) ) @@ -495,14 +487,10 @@ ;; definition of type red-sagecage (deftype red-sagecage (citb-sage) () - :heap-base #x180 - :method-count-assert 53 - :size-assert #x1e8 - :flag-assert #x35018001e8 ) ;; definition for method 3 of type red-sagecage -(defmethod inspect red-sagecage ((this red-sagecage)) +(defmethod inspect ((this red-sagecage)) (let ((t9-0 (method-of-type citb-sage inspect))) (t9-0 this) ) @@ -511,7 +499,7 @@ ;; definition for method 52 of type red-sagecage ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 red-sagecage ((this red-sagecage)) +(defmethod process-taskable-method-52 ((this red-sagecage)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) @@ -530,7 +518,7 @@ ;; definition for method 48 of type red-sagecage ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow red-sagecage ((this red-sagecage)) +(defmethod draw-npc-shadow ((this red-sagecage)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -555,7 +543,7 @@ ;; definition for method 45 of type red-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod process-taskable-method-45 red-sagecage ((this red-sagecage)) +(defmethod process-taskable-method-45 ((this red-sagecage)) (set! (-> *part-id-table* 2455 init-specs 14 initial-valuef) (-> this rot-y)) (set! (-> *part-id-table* 2455 init-specs 13 initial-valuef) (-> this rot-x)) (set! (-> *part-id-table* 2457 init-specs 14 initial-valuef) (-> this rot-y)) @@ -567,7 +555,7 @@ ;; definition for method 44 of type red-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod play-reminder red-sagecage ((this red-sagecage)) +(defmethod play-reminder ((this red-sagecage)) (set! (-> this idle-anim) 4) (set! (-> this attack-start-anim) 5) (set! (-> this attack-anim) 6) @@ -592,7 +580,7 @@ ) ;; definition for method 43 of type red-sagecage -(defmethod process-taskable-method-43 red-sagecage ((this red-sagecage)) +(defmethod process-taskable-method-43 ((this red-sagecage)) (if (-> this beam-on) (return #f) ) @@ -600,13 +588,13 @@ (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) - (play-ambient (-> this ambient) "RED-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "RED-AM01" #f (-> this root trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> this ambient) "RED-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "RED-AM02" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "RED-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "RED-AM03" #f (-> this root trans)) ) ) ) @@ -614,7 +602,7 @@ ) ;; definition for method 11 of type red-sagecage -(defmethod init-from-entity! red-sagecage ((this red-sagecage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this red-sagecage) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *redsage-sg* 3 33 (new 'static 'vector :w 8192.0) 5) (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) (play-reminder this) @@ -626,14 +614,10 @@ ;; definition of type blue-sagecage (deftype blue-sagecage (citb-sage) () - :heap-base #x180 - :method-count-assert 53 - :size-assert #x1e8 - :flag-assert #x35018001e8 ) ;; definition for method 3 of type blue-sagecage -(defmethod inspect blue-sagecage ((this blue-sagecage)) +(defmethod inspect ((this blue-sagecage)) (let ((t9-0 (method-of-type citb-sage inspect))) (t9-0 this) ) @@ -642,7 +626,7 @@ ;; definition for method 52 of type blue-sagecage ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 blue-sagecage ((this blue-sagecage)) +(defmethod process-taskable-method-52 ((this blue-sagecage)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) @@ -661,7 +645,7 @@ ;; definition for method 48 of type blue-sagecage ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow blue-sagecage ((this blue-sagecage)) +(defmethod draw-npc-shadow ((this blue-sagecage)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -686,7 +670,7 @@ ;; definition for method 45 of type blue-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod process-taskable-method-45 blue-sagecage ((this blue-sagecage)) +(defmethod process-taskable-method-45 ((this blue-sagecage)) (set! (-> *part-id-table* 2448 init-specs 14 initial-valuef) (-> this rot-y)) (set! (-> *part-id-table* 2448 init-specs 13 initial-valuef) (-> this rot-x)) (set! (-> *part-id-table* 2450 init-specs 14 initial-valuef) (-> this rot-y)) @@ -698,7 +682,7 @@ ;; definition for method 44 of type blue-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod play-reminder blue-sagecage ((this blue-sagecage)) +(defmethod play-reminder ((this blue-sagecage)) (set! (-> this idle-anim) 4) (set! (-> this attack-start-anim) 5) (set! (-> this attack-anim) 6) @@ -728,7 +712,7 @@ ) ;; definition for method 43 of type blue-sagecage -(defmethod process-taskable-method-43 blue-sagecage ((this blue-sagecage)) +(defmethod process-taskable-method-43 ((this blue-sagecage)) (if (-> this beam-on) (return #f) ) @@ -736,13 +720,13 @@ (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) - (play-ambient (-> this ambient) "BLU-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BLU-AM01" #f (-> this root trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> this ambient) "BLU-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BLU-AM02" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "BLU-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BLU-AM03" #f (-> this root trans)) ) ) ) @@ -750,7 +734,7 @@ ) ;; definition for method 11 of type blue-sagecage -(defmethod init-from-entity! blue-sagecage ((this blue-sagecage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this blue-sagecage) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *bluesage-sg* 3 54 (new 'static 'vector :w 8192.0) 5) (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) (play-reminder this) @@ -762,14 +746,10 @@ ;; definition of type yellow-sagecage (deftype yellow-sagecage (citb-sage) () - :heap-base #x180 - :method-count-assert 53 - :size-assert #x1e8 - :flag-assert #x35018001e8 ) ;; definition for method 3 of type yellow-sagecage -(defmethod inspect yellow-sagecage ((this yellow-sagecage)) +(defmethod inspect ((this yellow-sagecage)) (let ((t9-0 (method-of-type citb-sage inspect))) (t9-0 this) ) @@ -778,7 +758,7 @@ ;; definition for method 52 of type yellow-sagecage ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 yellow-sagecage ((this yellow-sagecage)) +(defmethod process-taskable-method-52 ((this yellow-sagecage)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) @@ -797,7 +777,7 @@ ;; definition for method 48 of type yellow-sagecage ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow yellow-sagecage ((this yellow-sagecage)) +(defmethod draw-npc-shadow ((this yellow-sagecage)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -822,7 +802,7 @@ ;; definition for method 45 of type yellow-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod process-taskable-method-45 yellow-sagecage ((this yellow-sagecage)) +(defmethod process-taskable-method-45 ((this yellow-sagecage)) (set! (-> *part-id-table* 2462 init-specs 14 initial-valuef) (-> this rot-y)) (set! (-> *part-id-table* 2462 init-specs 13 initial-valuef) (-> this rot-x)) (set! (-> *part-id-table* 2464 init-specs 14 initial-valuef) (-> this rot-y)) @@ -834,7 +814,7 @@ ;; definition for method 44 of type yellow-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod play-reminder yellow-sagecage ((this yellow-sagecage)) +(defmethod play-reminder ((this yellow-sagecage)) (set! (-> this idle-anim) 4) (set! (-> this attack-start-anim) 5) (set! (-> this attack-anim) 6) @@ -859,7 +839,7 @@ ) ;; definition for method 43 of type yellow-sagecage -(defmethod process-taskable-method-43 yellow-sagecage ((this yellow-sagecage)) +(defmethod process-taskable-method-43 ((this yellow-sagecage)) (if (-> this beam-on) (return #f) ) @@ -867,13 +847,13 @@ (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) - (play-ambient (-> this ambient) "YEL-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "YEL-AM01" #f (-> this root trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> this ambient) "YEL-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "YEL-AM02" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "YEL-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "YEL-AM03" #f (-> this root trans)) ) ) ) @@ -881,7 +861,7 @@ ) ;; definition for method 11 of type yellow-sagecage -(defmethod init-from-entity! yellow-sagecage ((this yellow-sagecage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this yellow-sagecage) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *yellowsage-sg* 3 50 (new 'static 'vector :w 8192.0) 5) (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) (play-reminder this) @@ -892,20 +872,16 @@ ;; definition of type green-sagecage (deftype green-sagecage (citb-sage) - ((which-movie int32 :offset-assert 488) - (evilbro handle :offset-assert 496) - (evilsis handle :offset-assert 504) - (robotboss handle :offset-assert 512) - (exitplat handle :offset-assert 520) + ((which-movie int32) + (evilbro handle) + (evilsis handle) + (robotboss handle) + (exitplat handle) ) - :heap-base #x1a0 - :method-count-assert 53 - :size-assert #x210 - :flag-assert #x3501a00210 ) ;; definition for method 3 of type green-sagecage -(defmethod inspect green-sagecage ((this green-sagecage)) +(defmethod inspect ((this green-sagecage)) (let ((t9-0 (method-of-type citb-sage inspect))) (t9-0 this) ) @@ -919,7 +895,7 @@ ;; definition for method 45 of type green-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod process-taskable-method-45 green-sagecage ((this green-sagecage)) +(defmethod process-taskable-method-45 ((this green-sagecage)) (set! (-> *part-id-table* 2469 init-specs 14 initial-valuef) (-> this rot-y)) (set! (-> *part-id-table* 2469 init-specs 13 initial-valuef) (-> this rot-x)) (set! (-> *part-id-table* 2471 init-specs 14 initial-valuef) (-> this rot-y)) @@ -931,7 +907,7 @@ ;; definition for method 44 of type green-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod play-reminder green-sagecage ((this green-sagecage)) +(defmethod play-reminder ((this green-sagecage)) (set! (-> this idle-anim) 4) (set! (-> this attack-start-anim) 4) (set! (-> this attack-anim) 4) @@ -958,7 +934,7 @@ ) ;; definition for method 32 of type green-sagecage -(defmethod play-anim! green-sagecage ((this green-sagecage) (arg0 symbol)) +(defmethod play-anim! ((this green-sagecage) (arg0 symbol)) (local-vars (v1-7 int)) (let ((v1-1 (current-status (-> this tasks)))) (cond @@ -996,17 +972,13 @@ (+! (-> this which-movie) 1) (set! (-> this draw bounds w) 40960.0) (set! (-> this evilbro) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *evilbro-citadel-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *evilbro-citadel-sg* #f :to this)) ) (send-event (handle->process (-> this evilbro)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this evilbro)) 'blend-shape #t) (send-event (handle->process (-> this evilbro)) 'center-joint 3) (set! (-> this evilsis) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *evilsis-citadel-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *evilsis-citadel-sg* #f :to this)) ) (send-event (handle->process (-> this evilsis)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this evilsis)) 'blend-shape #t) @@ -1123,7 +1095,7 @@ (format 0 "robotboss ent ~A~%" gp-0) (when gp-0 (set! (-> self robotboss) - (ppointer->handle (manipy-spawn (-> self root-override trans) gp-0 *robotboss-sg* #f :to self)) + (ppointer->handle (manipy-spawn (-> self root trans) gp-0 *robotboss-sg* #f :to self)) ) (send-event (handle->process (-> self robotboss)) 'anim-mode 'clone-anim) (send-event (handle->process (-> self robotboss)) 'center-joint 3) @@ -1222,7 +1194,7 @@ ) ;; definition for method 39 of type green-sagecage -(defmethod should-display? green-sagecage ((this green-sagecage)) +(defmethod should-display? ((this green-sagecage)) (< (-> this which-movie) 2) ) @@ -1245,7 +1217,7 @@ ) ;; definition for method 11 of type green-sagecage -(defmethod init-from-entity! green-sagecage ((this green-sagecage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this green-sagecage) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *green-sagecage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) (play-reminder this) diff --git a/test/decompiler/reference/jak1/levels/citadel/citb-bunny_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citb-bunny_REF.gc index ad7aa51086d..f7b87c7abbf 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citb-bunny_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citb-bunny_REF.gc @@ -4,17 +4,13 @@ ;; definition of type citb-bunny (deftype citb-bunny (snow-bunny) () - :heap-base #x190 - :method-count-assert 77 - :size-assert #x200 - :flag-assert #x4d01900200 (:methods - (citb-bunny-method-48 (_type_ object) none :replace 48) + (nav-enemy-method-48 (_type_ object) none :replace) ) ) ;; definition for method 3 of type citb-bunny -(defmethod inspect citb-bunny ((this citb-bunny)) +(defmethod inspect ((this citb-bunny)) (let ((t9-0 (method-of-type snow-bunny inspect))) (t9-0 this) ) @@ -82,7 +78,7 @@ ;; definition for method 60 of type citb-bunny ;; INFO: Return type mismatch int vs none. -(defmethod snow-bunny-method-60 citb-bunny ((this citb-bunny)) +(defmethod nav-enemy-method-60 ((this citb-bunny)) (initialize-skeleton this *citb-bunny-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) 0 @@ -91,8 +87,8 @@ ;; definition for method 48 of type citb-bunny ;; INFO: Return type mismatch int vs none. -(defmethod citb-bunny-method-48 citb-bunny ((this citb-bunny) (arg0 object)) - (snow-bunny-method-60 this) +(defmethod nav-enemy-method-48 ((this citb-bunny) (arg0 object)) + (nav-enemy-method-60 this) (init-defaults! this *citb-bunny-nav-enemy-info*) (logclear! (-> this draw shadow-ctrl settings flags) (shadow-flags shdf03)) (cond @@ -122,7 +118,7 @@ ;; definition for method 56 of type citb-bunny ;; INFO: Return type mismatch float vs none. -(defmethod set-jump-height-factor! citb-bunny ((this citb-bunny) (arg0 int)) +(defmethod set-jump-height-factor! ((this citb-bunny) (arg0 int)) (let ((v1-0 arg0)) (cond ((zero? v1-0) diff --git a/test/decompiler/reference/jak1/levels/citadel/citb-drop-plat_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citb-drop-plat_REF.gc index d8220982f90..a2f86d5b351 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citb-drop-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citb-drop-plat_REF.gc @@ -33,22 +33,18 @@ ;; definition of type drop-plat (deftype drop-plat (process-drawable) - ((root-override collide-shape-moving :offset 112) - (spin-axis vector :inline :offset-assert 176) - (spin-angle float :offset-assert 192) - (spin-speed float :offset-assert 196) - (interp float :offset-assert 200) - (duration time-frame :offset-assert 208) - (delay time-frame :offset-assert 216) - (color int8 :offset-assert 224) + ((root collide-shape-moving :override) + (spin-axis vector :inline) + (spin-angle float) + (spin-speed float) + (interp float) + (duration time-frame) + (delay time-frame) + (color int8) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xe1 - :flag-assert #x16008000e1 (:methods - (drop-plat-method-20 (_type_) none 20) - (drop-plat-method-21 (_type_) none 21) + (drop-plat-method-20 (_type_) none) + (drop-plat-method-21 (_type_) none) ) (:states drop-plat-die @@ -60,7 +56,7 @@ ) ;; definition for method 3 of type drop-plat -(defmethod inspect drop-plat ((this drop-plat)) +(defmethod inspect ((this drop-plat)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -91,7 +87,7 @@ ) :code (behavior () (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (set-time! (-> self state-time)) (logior! (-> self mask) (process-mask actor-pause)) (loop @@ -108,11 +104,12 @@ ;; INFO: Return type mismatch int vs none. (defbehavior drop-plat-set-fade drop-plat () (let ((f0-1 - (fmin 1.0 (* 0.000012207031 (- (-> self root-override trans y) - (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y)) - ) - ) - ) + (fmin + 1.0 + (* 0.000012207031 + (- (-> self root trans y) (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y))) + ) + ) ) ) (set-vector! (-> self draw color-mult) f0-1 f0-1 f0-1 1.0) @@ -131,9 +128,7 @@ ) ) :code (behavior () - (set! (-> self root-override trans y) - (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y)) - ) + (set! (-> self root trans y) (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y))) (logior! (-> self draw status) (draw-status hidden)) (ja-post) (set-time! (-> self state-time)) @@ -164,19 +159,17 @@ (set! (-> self interp) 1.0) (set-time! (-> self state-time)) (set! (-> self spin-angle) 0.0) - (set! (-> self root-override trans y) - (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y)) - ) + (set! (-> self root trans y) (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y))) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 #f) ) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (set! (-> gp-0 y) (-> (the-as process-drawable (-> self parent 0)) root trans y)) (loop (let ((f0-6 (fmax 0.0 (- 1.0 (* 0.0033333334 (the float (- (current-time) (-> self state-time)))))))) (set! (-> self interp) (* f0-6 f0-6)) ) - (set! (-> self root-override trans y) + (set! (-> self root trans y) (- (-> (the-as process-drawable (-> self parent 0)) root trans y) (* 204800.0 (-> self interp))) ) (when (and (not s5-0) (< (-> self interp) 0.05)) @@ -184,7 +177,7 @@ (sound-play "bridge-piece-up" :position (the-as symbol gp-0)) ) (set! (-> self spin-angle) (* 10.0 (-> self spin-speed) (-> self interp))) - (if (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) + (if (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root trans y)) (go drop-plat-idle) ) (suspend) @@ -194,7 +187,7 @@ :post (behavior () (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-vector-angle! gp-0 (-> self spin-axis) (-> self spin-angle)) - (quaternion*! (-> self root-override quat) (-> (the-as process-drawable (-> self parent 0)) root quat) gp-0) + (quaternion*! (-> self root quat) (-> (the-as process-drawable (-> self parent 0)) root quat) gp-0) ) (drop-plat-set-fade) (transform-post) @@ -204,7 +197,7 @@ ;; failed to figure out what this is: (defstate drop-plat-drop (drop-plat) :code (behavior () - (when (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) + (when (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root trans y)) (set-time! (-> self state-time)) (sound-play "bridge-piece-dn") (let ((gp-1 (the int (* 300.0 (rand-vu-float-range 0.2 0.3))))) @@ -216,14 +209,9 @@ ) ) (loop - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) - ) - (vector-v++! (-> self root-override trans) (-> self root-override transv)) - (if (< 204800.0 - (- (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) - ) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) + (vector-v++! (-> self root trans) (-> self root transv)) + (if (< 204800.0 (- (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root trans y))) (go drop-plat-die) ) (+! (-> self spin-angle) (* (-> self spin-speed) (seconds-per-frame))) @@ -233,7 +221,7 @@ :post (behavior () (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-vector-angle! gp-0 (-> self spin-axis) (-> self spin-angle)) - (quaternion*! (-> self root-override quat) (-> (the-as process-drawable (-> self parent 0)) root quat) gp-0) + (quaternion*! (-> self root quat) (-> (the-as process-drawable (-> self parent 0)) root quat) gp-0) ) (drop-plat-set-fade) (transform-post) @@ -249,7 +237,7 @@ ;; definition for method 20 of type drop-plat ;; INFO: Return type mismatch int vs none. -(defmethod drop-plat-method-20 drop-plat ((this drop-plat)) +(defmethod drop-plat-method-20 ((this drop-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -268,7 +256,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -276,7 +264,7 @@ ;; definition for method 21 of type drop-plat ;; INFO: Return type mismatch int vs none. -(defmethod drop-plat-method-21 drop-plat ((this drop-plat)) +(defmethod drop-plat-method-21 ((this drop-plat)) (case (-> this color) ((1) (initialize-skeleton this *citb-drop-plat-red-sg* '()) @@ -325,9 +313,9 @@ (set! (-> self delay) arg1) (set! (-> self duration) arg2) (drop-plat-method-20 self) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (vector-identity! (-> self root-override scale)) - (quaternion-copy! (-> self root-override quat) (-> (the-as process-drawable (-> self parent 0)) root quat)) + (set! (-> self root trans quad) (-> arg0 quad)) + (vector-identity! (-> self root scale)) + (quaternion-copy! (-> self root quat) (-> (the-as process-drawable (-> self parent 0)) root quat)) (drop-plat-method-21 self) (go drop-plat-spawn) (none) @@ -335,15 +323,12 @@ ;; definition of type handle-inline-array (deftype handle-inline-array (inline-array-class) - ((data handle :dynamic :offset-assert 16) + ((data handle :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type handle-inline-array -(defmethod inspect handle-inline-array ((this handle-inline-array)) +(defmethod inspect ((this handle-inline-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -356,24 +341,20 @@ ;; definition of type citb-drop-plat (deftype citb-drop-plat (process-drawable) - ((x-count int32 :offset-assert 176) - (z-count int32 :offset-assert 180) - (child-count int32 :offset-assert 184) - (child-array handle-inline-array :offset-assert 188) - (child-color-array (pointer int8) :offset-assert 192) - (x-dir vector :inline :offset-assert 208) - (z-dir vector :inline :offset-assert 224) - (origin vector :inline :offset-assert 240) - (x-spacing float :offset-assert 256) - (z-spacing float :offset-assert 260) - (idle-distance float :offset-assert 264) - (duration time-frame :offset-assert 272) - (drop-time time-frame :offset-assert 280) + ((x-count int32) + (z-count int32) + (child-count int32) + (child-array handle-inline-array) + (child-color-array (pointer int8)) + (x-dir vector :inline) + (z-dir vector :inline) + (origin vector :inline) + (x-spacing float) + (z-spacing float) + (idle-distance float) + (duration time-frame) + (drop-time time-frame) ) - :heap-base #xb0 - :method-count-assert 20 - :size-assert #x120 - :flag-assert #x1400b00120 (:states citb-drop-plat-active citb-drop-plat-idle @@ -381,7 +362,7 @@ ) ;; definition for method 3 of type citb-drop-plat -(defmethod inspect citb-drop-plat ((this citb-drop-plat)) +(defmethod inspect ((this citb-drop-plat)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -403,7 +384,7 @@ ;; definition for method 7 of type citb-drop-plat ;; INFO: Return type mismatch process-drawable vs citb-drop-plat. -(defmethod relocate citb-drop-plat ((this citb-drop-plat) (arg0 int)) +(defmethod relocate ((this citb-drop-plat) (arg0 int)) (if (nonzero? (-> this child-array)) (&+! (-> this child-array) arg0) ) @@ -563,7 +544,7 @@ ;; definition for method 11 of type citb-drop-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-drop-plat ((this citb-drop-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-drop-plat) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (let ((v1-2 (res-lump-data arg0 'count pointer))) diff --git a/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc index 03c7f96c66f..0ac9f6174f8 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc @@ -33,24 +33,22 @@ ;; definition of type citb-base-plat (deftype citb-base-plat (process-drawable) - ((root-override collide-shape-moving :offset 112) - (idle-distance float :offset-assert 176) + ((root collide-shape-moving :override) + (idle-distance float) ) - :heap-base #x50 - :method-count-assert 25 - :size-assert #xb4 - :flag-assert #x19005000b4 + (:state-methods + citb-base-plat-idle + ) (:methods - (citb-base-plat-idle () _type_ :state 20) - (citb-base-plat-method-21 (_type_) none 21) - (citb-base-plat-method-22 (_type_) none 22) - (citb-base-plat-active () _type_ :state 23) - (citb-base-plat-method-24 (_type_) none 24) + (citb-base-plat-method-21 (_type_) none) + (citb-base-plat-method-22 (_type_) none) + (citb-base-plat-active () _type_ :state) + (citb-base-plat-method-24 (_type_) none) ) ) ;; definition for method 3 of type citb-base-plat -(defmethod inspect citb-base-plat ((this citb-base-plat)) +(defmethod inspect ((this citb-base-plat)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -62,9 +60,8 @@ (defstate citb-base-plat-idle (citb-base-plat) :virtual #t :trans (behavior () - (if (and *target* (>= (-> self idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (and *target* + (>= (-> self idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (go-virtual citb-base-plat-active) ) @@ -78,7 +75,7 @@ :virtual #t :trans (behavior () (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + (vector-vector-distance (-> self root trans) (-> *target* control trans)) ) ) (go-virtual citb-base-plat-idle) @@ -91,7 +88,7 @@ ;; definition for method 21 of type citb-base-plat ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-21 citb-base-plat ((this citb-base-plat)) +(defmethod citb-base-plat-method-21 ((this citb-base-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -110,7 +107,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -118,7 +115,7 @@ ;; definition for method 22 of type citb-base-plat ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-22 citb-base-plat ((this citb-base-plat)) +(defmethod citb-base-plat-method-22 ((this citb-base-plat)) (initialize-skeleton this *plat-citb-sg* '()) 0 (none) @@ -126,14 +123,14 @@ ;; definition for method 24 of type citb-base-plat ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-24 citb-base-plat ((this citb-base-plat)) +(defmethod citb-base-plat-method-24 ((this citb-base-plat)) (go (method-of-object this citb-base-plat-idle)) 0 (none) ) ;; definition for method 11 of type citb-base-plat -(defmethod init-from-entity! citb-base-plat ((this citb-base-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-base-plat) (arg0 entity-actor)) (citb-base-plat-method-21 this) (process-drawable-from-entity! this arg0) (set! (-> this idle-distance) 245760.0) @@ -146,14 +143,10 @@ ;; definition of type citb-plat-eco (deftype citb-plat-eco (plat-eco) () - :heap-base #x100 - :method-count-assert 33 - :size-assert #x165 - :flag-assert #x2101000165 ) ;; definition for method 3 of type citb-plat-eco -(defmethod inspect citb-plat-eco ((this citb-plat-eco)) +(defmethod inspect ((this citb-plat-eco)) (let ((t9-0 (method-of-type plat-eco inspect))) (t9-0 this) ) @@ -162,7 +155,7 @@ ;; definition for method 24 of type citb-plat-eco ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 citb-plat-eco ((this citb-plat-eco)) +(defmethod baseplat-method-24 ((this citb-plat-eco)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -181,7 +174,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -189,34 +182,30 @@ ;; definition for method 26 of type citb-plat-eco ;; INFO: Return type mismatch float vs none. -(defmethod baseplat-method-26 citb-plat-eco ((this citb-plat-eco)) +(defmethod baseplat-method-26 ((this citb-plat-eco)) (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this notice-dist) 8192.0) (none) ) ;; definition for method 23 of type citb-plat-eco -(defmethod get-unlit-skel citb-plat-eco ((this citb-plat-eco)) +(defmethod get-unlit-skel ((this citb-plat-eco)) *plat-eco-citb-unlit-sg* ) ;; definition for method 27 of type citb-plat-eco -(defmethod get-lit-skel citb-plat-eco ((this citb-plat-eco)) +(defmethod get-lit-skel ((this citb-plat-eco)) *plat-eco-citb-lit-sg* ) ;; definition of type citb-plat (deftype citb-plat (plat) - ((trans-offset vector :inline :offset-assert 272) + ((trans-offset vector :inline) ) - :heap-base #xb0 - :method-count-assert 33 - :size-assert #x120 - :flag-assert #x2100b00120 ) ;; definition for method 3 of type citb-plat -(defmethod inspect citb-plat ((this citb-plat)) +(defmethod inspect ((this citb-plat)) (let ((t9-0 (method-of-type plat inspect))) (t9-0 this) ) @@ -235,21 +224,21 @@ ) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (vector+! (-> self basetrans) (-> self basetrans) (-> self trans-offset)) - (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) + (if (< (vector-vector-distance (-> self root trans) (ear-trans)) 81920.0) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root trans))) ) (plat-trans) ) ) ;; definition for method 23 of type citb-plat -(defmethod get-unlit-skel citb-plat ((this citb-plat)) +(defmethod get-unlit-skel ((this citb-plat)) *plat-citb-sg* ) ;; definition for method 24 of type citb-plat ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 citb-plat ((this citb-plat)) +(defmethod baseplat-method-24 ((this citb-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -268,7 +257,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -277,13 +266,11 @@ ;; definition for method 26 of type citb-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-26 citb-plat ((this citb-plat)) +(defmethod baseplat-method-26 ((this citb-plat)) (logclear! (-> this mask) (process-mask actor-pause)) - (set! (-> this root-override scale quad) (-> (res-lump-struct (-> this entity) 'scale vector) quad)) - (let ((f0-0 (-> this root-override scale x))) - (set! (-> this root-override root-prim local-sphere w) - (* (-> this root-override root-prim local-sphere w) f0-0) - ) + (set! (-> this root scale quad) (-> (res-lump-struct (-> this entity) 'scale vector) quad)) + (let ((f0-0 (-> this root scale x))) + (set! (-> this root root-prim local-sphere w) (* (-> this root root-prim local-sphere w) f0-0)) (set! (-> this draw bounds w) (* (-> this draw bounds w) f0-0)) ) (set! (-> this trans-offset quad) (-> (the-as vector ((method-of-type res-lump get-property-struct) @@ -305,19 +292,15 @@ ;; definition of type citb-stair-plat (deftype citb-stair-plat (citb-base-plat) - ((idle-height float :offset-assert 180) - (rise-height float :offset-assert 184) - (delay time-frame :offset-assert 192) - (rise symbol :offset-assert 200) + ((idle-height float) + (rise-height float) + (delay time-frame) + (rise symbol) ) - :heap-base #x60 - :method-count-assert 25 - :size-assert #xcc - :flag-assert #x19006000cc ) ;; definition for method 3 of type citb-stair-plat -(defmethod inspect citb-stair-plat ((this citb-stair-plat)) +(defmethod inspect ((this citb-stair-plat)) (let ((t9-0 (method-of-type citb-base-plat inspect))) (t9-0 this) ) @@ -359,12 +342,12 @@ (loop (let ((f30-0 (- 1.0 (* 0.0011111111 (the float (- (current-time) (-> self state-time))))))) (when (< f30-0 0.0) - (set! (-> self root-override trans y) (-> self rise-height)) + (set! (-> self root trans y) (-> self rise-height)) (go-virtual citb-base-plat-active) ) - (set! (-> self root-override trans y) (lerp (-> self rise-height) (-> self idle-height) (* f30-0 f30-0))) + (set! (-> self root trans y) (lerp (-> self rise-height) (-> self idle-height) (* f30-0 f30-0))) ) - (let ((f0-12 (fmax 0.0 (fmin 1.0 (* 0.000012207031 (+ 409600.0 (-> self root-override trans y))))))) + (let ((f0-12 (fmax 0.0 (fmin 1.0 (* 0.000012207031 (+ 409600.0 (-> self root trans y))))))) (set! (-> self draw color-mult x) f0-12) (set! (-> self draw color-mult y) f0-12) (set! (-> self draw color-mult z) f0-12) @@ -381,9 +364,9 @@ :virtual #t :trans #f :code (behavior () - (set! (-> self root-override trans y) (-> self rise-height)) + (set! (-> self root trans y) (-> self rise-height)) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (logior! (-> self mask) (process-mask actor-pause)) (anim-loop) ) @@ -392,20 +375,18 @@ ;; definition for method 22 of type citb-stair-plat ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-22 citb-stair-plat ((this citb-stair-plat)) +(defmethod citb-base-plat-method-22 ((this citb-stair-plat)) (initialize-skeleton this *plat-citb-sg* '()) - (set! (-> this rise-height) (-> this root-override trans y)) + (set! (-> this rise-height) (-> this root trans y)) (set! (-> this idle-height) (+ -409600.0 (-> this rise-height))) - (set! (-> this root-override trans y) (-> this idle-height)) + (set! (-> this root trans y) (-> this idle-height)) (set! (-> this rise) #f) (set! (-> this delay) (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'delay :default 1.0)))) ) (let ((f0-7 1.5)) - (set-vector! (-> this root-override scale) f0-7 f0-7 f0-7 1.0) - (set! (-> this root-override root-prim local-sphere w) - (* (-> this root-override root-prim local-sphere w) f0-7) - ) + (set-vector! (-> this root scale) f0-7 f0-7 f0-7 1.0) + (set! (-> this root root-prim local-sphere w) (* (-> this root root-prim local-sphere w) f0-7)) (set! (-> this draw bounds w) (* (-> this draw bounds w) f0-7)) ) 0 @@ -414,7 +395,7 @@ ;; definition for method 24 of type citb-stair-plat ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-24 citb-stair-plat ((this citb-stair-plat)) +(defmethod citb-base-plat-method-24 ((this citb-stair-plat)) (if (and (task-complete? *game-info* (game-task citadel-sage-blue)) (task-complete? *game-info* (game-task citadel-sage-red)) (task-complete? *game-info* (game-task citadel-sage-yellow)) @@ -455,23 +436,19 @@ ;; definition of type citb-chain-plat (deftype citb-chain-plat (rigid-body-platform) - ((orig-trans vector :inline :offset-assert 736) - (orig-quat quaternion :inline :offset-assert 752) - (beam-end vector :inline :offset-assert 768) - (float-offset float :offset-assert 784) - (idle-offset float :offset-assert 788) + ((orig-trans vector :inline) + (orig-quat quaternion :inline) + (beam-end vector :inline) + (float-offset float) + (idle-offset float) ) - :heap-base #x2b0 - :method-count-assert 35 - :size-assert #x318 - :flag-assert #x2302b00318 (:states citb-chain-plat-settle ) ) ;; definition for method 3 of type citb-chain-plat -(defmethod inspect citb-chain-plat ((this citb-chain-plat)) +(defmethod inspect ((this citb-chain-plat)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) (t9-0 this) ) @@ -484,7 +461,7 @@ ) ;; definition for method 22 of type citb-chain-plat -(defmethod rigid-body-platform-method-22 citb-chain-plat ((this citb-chain-plat) (arg0 vector) (arg1 float)) +(defmethod rigid-body-platform-method-22 ((this citb-chain-plat) (arg0 vector) (arg1 float)) (+ 12288.0 (* 2048.0 (fmax 0.0 (fmin 1.0 (* 0.000024414063 (-> this float-height-offset)))) @@ -497,7 +474,7 @@ ;; definition for method 27 of type citb-chain-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-27 citb-chain-plat ((this citb-chain-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-27 ((this citb-chain-plat) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 arg0 (-> this rbody position)) (set! (-> gp-0 y) 0.0) @@ -516,7 +493,7 @@ ;; definition for method 23 of type citb-chain-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 citb-chain-plat ((this citb-chain-plat) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this citb-chain-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this orig-trans)) 0 @@ -623,7 +600,7 @@ ;; definition for method 30 of type citb-chain-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 citb-chain-plat ((this citb-chain-plat)) +(defmethod rigid-body-platform-method-30 ((this citb-chain-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -651,7 +628,7 @@ ;; definition for method 31 of type citb-chain-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 citb-chain-plat ((this citb-chain-plat)) +(defmethod rigid-body-platform-method-31 ((this citb-chain-plat)) (initialize-skeleton this *citb-chain-plat-sg* '()) (set! (-> this orig-trans quad) (-> this root-overlay trans quad)) (quaternion-copy! (-> this orig-quat) (-> this root-overlay quat)) @@ -689,14 +666,10 @@ ;; definition of type citb-rotatebox (deftype citb-rotatebox (citb-base-plat) () - :heap-base #x50 - :method-count-assert 25 - :size-assert #xb4 - :flag-assert #x19005000b4 ) ;; definition for method 3 of type citb-rotatebox -(defmethod inspect citb-rotatebox ((this citb-rotatebox)) +(defmethod inspect ((this citb-rotatebox)) (let ((t9-0 (method-of-type citb-base-plat inspect))) (t9-0 this) ) @@ -715,7 +688,7 @@ (ja :num! (seek!)) ) (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + (vector-vector-distance (-> self root trans) (-> *target* control trans)) ) ) (go-virtual citb-base-plat-idle) @@ -726,7 +699,7 @@ ;; definition for method 21 of type citb-rotatebox ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-21 citb-rotatebox ((this citb-rotatebox)) +(defmethod citb-base-plat-method-21 ((this citb-rotatebox)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -745,7 +718,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -753,7 +726,7 @@ ;; definition for method 22 of type citb-rotatebox ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-22 citb-rotatebox ((this citb-rotatebox)) +(defmethod citb-base-plat-method-22 ((this citb-rotatebox)) (initialize-skeleton this *citb-rotatebox-sg* '()) 0 (none) @@ -767,16 +740,12 @@ ;; definition of type citb-donut (deftype citb-donut (citb-base-plat) - ((sync sync-info :inline :offset-assert 180) + ((sync sync-info :inline) ) - :heap-base #x50 - :method-count-assert 25 - :size-assert #xbc - :flag-assert #x19005000bc ) ;; definition for method 3 of type citb-donut -(defmethod inspect citb-donut ((this citb-donut)) +(defmethod inspect ((this citb-donut)) (let ((t9-0 (method-of-type citb-base-plat inspect))) (t9-0 this) ) @@ -789,20 +758,14 @@ :virtual #t :post (behavior () (update! (-> self sound)) - (quaternion-axis-angle! - (-> self root-override quat) - 0.0 - 1.0 - 0.0 - (* 65536.0 (get-current-phase (-> self sync))) - ) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (* 65536.0 (get-current-phase (-> self sync)))) (rider-post) ) ) ;; definition for method 21 of type citb-donut ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-21 citb-donut ((this citb-donut)) +(defmethod citb-base-plat-method-21 ((this citb-donut)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -821,7 +784,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -829,11 +792,11 @@ ;; definition for method 22 of type citb-donut ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-22 citb-donut ((this citb-donut)) +(defmethod citb-base-plat-method-22 ((this citb-donut)) (initialize-skeleton this *citb-donut-sg* '()) (setup-params! (-> this sync) (the-as uint 9000) 0.0 0.15 0.15) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> this root trans)) ) (logclear! (-> this mask) (process-mask actor-pause)) 0 @@ -849,14 +812,10 @@ ;; definition of type citb-stopbox (deftype citb-stopbox (plat) () - :heap-base #xa0 - :method-count-assert 33 - :size-assert #x108 - :flag-assert #x2100a00108 ) ;; definition for method 3 of type citb-stopbox -(defmethod inspect citb-stopbox ((this citb-stopbox)) +(defmethod inspect ((this citb-stopbox)) (let ((t9-0 (method-of-type plat inspect))) (t9-0 this) ) @@ -869,21 +828,21 @@ :trans (behavior () (set! (-> self path-pos) (get-current-phase (-> self sync))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) + (if (< (vector-vector-distance (-> self root trans) (ear-trans)) 81920.0) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root trans))) ) (plat-trans) ) ) ;; definition for method 23 of type citb-stopbox -(defmethod get-unlit-skel citb-stopbox ((this citb-stopbox)) +(defmethod get-unlit-skel ((this citb-stopbox)) *citb-stopbox-sg* ) ;; definition for method 24 of type citb-stopbox ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 citb-stopbox ((this citb-stopbox)) +(defmethod baseplat-method-24 ((this citb-stopbox)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -902,7 +861,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -910,7 +869,7 @@ ;; definition for method 26 of type citb-stopbox ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-26 citb-stopbox ((this citb-stopbox)) +(defmethod baseplat-method-26 ((this citb-stopbox)) (logior! (-> this fact options) (fact-options wrap-phase)) (logclear! (-> this mask) (process-mask actor-pause)) 0 @@ -919,16 +878,12 @@ ;; definition of type citb-firehose (deftype citb-firehose (process-drawable) - ((root-override collide-shape :offset 112) - (idle-distance float :offset-assert 176) - (sync sync-info :inline :offset-assert 180) - (last-sync float :offset-assert 188) - (blast-pos vector :inline :offset-assert 192) + ((root collide-shape :override) + (idle-distance float) + (sync sync-info :inline) + (last-sync float) + (blast-pos vector :inline) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14006000d0 (:states citb-firehose-active citb-firehose-blast @@ -937,7 +892,7 @@ ) ;; definition for method 3 of type citb-firehose -(defmethod inspect citb-firehose ((this citb-firehose)) +(defmethod inspect ((this citb-firehose)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -957,9 +912,8 @@ ;; failed to figure out what this is: (defstate citb-firehose-idle (citb-firehose) :trans (behavior () - (if (and *target* (>= (-> self idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (and *target* + (>= (-> self idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (go citb-firehose-active) ) @@ -976,7 +930,7 @@ (defstate citb-firehose-active (citb-firehose) :trans (behavior () (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + (vector-vector-distance (-> self root trans) (-> *target* control trans)) ) ) (go citb-firehose-idle) @@ -1033,7 +987,7 @@ (ja :num! (seek!)) ) (ja-channel-push! 1 (seconds 0.1)) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (sound-play "eco-torch" :position (the-as symbol (-> self blast-pos))) (dotimes (gp-1 2) (ja-no-eval :group! citb-firehose-loopflame-ja :num! (seek!) :frame-num 0.0) @@ -1044,7 +998,7 @@ (ja :num! (seek!)) ) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! citb-firehose-end-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -1058,7 +1012,7 @@ ;; definition for method 11 of type citb-firehose ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-firehose ((this citb-firehose) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citb-firehose) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -1090,14 +1044,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *citb-firehose-sg* '()) (load-params! (-> this sync) this (the-as uint 900) 0.0 0.15 0.15) (set! (-> this idle-distance) 286720.0) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 685) this)) - (clear-collide-with-as (-> this root-override)) + (clear-collide-with-as (-> this root)) (go citb-firehose-idle) (none) ) @@ -1110,14 +1064,10 @@ ;; definition of type citb-exit-plat (deftype citb-exit-plat (plat-button) - ((idle-height float :offset-assert 240) - (rise-height float :offset-assert 244) - (activated symbol :offset-assert 248) + ((idle-height float) + (rise-height float) + (activated symbol) ) - :heap-base #x90 - :method-count-assert 33 - :size-assert #xfc - :flag-assert #x21009000fc (:states citb-exit-plat-idle citb-exit-plat-rise @@ -1125,7 +1075,7 @@ ) ;; definition for method 3 of type citb-exit-plat -(defmethod inspect citb-exit-plat ((this citb-exit-plat)) +(defmethod inspect ((this citb-exit-plat)) (let ((t9-0 (method-of-type plat-button inspect))) (t9-0 this) ) @@ -1150,7 +1100,7 @@ ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (loop (suspend) ) @@ -1162,15 +1112,15 @@ :trans rider-trans :code (behavior () (logclear! (-> self draw status) (draw-status hidden)) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (set-time! (-> self state-time)) (loop (let ((f30-0 (- 1.0 (* 0.0016666667 (the float (- (current-time) (-> self state-time))))))) (when (< f30-0 0.0) - (set! (-> self root-override trans y) (-> self rise-height)) + (set! (-> self root trans y) (-> self rise-height)) (go-virtual plat-button-idle) ) - (set! (-> self root-override trans y) (lerp (-> self rise-height) (-> self idle-height) (* f30-0 f30-0))) + (set! (-> self root trans y) (lerp (-> self rise-height) (-> self idle-height) (* f30-0 f30-0))) ) (suspend) ) @@ -1183,8 +1133,8 @@ (defbehavior citb-exit-plat-move-player citb-exit-plat ((arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! gp-0 (-> self root-override trans) arg0) - (vector-! s5-0 (-> *target* control trans) (-> self root-override trans)) + (vector-! gp-0 (-> self root trans) arg0) + (vector-! s5-0 (-> *target* control trans) (-> self root trans)) (set! (-> s5-0 y) 0.0) (let ((f30-0 (vector-length s5-0))) (when (< 122880.0 f30-0) @@ -1205,7 +1155,7 @@ :virtual #t :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (let ((t9-1 (-> (the-as (state plat-button) (find-parent-state)) trans))) (if t9-1 (t9-1) @@ -1222,7 +1172,7 @@ :virtual #t :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (let ((t9-1 (-> (the-as (state plat-button) (find-parent-state)) trans))) (if t9-1 (t9-1) @@ -1235,19 +1185,19 @@ ) ;; definition for method 26 of type citb-exit-plat -(defmethod can-activate? citb-exit-plat ((this citb-exit-plat)) +(defmethod can-activate? ((this citb-exit-plat)) (not (movie?)) ) ;; definition for method 31 of type citb-exit-plat -(defmethod plat-button-method-31 citb-exit-plat ((this citb-exit-plat)) +(defmethod plat-button-method-31 ((this citb-exit-plat)) (initialize-skeleton this *citb-exit-plat-sg* '()) (none) ) ;; definition for method 32 of type citb-exit-plat ;; INFO: Return type mismatch int vs none. -(defmethod plat-button-method-32 citb-exit-plat ((this citb-exit-plat)) +(defmethod plat-button-method-32 ((this citb-exit-plat)) (if (-> this activated) (go (method-of-object this plat-button-idle)) (go citb-exit-plat-idle) @@ -1257,7 +1207,7 @@ ) ;; definition for method 28 of type citb-exit-plat -(defmethod plat-button-method-28 citb-exit-plat ((this citb-exit-plat)) +(defmethod plat-button-method-28 ((this citb-exit-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1293,14 +1243,14 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) ;; definition for method 29 of type citb-exit-plat ;; INFO: Return type mismatch int vs none. -(defmethod can-target-move? citb-exit-plat ((this citb-exit-plat)) +(defmethod can-target-move? ((this citb-exit-plat)) (process-entity-status! this (entity-perm-status bit-7) #t) (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this draw light-index) (the-as uint 255)) @@ -1320,15 +1270,15 @@ (set! (-> this path-pos) 1.0) ) ) - (let ((s5-0 (-> this root-override trans))) + (let ((s5-0 (-> this root trans))) (eval-path-curve! (-> this path) s5-0 (-> this path-pos) 'interp) (vector+! s5-0 s5-0 (-> this trans-off)) ) - (set! (-> this rise-height) (-> this root-override trans y)) + (set! (-> this rise-height) (-> this root trans y)) (set! (-> this idle-height) (+ -286720.0 (-> this rise-height))) (if (-> this activated) - (set! (-> this root-override trans y) (-> this rise-height)) - (set! (-> this root-override trans y) (-> this idle-height)) + (set! (-> this root trans y) (-> this rise-height)) + (set! (-> this root trans y) (-> this idle-height)) ) (set! (-> this allow-auto-kill) #f) (process-entity-status! this (entity-perm-status bit-3) #t) diff --git a/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc b/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc index 777f91387df..f526691223e 100644 --- a/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc @@ -3,20 +3,17 @@ ;; definition of type battlecontroller-spawner (deftype battlecontroller-spawner (structure) - ((path path-control :offset-assert 0) - (creature handle :offset-assert 8) - (trigger-actor entity-actor :offset-assert 16) - (blocker-actor entity-actor :offset-assert 20) - (state int8 :offset-assert 24) - (enabled symbol :offset-assert 28) + ((path path-control) + (creature handle) + (trigger-actor entity-actor) + (blocker-actor entity-actor) + (state int8) + (enabled symbol) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type battlecontroller-spawner -(defmethod inspect battlecontroller-spawner ((this battlecontroller-spawner)) +(defmethod inspect ((this battlecontroller-spawner)) (format #t "[~8x] ~A~%" this 'battlecontroller-spawner) (format #t "~Tpath: ~A~%" (-> this path)) (format #t "~Tcreature: ~D~%" (-> this creature)) @@ -29,21 +26,18 @@ ;; definition of type battlecontroller-creature-type (deftype battlecontroller-creature-type (structure) - ((type2 type :offset-assert 0) - (percent float :offset-assert 4) - (pickup-percent float :offset-assert 8) - (pickup-type pickup-type :offset-assert 12) - (max-pickup-count int8 :offset-assert 16) - (pickup-count int8 :offset-assert 17) + ((type2 type) + (percent float) + (pickup-percent float) + (pickup-type pickup-type) + (max-pickup-count int8) + (pickup-count int8) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x12 - :flag-assert #x900000012 ) ;; definition for method 3 of type battlecontroller-creature-type -(defmethod inspect battlecontroller-creature-type ((this battlecontroller-creature-type)) +(defmethod inspect ((this battlecontroller-creature-type)) (format #t "[~8x] ~A~%" this 'battlecontroller-creature-type) (format #t "~Ttype2: ~A~%" (-> this type2)) (format #t "~Tpercent: ~f~%" (-> this percent)) @@ -56,46 +50,42 @@ ;; definition of type battlecontroller (deftype battlecontroller (process-drawable) - ((final-pickup-spawn-point vector :inline :offset-assert 176) - (activate-distance float :offset-assert 192) - (max-spawn-count int16 :offset-assert 196) - (spawn-count int16 :offset-assert 198) - (die-count int16 :offset-assert 200) - (target-count int8 :offset-assert 202) - (spawner-count int8 :offset-assert 203) - (creature-type-count int8 :offset-assert 204) - (spawner-array battlecontroller-spawner 8 :inline :offset-assert 208) - (spawn-period time-frame :offset-assert 464) - (path-spawn path-control :offset-assert 472) - (creature-type-array battlecontroller-creature-type 4 :inline :offset-assert 476) - (final-pickup-type pickup-type :offset-assert 604) - (prespawn symbol :offset-assert 608) - (noticed-player symbol :offset-assert 612) - (camera-on symbol :offset-assert 616) - (misty-ambush-collision-hack symbol :offset-assert 620) - (disable-ocean symbol :offset-assert 624) - (disable-near-ocean symbol :offset-assert 628) - (disable-mid-ocean symbol :offset-assert 632) + ((final-pickup-spawn-point vector :inline) + (activate-distance float) + (max-spawn-count int16) + (spawn-count int16) + (die-count int16) + (target-count int8) + (spawner-count int8) + (creature-type-count int8) + (spawner-array battlecontroller-spawner 8 :inline) + (spawn-period time-frame) + (path-spawn path-control) + (creature-type-array battlecontroller-creature-type 4 :inline) + (final-pickup-type pickup-type) + (prespawn symbol) + (noticed-player symbol) + (camera-on symbol) + (misty-ambush-collision-hack symbol) + (disable-ocean symbol) + (disable-near-ocean symbol) + (disable-mid-ocean symbol) ) - :heap-base #x210 - :method-count-assert 29 - :size-assert #x27c - :flag-assert #x1d0210027c (:methods - (battlecontroller-method-20 () none 20) - (battlecontroller-idle () _type_ :state 21) - (battlecontroller-play-intro-camera () _type_ :state 22) - (battlecontroller-method-23 () none 23) - (battlecontroller-active () _type_ :state 24) - (battlecontroller-method-25 () none 25) - (battlecontroller-die () _type_ :state 26) - (battlecontroller-method-27 (_type_) none 27) - (cleanup-if-finished! (_type_) none 28) + (battlecontroller-method-20 () none) + (battlecontroller-idle () _type_ :state) + (battlecontroller-play-intro-camera () _type_ :state) + (battlecontroller-method-23 () none) + (battlecontroller-active () _type_ :state) + (battlecontroller-method-25 () none) + (battlecontroller-die () _type_ :state) + (battlecontroller-method-27 (_type_) none) + (cleanup-if-finished! (_type_) none) ) ) ;; definition for method 3 of type battlecontroller -(defmethod inspect battlecontroller ((this battlecontroller)) +(defmethod inspect ((this battlecontroller)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -664,7 +654,7 @@ battlecontroller-default-event-handler ) ;; definition for method 7 of type battlecontroller -(defmethod relocate battlecontroller ((this battlecontroller) (arg0 int)) +(defmethod relocate ((this battlecontroller) (arg0 int)) (dotimes (v1-0 (-> this spawner-count)) (let ((a0-3 (-> this spawner-array v1-0))) (if (nonzero? (-> a0-3 path)) @@ -680,7 +670,7 @@ battlecontroller-default-event-handler ;; definition for method 10 of type battlecontroller ;; INFO: Return type mismatch int vs none. -(defmethod deactivate battlecontroller ((this battlecontroller)) +(defmethod deactivate ((this battlecontroller)) (with-pp (let ((gp-0 pp)) (set! pp this) @@ -696,7 +686,7 @@ battlecontroller-default-event-handler ;; definition for method 27 of type battlecontroller ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod battlecontroller-method-27 battlecontroller ((this battlecontroller)) +(defmethod battlecontroller-method-27 ((this battlecontroller)) (local-vars (sv-16 res-tag)) (set! (-> this fact) (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) @@ -841,7 +831,7 @@ battlecontroller-default-event-handler ;; definition for method 28 of type battlecontroller ;; INFO: Return type mismatch int vs none. -(defmethod cleanup-if-finished! battlecontroller ((this battlecontroller)) +(defmethod cleanup-if-finished! ((this battlecontroller)) (if (battlecontroller-task-completed?) (go (method-of-object this battlecontroller-die)) (go (method-of-object this battlecontroller-idle)) @@ -851,7 +841,7 @@ battlecontroller-default-event-handler ) ;; definition for method 11 of type battlecontroller -(defmethod init-from-entity! battlecontroller ((this battlecontroller) (arg0 entity-actor)) +(defmethod init-from-entity! ((this battlecontroller) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) diff --git a/test/decompiler/reference/jak1/levels/common/blocking-plane_REF.gc b/test/decompiler/reference/jak1/levels/common/blocking-plane_REF.gc index 56ccc7dd6e4..6eccea76a3b 100644 --- a/test/decompiler/reference/jak1/levels/common/blocking-plane_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/blocking-plane_REF.gc @@ -4,17 +4,13 @@ ;; definition of type blocking-plane (deftype blocking-plane (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states blocking-plane-idle ) ) ;; definition for method 3 of type blocking-plane -(defmethod inspect blocking-plane ((this blocking-plane)) +(defmethod inspect ((this blocking-plane)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/common/launcherdoor_REF.gc b/test/decompiler/reference/jak1/levels/common/launcherdoor_REF.gc index 2d71314bf8f..bee4776dfc7 100644 --- a/test/decompiler/reference/jak1/levels/common/launcherdoor_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/launcherdoor_REF.gc @@ -3,17 +3,13 @@ ;; definition of type launcherdoor (deftype launcherdoor (process-drawable) - ((root-override collide-shape :offset 112) - (notify-player-passed-thru? symbol :offset-assert 176) - (thresh-y float :offset-assert 180) - (open-speed float :offset-assert 184) - (close-speed float :offset-assert 188) - (load-mode symbol :offset-assert 192) + ((root collide-shape :override) + (notify-player-passed-thru? symbol) + (thresh-y float) + (open-speed float) + (close-speed float) + (load-mode symbol) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xc4 - :flag-assert #x14006000c4 (:states (launcherdoor-closed symbol) (launcherdoor-open symbol) @@ -21,7 +17,7 @@ ) ;; definition for method 3 of type launcherdoor -(defmethod inspect launcherdoor ((this launcherdoor)) +(defmethod inspect ((this launcherdoor)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -58,7 +54,7 @@ ) ) ) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (ja-no-eval :num! (seek! 0.0)) (when arg0 (ja :num-func num-func-identity :frame-num 0.0) @@ -114,7 +110,7 @@ (sound-play "ldoor-open") ) (set! (-> self draw force-lod) 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :num! (seek!)) (if arg0 (ja :num-func num-func-identity :frame-num max) @@ -122,7 +118,7 @@ (loop (when (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump) - (< (+ 4096.0 (-> self root-override trans y)) (-> *target* control trans y)) + (< (+ 4096.0 (-> self root trans y)) (-> *target* control trans y)) ) (when (and *target* (< (-> self thresh-y) (-> *target* control trans y))) (let ((a1-3 (res-lump-struct (-> self entity) 'continue-name structure))) @@ -145,7 +141,7 @@ ;; definition for method 11 of type launcherdoor ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! launcherdoor ((this launcherdoor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this launcherdoor) (arg0 entity-actor)) (set! (-> this notify-player-passed-thru?) #f) (set! (-> this open-speed) 4.0) (set! (-> this close-speed) 2.0) @@ -161,7 +157,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (cond @@ -211,7 +207,7 @@ name ) ) - (set! (-> this thresh-y) (+ -81920.0 (-> this root-override trans y))) + (set! (-> this thresh-y) (+ -81920.0 (-> this root trans y))) (if (and *target* (= (-> *target* control unknown-surface00 name) 'launch-jump)) (go launcherdoor-open #t) (go launcherdoor-closed #t) diff --git a/test/decompiler/reference/jak1/levels/darkcave/darkcave-obs_REF.gc b/test/decompiler/reference/jak1/levels/darkcave/darkcave-obs_REF.gc index 4b91bf85849..f2b8bf98d6e 100644 --- a/test/decompiler/reference/jak1/levels/darkcave/darkcave-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/darkcave/darkcave-obs_REF.gc @@ -3,30 +3,26 @@ ;; definition of type cavecrystal (deftype cavecrystal (process-drawable) - ((root-override collide-shape :offset 112) - (is-master? symbol :offset-assert 176) - (crystal-id int32 :offset-assert 180) - (glow-u float :offset-assert 184) - (glow-wf-period int32 :offset-assert 188) - (glow-wf-offset int32 :offset-assert 192) - (prev-compute-glow-time time-frame :offset-assert 200) - (start-fade-time time-frame :offset-assert 208) - (end-fade-time time-frame :offset-assert 216) - (activated-time time-frame :offset-assert 224) - (last-updated-user-lighting time-frame :offset-assert 232) - (player-attack-id uint64 :offset-assert 240) - (on-color-mult vector :inline :offset-assert 256) - (on-color-emissive vector :inline :offset-assert 272) - (off-color-mult vector :inline :offset-assert 288) - (off-color-emissive vector :inline :offset-assert 304) + ((root collide-shape :override) + (is-master? symbol) + (crystal-id int32) + (glow-u float) + (glow-wf-period int32) + (glow-wf-offset int32) + (prev-compute-glow-time time-frame) + (start-fade-time time-frame) + (end-fade-time time-frame) + (activated-time time-frame) + (last-updated-user-lighting time-frame) + (player-attack-id uint64) + (on-color-mult vector :inline) + (on-color-emissive vector :inline) + (off-color-mult vector :inline) + (off-color-emissive vector :inline) ) - :heap-base #xd0 - :method-count-assert 22 - :size-assert #x140 - :flag-assert #x1600d00140 (:methods - (update-connected-crystals! (_type_) none 20) - (compute-glow (_type_) float 21) + (update-connected-crystals! (_type_) none) + (compute-glow (_type_) float) ) (:states cavecrystal-active @@ -35,7 +31,7 @@ ) ;; definition for method 3 of type cavecrystal -(defmethod inspect cavecrystal ((this cavecrystal)) +(defmethod inspect ((this cavecrystal)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -65,7 +61,7 @@ ;; definition for method 20 of type cavecrystal ;; INFO: Return type mismatch int vs none. -(defmethod update-connected-crystals! cavecrystal ((this cavecrystal)) +(defmethod update-connected-crystals! ((this cavecrystal)) (when (-> this is-master?) (let ((v1-2 (current-time))) (when (!= (-> this last-updated-user-lighting) v1-2) @@ -78,7 +74,7 @@ ) ;; definition for method 21 of type cavecrystal -(defmethod compute-glow cavecrystal ((this cavecrystal)) +(defmethod compute-glow ((this cavecrystal)) (set! (-> this prev-compute-glow-time) (-> *display* game-frame-counter)) (let* ((gp-1 (max 1 (+ (- 1 (-> this activated-time)) (-> *display* game-frame-counter)))) (f0-2 (/ (the float (mod (+ (current-time) (-> this glow-wf-offset)) (-> this glow-wf-period))) @@ -120,7 +116,7 @@ ) ) :trans (behavior () - (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id darkcave-light-hint) "sksp0333" (the-as entity #f) *entity-pool* (game-task none)) ) (update-connected-crystals! self) @@ -203,7 +199,7 @@ ) ;; definition for method 10 of type cavecrystal -(defmethod deactivate cavecrystal ((this cavecrystal)) +(defmethod deactivate ((this cavecrystal)) (if (nonzero? (-> this sound)) (stop! (-> this sound)) ) @@ -214,7 +210,7 @@ ;; definition for method 11 of type cavecrystal ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cavecrystal ((this cavecrystal) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cavecrystal) (arg0 entity-actor)) (set! (-> this glow-u) 0.0) (set! (-> this player-attack-id) (the-as uint 0)) (set! (-> this last-updated-user-lighting) 0) @@ -234,7 +230,7 @@ ) (set! (-> s4-0 nav-radius) 4915.2) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (set! (-> this link) (new 'process 'actor-link-info this)) (set! (-> this crystal-id) (actor-count-before (-> this link))) @@ -249,7 +245,7 @@ ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *cavecrystal-sg* '()) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (set! (-> this draw color-mult quad) (-> this off-color-mult quad)) (set! (-> this draw color-emissive quad) (-> this off-color-emissive quad)) (ja-channel-push! 1 0) @@ -262,10 +258,10 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (cavecrystal-light-control-method-9 *cavecrystal-light-control* (-> this crystal-id) 0.0 this) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "crystal-on" :fo-max 80) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "crystal-on" :fo-max 80) (-> this root trans)) ) (go cavecrystal-idle) (none) diff --git a/test/decompiler/reference/jak1/levels/demo/static-screen_REF.gc b/test/decompiler/reference/jak1/levels/demo/static-screen_REF.gc index debbe097fd5..d58c696dea2 100644 --- a/test/decompiler/reference/jak1/levels/demo/static-screen_REF.gc +++ b/test/decompiler/reference/jak1/levels/demo/static-screen_REF.gc @@ -3,20 +3,16 @@ ;; definition of type static-screen (deftype static-screen (process) - ((part sparticle-launch-control 1 :offset-assert 112) - (state-time time-frame :offset-assert 120) + ((part sparticle-launch-control 1) + (state-time time-frame) ) - :heap-base #x10 - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00100080 - (:methods - (idle (int time-frame symbol) _type_ :state 14) + (:state-methods + (idle int time-frame symbol) ) ) ;; definition for method 3 of type static-screen -(defmethod inspect static-screen ((this static-screen)) +(defmethod inspect ((this static-screen)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -27,7 +23,7 @@ ;; definition for method 7 of type static-screen ;; INFO: Return type mismatch process vs static-screen. -(defmethod relocate static-screen ((this static-screen) (arg0 int)) +(defmethod relocate ((this static-screen) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -45,7 +41,7 @@ ) ;; definition for method 10 of type static-screen -(defmethod deactivate static-screen ((this static-screen)) +(defmethod deactivate ((this static-screen)) (dotimes (s5-0 1) (if (nonzero? (-> this part s5-0)) (kill-and-free-particles (-> this part s5-0)) diff --git a/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc index 5667516e6b6..932b472bc4b 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc @@ -4,13 +4,10 @@ ;; definition of type fin-door (deftype fin-door (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) ;; definition for method 3 of type fin-door -(defmethod inspect fin-door ((this fin-door)) +(defmethod inspect ((this fin-door)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -44,19 +41,17 @@ ;; definition of type final-door (deftype final-door (process-drawable) () - :heap-base #x40 - :method-count-assert 23 - :size-assert #xb0 - :flag-assert #x17004000b0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (final-door-method-21 (_type_) none 21) - (open (symbol) _type_ :state 22) + (final-door-method-21 (_type_) none) + (open (symbol) _type_ :state) ) ) ;; definition for method 3 of type final-door -(defmethod inspect final-door ((this final-door)) +(defmethod inspect ((this final-door)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -148,7 +143,7 @@ ;; definition for method 11 of type final-door ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! final-door ((this final-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this final-door) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -177,14 +172,10 @@ ;; definition of type power-left (deftype power-left (final-door) () - :heap-base #x40 - :method-count-assert 23 - :size-assert #xb0 - :flag-assert #x17004000b0 ) ;; definition for method 3 of type power-left -(defmethod inspect power-left ((this power-left)) +(defmethod inspect ((this power-left)) (let ((t9-0 (method-of-type final-door inspect))) (t9-0 this) ) @@ -194,14 +185,10 @@ ;; definition of type power-right (deftype power-right (final-door) () - :heap-base #x40 - :method-count-assert 23 - :size-assert #xb0 - :flag-assert #x17004000b0 ) ;; definition for method 3 of type power-right -(defmethod inspect power-right ((this power-right)) +(defmethod inspect ((this power-right)) (let ((t9-0 (method-of-type final-door inspect))) (t9-0 this) ) @@ -238,7 +225,7 @@ ;; definition for method 21 of type power-left ;; INFO: Return type mismatch int vs none. -(defmethod final-door-method-21 power-left ((this power-left)) +(defmethod final-door-method-21 ((this power-left)) (initialize-skeleton this *power-left-sg* '()) 0 (none) @@ -246,7 +233,7 @@ ;; definition for method 21 of type power-right ;; INFO: Return type mismatch int vs none. -(defmethod final-door-method-21 power-right ((this power-right)) +(defmethod final-door-method-21 ((this power-right)) (initialize-skeleton this *power-right-sg* '()) 0 (none) @@ -254,24 +241,20 @@ ;; definition of type powercellalt (deftype powercellalt (process-drawable) - ((root-override collide-shape-moving :offset 112) - (jump-pos vector :inline :offset-assert 176) - (base vector :inline :offset-assert 192) - (index int32 :offset-assert 208) + ((root collide-shape-moving :override) + (jump-pos vector :inline) + (base vector :inline) + (index int32) ) - :heap-base #x70 - :method-count-assert 23 - :size-assert #xd4 - :flag-assert #x17007000d4 (:methods - (powercellalt-method-20 () none 20) - (jump () _type_ :state 21) - (idle () _type_ :state 22) + (powercellalt-method-20 () none) + (jump () _type_ :state) + (idle () _type_ :state) ) ) ;; definition for method 3 of type powercellalt -(defmethod inspect powercellalt ((this powercellalt)) +(defmethod inspect ((this powercellalt)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -288,22 +271,22 @@ (sound-play "cell-prize") (let ((gp-1 (new 'stack 'trajectory))) (set! (-> self base y) (-> self jump-pos y)) - (setup-from-to-duration! gp-1 (-> self root-override trans) (-> self jump-pos) 300.0 -2.2755556) + (setup-from-to-duration! gp-1 (-> self root trans) (-> self jump-pos) 300.0 -2.2755556) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 1)) (let ((f0-2 (the float (- (current-time) (-> self state-time))))) - (eval-position! gp-1 f0-2 (-> self root-override trans)) + (eval-position! gp-1 f0-2 (-> self root trans)) ) (transform-post) - (spawn (-> self part) (the-as vector (-> self root-override root-prim prim-core))) + (spawn (-> self part) (the-as vector (-> self root root-prim prim-core))) (suspend) (if (nonzero? (-> self skel)) (ja :num! (loop! 0.5)) ) ) ) - (set! (-> self root-override trans quad) (-> self jump-pos quad)) - (set! (-> self base quad) (-> self root-override trans quad)) + (set! (-> self root trans quad) (-> self jump-pos quad)) + (set! (-> self base quad) (-> self root trans quad)) (transform-post) (sound-play "land-pcmetal" :pitch 2) (process-spawn @@ -314,7 +297,7 @@ #f #f #f - (-> self root-override root-prim prim-core) + (-> self root root-prim prim-core) :to *entity-pool* ) (go-virtual idle) @@ -327,7 +310,7 @@ :code (behavior () (loop (vector<-cspace! - (-> self root-override trans) + (-> self root trans) (-> (the-as process-drawable (-> self parent 0)) node-list data (-> self index)) ) (transform-post) @@ -355,16 +338,16 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg1 quad)) + (set! (-> self root trans quad) (-> arg1 quad)) (set! (-> self jump-pos quad) (-> arg2 quad)) - (set-vector! (-> self root-override scale) 0.5 0.5 0.5 1.0) + (set-vector! (-> self root scale) 0.5 0.5 0.5 1.0) (set! (-> self index) arg3) (initialize-skeleton self *powercellalt-sg* '()) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 63) self)) enter-state - (-> self root-override trans) + (-> self root trans) (-> self jump-pos) (go-virtual jump) (none) diff --git a/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc index a42701faeab..0a96f9661dc 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc @@ -3,17 +3,13 @@ ;; definition of type green-eco-lurker (deftype green-eco-lurker (nav-enemy) - ((played-sound? symbol :offset-assert 400) - (sound-delay int32 :offset-assert 404) - (appear-dest vector :inline :offset-assert 416) - (traj trajectory :inline :offset-assert 432) + ((played-sound? symbol) + (sound-delay int32) + (appear-dest vector :inline) + (traj trajectory :inline) ) - :heap-base #x170 - :method-count-assert 76 - :size-assert #x1d8 - :flag-assert #x4c017001d8 (:methods - (green-eco-lurker-method-51 (_type_ vector) symbol :replace 51) + (nav-enemy-method-51 (_type_ vector) symbol :replace) ) (:states green-eco-lurker-appear @@ -24,7 +20,7 @@ ) ;; definition for method 3 of type green-eco-lurker -(defmethod inspect green-eco-lurker ((this green-eco-lurker)) +(defmethod inspect ((this green-eco-lurker)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -37,21 +33,17 @@ ;; definition of type green-eco-lurker-gen (deftype green-eco-lurker-gen (process-drawable) - ((num-to-spawn int32 :offset-assert 176) - (num-spawned int32 :offset-assert 180) - (num-alive int32 :offset-assert 184) + ((num-to-spawn int32) + (num-spawned int32) + (num-alive int32) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states spawn-minions ) ) ;; definition for method 3 of type green-eco-lurker-gen -(defmethod inspect green-eco-lurker-gen ((this green-eco-lurker-gen)) +(defmethod inspect ((this green-eco-lurker-gen)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -323,7 +315,7 @@ ) ;; definition for method 43 of type green-eco-lurker -(defmethod attack-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) (cond ((= (-> arg0 type) target) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) @@ -339,7 +331,7 @@ ) ;; definition for method 73 of type green-eco-lurker -(defmethod nav-enemy-attack-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod nav-enemy-attack-handler ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) (cond ((= (-> arg0 type) target) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) @@ -354,7 +346,7 @@ ) ;; definition for method 44 of type green-eco-lurker -(defmethod touch-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) @@ -369,7 +361,7 @@ ) ;; definition for method 72 of type green-eco-lurker -(defmethod nav-enemy-touch-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod nav-enemy-touch-handler ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) @@ -385,7 +377,7 @@ ;; definition for method 51 of type green-eco-lurker ;; INFO: Used lq/sq -(defmethod green-eco-lurker-method-51 green-eco-lurker ((this green-eco-lurker) (arg0 vector)) +(defmethod nav-enemy-method-51 ((this green-eco-lurker) (arg0 vector)) (when (or (not *target*) (>= (vector-vector-xz-distance arg0 (target-pos 0)) 36864.0)) (let ((v1-3 (new 'stack-no-clear 'vector))) (set! (-> v1-3 quad) (-> arg0 quad)) @@ -399,7 +391,7 @@ ) ;; definition for method 52 of type green-eco-lurker -(defmethod nav-enemy-method-52 green-eco-lurker ((this green-eco-lurker) (arg0 vector)) +(defmethod nav-enemy-method-52 ((this green-eco-lurker) (arg0 vector)) (let ((s4-0 (-> this path curve num-cverts))) (when (> s4-0 0) (let ((s2-0 (nav-enemy-rnd-int-count s4-0)) @@ -407,7 +399,7 @@ ) (while (> s3-0 0) (eval-path-curve-div! (-> this path) arg0 (the float s2-0) 'interp) - (if (green-eco-lurker-method-51 this arg0) + (if (nav-enemy-method-51 this arg0) (return #t) ) (set! s2-0 (mod (+ s2-0 1) s4-0)) @@ -455,7 +447,7 @@ ;; definition for method 53 of type green-eco-lurker ;; INFO: Return type mismatch int vs symbol. -(defmethod nav-enemy-method-53 green-eco-lurker ((this green-eco-lurker)) +(defmethod nav-enemy-method-53 ((this green-eco-lurker)) (the-as symbol (cond ((and (-> this draw shadow) (zero? (-> this draw cur-lod)) @@ -695,7 +687,7 @@ ;; definition for method 47 of type green-eco-lurker ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision green-eco-lurker ((this green-eco-lurker)) +(defmethod initialize-collision ((this green-eco-lurker)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -777,7 +769,7 @@ ;; definition for method 48 of type green-eco-lurker ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 green-eco-lurker ((this green-eco-lurker)) +(defmethod nav-enemy-method-48 ((this green-eco-lurker)) (initialize-skeleton this *green-eco-lurker-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) (logclear! (-> this collide-info nav-flags) (nav-flags navf0)) diff --git a/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc index 06ad391548b..489b9cf2c2c 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc @@ -3,21 +3,17 @@ ;; definition of type light-eco-child (deftype light-eco-child (process-drawable) - ((root-override collide-shape :offset 112) - (angle-bit int32 :offset-assert 176) - (ground-y float :offset-assert 180) - (falling-start-time time-frame :offset-assert 184) - (last-update-time time-frame :offset-assert 192) - (rot vector :inline :offset-assert 208) - (rotv vector :inline :offset-assert 224) - (traj trajectory :inline :offset-assert 240) + ((root collide-shape :override) + (angle-bit int32) + (ground-y float) + (falling-start-time time-frame) + (last-update-time time-frame) + (rot vector :inline) + (rotv vector :inline) + (traj trajectory :inline) ) - :heap-base #xb0 - :method-count-assert 21 - :size-assert #x118 - :flag-assert #x1500b00118 (:methods - (common-trans (_type_) none 20) + (common-trans (_type_) none) ) (:states light-eco-child-appear @@ -29,7 +25,7 @@ ) ;; definition for method 3 of type light-eco-child -(defmethod inspect light-eco-child ((this light-eco-child)) +(defmethod inspect ((this light-eco-child)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -45,20 +41,16 @@ ;; definition of type light-eco-mother (deftype light-eco-mother (process-drawable) - ((player-got-eco? symbol :offset-assert 176) - (angle-mask int64 :offset-assert 184) - (delay-til-spawn int32 :offset-assert 192) - (part2 sparticle-launch-control :offset-assert 196) - (last-update-time time-frame :offset-assert 200) - (last-spawned-time time-frame :offset-assert 208) + ((player-got-eco? symbol) + (angle-mask int64) + (delay-til-spawn int32) + (part2 sparticle-launch-control) + (last-update-time time-frame) + (last-spawned-time time-frame) ) - :heap-base #x70 - :method-count-assert 22 - :size-assert #xd8 - :flag-assert #x16007000d8 (:methods - (spawn-child-eco (_type_) symbol 20) - (common-trans (_type_) none 21) + (spawn-child-eco (_type_) symbol) + (common-trans (_type_) none) ) (:states light-eco-mother-active @@ -68,7 +60,7 @@ ) ;; definition for method 3 of type light-eco-mother -(defmethod inspect light-eco-mother ((this light-eco-mother)) +(defmethod inspect ((this light-eco-mother)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -406,7 +398,7 @@ ;; definition for method 20 of type light-eco-child ;; INFO: Return type mismatch object vs none. -(defmethod common-trans light-eco-child ((this light-eco-child)) +(defmethod common-trans ((this light-eco-child)) (let ((v1-1 (current-time))) (when (!= v1-1 (-> this last-update-time)) (set! (-> this last-update-time) v1-1) @@ -418,9 +410,9 @@ (set! (-> s4-0 w) (+ f30-0 (* (-> this rotv w) (seconds-per-frame)))) (set-vector! s5-0 (cos (-> s4-0 x)) (cos (-> s4-0 y)) (cos (-> s4-0 z)) 1.0) (vector-normalize! s5-0 1.0) - (quaternion-vector-angle! (-> this root-override quat) s5-0 f30-0) + (quaternion-vector-angle! (-> this root quat) s5-0 f30-0) ) - (spawn (-> this part) (-> this root-override trans)) + (spawn (-> this part) (-> this root trans)) ) ) (none) @@ -434,7 +426,7 @@ ) :trans (behavior () (let ((f30-0 (fmin (the float (- (current-time) (-> self falling-start-time))) (-> self traj time)))) - (eval-position! (-> self traj) f30-0 (-> self root-override trans)) + (eval-position! (-> self traj) f30-0 (-> self root trans)) (if (= f30-0 (-> self traj time)) (go light-eco-child-hit-ground) ) @@ -457,32 +449,30 @@ (set-time! (-> self state-time)) ) :trans (behavior () - (let ((f30-0 (+ (-> self root-override transv y) (* -544768.0 (seconds-per-frame))))) - (when (and (< f30-0 0.0) (>= (-> self ground-y) (-> self root-override trans y))) + (let ((f30-0 (+ (-> self root transv y) (* -544768.0 (seconds-per-frame))))) + (when (and (< f30-0 0.0) (>= (-> self ground-y) (-> self root trans y))) (if (>= 4096.0 (fabs f30-0)) (go light-eco-child-idle) ) - (set! (-> self root-override transv y) 0.0) - (vector-normalize! (-> self root-override transv) (* 0.25 (vector-xz-length (-> self root-override transv)))) + (set! (-> self root transv y) 0.0) + (vector-normalize! (-> self root transv) (* 0.25 (vector-xz-length (-> self root transv)))) (set! f30-0 (* 0.35 (- f30-0))) ) - (set! (-> self root-override transv y) f30-0) + (set! (-> self root transv y) f30-0) ) - (vector-v+! (-> self root-override trans) (-> self root-override trans) (-> self root-override transv)) - (let ((f0-8 (vector-vector-xz-distance - (-> self root-override trans) - (-> (the-as light-eco-mother (-> self parent 0)) root trans) - ) - ) + (vector-v+! (-> self root trans) (-> self root trans) (-> self root transv)) + (let ((f0-8 + (vector-vector-xz-distance (-> self root trans) (-> (the-as light-eco-mother (-> self parent 0)) root trans)) + ) ) (when (< 92610.56 f0-8) (let ((gp-1 (new 'stack-no-clear 'vector))) - (vector-! gp-1 (-> self root-override trans) (-> (the-as light-eco-mother (-> self parent 0)) root trans)) + (vector-! gp-1 (-> self root trans) (-> (the-as light-eco-mother (-> self parent 0)) root trans)) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 92610.56) (vector+! gp-1 gp-1 (-> (the-as light-eco-mother (-> self parent 0)) root trans)) - (set! (-> gp-1 y) (-> self root-override trans y)) - (set! (-> self root-override trans quad) (-> gp-1 quad)) + (set! (-> gp-1 y) (-> self root trans y)) + (set! (-> self root trans quad) (-> gp-1 quad)) ) ) ) @@ -522,7 +512,7 @@ (defstate light-eco-child-die (light-eco-child) :code (behavior () (send-event (ppointer->process (-> self parent)) 'untrigger (-> self angle-bit)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (logior! (-> self draw status) (draw-status hidden)) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 0.1)) @@ -571,13 +561,13 @@ ) (set! (-> s4-2 nav-radius) (* 0.75 (-> s4-2 root-prim local-sphere w))) (backup-collide-with-as s4-2) - (set! (-> self root-override) s4-2) + (set! (-> self root) s4-2) ) - (set! (-> self root-override trans quad) (-> arg1 quad)) - (set-vector! (-> self root-override scale) 2.0 2.0 2.0 1.0) - (quaternion-identity! (-> self root-override quat)) - (setup-from-to-height! (-> self traj) (-> self root-override trans) arg2 4096.0 -4.551111) - (let ((s4-3 (-> self root-override transv))) + (set! (-> self root trans quad) (-> arg1 quad)) + (set-vector! (-> self root scale) 2.0 2.0 2.0 1.0) + (quaternion-identity! (-> self root quat)) + (setup-from-to-height! (-> self traj) (-> self root trans) arg2 4096.0 -4.551111) + (let ((s4-3 (-> self root transv))) (vector-! s4-3 arg2 arg1) (set! (-> s4-3 y) 0.0) (vector-normalize! s4-3 163840.0) @@ -596,7 +586,7 @@ ;; definition for method 21 of type light-eco-mother ;; INFO: Return type mismatch int vs none. -(defmethod common-trans light-eco-mother ((this light-eco-mother)) +(defmethod common-trans ((this light-eco-mother)) (let ((v1-1 (current-time))) (when (!= v1-1 (-> this last-update-time)) (set! (-> this last-update-time) v1-1) @@ -633,7 +623,7 @@ ) ;; definition for method 20 of type light-eco-mother -(defmethod spawn-child-eco light-eco-mother ((this light-eco-mother)) +(defmethod spawn-child-eco ((this light-eco-mother)) (countdown (s3-0 4) (let ((gp-0 (rand-vu-int-count 32))) (when (not (logtest? (-> this angle-mask) (ash 1 gp-0))) @@ -746,7 +736,7 @@ ) ;; definition for method 10 of type light-eco-mother -(defmethod deactivate light-eco-mother ((this light-eco-mother)) +(defmethod deactivate ((this light-eco-mother)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -756,7 +746,7 @@ ;; definition for method 7 of type light-eco-mother ;; INFO: Return type mismatch projectile vs light-eco-mother. -(defmethod relocate light-eco-mother ((this light-eco-mother) (arg0 int)) +(defmethod relocate ((this light-eco-mother) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss-h_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss-h_REF.gc index df9b99ac63e..0fa9391cbc0 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss-h_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss-h_REF.gc @@ -3,26 +3,23 @@ ;; definition of type robotboss-dda (deftype robotboss-dda (structure) - ((blue-bomb-time float :offset-assert 0) - (num-blobs int32 :offset-assert 4) - (green-bomb-time float :offset-assert 8) - (red-shots-min int32 :offset-assert 12) - (red-shots-rnd int32 :offset-assert 16) - (red-shot-time-min float :offset-assert 20) - (red-shot-time-rnd float :offset-assert 24) - (red-bomb-time float :offset-assert 28) - (yellow-shot-time-min float :offset-assert 32) - (yellow-shot-time-rnd float :offset-assert 36) - (yellow-gun-hits int32 :offset-assert 40) - (yellow-bomb-time float :offset-assert 44) + ((blue-bomb-time float) + (num-blobs int32) + (green-bomb-time float) + (red-shots-min int32) + (red-shots-rnd int32) + (red-shot-time-min float) + (red-shot-time-rnd float) + (red-bomb-time float) + (yellow-shot-time-min float) + (yellow-shot-time-rnd float) + (yellow-gun-hits int32) + (yellow-bomb-time float) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type robotboss-dda -(defmethod inspect robotboss-dda ((this robotboss-dda)) +(defmethod inspect ((this robotboss-dda)) (format #t "[~8x] ~A~%" this 'robotboss-dda) (format #t "~Tblue-bomb-time: ~f~%" (-> this blue-bomb-time)) (format #t "~Tnum-blobs: ~D~%" (-> this num-blobs)) @@ -41,43 +38,39 @@ ;; definition of type robotboss (deftype robotboss (process-drawable) - ((root-override collide-shape-moving :offset 112) - (alts entity-actor 13 :offset-assert 176) - (desired-loc vector :inline :offset-assert 240) - (old-loc vector :inline :offset-assert 256) - (loc-t float :offset-assert 272) - (loc-t-start time-frame :offset-assert 280) - (loc-t-duration time-frame :offset-assert 288) - (hits-to-go int32 :offset-assert 296) - (took-hit symbol :offset-assert 300) - (children-spawned int32 :offset-assert 304) - (vulnerable int64 :offset-assert 312) - (till-next-shot int64 :offset-assert 320) - (shot-attractor handle :offset-assert 328) - (desired-pool-y float :offset-assert 336) - (particle sparticle-launch-control 7 :offset-assert 340) - (blue-smoke symbol :offset-assert 368) - (red-smoke symbol :offset-assert 372) - (yellow-smoke symbol :offset-assert 376) - (white-eco handle :offset-assert 384) - (des-cam-entity string :offset-assert 392) - (use-interesting symbol :offset-assert 396) - (ignore-camera symbol :offset-assert 400) - (ambient ambient-control :inline :offset-assert 408) - (yellow-gun joint-mod :offset-assert 424) - (palette-val float :offset-assert 428) - (looping-sound ambient-sound 4 :offset-assert 432) - (dda robotboss-dda :offset-assert 448) - (valid-frames int32 :offset-assert 452) - (skip-cut symbol :offset-assert 456) - (keep-charging symbol :offset-assert 460) + ((root collide-shape-moving :override) + (alts entity-actor 13) + (desired-loc vector :inline) + (old-loc vector :inline) + (loc-t float) + (loc-t-start time-frame) + (loc-t-duration time-frame) + (hits-to-go int32) + (took-hit symbol) + (children-spawned int32) + (vulnerable int64) + (till-next-shot int64) + (shot-attractor handle) + (desired-pool-y float) + (particle sparticle-launch-control 7) + (blue-smoke symbol) + (red-smoke symbol) + (yellow-smoke symbol) + (white-eco handle) + (des-cam-entity string) + (use-interesting symbol) + (ignore-camera symbol) + (ambient ambient-control :inline) + (yellow-gun joint-mod) + (palette-val float) + (looping-sound ambient-sound 4) + (dda robotboss-dda) + (valid-frames int32) + (skip-cut symbol) + (keep-charging symbol) ) - :heap-base #x160 - :method-count-assert 21 - :size-assert #x1d0 - :flag-assert #x15016001d0 (:methods - (ease-loc-t (_type_) float 20) + (ease-loc-t (_type_) float) ) (:states robotboss-blue-dark-bomb @@ -101,7 +94,7 @@ ) ;; definition for method 3 of type robotboss -(defmethod inspect robotboss ((this robotboss)) +(defmethod inspect ((this robotboss)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -139,7 +132,7 @@ ;; definition for method 7 of type robotboss ;; INFO: Return type mismatch process-drawable vs robotboss. -(defmethod relocate robotboss ((this robotboss) (arg0 int)) +(defmethod relocate ((this robotboss) (arg0 int)) (dotimes (v1-0 7) (if (nonzero? (-> this particle v1-0)) (&+! (-> this particle v1-0) arg0) @@ -157,7 +150,7 @@ ) ;; definition for method 10 of type robotboss -(defmethod deactivate robotboss ((this robotboss)) +(defmethod deactivate ((this robotboss)) (dotimes (s5-0 7) (let ((a0-1 (-> this particle s5-0))) (if (nonzero? a0-1) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc index 7176e3153be..5f2d609c74f 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc @@ -79,17 +79,14 @@ ;; definition of type ecoclaw-part-info (deftype ecoclaw-part-info (structure) - ((tracker handle :offset-assert 0) - (kind basic :offset-assert 8) - (trans vector :inline :offset-assert 16) + ((tracker handle) + (kind basic) + (trans vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type ecoclaw-part-info -(defmethod inspect ecoclaw-part-info ((this ecoclaw-part-info)) +(defmethod inspect ((this ecoclaw-part-info)) (format #t "[~8x] ~A~%" this 'ecoclaw-part-info) (format #t "~Ttracker: ~D~%" (-> this tracker)) (format #t "~Tkind: ~A~%" (-> this kind)) @@ -99,12 +96,8 @@ ;; definition of type ecoclaw (deftype ecoclaw (process-drawable) - ((particles ecoclaw-part-info 3 :inline :offset-assert 176) + ((particles ecoclaw-part-info 3 :inline) ) - :heap-base #xa0 - :method-count-assert 20 - :size-assert #x110 - :flag-assert #x1400a00110 (:states ecoclaw-activate ecoclaw-idle @@ -112,7 +105,7 @@ ) ;; definition for method 3 of type ecoclaw -(defmethod inspect ecoclaw ((this ecoclaw)) +(defmethod inspect ((this ecoclaw)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -280,7 +273,7 @@ ;; definition for method 11 of type ecoclaw ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ecoclaw ((this ecoclaw) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ecoclaw) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *ecoclaw-sg* '()) @@ -295,20 +288,16 @@ ;; definition of type silodoor (deftype silodoor (process-drawable) - ((part-opened float :offset-assert 176) + ((part-opened float) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xb4 - :flag-assert #x16005000b4 - (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) + (:state-methods + idle + hidden ) ) ;; definition for method 3 of type silodoor -(defmethod inspect silodoor ((this silodoor)) +(defmethod inspect ((this silodoor)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -383,7 +372,7 @@ ;; definition for method 11 of type silodoor ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! silodoor ((this silodoor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this silodoor) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -454,16 +443,12 @@ ;; definition of type finalbosscam (deftype finalbosscam (process-taskable) - ((robotboss handle :offset-assert 384) + ((robotboss handle) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x188 - :flag-assert #x3501200188 ) ;; definition for method 3 of type finalbosscam -(defmethod inspect finalbosscam ((this finalbosscam)) +(defmethod inspect ((this finalbosscam)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -490,10 +475,10 @@ ;; definition for method 32 of type finalbosscam ;; INFO: Return type mismatch spool-anim vs basic. -(defmethod play-anim! finalbosscam ((this finalbosscam) (arg0 symbol)) +(defmethod play-anim! ((this finalbosscam) (arg0 symbol)) (when arg0 (set! (-> this robotboss) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *robotboss-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *robotboss-sg* #f :to this)) ) (send-event (handle->process (-> this robotboss)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this robotboss)) 'center-joint 3) @@ -518,12 +503,12 @@ ) ;; definition for method 31 of type finalbosscam -(defmethod get-art-elem finalbosscam ((this finalbosscam)) +(defmethod get-art-elem ((this finalbosscam)) (-> this draw art-group data 2) ) ;; definition for method 39 of type finalbosscam -(defmethod should-display? finalbosscam ((this finalbosscam)) +(defmethod should-display? ((this finalbosscam)) #f ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc index 43ec4345d55..043c458f192 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc @@ -3,24 +3,21 @@ ;; definition of type torus (deftype torus (structure) - ((origin vector :inline :offset-assert 0) - (axis vector :inline :offset-assert 16) - (radius-primary float :offset-assert 32) - (radius-secondary float :offset-assert 36) + ((origin vector :inline) + (axis vector :inline) + (radius-primary float) + (radius-secondary float) ) - :method-count-assert 13 - :size-assert #x28 - :flag-assert #xd00000028 (:methods - (torus-method-9 (_type_ vector) none 9) - (torus-method-10 (_type_ collide-prim-core vector) symbol 10) - (torus-method-11 (_type_ vector) symbol 11) - (torus-method-12 (_type_ vector) vector 12) + (torus-method-9 (_type_ vector) none) + (torus-method-10 (_type_ collide-prim-core vector) symbol) + (torus-method-11 (_type_ vector) symbol) + (torus-method-12 (_type_ vector) vector) ) ) ;; definition for method 3 of type torus -(defmethod inspect torus ((this torus)) +(defmethod inspect ((this torus)) (format #t "[~8x] ~A~%" this 'torus) (format #t "~Torigin: #~%" (-> this origin)) (format #t "~Taxis: #~%" (-> this axis)) @@ -30,7 +27,7 @@ ) ;; definition for method 10 of type torus -(defmethod torus-method-10 torus ((this torus) (arg0 collide-prim-core) (arg1 vector)) +(defmethod torus-method-10 ((this torus) (arg0 collide-prim-core) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (f30-0 (+ (-> this radius-secondary) (-> arg0 world-sphere w))) @@ -44,7 +41,7 @@ ) ;; definition for method 11 of type torus -(defmethod torus-method-11 torus ((this torus) (arg0 vector)) +(defmethod torus-method-11 ((this torus) (arg0 vector)) (let ((s4-0 (the-as collide-shape-prim-group (-> *target* control root-prim)))) (when (and (logtest? (-> s4-0 prim-core collide-as) (collide-kind target)) (torus-method-10 this (-> s4-0 prim-core) arg0) @@ -66,15 +63,12 @@ ;; definition of type torus-verts (deftype torus-verts (structure) - ((vert vector 8 :inline :offset-assert 0) + ((vert vector 8 :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type torus-verts -(defmethod inspect torus-verts ((this torus-verts)) +(defmethod inspect ((this torus-verts)) (format #t "[~8x] ~A~%" this 'torus-verts) (format #t "~Tvert[8] @ #x~X~%" (-> this vert)) this @@ -83,7 +77,7 @@ ;; definition for method 9 of type torus ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod torus-method-9 torus ((this torus) (arg0 vector)) +(defmethod torus-method-9 ((this torus) (arg0 vector)) (local-vars (sv-256 int) (sv-272 int) (sv-288 int)) (let ((s0-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -134,7 +128,7 @@ ) ;; definition for method 12 of type torus -(defmethod torus-method-12 torus ((this torus) (arg0 vector)) +(defmethod torus-method-12 ((this torus) (arg0 vector)) (let* ((f30-0 65536.0) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-2 (the-as number (logior #x3f800000 v1-1))) @@ -165,23 +159,19 @@ ;; definition of type arcing-shot (deftype arcing-shot (process-drawable) - ((root-override collide-shape-moving :offset 112) - (y-vel float :offset-assert 176) - (grav float :offset-assert 180) - (from vector :inline :offset-assert 192) - (to vector :inline :offset-assert 208) + ((root collide-shape-moving :override) + (y-vel float) + (grav float) + (from vector :inline) + (to vector :inline) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xe0 - :flag-assert #x14007000e0 (:states arcing-shot-debug-trajectory ) ) ;; definition for method 3 of type arcing-shot -(defmethod inspect arcing-shot ((this arcing-shot)) +(defmethod inspect ((this arcing-shot)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -252,15 +242,11 @@ ;; definition of type darkecobomb (deftype darkecobomb (arcing-shot) - ((flight-time time-frame :offset-assert 224) - (countdown-time float :offset-assert 232) - (anim-speed float :offset-assert 236) - (next-tick float :offset-assert 240) + ((flight-time time-frame) + (countdown-time float) + (anim-speed float) + (next-tick float) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #xf4 - :flag-assert #x14009000f4 (:states darkecobomb-countdown (darkecobomb-explode symbol) @@ -270,7 +256,7 @@ ) ;; definition for method 3 of type darkecobomb -(defmethod inspect darkecobomb ((this darkecobomb)) +(defmethod inspect ((this darkecobomb)) (let ((t9-0 (method-of-type arcing-shot inspect))) (t9-0 this) ) @@ -302,7 +288,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (logior! (-> self draw status) (draw-status hidden)) @@ -385,7 +371,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (+! (-> self next-tick) -0.06) @@ -458,7 +444,7 @@ ) :trans (behavior () (arcing-shot-calculate - (-> self root-override trans) + (-> self root trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) ) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time)) @@ -503,9 +489,9 @@ ) (set! (-> s1-0 nav-radius) (* 0.75 (-> s1-0 root-prim local-sphere w))) (backup-collide-with-as s1-0) - (set! (-> self root-override) s1-0) + (set! (-> self root) s1-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *darkecobomb-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 639) self)) @@ -519,19 +505,15 @@ ;; definition of type greenshot (deftype greenshot (arcing-shot) - ((flight-time time-frame :offset-assert 224) + ((flight-time time-frame) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xe8 - :flag-assert #x14008000e8 (:states greenshot-idle ) ) ;; definition for method 3 of type greenshot -(defmethod inspect greenshot ((this greenshot)) +(defmethod inspect ((this greenshot)) (let ((t9-0 (method-of-type arcing-shot inspect))) (t9-0 this) ) @@ -552,13 +534,13 @@ ) :trans (behavior () (arcing-shot-calculate - (-> self root-override trans) + (-> self root trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) ) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time)) (deactivate self) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) ) :code (behavior () (loop @@ -591,9 +573,9 @@ ) (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) (backup-collide-with-as s2-0) - (set! (-> self root-override) s2-0) + (set! (-> self root) s2-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *greenshot-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (arcing-shot-setup arg0 arg1 arg2) @@ -606,18 +588,14 @@ ;; definition of type redshot (deftype redshot (arcing-shot) - ((flight-time time-frame :offset-assert 224) - (stall-time time-frame :offset-assert 232) - (ring torus :inline :offset-assert 240) - (rotation-offset int64 :offset-assert 280) - (part-track handle :offset-assert 288) - (shot-particle sparticle-launch-control :offset-assert 296) - (test-particle sparticle-launch-control :offset-assert 300) + ((flight-time time-frame) + (stall-time time-frame) + (ring torus :inline) + (rotation-offset int64) + (part-track handle) + (shot-particle sparticle-launch-control) + (test-particle sparticle-launch-control) ) - :heap-base #xc0 - :method-count-assert 20 - :size-assert #x130 - :flag-assert #x1400c00130 (:states redshot-explode redshot-idle @@ -626,7 +604,7 @@ ) ;; definition for method 3 of type redshot -(defmethod inspect redshot ((this redshot)) +(defmethod inspect ((this redshot)) (let ((t9-0 (method-of-type arcing-shot inspect))) (t9-0 this) ) @@ -642,7 +620,7 @@ ;; definition for method 7 of type redshot ;; INFO: Return type mismatch arcing-shot vs redshot. -(defmethod relocate redshot ((this redshot) (arg0 int)) +(defmethod relocate ((this redshot) (arg0 int)) (if (nonzero? (-> this shot-particle)) (&+! (-> this shot-particle) arg0) ) @@ -653,7 +631,7 @@ ) ;; definition for method 10 of type redshot -(defmethod deactivate redshot ((this redshot)) +(defmethod deactivate ((this redshot)) (if (nonzero? (-> this shot-particle)) (kill-and-free-particles (-> this shot-particle)) ) @@ -692,10 +670,10 @@ (* 436.90668 (the float (+ (-> self rotation-offset) (-> *display* game-frame-counter)))) (* 291.27112 (the float (+ (-> self rotation-offset) (-> *display* game-frame-counter)))) ) - (matrix->quaternion (-> self root-override quat) s5-0) + (matrix->quaternion (-> self root quat) s5-0) ) (if (< (* 0.006666667 (the float (min 150 arg0))) 1.0) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) ) (none) ) @@ -706,9 +684,9 @@ (set! (-> self state-time) (-> *display* game-frame-counter)) (sound-play "red-explode") (logclear! (-> self draw status) (draw-status hidden)) - (quaternion-identity! (-> self root-override quat)) + (quaternion-identity! (-> self root quat)) (set! (-> self ring radius-secondary) 3072.0) - (set! (-> self ring origin quad) (-> self root-override trans quad)) + (set! (-> self ring origin quad) (-> self root trans quad)) (+! (-> self ring origin y) (-> self ring radius-secondary)) (set-vector! (-> self ring axis) 0.0 1.0 0.0 1.0) (set! (-> self part-track) (ppointer->handle (process-spawn @@ -719,7 +697,7 @@ redshot-particle-callback (-> self ppointer) #f - (-> self root-override trans) + (-> self root trans) :to self ) ) @@ -785,7 +763,7 @@ (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self stall-time)) (go redshot-explode) ) - (spawn (-> self shot-particle) (-> self root-override trans)) + (spawn (-> self shot-particle) (-> self root trans)) ) :code (behavior () (loop @@ -804,13 +782,13 @@ :trans (behavior () (redshot-trans (seconds 5)) (arcing-shot-calculate - (-> self root-override trans) + (-> self root trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) ) (if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time)) (go redshot-wait) ) - (spawn (-> self shot-particle) (-> self root-override trans)) + (spawn (-> self shot-particle) (-> self root trans)) ) :code (behavior () (loop @@ -841,9 +819,9 @@ (set-root-prim! s0-0 sv-16) (set! (-> s0-0 nav-radius) (* 0.75 (-> s0-0 root-prim local-sphere w))) (backup-collide-with-as s0-0) - (set! (-> self root-override) s0-0) + (set! (-> self root) s0-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *redring-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (arcing-shot-setup arg0 arg1 arg2) @@ -855,7 +833,7 @@ (set! (-> self test-particle) (create-launch-control (-> *part-group-id-table* 679) self)) (logior! (-> self draw status) (draw-status hidden)) (set! (-> self sound) - (new 'process 'ambient-sound (static-sound-spec "red-fireball" :fo-max 80) (-> self root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "red-fireball" :fo-max 80) (-> self root trans)) ) (go redshot-idle) (none) @@ -863,19 +841,15 @@ ;; definition of type yellowshot (deftype yellowshot (arcing-shot) - ((flight-time time-frame :offset-assert 224) + ((flight-time time-frame) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xe8 - :flag-assert #x14008000e8 (:states yellowshot-idle ) ) ;; definition for method 3 of type yellowshot -(defmethod inspect yellowshot ((this yellowshot)) +(defmethod inspect ((this yellowshot)) (let ((t9-0 (method-of-type arcing-shot inspect))) (t9-0 this) ) @@ -900,10 +874,10 @@ ) :trans (behavior () (arcing-shot-calculate - (-> self root-override trans) + (-> self root trans) (/ (the float (- (-> *display* game-frame-counter) (-> self state-time))) (the float (-> self flight-time))) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (when (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time)) (send-event (ppointer->process (-> self parent)) 'missed-jak) (deactivate self) @@ -937,9 +911,9 @@ ) (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) (backup-collide-with-as s2-0) - (set! (-> self root-override) s2-0) + (set! (-> self root) s2-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *redring-sg* '()) (logior! (-> self draw status) (draw-status hidden)) (arcing-shot-setup arg0 arg1 arg2) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc index a2925c6c79b..dbda64eb09e 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 20 of type robotboss -(defmethod ease-loc-t robotboss ((this robotboss)) +(defmethod ease-loc-t ((this robotboss)) (parameter-ease-sin-clamp (-> this loc-t)) ) @@ -55,7 +55,7 @@ (else (logior! (-> self skel status) (janim-status inited)) (process-grab? *target*) - (set! (-> *camera-other-root* quad) (-> self root-override trans quad)) + (set! (-> *camera-other-root* quad) (-> self root trans quad)) (let ((s5-1 (-> self node-list data 88 bone transform)) (gp-1 (-> self node-list data 88 bone scale)) ) @@ -155,9 +155,7 @@ (b! (not (and (-> self des-cam-entity) (or (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 188416.0) - (and *target* - (>= 290816.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (and *target* (>= 290816.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) ) ) ) @@ -177,9 +175,7 @@ (label cfg-37) (b! (not (or (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 73728.0) - (and *target* - (>= 290816.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (and *target* (>= 290816.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) ) ) cfg-49 @@ -193,9 +189,7 @@ (label cfg-49) (when (and (< 196608.0 (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0))) (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 614400.0) - (not (and *target* - (>= 299008.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (not (and *target* (>= 299008.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) ) ) (when (not (send-event *camera* 'query-state cam-string)) @@ -242,7 +236,7 @@ (let ((gp-0 (new 'stack 'sphere))) (set! (-> gp-0 w) 4096.0) (set! (-> self shot-attractor) - (ppointer->handle (manipy-spawn (-> self root-override trans) (-> self entity) *redring-sg* gp-0 :to self)) + (ppointer->handle (manipy-spawn (-> self root trans) (-> self entity) *redring-sg* gp-0 :to self)) ) ) (send-event (handle->process (-> self shot-attractor)) 'attackable #t) @@ -300,12 +294,12 @@ (matrix-rotate-y! s4-0 (-> gp-0 x)) (set! (-> gp-0 x) 0.0) (vector-matrix*! gp-0 gp-0 s4-0) - (vector+! (-> self root-override trans) gp-0 (-> self entity extra trans)) + (vector+! (-> self root trans) gp-0 (-> self entity extra trans)) (vector-negate! (the-as vector (-> s4-0 vector)) (the-as vector (-> s4-0 vector))) (vector-negate! (-> s4-0 vector 2) (-> s4-0 vector 2)) - (matrix->quaternion (-> self root-override quat) s4-0) + (matrix->quaternion (-> self root quat) s4-0) ) - (vector-! gp-0 s5-0 (-> self root-override trans)) + (vector-! gp-0 s5-0 (-> self root trans)) (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 (the-as float 204800.0)) (set! (-> gp-0 y) 32768.0) @@ -411,7 +405,7 @@ (let ((a0-5 (-> arg3 param 0))) (when (and a0-5 ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry a0-5) - (-> self root-override) + (-> self root) (the-as uint (-> self vulnerable)) ) ) @@ -978,10 +972,8 @@ ) ) ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 3 collide-with) - (collide-kind) - ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 3 prim-core collide-as) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 3 collide-with) (collide-kind)) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 3 prim-core collide-as) (collide-kind) ) (set! (-> self use-interesting) #f) @@ -1020,10 +1012,10 @@ :to *entity-pool* ) ) - (let ((gp-1 (manipy-spawn (-> self root-override trans) (-> self entity) *robotboss-yelloweco-sg* #f :to self))) + (let ((gp-1 (manipy-spawn (-> self root trans) (-> self entity) *robotboss-yelloweco-sg* #f :to self))) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-1) 'anim-mode 'play1) - (send-event (ppointer->process gp-1) 'rot-quat (-> self root-override quat)) + (send-event (ppointer->process gp-1) 'rot-quat (-> self root quat)) (send-event (ppointer->process gp-1) 'art-joint-anim "robotboss-yelloweco-yellow-last-hit") ) ) @@ -1315,17 +1307,14 @@ ;; definition of type redshot-launch-info (deftype redshot-launch-info (structure) - ((dest vector :inline :offset-assert 0) - (flight-time time-frame :offset-assert 16) - (stall-time time-frame :offset-assert 24) + ((dest vector :inline) + (flight-time time-frame) + (stall-time time-frame) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type redshot-launch-info -(defmethod inspect redshot-launch-info ((this redshot-launch-info)) +(defmethod inspect ((this redshot-launch-info)) (format #t "[~8x] ~A~%" this 'redshot-launch-info) (format #t "~Tdest: #~%" (-> this dest)) (format #t "~Tflight-time: ~D~%" (-> this flight-time)) @@ -1335,15 +1324,12 @@ ;; definition of type redshot-launch-array (deftype redshot-launch-array (structure) - ((info redshot-launch-info 6 :inline :offset-assert 0) + ((info redshot-launch-info 6 :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) ;; definition for method 3 of type redshot-launch-array -(defmethod inspect redshot-launch-array ((this redshot-launch-array)) +(defmethod inspect ((this redshot-launch-array)) (format #t "[~8x] ~A~%" this 'redshot-launch-array) (format #t "~Tinfo[6] @ #x~X~%" (-> this info)) this @@ -1564,10 +1550,8 @@ ) ) ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 5 collide-with) - (collide-kind) - ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 5 prim-core collide-as) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 5 collide-with) (collide-kind)) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 5 prim-core collide-as) (collide-kind) ) (set! (-> self use-interesting) #f) @@ -1629,10 +1613,10 @@ :to *entity-pool* ) ) - (let ((gp-1 (manipy-spawn (-> self root-override trans) (-> self entity) *robotboss-redeco-sg* #f :to self))) + (let ((gp-1 (manipy-spawn (-> self root trans) (-> self entity) *robotboss-redeco-sg* #f :to self))) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-1) 'anim-mode 'play1) - (send-event (ppointer->process gp-1) 'rot-quat (-> self root-override quat)) + (send-event (ppointer->process gp-1) 'rot-quat (-> self root quat)) (send-event (ppointer->process gp-1) 'art-joint-anim "robotboss-redeco-red-last-hit") ) ) @@ -2036,10 +2020,8 @@ ) ) ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 9 collide-with) - (collide-kind) - ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 9 prim-core collide-as) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 9 collide-with) (collide-kind)) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 9 prim-core collide-as) (collide-kind) ) (set! (-> self des-cam-entity) #f) @@ -2546,10 +2528,8 @@ ) ) ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 collide-with) - (collide-kind) - ) - (set! (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core collide-as) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 collide-with) (collide-kind)) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core collide-as) (collide-kind) ) (set! (-> self use-interesting) #f) @@ -2591,10 +2571,10 @@ :to *entity-pool* ) ) - (let ((gp-2 (manipy-spawn (-> self root-override trans) (-> self entity) *robotboss-blueeco-sg* #f :to self))) + (let ((gp-2 (manipy-spawn (-> self root trans) (-> self entity) *robotboss-blueeco-sg* #f :to self))) (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-2) 'anim-mode 'play1) - (send-event (ppointer->process gp-2) 'rot-quat (-> self root-override quat)) + (send-event (ppointer->process gp-2) 'rot-quat (-> self root quat)) (send-event (ppointer->process gp-2) 'art-joint-anim "robotboss-blueeco-blue-last-hit") ) ) @@ -2692,7 +2672,7 @@ ;; definition for method 11 of type robotboss ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! robotboss ((this robotboss) (arg0 entity-actor)) +(defmethod init-from-entity! ((this robotboss) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -2881,18 +2861,18 @@ ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *robotboss-sg* '()) (aybabtu 2) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 (the-as float 40960.0))) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 (the-as float 40960.0))) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (logclear! (-> this root-override nav-flags) (nav-flags navf0)) + (logclear! (-> this root nav-flags) (nav-flags navf0)) (set! (-> this path) (new 'process 'path-control this 'path (the-as float 0.0))) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (logclear! (-> this mask) (process-mask actor-pause)) - (set! (-> this root-override pause-adjust-distance) 1228800.0) + (set! (-> this root pause-adjust-distance) 1228800.0) (set-vector! (-> this old-loc) 8192.0 0.0 245760.0 1.0) (set! (-> this desired-loc quad) (-> this old-loc quad)) (set! (-> this loc-t) 1.0) @@ -2920,16 +2900,16 @@ (set! (-> this particle 5) (create-launch-control (-> *part-group-id-table* 646) this)) (set! (-> this particle 6) (create-launch-control (-> *part-group-id-table* 651) this)) (set! (-> this looping-sound 0) - (new 'process 'ambient-sound (static-sound-spec "robo-blue-lp" :fo-max 80) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "robo-blue-lp" :fo-max 80) (-> this root trans)) ) (set! (-> this looping-sound 1) - (new 'process 'ambient-sound (static-sound-spec "eco-torch" :fo-max 80) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "eco-torch" :fo-max 80) (-> this root trans)) ) (set! (-> this looping-sound 2) - (new 'process 'ambient-sound (static-sound-spec "red-buzz" :fo-max 80) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "red-buzz" :fo-max 80) (-> this root trans)) ) (set! (-> this looping-sound 3) - (new 'process 'ambient-sound (static-sound-spec "bfg-buzz" :fo-max 80) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "bfg-buzz" :fo-max 80) (-> this root trans)) ) (set! (-> this blue-smoke) #f) (set! (-> this red-smoke) #f) diff --git a/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc index 66589782ae1..8b64033067b 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc @@ -33,20 +33,16 @@ ;; definition of type plat-eco-finalboss (deftype plat-eco-finalboss (plat-eco) - ((force-dest float :offset-assert 360) - (targ-dest float :offset-assert 364) - (dest float :offset-assert 368) - (speed float :offset-assert 372) - (touch-time time-frame :offset-assert 376) + ((force-dest float) + (targ-dest float) + (dest float) + (speed float) + (touch-time time-frame) ) - :heap-base #x110 - :method-count-assert 33 - :size-assert #x180 - :flag-assert #x2101100180 ) ;; definition for method 3 of type plat-eco-finalboss -(defmethod inspect plat-eco-finalboss ((this plat-eco-finalboss)) +(defmethod inspect ((this plat-eco-finalboss)) (let ((t9-0 (method-of-type plat-eco inspect))) (t9-0 this) ) @@ -59,18 +55,18 @@ ) ;; definition for method 23 of type plat-eco-finalboss -(defmethod get-unlit-skel plat-eco-finalboss ((this plat-eco-finalboss)) +(defmethod get-unlit-skel ((this plat-eco-finalboss)) *plat-eco-finalboss-unlit-sg* ) ;; definition for method 27 of type plat-eco-finalboss -(defmethod get-lit-skel plat-eco-finalboss ((this plat-eco-finalboss)) +(defmethod get-lit-skel ((this plat-eco-finalboss)) *plat-eco-finalboss-lit-sg* ) ;; definition for method 26 of type plat-eco-finalboss ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-26 plat-eco-finalboss ((this plat-eco-finalboss)) +(defmethod baseplat-method-26 ((this plat-eco-finalboss)) (set! (-> this force-dest) -1.0) (set! (-> this targ-dest) -1.0) (set! (-> this dest) 0.0) @@ -156,8 +152,8 @@ ) (seek! (-> self path-pos) (-> self dest) (* (-> self speed) (seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) - (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) - (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) + (if (< (vector-vector-distance (-> self root trans) (ear-trans)) 81920.0) + (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root trans))) ) (plat-trans) (when (send-event *target* 'query 'powerup (pickup-type eco-yellow)) @@ -169,17 +165,14 @@ ;; definition of type sage-finalboss-particle (deftype sage-finalboss-particle (structure) - ((part sparticle-launch-control :offset-assert 0) - (active symbol :offset-assert 4) + ((part sparticle-launch-control) + (active symbol) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type sage-finalboss-particle -(defmethod inspect sage-finalboss-particle ((this sage-finalboss-particle)) +(defmethod inspect ((this sage-finalboss-particle)) (format #t "[~8x] ~A~%" this 'sage-finalboss-particle) (format #t "~Tpart: ~A~%" (-> this part)) (format #t "~Tactive: ~A~%" (-> this active)) @@ -188,35 +181,31 @@ ;; definition of type sage-finalboss (deftype sage-finalboss (process-taskable) - ((redsage handle :offset-assert 384) - (bluesage handle :offset-assert 392) - (yellowsage handle :offset-assert 400) - (assistant handle :offset-assert 408) - (robotplat handle :offset-assert 416) - (robotboss handle :offset-assert 424) - (silodoor handle :offset-assert 432) - (jak-white handle :offset-assert 440) - (left-door entity-actor :offset-assert 448) - (right-door entity-actor :offset-assert 452) - (kick-in-the-door symbol :offset-assert 456) - (kick-the-credits symbol :offset-assert 460) - (credit-fade float :offset-assert 464) - (palette-val float :offset-assert 468) - (particle sage-finalboss-particle 9 :inline :offset-assert 472) - (particle-whiteout sparticle-launch-control :offset-assert 616) - (credits-played symbol :offset-assert 620) + ((redsage handle) + (bluesage handle) + (yellowsage handle) + (assistant handle) + (robotplat handle) + (robotboss handle) + (silodoor handle) + (jak-white handle) + (left-door entity-actor) + (right-door entity-actor) + (kick-in-the-door symbol) + (kick-the-credits symbol) + (credit-fade float) + (palette-val float) + (particle sage-finalboss-particle 9 :inline) + (particle-whiteout sparticle-launch-control) + (credits-played symbol) ) - :heap-base #x200 - :method-count-assert 53 - :size-assert #x270 - :flag-assert #x3502000270 (:states sage-finalboss-credits ) ) ;; definition for method 3 of type sage-finalboss -(defmethod inspect sage-finalboss ((this sage-finalboss)) +(defmethod inspect ((this sage-finalboss)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -242,7 +231,7 @@ ;; definition for method 7 of type sage-finalboss ;; INFO: Return type mismatch process-taskable vs sage-finalboss. -(defmethod relocate sage-finalboss ((this sage-finalboss) (arg0 int)) +(defmethod relocate ((this sage-finalboss) (arg0 int)) (dotimes (v1-0 9) (if (nonzero? (-> this particle v1-0 part)) (&+! (-> this particle v1-0 part) arg0) @@ -255,7 +244,7 @@ ) ;; definition for method 10 of type sage-finalboss -(defmethod deactivate sage-finalboss ((this sage-finalboss)) +(defmethod deactivate ((this sage-finalboss)) (dotimes (s5-0 9) (let ((a0-1 (-> this particle s5-0 part))) (if (nonzero? a0-1) @@ -279,12 +268,10 @@ ;; definition for method 44 of type sage-finalboss ;; INFO: Return type mismatch object vs symbol. -(defmethod play-reminder sage-finalboss ((this sage-finalboss)) +(defmethod play-reminder ((this sage-finalboss)) (let ((s5-0 (entity-by-name "red-sagecage-1"))) (when s5-0 - (set! (-> this redsage) - (ppointer->handle (manipy-spawn (-> this root-override trans) s5-0 *redsage-sg* #f :to this)) - ) + (set! (-> this redsage) (ppointer->handle (manipy-spawn (-> this root trans) s5-0 *redsage-sg* #f :to this))) (send-event (handle->process (-> this redsage)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this redsage)) 'blend-shape #t) (send-event (handle->process (-> this redsage)) 'center-joint 3) @@ -294,7 +281,7 @@ (let ((s5-1 (entity-by-name "blue-sagecage-1"))) (when s5-1 (set! (-> this bluesage) - (ppointer->handle (manipy-spawn (-> this root-override trans) s5-1 *bluesage-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) s5-1 *bluesage-sg* #f :to this)) ) (send-event (handle->process (-> this bluesage)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this bluesage)) 'blend-shape #t) @@ -307,7 +294,7 @@ symbol (when s5-2 (set! (-> this yellowsage) - (ppointer->handle (manipy-spawn (-> this root-override trans) s5-2 *yellowsage-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) s5-2 *yellowsage-sg* #f :to this)) ) (send-event (handle->process (-> this yellowsage)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this yellowsage)) 'blend-shape #t) @@ -320,13 +307,13 @@ ;; definition for method 45 of type sage-finalboss ;; INFO: Return type mismatch object vs symbol. -(defmethod process-taskable-method-45 sage-finalboss ((this sage-finalboss)) +(defmethod process-taskable-method-45 ((this sage-finalboss)) (let ((s5-0 (entity-by-name "assistant-lavatube-end-3"))) (the-as symbol (when s5-0 (set! (-> this assistant) - (ppointer->handle (manipy-spawn (-> this root-override trans) s5-0 *assistant-lavatube-end-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) s5-0 *assistant-lavatube-end-sg* #f :to this)) ) (let ((s5-1 (handle->process (-> this assistant)))) (if (the-as manipy s5-1) @@ -344,12 +331,12 @@ ;; definition for method 32 of type sage-finalboss ;; INFO: Used lq/sq -(defmethod play-anim! sage-finalboss ((this sage-finalboss) (arg0 symbol)) +(defmethod play-anim! ((this sage-finalboss) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status unknown)) (when arg0 (close-current! (-> this tasks)) - (set-yaw-angle-clear-roll-pitch! (-> this root-override) 0.0) + (set-yaw-angle-clear-roll-pitch! (-> this root) 0.0) ) (new 'static 'spool-anim :name "green-sagecage-daxter-sacrifice" @@ -360,10 +347,10 @@ ) (((task-status need-introduction)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> this root-override) 0.0) + (set-yaw-angle-clear-roll-pitch! (-> this root) 0.0) (close-current! (-> this tasks)) (set! (-> this jak-white) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *jak-white-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *jak-white-sg* #f :to this)) ) (send-event (handle->process (-> this jak-white)) @@ -374,9 +361,7 @@ (send-event (handle->process (-> this jak-white)) 'origin-joint-index 3) (send-event (handle->process (-> this jak-white)) 'blend-shape #t) (set! (-> this robotboss) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *robotboss-cinematic-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *robotboss-cinematic-sg* #f :to this)) ) (send-event (handle->process (-> this robotboss)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this robotboss)) 'origin-joint-index 3) @@ -386,7 +371,7 @@ ) ) (set! (-> this silodoor) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *silodoor-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *silodoor-sg* #f :to this)) ) (send-event (handle->process (-> this silodoor)) 'anim-mode 'clone-anim) (let ((v1-84 (handle->process (-> this silodoor)))) @@ -441,14 +426,14 @@ ) (((task-status need-reminder-a)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> this root-override) 0.0) + (set-yaw-angle-clear-roll-pitch! (-> this root) 0.0) (close-current! (-> this tasks)) (play-reminder this) (process-taskable-method-45 this) (set! (-> this kick-the-credits) #t) (set! (-> this robotplat) (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *plat-eco-finalboss-lit-sg* #f :to this) + (manipy-spawn (-> this root trans) (-> this entity) *plat-eco-finalboss-lit-sg* #f :to this) ) ) (send-event (handle->process (-> this robotplat)) 'anim-mode 'clone-anim) @@ -496,7 +481,7 @@ ) (((task-status need-reminder)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> this root-override) -13116.667) + (set-yaw-angle-clear-roll-pitch! (-> this root) -13116.667) (close-current! (-> this tasks)) (process-taskable-method-45 this) (send-event *camera* 'teleport) @@ -544,7 +529,7 @@ ) (((task-status need-reward-speech)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> this root-override) -13116.667) + (set-yaw-angle-clear-roll-pitch! (-> this root) -13116.667) (close-current! (-> this tasks)) (process-taskable-method-45 this) (set! (-> this left-door) (the-as entity-actor (entity-by-name "power-left-2"))) @@ -585,7 +570,7 @@ ) ;; definition for method 31 of type sage-finalboss -(defmethod get-art-elem sage-finalboss ((this sage-finalboss)) +(defmethod get-art-elem ((this sage-finalboss)) (-> this draw art-group data 4) ) @@ -998,7 +983,7 @@ ) ;; definition for method 39 of type sage-finalboss -(defmethod should-display? sage-finalboss ((this sage-finalboss)) +(defmethod should-display? ((this sage-finalboss)) #f ) @@ -1066,7 +1051,7 @@ ;; definition for method 11 of type sage-finalboss ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! sage-finalboss ((this sage-finalboss) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sage-finalboss) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sage-finalboss-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task finalboss-movies))) (set! (-> this redsage) (the-as handle #f)) @@ -1099,7 +1084,7 @@ (set! (-> this particle v1-37 active) #f) ) (set! (-> this palette-val) 0.0) - (+! (-> this root-override trans y) 2048.0) + (+! (-> this root trans y) 2048.0) (if (not (should-display? this)) (go (method-of-object this hidden)) (go (method-of-object this idle)) diff --git a/test/decompiler/reference/jak1/levels/firecanyon/assistant-firecanyon_REF.gc b/test/decompiler/reference/jak1/levels/firecanyon/assistant-firecanyon_REF.gc index d31d88afdd5..de3852bad3a 100644 --- a/test/decompiler/reference/jak1/levels/firecanyon/assistant-firecanyon_REF.gc +++ b/test/decompiler/reference/jak1/levels/firecanyon/assistant-firecanyon_REF.gc @@ -4,14 +4,10 @@ ;; definition of type assistant-firecanyon (deftype assistant-firecanyon (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type assistant-firecanyon -(defmethod inspect assistant-firecanyon ((this assistant-firecanyon)) +(defmethod inspect ((this assistant-firecanyon)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -26,7 +22,7 @@ ) ;; definition for method 32 of type assistant-firecanyon -(defmethod play-anim! assistant-firecanyon ((this assistant-firecanyon) (arg0 symbol)) +(defmethod play-anim! ((this assistant-firecanyon) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (if arg0 @@ -67,7 +63,7 @@ ) ;; definition for method 31 of type assistant-firecanyon -(defmethod get-art-elem assistant-firecanyon ((this assistant-firecanyon)) +(defmethod get-art-elem ((this assistant-firecanyon)) (if (= (current-status (-> this tasks)) (task-status invalid)) (-> this draw art-group data 8) (-> this draw art-group data 3) @@ -80,7 +76,7 @@ :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) (when (and (cond - ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + ((and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) #t ) (else @@ -256,13 +252,13 @@ ) ;; definition for method 39 of type assistant-firecanyon -(defmethod should-display? assistant-firecanyon ((this assistant-firecanyon)) +(defmethod should-display? ((this assistant-firecanyon)) (first-any (-> this tasks) #t) (= (current-status (-> this tasks)) (task-status need-reward-speech)) ) ;; definition for method 11 of type assistant-firecanyon -(defmethod init-from-entity! assistant-firecanyon ((this assistant-firecanyon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant-firecanyon) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-firecanyon-sg* 3 29 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task firecanyon-assistant))) (first-any (-> this tasks) #t) diff --git a/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc b/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc index 725b0941972..7460609d5d8 100644 --- a/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc @@ -3,12 +3,8 @@ ;; definition of type balloon (deftype balloon (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states balloon-idle balloon-popping @@ -16,7 +12,7 @@ ) ;; definition for method 3 of type balloon -(defmethod inspect balloon ((this balloon)) +(defmethod inspect ((this balloon)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -98,7 +94,7 @@ (defstate balloon-popping (balloon) :code (behavior () (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (sound-play "cool-balloon") (process-spawn @@ -109,7 +105,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (suspend) @@ -143,7 +139,7 @@ ;; definition for method 11 of type balloon ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! balloon ((this balloon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this balloon) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -154,7 +150,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *balloon-sg* '()) @@ -165,13 +161,9 @@ ;; definition of type spike (deftype spike (process-drawable) - ((root-override collide-shape :offset 112) - (num-alts int32 :offset-assert 176) + ((root collide-shape :override) + (num-alts int32) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states spike-down spike-idle @@ -180,7 +172,7 @@ ) ;; definition for method 3 of type spike -(defmethod inspect spike ((this spike)) +(defmethod inspect ((this spike)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -294,7 +286,7 @@ :trans (behavior () (when (and *target* (= (send-event *target* 'query 'mode) 'racer) - (< (vector-vector-distance (-> self root-override trans) (target-pos 0)) 225280.0) + (< (vector-vector-distance (-> self root trans) (target-pos 0)) 225280.0) ) (sound-play "magma-rock") (let ((v1-8 (entity-actor-count (-> self entity) 'alt-actor))) @@ -323,7 +315,7 @@ ;; definition for method 11 of type spike ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! spike ((this spike) (arg0 entity-actor)) +(defmethod init-from-entity! ((this spike) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -372,7 +364,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *spike-sg* '()) @@ -393,20 +385,16 @@ ;; definition of type crate-darkeco-cluster (deftype crate-darkeco-cluster (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) ;; definition for method 3 of type crate-darkeco-cluster -(defmethod inspect crate-darkeco-cluster ((this crate-darkeco-cluster)) +(defmethod inspect ((this crate-darkeco-cluster)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -610,7 +598,7 @@ :virtual #t :code (behavior () (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (sound-play "dcrate-break") (process-spawn @@ -621,7 +609,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (suspend) @@ -651,7 +639,7 @@ ;; definition for method 11 of type crate-darkeco-cluster ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! crate-darkeco-cluster ((this crate-darkeco-cluster) (arg0 entity-actor)) +(defmethod init-from-entity! ((this crate-darkeco-cluster) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind crate)) @@ -664,7 +652,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *crate-darkeco-cluster-sg* '()) diff --git a/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-part_REF.gc b/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-part_REF.gc index 7fbe7d09c98..7fb36d9e2e8 100644 --- a/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type firecanyon-part (deftype firecanyon-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type firecanyon-part -(defmethod inspect firecanyon-part ((this firecanyon-part)) +(defmethod inspect ((this firecanyon-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc b/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc index bada9cce7ca..c5cedacdb68 100644 --- a/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc +++ b/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc @@ -8,32 +8,28 @@ ;; definition of type flutflut (deftype flutflut (process-drawable) - ((parent-override (pointer target) :offset 12) - (root-override collide-shape-moving :offset 112) - (extra-trans vector :inline :offset-assert 176) - (condition int32 :offset-assert 192) - (auto-get-off symbol :offset-assert 196) - (cell handle :offset-assert 200) - (path-data path-control 2 :offset-assert 208) - (path-target path-control :offset 208) - (path-flut path-control :offset 212) - (touch-time time-frame :offset-assert 216) + ((root collide-shape-moving :override) + (parent-override (pointer target) :overlay-at parent) + (extra-trans vector :inline) + (condition int32) + (auto-get-off symbol) + (cell handle) + (path-data path-control 2) + (path-target path-control :overlay-at (-> path-data 0)) + (path-flut path-control :overlay-at (-> path-data 1)) + (touch-time time-frame) ) :pack-me - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe0 - :flag-assert #x18007000e0 - (:methods - (wait-for-start () _type_ :state 20) - (idle () _type_ :state 21) - (pickup ((state flutflut)) _type_ :state 22) - (wait-for-return () _type_ :state 23) + (:state-methods + wait-for-start + idle + (pickup (state flutflut)) + wait-for-return ) ) ;; definition for method 3 of type flutflut -(defmethod inspect flutflut ((this flutflut)) +(defmethod inspect ((this flutflut)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -50,7 +46,7 @@ ;; definition for method 7 of type flutflut ;; INFO: Return type mismatch process-drawable vs flutflut. -(defmethod relocate flutflut ((this flutflut) (arg0 int)) +(defmethod relocate ((this flutflut) (arg0 int)) (countdown (v1-0 2) (if (-> this path-data v1-0) (&+! (-> this path-data v1-0) arg0) @@ -81,7 +77,7 @@ ;; definition for function flutflut-effect ;; INFO: Return type mismatch int vs none. (defbehavior flutflut-effect flutflut () - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (update! (-> self sound)) 0 (none) @@ -93,7 +89,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('trans) - (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) (('notify) (let ((v0-1 (the-as structure #t))) @@ -108,8 +104,8 @@ ) ) :exit (behavior () - (set! (-> self root-override root-prim prim-core action) (collide-action)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) + (set! (-> self root root-prim prim-core action) (collide-action)) + (set! (-> self root root-prim prim-core offense) (collide-offense no-offense)) 0 ) :code (behavior () @@ -155,7 +151,7 @@ (set! (-> self cell) (ppointer->handle (birth-pickup-at-point - (vector+! (new 'stack-no-clear 'vector) (-> self root-override trans) (new 'static 'vector :y 8192.0 :w 1.0)) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 8192.0 :w 1.0)) (pickup-type fuel-cell) (the float (-> self entity extra perm task)) #f @@ -195,18 +191,18 @@ :code (behavior () (ja-channel-set! 1) (ja :group! flut-saddle-flut-idle-ja) - (set! (-> self root-override root-prim prim-core action) (collide-action solid attackable-unused)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> self root root-prim prim-core action) (collide-action solid attackable-unused)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) (loop (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut))) (go-virtual wait-for-return) ) (when (logtest? (-> self draw status) (draw-status was-drawn)) - (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id swamp-flutflut-hint) "sksp0160" (the-as entity #f) *entity-pool* (game-task none)) ) ) - (when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (not (movie?)) (not (level-hint-displayed?)) (!= (-> self condition) 4) @@ -249,12 +245,12 @@ (('draw) (ja-channel-set! 1) (ja :group! flut-saddle-flut-idle-ja) - (set! (-> self root-override root-prim prim-core action) (collide-action solid attackable-unused)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> self root root-prim prim-core action) (collide-action solid attackable-unused)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) (transform-post) ) (('trans) - (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) (('touch 'attack) #f @@ -268,9 +264,7 @@ (ja-channel-set! 0) (ja-post) (while (zero? (ja-group-size)) - (if (or (not *target*) - (< 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (or (not *target*) (< 24576.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (go arg0) ) (flutflut-effect) @@ -298,7 +292,7 @@ (go-virtual pickup (method-of-object self idle)) ) (if (= message 'trans) - (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) ) :enter (behavior () @@ -320,7 +314,7 @@ ;; definition for method 11 of type flutflut ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! flutflut ((this flutflut) (arg0 entity-actor)) +(defmethod init-from-entity! ((this flutflut) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -335,16 +329,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (set-yaw-angle-clear-roll-pitch! (-> this root-override) (res-lump-float arg0 'rotoffset)) + (set-yaw-angle-clear-roll-pitch! (-> this root) (res-lump-float arg0 'rotoffset)) (initialize-skeleton this *flutflut-sg* '()) (logior! (-> this skel status) (janim-status eye)) (set! (-> this draw shadow-ctrl) *flutflut-shadow-control*) (let ((v1-24 (-> this node-list data))) (set! (-> v1-24 0 param0) cspace<-transformq+trans!) - (set! (-> v1-24 0 param1) (the-as basic (-> this root-override trans))) + (set! (-> v1-24 0 param1) (the-as basic (-> this root trans))) (set! (-> v1-24 0 param2) (the-as basic (-> this extra-trans))) ) (dotimes (s4-2 2) @@ -361,7 +355,7 @@ ) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 120) this)) (set! (-> this auto-get-off) #f) - (move-to-ground (-> this root-override) 40960.0 40960.0 #t (collide-kind background)) + (move-to-ground (-> this root) 40960.0 40960.0 #t (collide-kind background)) (set! (-> this cell) (the-as handle #f)) (blocking-plane-spawn (the-as @@ -373,7 +367,7 @@ ) ) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> this root trans)) ) (go (method-of-object this wait-for-start)) (none) diff --git a/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc b/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc index cf7d498dcfd..402b72ddfeb 100644 --- a/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc +++ b/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc @@ -3,20 +3,17 @@ ;; definition of type flut-info (deftype flut-info (basic) - ((entity entity-actor :offset-assert 4) - (flut-trans vector :inline :offset-assert 16) - (flut-quat vector :inline :offset-assert 32) - (flut-scale vector :inline :offset-assert 48) - (stick-lock basic :offset-assert 64) - (flap-sound-id sound-id :offset-assert 68) + ((entity entity-actor) + (flut-trans vector :inline) + (flut-quat vector :inline) + (flut-scale vector :inline) + (stick-lock basic) + (flap-sound-id sound-id) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) ;; definition for method 3 of type flut-info -(defmethod inspect flut-info ((this flut-info)) +(defmethod inspect ((this flut-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tentity: ~A~%" (-> this entity)) (format #t "~Tflut-trans: ~`vector`P~%" (-> this flut-trans)) @@ -29,20 +26,17 @@ ;; definition of type flut-bank (deftype flut-bank (basic) - ((jump-height-min meters :offset-assert 4) - (jump-height-max meters :offset-assert 8) - (double-jump-height-min meters :offset-assert 12) - (double-jump-height-max meters :offset-assert 16) - (air-attack-speed meters :offset-assert 20) - (ground-timeout time-frame :offset-assert 24) + ((jump-height-min meters) + (jump-height-max meters) + (double-jump-height-min meters) + (double-jump-height-max meters) + (air-attack-speed meters) + (ground-timeout time-frame) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type flut-bank -(defmethod inspect flut-bank ((this flut-bank)) +(defmethod inspect ((this flut-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tjump-height-min: (meters ~m)~%" (-> this jump-height-min)) (format #t "~Tjump-height-max: (meters ~m)~%" (-> this jump-height-max)) @@ -493,12 +487,12 @@ ) ) ) - (set! (-> self root-override trans quad) (-> v1-0 flut flut-trans quad)) + (set! (-> self root trans quad) (-> v1-0 flut flut-trans quad)) (let ((a0-4 (-> v1-0 flut flut-quat quad))) - (set! (-> self root-override quat vec quad) a0-4) + (set! (-> self root quat vec quad) a0-4) ) - (set! (-> self root-override scale quad) (-> v1-0 flut flut-scale quad)) - (set! (-> self root-override ground-pat material) (the-as int (-> v1-0 control ground-pat material))) + (set! (-> self root scale quad) (-> v1-0 flut flut-scale quad)) + (set! (-> self root ground-pat material) (the-as int (-> v1-0 control ground-pat material))) (set! (-> self draw light-index) (the-as uint 255)) (let ((a0-13 (-> v1-0 draw color-mult quad))) (set! (-> self draw color-mult quad) a0-13) @@ -1226,9 +1220,7 @@ (set! (-> *run-attack-mods* turnvv) 655360.0) (target-start-attack) (target-danger-set! 'flut-attack #f) - (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (time-elapsed? (-> self control unknown-dword82) (seconds 0.25)) ) (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) @@ -1243,7 +1235,7 @@ (-> self entity) s5-0 gp-0 - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + (if (>= (-> self fact eco-level) (-> *FACT-bank* eco-level-max)) 281 265 ) @@ -1610,7 +1602,7 @@ :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control unknown-cpad-info00 number) r2)) - (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) + (pickup-collectable! (-> self fact) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) (go target-flut-stance) ) ) @@ -1681,38 +1673,23 @@ (go target-flut-stance) ) (else - (pickup-collectable! - (-> self fact-info-target) - (pickup-type eco-green) - (the-as float -1000.0) - (the-as handle #f) - ) + (pickup-collectable! (-> self fact) (pickup-type eco-green) (the-as float -1000.0) (the-as handle #f)) (go target-flut-death (-> gp-0 mode)) ) ) ) (('water-vol 'sharkey) - (pickup-collectable! - (-> self fact-info-target) - (pickup-type eco-green) - (the-as float -1000.0) - (the-as handle #f) - ) + (pickup-collectable! (-> self fact) (pickup-type eco-green) (the-as float -1000.0) (the-as handle #f)) (if (= (-> self game mode) 'play) (go target-flut-death (-> gp-0 mode)) ) ) (('death) - (pickup-collectable! - (-> self fact-info-target) - (pickup-type eco-green) - (the-as float -1000.0) - (the-as handle #f) - ) + (pickup-collectable! (-> self fact) (pickup-type eco-green) (the-as float -1000.0) (the-as handle #f)) ) (else (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) @@ -1743,7 +1720,7 @@ (target-hit-move gp-0 (target-hit-orient gp-0 s5-0) target-flut-falling-anim-trans f30-0) ) ) - (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) (go target-flut-death (-> gp-0 mode)) ) ) diff --git a/test/decompiler/reference/jak1/levels/intro/evilbro_REF.gc b/test/decompiler/reference/jak1/levels/intro/evilbro_REF.gc index a33dfca0af5..c6306f1e369 100644 --- a/test/decompiler/reference/jak1/levels/intro/evilbro_REF.gc +++ b/test/decompiler/reference/jak1/levels/intro/evilbro_REF.gc @@ -3,16 +3,12 @@ ;; definition of type evilbro (deftype evilbro (process-taskable) - ((evilsis entity-actor :offset-assert 380) + ((evilsis entity-actor) ) - :heap-base #x110 - :method-count-assert 53 - :size-assert #x180 - :flag-assert #x3501100180 ) ;; definition for method 3 of type evilbro -(defmethod inspect evilbro ((this evilbro)) +(defmethod inspect ((this evilbro)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -29,7 +25,7 @@ ;; definition for method 32 of type evilbro ;; INFO: Return type mismatch spool-anim vs basic. -(defmethod play-anim! evilbro ((this evilbro) (arg0 symbol)) +(defmethod play-anim! ((this evilbro) (arg0 symbol)) (cond (arg0 (close-specific-task! (game-task leaving-misty) (task-status need-introduction)) @@ -43,7 +39,7 @@ ) ;; definition for method 31 of type evilbro -(defmethod get-art-elem evilbro ((this evilbro)) +(defmethod get-art-elem ((this evilbro)) (-> this draw art-group data 3) ) @@ -101,7 +97,7 @@ ) ;; definition for method 11 of type evilbro -(defmethod init-from-entity! evilbro ((this evilbro) (arg0 entity-actor)) +(defmethod init-from-entity! ((this evilbro) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *evilbro-intro-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task leaving-misty))) (set! (-> this evilsis) (entity-actor-lookup arg0 'alt-actor 0)) @@ -112,14 +108,10 @@ ;; definition of type evilsis (deftype evilsis (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type evilsis -(defmethod inspect evilsis ((this evilsis)) +(defmethod inspect ((this evilsis)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -135,7 +127,7 @@ ;; definition for method 32 of type evilsis ;; INFO: Return type mismatch art-element vs basic. -(defmethod play-anim! evilsis ((this evilsis) (arg0 symbol)) +(defmethod play-anim! ((this evilsis) (arg0 symbol)) (if arg0 (format 0 @@ -148,7 +140,7 @@ ) ;; definition for method 31 of type evilsis -(defmethod get-art-elem evilsis ((this evilsis)) +(defmethod get-art-elem ((this evilsis)) (-> this draw art-group data 3) ) @@ -162,7 +154,7 @@ ) ;; definition for method 11 of type evilsis -(defmethod init-from-entity! evilsis ((this evilsis) (arg0 entity-actor)) +(defmethod init-from-entity! ((this evilsis) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *evilsis-intro-sg* 3 0 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task leaving-misty))) (process-taskable-method-42 this) diff --git a/test/decompiler/reference/jak1/levels/jungle/bouncer_REF.gc b/test/decompiler/reference/jak1/levels/jungle/bouncer_REF.gc index 8086d273017..23f95004c8b 100644 --- a/test/decompiler/reference/jak1/levels/jungle/bouncer_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/bouncer_REF.gc @@ -3,13 +3,9 @@ ;; definition of type springbox (deftype springbox (process-drawable) - ((spring-height meters :offset-assert 176) - (smush float :offset-assert 180) + ((spring-height meters) + (smush float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states bouncer-fire bouncer-smush @@ -18,7 +14,7 @@ ) ;; definition for method 3 of type springbox -(defmethod inspect springbox ((this springbox)) +(defmethod inspect ((this springbox)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -125,7 +121,7 @@ ;; definition for method 11 of type springbox ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! springbox ((this springbox) (arg0 entity-actor)) +(defmethod init-from-entity! ((this springbox) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) diff --git a/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc b/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc index ef81c525f16..220bf176b5c 100644 --- a/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc @@ -3,19 +3,15 @@ ;; definition of type darkvine (deftype darkvine (process-drawable) - ((root-override collide-shape :offset 112) - (speed float :offset-assert 176) - (tip-index int8 :offset-assert 180) - (dangerous symbol :offset-assert 184) - (vulnerable symbol :offset-assert 188) - (hit-player symbol :offset-assert 192) - (touch-time time-frame :offset-assert 200) - (player-attack-id int32 :offset-assert 208) + ((root collide-shape :override) + (speed float) + (tip-index int8) + (dangerous symbol) + (vulnerable symbol) + (hit-player symbol) + (touch-time time-frame) + (player-attack-id int32) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd4 - :flag-assert #x14007000d4 (:states (darkvine-die symbol) darkvine-idle @@ -24,7 +20,7 @@ ) ;; definition for method 3 of type darkvine -(defmethod inspect darkvine ((this darkvine)) +(defmethod inspect ((this darkvine)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -39,12 +35,12 @@ ) ;; definition for method 12 of type darkvine -(defmethod run-logic? darkvine ((this darkvine)) +(defmethod run-logic? ((this darkvine)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status was-drawn)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root-override pause-adjust-distance)) - (vector-vector-distance (-> this root-override trans) (math-camera-pos)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) ) (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) @@ -139,10 +135,10 @@ (defbehavior darkvine-event-handler darkvine ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) (when (-> self dangerous) (if (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) + (set-collide-offense (-> self root) 2 (collide-offense no-offense)) ) ) ) @@ -152,7 +148,7 @@ ((!= v1-10 (-> self player-attack-id)) (set! (-> self player-attack-id) (the-as int v1-10)) (when (-> self vulnerable) - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) (go darkvine-retreat) ) ) @@ -179,7 +175,7 @@ (ja-no-eval :group! darkvine-idle-ja :num! (seek! max (-> self speed)) :frame-num 0.0) (until (ja-done? 0) (if (and (>= (ja-aframe-num 0) 120.0) (>= 180.0 (ja-aframe-num 0))) - (seek-toward-yaw-angle! (-> self root-override) f30-0 32768.0 (seconds 0.5)) + (seek-toward-yaw-angle! (-> self root) f30-0 32768.0 (seconds 0.5)) ) (suspend) (ja :num! (seek! max (-> self speed))) @@ -194,7 +190,7 @@ ) :post (behavior () (when (and (-> self hit-player) (or (not *target*) (time-elapsed? (-> self touch-time) (seconds 0.05)))) - (set-collide-offense (-> self root-override) 2 (collide-offense indestructible)) + (set-collide-offense (-> self root) 2 (collide-offense indestructible)) (set! (-> self hit-player) #f) ) (transform-post) @@ -220,7 +216,7 @@ (ja-channel-push! 1 (seconds 0.15)) (ja-no-eval :group! darkvine-retreat-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (launch-particles (-> *part-id-table* 800) (-> self root-override trans)) + (launch-particles (-> *part-id-table* 800) (-> self root trans)) (suspend) (ja :num! (seek!)) ) @@ -238,7 +234,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (let ((gp-2 (current-time))) @@ -267,7 +263,7 @@ (ja-channel-set! 1) (ja-channel-push! 1 (seconds 0.5)) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja :group! darkvine-dead-ja :num! min) (while (!= (-> self skel root-channel 0) (-> self skel channel)) (suspend) @@ -280,7 +276,7 @@ ;; definition for method 11 of type darkvine ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! darkvine ((this darkvine) (arg0 entity-actor)) +(defmethod init-from-entity! ((this darkvine) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) @@ -328,12 +324,12 @@ ) (set! (-> s4-0 nav-radius) 2048.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (set! (-> this tip-index) 8) (process-drawable-from-entity! this arg0) (initialize-skeleton this *darkvine-sg* '()) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (set! (-> this hit-player) #f) (set! (-> this speed) (rand-vu-float-range 0.95 1.05)) (if (logtest? (get-reminder (get-task-control (game-task jungle-plant)) 0) 1) diff --git a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc index 1f1afef02f8..4a22e0ecb39 100644 --- a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc @@ -3,18 +3,15 @@ ;; definition of type fisher-bank (deftype fisher-bank (basic) - ((width meters :offset-assert 4) - (net-radius meters :offset-assert 8) - (max-caught int32 :offset-assert 12) - (max-missed int32 :offset-assert 16) + ((width meters) + (net-radius meters) + (max-caught int32) + (max-missed int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type fisher-bank -(defmethod inspect fisher-bank ((this fisher-bank)) +(defmethod inspect ((this fisher-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Twidth: (meters ~m)~%" (-> this width)) (format #t "~Tnet-radius: (meters ~m)~%" (-> this net-radius)) @@ -168,24 +165,21 @@ ;; definition of type fisher-params (deftype fisher-params (structure) - ((timeout time-frame :offset-assert 0) - (vel float :offset-assert 8) - (swing-min time-frame :offset-assert 16) - (swing-max time-frame :offset-assert 24) - (period time-frame :offset-assert 32) - (fish-vel float :offset-assert 40) - (bad-percent float :offset-assert 44) - (deadly-percent float :offset-assert 48) - (powerup-percent float :offset-assert 52) + ((timeout time-frame) + (vel float) + (swing-min time-frame) + (swing-max time-frame) + (period time-frame) + (fish-vel float) + (bad-percent float) + (deadly-percent float) + (powerup-percent float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) ;; definition for method 3 of type fisher-params -(defmethod inspect fisher-params ((this fisher-params)) +(defmethod inspect ((this fisher-params)) (format #t "[~8x] ~A~%" this 'fisher-params) (format #t "~Ttimeout: ~D~%" (-> this timeout)) (format #t "~Tvel: ~f~%" (-> this vel)) @@ -745,34 +739,30 @@ ;; definition of type fisher (deftype fisher (process-taskable) - ((paddle-end vector 2 :inline :offset-assert 384) - (paddle-pos vector :inline :offset-assert 416) - (paddle float :offset-assert 432) - (paddle-vel float :offset-assert 436) - (spawner float :offset-assert 440) - (spawner-last float :offset-assert 444) - (spawn-time time-frame :offset-assert 448) - (turn-time time-frame :offset-assert 456) - (swing-time time-frame :offset-assert 464) - (block-time time-frame :offset-assert 472) - (block int32 :offset-assert 480) - (caught int32 :offset-assert 484) - (missed int32 :offset-assert 488) - (difficulty int32 :offset-assert 492) - (start-time time-frame :offset-assert 496) - (ambient-big-one time-frame :offset-assert 504) - (ambient-steady time-frame :offset-assert 512) - (ambient-sagging time-frame :offset-assert 520) - (ambient-almost time-frame :offset-assert 528) - (cheat-temp int32 :offset-assert 536) - (hard symbol :offset-assert 540) - (training symbol :offset-assert 544) - (params fisher-params :inline :offset-assert 552) + ((paddle-end vector 2 :inline) + (paddle-pos vector :inline) + (paddle float) + (paddle-vel float) + (spawner float) + (spawner-last float) + (spawn-time time-frame) + (turn-time time-frame) + (swing-time time-frame) + (block-time time-frame) + (block int32) + (caught int32) + (missed int32) + (difficulty int32) + (start-time time-frame) + (ambient-big-one time-frame) + (ambient-steady time-frame) + (ambient-sagging time-frame) + (ambient-almost time-frame) + (cheat-temp int32) + (hard symbol) + (training symbol) + (params fisher-params :inline) ) - :heap-base #x1f0 - :method-count-assert 53 - :size-assert #x260 - :flag-assert #x3501f00260 (:states fisher-done fisher-playing @@ -780,7 +770,7 @@ ) ;; definition for method 3 of type fisher -(defmethod inspect fisher ((this fisher)) +(defmethod inspect ((this fisher)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -812,17 +802,13 @@ ;; definition of type fisher-fish (deftype fisher-fish (process-drawable) - ((dir vector :inline :offset-assert 176) - (offset float :offset-assert 192) - (pos float :offset-assert 196) - (vel float :offset-assert 200) - (mode basic :offset-assert 204) - (size meters :offset-assert 208) + ((dir vector :inline) + (offset float) + (pos float) + (vel float) + (mode basic) + (size meters) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd4 - :flag-assert #x14007000d4 (:states fisher-fish-caught fisher-fish-die @@ -831,7 +817,7 @@ ) ;; definition for method 3 of type fisher-fish -(defmethod inspect fisher-fish ((this fisher-fish)) +(defmethod inspect ((this fisher-fish)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -877,10 +863,10 @@ ;; definition for method 52 of type fisher ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 fisher ((this fisher)) +(defmethod process-taskable-method-52 ((this fisher)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -1024.0 f0-0))) ) @@ -898,7 +884,7 @@ ;; definition for method 48 of type fisher ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow fisher ((this fisher)) +(defmethod draw-npc-shadow ((this fisher)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -1179,7 +1165,7 @@ ) ;; definition for method 32 of type fisher -(defmethod play-anim! fisher ((this fisher) (arg0 symbol)) +(defmethod play-anim! ((this fisher) (arg0 symbol)) (if arg0 (set! (-> this training) #f) ) @@ -1257,7 +1243,7 @@ ) ;; definition for method 31 of type fisher -(defmethod get-art-elem fisher ((this fisher)) +(defmethod get-art-elem ((this fisher)) (if (closed? (-> this tasks) (game-task jungle-fishgame) (task-status need-reminder)) (-> this draw art-group data 7) (-> this draw art-group data 6) @@ -1266,7 +1252,7 @@ ;; definition for method 38 of type fisher ;; INFO: Return type mismatch object vs none. -(defmethod process-taskable-method-38 fisher ((this fisher)) +(defmethod process-taskable-method-38 ((this fisher)) (case (current-status (-> this tasks)) (((task-status need-reminder-a) (task-status need-reminder)) (go (method-of-object this query)) @@ -1282,7 +1268,7 @@ ) ;; definition for method 34 of type fisher -(defmethod get-accept-anim fisher ((this fisher) (arg0 symbol)) +(defmethod get-accept-anim ((this fisher) (arg0 symbol)) (when arg0 (close-current! (-> this tasks)) (aybabtu 2) @@ -1296,7 +1282,7 @@ ) ;; definition for method 36 of type fisher -(defmethod get-reject-anim fisher ((this fisher) (arg0 symbol)) +(defmethod get-reject-anim ((this fisher) (arg0 symbol)) (new 'static 'spool-anim :name "fisher-reject" :index 11 :parts 2 :command-list '()) ) @@ -1487,7 +1473,7 @@ (cond ((and (< 0.3 f0-2) (< (+ (-> *FISHER-bank* max-caught) -30) (-> self caught))) (if (and (time-elapsed? (-> self ambient-almost) (seconds 10)) - (play-ambient (-> self ambient) "FIS-TA11" #t (-> self root-override trans)) + (play-ambient (-> self ambient) "FIS-TA11" #t (-> self root trans)) ) (set-time! (-> self ambient-almost)) ) @@ -1496,14 +1482,14 @@ ) ((< 0.1 f0-2) (if (and (time-elapsed? (-> self ambient-steady) (seconds 10)) - (play-ambient (-> self ambient) "FIS-TA06" #t (-> self root-override trans)) + (play-ambient (-> self ambient) "FIS-TA06" #t (-> self root trans)) ) (set-time! (-> self ambient-steady)) ) ) ((< (+ (-> *FISHER-bank* max-missed) -6) (-> self missed)) (if (and (time-elapsed? (-> self ambient-sagging) (seconds 10)) - (play-ambient (-> self ambient) "FIS-TA07" #t (-> self root-override trans)) + (play-ambient (-> self ambient) "FIS-TA07" #t (-> self root trans)) ) (set-time! (-> self ambient-sagging)) ) @@ -1551,7 +1537,7 @@ (cond ((rand-vu-percent? (-> self params powerup-percent)) (if (and (time-elapsed? (-> self ambient-big-one) (seconds 30)) - (play-ambient (-> self ambient) "FIS-TA03" #t (-> self root-override trans)) + (play-ambient (-> self ambient) "FIS-TA03" #t (-> self root trans)) ) (set-time! (-> self ambient-big-one)) ) @@ -1627,7 +1613,7 @@ (set-setting! 'ambient-volume 'rel 50.0 0) (send-event *target* 'reset-pickup 'eco) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (process-spawn-function process (lambda :behavior fisher-fish @@ -1660,8 +1646,8 @@ ) (set! (-> *camera-other-fov* data) (-> *camera-combiner* fov)) (set! (-> *camera-other-trans* quad) (-> *camera-combiner* trans quad)) - (set! (-> *camera-other-root* quad) (-> self root-override trans quad)) - (restore-collide-with-as (-> self root-override)) + (set! (-> *camera-other-root* quad) (-> self root trans quad)) + (restore-collide-with-as (-> self root)) (send-event *camera* 'blend-from-as-fixed) (send-event *camera* 'change-state *camera-base-mode* 0) (send-event *camera* 'clear-entity) @@ -1738,14 +1724,14 @@ ) ;; definition for method 43 of type fisher -(defmethod process-taskable-method-43 fisher ((this fisher)) +(defmethod process-taskable-method-43 ((this fisher)) (cond ((closed? (-> this tasks) (game-task jungle-fishgame) (task-status need-reminder)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 1) 122880.0 this) (let ((f0-2 (rand-float-gen))) (if (< 0.5 f0-2) - (play-ambient (-> this ambient) "FIS-LO03" #f (-> this root-override trans)) - (play-ambient (-> this ambient) "FIS-LO05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-LO03" #f (-> this root trans)) + (play-ambient (-> this ambient) "FIS-LO05" #f (-> this root trans)) ) ) ) @@ -1755,28 +1741,28 @@ (let ((f0-5 (rand-float-gen))) (cond ((< 0.875 f0-5) - (play-ambient (-> this ambient) "FIS-LO01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-LO01" #f (-> this root trans)) ) ((< 0.75 f0-5) - (play-ambient (-> this ambient) "FIS-LO04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-LO04" #f (-> this root trans)) ) ((< 0.625 f0-5) - (play-ambient (-> this ambient) "FIS-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-AM01" #f (-> this root trans)) ) ((< 0.5 f0-5) - (play-ambient (-> this ambient) "FIS-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-AM02" #f (-> this root trans)) ) ((< 0.375 f0-5) - (play-ambient (-> this ambient) "FIS-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-AM03" #f (-> this root trans)) ) ((< 0.25 f0-5) - (play-ambient (-> this ambient) "FIS-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-AM04" #f (-> this root trans)) ) ((< 0.125 f0-5) - (play-ambient (-> this ambient) "FIS-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-AM05" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "FIS-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-AM06" #f (-> this root trans)) ) ) ) @@ -1989,7 +1975,7 @@ ;; definition for method 41 of type fisher ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision fisher ((this fisher) (arg0 int) (arg1 vector)) +(defmethod initialize-collision ((this fisher) (arg0 int) (arg1 vector)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) @@ -2019,20 +2005,20 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 47 of type fisher -(defmethod target-above-threshold? fisher ((this fisher)) +(defmethod target-above-threshold? ((this fisher)) (or (= (current-task (-> this tasks)) (game-task jungle-fishgame)) (-> this hard)) ) ;; definition for method 11 of type fisher ;; INFO: Used lq/sq -(defmethod init-from-entity! fisher ((this fisher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fisher) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *fisher-sg* 3 49 (new 'static 'vector :w 4096.0) 33) (set! (-> this tasks) (get-task-control (game-task jungle-fishgame))) (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) diff --git a/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc b/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc index f8f2d66aec2..2ba6c9cbb4e 100644 --- a/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc @@ -3,17 +3,13 @@ ;; definition of type hopper (deftype hopper (nav-enemy) - ((jump-length float :offset-assert 400) - (shadow-min-y float :offset-assert 404) + ((jump-length float) + (shadow-min-y float) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x198 - :flag-assert #x4c01300198 ) ;; definition for method 3 of type hopper -(defmethod inspect hopper ((this hopper)) +(defmethod inspect ((this hopper)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -35,7 +31,7 @@ nav-enemy-default-event-handler ;; definition for method 39 of type hopper ;; INFO: Return type mismatch int vs none. -(defmethod common-post hopper ((this hopper)) +(defmethod common-post ((this hopper)) (let ((v1-1 (-> this draw shadow-ctrl))) (set! (-> v1-1 settings bot-plane w) (- (- (-> this shadow-min-y) (-> this collide-info trans y)))) ) @@ -326,7 +322,7 @@ nav-enemy-default-event-handler ;; definition for method 47 of type hopper ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision hopper ((this hopper)) +(defmethod initialize-collision ((this hopper)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -367,7 +363,7 @@ nav-enemy-default-event-handler ;; definition for method 48 of type hopper ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 hopper ((this hopper)) +(defmethod nav-enemy-method-48 ((this hopper)) (initialize-skeleton this *hopper-sg* '()) (init-defaults! this *hopper-nav-enemy-info*) (set! (-> this shadow-min-y) (+ (-> this collide-info trans y) (-> this nav-info shadow-min-y))) diff --git a/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc b/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc index 82ff4a448e8..c27c2f916aa 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc @@ -3,18 +3,14 @@ ;; definition of type jungle-elevator (deftype jungle-elevator (plat-button) - ((bottom-height float :offset-assert 240) - (teleport-if-below-y float :offset-assert 244) - (teleport-if-above-y float :offset-assert 248) + ((bottom-height float) + (teleport-if-below-y float) + (teleport-if-above-y float) ) - :heap-base #x90 - :method-count-assert 33 - :size-assert #xfc - :flag-assert #x21009000fc ) ;; definition for method 3 of type jungle-elevator -(defmethod inspect jungle-elevator ((this jungle-elevator)) +(defmethod inspect ((this jungle-elevator)) (let ((t9-0 (method-of-type plat-button inspect))) (t9-0 this) ) @@ -25,7 +21,7 @@ ) ;; definition for method 26 of type jungle-elevator -(defmethod can-activate? jungle-elevator ((this jungle-elevator)) +(defmethod can-activate? ((this jungle-elevator)) (and ((method-of-type plat-button can-activate?) this) (task-complete? *game-info* (game-task jungle-tower))) ) @@ -55,13 +51,13 @@ (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> self root-override trans quad)) + (set! (-> s5-0 quad) (-> self root trans quad)) (let ((t9-1 (-> (find-parent-state) trans))) (if t9-1 (t9-1) ) ) - (vector-! gp-0 (-> self root-override trans) s5-0) + (vector-! gp-0 (-> self root trans) s5-0) (when (< (-> self path-pos) 0.9) (move-by-vector! (-> *target* control) gp-0) (send-event *target* 'reset-height) @@ -136,7 +132,7 @@ ) ;; definition for method 30 of type jungle-elevator -(defmethod should-teleport? jungle-elevator ((this jungle-elevator)) +(defmethod should-teleport? ((this jungle-elevator)) (let ((f0-0 (-> (camera-pos) y))) (case (-> this path-pos) ((0.0) @@ -158,7 +154,7 @@ ;; definition for method 29 of type jungle-elevator ;; INFO: Return type mismatch symbol vs none. -(defmethod can-target-move? jungle-elevator ((this jungle-elevator)) +(defmethod can-target-move? ((this jungle-elevator)) (let ((s5-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> this path) s5-0 0.4 'interp) (set! (-> this teleport-if-above-y) (-> s5-0 y)) diff --git a/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc b/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc index 2c19bc54950..e883fe3bd7b 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc @@ -508,36 +508,32 @@ ;; definition of type periscope (deftype periscope (process-drawable) - ((root-override collide-shape :offset 112) - (y-offset meters :offset-assert 176) - (y-offset-grips meters :offset-assert 180) - (height meters :offset-assert 184) - (turn degrees :offset-assert 188) - (tilt degrees :offset-assert 192) - (target-turn degrees :offset-assert 196) - (target-tilt degrees :offset-assert 200) - (base vector :inline :offset-assert 208) - (reflector-trans vector :inline :offset-assert 224) - (next-reflector-trans vector :inline :offset-assert 240) - (prev-reflector-trans vector :inline :offset-assert 256) - (old-camera-matrix matrix :inline :offset-assert 272) - (reflector (pointer reflector) :offset-assert 336) - (gauge-rot degrees :offset-assert 340) - (lock-time time-frame :offset-assert 344) - (aligned? symbol :offset-assert 352) - (raised? symbol :offset-assert 356) - (player-touching-grips? symbol :offset-assert 360) - (grips-moving? symbol :offset-assert 364) - (sound-id sound-id :offset-assert 368) - (rise-sound-id sound-id :offset-assert 372) - (grips-sound-id sound-id :offset-assert 376) - (grips joint-mod-set-world :offset-assert 380) - (part-aligned sparticle-launch-control :offset-assert 384) + ((root collide-shape :override) + (y-offset meters) + (y-offset-grips meters) + (height meters) + (turn degrees) + (tilt degrees) + (target-turn degrees) + (target-tilt degrees) + (base vector :inline) + (reflector-trans vector :inline) + (next-reflector-trans vector :inline) + (prev-reflector-trans vector :inline) + (old-camera-matrix matrix :inline) + (reflector (pointer reflector)) + (gauge-rot degrees) + (lock-time time-frame) + (aligned? symbol) + (raised? symbol) + (player-touching-grips? symbol) + (grips-moving? symbol) + (sound-id sound-id) + (rise-sound-id sound-id) + (grips-sound-id sound-id) + (grips joint-mod-set-world) + (part-aligned sparticle-launch-control) ) - :heap-base #x120 - :method-count-assert 20 - :size-assert #x184 - :flag-assert #x1401200184 (:states periscope-activate periscope-idle @@ -549,7 +545,7 @@ ) ;; definition for method 3 of type periscope -(defmethod inspect periscope ((this periscope)) +(defmethod inspect ((this periscope)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -582,7 +578,7 @@ ;; definition for method 7 of type periscope ;; INFO: Return type mismatch process-drawable vs periscope. -(defmethod relocate periscope ((this periscope) (arg0 int)) +(defmethod relocate ((this periscope) (arg0 int)) (if (nonzero? (-> this grips)) (&+! (-> this grips) arg0) ) @@ -593,7 +589,7 @@ ) ;; definition for method 10 of type periscope -(defmethod deactivate periscope ((this periscope)) +(defmethod deactivate ((this periscope)) (if (nonzero? (-> this part-aligned)) (kill-and-free-particles (-> this part-aligned)) ) @@ -603,20 +599,16 @@ ;; definition of type reflector (deftype reflector (process-drawable) - ((parent-override (pointer periscope) :offset 12) - (root-override collide-shape :offset 112) + ((root collide-shape :override) + (parent-override (pointer periscope) :overlay-at parent) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states reflector-idle ) ) ;; definition for method 3 of type reflector -(defmethod inspect reflector ((this reflector)) +(defmethod inspect ((this reflector)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -625,23 +617,19 @@ ;; definition of type reflector-origin (deftype reflector-origin (process-drawable) - ((reflector-trans vector :inline :offset-assert 176) - (next-reflector-trans vector :inline :offset-assert 192) - (reflector uint32 :offset-assert 208) - (next basic :offset-assert 212) - (blocker entity-actor :offset-assert 216) + ((reflector-trans vector :inline) + (next-reflector-trans vector :inline) + (reflector uint32) + (next basic) + (blocker entity-actor) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xdc - :flag-assert #x14007000dc (:states reflector-origin-idle ) ) ;; definition for method 3 of type reflector-origin -(defmethod inspect reflector-origin ((this reflector-origin)) +(defmethod inspect ((this reflector-origin)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -655,13 +643,9 @@ ;; definition of type reflector-mirror (deftype reflector-mirror (process-drawable) - ((root-override collide-shape :offset 112) - (beam-end vector :inline :offset-assert 176) + ((root collide-shape :override) + (beam-end vector :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc0 - :flag-assert #x14005000c0 (:states (reflector-mirror-broken symbol) reflector-mirror-idle @@ -669,7 +653,7 @@ ) ;; definition for method 3 of type reflector-mirror -(defmethod inspect reflector-mirror ((this reflector-mirror)) +(defmethod inspect ((this reflector-mirror)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -816,12 +800,10 @@ (set! (-> gp-0 y) (-> self parent-override 0 turn)) (set! (-> gp-0 z) 0.0) (set! (-> gp-0 w) 1.0) - (quaternion-zxy! (-> self root-override quat) gp-0) - (set! (-> self root-override trans quad) - (-> self parent-override 0 node-list data 6 bone transform vector 3 quad) - ) + (quaternion-zxy! (-> self root quat) gp-0) + (set! (-> self root trans quad) (-> self parent-override 0 node-list data 6 bone transform vector 3 quad)) (ja-post) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (suspend) ) ) @@ -845,9 +827,9 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *periscope-mirror-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (go reflector-idle) @@ -1124,9 +1106,9 @@ (set! (-> a1-0 from) (the-as process (-> self turn))) (set! (-> a1-0 num-params) (the-as int 0.0)) (set! (-> a1-0 message) (the-as symbol 1.0)) - (quaternion-zxy! (-> self root-override quat) (the-as vector a1-0)) + (quaternion-zxy! (-> self root quat) (the-as vector a1-0)) ) - (set! (-> self root-override trans y) (+ -184320.0 (-> self y-offset) (-> self base y))) + (set! (-> self root trans y) (+ -184320.0 (-> self y-offset) (-> self base y))) (set! (-> self grips transform trans y) (+ (- (+ (-> self base y) (-> self y-offset)) (-> self height)) (-> self y-offset-grips)) ) @@ -1140,7 +1122,7 @@ (periscope-draw-beam-impact) (periscope-update-joints) (ja-post) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) 0 (none) ) @@ -1278,10 +1260,10 @@ ) ) :enter (behavior () - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) ) :exit (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (logclear! (-> self draw status) (draw-status hidden)) ) :trans periscope-debug-trans @@ -1295,7 +1277,7 @@ (periscope-update-joints) (ja-post) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (logior! (-> self draw status) (draw-status hidden)) (loop (suspend) @@ -1349,7 +1331,7 @@ (suspend) ) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (set! (-> self y-offset) (-> self height)) (loop (if (periscope-has-power-input?) @@ -1379,7 +1361,7 @@ ) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) (let ((v0-0 (the-as object #t))) @@ -1451,7 +1433,7 @@ (vector-z-quaternion! s3-0 (-> self grips transform quat)) (set! (-> self grips-moving?) (< (vector-dot s4-0 s3-0) (cos 182.04445))) (periscope-update-joints) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (when (and (-> self player-touching-grips?) (not (level-hint-displayed?))) (set! (-> self player-touching-grips?) #f) (hide-hud) @@ -1749,7 +1731,7 @@ ;; definition for method 11 of type periscope ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! periscope ((this periscope) (arg0 entity-actor)) +(defmethod init-from-entity! ((this periscope) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) @@ -1788,13 +1770,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set! (-> this height) (res-lump-float (-> this entity) 'height-info)) (set! (-> this y-offset) (-> this height)) (set! (-> this y-offset-grips) (+ -20480.0 (-> this height))) - (set! (-> this base quad) (-> this root-override trans quad)) + (set! (-> this base quad) (-> this root trans quad)) (set! (-> this reflector-trans quad) (-> this base quad)) (+! (-> this reflector-trans y) (-> this height)) (set! (-> this reflector) (process-spawn reflector (-> this reflector-trans) :to this)) @@ -1804,7 +1786,7 @@ (set! (-> this part) (create-launch-control (-> *part-group-id-table* 176) this)) (set! (-> this part-aligned) (create-launch-control (-> *part-group-id-table* 689) this)) (set! (-> this grips) (new 'process 'joint-mod-set-world this 4 #t)) - (transformq-copy! (-> this grips transform) (the-as transformq (-> this root-override trans))) + (transformq-copy! (-> this grips transform) (the-as transformq (-> this root trans))) (periscope-find-reflection-angles) (set! (-> this turn) (-> this target-turn)) (set! (-> this tilt) (-> this target-tilt)) @@ -1816,8 +1798,8 @@ ) (set! (-> this rise-sound-id) (new-sound-id)) (set! (-> this grips-sound-id) (new-sound-id)) - (set! (-> this root-override nav-radius) 8192.0) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this root nav-radius) 8192.0) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (cond ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go periscope-power-on) @@ -1898,7 +1880,7 @@ ;; definition for method 11 of type reflector-origin ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! reflector-origin ((this reflector-origin) (arg0 entity-actor)) +(defmethod init-from-entity! ((this reflector-origin) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1924,14 +1906,14 @@ ) :code (behavior () (let ((gp-0 (new-stack-vector0))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (+! (-> gp-0 y) 49152.0) (loop (draw-power-beam gp-0 (-> self beam-end)) (update! (-> self sound)) (when (logtest? (-> self draw status) (draw-status was-drawn)) (launch-particles (-> *part-id-table* 825) (-> self beam-end)) - (when (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and *target* (>= 24576.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (start-hint-timer (text-id sidekick-hint-reflector-mirror)) (level-hint-spawn (text-id sidekick-hint-reflector-mirror) @@ -1953,7 +1935,7 @@ (defstate reflector-mirror-broken (reflector-mirror) :code (behavior ((arg0 symbol)) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (let ((s5-0 (entity-actor-count (-> self entity) 'alt-actor))) (dotimes (s4-0 s5-0) @@ -1979,8 +1961,7 @@ ) (when (not arg0) (ambient-hint-spawn "gamcam21" (the-as vector #f) *entity-pool* 'camera) - (let ((v1-11 (manipy-spawn (-> self root-override trans) (-> self entity) *reflector-mirror-break-sg* #f :to self)) - ) + (let ((v1-11 (manipy-spawn (-> self root trans) (-> self entity) *reflector-mirror-break-sg* #f :to self))) (send-event (ppointer->process v1-11) 'anim-mode 'play1) ) (let ((gp-2 (current-time))) @@ -2009,7 +1990,7 @@ ;; definition for method 11 of type reflector-mirror ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! reflector-mirror ((this reflector-mirror) (arg0 entity-actor)) +(defmethod init-from-entity! ((this reflector-mirror) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -2045,7 +2026,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc b/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc index 4891cd12e7f..79bedaba8d9 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc @@ -17,19 +17,15 @@ ;; definition of type logtrap (deftype logtrap (process-drawable) - ((root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) ) - :heap-base #x40 - :method-count-assert 21 - :size-assert #xb0 - :flag-assert #x15004000b0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type logtrap -(defmethod inspect logtrap ((this logtrap)) +(defmethod inspect ((this logtrap)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -65,7 +61,7 @@ (else (transform-post) (if *target* - (look-at-enemy! (-> *target* neck) (the-as vector (-> self root-override root-prim prim-core)) #f self) + (look-at-enemy! (-> *target* neck) (the-as vector (-> self root root-prim prim-core)) #f self) ) ) ) @@ -79,7 +75,7 @@ ;; definition for method 11 of type logtrap ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! logtrap ((this logtrap) (arg0 entity-actor)) +(defmethod init-from-entity! ((this logtrap) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -96,7 +92,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *logtrap-sg* '()) @@ -104,26 +100,22 @@ (new 'process 'shadow-control -5734.4 0.0 614400.0 (the-as float 1) 163840.0) ) (logclear! (-> this mask) (process-mask actor-pause)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go (method-of-object this idle)) (none) ) ;; definition of type towertop (deftype towertop (process-drawable) - ((root-override trsq :offset 112) + ((root-override trsq :overlay-at root) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states towertop-idle ) ) ;; definition for method 3 of type towertop -(defmethod inspect towertop ((this towertop)) +(defmethod inspect ((this towertop)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -152,7 +144,7 @@ ;; definition for method 11 of type towertop ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! towertop ((this towertop) (arg0 entity-actor)) +(defmethod init-from-entity! ((this towertop) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (set! (-> this root-override) (new 'process 'trsq)) (process-drawable-from-entity! this arg0) @@ -164,21 +156,17 @@ ;; definition of type lurkerm-tall-sail (deftype lurkerm-tall-sail (process-drawable) - ((root-override collide-shape-moving :offset 112) - (speed float :offset-assert 176) - (alt-actor entity-actor :offset-assert 180) + ((root collide-shape-moving :override) + (speed float) + (alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states lurkerm-tall-sail-idle ) ) ;; definition for method 3 of type lurkerm-tall-sail -(defmethod inspect lurkerm-tall-sail ((this lurkerm-tall-sail)) +(defmethod inspect ((this lurkerm-tall-sail)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -213,8 +201,8 @@ (ja-no-eval :group! lurkerm-tall-sail-idle-ja :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! - (-> self root-override quat) - (-> self root-override quat) + (-> self root quat) + (-> self root quat) (* 12743.111 (seconds-per-frame) (-> self speed)) ) (suspend) @@ -227,7 +215,7 @@ ;; definition for method 11 of type lurkerm-tall-sail ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lurkerm-tall-sail ((this lurkerm-tall-sail) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lurkerm-tall-sail) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -255,12 +243,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lurkerm-tall-sail-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (set! (-> this speed) 1.0) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) @@ -272,21 +260,17 @@ ;; definition of type lurkerm-short-sail (deftype lurkerm-short-sail (process-drawable) - ((root-override collide-shape-moving :offset 112) - (speed float :offset-assert 176) - (alt-actor entity-actor :offset-assert 180) + ((root collide-shape-moving :override) + (speed float) + (alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states lurkerm-short-sail-idle ) ) ;; definition for method 3 of type lurkerm-short-sail -(defmethod inspect lurkerm-short-sail ((this lurkerm-short-sail)) +(defmethod inspect ((this lurkerm-short-sail)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -317,8 +301,8 @@ (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek! max (* 0.5 (-> self speed))) :frame-num 0.0) (until (ja-done? 0) (quaternion-rotate-local-y! - (-> self root-override quat) - (-> self root-override quat) + (-> self root quat) + (-> self root quat) (* -12743.111 (seconds-per-frame) (-> self speed)) ) (suspend) @@ -331,7 +315,7 @@ ;; definition for method 11 of type lurkerm-short-sail ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lurkerm-short-sail ((this lurkerm-short-sail) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lurkerm-short-sail) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -376,12 +360,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lurkerm-short-sail-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (set! (-> this speed) 1.0) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) @@ -393,24 +377,20 @@ ;; definition of type lurkerm-piston (deftype lurkerm-piston (process-drawable) - ((root-override collide-shape-moving :offset 112) - (sync sync-info :inline :offset-assert 176) - (base vector :inline :offset-assert 192) - (height vector :inline :offset-assert 208) - (speed float :offset-assert 224) - (alt-actor entity-actor :offset-assert 228) + ((root collide-shape-moving :override) + (sync sync-info :inline) + (base vector :inline) + (height vector :inline) + (speed float) + (alt-actor entity-actor) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xe8 - :flag-assert #x14008000e8 (:states lurkerm-piston-idle ) ) ;; definition for method 3 of type lurkerm-piston -(defmethod inspect lurkerm-piston ((this lurkerm-piston)) +(defmethod inspect ((this lurkerm-piston)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -446,7 +426,7 @@ (let ((gp-0 (new-stack-vector0))) (set! (-> gp-0 quad) (-> self base quad)) (+! (-> gp-0 y) (* (get-current-value-with-mirror (-> self sync) (-> self height y)) (-> self speed))) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) (suspend) (ja :num! (seek! max (-> self speed))) @@ -459,7 +439,7 @@ ;; definition for method 11 of type lurkerm-piston ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lurkerm-piston ((this lurkerm-piston) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lurkerm-piston) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -480,14 +460,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton this *lurkerm-piston-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) - (set! (-> this base quad) (-> this root-override trans quad)) + (update-transforms! (-> this root)) + (set! (-> this base quad) (-> this root trans quad)) (let ((f30-0 (-> this base y))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-32 (res-lump-data arg0 'height-info pointer :tag-ptr (& sv-16)))) @@ -524,20 +504,16 @@ ;; definition of type accordian (deftype accordian (process-drawable) - ((speed float :offset-assert 176) - (alt-actor entity-actor :offset-assert 180) + ((speed float) + (alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states accordian-idle ) ) ;; definition for method 3 of type accordian -(defmethod inspect accordian ((this accordian)) +(defmethod inspect ((this accordian)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -578,7 +554,7 @@ ;; definition for method 11 of type accordian ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! accordian ((this accordian) (arg0 entity-actor)) +(defmethod init-from-entity! ((this accordian) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *accordian-sg* '()) @@ -601,13 +577,10 @@ ;; definition of type junglecam (deftype junglecam (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) ;; definition for method 3 of type junglecam -(defmethod inspect junglecam ((this junglecam)) +(defmethod inspect ((this junglecam)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -641,14 +614,10 @@ ;; definition of type precurbridgecam (deftype precurbridgecam (pov-camera) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) ;; definition for method 3 of type precurbridgecam -(defmethod inspect precurbridgecam ((this precurbridgecam)) +(defmethod inspect ((this precurbridgecam)) (let ((t9-0 (method-of-type pov-camera inspect))) (t9-0 this) ) @@ -679,29 +648,22 @@ ;; definition of type precurbridge-span (deftype precurbridge-span (structure) () - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) ;; definition for method 3 of type precurbridge-span -(defmethod inspect precurbridge-span ((this precurbridge-span)) +(defmethod inspect ((this precurbridge-span)) (format #t "[~8x] ~A~%" this 'precurbridge-span) this ) ;; definition of type precurbridge (deftype precurbridge (process-drawable) - ((root-override collide-shape-moving :offset 112) - (smush smush-control :inline :offset-assert 176) - (base vector :inline :offset-assert 208) - (activation-point vector :inline :offset-assert 224) - (span-array precurbridge-span 8 :offset-assert 240) + ((root collide-shape-moving :override) + (smush smush-control :inline) + (base vector :inline) + (activation-point vector :inline) + (span-array precurbridge-span 8) ) - :heap-base #xa0 - :method-count-assert 20 - :size-assert #x110 - :flag-assert #x1400a00110 (:states precurbridge-activate (precurbridge-active symbol) @@ -710,7 +672,7 @@ ) ;; definition for method 3 of type precurbridge -(defmethod inspect precurbridge ((this precurbridge)) +(defmethod inspect ((this precurbridge)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -798,7 +760,7 @@ :trans rider-trans :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root trans))) (ja-no-eval :group! precurbridge-idle-ja :num! (seek! max 0.25) :frame-num 0.0) (until (ja-done? 0) (if (rand-vu-percent? 0.1) @@ -819,7 +781,7 @@ (('bonk) (let* ((gp-0 (the-as object (-> block param 0))) (a0-2 (-> (the-as touching-shapes-entry gp-0) head)) - (s5-0 (-> self root-override)) + (s5-0 (-> self root)) ) (get-touched-prim a0-2 s5-0 (the-as touching-shapes-entry gp-0)) ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s5-0) @@ -836,14 +798,14 @@ (ja :group! precurbridge-float-ja :num! min) ) (ja-post) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (logior! (-> self mask) (process-mask actor-pause)) (loop (if (not (movie?)) (logior! (-> self mask) (process-mask platform)) ) (cond - ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + ((and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (when (not (ja-group? precurbridge-static-ja)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! precurbridge-static-ja :num! min) @@ -867,7 +829,7 @@ ;; definition for method 11 of type precurbridge ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! precurbridge ((this precurbridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this precurbridge) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -1031,16 +993,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set-vector! (-> this activation-point) 1765785.6 61440.0 -1279180.8 1.0) (initialize-skeleton this *precurbridge-sg* '()) (logior! (-> this skel status) (janim-status inited)) (ja-post) - (update-transforms! (-> this root-override)) - (set! (-> this base quad) (-> this root-override trans quad)) - (set! (-> this sound) (new 'process 'ambient-sound arg0 (-> this root-override trans))) + (update-transforms! (-> this root)) + (set! (-> this base quad) (-> this root trans quad)) + (set! (-> this sound) (new 'process 'ambient-sound arg0 (-> this root trans))) (cond ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1055,13 +1017,9 @@ ;; definition of type maindoor (deftype maindoor (process-drawable) - ((root-override collide-shape :offset 112) - (thresh vector :inline :offset-assert 176) + ((root collide-shape :override) + (thresh vector :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc0 - :flag-assert #x14005000c0 (:states (maindoor-closed symbol) (maindoor-open symbol) @@ -1069,7 +1027,7 @@ ) ;; definition for method 3 of type maindoor -(defmethod inspect maindoor ((this maindoor)) +(defmethod inspect ((this maindoor)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1092,20 +1050,20 @@ (ja :num-func num-func-identity :frame-num 0.0) ) (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (loop (when (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) (and (and *target* - (>= (-> self thresh w) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + (>= (-> self thresh w) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) - (sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans))) + (sound-play "blue-eco-on" :position (the-as symbol (-> self root trans))) (go maindoor-open #f) ) (if (and *target* - (>= (-> self thresh w) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + (>= (-> self thresh w) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (level-hint-spawn (text-id sidekick-hint-rounddoor) @@ -1116,8 +1074,8 @@ ) ) (when (ja-min? 0) - (set! (-> self root-override root-prim prim-core action) (collide-action solid)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> self root root-prim prim-core action) (collide-action solid)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) ) (ja :num! (seek! 0.0)) (ja-post) @@ -1135,8 +1093,8 @@ (if arg0 (ja :num-func num-func-identity :frame-num max) ) - (set! (-> self root-override root-prim prim-core action) (collide-action)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) + (set! (-> self root root-prim prim-core action) (collide-action)) + (set! (-> self root root-prim prim-core offense) (collide-offense no-offense)) (while (not (ja-max? 0)) (ja :num! (seek! max 2.0)) (if (and (not arg0) (rand-vu-percent? 0.2)) @@ -1154,7 +1112,7 @@ ;; definition for method 11 of type maindoor ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! maindoor ((this maindoor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this maindoor) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) @@ -1167,15 +1125,15 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *maindoor-sg* '()) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this thresh w) 61440.0) (if (or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (and (and *target* - (>= (-> this thresh w) (vector-vector-distance (-> this root-override trans) (-> *target* control trans))) + (>= (-> this thresh w) (vector-vector-distance (-> this root trans) (-> *target* control trans))) ) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) @@ -1189,14 +1147,10 @@ ;; definition of type sidedoor (deftype sidedoor (eco-door) () - :heap-base #xa0 - :method-count-assert 27 - :size-assert #x104 - :flag-assert #x1b00a00104 ) ;; definition for method 3 of type sidedoor -(defmethod inspect sidedoor ((this sidedoor)) +(defmethod inspect ((this sidedoor)) (let ((t9-0 (method-of-type eco-door inspect))) (t9-0 this) ) @@ -1211,7 +1165,7 @@ ;; definition for method 24 of type sidedoor ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-24 sidedoor ((this sidedoor)) +(defmethod eco-door-method-24 ((this sidedoor)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -1224,7 +1178,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1232,33 +1186,29 @@ ;; definition for method 25 of type sidedoor ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-25 sidedoor ((this sidedoor)) +(defmethod eco-door-method-25 ((this sidedoor)) (initialize-skeleton this *sidedoor-sg* '()) (set! (-> this open-distance) 22528.0) (set! (-> this close-distance) 61440.0) (set! (-> this speed) 6.0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) 0 (none) ) ;; definition of type jngpusher (deftype jngpusher (process-drawable) - ((root-override trsqv :offset 112) - (sync sync-info :inline :offset-assert 176) - (back-prim collide-shape-prim :offset-assert 184) + ((root trsqv :override) + (sync sync-info :inline) + (back-prim collide-shape-prim) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states jngpusher-idle ) ) ;; definition for method 3 of type jngpusher -(defmethod inspect jngpusher ((this jngpusher)) +(defmethod inspect ((this jngpusher)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1268,7 +1218,7 @@ ) ;; definition for method 7 of type jngpusher -(defmethod relocate jngpusher ((this jngpusher) (arg0 int)) +(defmethod relocate ((this jngpusher) (arg0 int)) (if (nonzero? (-> this back-prim)) (&+! (-> this back-prim) arg0) ) @@ -1305,7 +1255,7 @@ ;; definition for method 11 of type jngpusher ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! jngpusher ((this jngpusher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this jngpusher) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -1354,14 +1304,10 @@ ;; definition of type jungle-water (deftype jungle-water (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) ;; definition for method 3 of type jungle-water -(defmethod inspect jungle-water ((this jungle-water)) +(defmethod inspect ((this jungle-water)) (let ((t9-0 (method-of-type water-anim inspect))) (t9-0 this) ) @@ -1384,7 +1330,7 @@ ;; definition for method 22 of type jungle-water ;; INFO: Return type mismatch ripple-wave-set vs none. -(defmethod water-vol-method-22 jungle-water ((this jungle-water)) +(defmethod water-vol-method-22 ((this jungle-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/jungle-part_REF.gc b/test/decompiler/reference/jak1/levels/jungle/jungle-part_REF.gc index ede3de3dd4c..c46587fb8a4 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type jungle-part (deftype jungle-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type jungle-part -(defmethod inspect jungle-part ((this jungle-part)) +(defmethod inspect ((this jungle-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc b/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc index 038471d61da..f7d0c6a98b8 100644 --- a/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc @@ -4,14 +4,10 @@ ;; definition of type junglefish (deftype junglefish (nav-enemy) () - :heap-base #x120 - :method-count-assert 76 - :size-assert #x190 - :flag-assert #x4c01200190 ) ;; definition for method 3 of type junglefish -(defmethod inspect junglefish ((this junglefish)) +(defmethod inspect ((this junglefish)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -29,7 +25,7 @@ nav-enemy-default-event-handler ;; definition for method 39 of type junglefish ;; INFO: Return type mismatch int vs none. -(defmethod common-post junglefish ((this junglefish)) +(defmethod common-post ((this junglefish)) (water-control-method-10 (-> this water)) (call-parent-method this) 0 @@ -236,7 +232,7 @@ nav-enemy-default-event-handler ;; definition for method 11 of type junglefish ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! junglefish ((this junglefish) (arg0 entity-actor)) +(defmethod init-from-entity! ((this junglefish) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) diff --git a/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc b/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc index f992b423d48..84a65461a2e 100644 --- a/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc @@ -42,18 +42,15 @@ ;; definition of type junglesnake-twist-joint (deftype junglesnake-twist-joint (structure) - ((joint-index int32 :offset-assert 0) - (ry float :offset-assert 4) - (drag-delta-ry float :offset-assert 8) + ((joint-index int32) + (ry float) + (drag-delta-ry float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type junglesnake-twist-joint -(defmethod inspect junglesnake-twist-joint ((this junglesnake-twist-joint)) +(defmethod inspect ((this junglesnake-twist-joint)) (format #t "[~8x] ~A~%" this 'junglesnake-twist-joint) (format #t "~Tjoint-index: ~D~%" (-> this joint-index)) (format #t "~Try: ~f~%" (-> this ry)) @@ -63,17 +60,14 @@ ;; definition of type junglesnake-tilt-joint (deftype junglesnake-tilt-joint (structure) - ((joint-index int32 :offset-assert 0) - (flip-it symbol :offset-assert 4) + ((joint-index int32) + (flip-it symbol) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type junglesnake-tilt-joint -(defmethod inspect junglesnake-tilt-joint ((this junglesnake-tilt-joint)) +(defmethod inspect ((this junglesnake-tilt-joint)) (format #t "[~8x] ~A~%" this 'junglesnake-tilt-joint) (format #t "~Tjoint-index: ~D~%" (-> this joint-index)) (format #t "~Tflip-it: ~A~%" (-> this flip-it)) @@ -82,30 +76,26 @@ ;; definition of type junglesnake (deftype junglesnake (process-drawable) - ((root-override collide-shape :offset 112) - (state-time2 time-frame :offset-assert 176) - (hit-player symbol :offset 184) - (is-lethal? symbol :offset-assert 188) - (refractory-delay int32 :offset-assert 192) - (ry float :offset-assert 196) - (des-ry float :offset-assert 200) - (tilt float :offset-assert 204) - (des-tilt float :offset-assert 208) - (track-player-ry symbol :offset-assert 212) - (track-player-tilt symbol :offset-assert 216) - (twist-joints junglesnake-twist-joint 24 :inline :offset 220) - (tilt-joints junglesnake-tilt-joint 3 :inline :offset 604) + ((root collide-shape :override) + (state-time2 time-frame) + (hit-player symbol :offset 184) + (is-lethal? symbol) + (refractory-delay int32) + (ry float) + (des-ry float) + (tilt float) + (des-tilt float) + (track-player-ry symbol) + (track-player-tilt symbol) + (twist-joints junglesnake-twist-joint 24 :inline :offset 220) + (tilt-joints junglesnake-tilt-joint 3 :inline :offset 604) ) - :heap-base #x220 - :method-count-assert 25 - :size-assert #x28c - :flag-assert #x190220028c (:methods - (junglesnake-method-20 (_type_) symbol 20) - (junglesnake-method-21 (_type_) symbol 21) - (junglesnake-method-22 (_type_ float) symbol 22) - (junglesnake-method-23 (_type_) none 23) - (junglesnake-method-24 (_type_) none 24) + (junglesnake-method-20 (_type_) symbol) + (junglesnake-method-21 (_type_) symbol) + (junglesnake-method-22 (_type_ float) symbol) + (junglesnake-method-23 (_type_) none) + (junglesnake-method-24 (_type_) none) ) (:states junglesnake-attack @@ -118,7 +108,7 @@ ) ;; definition for method 3 of type junglesnake -(defmethod inspect junglesnake ((this junglesnake)) +(defmethod inspect ((this junglesnake)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -144,7 +134,7 @@ (('touch) (when (and *target* ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) ) @@ -163,7 +153,7 @@ ) ) (else - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) (send-event arg0 'shove @@ -184,12 +174,10 @@ junglesnake-default-event-handler ;; definition for method 20 of type junglesnake -(defmethod junglesnake-method-20 junglesnake ((this junglesnake)) +(defmethod junglesnake-method-20 ((this junglesnake)) (when (and *target* (-> this track-player-ry)) (let ((v1-3 (target-pos 0))) - (set! (-> this des-ry) - (atan (- (-> v1-3 x) (-> this root-override trans x)) (- (-> v1-3 z) (-> this root-override trans z))) - ) + (set! (-> this des-ry) (atan (- (-> v1-3 x) (-> this root trans x)) (- (-> v1-3 z) (-> this root trans z)))) ) ) (let ((f0-7 (deg-diff (-> this ry) (-> this des-ry)))) @@ -238,13 +226,7 @@ junglesnake-default-event-handler (s2-0 (new 'stack-no-clear 'matrix)) ) (let ((s1-0 (new 'stack-no-clear 'vector))) - (set-vector! - s1-0 - (-> arg0 root-override trans x) - (-> arg0 root-override trans y) - (-> arg0 root-override trans z) - 1.0 - ) + (set-vector! s1-0 (-> arg0 root trans x) (-> arg0 root trans y) (-> arg0 root trans z) 1.0) (matrix-translate! s2-0 s1-0) (vector-negate! s1-0 s1-0) (matrix-translate! s3-0 s1-0) @@ -377,9 +359,9 @@ junglesnake-default-event-handler :trans (behavior () (when *target* (let* ((a0-1 (target-pos 0)) - (f0-1 (- (-> a0-1 y) (-> self root-override trans y))) + (f0-1 (- (-> a0-1 y) (-> self root trans y))) ) - (if (and (>= 40960.0 f0-1) (>= 143360.0 (vector-vector-xz-distance a0-1 (-> self root-override trans)))) + (if (and (>= 40960.0 f0-1) (>= 143360.0 (vector-vector-xz-distance a0-1 (-> self root trans)))) (go junglesnake-wake) ) ) @@ -409,7 +391,7 @@ junglesnake-default-event-handler (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -436,7 +418,7 @@ junglesnake-default-event-handler (set! (-> self track-player-tilt) #t) ) :trans (behavior () - (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (time-elapsed? (-> self state-time) (-> self refractory-delay)) (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) @@ -447,8 +429,8 @@ junglesnake-default-event-handler ) (when *target* (let ((a0-8 (target-pos 0))) - (if (or (>= (- (-> a0-8 y) (-> self root-override trans y)) 57344.0) - (>= (vector-vector-xz-distance a0-8 (-> self root-override trans)) 163840.0) + (if (or (>= (- (-> a0-8 y) (-> self root trans y)) 57344.0) + (>= (vector-vector-xz-distance a0-8 (-> self root trans)) 163840.0) ) (go junglesnake-give-up) ) @@ -459,7 +441,7 @@ junglesnake-default-event-handler (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -504,7 +486,7 @@ junglesnake-default-event-handler (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -516,18 +498,16 @@ junglesnake-default-event-handler (set! (-> self track-player-tilt) #t) (ja-channel-push! 2 (seconds 0.15)) (junglesnake-method-23 self) - (let ((f30-0 (lerp-scale 0.0 1.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)) 0.0 24576.0)) - ) + (let ((f30-0 (lerp-scale 0.0 1.0 (vector-vector-distance (target-pos 0) (-> self root trans)) 0.0 24576.0))) (ja-no-eval :group! junglesnake-strike-close-ja :num! (seek! max 1.25) :frame-num 0.0) (ja-no-eval :chan 1 :group! junglesnake-strike-far-ja :num! (chan 0) :frame-interp f30-0 :frame-num 0.0) (until (ja-done? 0) (suspend) - (set! f30-0 - (seek - f30-0 - (lerp-scale 0.0 1.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)) 0.0 24576.0) - (* 2.0 (seconds-per-frame)) - ) + (set! f30-0 (seek + f30-0 + (lerp-scale 0.0 1.0 (vector-vector-distance (target-pos 0) (-> self root trans)) 0.0 24576.0) + (* 2.0 (seconds-per-frame)) + ) ) (ja :num! (seek! max 1.25)) (ja :chan 1 :num! (chan 0) :frame-interp f30-0) @@ -573,7 +553,7 @@ junglesnake-default-event-handler (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (set! (-> s5-0 quad) (-> gp-0 quad)) (+! (-> s5-0 y) 131072.0) (ja-no-eval :group! junglesnake-give-up-ja :num! (seek! max 0.5) :frame-num 0.0) @@ -583,17 +563,17 @@ junglesnake-default-event-handler (f0-7 (/ f0-6 (the float (+ (-> v1-18 data 0 length) -1)))) (s4-0 (new 'stack-no-clear 'vector)) ) - (set-vector! (-> self root-override scale) 1.0 (- 1.0 f0-7) 1.0 1.0) + (set-vector! (-> self root scale) 1.0 (- 1.0 f0-7) 1.0 1.0) (vector-lerp! s4-0 gp-0 s5-0 f0-7) - (move-to-point! (-> self root-override) s4-0) + (move-to-point! (-> self root) s4-0) ) (suspend) (ja :num! (seek! max 0.5)) ) ) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) - (set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (go junglesnake-sleeping) ) :post transform-post @@ -604,7 +584,7 @@ junglesnake-default-event-handler :event process-drawable-death-event-handler :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-channel-push! 1 (seconds 0.15)) (ja-no-eval :group! junglesnake-death-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -618,10 +598,10 @@ junglesnake-default-event-handler ;; definition for method 23 of type junglesnake ;; INFO: Return type mismatch int vs none. -(defmethod junglesnake-method-23 junglesnake ((this junglesnake)) +(defmethod junglesnake-method-23 ((this junglesnake)) (when (not (-> this is-lethal?)) (set! (-> this is-lethal?) #t) - (let ((v1-5 (-> (the-as collide-shape-prim-group (-> this root-override root-prim)) prims 0))) + (let ((v1-5 (-> (the-as collide-shape-prim-group (-> this root root-prim)) prims 0))) (logclear! (-> v1-5 prim-core action) (collide-action solid)) ) ) @@ -631,13 +611,13 @@ junglesnake-default-event-handler ;; definition for method 24 of type junglesnake ;; INFO: Return type mismatch int vs none. -(defmethod junglesnake-method-24 junglesnake ((this junglesnake)) +(defmethod junglesnake-method-24 ((this junglesnake)) (when (-> this is-lethal?) (set! (-> this is-lethal?) #f) - (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root-override root-prim)) prims 0))) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) prims 0))) (logior! (-> v1-4 prim-core action) (collide-action solid)) ) - (do-push-aways! (-> this root-override)) + (do-push-aways! (-> this root)) ) 0 (none) @@ -677,7 +657,7 @@ junglesnake-default-event-handler ) ;; definition for method 22 of type junglesnake -(defmethod junglesnake-method-22 junglesnake ((this junglesnake) (arg0 float)) +(defmethod junglesnake-method-22 ((this junglesnake) (arg0 float)) (let ((f0-0 0.0)) (dotimes (v1-0 24) (let ((a2-2 (-> this twist-joints v1-0))) @@ -694,7 +674,7 @@ junglesnake-default-event-handler ) ;; definition for method 21 of type junglesnake -(defmethod junglesnake-method-21 junglesnake ((this junglesnake)) +(defmethod junglesnake-method-21 ((this junglesnake)) (dotimes (v1-0 3) (let ((a1-2 (-> this tilt-joints v1-0))) (set! (-> a1-2 joint-index) (+ v1-0 23)) @@ -714,7 +694,7 @@ junglesnake-default-event-handler ;; definition for method 11 of type junglesnake ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! junglesnake ((this junglesnake) (arg0 entity-actor)) +(defmethod init-from-entity! ((this junglesnake) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) @@ -807,7 +787,7 @@ junglesnake-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *junglesnake-sg* '()) @@ -816,13 +796,13 @@ junglesnake-default-event-handler ) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 173) this)) (set! (-> this is-lethal?) #f) - (set! (-> this ry) (y-angle (-> this root-override))) + (set! (-> this ry) (y-angle (-> this root))) (set! (-> this des-ry) (-> this ry)) (set! (-> this tilt) 0.0) (set! (-> this des-tilt) (-> this tilt)) (set! (-> this track-player-ry) #f) (set! (-> this track-player-tilt) #f) - (quaternion-identity! (-> this root-override quat)) + (quaternion-identity! (-> this root quat)) (junglesnake-method-22 this (-> this ry)) (junglesnake-method-21 this) (logior! (-> this skel status) (janim-status inited)) diff --git a/test/decompiler/reference/jak1/levels/jungleb/aphid_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/aphid_REF.gc index 072911d7c47..91dcc4b1c12 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/aphid_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/aphid_REF.gc @@ -3,16 +3,12 @@ ;; definition of type aphid (deftype aphid (nav-enemy) - ((try int32 :offset-assert 400) + ((try int32) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x194 - :flag-assert #x4c01300194 ) ;; definition for method 3 of type aphid -(defmethod inspect aphid ((this aphid)) +(defmethod inspect ((this aphid)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -42,7 +38,7 @@ ) ;; definition for method 43 of type aphid -(defmethod attack-handler aphid ((this aphid) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this aphid) (arg0 process) (arg1 event-message-block)) (cond ((or (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf5)) (= arg0 (ppointer->process (-> this parent))) @@ -265,7 +261,7 @@ ;; definition for method 47 of type aphid ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision aphid ((this aphid)) +(defmethod initialize-collision ((this aphid)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -291,7 +287,7 @@ ;; definition for method 48 of type aphid ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 aphid ((this aphid)) +(defmethod nav-enemy-method-48 ((this aphid)) (initialize-skeleton this *aphid-sg* '()) (init-defaults! this *aphid-nav-enemy-info*) (set! (-> this neck up) (the-as uint 0)) diff --git a/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc index 1b2772485f5..896ba313c3a 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc @@ -3,14 +3,10 @@ ;; definition of type eggtop (deftype eggtop (process-drawable) - ((root-override collide-shape-moving :offset 112) - (cam-tracker handle :offset-assert 176) - (sound-id sound-id :offset-assert 184) + ((root collide-shape-moving :override) + (cam-tracker handle) + (sound-id sound-id) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states (eggtop-close symbol) eggtop-idle @@ -18,7 +14,7 @@ ) ;; definition for method 3 of type eggtop -(defmethod inspect eggtop ((this eggtop)) +(defmethod inspect ((this eggtop)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -210,12 +206,12 @@ (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) (go eggtop-close #f) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (sound-play "electric-loop" :id (-> self sound-id)) ) :code (behavior () (suspend) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (anim-loop) ) :post ja-post @@ -238,7 +234,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (set! (-> self cam-tracker) @@ -308,7 +304,7 @@ ;; definition for method 11 of type eggtop ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! eggtop ((this eggtop) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eggtop) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -327,12 +323,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *eggtop-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 189) this)) (set! (-> this sound-id) (new-sound-id)) (cond @@ -341,7 +337,7 @@ ) (else (birth-pickup-at-point - (vector+! (new 'stack-no-clear 'vector) (-> this root-override trans) (new 'static 'vector :y 6144.0 :w 1.0)) + (vector+! (new 'stack-no-clear 'vector) (-> this root trans) (new 'static 'vector :y 6144.0 :w 1.0)) (pickup-type fuel-cell) (the float (-> this entity extra perm task)) #f @@ -357,14 +353,10 @@ ;; definition of type jng-iris-door (deftype jng-iris-door (eco-door) () - :heap-base #xa0 - :method-count-assert 27 - :size-assert #x104 - :flag-assert #x1b00a00104 ) ;; definition for method 3 of type jng-iris-door -(defmethod inspect jng-iris-door ((this jng-iris-door)) +(defmethod inspect ((this jng-iris-door)) (let ((t9-0 (method-of-type eco-door inspect))) (t9-0 this) ) @@ -379,7 +371,7 @@ ;; definition for method 24 of type jng-iris-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-24 jng-iris-door ((this jng-iris-door)) +(defmethod eco-door-method-24 ((this jng-iris-door)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -392,7 +384,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -400,11 +392,11 @@ ;; definition for method 25 of type jng-iris-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-25 jng-iris-door ((this jng-iris-door)) +(defmethod eco-door-method-25 ((this jng-iris-door)) (initialize-skeleton this *jng-iris-door-sg* '()) (set! (-> this open-distance) 32768.0) (set! (-> this close-distance) 49152.0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) 0 (none) ) diff --git a/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc index 2c64c9b1750..816bf037cc4 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc @@ -3,31 +3,27 @@ ;; definition of type plant-boss (deftype plant-boss (process-drawable) - ((root-override collide-shape :offset 112) - (neck joint-mod :offset-assert 176) - (body joint-mod :offset-assert 180) - (leaf (pointer plant-boss-leaf) 2 :offset-assert 184) - (energy float :offset-assert 192) - (health float :offset-assert 196) - (ate symbol :offset-assert 200) - (cycle-count int32 :offset-assert 204) - (snap-count int32 :offset-assert 208) - (attack-prim collide-shape-prim-sphere 3 :offset-assert 212) - (death-prim collide-shape-prim-mesh 3 :offset-assert 224) - (cam-tracker handle :offset-assert 240) - (want-aphid-count int32 :offset-assert 248) - (aphid-count int32 :offset-assert 252) - (aphid-spawn-time time-frame :offset-assert 256) - (interp float :offset-assert 264) - (try int32 :offset-assert 268) - (camera handle :offset-assert 272) - (money handle :offset-assert 280) - (try-inc symbol :offset-assert 288) + ((root collide-shape :override) + (neck joint-mod) + (body joint-mod) + (leaf (pointer plant-boss-leaf) 2) + (energy float) + (health float) + (ate symbol) + (cycle-count int32) + (snap-count int32) + (attack-prim collide-shape-prim-sphere 3) + (death-prim collide-shape-prim-mesh 3) + (cam-tracker handle) + (want-aphid-count int32) + (aphid-count int32) + (aphid-spawn-time time-frame) + (interp float) + (try int32) + (camera handle) + (money handle) + (try-inc symbol) ) - :heap-base #xc0 - :method-count-assert 20 - :size-assert #x124 - :flag-assert #x1400c00124 (:states (plant-boss-attack int) (plant-boss-dead symbol) @@ -45,7 +41,7 @@ ) ;; definition for method 3 of type plant-boss -(defmethod inspect plant-boss ((this plant-boss)) +(defmethod inspect ((this plant-boss)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -72,7 +68,7 @@ ) ;; definition for method 7 of type plant-boss -(defmethod relocate plant-boss ((this plant-boss) (arg0 int)) +(defmethod relocate ((this plant-boss) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) @@ -92,14 +88,10 @@ ;; definition of type plant-boss-arm (deftype plant-boss-arm (process-drawable) - ((parent-override (pointer plant-boss) :offset 12) - (root-override collide-shape :offset 112) - (side int32 :offset-assert 176) + ((root collide-shape :override) + (parent-override (pointer plant-boss) :overlay-at parent) + (side int32) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states (plant-boss-arm-die symbol) (plant-boss-arm-hit basic) @@ -116,7 +108,7 @@ ) ;; definition for method 3 of type plant-boss-arm -(defmethod inspect plant-boss-arm ((this plant-boss-arm)) +(defmethod inspect ((this plant-boss-arm)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -126,15 +118,11 @@ ;; definition of type plant-boss-leaf (deftype plant-boss-leaf (process-drawable) - ((root-override collide-shape-moving :offset 112) - (side int32 :offset-assert 176) - (state-object symbol :offset-assert 180) - (state-time-frame time-frame :offset-assert 184) + ((root collide-shape-moving :override) + (side int32) + (state-object symbol) + (state-time-frame time-frame) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc0 - :flag-assert #x14005000c0 (:states plant-boss-leaf-bounce plant-boss-leaf-close @@ -146,7 +134,7 @@ ) ;; definition for method 3 of type plant-boss-leaf -(defmethod inspect plant-boss-leaf ((this plant-boss-leaf)) +(defmethod inspect ((this plant-boss-leaf)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -254,7 +242,7 @@ (('touch 'attack) (if (and ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) (not (ja-group? plant-boss-main-vulnerable2idle-ja)) @@ -331,8 +319,8 @@ ;; failed to figure out what this is: (defstate plant-boss-arm-die (plant-boss-arm) :code (behavior ((arg0 symbol)) - (let ((a0-1 (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0))) - (set! (-> self root-override root-prim local-sphere w) 81920.0) + (let ((a0-1 (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0))) + (set! (-> self root root-prim local-sphere w) 81920.0) (set! (-> (the-as collide-shape-prim-mesh a0-1) local-sphere w) 69632.0) (set! (-> (the-as collide-shape-prim-mesh a0-1) collide-with) (collide-kind target)) (set! (-> (the-as collide-shape-prim-mesh a0-1) prim-core collide-as) (collide-kind enemy)) @@ -383,11 +371,11 @@ (ja :group! plant-boss-arms-die-ja :num! max) ) ) - (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 1)) prim-core action) (collide-action)) + (set! (-> (find-prim-by-id (-> self root) (the-as uint 1)) prim-core action) (collide-action)) 0 - (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 2)) prim-core action) (collide-action)) + (set! (-> (find-prim-by-id (-> self root) (the-as uint 2)) prim-core action) (collide-action)) 0 - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (loop (logior! (-> self mask) (process-mask sleep)) (suspend) @@ -479,7 +467,7 @@ ) ) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja :group! plant-boss-back-arms-die-ja :num! max) (loop (suspend) @@ -589,7 +577,7 @@ (when (not arg0) (let ((gp-0 (current-time))) (until (time-elapsed? gp-0 (seconds 4)) - (+! (-> self root-override trans z) (* -4096.0 (seconds-per-frame))) + (+! (-> self root trans z) (* -4096.0 (seconds-per-frame))) (suspend) ) ) @@ -639,10 +627,10 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set-yaw-angle-clear-roll-pitch! (-> self root-override) arg1) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-yaw-angle-clear-roll-pitch! (-> self root) arg1) (set! (-> self side) arg2) (initialize-skeleton self *plant-boss-arm-sg* '()) (set! (-> self draw shadow-ctrl) *plant-boss-shadow-control*) @@ -682,10 +670,10 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set-yaw-angle-clear-roll-pitch! (-> self root-override) arg1) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-yaw-angle-clear-roll-pitch! (-> self root) arg1) (set! (-> self side) arg2) (initialize-skeleton self *plant-boss-back-arms-sg* '()) (set! (-> self draw shadow-ctrl) *plant-boss-shadow-control*) @@ -698,10 +686,10 @@ ;; INFO: Return type mismatch object vs none. (defbehavior plant-boss-vine-init plant-boss-arm ((arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) (stack-size-set! (-> self main-thread) 128) - (set! (-> self root-override) (the-as collide-shape (new 'process 'trsqv))) - (set-vector! (-> self root-override scale) arg2 arg2 arg2 1.0) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-zxy! (-> self root-override quat) arg1) + (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) + (set-vector! (-> self root scale) arg2 arg2 arg2 1.0) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-zxy! (-> self root quat) arg1) (set! (-> self side) arg3) (initialize-skeleton self *plant-boss-vine-sg* '()) (go plant-boss-vine-idle) @@ -713,10 +701,10 @@ ;; INFO: Return type mismatch object vs none. (defbehavior plant-boss-root-init plant-boss-arm ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 int)) (stack-size-set! (-> self main-thread) 128) - (set! (-> self root-override) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root-override scale quad) (-> arg2 quad)) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-zxy! (-> self root-override quat) arg1) + (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) + (set! (-> self root scale quad) (-> arg2 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-zxy! (-> self root quat) arg1) (set! (-> self side) arg3) (initialize-skeleton self *plant-boss-root-sg* '()) (go plant-boss-root-idle) @@ -977,10 +965,10 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set-yaw-angle-clear-roll-pitch! (-> self root-override) arg1) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-yaw-angle-clear-roll-pitch! (-> self root) arg1) (set! (-> self side) arg2) (initialize-skeleton self *plant-boss-leaf-sg* '()) (set! (-> self draw shadow-ctrl) *plant-boss-shadow-control*) @@ -1017,10 +1005,8 @@ (ja-no-eval :group! plant-boss-main-initial-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek! (-> self energy) (the-as float 0.25) (seconds-per-frame)) - (if (and (and *target* - (>= 245760.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) - (< (fabs (- (-> (target-pos 0) y) (-> self root-override trans y))) 40960.0) + (if (and (and *target* (>= 245760.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (< (fabs (- (-> (target-pos 0) y) (-> self root trans y))) 40960.0) ) (go plant-boss-intro) ) @@ -1132,7 +1118,7 @@ (set! (-> self neck flex-blend) 1.0) ) :trans (behavior () - (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) + (let ((f30-0 (vector-vector-distance (target-pos 0) (-> self root trans)))) (if (< 409600.0 f30-0) (go plant-boss-far-idle) ) @@ -1257,7 +1243,7 @@ ) ) :trans (behavior () - (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) + (let ((f0-0 (vector-vector-distance (target-pos 0) (-> self root trans)))) (if (< 409600.0 f0-0) (go plant-boss-far-idle) ) @@ -1281,7 +1267,7 @@ ) ) ((time-elapsed? (-> self aphid-spawn-time) (seconds 1.4)) - (when (process-spawn aphid self (-> self root-override trans) (target-pos 0) :to self) + (when (process-spawn aphid self (-> self root trans) (target-pos 0) :to self) (+! (-> self aphid-count) 1) (seekl! (-> self want-aphid-count) 0 1) (set-time! (-> self aphid-spawn-time)) @@ -1300,7 +1286,7 @@ (('attack) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) (send-event @@ -1397,7 +1383,7 @@ (('touch 'attack) (when (and ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) (not (ja-group? plant-boss-main-vulnerable2idle-ja)) @@ -1435,7 +1421,7 @@ (let ((f30-0 (lerp-scale (the-as float 0.0) (the-as float 1.0) - (vector-vector-distance (target-pos 0) (-> self root-override trans)) + (vector-vector-distance (target-pos 0) (-> self root trans)) (the-as float 26624.0) (the-as float 86016.0) ) @@ -1449,7 +1435,7 @@ (lerp-scale (the-as float 1.0) (the-as float 0.0) - (vector-vector-distance (target-pos 0) (-> self root-override trans)) + (vector-vector-distance (target-pos 0) (-> self root trans)) (the-as float 26624.0) (the-as float 86016.0) ) @@ -1722,9 +1708,9 @@ (set! (-> self death-prim 1 collide-with) (collide-kind target)) (set! (-> self death-prim 1 prim-core offense) (collide-offense indestructible)) (logior! (-> self death-prim 1 prim-core action) (collide-action solid)) - (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 8)) prim-core action) (collide-action)) + (set! (-> (find-prim-by-id (-> self root) (the-as uint 8)) prim-core action) (collide-action)) 0 - (set! (-> (find-prim-by-id (-> self root-override) (the-as uint 16)) prim-core action) (collide-action)) + (set! (-> (find-prim-by-id (-> self root) (the-as uint 16)) prim-core action) (collide-action)) 0 (logior! (-> self mask) (process-mask actor-pause)) (remove-setting! 'music) @@ -1732,7 +1718,7 @@ ) :post (behavior () (plant-boss-post) - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) ) ) @@ -1761,7 +1747,7 @@ (let ((gp-1 (current-time))) (until (time-elapsed? gp-1 (seconds 5)) (transform-post) - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) (suspend) ) ) @@ -1807,7 +1793,7 @@ ;; definition for method 11 of type plant-boss ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! plant-boss ((this plant-boss) (arg0 entity-actor)) +(defmethod init-from-entity! ((this plant-boss) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) @@ -1863,7 +1849,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *plant-boss-sg* '()) @@ -1871,11 +1857,7 @@ (process-spawn plant-boss-arm :init plant-boss-arm-init - (vector+! - (new-stack-vector0) - (-> this root-override trans) - (new 'static 'vector :x -24576.0 :z 8192.0 :w 1.0) - ) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x -24576.0 :z 8192.0 :w 1.0)) -8192.0 1 :to this @@ -1883,7 +1865,7 @@ (process-spawn plant-boss-arm :init plant-boss-arm-init - (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :x 24576.0 :z 8192.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x 24576.0 :z 8192.0 :w 1.0)) 8192.0 0 :to this @@ -1891,7 +1873,7 @@ (process-spawn plant-boss-arm :init plant-boss-back-arms-init - (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :w 1.0)) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :w 1.0)) 0.0 2 :to this @@ -1899,7 +1881,7 @@ (process-spawn plant-boss-arm :init plant-boss-vine-init - (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :x 38912.0 :z 8192.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x 38912.0 :z 8192.0 :w 1.0)) (new 'static 'vector :y 14563.556) 1.0 3 @@ -1908,11 +1890,7 @@ (process-spawn plant-boss-arm :init plant-boss-vine-init - (vector+! - (new-stack-vector0) - (-> this root-override trans) - (new 'static 'vector :x -40960.0 :z 8192.0 :w 1.0) - ) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x -40960.0 :z 8192.0 :w 1.0)) (new 'static 'vector :y -5461.3335) 1.0 3 @@ -1921,11 +1899,7 @@ (process-spawn plant-boss-arm :init plant-boss-vine-init - (vector+! - (new-stack-vector0) - (-> this root-override trans) - (new 'static 'vector :x -29491.2 :z -7168.0 :w 1.0) - ) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x -29491.2 :z -7168.0 :w 1.0)) (new 'static 'vector :x -1820.4445 :y -11286.756) 0.8 3 @@ -1934,11 +1908,7 @@ (process-spawn plant-boss-arm :init plant-boss-vine-init - (vector+! - (new-stack-vector0) - (-> this root-override trans) - (new 'static 'vector :x 32768.0 :z -3072.0 :w 1.0) - ) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x 32768.0 :z -3072.0 :w 1.0)) (new 'static 'vector :x -910.2222 :y 22755.555) 0.8 3 @@ -1947,7 +1917,7 @@ (process-spawn plant-boss-arm :init plant-boss-root-init - (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :x 18841.6 :z 4096.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x 18841.6 :z 4096.0 :w 1.0)) (new 'static 'vector :y -4096.0) (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) 4 @@ -1956,11 +1926,7 @@ (process-spawn plant-boss-arm :init plant-boss-root-init - (vector+! - (new-stack-vector0) - (-> this root-override trans) - (new 'static 'vector :x -18841.6 :z 4096.0 :w 1.0) - ) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :x -18841.6 :z 4096.0 :w 1.0)) (new 'static 'vector :x 364.0889 :y 4096.0) (new 'static 'vector :x 1.0 :y 1.25 :z 1.0) 4 @@ -1969,28 +1935,27 @@ (process-spawn plant-boss-arm :init plant-boss-root-init - (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :z -2048.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :z -2048.0 :w 1.0)) (new 'static 'vector :x 1820.4445) (new 'static 'vector :x 0.9 :y 1.5 :z 1.0) 4 :to this ) - (set! (-> this leaf 0) - (process-spawn - plant-boss-leaf - :init plant-boss-leaf-init - (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :w 1.0)) - 0.0 - 0 - :to this - ) + (set! (-> this leaf 0) (process-spawn + plant-boss-leaf + :init plant-boss-leaf-init + (vector+! (new-stack-vector0) (-> this root trans) (new 'static 'vector :w 1.0)) + 0.0 + 0 + :to this + ) ) (set! (-> this leaf 1) (process-spawn plant-boss-leaf :init plant-boss-leaf-init (vector+! (new-stack-vector0) - (-> this root-override trans) + (-> this root trans) (new 'static 'vector :x -13189.12 :y 2838.528 :z 12288.0 :w 1.0) ) 0.0 diff --git a/test/decompiler/reference/jak1/levels/jungleb/plat-flip_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/plat-flip_REF.gc index 941fc9386c2..5648f43f8f7 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/plat-flip_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/plat-flip_REF.gc @@ -3,28 +3,24 @@ ;; definition of type plat-flip (deftype plat-flip (process-drawable) - ((root-override collide-shape-moving :offset 112) - (path-pos float :offset-assert 176) - (before-turn-down-time float :offset-assert 180) - (turn-down-time float :offset-assert 184) - (before-turn-up-time float :offset-assert 188) - (turn-up-time float :offset-assert 192) - (total-time float :offset-assert 196) - (sync sync-info :inline :offset-assert 200) - (base-pos vector :inline :offset-assert 208) - (smush smush-control :inline :offset-assert 224) + ((root collide-shape-moving :override) + (path-pos float) + (before-turn-down-time float) + (turn-down-time float) + (before-turn-up-time float) + (turn-up-time float) + (total-time float) + (sync sync-info :inline) + (base-pos vector :inline) + (smush smush-control :inline) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #x100 - :flag-assert #x1400900100 (:states plat-flip-idle ) ) ;; definition for method 3 of type plat-flip -(defmethod inspect plat-flip ((this plat-flip)) +(defmethod inspect ((this plat-flip)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -105,7 +101,7 @@ (let ((s5-5 (new 'stack-no-clear 'vector))) (set! (-> s5-5 quad) (-> self base-pos quad)) (+! (-> s5-5 y) (* 1638.4 (update! (-> self smush)))) - (move-to-point! (-> self root-override) s5-5) + (move-to-point! (-> self root) s5-5) ) (suspend) ) @@ -117,7 +113,7 @@ ;; definition for method 11 of type plat-flip ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! plat-flip ((this plat-flip) (arg0 entity-actor)) +(defmethod init-from-entity! ((this plat-flip) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -138,10 +134,10 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (set! (-> this base-pos quad) (-> this root-override trans quad)) + (set! (-> this base-pos quad) (-> this root trans quad)) (initialize-skeleton this *plat-flip-sg* '()) (logior! (-> this skel status) (janim-status inited)) (let ((f30-0 300.0)) @@ -192,7 +188,7 @@ ) ) ) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go plat-flip-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/lavatube/assistant-lavatube_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/assistant-lavatube_REF.gc index 6a4c4139fb8..5ff50eee9e4 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/assistant-lavatube_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/assistant-lavatube_REF.gc @@ -4,14 +4,10 @@ ;; definition of type assistant-lavatube-start (deftype assistant-lavatube-start (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type assistant-lavatube-start -(defmethod inspect assistant-lavatube-start ((this assistant-lavatube-start)) +(defmethod inspect ((this assistant-lavatube-start)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -26,7 +22,7 @@ ) ;; definition for method 32 of type assistant-lavatube-start -(defmethod play-anim! assistant-lavatube-start ((this assistant-lavatube-start) (arg0 symbol)) +(defmethod play-anim! ((this assistant-lavatube-start) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (if arg0 @@ -54,7 +50,7 @@ ) ;; definition for method 31 of type assistant-lavatube-start -(defmethod get-art-elem assistant-lavatube-start ((this assistant-lavatube-start)) +(defmethod get-art-elem ((this assistant-lavatube-start)) (-> this draw art-group data 3) ) @@ -64,7 +60,7 @@ :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) (when (and (cond - ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + ((and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) #t ) (else @@ -146,13 +142,13 @@ ) ;; definition for method 39 of type assistant-lavatube-start -(defmethod should-display? assistant-lavatube-start ((this assistant-lavatube-start)) +(defmethod should-display? ((this assistant-lavatube-start)) (first-any (-> this tasks) #t) (= (current-status (-> this tasks)) (task-status need-reward-speech)) ) ;; definition for method 11 of type assistant-lavatube-start -(defmethod init-from-entity! assistant-lavatube-start ((this assistant-lavatube-start) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant-lavatube-start) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-lavatube-start-sg* 3 29 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task lavatube-start))) (first-any (-> this tasks) #t) diff --git a/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc index 12ead6386d5..4784d04398f 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc @@ -371,13 +371,9 @@ ;; definition of type energydoor (deftype energydoor (process-drawable) - ((root-override collide-shape-moving :offset 112) - (alt-actor entity-actor :offset-assert 176) + ((root collide-shape-moving :override) + (alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states energydoor-closed-till-near energydoor-closed-till-task @@ -388,7 +384,7 @@ ) ;; definition for method 3 of type energydoor -(defmethod inspect energydoor ((this energydoor)) +(defmethod inspect ((this energydoor)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -407,8 +403,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'matrix)) ) - (vector-! gp-0 (target-pos 0) (-> self root-override trans)) - (quaternion->matrix s5-0 (-> self root-override quat)) + (vector-! gp-0 (target-pos 0) (-> self root trans)) + (quaternion->matrix s5-0 (-> self root quat)) (vector-dot gp-0 (the-as vector (-> s5-0 vector))) ) ) @@ -565,7 +561,7 @@ ;; definition for method 11 of type energydoor ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! energydoor ((this energydoor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this energydoor) (arg0 entity-actor)) (with-pp (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -584,11 +580,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *energydoor-sg* '()) - (set! (-> this root-override pause-adjust-distance) 245760.0) + (set! (-> this root pause-adjust-distance) 245760.0) (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) (cond ((< (energydoor-player-dist) -409600.0) @@ -632,10 +628,6 @@ ;; definition of type energybase (deftype energybase (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states energybase-idle energybase-stopped @@ -644,7 +636,7 @@ ) ;; definition for method 3 of type energybase -(defmethod inspect energybase ((this energybase)) +(defmethod inspect ((this energybase)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -713,7 +705,7 @@ ;; definition for method 11 of type energybase ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! energybase ((this energybase) (arg0 entity-actor)) +(defmethod init-from-entity! ((this energybase) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *energybase-sg* '()) @@ -726,21 +718,17 @@ ;; definition of type energyhub (deftype energyhub (process-drawable) - ((self-override energyhub :offset 28) - (alts entity-actor 3 :offset-assert 176) - (arm handle 5 :offset-assert 192) - (rot-mat matrix :inline :offset-assert 240) - (rot-mat-init matrix :inline :offset-assert 304) - (rotation-speed oscillating-float :inline :offset-assert 368) - (rotation-speed-offset delayed-rand-float :inline :offset-assert 392) - (y-rotation float :offset-assert 420) - (x-rotation float :offset-assert 424) - (palette-val float :offset-assert 428) + ((self-override energyhub :overlay-at self) + (alts entity-actor 3) + (arm handle 5) + (rot-mat matrix :inline) + (rot-mat-init matrix :inline) + (rotation-speed oscillating-float :inline) + (rotation-speed-offset delayed-rand-float :inline) + (y-rotation float) + (x-rotation float) + (palette-val float) ) - :heap-base #x140 - :method-count-assert 20 - :size-assert #x1b0 - :flag-assert #x14014001b0 (:states energyhub-idle energyhub-stop @@ -749,7 +737,7 @@ ) ;; definition for method 3 of type energyhub -(defmethod inspect energyhub ((this energyhub)) +(defmethod inspect ((this energyhub)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -767,23 +755,19 @@ ;; definition of type energyarm (deftype energyarm (process-drawable) - ((parent-overide (pointer energyhub) :offset 12) - (self-override energyarm :offset 28) - (root-override collide-shape-moving :offset 112) - (offset vector :inline :offset-assert 176) - (y-rotation float :offset-assert 192) - (y-chatter-rotation bouncing-float :inline :offset-assert 196) - (y-chatter-min delayed-rand-float :inline :offset-assert 240) - (x-rotation bouncing-float :inline :offset-assert 268) - (x-fall-rotation bouncing-float :inline :offset-assert 308) - (rot-mat matrix :inline :offset-assert 352) - (ball handle :offset-assert 416) - (x-correction float :offset-assert 424) + ((root collide-shape-moving :override) + (parent-overide (pointer energyhub) :overlay-at parent) + (self-override energyarm :overlay-at self) + (offset vector :inline) + (y-rotation float) + (y-chatter-rotation bouncing-float :inline) + (y-chatter-min delayed-rand-float :inline) + (x-rotation bouncing-float :inline) + (x-fall-rotation bouncing-float :inline) + (rot-mat matrix :inline) + (ball handle) + (x-correction float) ) - :heap-base #x140 - :method-count-assert 20 - :size-assert #x1ac - :flag-assert #x14014001ac (:states energyarm-fall energyarm-idle @@ -793,7 +777,7 @@ ) ;; definition for method 3 of type energyarm -(defmethod inspect energyarm ((this energyarm)) +(defmethod inspect ((this energyarm)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -811,20 +795,16 @@ ;; definition of type energyball (deftype energyball (process-drawable) - ((parent-overide (pointer energyarm) :offset 12) - (root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) + (parent-overide (pointer energyarm) :overlay-at parent) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states energyball-idle ) ) ;; definition for method 3 of type energyball -(defmethod inspect energyball ((this energyball)) +(defmethod inspect ((this energyball)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -853,7 +833,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (cleanup-for-death self) @@ -864,7 +844,7 @@ ) :trans (behavior () (rider-trans) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (let* ((v1-3 (-> self parent-overide)) (s5-0 (if v1-3 (-> v1-3 0 self-override) @@ -882,10 +862,10 @@ (when gp-0 (set-vector! s4-0 0.0 -61440.0 -106496.0 1.0) (vector-matrix*! s4-0 s4-0 (-> gp-0 rot-mat)) - (vector+! (-> self root-override trans) s4-0 (-> gp-0 root-override trans)) + (vector+! (-> self root trans) s4-0 (-> gp-0 root trans)) (matrix-rotate-y! s5-1 (* -436.90668 f30-0)) (matrix*! s5-1 s5-1 (-> gp-0 rot-mat)) - (matrix->quaternion (-> self root-override quat) s5-1) + (matrix->quaternion (-> self root quat) s5-1) ) ) ) @@ -920,7 +900,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> arg0 root-override) s5-0) + (set! (-> arg0 root) s5-0) s5-0 ) ) @@ -930,7 +910,7 @@ ;; INFO: Return type mismatch object vs none. (defbehavior energyball-init-by-other energyball ((arg0 vector)) (energyball-init self) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root trans quad) (-> arg0 quad)) (initialize-skeleton self *energyball-sg* '()) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 545) self)) (go energyball-idle) @@ -975,9 +955,9 @@ (set-vector! gp-1 0.0 0.0 -81920.0 1.0) (vector-matrix*! (-> self draw bounds) gp-1 (-> self rot-mat)) (set! (-> self draw bounds w) 69632.0) - (matrix->quaternion (-> self root-override quat) (-> self rot-mat)) + (matrix->quaternion (-> self root quat) (-> self rot-mat)) (vector-matrix*! gp-1 (-> self offset) (-> s5-0 rot-mat)) - (vector+! (-> self root-override trans) (-> s5-0 root trans) gp-1) + (vector+! (-> self root trans) (-> s5-0 root trans) gp-1) ) ) ) @@ -1176,7 +1156,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> arg0 root-override) s5-0) + (set! (-> arg0 root) s5-0) ) (let ((v0-5 (create-launch-control (-> *part-group-id-table* 544) arg0))) (set! (-> arg0 part) v0-5) @@ -1200,7 +1180,7 @@ ) ) (if a0-3 - (set! (-> self root-override trans quad) (-> a0-3 root trans quad)) + (set! (-> self root trans quad) (-> a0-3 root trans quad)) ) ) (initialize-skeleton self *energyarm-sg* '()) @@ -1218,7 +1198,7 @@ (go energyarm-stop) ) (else - (set! (-> self ball) (ppointer->handle (process-spawn energyball (-> self root-override trans) :to self))) + (set! (-> self ball) (ppointer->handle (process-spawn energyball (-> self root trans) :to self))) (go energyarm-idle) ) ) @@ -1470,7 +1450,7 @@ ;; definition for method 11 of type energyhub ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! energyhub ((this energyhub) (arg0 entity-actor)) +(defmethod init-from-entity! ((this energyhub) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *energyhub-sg* '()) @@ -1514,19 +1494,14 @@ ;; definition of type energylava (deftype energylava (process-drawable) - ((root-override basic :offset 112) - ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 + () (:states energylava-idle ) ) ;; definition for method 3 of type energylava -(defmethod inspect energylava ((this energylava)) +(defmethod inspect ((this energylava)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1552,7 +1527,7 @@ ;; definition for method 11 of type energylava ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! energylava ((this energylava) (arg0 entity-actor)) +(defmethod init-from-entity! ((this energylava) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *energylava-sg* '()) diff --git a/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc index 448ceb4e460..1a8a5f2d118 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc @@ -4,17 +4,13 @@ ;; definition of type lavabase (deftype lavabase (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states lavabase-idle ) ) ;; definition for method 3 of type lavabase -(defmethod inspect lavabase ((this lavabase)) +(defmethod inspect ((this lavabase)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -44,7 +40,7 @@ ;; definition for method 11 of type lavabase ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavabase ((this lavabase) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavabase) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavabase-sg* '()) @@ -55,17 +51,13 @@ ;; definition of type lavafall (deftype lavafall (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states lavafall-idle ) ) ;; definition for method 3 of type lavafall -(defmethod inspect lavafall ((this lavafall)) +(defmethod inspect ((this lavafall)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -95,7 +87,7 @@ ;; definition for method 11 of type lavafall ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavafall ((this lavafall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavafall) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavafall-sg* '()) @@ -106,17 +98,13 @@ ;; definition of type lavashortcut (deftype lavashortcut (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states lavashortcut-idle ) ) ;; definition for method 3 of type lavashortcut -(defmethod inspect lavashortcut ((this lavashortcut)) +(defmethod inspect ((this lavashortcut)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -146,7 +134,7 @@ ;; definition for method 11 of type lavashortcut ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavashortcut ((this lavashortcut) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavashortcut) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavashortcut-sg* '()) @@ -383,16 +371,13 @@ ;; definition of type darkecobarrel-leak (deftype darkecobarrel-leak (structure) - ((offset vector :inline :offset-assert 0) - (first-frame basic :offset-assert 16) + ((offset vector :inline) + (first-frame basic) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type darkecobarrel-leak -(defmethod inspect darkecobarrel-leak ((this darkecobarrel-leak)) +(defmethod inspect ((this darkecobarrel-leak)) (format #t "[~8x] ~A~%" this 'darkecobarrel-leak) (format #t "~Toffset: #~%" (-> this offset)) (format #t "~Tfirst-frame: ~A~%" (-> this first-frame)) @@ -401,18 +386,14 @@ ;; definition of type darkecobarrel-base (deftype darkecobarrel-base (process-drawable) - ((root-override collide-shape-moving :offset 112) - (speed float :offset-assert 176) - (sync time-frame :offset-assert 184) + ((root collide-shape-moving :override) + (speed float) + (sync time-frame) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc0 - :flag-assert #x14005000c0 ) ;; definition for method 3 of type darkecobarrel-base -(defmethod inspect darkecobarrel-base ((this darkecobarrel-base)) +(defmethod inspect ((this darkecobarrel-base)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -423,18 +404,14 @@ ;; definition of type darkecobarrel-mover (deftype darkecobarrel-mover (darkecobarrel-base) - ((start-time time-frame :offset-assert 192) - (hits int32 :offset-assert 200) - (leak darkecobarrel-leak 1 :inline :offset-assert 208) - (y-offset bouncing-float :inline :offset-assert 240) - (y-offset-tgt delayed-rand-float :inline :offset-assert 280) - (down oscillating-vector :inline :offset-assert 320) - (down-tgt delayed-rand-vector :inline :offset-assert 384) + ((start-time time-frame) + (hits int32) + (leak darkecobarrel-leak 1 :inline) + (y-offset bouncing-float :inline) + (y-offset-tgt delayed-rand-float :inline) + (down oscillating-vector :inline) + (down-tgt delayed-rand-vector :inline) ) - :heap-base #x140 - :method-count-assert 20 - :size-assert #x1b0 - :flag-assert #x14014001b0 (:states darkecobarrel-mover-die darkecobarrel-mover-move @@ -442,7 +419,7 @@ ) ;; definition for method 3 of type darkecobarrel-mover -(defmethod inspect darkecobarrel-mover ((this darkecobarrel-mover)) +(defmethod inspect ((this darkecobarrel-mover)) (let ((t9-0 (method-of-type darkecobarrel-base inspect))) (t9-0 this) ) @@ -458,21 +435,17 @@ ;; definition of type darkecobarrel (deftype darkecobarrel (darkecobarrel-base) - ((self-override darkecobarrel :offset 28) - (spawn-array (array int64) :offset-assert 192) - (cur-spawn int32 :offset-assert 196) + ((self-override darkecobarrel :overlay-at self) + (spawn-array (array int64)) + (cur-spawn int32) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xc8 - :flag-assert #x14006000c8 (:states darkecobarrel-spawner ) ) ;; definition for method 3 of type darkecobarrel -(defmethod inspect darkecobarrel ((this darkecobarrel)) +(defmethod inspect ((this darkecobarrel)) (let ((t9-0 (method-of-type darkecobarrel-base inspect))) (t9-0 this) ) @@ -482,7 +455,7 @@ ) ;; definition for method 7 of type darkecobarrel -(defmethod relocate darkecobarrel ((this darkecobarrel) (arg0 int)) +(defmethod relocate ((this darkecobarrel) (arg0 int)) (if (nonzero? (-> this spawn-array)) (&+! (-> this spawn-array) arg0) ) @@ -533,9 +506,9 @@ (if (darkecobarrel-base-done? f30-0) (deactivate self) ) - (eval-path-curve! (-> self path) (-> self root-override trans) f30-0 'interp) - (+! (-> self root-override trans y) (* 4096.0 (-> self y-offset osc value))) - (+! (-> self root-override trans y) -4096.0) + (eval-path-curve! (-> self path) (-> self root trans) f30-0 'interp) + (+! (-> self root trans y) (* 4096.0 (-> self y-offset osc value))) + (+! (-> self root trans y) -4096.0) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'matrix)) ) @@ -546,7 +519,7 @@ (vector-normalize! s4-0 1.0) (forward-down-nopitch->inv-matrix gp-0 s5-0 s4-0) ) - (matrix->quaternion (-> self root-override quat) gp-0) + (matrix->quaternion (-> self root quat) gp-0) (dotimes (s5-1 (-> self hits)) (when (-> self leak s5-1 first-frame) (set! (-> self leak s5-1 first-frame) #f) @@ -557,13 +530,13 @@ ) (let ((s4-2 (new 'stack-no-clear 'vector))) (vector-matrix*! s4-2 (the-as vector (-> self leak s5-1)) gp-0) - (vector+! s4-2 s4-2 (-> self root-override trans)) + (vector+! s4-2 s4-2 (-> self root trans)) (spawn (-> self part) s4-2) ) ) ) ) - (if (< (vector-vector-xz-distance-squared (-> self root-override trans) (camera-pos)) 1073741800.0) + (if (< (vector-vector-xz-distance-squared (-> self root trans) (camera-pos)) 1073741800.0) (logior! (-> self draw status) (draw-status skip-bones)) (set! (-> self draw status) (the-as draw-status (logclear (-> self draw status) (draw-status skip-bones)))) ) @@ -574,11 +547,11 @@ (defstate darkecobarrel-mover-die (darkecobarrel-mover) :code (behavior () (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (sound-play "dcrate-break") (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root-override trans quad)) + (set! (-> gp-1 quad) (-> self root trans quad)) (+! (-> gp-1 y) -49152.0) (process-spawn part-tracker @@ -613,7 +586,7 @@ (if (and s5-0 ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry s5-0) - (-> self root-override) + (-> self root) (the-as uint 1) ) (send-event proc 'attack-invinc s5-0 (static-attack-info ((mode 'death)))) @@ -640,7 +613,7 @@ (set! (-> self leak (+ (-> self hits) -1) first-frame) #t) (cond (v1-17 - (vector-! gp-1 (-> (the-as process-drawable v1-17) root trans) (-> self root-override trans)) + (vector-! gp-1 (-> (the-as process-drawable v1-17) root trans) (-> self root trans)) (set! (-> self leak (+ (-> self hits) -1) offset quad) (-> gp-1 quad)) (vector-normalize! gp-1 -0.04) (let ((v0-0 (the-as object (-> self down vel)))) @@ -649,7 +622,7 @@ ) ) (else - (set! (-> self leak (+ (-> self hits) -1) offset quad) (-> self root-override trans quad)) + (set! (-> self leak (+ (-> self hits) -1) offset quad) (-> self root trans quad)) (set! (-> self leak (+ (-> self hits) -1) offset y) (+ -49152.0 (-> self leak (+ (-> self hits) -1) offset y)) ) @@ -728,7 +701,7 @@ ) (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) (backup-collide-with-as s2-0) - (set! (-> self root-override) s2-0) + (set! (-> self root) s2-0) ) (darkecobarrel-base-init arg0) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 540) self)) @@ -802,12 +775,12 @@ ;; definition for method 11 of type darkecobarrel ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! darkecobarrel ((this darkecobarrel) (arg0 entity-actor)) +(defmethod init-from-entity! ((this darkecobarrel) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> this root-override) (the-as collide-shape-moving (new 'process 'trsqv))) + (set! (-> this root) (the-as collide-shape-moving (new 'process 'trsqv))) (darkecobarrel-base-init arg0) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "lav-dark-eco" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "lav-dark-eco" :fo-max 30) (-> this root trans)) ) (logior! (-> this draw status) (draw-status hidden)) (set! (-> this speed) (/ 300.0 (res-lump-float (-> this entity) 'speed :default 61440.0))) @@ -870,17 +843,13 @@ ;; definition of type lavafallsewera (deftype lavafallsewera (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states lavafallsewera-idle ) ) ;; definition for method 3 of type lavafallsewera -(defmethod inspect lavafallsewera ((this lavafallsewera)) +(defmethod inspect ((this lavafallsewera)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -909,7 +878,7 @@ ;; definition for method 11 of type lavafallsewera ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavafallsewera ((this lavafallsewera) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavafallsewera) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavafallsewera-sg* '()) @@ -920,17 +889,13 @@ ;; definition of type lavafallsewerb (deftype lavafallsewerb (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states lavafallsewerb-idle ) ) ;; definition for method 3 of type lavafallsewerb -(defmethod inspect lavafallsewerb ((this lavafallsewerb)) +(defmethod inspect ((this lavafallsewerb)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -959,7 +924,7 @@ ;; definition for method 11 of type lavafallsewerb ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavafallsewerb ((this lavafallsewerb) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavafallsewerb) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavafallsewerb-sg* '()) @@ -969,20 +934,16 @@ ;; definition of type chainmine (deftype chainmine (process-drawable) - ((root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) ) - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 - (:methods - (die () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + die + idle ) ) ;; definition for method 3 of type chainmine -(defmethod inspect chainmine ((this chainmine)) +(defmethod inspect ((this chainmine)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1138,11 +1099,11 @@ :virtual #t :code (behavior () (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (sound-play "dcrate-break") (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root-override trans quad)) + (set! (-> gp-1 quad) (-> self root trans quad)) (+! (-> gp-1 y) -73728.0) (process-spawn part-tracker @@ -1194,7 +1155,7 @@ ;; definition for method 11 of type chainmine ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! chainmine ((this chainmine) (arg0 entity-actor)) +(defmethod init-from-entity! ((this chainmine) (arg0 entity-actor)) (logior! (-> this mask) (process-mask attackable)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -1213,12 +1174,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *chainmine-sg* '()) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "lava-mine-chain" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "lava-mine-chain" :fo-max 30) (-> this root trans)) ) (go (method-of-object this idle)) (none) @@ -1232,21 +1193,17 @@ ;; definition of type lavaballoon (deftype lavaballoon (process-drawable) - ((root-override collide-shape :offset 112) - (move-per-tick float :offset-assert 176) + ((root collide-shape :override) + (move-per-tick float) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xb4 - :flag-assert #x16005000b4 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) ;; definition for method 3 of type lavaballoon -(defmethod inspect lavaballoon ((this lavaballoon)) +(defmethod inspect ((this lavaballoon)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1330,7 +1287,7 @@ :virtual #t :code (behavior () (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (sound-play "cool-balloon") (process-spawn @@ -1341,7 +1298,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (suspend) @@ -1364,7 +1321,7 @@ :trans (behavior () (when (not (logtest? (-> self path flags) (path-control-flag not-found))) (let ((f0-4 (* 0.5 (+ 1.0 (sin (* (-> self move-per-tick) (the float (current-time)))))))) - (eval-path-curve! (-> self path) (-> self root-override trans) f0-4 'interp) + (eval-path-curve! (-> self path) (-> self root trans) f0-4 'interp) ) ) ) @@ -1382,7 +1339,7 @@ ;; definition for method 11 of type lavaballoon ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavaballoon ((this lavaballoon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavaballoon) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -1393,12 +1350,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavaballoon-sg* '()) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 543) this)) - (set! (-> this root-override pause-adjust-distance) 122880.0) + (set! (-> this root pause-adjust-distance) 122880.0) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (when (not (logtest? (-> this path flags) (path-control-flag not-found))) @@ -1413,14 +1370,10 @@ ;; definition of type lavatube-lava (deftype lavatube-lava (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) ;; definition for method 3 of type lavatube-lava -(defmethod inspect lavatube-lava ((this lavatube-lava)) +(defmethod inspect ((this lavatube-lava)) (let ((t9-0 (method-of-type water-anim inspect))) (t9-0 this) ) @@ -1455,7 +1408,7 @@ ;; definition for method 22 of type lavatube-lava ;; INFO: Return type mismatch symbol vs none. -(defmethod water-vol-method-22 lavatube-lava ((this lavatube-lava)) +(defmethod water-vol-method-22 ((this lavatube-lava)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) @@ -1473,17 +1426,13 @@ ;; definition of type lavayellowtarp (deftype lavayellowtarp (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states lavayellowtarp-idle ) ) ;; definition for method 3 of type lavayellowtarp -(defmethod inspect lavayellowtarp ((this lavayellowtarp)) +(defmethod inspect ((this lavayellowtarp)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1512,7 +1461,7 @@ ;; definition for method 11 of type lavayellowtarp ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavayellowtarp ((this lavayellowtarp) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lavayellowtarp) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lavayellowtarp-sg* '()) diff --git a/test/decompiler/reference/jak1/levels/lavatube/lavatube-part_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/lavatube-part_REF.gc index 735f9dc33c7..3368fb180c3 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/lavatube-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/lavatube-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type lavatube-part (deftype lavatube-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type lavatube-part -(defmethod inspect lavatube-part ((this lavatube-part)) +(defmethod inspect ((this lavatube-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc b/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc index 5b9b1ab03a9..617886fc1b4 100644 --- a/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc @@ -3,26 +3,23 @@ ;; definition of type baby-spider-spawn-params (deftype baby-spider-spawn-params (structure) - ((hatched? symbol :offset-assert 0) - (fast-start? symbol :offset-assert 4) - (hack-move-above-ground? symbol :offset-assert 8) - (die-if-not-visible? symbol :offset-assert 12) - (pickup int32 :offset-assert 16) - (pickup-amount int32 :offset-assert 20) - (event-death symbol :offset-assert 24) - (delay-before-dying-if-not-visible time-frame :offset-assert 32) + ((hatched? symbol) + (fast-start? symbol) + (hack-move-above-ground? symbol) + (die-if-not-visible? symbol) + (pickup int32) + (pickup-amount int32) + (event-death symbol) + (delay-before-dying-if-not-visible time-frame) ) - :method-count-assert 11 - :size-assert #x28 - :flag-assert #xb00000028 (:methods - (init! (_type_ symbol symbol symbol symbol int int symbol) none 9) - (set-delay! (_type_ time-frame) none 10) + (init! (_type_ symbol symbol symbol symbol int int symbol) none) + (set-delay! (_type_ time-frame) none) ) ) ;; definition for method 3 of type baby-spider-spawn-params -(defmethod inspect baby-spider-spawn-params ((this baby-spider-spawn-params)) +(defmethod inspect ((this baby-spider-spawn-params)) (format #t "[~8x] ~A~%" this 'baby-spider-spawn-params) (format #t "~Thatched?: ~A~%" (-> this hatched?)) (format #t "~Tfast-start?: ~A~%" (-> this fast-start?)) @@ -37,27 +34,23 @@ ;; definition of type baby-spider (deftype baby-spider (nav-enemy) - ((die-if-not-visible? symbol :offset-assert 400) - (hack-move-above-ground? symbol :offset-assert 404) - (state-float float :offset-assert 408) - (wiggle-angle float :offset-assert 412) - (delta-wiggle-angle float :offset-assert 416) - (wiggle-factor float :offset-assert 420) - (event-death symbol :offset-assert 424) - (delay-before-dying-if-not-visible time-frame :offset-assert 432) - (chase-rest-time time-frame :offset-assert 440) - (target-nav-time time-frame :offset-assert 448) - (unknown00 basic :offset-assert 456) - (unknown01 basic :offset-assert 460) - (wiggle-time time-frame :offset-assert 464) - (last-visible-time time-frame :offset-assert 472) - (up-vector vector :inline :offset-assert 480) - (state-vector vector :inline :offset-assert 496) + ((die-if-not-visible? symbol) + (hack-move-above-ground? symbol) + (state-float float) + (wiggle-angle float) + (delta-wiggle-angle float) + (wiggle-factor float) + (event-death symbol) + (delay-before-dying-if-not-visible time-frame) + (chase-rest-time time-frame) + (target-nav-time time-frame) + (unknown00 basic) + (unknown01 basic) + (wiggle-time time-frame) + (last-visible-time time-frame) + (up-vector vector :inline) + (state-vector vector :inline) ) - :heap-base #x190 - :method-count-assert 76 - :size-assert #x200 - :flag-assert #x4c01900200 (:states baby-spider-die-fast baby-spider-hatching @@ -66,7 +59,7 @@ ) ;; definition for method 3 of type baby-spider -(defmethod inspect baby-spider ((this baby-spider)) +(defmethod inspect ((this baby-spider)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -205,15 +198,15 @@ ;; definition for method 9 of type baby-spider-spawn-params ;; INFO: Return type mismatch int vs none. -(defmethod init! baby-spider-spawn-params ((this baby-spider-spawn-params) - (arg0 symbol) - (arg1 symbol) - (arg2 symbol) - (arg3 symbol) - (arg4 int) - (arg5 int) - (arg6 symbol) - ) +(defmethod init! ((this baby-spider-spawn-params) + (arg0 symbol) + (arg1 symbol) + (arg2 symbol) + (arg3 symbol) + (arg4 int) + (arg5 int) + (arg6 symbol) + ) (set! (-> this hatched?) arg0) (set! (-> this fast-start?) arg1) (set! (-> this die-if-not-visible?) arg2) @@ -227,13 +220,13 @@ ;; definition for method 10 of type baby-spider-spawn-params ;; INFO: Return type mismatch time-frame vs none. -(defmethod set-delay! baby-spider-spawn-params ((this baby-spider-spawn-params) (arg0 time-frame)) +(defmethod set-delay! ((this baby-spider-spawn-params) (arg0 time-frame)) (set! (-> this delay-before-dying-if-not-visible) arg0) (none) ) ;; definition for method 44 of type baby-spider -(defmethod touch-handler baby-spider ((this baby-spider) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this baby-spider) (arg0 process) (arg1 event-message-block)) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) (-> this collide-info) @@ -262,7 +255,7 @@ baby-spider-default-event-handler ;; definition for method 39 of type baby-spider ;; INFO: Used lq/sq -(defmethod common-post baby-spider ((this baby-spider)) +(defmethod common-post ((this baby-spider)) (when (logtest? (-> this collide-info status) (cshape-moving-flags onsurf)) (vector-deg-seek (-> this up-vector) (-> this up-vector) (-> this collide-info surface-normal) 910.2222) (vector-normalize! (-> this up-vector) 1.0) @@ -277,7 +270,7 @@ baby-spider-default-event-handler ) ;; definition for method 38 of type baby-spider -(defmethod nav-enemy-method-38 baby-spider ((this baby-spider)) +(defmethod nav-enemy-method-38 ((this baby-spider)) (integrate-for-enemy-with-move-to-ground! (-> this collide-info) (-> this collide-info transv) @@ -292,7 +285,7 @@ baby-spider-default-event-handler ;; definition for method 51 of type baby-spider ;; INFO: Return type mismatch float vs none. -(defmethod nav-enemy-method-51 baby-spider ((this baby-spider)) +(defmethod nav-enemy-method-51 ((this baby-spider)) (let* ((f0-0 (rand-vu-float-range 0.0 1.0)) (f1-1 (+ 1.0 (* 2.0 f0-0))) (f2-2 f1-1) @@ -309,7 +302,7 @@ baby-spider-default-event-handler ;; definition for method 52 of type baby-spider ;; INFO: Used lq/sq ;; INFO: Return type mismatch vector vs symbol. -(defmethod nav-enemy-method-52 baby-spider ((this baby-spider) (arg0 vector)) +(defmethod nav-enemy-method-52 ((this baby-spider) (arg0 vector)) (+! (-> this wiggle-angle) (-> this delta-wiggle-angle)) (if (< 65536.0 (-> this wiggle-angle)) (+! (-> this wiggle-angle) -65536.0) @@ -328,7 +321,7 @@ baby-spider-default-event-handler ) ;; definition for method 53 of type baby-spider -(defmethod nav-enemy-method-53 baby-spider ((this baby-spider)) +(defmethod nav-enemy-method-53 ((this baby-spider)) (cond ((logtest? (-> this draw status) (draw-status was-drawn)) (set-time! (-> this last-visible-time)) @@ -691,7 +684,7 @@ baby-spider-default-event-handler ;; definition for method 47 of type baby-spider ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision baby-spider ((this baby-spider)) +(defmethod initialize-collision ((this baby-spider)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -717,7 +710,7 @@ baby-spider-default-event-handler ;; definition for method 48 of type baby-spider ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 baby-spider ((this baby-spider)) +(defmethod nav-enemy-method-48 ((this baby-spider)) (set-time! (-> this last-visible-time)) (initialize-skeleton this *baby-spider-sg* '()) (if (= (-> this parent 0 type) cave-trap) @@ -784,7 +777,7 @@ baby-spider-default-event-handler ;; definition for method 11 of type baby-spider ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! baby-spider ((this baby-spider) (arg0 entity-actor)) +(defmethod init-from-entity! ((this baby-spider) (arg0 entity-actor)) (set! (-> this die-if-not-visible?) #f) (set! (-> this delay-before-dying-if-not-visible) (seconds 2)) (set! (-> this hack-move-above-ground?) #f) diff --git a/test/decompiler/reference/jak1/levels/maincave/cavecrystal-light_REF.gc b/test/decompiler/reference/jak1/levels/maincave/cavecrystal-light_REF.gc index 5d29a8e32a3..c3e4ae6b8e4 100644 --- a/test/decompiler/reference/jak1/levels/maincave/cavecrystal-light_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/cavecrystal-light_REF.gc @@ -6,21 +6,18 @@ ;; definition of type cavecrystal-light (deftype cavecrystal-light (structure) - ((next cavecrystal-light :offset-assert 0) - (crystal-id int32 :offset-assert 4) - (intensity float :offset-assert 8) - (fade-start float :offset-assert 12) - (fade-end float :offset-assert 16) - (crystal-handle handle :offset-assert 24) - (trans vector :inline :offset-assert 32) + ((next cavecrystal-light) + (crystal-id int32) + (intensity float) + (fade-start float) + (fade-end float) + (crystal-handle handle) + (trans vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type cavecrystal-light -(defmethod inspect cavecrystal-light ((this cavecrystal-light)) +(defmethod inspect ((this cavecrystal-light)) (format #t "[~8x] ~A~%" this 'cavecrystal-light) (format #t "~Tnext: #~%" (-> this next)) (format #t "~Tcrystal-id: ~D~%" (-> this crystal-id)) @@ -34,26 +31,23 @@ ;; definition of type cavecrystal-light-control (deftype cavecrystal-light-control (basic) - ((active-count int32 :offset-assert 4) - (head cavecrystal-light :offset-assert 8) - (last-known-valid-time time-frame :offset-assert 16) - (crystal cavecrystal-light 7 :inline :offset-assert 32) + ((active-count int32) + (head cavecrystal-light) + (last-known-valid-time time-frame) + (crystal cavecrystal-light 7 :inline) ) - :method-count-assert 15 - :size-assert #x170 - :flag-assert #xf00000170 (:methods - (cavecrystal-light-control-method-9 (_type_ int float process-drawable) none 9) - (cavecrystal-light-control-method-10 (_type_ vector) float 10) - (inc-intensities! (_type_) none 11) - (cavecrystal-light-control-method-12 (_type_) none 12) - (create-connection! (_type_ process-drawable res-lump (function object object object object object) int float) connection 13) - (execute-connections (_type_) int 14) + (cavecrystal-light-control-method-9 (_type_ int float process-drawable) none) + (cavecrystal-light-control-method-10 (_type_ vector) float) + (inc-intensities! (_type_) none) + (cavecrystal-light-control-method-12 (_type_) none) + (create-connection! (_type_ process-drawable res-lump (function object object object object object) int float) connection) + (execute-connections (_type_) int) ) ) ;; definition for method 3 of type cavecrystal-light-control -(defmethod inspect cavecrystal-light-control ((this cavecrystal-light-control)) +(defmethod inspect ((this cavecrystal-light-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tactive-count: ~D~%" (-> this active-count)) (format #t "~Thead: #~%" (-> this head)) @@ -88,26 +82,26 @@ ) ;; definition for method 13 of type cavecrystal-light-control -(defmethod create-connection! cavecrystal-light-control ((this cavecrystal-light-control) - (arg0 process-drawable) - (arg1 res-lump) - (arg2 (function object object object object object)) - (arg3 int) - (arg4 float) - ) +(defmethod create-connection! ((this cavecrystal-light-control) + (arg0 process-drawable) + (arg1 res-lump) + (arg2 (function object object object object object)) + (arg3 int) + (arg4 float) + ) (if (nonzero? (res-lump-value arg1 'crystal-light uint128)) (add-connection *cavecrystal-engine* arg0 arg2 (process->ppointer arg0) arg3 arg4) ) ) ;; definition for method 14 of type cavecrystal-light-control -(defmethod execute-connections cavecrystal-light-control ((this cavecrystal-light-control)) +(defmethod execute-connections ((this cavecrystal-light-control)) (execute-connections *cavecrystal-engine* #f) ) ;; definition for method 12 of type cavecrystal-light-control ;; INFO: Return type mismatch symbol vs none. -(defmethod cavecrystal-light-control-method-12 cavecrystal-light-control ((this cavecrystal-light-control)) +(defmethod cavecrystal-light-control-method-12 ((this cavecrystal-light-control)) (let ((v1-0 (-> this last-known-valid-time)) (a1-1 (current-time)) ) @@ -164,7 +158,7 @@ ;; definition for method 11 of type cavecrystal-light-control ;; INFO: Return type mismatch int vs none. -(defmethod inc-intensities! cavecrystal-light-control ((this cavecrystal-light-control)) +(defmethod inc-intensities! ((this cavecrystal-light-control)) (set! (-> this head) #f) (let ((a1-0 (the-as cavecrystal-light #f)) (v0-0 0) @@ -191,7 +185,7 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. ;; WARN: Function (method 9 cavecrystal-light-control) has a return type of none, but the expression builder found a return statement. -(defmethod cavecrystal-light-control-method-9 cavecrystal-light-control ((this cavecrystal-light-control) (arg0 int) (arg1 float) (arg2 process-drawable)) +(defmethod cavecrystal-light-control-method-9 ((this cavecrystal-light-control) (arg0 int) (arg1 float) (arg2 process-drawable)) (cavecrystal-light-control-method-12 this) (when (or (< arg0 0) (>= arg0 7)) (format 0 "ERROR: Bogus cavecrystal id!~%") @@ -221,7 +215,7 @@ ) ;; definition for method 10 of type cavecrystal-light-control -(defmethod cavecrystal-light-control-method-10 cavecrystal-light-control ((this cavecrystal-light-control) (arg0 vector)) +(defmethod cavecrystal-light-control-method-10 ((this cavecrystal-light-control) (arg0 vector)) (cavecrystal-light-control-method-12 this) (let ((s5-1 (-> this head)) (f30-0 0.0) diff --git a/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc b/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc index 3bca115787b..cfb87e9399a 100644 --- a/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc @@ -3,22 +3,18 @@ ;; definition of type dark-crystal (deftype dark-crystal (process-drawable) - ((root-override collide-shape :offset 112) - (crystal-num int32 :offset-assert 176) - (underwater? symbol :offset-assert 180) - (explode-danger-radius float :offset-assert 184) - (lit-color-mult vector :inline :offset-assert 192) - (lit-color-emissive vector :inline :offset-assert 208) - (unlit-color-mult vector :inline :offset-assert 224) - (unlit-color-emissive vector :inline :offset-assert 240) + ((root collide-shape :override) + (crystal-num int32) + (underwater? symbol) + (explode-danger-radius float) + (lit-color-mult vector :inline) + (lit-color-emissive vector :inline) + (unlit-color-mult vector :inline) + (unlit-color-emissive vector :inline) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x100 - :flag-assert #x1600900100 (:methods - (dark-crystal-method-20 (_type_) none 20) - (dark-crystal-method-21 (_type_) symbol 21) + (dark-crystal-method-20 (_type_) none) + (dark-crystal-method-21 (_type_) symbol) ) (:states dark-crystal-activate @@ -29,7 +25,7 @@ ) ;; definition for method 3 of type dark-crystal -(defmethod inspect dark-crystal ((this dark-crystal)) +(defmethod inspect ((this dark-crystal)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -497,7 +493,7 @@ :code (behavior () (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (let ((gp-0 (new 'stack 'joint-exploder-tuning 0))) (when (-> self underwater?) (set! (-> gp-0 duration) (seconds 4)) @@ -530,7 +526,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (let ((s5-4 (current-time))) @@ -554,7 +550,7 @@ :event process-drawable-fuel-cell-handler :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (level-hint-spawn (text-id cave-dark-crystals-resolution) "sksp0327" @@ -567,7 +563,7 @@ (logior! (-> self draw status) (draw-status hidden)) (if (not (task-complete? *game-info* (-> self entity extra perm task))) (birth-pickup-at-point - (-> self root-override trans) + (-> self root trans) (pickup-type fuel-cell) (the float (-> self entity extra perm task)) #t @@ -587,13 +583,13 @@ ;; definition for method 20 of type dark-crystal ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod dark-crystal-method-20 dark-crystal ((this dark-crystal)) +(defmethod dark-crystal-method-20 ((this dark-crystal)) (when *target* (let ((s5-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> this root-override trans quad)) + (set! (-> s5-0 quad) (-> this root trans quad)) (+! (-> s5-0 y) 6144.0) (set! (-> s3-0 quad) (-> (target-pos 0) quad)) (+! (-> s3-0 y) 6144.0) @@ -622,7 +618,7 @@ ) ;; definition for method 21 of type dark-crystal -(defmethod dark-crystal-method-21 dark-crystal ((this dark-crystal)) +(defmethod dark-crystal-method-21 ((this dark-crystal)) (let ((s5-0 #f)) (when (nonzero? (-> this crystal-num)) (let* ((s4-0 (get-task-control (game-task cave-dark-crystals))) @@ -642,7 +638,7 @@ ;; definition for method 11 of type dark-crystal ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! dark-crystal ((this dark-crystal) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dark-crystal) (arg0 entity-actor)) (set-vector! (-> this unlit-color-mult) 0.5 0.5 0.5 1.0) (set-vector! (-> this unlit-color-emissive) 0.0 0.0 0.0 0.0) (set-vector! (-> this lit-color-mult) 1.0 1.0 1.0 1.0) @@ -660,7 +656,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *dark-crystal-sg* '()) @@ -670,7 +666,7 @@ (set! (-> this underwater?) (= (res-lump-value arg0 'mode uint128) 1)) (set! (-> this explode-danger-radius) (res-lump-float arg0 'extra-radius :default 28672.0)) (set! (-> this crystal-num) (res-lump-value arg0 'extra-id int)) - (set-vector! (-> this root-override scale) 2.0 2.0 2.0 1.0) + (set-vector! (-> this root scale) 2.0 2.0 2.0 1.0) (ja-channel-push! 1 0) (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! @@ -681,7 +677,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go dark-crystal-spawn-fuel-cell) (go dark-crystal-idle) diff --git a/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc b/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc index 2159eb21f97..561a3e15007 100644 --- a/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc @@ -3,45 +3,41 @@ ;; definition of type driller-lurker (deftype driller-lurker (process-drawable) - ((root-overeride collide-shape-moving :offset 112) - (hit-player? symbol :offset-assert 176) - (played-drill-sound? symbol :offset-assert 180) - (mode uint64 :offset-assert 184) - (path-u float :offset-assert 192) - (path-units-per-meter float :offset-assert 196) - (path-speed float :offset-assert 200) - (targ-path-speed float :offset-assert 204) - (path-dir float :offset-assert 208) - (path-ry float :offset-assert 212) - (facing-ry float :offset-assert 216) - (drill-rz float :offset-assert 220) - (drill-speed float :offset-assert 224) - (up-blend float :offset-assert 228) - (player-path-u float :offset-assert 232) - (ambient-drilling-u float :offset-assert 236) - (timeout int32 :offset-assert 240) - (neck joint-mod :offset-assert 244) - (drill joint-mod :offset-assert 248) - (sound2 ambient-sound :offset-assert 252) - (last-update-time time-frame :offset-assert 256) - (last-player-path-u-time time-frame :offset-assert 264) - (started-chasing-time time-frame :offset-assert 272) - (hit-player-time time-frame :offset-assert 280) - (player-attack-id uint64 :offset-assert 288) + ((root-overeride collide-shape-moving :overlay-at root) + (hit-player? symbol) + (played-drill-sound? symbol) + (mode uint64) + (path-u float) + (path-units-per-meter float) + (path-speed float) + (targ-path-speed float) + (path-dir float) + (path-ry float) + (facing-ry float) + (drill-rz float) + (drill-speed float) + (up-blend float) + (player-path-u float) + (ambient-drilling-u float) + (timeout int32) + (neck joint-mod) + (drill joint-mod) + (sound2 ambient-sound) + (last-update-time time-frame) + (last-player-path-u-time time-frame) + (started-chasing-time time-frame) + (hit-player-time time-frame) + (player-attack-id uint64) ) - :heap-base #xc0 - :method-count-assert 28 - :size-assert #x128 - :flag-assert #x1c00c00128 (:methods - (driller-lurker-method-20 (_type_ symbol target) symbol 20) - (driller-lurker-method-21 (_type_) none 21) - (driller-lurker-method-22 (_type_) none 22) - (driller-lurker-method-23 (_type_) float 23) - (driller-lurker-method-24 (_type_) symbol 24) - (driller-lurker-method-25 (_type_) symbol 25) - (driller-lurker-method-26 (_type_) symbol 26) - (driller-lurker-method-27 (_type_) object 27) + (driller-lurker-method-20 (_type_ symbol target) symbol) + (driller-lurker-method-21 (_type_) none) + (driller-lurker-method-22 (_type_) none) + (driller-lurker-method-23 (_type_) float) + (driller-lurker-method-24 (_type_) symbol) + (driller-lurker-method-25 (_type_) symbol) + (driller-lurker-method-26 (_type_) symbol) + (driller-lurker-method-27 (_type_) object) ) (:states driller-lurker-attack @@ -56,7 +52,7 @@ ) ;; definition for method 3 of type driller-lurker -(defmethod inspect driller-lurker ((this driller-lurker)) +(defmethod inspect ((this driller-lurker)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -352,7 +348,7 @@ ;; definition for method 20 of type driller-lurker ;; INFO: Used lq/sq -(defmethod driller-lurker-method-20 driller-lurker ((this driller-lurker) (arg0 symbol) (arg1 target)) +(defmethod driller-lurker-method-20 ((this driller-lurker) (arg0 symbol) (arg1 target)) (let ((v1-1 (current-time))) (when (!= v1-1 (-> this last-update-time)) (set! (-> this last-update-time) v1-1) @@ -552,7 +548,7 @@ ) ;; definition for method 23 of type driller-lurker -(defmethod driller-lurker-method-23 driller-lurker ((this driller-lurker)) +(defmethod driller-lurker-method-23 ((this driller-lurker)) (let ((v1-1 (current-time))) (when (!= v1-1 (-> this last-player-path-u-time)) (set! (-> this last-player-path-u-time) v1-1) @@ -575,7 +571,7 @@ ) ;; definition for method 25 of type driller-lurker -(defmethod driller-lurker-method-25 driller-lurker ((this driller-lurker)) +(defmethod driller-lurker-method-25 ((this driller-lurker)) (when *target* (let* ((s5-0 (target-pos 0)) (f0-1 (- (-> s5-0 y) (-> this root-overeride trans y))) @@ -607,7 +603,7 @@ ) ;; definition for method 26 of type driller-lurker -(defmethod driller-lurker-method-26 driller-lurker ((this driller-lurker)) +(defmethod driller-lurker-method-26 ((this driller-lurker)) (when *target* (let* ((a1-0 (target-pos 0)) (f0-1 (- (-> a1-0 y) (-> this root-overeride trans y))) @@ -624,7 +620,7 @@ ) ;; definition for method 24 of type driller-lurker -(defmethod driller-lurker-method-24 driller-lurker ((this driller-lurker)) +(defmethod driller-lurker-method-24 ((this driller-lurker)) (when *target* (let* ((a1-0 (target-pos 0)) (f0-1 (- (-> a1-0 y) (-> this root-overeride trans y))) @@ -653,7 +649,7 @@ ) ;; definition for method 27 of type driller-lurker -(defmethod driller-lurker-method-27 driller-lurker ((this driller-lurker)) +(defmethod driller-lurker-method-27 ((this driller-lurker)) (let ((a2-0 (-> this node-list data 25 bone transform)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -987,7 +983,7 @@ ) ;; definition for method 7 of type driller-lurker -(defmethod relocate driller-lurker ((this driller-lurker) (arg0 int)) +(defmethod relocate ((this driller-lurker) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) @@ -1001,7 +997,7 @@ ) ;; definition for method 10 of type driller-lurker -(defmethod deactivate driller-lurker ((this driller-lurker)) +(defmethod deactivate ((this driller-lurker)) (if (nonzero? (-> this sound2)) (stop! (-> this sound2)) ) @@ -1012,7 +1008,7 @@ ;; definition for method 11 of type driller-lurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! driller-lurker ((this driller-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this driller-lurker) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (set! (-> this hit-player?) #f) (set! (-> this played-drill-sound?) #f) diff --git a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc index 13d7774347b..f0d040b7b10 100644 --- a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc @@ -3,21 +3,17 @@ ;; definition of type gnawer-falling-segment (deftype gnawer-falling-segment (process-drawable) - ((transv vector :inline :offset-assert 176) - (facing-rot vector :inline :offset-assert 192) - (facing-rotv vector :inline :offset-assert 208) + ((transv vector :inline) + (facing-rot vector :inline) + (facing-rotv vector :inline) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xe0 - :flag-assert #x15007000e0 - (:methods - (falling () _type_ :state 20) + (:state-methods + falling ) ) ;; definition for method 3 of type gnawer-falling-segment -(defmethod inspect gnawer-falling-segment ((this gnawer-falling-segment)) +(defmethod inspect ((this gnawer-falling-segment)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -29,16 +25,13 @@ ;; definition of type gnawer-segment-info (deftype gnawer-segment-info (structure) - ((num-joints int32 :offset-assert 0) - (joint-index int8 8 :offset-assert 4) + ((num-joints int32) + (joint-index int8 8) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type gnawer-segment-info -(defmethod inspect gnawer-segment-info ((this gnawer-segment-info)) +(defmethod inspect ((this gnawer-segment-info)) (format #t "[~8x] ~A~%" this 'gnawer-segment-info) (format #t "~Tnum-joints: ~D~%" (-> this num-joints)) (format #t "~Tjoint-index[8] @ #x~X~%" (-> this joint-index)) @@ -47,18 +40,15 @@ ;; definition of type gnawer-segment (deftype gnawer-segment (structure) - ((place int32 :offset-assert 0) - (world-pos vector :inline :offset-assert 16) - (anim-to-local-trans-offset vector :inline :offset-assert 32) - (orient-mat matrix :inline :offset-assert 48) + ((place int32) + (world-pos vector :inline) + (anim-to-local-trans-offset vector :inline) + (orient-mat matrix :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type gnawer-segment -(defmethod inspect gnawer-segment ((this gnawer-segment)) +(defmethod inspect ((this gnawer-segment)) (format #t "[~8x] ~A~%" this 'gnawer-segment) (format #t "~Tplace: ~D~%" (-> this place)) (format #t "~Tworld-pos: #~%" (-> this world-pos)) @@ -69,25 +59,22 @@ ;; definition of type gnawer-route (deftype gnawer-route (structure) - ((src-pt-index int32 :offset-assert 0) - (dest-pt-index int32 :offset-assert 4) - (total-travel-time time-frame :offset-assert 8) - (src-ang float :offset-assert 16) - (dest-ang float :offset-assert 20) - (delta-ang float :offset-assert 24) - (surface-dist float :offset-assert 28) - (total-dist float :offset-assert 32) - (src-pt-offset vector :inline :offset-assert 48) - (dest-pt-offset vector :inline :offset-assert 64) - (surface-dir vector :inline :offset-assert 80) + ((src-pt-index int32) + (dest-pt-index int32) + (total-travel-time time-frame) + (src-ang float) + (dest-ang float) + (delta-ang float) + (surface-dist float) + (total-dist float) + (src-pt-offset vector :inline) + (dest-pt-offset vector :inline) + (surface-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type gnawer-route -(defmethod inspect gnawer-route ((this gnawer-route)) +(defmethod inspect ((this gnawer-route)) (format #t "[~8x] ~A~%" this 'gnawer-route) (format #t "~Tsrc-pt-index: ~D~%" (-> this src-pt-index)) (format #t "~Tdest-pt-index: ~D~%" (-> this dest-pt-index)) @@ -105,41 +92,37 @@ ;; definition of type gnawer (deftype gnawer (process-drawable) - ((root-override collide-shape :offset 112) - (hit-points int32 :offset-assert 176) - (gnawer-id int32 :offset-assert 180) - (total-money int32 :offset-assert 184) - (money-mask uint32 :offset-assert 188) - (eco-green-mask uint32 :offset-assert 192) - (hidden? symbol :offset-assert 196) - (show-damage? symbol :offset-assert 200) - (route-dist float :offset-assert 204) - (speed float :offset-assert 208) - (anim-speed float :offset-assert 212) - (part2 sparticle-launch-control :offset-assert 216) - (sound2 ambient-sound :offset-assert 220) - (last-hit-time time-frame :offset-assert 224) - (post-trans vector :inline :offset-assert 240) - (fall-trans vector :inline :offset-assert 256) - (route gnawer-route :inline :offset-assert 272) - (segments gnawer-segment 10 :inline :offset-assert 368) + ((root collide-shape :override) + (hit-points int32) + (gnawer-id int32) + (total-money int32) + (money-mask uint32) + (eco-green-mask uint32) + (hidden? symbol) + (show-damage? symbol) + (route-dist float) + (speed float) + (anim-speed float) + (part2 sparticle-launch-control) + (sound2 ambient-sound) + (last-hit-time time-frame) + (post-trans vector :inline) + (fall-trans vector :inline) + (route gnawer-route :inline) + (segments gnawer-segment 10 :inline) ) - :heap-base #x560 - :method-count-assert 31 - :size-assert #x5d0 - :flag-assert #x1f056005d0 (:methods - (gnawer-method-20 (_type_ int) matrix 20) - (gnawer-method-21 (_type_ int bounding-box symbol float) float 21) - (gnawer-method-22 (_type_ float) symbol 22) - (gnawer-method-23 (_type_) none 23) - (gnawer-method-24 (_type_) none 24) - (gnawer-method-25 (_type_) symbol 25) - (gnawer-method-26 (_type_) none 26) - (gnawer-method-27 (_type_) none 27) - (gnawer-method-28 (_type_ int int) symbol 28) - (gnawer-method-29 (_type_ int vector vector) float 29) - (gnawer-method-30 (_type_ process-drawable) uint 30) + (gnawer-method-20 (_type_ int) matrix) + (gnawer-method-21 (_type_ int bounding-box symbol float) float) + (gnawer-method-22 (_type_ float) symbol) + (gnawer-method-23 (_type_) none) + (gnawer-method-24 (_type_) none) + (gnawer-method-25 (_type_) symbol) + (gnawer-method-26 (_type_) none) + (gnawer-method-27 (_type_) none) + (gnawer-method-28 (_type_ int int) symbol) + (gnawer-method-29 (_type_ int vector vector) float) + (gnawer-method-30 (_type_ process-drawable) uint) ) (:states gnawer-chewing-on-post @@ -154,7 +137,7 @@ ) ;; definition for method 3 of type gnawer -(defmethod inspect gnawer ((this gnawer)) +(defmethod inspect ((this gnawer)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -464,14 +447,14 @@ ;; definition for method 23 of type gnawer ;; INFO: Used lq/sq ;; INFO: Return type mismatch vector vs none. -(defmethod gnawer-method-23 gnawer ((this gnawer)) +(defmethod gnawer-method-23 ((this gnawer)) (when (not (-> this hidden?)) (set! (-> this hidden?) #t) (logior! (-> this draw status) (draw-status hidden)) (logclear! (-> this mask) (process-mask attackable)) (set! (-> this skel postbind-function) #f) - (set! (-> this root-override trans quad) (-> this post-trans quad)) - (clear-collide-with-as (-> this root-override)) + (set! (-> this root trans quad) (-> this post-trans quad)) + (clear-collide-with-as (-> this root)) (dotimes (v1-12 10) (set! (-> this segments v1-12 world-pos quad) (-> this post-trans quad)) ) @@ -482,10 +465,10 @@ ;; definition for method 26 of type gnawer ;; INFO: Return type mismatch draw-status vs none. -(defmethod gnawer-method-26 gnawer ((this gnawer)) +(defmethod gnawer-method-26 ((this gnawer)) (when (-> this hidden?) (set! (-> this hidden?) #f) - (restore-collide-with-as (-> this root-override)) + (restore-collide-with-as (-> this root)) (set! (-> this skel postbind-function) gnawer-joint-callback) (logclear! (-> this draw status) (draw-status hidden)) ) @@ -495,7 +478,7 @@ ;; definition for method 24 of type gnawer ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod gnawer-method-24 gnawer ((this gnawer)) +(defmethod gnawer-method-24 ((this gnawer)) (local-vars (sv-48 vector) (sv-64 vector)) (let ((s5-0 0) (s4-0 0) @@ -595,7 +578,7 @@ ;; definition for method 22 of type gnawer ;; INFO: Used lq/sq -(defmethod gnawer-method-22 gnawer ((this gnawer) (arg0 float)) +(defmethod gnawer-method-22 ((this gnawer) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'bounding-box)) (a3-0 #t) (gp-0 #t) @@ -628,25 +611,25 @@ (set! a3-0 #f) ) (set-vector! - (-> this root-override trans) + (-> this root trans) (* 0.5 (+ (-> s4-0 min x) (-> s4-0 max x))) (* 0.5 (+ (-> s4-0 min y) (-> s4-0 max y))) (* 0.5 (+ (-> s4-0 min z) (-> s4-0 max z))) 1.0 ) - (let* ((f0-10 (- (-> s4-0 max x) (-> this root-override trans x))) - (f1-12 (- (-> s4-0 max y) (-> this root-override trans y))) - (f2-7 (- (-> s4-0 max z) (-> this root-override trans z))) + (let* ((f0-10 (- (-> s4-0 max x) (-> this root trans x))) + (f1-12 (- (-> s4-0 max y) (-> this root trans y))) + (f2-7 (- (-> s4-0 max z) (-> this root trans z))) (f0-14 (sqrtf (+ (* f0-10 f0-10) (* f1-12 f1-12) (* f2-7 f2-7)))) (a0-3 (-> this draw bounds)) - (v1-21 (-> this root-override root-prim)) + (v1-21 (-> this root root-prim)) (f0-15 (+ 12288.0 f0-14)) ) (vector-reset! a0-3) (set! (-> a0-3 w) f0-15) (vector-reset! (-> v1-21 local-sphere)) (set! (-> v1-21 local-sphere w) f0-15) - (set! (-> v1-21 prim-core world-sphere quad) (-> this root-override trans quad)) + (set! (-> v1-21 prim-core world-sphere quad) (-> this root trans quad)) (set! (-> v1-21 prim-core world-sphere w) f0-15) ) gp-0 @@ -655,7 +638,7 @@ ;; definition for method 21 of type gnawer ;; INFO: Used lq/sq -(defmethod gnawer-method-21 gnawer ((this gnawer) (arg0 int) (arg1 bounding-box) (arg2 symbol) (arg3 float)) +(defmethod gnawer-method-21 ((this gnawer) (arg0 int) (arg1 bounding-box) (arg2 symbol) (arg3 float)) (let ((gp-0 (-> this segments arg0))) (let ((f0-1 (+ 10240.0 (-> this route surface-dist)))) (cond @@ -724,7 +707,7 @@ ;; definition for method 20 of type gnawer ;; INFO: Used lq/sq -(defmethod gnawer-method-20 gnawer ((this gnawer) (arg0 int)) +(defmethod gnawer-method-20 ((this gnawer) (arg0 int)) (let ((v1-3 (-> this segments arg0)) (a0-1 (-> this segments (+ arg0 -1))) ) @@ -747,7 +730,7 @@ ) ;; definition for method 25 of type gnawer -(defmethod gnawer-method-25 gnawer ((this gnawer)) +(defmethod gnawer-method-25 ((this gnawer)) (dotimes (s5-0 3) (when (> (-> this hit-points) 0) (+! (-> this hit-points) -1) @@ -759,7 +742,7 @@ (let ((s1-0 (new 'stack-no-clear 'vector)) (s2-0 (-> s3-0 world-pos)) ) - (vector-! s1-0 s2-0 (-> this root-override trans)) + (vector-! s1-0 s2-0 (-> this root trans)) (set! (-> s1-0 y) 0.0) (vector-normalize! s1-0 1.0) (process-spawn gnawer-falling-segment this s2-0 s1-0 :to this) @@ -784,7 +767,7 @@ ;; definition for method 28 of type gnawer ;; INFO: Return type mismatch int vs symbol. -(defmethod gnawer-method-28 gnawer ((this gnawer) (arg0 int) (arg1 int)) +(defmethod gnawer-method-28 ((this gnawer) (arg0 int) (arg1 int)) (when (> arg0 0) (let* ((v1-1 (rand-vu-int-count arg0)) (a0-2 v1-1) @@ -804,16 +787,15 @@ ;; definition for method 27 of type gnawer ;; INFO: Return type mismatch int vs none. -(defmethod gnawer-method-27 gnawer ((this gnawer)) +(defmethod gnawer-method-27 ((this gnawer)) (set! (-> this eco-green-mask) (the-as uint 0)) (let ((s4-0 (-> this path curve num-cverts)) (s3-0 (get-death-count *game-info* #f)) (s5-0 (-> this money-mask)) ) - (when (and *target* - (or (and (= s3-0 1) (and (>= 1.0 (-> *target* fact-info-target health)) (rand-vu-percent? 0.1))) - (and (< 1 s3-0) (and (>= 2.0 (-> *target* fact-info-target health)) (rand-vu-percent? 0.05))) - ) + (when (and *target* (or (and (= s3-0 1) (and (>= 1.0 (-> *target* fact health)) (rand-vu-percent? 0.1))) + (and (< 1 s3-0) (and (>= 2.0 (-> *target* fact health)) (rand-vu-percent? 0.05))) + ) ) (let ((v1-14 (gnawer-method-28 this s4-0 (the-as int s5-0)))) (logior s5-0 (the-as uint v1-14)) @@ -825,7 +807,7 @@ ) ;; definition for method 29 of type gnawer -(defmethod gnawer-method-29 gnawer ((this gnawer) (arg0 int) (arg1 vector) (arg2 vector)) +(defmethod gnawer-method-29 ((this gnawer) (arg0 int) (arg1 vector) (arg2 vector)) (let ((s1-0 (-> this path curve num-cverts)) (s2-0 (new 'stack-no-clear 'vector)) ) @@ -854,7 +836,7 @@ ;; definition for method 30 of type gnawer ;; INFO: Used lq/sq -(defmethod gnawer-method-30 gnawer ((this gnawer) (arg0 process-drawable)) +(defmethod gnawer-method-30 ((this gnawer) (arg0 process-drawable)) (local-vars (sv-48 vector)) (let ((gp-0 (-> this entity extra perm))) (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) @@ -917,7 +899,7 @@ (stop! (-> self sound2)) ) :trans (behavior () - (if (and *target* (>= 81920.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) + (if (and *target* (>= 81920.0 (vector-vector-distance (target-pos 0) (-> self root trans)))) (go gnawer-retreat-into-post) ) ) @@ -1020,7 +1002,7 @@ (suspend) (ja :num! (seek!)) ) - (quaternion-identity! (-> self root-override quat)) + (quaternion-identity! (-> self root quat)) (go gnawer-wait-to-run) ) :post transform-post @@ -1073,7 +1055,7 @@ (let* ((a2-1 (the-as object (-> block param 0))) (v1-19 (-> (get-touched-prim (-> (the-as touching-shapes-entry a2-1) head) - (-> self root-override) + (-> self root) (the-as touching-shapes-entry a2-1) ) prim-id @@ -1146,25 +1128,25 @@ :enter (behavior () (let ((v1-0 (-> self segments))) (set! (-> self fall-trans quad) (-> v1-0 0 world-pos quad)) - (vector-! (-> self root-override transv) (-> v1-0 0 world-pos) (-> self post-trans)) + (vector-! (-> self root transv) (-> v1-0 0 world-pos) (-> self post-trans)) ) - (set! (-> self root-override transv y) 0.0) - (vector-normalize! (-> self root-override transv) 1.0) - (set! (-> self root-override transv y) 0.3) - (vector-normalize! (-> self root-override transv) 32768.0) + (set! (-> self root transv y) 0.0) + (vector-normalize! (-> self root transv) 1.0) + (set! (-> self root transv y) 0.3) + (vector-normalize! (-> self root transv) 32768.0) ) :trans (behavior () - (+! (-> self root-override transv y) (* -409600.0 (seconds-per-frame))) + (+! (-> self root transv y) (* -409600.0 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self fall-trans quad)) - (vector-v+! (-> self fall-trans) (-> self fall-trans) (-> self root-override transv)) + (vector-v+! (-> self fall-trans) (-> self fall-trans) (-> self root transv)) (vector-! gp-0 (-> self fall-trans) gp-0) (dotimes (v1-6 10) (let ((a1-3 (-> self segments v1-6))) (vector+! (-> a1-3 world-pos) (-> a1-3 world-pos) gp-0) ) ) - (vector+! (-> self root-override trans) (-> self root-override trans) gp-0) + (vector+! (-> self root trans) (-> self root trans) gp-0) ) (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) ) @@ -1172,7 +1154,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) (ja-channel-push! 1 (seconds 0.1)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :group! gnawer-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1199,7 +1181,7 @@ ) :code (behavior () (local-vars (sv-128 symbol)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (set! (-> self skel postbind-function) #f) (ja-channel-set! 0) (ja-post) @@ -1332,7 +1314,7 @@ ) :code (behavior () (set! (-> self draw origin-joint-index) (the-as uint 0)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (set! (-> self skel postbind-function) #f) (ja-channel-set! 0) (ja-post) @@ -1387,7 +1369,7 @@ ) (countdown (s2-0 (-> v1-1 num-joints)) (let ((s1-0 (-> arg0 node-list data (-> s3-0 0) bone transform))) - (vector-! (-> s1-0 vector 3) (-> s1-0 vector 3) (-> arg0 root-override trans)) + (vector-! (-> s1-0 vector 3) (-> s1-0 vector 3) (-> arg0 root trans)) (vector+! (-> s1-0 vector 3) (-> s1-0 vector 3) (-> s4-0 anim-to-local-trans-offset)) (matrix*! s1-0 s1-0 (-> s4-0 orient-mat)) (vector+! (-> s1-0 vector 3) (-> s1-0 vector 3) (-> s4-0 world-pos)) @@ -1401,7 +1383,7 @@ ) ;; definition for method 10 of type gnawer -(defmethod deactivate gnawer ((this gnawer)) +(defmethod deactivate ((this gnawer)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -1413,7 +1395,7 @@ ) ;; definition for method 7 of type gnawer -(defmethod relocate gnawer ((this gnawer) (arg0 int)) +(defmethod relocate ((this gnawer) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -1426,7 +1408,7 @@ ;; definition for method 11 of type gnawer ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! gnawer ((this gnawer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gnawer) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) (set! (-> this hidden?) #f) (set! (-> this show-damage?) #f) @@ -1508,23 +1490,23 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (quaternion-identity! (-> this root-override quat)) + (quaternion-identity! (-> this root quat)) (initialize-skeleton this *gnawer-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 8)) - (set! (-> this post-trans quad) (-> this root-override trans quad)) + (set! (-> this post-trans quad) (-> this root trans quad)) (let ((f0-40 (res-lump-float (-> this entity) 'rotoffset))) - (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-40) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-40) ) - (+! (-> this root-override trans y) -2048.0) + (+! (-> this root trans y) -2048.0) (set! sv-16 (new 'static 'res-tag)) (let ((v1-81 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-81 - (+! (-> this root-override trans x) (-> v1-81 0)) - (+! (-> this root-override trans y) (-> v1-81 1)) - (+! (-> this root-override trans z) (-> v1-81 2)) + (+! (-> this root trans x) (-> v1-81 0)) + (+! (-> this root trans y) (-> v1-81 1)) + (+! (-> this root trans z) (-> v1-81 2)) ) ) (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) @@ -1567,15 +1549,10 @@ ) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 329) this)) (set! (-> this sound) - (new - 'process - 'ambient-sound - (static-sound-spec "gnawer-crawl" :fo-min 30 :fo-max 30) - (-> this root-override trans) - ) + (new 'process 'ambient-sound (static-sound-spec "gnawer-crawl" :fo-min 30 :fo-max 30) (-> this root trans)) ) (set! (-> this sound2) - (new 'process 'ambient-sound (static-sound-spec "gnawer-chew" :fo-max 40) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "gnawer-chew" :fo-max 40) (-> this root trans)) ) (dotimes (v1-110 10) (let ((a0-59 (-> this segments v1-110))) diff --git a/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc b/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc index 6873189f76a..042c51ad7b7 100644 --- a/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc @@ -3,16 +3,12 @@ ;; definition of type maincavecam (deftype maincavecam (pov-camera) - ((seq uint64 :offset-assert 224) + ((seq uint64) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xe8 - :flag-assert #x1e008000e8 ) ;; definition for method 3 of type maincavecam -(defmethod inspect maincavecam ((this maincavecam)) +(defmethod inspect ((this maincavecam)) (let ((t9-0 (method-of-type pov-camera inspect))) (t9-0 this) ) @@ -27,7 +23,7 @@ ) ;; definition for method 29 of type maincavecam -(defmethod set-stack-size! maincavecam ((this maincavecam)) +(defmethod set-stack-size! ((this maincavecam)) (stack-size-set! (-> this main-thread) 512) (none) ) @@ -75,14 +71,10 @@ ;; definition of type cave-water (deftype cave-water (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) ;; definition for method 3 of type cave-water -(defmethod inspect cave-water ((this cave-water)) +(defmethod inspect ((this cave-water)) (let ((t9-0 (method-of-type water-anim inspect))) (t9-0 this) ) @@ -105,7 +97,7 @@ ;; definition for method 22 of type cave-water ;; INFO: Return type mismatch rgbaf vs none. -(defmethod water-vol-method-22 cave-water ((this cave-water)) +(defmethod water-vol-method-22 ((this cave-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) @@ -126,19 +118,15 @@ ;; definition of type cavecrusher (deftype cavecrusher (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states cavecrusher-idle ) ) ;; definition for method 3 of type cavecrusher -(defmethod inspect cavecrusher ((this cavecrusher)) +(defmethod inspect ((this cavecrusher)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -184,7 +172,7 @@ ;; definition for method 11 of type cavecrusher ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cavecrusher ((this cavecrusher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cavecrusher) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -197,12 +185,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *cavecrusher-sg* '()) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "crush-click" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "crush-click" :fo-max 30) (-> this root trans)) ) (ja-channel-push! 1 0) (let ((s5-1 (-> this skel root-channel 0))) @@ -214,28 +202,24 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go cavecrusher-idle) (none) ) ;; definition of type cavetrapdoor (deftype cavetrapdoor (process-drawable) - ((root-override collide-shape-moving :offset 112) - (delay-before-wiggle int32 :offset-assert 176) + ((root collide-shape-moving :override) + (delay-before-wiggle int32) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xb4 - :flag-assert #x16005000b4 - (:methods - (idle () _type_ :state 20) - (trigger () _type_ :state 21) + (:state-methods + idle + trigger ) ) ;; definition for method 3 of type cavetrapdoor -(defmethod inspect cavetrapdoor ((this cavetrapdoor)) +(defmethod inspect ((this cavetrapdoor)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -257,7 +241,7 @@ (case message (('touch) (when (= (-> proc type) target) - (when (>= (- (-> (target-pos 0) y) (-> self root-override trans y)) 409.6) + (when (>= (- (-> (target-pos 0) y) (-> self root trans y)) 409.6) (send-event proc 'no-look-around (seconds 1.5)) (go-virtual trigger) ) @@ -291,21 +275,19 @@ (suspend) (ja :num! (seek!)) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :group! cavetrapdoor-swing-ja :num! (seek! (ja-aframe 290.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 290.0 0))) ) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (ja-no-eval :num! (seek!)) (while (not (ja-done? 0)) (suspend) (ja-eval) ) - (until (or (or (not *target*) - (< 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (until (or (or (not *target*) (< 28672.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) @@ -322,7 +304,7 @@ ) (ja-no-eval :group! cavetrapdoor-reset-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (when (and (and *target* (>= 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and (and *target* (>= 28672.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) @@ -345,7 +327,7 @@ ;; definition for method 11 of type cavetrapdoor ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cavetrapdoor ((this cavetrapdoor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cavetrapdoor) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -365,7 +347,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *cavetrapdoor-sg* '()) @@ -379,8 +361,8 @@ (set! (-> s4-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) - (let ((f0-7 (quaternion-y-angle (-> this root-override quat))) + (update-transforms! (-> this root)) + (let ((f0-7 (quaternion-y-angle (-> this root quat))) (s4-2 (-> this draw bounds)) ) (set-vector! s4-2 0.0 -8192.0 4096.0 1.0) @@ -402,26 +384,22 @@ ;; definition of type caveflamepots (deftype caveflamepots (process-drawable) - ((root-override collide-shape :offset 112) - (shove-up float :offset-assert 176) - (cycle-speed int32 :offset-assert 180) - (cycle-pause int32 :offset-assert 184) - (cycle-offset uint32 :offset-assert 188) - (was-deadly? symbol :offset-assert 192) - (should-play-sound? symbol :offset-assert 196) - (launch-pos vector 2 :inline :offset-assert 208) + ((root collide-shape :override) + (shove-up float) + (cycle-speed int32) + (cycle-pause int32) + (cycle-offset uint32) + (was-deadly? symbol) + (should-play-sound? symbol) + (launch-pos vector 2 :inline) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xf0 - :flag-assert #x14008000f0 (:states caveflamepots-active ) ) ;; definition for method 3 of type caveflamepots -(defmethod inspect caveflamepots ((this caveflamepots)) +(defmethod inspect ((this caveflamepots)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -494,7 +472,7 @@ (collide-action) ) (let ((s4-0 (new 'stack 'attack-info))) - (calc-shove-up (-> self root-override) s4-0 (-> self shove-up)) + (calc-shove-up (-> self root) s4-0 (-> self shove-up)) (if (or (= (-> *target* control unknown-surface00 mode) 'air) (>= (+ (current-time) (seconds -0.2)) (-> *target* control unknown-dword11)) (< 0.75 (-> *target* control poly-normal y)) @@ -531,7 +509,7 @@ ) (cond ((< gp-0 a0-1) - (when (sphere-in-view-frustum? (the-as sphere (-> self root-override root-prim prim-core))) + (when (sphere-in-view-frustum? (the-as sphere (-> self root root-prim prim-core))) (launch-particles (-> *part-id-table* 704) (the-as vector (-> self launch-pos))) (launch-particles (-> *part-id-table* 705) (the-as vector (&-> self stack 112))) ) @@ -543,26 +521,26 @@ ((< gp-0 30) (when (-> self was-deadly?) (set! (-> self was-deadly?) #f) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) ) ) (else (when (not (-> self was-deadly?)) (set! (-> self was-deadly?) #t) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) ) ) ) (when (and (not (-> self was-deadly?)) (< 60 gp-0)) (set! (-> self was-deadly?) #t) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) ) ) (else (set! (-> self should-play-sound?) #t) (when (-> self was-deadly?) (set! (-> self was-deadly?) #f) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) ) ) ) @@ -579,7 +557,7 @@ ;; definition for method 11 of type caveflamepots ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! caveflamepots ((this caveflamepots) (arg0 entity-actor)) +(defmethod init-from-entity! ((this caveflamepots) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) (set! (-> this was-deadly?) #f) (set! (-> this should-play-sound?) #f) @@ -625,7 +603,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (let ((v1-42 (new 'process 'path-control this 'path 0.0))) @@ -637,10 +615,10 @@ ) (let ((f0-23 (res-lump-float arg0 'rotoffset))) (if (!= f0-23 0.0) - (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-23) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-23) ) ) - (let ((f30-0 (quaternion-y-angle (-> this root-override quat)))) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (let ((s4-1 (-> this launch-pos))) (let ((v1-53 s4-1)) (set! (-> v1-53 0 x) 6144.0) @@ -649,14 +627,14 @@ (set! (-> v1-53 0 w) 1.0) ) (vector-rotate-around-y! (the-as vector s4-1) (the-as vector s4-1) f30-0) - (vector+! (the-as vector s4-1) (the-as vector s4-1) (-> this root-override trans)) + (vector+! (the-as vector s4-1) (the-as vector s4-1) (-> this root trans)) ) (let ((s4-2 (the-as object (&-> this stack 112)))) (set-vector! (the-as vector s4-2) -6144.0 0.0 0.0 1.0) (vector-rotate-around-y! (the-as vector s4-2) (the-as vector s4-2) f30-0) - (vector+! (the-as vector s4-2) (the-as vector s4-2) (-> this root-override trans)) + (vector+! (the-as vector s4-2) (the-as vector s4-2) (-> this root trans)) ) - (let ((s4-3 (-> this root-override root-prim))) + (let ((s4-3 (-> this root root-prim))) (dotimes (s3-1 (-> (the-as collide-shape-prim-group s4-3) num-prims)) (let ((a1-19 (-> (the-as collide-shape-prim-group s4-3) prims s3-1 local-sphere))) (vector-rotate-around-y! a1-19 a1-19 f30-0) @@ -664,7 +642,7 @@ ) ) ) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (let ((f30-1 300.0)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-70 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-16)))) @@ -709,20 +687,16 @@ ;; definition of type cavespatula (deftype cavespatula (process-drawable) - ((root-override collide-shape-moving :offset 112) - (sync sync-info :inline :offset-assert 176) + ((root collide-shape-moving :override) + (sync sync-info :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states cavespatula-idle ) ) ;; definition for method 3 of type cavespatula -(defmethod inspect cavespatula ((this cavespatula)) +(defmethod inspect ((this cavespatula)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -748,7 +722,7 @@ (rider-trans) (update! (-> self sound)) (let ((f0-0 (get-current-phase (-> self sync)))) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (* -65536.0 f0-0)) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (* -65536.0 f0-0)) ) ) :code (behavior () @@ -762,7 +736,7 @@ ;; definition for method 11 of type cavespatula ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cavespatula ((this cavespatula) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cavespatula) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -782,16 +756,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set! (-> this sound) - (new - 'process - 'ambient-sound - (static-sound-spec "spatula" :fo-min 25 :fo-max 50) - (-> this root-override trans) - ) + (new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> this root trans)) ) (case (-> (if (-> this entity) (-> this entity extra level) @@ -827,7 +796,7 @@ (logior! (-> this skel status) (janim-status inited)) (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (create-connection! *cavecrystal-light-control* this @@ -842,20 +811,16 @@ ;; definition of type cavespatulatwo (deftype cavespatulatwo (process-drawable) - ((root-override collide-shape-moving :offset 112) - (sync sync-info :inline :offset-assert 176) + ((root collide-shape-moving :override) + (sync sync-info :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states cavespatulatwo-idle ) ) ;; definition for method 3 of type cavespatulatwo -(defmethod inspect cavespatulatwo ((this cavespatulatwo)) +(defmethod inspect ((this cavespatulatwo)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -876,7 +841,7 @@ (rider-trans) (update! (-> self sound)) (let ((f0-0 (get-current-phase (-> self sync)))) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (* -65536.0 f0-0)) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (* -65536.0 f0-0)) ) ) :code (behavior () @@ -890,7 +855,7 @@ ;; definition for method 11 of type cavespatulatwo ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cavespatulatwo ((this cavespatulatwo) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cavespatulatwo) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -910,7 +875,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *cavespatulatwo-sg* '()) @@ -927,12 +892,8 @@ (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (set! (-> this sound) (new - 'process - 'ambient-sound - (static-sound-spec "spatula" :fo-min 25 :fo-max 50) - (-> this root-override trans) - ) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> this root trans)) ) (go cavespatulatwo-idle) (none) @@ -940,24 +901,20 @@ ;; definition of type caveelevator (deftype caveelevator (process-drawable) - ((root-override collide-shape-moving :offset 112) - (elev-mode uint64 :offset-assert 176) - (elev-type int32 :offset-assert 184) - (prev-frame-num float :offset-assert 188) - (last-update-bounce-time time-frame :offset-assert 192) - (orig-trans vector :inline :offset-assert 208) - (sync sync-info :inline :offset-assert 224) - (smush smush-control :inline :offset-assert 232) - (anim int32 2 :offset-assert 264) - (wheel-ry-mat matrix :inline :offset 272) + ((root collide-shape-moving :override) + (elev-mode uint64) + (elev-type int32) + (prev-frame-num float) + (last-update-bounce-time time-frame) + (orig-trans vector :inline) + (sync sync-info :inline) + (smush smush-control :inline) + (anim int32 2) + (wheel-ry-mat matrix :inline :offset 272) ) - :heap-base #xe0 - :method-count-assert 22 - :size-assert #x150 - :flag-assert #x1600e00150 (:methods - (caveelevator-method-20 (_type_) none 20) - (caveelevator-method-21 (_type_) float 21) + (caveelevator-method-20 (_type_) none) + (caveelevator-method-21 (_type_) float) ) (:states caveelevator-cycle-active @@ -969,7 +926,7 @@ ) ;; definition for method 3 of type caveelevator -(defmethod inspect caveelevator ((this caveelevator)) +(defmethod inspect ((this caveelevator)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -998,7 +955,7 @@ (let ((v1-1 (-> arg0 0 node-list))) (if (and (>= arg1 0) (nonzero? v1-1)) (vector<-cspace! s5-0 (-> v1-1 data arg1)) - (set! (-> s5-0 quad) (-> arg0 0 root-override trans quad)) + (set! (-> s5-0 quad) (-> arg0 0 root trans quad)) ) ) (set! (-> s5-0 w) arg2) @@ -1013,7 +970,7 @@ ;; definition for method 20 of type caveelevator ;; INFO: Used lq/sq -(defmethod caveelevator-method-20 caveelevator ((this caveelevator)) +(defmethod caveelevator-method-20 ((this caveelevator)) (let ((v1-1 (current-time))) (when (!= v1-1 (-> this last-update-bounce-time)) (set! (-> this last-update-bounce-time) v1-1) @@ -1021,7 +978,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> this orig-trans quad)) (+! (-> s5-0 y) (* 819.2 (update! (-> this smush)))) - (move-to-point! (-> this root-override) s5-0) + (move-to-point! (-> this root) s5-0) ) ) ) @@ -1030,12 +987,12 @@ ) ;; definition for method 21 of type caveelevator -(defmethod caveelevator-method-21 caveelevator ((this caveelevator)) +(defmethod caveelevator-method-21 ((this caveelevator)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (-> this draw bounds)) ) (vector<-cspace! s5-0 (-> this node-list data 3)) - (vector-! gp-0 s5-0 (-> this root-override trans)) + (vector-! gp-0 s5-0 (-> this root trans)) (set! (-> gp-0 w) 17408.0) ) ) @@ -1086,9 +1043,7 @@ (go caveelevator-one-way-travel-to-end) ) (('attack 'touch) - (if (and (= (-> proc type) target) - (>= 8192.0 (vector-vector-xz-distance (target-pos 0) (-> self root-override trans))) - ) + (if (and (= (-> proc type) target) (>= 8192.0 (vector-vector-xz-distance (target-pos 0) (-> self root trans)))) (go caveelevator-one-way-travel-to-end) ) ) @@ -1162,7 +1117,7 @@ ) :trans (behavior () (cond - ((zero? (-> self root-override riders num-riders)) + ((zero? (-> self root riders num-riders)) (if (time-elapsed? (-> self state-time) (seconds 3)) (go caveelevator-one-way-travel-to-start) ) @@ -1247,7 +1202,7 @@ ;; definition for method 11 of type caveelevator ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! caveelevator ((this caveelevator) (arg0 entity-actor)) +(defmethod init-from-entity! ((this caveelevator) (arg0 entity-actor)) (local-vars (v1-43 int) (sv-16 res-tag)) (set! (-> this prev-frame-num) 10000.0) (set! (-> this last-update-bounce-time) 0) @@ -1270,7 +1225,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *caveelevator-sg* '()) @@ -1279,18 +1234,18 @@ (set! sv-16 (new 'static 'res-tag)) (let ((v1-28 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-28 - (+! (-> this root-override trans x) (-> v1-28 0)) - (+! (-> this root-override trans y) (-> v1-28 1)) - (+! (-> this root-override trans z) (-> v1-28 2)) + (+! (-> this root trans x) (-> v1-28 0)) + (+! (-> this root trans y) (-> v1-28 1)) + (+! (-> this root trans z) (-> v1-28 2)) ) ) - (set! (-> this orig-trans quad) (-> this root-override trans quad)) + (set! (-> this orig-trans quad) (-> this root trans quad)) (let ((f0-13 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-13 0.0) - (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-13) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-13) ) ) - (let ((f0-14 (quaternion-y-angle (-> this root-override quat)))) + (let ((f0-14 (quaternion-y-angle (-> this root quat)))) (matrix-rotate-y! (-> this wheel-ry-mat) f0-14) ) (set-zero! (-> this smush)) diff --git a/test/decompiler/reference/jak1/levels/maincave/maincave-part_REF.gc b/test/decompiler/reference/jak1/levels/maincave/maincave-part_REF.gc index e8f19c84b4c..746a7f7d982 100644 --- a/test/decompiler/reference/jak1/levels/maincave/maincave-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/maincave-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type maincave-part (deftype maincave-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type maincave-part -(defmethod inspect maincave-part ((this maincave-part)) +(defmethod inspect ((this maincave-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) @@ -21,14 +17,10 @@ ;; definition of type darkcave-part (deftype darkcave-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type darkcave-part -(defmethod inspect darkcave-part ((this darkcave-part)) +(defmethod inspect ((this darkcave-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc index 0fb9be1adf3..644dc8d1ee2 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc @@ -3,24 +3,20 @@ ;; definition of type mother-spider-egg (deftype mother-spider-egg (process-drawable) - ((parent-override (pointer mother-spider) :offset 12) - (root-override collide-shape-moving :offset 112) - (anim-speed float :offset-assert 176) - (part2 sparticle-launch-control :offset-assert 180) - (falling-start-time time-frame :offset-assert 184) - (fall-dest vector :inline :offset-assert 192) - (fall-dest-normal vector :inline :offset-assert 208) - (broken-look lod-set :inline :offset-assert 224) - (traj trajectory :inline :offset-assert 272) - (shadow-pos vector :inline :offset-assert 320) + ((root collide-shape-moving :override) + (parent-override (pointer mother-spider) :overlay-at parent) + (anim-speed float) + (part2 sparticle-launch-control) + (falling-start-time time-frame) + (fall-dest vector :inline) + (fall-dest-normal vector :inline) + (broken-look lod-set :inline) + (traj trajectory :inline) + (shadow-pos vector :inline) ) - :heap-base #xe0 - :method-count-assert 22 - :size-assert #x150 - :flag-assert #x1600e00150 (:methods - (mother-spider-egg-method-20 (_type_) none 20) - (draw-egg-shadow (_type_ vector symbol) symbol 21) + (mother-spider-egg-method-20 (_type_) none) + (draw-egg-shadow (_type_ vector symbol) symbol) ) (:states mother-spider-egg-die @@ -33,7 +29,7 @@ ) ;; definition for method 3 of type mother-spider-egg -(defmethod inspect mother-spider-egg ((this mother-spider-egg)) +(defmethod inspect ((this mother-spider-egg)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -175,7 +171,7 @@ ;; definition for method 21 of type mother-spider-egg ;; INFO: Used lq/sq -(defmethod draw-egg-shadow mother-spider-egg ((this mother-spider-egg) (arg0 vector) (arg1 symbol)) +(defmethod draw-egg-shadow ((this mother-spider-egg) (arg0 vector) (arg1 symbol)) (cond ((and (-> this draw shadow) (zero? (-> this draw cur-lod)) @@ -185,7 +181,7 @@ (a1-1 (new 'stack-no-clear 'vector)) (a2-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> this root-override trans quad)) + (set! (-> a1-1 quad) (-> this root trans quad)) (+! (-> a1-1 y) 1228.8) (set-vector! a2-1 0.0 -61440.0 0.0 1.0) (cond @@ -249,9 +245,9 @@ :trans (behavior () (let ((f30-0 (fmin (the float (- (current-time) (-> self falling-start-time))) (-> self traj time)))) (let ((f28-0 (/ f30-0 (-> self traj time)))) - (eval-position! (-> self traj) f30-0 (-> self root-override trans)) + (eval-position! (-> self traj) f30-0 (-> self root trans)) (let ((f0-3 (lerp 0.3 0.4 f28-0))) - (set-vector! (-> self root-override scale) f0-3 f0-3 f0-3 1.0) + (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) ) (when (= f30-0 (-> self traj time)) @@ -279,14 +275,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('touch) - (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> block param 0)) - 0.7 - 6144.0 - 16384.0 - ) + (send-shove-back (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) ) (('attack) (go mother-spider-egg-die) @@ -313,7 +302,7 @@ (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (quaternion-copy! gp-0 (-> self root-override quat)) + (quaternion-copy! gp-0 (-> self root quat)) (set-vector! s4-0 0.0 1.0 0.0 1.0) (set! (-> s3-0 quad) (-> self fall-dest-normal quad)) (vector-normalize! s3-0 1.0) @@ -326,7 +315,7 @@ (v1-19 (ja-group)) (f0-9 (/ f0-8 (the float (+ (-> v1-19 data 0 length) -1)))) ) - (quaternion-slerp! (-> self root-override quat) gp-0 s5-0 f0-9) + (quaternion-slerp! (-> self root quat) gp-0 s5-0 f0-9) ) (suspend) (ja :num! (seek! max 1.3)) @@ -350,7 +339,7 @@ (let ((a1-0 (new 'stack-no-clear 'vector))) (set! (-> a1-0 quad) (-> self fall-dest quad)) (compute-and-draw-shadow - (-> self root-override trans) + (-> self root trans) a1-0 (-> self fall-dest-normal) (the-as vector 7372.8) @@ -362,7 +351,7 @@ ) :code (behavior () (send-event (ppointer->process (-> self parent-override)) 'trigger) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (process-spawn part-tracker :init part-tracker-init @@ -371,7 +360,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) @@ -400,7 +389,7 @@ 0 (lods-assign! (-> self draw) (-> self broken-look)) (ja-channel-push! 1 (seconds 0.1)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (process-spawn part-tracker :init part-tracker-init @@ -409,7 +398,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (ja-no-eval :group! spider-egg-die-ja :num! (seek!) :frame-num 0.0) @@ -426,12 +415,12 @@ (defstate mother-spider-egg-die-while-falling (mother-spider-egg) :trans (behavior () (let ((f0-2 (fmin (the float (- (current-time) (-> self falling-start-time))) (-> self traj time)))) - (eval-position! (-> self traj) f0-2 (-> self root-override trans)) + (eval-position! (-> self traj) f0-2 (-> self root trans)) ) ) :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (let ((v1-5 (-> self draw shadow-ctrl))) (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) @@ -444,7 +433,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) @@ -468,9 +457,9 @@ (logior! (-> v1-8 settings flags) (shadow-flags disable-draw)) ) 0 - (logclear! (-> self root-override nav-flags) (nav-flags navf0)) - (logclear! (-> self root-override nav-flags) (nav-flags navf1)) - (clear-collide-with-as (-> self root-override)) + (logclear! (-> self root nav-flags) (nav-flags navf0)) + (logclear! (-> self root nav-flags) (nav-flags navf1)) + (clear-collide-with-as (-> self root)) (until (not (-> self child)) (suspend) ) @@ -502,24 +491,24 @@ ) (set! (-> s4-1 nav-radius) 4096.0) (backup-collide-with-as s4-1) - (set! (-> self root-override) s4-1) + (set! (-> self root) s4-1) ) - (set! (-> self root-override trans quad) (-> arg1 quad)) - (set-vector! (-> self root-override scale) 0.3 0.3 0.3 1.0) - (quaternion-copy! (-> self root-override quat) (-> self parent-override 0 root-override quat)) + (set! (-> self root trans quad) (-> arg1 quad)) + (set-vector! (-> self root scale) 0.3 0.3 0.3 1.0) + (quaternion-copy! (-> self root quat) (-> self parent-override 0 root quat)) (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self mask) (process-mask enemy)) (logior! (-> self mask) (process-mask attackable)) (initialize-skeleton self *mother-spider-egg-unbroken-sg* '()) (setup-lods! (-> self broken-look) *mother-spider-egg-broken-sg* (-> self draw art-group) (-> self entity)) (set! (-> self draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) - (set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0)) + (set! (-> self nav) (new 'process 'nav-control (-> self root) 16 40960.0)) (logior! (-> self nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (logclear! (-> self root-override nav-flags) (nav-flags navf0)) - (logior! (-> self root-override nav-flags) (nav-flags navf1)) + (logclear! (-> self root nav-flags) (nav-flags navf0)) + (logior! (-> self root nav-flags) (nav-flags navf1)) (set! (-> self nav extra-nav-sphere quad) (-> self fall-dest quad)) (set! (-> self nav extra-nav-sphere w) 4096.0) - (setup-from-to-height! (-> self traj) (-> self root-override trans) arg2 4096.0 -4.551111) + (setup-from-to-height! (-> self traj) (-> self root trans) arg2 4096.0 -4.551111) (create-connection! *cavecrystal-light-control* self diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider-h_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider-h_REF.gc index bb7ce43ed0c..471840f4022 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider-h_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider-h_REF.gc @@ -3,22 +3,18 @@ ;; definition of type mother-spider-leg (deftype mother-spider-leg (process-drawable) - ((gravity float :offset-assert 176) - (transv vector :inline :offset-assert 192) - (facing-rot vector :inline :offset-assert 208) - (facing-rotv vector :inline :offset-assert 224) + ((gravity float) + (transv vector :inline) + (facing-rot vector :inline) + (facing-rotv vector :inline) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xf0 - :flag-assert #x14008000f0 (:states mother-spider-leg-flying ) ) ;; definition for method 3 of type mother-spider-leg -(defmethod inspect mother-spider-leg ((this mother-spider-leg)) +(defmethod inspect ((this mother-spider-leg)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -31,18 +27,15 @@ ;; definition of type mother-spider-thread (deftype mother-spider-thread (structure) - ((joint-index int32 :offset-assert 0) - (trans-u float :offset-assert 4) - (swing-arc-u float :offset-assert 8) + ((joint-index int32) + (trans-u float) + (swing-arc-u float) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type mother-spider-thread -(defmethod inspect mother-spider-thread ((this mother-spider-thread)) +(defmethod inspect ((this mother-spider-thread)) (format #t "[~8x] ~A~%" this 'mother-spider-thread) (format #t "~Tjoint-index: ~D~%" (-> this joint-index)) (format #t "~Ttrans-u: ~f~%" (-> this trans-u)) @@ -52,17 +45,14 @@ ;; definition of type mother-spider-leg-info (deftype mother-spider-leg-info (structure) - ((joint-index0 int32 :offset-assert 0) - (joint-index1 int32 :offset-assert 4) - (cprim-index int32 :offset-assert 8) + ((joint-index0 int32) + (joint-index1 int32) + (cprim-index int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type mother-spider-leg-info -(defmethod inspect mother-spider-leg-info ((this mother-spider-leg-info)) +(defmethod inspect ((this mother-spider-leg-info)) (format #t "[~8x] ~A~%" this 'mother-spider-leg-info) (format #t "~Tjoint-index0: ~D~%" (-> this joint-index0)) (format #t "~Tjoint-index1: ~D~%" (-> this joint-index1)) @@ -72,15 +62,12 @@ ;; definition of type mother-spider-history (deftype mother-spider-history (structure) - ((trans vector :inline :offset-assert 0) + ((trans vector :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type mother-spider-history -(defmethod inspect mother-spider-history ((this mother-spider-history)) +(defmethod inspect ((this mother-spider-history)) (format #t "[~8x] ~A~%" this 'mother-spider-history) (format #t "~Ttrans: #~%" (-> this trans)) this @@ -88,15 +75,12 @@ ;; definition of type mother-spider-history-array (deftype mother-spider-history-array (inline-array-class) - ((data mother-spider-history :dynamic :offset-assert 16) + ((data mother-spider-history :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type mother-spider-history-array -(defmethod inspect mother-spider-history-array ((this mother-spider-history-array)) +(defmethod inspect ((this mother-spider-history-array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -109,67 +93,63 @@ ;; definition of type mother-spider (deftype mother-spider (process-drawable) - ((root-override collide-shape :offset 112) - (mode uint64 :offset-assert 176) - (damage int32 :offset-assert 184) - (baby-count int32 :offset-assert 188) - (max-baby-count int32 :offset-assert 192) - (birthing-counter int32 :offset-assert 196) - (spit-counter int32 :offset-assert 200) - (leg-socket-part-mask int32 :offset-assert 204) - (dist-from-anchor float :offset-assert 208) - (targ-dist-from-anchor float :offset-assert 212) - (idle-dist-from-anchor float :offset-assert 216) - (player-sticky-dist-from-anchor float :offset-assert 220) - (max-dist-from-anchor float :offset-assert 224) - (activate-xz-dist float :offset-assert 228) - (deactivate-xz-dist float :offset-assert 232) - (max-spit-xz-dist float :offset-assert 236) - (max-swing-radius float :offset-assert 240) - (spin-vel float :offset-assert 244) - (thread-speed float :offset-assert 248) - (thread-vel float :offset-assert 252) - (history mother-spider-history-array :offset-assert 256) - (history-len int32 :offset-assert 260) - (history-next-index int32 :offset-assert 264) - (hit? symbol :offset-assert 268) - (going-up? symbol :offset-assert 272) - (check-z-thresh? symbol :offset-assert 276) - (activate-z-thresh float :offset-assert 280) - (deactivate-z-thresh float :offset-assert 284) - (spawned-time time-frame :offset-assert 288) - (last-update-time time-frame :offset-assert 296) - (spin-time time-frame :offset-assert 304) - (last-spit-time time-frame :offset-assert 312) - (last-player-in-air-time time-frame :offset-assert 320) - (started-birthing-time time-frame :offset-assert 328) - (neck joint-mod :offset-assert 336) - (player-attack-id uint64 :offset-assert 344) - (leg-socket-part-time time-frame 6 :offset-assert 352) - (orient-rot vector :inline :offset-assert 400) - (anchor-trans vector :inline :offset-assert 416) - (thread-min-trans vector :inline :offset-assert 432) - (swing-pos vector :inline :offset-assert 448) - (swing-base-pos vector :inline :offset-assert 464) - (swing-vel vector :inline :offset-assert 480) + ((root collide-shape :override) + (mode uint64) + (damage int32) + (baby-count int32) + (max-baby-count int32) + (birthing-counter int32) + (spit-counter int32) + (leg-socket-part-mask int32) + (dist-from-anchor float) + (targ-dist-from-anchor float) + (idle-dist-from-anchor float) + (player-sticky-dist-from-anchor float) + (max-dist-from-anchor float) + (activate-xz-dist float) + (deactivate-xz-dist float) + (max-spit-xz-dist float) + (max-swing-radius float) + (spin-vel float) + (thread-speed float) + (thread-vel float) + (history mother-spider-history-array) + (history-len int32) + (history-next-index int32) + (hit? symbol) + (going-up? symbol) + (check-z-thresh? symbol) + (activate-z-thresh float) + (deactivate-z-thresh float) + (spawned-time time-frame) + (last-update-time time-frame) + (spin-time time-frame) + (last-spit-time time-frame) + (last-player-in-air-time time-frame) + (started-birthing-time time-frame) + (neck joint-mod) + (player-attack-id uint64) + (leg-socket-part-time time-frame 6) + (orient-rot vector :inline) + (anchor-trans vector :inline) + (thread-min-trans vector :inline) + (swing-pos vector :inline) + (swing-base-pos vector :inline) + (swing-vel vector :inline) ) - :heap-base #x180 - :method-count-assert 32 - :size-assert #x1f0 - :flag-assert #x20018001f0 (:methods - (mother-spider-method-20 (_type_ vector vector) symbol 20) - (mother-spider-method-21 (_type_ vector float symbol) symbol 21) - (mother-spider-method-22 (_type_ matrix vector) float 22) - (mother-spider-method-23 (_type_) none 23) - (shadow-handler (_type_) number 24) - (letgo-player? (_type_) symbol 25) - (grab-player? (_type_) symbol 26) - (mother-spider-method-27 (_type_) none 27) - (mother-spider-method-28 (_type_) none 28) - (mother-spider-method-29 (_type_ symbol symbol) none 29) - (spawn-child (_type_ vector vector symbol) int 30) - (is-player-stuck? (_type_) symbol 31) + (mother-spider-method-20 (_type_ vector vector) symbol) + (mother-spider-method-21 (_type_ vector float symbol) symbol) + (mother-spider-method-22 (_type_ matrix vector) float) + (mother-spider-method-23 (_type_) none) + (shadow-handler (_type_) number) + (letgo-player? (_type_) symbol) + (grab-player? (_type_) symbol) + (mother-spider-method-27 (_type_) none) + (mother-spider-method-28 (_type_) none) + (mother-spider-method-29 (_type_ symbol symbol) none) + (spawn-child (_type_ vector vector symbol) int) + (is-player-stuck? (_type_) symbol) ) (:states mother-spider-birth-baby @@ -189,7 +169,7 @@ ) ;; definition for method 3 of type mother-spider -(defmethod inspect mother-spider ((this mother-spider)) +(defmethod inspect ((this mother-spider)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc index b48a0f82786..65b911e31e6 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc @@ -3,17 +3,13 @@ ;; definition of type mother-spider-proj (deftype mother-spider-proj (projectile) - ((parent-process (pointer projectile) :offset 12) - (facing-dir vector :inline :offset-assert 416) + ((parent-process (pointer projectile) :overlay-at parent) + (facing-dir vector :inline) ) - :heap-base #x140 - :method-count-assert 29 - :size-assert #x1b0 - :flag-assert #x1d014001b0 ) ;; definition for method 3 of type mother-spider-proj -(defmethod inspect mother-spider-proj ((this mother-spider-proj)) +(defmethod inspect ((this mother-spider-proj)) (let ((t9-0 (method-of-type projectile inspect))) (t9-0 this) ) @@ -239,13 +235,13 @@ ) ;; definition for method 24 of type mother-spider-proj -(defmethod projectile-method-24 mother-spider-proj ((this mother-spider-proj)) +(defmethod projectile-method-24 ((this mother-spider-proj)) (with-pp - (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) + (spawn (-> this part) (the-as vector (-> this root root-prim prim-core))) (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) (set! (-> s5-0 id) (-> this sound-id)) - (let ((a1-1 (-> this root-override trans))) + (let ((a1-1 (-> this root trans))) (let ((s4-0 pp)) (when (= a1-1 #t) (if (and s4-0 (type-type? (-> s4-0 type) process-drawable) (nonzero? (-> (the-as process-drawable s4-0) root))) @@ -261,7 +257,7 @@ ) (let ((f0-5 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (current-time) 75))))))))) (find-ground-and-draw-shadow - (-> this root-override trans) + (-> this root trans) (the-as vector #f) f0-5 (collide-kind background) @@ -277,15 +273,15 @@ ;; definition for function mother-spider-proj-update-velocity ;; INFO: Return type mismatch int vs none. (defun mother-spider-proj-update-velocity ((arg0 mother-spider-proj)) - (when (>= (vector-vector-xz-distance (-> arg0 parent-process 0 root-override trans) (-> arg0 target)) - (vector-vector-xz-distance (-> arg0 parent-process 0 root-override trans) (-> arg0 root-override trans)) + (when (>= (vector-vector-xz-distance (-> arg0 parent-process 0 root trans) (-> arg0 target)) + (vector-vector-xz-distance (-> arg0 parent-process 0 root trans) (-> arg0 root trans)) ) - (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target) (-> arg0 root-override trans))) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target) (-> arg0 root trans))) (s4-0 (new 'stack-no-clear 'vector)) - (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) + (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root transv) 1.0)) ) - (if (logtest? (-> arg0 root-override status) (cshape-moving-flags tsurf)) - (vector-flatten! s3-1 s3-1 (-> arg0 root-override local-normal)) + (if (logtest? (-> arg0 root status) (cshape-moving-flags tsurf)) + (vector-flatten! s3-1 s3-1 (-> arg0 root local-normal)) ) (vector-normalize-copy! s4-0 s3-1 1.0) (let ((s3-2 (new 'stack-no-clear 'matrix))) @@ -299,7 +295,7 @@ (vector-matrix*! s5-0 s5-0 s3-2) ) (vector-normalize! s5-0 1.0) - (vector-float*! (-> arg0 root-override transv) s5-0 (-> arg0 max-speed)) + (vector-float*! (-> arg0 root transv) s5-0 (-> arg0 max-speed)) ) ) 0 @@ -308,7 +304,7 @@ ;; definition for method 26 of type mother-spider-proj ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-26 mother-spider-proj ((this mother-spider-proj)) +(defmethod projectile-method-26 ((this mother-spider-proj)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) @@ -329,7 +325,7 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (logclear! (-> this mask) (process-mask enemy)) (logclear! (-> this mask) (process-mask crate)) @@ -342,7 +338,7 @@ ;; definition for method 27 of type mother-spider-proj ;; INFO: Used lq/sq ;; INFO: Return type mismatch sound-id vs none. -(defmethod projectile-method-27 mother-spider-proj ((this mother-spider-proj)) +(defmethod projectile-method-27 ((this mother-spider-proj)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 326) this)) (set! (-> this max-speed) 32768.0) (set! (-> this update-velocity) mother-spider-proj-update-velocity) @@ -361,7 +357,7 @@ ;; definition for method 28 of type mother-spider-proj ;; INFO: Used lq/sq ;; INFO: Return type mismatch vector vs none. -(defmethod projectile-method-28 mother-spider-proj ((this mother-spider-proj)) +(defmethod projectile-method-28 ((this mother-spider-proj)) (when (and *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) @@ -371,7 +367,7 @@ (let ((gp-0 (-> this target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (+! (-> gp-0 y) 4915.2) - (let ((f0-2 (vector-vector-distance gp-0 (-> this root-override trans))) + (let ((f0-2 (vector-vector-distance gp-0 (-> this root trans))) (a2-0 (new 'stack-no-clear 'vector)) ) (if (>= 0.0 f0-2) @@ -400,7 +396,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (if (nonzero? (-> self sound-id)) @@ -424,7 +420,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (if (nonzero? (-> self sound-id)) diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc index cdbc8fe32d0..17b2b4efecc 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc @@ -249,7 +249,7 @@ (else (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((v1-5 (target-pos 0))) - (vector-! gp-0 (-> self root-override trans) v1-5) + (vector-! gp-0 (-> self root trans) v1-5) ) (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 1.0) @@ -266,7 +266,7 @@ (else (let ((gp-1 (new 'stack-no-clear 'vector))) (let ((v1-10 (-> (the-as process-drawable arg0) root trans))) - (vector-! gp-1 (-> self root-override trans) v1-10) + (vector-! gp-1 (-> self root trans) v1-10) ) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) @@ -288,7 +288,7 @@ ) (let ((gp-2 (new 'stack-no-clear 'vector))) (let ((v1-20 (target-pos 0))) - (vector-! gp-2 (-> self root-override trans) v1-20) + (vector-! gp-2 (-> self root trans) v1-20) ) (set! (-> gp-2 y) 0.0) (vector-normalize! gp-2 1.0) @@ -349,7 +349,7 @@ ) ;; definition for method 30 of type mother-spider -(defmethod spawn-child mother-spider ((this mother-spider) (arg0 vector) (arg1 vector) (arg2 symbol)) +(defmethod spawn-child ((this mother-spider) (arg0 vector) (arg1 vector) (arg2 symbol)) (let ((s3-0 (new 'stack-no-clear 'baby-spider-spawn-params))) (init! s3-0 arg2 #f #t #f 7 1 'untrigger) (set-delay! s3-0 (seconds 9)) @@ -362,7 +362,7 @@ ) ;; definition for method 31 of type mother-spider -(defmethod is-player-stuck? mother-spider ((this mother-spider)) +(defmethod is-player-stuck? ((this mother-spider)) (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) @@ -383,20 +383,20 @@ ;; definition for method 27 of type mother-spider ;; INFO: Return type mismatch symbol vs none. -(defmethod mother-spider-method-27 mother-spider ((this mother-spider)) +(defmethod mother-spider-method-27 ((this mother-spider)) (none) ) ;; definition for method 28 of type mother-spider ;; INFO: Return type mismatch int vs none. -(defmethod mother-spider-method-28 mother-spider ((this mother-spider)) +(defmethod mother-spider-method-28 ((this mother-spider)) 0 (none) ) ;; definition for method 24 of type mother-spider ;; INFO: Used lq/sq -(defmethod shadow-handler mother-spider ((this mother-spider)) +(defmethod shadow-handler ((this mother-spider)) (cond ((and (-> this draw shadow) (zero? (-> this draw cur-lod)) @@ -406,7 +406,7 @@ (a1-0 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> this root-override trans quad)) + (set! (-> a1-0 quad) (-> this root trans quad)) (set-vector! a2-0 0.0 -81920.0 0.0 1.0) (+! (-> a1-0 y) -8192.0) (cond @@ -434,7 +434,7 @@ (set! (-> v1-17 settings top-plane w) (- (+ 6144.0 (-> s5-0 intersect y)))) ) 0 - (let* ((f3-0 (vector-vector-distance (-> s5-0 intersect) (-> this root-override trans))) + (let* ((f3-0 (vector-vector-distance (-> s5-0 intersect) (-> this root trans))) (f0-14 (* 0.000030517578 (fmin 32768.0 (fmax 0.0 (+ -57344.0 f3-0))))) ) (set! (-> this draw shadow-ctrl settings shadow-dir w) (lerp 409600.0 40960.0 f0-14)) @@ -459,7 +459,7 @@ ) ;; definition for method 26 of type mother-spider -(defmethod grab-player? mother-spider ((this mother-spider)) +(defmethod grab-player? ((this mother-spider)) (when *target* (let ((s5-0 (target-pos 0))) (when (and (>= 40960.0 (- (-> this thread-min-trans y) (-> s5-0 y))) @@ -467,7 +467,7 @@ ) (cond ((-> this check-z-thresh?) - (let ((f0-3 (- (-> s5-0 z) (-> this root-override trans z)))) + (let ((f0-3 (- (-> s5-0 z) (-> this root trans z)))) (if (>= (-> this activate-z-thresh) f0-3) (return #t) ) @@ -484,13 +484,13 @@ ) ;; definition for method 25 of type mother-spider -(defmethod letgo-player? mother-spider ((this mother-spider)) +(defmethod letgo-player? ((this mother-spider)) (if (not *target*) (return #t) ) (let ((a1-0 (target-pos 0))) (when (-> this check-z-thresh?) - (if (>= (- (-> a1-0 z) (-> this root-override trans z)) (-> this deactivate-z-thresh)) + (if (>= (- (-> a1-0 z) (-> this root trans z)) (-> this deactivate-z-thresh)) (return #t) ) ) @@ -505,7 +505,7 @@ ;; definition for method 21 of type mother-spider ;; INFO: Used lq/sq -(defmethod mother-spider-method-21 mother-spider ((this mother-spider) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod mother-spider-method-21 ((this mother-spider) (arg0 vector) (arg1 float) (arg2 symbol)) (local-vars (sv-112 process) (sv-128 vector) (sv-144 vector)) (let ((f30-0 (vector-length (-> this swing-pos)))) (when (< 0.0 f30-0) @@ -535,7 +535,7 @@ (set! (-> this spin-vel) 131072.0) (set-time! (-> this spin-time)) (let ((s4-1 (-> this damage)) - (s3-1 (-> this root-override root-prim)) + (s3-1 (-> this root root-prim)) ) (dotimes (s2-2 2) (when (< (-> this damage) 6) @@ -578,7 +578,7 @@ ) ;; definition for method 29 of type mother-spider -(defmethod mother-spider-method-29 mother-spider ((this mother-spider) (arg0 symbol) (arg1 symbol)) +(defmethod mother-spider-method-29 ((this mother-spider) (arg0 symbol) (arg1 symbol)) (let ((v1-1 (current-time))) (when (!= v1-1 (-> this last-update-time)) (set! (-> this last-update-time) v1-1) @@ -586,11 +586,11 @@ (let ((f0-1 (fmax 0.0 (- (-> this dist-from-anchor) (-> this idle-dist-from-anchor))))) (cond ((>= f0-1 20480.0) - (vector-identity! (-> this root-override scale)) + (vector-identity! (-> this root scale)) ) (else (let ((f0-2 (* 0.000048828126 f0-1))) - (set-vector! (-> this root-override scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) ) ) @@ -625,12 +625,7 @@ (case (-> this mode) ((1 2) (if *target* - (look-at-enemy! - (-> *target* neck) - (the-as vector (-> this root-override root-prim prim-core)) - 'attacking - this - ) + (look-at-enemy! (-> *target* neck) (the-as vector (-> this root root-prim prim-core)) 'attacking this) ) ) ) @@ -645,7 +640,7 @@ ;; definition for method 23 of type mother-spider ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod mother-spider-method-23 mother-spider ((this mother-spider)) +(defmethod mother-spider-method-23 ((this mother-spider)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -765,23 +760,23 @@ (let* ((f30-2 (-> this dist-from-anchor)) (f28-2 (* 10430.379 (/ f0-26 f30-2))) ) - (set-vector! (-> this root-override trans) 0.0 (* (cos f28-2) (- f30-2)) (* (sin f28-2) f30-2) 1.0) + (set-vector! (-> this root trans) 0.0 (* (cos f28-2) (- f30-2)) (* (sin f28-2) f30-2) 1.0) ) (let ((f0-36 (atan (-> this swing-pos x) (-> this swing-pos z)))) - (vector-rotate-around-y! (-> this root-override trans) (-> this root-override trans) f0-36) + (vector-rotate-around-y! (-> this root trans) (-> this root trans) f0-36) ) - (vector+! (-> this root-override trans) (-> this root-override trans) (-> this anchor-trans)) + (vector+! (-> this root trans) (-> this root trans) (-> this anchor-trans)) ) (else - (set! (-> this root-override trans quad) (-> this anchor-trans quad)) - (set! (-> this root-override trans y) (- (-> this root-override trans y) (-> this dist-from-anchor))) + (set! (-> this root trans quad) (-> this anchor-trans quad)) + (set! (-> this root trans y) (- (-> this root trans y) (-> this dist-from-anchor))) ) ) ) (let ((v1-51 (-> this draw bounds))) - (vector+! v1-51 (-> this root-override trans) (-> this anchor-trans)) + (vector+! v1-51 (-> this root trans) (-> this anchor-trans)) (vector-float*! v1-51 v1-51 0.5) - (vector-! v1-51 v1-51 (-> this root-override trans)) + (vector-! v1-51 v1-51 (-> this root trans)) (set! (-> v1-51 w) (+ 28672.0 (* 0.5 (-> this dist-from-anchor)))) ) (cond @@ -798,9 +793,7 @@ (cond (*target* (let* ((v1-59 (target-pos 0)) - (f0-59 - (atan (- (-> v1-59 x) (-> this root-override trans x)) (- (-> v1-59 z) (-> this root-override trans z))) - ) + (f0-59 (atan (- (-> v1-59 x) (-> this root trans x)) (- (-> v1-59 z) (-> this root trans z)))) ) (if (>= 3640.889 (fabs (deg- f0-59 (-> this orient-rot y)))) (set! (-> this spin-vel) 0.0) @@ -816,9 +809,7 @@ (else (when *target* (let* ((v1-66 (target-pos 0)) - (f0-69 - (atan (- (-> v1-66 x) (-> this root-override trans x)) (- (-> v1-66 z) (-> this root-override trans z))) - ) + (f0-69 (atan (- (-> v1-66 x) (-> this root trans x)) (- (-> v1-66 z) (-> this root trans z)))) ) (set! (-> this orient-rot y) (deg-seek-smooth (-> this orient-rot y) f0-69 (* 32768.0 (seconds-per-frame)) 0.2) @@ -827,7 +818,7 @@ ) ) ) - (quaternion-zxy! (-> this root-override quat) (-> this orient-rot)) + (quaternion-zxy! (-> this root quat) (-> this orient-rot)) 0 (none) ) @@ -842,13 +833,13 @@ 0 (set! (-> self mode) (the-as uint 0)) (set! (-> self skel postbind-function) (the-as (function process-drawable none) 0)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (shut-down! (-> self neck)) (logior! (-> self mask) (process-mask actor-pause)) (logior! (-> self draw status) (draw-status hidden)) ) :exit (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (set! (-> self skel postbind-function) mother-spider-full-joint-callback) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) @@ -1072,12 +1063,12 @@ (when (and *target* (time-elapsed? (-> self last-spit-time) (seconds 3)) (time-elapsed? (-> self last-player-in-air-time) (seconds 0.06)) - (>= (-> self max-spit-xz-dist) (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) + (>= (-> self max-spit-xz-dist) (vector-vector-xz-distance (-> self root trans) (target-pos 0))) ) (let ((gp-2 (new 'stack-no-clear 'vector)) (s5-2 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-2 quad) (-> self root-override trans quad)) + (set! (-> gp-2 quad) (-> self root trans quad)) (set! (-> gp-2 w) 4096.0) (when (sphere-in-view-frustum? (the-as sphere gp-2)) (vector<-cspace! gp-2 (joint-node-index mother-spider-lod0-jg jaw)) @@ -1261,7 +1252,7 @@ (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (nav-control-method-21 (-> self nav) (-> self root-override trans)) + (nav-control-method-21 (-> self nav) (-> self root trans)) ) ) (go mother-spider-birth-baby) @@ -1306,7 +1297,7 @@ (if (letgo-player? self) (go mother-spider-traveling (the-as uint 0)) ) - (if (not (nav-control-method-21 (-> self nav) (-> self root-override trans))) + (if (not (nav-control-method-21 (-> self nav) (-> self root trans))) (go mother-spider-birthing) ) (mother-spider-method-29 self #t #t) @@ -1322,7 +1313,7 @@ (s4-0 (new 'stack-no-clear 'vector)) ) (when (mother-spider-method-20 self s5-0 s4-0) - (process-spawn mother-spider-egg (-> self entity) (-> self root-override trans) s5-0 s4-0 :to self) + (process-spawn mother-spider-egg (-> self entity) (-> self root trans) s5-0 s4-0 :to self) (+! (-> self baby-count) 1) (+! (-> self birthing-counter) -1) (sound-play "lay-eggs") @@ -1340,9 +1331,9 @@ ;; definition for method 20 of type mother-spider ;; INFO: Used lq/sq -(defmethod mother-spider-method-20 mother-spider ((this mother-spider) (arg0 vector) (arg1 vector)) +(defmethod mother-spider-method-20 ((this mother-spider) (arg0 vector) (arg1 vector)) (set! (-> this nav nav-cull-radius) 40960.0) - (set-current-poly! (-> this nav) (nav-control-method-16 (-> this nav) (-> this root-override trans))) + (set-current-poly! (-> this nav) (nav-control-method-16 (-> this nav) (-> this root trans))) (nav-control-method-28 (-> this nav) (the-as collide-kind -1)) (dotimes (s3-1 4) (let ((f28-0 (+ 32768.0 (-> this orient-rot y))) @@ -1355,13 +1346,13 @@ (set-vector! s1-0 (sin f28-1) 0.0 (cos f28-1) 1.0) ) (vector-float*! s2-1 s1-0 f30-0) - (nav-control-method-35 (-> this nav) (-> this nav travel) (-> this root-override trans) s2-1 s1-0 f30-0) + (nav-control-method-35 (-> this nav) (-> this nav travel) (-> this root trans) s2-1 s1-0 f30-0) ) (nav-control-method-24 (-> this nav) f30-0 (the-as clip-travel-vector-to-mesh-return-info #f)) ) (cond ((>= (vector-xz-length (-> this nav travel)) 4096.0) - (vector+! arg0 (-> this root-override trans) (-> this nav travel)) + (vector+! arg0 (-> this root trans) (-> this nav travel)) (let ((s2-2 (new 'stack-no-clear 'collide-tri-result))) (cond ((>= (fill-and-probe-using-line-sphere @@ -1391,7 +1382,7 @@ ) ) ) - (project-onto-nav-mesh (-> this nav) arg0 (-> this root-override trans)) + (project-onto-nav-mesh (-> this nav) arg0 (-> this root trans)) (let ((a1-12 (new 'stack-no-clear 'vector)) (s3-2 (new 'stack-no-clear 'collide-tri-result)) ) @@ -1498,7 +1489,7 @@ ) (logclear! (-> self mask) (process-mask actor-pause)) (ja-channel-push! 1 (seconds 0.1)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :group! mother-spider-die-from-uppercut-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1523,7 +1514,7 @@ (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) (ja-channel-push! 1 (seconds 0.1)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :group! mother-spider-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1539,7 +1530,7 @@ :event mother-spider-death-event-handler :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (set! (-> self skel postbind-function) #f) (logior! (-> self draw status) (draw-status hidden)) (while (-> self child) @@ -1559,7 +1550,7 @@ (let* ((v1-1 (the-as mother-spider-thread (+ (the-as uint *mother-spider-threads*) (* s5-0 16)))) (s4-0 (-> arg0 node-list data (-> v1-1 joint-index) bone transform)) ) - (vector-! (-> s4-0 vector 3) (-> arg0 root-override trans) (-> arg0 anchor-trans)) + (vector-! (-> s4-0 vector 3) (-> arg0 root trans) (-> arg0 anchor-trans)) (vector-float*! (-> s4-0 vector 3) (-> s4-0 vector 3) (-> v1-1 trans-u)) (vector+! (-> s4-0 vector 3) (-> s4-0 vector 3) (-> arg0 anchor-trans)) (let ((f1-2 (- (-> s4-0 vector 3 x) (-> arg0 anchor-trans x))) @@ -1577,8 +1568,8 @@ (let ((a0-11 (-> arg0 node-list data 22 bone transform)) (a2-7 (new 'stack-no-clear 'vector)) ) - (vector-! a2-7 (-> arg0 root-override trans) (-> a0-11 vector 3)) - (vector+! a2-7 a2-7 (-> arg0 root-override trans)) + (vector-! a2-7 (-> arg0 root trans) (-> a0-11 vector 3)) + (vector+! a2-7 a2-7 (-> arg0 root trans)) (mother-spider-method-22 arg0 a1-0 a2-7) ) ) @@ -1603,7 +1594,7 @@ ) ;; definition for method 22 of type mother-spider -(defmethod mother-spider-method-22 mother-spider ((this mother-spider) (arg0 matrix) (arg1 vector)) +(defmethod mother-spider-method-22 ((this mother-spider) (arg0 matrix) (arg1 vector)) (rlet ((vf0 :class vf)) (init-vf0-vector) (vector-! (-> arg0 vector 2) arg1 (-> arg0 vector 3)) @@ -1627,9 +1618,9 @@ ) ;; definition for method 12 of type mother-spider -(defmethod run-logic? mother-spider ((this mother-spider)) +(defmethod run-logic? ((this mother-spider)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) - (or (< (vector-vector-xz-distance (-> this root-override trans) (math-camera-pos)) (-> this deactivate-xz-dist)) + (or (< (vector-vector-xz-distance (-> this root trans) (math-camera-pos)) (-> this deactivate-xz-dist)) (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) @@ -1638,7 +1629,7 @@ ;; definition for method 7 of type mother-spider ;; INFO: Return type mismatch process-drawable vs mother-spider. -(defmethod relocate mother-spider ((this mother-spider) (arg0 int)) +(defmethod relocate ((this mother-spider) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) @@ -1648,7 +1639,7 @@ ;; definition for method 11 of type mother-spider ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! mother-spider ((this mother-spider) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mother-spider) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-64 vector)) (set! (-> this baby-count) 0) (set! (-> this spit-counter) 0) @@ -1759,15 +1750,15 @@ ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *mother-spider-sg* '()) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> this nav nearest-y-threshold) 409600.0) - (logclear! (-> this root-override nav-flags) (nav-flags navf0)) - (logclear! (-> this root-override nav-flags) (nav-flags navf1)) + (logclear! (-> this root nav-flags) (nav-flags navf0)) + (logclear! (-> this root nav-flags) (nav-flags navf1)) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (set! (-> this fact) @@ -1785,8 +1776,8 @@ (set! (-> v0-30 max-dist) 102400.0) (set! (-> v0-30 ignore-angle) 16384.0) ) - (set! (-> this thread-min-trans quad) (-> this root-override trans quad)) - (set! (-> this anchor-trans quad) (-> this root-override trans quad)) + (set! (-> this thread-min-trans quad) (-> this root trans quad)) + (set! (-> this anchor-trans quad) (-> this root trans quad)) (set! (-> this max-swing-radius) 73728.0) (set! (-> this max-baby-count) 4) (let ((s4-1 #f)) @@ -1818,10 +1809,10 @@ (set! (-> this max-dist-from-anchor) (- (-> this anchor-trans y) (-> this thread-min-trans y))) (set! (-> this player-sticky-dist-from-anchor) (-> this max-dist-from-anchor)) (set! (-> this targ-dist-from-anchor) (-> this idle-dist-from-anchor)) - (set! (-> this root-override trans quad) (-> this anchor-trans quad)) - (set! (-> this root-override trans y) (- (-> this root-override trans y) (-> this idle-dist-from-anchor))) + (set! (-> this root trans quad) (-> this anchor-trans quad)) + (set! (-> this root trans y) (- (-> this root trans y) (-> this idle-dist-from-anchor))) (set-vector! (-> this orient-rot) 0.0 0.0 0.0 1.0) - (quaternion-zxy! (-> this root-override quat) (-> this orient-rot)) + (quaternion-zxy! (-> this root quat) (-> this orient-rot)) (ja-channel-push! 1 0) (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! diff --git a/test/decompiler/reference/jak1/levels/maincave/spiderwebs_REF.gc b/test/decompiler/reference/jak1/levels/maincave/spiderwebs_REF.gc index 552fe0e41aa..208fe2dc2d3 100644 --- a/test/decompiler/reference/jak1/levels/maincave/spiderwebs_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/spiderwebs_REF.gc @@ -33,12 +33,8 @@ ;; definition of type spiderwebs (deftype spiderwebs (process-drawable) - ((spring-height meters :offset-assert 176) + ((spring-height meters) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states spiderwebs-bounce spiderwebs-idle @@ -46,7 +42,7 @@ ) ;; definition for method 3 of type spiderwebs -(defmethod inspect spiderwebs ((this spiderwebs)) +(defmethod inspect ((this spiderwebs)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -131,7 +127,7 @@ ;; definition for method 11 of type spiderwebs ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! spiderwebs ((this spiderwebs) (arg0 entity-actor)) +(defmethod init-from-entity! ((this spiderwebs) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) diff --git a/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc b/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc index 2af062ab3d8..b14bbbb3396 100644 --- a/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc @@ -3,13 +3,9 @@ ;; definition of type babak-with-cannon (deftype babak-with-cannon (babak) - ((cannon-ent entity :offset-assert 400) - (distance float :offset-assert 404) + ((cannon-ent entity) + (distance float) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x198 - :flag-assert #x4c01300198 (:states babak-with-cannon-jump-off-cannon babak-with-cannon-jump-onto-cannon @@ -18,7 +14,7 @@ ) ;; definition for method 3 of type babak-with-cannon -(defmethod inspect babak-with-cannon ((this babak-with-cannon)) +(defmethod inspect ((this babak-with-cannon)) (let ((t9-0 (method-of-type babak inspect))) (t9-0 this) ) @@ -141,7 +137,7 @@ nav-enemy-default-event-handler ;; definition for function babak-with-cannon-compute-ride-point ;; INFO: Used lq/sq (defun babak-with-cannon-compute-ride-point ((arg0 mistycannon) (arg1 vector)) - (set! (-> arg1 quad) (-> arg0 root-override trans quad)) + (set! (-> arg1 quad) (-> arg0 root trans quad)) (let ((a1-4 (new 'static 'vector :y 18149.377 :z -17289.217 :w 1.0)) (a2-0 (-> arg0 node-list data 3 bone transform)) ) @@ -369,7 +365,7 @@ nav-enemy-default-event-handler ) ;; definition for method 39 of type babak-with-cannon -(defmethod common-post babak-with-cannon ((this babak-with-cannon)) +(defmethod common-post ((this babak-with-cannon)) (cond ((= (level-status *level* 'beach) 'active) (spool-push *art-control* "beachcam-cannon" 0 this -99.0) @@ -384,7 +380,7 @@ nav-enemy-default-event-handler ;; definition for method 11 of type babak-with-cannon ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! babak-with-cannon ((this babak-with-cannon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this babak-with-cannon) (arg0 entity-actor)) (initialize-collision this) (process-drawable-from-entity! this arg0) (nav-enemy-method-48 this) diff --git a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc index 52111b61134..65e1705c12c 100644 --- a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc @@ -220,24 +220,21 @@ ;; definition of type balloonlurker-bank (deftype balloonlurker-bank (basic) - ((buoyancy-depth-offset meters :offset-assert 4) - (player-mass float :offset-assert 8) - (rudder-factor float :offset-assert 12) - (max-engine-thrust float :offset-assert 16) - (max-rudder-deflection-angle float :offset-assert 20) - (throttle-factor float :offset-assert 24) - (throttle-distance float :offset-assert 28) - (throttle-close-distance float :offset-assert 32) - (explosion-force float :offset-assert 36) - (mine-weight float :offset-assert 40) + ((buoyancy-depth-offset meters) + (player-mass float) + (rudder-factor float) + (max-engine-thrust float) + (max-rudder-deflection-angle float) + (throttle-factor float) + (throttle-distance float) + (throttle-close-distance float) + (explosion-force float) + (mine-weight float) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type balloonlurker-bank -(defmethod inspect balloonlurker-bank ((this balloonlurker-bank)) +(defmethod inspect ((this balloonlurker-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tbuoyancy-depth-offset: (meters ~m)~%" (-> this buoyancy-depth-offset)) (format #t "~Tplayer-mass: ~f~%" (-> this player-mass)) @@ -297,34 +294,30 @@ ;; definition of type balloonlurker (deftype balloonlurker (rigid-body-platform) - ((explosion-force-position vector :inline :offset-assert 736) - (explosion-force vector :inline :offset-assert 752) - (explosion symbol :offset-assert 768) - (explosion-joint-index uint16 2 :offset-assert 772) - (explosion-joint-index-bytes int8 4 :offset 772) - (vulnerable symbol :offset-assert 776) - (water-y float :offset-assert 780) - (propeller joint-mod-spinner :offset-assert 784) - (rudder joint-mod-set-local :offset-assert 788) - (mine joint-mod-set-world 2 :offset-assert 792) - (buoyancy-factor float :offset-assert 800) - (rudder-control float :offset-assert 804) - (throttle-control float :offset-assert 808) - (engine-thrust float :offset-assert 812) - (dest-point vector :inline :offset-assert 816) - (dest-point-old vector :inline :offset-assert 832) - (dest-index int8 :offset-assert 848) - (auto-pilot symbol :offset-assert 852) - (dead symbol :offset-assert 856) - (anim-frame float :offset-assert 860) - (engine-sound-id sound-id :offset-assert 864) - (pedal-sound-id sound-id :offset-assert 868) - (frame-count int8 :offset-assert 872) + ((explosion-force-position vector :inline) + (explosion-force vector :inline) + (explosion symbol) + (explosion-joint-index uint16 2) + (explosion-joint-index-bytes int8 4 :overlay-at (-> explosion-joint-index 0)) + (vulnerable symbol) + (water-y float) + (propeller joint-mod-spinner) + (rudder joint-mod-set-local) + (mine joint-mod-set-world 2) + (buoyancy-factor float) + (rudder-control float) + (throttle-control float) + (engine-thrust float) + (dest-point vector :inline) + (dest-point-old vector :inline) + (dest-index int8) + (auto-pilot symbol) + (dead symbol) + (anim-frame float) + (engine-sound-id sound-id) + (pedal-sound-id sound-id) + (frame-count int8) ) - :heap-base #x300 - :method-count-assert 35 - :size-assert #x369 - :flag-assert #x2303000369 (:states balloonlurker-die (balloonlurker-mine-explode int) @@ -333,7 +326,7 @@ ) ;; definition for method 3 of type balloonlurker -(defmethod inspect balloonlurker ((this balloonlurker)) +(defmethod inspect ((this balloonlurker)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) (t9-0 this) ) @@ -364,16 +357,12 @@ ;; definition of type balloonlurker-pilot (deftype balloonlurker-pilot (process-drawable) - ((parent-override (pointer balloonlurker) :offset 12) - (root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) + (parent-override (pointer balloonlurker) :overlay-at parent) ) - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 (:methods - (balloonlurker-pilot-method-20 (_type_) none 20) - (balloonlurker-pilot-method-21 (_type_) none 21) + (balloonlurker-pilot-method-20 (_type_) none) + (balloonlurker-pilot-method-21 (_type_) none) ) (:states balloonlurker-pilot-die @@ -382,7 +371,7 @@ ) ;; definition for method 3 of type balloonlurker-pilot -(defmethod inspect balloonlurker-pilot ((this balloonlurker-pilot)) +(defmethod inspect ((this balloonlurker-pilot)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -548,7 +537,7 @@ ;; definition for method 23 of type balloonlurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 balloonlurker ((this balloonlurker) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this balloonlurker) (arg0 float)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (-> this rbody matrix)) @@ -894,7 +883,7 @@ ) ;; definition for method 7 of type balloonlurker -(defmethod relocate balloonlurker ((this balloonlurker) (arg0 int)) +(defmethod relocate ((this balloonlurker) (arg0 int)) (if (nonzero? (-> this propeller)) (&+! (-> this propeller) arg0) ) @@ -930,9 +919,9 @@ ) ) :post (behavior () - (set! (-> self root-override trans quad) (-> self parent-override 0 root-overlay trans quad)) - (quaternion-copy! (-> self root-override quat) (-> self parent-override 0 root-overlay quat)) - (update-transforms! (-> self root-override)) + (set! (-> self root trans quad) (-> self parent-override 0 root-overlay trans quad)) + (quaternion-copy! (-> self root quat) (-> self parent-override 0 root-overlay quat)) + (update-transforms! (-> self root)) (ja-post) ) ) @@ -949,15 +938,11 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) - (rigid-body-method-17 - (-> self parent-override 0 rbody) - (-> self root-override trans) - (-> self root-override transv) - ) - (clear-collide-with-as (-> self root-override)) + (rigid-body-method-17 (-> self parent-override 0 rbody) (-> self root trans) (-> self root transv)) + (clear-collide-with-as (-> self root)) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! balloonlurker-pilot-death-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -967,18 +952,15 @@ (cleanup-for-death self) ) :post (behavior () - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) - ) - (integrate-no-collide! (-> self root-override) (-> self root-override transv)) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) + (integrate-no-collide! (-> self root) (-> self root transv)) (ja-post) ) ) ;; definition for method 20 of type balloonlurker-pilot ;; INFO: Return type mismatch int vs none. -(defmethod balloonlurker-pilot-method-20 balloonlurker-pilot ((this balloonlurker-pilot)) +(defmethod balloonlurker-pilot-method-20 ((this balloonlurker-pilot)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -995,7 +977,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1003,7 +985,7 @@ ;; definition for method 21 of type balloonlurker-pilot ;; INFO: Return type mismatch int vs none. -(defmethod balloonlurker-pilot-method-21 balloonlurker-pilot ((this balloonlurker-pilot)) +(defmethod balloonlurker-pilot-method-21 ((this balloonlurker-pilot)) (initialize-skeleton this *balloonlurker-pilot-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 6)) 0 @@ -1020,9 +1002,9 @@ (set! (-> self fact) (new 'process 'fact-info-enemy self (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> self root-override trans quad) (-> arg0 root-overlay trans quad)) - (set! (-> self root-override quat vec quad) (-> arg0 root-overlay quat vec quad)) - (set! (-> self root-override scale quad) (-> arg0 root-overlay scale quad)) + (set! (-> self root trans quad) (-> arg0 root-overlay trans quad)) + (set! (-> self root quat vec quad) (-> arg0 root-overlay quat vec quad)) + (set! (-> self root scale quad) (-> arg0 root-overlay scale quad)) (balloonlurker-pilot-method-21 self) (go balloonlurker-pilot-idle) (none) @@ -1030,7 +1012,7 @@ ;; definition for method 30 of type balloonlurker ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 balloonlurker ((this balloonlurker)) +(defmethod rigid-body-platform-method-30 ((this balloonlurker)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1088,7 +1070,7 @@ ;; definition for method 31 of type balloonlurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 balloonlurker ((this balloonlurker)) +(defmethod rigid-body-platform-method-31 ((this balloonlurker)) (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton this *balloonlurker-sg* '()) (set! (-> this root-overlay pause-adjust-distance) 1228800.0) @@ -1156,7 +1138,7 @@ ;; definition for method 11 of type balloonlurker ;; INFO: Return type mismatch object vs none. ;; WARN: Function (method 11 balloonlurker) has a return type of none, but the expression builder found a return statement. -(defmethod init-from-entity! balloonlurker ((this balloonlurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this balloonlurker) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (rigid-body-platform-method-30 this) (process-drawable-from-entity! this arg0) diff --git a/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc index 874fc94987c..776247edf82 100644 --- a/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc @@ -3,19 +3,15 @@ ;; definition of type bonelurker (deftype bonelurker (nav-enemy) - ((bump-player-time time-frame :offset-assert 400) + ((bump-player-time time-frame) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x198 - :flag-assert #x4c01300198 (:states bonelurker-stun ) ) ;; definition for method 3 of type bonelurker -(defmethod inspect bonelurker ((this bonelurker)) +(defmethod inspect ((this bonelurker)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -48,7 +44,7 @@ ;; definition for method 44 of type bonelurker ;; INFO: Return type mismatch symbol vs object. -(defmethod touch-handler bonelurker ((this bonelurker) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this bonelurker) (arg0 process) (arg1 event-message-block)) (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) @@ -65,7 +61,7 @@ ;; definition for method 43 of type bonelurker ;; INFO: Return type mismatch symbol vs object. -(defmethod attack-handler bonelurker ((this bonelurker) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this bonelurker) (arg0 process) (arg1 event-message-block)) (with-pp (set-time! (-> this state-time)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -471,7 +467,7 @@ nav-enemy-default-event-handler ;; definition for method 47 of type bonelurker ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision bonelurker ((this bonelurker)) +(defmethod initialize-collision ((this bonelurker)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -520,7 +516,7 @@ nav-enemy-default-event-handler ;; definition for method 48 of type bonelurker ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 bonelurker ((this bonelurker)) +(defmethod nav-enemy-method-48 ((this bonelurker)) (initialize-skeleton this *bonelurker-sg* '()) (init-defaults! this *bonelurker-nav-enemy-info*) (set! (-> this neck up) (the-as uint 0)) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc index 506b261cf9e..c9584714b2a 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc @@ -49,20 +49,16 @@ ;; definition of type keg-conveyor (deftype keg-conveyor (process-drawable) - ((pivot joint-mod-spinner :offset-assert 176) - (quat quaternion :inline :offset-assert 192) + ((pivot joint-mod-spinner) + (quat quaternion :inline) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14006000d0 (:states keg-conveyor-idle ) ) ;; definition for method 3 of type keg-conveyor -(defmethod inspect keg-conveyor ((this keg-conveyor)) +(defmethod inspect ((this keg-conveyor)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -73,21 +69,17 @@ ;; definition of type keg-conveyor-paddle (deftype keg-conveyor-paddle (process-drawable) - ((root-override collide-shape-moving :offset 112) - (object-on-paddle (pointer bouncing-float) :offset-assert 176) - (sync sync-info :inline :offset-assert 180) + ((root collide-shape-moving :override) + (object-on-paddle (pointer bouncing-float)) + (sync sync-info :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states keg-conveyor-paddle-idle ) ) ;; definition for method 3 of type keg-conveyor-paddle -(defmethod inspect keg-conveyor-paddle ((this keg-conveyor-paddle)) +(defmethod inspect ((this keg-conveyor-paddle)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -98,18 +90,14 @@ ;; definition of type keg (deftype keg (process-drawable) - ((root-override collide-shape-moving :offset 112) - (sync-offset float :offset-assert 176) - (keg-behavior int8 :offset-assert 180) - (path-position vector :inline :offset-assert 192) - (shadow-enable-plane vector :inline :offset-assert 208) - (smush smush-control :inline :offset-assert 224) - (sound-id sound-id :offset-assert 256) + ((root collide-shape-moving :override) + (sync-offset float) + (keg-behavior int8) + (path-position vector :inline) + (shadow-enable-plane vector :inline) + (smush smush-control :inline) + (sound-id sound-id) ) - :heap-base #xa0 - :method-count-assert 20 - :size-assert #x104 - :flag-assert #x1400a00104 (:states keg-die keg-in-chute @@ -120,7 +108,7 @@ ) ;; definition for method 3 of type keg -(defmethod inspect keg ((this keg)) +(defmethod inspect ((this keg)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -155,9 +143,9 @@ ;; definition for function keg-update-smush ;; INFO: Return type mismatch int vs none. (defun keg-update-smush ((arg0 keg) (arg1 float)) - (set! (-> arg0 root-override scale x) (+ 1.0 (* -1.0 arg1))) - (set! (-> arg0 root-override scale y) (+ 1.0 (* 2.0 arg1))) - (set! (-> arg0 root-override scale z) (+ 1.0 (* -1.0 arg1))) + (set! (-> arg0 root scale x) (+ 1.0 (* -1.0 arg1))) + (set! (-> arg0 root scale y) (+ 1.0 (* 2.0 arg1))) + (set! (-> arg0 root scale z) (+ 1.0 (* -1.0 arg1))) 0 (none) ) @@ -177,7 +165,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (sound-stop (-> self sound-id)) @@ -193,8 +181,8 @@ ((= (-> self keg-behavior) 1) ) (else - (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 163840.0) - (sound-play "barrel-roll" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) + (if (< (vector-vector-distance (-> self root trans) (ear-trans)) 163840.0) + (sound-play "barrel-roll" :id (-> self sound-id) :position (the-as symbol (-> self root trans))) ) ) ) @@ -215,10 +203,10 @@ (ja :num-func num-func-identity :frame-num 0.0) (loop (let ((gp-0 (-> (the-as process-drawable (-> self parent 0)) node-list data 4))) - (matrix->quaternion (-> self root-override quat) (-> gp-0 bone transform)) - (vector<-cspace! (-> self root-override trans) gp-0) + (matrix->quaternion (-> self root quat) (-> gp-0 bone transform)) + (vector<-cspace! (-> self root trans) gp-0) ) - (set! (-> self path-position quad) (-> self root-override trans quad)) + (set! (-> self path-position quad) (-> self root trans quad)) (set-time! (-> self state-time)) (suspend) ) @@ -231,11 +219,11 @@ :event keg-event-handler :code (behavior () (let ((gp-0 (new-stack-vector0))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (let ((s5-0 (eval-path-curve-div! (-> (the-as process-drawable (-> self parent 0)) path) (new-stack-vector0) 0.0 'interp) ) - (s4-0 (quaternion-copy! (new-stack-quaternion0) (-> self root-override quat))) + (s4-0 (quaternion-copy! (new-stack-quaternion0) (-> self root quat))) (s3-0 (new-stack-quaternion0)) (a1-3 (path-control-method-12 (-> (the-as process-drawable (-> self parent 0)) path) (new-stack-vector0) 0.0)) (f30-0 45.0) @@ -248,9 +236,9 @@ (go keg-on-path) ) (let ((f28-0 (/ (the float (- (current-time) (-> self state-time))) f30-0))) - (vector-lerp! (-> self root-override trans) gp-0 s5-0 f28-0) - (set! (-> self path-position quad) (-> self root-override trans quad)) - (quaternion-slerp! (-> self root-override quat) s4-0 s3-0 f28-0) + (vector-lerp! (-> self root trans) gp-0 s5-0 f28-0) + (set! (-> self path-position quad) (-> self root trans quad)) + (quaternion-slerp! (-> self root quat) s4-0 s3-0 f28-0) ) (ja :num! (loop!)) (suspend) @@ -300,8 +288,8 @@ 'interp ) (path-control-method-12 (-> (the-as keg-conveyor-paddle (-> self parent 0)) path) gp-0 sv-112) - (seek-toward-heading-vec! (-> self root-override) gp-0 131072.0 (seconds 0.1)) - (set! (-> self root-override trans quad) (-> self path-position quad)) + (seek-toward-heading-vec! (-> self root) gp-0 131072.0 (seconds 0.1)) + (set! (-> self root trans quad) (-> self path-position quad)) (when (= (-> self keg-behavior) 1) (cond ((>= (vector4-dot (camera-pos) (-> self shadow-enable-plane)) 0.0) @@ -353,14 +341,14 @@ keg-bounce-set-particle-rotation-callback (-> self ppointer) #f - (-> self root-override trans) + (-> self root trans) :to self ) ) (let ((f0-39 (update! (-> self smush)))) (keg-update-smush self f0-39) ) - (+! (-> self root-override trans y) (* f22-0 sv-48)) + (+! (-> self root trans y) (* f22-0 sv-48)) (set! (-> s5-0 x) 0.0) (set! (-> s5-0 y) 1.0) (set! (-> s5-0 z) 0.0) @@ -396,14 +384,14 @@ (logior! (-> v1-10 settings flags) (shadow-flags disable-draw)) ) 0 - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (vector-normalize! gp-0 1.0) (set-time! (-> self state-time)) (loop (if (time-elapsed? (-> self state-time) (seconds 1)) (go keg-die) ) - (let ((v1-23 (-> self root-override trans))) + (let ((v1-23 (-> self root trans))) (vector-float*! s5-0 gp-0 (* f30-0 (seconds-per-frame))) (set! (-> s5-0 y) (* f28-0 (seconds-per-frame))) (+! f28-0 (* f26-0 (seconds-per-frame))) @@ -448,9 +436,9 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> self root-override) s4-0) + (set! (-> self root) s4-0) ) - (set! (-> self root-override trans quad) (-> arg0 root-override trans quad)) + (set! (-> self root trans quad) (-> arg0 root trans quad)) (initialize-skeleton self *keg-sg* '()) (set! (-> self draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) (let ((v1-25 (-> self draw shadow-ctrl))) @@ -475,7 +463,7 @@ (logclear! (-> self mask) (process-mask actor-pause enemy)) (let ((gp-1 (new-stack-vector0))) (path-control-method-12 (-> (the-as process-drawable (-> self parent 0)) path) gp-1 0.0) - (set-heading-vec! (-> self root-override) gp-1) + (set-heading-vec! (-> self root) gp-1) ) (set! (-> self sound-id) (new-sound-id)) (go keg-on-paddle) @@ -518,9 +506,7 @@ ) (loop (let ((s4-0 #f)) - (when (or (not *target*) - (< 102400.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (when (or (not *target*) (< 102400.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (let ((v1-10 (-> *keg-conveyor-keg-spawn-table* gp-0))) (cond ((zero? v1-10) @@ -596,13 +582,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) (set! (-> self path) (new 'process 'curve-control self 'path -1000000000.0)) (logior! (-> self path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> self root-override trans quad) (-> arg0 root-override trans quad)) - (set! (-> self root-override quat vec quad) (-> arg0 root-override quat vec quad)) - (set! (-> self root-override scale quad) (-> arg0 root-override scale quad)) + (set! (-> self root trans quad) (-> arg0 root trans quad)) + (set! (-> self root quat vec quad) (-> arg0 root quat vec quad)) + (set! (-> self root scale quad) (-> arg0 root scale quad)) (initialize-skeleton self *keg-conveyor-paddle-sg* '()) (setup-params! (-> self sync) (the-as uint 4800) 0.0 0.15 0.15) (logclear! (-> self mask) (process-mask actor-pause enemy)) @@ -612,7 +598,7 @@ ) ;; definition for method 7 of type keg-conveyor -(defmethod relocate keg-conveyor ((this keg-conveyor) (arg0 int)) +(defmethod relocate ((this keg-conveyor) (arg0 int)) (if (nonzero? (-> this pivot)) (&+! (-> this pivot) arg0) ) @@ -623,7 +609,7 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. ;; WARN: Function (method 11 keg-conveyor) has a return type of none, but the expression builder found a return statement. -(defmethod init-from-entity! keg-conveyor ((this keg-conveyor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this keg-conveyor) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy death)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc index 607c0e3dac4..f5071028b4c 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc @@ -1045,17 +1045,13 @@ ;; definition of type boatpaddle (deftype boatpaddle (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states boatpaddle-idle ) ) ;; definition for method 3 of type boatpaddle -(defmethod inspect boatpaddle ((this boatpaddle)) +(defmethod inspect ((this boatpaddle)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1095,7 +1091,7 @@ ;; definition for method 11 of type boatpaddle ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! boatpaddle ((this boatpaddle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this boatpaddle) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -1108,20 +1104,16 @@ ;; definition of type windturbine (deftype windturbine (process-drawable) - ((spawn-particle-enable symbol :offset-assert 176) - (angle-speed float :offset-assert 180) + ((spawn-particle-enable symbol) + (angle-speed float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states windturbine-idle ) ) ;; definition for method 3 of type windturbine -(defmethod inspect windturbine ((this windturbine)) +(defmethod inspect ((this windturbine)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1167,7 +1159,7 @@ ;; definition for method 11 of type windturbine ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! windturbine ((this windturbine) (arg0 entity-actor)) +(defmethod init-from-entity! ((this windturbine) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -1183,16 +1175,12 @@ ;; definition of type mis-bone-bridge (deftype mis-bone-bridge (process-drawable) - ((root-override collide-shape-moving :offset 112) - (particle-group sparticle-launch-group :offset-assert 176) - (player-attack-id int32 :offset-assert 180) - (fall-anim-index int32 :offset-assert 184) - (hit-points int8 :offset-assert 188) + ((root collide-shape-moving :override) + (particle-group sparticle-launch-group) + (player-attack-id int32) + (fall-anim-index int32) + (hit-points int8) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbd - :flag-assert #x14005000bd (:states mis-bone-bridge-bump (mis-bone-bridge-fall symbol) @@ -1202,7 +1190,7 @@ ) ;; definition for method 3 of type mis-bone-bridge -(defmethod inspect mis-bone-bridge ((this mis-bone-bridge)) +(defmethod inspect ((this mis-bone-bridge)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1225,9 +1213,9 @@ (case arg2 (('attack) (let ((s5-0 (-> arg3 param 2)) - (gp-0 (vector-x-quaternion! (new-stack-vector0) (-> self root-override quat))) - (a0-4 (vector-z-quaternion! (new-stack-vector0) (-> self root-override quat))) - (v1-4 (vector-! (new-stack-vector0) (-> *target* control trans) (-> self root-override trans))) + (gp-0 (vector-x-quaternion! (new-stack-vector0) (-> self root quat))) + (a0-4 (vector-z-quaternion! (new-stack-vector0) (-> self root quat))) + (v1-4 (vector-! (new-stack-vector0) (-> *target* control trans) (-> self root trans))) ) 0.0 0.0 @@ -1261,7 +1249,7 @@ :code (behavior () (ja :num-func num-func-identity :frame-num 0.0) (loop - (if (and *target* (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and *target* (>= 32768.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id misty-bone-bridge-hint) "sksp0435" @@ -1324,7 +1312,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (ja-no-eval :group! (-> self draw art-group data (-> self fall-anim-index)) :num! (seek!) :frame-num 0.0) @@ -1345,7 +1333,7 @@ ;; definition for method 11 of type mis-bone-bridge ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! mis-bone-bridge ((this mis-bone-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mis-bone-bridge) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -1383,7 +1371,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *mis-bone-bridge-sg* '()) @@ -1421,15 +1409,11 @@ ;; definition of type breakaway (deftype breakaway (process-drawable) - ((root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) ) - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 (:methods - (init! (_type_ res-lump int) none 20) - (go-idle (_type_) none 21) + (init! (_type_ res-lump int) none) + (go-idle (_type_) none) ) (:states breakaway-about-to-fall @@ -1439,7 +1423,7 @@ ) ;; definition for method 3 of type breakaway -(defmethod inspect breakaway ((this breakaway)) +(defmethod inspect ((this breakaway)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1474,7 +1458,7 @@ (defstate breakaway-about-to-fall (breakaway) :code (behavior () (sound-play "falling-bones") - (launch-particles (-> *part-id-table* 281) (-> self root-override trans)) + (launch-particles (-> *part-id-table* 281) (-> self root trans)) (let ((gp-1 #f) (s5-1 (current-time)) ) @@ -1508,7 +1492,7 @@ (until (ja-done? 0) (+! f30-0 (* f28-0 (seconds-per-frame))) (+! f28-0 (* f26-0 (seconds-per-frame))) - (+! (-> self root-override trans y) f30-0) + (+! (-> self root trans y) f30-0) (suspend) (ja :num! (seek! (ja-aframe 32.0 0) 0.4)) ) @@ -1519,7 +1503,7 @@ ) ;; definition for method 20 of type breakaway -(defmethod init! breakaway ((this breakaway) (arg0 res-lump) (arg1 int)) +(defmethod init! ((this breakaway) (arg0 res-lump) (arg1 int)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -1539,7 +1523,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (set! (-> this link) (new 'process 'actor-link-info this)) (process-drawable-from-entity! this (the-as entity-actor arg0)) @@ -1548,7 +1532,7 @@ ;; definition for method 21 of type breakaway ;; INFO: Return type mismatch object vs none. -(defmethod go-idle breakaway ((this breakaway)) +(defmethod go-idle ((this breakaway)) (go breakaway-idle) (none) ) @@ -1556,14 +1540,10 @@ ;; definition of type breakaway-right (deftype breakaway-right (breakaway) () - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 ) ;; definition for method 3 of type breakaway-right -(defmethod inspect breakaway-right ((this breakaway-right)) +(defmethod inspect ((this breakaway-right)) (let ((t9-0 (method-of-type breakaway inspect))) (t9-0 this) ) @@ -1573,14 +1553,10 @@ ;; definition of type breakaway-mid (deftype breakaway-mid (breakaway) () - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 ) ;; definition for method 3 of type breakaway-mid -(defmethod inspect breakaway-mid ((this breakaway-mid)) +(defmethod inspect ((this breakaway-mid)) (let ((t9-0 (method-of-type breakaway inspect))) (t9-0 this) ) @@ -1590,14 +1566,10 @@ ;; definition of type breakaway-left (deftype breakaway-left (breakaway) () - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 ) ;; definition for method 3 of type breakaway-left -(defmethod inspect breakaway-left ((this breakaway-left)) +(defmethod inspect ((this breakaway-left)) (let ((t9-0 (method-of-type breakaway inspect))) (t9-0 this) ) @@ -1623,7 +1595,7 @@ ) ;; definition for method 11 of type breakaway-right -(defmethod init-from-entity! breakaway-right ((this breakaway-right) (arg0 entity-actor)) +(defmethod init-from-entity! ((this breakaway-right) (arg0 entity-actor)) (init! this arg0 3) (initialize-skeleton this *breakaway-right-sg* '()) (go-idle this) @@ -1631,7 +1603,7 @@ ) ;; definition for method 11 of type breakaway-mid -(defmethod init-from-entity! breakaway-mid ((this breakaway-mid) (arg0 entity-actor)) +(defmethod init-from-entity! ((this breakaway-mid) (arg0 entity-actor)) (init! this arg0 3) (initialize-skeleton this *breakaway-mid-sg* '()) (go-idle this) @@ -1639,7 +1611,7 @@ ) ;; definition for method 11 of type breakaway-left -(defmethod init-from-entity! breakaway-left ((this breakaway-left) (arg0 entity-actor)) +(defmethod init-from-entity! ((this breakaway-left) (arg0 entity-actor)) (init! this arg0 3) (initialize-skeleton this *breakaway-left-sg* '()) (go-idle this) @@ -1676,16 +1648,12 @@ ;; definition of type bone-platform (deftype bone-platform (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 736) + ((anchor-point vector :inline) ) - :heap-base #x280 - :method-count-assert 35 - :size-assert #x2f0 - :flag-assert #x23028002f0 ) ;; definition for method 3 of type bone-platform -(defmethod inspect bone-platform ((this bone-platform)) +(defmethod inspect ((this bone-platform)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) (t9-0 this) ) @@ -1701,7 +1669,7 @@ ;; definition for method 27 of type bone-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-27 bone-platform ((this bone-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-27 ((this bone-platform) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 arg0 (-> this rbody position)) (set! (-> gp-0 y) 0.0) @@ -1720,7 +1688,7 @@ ;; definition for method 23 of type bone-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 bone-platform ((this bone-platform) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this bone-platform) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 @@ -1777,7 +1745,7 @@ ;; definition for method 30 of type bone-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 bone-platform ((this bone-platform)) +(defmethod rigid-body-platform-method-30 ((this bone-platform)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1805,7 +1773,7 @@ ;; definition for method 31 of type bone-platform ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 bone-platform ((this bone-platform)) +(defmethod rigid-body-platform-method-31 ((this bone-platform)) (initialize-skeleton this *mis-bone-platform-sg* '()) (rigid-body-platform-method-29 this *bone-platform-constants*) (set! (-> this float-height-offset) -4096.0) @@ -1832,13 +1800,10 @@ ;; definition of type mistycam (deftype mistycam (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) ;; definition for method 3 of type mistycam -(defmethod inspect mistycam ((this mistycam)) +(defmethod inspect ((this mistycam)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -1919,14 +1884,10 @@ ;; definition of type misty-battlecontroller (deftype misty-battlecontroller (battlecontroller) () - :heap-base #x210 - :method-count-assert 29 - :size-assert #x27c - :flag-assert #x1d0210027c ) ;; definition for method 3 of type misty-battlecontroller -(defmethod inspect misty-battlecontroller ((this misty-battlecontroller)) +(defmethod inspect ((this misty-battlecontroller)) (let ((t9-0 (method-of-type battlecontroller inspect))) (t9-0 this) ) @@ -1952,7 +1913,7 @@ ;; definition for method 27 of type misty-battlecontroller ;; INFO: Return type mismatch int vs none. -(defmethod battlecontroller-method-27 misty-battlecontroller ((this misty-battlecontroller)) +(defmethod battlecontroller-method-27 ((this misty-battlecontroller)) (call-parent-method this) (set! (-> this misty-ambush-collision-hack) #t) 0 @@ -2004,12 +1965,8 @@ ;; definition of type boat-fuelcell (deftype boat-fuelcell (process-drawable) - ((play-cutscene? symbol :offset-assert 176) + ((play-cutscene? symbol) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states boat-fuelcell-die boat-fuelcell-idle @@ -2018,7 +1975,7 @@ ) ;; definition for method 3 of type boat-fuelcell -(defmethod inspect boat-fuelcell ((this boat-fuelcell)) +(defmethod inspect ((this boat-fuelcell)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -2074,7 +2031,7 @@ ;; definition for method 11 of type boat-fuelcell ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! boat-fuelcell ((this boat-fuelcell) (arg0 entity-actor)) +(defmethod init-from-entity! ((this boat-fuelcell) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-part_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-part_REF.gc index 7ff60a9ba9c..55aa6a13879 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type misty-part (deftype misty-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type misty-part -(defmethod inspect misty-part ((this misty-part)) +(defmethod inspect ((this misty-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-teetertotter_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-teetertotter_REF.gc index 7d6b68d964d..f2b053f153a 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-teetertotter_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-teetertotter_REF.gc @@ -3,14 +3,10 @@ ;; definition of type teetertotter (deftype teetertotter (process-drawable) - ((launched-player basic :offset-assert 176) - (in-launch-window basic :offset-assert 180) - (rock-is-dangerous basic :offset-assert 184) + ((launched-player basic) + (in-launch-window basic) + (rock-is-dangerous basic) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states teetertotter-bend teetertotter-idle @@ -19,7 +15,7 @@ ) ;; definition for method 3 of type teetertotter -(defmethod inspect teetertotter ((this teetertotter)) +(defmethod inspect ((this teetertotter)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -146,7 +142,7 @@ ;; definition for method 11 of type teetertotter ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! teetertotter ((this teetertotter) (arg0 entity-actor)) +(defmethod init-from-entity! ((this teetertotter) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc index 5968ed27928..ff2f7709076 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc @@ -3,13 +3,9 @@ ;; definition of type silostep (deftype silostep (process-drawable) - ((anim-limit float :offset-assert 176) - (cam-tracker handle :offset-assert 184) + ((anim-limit float) + (cam-tracker handle) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc0 - :flag-assert #x14005000c0 (:states silostep-camera silostep-idle @@ -18,7 +14,7 @@ ) ;; definition for method 3 of type silostep -(defmethod inspect silostep ((this silostep)) +(defmethod inspect ((this silostep)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -133,7 +129,7 @@ ;; definition for method 11 of type silostep ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! silostep ((this silostep) (arg0 entity-actor)) +(defmethod init-from-entity! ((this silostep) (arg0 entity-actor)) (logior! (-> this mask) (process-mask movie-subject)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -179,14 +175,10 @@ ;; definition of type rounddoor (deftype rounddoor (eco-door) () - :heap-base #xa0 - :method-count-assert 27 - :size-assert #x104 - :flag-assert #x1b00a00104 ) ;; definition for method 3 of type rounddoor -(defmethod inspect rounddoor ((this rounddoor)) +(defmethod inspect ((this rounddoor)) (let ((t9-0 (method-of-type eco-door inspect))) (t9-0 this) ) @@ -195,7 +187,7 @@ ;; definition for method 24 of type rounddoor ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-24 rounddoor ((this rounddoor)) +(defmethod eco-door-method-24 ((this rounddoor)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) @@ -208,7 +200,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -217,7 +209,7 @@ ;; definition for method 25 of type rounddoor ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-25 rounddoor ((this rounddoor)) +(defmethod eco-door-method-25 ((this rounddoor)) (initialize-skeleton this *rounddoor-sg* '()) (set! (-> this open-distance) 69632.0) (set! (-> this close-distance) 81920.0) @@ -226,9 +218,9 @@ (set! (-> this speed) 1.5) (set! (-> this auto-close) #t) (set! (-> this one-way) #t) - (vector-x-quaternion! (-> this out-dir) (-> this root-override quat)) - (set! (-> this out-dir w) (- 8192.0 (vector-dot (-> this out-dir) (-> this root-override trans)))) - (update-transforms! (-> this root-override)) + (vector-x-quaternion! (-> this out-dir) (-> this root quat)) + (set! (-> this out-dir w) (- 8192.0 (vector-dot (-> this out-dir) (-> this root trans)))) + (update-transforms! (-> this root)) 0 (none) ) diff --git a/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc b/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc index fc32b80141c..0ae435e303a 100644 --- a/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc @@ -3,18 +3,15 @@ ;; definition of type angle-tracker (deftype angle-tracker (structure) - ((value float :offset-assert 0) - (min float :offset-assert 4) - (range float :offset-assert 8) - (speed float :offset-assert 12) + ((value float) + (min float) + (range float) + (speed float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type angle-tracker -(defmethod inspect angle-tracker ((this angle-tracker)) +(defmethod inspect ((this angle-tracker)) (format #t "[~8x] ~A~%" this 'angle-tracker) (format #t "~Tvalue: ~f~%" (-> this value)) (format #t "~Tmin: ~f~%" (-> this min)) @@ -637,21 +634,17 @@ ;; definition of type mistycannon-missile (deftype mistycannon-missile (process-drawable) - ((root-override collide-shape-moving :offset 112) - (muzzle-time float :offset-assert 176) - (tumble-quat quaternion :inline :offset-assert 192) - (blast-radius float :offset-assert 208) - (water-height float :offset-assert 212) - (sfx uint32 :offset-assert 216) - (part2 sparticle-launch-control :offset-assert 220) - (ground-time time-frame :offset-assert 224) + ((root collide-shape-moving :override) + (muzzle-time float) + (tumble-quat quaternion :inline) + (blast-radius float) + (water-height float) + (sfx uint32) + (part2 sparticle-launch-control) + (ground-time time-frame) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #xe8 - :flag-assert #x15008000e8 (:methods - (spawn-part (_type_) none 20) + (spawn-part (_type_) none) ) (:states mistycannon-missile-explode @@ -661,7 +654,7 @@ ) ;; definition for method 3 of type mistycannon-missile -(defmethod inspect mistycannon-missile ((this mistycannon-missile)) +(defmethod inspect ((this mistycannon-missile)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -677,7 +670,7 @@ ;; definition for method 7 of type mistycannon-missile ;; INFO: Return type mismatch process-drawable vs mistycannon-missile. -(defmethod relocate mistycannon-missile ((this mistycannon-missile) (arg0 int)) +(defmethod relocate ((this mistycannon-missile) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -685,7 +678,7 @@ ) ;; definition for method 10 of type mistycannon-missile -(defmethod deactivate mistycannon-missile ((this mistycannon-missile)) +(defmethod deactivate ((this mistycannon-missile)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -701,7 +694,7 @@ ;; definition for method 20 of type mistycannon-missile ;; INFO: Return type mismatch int vs none. -(defmethod spawn-part mistycannon-missile ((this mistycannon-missile)) +(defmethod spawn-part ((this mistycannon-missile)) (let ((gp-0 (-> this part)) (a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 7))) ) @@ -726,14 +719,14 @@ 0 ) :trans (behavior () - (if (< (-> self root-override trans y) (-> self water-height)) + (if (< (-> self root trans y) (-> self water-height)) (go mistycannon-missile-in-water) ) ) :code (behavior () - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (while (not (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self muzzle-time))))) - (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) + (quaternion*! (-> self root quat) (-> self root quat) (-> self tumble-quat)) (suspend) (let ((f0-1 (fmin @@ -742,35 +735,32 @@ ) ) ) - (set! (-> self root-override scale x) (* 0.6 f0-1)) - (set! (-> self root-override scale y) (* 0.6 f0-1)) - (set! (-> self root-override scale z) (* 0.6 f0-1)) + (set! (-> self root scale x) (* 0.6 f0-1)) + (set! (-> self root scale y) (* 0.6 f0-1)) + (set! (-> self root scale z) (* 0.6 f0-1)) ) ) - (restore-collide-with-as (-> self root-override)) - (set-vector! (-> self root-override scale) 0.6 0.6 0.6 1.0) - (while (not (logtest? (-> self root-override status) (cshape-moving-flags onsurf))) - (if (and (zero? (-> self sfx)) - (< (if *target* - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - 4096000.0 - ) - 409600.0 - ) + (restore-collide-with-as (-> self root)) + (set-vector! (-> self root scale) 0.6 0.6 0.6 1.0) + (while (not (logtest? (-> self root status) (cshape-moving-flags onsurf))) + (if (and (zero? (-> self sfx)) (< (if *target* + (vector-vector-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + 409600.0 + ) ) - (set! (-> self sfx) - (the-as uint (sound-play "sack-incoming" :position (the-as symbol (-> self root-override trans)))) - ) + (set! (-> self sfx) (the-as uint (sound-play "sack-incoming" :position (the-as symbol (-> self root trans))))) ) (when (nonzero? (-> self sfx)) (let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-1 command) (sound-command set-param)) (set! (-> gp-1 id) (the-as sound-id (-> self sfx))) - (let ((a1-3 (-> self root-override trans))) + (let ((a1-3 (-> self root trans))) (let ((s5-1 self)) (when (= a1-3 #t) - (if (and s5-1 (type-type? (-> s5-1 type) process-drawable) (nonzero? (-> s5-1 root-override))) - (set! a1-3 (-> s5-1 root-override trans)) + (if (and s5-1 (type-type? (-> s5-1 type) process-drawable) (nonzero? (-> s5-1 root))) + (set! a1-3 (-> s5-1 root trans)) (set! a1-3 (the-as vector #f)) ) ) @@ -781,18 +771,18 @@ (-> gp-1 id) ) ) - (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) + (quaternion*! (-> self root quat) (-> self root quat) (-> self tumble-quat)) (suspend) ) - (quaternion-set! (-> self root-override quat) 0.0 0.0 0.0 1.0) - (update-transforms! (-> self root-override)) + (quaternion-set! (-> self root quat) 0.0 0.0 0.0 1.0) + (update-transforms! (-> self root)) (when (nonzero? (-> self sfx)) (sound-stop (the-as sound-id (-> self sfx))) (set! (-> self sfx) (the-as uint 0)) 0 ) (set-time! (-> self ground-time)) - (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) + (sound-play "sack-land" :position (the-as symbol (-> self root trans))) (ja-no-eval :group! sack-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -806,31 +796,24 @@ (go mistycannon-missile-explode) ) :post (behavior () - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0) - ) - (set! (-> self root-override root-prim prim-core offense) (collide-offense touch)) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (-> self root-override root-prim collide-with) - ) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 1.0)) + (set! (-> self root root-prim prim-core offense) (collide-offense touch)) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (-> self root root-prim collide-with)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) (spawn-part self) (when (and (zero? (-> self draw cur-lod)) (logtest? (-> self draw status) (draw-status was-drawn))) - (if (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) + (if (logtest? (-> self root status) (cshape-moving-flags onsurf)) (draw-shadow - (-> self root-override shadow-pos) - (-> self root-override shadow-pos) - (-> self root-override ground-poly-normal) + (-> self root shadow-pos) + (-> self root shadow-pos) + (-> self root ground-poly-normal) 8192.0 4096.0 (the-as float 0) ) (find-ground-and-draw-shadow - (-> self root-override trans) - (-> self root-override shadow-pos) + (-> self root trans) + (-> self root shadow-pos) 8192.0 (collide-kind background) (the-as process-drawable #f) @@ -852,28 +835,21 @@ 0 ) (let ((a1-0 (new-stack-vector0))) - (set! (-> a1-0 x) (-> self root-override trans x)) + (set! (-> a1-0 x) (-> self root trans x)) (set! (-> a1-0 y) (-> self water-height)) - (set! (-> a1-0 z) (-> self root-override trans z)) + (set! (-> a1-0 z) (-> self root trans z)) (set! (-> a1-0 w) 1.0) (splash-spawn (the-as basic 1.0) (the-as basic a1-0) 1) ) (label cfg-3) - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0) - ) - (vector-float*! (-> self root-override transv) (-> self root-override transv) 0.5) - (update-transforms! (-> self root-override)) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (-> self root-override root-prim collide-with) - ) - (seek! (-> self root-override scale x) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - (seek! (-> self root-override scale y) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - (seek! (-> self root-override scale z) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) - (when (< 0.05 (-> self root-override scale x)) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 1.0)) + (vector-float*! (-> self root transv) (-> self root transv) 0.5) + (update-transforms! (-> self root)) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (-> self root root-prim collide-with)) + (seek! (-> self root scale x) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) + (seek! (-> self root scale y) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) + (seek! (-> self root scale z) 0.0 (* 0.01 (-> *display* time-adjust-ratio))) + (when (< 0.05 (-> self root scale x)) (suspend) (goto cfg-3) ) @@ -894,8 +870,8 @@ ) ) (when v1-2 - (let* ((v1-3 (-> (the-as mistycannon-missile v1-2) root-override)) - (a1-2 (-> self root-override root-prim prim-core)) + (let* ((v1-3 (-> (the-as mistycannon-missile v1-2) root)) + (a1-2 (-> self root root-prim prim-core)) (v1-5 (-> v1-3 root-prim prim-core)) (a2-1 (new 'stack-no-clear 'vector)) (t2-0 (new 'stack-no-clear 'collide-tri-result)) @@ -946,25 +922,25 @@ (sound-play-by-spec (static-sound-spec "explosion" :fo-min 200 :fo-max 400) (new-sound-id) (the-as vector #t)) (sound-play-by-spec (static-sound-spec "explosion") (new-sound-id) (the-as vector #t)) ) - (spawn (-> self part2) (-> self root-override trans)) + (spawn (-> self part2) (-> self root trans)) (ja-channel-set! 0) - (let ((v1-11 (-> self root-override root-prim))) + (let ((v1-11 (-> self root root-prim))) (set! (-> v1-11 local-sphere w) (-> self blast-radius)) (set! (-> v1-11 prim-core world-sphere w) (-> self blast-radius)) (set! (-> v1-11 collide-with) (collide-kind cak-2 cak-3 target crate enemy wall-object)) (set! (-> v1-11 prim-core collide-as) (collide-kind enemy)) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (let ((a1-3 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-3 options) (the-as uint 0)) (set! (-> a1-3 tlist) *touching-list*) - (find-overlapping-shapes (-> self root-override) a1-3) + (find-overlapping-shapes (-> self root) a1-3) ) (suspend) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (let ((gp-2 (current-time))) (until (time-elapsed? gp-2 (seconds 3)) - (spawn (-> self part2) (-> self root-override trans)) + (spawn (-> self part2) (-> self root trans)) (suspend) ) ) @@ -998,20 +974,17 @@ ;; definition of type mistycannon-init-data (deftype mistycannon-init-data (structure) - ((pos vector :offset-assert 0) - (vel vector :offset-assert 4) - (rotate float :offset-assert 8) - (flight-time float :offset-assert 12) - (muzzle-time float :offset-assert 16) - (blast-radius float :offset-assert 20) + ((pos vector) + (vel vector) + (rotate float) + (flight-time float) + (muzzle-time float) + (blast-radius float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type mistycannon-init-data -(defmethod inspect mistycannon-init-data ((this mistycannon-init-data)) +(defmethod inspect ((this mistycannon-init-data)) (format #t "[~8x] ~A~%" this 'mistycannon-init-data) (format #t "~Tpos: #~%" (-> this pos)) (format #t "~Tvel: #~%" (-> this vel)) @@ -1048,17 +1021,17 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 event-self) 'touched) (set! (-> s5-0 max-iteration-count) (the-as uint 4)) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) - (set! (-> self root-override trans quad) (-> arg0 pos quad)) - (set-vector! (-> self root-override scale) 0.0 0.0 0.0 1.0) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (set-vector! (-> self root scale) 0.0 0.0 0.0 1.0) (set! (-> self muzzle-time) (-> arg0 muzzle-time)) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> arg0 rotate)) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (-> arg0 rotate)) (let ((f0-13 (/ 655360.0 (the float (the int (* 300.0 (-> arg0 flight-time))))))) (quaternion-axis-angle! (-> self tumble-quat) 1.0 0.0 0.0 f0-13) ) (initialize-skeleton self *mistycannon-missile-sg* '()) - (set! (-> self root-override transv quad) (-> arg0 vel quad)) + (set! (-> self root transv quad) (-> arg0 vel quad)) (set! (-> self blast-radius) (-> arg0 blast-radius)) (set! (-> self water-height) (res-lump-float (-> self entity) 'water-height :default -4096000.0)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 117) self)) @@ -1093,36 +1066,32 @@ ;; definition of type mistycannon (deftype mistycannon (process-drawable) - ((root-override collide-shape-moving :offset 112) - (rotate angle-tracker :inline :offset-assert 176) - (fact-info-override fact-info-enemy :offset 144) - (tilt angle-tracker :inline :offset-assert 192) - (front-wheel float :offset-assert 208) - (rear-wheel float :offset-assert 212) - (last-known-rotation float :offset-assert 216) - (part-timer time-frame :offset-assert 224) - (hellmouth vector :inline :offset-assert 240) - (postbindinfo-ok symbol :offset-assert 256) - (launch-origin vector :inline :offset-assert 272) - (goggles vector :inline :offset-assert 288) - (avoid-entity entity-actor :offset-assert 304) - (center-point vector :inline :offset-assert 320) - (at-point vector :inline :offset-assert 336) - (accuracy-range float :offset-assert 352) - (target-theta float :offset-assert 356) - (sound-id sound-id :offset-assert 360) - (aim-sound-id sound-id :offset-assert 364) - (player-touching-grips? symbol :offset-assert 368) + ((root collide-shape-moving :override) + (fact fact-info-enemy :override) + (rotate angle-tracker :inline) + (tilt angle-tracker :inline) + (front-wheel float) + (rear-wheel float) + (last-known-rotation float) + (part-timer time-frame) + (hellmouth vector :inline) + (postbindinfo-ok symbol) + (launch-origin vector :inline) + (goggles vector :inline) + (avoid-entity entity-actor) + (center-point vector :inline) + (at-point vector :inline) + (accuracy-range float) + (target-theta float) + (sound-id sound-id) + (aim-sound-id sound-id) + (player-touching-grips? symbol) ) - :heap-base #x110 - :method-count-assert 24 - :size-assert #x174 - :flag-assert #x1801100174 (:methods - (rotate! (_type_ float) none 20) - (tilt! (_type_ float) none 21) - (mistycannon-method-22 (_type_ float float float) none 22) - (mistycannon-method-23 (_type_) none 23) + (rotate! (_type_ float) none) + (tilt! (_type_ float) none) + (mistycannon-method-22 (_type_ float float float) none) + (mistycannon-method-23 (_type_) none) ) (:states mistycannon-aim-at-player @@ -1134,7 +1103,7 @@ ) ;; definition for method 3 of type mistycannon -(defmethod inspect mistycannon ((this mistycannon)) +(defmethod inspect ((this mistycannon)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1176,7 +1145,7 @@ ;; definition for method 20 of type mistycannon ;; INFO: Return type mismatch int vs none. -(defmethod rotate! mistycannon ((this mistycannon) (arg0 float)) +(defmethod rotate! ((this mistycannon) (arg0 float)) (angle-tracker-apply-move! (-> this rotate) arg0) 0 (none) @@ -1184,7 +1153,7 @@ ;; definition for method 21 of type mistycannon ;; INFO: Return type mismatch int vs none. -(defmethod tilt! mistycannon ((this mistycannon) (arg0 float)) +(defmethod tilt! ((this mistycannon) (arg0 float)) (angle-tracker-apply-move! (-> this tilt) arg0) 0 (none) @@ -1193,7 +1162,7 @@ ;; definition for method 22 of type mistycannon ;; INFO: Return type mismatch int vs none. ;; WARN: Function (method 22 mistycannon) has a return type of none, but the expression builder found a return statement. -(defmethod mistycannon-method-22 mistycannon ((this mistycannon) (arg0 float) (arg1 float) (arg2 float)) +(defmethod mistycannon-method-22 ((this mistycannon) (arg0 float) (arg1 float) (arg2 float)) (if (not (-> this postbindinfo-ok)) (return #f) ) @@ -1224,7 +1193,7 @@ ;; definition for method 23 of type mistycannon ;; INFO: Return type mismatch int vs none. -(defmethod mistycannon-method-23 mistycannon ((this mistycannon)) +(defmethod mistycannon-method-23 ((this mistycannon)) (when (not (time-elapsed? (-> this part-timer) (seconds 3))) (let ((v1-4 (-> this rotate))) (set! (-> *part-id-table* 529 init-specs 24 initial-valuef) @@ -1352,9 +1321,7 @@ ) (if (and (-> self postbindinfo-ok) *target* - (>= (-> self fact-info-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (go mistycannon-aim-at-player) ) @@ -1371,16 +1338,13 @@ ;; definition of type quadratic-solution (deftype quadratic-solution (structure) - ((s1 float :offset-assert 0) - (s2 float :offset-assert 4) + ((s1 float) + (s2 float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type quadratic-solution -(defmethod inspect quadratic-solution ((this quadratic-solution)) +(defmethod inspect ((this quadratic-solution)) (format #t "[~8x] ~A~%" this 'quadratic-solution) (format #t "~Ts1: ~f~%" (-> this s1)) (format #t "~Ts2: ~f~%" (-> this s2)) @@ -1409,20 +1373,17 @@ ;; definition of type trajectory-params (deftype trajectory-params (structure) - ((x float :offset-assert 0) - (y float :offset-assert 4) - (gravity float :offset-assert 8) - (theta float :offset-assert 12) - (speed float :offset-assert 16) - (time float :offset-assert 20) + ((x float) + (y float) + (gravity float) + (theta float) + (speed float) + (time float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type trajectory-params -(defmethod inspect trajectory-params ((this trajectory-params)) +(defmethod inspect ((this trajectory-params)) (format #t "[~8x] ~A~%" this 'trajectory-params) (format #t "~Tx: ~f~%" (-> this x)) (format #t "~Ty: ~f~%" (-> this y)) @@ -1565,9 +1526,8 @@ (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (go mistycannon-waiting-for-player) ) - (if (not (and *target* (>= (-> self fact-info-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (not (and *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) ) (go mistycannon-idle) @@ -1594,7 +1554,7 @@ (('touch) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) (let ((v0-1 (the-as object #t))) @@ -1785,7 +1745,7 @@ (('touch) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) (let ((v0-0 (current-time))) @@ -1815,7 +1775,7 @@ ;; definition for method 11 of type mistycannon ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! mistycannon ((this mistycannon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mistycannon) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) @@ -1852,16 +1812,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (quaternion-identity! (-> this root-override quat)) + (quaternion-identity! (-> this root quat)) (initialize-skeleton this *mistycannon-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! (-> this skel prebind-function) mistycannon-prebind-function) (set! (-> this skel postbind-function) mistycannon-postbind-function) - (set! (-> this fact-info-override) + (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1881,8 +1841,8 @@ (set! (-> this center-point w) (res-lump-float arg0 'center-radius)) (cond ((= (-> this center-point w) 0.0) - (set! (-> this center-point quad) (-> this root-override trans quad)) - (set! (-> this center-point w) (-> this fact-info-override idle-distance)) + (set! (-> this center-point quad) (-> this root trans quad)) + (set! (-> this center-point w) (-> this fact idle-distance)) ) (else (set! sv-16 (new 'static 'res-tag)) diff --git a/test/decompiler/reference/jak1/levels/misty/mud_REF.gc b/test/decompiler/reference/jak1/levels/misty/mud_REF.gc index 94b132fc8a1..4614b84d0ab 100644 --- a/test/decompiler/reference/jak1/levels/misty/mud_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/mud_REF.gc @@ -4,14 +4,10 @@ ;; definition of type mud (deftype mud (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) ;; definition for method 3 of type mud -(defmethod inspect mud ((this mud)) +(defmethod inspect ((this mud)) (let ((t9-0 (method-of-type water-anim inspect))) (t9-0 this) ) @@ -48,7 +44,7 @@ ;; definition for method 22 of type mud ;; INFO: Return type mismatch ripple-wave-set vs none. -(defmethod water-vol-method-22 mud ((this mud)) +(defmethod water-vol-method-22 ((this mud)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/misty/muse_REF.gc b/test/decompiler/reference/jak1/levels/misty/muse_REF.gc index 54d2b95be43..17f563fec2a 100644 --- a/test/decompiler/reference/jak1/levels/misty/muse_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/muse_REF.gc @@ -3,22 +3,18 @@ ;; definition of type muse (deftype muse (nav-enemy) - ((root-override collide-shape-moving :offset 112) - (current-path-index float :offset-assert 400) - (prev-path-index float :offset-assert 404) - (dest-path-index float :offset-assert 408) - (player-path-index float :offset-assert 412) - (max-path-index float :offset-assert 416) - (sprint-distance float :offset-assert 420) - (dest-point vector :inline :offset-assert 432) - (anim spool-anim :offset-assert 448) - (victory-anim spool-anim :offset-assert 452) - (old-target-pos transformq :inline :offset-assert 464) + ((root collide-shape-moving :override) + (current-path-index float) + (prev-path-index float) + (dest-path-index float) + (player-path-index float) + (max-path-index float) + (sprint-distance float) + (dest-point vector :inline) + (anim spool-anim) + (victory-anim spool-anim) + (old-target-pos transformq :inline) ) - :heap-base #x190 - :method-count-assert 76 - :size-assert #x200 - :flag-assert #x4c01900200 (:states muse-caught muse-idle @@ -26,7 +22,7 @@ ) ;; definition for method 3 of type muse -(defmethod inspect muse ((this muse)) +(defmethod inspect ((this muse)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -45,21 +41,18 @@ ;; definition of type point-on-path-segment-info (deftype point-on-path-segment-info (structure) - ((point vector :inline :offset-assert 0) - (segment vector 2 :inline :offset-assert 16) - (dir vector :inline :offset-assert 48) - (nearest-point vector :inline :offset-assert 64) - (segment-length float :offset-assert 80) - (distance-to-segment float :offset-assert 84) - (parametric-index float :offset-assert 88) + ((point vector :inline) + (segment vector 2 :inline) + (dir vector :inline) + (nearest-point vector :inline) + (segment-length float) + (distance-to-segment float) + (parametric-index float) ) - :method-count-assert 9 - :size-assert #x5c - :flag-assert #x90000005c ) ;; definition for method 3 of type point-on-path-segment-info -(defmethod inspect point-on-path-segment-info ((this point-on-path-segment-info)) +(defmethod inspect ((this point-on-path-segment-info)) (format #t "[~8x] ~A~%" this 'point-on-path-segment-info) (format #t "~Tpoint: #~%" (-> this point)) (format #t "~Tsegment[2] @ #x~X~%" (-> this segment)) @@ -173,7 +166,7 @@ ;; definition for method 51 of type muse ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-51 muse ((this muse)) +(defmethod nav-enemy-method-51 ((this muse)) (dotimes (s5-0 2) (let ((v1-2 (rand-vu-int-range 3 (+ (-> this node-list length) -1)))) (launch-particles @@ -187,7 +180,7 @@ ) ;; definition for method 39 of type muse -(defmethod common-post muse ((this muse)) +(defmethod common-post ((this muse)) (spool-push *art-control* (-> this anim name) 0 this -99.0) (nav-enemy-method-51 this) ((method-of-type nav-enemy common-post) this) @@ -202,12 +195,12 @@ ) ;; definition for method 44 of type muse -(defmethod touch-handler muse ((this muse) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this muse) (arg0 process) (arg1 event-message-block)) (go muse-caught) ) ;; definition for method 43 of type muse -(defmethod attack-handler muse ((this muse) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this muse) (arg0 process) (arg1 event-message-block)) (go muse-caught) ) @@ -494,7 +487,7 @@ nav-enemy-default-event-handler ;; definition for method 11 of type muse ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! muse ((this muse) (arg0 entity-actor)) +(defmethod init-from-entity! ((this muse) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) diff --git a/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc index ae74bddcc64..11fbd856b33 100644 --- a/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc @@ -295,12 +295,8 @@ ;; definition of type quicksandlurker-missile (deftype quicksandlurker-missile (process-drawable) - ((root-override collide-shape-moving :offset 112) + ((root collide-shape-moving :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states quicksandlurker-missile-idle quicksandlurker-missile-impact @@ -308,7 +304,7 @@ ) ;; definition for method 3 of type quicksandlurker-missile -(defmethod inspect quicksandlurker-missile ((this quicksandlurker-missile)) +(defmethod inspect ((this quicksandlurker-missile)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -351,21 +347,15 @@ ) :code (behavior () (while (not (time-elapsed? (-> self state-time) (seconds 4))) - (fill-cache-integrate-and-collide! - (-> self root-override) - (-> self root-override transv) - (-> self root-override root-prim collide-with) - ) - (if (or (logtest? (-> self root-override status) (cshape-moving-flags twall)) - (< (vector-vector-distance (-> self root-override trans) (the-as vector (-> self root-override trans-old))) - 40.96 - ) + (fill-cache-integrate-and-collide! (-> self root) (-> self root transv) (-> self root root-prim collide-with)) + (if (or (logtest? (-> self root status) (cshape-moving-flags twall)) + (< (vector-vector-distance (-> self root trans) (the-as vector (-> self root trans-old))) 40.96) ) (go quicksandlurker-missile-impact) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (find-ground-and-draw-shadow - (-> self root-override trans) + (-> self root trans) (the-as vector #f) 8192.0 (collide-kind background) @@ -378,14 +368,14 @@ (cleanup-for-death self) ) :post (behavior () - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) ) ) ;; failed to figure out what this is: (defstate quicksandlurker-missile-impact (quicksandlurker-missile) :code (behavior () - (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) + (sound-play "sack-land" :position (the-as symbol (-> self root trans))) (process-spawn part-tracker :init part-tracker-init @@ -394,7 +384,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (set-time! (-> self state-time)) @@ -407,16 +397,13 @@ ;; definition of type quicksandlurker-missile-init-data (deftype quicksandlurker-missile-init-data (structure) - ((position vector :offset-assert 0) - (velocity vector :offset-assert 4) + ((position vector) + (velocity vector) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type quicksandlurker-missile-init-data -(defmethod inspect quicksandlurker-missile-init-data ((this quicksandlurker-missile-init-data)) +(defmethod inspect ((this quicksandlurker-missile-init-data)) (format #t "[~8x] ~A~%" this 'quicksandlurker-missile-init-data) (format #t "~Tposition: #~%" (-> this position)) (format #t "~Tvelocity: #~%" (-> this velocity)) @@ -448,14 +435,12 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) - (set! (-> self root-override trans quad) (-> arg0 position quad)) - (set! (-> self root-override quat vec quad) - (-> (the-as process-drawable (-> self parent 0)) root quat vec quad) - ) - (vector-identity! (-> self root-override scale)) - (set! (-> self root-override transv quad) (-> arg0 velocity quad)) + (set! (-> self root trans quad) (-> arg0 position quad)) + (set! (-> self root quat vec quad) (-> (the-as process-drawable (-> self parent 0)) root quat vec quad)) + (vector-identity! (-> self root scale)) + (set! (-> self root transv quad) (-> arg0 velocity quad)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 198) self)) (go quicksandlurker-missile-idle) (none) @@ -475,18 +460,14 @@ ;; definition of type quicksandlurker (deftype quicksandlurker (process-drawable) - ((root-override collide-shape :offset 112) - (original-position vector :inline :offset-assert 176) - (y-offset float :offset-assert 192) - (theta-angle float :offset-assert 196) - (radial-offset float :offset-assert 200) - (bob-angle float :offset-assert 204) - (mud-entity entity-actor :offset-assert 208) + ((root collide-shape :override) + (original-position vector :inline) + (y-offset float) + (theta-angle float) + (radial-offset float) + (bob-angle float) + (mud-entity entity-actor) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd4 - :flag-assert #x14007000d4 (:states quicksandlurker-attack quicksandlurker-die @@ -501,7 +482,7 @@ ) ;; definition for method 3 of type quicksandlurker -(defmethod inspect quicksandlurker ((this quicksandlurker)) +(defmethod inspect ((this quicksandlurker)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -523,7 +504,7 @@ ;; definition for function orient-to-face-target (defbehavior orient-to-face-target quicksandlurker () (if *target* - (seek-to-point-toward-point! (-> self root-override) (-> *target* control trans) 65536.0 (seconds 0.2)) + (seek-to-point-toward-point! (-> self root) (-> *target* control trans) 65536.0 (seconds 0.2)) ) ) @@ -567,8 +548,8 @@ (f30-2 (* 0.0 (sin (-> self theta-angle)))) ) (let ((f0-10 (* (-> self radial-offset) (sin (-> self theta-angle))))) - (set! (-> self root-override trans x) (+ (-> self original-position x) f28-0)) - (set! (-> self root-override trans z) (+ (-> self original-position z) f0-10)) + (set! (-> self root trans x) (+ (-> self original-position x) f28-0)) + (set! (-> self root trans z) (+ (-> self original-position z) f0-10)) ) (let* ((v1-4 (-> self mud-entity)) (a0-5 (if v1-4 @@ -577,10 +558,10 @@ ) ) (if a0-5 - (set! (-> self root-override trans y) - (+ (get-ripple-height (the-as water-anim a0-5) (-> self root-override trans)) f30-2 (-> self y-offset)) + (set! (-> self root trans y) + (+ (get-ripple-height (the-as water-anim a0-5) (-> self root trans)) f30-2 (-> self y-offset)) ) - (set! (-> self root-override trans y) (+ (-> self original-position y) f30-2 (-> self y-offset))) + (set! (-> self root trans y) (+ (-> self original-position y) f30-2 (-> self y-offset))) ) ) ) @@ -592,7 +573,7 @@ ;; INFO: Return type mismatch object vs none. (defbehavior quicksandlurker-check-hide-transition quicksandlurker () (when *target* - (if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (!= (-> *target* next-state name) 'target-flop) ) (go quicksandlurker-hide) @@ -623,9 +604,7 @@ (logclear! (-> self draw status) (draw-status hidden)) ) :trans (behavior () - (if (and *target* - (>= 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* (>= 163840.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (go quicksandlurker-wait) ) ) @@ -642,13 +621,11 @@ :event quicksandlurker-default-event-handler :trans (behavior () (cond - ((and *target* (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + ((and *target* (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (set! (-> self y-offset) 1228.8) (go quicksandlurker-track) ) - ((or (not *target*) - (< 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + ((or (not *target*) (< 163840.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (seek! (-> self y-offset) -6553.6 (* 20480.0 (seconds-per-frame))) (if (= (-> self y-offset) -6553.6) (go quicksandlurker-idle) @@ -712,9 +689,7 @@ (defstate quicksandlurker-track (quicksandlurker) :event quicksandlurker-default-event-handler :trans (behavior () - (if (or (not *target*) - (< 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (or (not *target*) (< 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (go quicksandlurker-wait) ) (quicksandlurker-check-hide-transition) @@ -838,7 +813,7 @@ (set-time! (-> self state-time)) ) :exit (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) ) :trans (behavior () (if (not *target*) @@ -851,7 +826,7 @@ ((or (if (nav-control-method-16 a0-0 a1-0) #t ) - (and *target* (>= 16384.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (and *target* (>= 16384.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) ) (set-time! (-> self state-time)) ) @@ -878,10 +853,10 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (loop (orient-to-face-target) (suspend) @@ -902,7 +877,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (ja-no-eval :group! quicksandlurker-popup-ja :num! (seek!) :frame-num 0.0) @@ -935,7 +910,7 @@ ;; definition for method 11 of type quicksandlurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! quicksandlurker ((this quicksandlurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this quicksandlurker) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) @@ -971,18 +946,18 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (+! (-> this root-override trans y) -2048.0) - (set! (-> this original-position quad) (-> this root-override trans quad)) + (+! (-> this root trans y) -2048.0) + (set! (-> this original-position quad) (-> this root trans quad)) (set! (-> this theta-angle) (rand-vu-float-range 0.0 65536.0)) (set! (-> this bob-angle) (rand-vu-float-range 0.0 65536.0)) (set! (-> this radial-offset) 4096.0) (set! (-> this y-offset) -6553.6) - (set-yaw-angle-clear-roll-pitch! (-> this root-override) (rand-vu-float-range 0.0 65536.0)) + (set-yaw-angle-clear-roll-pitch! (-> this root) (rand-vu-float-range 0.0 65536.0)) (initialize-skeleton this *quicksandlurker-sg* '()) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) diff --git a/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc b/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc index 2a4d1befd90..cc9c23bc172 100644 --- a/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc @@ -4,13 +4,10 @@ ;; definition of type sequenceA (deftype sequenceA (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) ;; definition for method 3 of type sequenceA -(defmethod inspect sequenceA ((this sequenceA)) +(defmethod inspect ((this sequenceA)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -1149,19 +1146,15 @@ ;; definition of type sequenceB (deftype sequenceB (process-taskable) - ((bonelurker handle :offset-assert 384) - (evilbro handle :offset-assert 392) - (evilsis handle :offset-assert 400) - (lurker-army handle 9 :offset-assert 408) + ((bonelurker handle) + (evilbro handle) + (evilsis handle) + (lurker-army handle 9) ) - :heap-base #x170 - :method-count-assert 53 - :size-assert #x1e0 - :flag-assert #x35017001e0 ) ;; definition for method 3 of type sequenceB -(defmethod inspect sequenceB ((this sequenceB)) +(defmethod inspect ((this sequenceB)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -1174,18 +1167,14 @@ ;; definition of type sequenceC (deftype sequenceC (process-taskable) - ((bonelurker handle :offset-assert 384) - (darkecocan handle :offset-assert 392) - (darkecocan-glowing-look lod-set :inline :offset-assert 400) + ((bonelurker handle) + (darkecocan handle) + (darkecocan-glowing-look lod-set :inline) ) - :heap-base #x150 - :method-count-assert 53 - :size-assert #x1b1 - :flag-assert #x35015001b1 ) ;; definition for method 3 of type sequenceC -(defmethod inspect sequenceC ((this sequenceC)) +(defmethod inspect ((this sequenceC)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -1228,18 +1217,15 @@ ;; definition of type army-info (deftype army-info (structure) - ((pos vector :offset-assert 0) - (rot float :offset-assert 4) - (start-frame float :offset-assert 8) - (skel symbol :offset-assert 12) + ((pos vector) + (rot float) + (start-frame float) + (skel symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type army-info -(defmethod inspect army-info ((this army-info)) +(defmethod inspect ((this army-info)) (format #t "[~8x] ~A~%" this 'army-info) (format #t "~Tpos: #~%" (-> this pos)) (format #t "~Trot: ~f~%" (-> this rot)) @@ -1334,12 +1320,12 @@ ) ;; definition for method 32 of type sequenceB -(defmethod play-anim! sequenceB ((this sequenceB) (arg0 symbol)) +(defmethod play-anim! ((this sequenceB) (arg0 symbol)) (cond (arg0 (send-event *target* 'sidekick #f) (set! (-> this bonelurker) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *bonelurker-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *bonelurker-sg* #f :to this)) ) (send-event (handle->process (-> this bonelurker)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this bonelurker)) 'center-joint 3) @@ -1485,7 +1471,7 @@ ) ;; definition for method 31 of type sequenceB -(defmethod get-art-elem sequenceB ((this sequenceB)) +(defmethod get-art-elem ((this sequenceB)) (-> this draw art-group data 3) ) @@ -1506,9 +1492,7 @@ (when (= (level-status *level* 'intro) 'active) (let ((gp-2 (entity-by-name "evilbro-2"))) (when gp-2 - (set! (-> self evilbro) - (ppointer->handle (manipy-spawn (-> self root-override trans) gp-2 *evilbro-sg* #f :to self)) - ) + (set! (-> self evilbro) (ppointer->handle (manipy-spawn (-> self root trans) gp-2 *evilbro-sg* #f :to self))) (let ((gp-3 (handle->process (-> self evilbro)))) (when gp-3 (set! (-> (the-as evilbro gp-3) draw light-index) (the-as uint 1)) @@ -1533,9 +1517,7 @@ ) (let ((gp-4 (entity-by-name "evilsis-2"))) (when gp-4 - (set! (-> self evilsis) - (ppointer->handle (manipy-spawn (-> self root-override trans) gp-4 *evilsis-sg* #f :to self)) - ) + (set! (-> self evilsis) (ppointer->handle (manipy-spawn (-> self root trans) gp-4 *evilsis-sg* #f :to self))) (let ((gp-5 (handle->process (-> self evilsis)))) (when gp-5 (set! (-> (the-as evilsis gp-5) draw light-index) (the-as uint 1)) @@ -1606,12 +1588,12 @@ ) ;; definition for method 39 of type sequenceB -(defmethod should-display? sequenceB ((this sequenceB)) +(defmethod should-display? ((this sequenceB)) #f ) ;; definition for method 11 of type sequenceB -(defmethod init-from-entity! sequenceB ((this sequenceB) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sequenceB) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sidekick-human-sg* 3 44 (new 'static 'vector :w 4096.0) -1) (set! (-> this tasks) (get-task-control (game-task intro))) (set! (-> this bonelurker) (the-as handle #f)) @@ -1663,18 +1645,18 @@ ;; definition for method 32 of type sequenceC ;; INFO: Return type mismatch spool-anim vs basic. -(defmethod play-anim! sequenceC ((this sequenceC) (arg0 symbol)) +(defmethod play-anim! ((this sequenceC) (arg0 symbol)) (when arg0 (set-setting! 'music-volume-movie 'abs 0.0 0) (set-setting! 'sfx-volume-movie 'abs 0.0 0) (set-setting! 'ambient-volume-movie 'abs 0.0 0) (set! (-> this bonelurker) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *bonelurker-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *bonelurker-sg* #f :to this)) ) (send-event (handle->process (-> this bonelurker)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this bonelurker)) 'center-joint 3) (set! (-> this darkecocan) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *darkecocan-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *darkecocan-sg* #f :to this)) ) (send-event (handle->process (-> this darkecocan)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this darkecocan)) 'center-joint 3) @@ -1757,7 +1739,7 @@ ) ;; definition for method 31 of type sequenceC -(defmethod get-art-elem sequenceC ((this sequenceC)) +(defmethod get-art-elem ((this sequenceC)) (-> this draw art-group data 3) ) @@ -1785,7 +1767,7 @@ ) ;; definition for method 39 of type sequenceC -(defmethod should-display? sequenceC ((this sequenceC)) +(defmethod should-display? ((this sequenceC)) #f ) @@ -1814,7 +1796,7 @@ ) ;; definition for method 11 of type sequenceC -(defmethod init-from-entity! sequenceC ((this sequenceC) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sequenceC) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sidekick-human-sg* 3 44 (new 'static 'vector :w 4096.0) -1) (set! (-> this tasks) (get-task-control (game-task intro))) (set! (-> this bonelurker) (the-as handle #f)) diff --git a/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc b/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc index 371faf6a76f..8ed835d5530 100644 --- a/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc @@ -9,13 +9,9 @@ ;; definition of type plunger-lurker (deftype plunger-lurker (process-drawable) - ((alt-actor entity-actor :offset-assert 176) - (got-hit symbol :offset-assert 180) + ((alt-actor entity-actor) + (got-hit symbol) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states plunger-lurker-die plunger-lurker-flee @@ -25,7 +21,7 @@ ) ;; definition for method 3 of type plunger-lurker -(defmethod inspect plunger-lurker ((this plunger-lurker)) +(defmethod inspect ((this plunger-lurker)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -262,7 +258,7 @@ ;; definition for method 11 of type plunger-lurker ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! plunger-lurker ((this plunger-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this plunger-lurker) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -292,32 +288,28 @@ ;; definition of type flying-lurker (deftype flying-lurker (process-drawable) - ((curve-position float :offset-assert 176) - (speed float :offset-assert 180) - (tangent vector :inline :offset-assert 192) - (anim-blend float :offset-assert 208) - (y-offset float :offset-assert 212) - (y-offset-desired float :offset-assert 216) - (y-vel float :offset-assert 220) - (last-look-time time-frame :offset-assert 224) - (time-to-next-look time-frame :offset-assert 232) - (take-off symbol :offset-assert 240) - (race-seconds float :offset-assert 244) - (race-start-time time-frame :offset-assert 248) - (rank int32 :offset-assert 256) - (alt-actor entity-actor :offset-assert 260) - (alt-trans vector :offset-assert 264) - (shadow-backup shadow-geo :offset-assert 268) - (try-count uint8 :offset-assert 272) - (try-counted symbol :offset-assert 276) - (default-bounds vector :inline :offset-assert 288) + ((curve-position float) + (speed float) + (tangent vector :inline) + (anim-blend float) + (y-offset float) + (y-offset-desired float) + (y-vel float) + (last-look-time time-frame) + (time-to-next-look time-frame) + (take-off symbol) + (race-seconds float) + (race-start-time time-frame) + (rank int32) + (alt-actor entity-actor) + (alt-trans vector) + (shadow-backup shadow-geo) + (try-count uint8) + (try-counted symbol) + (default-bounds vector :inline) ) - :heap-base #xc0 - :method-count-assert 21 - :size-assert #x130 - :flag-assert #x1500c00130 (:methods - (flying-lurker-method-20 (_type_) none 20) + (flying-lurker-method-20 (_type_) none) ) (:states (flying-lurker-clone handle string) @@ -330,7 +322,7 @@ ) ;; definition for method 3 of type flying-lurker -(defmethod inspect flying-lurker ((this flying-lurker)) +(defmethod inspect ((this flying-lurker)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -370,7 +362,7 @@ ;; definition for method 20 of type flying-lurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod flying-lurker-method-20 flying-lurker ((this flying-lurker)) +(defmethod flying-lurker-method-20 ((this flying-lurker)) (with-pp (let ((s5-0 (-> this draw shadow-ctrl)) (s4-0 #f) @@ -1242,7 +1234,7 @@ ;; definition for method 11 of type flying-lurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! flying-lurker ((this flying-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this flying-lurker) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) diff --git a/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc b/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc index ddac46aaa34..eecdd0b0407 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc @@ -308,20 +308,16 @@ ;; definition of type tntbarrel (deftype tntbarrel (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 - (:methods - (idle () _type_ :state 20) - (die (symbol) _type_ :state 21) + (:state-methods + idle + (die symbol) ) ) ;; definition for method 3 of type tntbarrel -(defmethod inspect tntbarrel ((this tntbarrel)) +(defmethod inspect ((this tntbarrel)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -333,7 +329,7 @@ :virtual #t :code (behavior ((arg0 symbol)) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (sound-play "dcrate-break") (if arg0 @@ -345,7 +341,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (process-spawn @@ -356,7 +352,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) ) @@ -393,7 +389,7 @@ ;; definition for method 11 of type tntbarrel ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! tntbarrel ((this tntbarrel) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tntbarrel) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind crate)) @@ -406,7 +402,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *tntbarrel-sg* '()) @@ -459,21 +455,17 @@ ;; definition of type ogre-plat (deftype ogre-plat (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 736) - (idle-y-offset float :offset-assert 752) - (float-y-offset float :offset-assert 756) - (delay time-frame :offset-assert 760) - (active symbol :offset-assert 768) - (triggered entity-actor :offset-assert 772) + ((anchor-point vector :inline) + (idle-y-offset float) + (float-y-offset float) + (delay time-frame) + (active symbol) + (triggered entity-actor) ) - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) ;; definition for method 3 of type ogre-plat -(defmethod inspect ogre-plat ((this ogre-plat)) +(defmethod inspect ((this ogre-plat)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) (t9-0 this) ) @@ -488,7 +480,7 @@ ;; definition for method 23 of type ogre-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 ogre-plat ((this ogre-plat) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this ogre-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 @@ -572,7 +564,7 @@ ;; definition for method 30 of type ogre-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 ogre-plat ((this ogre-plat)) +(defmethod rigid-body-platform-method-30 ((this ogre-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -600,7 +592,7 @@ ;; definition for method 31 of type ogre-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-plat ((this ogre-plat)) +(defmethod rigid-body-platform-method-31 ((this ogre-plat)) (set! (-> this float-height-offset) (-> this idle-y-offset)) (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) @@ -653,14 +645,10 @@ ;; definition of type ogre-step (deftype ogre-step (ogre-plat) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) ;; definition for method 3 of type ogre-step -(defmethod inspect ogre-step ((this ogre-step)) +(defmethod inspect ((this ogre-step)) (let ((t9-0 (method-of-type ogre-plat inspect))) (t9-0 this) ) @@ -669,7 +657,7 @@ ;; definition for method 31 of type ogre-step ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-step ((this ogre-step)) +(defmethod rigid-body-platform-method-31 ((this ogre-step)) (set! (-> this idle-y-offset) -28672.0) (set! (-> this float-y-offset) 0.0) (+! (-> this root-overlay trans y) (-> this idle-y-offset)) @@ -686,7 +674,7 @@ ;; definition for method 34 of type ogre-step ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-34 ogre-step ((this ogre-step)) +(defmethod rigid-body-platform-method-34 ((this ogre-step)) (if (-> this active) (go (method-of-object this rigid-body-platform-float)) (go (method-of-object this rigid-body-platform-idle)) @@ -698,14 +686,10 @@ ;; definition of type ogre-step-a (deftype ogre-step-a (ogre-step) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) ;; definition for method 3 of type ogre-step-a -(defmethod inspect ogre-step-a ((this ogre-step-a)) +(defmethod inspect ((this ogre-step-a)) (let ((t9-0 (method-of-type ogre-step inspect))) (t9-0 this) ) @@ -715,14 +699,10 @@ ;; definition of type ogre-step-b (deftype ogre-step-b (ogre-step) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) ;; definition for method 3 of type ogre-step-b -(defmethod inspect ogre-step-b ((this ogre-step-b)) +(defmethod inspect ((this ogre-step-b)) (let ((t9-0 (method-of-type ogre-step inspect))) (t9-0 this) ) @@ -732,14 +712,10 @@ ;; definition of type ogre-step-c (deftype ogre-step-c (ogre-step) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) ;; definition for method 3 of type ogre-step-c -(defmethod inspect ogre-step-c ((this ogre-step-c)) +(defmethod inspect ((this ogre-step-c)) (let ((t9-0 (method-of-type ogre-step inspect))) (t9-0 this) ) @@ -749,14 +725,10 @@ ;; definition of type ogre-step-d (deftype ogre-step-d (ogre-step) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) ;; definition for method 3 of type ogre-step-d -(defmethod inspect ogre-step-d ((this ogre-step-d)) +(defmethod inspect ((this ogre-step-d)) (let ((t9-0 (method-of-type ogre-step inspect))) (t9-0 this) ) @@ -765,7 +737,7 @@ ;; definition for method 31 of type ogre-step-a ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-step-a ((this ogre-step-a)) +(defmethod rigid-body-platform-method-31 ((this ogre-step-a)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0) (initialize-skeleton this *ogre-step-a-sg* '()) (call-parent-method this) @@ -775,7 +747,7 @@ ;; definition for method 31 of type ogre-step-b ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-step-b ((this ogre-step-b)) +(defmethod rigid-body-platform-method-31 ((this ogre-step-b)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0) (initialize-skeleton this *ogre-step-b-sg* '()) (call-parent-method this) @@ -785,7 +757,7 @@ ;; definition for method 31 of type ogre-step-c ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-step-c ((this ogre-step-c)) +(defmethod rigid-body-platform-method-31 ((this ogre-step-c)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 26624.0) (initialize-skeleton this *ogre-step-c-sg* '()) (call-parent-method this) @@ -795,7 +767,7 @@ ;; definition for method 31 of type ogre-step-d ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-step-d ((this ogre-step-d)) +(defmethod rigid-body-platform-method-31 ((this ogre-step-d)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0) (initialize-skeleton this *ogre-step-b-sg* '()) (call-parent-method this) @@ -834,14 +806,10 @@ ;; definition of type ogre-isle (deftype ogre-isle (ogre-plat) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) ;; definition for method 3 of type ogre-isle -(defmethod inspect ogre-isle ((this ogre-isle)) +(defmethod inspect ((this ogre-isle)) (let ((t9-0 (method-of-type ogre-plat inspect))) (t9-0 this) ) @@ -850,7 +818,7 @@ ;; definition for method 31 of type ogre-isle ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-isle ((this ogre-isle)) +(defmethod rigid-body-platform-method-31 ((this ogre-isle)) (set! (-> this idle-y-offset) -6144.0) (set! (-> this float-y-offset) 4096.0) (rigid-body-platform-method-29 this *ogre-isle-constants*) @@ -863,14 +831,10 @@ ;; definition of type ogre-isle-b (deftype ogre-isle-b (ogre-isle) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) ;; definition for method 3 of type ogre-isle-b -(defmethod inspect ogre-isle-b ((this ogre-isle-b)) +(defmethod inspect ((this ogre-isle-b)) (let ((t9-0 (method-of-type ogre-isle inspect))) (t9-0 this) ) @@ -880,14 +844,10 @@ ;; definition of type ogre-isle-c (deftype ogre-isle-c (ogre-isle) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) ;; definition for method 3 of type ogre-isle-c -(defmethod inspect ogre-isle-c ((this ogre-isle-c)) +(defmethod inspect ((this ogre-isle-c)) (let ((t9-0 (method-of-type ogre-isle inspect))) (t9-0 this) ) @@ -897,14 +857,10 @@ ;; definition of type ogre-isle-d (deftype ogre-isle-d (ogre-isle) () - :heap-base #x2a0 - :method-count-assert 35 - :size-assert #x308 - :flag-assert #x2302a00308 ) ;; definition for method 3 of type ogre-isle-d -(defmethod inspect ogre-isle-d ((this ogre-isle-d)) +(defmethod inspect ((this ogre-isle-d)) (let ((t9-0 (method-of-type ogre-isle inspect))) (t9-0 this) ) @@ -913,7 +869,7 @@ ;; definition for method 31 of type ogre-isle-b ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-isle-b ((this ogre-isle-b)) +(defmethod rigid-body-platform-method-31 ((this ogre-isle-b)) (+! (-> this root-overlay trans x) -8192.0) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 8192.0 0.0 24576.0) (initialize-skeleton this *ogre-isle-b-sg* '()) @@ -924,7 +880,7 @@ ;; definition for method 31 of type ogre-isle-c ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-isle-c ((this ogre-isle-c)) +(defmethod rigid-body-platform-method-31 ((this ogre-isle-c)) (+! (-> this root-overlay trans x) -8192.0) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 8192.0 0.0 24576.0) (initialize-skeleton this *ogre-isle-b-sg* '()) @@ -935,7 +891,7 @@ ;; definition for method 31 of type ogre-isle-d ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-isle-d ((this ogre-isle-d)) +(defmethod rigid-body-platform-method-31 ((this ogre-isle-d)) (+! (-> this root-overlay trans x) -8192.0) (+! (-> this root-overlay trans z) -8192.0) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 8192.0 0.0 22528.0) @@ -954,14 +910,10 @@ ;; definition of type ogre-bridge (deftype ogre-bridge (process-drawable) - ((root-override collide-shape-moving :offset 112) - (joint-mod-array joint-mod 8 :offset-assert 176) - (dead-joint-count int8 :offset-assert 208) + ((root collide-shape-moving :override) + (joint-mod-array joint-mod 8) + (dead-joint-count int8) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd1 - :flag-assert #x14007000d1 (:states ogre-bridge-activate ogre-bridge-activated @@ -971,7 +923,7 @@ ) ;; definition for method 3 of type ogre-bridge -(defmethod inspect ogre-bridge ((this ogre-bridge)) +(defmethod inspect ((this ogre-bridge)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -981,7 +933,7 @@ ) ;; definition for method 7 of type ogre-bridge -(defmethod relocate ogre-bridge ((this ogre-bridge) (arg0 int)) +(defmethod relocate ((this ogre-bridge) (arg0 int)) (dotimes (v1-0 8) (if (nonzero? (-> this joint-mod-array v1-0)) (&+! (-> this joint-mod-array v1-0) arg0) @@ -1012,9 +964,7 @@ (ogre-bridge-update-joints) ) :trans (behavior () - (if (and (and *target* - (>= 286720.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and (and *target* (>= 286720.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) (go ogre-bridge-activate) @@ -1129,7 +1079,7 @@ ;; definition for method 11 of type ogre-bridge ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ogre-bridge ((this ogre-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ogre-bridge) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -1302,7 +1252,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1335,19 +1285,15 @@ ;; definition of type ogre-bridgeend (deftype ogre-bridgeend (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states ogre-bridgeend-idle ) ) ;; definition for method 3 of type ogre-bridgeend -(defmethod inspect ogre-bridgeend ((this ogre-bridgeend)) +(defmethod inspect ((this ogre-bridgeend)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1364,7 +1310,7 @@ ;; definition for method 11 of type ogre-bridgeend ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ogre-bridgeend ((this ogre-bridgeend) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ogre-bridgeend) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object)) @@ -1377,7 +1323,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *ogre-bridgeend-sg* '()) @@ -1387,17 +1333,13 @@ ;; definition of type ogre-lava (deftype ogre-lava (water-anim) - ((idle-anim int32 :offset-assert 220) - (anim int32 :offset-assert 224) + ((idle-anim int32) + (anim int32) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xe4 - :flag-assert #x1e008000e4 ) ;; definition for method 3 of type ogre-lava -(defmethod inspect ogre-lava ((this ogre-lava)) +(defmethod inspect ((this ogre-lava)) (let ((t9-0 (method-of-type water-anim inspect))) (t9-0 this) ) @@ -1480,7 +1422,7 @@ ;; definition for method 22 of type ogre-lava ;; INFO: Return type mismatch symbol vs none. -(defmethod water-vol-method-22 ogre-lava ((this ogre-lava)) +(defmethod water-vol-method-22 ((this ogre-lava)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) @@ -1497,13 +1439,9 @@ ;; definition of type shortcut-boulder (deftype shortcut-boulder (process-drawable) - ((root-override collide-shape :offset 112) - (broken-look lod-set :inline :offset-assert 176) + ((root collide-shape :override) + (broken-look lod-set :inline) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd1 - :flag-assert #x14007000d1 (:states shortcut-boulder-break shortcut-boulder-idle @@ -1511,7 +1449,7 @@ ) ;; definition for method 3 of type shortcut-boulder -(defmethod inspect shortcut-boulder ((this shortcut-boulder)) +(defmethod inspect ((this shortcut-boulder)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1626,7 +1564,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) @@ -1662,7 +1600,7 @@ ;; definition for method 11 of type shortcut-boulder ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! shortcut-boulder ((this shortcut-boulder) (arg0 entity-actor)) +(defmethod init-from-entity! ((this shortcut-boulder) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) @@ -1675,7 +1613,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *shortcut-boulder-whole-sg* '()) diff --git a/test/decompiler/reference/jak1/levels/ogre/ogre-part_REF.gc b/test/decompiler/reference/jak1/levels/ogre/ogre-part_REF.gc index 1c3fdcc8f8f..9e83d71d6b1 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogre-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogre-part_REF.gc @@ -683,14 +683,10 @@ ;; definition of type ogre-part (deftype ogre-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type ogre-part -(defmethod inspect ogre-part ((this ogre-part)) +(defmethod inspect ((this ogre-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc b/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc index decadd6dfb9..9491535d2c3 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc @@ -69,20 +69,16 @@ ;; definition of type ogreboss-missile (deftype ogreboss-missile (process-drawable) - ((parent-override (pointer process-drawable) :offset 12) - (root-override collide-shape-moving :offset 112) - (trajectory trajectory :inline :offset-assert 176) - (src-pos vector :inline :offset-assert 224) - (dest-pos vector :inline :offset-assert 240) - (start-time time-frame :offset-assert 256) - (tumble-quat quaternion :inline :offset-assert 272) - (blast-radius float :offset-assert 288) - (pickup-type pickup-type :offset-assert 292) + ((root collide-shape-moving :override) + (parent-override (pointer process-drawable) :overlay-at parent) + (trajectory trajectory :inline) + (src-pos vector :inline) + (dest-pos vector :inline) + (start-time time-frame) + (tumble-quat quaternion :inline) + (blast-radius float) + (pickup-type pickup-type) ) - :heap-base #xc0 - :method-count-assert 20 - :size-assert #x128 - :flag-assert #x1400c00128 (:states ogreboss-missile-idle ogreboss-missile-impact @@ -91,7 +87,7 @@ ) ;; definition for method 3 of type ogreboss-missile -(defmethod inspect ogreboss-missile ((this ogreboss-missile)) +(defmethod inspect ((this ogreboss-missile)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -119,13 +115,13 @@ (let ((f0-1 (the float (- (current-time) (-> self start-time))))) (eval-position! (-> self trajectory) f0-1 gp-0) ) - (vector-! s5-0 gp-0 (-> self root-override trans)) + (vector-! s5-0 gp-0 (-> self root trans)) (let ((f0-2 (fill-and-probe-using-line-sphere *collide-cache* - (-> self root-override trans) + (-> self root trans) s5-0 (the-as float 4096.0) - (-> self root-override root-prim collide-with) + (-> self root root-prim collide-with) (-> self parent-override 0) s4-0 (new 'static 'pat-surface :noentity #x1) @@ -134,17 +130,17 @@ ) (cond ((>= f0-2 0.0) - (vector+*! (-> self root-override trans) (-> self root-override trans) s5-0 f0-2) + (vector+*! (-> self root trans) (-> self root trans) s5-0 f0-2) (go ogreboss-missile-impact) ) (else - (set! (-> self root-override trans quad) (-> gp-0 quad)) + (set! (-> self root trans quad) (-> gp-0 quad)) 0 ) ) ) - (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) - (spawn (-> self part) (-> self root-override trans)) + (quaternion*! (-> self root quat) (-> self root quat) (-> self tumble-quat)) + (spawn (-> self part) (-> self root trans)) (suspend) ) ) @@ -156,7 +152,7 @@ ;; failed to figure out what this is: (defstate ogreboss-missile-seek (ogreboss-missile) :post (behavior () - (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) + (quaternion*! (-> self root quat) (-> self root quat) (-> self tumble-quat)) (transform-post) ) ) @@ -259,7 +255,7 @@ s4-1 s3-0 (the-as float 40.96) - (-> self root-override root-prim collide-with) + (-> self root root-prim collide-with) t1-0 t2-0 (new 'static 'pat-surface :noentity #x1) @@ -296,11 +292,11 @@ ) :code (behavior () (logclear! (-> self mask) (process-mask enemy projectile)) - (ogreboss-rock-explosion-effect (the-as basic (-> self root-override trans))) + (ogreboss-rock-explosion-effect (the-as basic (-> self root trans))) (when (nonzero? (-> self pickup-type)) (let ((t1-0 (new 'static 'fact-info :options (fact-options fade) :fade-time (seconds 5)))) (birth-pickup-at-point - (-> self root-override trans) + (-> self root trans) (-> self pickup-type) (-> *FACT-bank* eco-single-inc) #t @@ -310,20 +306,20 @@ ) ) (ja-channel-set! 0) - (let ((v1-10 (-> self root-override root-prim))) + (let ((v1-10 (-> self root root-prim))) (set! (-> v1-10 local-sphere w) (-> self blast-radius)) (set! (-> v1-10 prim-core world-sphere w) (-> self blast-radius)) (set! (-> v1-10 collide-with) (collide-kind cak-2 cak-3 target crate enemy wall-object ground-object)) (set! (-> v1-10 prim-core collide-as) (collide-kind enemy)) ) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (let ((a1-1 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-1 options) (the-as uint 0)) (set! (-> a1-1 tlist) *touching-list*) - (find-overlapping-shapes (-> self root-override) a1-1) + (find-overlapping-shapes (-> self root) a1-1) ) (suspend) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (while (-> self child) (suspend) ) @@ -334,20 +330,17 @@ ;; definition of type ogreboss-missile-init-data (deftype ogreboss-missile-init-data (structure) - ((src vector :offset-assert 0) - (dest vector :offset-assert 4) - (duration time-frame :offset-assert 8) - (xz-speed float :offset-assert 16) - (blast-radius float :offset-assert 20) - (pickup-type pickup-type :offset-assert 24) + ((src vector) + (dest vector) + (duration time-frame) + (xz-speed float) + (blast-radius float) + (pickup-type pickup-type) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type ogreboss-missile-init-data -(defmethod inspect ogreboss-missile-init-data ((this ogreboss-missile-init-data)) +(defmethod inspect ((this ogreboss-missile-init-data)) (format #t "[~8x] ~A~%" this 'ogreboss-missile-init-data) (format #t "~Tsrc: #~%" (-> this src)) (format #t "~Tdest: #~%" (-> this dest)) @@ -380,13 +373,13 @@ (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) (set! (-> s5-0 event-self) 'touched) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) - (set! (-> self root-override trans quad) (-> arg0 src quad)) + (set! (-> self root trans quad) (-> arg0 src quad)) (set! (-> self src-pos quad) (-> arg0 src quad)) (set! (-> self dest-pos quad) (-> arg0 dest quad)) - (set! (-> self root-override quat vec quad) (-> self parent-override 0 root quat vec quad)) - (vector-identity! (-> self root-override scale)) + (set! (-> self root quat vec quad) (-> self parent-override 0 root quat vec quad)) + (vector-identity! (-> self root scale)) (initialize-skeleton self *ogreboss-shoot-boulder-sg* '()) (logior! (-> self mask) (process-mask enemy projectile)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -427,24 +420,20 @@ ;; definition of type ogreboss-super-boulder (deftype ogreboss-super-boulder (process-drawable) - ((parent-override (pointer process-drawable) :offset 12) - (root-override collide-shape-moving :offset 112) - (orig-pos vector :inline :offset-assert 176) - (src-pos vector :inline :offset-assert 192) - (spin-axis vector :inline :offset-assert 208) - (joint joint-mod-blend-local :offset-assert 224) - (speed float :offset-assert 228) - (size float :offset-assert 232) - (grow-rate float :offset-assert 236) - (lava entity-actor :offset-assert 240) - (sound-id sound-id :offset-assert 244) - (hit-boss symbol :offset-assert 248) - (tumble-quat quaternion :inline :offset-assert 256) + ((root collide-shape-moving :override) + (parent-override (pointer process-drawable) :overlay-at parent) + (orig-pos vector :inline) + (src-pos vector :inline) + (spin-axis vector :inline) + (joint joint-mod-blend-local) + (speed float) + (size float) + (grow-rate float) + (lava entity-actor) + (sound-id sound-id) + (hit-boss symbol) + (tumble-quat quaternion :inline) ) - :heap-base #xa0 - :method-count-assert 20 - :size-assert #x110 - :flag-assert #x1400a00110 (:states ogreboss-super-boulder-die ogreboss-super-boulder-hit @@ -457,7 +446,7 @@ ) ;; definition for method 3 of type ogreboss-super-boulder -(defmethod inspect ogreboss-super-boulder ((this ogreboss-super-boulder)) +(defmethod inspect ((this ogreboss-super-boulder)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -481,7 +470,7 @@ (('touch) (when (and *target* ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) ) @@ -598,7 +587,7 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs object. (defbehavior ogreboss-super-boulder-play-hit-anim ogreboss-super-boulder () - (set! (-> self src-pos quad) (-> self root-override trans quad)) + (set! (-> self src-pos quad) (-> self root trans quad)) (ja-no-eval :group! ogreboss-super-boulder-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (seconds-per-frame))) @@ -608,7 +597,7 @@ ) (f0-13 (fmax 0.0 (fmin 1.0 f1-1))) ) - (vector-lerp! (-> self root-override trans) (-> self src-pos) (-> self orig-pos) f0-13) + (vector-lerp! (-> self root trans) (-> self src-pos) (-> self orig-pos) f0-13) ) (suspend) (ja :num! (seek!)) @@ -621,7 +610,7 @@ :event ogreboss-super-boulder-event-handler :code (behavior () (set! (-> self hit-boss) #f) - (set! (-> self src-pos quad) (-> self root-override trans quad)) + (set! (-> self src-pos quad) (-> self root trans quad)) (ja-no-eval :group! ogreboss-super-boulder-throw-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (seconds-per-frame))) @@ -631,7 +620,7 @@ ) (f0-13 (fmax 0.0 (fmin 1.0 f1-1))) ) - (vector-lerp! (-> self root-override trans) (-> self src-pos) (-> self orig-pos) f0-13) + (vector-lerp! (-> self root trans) (-> self src-pos) (-> self orig-pos) f0-13) ) 0 (suspend) @@ -673,7 +662,7 @@ (defstate ogreboss-super-boulder-land (ogreboss-super-boulder) :event ogreboss-super-boulder-event-handler :code (behavior () - (set! (-> self root-override trans quad) (-> self orig-pos quad)) + (set! (-> self root trans quad) (-> self orig-pos quad)) (ogreboss-super-boulder-impact-effect) (set! (-> self joint enable) #f) (ja-no-eval :group! ogreboss-super-boulder-roll-ja @@ -681,9 +670,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (when (< 81920.0 - (vector-vector-distance (the-as vector (-> self root-override root-prim prim-core)) (target-pos 0)) - ) + (when (< 81920.0 (vector-vector-distance (the-as vector (-> self root root-prim prim-core)) (target-pos 0))) (ja-channel-push! 1 (seconds 0.1)) (go ogreboss-super-boulder-roll) ) @@ -711,7 +698,7 @@ (suspend) (ja :num! (seek! (ja-aframe (the-as float 162.0) 0))) ) - (set! (-> self root-override root-prim local-sphere w) 28672.0) + (set! (-> self root root-prim local-sphere w) 28672.0) (cond ((-> self hit-boss) (while (let ((gp-2 (new 'stack-no-clear 'event-message-block))) @@ -771,7 +758,7 @@ ) ;; definition for method 7 of type ogreboss-super-boulder -(defmethod relocate ogreboss-super-boulder ((this ogreboss-super-boulder) (arg0 int)) +(defmethod relocate ((this ogreboss-super-boulder) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -781,7 +768,7 @@ ;; failed to figure out what this is: (defstate ogreboss-super-boulder-killed-player (ogreboss-super-boulder) :code (behavior () - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-post) (loop (suspend) @@ -811,12 +798,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> self root-override) s4-0) + (set! (-> self root) s4-0) ) (set! (-> self orig-pos quad) (-> arg0 quad)) - (set! (-> self root-override trans quad) (-> self parent-override 0 root trans quad)) - (set! (-> self root-override quat vec quad) (-> self parent-override 0 root quat vec quad)) - (vector-identity! (-> self root-override scale)) + (set! (-> self root trans quad) (-> self parent-override 0 root trans quad)) + (set! (-> self root quat vec quad) (-> self parent-override 0 root quat vec quad)) + (vector-identity! (-> self root scale)) (initialize-skeleton self *ogreboss-super-boulder-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self lava) (entity-actor-lookup (-> self entity) 'water-actor 0)) @@ -844,25 +831,21 @@ ;; definition of type ogreboss-bounce-boulder (deftype ogreboss-bounce-boulder (process-drawable) - ((parent-override (pointer ogreboss-super-boulder) :offset 12) - (root-override collide-shape-moving :offset 112) - (src-pos vector :inline :offset-assert 176) - (side-dir vector :inline :offset-assert 192) - (side-pos float :offset-assert 208) - (dest-pos float :offset-assert 212) - (boulder-type int8 :offset-assert 216) + ((root collide-shape-moving :override) + (parent-override (pointer ogreboss-super-boulder) :overlay-at parent) + (src-pos vector :inline) + (side-dir vector :inline) + (side-pos float) + (dest-pos float) + (boulder-type int8) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd9 - :flag-assert #x14007000d9 (:states ogreboss-bounce-boulder-idle ) ) ;; definition for method 3 of type ogreboss-bounce-boulder -(defmethod inspect ogreboss-bounce-boulder ((this ogreboss-bounce-boulder)) +(defmethod inspect ((this ogreboss-bounce-boulder)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -880,7 +863,7 @@ (('touch) (if (and *target* ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) ) @@ -922,10 +905,10 @@ (cleanup-for-death self) ) :post (behavior () - (vector+*! (-> self root-override trans) (-> self src-pos) (-> self side-dir) (-> self side-pos)) + (vector+*! (-> self root trans) (-> self src-pos) (-> self side-dir) (-> self side-pos)) (transform-post) (find-ground-and-draw-shadow - (the-as vector (-> self root-override root-prim prim-core)) + (the-as vector (-> self root root-prim prim-core)) (the-as vector #f) (the-as float 49152.0) (collide-kind background) @@ -958,13 +941,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) (set! (-> self boulder-type) arg0) - (set! (-> self root-override trans quad) (-> self parent-override 0 root-override trans quad)) - (set! (-> self root-override quat vec quad) (-> self parent-override 0 root-override quat vec quad)) - (vector-identity! (-> self root-override scale)) - (set! (-> self src-pos quad) (-> self root-override trans quad)) + (set! (-> self root trans quad) (-> self parent-override 0 root trans quad)) + (set! (-> self root quat vec quad) (-> self parent-override 0 root quat vec quad)) + (vector-identity! (-> self root scale)) + (set! (-> self src-pos quad) (-> self root trans quad)) (set! (-> self side-pos) 0.0) (set! (-> self dest-pos) (the-as float (cond ((zero? arg0) @@ -982,7 +965,7 @@ ) ) ) - (vector-x-quaternion! (-> self side-dir) (-> self root-override quat)) + (vector-x-quaternion! (-> self side-dir) (-> self root quat)) (initialize-skeleton self *ogreboss-bounce-boulder-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self draw origin-joint-index) (the-as uint 3)) @@ -993,40 +976,36 @@ ;; definition of type ogreboss (deftype ogreboss (process-drawable) - ((root-override collide-shape :offset 112) - (old-player-transform transformq :inline :offset-assert 176) - (level float :offset-assert 224) - (difficulty float :offset-assert 228) - (boulder handle :offset-assert 232) - (column handle :offset-assert 240) - (z-plane vector :inline :offset-assert 256) - (far-pos vector :inline :offset-assert 272) - (near-pos vector :inline :offset-assert 288) - (side-dir vector :inline :offset-assert 304) - (target-offset-array vector 3 :inline :offset-assert 320) - (target-offset-array-2 vector :inline :offset 336) - (target-offset-array-3 vector :inline :offset 352) - (target-actor-array entity-actor 3 :offset-assert 368) - (target-blast-radius-array float 3 :offset-assert 380) - (shuffle-pos float :offset-assert 392) - (target-count int8 :offset-assert 396) - (hit-count int8 :offset-assert 397) - (max-hit-count int8 :offset-assert 398) - (roll-boulder int8 :offset-assert 399) - (try-count uint8 :offset-assert 400) - (hit-time time-frame :offset-assert 408) - (grow-time float :offset-assert 416) - (lava entity-actor :offset-assert 420) - (vulnerable symbol :offset-assert 424) - (bridge-assembled symbol :offset-assert 428) - (at-near-spot symbol :offset-assert 432) - (submerged symbol :offset-assert 436) - (try-counted symbol :offset-assert 440) + ((root collide-shape :override) + (old-player-transform transformq :inline) + (level float) + (difficulty float) + (boulder handle) + (column handle) + (z-plane vector :inline) + (far-pos vector :inline) + (near-pos vector :inline) + (side-dir vector :inline) + (target-offset-array vector 3 :inline) + (target-offset-array-2 vector :inline :overlay-at (-> target-offset-array 1)) + (target-offset-array-3 vector :inline :overlay-at (-> target-offset-array 2)) + (target-actor-array entity-actor 3) + (target-blast-radius-array float 3) + (shuffle-pos float) + (target-count int8) + (hit-count int8) + (max-hit-count int8) + (roll-boulder int8) + (try-count uint8) + (hit-time time-frame) + (grow-time float) + (lava entity-actor) + (vulnerable symbol) + (bridge-assembled symbol) + (at-near-spot symbol) + (submerged symbol) + (try-counted symbol) ) - :heap-base #x150 - :method-count-assert 20 - :size-assert #x1bc - :flag-assert #x14015001bc (:states ogreboss-dead ogreboss-die @@ -1042,7 +1021,7 @@ ) ;; definition for method 3 of type ogreboss -(defmethod inspect ogreboss ((this ogreboss)) +(defmethod inspect ((this ogreboss)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1179,7 +1158,7 @@ (defstate ogreboss-idle (ogreboss) :enter (behavior () (when (zero? (-> self try-count)) - (let ((gp-0 (manipy-spawn (-> self root-override trans) (-> self entity) *ogreboss-column-sg* #f :to self))) + (let ((gp-0 (manipy-spawn (-> self root trans) (-> self entity) *ogreboss-column-sg* #f :to self))) (set! (-> self column) (ppointer->handle gp-0)) (send-event (ppointer->process gp-0) 'anim-mode 'loop) (send-event (ppointer->process gp-0) 'art-joint-anim "ogreboss-column-idle" 0) @@ -1220,7 +1199,7 @@ (run-now-in-process gp-0 pov-camera-init-by-other - (-> self root-override trans) + (-> self root trans) *ogreboss-cam-sg* "ogreboss-cam-intro" 0 @@ -1332,7 +1311,7 @@ ) (if a1-0 (set! (-> s5-0 quad) (-> (the-as process-drawable a1-0) root trans quad)) - (set! (-> s5-0 quad) (-> self root-override trans quad)) + (set! (-> s5-0 quad) (-> self root trans quad)) ) ) (vector+! s5-0 s5-0 (-> self target-offset-array v1-10)) @@ -1340,12 +1319,12 @@ ) ) (else - (vector+*! s5-0 (-> self root-override trans) *z-vector* (the-as float 409600.0)) + (vector+*! s5-0 (-> self root trans) *z-vector* (the-as float 409600.0)) ) ) (set! (-> gp-0 dest) s5-0) ) - (sound-play "ogre-fires" :position (the-as symbol (-> self root-override trans))) + (sound-play "ogre-fires" :position (the-as symbol (-> self root trans))) (process-spawn part-tracker :init part-tracker-init @@ -1495,7 +1474,7 @@ (when (not (-> self at-near-spot)) (ogreboss-submerge arg0 arg1) (set! (-> self at-near-spot) #t) - (set! (-> self root-override trans quad) (-> self near-pos quad)) + (set! (-> self root trans quad) (-> self near-pos quad)) (ogreboss-emerge arg1) ) 0 @@ -1509,7 +1488,7 @@ (when (-> self at-near-spot) (ogreboss-submerge arg0 arg1) (set! (-> self at-near-spot) #f) - (set! (-> self root-override trans quad) (-> self far-pos quad)) + (set! (-> self root trans quad) (-> self far-pos quad)) (ogreboss-emerge arg1) ) 0 @@ -1584,10 +1563,10 @@ (let ((boulder-pickup (pickup-type none))) (let ((f28-0 0.0)) (cond - ((>= 1.0 (-> *target* fact-info-target health)) + ((>= 1.0 (-> *target* fact health)) (set! f28-0 0.1) ) - ((>= 2.0 (-> *target* fact-info-target health)) + ((>= 2.0 (-> *target* fact health)) (set! f28-0 0.05) ) ) @@ -1639,7 +1618,7 @@ ;; definition for function ogreboss-roll-boulder ;; INFO: Return type mismatch int vs none. (defbehavior ogreboss-roll-boulder ogreboss () - (sound-play "ogre-fires" :position (the-as symbol (-> self root-override trans))) + (sound-play "ogre-fires" :position (the-as symbol (-> self root trans))) (+! (-> self roll-boulder) (rand-vu-int-range 1 2)) (if (>= (-> self roll-boulder) 3) (+! (-> self roll-boulder) -3) @@ -1699,7 +1678,7 @@ (defbehavior ogreboss-update-super-boulder ogreboss () (let ((a1-0 (handle->process (-> self boulder)))) (if a1-0 - (set! (-> (the-as ogreboss-super-boulder a1-0) root-override trans quad) (-> self root-override trans quad)) + (set! (-> (the-as ogreboss-super-boulder a1-0) root trans quad) (-> self root trans quad)) ) ) 0 @@ -1723,7 +1702,7 @@ (when (-> self vulnerable) (if ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 128) ) (ja :chan 1 :group! ogreboss-hit-crotch-ja :num! min :frame-interp 0.0) @@ -1733,13 +1712,13 @@ (let ((v1-17 (rand-vu-int-range 0 2))) (cond ((zero? v1-17) - (sound-play "ogre-grunt1" :position (the-as symbol (-> self root-override trans))) + (sound-play "ogre-grunt1" :position (the-as symbol (-> self root trans))) ) ((= v1-17 1) - (sound-play "ogre-grunt2" :position (the-as symbol (-> self root-override trans))) + (sound-play "ogre-grunt2" :position (the-as symbol (-> self root trans))) ) (else - (sound-play "ogre-grunt3" :position (the-as symbol (-> self root-override trans))) + (sound-play "ogre-grunt3" :position (the-as symbol (-> self root trans))) ) ) ) @@ -1932,7 +1911,7 @@ ) ) :post (behavior () - (vector+*! (-> self root-override trans) (-> self far-pos) (-> self side-dir) (-> self shuffle-pos)) + (vector+*! (-> self root trans) (-> self far-pos) (-> self side-dir) (-> self shuffle-pos)) (ogreboss-post) ) ) @@ -2054,7 +2033,7 @@ ) (process-entity-status! self (entity-perm-status complete) #t) (close-specific-task! (game-task ogre-boss) (task-status need-reminder)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-channel-set! 0) (ja-post) (when (not (task-complete? *game-info* (-> self entity extra perm task))) @@ -2109,7 +2088,7 @@ ;; definition for method 11 of type ogreboss ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ogreboss ((this ogreboss) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ogreboss) (arg0 entity-actor)) (logior! (-> this mask) (process-mask attackable)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 6) 0))) @@ -2175,7 +2154,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -2203,17 +2182,17 @@ (set! (-> this vulnerable) #f) (set! (-> this bridge-assembled) #f) (set! (-> this submerged) #f) - (vector-z-quaternion! (-> this z-plane) (-> this root-override quat)) - (set! (-> this z-plane w) (- (vector-dot (-> this z-plane) (-> this root-override trans)))) - (vector-x-quaternion! (-> this side-dir) (-> this root-override quat)) - (set! (-> this far-pos quad) (-> this root-override trans quad)) + (vector-z-quaternion! (-> this z-plane) (-> this root quat)) + (set! (-> this z-plane w) (- (vector-dot (-> this z-plane) (-> this root trans)))) + (vector-x-quaternion! (-> this side-dir) (-> this root quat)) + (set! (-> this far-pos quad) (-> this root trans quad)) (let ((f0-38 1.0)) - (set-vector! (-> this root-override scale) f0-38 f0-38 f0-38 1.0) + (set-vector! (-> this root scale) f0-38 f0-38 f0-38 1.0) ) (vector+*! (-> this near-pos) (-> this far-pos) (-> this z-plane) (the-as float 348160.0)) (set! (-> this at-near-spot) #t) (set! (-> this try-counted) #f) - (set! (-> this root-override trans quad) (-> this near-pos quad)) + (set! (-> this root trans quad) (-> this near-pos quad)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go ogreboss-dead) (go ogreboss-idle) diff --git a/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc index 7e0e8f77831..c59342b1b29 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc @@ -333,14 +333,10 @@ ;; definition of type hud-bike-heat (deftype hud-bike-heat (hud) () - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x118 - :flag-assert #x1b00b00118 ) ;; definition for method 3 of type hud-bike-heat -(defmethod inspect hud-bike-heat ((this hud-bike-heat)) +(defmethod inspect ((this hud-bike-heat)) (let ((t9-0 (method-of-type hud inspect))) (t9-0 this) ) @@ -349,7 +345,7 @@ ;; definition for method 19 of type hud-bike-heat ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-bike-heat ((this hud-bike-heat)) +(defmethod hud-update ((this hud-bike-heat)) (if *target* (tally-value this (the int (-> *target* racer heat)) 0) ) @@ -359,7 +355,7 @@ ;; definition for method 20 of type hud-bike-heat ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-bike-heat ((this hud-bike-heat) (arg0 int)) +(defmethod init-particles! ((this hud-bike-heat) (arg0 int)) (add-setting! 'common-page 'set 0.0 2) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) @@ -420,14 +416,10 @@ ;; definition of type hud-bike-speed (deftype hud-bike-speed (hud) () - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x118 - :flag-assert #x1b00b00118 ) ;; definition for method 3 of type hud-bike-speed -(defmethod inspect hud-bike-speed ((this hud-bike-speed)) +(defmethod inspect ((this hud-bike-speed)) (let ((t9-0 (method-of-type hud inspect))) (t9-0 this) ) @@ -436,7 +428,7 @@ ;; definition for method 19 of type hud-bike-speed ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-bike-speed ((this hud-bike-speed)) +(defmethod hud-update ((this hud-bike-speed)) (if *target* (tally-value this (the int (-> *target* control unknown-float01)) 0) ) @@ -446,7 +438,7 @@ ;; definition for method 20 of type hud-bike-speed ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-bike-speed ((this hud-bike-speed) (arg0 int)) +(defmethod init-particles! ((this hud-bike-speed) (arg0 int)) (add-setting! 'common-page 'set 0.0 2) (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) (let ((s5-0 (-> this nb-of-particles))) diff --git a/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc index 881ab1f4aaf..f903fce2ecc 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc @@ -757,11 +757,11 @@ (combine! (-> self attack-info) arg1) (case (-> self attack-info mode) (('endlessfall 'death 'explode 'water-vol 'heat 'melt 'instant-death) - (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) -1000.0 (the-as handle #f)) + (pickup-collectable! (-> self fact) (pickup-type eco-green) -1000.0 (the-as handle #f)) ) (else (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) @@ -789,7 +789,7 @@ (set! (-> self racer boost-target) 0.0) (set! (-> self racer boost-output) 0.0) (set! (-> self racer boost-time) 0) - (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) (go target-racing-death (-> self attack-info mode)) ) (case (-> self attack-info mode) @@ -1065,11 +1065,11 @@ ) ) (when s4-1 - (set! (-> s5-0 quad) (-> s4-1 root-override trans quad)) - (quaternion-copy! (-> self control unknown-quaternion03) (-> s4-1 root-override quat)) + (set! (-> s5-0 quad) (-> s4-1 root trans quad)) + (quaternion-copy! (-> self control unknown-quaternion03) (-> s4-1 root quat)) (send-event s4-1 'trans (-> self racer bike-trans)) - (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> s4-1 root-override quat)) - (set! (-> self racer bike-scale quad) (-> s4-1 root-override scale quad)) + (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> s4-1 root quat)) + (set! (-> self racer bike-scale quad) (-> s4-1 root scale quad)) (set! (-> self control unknown-int21) (the-as int (-> self racer bike-trans y))) ) ) @@ -1229,12 +1229,12 @@ ) ) (when s3-0 - (set! (-> s4-1 quad) (-> s3-0 root-override trans quad)) - (set-yaw-angle-clear-roll-pitch! (-> s3-0 root-override) (quaternion-y-angle (-> self control quat))) - (quaternion-copy! (-> self control unknown-quaternion03) (-> s3-0 root-override quat)) + (set! (-> s4-1 quad) (-> s3-0 root trans quad)) + (set-yaw-angle-clear-roll-pitch! (-> s3-0 root) (quaternion-y-angle (-> self control quat))) + (quaternion-copy! (-> self control unknown-quaternion03) (-> s3-0 root quat)) (send-event s3-0 'trans (-> self racer bike-trans)) - (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> s3-0 root-override quat)) - (set! (-> self racer bike-scale quad) (-> s3-0 root-override scale quad)) + (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> s3-0 root quat)) + (set! (-> self racer bike-scale quad) (-> s3-0 root scale quad)) (set! (-> self control unknown-int21) (the-as int (-> self racer bike-trans y))) ) ) diff --git a/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc index 02528f50ddf..b3cde075e90 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc @@ -8,31 +8,27 @@ ;; definition of type racer (deftype racer (process-drawable) - ((parent-override (pointer target) :offset 12) - (root-override collide-shape-moving :offset 112) - (extra-trans vector :inline :offset-assert 176) - (condition int32 :offset-assert 192) - (cell handle :offset-assert 200) - (path-data path-control 2 :offset-assert 208) - (path-target curve-control :offset 208) - (path-racer path-control :offset 212) - (auto-get-off symbol :offset-assert 216) - (shadow-backup shadow-geo :offset-assert 220) + ((root collide-shape-moving :override) + (parent-override (pointer target) :overlay-at parent) + (extra-trans vector :inline) + (condition int32) + (cell handle) + (path-data path-control 2) + (path-target curve-control :overlay-at (-> path-data 0)) + (path-racer path-control :overlay-at (-> path-data 1)) + (auto-get-off symbol) + (shadow-backup shadow-geo) ) - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe0 - :flag-assert #x18007000e0 - (:methods - (wait-for-start () _type_ :state 20) - (idle () _type_ :state 21) - (pickup ((state collectable)) _type_ :state 22) - (wait-for-return () _type_ :state 23) + (:state-methods + wait-for-start + idle + (pickup (state collectable)) + wait-for-return ) ) ;; definition for method 3 of type racer -(defmethod inspect racer ((this racer)) +(defmethod inspect ((this racer)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -49,7 +45,7 @@ ;; definition for method 7 of type racer ;; INFO: Return type mismatch process-drawable vs racer. -(defmethod relocate racer ((this racer) (arg0 int)) +(defmethod relocate ((this racer) (arg0 int)) (countdown (v1-0 2) (if (-> this path-data v1-0) (&+! (-> this path-data v1-0) arg0) @@ -87,7 +83,7 @@ ;; INFO: Return type mismatch int vs none. (defbehavior racer-effect racer () (when (!= (-> self condition) 4) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (update! (-> self sound)) ) 0 @@ -101,7 +97,7 @@ (local-vars (v0-1 structure)) (case message (('trans) - (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) (('notify) (set! v0-1 #t) @@ -124,8 +120,8 @@ ) ) :exit (behavior () - (set! (-> self root-override root-prim prim-core action) (collide-action)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense)) + (set! (-> self root root-prim prim-core action) (collide-action)) + (set! (-> self root root-prim prim-core offense) (collide-offense no-offense)) 0 ) :code (behavior () @@ -141,8 +137,8 @@ (((task-status need-reward-speech)) (ja-channel-set! 1) (ja :group! racer-racer-idle-ja) - (set! (-> self root-override root-prim prim-core action) (collide-action solid attackable-unused)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> self root root-prim prim-core action) (collide-action solid attackable-unused)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) (ja-post) ) (((task-status invalid)) @@ -183,7 +179,7 @@ (set! (-> self cell) (ppointer->handle (birth-pickup-at-point - (vector+! (new 'stack-no-clear 'vector) (-> self root-override trans) (new 'static 'vector :y 8192.0 :w 1.0)) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 8192.0 :w 1.0)) (pickup-type fuel-cell) (the float (-> self entity extra perm task)) #f @@ -227,8 +223,8 @@ :code (behavior () (ja-channel-set! 1) (ja :group! racer-racer-idle-ja) - (set! (-> self root-override root-prim prim-core action) (collide-action solid attackable-unused)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> self root root-prim prim-core action) (collide-action solid attackable-unused)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) 0.0 (let ((f30-0 (if (= (-> self condition) 4) 61440.0 @@ -240,7 +236,7 @@ (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) (go-virtual wait-for-return) ) - (when (and (and *target* (>= f30-0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and (and *target* (>= f30-0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (and (not (movie?)) (not (level-hint-displayed?))) ) (hide-hud) @@ -281,12 +277,12 @@ (('draw) (ja-channel-set! 1) (ja :group! racer-racer-idle-ja) - (set! (-> self root-override root-prim prim-core action) (collide-action solid attackable-unused)) - (set! (-> self root-override root-prim prim-core offense) (collide-offense indestructible)) + (set! (-> self root root-prim prim-core action) (collide-action solid attackable-unused)) + (set! (-> self root root-prim prim-core offense) (collide-offense indestructible)) (transform-post) ) (('trans) - (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) (('touch 'attack) #f @@ -314,9 +310,7 @@ (ja-channel-set! 0) (ja-post) (while (zero? (ja-group-size)) - (when (or (not *target*) - (< 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (when (or (not *target*) (< 24576.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (when (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) (case (-> (level-get-target-inside *level*) name) (('misty) @@ -355,7 +349,7 @@ ) (cond ((= message 'trans) - (vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> block param 0)) (-> self root trans) (-> self extra-trans)) ) ((= message 'shadow) (cond @@ -392,7 +386,7 @@ ;; definition for method 11 of type racer ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! racer ((this racer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this racer) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -407,16 +401,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (set-yaw-angle-clear-roll-pitch! (-> this root-override) (res-lump-float arg0 'rotoffset)) + (set-yaw-angle-clear-roll-pitch! (-> this root) (res-lump-float arg0 'rotoffset)) (initialize-skeleton this *racer-sg* '()) (set! (-> this shadow-backup) (-> this draw shadow)) (set! (-> this draw shadow-ctrl) *racer-shadow-control*) (let ((v1-23 (-> this node-list data))) (set! (-> v1-23 0 param0) cspace<-transformq+trans!) - (set! (-> v1-23 0 param1) (the-as basic (-> this root-override trans))) + (set! (-> v1-23 0 param1) (the-as basic (-> this root trans))) (set! (-> v1-23 0 param2) (the-as basic (-> this extra-trans))) ) (set! (-> this condition) (res-lump-value arg0 'index int)) @@ -435,7 +429,7 @@ (set! (-> this path) (-> this path-target)) (set-vector! (-> this extra-trans) 0.0 6144.0 0.0 1.0) (set! (-> this auto-get-off) #f) - (move-to-ground (-> this root-override) 40960.0 40960.0 #t (collide-kind background)) + (move-to-ground (-> this root) 40960.0 40960.0 #t (collide-kind background)) (set! (-> this cell) (the-as handle #f)) (blocking-plane-spawn (the-as @@ -449,7 +443,7 @@ ) ) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> this root trans)) ) (go (method-of-object this wait-for-start)) (none) diff --git a/test/decompiler/reference/jak1/levels/racer_common/target-racer-h_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/target-racer-h_REF.gc index 6e93c0df47a..03c59d1a782 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/target-racer-h_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/target-racer-h_REF.gc @@ -3,101 +3,98 @@ ;; definition of type racer-info (deftype racer-info (basic) - ((entity entity-actor :offset-assert 4) - (bike-trans vector :inline :offset-assert 16) - (bike-quat vector :inline :offset-assert 32) - (bike-scale vector :inline :offset-assert 48) - (mod-x float :offset-assert 64) - (rot vector :inline :offset-assert 80) - (rot-old vector :inline :offset-assert 96) - (rotv vector :inline :offset-assert 112) - (lean-rotx degrees :offset-assert 128) - (change-roty degrees :offset-assert 132) - (change-roty-old degrees :offset-assert 136) - (quat vector :inline :offset-assert 144) - (surface-y meters :offset-assert 160) - (surface-vy meters :offset-assert 164) - (surface-quat vector :inline :offset-assert 176) - (surface-quat-smooth vector :inline :offset-assert 192) - (cushion-base meters :offset-assert 208) - (cushion-offset meters :offset-assert 212) - (cushion-bob meters :offset-assert 216) - (cushion-bob-old meters :offset-assert 220) - (cushion-smush smush-control :inline :offset-assert 224) - (shock-offset meters :offset-assert 256) - (shock-offsetv meters :offset-assert 260) - (shock-rotx meters :offset-assert 264) - (hill-value float :offset-assert 268) - (hill-ground-value float :offset-assert 272) - (hill-offset meters :offset-assert 276) - (hill-rotx degrees :offset-assert 280) - (hill-boost meters :offset-assert 284) - (bob-timer float :offset-assert 288) - (bob-meta-timer float :offset-assert 292) - (bob-meta-meta-timer float :offset-assert 296) - (bob-mult-rot float :offset-assert 300) - (bob-mult-trans float :offset-assert 304) - (bob-period float :offset-assert 308) - (bob-meta-time time-frame :offset-assert 312) - (bob-hit-ground-time time-frame :offset-assert 320) - (cur-rotx degrees :offset-assert 328) - (targ-rotx degrees :offset-assert 332) - (speed-rotx float :offset-assert 336) - (mult-rotx degrees :offset-assert 340) - (front-blade joint-mod :offset-assert 344) - (front-rot degrees :offset-assert 348) - (front-rotv degrees :offset-assert 352) - (bottom-blade joint-mod :offset-assert 356) - (bottom-rot degrees :offset-assert 360) - (front joint-mod :offset-assert 364) - (front-turn degrees :offset-assert 368) - (tail joint-mod :offset-assert 372) - (tail-tilt degrees :offset-assert 376) - (transv-max meters :offset-assert 380) - (slide-down-time time-frame 2 :offset-assert 384) - (slide-enter-time time-frame :offset-assert 400) - (slide-mode int32 :offset-assert 408) - (slide-amp float :offset-assert 412) - (slide-grip-mult float :offset-assert 416) - (slide-shift-x float :offset-assert 420) - (slide-interp float :offset-assert 424) - (heat float :offset-assert 428) - (boost-time time-frame :offset-assert 432) - (boost-duration time-frame :offset-assert 440) - (boost-curve float :offset-assert 448) - (boost-level float :offset-assert 452) - (boost-target float :offset-assert 456) - (boost-output float :offset-assert 460) - (hop? symbol :offset-assert 464) - (hop-start-y float :offset-assert 468) - (bounce int32 :offset-assert 472) - (bounce-hit float :offset-assert 476) - (engine-sound-id sound-id :offset-assert 480) - (boost-sound-id sound-id :offset-assert 484) - (engine-sound-pitch float :offset-assert 488) - (turn-anim-targ float :offset-assert 492) - (turn-anim-frame float :offset-assert 496) - (turn-anim-vel float :offset-assert 500) - (tail-anim-vel float :offset-assert 504) - (tail-anim-frame float :offset-assert 508) - (rudd-anim-vel float :offset-assert 512) - (rudd-anim-frame float :offset-assert 516) - (racing-time time-frame :offset-assert 520) - (stick-lock symbol :offset-assert 528) - (stick-off symbol :offset-assert 532) - (heavy symbol :offset-assert 536) - (unstuck-time time-frame :offset-assert 544) - (stuck-count int32 :offset-assert 552) - (scrape-sound-id sound-id :offset-assert 556) - (heat-sound-time time-frame :offset-assert 560) + ((entity entity-actor) + (bike-trans vector :inline) + (bike-quat vector :inline) + (bike-scale vector :inline) + (mod-x float) + (rot vector :inline) + (rot-old vector :inline) + (rotv vector :inline) + (lean-rotx degrees) + (change-roty degrees) + (change-roty-old degrees) + (quat vector :inline) + (surface-y meters) + (surface-vy meters) + (surface-quat vector :inline) + (surface-quat-smooth vector :inline) + (cushion-base meters) + (cushion-offset meters) + (cushion-bob meters) + (cushion-bob-old meters) + (cushion-smush smush-control :inline) + (shock-offset meters) + (shock-offsetv meters) + (shock-rotx meters) + (hill-value float) + (hill-ground-value float) + (hill-offset meters) + (hill-rotx degrees) + (hill-boost meters) + (bob-timer float) + (bob-meta-timer float) + (bob-meta-meta-timer float) + (bob-mult-rot float) + (bob-mult-trans float) + (bob-period float) + (bob-meta-time time-frame) + (bob-hit-ground-time time-frame) + (cur-rotx degrees) + (targ-rotx degrees) + (speed-rotx float) + (mult-rotx degrees) + (front-blade joint-mod) + (front-rot degrees) + (front-rotv degrees) + (bottom-blade joint-mod) + (bottom-rot degrees) + (front joint-mod) + (front-turn degrees) + (tail joint-mod) + (tail-tilt degrees) + (transv-max meters) + (slide-down-time time-frame 2) + (slide-enter-time time-frame) + (slide-mode int32) + (slide-amp float) + (slide-grip-mult float) + (slide-shift-x float) + (slide-interp float) + (heat float) + (boost-time time-frame) + (boost-duration time-frame) + (boost-curve float) + (boost-level float) + (boost-target float) + (boost-output float) + (hop? symbol) + (hop-start-y float) + (bounce int32) + (bounce-hit float) + (engine-sound-id sound-id) + (boost-sound-id sound-id) + (engine-sound-pitch float) + (turn-anim-targ float) + (turn-anim-frame float) + (turn-anim-vel float) + (tail-anim-vel float) + (tail-anim-frame float) + (rudd-anim-vel float) + (rudd-anim-frame float) + (racing-time time-frame) + (stick-lock symbol) + (stick-off symbol) + (heavy symbol) + (unstuck-time time-frame) + (stuck-count int32) + (scrape-sound-id sound-id) + (heat-sound-time time-frame) ) - :method-count-assert 9 - :size-assert #x238 - :flag-assert #x900000238 ) ;; definition for method 3 of type racer-info -(defmethod inspect racer-info ((this racer-info)) +(defmethod inspect ((this racer-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tentity: ~A~%" (-> this entity)) (format #t "~Tbike-trans: ~`vector`P~%" (-> this bike-trans)) @@ -191,32 +188,29 @@ ;; definition of type racer-bank (deftype racer-bank (basic) - ((slide-hold-time seconds :offset-assert 8) - (heat-max float :offset-assert 16) - (hotcoals-heat-inc float :offset-assert 20) - (lava-heat-inc float :offset-assert 24) - (lava-air-heat-inc float :offset-assert 28) - (surface-heat-inc float :offset-assert 32) - (jump-heat-inc float :offset-assert 36) - (lavatube-hotcoals-heat-inc float :offset-assert 40) - (lavatube-lava-heat-inc float :offset-assert 44) - (lavatube-lava-air-heat-inc float :offset-assert 48) - (lavatube-surface-heat-inc float :offset-assert 52) - (lavatube-jump-heat-inc float :offset-assert 56) - (boost-curve-max meters :offset-assert 60) - (boost-level-max meters :offset-assert 64) - (boost-level-inc meters :offset-assert 68) - (boost-duration seconds :offset-assert 72) - (default-front-blade degrees :offset-assert 80) - (yellow-projectile-speed meters :offset-assert 84) + ((slide-hold-time seconds) + (heat-max float) + (hotcoals-heat-inc float) + (lava-heat-inc float) + (lava-air-heat-inc float) + (surface-heat-inc float) + (jump-heat-inc float) + (lavatube-hotcoals-heat-inc float) + (lavatube-lava-heat-inc float) + (lavatube-lava-air-heat-inc float) + (lavatube-surface-heat-inc float) + (lavatube-jump-heat-inc float) + (boost-curve-max meters) + (boost-level-max meters) + (boost-level-inc meters) + (boost-duration seconds) + (default-front-blade degrees) + (yellow-projectile-speed meters) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) ;; definition for method 3 of type racer-bank -(defmethod inspect racer-bank ((this racer-bank)) +(defmethod inspect ((this racer-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tslide-hold-time: (seconds ~e)~%" (-> this slide-hold-time)) (format #t "~Theat-max: ~f~%" (-> this heat-max)) diff --git a/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc index e7a8ba973d7..ab220ae2132 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc @@ -89,7 +89,7 @@ ;; definition for function racer-on-ground? (defbehavior racer-on-ground? racer () - (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) + (logtest? (-> self root status) (cshape-moving-flags onsurf)) ) ;; definition for function racer-calc-gravity @@ -293,10 +293,7 @@ ) (set! f0-13 (cond - ((and (not (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) - ) + ((and (not (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0))) (cpad-hold? (-> self control unknown-cpad-info00 number) square) ) (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) x) @@ -782,9 +779,7 @@ ) ) ) - (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) + (when (and (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)) (cpad-pressed? (-> self control unknown-cpad-info00 number) circle square) (time-elapsed? (-> self control unknown-dword82) (seconds 0.25)) (not (logtest? (-> self state-flags) (state-flags being-attacked dying))) @@ -801,7 +796,7 @@ (-> self entity) s5-4 gp-6 - (if (>= (-> self fact-info-target eco-level) (-> *FACT-bank* eco-level-max)) + (if (>= (-> self fact eco-level) (-> *FACT-bank* eco-level-max)) 152 136 ) diff --git a/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc b/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc index e8f9968c4c2..3d92f02ac08 100644 --- a/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc +++ b/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc @@ -3,19 +3,15 @@ ;; definition of type cave-trap (deftype cave-trap (process-drawable) - ((root-override collide-shape :offset 112) - (spider-count int32 :offset-assert 176) - (alt-actors (array entity-actor) :offset-assert 180) - (spawn-delay time-frame :offset-assert 184) - (last-spawn-time time-frame :offset-assert 192) - (debug-targ-pos vector :inline :offset-assert 208) + ((root collide-shape :override) + (spider-count int32) + (alt-actors (array entity-actor)) + (spawn-delay time-frame) + (last-spawn-time time-frame) + (debug-targ-pos vector :inline) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xe0 - :flag-assert #x15007000e0 (:methods - (cave-trap-method-20 (_type_) symbol 20) + (cave-trap-method-20 (_type_) symbol) ) (:states cave-trap-active @@ -25,7 +21,7 @@ ) ;; definition for method 3 of type cave-trap -(defmethod inspect cave-trap ((this cave-trap)) +(defmethod inspect ((this cave-trap)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -39,19 +35,15 @@ ;; definition of type spider-vent (deftype spider-vent (process-drawable) - ((last-spawn-time time-frame :offset-assert 176) + ((last-spawn-time time-frame) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states spider-vent-idle ) ) ;; definition for method 3 of type spider-vent -(defmethod inspect spider-vent ((this spider-vent)) +(defmethod inspect ((this spider-vent)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -84,7 +76,7 @@ ;; definition for method 11 of type spider-vent ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! spider-vent ((this spider-vent) (arg0 entity-actor)) +(defmethod init-from-entity! ((this spider-vent) (arg0 entity-actor)) (set! (-> this last-spawn-time) 0) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -113,16 +105,13 @@ ;; definition of type spawn-baby-spider-best (deftype spawn-baby-spider-best (structure) - ((index int32 :offset-assert 0) - (dist float :offset-assert 4) + ((index int32) + (dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type spawn-baby-spider-best -(defmethod inspect spawn-baby-spider-best ((this spawn-baby-spider-best)) +(defmethod inspect ((this spawn-baby-spider-best)) (format #t "[~8x] ~A~%" this 'spawn-baby-spider-best) (format #t "~Tindex: ~D~%" (-> this index)) (format #t "~Tdist: ~f~%" (-> this dist)) @@ -131,15 +120,12 @@ ;; definition of type spawn-baby-spider-work (deftype spawn-baby-spider-work (structure) - ((best spawn-baby-spider-best 4 :inline :offset-assert 0) + ((best spawn-baby-spider-best 4 :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type spawn-baby-spider-work -(defmethod inspect spawn-baby-spider-work ((this spawn-baby-spider-work)) +(defmethod inspect ((this spawn-baby-spider-work)) (format #t "[~8x] ~A~%" this 'spawn-baby-spider-work) (format #t "~Tbest[4] @ #x~X~%" (-> this best)) this @@ -147,7 +133,7 @@ ;; definition for method 20 of type cave-trap ;; INFO: Used lq/sq -(defmethod cave-trap-method-20 cave-trap ((this cave-trap)) +(defmethod cave-trap-method-20 ((this cave-trap)) (set-time! (-> this last-spawn-time)) (set! (-> this spawn-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.5))) (let ((s5-0 (new 'stack-no-clear 'spawn-baby-spider-work))) @@ -254,8 +240,8 @@ :trans (behavior () (when *target* (let* ((gp-0 (target-pos 0)) - (f0-0 (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) - (f1-1 (- (-> gp-0 y) (-> self root-override trans y))) + (f0-0 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) + (f1-1 (- (-> gp-0 y) (-> self root trans y))) ) (when (and (>= 61440.0 f1-1) (>= f1-1 -16384.0)) (when (>= 274432.0 f0-0) @@ -286,8 +272,8 @@ (cond (*target* (let* ((gp-0 (target-pos 0)) - (f0-0 (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) - (f1-1 (- (-> gp-0 y) (-> self root-override trans y))) + (f0-0 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) + (f1-1 (- (-> gp-0 y) (-> self root trans y))) ) (if (or (< 73728.0 f1-1) (< f1-1 -24576.0) (< 368640.0 f0-0)) (go cave-trap-give-up) @@ -320,7 +306,7 @@ ) ;; definition for method 7 of type cave-trap -(defmethod relocate cave-trap ((this cave-trap) (arg0 int)) +(defmethod relocate ((this cave-trap) (arg0 int)) (if (nonzero? (-> this alt-actors)) (&+! (-> this alt-actors) arg0) ) @@ -329,7 +315,7 @@ ;; definition for method 11 of type cave-trap ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cave-trap ((this cave-trap) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cave-trap) (arg0 entity-actor)) (set! (-> this spider-count) 0) (set! (-> this spawn-delay) 0) (set! (-> this last-spawn-time) 0) @@ -341,13 +327,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> this nav nearest-y-threshold) 409600.0) - (logclear! (-> this root-override nav-flags) (nav-flags navf0)) + (logclear! (-> this root nav-flags) (nav-flags navf0)) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((s4-1 (entity-actor-count arg0 'alt-actor))) diff --git a/test/decompiler/reference/jak1/levels/robocave/robocave-part_REF.gc b/test/decompiler/reference/jak1/levels/robocave/robocave-part_REF.gc index a0fb29d9841..f6531f6fbb7 100644 --- a/test/decompiler/reference/jak1/levels/robocave/robocave-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/robocave/robocave-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type robocave-part (deftype robocave-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type robocave-part -(defmethod inspect robocave-part ((this robocave-part)) +(defmethod inspect ((this robocave-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/robocave/spider-egg_REF.gc b/test/decompiler/reference/jak1/levels/robocave/spider-egg_REF.gc index 035f056760a..283643d4402 100644 --- a/test/decompiler/reference/jak1/levels/robocave/spider-egg_REF.gc +++ b/test/decompiler/reference/jak1/levels/robocave/spider-egg_REF.gc @@ -3,14 +3,10 @@ ;; definition of type spider-egg (deftype spider-egg (process-drawable) - ((root-override collide-shape-moving :offset 112) - (notify-actor entity-actor :offset-assert 176) - (broken-look lod-set :inline :offset-assert 180) + ((root collide-shape-moving :override) + (notify-actor entity-actor) + (broken-look lod-set :inline) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd5 - :flag-assert #x14007000d5 (:states spider-egg-die spider-egg-hatch @@ -19,7 +15,7 @@ ) ;; definition for method 3 of type spider-egg -(defmethod inspect spider-egg ((this spider-egg)) +(defmethod inspect ((this spider-egg)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -52,14 +48,7 @@ (local-vars (v0-0 object)) (case message (('touch) - (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> block param 0)) - 0.7 - 6144.0 - 16384.0 - ) + (send-shove-back (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) ) (('can-spawn?) (return #t) @@ -131,7 +120,7 @@ :code (behavior () (cleanup-for-death self) (logclear! (-> self mask) (process-mask actor-pause)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (process-spawn part-tracker :init part-tracker-init @@ -140,7 +129,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) @@ -198,12 +187,12 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (lods-assign! (-> self draw) (-> self broken-look)) (ja-channel-push! 1 (seconds 0.1)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :group! spider-egg-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -220,7 +209,7 @@ ;; definition for method 11 of type spider-egg ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! spider-egg ((this spider-egg) (arg0 entity-actor)) +(defmethod init-from-entity! ((this spider-egg) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (logior! (-> this mask) (process-mask attackable)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -239,31 +228,31 @@ ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *spider-egg-unbroken-sg* '()) (setup-lods! (-> this broken-look) *spider-egg-broken-sg* (-> this draw art-group) (-> this entity)) - (set-vector! (-> this root-override scale) 0.4 0.4 0.4 1.0) - (if (not (move-to-ground (-> this root-override) 12288.0 40960.0 #t (collide-kind background))) + (set-vector! (-> this root scale) 0.4 0.4 0.4 1.0) + (if (not (move-to-ground (-> this root) 12288.0 40960.0 #t (collide-kind background))) (go process-drawable-art-error "no ground") ) - (+! (-> this root-override trans y) -409.6) + (+! (-> this root trans y) -409.6) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> this root-override surface-normal quad)) + (set! (-> s4-1 quad) (-> this root surface-normal quad)) (+! (-> s4-1 x) (rand-vu-float-range -0.2 0.2)) (+! (-> s4-1 z) (rand-vu-float-range -0.2 0.2)) (vector-normalize! s4-1 1.0) (quaternion-axis-angle! - (-> this root-override quat) + (-> this root quat) (-> s4-1 x) (-> s4-1 y) (-> s4-1 z) (rand-vu-float-range 0.0 65536.0) ) ) - (update-transforms! (-> this root-override)) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (update-transforms! (-> this root)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (if (> (entity-actor-count arg0 'alt-actor) 0) (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> this notify-actor) #f) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc index 46430b75d6c..9b3dbd6b6c3 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc @@ -124,33 +124,30 @@ ;; definition of type fleeing-nav-enemy-info (deftype fleeing-nav-enemy-info (structure) - ((min-reflect-angle float :offset-assert 0) - (max-reflect-angle float :offset-assert 4) - (max-boundary-deflection float :offset-assert 8) - (deflection-min-dist float :offset-assert 12) - (deflection-max-dist float :offset-assert 16) - (reflection-time int32 :offset-assert 20) - (travel-rotate-speed float :offset-assert 24) - (blend_interp_angle float :offset-assert 28) - (min-speed-adjust float :offset-assert 32) - (max-speed-adjust float :offset-assert 36) - (speed-adjust-center float :offset-assert 40) - (speed-adjust-range float :offset-assert 44) - (abort-notice-distance float :offset-assert 48) - (min-notice-dist float :offset-assert 52) - (max-notice-dist float :offset-assert 56) - (min-stop-chase-dist float :offset-assert 60) - (max-stop-chase-dist float :offset-assert 64) - (max-flee-rotation float :offset-assert 68) + ((min-reflect-angle float) + (max-reflect-angle float) + (max-boundary-deflection float) + (deflection-min-dist float) + (deflection-max-dist float) + (reflection-time int32) + (travel-rotate-speed float) + (blend_interp_angle float) + (min-speed-adjust float) + (max-speed-adjust float) + (speed-adjust-center float) + (speed-adjust-range float) + (abort-notice-distance float) + (min-notice-dist float) + (max-notice-dist float) + (min-stop-chase-dist float) + (max-stop-chase-dist float) + (max-flee-rotation float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) ;; definition for method 3 of type fleeing-nav-enemy-info -(defmethod inspect fleeing-nav-enemy-info ((this fleeing-nav-enemy-info)) +(defmethod inspect ((this fleeing-nav-enemy-info)) (format #t "[~8x] ~A~%" this 'fleeing-nav-enemy-info) (format #t "~Tmin-reflect-angle: ~f~%" (-> this min-reflect-angle)) (format #t "~Tmax-reflect-angle: ~f~%" (-> this max-reflect-angle)) @@ -175,24 +172,20 @@ ;; definition of type fleeing-nav-enemy (deftype fleeing-nav-enemy (nav-enemy) - ((last-reflection-time time-frame :offset-assert 400) - (run-blend-interp float :offset-assert 408) - (desired-travel vector :inline :offset-assert 416) - (saved-travel vector :inline :offset-assert 432) - (speed-adjust float :offset-assert 448) - (flee-info fleeing-nav-enemy-info :inline :offset-assert 452) + ((last-reflection-time time-frame) + (run-blend-interp float) + (desired-travel vector :inline) + (saved-travel vector :inline) + (speed-adjust float) + (flee-info fleeing-nav-enemy-info :inline) ) - :heap-base #x1a0 - :method-count-assert 76 - :size-assert #x20c - :flag-assert #x4c01a0020c (:states fleeing-nav-enemy-debug ) ) ;; definition for method 3 of type fleeing-nav-enemy -(defmethod inspect fleeing-nav-enemy ((this fleeing-nav-enemy)) +(defmethod inspect ((this fleeing-nav-enemy)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -543,13 +536,9 @@ ;; definition of type lightning-mole (deftype lightning-mole (fleeing-nav-enemy) - ((debug-vector vector :inline :offset-assert 528) - (alt-actor entity-actor :offset-assert 544) + ((debug-vector vector :inline) + (alt-actor entity-actor) ) - :heap-base #x1c0 - :method-count-assert 76 - :size-assert #x224 - :flag-assert #x4c01c00224 (:states lightning-mole-debug-blend lightning-mole-debug-run @@ -562,7 +551,7 @@ ) ;; definition for method 3 of type lightning-mole -(defmethod inspect lightning-mole ((this lightning-mole)) +(defmethod inspect ((this lightning-mole)) (let ((t9-0 (method-of-type fleeing-nav-enemy inspect))) (t9-0 this) ) @@ -937,7 +926,7 @@ ;; definition for method 43 of type lightning-mole ;; INFO: Return type mismatch symbol vs object. -(defmethod attack-handler lightning-mole ((this lightning-mole) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler ((this lightning-mole) (arg0 process) (arg1 event-message-block)) (send-event arg0 'get-attack-count 1) (when (!= (-> this state) lightning-mole-yelp) (send-event arg0 'jump 32768.0 32768.0) @@ -948,7 +937,7 @@ ;; definition for method 44 of type lightning-mole ;; INFO: Return type mismatch symbol vs object. -(defmethod touch-handler lightning-mole ((this lightning-mole) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this lightning-mole) (arg0 process) (arg1 event-message-block)) (when (!= (-> this state) lightning-mole-yelp) (send-event arg0 'jump 32768.0 32768.0) (go lightning-mole-yelp) @@ -1012,7 +1001,7 @@ ;; definition for method 11 of type lightning-mole ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lightning-mole ((this lightning-mole) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lightning-mole) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -1239,10 +1228,6 @@ ;; definition of type peeper (deftype peeper (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states peeper-down peeper-hide @@ -1252,7 +1237,7 @@ ) ;; definition for method 3 of type peeper -(defmethod inspect peeper ((this peeper)) +(defmethod inspect ((this peeper)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1392,7 +1377,7 @@ ;; definition for method 11 of type peeper ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! peeper ((this peeper) (arg0 entity-actor)) +(defmethod init-from-entity! ((this peeper) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *lightning-mole-sg* '()) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc index 5e131fc39c5..331e41d74e9 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc @@ -3,16 +3,11 @@ ;; definition of type rolling-part (deftype rolling-part (part-spawner) - ((root-override basic :offset 112) - ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 + () ) ;; definition for method 3 of type rolling-part -(defmethod inspect rolling-part ((this rolling-part)) +(defmethod inspect ((this rolling-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) @@ -22,13 +17,10 @@ ;; definition of type rollingcam (deftype rollingcam (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) ;; definition for method 3 of type rollingcam -(defmethod inspect rollingcam ((this rollingcam)) +(defmethod inspect ((this rollingcam)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -67,17 +59,13 @@ ;; definition of type pusher-base (deftype pusher-base (process-drawable) - ((root-override collide-shape-moving :offset 112) - (max-frame float :offset-assert 176) + ((root collide-shape-moving :override) + (max-frame float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 ) ;; definition for method 3 of type pusher-base -(defmethod inspect pusher-base ((this pusher-base)) +(defmethod inspect ((this pusher-base)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -87,20 +75,16 @@ ;; definition of type pusher (deftype pusher (pusher-base) - ((sync sync-info-paused :inline :offset-assert 180) - (cyl cylinder :inline :offset-assert 208) + ((sync sync-info-paused :inline) + (cyl cylinder :inline) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #xf8 - :flag-assert #x14009000f8 (:states pusher-idle ) ) ;; definition for method 3 of type pusher -(defmethod inspect pusher ((this pusher)) +(defmethod inspect ((this pusher)) (let ((t9-0 (method-of-type pusher-base inspect))) (t9-0 this) ) @@ -111,19 +95,15 @@ ;; definition of type gorge-pusher (deftype gorge-pusher (pusher-base) - ((min-frame float :offset-assert 180) + ((min-frame float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states gorge-pusher-idle ) ) ;; definition for method 3 of type gorge-pusher -(defmethod inspect gorge-pusher ((this gorge-pusher)) +(defmethod inspect ((this gorge-pusher)) (let ((t9-0 (method-of-type pusher-base inspect))) (t9-0 this) ) @@ -165,7 +145,7 @@ ) (set! (-> gp-0 nav-radius) (* 0.75 (-> gp-0 root-prim local-sphere w))) (backup-collide-with-as gp-0) - (set! (-> self root-override) gp-0) + (set! (-> self root) gp-0) gp-0 ) ) @@ -196,14 +176,14 @@ ;; definition for method 11 of type pusher ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! pusher ((this pusher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pusher) (arg0 entity-actor)) (pusher-base-init) (process-drawable-from-entity! this arg0) (initialize-skeleton this *pusher-sg* '()) (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) (set! (-> this max-frame) (res-lump-float arg0 'max-frame :default (the float (ja-num-frames 0)))) - (set! (-> this cyl origin quad) (-> this root-override trans quad)) - (vector-x-quaternion! (-> this cyl axis) (-> this root-override quat)) + (set! (-> this cyl origin quad) (-> this root trans quad)) + (vector-x-quaternion! (-> this cyl axis) (-> this root quat)) (vector-negate! (-> this cyl axis) (-> this cyl axis)) (set! (-> this cyl length) 36864.0) (set! (-> this cyl radius) 20480.0) @@ -228,7 +208,7 @@ ;; definition for method 11 of type gorge-pusher ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! gorge-pusher ((this gorge-pusher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gorge-pusher) (arg0 entity-actor)) (pusher-base-init) (process-drawable-from-entity! this arg0) (initialize-skeleton this *pusher-sg* '()) @@ -256,13 +236,9 @@ ;; definition of type dark-plant (deftype dark-plant (process-drawable) - ((num-alts int32 :offset-assert 176) - (alts entity-actor 4 :offset-assert 180) + ((num-alts int32) + (alts entity-actor 4) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xc4 - :flag-assert #x14006000c4 (:states dark-plant-death dark-plant-gone @@ -273,7 +249,7 @@ ) ;; definition for method 3 of type dark-plant -(defmethod inspect dark-plant ((this dark-plant)) +(defmethod inspect ((this dark-plant)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -546,7 +522,7 @@ ;; definition for method 11 of type dark-plant ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! dark-plant ((this dark-plant) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dark-plant) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *dark-plant-sg* '()) @@ -572,13 +548,9 @@ ;; definition of type happy-plant (deftype happy-plant (process-drawable) - ((root-override collide-shape :offset 112) - (alt-actor entity-actor :offset-assert 176) + ((root collide-shape :override) + (alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states happy-plant-init happy-plant-opened @@ -587,7 +559,7 @@ ) ;; definition for method 3 of type happy-plant -(defmethod inspect happy-plant ((this happy-plant)) +(defmethod inspect ((this happy-plant)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -628,7 +600,7 @@ (close-specific-task! (game-task rolling-plants) (task-status need-reminder)) (process-entity-status! self (entity-perm-status bit-3) #t) (logclear! (-> self mask) (process-mask actor-pause)) - (while (and *target* (< (vector-vector-distance (-> self root-override trans) (target-pos 0)) 24576.0)) + (while (and *target* (< (vector-vector-distance (-> self root trans) (target-pos 0)) 24576.0)) (suspend) ) (let ((gp-2 @@ -680,7 +652,7 @@ ) ) ) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (go happy-plant-opened) ) :post transform-post @@ -706,7 +678,7 @@ ) ) :code (behavior () - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -720,7 +692,7 @@ ;; definition for method 11 of type happy-plant ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! happy-plant ((this happy-plant) (arg0 entity-actor)) +(defmethod init-from-entity! ((this happy-plant) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -733,7 +705,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *happy-plant-sg* '()) @@ -767,16 +739,13 @@ ;; definition of type race-time (deftype race-time (structure) - ((digit int8 5 :offset-assert 0) + ((digit int8 5) ) :pack-me - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type race-time -(defmethod inspect race-time ((this race-time)) +(defmethod inspect ((this race-time)) (format #t "[~8x] ~A~%" this 'race-time) (format #t "~Tdigit[5] @ #x~X~%" (-> this digit)) this @@ -892,13 +861,9 @@ ;; definition of type rolling-start (deftype rolling-start (process-drawable) - ((whole-look lod-set :inline :offset-assert 176) - (broken-look lod-set :inline :offset-assert 212) + ((whole-look lod-set :inline) + (broken-look lod-set :inline) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #xf5 - :flag-assert #x14009000f5 (:states (rolling-start-break symbol) rolling-start-whole @@ -906,7 +871,7 @@ ) ;; definition for method 3 of type rolling-start -(defmethod inspect rolling-start ((this rolling-start)) +(defmethod inspect ((this rolling-start)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -995,19 +960,15 @@ ;; definition of type gorge (deftype gorge (process-drawable) - ((root-override collide-shape-moving :offset 112) - (coord matrix :inline :offset-assert 176) - (radius float :offset-assert 240) - (thickness float :offset-assert 244) + ((root collide-shape-moving :override) + (coord matrix :inline) + (radius float) + (thickness float) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #xf8 - :flag-assert #x14009000f8 ) ;; definition for method 3 of type gorge -(defmethod inspect gorge ((this gorge)) +(defmethod inspect ((this gorge)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1032,18 +993,14 @@ ;; definition of type gorge-start (deftype gorge-start (gorge) - ((tasks task-control :offset-assert 248) - (record-time race-time :inline :offset-assert 252) - (this-time race-time :inline :offset-assert 257) - (start-banner handle :offset-assert 264) - (end-banner handle :offset-assert 272) - (timer-pos-offset int32 :offset-assert 280) - (ticker ticky :inline :offset-assert 288) + ((tasks task-control) + (record-time race-time :inline) + (this-time race-time :inline) + (start-banner handle) + (end-banner handle) + (timer-pos-offset int32) + (ticker ticky :inline) ) - :heap-base #xd0 - :method-count-assert 20 - :size-assert #x140 - :flag-assert #x1400d00140 (:states gorge-start-idle gorge-start-race-aborted @@ -1054,7 +1011,7 @@ ) ;; definition for method 3 of type gorge-start -(defmethod inspect gorge-start ((this gorge-start)) +(defmethod inspect ((this gorge-start)) (let ((t9-0 (method-of-type gorge inspect))) (t9-0 this) ) @@ -1070,19 +1027,15 @@ ;; definition of type gorge-finish (deftype gorge-finish (gorge) - ((alt-actor entity-actor :offset-assert 248) + ((alt-actor entity-actor) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #xfc - :flag-assert #x14009000fc (:states gorge-finish-idle ) ) ;; definition for method 3 of type gorge-finish -(defmethod inspect gorge-finish ((this gorge-finish)) +(defmethod inspect ((this gorge-finish)) (let ((t9-0 (method-of-type gorge inspect))) (t9-0 this) ) @@ -1093,17 +1046,13 @@ ;; definition of type gorge-abort (deftype gorge-abort (gorge) () - :heap-base #x90 - :method-count-assert 20 - :size-assert #xf8 - :flag-assert #x14009000f8 (:states gorge-abort-idle ) ) ;; definition for method 3 of type gorge-abort -(defmethod inspect gorge-abort ((this gorge-abort)) +(defmethod inspect ((this gorge-abort)) (let ((t9-0 (method-of-type gorge inspect))) (t9-0 this) ) @@ -1166,8 +1115,8 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. (defbehavior gorge-abort-init-by-other gorge-abort ((arg0 vector) (arg1 vector) (arg2 float)) - (set! (-> self root-override) (the-as collide-shape-moving (new 'process 'trsqv))) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root) (the-as collide-shape-moving (new 'process 'trsqv))) + (set! (-> self root trans quad) (-> arg0 quad)) (gorge-init arg0 arg1 arg2 8192.0) (go gorge-abort-idle) (none) @@ -1190,8 +1139,8 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. (defbehavior gorge-finish-init-by-other gorge-finish ((arg0 vector) (arg1 vector) (arg2 float)) - (set! (-> self root-override) (the-as collide-shape-moving (new 'process 'trsqv))) - (set! (-> self root-override trans quad) (-> arg0 quad)) + (set! (-> self root) (the-as collide-shape-moving (new 'process 'trsqv))) + (set! (-> self root trans quad) (-> arg0 quad)) (gorge-init arg0 arg1 arg2 20480.0) (go gorge-finish-idle) (none) @@ -1327,7 +1276,7 @@ (the-as handle (when (task-closed? (game-task rolling-race) (task-status need-introduction)) (when (not (handle->process (-> self start-banner))) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (let ((v0-1 (ppointer->handle (process-spawn rolling-start gp-0 0.0 :to self)))) (set! (-> self start-banner) (the-as handle v0-1)) v0-1 @@ -1561,11 +1510,11 @@ ;; definition for method 11 of type gorge-start ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! gorge-start ((this gorge-start) (arg0 entity-actor)) - (set! (-> this root-override) (the-as collide-shape-moving (new 'process 'trsqv))) +(defmethod init-from-entity! ((this gorge-start) (arg0 entity-actor)) + (set! (-> this root) (the-as collide-shape-moving (new 'process 'trsqv))) (process-drawable-from-entity! this arg0) (let ((a0-3 (new 'stack-no-clear 'vector))) - (set! (-> a0-3 quad) (-> this root-override trans quad)) + (set! (-> a0-3 quad) (-> this root trans quad)) (+! (-> a0-3 y) -8192.0) (gorge-init a0-3 (new 'static 'vector :z 1.0) 102400.0 40960.0) ) @@ -1580,14 +1529,10 @@ ;; definition of type rolling-water (deftype rolling-water (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) ;; definition for method 3 of type rolling-water -(defmethod inspect rolling-water ((this rolling-water)) +(defmethod inspect ((this rolling-water)) (let ((t9-0 (method-of-type water-anim inspect))) (t9-0 this) ) @@ -1612,7 +1557,7 @@ ;; definition for method 22 of type rolling-water ;; INFO: Return type mismatch water-flags vs none. -(defmethod water-vol-method-22 rolling-water ((this rolling-water)) +(defmethod water-vol-method-22 ((this rolling-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc index 01a06f1b19b..eb7d780e97f 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc @@ -3,20 +3,16 @@ ;; definition of type race-ring (deftype race-ring (process-drawable) - ((rot-y float :offset-assert 176) - (face-vec vector :inline :offset-assert 192) - (part-track handle :offset-assert 208) - (keep-part-track-alive symbol :offset-assert 216) - (timeout time-frame :offset-assert 224) - (alt-actor entity-actor :offset-assert 232) - (alt-task uint8 :offset-assert 236) - (cyl cylinder-flat :inline :offset-assert 240) - (old-hips vector :inline :offset-assert 288) + ((rot-y float) + (face-vec vector :inline) + (part-track handle) + (keep-part-track-alive symbol) + (timeout time-frame) + (alt-actor entity-actor) + (alt-task uint8) + (cyl cylinder-flat :inline) + (old-hips vector :inline) ) - :heap-base #xc0 - :method-count-assert 20 - :size-assert #x130 - :flag-assert #x1400c00130 (:states race-ring-active race-ring-idle @@ -25,7 +21,7 @@ ) ;; definition for method 3 of type race-ring -(defmethod inspect race-ring ((this race-ring)) +(defmethod inspect ((this race-ring)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -990,7 +986,7 @@ ;; definition for method 11 of type race-ring ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! race-ring ((this race-ring) (arg0 entity-actor)) +(defmethod init-from-entity! ((this race-ring) (arg0 entity-actor)) (let ((a0-1 arg0)) (if (not (entity-actor-lookup a0-1 'next-actor 0)) (stack-size-set! (-> this main-thread) 512) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc index 9bfe7cb0603..16cf292ad01 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc @@ -35,14 +35,14 @@ (set! arg1 (+ 1.0 arg1)) ) ) - (eval-path-curve! (-> self path) (-> self root-override trans) arg1 'interp) - (+! (-> self root-override trans y) 8192.0) - (set! (-> self root-override trans y) (fmax 106496.0 (-> self root-override trans y))) - (set! (-> self base quad) (-> self root-override trans quad)) + (eval-path-curve! (-> self path) (-> self root trans) arg1 'interp) + (+! (-> self root trans y) 8192.0) + (set! (-> self root trans y) (fmax 106496.0 (-> self root trans y))) + (set! (-> self base quad) (-> self root trans quad)) (transform-post) (animate self) (let ((s4-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 (-> self root-override trans) *camera-other-trans*) + (vector-! s4-0 (-> self root trans) *camera-other-trans*) (vector-normalize! s4-0 1.0) (forward-down->inv-matrix *camera-other-matrix* s4-0 (new 'static 'vector :y -1.0 :w 1.0)) ) @@ -72,26 +72,22 @@ ;; definition of type robber (deftype robber (process-drawable) - ((root-override collide-shape-moving :offset 112) - (curve-position float :offset-assert 176) - (speed float :offset-assert 180) - (facing vector :inline :offset-assert 192) - (tangent vector :inline :offset-assert 208) - (run-blend-interp float :offset-assert 224) - (near-timer int32 :offset-assert 228) - (far-time time-frame :offset-assert 232) - (y-offset float :offset-assert 240) - (y-offset-desired float :offset-assert 244) - (y-vel float :offset-assert 248) - (water-height float :offset-assert 252) - (timeout time-frame :offset-assert 256) - (last-ambient-time time-frame :offset-assert 264) - (time-to-next-ambient time-frame :offset-assert 272) + ((root collide-shape-moving :override) + (curve-position float) + (speed float) + (facing vector :inline) + (tangent vector :inline) + (run-blend-interp float) + (near-timer int32) + (far-time time-frame) + (y-offset float) + (y-offset-desired float) + (y-vel float) + (water-height float) + (timeout time-frame) + (last-ambient-time time-frame) + (time-to-next-ambient time-frame) ) - :heap-base #xb0 - :method-count-assert 20 - :size-assert #x118 - :flag-assert #x1400b00118 (:states robber-dead robber-debug @@ -106,7 +102,7 @@ ) ;; definition for method 3 of type robber -(defmethod inspect robber ((this robber)) +(defmethod inspect ((this robber)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -166,7 +162,7 @@ ;; INFO: Used lq/sq (defbehavior robber-find-ground robber () (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result))) (+! (-> gp-0 y) 8192.0) (let ((f0-2 (fill-and-probe-using-line-sphere @@ -182,12 +178,12 @@ ) (v1-5 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-5 quad) (-> self root-override trans quad)) + (set! (-> v1-5 quad) (-> self root trans quad)) (set! (-> v1-5 y) (+ (-> gp-0 y) (* -81920.0 f0-2))) (cond ((and (>= f0-2 0.0) (< 204.8 (fabs (- (-> v1-5 y) (-> self water-height))))) (set! (-> self y-offset-desired) - (- (+ (-> gp-0 y) (* -81920.0 f0-2)) (- (-> self root-override trans y) (-> self y-offset))) + (- (+ (-> gp-0 y) (* -81920.0 f0-2)) (- (-> self root trans y) (-> self y-offset))) ) #t ) @@ -210,7 +206,7 @@ (path-control-method-14 (-> self path) (-> self tangent) (-> self curve-position)) (cond ((and arg0 *target*) - (vector-! gp-0 (-> self root-override trans) (target-pos 0)) + (vector-! gp-0 (-> self root trans) (target-pos 0)) (vector-normalize! gp-0 1.0) ) ((< (-> self speed) 0.0) @@ -224,7 +220,7 @@ (vector-matrix*! gp-0 (-> self facing) s5-0) (vector-normalize! gp-0 1.0) (forward-down->inv-matrix s5-0 gp-0 (new 'static 'vector :y -1.0)) - (matrix->quaternion (-> self root-override quat) s5-0) + (matrix->quaternion (-> self root quat) s5-0) (set! (-> self run-blend-interp) (acos (vector-dot gp-0 (-> self facing)))) (set! (-> self run-blend-interp) (* 0.0002746582 (-> self run-blend-interp))) (if (< (vector-dot (-> self facing) (the-as vector (-> s5-0 vector))) 0.0) @@ -252,7 +248,7 @@ (+! (-> self curve-position) 1.0) ) ) - (eval-path-curve! (-> self path) (-> self root-override trans) (-> self curve-position) 'interp) + (eval-path-curve! (-> self path) (-> self root trans) (-> self curve-position) 'interp) (cond ((< (-> self y-offset-desired) (-> self y-offset)) (set! (-> self y-vel) (* 0.25 (- (-> self y-offset-desired) (-> self y-offset)))) @@ -273,12 +269,12 @@ ) ) ) - (set! (-> self root-override trans y) (+ (-> self root-override trans y) (-> self y-offset))) + (set! (-> self root trans y) (+ (-> self root trans y) (-> self y-offset))) ) ;; definition for function robber-calc-speed (defbehavior robber-calc-speed robber ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 symbol)) - (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root-override trans) (target-pos 0)))) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (target-pos 0)))) (set! (-> gp-1 y) 0.0) (let* ((f2-1 (/ (- (vector-length gp-1) arg0) (- arg1 arg0))) (f0-4 (- 1.0 (fmax 0.0 (fmin 1.0 f2-1)))) @@ -334,7 +330,7 @@ (+! (-> self curve-position) 1.0) ) ) - (eval-path-curve! (-> self path) (-> self root-override trans) (-> self curve-position) 'interp) + (eval-path-curve! (-> self path) (-> self root trans) (-> self curve-position) 'interp) (robber-rotate (the-as target #f) 1820.4445) (robber-find-ground) (suspend) @@ -424,17 +420,13 @@ (defstate robber-got-away (robber) :event robber-event-handler :trans (behavior () - (if (and (not (and *target* - (>= 204800.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and (not (and *target* (>= 204800.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) ) (robber-find-ground) ) (go robber-idle) ) - (if (and *target* - (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* (>= 122880.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go robber-flee) ) ) @@ -466,9 +458,7 @@ (set! (-> self y-offset-desired) 0.0) ) :trans (behavior () - (if (not (and *target* - (>= 163840.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (not (and *target* (>= 163840.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) ) (go robber-got-away) ) @@ -520,15 +510,11 @@ (set! (-> self y-offset-desired) 0.0) ) :trans (behavior () - (if (not (and *target* - (>= 163840.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (not (and *target* (>= 163840.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) ) (go robber-got-away) ) - (when (and *target* - (>= 102400.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (when (and *target* (>= 102400.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (set! (-> self near-timer) (- (the-as time-frame (-> self near-timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) @@ -586,9 +572,7 @@ (set! (-> self speed) 0.0) ) :trans (behavior () - (if (and *target* - (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* (>= 122880.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go robber-flee) ) (robber-rotate (the-as target #t) 182.04445) @@ -612,21 +596,17 @@ :event robber-event-handler :trans (behavior () (when (logtest? (-> self draw status) (draw-status was-drawn)) - (if (and *target* - (>= 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* (>= 163840.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id rolling-robbers-hint) "sksp0116" (the-as entity #f) *entity-pool* (game-task none)) ) ) - (if (and *target* - (>= 32768.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* (>= 32768.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go robber-flee) ) ) :code (behavior () (path-control-method-14 (-> self path) (-> self tangent) (-> self curve-position)) - (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root-override trans) (target-pos 0))) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (target-pos 0))) (f0-1 6.826667) ) (set! (-> gp-1 y) 0.0) @@ -657,9 +637,7 @@ (set! (-> self speed) 0.0) ) :trans (behavior () - (if (and *target* - (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* (>= 122880.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (go robber-initial-notice) ) (robber-move) @@ -680,7 +658,7 @@ ;; definition for method 11 of type robber ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! robber ((this robber) (arg0 entity-actor)) +(defmethod init-from-entity! ((this robber) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -698,11 +676,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *robber-sg* '()) - (set! (-> this root-override pause-adjust-distance) 122880.0) + (set! (-> this root pause-adjust-distance) 122880.0) (set! (-> this link) (new 'process 'actor-link-info this)) (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) @@ -711,12 +689,12 @@ ) (set! (-> this draw origin-joint-index) (the-as uint 3)) (set! (-> this curve-position) (res-lump-float (-> this entity) 'initial-spline-pos)) - (eval-path-curve! (-> this path) (-> this root-override trans) (-> this curve-position) 'interp) + (eval-path-curve! (-> this path) (-> this root trans) (-> this curve-position) 'interp) (path-control-method-14 (-> this path) (-> this tangent) (-> this curve-position)) (set! (-> this facing quad) (-> this tangent quad)) (let ((s4-1 (new 'stack-no-clear 'matrix))) (forward-down->inv-matrix s4-1 (-> this facing) (new 'static 'vector :y -1.0)) - (matrix->quaternion (-> this root-override quat) s4-1) + (matrix->quaternion (-> this root quat) s4-1) ) (set! (-> this y-vel) 0.0) (set! (-> this water-height) (res-lump-float (-> this entity) 'water-height)) diff --git a/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc b/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc index b78489b0956..8d9adccad7a 100644 --- a/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc @@ -9,30 +9,26 @@ ;; definition of type ice-cube (deftype ice-cube (nav-enemy) - ((part2 sparticle-launch-control :offset-assert 400) - (part3 sparticle-launch-control :offset-assert 404) - (part4 sparticle-launch-control :offset-assert 408) - (track-target? symbol :offset-assert 412) - (slow-down? symbol :offset-assert 416) - (tracking-player? symbol :offset-assert 420) - (force-spawn-pt int32 :offset-assert 424) - (speed float :offset-assert 428) - (anim-blend float :offset-assert 432) - (prev-charge-angle-diff float :offset-assert 436) - (charge-angle float :offset-assert 440) - (ground-y float :offset-assert 444) - (cprims-type uint64 :offset-assert 448) - (next-skid-sound-time time-frame :offset-assert 456) - (starting-pos vector :inline :offset-assert 464) - (target-pt vector :inline :offset-assert 480) + ((part2 sparticle-launch-control) + (part3 sparticle-launch-control) + (part4 sparticle-launch-control) + (track-target? symbol) + (slow-down? symbol) + (tracking-player? symbol) + (force-spawn-pt int32) + (speed float) + (anim-blend float) + (prev-charge-angle-diff float) + (charge-angle float) + (ground-y float) + (cprims-type uint64) + (next-skid-sound-time time-frame) + (starting-pos vector :inline) + (target-pt vector :inline) ) - :heap-base #x180 - :method-count-assert 76 - :size-assert #x1f0 - :flag-assert #x4c018001f0 (:methods - (ice-cube-method-51 (_type_ vector vector) symbol :replace 51) - (ice-cube-method-53 (_type_ vector vector) symbol :replace 53) + (ice-cube-method-51 (_type_ vector vector) symbol :overlay-at nav-enemy-method-51) + (ice-cube-method-53 (_type_ vector vector) symbol :overlay-at nav-enemy-method-53) ) (:states ice-cube-appear @@ -50,7 +46,7 @@ ) ;; definition for method 3 of type ice-cube -(defmethod inspect ice-cube ((this ice-cube)) +(defmethod inspect ((this ice-cube)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -499,7 +495,7 @@ ;; definition for method 47 of type ice-cube ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision ice-cube ((this ice-cube)) +(defmethod initialize-collision ((this ice-cube)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -568,7 +564,7 @@ ;; definition for method 57 of type ice-cube ;; INFO: Return type mismatch vector vs none. -(defmethod nav-enemy-method-57 ice-cube ((this ice-cube)) +(defmethod nav-enemy-method-57 ((this ice-cube)) (when (!= (-> this cprims-type) 1) (set! (-> this cprims-type) (the-as uint 1)) (let ((v1-3 (-> this collide-info root-prim))) @@ -582,7 +578,7 @@ ;; definition for method 58 of type ice-cube ;; INFO: Return type mismatch vector vs none. -(defmethod nav-enemy-method-58 ice-cube ((this ice-cube)) +(defmethod nav-enemy-method-58 ((this ice-cube)) (when (!= (-> this cprims-type) 2) (set! (-> this cprims-type) (the-as uint 2)) (let ((v1-3 (-> this collide-info root-prim))) @@ -596,7 +592,7 @@ ;; definition for method 48 of type ice-cube ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 ice-cube ((this ice-cube)) +(defmethod nav-enemy-method-48 ((this ice-cube)) (process-drawable-from-entity! this (-> this entity)) (initialize-skeleton this *ice-cube-sg* '()) (init-defaults! this *ice-cube-nav-enemy-info*) @@ -608,7 +604,7 @@ ) ;; definition for method 10 of type ice-cube -(defmethod deactivate ice-cube ((this ice-cube)) +(defmethod deactivate ((this ice-cube)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -623,7 +619,7 @@ ) ;; definition for method 7 of type ice-cube -(defmethod relocate ice-cube ((this ice-cube) (arg0 int)) +(defmethod relocate ((this ice-cube) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -638,7 +634,7 @@ ;; definition for method 11 of type ice-cube ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ice-cube ((this ice-cube) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ice-cube) (arg0 entity-actor)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 507) this)) (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 508) this)) (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 509) this)) @@ -662,7 +658,7 @@ ;; definition for method 60 of type ice-cube ;; INFO: Used lq/sq -(defmethod nav-enemy-method-60 ice-cube ((this ice-cube) (arg0 symbol)) +(defmethod nav-enemy-method-60 ((this ice-cube) (arg0 symbol)) (let ((gp-0 (new 'stack-no-clear 'vector))) (when (-> this tracking-player?) (if (and *target* arg0) @@ -683,7 +679,7 @@ ;; definition for method 51 of type ice-cube ;; INFO: Used lq/sq -(defmethod ice-cube-method-51 ice-cube ((this ice-cube) (arg0 vector) (arg1 vector)) +(defmethod ice-cube-method-51 ((this ice-cube) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let* ((s4-0 (new 'stack-no-clear 'collide-tri-result)) (f0-0 40960.0) @@ -715,7 +711,7 @@ ;; definition for method 52 of type ice-cube ;; INFO: Used lq/sq -(defmethod nav-enemy-method-52 ice-cube ((this ice-cube) (arg0 vector)) +(defmethod nav-enemy-method-52 ((this ice-cube) (arg0 vector)) (when *target* (let ((f0-0 (vector-vector-xz-distance arg0 (target-pos 0)))) (when (and (>= f0-0 40960.0) (>= 81920.0 f0-0) (not (nav-enemy-method-50 this arg0))) @@ -734,7 +730,7 @@ ;; definition for method 53 of type ice-cube ;; INFO: Used lq/sq -(defmethod ice-cube-method-53 ice-cube ((this ice-cube) (arg0 vector) (arg1 vector)) +(defmethod ice-cube-method-53 ((this ice-cube) (arg0 vector) (arg1 vector)) (local-vars (s1-0 int) (s2-0 int)) (let ((s3-0 (-> this path curve num-cverts))) (if (<= s3-0 0) @@ -1062,7 +1058,7 @@ ;; definition for method 54 of type ice-cube ;; INFO: Used lq/sq -(defmethod nav-enemy-method-54 ice-cube ((this ice-cube) (arg0 vector)) +(defmethod nav-enemy-method-54 ((this ice-cube) (arg0 vector)) (let* ((s4-0 (-> this path curve num-cverts)) (s2-0 (nav-enemy-rnd-int-count s4-0)) (s5-0 (new 'stack-no-clear 'vector)) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc index b0723cb1c73..35ef2667642 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc @@ -4,17 +4,13 @@ ;; definition of type snow-ball-shadow (deftype snow-ball-shadow (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states snow-ball-shadow-idle ) ) ;; definition for method 3 of type snow-ball-shadow -(defmethod inspect snow-ball-shadow ((this snow-ball-shadow)) +(defmethod inspect ((this snow-ball-shadow)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -23,16 +19,13 @@ ;; definition of type snow-ball-junction (deftype snow-ball-junction (structure) - ((enter-time time-frame :offset-assert 0) - (exit-time time-frame :offset-assert 8) + ((enter-time time-frame) + (exit-time time-frame) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type snow-ball-junction -(defmethod inspect snow-ball-junction ((this snow-ball-junction)) +(defmethod inspect ((this snow-ball-junction)) (format #t "[~8x] ~A~%" this 'snow-ball-junction) (format #t "~Tenter-time: ~D~%" (-> this enter-time)) (format #t "~Texit-time: ~D~%" (-> this exit-time)) @@ -41,16 +34,13 @@ ;; definition of type snow-ball-path-info (deftype snow-ball-path-info (structure) - ((hug-path? symbol :offset-assert 0) - (path-pos vector :inline :offset-assert 16) + ((hug-path? symbol) + (path-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type snow-ball-path-info -(defmethod inspect snow-ball-path-info ((this snow-ball-path-info)) +(defmethod inspect ((this snow-ball-path-info)) (format #t "[~8x] ~A~%" this 'snow-ball-path-info) (format #t "~Thug-path?: ~A~%" (-> this hug-path?)) (format #t "~Tpath-pos: #~%" (-> this path-pos)) @@ -59,30 +49,26 @@ ;; definition of type snow-ball-roller (deftype snow-ball-roller (process-drawable) - ((root-override collide-shape-moving :offset 112) - (which-path int32 :offset-assert 176) - (path-u float :offset-assert 180) - (path-speed float :offset-assert 184) - (path-length float :offset-assert 188) - (path-fall-u float :offset-assert 192) - (path-coming-out-u float :offset-assert 196) - (path-faded-up-u float :offset-assert 200) - (delay-til-bounce int32 :offset-assert 204) - (rolling-sound-id sound-id :offset-assert 208) - (rolling-sound-enabled? symbol :offset-assert 212) - (last-bounce-time time-frame :offset-assert 216) - (hit-player-time time-frame :offset-assert 224) - (path-info snow-ball-path-info :inline :offset-assert 240) - (junctions snow-ball-junction 4 :inline :offset-assert 272) + ((root collide-shape-moving :override) + (which-path int32) + (path-u float) + (path-speed float) + (path-length float) + (path-fall-u float) + (path-coming-out-u float) + (path-faded-up-u float) + (delay-til-bounce int32) + (rolling-sound-id sound-id) + (rolling-sound-enabled? symbol) + (last-bounce-time time-frame) + (hit-player-time time-frame) + (path-info snow-ball-path-info :inline) + (junctions snow-ball-junction 4 :inline) ) - :heap-base #xe0 - :method-count-assert 23 - :size-assert #x150 - :flag-assert #x1700e00150 (:methods - (follow-path (_type_) none 20) - (play-landing-sound (_type_ float) sound-id 21) - (snow-ball-roller-method-22 (_type_ process-drawable) none 22) + (follow-path (_type_) none) + (play-landing-sound (_type_ float) sound-id) + (snow-ball-roller-method-22 (_type_ process-drawable) none) ) (:states snow-ball-roller-idle @@ -90,7 +76,7 @@ ) ;; definition for method 3 of type snow-ball-roller -(defmethod inspect snow-ball-roller ((this snow-ball-roller)) +(defmethod inspect ((this snow-ball-roller)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -113,20 +99,16 @@ ;; definition of type snow-ball (deftype snow-ball (process) - ((child-override (pointer snow-ball-roller) :offset 20) - (state-time time-frame :offset-assert 112) - (last-path-picked int32 :offset-assert 120) - (same-path-picked-count int32 :offset-assert 124) - (delay-til-next int32 :offset-assert 128) - (path curve-control 2 :offset-assert 132) + ((child-override (pointer snow-ball-roller) :overlay-at child) + (state-time time-frame) + (last-path-picked int32) + (same-path-picked-count int32) + (delay-til-next int32) + (path curve-control 2) ) - :heap-base #x20 - :method-count-assert 16 - :size-assert #x8c - :flag-assert #x100020008c (:methods - (snow-ball-method-14 (_type_ (inline-array snow-ball-junction) float int) symbol 14) - (snow-ball-method-15 (_type_ (inline-array snow-ball-junction) int) symbol 15) + (snow-ball-method-14 (_type_ (inline-array snow-ball-junction) float int) symbol) + (snow-ball-method-15 (_type_ (inline-array snow-ball-junction) int) symbol) ) (:states snow-ball-idle @@ -134,7 +116,7 @@ ) ;; definition for method 3 of type snow-ball -(defmethod inspect snow-ball ((this snow-ball)) +(defmethod inspect ((this snow-ball)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -216,7 +198,7 @@ ;; definition for method 20 of type snow-ball-roller ;; INFO: Used lq/sq ;; INFO: Return type mismatch float vs none. -(defmethod follow-path snow-ball-roller ((this snow-ball-roller)) +(defmethod follow-path ((this snow-ball-roller)) (let ((s5-0 (-> this path-info))) (set! (-> s5-0 hug-path?) #f) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -245,13 +227,13 @@ (cond ((>= (-> this path-u) (-> this path-fall-u)) (set! (-> s5-0 path-pos y) -409600.0) - (set! (-> s5-0 path-pos x) (+ (-> s4-0 x) (-> this root-override transv x))) - (set! (-> s5-0 path-pos z) (+ (-> s4-0 z) (-> this root-override transv z))) + (set! (-> s5-0 path-pos x) (+ (-> s4-0 x) (-> this root transv x))) + (set! (-> s5-0 path-pos z) (+ (-> s4-0 z) (-> this root transv z))) (set! (-> this rolling-sound-enabled?) #f) ) (else - (set! (-> this root-override transv x) (- (-> s5-0 path-pos x) (-> s4-0 x))) - (set! (-> this root-override transv z) (- (-> s5-0 path-pos z) (-> s4-0 z))) + (set! (-> this root transv x) (- (-> s5-0 path-pos x) (-> s4-0 x))) + (set! (-> this root transv z) (- (-> s5-0 path-pos z) (-> s4-0 z))) ) ) ) @@ -260,7 +242,7 @@ ) ;; definition for method 21 of type snow-ball-roller -(defmethod play-landing-sound snow-ball-roller ((this snow-ball-roller) (arg0 float)) +(defmethod play-landing-sound ((this snow-ball-roller) (arg0 float)) (let ((f30-0 (* 0.0018780049 (fmin 53248.0 (fmax 0.0 (+ -4096.0 (fabs arg0))))))) (sound-play "snowball-land" :vol f30-0) ) @@ -271,9 +253,9 @@ ;; INFO: Return type mismatch int vs none. (defbehavior snow-ball-roller-path-update snow-ball-roller () (local-vars (f0-5 float)) - (let ((f0-0 (-> self root-override trans y))) - (+! (-> self root-override transv y) (* -491520.0 (seconds-per-frame))) - (let ((f30-0 (+ f0-0 (* (-> self root-override transv y) (seconds-per-frame))))) + (let ((f0-0 (-> self root trans y))) + (+! (-> self root transv y) (* -491520.0 (seconds-per-frame))) + (let ((f30-0 (+ f0-0 (* (-> self root transv y) (seconds-per-frame))))) (follow-path self) (let ((a1-0 (new 'stack-no-clear 'vector))) (let ((a0-1 (-> self path-info))) @@ -282,30 +264,30 @@ (+! (-> a1-0 y) 9216.0) (cond ((-> self path-info hug-path?) - (move-to-point! (-> self root-override) a1-0) - (set! (-> self root-override transv y) 0.0) + (move-to-point! (-> self root) a1-0) + (set! (-> self root transv y) 0.0) ) ((begin (set! f0-5 (- f30-0 (-> a1-0 y))) (< 0.0 f0-5)) (+! (-> a1-0 y) f0-5) - (move-to-point! (-> self root-override) a1-0) + (move-to-point! (-> self root) a1-0) ) (else - (move-to-point! (-> self root-override) a1-0) - (let ((f0-7 (-> self root-override transv y))) + (move-to-point! (-> self root) a1-0) + (let ((f0-7 (-> self root transv y))) (cond ((>= -40960.0 f0-7) - (set! (-> self root-override transv y) (* 0.4 (- f0-7))) - (play-landing-sound self (-> self root-override transv y)) + (set! (-> self root transv y) (* 0.4 (- f0-7))) + (play-landing-sound self (-> self root transv y)) ) (else - (set! (-> self root-override transv y) 0.0) + (set! (-> self root transv y) 0.0) ) ) ) (when (< (-> self path-u) (-> self path-fall-u)) (when (time-elapsed? (-> self last-bounce-time) (-> self delay-til-bounce)) (let ((f0-13 (rand-vu-float-range 8192.0 20480.0))) - (+! (-> self root-override transv y) f0-13) + (+! (-> self root transv y) f0-13) (play-landing-sound self f0-13) ) (set-time! (-> self last-bounce-time)) @@ -328,14 +310,14 @@ (matrix-rotate-x! s5-0 (* 1.1317686 (-> self path-u) (-> self path-length))) (matrix*! gp-0 s5-0 gp-0) ) - (matrix->quaternion (-> self root-override quat) gp-0) + (matrix->quaternion (-> self root quat) gp-0) ) ) (+! (-> self path-u) (* (-> self path-speed) (seconds-per-frame))) (if (< 1.0 (-> self path-u)) (set! (-> self path-u) 1.0) ) - (let ((f0-23 (- 819200.0 (-> self root-override trans y)))) + (let ((f0-23 (- 819200.0 (-> self root trans y)))) (when (>= f0-23 0.0) (cond ((>= f0-23 245760.0) @@ -343,29 +325,23 @@ ) (else (let ((f0-25 (- 1.0 (* 0.0000040690106 f0-23)))) - (set! (-> self root-override scale x) f0-25) - (set! (-> self root-override scale y) f0-25) - (set! (-> self root-override scale z) f0-25) + (set! (-> self root scale x) f0-25) + (set! (-> self root scale y) f0-25) + (set! (-> self root scale z) f0-25) ) ) ) ) ) - (let ((v1-54 (< (vector-vector-distance (-> self root-override trans) (math-camera-pos)) 163840.0))) + (let ((v1-54 (< (vector-vector-distance (-> self root trans) (math-camera-pos)) 163840.0))) (cond ((zero? (-> self rolling-sound-id)) (if (and v1-54 (-> self rolling-sound-enabled?)) - (set! (-> self rolling-sound-id) - (sound-play "snowball-roll" :position (the-as symbol (-> self root-override trans))) - ) + (set! (-> self rolling-sound-id) (sound-play "snowball-roll" :position (the-as symbol (-> self root trans)))) ) ) ((and v1-54 (-> self rolling-sound-enabled?)) - (sound-play - "snowball-roll" - :id (-> self rolling-sound-id) - :position (the-as symbol (-> self root-override trans)) - ) + (sound-play "snowball-roll" :id (-> self rolling-sound-id) :position (the-as symbol (-> self root trans))) ) (else (sound-stop (-> self rolling-sound-id)) @@ -380,24 +356,24 @@ ;; definition for method 22 of type snow-ball-roller ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod snow-ball-roller-method-22 snow-ball-roller ((this snow-ball-roller) (arg0 process-drawable)) +(defmethod snow-ball-roller-method-22 ((this snow-ball-roller) (arg0 process-drawable)) (cond - ((< (+ 4096.0 (-> arg0 root trans y)) (-> this root-override trans y)) + ((< (+ 4096.0 (-> arg0 root trans y)) (-> this root trans y)) (let ((f0-2 81920.0)) - (+! (-> this root-override transv y) f0-2) + (+! (-> this root transv y) f0-2) (play-landing-sound this f0-2) ) ) (else (let ((f0-3 24576.0)) - (+! (-> this root-override transv y) f0-3) + (+! (-> this root transv y) f0-3) (play-landing-sound this f0-3) ) ) ) (let ((s4-0 (new 'stack-no-clear 'vector))) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 (-> arg0 root trans) (-> this root-override trans)) + (vector-! s4-0 (-> arg0 root trans) (-> this root trans)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) (path-control-method-14 (-> this path) s3-0 (-> this path-u)) @@ -421,7 +397,7 @@ ) ) (vector-normalize! s4-0 25600.0) - (vector+! s4-0 s4-0 (-> this root-override trans)) + (vector+! s4-0 s4-0 (-> this root trans)) (vector-! s4-0 s4-0 (-> arg0 root trans)) (set! (-> s4-0 y) 0.0) (let ((f30-2 (vector-length s4-0))) @@ -438,7 +414,7 @@ (case message (('touch 'attack) (when (= (-> proc type) target) - (do-push-aways! (-> self root-override)) + (do-push-aways! (-> self root)) (when (time-elapsed? (-> self hit-player-time) (seconds 0.5)) (set-time! (-> self hit-player-time)) (snow-ball-roller-method-22 self *target*) @@ -499,9 +475,9 @@ ) (set! (-> s4-1 nav-radius) (* 0.75 (-> s4-1 root-prim local-sphere w))) (backup-collide-with-as s4-1) - (set! (-> self root-override) s4-1) + (set! (-> self root) s4-1) ) - (set-vector! (-> self root-override transv) 0.0 0.0 0.0 1.0) + (set-vector! (-> self root transv) 0.0 0.0 0.0 1.0) (process-drawable-from-entity! self arg0) (initialize-skeleton self *snow-ball-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) @@ -528,7 +504,7 @@ ) ;; definition for method 14 of type snow-ball -(defmethod snow-ball-method-14 snow-ball ((this snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 float) (arg2 int)) +(defmethod snow-ball-method-14 ((this snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 float) (arg2 int)) (local-vars (v1-0 (pointer float))) (if (zero? arg2) (set! v1-0 (new 'static 'array float 8 0.3309 0.36 0.4691 0.5061 0.6904 0.7264 0.864 0.8667)) @@ -549,7 +525,7 @@ ) ;; definition for method 15 of type snow-ball -(defmethod snow-ball-method-15 snow-ball ((this snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 int)) +(defmethod snow-ball-method-15 ((this snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 int)) (local-vars (v0-0 symbol)) (let ((v1-0 (-> this child-override))) (while v1-0 @@ -633,7 +609,7 @@ ) ;; definition for method 7 of type snow-ball -(defmethod relocate snow-ball ((this snow-ball) (arg0 int)) +(defmethod relocate ((this snow-ball) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this path v1-0)) (&+! (-> this path v1-0) arg0) @@ -644,7 +620,7 @@ ;; definition for method 11 of type snow-ball ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-ball ((this snow-ball) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-ball) (arg0 entity-actor)) (set! (-> this last-path-picked) 1) (set! (-> this same-path-picked-count) 1) (dotimes (s5-0 2) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc index 7560d8e9ed9..0b89c27b0ac 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc @@ -3,19 +3,15 @@ ;; definition of type snow-bumper (deftype snow-bumper (process-drawable) - ((bumper-id int32 :offset-assert 176) - (base-shove-ry float :offset-assert 180) - (max-shove-diff-ry float :offset-assert 184) - (part2 sparticle-launch-control :offset-assert 188) - (last-shoved-player-time time-frame :offset-assert 192) + ((bumper-id int32) + (base-shove-ry float) + (max-shove-diff-ry float) + (part2 sparticle-launch-control) + (last-shoved-player-time time-frame) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16006000c8 (:methods - (snow-bumper-method-20 (_type_) none 20) - (shove-player (_type_ process-drawable) none 21) + (snow-bumper-method-20 (_type_) none) + (shove-player (_type_ process-drawable) none) ) (:states snow-bumper-active-close-idle @@ -27,7 +23,7 @@ ) ;; definition for method 3 of type snow-bumper -(defmethod inspect snow-bumper ((this snow-bumper)) +(defmethod inspect ((this snow-bumper)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -113,7 +109,7 @@ ;; definition for method 21 of type snow-bumper ;; INFO: Used lq/sq ;; INFO: Return type mismatch time-frame vs none. -(defmethod shove-player snow-bumper ((this snow-bumper) (arg0 process-drawable)) +(defmethod shove-player ((this snow-bumper) (arg0 process-drawable)) (let ((s5-0 (new 'stack-no-clear 'vector))) (vector-! s5-0 (-> arg0 root trans) (-> this root trans)) (set! (-> s5-0 y) 0.0) @@ -307,7 +303,7 @@ ) ;; definition for method 10 of type snow-bumper -(defmethod deactivate snow-bumper ((this snow-bumper)) +(defmethod deactivate ((this snow-bumper)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -316,7 +312,7 @@ ) ;; definition for method 7 of type snow-bumper -(defmethod relocate snow-bumper ((this snow-bumper) (arg0 int)) +(defmethod relocate ((this snow-bumper) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -326,7 +322,7 @@ ;; definition for method 11 of type snow-bumper ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-bumper ((this snow-bumper) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-bumper) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (set! (-> this last-shoved-player-time) 0) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc index 9a82444ebdd..ceea6513672 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc @@ -3,43 +3,39 @@ ;; definition of type snow-bunny (deftype snow-bunny (nav-enemy) - ((patrol-rand-distraction int32 :offset-assert 400) - (base-hop-dist float :offset-assert 404) - (halfway-dist float :offset-assert 408) - (retreat-timeout float :offset-assert 412) - (gnd-popup float :offset-assert 416) - (jump-height-min float :offset-assert 420) - (jump-height-factor float :offset-assert 424) - (jump-anim-start-frame float :offset-assert 428) - (defense uint64 :offset-assert 432) - (retreat-timeout-time time-frame :offset-assert 440) - (last-nondangerous-time time-frame :offset-assert 448) - (patrol-hop-failed? basic :offset-assert 456) - (should-retreat? basic :offset-assert 460) - (got-jump-event? symbol :offset-assert 464) - (using-jump-event? basic :offset-assert 468) - (jump-anim int8 :offset-assert 472) - (notice-land-anim int8 :offset-assert 473) - (attack-anim int8 :offset-assert 474) - (final-dest vector :inline :offset-assert 480) - (jump-event-dest vector :inline :offset-assert 496) + ((patrol-rand-distraction int32) + (base-hop-dist float) + (halfway-dist float) + (retreat-timeout float) + (gnd-popup float) + (jump-height-min float) + (jump-height-factor float) + (jump-anim-start-frame float) + (defense uint64) + (retreat-timeout-time time-frame) + (last-nondangerous-time time-frame) + (patrol-hop-failed? basic) + (should-retreat? basic) + (got-jump-event? symbol) + (using-jump-event? basic) + (jump-anim int8) + (notice-land-anim int8) + (attack-anim int8) + (final-dest vector :inline) + (jump-event-dest vector :inline) ) - :heap-base #x190 - :method-count-assert 77 - :size-assert #x200 - :flag-assert #x4d01900200 (:methods - (snow-bunny-method-51 (_type_ vector vector) symbol :replace 51) - (snow-bunny-method-52 (_type_) symbol :replace 52) - (snow-bunny-method-54 (_type_) symbol :replace 54) - (snow-bunny-method-57 (_type_) symbol :replace 57) - (snow-bunny-method-60 (_type_) none :replace 60) - (snow-bunny-method-76 (_type_ symbol) none 76) + (nav-enemy-method-51 (_type_ vector vector) symbol :replace) + (nav-enemy-method-52 (_type_) symbol :replace) + (nav-enemy-method-54 (_type_) symbol :replace) + (nav-enemy-method-57 (_type_) symbol :replace) + (nav-enemy-method-60 (_type_) none :replace) + (snow-bunny-method-76 (_type_ symbol) none) ) ) ;; definition for method 3 of type snow-bunny -(defmethod inspect snow-bunny ((this snow-bunny)) +(defmethod inspect ((this snow-bunny)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -156,7 +152,7 @@ ;; definition for method 76 of type snow-bunny ;; INFO: Return type mismatch int vs none. -(defmethod snow-bunny-method-76 snow-bunny ((this snow-bunny) (arg0 symbol)) +(defmethod snow-bunny-method-76 ((this snow-bunny) (arg0 symbol)) (let ((f0-0 -4096.0)) (if arg0 (set! f0-0 -20480.0) @@ -171,7 +167,7 @@ ;; definition for method 47 of type snow-bunny ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision snow-bunny ((this snow-bunny)) +(defmethod initialize-collision ((this snow-bunny)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -220,7 +216,7 @@ ;; definition for method 60 of type snow-bunny ;; INFO: Return type mismatch int vs none. -(defmethod snow-bunny-method-60 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-60 ((this snow-bunny)) (initialize-skeleton this *snow-bunny-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) (none) @@ -228,8 +224,8 @@ ;; definition for method 48 of type snow-bunny ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 snow-bunny ((this snow-bunny)) - (snow-bunny-method-60 this) +(defmethod nav-enemy-method-48 ((this snow-bunny)) + (nav-enemy-method-60 this) (init-defaults! this *snow-bunny-nav-enemy-info*) (logclear! (-> this draw shadow-ctrl settings flags) (shadow-flags shdf03)) (cond @@ -257,7 +253,7 @@ ) ;; definition for method 11 of type snow-bunny -(defmethod init-from-entity! snow-bunny ((this snow-bunny) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-bunny) (arg0 entity-actor)) (initialize-collision this) (process-drawable-from-entity! this arg0) (nav-enemy-method-48 this) @@ -271,7 +267,7 @@ ;; definition for method 58 of type snow-bunny ;; INFO: Return type mismatch time-frame vs none. -(defmethod nav-enemy-method-58 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-58 ((this snow-bunny)) (if (not (logtest? (-> *target* state-flags) (state-flags dangerous))) (set-time! (-> this last-nondangerous-time)) ) @@ -298,7 +294,7 @@ ;; definition for method 56 of type snow-bunny ;; INFO: Return type mismatch float vs none. -(defmethod set-jump-height-factor! snow-bunny ((this snow-bunny) (arg0 int)) +(defmethod set-jump-height-factor! ((this snow-bunny) (arg0 int)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -325,7 +321,7 @@ ) ;; definition for method 57 of type snow-bunny -(defmethod snow-bunny-method-57 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-57 ((this snow-bunny)) (if (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags dangerous)))) (return #f) ) @@ -436,7 +432,7 @@ (set! (-> self state-timeout) (seconds 0.1)) ) :trans (behavior () - (if (snow-bunny-method-57 self) + (if (nav-enemy-method-57 self) (go-virtual snow-bunny-defend) ) (when (time-elapsed? (-> self state-time) (-> self state-timeout)) @@ -493,7 +489,7 @@ ;; definition for method 51 of type snow-bunny ;; INFO: Used lq/sq -(defmethod snow-bunny-method-51 snow-bunny ((this snow-bunny) (arg0 vector) (arg1 vector)) +(defmethod nav-enemy-method-51 ((this snow-bunny) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let* ((s4-0 (new 'stack-no-clear 'collide-tri-result)) (f0-0 (-> this gnd-popup)) @@ -525,7 +521,7 @@ ;; definition for method 53 of type snow-bunny ;; INFO: Used lq/sq -(defmethod nav-enemy-method-53 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-53 ((this snow-bunny)) (let* ((s4-0 (-> this path curve num-cverts)) (s2-0 (nav-enemy-rnd-int-count s4-0)) (s5-0 (new 'stack-no-clear 'vector)) @@ -534,7 +530,7 @@ (eval-path-curve-div! (-> this path) s5-0 (the float s2-0) 'interp) (let ((f30-0 (vector-vector-xz-distance s5-0 (-> this collide-info trans)))) (when (>= f30-0 6144.0) - (when (snow-bunny-method-51 this s5-0 s5-0) + (when (nav-enemy-method-51 this s5-0 s5-0) (set! (-> this final-dest quad) (-> s5-0 quad)) (set! (-> this halfway-dist) (* 0.5 f30-0)) (set! (-> this base-hop-dist) (rand-vu-float-range 6144.0 22118.4)) @@ -550,7 +546,7 @@ ;; definition for method 54 of type snow-bunny ;; INFO: Used lq/sq -(defmethod snow-bunny-method-54 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-54 ((this snow-bunny)) (local-vars (sv-48 (function float float))) (set! (-> this using-jump-event?) #f) (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this final-dest) (-> this collide-info trans))) @@ -610,7 +606,7 @@ ) (let ((a2-2 (-> this nav target-pos))) (vector+! a2-2 (-> this collide-info trans) s5-2) - (if (not (snow-bunny-method-51 this a2-2 a2-2)) + (if (not (nav-enemy-method-51 this a2-2 a2-2)) (return #f) ) ) @@ -626,11 +622,11 @@ :event snow-bunny-default-event-handler :enter (behavior () (set-time! (-> self state-time)) - (when (not (snow-bunny-method-54 self)) + (when (not (nav-enemy-method-54 self)) (set! (-> self patrol-hop-failed?) #t) (go-virtual snow-bunny-patrol-idle) ) - (if (snow-bunny-method-57 self) + (if (nav-enemy-method-57 self) (go-virtual snow-bunny-defend) ) (set-jump-height-factor! self 0) @@ -739,7 +735,7 @@ ;; definition for method 52 of type snow-bunny ;; INFO: Used lq/sq -(defmethod snow-bunny-method-52 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-52 ((this snow-bunny)) (local-vars (sv-48 (function float float))) (set! (-> this using-jump-event?) #f) (if (not *target*) @@ -747,7 +743,7 @@ ) (let ((s4-0 (-> this final-dest))) (set! (-> s4-0 quad) (-> (target-pos 0) quad)) - (if (not (snow-bunny-method-51 this s4-0 s4-0)) + (if (not (nav-enemy-method-51 this s4-0 s4-0)) (return #f) ) (set! (-> this base-hop-dist) (rand-vu-float-range 18022.4 22118.4)) @@ -797,7 +793,7 @@ ) (let ((a2-3 (-> this nav target-pos))) (vector+! a2-3 (-> this collide-info trans) s5-3) - (if (not (snow-bunny-method-51 this a2-3 a2-3)) + (if (not (nav-enemy-method-51 this a2-3 a2-3)) (return #f) ) ) @@ -820,10 +816,10 @@ (if (not (target-in-range? self (-> self nav-info stop-chase-distance))) (go-virtual nav-enemy-patrol) ) - (if (snow-bunny-method-57 self) + (if (nav-enemy-method-57 self) (go-virtual snow-bunny-defend) ) - (when (not (snow-bunny-method-52 self)) + (when (not (nav-enemy-method-52 self)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1)) (go-virtual nav-enemy-notice) ) @@ -838,7 +834,7 @@ (logclear! (-> self collide-info nav-flags) (nav-flags navf1)) ) :trans (behavior () - (if (snow-bunny-method-57 self) + (if (nav-enemy-method-57 self) (set! (-> self should-retreat?) #t) ) (nav-enemy-method-58 self) @@ -869,19 +865,16 @@ ;; definition of type snow-bunny-retreat-work (deftype snow-bunny-retreat-work (structure) - ((found-best basic :offset-assert 0) - (using-jump-event? basic :offset-assert 4) - (best-travel-dist float :offset-assert 8) - (best-dest vector :inline :offset-assert 16) - (away-vec vector :inline :offset-assert 32) + ((found-best basic) + (using-jump-event? basic) + (best-travel-dist float) + (best-dest vector :inline) + (away-vec vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type snow-bunny-retreat-work -(defmethod inspect snow-bunny-retreat-work ((this snow-bunny-retreat-work)) +(defmethod inspect ((this snow-bunny-retreat-work)) (format #t "[~8x] ~A~%" this 'snow-bunny-retreat-work) (format #t "~Tfound-best: ~A~%" (-> this found-best)) (format #t "~Tusing-jump-event?: ~A~%" (-> this using-jump-event?)) @@ -893,7 +886,7 @@ ;; definition for method 55 of type snow-bunny ;; INFO: Used lq/sq -(defmethod nav-enemy-method-55 snow-bunny ((this snow-bunny)) +(defmethod nav-enemy-method-55 ((this snow-bunny)) (set! (-> this using-jump-event?) #f) (if (not *target*) (return #f) @@ -990,7 +983,7 @@ (when (>= f30-2 409.6) (let ((s1-5 (-> this nav target-pos))) (vector+! s1-5 (-> this collide-info trans) s0-0) - (when (snow-bunny-method-51 this s1-5 s1-5) + (when (nav-enemy-method-51 this s1-5 s1-5) (if (>= f30-2 (+ -409.6 (-> this base-hop-dist))) (return #t) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc index 53329d3b2a1..1b9578f647b 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc @@ -3,23 +3,19 @@ ;; definition of type flutflut-plat (deftype flutflut-plat (plat) - ((has-path? symbol :offset-assert 264) - (plat-type int32 :offset-assert 268) - (rise-time int32 :offset-assert 272) - (fall-time int32 :offset-assert 276) - (part-ry float :offset-assert 280) - (sync-starting-val float :offset-assert 284) - (flutflut-button entity-actor :offset-assert 288) - (appear-trans-top vector :inline :offset-assert 304) - (appear-trans-bottom vector :inline :offset-assert 320) - (appear-quat-top quaternion :inline :offset-assert 336) - (appear-quat-bottom quaternion :inline :offset-assert 352) - (start-trans vector :inline :offset-assert 368) + ((has-path? symbol) + (plat-type int32) + (rise-time int32) + (fall-time int32) + (part-ry float) + (sync-starting-val float) + (flutflut-button entity-actor) + (appear-trans-top vector :inline) + (appear-trans-bottom vector :inline) + (appear-quat-top quaternion :inline) + (appear-quat-bottom quaternion :inline) + (start-trans vector :inline) ) - :heap-base #x110 - :method-count-assert 33 - :size-assert #x180 - :flag-assert #x2101100180 (:states elevator-idle-at-cave elevator-idle-at-fort @@ -32,7 +28,7 @@ ) ;; definition for method 3 of type flutflut-plat -(defmethod inspect flutflut-plat ((this flutflut-plat)) +(defmethod inspect ((this flutflut-plat)) (let ((t9-0 (method-of-type plat inspect))) (t9-0 this) ) @@ -53,18 +49,14 @@ ;; definition of type snow-button (deftype snow-button (process-drawable) - ((root-override collide-shape-moving :offset 112) - (wiggled? symbol :offset-assert 176) - (trying-for-fuel-cell? symbol :offset-assert 180) - (timeout time-frame :offset-assert 184) - (delay-til-wiggle time-frame :offset-assert 192) - (prev-button entity-actor :offset-assert 200) - (ticker ticky :inline :offset-assert 208) + ((root collide-shape-moving :override) + (wiggled? symbol) + (trying-for-fuel-cell? symbol) + (timeout time-frame) + (delay-til-wiggle time-frame) + (prev-button entity-actor) + (ticker ticky :inline) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xf0 - :flag-assert #x14008000f0 (:states snow-button-activate snow-button-deactivate @@ -73,7 +65,7 @@ ) ;; definition for method 3 of type snow-button -(defmethod inspect snow-button ((this snow-button)) +(defmethod inspect ((this snow-button)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -270,7 +262,7 @@ (('touch 'attack 'bonk) (when (and (= (-> proc type) target) (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)) - (>= 10649.6 (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) + (>= 10649.6 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) ) (close-specific-task! (game-task snow-ball) (task-status need-hint)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -385,7 +377,7 @@ ;; definition for method 11 of type snow-button ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-button ((this snow-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-button) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -428,7 +420,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set! (-> this link) (new 'process 'actor-link-info this)) @@ -457,7 +449,7 @@ ;; definition for method 26 of type flutflut-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-26 flutflut-plat ((this flutflut-plat)) +(defmethod baseplat-method-26 ((this flutflut-plat)) (let ((t9-0 (method-of-type plat baseplat-method-26))) (t9-0 this) ) @@ -469,7 +461,7 @@ (set! (-> this flutflut-button) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-0 0.0) - (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-0) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-0) ) ) (set! (-> this has-path?) @@ -491,12 +483,12 @@ ) ) (else - (set! (-> this appear-trans-top quad) (-> this root-override trans quad)) + (set! (-> this appear-trans-top quad) (-> this root trans quad)) ) ) (set! (-> this appear-trans-bottom quad) (-> this appear-trans-top quad)) (+! (-> this appear-trans-bottom y) -286720.0) - (quaternion-copy! (-> this appear-quat-top) (-> this root-override quat)) + (quaternion-copy! (-> this appear-quat-top) (-> this root quat)) (let ((v1-33 (res-lump-value (-> this entity) 'extra-id uint128))) (set! (-> this rise-time) (the int (* 300.0 (+ 0.6 (* 0.15 (the float v1-33)))))) ) @@ -507,7 +499,7 @@ ;; definition for method 27 of type flutflut-plat ;; INFO: Return type mismatch symbol vs skeleton-group. -(defmethod get-lit-skel flutflut-plat ((this flutflut-plat)) +(defmethod get-lit-skel ((this flutflut-plat)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (return (the-as skeleton-group #t)) ) @@ -583,8 +575,8 @@ ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) - (clear-collide-with-as (-> self root-override)) - (set! (-> self root-override trans quad) (-> self appear-trans-top quad)) + (clear-collide-with-as (-> self root)) + (set! (-> self root trans quad) (-> self appear-trans-top quad)) (transform-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -605,7 +597,7 @@ (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (set! (-> self basetrans quad) (-> self appear-trans-bottom quad)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'quaternion)) @@ -629,7 +621,7 @@ (f30-0 (- 1.0 f0-3)) ) (vector-lerp! (-> self basetrans) (-> self appear-trans-bottom) (-> self appear-trans-top) f30-0) - (quaternion-slerp! (-> self root-override quat) (-> self appear-quat-bottom) (-> self appear-quat-top) f30-0) + (quaternion-slerp! (-> self root quat) (-> self appear-quat-bottom) (-> self appear-quat-top) f30-0) (set-vector! (-> self draw color-mult) f30-0 f30-0 f30-0 1.0) (when (>= f30-0 1.0) (baseplat-method-22 self) @@ -747,8 +739,8 @@ :enter (behavior () (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) - (logclear! (-> self root-override root-prim prim-core action) (collide-action rider-plat-sticky)) - (set! (-> self start-trans quad) (-> self root-override trans quad)) + (logclear! (-> self root root-prim prim-core action) (collide-action rider-plat-sticky)) + (set! (-> self start-trans quad) (-> self root trans quad)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'quaternion)) ) @@ -762,7 +754,7 @@ ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) - (logior! (-> self root-override root-prim prim-core action) (collide-action rider-plat-sticky)) + (logior! (-> self root root-prim prim-core action) (collide-action rider-plat-sticky)) ) :trans (behavior () (plat-trans) @@ -770,7 +762,7 @@ (f30-0 (* f0-1 f0-1)) ) (vector-lerp! (-> self basetrans) (-> self start-trans) (-> self appear-trans-bottom) f30-0) - (quaternion-slerp! (-> self root-override quat) (-> self appear-quat-top) (-> self appear-quat-bottom) f30-0) + (quaternion-slerp! (-> self root quat) (-> self appear-quat-top) (-> self appear-quat-bottom) f30-0) (let ((f0-3 (- 1.0 f30-0))) (set-vector! (-> self draw color-mult) f0-3 f0-3 f0-3 1.0) ) @@ -896,14 +888,10 @@ ;; definition of type flutflut-plat-small (deftype flutflut-plat-small (flutflut-plat) () - :heap-base #x110 - :method-count-assert 33 - :size-assert #x180 - :flag-assert #x2101100180 ) ;; definition for method 3 of type flutflut-plat-small -(defmethod inspect flutflut-plat-small ((this flutflut-plat-small)) +(defmethod inspect ((this flutflut-plat-small)) (let ((t9-0 (method-of-type flutflut-plat inspect))) (t9-0 this) ) @@ -913,14 +901,10 @@ ;; definition of type flutflut-plat-med (deftype flutflut-plat-med (flutflut-plat) () - :heap-base #x110 - :method-count-assert 33 - :size-assert #x180 - :flag-assert #x2101100180 ) ;; definition for method 3 of type flutflut-plat-med -(defmethod inspect flutflut-plat-med ((this flutflut-plat-med)) +(defmethod inspect ((this flutflut-plat-med)) (let ((t9-0 (method-of-type flutflut-plat inspect))) (t9-0 this) ) @@ -930,14 +914,10 @@ ;; definition of type flutflut-plat-large (deftype flutflut-plat-large (flutflut-plat) () - :heap-base #x110 - :method-count-assert 33 - :size-assert #x180 - :flag-assert #x2101100180 ) ;; definition for method 3 of type flutflut-plat-large -(defmethod inspect flutflut-plat-large ((this flutflut-plat-large)) +(defmethod inspect ((this flutflut-plat-large)) (let ((t9-0 (method-of-type flutflut-plat inspect))) (t9-0 this) ) @@ -945,13 +925,13 @@ ) ;; definition for method 23 of type flutflut-plat-small -(defmethod get-unlit-skel flutflut-plat-small ((this flutflut-plat-small)) +(defmethod get-unlit-skel ((this flutflut-plat-small)) *flutflut-plat-small-sg* ) ;; definition for method 25 of type flutflut-plat-small ;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group. -(defmethod baseplat-method-25 flutflut-plat-small ((this flutflut-plat-small)) +(defmethod baseplat-method-25 ((this flutflut-plat-small)) (let ((v0-0 (create-launch-control (-> *part-group-id-table* 516) this))) (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) @@ -960,28 +940,28 @@ ;; definition for method 20 of type flutflut-plat-small ;; INFO: Return type mismatch object vs none. -(defmethod baseplat-method-20 flutflut-plat-small ((this flutflut-plat-small)) +(defmethod baseplat-method-20 ((this flutflut-plat-small)) (when (nonzero? (-> this part)) (set! (-> *part-id-table* 2087 init-specs 12 initial-valuef) (-> this part-ry)) (set! (-> *part-id-table* 2088 init-specs 17 initial-valuef) (-> this part-ry)) - (spawn (-> this part) (-> this root-override trans)) + (spawn (-> this part) (-> this root trans)) ) (none) ) ;; definition for method 26 of type flutflut-plat-small ;; INFO: Return type mismatch float vs none. -(defmethod baseplat-method-26 flutflut-plat-small ((this flutflut-plat-small)) +(defmethod baseplat-method-26 ((this flutflut-plat-small)) (let ((t9-0 (method-of-type flutflut-plat baseplat-method-26))) (t9-0 this) ) - (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root-override quat)))) + (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root quat)))) (none) ) ;; definition for method 24 of type flutflut-plat-small ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 flutflut-plat-small ((this flutflut-plat-small)) +(defmethod baseplat-method-24 ((this flutflut-plat-small)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1000,20 +980,20 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 23 of type flutflut-plat-med -(defmethod get-unlit-skel flutflut-plat-med ((this flutflut-plat-med)) +(defmethod get-unlit-skel ((this flutflut-plat-med)) *flutflut-plat-med-sg* ) ;; definition for method 25 of type flutflut-plat-med ;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group. -(defmethod baseplat-method-25 flutflut-plat-med ((this flutflut-plat-med)) +(defmethod baseplat-method-25 ((this flutflut-plat-med)) (let ((v0-0 (create-launch-control (-> *part-group-id-table* 517) this))) (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) @@ -1022,7 +1002,7 @@ ;; definition for method 24 of type flutflut-plat-med ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 flutflut-plat-med ((this flutflut-plat-med)) +(defmethod baseplat-method-24 ((this flutflut-plat-med)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1041,20 +1021,20 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 23 of type flutflut-plat-large -(defmethod get-unlit-skel flutflut-plat-large ((this flutflut-plat-large)) +(defmethod get-unlit-skel ((this flutflut-plat-large)) *flutflut-plat-large-sg* ) ;; definition for method 25 of type flutflut-plat-large ;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group. -(defmethod baseplat-method-25 flutflut-plat-large ((this flutflut-plat-large)) +(defmethod baseplat-method-25 ((this flutflut-plat-large)) (let ((v0-0 (create-launch-control (-> *part-group-id-table* 518) this))) (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) @@ -1063,28 +1043,28 @@ ;; definition for method 20 of type flutflut-plat-large ;; INFO: Return type mismatch object vs none. -(defmethod baseplat-method-20 flutflut-plat-large ((this flutflut-plat-large)) +(defmethod baseplat-method-20 ((this flutflut-plat-large)) (when (nonzero? (-> this part)) (set! (-> *part-id-table* 2091 init-specs 12 initial-valuef) (-> this part-ry)) (set! (-> *part-id-table* 2092 init-specs 17 initial-valuef) (-> this part-ry)) - (spawn (-> this part) (-> this root-override trans)) + (spawn (-> this part) (-> this root trans)) ) (none) ) ;; definition for method 26 of type flutflut-plat-large ;; INFO: Return type mismatch float vs none. -(defmethod baseplat-method-26 flutflut-plat-large ((this flutflut-plat-large)) +(defmethod baseplat-method-26 ((this flutflut-plat-large)) (let ((t9-0 (method-of-type flutflut-plat baseplat-method-26))) (t9-0 this) ) - (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root-override quat)))) + (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root quat)))) (none) ) ;; definition for method 24 of type flutflut-plat-large ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 flutflut-plat-large ((this flutflut-plat-large)) +(defmethod baseplat-method-24 ((this flutflut-plat-large)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1103,7 +1083,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc index a39b72d2dca..32d57f1769e 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc @@ -3,16 +3,12 @@ ;; definition of type snowcam (deftype snowcam (pov-camera) - ((seq uint64 :offset-assert 224) + ((seq uint64) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xe8 - :flag-assert #x1e008000e8 ) ;; definition for method 3 of type snowcam -(defmethod inspect snowcam ((this snowcam)) +(defmethod inspect ((this snowcam)) (let ((t9-0 (method-of-type pov-camera inspect))) (t9-0 this) ) @@ -27,7 +23,7 @@ ) ;; definition for method 29 of type snowcam -(defmethod set-stack-size! snowcam ((this snowcam)) +(defmethod set-stack-size! ((this snowcam)) (stack-size-set! (-> this main-thread) 512) (none) ) @@ -115,14 +111,10 @@ ;; definition of type snow-eggtop (deftype snow-eggtop (process-drawable) - ((root-override collide-shape-moving :offset 112) - (spawn-trans vector :inline :offset-assert 176) - (play-sound? symbol :offset-assert 192) + ((root collide-shape-moving :override) + (spawn-trans vector :inline) + (play-sound? symbol) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xc4 - :flag-assert #x14006000c4 (:states snow-eggtop-activate snow-eggtop-idle-down @@ -131,7 +123,7 @@ ) ;; definition for method 3 of type snow-eggtop -(defmethod inspect snow-eggtop ((this snow-eggtop)) +(defmethod inspect ((this snow-eggtop)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -320,7 +312,7 @@ (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) (go snow-eggtop-activate) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (update! (-> self sound)) ) :code (behavior () @@ -377,7 +369,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (let ((v1-7 @@ -458,7 +450,7 @@ ;; definition for method 11 of type snow-eggtop ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-eggtop ((this snow-eggtop) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-eggtop) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -477,17 +469,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-eggtop-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (set! (-> this spawn-trans quad) (-> this root-override trans quad)) - (+! (-> this root-override trans y) -2662.4) - (update-transforms! (-> this root-override)) + (set! (-> this spawn-trans quad) (-> this root trans quad)) + (+! (-> this root trans y) -2662.4) + (update-transforms! (-> this root)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 510) this)) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "electric-loop" :fo-max 40) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "electric-loop" :fo-max 40) (-> this root trans)) ) (cond ((task-complete? *game-info* (-> this entity extra perm task)) @@ -495,7 +487,7 @@ ) (else (let ((a0-17 (new 'stack-no-clear 'vector))) - (set! (-> a0-17 quad) (-> this root-override trans quad)) + (set! (-> a0-17 quad) (-> this root trans quad)) (+! (-> a0-17 y) 3072.0) (birth-pickup-at-point a0-17 @@ -514,16 +506,12 @@ ;; definition of type snowpusher (deftype snowpusher (process-drawable) - ((root-override collide-shape-moving :offset 112) - (max-frame float :offset-assert 176) - (open-sound sound-name :offset-assert 192) - (close-sound sound-name :offset-assert 208) - (sync sync-info-paused :inline :offset-assert 224) + ((root collide-shape-moving :override) + (max-frame float) + (open-sound sound-name) + (close-sound sound-name) + (sync sync-info-paused :inline) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xf0 - :flag-assert #x14008000f0 (:states snowpusher-idle ) @@ -531,7 +519,7 @@ ;; definition for method 3 of type snowpusher ;; INFO: Used lq/sq -(defmethod inspect snowpusher ((this snowpusher)) +(defmethod inspect ((this snowpusher)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -588,7 +576,7 @@ ;; definition for method 11 of type snowpusher ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snowpusher ((this snowpusher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snowpusher) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (logior! (-> this mask) (process-mask enemy platform)) (let ((s3-0 0) @@ -632,7 +620,7 @@ ) (set! (-> s3-1 nav-radius) (* 0.75 (-> s3-1 root-prim local-sphere w))) (backup-collide-with-as s3-1) - (set! (-> this root-override) s3-1) + (set! (-> this root) s3-1) ) ) (process-drawable-from-entity! this arg0) @@ -654,20 +642,16 @@ ;; definition of type snow-spatula (deftype snow-spatula (baseplat) - ((sync sync-info :inline :offset-assert 228) - (startmat matrix :inline :offset-assert 240) + ((sync sync-info :inline) + (startmat matrix :inline) ) - :heap-base #xc0 - :method-count-assert 27 - :size-assert #x130 - :flag-assert #x1b00c00130 (:states snow-spatula-idle ) ) ;; definition for method 3 of type snow-spatula -(defmethod inspect snow-spatula ((this snow-spatula)) +(defmethod inspect ((this snow-spatula)) (let ((t9-0 (method-of-type baseplat inspect))) (t9-0 this) ) @@ -722,7 +706,7 @@ (let ((s5-2 (new 'stack-no-clear 'matrix))) (matrix-rotate-y! s5-2 (* 16384.0 f30-0)) (matrix*! s5-2 s5-2 (-> self startmat)) - (matrix->quaternion (-> self root-override quat) s5-2) + (matrix->quaternion (-> self root quat) s5-2) ) ) (suspend) @@ -734,7 +718,7 @@ ;; definition for method 11 of type snow-spatula ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-spatula ((this snow-spatula) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-spatula) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -754,13 +738,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-spatula-sg* '()) (logior! (-> this skel status) (janim-status inited)) (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) - (quaternion->matrix (-> this startmat) (-> this root-override quat)) + (quaternion->matrix (-> this startmat) (-> this root quat)) (baseplat-method-21 this) (go snow-spatula-idle) (none) @@ -768,16 +752,12 @@ ;; definition of type snow-fort-gate (deftype snow-fort-gate (process-drawable) - ((root-override collide-shape :offset 112) - (part2 sparticle-launch-control :offset-assert 176) - (part3 sparticle-launch-control :offset-assert 180) - (open-trans vector :inline :offset-assert 192) - (closed-trans vector :inline :offset-assert 208) + ((root collide-shape :override) + (part2 sparticle-launch-control) + (part3 sparticle-launch-control) + (open-trans vector :inline) + (closed-trans vector :inline) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xe0 - :flag-assert #x14007000e0 (:states snow-fort-gate-activate snow-fort-gate-idle-closed @@ -786,7 +766,7 @@ ) ;; definition for method 3 of type snow-fort-gate -(defmethod inspect snow-fort-gate ((this snow-fort-gate)) +(defmethod inspect ((this snow-fort-gate)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -990,14 +970,14 @@ ) ) :trans (behavior () - (when (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (when (and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id snow-fort-hint) "sksp0345" (the-as entity #f) *entity-pool* (game-task none)) (close-specific-task! (game-task snow-fort) (task-status need-hint)) ) ) :code (behavior () (ja :group! snow-fort-gate-idle-ja :num! min) - (set! (-> self root-override trans quad) (-> self closed-trans quad)) + (set! (-> self root trans quad) (-> self closed-trans quad)) (transform-post) (suspend) (loop @@ -1026,7 +1006,7 @@ (spawn (-> self part) a1-0) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self root-override trans quad)) + (set! (-> s5-0 quad) (-> self root trans quad)) (let ((f30-0 (vector-vector-distance-squared s5-0 (-> self open-trans)))) (when (and (not gp-0) (>= 1048576.0 f30-0)) (set! gp-0 #t) @@ -1044,10 +1024,10 @@ ) ) (vector-seek-3d-smooth! s5-0 (-> self open-trans) (* 16384.0 (seconds-per-frame)) 0.9) - (move-to-point! (-> self root-override) s5-0) + (move-to-point! (-> self root) s5-0) ) (let ((a1-7 (new 'stack-no-clear 'vector))) - (set! (-> a1-7 quad) (-> self root-override trans quad)) + (set! (-> a1-7 quad) (-> self root trans quad)) (+! (-> a1-7 x) 20480.0) (+! (-> a1-7 y) 106496.0) (+! (-> a1-7 z) -32768.0) @@ -1065,7 +1045,7 @@ (defstate snow-fort-gate-idle-open (snow-fort-gate) :code (behavior () (ja :group! snow-fort-gate-idle-ja :num! min) - (set! (-> self root-override trans quad) (-> self open-trans quad)) + (set! (-> self root trans quad) (-> self open-trans quad)) (transform-post) (suspend) (transform-post) @@ -1077,7 +1057,7 @@ ) ;; definition for method 10 of type snow-fort-gate -(defmethod deactivate snow-fort-gate ((this snow-fort-gate)) +(defmethod deactivate ((this snow-fort-gate)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -1089,7 +1069,7 @@ ) ;; definition for method 7 of type snow-fort-gate -(defmethod relocate snow-fort-gate ((this snow-fort-gate) (arg0 int)) +(defmethod relocate ((this snow-fort-gate) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -1102,7 +1082,7 @@ ;; definition for method 11 of type snow-fort-gate ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-fort-gate ((this snow-fort-gate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-fort-gate) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object)) @@ -1115,14 +1095,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-fort-gate-sg* '()) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 512) this)) (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 513) this)) (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 514) this)) - (set! (-> this open-trans quad) (-> this root-override trans quad)) + (set! (-> this open-trans quad) (-> this root trans quad)) (set! (-> this closed-trans quad) (-> this open-trans quad)) (+! (-> this open-trans y) -141312.0) (+! (-> this open-trans z) 32768.0) @@ -1140,12 +1120,12 @@ ) (cond ((task-complete? *game-info* (game-task snow-ball)) - (set! (-> this root-override trans quad) (-> this open-trans quad)) + (set! (-> this root trans quad) (-> this open-trans quad)) (transform-post) (go snow-fort-gate-idle-open) ) (else - (set! (-> this root-override trans quad) (-> this closed-trans quad)) + (set! (-> this root trans quad) (-> this closed-trans quad)) (transform-post) (go snow-fort-gate-idle-closed) ) @@ -1156,12 +1136,8 @@ ;; definition of type snow-gears (deftype snow-gears (process-drawable) () - :heap-base #x40 - :method-count-assert 21 - :size-assert #xb0 - :flag-assert #x15004000b0 (:methods - (snow-gears-method-20 (_type_) none 20) + (snow-gears-method-20 (_type_) none) ) (:states snow-gears-activate @@ -1172,7 +1148,7 @@ ) ;; definition for method 3 of type snow-gears -(defmethod inspect snow-gears ((this snow-gears)) +(defmethod inspect ((this snow-gears)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1257,7 +1233,7 @@ ;; definition for method 20 of type snow-gears ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod snow-gears-method-20 snow-gears ((this snow-gears)) +(defmethod snow-gears-method-20 ((this snow-gears)) (let ((a1-0 (new 'stack-no-clear 'vector))) (set! (-> a1-0 quad) (-> this root trans quad)) (+! (-> a1-0 y) 61440.0) @@ -1357,7 +1333,7 @@ ;; definition for method 11 of type snow-gears ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-gears ((this snow-gears) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-gears) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-gears-sg* '()) @@ -1371,15 +1347,11 @@ ;; definition of type snow-switch (deftype snow-switch (process-drawable) - ((root-override collide-shape-moving :offset 112) - (pressed? symbol :offset-assert 176) - (fcell-handle handle :offset-assert 184) - (orig-trans vector :inline :offset-assert 192) + ((root collide-shape-moving :override) + (pressed? symbol) + (fcell-handle handle) + (orig-trans vector :inline) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14006000d0 (:states snow-switch-activate snow-switch-idle-down @@ -1388,7 +1360,7 @@ ) ;; definition for method 3 of type snow-switch -(defmethod inspect snow-switch ((this snow-switch)) +(defmethod inspect ((this snow-switch)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1489,7 +1461,7 @@ (let ((s5-1 (new 'stack-no-clear 'vector)) (f0-1 (+ -1433.6 (-> self orig-trans y))) ) - (set! (-> s5-1 quad) (-> self root-override trans quad)) + (set! (-> s5-1 quad) (-> self root trans quad)) (cond ((= (-> s5-1 y) f0-1) (when (not gp-2) @@ -1498,10 +1470,8 @@ ) ) (else - (set! (-> s5-1 y) - (seek-with-smooth (-> self root-override trans y) f0-1 (* 6144.0 (seconds-per-frame)) 0.2 204.8) - ) - (move-to-point! (-> self root-override) s5-1) + (set! (-> s5-1 y) (seek-with-smooth (-> self root trans y) f0-1 (* 6144.0 (seconds-per-frame)) 0.2 204.8)) + (move-to-point! (-> self root) s5-1) ) ) ) @@ -1517,8 +1487,8 @@ :event snow-switch-event-handler :code (behavior () (set! (-> self pressed?) #t) - (set! (-> self root-override trans quad) (-> self orig-trans quad)) - (+! (-> self root-override trans y) -1433.6) + (set! (-> self root trans quad) (-> self orig-trans quad)) + (+! (-> self root trans y) -1433.6) (transform-post) (loop (logior! (-> self mask) (process-mask sleep-code)) @@ -1530,7 +1500,7 @@ ;; definition for method 11 of type snow-switch ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-switch ((this snow-switch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-switch) (arg0 entity-actor)) (set! (-> this pressed?) #f) (set! (-> this fcell-handle) (the-as handle #f)) (set! (-> this link) (new 'process 'actor-link-info this)) @@ -1552,7 +1522,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-switch-sg* '()) @@ -1567,7 +1537,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (set! (-> this orig-trans quad) (-> this root-override trans quad)) + (set! (-> this orig-trans quad) (-> this root trans quad)) (let ((s5-2 (task-complete? *game-info* (game-task snow-ball)))) (set! (-> this pressed?) s5-2) (when (not s5-2) @@ -1596,13 +1566,9 @@ ;; definition of type snow-log (deftype snow-log (process-drawable) - ((root-override collide-shape-moving :offset 112) - (master entity-actor :offset-assert 176) + ((root collide-shape-moving :override) + (master entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states snow-log-activate snow-log-active @@ -1612,7 +1578,7 @@ ) ;; definition for method 3 of type snow-log -(defmethod inspect snow-log ((this snow-log)) +(defmethod inspect ((this snow-log)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1761,7 +1727,7 @@ ;; definition for method 11 of type snow-log ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-log ((this snow-log) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-log) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -1780,16 +1746,16 @@ ) (set! (-> s4-0 nav-radius) 11264.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-log-sg* '()) (logior! (-> this skel status) (janim-status inited)) (logior! (-> this draw status) (draw-status hidden)) - (+! (-> this root-override trans x) -1024.0) - (+! (-> this root-override trans y) -4915.2) - (set-vector! (-> this root-override scale) 1.5 1.0 1.5 1.0) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (+! (-> this root trans x) -1024.0) + (+! (-> this root trans y) -4915.2) + (set-vector! (-> this root scale) 1.5 1.0 1.5 1.0) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (set! (-> this master) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> this draw origin-joint-index) (the-as uint 3)) (go snow-log-wait-for-master) @@ -1798,14 +1764,10 @@ ;; definition of type snow-log-button (deftype snow-log-button (process-drawable) - ((root-override collide-shape-moving :offset 112) - (log entity-actor :offset-assert 176) - (orig-trans vector :inline :offset-assert 192) + ((root collide-shape-moving :override) + (log entity-actor) + (orig-trans vector :inline) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14006000d0 (:states snow-log-button-activate snow-log-button-idle-down @@ -1814,7 +1776,7 @@ ) ;; definition for method 3 of type snow-log-button -(defmethod inspect snow-log-button ((this snow-log-button)) +(defmethod inspect ((this snow-log-button)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1831,7 +1793,7 @@ (('touch 'bonk 'attack) (when (and (= (-> arg0 type) target) (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - (>= 6553.6 (vector-vector-xz-distance (target-pos 0) (-> self root-override trans))) + (>= 6553.6 (vector-vector-xz-distance (target-pos 0) (-> self root trans))) ) (process-entity-status! self (entity-perm-status complete) #t) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1877,7 +1839,7 @@ (sound-play "prec-button1") (loop (let ((f30-0 (+ -1433.6 (-> self orig-trans y)))) - (when (= (-> self root-override trans y) f30-0) + (when (= (-> self root trans y) f30-0) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 0) @@ -1895,8 +1857,8 @@ ) (go snow-log-button-idle-down) ) - (set! (-> self root-override trans y) - (seek-with-smooth (-> self root-override trans y) f30-0 (* 12288.0 (seconds-per-frame)) 0.2 204.8) + (set! (-> self root trans y) + (seek-with-smooth (-> self root trans y) f30-0 (* 12288.0 (seconds-per-frame)) 0.2 204.8) ) ) (suspend) @@ -1909,8 +1871,8 @@ (defstate snow-log-button-idle-down (snow-log-button) :event snow-log-button-event-handler :code (behavior () - (set! (-> self root-override trans quad) (-> self orig-trans quad)) - (+! (-> self root-override trans y) -1433.6) + (set! (-> self root trans quad) (-> self orig-trans quad)) + (+! (-> self root trans y) -1433.6) (transform-post) (loop (logior! (-> self mask) (process-mask sleep-code)) @@ -1922,7 +1884,7 @@ ;; definition for method 11 of type snow-log-button ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-log-button ((this snow-log-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this snow-log-button) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -1941,7 +1903,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *snow-switch-sg* '()) @@ -1956,7 +1918,7 @@ (set! (-> s4-1 frame-num) 0.0) ) (transform-post) - (set! (-> this orig-trans quad) (-> this root-override trans quad)) + (set! (-> this orig-trans quad) (-> this root trans quad)) (set! (-> this log) (entity-actor-lookup arg0 'alt-actor 0)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go snow-log-button-idle-down) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-part_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-part_REF.gc index 002edc447ee..e48f3fae6b9 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type snow-part (deftype snow-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type snow-part -(defmethod inspect snow-part ((this snow-part)) +(defmethod inspect ((this snow-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc index 11ca31f1009..c8554b99b23 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc @@ -3,18 +3,14 @@ ;; definition of type ram-boss-proj (deftype ram-boss-proj (projectile) - ((parent-override (pointer ram-boss) :offset 12) - (part2 sparticle-launch-control :offset-assert 412) - (launched? symbol :offset-assert 416) - (growth float :offset-assert 420) - (charge-sound-id sound-id :offset-assert 424) - (launch-time time-frame :offset-assert 432) - (facing-dir vector :inline :offset-assert 448) + ((parent-override (pointer ram-boss) :overlay-at parent) + (part2 sparticle-launch-control) + (launched? symbol) + (growth float) + (charge-sound-id sound-id) + (launch-time time-frame) + (facing-dir vector :inline) ) - :heap-base #x160 - :method-count-assert 29 - :size-assert #x1d0 - :flag-assert #x1d016001d0 (:states ram-boss-proj-growing ram-boss-proj-launch @@ -22,7 +18,7 @@ ) ;; definition for method 3 of type ram-boss-proj -(defmethod inspect ram-boss-proj ((this ram-boss-proj)) +(defmethod inspect ((this ram-boss-proj)) (let ((t9-0 (method-of-type projectile inspect))) (t9-0 this) ) @@ -37,30 +33,26 @@ ;; definition of type ram-boss (deftype ram-boss (nav-enemy) - ((parent-override (pointer ram) :offset 12) - (facing-y float :offset-assert 400) - (player-dir-y float :offset-assert 404) - (last-turn-speed float :offset-assert 408) - (frustration int32 :offset-assert 412) - (dead? symbol :offset-assert 416) - (has-shield? symbol :offset-assert 420) - (proj-stoked basic :offset-assert 424) - (proj-status uint64 :offset-assert 432) - (part2 sparticle-launch-control :offset-assert 440) - (proj-last-thrown-time time-frame :offset-assert 448) - (nav-enemy-patrol-timeout time-frame :offset-assert 456) - (proj-launch-vec vector :inline :offset-assert 464) - (local-throw-point vector :inline :offset-assert 480) - (shield-jmod joint-mod-set-local :offset-assert 496) + ((parent-override (pointer ram) :overlay-at parent) + (facing-y float) + (player-dir-y float) + (last-turn-speed float) + (frustration int32) + (dead? symbol) + (has-shield? symbol) + (proj-stoked basic) + (proj-status uint64) + (part2 sparticle-launch-control) + (proj-last-thrown-time time-frame) + (nav-enemy-patrol-timeout time-frame) + (proj-launch-vec vector :inline) + (local-throw-point vector :inline) + (shield-jmod joint-mod-set-local) ) - :heap-base #x190 - :method-count-assert 76 - :size-assert #x1f4 - :flag-assert #x4c019001f4 (:methods - (ram-boss-method-51 (_type_ vector) symbol :replace 51) - (ram-boss-method-52 (_type_) symbol :replace 52) - (ram-boss-method-57 (_type_ float) float :replace 57) + (ram-boss-method-51 (_type_ vector) symbol :overlay-at nav-enemy-method-51) + (ram-boss-method-52 (_type_) symbol :overlay-at nav-enemy-method-52) + (ram-boss-method-57 (_type_ float) float :overlay-at nav-enemy-method-57) ) (:states (ram-boss-already-down basic) @@ -79,7 +71,7 @@ ) ;; definition for method 3 of type ram-boss -(defmethod inspect ram-boss ((this ram-boss)) +(defmethod inspect ((this ram-boss)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -503,21 +495,13 @@ ;; definition for method 24 of type ram-boss-proj ;; INFO: Return type mismatch sound-id vs none. -(defmethod projectile-method-24 ram-boss-proj ((this ram-boss-proj)) +(defmethod projectile-method-24 ((this ram-boss-proj)) (with-pp - (quaternion-rotate-local-x! - (-> this root-override quat) - (-> this root-override quat) - (* 65718.05 (seconds-per-frame)) - ) - (quaternion-rotate-local-y! - (-> this root-override quat) - (-> this root-override quat) - (* 32221.867 (seconds-per-frame)) - ) + (quaternion-rotate-local-x! (-> this root quat) (-> this root quat) (* 65718.05 (seconds-per-frame))) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) (* 32221.867 (seconds-per-frame))) (let ((f0-9 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (current-time) 75))))))))) (find-ground-and-draw-shadow - (-> this root-override trans) + (-> this root trans) (the-as vector #f) f0-9 (collide-kind background) @@ -527,12 +511,12 @@ ) ) (if (-> this launched?) - (spawn (-> this part2) (the-as vector (-> this root-override root-prim prim-core))) + (spawn (-> this part2) (the-as vector (-> this root root-prim prim-core))) ) (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) (set! (-> s5-0 id) (-> this sound-id)) - (let ((a1-4 (-> this root-override trans))) + (let ((a1-4 (-> this root trans))) (let ((gp-1 pp)) (when (= a1-4 #t) (if (and gp-1 (type-type? (-> gp-1 type) process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root))) @@ -554,14 +538,14 @@ ;; INFO: Return type mismatch int vs none. (defun snow-ram-proj-update-velocity ((arg0 ram-boss-proj)) (when (>= (vector-vector-distance (-> arg0 parent-override 0 collide-info trans) (-> arg0 target)) - (vector-vector-distance (-> arg0 parent-override 0 collide-info trans) (-> arg0 root-override trans)) + (vector-vector-distance (-> arg0 parent-override 0 collide-info trans) (-> arg0 root trans)) ) - (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target) (-> arg0 root-override trans))) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> arg0 target) (-> arg0 root trans))) (s4-0 (new 'stack-no-clear 'vector)) - (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root-override transv) 1.0)) + (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 root transv) 1.0)) ) - (if (logtest? (-> arg0 root-override status) (cshape-moving-flags tsurf)) - (vector-flatten! s3-1 s3-1 (-> arg0 root-override local-normal)) + (if (logtest? (-> arg0 root status) (cshape-moving-flags tsurf)) + (vector-flatten! s3-1 s3-1 (-> arg0 root local-normal)) ) (vector-normalize-copy! s4-0 s3-1 1.0) (let ((s3-2 (new 'stack-no-clear 'matrix))) @@ -575,7 +559,7 @@ (vector-matrix*! s5-0 s5-0 s3-2) ) (vector-normalize! s5-0 1.0) - (vector-float*! (-> arg0 root-override transv) s5-0 (-> arg0 max-speed)) + (vector-float*! (-> arg0 root transv) s5-0 (-> arg0 max-speed)) ) ) 0 @@ -584,7 +568,7 @@ ;; definition for method 25 of type ram-boss-proj ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-25 ram-boss-proj ((this ram-boss-proj)) +(defmethod projectile-method-25 ((this ram-boss-proj)) (go ram-boss-proj-growing) 0 (none) @@ -592,7 +576,7 @@ ;; definition for method 26 of type ram-boss-proj ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-26 ram-boss-proj ((this ram-boss-proj)) +(defmethod projectile-method-26 ((this ram-boss-proj)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) @@ -612,7 +596,7 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -620,7 +604,7 @@ ;; definition for method 27 of type ram-boss-proj ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-27 ram-boss-proj ((this ram-boss-proj)) +(defmethod projectile-method-27 ((this ram-boss-proj)) (set! (-> this charge-sound-id) (new 'static 'sound-id)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 521) this)) (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 522) this)) @@ -642,7 +626,7 @@ ) ;; definition for method 10 of type ram-boss-proj -(defmethod deactivate ram-boss-proj ((this ram-boss-proj)) +(defmethod deactivate ((this ram-boss-proj)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -652,7 +636,7 @@ ;; definition for method 7 of type ram-boss-proj ;; INFO: Return type mismatch projectile vs ram-boss-proj. -(defmethod relocate ram-boss-proj ((this ram-boss-proj) (arg0 int)) +(defmethod relocate ((this ram-boss-proj) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -662,7 +646,7 @@ ;; definition for method 28 of type ram-boss-proj ;; INFO: Used lq/sq ;; INFO: Return type mismatch vector vs none. -(defmethod projectile-method-28 ram-boss-proj ((this ram-boss-proj)) +(defmethod projectile-method-28 ((this ram-boss-proj)) (when (and *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) @@ -672,7 +656,7 @@ (let ((gp-0 (-> this target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (+! (-> gp-0 y) 4915.2) - (let ((f0-2 (vector-vector-distance gp-0 (-> this root-override trans))) + (let ((f0-2 (vector-vector-distance gp-0 (-> this root trans))) (a2-0 (new 'stack-no-clear 'vector)) ) (if (>= 0.0 f0-2) @@ -713,8 +697,8 @@ (sound-stop (-> self charge-sound-id)) (go-virtual projectile-dissipate) ) - (nav-enemy-method-54 (-> gp-1 0) (-> self root-override trans)) - (update-transforms! (-> self root-override)) + (nav-enemy-method-54 (-> gp-1 0) (-> self root trans)) + (update-transforms! (-> self root)) (cond ((-> gp-1 0 proj-stoked) (set! (-> gp-1 0 proj-stoked) #f) @@ -734,9 +718,9 @@ ) ) (let ((f0-6 (-> self growth))) - (set-vector! (-> self root-override scale) f0-6 f0-6 f0-6 1.0) + (set-vector! (-> self root scale) f0-6 f0-6 f0-6 1.0) ) - (spawn (-> self part) (-> self root-override trans)) + (spawn (-> self part) (-> self root trans)) (suspend) ) ) @@ -748,9 +732,9 @@ (sound-play "ramboss-fire") (set! (-> self launched?) #t) (set! (-> self growth) 1.0) - (logior! (-> self root-override root-prim prim-core action) (collide-action solid)) + (logior! (-> self root root-prim prim-core action) (collide-action solid)) (set-time! (-> self launch-time)) - (vector-float*! (-> self root-override transv) (-> self parent-override 0 proj-launch-vec) 40960.0) + (vector-float*! (-> self root transv) (-> self parent-override 0 proj-launch-vec) 40960.0) (set! (-> self target quad) (-> (target-pos 0) quad)) (+! (-> self target y) 4915.2) (set! (-> self target-base quad) (-> self target quad)) @@ -770,7 +754,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (if (nonzero? (-> self sound-id)) @@ -794,7 +778,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (if (nonzero? (-> self sound-id)) @@ -1047,7 +1031,7 @@ ) ;; definition for method 10 of type ram-boss -(defmethod deactivate ram-boss ((this ram-boss)) +(defmethod deactivate ((this ram-boss)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -1057,7 +1041,7 @@ ;; definition for method 7 of type ram-boss ;; INFO: Return type mismatch nav-enemy vs ram-boss. -(defmethod relocate ram-boss ((this ram-boss) (arg0 int)) +(defmethod relocate ((this ram-boss) (arg0 int)) (if (nonzero? (-> this shield-jmod)) (&+! (-> this shield-jmod) arg0) ) @@ -1069,7 +1053,7 @@ ;; definition for method 47 of type ram-boss ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision ram-boss ((this ram-boss)) +(defmethod initialize-collision ((this ram-boss)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1124,7 +1108,7 @@ ;; definition for method 52 of type ram-boss ;; INFO: Return type mismatch vector vs symbol. -(defmethod ram-boss-method-52 ram-boss ((this ram-boss)) +(defmethod ram-boss-method-52 ((this ram-boss)) (let ((v1-1 (the-as basic (-> this collide-info root-prim)))) (set-vector! (-> (the-as collide-shape-prim v1-1) local-sphere) 0.0 8192.0 0.0 13516.8) (set-vector! (-> (the-as (array collide-shape-prim) v1-1) 16 local-sphere) 0.0 4096.0 0.0 4505.6) @@ -1147,7 +1131,7 @@ ;; definition for method 53 of type ram-boss ;; INFO: Return type mismatch int vs symbol. -(defmethod nav-enemy-method-53 ram-boss ((this ram-boss)) +(defmethod nav-enemy-method-53 ((this ram-boss)) (let ((v1-1 (the-as (array collide-shape-prim) (-> this collide-info root-prim)))) (let ((a0-1 (-> v1-1 16))) (set! (-> a0-1 prim-core offense) (collide-offense touch)) @@ -1171,7 +1155,7 @@ ;; definition for method 48 of type ram-boss ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 ram-boss ((this ram-boss)) +(defmethod nav-enemy-method-48 ((this ram-boss)) (initialize-skeleton this *ram-boss-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) (init-defaults! this *ram-boss-nav-enemy-info*) @@ -1232,7 +1216,7 @@ ;; definition for method 54 of type ram-boss ;; INFO: Return type mismatch vector vs symbol. -(defmethod nav-enemy-method-54 ram-boss ((this ram-boss) (arg0 vector)) +(defmethod nav-enemy-method-54 ((this ram-boss) (arg0 vector)) (let ((a2-0 (-> this node-list data 18 bone transform))) (set-vector! arg0 0.0 0.0 -2457.6 1.0) (vector-matrix*! arg0 arg0 a2-0) @@ -1242,7 +1226,7 @@ ;; definition for method 55 of type ram-boss ;; INFO: Used lq/sq -(defmethod nav-enemy-method-55 ram-boss ((this ram-boss)) +(defmethod nav-enemy-method-55 ((this ram-boss)) (if (not *target*) (return #f) ) @@ -1279,7 +1263,7 @@ ) ;; definition for method 51 of type ram-boss -(defmethod ram-boss-method-51 ram-boss ((this ram-boss) (arg0 vector)) +(defmethod ram-boss-method-51 ((this ram-boss) (arg0 vector)) (let* ((f30-0 (quaternion-y-angle (-> this collide-info quat))) (f0-2 (atan (-> arg0 x) (-> arg0 z))) (f0-3 (deg- f30-0 f0-2)) @@ -1297,7 +1281,7 @@ ;; definition for method 56 of type ram-boss ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod set-jump-height-factor! ram-boss ((this ram-boss) (arg0 int)) +(defmethod set-jump-height-factor! ((this ram-boss) (arg0 int)) (cond ((zero? (-> this proj-status)) (when (and *target* (time-elapsed? (-> this proj-last-thrown-time) (seconds 2))) @@ -1609,7 +1593,7 @@ ) ;; definition for method 57 of type ram-boss -(defmethod ram-boss-method-57 ram-boss ((this ram-boss) (arg0 float)) +(defmethod ram-boss-method-57 ((this ram-boss) (arg0 float)) (let ((f0-0 0.0)) (when *target* (let ((s3-0 (new 'stack-no-clear 'vector))) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ram-h_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ram-h_REF.gc index 04c62789d4c..f9583bdb02c 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ram-h_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ram-h_REF.gc @@ -3,22 +3,18 @@ ;; definition of type ram (deftype ram (process-drawable) - ((root-override collide-shape-moving :offset 112) - (ram-id int32 :offset-assert 176) - (give-fuel-cell? symbol :offset-assert 180) - (give-fuel-cell-anim spool-anim :offset-assert 184) - (part2 sparticle-launch-control :offset-assert 188) - (orient-ry float :offset-assert 192) - (fuel-cell-dest-pos vector :inline :offset-assert 208) + ((root collide-shape-moving :override) + (ram-id int32) + (give-fuel-cell? symbol) + (give-fuel-cell-anim spool-anim) + (part2 sparticle-launch-control) + (orient-ry float) + (fuel-cell-dest-pos vector :inline) ) - :heap-base #x70 - :method-count-assert 23 - :size-assert #xe0 - :flag-assert #x17007000e0 (:methods - (ram-method-20 (_type_) object 20) - (ram-method-21 (_type_) object 21) - (ram-method-22 (_type_) symbol 22) + (ram-method-20 (_type_) object) + (ram-method-21 (_type_) object) + (ram-method-22 (_type_) symbol) ) (:states ram-fun-idle @@ -28,7 +24,7 @@ ) ;; definition for method 3 of type ram -(defmethod inspect ram ((this ram)) +(defmethod inspect ((this ram)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ram_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ram_REF.gc index 9b6d57887fe..bd43dcbb9aa 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ram_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ram_REF.gc @@ -109,7 +109,7 @@ ) ;; definition for method 20 of type ram -(defmethod ram-method-20 ram ((this ram)) +(defmethod ram-method-20 ((this ram)) (let ((gp-0 (-> this part))) (when (nonzero? gp-0) (let ((a2-0 (-> this node-list data 8 bone transform)) @@ -125,7 +125,7 @@ ) ;; definition for method 21 of type ram -(defmethod ram-method-21 ram ((this ram)) +(defmethod ram-method-21 ((this ram)) (let ((gp-0 (-> this part2))) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -157,7 +157,7 @@ ) ;; definition for method 22 of type ram -(defmethod ram-method-22 ram ((this ram)) +(defmethod ram-method-22 ((this ram)) (process-entity-status! this (entity-perm-status complete) #t) (let ((v1-0 (alt-actor-list-subtask-incomplete-count this))) (cond @@ -188,7 +188,7 @@ (('touch 'attack) (if ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (-> self root-override) + (-> self root) (the-as uint 1) ) (send-event @@ -241,7 +241,7 @@ (logior! (-> self mask) (process-mask actor-pause)) (set! sv-16 (the-as symbol #f)) (apply-function-forward (-> self link) actor-link-dead-hook (& sv-16)) - (when (or sv-16 (nonzero? (-> self root-override riders num-riders))) + (when (or sv-16 (nonzero? (-> self root riders num-riders))) (let ((v1-67 (-> self entity extra perm))) (logior! (-> v1-67 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-67 user-int8 0) 1) @@ -311,7 +311,7 @@ (let ((v1-14 (process-spawn snowcam :init pov-camera-init-by-other - (-> self root-override trans) + (-> self root trans) *snowcam-sg* (-> self give-fuel-cell-anim) 0 @@ -333,7 +333,7 @@ ) ;; definition for method 10 of type ram -(defmethod deactivate ram ((this ram)) +(defmethod deactivate ((this ram)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -343,7 +343,7 @@ ;; definition for method 7 of type ram ;; INFO: Return type mismatch process-drawable vs ram. -(defmethod relocate ram ((this ram) (arg0 int)) +(defmethod relocate ((this ram) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -352,7 +352,7 @@ ;; definition for method 11 of type ram ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ram ((this ram) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ram) (arg0 entity-actor)) (set! (-> this give-fuel-cell?) #f) (set! (-> this link) (new 'process 'actor-link-info this)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) @@ -397,15 +397,15 @@ ) (set! (-> s4-0 nav-radius) 20480.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *ram-sg* '()) (logior! (-> this skel status) (janim-status inited)) (ja-post) - (update-transforms! (-> this root-override)) - (set! (-> this orient-ry) (quaternion-y-angle (-> this root-override quat))) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (update-transforms! (-> this root)) + (set! (-> this orient-ry) (quaternion-y-angle (-> this root quat))) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 526) this)) (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 527) this)) (set! (-> this ram-id) (res-lump-value arg0 'extra-id int)) diff --git a/test/decompiler/reference/jak1/levels/snow/target-snowball_REF.gc b/test/decompiler/reference/jak1/levels/snow/target-snowball_REF.gc index e20a00ac570..b6757697932 100644 --- a/test/decompiler/reference/jak1/levels/snow/target-snowball_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/target-snowball_REF.gc @@ -3,15 +3,12 @@ ;; definition of type snowball-info (deftype snowball-info (basic) - ((entity basic :offset-assert 4) + ((entity basic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type snowball-info -(defmethod inspect snowball-info ((this snowball-info)) +(defmethod inspect ((this snowball-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tentity: ~A~%" (-> this entity)) this @@ -20,13 +17,10 @@ ;; definition of type snowball-bank (deftype snowball-bank (basic) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type snowball-bank -(defmethod inspect snowball-bank ((this snowball-bank)) +(defmethod inspect ((this snowball-bank)) (format #t "[~8x] ~A~%" this (-> this type)) this ) diff --git a/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc b/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc index c67589370a5..2bb15d9efe6 100644 --- a/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc @@ -3,13 +3,9 @@ ;; definition of type yeti-slave (deftype yeti-slave (nav-enemy) - ((ground-y float :offset-assert 400) - (part2 sparticle-launch-control :offset-assert 404) + ((ground-y float) + (part2 sparticle-launch-control) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x198 - :flag-assert #x4c01300198 (:states yeti-slave-appear-jump-up yeti-slave-appear-land @@ -18,7 +14,7 @@ ) ;; definition for method 3 of type yeti-slave -(defmethod inspect yeti-slave ((this yeti-slave)) +(defmethod inspect ((this yeti-slave)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -29,21 +25,17 @@ ;; definition of type yeti (deftype yeti (process-drawable) - ((child-process (pointer yeti-slave) :offset 20) - (desired-num-children int32 :offset-assert 176) - (spawn-delay int32 :offset-assert 180) - (first-time-spawn-dist float :offset-assert 184) - (unknown basic :offset-assert 188) - (unknown1 basic :offset-assert 192) - (unknown2 basic :offset-assert 196) + ((child-process (pointer yeti-slave) :overlay-at child) + (desired-num-children int32) + (spawn-delay int32) + (first-time-spawn-dist float) + (unknown basic) + (unknown1 basic) + (unknown2 basic) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16006000c8 (:methods - (yeti-method-20 (_type_ vector vector) symbol 20) - (aggro? (_type_ vector) symbol 21) + (yeti-method-20 (_type_ vector vector) symbol) + (aggro? (_type_ vector) symbol) ) (:states yeti-first-time-start @@ -53,7 +45,7 @@ ) ;; definition for method 3 of type yeti -(defmethod inspect yeti ((this yeti)) +(defmethod inspect ((this yeti)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -502,7 +494,7 @@ ;; definition for method 47 of type yeti-slave ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision yeti-slave ((this yeti-slave)) +(defmethod initialize-collision ((this yeti-slave)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -551,7 +543,7 @@ ;; definition for method 48 of type yeti-slave ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 yeti-slave ((this yeti-slave)) +(defmethod nav-enemy-method-48 ((this yeti-slave)) (initialize-skeleton this *yeti-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) (init-defaults! this *yeti-nav-enemy-info*) @@ -563,7 +555,7 @@ ) ;; definition for method 10 of type yeti-slave -(defmethod deactivate yeti-slave ((this yeti-slave)) +(defmethod deactivate ((this yeti-slave)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -572,7 +564,7 @@ ) ;; definition for method 7 of type yeti-slave -(defmethod relocate yeti-slave ((this yeti-slave) (arg0 int)) +(defmethod relocate ((this yeti-slave) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -599,7 +591,7 @@ ) ;; definition for method 21 of type yeti -(defmethod aggro? yeti ((this yeti) (arg0 vector)) +(defmethod aggro? ((this yeti) (arg0 vector)) (let ((s5-0 (the-as (pointer process-tree) (-> this child-process)))) (while s5-0 (if (< (vector-vector-xz-distance-squared arg0 (-> (the-as (pointer yeti-slave) s5-0) 0 collide-info trans)) @@ -619,7 +611,7 @@ ) ;; definition for method 20 of type yeti -(defmethod yeti-method-20 yeti ((this yeti) (arg0 vector) (arg1 vector)) +(defmethod yeti-method-20 ((this yeti) (arg0 vector) (arg1 vector)) (let ((s3-0 (-> this path curve num-cverts))) (if (<= s3-0 0) (return #f) @@ -736,7 +728,7 @@ ;; definition for method 11 of type yeti ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! yeti ((this yeti) (arg0 entity-actor)) +(defmethod init-from-entity! ((this yeti) (arg0 entity-actor)) (set! (-> this spawn-delay) 0) (set! (-> this root) (new 'process 'trsqv)) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) diff --git a/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc b/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc index c8f213afb1e..7272e06b5dc 100644 --- a/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc @@ -3,19 +3,15 @@ ;; definition of type bully-broken-cage (deftype bully-broken-cage (process-drawable) - ((parent-override (pointer bully) :offset 12) + ((parent-override (pointer bully) :overlay-at parent) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states bully-broken-cage-explode ) ) ;; definition for method 3 of type bully-broken-cage -(defmethod inspect bully-broken-cage ((this bully-broken-cage)) +(defmethod inspect ((this bully-broken-cage)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -24,28 +20,24 @@ ;; definition of type bully (deftype bully (process-drawable) - ((root-override collide-shape-moving :offset 112) - (fact-override fact-info-enemy :offset 144) - (hit-player? symbol :offset-assert 176) - (bounced? symbol :offset-assert 180) - (bounce-volume int32 :offset-assert 184) - (facing-ry float :offset-assert 188) - (travel-ry float :offset-assert 192) - (speed-u float :offset-assert 196) - (spin-vel float :offset-assert 200) - (travel-speed float :offset-assert 204) - (reaction-delay time-frame :offset-assert 208) - (start-spin-time time-frame :offset-assert 216) - (slow-down time-frame :offset-assert 224) - (hit-player-time time-frame :offset-assert 232) - (neck joint-mod :offset-assert 240) + ((root collide-shape-moving :override) + (fact fact-info-enemy :override) + (hit-player? symbol) + (bounced? symbol) + (bounce-volume int32) + (facing-ry float) + (travel-ry float) + (speed-u float) + (spin-vel float) + (travel-speed float) + (reaction-delay time-frame) + (start-spin-time time-frame) + (slow-down time-frame) + (hit-player-time time-frame) + (neck joint-mod) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #xf4 - :flag-assert #x15009000f4 (:methods - (bully-method-20 (_type_) float 20) + (bully-method-20 (_type_) float) ) (:states bully-die @@ -57,7 +49,7 @@ ) ;; definition for method 3 of type bully -(defmethod inspect bully ((this bully)) +(defmethod inspect ((this bully)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -268,9 +260,9 @@ (defbehavior bully-broken-cage-init-by-other bully-broken-cage ((arg0 entity-actor)) (set! (-> self entity) arg0) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> self parent-override 0 root-override trans quad)) - (quaternion-copy! (-> self root quat) (-> self parent-override 0 root-override quat)) - (set! (-> self root scale quad) (-> self parent-override 0 root-override scale quad)) + (set! (-> self root trans quad) (-> self parent-override 0 root trans quad)) + (quaternion-copy! (-> self root quat) (-> self parent-override 0 root quat)) + (set! (-> self root scale quad) (-> self parent-override 0 root scale quad)) (initialize-skeleton self *bully-broken-cage-sg* '()) (go bully-broken-cage-explode) (none) @@ -286,7 +278,7 @@ (cond ((= (-> arg0 type) bully) (let ((v1-3 (new 'stack-no-clear 'vector))) - (vector-! v1-3 (-> self root-override trans) (-> (the-as process-drawable arg0) root trans)) + (vector-! v1-3 (-> self root trans) (-> (the-as process-drawable arg0) root trans)) (set! (-> self travel-ry) (atan (-> v1-3 x) (-> v1-3 z))) ) (set! (-> self bounced?) #t) @@ -303,13 +295,13 @@ ) ((or (= arg2 'touch) (= arg2 'attack)) (cond - ((>= (- (-> (target-pos 0) y) (-> self root-override trans y)) 6144.0) + ((>= (- (-> (target-pos 0) y) (-> self root trans y)) 6144.0) (let* ((f0-6 (fmax 0.6 (* 0.000023935356 (-> self travel-speed)))) (f28-0 (* 8192.0 f0-6)) (f30-0 (* 8192.0 f0-6)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector-! s4-0 (target-pos 0) (-> self root-override trans)) + (vector-! s4-0 (target-pos 0) (-> self root trans)) (let ((f26-0 (atan (-> s4-0 x) (-> s4-0 z)))) (when (< 0.0 (-> self travel-speed)) (let ((f0-11 (deg- f26-0 (-> self travel-ry)))) @@ -358,7 +350,7 @@ (set! (-> self bounced?) #t) (set! (-> self bounce-volume) 100) (set-time! (-> self hit-player-time)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) + (set-collide-offense (-> self root) 2 (collide-offense no-offense)) ) ) ) @@ -408,7 +400,7 @@ ) ) ) - (set-collide-offense (-> self root-override) 2 (collide-offense normal-attack)) + (set-collide-offense (-> self root) 2 (collide-offense normal-attack)) (set! (-> self hit-player?) #f) ) (transform-post) @@ -417,7 +409,7 @@ ;; definition for method 20 of type bully ;; INFO: Used lq/sq -(defmethod bully-method-20 bully ((this bully)) +(defmethod bully-method-20 ((this bully)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -425,7 +417,7 @@ ) (init-vf0-vector) (set-vector! - (-> this root-override transv) + (-> this root transv) (* (sin (-> this travel-ry)) (-> this travel-speed)) 0.0 (* (cos (-> this travel-ry)) (-> this travel-speed)) @@ -434,7 +426,7 @@ (let ((s5-1 #f)) (nav-control-method-28 (-> this nav) (collide-kind wall-object ground-object)) (let ((v1-4 (-> this nav travel))) - (.lvf vf1 (&-> (-> this root-override transv) quad)) + (.lvf vf1 (&-> (-> this root transv) quad)) (let ((f0-8 (seconds-per-frame))) (.mov at-0 f0-8) ) @@ -449,34 +441,33 @@ (set! (-> s5-2 quad) (-> s4-0 normal quad)) (set! (-> s5-2 y) 0.0) (vector-normalize! s5-2 1.0) - (vector-reflect! (-> this root-override transv) (-> this root-override transv) s5-2) + (vector-reflect! (-> this root transv) (-> this root transv) s5-2) ) - (set! (-> this travel-ry) (atan (-> this root-override transv x) (-> this root-override transv z))) + (set! (-> this travel-ry) (atan (-> this root transv x) (-> this root transv z))) (+! (-> this travel-ry) (rand-vu-float-range -910.2222 910.2222)) - (vector-reset! (-> this root-override transv)) + (vector-reset! (-> this root transv)) (set! s5-1 #t) (set! (-> this bounced?) #t) (set! (-> this bounce-volume) 100) ) ) (when (not s5-1) - (vector-normalize-copy! (-> this nav travel) (-> this root-override transv) 2048.0) + (vector-normalize-copy! (-> this nav travel) (-> this root transv) 2048.0) (let ((s5-3 (new 'stack 'clip-travel-vector-to-mesh-return-info))) (nav-control-method-24 (-> this nav) 2048.0 s5-3) - (when (and (-> s5-3 found-boundary) - (>= (* (-> this travel-speed) (seconds-per-frame)) - (vector-vector-xz-distance (-> s5-3 intersection) (-> this root-override trans)) - ) + (when (and (-> s5-3 found-boundary) (>= (* (-> this travel-speed) (seconds-per-frame)) + (vector-vector-xz-distance (-> s5-3 intersection) (-> this root trans)) + ) ) (let ((s4-1 (new 'stack-no-clear 'vector))) (vector-negate! s4-1 (-> s5-3 boundary-normal)) (set! (-> s4-1 y) 0.0) (vector-normalize! s4-1 1.0) - (vector-reflect! (-> this root-override transv) (-> this root-override transv) s4-1) + (vector-reflect! (-> this root transv) (-> this root transv) s4-1) ) - (set! (-> this travel-ry) (atan (-> this root-override transv x) (-> this root-override transv z))) + (set! (-> this travel-ry) (atan (-> this root transv x) (-> this root transv z))) (+! (-> this travel-ry) (rand-vu-float-range -910.2222 910.2222)) - (vector-reset! (-> this root-override transv)) + (vector-reset! (-> this root transv)) #t (set! (-> this bounced?) #t) (set! (-> this bounce-volume) 60) @@ -484,7 +475,7 @@ ) ) ) - (set! (-> this root-override transv y) (+ -36864.0 (-> this root-override transv y))) + (set! (-> this root transv y) (+ -36864.0 (-> this root transv y))) ) ) @@ -508,9 +499,8 @@ 0 ) :trans (behavior () - (when (and (and *target* (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (when (and (and *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (time-elapsed? (-> self state-time) (-> self reaction-delay)) ) @@ -542,7 +532,7 @@ (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -553,18 +543,18 @@ :code (behavior () (set! (-> self travel-speed) 0.0) (ja-channel-push! 1 (seconds 0.075)) - (set-vector! (-> self root-override transv) 0.0 (rand-vu-float-range 61440.0 90112.0) 0.0 1.0) + (set-vector! (-> self root transv) 0.0 (rand-vu-float-range 61440.0 90112.0) 0.0 1.0) (ja-no-eval :group! bully-notice-jump-up-ja :num! (seek! (ja-aframe 13.0 0)) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek! (ja-aframe 13.0 0))) ) - (until (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) + (until (logtest? (-> self root status) (cshape-moving-flags onsurf)) (ja :num! (seek!)) - (+! (-> self root-override transv y) (* -545996.8 (seconds-per-frame))) + (+! (-> self root transv y) (* -545996.8 (seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! - (-> self root-override) - (-> self root-override transv) + (-> self root) + (-> self root transv) (collide-kind background) 12288.0 #f @@ -573,10 +563,10 @@ ) (when *target* (let ((gp-3 (new 'stack-no-clear 'vector))) - (vector-! gp-3 (target-pos 0) (-> self root-override trans)) - (seek-toward-heading-vec! (-> self root-override) gp-3 524288.0 (seconds 0.1)) + (vector-! gp-3 (target-pos 0) (-> self root trans)) + (seek-toward-heading-vec! (-> self root) gp-3 524288.0 (seconds 0.1)) ) - (set! (-> self facing-ry) (quaternion-y-angle (-> self root-override quat))) + (set! (-> self facing-ry) (quaternion-y-angle (-> self root quat))) ) (suspend) ) @@ -601,8 +591,8 @@ (set! (-> self bounced?) #f) (let ((gp-0 (new 'stack-no-clear 'vector))) (if *target* - (vector-! gp-0 (target-pos 0) (-> self root-override trans)) - (vector-z-quaternion! gp-0 (-> self root-override quat)) + (vector-! gp-0 (target-pos 0) (-> self root trans)) + (vector-z-quaternion! gp-0 (-> self root quat)) ) (set! (-> self travel-ry) (atan (-> gp-0 x) (-> gp-0 z))) ) @@ -613,7 +603,7 @@ (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -634,11 +624,11 @@ (set! (-> self spin-vel) (* 196608.0 (-> self speed-u))) (set! (-> self travel-speed) (* 41779.2 (-> self speed-u))) (+! (-> self facing-ry) (* (-> self spin-vel) (seconds-per-frame))) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> self facing-ry)) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (-> self facing-ry)) (bully-method-20 self) (integrate-for-enemy-with-move-to-ground! - (-> self root-override) - (-> self root-override transv) + (-> self root) + (-> self root transv) (collide-kind background) 8192.0 #f @@ -698,7 +688,7 @@ (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -742,9 +732,8 @@ ) ) ) - (if (or (not *target*) (< (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (or (not *target*) + (< (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (go bully-idle #f) ) @@ -760,9 +749,9 @@ (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) (process-spawn bully-broken-cage (-> self entity) :to self) - (spawn (-> self part) (-> self root-override trans)) - (clear-collide-with-as (-> self root-override)) - (drop-pickup (-> self fact-override) #t *entity-pool* (-> self fact-override) 0) + (spawn (-> self part) (-> self root trans)) + (clear-collide-with-as (-> self root)) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0) (ja-channel-push! 1 (seconds 0.075)) (ja-no-eval :group! bully-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -779,7 +768,7 @@ ) ;; definition for method 7 of type bully -(defmethod relocate bully ((this bully) (arg0 int)) +(defmethod relocate ((this bully) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) @@ -788,7 +777,7 @@ ;; definition for method 11 of type bully ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! bully ((this bully) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bully) (arg0 entity-actor)) (set! (-> this hit-player?) #f) (set! (-> this bounced?) #f) (set! (-> this bounce-volume) 100) @@ -827,17 +816,17 @@ ) (set! (-> s4-0 nav-radius) 7680.0) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> this root-override event-self) 'touched) - (set! (-> this root-override event-other) 'touch) + (set! (-> this root event-self) 'touched) + (set! (-> this root event-other) 'touch) (process-drawable-from-entity! this arg0) (initialize-skeleton this *bully-sg* '()) (set! (-> this draw shadow-ctrl) *bully-shadow-control*) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 454) this)) - (set! (-> this fact-override) + (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (let ((v1-49 (new 'process 'joint-mod (joint-mod-handler-mode reset) this 5))) @@ -850,10 +839,10 @@ (set! (-> v1-49 ignore-angle) 16384.0) ) (transform-post) - (if (not (move-to-ground (-> this root-override) 12288.0 40960.0 #t (collide-kind background))) + (if (not (move-to-ground (-> this root) 12288.0 40960.0 #t (collide-kind background))) (go process-drawable-art-error "no ground") ) - (set! (-> this facing-ry) (quaternion-y-angle (-> this root-override quat))) + (set! (-> this facing-ry) (quaternion-y-angle (-> this root quat))) (go bully-idle #t) (none) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/double-lurker_REF.gc b/test/decompiler/reference/jak1/levels/sunken/double-lurker_REF.gc index 6f063a75824..f2524246e0a 100644 --- a/test/decompiler/reference/jak1/levels/sunken/double-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/double-lurker_REF.gc @@ -3,13 +3,9 @@ ;; definition of type double-lurker-top (deftype double-lurker-top (nav-enemy) - ((parent-process (pointer double-lurker) :offset 12) - (fall-dest vector :inline :offset-assert 400) + ((parent-process (pointer double-lurker) :overlay-at parent) + (fall-dest vector :inline) ) - :heap-base #x130 - :method-count-assert 76 - :size-assert #x1a0 - :flag-assert #x4c013001a0 (:states (double-lurker-top-knocked-down object vector vector) double-lurker-top-on-shoulders @@ -19,7 +15,7 @@ ) ;; definition for method 3 of type double-lurker-top -(defmethod inspect double-lurker-top ((this double-lurker-top)) +(defmethod inspect ((this double-lurker-top)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -29,19 +25,15 @@ ;; definition of type double-lurker (deftype double-lurker (nav-enemy) - ((knocked-back-speed float :offset-assert 400) - (buddy-on-shoulders? symbol :offset-assert 404) - (dead? symbol :offset-assert 408) - (buddy-dead? symbol :offset-assert 412) - (buddy-handle handle :offset-assert 416) + ((knocked-back-speed float) + (buddy-on-shoulders? symbol) + (dead? symbol) + (buddy-dead? symbol) + (buddy-handle handle) ) - :heap-base #x140 - :method-count-assert 76 - :size-assert #x1a8 - :flag-assert #x4c014001a8 (:methods - (initialize-collision (_type_) collide-shape-moving :replace 47) - (double-lurker-method-53 (_type_ vector) symbol :replace 53) + (initialize-collision (_type_) collide-shape-moving :replace) + (double-lurker-method-53 (_type_ vector) symbol :overlay-at nav-enemy-method-53) ) (:states double-lurker-both-knocked-back @@ -55,7 +47,7 @@ ) ;; definition for method 3 of type double-lurker -(defmethod inspect double-lurker ((this double-lurker)) +(defmethod inspect ((this double-lurker)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -413,7 +405,7 @@ ) ;; definition for method 51 of type double-lurker-top -(defmethod nav-enemy-method-51 double-lurker-top ((this double-lurker-top)) +(defmethod nav-enemy-method-51 ((this double-lurker-top)) (restore-collide-with-as (-> this collide-info)) (logior! (-> this collide-info nav-flags) (nav-flags navf0)) (nav-control-method-27 (-> this nav)) @@ -421,7 +413,7 @@ ) ;; definition for method 47 of type double-lurker-top -(defmethod initialize-collision double-lurker-top ((this double-lurker-top)) +(defmethod initialize-collision ((this double-lurker-top)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -494,7 +486,7 @@ ;; definition for method 48 of type double-lurker-top ;; INFO: Used lq/sq ;; INFO: Return type mismatch nav-flags vs none. -(defmethod nav-enemy-method-48 double-lurker-top ((this double-lurker-top)) +(defmethod nav-enemy-method-48 ((this double-lurker-top)) (initialize-skeleton this *double-lurker-top-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) (init-defaults! this *double-lurker-top-nav-enemy-info*) @@ -800,7 +792,7 @@ ;; definition for method 52 of type double-lurker ;; INFO: Used lq/sq -(defmethod nav-enemy-method-52 double-lurker ((this double-lurker) (arg0 vector)) +(defmethod nav-enemy-method-52 ((this double-lurker) (arg0 vector)) (nav-control-method-28 (-> this nav) (the-as collide-kind -1)) (let ((a1-2 (new 'stack-no-clear 'vector))) (vector-float*! a1-2 (-> this hit-from-dir) 22937.602) @@ -955,7 +947,7 @@ ) ;; definition for method 53 of type double-lurker -(defmethod double-lurker-method-53 double-lurker ((this double-lurker) (arg0 vector)) +(defmethod double-lurker-method-53 ((this double-lurker) (arg0 vector)) (let* ((s3-0 (-> this path curve num-cverts)) (s4-0 (rand-vu-int-count s3-0)) ) @@ -971,7 +963,7 @@ ) ;; definition for method 47 of type double-lurker -(defmethod initialize-collision double-lurker ((this double-lurker)) +(defmethod initialize-collision ((this double-lurker)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1066,7 +1058,7 @@ ;; definition for method 51 of type double-lurker ;; INFO: Return type mismatch symbol vs none. -(defmethod nav-enemy-method-51 double-lurker ((this double-lurker)) +(defmethod nav-enemy-method-51 ((this double-lurker)) (let ((v1-1 (-> this collide-info root-prim))) (let ((a0-1 0)) (dotimes (a1-0 3) @@ -1094,7 +1086,7 @@ ;; definition for method 48 of type double-lurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch float vs none. -(defmethod nav-enemy-method-48 double-lurker ((this double-lurker)) +(defmethod nav-enemy-method-48 ((this double-lurker)) (set! (-> this buddy-handle) (the-as handle #f)) (process-drawable-from-entity! this (-> this entity)) (set! (-> this align) (new 'process 'align-control this)) @@ -1152,7 +1144,7 @@ ;; definition for method 11 of type double-lurker ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! double-lurker ((this double-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this double-lurker) (arg0 entity-actor)) (initialize-collision this) (nav-enemy-method-48 this) (if (-> this dead?) diff --git a/test/decompiler/reference/jak1/levels/sunken/floating-launcher_REF.gc b/test/decompiler/reference/jak1/levels/sunken/floating-launcher_REF.gc index 070daea6cb9..f6a4b264027 100644 --- a/test/decompiler/reference/jak1/levels/sunken/floating-launcher_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/floating-launcher_REF.gc @@ -3,13 +3,9 @@ ;; definition of type floating-launcher (deftype floating-launcher (baseplat) - ((trigger-height float :offset-assert 228) - (launcher (pointer launcher) :offset-assert 232) + ((trigger-height float) + (launcher (pointer launcher)) ) - :heap-base #x80 - :method-count-assert 27 - :size-assert #xec - :flag-assert #x1b008000ec (:states floating-launcher-idle floating-launcher-lowering @@ -18,7 +14,7 @@ ) ;; definition for method 3 of type floating-launcher -(defmethod inspect floating-launcher ((this floating-launcher)) +(defmethod inspect ((this floating-launcher)) (let ((t9-0 (method-of-type baseplat inspect))) (t9-0 this) ) @@ -38,9 +34,7 @@ :event plat-event :trans (behavior () (plat-trans) - (when (< (vector-xz-length (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root-override trans))) - 81920.0 - ) + (when (< (vector-xz-length (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans))) 81920.0) (if (and (>= (-> (target-pos 0) y) (-> self trigger-height)) (logtest? (-> *target* control status) (cshape-moving-flags onground)) ) @@ -74,14 +68,14 @@ (while (!= f30-0 0.0) (set! f30-0 (seek f30-0 0.0 (seconds-per-frame))) (eval-path-curve-div! (-> self path) (-> self basetrans) f30-0 'interp) - (set! (-> self launcher 0 root-override trans quad) (-> self basetrans quad)) - (update-transforms! (-> self launcher 0 root-override)) + (set! (-> self launcher 0 root trans quad) (-> self basetrans quad)) + (update-transforms! (-> self launcher 0 root)) (suspend) ) ) (eval-path-curve-div! (-> self path) (-> self basetrans) 0.0 'interp) - (set! (-> self launcher 0 root-override trans quad) (-> self basetrans quad)) - (update-transforms! (-> self launcher 0 root-override)) + (set! (-> self launcher 0 root trans quad) (-> self basetrans quad)) + (update-transforms! (-> self launcher 0 root)) (go floating-launcher-ready) ) :post plat-post @@ -97,7 +91,7 @@ ;; definition for method 11 of type floating-launcher ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! floating-launcher ((this floating-launcher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this floating-launcher) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -117,18 +111,18 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) - (eval-path-curve-div! (-> this path) (-> this root-override trans) 1.0 'interp) + (eval-path-curve-div! (-> this path) (-> this root trans) 1.0 'interp) (let ((f30-0 (res-lump-float arg0 'spring-height :default 163840.0))) - (set! (-> this launcher) (process-spawn launcher (-> this root-override trans) f30-0 0 81920.0 :to this)) + (set! (-> this launcher) (process-spawn launcher (-> this root trans) f30-0 0 81920.0 :to this)) ) (initialize-skeleton this *floating-launcher-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (baseplat-method-21 this) (set! (-> this trigger-height) (res-lump-float arg0 'trigger-height)) (go floating-launcher-idle) diff --git a/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc b/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc index f1aee464720..6725e8ada69 100644 --- a/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc @@ -3,12 +3,8 @@ ;; definition of type helix-slide-door (deftype helix-slide-door (process-drawable) - ((root-override collide-shape :offset 112) + ((root collide-shape :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states helix-slide-door-close helix-slide-door-idle-closed @@ -17,7 +13,7 @@ ) ;; definition for method 3 of type helix-slide-door -(defmethod inspect helix-slide-door ((this helix-slide-door)) +(defmethod inspect ((this helix-slide-door)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -32,17 +28,13 @@ ;; definition of type helix-button (deftype helix-button (process-drawable) - ((root-override collide-shape-moving :offset 112) - (my-water entity-actor :offset-assert 176) - (my-door entity-actor :offset-assert 180) - (fcell-handle handle :offset-assert 184) - (down-y float :offset-assert 192) - (spawn-trans vector :inline :offset-assert 208) + ((root collide-shape-moving :override) + (my-water entity-actor) + (my-door entity-actor) + (fcell-handle handle) + (down-y float) + (spawn-trans vector :inline) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xe0 - :flag-assert #x14007000e0 (:states helix-button-activate helix-button-idle-down @@ -53,7 +45,7 @@ ) ;; definition for method 3 of type helix-button -(defmethod inspect helix-button ((this helix-button)) +(defmethod inspect ((this helix-button)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -74,14 +66,10 @@ ;; definition of type helix-dark-eco (deftype helix-dark-eco (dark-eco-pool) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) ;; definition for method 3 of type helix-dark-eco -(defmethod inspect helix-dark-eco ((this helix-dark-eco)) +(defmethod inspect ((this helix-dark-eco)) (let ((t9-0 (method-of-type dark-eco-pool inspect))) (t9-0 this) ) @@ -90,20 +78,16 @@ ;; definition of type helix-water (deftype helix-water (process-drawable) - ((last-alt-actor-consumed int32 :offset-assert 176) - (alt-actors (array entity-actor) :offset-assert 180) - (transv-y float :offset-assert 184) - (start-y float :offset-assert 188) - (end-y float :offset-assert 192) - (dark-eco (pointer helix-dark-eco) :offset-assert 196) + ((last-alt-actor-consumed int32) + (alt-actors (array entity-actor)) + (transv-y float) + (start-y float) + (end-y float) + (dark-eco (pointer helix-dark-eco)) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16006000c8 (:methods - (helix-water-method-20 (_type_) none 20) - (helix-water-method-21 (_type_) object 21) + (helix-water-method-20 (_type_) none) + (helix-water-method-21 (_type_) object) ) (:states helix-water-activated @@ -112,7 +96,7 @@ ) ;; definition for method 3 of type helix-water -(defmethod inspect helix-water ((this helix-water)) +(defmethod inspect ((this helix-water)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -212,7 +196,7 @@ ;; definition for method 11 of type helix-slide-door ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! helix-slide-door ((this helix-slide-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this helix-slide-door) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) @@ -225,7 +209,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *helix-slide-door-sg* '()) @@ -240,7 +224,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! *helix-slide-door* this) (go helix-slide-door-idle-open) (none) @@ -251,7 +235,7 @@ :code (behavior () (when (not (task-complete? *game-info* (game-task sunken-slide))) (let ((a0-1 (new 'stack-no-clear 'vector))) - (set! (-> a0-1 quad) (-> self root-override trans quad)) + (set! (-> a0-1 quad) (-> self root trans quad)) (+! (-> a0-1 y) 30720.0) (let ((v1-7 (birth-pickup-at-point a0-1 @@ -265,7 +249,7 @@ ) (set! (-> self fcell-handle) (ppointer->handle v1-7)) (if v1-7 - (clear-collide-with-as (-> (the-as collectable (-> v1-7 0)) root-override)) + (clear-collide-with-as (-> (the-as collectable (-> v1-7 0)) root)) ) ) ) @@ -353,13 +337,13 @@ (set-time! (-> self state-time)) (when *target* (let ((gp-1 (new 'stack-no-clear 'vector))) - (vector-! gp-1 (-> self root-override trans) (target-pos 0)) + (vector-! gp-1 (-> self root trans) (target-pos 0)) (when (< 12288.0 (vector-xz-length gp-1)) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 4096.0) (move-by-vector! (-> *target* control) gp-1) - (do-push-aways! (-> self root-override)) - (detect-riders! (-> self root-override)) + (do-push-aways! (-> self root)) + (detect-riders! (-> self root)) ) ) ) @@ -369,11 +353,11 @@ (level-hint-spawn (text-id sunken-helix-hint) "sksp0124" (the-as entity #f) *entity-pool* (game-task none)) (send-event *target* 'play-anim 'shock-in) (sound-play "prec-button8") - (set! (-> self root-override transv quad) (the-as uint128 0)) + (set! (-> self root transv quad) (the-as uint128 0)) (let ((gp-3 5)) (until (<= gp-3 0) - (let ((f1-0 (-> self root-override transv y)) - (f0-2 (-> self root-override trans y)) + (let ((f1-0 (-> self root transv y)) + (f0-2 (-> self root trans y)) (a1-11 (new 'stack-no-clear 'vector)) ) (let* ((f1-1 (+ f1-0 (* -737280.0 (seconds-per-frame)))) @@ -384,11 +368,11 @@ (set! f1-1 (* 0.65 (- f1-1))) (+! gp-3 -1) ) - (set! (-> self root-override transv y) f1-1) - (set! (-> a1-11 quad) (-> self root-override trans quad)) + (set! (-> self root transv y) f1-1) + (set! (-> a1-11 quad) (-> self root trans quad)) (set! (-> a1-11 y) f0-3) ) - (move-to-point! (-> self root-override) a1-11) + (move-to-point! (-> self root) a1-11) ) (suspend) ) @@ -505,11 +489,11 @@ ) ) ) - (set! (-> self root-override transv quad) (the-as uint128 0)) + (set! (-> self root transv quad) (the-as uint128 0)) (let ((gp-2 5)) (until (<= gp-2 0) - (let ((f1-0 (-> self root-override transv y)) - (f0-0 (-> self root-override trans y)) + (let ((f1-0 (-> self root transv y)) + (f0-0 (-> self root trans y)) (a1-5 (new 'stack-no-clear 'vector)) ) (let* ((f1-1 (+ f1-0 (* -737280.0 (seconds-per-frame)))) @@ -520,11 +504,11 @@ (set! f1-1 (* 0.65 (- f1-1))) (+! gp-2 -1) ) - (set! (-> self root-override transv y) f1-1) - (set! (-> a1-5 quad) (-> self root-override trans quad)) + (set! (-> self root transv y) f1-1) + (set! (-> a1-5 quad) (-> self root trans quad)) (set! (-> a1-5 y) f0-1) ) - (move-to-point! (-> self root-override) a1-5) + (move-to-point! (-> self root) a1-5) ) (suspend) ) @@ -546,7 +530,7 @@ ;; definition for method 11 of type helix-button ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! helix-button ((this helix-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this helix-button) (arg0 entity-actor)) (set! (-> this fcell-handle) (the-as handle #f)) (set! (-> this my-water) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> this my-door) (entity-actor-lookup arg0 'alt-actor 1)) @@ -568,7 +552,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *helix-button-sg* '()) @@ -582,21 +566,21 @@ ) (set! (-> s5-1 frame-num) 0.0) ) - (set! (-> this spawn-trans quad) (-> this root-override trans quad)) - (+! (-> this root-override trans y) -26624.0) - (set! (-> this down-y) (+ -6553.6 (-> this root-override trans y))) + (set! (-> this spawn-trans quad) (-> this root trans quad)) + (+! (-> this root trans y) -26624.0) + (set! (-> this down-y) (+ -6553.6 (-> this root trans y))) (set! (-> this fact) (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! *helix-button* this) (go helix-button-startup) (none) ) ;; definition for method 21 of type helix-water -(defmethod helix-water-method-21 helix-water ((this helix-water)) +(defmethod helix-water-method-21 ((this helix-water)) (let ((s5-0 (+ (-> this last-alt-actor-consumed) 1))) (when (< s5-0 (-> this alt-actors length)) (let* ((v1-5 (-> this alt-actors s5-0)) @@ -715,7 +699,7 @@ ) ;; definition for method 7 of type helix-water -(defmethod relocate helix-water ((this helix-water) (arg0 int)) +(defmethod relocate ((this helix-water) (arg0 int)) (if (nonzero? (-> this alt-actors)) (&+! (-> this alt-actors) arg0) ) @@ -724,7 +708,7 @@ ;; definition for method 11 of type helix-water ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! helix-water ((this helix-water) (arg0 entity-actor)) +(defmethod init-from-entity! ((this helix-water) (arg0 entity-actor)) (set! (-> this last-alt-actor-consumed) -1) (set! (-> this transv-y) 9216.0) (set! (-> this root) (new 'process 'trsqv)) diff --git a/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc b/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc index 3ad789b3fb1..09ea1034f33 100644 --- a/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc @@ -3,15 +3,11 @@ ;; definition of type orbit-plat-bottom (deftype orbit-plat-bottom (process-drawable) - ((parent-override (pointer orbit-plat) :offset 12) - (part2 sparticle-launch-control :offset-assert 176) + ((parent-override (pointer orbit-plat) :overlay-at parent) + (part2 sparticle-launch-control) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xb4 - :flag-assert #x15005000b4 (:methods - (orbit-plat-bottom-method-20 (_type_ vector vector) none 20) + (orbit-plat-bottom-method-20 (_type_ vector vector) none) ) (:states orbit-plat-bottom-idle @@ -19,7 +15,7 @@ ) ;; definition for method 3 of type orbit-plat-bottom -(defmethod inspect orbit-plat-bottom ((this orbit-plat-bottom)) +(defmethod inspect ((this orbit-plat-bottom)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -35,21 +31,17 @@ ;; definition of type orbit-plat (deftype orbit-plat (baseplat) - ((other entity-actor :offset-assert 228) - (rot-dir float :offset-assert 232) - (reset-trans vector :inline :offset-assert 240) - (is-reset? symbol :offset-assert 256) - (reset-length float :offset-assert 260) - (timeout float :offset-assert 264) - (plat-status uint64 :offset-assert 272) + ((other entity-actor) + (rot-dir float) + (reset-trans vector :inline) + (is-reset? symbol) + (reset-length float) + (timeout float) + (plat-status uint64) ) - :heap-base #xb0 - :method-count-assert 29 - :size-assert #x118 - :flag-assert #x1d00b00118 (:methods - (orbit-plat-method-27 (_type_) symbol 27) - (orbit-plat-method-28 (_type_) symbol 28) + (orbit-plat-method-27 (_type_) symbol) + (orbit-plat-method-28 (_type_) symbol) ) (:states orbit-plat-idle @@ -62,7 +54,7 @@ ) ;; definition for method 3 of type orbit-plat -(defmethod inspect orbit-plat ((this orbit-plat)) +(defmethod inspect ((this orbit-plat)) (let ((t9-0 (method-of-type baseplat inspect))) (t9-0 this) ) @@ -161,7 +153,7 @@ ;; definition for method 20 of type orbit-plat-bottom ;; INFO: Return type mismatch int vs none. -(defmethod orbit-plat-bottom-method-20 orbit-plat-bottom ((this orbit-plat-bottom) (arg0 vector) (arg1 vector)) +(defmethod orbit-plat-bottom-method-20 ((this orbit-plat-bottom) (arg0 vector) (arg1 vector)) (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) (f30-0 (vector-length s5-1)) ) @@ -182,7 +174,7 @@ (defstate orbit-plat-bottom-idle (orbit-plat-bottom) :code (behavior () (loop - (set! (-> self root trans quad) (-> self parent-override 0 root-override trans quad)) + (set! (-> self root trans quad) (-> self parent-override 0 root trans quad)) (+! (-> self root trans y) -5324.8) (spawn (-> self part2) (-> self root trans)) (let* ((a0-6 (-> self parent-override 0 other)) @@ -193,8 +185,8 @@ ) (when v1-9 (let ((f30-0 (atan - (- (-> (the-as orbit-plat v1-9) root-override trans x) (-> self root trans x)) - (- (-> (the-as orbit-plat v1-9) root-override trans z) (-> self root trans z)) + (- (-> (the-as orbit-plat v1-9) root trans x) (-> self root trans x)) + (- (-> (the-as orbit-plat v1-9) root trans z) (-> self root trans z)) ) ) ) @@ -230,7 +222,7 @@ (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self root trans quad)) (+! (-> gp-1 y) -2048.0) - (set! (-> s5-0 quad) (-> (the-as orbit-plat v1-32) root-override trans quad)) + (set! (-> s5-0 quad) (-> (the-as orbit-plat v1-32) root trans quad)) (+! (-> s5-0 y) -7372.8) (vector-! s4-0 s5-0 gp-1) (vector-normalize! s4-0 1.0) @@ -255,7 +247,7 @@ ;; definition for method 7 of type orbit-plat-bottom ;; INFO: Return type mismatch process-drawable vs orbit-plat-bottom. -(defmethod relocate orbit-plat-bottom ((this orbit-plat-bottom) (arg0 int)) +(defmethod relocate ((this orbit-plat-bottom) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -263,7 +255,7 @@ ) ;; definition for method 10 of type orbit-plat-bottom -(defmethod deactivate orbit-plat-bottom ((this orbit-plat-bottom)) +(defmethod deactivate ((this orbit-plat-bottom)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -278,9 +270,9 @@ (set! (-> self entity) arg0) (logior! (-> self mask) (process-mask platform)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg1 root-override trans quad)) - (quaternion-copy! (-> self root quat) (-> arg1 root-override quat)) - (set! (-> self root scale quad) (-> arg1 root-override scale quad)) + (set! (-> self root trans quad) (-> arg1 root trans quad)) + (quaternion-copy! (-> self root quat) (-> arg1 root quat)) + (set! (-> self root scale quad) (-> arg1 root scale quad)) (+! (-> self root trans y) -5324.8) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 440) self)) (set! (-> self part2) (create-launch-control (-> *part-group-id-table* 107) self)) @@ -338,7 +330,7 @@ ) ) (loop - (when (nonzero? (-> self root-override riders num-riders)) + (when (nonzero? (-> self root riders num-riders)) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) self) (set! (-> a1-2 num-params) 0) @@ -383,13 +375,13 @@ ) ;; definition for method 28 of type orbit-plat -(defmethod orbit-plat-method-28 orbit-plat ((this orbit-plat)) +(defmethod orbit-plat-method-28 ((this orbit-plat)) (when (time-elapsed? (-> this state-time) (the int (* 300.0 (-> this timeout)))) (cond (*target* (let ((s5-0 (target-pos 0))) - (if (or (>= (vector-vector-xz-distance s5-0 (-> this root-override trans)) 102400.0) - (>= (- (-> this root-override trans y) (-> s5-0 y)) 16384.0) + (if (or (>= (vector-vector-xz-distance s5-0 (-> this root trans)) 102400.0) + (>= (- (-> this root trans y) (-> s5-0 y)) 16384.0) ) (return #t) ) @@ -421,7 +413,7 @@ (set-time! (-> self state-time)) (ja-no-eval :num! (seek! 0.0)) (until (orbit-plat-method-28 self) - (when (nonzero? (-> self root-override riders num-riders)) + (when (nonzero? (-> self root riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 0) @@ -457,7 +449,7 @@ (set! (-> self plat-status) (the-as uint 1)) (ja-no-eval :num! (seek!)) (loop - (when (zero? (-> self root-override riders num-riders)) + (when (zero? (-> self root riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 0) @@ -516,9 +508,9 @@ ) (vector-normalize! (-> arg1 nav travel) (* f0-0 (seconds-per-frame))) ) - (set! (-> arg0 x) (+ (-> arg1 root-override trans x) (-> arg1 nav travel x))) - (set! (-> arg0 y) (-> arg1 root-override trans x)) - (set! (-> arg0 z) (+ (-> arg1 root-override trans z) (-> arg1 nav travel z))) + (set! (-> arg0 x) (+ (-> arg1 root trans x) (-> arg1 nav travel x))) + (set! (-> arg0 y) (-> arg1 root trans x)) + (set! (-> arg0 z) (+ (-> arg1 root trans z) (-> arg1 nav travel z))) arg0 ) @@ -550,7 +542,7 @@ (-> a1-0 extra process) ) ) - root-override + root trans quad ) @@ -586,7 +578,7 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs symbol. ;; WARN: disable def twice: 132. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod orbit-plat-method-27 orbit-plat ((this orbit-plat)) +(defmethod orbit-plat-method-27 ((this orbit-plat)) (local-vars (v0-11 object)) (let* ((v1-0 (-> this other)) (s5-0 (if v1-0 @@ -635,7 +627,7 @@ (-> a1-5 extra process) ) ) - root-override + root trans quad ) @@ -676,7 +668,7 @@ (-> a0-19 extra process) ) ) - root-override + root trans quad ) @@ -751,7 +743,7 @@ (ja-no-eval :num! (seek! 0.0)) (while (not (logtest? (nav-control-flags navcf19) (-> self nav flags))) (orbit-plat-method-27 self) - (when (nonzero? (-> self root-override riders num-riders)) + (when (nonzero? (-> self root riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 0) @@ -806,7 +798,7 @@ ;; definition for method 11 of type orbit-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! orbit-plat ((this orbit-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this orbit-plat) (arg0 entity-actor)) (set! (-> this plat-status) (the-as uint 0)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) @@ -827,7 +819,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *orbit-plat-sg* '()) @@ -842,14 +834,14 @@ (set! (-> s4-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (baseplat-method-21 this) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> this nav gap-event) 'blocked) (set! (-> this other) (entity-actor-lookup arg0 'alt-actor 0)) (let ((f0-7 (res-lump-float arg0 'scale :default 1.0))) - (set-vector! (-> this root-override scale) f0-7 f0-7 f0-7 1.0) + (set-vector! (-> this root scale) f0-7 f0-7 f0-7 1.0) ) (set! (-> this timeout) (res-lump-float arg0 'timeout :default 10.0)) (set! (-> this rot-dir) 1.0) diff --git a/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc b/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc index ae486eae5d6..605953ec282 100644 --- a/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc @@ -3,53 +3,49 @@ ;; definition of type puffer (deftype puffer (process-drawable) - ((root-override collide-shape-moving :offset 112) - (fact-info-override fact-info-enemy :offset 144) - (path-index int32 :offset-assert 176) - (facing-ry float :offset-assert 180) - (travel-ry float :offset-assert 184) - (travel-speed float :offset-assert 188) - (attack-bottom-y float :offset-assert 192) - (patrol-bottom-y float :offset-assert 196) - (top-y float :offset-assert 200) - (targ-trans-y float :offset-assert 204) - (acc-y float :offset-assert 208) - (travel-turn-speed float :offset-assert 212) - (notice-dist float :offset-assert 216) - (give-up-dist float :offset-assert 220) - (attacking? symbol :offset-assert 224) - (hit-player? symbol :offset-assert 228) - (look-mean? symbol :offset-assert 232) - (cprims-type uint64 :offset-assert 240) - (neck joint-mod :offset-assert 248) - (hit-player-time time-frame :offset-assert 256) - (reaction-delay time-frame :offset-assert 264) - (picked-point-time time-frame :offset-assert 272) - (pick-new-point-delay time-frame :offset-assert 280) - (last-on-screen-time time-frame :offset-assert 288) - (buddy process-drawable :offset-assert 296) - (nice-look lod-set :inline :offset-assert 300) - (mean-look lod-set :inline :offset-assert 336) - (dest-pos vector :inline :offset-assert 384) - (sync sync-info :inline :offset-assert 400) + ((root collide-shape-moving :override) + (fact fact-info-enemy :override) + (path-index int32) + (facing-ry float) + (travel-ry float) + (travel-speed float) + (attack-bottom-y float) + (patrol-bottom-y float) + (top-y float) + (targ-trans-y float) + (acc-y float) + (travel-turn-speed float) + (notice-dist float) + (give-up-dist float) + (attacking? symbol) + (hit-player? symbol) + (look-mean? symbol) + (cprims-type uint64) + (neck joint-mod) + (hit-player-time time-frame) + (reaction-delay time-frame) + (picked-point-time time-frame) + (pick-new-point-delay time-frame) + (last-on-screen-time time-frame) + (buddy process-drawable) + (nice-look lod-set :inline) + (mean-look lod-set :inline) + (dest-pos vector :inline) + (sync sync-info :inline) ) - :heap-base #x130 - :method-count-assert 32 - :size-assert #x198 - :flag-assert #x2001300198 (:methods - (puffer-method-20 (_type_ vector) none 20) - (puffer-method-21 (_type_) none 21) - (puffer-method-22 (_type_) symbol 22) - (puffer-method-23 (_type_ symbol) symbol 23) - (puffer-method-24 (_type_ vector) symbol 24) - (puffer-method-25 (_type_ float) symbol 25) - (puffer-method-26 (_type_) none 26) - (puffer-method-27 (_type_) none 27) - (puffer-method-28 (_type_) none 28) - (flip-look! (_type_ symbol) none 29) - (puffer-method-30 (_type_) vector 30) - (puffer-method-31 (_type_) vector 31) + (puffer-method-20 (_type_ vector) none) + (puffer-method-21 (_type_) none) + (puffer-method-22 (_type_) symbol) + (puffer-method-23 (_type_ symbol) symbol) + (puffer-method-24 (_type_ vector) symbol) + (puffer-method-25 (_type_ float) symbol) + (puffer-method-26 (_type_) none) + (puffer-method-27 (_type_) none) + (puffer-method-28 (_type_) none) + (flip-look! (_type_ symbol) none) + (puffer-method-30 (_type_) vector) + (puffer-method-31 (_type_) vector) ) (:states puffer-attack @@ -60,7 +56,7 @@ ) ;; definition for method 3 of type puffer -(defmethod inspect puffer ((this puffer)) +(defmethod inspect ((this puffer)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -123,12 +119,12 @@ ) (when v1-7 (let ((f0-4 (atan - (- (-> (the-as process-drawable v1-7) root trans x) (-> self root-override trans x)) - (- (-> (the-as process-drawable v1-7) root trans z) (-> self root-override trans z)) + (- (-> (the-as process-drawable v1-7) root trans x) (-> self root trans x)) + (- (-> (the-as process-drawable v1-7) root trans z) (-> self root trans z)) ) ) ) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 f0-4) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 f0-4) ) ) ) @@ -144,7 +140,7 @@ ) (set! (-> self hit-player?) #t) (set-time! (-> self hit-player-time)) - (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) + (set-collide-offense (-> self root) 2 (collide-offense no-offense)) ) ) ) @@ -164,7 +160,7 @@ ) ) ) - (set-collide-offense (-> self root-override) 2 (collide-offense normal-attack)) + (set-collide-offense (-> self root) 2 (collide-offense normal-attack)) (set! (-> self hit-player?) #f) ) (transform-post) @@ -174,7 +170,7 @@ ;; definition for method 28 of type puffer ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod puffer-method-28 puffer ((this puffer)) +(defmethod puffer-method-28 ((this puffer)) (cond ((and (-> this draw shadow) (zero? (-> this draw cur-lod)) @@ -184,7 +180,7 @@ (a1-0 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> this root-override trans quad)) + (set! (-> a1-0 quad) (-> this root trans quad)) (set-vector! a2-0 0.0 -40960.0 0.0 1.0) (cond ((>= (fill-and-probe-using-line-sphere @@ -232,14 +228,14 @@ ) ;; definition for method 24 of type puffer -(defmethod puffer-method-24 puffer ((this puffer) (arg0 vector)) +(defmethod puffer-method-24 ((this puffer) (arg0 vector)) (and (is-in-mesh? (-> this nav) arg0 11468.8) - (< (-> arg0 y) (+ (-> this root-override trans y) (-> this fact-info-override notice-top))) + (< (-> arg0 y) (+ (-> this root trans y) (-> this fact notice-top))) ) ) ;; definition for method 22 of type puffer -(defmethod puffer-method-22 puffer ((this puffer)) +(defmethod puffer-method-22 ((this puffer)) (let* ((a1-0 (-> this buddy)) (v1-0 (if a1-0 (-> a1-0 ppointer 3) @@ -247,9 +243,7 @@ ) ) (if (and v1-0 - (>= 25395.2 - (vector-vector-xz-distance (-> this root-override trans) (-> (the-as process-drawable v1-0) root trans)) - ) + (>= 25395.2 (vector-vector-xz-distance (-> this root trans) (-> (the-as process-drawable v1-0) root trans))) ) (return #t) ) @@ -258,7 +252,7 @@ ) ;; definition for method 25 of type puffer -(defmethod puffer-method-25 puffer ((this puffer) (arg0 float)) +(defmethod puffer-method-25 ((this puffer) (arg0 float)) (when *target* (let ((gp-0 (target-pos 0))) (when (and (not (logtest? (-> *target* state-flags) @@ -269,7 +263,7 @@ (>= (-> gp-0 y) (+ -14336.0 (-> this attack-bottom-y))) (>= (+ 2048.0 (-> this top-y)) (-> gp-0 y)) ) - (let ((f30-0 (vector-vector-xz-distance gp-0 (-> this root-override trans)))) + (let ((f30-0 (vector-vector-xz-distance gp-0 (-> this root trans)))) (when (>= arg0 f30-0) (let* ((a0-4 (-> this buddy)) (v1-12 (if a0-4 @@ -282,7 +276,7 @@ (if (not (-> (the-as puffer v1-12) attacking?)) (return #t) ) - (if (< f30-0 (vector-vector-xz-distance gp-0 (-> (the-as puffer v1-12) root-override trans))) + (if (< f30-0 (vector-vector-xz-distance gp-0 (-> (the-as puffer v1-12) root trans))) (return #t) ) ) @@ -301,20 +295,17 @@ ;; definition of type pick-patrol-point-away-from-buddy-work (deftype pick-patrol-point-away-from-buddy-work (structure) - ((best-path-index int32 :offset-assert 0) - (best-rating float :offset-assert 4) - (best-dest vector :inline :offset-assert 16) - (pt-dir vector :inline :offset-assert 32) - (buddy-dir vector :inline :offset-assert 48) - (dest vector :inline :offset-assert 64) + ((best-path-index int32) + (best-rating float) + (best-dest vector :inline) + (pt-dir vector :inline) + (buddy-dir vector :inline) + (dest vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type pick-patrol-point-away-from-buddy-work -(defmethod inspect pick-patrol-point-away-from-buddy-work ((this pick-patrol-point-away-from-buddy-work)) +(defmethod inspect ((this pick-patrol-point-away-from-buddy-work)) (format #t "[~8x] ~A~%" this 'pick-patrol-point-away-from-buddy-work) (format #t "~Tbest-path-index: ~D~%" (-> this best-path-index)) (format #t "~Tbest-rating: ~f~%" (-> this best-rating)) @@ -327,7 +318,7 @@ ;; definition for method 23 of type puffer ;; INFO: Used lq/sq -(defmethod puffer-method-23 puffer ((this puffer) (arg0 symbol)) +(defmethod puffer-method-23 ((this puffer) (arg0 symbol)) (local-vars (v1-0 process)) (set! v1-0 (when arg0 (let ((a0-1 (-> this buddy))) @@ -348,12 +339,12 @@ (s5-0 (new 'stack-no-clear 'inline-array 'vector 5)) ) (set! (-> s5-0 0 x) (the-as float -1)) - (vector-! (-> s5-0 3) (-> this root-override trans) (-> (the-as process-drawable v1-0) root trans)) + (vector-! (-> s5-0 3) (-> this root trans) (-> (the-as process-drawable v1-0) root trans)) (set! (-> s5-0 3 y) 0.0) (vector-normalize! (-> s5-0 3) 1.0) (dotimes (s3-0 s4-0) (eval-path-curve-div! (-> this path) (-> s5-0 4) (the float s3-0) 'interp) - (vector-! (-> s5-0 2) (-> s5-0 4) (-> this root-override trans)) + (vector-! (-> s5-0 2) (-> s5-0 4) (-> this root trans)) (when (>= (vector-xz-length (-> s5-0 2)) 10240.0) (set! (-> s5-0 2 y) 0.0) (vector-normalize! (-> s5-0 2) 1.0) @@ -370,7 +361,7 @@ ) (when (>= (the-as int (-> s5-0 0 x)) 0) (set! (-> this dest-pos quad) (-> s5-0 1 quad)) - (set! (-> this dest-pos y) (-> this root-override trans y)) + (set! (-> this dest-pos y) (-> this root trans y)) (return #t) ) ) @@ -383,9 +374,9 @@ (while (nonzero? s3-1) (+! s3-1 -1) (eval-path-curve-div! (-> this path) s4-1 (the float s5-1) 'interp) - (when (>= (vector-vector-xz-distance s4-1 (-> this root-override trans)) 10240.0) + (when (>= (vector-vector-xz-distance s4-1 (-> this root trans)) 10240.0) (set! (-> this dest-pos quad) (-> s4-1 quad)) - (set! (-> this dest-pos y) (-> this root-override trans y)) + (set! (-> this dest-pos y) (-> this root trans y)) (set! (-> this path-index) s5-1) (return #t) ) @@ -398,7 +389,7 @@ ;; definition for method 20 of type puffer ;; INFO: Used lq/sq -(defmethod puffer-method-20 puffer ((this puffer) (arg0 vector)) +(defmethod puffer-method-20 ((this puffer) (arg0 vector)) (if (-> this attacking?) (set! (-> this travel-speed) (seek-with-smooth (-> this travel-speed) 30720.0 (* 8192.0 (seconds-per-frame)) 0.125 40.96) @@ -409,7 +400,7 @@ ) (nav-control-method-27 (-> this nav)) (nav-control-method-28 (-> this nav) (the-as collide-kind -1)) - (nav-control-method-13 (-> this nav) arg0 (-> this root-override transv)) + (nav-control-method-13 (-> this nav) arg0 (-> this root transv)) (let ((f30-0 (* (vector-xz-length (-> this nav travel)) (-> *display* frames-per-second)))) (let ((f0-11 (atan (-> this nav travel x) (-> this nav travel z))) (s5-1 (new 'stack-no-clear 'vector)) @@ -431,12 +422,12 @@ (set! (-> this nav travel quad) (-> s4-0 quad)) (nav-control-method-24 (-> this nav) f28-0 s3-1) (if (-> s3-1 found-boundary) - (set! f26-0 (vector-vector-xz-distance (-> s3-1 intersection) (-> this root-override trans))) + (set! f26-0 (vector-vector-xz-distance (-> s3-1 intersection) (-> this root trans))) ) ) (let ((s3-2 (new 'stack-no-clear 'matrix))) (when (>= (nav-control-method-23 (-> this nav) s4-0 (the-as check-vector-collision-with-nav-spheres-info s3-2)) 0.0) - (let ((f0-26 (vector-vector-xz-distance (-> s3-2 vector 1) (-> this root-override trans)))) + (let ((f0-26 (vector-vector-xz-distance (-> s3-2 vector 1) (-> this root trans)))) (if (or (< f26-0 0.0) (< f0-26 f26-0)) (set! f26-0 f0-26) ) @@ -452,9 +443,9 @@ ) ) (set-vector! - (-> this root-override transv) + (-> this root transv) (* (sin (-> this travel-ry)) f30-0) - (-> this root-override transv y) + (-> this root transv y) (* (cos (-> this travel-ry)) f30-0) 1.0 ) @@ -468,37 +459,37 @@ ;; definition for method 27 of type puffer ;; INFO: Return type mismatch float vs none. -(defmethod puffer-method-27 puffer ((this puffer)) +(defmethod puffer-method-27 ((this puffer)) (let ((f30-0 (-> this patrol-bottom-y))) (cond ((-> this attacking?) (let ((f30-1 (-> this attack-bottom-y))) (set! (-> this targ-trans-y) (fmax (fmin (+ 4096.0 (-> (target-pos 0) y)) (-> this top-y)) f30-1)) ) - (set! (-> this root-override transv y) - (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root-override trans y))) + (set! (-> this root transv y) + (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root trans y))) ) - (when (< 6144.0 (fabs (-> this root-override transv y))) - (if (>= (-> this root-override transv y) 0.0) - (set! (-> this root-override transv y) 6144.0) - (set! (-> this root-override transv y) -6144.0) + (when (< 6144.0 (fabs (-> this root transv y))) + (if (>= (-> this root transv y) 0.0) + (set! (-> this root transv y) 6144.0) + (set! (-> this root transv y) -6144.0) ) ) ) - ((< (-> this root-override trans y) f30-0) + ((< (-> this root trans y) f30-0) (set! (-> this targ-trans-y) (* 0.5 (+ (-> this top-y) (-> this patrol-bottom-y)))) - (set! (-> this root-override transv y) - (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root-override trans y))) + (set! (-> this root transv y) + (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root trans y))) ) - (when (< 2048.0 (fabs (-> this root-override transv y))) - (if (>= (-> this root-override transv y) 0.0) - (set! (-> this root-override transv y) 2048.0) - (set! (-> this root-override transv y) -2048.0) + (when (< 2048.0 (fabs (-> this root transv y))) + (if (>= (-> this root transv y) 0.0) + (set! (-> this root transv y) 2048.0) + (set! (-> this root transv y) -2048.0) ) ) ) (else - (let ((f0-22 (- (-> this targ-trans-y) (-> this root-override trans y)))) + (let ((f0-22 (- (-> this targ-trans-y) (-> this root trans y)))) (when (or (and (>= f0-22 0.0) (< (-> this acc-y) 0.0)) (and (< f0-22 0.0) (>= (-> this acc-y) 0.0))) (when (not (-> this attacking?)) (cond @@ -517,20 +508,20 @@ (set! (-> this acc-y) (- (-> this acc-y))) ) ) - (+! (-> this root-override transv y) (* (-> this acc-y) (seconds-per-frame))) - (let ((f0-37 (* (-> this root-override transv y) (seconds-per-frame)))) + (+! (-> this root transv y) (* (-> this acc-y) (seconds-per-frame))) + (let ((f0-37 (* (-> this root transv y) (seconds-per-frame)))) (cond ((>= f0-37 0.0) - (let ((f1-27 (* 0.0625 (- (-> this top-y) (-> this root-override trans y))))) + (let ((f1-27 (* 0.0625 (- (-> this top-y) (-> this root trans y))))) (if (< f1-27 f0-37) - (set! (-> this root-override transv y) (* f1-27 (-> *display* frames-per-second))) + (set! (-> this root transv y) (* f1-27 (-> *display* frames-per-second))) ) ) ) (else - (let ((f1-29 (* 0.0625 (- f30-0 (-> this root-override trans y))))) + (let ((f1-29 (* 0.0625 (- f30-0 (-> this root trans y))))) (if (< f0-37 f1-29) - (set! (-> this root-override transv y) (* f1-29 (-> *display* frames-per-second))) + (set! (-> this root transv y) (* f1-29 (-> *display* frames-per-second))) ) ) ) @@ -556,9 +547,8 @@ ) :code (behavior () (loop - (if (and (and *target* (>= (-> self fact-info-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (and (and *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (logtest? (-> self draw status) (draw-status was-drawn)) (time-elapsed? (-> self state-time) (seconds 0.2)) @@ -587,9 +577,8 @@ (set-time! (-> self last-on-screen-time)) ) :trans (behavior () - (if (and (not (and *target* (>= (-> self fact-info-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (and (not (and *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) ) (time-elapsed? (-> self state-time) (seconds 3)) @@ -617,7 +606,7 @@ ) (go puffer-attack) ) - (when (or (< (vector-vector-xz-distance (-> self root-override trans) (-> self dest-pos)) 8192.0) + (when (or (< (vector-vector-xz-distance (-> self root trans) (-> self dest-pos)) 8192.0) (time-elapsed? (-> self picked-point-time) (-> self pick-new-point-delay)) ) (when (puffer-method-23 self #f) @@ -628,9 +617,9 @@ (puffer-method-20 self (-> self dest-pos)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set-vector! gp-0 (sin (-> self facing-ry)) 0.0 (cos (-> self facing-ry)) 1.0) - (set-heading-vec-clear-roll-pitch! (-> self root-override) gp-0) + (set-heading-vec-clear-roll-pitch! (-> self root) gp-0) ) - (vector-v+! (-> self root-override trans) (-> self root-override trans) (-> self root-override transv)) + (vector-v+! (-> self root trans) (-> self root trans) (-> self root transv)) (puffer-method-28 self) ) :code (behavior () @@ -663,7 +652,7 @@ (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> (the-as collide-shape-prim-group (-> self root-override root-prim)) prims 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group (-> self root root-prim)) prims 0 prim-core)) 'attacking self ) @@ -673,9 +662,9 @@ (puffer-method-20 self (target-pos 0)) (let ((gp-2 (new 'stack-no-clear 'vector))) (set-vector! gp-2 (sin (-> self facing-ry)) 0.0 (cos (-> self facing-ry)) 1.0) - (set-heading-vec-clear-roll-pitch! (-> self root-override) gp-2) + (set-heading-vec-clear-roll-pitch! (-> self root) gp-2) ) - (vector-v+! (-> self root-override trans) (-> self root-override trans) (-> self root-override transv)) + (vector-v+! (-> self root trans) (-> self root trans) (-> self root transv)) (puffer-method-28 self) ) :code (behavior () @@ -690,27 +679,25 @@ ;; failed to figure out what this is: (defstate puffer-die (puffer) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (the-as - uint - (case message - (('death-start) - (the-as uint (drop-pickup (-> self fact-info-override) #t *entity-pool* (-> self fact-info-override) 0)) - ) - (('death-end) - (let ((v0-0 (the-as uint (logior (-> self draw status) (draw-status hidden))))) - (set! (-> self draw status) (the-as draw-status v0-0)) - v0-0 - ) - ) - ) - ) + (the-as uint (case message + (('death-start) + (the-as uint (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0)) + ) + (('death-end) + (let ((v0-0 (the-as uint (logior (-> self draw status) (draw-status hidden))))) + (set! (-> self draw status) (the-as draw-status v0-0)) + v0-0 + ) + ) + ) + ) ) :code (behavior () (cleanup-for-death self) (shut-down! (-> self neck)) (logclear! (-> self mask) (process-mask actor-pause)) (ja-channel-push! 1 (seconds 0.075)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (ja-no-eval :group! puffer-die-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -722,7 +709,7 @@ ;; definition for method 21 of type puffer ;; INFO: Return type mismatch int vs none. -(defmethod puffer-method-21 puffer ((this puffer)) +(defmethod puffer-method-21 ((this puffer)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -761,7 +748,7 @@ ) (set! (-> s5-0 nav-radius) 12288.0) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (puffer-method-30 this) 0 @@ -769,7 +756,7 @@ ) ;; definition for method 29 of type puffer -(defmethod flip-look! puffer ((this puffer) (arg0 symbol)) +(defmethod flip-look! ((this puffer) (arg0 symbol)) (when (!= arg0 (-> this look-mean?)) (set! (-> this look-mean?) arg0) (if arg0 @@ -781,10 +768,10 @@ ) ;; definition for method 30 of type puffer -(defmethod puffer-method-30 puffer ((this puffer)) +(defmethod puffer-method-30 ((this puffer)) (when (!= (-> this cprims-type) 1) (set! (-> this cprims-type) (the-as uint 1)) - (let ((v1-3 (the-as basic (-> this root-override root-prim)))) + (let ((v1-3 (the-as basic (-> this root root-prim)))) (set-vector! (-> (the-as collide-shape-prim v1-3) local-sphere) 0.0 6144.0 0.0 18432.0) (let ((v0-0 (-> (the-as (array collide-shape-prim) v1-3) 17 local-sphere))) (set! (-> v0-0 x) 0.0) @@ -798,10 +785,10 @@ ) ;; definition for method 31 of type puffer -(defmethod puffer-method-31 puffer ((this puffer)) +(defmethod puffer-method-31 ((this puffer)) (when (!= (-> this cprims-type) 2) (set! (-> this cprims-type) (the-as uint 2)) - (let ((v1-3 (the-as basic (-> this root-override root-prim)))) + (let ((v1-3 (the-as basic (-> this root root-prim)))) (set-vector! (-> (the-as collide-shape-prim v1-3) local-sphere) 0.0 6144.0 0.0 18432.0) (let ((v0-0 (-> (the-as (array collide-shape-prim) v1-3) 17 local-sphere))) (set! (-> v0-0 x) 0.0) @@ -816,7 +803,7 @@ ;; definition for method 26 of type puffer ;; INFO: Return type mismatch vector vs none. -(defmethod puffer-method-26 puffer ((this puffer)) +(defmethod puffer-method-26 ((this puffer)) (let ((f30-0 (get-current-phase (-> this sync)))) (if (and (< 0.025 f30-0) (< f30-0 0.525)) (flip-look! this #f) @@ -1119,7 +1106,7 @@ ) ;; definition for method 7 of type puffer -(defmethod relocate puffer ((this puffer) (arg0 int)) +(defmethod relocate ((this puffer) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) @@ -1129,7 +1116,7 @@ ;; definition for method 11 of type puffer ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! puffer ((this puffer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this puffer) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (set! (-> this cprims-type) (the-as uint 0)) (set! (-> this attacking?) #f) @@ -1148,12 +1135,12 @@ (load-params! (-> this sync) this (the-as uint 2400) 0.0 0.15 0.15) (set! (-> this notice-dist) (res-lump-float arg0 'notice-dist :default 57344.0)) (set! (-> this give-up-dist) (+ 20480.0 (-> this notice-dist))) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (nav-control-method-26 (-> this nav)) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> this fact-info-override) + (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) @@ -1175,11 +1162,11 @@ ) (set! (-> s4-0 frame-num) 0.0) ) - (set! (-> this facing-ry) (quaternion-y-angle (-> this root-override quat))) + (set! (-> this facing-ry) (quaternion-y-angle (-> this root quat))) (set! (-> this travel-ry) (-> this facing-ry)) (set! (-> this travel-speed) 18432.0) - (vector-reset! (-> this root-override transv)) - (set! (-> this patrol-bottom-y) (-> this root-override trans y)) + (vector-reset! (-> this root transv)) + (set! (-> this patrol-bottom-y) (-> this root trans y)) (let ((f28-0 8192.0) (f30-0 -8192.0) ) @@ -1193,8 +1180,8 @@ (set! (-> this top-y) (+ (-> this patrol-bottom-y) f28-0)) (set! (-> this attack-bottom-y) (+ (-> this patrol-bottom-y) f30-0)) ) - (set! (-> this root-override trans y) (rand-vu-float-range (-> this patrol-bottom-y) (-> this top-y))) - (set! (-> this targ-trans-y) (-> this root-override trans y)) + (set! (-> this root trans y) (rand-vu-float-range (-> this patrol-bottom-y) (-> this top-y))) + (set! (-> this targ-trans-y) (-> this root trans y)) (set! (-> this acc-y) 2048.0) (let ((v1-59 (new 'process 'joint-mod (joint-mod-handler-mode reset) this 5))) (set! (-> this neck) v1-59) @@ -1205,7 +1192,7 @@ (set! (-> v1-59 max-dist) 102400.0) (set! (-> v1-59 ignore-angle) 16384.0) ) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go puffer-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc b/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc index 4140d632b41..286e7a1574e 100644 --- a/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc @@ -4,14 +4,10 @@ ;; definition of type qbert-plat-on (deftype qbert-plat-on (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 ) ;; definition for method 3 of type qbert-plat-on -(defmethod inspect qbert-plat-on ((this qbert-plat-on)) +(defmethod inspect ((this qbert-plat-on)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -26,16 +22,12 @@ ;; definition of type qbert-plat (deftype qbert-plat (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 736) - (plat-id int32 :offset-assert 752) - (on? symbol :offset-assert 756) - (player-is-riding? symbol :offset-assert 760) - (master entity-actor :offset-assert 764) + ((anchor-point vector :inline) + (plat-id int32) + (on? symbol) + (player-is-riding? symbol) + (master entity-actor) ) - :heap-base #x290 - :method-count-assert 35 - :size-assert #x300 - :flag-assert #x2302900300 (:states qbert-plat-on-die qbert-plat-on-mimic @@ -44,7 +36,7 @@ ) ;; definition for method 3 of type qbert-plat -(defmethod inspect qbert-plat ((this qbert-plat)) +(defmethod inspect ((this qbert-plat)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) (t9-0 this) ) @@ -91,24 +83,20 @@ ;; definition of type qbert-plat-master (deftype qbert-plat-master (process-drawable) - ((last-plat-triggered int32 :offset-assert 176) - (plat-states uint32 :offset-assert 180) - (plat-states-needed-to-open-door uint32 :offset-assert 184) - (player-in-bounds? symbol :offset-assert 188) - (player-in-water? symbol :offset-assert 192) - (play-door-cam? symbol :offset-assert 196) - (puzzle-beaten? symbol :offset-assert 200) - (door entity-actor :offset-assert 204) - (door-plat entity-actor :offset-assert 208) - (bounds-start vector :inline :offset-assert 224) - (bounds-end vector :inline :offset-assert 240) + ((last-plat-triggered int32) + (plat-states uint32) + (plat-states-needed-to-open-door uint32) + (player-in-bounds? symbol) + (player-in-water? symbol) + (play-door-cam? symbol) + (puzzle-beaten? symbol) + (door entity-actor) + (door-plat entity-actor) + (bounds-start vector :inline) + (bounds-end vector :inline) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x100 - :flag-assert #x1500900100 (:methods - (plat-state-set? (_type_ uint) symbol 20) + (plat-state-set? (_type_ uint) symbol) ) (:states (qbert-plat-master-do-door symbol) @@ -118,7 +106,7 @@ ) ;; definition for method 3 of type qbert-plat-master -(defmethod inspect qbert-plat-master ((this qbert-plat-master)) +(defmethod inspect ((this qbert-plat-master)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -204,7 +192,7 @@ ) ;; definition for method 33 of type qbert-plat -(defmethod rigid-body-platform-method-33 qbert-plat ((this qbert-plat)) +(defmethod rigid-body-platform-method-33 ((this qbert-plat)) (let* ((a1-0 (-> this master)) (v1-0 (if a1-0 (-> a1-0 extra process) @@ -218,7 +206,7 @@ ) ;; definition for method 32 of type qbert-plat -(defmethod rigid-body-platform-method-32 qbert-plat ((this qbert-plat)) +(defmethod rigid-body-platform-method-32 ((this qbert-plat)) (let* ((v1-0 (-> this master)) (a0-1 (if v1-0 (-> v1-0 extra process) @@ -318,7 +306,7 @@ ) ;; definition for method 22 of type qbert-plat -(defmethod rigid-body-platform-method-22 qbert-plat ((this qbert-plat) (arg0 vector) (arg1 float)) +(defmethod rigid-body-platform-method-22 ((this qbert-plat) (arg0 vector) (arg1 float)) (+ (-> this anchor-point y) (-> this float-height-offset) (* 512.0 (cos (* 546.13336 (+ (* 60.0 arg1) (* 0.03 (-> arg0 x)) (* 0.03 (-> arg0 z)))))) @@ -327,7 +315,7 @@ ;; definition for method 23 of type qbert-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 qbert-plat ((this qbert-plat) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this qbert-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 @@ -336,7 +324,7 @@ ;; definition for method 30 of type qbert-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 qbert-plat ((this qbert-plat)) +(defmethod rigid-body-platform-method-30 ((this qbert-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -364,7 +352,7 @@ ;; definition for method 31 of type qbert-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 qbert-plat ((this qbert-plat)) +(defmethod rigid-body-platform-method-31 ((this qbert-plat)) (initialize-skeleton this *qbert-plat-sg* '()) (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) (logior! (-> this skel status) (janim-status inited)) @@ -406,7 +394,7 @@ ;; definition for method 11 of type qbert-plat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! qbert-plat ((this qbert-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this qbert-plat) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (rigid-body-platform-method-30 this) (process-drawable-from-entity! this arg0) @@ -416,7 +404,7 @@ ) ;; definition for method 20 of type qbert-plat-master -(defmethod plat-state-set? qbert-plat-master ((this qbert-plat-master) (arg0 uint)) +(defmethod plat-state-set? ((this qbert-plat-master) (arg0 uint)) (logtest? (-> this plat-states) (ash 1 arg0)) ) @@ -773,7 +761,7 @@ ;; definition for method 11 of type qbert-plat-master ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! qbert-plat-master ((this qbert-plat-master) (arg0 entity-actor)) +(defmethod init-from-entity! ((this qbert-plat-master) (arg0 entity-actor)) (set! (-> this last-plat-triggered) -1) (set! (-> this player-in-water?) #f) (set! (-> this player-in-bounds?) #f) diff --git a/test/decompiler/reference/jak1/levels/sunken/shover_REF.gc b/test/decompiler/reference/jak1/levels/sunken/shover_REF.gc index 212534095e9..3f3b359bc22 100644 --- a/test/decompiler/reference/jak1/levels/sunken/shover_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/shover_REF.gc @@ -3,20 +3,16 @@ ;; definition of type shover (deftype shover (process-drawable) - ((root-override collide-shape :offset 112) - (shove-up float :offset-assert 176) + ((root collide-shape :override) + (shove-up float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states shover-idle ) ) ;; definition for method 3 of type shover -(defmethod inspect shover ((this shover)) +(defmethod inspect ((this shover)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -43,7 +39,7 @@ (collide-action) ) (let ((s4-0 (new 'stack 'attack-info))) - (calc-shove-up (-> self root-override) s4-0 (-> self shove-up)) + (calc-shove-up (-> self root) s4-0 (-> self shove-up)) (level-hint-spawn (text-id sunken-hotpipes) "sksp0134" (the-as entity #f) *entity-pool* (game-task none)) (if (or (= (-> *target* control unknown-surface00 mode) 'air) (>= (+ (current-time) (seconds -0.2)) (-> *target* control unknown-dword11)) @@ -80,7 +76,7 @@ ;; definition for method 11 of type shover ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! shover ((this shover) (arg0 entity-actor)) +(defmethod init-from-entity! ((this shover) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (set! (-> this shove-up) (res-lump-float arg0 'shove :default 12288.0)) (let ((s3-0 (res-lump-value arg0 'collision-mesh-id uint128)) @@ -97,7 +93,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *shover-sg* '()) @@ -111,14 +107,14 @@ (set! sv-16 (new 'static 'res-tag)) (let ((v1-23 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-23 - (+! (-> this root-override trans x) (-> v1-23 0)) - (+! (-> this root-override trans y) (-> v1-23 1)) - (+! (-> this root-override trans z) (-> v1-23 2)) + (+! (-> this root trans x) (-> v1-23 0)) + (+! (-> this root trans y) (-> v1-23 1)) + (+! (-> this root trans z) (-> v1-23 2)) ) ) (let ((f0-13 (res-lump-float arg0 'rotoffset))) (if (!= f0-13 0.0) - (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-13) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-13) ) ) (ja-channel-set! 1) @@ -131,7 +127,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (set! *shover* this) (go shover-idle) (none) diff --git a/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc b/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc index 565e2d60ce6..f9761353969 100644 --- a/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc @@ -3,23 +3,19 @@ ;; definition of type square-platform (deftype square-platform (baseplat) - ((plat-id int32 :offset-assert 228) - (pos-u float :offset-assert 232) - (water-entity entity-actor :offset-assert 236) - (splash-counter int32 :offset-assert 240) - (start-splash-time time-frame :offset-assert 248) - (part2 sparticle-launch-control :offset-assert 256) - (part3 sparticle-launch-control :offset-assert 260) - (part4 sparticle-launch-control :offset-assert 264) - (up-pos vector :inline :offset-assert 272) - (down-pos vector :inline :offset-assert 288) + ((plat-id int32) + (pos-u float) + (water-entity entity-actor) + (splash-counter int32) + (start-splash-time time-frame) + (part2 sparticle-launch-control) + (part3 sparticle-launch-control) + (part4 sparticle-launch-control) + (up-pos vector :inline) + (down-pos vector :inline) ) - :heap-base #xc0 - :method-count-assert 28 - :size-assert #x130 - :flag-assert #x1c00c00130 (:methods - (square-platform-method-27 (_type_ symbol) none 27) + (square-platform-method-27 (_type_ symbol) none) ) (:states square-platform-lowered @@ -30,7 +26,7 @@ ) ;; definition for method 3 of type square-platform -(defmethod inspect square-platform ((this square-platform)) +(defmethod inspect ((this square-platform)) (let ((t9-0 (method-of-type baseplat inspect))) (t9-0 this) ) @@ -56,14 +52,10 @@ ;; definition of type square-platform-button (deftype square-platform-button (basebutton) () - :heap-base #x90 - :method-count-assert 32 - :size-assert #x100 - :flag-assert #x2000900100 ) ;; definition for method 3 of type square-platform-button -(defmethod inspect square-platform-button ((this square-platform-button)) +(defmethod inspect ((this square-platform-button)) (let ((t9-0 (method-of-type basebutton inspect))) (t9-0 this) ) @@ -72,20 +64,16 @@ ;; definition of type square-platform-master (deftype square-platform-master (process-drawable) - ((button-id int32 :offset-assert 176) - (plat-id int32 :offset-assert 180) - (plat-mask uint32 :offset-assert 184) - (plat-id-dir int32 :offset-assert 188) - (wiggled? symbol :offset-assert 192) - (timeout time-frame :offset-assert 200) - (last-plat-activated-time time-frame :offset-assert 208) - (delay-til-wiggle time-frame :offset-assert 216) - (ticker ticky :inline :offset-assert 224) + ((button-id int32) + (plat-id int32) + (plat-mask uint32) + (plat-id-dir int32) + (wiggled? symbol) + (timeout time-frame) + (last-plat-activated-time time-frame) + (delay-til-wiggle time-frame) + (ticker ticky :inline) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #x100 - :flag-assert #x1400900100 (:states square-platform-master-activate square-platform-master-idle @@ -93,7 +81,7 @@ ) ;; definition for method 3 of type square-platform-master -(defmethod inspect square-platform-master ((this square-platform-master)) +(defmethod inspect ((this square-platform-master)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -220,10 +208,10 @@ ;; definition for method 27 of type square-platform ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod square-platform-method-27 square-platform ((this square-platform) (arg0 symbol)) +(defmethod square-platform-method-27 ((this square-platform) (arg0 symbol)) (local-vars (v0-3 sound-id) (sv-48 int)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this root-override trans quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) (+! (-> s4-0 y) -20480.0) (let* ((v1-1 (-> this water-entity)) (a0-4 (if v1-1 @@ -431,7 +419,7 @@ ) ;; definition for method 10 of type square-platform -(defmethod deactivate square-platform ((this square-platform)) +(defmethod deactivate ((this square-platform)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -446,7 +434,7 @@ ) ;; definition for method 7 of type square-platform -(defmethod relocate square-platform ((this square-platform) (arg0 int)) +(defmethod relocate ((this square-platform) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -462,7 +450,7 @@ ;; definition for method 11 of type square-platform ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! square-platform ((this square-platform) (arg0 entity-actor)) +(defmethod init-from-entity! ((this square-platform) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) (set! (-> this pos-u) 0.0) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -483,7 +471,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set! (-> this link) (new 'process 'actor-link-info this)) @@ -515,20 +503,20 @@ ) ) ) - (set! (-> this down-pos quad) (-> this root-override trans quad)) + (set! (-> this down-pos quad) (-> this root trans quad)) (+! (-> this down-pos y) f30-0) - (set! (-> this up-pos quad) (-> this root-override trans quad)) + (set! (-> this up-pos quad) (-> this root trans quad)) (+! (-> this up-pos y) f0-10) ) ) (set! (-> this basetrans quad) (-> this down-pos quad)) - (set! (-> this root-override trans quad) (-> this basetrans quad)) + (set! (-> this root trans quad) (-> this basetrans quad)) (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 437) this)) (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 438) this)) (set! (-> this part4) (create-launch-control (-> *part-group-id-table* 439) this)) (set! (-> this water-entity) (entity-actor-lookup arg0 'alt-actor 0)) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go square-platform-lowered) (none) ) @@ -697,7 +685,7 @@ ;; definition for method 11 of type square-platform-master ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! square-platform-master ((this square-platform-master) (arg0 entity-actor)) +(defmethod init-from-entity! ((this square-platform-master) (arg0 entity-actor)) (set! (-> this button-id) -1) (set! (-> this plat-id) -1) (set! (-> this root) (new 'process 'trsqv)) diff --git a/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc b/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc index c98bbefd076..c034df919d5 100644 --- a/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc @@ -3,16 +3,13 @@ ;; definition of type steam-cap-control-pt (deftype steam-cap-control-pt (structure) - ((trans vector :inline :offset-assert 0) - (transv vector :inline :offset-assert 16) + ((trans vector :inline) + (transv vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type steam-cap-control-pt -(defmethod inspect steam-cap-control-pt ((this steam-cap-control-pt)) +(defmethod inspect ((this steam-cap-control-pt)) (format #t "[~8x] ~A~%" this 'steam-cap-control-pt) (format #t "~Ttrans: #~%" (-> this trans)) (format #t "~Ttransv: #~%" (-> this transv)) @@ -21,26 +18,22 @@ ;; definition of type steam-cap (deftype steam-cap (process-drawable) - ((root-override collide-shape-moving :offset 112) - (do-burst? symbol :offset-assert 176) - (do-falling-sound? symbol :offset-assert 180) - (do-landing-sound? symbol :offset-assert 184) - (begin-travel-up float :offset-assert 188) - (begin-travel-down float :offset-assert 192) - (sync sync-info :inline :offset-assert 196) - (part2 sparticle-launch-control :offset-assert 204) - (part3 sparticle-launch-control :offset-assert 208) - (down vector :inline :offset-assert 224) - (up vector :inline :offset-assert 240) - (control-pt steam-cap-control-pt 3 :inline :offset-assert 256) + ((root collide-shape-moving :override) + (do-burst? symbol) + (do-falling-sound? symbol) + (do-landing-sound? symbol) + (begin-travel-up float) + (begin-travel-down float) + (sync sync-info :inline) + (part2 sparticle-launch-control) + (part3 sparticle-launch-control) + (down vector :inline) + (up vector :inline) + (control-pt steam-cap-control-pt 3 :inline) ) - :heap-base #xf0 - :method-count-assert 22 - :size-assert #x160 - :flag-assert #x1600f00160 (:methods - (steam-cap-method-20 (_type_) none 20) - (steam-cap-method-21 (_type_) quaternion 21) + (steam-cap-method-20 (_type_) none) + (steam-cap-method-21 (_type_) quaternion) ) (:states steam-cap-idle @@ -48,7 +41,7 @@ ) ;; definition for method 3 of type steam-cap -(defmethod inspect steam-cap ((this steam-cap)) +(defmethod inspect ((this steam-cap)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -453,23 +446,23 @@ ;; definition for method 20 of type steam-cap ;; INFO: Return type mismatch object vs none. -(defmethod steam-cap-method-20 steam-cap ((this steam-cap)) +(defmethod steam-cap-method-20 ((this steam-cap)) (when *target* (let* ((a1-0 (target-pos 0)) (f0-0 (-> a1-0 y)) ) (when (and (>= f0-0 (+ -8192.0 (-> this down y))) - (and (>= (+ -4096.0 (-> this root-override trans y)) f0-0) (zero? (-> this root-override riders num-riders))) + (and (>= (+ -4096.0 (-> this root trans y)) f0-0) (zero? (-> this root riders num-riders))) ) (let ((f0-1 (vector-vector-xz-distance-squared (-> this down) a1-0))) (when (>= 104857600.0 f0-1) (let ((s5-0 (>= 37748736.0 f0-1))) (when (not s5-0) - (when (>= (- (-> this root-override trans y) (-> this down y)) 3072.0) + (when (>= (- (-> this root trans y) (-> this down y)) 3072.0) (let ((a1-1 (new 'stack-no-clear 'vector))) (set! (-> a1-1 x) (the-as float 1)) (set! (-> a1-1 y) (the-as float #f)) - (if (find-overlapping-shapes (-> this root-override) (the-as overlaps-others-params a1-1)) + (if (find-overlapping-shapes (-> this root) (the-as overlaps-others-params a1-1)) (set! s5-0 #t) ) ) @@ -489,7 +482,7 @@ ;; definition for method 21 of type steam-cap ;; INFO: Used lq/sq -(defmethod steam-cap-method-21 steam-cap ((this steam-cap)) +(defmethod steam-cap-method-21 ((this steam-cap)) (local-vars (at-0 int) (at-1 int) (s5-0 symbol)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -536,7 +529,7 @@ (when (< f30-1 0.94) (spawn (-> this part2) (-> this down)) (let ((a1-8 (new 'stack-no-clear 'vector))) - (set! (-> a1-8 quad) (-> this root-override trans quad)) + (set! (-> a1-8 quad) (-> this root trans quad)) (+! (-> a1-8 y) -3072.0) (spawn (-> this part3) a1-8) ) @@ -654,9 +647,9 @@ (let ((f0-32 (* 0.33333334 f0-31)) (a1-16 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-16 quad) (-> this root-override trans quad)) + (set! (-> a1-16 quad) (-> this root trans quad)) (set! (-> a1-16 y) f0-32) - (move-to-point! (-> this root-override) a1-16) + (move-to-point! (-> this root) a1-16) ) ) (let ((v1-77 (new 'stack-no-clear 'vector)) @@ -668,8 +661,8 @@ (vector-cross! s5-1 v1-77 a0-35) (vector-normalize! s5-1 1.0) (forward-up-nopitch->quaternion - (-> this root-override quat) - (vector-z-quaternion! (new-stack-vector0) (-> this root-override quat)) + (-> this root quat) + (vector-z-quaternion! (new-stack-vector0) (-> this root quat)) s5-1 ) ) @@ -690,7 +683,7 @@ ) ;; definition for method 7 of type steam-cap -(defmethod relocate steam-cap ((this steam-cap) (arg0 int)) +(defmethod relocate ((this steam-cap) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -701,7 +694,7 @@ ) ;; definition for method 10 of type steam-cap -(defmethod deactivate steam-cap ((this steam-cap)) +(defmethod deactivate ((this steam-cap)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -715,7 +708,7 @@ ;; definition for method 11 of type steam-cap ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! steam-cap ((this steam-cap) (arg0 entity-actor)) +(defmethod init-from-entity! ((this steam-cap) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -736,7 +729,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (set! (-> this do-burst?) #f) (set! (-> this do-falling-sound?) #f) @@ -753,7 +746,7 @@ ) (set! (-> s4-1 frame-num) 0.0) ) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (load-params! (-> this sync) this (the-as uint 1800) 0.0 0.15 0.15) (let ((f30-0 0.4) (f28-0 0.9) @@ -781,13 +774,13 @@ (set! (-> this begin-travel-up) f30-0) (set! (-> this begin-travel-down) f28-0) ) - (set! (-> this down quad) (-> this root-override trans quad)) - (set! (-> this up quad) (-> this root-override trans quad)) + (set! (-> this down quad) (-> this root trans quad)) + (set! (-> this up quad) (-> this root trans quad)) (+! (-> this up y) 40960.0) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 441) this)) (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 442) this)) (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 443) this)) - (vector-reset! (-> this root-override transv)) + (vector-reset! (-> this root transv)) (let ((s5-1 (new 'stack-no-clear 'vector)) (f30-1 0.0) ) @@ -796,7 +789,7 @@ (set-vector! s5-1 0.0 0.0 10240.0 1.0) (vector-rotate-around-y! s5-1 s5-1 f30-1) (set! f30-1 (+ 21845.334 f30-1)) - (vector+! (-> s3-1 trans) s5-1 (-> this root-override trans)) + (vector+! (-> s3-1 trans) s5-1 (-> this root trans)) (vector-reset! (-> s3-1 transv)) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc index 2da6edb3ac7..db277bfb1ab 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc @@ -3,18 +3,14 @@ ;; definition of type blue-eco-charger-orb (deftype blue-eco-charger-orb (process-drawable) - ((parent-process (pointer blue-eco-charger) :offset 12) - (orbit-rot vector :inline :offset-assert 176) - (orbit-rotv vector :inline :offset-assert 192) - (targ-orbit-rotv vector :inline :offset-assert 208) - (rest-pos vector :inline :offset-assert 224) + ((parent-process (pointer blue-eco-charger) :overlay-at parent) + (orbit-rot vector :inline) + (orbit-rotv vector :inline) + (targ-orbit-rotv vector :inline) + (rest-pos vector :inline) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #xf0 - :flag-assert #x15008000f0 (:methods - (blue-eco-charger-orb-method-20 (_type_ float) vector 20) + (blue-eco-charger-orb-method-20 (_type_ float) vector) ) (:states blue-eco-charger-orb-active @@ -23,7 +19,7 @@ ) ;; definition for method 3 of type blue-eco-charger-orb -(defmethod inspect blue-eco-charger-orb ((this blue-eco-charger-orb)) +(defmethod inspect ((this blue-eco-charger-orb)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -42,18 +38,14 @@ ;; definition of type blue-eco-charger (deftype blue-eco-charger (process-drawable) - ((root-override collide-shape :offset 112) - (charger-id int32 :offset-assert 176) - (open-level float :offset-assert 180) - (master entity-actor :offset-assert 184) + ((root collide-shape :override) + (charger-id int32) + (open-level float) + (master entity-actor) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xbc - :flag-assert #x16005000bc (:methods - (blue-eco-charger-method-20 (_type_) object 20) - (blue-eco-charger-method-21 (_type_ symbol) object 21) + (blue-eco-charger-method-20 (_type_) object) + (blue-eco-charger-method-21 (_type_ symbol) object) ) (:states blue-eco-charger-close @@ -64,7 +56,7 @@ ) ;; definition for method 3 of type blue-eco-charger -(defmethod inspect blue-eco-charger ((this blue-eco-charger)) +(defmethod inspect ((this blue-eco-charger)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -82,19 +74,16 @@ ;; definition of type exit-chamber-items (deftype exit-chamber-items (structure) - ((door-pos vector :inline :offset-assert 0) - (door-quat quaternion :inline :offset-assert 16) - (button-pos vector :inline :offset-assert 32) - (button-quat quaternion :inline :offset-assert 48) - (fcell-pos vector :inline :offset-assert 64) + ((door-pos vector :inline) + (door-quat quaternion :inline) + (button-pos vector :inline) + (button-quat quaternion :inline) + (fcell-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type exit-chamber-items -(defmethod inspect exit-chamber-items ((this exit-chamber-items)) +(defmethod inspect ((this exit-chamber-items)) (format #t "[~8x] ~A~%" this 'exit-chamber-items) (format #t "~Tdoor-pos: #~%" (-> this door-pos)) (format #t "~Tdoor-quat: #~%" (-> this door-quat)) @@ -106,28 +95,24 @@ ;; definition of type exit-chamber (deftype exit-chamber (process-drawable) - ((root-override collide-shape-moving :offset 112) - (chargers-active uint32 :offset-assert 176) - (move-player? symbol :offset-assert 180) - (move-fcell? symbol :offset-assert 184) - (play-assistant-message? symbol :offset-assert 188) - (wave-scale float :offset-assert 192) - (button (pointer exit-chamber-button) :offset-assert 196) - (door (pointer sun-iris-door) :offset-assert 200) - (fcell-handle handle :offset-assert 208) - (orig-trans vector :inline :offset-assert 224) - (last-pos vector :inline :offset-assert 240) + ((root collide-shape-moving :override) + (chargers-active uint32) + (move-player? symbol) + (move-fcell? symbol) + (play-assistant-message? symbol) + (wave-scale float) + (button (pointer exit-chamber-button)) + (door (pointer sun-iris-door)) + (fcell-handle handle) + (orig-trans vector :inline) + (last-pos vector :inline) ) - :heap-base #x90 - :method-count-assert 25 - :size-assert #x100 - :flag-assert #x1900900100 (:methods - (exit-chamber-method-20 (_type_ float) float 20) - (exit-chamber-method-21 (_type_ exit-chamber-items) vector 21) - (exit-chamber-method-22 (_type_) none 22) - (exit-chamber-method-23 (_type_ symbol) object 23) - (exit-chamber-method-24 (_type_ float) none 24) + (exit-chamber-method-20 (_type_ float) float) + (exit-chamber-method-21 (_type_ exit-chamber-items) vector) + (exit-chamber-method-22 (_type_) none) + (exit-chamber-method-23 (_type_ symbol) object) + (exit-chamber-method-24 (_type_ float) none) ) (:states exit-chamber-charger-puzzle @@ -140,7 +125,7 @@ ) ;; definition for method 3 of type exit-chamber -(defmethod inspect exit-chamber ((this exit-chamber)) +(defmethod inspect ((this exit-chamber)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -232,7 +217,7 @@ ) ;; definition for method 20 of type blue-eco-charger-orb -(defmethod blue-eco-charger-orb-method-20 blue-eco-charger-orb ((this blue-eco-charger-orb) (arg0 float)) +(defmethod blue-eco-charger-orb-method-20 ((this blue-eco-charger-orb) (arg0 float)) (set-vector! (-> this targ-orbit-rotv) (rand-vu-float-range 72817.78 258503.11) @@ -327,7 +312,7 @@ (set! (-> gp-1 y) (rand-vu-float-range -4096.0 4096.0)) (set! (-> gp-1 z) (rand-vu-float-range -4096.0 4096.0)) (vector+! gp-1 gp-1 (-> self root trans)) - (vector-lerp! gp-1 gp-1 (-> self parent-process 0 root-override trans) (rand-vu-float-range 0.2 0.8)) + (vector-lerp! gp-1 gp-1 (-> self parent-process 0 root trans) (rand-vu-float-range 0.2 0.8)) (eco-blue-glow gp-1) ) (suspend) @@ -357,7 +342,7 @@ ) ;; definition for method 21 of type blue-eco-charger -(defmethod blue-eco-charger-method-21 blue-eco-charger ((this blue-eco-charger) (arg0 symbol)) +(defmethod blue-eco-charger-method-21 ((this blue-eco-charger) (arg0 symbol)) (let* ((v1-0 (-> this master)) (a0-1 (if v1-0 (-> v1-0 extra process) @@ -388,8 +373,8 @@ ) ;; definition for method 20 of type blue-eco-charger -(defmethod blue-eco-charger-method-20 blue-eco-charger ((this blue-eco-charger)) - (and (and *target* (>= 16384.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans)))) +(defmethod blue-eco-charger-method-20 ((this blue-eco-charger)) + (and (and *target* (>= 16384.0 (vector-vector-distance (-> this root trans) (-> *target* control trans)))) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) @@ -402,7 +387,7 @@ (ja :group! blue-eco-charger-open-ja :num! min) (loop (when (logtest? (-> self draw status) (draw-status was-drawn)) - (if (and (and *target* (>= 16384.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and (and *target* (>= 16384.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) ) (level-hint-spawn @@ -514,7 +499,7 @@ ;; definition for method 11 of type blue-eco-charger ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! blue-eco-charger ((this blue-eco-charger) (arg0 entity-actor)) +(defmethod init-from-entity! ((this blue-eco-charger) (arg0 entity-actor)) (set! (-> this open-level) 0.0) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -528,13 +513,13 @@ ) (set! (-> s4-0 nav-radius) 6553.6) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *blue-eco-charger-sg* '()) (let ((f0-6 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-6 0.0) - (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-6) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-6) ) ) (ja-channel-set! 1) @@ -547,14 +532,14 @@ (set! (-> s4-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (update-transforms! (-> this root)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (set! (-> this master) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> this link) (new 'process 'actor-link-info this)) (set! (-> this charger-id) (+ (actor-count-before (-> this link)) 1)) (process-spawn blue-eco-charger-orb (-> this entity) this :to this) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "blue-eco-charg" :fo-max 35) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "blue-eco-charg" :fo-max 35) (-> this root trans)) ) (if (zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) (go blue-eco-charger-idle) @@ -566,14 +551,10 @@ ;; definition of type exit-chamber-button (deftype exit-chamber-button (basebutton) () - :heap-base #x90 - :method-count-assert 32 - :size-assert #x100 - :flag-assert #x2000900100 ) ;; definition for method 3 of type exit-chamber-button -(defmethod inspect exit-chamber-button ((this exit-chamber-button)) +(defmethod inspect ((this exit-chamber-button)) (let ((t9-0 (method-of-type basebutton inspect))) (t9-0 this) ) @@ -587,8 +568,8 @@ ) ;; definition for method 20 of type exit-chamber -(defmethod exit-chamber-method-20 exit-chamber ((this exit-chamber) (arg0 float)) - (set! (-> this root-override trans y) +(defmethod exit-chamber-method-20 ((this exit-chamber) (arg0 float)) + (set! (-> this root trans y) (+ (-> this orig-trans y) (* 2252.8 arg0 (cos (* 36.40889 (the float (mod (current-time) 1800)))))) ) ) @@ -614,7 +595,7 @@ ) ;; definition for method 24 of type exit-chamber -(defmethod exit-chamber-method-24 exit-chamber ((this exit-chamber) (arg0 float)) +(defmethod exit-chamber-method-24 ((this exit-chamber) (arg0 float)) (let ((s4-0 (-> this node-list data 3 bone transform)) (f30-0 (rand-vu-float-range 0.0 65536.0)) (f28-0 (rand-vu-float-range 8192.0 40960.0)) @@ -630,7 +611,7 @@ ) ;; definition for method 21 of type exit-chamber -(defmethod exit-chamber-method-21 exit-chamber ((this exit-chamber) (arg0 exit-chamber-items)) +(defmethod exit-chamber-method-21 ((this exit-chamber) (arg0 exit-chamber-items)) (let ((s5-0 (-> this node-list data 3 bone transform))) (set-vector! (-> arg0 door-pos) 0.0 13107.2 -40960.0 1.0) (vector-matrix*! (-> arg0 door-pos) (-> arg0 door-pos) s5-0) @@ -648,11 +629,11 @@ ;; definition for method 23 of type exit-chamber ;; INFO: Used lq/sq -(defmethod exit-chamber-method-23 exit-chamber ((this exit-chamber) (arg0 symbol)) +(defmethod exit-chamber-method-23 ((this exit-chamber) (arg0 symbol)) (new 'stack-no-clear 'vector) (let ((s5-0 (new 'stack-no-clear 'vector))) (vector<-cspace! (-> this last-pos) (-> this node-list data 3)) - (vector-! s5-0 (-> this last-pos) (-> this root-override trans)) + (vector-! s5-0 (-> this last-pos) (-> this root trans)) (set! (-> this draw bounds quad) (-> s5-0 quad)) ) (+! (-> this draw bounds y) 16384.0) @@ -676,7 +657,7 @@ (when arg0 (let ((a0-12 (handle->process (-> this fcell-handle)))) (when a0-12 - (when (or (-> this move-fcell?) (< (-> (the-as fuel-cell a0-12) root-override trans y) (-> s5-1 fcell-pos y))) + (when (or (-> this move-fcell?) (< (-> (the-as fuel-cell a0-12) root trans y) (-> s5-1 fcell-pos y))) (when (not (-> this move-fcell?)) (set! (-> this move-fcell?) #t) (let ((v1-50 (-> this entity extra perm))) @@ -732,7 +713,7 @@ ) :code (behavior () (loop - (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root-override trans))) + (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root trans))) (logclear! (-> self draw status) (draw-status hidden)) (logior! (-> self draw status) (draw-status hidden)) ) @@ -745,16 +726,7 @@ ;; failed to figure out what this is: (defstate exit-chamber-charger-puzzle-beaten (exit-chamber) :code (behavior () - (process-spawn - pov-camera - (-> self root-override trans) - *sunkencam-sg* - "exit-chamber-door-open" - 0 - #f - '() - :to self - ) + (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "exit-chamber-door-open" 0 #f '() :to self) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 2.5)) (suspend) @@ -802,7 +774,7 @@ (send-event (ppointer->process (-> self button)) 'untrigger) ) (loop - (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root-override trans))) + (if (>= 214228270000.0 (vector-vector-distance-squared (camera-pos) (-> self root trans))) (logclear! (-> self draw status) (draw-status hidden)) (logior! (-> self draw status) (draw-status hidden)) ) @@ -825,7 +797,7 @@ (aybabtu 2) (let ((v1-1 (handle->process (-> self fcell-handle)))) (if v1-1 - (clear-collide-with-as (-> (the-as fuel-cell v1-1) root-override)) + (clear-collide-with-as (-> (the-as fuel-cell v1-1) root)) ) ) (close-specific-task! (game-task sunken-room) (task-status need-reminder)) @@ -838,7 +810,7 @@ (run-now-in-process gp-0 pov-camera-init-by-other - (-> self root-override trans) + (-> self root trans) *sunkencam-sg* "qbert-show-door-open" 0 @@ -916,7 +888,7 @@ (send-event *target* 'dry) (let ((v1-143 (handle->process (-> self fcell-handle)))) (if v1-143 - (restore-collide-with-as (-> (the-as fuel-cell v1-143) root-override)) + (restore-collide-with-as (-> (the-as fuel-cell v1-143) root)) ) ) (set-time! (-> self state-time)) @@ -1030,7 +1002,7 @@ (set! (-> self move-player?) #t) (let ((v1-2 (handle->process (-> self fcell-handle)))) (if v1-2 - (clear-collide-with-as (-> (the-as fuel-cell v1-2) root-override)) + (clear-collide-with-as (-> (the-as fuel-cell v1-2) root)) ) ) ) @@ -1045,7 +1017,7 @@ (let ((v1-1 (process-spawn sunkencam :init pov-camera-init-by-other - (-> self root-override trans) + (-> self root trans) *sunkencam-sg* "qbert-show-door-open" 0 @@ -1109,7 +1081,7 @@ ) (let ((v1-109 (handle->process (-> self fcell-handle)))) (if v1-109 - (restore-collide-with-as (-> (the-as fuel-cell v1-109) root-override)) + (restore-collide-with-as (-> (the-as fuel-cell v1-109) root)) ) ) (set-time! (-> self state-time)) @@ -1131,7 +1103,7 @@ ;; definition for method 11 of type exit-chamber ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! exit-chamber ((this exit-chamber) (arg0 entity-actor)) +(defmethod init-from-entity! ((this exit-chamber) (arg0 entity-actor)) (process-entity-status! this (entity-perm-status bit-3) #t) (process-entity-status! this (entity-perm-status bit-7) #t) (set! (-> this move-player?) #f) @@ -1157,7 +1129,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *exit-chamber-sg* '()) @@ -1212,7 +1184,7 @@ ) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (exit-chamber-method-21 this (the-as exit-chamber-items s3-1)) (let ((s1-3 #t)) (let ((v1-64 s4-1)) @@ -1232,12 +1204,8 @@ (set! (-> this button) (process-spawn exit-chamber-button (-> s3-1 vector 2) (-> s3-1 vector 3) arg0 #f :to this) ) - (set! (-> this sound) (new - 'process - 'ambient-sound - (static-sound-spec "chamber-move" :fo-min 300 :fo-max 400) - (-> this root-override trans) - ) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "chamber-move" :fo-min 300 :fo-max 400) (-> this root trans)) ) (when (not (task-complete? *game-info* (game-task sunken-room))) (let ((a0-40 (new 'stack-no-clear 'vector))) @@ -1258,8 +1226,8 @@ ) ) ) - (set! (-> this orig-trans quad) (-> this root-override trans quad)) - (set! (-> this last-pos quad) (-> this root-override trans quad)) + (set! (-> this orig-trans quad) (-> this root trans quad)) + (set! (-> this last-pos quad) (-> this root trans quad)) (set! (-> this move-player?) #f) (exit-chamber-method-23 this #t) (set! (-> this move-player?) #f) diff --git a/test/decompiler/reference/jak1/levels/sunken/sun-iris-door_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sun-iris-door_REF.gc index 0361936ef49..9013fa0d635 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sun-iris-door_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sun-iris-door_REF.gc @@ -3,25 +3,21 @@ ;; definition of type sun-iris-door (deftype sun-iris-door (process-drawable) - ((root-override collide-shape :offset 112) - (timeout float :offset-assert 176) - (proximity? symbol :offset-assert 180) - (directional-proximity? symbol :offset-assert 184) - (move-to? symbol :offset-assert 188) - (locked-by-task? symbol :offset-assert 192) - (close-dist float :offset-assert 196) - (open-dist float :offset-assert 200) - (move-to-pos vector :inline :offset-assert 208) - (outward-vec vector :inline :offset-assert 224) - (move-to-quat quaternion :inline :offset-assert 240) + ((root collide-shape :override) + (timeout float) + (proximity? symbol) + (directional-proximity? symbol) + (move-to? symbol) + (locked-by-task? symbol) + (close-dist float) + (open-dist float) + (move-to-pos vector :inline) + (outward-vec vector :inline) + (move-to-quat quaternion :inline) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x100 - :flag-assert #x1600900100 (:methods - (should-close? (_type_) symbol 20) - (should-open? (_type_) symbol 21) + (should-close? (_type_) symbol) + (should-open? (_type_) symbol) ) (:states sun-iris-door-closed @@ -32,7 +28,7 @@ ) ;; definition for method 3 of type sun-iris-door -(defmethod inspect sun-iris-door ((this sun-iris-door)) +(defmethod inspect ((this sun-iris-door)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -56,27 +52,27 @@ ) ;; definition for method 21 of type sun-iris-door -(defmethod should-open? sun-iris-door ((this sun-iris-door)) +(defmethod should-open? ((this sun-iris-door)) (let ((f30-0 1228800.0)) 0.0 (let ((f0-7 (cond ((-> this directional-proximity?) (let ((s5-0 (new 'stack-no-clear 'vector))) (when *target* - (vector-! s5-0 (target-pos 0) (-> this root-override trans)) + (vector-! s5-0 (target-pos 0) (-> this root trans)) (set! (-> s5-0 y) 0.0) (set! f30-0 (fabs (vector-dot s5-0 (-> this outward-vec)))) ) - (vector-! s5-0 (camera-pos) (-> this root-override trans)) + (vector-! s5-0 (camera-pos) (-> this root trans)) (set! (-> s5-0 y) 0.0) (fabs (vector-dot s5-0 (-> this outward-vec))) ) ) (else (if *target* - (set! f30-0 (vector-vector-xz-distance (-> this root-override trans) (target-pos 0))) + (set! f30-0 (vector-vector-xz-distance (-> this root trans) (target-pos 0))) ) - (vector-vector-xz-distance (-> this root-override trans) (camera-pos)) + (vector-vector-xz-distance (-> this root trans) (camera-pos)) ) ) ) @@ -121,8 +117,8 @@ :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) - (move-to-point! (-> self root-override) (-> self move-to-pos)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (move-to-point! (-> self root) (-> self move-to-pos)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (ja-post) ) ) @@ -156,8 +152,8 @@ (cond ((-> self move-to?) (set! (-> self move-to?) #f) - (move-to-point! (-> self root-override) (-> self move-to-pos)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (move-to-point! (-> self root) (-> self move-to-pos)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (ja-post) ) (else @@ -168,27 +164,27 @@ ) ;; definition for method 20 of type sun-iris-door -(defmethod should-close? sun-iris-door ((this sun-iris-door)) +(defmethod should-close? ((this sun-iris-door)) (let ((f30-0 1228800.0)) 0.0 (let ((f0-7 (cond ((-> this directional-proximity?) (let ((s5-0 (new 'stack-no-clear 'vector))) (when *target* - (vector-! s5-0 (target-pos 0) (-> this root-override trans)) + (vector-! s5-0 (target-pos 0) (-> this root trans)) (set! (-> s5-0 y) 0.0) (set! f30-0 (fabs (vector-dot s5-0 (-> this outward-vec)))) ) - (vector-! s5-0 (camera-pos) (-> this root-override trans)) + (vector-! s5-0 (camera-pos) (-> this root trans)) (set! (-> s5-0 y) 0.0) (fabs (vector-dot s5-0 (-> this outward-vec))) ) ) (else (if *target* - (set! f30-0 (vector-vector-xz-distance (-> this root-override trans) (target-pos 0))) + (set! f30-0 (vector-vector-xz-distance (-> this root trans) (target-pos 0))) ) - (vector-vector-xz-distance (-> this root-override trans) (camera-pos)) + (vector-vector-xz-distance (-> this root trans) (camera-pos)) ) ) ) @@ -199,9 +195,9 @@ (let ((s4-6 (new 'stack-no-clear 'vector)) (s5-3 (new 'stack-no-clear 'vector)) ) - (vector-! s4-6 (target-pos 0) (-> this root-override trans)) + (vector-! s4-6 (target-pos 0) (-> this root trans)) (set! (-> s4-6 y) 0.0) - (vector-! s5-3 (camera-pos) (-> this root-override trans)) + (vector-! s5-3 (camera-pos) (-> this root trans)) (set! (-> s5-3 y) 0.0) (case (>= (vector-dot (-> this outward-vec) s4-6) 0.0) (((>= (vector-dot (-> this outward-vec) s5-3) 0.0)) @@ -242,11 +238,11 @@ ) :enter (behavior () (set-time! (-> self state-time)) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (logior! (-> self draw status) (draw-status hidden)) ) :exit (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (logclear! (-> self draw status) (draw-status hidden)) ) :trans (behavior () @@ -268,8 +264,8 @@ :post (behavior () (when (-> self move-to?) (set! (-> self move-to?) #f) - (move-to-point! (-> self root-override) (-> self move-to-pos)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (move-to-point! (-> self root) (-> self move-to-pos)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (ja-post) ) ) @@ -303,8 +299,8 @@ (cond ((-> self move-to?) (set! (-> self move-to?) #f) - (move-to-point! (-> self root-override) (-> self move-to-pos)) - (quaternion-copy! (-> self root-override quat) (-> self move-to-quat)) + (move-to-point! (-> self root) (-> self move-to-pos)) + (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (ja-post) ) (else @@ -317,7 +313,7 @@ ;; definition for method 11 of type sun-iris-door ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! sun-iris-door ((this sun-iris-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sun-iris-door) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (set! (-> this move-to?) #f) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) @@ -332,7 +328,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *sun-iris-door-sg* '()) @@ -348,21 +344,21 @@ ) (set! (-> this locked-by-task?) (nonzero? (-> this entity extra perm task))) (let ((f0-11 (res-lump-float arg0 'scale-factor :default 1.0))) - (set-vector! (-> this root-override scale) f0-11 f0-11 f0-11 1.0) + (set-vector! (-> this root scale) f0-11 f0-11 f0-11 1.0) (set! (-> this draw bounds w) (* 18432.0 f0-11)) - (let ((v1-25 (-> this root-override root-prim))) + (let ((v1-25 (-> this root root-prim))) (set! (-> v1-25 local-sphere w) (* 24576.0 f0-11 f0-11)) ) ) (set! sv-16 (new 'static 'res-tag)) (let ((v1-28 (res-lump-data (-> this entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-28 - (+! (-> this root-override trans x) (-> v1-28 0)) - (+! (-> this root-override trans y) (-> v1-28 1)) - (+! (-> this root-override trans z) (-> v1-28 2)) + (+! (-> this root trans x) (-> v1-28 0)) + (+! (-> this root trans y) (-> v1-28 1)) + (+! (-> this root trans z) (-> v1-28 2)) ) ) - (let ((f30-0 (quaternion-y-angle (-> this root-override quat)))) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (set-vector! (-> this outward-vec) (sin f30-0) 0.0 (cos f30-0) 1.0) ) (ja-channel-set! 1) @@ -374,7 +370,7 @@ ) (set! (-> s5-2 frame-num) 0.0) ) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (ja-post) (go sun-iris-door-closed) (none) @@ -397,10 +393,10 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> self root-override) s3-0) + (set! (-> self root) s3-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (quaternion-copy! (-> self root-override quat) arg1) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) (initialize-skeleton self *sun-iris-door-sg* '()) (set! (-> self close-dist) 49152.0) (set! (-> self open-dist) 40960.0) diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-fish_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-fish_REF.gc index b16c520d201..a9543039ef5 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-fish_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-fish_REF.gc @@ -3,34 +3,30 @@ ;; definition of type sunkenfisha (deftype sunkenfisha (process-drawable) - ((path-u float :offset-assert 176) - (path-speed float :offset-assert 180) - (path-speed-seek-speed float :offset-assert 184) - (targ-path-speed float :offset-assert 188) - (path-normal-speed-lo float :offset-assert 192) - (path-normal-speed-hi float :offset-assert 196) - (path-dir float :offset-assert 200) - (change-path-dir-time time-frame :offset-assert 208) - (local-path-offset vector :inline :offset-assert 224) - (targ-local-path-offset vector :inline :offset-assert 240) - (local-path-offset-dir vector :inline :offset-assert 256) - (max-local-path-offset vector :inline :offset-assert 272) - (facing-rot vector :inline :offset-assert 288) - (path-trans-offset vector :inline :offset-assert 304) + ((path-u float) + (path-speed float) + (path-speed-seek-speed float) + (targ-path-speed float) + (path-normal-speed-lo float) + (path-normal-speed-hi float) + (path-dir float) + (change-path-dir-time time-frame) + (local-path-offset vector :inline) + (targ-local-path-offset vector :inline) + (local-path-offset-dir vector :inline) + (max-local-path-offset vector :inline) + (facing-rot vector :inline) + (path-trans-offset vector :inline) ) - :heap-base #xd0 - :method-count-assert 28 - :size-assert #x140 - :flag-assert #x1c00d00140 (:methods - (sunkenfisha-method-20 (_type_) float 20) - (sunkenfisha-method-21 (_type_ vector float vector) vector 21) - (sunkenfisha-method-22 (_type_) none 22) - (sunkenfisha-method-23 (_type_) quaternion 23) - (sunkenfisha-method-24 (_type_) vector 24) - (sunkenfisha-method-25 (_type_) none 25) - (sunkenfisha-method-26 (_type_) float 26) - (sunkenfisha-method-27 (_type_) float 27) + (sunkenfisha-method-20 (_type_) float) + (sunkenfisha-method-21 (_type_ vector float vector) vector) + (sunkenfisha-method-22 (_type_) none) + (sunkenfisha-method-23 (_type_) quaternion) + (sunkenfisha-method-24 (_type_) vector) + (sunkenfisha-method-25 (_type_) none) + (sunkenfisha-method-26 (_type_) float) + (sunkenfisha-method-27 (_type_) float) ) (:states sunkenfisha-idle @@ -38,7 +34,7 @@ ) ;; definition for method 3 of type sunkenfisha -(defmethod inspect sunkenfisha ((this sunkenfisha)) +(defmethod inspect ((this sunkenfisha)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -79,13 +75,13 @@ ;; definition for method 22 of type sunkenfisha ;; INFO: Return type mismatch int vs none. -(defmethod sunkenfisha-method-22 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-22 ((this sunkenfisha)) 0 (none) ) ;; definition for method 21 of type sunkenfisha -(defmethod sunkenfisha-method-21 sunkenfisha ((this sunkenfisha) (arg0 vector) (arg1 float) (arg2 vector)) +(defmethod sunkenfisha-method-21 ((this sunkenfisha) (arg0 vector) (arg1 float) (arg2 vector)) (eval-path-curve! (-> this path) arg0 arg1 'interp) (vector+! arg0 arg0 (-> this path-trans-offset)) (let ((s2-0 (new 'stack-no-clear 'vector))) @@ -100,7 +96,7 @@ ) ;; definition for method 24 of type sunkenfisha -(defmethod sunkenfisha-method-24 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-24 ((this sunkenfisha)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'matrix)) (gp-0 (new 'stack-no-clear 'vector)) @@ -134,7 +130,7 @@ ;; definition for method 25 of type sunkenfisha ;; INFO: Return type mismatch float vs none. -(defmethod sunkenfisha-method-25 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-25 ((this sunkenfisha)) (let* ((f0-0 (-> this path-speed)) (f1-1 (seek f0-0 (-> this targ-path-speed) (* (-> this path-speed-seek-speed) (seconds-per-frame)))) ) @@ -157,7 +153,7 @@ ) ;; definition for method 23 of type sunkenfisha -(defmethod sunkenfisha-method-23 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-23 ((this sunkenfisha)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set-vector! s5-0 (- (vector-x-angle (-> this root transv))) (vector-y-angle (-> this root transv)) 0.0 1.0) (set! (-> this facing-rot x) @@ -171,7 +167,7 @@ ) ;; definition for method 20 of type sunkenfisha -(defmethod sunkenfisha-method-20 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-20 ((this sunkenfisha)) (set! (-> this path-dir) (- (-> this path-dir))) (set! (-> this path-speed) 0.0) (set! (-> this targ-path-speed) @@ -238,7 +234,7 @@ ) ;; definition for method 26 of type sunkenfisha -(defmethod sunkenfisha-method-26 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-26 ((this sunkenfisha)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this (-> this entity)) (set-vector! (-> this root scale) 6.0 6.0 6.0 1.0) @@ -268,7 +264,7 @@ ;; definition for method 27 of type sunkenfisha ;; INFO: Used lq/sq -(defmethod sunkenfisha-method-27 sunkenfisha ((this sunkenfisha)) +(defmethod sunkenfisha-method-27 ((this sunkenfisha)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) (vector-reset! (-> this path-trans-offset)) (set! (-> this path-u) (rand-vu-float-range 0.0 1.0)) @@ -357,7 +353,7 @@ ;; definition for method 11 of type sunkenfisha ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! sunkenfisha ((this sunkenfisha) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sunkenfisha) (arg0 entity-actor)) (sunkenfisha-method-26 this) (sunkenfisha-method-27 this) (let ((s5-0 (+ (res-lump-value (-> this entity) 'count uint128 :default (the-as uint128 1)) -1))) diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-obs_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-obs_REF.gc index a1ff5c86570..f4bb1a87692 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-obs_REF.gc @@ -4,13 +4,10 @@ ;; definition of type water-vol-deadly (deftype water-vol-deadly (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) ;; definition for method 3 of type water-vol-deadly -(defmethod inspect water-vol-deadly ((this water-vol-deadly)) +(defmethod inspect ((this water-vol-deadly)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -43,16 +40,12 @@ ;; definition of type side-to-side-plat (deftype side-to-side-plat (plat) - ((part-ry float :offset-assert 264) + ((part-ry float) ) - :heap-base #xa0 - :method-count-assert 33 - :size-assert #x10c - :flag-assert #x2100a0010c ) ;; definition for method 3 of type side-to-side-plat -(defmethod inspect side-to-side-plat ((this side-to-side-plat)) +(defmethod inspect ((this side-to-side-plat)) (let ((t9-0 (method-of-type plat inspect))) (t9-0 this) ) @@ -122,13 +115,13 @@ ) ;; definition for method 23 of type side-to-side-plat -(defmethod get-unlit-skel side-to-side-plat ((this side-to-side-plat)) +(defmethod get-unlit-skel ((this side-to-side-plat)) *side-to-side-plat-sg* ) ;; definition for method 24 of type side-to-side-plat ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 side-to-side-plat ((this side-to-side-plat)) +(defmethod baseplat-method-24 ((this side-to-side-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -147,7 +140,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -155,14 +148,14 @@ ;; definition for method 26 of type side-to-side-plat ;; INFO: Return type mismatch float vs none. -(defmethod baseplat-method-26 side-to-side-plat ((this side-to-side-plat)) - (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root-override quat)))) +(defmethod baseplat-method-26 ((this side-to-side-plat)) + (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root quat)))) (none) ) ;; definition for method 25 of type side-to-side-plat ;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group. -(defmethod baseplat-method-25 side-to-side-plat ((this side-to-side-plat)) +(defmethod baseplat-method-25 ((this side-to-side-plat)) (let ((v0-0 (create-launch-control (-> *part-group-id-table* 436) this))) (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) @@ -171,28 +164,24 @@ ;; definition for method 20 of type side-to-side-plat ;; INFO: Return type mismatch object vs none. -(defmethod baseplat-method-20 side-to-side-plat ((this side-to-side-plat)) +(defmethod baseplat-method-20 ((this side-to-side-plat)) (when (nonzero? (-> this part)) (set! (-> *part-id-table* 1713 init-specs 14 initial-valuef) (-> this part-ry)) (set! (-> *part-id-table* 1714 init-specs 19 initial-valuef) (-> this part-ry)) - (spawn (-> this part) (-> this root-override trans)) + (spawn (-> this part) (-> this root trans)) ) (none) ) ;; definition of type sunkencam (deftype sunkencam (pov-camera) - ((ppointer-override (pointer sunkencam) :offset 24) - (seq uint64 :offset-assert 224) + ((ppointer-override (pointer sunkencam) :overlay-at ppointer) + (seq uint64) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xe8 - :flag-assert #x1e008000e8 ) ;; definition for method 3 of type sunkencam -(defmethod inspect sunkencam ((this sunkencam)) +(defmethod inspect ((this sunkencam)) (let ((t9-0 (method-of-type pov-camera inspect))) (t9-0 this) ) @@ -207,7 +196,7 @@ ) ;; definition for method 29 of type sunkencam -(defmethod set-stack-size! sunkencam ((this sunkencam)) +(defmethod set-stack-size! ((this sunkencam)) (stack-size-set! (-> this main-thread) 512) (none) ) @@ -359,19 +348,15 @@ ;; definition of type seaweed (deftype seaweed (process-drawable) - ((anim-speed float :offset-assert 176) + ((anim-speed float) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states seaweed-idle ) ) ;; definition for method 3 of type seaweed -(defmethod inspect seaweed ((this seaweed)) +(defmethod inspect ((this seaweed)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -406,7 +391,7 @@ ;; definition for method 11 of type seaweed ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! seaweed ((this seaweed) (arg0 entity-actor)) +(defmethod init-from-entity! ((this seaweed) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *seaweed-sg* '()) diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-part_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-part_REF.gc index 3e8d89b027e..833ca3c7c09 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type sunken-part (deftype sunken-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type sunken-part -(defmethod inspect sunken-part ((this sunken-part)) +(defmethod inspect ((this sunken-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc index fa363686dda..81a890afcb9 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc @@ -4,14 +4,10 @@ ;; definition of type sunken-pipegame-button (deftype sunken-pipegame-button (basebutton) () - :heap-base #x90 - :method-count-assert 32 - :size-assert #x100 - :flag-assert #x2000900100 ) ;; definition for method 3 of type sunken-pipegame-button -(defmethod inspect sunken-pipegame-button ((this sunken-pipegame-button)) +(defmethod inspect ((this sunken-pipegame-button)) (let ((t9-0 (method-of-type basebutton inspect))) (t9-0 this) ) @@ -20,26 +16,23 @@ ;; definition of type sunken-pipegame-prize (deftype sunken-pipegame-prize (structure) - ((puzzle-delay time-frame :offset-assert 0) - (pipe-travel-time-to-far time-frame :offset-assert 8) - (pipe-travel-time-to-jar time-frame :offset-assert 16) - (actor-handle handle :offset-assert 24) - (jar-pos vector :inline :offset-assert 32) - (far-pos vector :inline :offset-assert 48) - (sucked-up-jar-part-pos vector :inline :offset-assert 64) - (sucked-up-far-part-pos vector :inline :offset-assert 80) - (blown-out-jar-part-pos vector :inline :offset-assert 96) - (blown-out-far-part-pos vector :inline :offset-assert 112) - (sucked-up-part sparticle-launch-control :offset-assert 128) - (blown-out-part sparticle-launch-control :offset-assert 132) + ((puzzle-delay time-frame) + (pipe-travel-time-to-far time-frame) + (pipe-travel-time-to-jar time-frame) + (actor-handle handle) + (jar-pos vector :inline) + (far-pos vector :inline) + (sucked-up-jar-part-pos vector :inline) + (sucked-up-far-part-pos vector :inline) + (blown-out-jar-part-pos vector :inline) + (blown-out-far-part-pos vector :inline) + (sucked-up-part sparticle-launch-control) + (blown-out-part sparticle-launch-control) ) - :method-count-assert 9 - :size-assert #x88 - :flag-assert #x900000088 ) ;; definition for method 3 of type sunken-pipegame-prize -(defmethod inspect sunken-pipegame-prize ((this sunken-pipegame-prize)) +(defmethod inspect ((this sunken-pipegame-prize)) (format #t "[~8x] ~A~%" this 'sunken-pipegame-prize) (format #t "~Tpuzzle-delay: ~D~%" (-> this puzzle-delay)) (format #t "~Tpipe-travel-time-to-far: ~D~%" (-> this pipe-travel-time-to-far)) @@ -58,21 +51,17 @@ ;; definition of type sunken-pipegame (deftype sunken-pipegame (process-drawable) - ((abort-audio-if-beaten? symbol :offset-assert 176) - (challenges-mask uint32 :offset-assert 180) - (challenge int32 :offset-assert 184) - (ticker ticky :inline :offset-assert 192) - (button (pointer sunken-pipegame-button) 3 :offset-assert 224) - (prize sunken-pipegame-prize 3 :inline :offset-assert 240) + ((abort-audio-if-beaten? symbol) + (challenges-mask uint32) + (challenge int32) + (ticker ticky :inline) + (button (pointer sunken-pipegame-button) 3) + (prize sunken-pipegame-prize 3 :inline) ) - :heap-base #x230 - :method-count-assert 23 - :size-assert #x2a0 - :flag-assert #x17023002a0 (:methods - (sunken-pipegame-method-20 (_type_) uint 20) - (sunken-pipegame-method-21 (_type_ symbol) symbol 21) - (sunken-pipegame-method-22 (_type_ symbol) none 22) + (sunken-pipegame-method-20 (_type_) uint) + (sunken-pipegame-method-21 (_type_ symbol) symbol) + (sunken-pipegame-method-22 (_type_ symbol) none) ) (:states sunken-pipegame-beat-challenge @@ -84,7 +73,7 @@ ) ;; definition for method 3 of type sunken-pipegame -(defmethod inspect sunken-pipegame ((this sunken-pipegame)) +(defmethod inspect ((this sunken-pipegame)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -554,7 +543,7 @@ ;; definition for method 20 of type sunken-pipegame ;; INFO: Return type mismatch int vs uint. -(defmethod sunken-pipegame-method-20 sunken-pipegame ((this sunken-pipegame)) +(defmethod sunken-pipegame-method-20 ((this sunken-pipegame)) (let ((gp-0 0)) (if (task-complete? *game-info* (game-task sunken-pipe)) (+! gp-0 1) @@ -905,7 +894,7 @@ ) ;; definition for method 22 of type sunken-pipegame -(defmethod sunken-pipegame-method-22 sunken-pipegame ((this sunken-pipegame) (arg0 symbol)) +(defmethod sunken-pipegame-method-22 ((this sunken-pipegame) (arg0 symbol)) (let* ((v1-0 (-> this challenge)) (a2-0 v1-0) ) @@ -914,8 +903,8 @@ (let ((v1-5 (handle->process (-> this prize v1-0 actor-handle)))) (when v1-5 (if arg0 - (restore-collide-with-as (-> (the-as collectable v1-5) root-override)) - (clear-collide-with-as (-> (the-as collectable v1-5) root-override)) + (restore-collide-with-as (-> (the-as collectable v1-5) root)) + (clear-collide-with-as (-> (the-as collectable v1-5) root)) ) ) ) @@ -924,8 +913,8 @@ (let ((v1-13 (handle->process (-> this prize v1-0 actor-handle)))) (when v1-13 (if arg0 - (restore-collide-with-as (-> (the-as collectable v1-13) root-override)) - (clear-collide-with-as (-> (the-as collectable v1-13) root-override)) + (restore-collide-with-as (-> (the-as collectable v1-13) root)) + (clear-collide-with-as (-> (the-as collectable v1-13) root)) ) ) ) @@ -936,7 +925,7 @@ ) ;; definition for method 21 of type sunken-pipegame -(defmethod sunken-pipegame-method-21 sunken-pipegame ((this sunken-pipegame) (arg0 symbol)) +(defmethod sunken-pipegame-method-21 ((this sunken-pipegame) (arg0 symbol)) (if arg0 (logior! (-> this mask) (process-mask actor-pause)) (logclear! (-> this mask) (process-mask actor-pause)) @@ -954,7 +943,7 @@ ) ;; definition for method 10 of type sunken-pipegame -(defmethod deactivate sunken-pipegame ((this sunken-pipegame)) +(defmethod deactivate ((this sunken-pipegame)) (dotimes (s5-0 3) (let ((s4-0 (-> this prize s5-0))) (if (nonzero? (-> s4-0 sucked-up-part)) @@ -970,7 +959,7 @@ ) ;; definition for method 7 of type sunken-pipegame -(defmethod relocate sunken-pipegame ((this sunken-pipegame) (arg0 int)) +(defmethod relocate ((this sunken-pipegame) (arg0 int)) (dotimes (v1-0 3) (let ((a0-4 (-> this prize v1-0))) (when (nonzero? (-> a0-4 sucked-up-part)) @@ -991,7 +980,7 @@ ;; definition for method 11 of type sunken-pipegame ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! sunken-pipegame ((this sunken-pipegame) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sunken-pipegame) (arg0 entity-actor)) (set! (-> this abort-audio-if-beaten?) #f) (stack-size-set! (-> this main-thread) 512) (set! (-> this challenge) -1) @@ -1039,7 +1028,7 @@ ) (let ((a1-10 (handle->process (-> s0-0 actor-handle)))) (if a1-10 - (clear-collide-with-as (-> (the-as collectable a1-10) root-override)) + (clear-collide-with-as (-> (the-as collectable a1-10) root)) ) ) ) @@ -1063,7 +1052,7 @@ (let ((s0-1 (handle->process (-> s0-0 actor-handle)))) (when s0-1 (send-event s0-1 'movie-pos 1) - (clear-collide-with-as (-> (the-as collectable s0-1) root-override)) + (clear-collide-with-as (-> (the-as collectable s0-1) root)) ) ) ) @@ -1087,7 +1076,7 @@ (let ((s0-2 (handle->process (-> s0-0 actor-handle)))) (when s0-2 (send-event s0-2 'movie-pos 2) - (clear-collide-with-as (-> (the-as collectable s0-2) root-override)) + (clear-collide-with-as (-> (the-as collectable s0-2) root)) ) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-water_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-water_REF.gc index 6e648de80aa..43d8eb85792 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-water_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-water_REF.gc @@ -3,27 +3,23 @@ ;; definition of type sunken-water (deftype sunken-water (water-anim) - ((use-sync? symbol :offset-assert 220) - (playing-deadly-sound? symbol :offset-assert 224) - (deadly-time float :offset-assert 228) - (deadly-fade float :offset-assert 232) - (sync sync-info :inline :offset-assert 236) - (safe-color-mult vector :inline :offset-assert 256) - (safe-color-emissive vector :inline :offset-assert 272) - (deadly-color-mult vector :inline :offset-assert 288) - (deadly-color-emissive vector :inline :offset-assert 304) + ((use-sync? symbol) + (playing-deadly-sound? symbol) + (deadly-time float) + (deadly-fade float) + (sync sync-info :inline) + (safe-color-mult vector :inline) + (safe-color-emissive vector :inline) + (deadly-color-mult vector :inline) + (deadly-color-emissive vector :inline) ) - :heap-base #xd0 - :method-count-assert 31 - :size-assert #x140 - :flag-assert #x1f00d00140 (:methods - (draw-ripple (_type_) symbol 30) + (draw-ripple (_type_) symbol) ) ) ;; definition for method 3 of type sunken-water -(defmethod inspect sunken-water ((this sunken-water)) +(defmethod inspect ((this sunken-water)) (let ((t9-0 (method-of-type water-anim inspect))) (t9-0 this) ) @@ -88,7 +84,7 @@ ) ;; definition for method 30 of type sunken-water -(defmethod draw-ripple sunken-water ((this sunken-water)) +(defmethod draw-ripple ((this sunken-water)) (set! (-> this draw ripple send-query) #t) (let ((gp-0 (-> this draw ripple query))) (let ((a0-1 (current-time))) @@ -197,7 +193,7 @@ ;; definition for method 25 of type sunken-water ;; INFO: Return type mismatch uint vs none. -(defmethod water-vol-method-25 sunken-water ((this sunken-water)) +(defmethod water-vol-method-25 ((this sunken-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-25))) (t9-0 this) ) @@ -245,7 +241,7 @@ ;; definition for method 22 of type sunken-water ;; INFO: Used lq/sq ;; INFO: Return type mismatch ripple-merc-query vs none. -(defmethod water-vol-method-22 sunken-water ((this sunken-water)) +(defmethod water-vol-method-22 ((this sunken-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc b/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc index da459077fdf..a36bd70b471 100644 --- a/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc @@ -117,30 +117,27 @@ ;; definition of type tube-info (deftype tube-info (basic) - ((entity basic :offset-assert 4) - (tube handle :offset-assert 8) - (downhill vector :inline :offset-assert 16) - (centertube vector :inline :offset-assert 32) - (downtube vector :inline :offset-assert 48) - (sidetube vector :inline :offset-assert 64) - (foretube vector :inline :offset-assert 80) - (old-transv vector :inline :offset-assert 96) - (mod-x float :offset-assert 112) - (mod-y float :offset-assert 116) - (start-time time-frame :offset-assert 120) - (turn-anim-targ float :offset-assert 128) - (turn-anim-frame float :offset-assert 132) - (turn-anim-vel float :offset-assert 136) - (tube-sound-id sound-id :offset-assert 140) - (tube-sound-vol float :offset-assert 144) + ((entity basic) + (tube handle) + (downhill vector :inline) + (centertube vector :inline) + (downtube vector :inline) + (sidetube vector :inline) + (foretube vector :inline) + (old-transv vector :inline) + (mod-x float) + (mod-y float) + (start-time time-frame) + (turn-anim-targ float) + (turn-anim-frame float) + (turn-anim-vel float) + (tube-sound-id sound-id) + (tube-sound-vol float) ) - :method-count-assert 9 - :size-assert #x94 - :flag-assert #x900000094 ) ;; definition for method 3 of type tube-info -(defmethod inspect tube-info ((this tube-info)) +(defmethod inspect ((this tube-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tentity: ~A~%" (-> this entity)) (format #t "~Ttube: ~D~%" (-> this tube)) @@ -164,13 +161,10 @@ ;; definition of type tube-bank (deftype tube-bank (basic) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type tube-bank -(defmethod inspect tube-bank ((this tube-bank)) +(defmethod inspect ((this tube-bank)) (format #t "[~8x] ~A~%" this (-> this type)) this ) @@ -796,7 +790,7 @@ (combine! gp-0 arg1) (when (= arg0 'attack) (pickup-collectable! - (-> self fact-info-target) + (-> self fact) (pickup-type eco-green) (- (-> *FACT-bank* health-single-inc)) (the-as handle #f) @@ -830,7 +824,7 @@ (set! (-> a0-35 quad) (-> self control transv quad)) (s5-3 s4-2 (t9-9 a0-35 1.0) (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ))) ) - (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))) + (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) (go target-tube-death (-> gp-0 mode)) ) ) @@ -884,24 +878,20 @@ ;; definition of type slide-control (deftype slide-control (process-drawable) - ((target handle :offset-assert 176) - (pos float :offset-assert 184) - (trans vector :inline :offset-assert 192) - (rot vector :inline :offset-assert 208) - (side vector :inline :offset-assert 224) + ((target handle) + (pos float) + (trans vector :inline) + (rot vector :inline) + (side vector :inline) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf0 - :flag-assert #x16008000f0 - (:methods - (slide-control-watch () _type_ :state 20) - (slide-control-ride () _type_ :state 21) + (:state-methods + slide-control-watch + slide-control-ride ) ) ;; definition for method 3 of type slide-control -(defmethod inspect slide-control ((this slide-control)) +(defmethod inspect ((this slide-control)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1045,7 +1035,7 @@ ;; definition for method 11 of type slide-control ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! slide-control ((this slide-control) (arg0 entity-actor)) +(defmethod init-from-entity! ((this slide-control) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/test/decompiler/reference/jak1/levels/sunken/wall-plat_REF.gc b/test/decompiler/reference/jak1/levels/sunken/wall-plat_REF.gc index 26c42ca9b72..da3f373b669 100644 --- a/test/decompiler/reference/jak1/levels/sunken/wall-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/wall-plat_REF.gc @@ -3,17 +3,13 @@ ;; definition of type wall-plat (deftype wall-plat (process-drawable) - ((root-override collide-shape-moving :offset 112) - (use-sync? symbol :offset-assert 176) - (extended-amount float :offset-assert 180) - (in-trans vector :inline :offset-assert 192) - (out-trans vector :inline :offset-assert 208) - (sync sync-info-paused :inline :offset-assert 224) + ((root collide-shape-moving :override) + (use-sync? symbol) + (extended-amount float) + (in-trans vector :inline) + (out-trans vector :inline) + (sync sync-info-paused :inline) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xf0 - :flag-assert #x14008000f0 (:states wall-plat-extended wall-plat-extending @@ -24,7 +20,7 @@ ) ;; definition for method 3 of type wall-plat -(defmethod inspect wall-plat ((this wall-plat)) +(defmethod inspect ((this wall-plat)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -53,9 +49,9 @@ ) :code (behavior () (set! (-> self extended-amount) 0.0) - (move-to-point! (-> self root-override) (-> self in-trans)) + (move-to-point! (-> self root) (-> self in-trans)) (transform-post) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (loop (logior! (-> self mask) (process-mask sleep-code)) (suspend) @@ -78,13 +74,13 @@ ) :trans rider-trans :code (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (set-time! (-> self state-time)) (loop (seek! (-> self extended-amount) 1.0 (* 2.5 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) (suspend) (if (= (-> self extended-amount) 1.0) @@ -106,7 +102,7 @@ ) :code (behavior () (set! (-> self extended-amount) 1.0) - (move-to-point! (-> self root-override) (-> self out-trans)) + (move-to-point! (-> self root) (-> self out-trans)) (transform-post) (loop (logior! (-> self mask) (process-mask sleep-code)) @@ -135,7 +131,7 @@ (seek! (-> self extended-amount) 0.0 (* 2.5 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) - (move-to-point! (-> self root-override) gp-0) + (move-to-point! (-> self root) gp-0) ) (suspend) (if (= (-> self extended-amount) 0.0) @@ -169,23 +165,23 @@ (let ((f30-0 (get-current-phase-with-mirror (-> self sync)))) (let ((s5-0 (new 'stack-no-clear 'vector))) (vector-lerp! s5-0 (-> self in-trans) (-> self out-trans) f30-0) - (move-to-point! (-> self root-override) s5-0) + (move-to-point! (-> self root) s5-0) ) (cond ((= f30-0 0.0) (set! gp-0 #f) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) ) ((= f30-0 1.0) (set! gp-0 #f) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) ) (else (when (not gp-0) (sound-play "wall-plat") (set! gp-0 #t) ) - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) ) ) ) @@ -198,7 +194,7 @@ ;; definition for method 11 of type wall-plat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! wall-plat ((this wall-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this wall-plat) (arg0 entity-actor)) (set! (-> this extended-amount) 0.0) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -219,18 +215,18 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *wall-plat-sg* '()) (logior! (-> this skel status) (janim-status inited)) (set! (-> this use-sync?) (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.2 0.2)) - (let ((f30-0 (quaternion-y-angle (-> this root-override quat))) + (let ((f30-0 (quaternion-y-angle (-> this root quat))) (s4-1 (new 'stack-no-clear 'vector)) ) (set-vector! s4-1 0.0 0.0 (+ 1638.4 (res-lump-float arg0 'tunemeters)) 1.0) (vector-rotate-around-y! s4-1 s4-1 f30-0) - (vector+! (-> this out-trans) (-> this root-override trans) s4-1) + (vector+! (-> this out-trans) (-> this root trans) s4-1) (set-vector! s4-1 0.0 0.0 20480.0 1.0) (vector-rotate-around-y! s4-1 s4-1 f30-0) (vector+! (-> this in-trans) (-> this out-trans) s4-1) @@ -245,7 +241,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (cond ((-> this use-sync?) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/test/decompiler/reference/jak1/levels/sunken/wedge-plats_REF.gc b/test/decompiler/reference/jak1/levels/sunken/wedge-plats_REF.gc index 004968ee45b..aeb19cce98e 100644 --- a/test/decompiler/reference/jak1/levels/sunken/wedge-plats_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/wedge-plats_REF.gc @@ -3,22 +3,18 @@ ;; definition of type wedge-plat-master (deftype wedge-plat-master (process) - ((center vector :inline :offset-assert 112) - (rotspeed float :offset-assert 128) - (rotate-inner float :offset-assert 132) - (rotate-outer float :offset-assert 136) + ((center vector :inline) + (rotspeed float) + (rotate-inner float) + (rotate-outer float) ) - :heap-base #x20 - :method-count-assert 14 - :size-assert #x8c - :flag-assert #xe0020008c (:states wedge-plat-master-idle ) ) ;; definition for method 3 of type wedge-plat-master -(defmethod inspect wedge-plat-master ((this wedge-plat-master)) +(defmethod inspect ((this wedge-plat-master)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -47,7 +43,7 @@ ;; definition for method 11 of type wedge-plat-master ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! wedge-plat-master ((this wedge-plat-master) (arg0 entity-actor)) +(defmethod init-from-entity! ((this wedge-plat-master) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (set! (-> this center quad) (-> arg0 extra trans quad)) (+! (-> this center y) 819.2) @@ -61,16 +57,12 @@ ;; definition of type wedge-plat (deftype wedge-plat (baseplat) - ((master wedge-plat-master :offset-assert 228) - (distance float :offset-assert 232) - (offset float :offset-assert 236) + ((master wedge-plat-master) + (distance float) + (offset float) ) - :heap-base #x80 - :method-count-assert 28 - :size-assert #xf0 - :flag-assert #x1c008000f0 (:methods - (wedge-plat-method-27 (_type_) symbol 27) + (wedge-plat-method-27 (_type_) symbol) ) (:states wedge-plat-idle @@ -79,7 +71,7 @@ ) ;; definition for method 3 of type wedge-plat -(defmethod inspect wedge-plat ((this wedge-plat)) +(defmethod inspect ((this wedge-plat)) (let ((t9-0 (method-of-type baseplat inspect))) (t9-0 this) ) @@ -96,7 +88,7 @@ ) ;; definition for method 27 of type wedge-plat -(defmethod wedge-plat-method-27 wedge-plat ((this wedge-plat)) +(defmethod wedge-plat-method-27 ((this wedge-plat)) (let* ((a0-1 (-> this master)) (v1-0 (if a0-1 (-> (the-as process-drawable (-> a0-1 ppointer)) brother) @@ -110,7 +102,7 @@ (s5-0 #f) ) (quaternion-axis-angle! - (-> this root-override quat) + (-> this root quat) 0.0 1.0 0.0 @@ -198,7 +190,7 @@ ;; definition for method 11 of type wedge-plat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! wedge-plat ((this wedge-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this wedge-plat) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -218,12 +210,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *wedge-plat-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (baseplat-method-21 this) (set! (-> this master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) (set! (-> this offset) (res-lump-float arg0 'rotoffset)) @@ -236,10 +228,6 @@ ;; definition of type wedge-plat-outer (deftype wedge-plat-outer (wedge-plat) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #xf0 - :flag-assert #x1c008000f0 (:states wedge-plat-outer-idle wedge-plat-outer-tip @@ -247,7 +235,7 @@ ) ;; definition for method 3 of type wedge-plat-outer -(defmethod inspect wedge-plat-outer ((this wedge-plat-outer)) +(defmethod inspect ((this wedge-plat-outer)) (let ((t9-0 (method-of-type wedge-plat inspect))) (t9-0 this) ) @@ -261,7 +249,7 @@ ) ;; definition for method 27 of type wedge-plat-outer -(defmethod wedge-plat-method-27 wedge-plat-outer ((this wedge-plat-outer)) +(defmethod wedge-plat-method-27 ((this wedge-plat-outer)) (let* ((a0-1 (-> this master)) (v1-0 (if a0-1 (-> (the-as process-drawable (-> a0-1 ppointer)) brother) @@ -275,7 +263,7 @@ (s5-0 #f) ) (quaternion-axis-angle! - (-> this root-override quat) + (-> this root quat) 0.0 1.0 0.0 @@ -362,7 +350,7 @@ ;; definition for method 11 of type wedge-plat-outer ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! wedge-plat-outer ((this wedge-plat-outer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this wedge-plat-outer) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -382,12 +370,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *wedge-plat-sg* '()) (logior! (-> this skel status) (janim-status inited)) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (baseplat-method-21 this) (set! (-> this master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) (set! (-> this offset) (res-lump-float arg0 'rotoffset)) diff --git a/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc b/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc index 97438bdf7cd..bce990988f4 100644 --- a/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc @@ -3,18 +3,14 @@ ;; definition of type whirlpool (deftype whirlpool (process-drawable) - ((root-override collide-shape :offset 112) - (spin-ry float :offset-assert 176) - (spin-speed-idle float :offset-assert 180) - (spin-speed-delta float :offset-assert 184) - (sync sync-info-paused :inline :offset-assert 188) + ((root collide-shape :override) + (spin-ry float) + (spin-speed-idle float) + (spin-speed-delta float) + (sync sync-info-paused :inline) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xcc - :flag-assert #x15006000cc (:methods - (whirlpool-method-20 (_type_ float) cshape-moving-flags 20) + (whirlpool-method-20 (_type_ float) cshape-moving-flags) ) (:states whirlpool-idle @@ -22,7 +18,7 @@ ) ;; definition for method 3 of type whirlpool -(defmethod inspect whirlpool ((this whirlpool)) +(defmethod inspect ((this whirlpool)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -297,21 +293,21 @@ ) ;; definition for method 20 of type whirlpool -(defmethod whirlpool-method-20 whirlpool ((this whirlpool) (arg0 float)) +(defmethod whirlpool-method-20 ((this whirlpool) (arg0 float)) (let* ((gp-0 (target-pos 0)) - (f28-0 (vector-vector-xz-distance (-> this root-override trans) gp-0)) + (f28-0 (vector-vector-xz-distance (-> this root trans) gp-0)) ) (when (< f28-0 40960.0) (let* ((f0-2 (* 0.000024414063 (- 40960.0 f28-0))) (f26-0 (* f0-2 f0-2)) - (f0-7 (atan (- (-> gp-0 x) (-> this root-override trans x)) (- (-> gp-0 z) (-> this root-override trans z)))) + (f0-7 (atan (- (-> gp-0 x) (-> this root trans x)) (- (-> gp-0 z) (-> this root trans z)))) (f30-0 (* 0.5 f26-0 arg0 (seconds-per-frame))) (f24-0 (+ f0-7 f30-0)) (f28-1 (- f28-0 (fmin f28-0 (* 0.16874999 f26-0 (fabs arg0) (seconds-per-frame))))) (s4-1 (new 'stack-no-clear 'vector)) ) (set-vector! s4-1 (* (sin f24-0) f28-1) 0.0 (* (cos f24-0) f28-1) 1.0) - (vector+! s4-1 s4-1 (-> this root-override trans)) + (vector+! s4-1 s4-1 (-> this root trans)) (set! (-> s4-1 x) (* (- (-> s4-1 x) (-> gp-0 x)) (-> *display* frames-per-second))) (set! (-> s4-1 y) 0.0) (set! (-> s4-1 z) (* (- (-> s4-1 z) (-> gp-0 z)) (-> *display* frames-per-second))) @@ -338,13 +334,13 @@ ) (when (>= (fabs f30-0) 45511.11) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root-override trans quad)) + (set! (-> a1-0 quad) (-> self root trans quad)) (+! (-> a1-0 y) -8192.0) (spawn (-> self part) a1-0) ) ) (+! (-> self spin-ry) (* f30-0 (seconds-per-frame))) - (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> self spin-ry)) + (quaternion-axis-angle! (-> self root quat) 0.0 1.0 0.0 (-> self spin-ry)) (if (and *target* (logtest? (-> *target* water flags) (water-flags wt09))) (whirlpool-method-20 self f30-0) ) @@ -359,7 +355,7 @@ ) ;; definition for method 10 of type whirlpool -(defmethod deactivate whirlpool ((this whirlpool)) +(defmethod deactivate ((this whirlpool)) (if (nonzero? (-> this sound)) (stop! (-> this sound)) ) @@ -370,7 +366,7 @@ ;; definition for method 11 of type whirlpool ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! whirlpool ((this whirlpool) (arg0 entity-actor)) +(defmethod init-from-entity! ((this whirlpool) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) (set! (-> this spin-ry) (rand-vu-float-range 0.0 65536.0)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) @@ -384,7 +380,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *whirlpool-sg* '()) @@ -404,7 +400,7 @@ ) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 447) this)) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "whirlpool" :fo-max 55) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "whirlpool" :fo-max 55) (-> this root trans)) ) (ja-channel-set! 1) (let ((s5-1 (-> this skel root-channel 0))) @@ -416,7 +412,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (go whirlpool-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc b/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc index e944029af80..65881713091 100644 --- a/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc @@ -3,26 +3,22 @@ ;; definition of type billy (deftype billy (process-taskable) - ((child-override (pointer billy-snack) :offset 20) - (farthy handle :offset-assert 384) - (path-data path-control 3 :offset-assert 392) - (path-snacks path-control :offset 392) - (path-starts path-control :offset 396) - (path-waypts path-control :offset 400) - (passed-last-stage symbol :offset-assert 404) - (spawn-rats symbol :offset-assert 408) - (current-wave int32 :offset-assert 412) - (wave-start-time time-frame :offset-assert 416) - (num-snacks int32 :offset-assert 424) - (num-rats int32 :offset-assert 428) - (max-rats int32 :offset-assert 432) - (rat-speed float :offset-assert 436) - (offending-rat handle :offset-assert 440) + ((child-override (pointer billy-snack) :overlay-at child) + (farthy handle) + (path-data path-control 3) + (path-snacks path-control :overlay-at (-> path-data 0)) + (path-starts path-control :overlay-at (-> path-data 1)) + (path-waypts path-control :overlay-at (-> path-data 2)) + (passed-last-stage symbol) + (spawn-rats symbol) + (current-wave int32) + (wave-start-time time-frame) + (num-snacks int32) + (num-rats int32) + (max-rats int32) + (rat-speed float) + (offending-rat handle) ) - :heap-base #x150 - :method-count-assert 53 - :size-assert #x1c0 - :flag-assert #x35015001c0 (:states billy-done billy-playing @@ -30,7 +26,7 @@ ) ;; definition for method 3 of type billy -(defmethod inspect billy ((this billy)) +(defmethod inspect ((this billy)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -52,7 +48,7 @@ ) ;; definition for method 7 of type billy -(defmethod relocate billy ((this billy) (arg0 int)) +(defmethod relocate ((this billy) (arg0 int)) (countdown (v1-0 3) (if (nonzero? (-> this path-data v1-0)) (&+! (-> this path-data v1-0) arg0) @@ -63,12 +59,8 @@ ;; definition of type billy-snack (deftype billy-snack (process-drawable) - ((num-rats int32 :offset-assert 176) + ((num-rats int32) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states billy-snack-eat billy-snack-idle @@ -76,7 +68,7 @@ ) ;; definition for method 3 of type billy-snack -(defmethod inspect billy-snack ((this billy-snack)) +(defmethod inspect ((this billy-snack)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -142,15 +134,11 @@ ;; definition of type billy-rat (deftype billy-rat (swamp-rat) - ((dest-type uint64 :offset-assert 496) - (snack handle :offset-assert 504) - (destination vector :inline :offset-assert 512) - (billy (pointer billy) :offset-assert 528) + ((dest-type uint64) + (snack handle) + (destination vector :inline) + (billy (pointer billy)) ) - :heap-base #x1b0 - :method-count-assert 76 - :size-assert #x214 - :flag-assert #x4c01b00214 (:states billy-rat-eat billy-rat-salivate @@ -158,7 +146,7 @@ ) ;; definition for method 3 of type billy-rat -(defmethod inspect billy-rat ((this billy-rat)) +(defmethod inspect ((this billy-rat)) (let ((t9-0 (method-of-type swamp-rat inspect))) (t9-0 this) ) @@ -339,7 +327,7 @@ ) ;; definition for method 32 of type billy -(defmethod play-anim! billy ((this billy) (arg0 symbol)) +(defmethod play-anim! ((this billy) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 @@ -473,7 +461,7 @@ ) ;; definition for method 31 of type billy -(defmethod get-art-elem billy ((this billy)) +(defmethod get-art-elem ((this billy)) (case (current-status (-> this tasks)) (((task-status invalid) (task-status need-resolution)) (-> this draw art-group data 10) @@ -486,7 +474,7 @@ ;; definition for method 38 of type billy ;; INFO: Return type mismatch object vs none. -(defmethod process-taskable-method-38 billy ((this billy)) +(defmethod process-taskable-method-38 ((this billy)) (case (current-status (-> this tasks)) (((task-status need-reminder-a) (task-status need-reminder)) (go (method-of-object this query)) @@ -502,7 +490,7 @@ ) ;; definition for method 34 of type billy -(defmethod get-accept-anim billy ((this billy) (arg0 symbol)) +(defmethod get-accept-anim ((this billy) (arg0 symbol)) (if arg0 (close-current! (-> this tasks)) ) @@ -510,7 +498,7 @@ ) ;; definition for method 36 of type billy -(defmethod get-reject-anim billy ((this billy) (arg0 symbol)) +(defmethod get-reject-anim ((this billy) (arg0 symbol)) (new 'static 'spool-anim :name "billy-reject" :index 7 :parts 3 :command-list '()) ) @@ -925,7 +913,7 @@ :enter (behavior () (add-setting! 'music 'danger 0.0 0) (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (init! (-> self query) (the-as string #f) 40 150 25 #t (lookup-text! *common-text* (text-id quit) #f)) (set-time! (-> self wave-start-time)) (set! (-> self num-snacks) 0) @@ -975,7 +963,7 @@ ) ) :exit (behavior () - (restore-collide-with-as (-> self root-override)) + (restore-collide-with-as (-> self root)) (restore-load-state-and-cleanup *load-state*) (set! (-> *ACTOR-bank* birth-max) 1000) (remove-setting! 'music) @@ -1022,63 +1010,63 @@ ) ;; definition for method 43 of type billy -(defmethod process-taskable-method-43 billy ((this billy)) +(defmethod process-taskable-method-43 ((this billy)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f30-0 (rand-float-gen))) (cond ((< 0.9411765 f30-0) - (play-ambient (-> this ambient) "BIL-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM01" #f (-> this root trans)) ) ((< 0.88235295 f30-0) - (play-ambient (-> this ambient) "BIL-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM02" #f (-> this root trans)) ) ((< 0.8235294 f30-0) - (play-ambient (-> this ambient) "BIL-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM03" #f (-> this root trans)) ) ((< 0.7647059 f30-0) - (play-ambient (-> this ambient) "BIL-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM04" #f (-> this root trans)) ) ((< 0.7058824 f30-0) - (play-ambient (-> this ambient) "BIL-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM05" #f (-> this root trans)) ) ((< 0.64705884 f30-0) - (play-ambient (-> this ambient) "BIL-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM06" #f (-> this root trans)) ) ((< 0.5882353 f30-0) - (play-ambient (-> this ambient) "BIL-AM07" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM07" #f (-> this root trans)) ) ((< 0.5294118 f30-0) - (play-ambient (-> this ambient) "BIL-AM08" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM08" #f (-> this root trans)) ) ((< 0.47058824 f30-0) - (play-ambient (-> this ambient) "BIL-AM1A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM1A" #f (-> this root trans)) ) ((< 0.4117647 f30-0) - (play-ambient (-> this ambient) "BIL-AM2A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM2A" #f (-> this root trans)) ) ((< 0.3529412 f30-0) - (play-ambient (-> this ambient) "BIL-AM2B" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-AM2B" #f (-> this root trans)) ) ((= (current-status (-> this tasks)) (task-status invalid)) #f ) ((< 0.29411766 f30-0) - (play-ambient (-> this ambient) "BIL-LO01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-LO01" #f (-> this root trans)) ) ((< 0.23529412 f30-0) - (play-ambient (-> this ambient) "BIL-LO02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-LO02" #f (-> this root trans)) ) ((< 0.1764706 f30-0) - (play-ambient (-> this ambient) "BIL-LO03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-LO03" #f (-> this root trans)) ) ((< 0.11764706 f30-0) - (play-ambient (-> this ambient) "BIL-LO1A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-LO1A" #f (-> this root trans)) ) ((< 0.05882353 f30-0) - (play-ambient (-> this ambient) "BIL-LO2A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-LO2A" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "BIL-LO2B" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "BIL-LO2B" #f (-> this root trans)) ) ) ) @@ -1129,7 +1117,7 @@ ;; definition for method 47 of type billy ;; INFO: Return type mismatch basic vs symbol. -(defmethod target-above-threshold? billy ((this billy)) +(defmethod target-above-threshold? ((this billy)) (the-as symbol (and *target* (not (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)))) @@ -1137,7 +1125,7 @@ ) ;; definition for method 11 of type billy -(defmethod init-from-entity! billy ((this billy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this billy) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *billy-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task swamp-billy))) (dotimes (s5-0 3) @@ -1148,9 +1136,7 @@ ) (set! (-> this path) (-> this path-snacks)) (set! (-> this farthy) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *billy-sidekick-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *billy-sidekick-sg* #f :to this)) ) (send-event (handle->process (-> this farthy)) 'center-joint 3) (send-event (handle->process (-> this farthy)) 'anim-mode 'clone-anim) diff --git a/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc b/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc index bc68b0234da..848a2f7ed98 100644 --- a/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc @@ -398,26 +398,23 @@ ;; definition of type joint-mod-tracker (deftype joint-mod-tracker (basic) - ((target-pos vector :inline :offset-assert 16) - (target-pos-func (function vector vector) :offset-assert 32) - (inv-forward-scale-factor float :offset-assert 36) - (forward-scale-control float :offset-assert 40) - (forward-scale-max float :offset-assert 44) - (process kermit :offset-assert 48) - (enable symbol :offset-assert 52) - (up-axis int8 :offset-assert 56) - (forward-axis int8 :offset-assert 57) + ((target-pos vector :inline) + (target-pos-func (function vector vector)) + (inv-forward-scale-factor float) + (forward-scale-control float) + (forward-scale-max float) + (process kermit) + (enable symbol) + (up-axis int8) + (forward-axis int8) ) - :method-count-assert 9 - :size-assert #x3a - :flag-assert #x90000003a (:methods - (new (symbol type kermit int function int int) _type_ 0) + (new (symbol type kermit int function int int) _type_) ) ) ;; definition for method 3 of type joint-mod-tracker -(defmethod inspect joint-mod-tracker ((this joint-mod-tracker)) +(defmethod inspect ((this joint-mod-tracker)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Ttarget-pos: #~%" (-> this target-pos)) (format #t "~Ttarget-pos-func: ~A~%" (-> this target-pos-func)) @@ -432,7 +429,7 @@ ) ;; definition for method 7 of type joint-mod-tracker -(defmethod relocate joint-mod-tracker ((this joint-mod-tracker) (arg0 int)) +(defmethod relocate ((this joint-mod-tracker) (arg0 int)) (&+! (-> this process) arg0) this ) @@ -534,15 +531,11 @@ ;; definition of type kermit-pulse (deftype kermit-pulse (process-drawable) - ((parent-override (pointer kermit) :offset 12) - (self-override kermit-pulse :offset 28) - (root-override collide-shape-moving :offset 112) - (sound-id sound-id :offset-assert 176) + ((root collide-shape-moving :override) + (parent-override (pointer kermit) :overlay-at parent) + (self-override kermit-pulse :overlay-at self) + (sound-id sound-id) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states kermit-pulse-idle kermit-pulse-impact @@ -550,7 +543,7 @@ ) ;; definition for method 3 of type kermit-pulse -(defmethod inspect kermit-pulse ((this kermit-pulse)) +(defmethod inspect ((this kermit-pulse)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -576,10 +569,10 @@ ) :code (behavior () (while (not (time-elapsed? (-> self state-time) (seconds 4))) - (sound-play "kermit-loop" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) - (spawn (-> self part) (-> self root-override trans)) + (sound-play "kermit-loop" :id (-> self sound-id) :position (the-as symbol (-> self root trans))) + (spawn (-> self part) (-> self root trans)) (find-ground-and-draw-shadow - (-> self root-override trans) + (-> self root trans) (the-as vector #f) 8192.0 (collide-kind background) @@ -592,7 +585,7 @@ (cleanup-for-death self) ) :post (behavior () - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) ) ) @@ -608,7 +601,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (cleanup-for-death self) @@ -638,12 +631,12 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> self root-override) s5-0) + (set! (-> self root) s5-0) ) - (set! (-> self root-override trans quad) (-> arg0 quad)) - (set! (-> self root-override quat vec quad) (-> self parent-override 0 collide-info quat vec quad)) - (vector-identity! (-> self root-override scale)) - (vector-reset! (-> self root-override transv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self root quat vec quad) (-> self parent-override 0 collide-info quat vec quad)) + (vector-identity! (-> self root scale)) + (vector-reset! (-> self root transv)) (set! (-> self sound-id) (new-sound-id)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 300) self)) (go kermit-pulse-idle) @@ -660,20 +653,16 @@ ;; definition of type kermit (deftype kermit (nav-enemy) - ((child-override (pointer kermit-pulse) :offset 20) - (rotate-dir vector :inline :offset-assert 400) - (charging-part sparticle-launch-control :offset-assert 416) - (airborne symbol :offset-assert 420) - (tongue-control joint-mod-tracker :offset-assert 424) - (tongue-pulse-pos float :offset-assert 428) - (miss-count int8 :offset-assert 432) - (charged-up symbol :offset-assert 436) - (sound-id sound-id :offset-assert 440) + ((child-override (pointer kermit-pulse) :overlay-at child) + (rotate-dir vector :inline) + (charging-part sparticle-launch-control) + (airborne symbol) + (tongue-control joint-mod-tracker) + (tongue-pulse-pos float) + (miss-count int8) + (charged-up symbol) + (sound-id sound-id) ) - :heap-base #x150 - :method-count-assert 76 - :size-assert #x1bc - :flag-assert #x4c015001bc (:states kermit-attack kermit-chase @@ -688,7 +677,7 @@ ) ;; definition for method 3 of type kermit -(defmethod inspect kermit ((this kermit)) +(defmethod inspect ((this kermit)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -705,7 +694,7 @@ ;; definition for method 7 of type kermit ;; INFO: Return type mismatch nav-enemy vs kermit. -(defmethod relocate kermit ((this kermit) (arg0 int)) +(defmethod relocate ((this kermit) (arg0 int)) (if (nonzero? (-> this tongue-control)) (&+! (-> this tongue-control) arg0) ) @@ -716,7 +705,7 @@ ) ;; definition for method 10 of type kermit -(defmethod deactivate kermit ((this kermit)) +(defmethod deactivate ((this kermit)) (if (nonzero? (-> this charging-part)) (kill-and-free-particles (-> this charging-part)) ) @@ -925,7 +914,7 @@ nav-enemy-default-event-handler ;; definition for method 39 of type kermit ;; INFO: Return type mismatch int vs none. -(defmethod common-post kermit ((this kermit)) +(defmethod common-post ((this kermit)) (call-parent-method this) (when (-> this charged-up) ) @@ -1295,7 +1284,7 @@ nav-enemy-default-event-handler ) (v1-15 (vector-lerp! (new 'stack-no-clear 'vector) gp-0 s5-0 (-> self tongue-pulse-pos))) ) - (set! (-> s4-0 root-override trans quad) (-> v1-15 quad)) + (set! (-> s4-0 root trans quad) (-> v1-15 quad)) ) ) (send-event *target* 'tongue gp-0) @@ -1422,7 +1411,7 @@ nav-enemy-default-event-handler ;; definition for method 11 of type kermit ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! kermit ((this kermit) (arg0 entity-actor)) +(defmethod init-from-entity! ((this kermit) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc index a008ca2fa62..e963eb6ec10 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc @@ -3,20 +3,17 @@ ;; definition of type swamp-bat-idle-path (deftype swamp-bat-idle-path (structure) - ((origin vector :inline :offset-assert 0) - (x-axis vector :inline :offset-assert 16) - (y-axis vector :inline :offset-assert 32) + ((origin vector :inline) + (x-axis vector :inline) + (y-axis vector :inline) ) - :method-count-assert 10 - :size-assert #x30 - :flag-assert #xa00000030 (:methods - (swamp-bat-idle-path-method-9 (_type_ vector float) vector 9) + (swamp-bat-idle-path-method-9 (_type_ vector float) vector) ) ) ;; definition for method 3 of type swamp-bat-idle-path -(defmethod inspect swamp-bat-idle-path ((this swamp-bat-idle-path)) +(defmethod inspect ((this swamp-bat-idle-path)) (format #t "[~8x] ~A~%" this 'swamp-bat-idle-path) (format #t "~Torigin: #~%" (-> this origin)) (format #t "~Tx-axis: #~%" (-> this x-axis)) @@ -26,7 +23,7 @@ ;; definition for method 9 of type swamp-bat-idle-path ;; INFO: Used lq/sq -(defmethod swamp-bat-idle-path-method-9 swamp-bat-idle-path ((this swamp-bat-idle-path) (arg0 vector) (arg1 float)) +(defmethod swamp-bat-idle-path-method-9 ((this swamp-bat-idle-path) (arg0 vector) (arg1 float)) (let ((f30-0 (* 65536.0 arg1))) (set! (-> arg0 quad) (-> this origin quad)) (vector+*! arg0 arg0 (-> this x-axis) (cos f30-0)) @@ -37,21 +34,17 @@ ;; definition of type swamp-bat (deftype swamp-bat (process-drawable) - ((child-process (pointer swamp-bat-slave) :offset 20) - (root-override collide-shape :offset 112) - (fact-override fact-info-enemy :offset 144) - (path-origin vector :inline :offset-assert 176) - (idle-position-angle float 8 :offset-assert 192) - (path-select-plane plane 2 :inline :offset-assert 224) - (path-list curve-control 2 :offset-assert 256) - (path-select int8 :offset-assert 264) - (slave-count int8 :offset-assert 265) - (path-count int8 :offset-assert 266) + ((root collide-shape :override) + (fact fact-info-enemy :override) + (child-process (pointer swamp-bat-slave) :overlay-at child) + (path-origin vector :inline) + (idle-position-angle float 8) + (path-select-plane plane 2 :inline) + (path-list curve-control 2) + (path-select int8) + (slave-count int8) + (path-count int8) ) - :heap-base #xa0 - :method-count-assert 20 - :size-assert #x10b - :flag-assert #x1400a0010b (:states swamp-bat-idle swamp-bat-launch-slaves @@ -59,7 +52,7 @@ ) ;; definition for method 3 of type swamp-bat -(defmethod inspect swamp-bat ((this swamp-bat)) +(defmethod inspect ((this swamp-bat)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -74,7 +67,7 @@ ) ;; definition for method 7 of type swamp-bat -(defmethod relocate swamp-bat ((this swamp-bat) (arg0 int)) +(defmethod relocate ((this swamp-bat) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this path-list v1-0)) (&+! (-> this path-list v1-0) arg0) @@ -85,25 +78,21 @@ ;; definition of type swamp-bat-slave (deftype swamp-bat-slave (process-drawable) - ((parent-process (pointer swamp-bat) :offset 12) - (root-override collide-shape-moving :offset 112) - (sync sync-info :inline :offset-assert 176) - (idle-anim-speed float :offset-assert 184) - (strafe-envelope float :offset-assert 188) - (strafe-distance float :offset-assert 192) - (path-point-count float :offset-assert 196) - (idle-path swamp-bat-idle-path :inline :offset-assert 208) - (idle-position vector :inline :offset-assert 256) - (idle-position-index int8 :offset-assert 272) - (path-select int8 :offset-assert 273) - (launch-ready symbol :offset-assert 276) + ((root collide-shape-moving :override) + (parent-process (pointer swamp-bat) :overlay-at parent) + (sync sync-info :inline) + (idle-anim-speed float) + (strafe-envelope float) + (strafe-distance float) + (path-point-count float) + (idle-path swamp-bat-idle-path :inline) + (idle-position vector :inline) + (idle-position-index int8) + (path-select int8) + (launch-ready symbol) ) - :heap-base #xb0 - :method-count-assert 21 - :size-assert #x118 - :flag-assert #x1500b00118 (:methods - (swamp-bat-slave-method-20 (_type_) float 20) + (swamp-bat-slave-method-20 (_type_) float) ) (:states (swamp-bat-slave-die handle) @@ -116,7 +105,7 @@ ) ;; definition for method 3 of type swamp-bat-slave -(defmethod inspect swamp-bat-slave ((this swamp-bat-slave)) +(defmethod inspect ((this swamp-bat-slave)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -161,7 +150,7 @@ swamp-bat-slave-event-handler ) ;; definition for method 20 of type swamp-bat-slave -(defmethod swamp-bat-slave-method-20 swamp-bat-slave ((this swamp-bat-slave)) +(defmethod swamp-bat-slave-method-20 ((this swamp-bat-slave)) (* (get-current-phase (-> this sync)) (-> this path-point-count)) ) @@ -188,8 +177,8 @@ swamp-bat-slave-event-handler (seek! (-> self strafe-distance) f0-4 (* 20480.0 (seconds-per-frame))) ) (vector-float*! s4-0 s4-0 (-> self strafe-distance)) - (vector+! (-> self root-override trans) s5-0 s4-0) - (forward-up->quaternion (-> self root-override quat) gp-0 s3-0) + (vector+! (-> self root trans) s5-0 s4-0) + (forward-up->quaternion (-> self root quat) gp-0 s3-0) ) (swamp-bat-slave-post) ) @@ -236,8 +225,8 @@ swamp-bat-slave-event-handler (ja-channel-push! 1 (seconds 0.165)) (ja :group! swamp-bat-idle-ja) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self root-override trans quad)) - (let ((s4-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root-override quat))) + (set! (-> s5-0 quad) (-> self root trans quad)) + (let ((s4-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat))) (gp-0 (new-stack-quaternion0)) ) (let ((s2-0 (path-control-method-12 @@ -264,8 +253,8 @@ swamp-bat-slave-event-handler (set-pos *__private-assert-info* "swamp-bat" (the-as uint 283) (the-as uint 20)) (__assert (< f30-1 1.0) "(< interp 1.0)") ) - (vector-lerp! (-> self root-override trans) s5-0 (-> self idle-position) f30-1) - (quaternion-slerp! (-> self root-override quat) s4-0 gp-0 f30-1) + (vector-lerp! (-> self root trans) s5-0 (-> self idle-position) f30-1) + (quaternion-slerp! (-> self root quat) s4-0 gp-0 f30-1) ) ) (ja :num! (loop! (-> self idle-anim-speed))) @@ -275,8 +264,8 @@ swamp-bat-slave-event-handler ) ) (label cfg-10) - (set! (-> self root-override trans quad) (-> self idle-position quad)) - (quaternion-copy! (-> self root-override quat) gp-0) + (set! (-> self root trans quad) (-> self idle-position quad)) + (quaternion-copy! (-> self root quat) gp-0) ) ) (set! (-> self launch-ready) #t) @@ -286,9 +275,9 @@ swamp-bat-slave-event-handler (let ((f26-0 (cos f30-2)) (f28-0 (sin f30-2)) ) - (set! (-> self root-override trans quad) (-> self idle-path origin quad)) - (vector+*! (-> self root-override trans) (-> self root-override trans) (-> self idle-path x-axis) f26-0) - (vector+*! (-> self root-override trans) (-> self root-override trans) (-> self idle-path y-axis) f28-0) + (set! (-> self root trans quad) (-> self idle-path origin quad)) + (vector+*! (-> self root trans) (-> self root trans) (-> self idle-path x-axis) f26-0) + (vector+*! (-> self root trans) (-> self root trans) (-> self idle-path y-axis) f28-0) ) (ja :num! (loop! (-> self idle-anim-speed))) (suspend) @@ -307,7 +296,7 @@ swamp-bat-slave-event-handler (set! (-> self launch-ready) #f) (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new-stack-vector0))) - (set! (-> gp-0 quad) (-> self root-override trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) (let ((s5-0 (new-stack-vector0))) (eval-path-curve-div! (-> self parent-process 0 path-list (-> self path-select)) s5-0 0.0 'interp) (ja :group! swamp-bat-idle-ja) @@ -317,7 +306,7 @@ swamp-bat-slave-event-handler (go swamp-bat-slave-swoop) ) (let ((f0-1 (* 0.011111111 (the float s4-0)))) - (vector-lerp! (-> self root-override trans) gp-0 s5-0 f0-1) + (vector-lerp! (-> self root trans) gp-0 s5-0 f0-1) ) ) (ja :num! (loop! (-> self idle-anim-speed))) @@ -415,14 +404,14 @@ swamp-bat-slave-event-handler (let ((gp-0 (new-stack-vector0))) (let ((v1-1 (handle->process arg0))) (if v1-1 - (vector-! gp-0 (-> self root-override trans) (-> (the-as swamp-bat v1-1) root-override trans)) + (vector-! gp-0 (-> self root trans) (-> (the-as swamp-bat v1-1) root trans)) ) ) (+! (-> gp-0 y) -6144.0) (vector-normalize! gp-0 98304.0) (ja :group! swamp-bat-die-ja) (until (ja-done? 0) - (vector-v++! (-> self root-override trans) gp-0) + (vector-v++! (-> self root trans) gp-0) (ja :num! (seek! max 0.5)) (suspend) ) @@ -461,12 +450,12 @@ swamp-bat-slave-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> self root-override) s4-0) + (set! (-> self root) s4-0) ) - (set! (-> self root-override trans quad) (-> arg0 root-override trans quad)) - (set! (-> self root-override quat vec quad) (-> arg0 root-override quat vec quad)) - (vector-float*! (-> self root-override scale) *identity-vector* 2.0) - (set! (-> self root-override pause-adjust-distance) 286720.0) + (set! (-> self root trans quad) (-> arg0 root trans quad)) + (set! (-> self root quat vec quad) (-> arg0 root quat vec quad)) + (vector-float*! (-> self root scale) *identity-vector* 2.0) + (set! (-> self root pause-adjust-distance) 286720.0) (set! (-> self fact) (new 'process 'fact-info-enemy self (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) @@ -475,7 +464,7 @@ swamp-bat-slave-event-handler (set! (-> self strafe-envelope) 0.0) (set! (-> self idle-position-index) arg1) (swamp-bat-slave-get-new-path) - (set! (-> self root-override trans quad) (-> self idle-position quad)) + (set! (-> self root trans quad) (-> self idle-position quad)) (setup-params! (-> self sync) (the-as uint 1200) 0.0 0.15 0.15) (initialize-skeleton self *swamp-bat-slave-sg* '()) (logclear! (-> self mask) (process-mask actor-pause)) @@ -570,9 +559,7 @@ swamp-bat-slave-event-handler (loop (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) *target* - (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (when (not (-> self child-process)) (process-entity-status! self (entity-perm-status dead) #t) @@ -586,8 +573,8 @@ swamp-bat-slave-event-handler ) ) (let ((gp-1 (new 'static 'matrix))) - (quaternion->matrix gp-1 (-> self root-override quat)) - (set! (-> gp-1 vector 3 quad) (-> self root-override trans quad)) + (quaternion->matrix gp-1 (-> self root quat)) + (set! (-> gp-1 vector 3 quad) (-> self root trans quad)) ) (suspend) ) @@ -634,7 +621,7 @@ swamp-bat-slave-event-handler ;; definition for method 11 of type swamp-bat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swamp-bat ((this swamp-bat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swamp-bat) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 0.0) @@ -642,7 +629,7 @@ swamp-bat-slave-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -665,7 +652,7 @@ swamp-bat-slave-event-handler (if (!= (-> this path-count) 2) (go process-drawable-art-error "need 2 paths") ) - (set! (-> this fact-override) + (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (let ((a1-10 (res-lump-value arg0 'num-lurkers uint128 :default (the-as uint128 6)))) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc index 0bf5beece2e..be1ea1610c7 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc @@ -110,17 +110,13 @@ ;; definition of type swamp-spike (deftype swamp-spike (process-drawable) - ((root-override collide-shape :offset 112) - (sync sync-info :inline :offset-assert 176) - (open-gate symbol :offset-assert 184) - (dangerous symbol :offset-assert 188) + ((root collide-shape :override) + (sync sync-info :inline) + (open-gate symbol) + (dangerous symbol) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc0 - :flag-assert #x15005000c0 (:methods - (init! (_type_) symbol 20) + (init! (_type_) symbol) ) (:states swamp-spike-idle @@ -128,7 +124,7 @@ ) ;; definition for method 3 of type swamp-spike -(defmethod inspect swamp-spike ((this swamp-spike)) +(defmethod inspect ((this swamp-spike)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -152,7 +148,7 @@ (when (-> self dangerous) (if ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 1) ) (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) @@ -166,7 +162,7 @@ ;; INFO: Return type mismatch int vs none. (defun swamp-spike-set-particle-rotation-callback ((arg0 part-tracker)) (let* ((v1-0 (the-as object (-> arg0 userdata))) - (f0-1 (+ -65314.562 (quaternion-y-angle (-> (the-as (pointer swamp-spike) v1-0) 0 root-override quat)))) + (f0-1 (+ -65314.562 (quaternion-y-angle (-> (the-as (pointer swamp-spike) v1-0) 0 root quat)))) ) (set! (-> *part-id-table* 1325 init-specs 20 initial-valuef) f0-1) (set! (-> *part-id-table* 1326 init-specs 20 initial-valuef) f0-1) @@ -183,8 +179,8 @@ (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 to) (the-as process 1)) (set! (-> a1-0 from) (the-as process *touching-list*)) - (if (find-overlapping-shapes (-> self root-override) (the-as overlaps-others-params a1-0)) - (do-push-aways! (-> self root-override)) + (if (find-overlapping-shapes (-> self root) (the-as overlaps-others-params a1-0)) + (do-push-aways! (-> self root)) ) ) (none) @@ -197,8 +193,8 @@ (set! (-> self dangerous) #f) (let ((gp-0 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) - (vector-z-quaternion! gp-0 (-> self root-override quat)) - (set! (-> gp-0 w) (- (vector-dot gp-0 (-> self root-override trans)))) + (vector-z-quaternion! gp-0 (-> self root quat)) + (set! (-> gp-0 w) (- (vector-dot gp-0 (-> self root trans)))) (loop (set-time! (-> self state-time)) (ja :group! swamp-spike-up-ja) @@ -206,12 +202,11 @@ (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) - (let ((s5-0 (or (not *target*) - (< 204800.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) - ) + (let ((s5-0 + (or (not *target*) (< 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + ) ) - (if (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) *camera* ) (set! s5-0 (< (* (vector4-dot gp-0 (target-pos 0)) (vector4-dot gp-0 (camera-pos))) 0.0)) @@ -237,7 +232,7 @@ swamp-spike-set-particle-rotation-callback (-> self ppointer) #f - (-> self root-override trans) + (-> self root trans) :to self ) ) @@ -262,7 +257,7 @@ swamp-spike-set-particle-rotation-callback (-> self ppointer) #f - (-> self root-override trans) + (-> self root trans) :to self ) ) @@ -307,7 +302,7 @@ swamp-spike-set-particle-rotation-callback (-> self ppointer) #f - (-> self root-override trans) + (-> self root trans) :to self ) (ja-no-eval :group! swamp-spike-down-ja :num! (seek!) :frame-num 0.0) @@ -330,7 +325,7 @@ ) ;; definition for method 20 of type swamp-spike -(defmethod init! swamp-spike ((this swamp-spike)) +(defmethod init! ((this swamp-spike)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -359,7 +354,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (process-drawable-from-entity! this (-> this entity)) (initialize-skeleton this *swamp-spike-sg* '()) @@ -372,7 +367,7 @@ ;; definition for method 11 of type swamp-spike ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swamp-spike ((this swamp-spike) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swamp-spike) (arg0 entity-actor)) (init! this) (go swamp-spike-idle) (none) @@ -381,10 +376,6 @@ ;; definition of type swampgate (deftype swampgate (swamp-spike) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc0 - :flag-assert #x15005000c0 (:states swamp-spike-gate-down swamp-spike-gate-up @@ -392,7 +383,7 @@ ) ;; definition for method 3 of type swampgate -(defmethod inspect swampgate ((this swampgate)) +(defmethod inspect ((this swampgate)) (let ((t9-0 (method-of-type swamp-spike inspect))) (t9-0 this) ) @@ -401,7 +392,7 @@ ;; definition for method 11 of type swampgate ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swampgate ((this swampgate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swampgate) (arg0 entity-actor)) (init! this) (if (logtest? (-> arg0 extra perm status) (entity-perm-status complete)) (go swamp-spike-gate-down) @@ -412,25 +403,21 @@ ;; definition of type balance-plat (deftype balance-plat (process-drawable) - ((root-override collide-shape-moving :offset 112) - (y-travel float :offset-assert 176) - (y-init float :offset-assert 180) - (y-offset float :offset-assert 184) - (y-vel float :offset-assert 188) - (y-accel float :offset-assert 192) - (got-grow symbol :offset-assert 196) + ((root collide-shape-moving :override) + (y-travel float) + (y-init float) + (y-offset float) + (y-vel float) + (y-accel float) + (got-grow symbol) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xc8 - :flag-assert #x14006000c8 (:states balance-plat-idle ) ) ;; definition for method 3 of type balance-plat -(defmethod inspect balance-plat ((this balance-plat)) +(defmethod inspect ((this balance-plat)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -468,7 +455,7 @@ (f28-0 (* -0.025 (- (-> self y-offset) (-> self y-travel)))) ) (cond - ((and (-> self root-override riders) (nonzero? (-> self root-override riders num-riders))) + ((and (-> self root riders) (nonzero? (-> self root riders num-riders))) (send-event *target* 'no-look-around (seconds 0.25)) (set! (-> self y-accel) (fmin 4.096 (fmax -4.096 (+ -0.2048 (-> self y-accel))))) (set! (-> self y-vel) (fmin f28-0 (fmax f30-0 (+ (-> self y-vel) (-> self y-accel))))) @@ -497,7 +484,7 @@ ) ) (+! (-> self y-offset) (-> self y-vel)) - (set! (-> self root-override trans y) (+ (-> self y-init) (-> self y-offset))) + (set! (-> self root trans y) (+ (-> self y-init) (-> self y-offset))) (suspend) ) ) @@ -506,7 +493,7 @@ ;; definition for method 11 of type balance-plat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! balance-plat ((this balance-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this balance-plat) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -526,7 +513,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *balance-plat-sg* '()) @@ -534,7 +521,7 @@ (set! (-> this y-accel) 0.0) (set! (-> this y-vel) 0.0) (set! (-> this y-offset) 0.0) - (set! (-> this y-init) (-> this root-override trans y)) + (set! (-> this y-init) (-> this root trans y)) (set! (-> this got-grow) #f) (set! (-> this y-travel) (res-lump-float arg0 'distance :default 20480.0)) (go balance-plat-idle) @@ -543,12 +530,8 @@ ;; definition of type swamp-rock (deftype swamp-rock (process-drawable) - ((root-override basic :offset 112) + ((root collide-shape-moving :override) ) - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states swamp-rock-break swamp-rock-idle @@ -556,7 +539,7 @@ ) ;; definition for method 3 of type swamp-rock -(defmethod inspect swamp-rock ((this swamp-rock)) +(defmethod inspect ((this swamp-rock)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -695,7 +678,7 @@ ;; definition for method 11 of type swamp-rock ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swamp-rock ((this swamp-rock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swamp-rock) (arg0 entity-actor)) (logior! (-> this mask) (process-mask attackable)) (let ((f30-0 (res-lump-float arg0 'scale-factor :default 1.0))) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -710,7 +693,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root) s4-0) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) (process-drawable-from-entity! this arg0) (vector-float*! (-> this root scale) *identity-vector* f30-0) @@ -791,17 +774,13 @@ ;; definition of type tar-plat (deftype tar-plat (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 736) - (float-height float :offset-assert 752) + ((anchor-point vector :inline) + (float-height float) ) - :heap-base #x290 - :method-count-assert 35 - :size-assert #x2f4 - :flag-assert #x23029002f4 ) ;; definition for method 3 of type tar-plat -(defmethod inspect tar-plat ((this tar-plat)) +(defmethod inspect ((this tar-plat)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) (t9-0 this) ) @@ -811,7 +790,7 @@ ) ;; definition for method 22 of type tar-plat -(defmethod rigid-body-platform-method-22 tar-plat ((this tar-plat) (arg0 vector) (arg1 float)) +(defmethod rigid-body-platform-method-22 ((this tar-plat) (arg0 vector) (arg1 float)) (+ (-> this float-height) (-> this float-height-offset) (* 512.0 (cos (* 109.22667 (+ (* 60.0 arg1) (* 0.03 (-> arg0 x)) (* 0.03 (-> arg0 z)))))) @@ -820,7 +799,7 @@ ;; definition for method 23 of type tar-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 tar-plat ((this tar-plat) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this tar-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 @@ -876,7 +855,7 @@ ;; definition for method 30 of type tar-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 tar-plat ((this tar-plat)) +(defmethod rigid-body-platform-method-30 ((this tar-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -904,7 +883,7 @@ ;; definition for method 31 of type tar-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 tar-plat ((this tar-plat)) +(defmethod rigid-body-platform-method-31 ((this tar-plat)) (initialize-skeleton this *tar-plat-sg* '()) (rigid-body-platform-method-29 this *tar-plat-constants*) (set! (-> this float-height) (-> this entity extra trans y)) @@ -933,14 +912,10 @@ ;; definition of type swamp-barrel (deftype swamp-barrel (barrel) () - :heap-base #x90 - :method-count-assert 30 - :size-assert #x100 - :flag-assert #x1e00900100 ) ;; definition for method 3 of type swamp-barrel -(defmethod inspect swamp-barrel ((this swamp-barrel)) +(defmethod inspect ((this swamp-barrel)) (let ((t9-0 (method-of-type barrel inspect))) (t9-0 this) ) @@ -950,13 +925,10 @@ ;; definition of type swampcam (deftype swampcam (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) ;; definition for method 3 of type swampcam -(defmethod inspect swampcam ((this swampcam)) +(defmethod inspect ((this swampcam)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -996,14 +968,10 @@ ;; definition of type swamp-battlecontroller (deftype swamp-battlecontroller (battlecontroller) () - :heap-base #x210 - :method-count-assert 29 - :size-assert #x27c - :flag-assert #x1d0210027c ) ;; definition for method 3 of type swamp-battlecontroller -(defmethod inspect swamp-battlecontroller ((this swamp-battlecontroller)) +(defmethod inspect ((this swamp-battlecontroller)) (let ((t9-0 (method-of-type battlecontroller inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-part_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-part_REF.gc index 6f2e7fffffe..28246341125 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type swamp-part (deftype swamp-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type swamp-part -(defmethod inspect swamp-part ((this swamp-part)) +(defmethod inspect ((this swamp-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc index 626b9ee8a75..2e4833d9b40 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc @@ -593,23 +593,19 @@ ;; definition of type swamp-rat-nest (deftype swamp-rat-nest (process-drawable) - ((child-process (pointer swamp-rat-nest-dummy) :offset 20) - (fact-override fact-info-enemy :offset 144) - (dummy (pointer swamp-rat-nest-dummy) :offset-assert 176) - (damaged symbol :offset-assert 180) - (dummy-type int8 :offset-assert 184) - (rat-count int8 :offset-assert 185) - (hit-points int8 :offset-assert 186) - (defensive-rat-count int8 :offset-assert 187) - (spawn-period float :offset-assert 188) - (spawn-period-scale float :offset-assert 192) - (test-interval time-frame :offset-assert 200) - (player-attack-id int32 :offset-assert 208) + ((fact fact-info-enemy :override) + (child-process (pointer swamp-rat-nest-dummy) :overlay-at child) + (dummy (pointer swamp-rat-nest-dummy)) + (damaged symbol) + (dummy-type int8) + (rat-count int8) + (hit-points int8) + (defensive-rat-count int8) + (spawn-period float) + (spawn-period-scale float) + (test-interval time-frame) + (player-attack-id int32) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd4 - :flag-assert #x14007000d4 (:states swamp-rat-nest-active swamp-rat-nest-die @@ -620,7 +616,7 @@ ) ;; definition for method 3 of type swamp-rat-nest -(defmethod inspect swamp-rat-nest ((this swamp-rat-nest)) +(defmethod inspect ((this swamp-rat-nest)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -639,21 +635,17 @@ ;; definition of type swamp-rat-nest-dummy (deftype swamp-rat-nest-dummy (process-drawable) - ((parent-process (pointer swamp-rat-nest) :offset 12) - (root-override collide-shape :offset 112) - (top-sphere sphere :inline :offset-assert 176) - (death-part sparticle-launch-group :offset-assert 192) - (spawn-joint-array int8 6 :offset-assert 196) - (spawn-joint-count int8 :offset-assert 202) - (particle-spawn-joint int8 :offset-assert 203) + ((root collide-shape :override) + (parent-process (pointer swamp-rat-nest) :overlay-at parent) + (top-sphere sphere :inline) + (death-part sparticle-launch-group) + (spawn-joint-array int8 6) + (spawn-joint-count int8) + (particle-spawn-joint int8) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16006000cc (:methods - (swamp-rat-nest-dummy-method-20 (_type_) none 20) - (swamp-rat-nest-dummy-method-21 (_type_) int 21) + (swamp-rat-nest-dummy-method-20 (_type_) none) + (swamp-rat-nest-dummy-method-21 (_type_) int) ) (:states swamp-rat-nest-dummy-die @@ -664,7 +656,7 @@ ) ;; definition for method 3 of type swamp-rat-nest-dummy -(defmethod inspect swamp-rat-nest-dummy ((this swamp-rat-nest-dummy)) +(defmethod inspect ((this swamp-rat-nest-dummy)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -679,14 +671,10 @@ ;; definition of type swamp-rat-nest-dummy-a (deftype swamp-rat-nest-dummy-a (swamp-rat-nest-dummy) () - :heap-base #x60 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16006000cc ) ;; definition for method 3 of type swamp-rat-nest-dummy-a -(defmethod inspect swamp-rat-nest-dummy-a ((this swamp-rat-nest-dummy-a)) +(defmethod inspect ((this swamp-rat-nest-dummy-a)) (let ((t9-0 (method-of-type swamp-rat-nest-dummy inspect))) (t9-0 this) ) @@ -696,14 +684,10 @@ ;; definition of type swamp-rat-nest-dummy-b (deftype swamp-rat-nest-dummy-b (swamp-rat-nest-dummy) () - :heap-base #x60 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16006000cc ) ;; definition for method 3 of type swamp-rat-nest-dummy-b -(defmethod inspect swamp-rat-nest-dummy-b ((this swamp-rat-nest-dummy-b)) +(defmethod inspect ((this swamp-rat-nest-dummy-b)) (let ((t9-0 (method-of-type swamp-rat-nest-dummy inspect))) (t9-0 this) ) @@ -713,14 +697,10 @@ ;; definition of type swamp-rat-nest-dummy-c (deftype swamp-rat-nest-dummy-c (swamp-rat-nest-dummy) () - :heap-base #x60 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16006000cc ) ;; definition for method 3 of type swamp-rat-nest-dummy-c -(defmethod inspect swamp-rat-nest-dummy-c ((this swamp-rat-nest-dummy-c)) +(defmethod inspect ((this swamp-rat-nest-dummy-c)) (let ((t9-0 (method-of-type swamp-rat-nest-dummy inspect))) (t9-0 this) ) @@ -869,14 +849,14 @@ (logior! (-> self mask) (process-mask enemy)) (swamp-rat-nest-dummy-method-20 self) (process-drawable-from-entity! self gp-0) - (set! (-> self top-sphere quad) (-> self root-override trans quad)) + (set! (-> self top-sphere quad) (-> self root trans quad)) (+! (-> self top-sphere y) 24576.0) (set! (-> self top-sphere w) 18432.0) (set! (-> self entity) gp-0) ) - (set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0)) + (set! (-> self nav) (new 'process 'nav-control (-> self root) 16 40960.0)) (logior! (-> self nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set-current-poly! (-> self nav) (find-poly (-> self nav) (-> self root-override trans))) + (set-current-poly! (-> self nav) (find-poly (-> self nav) (-> self root trans))) (+! (-> self parent-process 0 hit-points) 3) (swamp-rat-nest-dummy-method-21 self) (when (zero? (-> self skel)) @@ -942,7 +922,7 @@ swamp-rat-nest-default-event-handler ) (set! (-> gp-0 quad) (-> v1-8 transform vector 3 quad)) (let ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-8 transform vector 1) 1.0)) - (s4-0 (if (= (-> self fact-override pickup-type) (pickup-type none)) + (s4-0 (if (= (-> self fact pickup-type) (pickup-type none)) 0 9 ) @@ -1000,9 +980,8 @@ swamp-rat-nest-default-event-handler (set-time! (-> self state-time)) ) :trans (behavior () - (if (and *target* (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root trans) (-> *target* control trans)) - ) + (if (and *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (go swamp-rat-nest-active) ) @@ -1102,7 +1081,7 @@ swamp-rat-nest-default-event-handler :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) (process-entity-status! self (entity-perm-status dead) #t) - (drop-pickup (-> self fact-override) #t *entity-pool* (-> self fact-override) 0) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0) (while (-> self child-process) (suspend) ) @@ -1112,11 +1091,11 @@ swamp-rat-nest-default-event-handler ;; definition for method 11 of type swamp-rat-nest ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swamp-rat-nest ((this swamp-rat-nest) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swamp-rat-nest) (arg0 entity-actor)) (logior! (-> this mask) (process-mask enemy)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) - (set! (-> this fact-override) + (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (set! (-> this path) (new 'process 'path-control this 'path 0.0)) @@ -1161,7 +1140,7 @@ swamp-rat-nest-default-event-handler ) ;; definition for method 20 of type swamp-rat-nest-dummy-a -(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-a ((this swamp-rat-nest-dummy-a)) +(defmethod swamp-rat-nest-dummy-method-20 ((this swamp-rat-nest-dummy-a)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -1174,14 +1153,14 @@ swamp-rat-nest-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton this *swamp-rat-nest-dummy-a-sg* '()) (none) ) ;; definition for method 20 of type swamp-rat-nest-dummy-b -(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-b ((this swamp-rat-nest-dummy-b)) +(defmethod swamp-rat-nest-dummy-method-20 ((this swamp-rat-nest-dummy-b)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -1194,14 +1173,14 @@ swamp-rat-nest-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton this *swamp-rat-nest-dummy-b-sg* '()) (none) ) ;; definition for method 20 of type swamp-rat-nest-dummy-c -(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-c ((this swamp-rat-nest-dummy-c)) +(defmethod swamp-rat-nest-dummy-method-20 ((this swamp-rat-nest-dummy-c)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -1214,14 +1193,14 @@ swamp-rat-nest-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton this *swamp-rat-nest-dummy-c-sg* '()) (none) ) ;; definition for method 21 of type swamp-rat-nest-dummy-a -(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-a ((this swamp-rat-nest-dummy-a)) +(defmethod swamp-rat-nest-dummy-method-21 ((this swamp-rat-nest-dummy-a)) (let ((v1-0 0)) (let* ((a0-1 '(5 6 7 8 9 10)) (a1-0 (car a0-1)) @@ -1246,7 +1225,7 @@ swamp-rat-nest-default-event-handler ) ;; definition for method 21 of type swamp-rat-nest-dummy-b -(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-b ((this swamp-rat-nest-dummy-b)) +(defmethod swamp-rat-nest-dummy-method-21 ((this swamp-rat-nest-dummy-b)) (let ((v1-0 0)) (let* ((a0-1 '(5 9 10 6 7 8)) (a1-0 (car a0-1)) @@ -1271,7 +1250,7 @@ swamp-rat-nest-default-event-handler ) ;; definition for method 21 of type swamp-rat-nest-dummy-c -(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-c ((this swamp-rat-nest-dummy-c)) +(defmethod swamp-rat-nest-dummy-method-21 ((this swamp-rat-nest-dummy-c)) (let ((v1-0 0)) (let* ((a0-1 '(5 6)) (a1-0 (car a0-1)) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc index db0a77795f1..5f56a46cc3d 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc @@ -3,29 +3,25 @@ ;; definition of type swamp-rat (deftype swamp-rat (nav-enemy) - ((up-vector vector :inline :offset-assert 400) - (state-float float :offset-assert 416) - (state-vector vector :inline :offset-assert 432) - (_hack uint64 :offset-assert 448) - (wiggle-time time-frame :offset-assert 456) - (wiggle-angle float :offset-assert 464) - (delta-wiggle-angle float :offset-assert 468) - (wiggle-factor float :offset-assert 472) - (min-height float :offset-assert 476) - (chase-rest-time time-frame :offset-assert 480) - (target-nav-time time-frame :offset-assert 488) + ((up-vector vector :inline) + (state-float float) + (state-vector vector :inline) + (_hack uint64) + (wiggle-time time-frame) + (wiggle-angle float) + (delta-wiggle-angle float) + (wiggle-factor float) + (min-height float) + (chase-rest-time time-frame) + (target-nav-time time-frame) ) - :heap-base #x180 - :method-count-assert 76 - :size-assert #x1f0 - :flag-assert #x4c018001f0 (:states swamp-rat-spawn ) ) ;; definition for method 3 of type swamp-rat -(defmethod inspect swamp-rat ((this swamp-rat)) +(defmethod inspect ((this swamp-rat)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -51,7 +47,7 @@ ) ;; definition for method 44 of type swamp-rat -(defmethod touch-handler swamp-rat ((this swamp-rat) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler ((this swamp-rat) (arg0 process) (arg1 event-message-block)) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) (-> this collide-info) @@ -90,7 +86,7 @@ swamp-rat-default-event-handler ;; definition for method 39 of type swamp-rat ;; INFO: Used lq/sq -(defmethod common-post swamp-rat ((this swamp-rat)) +(defmethod common-post ((this swamp-rat)) (when (logtest? (-> this collide-info status) (cshape-moving-flags onsurf)) (vector-deg-seek (-> this up-vector) (-> this up-vector) (-> this collide-info surface-normal) 910.2222) (vector-normalize! (-> this up-vector) 1.0) @@ -107,7 +103,7 @@ swamp-rat-default-event-handler ;; definition for method 38 of type swamp-rat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-38 swamp-rat ((this swamp-rat)) +(defmethod nav-enemy-method-38 ((this swamp-rat)) (integrate-for-enemy-with-move-to-ground! (-> this collide-info) (-> this collide-info transv) @@ -442,7 +438,7 @@ swamp-rat-default-event-handler ;; definition for method 47 of type swamp-rat ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision swamp-rat ((this swamp-rat)) +(defmethod initialize-collision ((this swamp-rat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -468,7 +464,7 @@ swamp-rat-default-event-handler ;; definition for method 48 of type swamp-rat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 swamp-rat ((this swamp-rat)) +(defmethod nav-enemy-method-48 ((this swamp-rat)) (initialize-skeleton this *swamp-rat-sg* '()) (init-defaults! this *swamp-rat-nav-enemy-info*) (vector-float*! (-> this collide-info scale) *identity-vector* 1.5) diff --git a/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc b/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc index 6ac7ddcdde1..b1f03c4fbf5 100644 --- a/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc @@ -3,31 +3,27 @@ ;; definition of type logo (deftype logo (process-drawable) - ((camera handle :offset-assert 176) - (camera-anim handle :offset-assert 184) - (volumes handle :offset-assert 192) - (black handle :offset-assert 200) - (target handle :offset-assert 208) - (sidekick handle :offset-assert 216) - (main-joint joint-mod :offset-assert 224) - (anim spool-anim :offset-assert 228) - (next-anim spool-anim :offset-assert 232) - (done? symbol :offset-assert 236) + ((camera handle) + (camera-anim handle) + (volumes handle) + (black handle) + (target handle) + (sidekick handle) + (main-joint joint-mod) + (anim spool-anim) + (next-anim spool-anim) + (done? symbol) ) - :heap-base #x80 - :method-count-assert 24 - :size-assert #xf0 - :flag-assert #x18008000f0 - (:methods - (idle () _type_ :state 20) - (startup () _type_ :state 21) - (hidden () _type_ :state 22) - (ndi () _type_ :state 23) + (:state-methods + idle + startup + hidden + ndi ) ) ;; definition for method 3 of type logo -(defmethod inspect logo ((this logo)) +(defmethod inspect ((this logo)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -46,7 +42,7 @@ ;; definition for method 7 of type logo ;; INFO: Return type mismatch process-drawable vs logo. -(defmethod relocate logo ((this logo) (arg0 int)) +(defmethod relocate ((this logo) (arg0 int)) (if (nonzero? (-> this main-joint)) (&+! (-> this main-joint) arg0) ) @@ -55,20 +51,16 @@ ;; definition of type logo-slave (deftype logo-slave (process-drawable) - ((parent-process (pointer logo) :offset 12) - (main-joint joint-mod :offset-assert 176) + ((parent-process (pointer logo) :overlay-at parent) + (main-joint joint-mod) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xb4 - :flag-assert #x15005000b4 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type logo-slave -(defmethod inspect logo-slave ((this logo-slave)) +(defmethod inspect ((this logo-slave)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -78,7 +70,7 @@ ;; definition for method 7 of type logo-slave ;; INFO: Return type mismatch process-drawable vs logo-slave. -(defmethod relocate logo-slave ((this logo-slave) (arg0 int)) +(defmethod relocate ((this logo-slave) (arg0 int)) (if (nonzero? (-> this main-joint)) (&+! (-> this main-joint) arg0) ) diff --git a/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc b/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc index 6fa0d1077d7..e2f2f7bb665 100644 --- a/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc @@ -4,14 +4,10 @@ ;; definition of type training-water (deftype training-water (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) ;; definition for method 3 of type training-water -(defmethod inspect training-water ((this training-water)) +(defmethod inspect ((this training-water)) (let ((t9-0 (method-of-type water-anim inspect))) (t9-0 this) ) @@ -34,7 +30,7 @@ ;; definition for method 22 of type training-water ;; INFO: Return type mismatch ripple-wave-set vs none. -(defmethod water-vol-method-22 training-water ((this training-water)) +(defmethod water-vol-method-22 ((this training-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) @@ -57,22 +53,18 @@ ;; definition of type training-cam (deftype training-cam (process) - ((root trsq :offset-assert 112) - (range meters :offset-assert 116) - (index int32 :offset-assert 120) - (state-time time-frame :offset-assert 128) + ((root trsq) + (range meters) + (index int32) + (state-time time-frame) ) - :heap-base #x20 - :method-count-assert 15 - :size-assert #x88 - :flag-assert #xf00200088 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) ;; definition for method 3 of type training-cam -(defmethod inspect training-cam ((this training-cam)) +(defmethod inspect ((this training-cam)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -85,7 +77,7 @@ ;; definition for method 7 of type training-cam ;; INFO: Return type mismatch process vs training-cam. -(defmethod relocate training-cam ((this training-cam) (arg0 int)) +(defmethod relocate ((this training-cam) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) @@ -232,7 +224,7 @@ ;; definition for method 11 of type training-cam ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! training-cam ((this training-cam) (arg0 entity-actor)) +(defmethod init-from-entity! ((this training-cam) (arg0 entity-actor)) "Copy defaults from the entity." (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this root) (new 'process 'trsq)) @@ -247,16 +239,12 @@ ;; definition of type tra-pontoon (deftype tra-pontoon (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 736) + ((anchor-point vector :inline) ) - :heap-base #x280 - :method-count-assert 35 - :size-assert #x2f0 - :flag-assert #x23028002f0 ) ;; definition for method 3 of type tra-pontoon -(defmethod inspect tra-pontoon ((this tra-pontoon)) +(defmethod inspect ((this tra-pontoon)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) (t9-0 this) ) @@ -266,7 +254,7 @@ ;; definition for method 11 of type tra-pontoon ;; INFO: Return type mismatch int vs none. -(defmethod init-from-entity! tra-pontoon ((this tra-pontoon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tra-pontoon) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (rigid-body-platform-method-30 this) (process-drawable-from-entity! this arg0) @@ -278,7 +266,7 @@ ;; definition for method 23 of type tra-pontoon ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 tra-pontoon ((this tra-pontoon) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this tra-pontoon) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 @@ -320,7 +308,7 @@ ;; definition for method 30 of type tra-pontoon ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 tra-pontoon ((this tra-pontoon)) +(defmethod rigid-body-platform-method-30 ((this tra-pontoon)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -348,7 +336,7 @@ ;; definition for method 31 of type tra-pontoon ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 tra-pontoon ((this tra-pontoon)) +(defmethod rigid-body-platform-method-31 ((this tra-pontoon)) (initialize-skeleton this *tra-pontoon-sg* '()) (rigid-body-platform-method-29 this *tra-pontoon-constants*) (set! (-> this float-height-offset) 6144.0) @@ -386,14 +374,10 @@ ;; definition of type tra-iris-door (deftype tra-iris-door (eco-door) () - :heap-base #xa0 - :method-count-assert 27 - :size-assert #x104 - :flag-assert #x1b00a00104 ) ;; definition for method 3 of type tra-iris-door -(defmethod inspect tra-iris-door ((this tra-iris-door)) +(defmethod inspect ((this tra-iris-door)) (let ((t9-0 (method-of-type eco-door inspect))) (t9-0 this) ) @@ -408,7 +392,7 @@ ;; definition for method 24 of type tra-iris-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-24 tra-iris-door ((this tra-iris-door)) +(defmethod eco-door-method-24 ((this tra-iris-door)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) @@ -421,7 +405,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -429,11 +413,11 @@ ;; definition for method 25 of type tra-iris-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-25 tra-iris-door ((this tra-iris-door)) +(defmethod eco-door-method-25 ((this tra-iris-door)) (initialize-skeleton this *tra-iris-door-sg* '()) (set! (-> this open-distance) 32768.0) (set! (-> this close-distance) 49152.0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) 0 (none) ) @@ -611,22 +595,18 @@ ;; definition of type scarecrow-a (deftype scarecrow-a (process-drawable) - ((root-override collide-shape :offset 112) - (incomming-attack-id uint64 :offset-assert 176) - (intersection vector :inline :offset-assert 192) + ((root collide-shape :override) + (incomming-attack-id uint64) + (intersection vector :inline) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16006000d0 - (:methods - (idle () _type_ :state 20) - (hit (float vector symbol) _type_ :state 21) + (:state-methods + idle + (hit float vector symbol) ) ) ;; definition for method 3 of type scarecrow-a -(defmethod inspect scarecrow-a ((this scarecrow-a)) +(defmethod inspect ((this scarecrow-a)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -637,22 +617,18 @@ ;; definition of type scarecrow-b (deftype scarecrow-b (process-drawable) - ((root-override collide-shape :offset 112) - (incomming-attack-id uint64 :offset-assert 176) - (intersection vector :inline :offset-assert 192) + ((root collide-shape :override) + (incomming-attack-id uint64) + (intersection vector :inline) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16006000d0 - (:methods - (idle () _type_ :state 20) - (hit (float vector symbol) _type_ :state 21) + (:state-methods + idle + (hit float vector symbol) ) ) ;; definition for method 3 of type scarecrow-b -(defmethod inspect scarecrow-b ((this scarecrow-b)) +(defmethod inspect ((this scarecrow-b)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -709,7 +685,7 @@ (f30-0 (cond (v1-14 - (let ((s4-2 (-> self root-override)) + (let ((s4-2 (-> self root)) (s2-0 (-> (the-as process-drawable v1-14) root trans)) ) (deg-diff (y-angle s4-2) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-2 trans)))) @@ -722,7 +698,7 @@ ) (a0-24 ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint -1) ) ) @@ -738,7 +714,7 @@ symbol (and ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> block param 0)) - (the-as collide-shape-moving (-> self root-override)) + (the-as collide-shape-moving (-> self root)) (the-as uint 2) ) (or (= (-> self type) scarecrow-a) @@ -755,19 +731,12 @@ ) ) (('touch) - (send-shove-back - (-> self root-override) - proc - (the-as touching-shapes-entry (-> block param 0)) - 0.7 - 6144.0 - 16384.0 - ) + (send-shove-back (-> self root) proc (the-as touching-shapes-entry (-> block param 0)) 0.7 6144.0 16384.0) ) ) ) :trans (behavior () - (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (get-reminder (get-task-control (game-task training-gimmie)) 0) ) ) @@ -816,7 +785,7 @@ ) (go-virtual idle) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (effect-control-method-10 (-> self skel effect) 'group-scarecrow-joint-explode 12.0 -1) (effect-control-method-10 (-> self skel effect) 'group-scarecrow-joint-explode 20.0 -1) (effect-control-method-10 (-> self skel effect) 'group-scarecrow-explode 4.0 -1) @@ -862,7 +831,7 @@ ;; definition for method 11 of type scarecrow-a ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! scarecrow-a ((this scarecrow-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this scarecrow-a) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -889,7 +858,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *scarecrow-a-sg* '()) @@ -958,7 +927,7 @@ ) (go-virtual idle) ) - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (effect-control-method-10 (-> self skel effect) 'group-scarecrow-joint-explode 12.0 -1) (effect-control-method-10 (-> self skel effect) 'group-scarecrow-joint-explode 21.0 -1) (effect-control-method-10 (-> self skel effect) 'group-scarecrow-explode 4.0 -1) @@ -1007,7 +976,7 @@ ;; definition for method 11 of type scarecrow-b ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! scarecrow-b ((this scarecrow-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this scarecrow-b) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -1042,7 +1011,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *scarecrow-b-sg* '()) diff --git a/test/decompiler/reference/jak1/levels/training/training-part_REF.gc b/test/decompiler/reference/jak1/levels/training/training-part_REF.gc index df0ed14b790..7769a09e5a6 100644 --- a/test/decompiler/reference/jak1/levels/training/training-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/training/training-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type training-part (deftype training-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type training-part -(defmethod inspect training-part ((this training-part)) +(defmethod inspect ((this training-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/village1/assistant_REF.gc b/test/decompiler/reference/jak1/levels/village1/assistant_REF.gc index 3c05b591d09..f4e8ef23863 100644 --- a/test/decompiler/reference/jak1/levels/village1/assistant_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/assistant_REF.gc @@ -3,16 +3,12 @@ ;; definition of type assistant (deftype assistant (process-taskable) - ((sound-id sound-id :offset-assert 380) + ((sound-id sound-id) ) - :heap-base #x110 - :method-count-assert 53 - :size-assert #x180 - :flag-assert #x3501100180 ) ;; definition for method 3 of type assistant -(defmethod inspect assistant ((this assistant)) +(defmethod inspect ((this assistant)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -29,10 +25,10 @@ ;; definition for method 52 of type assistant ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 assistant ((this assistant)) +(defmethod process-taskable-method-52 ((this assistant)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -50,7 +46,7 @@ ;; definition for method 48 of type assistant ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow assistant ((this assistant)) +(defmethod draw-npc-shadow ((this assistant)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -74,7 +70,7 @@ ) ;; definition for method 32 of type assistant -(defmethod play-anim! assistant ((this assistant) (arg0 symbol)) +(defmethod play-anim! ((this assistant) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (case (current-task (-> this tasks)) @@ -176,12 +172,12 @@ ) ;; definition for method 31 of type assistant -(defmethod get-art-elem assistant ((this assistant)) +(defmethod get-art-elem ((this assistant)) (-> this draw art-group data 3) ) ;; definition for method 43 of type assistant -(defmethod process-taskable-method-43 assistant ((this assistant)) +(defmethod process-taskable-method-43 ((this assistant)) (let ((s5-0 (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this)) ) (when s5-0 @@ -191,19 +187,19 @@ #f ) ((< 0.8 f0-2) - (play-ambient (-> this ambient) "ASSTLP01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP01" #f (-> this root trans)) ) ((< 0.6 f0-2) - (play-ambient (-> this ambient) "ASSTLP04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP04" #f (-> this root trans)) ) ((< 0.4 f0-2) - (play-ambient (-> this ambient) "ASSTLP05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP05" #f (-> this root trans)) ) ((< 0.2 f0-2) - (play-ambient (-> this ambient) "ASSTLP02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP02" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "ASSTLP03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP03" #f (-> this root trans)) ) ) ) @@ -388,7 +384,7 @@ ;; definition for method 11 of type assistant ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! assistant ((this assistant) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-sg* 3 31 (new 'static 'vector :w 4096.0) 5) (set! (-> this bounce-away) #f) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 122) this)) diff --git a/test/decompiler/reference/jak1/levels/village1/explorer_REF.gc b/test/decompiler/reference/jak1/levels/village1/explorer_REF.gc index 5656a0c9091..fc96dc44795 100644 --- a/test/decompiler/reference/jak1/levels/village1/explorer_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/explorer_REF.gc @@ -4,14 +4,10 @@ ;; definition of type explorer (deftype explorer (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type explorer -(defmethod inspect explorer ((this explorer)) +(defmethod inspect ((this explorer)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -27,10 +23,10 @@ ;; definition for method 52 of type explorer ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 explorer ((this explorer)) +(defmethod process-taskable-method-52 ((this explorer)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -48,7 +44,7 @@ ;; definition for method 48 of type explorer ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow explorer ((this explorer)) +(defmethod draw-npc-shadow ((this explorer)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -72,7 +68,7 @@ ) ;; definition for method 32 of type explorer -(defmethod play-anim! explorer ((this explorer) (arg0 symbol)) +(defmethod play-anim! ((this explorer) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -148,39 +144,39 @@ ) ;; definition for method 31 of type explorer -(defmethod get-art-elem explorer ((this explorer)) +(defmethod get-art-elem ((this explorer)) (-> this draw art-group data 3) ) ;; definition for method 43 of type explorer -(defmethod process-taskable-method-43 explorer ((this explorer)) +(defmethod process-taskable-method-43 ((this explorer)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) - (play-ambient (-> this ambient) "EXP-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-AM05" #f (-> this root trans)) ) ((< 0.71428573 f0-2) (if (not (closed? (-> this tasks) (game-task village1-uncle-money) (task-status need-reminder))) - (play-ambient (-> this ambient) "EXP-LO02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-LO02" #f (-> this root trans)) ) ) ((< 0.5714286 f0-2) - (play-ambient (-> this ambient) "EXP-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-AM04" #f (-> this root trans)) ) ((< 0.42857143 f0-2) - (play-ambient (-> this ambient) "EXP-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-AM03" #f (-> this root trans)) ) ((< 0.2857143 f0-2) - (play-ambient (-> this ambient) "EXP-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-AM02" #f (-> this root trans)) ) ((< 0.14285715 f0-2) (if (not (closed? (-> this tasks) (game-task village1-uncle-money) (task-status need-reminder))) - (play-ambient (-> this ambient) "EXP-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-AM01" #f (-> this root trans)) ) ) (else - (play-ambient (-> this ambient) "EXP-LO1A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "EXP-LO1A" #f (-> this root trans)) ) ) ) @@ -189,7 +185,7 @@ ;; definition for method 47 of type explorer ;; INFO: Return type mismatch basic vs symbol. -(defmethod target-above-threshold? explorer ((this explorer)) +(defmethod target-above-threshold? ((this explorer)) (the-as symbol (and *target* (< (-> (target-pos 0) x) -202752.0) (< 98304.0 (-> (target-pos 0) z)))) ) @@ -346,7 +342,7 @@ ) ;; definition for method 11 of type explorer -(defmethod init-from-entity! explorer ((this explorer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this explorer) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *explorer-sg* 3 42 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task village1-uncle-money))) (set! (-> this sound-flava) (music-flava explorer)) diff --git a/test/decompiler/reference/jak1/levels/village1/farmer_REF.gc b/test/decompiler/reference/jak1/levels/village1/farmer_REF.gc index 31285a51a44..f6cbed530a1 100644 --- a/test/decompiler/reference/jak1/levels/village1/farmer_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/farmer_REF.gc @@ -4,14 +4,10 @@ ;; definition of type farmer (deftype farmer (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type farmer -(defmethod inspect farmer ((this farmer)) +(defmethod inspect ((this farmer)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -26,7 +22,7 @@ ) ;; definition for method 32 of type farmer -(defmethod play-anim! farmer ((this farmer) (arg0 symbol)) +(defmethod play-anim! ((this farmer) (arg0 symbol)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 @@ -73,7 +69,7 @@ ) ;; definition for method 31 of type farmer -(defmethod get-art-elem farmer ((this farmer)) +(defmethod get-art-elem ((this farmer)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction) (task-status need-resolution) (task-status invalid)) (-> this draw art-group data 4) @@ -85,24 +81,24 @@ ) ;; definition for method 43 of type farmer -(defmethod process-taskable-method-43 farmer ((this farmer)) +(defmethod process-taskable-method-43 ((this farmer)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8333333 f0-2) - (play-ambient (-> this ambient) "FAR-LO1A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FAR-LO1A" #f (-> this root trans)) ) ((< 0.6666667 f0-2) - (play-ambient (-> this ambient) "FAR-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FAR-AM01" #f (-> this root trans)) ) ((< 0.5 f0-2) #f ) ((< 0.33333334 f0-2) - (play-ambient (-> this ambient) "FAR-AM2A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FAR-AM2A" #f (-> this root trans)) ) ((< 0.16666667 f0-2) - (play-ambient (-> this ambient) "FAR-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FAR-AM02" #f (-> this root trans)) ) (else #f @@ -114,7 +110,7 @@ ;; definition for method 41 of type farmer ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision farmer ((this farmer) (arg0 int) (arg1 vector)) +(defmethod initialize-collision ((this farmer) (arg0 int) (arg1 vector)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) @@ -142,17 +138,17 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 11 of type farmer -(defmethod init-from-entity! farmer ((this farmer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farmer) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *farmer-sg* 3 25 (new 'static 'vector :w 4096.0) 5) - (set! (-> this root-override nav-radius) 40960.0) - (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this root nav-radius) 40960.0) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (set! (-> this tasks) (get-task-control (game-task village1-yakow))) (process-taskable-method-42 this) (none) diff --git a/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc b/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc index fbcc167864f..ff68696609c 100644 --- a/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc @@ -32,16 +32,13 @@ ;; definition of type boat-stabilizer (deftype boat-stabilizer (structure) - ((local-pos vector :inline :offset-assert 0) - (normal vector :inline :offset-assert 16) + ((local-pos vector :inline) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type boat-stabilizer -(defmethod inspect boat-stabilizer ((this boat-stabilizer)) +(defmethod inspect ((this boat-stabilizer)) (format #t "[~8x] ~A~%" this 'boat-stabilizer) (format #t "~Tlocal-pos: #~%" (-> this local-pos)) (format #t "~Tnormal: #~%" (-> this normal)) @@ -50,23 +47,20 @@ ;; definition of type vehicle-path (deftype vehicle-path (structure) - ((point-array vector 10 :inline :offset-assert 0) - (point-count int32 :offset-assert 160) + ((point-array vector 10 :inline) + (point-count int32) ) - :method-count-assert 14 - :size-assert #xa4 - :flag-assert #xe000000a4 (:methods - (get-point-count (_type_) int 9) - (nth-point (_type_ int vector) vector 10) - (distance-to-next-point (_type_ int vector) vector 11) - (add-point! (_type_ float float float float) none 12) - (debug-draw (_type_) symbol 13) + (get-point-count (_type_) int) + (nth-point (_type_ int vector) vector) + (distance-to-next-point (_type_ int vector) vector) + (add-point! (_type_ float float float float) none) + (debug-draw (_type_) symbol) ) ) ;; definition for method 3 of type vehicle-path -(defmethod inspect vehicle-path ((this vehicle-path)) +(defmethod inspect ((this vehicle-path)) (format #t "[~8x] ~A~%" this 'vehicle-path) (format #t "~Tpoint-array[10] @ #x~X~%" (-> this point-array)) (format #t "~Tpoint-count: ~D~%" (-> this point-count)) @@ -74,19 +68,19 @@ ) ;; definition for method 9 of type vehicle-path -(defmethod get-point-count vehicle-path ((this vehicle-path)) +(defmethod get-point-count ((this vehicle-path)) (-> this point-count) ) ;; definition for method 10 of type vehicle-path ;; INFO: Used lq/sq -(defmethod nth-point vehicle-path ((this vehicle-path) (arg0 int) (arg1 vector)) +(defmethod nth-point ((this vehicle-path) (arg0 int) (arg1 vector)) (set! (-> arg1 quad) (-> this point-array arg0 quad)) arg1 ) ;; definition for method 11 of type vehicle-path -(defmethod distance-to-next-point vehicle-path ((this vehicle-path) (arg0 int) (arg1 vector)) +(defmethod distance-to-next-point ((this vehicle-path) (arg0 int) (arg1 vector)) (let ((a2-1 (+ arg0 1))) (if (>= a2-1 (-> this point-count)) (set! a2-1 0) @@ -100,7 +94,7 @@ ;; definition for method 12 of type vehicle-path ;; INFO: Return type mismatch int vs none. -(defmethod add-point! vehicle-path ((this vehicle-path) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) +(defmethod add-point! ((this vehicle-path) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (let ((v1-0 (-> this point-count))) (when (< v1-0 10) (set-vector! (-> this point-array v1-0) arg0 arg1 arg2 arg3) @@ -113,7 +107,7 @@ ;; definition for method 13 of type vehicle-path ;; INFO: Used lq/sq -(defmethod debug-draw vehicle-path ((this vehicle-path)) +(defmethod debug-draw ((this vehicle-path)) (local-vars (sv-64 int) (sv-80 (function _varargs_ object))) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -253,41 +247,38 @@ ;; definition of type vehicle-controller (deftype vehicle-controller (structure) - ((path vehicle-path :offset-assert 0) - (turning-radius-table (pointer float) :offset-assert 4) - (throttle-control-table (pointer float) :offset-assert 8) - (table-step float :offset-assert 12) - (table-length int32 :offset-assert 16) - (circle-radius float :offset-assert 20) - (throttle float :offset-assert 24) - (steering float :offset-assert 28) - (path-dest-index int8 :offset-assert 32) - (left-circle int8 :offset-assert 33) - (path-dest-point vector :inline :offset-assert 48) - (path-dest-velocity vector :inline :offset-assert 64) - (dest-circle vector :inline :offset-assert 80) - (target-point vector :inline :offset-assert 96) - (sample-dir vector :inline :offset-assert 112) - (sample-time time-frame :offset-assert 128) - (sample-index int32 :offset-assert 136) + ((path vehicle-path) + (turning-radius-table (pointer float)) + (throttle-control-table (pointer float)) + (table-step float) + (table-length int32) + (circle-radius float) + (throttle float) + (steering float) + (path-dest-index int8) + (left-circle int8) + (path-dest-point vector :inline) + (path-dest-velocity vector :inline) + (dest-circle vector :inline) + (target-point vector :inline) + (sample-dir vector :inline) + (sample-time time-frame) + (sample-index int32) ) - :method-count-assert 17 - :size-assert #x8c - :flag-assert #x110000008c (:methods - (init! (_type_ vehicle-path (pointer float) (pointer float) int float) none 9) - (vehicle-controller-method-10 (_type_ vector float int) none 10) - (vehicle-controller-method-11 (_type_) none 11) - (vehicle-controller-method-12 (_type_ int vector) none 12) - (move-to-next-point (_type_ vector) none 13) - (vehicle-controller-method-14 (_type_ vector vector) none 14) - (vehicle-controller-method-15 (_type_ collide-shape-moving) none 15) - (vehicle-controller-method-16 (_type_) none 16) + (init! (_type_ vehicle-path (pointer float) (pointer float) int float) none) + (vehicle-controller-method-10 (_type_ vector float int) none) + (vehicle-controller-method-11 (_type_) none) + (vehicle-controller-method-12 (_type_ int vector) none) + (move-to-next-point (_type_ vector) none) + (vehicle-controller-method-14 (_type_ vector vector) none) + (vehicle-controller-method-15 (_type_ collide-shape-moving) none) + (vehicle-controller-method-16 (_type_) none) ) ) ;; definition for method 3 of type vehicle-controller -(defmethod inspect vehicle-controller ((this vehicle-controller)) +(defmethod inspect ((this vehicle-controller)) (format #t "[~8x] ~A~%" this 'vehicle-controller) (format #t "~Tpath: #~%" (-> this path)) (format #t "~Tturning-radius-table: #x~X~%" (-> this turning-radius-table)) @@ -311,7 +302,7 @@ ;; definition for method 7 of type vehicle-controller ;; INFO: Return type mismatch int vs vehicle-controller. -(defmethod relocate vehicle-controller ((this vehicle-controller) (arg0 int)) +(defmethod relocate ((this vehicle-controller) (arg0 int)) (if (nonzero? (-> this path)) (&+! (-> this path) arg0) ) @@ -321,7 +312,7 @@ ;; definition for method 12 of type vehicle-controller ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod vehicle-controller-method-12 vehicle-controller ((this vehicle-controller) (arg0 int) (arg1 vector)) +(defmethod vehicle-controller-method-12 ((this vehicle-controller) (arg0 int) (arg1 vector)) (when (< arg0 (get-point-count (-> this path))) (set! (-> this path-dest-index) arg0) (nth-point (-> this path) arg0 (-> this path-dest-point)) @@ -358,7 +349,7 @@ ;; definition for method 13 of type vehicle-controller ;; INFO: Return type mismatch int vs none. -(defmethod move-to-next-point vehicle-controller ((this vehicle-controller) (arg0 vector)) +(defmethod move-to-next-point ((this vehicle-controller) (arg0 vector)) (let ((s4-0 (+ (-> this path-dest-index) 1))) (if (>= s4-0 (get-point-count (-> this path))) (set! s4-0 0) @@ -372,7 +363,7 @@ ;; definition for method 14 of type vehicle-controller ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod vehicle-controller-method-14 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 vector)) +(defmethod vehicle-controller-method-14 ((this vehicle-controller) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) @@ -410,7 +401,7 @@ ;; definition for method 15 of type vehicle-controller ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod vehicle-controller-method-15 vehicle-controller ((this vehicle-controller) (arg0 collide-shape-moving)) +(defmethod vehicle-controller-method-15 ((this vehicle-controller) (arg0 collide-shape-moving)) (vehicle-controller-method-14 this (-> arg0 trans) (-> this target-point)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -452,7 +443,7 @@ ;; definition for method 11 of type vehicle-controller ;; INFO: Return type mismatch int vs none. -(defmethod vehicle-controller-method-11 vehicle-controller ((this vehicle-controller)) +(defmethod vehicle-controller-method-11 ((this vehicle-controller)) (format #t "(define *turning-radius-table* (new 'static 'inline-array 'float 0~%") (dotimes (s5-0 (-> this table-length)) (format #t " (meters ~4,,2M)~%" (-> this turning-radius-table s5-0)) @@ -472,7 +463,7 @@ ;; definition for method 10 of type vehicle-controller ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod vehicle-controller-method-10 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 float) (arg2 int)) +(defmethod vehicle-controller-method-10 ((this vehicle-controller) (arg0 vector) (arg1 float) (arg2 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 quad) (-> arg0 quad)) (set! (-> s3-0 y) 0.0) @@ -505,7 +496,7 @@ ;; definition for method 16 of type vehicle-controller ;; INFO: Return type mismatch int vs none. -(defmethod vehicle-controller-method-16 vehicle-controller ((this vehicle-controller)) +(defmethod vehicle-controller-method-16 ((this vehicle-controller)) (debug-draw (-> this path)) (add-debug-sphere #t @@ -526,13 +517,13 @@ ;; definition for method 9 of type vehicle-controller ;; INFO: Return type mismatch int vs none. -(defmethod init! vehicle-controller ((this vehicle-controller) - (arg0 vehicle-path) - (arg1 (pointer float)) - (arg2 (pointer float)) - (arg3 int) - (arg4 float) - ) +(defmethod init! ((this vehicle-controller) + (arg0 vehicle-path) + (arg1 (pointer float)) + (arg2 (pointer float)) + (arg3 int) + (arg4 float) + ) (set! (-> this path) arg0) (set! (-> this turning-radius-table) arg1) (set! (-> this throttle-control-table) arg2) @@ -545,37 +536,33 @@ ;; definition of type fishermans-boat (deftype fishermans-boat (rigid-body-platform) - ((stabilizer-array boat-stabilizer 2 :inline :offset-assert 736) - (engine-thrust-local-pos vector :inline :offset-assert 800) - (ignition symbol :offset-assert 816) - (engine-thrust float :offset-assert 820) - (propeller joint-mod-spinner :offset-assert 824) - (dock-point vector :inline :offset-assert 832) - (dest-dir vector :inline :offset-assert 848) - (dock-point-index int8 :offset-assert 864) - (auto-pilot symbol :offset-assert 868) - (anchored symbol :offset-assert 872) - (waiting-for-player symbol :offset-assert 876) - (player-riding symbol :offset-assert 880) - (boat-path vehicle-path :inline :offset-assert 896) - (cam-tracker handle :offset-assert 1064) - (kill-player symbol :offset 1076) - (engine-sound-id sound-id :offset 1080) - (engine-sound-envelope float :offset 1084) - (debug-draw basic :offset 1088) - (debug-path-record basic :offset 1092) - (debug-path-playback basic :offset 1096) - (measure-parameters basic :offset 1100) - (controller vehicle-controller :inline :offset 1104) - (anim spool-anim :offset 1244) - (old-target-pos transformq :inline :offset 1248) - (evilbro handle :offset 1296) - (evilsis handle :offset 1304) + ((stabilizer-array boat-stabilizer 2 :inline) + (engine-thrust-local-pos vector :inline) + (ignition symbol) + (engine-thrust float) + (propeller joint-mod-spinner) + (dock-point vector :inline) + (dest-dir vector :inline) + (dock-point-index int8) + (auto-pilot symbol) + (anchored symbol) + (waiting-for-player symbol) + (player-riding symbol) + (boat-path vehicle-path :inline) + (cam-tracker handle) + (kill-player symbol :offset 1076) + (engine-sound-id sound-id :offset 1080) + (engine-sound-envelope float :offset 1084) + (debug-draw basic :offset 1088) + (debug-path-record basic :offset 1092) + (debug-path-playback basic :offset 1096) + (measure-parameters basic :offset 1100) + (controller vehicle-controller :inline :offset 1104) + (anim spool-anim :offset 1244) + (old-target-pos transformq :inline :offset 1248) + (evilbro handle :offset 1296) + (evilsis handle :offset 1304) ) - :heap-base #x4b0 - :method-count-assert 35 - :size-assert #x520 - :flag-assert #x2304b00520 (:states fishermans-boat-docked-misty fishermans-boat-docked-village @@ -591,7 +578,7 @@ ) ;; definition for method 3 of type fishermans-boat -(defmethod inspect fishermans-boat ((this fishermans-boat)) +(defmethod inspect ((this fishermans-boat)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) (t9-0 this) ) @@ -647,7 +634,7 @@ ;; definition for method 23 of type fishermans-boat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 fishermans-boat ((this fishermans-boat) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this fishermans-boat) (arg0 float)) (local-vars (sv-128 int) (sv-144 rigid-body-control-point) (sv-160 int) (sv-176 vector)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) @@ -1347,7 +1334,7 @@ ) ;; definition for method 7 of type fishermans-boat -(defmethod relocate fishermans-boat ((this fishermans-boat) (arg0 int)) +(defmethod relocate ((this fishermans-boat) (arg0 int)) (relocate (-> this controller) arg0) (if (nonzero? (-> this propeller)) (&+! (-> this propeller) arg0) @@ -1357,7 +1344,7 @@ ;; definition for method 30 of type fishermans-boat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 fishermans-boat ((this fishermans-boat)) +(defmethod rigid-body-platform-method-30 ((this fishermans-boat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -1393,7 +1380,7 @@ ;; definition for method 31 of type fishermans-boat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 fishermans-boat ((this fishermans-boat)) +(defmethod rigid-body-platform-method-31 ((this fishermans-boat)) (initialize-skeleton this *fishermans-boat-sg* '()) (logclear! (-> this mask) (process-mask actor-pause movie)) (logior! (-> this skel status) (janim-status inited)) @@ -1504,7 +1491,7 @@ ;; definition for method 11 of type fishermans-boat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! fishermans-boat ((this fishermans-boat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fishermans-boat) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (logior! (-> this mask) (process-mask platform)) (rigid-body-platform-method-30 this) diff --git a/test/decompiler/reference/jak1/levels/village1/sage_REF.gc b/test/decompiler/reference/jak1/levels/village1/sage_REF.gc index cd78c5b6e87..c54c7b03dc3 100644 --- a/test/decompiler/reference/jak1/levels/village1/sage_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/sage_REF.gc @@ -3,17 +3,13 @@ ;; definition of type sage (deftype sage (process-taskable) - ((reminder-played basic :offset-assert 380) - (assistant handle :offset-assert 384) + ((reminder-played basic) + (assistant handle) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x188 - :flag-assert #x3501200188 ) ;; definition for method 3 of type sage -(defmethod inspect sage ((this sage)) +(defmethod inspect ((this sage)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -30,7 +26,7 @@ ) ;; definition for method 32 of type sage -(defmethod play-anim! sage ((this sage) (arg0 symbol)) +(defmethod play-anim! ((this sage) (arg0 symbol)) (when (!= *kernel-boot-message* 'play) (close-specific-task! (game-task intro) (task-status need-resolution)) (return (new 'static 'spool-anim @@ -237,7 +233,7 @@ (apply-settings *setting-control*) (close-status! (-> this tasks) (task-status need-reward-speech)) (set! (-> this assistant) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *assistant-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *assistant-sg* #f :to this)) ) (send-event (handle->process (-> this assistant)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this assistant)) 'blend-shape #t) @@ -340,7 +336,7 @@ ) ;; definition for method 45 of type sage -(defmethod process-taskable-method-45 sage ((this sage)) +(defmethod process-taskable-method-45 ((this sage)) (cond ((and (closed? (-> this tasks) (game-task beach-ecorocks) (task-status need-reminder)) (= (get-reminder (-> this tasks) 0) 0) @@ -352,9 +348,7 @@ ) #t ) - ((and (-> this reminder-played) - (< 81920.0 (vector-vector-distance (-> this root-override trans) (camera-pos))) - ) + ((and (-> this reminder-played) (< 81920.0 (vector-vector-distance (-> this root trans) (camera-pos)))) #t ) (else @@ -364,7 +358,7 @@ ) ;; definition for method 31 of type sage -(defmethod get-art-elem sage ((this sage)) +(defmethod get-art-elem ((this sage)) (cond ((and (= (current-task (-> this tasks)) (game-task beach-ecorocks)) (or (= (current-status (-> this tasks)) (task-status need-hint)) @@ -427,7 +421,7 @@ ) ;; definition for method 43 of type sage -(defmethod process-taskable-method-43 sage ((this sage)) +(defmethod process-taskable-method-43 ((this sage)) (let ((s5-0 (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this)) ) (when s5-0 @@ -437,19 +431,19 @@ #f ) ((< 0.8 f0-2) - (play-ambient (-> this ambient) "SAGELP03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP03" #f (-> this root trans)) ) ((< 0.6 f0-2) - (play-ambient (-> this ambient) "SAGELP04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP04" #f (-> this root trans)) ) ((< 0.4 f0-2) - (play-ambient (-> this ambient) "SAGELP05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP05" #f (-> this root trans)) ) ((< 0.2 f0-2) - (play-ambient (-> this ambient) "SAGELP06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP06" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "SAGELP11" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP11" #f (-> this root trans)) ) ) ) @@ -484,9 +478,7 @@ (process-taskable-method-43 self) (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (if (and (-> self reminder-played) - (< 81920.0 (vector-vector-distance (-> self root-override trans) (camera-pos))) - ) + (if (and (-> self reminder-played) (< 81920.0 (vector-vector-distance (-> self root trans) (camera-pos)))) (go-virtual idle) ) (suspend) @@ -535,13 +527,13 @@ ) ;; definition for method 39 of type sage -(defmethod should-display? sage ((this sage)) +(defmethod should-display? ((this sage)) (not (sages-kidnapped?)) ) ;; definition for method 41 of type sage ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision sage ((this sage) (arg0 int) (arg1 vector)) +(defmethod initialize-collision ((this sage) (arg0 int) (arg1 vector)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) @@ -572,14 +564,14 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 11 of type sage -(defmethod init-from-entity! sage ((this sage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sage) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task misty-cannon))) (set! (-> this reminder-played) #f) diff --git a/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc b/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc index 77314659b87..24f81ec74fc 100644 --- a/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc @@ -200,17 +200,13 @@ ;; definition of type sequenceA-village1 (deftype sequenceA-village1 (process-taskable) - ((boat handle :offset-assert 384) - (side handle :offset-assert 392) + ((boat handle) + (side handle) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x190 - :flag-assert #x3501200190 ) ;; definition for method 3 of type sequenceA-village1 -(defmethod inspect sequenceA-village1 ((this sequenceA-village1)) +(defmethod inspect ((this sequenceA-village1)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -221,7 +217,7 @@ ;; definition for method 32 of type sequenceA-village1 ;; INFO: Return type mismatch spool-anim vs basic. -(defmethod play-anim! sequenceA-village1 ((this sequenceA-village1) (arg0 symbol)) +(defmethod play-anim! ((this sequenceA-village1) (arg0 symbol)) (when arg0 (set! (-> *time-of-day-proc* 0 time-ratio) 0.0) (set! (-> *time-of-day-proc* 0 hour) 23) @@ -231,9 +227,7 @@ (send-event *camera* 'change-state cam-fixed 0) (send-event *target* 'sidekick #f) (set! (-> this boat) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *fishermans-boat-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *fishermans-boat-sg* #f :to this)) ) (send-event (handle->process (-> this boat)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this boat)) 'origin-joint-index 3) @@ -268,7 +262,7 @@ ) ;; definition for method 31 of type sequenceA-village1 -(defmethod get-art-elem sequenceA-village1 ((this sequenceA-village1)) +(defmethod get-art-elem ((this sequenceA-village1)) (-> this draw art-group data 3) ) @@ -284,7 +278,7 @@ (when gp-1 (format 0 "found entity for sidekick-human~%") (set! (-> self side) - (ppointer->handle (manipy-spawn (-> self root-override trans) gp-1 *sidekick-human-sg* #f :to self)) + (ppointer->handle (manipy-spawn (-> self root trans) gp-1 *sidekick-human-sg* #f :to self)) ) (send-event (handle->process (-> self side)) 'anim-mode 'clone-anim) (send-event (handle->process (-> self side)) 'center-joint 3) @@ -327,7 +321,7 @@ ) ;; definition for method 39 of type sequenceA-village1 -(defmethod should-display? sequenceA-village1 ((this sequenceA-village1)) +(defmethod should-display? ((this sequenceA-village1)) #f ) diff --git a/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc b/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc index 9f81e2e8b1d..370978cd363 100644 --- a/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc @@ -190,24 +190,20 @@ ;; definition of type windmill-sail (deftype windmill-sail (process-drawable) - ((root-override trsq :offset 112) - (sync sync-info :inline :offset-assert 176) - (blade-normal vector :inline :offset-assert 192) - (orig-quat quaternion :inline :offset-assert 208) - (alt-actor entity-actor :offset-assert 224) - (part2 sparticle-launch-control :offset-assert 228) + ((root-override trsq :overlay-at root) + (sync sync-info :inline) + (blade-normal vector :inline) + (orig-quat quaternion :inline) + (alt-actor entity-actor) + (part2 sparticle-launch-control) ) - :heap-base #x80 - :method-count-assert 20 - :size-assert #xe8 - :flag-assert #x14008000e8 (:states windmill-sail-idle ) ) ;; definition for method 3 of type windmill-sail -(defmethod inspect windmill-sail ((this windmill-sail)) +(defmethod inspect ((this windmill-sail)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -221,7 +217,7 @@ ;; definition for method 7 of type windmill-sail ;; INFO: Return type mismatch process-drawable vs windmill-sail. -(defmethod relocate windmill-sail ((this windmill-sail) (arg0 int)) +(defmethod relocate ((this windmill-sail) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -229,7 +225,7 @@ ) ;; definition for method 10 of type windmill-sail -(defmethod deactivate windmill-sail ((this windmill-sail)) +(defmethod deactivate ((this windmill-sail)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -323,7 +319,7 @@ ;; definition for method 11 of type windmill-sail ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! windmill-sail ((this windmill-sail) (arg0 entity-actor)) +(defmethod init-from-entity! ((this windmill-sail) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (load-params! (-> this sync) this (the-as uint 4800) 0.0 0.15 0.15) (set! (-> this root-override) (new 'process 'trsq)) @@ -342,22 +338,18 @@ ;; definition of type sagesail (deftype sagesail (process-drawable) - ((root-override trsq :offset 112) - (sync sync-info :inline :offset-assert 176) - (blade-normal vector :inline :offset-assert 192) - (orig-quat quaternion :inline :offset-assert 208) + ((root-override trsq :overlay-at root) + (sync sync-info :inline) + (blade-normal vector :inline) + (orig-quat quaternion :inline) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xe0 - :flag-assert #x14007000e0 (:states sagesail-idle ) ) ;; definition for method 3 of type sagesail -(defmethod inspect sagesail ((this sagesail)) +(defmethod inspect ((this sagesail)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -395,7 +387,7 @@ ;; definition for method 11 of type sagesail ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! sagesail ((this sagesail) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sagesail) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (set! (-> this root-override) (new 'process 'trsq)) @@ -411,22 +403,18 @@ ;; definition of type windspinner (deftype windspinner (process-drawable) - ((blade-normal vector :inline :offset-assert 176) - (orig-quat quaternion :inline :offset-assert 192) - (angle float :offset-assert 208) - (angle-vel float :offset-assert 212) + ((blade-normal vector :inline) + (orig-quat quaternion :inline) + (angle float) + (angle-vel float) ) - :heap-base #x70 - :method-count-assert 20 - :size-assert #xd8 - :flag-assert #x14007000d8 (:states windspinner-idle ) ) ;; definition for method 3 of type windspinner -(defmethod inspect windspinner ((this windspinner)) +(defmethod inspect ((this windspinner)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -438,7 +426,7 @@ ) ;; definition for method 12 of type windspinner -(defmethod run-logic? windspinner ((this windspinner)) +(defmethod run-logic? ((this windspinner)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status was-drawn)) @@ -501,7 +489,7 @@ ;; definition for method 11 of type windspinner ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! windspinner ((this windspinner) (arg0 entity-actor)) +(defmethod init-from-entity! ((this windspinner) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (set! (-> this angle) 0.0) (set! (-> this angle-vel) 145.63556) @@ -518,19 +506,15 @@ ;; definition of type mayorgears (deftype mayorgears (process-drawable) - ((alt-actor entity-actor :offset-assert 176) + ((alt-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb4 - :flag-assert #x14005000b4 (:states mayorgears-idle ) ) ;; definition for method 3 of type mayorgears -(defmethod inspect mayorgears ((this mayorgears)) +(defmethod inspect ((this mayorgears)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -560,7 +544,7 @@ ;; definition for method 11 of type mayorgears ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! mayorgears ((this mayorgears) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mayorgears) (arg0 entity-actor)) (logior! (-> this mask) (process-mask ambient)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -572,20 +556,16 @@ ;; definition of type reflector-middle (deftype reflector-middle (process-drawable) - ((reflector-trans vector :inline :offset-assert 176) - (next-reflector-trans vector :inline :offset-assert 192) + ((reflector-trans vector :inline) + (next-reflector-trans vector :inline) ) - :heap-base #x60 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14006000d0 (:states reflector-middle-idle ) ) ;; definition for method 3 of type reflector-middle -(defmethod inspect reflector-middle ((this reflector-middle)) +(defmethod inspect ((this reflector-middle)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -615,7 +595,7 @@ ;; definition for method 11 of type reflector-middle ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! reflector-middle ((this reflector-middle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this reflector-middle) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *reflector-middle-sg* '()) @@ -637,17 +617,13 @@ ;; definition of type reflector-end (deftype reflector-end (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states reflector-end-idle ) ) ;; definition for method 3 of type reflector-end -(defmethod inspect reflector-end ((this reflector-end)) +(defmethod inspect ((this reflector-end)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -661,7 +637,7 @@ ;; definition for method 11 of type reflector-end ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! reflector-end ((this reflector-end) (arg0 entity-actor)) +(defmethod init-from-entity! ((this reflector-end) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (go reflector-end-idle) @@ -670,19 +646,15 @@ ;; definition of type villa-starfish (deftype villa-starfish (process-drawable) - ((child-count int8 :offset-assert 176) + ((child-count int8) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb1 - :flag-assert #x14005000b1 (:states villa-starfish-idle ) ) ;; definition for method 3 of type villa-starfish -(defmethod inspect villa-starfish ((this villa-starfish)) +(defmethod inspect ((this villa-starfish)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -699,10 +671,6 @@ ;; definition of type starfish (deftype starfish (nav-enemy) () - :heap-base #x120 - :method-count-assert 76 - :size-assert #x190 - :flag-assert #x4c01200190 (:states starfish-idle starfish-patrol @@ -710,7 +678,7 @@ ) ;; definition for method 3 of type starfish -(defmethod inspect starfish ((this starfish)) +(defmethod inspect ((this starfish)) (let ((t9-0 (method-of-type nav-enemy inspect))) (t9-0 this) ) @@ -825,7 +793,7 @@ ;; definition for method 47 of type starfish ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision starfish ((this starfish)) +(defmethod initialize-collision ((this starfish)) (logior! (-> this mask) (process-mask enemy)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -848,7 +816,7 @@ ;; definition for method 48 of type starfish ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 starfish ((this starfish)) +(defmethod nav-enemy-method-48 ((this starfish)) (initialize-skeleton this *starfish-sg* '()) (init-defaults! this *starfish-nav-enemy-info*) 0 @@ -916,7 +884,7 @@ ;; definition for method 11 of type villa-starfish ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! villa-starfish ((this villa-starfish) (arg0 entity-actor)) +(defmethod init-from-entity! ((this villa-starfish) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (let ((a1-4 (res-lump-value arg0 'num-lurkers uint128 :default (the-as uint128 3)))) @@ -929,19 +897,15 @@ ;; definition of type village-fish (deftype village-fish (process-drawable) - ((child-count int8 :offset-assert 176) + ((child-count int8) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb1 - :flag-assert #x14005000b1 (:states village-fish-idle ) ) ;; definition for method 3 of type village-fish -(defmethod inspect village-fish ((this village-fish)) +(defmethod inspect ((this village-fish)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -962,7 +926,7 @@ ;; definition for method 11 of type village-fish ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! village-fish ((this village-fish) (arg0 entity-actor)) +(defmethod init-from-entity! ((this village-fish) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (go village-fish-idle) @@ -972,14 +936,10 @@ ;; definition of type villa-fisha (deftype villa-fisha (village-fish) () - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb1 - :flag-assert #x14005000b1 ) ;; definition for method 3 of type villa-fisha -(defmethod inspect villa-fisha ((this villa-fisha)) +(defmethod inspect ((this villa-fisha)) (let ((t9-0 (method-of-type village-fish inspect))) (t9-0 this) ) @@ -989,14 +949,10 @@ ;; definition of type villa-fishb (deftype villa-fishb (village-fish) () - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb1 - :flag-assert #x14005000b1 ) ;; definition for method 3 of type villa-fishb -(defmethod inspect villa-fishb ((this villa-fishb)) +(defmethod inspect ((this villa-fishb)) (let ((t9-0 (method-of-type village-fish inspect))) (t9-0 this) ) @@ -1005,17 +961,14 @@ ;; definition of type cyclegen (deftype cyclegen (structure) - ((output float :offset-assert 0) - (inc float :offset-assert 4) + ((output float) + (inc float) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type cyclegen -(defmethod inspect cyclegen ((this cyclegen)) +(defmethod inspect ((this cyclegen)) (format #t "[~8x] ~A~%" this 'cyclegen) (format #t "~Toutput: ~f~%" (-> this output)) (format #t "~Tinc: ~f~%" (-> this inc)) @@ -1037,20 +990,16 @@ ;; definition of type hutlamp (deftype hutlamp (process-drawable) - ((pivot joint-mod-set-local :offset-assert 176) - (clock cyclegen :inline :offset-assert 180) + ((pivot joint-mod-set-local) + (clock cyclegen :inline) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xbc - :flag-assert #x14005000bc (:states hutlamp-idle ) ) ;; definition for method 3 of type hutlamp -(defmethod inspect hutlamp ((this hutlamp)) +(defmethod inspect ((this hutlamp)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1060,7 +1009,7 @@ ) ;; definition for method 7 of type hutlamp -(defmethod relocate hutlamp ((this hutlamp) (arg0 int)) +(defmethod relocate ((this hutlamp) (arg0 int)) (if (nonzero? (-> this pivot)) (&+! (-> this pivot) arg0) ) @@ -1089,7 +1038,7 @@ ;; definition for method 11 of type hutlamp ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! hutlamp ((this hutlamp) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hutlamp) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *hutlamp-sg* '()) @@ -1103,17 +1052,13 @@ ;; definition of type revcycleprop (deftype revcycleprop (process-drawable) () - :heap-base #x40 - :method-count-assert 21 - :size-assert #xb0 - :flag-assert #x15004000b0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type revcycleprop -(defmethod inspect revcycleprop ((this revcycleprop)) +(defmethod inspect ((this revcycleprop)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1135,7 +1080,7 @@ ;; definition for method 11 of type revcycleprop ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! revcycleprop ((this revcycleprop) (arg0 entity-actor)) +(defmethod init-from-entity! ((this revcycleprop) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *revcycleprop-sg* '()) @@ -1147,17 +1092,13 @@ ;; definition of type revcycle (deftype revcycle (process-drawable) () - :heap-base #x40 - :method-count-assert 21 - :size-assert #xb0 - :flag-assert #x15004000b0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type revcycle -(defmethod inspect revcycle ((this revcycle)) +(defmethod inspect ((this revcycle)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1179,7 +1120,7 @@ ;; definition for method 11 of type revcycle ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! revcycle ((this revcycle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this revcycle) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *revcycle-sg* '()) @@ -1191,14 +1132,10 @@ ;; definition of type villagea-water (deftype villagea-water (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) ;; definition for method 3 of type villagea-water -(defmethod inspect villagea-water ((this villagea-water)) +(defmethod inspect ((this villagea-water)) (let ((t9-0 (method-of-type water-anim inspect))) (t9-0 this) ) @@ -1221,7 +1158,7 @@ ;; definition for method 22 of type villagea-water ;; INFO: Return type mismatch ripple-wave-set vs none. -(defmethod water-vol-method-22 villagea-water ((this villagea-water)) +(defmethod water-vol-method-22 ((this villagea-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/village1/village1-part_REF.gc b/test/decompiler/reference/jak1/levels/village1/village1-part_REF.gc index 1f0c7516249..ef90f984802 100644 --- a/test/decompiler/reference/jak1/levels/village1/village1-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/village1-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type villagea-part (deftype villagea-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type villagea-part -(defmethod inspect villagea-part ((this villagea-part)) +(defmethod inspect ((this villagea-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/village1/yakow_REF.gc b/test/decompiler/reference/jak1/levels/village1/yakow_REF.gc index 2f0bc795421..f05465ab53f 100644 --- a/test/decompiler/reference/jak1/levels/village1/yakow_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/yakow_REF.gc @@ -22,39 +22,36 @@ ;; definition of type yakow-bank (deftype yakow-bank (basic) - ((walk-cycle-frame-count float :offset-assert 4) - (run-cycle-frame-count float :offset-assert 8) - (walk-speed meters :offset-assert 12) - (run-speed meters :offset-assert 16) - (walk-anim-speed float :offset-assert 20) - (run-anim-speed float :offset-assert 24) - (walk-away-dist meters :offset-assert 28) - (run-away-dist meters :offset-assert 32) - (walk-rotate-speed float :offset-assert 36) - (run-rotate-speed float :offset-assert 40) - (walk-turn-time time-frame :offset-assert 48) - (run-turn-time time-frame :offset-assert 56) - (max-walk-speed float :offset-assert 64) - (min-run-speed float :offset-assert 68) - (walk-run-blend-rate float :offset-assert 72) - (walk-turn-blend-rate float :offset-assert 76) - (max-run-speed float :offset-assert 80) - (acceleration meters :offset-assert 84) - (default-patrol-time time-frame :offset-assert 88) - (default-idle-distance meters :offset-assert 96) - (safe-distance meters :offset-assert 100) - (min-run-anim-speed float :offset-assert 104) - (max-run-anim-speed float :offset-assert 108) - (min-walk-anim-speed float :offset-assert 112) - (speed-boost-impulse meters :offset-assert 116) + ((walk-cycle-frame-count float) + (run-cycle-frame-count float) + (walk-speed meters) + (run-speed meters) + (walk-anim-speed float) + (run-anim-speed float) + (walk-away-dist meters) + (run-away-dist meters) + (walk-rotate-speed float) + (run-rotate-speed float) + (walk-turn-time time-frame) + (run-turn-time time-frame) + (max-walk-speed float) + (min-run-speed float) + (walk-run-blend-rate float) + (walk-turn-blend-rate float) + (max-run-speed float) + (acceleration meters) + (default-patrol-time time-frame) + (default-idle-distance meters) + (safe-distance meters) + (min-run-anim-speed float) + (max-run-anim-speed float) + (min-walk-anim-speed float) + (speed-boost-impulse meters) ) - :method-count-assert 9 - :size-assert #x78 - :flag-assert #x900000078 ) ;; definition for method 3 of type yakow-bank -(defmethod inspect yakow-bank ((this yakow-bank)) +(defmethod inspect ((this yakow-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Twalk-cycle-frame-count: ~f~%" (-> this walk-cycle-frame-count)) (format #t "~Trun-cycle-frame-count: ~f~%" (-> this run-cycle-frame-count)) @@ -116,30 +113,26 @@ ;; definition of type yakow (deftype yakow (process-drawable) - ((root-override collide-shape-moving :offset 112) - (fact-override fact-info-enemy :offset 144) - (player-attack-id int32 :offset-assert 176) - (walk-run-blend float :offset-assert 180) - (walk-turn-blend float :offset-assert 184) - (run-mode basic :offset-assert 188) - (travel-speed meters :offset-assert 192) - (final-speed meters :offset-assert 196) - (rotate-speed float :offset-assert 200) - (turn-time time-frame :offset-assert 208) - (vulnerable basic :offset-assert 216) - (grazing basic :offset-assert 220) - (push-velocity vector :inline :offset-assert 224) - (home-base vector :inline :offset-assert 240) - (dest-base vector :inline :offset-assert 256) - (dest-rot degrees :offset-assert 272) - (enable-turn-around basic :offset-assert 276) - (rotating basic :offset-assert 280) - (in-pen basic :offset-assert 284) + ((root collide-shape-moving :override) + (fact fact-info-enemy :override) + (player-attack-id int32) + (walk-run-blend float) + (walk-turn-blend float) + (run-mode basic) + (travel-speed meters) + (final-speed meters) + (rotate-speed float) + (turn-time time-frame) + (vulnerable basic) + (grazing basic) + (push-velocity vector :inline) + (home-base vector :inline) + (dest-base vector :inline) + (dest-rot degrees) + (enable-turn-around basic) + (rotating basic) + (in-pen basic) ) - :heap-base #xb0 - :method-count-assert 20 - :size-assert #x120 - :flag-assert #x1400b00120 (:states yakow-die yakow-graze @@ -153,7 +146,7 @@ ) ;; definition for method 3 of type yakow -(defmethod inspect yakow ((this yakow)) +(defmethod inspect ((this yakow)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -195,16 +188,9 @@ ) ) ) - (when (and v1-2 (< 8192.0 (- (-> v1-2 root trans y) (-> self root-override trans y)))) - (do-push-aways! (-> self root-override)) - (send-shove-back - (-> self root-override) - arg0 - (the-as touching-shapes-entry (-> arg3 param 0)) - 0.7 - 6144.0 - 16384.0 - ) + (when (and v1-2 (< 8192.0 (- (-> v1-2 root trans y) (-> self root trans y)))) + (do-push-aways! (-> self root)) + (send-shove-back (-> self root) arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 0.7 6144.0 16384.0) ) ) ) @@ -273,7 +259,7 @@ yakow-default-event-handler (defbehavior yakow-common-post yakow () (update-direction-from-time-of-day (-> self draw shadow-ctrl)) (if *target* - (look-at-enemy! (-> *target* neck) (the-as vector (-> self root-override root-prim prim-core)) #f self) + (look-at-enemy! (-> *target* neck) (the-as vector (-> self root root-prim prim-core)) #f self) ) (ja-post) (none) @@ -283,7 +269,7 @@ yakow-default-event-handler ;; INFO: Return type mismatch symbol vs none. (defbehavior yakow-simple-post yakow () (yakow-common-post) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (none) ) @@ -297,14 +283,9 @@ yakow-default-event-handler (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (vector-z-quaternion! s5-0 (-> self root-override quat)) - (seek-toward-heading-vec! - (-> self root-override) - (-> self nav travel) - (-> self rotate-speed) - (-> self turn-time) - ) - (vector-z-quaternion! gp-0 (-> self root-override quat)) + (vector-z-quaternion! s5-0 (-> self root quat)) + (seek-toward-heading-vec! (-> self root) (-> self nav travel) (-> self rotate-speed) (-> self turn-time)) + (vector-z-quaternion! gp-0 (-> self root quat)) (set! (-> self rotating) (< (vector-dot gp-0 s5-0) (cos (* 8192.0 (seconds-per-frame))))) (when (-> self rotating) (let ((v1-16 (new 'stack-no-clear 'vector))) @@ -320,18 +301,15 @@ yakow-default-event-handler (fmin (-> self travel-speed) (* (vector-length (-> self nav travel)) (-> *display* frames-per-second))) ) (let ((v1-24 (vector-normalize-copy! (new-stack-vector0) (-> self nav travel) (-> self final-speed)))) - (set! (-> self root-override transv x) (-> v1-24 x)) - (set! (-> self root-override transv z) (-> v1-24 z)) - ) - (vector-v++! - (-> self root-override transv) - (compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0) + (set! (-> self root transv x) (-> v1-24 x)) + (set! (-> self root transv z) (-> v1-24 z)) ) + (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) (let ((gp-2 (new 'stack-no-clear 'vector))) - (set! (-> gp-2 quad) (-> self root-override trans quad)) + (set! (-> gp-2 quad) (-> self root trans quad)) (integrate-for-enemy-with-move-to-ground! - (-> self root-override) - (-> self root-override transv) + (-> self root) + (-> self root transv) (collide-kind background) 8192.0 #t @@ -339,7 +317,7 @@ yakow-default-event-handler #f ) (set! (-> self final-speed) - (* (vector-vector-xz-distance gp-2 (-> self root-override trans)) (-> *display* frames-per-second)) + (* (vector-vector-xz-distance gp-2 (-> self root trans)) (-> *display* frames-per-second)) ) ) (set! (-> self travel-speed) (fmin (-> self travel-speed) (-> self final-speed))) @@ -358,8 +336,8 @@ yakow-default-event-handler ;; definition for function yakow-generate-travel-vector ;; INFO: Used lq/sq (defbehavior yakow-generate-travel-vector yakow () - (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root-override trans) (target-pos 0))) - (s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override quat))) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (target-pos 0))) + (s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) 0.0 0.0 @@ -381,7 +359,7 @@ yakow-default-event-handler (vector-length (-> self nav travel)) ) ) - (vector+! (-> self nav target-pos) (-> self root-override trans) (-> self nav travel)) + (vector+! (-> self nav target-pos) (-> self root trans) (-> self nav travel)) ) ;; definition for function yakow-run-post @@ -467,7 +445,7 @@ yakow-default-event-handler ;; definition for function yakow-facing-direction? ;; INFO: Used lq/sq (defbehavior yakow-facing-direction? yakow ((arg0 vector) (arg1 float)) - (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override quat))) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s5-0 quad) (-> arg0 quad)) @@ -479,7 +457,7 @@ yakow-default-event-handler ;; definition for function yakow-facing-point? (defbehavior yakow-facing-point? yakow ((arg0 vector) (arg1 float)) - (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> self root-override trans)))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> self root trans)))) (yakow-facing-direction? v1-1 arg1) ) ) @@ -498,9 +476,8 @@ yakow-default-event-handler ) :trans (behavior () (if (and (time-elapsed? (-> self state-time) (-> *YAKOW-bank* default-patrol-time)) - (and *target* (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (and *target* + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (not (yakow-facing-player? 21845.334)) ) @@ -566,9 +543,7 @@ yakow-default-event-handler (if (and (time-elapsed? (-> self state-time) (-> *YAKOW-bank* default-patrol-time)) (not (-> self in-pen)) (and *target* - (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (>= (-> self fact idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (not (yakow-facing-player? 21845.334)) ) @@ -576,7 +551,7 @@ yakow-default-event-handler ) (when (time-elapsed? (-> self state-time) (seconds 0.05)) (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) - (< (vector-vector-xz-distance (-> self root-override trans) (-> self nav destination-pos)) 4096.0) + (< (vector-vector-xz-distance (-> self root trans) (-> self nav destination-pos)) 4096.0) ) (if (-> self in-pen) (go yakow-graze) @@ -595,7 +570,7 @@ yakow-default-event-handler (nav-control-method-19 (-> self nav) (-> self nav target-pos) - (-> self root-override) + (-> self root) (-> self nav destination-pos) 131072.0 ) @@ -623,11 +598,11 @@ yakow-default-event-handler ) ) :code (behavior () - (while (< 546.13336 (fabs (deg-diff (-> self dest-rot) (y-angle (-> self root-override))))) + (while (< 546.13336 (fabs (deg-diff (-> self dest-rot) (y-angle (-> self root))))) (if (not (ja-group? yakow-walk-ja)) (ja-channel-push! 1 (seconds 0.075)) ) - (seek-toward-yaw-angle! (-> self root-override) (-> self dest-rot) 16384.0 (seconds 0.5)) + (seek-toward-yaw-angle! (-> self root) (-> self dest-rot) 16384.0 (seconds 0.5)) (ja :group! yakow-walk-ja :num! (loop!)) (suspend) ) @@ -676,9 +651,8 @@ yakow-default-event-handler (set! (-> self turn-time) (-> *YAKOW-bank* run-turn-time)) ) :trans (behavior () - (when (or (not *target*) (< (-> *YAKOW-bank* safe-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (when (or (not *target*) + (< (-> *YAKOW-bank* safe-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) (if (-> self in-pen) (go yakow-walk-to (-> self dest-base)) @@ -689,7 +663,7 @@ yakow-default-event-handler 0.5 1.0 ) - (vector-vector-distance (-> self root-override trans) (target-pos 0)) + (vector-vector-distance (-> self root trans) (target-pos 0)) ) ) (f30-2 (lerp-scale @@ -785,12 +759,12 @@ yakow-default-event-handler (defstate yakow-die (yakow) :event #f :code (behavior () - (let ((v1-1 (-> self root-override root-prim))) + (let ((v1-1 (-> self root root-prim))) (set! (-> v1-1 collide-with) (collide-kind)) (set! (-> v1-1 prim-core collide-as) (collide-kind)) ) 0 - (drop-pickup (-> self fact-override) #t *entity-pool* (-> self fact-override) 0) + (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0) (process-entity-status! self (entity-perm-status dead) #t) ) ) @@ -798,7 +772,7 @@ yakow-default-event-handler ;; definition for method 11 of type yakow ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! yakow ((this yakow) (arg0 entity-actor)) +(defmethod init-from-entity! ((this yakow) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -816,17 +790,17 @@ yakow-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (set! (-> this align) (new 'process 'align-control this)) - (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (set! (-> this nav) (new 'process 'nav-control (-> this root) 16 40960.0)) (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) (set! (-> this nav nearest-y-threshold) 409600.0) - (set! (-> this fact-override) + (set! (-> this fact) (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> this fact-override idle-distance) (-> *YAKOW-bank* default-idle-distance)) + (set! (-> this fact idle-distance) (-> *YAKOW-bank* default-idle-distance)) (initialize-skeleton this *yakow-sg* '()) (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control -4096.0 4096.0 614400.0 (the-as float 24) 245760.0) @@ -836,7 +810,7 @@ yakow-default-event-handler (set! (-> this water flags) (water-flags wt01)) (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) (set! (-> this water ripple-size) 12288.0) - (set! (-> this home-base quad) (-> this root-override trans quad)) + (set! (-> this home-base quad) (-> this root trans quad)) (let ((v1-40 (res-lump-struct (-> this entity) 'alt-vector vector))) (when v1-40 (set! (-> this dest-base quad) (-> v1-40 quad)) @@ -852,8 +826,8 @@ yakow-default-event-handler ) (cond ((-> this in-pen) - (set! (-> this root-override trans quad) (-> this dest-base quad)) - (set-yaw-angle-clear-roll-pitch! (-> this root-override) (-> this dest-rot)) + (set! (-> this root trans quad) (-> this dest-base quad)) + (set-yaw-angle-clear-roll-pitch! (-> this root) (-> this dest-rot)) (go yakow-graze) ) (else diff --git a/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc b/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc index 9cae6e289c5..deecf47d61e 100644 --- a/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc @@ -3,20 +3,16 @@ ;; definition of type assistant-levitator (deftype assistant-levitator (process-taskable) - ((boulder entity-actor :offset-assert 380) - (particle sparticle-launch-control 4 :offset-assert 384) + ((boulder entity-actor) + (particle sparticle-launch-control 4) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x190 - :flag-assert #x3501200190 (:states just-particles ) ) ;; definition for method 3 of type assistant-levitator -(defmethod inspect assistant-levitator ((this assistant-levitator)) +(defmethod inspect ((this assistant-levitator)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -27,7 +23,7 @@ ;; definition for method 7 of type assistant-levitator ;; INFO: Return type mismatch process-taskable vs assistant-levitator. -(defmethod relocate assistant-levitator ((this assistant-levitator) (arg0 int)) +(defmethod relocate ((this assistant-levitator) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this particle v1-0)) (&+! (-> this particle v1-0) arg0) @@ -37,7 +33,7 @@ ) ;; definition for method 10 of type assistant-levitator -(defmethod deactivate assistant-levitator ((this assistant-levitator)) +(defmethod deactivate ((this assistant-levitator)) (dotimes (s5-0 4) (let ((a0-1 (-> this particle s5-0))) (if (nonzero? a0-1) @@ -67,10 +63,10 @@ ;; definition for method 52 of type assistant-levitator ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 assistant-levitator ((this assistant-levitator)) +(defmethod process-taskable-method-52 ((this assistant-levitator)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -409.6 f0-0))) ) @@ -88,7 +84,7 @@ ;; definition for method 48 of type assistant-levitator ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow assistant-levitator ((this assistant-levitator)) +(defmethod draw-npc-shadow ((this assistant-levitator)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -112,7 +108,7 @@ ) ;; definition for method 32 of type assistant-bluehut -(defmethod play-anim! assistant-bluehut ((this assistant-bluehut) (arg0 symbol)) +(defmethod play-anim! ((this assistant-bluehut) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk-to-assistant)) (case (current-status (-> this tasks)) (((task-status unknown) (task-status need-hint) (task-status need-introduction)) @@ -294,7 +290,7 @@ ) (close-status! (-> this tasks) (task-status need-introduction)) (set! (-> this jaws) - (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *jaws-sg* #f :to this)) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *jaws-sg* #f :to this)) ) (let ((v1-42 (handle->process (-> this jaws)))) (if v1-42 @@ -408,12 +404,12 @@ ) ;; definition for method 31 of type assistant-bluehut -(defmethod get-art-elem assistant-bluehut ((this assistant-bluehut)) +(defmethod get-art-elem ((this assistant-bluehut)) (-> this draw art-group data 10) ) ;; definition for method 44 of type assistant-bluehut -(defmethod play-reminder assistant-bluehut ((this assistant-bluehut)) +(defmethod play-reminder ((this assistant-bluehut)) (cond ((and (-> this will-talk) *target*) (let* ((f30-1 (+ -1552384.0 (-> (target-pos 0) x))) @@ -429,7 +425,7 @@ ) ;; definition for method 47 of type assistant-bluehut -(defmethod target-above-threshold? assistant-bluehut ((this assistant-bluehut)) +(defmethod target-above-threshold? ((this assistant-bluehut)) (when (not (play-reminder this)) (set! (-> this im-talking) #f) (return #f) @@ -480,7 +476,7 @@ ) ;; definition for method 43 of type assistant-bluehut -(defmethod process-taskable-method-43 assistant-bluehut ((this assistant-bluehut)) +(defmethod process-taskable-method-43 ((this assistant-bluehut)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f30-0 (rand-float-gen))) (cond @@ -488,10 +484,10 @@ #f ) ((< 0.5 f30-0) - (play-ambient (-> this ambient) "ASSTLP23" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP23" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "ASSTLP24" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP24" #f (-> this root trans)) ) ) ) @@ -620,7 +616,7 @@ ) ;; definition for method 39 of type assistant-bluehut -(defmethod should-display? assistant-bluehut ((this assistant-bluehut)) +(defmethod should-display? ((this assistant-bluehut)) (cond ((not (closed? (-> this tasks) (game-task village2-levitator) (task-status unknown))) (process-taskable-method-33 this) @@ -722,7 +718,7 @@ ) ;; definition for method 11 of type assistant-bluehut -(defmethod init-from-entity! assistant-bluehut ((this assistant-bluehut) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant-bluehut) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 288) this)) (set! (-> this tasks) (get-task-control (game-task village2-levitator))) @@ -1275,7 +1271,7 @@ ) ;; definition for method 32 of type assistant-levitator -(defmethod play-anim! assistant-levitator ((this assistant-levitator) (arg0 symbol)) +(defmethod play-anim! ((this assistant-levitator) (arg0 symbol)) (with-pp (case (current-status (-> this tasks)) (((task-status need-reward-speech)) @@ -1329,7 +1325,7 @@ ) ;; definition for method 31 of type assistant-levitator -(defmethod get-art-elem assistant-levitator ((this assistant-levitator)) +(defmethod get-art-elem ((this assistant-levitator)) (if (= (get-task-status (game-task village2-levitator)) (task-status invalid)) (-> this draw art-group data 9) (-> this draw art-group data 5) @@ -1372,7 +1368,7 @@ :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) (when (and (cond - ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + ((and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) #t ) (else @@ -1424,7 +1420,7 @@ ) ;; definition for method 47 of type assistant-levitator -(defmethod target-above-threshold? assistant-levitator ((this assistant-levitator)) +(defmethod target-above-threshold? ((this assistant-levitator)) (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) ) @@ -1498,7 +1494,7 @@ ) ;; definition for method 39 of type assistant-levitator -(defmethod should-display? assistant-levitator ((this assistant-levitator)) +(defmethod should-display? ((this assistant-levitator)) (or (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) (zero? (get-task-status (game-task village2-levitator))) ) @@ -1519,7 +1515,7 @@ ;; definition for method 11 of type assistant-levitator ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! assistant-levitator ((this assistant-levitator) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant-levitator) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task village2-levitator))) (set! (-> this boulder) (entity-actor-lookup arg0 'alt-actor 0)) @@ -1528,7 +1524,7 @@ (set! (-> this particle 2) (create-launch-control (-> *part-group-id-table* 660) this)) (set! (-> this particle 3) (create-launch-control (-> *part-group-id-table* 661) this)) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "lev-mach-idle" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "lev-mach-idle" :fo-max 30) (-> this root trans)) ) (if (= (get-task-status (game-task village2-levitator)) (task-status invalid)) (go just-particles) diff --git a/test/decompiler/reference/jak1/levels/village2/flutflut-bluehut_REF.gc b/test/decompiler/reference/jak1/levels/village2/flutflut-bluehut_REF.gc index 5777f128a5f..1beb92d1339 100644 --- a/test/decompiler/reference/jak1/levels/village2/flutflut-bluehut_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/flutflut-bluehut_REF.gc @@ -4,14 +4,10 @@ ;; definition of type flutflut-bluehut (deftype flutflut-bluehut (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type flutflut-bluehut -(defmethod inspect flutflut-bluehut ((this flutflut-bluehut)) +(defmethod inspect ((this flutflut-bluehut)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -26,7 +22,7 @@ ;; definition for method 32 of type flutflut-bluehut ;; INFO: Return type mismatch art-element vs basic. -(defmethod play-anim! flutflut-bluehut ((this flutflut-bluehut) (arg0 symbol)) +(defmethod play-anim! ((this flutflut-bluehut) (arg0 symbol)) (current-status (-> this tasks)) (if arg0 (format @@ -40,12 +36,12 @@ ) ;; definition for method 31 of type flutflut-bluehut -(defmethod get-art-elem flutflut-bluehut ((this flutflut-bluehut)) +(defmethod get-art-elem ((this flutflut-bluehut)) (-> this draw art-group data 2) ) ;; definition for method 39 of type flutflut-bluehut -(defmethod should-display? flutflut-bluehut ((this flutflut-bluehut)) +(defmethod should-display? ((this flutflut-bluehut)) (and (closed? (-> this tasks) (game-task village2-levitator) (task-status need-introduction)) (task-closed? (game-task beach-flutflut) (task-status need-resolution)) ) @@ -119,7 +115,7 @@ ) ;; definition for method 11 of type flutflut-bluehut -(defmethod init-from-entity! flutflut-bluehut ((this flutflut-bluehut) (arg0 entity-actor)) +(defmethod init-from-entity! ((this flutflut-bluehut) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *flutflut-bluehut-sg* 3 0 (new 'static 'vector :w 4096.0) 27) (set! (-> this tasks) (get-task-control (game-task village2-levitator))) (set! (-> this draw light-index) (the-as uint 1)) diff --git a/test/decompiler/reference/jak1/levels/village2/gambler_REF.gc b/test/decompiler/reference/jak1/levels/village2/gambler_REF.gc index 6f44af01dc9..93fed3dda3b 100644 --- a/test/decompiler/reference/jak1/levels/village2/gambler_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/gambler_REF.gc @@ -4,14 +4,10 @@ ;; definition of type gambler (deftype gambler (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type gambler -(defmethod inspect gambler ((this gambler)) +(defmethod inspect ((this gambler)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -26,7 +22,7 @@ ) ;; definition for method 32 of type gambler -(defmethod play-anim! gambler ((this gambler) (arg0 symbol)) +(defmethod play-anim! ((this gambler) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -123,55 +119,55 @@ ) ;; definition for method 31 of type gambler -(defmethod get-art-elem gambler ((this gambler)) +(defmethod get-art-elem ((this gambler)) (-> this draw art-group data 7) ) ;; definition for method 43 of type gambler -(defmethod process-taskable-method-43 gambler ((this gambler)) +(defmethod process-taskable-method-43 ((this gambler)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 61440.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.9230769 f0-2) - (play-ambient (-> this ambient) "GAM-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM01" #f (-> this root trans)) ) ((< 0.84615386 f0-2) - (play-ambient (-> this ambient) "GAM-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM02" #f (-> this root trans)) ) ((< 0.7692308 f0-2) - (play-ambient (-> this ambient) "GAM-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM03" #f (-> this root trans)) ) ((< 0.6923077 f0-2) - (play-ambient (-> this ambient) "GAM-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM04" #f (-> this root trans)) ) ((< 0.61538464 f0-2) - (play-ambient (-> this ambient) "GAM-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM05" #f (-> this root trans)) ) ((< 0.53846157 f0-2) - (play-ambient (-> this ambient) "GAM-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM06" #f (-> this root trans)) ) ((< 0.46153846 f0-2) - (play-ambient (-> this ambient) "GAM-AM07" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM07" #f (-> this root trans)) ) ((< 0.3846154 f0-2) - (play-ambient (-> this ambient) "GAM-AM08" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM08" #f (-> this root trans)) ) ((< 0.30769232 f0-2) - (play-ambient (-> this ambient) "GAM-AM09" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM09" #f (-> this root trans)) ) ((< 0.23076923 f0-2) (if (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) - (play-ambient (-> this ambient) "GAM-AM10" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM10" #f (-> this root trans)) ) ) ((< 0.15384616 f0-2) - (play-ambient (-> this ambient) "GAM-AM11" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM11" #f (-> this root trans)) ) ((< 0.07692308 f0-2) - (play-ambient (-> this ambient) "GAM-AM12" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM12" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "GAM-AM13" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GAM-AM13" #f (-> this root trans)) ) ) ) @@ -220,7 +216,7 @@ ) ;; definition for method 11 of type gambler -(defmethod init-from-entity! gambler ((this gambler) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gambler) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *gambler-sg* 3 32 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task rolling-race))) (set! (-> this sound-flava) (music-flava gambler)) diff --git a/test/decompiler/reference/jak1/levels/village2/geologist_REF.gc b/test/decompiler/reference/jak1/levels/village2/geologist_REF.gc index a4e9721eb8e..20edc543882 100644 --- a/test/decompiler/reference/jak1/levels/village2/geologist_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/geologist_REF.gc @@ -4,14 +4,10 @@ ;; definition of type geologist (deftype geologist (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type geologist -(defmethod inspect geologist ((this geologist)) +(defmethod inspect ((this geologist)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -26,7 +22,7 @@ ) ;; definition for method 32 of type geologist -(defmethod play-anim! geologist ((this geologist) (arg0 symbol)) +(defmethod play-anim! ((this geologist) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -115,50 +111,50 @@ ) ;; definition for method 31 of type geologist -(defmethod get-art-elem geologist ((this geologist)) +(defmethod get-art-elem ((this geologist)) (-> this draw art-group data 5) ) ;; definition for method 43 of type geologist -(defmethod process-taskable-method-43 geologist ((this geologist)) +(defmethod process-taskable-method-43 ((this geologist)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8888889 f0-2) - (play-ambient (-> this ambient) "GEO-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM01" #f (-> this root trans)) ) ((< 0.7777778 f0-2) (if (not (closed? (-> this tasks) (game-task rolling-moles) (task-status need-reminder))) - (play-ambient (-> this ambient) "GEO-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM02" #f (-> this root trans)) ) ) ((< 0.6666667 f0-2) - (play-ambient (-> this ambient) "GEO-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM03" #f (-> this root trans)) ) ((< 0.5555556 f0-2) (if (closed? (-> this tasks) (game-task village2-geologist-money) (task-status need-introduction)) - (play-ambient (-> this ambient) "GEO-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM04" #f (-> this root trans)) ) ) ((< 0.44444445 f0-2) - (play-ambient (-> this ambient) "GEO-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM05" #f (-> this root trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> this ambient) "GEO-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM06" #f (-> this root trans)) ) ((< 0.22222222 f0-2) (if (not (closed? (-> this tasks) (game-task rolling-moles) (task-status need-reminder))) - (play-ambient (-> this ambient) "GEO-AM07" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM07" #f (-> this root trans)) ) ) ((< 0.11111111 f0-2) - (play-ambient (-> this ambient) "GEO-LO02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-LO02" #f (-> this root trans)) ) ((closed? (-> this tasks) (game-task village2-geologist-money) (task-status need-resolution)) - (play-ambient (-> this ambient) "GEO-AM08" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-AM08" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "GEO-LO01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "GEO-LO01" #f (-> this root trans)) ) ) ) @@ -166,7 +162,7 @@ ) ;; definition for method 11 of type geologist -(defmethod init-from-entity! geologist ((this geologist) (arg0 entity-actor)) +(defmethod init-from-entity! ((this geologist) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *geologist-sg* 3 45 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task rolling-moles))) (set! (-> this sound-flava) (music-flava geologist)) diff --git a/test/decompiler/reference/jak1/levels/village2/sage-bluehut_REF.gc b/test/decompiler/reference/jak1/levels/village2/sage-bluehut_REF.gc index 56b14df74a0..5cdc27f03a5 100644 --- a/test/decompiler/reference/jak1/levels/village2/sage-bluehut_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/sage-bluehut_REF.gc @@ -3,19 +3,15 @@ ;; definition of type assistant-bluehut (deftype assistant-bluehut (process-taskable) - ((sound-id sound-id :offset-assert 380) - (jaws handle :offset-assert 384) - (sage entity-actor :offset-assert 392) - (im-talking symbol :offset-assert 396) + ((sound-id sound-id) + (jaws handle) + (sage entity-actor) + (im-talking symbol) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x190 - :flag-assert #x3501200190 ) ;; definition for method 3 of type assistant-bluehut -(defmethod inspect assistant-bluehut ((this assistant-bluehut)) +(defmethod inspect ((this assistant-bluehut)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -28,17 +24,13 @@ ;; definition of type sage-bluehut (deftype sage-bluehut (process-taskable) - ((reminder-played symbol :offset-assert 380) - (assistant entity-actor :offset-assert 384) + ((reminder-played symbol) + (assistant entity-actor) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x184 - :flag-assert #x3501200184 ) ;; definition for method 3 of type sage-bluehut -(defmethod inspect sage-bluehut ((this sage-bluehut)) +(defmethod inspect ((this sage-bluehut)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -55,7 +47,7 @@ ) ;; definition for method 32 of type sage-bluehut -(defmethod play-anim! sage-bluehut ((this sage-bluehut) (arg0 symbol)) +(defmethod play-anim! ((this sage-bluehut) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk-to-sage)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -145,7 +137,7 @@ ) ;; definition for method 45 of type sage-bluehut -(defmethod process-taskable-method-45 sage-bluehut ((this sage-bluehut)) +(defmethod process-taskable-method-45 ((this sage-bluehut)) (cond ((= (current-status (-> this tasks)) (task-status unknown)) #f @@ -163,9 +155,7 @@ ) #t ) - ((and (-> this reminder-played) - (< 81920.0 (vector-vector-distance (-> this root-override trans) (camera-pos))) - ) + ((and (-> this reminder-played) (< 81920.0 (vector-vector-distance (-> this root trans) (camera-pos)))) #t ) (else @@ -175,7 +165,7 @@ ) ;; definition for method 31 of type sage-bluehut -(defmethod get-art-elem sage-bluehut ((this sage-bluehut)) +(defmethod get-art-elem ((this sage-bluehut)) (cond ((and (= (current-task (-> this tasks)) (game-task rolling-plants)) (or (= (current-status (-> this tasks)) (task-status need-hint)) @@ -228,13 +218,13 @@ ) ;; definition for method 39 of type sage-bluehut -(defmethod should-display? sage-bluehut ((this sage-bluehut)) +(defmethod should-display? ((this sage-bluehut)) (and (task-closed? (game-task village2-levitator) (task-status need-introduction)) (not (sages-kidnapped?))) ) ;; definition for method 44 of type sage-bluehut ;; INFO: Return type mismatch basic vs symbol. -(defmethod play-reminder sage-bluehut ((this sage-bluehut)) +(defmethod play-reminder ((this sage-bluehut)) (the-as symbol (and (-> this will-talk) *target* (< -6365184.0 (-> (target-pos 0) z)) (< (-> (target-pos 0) x) 1612800.0)) @@ -242,7 +232,7 @@ ) ;; definition for method 47 of type sage-bluehut -(defmethod target-above-threshold? sage-bluehut ((this sage-bluehut)) +(defmethod target-above-threshold? ((this sage-bluehut)) (local-vars (v0-1 symbol)) (if (not (play-reminder this)) (return #f) @@ -258,24 +248,24 @@ ) ;; definition for method 43 of type sage-bluehut -(defmethod process-taskable-method-43 sage-bluehut ((this sage-bluehut)) +(defmethod process-taskable-method-43 ((this sage-bluehut)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8 f0-2) - (play-ambient (-> this ambient) "SAGELP20" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP20" #f (-> this root trans)) ) ((< 0.6 f0-2) - (play-ambient (-> this ambient) "SAGELP21" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP21" #f (-> this root trans)) ) ((< 0.4 f0-2) - (play-ambient (-> this ambient) "SAGELP22" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP22" #f (-> this root trans)) ) ((< 0.2 f0-2) - (play-ambient (-> this ambient) "SAGELP23" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP23" #f (-> this root trans)) ) ((nonzero? (get-task-status (game-task citadel-sage-blue))) - (play-ambient (-> this ambient) "SAGELP24" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP24" #f (-> this root trans)) ) ) ) @@ -342,7 +332,7 @@ ) ;; definition for method 11 of type sage-bluehut -(defmethod init-from-entity! sage-bluehut ((this sage-bluehut) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sage-bluehut) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sage-bluehut-sg* 3 40 (new 'static 'vector :w 4505.6) 5) (set! (-> this tasks) (get-task-control (game-task rolling-plants))) (set! (-> this reminder-played) #f) diff --git a/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc b/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc index 2ecc69bb8b2..500a447c327 100644 --- a/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc @@ -3,18 +3,14 @@ ;; definition of type sunken-elevator (deftype sunken-elevator (plat-button) - ((play-at-top-going-up-camera? symbol :offset-assert 240) - (teleport-if-below-y float :offset-assert 244) - (teleport-if-above-y float :offset-assert 248) + ((play-at-top-going-up-camera? symbol) + (teleport-if-below-y float) + (teleport-if-above-y float) ) - :heap-base #x90 - :method-count-assert 33 - :size-assert #xfc - :flag-assert #x21009000fc ) ;; definition for method 3 of type sunken-elevator -(defmethod inspect sunken-elevator ((this sunken-elevator)) +(defmethod inspect ((this sunken-elevator)) (let ((t9-0 (method-of-type plat-button inspect))) (t9-0 this) ) @@ -31,7 +27,7 @@ ) ;; definition for method 30 of type sunken-elevator -(defmethod should-teleport? sunken-elevator ((this sunken-elevator)) +(defmethod should-teleport? ((this sunken-elevator)) (let ((f0-0 (-> (camera-pos) y))) (case (-> this path-pos) ((0.0) @@ -157,13 +153,13 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (set! *teleport* #t) - (set! (-> s5-0 quad) (-> self root-override trans quad)) + (set! (-> s5-0 quad) (-> self root trans quad)) (let ((t9-1 (-> (find-parent-state) trans))) (if t9-1 (t9-1) ) ) - (vector-! gp-0 (-> self root-override trans) s5-0) + (vector-! gp-0 (-> self root trans) s5-0) (when (< (-> self path-pos) 0.9) (move-by-vector! (-> *target* control) gp-0) (send-event *target* 'reset-height) @@ -174,7 +170,7 @@ ;; definition for method 29 of type sunken-elevator ;; INFO: Return type mismatch float vs none. -(defmethod can-target-move? sunken-elevator ((this sunken-elevator)) +(defmethod can-target-move? ((this sunken-elevator)) (set! (-> this play-at-top-going-up-camera?) #f) (let ((s5-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> this path) s5-0 0.4 'interp) @@ -187,7 +183,7 @@ ;; definition for method 27 of type sunken-elevator ;; INFO: Return type mismatch symbol vs none. -(defmethod plat-button-method-27 sunken-elevator ((this sunken-elevator)) +(defmethod plat-button-method-27 ((this sunken-elevator)) (ja-channel-set! 1) (cond ((can-activate? this) @@ -214,13 +210,13 @@ ) ) (ja-post) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (none) ) ;; definition for method 31 of type sunken-elevator ;; INFO: Return type mismatch int vs none. -(defmethod plat-button-method-31 sunken-elevator ((this sunken-elevator)) +(defmethod plat-button-method-31 ((this sunken-elevator)) (initialize-skeleton this *sunken-elevator-sg* '()) 0 (none) diff --git a/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc b/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc index 5ddb992c916..1533ec45742 100644 --- a/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc @@ -201,18 +201,15 @@ ;; definition of type swamp-blimp-bank (deftype swamp-blimp-bank (basic) - ((arm-index int32 :offset-assert 4) - (pause-before-dropping-arm int32 :offset-assert 8) - (rise-per-break float :offset-assert 12) - (arm-sink-wait float :offset-assert 16) + ((arm-index int32) + (pause-before-dropping-arm int32) + (rise-per-break float) + (arm-sink-wait float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type swamp-blimp-bank -(defmethod inspect swamp-blimp-bank ((this swamp-blimp-bank)) +(defmethod inspect ((this swamp-blimp-bank)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tarm-index: ~D~%" (-> this arm-index)) (format #t "~Tpause-before-dropping-arm: ~D~%" (-> this pause-before-dropping-arm)) @@ -228,20 +225,17 @@ ;; definition of type tetherrock-info (deftype tetherrock-info (structure) - ((rock-camera string :offset-assert 0) - (arm-camera string :offset-assert 4) - (blimp-rp int32 :offset-assert 8) - (other-rp int32 :offset-assert 12) - (connected-to-rock basic :offset-assert 16) - (damping float :offset-assert 20) + ((rock-camera string) + (arm-camera string) + (blimp-rp int32) + (other-rp int32) + (connected-to-rock basic) + (damping float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type tetherrock-info -(defmethod inspect tetherrock-info ((this tetherrock-info)) +(defmethod inspect ((this tetherrock-info)) (format #t "[~8x] ~A~%" this 'tetherrock-info) (format #t "~Trock-camera: ~A~%" (-> this rock-camera)) (format #t "~Tarm-camera: ~A~%" (-> this arm-camera)) @@ -310,24 +304,21 @@ ;; definition of type swamp-rope-rand-float (deftype swamp-rope-rand-float (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (max-val float :offset-assert 8) - (timer int32 :offset-assert 12) - (value float :offset-assert 16) + ((min-time int32) + (max-time int32) + (max-val float) + (timer int32) + (value float) ) :pack-me - :method-count-assert 11 - :size-assert #x14 - :flag-assert #xb00000014 (:methods - (init! (_type_ int int float) none 9) - (update-timer! (_type_) none 10) + (init! (_type_ int int float) none) + (update-timer! (_type_) none) ) ) ;; definition for method 3 of type swamp-rope-rand-float -(defmethod inspect swamp-rope-rand-float ((this swamp-rope-rand-float)) +(defmethod inspect ((this swamp-rope-rand-float)) (format #t "[~8x] ~A~%" this 'swamp-rope-rand-float) (format #t "~Tmin-time: ~D~%" (-> this min-time)) (format #t "~Tmax-time: ~D~%" (-> this max-time)) @@ -339,7 +330,7 @@ ;; definition for method 9 of type swamp-rope-rand-float ;; INFO: Return type mismatch int vs none. -(defmethod init! swamp-rope-rand-float ((this swamp-rope-rand-float) (arg0 int) (arg1 int) (arg2 float)) +(defmethod init! ((this swamp-rope-rand-float) (arg0 int) (arg1 int) (arg2 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) (set! (-> this max-val) (* 0.5 arg2)) @@ -351,7 +342,7 @@ ;; definition for method 10 of type swamp-rope-rand-float ;; INFO: Return type mismatch int vs none. -(defmethod update-timer! swamp-rope-rand-float ((this swamp-rope-rand-float)) +(defmethod update-timer! ((this swamp-rope-rand-float)) (set! (-> this timer) (- (the-as time-frame (-> this timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) @@ -365,25 +356,22 @@ ;; definition of type swamp-rope-oscillator (deftype swamp-rope-oscillator (structure) - ((target float :offset-assert 0) - (value float :offset-assert 4) - (vel float :offset-assert 8) - (accel float :offset-assert 12) - (vector-overlay vector :inline :offset 0) - (max-vel float :offset-assert 16) - (damping float :offset-assert 20) + ((target float) + (value float) + (vel float) + (accel float) + (vector-overlay vector :inline :overlay-at target) + (max-vel float) + (damping float) ) - :method-count-assert 11 - :size-assert #x18 - :flag-assert #xb00000018 (:methods - (init! (_type_ float float float float) none 9) - (swamp-rope-oscillator-method-10 (_type_ float) none 10) + (init! (_type_ float float float float) none) + (swamp-rope-oscillator-method-10 (_type_ float) none) ) ) ;; definition for method 3 of type swamp-rope-oscillator -(defmethod inspect swamp-rope-oscillator ((this swamp-rope-oscillator)) +(defmethod inspect ((this swamp-rope-oscillator)) (format #t "[~8x] ~A~%" this 'swamp-rope-oscillator) (format #t "~Ttarget: ~f~%" (-> this target)) (format #t "~Tvalue: ~f~%" (-> this value)) @@ -396,7 +384,7 @@ ;; definition for method 9 of type swamp-rope-oscillator ;; INFO: Return type mismatch int vs none. -(defmethod init! swamp-rope-oscillator ((this swamp-rope-oscillator) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init! ((this swamp-rope-oscillator) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (set! (-> this target) arg0) (set! (-> this value) arg0) (set! (-> this vel) 0.0) @@ -409,7 +397,7 @@ ;; definition for method 10 of type swamp-rope-oscillator ;; INFO: Return type mismatch int vs none. -(defmethod swamp-rope-oscillator-method-10 swamp-rope-oscillator ((this swamp-rope-oscillator) (arg0 float)) +(defmethod swamp-rope-oscillator-method-10 ((this swamp-rope-oscillator) (arg0 float)) (let ((f0-3 (* (- (+ (-> this target) arg0) (-> this value)) (* (-> this accel) (-> *display* time-adjust-ratio)))) ) (+! (-> this vel) f0-3) @@ -423,24 +411,21 @@ ;; definition of type swamp-blimp-rand-vector (deftype swamp-blimp-rand-vector (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (xz-max float :offset-assert 8) - (y-max float :offset-assert 12) - (timer int32 :offset-assert 16) - (value vector :inline :offset-assert 32) + ((min-time int32) + (max-time int32) + (xz-max float) + (y-max float) + (timer int32) + (value vector :inline) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (init! (_type_ int int float float) none 9) - (update-timer! (_type_) none 10) + (init! (_type_ int int float float) none) + (update-timer! (_type_) none) ) ) ;; definition for method 3 of type swamp-blimp-rand-vector -(defmethod inspect swamp-blimp-rand-vector ((this swamp-blimp-rand-vector)) +(defmethod inspect ((this swamp-blimp-rand-vector)) (format #t "[~8x] ~A~%" this 'swamp-blimp-rand-vector) (format #t "~Tmin-time: ~D~%" (-> this min-time)) (format #t "~Tmax-time: ~D~%" (-> this max-time)) @@ -453,7 +438,7 @@ ;; definition for method 9 of type swamp-blimp-rand-vector ;; INFO: Return type mismatch int vs none. -(defmethod init! swamp-blimp-rand-vector ((this swamp-blimp-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) +(defmethod init! ((this swamp-blimp-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) (set! (-> this xz-max) (* 0.5 arg2)) @@ -466,7 +451,7 @@ ;; definition for method 10 of type swamp-blimp-rand-vector ;; INFO: Return type mismatch int vs none. -(defmethod update-timer! swamp-blimp-rand-vector ((this swamp-blimp-rand-vector)) +(defmethod update-timer! ((this swamp-blimp-rand-vector)) (set! (-> this timer) (- (the-as time-frame (-> this timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) @@ -482,25 +467,22 @@ ;; definition of type swamp-blimp-oscillator (deftype swamp-blimp-oscillator (structure) - ((target vector :inline :offset-assert 0) - (value vector :inline :offset-assert 16) - (vel vector :inline :offset-assert 32) - (accel float :offset-assert 48) - (max-vel float :offset-assert 52) - (damping float :offset-assert 56) + ((target vector :inline) + (value vector :inline) + (vel vector :inline) + (accel float) + (max-vel float) + (damping float) ) :pack-me - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (init! (_type_ vector float float float) none 9) - (swamp-blimp-oscillator-method-10 (_type_ vector) none 10) + (init! (_type_ vector float float float) none) + (swamp-blimp-oscillator-method-10 (_type_ vector) none) ) ) ;; definition for method 3 of type swamp-blimp-oscillator -(defmethod inspect swamp-blimp-oscillator ((this swamp-blimp-oscillator)) +(defmethod inspect ((this swamp-blimp-oscillator)) (format #t "[~8x] ~A~%" this 'swamp-blimp-oscillator) (format #t "~Ttarget: #~%" (-> this target)) (format #t "~Tvalue: #~%" (-> this value)) @@ -514,7 +496,7 @@ ;; definition for method 9 of type swamp-blimp-oscillator ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod init! swamp-blimp-oscillator ((this swamp-blimp-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init! ((this swamp-blimp-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 (set! (-> this target quad) (-> arg0 quad)) @@ -535,7 +517,7 @@ ;; definition for method 10 of type swamp-blimp-oscillator ;; INFO: Return type mismatch int vs none. -(defmethod swamp-blimp-oscillator-method-10 swamp-blimp-oscillator ((this swamp-blimp-oscillator) (arg0 vector)) +(defmethod swamp-blimp-oscillator-method-10 ((this swamp-blimp-oscillator) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (cond (arg0 @@ -563,17 +545,13 @@ ;; definition of type swamp-tetherrock (deftype swamp-tetherrock (process-drawable) - ((root-override collide-shape-moving :offset 112) - (tension float :offset-assert 176) - (tension-pt vector :inline :offset-assert 192) - (blimp entity-actor :offset-assert 208) - (rot-at-init quaternion :inline :offset-assert 224) - (hits int32 :offset-assert 240) + ((root collide-shape-moving :override) + (tension float) + (tension-pt vector :inline) + (blimp entity-actor) + (rot-at-init quaternion :inline) + (hits int32) ) - :heap-base #x90 - :method-count-assert 20 - :size-assert #xf4 - :flag-assert #x14009000f4 (:states swamp-tetherrock-break swamp-tetherrock-die @@ -583,7 +561,7 @@ ) ;; definition for method 3 of type swamp-tetherrock -(defmethod inspect swamp-tetherrock ((this swamp-tetherrock)) +(defmethod inspect ((this swamp-tetherrock)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -597,20 +575,16 @@ ;; definition of type precursor-arm (deftype precursor-arm (process-drawable) - ((root-override collide-shape :offset 112) - (y-init float :offset-assert 176) - (y-offset float :offset-assert 180) - (rot-speed float :offset-assert 184) - (rot-dist float :offset-assert 188) - (rot-base float :offset-assert 192) - (rot-t float :offset-assert 196) - (init-mat matrix :inline :offset-assert 208) - (tension float :offset-assert 272) + ((root collide-shape :override) + (y-init float) + (y-offset float) + (rot-speed float) + (rot-dist float) + (rot-base float) + (rot-t float) + (init-mat matrix :inline) + (tension float) ) - :heap-base #xb0 - :method-count-assert 20 - :size-assert #x114 - :flag-assert #x1400b00114 (:states precursor-arm-die precursor-arm-idle @@ -619,7 +593,7 @@ ) ;; definition for method 3 of type precursor-arm -(defmethod inspect precursor-arm ((this precursor-arm)) +(defmethod inspect ((this precursor-arm)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -636,26 +610,22 @@ ;; definition of type swamp-rope (deftype swamp-rope (process-drawable) - ((parent-override (pointer swamp-blimp) :offset 12) - (parent-rp int32 :offset-assert 176) - (other-entity entity-actor :offset-assert 180) - (other-rp int32 :offset-assert 184) - (old-scale float :offset-assert 188) - (frame swamp-rope-oscillator :inline :offset-assert 192) - (other-pos vector :inline :offset-assert 224) - (scale-base float :offset-assert 240) - (base-vec vector :inline :offset-assert 256) - (scale-t float :offset-assert 272) - (x-t float :offset-assert 276) - (z-t float :offset-assert 280) - (rot-speed float :offset-assert 284) + ((parent-override (pointer swamp-blimp) :overlay-at parent) + (parent-rp int32) + (other-entity entity-actor) + (other-rp int32) + (old-scale float) + (frame swamp-rope-oscillator :inline) + (other-pos vector :inline) + (scale-base float) + (base-vec vector :inline) + (scale-t float) + (x-t float) + (z-t float) + (rot-speed float) ) - :heap-base #xb0 - :method-count-assert 21 - :size-assert #x120 - :flag-assert #x1500b00120 (:methods - (swamp-rope-method-20 (_type_) basic 20) + (swamp-rope-method-20 (_type_) basic) ) (:states swamp-rope-break @@ -665,7 +635,7 @@ ) ;; definition for method 3 of type swamp-rope -(defmethod inspect swamp-rope ((this swamp-rope)) +(defmethod inspect ((this swamp-rope)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -685,7 +655,7 @@ ) ;; definition for method 20 of type swamp-rope -(defmethod swamp-rope-method-20 swamp-rope ((this swamp-rope)) +(defmethod swamp-rope-method-20 ((this swamp-rope)) (and (-> this other-entity) (not (task-closed? (-> this other-entity extra perm task) (task-status need-reminder))) ) @@ -693,28 +663,24 @@ ;; definition of type swamp-blimp (deftype swamp-blimp (process-drawable) - ((root-override collide-shape-moving :offset 112) - (the-ropes handle 5 :offset-assert 176) - (arm-timer int32 :offset-assert 216) - (trans-at-init vector :inline :offset-assert 224) - (rot-at-init quaternion :inline :offset-assert 240) - (y-vel float :offset-assert 256) - (y-offset float :offset-assert 260) - (y-offset-target float :offset-assert 264) - (main-tilt-rand swamp-blimp-rand-vector :inline :offset-assert 272) - (main-tilt-oscillator swamp-blimp-oscillator :inline :offset-assert 320) - (gondola-tilt-oscillator swamp-blimp-oscillator :inline :offset-assert 384) - (pos-rand swamp-blimp-rand-vector :inline :offset-assert 448) - (pos-oscillator swamp-blimp-oscillator :inline :offset-assert 496) - (scale-rand swamp-rope-rand-float :inline :offset-assert 556) - (scale-oscillator swamp-rope-oscillator :inline :offset-assert 576) - (gondola joint-mod :offset-assert 600) - (bag joint-mod :offset-assert 604) + ((root collide-shape-moving :override) + (the-ropes handle 5) + (arm-timer int32) + (trans-at-init vector :inline) + (rot-at-init quaternion :inline) + (y-vel float) + (y-offset float) + (y-offset-target float) + (main-tilt-rand swamp-blimp-rand-vector :inline) + (main-tilt-oscillator swamp-blimp-oscillator :inline) + (gondola-tilt-oscillator swamp-blimp-oscillator :inline) + (pos-rand swamp-blimp-rand-vector :inline) + (pos-oscillator swamp-blimp-oscillator :inline) + (scale-rand swamp-rope-rand-float :inline) + (scale-oscillator swamp-rope-oscillator :inline) + (gondola joint-mod) + (bag joint-mod) ) - :heap-base #x1f0 - :method-count-assert 20 - :size-assert #x260 - :flag-assert #x1401f00260 (:states swamp-blimp-bye-bye swamp-blimp-idle @@ -722,7 +688,7 @@ ) ;; definition for method 3 of type swamp-blimp -(defmethod inspect swamp-blimp ((this swamp-blimp)) +(defmethod inspect ((this swamp-blimp)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -750,7 +716,7 @@ ) ;; definition for method 7 of type swamp-blimp -(defmethod relocate swamp-blimp ((this swamp-blimp) (arg0 int)) +(defmethod relocate ((this swamp-blimp) (arg0 int)) (if (nonzero? (-> this gondola)) (&+! (-> this gondola) arg0) ) @@ -773,7 +739,7 @@ ;; failed to figure out what this is: (defstate swamp-tetherrock-hide (swamp-tetherrock) :code (behavior () - (clear-collide-with-as (-> self root-override)) + (clear-collide-with-as (-> self root)) (logior! (-> self draw status) (draw-status hidden)) (loop (when (= (get-task-status (-> self entity extra perm task)) (task-status invalid)) @@ -824,7 +790,7 @@ (cam-slave-get-rot (the-as entity-actor s5-1) *camera-other-matrix*) (set! (-> *camera-other-fov* data) (cam-slave-get-fov s5-1)) ) - (set! (-> *camera-other-root* quad) (-> self root-override trans quad)) + (set! (-> *camera-other-root* quad) (-> self root trans quad)) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 0.6)) (set! *camera-look-through-other* 2) @@ -833,7 +799,7 @@ (set! (-> self tension) 0.0) (close-specific-task! (-> self entity extra perm task) (task-status need-reminder)) (birth-pickup-at-point - (-> self root-override trans) + (-> self root trans) (pickup-type fuel-cell) (the float (-> self entity extra perm task)) #f @@ -863,19 +829,15 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) (logior! (-> self draw status) (draw-status skip-bones)) - (let ((s4-3 (ppointer->handle (manipy-spawn - (-> self root-override trans) - (-> self entity) - *swamp-tetherrock-explode-sg* - #f - :to *entity-pool* - ) - ) - ) + (let ((s4-3 + (ppointer->handle + (manipy-spawn (-> self root trans) (-> self entity) *swamp-tetherrock-explode-sg* #f :to *entity-pool*) + ) + ) ) (send-event (handle->process (the-as handle s4-3)) 'anim-mode 'play1) (send-event (handle->process (the-as handle s4-3)) 'art-joint-anim "swamp-tetherrock-explode-explode" 0) @@ -896,7 +858,7 @@ (cam-slave-get-rot (the-as entity-actor gp-1) *camera-other-matrix*) (set! (-> *camera-other-fov* data) (cam-slave-get-fov gp-1)) ) - (set! (-> *camera-other-root* quad) (-> self root-override trans quad)) + (set! (-> *camera-other-root* quad) (-> self root trans quad)) (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (seconds 5)) (set! *camera-look-through-other* 2) @@ -909,7 +871,7 @@ (a0-58 (-> self blimp extra process)) ) (when a0-58 - (vector-! gp-2 (-> (the-as swamp-blimp a0-58) root-override trans) *camera-other-trans*) + (vector-! gp-2 (-> (the-as swamp-blimp a0-58) root trans) *camera-other-trans*) (vector-normalize! gp-2 1.0) (forward-down->inv-matrix *camera-other-matrix* gp-2 (-> *camera* local-down)) ) @@ -1000,7 +962,7 @@ #f (if gp-0 (-> (the-as process-drawable gp-0) root trans) - (-> self root-override trans) + (-> self root trans) ) :to *entity-pool* ) @@ -1019,16 +981,16 @@ (gp-0 (new 'stack-no-clear 'quaternion)) ) 0.0 - (vector-! s3-0 (-> self tension-pt) (-> self root-override trans)) + (vector-! s3-0 (-> self tension-pt) (-> self root trans)) (vector-normalize! s3-0 1.0) (vector-cross! s5-0 s4-0 s3-0) (let ((f30-0 (asin (vector-normalize-ret-len! s5-0 1.0)))) (vector-normalize! s5-0 1.0) (quaternion-vector-angle! gp-0 s5-0 (* (fmin 1820.4445 f30-0) (- 1.0 (-> self tension)))) ) - (quaternion*! (-> self root-override quat) gp-0 (-> self rot-at-init)) + (quaternion*! (-> self root quat) gp-0 (-> self rot-at-init)) ) - (if (and *target* (>= 49152.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (if (and *target* (>= 49152.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (level-hint-spawn (text-id swamp-tetherrock-eco-yellow-hint) "sksp0138" @@ -1045,7 +1007,7 @@ ;; definition for method 11 of type swamp-tetherrock ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swamp-tetherrock ((this swamp-tetherrock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swamp-tetherrock) (arg0 entity-actor)) (logior! (-> this mask) (process-mask attackable)) (process-entity-status! this (entity-perm-status bit-7) #t) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -1066,7 +1028,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *swamp-tetherrock-sg* '()) @@ -1076,7 +1038,7 @@ (set! (-> this blimp) (entity-actor-lookup arg0 'alt-actor 0)) (set! (-> this tension) 0.0) (vector-reset! (-> this tension-pt)) - (quaternion-copy! (-> this rot-at-init) (-> this root-override quat)) + (quaternion-copy! (-> this rot-at-init) (-> this root quat)) (logclear! (-> this mask) (process-mask actor-pause)) (case (get-task-status (-> this entity extra perm task)) (((task-status invalid)) @@ -1084,7 +1046,7 @@ ) (((task-status need-resolution)) (birth-pickup-at-point - (-> this root-override trans) + (-> this root trans) (pickup-type fuel-cell) (the float (-> this entity extra perm task)) #f @@ -1131,7 +1093,7 @@ (deactivate self) ) ) - (set! (-> self root-override trans y) (+ (-> self y-offset) (-> self y-init))) + (set! (-> self root trans y) (+ (-> self y-offset) (-> self y-init))) (suspend) ) ) @@ -1182,11 +1144,11 @@ (+ (-> self rot-base) (* (parameter-ease-sin-clamp (-> self rot-t)) (-> self rot-dist))) ) (matrix*! gp-0 (-> self init-mat) gp-0) - (matrix->quaternion (-> self root-override quat) gp-0) + (matrix->quaternion (-> self root quat) gp-0) ) - (when (< (vector-vector-distance (-> self root-override trans) (camera-pos)) 204800.0) + (when (< (vector-vector-distance (-> self root trans) (camera-pos)) 204800.0) (let ((a2-1 (new 'static 'vector))) - (set! (-> a2-1 quad) (-> self root-override trans quad)) + (set! (-> a2-1 quad) (-> self root trans quad)) (set! (-> a2-1 y) 0.0) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2017) a2-1) ) @@ -1211,7 +1173,7 @@ (set! (-> self y-offset) (+ f30-2 (* f28-2 (precursor-arm-slip (/ (the float (- (current-time) (-> self state-time))) f26-1)))) ) - (set! (-> self root-override trans y) (+ (-> self y-offset) (-> self y-init))) + (set! (-> self root trans y) (+ (-> self y-offset) (-> self y-init))) (suspend) ) ) @@ -1233,7 +1195,7 @@ (set! (-> self y-offset) (+ f30-5 (* f28-4 (parameter-ease-sin-clamp (/ (the float (- (current-time) (-> self state-time))) f26-3)))) ) - (set! (-> self root-override trans y) (+ (-> self y-offset) (-> self y-init))) + (set! (-> self root trans y) (+ (-> self y-offset) (-> self y-init))) (suspend) ) ) @@ -1247,7 +1209,7 @@ ;; definition for method 11 of type precursor-arm ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! precursor-arm ((this precursor-arm) (arg0 entity-actor)) +(defmethod init-from-entity! ((this precursor-arm) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (alloc-riders s4-0 1) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -1260,7 +1222,7 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *precursor-arm-sg* '()) @@ -1268,9 +1230,9 @@ (set! (-> this rot-dist) 0.0) (set! (-> this rot-base) 0.0) (set! (-> this rot-t) 1.0) - (quaternion->matrix (-> this init-mat) (-> this root-override quat)) + (quaternion->matrix (-> this init-mat) (-> this root quat)) (set! (-> this y-offset) 0.0) - (set! (-> this y-init) (-> this root-override trans y)) + (set! (-> this y-init) (-> this root trans y)) (set! (-> this tension) 0.0) (process-entity-status! this (entity-perm-status bit-7) #t) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1573,11 +1535,11 @@ (quaternion-vector-angle! gp-0 s5-0 f30-1) ) ) - (quaternion*! (-> self root-override quat) gp-0 (-> self rot-at-init)) + (quaternion*! (-> self root quat) gp-0 (-> self rot-at-init)) ) - (quaternion-normalize! (-> self root-override quat)) - (vector+! (-> self root-override trans) (-> self trans-at-init) (-> self pos-oscillator value)) - (set! (-> self root-override trans y) (+ (-> self root-override trans y) (-> self y-offset))) + (quaternion-normalize! (-> self root quat)) + (vector+! (-> self root trans) (-> self trans-at-init) (-> self pos-oscillator value)) + (set! (-> self root trans y) (+ (-> self root trans y) (-> self y-offset))) ) ;; failed to figure out what this is: @@ -1644,7 +1606,7 @@ (vector-! (the-as vector (-> self pos-oscillator)) (the-as vector (-> self pos-oscillator)) - (-> self root-override trans) + (-> self root trans) ) ) ((swamp-rope-method-20 (the-as swamp-rope s4-0)) @@ -1672,7 +1634,7 @@ (vector+! (the-as vector (-> self gondola-tilt-oscillator)) (the-as vector (-> self gondola-tilt-oscillator)) - (-> self root-override trans) + (-> self root trans) ) ) ) @@ -1758,7 +1720,7 @@ ;; definition for method 11 of type swamp-blimp ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swamp-blimp ((this swamp-blimp) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swamp-blimp) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) @@ -1777,13 +1739,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (initialize-skeleton this *swamp-blimp-sg* '()) - (quaternion-copy! (-> this rot-at-init) (-> this root-override quat)) + (quaternion-copy! (-> this rot-at-init) (-> this root quat)) (set! (-> this arm-timer) 0) - (set! (-> this trans-at-init quad) (-> this root-override trans quad)) + (set! (-> this trans-at-init quad) (-> this root trans quad)) (set! (-> this y-vel) 0.0) (set! (-> this y-offset) 0.0) (set! (-> this y-offset-target) 0.0) diff --git a/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc b/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc index 703dfe75477..af8a7db62ee 100644 --- a/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc @@ -3,16 +3,12 @@ ;; definition of type village2cam (deftype village2cam (pov-camera) - ((seq uint64 :offset-assert 224) + ((seq uint64) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xe8 - :flag-assert #x1e008000e8 ) ;; definition for method 3 of type village2cam -(defmethod inspect village2cam ((this village2cam)) +(defmethod inspect ((this village2cam)) (let ((t9-0 (method-of-type pov-camera inspect))) (t9-0 this) ) @@ -27,7 +23,7 @@ ) ;; definition for method 29 of type village2cam -(defmethod set-stack-size! village2cam ((this village2cam)) +(defmethod set-stack-size! ((this village2cam)) (stack-size-set! (-> this main-thread) 512) (none) ) @@ -92,14 +88,10 @@ ;; definition of type pontoon (deftype pontoon (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 736) - (task uint8 :offset-assert 752) - (alt-task uint8 :offset-assert 753) + ((anchor-point vector :inline) + (task uint8) + (alt-task uint8) ) - :heap-base #x290 - :method-count-assert 35 - :size-assert #x2f2 - :flag-assert #x23029002f2 (:states pontoon-die pontoon-hidden @@ -107,7 +99,7 @@ ) ;; definition for method 3 of type pontoon -(defmethod inspect pontoon ((this pontoon)) +(defmethod inspect ((this pontoon)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) (t9-0 this) ) @@ -178,7 +170,7 @@ ;; definition for method 11 of type pontoon ;; INFO: Return type mismatch int vs none. -(defmethod init-from-entity! pontoon ((this pontoon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pontoon) (arg0 entity-actor)) (logior! (-> this mask) (process-mask platform)) (rigid-body-platform-method-30 this) (process-drawable-from-entity! this arg0) @@ -209,7 +201,7 @@ ;; definition for method 23 of type pontoon ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 pontoon ((this pontoon) (arg0 float)) +(defmethod rigid-body-platform-method-23 ((this pontoon) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 @@ -273,14 +265,10 @@ ;; definition of type pontoonfive (deftype pontoonfive (pontoon) () - :heap-base #x290 - :method-count-assert 35 - :size-assert #x2f2 - :flag-assert #x23029002f2 ) ;; definition for method 3 of type pontoonfive -(defmethod inspect pontoonfive ((this pontoonfive)) +(defmethod inspect ((this pontoonfive)) (let ((t9-0 (method-of-type pontoon inspect))) (t9-0 this) ) @@ -290,14 +278,10 @@ ;; definition of type pontoonten (deftype pontoonten (pontoon) () - :heap-base #x290 - :method-count-assert 35 - :size-assert #x2f2 - :flag-assert #x23029002f2 ) ;; definition for method 3 of type pontoonten -(defmethod inspect pontoonten ((this pontoonten)) +(defmethod inspect ((this pontoonten)) (let ((t9-0 (method-of-type pontoon inspect))) (t9-0 this) ) @@ -320,7 +304,7 @@ ;; definition for method 30 of type pontoonfive ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 pontoonfive ((this pontoonfive)) +(defmethod rigid-body-platform-method-30 ((this pontoonfive)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -348,7 +332,7 @@ ;; definition for method 31 of type pontoonfive ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 pontoonfive ((this pontoonfive)) +(defmethod rigid-body-platform-method-31 ((this pontoonfive)) (initialize-skeleton this *pontoonfive-sg* '()) (rigid-body-platform-method-29 this *pontoonfive-constants*) (set! (-> this float-height-offset) 6144.0) @@ -385,7 +369,7 @@ ;; definition for method 30 of type pontoonten ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 pontoonten ((this pontoonten)) +(defmethod rigid-body-platform-method-30 ((this pontoonten)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -413,7 +397,7 @@ ;; definition for method 31 of type pontoonten ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 pontoonten ((this pontoonten)) +(defmethod rigid-body-platform-method-31 ((this pontoonten)) (initialize-skeleton this *pontoonten-sg* '()) (rigid-body-platform-method-29 this *pontoonten-constants*) (set! (-> this float-height-offset) 6144.0) @@ -517,12 +501,8 @@ ;; definition of type allpontoons (deftype allpontoons (process-drawable) - ((task uint8 :offset-assert 176) + ((task uint8) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb1 - :flag-assert #x14005000b1 (:states (allpontoons-be-clone handle) allpontoons-idle @@ -530,7 +510,7 @@ ) ;; definition for method 3 of type allpontoons -(defmethod inspect allpontoons ((this allpontoons)) +(defmethod inspect ((this allpontoons)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -622,7 +602,7 @@ ;; definition for method 11 of type allpontoons ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! allpontoons ((this allpontoons) (arg0 entity-actor)) +(defmethod init-from-entity! ((this allpontoons) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *allpontoons-sg* '()) @@ -634,14 +614,10 @@ ;; definition of type fireboulder (deftype fireboulder (process-drawable) - ((root-override collide-shape :offset 112) - (tracker handle :offset-assert 176) - (task uint8 :offset-assert 184) + ((root collide-shape :override) + (tracker handle) + (task uint8) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb9 - :flag-assert #x14005000b9 (:states (fireboulder-be-clone handle) fireboulder-hover @@ -650,7 +626,7 @@ ) ;; definition for method 3 of type fireboulder -(defmethod inspect fireboulder ((this fireboulder)) +(defmethod inspect ((this fireboulder)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -669,7 +645,7 @@ ;; definition for function fireboulder-disable-blocking-collision ;; INFO: Return type mismatch int vs none. (defbehavior fireboulder-disable-blocking-collision fireboulder () - (let ((v1-1 (-> self root-override root-prim))) + (let ((v1-1 (-> self root root-prim))) (dotimes (a0-0 (-> (the-as collide-shape-prim-group v1-1) num-prims)) (let ((a1-2 (-> (the-as collide-shape-prim-group v1-1) prims a0-0))) (when (= (-> a1-2 prim-id) 256) @@ -702,24 +678,16 @@ ) (else (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000))) - (set! v0-1 (ppointer->handle - (when gp-1 - (let ((t9-2 (method-of-type part-tracker activate))) - (t9-2 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - part-tracker-init - (-> *part-group-id-table* 678) - -1 - #f - #f - #f - (-> self root-override trans) - ) - (-> gp-1 ppointer) - ) - ) + (set! v0-1 + (ppointer->handle + (when gp-1 + (let ((t9-2 (method-of-type part-tracker activate))) + (t9-2 (the-as part-tracker gp-1) *entity-pool* 'part-tracker (the-as pointer #x70004000)) + ) + (run-now-in-process gp-1 part-tracker-init (-> *part-group-id-table* 678) -1 #f #f #f (-> self root trans)) + (-> gp-1 ppointer) + ) + ) ) ) (set! (-> self tracker) (the-as handle v0-1)) @@ -736,14 +704,14 @@ (ja-channel-set! 1) (ja :group! fireboulder-hover-ja) (logclear! (-> self draw status) (draw-status hidden)) - (set! (-> self root-override trans quad) (-> self entity extra trans quad)) + (set! (-> self root trans quad) (-> self entity extra trans quad)) (vector-reset! (-> self draw origin)) (logior! (-> self skel status) (janim-status inited)) (ja-post) (logclear! (-> self skel status) (janim-status inited)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector<-cspace! gp-0 (joint-node-index fireboulder-lod0-jg bouldercenter)) - (vector-! (-> self draw bounds) gp-0 (-> self root-override trans)) + (vector-! (-> self draw bounds) gp-0 (-> self root trans)) ) (set! (-> self draw bounds w) 24576.0) ) @@ -758,11 +726,7 @@ (loop (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (quaternion-rotate-y! - (-> self root-override quat) - (-> self root-override quat) - (* 455.1111 (-> *display* time-adjust-ratio)) - ) + (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 455.1111 (-> *display* time-adjust-ratio))) (suspend) (ja :num! (seek!)) ) @@ -832,7 +796,7 @@ #f #f #f - (-> self root-override trans) + (-> self root trans) :to *entity-pool* ) ) @@ -849,7 +813,7 @@ ;; definition for method 11 of type fireboulder ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! fireboulder ((this fireboulder) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fireboulder) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) @@ -879,14 +843,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) (cond ((name= (-> this name) "fireboulder-6") - (quaternion-axis-angle! (-> this root-override quat) 0.0 1.0 0.0 16384.0) + (quaternion-axis-angle! (-> this root quat) 0.0 1.0 0.0 16384.0) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "rock-hover" :fo-max 30) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "rock-hover" :fo-max 30) (-> this root trans)) ) ) (else @@ -914,17 +878,13 @@ ;; definition of type ceilingflag (deftype ceilingflag (process-drawable) () - :heap-base #x40 - :method-count-assert 20 - :size-assert #xb0 - :flag-assert #x14004000b0 (:states ceilingflag-idle ) ) ;; definition for method 3 of type ceilingflag -(defmethod inspect ceilingflag ((this ceilingflag)) +(defmethod inspect ((this ceilingflag)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -953,7 +913,7 @@ ;; definition for method 11 of type ceilingflag ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ceilingflag ((this ceilingflag) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ceilingflag) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *ceilingflag-sg* '()) @@ -963,15 +923,11 @@ ;; definition of type exit-chamber-dummy (deftype exit-chamber-dummy (process-drawable) - ((orig-trans vector :inline :offset-assert 176) - (fcell-handle handle :offset-assert 192) + ((orig-trans vector :inline) + (fcell-handle handle) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15006000c8 (:methods - (skip-reminder? (_type_) symbol 20) + (skip-reminder? (_type_) symbol) ) (:states exit-chamber-dummy-idle @@ -980,7 +936,7 @@ ) ;; definition for method 3 of type exit-chamber-dummy -(defmethod inspect exit-chamber-dummy ((this exit-chamber-dummy)) +(defmethod inspect ((this exit-chamber-dummy)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -996,7 +952,7 @@ ) ;; definition for method 20 of type exit-chamber-dummy -(defmethod skip-reminder? exit-chamber-dummy ((this exit-chamber-dummy)) +(defmethod skip-reminder? ((this exit-chamber-dummy)) (case (get-reminder (get-task-control (game-task sunken-room)) 0) ((2) (let ((v1-4 (level-get *level* 'sunken))) @@ -1068,7 +1024,7 @@ ;; definition for method 11 of type exit-chamber-dummy ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! exit-chamber-dummy ((this exit-chamber-dummy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this exit-chamber-dummy) (arg0 entity-actor)) (set! (-> this fcell-handle) (the-as handle #f)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -1092,12 +1048,8 @@ ;; definition of type ogreboss-village2 (deftype ogreboss-village2 (process-drawable) - ((boulder handle :offset-assert 176) + ((boulder handle) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 (:states ogreboss-village2-idle ogreboss-village2-throw @@ -1105,7 +1057,7 @@ ) ;; definition for method 3 of type ogreboss-village2 -(defmethod inspect ogreboss-village2 ((this ogreboss-village2)) +(defmethod inspect ((this ogreboss-village2)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -1677,7 +1629,7 @@ ;; definition for method 11 of type ogreboss-village2 ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ogreboss-village2 ((this ogreboss-village2) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ogreboss-village2) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) @@ -1712,14 +1664,10 @@ ;; definition of type villageb-ogreboss (deftype villageb-ogreboss (ogreboss-village2) () - :heap-base #x50 - :method-count-assert 20 - :size-assert #xb8 - :flag-assert #x14005000b8 ) ;; definition for method 3 of type villageb-ogreboss -(defmethod inspect villageb-ogreboss ((this villageb-ogreboss)) +(defmethod inspect ((this villageb-ogreboss)) (let ((t9-0 (method-of-type ogreboss-village2 inspect))) (t9-0 this) ) @@ -1729,14 +1677,10 @@ ;; definition of type villageb-water (deftype villageb-water (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) ;; definition for method 3 of type villageb-water -(defmethod inspect villageb-water ((this villageb-water)) +(defmethod inspect ((this villageb-water)) (let ((t9-0 (method-of-type water-anim inspect))) (t9-0 this) ) @@ -1759,7 +1703,7 @@ ;; definition for method 22 of type villageb-water ;; INFO: Return type mismatch ripple-wave-set vs none. -(defmethod water-vol-method-22 villageb-water ((this villageb-water)) +(defmethod water-vol-method-22 ((this villageb-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/village2/village2-part_REF.gc b/test/decompiler/reference/jak1/levels/village2/village2-part_REF.gc index 218a1ccaecb..4f85afe09e1 100644 --- a/test/decompiler/reference/jak1/levels/village2/village2-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/village2-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type villageb-part (deftype villageb-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type villageb-part -(defmethod inspect villageb-part ((this villageb-part)) +(defmethod inspect ((this villageb-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/village2/warrior_REF.gc b/test/decompiler/reference/jak1/levels/village2/warrior_REF.gc index 47fe04b0f4b..841296dd1a9 100644 --- a/test/decompiler/reference/jak1/levels/village2/warrior_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/warrior_REF.gc @@ -4,14 +4,10 @@ ;; definition of type warrior (deftype warrior (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type warrior -(defmethod inspect warrior ((this warrior)) +(defmethod inspect ((this warrior)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -27,10 +23,10 @@ ;; definition for method 52 of type warrior ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-52 warrior ((this warrior)) +(defmethod process-taskable-method-52 ((this warrior)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -45,7 +41,7 @@ ;; definition for method 48 of type warrior ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow warrior ((this warrior)) +(defmethod draw-npc-shadow ((this warrior)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -69,7 +65,7 @@ ) ;; definition for method 32 of type warrior -(defmethod play-anim! warrior ((this warrior) (arg0 symbol)) +(defmethod play-anim! ((this warrior) (arg0 symbol)) (with-pp (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) @@ -153,7 +149,7 @@ ) ;; definition for method 31 of type warrior -(defmethod get-art-elem warrior ((this warrior)) +(defmethod get-art-elem ((this warrior)) (-> this draw art-group data 5) ) @@ -167,18 +163,18 @@ ) ;; definition for method 43 of type warrior -(defmethod process-taskable-method-43 warrior ((this warrior)) +(defmethod process-taskable-method-43 ((this warrior)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 2) 61440.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.66 f0-2) - (play-ambient (-> this ambient) "WAR-LO1A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "WAR-LO1A" #f (-> this root trans)) ) ((< 0.33 f0-2) - (play-ambient (-> this ambient) "WAR-LO1B" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "WAR-LO1B" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "WAR-LO1C" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "WAR-LO1C" #f (-> this root trans)) ) ) ) @@ -187,7 +183,7 @@ ;; definition for method 41 of type warrior ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision warrior ((this warrior) (arg0 int) (arg1 vector)) +(defmethod initialize-collision ((this warrior) (arg0 int) (arg1 vector)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) @@ -215,14 +211,14 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 11 of type warrior -(defmethod init-from-entity! warrior ((this warrior) (arg0 entity-actor)) +(defmethod init-from-entity! ((this warrior) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *warrior-sg* 3 33 (new 'static 'vector :y -4096.0 :w 10240.0) 5) (set! (-> this tasks) (get-task-control (game-task village2-warrior-money))) (set! (-> this sound-flava) (music-flava warrior)) diff --git a/test/decompiler/reference/jak1/levels/village3/assistant-village3_REF.gc b/test/decompiler/reference/jak1/levels/village3/assistant-village3_REF.gc index 23196bf35e5..dabae820459 100644 --- a/test/decompiler/reference/jak1/levels/village3/assistant-village3_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/assistant-village3_REF.gc @@ -4,14 +4,10 @@ ;; definition of type assistant-villagec (deftype assistant-villagec (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type assistant-villagec -(defmethod inspect assistant-villagec ((this assistant-villagec)) +(defmethod inspect ((this assistant-villagec)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -27,10 +23,10 @@ ;; definition for method 52 of type assistant-villagec ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-52 assistant-villagec ((this assistant-villagec)) +(defmethod process-taskable-method-52 ((this assistant-villagec)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) ) @@ -45,7 +41,7 @@ ;; definition for method 48 of type assistant-villagec ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow assistant-villagec ((this assistant-villagec)) +(defmethod draw-npc-shadow ((this assistant-villagec)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -69,7 +65,7 @@ ) ;; definition for method 32 of type assistant-villagec -(defmethod play-anim! assistant-villagec ((this assistant-villagec) (arg0 symbol)) +(defmethod play-anim! ((this assistant-villagec) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk-to-assistant)) (cond ((= (get-task-status (game-task finalboss-movies)) (task-status need-introduction)) @@ -90,58 +86,58 @@ ) ;; definition for method 31 of type assistant-villagec -(defmethod get-art-elem assistant-villagec ((this assistant-villagec)) +(defmethod get-art-elem ((this assistant-villagec)) (-> this draw art-group data 3) ) ;; definition for method 39 of type assistant-villagec -(defmethod should-display? assistant-villagec ((this assistant-villagec)) +(defmethod should-display? ((this assistant-villagec)) (and (task-closed? (game-task village3-button) (task-status need-introduction)) (not (sages-kidnapped?))) ) ;; definition for method 47 of type assistant-villagec ;; INFO: Return type mismatch basic vs symbol. -(defmethod target-above-threshold? assistant-villagec ((this assistant-villagec)) +(defmethod target-above-threshold? ((this assistant-villagec)) (the-as symbol (and *target* (< (-> (target-pos 0) z) -14245888.0))) ) ;; definition for method 43 of type assistant-villagec -(defmethod process-taskable-method-43 assistant-villagec ((this assistant-villagec)) +(defmethod process-taskable-method-43 ((this assistant-villagec)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) - (play-ambient (-> this ambient) "ASSTLP31" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP31" #f (-> this root trans)) ) ((< 0.71428573 f0-2) - (play-ambient (-> this ambient) "ASSTLP32" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP32" #f (-> this root trans)) ) ((< 0.5714286 f0-2) - (play-ambient (-> this ambient) "ASSTLP33" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP33" #f (-> this root trans)) ) ((< 0.42857143 f0-2) (let ((v1-16 (get-task-status (game-task lavatube-end)))) (if (not (or (= v1-16 (task-status need-reward-speech)) (= v1-16 (task-status invalid)))) - (play-ambient (-> this ambient) "ASSTLP34" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP34" #f (-> this root trans)) ) ) ) ((< 0.2857143 f0-2) (let ((v1-21 (get-task-status (game-task lavatube-end)))) (if (not (or (= v1-21 (task-status need-reward-speech)) (= v1-21 (task-status invalid)))) - (play-ambient (-> this ambient) "ASSTLP35" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP35" #f (-> this root trans)) ) ) ) ((< 0.14285715 f0-2) (let ((v1-26 (get-task-status (game-task lavatube-end)))) (if (not (or (= v1-26 (task-status need-reward-speech)) (= v1-26 (task-status invalid)))) - (play-ambient (-> this ambient) "ASSTLP36" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP36" #f (-> this root trans)) ) ) ) ((nonzero? (get-task-status (game-task citadel-sage-green))) - (play-ambient (-> this ambient) "ASSTLP37" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "ASSTLP37" #f (-> this root trans)) ) ) ) @@ -194,7 +190,7 @@ ) ;; definition for method 11 of type assistant-villagec -(defmethod init-from-entity! assistant-villagec ((this assistant-villagec) (arg0 entity-actor)) +(defmethod init-from-entity! ((this assistant-villagec) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *assistant-village3-sg* 3 31 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task assistant-village3))) (process-taskable-method-42 this) diff --git a/test/decompiler/reference/jak1/levels/village3/minecart_REF.gc b/test/decompiler/reference/jak1/levels/village3/minecart_REF.gc index dbd678694d8..60f47887e39 100644 --- a/test/decompiler/reference/jak1/levels/village3/minecart_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/minecart_REF.gc @@ -12,22 +12,18 @@ ;; definition of type minecartsteel (deftype minecartsteel (process-drawable) - ((root-override collide-shape-moving :offset 112) - (index int32 :offset-assert 176) - (anim spool-anim :offset-assert 180) - (sync sync-info :inline :offset-assert 184) + ((root collide-shape-moving :override) + (index int32) + (anim spool-anim) + (sync sync-info :inline) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc0 - :flag-assert #x15005000c0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type minecartsteel -(defmethod inspect minecartsteel ((this minecartsteel)) +(defmethod inspect ((this minecartsteel)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -45,7 +41,7 @@ (('touch 'attack) (when (= (-> proc type) target) (let ((a2-1 (new 'stack 'collide-overlap-result))) - (if (not (on-platform (-> self root-override) (-> *target* control) a2-1)) + (if (not (on-platform (-> self root) (-> *target* control) a2-1)) (send-event proc 'no-look-around (seconds 1.5)) ) ) @@ -92,17 +88,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> self root-override) s4-0) + (set! (-> self root) s4-0) ) (process-drawable-from-entity! self arg0) (logclear! (-> self mask) (process-mask actor-pause)) - (quaternion-identity! (-> self root-override quat)) + (quaternion-identity! (-> self root quat)) (initialize-skeleton self *minecartsteel-sg* '()) (set! (-> self draw origin-joint-index) (the-as uint 3)) (logior! (-> self skel status) (janim-status inited)) (load-params! (-> self sync) self (the-as uint 9000) arg1 0.15 0.15) (set! (-> self sound) - (new 'process 'ambient-sound (static-sound-spec "v3-cartride" :fo-max 30) (-> self root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "v3-cartride" :fo-max 30) (-> self root trans)) ) (set! (-> self index) (res-lump-value arg0 'index int)) (let ((v1-33 (-> self index))) @@ -142,7 +138,7 @@ ;; definition for method 11 of type minecartsteel ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! minecartsteel ((this minecartsteel) (arg0 entity-actor)) +(defmethod init-from-entity! ((this minecartsteel) (arg0 entity-actor)) (dotimes (s4-0 4) (process-spawn minecartsteel diff --git a/test/decompiler/reference/jak1/levels/village3/miners_REF.gc b/test/decompiler/reference/jak1/levels/village3/miners_REF.gc index 74b496788be..2fcd77e2e27 100644 --- a/test/decompiler/reference/jak1/levels/village3/miners_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/miners_REF.gc @@ -22,14 +22,10 @@ ;; definition of type minertall (deftype minertall (process-taskable) () - :heap-base #x110 - :method-count-assert 53 - :size-assert #x17c - :flag-assert #x350110017c ) ;; definition for method 3 of type minertall -(defmethod inspect minertall ((this minertall)) +(defmethod inspect ((this minertall)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -45,10 +41,10 @@ ;; definition for method 52 of type minertall ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 minertall ((this minertall)) +(defmethod process-taskable-method-52 ((this minertall)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -66,7 +62,7 @@ ;; definition for method 48 of type minertall ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow minertall ((this minertall)) +(defmethod draw-npc-shadow ((this minertall)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -91,7 +87,7 @@ ;; definition for method 32 of type minertall ;; INFO: Return type mismatch art-element vs basic. -(defmethod play-anim! minertall ((this minertall) (arg0 symbol)) +(defmethod play-anim! ((this minertall) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (current-status (-> this tasks)) (if arg0 @@ -106,7 +102,7 @@ ) ;; definition for method 31 of type minertall -(defmethod get-art-elem minertall ((this minertall)) +(defmethod get-art-elem ((this minertall)) (-> this draw art-group data 3) ) @@ -121,7 +117,7 @@ ) ;; definition for method 11 of type minertall -(defmethod init-from-entity! minertall ((this minertall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this minertall) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *minertall-sg* 32 47 (new 'static 'vector :w 4096.0) 5) (set! (-> this tasks) (get-task-control (game-task village3-miner-money1))) (set! (-> this draw light-index) (the-as uint 1)) @@ -131,16 +127,12 @@ ;; definition of type minershort (deftype minershort (process-taskable) - ((other-miner minertall :offset-assert 380) + ((other-miner minertall) ) - :heap-base #x110 - :method-count-assert 53 - :size-assert #x180 - :flag-assert #x3501100180 ) ;; definition for method 3 of type minershort -(defmethod inspect minershort ((this minershort)) +(defmethod inspect ((this minershort)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -242,10 +234,10 @@ ;; definition for method 52 of type minershort ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 minershort ((this minershort)) +(defmethod process-taskable-method-52 ((this minershort)) (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> this root-override trans y))) + (let ((f0-0 (-> this root trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -263,7 +255,7 @@ ;; definition for method 48 of type minershort ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow minershort ((this minershort)) +(defmethod draw-npc-shadow ((this minershort)) (-> this draw shadow-ctrl) (cond ((and (-> this draw shadow) @@ -297,7 +289,7 @@ ) ;; definition for method 32 of type minershort -(defmethod play-anim! minershort ((this minershort) (arg0 symbol)) +(defmethod play-anim! ((this minershort) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -499,101 +491,101 @@ ) ;; definition for method 31 of type minershort -(defmethod get-art-elem minershort ((this minershort)) +(defmethod get-art-elem ((this minershort)) (-> this draw art-group data 3) ) ;; definition for method 43 of type minershort -(defmethod process-taskable-method-43 minershort ((this minershort)) +(defmethod process-taskable-method-43 ((this minershort)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.9655172 f0-2) - (play-ambient (-> this ambient) "MIN-LO01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MIN-LO01" #f (-> this root trans)) ) ((< 0.9310345 f0-2) - (play-ambient (-> this ambient) "MIN-LO03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MIN-LO03" #f (-> this root trans)) ) ((< 0.8965517 f0-2) - (play-ambient (-> this ambient) "MIN-LO04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MIN-LO04" #f (-> this root trans)) ) ((< 0.86206895 f0-2) - (play-ambient (-> this ambient) "MIN-LO05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MIN-LO05" #f (-> this root trans)) ) ((< 0.82758623 f0-2) - (play-ambient (-> this ambient) "MIN-LO06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MIN-LO06" #f (-> this root trans)) ) ((< 0.79310346 f0-2) - (play-ambient (-> this ambient) "MSH-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM01" #f (-> this root trans)) ) ((< 0.7586207 f0-2) - (play-ambient (-> this ambient) "MSH-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM02" #f (-> this root trans)) ) ((< 0.7241379 f0-2) - (play-ambient (-> this ambient) "MSH-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM03" #f (-> this root trans)) ) ((< 0.6896552 f0-2) - (play-ambient (-> this ambient) "MSH-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM04" #f (-> this root trans)) ) ((< 0.6551724 f0-2) - (play-ambient (-> this ambient) "MSH-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM05" #f (-> this root trans)) ) ((< 0.62068963 f0-2) - (play-ambient (-> this ambient) "MSH-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM06" #f (-> this root trans)) ) ((< 0.5862069 f0-2) - (play-ambient (-> this ambient) "MSH-AM07" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM07" #f (-> this root trans)) ) ((< 0.55172414 f0-2) - (play-ambient (-> this ambient) "MSH-AM08" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM08" #f (-> this root trans)) ) ((< 0.51724136 f0-2) - (play-ambient (-> this ambient) "MSH-AM09" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM09" #f (-> this root trans)) ) ((< 0.4827586 f0-2) - (play-ambient (-> this ambient) "MSH-AM10" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM10" #f (-> this root trans)) ) ((< 0.44827586 f0-2) - (play-ambient (-> this ambient) "MSH-AM11" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM11" #f (-> this root trans)) ) ((< 0.41379312 f0-2) - (play-ambient (-> this ambient) "MSH-AM12" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM12" #f (-> this root trans)) ) ((< 0.37931034 f0-2) - (play-ambient (-> this ambient) "MSH-AM1A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM1A" #f (-> this root trans)) ) ((< 0.3448276 f0-2) - (play-ambient (-> this ambient) "MSH-AM2A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM2A" #f (-> this root trans)) ) ((< 0.31034482 f0-2) - (play-ambient (-> this ambient) "MSH-AM3A" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MSH-AM3A" #f (-> this root trans)) ) ((< 0.27586207 f0-2) - (play-ambient (-> this ambient) "MTA-AM01" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM01" #f (-> this root trans)) ) ((< 0.2413793 f0-2) - (play-ambient (-> this ambient) "MTA-AM02" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM02" #f (-> this root trans)) ) ((< 0.20689656 f0-2) - (play-ambient (-> this ambient) "MTA-AM03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM03" #f (-> this root trans)) ) ((< 0.1724138 f0-2) - (play-ambient (-> this ambient) "MTA-AM04" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM04" #f (-> this root trans)) ) ((< 0.13793103 f0-2) - (play-ambient (-> this ambient) "MTA-AM05" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM05" #f (-> this root trans)) ) ((< 0.10344828 f0-2) - (play-ambient (-> this ambient) "MTA-AM06" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM06" #f (-> this root trans)) ) ((< 0.06896552 f0-2) - (play-ambient (-> this ambient) "MTA-AM07" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM07" #f (-> this root trans)) ) ((< 0.03448276 f0-2) - (play-ambient (-> this ambient) "MTA-AM08" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM08" #f (-> this root trans)) ) (else - (play-ambient (-> this ambient) "MTA-AM09" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "MTA-AM09" #f (-> this root trans)) ) ) ) @@ -607,7 +599,7 @@ ) ;; definition for method 11 of type minershort -(defmethod init-from-entity! minershort ((this minershort) (arg0 entity-actor)) +(defmethod init-from-entity! ((this minershort) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *minershort-sg* 34 46 (new 'static 'vector :w 4096.0) 5) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 566) this)) (set! (-> this tasks) (get-task-control (game-task village3-miner-money1))) @@ -622,17 +614,13 @@ ;; definition of type cavegem (deftype cavegem (process-drawable) () - :heap-base #x40 - :method-count-assert 21 - :size-assert #xb0 - :flag-assert #x15004000b0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type cavegem -(defmethod inspect cavegem ((this cavegem)) +(defmethod inspect ((this cavegem)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -662,7 +650,7 @@ ;; definition for method 11 of type cavegem ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cavegem ((this cavegem) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cavegem) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *cavegem-sg* '()) diff --git a/test/decompiler/reference/jak1/levels/village3/sage-village3_REF.gc b/test/decompiler/reference/jak1/levels/village3/sage-village3_REF.gc index 4cc56ce96df..ae55448df25 100644 --- a/test/decompiler/reference/jak1/levels/village3/sage-village3_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/sage-village3_REF.gc @@ -3,18 +3,14 @@ ;; definition of type sage-villagec (deftype sage-villagec (process-taskable) - ((evilbro handle :offset-assert 384) - (evilsis handle :offset-assert 392) - (assistant entity-actor :offset-assert 400) + ((evilbro handle) + (evilsis handle) + (assistant entity-actor) ) - :heap-base #x130 - :method-count-assert 53 - :size-assert #x194 - :flag-assert #x3501300194 ) ;; definition for method 3 of type sage-villagec -(defmethod inspect sage-villagec ((this sage-villagec)) +(defmethod inspect ((this sage-villagec)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -46,7 +42,7 @@ ) ;; definition for method 32 of type sage-villagec -(defmethod play-anim! sage-villagec ((this sage-villagec) (arg0 symbol)) +(defmethod play-anim! ((this sage-villagec) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk-to-sage)) (case (current-status (-> this tasks)) (((task-status unknown) (task-status need-hint) (task-status need-introduction)) @@ -59,17 +55,13 @@ (close-status! (-> this tasks) (task-status need-introduction)) (send-event (-> this assistant extra process) 'clone (process->handle this)) (set! (-> this evilbro) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *evilbro-village3-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *evilbro-village3-sg* #f :to this)) ) (send-event (handle->process (-> this evilbro)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this evilbro)) 'blend-shape #t) (send-event (handle->process (-> this evilbro)) 'center-joint 3) (set! (-> this evilsis) - (ppointer->handle - (manipy-spawn (-> this root-override trans) (-> this entity) *evilsis-village3-sg* #f :to this) - ) + (ppointer->handle (manipy-spawn (-> this root trans) (-> this entity) *evilsis-village3-sg* #f :to this)) ) (send-event (handle->process (-> this evilsis)) 'anim-mode 'clone-anim) (send-event (handle->process (-> this evilsis)) 'blend-shape #t) @@ -189,50 +181,50 @@ ) ;; definition for method 31 of type sage-villagec -(defmethod get-art-elem sage-villagec ((this sage-villagec)) +(defmethod get-art-elem ((this sage-villagec)) (-> this draw art-group data 3) ) ;; definition for method 47 of type sage-villagec ;; INFO: Return type mismatch basic vs symbol. -(defmethod target-above-threshold? sage-villagec ((this sage-villagec)) +(defmethod target-above-threshold? ((this sage-villagec)) (the-as symbol (and *target* (< (-> (target-pos 0) x) 4575232.0) (< -14323302.0 (-> (target-pos 0) z)))) ) ;; definition for method 43 of type sage-villagec -(defmethod process-taskable-method-43 sage-villagec ((this sage-villagec)) +(defmethod process-taskable-method-43 ((this sage-villagec)) (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.875 f0-2) - (play-ambient (-> this ambient) "SAGELP31" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP31" #f (-> this root trans)) ) ((< 0.75 f0-2) (if (not (closed? (-> this tasks) (game-task cave-dark-crystals) (task-status need-reminder))) - (play-ambient (-> this ambient) "SAGELP32" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP32" #f (-> this root trans)) ) ) ((< 0.625 f0-2) (if (nonzero? (get-task-status (game-task citadel-sage-green))) - (play-ambient (-> this ambient) "SAGELP33" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP33" #f (-> this root trans)) ) ) ((< 0.5 f0-2) - (play-ambient (-> this ambient) "SAGELP34" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP34" #f (-> this root trans)) ) ((< 0.375 f0-2) - (play-ambient (-> this ambient) "SAGELP35" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP35" #f (-> this root trans)) ) ((< 0.25 f0-2) - (play-ambient (-> this ambient) "SAGELP36" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP36" #f (-> this root trans)) ) ((< 0.125 f0-2) (if (nonzero? (get-task-status (game-task citadel-sage-green))) - (play-ambient (-> this ambient) "SAGELP37" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP37" #f (-> this root trans)) ) ) ((!= (get-task-status (game-task citadel-sage-green)) (task-status need-resolution)) - (play-ambient (-> this ambient) "SAGELP38" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "SAGELP38" #f (-> this root trans)) ) ) ) @@ -273,7 +265,7 @@ ) ;; definition for method 39 of type sage-villagec -(defmethod should-display? sage-villagec ((this sage-villagec)) +(defmethod should-display? ((this sage-villagec)) (cond ((not (closed? (-> this tasks) (game-task village3-button) (task-status need-hint))) (process-taskable-method-33 this) @@ -291,7 +283,7 @@ ;; definition for method 48 of type sage-villagec ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow sage-villagec ((this sage-villagec)) +(defmethod draw-npc-shadow ((this sage-villagec)) (let ((v1-1 (-> this draw shadow-ctrl))) (cond ((and (-> this draw shadow) @@ -317,7 +309,7 @@ ) ;; definition for method 11 of type sage-villagec -(defmethod init-from-entity! sage-villagec ((this sage-villagec) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sage-villagec) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *sage-village3-sg* 3 40 (new 'static 'vector :w 8192.0) 5) (set! (-> this tasks) (get-task-control (game-task cave-dark-crystals))) (set! (-> this assistant) (entity-actor-lookup arg0 'alt-actor 0)) diff --git a/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc b/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc index 3d6b1c78bca..d2ad88ea8a3 100644 --- a/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc @@ -32,14 +32,10 @@ ;; definition of type villagec-lava (deftype villagec-lava (water-anim) () - :heap-base #x70 - :method-count-assert 30 - :size-assert #xdc - :flag-assert #x1e007000dc ) ;; definition for method 3 of type villagec-lava -(defmethod inspect villagec-lava ((this villagec-lava)) +(defmethod inspect ((this villagec-lava)) (let ((t9-0 (method-of-type water-anim inspect))) (t9-0 this) ) @@ -61,7 +57,7 @@ ;; definition for method 22 of type villagec-lava ;; INFO: Return type mismatch symbol vs none. -(defmethod water-vol-method-22 villagec-lava ((this villagec-lava)) +(defmethod water-vol-method-22 ((this villagec-lava)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) (t9-0 this) ) @@ -78,23 +74,19 @@ ;; definition of type gondola (deftype gondola (process-drawable) - ((root-override collide-shape-moving :offset 112) - (anim spool-anim :offset-assert 176) - (old-target-pos transformq :inline :offset-assert 192) + ((root collide-shape-moving :override) + (anim spool-anim) + (old-target-pos transformq :inline) ) - :heap-base #x80 - :method-count-assert 23 - :size-assert #xf0 - :flag-assert #x17008000f0 - (:methods - (idle (symbol) _type_ :state 20) - (ride-up () _type_ :state 21) - (ride-down () _type_ :state 22) + (:state-methods + (idle symbol) + ride-up + ride-down ) ) ;; definition for method 3 of type gondola -(defmethod inspect gondola ((this gondola)) +(defmethod inspect ((this gondola)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -280,7 +272,7 @@ (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) (send-event *target* 'trans 'restore (-> self old-target-pos)) (send-event *target* 'end-mode) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) (logior! (-> *target* control status) (cshape-moving-flags onsurf onground tsurf)) (suspend) @@ -322,7 +314,7 @@ (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) (send-event *target* 'trans 'restore (-> self old-target-pos)) (send-event *target* 'end-mode) - (update-transforms! (-> self root-override)) + (update-transforms! (-> self root)) (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) (logior! (-> *target* control status) (cshape-moving-flags onsurf onground tsurf)) (suspend) @@ -339,7 +331,7 @@ ;; definition for method 11 of type gondola ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! gondola ((this gondola) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gondola) (arg0 entity-actor)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -359,10 +351,10 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> this root-override) s4-0) + (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (quaternion-identity! (-> this root-override quat)) + (quaternion-identity! (-> this root quat)) (initialize-skeleton this *gondola-sg* '()) (set! (-> this draw origin-joint-index) (the-as uint 3)) (logclear! (-> this mask) (process-mask actor-pause)) @@ -382,7 +374,7 @@ ) ) (cond - ((< (-> (target-pos 0) y) (+ 204800.0 (-> this root-override trans y))) + ((< (-> (target-pos 0) y) (+ 204800.0 (-> this root trans y))) (go (method-of-object this idle) #f) ) (else @@ -396,18 +388,14 @@ ;; definition of type pistons (deftype pistons (process-drawable) () - :heap-base #x40 - :method-count-assert 22 - :size-assert #xb0 - :flag-assert #x16004000b0 - (:methods - (idle () _type_ :state 20) - (active (handle symbol) _type_ :state 21) + (:state-methods + idle + (active handle symbol) ) ) ;; definition for method 3 of type pistons -(defmethod inspect pistons ((this pistons)) +(defmethod inspect ((this pistons)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -445,7 +433,7 @@ ;; definition for method 11 of type pistons ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! pistons ((this pistons) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pistons) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *pistons-sg* '()) @@ -462,17 +450,13 @@ ;; definition of type gondolacables (deftype gondolacables (process-drawable) () - :heap-base #x40 - :method-count-assert 21 - :size-assert #xb0 - :flag-assert #x15004000b0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type gondolacables -(defmethod inspect gondolacables ((this gondolacables)) +(defmethod inspect ((this gondolacables)) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) @@ -513,7 +497,7 @@ ;; definition for method 11 of type gondolacables ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! gondolacables ((this gondolacables) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gondolacables) (arg0 entity-actor)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this *gondolacables-sg* '()) diff --git a/test/decompiler/reference/jak1/levels/village3/village3-part_REF.gc b/test/decompiler/reference/jak1/levels/village3/village3-part_REF.gc index beedf1cff6f..d128b73cfe4 100644 --- a/test/decompiler/reference/jak1/levels/village3/village3-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/village3-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type villagec-part (deftype villagec-part (part-spawner) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15006000d0 ) ;; definition for method 3 of type villagec-part -(defmethod inspect villagec-part ((this villagec-part)) +(defmethod inspect ((this villagec-part)) (let ((t9-0 (method-of-type part-spawner inspect))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak1/levels/village_common/oracle_REF.gc b/test/decompiler/reference/jak1/levels/village_common/oracle_REF.gc index df062be3297..d6521aaf192 100644 --- a/test/decompiler/reference/jak1/levels/village_common/oracle_REF.gc +++ b/test/decompiler/reference/jak1/levels/village_common/oracle_REF.gc @@ -3,19 +3,15 @@ ;; definition of type oracle (deftype oracle (process-taskable) - ((first-task uint8 :offset-assert 380) - (second-task uint8 :offset-assert 381) - (left-eye-cell handle :offset-assert 384) - (right-eye-cell handle :offset-assert 392) + ((first-task uint8) + (second-task uint8) + (left-eye-cell handle) + (right-eye-cell handle) ) - :heap-base #x120 - :method-count-assert 53 - :size-assert #x190 - :flag-assert #x3501200190 ) ;; definition for method 3 of type oracle -(defmethod inspect oracle ((this oracle)) +(defmethod inspect ((this oracle)) (let ((t9-0 (method-of-type process-taskable inspect))) (t9-0 this) ) @@ -33,7 +29,7 @@ ) ;; definition for method 32 of type oracle -(defmethod play-anim! oracle ((this oracle) (arg0 symbol)) +(defmethod play-anim! ((this oracle) (arg0 symbol)) (set! (-> this talk-message) (text-id press-to-talk)) (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) @@ -226,7 +222,7 @@ ) ;; definition for method 31 of type oracle -(defmethod get-art-elem oracle ((this oracle)) +(defmethod get-art-elem ((this oracle)) (-> this draw art-group data 2) ) @@ -244,10 +240,10 @@ ) ;; definition for method 11 of type oracle -(defmethod init-from-entity! oracle ((this oracle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this oracle) (arg0 entity-actor)) (process-taskable-method-40 this arg0 *oracle-sg* 3 4 (new 'static 'vector :y -4096.0 :w 4096.0) -1) (set! (-> this sound) - (new 'process 'ambient-sound (static-sound-spec "oracle-sleep" :fo-max 50) (-> this root-override trans)) + (new 'process 'ambient-sound (static-sound-spec "oracle-sleep" :fo-max 50) (-> this root trans)) ) (set! (-> this first-task) (the-as uint (-> arg0 extra perm task))) (set! (-> this second-task) (res-lump-value arg0 'alt-task uint)) @@ -258,14 +254,14 @@ (let ((s4-0 (new 'stack-no-clear 'vector)) (s5-1 (lambda :behavior oracle () - (let* ((gp-0 (-> self root-override)) + (let* ((gp-0 (-> self root)) (v1-1 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) collide-shape)) gp-0 ) ) (a1-1 (if v1-1 (-> v1-1 root-prim prim-core) - (-> self root-override trans) + (-> self root trans) ) ) ) diff --git a/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc b/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc index 2d62230ae72..5c21dc9e4a5 100644 --- a/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc @@ -4,13 +4,10 @@ ;; definition of type warpgate (deftype warpgate (process-hidden) () - :method-count-assert 15 - :size-assert #x70 - :flag-assert #xf00000070 ) ;; definition for method 3 of type warpgate -(defmethod inspect warpgate ((this warpgate)) +(defmethod inspect ((this warpgate)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tmask: ~D~%" (-> this mask)) @@ -477,19 +474,15 @@ ;; definition of type warp-gate-switch (deftype warp-gate-switch (basebutton) - ((warp handle :offset-assert 256) + ((warp handle) ) - :heap-base #xa0 - :method-count-assert 33 - :size-assert #x108 - :flag-assert #x2100a00108 (:methods - (pressable? (_type_) symbol 32) + (pressable? (_type_) symbol) ) ) ;; definition for method 3 of type warp-gate-switch -(defmethod inspect warp-gate-switch ((this warp-gate-switch)) +(defmethod inspect ((this warp-gate-switch)) (let ((t9-0 (method-of-type basebutton inspect))) (t9-0 this) ) @@ -504,7 +497,7 @@ ) ;; definition for method 27 of type warp-gate-switch -(defmethod basebutton-method-27 warp-gate-switch ((this warp-gate-switch)) +(defmethod basebutton-method-27 ((this warp-gate-switch)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) @@ -530,13 +523,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> this root-override) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) ;; definition for method 32 of type warp-gate-switch -(defmethod pressable? warp-gate-switch ((this warp-gate-switch)) +(defmethod pressable? ((this warp-gate-switch)) (let ((v1-2 (-> this entity extra perm task))) (cond ((logtest? (-> *target* control root-prim prim-core action) @@ -573,7 +566,7 @@ ) ;; definition for method 26 of type warp-gate-switch -(defmethod basebutton-method-26 warp-gate-switch ((this warp-gate-switch)) +(defmethod basebutton-method-26 ((this warp-gate-switch)) (set! (-> this warp) (the-as handle #f)) (let ((v1-2 (-> this entity extra perm task))) (cond @@ -620,13 +613,13 @@ ) ) (set! (-> this anim-speed) 2.0) - (update-transforms! (-> this root-override)) + (update-transforms! (-> this root)) (ja-post) (none) ) ;; definition for method 31 of type warp-gate-switch -(defmethod press! warp-gate-switch ((this warp-gate-switch) (arg0 symbol)) +(defmethod press! ((this warp-gate-switch) (arg0 symbol)) (with-pp (when arg0 (let ((s4-0 (-> this entity extra perm task))) @@ -896,22 +889,18 @@ ;; definition of type village-cam (deftype village-cam (process) - ((root-override trsq :offset-assert 112) - (range meters :offset-assert 116) - (index int32 :offset-assert 120) - (state-time time-frame :offset-assert 128) + ((root-override trsq) + (range meters) + (index int32) + (state-time time-frame) ) - :heap-base #x20 - :method-count-assert 15 - :size-assert #x88 - :flag-assert #xf00200088 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) ;; definition for method 3 of type village-cam -(defmethod inspect village-cam ((this village-cam)) +(defmethod inspect ((this village-cam)) (let ((t9-0 (method-of-type process inspect))) (t9-0 this) ) @@ -924,7 +913,7 @@ ;; definition for method 7 of type village-cam ;; INFO: Return type mismatch process vs village-cam. -(defmethod relocate village-cam ((this village-cam) (arg0 int)) +(defmethod relocate ((this village-cam) (arg0 int)) (if (nonzero? (-> this root-override)) (&+! (-> this root-override) arg0) ) @@ -1183,7 +1172,7 @@ ;; definition for method 11 of type village-cam ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! village-cam ((this village-cam) (arg0 entity-actor)) +(defmethod init-from-entity! ((this village-cam) (arg0 entity-actor)) "Copy defaults from the entity." (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this root-override) (new 'process 'trsq)) diff --git a/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc b/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc index 6d175f0132f..1241c56dfee 100644 --- a/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc @@ -3,20 +3,17 @@ ;; definition of type enemy-focus (deftype enemy-focus (focus) - ((aware enemy-aware :offset-assert 16) - (flags enemy-flag :offset-assert 24) + ((aware enemy-aware) + (flags enemy-flag) ) - :method-count-assert 14 - :size-assert #x20 - :flag-assert #xe00000020 (:methods - (try-update-focus (_type_ process-focusable enemy) symbol :replace 12) - (enemy-focus-method-13 (_type_ process-focusable enemy-aware) symbol 13) + (try-update-focus (_type_ process-focusable enemy) symbol :replace) + (enemy-focus-method-13 (_type_ process-focusable enemy-aware) symbol) ) ) ;; definition for method 3 of type enemy-focus -(defmethod inspect enemy-focus ((this enemy-focus)) +(defmethod inspect ((this enemy-focus)) (when (not this) (set! this this) (goto cfg-4) @@ -32,99 +29,96 @@ ;; definition of type enemy-info (deftype enemy-info (basic) - ((fact-defaults fact-info-enemy-defaults :offset-assert 4) - (use-die-falling symbol :offset-assert 8) - (use-victory symbol :offset-assert 12) - (use-jump-blocked symbol :offset-assert 16) - (debug-draw-neck symbol :offset-assert 20) - (jump-debug-draw symbol :offset-assert 24) - (move-to-ground symbol :offset-assert 28) - (hover-if-no-ground symbol :offset-assert 32) - (idle-anim-script (pointer idle-control-frame) :offset-assert 36) - (idle-anim int32 :offset-assert 40) - (notice-anim int32 :offset-assert 44) - (hostile-anim int32 :offset-assert 48) - (hit-anim int32 :offset-assert 52) - (knocked-anim int32 :offset-assert 56) - (knocked-land-anim int32 :offset-assert 60) - (die-anim int32 :offset-assert 64) - (die-falling-anim int32 :offset-assert 68) - (victory-anim int32 :offset-assert 72) - (jump-wind-up-anim int32 :offset-assert 76) - (jump-in-air-anim int32 :offset-assert 80) - (jump-land-anim int32 :offset-assert 84) - (neck-joint int32 :offset-assert 88) - (look-at-joint int32 :offset-assert 92) - (bullseye-joint int32 :offset-assert 96) - (sound-hit sound-name :offset-assert 112) - (sound-die sound-name :offset-assert 128) - (notice-distance meters :offset-assert 144) - (notice-distance-delta meters :offset-assert 148) - (proximity-notice-distance meters :offset-assert 152) - (default-hit-points int32 :offset-assert 156) - (gnd-collide-with collide-spec :offset-assert 160) - (overlaps-others-collide-with-filter collide-spec :offset-assert 164) - (penetrate-flinch penetrate :offset-assert 168) - (penetrate-knocked penetrate :offset-assert 176) - (movement-gravity meters :offset-assert 184) - (friction float :offset-assert 188) - (slip-factor float :offset-assert 192) - (attack-shove-back meters :offset-assert 196) - (attack-shove-up meters :offset-assert 200) - (attack-mode symbol :offset-assert 204) - (attack-damage int32 :offset-assert 208) - (recover-gnd-collide-with collide-spec :offset-assert 212) - (jump-height-min meters :offset-assert 216) - (jump-height-factor float :offset-assert 220) - (knocked-seek-ry-clamp float :offset-assert 224) - (knocked-soft-vxz-lo float :offset-assert 228) - (knocked-soft-vxz-hi float :offset-assert 232) - (knocked-soft-vy-lo float :offset-assert 236) - (knocked-soft-vy-hi float :offset-assert 240) - (knocked-medium-vxz-lo float :offset-assert 244) - (knocked-medium-vxz-hi float :offset-assert 248) - (knocked-medium-vy-lo float :offset-assert 252) - (knocked-medium-vy-hi float :offset-assert 256) - (knocked-hard-vxz-lo float :offset-assert 260) - (knocked-hard-vxz-hi float :offset-assert 264) - (knocked-hard-vy-lo float :offset-assert 268) - (knocked-hard-vy-hi float :offset-assert 272) - (knocked-huge-vxz-lo float :offset-assert 276) - (knocked-huge-vxz-hi float :offset-assert 280) - (knocked-huge-vy-lo float :offset-assert 284) - (knocked-huge-vy-hi float :offset-assert 288) - (knocked-yellow-vxz-lo float :offset-assert 292) - (knocked-yellow-vxz-hi float :offset-assert 296) - (knocked-yellow-vy-lo float :offset-assert 300) - (knocked-yellow-vy-hi float :offset-assert 304) - (knocked-red-vxz-lo float :offset-assert 308) - (knocked-red-vxz-hi float :offset-assert 312) - (knocked-red-vy-lo float :offset-assert 316) - (knocked-red-vy-hi float :offset-assert 320) - (knocked-blue-vxz-lo float :offset-assert 324) - (knocked-blue-vxz-hi float :offset-assert 328) - (knocked-blue-vy-lo float :offset-assert 332) - (knocked-blue-vy-hi float :offset-assert 336) - (shadow-size meters :offset-assert 340) - (shadow-max-y meters :offset-assert 344) - (shadow-min-y meters :offset-assert 348) - (shadow-locus-dist meters :offset-assert 352) - (gem-joint int32 :offset-assert 356) - (gem-seg uint32 :offset-assert 360) - (gem-no-seg uint32 :offset-assert 364) - (gem-offset sphere :inline :offset-assert 368) + ((fact-defaults fact-info-enemy-defaults) + (use-die-falling symbol) + (use-victory symbol) + (use-jump-blocked symbol) + (debug-draw-neck symbol) + (jump-debug-draw symbol) + (move-to-ground symbol) + (hover-if-no-ground symbol) + (idle-anim-script (pointer idle-control-frame)) + (idle-anim int32) + (notice-anim int32) + (hostile-anim int32) + (hit-anim int32) + (knocked-anim int32) + (knocked-land-anim int32) + (die-anim int32) + (die-falling-anim int32) + (victory-anim int32) + (jump-wind-up-anim int32) + (jump-in-air-anim int32) + (jump-land-anim int32) + (neck-joint int32) + (look-at-joint int32) + (bullseye-joint int32) + (sound-hit sound-name) + (sound-die sound-name) + (notice-distance meters) + (notice-distance-delta meters) + (proximity-notice-distance meters) + (default-hit-points int32) + (gnd-collide-with collide-spec) + (overlaps-others-collide-with-filter collide-spec) + (penetrate-flinch penetrate) + (penetrate-knocked penetrate) + (movement-gravity meters) + (friction float) + (slip-factor float) + (attack-shove-back meters) + (attack-shove-up meters) + (attack-mode symbol) + (attack-damage int32) + (recover-gnd-collide-with collide-spec) + (jump-height-min meters) + (jump-height-factor float) + (knocked-seek-ry-clamp float) + (knocked-soft-vxz-lo float) + (knocked-soft-vxz-hi float) + (knocked-soft-vy-lo float) + (knocked-soft-vy-hi float) + (knocked-medium-vxz-lo float) + (knocked-medium-vxz-hi float) + (knocked-medium-vy-lo float) + (knocked-medium-vy-hi float) + (knocked-hard-vxz-lo float) + (knocked-hard-vxz-hi float) + (knocked-hard-vy-lo float) + (knocked-hard-vy-hi float) + (knocked-huge-vxz-lo float) + (knocked-huge-vxz-hi float) + (knocked-huge-vy-lo float) + (knocked-huge-vy-hi float) + (knocked-yellow-vxz-lo float) + (knocked-yellow-vxz-hi float) + (knocked-yellow-vy-lo float) + (knocked-yellow-vy-hi float) + (knocked-red-vxz-lo float) + (knocked-red-vxz-hi float) + (knocked-red-vy-lo float) + (knocked-red-vy-hi float) + (knocked-blue-vxz-lo float) + (knocked-blue-vxz-hi float) + (knocked-blue-vy-lo float) + (knocked-blue-vy-hi float) + (shadow-size meters) + (shadow-max-y meters) + (shadow-min-y meters) + (shadow-locus-dist meters) + (gem-joint int32) + (gem-seg uint32) + (gem-no-seg uint32) + (gem-offset sphere :inline) ) - :method-count-assert 10 - :size-assert #x180 - :flag-assert #xa00000180 (:methods - (copy-enemy-info! (_type_ _type_) none 9) + (copy-enemy-info! (_type_ _type_) none) ) ) ;; definition for method 3 of type enemy-info ;; INFO: Used lq/sq -(defmethod inspect enemy-info ((this enemy-info)) +(defmethod inspect ((this enemy-info)) (when (not this) (set! this this) (goto cfg-4) @@ -217,18 +211,15 @@ ;; definition of type enemy-knocked-info (deftype enemy-knocked-info (structure) - ((anim-speed float :offset-assert 0) - (on-surface-count int32 :offset-assert 4) - (move-count int32 :offset-assert 8) - (land-can-land-time time-frame :offset-assert 16) + ((anim-speed float) + (on-surface-count int32) + (move-count int32) + (land-can-land-time time-frame) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type enemy-knocked-info -(defmethod inspect enemy-knocked-info ((this enemy-knocked-info)) +(defmethod inspect ((this enemy-knocked-info)) (when (not this) (set! this this) (goto cfg-4) @@ -244,20 +235,17 @@ ;; definition of type enemy-jump-info (deftype enemy-jump-info (structure) - ((flags uint8 :offset-assert 0) - (anim-speed float :offset-assert 4) - (hang-time time-frame :offset-assert 8) - (start-pos vector :inline :offset-assert 16) - (dest-pos vector :inline :offset-assert 32) - (traj trajectory :inline :offset-assert 48) + ((flags uint8) + (anim-speed float) + (hang-time time-frame) + (start-pos vector :inline) + (dest-pos vector :inline) + (traj trajectory :inline) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) ;; definition for method 3 of type enemy-jump-info -(defmethod inspect enemy-jump-info ((this enemy-jump-info)) +(defmethod inspect ((this enemy-jump-info)) (when (not this) (set! this this) (goto cfg-4) @@ -275,19 +263,16 @@ ;; definition of type enemy-init-by-other-params (deftype enemy-init-by-other-params (structure) - ((trans vector :inline :offset-assert 0) - (quat quaternion :inline :offset-assert 16) - (entity entity :offset-assert 32) - (directed? symbol :offset-assert 36) - (no-initial-move-to-ground? symbol :offset-assert 40) + ((trans vector :inline) + (quat quaternion :inline) + (entity entity) + (directed? symbol) + (no-initial-move-to-ground? symbol) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type enemy-init-by-other-params -(defmethod inspect enemy-init-by-other-params ((this enemy-init-by-other-params)) +(defmethod inspect ((this enemy-init-by-other-params)) (when (not this) (set! this this) (goto cfg-4) @@ -304,22 +289,19 @@ ;; definition of type enemy-attack-info (deftype enemy-attack-info (structure) - ((attack-id uint32 :offset-assert 0) - (knocked-type knocked-type :offset-assert 4) - (blue-juggle-count uint8 :offset-assert 5) - (attacker-handle handle :offset-assert 8) - (attack-time time-frame :offset-assert 16) - (penetrate-using uint64 :offset-assert 24) - (attacker-pos vector :inline :offset-assert 32) - (attack-direction vector :inline :offset-assert 48) + ((attack-id uint32) + (knocked-type knocked-type) + (blue-juggle-count uint8) + (attacker-handle handle) + (attack-time time-frame) + (penetrate-using uint64) + (attacker-pos vector :inline) + (attack-direction vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type enemy-attack-info -(defmethod inspect enemy-attack-info ((this enemy-attack-info)) +(defmethod inspect ((this enemy-attack-info)) (when (not this) (set! this this) (goto cfg-4) @@ -339,17 +321,14 @@ ;; definition of type enemy-best-focus (deftype enemy-best-focus (structure) - ((proc process :offset-assert 0) - (rating float :offset-assert 4) - (aware enemy-aware :offset-assert 8) + ((proc process) + (rating float) + (aware enemy-aware) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type enemy-best-focus -(defmethod inspect enemy-best-focus ((this enemy-best-focus)) +(defmethod inspect ((this enemy-best-focus)) (when (not this) (set! this this) (goto cfg-4) @@ -364,164 +343,162 @@ ;; definition of type enemy (deftype enemy (process-focusable) - ((root collide-shape-moving :override) - (fact fact-info-enemy :override) - (enemy-flags enemy-flag :offset-assert 208) - (enemy-info enemy-info :offset-assert 216) - (hit-points int32 :offset-assert 220) - (gnd-collide uint32 :offset-assert 224) - (attack-id uint32 :offset-assert 228) - (persistent-attack-id uint32 :offset-assert 232) - (water-max-height meters :offset-assert 236) - (water-surface-height meters :offset-assert 240) - (desired-angle degrees :offset-assert 244) - (jump-why uint64 :offset-assert 248) - (penetrated-by-all penetrate :offset-assert 256) - (penetrated-flinch penetrate :offset-assert 264) - (penetrated-knocked penetrate :offset-assert 272) - (reaction-time time-frame :offset-assert 280) - (notice-time time-frame :offset-assert 288) - (state-timeout time-frame :offset-assert 296) - (auto-reset-penetrate-time time-frame :offset-assert 304) - (hit-focus-time time-frame :offset-assert 312) - (last-draw-time time-frame :offset-assert 320) - (starting-time time-frame :offset-assert 328) - (fated-time time-frame :offset-assert 336) - (focus-pos vector :inline :offset-assert 352) - (event-param-point vector :inline :offset-assert 368) - (jump-dest vector :inline :offset 368) - (focus enemy-focus :inline :offset-assert 384) - (incoming enemy-attack-info :inline :offset-assert 416) - (actor-group (pointer actor-group) :offset-assert 480) - (actor-group-count int32 :offset-assert 484) - (neck joint-mod :offset-assert 488) - (on-notice symbol :offset-assert 492) - (on-active symbol :offset-assert 496) - (on-hostile symbol :offset-assert 500) - (on-death symbol :offset-assert 504) - (idle-anim-player idle-control :inline :offset-assert 512) - (rand-gen symbol :offset-assert 528) + ((root collide-shape-moving :override) + (fact fact-info-enemy :override) + (enemy-flags enemy-flag) + (enemy-info enemy-info) + (hit-points int32) + (gnd-collide uint32) + (attack-id uint32) + (persistent-attack-id uint32) + (water-max-height meters) + (water-surface-height meters) + (desired-angle degrees) + (jump-why uint64) + (penetrated-by-all penetrate) + (penetrated-flinch penetrate) + (penetrated-knocked penetrate) + (reaction-time time-frame) + (notice-time time-frame) + (state-timeout time-frame) + (auto-reset-penetrate-time time-frame) + (hit-focus-time time-frame) + (last-draw-time time-frame) + (starting-time time-frame) + (fated-time time-frame) + (focus-pos vector :inline) + (event-param-point vector :inline) + (jump-dest vector :inline :overlay-at event-param-point) + (focus enemy-focus :inline) + (incoming enemy-attack-info :inline) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (neck joint-mod) + (on-notice symbol) + (on-active symbol) + (on-hostile symbol) + (on-death symbol) + (idle-anim-player idle-control :inline) + (rand-gen symbol) ) - :heap-base #x1a0 - :method-count-assert 137 - :size-assert #x214 - :flag-assert #x8901a00214 + (:state-methods + dormant + dormant-aware + hit + knocked + idle + active + notice + flee + stare + hostile + victory + die + die-falling + die-fast + directed + jump + jump-blocked + ambush + view-anims + ) (:methods - (dormant () _type_ :state 27) - (dormant-aware () _type_ :state 28) - (hit () _type_ :state 29) - (knocked () _type_ :state 30) - (idle () _type_ :state 31) - (active () _type_ :state 32) - (notice () _type_ :state 33) - (flee () _type_ :state 34) - (stare () _type_ :state 35) - (hostile () _type_ :state 36) - (victory () _type_ :state 37) - (die () _type_ :state 38) - (die-falling () _type_ :state 39) - (die-fast () _type_ :state 40) - (directed () _type_ :state 41) - (jump () _type_ :state 42) - (jump-blocked () _type_ :state 43) - (ambush () _type_ :state 44) - (view-anims () _type_ :state 45) - (enemy-method-46 (_type_ int) none 46) - (enemy-method-47 (_type_ vector) float 47) - (take-damage-from-attack (_type_ process event-message-block) int 48) - (enemy-method-49 (_type_) time-frame :behavior enemy 49) - (enemy-method-50 (_type_ vector) vector 50) - (enemy-method-51 (_type_) float 51) - (enemy-method-52 (_type_ vector) none 52) - (enemy-method-53 (_type_ process-focusable) symbol 53) - (enemy-method-54 (_type_) enemy-flag 54) - (track-target! (_type_) none 55) - (damage-amount-from-attack (_type_ process event-message-block) int 56) - (update-target-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware 57) - (enemy-method-58 (_type_ process event-message-block) symbol 58) - (get-penetrate-info (_type_) penetrate 59) - (coin-flip? (_type_) symbol 60) - (enemy-method-61 (_type_ int) int :behavior enemy 61) - (enemy-method-62 (_type_) none 62) - (enemy-method-63 (_type_ process-focusable enemy-aware) symbol 63) - (enemy-method-64 (_type_) none 64) - (enemy-method-65 (_type_) none 65) - (go-ambush (_type_) object 66) - (go-stare (_type_) object 67) - (go-stare2 (_type_) object 68) - (go-directed (_type_) object 69) - (go-hostile (_type_) object 70) - (go-flee (_type_) object 71) - (react-to-focus (_type_) object 72) - (kill-prefer-falling (_type_) object 73) - (general-event-handler (_type_ process int symbol event-message-block) object 74) - (enemy-method-75 (_type_ process event-message-block) object 75) - (enemy-method-76 (_type_ process event-message-block) symbol 76) - (enemy-method-77 (_type_ (pointer float)) symbol 77) - (enemy-method-78 (_type_ (pointer float)) symbol 78) - (enemy-method-79 (_type_ int enemy-knocked-info) symbol 79) - (enemy-method-80 (_type_ enemy-knocked-info) symbol 80) - (enemy-method-81 (_type_) symbol 81) - (enemy-method-82 (_type_ enemy-jump-info) symbol 82) - (enemy-method-83 (_type_ enemy-jump-info) none 83) - (enemy-method-84 (_type_ enemy-jump-info) none 84) - (enemy-method-85 (_type_) float 85) - (enemy-method-86 (_type_) symbol 86) - (enemy-method-87 (_type_ enemy-jump-info) symbol 87) - (enemy-method-88 (_type_ enemy-jump-info) symbol 88) - (enemy-method-89 (_type_ enemy-jump-info) symbol 89) - (enemy-method-90 (_type_ int enemy-jump-info) symbol 90) - (enemy-method-91 (_type_ int enemy-jump-info) none 91) - (enemy-method-92 (_type_ int nav-poly) none 92) - (enemy-method-93 (_type_) none 93) - (enemy-method-94 (_type_ vector float) symbol 94) - (enemy-method-95 (_type_ vector float) symbol 95) - (enemy-method-96 (_type_ float symbol) symbol 96) - (enemy-method-97 (_type_) process 97) - (in-aggro-range? (_type_ process-focusable vector) symbol 98) - (enemy-method-99 (_type_ process-focusable) symbol 99) - (enemy-method-100 (_type_) symbol 100) - (enemy-method-101 (_type_) none 101) - (enemy-method-102 (_type_) symbol 102) - (enemy-method-103 (_type_) collide-spec 103) - (enemy-method-104 (_type_ process touching-shapes-entry uint) symbol :behavior process 104) - (enemy-method-105 (_type_ process) enemy-flag 105) - (enemy-method-106 (_type_ process object int attack-info) none :behavior enemy 106) - (get-enemy-target (_type_) process-focusable 107) - (enemy-method-108 (_type_ enemy event-message-block) int 108) - (look-at-target! (_type_ enemy-flag) none 109) - (stop-looking-at-target! (_type_) none 110) - (enemy-method-111 (_type_) none :behavior enemy 111) - (set-enemy-info! (_type_ enemy-info) none 112) - (init-enemy-behaviour-and-stats! (_type_ enemy-info) none 113) - (init-enemy-collision! (_type_) none 114) - (init-enemy! (_type_) none 115) - (go-idle (_type_) none 116) - (get-rand-float (_type_) float 117) - (get-rand-float-range (_type_ float float) float 118) - (get-rand-int (_type_ int) int 119) - (enemy-method-120 (_type_ int int) int 120) - (get-rand-int-range (_type_ int int) int 121) - (rng-hit? (_type_ float) symbol 122) - (enemy-method-123 (_type_ float) symbol 123) - (enemy-method-124 (_type_) collide-spec 124) - (enemy-method-125 (_type_ collide-query collide-spec float float float) pat-surface 125) - (enemy-above-ground? (_type_ collide-query vector collide-spec float float float) symbol 126) - (enemy-method-127 (_type_ float float symbol collide-spec) symbol 127) - (enemy-method-128 (_type_ vector move-above-ground-params) none 128) - (enemy-method-129 (_type_) none 129) - (enemy-method-130 (_type_ float) symbol 130) - (enemy-method-131 (_type_ int) uint 131) - (dispose! (_type_) none 132) - (enemy-method-133 (_type_) symbol 133) - (enemy-method-134 (_type_ process attack-info) process-focusable 134) - (enemy-method-135 (_type_ int) sound-id 135) - (enemy-method-136 (_type_) enemy-flag 136) + (enemy-method-46 (_type_ int) none) + (enemy-method-47 (_type_ vector) float) + (take-damage-from-attack (_type_ process event-message-block) int) + (enemy-method-49 (_type_) time-frame :behavior enemy) + (enemy-method-50 (_type_ vector) vector) + (enemy-method-51 (_type_) float) + (enemy-method-52 (_type_ vector) none) + (enemy-method-53 (_type_ process-focusable) symbol) + (enemy-method-54 (_type_) enemy-flag) + (track-target! (_type_) none) + (damage-amount-from-attack (_type_ process event-message-block) int) + (update-target-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware) + (enemy-method-58 (_type_ process event-message-block) symbol) + (get-penetrate-info (_type_) penetrate) + (coin-flip? (_type_) symbol) + (enemy-method-61 (_type_ int) int :behavior enemy) + (enemy-method-62 (_type_) none) + (enemy-method-63 (_type_ process-focusable enemy-aware) symbol) + (enemy-method-64 (_type_) none) + (enemy-method-65 (_type_) none) + (go-ambush (_type_) object) + (go-stare (_type_) object) + (go-stare2 (_type_) object) + (go-directed (_type_) object) + (go-hostile (_type_) object) + (go-flee (_type_) object) + (react-to-focus (_type_) object) + (kill-prefer-falling (_type_) object) + (general-event-handler (_type_ process int symbol event-message-block) object) + (enemy-method-75 (_type_ process event-message-block) object) + (enemy-method-76 (_type_ process event-message-block) symbol) + (enemy-method-77 (_type_ (pointer float)) symbol) + (enemy-method-78 (_type_ (pointer float)) symbol) + (enemy-method-79 (_type_ int enemy-knocked-info) symbol) + (enemy-method-80 (_type_ enemy-knocked-info) symbol) + (enemy-method-81 (_type_) symbol) + (enemy-method-82 (_type_ enemy-jump-info) symbol) + (enemy-method-83 (_type_ enemy-jump-info) none) + (enemy-method-84 (_type_ enemy-jump-info) none) + (enemy-method-85 (_type_) float) + (enemy-method-86 (_type_) symbol) + (enemy-method-87 (_type_ enemy-jump-info) symbol) + (enemy-method-88 (_type_ enemy-jump-info) symbol) + (enemy-method-89 (_type_ enemy-jump-info) symbol) + (enemy-method-90 (_type_ int enemy-jump-info) symbol) + (enemy-method-91 (_type_ int enemy-jump-info) none) + (enemy-method-92 (_type_ int nav-poly) none) + (enemy-method-93 (_type_) none) + (enemy-method-94 (_type_ vector float) symbol) + (enemy-method-95 (_type_ vector float) symbol) + (enemy-method-96 (_type_ float symbol) symbol) + (enemy-method-97 (_type_) process) + (in-aggro-range? (_type_ process-focusable vector) symbol) + (enemy-method-99 (_type_ process-focusable) symbol) + (enemy-method-100 (_type_) symbol) + (enemy-method-101 (_type_) none) + (enemy-method-102 (_type_) symbol) + (enemy-method-103 (_type_) collide-spec) + (enemy-method-104 (_type_ process touching-shapes-entry uint) symbol :behavior process) + (enemy-method-105 (_type_ process) enemy-flag) + (enemy-method-106 (_type_ process object int attack-info) none :behavior enemy) + (get-enemy-target (_type_) process-focusable) + (enemy-method-108 (_type_ enemy event-message-block) int) + (look-at-target! (_type_ enemy-flag) none) + (stop-looking-at-target! (_type_) none) + (enemy-method-111 (_type_) none :behavior enemy) + (set-enemy-info! (_type_ enemy-info) none) + (init-enemy-behaviour-and-stats! (_type_ enemy-info) none) + (init-enemy-collision! (_type_) none) + (init-enemy! (_type_) none) + (go-idle (_type_) none) + (get-rand-float (_type_) float) + (get-rand-float-range (_type_ float float) float) + (get-rand-int (_type_ int) int) + (enemy-method-120 (_type_ int int) int) + (get-rand-int-range (_type_ int int) int) + (rng-hit? (_type_ float) symbol) + (enemy-method-123 (_type_ float) symbol) + (enemy-method-124 (_type_) collide-spec) + (enemy-method-125 (_type_ collide-query collide-spec float float float) pat-surface) + (enemy-above-ground? (_type_ collide-query vector collide-spec float float float) symbol) + (enemy-method-127 (_type_ float float symbol collide-spec) symbol) + (enemy-method-128 (_type_ vector move-above-ground-params) none) + (enemy-method-129 (_type_) none) + (enemy-method-130 (_type_ float) symbol) + (enemy-method-131 (_type_ int) uint) + (dispose! (_type_) none) + (enemy-method-133 (_type_) symbol) + (enemy-method-134 (_type_ process attack-info) process-focusable) + (enemy-method-135 (_type_ int) sound-id) + (enemy-method-136 (_type_) enemy-flag) ) ) ;; definition for method 3 of type enemy -(defmethod inspect enemy ((this enemy)) +(defmethod inspect ((this enemy)) (when (not this) (set! this this) (goto cfg-79) @@ -684,16 +661,13 @@ ;; definition of type anim-info (deftype anim-info (structure) - ((anim-index int32 :offset-assert 0) - (travel-speed meters :offset-assert 4) + ((anim-index int32) + (travel-speed meters) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type anim-info -(defmethod inspect anim-info ((this anim-info)) +(defmethod inspect ((this anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -706,7 +680,7 @@ ) ;; definition for method 12 of type enemy-focus -(defmethod try-update-focus enemy-focus ((this enemy-focus) (arg0 process-focusable) (arg1 enemy)) +(defmethod try-update-focus ((this enemy-focus) (arg0 process-focusable) (arg1 enemy)) (let* ((t9-0 (method-of-type focus try-update-focus)) (s3-0 (t9-0 this arg0)) ) @@ -724,7 +698,7 @@ ) ;; definition for method 13 of type enemy-focus -(defmethod enemy-focus-method-13 enemy-focus ((this enemy-focus) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-focus-method-13 ((this enemy-focus) (arg0 process-focusable) (arg1 enemy-aware)) (let* ((t9-0 (method-of-type focus try-update-focus)) (v0-0 (t9-0 this arg0)) ) @@ -738,7 +712,7 @@ ;; definition for method 9 of type enemy-focus ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod clear-focused enemy-focus ((this enemy-focus)) +(defmethod clear-focused ((this enemy-focus)) (let ((t9-0 (method-of-type focus clear-focused))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc index 631e4a0b0e1..10327f84a0e 100644 --- a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type enemy-info ;; WARN: Return type mismatch int vs none. -(defmethod copy-enemy-info! enemy-info ((this enemy-info) (obj-to-copy enemy-info)) +(defmethod copy-enemy-info! ((this enemy-info) (obj-to-copy enemy-info)) "Copies the given [[enemy-info]] into the current [[enemy-info]]" (mem-copy! (&-> this type) (&-> obj-to-copy type) 384) 0 @@ -22,7 +22,7 @@ ) ;; definition for method 7 of type enemy -(defmethod relocate enemy ((this enemy) (arg0 int)) +(defmethod relocate ((this enemy) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) @@ -30,13 +30,13 @@ ) ;; definition for method 117 of type enemy -(defmethod get-rand-float enemy ((this enemy)) +(defmethod get-rand-float ((this enemy)) "@returns the result of calling [[rand-vu]]" (rand-vu) ) ;; definition for method 118 of type enemy -(defmethod get-rand-float-range enemy ((this enemy) (low float) (high float)) +(defmethod get-rand-float-range ((this enemy) (low float) (high float)) "@param low The lower bound of the range (inclusive) @param high The upper bound of the range (exclusive) @returns A random float in the specified range" @@ -44,7 +44,7 @@ ) ;; definition for method 119 of type enemy -(defmethod get-rand-int enemy ((this enemy) (high int)) +(defmethod get-rand-int ((this enemy) (high int)) "@param high The upper bound of the range (exclusive) @returns a random integer in the range 0 to `high` @see [[rand-vu]]" @@ -52,7 +52,7 @@ ) ;; definition for method 121 of type enemy -(defmethod get-rand-int-range enemy ((this enemy) (low int) (high int)) +(defmethod get-rand-int-range ((this enemy) (low int) (high int)) "@param low The lower bound of the range (inclusive) @param high The upper bound of the range (exclusive) @returns A random integer in the specified range" @@ -60,7 +60,7 @@ ) ;; definition for method 122 of type enemy -(defmethod rng-hit? enemy ((this enemy) (chance float)) +(defmethod rng-hit? ((this enemy) (chance float)) "TODO - not the best name @param chance The value to compare ([[>=]]) with the result from [[rand-vu]]. @returns If `chance` is greater than the random draw" @@ -69,7 +69,7 @@ ;; definition for method 120 of type enemy ;; WARN: new jak 2 until loop case, check carefully -(defmethod enemy-method-120 enemy ((this enemy) (arg0 int) (arg1 int)) +(defmethod enemy-method-120 ((this enemy) (arg0 int) (arg1 int)) "TODO" (let ((v1-0 0) (s5-0 0) @@ -110,7 +110,7 @@ ) ;; definition for method 123 of type enemy -(defmethod enemy-method-123 enemy ((this enemy) (arg0 float)) +(defmethod enemy-method-123 ((this enemy) (arg0 float)) "TODO" (let* ((v1-5 (-> *display* frames (-> *display* last-screen) run-time)) (f1-2 (fmax 0.0 (fmin 1.0 (* 0.001 (+ -7000.0 (the float v1-5)))))) @@ -120,14 +120,14 @@ ) ;; definition for method 60 of type enemy -(defmethod coin-flip? enemy ((this enemy)) +(defmethod coin-flip? ((this enemy)) "@returns The result of a 50/50 RNG roll" (zero? (get-rand-int this 2)) ) ;; definition for method 12 of type enemy ;; WARN: disable def twice: 40. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod run-logic? enemy ((this enemy)) +(defmethod run-logic? ((this enemy)) (cond ((logtest? (-> this mask) (process-mask actor-pause)) (let ((draw (-> this draw))) @@ -152,13 +152,13 @@ ;; definition for method 53 of type enemy ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-53 enemy ((this enemy) (proc-focus process-focusable)) +(defmethod enemy-method-53 ((this enemy) (proc-focus process-focusable)) "TODO" (the-as symbol (and proc-focus (!= this proc-focus) (collide-check? (-> this focus) proc-focus))) ) ;; definition for method 20 of type enemy -(defmethod get-trans enemy ((this enemy) (arg0 int)) +(defmethod get-trans ((this enemy) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (let ((s4-0 (-> this root))) (cond @@ -185,7 +185,7 @@ ) ;; definition for method 124 of type enemy -(defmethod enemy-method-124 enemy ((this enemy)) +(defmethod enemy-method-124 ((this enemy)) "TODO" (let* ((v1-0 (-> this enemy-info)) (v0-0 (if (logtest? (enemy-flag use-trigger) (-> this enemy-flags)) @@ -200,20 +200,20 @@ ) ;; definition for method 59 of type enemy -(defmethod get-penetrate-info enemy ((this enemy)) +(defmethod get-penetrate-info ((this enemy)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (penetrated-by-all&hit-points->penetrated-by (-> this penetrated-by-all) (-> this hit-points)) ) ;; definition for method 24 of type enemy -(defmethod get-water-height enemy ((this enemy)) +(defmethod get-water-height ((this enemy)) (-> this water-surface-height) ) ;; definition for method 54 of type enemy ;; INFO: Used lq/sq -(defmethod enemy-method-54 enemy ((this enemy)) +(defmethod enemy-method-54 ((this enemy)) (let ((s4-0 (-> this root))) (when (>= (-> this water-max-height) (-> s4-0 trans y)) (let ((s5-0 (new 'stack-no-clear 'water-info))) @@ -301,7 +301,7 @@ ;; definition for method 55 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod track-target! enemy ((self enemy)) +(defmethod track-target! ((self enemy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -361,7 +361,7 @@ ) ;; definition for method 136 of type enemy -(defmethod enemy-method-136 enemy ((this enemy)) +(defmethod enemy-method-136 ((this enemy)) (when (or (time-elapsed? (-> this hit-focus-time) (seconds 2)) (and (handle->process (-> this focus handle)) (not (logtest? (-> (the-as process-focusable (handle->process (-> this focus handle))) focus-status) @@ -409,7 +409,7 @@ ;; definition for method 107 of type enemy ;; WARN: Return type mismatch process vs process-focusable. -(defmethod get-enemy-target enemy ((this enemy)) +(defmethod get-enemy-target ((this enemy)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" (let ((v0-0 (handle->process (-> this focus handle)))) (if (and v0-0 @@ -425,7 +425,7 @@ ) ;; definition for method 63 of type enemy -(defmethod enemy-method-63 enemy ((this enemy) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this enemy) (arg0 process-focusable) (arg1 enemy-aware)) (if arg1 (enemy-focus-method-13 (-> this focus) arg0 arg1) (try-update-focus (-> this focus) arg0 this) @@ -434,7 +434,7 @@ ;; definition for method 62 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-62 enemy ((this enemy)) +(defmethod enemy-method-62 ((this enemy)) (when (not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags))) (let* ((s4-0 (handle->process (-> this incoming attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) @@ -453,7 +453,7 @@ ) ;; definition for method 108 of type enemy -(defmethod enemy-method-108 enemy ((this enemy) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 ((this enemy) (arg0 enemy) (arg1 event-message-block)) (let ((s4-0 (the-as touching-shapes-entry (-> arg1 param 0)))) (when (and s4-0 (and (logtest? (-> this incoming penetrate-using) 4096) @@ -492,7 +492,7 @@ ;; definition for method 64 of type enemy ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-64 enemy ((this enemy)) +(defmethod enemy-method-64 ((this enemy)) (let ((v1-1 (-> this root root-prim))) (set! (-> v1-1 prim-core collide-as) (collide-spec)) (set! (-> v1-1 prim-core collide-with) (collide-spec)) @@ -506,7 +506,7 @@ ;; definition for method 65 of type enemy ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-65 enemy ((this enemy)) +(defmethod enemy-method-65 ((this enemy)) (let ((v1-1 (-> this root root-prim))) (set! (-> v1-1 prim-core collide-as) (collide-spec)) (set! (-> v1-1 prim-core collide-with) (collide-spec)) @@ -519,37 +519,37 @@ ) ;; definition for method 67 of type enemy -(defmethod go-stare enemy ((this enemy)) +(defmethod go-stare ((this enemy)) (go (method-of-object this stare)) ) ;; definition for method 68 of type enemy -(defmethod go-stare2 enemy ((this enemy)) +(defmethod go-stare2 ((this enemy)) (go (method-of-object this stare)) ) ;; definition for method 70 of type enemy -(defmethod go-hostile enemy ((this enemy)) +(defmethod go-hostile ((this enemy)) (go (method-of-object this hostile)) ) ;; definition for method 66 of type enemy -(defmethod go-ambush enemy ((this enemy)) +(defmethod go-ambush ((this enemy)) (go (method-of-object this ambush)) ) ;; definition for method 71 of type enemy -(defmethod go-flee enemy ((this enemy)) +(defmethod go-flee ((this enemy)) (go (method-of-object this flee)) ) ;; definition for method 69 of type enemy -(defmethod go-directed enemy ((this enemy)) +(defmethod go-directed ((this enemy)) (go (method-of-object this directed)) ) ;; definition for method 72 of type enemy -(defmethod react-to-focus enemy ((this enemy)) +(defmethod react-to-focus ((this enemy)) "@TODO - flesh out docs" (let ((s5-0 (-> this focus aware))) (cond @@ -574,7 +574,7 @@ ;; definition for method 93 of type enemy ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 enemy ((this enemy)) +(defmethod enemy-method-93 ((this enemy)) (if (logtest? (enemy-flag alert) (-> this enemy-flags)) (go-directed this) (react-to-focus this) @@ -583,7 +583,7 @@ ) ;; definition for method 73 of type enemy -(defmethod kill-prefer-falling enemy ((this enemy)) +(defmethod kill-prefer-falling ((this enemy)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (if (-> this enemy-info use-die-falling) (go (method-of-object this die-falling)) @@ -593,7 +593,7 @@ ;; definition for method 135 of type enemy ;; INFO: Used lq/sq -(defmethod enemy-method-135 enemy ((this enemy) (arg0 int)) +(defmethod enemy-method-135 ((this enemy) (arg0 int)) (let ((gp-0 (make-u128 0 0))) (let ((v1-0 arg0)) (cond @@ -613,7 +613,7 @@ ;; definition for method 94 of type enemy ;; INFO: Used lq/sq -(defmethod enemy-method-94 enemy ((this enemy) (arg0 vector) (arg1 float)) +(defmethod enemy-method-94 ((this enemy) (arg0 vector) (arg1 float)) (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -627,14 +627,14 @@ ) ;; definition for method 95 of type enemy -(defmethod enemy-method-95 enemy ((this enemy) (arg0 vector) (arg1 float)) +(defmethod enemy-method-95 ((this enemy) (arg0 vector) (arg1 float)) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans)))) (enemy-method-94 this v1-1 arg1) ) ) ;; definition for method 96 of type enemy -(defmethod enemy-method-96 enemy ((this enemy) (arg0 float) (arg1 symbol)) +(defmethod enemy-method-96 ((this enemy) (arg0 float) (arg1 symbol)) (let ((a0-2 (handle->process (-> this focus handle)))) (cond (a0-2 @@ -653,7 +653,7 @@ ) ;; definition for method 104 of type enemy -(defmethod enemy-method-104 enemy ((this enemy) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ((this enemy) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (let ((v1-1 (-> this enemy-info attack-damage))) (if (and (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) (= v1-1 1)) (set! v1-1 2) @@ -674,7 +674,7 @@ ) ;; definition for method 105 of type enemy -(defmethod enemy-method-105 enemy ((this enemy) (arg0 process)) +(defmethod enemy-method-105 ((this enemy) (arg0 process)) (when (logtest? (process-mask target bot) (-> arg0 mask)) (set! (-> this root penetrated-by) (the-as penetrate -1)) (enemy-method-49 this) @@ -703,7 +703,7 @@ ) ;; definition for method 49 of type enemy -(defmethod enemy-method-49 enemy ((this enemy)) +(defmethod enemy-method-49 ((this enemy)) (logior! (-> this enemy-flags) (enemy-flag attackable-backup)) (let ((v0-0 (current-time))) (set! (-> this auto-reset-penetrate-time) v0-0) @@ -713,7 +713,7 @@ ;; definition for method 50 of type enemy ;; INFO: Used lq/sq -(defmethod enemy-method-50 enemy ((this enemy) (arg0 vector)) +(defmethod enemy-method-50 ((this enemy) (arg0 vector)) (set! (-> arg0 quad) (-> this incoming attack-direction quad)) (let ((v1-1 arg0)) (when (= (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))) 0.0) @@ -727,7 +727,7 @@ ;; definition for method 131 of type enemy ;; WARN: Return type mismatch int vs uint. -(defmethod enemy-method-131 enemy ((this enemy) (arg0 int)) +(defmethod enemy-method-131 ((this enemy) (arg0 int)) (the-as uint (cond ((logtest? arg0 1024) 7 @@ -760,7 +760,7 @@ ;; definition for method 106 of type enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-106 enemy ((this enemy) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 ((this enemy) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (set! (-> this incoming penetrate-using) (the-as uint arg2)) (set! (-> this incoming attack-id) (-> arg3 id)) (let ((v1-3 (if (logtest? (attack-mask knock) (-> arg3 mask)) @@ -805,7 +805,7 @@ ;; definition for method 109 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod look-at-target! enemy ((this enemy) (arg0 enemy-flag)) +(defmethod look-at-target! ((this enemy) (arg0 enemy-flag)) "Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available @param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details" (case arg0 @@ -827,7 +827,7 @@ ;; definition for method 110 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod stop-looking-at-target! enemy ((this enemy)) +(defmethod stop-looking-at-target! ((this enemy)) "Will unset [[enemy-flag::death-start]] and [[enemy-flag::lock-focus]] and call [[joint-mod::shut-down]] if applicable" (when (nonzero? (-> this neck)) (logclear! (-> this enemy-flags) (enemy-flag lock-focus death-start)) @@ -838,7 +838,7 @@ ) ;; definition for method 125 of type enemy -(defmethod enemy-method-125 enemy ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) (let ((v0-1 (-> arg0 best-other-tri pat))) (set! (-> this root ground-pat) v0-1) @@ -848,7 +848,7 @@ ) ;; definition for method 126 of type enemy -(defmethod enemy-above-ground? enemy ((this enemy) (arg0 collide-query) (arg1 vector) (arg2 collide-spec) (arg3 float) (arg4 float) (arg5 float)) +(defmethod enemy-above-ground? ((this enemy) (arg0 collide-query) (arg1 vector) (arg2 collide-spec) (arg3 float) (arg4 float) (arg5 float)) "@returns if the enemy is above the ground or not @see [[above-ground?]]" (above-ground? (-> this root) arg0 arg1 arg2 arg3 arg4 arg5) @@ -856,7 +856,7 @@ ;; definition for method 127 of type enemy ;; INFO: Used lq/sq -(defmethod enemy-method-127 enemy ((this enemy) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) +(defmethod enemy-method-127 ((this enemy) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) (cond ((enemy-method-125 this s4-0 arg3 arg0 arg1 1024.0) @@ -923,7 +923,7 @@ ;; definition for method 128 of type enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-128 enemy ((this enemy) (arg0 vector) (arg1 move-above-ground-params)) +(defmethod enemy-method-128 ((this enemy) (arg0 vector) (arg1 move-above-ground-params)) (let ((gp-0 (-> this root))) (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) @@ -1024,7 +1024,7 @@ ;; definition for method 111 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-111 enemy ((this enemy)) +(defmethod enemy-method-111 ((this enemy)) (let ((v1-0 (-> this root))) (when (logtest? (-> v1-0 status) (collide-status touch-surface)) (let ((f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 (-> this enemy-info friction))))))) @@ -1039,7 +1039,7 @@ ;; definition for method 114 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! enemy ((this enemy)) +(defmethod init-enemy-collision! ((this enemy)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" 0 (none) @@ -1047,7 +1047,7 @@ ;; definition for method 115 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! enemy ((this enemy)) +(defmethod init-enemy! ((this enemy)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" 0 (none) @@ -1055,14 +1055,14 @@ ;; definition for method 116 of type enemy ;; WARN: Return type mismatch object vs none. -(defmethod go-idle enemy ((this enemy)) +(defmethod go-idle ((this enemy)) (go (method-of-object this idle)) (none) ) ;; definition for method 112 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod set-enemy-info! enemy ((this enemy) (arg0 enemy-info)) +(defmethod set-enemy-info! ((this enemy) (arg0 enemy-info)) "In addition to setting the `enemy-info`, also init the `neck-joint` if applicable from it @param info Set `enemy-info` accordingly" (set! (-> this enemy-info) arg0) @@ -1084,7 +1084,7 @@ ;; definition for method 113 of type enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-behaviour-and-stats! enemy ((this enemy) (arg0 enemy-info)) +(defmethod init-enemy-behaviour-and-stats! ((this enemy) (arg0 enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (local-vars (sv-16 res-tag)) (when (coin-flip? this) @@ -1297,7 +1297,7 @@ ;; definition for method 11 of type enemy ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! enemy ((this enemy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this enemy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1357,7 +1357,7 @@ This commonly includes things such as: ) ;; definition for method 98 of type enemy -(defmethod in-aggro-range? enemy ((this enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this enemy) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -1367,13 +1367,13 @@ This commonly includes things such as: ) ;; definition for method 99 of type enemy -(defmethod enemy-method-99 enemy ((this enemy) (arg0 process-focusable)) +(defmethod enemy-method-99 ((this enemy) (arg0 process-focusable)) #f ) ;; definition for method 11 of type enemy-focus ;; WARN: Return type mismatch int vs none. -(defmethod reset-to-collide-spec enemy-focus ((this enemy-focus) (arg0 collide-spec)) +(defmethod reset-to-collide-spec ((this enemy-focus) (arg0 collide-spec)) (let ((t9-0 (method-of-type focus reset-to-collide-spec))) (t9-0 this arg0) ) @@ -1385,7 +1385,7 @@ This commonly includes things such as: ;; definition for method 129 of type enemy ;; WARN: Return type mismatch process vs none. ;; WARN: Function (method 129 enemy) has a return type of none, but the expression builder found a return statement. -(defmethod enemy-method-129 enemy ((this enemy)) +(defmethod enemy-method-129 ((this enemy)) (let ((gp-0 (-> this focus))) (let ((a1-0 (handle->process (-> gp-0 handle)))) (when a1-0 @@ -1431,7 +1431,7 @@ This commonly includes things such as: ) ;; definition for method 97 of type enemy -(defmethod enemy-method-97 enemy ((this enemy)) +(defmethod enemy-method-97 ((this enemy)) (let ((s4-0 (-> this focus collide-with)) (gp-0 (new 'stack-no-clear 'enemy-best-focus)) ) @@ -1533,7 +1533,7 @@ This commonly includes things such as: ;; definition for method 57 of type enemy ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! enemy ((this enemy) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod update-target-awareness! ((this enemy) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! @TODO - flesh out docs @returns the value that sets `aware`" @@ -1610,7 +1610,7 @@ This commonly includes things such as: ) ;; definition for method 130 of type enemy -(defmethod enemy-method-130 enemy ((this enemy) (arg0 float)) +(defmethod enemy-method-130 ((this enemy) (arg0 float)) (let* ((v1-0 (-> this fact)) (a2-0 (-> v1-0 trig-mask-count)) (a3-0 (-> v1-0 trig-mask)) @@ -1644,7 +1644,7 @@ This commonly includes things such as: ) ;; definition for method 61 of type enemy -(defmethod enemy-method-61 enemy ((this enemy) (arg0 int)) +(defmethod enemy-method-61 ((this enemy) (arg0 int)) (let ((v1-1 (< 1 arg0))) (cond (v1-1 @@ -1678,7 +1678,7 @@ This commonly includes things such as: ;; definition for method 74 of type enemy ;; INFO: Used lq/sq -(defmethod general-event-handler enemy ((this enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (s5-5 rgbaf) (sv-432 process) (sv-448 event-message-block)) @@ -2026,7 +2026,7 @@ This commonly includes things such as: ) ;; definition for method 56 of type enemy -(defmethod damage-amount-from-attack enemy ((this enemy) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this enemy) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let ((v1-0 (the-as attack-info (-> arg1 param 1)))) (if (logtest? (attack-mask damage) (-> v1-0 mask)) @@ -2037,7 +2037,7 @@ This commonly includes things such as: ) ;; definition for method 58 of type enemy -(defmethod enemy-method-58 enemy ((this enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 ((this enemy) (arg0 process) (arg1 event-message-block)) (let ((v1-0 (-> this incoming penetrate-using))) (cond ((logtest? (the-as penetrate v1-0) (-> this penetrated-flinch)) @@ -2054,7 +2054,7 @@ This commonly includes things such as: ) ;; definition for method 48 of type enemy -(defmethod take-damage-from-attack enemy ((this enemy) (arg0 process) (arg1 event-message-block)) +(defmethod take-damage-from-attack ((this enemy) (arg0 process) (arg1 event-message-block)) (let* ((v1-1 (damage-amount-from-attack this arg0 arg1)) (s5-0 (-> this hit-points)) (s4-1 (max 0 (- s5-0 v1-1))) @@ -2081,12 +2081,12 @@ This commonly includes things such as: ) ;; definition for method 134 of type enemy -(defmethod enemy-method-134 enemy ((this enemy) (arg0 process) (arg1 attack-info)) +(defmethod enemy-method-134 ((this enemy) (arg0 process) (arg1 attack-info)) (find-offending-process-focusable arg0 arg1) ) ;; definition for method 75 of type enemy -(defmethod enemy-method-75 enemy ((this enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-75 ((this enemy) (arg0 process) (arg1 event-message-block)) (let* ((touch-entry (the-as touching-shapes-entry (-> arg1 param 0))) (s2-0 arg0) (s3-0 (if (type? s2-0 process-focusable) @@ -2137,7 +2137,7 @@ This commonly includes things such as: ) ;; definition for method 76 of type enemy -(defmethod enemy-method-76 enemy ((this enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 ((this enemy) (arg0 process) (arg1 event-message-block)) (let ((s4-0 (-> arg1 param 0))) (when s4-0 (when (or (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) @@ -2216,7 +2216,7 @@ This commonly includes things such as: ) ;; definition for method 47 of type enemy -(defmethod enemy-method-47 enemy ((this enemy) (arg0 vector)) +(defmethod enemy-method-47 ((this enemy) (arg0 vector)) (let* ((f2-0 0.8) (f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 f2-0))))) ) @@ -2622,14 +2622,14 @@ This commonly includes things such as: ) ;; definition for method 82 of type enemy -(defmethod enemy-method-82 enemy ((this enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-82 ((this enemy) (arg0 enemy-jump-info)) "@abstract" #f ) ;; definition for method 83 of type enemy ;; INFO: Used lq/sq -(defmethod enemy-method-83 enemy ((this enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-83 ((this enemy) (arg0 enemy-jump-info)) (set! (-> arg0 flags) (the-as uint 1)) (set! (-> arg0 anim-speed) (get-rand-float-range this 0.9 1.1)) (set! (-> arg0 hang-time) 0) @@ -2653,7 +2653,7 @@ This commonly includes things such as: ) ;; definition for method 84 of type enemy -(defmethod enemy-method-84 enemy ((this enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 ((this enemy) (arg0 enemy-jump-info)) (let* ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos))) (f0-2 (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0))) ) @@ -2663,7 +2663,7 @@ This commonly includes things such as: ) ;; definition for method 86 of type enemy -(defmethod enemy-method-86 enemy ((this enemy)) +(defmethod enemy-method-86 ((this enemy)) (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) (let ((a1-0 (new 'stack-no-clear 'collide-query))) @@ -2675,7 +2675,7 @@ This commonly includes things such as: ) ;; definition for method 85 of type enemy -(defmethod enemy-method-85 enemy ((this enemy)) +(defmethod enemy-method-85 ((this enemy)) (let* ((v1-0 (-> this root)) (f0-0 (-> v1-0 gspot-pos y)) ) @@ -2688,7 +2688,7 @@ This commonly includes things such as: ;; definition for method 92 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-92 enemy ((this enemy) (arg0 int) (arg1 nav-poly)) +(defmethod enemy-method-92 ((this enemy) (arg0 int) (arg1 nav-poly)) "TODO - nav-poly is a guess @abstract" 0 @@ -2697,7 +2697,7 @@ This commonly includes things such as: ;; definition for method 91 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-91 enemy ((this enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-91 ((this enemy) (arg0 int) (arg1 enemy-jump-info)) (case arg0 ((2 3) (logior! (-> this enemy-flags) (enemy-flag directed)) @@ -2717,7 +2717,7 @@ This commonly includes things such as: ) ;; definition for method 89 of type enemy -(defmethod enemy-method-89 enemy ((this enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this enemy) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -2736,7 +2736,7 @@ This commonly includes things such as: ) ;; definition for method 87 of type enemy -(defmethod enemy-method-87 enemy ((this enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this enemy) (arg0 enemy-jump-info)) (let ((s5-0 (-> this draw art-group data (-> this enemy-info jump-in-air-anim)))) (let ((v1-6 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) @@ -2768,7 +2768,7 @@ This commonly includes things such as: ) ;; definition for method 88 of type enemy -(defmethod enemy-method-88 enemy ((this enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this enemy) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -2787,7 +2787,7 @@ This commonly includes things such as: ) ;; definition for method 90 of type enemy -(defmethod enemy-method-90 enemy ((this enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 ((this enemy) (arg0 int) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond @@ -3023,7 +3023,7 @@ This commonly includes things such as: ;; definition for method 101 of type enemy ;; WARN: Return type mismatch collide-spec vs none. -(defmethod enemy-method-101 enemy ((this enemy)) +(defmethod enemy-method-101 ((this enemy)) (when (not (logtest? (enemy-flag use-trigger) (-> this enemy-flags))) (logior! (-> this enemy-flags) (enemy-flag use-trigger)) (logclear! (-> this enemy-flags) (enemy-flag directed)) @@ -3033,7 +3033,7 @@ This commonly includes things such as: ) ;; definition for method 103 of type enemy -(defmethod enemy-method-103 enemy ((this enemy)) +(defmethod enemy-method-103 ((this enemy)) (when (logtest? (enemy-flag use-trigger) (-> this enemy-flags)) (logclear! (-> this enemy-flags) (enemy-flag use-trigger directed)) (enemy-method-124 this) @@ -3041,14 +3041,14 @@ This commonly includes things such as: ) ;; definition for method 102 of type enemy -(defmethod enemy-method-102 enemy ((this enemy)) +(defmethod enemy-method-102 ((this enemy)) #f ) ;; definition for method 100 of type enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs symbol. -(defmethod enemy-method-100 enemy ((this enemy)) +(defmethod enemy-method-100 ((this enemy)) (local-vars (v0-1 vector)) (when (not (-> this enemy-info move-to-ground)) (enemy-method-103 this) @@ -3109,7 +3109,7 @@ This commonly includes things such as: ;; definition for method 46 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-46 enemy ((this enemy) (arg0 int)) +(defmethod enemy-method-46 ((this enemy) (arg0 int)) "@abstract" 0 (none) @@ -3118,7 +3118,7 @@ This commonly includes things such as: ;; definition for method 52 of type enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 enemy ((this enemy) (arg0 vector)) +(defmethod enemy-method-52 ((this enemy) (arg0 vector)) (enemy-method-50 this arg0) (let ((s5-0 (-> this enemy-info))) (case (-> this incoming knocked-type) @@ -3202,7 +3202,7 @@ This commonly includes things such as: ) ;; definition for method 51 of type enemy -(defmethod enemy-method-51 enemy ((this enemy)) +(defmethod enemy-method-51 ((this enemy)) (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) @@ -3251,7 +3251,7 @@ This commonly includes things such as: ) ;; definition for method 77 of type enemy -(defmethod enemy-method-77 enemy ((this enemy) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this enemy) (arg0 (pointer float))) (ja-channel-push! 1 0) (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-anim))) (a0-4 (-> this skel root-channel 0)) @@ -3266,7 +3266,7 @@ This commonly includes things such as: ) ;; definition for method 78 of type enemy -(defmethod enemy-method-78 enemy ((this enemy) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this enemy) (arg0 (pointer float))) (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-3 (-> this skel root-channel 0)) ) @@ -3280,7 +3280,7 @@ This commonly includes things such as: ) ;; definition for method 80 of type enemy -(defmethod enemy-method-80 enemy ((this enemy) (arg0 enemy-knocked-info)) +(defmethod enemy-method-80 ((this enemy) (arg0 enemy-knocked-info)) (let ((gp-0 (-> this root))) (or (>= (-> arg0 on-surface-count) 3) (and (logtest? (-> gp-0 status) (collide-status on-ground)) (>= 16384.0 (-> gp-0 transv y))) @@ -3297,7 +3297,7 @@ This commonly includes things such as: ) ;; definition for method 81 of type enemy -(defmethod enemy-method-81 enemy ((this enemy)) +(defmethod enemy-method-81 ((this enemy)) (let ((s5-0 (-> this root)) (a1-0 (new 'stack-no-clear 'collide-query)) (gp-0 #t) @@ -3314,7 +3314,7 @@ This commonly includes things such as: ) ;; definition for method 79 of type enemy -(defmethod enemy-method-79 enemy ((this enemy) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this enemy) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond @@ -3541,7 +3541,7 @@ This commonly includes things such as: ) ;; definition for method 132 of type enemy -(defmethod dispose! enemy ((this enemy)) +(defmethod dispose! ((this enemy)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) (set! (-> this enemy-flags) @@ -3624,7 +3624,7 @@ This commonly includes things such as: ) ;; definition for method 133 of type enemy -(defmethod enemy-method-133 enemy ((this enemy)) +(defmethod enemy-method-133 ((this enemy)) (let ((s5-0 (-> this root)) (a1-0 (new 'stack-no-clear 'collide-query)) (gp-0 #t) diff --git a/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc b/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc index 23f913a6d73..abe0f79a430 100644 --- a/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc @@ -15,22 +15,19 @@ ;; definition of type traffic-danger-info (deftype traffic-danger-info (structure) - ((sphere sphere :inline :offset-assert 0) - (velocity vector :inline :offset-assert 16) - (handle handle :offset-assert 32) - (notify-radius float :offset-assert 40) - (danger-level float :offset-assert 44) - (decay-rate float :offset-assert 48) - (flags traffic-danger-flags :offset-assert 52) - (danger-type traffic-danger-type :offset-assert 53) + ((sphere sphere :inline) + (velocity vector :inline) + (handle handle) + (notify-radius float) + (danger-level float) + (decay-rate float) + (flags traffic-danger-flags) + (danger-type traffic-danger-type) ) - :method-count-assert 9 - :size-assert #x36 - :flag-assert #x900000036 ) ;; definition for method 3 of type traffic-danger-info -(defmethod inspect traffic-danger-info ((this traffic-danger-info)) +(defmethod inspect ((this traffic-danger-info)) (when (not this) (set! this this) (goto cfg-4) @@ -50,23 +47,20 @@ ;; definition of type traffic-suppression-params (deftype traffic-suppression-params (structure) - ((bbox bounding-box :inline :offset-assert 0) - (duration time-frame :offset-assert 32) - (id int8 :offset-assert 40) + ((bbox bounding-box :inline) + (duration time-frame) + (id int8) ) - :method-count-assert 13 - :size-assert #x29 - :flag-assert #xd00000029 (:methods - (try-creating-new-suppression-box (_type_) symbol 9) - (create-or-update-suppression-box (_type_) symbol 10) - (has-valid-id? (_type_) none 11) - (kill-suppression-box (_type_) none 12) + (try-creating-new-suppression-box (_type_) symbol) + (create-or-update-suppression-box (_type_) symbol) + (has-valid-id? (_type_) none) + (kill-suppression-box (_type_) none) ) ) ;; definition for method 3 of type traffic-suppression-params -(defmethod inspect traffic-suppression-params ((this traffic-suppression-params)) +(defmethod inspect ((this traffic-suppression-params)) (when (not this) (set! this this) (goto cfg-4) @@ -81,34 +75,31 @@ ;; definition for method 11 of type traffic-suppression-params ;; WARN: Return type mismatch symbol vs none. -(defmethod has-valid-id? traffic-suppression-params ((this traffic-suppression-params)) +(defmethod has-valid-id? ((this traffic-suppression-params)) (!= (-> this id) -1) (none) ) ;; definition of type traffic-object-spawn-params (deftype traffic-object-spawn-params (structure) - ((object-type traffic-type :offset-assert 0) - (behavior uint64 :offset-assert 8) - (id uint32 :offset-assert 16) - (nav-mesh nav-mesh :offset-assert 20) - (nav-branch nav-branch :offset-assert 24) - (position vector :inline :offset-assert 32) - (rotation quaternion :inline :offset-assert 48) - (velocity vector :inline :offset-assert 64) - (handle handle :offset-assert 80) - (guard-type uint8 :offset-assert 88) - (user-data uint32 :offset-assert 92) - (flags traffic-spawn-flags :offset-assert 96) - (proc process :offset-assert 100) + ((object-type traffic-type) + (behavior uint64) + (id uint32) + (nav-mesh nav-mesh) + (nav-branch nav-branch) + (position vector :inline) + (rotation quaternion :inline) + (velocity vector :inline) + (handle handle) + (guard-type uint8) + (user-data uint32) + (flags traffic-spawn-flags) + (proc process) ) - :method-count-assert 9 - :size-assert #x68 - :flag-assert #x900000068 ) ;; definition for method 3 of type traffic-object-spawn-params -(defmethod inspect traffic-object-spawn-params ((this traffic-object-spawn-params)) +(defmethod inspect ((this traffic-object-spawn-params)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc b/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc index 6c2f51b47b8..ac8923f4dac 100644 --- a/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc @@ -3,32 +3,29 @@ ;; definition of type talker-speech-class (deftype talker-speech-class (structure) - ((name string :offset-assert 0) - (channel gui-channel :offset-assert 4) - (flags uint8 :offset-assert 5) - (speech uint16 :offset-assert 6) - (text-message text-id :offset-assert 8) - (text-duration uint16 :offset-assert 12) - (delay uint16 :offset-assert 14) - (pos uint16 :offset-assert 16) - (neg uint16 :offset-assert 18) - (on-close pair :offset-assert 20) + ((name string) + (channel gui-channel) + (flags uint8) + (speech uint16) + (text-message text-id) + (text-duration uint16) + (delay uint16) + (pos uint16) + (neg uint16) + (on-close pair) ) :pack-me - :method-count-assert 14 - :size-assert #x18 - :flag-assert #xe00000018 (:methods - (talker-speech-class-method-9 (_type_) symbol 9) - (play-communicator-speech! (_type_) none 10) - (talker-speech-class-method-11 (_type_) none 11) - (talker-speech-class-method-12 (_type_ int) none 12) - (talker-speech-class-method-13 (_type_ int) none 13) + (talker-speech-class-method-9 (_type_) symbol) + (play-communicator-speech! (_type_) none) + (talker-speech-class-method-11 (_type_) none) + (talker-speech-class-method-12 (_type_ int) none) + (talker-speech-class-method-13 (_type_ int) none) ) ) ;; definition for method 3 of type talker-speech-class -(defmethod inspect talker-speech-class ((this talker-speech-class)) +(defmethod inspect ((this talker-speech-class)) (when (not this) (set! this this) (goto cfg-4) @@ -50,33 +47,31 @@ ;; definition of type talker (deftype talker (process) - ((trans vector :inline :offset-assert 128) - (message talker-speech-class :offset-assert 144) - (total-time time-frame :offset-assert 152) - (total-off-time time-frame :offset-assert 160) - (start-time time-frame :offset-assert 168) - (state-time time-frame :offset-assert 176) - (voicebox handle :offset-assert 184) - (voice-id sound-id :offset-assert 192) - (message-id sound-id :offset-assert 196) - (region region :offset-assert 200) - (interp float :offset-assert 204) - (save? symbol :offset-assert 208) + ((trans vector :inline) + (message talker-speech-class) + (total-time time-frame) + (total-off-time time-frame) + (start-time time-frame) + (state-time time-frame) + (voicebox handle) + (voice-id sound-id) + (message-id sound-id) + (region region) + (interp float) + (save? symbol) ) - :heap-base #x60 - :method-count-assert 18 - :size-assert #xd4 - :flag-assert #x12006000d4 + (:state-methods + idle + active + exit + ) (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (exit () _type_ :state 16) - (talker-method-17 (_type_) none 17) + (talker-method-17 (_type_) none) ) ) ;; definition for method 3 of type talker -(defmethod inspect talker ((this talker)) +(defmethod inspect ((this talker)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc index a6c6b20320e..745a2b0da4c 100644 --- a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc @@ -113,7 +113,7 @@ ) ;; definition for method 9 of type talker-speech-class -(defmethod talker-speech-class-method-9 talker-speech-class ((this talker-speech-class)) +(defmethod talker-speech-class-method-9 ((this talker-speech-class)) (and (>= (-> *game-info* unknown-pad6 (* (-> this speech) 2)) (-> this pos)) (>= (-> this neg) (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1))) ) @@ -121,7 +121,7 @@ ;; definition for method 10 of type talker-speech-class ;; WARN: Return type mismatch int vs none. -(defmethod play-communicator-speech! talker-speech-class ((this talker-speech-class)) +(defmethod play-communicator-speech! ((this talker-speech-class)) "Plays the provided [[talker-speech-class]] @TODO - understand the array from [[game-info]] better" (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) (the-as uint #xffff)) @@ -131,7 +131,7 @@ ;; definition for method 11 of type talker-speech-class ;; WARN: Return type mismatch int vs none. -(defmethod talker-speech-class-method-11 talker-speech-class ((this talker-speech-class)) +(defmethod talker-speech-class-method-11 ((this talker-speech-class)) (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) (the-as uint 0)) 0 (none) @@ -139,7 +139,7 @@ ;; definition for method 12 of type talker-speech-class ;; WARN: Return type mismatch int vs none. -(defmethod talker-speech-class-method-12 talker-speech-class ((this talker-speech-class) (arg0 int)) +(defmethod talker-speech-class-method-12 ((this talker-speech-class) (arg0 int)) (if (>= arg0 0) (set! (-> *game-info* unknown-pad6 (* (-> this speech) 2)) (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (* (-> this speech) 2))) #xfff0 arg0)) @@ -157,7 +157,7 @@ ;; definition for method 13 of type talker-speech-class ;; WARN: Return type mismatch int vs none. -(defmethod talker-speech-class-method-13 talker-speech-class ((this talker-speech-class) (arg0 int)) +(defmethod talker-speech-class-method-13 ((this talker-speech-class) (arg0 int)) (if (>= arg0 0) (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1))) #xfff0 arg0)) @@ -270,7 +270,7 @@ ) ;; definition for method 10 of type talker -(defmethod deactivate talker ((this talker)) +(defmethod deactivate ((this talker)) (send-event (handle->process (-> this voicebox)) 'die) (call-parent-method this) (none) @@ -278,7 +278,7 @@ ;; definition for method 17 of type talker ;; WARN: Return type mismatch int vs none. -(defmethod talker-method-17 talker ((this talker)) +(defmethod talker-method-17 ((this talker)) (let ((gp-0 (new 'stack 'font-context *font-default-matrix* 36 310 0.0 (font-color default) (font-flags shadow kerning)) ) diff --git a/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc index 8d49392b868..51d6efbe3f0 100644 --- a/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc @@ -3,31 +3,28 @@ ;; definition of type align-control (deftype align-control (basic) - ((flags align-flags :offset-assert 4) - (process process-drawable :offset-assert 8) - (frame-group art-joint-anim :offset-assert 12) - (frame-num float :offset-assert 16) - (matrix matrix 2 :inline :offset-assert 32) - (transform transform 2 :inline :offset-assert 160) - (delta transformq :inline :offset-assert 256) - (last-speed meters :offset-assert 304) - (align transformq :inline :offset 160) + ((flags align-flags) + (process process-drawable) + (frame-group art-joint-anim) + (frame-num float) + (matrix matrix 2 :inline) + (transform transform 2 :inline) + (delta transformq :inline) + (last-speed meters) + (align transformq :inline :overlay-at (-> transform 0 trans data 0)) ) - :method-count-assert 14 - :size-assert #x134 - :flag-assert #xe00000134 (:methods - (new (symbol type process) _type_ 0) - (compute-alignment! (_type_) transformq 9) - (align! (_type_ align-opts float float float) trsqv 10) - (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv :behavior process 11) - (first-transform (_type_) transform 12) - (second-transform (_type_) transform 13) + (new (symbol type process) _type_) + (compute-alignment! (_type_) transformq) + (align! (_type_ align-opts float float float) trsqv) + (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv :behavior process) + (first-transform (_type_) transform) + (second-transform (_type_) transform) ) ) ;; definition for method 3 of type align-control -(defmethod inspect align-control ((this align-control)) +(defmethod inspect ((this align-control)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/anim/aligner_REF.gc b/test/decompiler/reference/jak2/engine/anim/aligner_REF.gc index c5f87b393f7..95e592a9046 100644 --- a/test/decompiler/reference/jak2/engine/anim/aligner_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/aligner_REF.gc @@ -5,7 +5,7 @@ ;; INFO: Used lq/sq ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod compute-alignment! align-control ((this align-control)) +(defmethod compute-alignment! ((this align-control)) (local-vars (a0-10 symbol) (s7-0 none) (ra-0 int)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -127,19 +127,19 @@ ;; definition for method 12 of type align-control ;; WARN: Return type mismatch (inline-array transform) vs transform. -(defmethod first-transform align-control ((this align-control)) +(defmethod first-transform ((this align-control)) "@returns The first of the two [[transforms]] held by the object" (the-as transform (-> this transform)) ) ;; definition for method 13 of type align-control -(defmethod second-transform align-control ((this align-control)) +(defmethod second-transform ((this align-control)) "@returns The second of the two [[transforms]] held by the object" (-> this transform 1) ) ;; definition for method 10 of type align-control -(defmethod align! align-control ((this align-control) (options align-opts) (x float) (y float) (z float)) +(defmethod align! ((this align-control) (options align-opts) (x float) (y float) (z float)) "As long as [[align-flags::0]] is not set call [[process-drawable::16]] on the process being controlled using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> @@ -162,7 +162,7 @@ using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> ) ;; definition for method 26 of type trsqv -(defmethod set-and-limit-velocity trsqv ((this trsqv) (unkBitfield int) (limit vector) (arg2 float)) +(defmethod set-and-limit-velocity ((this trsqv) (unkBitfield int) (limit vector) (arg2 float)) "TODO - arg1 is an bitfield of some sort" (let ((transv (-> this transv))) (when (logtest? unkBitfield 4) @@ -184,7 +184,7 @@ using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> ) ;; definition for method 11 of type align-control -(defmethod align-vel-and-quat-only! align-control ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) +(defmethod align-vel-and-quat-only! ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) (when (not (logtest? (-> this flags) (align-flags disabled))) (let ((s5-0 (-> this delta))) (let ((a0-1 (-> this process root transv))) diff --git a/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc b/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc index 4cb38b250b7..716d2ef48f1 100644 --- a/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc @@ -3,27 +3,23 @@ ;; definition of type fma-sphere (deftype fma-sphere (process-drawable) - ((root collide-shape :override) - (first-time? symbol :offset-assert 200) - (mode fma-sphere-mode :offset-assert 204) - (track-handle handle :offset-assert 208) - (track-joint int32 :offset-assert 216) - (attack-id uint32 :offset-assert 220) - (duration time-frame :offset-assert 224) - (sphere sphere :inline :offset-assert 240) - (danger traffic-danger-info :inline :offset-assert 256) + ((root collide-shape :override) + (first-time? symbol) + (mode fma-sphere-mode) + (track-handle handle) + (track-joint int32) + (attack-id uint32) + (duration time-frame) + (sphere sphere :inline) + (danger traffic-danger-info :inline) ) - :heap-base #xc0 - :method-count-assert 21 - :size-assert #x136 - :flag-assert #x1500c00136 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type fma-sphere -(defmethod inspect fma-sphere ((this fma-sphere)) +(defmethod inspect ((this fma-sphere)) (when (not this) (set! this this) (goto cfg-4) @@ -45,7 +41,7 @@ ) ;; definition for method 12 of type fma-sphere -(defmethod run-logic? fma-sphere ((this fma-sphere)) +(defmethod run-logic? ((this fma-sphere)) (or (logtest? *display-scene-control* (scene-controls display-controls)) (and *display-nav-marks* (logtest? (-> this mode) (fma-sphere-mode nav))) (logtest? (-> this mode) (fma-sphere-mode deadly-overlap)) diff --git a/test/decompiler/reference/jak2/engine/anim/joint-exploder_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-exploder_REF.gc index 5230837280f..6d2bf56cc5c 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint-exploder_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint-exploder_REF.gc @@ -3,34 +3,31 @@ ;; definition of type joint-exploder-tuning (deftype joint-exploder-tuning (structure) - ((explosion uint64 :offset-assert 0) - (duration time-frame :offset-assert 8) - (gravity float :offset-assert 16) - (rot-speed float :offset-assert 20) - (bounds-inflate float :offset-assert 24) - (max-probe-width float :offset-assert 28) - (max-probe-height float :offset-assert 32) - (max-probe-depth float :offset-assert 36) - (fountain-rand-transv-lo vector :inline :offset-assert 48) - (fountain-rand-transv-hi vector :inline :offset-assert 64) - (away-from-focal-pt vector :inline :offset 48) - (away-from-rand-transv-xz-lo float :offset 64) - (away-from-rand-transv-xz-hi float :offset 68) - (away-from-rand-transv-y-lo float :offset 72) - (away-from-rand-transv-y-hi float :offset 76) - (hit-xz-reaction float :offset-assert 80) - (hit-y-reaction float :offset-assert 84) + ((explosion uint64) + (duration time-frame) + (gravity float) + (rot-speed float) + (bounds-inflate float) + (max-probe-width float) + (max-probe-height float) + (max-probe-depth float) + (fountain-rand-transv-lo vector :inline) + (fountain-rand-transv-hi vector :inline) + (away-from-focal-pt vector :inline :overlay-at fountain-rand-transv-lo) + (away-from-rand-transv-xz-lo float :overlay-at (-> fountain-rand-transv-hi data 0)) + (away-from-rand-transv-xz-hi float :overlay-at (-> fountain-rand-transv-hi data 1)) + (away-from-rand-transv-y-lo float :overlay-at (-> fountain-rand-transv-hi data 2)) + (away-from-rand-transv-y-hi float :overlay-at (-> fountain-rand-transv-hi data 3)) + (hit-xz-reaction float) + (hit-y-reaction float) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 (:methods - (new (symbol type uint) _type_ 0) + (new (symbol type uint) _type_) ) ) ;; definition for method 3 of type joint-exploder-tuning -(defmethod inspect joint-exploder-tuning ((this joint-exploder-tuning)) +(defmethod inspect ((this joint-exploder-tuning)) (when (not this) (set! this this) (goto cfg-4) @@ -59,16 +56,13 @@ ;; definition of type joint-exploder-static-joint-params (deftype joint-exploder-static-joint-params (structure) - ((joint-index int16 :offset-assert 0) - (parent-joint-index int16 :offset-assert 2) + ((joint-index int16) + (parent-joint-index int16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type joint-exploder-static-joint-params -(defmethod inspect joint-exploder-static-joint-params ((this joint-exploder-static-joint-params)) +(defmethod inspect ((this joint-exploder-static-joint-params)) (when (not this) (set! this this) (goto cfg-4) @@ -82,17 +76,14 @@ ;; definition of type joint-exploder-static-params (deftype joint-exploder-static-params (basic) - ((joints (array joint-exploder-static-joint-params) :offset-assert 4) - (collide-spec uint32 :offset-assert 8) - (art-level symbol :offset-assert 12) + ((joints (array joint-exploder-static-joint-params)) + (collide-spec uint32) + (art-level symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type joint-exploder-static-params -(defmethod inspect joint-exploder-static-params ((this joint-exploder-static-params)) +(defmethod inspect ((this joint-exploder-static-params)) (when (not this) (set! this this) (goto cfg-4) @@ -107,22 +98,19 @@ ;; definition of type joint-exploder-joint (deftype joint-exploder-joint (structure) - ((next int16 :offset-assert 0) - (prev int16 :offset-assert 2) - (joint-index int16 :offset-assert 4) - (mat matrix :inline :offset-assert 16) - (rmat matrix :inline :offset-assert 80) - (update-rmat matrix :inline :offset-assert 144) - (transv vector :inline :offset-assert 208) - (prev-pos vector :inline :offset-assert 224) + ((next int16) + (prev int16) + (joint-index int16) + (mat matrix :inline) + (rmat matrix :inline) + (update-rmat matrix :inline) + (transv vector :inline) + (prev-pos vector :inline) ) - :method-count-assert 9 - :size-assert #xf0 - :flag-assert #x9000000f0 ) ;; definition for method 3 of type joint-exploder-joint -(defmethod inspect joint-exploder-joint ((this joint-exploder-joint)) +(defmethod inspect ((this joint-exploder-joint)) (when (not this) (set! this this) (goto cfg-4) @@ -142,19 +130,16 @@ ;; definition of type joint-exploder-joints (deftype joint-exploder-joints (basic) - ((num-joints int32 :offset-assert 4) - (joint joint-exploder-joint :inline :dynamic :offset-assert 16) + ((num-joints int32) + (joint joint-exploder-joint :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type joint-exploder-static-params) _type_ 0) + (new (symbol type joint-exploder-static-params) _type_) ) ) ;; definition for method 3 of type joint-exploder-joints -(defmethod inspect joint-exploder-joints ((this joint-exploder-joints)) +(defmethod inspect ((this joint-exploder-joints)) (when (not this) (set! this this) (goto cfg-4) @@ -168,19 +153,16 @@ ;; definition of type joint-exploder-list (deftype joint-exploder-list (structure) - ((head int32 :offset-assert 0) - (pre-moved? symbol :offset-assert 4) - (bbox-valid? symbol :offset-assert 8) - (probeless? symbol :offset-assert 12) - (bbox bounding-box :inline :offset-assert 16) + ((head int32) + (pre-moved? symbol) + (bbox-valid? symbol) + (probeless? symbol) + (bbox bounding-box :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type joint-exploder-list -(defmethod inspect joint-exploder-list ((this joint-exploder-list)) +(defmethod inspect ((this joint-exploder-list)) (when (not this) (set! this this) (goto cfg-4) @@ -197,30 +179,26 @@ ;; definition of type joint-exploder (deftype joint-exploder (process-drawable) - ((die-if-below-y float :offset-assert 200) - (die-if-beyond-xz-dist-sqrd float :offset-assert 204) - (joints joint-exploder-joints :offset-assert 208) - (static-params joint-exploder-static-params :offset-assert 212) - (anim art-joint-anim :offset-assert 216) - (scale-vector vector :inline :offset-assert 224) - (tuning joint-exploder-tuning :inline :offset-assert 240) - (lists joint-exploder-list 5 :inline :offset-assert 336) + ((die-if-below-y float) + (die-if-beyond-xz-dist-sqrd float) + (joints joint-exploder-joints) + (static-params joint-exploder-static-params) + (anim art-joint-anim) + (scale-vector vector :inline) + (tuning joint-exploder-tuning :inline) + (lists joint-exploder-list 5 :inline) ) - :heap-base #x1c0 - :method-count-assert 30 - :size-assert #x240 - :flag-assert #x1e01c00240 (:methods - (add-joint-to-list (_type_ joint-exploder-list int) int 20) - (update-bbox-for-joint (_type_ joint-exploder-list joint-exploder-joint) none 21) - (do-collision-response (_type_ joint-exploder-list) none 22) - (init-joint-list (_type_) none 23) - (remove-from-list-and-reset (_type_ joint-exploder-list int) int 24) - (final-adjust (_type_ joint-exploder-list int) int 25) - (integrate-and-kill (_type_ joint-exploder-list) none 26) - (remove-joint-from-list (_type_ joint-exploder-list int) int 27) - (adjust-bbox-for-limits-along-axis (_type_ joint-exploder-list int) joint-exploder-list 28) - (adjust-bbox-for-limits (_type_ joint-exploder-list) none 29) + (add-joint-to-list (_type_ joint-exploder-list int) int) + (update-bbox-for-joint (_type_ joint-exploder-list joint-exploder-joint) none) + (do-collision-response (_type_ joint-exploder-list) none) + (init-joint-list (_type_) none) + (remove-from-list-and-reset (_type_ joint-exploder-list int) int) + (final-adjust (_type_ joint-exploder-list int) int) + (integrate-and-kill (_type_ joint-exploder-list) none) + (remove-joint-from-list (_type_ joint-exploder-list int) int) + (adjust-bbox-for-limits-along-axis (_type_ joint-exploder-list int) joint-exploder-list) + (adjust-bbox-for-limits (_type_ joint-exploder-list) none) ) (:states joint-exploder-shatter @@ -228,7 +206,7 @@ ) ;; definition for method 3 of type joint-exploder -(defmethod inspect joint-exploder ((this joint-exploder)) +(defmethod inspect ((this joint-exploder)) (when (not this) (set! this this) (goto cfg-4) @@ -250,7 +228,7 @@ ;; definition for method 5 of type joint-exploder-joints ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-exploder-joints ((this joint-exploder-joints)) +(defmethod asize-of ((this joint-exploder-joints)) (the-as int (+ (-> this type size) (* 240 (-> this num-joints)))) ) @@ -300,7 +278,7 @@ ;; definition for method 24 of type joint-exploder ;; INFO: Used lq/sq -(defmethod remove-from-list-and-reset joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod remove-from-list-and-reset ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (let ((v0-0 (remove-joint-from-list this arg0 arg1))) (let* ((v1-1 (-> this joints)) (v1-2 (-> v1-1 joint arg1)) @@ -315,7 +293,7 @@ ) ;; definition for method 27 of type joint-exploder -(defmethod remove-joint-from-list joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod remove-joint-from-list ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (let* ((v1-0 (-> this joints)) (a2-1 (-> v1-0 joint arg1)) (a0-4 (-> a2-1 prev)) @@ -347,7 +325,7 @@ ) ;; definition for method 20 of type joint-exploder -(defmethod add-joint-to-list joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod add-joint-to-list ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (let* ((v1-0 (-> this joints)) (a3-0 (-> v1-0 joint arg1)) (a0-4 (-> arg0 head)) @@ -364,7 +342,7 @@ ;; definition for method 21 of type joint-exploder ;; INFO: Used lq/sq -(defmethod update-bbox-for-joint joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) +(defmethod update-bbox-for-joint ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) (let ((a1-1 (-> arg1 mat trans))) (cond ((-> arg0 bbox-valid?) @@ -383,7 +361,7 @@ ;; definition for method 28 of type joint-exploder ;; INFO: Used lq/sq -(defmethod adjust-bbox-for-limits-along-axis joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod adjust-bbox-for-limits-along-axis ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (local-vars (sv-16 int) (sv-32 int) @@ -507,7 +485,7 @@ ;; definition for method 25 of type joint-exploder ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs int. -(defmethod final-adjust joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod final-adjust ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (local-vars (sv-48 int) (sv-64 (inline-array joint-exploder-list)) (sv-80 joint-exploder-joint)) (set! (-> arg0 bbox-valid?) #f) (let ((s3-0 (-> this joints)) @@ -554,7 +532,7 @@ ;; definition for method 29 of type joint-exploder ;; WARN: Return type mismatch int vs none. -(defmethod adjust-bbox-for-limits joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) +(defmethod adjust-bbox-for-limits ((this joint-exploder) (arg0 joint-exploder-list)) (when (and (-> arg0 bbox-valid?) (>= (-> arg0 head) 0) (not (-> arg0 probeless?))) (let ((a2-0 -1)) (cond @@ -585,7 +563,7 @@ ;; definition for method 26 of type joint-exploder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod integrate-and-kill joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) +(defmethod integrate-and-kill ((this joint-exploder) (arg0 joint-exploder-list)) (set! (-> arg0 bbox-valid?) #f) (set! (-> arg0 pre-moved?) #t) (let ((s4-0 (-> this joints)) @@ -621,7 +599,7 @@ ;; definition for method 22 of type joint-exploder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-collision-response joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) +(defmethod do-collision-response ((this joint-exploder) (arg0 joint-exploder-list)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (set! (-> s5-0 collide-with) (the-as collide-spec (-> this static-params collide-spec))) (set! (-> s5-0 ignore-process0) this) @@ -739,7 +717,7 @@ ;; definition for method 23 of type joint-exploder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-joint-list joint-exploder ((this joint-exploder)) +(defmethod init-joint-list ((this joint-exploder)) (let ((gp-0 (-> this joints))) (dotimes (s4-0 (-> gp-0 num-joints)) (let ((v1-2 (-> this static-params joints s4-0)) @@ -845,7 +823,7 @@ ;; definition for method 7 of type joint-exploder ;; WARN: Return type mismatch process-drawable vs joint-exploder. -(defmethod relocate joint-exploder ((this joint-exploder) (arg0 int)) +(defmethod relocate ((this joint-exploder) (arg0 int)) (if (nonzero? (-> this joints)) (&+! (-> this joints) arg0) ) diff --git a/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc index 5b40506750d..2c3aaa5236c 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc @@ -3,26 +3,23 @@ ;; definition of type joint-control-channel (deftype joint-control-channel (structure) - ((parent joint-control :offset-assert 0) - (frame-group art-joint-anim :offset-assert 4) - (frame-num float :offset-assert 8) - (dist meters :offset-assert 12) - (num-func (function joint-control-channel float float float float) :offset-assert 16) - (param float 3 :offset-assert 20) - (frame-interp float 2 :offset-assert 32) - (inspector-amount uint8 :offset-assert 40) - (command joint-control-command :offset-assert 48) - (group-sub-index int8 :offset-assert 56) - (group-size int8 :offset-assert 57) - (eval-time uint32 :offset-assert 60) + ((parent joint-control) + (frame-group art-joint-anim) + (frame-num float) + (dist meters) + (num-func (function joint-control-channel float float float float)) + (param float 3) + (frame-interp float 2) + (inspector-amount uint8) + (command joint-control-command) + (group-sub-index int8) + (group-size int8) + (eval-time uint32) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type joint-control-channel -(defmethod inspect joint-control-channel ((this joint-control-channel)) +(defmethod inspect ((this joint-control-channel)) (when (not this) (set! this this) (goto cfg-23) @@ -82,40 +79,37 @@ ;; definition of type top-anim-joint-control (deftype top-anim-joint-control (basic) - ((process (pointer process-drawable) :offset-assert 4) - (interp-select uint64 2 :offset-assert 8) - (base-anim basic :offset-assert 24) - (base-anim-speed float :offset-assert 28) - (base-anim-blend float :offset-assert 32) - (interp float :offset-assert 36) - (frame-group art-joint-anim :offset-assert 40) - (frame-group-push art-joint-anim :offset-assert 44) - (frame-num float :offset-assert 48) - (frame-targ art-joint-anim :offset-assert 52) - (frame-speed float :offset-assert 56) - (frame-blend float :offset-assert 60) - (frame-cur-blend float :offset-assert 64) - (frame-start float :offset-assert 68) - (frame-post-blend float :offset-assert 72) - (frame-post-end float :offset-assert 76) - (frame-push-time time-frame :offset-assert 80) - (frame-post-put-away basic :offset-assert 88) - (update-time time-frame :offset-assert 96) + ((process (pointer process-drawable)) + (interp-select uint64 2) + (base-anim basic) + (base-anim-speed float) + (base-anim-blend float) + (interp float) + (frame-group art-joint-anim) + (frame-group-push art-joint-anim) + (frame-num float) + (frame-targ art-joint-anim) + (frame-speed float) + (frame-blend float) + (frame-cur-blend float) + (frame-start float) + (frame-post-blend float) + (frame-post-end float) + (frame-push-time time-frame) + (frame-post-put-away basic) + (update-time time-frame) ) - :method-count-assert 13 - :size-assert #x68 - :flag-assert #xd00000068 (:methods - (new (symbol type process-drawable) _type_ 0) - (reset (_type_) none 9) - (update (_type_) none 10) - (get-channel (_type_ int) joint-control-channel 11) - (push-anim-to-targ (_type_ art-joint-anim float int int float float symbol) none 12) + (new (symbol type process-drawable) _type_) + (reset (_type_) none) + (update (_type_) none) + (get-channel (_type_ int) joint-control-channel) + (push-anim-to-targ (_type_ art-joint-anim float int int float float symbol) none) ) ) ;; definition for method 3 of type top-anim-joint-control -(defmethod inspect top-anim-joint-control ((this top-anim-joint-control)) +(defmethod inspect ((this top-anim-joint-control)) (when (not this) (set! this this) (goto cfg-4) @@ -146,35 +140,32 @@ ;; definition of type joint-control (deftype joint-control (basic) - ((status joint-control-status :offset-assert 4) - (allocated-length uint8 :offset-assert 6) - (active-channels uint8 :offset-assert 7) - (root-channel (inline-array joint-control-channel) :offset 16) - (blend-index uint8 :offset-assert 20) - (active-frame-interp uint8 :offset-assert 21) - (float-channels uint8 :offset-assert 22) - (generate-frame-function (function joint-anim-frame int joint-control int) :offset-assert 24) - (prebind-function (function joint-anim-frame int joint-control int) :offset-assert 28) - (postbind-function (function draw-control cspace-array joint-control none) :offset-assert 32) - (effect effect-control :offset-assert 36) - (interp-select int64 2 :offset-assert 40) - (top-anim top-anim-joint-control :offset-assert 56) - (override (array float) :offset-assert 60) - (channel joint-control-channel :inline :dynamic :offset-assert 64) + ((status joint-control-status) + (allocated-length uint8) + (active-channels uint8) + (root-channel (inline-array joint-control-channel) :offset 16) + (blend-index uint8) + (active-frame-interp uint8) + (float-channels uint8) + (generate-frame-function (function joint-anim-frame int joint-control int)) + (prebind-function (function joint-anim-frame int joint-control int)) + (postbind-function (function draw-control cspace-array joint-control none)) + (effect effect-control) + (interp-select int64 2) + (top-anim top-anim-joint-control) + (override (array float)) + (channel joint-control-channel :inline :dynamic) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 (:methods - (new (symbol type int) _type_ 0) - (current-cycle-distance (_type_) float 9) - (update-anim-data (_type_) none 10) - (debug-print-channels (_type_ symbol) int 11) + (new (symbol type int) _type_) + (current-cycle-distance (_type_) float) + (update-anim-data (_type_) none) + (debug-print-channels (_type_ symbol) int) ) ) ;; definition for method 3 of type joint-control -(defmethod inspect joint-control ((this joint-control)) +(defmethod inspect ((this joint-control)) (when (not this) (set! this this) (goto cfg-28) @@ -239,16 +230,13 @@ ;; definition of type matrix-stack (deftype matrix-stack (structure) - ((top matrix :offset-assert 0) - (data matrix 24 :inline :offset-assert 16) + ((top matrix) + (data matrix 24 :inline) ) - :method-count-assert 9 - :size-assert #x610 - :flag-assert #x900000610 ) ;; definition for method 3 of type matrix-stack -(defmethod inspect matrix-stack ((this matrix-stack)) +(defmethod inspect ((this matrix-stack)) (when (not this) (set! this this) (goto cfg-4) @@ -262,21 +250,18 @@ ;; definition of type channel-upload-info (deftype channel-upload-info (structure) - ((fixed joint-anim-compressed-fixed :offset-assert 0) - (fixed-qwc int32 :offset-assert 4) - (frame joint-anim-compressed-frame :offset-assert 8) - (frame-qwc int32 :offset-assert 12) - (amount float :offset-assert 16) - (interp float :offset-assert 20) + ((fixed joint-anim-compressed-fixed) + (fixed-qwc int32) + (frame joint-anim-compressed-frame) + (frame-qwc int32) + (amount float) + (interp float) ) :pack-me - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type channel-upload-info -(defmethod inspect channel-upload-info ((this channel-upload-info)) +(defmethod inspect ((this channel-upload-info)) (when (not this) (set! this this) (goto cfg-4) @@ -294,28 +279,25 @@ ;; definition of type joint-work (deftype joint-work (structure) - ((temp-mtx matrix :inline :offset-assert 0) - (joint-stack matrix-stack :inline :offset-assert 64) - (fix-jmp-table (function none) 16 :offset-assert 1616) - (frm-jmp-table (function none) 16 :offset-assert 1680) - (pair-jmp-table (function none) 16 :offset-assert 1744) - (uploads channel-upload-info 24 :inline :offset-assert 1808) - (num-uploads int32 :offset-assert 2384) - (mtx-acc matrix 2 :inline :offset-assert 2400) - (tq-acc transformq 100 :inline :offset-assert 2528) - (jacp-hdr joint-anim-compressed-hdr :inline :offset-assert 7328) - (fixed-data joint-anim-compressed-fixed :inline :offset-assert 7392) - (frame-data joint-anim-compressed-frame 2 :inline :offset-assert 9600) - (flatten-array float 576 :offset 2400) - (flattened vector 24 :offset 2400) + ((temp-mtx matrix :inline) + (joint-stack matrix-stack :inline) + (fix-jmp-table (function none) 16) + (frm-jmp-table (function none) 16) + (pair-jmp-table (function none) 16) + (uploads channel-upload-info 24 :inline) + (num-uploads int32) + (mtx-acc matrix 2 :inline) + (tq-acc transformq 100 :inline) + (jacp-hdr joint-anim-compressed-hdr :inline) + (fixed-data joint-anim-compressed-fixed :inline) + (frame-data joint-anim-compressed-frame 2 :inline) + (flatten-array float 576 :overlay-at mtx-acc) + (flattened vector 24 :overlay-at mtx-acc) ) - :method-count-assert 9 - :size-assert #x3640 - :flag-assert #x900003640 ) ;; definition for method 3 of type joint-work -(defmethod inspect joint-work ((this joint-work)) +(defmethod inspect ((this joint-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc index 9400feef338..ba132b8c96d 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc @@ -3,61 +3,58 @@ ;; definition of type joint-mod (deftype joint-mod (basic) - ((mode joint-mod-mode :offset-assert 4) - (process process-drawable :offset-assert 8) - (joint cspace :offset-assert 12) - (target vector :inline :offset-assert 16) - (twist vector :inline :offset-assert 32) - (twist-max vector :inline :offset-assert 48) - (extra-twist degrees :offset 40) - (track-mode track-mode :offset 44) - (loock-at-count uint16 :offset 46) - (twist-range-x meters :offset 56) - (twist-range-y meters :offset 60) - (twist-speed-x float :offset 64) - (twist-speed-y float :offset 68) - (twist-min-x float :offset 72) - (twist-min-y float :offset 76) - (trans vector :inline :offset-assert 80) - (shmushy-old float :offset 80) - (smushy-off float :offset 84) - (smushyv float :offset 88) - (quat quaternion :inline :offset-assert 96) - (scale vector :inline :offset-assert 112) - (notice-time time-frame :offset-assert 128) - (flex-blend float :offset-assert 136) - (blend float :offset-assert 140) - (max-dist meters :offset-assert 144) - (ignore-angle degrees :offset-assert 148) - (up uint8 :offset-assert 152) - (nose uint8 :offset-assert 153) - (ear uint8 :offset-assert 154) - (base-joint uint8 :offset-assert 155) - (base-nose uint8 :offset-assert 156) - (shutting-down? symbol :offset-assert 160) - (parented-scale? symbol :offset-assert 164) - (polar-internal-tilt-max float :offset-assert 168) - (polar-internal-radius float :offset-assert 172) - (polar-external-tilt-max float :offset-assert 176) - (polar-external-radius float :offset-assert 180) + ((mode joint-mod-mode) + (process process-drawable) + (joint cspace) + (target vector :inline) + (twist vector :inline) + (twist-max vector :inline) + (extra-twist degrees :overlay-at (-> twist data 2)) + (track-mode track-mode :overlay-at (-> twist data 3)) + (loock-at-count uint16 :offset 46) + (twist-range-x meters :overlay-at (-> twist-max data 2)) + (twist-range-y meters :overlay-at (-> twist-max data 3)) + (twist-speed-x float :offset 64) + (twist-speed-y float :offset 68) + (twist-min-x float :offset 72) + (twist-min-y float :offset 76) + (trans vector :inline) + (shmushy-old float :overlay-at (-> trans data 0)) + (smushy-off float :overlay-at (-> trans data 1)) + (smushyv float :overlay-at (-> trans data 2)) + (quat quaternion :inline) + (scale vector :inline) + (notice-time time-frame) + (flex-blend float) + (blend float) + (max-dist meters) + (ignore-angle degrees) + (up uint8) + (nose uint8) + (ear uint8) + (base-joint uint8) + (base-nose uint8) + (shutting-down? symbol) + (parented-scale? symbol) + (polar-internal-tilt-max float) + (polar-internal-radius float) + (polar-external-tilt-max float) + (polar-external-radius float) ) - :method-count-assert 16 - :size-assert #xb8 - :flag-assert #x10000000b8 (:methods - (new (symbol type joint-mod-mode process-drawable int) _type_ 0) - (mode-set! (_type_ joint-mod-mode) none 9) - (target-set! (_type_ vector) none 10) - (look-at! (_type_ vector symbol process) none :behavior process 11) - (reset-blend! (_type_) _type_ 12) - (twist-set! (_type_ float float float) vector 13) - (trs-set! (_type_ vector quaternion vector) none 14) - (shut-down (_type_) none 15) + (new (symbol type joint-mod-mode process-drawable int) _type_) + (mode-set! (_type_ joint-mod-mode) none) + (target-set! (_type_ vector) none) + (look-at! (_type_ vector symbol process) none :behavior process) + (reset-blend! (_type_) _type_) + (twist-set! (_type_ float float float) vector) + (trs-set! (_type_ vector quaternion vector) none) + (shut-down (_type_) none) ) ) ;; definition for method 3 of type joint-mod -(defmethod inspect joint-mod ((this joint-mod)) +(defmethod inspect ((this joint-mod)) (when (not this) (set! this this) (goto cfg-18) @@ -130,17 +127,14 @@ ;; definition of type try-to-look-at-info (deftype try-to-look-at-info (basic) - ((who handle :offset-assert 8) - (horz float :offset-assert 16) - (vert float :offset-assert 20) + ((who handle) + (horz float) + (vert float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type try-to-look-at-info -(defmethod inspect try-to-look-at-info ((this try-to-look-at-info)) +(defmethod inspect ((this try-to-look-at-info)) (when (not this) (set! this this) (goto cfg-4) @@ -162,7 +156,7 @@ ) ;; definition for method 12 of type joint-mod -(defmethod reset-blend! joint-mod ((this joint-mod)) +(defmethod reset-blend! ((this joint-mod)) (set! (-> this blend) 0.0) this ) @@ -180,22 +174,19 @@ ;; definition of type joint-mod-wheel (deftype joint-mod-wheel (basic) - ((last-position vector :inline :offset-assert 16) - (angle float :offset-assert 32) - (process process-drawable :offset-assert 36) - (wheel-radius float :offset-assert 40) - (wheel-axis int8 :offset-assert 44) + ((last-position vector :inline) + (angle float) + (process process-drawable) + (wheel-radius float) + (wheel-axis int8) ) - :method-count-assert 9 - :size-assert #x2d - :flag-assert #x90000002d (:methods - (new (symbol type process-drawable int float int) _type_ 0) + (new (symbol type process-drawable int float int) _type_) ) ) ;; definition for method 3 of type joint-mod-wheel -(defmethod inspect joint-mod-wheel ((this joint-mod-wheel)) +(defmethod inspect ((this joint-mod-wheel)) (when (not this) (set! this this) (goto cfg-4) @@ -257,22 +248,19 @@ ;; definition of type joint-mod-set-local (deftype joint-mod-set-local (basic) - ((transform transformq :inline :offset-assert 16) - (set-rotation symbol :offset-assert 64) - (set-scale symbol :offset-assert 68) - (set-translation symbol :offset-assert 72) - (enable symbol :offset-assert 76) + ((transform transformq :inline) + (set-rotation symbol) + (set-scale symbol) + (set-translation symbol) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 (:methods - (new (symbol type process-drawable int symbol symbol symbol) _type_ 0) + (new (symbol type process-drawable int symbol symbol symbol) _type_) ) ) ;; definition for method 3 of type joint-mod-set-local -(defmethod inspect joint-mod-set-local ((this joint-mod-set-local)) +(defmethod inspect ((this joint-mod-set-local)) (when (not this) (set! this this) (goto cfg-4) @@ -340,22 +328,19 @@ ;; definition of type joint-mod-add-local (deftype joint-mod-add-local (basic) - ((transform transformq :inline :offset-assert 16) - (add-rotation symbol :offset-assert 64) - (add-scale symbol :offset-assert 68) - (add-translation symbol :offset-assert 72) - (enable symbol :offset-assert 76) + ((transform transformq :inline) + (add-rotation symbol) + (add-scale symbol) + (add-translation symbol) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 (:methods - (new (symbol type process-drawable int symbol symbol symbol) _type_ 0) + (new (symbol type process-drawable int symbol symbol symbol) _type_) ) ) ;; definition for method 3 of type joint-mod-add-local -(defmethod inspect joint-mod-add-local ((this joint-mod-add-local)) +(defmethod inspect ((this joint-mod-add-local)) (when (not this) (set! this this) (goto cfg-4) @@ -417,20 +402,17 @@ ;; definition of type joint-mod-set-world (deftype joint-mod-set-world (basic) - ((transform transformq :inline :offset-assert 16) - (node-index int32 :offset-assert 64) - (enable symbol :offset-assert 68) + ((transform transformq :inline) + (node-index int32) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 (:methods - (new (symbol type process-drawable int symbol) _type_ 0) + (new (symbol type process-drawable int symbol) _type_) ) ) ;; definition for method 3 of type joint-mod-set-world -(defmethod inspect joint-mod-set-world ((this joint-mod-set-world)) +(defmethod inspect ((this joint-mod-set-world)) (when (not this) (set! this this) (goto cfg-4) @@ -474,22 +456,19 @@ ;; definition of type joint-mod-blend-local (deftype joint-mod-blend-local (basic) - ((transform transformq :inline :offset-assert 16) - (blend-transform transformq :inline :offset-assert 64) - (node-index int32 :offset-assert 112) - (blend float :offset-assert 116) - (enable symbol :offset-assert 120) + ((transform transformq :inline) + (blend-transform transformq :inline) + (node-index int32) + (blend float) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x7c - :flag-assert #x90000007c (:methods - (new (symbol type process-drawable int symbol) _type_ 0) + (new (symbol type process-drawable int symbol) _type_) ) ) ;; definition for method 3 of type joint-mod-blend-local -(defmethod inspect joint-mod-blend-local ((this joint-mod-blend-local)) +(defmethod inspect ((this joint-mod-blend-local)) (when (not this) (set! this this) (goto cfg-4) @@ -547,21 +526,18 @@ ;; definition of type joint-mod-spinner (deftype joint-mod-spinner (basic) - ((spin-axis vector :inline :offset-assert 16) - (angle float :offset-assert 32) - (spin-rate float :offset-assert 36) - (enable symbol :offset-assert 40) + ((spin-axis vector :inline) + (angle float) + (spin-rate float) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c (:methods - (new (symbol type process-drawable int vector float) _type_ 0) + (new (symbol type process-drawable int vector float) _type_) ) ) ;; definition for method 3 of type joint-mod-spinner -(defmethod inspect joint-mod-spinner ((this joint-mod-spinner)) +(defmethod inspect ((this joint-mod-spinner)) (when (not this) (set! this this) (goto cfg-4) @@ -610,23 +586,20 @@ ;; definition of type joint-mod-blend-world (deftype joint-mod-blend-world (basic) - ((transform transformq :inline :offset-assert 16) - (blend-transform transformq :inline :offset-assert 64) - (blend-flags joint-mod-blend-flags :offset-assert 112) - (node-index int32 :offset-assert 116) - (blend float :offset-assert 120) - (enable symbol :offset-assert 124) + ((transform transformq :inline) + (blend-transform transformq :inline) + (blend-flags joint-mod-blend-flags) + (node-index int32) + (blend float) + (enable symbol) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 (:methods - (new (symbol type process-drawable int symbol float) _type_ 0) + (new (symbol type process-drawable int symbol float) _type_) ) ) ;; definition for method 3 of type joint-mod-blend-world -(defmethod inspect joint-mod-blend-world ((this joint-mod-blend-world)) +(defmethod inspect ((this joint-mod-blend-world)) (when (not this) (set! this this) (goto cfg-4) @@ -741,19 +714,16 @@ ;; definition of type joint-mod-rotate-local (deftype joint-mod-rotate-local (basic) - ((enable symbol :offset-assert 4) - (rotation quaternion :inline :offset-assert 16) + ((enable symbol) + (rotation quaternion :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 (:methods - (new (symbol type process-drawable int symbol) _type_ 0) + (new (symbol type process-drawable int symbol) _type_) ) ) ;; definition for method 3 of type joint-mod-rotate-local -(defmethod inspect joint-mod-rotate-local ((this joint-mod-rotate-local)) +(defmethod inspect ((this joint-mod-rotate-local)) (when (not this) (set! this this) (goto cfg-4) @@ -792,34 +762,31 @@ ;; definition of type joint-mod-ik (deftype joint-mod-ik (basic) - ((flags joint-mod-ik-flags :offset-assert 4) - (process process-drawable :offset-assert 8) - (hand-dist float :offset-assert 12) - (handle-pos vector :inline :offset-assert 16) - (elbow-pole-vector-axis uint32 :offset-assert 32) - (elbow-rotation-axis uint32 :offset-assert 36) - (user-position vector :inline :offset-assert 48) - (user-normal vector :inline :offset-assert 64) - (user-blend float :offset-assert 80) - (user-float float :offset-assert 84) - (callback (function joint-mod-ik matrix matrix vector object) :offset-assert 88) - (shoulder-matrix-no-ik matrix :inline :offset-assert 96) - (elbow-matrix-no-ik matrix :inline :offset-assert 160) - (blend float :offset-assert 224) - (blend-interp float :offset-assert 228) + ((flags joint-mod-ik-flags) + (process process-drawable) + (hand-dist float) + (handle-pos vector :inline) + (elbow-pole-vector-axis uint32) + (elbow-rotation-axis uint32) + (user-position vector :inline) + (user-normal vector :inline) + (user-blend float) + (user-float float) + (callback (function joint-mod-ik matrix matrix vector object)) + (shoulder-matrix-no-ik matrix :inline) + (elbow-matrix-no-ik matrix :inline) + (blend float) + (blend-interp float) ) - :method-count-assert 11 - :size-assert #xe8 - :flag-assert #xb000000e8 (:methods - (new (symbol type process-drawable int float) _type_ 0) - (handle-copy! (_type_ vector) none 9) - (enable-set! (_type_ symbol) none 10) + (new (symbol type process-drawable int float) _type_) + (handle-copy! (_type_ vector) none) + (enable-set! (_type_ symbol) none) ) ) ;; definition for method 3 of type joint-mod-ik -(defmethod inspect joint-mod-ik ((this joint-mod-ik)) +(defmethod inspect ((this joint-mod-ik)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc index 36f5414b259..afc87a2f5a9 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc @@ -308,7 +308,7 @@ ;; definition for method 9 of type joint-mod-ik ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod handle-copy! joint-mod-ik ((this joint-mod-ik) (arg0 vector)) +(defmethod handle-copy! ((this joint-mod-ik) (arg0 vector)) (set! (-> this handle-pos quad) (-> arg0 quad)) 0 (none) @@ -316,7 +316,7 @@ ;; definition for method 10 of type joint-mod-ik ;; WARN: Return type mismatch int vs none. -(defmethod enable-set! joint-mod-ik ((this joint-mod-ik) (arg0 symbol)) +(defmethod enable-set! ((this joint-mod-ik) (arg0 symbol)) (if arg0 (logior! (-> this flags) (joint-mod-ik-flags enable)) (logclear! (-> this flags) (joint-mod-ik-flags enable)) @@ -584,7 +584,7 @@ ;; definition for method 9 of type joint-mod ;; WARN: Return type mismatch joint-mod vs none. -(defmethod mode-set! joint-mod ((this joint-mod) (arg0 joint-mod-mode)) +(defmethod mode-set! ((this joint-mod) (arg0 joint-mod-mode)) (set! (-> this mode) arg0) (let ((v1-0 (-> this joint))) (case arg0 @@ -693,14 +693,14 @@ ;; definition for method 15 of type joint-mod ;; WARN: Return type mismatch joint-mod vs none. -(defmethod shut-down joint-mod ((this joint-mod)) +(defmethod shut-down ((this joint-mod)) (set! (-> this shutting-down?) #t) (set! (-> this blend) 0.0) (none) ) ;; definition for method 13 of type joint-mod -(defmethod twist-set! joint-mod ((this joint-mod) (arg0 float) (arg1 float) (arg2 float)) +(defmethod twist-set! ((this joint-mod) (arg0 float) (arg1 float) (arg2 float)) (if arg0 (set! (-> this twist x) arg0) ) @@ -716,7 +716,7 @@ ;; definition for method 14 of type joint-mod ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod trs-set! joint-mod ((this joint-mod) (arg0 vector) (arg1 quaternion) (arg2 vector)) +(defmethod trs-set! ((this joint-mod) (arg0 vector) (arg1 quaternion) (arg2 vector)) (if arg0 (set! (-> this trans quad) (-> arg0 quad)) ) @@ -733,7 +733,7 @@ ;; definition for method 10 of type joint-mod ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod target-set! joint-mod ((this joint-mod) (arg0 vector)) +(defmethod target-set! ((this joint-mod) (arg0 vector)) (if (= (-> this mode) (joint-mod-mode reset)) (mode-set! this (joint-mod-mode look-at)) ) @@ -755,7 +755,7 @@ ;; definition for method 11 of type joint-mod ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod look-at! joint-mod ((this joint-mod) (arg0 vector) (arg1 symbol) (arg2 process)) +(defmethod look-at! ((this joint-mod) (arg0 vector) (arg1 symbol) (arg2 process)) (when (= arg1 'attacking) (let* ((s2-0 arg2) (s1-0 (if (type? s2-0 process-drawable) diff --git a/test/decompiler/reference/jak2/engine/anim/joint_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint_REF.gc index fdafe5536da..9625a2b39a5 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint_REF.gc @@ -2,13 +2,13 @@ (in-package goal) ;; definition for method 2 of type joint -(defmethod print joint ((this joint)) +(defmethod print ((this joint)) (format #t "#<~A ~S ~D @ #x~X>" (-> this type) (-> this name) (-> this number) this) this ) ;; definition for method 8 of type joint -(defmethod mem-usage joint ((this joint) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this joint) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 68 (-> arg0 length))) (set! (-> arg0 data 67 name) "joint") (+! (-> arg0 data 67 count) 1) @@ -20,31 +20,31 @@ ) ;; definition for method 2 of type joint-anim -(defmethod print joint-anim ((this joint-anim)) +(defmethod print ((this joint-anim)) (format #t "#<~A ~S ~D [~D] @ #x~X>" (-> this type) (-> this name) (-> this number) (-> this length) this) this ) ;; definition for method 4 of type joint-anim -(defmethod length joint-anim ((this joint-anim)) +(defmethod length ((this joint-anim)) (-> this length) ) ;; definition for method 5 of type joint-anim-matrix ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-matrix ((this joint-anim-matrix)) +(defmethod asize-of ((this joint-anim-matrix)) (the-as int (+ (-> joint-anim-matrix size) (* (-> this length) 64))) ) ;; definition for method 5 of type joint-anim-transformq ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-transformq ((this joint-anim-transformq)) +(defmethod asize-of ((this joint-anim-transformq)) (the-as int (+ (-> joint-anim-transformq size) (* 48 (-> this length)))) ) ;; definition for method 5 of type joint-anim-drawable ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-drawable ((this joint-anim-drawable)) +(defmethod asize-of ((this joint-anim-drawable)) (the-as int (+ (-> joint-anim-drawable size) (* (-> this length) 4))) ) @@ -72,7 +72,7 @@ ) ;; definition for method 8 of type joint-anim-drawable -(defmethod mem-usage joint-anim-drawable ((this joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 80 (-> arg0 length))) (set! (-> arg0 data 79 name) "joint-anim-drawable") (+! (-> arg0 data 79 count) 1) @@ -115,7 +115,7 @@ ) ;; definition for method 2 of type joint-control-channel -(defmethod print joint-control-channel ((this joint-control-channel)) +(defmethod print ((this joint-control-channel)) (let ((t9-0 format) (a0-1 #t) (a1-0 "#") @@ -157,7 +157,7 @@ ;; definition for method 5 of type joint-control ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-control ((this joint-control)) +(defmethod asize-of ((this joint-control)) (the-as int (+ (-> this type size) (* (-> this allocated-length) 64))) ) @@ -183,7 +183,7 @@ ) ;; definition for method 11 of type joint-control -(defmethod debug-print-channels joint-control ((this joint-control) (arg0 symbol)) +(defmethod debug-print-channels ((this joint-control) (arg0 symbol)) (format arg0 "~0K") (dotimes (s4-0 (the-as int (+ (-> this active-channels) (-> this float-channels)))) (let* ((s3-0 (-> this channel s4-0)) @@ -271,35 +271,35 @@ ) ;; definition for method 12 of type art -(defmethod needs-link? art ((this art)) +(defmethod needs-link? ((this art)) #f ) ;; definition for method 10 of type art ;; WARN: Return type mismatch symbol vs basic. -(defmethod get-art-by-name-method art ((this art) (arg0 string) (arg1 type)) +(defmethod get-art-by-name-method ((this art) (arg0 string) (arg1 type)) (the-as basic #f) ) ;; definition for method 11 of type art ;; WARN: Return type mismatch symbol vs int. -(defmethod get-art-idx-by-name-method art ((this art) (arg0 string) (arg1 type)) +(defmethod get-art-idx-by-name-method ((this art) (arg0 string) (arg1 type)) (the-as int #f) ) ;; definition for method 2 of type art -(defmethod print art ((this art)) +(defmethod print ((this art)) (format #t "#<~A ~S :length ~D @ #x~X>" (-> this type) (-> this name) (-> this length) this) this ) ;; definition for method 4 of type art -(defmethod length art ((this art)) +(defmethod length ((this art)) (-> this length) ) ;; definition for method 9 of type art -(defmethod login art ((this art)) +(defmethod login ((this art)) (if (and (-> this extra) (zero? (-> this extra tag))) (set! (-> this extra tag) (the-as (pointer res-tag) (&+ (the-as pointer (-> this extra)) 28))) ) @@ -307,7 +307,7 @@ ) ;; definition for method 8 of type art-mesh-anim -(defmethod mem-usage art-mesh-anim ((this art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 75 (-> arg0 length))) (set! (-> arg0 data 74 name) "art-mesh-anim") (+! (-> arg0 data 74 count) 1) @@ -325,7 +325,7 @@ ) ;; definition for method 8 of type art-joint-anim -(defmethod mem-usage art-joint-anim ((this art-joint-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-joint-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 78 (-> arg0 length))) (set! (-> arg0 data 77 name) "art-joint-anim") (+! (-> arg0 data 77 count) 1) @@ -351,12 +351,12 @@ ;; definition for method 5 of type art-joint-anim ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of art-joint-anim ((this art-joint-anim)) +(defmethod asize-of ((this art-joint-anim)) (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 3 of type art-group -(defmethod inspect art-group ((this art-group)) +(defmethod inspect ((this art-group)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tinfo: ~A~%" (-> this info)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -373,7 +373,7 @@ ) ;; definition for method 12 of type art-group -(defmethod needs-link? art-group ((this art-group)) +(defmethod needs-link? ((this art-group)) (and (nonzero? (-> this length)) (type? (-> this data 0) art-joint-anim) (!= (-> this name) (-> (the-as art-joint-anim (-> this data 0)) master-art-group-name)) @@ -382,7 +382,7 @@ ;; definition for method 10 of type art-group ;; WARN: Return type mismatch art-element vs basic. -(defmethod get-art-by-name-method art-group ((this art-group) (arg0 string) (arg1 type)) +(defmethod get-art-by-name-method ((this art-group) (arg0 string) (arg1 type)) (cond (arg1 (let ((s3-0 (+ (length (-> this name)) 1))) @@ -409,7 +409,7 @@ ) ;; definition for method 11 of type art-group -(defmethod get-art-idx-by-name-method art-group ((this art-group) (arg0 string) (arg1 type)) +(defmethod get-art-idx-by-name-method ((this art-group) (arg0 string) (arg1 type)) (cond (arg1 (let ((s3-0 (+ (length (-> this name)) 1))) @@ -436,7 +436,7 @@ ) ;; definition for method 9 of type art-group -(defmethod login art-group ((this art-group)) +(defmethod login ((this art-group)) (dotimes (s5-0 (-> this length)) (if (-> this data s5-0) (set! (-> this data s5-0) (login (-> this data s5-0))) @@ -446,7 +446,7 @@ ) ;; definition for method 8 of type art-group -(defmethod mem-usage art-group ((this art-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 74 (-> arg0 length))) (set! (-> arg0 data 73 name) "art-group") (+! (-> arg0 data 73 count) 1) @@ -467,7 +467,7 @@ ;; definition for method 7 of type art-group ;; WARN: Return type mismatch art-group vs none. -(defmethod relocate art-group ((this art-group) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate ((this art-group) (arg0 kheap) (arg1 (pointer uint8))) (let ((s4-0 (clear *temp-string*))) (string<-charp s4-0 arg1) (set! this @@ -534,12 +534,12 @@ ;; definition for method 5 of type art-mesh-geo ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of art-mesh-geo ((this art-mesh-geo)) +(defmethod asize-of ((this art-mesh-geo)) (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 8 of type art-mesh-geo -(defmethod mem-usage art-mesh-geo ((this art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 76 (-> arg0 length))) (set! (-> arg0 data 75 name) "art-mesh-geo") (+! (-> arg0 data 75 count) 1) @@ -557,7 +557,7 @@ ) ;; definition for method 9 of type art-mesh-geo -(defmethod login art-mesh-geo ((this art-mesh-geo)) +(defmethod login ((this art-mesh-geo)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (the-as object (-> this data s5-0)))) (dotimes (s3-0 (-> (the-as (pointer int16) s4-0) 3)) @@ -571,7 +571,7 @@ ) ;; definition for method 9 of type art-joint-anim -(defmethod login art-joint-anim ((this art-joint-anim)) +(defmethod login ((this art-joint-anim)) (if (and (-> this extra) (zero? (-> this extra tag))) (set! (-> this extra tag) (the-as (pointer res-tag) (&+ (the-as pointer (-> this extra)) 28))) ) @@ -580,13 +580,13 @@ ;; definition for method 5 of type art-joint-geo ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of art-joint-geo ((this art-joint-geo)) +(defmethod asize-of ((this art-joint-geo)) (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 10 of type art-joint-geo ;; WARN: Return type mismatch joint vs basic. -(defmethod get-art-by-name-method art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) +(defmethod get-art-by-name-method ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 (dotimes (s3-0 (-> this length)) @@ -608,7 +608,7 @@ ) ;; definition for method 11 of type art-joint-geo -(defmethod get-art-idx-by-name-method art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) +(defmethod get-art-idx-by-name-method ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 (dotimes (s3-0 (-> this length)) @@ -630,7 +630,7 @@ ) ;; definition for method 8 of type art-joint-geo -(defmethod mem-usage art-joint-geo ((this art-joint-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this art-joint-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 77 (-> arg0 length))) (set! (-> arg0 data 76 name) "art-joint-geo") (+! (-> arg0 data 76 count) 1) @@ -1185,7 +1185,7 @@ ) ;; definition for method 9 of type cspace -(defmethod reset-and-assign-geo! cspace ((this cspace) (arg0 drawable)) +(defmethod reset-and-assign-geo! ((this cspace) (arg0 drawable)) (set! (-> this parent) #f) (set! (-> this joint) #f) (set! (-> this geo) arg0) @@ -2056,7 +2056,7 @@ ) ;; definition for method 2 of type art-joint-anim-manager-slot -(defmethod print art-joint-anim-manager-slot ((this art-joint-anim-manager-slot)) +(defmethod print ((this art-joint-anim-manager-slot)) (let* ((gp-0 format) (s5-0 #t) (s4-0 "#") @@ -2094,7 +2094,7 @@ ) ;; definition for method 12 of type art-joint-anim-manager -(defmethod used-bytes-for-slot art-joint-anim-manager ((this art-joint-anim-manager) (arg0 int)) +(defmethod used-bytes-for-slot ((this art-joint-anim-manager) (arg0 int)) (let ((v1-2 (-> this slot arg0))) (if (< arg0 (+ (-> this free-index) -1)) (&- @@ -2107,7 +2107,7 @@ ) ;; definition for method 11 of type art-joint-anim-manager -(defmethod unload-from-slot art-joint-anim-manager ((this art-joint-anim-manager) (arg0 int)) +(defmethod unload-from-slot ((this art-joint-anim-manager) (arg0 int)) (let* ((s3-0 (-> this slot arg0)) (s5-0 (-> s3-0 anim)) ) @@ -2168,7 +2168,7 @@ ) ;; definition for method 10 of type art-joint-anim-manager -(defmethod update-time-stamp art-joint-anim-manager ((this art-joint-anim-manager) (arg0 art-joint-anim)) +(defmethod update-time-stamp ((this art-joint-anim-manager) (arg0 art-joint-anim)) (countdown (v1-0 (-> this free-index)) (when (= arg0 (-> this slot v1-0 anim)) (set! (-> this slot v1-0 time-stamp) (the-as uint (-> *display* base-clock frame-counter))) @@ -2179,7 +2179,7 @@ ) ;; definition for method 9 of type art-joint-anim-manager -(defmethod decompress art-joint-anim-manager ((this art-joint-anim-manager) (arg0 art-joint-anim)) +(defmethod decompress ((this art-joint-anim-manager) (arg0 art-joint-anim)) (let* ((s5-0 (-> arg0 frames)) (s3-0 (* (+ (-> s5-0 fixed-qwc) (* (-> s5-0 num-frames) (-> s5-0 frame-qwc))) 16)) ) @@ -2226,7 +2226,7 @@ ;; definition for method 13 of type art-joint-anim-manager ;; WARN: Return type mismatch int vs none. -(defmethod unload-from-level art-joint-anim-manager ((this art-joint-anim-manager) (arg0 level)) +(defmethod unload-from-level ((this art-joint-anim-manager) (arg0 level)) (let ((s5-0 (-> arg0 heap base)) (s4-0 (-> arg0 heap top-base)) ) diff --git a/test/decompiler/reference/jak2/engine/anim/mspace-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/mspace-h_REF.gc index 3424ae91411..e3550420044 100644 --- a/test/decompiler/reference/jak2/engine/anim/mspace-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/mspace-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type joint (deftype joint (basic) - ((name basic :offset-assert 4) - (number int32 :offset-assert 8) - (parent joint :offset-assert 12) - (bind-pose matrix :inline :offset-assert 16) + ((name basic) + (number int32) + (parent joint) + (bind-pose matrix :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type joint -(defmethod inspect joint ((this joint)) +(defmethod inspect ((this joint)) (when (not this) (set! this this) (goto cfg-4) @@ -30,18 +27,15 @@ ;; definition of type bone-cache (deftype bone-cache (structure) - ((bone-matrix uint32 :offset-assert 0) - (parent-matrix uint32 :offset-assert 4) - (dummy uint32 :offset-assert 8) - (frame uint32 :offset-assert 12) + ((bone-matrix uint32) + (parent-matrix uint32) + (dummy uint32) + (frame uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type bone-cache -(defmethod inspect bone-cache ((this bone-cache)) +(defmethod inspect ((this bone-cache)) (when (not this) (set! this this) (goto cfg-4) @@ -57,17 +51,14 @@ ;; definition of type bone (deftype bone (structure) - ((transform matrix :inline :offset-assert 0) - (position vector :inline :offset 48) - (scale vector :inline :offset-assert 64) + ((transform matrix :inline) + (position vector :inline :overlay-at (-> transform data 12)) + (scale vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type bone -(defmethod inspect bone ((this bone)) +(defmethod inspect ((this bone)) (when (not this) (set! this this) (goto cfg-4) @@ -82,15 +73,12 @@ ;; definition of type skeleton (deftype skeleton (inline-array-class) - ((bones bone :inline :dynamic :offset-assert 16) + ((bones bone :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type skeleton -(defmethod inspect skeleton ((this skeleton)) +(defmethod inspect ((this skeleton)) (when (not this) (set! this this) (goto cfg-4) @@ -108,26 +96,23 @@ ;; definition of type cspace (deftype cspace (structure) - ((parent cspace :offset-assert 0) - (joint joint :offset-assert 4) - (joint-num int16 :offset-assert 8) - (geo drawable :offset-assert 12) - (bone bone :offset-assert 16) - (param0 (function cspace transformq none) :offset-assert 20) - (param1 basic :offset-assert 24) - (param2 basic :offset-assert 28) + ((parent cspace) + (joint joint) + (joint-num int16) + (geo drawable) + (bone bone) + (param0 (function cspace transformq none)) + (param1 basic) + (param2 basic) ) - :method-count-assert 10 - :size-assert #x20 - :flag-assert #xa00000020 (:methods - (new (symbol type drawable) _type_ 0) - (reset-and-assign-geo! (_type_ drawable) _type_ 9) + (new (symbol type drawable) _type_) + (reset-and-assign-geo! (_type_ drawable) _type_) ) ) ;; definition for method 3 of type cspace -(defmethod inspect cspace ((this cspace)) +(defmethod inspect ((this cspace)) (when (not this) (set! this this) (goto cfg-4) @@ -147,15 +132,12 @@ ;; definition of type cspace-array (deftype cspace-array (inline-array-class) - ((data cspace :inline :dynamic :offset-assert 16) + ((data cspace :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type cspace-array -(defmethod inspect cspace-array ((this cspace-array)) +(defmethod inspect ((this cspace-array)) (when (not this) (set! this this) (goto cfg-4) @@ -172,7 +154,7 @@ (set! (-> cspace-array heap-base) (the-as uint 32)) ;; definition for method 2 of type cspace -(defmethod print cspace ((this cspace)) +(defmethod print ((this cspace)) (format #t "#" diff --git a/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc index 5572d20bca9..eb443c7a6f2 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc @@ -36,30 +36,27 @@ ;; definition of type cam-dbg-scratch (deftype cam-dbg-scratch (structure) - ((linevec4w vector4w 2 :inline :offset-assert 0) - (color vector4w :inline :offset-assert 32) - (plotvec vector4w 2 :inline :offset-assert 48) - (linevec vector4w 2 :inline :offset-assert 80) - (rel-vec vector :inline :offset-assert 112) - (sphere-v-start vector :inline :offset-assert 128) - (sphere-v-end vector :inline :offset-assert 144) - (sphere-v-down vector :inline :offset-assert 160) - (sphere-vec vector :inline :offset-assert 176) - (crossvec vector 3 :inline :offset-assert 192) - (bboxvec vector 6 :inline :offset-assert 240) - (fov-vv vector 4 :inline :offset-assert 336) - (fov-src vector :inline :offset-assert 400) - (fov-dest vector :inline :offset-assert 416) - (fov-vert vector :inline :offset-assert 432) - (fov-horz vector :inline :offset-assert 448) + ((linevec4w vector4w 2 :inline) + (color vector4w :inline) + (plotvec vector4w 2 :inline) + (linevec vector4w 2 :inline) + (rel-vec vector :inline) + (sphere-v-start vector :inline) + (sphere-v-end vector :inline) + (sphere-v-down vector :inline) + (sphere-vec vector :inline) + (crossvec vector 3 :inline) + (bboxvec vector 6 :inline) + (fov-vv vector 4 :inline) + (fov-src vector :inline) + (fov-dest vector :inline) + (fov-vert vector :inline) + (fov-horz vector :inline) ) - :method-count-assert 9 - :size-assert #x1d0 - :flag-assert #x9000001d0 ) ;; definition for method 3 of type cam-dbg-scratch -(defmethod inspect cam-dbg-scratch ((this cam-dbg-scratch)) +(defmethod inspect ((this cam-dbg-scratch)) (when (not this) (set! this this) (goto cfg-4) @@ -620,17 +617,14 @@ ;; definition of type cam-debug-tri (deftype cam-debug-tri (structure) - ((vertex vector 3 :inline :offset-assert 0) - (intersect vector :inline :offset-assert 48) - (color vector4w :offset-assert 64) + ((vertex vector 3 :inline) + (intersect vector :inline) + (color vector4w) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) ;; definition for method 3 of type cam-debug-tri -(defmethod inspect cam-debug-tri ((this cam-debug-tri)) +(defmethod inspect ((this cam-debug-tri)) (when (not this) (set! this this) (goto cfg-4) @@ -900,7 +894,7 @@ ;; definition for method 11 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod debug-point-info tracking-spline ((this tracking-spline) (arg0 int)) +(defmethod debug-point-info ((this tracking-spline) (arg0 int)) (if (= arg0 (-> this used-point)) (format 0 "u") (format 0 " ") @@ -930,7 +924,7 @@ ;; definition for method 12 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod debug-all-points tracking-spline ((this tracking-spline)) +(defmethod debug-all-points ((this tracking-spline)) (let ((s5-0 (-> this used-point))) (while (!= s5-0 -134250495) (debug-point-info this s5-0) @@ -944,7 +938,7 @@ ;; definition for method 23 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-spline tracking-spline ((this tracking-spline)) +(defmethod debug-draw-spline ((this tracking-spline)) (let ((s5-0 (-> this used-point))) (let ((s4-0 (-> this point (-> this used-point) next))) (let ((s3-0 (new 'stack-no-clear 'vector))) @@ -1385,29 +1379,26 @@ ;; definition of type cam-collision-record (deftype cam-collision-record (structure) - ((pos vector :inline :offset-assert 0) - (vel vector :inline :offset-assert 16) - (desired-pos vector :inline :offset-assert 32) - (cam-tpos-cur vector :inline :offset-assert 48) - (cam-tpos-old vector :inline :offset-assert 64) - (view-flat vector :inline :offset-assert 80) - (string-min-val vector :inline :offset-assert 96) - (string-max-val vector :inline :offset-assert 112) - (view-off vector :inline :offset-assert 128) - (min-z-override float :offset-assert 144) - (string-push-z float :offset-assert 148) - (view-off-param float :offset-assert 152) - (frame int32 :offset-assert 156) - (iteration int32 :offset-assert 160) - (move-type symbol :offset-assert 164) + ((pos vector :inline) + (vel vector :inline) + (desired-pos vector :inline) + (cam-tpos-cur vector :inline) + (cam-tpos-old vector :inline) + (view-flat vector :inline) + (string-min-val vector :inline) + (string-max-val vector :inline) + (view-off vector :inline) + (min-z-override float) + (string-push-z float) + (view-off-param float) + (frame int32) + (iteration int32) + (move-type symbol) ) - :method-count-assert 9 - :size-assert #xa8 - :flag-assert #x9000000a8 ) ;; definition for method 3 of type cam-collision-record -(defmethod inspect cam-collision-record ((this cam-collision-record)) +(defmethod inspect ((this cam-collision-record)) (when (not this) (set! this this) (goto cfg-4) @@ -1434,15 +1425,12 @@ ;; definition of type cam-collision-record-array (deftype cam-collision-record-array (inline-array-class) - ((data cam-collision-record :dynamic :offset-assert 16) + ((data cam-collision-record :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type cam-collision-record-array -(defmethod inspect cam-collision-record-array ((this cam-collision-record-array)) +(defmethod inspect ((this cam-collision-record-array)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc index 500d7eb5896..ad8a169f33a 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc @@ -9,20 +9,17 @@ ;; definition of type cam-layout-bank (deftype cam-layout-bank (basic) - ((spline-t float :offset-assert 4) - (spline-step float :offset-assert 8) - (intro-t float :offset-assert 12) - (intro-step float :offset-assert 16) - (debug-t float :offset-assert 20) - (debug-step float :offset-assert 24) + ((spline-t float) + (spline-step float) + (intro-t float) + (intro-step float) + (debug-t float) + (debug-step float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type cam-layout-bank -(defmethod inspect cam-layout-bank ((this cam-layout-bank)) +(defmethod inspect ((this cam-layout-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -55,13 +52,10 @@ ;; definition of type clm-basic (deftype clm-basic (basic) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type clm-basic -(defmethod inspect clm-basic ((this clm-basic)) +(defmethod inspect ((this clm-basic)) (when (not this) (set! this this) (goto cfg-4) @@ -73,22 +67,19 @@ ;; definition of type clm-item-action (deftype clm-item-action (structure) - ((button uint64 :offset-assert 0) - (options uint64 :offset-assert 8) - (func symbol :offset-assert 16) - (parm0 int32 :offset 20) - (parm0-symbol symbol :offset 20) - (parm0-basic basic :offset 20) - (parm1 symbol :offset 24) - (parm1-basic basic :offset 24) + ((button uint64) + (options uint64) + (func symbol) + (parm0 int32 :offset 20) + (parm0-symbol symbol :overlay-at parm0) + (parm0-basic basic :overlay-at parm0-symbol) + (parm1 symbol :offset 24) + (parm1-basic basic :overlay-at parm1) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type clm-item-action -(defmethod inspect clm-item-action ((this clm-item-action)) +(defmethod inspect ((this clm-item-action)) (when (not this) (set! this this) (goto cfg-4) @@ -105,17 +96,14 @@ ;; definition of type clm-item (deftype clm-item (clm-basic) - ((description string :offset-assert 4) - (button-symbol symbol :offset-assert 8) - (action clm-item-action :inline :offset-assert 16) + ((description string) + (button-symbol symbol) + (action clm-item-action :inline) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type clm-item -(defmethod inspect clm-item ((this clm-item)) +(defmethod inspect ((this clm-item)) (when (not this) (set! this this) (goto cfg-4) @@ -130,23 +118,20 @@ ;; definition of type clm-list-item (deftype clm-list-item (basic) - ((description string :offset-assert 4) - (track-val symbol :offset-assert 8) - (val-func symbol :offset-assert 12) - (val-parm0 int32 :offset 16) - (val-parm0-symbol symbol :offset 16) - (val-parm0-basic basic :offset 16) - (val-parm1 symbol :offset 20) - (val-parm1-basic basic :offset 20) - (actions (array clm-item-action) :offset-assert 24) + ((description string) + (track-val symbol) + (val-func symbol) + (val-parm0 int32 :offset 16) + (val-parm0-symbol symbol :overlay-at val-parm0) + (val-parm0-basic basic :overlay-at val-parm0-symbol) + (val-parm1 symbol :offset 20) + (val-parm1-basic basic :overlay-at val-parm1) + (actions (array clm-item-action)) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type clm-list-item -(defmethod inspect clm-list-item ((this clm-list-item)) +(defmethod inspect ((this clm-list-item)) (when (not this) (set! this this) (goto cfg-4) @@ -164,17 +149,14 @@ ;; definition of type clm-list (deftype clm-list (clm-basic) - ((tracker symbol :offset-assert 4) - (cur-list-item int32 :offset-assert 8) - (items (array clm-list-item) :offset-assert 12) + ((tracker symbol) + (cur-list-item int32) + (items (array clm-list-item)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type clm-list -(defmethod inspect clm-list ((this clm-list)) +(defmethod inspect ((this clm-list)) (when (not this) (set! this this) (goto cfg-4) @@ -189,16 +171,13 @@ ;; definition of type clm (deftype clm (basic) - ((title string :offset-assert 4) - (items (array clm-basic) :offset-assert 8) + ((title string) + (items (array clm-basic)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type clm -(defmethod inspect clm ((this clm)) +(defmethod inspect ((this clm)) (when (not this) (set! this this) (goto cfg-4) @@ -224,15 +203,12 @@ ;; definition of type volume-descriptor-array (deftype volume-descriptor-array (inline-array-class) - ((data plane-volume :inline :dynamic :offset 16) + ((data plane-volume :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type volume-descriptor-array -(defmethod inspect volume-descriptor-array ((this volume-descriptor-array)) +(defmethod inspect ((this volume-descriptor-array)) (when (not this) (set! this this) (goto cfg-4) @@ -256,26 +232,23 @@ ;; definition of type cam-layout (deftype cam-layout (process) - ((cam-entity entity-camera :offset-assert 128) - (num-entities int32 :offset-assert 132) - (cur-entity int32 :offset-assert 136) - (num-volumes int32 :offset-assert 140) - (cur-volume int32 :offset-assert 144) - (first-pvol int32 :offset-assert 148) - (first-cutoutvol int32 :offset-assert 152) - (res-key float :offset-assert 156) + ((cam-entity entity-camera) + (num-entities int32) + (cur-entity int32) + (num-volumes int32) + (cur-volume int32) + (first-pvol int32) + (first-cutoutvol int32) + (res-key float) ) :heap-base #x200 - :method-count-assert 14 - :size-assert #xa0 - :flag-assert #xe020000a0 (:states cam-layout-active ) ) ;; definition for method 3 of type cam-layout -(defmethod inspect cam-layout ((this cam-layout)) +(defmethod inspect ((this cam-layout)) (when (not this) (set! this this) (goto cfg-4) @@ -609,20 +582,17 @@ ;; definition of type interp-test-info (deftype interp-test-info (structure) - ((from vector :inline :offset-assert 0) - (to vector :inline :offset-assert 16) - (origin vector :inline :offset-assert 32) - (color vector4w :offset-assert 48) - (axis vector :offset-assert 52) - (disp string :offset-assert 56) + ((from vector :inline) + (to vector :inline) + (origin vector :inline) + (color vector4w) + (axis vector) + (disp string) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) ;; definition for method 3 of type interp-test-info -(defmethod inspect interp-test-info ((this interp-test-info)) +(defmethod inspect ((this interp-test-info)) (when (not this) (set! this this) (goto cfg-4) @@ -2268,17 +2238,14 @@ ;; definition of type clmf-cam-flag-toggle-info (deftype clmf-cam-flag-toggle-info (structure) - ((key float :offset-assert 0) - (force-on int32 :offset-assert 4) - (force-off int32 :offset-assert 8) + ((key float) + (force-on int32) + (force-off int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type clmf-cam-flag-toggle-info -(defmethod inspect clmf-cam-flag-toggle-info ((this clmf-cam-flag-toggle-info)) +(defmethod inspect ((this clmf-cam-flag-toggle-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc index 6a5bb23e1b0..a4fe37dd9ab 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 16 of type camera-master -(defmethod camera-master-method-16 camera-master ((this camera-master) (arg0 symbol)) +(defmethod camera-master-method-16 ((this camera-master) (arg0 symbol)) (let ((a2-0 (the-as target (handle->process (-> this focus handle)))) (v1-4 0) ) @@ -1088,7 +1088,7 @@ ) ;; definition for method 14 of type camera-master -(defmethod camera-master-method-14 camera-master ((this camera-master) (arg0 vector)) +(defmethod camera-master-method-14 ((this camera-master) (arg0 vector)) (if (handle->process (-> this focus handle)) (vector-! arg0 (-> this tpos-curr) (-> this tpos-old)) (vector-reset! arg0) @@ -1098,7 +1098,7 @@ ;; definition for method 15 of type camera-master ;; INFO: Used lq/sq -(defmethod camera-master-method-15 camera-master ((this camera-master) (arg0 vector)) +(defmethod camera-master-method-15 ((this camera-master) (arg0 vector)) (if (and (-> this slave) (-> this slave 0 next-state) (= (-> this slave 0 next-state name) 'cam-string)) (set! (-> arg0 quad) (-> this slave 0 view-flat quad)) (vector-reset! arg0) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc index 2d28746d7ae..d1543db1ac8 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc @@ -3,16 +3,13 @@ ;; definition of type cam-point-watch-bank (deftype cam-point-watch-bank (basic) - ((speed float :offset-assert 4) - (rot-speed degrees :offset-assert 8) + ((speed float) + (rot-speed degrees) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type cam-point-watch-bank -(defmethod inspect cam-point-watch-bank ((this cam-point-watch-bank)) +(defmethod inspect ((this cam-point-watch-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -98,16 +95,13 @@ ;; definition of type cam-free-bank (deftype cam-free-bank (basic) - ((speed float :offset-assert 4) - (rot-speed degrees :offset-assert 8) + ((speed float) + (rot-speed degrees) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type cam-free-bank -(defmethod inspect cam-free-bank ((this cam-free-bank)) +(defmethod inspect ((this cam-free-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -412,18 +406,15 @@ ;; definition of type camera-free-floating-move-info (deftype camera-free-floating-move-info (structure) - ((rv vector :inline :offset-assert 0) - (tv vector :inline :offset-assert 16) - (up vector :inline :offset-assert 32) - (tm matrix :inline :offset-assert 48) + ((rv vector :inline) + (tv vector :inline) + (up vector :inline) + (tm matrix :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type camera-free-floating-move-info -(defmethod inspect camera-free-floating-move-info ((this camera-free-floating-move-info)) +(defmethod inspect ((this camera-free-floating-move-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc index 6cc9d19791b..eed80206bbb 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc @@ -444,18 +444,15 @@ ;; definition of type cam-eye-bank (deftype cam-eye-bank (basic) - ((rot-speed float :offset-assert 4) - (max-degrees float :offset-assert 8) - (max-fov float :offset-assert 12) - (min-fov float :offset-assert 16) + ((rot-speed float) + (max-degrees float) + (max-fov float) + (min-fov float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type cam-eye-bank -(defmethod inspect cam-eye-bank ((this cam-eye-bank)) +(defmethod inspect ((this cam-eye-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -1192,16 +1189,13 @@ ;; definition of type cam-string-bank (deftype cam-string-bank (basic) - ((los-coll-rad meters :offset-assert 4) - (los-coll-rad2 meters :offset-assert 8) + ((los-coll-rad meters) + (los-coll-rad2 meters) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type cam-string-bank -(defmethod inspect cam-string-bank ((this cam-string-bank)) +(defmethod inspect ((this cam-string-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -1314,17 +1308,14 @@ ;; definition of type los-dist (deftype los-dist (structure) - ((par-dist float :offset-assert 0) - (lat-dist float :offset-assert 4) - (vert-dist float :offset-assert 8) + ((par-dist float) + (lat-dist float) + (vert-dist float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type los-dist -(defmethod inspect los-dist ((this los-dist)) +(defmethod inspect ((this los-dist)) (when (not this) (set! this this) (goto cfg-4) @@ -1339,23 +1330,20 @@ ;; definition of type collide-los-dist-info (deftype collide-los-dist-info (structure) - ((min-par float :offset-assert 0) - (max-par float :offset-assert 4) - (min-lat float :offset-assert 8) - (max-lat float :offset-assert 12) - (min-vp float :offset-assert 16) - (max-vp float :offset-assert 20) - (min-vn float :offset-assert 24) - (max-vn float :offset-assert 28) - (count int32 :offset-assert 32) + ((min-par float) + (max-par float) + (min-lat float) + (max-lat float) + (min-vp float) + (max-vp float) + (min-vn float) + (max-vn float) + (count int32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type collide-los-dist-info -(defmethod inspect collide-los-dist-info ((this collide-los-dist-info)) +(defmethod inspect ((this collide-los-dist-info)) (when (not this) (set! this this) (goto cfg-4) @@ -1481,19 +1469,16 @@ ;; definition of type collide-los-result (deftype collide-los-result (structure) - ((lateral vector :inline :offset-assert 0) - (cw collide-los-dist-info :inline :offset-assert 16) - (ccw collide-los-dist-info :inline :offset-assert 64) - (straddle collide-los-dist-info :inline :offset-assert 112) - (lateral-valid symbol :offset-assert 148) + ((lateral vector :inline) + (cw collide-los-dist-info :inline) + (ccw collide-los-dist-info :inline) + (straddle collide-los-dist-info :inline) + (lateral-valid symbol) ) - :method-count-assert 9 - :size-assert #x98 - :flag-assert #x900000098 ) ;; definition for method 3 of type collide-los-result -(defmethod inspect collide-los-result ((this collide-los-result)) +(defmethod inspect ((this collide-los-result)) (when (not this) (set! this this) (goto cfg-4) @@ -3320,18 +3305,15 @@ ;; definition of type cam-stick-bank (deftype cam-stick-bank (basic) - ((max-z meters :offset-assert 4) - (min-z meters :offset-assert 8) - (max-y meters :offset-assert 12) - (min-y meters :offset-assert 16) + ((max-z meters) + (min-z meters) + (max-y meters) + (min-y meters) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type cam-stick-bank -(defmethod inspect cam-stick-bank ((this cam-stick-bank)) +(defmethod inspect ((this cam-stick-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -3550,18 +3532,15 @@ ;; definition of type cam-bike-bank (deftype cam-bike-bank (basic) - ((max-z meters :offset-assert 4) - (min-z meters :offset-assert 8) - (max-y meters :offset-assert 12) - (min-y meters :offset-assert 16) + ((max-z meters) + (min-z meters) + (max-y meters) + (min-y meters) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type cam-bike-bank -(defmethod inspect cam-bike-bank ((this cam-bike-bank)) +(defmethod inspect ((this cam-bike-bank)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/camera/camera-defs-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera-defs-h_REF.gc index a683b665e73..95ebe228bbd 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera-defs-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera-defs-h_REF.gc @@ -3,24 +3,21 @@ ;; definition of type camera-bank (deftype camera-bank (basic) - ((collide-move-rad float :offset-assert 4) - (joypad uint32 :offset-assert 8) - (min-detectable-velocity float :offset-assert 12) - (attack-timeout time-frame :offset-assert 16) - (default-string-max-y meters :offset-assert 24) - (default-string-min-y meters :offset-assert 28) - (default-string-max-z meters :offset-assert 32) - (default-string-min-z meters :offset-assert 36) - (default-string-push-z meters :offset-assert 40) - (default-tilt-adjust degrees :offset-assert 44) + ((collide-move-rad float) + (joypad uint32) + (min-detectable-velocity float) + (attack-timeout time-frame) + (default-string-max-y meters) + (default-string-min-y meters) + (default-string-max-z meters) + (default-string-min-z meters) + (default-string-push-z meters) + (default-tilt-adjust degrees) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type camera-bank -(defmethod inspect camera-bank ((this camera-bank)) +(defmethod inspect ((this camera-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -56,22 +53,19 @@ ;; definition of type camera-master-bank (deftype camera-master-bank (basic) - ((onscreen-head-height meters :offset-assert 4) - (onscreen-foot-height meters :offset-assert 8) - (target-height meters :offset-assert 12) - (up-move-to-pitch-ratio-in-air float :offset-assert 16) - (down-move-to-pitch-ratio-in-air float :offset-assert 20) - (up-move-to-pitch-on-ground float :offset-assert 24) - (down-move-to-pitch-on-ground float :offset-assert 28) - (pitch-off-blend float :offset-assert 32) + ((onscreen-head-height meters) + (onscreen-foot-height meters) + (target-height meters) + (up-move-to-pitch-ratio-in-air float) + (down-move-to-pitch-ratio-in-air float) + (up-move-to-pitch-on-ground float) + (down-move-to-pitch-on-ground float) + (pitch-off-blend float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type camera-master-bank -(defmethod inspect camera-master-bank ((this camera-master-bank)) +(defmethod inspect ((this camera-master-bank)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc index 94447e32d7c..45275b7e056 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc @@ -3,20 +3,17 @@ ;; definition of type cam-index (deftype cam-index (structure) - ((flags cam-index-options :offset-assert 0) - (vec vector 2 :inline :offset-assert 16) + ((flags cam-index-options) + (vec vector 2 :inline) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (cam-index-method-9 (_type_ symbol entity vector curve) symbol 9) - (cam-index-method-10 (_type_ vector) float 10) + (cam-index-method-9 (_type_ symbol entity vector curve) symbol) + (cam-index-method-10 (_type_ vector) float) ) ) ;; definition for method 3 of type cam-index -(defmethod inspect cam-index ((this cam-index)) +(defmethod inspect ((this cam-index)) (when (not this) (set! this this) (goto cfg-4) @@ -30,19 +27,16 @@ ;; definition of type tracking-point (deftype tracking-point (structure) - ((position vector :inline :offset-assert 0) - (direction vector :inline :offset-assert 16) - (tp-length float :offset-assert 32) - (next int32 :offset-assert 36) - (incarnation int32 :offset-assert 40) + ((position vector :inline) + (direction vector :inline) + (tp-length float) + (next int32) + (incarnation int32) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type tracking-point -(defmethod inspect tracking-point ((this tracking-point)) +(defmethod inspect ((this tracking-point)) (when (not this) (set! this this) (goto cfg-4) @@ -59,16 +53,13 @@ ;; definition of type tracking-spline-sampler (deftype tracking-spline-sampler (structure) - ((cur-pt int32 :offset-assert 0) - (partial-pt float :offset-assert 4) + ((cur-pt int32) + (partial-pt float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type tracking-spline-sampler -(defmethod inspect tracking-spline-sampler ((this tracking-spline-sampler)) +(defmethod inspect ((this tracking-spline-sampler)) (when (not this) (set! this this) (goto cfg-4) @@ -82,45 +73,42 @@ ;; definition of type tracking-spline (deftype tracking-spline (structure) - ((point tracking-point 32 :inline :offset-assert 0) - (summed-len float :offset-assert 1536) - (free-point int32 :offset-assert 1540) - (used-point int32 :offset-assert 1544) - (partial-point float :offset-assert 1548) - (end-point int32 :offset-assert 1552) - (next-to-last-point int32 :offset-assert 1556) - (max-move float :offset-assert 1560) - (sample-len float :offset-assert 1564) - (used-count int32 :offset-assert 1568) - (old-position vector :inline :offset-assert 1584) - (debug-old-position vector :inline :offset-assert 1600) - (debug-out-position vector :inline :offset-assert 1616) - (debug-last-point int32 :offset-assert 1632) + ((point tracking-point 32 :inline) + (summed-len float) + (free-point int32) + (used-point int32) + (partial-point float) + (end-point int32) + (next-to-last-point int32) + (max-move float) + (sample-len float) + (used-count int32) + (old-position vector :inline) + (debug-old-position vector :inline) + (debug-out-position vector :inline) + (debug-last-point int32) ) - :method-count-assert 24 - :size-assert #x664 - :flag-assert #x1800000664 (:methods - (tracking-spline-method-9 (_type_) none 9) - (tracking-spline-method-10 (_type_ vector) none 10) - (debug-point-info (_type_ int) none 11) - (debug-all-points (_type_) none 12) - (tracking-spline-method-13 (_type_ int) none 13) - (tracking-spline-method-14 (_type_ tracking-spline-sampler) none 14) - (tracking-spline-method-15 (_type_) none 15) - (tracking-spline-method-16 (_type_ float) none 16) - (tracking-spline-method-17 (_type_ vector float float symbol) int 17) - (tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector 18) - (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector 19) - (tracking-spline-method-20 (_type_ vector int) none 20) - (tracking-spline-method-21 (_type_ vector float float float) vector 21) - (tracking-spline-method-22 (_type_ float) symbol 22) - (debug-draw-spline (_type_) none 23) + (tracking-spline-method-9 (_type_) none) + (tracking-spline-method-10 (_type_ vector) none) + (debug-point-info (_type_ int) none) + (debug-all-points (_type_) none) + (tracking-spline-method-13 (_type_ int) none) + (tracking-spline-method-14 (_type_ tracking-spline-sampler) none) + (tracking-spline-method-15 (_type_) none) + (tracking-spline-method-16 (_type_ float) none) + (tracking-spline-method-17 (_type_ vector float float symbol) int) + (tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector) + (tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector) + (tracking-spline-method-20 (_type_ vector int) none) + (tracking-spline-method-21 (_type_ vector float float float) vector) + (tracking-spline-method-22 (_type_ float) symbol) + (debug-draw-spline (_type_) none) ) ) ;; definition for method 3 of type tracking-spline -(defmethod inspect tracking-spline ((this tracking-spline)) +(defmethod inspect ((this tracking-spline)) (when (not this) (set! this this) (goto cfg-4) @@ -146,27 +134,24 @@ ;; definition of type cam-float-seeker (deftype cam-float-seeker (structure) - ((target float :offset-assert 0) - (value float :offset-assert 4) - (vel float :offset-assert 8) - (accel float :offset-assert 12) - (max-vel float :offset-assert 16) - (max-partial float :offset-assert 20) + ((target float) + (value float) + (vel float) + (accel float) + (max-vel float) + (max-partial float) ) :pack-me - :method-count-assert 13 - :size-assert #x18 - :flag-assert #xd00000018 (:methods - (init (_type_ float float float float) none 9) - (copy-to (_type_ _type_) none 10) - (update! (_type_ float) none 11) - (jump-to-target! (_type_ float) float 12) + (init (_type_ float float float float) none) + (copy-to (_type_ _type_) none) + (update! (_type_ float) none) + (jump-to-target! (_type_ float) float) ) ) ;; definition for method 3 of type cam-float-seeker -(defmethod inspect cam-float-seeker ((this cam-float-seeker)) +(defmethod inspect ((this cam-float-seeker)) (when (not this) (set! this this) (goto cfg-4) @@ -184,7 +169,7 @@ ;; definition for method 9 of type cam-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod init cam-float-seeker ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (set! (-> this target) arg0) (set! (-> this value) arg0) (set! (-> this vel) 0.0) @@ -197,7 +182,7 @@ ;; definition for method 10 of type cam-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod copy-to cam-float-seeker ((this cam-float-seeker) (arg0 cam-float-seeker)) +(defmethod copy-to ((this cam-float-seeker) (arg0 cam-float-seeker)) (set! (-> this target) (-> arg0 target)) (set! (-> this value) (-> arg0 value)) (set! (-> this vel) (-> arg0 vel)) @@ -210,7 +195,7 @@ ;; definition for method 11 of type cam-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod update! cam-float-seeker ((this cam-float-seeker) (arg0 float)) +(defmethod update! ((this cam-float-seeker) (arg0 float)) (with-pp 0.0 0.0 @@ -237,7 +222,7 @@ ) ;; definition for method 12 of type cam-float-seeker -(defmethod jump-to-target! cam-float-seeker ((this cam-float-seeker) (arg0 float)) +(defmethod jump-to-target! ((this cam-float-seeker) (arg0 float)) (set! (-> this value) (+ (-> this target) arg0)) (set! (-> this vel) 0.0) 0.0 @@ -245,24 +230,21 @@ ;; definition of type cam-vector-seeker (deftype cam-vector-seeker (structure) - ((target vector :inline :offset-assert 0) - (value vector :inline :offset-assert 16) - (vel vector :inline :offset-assert 32) - (accel float :offset-assert 48) - (max-vel float :offset-assert 52) - (max-partial float :offset-assert 56) + ((target vector :inline) + (value vector :inline) + (vel vector :inline) + (accel float) + (max-vel float) + (max-partial float) ) - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (init (_type_ vector float float float) none 9) - (update! (_type_ vector) none 10) + (init (_type_ vector float float float) none) + (update! (_type_ vector) none) ) ) ;; definition for method 3 of type cam-vector-seeker -(defmethod inspect cam-vector-seeker ((this cam-vector-seeker)) +(defmethod inspect ((this cam-vector-seeker)) (when (not this) (set! this this) (goto cfg-4) @@ -281,7 +263,7 @@ ;; definition for method 9 of type cam-vector-seeker ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init cam-vector-seeker ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 (set! (-> this target quad) (-> arg0 quad)) @@ -302,7 +284,7 @@ ;; definition for method 10 of type cam-vector-seeker ;; WARN: Return type mismatch int vs none. -(defmethod update! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector)) +(defmethod update! ((this cam-vector-seeker) (arg0 vector)) (with-pp (let ((v1-0 (new 'stack-no-clear 'vector))) 0.0 @@ -336,26 +318,23 @@ ;; definition of type cam-rotation-tracker (deftype cam-rotation-tracker (structure) - ((inv-mat matrix :inline :offset-assert 0) - (no-follow basic :offset-assert 64) - (follow-pt vector :inline :offset-assert 80) - (follow-off vector :inline :offset-assert 96) - (follow-blend float :offset-assert 112) - (tilt-adjust cam-float-seeker :inline :offset-assert 116) - (point-of-interest-blend cam-float-seeker :inline :offset-assert 140) - (underwater-blend cam-float-seeker :inline :offset-assert 164) - (looking-at vector :inline :offset-assert 192) - (looking-interesting vector :inline :offset-assert 208) - (old-cam-trans vector :inline :offset-assert 224) - (follow-height-extra cam-float-seeker :inline :offset-assert 240) + ((inv-mat matrix :inline) + (no-follow basic) + (follow-pt vector :inline) + (follow-off vector :inline) + (follow-blend float) + (tilt-adjust cam-float-seeker :inline) + (point-of-interest-blend cam-float-seeker :inline) + (underwater-blend cam-float-seeker :inline) + (looking-at vector :inline) + (looking-interesting vector :inline) + (old-cam-trans vector :inline) + (follow-height-extra cam-float-seeker :inline) ) - :method-count-assert 9 - :size-assert #x108 - :flag-assert #x900000108 ) ;; definition for method 3 of type cam-rotation-tracker -(defmethod inspect cam-rotation-tracker ((this cam-rotation-tracker)) +(defmethod inspect ((this cam-rotation-tracker)) (when (not this) (set! this this) (goto cfg-4) @@ -379,31 +358,27 @@ ;; definition of type camera-combiner (deftype camera-combiner (process) - ((trans vector :inline :offset-assert 128) - (inv-camera-rot matrix :inline :offset-assert 144) - (fov float :offset-assert 208) - (interp-val float :offset-assert 212) - (interp-step float :offset-assert 216) - (dist-from-src float :offset-assert 220) - (dist-from-dest float :offset-assert 224) - (flip-control-axis vector :inline :offset-assert 240) - (velocity vector :inline :offset-assert 256) - (tracking-status uint64 :offset-assert 272) - (tracking-options int32 :offset-assert 280) - (tracking cam-rotation-tracker :inline :offset-assert 288) - (fast-rot basic :offset-assert 552) + ((trans vector :inline) + (inv-camera-rot matrix :inline) + (fov float) + (interp-val float) + (interp-step float) + (dist-from-src float) + (dist-from-dest float) + (flip-control-axis vector :inline) + (velocity vector :inline) + (tracking-status uint64) + (tracking-options int32) + (tracking cam-rotation-tracker :inline) + (fast-rot basic) ) - :heap-base #x1b0 - :method-count-assert 14 - :size-assert #x22c - :flag-assert #xe01b0022c (:states cam-combiner-active ) ) ;; definition for method 3 of type camera-combiner -(defmethod inspect camera-combiner ((this camera-combiner)) +(defmethod inspect ((this camera-combiner)) (when (not this) (set! this this) (goto cfg-4) @@ -430,66 +405,62 @@ ;; definition of type camera-slave (deftype camera-slave (process) - ((trans vector :inline :offset-assert 128) - (fov float :offset-assert 144) - (fov0 float :offset-assert 148) - (fov1 float :offset-assert 152) - (fov-index cam-index :inline :offset-assert 160) - (tracking cam-rotation-tracker :inline :offset-assert 208) - (view-off-param float :offset-assert 472) - (view-off vector :inline :offset-assert 480) - (joystick-saved-view-off vector :inline :offset-assert 496) - (min-z-override float :offset-assert 512) - (view-flat vector :inline :offset-assert 528) - (string-vel-dir uint32 :offset-assert 544) - (string-trans vector :inline :offset-assert 560) - (position-spline tracking-spline :inline :offset-assert 576) - (pivot-pt vector :inline :offset-assert 2224) - (pivot-rad float :offset-assert 2240) - (circular-follow vector :inline :offset-assert 2256) - (max-angle-offset float :offset-assert 2272) - (max-angle-curr float :offset-assert 2276) - (options cam-slave-options-u32 :offset-assert 2280) - (cam-entity entity :offset-assert 2284) - (butt-timer uint64 :offset-assert 2288) - (butt-seek basic :offset-assert 2296) - (butt-vector vector :inline :offset-assert 2304) - (velocity vector :inline :offset-assert 2320) - (desired-pos vector :inline :offset-assert 2336) - (time-dist-too-far uint32 :offset-assert 2352) - (los-state slave-los-state :offset-assert 2356) - (good-point vector :inline :offset-assert 2368) - (los-tgt-spline-pt int32 :offset-assert 2384) - (los-tgt-spline-pt-incarnation int32 :offset-assert 2388) - (los-last-pos vector :inline :offset-assert 2400) - (intro-curve curve :inline :offset-assert 2416) - (intro-offset vector :inline :offset-assert 2448) - (intro-t float :offset-assert 2464) - (intro-t-step float :offset-assert 2468) - (outro-exit-value float :offset-assert 2472) - (spline-exists basic :offset-assert 2476) - (spline-curve curve :inline :offset-assert 2480) - (spline-offset vector :inline :offset-assert 2512) - (index cam-index :inline :offset-assert 2528) - (saved-pt vector :inline :offset-assert 2576) - (spline-tt float :offset-assert 2592) - (spline-follow-dist float :offset-assert 2596) - (enter-has-run symbol :offset-assert 2600) - (blend-from-type uint64 :offset-assert 2608) - (blend-to-type camera-blend-to-type :offset-assert 2616) - (have-phony-joystick basic :offset-assert 2624) - (phony-joystick-x float :offset-assert 2628) - (phony-joystick-y float :offset-assert 2632) - (string-min-val vector :inline :offset-assert 2640) - (string-max-val vector :inline :offset-assert 2656) - (string-val-locked basic :offset-assert 2672) - (relative-position vector :inline :offset-assert 2688) - (string-relative basic :offset-assert 2704) + ((trans vector :inline) + (fov float) + (fov0 float) + (fov1 float) + (fov-index cam-index :inline) + (tracking cam-rotation-tracker :inline) + (view-off-param float) + (view-off vector :inline) + (joystick-saved-view-off vector :inline) + (min-z-override float) + (view-flat vector :inline) + (string-vel-dir uint32) + (string-trans vector :inline) + (position-spline tracking-spline :inline) + (pivot-pt vector :inline) + (pivot-rad float) + (circular-follow vector :inline) + (max-angle-offset float) + (max-angle-curr float) + (options cam-slave-options-u32) + (cam-entity entity) + (butt-timer uint64) + (butt-seek basic) + (butt-vector vector :inline) + (velocity vector :inline) + (desired-pos vector :inline) + (time-dist-too-far uint32) + (los-state slave-los-state) + (good-point vector :inline) + (los-tgt-spline-pt int32) + (los-tgt-spline-pt-incarnation int32) + (los-last-pos vector :inline) + (intro-curve curve :inline) + (intro-offset vector :inline) + (intro-t float) + (intro-t-step float) + (outro-exit-value float) + (spline-exists basic) + (spline-curve curve :inline) + (spline-offset vector :inline) + (index cam-index :inline) + (saved-pt vector :inline) + (spline-tt float) + (spline-follow-dist float) + (enter-has-run symbol) + (blend-from-type uint64) + (blend-to-type camera-blend-to-type) + (have-phony-joystick basic) + (phony-joystick-x float) + (phony-joystick-y float) + (string-min-val vector :inline) + (string-max-val vector :inline) + (string-val-locked basic) + (relative-position vector :inline) + (string-relative basic) ) - :heap-base #xa20 - :method-count-assert 14 - :size-assert #xa94 - :flag-assert #xe0a200a94 (:states cam-bike cam-circular @@ -519,7 +490,7 @@ ) ;; definition for method 3 of type camera-slave -(defmethod inspect camera-slave ((this camera-slave)) +(defmethod inspect ((this camera-slave)) (when (not this) (set! this this) (goto cfg-4) @@ -588,54 +559,50 @@ ;; definition of type camera-master (deftype camera-master (process) - ((master-options cam-master-options-u32 :offset-assert 128) - (settings cam-setting-data :offset-assert 132) - (slave (pointer camera-slave) :offset-assert 136) - (decel (pointer camera-slave) :offset-assert 140) - (slave-options uint32 :offset-assert 144) - (view-off-param-save float :offset-assert 148) - (changer uint32 :offset-assert 152) - (string-min cam-vector-seeker :inline :offset-assert 160) - (string-max cam-vector-seeker :inline :offset-assert 224) - (string-push-z float :offset-assert 284) - (local-down vector :inline :offset-assert 288) - (focus focus :inline :offset-assert 304) - (being-attacked symbol :offset-assert 316) - (attack-start time-frame :offset-assert 320) - (on-ground symbol :offset-assert 328) - (under-water int32 :offset-assert 332) - (on-pole symbol :offset-assert 336) - (tgt-rot-mat matrix :inline :offset-assert 352) - (tgt-face-mat matrix :inline :offset-assert 416) - (tpos-old vector :inline :offset-assert 480) - (tpos-curr vector :inline :offset-assert 496) - (tpos-old-adj vector :inline :offset-assert 512) - (tpos-curr-adj vector :inline :offset-assert 528) - (tpos-tgt vector :inline :offset-assert 544) - (upspeed float :offset-assert 560) - (pitch-off vector :inline :offset-assert 576) - (target-spline tracking-spline :inline :offset-assert 592) - (ease-from vector :inline :offset-assert 2240) - (ease-t float :offset-assert 2256) - (ease-step float :offset-assert 2260) - (ease-to vector :inline :offset-assert 2272) - (outro-curve curve :inline :offset-assert 2288) - (outro-t float :offset-assert 2308) - (outro-t-step float :offset-assert 2312) - (outro-exit-value float :offset-assert 2316) - (water-drip-time time-frame :offset-assert 2320) - (water-drip sparticle-launch-control :offset-assert 2328) - (water-drip-mult float :offset-assert 2332) - (water-drip-speed float :offset-assert 2336) + ((master-options cam-master-options-u32) + (settings cam-setting-data) + (slave (pointer camera-slave)) + (decel (pointer camera-slave)) + (slave-options uint32) + (view-off-param-save float) + (changer uint32) + (string-min cam-vector-seeker :inline) + (string-max cam-vector-seeker :inline) + (string-push-z float) + (local-down vector :inline) + (focus focus :inline) + (being-attacked symbol) + (attack-start time-frame) + (on-ground symbol) + (under-water int32) + (on-pole symbol) + (tgt-rot-mat matrix :inline) + (tgt-face-mat matrix :inline) + (tpos-old vector :inline) + (tpos-curr vector :inline) + (tpos-old-adj vector :inline) + (tpos-curr-adj vector :inline) + (tpos-tgt vector :inline) + (upspeed float) + (pitch-off vector :inline) + (target-spline tracking-spline :inline) + (ease-from vector :inline) + (ease-t float) + (ease-step float) + (ease-to vector :inline) + (outro-curve curve :inline) + (outro-t float) + (outro-t-step float) + (outro-exit-value float) + (water-drip-time time-frame) + (water-drip sparticle-launch-control) + (water-drip-mult float) + (water-drip-speed float) ) - :heap-base #x8b0 - :method-count-assert 17 - :size-assert #x924 - :flag-assert #x1108b00924 (:methods - (camera-master-method-14 (_type_ vector) vector 14) - (camera-master-method-15 (_type_ vector) vector 15) - (camera-master-method-16 (_type_ symbol) int 16) + (camera-master-method-14 (_type_ vector) vector) + (camera-master-method-15 (_type_ vector) vector) + (camera-master-method-16 (_type_ symbol) int) ) (:states cam-master-active @@ -643,7 +610,7 @@ ) ;; definition for method 3 of type camera-master -(defmethod inspect camera-master ((this camera-master)) +(defmethod inspect ((this camera-master)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc index c18e4784751..6fe3ff881cd 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc @@ -375,7 +375,7 @@ ;; definition for method 9 of type cam-index ;; INFO: Used lq/sq -(defmethod cam-index-method-9 cam-index ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) +(defmethod cam-index-method-9 ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) (local-vars (sv-32 (function _varargs_ object))) (format (clear *cam-res-string*) "~S-flags" arg0) (set! (-> this flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *cam-res-string*)))) @@ -453,7 +453,7 @@ ;; definition for method 10 of type cam-index ;; INFO: Used lq/sq -(defmethod cam-index-method-10 cam-index ((this cam-index) (arg0 vector)) +(defmethod cam-index-method-10 ((this cam-index) (arg0 vector)) (let ((s5-0 (new-stack-vector0))) 0.0 (vector-! s5-0 arg0 (the-as vector (-> this vec))) @@ -475,7 +475,7 @@ ;; definition for method 10 of type tracking-spline ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-10 tracking-spline ((this tracking-spline) (arg0 vector)) +(defmethod tracking-spline-method-10 ((this tracking-spline) (arg0 vector)) (set! (-> this point 0 position quad) (-> arg0 quad)) (set! (-> this point 0 next) -134250495) (set! (-> this summed-len) 0.0) @@ -501,7 +501,7 @@ ;; definition for method 13 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-13 tracking-spline ((this tracking-spline) (arg0 int)) +(defmethod tracking-spline-method-13 ((this tracking-spline) (arg0 int)) (let ((v1-3 (-> this point arg0 next))) (cond ((= v1-3 -134250495) @@ -536,7 +536,7 @@ ;; definition for method 14 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-14 tracking-spline ((this tracking-spline) (arg0 tracking-spline-sampler)) +(defmethod tracking-spline-method-14 ((this tracking-spline) (arg0 tracking-spline-sampler)) (let ((v1-0 (-> this used-point))) (set! (-> this partial-point) (-> arg0 partial-pt)) (when (= (-> this next-to-last-point) v1-0) @@ -577,7 +577,7 @@ ;; definition for method 15 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-15 tracking-spline ((this tracking-spline)) +(defmethod tracking-spline-method-15 ((this tracking-spline)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 cur-pt) (-> this used-point)) @@ -625,7 +625,7 @@ ;; definition for method 16 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-16 tracking-spline ((this tracking-spline) (arg0 float)) +(defmethod tracking-spline-method-16 ((this tracking-spline) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 cur-pt) (-> this used-point)) @@ -665,7 +665,7 @@ ;; definition for method 17 of type tracking-spline ;; INFO: Used lq/sq -(defmethod tracking-spline-method-17 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) +(defmethod tracking-spline-method-17 ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) (let ((s3-0 (-> this free-point)) (s2-0 (-> this end-point)) ) @@ -708,7 +708,7 @@ ;; definition for method 18 of type tracking-spline ;; WARN: new jak 2 until loop case, check carefully -(defmethod tracking-spline-method-18 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-18 ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (local-vars (f0-4 float)) (when (not arg2) (set! arg2 (new 'stack-no-clear 'tracking-spline-sampler)) @@ -752,7 +752,7 @@ ) ;; definition for method 19 of type tracking-spline -(defmethod tracking-spline-method-19 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-19 ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (vector-reset! arg1) (tracking-spline-method-18 this arg0 arg1 arg2) arg1 @@ -760,7 +760,7 @@ ;; definition for method 20 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-20 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 int)) +(defmethod tracking-spline-method-20 ((this tracking-spline) (arg0 vector) (arg1 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-! s3-0 @@ -844,7 +844,7 @@ ;; definition for method 21 of type tracking-spline ;; INFO: Used lq/sq -(defmethod tracking-spline-method-21 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod tracking-spline-method-21 ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (with-pp (let ((v1-0 (-> this used-point)) (f0-0 (-> this partial-point)) @@ -895,7 +895,7 @@ ;; definition for method 22 of type tracking-spline ;; WARN: Return type mismatch int vs symbol. -(defmethod tracking-spline-method-22 tracking-spline ((this tracking-spline) (arg0 float)) +(defmethod tracking-spline-method-22 ((this tracking-spline) (arg0 float)) (when (< arg0 (-> this summed-len)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) @@ -911,7 +911,7 @@ ;; definition for method 9 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-9 tracking-spline ((this tracking-spline)) +(defmethod tracking-spline-method-9 ((this tracking-spline)) (let ((v1-0 (-> this used-point)) (s4-0 0) (s5-0 0) diff --git a/test/decompiler/reference/jak2/engine/camera/pov-camera-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/pov-camera-h_REF.gc index 8622f18a6b2..e8da783c754 100644 --- a/test/decompiler/reference/jak2/engine/camera/pov-camera-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/pov-camera-h_REF.gc @@ -3,35 +3,33 @@ ;; definition of type pov-camera (deftype pov-camera (process-drawable) - ((flags pov-camera-flag :offset-assert 200) - (debounce-start-time time-frame :offset-assert 208) - (notify-handle handle :offset-assert 216) - (anim-name string :offset-assert 224) - (command-list pair :offset-assert 228) - (mask-to-clear process-mask :offset-assert 232) - (music-volume-movie float :offset-assert 236) - (sfx-volume-movie float :offset-assert 240) + ((flags pov-camera-flag) + (debounce-start-time time-frame) + (notify-handle handle) + (anim-name string) + (command-list pair) + (mask-to-clear process-mask) + (music-volume-movie float) + (sfx-volume-movie float) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xf4 - :flag-assert #x1e008000f4 + (:state-methods + pov-camera-abort + pov-camera-done-playing + pov-camera-playing + pov-camera-start-playing + pov-camera-startup + ) (:methods - (pov-camera-abort () _type_ :state 20) - (pov-camera-done-playing () _type_ :state 21) - (pov-camera-playing () _type_ :state 22) - (pov-camera-start-playing () _type_ :state 23) - (pov-camera-startup () _type_ :state 24) - (abort? (_type_) symbol :behavior pov-camera 25) - (target-grabbed? (_type_) symbol 26) - (pov-camera-method-27 () none 27) - (pov-camera-method-28 () none 28) - (target-released? (_type_) symbol 29) + (abort? (_type_) symbol :behavior pov-camera) + (target-grabbed? (_type_) symbol) + (pov-camera-method-27 () none) + (pov-camera-method-28 () none) + (target-released? (_type_) symbol) ) ) ;; definition for method 3 of type pov-camera -(defmethod inspect pov-camera ((this pov-camera)) +(defmethod inspect ((this pov-camera)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-cache-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-cache-h_REF.gc index b480310ebbe..d8bf652b509 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-cache-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-cache-h_REF.gc @@ -3,16 +3,13 @@ ;; definition of type collide-puss-sphere (deftype collide-puss-sphere (structure) - ((bsphere sphere :inline :offset-assert 0) - (bbox4w bounding-box4w :inline :offset-assert 16) + ((bsphere sphere :inline) + (bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type collide-puss-sphere -(defmethod inspect collide-puss-sphere ((this collide-puss-sphere)) +(defmethod inspect ((this collide-puss-sphere)) (when (not this) (set! this this) (goto cfg-4) @@ -26,23 +23,20 @@ ;; definition of type collide-puss-work (deftype collide-puss-work (structure) - ((closest-pt vector :inline :offset-assert 0) - (tri-normal vector :inline :offset-assert 16) - (tri-bbox4w bounding-box4w :inline :offset-assert 32) - (spheres-bbox4w bounding-box4w :inline :offset-assert 64) - (spheres collide-puss-sphere 64 :inline :offset-assert 96) + ((closest-pt vector :inline) + (tri-normal vector :inline) + (tri-bbox4w bounding-box4w :inline) + (spheres-bbox4w bounding-box4w :inline) + (spheres collide-puss-sphere 64 :inline) ) - :method-count-assert 11 - :size-assert #xc60 - :flag-assert #xb00000c60 (:methods - (collide-puss-work-method-9 () none 9) - (collide-puss-work-method-10 () none 10) + (collide-puss-work-method-9 () none) + (collide-puss-work-method-10 () none) ) ) ;; definition for method 3 of type collide-puss-work -(defmethod inspect collide-puss-work ((this collide-puss-work)) +(defmethod inspect ((this collide-puss-work)) (when (not this) (set! this this) (goto cfg-4) @@ -59,22 +53,19 @@ ;; definition of type collide-cache-tri (deftype collide-cache-tri (structure) - ((vertex vector 3 :inline :offset-assert 0) - (extra-quad uint8 16 :offset-assert 48) - (pat pat-surface :offset 48) - (collide-ptr basic :offset 52) - (prim-index uint16 :offset 56) - (user16 uint16 :offset 58) - (user32 uint32 :offset 60) - (clear-flags uint128 :offset 48) + ((vertex vector 3 :inline) + (extra-quad uint8 16) + (pat pat-surface :overlay-at (-> extra-quad 0)) + (collide-ptr basic :overlay-at (-> extra-quad 4)) + (prim-index uint16 :overlay-at (-> extra-quad 8)) + (user16 uint16 :overlay-at (-> extra-quad 10)) + (user32 uint32 :overlay-at (-> extra-quad 12)) + (clear-flags uint128 :overlay-at (-> extra-quad 0)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type collide-cache-tri -(defmethod inspect collide-cache-tri ((this collide-cache-tri)) +(defmethod inspect ((this collide-cache-tri)) (when (not this) (set! this this) (goto cfg-4) @@ -93,29 +84,26 @@ ;; definition of type collide-cache-prim (deftype collide-cache-prim (structure) - ((prim-core collide-prim-core :inline :offset-assert 0) - (extra-quad uint8 16 :offset-assert 32) - (ccache collide-cache :offset 32) - (prim collide-shape-prim :offset 36) - (first-tri uint16 :offset 40) - (num-tris uint16 :offset 42) - (unused uint8 4 :offset 44) - (world-sphere vector :inline :offset 0) - (collide-as collide-spec :offset 16) - (action collide-action :offset 24) - (prim-type prim-type :offset 28) + ((prim-core collide-prim-core :inline) + (extra-quad uint8 16) + (ccache collide-cache :overlay-at (-> extra-quad 0)) + (prim collide-shape-prim :overlay-at (-> extra-quad 4)) + (first-tri uint16 :overlay-at (-> extra-quad 8)) + (num-tris uint16 :overlay-at (-> extra-quad 10)) + (unused uint8 4 :overlay-at (-> extra-quad 12)) + (world-sphere vector :inline :overlay-at (-> prim-core world-sphere)) + (collide-as collide-spec :overlay-at (-> prim-core collide-as)) + (action collide-action :overlay-at (-> prim-core action)) + (prim-type prim-type :overlay-at (-> prim-core prim-type)) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float 9) - (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float 10) + (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float) + (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float) ) ) ;; definition for method 3 of type collide-cache-prim -(defmethod inspect collide-cache-prim ((this collide-cache-prim)) +(defmethod inspect ((this collide-cache-prim)) (when (not this) (set! this this) (goto cfg-4) @@ -138,45 +126,42 @@ ;; definition of type collide-cache (deftype collide-cache (basic) - ((num-tris int32 :offset-assert 4) - (num-tris-u32 uint32 :offset 4) - (num-prims int32 :offset-assert 8) - (num-prims-u32 uint32 :offset 8) - (ignore-mask pat-surface :offset-assert 12) - (ignore-processes process 2 :offset-assert 16) - (collide-box bounding-box :inline :offset-assert 32) - (collide-box4w bounding-box4w :inline :offset-assert 64) - (collide-with collide-spec :offset-assert 96) - (unused uint32 :offset-assert 100) - (prims collide-cache-prim 100 :inline :offset-assert 112) - (tris collide-cache-tri 461 :inline :offset-assert 4912) + ((num-tris int32) + (num-tris-u32 uint32 :overlay-at num-tris) + (num-prims int32) + (num-prims-u32 uint32 :overlay-at num-prims) + (ignore-mask pat-surface) + (ignore-processes process 2) + (collide-box bounding-box :inline) + (collide-box4w bounding-box4w :inline) + (collide-with collide-spec) + (unused uint32) + (prims collide-cache-prim 100 :inline) + (tris collide-cache-tri 461 :inline) ) - :method-count-assert 26 - :size-assert #x8670 - :flag-assert #x1a00008670 (:methods - (debug-draw (_type_) none 9) - (fill-and-probe-using-line-sphere (_type_ collide-query) float 10) - (fill-and-probe-using-spheres (_type_ collide-query) symbol 11) - (fill-using-bounding-box (_type_ collide-query) none 12) - (fill-using-line-sphere (_type_ collide-query) none 13) - (fill-using-spheres (_type_ collide-query) none 14) - (reset (_type_) none 15) - (probe-using-line-sphere (_type_ collide-query) float 16) - (probe-using-spheres (_type_ collide-query) symbol 17) - (fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none 18) - (fill-from-fg-boxes (_type_) none 19) - (fill-from-fg-line-sphere (_type_ collide-query) none 20) - (fill-from-water (_type_ water-control) none 21) - (collide-cache-method-22 () none 22) - (collide-cache-method-23 () none 23) - (collide-cache-method-24 () none 24) - (collide-cache-method-25 () none 25) + (debug-draw (_type_) none) + (fill-and-probe-using-line-sphere (_type_ collide-query) float) + (fill-and-probe-using-spheres (_type_ collide-query) symbol) + (fill-using-bounding-box (_type_ collide-query) none) + (fill-using-line-sphere (_type_ collide-query) none) + (fill-using-spheres (_type_ collide-query) none) + (reset (_type_) none) + (probe-using-line-sphere (_type_ collide-query) float) + (probe-using-spheres (_type_ collide-query) symbol) + (fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none) + (fill-from-fg-boxes (_type_) none) + (fill-from-fg-line-sphere (_type_ collide-query) none) + (fill-from-water (_type_ water-control) none) + (collide-cache-method-22 () none) + (collide-cache-method-23 () none) + (collide-cache-method-24 () none) + (collide-cache-method-25 () none) ) ) ;; definition for method 3 of type collide-cache -(defmethod inspect collide-cache ((this collide-cache)) +(defmethod inspect ((this collide-cache)) (when (not this) (set! this this) (goto cfg-4) @@ -198,17 +183,14 @@ ;; definition of type collide-list-item (deftype collide-list-item (structure) - ((mesh instance-tie :offset-assert 0) - (inst basic :offset-assert 4) + ((mesh instance-tie) + (inst basic) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type collide-list-item -(defmethod inspect collide-list-item ((this collide-list-item)) +(defmethod inspect ((this collide-list-item)) (when (not this) (set! this this) (goto cfg-4) @@ -222,16 +204,13 @@ ;; definition of type collide-list (deftype collide-list (structure) - ((num-items int32 :offset-assert 0) - (items collide-list-item 256 :inline :offset 16) + ((num-items int32) + (items collide-list-item 256 :inline :offset 16) ) - :method-count-assert 9 - :size-assert #x810 - :flag-assert #x900000810 ) ;; definition for method 3 of type collide-list -(defmethod inspect collide-list ((this collide-list)) +(defmethod inspect ((this collide-list)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-cache_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-cache_REF.gc index 49882237d12..bdc259d7a17 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-cache_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-cache_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 15 of type collide-cache ;; WARN: Return type mismatch int vs none. -(defmethod reset collide-cache ((this collide-cache)) +(defmethod reset ((this collide-cache)) (set! (-> this num-tris) 0) (set! (-> this num-prims) 0) (set! (-> this ignore-processes 0) #f) @@ -16,11 +16,11 @@ ;; definition for method 18 of type collide-cache ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod fill-from-bg collide-cache ((this collide-cache) - (arg0 (function collide-hash int collide-list collide-query int)) - (arg1 (function collide-cache collide-list collide-query none)) - (arg2 collide-query) - ) +(defmethod fill-from-bg ((this collide-cache) + (arg0 (function collide-hash int collide-list collide-query int)) + (arg1 (function collide-cache collide-list collide-query none)) + (arg2 collide-query) + ) (set! *already-printed-exeeded-max-cache-tris* #f) (set! (-> *collide-list* num-items) 0) (if *collide-list-boxes* @@ -65,7 +65,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 21 collide-cache) has a return type of none, but the expression builder found a return statement. -(defmethod fill-from-water collide-cache ((this collide-cache) (arg0 water-control)) +(defmethod fill-from-water ((this collide-cache) (arg0 water-control)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -143,7 +143,7 @@ ;; definition for method 12 of type collide-cache ;; WARN: Return type mismatch int vs none. -(defmethod fill-using-bounding-box collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod fill-using-bounding-box ((this collide-cache) (arg0 collide-query)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -225,7 +225,7 @@ ;; definition for method 13 of type collide-cache ;; WARN: Return type mismatch int vs none. -(defmethod fill-using-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod fill-using-line-sphere ((this collide-cache) (arg0 collide-query)) (local-vars (v1-11 float) (v1-20 float)) (rlet ((acc :class vf) (Q :class vf) @@ -493,7 +493,7 @@ ;; definition for method 19 of type collide-cache ;; WARN: Return type mismatch int vs none. -(defmethod fill-from-fg-boxes collide-cache ((this collide-cache)) +(defmethod fill-from-fg-boxes ((this collide-cache)) (let ((s5-0 (-> this collide-with))) (set! *actor-list-length* 0) (if (logtest? s5-0 (collide-spec hit-by-others-list)) @@ -581,7 +581,7 @@ ;; definition for method 10 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. -(defmethod add-fg-prim-using-box collide-shape-prim ((this collide-shape-prim) (arg0 collide-cache)) +(defmethod add-fg-prim-using-box ((this collide-shape-prim) (arg0 collide-cache)) (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-box!~%") (none) ) @@ -600,7 +600,7 @@ ;; definition for method 20 of type collide-cache ;; WARN: Return type mismatch int vs none. -(defmethod fill-from-fg-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod fill-from-fg-line-sphere ((this collide-cache) (arg0 collide-query)) (local-vars (v1-9 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -729,7 +729,7 @@ ;; definition for method 11 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. -(defmethod add-fg-prim-using-line-sphere collide-shape-prim ((this collide-shape-prim) (arg0 collide-cache) (arg1 object)) +(defmethod add-fg-prim-using-line-sphere ((this collide-shape-prim) (arg0 collide-cache) (arg1 object)) (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-line-sphere!~%" @@ -750,24 +750,21 @@ (defmethod-mips2c "(method 11 collide-shape-prim-group)" 11 collide-shape-prim-group) ;; definition for method 10 of type collide-cache -(defmethod fill-and-probe-using-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod fill-and-probe-using-line-sphere ((this collide-cache) (arg0 collide-query)) (fill-using-line-sphere this arg0) (probe-using-line-sphere this arg0) ) ;; definition of type collide-puls-work (deftype collide-puls-work (structure) - ((ignore-pat pat-surface :offset-assert 0) - (bsphere sphere :inline :offset-assert 16) - (move-dist vector :inline :offset-assert 32) + ((ignore-pat pat-surface) + (bsphere sphere :inline) + (move-dist vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type collide-puls-work -(defmethod inspect collide-puls-work ((this collide-puls-work)) +(defmethod inspect ((this collide-puls-work)) (when (not this) (set! this this) (goto cfg-4) @@ -781,7 +778,7 @@ ) ;; definition for method 16 of type collide-cache -(defmethod probe-using-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod probe-using-line-sphere ((this collide-cache) (arg0 collide-query)) (rlet ((vf0 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -853,18 +850,15 @@ ;; definition of type lsmi-work (deftype lsmi-work (structure) - ((best-u float :offset-assert 0) - (orig-best-u float :offset-assert 4) - (action uint32 :offset-assert 8) - (cquery collide-query :inline :offset-assert 16) + ((best-u float) + (orig-best-u float) + (action uint32) + (cquery collide-query :inline) ) - :method-count-assert 9 - :size-assert #x22c - :flag-assert #x90000022c ) ;; definition for method 3 of type lsmi-work -(defmethod inspect lsmi-work ((this lsmi-work)) +(defmethod inspect ((this lsmi-work)) (when (not this) (set! this this) (goto cfg-4) @@ -887,13 +881,13 @@ (defmethod-mips2c "(method 10 collide-cache-prim)" 10 collide-cache-prim) ;; definition for method 11 of type collide-cache -(defmethod fill-and-probe-using-spheres collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod fill-and-probe-using-spheres ((this collide-cache) (arg0 collide-query)) (fill-using-spheres this arg0) (probe-using-spheres this arg0) ) ;; definition for method 14 of type collide-cache -(defmethod fill-using-spheres collide-cache ((this collide-cache) (arg0 collide-query)) +(defmethod fill-using-spheres ((this collide-cache) (arg0 collide-query)) (new 'stack-no-clear 'bounding-box) (set-from-spheres! (-> arg0 bbox) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-debug_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-debug_REF.gc index da4b16a64dc..46a1f282e34 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-debug_REF.gc @@ -6,7 +6,7 @@ ;; definition for method 9 of type collide-cache ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw collide-cache ((this collide-cache)) +(defmethod debug-draw ((this collide-cache)) (let ((gp-0 (the-as object (-> this tris)))) (countdown (s4-0 (-> this num-tris)) (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-cache-tri gp-0) pat mode) color) a 64))) @@ -55,17 +55,14 @@ ;; definition of type col-rend-filter (deftype col-rend-filter (structure) - ((show-pat-set pat-surface :offset-assert 0) - (show-pat-clear pat-surface :offset-assert 4) - (event-mask uint32 :offset-assert 8) + ((show-pat-set pat-surface) + (show-pat-clear pat-surface) + (event-mask uint32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type col-rend-filter -(defmethod inspect col-rend-filter ((this col-rend-filter)) +(defmethod inspect ((this col-rend-filter)) (when (not this) (set! this this) (goto cfg-4) @@ -185,7 +182,7 @@ ;; definition for method 9 of type col-rend ;; INFO: Used lq/sq -(defmethod col-rend-method-9 col-rend ((this col-rend)) +(defmethod col-rend-method-9 ((this col-rend)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f30-0 (-> this bbox-radius))) (let ((v1-0 (-> this track))) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc index 8835819352b..5ca16f1c4fb 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type pilot-edge-grab-info (deftype pilot-edge-grab-info (structure) - ((local-pos vector :inline :offset-assert 0) - (local-dir vector :inline :offset-assert 16) - (handle handle :offset-assert 32) + ((local-pos vector :inline) + (local-dir vector :inline) + (handle handle) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; definition for method 3 of type pilot-edge-grab-info -(defmethod inspect pilot-edge-grab-info ((this pilot-edge-grab-info)) +(defmethod inspect ((this pilot-edge-grab-info)) (when (not this) (set! this this) (goto cfg-4) @@ -28,38 +25,35 @@ ;; definition of type edge-grab-info (deftype edge-grab-info (structure) - ((world-vertex vector 8 :inline :offset-assert 0) - (local-vertex vector 8 :inline :offset-assert 128) - (status uint64 :offset-assert 256) - (actor-cshape-prim-offset int32 :offset-assert 264) - (actor-handle handle :offset-assert 272) - (hanging-matrix matrix :inline :offset-assert 288) - (edge-vertex vector 2 :inline :offset 0) - (center-hold vector :inline :offset 32) - (tri-vertex vector 3 :inline :offset 48) - (adjacent-edge-left-vertex vector :inline :offset 96) - (adjacent-edge-right-vertex vector :inline :offset 112) - (left-hand-hold vector :inline :offset-assert 352) - (right-hand-hold vector :inline :offset-assert 368) - (center-hold-old vector :inline :offset-assert 384) - (edge-tri-pat uint32 :offset-assert 400) - (found-edge? symbol :offset-assert 404) - (pilot-edge-grab? symbol :offset-assert 408) - (pilot-edge-grab pilot-edge-grab-info :inline :offset-assert 416) - (pilot-start-grab-pos vector :inline :offset-assert 464) - (pilot-grab-interp float :offset-assert 480) + ((world-vertex vector 8 :inline) + (local-vertex vector 8 :inline) + (status uint64) + (actor-cshape-prim-offset int32) + (actor-handle handle) + (hanging-matrix matrix :inline) + (edge-vertex vector 2 :inline :overlay-at (-> world-vertex 0)) + (center-hold vector :inline :overlay-at (-> world-vertex 2)) + (tri-vertex vector 3 :inline :overlay-at (-> world-vertex 3)) + (adjacent-edge-left-vertex vector :inline :overlay-at (-> world-vertex 6)) + (adjacent-edge-right-vertex vector :inline :overlay-at (-> world-vertex 7)) + (left-hand-hold vector :inline) + (right-hand-hold vector :inline) + (center-hold-old vector :inline) + (edge-tri-pat uint32) + (found-edge? symbol) + (pilot-edge-grab? symbol) + (pilot-edge-grab pilot-edge-grab-info :inline) + (pilot-start-grab-pos vector :inline) + (pilot-grab-interp float) ) - :method-count-assert 11 - :size-assert #x1e4 - :flag-assert #xb000001e4 (:methods - (edge-grab-info-method-9 (_type_) symbol 9) - (debug-draw (_type_) none 10) + (edge-grab-info-method-9 (_type_) symbol) + (debug-draw (_type_) none) ) ) ;; definition for method 3 of type edge-grab-info -(defmethod inspect edge-grab-info ((this edge-grab-info)) +(defmethod inspect ((this edge-grab-info)) (when (not this) (set! this this) (goto cfg-4) @@ -91,16 +85,13 @@ ;; definition of type collide-edge-tri (deftype collide-edge-tri (structure) - ((ctri collide-cache-tri :offset-assert 0) - (normal vector :inline :offset-assert 16) + ((ctri collide-cache-tri) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type collide-edge-tri -(defmethod inspect collide-edge-tri ((this collide-edge-tri)) +(defmethod inspect ((this collide-edge-tri)) (when (not this) (set! this this) (goto cfg-4) @@ -114,22 +105,19 @@ ;; definition of type collide-edge-edge (deftype collide-edge-edge (structure) - ((ignore basic :offset-assert 0) - (etri collide-edge-tri :offset-assert 4) - (vertex-ptr (inline-array vector) 2 :offset-assert 8) - (outward vector :inline :offset-assert 16) - (edge-vec-norm vector :inline :offset-assert 32) + ((ignore basic) + (etri collide-edge-tri) + (vertex-ptr (inline-array vector) 2) + (outward vector :inline) + (edge-vec-norm vector :inline) ) - :method-count-assert 10 - :size-assert #x30 - :flag-assert #xa00000030 (:methods - (no-collision-at-edge (_type_ collide-edge-work edge-grab-info) symbol 9) + (no-collision-at-edge (_type_ collide-edge-work edge-grab-info) symbol) ) ) ;; definition for method 3 of type collide-edge-edge -(defmethod inspect collide-edge-edge ((this collide-edge-edge)) +(defmethod inspect ((this collide-edge-edge)) (when (not this) (set! this this) (goto cfg-4) @@ -146,20 +134,17 @@ ;; definition of type collide-edge-hold-item (deftype collide-edge-hold-item (structure) - ((next collide-edge-hold-item :offset-assert 0) - (rating float :offset-assert 4) - (split int8 :offset-assert 8) - (edge collide-edge-edge :offset-assert 12) - (center-pt vector :inline :offset-assert 16) - (outward-pt vector :inline :offset-assert 32) + ((next collide-edge-hold-item) + (rating float) + (split int8) + (edge collide-edge-edge) + (center-pt vector :inline) + (outward-pt vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type collide-edge-hold-item -(defmethod inspect collide-edge-hold-item ((this collide-edge-hold-item)) +(defmethod inspect ((this collide-edge-hold-item)) (when (not this) (set! this this) (goto cfg-4) @@ -177,23 +162,20 @@ ;; definition of type collide-edge-hold-list (deftype collide-edge-hold-list (structure) - ((num-allocs uint32 :offset-assert 0) - (num-attempts uint32 :offset-assert 4) - (head collide-edge-hold-item :offset-assert 8) - (items collide-edge-hold-item 32 :inline :offset-assert 16) - (attempts qword 32 :inline :offset-assert 1552) + ((num-allocs uint32) + (num-attempts uint32) + (head collide-edge-hold-item) + (items collide-edge-hold-item 32 :inline) + (attempts qword 32 :inline) ) - :method-count-assert 11 - :size-assert #x810 - :flag-assert #xb00000810 (:methods - (debug-draw (_type_) object 9) - (add-to-list! (_type_ collide-edge-hold-item) none 10) + (debug-draw (_type_) object) + (add-to-list! (_type_ collide-edge-hold-item) none) ) ) ;; definition for method 3 of type collide-edge-hold-list -(defmethod inspect collide-edge-hold-list ((this collide-edge-hold-list)) +(defmethod inspect ((this collide-edge-hold-list)) (when (not this) (set! this this) (goto cfg-4) @@ -210,27 +192,24 @@ ;; definition of type collide-edge-spec (deftype collide-edge-spec (structure) - ((split-dists float 2 :offset-assert 0) - (outward-offset vector :inline :offset-assert 16) - (flags collide-edge-spec-flags :offset-assert 32) - (ignore-pat pat-surface :offset-assert 40) - (max-dist-sqrd-to-outward-pt float :offset-assert 44) - (max-dir-cosa-delta float :offset-assert 48) - (max-dir-cosa-player float :offset-assert 52) - (touching-segment symbol :offset-assert 56) - (local-cache-fill-box bounding-box :inline :offset-assert 64) - (local-within-reach-box bounding-box :inline :offset-assert 96) - (local-player-spheres sphere 12 :inline :offset 128) - (local-player-hanging-spheres sphere 6 :inline :offset 128) - (local-player-leap-up-spheres sphere 6 :inline :offset 224) + ((split-dists float 2) + (outward-offset vector :inline) + (flags collide-edge-spec-flags) + (ignore-pat pat-surface) + (max-dist-sqrd-to-outward-pt float) + (max-dir-cosa-delta float) + (max-dir-cosa-player float) + (touching-segment symbol) + (local-cache-fill-box bounding-box :inline) + (local-within-reach-box bounding-box :inline) + (local-player-spheres sphere 12 :inline :offset 128) + (local-player-hanging-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 0)) + (local-player-leap-up-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 6)) ) - :method-count-assert 9 - :size-assert #x140 - :flag-assert #x900000140 ) ;; definition for method 3 of type collide-edge-spec -(defmethod inspect collide-edge-spec ((this collide-edge-spec)) +(defmethod inspect ((this collide-edge-spec)) (when (not this) (set! this this) (goto cfg-4) @@ -255,47 +234,44 @@ ;; definition of type collide-edge-work (deftype collide-edge-work (structure) - ((ccache collide-cache :offset-assert 0) - (cshape collide-shape :offset-assert 4) - (num-verts uint32 :offset-assert 8) - (num-edges uint32 :offset-assert 12) - (num-tris uint32 :offset-assert 16) - (cache-fill-box bounding-box :inline :offset-assert 32) - (within-reach-box bounding-box :inline :offset-assert 64) - (within-reach-box4w bounding-box4w :inline :offset-assert 96) - (search-pt vector :inline :offset-assert 128) - (search-dir-vec vector :inline :offset-assert 144) - (world-player-spheres sphere 12 :inline :offset-assert 160) - (world-player-hanging-spheres sphere 6 :inline :offset 160) - (world-player-leap-up-spheres sphere 6 :inline :offset 256) - (spec collide-edge-spec :inline :offset-assert 352) - (process (pointer process-drawable) :offset-assert 672) - (verts vector 64 :inline :offset-assert 688) - (edges collide-edge-edge 96 :inline :offset-assert 1712) - (tris collide-edge-tri 48 :inline :offset-assert 6320) - (hold-list collide-edge-hold-list :inline :offset-assert 7856) + ((ccache collide-cache) + (cshape collide-shape) + (num-verts uint32) + (num-edges uint32) + (num-tris uint32) + (cache-fill-box bounding-box :inline) + (within-reach-box bounding-box :inline) + (within-reach-box4w bounding-box4w :inline) + (search-pt vector :inline) + (search-dir-vec vector :inline) + (world-player-spheres sphere 12 :inline) + (world-player-hanging-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 0)) + (world-player-leap-up-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 6)) + (spec collide-edge-spec :inline) + (process (pointer process-drawable)) + (verts vector 64 :inline) + (edges collide-edge-edge 96 :inline) + (tris collide-edge-tri 48 :inline) + (hold-list collide-edge-hold-list :inline) ) - :method-count-assert 21 - :size-assert #x26c0 - :flag-assert #x15000026c0 (:methods - (search-for-edges (_type_ collide-edge-hold-list) none 9) - (debug-draw-edges (_type_) object 10) - (debug-draw-tris (_type_) none 11) - (debug-draw-sphere (_type_) none 12) - (find-adjacent-edge (_type_ collide-edge-hold-item edge-grab-info) none 13) - (compute-center-point! (_type_ collide-edge-edge vector) float 14) - (get-best-hand-point (_type_ vector vector int) float 15) - (find-grabbable-edges (_type_) none 16) - (find-grabbable-tris (_type_) none 17) - (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol 18) - (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol 19) - (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol 20) + (search-for-edges (_type_ collide-edge-hold-list) none) + (debug-draw-edges (_type_) object) + (debug-draw-tris (_type_) none) + (debug-draw-sphere (_type_) none) + (find-adjacent-edge (_type_ collide-edge-hold-item edge-grab-info) none) + (compute-center-point! (_type_ collide-edge-edge vector) float) + (get-best-hand-point (_type_ vector vector int) float) + (find-grabbable-edges (_type_) none) + (find-grabbable-tris (_type_) none) + (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol) + (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol) + (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol) ) ) ;; definition for method 3 of type collide-edge-work -(defmethod inspect collide-edge-work ((this collide-edge-work)) +(defmethod inspect ((this collide-edge-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-edge-grab_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-edge-grab_REF.gc index 75bd095983f..3e53aee61e1 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-edge-grab_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-edge-grab_REF.gc @@ -5,7 +5,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 27 target) has a return type of none, but the expression builder found a return statement. -(defmethod do-edge-grabs target ((this target) (arg0 collide-cache) (arg1 collide-edge-spec)) +(defmethod do-edge-grabs ((this target) (arg0 collide-cache) (arg1 collide-edge-spec)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -87,7 +87,7 @@ ;; definition for method 9 of type collide-edge-work ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 9 collide-edge-work) has a return type of none, but the expression builder found a return statement. -(defmethod search-for-edges collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-list)) +(defmethod search-for-edges ((this collide-edge-work) (arg0 collide-edge-hold-list)) (set! (-> arg0 num-allocs) (the-as uint 0)) (set! (-> arg0 num-attempts) (the-as uint 0)) (set! (-> arg0 head) #f) @@ -120,18 +120,15 @@ ;; definition of type pbhp-stack-vars (deftype pbhp-stack-vars (structure) - ((edge collide-edge-edge :offset-assert 0) - (allocated basic :offset-assert 4) - (neg-hold-pt vector :inline :offset-assert 16) - (split-vec vector :inline :offset-assert 32) + ((edge collide-edge-edge) + (allocated basic) + (neg-hold-pt vector :inline) + (split-vec vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type pbhp-stack-vars -(defmethod inspect pbhp-stack-vars ((this pbhp-stack-vars)) +(defmethod inspect ((this pbhp-stack-vars)) (when (not this) (set! this this) (goto cfg-4) @@ -152,7 +149,7 @@ ;; definition for method 20 of type collide-edge-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs symbol. -(defmethod check-grab-for-collisions collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) +(defmethod check-grab-for-collisions ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) (local-vars (sv-656 vector) (sv-672 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -290,20 +287,17 @@ ;; definition of type faei-stack-vars (deftype faei-stack-vars (structure) - ((hold-edge-vec-norm vector :inline :offset-assert 0) - (adj-edge-vec-norm vector :inline :offset-assert 16) - (found-left? symbol :offset-assert 32) - (left-dot float :offset-assert 36) - (found-right? symbol :offset-assert 40) - (right-dot float :offset-assert 44) + ((hold-edge-vec-norm vector :inline) + (adj-edge-vec-norm vector :inline) + (found-left? symbol) + (left-dot float) + (found-right? symbol) + (right-dot float) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type faei-stack-vars -(defmethod inspect faei-stack-vars ((this faei-stack-vars)) +(defmethod inspect ((this faei-stack-vars)) (when (not this) (set! this this) (goto cfg-4) @@ -321,7 +315,7 @@ ;; definition for method 9 of type collide-edge-edge ;; INFO: Used lq/sq -(defmethod no-collision-at-edge collide-edge-edge ((this collide-edge-edge) (arg0 collide-edge-work) (arg1 edge-grab-info)) +(defmethod no-collision-at-edge ((this collide-edge-edge) (arg0 collide-edge-work) (arg1 edge-grab-info)) (let ((s4-0 (new 'stack-no-clear 'matrix)) (s5-0 (new 'stack-no-clear 'inline-array 'sphere 6)) ) @@ -355,7 +349,7 @@ ;; definition for method 13 of type collide-edge-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod find-adjacent-edge collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) +(defmethod find-adjacent-edge ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) (let ((s5-0 (new 'stack-no-clear 'faei-stack-vars))) (let* ((v1-0 (-> arg0 edge)) (s3-0 (-> v1-0 vertex-ptr 0 0)) @@ -432,7 +426,7 @@ ;; definition for method 15 of type collide-edge-work ;; INFO: Used lq/sq -(defmethod get-best-hand-point collide-edge-work ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod get-best-hand-point ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) (let ((f30-0 -1.0)) (let ((s2-0 (new 'stack-no-clear 'vector))) (dotimes (s1-0 (the-as int (-> this num-edges))) @@ -459,7 +453,7 @@ (defmethod-mips2c "(method 18 collide-edge-work)" 18 collide-edge-work) ;; definition for method 14 of type collide-edge-work -(defmethod compute-center-point! collide-edge-work ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) +(defmethod compute-center-point! ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) (local-vars (v1-1 float) (v1-2 float) (v1-3 float)) (rlet ((Q :class vf) (vf0 :class vf) @@ -527,7 +521,7 @@ ;; definition for method 10 of type edge-grab-info ;; WARN: Return type mismatch object vs none. -(defmethod debug-draw edge-grab-info ((this edge-grab-info)) +(defmethod debug-draw ((this edge-grab-info)) (add-debug-line #t (bucket-id debug-no-zbuf1) @@ -604,7 +598,7 @@ ;; definition for method 10 of type collide-edge-work ;; INFO: Used lq/sq -(defmethod debug-draw-edges collide-edge-work ((this collide-edge-work)) +(defmethod debug-draw-edges ((this collide-edge-work)) (local-vars (sv-32 (function _varargs_ object))) (let ((gp-0 0)) (dotimes (s4-0 (the-as int (-> this num-edges))) @@ -661,7 +655,7 @@ ;; definition for method 12 of type collide-edge-work ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-sphere collide-edge-work ((this collide-edge-work)) +(defmethod debug-draw-sphere ((this collide-edge-work)) (dotimes (s5-0 (the-as int (-> this num-verts))) (let ((a2-0 (-> this verts s5-0))) (add-debug-sphere #t (bucket-id debug-no-zbuf1) a2-0 (meters 0.2) (new 'static 'rgba :r #xff :g #xff :a #x80)) @@ -673,7 +667,7 @@ ;; definition for method 9 of type collide-edge-hold-list ;; INFO: Used lq/sq -(defmethod debug-draw collide-edge-hold-list ((this collide-edge-hold-list)) +(defmethod debug-draw ((this collide-edge-hold-list)) (let ((s4-0 (-> this head)) (s5-0 0) ) @@ -739,7 +733,7 @@ ;; definition for method 11 of type collide-edge-work ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-tris collide-edge-work ((this collide-edge-work)) +(defmethod debug-draw-tris ((this collide-edge-work)) (dotimes (s5-0 (the-as int (-> this num-tris))) (let* ((v1-3 (-> this tris s5-0 ctri)) (t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-3 pat mode) color) a 64)) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-frag-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-frag-h_REF.gc index c1064807041..5b0f25a135b 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-frag-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-frag-h_REF.gc @@ -4,14 +4,11 @@ ;; definition of type collide-frag-vertex (deftype collide-frag-vertex (vector) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type collide-frag-vertex ;; INFO: Used lq/sq -(defmethod inspect collide-frag-vertex ((this collide-frag-vertex)) +(defmethod inspect ((this collide-frag-vertex)) (when (not this) (set! this this) (goto cfg-4) @@ -29,23 +26,20 @@ ;; definition of type collide-frag-mesh (deftype collide-frag-mesh (basic) - ((packed-data uint32 :offset-assert 4) - (pat-array uint32 :offset-assert 8) - (strip-data-len uint16 :offset-assert 12) - (poly-count uint16 :offset-assert 14) - (base-trans vector4w :inline :offset-assert 16) - (vertex-count uint8 :offset 28) - (vertex-data-qwc uint8 :offset 29) - (total-qwc uint8 :offset 30) - (unused uint8 :offset 31) + ((packed-data uint32) + (pat-array uint32) + (strip-data-len uint16) + (poly-count uint16) + (base-trans vector4w :inline) + (vertex-count uint8 :overlay-at (-> base-trans data 3)) + (vertex-data-qwc uint8 :offset 29) + (total-qwc uint8 :offset 30) + (unused uint8 :offset 31) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type collide-frag-mesh -(defmethod inspect collide-frag-mesh ((this collide-frag-mesh)) +(defmethod inspect ((this collide-frag-mesh)) (when (not this) (set! this this) (goto cfg-4) @@ -66,16 +60,13 @@ ;; definition of type collide-fragment (deftype collide-fragment (drawable) - ((mesh collide-frag-mesh :offset 8) - (collide-new basic :offset 12) + ((mesh collide-frag-mesh :offset 8) + (collide-new basic :offset 12) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition for method 3 of type collide-fragment -(defmethod inspect collide-fragment ((this collide-fragment)) +(defmethod inspect ((this collide-fragment)) (when (not this) (set! this this) (goto cfg-4) @@ -91,16 +82,13 @@ ;; definition of type drawable-inline-array-collide-fragment (deftype drawable-inline-array-collide-fragment (drawable-inline-array) - ((data collide-fragment 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 64) + ((data collide-fragment 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 ) ;; definition for method 3 of type drawable-inline-array-collide-fragment -(defmethod inspect drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment)) +(defmethod inspect ((this drawable-inline-array-collide-fragment)) (when (not this) (set! this this) (goto cfg-4) @@ -117,9 +105,6 @@ ;; definition of type drawable-tree-collide-fragment (deftype drawable-tree-collide-fragment (drawable-tree) () - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/collide/collide-frag_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-frag_REF.gc index 21cb9ec47a1..c3fa31c5972 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-frag_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-frag_REF.gc @@ -2,13 +2,13 @@ (in-package goal) ;; definition for method 9 of type drawable-tree-collide-fragment -(defmethod login drawable-tree-collide-fragment ((this drawable-tree-collide-fragment)) +(defmethod login ((this drawable-tree-collide-fragment)) this ) ;; definition for method 10 of type drawable-tree-collide-fragment ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) (when *display-render-collision* (dotimes (s4-0 (-> this length)) (draw (-> this data s4-0) (-> this data s4-0) arg1) @@ -19,13 +19,13 @@ ) ;; definition for method 15 of type drawable-tree-collide-fragment -(defmethod unpack-vis drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) ;; definition for method 8 of type collide-fragment ;; WARN: Return type mismatch int vs collide-fragment. -(defmethod mem-usage collide-fragment ((this collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-fragment) (arg0 memory-usage-block) (arg1 int)) (let ((s5-0 (if (logtest? arg1 1) 54 50 @@ -58,23 +58,23 @@ ) ;; definition for method 9 of type drawable-inline-array-collide-fragment -(defmethod login drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment)) +(defmethod login ((this drawable-inline-array-collide-fragment)) this ) ;; definition for method 10 of type collide-fragment ;; WARN: Return type mismatch int vs none. -(defmethod draw collide-fragment ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) +(defmethod draw ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) 0 (none) ) ;; definition for method 10 of type drawable-inline-array-collide-fragment ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) - (arg0 drawable-inline-array-collide-fragment) - (arg1 display-frame) - ) +(defmethod draw ((this drawable-inline-array-collide-fragment) + (arg0 drawable-inline-array-collide-fragment) + (arg1 display-frame) + ) (dotimes (s4-0 (-> this length)) (let ((s3-0 (-> this data s4-0))) (if (sphere-cull (-> s3-0 bsphere)) @@ -87,7 +87,7 @@ ) ;; definition for method 8 of type drawable-inline-array-collide-fragment -(defmethod mem-usage drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-h_REF.gc index eedec520b02..e2b8a9e4843 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-h_REF.gc @@ -3,53 +3,50 @@ ;; definition of type collide-query (deftype collide-query (structure) - ((best-other-tri collide-tri-result :inline :offset-assert 0) - (best-my-tri collide-tri-result :inline :offset 0) - (ignore-processes process-tree 2 :offset-assert 88) - (ignore-process0 process-tree :offset 88) - (ignore-process1 process-tree :offset 92) - (ignore-pat pat-surface :offset-assert 96) - (ignore-pat-s32 int32 :offset 96) - (collide-with collide-spec :offset-assert 100) - (collide-with-s32 int32 :offset 100) - (overlay-params uint32 3 :offset 112) - (bbox bounding-box :inline :offset-assert 128) - (bbox4w bounding-box4w :inline :offset-assert 160) - (bsphere sphere :inline :offset-assert 192) - (start-pos vector :inline :offset-assert 208) - (move-dist vector :inline :offset-assert 224) - (rlength vector :inline :offset-assert 240) - (exit-planes plane 2 :inline :offset-assert 256) - (radius float :offset 268) - (inv-mat matrix :inline :offset 288) - (spheres (inline-array sphere) :offset 112) - (num-spheres uint32 :offset 116) - (solid-only symbol :offset 120) - (best-dist float :offset 112) - (best-other-prim collide-shape-prim :offset 116) - (best-my-prim collide-shape-prim :offset 120) - (move-vec vector :inline :offset 224) - (best-u float :offset 112) - (action-mask collide-action :offset-assert 352) - (local-box4w bounding-box4w :inline :offset-assert 368) - (search-box bounding-box4w :inline :offset-assert 400) - (search-vector vector4w :inline :offset-assert 432) - (instance-mat matrix :inline :offset-assert 448) - (instance-ptr basic :offset-assert 512) - (x-addr uint32 :offset-assert 516) - (x-step uint32 :offset-assert 520) - (y-addr uint32 :offset-assert 524) - (y-step uint32 :offset-assert 528) - (z-addr uint32 :offset-assert 532) - (z-step uint32 :offset-assert 536) + ((best-other-tri collide-tri-result :inline) + (best-my-tri collide-tri-result :inline :overlay-at best-other-tri) + (ignore-processes process-tree 2) + (ignore-process0 process-tree :overlay-at (-> ignore-processes 0)) + (ignore-process1 process-tree :overlay-at (-> ignore-processes 1)) + (ignore-pat pat-surface) + (ignore-pat-s32 int32 :overlay-at ignore-pat) + (collide-with collide-spec) + (collide-with-s32 int32 :overlay-at collide-with) + (overlay-params uint32 3 :offset 112) + (bbox bounding-box :inline) + (bbox4w bounding-box4w :inline) + (bsphere sphere :inline) + (start-pos vector :inline) + (move-dist vector :inline) + (rlength vector :inline) + (exit-planes plane 2 :inline) + (radius float :overlay-at (-> exit-planes 0 data 3)) + (inv-mat matrix :inline :offset 288) + (spheres (inline-array sphere) :overlay-at (-> overlay-params 0)) + (num-spheres uint32 :overlay-at (-> overlay-params 1)) + (solid-only symbol :overlay-at (-> overlay-params 2)) + (best-dist float :overlay-at spheres) + (best-other-prim collide-shape-prim :overlay-at num-spheres) + (best-my-prim collide-shape-prim :overlay-at solid-only) + (move-vec vector :inline :overlay-at move-dist) + (best-u float :overlay-at best-dist) + (action-mask collide-action) + (local-box4w bounding-box4w :inline) + (search-box bounding-box4w :inline) + (search-vector vector4w :inline) + (instance-mat matrix :inline) + (instance-ptr basic) + (x-addr uint32) + (x-step uint32) + (y-addr uint32) + (y-step uint32) + (z-addr uint32) + (z-step uint32) ) - :method-count-assert 9 - :size-assert #x21c - :flag-assert #x90000021c ) ;; definition for method 3 of type collide-query -(defmethod inspect collide-query ((this collide-query)) +(defmethod inspect ((this collide-query)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-mesh-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-mesh-h_REF.gc index 6d2a4a8d91a..008be8a87f9 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-mesh-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-mesh-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type collide-tri-result (deftype collide-tri-result (structure) - ((vertex vector 3 :inline :offset-assert 0) - (intersect vector :inline :offset-assert 48) - (normal vector :inline :offset-assert 64) - (pat pat-surface :offset-assert 80) - (collide-ptr basic :offset-assert 84) + ((vertex vector 3 :inline) + (intersect vector :inline) + (normal vector :inline) + (pat pat-surface) + (collide-ptr basic) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) ;; definition for method 3 of type collide-tri-result -(defmethod inspect collide-tri-result ((this collide-tri-result)) +(defmethod inspect ((this collide-tri-result)) (when (not this) (set! this this) (goto cfg-4) @@ -32,18 +29,15 @@ ;; definition of type collide-mesh-tri (deftype collide-mesh-tri (structure) - ((vertex-index uint8 3 :offset-assert 0) - (unused uint8 :offset-assert 3) - (pat pat-surface :offset-assert 4) + ((vertex-index uint8 3) + (unused uint8) + (pat pat-surface) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type collide-mesh-tri -(defmethod inspect collide-mesh-tri ((this collide-mesh-tri)) +(defmethod inspect ((this collide-mesh-tri)) (when (not this) (set! this this) (goto cfg-4) @@ -58,28 +52,25 @@ ;; definition of type collide-mesh (deftype collide-mesh (basic) - ((joint-id int32 :offset-assert 4) - (num-tris uint32 :offset-assert 8) - (num-verts uint32 :offset-assert 12) - (vertex-data (inline-array vector) :offset-assert 16) - (tris collide-mesh-tri 1 :inline :offset 32) + ((joint-id int32) + (num-tris uint32) + (num-verts uint32) + (vertex-data (inline-array vector)) + (tris collide-mesh-tri 1 :inline :offset 32) ) - :method-count-assert 16 - :size-assert #x28 - :flag-assert #x1000000028 (:methods - (debug-draw-tris (_type_ process-drawable int) none 9) - (overlap-test (_type_ collide-mesh-cache-tri vector) symbol 10) - (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 11) - (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 12) - (unpack-mesh-to-cache! (_type_ (inline-array collide-mesh-cache-tri) matrix) none 13) - (collide-mesh-math-1 (_type_ object object) none 14) - (collide-mesh-math-2 (_type_ object object object) none 15) + (debug-draw-tris (_type_ process-drawable int) none) + (overlap-test (_type_ collide-mesh-cache-tri vector) symbol) + (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (unpack-mesh-to-cache! (_type_ (inline-array collide-mesh-cache-tri) matrix) none) + (collide-mesh-math-1 (_type_ object object) none) + (collide-mesh-math-2 (_type_ object object object) none) ) ) ;; definition for method 3 of type collide-mesh -(defmethod inspect collide-mesh ((this collide-mesh)) +(defmethod inspect ((this collide-mesh)) (when (not this) (set! this this) (goto cfg-4) @@ -96,18 +87,15 @@ ;; definition of type collide-mesh-cache-tri (deftype collide-mesh-cache-tri (structure) - ((vertex vector 3 :inline :offset-assert 0) - (normal vector :inline :offset-assert 48) - (bbox4w bounding-box4w :inline :offset-assert 64) - (pat pat-surface :offset 60) + ((vertex vector 3 :inline) + (normal vector :inline) + (bbox4w bounding-box4w :inline) + (pat pat-surface :overlay-at (-> normal data 3)) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type collide-mesh-cache-tri -(defmethod inspect collide-mesh-cache-tri ((this collide-mesh-cache-tri)) +(defmethod inspect ((this collide-mesh-cache-tri)) (when (not this) (set! this this) (goto cfg-4) @@ -123,16 +111,13 @@ ;; definition of type collide-mesh-cache-entry (deftype collide-mesh-cache-entry (structure) - ((mat matrix :inline :offset-assert 0) - (tris collide-mesh-cache-tri :inline :dynamic :offset-assert 64) + ((mat matrix :inline) + (tris collide-mesh-cache-tri :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type collide-mesh-cache-entry -(defmethod inspect collide-mesh-cache-entry ((this collide-mesh-cache-entry)) +(defmethod inspect ((this collide-mesh-cache-entry)) (when (not this) (set! this this) (goto cfg-4) @@ -146,24 +131,21 @@ ;; definition of type collide-mesh-cache (deftype collide-mesh-cache (basic) - ((used-size uint32 :offset-assert 4) - (max-size uint32 :offset-assert 8) - (id uint32 :offset-assert 12) - (data uint8 48000 :offset-assert 16) + ((used-size uint32) + (max-size uint32) + (id uint32) + (data uint8 48000) ) - :method-count-assert 13 - :size-assert #xbb90 - :flag-assert #xd0000bb90 (:methods - (populate-for-prim-mesh (_type_ collide-shape-prim-mesh) collide-mesh-cache-entry 9) - (is-id? (_type_ int) symbol 10) - (next-id! (_type_) uint 11) - (allocate! (_type_ int) collide-mesh-cache-entry 12) + (populate-for-prim-mesh (_type_ collide-shape-prim-mesh) collide-mesh-cache-entry) + (is-id? (_type_ int) symbol) + (next-id! (_type_) uint) + (allocate! (_type_ int) collide-mesh-cache-entry) ) ) ;; definition for method 3 of type collide-mesh-cache -(defmethod inspect collide-mesh-cache ((this collide-mesh-cache)) +(defmethod inspect ((this collide-mesh-cache)) (when (not this) (set! this this) (goto cfg-4) @@ -181,7 +163,7 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for method 10 of type collide-mesh-cache -(defmethod is-id? collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) +(defmethod is-id? ((this collide-mesh-cache) (arg0 int)) (= (-> this id) arg0) ) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-mesh_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-mesh_REF.gc index ce2b5c5acf9..1af9c320bb3 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-mesh_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-mesh_REF.gc @@ -3,13 +3,13 @@ ;; definition for method 5 of type collide-mesh ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of collide-mesh ((this collide-mesh)) +(defmethod asize-of ((this collide-mesh)) (the-as int (+ (-> collide-mesh size) (* (+ (-> this num-tris) -1) 8))) ) ;; definition for method 8 of type collide-mesh ;; WARN: Return type mismatch int vs collide-mesh. -(defmethod mem-usage collide-mesh ((this collide-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 82 (-> arg0 length))) (set! (-> arg0 data 81 name) "collide-mesh") (+! (-> arg0 data 81 count) 1) @@ -29,7 +29,7 @@ ;; definition for method 9 of type collide-mesh ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-tris collide-mesh ((this collide-mesh) (arg0 process-drawable) (arg1 int)) +(defmethod debug-draw-tris ((this collide-mesh) (arg0 process-drawable) (arg1 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -85,16 +85,13 @@ ;; definition of type sopt-work (deftype sopt-work (structure) - ((intersect vector :inline :offset-assert 0) - (sphere-bbox4w bounding-box4w :inline :offset-assert 16) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type sopt-work -(defmethod inspect sopt-work ((this sopt-work)) +(defmethod inspect ((this sopt-work)) (when (not this) (set! this this) (goto cfg-4) @@ -112,16 +109,13 @@ ;; definition of type spat-work (deftype spat-work (structure) - ((intersect vector :inline :offset-assert 0) - (sphere-bbox4w bounding-box4w :inline :offset-assert 16) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type spat-work -(defmethod inspect spat-work ((this spat-work)) +(defmethod inspect ((this spat-work)) (when (not this) (set! this this) (goto cfg-4) @@ -151,7 +145,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [pxor a0, a0, a1] ;; ERROR: Unsupported inline assembly instruction kind - [pxor a0, a0, a1] ;; ERROR: Unsupported inline assembly instruction kind - [pxor a0, a0, a1] -(defmethod populate-for-prim-mesh collide-mesh-cache ((this collide-mesh-cache) (arg0 collide-shape-prim-mesh)) +(defmethod populate-for-prim-mesh ((this collide-mesh-cache) (arg0 collide-shape-prim-mesh)) (local-vars (r0-0 uint128) (v1-7 uint128) @@ -233,7 +227,7 @@ ;; definition for method 12 of type collide-mesh-cache ;; WARN: Return type mismatch (pointer uint8) vs collide-mesh-cache-entry. -(defmethod allocate! collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) +(defmethod allocate! ((this collide-mesh-cache) (arg0 int)) (local-vars (a1-2 int) (a2-2 int)) (let* ((v1-0 (+ arg0 15)) (a1-1 (-> this used-size)) @@ -270,7 +264,7 @@ ;; definition for method 13 of type collide-mesh ;; WARN: Return type mismatch int vs none. ;; ERROR: Failed load: (set! vf6 (l.vf (+ (the-as vector a3-0) 16))) at op 37 -(defmethod unpack-mesh-to-cache! collide-mesh ((this collide-mesh) (arg0 (inline-array collide-mesh-cache-tri)) (arg1 matrix)) +(defmethod unpack-mesh-to-cache! ((this collide-mesh) (arg0 (inline-array collide-mesh-cache-tri)) (arg1 matrix)) (local-vars (t0-2 uint)) (rlet ((acc :class vf) (Q :class vf) @@ -440,16 +434,13 @@ ;; definition of type oot-work (deftype oot-work (structure) - ((intersect vector :inline :offset-assert 0) - (sphere-bbox4w bounding-box4w :inline :offset-assert 16) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type oot-work -(defmethod inspect oot-work ((this oot-work)) +(defmethod inspect ((this oot-work)) (when (not this) (set! this this) (goto cfg-4) @@ -463,7 +454,7 @@ ;; definition for method 10 of type collide-mesh ;; INFO: Used lq/sq -(defmethod overlap-test collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) +(defmethod overlap-test ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) (local-vars (v1-0 uint128) (a0-1 uint128) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc index 6afd8431b05..641482a89b0 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type collide-rider (deftype collide-rider (structure) - ((rider-handle handle :offset-assert 0) - (sticky-prim collide-shape-prim :offset-assert 8) - (prim-ry float :offset-assert 12) - (rider-local-pos vector :inline :offset-assert 16) + ((rider-handle handle) + (sticky-prim collide-shape-prim) + (prim-ry float) + (rider-local-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type collide-rider -(defmethod inspect collide-rider ((this collide-rider)) +(defmethod inspect ((this collide-rider)) (when (not this) (set! this this) (goto cfg-4) @@ -30,20 +27,17 @@ ;; definition of type collide-rider-pool (deftype collide-rider-pool (basic) - ((alloc-count int32 :offset-assert 4) - (riders collide-rider 20 :inline :offset-assert 16) + ((alloc-count int32) + (riders collide-rider 20 :inline) ) - :method-count-assert 11 - :size-assert #x290 - :flag-assert #xb00000290 (:methods - (add-rider (_type_ handle) collide-rider 9) - (prepare (_type_) none 10) + (add-rider (_type_ handle) collide-rider) + (prepare (_type_) none) ) ) ;; definition for method 3 of type collide-rider-pool -(defmethod inspect collide-rider-pool ((this collide-rider-pool)) +(defmethod inspect ((this collide-rider-pool)) (when (not this) (set! this this) (goto cfg-4) @@ -57,7 +51,7 @@ ;; definition for method 10 of type collide-rider-pool ;; WARN: Return type mismatch int vs none. -(defmethod prepare collide-rider-pool ((this collide-rider-pool)) +(defmethod prepare ((this collide-rider-pool)) "Gets this pool ready to be used to allow allocations. This should be called once at the start of every frame." (set! (-> this alloc-count) 0) 0 @@ -66,18 +60,15 @@ ;; definition of type pull-rider-info (deftype pull-rider-info (structure) - ((rider collide-rider :offset-assert 0) - (rider-cshape collide-shape-moving :offset-assert 4) - (rider-delta-ry float :offset-assert 8) - (rider-dest vector :inline :offset-assert 16) + ((rider collide-rider) + (rider-cshape collide-shape-moving) + (rider-delta-ry float) + (rider-dest vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type pull-rider-info -(defmethod inspect pull-rider-info ((this pull-rider-info)) +(defmethod inspect ((this pull-rider-info)) (when (not this) (set! this this) (goto cfg-4) @@ -108,20 +99,17 @@ ;; definition of type overlaps-others-params (deftype overlaps-others-params (structure) - ((options overlaps-others-options :offset-assert 0) - (collide-with-filter collide-spec :offset-assert 4) - (tlist touching-list :offset-assert 8) - (filtered-root-collide-with collide-spec :offset-assert 12) - (filtered-child-collide-with collide-spec :offset-assert 16) - (filtered-other-collide-as collide-spec :offset-assert 20) + ((options overlaps-others-options) + (collide-with-filter collide-spec) + (tlist touching-list) + (filtered-root-collide-with collide-spec) + (filtered-child-collide-with collide-spec) + (filtered-other-collide-as collide-spec) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type overlaps-others-params -(defmethod inspect overlaps-others-params ((this overlaps-others-params)) +(defmethod inspect ((this overlaps-others-params)) (when (not this) (set! this this) (goto cfg-4) @@ -139,25 +127,22 @@ ;; definition of type move-above-ground-params (deftype move-above-ground-params (structure) - ((gnd-collide-with collide-spec :offset-assert 0) - (popup float :offset-assert 4) - (dont-move-if-overlaps? symbol :offset-assert 8) - (hover-if-no-ground? symbol :offset-assert 12) - (overlaps-params overlaps-others-params :inline :offset-assert 16) - (new-pos vector :inline :offset-assert 48) - (old-gspot-pos vector :inline :offset-assert 64) - (old-gspot-normal vector :inline :offset-assert 80) - (pat pat-surface :offset-assert 96) - (on-ground? symbol :offset-assert 100) - (do-move? symbol :offset-assert 104) + ((gnd-collide-with collide-spec) + (popup float) + (dont-move-if-overlaps? symbol) + (hover-if-no-ground? symbol) + (overlaps-params overlaps-others-params :inline) + (new-pos vector :inline) + (old-gspot-pos vector :inline) + (old-gspot-normal vector :inline) + (pat pat-surface) + (on-ground? symbol) + (do-move? symbol) ) - :method-count-assert 9 - :size-assert #x6c - :flag-assert #x90000006c ) ;; definition for method 3 of type move-above-ground-params -(defmethod inspect move-above-ground-params ((this move-above-ground-params)) +(defmethod inspect ((this move-above-ground-params)) (when (not this) (set! this this) (goto cfg-4) @@ -180,21 +165,18 @@ ;; definition of type collide-prim-core (deftype collide-prim-core (structure) - ((world-sphere vector :inline :offset-assert 0) - (collide-as collide-spec :offset 16) - (collide-with collide-spec :offset-assert 20) - (action collide-action :offset-assert 24) - (prim-type prim-type :offset-assert 28) - (unused1 uint8 3 :offset-assert 29) - (quad uint128 2 :offset 0) + ((world-sphere vector :inline) + (collide-as collide-spec :offset 16) + (collide-with collide-spec) + (action collide-action) + (prim-type prim-type) + (unused1 uint8 3) + (quad uint128 2 :overlay-at (-> world-sphere data 0)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type collide-prim-core -(defmethod inspect collide-prim-core ((this collide-prim-core)) +(defmethod inspect ((this collide-prim-core)) (when (not this) (set! this this) (goto cfg-4) @@ -213,41 +195,38 @@ ;; definition of type collide-shape-prim (deftype collide-shape-prim (basic) - ((cshape collide-shape :offset-assert 4) - (prim-id uint32 :offset-assert 8) - (transform-index int8 :offset-assert 12) - (unused2 int8 3 :offset-assert 13) - (prim-core collide-prim-core :inline :offset-assert 16) - (local-sphere vector :inline :offset-assert 48) - (world-sphere vector :inline :offset 16) - (collide-as collide-spec :offset 32) - (collide-with collide-spec :offset 36) - (action collide-action :offset 40) - (prim-type int8 :offset 44) - (radius float :offset 60) - (specific uint8 16 :offset-assert 64) + ((cshape collide-shape) + (prim-id uint32) + (transform-index int8) + (unused2 int8 3) + (prim-core collide-prim-core :inline) + (local-sphere vector :inline) + (world-sphere vector :inline :overlay-at (-> prim-core world-sphere)) + (collide-as collide-spec :overlay-at (-> prim-core collide-as)) + (collide-with collide-spec :overlay-at (-> prim-core collide-with)) + (action collide-action :overlay-at (-> prim-core action)) + (prim-type int8 :overlay-at (-> prim-core prim-type)) + (radius float :overlay-at (-> local-sphere data 3)) + (specific uint8 16) ) - :method-count-assert 20 - :size-assert #x50 - :flag-assert #x1400000050 (:methods - (new (symbol type collide-shape uint int) _type_ 0) - (debug-draw (_type_) none 9) - (add-fg-prim-using-box (_type_ collide-cache) none 10) - (add-fg-prim-using-line-sphere (_type_ collide-cache object) none 11) - (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 12) - (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 13) - (collide-shape-prim-method-14 () none 14) - (collide-with-collide-cache-prim-mesh (_type_ collide-query collide-cache-prim) none 15) - (collide-with-collide-cache-prim-sphere (_type_ collide-query collide-cache-prim) none 16) - (on-platform-test (_type_ collide-shape-prim collide-query float) none 17) - (should-push-away-test (_type_ collide-shape-prim collide-query) none 18) - (should-push-away-a-group-test (_type_ collide-shape-prim-group collide-query) none 19) + (new (symbol type collide-shape uint int) _type_) + (debug-draw (_type_) none) + (add-fg-prim-using-box (_type_ collide-cache) none) + (add-fg-prim-using-line-sphere (_type_ collide-cache object) none) + (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol) + (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol) + (collide-shape-prim-method-14 () none) + (collide-with-collide-cache-prim-mesh (_type_ collide-query collide-cache-prim) none) + (collide-with-collide-cache-prim-sphere (_type_ collide-query collide-cache-prim) none) + (on-platform-test (_type_ collide-shape-prim collide-query float) none) + (should-push-away-test (_type_ collide-shape-prim collide-query) none) + (should-push-away-a-group-test (_type_ collide-shape-prim-group collide-query) none) ) ) ;; definition for method 3 of type collide-shape-prim -(defmethod inspect collide-shape-prim ((this collide-shape-prim)) +(defmethod inspect ((this collide-shape-prim)) (when (not this) (set! this this) (goto cfg-146) @@ -494,19 +473,16 @@ ;; definition of type collide-shape-prim-sphere (deftype collide-shape-prim-sphere (collide-shape-prim) - ((pat pat-surface :offset 64) - (nav-radius float :offset 68) + ((pat pat-surface :overlay-at (-> specific 0)) + (nav-radius float :overlay-at (-> specific 4)) ) - :method-count-assert 20 - :size-assert #x50 - :flag-assert #x1400000050 (:methods - (new (symbol type collide-shape uint) _type_ 0) + (new (symbol type collide-shape uint) _type_) ) ) ;; definition for method 3 of type collide-shape-prim-sphere -(defmethod inspect collide-shape-prim-sphere ((this collide-shape-prim-sphere)) +(defmethod inspect ((this collide-shape-prim-sphere)) (when (not this) (set! this this) (goto cfg-146) @@ -755,21 +731,18 @@ ;; definition of type collide-shape-prim-mesh (deftype collide-shape-prim-mesh (collide-shape-prim) - ((mesh collide-mesh :offset 64) - (mesh-id int32 :offset 68) - (mesh-cache-id uint32 :offset 72) - (mesh-cache-entry collide-mesh-cache-entry :offset 76) + ((mesh collide-mesh :overlay-at (-> specific 0)) + (mesh-id int32 :overlay-at (-> specific 4)) + (mesh-cache-id uint32 :overlay-at (-> specific 8)) + (mesh-cache-entry collide-mesh-cache-entry :overlay-at (-> specific 12)) ) - :method-count-assert 20 - :size-assert #x50 - :flag-assert #x1400000050 (:methods - (new (symbol type collide-shape uint uint) _type_ 0) + (new (symbol type collide-shape uint uint) _type_) ) ) ;; definition for method 3 of type collide-shape-prim-mesh -(defmethod inspect collide-shape-prim-mesh ((this collide-shape-prim-mesh)) +(defmethod inspect ((this collide-shape-prim-mesh)) (when (not this) (set! this this) (goto cfg-146) @@ -1020,20 +993,17 @@ ;; definition of type collide-shape-prim-group (deftype collide-shape-prim-group (collide-shape-prim) - ((num-children uint8 :offset 64) - (num-alloc-children uint8 :offset 65) - (child (inline-array collide-shape-prim) :offset 68) + ((num-children uint8 :overlay-at (-> specific 0)) + (num-alloc-children uint8 :overlay-at (-> specific 1)) + (child (inline-array collide-shape-prim) :overlay-at (-> specific 4)) ) - :method-count-assert 20 - :size-assert #x50 - :flag-assert #x1400000050 (:methods - (new (symbol type collide-shape uint int) _type_ 0) + (new (symbol type collide-shape uint int) _type_) ) ) ;; definition for method 3 of type collide-shape-prim-group -(defmethod inspect collide-shape-prim-group ((this collide-shape-prim-group)) +(defmethod inspect ((this collide-shape-prim-group)) (when (not this) (set! this this) (goto cfg-146) @@ -1283,61 +1253,58 @@ ;; definition of type collide-shape (deftype collide-shape (trsqv) - ((actor-hash-index int16 :offset 12) - (process process-drawable :offset-assert 140) - (max-iteration-count uint8 :offset-assert 144) - (nav-flags nav-flags :offset-assert 145) - (total-prims uint8 :offset-assert 146) - (num-riders uint8 :offset-assert 147) - (pat-ignore-mask pat-surface :offset-assert 148) - (event-self symbol :offset-assert 152) - (event-other symbol :offset-assert 156) - (root-prim collide-shape-prim :offset-assert 160) - (riders (inline-array collide-rider) :offset-assert 164) - (penetrate-using penetrate :offset-assert 168) - (penetrated-by penetrate :offset-assert 176) - (backup-collide-as collide-spec :offset-assert 184) - (backup-collide-with collide-spec :offset-assert 188) - (event-priority uint8 :offset-assert 192) - (rider-max-momentum float :offset-assert 196) + ((actor-hash-index int16 :offset 12) + (process process-drawable) + (max-iteration-count uint8) + (nav-flags nav-flags) + (total-prims uint8) + (num-riders uint8) + (pat-ignore-mask pat-surface) + (event-self symbol) + (event-other symbol) + (root-prim collide-shape-prim) + (riders (inline-array collide-rider)) + (penetrate-using penetrate) + (penetrated-by penetrate) + (backup-collide-as collide-spec) + (backup-collide-with collide-spec) + (event-priority uint8) + (rider-max-momentum float) ) - :method-count-assert 55 - :size-assert #xc8 - :flag-assert #x37000000c8 (:methods - (new (symbol type process-drawable collide-list-enum) _type_ 0) - (move-by-vector! (_type_ vector) none 28) - (move-to-point! (_type_ vector) none 29) - (debug-draw (_type_) none 30) - (fill-cache-for-shape (_type_ float collide-query) none 31) - (fill-cache-integrate-and-collide (_type_ vector collide-query meters) none 32) - (find-prim-by-id (_type_ uint) collide-shape-prim 33) - (find-prim-by-id-logtest (_type_ uint) collide-shape-prim 34) - (detect-riders! (_type_) symbol 35) - (build-bounding-box-for-shape (_type_ bounding-box float collide-spec) symbol 36) - (integrate-and-collide! (_type_ vector) none 37) - (find-collision-meshes (_type_) none 38) - (on-platform (_type_ collide-shape collide-query) symbol 39) - (find-overlapping-shapes (_type_ overlaps-others-params) symbol 40) - (shove-to-closest-point-on-path (_type_ attack-info float) vector 41) - (should-push-away (_type_ collide-shape collide-query) symbol 42) - (pull-rider! (_type_ pull-rider-info) none 43) - (pull-riders! (_type_) symbol 44) - (do-push-aways (_type_) collide-spec 45) - (update-transforms (_type_) none 46) - (set-collide-with! (_type_ collide-spec) none 47) - (set-collide-as! (_type_ collide-spec) none 48) - (modify-collide-as! (_type_ int collide-spec collide-spec) none 49) - (send-shoves (_type_ process touching-shapes-entry float float float) symbol 50) - (above-ground? (_type_ collide-query vector collide-spec float float float) symbol 51) - (water-info-init! (_type_ water-info collide-action) water-info 52) - (iterate-prims (_type_ (function collide-shape-prim none)) none 53) - (pusher-init (_type_) none 54) + (new (symbol type process-drawable collide-list-enum) _type_) + (move-by-vector! (_type_ vector) none) + (move-to-point! (_type_ vector) none) + (debug-draw (_type_) none) + (fill-cache-for-shape (_type_ float collide-query) none) + (fill-cache-integrate-and-collide (_type_ vector collide-query meters) none) + (find-prim-by-id (_type_ uint) collide-shape-prim) + (find-prim-by-id-logtest (_type_ uint) collide-shape-prim) + (detect-riders! (_type_) symbol) + (build-bounding-box-for-shape (_type_ bounding-box float collide-spec) symbol) + (integrate-and-collide! (_type_ vector) none) + (find-collision-meshes (_type_) none) + (on-platform (_type_ collide-shape collide-query) symbol) + (find-overlapping-shapes (_type_ overlaps-others-params) symbol) + (shove-to-closest-point-on-path (_type_ attack-info float) vector) + (should-push-away (_type_ collide-shape collide-query) symbol) + (pull-rider! (_type_ pull-rider-info) none) + (pull-riders! (_type_) symbol) + (do-push-aways (_type_) collide-spec) + (update-transforms (_type_) none) + (set-collide-with! (_type_ collide-spec) none) + (set-collide-as! (_type_ collide-spec) none) + (modify-collide-as! (_type_ int collide-spec collide-spec) none) + (send-shoves (_type_ process touching-shapes-entry float float float) symbol) + (above-ground? (_type_ collide-query vector collide-spec float float float) symbol) + (water-info-init! (_type_ water-info collide-action) water-info) + (iterate-prims (_type_ (function collide-shape-prim none)) none) + (pusher-init (_type_) none) ) ) ;; definition for method 3 of type collide-shape -(defmethod inspect collide-shape ((this collide-shape)) +(defmethod inspect ((this collide-shape)) (when (not this) (set! this this) (goto cfg-136) @@ -1582,58 +1549,55 @@ ;; definition of type collide-shape-moving (deftype collide-shape-moving (collide-shape) - ((rider-time time-frame :offset-assert 200) - (rider-last-move vector :inline :offset-assert 208) - (trans-old vector :inline :offset-assert 224) - (trans-old-old vector :inline :offset 240) - (trans-old-old-old vector :inline :offset 256) - (poly-pat pat-surface :offset 272) - (cur-pat pat-surface :offset-assert 276) - (ground-pat pat-surface :offset-assert 280) - (status collide-status :offset-assert 288) - (old-status collide-status :offset-assert 296) - (prev-status collide-status :offset-assert 304) - (reaction-flag cshape-reaction-flags :offset-assert 312) - (reaction (function control-info collide-query vector vector collide-status) :offset-assert 316) - (no-reaction (function collide-shape-moving collide-query vector vector object) :offset-assert 320) - (local-normal vector :inline :offset-assert 336) - (surface-normal vector :inline :offset-assert 352) - (poly-normal vector :inline :offset-assert 368) - (ground-poly-normal vector :inline :offset-assert 384) - (gspot-pos vector :inline :offset-assert 400) - (gspot-normal vector :inline :offset-assert 416) - (grount-touch-point vector :inline :offset-assert 432) - (ground-impact-vel meters :offset-assert 448) - (surface-angle float :offset-assert 452) - (poly-angle float :offset-assert 456) - (touch-angle float :offset-assert 460) - (coverage float :offset-assert 464) - (dynam dynamics :offset-assert 468) - (surf surface :offset-assert 472) + ((rider-time time-frame) + (rider-last-move vector :inline) + (trans-old vector :inline) + (trans-old-old vector :inline :offset 240) + (trans-old-old-old vector :inline :offset 256) + (poly-pat pat-surface :offset 272) + (cur-pat pat-surface) + (ground-pat pat-surface) + (status collide-status) + (old-status collide-status) + (prev-status collide-status) + (reaction-flag cshape-reaction-flags) + (reaction (function control-info collide-query vector vector collide-status)) + (no-reaction (function collide-shape-moving collide-query vector vector object)) + (local-normal vector :inline) + (surface-normal vector :inline) + (poly-normal vector :inline) + (ground-poly-normal vector :inline) + (gspot-pos vector :inline) + (gspot-normal vector :inline) + (grount-touch-point vector :inline) + (ground-impact-vel meters) + (surface-angle float) + (poly-angle float) + (touch-angle float) + (coverage float) + (dynam dynamics) + (surf surface) ) - :method-count-assert 68 - :size-assert #x1dc - :flag-assert #x44000001dc (:methods - (new (symbol type process-drawable collide-list-enum) _type_ 0) - (find-ground (_type_ collide-query collide-spec float float float) symbol 55) - (react-to-pat! (_type_ pat-surface) cshape-reaction-flags 56) - (integrate-no-collide! (_type_ vector) none 57) - (integrate-for-enemy-no-mtg (_type_ vector overlaps-others-params) symbol 58) - (move-above-ground (_type_ vector move-above-ground-params) none 59) - (move-to-ground (_type_ float float symbol collide-spec) none 60) - (move-to-ground-point (_type_ vector vector vector) none 61) - (compute-acc-due-to-gravity (_type_ vector float) vector 62) - (collide-shape-moving-method-63 (_type_ rigid-body float) none 63) - (try-snap-to-surface (_type_ vector float float float) symbol 64) - (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol 65) - (step-collison! (_type_ vector vector float int) float 66) - (collide-with-all-collide-cache-prims (_type_ matrix collide-query) none 67) + (new (symbol type process-drawable collide-list-enum) _type_) + (find-ground (_type_ collide-query collide-spec float float float) symbol) + (react-to-pat! (_type_ pat-surface) cshape-reaction-flags) + (integrate-no-collide! (_type_ vector) none) + (integrate-for-enemy-no-mtg (_type_ vector overlaps-others-params) symbol) + (move-above-ground (_type_ vector move-above-ground-params) none) + (move-to-ground (_type_ float float symbol collide-spec) none) + (move-to-ground-point (_type_ vector vector vector) none) + (compute-acc-due-to-gravity (_type_ vector float) vector) + (collide-shape-moving-method-63 (_type_ rigid-body float) none) + (try-snap-to-surface (_type_ vector float float float) symbol) + (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol) + (step-collison! (_type_ vector vector float int) float) + (collide-with-all-collide-cache-prims (_type_ matrix collide-query) none) ) ) ;; definition for method 3 of type collide-shape-moving -(defmethod inspect collide-shape-moving ((this collide-shape-moving)) +(defmethod inspect ((this collide-shape-moving)) (when (not this) (set! this this) (goto cfg-136) @@ -1956,7 +1920,7 @@ ;; definition for method 4 of type collide-shape-prim-group ;; WARN: Return type mismatch uint vs int. -(defmethod length collide-shape-prim-group ((this collide-shape-prim-group)) +(defmethod length ((this collide-shape-prim-group)) (the-as int (-> this num-children)) ) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape-rider_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape-rider_REF.gc index 49faa013145..34b0eccafac 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape-rider_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape-rider_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 39 of type collide-shape -(defmethod on-platform collide-shape ((this collide-shape) (arg0 collide-shape) (arg1 collide-query)) +(defmethod on-platform ((this collide-shape) (arg0 collide-shape) (arg1 collide-query)) (let ((v1-0 arg1)) (set! (-> v1-0 best-dist) 0.0) (set! (-> v1-0 best-my-prim) #f) @@ -34,14 +34,14 @@ ;; definition for method 17 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. -(defmethod on-platform-test collide-shape-prim ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) +(defmethod on-platform-test ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%") (none) ) ;; definition for method 17 of type collide-shape-prim-group ;; WARN: Return type mismatch int vs none. -(defmethod on-platform-test collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) +(defmethod on-platform-test ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (let ((s4-0 (-> arg0 prim-core collide-as)) (s3-0 (-> this child 0)) ) @@ -71,7 +71,7 @@ ;; definition for method 17 of type collide-shape-prim-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch pat-surface vs none. -(defmethod on-platform-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) +(defmethod on-platform-test ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (case (-> arg0 type) ((collide-shape-prim-group) (let ((s4-0 (-> this prim-core collide-with)) @@ -136,7 +136,7 @@ ) ;; definition for method 9 of type collide-rider-pool -(defmethod add-rider collide-rider-pool ((this collide-rider-pool) (arg0 handle)) +(defmethod add-rider ((this collide-rider-pool) (arg0 handle)) (let ((v1-0 (-> this alloc-count))) (cond ((< v1-0 20) @@ -157,7 +157,7 @@ ;; definition for method 35 of type collide-shape ;; WARN: Return type mismatch joint-control-status vs symbol. -(defmethod detect-riders! collide-shape ((this collide-shape)) +(defmethod detect-riders! ((this collide-shape)) (local-vars (v0-7 joint-control-status) (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -317,7 +317,7 @@ ;; definition for method 44 of type collide-shape ;; WARN: Return type mismatch int vs symbol. -(defmethod pull-riders! collide-shape ((this collide-shape)) +(defmethod pull-riders! ((this collide-shape)) (let ((s5-0 (-> this riders))) (when s5-0 (let ((s4-0 (new 'stack-no-clear 'pull-rider-info))) @@ -354,7 +354,7 @@ ;; definition for method 43 of type collide-shape ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod pull-rider! collide-shape ((this collide-shape) (arg0 pull-rider-info)) +(defmethod pull-rider! ((this collide-shape) (arg0 pull-rider-info)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc index e3c30aaa287..e7dda1ab878 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 54 of type collide-shape ;; WARN: Return type mismatch collide-shape vs none. -(defmethod pusher-init collide-shape ((this collide-shape)) +(defmethod pusher-init ((this collide-shape)) (when (logtest? (collide-spec pusher) (-> this root-prim prim-core collide-as)) (let ((proc (the-as process-tree (-> this process)))) (while (not (logtest? (-> proc mask) (process-mask process-tree))) @@ -18,7 +18,7 @@ ) ;; definition for method 42 of type collide-shape -(defmethod should-push-away collide-shape ((this collide-shape) (other collide-shape) (cquery collide-query)) +(defmethod should-push-away ((this collide-shape) (other collide-shape) (cquery collide-query)) (local-vars (v1-2 uint) (v1-3 float) (a2-2 uint) (a3-2 uint)) (rlet ((acc :class vf) (vf0 :class vf) @@ -77,14 +77,14 @@ ;; definition for method 18 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. -(defmethod should-push-away-test collide-shape-prim ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query)) +(defmethod should-push-away-test ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query)) (format 0 "ERROR: collide-shape-prim::should-push-away-test was called illegally!~%") (none) ) ;; definition for method 18 of type collide-shape-prim-group ;; WARN: Return type mismatch int vs none. -(defmethod should-push-away-test collide-shape-prim-group ((this collide-shape-prim-group) (other collide-shape-prim) (cquery collide-query)) +(defmethod should-push-away-test ((this collide-shape-prim-group) (other collide-shape-prim) (cquery collide-query)) (local-vars (a0-2 collide-action) (a0-3 float) (f0-0 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -142,7 +142,7 @@ ;; definition for method 19 of type collide-shape-prim ;; WARN: Return type mismatch int vs none. -(defmethod should-push-away-a-group-test collide-shape-prim ((this collide-shape-prim) (other collide-shape-prim-group) (cquery collide-query)) +(defmethod should-push-away-a-group-test ((this collide-shape-prim) (other collide-shape-prim-group) (cquery collide-query)) (local-vars (a0-2 collide-action) (a0-3 float) (f0-0 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -201,7 +201,7 @@ ;; definition for method 18 of type collide-shape-prim-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod should-push-away-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (other collide-shape-prim) (cquery collide-query)) +(defmethod should-push-away-test ((this collide-shape-prim-mesh) (other collide-shape-prim) (cquery collide-query)) (let ((v1-0 (-> other prim-core prim-type))) (cond ((= v1-0 (prim-type group)) @@ -252,7 +252,7 @@ ;; definition for method 18 of type collide-shape-prim-sphere ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod should-push-away-test collide-shape-prim-sphere ((this collide-shape-prim-sphere) (other collide-shape-prim) (cquery collide-query)) +(defmethod should-push-away-test ((this collide-shape-prim-sphere) (other collide-shape-prim) (cquery collide-query)) (local-vars (v1-3 float)) (rlet ((acc :class vf) (Q :class vf) @@ -402,14 +402,14 @@ ;; definition for method 15 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-mesh!~%") (none) ) ;; definition for method 15 of type collide-shape-prim-sphere ;; WARN: Return type mismatch int vs none. -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-sphere ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -482,14 +482,14 @@ ;; definition for method 15 of type collide-shape-prim-mesh ;; WARN: Return type mismatch object vs none. -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim mesh is not currently supported!~%") (none) ) ;; definition for method 15 of type collide-shape-prim-group ;; WARN: Return type mismatch int vs none. -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) (let ((s4-0 (-> arg1 prim-core collide-as)) (s3-0 (-> this child 0)) ) @@ -506,14 +506,14 @@ ;; definition for method 16 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-sphere!~%") (none) ) ;; definition for method 16 of type collide-shape-prim-sphere ;; WARN: Return type mismatch int vs none. -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-sphere ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -582,14 +582,14 @@ ;; definition for method 16 of type collide-shape-prim-mesh ;; WARN: Return type mismatch object vs none. -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim sphere is not currently supported!~%") (none) ) ;; definition for method 16 of type collide-shape-prim-group ;; WARN: Return type mismatch int vs none. -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) (let ((s4-0 (-> arg1 prim-core collide-as)) (s3-0 (-> this child 0)) ) @@ -768,7 +768,7 @@ ) ;; definition for method 56 of type collide-shape-moving -(defmethod react-to-pat! collide-shape-moving ((this collide-shape-moving) (arg0 pat-surface)) +(defmethod react-to-pat! ((this collide-shape-moving) (arg0 pat-surface)) (let ((set-flags (cshape-reaction-flags))) (set! (-> this cur-pat) arg0) (set! (-> this poly-pat) arg0) @@ -1020,7 +1020,7 @@ ;; definition for method 66 of type collide-shape-moving ;; INFO: Used lq/sq -(defmethod step-collison! collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) +(defmethod step-collison! ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) (local-vars (sv-592 int)) (let ((s5-0 (new 'stack 'collide-query)) (s2-0 (new 'stack-no-clear 'vector)) @@ -1111,7 +1111,7 @@ ) ;; definition for method 37 of type collide-shape -(defmethod integrate-and-collide! collide-shape ((this collide-shape) (arg0 vector)) +(defmethod integrate-and-collide! ((this collide-shape) (arg0 vector)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -1138,7 +1138,7 @@ ;; definition for method 37 of type collide-shape-moving ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod integrate-and-collide! collide-shape-moving ((this collide-shape-moving) (arg0 vector)) +(defmethod integrate-and-collide! ((this collide-shape-moving) (arg0 vector)) (update-transforms this) (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) (set! (-> this trans-old-old quad) (-> this trans-old quad)) @@ -1191,7 +1191,7 @@ ;; definition for method 37 of type control-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod integrate-and-collide! control-info ((this control-info) (arg0 vector)) +(defmethod integrate-and-collide! ((this control-info) (arg0 vector)) (stopwatch-start (the-as stopwatch (&-> *collide-stats* pad0 1))) (when (< 1638400.0 (vector-length arg0)) (format 0 "WARNING: target vel is ~M m/s, reseting to zero.~%" (vector-length arg0)) @@ -1336,7 +1336,7 @@ ;; definition for method 64 of type collide-shape-moving ;; INFO: Used lq/sq -(defmethod try-snap-to-surface collide-shape-moving ((this collide-shape-moving) (vel vector) (check-dist float) (amt float) (bounce-dist float)) +(defmethod try-snap-to-surface ((this collide-shape-moving) (vel vector) (check-dist float) (amt float) (bounce-dist float)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -1418,7 +1418,7 @@ ) ;; definition for method 65 of type collide-shape-moving -(defmethod fill-and-try-snap-to-surface collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 collide-query)) +(defmethod fill-and-try-snap-to-surface ((this collide-shape-moving) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 collide-query)) (vector-normalize-copy! (-> arg4 start-pos) arg0 arg1) (vector+! (-> arg4 start-pos) (-> arg4 start-pos) (-> this trans)) (vector-normalize-copy! (-> arg4 move-dist) arg0 (- arg2 arg1)) @@ -1429,7 +1429,7 @@ ;; definition for method 61 of type collide-shape-moving ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-to-ground-point collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod move-to-ground-point ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) (move-to-point! this arg0) (set! (-> arg1 y) 0.0) (set! (-> this grount-touch-point quad) (-> arg0 quad)) @@ -1446,7 +1446,7 @@ ;; definition for method 57 of type collide-shape-moving ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod integrate-no-collide! collide-shape-moving ((this collide-shape-moving) (arg0 vector)) +(defmethod integrate-no-collide! ((this collide-shape-moving) (arg0 vector)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -1503,7 +1503,7 @@ ) ;; definition for method 58 of type collide-shape-moving -(defmethod integrate-for-enemy-no-mtg collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 overlaps-others-params)) +(defmethod integrate-for-enemy-no-mtg ((this collide-shape-moving) (arg0 vector) (arg1 overlaps-others-params)) (integrate-no-collide! this arg0) (let ((s5-1 (find-overlapping-shapes this arg1))) (if s5-1 @@ -1515,7 +1515,7 @@ ;; definition for method 55 of type collide-shape-moving ;; INFO: Used lq/sq -(defmethod find-ground collide-shape-moving ((this collide-shape-moving) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod find-ground ((this collide-shape-moving) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (set! (-> this gspot-pos quad) (-> this trans quad)) (set! (-> arg0 start-pos quad) (-> this trans quad)) (vector-reset! (-> arg0 move-dist)) @@ -1550,14 +1550,14 @@ ;; definition for method 51 of type collide-shape ;; INFO: Used lq/sq -(defmethod above-ground? collide-shape ((this collide-shape) - (arg0 collide-query) - (arg1 vector) - (arg2 collide-spec) - (arg3 float) - (arg4 float) - (arg5 float) - ) +(defmethod above-ground? ((this collide-shape) + (arg0 collide-query) + (arg1 vector) + (arg2 collide-spec) + (arg3 float) + (arg4 float) + (arg5 float) + ) "@returns if we are above ground or not" (set! (-> arg0 start-pos quad) (-> arg1 quad)) (+! (-> arg0 start-pos y) arg3) @@ -1577,7 +1577,7 @@ ;; definition for method 59 of type collide-shape-moving ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-above-ground collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 move-above-ground-params)) +(defmethod move-above-ground ((this collide-shape-moving) (arg0 vector) (arg1 move-above-ground-params)) (when *debug-segment* (let ((s3-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) (v1-7 'collide) @@ -1715,7 +1715,7 @@ ;; definition for method 60 of type collide-shape-moving ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-to-ground collide-shape-moving ((this collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) +(defmethod move-to-ground ((this collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) (local-vars (sv-576 profile-segment) (sv-592 int)) (when *debug-segment* (let ((s1-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) @@ -1817,7 +1817,7 @@ ;; definition for method 62 of type collide-shape-moving ;; INFO: Used lq/sq -(defmethod compute-acc-due-to-gravity collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 float)) +(defmethod compute-acc-due-to-gravity ((this collide-shape-moving) (arg0 vector) (arg1 float)) (let* ((s4-0 (vector-negate! (new 'stack-no-clear 'vector) (-> this dynam gravity))) (a2-1 (-> this local-normal)) (a2-2 (vector-reflect-flat! (new-stack-vector0) s4-0 a2-1)) @@ -1837,7 +1837,7 @@ ) ;; definition for method 32 of type collide-shape -(defmethod fill-cache-integrate-and-collide collide-shape ((this collide-shape) (arg0 vector) (arg1 collide-query) (arg2 meters)) +(defmethod fill-cache-integrate-and-collide ((this collide-shape) (arg0 vector) (arg1 collide-query) (arg2 meters)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -1864,7 +1864,7 @@ ;; definition for method 31 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod fill-cache-for-shape collide-shape ((this collide-shape) (arg0 float) (arg1 collide-query)) +(defmethod fill-cache-for-shape ((this collide-shape) (arg0 float) (arg1 collide-query)) (cond ((build-bounding-box-for-shape this (-> arg1 bbox) arg0 (-> arg1 collide-with)) (fill-using-bounding-box *collide-cache* arg1) @@ -1881,7 +1881,7 @@ ) ;; definition for method 36 of type collide-shape -(defmethod build-bounding-box-for-shape collide-shape ((this collide-shape) (arg0 bounding-box) (arg1 float) (arg2 collide-spec)) +(defmethod build-bounding-box-for-shape ((this collide-shape) (arg0 bounding-box) (arg1 float) (arg2 collide-spec)) (rlet ((vf0 :class vf) (vf24 :class vf) (vf25 :class vf) @@ -1947,7 +1947,7 @@ ) ;; definition for method 33 of type collide-shape -(defmethod find-prim-by-id collide-shape ((this collide-shape) (arg0 uint)) +(defmethod find-prim-by-id ((this collide-shape) (arg0 uint)) (let ((v1-0 (-> this root-prim))) (countdown (a0-1 (-> this total-prims)) (if (= (-> v1-0 prim-id) arg0) @@ -1960,7 +1960,7 @@ ) ;; definition for method 34 of type collide-shape -(defmethod find-prim-by-id-logtest collide-shape ((this collide-shape) (arg0 uint)) +(defmethod find-prim-by-id-logtest ((this collide-shape) (arg0 uint)) (let ((v1-0 (-> this root-prim))) (countdown (a0-1 (-> this total-prims)) (if (logtest? (-> v1-0 prim-id) arg0) @@ -2038,7 +2038,7 @@ ;; definition for method 30 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw collide-shape ((this collide-shape)) +(defmethod debug-draw ((this collide-shape)) (if (sphere-in-view-frustum? (the-as sphere (-> this root-prim prim-core))) (debug-draw (-> this root-prim)) ) @@ -2070,7 +2070,7 @@ ;; definition for method 46 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod update-transforms collide-shape ((this collide-shape)) +(defmethod update-transforms ((this collide-shape)) (local-vars (v1-8 float) (a1-5 float) (a1-7 float)) (rlet ((acc :class vf) (Q :class vf) @@ -2151,7 +2151,7 @@ ;; definition for method 28 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod move-by-vector! collide-shape ((this collide-shape) (arg0 vector)) +(defmethod move-by-vector! ((this collide-shape) (arg0 vector)) (vector+! (-> this trans) (-> this trans) arg0) (let ((v1-1 (-> this root-prim))) (countdown (a0-1 (-> this total-prims)) @@ -2167,7 +2167,7 @@ ;; definition for method 29 of type collide-shape ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-to-point! collide-shape ((this collide-shape) (arg0 vector)) +(defmethod move-to-point! ((this collide-shape) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> this trans)) (set! (-> this trans quad) (-> arg0 quad)) @@ -2185,7 +2185,7 @@ ;; definition for method 47 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod set-collide-with! collide-shape ((this collide-shape) (arg0 collide-spec)) +(defmethod set-collide-with! ((this collide-shape) (arg0 collide-spec)) (let ((v1-0 (-> this root-prim))) (countdown (a0-1 (-> this total-prims)) (set! (-> v1-0 prim-core collide-with) arg0) @@ -2200,7 +2200,7 @@ ;; definition for method 48 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod set-collide-as! collide-shape ((this collide-shape) (arg0 collide-spec)) +(defmethod set-collide-as! ((this collide-shape) (arg0 collide-spec)) (let ((v1-0 (-> this root-prim))) (countdown (a0-1 (-> this total-prims)) (set! (-> v1-0 prim-core collide-as) arg0) @@ -2215,7 +2215,7 @@ ;; definition for method 53 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod iterate-prims collide-shape ((this collide-shape) (arg0 (function collide-shape-prim none))) +(defmethod iterate-prims ((this collide-shape) (arg0 (function collide-shape-prim none))) (let ((s5-0 (-> this root-prim))) (countdown (s4-0 (-> this total-prims)) (arg0 s5-0) @@ -2228,7 +2228,7 @@ ;; definition for method 38 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod find-collision-meshes collide-shape ((this collide-shape)) +(defmethod find-collision-meshes ((this collide-shape)) (let ((s5-0 (-> this root-prim)) (s4-0 0) ) @@ -2291,7 +2291,7 @@ ;; definition for method 9 of type collide-shape-prim ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw collide-shape-prim ((this collide-shape-prim)) +(defmethod debug-draw ((this collide-shape-prim)) (add-debug-sphere #t (bucket-id debug2) @@ -2305,7 +2305,7 @@ ;; definition for method 9 of type collide-shape-prim-sphere ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw collide-shape-prim-sphere ((this collide-shape-prim-sphere)) +(defmethod debug-draw ((this collide-shape-prim-sphere)) (add-debug-sphere #t (bucket-id debug2) @@ -2329,7 +2329,7 @@ ;; definition for method 9 of type collide-shape-prim-mesh ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw collide-shape-prim-mesh ((this collide-shape-prim-mesh)) +(defmethod debug-draw ((this collide-shape-prim-mesh)) (add-debug-sphere #t (bucket-id debug2) @@ -2343,7 +2343,7 @@ ;; definition for method 9 of type collide-shape-prim-group ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw collide-shape-prim-group ((this collide-shape-prim-group)) +(defmethod debug-draw ((this collide-shape-prim-group)) (add-debug-sphere #t (bucket-id debug2) @@ -2360,7 +2360,7 @@ ;; definition for method 45 of type collide-shape ;; INFO: Used lq/sq -(defmethod do-push-aways collide-shape ((this collide-shape)) +(defmethod do-push-aways ((this collide-shape)) (local-vars (at-0 int) (v1-55 float) (a2-5 float) (a2-12 float)) (with-pp (rlet ((vf0 :class vf) @@ -2541,7 +2541,7 @@ ;; definition for method 40 of type collide-shape ;; WARN: Return type mismatch object vs symbol. -(defmethod find-overlapping-shapes collide-shape ((this collide-shape) (arg0 overlaps-others-params)) +(defmethod find-overlapping-shapes ((this collide-shape) (arg0 overlaps-others-params)) (local-vars (a0-10 float) (a0-14 uint) (a2-5 float) (a2-12 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2702,14 +2702,14 @@ ) ;; definition for method 12 of type collide-shape-prim -(defmethod overlaps-others-test collide-shape-prim ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (format 0 "ERROR: Unsupported call to collide-shape-prim::overlaps-others-test!~%") #f ) ;; definition for method 12 of type collide-shape-prim-group ;; WARN: Return type mismatch object vs symbol. -(defmethod overlaps-others-test collide-shape-prim-group ((this collide-shape-prim-group) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test ((this collide-shape-prim-group) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (a0-3 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2768,7 +2768,7 @@ ;; definition for method 13 of type collide-shape-prim ;; WARN: Return type mismatch object vs symbol. -(defmethod overlaps-others-group collide-shape-prim ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim-group)) +(defmethod overlaps-others-group ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim-group)) (local-vars (a0-4 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2827,7 +2827,7 @@ ) ;; definition for method 12 of type collide-shape-prim-sphere -(defmethod overlaps-others-test collide-shape-prim-sphere ((this collide-shape-prim-sphere) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test ((this collide-shape-prim-sphere) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (v1-11 uint) (s4-0 uint)) (let ((v1-0 (-> arg1 prim-core prim-type))) (b! (nonzero? v1-0) cfg-2 :delay (set! s4-0 (the-as uint (-> arg0 options)))) @@ -2873,7 +2873,7 @@ ) ;; definition for method 12 of type collide-shape-prim-mesh -(defmethod overlaps-others-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test ((this collide-shape-prim-mesh) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (v1-3 uint) (v1-11 uint) (s4-0 uint)) (let ((v1-0 (-> arg1 prim-core prim-type))) (b! (nonzero? v1-0) cfg-2 :delay (set! s4-0 (the-as uint (-> arg0 options)))) @@ -2928,7 +2928,7 @@ ;; definition for method 49 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod modify-collide-as! collide-shape ((this collide-shape) (arg0 int) (arg1 collide-spec) (arg2 collide-spec)) +(defmethod modify-collide-as! ((this collide-shape) (arg0 int) (arg1 collide-spec) (arg2 collide-spec)) (let ((v1-0 (-> this root-prim))) (countdown (a0-1 (-> this total-prims)) (if (logtest? (-> v1-0 prim-id) arg0) @@ -2943,7 +2943,7 @@ ;; definition for method 50 of type collide-shape ;; INFO: Used lq/sq -(defmethod send-shoves collide-shape ((this collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float)) +(defmethod send-shoves ((this collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float)) (local-vars (sv-144 process) (sv-160 collide-shape-prim) (sv-176 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -3008,7 +3008,7 @@ ;; definition for method 41 of type collide-shape ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs vector. -(defmethod shove-to-closest-point-on-path collide-shape ((this collide-shape) (arg0 attack-info) (arg1 float)) +(defmethod shove-to-closest-point-on-path ((this collide-shape) (arg0 attack-info) (arg1 float)) (set! (-> arg0 shove-up) arg1) (let* ((s3-0 (-> this process path)) (s2-0 (-> s3-0 curve num-cverts)) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-target-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-target-h_REF.gc index f8d5c020ccc..95e2a1f5a95 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-target-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-target-h_REF.gc @@ -3,230 +3,227 @@ ;; definition of type control-info (deftype control-info (collide-shape-moving) - ((unknown-float00 float :offset 448) - (unknown-float01 float :offset 452) - (unknown-float02 float :offset 456) - (unknown-float03 float :offset 460) - (transv-ctrl vector :inline :offset 480) - (target-transv vector :inline :offset 496) - (bent-gravity-normal vector :inline :offset 512) - (quat-for-control quaternion :inline :offset 528) - (override-quat quaternion :inline :offset 544) - (override-quat-alpha float :offset 560) - (ctrl-xz-vel float :offset 564) - (unknown-float003 float :offset 568) - (turn-go-the-long-way float :offset 572) - (velocity-after-thrust float :offset 576) - (turn-lockout-end-time time-frame :offset 584) - (turn-to-alt-heading vector :inline :offset 592) - (last-transv vector :inline :offset 608) - (last-quat-for-control quaternion :inline :offset 624) - (trans-log-trans vector 128 :inline :offset 640) - (trans-log-times time-frame 128 :offset 2688) - (trans-log-idx int32 :offset 3712) - (draw-offset vector :inline :offset 3728) - (cspace-offset vector :inline :offset 3744) - (anim-collide-offset-local vector :inline :offset 3760) - (anim-collide-offset-world vector :inline :offset 3776) - (old-anim-collide-offset-world vector :inline :offset 3792) - (anim-collide-offset-delta-world vector :inline :offset 3808) - (standard-dynamics dynamics :offset 3824) - (mod-surface surface :offset 3828) - (current-surface surface :offset 3832) - (prev-surf surface :offset 3836) - (time-of-last-surface-change time-frame :offset 3840) - (cpad cpad-info :offset 3848) - (turn-to-angle float :offset 3852) - (last-turn-to-angle float :offset 3856) - (turn-to-magnitude float :offset 3860) - (last-turn-to-magnitude float :offset 3864) - (to-target-pt-xz vector :inline :offset 3872) - (last-to-target-pt-xz vector :inline :offset 3888) - (turn-to-target vector :inline :offset 3904) - (last-turn-to-target vector :inline :offset 3920) - (turn-history-ctrl vector 7 :inline :offset 3936) - (pad-xz-dir vector :inline :offset 4064) - (last-pad-xz-dir vector :inline :offset 4080) - (pad-magnitude float :offset 4096) - (last-pad-magnitude float :offset 4100) - (time-of-last-pad-read time-frame :offset 4104) - (w-R-c matrix :inline :offset 4112) - (c-R-w matrix :inline :offset 4176) - (ctrl-orientation matrix :inline :offset 4240) - (pre-collide-local-normal vector :inline :offset 4320) - (camera-pos vector :inline :offset 4336) - (cam-R-w matrix :inline :offset 4352) - (update-cam-R-w-start-time int64 :offset 4416) - (force-turn-to-direction vector :inline :offset 4432) - (force-turn-to-speed float :offset 4448) - (unknown-floatiujh1bnb2n3i1 float :offset 4452) - (force-turn-to-strength float :offset 4456) - (tongue-counter int32 :offset 4460) - (collide-extra-velocity vector :inline :offset 4464) - (additional-decaying-velocity vector :inline :offset 4480) - (additional-decaying-velocity-end-time time-frame :offset 4496) - (additional-decaying-velocity-decay-start-time time-frame :offset 4504) - (gravity-normal vector :inline :offset 4512) - (last-gravity-normal vector :inline :offset 4528) - (last-trans-any-surf vector :inline :offset 4544) - (unknown-float16 float :offset 4548) - (ground-contact-normal vector :inline :offset 4560) - (last-trans-on-ground vector :inline :offset 4576) - (ground-contact-sphere-center vector :inline :offset 4592) - (transv-on-last-impact vector :inline :offset 4608) - (list-time-on-ground time-frame :offset 4624) - (ground-local-norm-dot-grav float :offset 4632) - (local-slope-z float :offset 4636) - (local-slope-x float :offset 4640) - (surface-slope-z float :offset 4644) - (surface-slope-x float :offset 4648) - (last-time-on-surface time-frame :offset 4656) - (normal-impact-vel float :offset 4664) - (last-time-touching-actor time-frame :offset 4672) - (wall-contact-pat pat-surface :offset 4680) - (wall-contact-pt vector :inline :offset 4688) - (wall-contact-poly-normal vector :inline :offset 4704) - (wall-contact-normal vector :inline :offset 4720) - (actor-contact-pt vector :inline :offset 4736) - (actor-contact-normal vector :inline :offset 4752) - (actor-contact-handle handle :offset 4768) - (gspot-pat-surfce pat-surface :offset 4776) - (gspot-slope-z float :offset 4780) - (gspot-slope-x float :offset 4784) - (ctrl-slope-heading float :offset 4788) - (ctrl-slope-z float :offset 4792) - (ctrl-slope-x float :offset 4796) - (unknown-word000 int32 :offset 4800) - (unknown-float002 float :offset 4804) - (unknown-float-n12iuh3n1 float :offset 4808) - (unknown-float-ki1jhbn23hj float :offset 4812) - (time-of-last-lc time-frame :offset 4816) - (low-coverage-pat-next1 pat-surface :offset 4828) - (low-coverage-dist-to-next2 float :offset 4832) - (low-coverage-pat-next2 pat-surface :offset 4836) - (low-coverage-slope-to-next1 float :offset 4824) - (low-coverage-norm-of-next1 vector :inline :offset 4848) - (low-coverage-norm-of-next2 vector :inline :offset 4864) - (low-coverage-overhang-plane-normal vector :inline :offset 4912) - (low-coverage-tangent vector :inline :offset 4928) - (low-coverage-tangent-xz vector :inline :offset 4944) - (btransv vector :inline :offset 4976) - (blocked-factor float :offset 4992) - (blocked-in-air-factor float :offset 4996) - (time-of-last-clear-wall-in-jump time-frame :offset 5000) - (time-of-last-lc-touch-edge time-frame :offset 5008) - (collision-spheres collide-shape-prim-sphere 10 :offset 5016) - (unknown-word02 int32 :offset 5064) - (last-roll-end-time time-frame :offset 5072) - (last-running-attack-end-time time-frame :offset 5080) - (last-hands-attempt-time time-frame :offset 5088) - (last-attack-end-time time-frame :offset 5096) - (last-feet-attempt-time time-frame :offset 5104) - (unknown-time-frame13 time-frame :offset 5112) - (last-time-of-stuck time-frame :offset 5120) - (bend-amount float :offset 5132) - (bend-target float :offset 5136) - (bend-speed float :offset 5140) - (ctrl-to-head-offset vector :inline :offset 5152) - (lhand-cspace cspace :offset 5168) - (rhand-cspace cspace :offset 5172) - (midpoint-of-hands vector :inline :offset 5184) - (ctrl-to-hands-offset vector :inline :offset 5200) - (sidekick-root cspace :inline :offset 5216) - (collide-mode symbol :offset 5248) - (collide-mode-transition float :offset 5252) - (duck-gun-tube-transision float :offset 5256) - (transv-history vector 15 :inline :offset 5264) - (average-xz-vel float :offset 5520) - (idx-of-fastest-xz-vel int32 :offset 5524) - (hand-to-edge-dist float :offset 5528) - (unknown-symbol000 symbol :offset 5532) - (edge-grab-edge-dir vector :inline :offset 5536) - (unknown-vector35 vector :inline :offset 5552) - (edge-grab-across-edge-dir vector :inline :offset 5568) - (last-successful-compute-edge-time time-frame :offset 5584) - (edge-grab-start-time time-frame :offset 5592) - (unknown-handle000 handle :offset 5600) - (anim-handle handle :offset 5608) - (unknown-word04 uint32 :offset 5616) - (unknown-spool-anim00 spool-anim :offset 5616) - (unknown-word05 int32 :offset 5616) - (unknown-symbol01 symbol :offset 5616) - (unknown-float34 float :offset 5616) - (did-move-to-pole-or-max-jump-height float :offset 5620) - (unknown-symbol03 float :offset 5624) - (unknown-float35 float :offset 5628) - (unknown-float36 float :offset 5632) - (unknown-float37 float :offset 5636) - (unknown-vector37 vector :inline :offset 5648) - (unknown-vector38 vector :inline :offset 5664) - (unknown-vector39 vector :inline :offset 5680) - (unknown-vector40 vector :inline :offset 5696) - (sliding-start-time time-frame :offset 5712) - (unknown-time-frame18 time-frame :offset 5720) - (unknown-sound-id00 sound-id :offset 5776) - (unknown-handle02 handle :offset 5792) - (impact-ctrl impact-control :inline :offset 5824) - (unknown-word06 int32 :offset 5832) - (unknown-vector41 vector :inline :offset 5888) - (last-trans-leaving-surf vector :inline :offset 5904) - (unknown-float38 float :offset 5908) - (highest-jump-mark vector :inline :offset 5920) - (unknown-float39 float :offset 5924) - (unknown-time-frame19 time-frame :offset 5936) - (time-of-last-debug-float time-frame :offset 5944) - (danger-mode symbol :offset 5984) - (target-attack-id uint32 :offset 5988) - (attacked-by-id int32 :offset 5992) - (bomb-scale float :offset 5996) - (attack-count uint64 :offset 6000) - (send-attack-dest handle :offset 6008) - (send-attack-time time-frame :offset 6016) - (unknown-combo-tracker00 combo-tracker :inline :offset 6032) - (unknown-time-frame21 time-frame :offset 6072) - (unknown-dword07 int64 :offset 6096) - (unknown-dword08 int64 :offset 6104) - (unknown-dword09 int64 :offset 6112) - (unknown-dword10 int64 :offset 6120) - (jump-kind symbol :offset 6144) - (unknown-quaternion04 quaternion :inline :offset 6160) - (unknown-sound-id01 sound-id :offset 6176) - (unknown-float41 float :offset 6180) - (unknown-float42 float :offset 6184) - (history-idx uint16 :offset 6188) - (history-length uint16 :offset 6190) - (remaining-ctrl-iterations int32 :offset 6192) - (invul1-on-time time-frame :offset 6200) - (invul1-off-time time-frame :offset 6208) - (invul2-on-time time-frame :offset 6216) - (invul2-off-time time-frame :offset 6224) - (unknown-float43 float :offset 6232) - (unknown-float001 float :offset 6236) - (board-jump-and-swim-sound sound-id :offset 6240) - (bubbles-sound sound-id :offset 6244) - (unknown-time-frame26 time-frame :offset 6248) - (unknown-time-frame27 time-frame :offset 6256) - (yellow-eco-last-use-time int64 :offset 6264) - (align-xz-vel vector :inline :offset 6272) - (zx-vel-frac float :offset 6288) - (unknown-sound-id04 sound-id :offset 6292) - (unknown-float45 float :offset 6296) - (default-collide-as-all collide-spec :offset 6300) - (default-collide-as-fgnd collide-spec :offset 6304) - (default-collide-with-all collide-spec :offset 6308) - (default-collide-with-fgnd collide-spec :offset 6312) - (time-of-last-zero-input time-frame :offset 6320) - (time-of-last-nonzero-input time-frame :offset 6328) - (time-between-zero-inputs time-frame :offset 6336) - (time-of-last-debug-heal time-frame :offset 6368) - (last-nonzero-input-dir-targ quaternion :inline :offset 6384) - (time-of-last-wall-hide-first-check-pass time-frame :offset 6400) - (time-of-first-wall-hide-first-check-pass time-frame :offset 6408) - (pad uint8 :offset 6415) + ((unknown-float00 float :overlay-at ground-impact-vel) + (unknown-float01 float :overlay-at surface-angle) + (unknown-float02 float :overlay-at poly-angle) + (unknown-float03 float :overlay-at touch-angle) + (transv-ctrl vector :inline :offset 480) + (target-transv vector :inline :offset 496) + (bent-gravity-normal vector :inline :offset 512) + (quat-for-control quaternion :inline :offset 528) + (override-quat quaternion :inline :offset 544) + (override-quat-alpha float :offset 560) + (ctrl-xz-vel float :offset 564) + (unknown-float003 float :offset 568) + (turn-go-the-long-way float :offset 572) + (velocity-after-thrust float :offset 576) + (turn-lockout-end-time time-frame :offset 584) + (turn-to-alt-heading vector :inline :offset 592) + (last-transv vector :inline :offset 608) + (last-quat-for-control quaternion :inline :offset 624) + (trans-log-trans vector 128 :inline :offset 640) + (trans-log-times time-frame 128 :offset 2688) + (trans-log-idx int32 :offset 3712) + (draw-offset vector :inline :offset 3728) + (cspace-offset vector :inline :offset 3744) + (anim-collide-offset-local vector :inline :offset 3760) + (anim-collide-offset-world vector :inline :offset 3776) + (old-anim-collide-offset-world vector :inline :offset 3792) + (anim-collide-offset-delta-world vector :inline :offset 3808) + (standard-dynamics dynamics :offset 3824) + (mod-surface surface :offset 3828) + (current-surface surface :offset 3832) + (prev-surf surface :offset 3836) + (time-of-last-surface-change time-frame :offset 3840) + (cpad cpad-info :offset 3848) + (turn-to-angle float :offset 3852) + (last-turn-to-angle float :offset 3856) + (turn-to-magnitude float :offset 3860) + (last-turn-to-magnitude float :offset 3864) + (to-target-pt-xz vector :inline :offset 3872) + (last-to-target-pt-xz vector :inline :offset 3888) + (turn-to-target vector :inline :offset 3904) + (last-turn-to-target vector :inline :offset 3920) + (turn-history-ctrl vector 7 :inline :offset 3936) + (pad-xz-dir vector :inline :offset 4064) + (last-pad-xz-dir vector :inline :offset 4080) + (pad-magnitude float :offset 4096) + (last-pad-magnitude float :offset 4100) + (time-of-last-pad-read time-frame :offset 4104) + (w-R-c matrix :inline :offset 4112) + (c-R-w matrix :inline :offset 4176) + (ctrl-orientation matrix :inline :offset 4240) + (pre-collide-local-normal vector :inline :offset 4320) + (camera-pos vector :inline :offset 4336) + (cam-R-w matrix :inline :offset 4352) + (update-cam-R-w-start-time int64 :offset 4416) + (force-turn-to-direction vector :inline :offset 4432) + (force-turn-to-speed float :offset 4448) + (unknown-floatiujh1bnb2n3i1 float :offset 4452) + (force-turn-to-strength float :offset 4456) + (tongue-counter int32 :offset 4460) + (collide-extra-velocity vector :inline :offset 4464) + (additional-decaying-velocity vector :inline :offset 4480) + (additional-decaying-velocity-end-time time-frame :offset 4496) + (additional-decaying-velocity-decay-start-time time-frame :offset 4504) + (gravity-normal vector :inline :offset 4512) + (last-gravity-normal vector :inline :offset 4528) + (last-trans-any-surf vector :inline :offset 4544) + (unknown-float16 float :overlay-at (-> last-trans-any-surf y)) + (ground-contact-normal vector :inline :offset 4560) + (last-trans-on-ground vector :inline :offset 4576) + (ground-contact-sphere-center vector :inline :offset 4592) + (transv-on-last-impact vector :inline :offset 4608) + (list-time-on-ground time-frame :offset 4624) + (ground-local-norm-dot-grav float :offset 4632) + (local-slope-z float :offset 4636) + (local-slope-x float :offset 4640) + (surface-slope-z float :offset 4644) + (surface-slope-x float :offset 4648) + (last-time-on-surface time-frame :offset 4656) + (normal-impact-vel float :offset 4664) + (last-time-touching-actor time-frame :offset 4672) + (wall-contact-pat pat-surface :offset 4680) + (wall-contact-pt vector :inline :offset 4688) + (wall-contact-poly-normal vector :inline :offset 4704) + (wall-contact-normal vector :inline :offset 4720) + (actor-contact-pt vector :inline :offset 4736) + (actor-contact-normal vector :inline :offset 4752) + (actor-contact-handle handle :offset 4768) + (gspot-pat-surfce pat-surface :offset 4776) + (gspot-slope-z float :offset 4780) + (gspot-slope-x float :offset 4784) + (ctrl-slope-heading float :offset 4788) + (ctrl-slope-z float :offset 4792) + (ctrl-slope-x float :offset 4796) + (unknown-word000 int32 :offset 4800) + (unknown-float002 float :offset 4804) + (unknown-float-n12iuh3n1 float :offset 4808) + (unknown-float-ki1jhbn23hj float :offset 4812) + (time-of-last-lc time-frame :offset 4816) + (low-coverage-pat-next1 pat-surface :offset 4828) + (low-coverage-dist-to-next2 float :offset 4832) + (low-coverage-pat-next2 pat-surface :offset 4836) + (low-coverage-slope-to-next1 float :offset 4824) + (low-coverage-norm-of-next1 vector :inline :offset 4848) + (low-coverage-norm-of-next2 vector :inline :offset 4864) + (low-coverage-overhang-plane-normal vector :inline :offset 4912) + (low-coverage-tangent vector :inline :offset 4928) + (low-coverage-tangent-xz vector :inline :offset 4944) + (btransv vector :inline :offset 4976) + (blocked-factor float :offset 4992) + (blocked-in-air-factor float :offset 4996) + (time-of-last-clear-wall-in-jump time-frame :offset 5000) + (time-of-last-lc-touch-edge time-frame :offset 5008) + (collision-spheres collide-shape-prim-sphere 10 :offset 5016) + (unknown-word02 int32 :offset 5064) + (last-roll-end-time time-frame :offset 5072) + (last-running-attack-end-time time-frame :offset 5080) + (last-hands-attempt-time time-frame :offset 5088) + (last-attack-end-time time-frame :offset 5096) + (last-feet-attempt-time time-frame :offset 5104) + (unknown-time-frame13 time-frame :offset 5112) + (last-time-of-stuck time-frame :offset 5120) + (bend-amount float :offset 5132) + (bend-target float :offset 5136) + (bend-speed float :offset 5140) + (ctrl-to-head-offset vector :inline :offset 5152) + (lhand-cspace cspace :offset 5168) + (rhand-cspace cspace :offset 5172) + (midpoint-of-hands vector :inline :offset 5184) + (ctrl-to-hands-offset vector :inline :offset 5200) + (sidekick-root cspace :inline :offset 5216) + (collide-mode symbol :offset 5248) + (collide-mode-transition float :offset 5252) + (duck-gun-tube-transision float :offset 5256) + (transv-history vector 15 :inline :offset 5264) + (average-xz-vel float :offset 5520) + (idx-of-fastest-xz-vel int32 :offset 5524) + (hand-to-edge-dist float :offset 5528) + (unknown-symbol000 symbol :offset 5532) + (edge-grab-edge-dir vector :inline :offset 5536) + (unknown-vector35 vector :inline :offset 5552) + (edge-grab-across-edge-dir vector :inline :offset 5568) + (last-successful-compute-edge-time time-frame :offset 5584) + (edge-grab-start-time time-frame :offset 5592) + (unknown-handle000 handle :offset 5600) + (anim-handle handle :offset 5608) + (unknown-word04 uint32 :offset 5616) + (unknown-spool-anim00 spool-anim :overlay-at unknown-word04) + (unknown-word05 int32 :overlay-at unknown-spool-anim00) + (unknown-symbol01 symbol :overlay-at unknown-word05) + (unknown-float34 float :overlay-at unknown-symbol01) + (did-move-to-pole-or-max-jump-height float :offset 5620) + (unknown-symbol03 float :offset 5624) + (unknown-float35 float :offset 5628) + (unknown-float36 float :offset 5632) + (unknown-float37 float :offset 5636) + (unknown-vector37 vector :inline :offset 5648) + (unknown-vector38 vector :inline :offset 5664) + (unknown-vector39 vector :inline :offset 5680) + (unknown-vector40 vector :inline :offset 5696) + (sliding-start-time time-frame :offset 5712) + (unknown-time-frame18 time-frame :offset 5720) + (unknown-sound-id00 sound-id :offset 5776) + (unknown-handle02 handle :offset 5792) + (impact-ctrl impact-control :inline :offset 5824) + (unknown-word06 int32 :offset 5832) + (unknown-vector41 vector :inline :offset 5888) + (last-trans-leaving-surf vector :inline :offset 5904) + (unknown-float38 float :overlay-at (-> last-trans-leaving-surf y)) + (highest-jump-mark vector :inline :offset 5920) + (unknown-float39 float :overlay-at (-> highest-jump-mark y)) + (unknown-time-frame19 time-frame :offset 5936) + (time-of-last-debug-float time-frame :offset 5944) + (danger-mode symbol :offset 5984) + (target-attack-id uint32 :offset 5988) + (attacked-by-id int32 :offset 5992) + (bomb-scale float :offset 5996) + (attack-count uint64 :offset 6000) + (send-attack-dest handle :offset 6008) + (send-attack-time time-frame :offset 6016) + (unknown-combo-tracker00 combo-tracker :inline :offset 6032) + (unknown-time-frame21 time-frame :offset 6072) + (unknown-dword07 int64 :offset 6096) + (unknown-dword08 int64 :offset 6104) + (unknown-dword09 int64 :offset 6112) + (unknown-dword10 int64 :offset 6120) + (jump-kind symbol :offset 6144) + (unknown-quaternion04 quaternion :inline :offset 6160) + (unknown-sound-id01 sound-id :offset 6176) + (unknown-float41 float :offset 6180) + (unknown-float42 float :offset 6184) + (history-idx uint16 :offset 6188) + (history-length uint16 :offset 6190) + (remaining-ctrl-iterations int32 :offset 6192) + (invul1-on-time time-frame :offset 6200) + (invul1-off-time time-frame :offset 6208) + (invul2-on-time time-frame :offset 6216) + (invul2-off-time time-frame :offset 6224) + (unknown-float43 float :offset 6232) + (unknown-float001 float :offset 6236) + (board-jump-and-swim-sound sound-id :offset 6240) + (bubbles-sound sound-id :offset 6244) + (unknown-time-frame26 time-frame :offset 6248) + (unknown-time-frame27 time-frame :offset 6256) + (yellow-eco-last-use-time int64 :offset 6264) + (align-xz-vel vector :inline :offset 6272) + (zx-vel-frac float :offset 6288) + (unknown-sound-id04 sound-id :offset 6292) + (unknown-float45 float :offset 6296) + (default-collide-as-all collide-spec :offset 6300) + (default-collide-as-fgnd collide-spec :offset 6304) + (default-collide-with-all collide-spec :offset 6308) + (default-collide-with-fgnd collide-spec :offset 6312) + (time-of-last-zero-input time-frame :offset 6320) + (time-of-last-nonzero-input time-frame :offset 6328) + (time-between-zero-inputs time-frame :offset 6336) + (time-of-last-debug-heal time-frame :offset 6368) + (last-nonzero-input-dir-targ quaternion :inline :offset 6384) + (time-of-last-wall-hide-first-check-pass time-frame :offset 6400) + (time-of-first-wall-hide-first-check-pass time-frame :offset 6408) + (pad uint8 :offset 6415) ) - :method-count-assert 68 - :size-assert #x1910 - :flag-assert #x4400001910 ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc index 0797a8e8371..9c094c0a636 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type touching-prim (deftype touching-prim (structure) - ((cprim collide-shape-prim :offset-assert 0) - (has-tri? symbol :offset-assert 4) - (tri collide-tri-result :inline :offset-assert 16) + ((cprim collide-shape-prim) + (has-tri? symbol) + (tri collide-tri-result :inline) ) - :method-count-assert 9 - :size-assert #x68 - :flag-assert #x900000068 ) ;; definition for method 3 of type touching-prim -(defmethod inspect touching-prim ((this touching-prim)) +(defmethod inspect ((this touching-prim)) (when (not this) (set! this this) (goto cfg-4) @@ -28,25 +25,22 @@ ;; definition of type touching-prims-entry (deftype touching-prims-entry (structure) - ((next touching-prims-entry :offset-assert 0) - (prev touching-prims-entry :offset-assert 4) - (allocated? symbol :offset-assert 8) - (u float :offset-assert 12) - (prim1 touching-prim :inline :offset-assert 16) - (prim2 touching-prim :inline :offset-assert 128) + ((next touching-prims-entry) + (prev touching-prims-entry) + (allocated? symbol) + (u float) + (prim1 touching-prim :inline) + (prim2 touching-prim :inline) ) - :method-count-assert 12 - :size-assert #xe8 - :flag-assert #xc000000e8 (:methods - (get-middle-of-bsphere-overlap (_type_ vector) vector 9) - (get-touched-prim (_type_ collide-shape touching-shapes-entry) collide-shape-prim 10) - (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result 11) + (get-middle-of-bsphere-overlap (_type_ vector) vector) + (get-touched-prim (_type_ collide-shape touching-shapes-entry) collide-shape-prim) + (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result) ) ) ;; definition for method 3 of type touching-prims-entry -(defmethod inspect touching-prims-entry ((this touching-prims-entry)) +(defmethod inspect ((this touching-prims-entry)) (when (not this) (set! this this) (goto cfg-4) @@ -64,23 +58,20 @@ ;; definition of type touching-prims-entry-pool (deftype touching-prims-entry-pool (structure) - ((head touching-prims-entry :offset-assert 0) - (nodes touching-prims-entry 64 :inline :offset-assert 16) + ((head touching-prims-entry) + (nodes touching-prims-entry 64 :inline) ) - :method-count-assert 13 - :size-assert #x3c10 - :flag-assert #xd00003c10 (:methods - (new (symbol type) _type_ 0) - (alloc-node (_type_) touching-prims-entry 9) - (get-free-node-count (_type_) int 10) - (init-list! (_type_) none 11) - (free-node (_type_ touching-prims-entry) touching-prims-entry 12) + (new (symbol type) _type_) + (alloc-node (_type_) touching-prims-entry) + (get-free-node-count (_type_) int) + (init-list! (_type_) none) + (free-node (_type_ touching-prims-entry) touching-prims-entry) ) ) ;; definition for method 3 of type touching-prims-entry-pool -(defmethod inspect touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod inspect ((this touching-prims-entry-pool)) (when (not this) (set! this this) (goto cfg-4) @@ -94,7 +85,7 @@ ;; definition for method 11 of type touching-prims-entry-pool ;; WARN: Return type mismatch int vs none. -(defmethod init-list! touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod init-list! ((this touching-prims-entry-pool)) (let ((v1-0 (the-as touching-prims-entry #f))) (let ((a1-0 (the-as touching-prims-entry (-> this nodes)))) (set! (-> this head) a1-0) @@ -130,29 +121,26 @@ ;; definition of type touching-shapes-entry (deftype touching-shapes-entry (structure) - ((cshape1 collide-shape :offset-assert 0) - (cshape2 collide-shape :offset-assert 4) - (resolve-u int8 :offset-assert 8) - (head touching-prims-entry :offset-assert 12) - (handle1 handle :offset-assert 16) - (handle2 handle :offset-assert 24) + ((cshape1 collide-shape) + (cshape2 collide-shape) + (resolve-u int8) + (head touching-prims-entry) + (handle1 handle) + (handle2 handle) ) :pack-me - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 (:methods - (get-head (_type_) touching-prims-entry 9) - (get-next (_type_ touching-shapes-entry) touching-prims-entry 10) - (get-touched-shape (_type_ collide-shape) collide-shape 11) - (prims-touching? (_type_ collide-shape uint) touching-prims-entry 12) - (prims-touching-action? (_type_ collide-shape collide-action collide-action) basic 13) - (free-touching-prims-list (_type_) none 14) + (get-head (_type_) touching-prims-entry) + (get-next (_type_ touching-shapes-entry) touching-prims-entry) + (get-touched-shape (_type_ collide-shape) collide-shape) + (prims-touching? (_type_ collide-shape uint) touching-prims-entry) + (prims-touching-action? (_type_ collide-shape collide-action collide-action) basic) + (free-touching-prims-list (_type_) none) ) ) ;; definition for method 3 of type touching-shapes-entry -(defmethod inspect touching-shapes-entry ((this touching-shapes-entry)) +(defmethod inspect ((this touching-shapes-entry)) (when (not this) (set! this this) (goto cfg-4) @@ -170,25 +158,22 @@ ;; definition of type touching-list (deftype touching-list (structure) - ((num-touching-shapes int32 :offset-assert 0) - (resolve-u int8 :offset-assert 4) - (touching-shapes touching-shapes-entry 32 :inline :offset-assert 8) + ((num-touching-shapes int32) + (resolve-u int8) + (touching-shapes touching-shapes-entry 32 :inline) ) - :method-count-assert 14 - :size-assert #x408 - :flag-assert #xe00000408 (:methods - (new (symbol type) _type_ 0) - (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none 9) - (free-nodes (_type_) none 10) - (update-from-step-size (_type_ float) none 11) - (send-events-for-touching-shapes (_type_) none 12) - (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry 13) + (new (symbol type) _type_) + (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none) + (free-nodes (_type_) none) + (update-from-step-size (_type_ float) none) + (send-events-for-touching-shapes (_type_) none) + (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry) ) ) ;; definition for method 3 of type touching-list -(defmethod inspect touching-list ((this touching-list)) +(defmethod inspect ((this touching-list)) (when (not this) (set! this this) (goto cfg-4) @@ -217,13 +202,13 @@ ) ;; definition for method 9 of type touching-shapes-entry -(defmethod get-head touching-shapes-entry ((this touching-shapes-entry)) +(defmethod get-head ((this touching-shapes-entry)) (-> this head) ) ;; definition for method 10 of type touching-shapes-entry ;; WARN: Return type mismatch collide-shape vs touching-prims-entry. -(defmethod get-next touching-shapes-entry ((this touching-shapes-entry) (arg0 touching-shapes-entry)) +(defmethod get-next ((this touching-shapes-entry) (arg0 touching-shapes-entry)) (the-as touching-prims-entry (-> arg0 cshape1)) ) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc index a32ee8523a2..ad9491688ea 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 10 of type touching-prims-entry-pool -(defmethod get-free-node-count touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod get-free-node-count ((this touching-prims-entry-pool)) (let ((v0-0 0)) (let ((v1-0 (-> this head))) (while v1-0 @@ -18,7 +18,7 @@ ) ;; definition for method 9 of type touching-prims-entry-pool -(defmethod alloc-node touching-prims-entry-pool ((this touching-prims-entry-pool)) +(defmethod alloc-node ((this touching-prims-entry-pool)) (let ((gp-0 (-> this head))) (cond (gp-0 @@ -41,7 +41,7 @@ ) ;; definition for method 12 of type touching-prims-entry-pool -(defmethod free-node touching-prims-entry-pool ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) +(defmethod free-node ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) (when (-> arg0 allocated?) (set! (-> arg0 allocated?) #f) (let ((v1-1 (-> this head))) @@ -58,7 +58,7 @@ ;; definition for method 14 of type touching-shapes-entry ;; WARN: Return type mismatch int vs none. -(defmethod free-touching-prims-list touching-shapes-entry ((this touching-shapes-entry)) +(defmethod free-touching-prims-list ((this touching-shapes-entry)) (when (-> this cshape1) (set! (-> this cshape1) #f) (let ((gp-0 (-> this head))) @@ -81,7 +81,7 @@ ;; definition for method 10 of type touching-list ;; WARN: Return type mismatch int vs none. -(defmethod free-nodes touching-list ((this touching-list)) +(defmethod free-nodes ((this touching-list)) (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) (countdown (s4-0 (-> this num-touching-shapes)) (free-touching-prims-list s5-0) @@ -96,7 +96,7 @@ ;; definition for method 13 of type touching-list ;; WARN: Return type mismatch object vs touching-shapes-entry. -(defmethod get-shapes-entry touching-list ((this touching-list) (shape1 collide-shape) (shape2 collide-shape)) +(defmethod get-shapes-entry ((this touching-list) (shape1 collide-shape) (shape2 collide-shape)) (let ((entry (the-as touching-shapes-entry (-> this touching-shapes)))) (let ((v1-0 (the-as touching-shapes-entry #f))) (countdown (a3-0 (-> this num-touching-shapes)) @@ -143,16 +143,13 @@ ;; definition of type add-prims-touching-work (deftype add-prims-touching-work (structure) - ((tri1 collide-tri-result :offset-assert 0) - (tri2 collide-tri-result :offset-assert 4) + ((tri1 collide-tri-result) + (tri2 collide-tri-result) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type add-prims-touching-work -(defmethod inspect add-prims-touching-work ((this add-prims-touching-work)) +(defmethod inspect ((this add-prims-touching-work)) (when (not this) (set! this this) (goto cfg-4) @@ -167,13 +164,13 @@ ;; definition for method 9 of type touching-list ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 9 touching-list) has a return type of none, but the expression builder found a return statement. -(defmethod add-touching-prims touching-list ((this touching-list) - (arg0 collide-shape-prim) - (arg1 collide-shape-prim) - (arg2 float) - (arg3 collide-tri-result) - (arg4 collide-tri-result) - ) +(defmethod add-touching-prims ((this touching-list) + (arg0 collide-shape-prim) + (arg1 collide-shape-prim) + (arg2 float) + (arg3 collide-tri-result) + (arg4 collide-tri-result) + ) (let ((gp-0 (new 'stack-no-clear 'add-prims-touching-work))) (set! (-> gp-0 tri1) arg3) (set! (-> gp-0 tri2) arg4) @@ -276,7 +273,7 @@ ;; definition for method 11 of type touching-list ;; WARN: Return type mismatch int vs none. -(defmethod update-from-step-size touching-list ((this touching-list) (arg0 float)) +(defmethod update-from-step-size ((this touching-list) (arg0 float)) (when (nonzero? (-> this resolve-u)) (set! (-> this resolve-u) 0) (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) @@ -337,7 +334,7 @@ ;; definition for method 12 of type touching-list ;; WARN: Return type mismatch int vs none. -(defmethod send-events-for-touching-shapes touching-list ((this touching-list)) +(defmethod send-events-for-touching-shapes ((this touching-list)) (let ((gp-0 (the-as touching-shapes-entry (-> this touching-shapes)))) (countdown (s5-0 (-> this num-touching-shapes)) (let ((s3-0 (-> gp-0 cshape1))) @@ -390,7 +387,7 @@ ) ;; definition for method 12 of type touching-shapes-entry -(defmethod prims-touching? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape) (arg1 uint)) +(defmethod prims-touching? ((this touching-shapes-entry) (arg0 collide-shape) (arg1 uint)) (cond ((= (-> this cshape1) arg0) (let ((v1-1 (-> this head))) @@ -421,7 +418,7 @@ ;; definition for method 13 of type touching-shapes-entry ;; WARN: Return type mismatch touching-prims-entry vs basic. -(defmethod prims-touching-action? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) +(defmethod prims-touching-action? ((this touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) (cond ((= (-> this cshape1) arg0) (let ((v1-1 (-> this head))) @@ -455,7 +452,7 @@ ) ;; definition for method 11 of type touching-shapes-entry -(defmethod get-touched-shape touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape)) +(defmethod get-touched-shape ((this touching-shapes-entry) (arg0 collide-shape)) (cond ((= (-> this cshape1) arg0) (return (-> this cshape2)) @@ -468,7 +465,7 @@ ) ;; definition for method 10 of type touching-prims-entry -(defmethod get-touched-prim touching-prims-entry ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) +(defmethod get-touched-prim ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) (cond ((= (-> arg1 cshape1) arg0) (return (-> this prim1 cprim)) @@ -481,7 +478,7 @@ ) ;; definition for method 11 of type touching-prims-entry -(defmethod get-touched-tri touching-prims-entry ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) +(defmethod get-touched-tri ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) (let ((v0-0 (the-as collide-tri-result #f))) (cond ((not this) @@ -506,7 +503,7 @@ ) ;; definition for method 9 of type touching-prims-entry -(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((this touching-prims-entry) (arg0 vector)) +(defmethod get-middle-of-bsphere-overlap ((this touching-prims-entry) (arg0 vector)) (let* ((s4-0 (-> this prim1 cprim)) (v1-0 (-> this prim2 cprim)) (gp-1 (vector-! diff --git a/test/decompiler/reference/jak2/engine/collide/find-nearest_REF.gc b/test/decompiler/reference/jak2/engine/collide/find-nearest_REF.gc index 825b9f2d977..9d55ef7f630 100644 --- a/test/decompiler/reference/jak2/engine/collide/find-nearest_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/find-nearest_REF.gc @@ -3,26 +3,23 @@ ;; definition of type search-info (deftype search-info (structure) - ((point vector :inline :offset-assert 0) - (best-point vector :inline :offset-assert 16) - (match-handle handle :offset-assert 32) - (match basic :offset-assert 40) - (best float :offset-assert 44) - (radius float :offset-assert 48) - (rating search-info-flag :offset-assert 52) - (require search-info-flag :offset-assert 56) - (mask search-info-flag :offset-assert 60) - (rot-base vector :inline :offset-assert 64) - (ack-point vector :inline :offset-assert 80) - (rot-range float :offset-assert 96) + ((point vector :inline) + (best-point vector :inline) + (match-handle handle) + (match basic) + (best float) + (radius float) + (rating search-info-flag) + (require search-info-flag) + (mask search-info-flag) + (rot-base vector :inline) + (ack-point vector :inline) + (rot-range float) ) - :method-count-assert 9 - :size-assert #x64 - :flag-assert #x900000064 ) ;; definition for method 3 of type search-info -(defmethod inspect search-info ((this search-info)) +(defmethod inspect ((this search-info)) (when (not this) (set! this this) (goto cfg-88) diff --git a/test/decompiler/reference/jak2/engine/collide/los-control-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/los-control-h_REF.gc index 8cca7938403..6db82373ab1 100644 --- a/test/decompiler/reference/jak2/engine/collide/los-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/los-control-h_REF.gc @@ -3,29 +3,26 @@ ;; definition of type los-control (deftype los-control (structure) - ((src-proc handle :offset-assert 0) - (dst-proc handle :offset-assert 8) - (have-los time-frame :offset-assert 16) - (have-no-los time-frame :offset-assert 24) - (check-interval time-frame :offset-assert 32) - (last-check-time time-frame :offset-assert 40) - (last-collide-result collide-tri-result :inline :offset-assert 48) - (collide-with collide-spec :offset 144) + ((src-proc handle) + (dst-proc handle) + (have-los time-frame) + (have-no-los time-frame) + (check-interval time-frame) + (last-check-time time-frame) + (last-collide-result collide-tri-result :inline) + (collide-with collide-spec :offset 144) ) - :method-count-assert 14 - :size-assert #x94 - :flag-assert #xe00000094 (:methods - (los-control-method-9 (_type_ process-focusable vector float) none :behavior process 9) - (check-los? (_type_ time-frame) symbol :behavior process 10) - (skip-check-los? (_type_ int) symbol :behavior process 11) - (set-dst-proc! (_type_ handle) none 12) - (new-source! (_type_ process time-frame collide-spec) none 13) + (los-control-method-9 (_type_ process-focusable vector float) none :behavior process) + (check-los? (_type_ time-frame) symbol :behavior process) + (skip-check-los? (_type_ int) symbol :behavior process) + (set-dst-proc! (_type_ handle) none) + (new-source! (_type_ process time-frame collide-spec) none) ) ) ;; definition for method 3 of type los-control -(defmethod inspect los-control ((this los-control)) +(defmethod inspect ((this los-control)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/collide/los-control_REF.gc b/test/decompiler/reference/jak2/engine/collide/los-control_REF.gc index 01c4360e9b5..ac744b32e5f 100644 --- a/test/decompiler/reference/jak2/engine/collide/los-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/los-control_REF.gc @@ -7,7 +7,7 @@ ;; definition for method 9 of type los-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch time-frame vs none. -(defmethod los-control-method-9 los-control ((this los-control) (process process-focusable) (trans-vec vector) (radius float)) +(defmethod los-control-method-9 ((this los-control) (process process-focusable) (trans-vec vector) (radius float)) (when (and (time-elapsed? (-> this last-check-time) (-> this check-interval)) (-> this src-proc) (or process (-> this dst-proc)) @@ -65,14 +65,14 @@ ) ;; definition for method 10 of type los-control -(defmethod check-los? los-control ((this los-control) (arg0 time-frame)) +(defmethod check-los? ((this los-control) (arg0 time-frame)) (and (time-elapsed? (-> this have-los) (+ (-> this check-interval) arg0)) (not (time-elapsed? (-> this have-no-los) (-> this check-interval))) ) ) ;; definition for method 11 of type los-control -(defmethod skip-check-los? los-control ((this los-control) (arg0 int)) +(defmethod skip-check-los? ((this los-control) (arg0 int)) (and (time-elapsed? (-> this have-no-los) (+ (-> this check-interval) arg0)) (not (time-elapsed? (-> this have-los) (-> this check-interval))) ) @@ -80,7 +80,7 @@ ;; definition for method 12 of type los-control ;; WARN: Return type mismatch int vs none. -(defmethod set-dst-proc! los-control ((this los-control) (dst handle)) +(defmethod set-dst-proc! ((this los-control) (dst handle)) (set! (-> this dst-proc) dst) 0 (none) @@ -88,7 +88,7 @@ ;; definition for method 13 of type los-control ;; WARN: Return type mismatch int vs none. -(defmethod new-source! los-control ((this los-control) (proc process) (check-interval time-frame) (c-spec collide-spec)) +(defmethod new-source! ((this los-control) (proc process) (check-interval time-frame) (c-spec collide-spec)) (set! (-> this src-proc) (process->handle proc)) (set! (-> this dst-proc) (the-as handle #f)) (set! (-> this have-los) 0) diff --git a/test/decompiler/reference/jak2/engine/collide/pat-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/pat-h_REF.gc index ecb31174b4d..e4ebefd12c2 100644 --- a/test/decompiler/reference/jak2/engine/collide/pat-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/pat-h_REF.gc @@ -23,13 +23,10 @@ (noprobe uint8 :offset 28 :size 1) (nolineofsight uint8 :offset 16 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type pat-surface -(defmethod inspect pat-surface ((this pat-surface)) +(defmethod inspect ((this pat-surface)) (when (not this) (set! this this) (goto cfg-4) @@ -232,18 +229,15 @@ ;; definition of type pat-mode-info (deftype pat-mode-info (structure) - ((name string :offset-assert 0) - (wall-angle float :offset-assert 4) - (color rgba :offset-assert 8) - (hilite-color rgba :offset-assert 12) + ((name string) + (wall-angle float) + (color rgba) + (hilite-color rgba) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type pat-mode-info -(defmethod inspect pat-mode-info ((this pat-mode-info)) +(defmethod inspect ((this pat-mode-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc index 3e73d87cb91..91d083fab31 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc @@ -3,30 +3,26 @@ ;; definition of type base-plat (deftype base-plat (process-focusable) - ((root collide-shape-moving :override) - (smush smush-control :inline :offset-assert 208) - (basetrans vector :inline :offset-assert 240) - (bounce-time time-frame :offset-assert 256) - (bouncing symbol :offset-assert 264) - (bounce-scale meters :offset-assert 268) + ((root collide-shape-moving :override) + (smush smush-control :inline) + (basetrans vector :inline) + (bounce-time time-frame) + (bouncing symbol) + (bounce-scale meters) ) - :heap-base #x90 - :method-count-assert 34 - :size-assert #x110 - :flag-assert #x2200900110 (:methods - (execute-effects (_type_) none 27) - (stop-bouncing! (_type_) none 28) - (start-bouncing! (_type_) none :behavior base-plat 29) - (get-art-group (_type_) art-group 30) - (init-plat-collision! (_type_) none 31) - (base-plat-method-32 (_type_) none 32) - (init-plat! (_type_) none 33) + (execute-effects (_type_) none) + (stop-bouncing! (_type_) none) + (start-bouncing! (_type_) none :behavior base-plat) + (get-art-group (_type_) art-group) + (init-plat-collision! (_type_) none) + (base-plat-method-32 (_type_) none) + (init-plat! (_type_) none) ) ) ;; definition for method 3 of type base-plat -(defmethod inspect base-plat ((this base-plat)) +(defmethod inspect ((this base-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -45,7 +41,7 @@ ;; definition for method 33 of type base-plat ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! base-plat ((this base-plat)) +(defmethod init-plat! ((this base-plat)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." 0 @@ -55,7 +51,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 28 of type base-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod stop-bouncing! base-plat ((this base-plat)) +(defmethod stop-bouncing! ((this base-plat)) "Sets `bouncing` to false and resets related settings to their defaults" (set! (-> this basetrans quad) (-> this root trans quad)) (set! (-> this bouncing) #f) @@ -66,7 +62,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 29 of type base-plat ;; WARN: Return type mismatch int vs none. -(defmethod start-bouncing! base-plat ((this base-plat)) +(defmethod start-bouncing! ((this base-plat)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" @@ -140,7 +136,7 @@ If we aren't bouncing however, TODO - CSHAPE" ;; definition for method 32 of type base-plat ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 base-plat ((this base-plat)) +(defmethod base-plat-method-32 ((this base-plat)) 0 (none) ) @@ -148,7 +144,7 @@ If we aren't bouncing however, TODO - CSHAPE" ;; definition for method 27 of type base-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod execute-effects base-plat ((this base-plat)) +(defmethod execute-effects ((this base-plat)) "Executes various ancillary tasks with the platform, such as spawning particles or playing the associated sound" (if (nonzero? (-> this part)) (spawn (-> this part) (-> this root trans)) @@ -175,37 +171,35 @@ If we aren't bouncing however, TODO - CSHAPE" ;; definition of type eco-door (deftype eco-door (process-drawable) "@unused - Likely a left-over from Jak 1" - ((root collide-shape :override) - (speed float :offset-assert 200) - (open-distance float :offset-assert 204) - (close-distance float :offset-assert 208) - (out-dir vector :inline :offset-assert 224) - (open-sound sound-name :offset-assert 240) - (close-sound sound-name :offset-assert 256) - (state-actor entity-actor :offset-assert 272) - (flags eco-door-flags :offset-assert 276) - (locked symbol :offset-assert 280) - (auto-close symbol :offset-assert 284) - (one-way symbol :offset-assert 288) + ((root collide-shape :override) + (speed float) + (open-distance float) + (close-distance float) + (out-dir vector :inline) + (open-sound sound-name) + (close-sound sound-name) + (state-actor entity-actor) + (flags eco-door-flags) + (locked symbol) + (auto-close symbol) + (one-way symbol) ) - :heap-base #xb0 - :method-count-assert 27 - :size-assert #x124 - :flag-assert #x1b00b00124 + (:state-methods + door-closed + door-opening + door-open + door-closing + ) (:methods - (door-closed () _type_ :state 20) - (door-opening () _type_ :state 21) - (door-open () _type_ :state 22) - (door-closing () _type_ :state 23) - (lock-according-to-task! (_type_) none 24) - (eco-door-method-25 (_type_) none 25) - (stub (_type_) none 26) + (lock-according-to-task! (_type_) none) + (eco-door-method-25 (_type_) none) + (stub (_type_) none) ) ) ;; definition for method 3 of type eco-door ;; INFO: Used lq/sq -(defmethod inspect eco-door ((this eco-door)) +(defmethod inspect ((this eco-door)) (when (not this) (set! this this) (goto cfg-4) @@ -384,7 +378,7 @@ eco-door-event-handler ;; definition for method 24 of type eco-door ;; WARN: Return type mismatch int vs none. -(defmethod lock-according-to-task! eco-door ((this eco-door)) +(defmethod lock-according-to-task! ((this eco-door)) "If the associated subtask is completed, lock the door if [[eco-door-flags:0]] is set otherwise, lock it if [[eco-door-flags:0]] is set" (when (-> this state-actor) @@ -399,7 +393,7 @@ otherwise, lock it if [[eco-door-flags:0]] is set" ;; definition for method 25 of type eco-door ;; WARN: Return type mismatch int vs none. -(defmethod eco-door-method-25 eco-door ((this eco-door)) +(defmethod eco-door-method-25 ((this eco-door)) (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) (set! (-> collision-mesh prim-core collide-as) (collide-spec obstacle)) @@ -423,7 +417,7 @@ otherwise, lock it if [[eco-door-flags:0]] is set" ;; definition for method 26 of type eco-door ;; WARN: Return type mismatch int vs none. -(defmethod stub eco-door ((this eco-door)) +(defmethod stub ((this eco-door)) "@unused - Stub with no overrides" 0 (none) @@ -431,7 +425,7 @@ otherwise, lock it if [[eco-door-flags:0]] is set" ;; definition for method 11 of type eco-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! eco-door ((this eco-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc index 6a35df6fe3b..42b48bd867a 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc @@ -3,42 +3,40 @@ ;; definition of type basebutton (deftype basebutton (process-focusable) - ((button-status button-status :offset-assert 204) - (notify-actor entity :offset-assert 208) - (actor-group (pointer actor-group) :offset-assert 212) - (actor-group-count int32 :offset-assert 216) - (timeout float :offset-assert 220) - (button-id int32 :offset-assert 224) - (event-going-down symbol :offset-assert 228) - (event-down symbol :offset-assert 232) - (event-going-up symbol :offset-assert 236) - (event-up symbol :offset-assert 240) - (anim-speed float :offset-assert 244) - (move-to-pos vector :inline :offset-assert 256) - (move-to-quat quaternion :inline :offset-assert 272) + ((button-status button-status) + (notify-actor entity) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (timeout float) + (button-id int32) + (event-going-down symbol) + (event-down symbol) + (event-going-up symbol) + (event-up symbol) + (anim-speed float) + (move-to-pos vector :inline) + (move-to-quat quaternion :inline) ) - :heap-base #xa0 - :method-count-assert 39 - :size-assert #x120 - :flag-assert #x2700a00120 + (:state-methods + down-idle + going-down + going-up + up-idle + ) (:methods - (down-idle () _type_ :state 27) - (going-down () _type_ :state 28) - (going-up () _type_ :state 29) - (up-idle () _type_ :state 30) - (reset! (_type_) none 31) - (idle-state-transition (_type_) object 32) - (basebutton-method-33 (_type_) none 33) - (basebutton-method-34 (_type_) none 34) - (prepare-trigger-event! (_type_) none 35) - (send-event! (_type_ symbol) none :behavior basebutton 36) - (move-to! (_type_ vector quaternion) none 37) - (press! (_type_ symbol) entity-perm-status 38) + (reset! (_type_) none) + (idle-state-transition (_type_) object) + (basebutton-method-33 (_type_) none) + (basebutton-method-34 (_type_) none) + (prepare-trigger-event! (_type_) none) + (send-event! (_type_ symbol) none :behavior basebutton) + (move-to! (_type_ vector quaternion) none) + (press! (_type_ symbol) entity-perm-status) ) ) ;; definition for method 3 of type basebutton -(defmethod inspect basebutton ((this basebutton)) +(defmethod inspect ((this basebutton)) (when (not this) (set! this this) (goto cfg-7) @@ -75,7 +73,7 @@ ;; definition for method 37 of type basebutton ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-to! basebutton ((this basebutton) (vec vector) (quat quaternion)) +(defmethod move-to! ((this basebutton) (vec vector) (quat quaternion)) (logclear! (-> this button-status) (button-status button-status-2)) (if vec (set! (-> this move-to-pos quad) (-> vec quad)) @@ -90,7 +88,7 @@ ) ;; definition for method 32 of type basebutton -(defmethod idle-state-transition basebutton ((this basebutton)) +(defmethod idle-state-transition ((this basebutton)) "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" (if (logtest? (-> this button-status) (button-status pressed)) (go (method-of-object this down-idle)) @@ -276,7 +274,7 @@ ) ;; definition for method 38 of type basebutton -(defmethod press! basebutton ((this basebutton) (pressed? symbol)) +(defmethod press! ((this basebutton) (pressed? symbol)) (if pressed? (logior! (-> this button-status) (button-status pressed)) (logclear! (-> this button-status) (button-status pressed)) @@ -291,7 +289,7 @@ ;; definition for method 36 of type basebutton ;; WARN: Return type mismatch int vs none. -(defmethod send-event! basebutton ((this basebutton) (event-type symbol)) +(defmethod send-event! ((this basebutton) (event-type symbol)) "Prepares an [[event-message-block]] using the provided type to send an event to: - the `notify-actor` - every [[entity-actor]] in the `actor-group` array @@ -337,7 +335,7 @@ ;; definition for method 31 of type basebutton ;; WARN: Return type mismatch int vs none. -(defmethod reset! basebutton ((this basebutton)) +(defmethod reset! ((this basebutton)) (set! (-> this button-status) (button-status)) (set! (-> this notify-actor) #f) (set! (-> this timeout) 0.0) @@ -352,7 +350,7 @@ ;; definition for method 35 of type basebutton ;; WARN: Return type mismatch int vs none. -(defmethod prepare-trigger-event! basebutton ((this basebutton)) +(defmethod prepare-trigger-event! ((this basebutton)) "Sets `event-going-down` to `'trigger`" (set! (-> this event-going-down) 'trigger) 0 @@ -361,7 +359,7 @@ ;; definition for method 33 of type basebutton ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 basebutton ((this basebutton)) +(defmethod basebutton-method-33 ((this basebutton)) "TODO - joint stuff" (initialize-skeleton this @@ -400,7 +398,7 @@ ;; definition for method 34 of type basebutton ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-34 basebutton ((this basebutton)) +(defmethod basebutton-method-34 ((this basebutton)) "TODO - collision stuff" (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) @@ -427,7 +425,7 @@ ;; definition for method 11 of type basebutton ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! basebutton ((this basebutton) (arg0 entity-actor)) +(defmethod init-from-entity! ((this basebutton) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc index 7cf10c18912..e578f3bf246 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc @@ -3,20 +3,18 @@ ;; definition of type blocking-plane (deftype blocking-plane (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (init! (_type_ (inline-array vector) float) none 21) + (init! (_type_ (inline-array vector) float) none) ) ) ;; definition for method 3 of type blocking-plane -(defmethod inspect blocking-plane ((this blocking-plane)) +(defmethod inspect ((this blocking-plane)) (when (not this) (set! this this) (goto cfg-4) @@ -98,7 +96,7 @@ ;; definition for method 21 of type blocking-plane ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init! blocking-plane ((this blocking-plane) (vec-pair (inline-array vector)) (height float)) +(defmethod init! ((this blocking-plane) (vec-pair (inline-array vector)) (height float)) "TODO - but sets up the plane given 2 vectors and a height" (let ((s3-0 (-> vec-pair 0)) (s4-0 (-> vec-pair 1)) @@ -175,7 +173,7 @@ ;; definition for method 11 of type blocking-plane ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! blocking-plane ((this blocking-plane) (arg0 entity-actor)) +(defmethod init-from-entity! ((this blocking-plane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc index e19530fd491..1ad6c4eee42 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc @@ -43,56 +43,54 @@ ;; definition of type collectable (deftype collectable (process-drawable) - ((root collide-shape-moving :override) - (pickup-type pickup-type :offset-assert 200) - (pickup-amount float :offset-assert 204) - (notify handle :offset-assert 208) - (old-base vector :inline :offset-assert 224) - (base vector :inline :offset-assert 240) - (extra-trans vector :inline :offset-assert 256) - (jump-pos vector :inline :offset-assert 272) - (flags collectable-flag :offset-assert 288) - (birth-time seconds :offset-assert 296) - (collect-timeout seconds :offset-assert 304) - (fadeout-timeout seconds :offset-assert 312) - (bob-offset seconds :offset-assert 320) - (bob-amount float :offset-assert 328) - (pickup-handle handle :offset-assert 336) - (actor-pause symbol :offset-assert 344) - (collect-effect basic :offset-assert 348) - (collect-effect2 basic :offset-assert 352) - (target handle :offset-assert 360) - (suck-time seconds :offset-assert 368) - (suck-y-offset float :offset-assert 376) - (speed vector :inline :offset-assert 384) - (movie-pos-index int32 :offset-assert 400) + ((root collide-shape-moving :override) + (pickup-type pickup-type) + (pickup-amount float) + (notify handle) + (old-base vector :inline) + (base vector :inline) + (extra-trans vector :inline) + (jump-pos vector :inline) + (flags collectable-flag) + (birth-time seconds) + (collect-timeout seconds) + (fadeout-timeout seconds) + (bob-offset seconds) + (bob-amount float) + (pickup-handle handle) + (actor-pause symbol) + (collect-effect basic) + (collect-effect2 basic) + (target handle) + (suck-time seconds) + (suck-y-offset float) + (speed vector :inline) + (movie-pos-index int32) ) - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 + (:state-methods + blocked + wait + deploy + (suck handle) + jump + fade + (pickup symbol handle) + die + (notice-blue handle) + ) (:methods - (blocked () _type_ :state 20) - (wait () _type_ :state 21) - (deploy () _type_ :state 22) - (suck (handle) _type_ :state 23) - (jump () _type_ :state 24) - (fade () _type_ :state 25) - (pickup (symbol handle) _type_ :state 26) - (die () _type_ :state 27) - (notice-blue (handle) _type_ :state 28) - (init-common (_type_ entity-actor pickup-type float) none 29) - (initialize-effects (_type_ pickup-type) none 30) - (go-to-initial-state (_type_) none 31) - (initialize-options (_type_ int float fact-info) collectable 32) - (initialize-allocations (_type_) none 33) - (common-post (_type_) none 34) - (do-pickup (_type_ handle) none 35) + (init-common (_type_ entity-actor pickup-type float) none) + (initialize-effects (_type_ pickup-type) none) + (go-to-initial-state (_type_) none) + (initialize-options (_type_ int float fact-info) collectable) + (initialize-allocations (_type_) none) + (common-post (_type_) none) + (do-pickup (_type_ handle) none) ) ) ;; definition for method 3 of type collectable -(defmethod inspect collectable ((this collectable)) +(defmethod inspect ((this collectable)) (when (not this) (set! this this) (goto cfg-20) @@ -155,7 +153,7 @@ ;; definition for method 31 of type collectable ;; WARN: Return type mismatch object vs none. -(defmethod go-to-initial-state collectable ((this collectable)) +(defmethod go-to-initial-state ((this collectable)) (cond ((logtest? (-> this fact options) (actor-option wait-for-task-complete)) (go (method-of-object this blocked)) @@ -172,7 +170,7 @@ ;; definition for method 32 of type collectable ;; INFO: Used lq/sq -(defmethod initialize-options collectable ((this collectable) (arg0 int) (arg1 float) (arg2 fact-info)) +(defmethod initialize-options ((this collectable) (arg0 int) (arg1 float) (arg2 fact-info)) (logclear! (-> this mask) (process-mask crate enemy platform ambient)) (logior! (-> this mask) (process-mask bit18)) (set! (-> this flags) (collectable-flag pickup no-eco-blue)) @@ -242,7 +240,7 @@ ;; definition for method 33 of type collectable ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations collectable ((this collectable)) +(defmethod initialize-allocations ((this collectable)) (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #t) @@ -274,7 +272,7 @@ ;; definition for method 30 of type collectable ;; WARN: Return type mismatch ambient-sound vs none. -(defmethod initialize-effects collectable ((this collectable) (arg0 pickup-type)) +(defmethod initialize-effects ((this collectable) (arg0 pickup-type)) (let ((s5-0 (the-as sparticle-launch-group #f)) (s4-0 (the-as sound-spec #f)) ) @@ -398,7 +396,7 @@ ;; definition for method 29 of type collectable ;; INFO: Used lq/sq -(defmethod init-common collectable ((this collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) +(defmethod init-common ((this collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) (set! (-> this pickup-amount) arg2) (set! (-> this pickup-type) arg1) (initialize-allocations this) @@ -415,7 +413,7 @@ ;; definition for method 34 of type collectable ;; WARN: Return type mismatch int vs none. -(defmethod common-post collectable ((this collectable)) +(defmethod common-post ((this collectable)) (let ((s5-0 (-> this part)) (s4-0 (-> this root root-prim prim-core)) ) @@ -436,7 +434,7 @@ ;; definition for method 35 of type collectable ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-pickup collectable ((this collectable) (arg0 handle)) +(defmethod do-pickup ((this collectable) (arg0 handle)) (set! (-> this pickup-handle) arg0) (logclear! (-> this mask) (process-mask actor-pause)) (let ((v1-3 (-> this root root-prim))) @@ -1222,16 +1220,12 @@ ;; definition of type eco (deftype eco (collectable) - ((respan-delay seconds :offset-assert 408) + ((respan-delay seconds) ) - :heap-base #x120 - :method-count-assert 36 - :size-assert #x1a0 - :flag-assert #x24012001a0 ) ;; definition for method 3 of type eco -(defmethod inspect eco ((this eco)) +(defmethod inspect ((this eco)) (when (not this) (set! this this) (goto cfg-4) @@ -1246,7 +1240,7 @@ ;; definition for method 33 of type eco ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations eco ((this eco)) +(defmethod initialize-allocations ((this eco)) (let ((t9-0 (method-of-type collectable initialize-allocations))) (t9-0 this) ) @@ -1333,14 +1327,10 @@ ;; definition of type eco-yellow (deftype eco-yellow (eco) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x1a0 - :flag-assert #x24012001a0 ) ;; definition for method 3 of type eco-yellow -(defmethod inspect eco-yellow ((this eco-yellow)) +(defmethod inspect ((this eco-yellow)) (when (not this) (set! this this) (goto cfg-4) @@ -1353,7 +1343,7 @@ ) ;; definition for method 11 of type eco-yellow -(defmethod init-from-entity! eco-yellow ((this eco-yellow) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1367,14 +1357,10 @@ This commonly includes things such as: ;; definition of type eco-red (deftype eco-red (eco) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x1a0 - :flag-assert #x24012001a0 ) ;; definition for method 3 of type eco-red -(defmethod inspect eco-red ((this eco-red)) +(defmethod inspect ((this eco-red)) (when (not this) (set! this this) (goto cfg-4) @@ -1387,7 +1373,7 @@ This commonly includes things such as: ) ;; definition for method 11 of type eco-red -(defmethod init-from-entity! eco-red ((this eco-red) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-red) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1401,14 +1387,10 @@ This commonly includes things such as: ;; definition of type eco-blue (deftype eco-blue (eco) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x1a0 - :flag-assert #x24012001a0 ) ;; definition for method 3 of type eco-blue -(defmethod inspect eco-blue ((this eco-blue)) +(defmethod inspect ((this eco-blue)) (when (not this) (set! this this) (goto cfg-4) @@ -1421,7 +1403,7 @@ This commonly includes things such as: ) ;; definition for method 11 of type eco-blue -(defmethod init-from-entity! eco-blue ((this eco-blue) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1435,14 +1417,10 @@ This commonly includes things such as: ;; definition of type eco-green (deftype eco-green (eco) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x1a0 - :flag-assert #x24012001a0 ) ;; definition for method 3 of type eco-green -(defmethod inspect eco-green ((this eco-green)) +(defmethod inspect ((this eco-green)) (when (not this) (set! this this) (goto cfg-4) @@ -1455,7 +1433,7 @@ This commonly includes things such as: ) ;; definition for method 11 of type eco-green -(defmethod init-from-entity! eco-green ((this eco-green) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-green) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1469,14 +1447,10 @@ This commonly includes things such as: ;; definition of type health (deftype health (collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 ) ;; definition for method 3 of type health -(defmethod inspect health ((this health)) +(defmethod inspect ((this health)) (when (not this) (set! this this) (goto cfg-4) @@ -1489,7 +1463,7 @@ This commonly includes things such as: ) ;; definition for method 11 of type health -(defmethod init-from-entity! health ((this health) (arg0 entity-actor)) +(defmethod init-from-entity! ((this health) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1503,14 +1477,10 @@ This commonly includes things such as: ;; definition of type eco-pill (deftype eco-pill (collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 ) ;; definition for method 3 of type eco-pill -(defmethod inspect eco-pill ((this eco-pill)) +(defmethod inspect ((this eco-pill)) (when (not this) (set! this this) (goto cfg-4) @@ -1548,7 +1518,7 @@ This commonly includes things such as: ) ;; definition for method 11 of type eco-pill -(defmethod init-from-entity! eco-pill ((this eco-pill) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco-pill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1560,7 +1530,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type eco-pill -(defmethod deactivate eco-pill ((this eco-pill)) +(defmethod deactivate ((this eco-pill)) (+! (-> *game-info* live-eco-pill-count) -1) ((method-of-type collectable deactivate) this) (none) @@ -1568,7 +1538,7 @@ This commonly includes things such as: ;; definition for method 33 of type eco-pill ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations eco-pill ((this eco-pill)) +(defmethod initialize-allocations ((this eco-pill)) (+! (-> *game-info* live-eco-pill-count) 1) (stack-size-set! (-> this main-thread) 128) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1602,14 +1572,10 @@ This commonly includes things such as: ;; definition of type money (deftype money (collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 ) ;; definition for method 3 of type money -(defmethod inspect money ((this money)) +(defmethod inspect ((this money)) (when (not this) (set! this this) (goto cfg-4) @@ -1622,7 +1588,7 @@ This commonly includes things such as: ) ;; definition for method 12 of type money -(defmethod run-logic? money ((this money)) +(defmethod run-logic? ((this money)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen)) @@ -1637,7 +1603,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type money -(defmethod deactivate money ((this money)) +(defmethod deactivate ((this money)) (when (and (-> this next-state) (= (-> this next-state name) 'pickup)) (case (-> this pickup-type) (((pickup-type gem)) @@ -1658,7 +1624,7 @@ This commonly includes things such as: ) ;; definition for method 34 of type money -(defmethod common-post money ((this money)) +(defmethod common-post ((this money)) (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) (let ((f30-0 (-> this bob-amount))) (when (< 0.0 f30-0) @@ -1726,7 +1692,7 @@ This commonly includes things such as: ;; definition for method 33 of type money ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations money ((this money)) +(defmethod initialize-allocations ((this money)) (stack-size-set! (-> this main-thread) 128) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1778,7 +1744,7 @@ This commonly includes things such as: ) ;; definition for method 11 of type money -(defmethod init-from-entity! money ((this money) (arg0 entity-actor)) +(defmethod init-from-entity! ((this money) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1861,17 +1827,13 @@ This commonly includes things such as: ;; definition of type gem (deftype gem (money) - ((roty-speed degrees :offset-assert 404) - (bounce-time seconds :offset-assert 408) + ((roty-speed degrees) + (bounce-time seconds) ) - :heap-base #x120 - :method-count-assert 36 - :size-assert #x1a0 - :flag-assert #x24012001a0 ) ;; definition for method 3 of type gem -(defmethod inspect gem ((this gem)) +(defmethod inspect ((this gem)) (when (not this) (set! this this) (goto cfg-4) @@ -1886,7 +1848,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type gem -(defmethod deactivate gem ((this gem)) +(defmethod deactivate ((this gem)) (+! (-> *game-info* live-gem-count) -1) (call-parent-method this) (none) @@ -1894,7 +1856,7 @@ This commonly includes things such as: ;; definition for method 34 of type gem ;; WARN: Return type mismatch int vs none. -(defmethod common-post gem ((this gem)) +(defmethod common-post ((this gem)) (seek! (-> this roty-speed) 20024.889 (* 65536.0 (seconds-per-frame))) (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* (-> this roty-speed) (seconds-per-frame))) (logclear! (-> this draw status) (draw-control-status no-draw-temp uninited)) @@ -2042,7 +2004,7 @@ This commonly includes things such as: ;; definition for method 33 of type gem ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations gem ((this gem)) +(defmethod initialize-allocations ((this gem)) (+! (-> *game-info* live-gem-count) 1) (stack-size-set! (-> this main-thread) 128) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) @@ -2111,14 +2073,10 @@ This commonly includes things such as: ;; definition of type skill (deftype skill (money) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 ) ;; definition for method 3 of type skill -(defmethod inspect skill ((this skill)) +(defmethod inspect ((this skill)) (when (not this) (set! this this) (goto cfg-4) @@ -2154,7 +2112,7 @@ This commonly includes things such as: ;; definition for method 33 of type skill ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations skill ((this skill)) +(defmethod initialize-allocations ((this skill)) (stack-size-set! (-> this main-thread) 128) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -2217,13 +2175,10 @@ This commonly includes things such as: ;; definition of type fuel-cell (deftype fuel-cell (process-hidden) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 ) ;; definition for method 3 of type fuel-cell -(defmethod inspect fuel-cell ((this fuel-cell)) +(defmethod inspect ((this fuel-cell)) (when (not this) (set! this this) (goto cfg-68) @@ -2363,14 +2318,10 @@ This commonly includes things such as: ;; definition of type trick-point (deftype trick-point (collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 ) ;; definition for method 3 of type trick-point -(defmethod inspect trick-point ((this trick-point)) +(defmethod inspect ((this trick-point)) (when (not this) (set! this this) (goto cfg-4) @@ -2385,14 +2336,10 @@ This commonly includes things such as: ;; definition of type skate-point (deftype skate-point (trick-point) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x194 - :flag-assert #x2401200194 ) ;; definition for method 3 of type skate-point -(defmethod inspect skate-point ((this skate-point)) +(defmethod inspect ((this skate-point)) (when (not this) (set! this this) (goto cfg-4) @@ -2406,7 +2353,7 @@ This commonly includes things such as: ;; definition for method 33 of type trick-point ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations trick-point ((this trick-point)) +(defmethod initialize-allocations ((this trick-point)) (stack-size-set! (-> this main-thread) 128) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -2440,7 +2387,7 @@ This commonly includes things such as: ) ;; definition for method 11 of type trick-point -(defmethod init-from-entity! trick-point ((this trick-point) (arg0 entity-actor)) +(defmethod init-from-entity! ((this trick-point) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2457,16 +2404,12 @@ This commonly includes things such as: ;; definition of type ammo-collectable (deftype ammo-collectable (collectable) - ((ammo-effect basic :offset-assert 404) + ((ammo-effect basic) ) - :heap-base #x120 - :method-count-assert 36 - :size-assert #x198 - :flag-assert #x2401200198 ) ;; definition for method 3 of type ammo-collectable -(defmethod inspect ammo-collectable ((this ammo-collectable)) +(defmethod inspect ((this ammo-collectable)) (when (not this) (set! this this) (goto cfg-4) @@ -2481,7 +2424,7 @@ This commonly includes things such as: ;; definition for method 33 of type ammo-collectable ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations ammo-collectable ((this ammo-collectable)) +(defmethod initialize-allocations ((this ammo-collectable)) (stack-size-set! (-> this main-thread) 128) (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this actor-pause) #f) @@ -2528,7 +2471,7 @@ This commonly includes things such as: ;; definition for method 30 of type ammo-collectable ;; WARN: Return type mismatch object vs none. -(defmethod initialize-effects ammo-collectable ((this ammo-collectable) (arg0 pickup-type)) +(defmethod initialize-effects ((this ammo-collectable) (arg0 pickup-type)) (set! (-> this fact pickup-type) arg0) (case arg0 (((pickup-type ammo-yellow)) @@ -2646,7 +2589,7 @@ This commonly includes things such as: ;; definition for method 29 of type ammo-collectable ;; INFO: Used lq/sq -(defmethod init-common ammo-collectable ((this ammo-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) +(defmethod init-common ((this ammo-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) (set! (-> this pickup-amount) arg2) (set! (-> this pickup-type) arg1) (initialize-allocations this) @@ -2660,7 +2603,7 @@ This commonly includes things such as: ;; definition for method 34 of type ammo-collectable ;; WARN: Return type mismatch int vs none. -(defmethod common-post ammo-collectable ((this ammo-collectable)) +(defmethod common-post ((this ammo-collectable)) (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) ((method-of-type collectable common-post) this) 0 @@ -2678,14 +2621,10 @@ This commonly includes things such as: ;; definition of type ammo (deftype ammo (ammo-collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x198 - :flag-assert #x2401200198 ) ;; definition for method 3 of type ammo -(defmethod inspect ammo ((this ammo)) +(defmethod inspect ((this ammo)) (when (not this) (set! this this) (goto cfg-4) @@ -2700,14 +2639,10 @@ This commonly includes things such as: ;; definition of type shield (deftype shield (ammo-collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x198 - :flag-assert #x2401200198 ) ;; definition for method 3 of type shield -(defmethod inspect shield ((this shield)) +(defmethod inspect ((this shield)) (when (not this) (set! this this) (goto cfg-4) @@ -2722,14 +2657,10 @@ This commonly includes things such as: ;; definition of type upgrade-collectable (deftype upgrade-collectable (ammo-collectable) () - :heap-base #x120 - :method-count-assert 36 - :size-assert #x198 - :flag-assert #x2401200198 ) ;; definition for method 3 of type upgrade-collectable -(defmethod inspect upgrade-collectable ((this upgrade-collectable)) +(defmethod inspect ((this upgrade-collectable)) (when (not this) (set! this this) (goto cfg-4) @@ -2776,7 +2707,7 @@ This commonly includes things such as: ) ;; definition for method 11 of type eco -(defmethod init-from-entity! eco ((this eco) (arg0 entity-actor)) +(defmethod init-from-entity! ((this eco) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3014,7 +2945,7 @@ This commonly includes things such as: ;; definition for method 9 of type fact-info ;; INFO: Used lq/sq -(defmethod drop-pickup fact-info ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) +(defmethod drop-pickup ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) (let ((s2-0 (-> this pickup-type)) (f30-0 (-> this pickup-amount)) ) @@ -3174,13 +3105,10 @@ This commonly includes things such as: ;; definition of type ecovent (deftype ecovent (process-hidden) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 ) ;; definition for method 3 of type ecovent -(defmethod inspect ecovent ((this ecovent)) +(defmethod inspect ((this ecovent)) (when (not this) (set! this this) (goto cfg-68) diff --git a/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc index b474a02a033..bd60bce3a2f 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc @@ -3,18 +3,15 @@ ;; definition of type conveyor-section (deftype conveyor-section (structure) - ((start vector :inline :offset-assert 0) - (trailing plane :inline :offset-assert 16) - (pull-dir vector :inline :offset-assert 32) - (radial-dir vector :inline :offset-assert 48) + ((start vector :inline) + (trailing plane :inline) + (pull-dir vector :inline) + (radial-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type conveyor-section -(defmethod inspect conveyor-section ((this conveyor-section)) +(defmethod inspect ((this conveyor-section)) (when (not this) (set! this this) (goto cfg-4) @@ -30,15 +27,12 @@ ;; definition of type conveyor-section-array (deftype conveyor-section-array (inline-array-class) - ((data conveyor-section :inline :dynamic :offset-assert 16) + ((data conveyor-section :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type conveyor-section-array -(defmethod inspect conveyor-section-array ((this conveyor-section-array)) +(defmethod inspect ((this conveyor-section-array)) (when (not this) (set! this this) (goto cfg-4) @@ -56,33 +50,31 @@ ;; definition of type conveyor (deftype conveyor (process-drawable) - ((speed float :offset-assert 200) - (belt-radius float :offset-assert 204) - (pull-y-threshold float :offset-assert 208) - (speed-mult-array (array float) :offset-assert 212) - (speed-mult-array-len int8 :offset-assert 216) - (sections conveyor-section-array :offset-assert 220) - (leading plane :inline :offset-assert 224) - (collide-bounds sphere :inline :offset-assert 240) + ((speed float) + (belt-radius float) + (pull-y-threshold float) + (speed-mult-array (array float)) + (speed-mult-array-len int8) + (sections conveyor-section-array) + (leading plane :inline) + (collide-bounds sphere :inline) ) - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (conveyor-method-21 (_type_) float 21) - (get-art-group (_type_) art-group 22) - (reset-root! (_type_) none 23) - (init! (_type_) none 24) - (set-and-get-ambient-sound! (_type_) ambient-sound 25) - (conveyor-method-26 (_type_ process-focusable) symbol :behavior conveyor 26) - (conveyor-method-27 (_type_) symbol 27) + (conveyor-method-21 (_type_) float) + (get-art-group (_type_) art-group) + (reset-root! (_type_) none) + (init! (_type_) none) + (set-and-get-ambient-sound! (_type_) ambient-sound) + (conveyor-method-26 (_type_ process-focusable) symbol :behavior conveyor) + (conveyor-method-27 (_type_) symbol) ) ) ;; definition for method 3 of type conveyor -(defmethod inspect conveyor ((this conveyor)) +(defmethod inspect ((this conveyor)) (when (not this) (set! this this) (goto cfg-4) @@ -103,14 +95,14 @@ ) ;; definition for method 7 of type conveyor -(defmethod relocate conveyor ((this conveyor) (new-addr int)) +(defmethod relocate ((this conveyor) (new-addr int)) (&+! (-> this sections) new-addr) (call-parent-method this new-addr) ) ;; definition for method 22 of type conveyor ;; WARN: Return type mismatch symbol vs art-group. -(defmethod get-art-group conveyor ((this conveyor)) +(defmethod get-art-group ((this conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (go process-drawable-art-error "invalid type") (the-as art-group #f) @@ -118,7 +110,7 @@ ;; definition for method 23 of type conveyor ;; WARN: Return type mismatch int vs none. -(defmethod reset-root! conveyor ((this conveyor)) +(defmethod reset-root! ((this conveyor)) "Re-initializes the `root` [[trsqv]]" (set! (-> this root) (new 'process 'trsqv)) 0 @@ -128,7 +120,7 @@ ;; definition for method 24 of type conveyor ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init! conveyor ((this conveyor)) +(defmethod init! ((this conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (local-vars (tag res-tag)) (set! (-> this speed) 24576.0) @@ -151,7 +143,7 @@ ;; definition for method 25 of type conveyor ;; WARN: Return type mismatch object vs ambient-sound. -(defmethod set-and-get-ambient-sound! conveyor ((this conveyor)) +(defmethod set-and-get-ambient-sound! ((this conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" (let ((actor-options (res-lump-value (-> this entity) 'options actor-option :time -1000000000.0))) @@ -178,7 +170,7 @@ and return it as well. Otherwise, set it to `0`" ;; definition for method 26 of type conveyor ;; INFO: Used lq/sq -(defmethod conveyor-method-26 conveyor ((this conveyor) (proc-focus process-focusable)) +(defmethod conveyor-method-26 ((this conveyor) (proc-focus process-focusable)) "TODO - conveyor section related, perhaps related to moving the process along the belt?" (let ((vec (new 'stack-no-clear 'vector))) (set! (-> vec quad) (-> (get-trans proc-focus 0) quad)) @@ -223,7 +215,7 @@ and return it as well. Otherwise, set it to `0`" ) ;; definition for method 27 of type conveyor -(defmethod conveyor-method-27 conveyor ((this conveyor)) +(defmethod conveyor-method-27 ((this conveyor)) "TODO - collision related, has some dead code as well (previous iteration?)" (local-vars (a0-10 float) (a2-5 float) (a2-12 float)) (rlet ((acc :class vf) @@ -362,7 +354,7 @@ and return it as well. Otherwise, set it to `0`" ;; definition for method 21 of type conveyor ;; INFO: Used lq/sq -(defmethod conveyor-method-21 conveyor ((this conveyor)) +(defmethod conveyor-method-21 ((this conveyor)) "TODO - quite dense, has to do with the conveyor sections and the path they are associated with" (local-vars (sv-32 conveyor-section) (sv-48 conveyor-section)) (let* ((s5-0 (-> this path)) @@ -435,7 +427,7 @@ and return it as well. Otherwise, set it to `0`" ;; definition for method 11 of type conveyor ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! conveyor ((this conveyor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this conveyor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -461,14 +453,10 @@ This commonly includes things such as: ;; definition of type strip-conveyor (deftype strip-conveyor (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) ;; definition for method 3 of type strip-conveyor -(defmethod inspect strip-conveyor ((this strip-conveyor)) +(defmethod inspect ((this strip-conveyor)) (when (not this) (set! this this) (goto cfg-4) @@ -487,7 +475,7 @@ This commonly includes things such as: ) ;; definition for method 22 of type strip-conveyor -(defmethod get-art-group strip-conveyor ((this strip-conveyor)) +(defmethod get-art-group ((this strip-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-strip-conveyor" (the-as (pointer uint32) #f)) ) @@ -495,14 +483,10 @@ This commonly includes things such as: ;; definition of type lgconveyor (deftype lgconveyor (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) ;; definition for method 3 of type lgconveyor -(defmethod inspect lgconveyor ((this lgconveyor)) +(defmethod inspect ((this lgconveyor)) (when (not this) (set! this this) (goto cfg-4) @@ -523,14 +507,14 @@ This commonly includes things such as: ) ;; definition for method 22 of type lgconveyor -(defmethod get-art-group lgconveyor ((this lgconveyor)) +(defmethod get-art-group ((this lgconveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-lgconveyor" (the-as (pointer uint32) #f)) ) ;; definition for method 24 of type lgconveyor ;; WARN: Return type mismatch float vs none. -(defmethod init! lgconveyor ((this lgconveyor)) +(defmethod init! ((this lgconveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (set! (-> this speed) 30720.0) (set! (-> this belt-radius) 11878.4) diff --git a/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc index 2cc4d6bb505..5ceca90b3b5 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc @@ -10,17 +10,14 @@ ;; definition of type crate-bank (deftype crate-bank (basic) - ((COLLIDE_YOFF float :offset-assert 4) - (COLLIDE_RADIUS float :offset-assert 8) - (DARKECO_EXPLODE_RADIUS float :offset-assert 12) + ((COLLIDE_YOFF float) + (COLLIDE_RADIUS float) + (DARKECO_EXPLODE_RADIUS float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type crate-bank -(defmethod inspect crate-bank ((this crate-bank)) +(defmethod inspect ((this crate-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -40,40 +37,38 @@ ;; definition of type crate (deftype crate (process-focusable) - ((root collide-shape-moving :override) - (smush smush-control :inline :offset-assert 208) - (base vector :inline :offset-assert 240) - (look symbol :offset-assert 256) - (defense symbol :offset-assert 260) - (incoming-attack-id uint32 :offset-assert 264) - (target handle :offset-assert 272) - (child-count int32 :offset-assert 280) - (victory-anim spool-anim :offset-assert 284) + ((root collide-shape-moving :override) + (smush smush-control :inline) + (base vector :inline) + (look symbol) + (defense symbol) + (incoming-attack-id uint32) + (target handle) + (child-count int32) + (victory-anim spool-anim) ) - :heap-base #xa0 - :method-count-assert 41 - :size-assert #x120 - :flag-assert #x2900a00120 + (:state-methods + hide + idle + (die symbol int) + special-contents-die + bounce-on + (notice-blue handle) + carry + fall + ) (:methods - (hide () _type_ :state 27) - (idle () _type_ :state 28) - (die (symbol int) _type_ :state 29) - (special-contents-die () _type_ :state 30) - (bounce-on () _type_ :state 31) - (notice-blue (handle) _type_ :state 32) - (carry () _type_ :state 33) - (fall () _type_ :state 34) - (crate-init! (_type_ entity-actor) none 35) - (skel-init! (_type_) none 36) - (params-set! (_type_ symbol symbol) none 37) - (crate-method-38 (_type_) none 38) - (smush-update! (_type_) none 39) - (crate-method-40 (_type_) symbol :behavior crate 40) + (crate-init! (_type_ entity-actor) none) + (skel-init! (_type_) none) + (params-set! (_type_ symbol symbol) none) + (crate-method-38 (_type_) none) + (smush-update! (_type_) none) + (crate-method-40 (_type_) symbol :behavior crate) ) ) ;; definition for method 3 of type crate -(defmethod inspect crate ((this crate)) +(defmethod inspect ((this crate)) (when (not this) (set! this this) (goto cfg-4) @@ -1171,7 +1166,7 @@ ) ;; definition for method 11 of type crate -(defmethod init-from-entity! crate ((this crate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1186,7 +1181,7 @@ This commonly includes things such as: ;; definition for method 35 of type crate ;; WARN: Return type mismatch crate vs none. -(defmethod crate-init! crate ((this crate) (arg0 entity-actor)) +(defmethod crate-init! ((this crate) (arg0 entity-actor)) "Initialize the [[crate]] with the specified [[entity-actor]]." (stack-size-set! (-> this main-thread) 128) (logior! (-> this mask) (process-mask crate)) @@ -1279,7 +1274,7 @@ This commonly includes things such as: ;; definition for method 36 of type crate ;; INFO: Used lq/sq ;; WARN: Return type mismatch crate vs none. -(defmethod skel-init! crate ((this crate)) +(defmethod skel-init! ((this crate)) "Initialize the [[crate]]'s skeleton and other parameters based on the crate type." (case (-> this look) (('iron) @@ -1339,7 +1334,7 @@ This commonly includes things such as: ;; definition for method 37 of type crate ;; WARN: Return type mismatch crate vs none. -(defmethod params-set! crate ((this crate) (arg0 symbol) (arg1 symbol)) +(defmethod params-set! ((this crate) (arg0 symbol) (arg1 symbol)) "Set [[crate]] params based on the arguments." (if arg0 (set! (-> this look) arg0) @@ -1352,7 +1347,7 @@ This commonly includes things such as: ;; definition for method 38 of type crate ;; WARN: Return type mismatch int vs none. -(defmethod crate-method-38 crate ((this crate)) +(defmethod crate-method-38 ((this crate)) (when (-> this entity) (if (>= (-> this entity extra perm user-int8 0) 1) (go (method-of-object this die) #t 0) @@ -1375,7 +1370,7 @@ This commonly includes things such as: ;; definition for method 39 of type crate ;; WARN: Return type mismatch int vs none. -(defmethod smush-update! crate ((this crate)) +(defmethod smush-update! ((this crate)) (let ((f0-0 (update! (-> this smush)))) (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) (set! (-> this root scale y) (+ 1.0 f0-0)) @@ -1387,7 +1382,7 @@ This commonly includes things such as: ;; definition for method 40 of type crate ;; WARN: disable def twice: 57. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod crate-method-40 crate ((this crate)) +(defmethod crate-method-40 ((this crate)) (cond ((and (> (-> (the-as fact-info-crate (-> this fact)) suck-count) 0) (< (you-suck-stage *game-info* #f) (-> (the-as fact-info-crate (-> this fact)) suck-count)) @@ -1420,16 +1415,12 @@ This commonly includes things such as: ;; definition of type pickup-spawner (deftype pickup-spawner (crate) - ((blocker entity-actor :offset-assert 288) + ((blocker entity-actor) ) - :heap-base #xb0 - :method-count-assert 41 - :size-assert #x124 - :flag-assert #x2900b00124 ) ;; definition for method 3 of type pickup-spawner -(defmethod inspect pickup-spawner ((this pickup-spawner)) +(defmethod inspect ((this pickup-spawner)) (when (not this) (set! this this) (goto cfg-4) @@ -1444,7 +1435,7 @@ This commonly includes things such as: ;; definition for method 35 of type pickup-spawner ;; WARN: Return type mismatch pickup-spawner vs none. -(defmethod crate-init! pickup-spawner ((this pickup-spawner) (arg0 entity-actor)) +(defmethod crate-init! ((this pickup-spawner) (arg0 entity-actor)) "Initialize the [[crate]] with the specified [[entity-actor]]." (let ((t9-0 (method-of-type crate crate-init!))) (t9-0 this arg0) @@ -1459,7 +1450,7 @@ This commonly includes things such as: ;; definition for method 38 of type pickup-spawner ;; WARN: Return type mismatch int vs none. -(defmethod crate-method-38 pickup-spawner ((this pickup-spawner)) +(defmethod crate-method-38 ((this pickup-spawner)) (go (method-of-object this idle)) 0 (none) @@ -1480,3 +1471,7 @@ This commonly includes things such as: #f ) ) + + + + diff --git a/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc index d755ff05c52..bb8ee7038ca 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc @@ -4,14 +4,10 @@ ;; definition of type dark-eco-pool (deftype dark-eco-pool (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) ;; definition for method 3 of type dark-eco-pool -(defmethod inspect dark-eco-pool ((this dark-eco-pool)) +(defmethod inspect ((this dark-eco-pool)) (when (not this) (set! this this) (goto cfg-4) @@ -54,7 +50,7 @@ ;; definition for method 28 of type dark-eco-pool ;; WARN: Return type mismatch ambient-sound vs none. -(defmethod offset! dark-eco-pool ((this dark-eco-pool)) +(defmethod offset! ((this dark-eco-pool)) "Offset a [[water-anim]]'s `trans` and `quat` by the lump data in `entity`." (let ((t9-0 (method-of-type water-anim offset!))) (t9-0 this) @@ -83,7 +79,7 @@ ;; definition for method 24 of type dark-eco-pool ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! dark-eco-pool ((this dark-eco-pool)) +(defmethod init-water! ((this dark-eco-pool)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) (t9-0 this) diff --git a/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc index 59b40d55022..dd5344d55f3 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc @@ -3,19 +3,16 @@ ;; definition of type elevator-params (deftype elevator-params (structure) - ((xz-threshold float :offset-assert 0) - (y-threshold float :offset-assert 4) - (start-pos float :offset-assert 8) - (move-rate float :offset-assert 12) - (flags elevator-flags :offset-assert 16) + ((xz-threshold float) + (y-threshold float) + (start-pos float) + (move-rate float) + (flags elevator-flags) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type elevator-params -(defmethod inspect elevator-params ((this elevator-params)) +(defmethod inspect ((this elevator-params)) (when (not this) (set! this this) (goto cfg-4) @@ -32,16 +29,13 @@ ;; definition of type path-step (deftype path-step (structure) - ((next-pos float :offset-assert 0) - (dist float :offset-assert 4) + ((next-pos float) + (dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type path-step -(defmethod inspect path-step ((this path-step)) +(defmethod inspect ((this path-step)) (when (not this) (set! this this) (goto cfg-4) @@ -55,15 +49,12 @@ ;; definition of type path-step-inline-array (deftype path-step-inline-array (inline-array-class) - ((data path-step :inline :dynamic :offset-assert 16) + ((data path-step :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type path-step-inline-array -(defmethod inspect path-step-inline-array ((this path-step-inline-array)) +(defmethod inspect ((this path-step-inline-array)) (when (not this) (set! this this) (goto cfg-4) @@ -81,45 +72,43 @@ ;; definition of type elevator (deftype elevator (base-plat) - ((params elevator-params :inline :offset-assert 272) - (path-seq path-step-inline-array :offset-assert 296) - (path-dest float :offset-assert 300) - (bottom-top float 2 :offset-assert 304) - (move-pos float 2 :offset-assert 312) - (move-dist float :offset-assert 320) - (path-pos float :offset-assert 324) - (path-eased-pos float :offset-assert 328) - (ride-timer time-frame :offset-assert 336) - (sticky-player-last-ride-time time-frame :offset-assert 344) - (elevator-status elevator-status :offset-assert 352) - (on-activate pair :offset-assert 360) - (on-deactivate pair :offset-assert 364) + ((params elevator-params :inline) + (path-seq path-step-inline-array) + (path-dest float) + (bottom-top float 2) + (move-pos float 2) + (move-dist float) + (path-pos float) + (path-eased-pos float) + (ride-timer time-frame) + (sticky-player-last-ride-time time-frame) + (elevator-status elevator-status) + (on-activate pair) + (on-deactivate pair) ) - :heap-base #xf0 - :method-count-assert 49 - :size-assert #x170 - :flag-assert #x3100f00170 + (:state-methods + dormant + waiting + running + arrived + ) (:methods - (dormant () _type_ :state 34) - (waiting () _type_ :state 35) - (running () _type_ :state 36) - (arrived () _type_ :state 37) - (elevator-method-38 (_type_) none 38) - (calc-dist-between-points! (_type_ int int) none 39) - (activate-elevator (_type_) object 40) - (init-defaults! (_type_) none 41) - (set-ambient-sound! (_type_) none 42) - (move-between-points (_type_ vector float float) symbol 43) - (elevator-method-44 (_type_) symbol 44) - (commited-to-ride? (_type_) symbol 45) - (move-to-next-point! (_type_) none 46) - (find-closest-point-in-path! (_type_ vector (pointer float) symbol symbol) symbol 47) - (elevator-method-48 (_type_) none 48) + (elevator-method-38 (_type_) none) + (calc-dist-between-points! (_type_ int int) none) + (activate-elevator (_type_) object) + (init-defaults! (_type_) none) + (set-ambient-sound! (_type_) none) + (move-between-points (_type_ vector float float) symbol) + (elevator-method-44 (_type_) symbol) + (commited-to-ride? (_type_) symbol) + (move-to-next-point! (_type_) none) + (find-closest-point-in-path! (_type_ vector (pointer float) symbol symbol) symbol) + (elevator-method-48 (_type_) none) ) ) ;; definition for method 3 of type elevator -(defmethod inspect elevator ((this elevator)) +(defmethod inspect ((this elevator)) (when (not this) (set! this this) (goto cfg-4) @@ -145,7 +134,7 @@ ) ;; definition for method 43 of type elevator -(defmethod move-between-points elevator ((this elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -156,7 +145,7 @@ ;; definition for method 48 of type elevator ;; INFO: Used lq/sq -(defmethod elevator-method-48 elevator ((this elevator)) +(defmethod elevator-method-48 ((this elevator)) "TODO - collision related" (let ((target *target*)) (when target @@ -192,7 +181,7 @@ ;; definition for method 41 of type elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-defaults! elevator ((this elevator)) +(defmethod init-defaults! ((this elevator)) "Initializes default settings related to the [[elevator]]: - `elevator-xz-threshold` - `elevator-y-threshold` @@ -430,7 +419,7 @@ which is obviously useful for an elevator." ;; definition for method 47 of type elevator ;; INFO: Used lq/sq -(defmethod find-closest-point-in-path! elevator ((this elevator) (arg0 vector) (arg1 (pointer float)) (arg2 symbol) (arg3 symbol)) +(defmethod find-closest-point-in-path! ((this elevator) (arg0 vector) (arg1 (pointer float)) (arg2 symbol) (arg3 symbol)) "Finds and sets the provided [[path-step]]'s `next-pos` field to the vertex index in the path which is closest to the provided [[vector]] @@ -475,7 +464,7 @@ the provided [[vector]] ;; definition for method 44 of type elevator ;; WARN: Return type mismatch object vs symbol. -(defmethod elevator-method-44 elevator ((this elevator)) +(defmethod elevator-method-44 ((this elevator)) (let* ((target-temp *target*) (target (if (type? target-temp process-focusable) target-temp @@ -490,7 +479,7 @@ the provided [[vector]] ) ;; definition for method 45 of type elevator -(defmethod commited-to-ride? elevator ((this elevator)) +(defmethod commited-to-ride? ((this elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" #t ) @@ -503,7 +492,7 @@ the provided [[vector]] ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod move-to-next-point! elevator ((this elevator)) +(defmethod move-to-next-point! ((this elevator)) "If the [[*target*]] is in a valid state and there is a point to transition to in the elevator's path do so. @see [[elevator::47]]" @@ -774,7 +763,7 @@ do so. ;; definition for method 39 of type elevator ;; WARN: Return type mismatch int vs none. -(defmethod calc-dist-between-points! elevator ((this elevator) (path-point-x int) (path-point-y int)) +(defmethod calc-dist-between-points! ((this elevator) (path-point-x int) (path-point-y int)) "Calculates the distance between two points in the elevator's path. @param path-point-x The index of the first point in the distance calculation, and where `next-pos` and `dist` are stored in the `path-seq` array @@ -791,7 +780,7 @@ do so. ;; definition for method 42 of type elevator ;; WARN: Return type mismatch int vs none. -(defmethod set-ambient-sound! elevator ((this elevator)) +(defmethod set-ambient-sound! ((this elevator)) "Sets the elevator's [[ambient-sound]] up" (set! (-> this sound) (the-as ambient-sound 0)) 0 @@ -800,7 +789,7 @@ do so. ;; definition for method 33 of type elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! elevator ((this elevator)) +(defmethod init-plat! ((this elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." 0 @@ -808,7 +797,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 7 of type elevator -(defmethod relocate elevator ((this elevator) (arg0 int)) +(defmethod relocate ((this elevator) (arg0 int)) (if (nonzero? (-> this path-seq)) (&+! (-> this path-seq) arg0) ) @@ -816,7 +805,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 40 of type elevator -(defmethod activate-elevator elevator ((this elevator)) +(defmethod activate-elevator ((this elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (if (logtest? (-> this params flags) (elevator-flags elevator-flags-6)) (go (method-of-object this arrived)) @@ -841,7 +830,7 @@ For example for an elevator pre-compute the distance between the first and last ;; WARN: Stack slot offset 32 signed mismatch ;; WARN: Stack slot offset 32 signed mismatch ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! elevator ((this elevator) (entity entity-actor)) +(defmethod init-from-entity! ((this elevator) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc index a8326d9ca85..11d18cfbff9 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc @@ -3,40 +3,36 @@ ;; definition of type manipy (deftype manipy (process-drawable) - ((root collide-shape :override) - (new-trans-hook (function none) :offset-assert 200) - (cur-trans-hook (function none) :offset-assert 204) - (cur-event-hook (function none) :offset-assert 208) - (new-joint-anim art-joint-anim :offset-assert 212) - (new-joint-anim-blend uint64 :offset-assert 216) - (anim-mode symbol :offset-assert 224) - (cur-grab-handle handle :offset-assert 232) - (cur-target-handle handle :offset-assert 240) - (old-grab-pos vector :inline :offset-assert 256) - (joint joint-mod 4 :offset-assert 272) - (new-post-hook (function none) :offset-assert 288) - (cur-post-hook (function none) :offset-assert 292) - (clone-copy-trans symbol :offset-assert 296) - (shadow-backup basic :offset-assert 300) - (draw? symbol :offset-assert 304) - (userdata uint64 :offset-assert 312) - (prefix basic :offset-assert 320) - (shadow-volume-joint int32 :offset-assert 324) - (speed float :offset-assert 328) - (user-uint64 uint64 4 :offset-assert 336) - (options manipy-options :offset-assert 368) + ((root collide-shape :override) + (new-trans-hook (function none)) + (cur-trans-hook (function none)) + (cur-event-hook (function none)) + (new-joint-anim art-joint-anim) + (new-joint-anim-blend uint64) + (anim-mode symbol) + (cur-grab-handle handle) + (cur-target-handle handle) + (old-grab-pos vector :inline) + (joint joint-mod 4) + (new-post-hook (function none)) + (cur-post-hook (function none)) + (clone-copy-trans symbol) + (shadow-backup basic) + (draw? symbol) + (userdata uint64) + (prefix basic) + (shadow-volume-joint int32) + (speed float) + (user-uint64 uint64 4) + (options manipy-options) ) - :heap-base #x100 - :method-count-assert 21 - :size-assert #x174 - :flag-assert #x1501000174 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type manipy -(defmethod inspect manipy ((this manipy)) +(defmethod inspect ((this manipy)) (when (not this) (set! this this) (goto cfg-4) @@ -71,26 +67,24 @@ ;; definition of type part-spawner (deftype part-spawner (process) - ((root trsqv :offset-assert 128) - (part sparticle-launch-control :offset-assert 132) - (sound ambient-sound :offset-assert 136) - (mode (pointer sparticle-launch-group) :offset-assert 140) - (enable symbol :offset-assert 144) - (radius meters :offset-assert 148) - (world-sphere sphere :inline :offset-assert 160) + ((root trsqv) + (part sparticle-launch-control) + (sound ambient-sound) + (mode (pointer sparticle-launch-group)) + (enable symbol) + (radius meters) + (world-sphere sphere :inline) ) - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 + (:state-methods + active + ) (:methods - (active () _type_ :state 14) - (is-in-view? (_type_) symbol 15) + (is-in-view? (_type_) symbol) ) ) ;; definition for method 3 of type part-spawner -(defmethod inspect part-spawner ((this part-spawner)) +(defmethod inspect ((this part-spawner)) (when (not this) (set! this this) (goto cfg-4) @@ -111,34 +105,32 @@ ;; definition of type part-tracker (deftype part-tracker (process) - ((root trsqv :offset-assert 128) - (mat matrix :inline :offset-assert 144) - (part sparticle-launch-control :offset-assert 208) - (callback (function part-tracker vector) :offset-assert 212) - (linger-callback (function part-tracker vector) :offset-assert 216) - (duration uint64 :offset-assert 224) - (linger-duration uint64 :offset-assert 232) - (start-time time-frame :offset-assert 240) - (target handle :offset-assert 248) - (target-joint int32 :offset-assert 256) - (offset vector :inline :offset-assert 272) - (userdata uint64 :offset-assert 288) - (user-time time-frame 2 :offset-assert 296) - (user-vector vector :inline :offset-assert 320) - (user-handle uint32 2 :offset 352) + ((root trsqv) + (mat matrix :inline) + (part sparticle-launch-control) + (callback (function part-tracker vector)) + (linger-callback (function part-tracker vector)) + (duration uint64) + (linger-duration uint64) + (start-time time-frame) + (target handle) + (target-joint int32) + (offset vector :inline) + (userdata uint64) + (user-time time-frame 2) + (user-vector vector :inline) + (user-handle uint32 2 :offset 352) ) - :heap-base #xf0 - :method-count-assert 16 - :size-assert #x168 - :flag-assert #x1000f00168 + (:state-methods + active + ) (:methods - (active () _type_ :state 14) - (notify-parent-of-death (_type_) none 15) + (notify-parent-of-death (_type_) none) ) ) ;; definition for method 3 of type part-tracker -(defmethod inspect part-tracker ((this part-tracker)) +(defmethod inspect ((this part-tracker)) (when (not this) (set! this this) (goto cfg-4) @@ -167,37 +159,35 @@ ;; definition of type lightning-tracker (deftype lightning-tracker (process) - ((ppointer (pointer lightning-tracker) :override) - (root trsqv :offset-assert 128) - (lightning lightning-control :offset-assert 132) - (callback (function lightning-tracker none) :offset-assert 136) - (duration uint64 :offset-assert 144) - (start-time time-frame :offset-assert 152) - (offset0 vector :inline :offset-assert 160) - (offset1 vector :inline :offset-assert 176) - (target0 handle :offset-assert 192) - (target1 handle :offset-assert 200) - (target-joint0 int32 :offset-assert 208) - (target-joint1 int32 :offset-assert 212) - (sound sound-id :offset-assert 216) - (userdata uint64 :offset-assert 224) - (user-time time-frame 2 :offset-assert 232) - (user-vector vector :inline :offset-assert 256) - (user-handle handle 2 :offset 288) + ((ppointer (pointer lightning-tracker) :override) + (root trsqv) + (lightning lightning-control) + (callback (function lightning-tracker none)) + (duration uint64) + (start-time time-frame) + (offset0 vector :inline) + (offset1 vector :inline) + (target0 handle) + (target1 handle) + (target-joint0 int32) + (target-joint1 int32) + (sound sound-id) + (userdata uint64) + (user-time time-frame 2) + (user-vector vector :inline) + (user-handle handle 2 :offset 288) ) - :heap-base #xb0 - :method-count-assert 17 - :size-assert #x130 - :flag-assert #x1100b00130 + (:state-methods + active + ) (:methods - (active () _type_ :state 14) - (notify-parent-of-death (_type_) none 15) - (update (_type_) none 16) + (notify-parent-of-death (_type_) none) + (update (_type_) none) ) ) ;; definition for method 3 of type lightning-tracker -(defmethod inspect lightning-tracker ((this lightning-tracker)) +(defmethod inspect ((this lightning-tracker)) (when (not this) (set! this this) (goto cfg-4) @@ -227,25 +217,21 @@ ;; definition of type touch-tracker (deftype touch-tracker (process-drawable) - ((root collide-shape :override) - (duration time-frame :offset-assert 200) - (target handle :offset-assert 208) - (event symbol :offset-assert 216) - (run-function (function object) :offset-assert 220) - (callback (function touch-tracker none) :offset-assert 224) - (event-mode basic :offset-assert 228) + ((root collide-shape :override) + (duration time-frame) + (target handle) + (event symbol) + (run-function (function object)) + (callback (function touch-tracker none)) + (event-mode basic) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xe8 - :flag-assert #x15007000e8 - (:methods - (active () _type_ :state 20) + (:state-methods + active ) ) ;; definition for method 3 of type touch-tracker -(defmethod inspect touch-tracker ((this touch-tracker)) +(defmethod inspect ((this touch-tracker)) (when (not this) (set! this this) (goto cfg-4) @@ -265,27 +251,25 @@ ;; definition of type swingpole (deftype swingpole (process-drawable) - ((root collide-shape :override) - (edge-length meters :offset-assert 200) - (path-pos float :offset-assert 204) - (joint-track int32 :offset-assert 208) - (speed meters :offset-assert 212) - (dir vector :inline :offset-assert 224) - (sync sync-eased :inline :offset-assert 240) + ((root collide-shape :override) + (edge-length meters) + (path-pos float) + (joint-track int32) + (speed meters) + (dir vector :inline) + (sync sync-eased :inline) ) - :heap-base #xa0 - :method-count-assert 23 - :size-assert #x11c - :flag-assert #x1700a0011c + (:state-methods + idle + (active handle) + ) (:methods - (idle () _type_ :state 20) - (active (handle) _type_ :state 21) - (move-along-path (_type_) none 22) + (move-along-path (_type_) none) ) ) ;; definition for method 3 of type swingpole -(defmethod inspect swingpole ((this swingpole)) +(defmethod inspect ((this swingpole)) (when (not this) (set! this this) (goto cfg-4) @@ -305,25 +289,22 @@ ;; definition of type gui-query (deftype gui-query (structure) - ((x-position int32 :offset-assert 0) - (y-position int32 :offset-assert 4) - (message string :offset-assert 8) - (decision symbol :offset-assert 12) - (only-allow-cancel symbol :offset-assert 16) - (no-msg string :offset-assert 20) - (message-space int32 :offset-assert 24) + ((x-position int32) + (y-position int32) + (message string) + (decision symbol) + (only-allow-cancel symbol) + (no-msg string) + (message-space int32) ) - :method-count-assert 11 - :size-assert #x1c - :flag-assert #xb0000001c (:methods - (gui-query-method-9 () none 9) - (gui-query-method-10 () none 10) + (gui-query-method-9 () none) + (gui-query-method-10 () none) ) ) ;; definition for method 3 of type gui-query -(defmethod inspect gui-query ((this gui-query)) +(defmethod inspect ((this gui-query)) (when (not this) (set! this this) (goto cfg-4) @@ -342,30 +323,26 @@ ;; definition of type othercam (deftype othercam (process) - ((hand handle :offset-assert 128) - (old-global-mask process-mask :offset-assert 136) - (mask-to-clear process-mask :offset-assert 140) - (cam-joint-index int32 :offset-assert 144) - (old-pos vector :inline :offset-assert 160) - (old-mat-z vector :inline :offset-assert 176) - (had-valid-frame basic :offset-assert 192) - (border-value basic :offset-assert 196) - (die? symbol :offset-assert 200) - (survive-anim-end? symbol :offset-assert 204) - (spooling? symbol :offset-assert 208) - (fov float :offset-assert 212) + ((hand handle) + (old-global-mask process-mask) + (mask-to-clear process-mask) + (cam-joint-index int32) + (old-pos vector :inline) + (old-mat-z vector :inline) + (had-valid-frame basic) + (border-value basic) + (die? symbol) + (survive-anim-end? symbol) + (spooling? symbol) + (fov float) ) - :heap-base #x60 - :method-count-assert 14 - :size-assert #xd8 - :flag-assert #xe006000d8 (:states othercam-running ) ) ;; definition for method 3 of type othercam -(defmethod inspect othercam ((this othercam)) +(defmethod inspect ((this othercam)) (when (not this) (set! this this) (goto cfg-4) @@ -391,25 +368,23 @@ ;; definition of type explosion (deftype explosion (process-drawable) - ((root collide-shape :override) - (start-time time-frame :offset-assert 200) - (duration uint32 :offset-assert 208) - (linger-duration uint32 :offset-assert 212) - (attack-id uint32 :offset-assert 216) + ((root collide-shape :override) + (start-time time-frame) + (duration uint32) + (linger-duration uint32) + (attack-id uint32) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17006000dc + (:state-methods + explode + ) (:methods - (explode () _type_ :state 20) - (setup-explosion-collision (_type_) none 21) - (explosion-method-22 (_type_) none 22) + (setup-explosion-collision (_type_) none) + (explosion-method-22 (_type_) none) ) ) ;; definition for method 3 of type explosion -(defmethod inspect explosion ((this explosion)) +(defmethod inspect ((this explosion)) (when (not this) (set! this this) (goto cfg-4) @@ -427,20 +402,17 @@ ;; definition of type explosion-init-params (deftype explosion-init-params (structure) - ((spawn-point vector :inline :offset-assert 0) - (spawn-quat quaternion :inline :offset-assert 16) - (radius float :offset-assert 32) - (group sparticle-launch-group :offset-assert 36) - (collide-with collide-spec :offset-assert 40) - (penetrate-using penetrate :offset-assert 48) + ((spawn-point vector :inline) + (spawn-quat quaternion :inline) + (radius float) + (group sparticle-launch-group) + (collide-with collide-spec) + (penetrate-using penetrate) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) ;; definition for method 3 of type explosion-init-params -(defmethod inspect explosion-init-params ((this explosion-init-params)) +(defmethod inspect ((this explosion-init-params)) (when (not this) (set! this this) (goto cfg-4) @@ -459,16 +431,13 @@ ;; definition of type process-hidden (deftype process-hidden (process) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 - (:methods - (die () _type_ :state 14) + (:state-methods + die ) ) ;; definition for method 3 of type process-hidden -(defmethod inspect process-hidden ((this process-hidden)) +(defmethod inspect ((this process-hidden)) (when (not this) (set! this this) (goto cfg-68) diff --git a/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc index f9b2607f287..6ae90384f4c 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc @@ -134,7 +134,7 @@ ;; definition for method 22 of type swingpole ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-along-path swingpole ((this swingpole)) +(defmethod move-along-path ((this swingpole)) (with-pp (if (nonzero? (-> this draw)) (ja-post) @@ -240,7 +240,7 @@ ;; definition for method 11 of type swingpole ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! swingpole ((this swingpole) (arg0 entity-actor)) +(defmethod init-from-entity! ((this swingpole) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -341,7 +341,7 @@ This commonly includes things such as: ;; definition for method 11 of type process-hidden ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! process-hidden ((this process-hidden) (arg0 entity-actor)) +(defmethod init-from-entity! ((this process-hidden) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -357,13 +357,10 @@ This commonly includes things such as: ;; definition of type target-start (deftype target-start (process-hidden) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 ) ;; definition for method 3 of type target-start -(defmethod inspect target-start ((this target-start)) +(defmethod inspect ((this target-start)) (when (not this) (set! this this) (goto cfg-68) @@ -503,13 +500,10 @@ This commonly includes things such as: ;; definition of type camera-start (deftype camera-start (process-hidden) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 ) ;; definition for method 3 of type camera-start -(defmethod inspect camera-start ((this camera-start)) +(defmethod inspect ((this camera-start)) (when (not this) (set! this this) (goto cfg-68) @@ -1311,7 +1305,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type part-tracker -(defmethod deactivate part-tracker ((this part-tracker)) +(defmethod deactivate ((this part-tracker)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) @@ -1321,7 +1315,7 @@ This commonly includes things such as: ;; definition for method 15 of type part-tracker ;; WARN: Return type mismatch object vs none. -(defmethod notify-parent-of-death part-tracker ((this part-tracker)) +(defmethod notify-parent-of-death ((this part-tracker)) (with-pp (let ((gp-0 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-0 from) (process->ppointer pp)) @@ -1546,7 +1540,7 @@ This commonly includes things such as: ;; definition for method 15 of type lightning-tracker ;; WARN: Return type mismatch object vs none. -(defmethod notify-parent-of-death lightning-tracker ((this lightning-tracker)) +(defmethod notify-parent-of-death ((this lightning-tracker)) (with-pp (let ((gp-0 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-0 from) (process->ppointer pp)) @@ -1571,7 +1565,7 @@ This commonly includes things such as: ;; definition for method 16 of type lightning-tracker ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update lightning-tracker ((this lightning-tracker)) +(defmethod update ((this lightning-tracker)) (if (-> this callback) ((-> this callback) this) ) @@ -1995,21 +1989,17 @@ This commonly includes things such as: ;; definition of type med-res-level (deftype med-res-level (process-drawable) - ((level-name basic :offset-assert 200) - (part-mode basic :offset-assert 204) - (index int32 :offset-assert 208) + ((level-name basic) + (part-mode basic) + (index int32) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd4 - :flag-assert #x15006000d4 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type med-res-level -(defmethod inspect med-res-level ((this med-res-level)) +(defmethod inspect ((this med-res-level)) (when (not this) (set! this this) (goto cfg-4) @@ -2057,7 +2047,7 @@ This commonly includes things such as: ;; definition for method 11 of type med-res-level ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! med-res-level ((this med-res-level) (arg0 entity-actor)) +(defmethod init-from-entity! ((this med-res-level) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2086,7 +2076,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type part-spawner -(defmethod deactivate part-spawner ((this part-spawner)) +(defmethod deactivate ((this part-spawner)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) @@ -2098,7 +2088,7 @@ This commonly includes things such as: ) ;; definition for method 15 of type part-spawner -(defmethod is-in-view? part-spawner ((this part-spawner)) +(defmethod is-in-view? ((this part-spawner)) (sphere<-vector+r! (-> this world-sphere) (-> this root trans) (-> this radius)) (sphere-in-view-frustum? (-> this world-sphere)) ) @@ -2143,7 +2133,7 @@ This commonly includes things such as: ;; definition for method 11 of type part-spawner ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! part-spawner ((this part-spawner) (arg0 entity-actor)) +(defmethod init-from-entity! ((this part-spawner) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2207,27 +2197,23 @@ This commonly includes things such as: ;; definition of type launcher (deftype launcher (process-drawable) - ((root collide-shape :override) - (spring-height meters :offset-assert 200) - (camera state :offset-assert 204) - (active-distance float :offset-assert 208) - (seek-time time-frame :offset-assert 216) - (dest vector :inline :offset-assert 224) - (sound-id sound-id :offset-assert 240) + ((root collide-shape :override) + (spring-height meters) + (camera state) + (active-distance float) + (seek-time time-frame) + (dest vector :inline) + (sound-id sound-id) ) - :heap-base #x80 - :method-count-assert 23 - :size-assert #xf4 - :flag-assert #x17008000f4 - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (deactivated () _type_ :state 22) + (:state-methods + idle + active + deactivated ) ) ;; definition for method 3 of type launcher -(defmethod inspect launcher ((this launcher)) +(defmethod inspect ((this launcher)) (when (not this) (set! this this) (goto cfg-4) @@ -2793,7 +2779,7 @@ This commonly includes things such as: ;; definition for method 11 of type launcher ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! launcher ((this launcher) (arg0 entity-actor)) +(defmethod init-from-entity! ((this launcher) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3091,7 +3077,7 @@ This commonly includes things such as: ;; definition for method 21 of type explosion ;; WARN: Return type mismatch int vs none. -(defmethod setup-explosion-collision explosion ((this explosion)) +(defmethod setup-explosion-collision ((this explosion)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (set! (-> s5-0 penetrate-using) (penetrate explode)) (let ((v1-3 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) @@ -3114,7 +3100,7 @@ This commonly includes things such as: ;; definition for method 22 of type explosion ;; WARN: Return type mismatch int vs none. -(defmethod explosion-method-22 explosion ((this explosion)) +(defmethod explosion-method-22 ((this explosion)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc index 8e20ad1b634..6c36e680c4f 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc @@ -3,23 +3,21 @@ ;; definition of type plat (deftype plat (base-plat) - ((path-pos float :offset-assert 272) - (sound-id sound-id :offset-assert 276) - (sync sync-eased :inline :offset-assert 280) + ((path-pos float) + (sound-id sound-id) + (sync sync-eased :inline) ) - :heap-base #xd0 - :method-count-assert 37 - :size-assert #x144 - :flag-assert #x2500d00144 + (:state-methods + plat-idle + plat-path-active + ) (:methods - (plat-idle () _type_ :state 34) - (plat-path-active () _type_ :state 35) - (plat-path-sync (_type_) object 36) + (plat-path-sync (_type_) object) ) ) ;; definition for method 3 of type plat -(defmethod inspect plat ((this plat)) +(defmethod inspect ((this plat)) (when (not this) (set! this this) (goto cfg-4) @@ -41,14 +39,14 @@ ) ;; definition for method 30 of type plat -(defmethod get-art-group plat ((this plat)) +(defmethod get-art-group ((this plat)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-plat" (the-as (pointer uint32) #f)) ) ;; definition for method 31 of type plat ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! plat ((this plat)) +(defmethod init-plat-collision! ((this plat)) "TODO - collision stuff for setting up the platform" (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) @@ -74,7 +72,7 @@ ;; definition for method 33 of type plat ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! plat ((this plat)) +(defmethod init-plat! ((this plat)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." 0 @@ -83,13 +81,13 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 32 of type plat ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 plat ((this plat)) +(defmethod base-plat-method-32 ((this plat)) 0 (none) ) ;; definition for method 36 of type plat -(defmethod plat-path-sync plat ((this plat)) +(defmethod plat-path-sync ((this plat)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @@ -166,7 +164,7 @@ otherwise, [[plat::34]] ;; definition for method 11 of type plat ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! plat ((this plat) (entity entity-actor)) +(defmethod init-from-entity! ((this plat) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -227,24 +225,20 @@ This commonly includes things such as: ;; definition of type drop-plat (deftype drop-plat (base-plat) - ((art-name string :offset-assert 272) - (anim spool-anim :offset-assert 276) - (break-anim-name string :offset-assert 280) - (safe-time time-frame :offset-assert 288) - (hit-point vector :inline :offset-assert 304) + ((art-name string) + (anim spool-anim) + (break-anim-name string) + (safe-time time-frame) + (hit-point vector :inline) ) - :heap-base #xc0 - :method-count-assert 36 - :size-assert #x140 - :flag-assert #x2400c00140 - (:methods - (idle () _type_ :state 34) - (fall (symbol) _type_ :state 35) + (:state-methods + idle + (fall symbol) ) ) ;; definition for method 3 of type drop-plat -(defmethod inspect drop-plat ((this drop-plat)) +(defmethod inspect ((this drop-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -263,7 +257,7 @@ This commonly includes things such as: ;; definition for method 7 of type drop-plat ;; WARN: Return type mismatch base-plat vs drop-plat. -(defmethod relocate drop-plat ((this drop-plat) (arg0 int)) +(defmethod relocate ((this drop-plat) (arg0 int)) (if (nonzero? (-> this break-anim-name)) (&+! (-> this break-anim-name) arg0) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/projectile-h_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/projectile-h_REF.gc index f4087b2cbce..85bdce6c48d 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/projectile-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/projectile-h_REF.gc @@ -3,66 +3,64 @@ ;; definition of type projectile (deftype projectile (process-drawable) - ((root collide-shape-moving :override) - (starting-pos vector :inline :offset-assert 208) - (starting-dir vector :inline :offset-assert 224) - (target-pos vector :inline :offset-assert 240) - (base-target-pos vector :inline :offset-assert 256) - (pre-move-transv vector :inline :offset-assert 272) - (timeout time-frame :offset-assert 288) - (spawn-time time-frame :offset-assert 296) - (options projectile-options :offset-assert 304) - (last-target handle :offset-assert 312) - (notify-handle handle :offset-assert 320) - (owner-handle handle :offset-assert 328) - (ignore-handle handle :offset-assert 336) - (update-velocity (function projectile none) :offset-assert 344) - (move (function projectile none) :offset-assert 348) - (pick-target (function projectile none) :offset-assert 352) - (max-speed float :offset-assert 356) - (old-dist float 16 :offset-assert 360) - (old-dist-count int32 :offset-assert 424) - (hits int32 :offset-assert 428) - (max-hits int32 :offset-assert 432) - (tween float :offset-assert 436) - (attack-mode symbol :offset-assert 440) - (attack-id uint32 :offset-assert 444) - (damage float :offset-assert 448) - (charge-level float :offset-assert 452) - (sound-id sound-id :offset-assert 456) - (stop-speed meters :offset-assert 460) - (invinc-time time-frame :offset-assert 464) + ((root collide-shape-moving :override) + (starting-pos vector :inline) + (starting-dir vector :inline) + (target-pos vector :inline) + (base-target-pos vector :inline) + (pre-move-transv vector :inline) + (timeout time-frame) + (spawn-time time-frame) + (options projectile-options) + (last-target handle) + (notify-handle handle) + (owner-handle handle) + (ignore-handle handle) + (update-velocity (function projectile none)) + (move (function projectile none)) + (pick-target (function projectile none)) + (max-speed float) + (old-dist float 16) + (old-dist-count int32) + (hits int32) + (max-hits int32) + (tween float) + (attack-mode symbol) + (attack-id uint32) + (damage float) + (charge-level float) + (sound-id sound-id) + (stop-speed meters) + (invinc-time time-frame) ) - :heap-base #x160 - :method-count-assert 40 - :size-assert #x1d8 - :flag-assert #x28016001d8 + (:state-methods + die + dissipate + impact + moving + ) (:methods - (die () _type_ :state 20) - (dissipate () _type_ :state 21) - (impact () _type_ :state 22) - (moving () _type_ :state 23) - (draw-laser-sight (_type_) none 24) - (spawn-impact-particles (_type_) none 25) - (spawn-shell-particles (_type_) none 26) - (unknown-particles (_type_) none 27) - (play-impact-sound (_type_ projectile-options) none 28) - (stop-sound! (_type_) none 29) - (init-proj-collision! (_type_) none 30) - (init-proj-settings! (_type_) none 31) - (go-moving! (_type_) none 32) - (go-sitting! (_type_) none 33) - (kill-projectile! (_type_) symbol 34) - (event-handler! (_type_ process int symbol event-message-block) object 35) - (handle-proj-hit! (_type_ process event-message-block) object 36) - (deal-damage! (_type_ process event-message-block) symbol 37) - (made-impact? (_type_) symbol 38) - (play-impact-sound! (_type_) none :behavior projectile 39) + (draw-laser-sight (_type_) none) + (spawn-impact-particles (_type_) none) + (spawn-shell-particles (_type_) none) + (unknown-particles (_type_) none) + (play-impact-sound (_type_ projectile-options) none) + (stop-sound! (_type_) none) + (init-proj-collision! (_type_) none) + (init-proj-settings! (_type_) none) + (go-moving! (_type_) none) + (go-sitting! (_type_) none) + (kill-projectile! (_type_) symbol) + (event-handler! (_type_ process int symbol event-message-block) object) + (handle-proj-hit! (_type_ process event-message-block) object) + (deal-damage! (_type_ process event-message-block) symbol) + (made-impact? (_type_) symbol) + (play-impact-sound! (_type_) none :behavior projectile) ) ) ;; definition for method 3 of type projectile -(defmethod inspect projectile ((this projectile)) +(defmethod inspect ((this projectile)) (when (not this) (set! this this) (goto cfg-4) @@ -104,24 +102,21 @@ ;; definition of type projectile-init-by-other-params (deftype projectile-init-by-other-params (structure) - ((ent entity :offset-assert 0) - (charge float :offset-assert 4) - (attack-id uint32 :offset-assert 8) - (options projectile-options :offset-assert 16) - (notify-handle handle :offset-assert 24) - (owner-handle handle :offset-assert 32) - (ignore-handle handle :offset-assert 40) - (pos vector :inline :offset-assert 48) - (vel vector :inline :offset-assert 64) - (timeout time-frame :offset-assert 80) + ((ent entity) + (charge float) + (attack-id uint32) + (options projectile-options) + (notify-handle handle) + (owner-handle handle) + (ignore-handle handle) + (pos vector :inline) + (vel vector :inline) + (timeout time-frame) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) ;; definition for method 3 of type projectile-init-by-other-params -(defmethod inspect projectile-init-by-other-params ((this projectile-init-by-other-params)) +(defmethod inspect ((this projectile-init-by-other-params)) (when (not this) (set! this this) (goto cfg-4) @@ -157,21 +152,19 @@ ;; definition of type projectile-bounce (deftype projectile-bounce (projectile) "This seems to be the scrapped peacemaker gun implementation - the bouncing dark eco grenade launcher" - ((played-bounce-time time-frame :offset-assert 472) - (tumble-quat quaternion :inline :offset-assert 480) + ((played-bounce-time time-frame) + (tumble-quat quaternion :inline) ) - :heap-base #x170 - :method-count-assert 42 - :size-assert #x1f0 - :flag-assert #x2a017001f0 + (:state-methods + sitting + ) (:methods - (sitting () _type_ :state 40) - (noop (_type_) none 41) + (noop (_type_) none) ) ) ;; definition for method 3 of type projectile-bounce -(defmethod inspect projectile-bounce ((this projectile-bounce)) +(defmethod inspect ((this projectile-bounce)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/common_objs/projectile_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/projectile_REF.gc index c575b164aae..e4cf7be3ac9 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/projectile_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/projectile_REF.gc @@ -16,14 +16,14 @@ ;; definition for method 39 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound! projectile ((this projectile)) +(defmethod play-impact-sound! ((this projectile)) "Plays impact sound" 0 (none) ) ;; definition for method 35 of type projectile -(defmethod event-handler! projectile ((this projectile) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod event-handler! ((this projectile) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Multiplex the projectile's event processing, called by [[projectile-event-handler]]" (case arg2 (('track) @@ -50,7 +50,7 @@ ;; definition for method 37 of type projectile ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs symbol. -(defmethod deal-damage! projectile ((this projectile) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! ((this projectile) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((v1-1 (new 'stack 'attack-info))) (let ((a0-2 v1-1)) @@ -88,7 +88,7 @@ ) ;; definition for method 36 of type projectile -(defmethod handle-proj-hit! projectile ((this projectile) (arg0 process) (arg1 event-message-block)) +(defmethod handle-proj-hit! ((this projectile) (arg0 process) (arg1 event-message-block)) "When a projectile hits something, first deal damage via [[projectile::37]] and increment the projectiles hit count. @@ -111,7 +111,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) ;; definition for method 34 of type projectile -(defmethod kill-projectile! projectile ((this projectile)) +(defmethod kill-projectile! ((this projectile)) "Transition to the [[projectile::impact]] state, always return [[#t]]" (if (not (and (-> this next-state) (= (-> this next-state name) 'impact))) (go (method-of-object this impact)) @@ -121,7 +121,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 24 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight projectile ((this projectile)) +(defmethod draw-laser-sight ((this projectile)) "TODO - confirm If applicable, draw the laser sight particles" 0 (none) @@ -129,7 +129,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 25 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles projectile ((this projectile)) +(defmethod spawn-impact-particles ((this projectile)) "Spawns associated particles with the projectile if applicable" (if (nonzero? (-> this part)) (spawn (-> this part) (-> this root trans)) @@ -140,7 +140,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 26 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles projectile ((this projectile)) +(defmethod spawn-shell-particles ((this projectile)) "TODO - confirm" 0 (none) @@ -148,7 +148,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 27 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod unknown-particles projectile ((this projectile)) +(defmethod unknown-particles ((this projectile)) "TODO - confirm" 0 (none) @@ -156,14 +156,14 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 28 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound projectile ((this projectile) (arg0 projectile-options)) +(defmethod play-impact-sound ((this projectile) (arg0 projectile-options)) 0 (none) ) ;; definition for method 29 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod stop-sound! projectile ((this projectile)) +(defmethod stop-sound! ((this projectile)) "Stops the current `sound-id` if set, re-init the `sound-id` after being stopped" (when (nonzero? (-> this sound-id)) (sound-stop (-> this sound-id)) @@ -175,7 +175,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) ;; definition for method 38 of type projectile -(defmethod made-impact? projectile ((this projectile)) +(defmethod made-impact? ((this projectile)) "TODO - queries the collision cache, return true/false" (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) @@ -409,7 +409,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 31 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! projectile ((this projectile)) +(defmethod init-proj-settings! ((this projectile)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" 0 (none) @@ -417,7 +417,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 30 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! projectile ((this projectile)) +(defmethod init-proj-collision! ((this projectile)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -453,7 +453,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 32 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod go-moving! projectile ((this projectile)) +(defmethod go-moving! ((this projectile)) (go (method-of-object this moving)) 0 (none) @@ -461,7 +461,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 33 of type projectile ;; WARN: Return type mismatch object vs none. -(defmethod go-sitting! projectile ((this projectile)) +(defmethod go-sitting! ((this projectile)) (if (not (and (-> this next-state) (= (-> this next-state name) 'impact))) (go (method-of-object this impact)) ) @@ -469,7 +469,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) ;; definition for method 10 of type projectile -(defmethod deactivate projectile ((this projectile)) +(defmethod deactivate ((this projectile)) (stop-sound! this) ((method-of-type process-drawable deactivate) this) (none) @@ -587,7 +587,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 41 of type projectile-bounce ;; WARN: Return type mismatch int vs none. -(defmethod noop projectile-bounce ((this projectile-bounce)) +(defmethod noop ((this projectile-bounce)) "Does nothing" 0 (none) @@ -603,14 +603,14 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 33 of type projectile-bounce ;; WARN: Return type mismatch object vs none. -(defmethod go-sitting! projectile-bounce ((this projectile-bounce)) +(defmethod go-sitting! ((this projectile-bounce)) (go (method-of-object this sitting)) (none) ) ;; definition for method 25 of type projectile-bounce ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles projectile-bounce ((this projectile-bounce)) +(defmethod spawn-impact-particles ((this projectile-bounce)) "Spawns associated particles with the projectile if applicable" (ja-post) 0 @@ -639,7 +639,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 39 of type projectile-bounce ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound! projectile-bounce ((this projectile-bounce)) +(defmethod play-impact-sound! ((this projectile-bounce)) "Plays impact sound" (let* ((a2-0 (-> this root)) (v1-0 (-> a2-0 status)) @@ -659,7 +659,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 30 of type projectile-bounce ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! projectile-bounce ((this projectile-bounce)) +(defmethod init-proj-collision! ((this projectile-bounce)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -696,7 +696,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 31 of type projectile-bounce ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! projectile-bounce ((this projectile-bounce)) +(defmethod init-proj-settings! ((this projectile-bounce)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this max-speed) 450560.0) (set! (-> this timeout) (seconds 1.6)) diff --git a/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc index ee76b1b9c31..1a04d33844f 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc @@ -3,27 +3,24 @@ ;; definition of type rigid-body-platform-constants (deftype rigid-body-platform-constants (rigid-body-object-constants) - ((drag-factor float :offset-assert 208) - (buoyancy-factor float :offset-assert 212) - (max-buoyancy-depth meters :offset-assert 216) - (player-weight meters :offset-assert 220) - (player-bonk-factor float :offset-assert 224) - (player-dive-factor float :offset-assert 228) - (player-force-distance meters :offset-assert 232) - (player-force-clamp meters :offset-assert 236) - (player-force-timeout uint64 :offset-assert 240) - (explosion-force meters :offset-assert 248) - (control-point-count int32 :offset-assert 252) - (platform symbol :offset-assert 256) - (sound-name string :offset-assert 260) + ((drag-factor float) + (buoyancy-factor float) + (max-buoyancy-depth meters) + (player-weight meters) + (player-bonk-factor float) + (player-dive-factor float) + (player-force-distance meters) + (player-force-clamp meters) + (player-force-timeout uint64) + (explosion-force meters) + (control-point-count int32) + (platform symbol) + (sound-name string) ) - :method-count-assert 9 - :size-assert #x108 - :flag-assert #x900000108 ) ;; definition for method 3 of type rigid-body-platform-constants -(defmethod inspect rigid-body-platform-constants ((this rigid-body-platform-constants)) +(defmethod inspect ((this rigid-body-platform-constants)) (when (not this) (set! this this) (goto cfg-4) @@ -67,17 +64,14 @@ ;; definition of type rigid-body-control-point (deftype rigid-body-control-point (structure) - ((local-pos vector :inline :offset-assert 0) - (world-pos vector :inline :offset-assert 16) - (velocity vector :inline :offset-assert 32) + ((local-pos vector :inline) + (world-pos vector :inline) + (velocity vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type rigid-body-control-point -(defmethod inspect rigid-body-control-point ((this rigid-body-control-point)) +(defmethod inspect ((this rigid-body-control-point)) (when (not this) (set! this this) (goto cfg-4) @@ -92,15 +86,12 @@ ;; definition of type rigid-body-control-point-inline-array (deftype rigid-body-control-point-inline-array (inline-array-class) - ((data rigid-body-control-point :inline :dynamic :offset-assert 16) + ((data rigid-body-control-point :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type rigid-body-control-point-inline-array -(defmethod inspect rigid-body-control-point-inline-array ((this rigid-body-control-point-inline-array)) +(defmethod inspect ((this rigid-body-control-point-inline-array)) (when (not this) (set! this this) (goto cfg-4) @@ -118,29 +109,25 @@ ;; definition of type rigid-body-platform (deftype rigid-body-platform (rigid-body-object) - ((info rigid-body-platform-constants :override) - (control-point-array rigid-body-control-point-inline-array :offset-assert 272) - (player-velocity vector :inline :offset-assert 288) - (player-velocity-prev vector :inline :offset-assert 304) - (unknown-pad uint32 8 :offset-assert 320) - (float-height-offset float :offset-assert 352) - (player-bonk-timeout uint64 :offset-assert 360) - (water-anim water-anim :offset-assert 368) + ((info rigid-body-platform-constants :override) + (control-point-array rigid-body-control-point-inline-array) + (player-velocity vector :inline) + (player-velocity-prev vector :inline) + (unknown-pad uint32 8) + (float-height-offset float) + (player-bonk-timeout uint64) + (water-anim water-anim) ) - :heap-base #x100 - :method-count-assert 57 - :size-assert #x174 - :flag-assert #x3901000174 (:methods - (rigid-body-platform-method-53 (_type_ vector) float 53) - (rigid-body-platform-method-54 (_type_ rigid-body-control-point) none 54) - (rigid-body-platform-method-55 (_type_) none 55) - (rigid-body-platform-method-56 (_type_ vector) none 56) + (rigid-body-platform-method-53 (_type_ vector) float) + (rigid-body-platform-method-54 (_type_ rigid-body-control-point) none) + (rigid-body-platform-method-55 (_type_) none) + (rigid-body-platform-method-56 (_type_ vector) none) ) ) ;; definition for method 3 of type rigid-body-platform -(defmethod inspect rigid-body-platform ((this rigid-body-platform)) +(defmethod inspect ((this rigid-body-platform)) (when (not this) (set! this this) (goto cfg-4) @@ -161,7 +148,7 @@ ) ;; definition for method 7 of type rigid-body-platform -(defmethod relocate rigid-body-platform ((this rigid-body-platform) (new-addr int)) +(defmethod relocate ((this rigid-body-platform) (new-addr int)) (if (nonzero? (-> this control-point-array)) (&+! (-> this control-point-array) new-addr) ) @@ -169,7 +156,7 @@ ) ;; definition for method 53 of type rigid-body-platform -(defmethod rigid-body-platform-method-53 rigid-body-platform ((this rigid-body-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-53 ((this rigid-body-platform) (arg0 vector)) (local-vars (f0-1 object)) (let ((v1-0 (-> this water-anim))) 0.0 @@ -196,7 +183,7 @@ ;; definition for method 54 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-54 rigid-body-platform ((this rigid-body-platform) (ctrl-point rigid-body-control-point)) +(defmethod rigid-body-platform-method-54 ((this rigid-body-platform) (ctrl-point rigid-body-control-point)) (set! (-> ctrl-point world-pos w) (+ (rigid-body-platform-method-53 this (-> ctrl-point world-pos)) (-> this float-height-offset)) ) @@ -235,7 +222,7 @@ ;; definition for method 50 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-50 rigid-body-platform ((this rigid-body-platform) (arg0 float)) +(defmethod rigid-body-object-method-50 ((this rigid-body-platform) (arg0 float)) (when (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) (if (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)) (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force)) @@ -254,7 +241,7 @@ ;; definition for method 55 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-55 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-platform-method-55 ((this rigid-body-platform)) (let ((a1-0 (new 'stack-no-clear 'vector))) (vector-float*! a1-0 *y-vector* (* -1.0 (-> this info extra gravity) (-> this rbody state info mass))) (rigid-body-method-20 (-> this rbody state) a1-0) @@ -265,7 +252,7 @@ ;; definition for method 56 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-56 rigid-body-platform ((this rigid-body-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-56 ((this rigid-body-platform) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> this rbody state position)) (set! (-> v1-0 y) 0.0) @@ -284,7 +271,7 @@ ;; definition for method 29 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 rigid-body-platform ((this rigid-body-platform) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this rigid-body-platform) (arg0 float)) (let ((s4-0 (-> this rbody state matrix))) (dotimes (s3-0 (-> this info control-point-count)) (let ((s2-0 (-> this control-point-array data s3-0))) @@ -308,7 +295,7 @@ ;; definition for method 30 of type rigid-body-platform ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-30 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-object-method-30 ((this rigid-body-platform)) (if (-> this info platform) (detect-riders! (-> this root)) ) @@ -326,19 +313,19 @@ ) ;; definition for method 47 of type rigid-body-platform -(defmethod rigid-body-object-method-47 rigid-body-platform ((this rigid-body-platform) - (arg0 process-drawable) - (arg1 attack-info) - (arg2 touching-shapes-entry) - (arg3 penetrate) - ) +(defmethod rigid-body-object-method-47 ((this rigid-body-platform) + (arg0 process-drawable) + (arg1 attack-info) + (arg2 touching-shapes-entry) + (arg3 penetrate) + ) ((method-of-type rigid-body-object rigid-body-object-method-47) this arg0 arg1 arg2 arg3) #f ) ;; definition for method 46 of type rigid-body-platform ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-46 rigid-body-platform ((this rigid-body-platform) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 ((this rigid-body-platform) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('edge-grabbed) (let ((v1-1 (the-as object (-> arg3 param 0)))) @@ -422,7 +409,7 @@ ) ;; definition for method 37 of type rigid-body-platform -(defmethod rigid-body-object-method-37 rigid-body-platform ((this rigid-body-platform)) +(defmethod rigid-body-object-method-37 ((this rigid-body-platform)) (if (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)) (sound-play-by-name (string->sound-name (-> this info sound-name)) @@ -448,7 +435,7 @@ ;; definition for method 31 of type rigid-body-platform ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod alloc-and-init-rigid-body-control rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-object-constants)) +(defmethod alloc-and-init-rigid-body-control ((this rigid-body-platform) (arg0 rigid-body-object-constants)) (set! (-> this info) (the-as rigid-body-platform-constants arg0)) (set! (-> this rbody) (new 'process 'rigid-body-control this)) (set! (-> this control-point-array) @@ -476,7 +463,7 @@ ;; definition for method 32 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape rigid-body-platform ((this rigid-body-platform)) +(defmethod allocate-and-init-cshape ((this rigid-body-platform)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -541,7 +528,7 @@ ;; definition for method 33 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body rigid-body-platform ((this rigid-body-platform)) +(defmethod init-skel-and-rigid-body ((this rigid-body-platform)) (set! (-> this float-height-offset) 0.0) (alloc-and-init-rigid-body-control this *rigid-body-platform-constants*) (let ((s5-0 (-> this info control-point-count))) @@ -562,7 +549,7 @@ ;; definition for method 11 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod init-from-entity! rigid-body-platform ((this rigid-body-platform) (arg0 entity-actor)) +(defmethod init-from-entity! ((this rigid-body-platform) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc index 02c800f7a0a..fdcb49b547b 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc @@ -48,14 +48,10 @@ ;; definition of type camera-remote (deftype camera-remote (camera-slave) () - :heap-base #xa20 - :method-count-assert 14 - :size-assert #xa94 - :flag-assert #xe0a200a94 ) ;; definition for method 3 of type camera-remote -(defmethod inspect camera-remote ((this camera-remote)) +(defmethod inspect ((this camera-remote)) (when (not this) (set! this this) (goto cfg-4) @@ -69,31 +65,29 @@ ;; definition of type remote (deftype remote (process-drawable) - ((parent (pointer camera-slave) :override) - (base-trans vector :inline :offset-assert 208) - (focus focus :inline :offset-assert 224) - (seeker cam-float-seeker :inline :offset-assert 236) - (start-time time-frame :offset-assert 264) - (blend float :offset-assert 272) - (twist float :offset-assert 276) - (speak-effect? basic :offset-assert 280) + ((parent (pointer camera-slave) :override) + (base-trans vector :inline) + (focus focus :inline) + (seeker cam-float-seeker :inline) + (start-time time-frame) + (blend float) + (twist float) + (speak-effect? basic) ) - :heap-base #xa0 - :method-count-assert 26 - :size-assert #x11c - :flag-assert #x1a00a0011c + (:state-methods + enter + idle + exit + ) (:methods - (enter () _type_ :state 20) - (idle () _type_ :state 21) - (exit () _type_ :state 22) - (init (_type_) none 23) - (get-track-pt-and-scale (_type_ vector) float 24) - (post-common (_type_) none 25) + (init (_type_) none) + (get-track-pt-and-scale (_type_ vector) float) + (post-common (_type_) none) ) ) ;; definition for method 3 of type remote -(defmethod inspect remote ((this remote)) +(defmethod inspect ((this remote)) (when (not this) (set! this this) (goto cfg-4) @@ -122,7 +116,7 @@ ;; definition for method 24 of type remote ;; INFO: Used lq/sq -(defmethod get-track-pt-and-scale remote ((this remote) (arg0 vector)) +(defmethod get-track-pt-and-scale ((this remote) (arg0 vector)) (let ((s4-0 (handle->process (-> this focus handle)))) (when s4-0 (set! (-> arg0 quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) @@ -136,7 +130,7 @@ ;; definition for method 25 of type remote ;; WARN: Return type mismatch int vs none. -(defmethod post-common remote ((this remote)) +(defmethod post-common ((this remote)) (with-pp (rlet ((acc :class vf) (vf0 :class vf) @@ -352,7 +346,7 @@ ;; definition for method 23 of type remote ;; WARN: Return type mismatch remote vs none. -(defmethod init remote ((this remote)) +(defmethod init ((this remote)) (reset-to-collide-spec (-> this focus) (collide-spec jak player-list)) (initialize-skeleton this @@ -383,16 +377,12 @@ ;; definition of type voicebox (deftype voicebox (remote) - ((hint handle :offset-assert 288) + ((hint handle) ) - :heap-base #xb0 - :method-count-assert 26 - :size-assert #x128 - :flag-assert #x1a00b00128 ) ;; definition for method 3 of type voicebox -(defmethod inspect voicebox ((this voicebox)) +(defmethod inspect ((this voicebox)) (when (not this) (set! this this) (goto cfg-4) @@ -458,23 +448,21 @@ ;; definition of type judge (deftype judge (remote) - ((total-time time-frame :offset-assert 288) - (beep-time time-frame :offset-assert 296) - (hud-timer handle :offset-assert 304) - (score uint8 :offset-assert 312) + ((total-time time-frame) + (beep-time time-frame) + (hud-timer handle) + (score uint8) ) - :heap-base #xc0 - :method-count-assert 28 - :size-assert #x139 - :flag-assert #x1c00c00139 + (:state-methods + wait + ) (:methods - (wait () _type_ :state 26) - (setup-collision (_type_) none 27) + (setup-collision (_type_) none) ) ) ;; definition for method 3 of type judge -(defmethod inspect judge ((this judge)) +(defmethod inspect ((this judge)) (when (not this) (set! this this) (goto cfg-4) @@ -492,14 +480,14 @@ ;; definition for method 24 of type judge ;; INFO: Used lq/sq -(defmethod get-track-pt-and-scale judge ((this judge) (arg0 vector)) +(defmethod get-track-pt-and-scale ((this judge) (arg0 vector)) (set! (-> arg0 quad) (-> this base-trans quad)) 1.0 ) ;; definition for method 25 of type judge ;; WARN: Return type mismatch int vs none. -(defmethod post-common judge ((this judge)) +(defmethod post-common ((this judge)) (ja-post) (if (type? (-> this root) collide-shape) (update-transforms (the-as collide-shape (-> this root))) @@ -595,7 +583,7 @@ ;; definition for method 27 of type judge ;; WARN: Return type mismatch int vs none. -(defmethod setup-collision judge ((this judge)) +(defmethod setup-collision ((this judge)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec collectable)) @@ -618,7 +606,7 @@ ;; definition for method 11 of type judge ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! judge ((this judge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this judge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc index ea179a81cd4..941096cad85 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc @@ -3,38 +3,36 @@ ;; definition of type water-anim (deftype water-anim (process-drawable) - ((water-height meters :offset-assert 200) - (wade-height meters :offset-assert 204) - (swim-height meters :offset-assert 208) - (bottom-height meters :offset-assert 212) - (attack-event symbol :offset-assert 216) - (attack-id uint32 :offset-assert 220) - (flow flow-control :offset-assert 224) - (target handle :offset-assert 232) - (flags water-flags :offset-assert 240) - (look int32 :offset-assert 244) - (play-ambient-sound? symbol :offset-assert 248) - (visible symbol :offset-assert 252) + ((water-height meters) + (wade-height meters) + (swim-height meters) + (bottom-height meters) + (attack-event symbol) + (attack-id uint32) + (flow flow-control) + (target handle) + (flags water-flags) + (look int32) + (play-ambient-sound? symbol) + (visible symbol) ) - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 + (:state-methods + water-anim-state-20 + idle + ) (:methods - (water-anim-method-20 () none 20) - (idle () _type_ :state 21) - (move-to-point! (_type_ vector) int 22) - (get-ripple-height (_type_ vector) float 23) - (init-water! (_type_) none 24) - (reset-root! (_type_) trsqv 25) - (water-anim-init! (_type_) none 26) - (water-anim-method-27 (_type_) none 27) - (offset! (_type_) none 28) + (move-to-point! (_type_ vector) int) + (get-ripple-height (_type_ vector) float) + (init-water! (_type_) none) + (reset-root! (_type_) trsqv) + (water-anim-init! (_type_) none) + (water-anim-method-27 (_type_) none) + (offset! (_type_) none) ) ) ;; definition for method 3 of type water-anim -(defmethod inspect water-anim ((this water-anim)) +(defmethod inspect ((this water-anim)) (when (not this) (set! this this) (goto cfg-4) @@ -59,7 +57,7 @@ ) ;; definition for method 7 of type water-anim -(defmethod relocate water-anim ((this water-anim) (arg0 int)) +(defmethod relocate ((this water-anim) (arg0 int)) (if (nonzero? (-> this flow)) (&+! (-> this flow) arg0) ) @@ -278,17 +276,14 @@ ;; definition of type water-anim-look (deftype water-anim-look (structure) - ((skel-group string :offset-assert 0) - (anim int32 :offset-assert 4) - (ambient-sound-spec sound-spec :offset-assert 8) + ((skel-group string) + (anim int32) + (ambient-sound-spec sound-spec) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type water-anim-look -(defmethod inspect water-anim-look ((this water-anim-look)) +(defmethod inspect ((this water-anim-look)) (when (not this) (set! this this) (goto cfg-4) @@ -508,7 +503,7 @@ ;; definition for method 22 of type water-anim ;; INFO: Used lq/sq -(defmethod move-to-point! water-anim ((this water-anim) (arg0 vector)) +(defmethod move-to-point! ((this water-anim) (arg0 vector)) "Set a [[water-anim]]'s `trans` as specified by the [[vector]] and update `water-height`." (set! (-> this root trans quad) (-> arg0 quad)) (set! (-> this water-height) (-> this root trans y)) @@ -518,13 +513,13 @@ ) ;; definition for method 23 of type water-anim -(defmethod get-ripple-height water-anim ((this water-anim) (arg0 vector)) +(defmethod get-ripple-height ((this water-anim) (arg0 vector)) (ripple-find-height this 0 arg0) ) ;; definition for method 27 of type water-anim ;; WARN: Return type mismatch symbol vs none. -(defmethod water-anim-method-27 water-anim ((this water-anim)) +(defmethod water-anim-method-27 ((this water-anim)) "Empty." (none) ) @@ -532,7 +527,7 @@ ;; definition for method 28 of type water-anim ;; INFO: Used lq/sq ;; WARN: Return type mismatch quaternion vs none. -(defmethod offset! water-anim ((this water-anim)) +(defmethod offset! ((this water-anim)) "Offset a [[water-anim]]'s `trans` and `quat` by the lump data in `entity`." (local-vars (sv-16 res-tag)) (set! (-> this play-ambient-sound?) #t) @@ -557,7 +552,7 @@ ) ;; definition for method 24 of type water-anim -(defmethod init-water! water-anim ((this water-anim)) +(defmethod init-water! ((this water-anim)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((s5-0 (-> this look))) (if (or (< s5-0 0) (>= s5-0 (-> *water-anim-look* length))) @@ -589,7 +584,7 @@ ) ;; definition for method 25 of type water-anim -(defmethod reset-root! water-anim ((this water-anim)) +(defmethod reset-root! ((this water-anim)) "Reset a [[water-anim]]'s `root`." (let ((v0-0 (new 'process 'trsqv))) (set! (-> this root) v0-0) @@ -600,7 +595,7 @@ ;; definition for method 26 of type water-anim ;; INFO: Used lq/sq ;; WARN: Return type mismatch water-flags vs none. -(defmethod water-anim-init! water-anim ((this water-anim)) +(defmethod water-anim-init! ((this water-anim)) "Initialize a [[water-anim]]." (local-vars (sv-16 res-tag)) (set! (-> this attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) @@ -685,7 +680,7 @@ ;; definition for method 11 of type water-anim ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! water-anim ((this water-anim) (arg0 entity-actor)) +(defmethod init-from-entity! ((this water-anim) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/engine/common_objs/water-flow_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water-flow_REF.gc index 63e97e6ffe9..c765b5e25c6 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water-flow_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water-flow_REF.gc @@ -14,18 +14,15 @@ ;; definition of type flow-section (deftype flow-section (structure) - ((start vector :inline :offset-assert 0) - (trailing plane :inline :offset-assert 16) - (pull-dir vector :inline :offset-assert 32) - (radial-dir vector :inline :offset-assert 48) + ((start vector :inline) + (trailing plane :inline) + (pull-dir vector :inline) + (radial-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type flow-section -(defmethod inspect flow-section ((this flow-section)) +(defmethod inspect ((this flow-section)) (when (not this) (set! this this) (goto cfg-4) @@ -41,15 +38,12 @@ ;; definition of type flow-section-array (deftype flow-section-array (inline-array-class) - ((data flow-section :inline :dynamic :offset-assert 16) + ((data flow-section :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type flow-section-array -(defmethod inspect flow-section-array ((this flow-section-array)) +(defmethod inspect ((this flow-section-array)) (when (not this) (set! this this) (goto cfg-4) @@ -67,27 +61,24 @@ ;; definition of type flow-control (deftype flow-control (basic) - ((path path-control :offset-assert 4) - (speed float :offset-assert 8) - (belt-radius float :offset-assert 12) - (sections flow-section-array :offset-assert 16) - (leading plane :inline :offset-assert 32) - (collide-bounds sphere :inline :offset-assert 48) + ((path path-control) + (speed float) + (belt-radius float) + (sections flow-section-array) + (leading plane :inline) + (collide-bounds sphere :inline) ) - :method-count-assert 13 - :size-assert #x40 - :flag-assert #xd00000040 (:methods - (new (symbol type process-drawable res-lump) _type_ 0) - (draw-path (_type_) none 9) - (setup (_type_) none 10) - (push-process (_type_ process-focusable) none 11) - (find-and-push-things (_type_) none 12) + (new (symbol type process-drawable res-lump) _type_) + (draw-path (_type_) none) + (setup (_type_) none) + (push-process (_type_ process-focusable) none) + (find-and-push-things (_type_) none) ) ) ;; definition for method 3 of type flow-control -(defmethod inspect flow-control ((this flow-control)) +(defmethod inspect ((this flow-control)) (when (not this) (set! this this) (goto cfg-4) @@ -104,7 +95,7 @@ ) ;; definition for method 7 of type flow-control -(defmethod relocate flow-control ((this flow-control) (arg0 int)) +(defmethod relocate ((this flow-control) (arg0 int)) (if (nonzero? (-> this sections)) (&+! (-> this sections) arg0) ) @@ -116,7 +107,7 @@ ;; definition for method 9 of type flow-control ;; WARN: Return type mismatch int vs none. -(defmethod draw-path flow-control ((this flow-control)) +(defmethod draw-path ((this flow-control)) (let ((a0-1 (-> this path))) (if (nonzero? a0-1) (debug-draw a0-1) @@ -130,7 +121,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 11 flow-control) has a return type of none, but the expression builder found a return statement. -(defmethod push-process flow-control ((this flow-control) (arg0 process-focusable)) +(defmethod push-process ((this flow-control) (arg0 process-focusable)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -221,7 +212,7 @@ ;; definition for method 12 of type flow-control ;; WARN: Return type mismatch int vs none. -(defmethod find-and-push-things flow-control ((this flow-control)) +(defmethod find-and-push-things ((this flow-control)) (local-vars (a0-10 float) (a2-5 float) (a2-12 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -370,7 +361,7 @@ ;; definition for method 10 of type flow-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod setup flow-control ((this flow-control)) +(defmethod setup ((this flow-control)) (local-vars (sv-32 flow-section) (sv-48 flow-section)) (let* ((s5-0 (-> this path)) (s4-0 (-> s5-0 curve num-cverts)) diff --git a/test/decompiler/reference/jak2/engine/common_objs/water-h_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water-h_REF.gc index d68b57b27c8..9d89ef57267 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water-h_REF.gc @@ -3,22 +3,19 @@ ;; definition of type water-info (deftype water-info (structure) - ((trans vector :inline :offset-assert 0) - (normal vector :inline :offset-assert 16) - (base-height meters :offset-assert 32) - (depth meters :offset-assert 36) - (handle handle :offset-assert 40) - (flags water-flags :offset-assert 48) - (prim drawable-region-prim :offset-assert 52) - (extra-flags uint32 :offset-assert 56) + ((trans vector :inline) + (normal vector :inline) + (base-height meters) + (depth meters) + (handle handle) + (flags water-flags) + (prim drawable-region-prim) + (extra-flags uint32) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) ;; definition for method 3 of type water-info -(defmethod inspect water-info ((this water-info)) +(defmethod inspect ((this water-info)) (when (not this) (set! this this) (goto cfg-68) @@ -137,64 +134,61 @@ ;; definition of type water-control (deftype water-control (basic) - ((flags water-flags :offset-assert 4) - (process target :offset-assert 8) - (joint-index int32 :offset-assert 12) - (top-y-offset float :offset-assert 16) - (attack-id uint32 :offset-assert 20) - (enter-water-time time-frame :offset-assert 24) - (wade-time time-frame :offset-assert 32) - (on-water-time time-frame :offset-assert 40) - (enter-swim-time time-frame :offset-assert 48) - (swim-time time-frame :offset-assert 56) - (base-height meters :offset-assert 64) - (wade-height meters :offset-assert 68) - (swim-height meters :offset-assert 72) - (surface-height meters :offset-assert 76) - (bottom-height meters :offset-assert 80) - (collide-height meters :offset-assert 84) - (height meters :offset-assert 88) - (height-offset float 4 :offset-assert 92) - (base-ocean-offset meters :offset 92) - (real-ocean-offset meters :offset 92) - (ocean-offset meters :offset 96) - (bob-offset meters :offset 100) - (align-offset meters :offset 104) - (swim-depth meters :offset 108) - (bob smush-control :inline :offset 112) - (ripple handle :offset 144) - (ripple-size meters :offset 152) - (wake-size meters :offset 156) - (bottom vector 2 :inline :offset 160) - (top vector 2 :inline :offset 192) - (enter-water-pos vector :inline :offset 224) - (drip-old-pos vector :inline :offset 240) - (drip-joint-index int32 :offset 256) - (drip-wetness float :offset 260) - (drip-time time-frame :offset 264) - (drip-speed float :offset 272) - (drip-height meters :offset 276) - (drip-mult float :offset 280) - (distort-time time-frame :offset 288) + ((flags water-flags) + (process target) + (joint-index int32) + (top-y-offset float) + (attack-id uint32) + (enter-water-time time-frame) + (wade-time time-frame) + (on-water-time time-frame) + (enter-swim-time time-frame) + (swim-time time-frame) + (base-height meters) + (wade-height meters) + (swim-height meters) + (surface-height meters) + (bottom-height meters) + (collide-height meters) + (height meters) + (height-offset float 4) + (base-ocean-offset meters :overlay-at (-> height-offset 0)) + (real-ocean-offset meters :overlay-at (-> height-offset 0)) + (ocean-offset meters :overlay-at (-> height-offset 1)) + (bob-offset meters :overlay-at (-> height-offset 2)) + (align-offset meters :overlay-at (-> height-offset 3)) + (swim-depth meters :offset 108) + (bob smush-control :inline :offset 112) + (ripple handle :offset 144) + (ripple-size meters :offset 152) + (wake-size meters :offset 156) + (bottom vector 2 :inline :offset 160) + (top vector 2 :inline :offset 192) + (enter-water-pos vector :inline :offset 224) + (drip-old-pos vector :inline :offset 240) + (drip-joint-index int32 :offset 256) + (drip-wetness float :offset 260) + (drip-time time-frame :offset 264) + (drip-speed float :offset 272) + (drip-height meters :offset 276) + (drip-mult float :offset 280) + (distort-time time-frame :offset 288) ) - :method-count-assert 17 - :size-assert #x128 - :flag-assert #x1100000128 (:methods - (new (symbol type process int float float float) _type_ 0) - (water-control-method-9 (_type_) none 9) - (water-control-method-10 (_type_) none 10) - (start-bobbing! (_type_ float int int) none 11) - (distance-from-surface (_type_) float 12) - (spawn-ripples (_type_ float vector int vector symbol) none 13) - (display-water-marks? (_type_) symbol 14) - (enter-water (_type_) none 15) - (water-control-method-16 (_type_) none 16) + (new (symbol type process int float float float) _type_) + (water-control-method-9 (_type_) none) + (water-control-method-10 (_type_) none) + (start-bobbing! (_type_ float int int) none) + (distance-from-surface (_type_) float) + (spawn-ripples (_type_ float vector int vector symbol) none) + (display-water-marks? (_type_) symbol) + (enter-water (_type_) none) + (water-control-method-16 (_type_) none) ) ) ;; definition for method 3 of type water-control -(defmethod inspect water-control ((this water-control)) +(defmethod inspect ((this water-control)) (when (not this) (set! this this) (goto cfg-68) @@ -343,7 +337,7 @@ ) ;; definition for method 14 of type water-control -(defmethod display-water-marks? water-control ((this water-control)) +(defmethod display-water-marks? ((this water-control)) *display-water-marks* ) @@ -371,20 +365,17 @@ ) ;; definition for method 12 of type water-control -(defmethod distance-from-surface water-control ((this water-control)) +(defmethod distance-from-surface ((this water-control)) (- (-> this top 0 y) (-> this height)) ) ;; definition of type water-vol (deftype water-vol (process-hidden) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 ) ;; definition for method 3 of type water-vol -(defmethod inspect water-vol ((this water-vol)) +(defmethod inspect ((this water-vol)) (when (not this) (set! this this) (goto cfg-68) diff --git a/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc index ae5237bb882..37dbce42a64 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc @@ -690,7 +690,7 @@ ;; definition for method 9 of type water-control ;; WARN: Return type mismatch int vs none. -(defmethod water-control-method-9 water-control ((this water-control)) +(defmethod water-control-method-9 ((this water-control)) 0 (none) ) @@ -698,7 +698,7 @@ ;; definition for method 10 of type water-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod water-control-method-10 water-control ((this water-control)) +(defmethod water-control-method-10 ((this water-control)) (local-vars (sv-272 (function vector entity-actor skeleton-group vector object none :behavior manipy)) (sv-288 vector) @@ -1168,7 +1168,7 @@ ;; definition for method 11 of type water-control ;; WARN: Return type mismatch int vs none. -(defmethod start-bobbing! water-control ((this water-control) (arg0 float) (arg1 int) (arg2 int)) +(defmethod start-bobbing! ((this water-control) (arg0 float) (arg1 int) (arg2 int)) (with-pp (activate! (-> this bob) (- arg0) arg1 arg2 0.9 1.0 (-> pp clock)) 0 @@ -1261,7 +1261,7 @@ ;; definition for method 15 of type water-control ;; WARN: Return type mismatch int vs none. -(defmethod enter-water water-control ((this water-control)) +(defmethod enter-water ((this water-control)) (with-pp (logior! (-> this flags) (water-flags touch-water)) (logclear! (-> this flags) (water-flags jump-out)) @@ -1295,7 +1295,7 @@ ;; definition for method 16 of type water-control ;; WARN: Return type mismatch int vs none. -(defmethod water-control-method-16 water-control ((this water-control)) +(defmethod water-control-method-16 ((this water-control)) (logclear! (-> this flags) (water-flags touch-water)) (set-zero! (-> this bob)) (if (logtest? (-> this flags) (water-flags tar lava)) @@ -1380,7 +1380,7 @@ ;; definition for method 13 of type water-control ;; WARN: Return type mismatch int vs none. -(defmethod spawn-ripples water-control ((this water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector) (arg4 symbol)) +(defmethod spawn-ripples ((this water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector) (arg4 symbol)) (when (and (logtest? (water-flags part-splash) (-> this flags)) (logtest? (water-flags part-water) (-> this flags))) (let ((s4-1 (vector+float*! (new 'stack-no-clear 'vector) arg1 arg3 0.05))) (set! (-> s4-1 y) (+ 40.96 (-> this surface-height))) @@ -1555,7 +1555,7 @@ ;; definition for method 52 of type collide-shape ;; INFO: Used lq/sq -(defmethod water-info-init! collide-shape ((this collide-shape) (arg0 water-info) (arg1 collide-action)) +(defmethod water-info-init! ((this collide-shape) (arg0 water-info) (arg1 collide-action)) "Initialize a [[water-info]] with the currently loaded regions." (local-vars (sv-80 int)) (let ((s3-0 (new 'stack 'water-info))) diff --git a/test/decompiler/reference/jak2/engine/data/art-h_REF.gc b/test/decompiler/reference/jak2/engine/data/art-h_REF.gc index 585a93b576e..21d6964e2bd 100644 --- a/test/decompiler/reference/jak2/engine/data/art-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/data/art-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type joint-anim (deftype joint-anim (basic) - ((name string :offset-assert 4) - (number int16 :offset-assert 8) - (length int16 :offset-assert 10) + ((name string) + (number int16) + (length int16) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type joint-anim -(defmethod inspect joint-anim ((this joint-anim)) +(defmethod inspect ((this joint-anim)) (when (not this) (set! this this) (goto cfg-4) @@ -28,24 +25,18 @@ ;; definition of type joint-anim-matrix (deftype joint-anim-matrix (joint-anim) - ((data matrix :inline :dynamic :offset 16) + ((data matrix :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition of type joint-anim-transformq (deftype joint-anim-transformq (joint-anim) - ((data transformq :inline :dynamic :offset 16) + ((data transformq :inline :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type joint-anim-transformq -(defmethod inspect joint-anim-transformq ((this joint-anim-transformq)) +(defmethod inspect ((this joint-anim-transformq)) (when (not this) (set! this this) (goto cfg-7) @@ -64,15 +55,12 @@ ;; definition of type joint-anim-drawable (deftype joint-anim-drawable (joint-anim) - ((data drawable :dynamic :offset-assert 12) + ((data drawable :dynamic) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type joint-anim-drawable -(defmethod inspect joint-anim-drawable ((this joint-anim-drawable)) +(defmethod inspect ((this joint-anim-drawable)) (when (not this) (set! this this) (goto cfg-4) @@ -88,19 +76,16 @@ ;; definition of type joint-anim-frame (deftype joint-anim-frame (structure) - ((matrices matrix 2 :inline :offset-assert 0) - (data transformq :inline :dynamic :offset-assert 128) + ((matrices matrix 2 :inline) + (data transformq :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) ;; definition for method 3 of type joint-anim-frame -(defmethod inspect joint-anim-frame ((this joint-anim-frame)) +(defmethod inspect ((this joint-anim-frame)) (when (not this) (set! this this) (goto cfg-4) @@ -125,17 +110,14 @@ ;; definition of type joint-anim-compressed-hdr (deftype joint-anim-compressed-hdr (structure) - ((control-bits uint32 14 :offset-assert 0) - (num-joints uint32 :offset-assert 56) - (matrix-bits uint32 :offset-assert 60) + ((control-bits uint32 14) + (num-joints uint32) + (matrix-bits uint32) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type joint-anim-compressed-hdr -(defmethod inspect joint-anim-compressed-hdr ((this joint-anim-compressed-hdr)) +(defmethod inspect ((this joint-anim-compressed-hdr)) (when (not this) (set! this this) (goto cfg-4) @@ -150,20 +132,17 @@ ;; definition of type joint-anim-compressed-fixed (deftype joint-anim-compressed-fixed (structure) - ((hdr joint-anim-compressed-hdr :inline :offset-assert 0) - (offset-64 uint32 :offset-assert 64) - (offset-32 uint32 :offset-assert 68) - (offset-16 uint32 :offset-assert 72) - (reserved uint32 :offset-assert 76) - (data vector 133 :inline :offset-assert 80) + ((hdr joint-anim-compressed-hdr :inline) + (offset-64 uint32) + (offset-32 uint32) + (offset-16 uint32) + (reserved uint32) + (data vector 133 :inline) ) - :method-count-assert 9 - :size-assert #x8a0 - :flag-assert #x9000008a0 ) ;; definition for method 3 of type joint-anim-compressed-fixed -(defmethod inspect joint-anim-compressed-fixed ((this joint-anim-compressed-fixed)) +(defmethod inspect ((this joint-anim-compressed-fixed)) (when (not this) (set! this this) (goto cfg-4) @@ -181,19 +160,16 @@ ;; definition of type joint-anim-compressed-frame (deftype joint-anim-compressed-frame (structure) - ((offset-64 uint32 :offset-assert 0) - (offset-32 uint32 :offset-assert 4) - (offset-16 uint32 :offset-assert 8) - (reserved uint32 :offset-assert 12) - (data vector 133 :inline :offset-assert 16) + ((offset-64 uint32) + (offset-32 uint32) + (offset-16 uint32) + (reserved uint32) + (data vector 133 :inline) ) - :method-count-assert 9 - :size-assert #x860 - :flag-assert #x900000860 ) ;; definition for method 3 of type joint-anim-compressed-frame -(defmethod inspect joint-anim-compressed-frame ((this joint-anim-compressed-frame)) +(defmethod inspect ((this joint-anim-compressed-frame)) (when (not this) (set! this this) (goto cfg-4) @@ -210,20 +186,17 @@ ;; definition of type joint-anim-compressed-control (deftype joint-anim-compressed-control (structure) - ((num-frames uint16 :offset-assert 0) - (flags uint16 :offset-assert 2) - (fixed-qwc uint32 :offset-assert 4) - (frame-qwc uint32 :offset-assert 8) - (fixed joint-anim-compressed-fixed :offset-assert 12) - (data joint-anim-compressed-frame :dynamic :offset-assert 16) + ((num-frames uint16) + (flags uint16) + (fixed-qwc uint32) + (frame-qwc uint32) + (fixed joint-anim-compressed-fixed) + (data joint-anim-compressed-frame :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type joint-anim-compressed-control -(defmethod inspect joint-anim-compressed-control ((this joint-anim-compressed-control)) +(defmethod inspect ((this joint-anim-compressed-control)) (when (not this) (set! this this) (goto cfg-4) @@ -241,23 +214,20 @@ ;; definition of type art (deftype art (basic) - ((name string :offset 8) - (length int32 :offset-assert 12) - (extra res-lump :offset-assert 16) + ((name string :offset 8) + (length int32) + (extra res-lump) ) - :method-count-assert 13 - :size-assert #x14 - :flag-assert #xd00000014 (:methods - (login (_type_) _type_ 9) - (get-art-by-name-method (_type_ string type) basic 10) - (get-art-idx-by-name-method (_type_ string type) int 11) - (needs-link? (_type_) symbol 12) + (login (_type_) _type_) + (get-art-by-name-method (_type_ string type) basic) + (get-art-idx-by-name-method (_type_ string type) int) + (needs-link? (_type_) symbol) ) ) ;; definition for method 3 of type art -(defmethod inspect art ((this art)) +(defmethod inspect ((this art)) (when (not this) (set! this this) (goto cfg-4) @@ -272,15 +242,12 @@ ;; definition of type art-element (deftype art-element (art) - ((pad uint8 12 :offset-assert 20) + ((pad uint8 12) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) ;; definition for method 3 of type art-element -(defmethod inspect art-element ((this art-element)) +(defmethod inspect ((this art-element)) (when (not this) (set! this this) (goto cfg-4) @@ -295,31 +262,25 @@ ;; definition of type art-mesh-anim (deftype art-mesh-anim (art-element) - ((data basic :dynamic :offset-assert 32) + ((data basic :dynamic) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) ;; definition of type art-joint-anim (deftype art-joint-anim (art-element) - ((speed float :offset 20) - (artist-base float :offset 24) - (artist-step float :offset 28) - (eye-anim merc-eye-anim-block :offset 4) - (master-art-group-name string :offset-assert 32) - (master-art-group-index int32 :offset-assert 36) - (blend-shape-anim (pointer int8) :offset-assert 40) - (frames joint-anim-compressed-control :offset-assert 44) + ((speed float :overlay-at (-> pad 0)) + (artist-base float :overlay-at (-> pad 4)) + (artist-step float :overlay-at (-> pad 8)) + (eye-anim merc-eye-anim-block :offset 4) + (master-art-group-name string) + (master-art-group-index int32) + (blend-shape-anim (pointer int8)) + (frames joint-anim-compressed-control) ) - :method-count-assert 13 - :size-assert #x30 - :flag-assert #xd00000030 ) ;; definition for method 3 of type art-joint-anim -(defmethod inspect art-joint-anim ((this art-joint-anim)) +(defmethod inspect ((this art-joint-anim)) (when (not this) (set! this this) (goto cfg-4) @@ -342,50 +303,38 @@ ;; definition of type art-group (deftype art-group (art) - ((info file-info :offset 4) - (data art-element :dynamic :offset 32) + ((info file-info :offset 4) + (data art-element :dynamic :offset 32) ) - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (link-art! (_type_) art-group 13) - (unlink-art! (_type_) int 14) + (relocate (_type_ kheap (pointer uint8)) none :replace) + (link-art! (_type_) art-group) + (unlink-art! (_type_) int) ) ) ;; definition of type art-mesh-geo (deftype art-mesh-geo (art-element) - ((data basic :dynamic :offset-assert 32) + ((data basic :dynamic) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) ;; definition of type art-joint-geo (deftype art-joint-geo (art-element) - ((data joint :dynamic :offset-assert 32) + ((data joint :dynamic) ) - :method-count-assert 13 - :size-assert #x20 - :flag-assert #xd00000020 ) ;; definition of type art-joint-anim-manager-slot (deftype art-joint-anim-manager-slot (structure) - ((anim art-joint-anim :offset-assert 0) - (comp-data uint32 :offset-assert 4) - (time-stamp uint64 :offset-assert 8) + ((anim art-joint-anim) + (comp-data uint32) + (time-stamp uint64) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type art-joint-anim-manager-slot -(defmethod inspect art-joint-anim-manager-slot ((this art-joint-anim-manager-slot)) +(defmethod inspect ((this art-joint-anim-manager-slot)) (when (not this) (set! this this) (goto cfg-4) @@ -400,25 +349,22 @@ ;; definition of type art-joint-anim-manager (deftype art-joint-anim-manager (basic) - ((kheap kheap :inline :offset-assert 16) - (free-index int32 :offset-assert 32) - (slot art-joint-anim-manager-slot 64 :inline :offset-assert 48) + ((kheap kheap :inline) + (free-index int32) + (slot art-joint-anim-manager-slot 64 :inline) ) - :method-count-assert 14 - :size-assert #x430 - :flag-assert #xe00000430 (:methods - (new (symbol type int) _type_ 0) - (decompress (_type_ art-joint-anim) art-joint-anim 9) - (update-time-stamp (_type_ art-joint-anim) art-joint-anim 10) - (unload-from-slot (_type_ int) art-joint-anim 11) - (used-bytes-for-slot (_type_ int) int 12) - (unload-from-level (_type_ level) none 13) + (new (symbol type int) _type_) + (decompress (_type_ art-joint-anim) art-joint-anim) + (update-time-stamp (_type_ art-joint-anim) art-joint-anim) + (unload-from-slot (_type_ int) art-joint-anim) + (used-bytes-for-slot (_type_ int) int) + (unload-from-level (_type_ level) none) ) ) ;; definition for method 3 of type art-joint-anim-manager -(defmethod inspect art-joint-anim-manager ((this art-joint-anim-manager)) +(defmethod inspect ((this art-joint-anim-manager)) (when (not this) (set! this this) (goto cfg-7) @@ -453,34 +399,31 @@ ;; definition of type skeleton-group (deftype skeleton-group (art-group) - ((art-group-name string :offset-assert 32) - (jgeo int32 :offset-assert 36) - (janim int32 :offset-assert 40) - (bounds vector :inline :offset-assert 48) - (radius meters :offset 60) - (mgeo int16 6 :offset-assert 64) - (max-lod int32 :offset-assert 76) - (lod-dist float 6 :offset-assert 80) - (longest-edge meters :offset-assert 104) - (texture-level int8 :offset-assert 108) - (version int8 :offset-assert 109) - (shadow int8 :offset-assert 110) - (sort int8 :offset-assert 111) - (origin-joint-index int8 :offset-assert 112) - (shadow-joint-index int8 :offset-assert 113) - (light-index uint8 :offset-assert 114) - (pad uint8 :offset-assert 115) + ((art-group-name string) + (jgeo int32) + (janim int32) + (bounds vector :inline) + (radius meters :overlay-at (-> bounds data 3)) + (mgeo int16 6) + (max-lod int32) + (lod-dist float 6) + (longest-edge meters) + (texture-level int8) + (version int8) + (shadow int8) + (sort int8) + (origin-joint-index int8) + (shadow-joint-index int8) + (light-index uint8) + (pad uint8) ) - :method-count-assert 16 - :size-assert #x74 - :flag-assert #x1000000074 (:methods - (add-to-loading-level (_type_) skeleton-group 15) + (add-to-loading-level (_type_) skeleton-group) ) ) ;; definition for method 3 of type skeleton-group -(defmethod inspect skeleton-group ((this skeleton-group)) +(defmethod inspect ((this skeleton-group)) (when (not this) (set! this this) (goto cfg-4) @@ -513,17 +456,14 @@ ;; definition of type lod-group (deftype lod-group (structure) - ((geo merc-ctrl :offset-assert 0) - (dist meters :offset-assert 4) + ((geo merc-ctrl) + (dist meters) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type lod-group -(defmethod inspect lod-group ((this lod-group)) +(defmethod inspect ((this lod-group)) (when (not this) (set! this this) (goto cfg-4) @@ -537,19 +477,16 @@ ;; definition of type lod-set (deftype lod-set (structure) - ((lod lod-group 6 :inline :offset-assert 0) - (max-lod int8 :offset-assert 48) + ((lod lod-group 6 :inline) + (max-lod int8) ) - :method-count-assert 10 - :size-assert #x31 - :flag-assert #xa00000031 (:methods - (setup-lods! (_type_ skeleton-group art-group entity) _type_ 9) + (setup-lods! (_type_ skeleton-group art-group entity) _type_) ) ) ;; definition for method 3 of type lod-set -(defmethod inspect lod-set ((this lod-set)) +(defmethod inspect ((this lod-set)) (when (not this) (set! this this) (goto cfg-4) @@ -563,63 +500,60 @@ ;; definition of type draw-control (deftype draw-control (basic) - ((process process-drawable :offset-assert 4) - (status draw-control-status :offset-assert 8) - (data-format draw-control-data-format :offset-assert 10) - (global-effect draw-control-global-effect :offset-assert 11) - (art-group art-group :offset-assert 12) - (jgeo art-joint-geo :offset-assert 16) - (mgeo merc-ctrl :offset-assert 20) - (dma-add-func (function process-drawable draw-control symbol object none) :offset-assert 24) - (skeleton skeleton :offset-assert 28) - (lod-set lod-set :inline :offset-assert 32) - (max-lod int8 :offset 80) - (force-lod int8 :offset-assert 81) - (cur-lod int8 :offset-assert 82) - (desired-lod int8 :offset-assert 83) - (ripple ripple-control :offset-assert 84) - (longest-edge meters :offset-assert 88) - (longest-edge? uint32 :offset 88) - (light-index uint8 :offset-assert 92) - (shadow-mask uint8 :offset-assert 93) - (level-index uint8 :offset-assert 94) - (death-draw-overlap uint8 :offset-assert 95) - (death-timer uint8 :offset-assert 96) - (death-timer-org uint8 :offset-assert 97) - (death-vertex-skip uint16 :offset-assert 98) - (death-effect uint32 :offset-assert 100) - (shadow shadow-geo :offset-assert 104) - (shadow-ctrl shadow-control :offset-assert 108) - (distance meters :offset-assert 112) - (origin vector :inline :offset-assert 128) - (bounds vector :inline :offset-assert 144) - (radius meters :offset 156) - (color-mult rgbaf :inline :offset-assert 160) - (color-emissive rgbaf :inline :offset-assert 176) - (effect-mask uint64 :offset-assert 192) - (seg-mask uint64 :offset-assert 200) - (origin-joint-index uint8 :offset-assert 208) - (shadow-joint-index uint8 :offset-assert 209) - (force-fade uint8 :offset-assert 210) - (default-texture-page uint8 :offset-assert 211) - (shadow-values uint32 :offset-assert 212) + ((process process-drawable) + (status draw-control-status) + (data-format draw-control-data-format) + (global-effect draw-control-global-effect) + (art-group art-group) + (jgeo art-joint-geo) + (mgeo merc-ctrl) + (dma-add-func (function process-drawable draw-control symbol object none)) + (skeleton skeleton) + (lod-set lod-set :inline) + (max-lod int8 :overlay-at (-> lod-set max-lod)) + (force-lod int8) + (cur-lod int8) + (desired-lod int8) + (ripple ripple-control) + (longest-edge meters) + (longest-edge? uint32 :overlay-at longest-edge) + (light-index uint8) + (shadow-mask uint8) + (level-index uint8) + (death-draw-overlap uint8) + (death-timer uint8) + (death-timer-org uint8) + (death-vertex-skip uint16) + (death-effect uint32) + (shadow shadow-geo) + (shadow-ctrl shadow-control) + (distance meters) + (origin vector :inline) + (bounds vector :inline) + (radius meters :overlay-at (-> bounds data 3)) + (color-mult rgbaf :inline) + (color-emissive rgbaf :inline) + (effect-mask uint64) + (seg-mask uint64) + (origin-joint-index uint8) + (shadow-joint-index uint8) + (force-fade uint8) + (default-texture-page uint8) + (shadow-values uint32) ) - :method-count-assert 15 - :size-assert #xd8 - :flag-assert #xf000000d8 (:methods - (new (symbol type process symbol) _type_ 0) - (get-skeleton-origin (_type_) vector 9) - (lod-set! (_type_ int) none 10) - (lods-assign! (_type_ lod-set) none 11) - (setup-masks (_type_ int int) none 12) - (setup-cspace-and-add (_type_ art-joint-geo symbol) cspace-array 13) - (do-joint-math (_type_ cspace-array joint-control) none 14) + (new (symbol type process symbol) _type_) + (get-skeleton-origin (_type_) vector) + (lod-set! (_type_ int) none) + (lods-assign! (_type_ lod-set) none) + (setup-masks (_type_ int int) none) + (setup-cspace-and-add (_type_ art-joint-geo symbol) cspace-array) + (do-joint-math (_type_ cspace-array joint-control) none) ) ) ;; definition for method 3 of type draw-control -(defmethod inspect draw-control ((this draw-control)) +(defmethod inspect ((this draw-control)) (when (not this) (set! this this) (goto cfg-47) @@ -752,7 +686,7 @@ ) ;; definition for method 9 of type draw-control -(defmethod get-skeleton-origin draw-control ((this draw-control)) +(defmethod get-skeleton-origin ((this draw-control)) (-> this skeleton bones 0 transform trans) ) diff --git a/test/decompiler/reference/jak2/engine/debug/debug-h_REF.gc b/test/decompiler/reference/jak2/engine/debug/debug-h_REF.gc index 400cf82018b..c3d6cb73b50 100644 --- a/test/decompiler/reference/jak2/engine/debug/debug-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/debug-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type pos-history (deftype pos-history (structure) - ((points (inline-array vector) :offset-assert 0) - (num-points int32 :offset-assert 4) - (h-first int32 :offset-assert 8) - (h-last int32 :offset-assert 12) + ((points (inline-array vector)) + (num-points int32) + (h-first int32) + (h-last int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type pos-history -(defmethod inspect pos-history ((this pos-history)) +(defmethod inspect ((this pos-history)) (when (not this) (set! this this) (goto cfg-4) @@ -30,18 +27,15 @@ ;; definition of type debug-vertex (deftype debug-vertex (structure) - ((trans vector4w :inline :offset-assert 0) - (normal vector3h :inline :offset-assert 16) - (st vector2h :inline :offset-assert 22) - (color uint32 :offset-assert 28) + ((trans vector4w :inline) + (normal vector3h :inline) + (st vector2h :inline) + (color uint32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type debug-vertex -(defmethod inspect debug-vertex ((this debug-vertex)) +(defmethod inspect ((this debug-vertex)) (when (not this) (set! this this) (goto cfg-4) @@ -57,17 +51,14 @@ ;; definition of type debug-vertex-stats (deftype debug-vertex-stats (basic) - ((length int32 :offset-assert 4) - (pos-count int32 :offset-assert 8) - (vertex debug-vertex 600 :inline :offset-assert 16) + ((length int32) + (pos-count int32) + (vertex debug-vertex 600 :inline) ) - :method-count-assert 9 - :size-assert #x4b10 - :flag-assert #x900004b10 ) ;; definition for method 3 of type debug-vertex-stats -(defmethod inspect debug-vertex-stats ((this debug-vertex-stats)) +(defmethod inspect ((this debug-vertex-stats)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc index 1d59354aff5..18acf237a5c 100644 --- a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc @@ -447,21 +447,18 @@ (when *debug-segment* ;; definition of type debug-line (deftype debug-line (structure) - ((flags int32 :offset-assert 0) - (bucket bucket-id :offset-assert 4) - (v1 vector :inline :offset-assert 16) - (v2 vector :inline :offset-assert 32) - (color rgba :offset-assert 48) - (mode symbol :offset-assert 52) - (color2 rgba :offset-assert 56) + ((flags int32) + (bucket bucket-id) + (v1 vector :inline) + (v2 vector :inline) + (color rgba) + (mode symbol) + (color2 rgba) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) ;; definition for method 3 of type debug-line -(defmethod inspect debug-line ((this debug-line)) +(defmethod inspect ((this debug-line)) (when (not this) (set! this this) (goto cfg-4) @@ -480,20 +477,17 @@ ;; definition of type debug-text-3d (deftype debug-text-3d (structure) - ((flags int32 :offset-assert 0) - (bucket bucket-id :offset-assert 4) - (pos vector :inline :offset-assert 16) - (color font-color :offset-assert 32) - (offset vector2h :inline :offset-assert 36) - (str string :offset-assert 40) + ((flags int32) + (bucket bucket-id) + (pos vector :inline) + (color font-color) + (offset vector2h :inline) + (str string) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type debug-text-3d -(defmethod inspect debug-text-3d ((this debug-text-3d)) +(defmethod inspect ((this debug-text-3d)) (when (not this) (set! this this) (goto cfg-4) @@ -511,16 +505,13 @@ ;; definition of type debug-tracking-thang (deftype debug-tracking-thang (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) + ((length int32) + (allocated-length int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type debug-tracking-thang -(defmethod inspect debug-tracking-thang ((this debug-tracking-thang)) +(defmethod inspect ((this debug-tracking-thang)) (when (not this) (set! this this) (goto cfg-4) @@ -1605,7 +1596,7 @@ ) ;; definition for method 3 of type debug-vertex-stats -(defmethod inspect debug-vertex-stats ((this debug-vertex-stats)) +(defmethod inspect ((this debug-vertex-stats)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tpos-count: ~D~%" (-> this pos-count)) diff --git a/test/decompiler/reference/jak2/engine/debug/editable-h_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable-h_REF.gc index e045557ba6d..e9ef34fb6c0 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable-h_REF.gc @@ -246,30 +246,27 @@ ;; definition of type editable-region (deftype editable-region (basic) - ((changed symbol :offset-assert 4) - (locked symbol :offset-assert 8) - (id uint64 :offset-assert 16) - (filter editable-filter :offset-assert 24) - (tree symbol :offset-assert 28) - (level string :offset-assert 32) - (on-enter string :offset-assert 36) - (on-inside string :offset-assert 40) - (on-exit string :offset-assert 44) + ((changed symbol) + (locked symbol) + (id uint64) + (filter editable-filter) + (tree symbol) + (level string) + (on-enter string) + (on-inside string) + (on-exit string) ) - :method-count-assert 13 - :size-assert #x30 - :flag-assert #xd00000030 (:methods - (new (symbol type) _type_ 0) - (editable-region-method-9 (_type_ editable-array int int) symbol 9) - (editable-region-method-10 (_type_ int) symbol 10) - (editable-region-method-11 (_type_ vector int) none 11) - (editable-region-method-12 (_type_) editable-filter 12) + (new (symbol type) _type_) + (editable-region-method-9 (_type_ editable-array int int) symbol) + (editable-region-method-10 (_type_ int) symbol) + (editable-region-method-11 (_type_ vector int) none) + (editable-region-method-12 (_type_) editable-filter) ) ) ;; definition for method 3 of type editable-region -(defmethod inspect editable-region ((this editable-region)) +(defmethod inspect ((this editable-region)) (when (not this) (set! this this) (goto cfg-4) @@ -290,42 +287,39 @@ ;; definition of type editable (deftype editable (basic) - ((flags editable-flag :offset-assert 4) - (name string :offset-assert 8) - (id uint32 :offset-assert 12) - (region editable-region :offset-assert 16) - (owner pair :offset-assert 20) + ((flags editable-flag) + (name string) + (id uint32) + (region editable-region) + (owner pair) ) - :method-count-assert 30 - :size-assert #x18 - :flag-assert #x1e00000018 (:methods - (get-color (_type_ int) rgba 9) - (editable-method-10 (_type_) none 10) - (editable-method-11 (_type_ vector) symbol 11) - (select-editable! (_type_ symbol) none 12) - (edit-get-distance (_type_ vector) float 13) - (edit-get-trans (_type_) vector 14) - (editable-method-15 (_type_ vector int) none 15) - (edit-coord! (_type_ vector editable-flag) none 16) - (editable-method-17 (_type_ vector) none 17) - (editable-method-18 (_type_ vector matrix) none 18) - (editable-method-19 (_type_ vector) none 19) - (editable-method-20 (_type_ vector vector vector vector) none 20) - (editable-method-21 (_type_ editable-region) none 21) - (editable-method-22 (_type_ editable-array int int) symbol 22) - (editable-method-23 (_type_) symbol 23) - (editable-method-24 (_type_) none 24) - (editable-method-25 (_type_ editable-array) none 25) - (editable-method-26 (_type_ editable editable-array) none 26) - (editable-method-27 (_type_ editable-array) editable 27) - (editable-method-28 (_type_ editable-filter) none 28) - (editable-method-29 (_type_ editable-filter) symbol 29) + (get-color (_type_ int) rgba) + (editable-method-10 (_type_) none) + (editable-method-11 (_type_ vector) symbol) + (select-editable! (_type_ symbol) none) + (edit-get-distance (_type_ vector) float) + (edit-get-trans (_type_) vector) + (editable-method-15 (_type_ vector int) none) + (edit-coord! (_type_ vector editable-flag) none) + (editable-method-17 (_type_ vector) none) + (editable-method-18 (_type_ vector matrix) none) + (editable-method-19 (_type_ vector) none) + (editable-method-20 (_type_ vector vector vector vector) none) + (editable-method-21 (_type_ editable-region) none) + (editable-method-22 (_type_ editable-array int int) symbol) + (editable-method-23 (_type_) symbol) + (editable-method-24 (_type_) none) + (editable-method-25 (_type_ editable-array) none) + (editable-method-26 (_type_ editable editable-array) none) + (editable-method-27 (_type_ editable-array) editable) + (editable-method-28 (_type_ editable-filter) none) + (editable-method-29 (_type_ editable-filter) symbol) ) ) ;; definition for method 3 of type editable -(defmethod inspect editable ((this editable)) +(defmethod inspect ((this editable)) (when (not this) (set! this this) (goto cfg-28) @@ -381,47 +375,44 @@ ;; definition of type editable-array (deftype editable-array (basic) - ((allocated-length int32 :offset-assert 4) - (length int32 :offset-assert 8) - (region editable-region :offset-assert 12) - (backup-region editable-region :offset-assert 16) - (region-lock? symbol :offset-assert 20) - (move-lock? symbol :offset-assert 24) - (move-speed float :offset-assert 28) - (selection (array editable) :offset-assert 32) - (filter editable-filter 2 :offset-assert 36) - (target editable :offset-assert 44) - (target-mode editable-command :offset-assert 48) - (target-command editable-command :offset-assert 52) - (target-message string :offset-assert 56) - (edit-plane editable-plane :offset-assert 60) - (edit-plane-center vector :inline :offset-assert 64) - (edit-plane-normal vector :inline :offset-assert 80) - (level-offset vector :inline :offset-assert 96) - (level-info-id uint32 :offset-assert 112) - (level uint32 :offset-assert 116) - (edit-param0 float :offset-assert 120) - (data editable :dynamic :offset-assert 124) + ((allocated-length int32) + (length int32) + (region editable-region) + (backup-region editable-region) + (region-lock? symbol) + (move-lock? symbol) + (move-speed float) + (selection (array editable)) + (filter editable-filter 2) + (target editable) + (target-mode editable-command) + (target-command editable-command) + (target-message string) + (edit-plane editable-plane) + (edit-plane-center vector :inline) + (edit-plane-normal vector :inline) + (level-offset vector :inline) + (level-info-id uint32) + (level uint32) + (edit-param0 float) + (data editable :dynamic) ) - :method-count-assert 18 - :size-assert #x7c - :flag-assert #x120000007c (:methods - (new (symbol type int) _type_ 0) - (editable-array-method-9 (_type_ editable-command mouse-info) symbol :behavior editable-player 9) - (editable-array-method-10 (_type_ vector int) editable 10) - (editable-array-method-11 (_type_) int 11) - (editable-array-method-12 (_type_ editable-array) none 12) - (editable-array-method-13 (_type_ editable-command editable-command string) none 13) - (editable-array-method-14 (_type_ (function editable editable-region symbol) editable-region) (array editable) 14) - (editable-array-method-15 (_type_ editable) none 15) - (editable-array-method-16 (_type_) none 16) - (editable-array-method-17 (_type_ vector vector) vector 17) + (new (symbol type int) _type_) + (editable-array-method-9 (_type_ editable-command mouse-info) symbol :behavior editable-player) + (editable-array-method-10 (_type_ vector int) editable) + (editable-array-method-11 (_type_) int) + (editable-array-method-12 (_type_ editable-array) none) + (editable-array-method-13 (_type_ editable-command editable-command string) none) + (editable-array-method-14 (_type_ (function editable editable-region symbol) editable-region) (array editable)) + (editable-array-method-15 (_type_ editable) none) + (editable-array-method-16 (_type_) none) + (editable-array-method-17 (_type_ vector vector) vector) ) ) ;; definition for method 3 of type editable-array -(defmethod inspect editable-array ((this editable-array)) +(defmethod inspect ((this editable-array)) (when (not this) (set! this this) (goto cfg-7) @@ -497,19 +488,16 @@ ;; definition of type editable-point (deftype editable-point (editable) - ((radius float :offset-assert 24) - (trans vector :inline :offset-assert 32) + ((radius float) + (trans vector :inline) ) - :method-count-assert 30 - :size-assert #x30 - :flag-assert #x1e00000030 (:methods - (new (symbol type vector editable-region) _type_ 0) + (new (symbol type vector editable-region) _type_) ) ) ;; definition for method 3 of type editable-point -(defmethod inspect editable-point ((this editable-point)) +(defmethod inspect ((this editable-point)) (when (not this) (set! this this) (goto cfg-28) @@ -591,16 +579,13 @@ ;; definition of type editable-sphere (deftype editable-sphere (editable-point) () - :method-count-assert 30 - :size-assert #x30 - :flag-assert #x1e00000030 (:methods - (new (symbol type vector float editable-region) _type_ 0) + (new (symbol type vector float editable-region) _type_) ) ) ;; definition for method 3 of type editable-sphere -(defmethod inspect editable-sphere ((this editable-sphere)) +(defmethod inspect ((this editable-sphere)) (when (not this) (set! this this) (goto cfg-28) @@ -682,13 +667,10 @@ ;; definition of type editable-sample (deftype editable-sample (editable-point) () - :method-count-assert 30 - :size-assert #x30 - :flag-assert #x1e00000030 ) ;; definition for method 3 of type editable-sample -(defmethod inspect editable-sample ((this editable-sample)) +(defmethod inspect ((this editable-sample)) (when (not this) (set! this this) (goto cfg-28) @@ -746,22 +728,19 @@ ;; definition of type editable-light (deftype editable-light (editable-sphere) - ((direction vector :inline :offset-assert 48) - (color vector :inline :offset-assert 64) - (decay-start float :offset-assert 80) - (ambient-point-ratio float :offset-assert 84) - (brightness float :offset-assert 88) + ((direction vector :inline) + (color vector :inline) + (decay-start float) + (ambient-point-ratio float) + (brightness float) ) - :method-count-assert 30 - :size-assert #x5c - :flag-assert #x1e0000005c (:methods - (new (symbol type vector float editable-region) _type_ 0) + (new (symbol type vector float editable-region) _type_) ) ) ;; definition for method 3 of type editable-light -(defmethod inspect editable-light ((this editable-light)) +(defmethod inspect ((this editable-light)) (when (not this) (set! this this) (goto cfg-28) @@ -857,13 +836,10 @@ ;; definition of type editable-entity (deftype editable-entity (editable-point) () - :method-count-assert 30 - :size-assert #x30 - :flag-assert #x1e00000030 ) ;; definition for method 3 of type editable-entity -(defmethod inspect editable-entity ((this editable-entity)) +(defmethod inspect ((this editable-entity)) (when (not this) (set! this this) (goto cfg-28) @@ -921,23 +897,20 @@ ;; definition of type editable-face (deftype editable-face (editable) - ((length int32 :offset-assert 24) - (normal vector :inline :offset-assert 32) - (center vector :inline :offset-assert 48) - (vertex editable-point 6 :offset-assert 64) + ((length int32) + (normal vector :inline) + (center vector :inline) + (vertex editable-point 6) ) - :method-count-assert 32 - :size-assert #x58 - :flag-assert #x2000000058 (:methods - (new (symbol type editable-region) _type_ 0) - (editable-face-method-30 (_type_ (inline-array vector)) int 30) - (editable-face-method-31 (_type_ vector) vector 31) + (new (symbol type editable-region) _type_) + (editable-face-method-30 (_type_ (inline-array vector)) int) + (editable-face-method-31 (_type_ vector) vector) ) ) ;; definition for method 3 of type editable-face -(defmethod inspect editable-face ((this editable-face)) +(defmethod inspect ((this editable-face)) (when (not this) (set! this this) (goto cfg-31) @@ -1020,22 +993,19 @@ ;; definition of type editable-plane (deftype editable-plane (editable) - ((length int32 :offset-assert 24) - (radius float :offset-assert 28) - (vertex editable-point 2 :offset-assert 32) + ((length int32) + (radius float) + (vertex editable-point 2) ) - :method-count-assert 32 - :size-assert #x28 - :flag-assert #x2000000028 (:methods - (new (symbol type editable-region) _type_ 0) - (editable-plane-method-30 (_type_ (inline-array vector)) int 30) - (editable-plane-method-31 (_type_ vector) vector 31) + (new (symbol type editable-region) _type_) + (editable-plane-method-30 (_type_ (inline-array vector)) int) + (editable-plane-method-31 (_type_ vector) vector) ) ) ;; definition for method 3 of type editable-plane -(defmethod inspect editable-plane ((this editable-plane)) +(defmethod inspect ((this editable-plane)) (when (not this) (set! this this) (goto cfg-31) @@ -1118,28 +1088,26 @@ ;; definition of type editable-player (deftype editable-player (process-drawable) - ((current editable-array :offset-assert 200) - (select-command function :offset-assert 204) - (move-command function :offset-assert 208) - (extra-command function :offset-assert 212) - (left-handed basic :offset-assert 216) - (light-names basic :offset-assert 220) - (external-cam-mode symbol :offset-assert 224) - (command editable-command 6 :offset-assert 228) - (close-menu-time time-frame :offset-assert 256) + ((current editable-array) + (select-command function) + (move-command function) + (extra-command function) + (left-handed basic) + (light-names basic) + (external-cam-mode symbol) + (command editable-command 6) + (close-menu-time time-frame) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x108 - :flag-assert #x1600900108 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (editable-player-method-21 (_type_) none 21) + (editable-player-method-21 (_type_) none) ) ) ;; definition for method 3 of type editable-player -(defmethod inspect editable-player ((this editable-player)) +(defmethod inspect ((this editable-player)) (when (not this) (set! this this) (goto cfg-4) @@ -1162,20 +1130,17 @@ ;; definition of type editable-work (deftype editable-work (basic) - ((num-found int16 :offset-assert 4) - (last-found int16 :offset-assert 6) - (last-x float :offset-assert 8) - (last-y float :offset-assert 12) - (found editable 256 :offset-assert 16) - (dists uint32 256 :offset-assert 1040) + ((num-found int16) + (last-found int16) + (last-x float) + (last-y float) + (found editable 256) + (dists uint32 256) ) - :method-count-assert 9 - :size-assert #x810 - :flag-assert #x900000810 ) ;; definition for method 3 of type editable-work -(defmethod inspect editable-work ((this editable-work)) +(defmethod inspect ((this editable-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc index 83d48e6e8b2..6a1d1e1ae12 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc @@ -1110,7 +1110,7 @@ ) ;; definition for method 9 of type editable-array -(defmethod editable-array-method-9 editable-array ((this editable-array) (arg0 editable-command) (arg1 mouse-info)) +(defmethod editable-array-method-9 ((this editable-array) (arg0 editable-command) (arg1 mouse-info)) (if (execute-select this arg0 arg1) (return #f) ) @@ -1424,7 +1424,7 @@ ) ;; definition for method 10 of type editable-player -(defmethod deactivate editable-player ((this editable-player)) +(defmethod deactivate ((this editable-player)) (dotimes (v1-0 (-> *level* length)) (let ((a1-3 (-> *level* level v1-0))) (if (= (-> a1-3 status) 'active) @@ -1440,7 +1440,7 @@ ;; definition for method 7 of type editable-player ;; WARN: Return type mismatch process-drawable vs editable-player. -(defmethod relocate editable-player ((this editable-player) (arg0 int)) +(defmethod relocate ((this editable-player) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -1461,7 +1461,7 @@ ;; definition for method 21 of type editable-player ;; WARN: Return type mismatch int vs none. -(defmethod editable-player-method-21 editable-player ((this editable-player)) +(defmethod editable-player-method-21 ((this editable-player)) (set! *display-region-marks* #f) (let* ((s5-0 (-> this current length)) (s4-0 0) diff --git a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc index ae820bda629..47d4ea02f7a 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc @@ -26,14 +26,14 @@ ) ;; definition for method 2 of type editable-region -(defmethod print editable-region ((this editable-region)) +(defmethod print ((this editable-region)) (format #t "#<~A region-~D ~A ~A @ #x~X>" (-> this type) (-> this id) (-> this level) (-> this tree) this) this ) ;; definition for method 10 of type editable-region ;; INFO: Used lq/sq -(defmethod editable-region-method-10 editable-region ((this editable-region) (arg0 int)) +(defmethod editable-region-method-10 ((this editable-region) (arg0 int)) (local-vars (sv-16 string) (sv-32 string)) (when (nonzero? (-> this id)) (let ((s5-0 (clear *temp-string*))) @@ -111,7 +111,7 @@ ) ;; definition for method 9 of type editable-region -(defmethod editable-region-method-9 editable-region ((this editable-region) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-region-method-9 ((this editable-region) (arg0 editable-array) (arg1 int) (arg2 int)) (local-vars (v0-0 symbol) (v1-5 object) (v1-28 object)) (set! v0-0 (when (-> this changed) @@ -302,7 +302,7 @@ ;; definition for method 11 of type editable-region ;; WARN: Return type mismatch int vs none. -(defmethod editable-region-method-11 editable-region ((this editable-region) (arg0 vector) (arg1 int)) +(defmethod editable-region-method-11 ((this editable-region) (arg0 vector) (arg1 int)) (local-vars (sv-32 vector2h)) (set! sv-32 (new 'stack 'vector2h)) (add-debug-x #t (bucket-id debug-no-zbuf1) arg0 (new 'static 'rgba :r #xff :g #xff :a #x80)) @@ -358,7 +358,7 @@ ;; definition for method 12 of type editable-region ;; WARN: Return type mismatch int vs editable-filter. -(defmethod editable-region-method-12 editable-region ((this editable-region)) +(defmethod editable-region-method-12 ((this editable-region)) (let* ((s5-0 0) (s4-0 (lambda ((arg0 string)) (let ((gp-0 0)) (when (not (type? arg0 string)) @@ -425,13 +425,13 @@ ) ;; definition for method 23 of type editable -(defmethod editable-method-23 editable ((this editable)) +(defmethod editable-method-23 ((this editable)) #t ) ;; definition for method 28 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-28 editable ((this editable) (arg0 editable-filter)) +(defmethod editable-method-28 ((this editable) (arg0 editable-filter)) (let* ((s5-0 (-> this owner)) (a0-1 (car s5-0)) ) @@ -447,7 +447,7 @@ ;; definition for method 29 of type editable ;; WARN: Return type mismatch int vs symbol. -(defmethod editable-method-29 editable ((this editable) (arg0 editable-filter)) +(defmethod editable-method-29 ((this editable) (arg0 editable-filter)) (let* ((s5-0 (-> this owner)) (a0-1 (car s5-0)) ) @@ -462,7 +462,7 @@ ;; definition for method 21 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-21 editable ((this editable) (arg0 editable-region)) +(defmethod editable-method-21 ((this editable) (arg0 editable-region)) (when (not (and (-> this region) (-> this region locked))) (if arg0 (set! (-> arg0 changed) #t) @@ -479,7 +479,7 @@ ;; definition for method 9 of type editable ;; WARN: Return type mismatch int vs rgba. -(defmethod get-color editable ((this editable) (arg0 int)) +(defmethod get-color ((this editable) (arg0 int)) "Returns the [[rgba]] that corresponds to the type of [[editable]] TODO - document the colors" (the-as rgba (cond ((and (logtest? (-> this flags) (editable-flag selected)) @@ -511,7 +511,7 @@ ;; definition for method 10 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-10 editable ((this editable)) +(defmethod editable-method-10 ((this editable)) (when (logtest? (-> this flags) (editable-flag selected)) (let ((s5-0 (new 'stack-no-clear 'vector))) (when (editable-method-11 this s5-0) @@ -527,7 +527,7 @@ ;; definition for method 12 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod select-editable! editable ((this editable) (arg0 symbol)) +(defmethod select-editable! ((this editable) (arg0 symbol)) (case arg0 (('toggle) (logxor! (-> this flags) (editable-flag selected)) @@ -544,14 +544,14 @@ ) ;; definition for method 13 of type editable -(defmethod edit-get-distance editable ((this editable) (arg0 vector)) +(defmethod edit-get-distance ((this editable) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" -1.0 ) ;; definition for method 20 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-20 editable ((this editable) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod editable-method-20 ((this editable) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (local-vars (sv-48 vector) (sv-52 vector)) (set! sv-48 (new 'stack-no-clear 'vector)) (set! sv-52 (new 'stack-no-clear 'vector)) @@ -571,7 +571,7 @@ ;; definition for method 11 of type editable ;; INFO: Used lq/sq -(defmethod editable-method-11 editable ((this editable) (arg0 vector)) +(defmethod editable-method-11 ((this editable) (arg0 vector)) (with-pp (let ((s5-0 (new 'stack 'collide-query))) (set! (-> s5-0 start-pos quad) (-> (edit-get-trans this) quad)) @@ -596,67 +596,67 @@ ;; definition for method 24 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-24 editable ((this editable)) +(defmethod editable-method-24 ((this editable)) 0 (none) ) ;; definition for method 17 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-17 editable ((this editable) (arg0 vector)) +(defmethod editable-method-17 ((this editable) (arg0 vector)) 0 (none) ) ;; definition for method 22 of type editable -(defmethod editable-method-22 editable ((this editable) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable) (arg0 editable-array) (arg1 int) (arg2 int)) #t ) ;; definition for method 15 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-15 editable ((this editable) (arg0 vector) (arg1 int)) +(defmethod editable-method-15 ((this editable) (arg0 vector) (arg1 int)) 0 (none) ) ;; definition for method 16 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod edit-coord! editable ((this editable) (arg0 vector) (arg1 editable-flag)) +(defmethod edit-coord! ((this editable) (arg0 vector) (arg1 editable-flag)) 0 (none) ) ;; definition for method 18 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-18 editable ((this editable) (arg0 vector) (arg1 matrix)) +(defmethod editable-method-18 ((this editable) (arg0 vector) (arg1 matrix)) 0 (none) ) ;; definition for method 14 of type editable -(defmethod edit-get-trans editable ((this editable)) +(defmethod edit-get-trans ((this editable)) "Returns the `trans` [[vector]] or [[*null-vector*]]" *null-vector* ) ;; definition for method 19 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-19 editable ((this editable) (arg0 vector)) +(defmethod editable-method-19 ((this editable) (arg0 vector)) 0 (none) ) ;; definition for method 26 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-26 editable ((this editable) (arg0 editable) (arg1 editable-array)) +(defmethod editable-method-26 ((this editable) (arg0 editable) (arg1 editable-array)) 0 (none) ) ;; definition for method 25 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-25 editable ((this editable) (arg0 editable-array)) +(defmethod editable-method-25 ((this editable) (arg0 editable-array)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -677,7 +677,7 @@ ) ;; definition for method 27 of type editable -(defmethod editable-method-27 editable ((this editable) (arg0 editable-array)) +(defmethod editable-method-27 ((this editable) (arg0 editable-array)) (local-vars (s4-0 editable)) (let ((v1-0 0)) (while (< v1-0 (-> arg0 selection length)) @@ -719,7 +719,7 @@ ) ;; definition for method 2 of type editable-point -(defmethod print editable-point ((this editable-point)) +(defmethod print ((this editable-point)) (format #t "#<~A~S~m ~m ~m :r ~m" @@ -740,7 +740,7 @@ ;; definition for method 28 of type editable-point ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 28 editable-point) has a return type of none, but the expression builder found a return statement. -(defmethod editable-method-28 editable-point ((this editable-point) (arg0 editable-filter)) +(defmethod editable-method-28 ((this editable-point) (arg0 editable-filter)) (if (logtest? arg0 (editable-filter water-command)) (return #f) ) @@ -783,7 +783,7 @@ ;; definition for method 15 of type editable-point ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-15 editable-point ((this editable-point) (arg0 vector) (arg1 int)) +(defmethod editable-method-15 ((this editable-point) (arg0 vector) (arg1 int)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -798,7 +798,7 @@ ;; definition for method 16 of type editable-point ;; WARN: Return type mismatch int vs none. -(defmethod edit-coord! editable-point ((this editable-point) (arg0 vector) (arg1 editable-flag)) +(defmethod edit-coord! ((this editable-point) (arg0 vector) (arg1 editable-flag)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -820,14 +820,14 @@ ) ;; definition for method 14 of type editable-point -(defmethod edit-get-trans editable-point ((this editable-point)) +(defmethod edit-get-trans ((this editable-point)) "Returns the `trans` [[vector]] or [[*null-vector*]]" (-> this trans) ) ;; definition for method 18 of type editable-point ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-18 editable-point ((this editable-point) (arg0 vector) (arg1 matrix)) +(defmethod editable-method-18 ((this editable-point) (arg0 vector) (arg1 matrix)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -843,7 +843,7 @@ ) ;; definition for method 10 of type editable-point -(defmethod editable-method-10 editable-point ((this editable-point)) +(defmethod editable-method-10 ((this editable-point)) (let* ((s5-0 vector-vector-distance) (a0-1 (math-camera-pos)) (a1-0 (-> this trans)) @@ -881,7 +881,7 @@ ;; definition for method 13 of type editable-point ;; INFO: Used lq/sq -(defmethod edit-get-distance editable-point ((this editable-point) (arg0 vector)) +(defmethod edit-get-distance ((this editable-point) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" (let ((a0-1 (new 'stack-no-clear 'sphere)) (s5-0 (new 'stack-no-clear 'vector)) @@ -902,7 +902,7 @@ ;; definition for method 19 of type editable-point ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-19 editable-point ((this editable-point) (arg0 vector)) +(defmethod editable-method-19 ((this editable-point) (arg0 vector)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -918,7 +918,7 @@ ) ;; definition for method 22 of type editable-point -(defmethod editable-method-22 editable-point ((this editable-point) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable-point) (arg0 editable-array) (arg1 int) (arg2 int)) (case arg1 ((2) (let ((s3-0 (clear *temp-string*))) @@ -946,7 +946,7 @@ ;; definition for method 17 of type editable-sphere ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-17 editable-sphere ((this editable-sphere) (arg0 vector)) +(defmethod editable-method-17 ((this editable-sphere) (arg0 vector)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -966,7 +966,7 @@ ) ;; definition for method 22 of type editable-sphere -(defmethod editable-method-22 editable-sphere ((this editable-sphere) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable-sphere) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((gp-0 (clear *temp-string*))) (format gp-0 @@ -982,7 +982,7 @@ ) ;; definition for method 22 of type editable-sample -(defmethod editable-method-22 editable-sample ((this editable-sample) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable-sample) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((s5-0 (clear *temp-string*))) (format s5-0 @@ -1002,7 +1002,7 @@ ) ;; definition for method 2 of type editable-light -(defmethod print editable-light ((this editable-light)) +(defmethod print ((this editable-light)) (format #t "#<~A~S ~S ~m ~m ~m" @@ -1022,7 +1022,7 @@ ;; definition for method 23 of type editable-light ;; INFO: Used lq/sq -(defmethod editable-method-23 editable-light ((this editable-light)) +(defmethod editable-method-23 ((this editable-light)) (let ((v1-0 *light-hash*)) (let* ((a2-0 (-> v1-0 num-lights)) (a1-1 (-> v1-0 light-sphere-array a2-0)) @@ -1064,7 +1064,7 @@ ;; definition for method 17 of type editable-light ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-17 editable-light ((this editable-light) (arg0 vector)) +(defmethod editable-method-17 ((this editable-light) (arg0 vector)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -1086,7 +1086,7 @@ ;; definition for method 15 of type editable-light ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-15 editable-light ((this editable-light) (arg0 vector) (arg1 int)) +(defmethod editable-method-15 ((this editable-light) (arg0 vector) (arg1 int)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -1103,7 +1103,7 @@ ;; definition for method 25 of type editable-light ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 25 editable-light) has a return type of none, but the expression builder found a return statement. -(defmethod editable-method-25 editable-light ((this editable-light) (arg0 editable-array)) +(defmethod editable-method-25 ((this editable-light) (arg0 editable-array)) (call-parent-method this arg0) (when (nonzero? (-> this id)) (let ((s5-1 (clear *temp-string*))) @@ -1121,7 +1121,7 @@ ) ;; definition for method 22 of type editable-light -(defmethod editable-method-22 editable-light ((this editable-light) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable-light) (arg0 editable-array) (arg1 int) (arg2 int)) (cond ((logtest? (-> this flags) (editable-flag changed)) (let ((s5-0 (clear *temp-string*))) @@ -1195,7 +1195,7 @@ ) ;; definition for method 10 of type editable-light -(defmethod editable-method-10 editable-light ((this editable-light)) +(defmethod editable-method-10 ((this editable-light)) (if (!= (-> this direction w) 0.0) (add-debug-vector #t @@ -1221,7 +1221,7 @@ ;; definition for method 14 of type editable-face ;; INFO: Used lq/sq -(defmethod edit-get-trans editable-face ((this editable-face)) +(defmethod edit-get-trans ((this editable-face)) "Returns the `trans` [[vector]] or [[*null-vector*]]" "The center of the obj." (cond @@ -1249,7 +1249,7 @@ ) ;; definition for method 22 of type editable-face -(defmethod editable-method-22 editable-face ((this editable-face) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable-face) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((s4-0 (clear *temp-string*))) (format s4-0 "insert into region_face set kind='face',region_id=~D" (-> this region id)) (if (logtest? (-> this flags) (editable-flag orient)) @@ -1269,7 +1269,7 @@ ) ;; definition for method 25 of type editable-face -(defmethod editable-method-25 editable-face ((this editable-face) (arg0 editable-array)) +(defmethod editable-method-25 ((this editable-face) (arg0 editable-array)) (dotimes (s4-0 (-> this length)) (let ((s3-0 (-> this vertex s4-0))) (set! (-> s3-0 owner) (delete! this (-> s3-0 owner))) @@ -1280,7 +1280,7 @@ ) ;; definition for method 26 of type editable-face -(defmethod editable-method-26 editable-face ((this editable-face) (arg0 editable) (arg1 editable-array)) +(defmethod editable-method-26 ((this editable-face) (arg0 editable) (arg1 editable-array)) (-> this length) (countdown (v1-1 (-> this length)) (when (= (-> this vertex v1-1) arg0) @@ -1304,7 +1304,7 @@ ;; definition for method 27 of type editable-face ;; WARN: Return type mismatch editable-face vs editable. -(defmethod editable-method-27 editable-face ((this editable-face) (arg0 editable-array)) +(defmethod editable-method-27 ((this editable-face) (arg0 editable-array)) (let ((gp-1 (the-as editable-face (call-parent-method this arg0)))) (dotimes (s4-0 (-> gp-1 length)) (set! (-> gp-1 vertex s4-0) (the-as editable-point (editable-method-27 (-> gp-1 vertex s4-0) arg0))) @@ -1316,7 +1316,7 @@ ;; definition for method 24 of type editable-face ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-24 editable-face ((this editable-face)) +(defmethod editable-method-24 ((this editable-face)) (logxor! (-> this flags) (editable-flag orient)) (editable-face-method-31 this (-> this normal)) (logior! (-> this flags) (editable-flag changed)) @@ -1327,7 +1327,7 @@ ;; definition for method 30 of type editable-face ;; INFO: Used lq/sq -(defmethod editable-face-method-30 editable-face ((this editable-face) (arg0 (inline-array vector))) +(defmethod editable-face-method-30 ((this editable-face) (arg0 (inline-array vector))) (let ((v1-0 (-> this length))) (cond ((or (zero? v1-0) (= v1-0 1)) @@ -1358,7 +1358,7 @@ ;; definition for method 31 of type editable-face ;; INFO: Used lq/sq -(defmethod editable-face-method-31 editable-face ((this editable-face) (arg0 vector)) +(defmethod editable-face-method-31 ((this editable-face) (arg0 vector)) (let ((s4-0 (new 'stack-no-clear 'matrix))) (dotimes (v1-0 6) (set! (-> s4-0 quad v1-0) (the-as uint128 0)) @@ -1375,7 +1375,7 @@ ;; definition for method 13 of type editable-face ;; INFO: Used lq/sq -(defmethod edit-get-distance editable-face ((this editable-face) (arg0 vector)) +(defmethod edit-get-distance ((this editable-face) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (editable-face-method-31 this (new 'stack-no-clear 'vector))) @@ -1468,7 +1468,7 @@ ;; WARN: Stack slot offset 400 signed mismatch ;; WARN: Stack slot offset 292 signed mismatch ;; WARN: Return type mismatch int vs symbol. -(defmethod editable-method-29 editable-face ((this editable-face) (arg0 editable-filter)) +(defmethod editable-method-29 ((this editable-face) (arg0 editable-filter)) (local-vars (sv-208 (inline-array vector)) (sv-216 int) @@ -1629,7 +1629,7 @@ ;; definition for method 10 of type editable-face ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-10 editable-face ((this editable-face)) +(defmethod editable-method-10 ((this editable-face)) (local-vars (sv-112 int)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 6))) (dotimes (v1-0 6) @@ -1692,7 +1692,7 @@ ) ;; definition for method 14 of type editable-plane -(defmethod edit-get-trans editable-plane ((this editable-plane)) +(defmethod edit-get-trans ((this editable-plane)) "Returns the `trans` [[vector]] or [[*null-vector*]]" (if (>= (-> this length) 1) (edit-get-trans (-> this vertex 0)) @@ -1701,7 +1701,7 @@ ) ;; definition for method 22 of type editable-plane -(defmethod editable-method-22 editable-plane ((this editable-plane) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 ((this editable-plane) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((s4-0 (clear *temp-string*))) (format s4-0 @@ -1723,7 +1723,7 @@ ) ;; definition for method 25 of type editable-plane -(defmethod editable-method-25 editable-plane ((this editable-plane) (arg0 editable-array)) +(defmethod editable-method-25 ((this editable-plane) (arg0 editable-array)) (dotimes (s4-0 (-> this length)) (let ((s3-0 (-> this vertex s4-0))) (set! (-> s3-0 owner) (delete! this (-> s3-0 owner))) @@ -1734,7 +1734,7 @@ ) ;; definition for method 26 of type editable-plane -(defmethod editable-method-26 editable-plane ((this editable-plane) (arg0 editable) (arg1 editable-array)) +(defmethod editable-method-26 ((this editable-plane) (arg0 editable) (arg1 editable-array)) (editable-array-method-15 arg1 this) ((method-of-type editable editable-method-26) this arg0 arg1) (none) @@ -1742,7 +1742,7 @@ ;; definition for method 27 of type editable-plane ;; WARN: Return type mismatch editable-plane vs editable. -(defmethod editable-method-27 editable-plane ((this editable-plane) (arg0 editable-array)) +(defmethod editable-method-27 ((this editable-plane) (arg0 editable-array)) (let ((gp-1 (the-as editable-plane (call-parent-method this arg0)))) (dotimes (s4-0 (-> gp-1 length)) (set! (-> gp-1 vertex s4-0) (the-as editable-point (editable-method-27 (-> gp-1 vertex s4-0) arg0))) @@ -1754,7 +1754,7 @@ ;; definition for method 24 of type editable-plane ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-24 editable-plane ((this editable-plane)) +(defmethod editable-method-24 ((this editable-plane)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) @@ -1776,7 +1776,7 @@ ) ;; definition for method 30 of type editable-plane -(defmethod editable-plane-method-30 editable-plane ((this editable-plane) (arg0 (inline-array vector))) +(defmethod editable-plane-method-30 ((this editable-plane) (arg0 (inline-array vector))) (case (-> this length) ((2) (let* ((v1-2 (editable-plane-method-31 this (new 'stack-no-clear 'vector))) @@ -1812,7 +1812,7 @@ ) ;; definition for method 31 of type editable-plane -(defmethod editable-plane-method-31 editable-plane ((this editable-plane) (arg0 vector)) +(defmethod editable-plane-method-31 ((this editable-plane) (arg0 vector)) (case (-> this length) ((2) (let ((s3-0 (-> this vertex 0)) @@ -1828,7 +1828,7 @@ ;; definition for method 13 of type editable-plane ;; INFO: Used lq/sq -(defmethod edit-get-distance editable-plane ((this editable-plane) (arg0 vector)) +(defmethod edit-get-distance ((this editable-plane) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (editable-plane-method-31 this (new 'stack-no-clear 'vector))) @@ -1866,7 +1866,7 @@ ;; definition for method 10 of type editable-plane ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-10 editable-plane ((this editable-plane)) +(defmethod editable-method-10 ((this editable-plane)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 4))) (dotimes (v1-0 4) (set! (-> gp-0 v1-0 quad) (the-as uint128 0)) @@ -1908,7 +1908,7 @@ ;; definition for method 17 of type editable-plane ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-17 editable-plane ((this editable-plane) (arg0 vector)) +(defmethod editable-method-17 ((this editable-plane) (arg0 vector)) (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) @@ -1929,7 +1929,7 @@ ;; definition for method 7 of type editable-array ;; WARN: Return type mismatch (array editable) vs editable-array. -(defmethod relocate editable-array ((this editable-array) (arg0 int)) +(defmethod relocate ((this editable-array) (arg0 int)) (the-as editable-array (when (nonzero? (-> this selection)) (let ((v0-0 (&+ (-> this selection) arg0))) (set! (-> this selection) v0-0) @@ -1940,18 +1940,18 @@ ) ;; definition for method 4 of type editable-array -(defmethod length editable-array ((this editable-array)) +(defmethod length ((this editable-array)) (-> this length) ) ;; definition for method 5 of type editable-array ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of editable-array ((this editable-array)) +(defmethod asize-of ((this editable-array)) (the-as int (+ (-> this type size) (* (-> this allocated-length) 4))) ) ;; definition for method 11 of type editable-array -(defmethod editable-array-method-11 editable-array ((this editable-array)) +(defmethod editable-array-method-11 ((this editable-array)) (dotimes (v1-0 (-> this length)) (if (not (-> this data v1-0)) (return v1-0) @@ -1965,7 +1965,7 @@ ) ;; definition for method 10 of type editable-array -(defmethod editable-array-method-10 editable-array ((this editable-array) (arg0 vector) (arg1 int)) +(defmethod editable-array-method-10 ((this editable-array) (arg0 vector) (arg1 int)) (when (or (!= (-> arg0 x) (-> *editable-work* last-x)) (!= (-> arg0 y) (-> *editable-work* last-y))) (set! (-> *editable-work* last-found) 0) (set! (-> *editable-work* last-x) (-> arg0 x)) @@ -2037,7 +2037,7 @@ ) ;; definition for method 14 of type editable-array -(defmethod editable-array-method-14 editable-array ((this editable-array) (arg0 (function editable editable-region symbol)) (arg1 editable-region)) +(defmethod editable-array-method-14 ((this editable-array) (arg0 (function editable editable-region symbol)) (arg1 editable-region)) (let ((gp-0 (-> this selection))) (set! (-> gp-0 length) 0) (let* ((s2-0 (-> this length)) @@ -2061,7 +2061,7 @@ ;; definition for method 15 of type editable-array ;; WARN: Return type mismatch int vs none. -(defmethod editable-array-method-15 editable-array ((this editable-array) (arg0 editable)) +(defmethod editable-array-method-15 ((this editable-array) (arg0 editable)) (let ((gp-0 (-> arg0 region))) (when gp-0 (editable-method-25 arg0 this) @@ -2124,7 +2124,7 @@ ;; WARN: Stack slot offset 44 signed mismatch ;; WARN: Return type mismatch symbol vs none. ;; WARN: Function (method 12 editable-array) has a return type of none, but the expression builder found a return statement. -(defmethod editable-array-method-12 editable-array ((this editable-array) (arg0 editable-array)) +(defmethod editable-array-method-12 ((this editable-array) (arg0 editable-array)) (local-vars (sv-16 sql-result) (sv-20 sql-result) @@ -2500,7 +2500,7 @@ ;; definition for method 13 of type editable-array ;; WARN: Return type mismatch int vs none. -(defmethod editable-array-method-13 editable-array ((this editable-array) (arg0 editable-command) (arg1 editable-command) (arg2 string)) +(defmethod editable-array-method-13 ((this editable-array) (arg0 editable-command) (arg1 editable-command) (arg2 string)) (set! (-> this target) #f) (set! (-> this target-mode) arg0) (set! (-> this target-command) arg1) @@ -2512,7 +2512,7 @@ ;; definition for method 16 of type editable-array ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod editable-array-method-16 editable-array ((this editable-array)) +(defmethod editable-array-method-16 ((this editable-array)) (cond ((-> this edit-plane) (editable-plane-method-31 (-> this edit-plane) (-> this edit-plane-normal)) @@ -2531,7 +2531,7 @@ ;; definition for method 17 of type editable-array ;; INFO: Used lq/sq -(defmethod editable-array-method-17 editable-array ((this editable-array) (arg0 vector) (arg1 vector)) +(defmethod editable-array-method-17 ((this editable-array) (arg0 vector) (arg1 vector)) (cond ((and (cpad-hold? 0 up) *target*) (set! (-> arg0 quad) (-> (get-trans *target* 0) quad)) diff --git a/test/decompiler/reference/jak2/engine/debug/history_REF.gc b/test/decompiler/reference/jak2/engine/debug/history_REF.gc index 2af436ae30e..0951e52bad1 100644 --- a/test/decompiler/reference/jak2/engine/debug/history_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/history_REF.gc @@ -48,27 +48,24 @@ ;; definition of type history-elt (deftype history-elt (structure) - ((record-tag-bytes uint8 4 :offset-assert 0) - (record-tag uint32 :offset 0) - (record-id uint16 :offset 0) - (owner uint8 :offset 2) - (channel history-channel :offset-assert 4) - (timestamp time-frame :offset-assert 8) - (origin vector :inline :offset-assert 16) - (bytes uint8 16 :offset-assert 32) - (vector vector :inline :offset 32) - (float float :offset 32) - (collide-status collide-status :offset 32) - (collide-reaction-flag uint32 :offset 40) - (pat pat-surface :offset 32) + ((record-tag-bytes uint8 4) + (record-tag uint32 :overlay-at (-> record-tag-bytes 0)) + (record-id uint16 :overlay-at (-> record-tag-bytes 0)) + (owner uint8 :overlay-at (-> record-tag-bytes 2)) + (channel history-channel) + (timestamp time-frame) + (origin vector :inline) + (bytes uint8 16) + (vector vector :inline :overlay-at (-> bytes 0)) + (float float :overlay-at (-> bytes 0)) + (collide-status collide-status :overlay-at (-> bytes 0)) + (collide-reaction-flag uint32 :overlay-at (-> bytes 8)) + (pat pat-surface :overlay-at (-> bytes 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type history-elt -(defmethod inspect history-elt ((this history-elt)) +(defmethod inspect ((this history-elt)) (when (not this) (set! this this) (goto cfg-4) @@ -93,27 +90,24 @@ ;; definition of type history-iterator (deftype history-iterator (basic) - ((max-age uint32 :offset-assert 4) - (owner uint8 :offset-assert 8) - (proc process :offset-assert 12) - (out object :offset-assert 16) - (channel-mask uint64 :offset-assert 24) - (index int32 :offset-assert 32) - (done? symbol :offset-assert 36) + ((max-age uint32) + (owner uint8) + (proc process) + (out object) + (channel-mask uint64) + (index int32) + (done? symbol) ) - :method-count-assert 12 - :size-assert #x28 - :flag-assert #xc00000028 (:methods - (new (symbol type uint) _type_ 0) - (frame-counter-delta (_type_ history-elt) time-frame 9) - (update-entries! (_type_) history-elt 10) - (get-age (_type_ history-elt) float 11) + (new (symbol type uint) _type_) + (frame-counter-delta (_type_ history-elt) time-frame) + (update-entries! (_type_) history-elt) + (get-age (_type_ history-elt) float) ) ) ;; definition for method 3 of type history-iterator -(defmethod inspect history-iterator ((this history-iterator)) +(defmethod inspect ((this history-iterator)) (when (not this) (set! this this) (goto cfg-4) @@ -132,22 +126,19 @@ ;; definition of type history (deftype history (basic) - ((alloc-index int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (elts history-elt :inline :dynamic :offset 16) + ((alloc-index int32) + (allocated-length int32) + (elts history-elt :inline :dynamic :offset 16) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (new (symbol type int) _type_ 0) - (clear-record-tags! (_type_ history-channel uint uint) history-elt 9) - (clear-history-entries! (_type_) none 10) + (new (symbol type int) _type_) + (clear-record-tags! (_type_ history-channel uint uint) history-elt) + (clear-history-entries! (_type_) none) ) ) ;; definition for method 3 of type history -(defmethod inspect history ((this history)) +(defmethod inspect ((this history)) (when (not this) (set! this this) (goto cfg-4) @@ -161,13 +152,13 @@ ) ;; definition for method 4 of type history -(defmethod length history ((this history)) +(defmethod length ((this history)) (-> this allocated-length) ) ;; definition for method 5 of type history ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of history ((this history)) +(defmethod asize-of ((this history)) (the-as int (+ (-> this type size) (* 48 (-> this allocated-length)))) ) @@ -181,7 +172,7 @@ ;; definition for method 10 of type history ;; WARN: Return type mismatch int vs none. -(defmethod clear-history-entries! history ((this history)) +(defmethod clear-history-entries! ((this history)) "Iterates through each [[history-elt]] in the `elt` dynamic array For each entry: - clear `timestamp` @@ -206,7 +197,7 @@ For each entry: ;; definition for method 9 of type history ;; WARN: new jak 2 until loop case, check carefully -(defmethod clear-record-tags! history ((this history) (arg0 history-channel) (arg1 uint) (arg2 uint)) +(defmethod clear-record-tags! ((this history) (arg0 history-channel) (arg1 uint) (arg2 uint)) "First grab the latest [[history-elt]] at `alloc-index` 1. update it's `channel`, `record-id` and `owner` from the provided args 2. - if it's `record-tag` is zero -- return it @@ -260,7 +251,7 @@ For each entry: ) ;; definition for method 10 of type history-iterator -(defmethod update-entries! history-iterator ((this history-iterator)) +(defmethod update-entries! ((this history-iterator)) "Iterate through each [[history-elt]] in [[*history*]] - If we hit the end set `done?` to true - If the `timestamp` on the elt, minus the current framecounter exceeds `max-age`, we are also done, return #f @@ -295,7 +286,7 @@ For each entry: ) ;; definition for method 11 of type history-iterator -(defmethod get-age history-iterator ((this history-iterator) (arg0 history-elt)) +(defmethod get-age ((this history-iterator) (arg0 history-elt)) "Get the age of a history element" (- 1.0 (fmin 1.0 (/ (the float (+ (- 1 (-> arg0 timestamp)) (-> *display* base-clock frame-counter))) (the float (+ (-> this max-age) 1)) @@ -305,7 +296,7 @@ For each entry: ) ;; definition for method 9 of type history-iterator -(defmethod frame-counter-delta history-iterator ((this history-iterator) (arg0 history-elt)) +(defmethod frame-counter-delta ((this history-iterator) (arg0 history-elt)) "Returns the difference between [[*display*]]'s `base-clock.frame-counter` and the elt's `timestamp`" (- (-> *display* base-clock frame-counter) (-> arg0 timestamp)) ) diff --git a/test/decompiler/reference/jak2/engine/debug/memory-usage-h_REF.gc b/test/decompiler/reference/jak2/engine/debug/memory-usage-h_REF.gc index 9d41a68cb2a..43bafc7fb41 100644 --- a/test/decompiler/reference/jak2/engine/debug/memory-usage-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/memory-usage-h_REF.gc @@ -6,18 +6,15 @@ ;; definition of type memory-usage-info (deftype memory-usage-info (structure) - ((name string :offset-assert 0) - (count int32 :offset-assert 4) - (used int32 :offset-assert 8) - (total int32 :offset-assert 12) + ((name string) + (count int32) + (used int32) + (total int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type memory-usage-info -(defmethod inspect memory-usage-info ((this memory-usage-info)) +(defmethod inspect ((this memory-usage-info)) (when (not this) (set! this this) (goto cfg-4) @@ -33,22 +30,19 @@ ;; definition of type memory-usage-block (deftype memory-usage-block (basic) - ((work-bsp basic :offset-assert 4) - (length int32 :offset-assert 8) - (data memory-usage-info 112 :inline :offset-assert 16) + ((work-bsp basic) + (length int32) + (data memory-usage-info 112 :inline) ) - :method-count-assert 12 - :size-assert #x710 - :flag-assert #xc00000710 (:methods - (reset! (_type_) _type_ 9) - (calculate-total (_type_) int 10) - (print-mem-usage (_type_ level object) _type_ 11) + (reset! (_type_) _type_) + (calculate-total (_type_) int) + (print-mem-usage (_type_ level object) _type_) ) ) ;; definition for method 3 of type memory-usage-block -(defmethod inspect memory-usage-block ((this memory-usage-block)) +(defmethod inspect ((this memory-usage-block)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/debug/memory-usage_REF.gc b/test/decompiler/reference/jak2/engine/debug/memory-usage_REF.gc index 87d277a78f7..0cb5bff908e 100644 --- a/test/decompiler/reference/jak2/engine/debug/memory-usage_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/memory-usage_REF.gc @@ -5,7 +5,7 @@ (declare-file (debug)) ;; definition for method 3 of type memory-usage-block -(defmethod inspect memory-usage-block ((this memory-usage-block)) +(defmethod inspect ((this memory-usage-block)) (format #t "-------------------------------------------------------------~%") (format #t " # name count bytes used aligned bytes~%") (format #t "-------------------------------------------------------------~%") @@ -34,12 +34,12 @@ ) ;; definition for method 8 of type object -(defmethod mem-usage object ((this object) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this object) (arg0 memory-usage-block) (arg1 int)) this ) ;; definition for method 10 of type memory-usage-block -(defmethod calculate-total memory-usage-block ((this memory-usage-block)) +(defmethod calculate-total ((this memory-usage-block)) "@returns The total sum of all [[memory-usage-info]] `total`s" (let ((sum 0)) (dotimes (idx (-> this length)) @@ -50,7 +50,7 @@ ) ;; definition for method 9 of type memory-usage-block -(defmethod reset! memory-usage-block ((this memory-usage-block)) +(defmethod reset! ((this memory-usage-block)) "Sets `length` to 0 as well as resets all fields except `name` in the associated [[memory-usage-info]]" (set! (-> this length) 0) (dotimes (idx 112) @@ -77,7 +77,7 @@ ) ;; definition for method 14 of type level -(defmethod compute-memory-usage! level ((this level) (force? symbol)) +(defmethod compute-memory-usage! ((this level) (force? symbol)) "Calculates the memory usage of the level, returns and stores the [[memory-usage-block]] in `mem-usage-block` as well as the total size in `mem-usage` @@ -97,7 +97,7 @@ in `mem-usage-block` as well as the total size in `mem-usage` ) ;; definition for method 8 of type process-tree -(defmethod mem-usage process-tree ((this process-tree) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this process-tree) (arg0 memory-usage-block) (arg1 int)) (let ((v1-0 90)) (let* ((a0-1 *dead-pool-list*) (a3-0 (car a0-1)) @@ -313,7 +313,7 @@ in `mem-usage-block` as well as the total size in `mem-usage` ;; definition for method 11 of type memory-usage-block ;; INFO: Used lq/sq -(defmethod print-mem-usage memory-usage-block ((this memory-usage-block) (level level) (fmt-dest object)) +(defmethod print-mem-usage ((this memory-usage-block) (level level) (fmt-dest object)) (local-vars (sv-16 object) (sv-32 string) (sv-48 int)) (let ((s3-0 (&- (-> level heap current) (the-as uint (-> level heap base))))) (let ((v1-2 (+ (-> this data 61 total) (-> this data 62 total)))) diff --git a/test/decompiler/reference/jak2/engine/debug/menu_REF.gc b/test/decompiler/reference/jak2/engine/debug/menu_REF.gc index 7a2883adbf0..5fac51fd2f9 100644 --- a/test/decompiler/reference/jak2/engine/debug/menu_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/menu_REF.gc @@ -6,26 +6,23 @@ ;; definition of type debug-menu-context (deftype debug-menu-context (basic) - ((is-active symbol :offset-assert 4) - (sel-length int32 :offset-assert 8) - (sel-menu debug-menu 8 :offset-assert 12) - (root-menu debug-menu :offset-assert 44) - (joypad-func (function basic int none) :offset-assert 48) - (joypad-item basic :offset-assert 52) - (font font-context :offset-assert 56) - (is-hidden symbol :offset-assert 60) - (joypad-number int32 :offset-assert 64) + ((is-active symbol) + (sel-length int32) + (sel-menu debug-menu 8) + (root-menu debug-menu) + (joypad-func (function basic int none)) + (joypad-item basic) + (font font-context) + (is-hidden symbol) + (joypad-number int32) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type debug-menu-context -(defmethod inspect debug-menu-context ((this debug-menu-context)) +(defmethod inspect ((this debug-menu-context)) (when (not this) (set! this this) (goto cfg-4) @@ -63,18 +60,15 @@ ;; definition of type debug-menu-node (deftype debug-menu-node (basic) - ((name string :offset-assert 4) - (parent debug-menu :offset-assert 8) - (refresh-delay int32 :offset-assert 12) - (refresh-ctr int32 :offset-assert 16) + ((name string) + (parent debug-menu) + (refresh-delay int32) + (refresh-ctr int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type debug-menu-node -(defmethod inspect debug-menu-node ((this debug-menu-node)) +(defmethod inspect ((this debug-menu-node)) (when (not this) (set! this this) (goto cfg-4) @@ -89,29 +83,26 @@ ) ;; definition for method 2 of type debug-menu-node -(defmethod print debug-menu-node ((this debug-menu-node)) +(defmethod print ((this debug-menu-node)) (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) this ) ;; definition of type debug-menu (deftype debug-menu (debug-menu-node) - ((context debug-menu-context :offset-assert 20) - (selected-item debug-menu-item :offset-assert 24) - (pix-width int32 :offset-assert 28) - (pix-height int32 :offset-assert 32) - (items pair :offset-assert 36) + ((context debug-menu-context) + (selected-item debug-menu-item) + (pix-width int32) + (pix-height int32) + (items pair) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 (:methods - (new (symbol type debug-menu-context string) _type_ 0) + (new (symbol type debug-menu-context string) _type_) ) ) ;; definition for method 3 of type debug-menu -(defmethod inspect debug-menu ((this debug-menu)) +(defmethod inspect ((this debug-menu)) (when (not this) (set! this this) (goto cfg-4) @@ -144,15 +135,12 @@ ;; definition of type debug-menu-item (deftype debug-menu-item (debug-menu-node) - ((id int32 :offset-assert 20) + ((id int32) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type debug-menu-item -(defmethod inspect debug-menu-item ((this debug-menu-item)) +(defmethod inspect ((this debug-menu-item)) (when (not this) (set! this this) (goto cfg-4) @@ -169,18 +157,15 @@ ;; definition of type debug-menu-item-submenu (deftype debug-menu-item-submenu (debug-menu-item) - ((submenu debug-menu :offset-assert 24) + ((submenu debug-menu) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c (:methods - (new (symbol type string debug-menu) _type_ 0) + (new (symbol type string debug-menu) _type_) ) ) ;; definition for method 3 of type debug-menu-item-submenu -(defmethod inspect debug-menu-item-submenu ((this debug-menu-item-submenu)) +(defmethod inspect ((this debug-menu-item-submenu)) (when (not this) (set! this this) (goto cfg-4) @@ -211,19 +196,16 @@ ;; definition of type debug-menu-item-function (deftype debug-menu-item-function (debug-menu-item) - ((activate-func (function object object) :offset-assert 24) - (hilite-timer int8 :offset-assert 28) + ((activate-func (function object object)) + (hilite-timer int8) ) - :method-count-assert 9 - :size-assert #x1d - :flag-assert #x90000001d (:methods - (new (symbol type string object (function object object)) _type_ 0) + (new (symbol type string object (function object object)) _type_) ) ) ;; definition for method 3 of type debug-menu-item-function -(defmethod inspect debug-menu-item-function ((this debug-menu-item-function)) +(defmethod inspect ((this debug-menu-item-function)) (when (not this) (set! this this) (goto cfg-4) @@ -256,19 +238,16 @@ ;; definition of type debug-menu-item-flag (deftype debug-menu-item-flag (debug-menu-item) - ((activate-func (function object debug-menu-msg object) :offset-assert 24) - (is-on object :offset-assert 28) + ((activate-func (function object debug-menu-msg object)) + (is-on object) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 (:methods - (new (symbol type string object (function object debug-menu-msg object)) _type_ 0) + (new (symbol type string object (function object debug-menu-msg object)) _type_) ) ) ;; definition for method 3 of type debug-menu-item-flag -(defmethod inspect debug-menu-item-flag ((this debug-menu-item-flag)) +(defmethod inspect ((this debug-menu-item-flag)) (when (not this) (set! this this) (goto cfg-4) @@ -306,43 +285,40 @@ ;; definition of type debug-menu-item-var (deftype debug-menu-item-var (debug-menu-item) - ((display-str string :offset-assert 24) - (grabbed-joypad-p symbol :offset-assert 28) - (float-p symbol :offset-assert 32) - (range-p symbol :offset-assert 36) - (show-len int32 :offset-assert 40) - (inc-delay int32 :offset-assert 44) - (inc-delay-ctr int32 :offset-assert 48) - (step-delay-ctr int32 :offset-assert 52) - (inc-dir int32 :offset-assert 56) - (fval float :offset-assert 60) - (fundo-val float :offset-assert 64) - (frange-min float :offset-assert 68) - (frange-max float :offset-assert 72) - (fstart-inc float :offset-assert 76) - (fstep float :offset-assert 80) - (fprecision int32 :offset-assert 84) - (factivate-func (function int debug-menu-msg float float float) :offset-assert 88) - (ival int32 :offset 60) - (iundo-val int32 :offset 64) - (irange-min int32 :offset 68) - (irange-max int32 :offset 72) - (istart-inc int32 :offset 76) - (istep int32 :offset 80) - (ihex-p symbol :offset-assert 92) - (iactivate-func (function int debug-menu-msg int int int) :offset 88) - (ifloat-p symbol :offset-assert 96) + ((display-str string) + (grabbed-joypad-p symbol) + (float-p symbol) + (range-p symbol) + (show-len int32) + (inc-delay int32) + (inc-delay-ctr int32) + (step-delay-ctr int32) + (inc-dir int32) + (fval float) + (fundo-val float) + (frange-min float) + (frange-max float) + (fstart-inc float) + (fstep float) + (fprecision int32) + (factivate-func (function int debug-menu-msg float float float)) + (ival int32 :overlay-at fval) + (iundo-val int32 :overlay-at fundo-val) + (irange-min int32 :overlay-at frange-min) + (irange-max int32 :overlay-at frange-max) + (istart-inc int32 :overlay-at fstart-inc) + (istep int32 :overlay-at fstep) + (ihex-p symbol) + (iactivate-func (function int debug-menu-msg int int int) :overlay-at factivate-func) + (ifloat-p symbol) ) - :method-count-assert 9 - :size-assert #x64 - :flag-assert #x900000064 (:methods - (new (symbol type string int int) _type_ 0) + (new (symbol type string int int) _type_) ) ) ;; definition for method 3 of type debug-menu-item-var -(defmethod inspect debug-menu-item-var ((this debug-menu-item-var)) +(defmethod inspect ((this debug-menu-item-var)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc b/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc index 955bccb04ab..1a9d2bb90d9 100644 --- a/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc @@ -6,33 +6,30 @@ ;; definition of type mysql-nav-node (deftype mysql-nav-node (structure) - ((mysql-save-flag mysql-save-flag :offset-assert 0) - (runtime-id uint32 :offset-assert 4) - (temp-edge-list (inline-array mysql-nav-edge) :offset-assert 8) - (level-node-index int32 :offset-assert 12) - (cam-dist float :offset-assert 16) - (visible symbol :offset-assert 20) - (nav_node_id uint32 :offset-assert 24) - (nav_graph_id uint32 :offset-assert 28) - (position vector :inline :offset-assert 32) - (level_name symbol :offset-assert 48) - (angle float :offset-assert 52) - (radius float :offset-assert 56) - (nav_node_flag nav-node-flag :offset-assert 60) - (nav_mesh_id uint32 :offset-assert 64) + ((mysql-save-flag mysql-save-flag) + (runtime-id uint32) + (temp-edge-list (inline-array mysql-nav-edge)) + (level-node-index int32) + (cam-dist float) + (visible symbol) + (nav_node_id uint32) + (nav_graph_id uint32) + (position vector :inline) + (level_name symbol) + (angle float) + (radius float) + (nav_node_flag nav-node-flag) + (nav_mesh_id uint32) ) :pack-me - :method-count-assert 11 - :size-assert #x44 - :flag-assert #xb00000044 (:methods - (exec-sql! (_type_) symbol 9) - (temp-edge-size (_type_) int 10) + (exec-sql! (_type_) symbol) + (temp-edge-size (_type_) int) ) ) ;; definition for method 3 of type mysql-nav-node -(defmethod inspect mysql-nav-node ((this mysql-nav-node)) +(defmethod inspect ((this mysql-nav-node)) (when (not this) (set! this this) (goto cfg-4) @@ -58,15 +55,12 @@ ;; definition of type mysql-nav-node-array (deftype mysql-nav-node-array (inline-array-class) - ((data mysql-nav-node :inline :dynamic :offset-assert 16) + ((data mysql-nav-node :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type mysql-nav-node-array -(defmethod inspect mysql-nav-node-array ((this mysql-nav-node-array)) +(defmethod inspect ((this mysql-nav-node-array)) (when (not this) (set! this this) (goto cfg-4) @@ -84,35 +78,32 @@ ;; definition of type mysql-nav-edge (deftype mysql-nav-edge (structure) - ((mysql-save-flag mysql-save-flag :offset-assert 0) - (runtime-id uint32 :offset-assert 4) - (runtime-node-id-1 int32 :offset-assert 8) - (runtime-node-id-2 int32 :offset-assert 12) - (temp-next-edge mysql-nav-edge :offset-assert 16) - (nav_edge_id uint32 :offset-assert 20) - (nav_graph_id uint32 :offset-assert 24) - (nav_node_id_1 uint32 :offset-assert 28) - (nav_node_id_2 uint32 :offset-assert 32) - (directionality nav-directionality :offset-assert 36) - (speed_limit float :offset-assert 40) - (density float :offset-assert 44) - (traffic_edge_flag int32 :offset-assert 48) - (nav_clock_mask nav-clock-mask :offset-assert 52) - (nav_clock_type nav-clock-type :offset-assert 56) - (width float :offset-assert 60) - (minimap_edge_flag nav-minimap-edge-flag :offset-assert 64) + ((mysql-save-flag mysql-save-flag) + (runtime-id uint32) + (runtime-node-id-1 int32) + (runtime-node-id-2 int32) + (temp-next-edge mysql-nav-edge) + (nav_edge_id uint32) + (nav_graph_id uint32) + (nav_node_id_1 uint32) + (nav_node_id_2 uint32) + (directionality nav-directionality) + (speed_limit float) + (density float) + (traffic_edge_flag int32) + (nav_clock_mask nav-clock-mask) + (nav_clock_type nav-clock-type) + (width float) + (minimap_edge_flag nav-minimap-edge-flag) ) :allow-misaligned - :method-count-assert 10 - :size-assert #x44 - :flag-assert #xa00000044 (:methods - (exec-sql! (_type_) symbol 9) + (exec-sql! (_type_) symbol) ) ) ;; definition for method 3 of type mysql-nav-edge -(defmethod inspect mysql-nav-edge ((this mysql-nav-edge)) +(defmethod inspect ((this mysql-nav-edge)) (when (not this) (set! this this) (goto cfg-4) @@ -141,15 +132,12 @@ ;; definition of type mysql-nav-edge-array (deftype mysql-nav-edge-array (inline-array-class) - ((data mysql-nav-edge :inline :dynamic :offset-assert 16) + ((data mysql-nav-edge :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type mysql-nav-edge-array -(defmethod inspect mysql-nav-edge-array ((this mysql-nav-edge-array)) +(defmethod inspect ((this mysql-nav-edge-array)) (when (not this) (set! this this) (goto cfg-4) @@ -167,24 +155,21 @@ ;; definition of type mysql-nav-visnode (deftype mysql-nav-visnode (structure) - ((mysql-save-flag mysql-save-flag :offset-assert 0) - (runtime-node-id int32 :offset-assert 4) - (runtime-edge-id int32 :offset-assert 8) - (nav_visnode_id uint32 :offset-assert 12) - (nav_graph_id uint32 :offset-assert 16) - (nav_node_id uint32 :offset-assert 20) - (nav_edge_id uint32 :offset-assert 24) + ((mysql-save-flag mysql-save-flag) + (runtime-node-id int32) + (runtime-edge-id int32) + (nav_visnode_id uint32) + (nav_graph_id uint32) + (nav_node_id uint32) + (nav_edge_id uint32) ) - :method-count-assert 10 - :size-assert #x1c - :flag-assert #xa0000001c (:methods - (exec-sql! (_type_) symbol 9) + (exec-sql! (_type_) symbol) ) ) ;; definition for method 3 of type mysql-nav-visnode -(defmethod inspect mysql-nav-visnode ((this mysql-nav-visnode)) +(defmethod inspect ((this mysql-nav-visnode)) (when (not this) (set! this this) (goto cfg-4) @@ -203,15 +188,12 @@ ;; definition of type mysql-nav-visnode-array (deftype mysql-nav-visnode-array (inline-array-class) - ((data mysql-nav-visnode :inline :dynamic :offset-assert 16) + ((data mysql-nav-visnode :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type mysql-nav-visnode-array -(defmethod inspect mysql-nav-visnode-array ((this mysql-nav-visnode-array)) +(defmethod inspect ((this mysql-nav-visnode-array)) (when (not this) (set! this this) (goto cfg-4) @@ -229,20 +211,17 @@ ;; definition of type mysql-nav-graph-level-info (deftype mysql-nav-graph-level-info (structure) - ((level symbol :offset-assert 0) - (level-id uint32 :offset-assert 4) - (node-count int32 :offset-assert 8) - (branch-count int32 :offset-assert 12) - (to-link-count int32 :offset-assert 16) + ((level symbol) + (level-id uint32) + (node-count int32) + (branch-count int32) + (to-link-count int32) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type mysql-nav-graph-level-info -(defmethod inspect mysql-nav-graph-level-info ((this mysql-nav-graph-level-info)) +(defmethod inspect ((this mysql-nav-graph-level-info)) (when (not this) (set! this this) (goto cfg-4) @@ -259,36 +238,33 @@ ;; definition of type mysql-nav-graph (deftype mysql-nav-graph (basic) - ((nav_graph_id uint32 :offset-assert 4) - (node-array mysql-nav-node-array :offset-assert 8) - (edge-array mysql-nav-edge-array :offset-assert 12) - (visnode-array mysql-nav-visnode-array :offset-assert 16) - (level-info-array-length int32 :offset-assert 20) - (level-info-last-lookup int32 :offset-assert 24) - (level-info-array mysql-nav-graph-level-info 32 :inline :offset-assert 28) + ((nav_graph_id uint32) + (node-array mysql-nav-node-array) + (edge-array mysql-nav-edge-array) + (visnode-array mysql-nav-visnode-array) + (level-info-array-length int32) + (level-info-last-lookup int32) + (level-info-array mysql-nav-graph-level-info 32 :inline) ) - :method-count-assert 21 - :size-assert #x41c - :flag-assert #x150000041c (:methods - (new (symbol type string) _type_ 0) - (init-from-sql! (_type_ string string) symbol 9) - (exec-sql! (_type_) symbol 10) - (indexof-nav-node (_type_ int) int 11) - (indexof-nav-edge (_type_ int) int 12) - (alloc-new-node! (_type_) int 13) - (alloc-new-edge! (_type_) int 14) - (indexof-visnode (_type_ int int) int 15) - (alloc-new-visnode! (_type_ int int) int 16) - (mysql-nav-graph-method-17 (_type_) none 17) - (lookup-level-info2 (_type_ mysql-nav-node symbol) mysql-nav-graph-level-info 18) - (mysql-nav-graph-method-19 (_type_) none 19) - (mysql-nav-graph-method-20 (_type_) none 20) + (new (symbol type string) _type_) + (init-from-sql! (_type_ string string) symbol) + (exec-sql! (_type_) symbol) + (indexof-nav-node (_type_ int) int) + (indexof-nav-edge (_type_ int) int) + (alloc-new-node! (_type_) int) + (alloc-new-edge! (_type_) int) + (indexof-visnode (_type_ int int) int) + (alloc-new-visnode! (_type_ int int) int) + (mysql-nav-graph-method-17 (_type_) none) + (lookup-level-info2 (_type_ mysql-nav-node symbol) mysql-nav-graph-level-info) + (mysql-nav-graph-method-19 (_type_) none) + (mysql-nav-graph-method-20 (_type_) none) ) ) ;; definition for method 3 of type mysql-nav-graph -(defmethod inspect mysql-nav-graph ((this mysql-nav-graph)) +(defmethod inspect ((this mysql-nav-graph)) (when (not this) (set! this this) (goto cfg-4) @@ -333,7 +309,7 @@ ) ;; definition for method 13 of type mysql-nav-graph -(defmethod alloc-new-node! mysql-nav-graph ((this mysql-nav-graph)) +(defmethod alloc-new-node! ((this mysql-nav-graph)) "Allocates a new `[[mysql-nav-node]]`, if `node-array`'s `length` exceeds `3000` return `-1` otherwise, return the new size of the array" (cond @@ -358,7 +334,7 @@ otherwise, return the new size of the array" ) ;; definition for method 14 of type mysql-nav-graph -(defmethod alloc-new-edge! mysql-nav-graph ((this mysql-nav-graph)) +(defmethod alloc-new-edge! ((this mysql-nav-graph)) "Allocates a new `[[mysql-nav-edge]]`, if `edge-array`'s `length` exceeds `5000` return `-1` otherwise, return the new size of the array" (cond @@ -383,7 +359,7 @@ otherwise, return the new size of the array" ) ;; definition for method 15 of type mysql-nav-graph -(defmethod indexof-visnode mysql-nav-graph ((this mysql-nav-graph) (edge-id int) (node-id int)) +(defmethod indexof-visnode ((this mysql-nav-graph) (edge-id int) (node-id int)) "Returns the index in the `visnode-array` whom's [[mysql-nav-visnode]] has the provided `runtime-edge-id` and `runtime-node-id` if none exist, return `-1`" (dotimes (v1-0 (-> this visnode-array length)) @@ -397,7 +373,7 @@ if none exist, return `-1`" ) ;; definition for method 16 of type mysql-nav-graph -(defmethod alloc-new-visnode! mysql-nav-graph ((this mysql-nav-graph) (edge-id int) (node-id int)) +(defmethod alloc-new-visnode! ((this mysql-nav-graph) (edge-id int) (node-id int)) "Potentially allocates a new `[[mysql-nav-visnode]]`: - if `visnode-array`'s `length` exceeds `3000` return `-1` - otherwise, if the node already exists, TODO @@ -433,7 +409,7 @@ if none exist, return `-1`" ) ;; definition for method 9 of type mysql-nav-node -(defmethod exec-sql! mysql-nav-node ((this mysql-nav-node)) +(defmethod exec-sql! ((this mysql-nav-node)) "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) (logtest? (-> this mysql-save-flag) (mysql-save-flag delete)) @@ -539,7 +515,7 @@ if none exist, return `-1`" ) ;; definition for method 9 of type mysql-nav-edge -(defmethod exec-sql! mysql-nav-edge ((this mysql-nav-edge)) +(defmethod exec-sql! ((this mysql-nav-edge)) "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) (logtest? (-> this mysql-save-flag) (mysql-save-flag delete)) @@ -744,7 +720,7 @@ if none exist, return `-1`" ) ;; definition for method 9 of type mysql-nav-visnode -(defmethod exec-sql! mysql-nav-visnode ((this mysql-nav-visnode)) +(defmethod exec-sql! ((this mysql-nav-visnode)) "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) (logtest? (-> this mysql-save-flag) (mysql-save-flag delete)) @@ -799,7 +775,7 @@ if none exist, return `-1`" ) ;; definition for method 11 of type mysql-nav-graph -(defmethod indexof-nav-node mysql-nav-graph ((this mysql-nav-graph) (node-id int)) +(defmethod indexof-nav-node ((this mysql-nav-graph) (node-id int)) "Iterate through the `node-array` and return the index for the first [[mysql-nav-node]] whom's `nav_node_id` matches the provided id returns `-1` if none is found" (dotimes (v1-0 (-> this node-array length)) @@ -811,7 +787,7 @@ returns `-1` if none is found" ) ;; definition for method 12 of type mysql-nav-graph -(defmethod indexof-nav-edge mysql-nav-graph ((this mysql-nav-graph) (edge-id int)) +(defmethod indexof-nav-edge ((this mysql-nav-graph) (edge-id int)) "Iterate through the `edge-array` and return the index for the first [[mysql-nav-edge]] whom's `nav_edge_id` matches the provided id returns `-1` if none is found" (dotimes (v1-0 (-> this edge-array length)) @@ -831,7 +807,7 @@ returns `-1` if none is found" ;; WARN: new jak 2 until loop case, check carefully ;; WARN: new jak 2 until loop case, check carefully ;; WARN: new jak 2 until loop case, check carefully -(defmethod init-from-sql! mysql-nav-graph ((this mysql-nav-graph) (arg0 string) (arg1 string)) +(defmethod init-from-sql! ((this mysql-nav-graph) (arg0 string) (arg1 string)) "Query the database and initialize the [[mysql-nav-graph]] and all it's related components" (local-vars (sv-16 string) (sv-32 int) (sv-48 int) (sv-64 int)) (set! (-> this node-array length) 0) @@ -1164,7 +1140,7 @@ returns `-1` if none is found" ) ;; definition for method 10 of type mysql-nav-node -(defmethod temp-edge-size mysql-nav-node ((this mysql-nav-node)) +(defmethod temp-edge-size ((this mysql-nav-node)) "Returns the number of [[mysql-nav-edge]] stored in the `temp-edge-list`" (let ((v0-0 0)) (let ((v1-0 (the-as object (-> this temp-edge-list)))) @@ -1179,7 +1155,7 @@ returns `-1` if none is found" ;; definition for method 17 of type mysql-nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod mysql-nav-graph-method-17 mysql-nav-graph ((this mysql-nav-graph)) +(defmethod mysql-nav-graph-method-17 ((this mysql-nav-graph)) (dotimes (v1-0 (-> this node-array length)) (set! (-> (the-as mysql-nav-node (-> this node-array data v1-0)) temp-edge-list) (the-as (inline-array mysql-nav-edge) #f) @@ -1212,7 +1188,7 @@ returns `-1` if none is found" ) ;; definition for method 18 of type mysql-nav-graph -(defmethod lookup-level-info2 mysql-nav-graph ((this mysql-nav-graph) (arg0 mysql-nav-node) (arg1 symbol)) +(defmethod lookup-level-info2 ((this mysql-nav-graph) (arg0 mysql-nav-node) (arg1 symbol)) "TODO - this was originally called `lookup-level-info` but it clashes with the function defined in `level`" (let ((s5-0 (the-as mysql-nav-graph-level-info #f))) (b! (>= (-> this level-info-last-lookup) (-> this level-info-array-length)) cfg-3 :delay #f) @@ -1281,7 +1257,7 @@ returns `-1` if none is found" ;; definition for method 19 of type mysql-nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod mysql-nav-graph-method-19 mysql-nav-graph ((this mysql-nav-graph)) +(defmethod mysql-nav-graph-method-19 ((this mysql-nav-graph)) (set! (-> this level-info-array-length) 0) (set! (-> this level-info-last-lookup) 0) (dotimes (v1-0 32) @@ -1321,7 +1297,7 @@ returns `-1` if none is found" ;; definition for method 20 of type mysql-nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod mysql-nav-graph-method-20 mysql-nav-graph ((this mysql-nav-graph)) +(defmethod mysql-nav-graph-method-20 ((this mysql-nav-graph)) (mysql-nav-graph-method-17 this) (mysql-nav-graph-method-19 this) 0 @@ -1329,7 +1305,7 @@ returns `-1` if none is found" ) ;; definition for method 10 of type mysql-nav-graph -(defmethod exec-sql! mysql-nav-graph ((this mysql-nav-graph)) +(defmethod exec-sql! ((this mysql-nav-graph)) (format #t "Saving nodes ...~%") (dotimes (s5-0 (-> this node-array length)) (let ((a0-3 (-> this node-array data s5-0))) diff --git a/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc b/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc index 897178cef6d..fd84a37229b 100644 --- a/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc @@ -6,18 +6,15 @@ ;; definition of type nav-graph-command (deftype nav-graph-command (structure) - ((com-type uint32 :offset-assert 0) - (id int32 :offset-assert 4) - (index int32 :offset-assert 8) - (move-vec vector :inline :offset-assert 16) + ((com-type uint32) + (id int32) + (index int32) + (move-vec vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type nav-graph-command -(defmethod inspect nav-graph-command ((this nav-graph-command)) +(defmethod inspect ((this nav-graph-command)) (when (not this) (set! this this) (goto cfg-4) @@ -33,15 +30,12 @@ ;; definition of type nav-graph-command-array (deftype nav-graph-command-array (inline-array-class) - ((data nav-graph-command :inline :dynamic :offset-assert 16) + ((data nav-graph-command :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type nav-graph-command-array -(defmethod inspect nav-graph-command-array ((this nav-graph-command-array)) +(defmethod inspect ((this nav-graph-command-array)) (when (not this) (set! this this) (goto cfg-4) @@ -59,95 +53,93 @@ ;; definition of type nav-graph-editor (deftype nav-graph-editor (process) - ((self nav-graph-editor :override) - (nav-graph mysql-nav-graph :offset-assert 128) - (mode symbol :offset-assert 132) - (command-id int32 :offset-assert 136) - (max-command int32 :offset-assert 140) - (selected-index int32 :offset-assert 144) - (selected-dist float :offset-assert 148) - (selected-node-edge? symbol :offset-assert 152) - (closest-node int32 :offset-assert 156) - (dist-closest-node float :offset-assert 160) - (closest-edge int32 :offset-assert 164) - (dist-closest-edge float :offset-assert 168) - (mouse-pos vector :inline :offset-assert 176) - (mouse-hit vector :inline :offset-assert 192) - (mouse-hit-pick vector :inline :offset-assert 208) - (mouse-normal vector :inline :offset-assert 224) - (mouse-spos-hold vector :inline :offset-assert 240) - (edge-src int32 :offset-assert 256) - (edge-dst int32 :offset-assert 260) - (edge-visibility int32 :offset-assert 264) - (vehicle-edit-mode symbol :offset-assert 268) - (hover-edit-mode symbol :offset-assert 272) - (clipping-dist float :offset-assert 276) - (plane-height float :offset-assert 280) - (plane-height-hold float :offset-assert 284) - (default-node mysql-nav-node :inline :offset-assert 288) - (default-edge mysql-nav-edge :inline :offset-assert 356) - (command-array nav-graph-command-array :offset-assert 424) + ((self nav-graph-editor :override) + (nav-graph mysql-nav-graph) + (mode symbol) + (command-id int32) + (max-command int32) + (selected-index int32) + (selected-dist float) + (selected-node-edge? symbol) + (closest-node int32) + (dist-closest-node float) + (closest-edge int32) + (dist-closest-edge float) + (mouse-pos vector :inline) + (mouse-hit vector :inline) + (mouse-hit-pick vector :inline) + (mouse-normal vector :inline) + (mouse-spos-hold vector :inline) + (edge-src int32) + (edge-dst int32) + (edge-visibility int32) + (vehicle-edit-mode symbol) + (hover-edit-mode symbol) + (clipping-dist float) + (plane-height float) + (plane-height-hold float) + (default-node mysql-nav-node :inline) + (default-edge mysql-nav-edge :inline) + (command-array nav-graph-command-array) ) - :heap-base #x130 - :method-count-assert 64 - :size-assert #x1ac - :flag-assert #x40013001ac + (:state-methods + move-node + move-plane + create + edit-edge + create-edge + adjust-plane + adjust-it + adjust-minimap + adjust-node-angle + adjust-node-radius + adjust-edge-visibility + adjust-edge-width + adjust-edge-density + draw-closest-minimap + ) (:methods - (move-node () _type_ :state 14) - (move-plane () _type_ :state 15) - (create () _type_ :state 16) - (edit-edge () _type_ :state 17) - (create-edge () _type_ :state 18) - (adjust-plane () _type_ :state 19) - (adjust-it () _type_ :state 20) - (adjust-minimap () _type_ :state 21) - (adjust-node-angle () _type_ :state 22) - (adjust-node-radius () _type_ :state 23) - (adjust-edge-visibility () _type_ :state 24) - (adjust-edge-width () _type_ :state 25) - (adjust-edge-density () _type_ :state 26) - (draw-closest-minimap () _type_ :state 27) - (nav-graph-editor-method-28 (_type_) none 28) - (nav-graph-editor-method-29 (_type_ string string string) none 29) - (nav-graph-editor-method-30 (_type_ int) symbol 30) - (nav-graph-editor-method-31 (_type_ int) symbol 31) - (nav-graph-editor-method-32 (_type_ symbol int) none 32) - (nav-graph-editor-method-33 (_type_ int) none 33) - (nav-graph-editor-method-34 (_type_) object 34) - (nav-graph-editor-method-35 (_type_) none 35) - (nav-graph-editor-method-36 (_type_) none 36) - (nav-graph-editor-method-37 (_type_) none 37) - (nav-graph-editor-method-38 (_type_) none 38) - (nav-graph-editor-method-39 (_type_) none 39) - (nav-graph-editor-method-40 (_type_) none 40) - (nav-graph-editor-method-41 (_type_) none 41) - (nav-graph-editor-method-42 (_type_) symbol 42) - (nav-graph-editor-method-43 (_type_) none 43) - (nav-graph-editor-method-44 (_type_) symbol 44) - (nav-graph-editor-method-45 (_type_) none 45) - (nav-graph-editor-method-46 (_type_) pad-buttons 46) - (nav-graph-editor-method-47 (_type_) none 47) - (nav-graph-editor-method-48 (_type_ uint) nav-graph-command 48) - (nav-graph-editor-method-49 (_type_) nav-graph-command 49) - (nav-graph-editor-method-50 (_type_) none 50) - (nav-graph-editor-method-51 (_type_) none 51) - (nav-graph-editor-method-52 (_type_) uint 52) - (nav-graph-editor-method-53 (_type_ int int) none 53) - (nav-graph-editor-method-54 (_type_ int) none 54) - (nav-graph-editor-method-55 (_type_ int) none 55) - (nav-graph-editor-method-56 (_type_ int) none 56) - (nav-graph-editor-method-57 (_type_ int int) int 57) - (nav-graph-editor-method-58 (_type_) symbol 58) - (nav-graph-editor-method-59 (_type_) pad-buttons 59) - (nav-graph-editor-method-60 (_type_) none 60) - (nav-graph-editor-method-61 (_type_) none 61) - (nav-graph-editor-method-62 (_type_ symbol symbol) none 62) - (nav-graph-editor-method-63 (_type_) none 63) + (nav-graph-editor-method-28 (_type_) none) + (nav-graph-editor-method-29 (_type_ string string string) none) + (nav-graph-editor-method-30 (_type_ int) symbol) + (nav-graph-editor-method-31 (_type_ int) symbol) + (nav-graph-editor-method-32 (_type_ symbol int) none) + (nav-graph-editor-method-33 (_type_ int) none) + (nav-graph-editor-method-34 (_type_) object) + (nav-graph-editor-method-35 (_type_) none) + (nav-graph-editor-method-36 (_type_) none) + (nav-graph-editor-method-37 (_type_) none) + (nav-graph-editor-method-38 (_type_) none) + (nav-graph-editor-method-39 (_type_) none) + (nav-graph-editor-method-40 (_type_) none) + (nav-graph-editor-method-41 (_type_) none) + (nav-graph-editor-method-42 (_type_) symbol) + (nav-graph-editor-method-43 (_type_) none) + (nav-graph-editor-method-44 (_type_) symbol) + (nav-graph-editor-method-45 (_type_) none) + (nav-graph-editor-method-46 (_type_) pad-buttons) + (nav-graph-editor-method-47 (_type_) none) + (nav-graph-editor-method-48 (_type_ uint) nav-graph-command) + (nav-graph-editor-method-49 (_type_) nav-graph-command) + (nav-graph-editor-method-50 (_type_) none) + (nav-graph-editor-method-51 (_type_) none) + (nav-graph-editor-method-52 (_type_) uint) + (nav-graph-editor-method-53 (_type_ int int) none) + (nav-graph-editor-method-54 (_type_ int) none) + (nav-graph-editor-method-55 (_type_ int) none) + (nav-graph-editor-method-56 (_type_ int) none) + (nav-graph-editor-method-57 (_type_ int int) int) + (nav-graph-editor-method-58 (_type_) symbol) + (nav-graph-editor-method-59 (_type_) pad-buttons) + (nav-graph-editor-method-60 (_type_) none) + (nav-graph-editor-method-61 (_type_) none) + (nav-graph-editor-method-62 (_type_ symbol symbol) none) + (nav-graph-editor-method-63 (_type_) none) ) ) ;; definition for method 3 of type nav-graph-editor -(defmethod inspect nav-graph-editor ((this nav-graph-editor)) +(defmethod inspect ((this nav-graph-editor)) (when (not this) (set! this this) (goto cfg-4) @@ -191,7 +183,7 @@ ;; definition for method 62 of type nav-graph-editor ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-62 nav-graph-editor ((this nav-graph-editor) (arg0 symbol) (arg1 symbol)) +(defmethod nav-graph-editor-method-62 ((this nav-graph-editor) (arg0 symbol) (arg1 symbol)) (case arg0 (('minimap) (set! (-> this vehicle-edit-mode) #t) @@ -211,27 +203,27 @@ ;; definition for method 63 of type nav-graph-editor ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-63 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-63 ((this nav-graph-editor)) (set! (-> this command-array length) 0) (exec-sql! (-> this nav-graph)) (none) ) ;; definition for method 10 of type nav-graph-editor -(defmethod deactivate nav-graph-editor ((this nav-graph-editor)) +(defmethod deactivate ((this nav-graph-editor)) (set! *nav-graph-editor* (the-as (pointer nav-graph-editor) #f)) ((method-of-type process deactivate) this) (none) ) ;; definition for method 7 of type nav-graph-editor -(defmethod relocate nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod relocate ((this nav-graph-editor) (arg0 int)) (call-parent-method this arg0) ) ;; definition for method 60 of type nav-graph-editor ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-60 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-60 ((this nav-graph-editor)) (let ((v0-0 (not (-> this vehicle-edit-mode)))) (set! (-> this vehicle-edit-mode) v0-0) (set! (-> this default-node nav_node_flag) (if v0-0 @@ -245,7 +237,7 @@ ;; definition for method 61 of type nav-graph-editor ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-61 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-61 ((this nav-graph-editor)) (set! (-> this hover-edit-mode) (not (-> this hover-edit-mode))) (none) ) @@ -253,7 +245,7 @@ ;; definition for method 54 of type nav-graph-editor ;; WARN: Return type mismatch symbol vs none. ;; WARN: Function (method 54 nav-graph-editor) has a return type of none, but the expression builder found a return statement. -(defmethod nav-graph-editor-method-54 nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-54 ((this nav-graph-editor) (arg0 int)) (when (not (-> this hover-edit-mode)) (let ((gp-0 (-> this nav-graph node-array data arg0))) (dotimes (s5-0 (-> *level* length)) @@ -300,7 +292,7 @@ ) ;; definition for method 30 of type nav-graph-editor -(defmethod nav-graph-editor-method-30 nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-30 ((this nav-graph-editor) (arg0 int)) (let ((s3-0 (-> this nav-graph edge-array data arg0)) (s4-0 (new 'stack-no-clear 'matrix)) ) @@ -399,7 +391,7 @@ ;; definition for method 33 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-33 nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-33 ((this nav-graph-editor) (arg0 int)) (let* ((gp-0 (-> this nav-graph edge-array data arg0)) (s5-0 (-> this nav-graph node-array data (-> gp-0 runtime-node-id-1))) (s3-0 (-> this nav-graph node-array data (-> gp-0 runtime-node-id-2))) @@ -433,7 +425,7 @@ ) ;; definition for method 31 of type nav-graph-editor -(defmethod nav-graph-editor-method-31 nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-31 ((this nav-graph-editor) (arg0 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -502,7 +494,7 @@ ;; definition for method 29 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-29 nav-graph-editor ((this nav-graph-editor) (arg0 string) (arg1 string) (arg2 string)) +(defmethod nav-graph-editor-method-29 ((this nav-graph-editor) (arg0 string) (arg1 string) (arg2 string)) (format *stdcon* "~0K") (format *stdcon* "~3L~18S~18S~18S~%~0L" "Left button" "Middle button" "Right button") (format *stdcon* "~18S~18S~18S~%" arg0 arg1 arg2) @@ -513,7 +505,7 @@ ;; definition for method 28 of type nav-graph-editor ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-28 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-28 ((this nav-graph-editor)) (local-vars (sv-144 int) (sv-160 (function _varargs_ object))) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -683,7 +675,7 @@ ;; definition for method 34 of type nav-graph-editor ;; INFO: Used lq/sq -(defmethod nav-graph-editor-method-34 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-34 ((this nav-graph-editor)) (with-pp (rlet ((acc :class vf) (vf0 :class vf) @@ -987,14 +979,14 @@ ;; definition for method 41 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-41 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-41 ((this nav-graph-editor)) (set! (-> this selected-index) -1) (none) ) ;; definition for method 42 of type nav-graph-editor ;; INFO: Used lq/sq -(defmethod nav-graph-editor-method-42 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-42 ((this nav-graph-editor)) (let ((s5-0 (-> this nav-graph))) (dotimes (s4-0 (-> s5-0 node-array length)) (let ((s3-0 (-> s5-0 node-array data s4-0))) @@ -1032,7 +1024,7 @@ ) ;; definition for method 44 of type nav-graph-editor -(defmethod nav-graph-editor-method-44 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-44 ((this nav-graph-editor)) (set! (-> this closest-node) -1) (set! (-> this dist-closest-node) 0.0) (let ((s5-0 (-> this nav-graph))) @@ -1057,7 +1049,7 @@ ;; definition for method 45 of type nav-graph-editor ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-45 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-45 ((this nav-graph-editor)) (set! (-> this closest-edge) -1) (set! (-> this dist-closest-edge) 0.0) (let ((s5-0 (-> this nav-graph))) @@ -1094,7 +1086,7 @@ ;; definition for method 43 of type nav-graph-editor ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-43 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-43 ((this nav-graph-editor)) (local-vars (sv-128 vector) (sv-144 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1170,7 +1162,7 @@ ;; definition for method 32 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-32 nav-graph-editor ((this nav-graph-editor) (arg0 symbol) (arg1 int)) +(defmethod nav-graph-editor-method-32 ((this nav-graph-editor) (arg0 symbol) (arg1 int)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) @@ -1241,14 +1233,14 @@ ;; definition for method 47 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-47 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-47 ((this nav-graph-editor)) (+! (-> this command-id) 1) (-> this command-id) (none) ) ;; definition for method 48 of type nav-graph-editor -(defmethod nav-graph-editor-method-48 nav-graph-editor ((this nav-graph-editor) (arg0 uint)) +(defmethod nav-graph-editor-method-48 ((this nav-graph-editor) (arg0 uint)) "TODO - enum / com-type" (let* ((v1-1 (-> this command-array length)) (v0-0 (-> this command-array data v1-1)) @@ -1262,13 +1254,13 @@ ) ;; definition for method 49 of type nav-graph-editor -(defmethod nav-graph-editor-method-49 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-49 ((this nav-graph-editor)) (-> this command-array data (+ (-> this command-array length) -1)) ) ;; definition for method 50 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-50 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-50 ((this nav-graph-editor)) (+! (-> this command-array length) -1) (set! (-> this max-command) (-> this command-array length)) (none) @@ -1276,7 +1268,7 @@ ;; definition for method 58 of type nav-graph-editor ;; WARN: new jak 2 until loop case, check carefully -(defmethod nav-graph-editor-method-58 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-58 ((this nav-graph-editor)) (if (zero? (-> this command-array length)) (return #f) ) @@ -1336,7 +1328,7 @@ ;; definition for method 51 of type nav-graph-editor ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-51 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-51 ((this nav-graph-editor)) (let ((gp-0 (alloc-new-node! (-> this nav-graph)))) (when (!= gp-0 -1) (let ((v1-6 (-> this nav-graph node-array data gp-0)) @@ -1357,7 +1349,7 @@ ;; definition for method 53 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-53 nav-graph-editor ((this nav-graph-editor) (arg0 int) (arg1 int)) +(defmethod nav-graph-editor-method-53 ((this nav-graph-editor) (arg0 int) (arg1 int)) (let ((s5-0 (indexof-visnode (-> this nav-graph) arg0 arg1))) (if (= s5-0 -1) (set! s5-0 (alloc-new-visnode! (-> this nav-graph) arg0 arg1)) @@ -1372,7 +1364,7 @@ ;; definition for method 52 of type nav-graph-editor ;; WARN: Return type mismatch int vs uint. -(defmethod nav-graph-editor-method-52 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-52 ((this nav-graph-editor)) (let ((gp-0 (alloc-new-edge! (-> this nav-graph)))) (when (!= gp-0 -1) (let ((v1-6 (-> this nav-graph edge-array data gp-0)) @@ -1396,7 +1388,7 @@ ) ;; definition for method 57 of type nav-graph-editor -(defmethod nav-graph-editor-method-57 nav-graph-editor ((this nav-graph-editor) (arg0 int) (arg1 int)) +(defmethod nav-graph-editor-method-57 ((this nav-graph-editor) (arg0 int) (arg1 int)) (case (indexof-visnode (-> this nav-graph) arg0 arg1) ((-1) (return (the-as int #f)) @@ -1414,7 +1406,7 @@ ;; definition for method 55 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-55 nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-55 ((this nav-graph-editor) (arg0 int)) (nav-graph-editor-method-47 this) (let ((s5-0 (-> this nav-graph node-array data arg0))) (logior! (-> s5-0 mysql-save-flag) (mysql-save-flag delete)) @@ -1446,7 +1438,7 @@ ;; definition for method 56 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-56 nav-graph-editor ((this nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-56 ((this nav-graph-editor) (arg0 int)) (nav-graph-editor-method-47 this) (let ((s5-0 (-> this nav-graph edge-array data arg0))) (logior! (-> s5-0 mysql-save-flag) (mysql-save-flag delete)) @@ -1492,7 +1484,7 @@ ) ;; definition for method 59 of type nav-graph-editor -(defmethod nav-graph-editor-method-59 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-59 ((this nav-graph-editor)) (if (cpad-pressed? 0 triangle) (nav-graph-editor-method-58 this) ) @@ -1504,7 +1496,7 @@ ) ;; definition for method 46 of type nav-graph-editor -(defmethod nav-graph-editor-method-46 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-46 ((this nav-graph-editor)) (if (cpad-pressed? 0 up) (go (method-of-object this create)) ) @@ -1533,7 +1525,7 @@ ;; definition for method 35 of type nav-graph-editor ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-35 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-35 ((this nav-graph-editor)) (nav-graph-editor-method-34 this) (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) (cond @@ -1641,7 +1633,7 @@ ;; definition for method 38 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-38 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-38 ((this nav-graph-editor)) (nav-graph-editor-method-41 this) (nav-graph-editor-method-34 this) (nav-graph-editor-method-42 this) @@ -1728,7 +1720,7 @@ ;; definition for method 37 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-37 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-37 ((this nav-graph-editor)) (nav-graph-editor-method-41 this) (nav-graph-editor-method-34 this) (nav-graph-editor-method-42 this) @@ -1918,7 +1910,7 @@ ;; definition for method 39 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-39 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-39 ((this nav-graph-editor)) (nav-graph-editor-method-41 this) (nav-graph-editor-method-34 this) (nav-graph-editor-method-42 this) @@ -1979,7 +1971,7 @@ ;; definition for method 40 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-40 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-40 ((this nav-graph-editor)) (nav-graph-editor-method-41 this) (nav-graph-editor-method-34 this) (nav-graph-editor-method-43 this) @@ -2080,7 +2072,7 @@ ;; definition for method 36 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-36 nav-graph-editor ((this nav-graph-editor)) +(defmethod nav-graph-editor-method-36 ((this nav-graph-editor)) (nav-graph-editor-method-41 this) (nav-graph-editor-method-34 this) (nav-graph-editor-method-42 this) diff --git a/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc b/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc index 9e46c857b93..31509c8bebf 100644 --- a/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc @@ -15,21 +15,17 @@ ;; definition of type part-tester (deftype part-tester (process) - ((root trsqv :offset-assert 128) - (part sparticle-launch-control :offset-assert 132) - (old-group sparticle-launch-group :offset-assert 136) + ((root trsqv) + (part sparticle-launch-control) + (old-group sparticle-launch-group) ) - :heap-base #x10 - :method-count-assert 14 - :size-assert #x8c - :flag-assert #xe0010008c (:states part-tester-idle ) ) ;; definition for method 3 of type part-tester -(defmethod inspect part-tester ((this part-tester)) +(defmethod inspect ((this part-tester)) (when (not this) (set! this this) (goto cfg-4) @@ -48,7 +44,7 @@ (define *part-tester-name* (the-as string #f)) ;; definition for method 10 of type part-tester -(defmethod deactivate part-tester ((this part-tester)) +(defmethod deactivate ((this part-tester)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) diff --git a/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc b/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc index 7b85f58773e..a7ede37f20e 100644 --- a/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc @@ -3,20 +3,17 @@ ;; definition of type tr-stat (deftype tr-stat (structure) - ((groups uint16 :offset-assert 0) - (fragments uint16 :offset-assert 2) - (tris uint32 :offset-assert 4) - (dverts uint32 :offset-assert 8) - (instances uint16 :offset-assert 12) - (pad uint16 :offset-assert 14) + ((groups uint16) + (fragments uint16) + (tris uint32) + (dverts uint32) + (instances uint16) + (pad uint16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type tr-stat -(defmethod inspect tr-stat ((this tr-stat)) +(defmethod inspect ((this tr-stat)) (when (not this) (set! this this) (goto cfg-4) @@ -34,17 +31,14 @@ ;; definition of type merc-global-stats (deftype merc-global-stats (structure) - ((merc tr-stat :inline :offset-assert 0) - (emerc tr-stat :inline :offset-assert 16) - (mercneric tr-stat :inline :offset-assert 32) + ((merc tr-stat :inline) + (emerc tr-stat :inline) + (mercneric tr-stat :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type merc-global-stats -(defmethod inspect merc-global-stats ((this merc-global-stats)) +(defmethod inspect ((this merc-global-stats)) (when (not this) (set! this this) (goto cfg-4) @@ -59,35 +53,32 @@ ;; definition of type perf-stat (deftype perf-stat (structure) - ((frame-number uint32 :offset-assert 0) - (count uint32 :offset-assert 4) - (cycles uint32 :offset-assert 8) - (instructions uint32 :offset-assert 12) - (icache uint32 :offset-assert 16) - (dcache uint32 :offset-assert 20) - (select uint32 :offset-assert 24) - (ctrl uint32 :offset-assert 28) - (accum0 uint32 :offset-assert 32) - (accum1 uint32 :offset-assert 36) - (to-vu0-waits uint32 :offset-assert 40) - (to-spr-waits uint32 :offset-assert 44) - (from-spr-waits uint32 :offset-assert 48) + ((frame-number uint32) + (count uint32) + (cycles uint32) + (instructions uint32) + (icache uint32) + (dcache uint32) + (select uint32) + (ctrl uint32) + (accum0 uint32) + (accum1 uint32) + (to-vu0-waits uint32) + (to-spr-waits uint32) + (from-spr-waits uint32) ) :pack-me - :method-count-assert 14 - :size-assert #x34 - :flag-assert #xe00000034 (:methods - (perf-stat-method-9 () none 9) - (print-to-stream (_type_ string basic) none 10) - (reset! (_type_) none 11) - (read! (_type_) none 12) - (update-wait-stats (_type_ uint uint uint) none 13) + (perf-stat-method-9 () none) + (print-to-stream (_type_ string basic) none) + (reset! (_type_) none) + (read! (_type_) none) + (update-wait-stats (_type_ uint uint uint) none) ) ) ;; definition for method 3 of type perf-stat -(defmethod inspect perf-stat ((this perf-stat)) +(defmethod inspect ((this perf-stat)) (when (not this) (set! this this) (goto cfg-4) @@ -274,15 +265,12 @@ ;; definition of type perf-stat-array (deftype perf-stat-array (inline-array-class) - ((data perf-stat :inline :dynamic :offset-assert 16) + ((data perf-stat :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type perf-stat-array -(defmethod inspect perf-stat-array ((this perf-stat-array)) +(defmethod inspect ((this perf-stat-array)) (when (not this) (set! this this) (goto cfg-4) @@ -300,7 +288,7 @@ ;; definition for method 11 of type perf-stat ;; WARN: Return type mismatch int vs none. -(defmethod reset! perf-stat ((this perf-stat)) +(defmethod reset! ((this perf-stat)) (let ((v1-0 (-> this ctrl))) (+! (-> this count) 1) (b! (zero? v1-0) cfg-2 :delay (nop!)) @@ -322,7 +310,7 @@ ;; definition for method 12 of type perf-stat ;; WARN: Return type mismatch int vs none. -(defmethod read! perf-stat ((this perf-stat)) +(defmethod read! ((this perf-stat)) (local-vars (v1-1 int) (v1-3 int)) (b! (zero? (-> this ctrl)) cfg-2 :delay (nop!)) (.mtc0 Perf 0) @@ -339,7 +327,7 @@ ;; definition for method 13 of type perf-stat ;; WARN: Return type mismatch int vs none. -(defmethod update-wait-stats perf-stat ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) +(defmethod update-wait-stats ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) (when (nonzero? (-> this ctrl)) (+! (-> this to-vu0-waits) arg0) (+! (-> this to-spr-waits) arg1) diff --git a/test/decompiler/reference/jak2/engine/debug/viewer_REF.gc b/test/decompiler/reference/jak2/engine/debug/viewer_REF.gc index f81ac679d7b..0d4df6c8254 100644 --- a/test/decompiler/reference/jak2/engine/debug/viewer_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/viewer_REF.gc @@ -10,19 +10,15 @@ ;; definition of type viewer (deftype viewer (process-drawable) - ((janim art-joint-anim :offset-assert 200) + ((janim art-joint-anim) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xcc - :flag-assert #x14005000cc (:states viewer-process ) ) ;; definition for method 3 of type viewer -(defmethod inspect viewer ((this viewer)) +(defmethod inspect ((this viewer)) (when (not this) (set! this this) (goto cfg-4) @@ -220,7 +216,7 @@ ;; definition for method 11 of type viewer ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! viewer ((this viewer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this viewer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/engine/dma/dma-buffer_REF.gc b/test/decompiler/reference/jak2/engine/dma/dma-buffer_REF.gc index 3346a7eb395..3a739384c33 100644 --- a/test/decompiler/reference/jak2/engine/dma/dma-buffer_REF.gc +++ b/test/decompiler/reference/jak2/engine/dma/dma-buffer_REF.gc @@ -3,19 +3,16 @@ ;; definition of type dma-packet (deftype dma-packet (structure) - ((dma dma-tag :offset-assert 0) - (vif0 vif-tag :offset-assert 8) - (vif1 vif-tag :offset-assert 12) - (quad uint128 :offset 0) + ((dma dma-tag) + (vif0 vif-tag) + (vif1 vif-tag) + (quad uint128 :overlay-at dma) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type dma-packet ;; INFO: Used lq/sq -(defmethod inspect dma-packet ((this dma-packet)) +(defmethod inspect ((this dma-packet)) (when (not this) (set! this this) (goto cfg-4) @@ -31,15 +28,12 @@ ;; definition of type dma-packet-array (deftype dma-packet-array (inline-array-class) - ((data dma-packet :inline :dynamic :offset-assert 16) + ((data dma-packet :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type dma-packet-array -(defmethod inspect dma-packet-array ((this dma-packet-array)) +(defmethod inspect ((this dma-packet-array)) (when (not this) (set! this this) (goto cfg-4) @@ -57,19 +51,16 @@ ;; definition of type dma-gif (deftype dma-gif (structure) - ((gif uint64 2 :offset-assert 0) - (quad uint128 :offset 0) - (gif0 uint64 :offset 0) - (gif1 uint64 :offset 8) + ((gif uint64 2) + (quad uint128 :overlay-at (-> gif 0)) + (gif0 uint64 :overlay-at (-> gif 0)) + (gif1 uint64 :overlay-at (-> gif 1)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type dma-gif ;; INFO: Used lq/sq -(defmethod inspect dma-gif ((this dma-gif)) +(defmethod inspect ((this dma-gif)) (when (not this) (set! this this) (goto cfg-4) @@ -83,19 +74,16 @@ ;; definition of type dma-gif-packet (deftype dma-gif-packet (structure) - ((dma-vif dma-packet :inline :offset-assert 0) - (gif uint64 2 :offset-assert 16) - (gif0 uint64 :offset 16) - (gif1 uint64 :offset 24) - (quad uint128 2 :offset 0) + ((dma-vif dma-packet :inline) + (gif uint64 2) + (gif0 uint64 :overlay-at (-> gif 0)) + (gif1 uint64 :overlay-at (-> gif 1)) + (quad uint128 2 :overlay-at (-> dma-vif dma)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type dma-gif-packet -(defmethod inspect dma-gif-packet ((this dma-gif-packet)) +(defmethod inspect ((this dma-gif-packet)) (when (not this) (set! this this) (goto cfg-4) @@ -110,22 +98,19 @@ ;; definition of type dma-buffer (deftype dma-buffer (basic) - ((allocated-length int32 :offset-assert 4) - (base pointer :offset-assert 8) - (end pointer :offset-assert 12) - (data uint64 1 :offset-assert 16) - (data-buffer uint8 :dynamic :offset 16) + ((allocated-length int32) + (base pointer) + (end pointer) + (data uint64 1) + (data-buffer uint8 :dynamic :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) ;; definition for method 3 of type dma-buffer -(defmethod inspect dma-buffer ((this dma-buffer)) +(defmethod inspect ((this dma-buffer)) (when (not this) (set! this this) (goto cfg-4) @@ -156,12 +141,12 @@ ) ;; definition for method 4 of type dma-buffer -(defmethod length dma-buffer ((this dma-buffer)) +(defmethod length ((this dma-buffer)) (-> this allocated-length) ) ;; definition for method 5 of type dma-buffer -(defmethod asize-of dma-buffer ((this dma-buffer)) +(defmethod asize-of ((this dma-buffer)) (+ (-> this allocated-length) -4 (-> dma-buffer size)) ) diff --git a/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc b/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc index 49ab02c88ba..58b71a8d59f 100644 --- a/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc +++ b/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc @@ -6,20 +6,17 @@ ;; definition of type vif-disasm-element (deftype vif-disasm-element (structure) - ((mask uint32 :offset-assert 0) - (tag vif-cmd-32 :offset-assert 4) - (val uint32 :offset-assert 8) - (print uint32 :offset-assert 12) - (string1 string :offset-assert 16) - (string2 string :offset-assert 20) + ((mask uint32) + (tag vif-cmd-32) + (val uint32) + (print uint32) + (string1 string) + (string2 string) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type vif-disasm-element -(defmethod inspect vif-disasm-element ((this vif-disasm-element)) +(defmethod inspect ((this vif-disasm-element)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/dma/dma-h_REF.gc b/test/decompiler/reference/jak2/engine/dma/dma-h_REF.gc index ec0764a8c8f..23c1167dbc9 100644 --- a/test/decompiler/reference/jak2/engine/dma/dma-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/dma/dma-h_REF.gc @@ -11,13 +11,10 @@ (str uint8 :offset 8 :size 1) (tag uint16 :offset 16 :size 16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type dma-chcr -(defmethod inspect dma-chcr ((this dma-chcr)) +(defmethod inspect ((this dma-chcr)) (when (not this) (set! this this) (goto cfg-4) @@ -36,17 +33,14 @@ ;; definition of type dma-bank (deftype dma-bank (structure) - ((chcr dma-chcr :offset 0) - (madr uint32 :offset 16) - (qwc uint32 :offset 32) + ((chcr dma-chcr :offset 0) + (madr uint32 :offset 16) + (qwc uint32 :offset 32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type dma-bank -(defmethod inspect dma-bank ((this dma-bank)) +(defmethod inspect ((this dma-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -61,15 +55,12 @@ ;; definition of type dma-bank-source (deftype dma-bank-source (dma-bank) - ((tadr uint32 :offset 48) + ((tadr uint32 :offset 48) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type dma-bank-source -(defmethod inspect dma-bank-source ((this dma-bank-source)) +(defmethod inspect ((this dma-bank-source)) (when (not this) (set! this this) (goto cfg-4) @@ -85,16 +76,13 @@ ;; definition of type dma-bank-vif (deftype dma-bank-vif (dma-bank-source) - ((as0 uint32 :offset 64) - (as1 uint32 :offset 80) + ((as0 uint32 :offset 64) + (as1 uint32 :offset 80) ) - :method-count-assert 9 - :size-assert #x54 - :flag-assert #x900000054 ) ;; definition for method 3 of type dma-bank-vif -(defmethod inspect dma-bank-vif ((this dma-bank-vif)) +(defmethod inspect ((this dma-bank-vif)) (when (not this) (set! this this) (goto cfg-4) @@ -112,15 +100,12 @@ ;; definition of type dma-bank-spr (deftype dma-bank-spr (dma-bank-source) - ((sadr uint32 :offset 128) + ((sadr uint32 :offset 128) ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) ;; definition for method 3 of type dma-bank-spr -(defmethod inspect dma-bank-spr ((this dma-bank-spr)) +(defmethod inspect ((this dma-bank-spr)) (when (not this) (set! this this) (goto cfg-4) @@ -144,18 +129,12 @@ (std uint8 :offset 6 :size 2) (rcyc uint8 :offset 8 :size 3) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type dma-enable (deftype dma-enable (uint32) ((cpnd uint8 :offset 16 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type dma-sqwc @@ -163,30 +142,24 @@ ((sqwc uint8 :offset 0 :size 8) (tqwc uint8 :offset 16 :size 8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type dma-bank-control (deftype dma-bank-control (structure) - ((ctrl dma-ctrl :offset 0) - (stat uint32 :offset 16) - (pcr uint32 :offset 32) - (sqwc dma-sqwc :offset 48) - (rbsr uint32 :offset 64) - (rbor uint32 :offset 80) - (stadr uint32 :offset 96) - (enabler uint32 :offset 5408) - (enablew uint32 :offset 5520) + ((ctrl dma-ctrl :offset 0) + (stat uint32 :offset 16) + (pcr uint32 :offset 32) + (sqwc dma-sqwc :offset 48) + (rbsr uint32 :offset 64) + (rbor uint32 :offset 80) + (stadr uint32 :offset 96) + (enabler uint32 :offset 5408) + (enablew uint32 :offset 5520) ) - :method-count-assert 9 - :size-assert #x1594 - :flag-assert #x900001594 ) ;; definition for method 3 of type dma-bank-control -(defmethod inspect dma-bank-control ((this dma-bank-control)) +(defmethod inspect ((this dma-bank-control)) (when (not this) (set! this this) (goto cfg-4) @@ -207,18 +180,15 @@ ;; definition of type vu-code-block (deftype vu-code-block (basic) - ((name basic :offset-assert 4) - (code uint32 :offset-assert 8) - (size int32 :offset-assert 12) - (dest-address uint32 :offset-assert 16) + ((name basic) + (code uint32) + (size int32) + (dest-address uint32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type vu-code-block -(defmethod inspect vu-code-block ((this vu-code-block)) +(defmethod inspect ((this vu-code-block)) (when (not this) (set! this this) (goto cfg-4) @@ -235,9 +205,6 @@ ;; definition of type vu-stat (deftype vu-stat (uint64) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type dma-tag @@ -249,13 +216,10 @@ (addr uint32 :offset 32 :size 31) (spr uint8 :offset 63 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type dma-tag -(defmethod inspect dma-tag ((this dma-tag)) +(defmethod inspect ((this dma-tag)) (when (not this) (set! this this) (goto cfg-4) @@ -273,21 +237,18 @@ ;; definition of type dma-bucket (deftype dma-bucket (structure) - ((tag dma-tag :offset-assert 0) - (last (pointer dma-tag) :offset-assert 8) - (dummy uint32 :offset-assert 12) - (next uint32 :offset 4) - (clear uint64 :offset 8) - (vif0 uint32 :offset 8) - (vif1 uint32 :offset 12) + ((tag dma-tag) + (last (pointer dma-tag)) + (dummy uint32) + (next uint32 :offset 4) + (clear uint64 :overlay-at last) + (vif0 uint32 :overlay-at last) + (vif1 uint32 :overlay-at dummy) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type dma-bucket -(defmethod inspect dma-bucket ((this dma-bucket)) +(defmethod inspect ((this dma-bucket)) (when (not this) (set! this this) (goto cfg-4) @@ -323,9 +284,6 @@ (m14 uint8 :offset 28 :size 2) (m15 uint8 :offset 30 :size 2) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type vif-stcycl-imm @@ -333,9 +291,6 @@ ((cl uint8 :offset 0 :size 8) (wl uint8 :offset 8 :size 8) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition of type vif-unpack-imm @@ -344,9 +299,6 @@ (usn uint8 :offset 14 :size 1) (flg uint8 :offset 15 :size 1) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition of type vif-tag @@ -357,13 +309,10 @@ (irq uint8 :offset 31 :size 1) (msk uint8 :offset 28 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type vif-tag -(defmethod inspect vif-tag ((this vif-tag)) +(defmethod inspect ((this vif-tag)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/draw/draw-node-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/draw-node-h_REF.gc index 87afc814685..a27f573e805 100644 --- a/test/decompiler/reference/jak2/engine/draw/draw-node-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/draw-node-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type draw-node (deftype draw-node (drawable) - ((child-count uint8 :offset 6) - (flags uint8 :offset 7) - (child drawable :offset 8) - (distance float :offset 12) + ((child-count uint8 :offset 6) + (flags uint8 :offset 7) + (child drawable :offset 8) + (distance float :offset 12) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition for method 3 of type draw-node -(defmethod inspect draw-node ((this draw-node)) +(defmethod inspect ((this draw-node)) (when (not this) (set! this this) (goto cfg-4) @@ -32,26 +29,20 @@ ;; definition of type drawable-inline-array-node (deftype drawable-inline-array-node (drawable-inline-array) - ((data draw-node 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 64) + ((data draw-node 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 ) ;; definition of type draw-node-dma (deftype draw-node-dma (structure) - ((banka draw-node 32 :inline :offset-assert 0) - (bankb draw-node 32 :inline :offset-assert 1024) + ((banka draw-node 32 :inline) + (bankb draw-node 32 :inline) ) - :method-count-assert 9 - :size-assert #x800 - :flag-assert #x900000800 ) ;; definition for method 3 of type draw-node-dma -(defmethod inspect draw-node-dma ((this draw-node-dma)) +(defmethod inspect ((this draw-node-dma)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc index 198bb60a886..0e8c9e727e6 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc @@ -3,15 +3,12 @@ ;; definition of type drawable-actor (deftype drawable-actor (drawable) - ((actor entity-actor :offset 8) + ((actor entity-actor :offset 8) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition for method 3 of type drawable-actor -(defmethod inspect drawable-actor ((this drawable-actor)) +(defmethod inspect ((this drawable-actor)) (when (not this) (set! this this) (goto cfg-4) @@ -27,24 +24,18 @@ ;; definition of type drawable-tree-actor (deftype drawable-tree-actor (drawable-tree) () - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition of type drawable-inline-array-actor (deftype drawable-inline-array-actor (drawable-inline-array) - ((data drawable-actor 1 :inline :offset-assert 32) - (pad uint8 4 :offset-assert 64) + ((data drawable-actor 1 :inline) + (pad uint8 4) ) - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 ) ;; definition for method 10 of type drawable-tree-actor ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-actor ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-group-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-group-h_REF.gc index 4b883edad06..56a6953c4bd 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-group-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-group-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type drawable-group (deftype drawable-group (drawable) - ((length int16 :offset 6) - (data drawable :dynamic :offset-assert 32) + ((length int16 :offset 6) + (data drawable :dynamic) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) ;; definition for method 3 of type drawable-group -(defmethod inspect drawable-group ((this drawable-group)) +(defmethod inspect ((this drawable-group)) (when (not this) (set! this this) (goto cfg-7) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-group_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-group_REF.gc index 1db9800792b..e9311c442a7 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-group_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-group_REF.gc @@ -11,7 +11,7 @@ ) ;; definition for method 2 of type drawable-group -(defmethod print drawable-group ((this drawable-group)) +(defmethod print ((this drawable-group)) (format #t "#<~A @ #x~X [~D]" (-> this type) this (-> this length)) (dotimes (idx (-> this length)) (format #t " ~A" (-> this data idx)) @@ -21,18 +21,18 @@ ) ;; definition for method 4 of type drawable-group -(defmethod length drawable-group ((this drawable-group)) +(defmethod length ((this drawable-group)) (-> this length) ) ;; definition for method 5 of type drawable-group ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of drawable-group ((this drawable-group)) +(defmethod asize-of ((this drawable-group)) (the-as int (+ (-> drawable-group size) (* (-> this length) 4))) ) ;; definition for method 8 of type drawable-group -(defmethod mem-usage drawable-group ((this drawable-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) "drawable-group") (+! (-> arg0 data 0 count) 1) @@ -47,7 +47,7 @@ ) ;; definition for method 9 of type drawable-group -(defmethod login drawable-group ((this drawable-group)) +(defmethod login ((this drawable-group)) (dotimes (idx (-> this length)) (login (-> this data idx)) ) @@ -56,7 +56,7 @@ ;; definition for method 10 of type drawable-group ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-group ((this drawable-group) (arg0 drawable-group) (arg1 display-frame)) +(defmethod draw ((this drawable-group) (arg0 drawable-group) (arg1 display-frame)) (when (vis-cull (-> this id)) (when (sphere-cull (-> this bsphere)) (dotimes (idx (-> this length)) @@ -70,7 +70,7 @@ ;; definition for method 13 of type drawable-group ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-group ((this drawable-group)) +(defmethod collect-stats ((this drawable-group)) (when (vis-cull (-> this id)) (when (sphere-cull (-> this bsphere)) (dotimes (idx (-> this length)) @@ -84,7 +84,7 @@ ;; definition for method 14 of type drawable-group ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-group ((this drawable-group) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-group) (arg0 drawable) (arg1 display-frame)) (when (vis-cull (-> this id)) (when (sphere-cull (-> this bsphere)) (dotimes (idx (-> this length)) @@ -97,7 +97,7 @@ ) ;; definition for method 15 of type drawable-group -(defmethod unpack-vis drawable-group ((this drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) (dotimes (idx (-> this length)) (set! arg1 (unpack-vis (-> this data idx) arg0 arg1)) ) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-h_REF.gc index 9be1f7e4e5e..198bbf1b8ea 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-h_REF.gc @@ -3,26 +3,23 @@ ;; definition of type drawable (deftype drawable (basic) - ((id int16 :offset-assert 4) - (bsphere vector :inline :offset-assert 16) + ((id int16) + (bsphere vector :inline) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 (:methods - (login (_type_) _type_ 9) - (draw (_type_ _type_ display-frame) none 10) - (fill-collide-list-from-box (_type_ int collide-list collide-query) int 11) - (fill-collide-list-from-line-sphere (_type_ int collide-list collide-query) int 12) - (collect-stats (_type_) none 13) - (debug-draw (_type_ drawable display-frame) none 14) - (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 15) - (collect-regions (_type_ sphere int region-prim-list) none 16) + (login (_type_) _type_) + (draw (_type_ _type_ display-frame) none) + (fill-collide-list-from-box (_type_ int collide-list collide-query) int) + (fill-collide-list-from-line-sphere (_type_ int collide-list collide-query) int) + (collect-stats (_type_) none) + (debug-draw (_type_ drawable display-frame) none) + (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8)) + (collect-regions (_type_ sphere int region-prim-list) none) ) ) ;; definition for method 3 of type drawable -(defmethod inspect drawable ((this drawable)) +(defmethod inspect ((this drawable)) (when (not this) (set! this this) (goto cfg-4) @@ -36,15 +33,12 @@ ;; definition of type drawable-error (deftype drawable-error (drawable) - ((name string :offset-assert 32) + ((name string) ) - :method-count-assert 17 - :size-assert #x24 - :flag-assert #x1100000024 ) ;; definition for method 3 of type drawable-error -(defmethod inspect drawable-error ((this drawable-error)) +(defmethod inspect ((this drawable-error)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-inline-array-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-inline-array-h_REF.gc index c22a990b69c..de74ab4d3f7 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-inline-array-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-inline-array-h_REF.gc @@ -3,15 +3,12 @@ ;; definition of type drawable-inline-array (deftype drawable-inline-array (drawable) - ((length int16 :offset 6) + ((length int16 :offset 6) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition for method 3 of type drawable-inline-array -(defmethod inspect drawable-inline-array ((this drawable-inline-array)) +(defmethod inspect ((this drawable-inline-array)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-inline-array_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-inline-array_REF.gc index 7f769aefae9..78f95c2c4c5 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-inline-array_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-inline-array_REF.gc @@ -2,32 +2,32 @@ (in-package goal) ;; definition for method 4 of type drawable-inline-array -(defmethod length drawable-inline-array ((this drawable-inline-array)) +(defmethod length ((this drawable-inline-array)) (-> this length) ) ;; definition for method 9 of type drawable-inline-array -(defmethod login drawable-inline-array ((this drawable-inline-array)) +(defmethod login ((this drawable-inline-array)) this ) ;; definition for method 10 of type drawable-inline-array ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) +(defmethod draw ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) 0 (none) ) ;; definition for method 13 of type drawable-inline-array ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-inline-array ((this drawable-inline-array)) +(defmethod collect-stats ((this drawable-inline-array)) 0 (none) ) ;; definition for method 14 of type drawable-inline-array ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-tree-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-tree-h_REF.gc index 9d2e2c433a6..97f3eca17e1 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-tree-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-tree-h_REF.gc @@ -4,23 +4,13 @@ ;; definition of type drawable-tree (deftype drawable-tree (drawable-group) () - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition of type drawable-tree-array (deftype drawable-tree-array (drawable-group) - ((trees drawable-tree :dynamic :offset 32) + ((trees drawable-tree :dynamic :offset 32) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-tree_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-tree_REF.gc index cb60f58e517..9470e6363e4 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-tree_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-tree_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 10 of type drawable-tree-array ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) (case (-> *level* draw-level *draw-index* display?) (('special #f) ) @@ -19,7 +19,7 @@ ;; definition for method 13 of type drawable-tree-array ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-tree-array ((this drawable-tree-array)) +(defmethod collect-stats ((this drawable-tree-array)) (dotimes (idx (-> this length)) (collect-stats (-> this trees idx)) ) @@ -29,7 +29,7 @@ ;; definition for method 14 of type drawable-tree-array ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-array) (arg0 drawable) (arg1 display-frame)) (dotimes (idx (-> this length)) (debug-draw (-> this trees idx) (-> (the-as drawable-tree-array arg0) trees idx) arg1) ) @@ -38,7 +38,7 @@ ) ;; definition for method 15 of type drawable-tree -(defmethod unpack-vis drawable-tree ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) (local-vars (t5-1 uint)) (let* ((v1-0 (the-as drawable-inline-array-node (-> this data 0))) (a3-1 (/ (-> v1-0 data 0 id) 8)) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc index 85a53a11b9d..55a75407c13 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc @@ -192,30 +192,30 @@ ) ;; definition for method 9 of type drawable -(defmethod login drawable ((this drawable)) +(defmethod login ((this drawable)) this ) ;; definition for method 10 of type drawable ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod draw ((this drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) ;; definition for method 11 of type drawable -(defmethod fill-collide-list-from-box drawable ((this drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) +(defmethod fill-collide-list-from-box ((this drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) 0 ) ;; definition for method 12 of type drawable -(defmethod fill-collide-list-from-line-sphere drawable ((this drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) +(defmethod fill-collide-list-from-line-sphere ((this drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) 0 ) ;; definition for method 16 of type drawable ;; WARN: Return type mismatch int vs none. -(defmethod collect-regions drawable ((this drawable) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions ((this drawable) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @@ -227,28 +227,28 @@ ;; definition for method 13 of type drawable ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable ((this drawable)) +(defmethod collect-stats ((this drawable)) 0 (none) ) ;; definition for method 14 of type drawable ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) ;; definition for method 10 of type drawable-error ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-error ((this drawable-error) (arg0 drawable-error) (arg1 display-frame)) +(defmethod draw ((this drawable-error) (arg0 drawable-error) (arg1 display-frame)) (error-sphere arg0 (-> arg0 name)) 0 (none) ) ;; definition for method 15 of type drawable -(defmethod unpack-vis drawable ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) diff --git a/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc b/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc index fc35bc3f16d..8d520a50f21 100644 --- a/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc @@ -34,37 +34,34 @@ ;; definition of type actor-link-info (deftype actor-link-info (basic) - ((process process :offset-assert 4) - (next entity-actor :offset-assert 8) - (prev entity-actor :offset-assert 12) + ((process process) + (next entity-actor) + (prev entity-actor) ) - :method-count-assert 26 - :size-assert #x10 - :flag-assert #x1a00000010 (:methods - (new (symbol type process symbol) _type_ 0) - (get-matching-actor-type-mask (_type_ type) int 9) - (actor-count-before (_type_) int 10) - (link-to-next-and-prev-actor (_type_) actor-link-info 11) - (get-next (_type_) entity-actor 12) - (get-prev (_type_) entity-actor 13) - (get-next-process (_type_) process 14) - (get-prev-process (_type_) process 15) - (apply-function-forward (_type_ (function entity-actor object object) object) int 16) - (apply-function-reverse (_type_ (function entity-actor object object) object) int 17) - (apply-all (_type_ (function entity-actor object object) object) int 18) - (send-to-all (_type_ symbol) none 19) - (send-to-all-after (_type_ symbol) object 20) - (send-to-all-before (_type_ symbol) object 21) - (send-to-next-and-prev (_type_ symbol) none 22) - (send-to-next (_type_ symbol) none 23) - (send-to-prev (_type_ symbol) none 24) - (actor-count (_type_) int 25) + (new (symbol type process symbol) _type_) + (get-matching-actor-type-mask (_type_ type) int) + (actor-count-before (_type_) int) + (link-to-next-and-prev-actor (_type_) actor-link-info) + (get-next (_type_) entity-actor) + (get-prev (_type_) entity-actor) + (get-next-process (_type_) process) + (get-prev-process (_type_) process) + (apply-function-forward (_type_ (function entity-actor object object) object) int) + (apply-function-reverse (_type_ (function entity-actor object object) object) int) + (apply-all (_type_ (function entity-actor object object) object) int) + (send-to-all (_type_ symbol) none) + (send-to-all-after (_type_ symbol) object) + (send-to-all-before (_type_ symbol) object) + (send-to-next-and-prev (_type_ symbol) none) + (send-to-next (_type_ symbol) none) + (send-to-prev (_type_ symbol) none) + (actor-count (_type_) int) ) ) ;; definition for method 3 of type actor-link-info -(defmethod inspect actor-link-info ((this actor-link-info)) +(defmethod inspect ((this actor-link-info)) (when (not this) (set! this this) (goto cfg-4) @@ -78,12 +75,12 @@ ) ;; definition for method 27 of type entity-actor -(defmethod next-actor entity-actor ((this entity-actor)) +(defmethod next-actor ((this entity-actor)) (entity-actor-lookup this 'next-actor 0) ) ;; definition for method 28 of type entity-actor -(defmethod prev-actor entity-actor ((this entity-actor)) +(defmethod prev-actor ((this entity-actor)) (entity-actor-lookup this 'prev-actor 0) ) @@ -106,29 +103,29 @@ ) ;; definition for method 12 of type actor-link-info -(defmethod get-next actor-link-info ((this actor-link-info)) +(defmethod get-next ((this actor-link-info)) (-> this next) ) ;; definition for method 13 of type actor-link-info -(defmethod get-prev actor-link-info ((this actor-link-info)) +(defmethod get-prev ((this actor-link-info)) (-> this prev) ) ;; definition for method 14 of type actor-link-info ;; WARN: Return type mismatch basic vs process. -(defmethod get-next-process actor-link-info ((this actor-link-info)) +(defmethod get-next-process ((this actor-link-info)) (the-as process (and (-> this next) (-> this next extra process))) ) ;; definition for method 15 of type actor-link-info ;; WARN: Return type mismatch basic vs process. -(defmethod get-prev-process actor-link-info ((this actor-link-info)) +(defmethod get-prev-process ((this actor-link-info)) (the-as process (and (-> this prev) (-> this prev extra process))) ) ;; definition for method 11 of type actor-link-info -(defmethod link-to-next-and-prev-actor actor-link-info ((this actor-link-info)) +(defmethod link-to-next-and-prev-actor ((this actor-link-info)) (let ((a0-1 (-> this process entity))) (set! (-> this next) (entity-actor-lookup a0-1 'next-actor 0)) ) @@ -139,7 +136,7 @@ ) ;; definition for method 16 of type actor-link-info -(defmethod apply-function-forward actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) +(defmethod apply-function-forward ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) (let ((s3-0 (-> this next))) (while s3-0 (if (arg0 s3-0 arg1) @@ -152,7 +149,7 @@ ) ;; definition for method 17 of type actor-link-info -(defmethod apply-function-reverse actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) +(defmethod apply-function-reverse ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) (let ((s3-0 (-> this prev))) (while s3-0 (if (arg0 s3-0 arg1) @@ -165,7 +162,7 @@ ) ;; definition for method 18 of type actor-link-info -(defmethod apply-all actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) +(defmethod apply-all ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) (let ((s4-0 (-> this process entity))) (while (let ((a0-2 s4-0)) (entity-actor-lookup a0-2 'prev-actor 0) @@ -185,7 +182,7 @@ ) ;; definition for method 20 of type actor-link-info -(defmethod send-to-all-after actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-all-after ((this actor-link-info) (arg0 symbol)) (with-pp (let ((s4-0 (-> this next)) (s5-0 (the-as object #f)) @@ -209,7 +206,7 @@ ) ;; definition for method 21 of type actor-link-info -(defmethod send-to-all-before actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-all-before ((this actor-link-info) (arg0 symbol)) (with-pp (let ((s4-0 (-> this prev)) (s5-0 (the-as object #f)) @@ -234,7 +231,7 @@ ;; definition for method 23 of type actor-link-info ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-next actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-next ((this actor-link-info) (arg0 symbol)) (let ((a0-1 (-> this next))) (when a0-1 (let ((a0-2 (-> a0-1 extra process))) @@ -249,7 +246,7 @@ ;; definition for method 24 of type actor-link-info ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-prev actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-prev ((this actor-link-info) (arg0 symbol)) (let ((a0-1 (-> this prev))) (when a0-1 (let ((a0-2 (-> a0-1 extra process))) @@ -264,7 +261,7 @@ ;; definition for method 22 of type actor-link-info ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-next-and-prev actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-next-and-prev ((this actor-link-info) (arg0 symbol)) (send-to-next this arg0) (send-to-prev this arg0) (none) @@ -272,14 +269,14 @@ ;; definition for method 19 of type actor-link-info ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-all actor-link-info ((this actor-link-info) (arg0 symbol)) +(defmethod send-to-all ((this actor-link-info) (arg0 symbol)) (send-to-all-after this arg0) (send-to-all-before this arg0) (none) ) ;; definition for method 25 of type actor-link-info -(defmethod actor-count actor-link-info ((this actor-link-info)) +(defmethod actor-count ((this actor-link-info)) (let ((s5-0 (-> this process entity)) (gp-0 0) ) @@ -299,7 +296,7 @@ ) ;; definition for method 9 of type actor-link-info -(defmethod get-matching-actor-type-mask actor-link-info ((this actor-link-info) (arg0 type)) +(defmethod get-matching-actor-type-mask ((this actor-link-info) (arg0 type)) (let ((s3-0 (-> this process entity)) (s5-0 0) ) @@ -324,7 +321,7 @@ ) ;; definition for method 10 of type actor-link-info -(defmethod actor-count-before actor-link-info ((this actor-link-info)) +(defmethod actor-count-before ((this actor-link-info)) (let* ((s5-0 (-> this process entity)) (s4-0 s5-0) (gp-0 0) diff --git a/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc b/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc index f01cfc69e72..d5a831f52d8 100644 --- a/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc @@ -12,32 +12,29 @@ ;; definition of type entity-perm (deftype entity-perm (structure) - ((user-object object 2 :offset-assert 0) - (user-uint64 uint64 :offset 0) - (user-float float 2 :offset 0) - (user-int32 int32 2 :offset 0) - (user-uint32 uint32 2 :offset 0) - (user-int16 int16 4 :offset 0) - (user-uint16 uint16 4 :offset 0) - (user-int8 int8 8 :offset 0) - (user-uint8 uint8 8 :offset 0) - (status entity-perm-status :offset 8) - (dummy uint8 1 :offset 10) - (task game-task :offset 11) - (aid actor-id :offset 12) - (quad uint128 :offset 0) + ((user-object object 2) + (user-uint64 uint64 :overlay-at (-> user-object 0)) + (user-float float 2 :overlay-at (-> user-object 0)) + (user-int32 int32 2 :overlay-at (-> user-object 0)) + (user-uint32 uint32 2 :overlay-at (-> user-object 0)) + (user-int16 int16 4 :overlay-at (-> user-object 0)) + (user-uint16 uint16 4 :overlay-at (-> user-object 0)) + (user-int8 int8 8 :overlay-at (-> user-object 0)) + (user-uint8 uint8 8 :overlay-at (-> user-object 0)) + (status entity-perm-status :offset 8) + (dummy uint8 1 :offset 10) + (task game-task :offset 11) + (aid actor-id :offset 12) + (quad uint128 :overlay-at (-> user-object 0)) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (update (_type_ symbol entity-perm-status) _type_ 9) + (update (_type_ symbol entity-perm-status) _type_) ) ) ;; definition for method 3 of type entity-perm ;; INFO: Used lq/sq -(defmethod inspect entity-perm ((this entity-perm)) +(defmethod inspect ((this entity-perm)) (when (not this) (set! this this) (goto cfg-4) @@ -63,30 +60,27 @@ ;; definition of type entity-links (deftype entity-links (structure) - ((prev-link entity-links :offset-assert 0) - (next-link entity-links :offset-assert 4) - (entity entity :offset-assert 8) - (process process :offset-assert 12) - (level level :offset-assert 16) - (vis-id int32 :offset-assert 20) - (kill-mask task-mask :offset-assert 24) - (vis-dist meters :offset-assert 28) - (trans vector :inline :offset-assert 32) - (perm entity-perm :inline :offset-assert 48) - (status uint16 :offset 56) - (aid uint32 :offset 60) - (task uint8 :offset 59) + ((prev-link entity-links) + (next-link entity-links) + (entity entity) + (process process) + (level level) + (vis-id int32) + (kill-mask task-mask) + (vis-dist meters) + (trans vector :inline) + (perm entity-perm :inline) + (status uint16 :overlay-at (-> perm status)) + (aid uint32 :overlay-at (-> perm aid)) + (task uint8 :overlay-at (-> perm task)) ) - :method-count-assert 10 - :size-assert #x40 - :flag-assert #xa00000040 (:methods - (birth? (_type_ vector) symbol 9) + (birth? (_type_ vector) symbol) ) ) ;; definition for method 3 of type entity-links -(defmethod inspect entity-links ((this entity-links)) +(defmethod inspect ((this entity-links)) (when (not this) (set! this this) (goto cfg-42) @@ -171,15 +165,12 @@ ;; definition of type entity-perm-array (deftype entity-perm-array (inline-array-class) - ((data entity-perm :inline :dynamic :offset-assert 16) + ((data entity-perm :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type entity-perm-array -(defmethod inspect entity-perm-array ((this entity-perm-array)) +(defmethod inspect ((this entity-perm-array)) (when (not this) (set! this this) (goto cfg-4) @@ -197,15 +188,12 @@ ;; definition of type entity-links-array (deftype entity-links-array (inline-array-class) - ((data entity-links :inline :dynamic :offset-assert 16) + ((data entity-links :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type entity-links-array -(defmethod inspect entity-links-array ((this entity-links-array)) +(defmethod inspect ((this entity-links-array)) (when (not this) (set! this this) (goto cfg-4) @@ -223,90 +211,72 @@ ;; definition of type entity (deftype entity (res-lump) - ((trans vector :inline :offset-assert 32) - (aid uint32 :offset-assert 48) + ((trans vector :inline) + (aid uint32) ) - :method-count-assert 27 - :size-assert #x34 - :flag-assert #x1b00000034 (:methods - (birth! (_type_) _type_ 22) - (kill! (_type_) _type_ 23) - (add-to-level! (_type_ level-group level actor-id) none 24) - (remove-from-level! (_type_ level-group) _type_ 25) - (get-level (_type_) level 26) + (birth! (_type_) _type_) + (kill! (_type_) _type_) + (add-to-level! (_type_ level-group level actor-id) none) + (remove-from-level! (_type_ level-group) _type_) + (get-level (_type_) level) ) ) ;; definition of type entity-camera (deftype entity-camera (entity) - ((connect connectable :inline :offset-assert 64) + ((connect connectable :inline) ) - :method-count-assert 27 - :size-assert #x50 - :flag-assert #x1b00000050 ) ;; definition of type entity-nav-mesh (deftype entity-nav-mesh (entity) - ((nav-mesh nav-mesh :offset-assert 52) + ((nav-mesh nav-mesh) ) - :method-count-assert 29 - :size-assert #x38 - :flag-assert #x1d00000038 (:methods - (initialize-nav-mesh! (_type_) none 27) - (debug-draw (_type_) none 28) + (initialize-nav-mesh! (_type_) none) + (debug-draw (_type_) none) ) ) ;; definition of type entity-race-mesh (deftype entity-race-mesh (entity) - ((race-mesh race-mesh :offset-assert 52) + ((race-mesh race-mesh) ) - :method-count-assert 29 - :size-assert #x38 - :flag-assert #x1d00000038 (:methods - (entity-race-mesh-method-27 () none 27) - (entity-race-mesh-method-28 () none 28) + (entity-race-mesh-method-27 () none) + (entity-race-mesh-method-28 () none) ) ) ;; definition of type entity-actor (deftype entity-actor (entity) - ((etype type :offset 56) - (task game-task :offset-assert 60) - (kill-mask task-mask :offset 52) - (vis-id int16 :offset-assert 62) - (quat quaternion :inline :offset-assert 64) + ((etype type :offset 56) + (task game-task) + (kill-mask task-mask :offset 52) + (vis-id int16) + (quat quaternion :inline) ) - :method-count-assert 33 - :size-assert #x50 - :flag-assert #x2100000050 (:methods - (next-actor (_type_) entity-actor 27) - (prev-actor (_type_) entity-actor 28) - (debug-print (_type_ symbol type) none 29) - (toggle-status (_type_ entity-perm-status symbol) none 30) - (get-simple-travel-vector (_type_ vector vector vector object float) nav-mesh 31) - (project-point-to-nav-mesh (_type_ vector vector nav-poly float) nav-poly 32) + (next-actor (_type_) entity-actor) + (prev-actor (_type_) entity-actor) + (debug-print (_type_ symbol type) none) + (toggle-status (_type_ entity-perm-status symbol) none) + (get-simple-travel-vector (_type_ vector vector vector object float) nav-mesh) + (project-point-to-nav-mesh (_type_ vector vector nav-poly float) nav-poly) ) ) ;; definition of type actor-reference (deftype actor-reference (structure) - ((actor entity :offset-assert 0) - (id uint32 :offset-assert 4) + ((actor entity) + (id uint32) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type actor-reference -(defmethod inspect actor-reference ((this actor-reference)) +(defmethod inspect ((this actor-reference)) (when (not this) (set! this this) (goto cfg-4) @@ -320,15 +290,12 @@ ;; definition of type actor-group (deftype actor-group (inline-array-class) - ((data actor-reference :inline :dynamic :offset-assert 16) + ((data actor-reference :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type actor-group -(defmethod inspect actor-group ((this actor-group)) +(defmethod inspect ((this actor-group)) (when (not this) (set! this this) (goto cfg-4) @@ -346,19 +313,16 @@ ;; definition of type entity-info (deftype entity-info (basic) - ((ptype type :offset-assert 4) - (package string :offset-assert 8) - (art-group pair :offset-assert 12) - (pool symbol :offset-assert 16) - (heap-size int32 :offset-assert 20) + ((ptype type) + (package string) + (art-group pair) + (pool symbol) + (heap-size int32) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type entity-info -(defmethod inspect entity-info ((this entity-info)) +(defmethod inspect ((this entity-info)) (when (not this) (set! this this) (goto cfg-4) @@ -375,17 +339,14 @@ ;; definition of type actor-bank (deftype actor-bank (basic) - ((pause-dist meters :offset-assert 4) - (birth-dist meters :offset-assert 8) - (birth-max int32 :offset-assert 12) + ((pause-dist meters) + (birth-dist meters) + (birth-max int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type actor-bank -(defmethod inspect actor-bank ((this actor-bank)) +(defmethod inspect ((this actor-bank)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc index 33d04ef4325..47dd3a29d01 100644 --- a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc @@ -12,7 +12,7 @@ ;; definition for method 8 of type drawable-actor ;; WARN: Return type mismatch int vs drawable-actor. -(defmethod mem-usage drawable-actor ((this drawable-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 44 (-> arg0 length))) (set! (-> arg0 data 43 name) "entity") (+! (-> arg0 data 43 count) 1) @@ -26,7 +26,7 @@ ;; definition for method 8 of type drawable-inline-array-actor ;; WARN: Return type mismatch int vs drawable-inline-array-actor. -(defmethod mem-usage drawable-inline-array-actor ((this drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -41,13 +41,13 @@ ) ;; definition for method 2 of type entity-links -(defmethod print entity-links ((this entity-links)) +(defmethod print ((this entity-links)) (format #t "#" (-> this process) this) this ) ;; definition for method 2 of type entity-perm -(defmethod print entity-perm ((this entity-perm)) +(defmethod print ((this entity-perm)) (format #t "#" @@ -61,7 +61,7 @@ ) ;; definition for method 2 of type actor-group -(defmethod print actor-group ((this actor-group)) +(defmethod print ((this actor-group)) (format #t "# this length)) (format #t " ~A" (-> this data s5-0 actor)) @@ -71,7 +71,7 @@ ) ;; definition for method 3 of type actor-group -(defmethod inspect actor-group ((this actor-group)) +(defmethod inspect ((this actor-group)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -83,25 +83,25 @@ ) ;; definition for method 22 of type entity -(defmethod birth! entity ((this entity)) +(defmethod birth! ((this entity)) (format #t "birth ~A~%" this) this ) ;; definition for method 23 of type entity -(defmethod kill! entity ((this entity)) +(defmethod kill! ((this entity)) (format #t "kill ~A~%" this) this ) ;; definition for method 2 of type entity -(defmethod print entity ((this entity)) +(defmethod print ((this entity)) (format #t "#<~A :name ~S @ #x~X>" (-> this type) (res-lump-struct this 'name structure) this) this ) ;; definition for method 26 of type entity -(defmethod get-level entity ((this entity)) +(defmethod get-level ((this entity)) (dotimes (v1-0 (-> *level* length)) (let ((a1-3 (-> *level* level v1-0))) (when (= (-> a1-3 status) 'active) @@ -257,7 +257,7 @@ ;; definition for method 18 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod update-nav-meshes-method level-group ((this level-group)) +(defmethod update-nav-meshes-method ((this level-group)) "Clashes with a function name" (when (not (paused?)) (dotimes (s5-0 (-> this length)) @@ -530,7 +530,7 @@ ) ;; definition for method 2 of type process -(defmethod print process ((this process)) +(defmethod print ((this process)) (cond ((and (-> this top-thread) (!= (-> this status) 'dead)) (format @@ -572,7 +572,7 @@ ) ;; definition for method 3 of type entity -(defmethod inspect entity ((this entity)) +(defmethod inspect ((this entity)) (call-parent-method this) (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) (format #t "~Taid: ~D~%" (-> this aid)) @@ -580,7 +580,7 @@ ) ;; definition for method 3 of type entity-nav-mesh -(defmethod inspect entity-nav-mesh ((this entity-nav-mesh)) +(defmethod inspect ((this entity-nav-mesh)) ((the-as (function object object) (find-parent-method entity-nav-mesh 3)) this) (format #t "~Tnav-mesh ~A~%" (-> this nav-mesh)) (if (and (-> this nav-mesh) (nonzero? (-> this nav-mesh))) @@ -590,7 +590,7 @@ ) ;; definition for method 3 of type entity-actor -(defmethod inspect entity-actor ((this entity-actor)) +(defmethod inspect ((this entity-actor)) (call-parent-method this) (format #t "~Tetype: ~A~%" (-> this etype)) (format #t "~Ttask: ~d~%" (-> this task)) @@ -662,7 +662,7 @@ ;; definition for method 29 of type entity-actor ;; WARN: Return type mismatch entity-actor vs none. -(defmethod debug-print entity-actor ((this entity-actor) (arg0 symbol) (arg1 type)) +(defmethod debug-print ((this entity-actor) (arg0 symbol) (arg1 type)) (let ((s4-0 (-> this etype))) (when (or (not arg1) (and s4-0 (valid? s4-0 type (the-as string #f) #f 0) (type-type? s4-0 arg1))) (format #t "~5D #x~8X ~-26S" (-> this extra vis-id) this (res-lump-struct this 'name structure)) @@ -736,7 +736,7 @@ ;; definition for method 14 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod debug-print-entities level-group ((this level-group) (arg0 symbol) (arg1 type)) +(defmethod debug-print-entities ((this level-group) (arg0 symbol) (arg1 type)) (let ((t9-0 format) (a0-1 #t) (a1-1 @@ -776,7 +776,7 @@ ;; definition for method 24 of type entity-actor ;; INFO: Used lq/sq ;; WARN: Return type mismatch entity-actor vs none. -(defmethod add-to-level! entity-actor ((this entity-actor) (arg0 level-group) (arg1 level) (arg2 actor-id)) +(defmethod add-to-level! ((this entity-actor) (arg0 level-group) (arg1 level) (arg2 actor-id)) (let ((v1-4 (-> arg1 entity data (-> arg1 entity length)))) (+! (-> arg1 entity length) 1) (set! (-> v1-4 process) #f) @@ -848,7 +848,7 @@ ) ;; definition for method 25 of type entity -(defmethod remove-from-level! entity ((this entity) (arg0 level-group)) +(defmethod remove-from-level! ((this entity) (arg0 level-group)) (let ((v1-0 (-> this extra))) (cond ((= (-> v1-0 next-link) v1-0) @@ -887,7 +887,7 @@ ;; definition for method 25 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod update-vis-volumes level-group ((this level-group)) +(defmethod update-vis-volumes ((this level-group)) (local-vars (sv-16 pointer) (sv-20 pointer) (sv-24 pointer) (sv-28 process)) (dotimes (s5-0 (-> this length)) (let ((v1-3 (-> this level s5-0))) @@ -986,7 +986,7 @@ ;; WARN: Stack slot offset 32 signed mismatch ;; WARN: Stack slot offset 32 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod update-vis-volumes-from-nav-mesh level-group ((this level-group)) +(defmethod update-vis-volumes-from-nav-mesh ((this level-group)) (local-vars (sv-16 pointer) (sv-20 vector) @@ -1092,7 +1092,7 @@ ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod print-volume-sizes level-group ((this level-group)) +(defmethod print-volume-sizes ((this level-group)) (local-vars (sv-16 pointer) (sv-20 float) @@ -1195,18 +1195,15 @@ ;; definition of type debug-actor-info (deftype debug-actor-info (basic) - ((name basic :offset-assert 4) - (handle handle :offset-assert 8) - (process basic :offset-assert 16) - (pid int32 :offset-assert 20) + ((name basic) + (handle handle) + (process basic) + (pid int32) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type debug-actor-info -(defmethod inspect debug-actor-info ((this debug-actor-info)) +(defmethod inspect ((this debug-actor-info)) (when (not this) (set! this this) (goto cfg-4) @@ -1403,7 +1400,7 @@ ;; definition for method 15 of type level-group ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-actors level-group ((this level-group) (arg0 symbol)) +(defmethod debug-draw-actors ((this level-group) (arg0 symbol)) (local-vars (sv-16 symbol) (sv-20 vector) @@ -1777,13 +1774,13 @@ ) ;; definition for method 22 of type entity-camera -(defmethod birth! entity-camera ((this entity-camera)) +(defmethod birth! ((this entity-camera)) (add-connection *camera-engine* *camera* nothing this #f #f) this ) ;; definition for method 23 of type entity-camera -(defmethod kill! entity-camera ((this entity-camera)) +(defmethod kill! ((this entity-camera)) (remove-by-param1 *camera-engine* (the-as int this)) this ) @@ -1800,7 +1797,7 @@ ) ;; definition for method 22 of type entity-actor -(defmethod birth! entity-actor ((this entity-actor)) +(defmethod birth! ((this entity-actor)) (let* ((s5-0 (-> this etype)) (v1-0 (entity-info-lookup s5-0)) (s4-0 (get-process *default-dead-pool* s5-0 (if v1-0 @@ -1844,7 +1841,7 @@ ) ;; definition for method 23 of type entity-actor -(defmethod kill! entity-actor ((this entity-actor)) +(defmethod kill! ((this entity-actor)) (let ((a0-1 (-> this extra process))) (if a0-1 (deactivate a0-1) @@ -1859,7 +1856,7 @@ ;; WARN: Return type mismatch bsp-header vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 s5, Count] ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod birth bsp-header ((this bsp-header)) +(defmethod birth ((this bsp-header)) (local-vars (v1-74 int) (s5-0 int) (sv-16 int)) (.mfc0 s5-0 Count) (let ((a2-0 (if (nonzero? (-> this actors)) @@ -2039,7 +2036,7 @@ ;; definition for method 18 of type bsp-header ;; WARN: Return type mismatch bsp-header vs none. -(defmethod deactivate-entities bsp-header ((this bsp-header)) +(defmethod deactivate-entities ((this bsp-header)) (let ((v1-1 (-> this level heap base)) (a0-2 (-> this level heap top-base)) ) @@ -2149,7 +2146,7 @@ ) ;; definition for method 9 of type entity-perm -(defmethod update entity-perm ((this entity-perm) (arg0 symbol) (arg1 entity-perm-status)) +(defmethod update ((this entity-perm) (arg0 symbol) (arg1 entity-perm-status)) (cond ((= arg0 'game) (logclear! (-> this status) arg1) @@ -2285,7 +2282,7 @@ ) ;; definition for method 12 of type process-drawable -(defmethod run-logic? process-drawable ((this process-drawable)) +(defmethod run-logic? ((this process-drawable)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) (vector-vector-distance (-> this root trans) (math-camera-pos)) @@ -2297,7 +2294,7 @@ ) ;; definition for method 9 of type entity-links -(defmethod birth? entity-links ((this entity-links) (arg0 vector)) +(defmethod birth? ((this entity-links) (arg0 vector)) (and (not (logtest? (-> this perm status) (entity-perm-status bit-0 dead))) (< (vector-vector-distance (-> this trans) arg0) (-> *ACTOR-bank* birth-dist)) ) @@ -2311,7 +2308,7 @@ ;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 17 level-group) has a return type of none, but the expression builder found a return statement. -(defmethod actors-update level-group ((this level-group)) +(defmethod actors-update ((this level-group)) (local-vars (sv-16 vector) (sv-24 int) @@ -2547,7 +2544,7 @@ ;; definition for method 30 of type entity-actor ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod toggle-status entity-actor ((this entity-actor) (arg0 entity-perm-status) (arg1 symbol)) +(defmethod toggle-status ((this entity-actor) (arg0 entity-perm-status) (arg1 symbol)) (let ((v1-0 (-> this extra))) (if arg1 (logior! (-> v1-0 perm status) arg0) diff --git a/test/decompiler/reference/jak2/engine/entity/relocate_REF.gc b/test/decompiler/reference/jak2/engine/entity/relocate_REF.gc index 1587e9d3b3b..ed5c522501d 100644 --- a/test/decompiler/reference/jak2/engine/entity/relocate_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/relocate_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 7 of type process -(defmethod relocate process ((this process) (arg0 int)) +(defmethod relocate ((this process) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -91,14 +91,14 @@ ) ;; definition for method 7 of type cpu-thread -(defmethod relocate cpu-thread ((this cpu-thread) (arg0 int)) +(defmethod relocate ((this cpu-thread) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type process-drawable ;; WARN: Return type mismatch process vs process-drawable. -(defmethod relocate process-drawable ((this process-drawable) (arg0 int)) +(defmethod relocate ((this process-drawable) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -158,7 +158,7 @@ ) ;; definition for method 7 of type collide-shape -(defmethod relocate collide-shape ((this collide-shape) (arg0 int)) +(defmethod relocate ((this collide-shape) (arg0 int)) (&+! (-> this process) arg0) (&+! (-> this root-prim) arg0) this @@ -166,7 +166,7 @@ ;; definition for method 7 of type collide-shape-moving ;; WARN: Return type mismatch collide-shape vs collide-shape-moving. -(defmethod relocate collide-shape-moving ((this collide-shape-moving) (arg0 int)) +(defmethod relocate ((this collide-shape-moving) (arg0 int)) (if (-> this dynam) (&+! (-> this dynam) arg0) ) @@ -174,26 +174,26 @@ ) ;; definition for method 7 of type collide-shape-prim -(defmethod relocate collide-shape-prim ((this collide-shape-prim) (arg0 int)) +(defmethod relocate ((this collide-shape-prim) (arg0 int)) (&+! (-> this cshape) arg0) this ) ;; definition for method 7 of type collide-shape-prim-group -(defmethod relocate collide-shape-prim-group ((this collide-shape-prim-group) (arg0 int)) +(defmethod relocate ((this collide-shape-prim-group) (arg0 int)) (&+! (-> this cshape) arg0) (set! (-> this child) (the-as (inline-array collide-shape-prim) (&+ (the-as pointer (-> this child)) arg0))) this ) ;; definition for method 7 of type fact-info -(defmethod relocate fact-info ((this fact-info) (arg0 int)) +(defmethod relocate ((this fact-info) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type draw-control -(defmethod relocate draw-control ((this draw-control) (arg0 int)) +(defmethod relocate ((this draw-control) (arg0 int)) (&+! (-> this skeleton) arg0) (&+! (-> this process) arg0) (when (-> this ripple) @@ -213,7 +213,7 @@ ) ;; definition for method 7 of type joint-control -(defmethod relocate joint-control ((this joint-control) (arg0 int)) +(defmethod relocate ((this joint-control) (arg0 int)) (if (-> this effect) (&+! (-> this effect) arg0) ) @@ -228,7 +228,7 @@ ) ;; definition for method 7 of type cspace-array -(defmethod relocate cspace-array ((this cspace-array) (arg0 int)) +(defmethod relocate ((this cspace-array) (arg0 int)) (countdown (v1-0 (-> this length)) (let ((a2-2 (-> this data v1-0))) (if (-> a2-2 parent) @@ -255,62 +255,62 @@ ) ;; definition for method 7 of type path-control -(defmethod relocate path-control ((this path-control) (arg0 int)) +(defmethod relocate ((this path-control) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type vol-control -(defmethod relocate vol-control ((this vol-control) (arg0 int)) +(defmethod relocate ((this vol-control) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type water-control -(defmethod relocate water-control ((this water-control) (arg0 int)) +(defmethod relocate ((this water-control) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type actor-link-info -(defmethod relocate actor-link-info ((this actor-link-info) (arg0 int)) +(defmethod relocate ((this actor-link-info) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type align-control -(defmethod relocate align-control ((this align-control) (arg0 int)) +(defmethod relocate ((this align-control) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type joint-mod -(defmethod relocate joint-mod ((this joint-mod) (arg0 int)) +(defmethod relocate ((this joint-mod) (arg0 int)) (&+! (-> this process) arg0) (&+! (-> this joint) arg0) this ) ;; definition for method 7 of type joint-mod-wheel -(defmethod relocate joint-mod-wheel ((this joint-mod-wheel) (arg0 int)) +(defmethod relocate ((this joint-mod-wheel) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type joint-mod-ik -(defmethod relocate joint-mod-ik ((this joint-mod-ik) (arg0 int)) +(defmethod relocate ((this joint-mod-ik) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type effect-control -(defmethod relocate effect-control ((this effect-control) (arg0 int)) +(defmethod relocate ((this effect-control) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 7 of type sparticle-launch-control -(defmethod relocate sparticle-launch-control ((this sparticle-launch-control) (arg0 int)) +(defmethod relocate ((this sparticle-launch-control) (arg0 int)) (&+! (-> this proc) arg0) (countdown (v1-2 (-> this length)) (let* ((a0-4 (-> this data v1-2)) @@ -343,7 +343,7 @@ ;; definition for method 7 of type camera-master ;; WARN: Return type mismatch process vs camera-master. -(defmethod relocate camera-master ((this camera-master) (arg0 int)) +(defmethod relocate ((this camera-master) (arg0 int)) (if (nonzero? (-> this water-drip)) (&+! (-> this water-drip) arg0) ) @@ -352,7 +352,7 @@ ;; definition for method 7 of type time-of-day-proc ;; WARN: Return type mismatch process vs time-of-day-proc. -(defmethod relocate time-of-day-proc ((this time-of-day-proc) (arg0 int)) +(defmethod relocate ((this time-of-day-proc) (arg0 int)) (if (nonzero? (-> this sun)) (&+! (-> this sun) arg0) ) @@ -367,7 +367,7 @@ ;; definition for method 7 of type part-tracker ;; WARN: Return type mismatch process vs part-tracker. -(defmethod relocate part-tracker ((this part-tracker) (arg0 int)) +(defmethod relocate ((this part-tracker) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) @@ -379,7 +379,7 @@ ;; definition for method 7 of type part-spawner ;; WARN: Return type mismatch process vs part-spawner. -(defmethod relocate part-spawner ((this part-spawner) (arg0 int)) +(defmethod relocate ((this part-spawner) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) @@ -394,7 +394,7 @@ ;; definition for method 7 of type lightning-tracker ;; WARN: Return type mismatch process vs lightning-tracker. -(defmethod relocate lightning-tracker ((this lightning-tracker) (arg0 int)) +(defmethod relocate ((this lightning-tracker) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) @@ -406,7 +406,7 @@ ;; definition for method 7 of type manipy ;; WARN: Return type mismatch process-drawable vs manipy. -(defmethod relocate manipy ((this manipy) (arg0 int)) +(defmethod relocate ((this manipy) (arg0 int)) (if (nonzero? (-> this joint 0)) (&+! (-> this joint 0) arg0) ) diff --git a/test/decompiler/reference/jak2/engine/entity/res-h_REF.gc b/test/decompiler/reference/jak2/engine/entity/res-h_REF.gc index b340aec78cc..01b9144a8fb 100644 --- a/test/decompiler/reference/jak2/engine/entity/res-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/res-h_REF.gc @@ -10,45 +10,39 @@ (elt-count uint32 :offset 112 :size 15) (inlined? uint8 :offset 127 :size 1) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition of type res-lump (deftype res-lump (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (data-base pointer :offset-assert 12) - (data-top pointer :offset-assert 16) - (data-size int32 :offset-assert 20) - (extra entity-links :offset-assert 24) - (tag (pointer res-tag) :offset-assert 28) + ((length int32) + (allocated-length int32) + (data-base pointer) + (data-top pointer) + (data-size int32) + (extra entity-links) + (tag (pointer res-tag)) ) - :method-count-assert 22 - :size-assert #x20 - :flag-assert #x1600000020 (:methods - (new (symbol type int int) _type_ 0) - (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual 9) - (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual 10) - (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual 11) - (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual 12) - (get-tag-index-data (_type_ int) pointer 13) - (get-tag-data (_type_ res-tag) pointer 14) - (allocate-data-memory-for-tag! (_type_ res-tag) res-tag 15) - (sort! (_type_) _type_ 16) - (add-data! (_type_ res-tag pointer) res-lump 17) - (add-32bit-data! (_type_ res-tag object) res-lump 18) - (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual 19) - (make-property-data (_type_ float res-tag-pair pointer) pointer 20) - (get-curve-data! (_type_ curve symbol symbol float) symbol 21) + (new (symbol type int int) _type_) + (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual) + (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual) + (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual) + (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual) + (get-tag-index-data (_type_ int) pointer) + (get-tag-data (_type_ res-tag) pointer) + (allocate-data-memory-for-tag! (_type_ res-tag) res-tag) + (sort! (_type_) _type_) + (add-data! (_type_ res-tag pointer) res-lump) + (add-32bit-data! (_type_ res-tag object) res-lump) + (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual) + (make-property-data (_type_ float res-tag-pair pointer) pointer) + (get-curve-data! (_type_ curve symbol symbol float) symbol) ) ) ;; definition for method 3 of type res-lump ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect res-lump ((this res-lump)) +(defmethod inspect ((this res-lump)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/entity/res_REF.gc b/test/decompiler/reference/jak2/engine/entity/res_REF.gc index 958968259e9..7e5aae6cedf 100644 --- a/test/decompiler/reference/jak2/engine/entity/res_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/res_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 2 of type res-tag -(defmethod print res-tag ((this res-tag)) +(defmethod print ((this res-tag)) (if (zero? (-> this inlined?)) (format #t @@ -26,7 +26,7 @@ ;; definition for method 4 of type res-tag ;; WARN: Return type mismatch uint vs int. -(defmethod length res-tag ((this res-tag)) +(defmethod length ((this res-tag)) (the-as int (if (zero? (-> this inlined?)) (* (-> this elt-count) 4) (* (-> this elt-count) (-> this elt-type size)) @@ -36,12 +36,12 @@ ;; definition for method 13 of type res-lump ;; INFO: Used lq/sq -(defmethod get-tag-index-data res-lump ((this res-lump) (arg0 int)) +(defmethod get-tag-index-data ((this res-lump) (arg0 int)) (&+ (-> this data-base) (-> this tag arg0 data-offset)) ) ;; definition for method 14 of type res-lump -(defmethod get-tag-data res-lump ((this res-lump) (arg0 res-tag)) +(defmethod get-tag-data ((this res-lump) (arg0 res-tag)) (&+ (-> this data-base) (-> arg0 data-offset)) ) @@ -58,20 +58,20 @@ ) ;; definition for method 4 of type res-lump -(defmethod length res-lump ((this res-lump)) +(defmethod length ((this res-lump)) (-> this length) ) ;; definition for method 5 of type res-lump ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of res-lump ((this res-lump)) +(defmethod asize-of ((this res-lump)) (the-as int (+ (-> this type psize) (* (-> this allocated-length) 16) (-> this data-size))) ) ;; definition for method 3 of type res-lump ;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -(defmethod inspect res-lump ((this res-lump)) +(defmethod inspect ((this res-lump)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Textra: ~A~%" (-> this extra)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) @@ -113,7 +113,7 @@ ;; definition for method 19 of type res-lump ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs res-tag-pair. -(defmethod lookup-tag-idx res-lump ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float)) +(defmethod lookup-tag-idx ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float)) (local-vars (t4-1 int)) (when (or (= arg0 'id) (= arg0 'aid) @@ -213,7 +213,7 @@ ;; definition for method 20 of type res-lump ;; INFO: Used lq/sq -(defmethod make-property-data res-lump ((this res-lump) (arg0 float) (arg1 res-tag-pair) (arg2 pointer)) +(defmethod make-property-data ((this res-lump) (arg0 float) (arg1 res-tag-pair) (arg2 pointer)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -395,14 +395,14 @@ ;; definition for method 9 of type res-lump ;; INFO: Used lq/sq -(defmethod get-property-data res-lump ((this res-lump) - (arg0 symbol) - (arg1 symbol) - (arg2 float) - (arg3 pointer) - (arg4 (pointer res-tag)) - (arg5 pointer) - ) +(defmethod get-property-data ((this res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 pointer) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) (let ((s3-0 (lookup-tag-idx this arg0 arg1 arg2))) (cond ((< (the-as int s3-0) 0) @@ -422,14 +422,14 @@ ;; definition for method 10 of type res-lump ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs structure. -(defmethod get-property-struct res-lump ((this res-lump) - (arg0 symbol) - (arg1 symbol) - (arg2 float) - (arg3 structure) - (arg4 (pointer res-tag)) - (arg5 pointer) - ) +(defmethod get-property-struct ((this res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 structure) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) (let ((s3-0 (lookup-tag-idx this arg0 arg1 arg2))) (cond ((< (the-as int s3-0) 0) @@ -455,14 +455,14 @@ ;; definition for method 11 of type res-lump ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs uint128. -(defmethod get-property-value res-lump ((this res-lump) - (arg0 symbol) - (arg1 symbol) - (arg2 float) - (arg3 uint128) - (arg4 (pointer res-tag)) - (arg5 pointer) - ) +(defmethod get-property-value ((this res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 uint128) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) (let ((a2-1 (lookup-tag-idx this arg0 arg1 arg2))) (cond ((< (the-as int a2-1) 0) @@ -532,14 +532,14 @@ ;; definition for method 12 of type res-lump ;; INFO: Used lq/sq -(defmethod get-property-value-float res-lump ((this res-lump) - (arg0 symbol) - (arg1 symbol) - (arg2 float) - (arg3 float) - (arg4 (pointer res-tag)) - (arg5 pointer) - ) +(defmethod get-property-value-float ((this res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 float) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) (local-vars (v1-8 uint) (v1-11 int)) (let ((a2-1 (lookup-tag-idx this arg0 arg1 arg2))) (cond @@ -612,7 +612,7 @@ ;; definition for method 16 of type res-lump ;; INFO: Used lq/sq -(defmethod sort! res-lump ((this res-lump)) +(defmethod sort! ((this res-lump)) (let ((v1-0 -1)) (while (nonzero? v1-0) (set! v1-0 0) @@ -641,7 +641,7 @@ ;; definition for method 15 of type res-lump ;; INFO: Used lq/sq -(defmethod allocate-data-memory-for-tag! res-lump ((this res-lump) (arg0 res-tag)) +(defmethod allocate-data-memory-for-tag! ((this res-lump) (arg0 res-tag)) (local-vars (resource-mem pointer)) (let* ((tag-pair (lookup-tag-idx this (-> arg0 name) 'exact (-> arg0 key-frame))) (existing-tag (-> this tag (-> tag-pair lo))) @@ -705,7 +705,7 @@ ) ;; definition for method 17 of type res-lump -(defmethod add-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 pointer)) +(defmethod add-data! ((this res-lump) (arg0 res-tag) (arg1 pointer)) (let ((a0-2 (allocate-data-memory-for-tag! this arg0))) (when a0-2 (let* ((v1-2 this) @@ -730,7 +730,7 @@ ) ;; definition for method 18 of type res-lump -(defmethod add-32bit-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 object)) +(defmethod add-32bit-data! ((this res-lump) (arg0 res-tag) (arg1 object)) (local-vars (sv-16 object)) (set! sv-16 arg1) (let* ((v1-0 arg0) @@ -742,7 +742,7 @@ ;; definition for method 21 of type res-lump ;; INFO: Used lq/sq -(defmethod get-curve-data! res-lump ((this res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) +(defmethod get-curve-data! ((this res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) (let ((s5-0 #f)) (set! sv-16 (new 'static 'res-tag)) @@ -802,7 +802,7 @@ ;; WARN: Using new Jak 2 rtype-of ;; WARN: Using new Jak 2 rtype-of ;; WARN: Using new Jak 2 rtype-of -(defmethod mem-usage res-lump ((this res-lump) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this res-lump) (arg0 memory-usage-block) (arg1 int)) (local-vars (sv-16 int)) (let ((s3-0 48) (s2-0 "res") diff --git a/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc b/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc index 4df32aa2de1..1ac2189b6c5 100644 --- a/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc @@ -3,31 +3,28 @@ ;; definition of type effect-control (deftype effect-control (basic) - ((process process-drawable :offset-assert 4) - (flags effect-control-flag :offset-assert 8) - (last-frame-group art-joint-anim :offset-assert 12) - (last-frame-num float :offset-assert 16) - (channel-offset int32 :offset-assert 20) - (res res-lump :offset-assert 24) - (name (pointer res-tag) :offset-assert 28) - (param uint32 :offset-assert 32) + ((process process-drawable) + (flags effect-control-flag) + (last-frame-group art-joint-anim) + (last-frame-num float) + (channel-offset int32) + (res res-lump) + (name (pointer res-tag)) + (param uint32) ) - :method-count-assert 15 - :size-assert #x24 - :flag-assert #xf00000024 (:methods - (new (symbol type process-drawable) _type_ 0) - (update-effects (_type_) none 9) - (do-effect (_type_ symbol float int) none 10) - (do-effect-for-surface (_type_ symbol float int basic pat-surface) none 11) - (play-effect-sound (_type_ symbol float int basic sound-name) int 12) - (set-channel-offset! (_type_ int) none 13) - (play-effects-from-res-lump (_type_ float float float) none 14) + (new (symbol type process-drawable) _type_) + (update-effects (_type_) none) + (do-effect (_type_ symbol float int) none) + (do-effect-for-surface (_type_ symbol float int basic pat-surface) none) + (play-effect-sound (_type_ symbol float int basic sound-name) int) + (set-channel-offset! (_type_ int) none) + (play-effects-from-res-lump (_type_ float float float) none) ) ) ;; definition for method 3 of type effect-control -(defmethod inspect effect-control ((this effect-control)) +(defmethod inspect ((this effect-control)) (when (not this) (set! this this) (goto cfg-4) @@ -63,7 +60,7 @@ ;; definition for method 13 of type effect-control ;; WARN: Return type mismatch int vs none. -(defmethod set-channel-offset! effect-control ((this effect-control) (arg0 int)) +(defmethod set-channel-offset! ((this effect-control) (arg0 int)) (set! (-> this channel-offset) arg0) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc b/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc index 398cfdfe629..f58eaad01cc 100644 --- a/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc @@ -149,7 +149,7 @@ ;; definition for method 9 of type effect-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-effects effect-control ((this effect-control)) +(defmethod update-effects ((this effect-control)) (let* ((a0-1 (-> this process skel)) (v1-3 (if (< (the-as uint (-> this channel-offset)) (-> a0-1 active-channels)) (-> a0-1 root-channel (-> this channel-offset)) @@ -253,7 +253,7 @@ ;; definition for method 14 of type effect-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod play-effects-from-res-lump effect-control ((this effect-control) (arg0 float) (arg1 float) (arg2 float)) +(defmethod play-effects-from-res-lump ((this effect-control) (arg0 float) (arg1 float) (arg2 float)) (let ((s2-0 (-> this name))) (while (= (-> s2-0 0 name) 'effect-name) (let ((f0-0 (-> s2-0 0 key-frame))) @@ -283,7 +283,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 10 effect-control) has a return type of none, but the expression builder found a return statement. -(defmethod do-effect effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) +(defmethod do-effect ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) (local-vars (sv-320 int) (sv-336 symbol) @@ -623,7 +623,7 @@ ;; definition for method 11 of type effect-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-effect-for-surface effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) +(defmethod do-effect-for-surface ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) (local-vars (sv-64 (function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none) @@ -1056,7 +1056,7 @@ ;; definition for method 12 of type effect-control ;; INFO: Used lq/sq -(defmethod play-effect-sound effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) +(defmethod play-effect-sound ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) (local-vars (sv-112 res-tag) (sv-128 sound-name) (sv-144 basic) (sv-160 (function vector vector float))) (set! sv-144 arg3) (let ((s0-0 arg4) diff --git a/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc b/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc index ecfbfd663bb..3c8aa355fb1 100644 --- a/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc @@ -3,48 +3,45 @@ ;; definition of type fact-bank (deftype fact-bank (basic) - ((eco-level-max float :offset-assert 4) - (eco-single-inc float :offset-assert 8) - (eco-full-inc float :offset-assert 12) - (eco-single-timeout seconds :offset-assert 16) - (eco-full-timeout seconds :offset-assert 24) - (dummy seconds :offset-assert 32) - (health-max-default float :offset-assert 40) - (health-single-inc float :offset-assert 44) - (health-default-inc float :offset-assert 48) - (health-darkjak-inc float :offset-assert 52) - (health-darkjak-min float :offset-assert 56) - (health-darkjak-error float :offset-assert 60) - (eco-pill-green-max-default float :offset-assert 64) - (eco-pill-dark-max-default float :offset-assert 68) - (health-small-inc float :offset-assert 72) - (buzzer-max-default float :offset-assert 76) - (buzzer-single-inc float :offset-assert 80) - (suck-bounce-dist meters :offset-assert 84) - (suck-suck-dist meters :offset-assert 88) - (default-eco-pill-green-inc float :offset-assert 92) - (default-eco-pill-dark-inc float :offset-assert 96) - (ammo-yellow-max float :offset-assert 100) - (ammo-red-max float :offset-assert 104) - (ammo-blue-max float :offset-assert 108) - (ammo-dark-max float :offset-assert 112) - (ammo-yellow-start float :offset-assert 116) - (ammo-red-start float :offset-assert 120) - (ammo-blue-start float :offset-assert 124) - (ammo-dark-start float :offset-assert 128) - (shield-max float :offset-assert 132) - (shield-use-speed float :offset-assert 136) - (shield-time-min seconds :offset-assert 144) - (trick-point-max float :offset-assert 152) - (super-skill-inc float :offset-assert 156) + ((eco-level-max float) + (eco-single-inc float) + (eco-full-inc float) + (eco-single-timeout seconds) + (eco-full-timeout seconds) + (dummy seconds) + (health-max-default float) + (health-single-inc float) + (health-default-inc float) + (health-darkjak-inc float) + (health-darkjak-min float) + (health-darkjak-error float) + (eco-pill-green-max-default float) + (eco-pill-dark-max-default float) + (health-small-inc float) + (buzzer-max-default float) + (buzzer-single-inc float) + (suck-bounce-dist meters) + (suck-suck-dist meters) + (default-eco-pill-green-inc float) + (default-eco-pill-dark-inc float) + (ammo-yellow-max float) + (ammo-red-max float) + (ammo-blue-max float) + (ammo-dark-max float) + (ammo-yellow-start float) + (ammo-red-start float) + (ammo-blue-start float) + (ammo-dark-start float) + (shield-max float) + (shield-use-speed float) + (shield-time-min seconds) + (trick-point-max float) + (super-skill-inc float) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type fact-bank -(defmethod inspect fact-bank ((this fact-bank)) +(defmethod inspect ((this fact-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -238,26 +235,23 @@ ;; definition of type fact-info (deftype fact-info (basic) - ((process process :offset-assert 4) - (pickup-type pickup-type :offset-assert 8) - (pickup-amount float :offset-assert 12) - (pickup-spawn-amount float :offset-assert 16) - (options actor-option :offset-assert 24) - (fade-time time-frame :offset-assert 32) + ((process process) + (pickup-type pickup-type) + (pickup-amount float) + (pickup-spawn-amount float) + (options actor-option) + (fade-time time-frame) ) - :method-count-assert 12 - :size-assert #x28 - :flag-assert #xc00000028 (:methods - (new (symbol type process pickup-type float) _type_ 0) - (drop-pickup (_type_ symbol process-tree fact-info int) (pointer process) 9) - (reset! (_type_ symbol) none 10) - (pickup-collectable! (_type_ pickup-type float handle) float 11) + (new (symbol type process pickup-type float) _type_) + (drop-pickup (_type_ symbol process-tree fact-info int) (pointer process)) + (reset! (_type_ symbol) none) + (pickup-collectable! (_type_ pickup-type float handle) float) ) ) ;; definition for method 3 of type fact-info -(defmethod inspect fact-info ((this fact-info)) +(defmethod inspect ((this fact-info)) (when (not this) (set! this this) (goto cfg-129) @@ -476,52 +470,49 @@ ;; definition of type fact-info-target (deftype fact-info-target (fact-info) - ((eco-type int32 :offset-assert 40) - (eco-level float :offset-assert 44) - (eco-pickup-time time-frame :offset-assert 48) - (eco-timeout time-frame :offset-assert 56) - (eco-source handle :offset-assert 64) - (eco-source-time time-frame :offset-assert 72) - (health float :offset-assert 80) - (health-max float :offset-assert 84) - (health-pickup-time time-frame :offset-assert 88) - (buzzer float :offset-assert 96) - (buzzer-max float :offset-assert 100) - (eco-pill-green float :offset-assert 104) - (eco-pill-green-max float :offset-assert 108) - (eco-pill-green-pickup-time time-frame :offset-assert 112) - (eco-pill-dark-pickup-time time-frame :offset-assert 120) - (money-pickup-time time-frame :offset-assert 128) - (buzzer-pickup-time time-frame :offset-assert 136) - (task-pickup-time time-frame :offset-assert 144) - (stop-time-timeout time-frame :offset-assert 152) - (darkjak-start-time time-frame :offset-assert 160) - (darkjak-effect-time time-frame :offset-assert 168) - (ammo-pickup-time time-frame :offset-assert 176) - (shield-pickup-time time-frame :offset-assert 184) - (shield-start-time time-frame :offset-assert 192) - (shield-use-time time-frame :offset-assert 200) - (shield-level float :offset-assert 208) - (shield-attack-id uint32 :offset-assert 212) - (trick-point float :offset-assert 216) - (trick-point-pickup-time time-frame :offset-assert 224) - (trick-point-start-time time-frame :offset-assert 232) - (trick-point-duration time-frame :offset-assert 240) - (gem-pickup-time time-frame :offset-assert 248) - (skill-pickup-time time-frame :offset-assert 256) - (karma-pickup-time time-frame :offset-assert 264) + ((eco-type int32) + (eco-level float) + (eco-pickup-time time-frame) + (eco-timeout time-frame) + (eco-source handle) + (eco-source-time time-frame) + (health float) + (health-max float) + (health-pickup-time time-frame) + (buzzer float) + (buzzer-max float) + (eco-pill-green float) + (eco-pill-green-max float) + (eco-pill-green-pickup-time time-frame) + (eco-pill-dark-pickup-time time-frame) + (money-pickup-time time-frame) + (buzzer-pickup-time time-frame) + (task-pickup-time time-frame) + (stop-time-timeout time-frame) + (darkjak-start-time time-frame) + (darkjak-effect-time time-frame) + (ammo-pickup-time time-frame) + (shield-pickup-time time-frame) + (shield-start-time time-frame) + (shield-use-time time-frame) + (shield-level float) + (shield-attack-id uint32) + (trick-point float) + (trick-point-pickup-time time-frame) + (trick-point-start-time time-frame) + (trick-point-duration time-frame) + (gem-pickup-time time-frame) + (skill-pickup-time time-frame) + (karma-pickup-time time-frame) ) - :method-count-assert 13 - :size-assert #x110 - :flag-assert #xd00000110 (:methods - (new (symbol type process-drawable pickup-type float) _type_ 0) - (get-gun-ammo (_type_) float 12) + (new (symbol type process-drawable pickup-type float) _type_) + (get-gun-ammo (_type_) float) ) ) ;; definition for method 3 of type fact-info-target -(defmethod inspect fact-info-target ((this fact-info-target)) +(defmethod inspect ((this fact-info-target)) (when (not this) (set! this this) (goto cfg-129) @@ -774,30 +765,27 @@ ;; definition of type fact-info-enemy (deftype fact-info-enemy (fact-info) - ((speed float :offset-assert 40) - (idle-distance meters :offset-assert 44) - (notice-top meters :offset-assert 48) - (notice-bottom meters :offset-assert 52) - (cam-horz meters :offset-assert 56) - (cam-vert meters :offset-assert 60) - (cam-notice-dist meters :offset-assert 64) - (enemy-options enemy-option :offset-assert 68) - (trig-dist meters :offset-assert 72) - (trig-actor-group (pointer actor-group) :offset-assert 76) - (trig-mask-count int8 :offset-assert 80) - (trig-mask uint8 2 :offset-assert 81) + ((speed float) + (idle-distance meters) + (notice-top meters) + (notice-bottom meters) + (cam-horz meters) + (cam-vert meters) + (cam-notice-dist meters) + (enemy-options enemy-option) + (trig-dist meters) + (trig-actor-group (pointer actor-group)) + (trig-mask-count int8) + (trig-mask uint8 2) ) - :method-count-assert 13 - :size-assert #x53 - :flag-assert #xd00000053 (:methods - (new (symbol type process (pointer float) pickup-type float) _type_ 0) - (clear-mask-bits (_type_ int) none 12) + (new (symbol type process (pointer float) pickup-type float) _type_) + (clear-mask-bits (_type_ int) none) ) ) ;; definition for method 3 of type fact-info-enemy -(defmethod inspect fact-info-enemy ((this fact-info-enemy)) +(defmethod inspect ((this fact-info-enemy)) (when (not this) (set! this this) (goto cfg-181) @@ -1109,18 +1097,15 @@ ;; definition of type fact-info-crate (deftype fact-info-crate (fact-info) - ((suck-count int32 :offset-assert 40) + ((suck-count int32) ) - :method-count-assert 12 - :size-assert #x2c - :flag-assert #xc0000002c (:methods - (new (symbol type process pickup-type float) _type_ 0) + (new (symbol type process pickup-type float) _type_) ) ) ;; definition for method 3 of type fact-info-crate -(defmethod inspect fact-info-crate ((this fact-info-crate)) +(defmethod inspect ((this fact-info-crate)) (when (not this) (set! this this) (goto cfg-129) @@ -1390,21 +1375,18 @@ ) ;; definition for method 11 of type fact-info -(defmethod pickup-collectable! fact-info ((this fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) +(defmethod pickup-collectable! ((this fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) 0.0 ) ;; definition of type fact-info-enemy-defaults (deftype fact-info-enemy-defaults (basic) - ((idle-distance meters :offset-assert 4) + ((idle-distance meters) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type fact-info-enemy-defaults -(defmethod inspect fact-info-enemy-defaults ((this fact-info-enemy-defaults)) +(defmethod inspect ((this fact-info-enemy-defaults)) (when (not this) (set! this this) (goto cfg-4) @@ -1479,7 +1461,7 @@ ;; definition for method 12 of type fact-info-enemy ;; WARN: Return type mismatch int vs none. -(defmethod clear-mask-bits fact-info-enemy ((this fact-info-enemy) (arg0 int)) +(defmethod clear-mask-bits ((this fact-info-enemy) (arg0 int)) (let ((v1-0 (lognot arg0))) (dotimes (a1-1 (-> this trig-mask-count)) (logand! (-> this trig-mask a1-1) v1-0) diff --git a/test/decompiler/reference/jak2/engine/game/game-h_REF.gc b/test/decompiler/reference/jak2/engine/game/game-h_REF.gc index 8ac2a728824..5033fa53d63 100644 --- a/test/decompiler/reference/jak2/engine/game/game-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-h_REF.gc @@ -3,35 +3,31 @@ ;; definition of type process-drawable (deftype process-drawable (process) - ((root trsqv :offset-assert 128) - (node-list cspace-array :offset-assert 132) - (draw draw-control :offset-assert 136) - (skel joint-control :offset-assert 140) - (nav nav-control :offset-assert 144) - (align align-control :offset-assert 148) - (path path-control :offset-assert 152) - (vol vol-control :offset-assert 156) - (fact fact-info :offset-assert 160) - (link actor-link-info :offset-assert 164) - (part sparticle-launch-control :offset-assert 168) - (water water-control :offset-assert 172) - (sound ambient-sound :offset-assert 176) - (carry carry-info :offset-assert 180) - (rbody rigid-body-control :offset-assert 184) - (state-flags state-flags :offset-assert 188) - (state-time time-frame :offset-assert 192) + ((root trsqv) + (node-list cspace-array) + (draw draw-control) + (skel joint-control) + (nav nav-control) + (align align-control) + (path path-control) + (vol vol-control) + (fact fact-info) + (link actor-link-info) + (part sparticle-launch-control) + (water water-control) + (sound ambient-sound) + (carry carry-info) + (rbody rigid-body-control) + (state-flags state-flags) + (state-time time-frame) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xc8 - :flag-assert #x14005000c8 (:methods - (initialize-skeleton (_type_ skeleton-group pair) draw-control 14) - (initialize-skeleton-by-name (_type_ string) draw-control 15) - (apply-alignment (_type_ align-opts transformq vector) trsqv 16) - (cleanup-for-death (_type_) none 17) - (relocate-nav (_type_ int) none 18) - (evaluate-joint-control (_type_) none 19) + (initialize-skeleton (_type_ skeleton-group pair) draw-control) + (initialize-skeleton-by-name (_type_ string) draw-control) + (apply-alignment (_type_ align-opts transformq vector) trsqv) + (cleanup-for-death (_type_) none) + (relocate-nav (_type_ int) none) + (evaluate-joint-control (_type_) none) ) (:states (process-drawable-art-error string) @@ -40,7 +36,7 @@ ) ;; definition for method 3 of type process-drawable -(defmethod inspect process-drawable ((this process-drawable)) +(defmethod inspect ((this process-drawable)) (when (not this) (set! this this) (goto cfg-4) @@ -72,174 +68,170 @@ ;; definition of type process-drawable-reserved (deftype process-drawable-reserved (process-drawable) () - :heap-base #x50 - :method-count-assert 178 - :size-assert #xc8 - :flag-assert #xb2005000c8 (:methods - (process-drawable-reserved-method-20 () none 20) - (process-drawable-reserved-method-21 () none 21) - (process-drawable-reserved-method-22 () none 22) - (process-drawable-reserved-method-23 () none 23) - (process-drawable-reserved-method-24 () none 24) - (process-drawable-reserved-method-25 () none 25) - (process-drawable-reserved-method-26 () none 26) - (process-drawable-reserved-method-27 () none 27) - (process-drawable-reserved-method-28 () none 28) - (process-drawable-reserved-method-29 () none 29) - (process-drawable-reserved-method-30 () none 30) - (process-drawable-reserved-method-31 () none 31) - (process-drawable-reserved-method-32 () none 32) - (process-drawable-reserved-method-33 () none 33) - (process-drawable-reserved-method-34 () none 34) - (process-drawable-reserved-method-35 () none 35) - (process-drawable-reserved-method-36 () none 36) - (process-drawable-reserved-method-37 () none 37) - (process-drawable-reserved-method-38 () none 38) - (process-drawable-reserved-method-39 () none 39) - (process-drawable-reserved-method-40 () none 40) - (process-drawable-reserved-method-41 () none 41) - (process-drawable-reserved-method-42 () none 42) - (process-drawable-reserved-method-43 () none 43) - (process-drawable-reserved-method-44 () none 44) - (process-drawable-reserved-method-45 () none 45) - (process-drawable-reserved-method-46 () none 46) - (process-drawable-reserved-method-47 () none 47) - (process-drawable-reserved-method-48 () none 48) - (process-drawable-reserved-method-49 () none 49) - (process-drawable-reserved-method-50 () none 50) - (process-drawable-reserved-method-51 () none 51) - (process-drawable-reserved-method-52 () none 52) - (process-drawable-reserved-method-53 () none 53) - (process-drawable-reserved-method-54 () none 54) - (process-drawable-reserved-method-55 () none 55) - (process-drawable-reserved-method-56 () none 56) - (process-drawable-reserved-method-57 () none 57) - (process-drawable-reserved-method-58 () none 58) - (process-drawable-reserved-method-59 () none 59) - (process-drawable-reserved-method-60 () none 60) - (process-drawable-reserved-method-61 () none 61) - (process-drawable-reserved-method-62 () none 62) - (process-drawable-reserved-method-63 () none 63) - (process-drawable-reserved-method-64 () none 64) - (process-drawable-reserved-method-65 () none 65) - (process-drawable-reserved-method-66 () none 66) - (process-drawable-reserved-method-67 () none 67) - (process-drawable-reserved-method-68 () none 68) - (process-drawable-reserved-method-69 () none 69) - (process-drawable-reserved-method-70 () none 70) - (process-drawable-reserved-method-71 () none 71) - (process-drawable-reserved-method-72 () none 72) - (process-drawable-reserved-method-73 () none 73) - (process-drawable-reserved-method-74 () none 74) - (process-drawable-reserved-method-75 () none 75) - (process-drawable-reserved-method-76 () none 76) - (process-drawable-reserved-method-77 () none 77) - (process-drawable-reserved-method-78 () none 78) - (process-drawable-reserved-method-79 () none 79) - (process-drawable-reserved-method-80 () none 80) - (process-drawable-reserved-method-81 () none 81) - (process-drawable-reserved-method-82 () none 82) - (process-drawable-reserved-method-83 () none 83) - (process-drawable-reserved-method-84 () none 84) - (process-drawable-reserved-method-85 () none 85) - (process-drawable-reserved-method-86 () none 86) - (process-drawable-reserved-method-87 () none 87) - (process-drawable-reserved-method-88 () none 88) - (process-drawable-reserved-method-89 () none 89) - (process-drawable-reserved-method-90 () none 90) - (process-drawable-reserved-method-91 () none 91) - (process-drawable-reserved-method-92 () none 92) - (process-drawable-reserved-method-93 () none 93) - (process-drawable-reserved-method-94 () none 94) - (process-drawable-reserved-method-95 () none 95) - (process-drawable-reserved-method-96 () none 96) - (process-drawable-reserved-method-97 () none 97) - (process-drawable-reserved-method-98 () none 98) - (process-drawable-reserved-method-99 () none 99) - (process-drawable-reserved-method-100 () none 100) - (process-drawable-reserved-method-101 () none 101) - (process-drawable-reserved-method-102 () none 102) - (process-drawable-reserved-method-103 () none 103) - (process-drawable-reserved-method-104 () none 104) - (process-drawable-reserved-method-105 () none 105) - (process-drawable-reserved-method-106 () none 106) - (process-drawable-reserved-method-107 () none 107) - (process-drawable-reserved-method-108 () none 108) - (process-drawable-reserved-method-109 () none 109) - (process-drawable-reserved-method-110 () none 110) - (process-drawable-reserved-method-111 () none 111) - (process-drawable-reserved-method-112 () none 112) - (process-drawable-reserved-method-113 () none 113) - (process-drawable-reserved-method-114 () none 114) - (process-drawable-reserved-method-115 () none 115) - (process-drawable-reserved-method-116 () none 116) - (process-drawable-reserved-method-117 () none 117) - (process-drawable-reserved-method-118 () none 118) - (process-drawable-reserved-method-119 () none 119) - (process-drawable-reserved-method-120 () none 120) - (process-drawable-reserved-method-121 () none 121) - (process-drawable-reserved-method-122 () none 122) - (process-drawable-reserved-method-123 () none 123) - (process-drawable-reserved-method-124 () none 124) - (process-drawable-reserved-method-125 () none 125) - (process-drawable-reserved-method-126 () none 126) - (process-drawable-reserved-method-127 () none 127) - (process-drawable-reserved-method-128 () none 128) - (process-drawable-reserved-method-129 () none 129) - (process-drawable-reserved-method-130 () none 130) - (process-drawable-reserved-method-131 () none 131) - (process-drawable-reserved-method-132 () none 132) - (process-drawable-reserved-method-133 () none 133) - (process-drawable-reserved-method-134 () none 134) - (process-drawable-reserved-method-135 () none 135) - (process-drawable-reserved-method-136 () none 136) - (process-drawable-reserved-method-137 () none 137) - (process-drawable-reserved-method-138 () none 138) - (process-drawable-reserved-method-139 () none 139) - (process-drawable-reserved-method-140 () none 140) - (process-drawable-reserved-method-141 () none 141) - (process-drawable-reserved-method-142 () none 142) - (process-drawable-reserved-method-143 () none 143) - (process-drawable-reserved-method-144 () none 144) - (process-drawable-reserved-method-145 () none 145) - (process-drawable-reserved-method-146 () none 146) - (process-drawable-reserved-method-147 () none 147) - (process-drawable-reserved-method-148 () none 148) - (process-drawable-reserved-method-149 () none 149) - (process-drawable-reserved-method-150 () none 150) - (process-drawable-reserved-method-151 () none 151) - (process-drawable-reserved-method-152 () none 152) - (process-drawable-reserved-method-153 () none 153) - (process-drawable-reserved-method-154 () none 154) - (process-drawable-reserved-method-155 () none 155) - (process-drawable-reserved-method-156 () none 156) - (process-drawable-reserved-method-157 () none 157) - (process-drawable-reserved-method-158 () none 158) - (process-drawable-reserved-method-159 () none 159) - (process-drawable-reserved-method-160 () none 160) - (process-drawable-reserved-method-161 () none 161) - (process-drawable-reserved-method-162 () none 162) - (process-drawable-reserved-method-163 () none 163) - (process-drawable-reserved-method-164 () none 164) - (process-drawable-reserved-method-165 () none 165) - (process-drawable-reserved-method-166 () none 166) - (process-drawable-reserved-method-167 () none 167) - (process-drawable-reserved-method-168 () none 168) - (process-drawable-reserved-method-169 () none 169) - (process-drawable-reserved-method-170 () none 170) - (process-drawable-reserved-method-171 () none 171) - (process-drawable-reserved-method-172 () none 172) - (process-drawable-reserved-method-173 () none 173) - (process-drawable-reserved-method-174 () none 174) - (process-drawable-reserved-method-175 () none 175) - (process-drawable-reserved-method-176 () none 176) - (process-drawable-reserved-method-177 () none 177) + (process-drawable-reserved-method-20 () none) + (process-drawable-reserved-method-21 () none) + (process-drawable-reserved-method-22 () none) + (process-drawable-reserved-method-23 () none) + (process-drawable-reserved-method-24 () none) + (process-drawable-reserved-method-25 () none) + (process-drawable-reserved-method-26 () none) + (process-drawable-reserved-method-27 () none) + (process-drawable-reserved-method-28 () none) + (process-drawable-reserved-method-29 () none) + (process-drawable-reserved-method-30 () none) + (process-drawable-reserved-method-31 () none) + (process-drawable-reserved-method-32 () none) + (process-drawable-reserved-method-33 () none) + (process-drawable-reserved-method-34 () none) + (process-drawable-reserved-method-35 () none) + (process-drawable-reserved-method-36 () none) + (process-drawable-reserved-method-37 () none) + (process-drawable-reserved-method-38 () none) + (process-drawable-reserved-method-39 () none) + (process-drawable-reserved-method-40 () none) + (process-drawable-reserved-method-41 () none) + (process-drawable-reserved-method-42 () none) + (process-drawable-reserved-method-43 () none) + (process-drawable-reserved-method-44 () none) + (process-drawable-reserved-method-45 () none) + (process-drawable-reserved-method-46 () none) + (process-drawable-reserved-method-47 () none) + (process-drawable-reserved-method-48 () none) + (process-drawable-reserved-method-49 () none) + (process-drawable-reserved-method-50 () none) + (process-drawable-reserved-method-51 () none) + (process-drawable-reserved-method-52 () none) + (process-drawable-reserved-method-53 () none) + (process-drawable-reserved-method-54 () none) + (process-drawable-reserved-method-55 () none) + (process-drawable-reserved-method-56 () none) + (process-drawable-reserved-method-57 () none) + (process-drawable-reserved-method-58 () none) + (process-drawable-reserved-method-59 () none) + (process-drawable-reserved-method-60 () none) + (process-drawable-reserved-method-61 () none) + (process-drawable-reserved-method-62 () none) + (process-drawable-reserved-method-63 () none) + (process-drawable-reserved-method-64 () none) + (process-drawable-reserved-method-65 () none) + (process-drawable-reserved-method-66 () none) + (process-drawable-reserved-method-67 () none) + (process-drawable-reserved-method-68 () none) + (process-drawable-reserved-method-69 () none) + (process-drawable-reserved-method-70 () none) + (process-drawable-reserved-method-71 () none) + (process-drawable-reserved-method-72 () none) + (process-drawable-reserved-method-73 () none) + (process-drawable-reserved-method-74 () none) + (process-drawable-reserved-method-75 () none) + (process-drawable-reserved-method-76 () none) + (process-drawable-reserved-method-77 () none) + (process-drawable-reserved-method-78 () none) + (process-drawable-reserved-method-79 () none) + (process-drawable-reserved-method-80 () none) + (process-drawable-reserved-method-81 () none) + (process-drawable-reserved-method-82 () none) + (process-drawable-reserved-method-83 () none) + (process-drawable-reserved-method-84 () none) + (process-drawable-reserved-method-85 () none) + (process-drawable-reserved-method-86 () none) + (process-drawable-reserved-method-87 () none) + (process-drawable-reserved-method-88 () none) + (process-drawable-reserved-method-89 () none) + (process-drawable-reserved-method-90 () none) + (process-drawable-reserved-method-91 () none) + (process-drawable-reserved-method-92 () none) + (process-drawable-reserved-method-93 () none) + (process-drawable-reserved-method-94 () none) + (process-drawable-reserved-method-95 () none) + (process-drawable-reserved-method-96 () none) + (process-drawable-reserved-method-97 () none) + (process-drawable-reserved-method-98 () none) + (process-drawable-reserved-method-99 () none) + (process-drawable-reserved-method-100 () none) + (process-drawable-reserved-method-101 () none) + (process-drawable-reserved-method-102 () none) + (process-drawable-reserved-method-103 () none) + (process-drawable-reserved-method-104 () none) + (process-drawable-reserved-method-105 () none) + (process-drawable-reserved-method-106 () none) + (process-drawable-reserved-method-107 () none) + (process-drawable-reserved-method-108 () none) + (process-drawable-reserved-method-109 () none) + (process-drawable-reserved-method-110 () none) + (process-drawable-reserved-method-111 () none) + (process-drawable-reserved-method-112 () none) + (process-drawable-reserved-method-113 () none) + (process-drawable-reserved-method-114 () none) + (process-drawable-reserved-method-115 () none) + (process-drawable-reserved-method-116 () none) + (process-drawable-reserved-method-117 () none) + (process-drawable-reserved-method-118 () none) + (process-drawable-reserved-method-119 () none) + (process-drawable-reserved-method-120 () none) + (process-drawable-reserved-method-121 () none) + (process-drawable-reserved-method-122 () none) + (process-drawable-reserved-method-123 () none) + (process-drawable-reserved-method-124 () none) + (process-drawable-reserved-method-125 () none) + (process-drawable-reserved-method-126 () none) + (process-drawable-reserved-method-127 () none) + (process-drawable-reserved-method-128 () none) + (process-drawable-reserved-method-129 () none) + (process-drawable-reserved-method-130 () none) + (process-drawable-reserved-method-131 () none) + (process-drawable-reserved-method-132 () none) + (process-drawable-reserved-method-133 () none) + (process-drawable-reserved-method-134 () none) + (process-drawable-reserved-method-135 () none) + (process-drawable-reserved-method-136 () none) + (process-drawable-reserved-method-137 () none) + (process-drawable-reserved-method-138 () none) + (process-drawable-reserved-method-139 () none) + (process-drawable-reserved-method-140 () none) + (process-drawable-reserved-method-141 () none) + (process-drawable-reserved-method-142 () none) + (process-drawable-reserved-method-143 () none) + (process-drawable-reserved-method-144 () none) + (process-drawable-reserved-method-145 () none) + (process-drawable-reserved-method-146 () none) + (process-drawable-reserved-method-147 () none) + (process-drawable-reserved-method-148 () none) + (process-drawable-reserved-method-149 () none) + (process-drawable-reserved-method-150 () none) + (process-drawable-reserved-method-151 () none) + (process-drawable-reserved-method-152 () none) + (process-drawable-reserved-method-153 () none) + (process-drawable-reserved-method-154 () none) + (process-drawable-reserved-method-155 () none) + (process-drawable-reserved-method-156 () none) + (process-drawable-reserved-method-157 () none) + (process-drawable-reserved-method-158 () none) + (process-drawable-reserved-method-159 () none) + (process-drawable-reserved-method-160 () none) + (process-drawable-reserved-method-161 () none) + (process-drawable-reserved-method-162 () none) + (process-drawable-reserved-method-163 () none) + (process-drawable-reserved-method-164 () none) + (process-drawable-reserved-method-165 () none) + (process-drawable-reserved-method-166 () none) + (process-drawable-reserved-method-167 () none) + (process-drawable-reserved-method-168 () none) + (process-drawable-reserved-method-169 () none) + (process-drawable-reserved-method-170 () none) + (process-drawable-reserved-method-171 () none) + (process-drawable-reserved-method-172 () none) + (process-drawable-reserved-method-173 () none) + (process-drawable-reserved-method-174 () none) + (process-drawable-reserved-method-175 () none) + (process-drawable-reserved-method-176 () none) + (process-drawable-reserved-method-177 () none) ) ) ;; definition for method 3 of type process-drawable-reserved -(defmethod inspect process-drawable-reserved ((this process-drawable-reserved)) +(defmethod inspect ((this process-drawable-reserved)) (when (not this) (set! this this) (goto cfg-4) @@ -253,18 +245,15 @@ ;; definition of type attack-dir-info (deftype attack-dir-info (structure) - ((dir vector :inline :offset-assert 0) - (xz-dir vector :inline :offset-assert 16) - (attacker-velocity vector :inline :offset-assert 32) - (pos vector :inline :offset-assert 48) + ((dir vector :inline) + (xz-dir vector :inline) + (attacker-velocity vector :inline) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type attack-dir-info -(defmethod inspect attack-dir-info ((this attack-dir-info)) +(defmethod inspect ((this attack-dir-info)) (when (not this) (set! this this) (goto cfg-4) @@ -280,43 +269,40 @@ ;; definition of type attack-info (deftype attack-info (structure) - ((trans vector :inline :offset-assert 0) - (vector vector :inline :offset-assert 16) - (attacker-velocity vector :inline :offset-assert 32) - (intersection vector :inline :offset-assert 48) - (attacker handle :offset-assert 64) - (attack-time time-frame :offset-assert 72) - (invinc-time time-frame :offset-assert 80) - (mask attack-mask :offset-assert 88) - (mode symbol :offset-assert 92) - (shove-back meters :offset-assert 96) - (shove-up meters :offset-assert 100) - (speed meters :offset-assert 104) - (dist meters :offset-assert 108) - (control float :offset-assert 112) - (angle symbol :offset-assert 116) - (rotate-to degrees :offset-assert 120) - (prev-state state :offset-assert 124) - (id uint32 :offset-assert 128) - (count uint32 :offset-assert 132) - (penetrate-using penetrate :offset-assert 136) - (damage float :offset-assert 144) - (shield-damage float :offset-assert 148) - (knock uint8 :offset-assert 152) - (test symbol :offset-assert 156) + ((trans vector :inline) + (vector vector :inline) + (attacker-velocity vector :inline) + (intersection vector :inline) + (attacker handle) + (attack-time time-frame) + (invinc-time time-frame) + (mask attack-mask) + (mode symbol) + (shove-back meters) + (shove-up meters) + (speed meters) + (dist meters) + (control float) + (angle symbol) + (rotate-to degrees) + (prev-state state) + (id uint32) + (count uint32) + (penetrate-using penetrate) + (damage float) + (shield-damage float) + (knock uint8) + (test symbol) ) - :method-count-assert 12 - :size-assert #xa0 - :flag-assert #xc000000a0 (:methods - (attack-info-method-9 (_type_ attack-info process-drawable process-drawable) none 9) - (compute-intersect-info (_type_ object process-drawable process touching-shapes-entry) attack-info 10) - (combine! (_type_ attack-info process-drawable) attack-info 11) + (attack-info-method-9 (_type_ attack-info process-drawable process-drawable) none) + (compute-intersect-info (_type_ object process-drawable process touching-shapes-entry) attack-info) + (combine! (_type_ attack-info process-drawable) attack-info) ) ) ;; definition for method 3 of type attack-info -(defmethod inspect attack-info ((this attack-info)) +(defmethod inspect ((this attack-info)) (when (not this) (set! this this) (goto cfg-50) @@ -424,18 +410,15 @@ ;; definition of type ground-tween-info (deftype ground-tween-info (structure) - ((chan uint8 3 :offset-assert 0) - (blend float 3 :offset-assert 4) - (group uint32 5 :offset-assert 16) + ((chan uint8 3) + (blend float 3) + (group uint32 5) ) :pack-me - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type ground-tween-info -(defmethod inspect ground-tween-info ((this ground-tween-info)) +(defmethod inspect ((this ground-tween-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc b/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc index a612a005ec3..db7f30b5e75 100644 --- a/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc @@ -5,19 +5,16 @@ ;; definition of type game-bank (deftype game-bank (basic) - ((life-max-default float :offset-assert 4) - (life-start-default float :offset-assert 8) - (life-single-inc float :offset-assert 12) - (money-task-inc float :offset-assert 16) - (money-oracle-inc float :offset-assert 20) + ((life-max-default float) + (life-start-default float) + (life-single-inc float) + (money-task-inc float) + (money-oracle-inc float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type game-bank -(defmethod inspect game-bank ((this game-bank)) +(defmethod inspect ((this game-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -45,29 +42,23 @@ ;; definition of type actor-id (deftype actor-id (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type highscore-info (deftype highscore-info (structure) - ((flags highscore-flags :offset-assert 0) - (award-scores float 3 :offset-assert 4) - (bronze-score float :offset 4) - (silver-score float :offset 8) - (gold-score float :offset 12) + ((flags highscore-flags) + (award-scores float 3) + (bronze-score float :overlay-at (-> award-scores 0)) + (silver-score float :overlay-at (-> award-scores 1)) + (gold-score float :overlay-at (-> award-scores 2)) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (get-rank (_type_ float) int 9) + (get-rank (_type_ float) int) ) ) ;; definition for method 3 of type highscore-info -(defmethod inspect highscore-info ((this highscore-info)) +(defmethod inspect ((this highscore-info)) (when (not this) (set! this this) (goto cfg-4) @@ -84,19 +75,16 @@ ;; definition of type level-buffer-state (deftype level-buffer-state (structure) - ((name symbol :offset-assert 0) - (display? symbol :offset-assert 4) - (force-vis? symbol :offset-assert 8) - (force-inside? symbol :offset-assert 12) + ((name symbol) + (display? symbol) + (force-vis? symbol) + (force-inside? symbol) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type level-buffer-state -(defmethod inspect level-buffer-state ((this level-buffer-state)) +(defmethod inspect ((this level-buffer-state)) (when (not this) (set! this this) (goto cfg-4) @@ -112,36 +100,33 @@ ;; definition of type load-state (deftype load-state (basic) - ((want level-buffer-state 6 :inline :offset-assert 4) - (want-sound symbol 3 :offset-assert 100) - (vis-nick symbol :offset-assert 112) - (command-list pair :offset-assert 116) - (object-name string 256 :offset-assert 120) - (object-status basic 256 :offset-assert 1144) + ((want level-buffer-state 6 :inline) + (want-sound symbol 3) + (vis-nick symbol) + (command-list pair) + (object-name string 256) + (object-status basic 256) ) - :method-count-assert 22 - :size-assert #x878 - :flag-assert #x1600000878 (:methods - (new (symbol type) _type_ 0) - (reset! (_type_) _type_ 9) - (update! (_type_) int 10) - (want-levels (_type_ (pointer symbol)) int 11) - (want-sound-banks (_type_ (pointer symbol)) none 12) - (want-display-level (_type_ symbol symbol) int 13) - (want-vis-level (_type_ symbol) none 14) - (want-force-vis (_type_ symbol symbol) int 15) - (want-force-inside (_type_ symbol symbol) none 16) - (execute-commands-up-to (_type_ float) none 17) - (backup-load-state-and-set-cmds (_type_ pair) int 18) - (restore-load-state-and-cleanup (_type_) int 19) - (restore-load-state (_type_) int 20) - (add-borrow-levels (_type_) none 21) + (new (symbol type) _type_) + (reset! (_type_) _type_) + (update! (_type_) int) + (want-levels (_type_ (pointer symbol)) int) + (want-sound-banks (_type_ (pointer symbol)) none) + (want-display-level (_type_ symbol symbol) int) + (want-vis-level (_type_ symbol) none) + (want-force-vis (_type_ symbol symbol) int) + (want-force-inside (_type_ symbol symbol) none) + (execute-commands-up-to (_type_ float) none) + (backup-load-state-and-set-cmds (_type_ pair) int) + (restore-load-state-and-cleanup (_type_) int) + (restore-load-state (_type_) int) + (add-borrow-levels (_type_) none) ) ) ;; definition for method 3 of type load-state -(defmethod inspect load-state ((this load-state)) +(defmethod inspect ((this load-state)) (when (not this) (set! this this) (goto cfg-10) @@ -170,30 +155,27 @@ ;; definition of type continue-point (deftype continue-point (basic) - ((name string :offset-assert 4) - (level symbol :offset-assert 8) - (flags continue-flags :offset-assert 12) - (trans vector :inline :offset-assert 16) - (quat vector :inline :offset-assert 32) - (camera-trans vector :inline :offset-assert 48) - (camera-rot vector3s 3 :inline :offset-assert 64) - (on-goto pair :offset-assert 100) - (vis-nick symbol :offset-assert 104) - (want level-buffer-state 6 :inline :offset-assert 108) - (want-sound symbol 3 :offset-assert 204) + ((name string) + (level symbol) + (flags continue-flags) + (trans vector :inline) + (quat vector :inline) + (camera-trans vector :inline) + (camera-rot vector3s 3 :inline) + (on-goto pair) + (vis-nick symbol) + (want level-buffer-state 6 :inline) + (want-sound symbol 3) ) - :method-count-assert 12 - :size-assert #xd8 - :flag-assert #xc000000d8 (:methods - (debug-draw (_type_) int 9) - (continue-point-method-10 (_type_ load-state) continue-point 10) - (move-camera! (_type_) none 11) + (debug-draw (_type_) int) + (continue-point-method-10 (_type_ load-state) continue-point) + (move-camera! (_type_) none) ) ) ;; definition for method 3 of type continue-point -(defmethod inspect continue-point ((this continue-point)) +(defmethod inspect ((this continue-point)) (when (not this) (set! this this) (goto cfg-10) @@ -222,134 +204,131 @@ ;; definition of type game-info (deftype game-info (basic) - ((mode symbol :offset-assert 4) - (save-name string :offset-assert 8) - (life float :offset-assert 12) - (life-max float :offset-assert 16) - (money float :offset-assert 20) - (money-total float :offset-assert 24) - (money-per-level uint8 32 :offset-assert 28) - (deaths-per-level uint8 32 :offset-assert 60) - (buzzer-total float :offset-assert 92) - (fuel float :offset-assert 96) - (gem float :offset-assert 100) - (gem-total float :offset-assert 104) - (skill float :offset-assert 108) - (skill-total float :offset-assert 112) - (karma float :offset-assert 116) - (eco-pill-dark float :offset-assert 120) - (eco-pill-dark-total float :offset-assert 124) - (features game-feature :offset-assert 128) - (debug-features game-feature :offset-assert 136) - (secrets game-secrets :offset-assert 144) - (unknown-pad1 uint32 :offset-assert 148) - (purchase-secrets game-secrets :offset-assert 152) - (unknown-pad2 uint32 :offset-assert 156) - (gun-type pickup-type :offset-assert 160) - (gun-ammo float 4 :offset-assert 164) - (shield float :offset-assert 180) - (score float :offset-assert 184) - (score-owner handle :offset-assert 192) - (timer time-frame :offset-assert 200) - (timer-owner handle :offset-assert 208) - (timer-flash symbol :offset-assert 216) - (counter float :offset-assert 220) - (counter-flash basic :offset-assert 224) - (attack-id uint32 :offset-assert 228) - (perm-list entity-perm-array :offset-assert 232) - (task-perm-list entity-perm-array :offset-assert 236) - (current-continue continue-point :offset-assert 240) - (last-continue continue-point :offset-assert 244) - (play-list (array game-task-info) :offset-assert 248) - (sub-task-list (array game-task-node-info) :offset-assert 252) - (mission-list (array game-task-node-info) :offset-assert 256) - (task-counter uint32 :offset-assert 260) - (unknown-pad6 (array uint16) :offset-assert 264) - (level-opened uint8 32 :offset-assert 268) - (total-deaths int32 :offset-assert 300) - (continue-deaths int32 :offset-assert 304) - (task-deaths int32 :offset-assert 308) - (total-trys int32 :offset-assert 312) - (game-start-time time-frame :offset-assert 320) - (continue-time time-frame :offset-assert 328) - (death-time time-frame :offset-assert 336) - (hit-time time-frame :offset-assert 344) - (task-pickup-time time-frame :offset-assert 352) - (unknown-array1 (array time-frame) :offset-assert 360) - (task-enter-times (array time-frame) :offset-assert 364) - (task-in-times (array time-frame) :offset-assert 368) - (death-pos vector-array :offset 372) - (stop-watch-start uint64 :offset-assert 376) - (stop-watch-stop uint64 :offset-assert 384) - (blackout-time time-frame :offset-assert 392) - (letterbox-time time-frame :offset-assert 400) - (hint-play-time time-frame :offset-assert 408) - (display-text-time time-frame :offset-assert 416) - (display-text-handle handle :offset-assert 424) - (death-movie-tick int32 :offset-assert 432) - (want-auto-save symbol :offset-assert 436) - (auto-save-proc handle :offset-assert 440) - (auto-save-status mc-status-code :offset-assert 448) - (auto-save-card int32 :offset-assert 452) - (auto-save-which int32 :offset-assert 456) - (auto-save-count int32 :offset-assert 460) - (pov-camera-handle handle :offset-assert 464) - (other-camera-handle handle :offset-assert 472) - (controller handle 2 :offset-assert 480) - (race-timer uint64 :offset-assert 496) - (race-current-lap-count int32 :offset-assert 504) - (race-total-lap-count int32 :offset-assert 508) - (race-position int32 :offset-assert 512) - (race-number-turbos int32 :offset-assert 516) - (bot-health float 3 :offset-assert 520) - (demo-state uint32 :offset-assert 532) - (wanted-flash symbol :offset-assert 536) - (distance float :offset-assert 540) - (kiosk-timeout uint64 :offset-assert 544) - (pause-start-time time-frame :offset-assert 552) - (game-score (array float) :offset-assert 560) - (goal float :offset-assert 564) - (miss float :offset-assert 568) - (miss-max float :offset-assert 572) - (task-close-times (array time-frame) :offset-assert 576) - (live-eco-pill-count int32 :offset-assert 580) - (live-gem-count int32 :offset-assert 584) - (air-supply float :offset-assert 588) - (homing-beacon int32 :offset-assert 592) - (dark-eco-pickup int32 :offset-assert 596) - (green-eco-pickup int32 :offset-assert 600) + ((mode symbol) + (save-name string) + (life float) + (life-max float) + (money float) + (money-total float) + (money-per-level uint8 32) + (deaths-per-level uint8 32) + (buzzer-total float) + (fuel float) + (gem float) + (gem-total float) + (skill float) + (skill-total float) + (karma float) + (eco-pill-dark float) + (eco-pill-dark-total float) + (features game-feature) + (debug-features game-feature) + (secrets game-secrets) + (unknown-pad1 uint32) + (purchase-secrets game-secrets) + (unknown-pad2 uint32) + (gun-type pickup-type) + (gun-ammo float 4) + (shield float) + (score float) + (score-owner handle) + (timer time-frame) + (timer-owner handle) + (timer-flash symbol) + (counter float) + (counter-flash basic) + (attack-id uint32) + (perm-list entity-perm-array) + (task-perm-list entity-perm-array) + (current-continue continue-point) + (last-continue continue-point) + (play-list (array game-task-info)) + (sub-task-list (array game-task-node-info)) + (mission-list (array game-task-node-info)) + (task-counter uint32) + (unknown-pad6 (array uint16)) + (level-opened uint8 32) + (total-deaths int32) + (continue-deaths int32) + (task-deaths int32) + (total-trys int32) + (game-start-time time-frame) + (continue-time time-frame) + (death-time time-frame) + (hit-time time-frame) + (task-pickup-time time-frame) + (unknown-array1 (array time-frame)) + (task-enter-times (array time-frame)) + (task-in-times (array time-frame)) + (death-pos vector-array :offset 372) + (stop-watch-start uint64) + (stop-watch-stop uint64) + (blackout-time time-frame) + (letterbox-time time-frame) + (hint-play-time time-frame) + (display-text-time time-frame) + (display-text-handle handle) + (death-movie-tick int32) + (want-auto-save symbol) + (auto-save-proc handle) + (auto-save-status mc-status-code) + (auto-save-card int32) + (auto-save-which int32) + (auto-save-count int32) + (pov-camera-handle handle) + (other-camera-handle handle) + (controller handle 2) + (race-timer uint64) + (race-current-lap-count int32) + (race-total-lap-count int32) + (race-position int32) + (race-number-turbos int32) + (bot-health float 3) + (demo-state uint32) + (wanted-flash symbol) + (distance float) + (kiosk-timeout uint64) + (pause-start-time time-frame) + (game-score (array float)) + (goal float) + (miss float) + (miss-max float) + (task-close-times (array time-frame)) + (live-eco-pill-count int32) + (live-gem-count int32) + (air-supply float) + (homing-beacon int32) + (dark-eco-pickup int32) + (green-eco-pickup int32) ) - :method-count-assert 31 - :size-assert #x25c - :flag-assert #x1f0000025c (:methods - (initialize! (_type_ symbol game-save string) _type_ 9) - (give (_type_ symbol float handle) float 10) - (task-complete? (_type_ game-task) symbol 11) - (subtask-index-by-name (_type_ string) int 12) - (set-subtask-hook! (_type_ game-task-node int function) function 13) - (actor-perm (_type_ actor-id) entity-perm 14) - (task-perm-by-index (_type_ int) entity-perm 15) - (copy-perms-from-level! (_type_ level) int 16) - (copy-perms-to-level! (_type_ level) int 17) - (debug-inspect (_type_ symbol) _type_ 18) - (get-current-continue-forced (_type_) continue-point 19) - (get-continue-by-name (_type_ string) continue-point 20) - (set-continue! (_type_ basic symbol) continue-point 21) - (game-info-method-22 (_type_) int 22) - (save-game (_type_ game-save string) game-save 23) - (load-game (_type_ game-save) game-save 24) - (you-suck-stage (_type_ symbol) int 25) - (you-suck-scale (_type_ object) float 26) - (get-next-attack-id (_type_) uint 27) - (game-info-method-28 (_type_ game-score float) int 28) - (get-game-score-ref (_type_ int) (pointer float) 29) - (calculate-percentage (_type_) float 30) + (initialize! (_type_ symbol game-save string) _type_) + (give (_type_ symbol float handle) float) + (task-complete? (_type_ game-task) symbol) + (subtask-index-by-name (_type_ string) int) + (set-subtask-hook! (_type_ game-task-node int function) function) + (actor-perm (_type_ actor-id) entity-perm) + (task-perm-by-index (_type_ int) entity-perm) + (copy-perms-from-level! (_type_ level) int) + (copy-perms-to-level! (_type_ level) int) + (debug-inspect (_type_ symbol) _type_) + (get-current-continue-forced (_type_) continue-point) + (get-continue-by-name (_type_ string) continue-point) + (set-continue! (_type_ basic symbol) continue-point) + (game-info-method-22 (_type_) int) + (save-game (_type_ game-save string) game-save) + (load-game (_type_ game-save) game-save) + (you-suck-stage (_type_ symbol) int) + (you-suck-scale (_type_ object) float) + (get-next-attack-id (_type_) uint) + (game-info-method-28 (_type_ game-score float) int) + (get-game-score-ref (_type_ int) (pointer float)) + (calculate-percentage (_type_) float) ) ) ;; definition for method 3 of type game-info -(defmethod inspect game-info ((this game-info)) +(defmethod inspect ((this game-info)) (when (not this) (set! this this) (goto cfg-4) @@ -446,7 +425,7 @@ ) ;; definition for method 27 of type game-info -(defmethod get-next-attack-id game-info ((this game-info)) +(defmethod get-next-attack-id ((this game-info)) (let ((v0-0 (+ (-> this attack-id) 1))) (set! (-> this attack-id) v0-0) v0-0 diff --git a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc index e819a4135dd..1c460539dae 100644 --- a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 9 of type border-plane -(defmethod debug-draw border-plane ((this border-plane)) +(defmethod debug-draw ((this border-plane)) (let* ((v1-0 (-> this action)) (plane-color (if (= v1-0 'load) (the-as uint #x8000ff00) @@ -31,17 +31,17 @@ ) ;; definition for method 10 of type border-plane -(defmethod point-past-plane? border-plane ((this border-plane) (arg0 vector)) +(defmethod point-past-plane? ((this border-plane) (arg0 vector)) (>= (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) (-> this normal)) 0.0) ) ;; definition for method 11 of type game-info -(defmethod task-complete? game-info ((this game-info) (arg0 game-task)) +(defmethod task-complete? ((this game-info) (arg0 game-task)) (logtest? (-> this task-perm-list data arg0 status) (entity-perm-status complete)) ) ;; definition for method 12 of type game-info -(defmethod subtask-index-by-name game-info ((this game-info) (arg0 string)) +(defmethod subtask-index-by-name ((this game-info) (arg0 string)) (let ((subtasks (-> *game-info* sub-task-list))) (dotimes (i (-> subtasks length)) (when (nonzero? i) @@ -57,7 +57,7 @@ ) ;; definition for method 13 of type game-info -(defmethod set-subtask-hook! game-info ((this game-info) (arg0 game-task-node) (arg1 int) (arg2 function)) +(defmethod set-subtask-hook! ((this game-info) (arg0 game-task-node) (arg1 int) (arg2 function)) (let ((subtask (-> this sub-task-list arg0))) (if (and subtask (-> subtask info)) (set! (-> subtask info hooks arg1) arg2) @@ -91,7 +91,7 @@ ;; definition for method 10 of type continue-point ;; INFO: Used lq/sq -(defmethod continue-point-method-10 continue-point ((this continue-point) (arg0 load-state)) +(defmethod continue-point-method-10 ((this continue-point) (arg0 load-state)) (let ((v1-0 (lookup-level-info (-> this vis-nick)))) (set! (-> this vis-nick) (if v1-0 (-> v1-0 name) @@ -127,7 +127,7 @@ ;; definition for method 11 of type continue-point ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-camera! continue-point ((this continue-point)) +(defmethod move-camera! ((this continue-point)) (set! (-> *camera-combiner* trans quad) (-> this camera-trans quad)) (let ((gp-0 (-> *camera-combiner* inv-camera-rot)) (s5-0 (-> this camera-rot)) @@ -150,7 +150,7 @@ ) ;; definition for method 19 of type game-info -(defmethod get-current-continue-forced game-info ((this game-info)) +(defmethod get-current-continue-forced ((this game-info)) (cond ((and (= (-> this mode) 'play) (-> this current-continue)) (-> this current-continue) @@ -167,7 +167,7 @@ ) ;; definition for method 20 of type game-info -(defmethod get-continue-by-name game-info ((this game-info) (arg0 string)) +(defmethod get-continue-by-name ((this game-info) (arg0 string)) (if (not arg0) (return (the-as continue-point #f)) ) @@ -191,7 +191,7 @@ ;; definition for method 21 of type game-info ;; WARN: Using new Jak 2 rtype-of -(defmethod set-continue! game-info ((this game-info) (arg0 basic) (arg1 symbol)) +(defmethod set-continue! ((this game-info) (arg0 basic) (arg1 symbol)) (let ((s5-0 (-> this current-continue))) (if (null? arg0) (set! arg0 (the-as basic #f)) @@ -241,12 +241,12 @@ ) ;; definition for method 15 of type game-info -(defmethod task-perm-by-index game-info ((this game-info) (arg0 int)) +(defmethod task-perm-by-index ((this game-info) (arg0 int)) (-> this task-perm-list data arg0) ) ;; definition for method 30 of type game-info -(defmethod calculate-percentage game-info ((this game-info)) +(defmethod calculate-percentage ((this game-info)) (let ((story-total 0) (story-complete 0) ) @@ -300,7 +300,7 @@ ;; definition for method 9 of type game-info ;; INFO: Used lq/sq ;; ERROR: Expression building failed: In (method 9 game-info): Expression pass could not find the set-to-run function. Found t9-31 instead. Make sure there are no casts on this function. -(defmethod initialize! game-info ((this game-info) (arg0 symbol) (arg1 game-save) (arg2 string)) +(defmethod initialize! ((this game-info) (arg0 symbol) (arg1 game-save) (arg2 string)) (local-vars (v0-17 object) (v0-29 process-tree) @@ -453,7 +453,7 @@ ) ;; definition for method 10 of type game-info -(defmethod give game-info ((this game-info) (arg0 symbol) (arg1 float) (arg2 handle)) +(defmethod give ((this game-info) (arg0 symbol) (arg1 float) (arg2 handle)) (local-vars (ammo-max float)) (with-pp (case arg0 @@ -629,13 +629,13 @@ ) ;; definition for method 22 of type game-info -(defmethod game-info-method-22 game-info ((this game-info)) +(defmethod game-info-method-22 ((this game-info)) 0 ) ;; definition for method 10 of type fact-info-target ;; WARN: Return type mismatch float vs none. -(defmethod reset! fact-info-target ((this fact-info-target) (arg0 symbol)) +(defmethod reset! ((this fact-info-target) (arg0 symbol)) (when (or (not arg0) (= arg0 'eco)) (set! (-> this eco-timeout) 0) (set! (-> this eco-level) 0.0) @@ -667,7 +667,7 @@ ) ;; definition for method 11 of type fact-info-target -(defmethod pickup-collectable! fact-info-target ((this fact-info-target) (arg0 pickup-type) (arg1 float) (arg2 handle)) +(defmethod pickup-collectable! ((this fact-info-target) (arg0 pickup-type) (arg1 float) (arg2 handle)) (case arg0 (((pickup-type health) (pickup-type eco-green)) (cond @@ -1009,7 +1009,7 @@ ) ;; definition for method 14 of type game-info -(defmethod actor-perm game-info ((this game-info) (arg0 actor-id)) +(defmethod actor-perm ((this game-info) (arg0 actor-id)) (let ((game-perms (-> this perm-list))) (countdown (i (-> game-perms length)) (if (= arg0 (-> game-perms data i aid)) @@ -1022,7 +1022,7 @@ ;; definition for method 16 of type game-info ;; INFO: Used lq/sq -(defmethod copy-perms-from-level! game-info ((this game-info) (arg0 level)) +(defmethod copy-perms-from-level! ((this game-info) (arg0 level)) (let ((game-perms (-> this perm-list)) (level-entities (-> arg0 bsp level entity)) ) @@ -1049,7 +1049,7 @@ ;; definition for method 17 of type game-info ;; INFO: Used lq/sq -(defmethod copy-perms-to-level! game-info ((this game-info) (arg0 level)) +(defmethod copy-perms-to-level! ((this game-info) (arg0 level)) (let ((level-entities (-> arg0 bsp level entity))) (dotimes (i (-> level-entities length)) (let* ((entity-perm (-> level-entities data i entity extra perm)) @@ -1066,14 +1066,14 @@ ) ;; definition for method 2 of type continue-point -(defmethod print continue-point ((this continue-point)) +(defmethod print ((this continue-point)) (format #t "#<~A ~S @ #x~X>" (-> this type) (-> this name) this) this ) ;; definition for method 9 of type continue-point ;; INFO: Used lq/sq -(defmethod debug-draw continue-point ((this continue-point)) +(defmethod debug-draw ((this continue-point)) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this trans) (new 'static 'rgba :r #xff :a #x80)) (add-debug-text-3d #t @@ -1286,14 +1286,14 @@ ) ;; definition for method 2 of type game-task-info -(defmethod print game-task-info ((this game-task-info)) +(defmethod print ((this game-task-info)) (format #t "#" (-> this name) this) this ) ;; definition for method 18 of type game-info ;; INFO: Used lq/sq -(defmethod debug-inspect game-info ((this game-info) (arg0 symbol)) +(defmethod debug-inspect ((this game-info) (arg0 symbol)) (local-vars (sv-16 int) (sv-24 int) @@ -1506,7 +1506,7 @@ ) ;; definition for method 25 of type game-info -(defmethod you-suck-stage game-info ((this game-info) (arg0 symbol)) +(defmethod you-suck-stage ((this game-info) (arg0 symbol)) (cond ((logtest? (-> *game-info* secrets) (game-secrets hero-mode)) 0 @@ -1541,12 +1541,12 @@ ) ;; definition for method 26 of type game-info -(defmethod you-suck-scale game-info ((this game-info) (arg0 object)) +(defmethod you-suck-scale ((this game-info) (arg0 object)) (* 0.25 (the float (you-suck-stage this #f))) ) ;; definition for method 9 of type cpad-info -(defmethod adjust-to-screen-flip cpad-info ((this cpad-info)) +(defmethod adjust-to-screen-flip ((this cpad-info)) (when (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) (set! (-> this leftx) (- 255 (the-as int (-> this leftx)))) (set! (-> this rightx) (- 255 (the-as int (-> this rightx)))) @@ -1555,7 +1555,7 @@ ) ;; definition for method 28 of type game-info -(defmethod game-info-method-28 game-info ((this game-info) (arg0 game-score) (arg1 float)) +(defmethod game-info-method-28 ((this game-info) (arg0 game-score) (arg1 float)) (when (!= arg1 0.0) (let ((v1-3 (&+ (-> this game-score data) (* (* arg0 8) 4)))) (case arg0 @@ -1605,12 +1605,12 @@ ) ;; definition for method 29 of type game-info -(defmethod get-game-score-ref game-info ((this game-info) (arg0 int)) +(defmethod get-game-score-ref ((this game-info) (arg0 int)) (&+ (-> this game-score data) (* (* arg0 8) 4)) ) ;; definition for method 9 of type highscore-info -(defmethod get-rank highscore-info ((this highscore-info) (score float)) +(defmethod get-rank ((this highscore-info) (score float)) (let ((place 0)) (cond ((logtest? (-> this flags) (highscore-flags time)) diff --git a/test/decompiler/reference/jak2/engine/game/game-save_REF.gc b/test/decompiler/reference/jak2/engine/game/game-save_REF.gc index 91102e31080..f9f2310d7e4 100644 --- a/test/decompiler/reference/jak2/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-save_REF.gc @@ -234,29 +234,26 @@ ;; definition of type game-save-tag (deftype game-save-tag (structure) - ((user-object object 2 :offset 0) - (user-uint64 uint64 :offset 0) - (user-float0 float :offset 0) - (user-float float 2 :offset 0) - (user-int32 int32 2 :offset 0) - (user-uint32 uint32 2 :offset 0) - (user-int16 int16 4 :offset 0) - (user-uint16 uint16 4 :offset 0) - (user-int8 int8 8 :offset 0) - (user-int80 int8 :offset 0) - (user-int81 int8 :offset 1) - (user-uint8 uint8 8 :offset 0) - (elt-count int32 :offset-assert 8) - (elt-size uint16 :offset-assert 12) - (elt-type game-save-elt :offset-assert 14) + ((user-object object 2 :offset 0) + (user-uint64 uint64 :overlay-at (-> user-object 0)) + (user-float0 float :overlay-at user-uint64) + (user-float float 2 :overlay-at user-float0) + (user-int32 int32 2 :overlay-at user-float0) + (user-uint32 uint32 2 :overlay-at user-float0) + (user-int16 int16 4 :overlay-at user-uint64) + (user-uint16 uint16 4 :overlay-at user-uint64) + (user-int8 int8 8 :overlay-at user-uint64) + (user-int80 int8 :overlay-at user-uint64) + (user-int81 int8 :overlay-at (-> user-int8 1)) + (user-uint8 uint8 8 :overlay-at user-int80) + (elt-count int32) + (elt-size uint16) + (elt-type game-save-elt) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type game-save-tag -(defmethod inspect game-save-tag ((this game-save-tag)) +(defmethod inspect ((this game-save-tag)) (when (not this) (set! this this) (goto cfg-4) @@ -283,41 +280,38 @@ ;; definition of type game-save (deftype game-save (basic) - ((version int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (length int32 :offset-assert 12) - (info-int32 int32 16 :offset-assert 16) - (info-int8 int8 64 :offset 16) - (level-index int32 :offset 16) - (gem-count float :offset 20) - (skill-count float :offset 24) - (completion-percentage float :offset 28) - (minute uint8 :offset 36) - (hour uint8 :offset 37) - (week uint8 :offset 38) - (day uint8 :offset 39) - (month uint8 :offset 40) - (year uint8 :offset 41) - (new-game int32 :offset 44) - (game-time time-frame :offset 48) - (secrets uint32 :offset 56) - (features uint32 :offset 60) - (tag game-save-tag :inline :dynamic :offset-assert 80) + ((version int32) + (allocated-length int32) + (length int32) + (info-int32 int32 16) + (info-int8 int8 64 :overlay-at (-> info-int32 0)) + (level-index int32 :overlay-at (-> info-int32 0)) + (gem-count float :overlay-at (-> info-int32 1)) + (skill-count float :overlay-at (-> info-int32 2)) + (completion-percentage float :overlay-at (-> info-int32 3)) + (minute uint8 :overlay-at (-> info-int32 5)) + (hour uint8 :overlay-at (-> info-int8 21)) + (week uint8 :overlay-at (-> info-int8 22)) + (day uint8 :overlay-at (-> info-int8 23)) + (month uint8 :overlay-at (-> info-int32 6)) + (year uint8 :overlay-at (-> info-int8 25)) + (new-game int32 :overlay-at (-> info-int32 7)) + (game-time time-frame :overlay-at (-> info-int32 8)) + (secrets uint32 :overlay-at (-> info-int32 10)) + (features uint32 :overlay-at (-> info-int32 11)) + (tag game-save-tag :inline :dynamic) ) - :method-count-assert 12 - :size-assert #x50 - :flag-assert #xc00000050 (:methods - (new (symbol type int) _type_ 0) - (save-to-file (_type_ string) _type_ 9) - (load-from-file (_type_ string) _type_ 10) - (debug-inspect (_type_ symbol) _type_ 11) + (new (symbol type int) _type_) + (save-to-file (_type_ string) _type_) + (load-from-file (_type_ string) _type_) + (debug-inspect (_type_ symbol) _type_) ) ) ;; definition for method 3 of type game-save ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect game-save ((this game-save)) +(defmethod inspect ((this game-save)) (when (not this) (set! this this) (goto cfg-4) @@ -349,7 +343,7 @@ ;; definition for method 5 of type game-save ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of game-save ((this game-save)) +(defmethod asize-of ((this game-save)) (the-as int (+ (-> game-save size) (-> this allocated-length))) ) @@ -364,7 +358,7 @@ ;; definition for method 11 of type game-save ;; INFO: Used lq/sq -(defmethod debug-inspect game-save ((this game-save) (arg0 symbol)) +(defmethod debug-inspect ((this game-save) (arg0 symbol)) (local-vars (sv-16 int) (sv-32 string) (sv-48 string)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tversion: ~D~%" (-> this version)) @@ -512,12 +506,12 @@ ;; definition for method 3 of type game-save ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect game-save ((this game-save)) +(defmethod inspect ((this game-save)) (debug-inspect this #f) ) ;; definition for method 23 of type game-info -(defmethod save-game game-info ((this game-info) (arg0 game-save) (arg1 string)) +(defmethod save-game ((this game-info) (arg0 game-save) (arg1 string)) (with-pp (dotimes (s4-0 (-> *level* length)) (let ((a1-1 (-> *level* level s4-0))) @@ -1310,7 +1304,7 @@ ) ;; definition for method 24 of type game-info -(defmethod load-game game-info ((this game-info) (arg0 game-save)) +(defmethod load-game ((this game-info) (arg0 game-save)) (let ((v1-0 (the-as object (-> arg0 tag)))) (while (< (the-as int v1-0) (the-as int (&-> arg0 tag 0 user-int8 (-> arg0 length)))) (case (-> (the-as (inline-array game-save-tag) v1-0) 0 elt-type) @@ -1775,7 +1769,7 @@ ) ;; definition for method 9 of type game-save -(defmethod save-to-file game-save ((this game-save) (arg0 string)) +(defmethod save-to-file ((this game-save) (arg0 string)) (let ((s5-0 (new 'stack 'file-stream arg0 'write))) (file-stream-write s5-0 (&-> this type) (+ (-> this type size) (-> this length))) (file-stream-close s5-0) @@ -1784,7 +1778,7 @@ ) ;; definition for method 10 of type game-save -(defmethod load-from-file game-save ((this game-save) (arg0 string)) +(defmethod load-from-file ((this game-save) (arg0 string)) (let ((s5-0 (new 'stack 'file-stream arg0 'read))) (let ((s3-0 (file-stream-length s5-0)) (s4-0 (-> this allocated-length)) @@ -1829,38 +1823,34 @@ ;; definition of type auto-save (deftype auto-save (process) - ((card int32 :offset-assert 128) - (slot int32 :offset-assert 132) - (which int32 :offset-assert 136) - (buffer kheap :offset-assert 140) - (mode symbol :offset-assert 144) - (result mc-status-code :offset-assert 148) - (save game-save :offset-assert 152) - (info mc-slot-info :inline :offset-assert 156) - (notify handle :offset-assert 456) - (force symbol :offset-assert 464) - (state-time time-frame :offset-assert 472) - (icon hud-sprite :inline :offset 480) + ((card int32) + (slot int32) + (which int32) + (buffer kheap) + (mode symbol) + (result mc-status-code) + (save game-save) + (info mc-slot-info :inline) + (notify handle) + (force symbol) + (state-time time-frame) + (icon hud-sprite :inline :offset 480) ) - :heap-base #x1a0 - :method-count-assert 23 - :size-assert #x214 - :flag-assert #x1701a00214 - (:methods - (get-heap () _type_ :state 14) - (get-card () _type_ :state 15) - (format-card () _type_ :state 16) - (unformat-card () _type_ :state 17) - (create-file () _type_ :state 18) - (save () _type_ :state 19) - (restore () _type_ :state 20) - (error (mc-status-code) _type_ :state 21) - (done () _type_ :state 22) + (:state-methods + get-heap + get-card + format-card + unformat-card + create-file + save + restore + (error mc-status-code) + done ) ) ;; definition for method 3 of type auto-save -(defmethod inspect auto-save ((this auto-save)) +(defmethod inspect ((this auto-save)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc b/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc index 9e6cd7b206e..9267dea5685 100644 --- a/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc @@ -8,13 +8,10 @@ (param0 uint8 :offset 16 :size 8) (param1 uint8 :offset 24 :size 8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type idle-control-frame -(defmethod inspect idle-control-frame ((this idle-control-frame)) +(defmethod inspect ((this idle-control-frame)) (local-vars (a2-4 int)) (when (not this) (set! this this) @@ -58,22 +55,19 @@ ;; definition of type idle-control (deftype idle-control (structure) - ((anim (pointer idle-control-frame) :offset-assert 0) - (current (pointer idle-control-frame) :offset-assert 4) - (counter int32 :offset-assert 8) - (target int32 :offset-assert 12) + ((anim (pointer idle-control-frame)) + (current (pointer idle-control-frame)) + (counter int32) + (target int32) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (idle-control-method-9 (_type_ (pointer idle-control-frame)) none 9) - (idle-control-method-10 (_type_ process-drawable) none :behavior process-drawable 10) + (idle-control-method-9 (_type_ (pointer idle-control-frame)) none) + (idle-control-method-10 (_type_ process-drawable) none :behavior process-drawable) ) ) ;; definition for method 3 of type idle-control -(defmethod inspect idle-control ((this idle-control)) +(defmethod inspect ((this idle-control)) (when (not this) (set! this this) (goto cfg-4) @@ -89,7 +83,7 @@ ;; definition for method 9 of type idle-control ;; WARN: Return type mismatch idle-control vs none. -(defmethod idle-control-method-9 idle-control ((this idle-control) (arg0 (pointer idle-control-frame))) +(defmethod idle-control-method-9 ((this idle-control) (arg0 (pointer idle-control-frame))) (set! (-> this anim) arg0) (set! (-> this current) arg0) (set! (-> this counter) 0) @@ -100,7 +94,7 @@ ;; definition for method 10 of type idle-control ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 10 idle-control) has a return type of none, but the expression builder found a return statement. -(defmethod idle-control-method-10 idle-control ((this idle-control) (arg0 process-drawable)) +(defmethod idle-control-method-10 ((this idle-control) (arg0 process-drawable)) (local-vars (a1-1 int)) (when (nonzero? (-> this anim)) (let ((s5-0 self)) diff --git a/test/decompiler/reference/jak2/engine/game/main-h_REF.gc b/test/decompiler/reference/jak2/engine/game/main-h_REF.gc index a79ca61cc48..ca6dc3e4183 100644 --- a/test/decompiler/reference/jak2/engine/game/main-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/main-h_REF.gc @@ -340,16 +340,13 @@ ;; definition of type frame-stats (deftype frame-stats (structure) - ((field-time time-frame 2 :offset-assert 0) - (field int32 :offset-assert 16) + ((field-time time-frame 2) + (field int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type frame-stats -(defmethod inspect frame-stats ((this frame-stats)) +(defmethod inspect ((this frame-stats)) (when (not this) (set! this this) (goto cfg-4) @@ -366,27 +363,24 @@ ;; definition of type screen-filter (deftype screen-filter (basic) - ((draw? symbol :offset-assert 4) - (bucket bucket-id :offset-assert 8) - (color vector :inline :offset-assert 16) - (color-src vector :inline :offset-assert 32) - (color-dest vector :inline :offset-assert 48) - (extra vector :inline :offset-assert 64) - (speed float :offset 64) - (current-interp float :offset 68) + ((draw? symbol) + (bucket bucket-id) + (color vector :inline) + (color-src vector :inline) + (color-dest vector :inline) + (extra vector :inline) + (speed float :overlay-at (-> extra data 0)) + (current-interp float :overlay-at (-> extra data 1)) ) - :method-count-assert 12 - :size-assert #x50 - :flag-assert #xc00000050 (:methods - (draw (_type_) none 9) - (setup (_type_ vector vector float bucket-id) none 10) - (disable (_type_) none 11) + (draw (_type_) none) + (setup (_type_ vector vector float bucket-id) none) + (disable (_type_) none) ) ) ;; definition for method 3 of type screen-filter -(defmethod inspect screen-filter ((this screen-filter)) +(defmethod inspect ((this screen-filter)) (when (not this) (set! this this) (goto cfg-4) @@ -406,28 +400,25 @@ ;; definition of type col-rend (deftype col-rend (basic) - ((draw? symbol :offset-assert 4) - (outline? symbol :offset-assert 8) - (show-back-faces? symbol :offset-assert 12) - (show-normals? symbol :offset-assert 16) - (ghost-hidden? symbol :offset-assert 20) - (show-only uint32 :offset-assert 24) - (cspec collide-spec :offset-assert 28) - (track uint8 :offset-assert 32) - (bbox-radius float :offset-assert 36) - (bbox-center vector :inline :offset-assert 48) - (camera-to-bbox-dist float :offset-assert 64) + ((draw? symbol) + (outline? symbol) + (show-back-faces? symbol) + (show-normals? symbol) + (ghost-hidden? symbol) + (show-only uint32) + (cspec collide-spec) + (track uint8) + (bbox-radius float) + (bbox-center vector :inline) + (camera-to-bbox-dist float) ) - :method-count-assert 10 - :size-assert #x44 - :flag-assert #xa00000044 (:methods - (col-rend-method-9 (_type_) none 9) + (col-rend-method-9 (_type_) none) ) ) ;; definition for method 3 of type col-rend -(defmethod inspect col-rend ((this col-rend)) +(defmethod inspect ((this col-rend)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/game/main_REF.gc b/test/decompiler/reference/jak2/engine/game/main_REF.gc index a61be7c2968..ef375bed150 100644 --- a/test/decompiler/reference/jak2/engine/game/main_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/main_REF.gc @@ -259,7 +259,7 @@ ;; definition for method 9 of type screen-filter ;; WARN: Return type mismatch int vs none. -(defmethod draw screen-filter ((this screen-filter)) +(defmethod draw ((this screen-filter)) (local-vars (v1-1 float)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -307,7 +307,7 @@ ;; definition for method 10 of type screen-filter ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod setup screen-filter ((this screen-filter) (arg0 vector) (arg1 vector) (arg2 float) (arg3 bucket-id)) +(defmethod setup ((this screen-filter) (arg0 vector) (arg1 vector) (arg2 float) (arg3 bucket-id)) (set! (-> this draw?) #t) (set! (-> this color quad) (-> arg0 quad)) (set! (-> this color-src quad) (-> arg0 quad)) @@ -321,7 +321,7 @@ ;; definition for method 11 of type screen-filter ;; WARN: Return type mismatch int vs none. -(defmethod disable screen-filter ((this screen-filter)) +(defmethod disable ((this screen-filter)) (set! (-> this draw?) #f) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/game/pilot-h_REF.gc b/test/decompiler/reference/jak2/engine/game/pilot-h_REF.gc index 6fea883c292..c8793ee532e 100644 --- a/test/decompiler/reference/jak2/engine/game/pilot-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/pilot-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type vehicle-controls (deftype vehicle-controls (structure) - ((steering float :offset-assert 0) - (throttle float :offset-assert 4) - (brake float :offset-assert 8) - (lean-z float :offset-assert 12) + ((steering float) + (throttle float) + (brake float) + (lean-z float) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vehicle-controls -(defmethod inspect vehicle-controls ((this vehicle-controls)) +(defmethod inspect ((this vehicle-controls)) (when (not this) (set! this this) (goto cfg-4) @@ -31,37 +28,34 @@ ;; definition of type pilot-info (deftype pilot-info (basic) - ((entity basic :offset-assert 4) - (vehicle handle :offset-assert 8) - (left-right-interp float :offset-assert 16) - (front-back-interp float :offset-assert 20) - (up-down-interp float :offset-assert 24) - (up-down-accel-factor float :offset-assert 28) - (front-back-accel-factor float :offset-assert 32) - (left-right-accel-factor float :offset-assert 36) - (stance uint8 :offset-assert 40) - (seat-index int8 :offset-assert 41) - (backup-nav-radius float :offset-assert 44) - (cam-side-shift float :offset-assert 48) - (enable-cam-side-shift symbol :offset-assert 52) - (gun? symbol :offset-assert 56) - (controls vehicle-controls :inline :offset-assert 60) - (accel-array vector 8 :inline :offset-assert 80) - (local-accel vector :inline :offset-assert 208) - (pilot-trans vector :inline :offset-assert 224) - (pilot-quat vector :inline :offset-assert 240) - (pilot-scale vector :inline :offset-assert 256) - (pilot-time time-frame :offset-assert 272) - (as-daxter? symbol :offset-assert 280) - (art-group-backup basic :offset-assert 284) + ((entity basic) + (vehicle handle) + (left-right-interp float) + (front-back-interp float) + (up-down-interp float) + (up-down-accel-factor float) + (front-back-accel-factor float) + (left-right-accel-factor float) + (stance uint8) + (seat-index int8) + (backup-nav-radius float) + (cam-side-shift float) + (enable-cam-side-shift symbol) + (gun? symbol) + (controls vehicle-controls :inline) + (accel-array vector 8 :inline) + (local-accel vector :inline) + (pilot-trans vector :inline) + (pilot-quat vector :inline) + (pilot-scale vector :inline) + (pilot-time time-frame) + (as-daxter? symbol) + (art-group-backup basic) ) - :method-count-assert 9 - :size-assert #x120 - :flag-assert #x900000120 ) ;; definition for method 3 of type pilot-info -(defmethod inspect pilot-info ((this pilot-info)) +(defmethod inspect ((this pilot-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc b/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc index 935da91de53..382b8195876 100644 --- a/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc @@ -3,115 +3,112 @@ ;; definition of type user-setting-data (deftype user-setting-data (structure) - ((border-mode symbol :offset-assert 0) - (process-mask process-mask :offset-assert 4) - (unknown-int32-00 int32 :offset-assert 8) - (language language-enum :offset 16) - (display-dx int32 :offset-assert 24) - (display-dy int32 :offset-assert 28) - (vibration symbol :offset 32) - (play-hints symbol :offset 36) - (movie (pointer process) :offset 40) - (talking (pointer process) :offset-assert 44) - (spooling (pointer process) :offset-assert 48) - (hint (pointer process) :offset-assert 52) - (ambient (pointer process) :offset-assert 56) - (video-mode symbol :offset-assert 60) - (aspect-ratio symbol :offset-assert 64) - (use-progressive-scan symbol :offset 68) - (auto-save symbol :offset 72) - (bg-r float :offset-assert 76) - (bg-g float :offset-assert 80) - (bg-b float :offset-assert 84) - (bg-a float :offset-assert 88) - (bg-a-speed float :offset-assert 92) - (bg-a-force float :offset-assert 96) - (allow-progress symbol :offset-assert 100) - (allow-pause symbol :offset-assert 104) - (ocean-off symbol :offset-assert 108) - (allow-look-around symbol :offset-assert 112) - (camera-stick-dir symbol :offset-assert 116) - (movie-name symbol :offset 120) - (weather symbol :offset-assert 124) - (mouse symbol :offset-assert 128) - (cursor symbol :offset-assert 132) - (task-mask task-mask :offset 136) - (region-mode symbol :offset-assert 140) - (duck symbol :offset 144) - (attack symbol :offset-assert 148) - (gun symbol :offset-assert 152) - (board symbol :offset-assert 156) - (jump symbol :offset-assert 160) - (speed-mult float :offset-assert 164) - (features game-feature :offset-assert 168) - (sfx-volume float :offset-assert 176) - (sfx-movie-volume float :offset-assert 180) - (music-volume float :offset-assert 184) - (music-volume-movie float :offset-assert 188) - (dialog-volume float :offset-assert 192) - (dialog-volume-hint float :offset-assert 196) - (ambient-volume float :offset-assert 200) - (ambient-volume-move float :offset-assert 204) - (sound-flava uint8 :offset-assert 208) - (sound-flava-priority float :offset-assert 212) - (mode-sound-bank uint32 :offset-assert 216) - (sound-excitement float :offset-assert 220) - (sound-reverb float :offset-assert 224) - (stereo-mode int32 :offset-assert 228) - (music symbol :offset-assert 232) - (sound-stinger int32 :offset-assert 236) - (spool-anim spool-anim :offset-assert 240) - (sound-mode uint32 :offset-assert 244) - (task-manager (pointer process) :offset-assert 248) - (task symbol :offset-assert 252) - (airlock symbol :offset-assert 256) - (minimap uint16 :offset-assert 260) - (sound-tune uint32 :offset-assert 264) - (allow-continue symbol :offset-assert 268) - (spotlight-color rgba :offset-assert 272) - (subtitle symbol :offset-assert 276) - (borrow pair :offset-assert 280) - (doorway symbol :offset-assert 284) - (gem symbol :offset-assert 288) - (half-speed symbol :offset-assert 292) - (gun-buoy symbol :offset-assert 296) - (double-jump symbol :offset-assert 300) - (pilot symbol :offset-assert 304) - (pilot-exit symbol :offset-assert 308) - (exclusive-task int32 :offset-assert 312) - (speech-control symbol :offset-assert 316) - (vehicle-hijacking symbol :offset-assert 320) - (darkjak symbol :offset-assert 324) - (endlessfall symbol :offset-assert 328) - (rain float :offset-assert 332) - (snow float :offset-assert 336) - (exclusive-load symbol :offset-assert 340) - (render symbol :offset-assert 344) - (allow-timeout symbol :offset-assert 348) - (mirror symbol :offset-assert 352) - (movie-skip-frame float :offset-assert 356) - (allow-blackout symbol :offset-assert 360) - (race-minimap int32 :offset-assert 364) - (extra-bank pair :offset-assert 368) - (beard symbol :offset-assert 372) - (ignore-target symbol :offset-assert 376) - (subtitle-language language-enum :offset-assert 384) - (sound-bank-load symbol :offset-assert 392) - (allow-error symbol :offset-assert 396) - (under-water-pitch-mod float :offset-assert 400) - (dummy object 31 :offset-assert 404) + ((border-mode symbol) + (process-mask process-mask) + (unknown-int32-00 int32) + (language language-enum :offset 16) + (display-dx int32) + (display-dy int32) + (vibration symbol :offset 32) + (play-hints symbol :offset 36) + (movie (pointer process) :offset 40) + (talking (pointer process)) + (spooling (pointer process)) + (hint (pointer process)) + (ambient (pointer process)) + (video-mode symbol) + (aspect-ratio symbol) + (use-progressive-scan symbol :offset 68) + (auto-save symbol :offset 72) + (bg-r float) + (bg-g float) + (bg-b float) + (bg-a float) + (bg-a-speed float) + (bg-a-force float) + (allow-progress symbol) + (allow-pause symbol) + (ocean-off symbol) + (allow-look-around symbol) + (camera-stick-dir symbol) + (movie-name symbol :offset 120) + (weather symbol) + (mouse symbol) + (cursor symbol) + (task-mask task-mask :offset 136) + (region-mode symbol) + (duck symbol :offset 144) + (attack symbol) + (gun symbol) + (board symbol) + (jump symbol) + (speed-mult float) + (features game-feature) + (sfx-volume float) + (sfx-movie-volume float) + (music-volume float) + (music-volume-movie float) + (dialog-volume float) + (dialog-volume-hint float) + (ambient-volume float) + (ambient-volume-move float) + (sound-flava uint8) + (sound-flava-priority float) + (mode-sound-bank uint32) + (sound-excitement float) + (sound-reverb float) + (stereo-mode int32) + (music symbol) + (sound-stinger int32) + (spool-anim spool-anim) + (sound-mode uint32) + (task-manager (pointer process)) + (task symbol) + (airlock symbol) + (minimap uint16) + (sound-tune uint32) + (allow-continue symbol) + (spotlight-color rgba) + (subtitle symbol) + (borrow pair) + (doorway symbol) + (gem symbol) + (half-speed symbol) + (gun-buoy symbol) + (double-jump symbol) + (pilot symbol) + (pilot-exit symbol) + (exclusive-task int32) + (speech-control symbol) + (vehicle-hijacking symbol) + (darkjak symbol) + (endlessfall symbol) + (rain float) + (snow float) + (exclusive-load symbol) + (render symbol) + (allow-timeout symbol) + (mirror symbol) + (movie-skip-frame float) + (allow-blackout symbol) + (race-minimap int32) + (extra-bank pair) + (beard symbol) + (ignore-target symbol) + (subtitle-language language-enum) + (sound-bank-load symbol) + (allow-error symbol) + (under-water-pitch-mod float) + (dummy object 31) ) - :method-count-assert 11 - :size-assert #x210 - :flag-assert #xb00000210 (:methods - (user-setting-data-method-9 (_type_ engine engine-pers engine) user-setting-data 9) - (user-setting-data-method-10 (_type_ object symbol float uint) user-setting-data 10) + (user-setting-data-method-9 (_type_ engine engine-pers engine) user-setting-data) + (user-setting-data-method-10 (_type_ object symbol float uint) user-setting-data) ) ) ;; definition for method 3 of type user-setting-data -(defmethod inspect user-setting-data ((this user-setting-data)) +(defmethod inspect ((this user-setting-data)) (when (not this) (set! this this) (goto cfg-71) @@ -304,72 +301,69 @@ ;; definition of type cam-setting-data (deftype cam-setting-data (structure) - ((fov degrees :offset-assert 0) - (pov-handle handle :offset 16) - (pov-bone int32 :offset-assert 24) - (pov-offset vector :inline :offset-assert 32) - (string-default symbol :offset-assert 48) - (string-max-length meters :offset-assert 52) - (string-min-length meters :offset-assert 56) - (string-max-height meters :offset-assert 60) - (string-min-height meters :offset-assert 64) - (string-cliff-height meters :offset-assert 68) - (string-camera-ceiling meters :offset-assert 72) - (gun-max-height meters :offset-assert 76) - (gun-min-height meters :offset-assert 80) - (string-local-down vector :inline :offset-assert 96) - (slave-options cam-slave-options :offset-assert 112) - (matrix-blend-max-angle degrees :offset-assert 120) - (matrix-blend-max-partial float :offset-assert 124) - (string-spline-max-move meters :offset-assert 128) - (string-spline-accel meters :offset-assert 132) - (string-spline-max-move-player meters :offset-assert 136) - (string-spline-accel-player meters :offset-assert 140) - (string-startup-vector vector :inline :offset-assert 144) - (string-use-startup-vector symbol :offset-assert 160) - (look-at-point vector :inline :offset-assert 176) - (use-look-at-point symbol :offset-assert 192) - (target-height meters :offset-assert 196) - (foot-offset meters :offset-assert 200) - (head-offset meters :offset-assert 204) - (teleport-on-entity-change symbol :offset-assert 208) - (entity-name string :offset-assert 212) - (entity-or-mode-changed symbol :offset-assert 216) - (master-options cam-master-options :offset-assert 224) - (entity-mask uint32 :offset-assert 232) - (mode-name symbol :offset-assert 236) - (real-entity-name string :offset-assert 240) - (cam-mode symbol :offset-assert 244) - (interp-time uint32 :offset-assert 248) - (no-intro symbol :offset-assert 252) - (use-point-of-interest symbol :offset-assert 256) - (point-of-interest vector :inline :offset-assert 272) - (handle-of-interest handle :offset-assert 288) - (mouse-tumble-point vector :inline :offset-assert 304) - (use-mouse-tumble-point symbol :offset-assert 320) - (mouse-input symbol :offset-assert 324) - (cpad1-skip-buttons symbol :offset-assert 328) - (butt-handle handle :offset-assert 336) - (butt-angle float :offset-assert 344) - (extra-follow-height float :offset-assert 348) - (interp-time-priority uint32 :offset-assert 352) - (string-max-length-default symbol :offset-assert 356) - (string-min-length-default symbol :offset-assert 360) - (string-max-height-default symbol :offset-assert 364) - (string-min-height-default symbol :offset-assert 368) - (dummy object 102 :offset-assert 372) + ((fov degrees) + (pov-handle handle :offset 16) + (pov-bone int32) + (pov-offset vector :inline) + (string-default symbol) + (string-max-length meters) + (string-min-length meters) + (string-max-height meters) + (string-min-height meters) + (string-cliff-height meters) + (string-camera-ceiling meters) + (gun-max-height meters) + (gun-min-height meters) + (string-local-down vector :inline) + (slave-options cam-slave-options) + (matrix-blend-max-angle degrees) + (matrix-blend-max-partial float) + (string-spline-max-move meters) + (string-spline-accel meters) + (string-spline-max-move-player meters) + (string-spline-accel-player meters) + (string-startup-vector vector :inline) + (string-use-startup-vector symbol) + (look-at-point vector :inline) + (use-look-at-point symbol) + (target-height meters) + (foot-offset meters) + (head-offset meters) + (teleport-on-entity-change symbol) + (entity-name string) + (entity-or-mode-changed symbol) + (master-options cam-master-options) + (entity-mask uint32) + (mode-name symbol) + (real-entity-name string) + (cam-mode symbol) + (interp-time uint32) + (no-intro symbol) + (use-point-of-interest symbol) + (point-of-interest vector :inline) + (handle-of-interest handle) + (mouse-tumble-point vector :inline) + (use-mouse-tumble-point symbol) + (mouse-input symbol) + (cpad1-skip-buttons symbol) + (butt-handle handle) + (butt-angle float) + (extra-follow-height float) + (interp-time-priority uint32) + (string-max-length-default symbol) + (string-min-length-default symbol) + (string-max-height-default symbol) + (string-min-height-default symbol) + (dummy object 102) ) - :method-count-assert 11 - :size-assert #x30c - :flag-assert #xb0000030c (:methods - (cam-setting-data-method-9 (_type_ engine engine-pers engine) _type_ 9) - (cam-setting-data-method-10 (_type_ object (pointer process) float int) _type_ 10) + (cam-setting-data-method-9 (_type_ engine engine-pers engine) _type_) + (cam-setting-data-method-10 (_type_ object (pointer process) float int) _type_) ) ) ;; definition for method 3 of type cam-setting-data -(defmethod inspect cam-setting-data ((this cam-setting-data)) +(defmethod inspect ((this cam-setting-data)) (when (not this) (set! this this) (goto cfg-68) @@ -539,41 +533,38 @@ ;; definition of type setting-control (deftype setting-control (basic) - ((user-current user-setting-data :inline :offset-assert 16) - (user-target user-setting-data :inline :offset-assert 544) - (user-default user-setting-data :inline :offset-assert 1072) - (cam-current cam-setting-data :inline :offset-assert 1600) - (cam-target cam-setting-data :inline :offset-assert 2384) - (cam-default cam-setting-data :inline :offset-assert 3168) - (engine engine :offset-assert 3948) - (engine-pers engine-pers :offset-assert 3952) - (engine-hi engine :offset-assert 3956) - (sound-stinger-time time-frame :offset-assert 3960) - (sound-stinger-change-time time-frame 4 :offset-assert 3968) - (sound-excitement-change-time time-frame :offset-assert 4000) - (sound-excitement-targ float :offset-assert 4008) - (sound-excitement-level uint32 :offset-assert 4012) + ((user-current user-setting-data :inline) + (user-target user-setting-data :inline) + (user-default user-setting-data :inline) + (cam-current cam-setting-data :inline) + (cam-target cam-setting-data :inline) + (cam-default cam-setting-data :inline) + (engine engine) + (engine-pers engine-pers) + (engine-hi engine) + (sound-stinger-time time-frame) + (sound-stinger-change-time time-frame 4) + (sound-excitement-change-time time-frame) + (sound-excitement-targ float) + (sound-excitement-level uint32) ) - :method-count-assert 19 - :size-assert #xfb0 - :flag-assert #x1300000fb0 (:methods - (new (symbol type int) _type_ 0) - (add-setting (_type_ process symbol object object object) none 9) - (persist-with-delay (_type_ symbol time-frame symbol symbol float int) none 10) - (set-setting (_type_ process symbol object object object) none 11) - (remove-setting (_type_ process symbol) none 12) - (kill-persister (_type_ engine-pers object) none 13) - (setting-control-method-14 (_type_ object) connectable 14) - (remove-setting-by-arg0 (_type_ object) none 15) - (set-setting-by-param (_type_ symbol object object object) connection 16) - (apply-settings (_type_) user-setting-data 17) - (update (_type_) user-setting-data 18) + (new (symbol type int) _type_) + (add-setting (_type_ process symbol object object object) none) + (persist-with-delay (_type_ symbol time-frame symbol symbol float int) none) + (set-setting (_type_ process symbol object object object) none) + (remove-setting (_type_ process symbol) none) + (kill-persister (_type_ engine-pers object) none) + (setting-control-method-14 (_type_ object) connectable) + (remove-setting-by-arg0 (_type_ object) none) + (set-setting-by-param (_type_ symbol object object object) connection) + (apply-settings (_type_) user-setting-data) + (update (_type_) user-setting-data) ) ) ;; definition for method 3 of type setting-control -(defmethod inspect setting-control ((this setting-control)) +(defmethod inspect ((this setting-control)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/game/settings_REF.gc b/test/decompiler/reference/jak2/engine/game/settings_REF.gc index 80787ca38b8..208e47e34d0 100644 --- a/test/decompiler/reference/jak2/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/settings_REF.gc @@ -8,7 +8,7 @@ ) ;; definition for method 9 of type user-setting-data -(defmethod user-setting-data-method-9 user-setting-data ((this user-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) +(defmethod user-setting-data-method-9 ((this user-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) (let ((s3-0 (-> arg1 alive-list))) (while s3-0 (user-setting-data-method-10 @@ -74,7 +74,7 @@ ) ;; definition for method 10 of type user-setting-data -(defmethod user-setting-data-method-10 user-setting-data ((this user-setting-data) (arg0 object) (arg1 symbol) (arg2 float) (arg3 uint)) +(defmethod user-setting-data-method-10 ((this user-setting-data) (arg0 object) (arg1 symbol) (arg2 float) (arg3 uint)) "set-defaults! perhaps?" (case arg0 (('border-mode) @@ -477,7 +477,7 @@ ) ;; definition for method 9 of type cam-setting-data -(defmethod cam-setting-data-method-9 cam-setting-data ((this cam-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) +(defmethod cam-setting-data-method-9 ((this cam-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) (let ((s3-0 (-> arg1 alive-list))) (while s3-0 (cam-setting-data-method-10 @@ -544,7 +544,7 @@ ;; definition for method 10 of type cam-setting-data ;; INFO: Used lq/sq -(defmethod cam-setting-data-method-10 cam-setting-data ((this cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 float) (arg3 int)) +(defmethod cam-setting-data-method-10 ((this cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 float) (arg3 int)) (case arg0 (('fov) (if (= arg1 'rel) @@ -802,7 +802,7 @@ ;; definition for method 9 of type setting-control ;; WARN: Return type mismatch int vs none. -(defmethod add-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) +(defmethod add-setting ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) "Originally called `setting-set` see (anon-function 48 script)" (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 @@ -811,7 +811,7 @@ ;; definition for method 11 of type setting-control ;; WARN: Return type mismatch int vs none. -(defmethod set-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) +(defmethod set-setting ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) (remove-setting this arg0 arg1) (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 @@ -820,7 +820,7 @@ ;; definition for method 10 of type setting-control ;; WARN: Return type mismatch int vs none. -(defmethod persist-with-delay setting-control ((this setting-control) (arg0 symbol) (arg1 time-frame) (arg2 symbol) (arg3 symbol) (arg4 float) (arg5 int)) +(defmethod persist-with-delay ((this setting-control) (arg0 symbol) (arg1 time-frame) (arg2 symbol) (arg3 symbol) (arg4 float) (arg5 int)) "Originally called `setting-pers` see (anon-function 46 script)" (let ((v1-1 (schedule-callback (-> this engine-pers) arg0 arg1))) (when v1-1 @@ -836,7 +836,7 @@ ;; definition for method 12 of type setting-control ;; WARN: Return type mismatch int vs none. -(defmethod remove-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol)) +(defmethod remove-setting ((this setting-control) (arg0 process) (arg1 symbol)) (when arg0 (let ((s5-0 (-> this engine)) (s4-0 (-> arg0 connection-list next1)) @@ -857,7 +857,7 @@ ;; definition for method 13 of type setting-control ;; WARN: Return type mismatch int vs none. -(defmethod kill-persister setting-control ((this setting-control) (arg0 engine-pers) (arg1 object)) +(defmethod kill-persister ((this setting-control) (arg0 engine-pers) (arg1 object)) "Calls [[engine-pers::kill-matching]]" (kill-matching (-> this engine-pers) @@ -872,7 +872,7 @@ ) ;; definition for method 14 of type setting-control -(defmethod setting-control-method-14 setting-control ((this setting-control) (arg0 object)) +(defmethod setting-control-method-14 ((this setting-control) (arg0 object)) (let ((v1-1 (-> this engine-hi alive-list next0))) (-> this engine-hi) (let ((a2-2 (-> v1-1 next0))) @@ -891,7 +891,7 @@ ;; definition for method 15 of type setting-control ;; WARN: Return type mismatch int vs none. -(defmethod remove-setting-by-arg0 setting-control ((this setting-control) (arg0 object)) +(defmethod remove-setting-by-arg0 ((this setting-control) (arg0 object)) "Calls [[engine::remove-by-param0]] on `engine-hi`" (remove-by-param0 (-> this engine-hi) arg0) 0 @@ -899,14 +899,14 @@ ) ;; definition for method 16 of type setting-control -(defmethod set-setting-by-param setting-control ((this setting-control) (arg0 symbol) (arg1 object) (arg2 object) (arg3 object)) +(defmethod set-setting-by-param ((this setting-control) (arg0 symbol) (arg1 object) (arg2 object) (arg3 object)) "Same as [[setting-control::set-setting]] but will [[engine::remove-by-param0]] using the symbol provided" (remove-by-param0 (-> this engine-hi) arg0) (add-connection (-> this engine-hi) *dproc* arg0 arg1 arg2 arg3) ) ;; definition for method 17 of type setting-control -(defmethod apply-settings setting-control ((this setting-control)) +(defmethod apply-settings ((this setting-control)) (speech-control-method-11 *speech-control*) (let ((s5-0 (-> this user-current))) (let ((s4-0 (-> this user-target))) @@ -1066,7 +1066,7 @@ ;; definition for method 18 of type setting-control ;; INFO: Used lq/sq -(defmethod update setting-control ((this setting-control)) +(defmethod update ((this setting-control)) (local-vars (v1-41 symbol)) (run-pending-updates! (-> this engine-pers) (-> *display* base-clock frame-counter)) (apply-settings this) diff --git a/test/decompiler/reference/jak2/engine/game/task/task-arrow_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-arrow_REF.gc index 9e0f1fb1d83..4b024ba223d 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-arrow_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-arrow_REF.gc @@ -10,18 +10,15 @@ ;; definition of type task-arrow-params (deftype task-arrow-params (structure) - ((flags task-arrow-flags :offset-assert 0) - (map-icon uint16 :offset-assert 4) - (pos vector :inline :offset-assert 16) - (quat quaternion :inline :offset-assert 32) + ((flags task-arrow-flags) + (map-icon uint16) + (pos vector :inline) + (quat quaternion :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type task-arrow-params -(defmethod inspect task-arrow-params ((this task-arrow-params)) +(defmethod inspect ((this task-arrow-params)) (when (not this) (set! this this) (goto cfg-4) @@ -40,35 +37,33 @@ "Despite the name, these are actually the beams of light that highlight various objections. Such as the flag in the first ruins mission or collectable items on the ground (jetboard / weapon upgrades / etc)" - ((pos vector :inline :offset-assert 208) - (theta float :offset-assert 224) - (phi float :offset-assert 228) - (dist float :offset-assert 232) - (smoothed-dist float :offset-assert 236) - (max-dist float :offset-assert 240) - (flags task-arrow-flags :offset-assert 244) - (map-icon uint16 :offset-assert 248) - (minimap connection-minimap :offset-assert 252) - (hud-dist handle :offset-assert 256) - (base-quat quaternion :inline :offset-assert 272) - (rod-of-god-scale float :offset-assert 288) - (moving symbol :offset-assert 292) + ((pos vector :inline) + (theta float) + (phi float) + (dist float) + (smoothed-dist float) + (max-dist float) + (flags task-arrow-flags) + (map-icon uint16) + (minimap connection-minimap) + (hud-dist handle) + (base-quat quaternion :inline) + (rod-of-god-scale float) + (moving symbol) ) - :heap-base #xb0 - :method-count-assert 25 - :size-assert #x128 - :flag-assert #x1900b00128 + (:state-methods + idle + die + leave + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (leave () _type_ :state 22) - (task-arrow-method-23 (_type_ vector) none 23) - (draw-arrow (_type_) none :behavior task-arrow 24) + (task-arrow-method-23 (_type_ vector) none) + (draw-arrow (_type_) none :behavior task-arrow) ) ) ;; definition for method 3 of type task-arrow -(defmethod inspect task-arrow ((this task-arrow)) +(defmethod inspect ((this task-arrow)) (when (not this) (set! this this) (goto cfg-4) @@ -95,7 +90,7 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" ;; definition for method 10 of type task-arrow ;; WARN: Return type mismatch int vs none. -(defmethod deactivate task-arrow ((this task-arrow)) +(defmethod deactivate ((this task-arrow)) (send-event (handle->process (-> this hud-dist)) 'hide-and-die) ((method-of-type process-drawable deactivate) this) 0 @@ -105,7 +100,7 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" ;; definition for method 23 of type task-arrow ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod task-arrow-method-23 task-arrow ((this task-arrow) (arg0 vector)) +(defmethod task-arrow-method-23 ((this task-arrow) (arg0 vector)) "Some weird debugging code left here, but checks for collisions on the arrow" (let ((s5-0 (new 'stack-no-clear 'collide-query-with-vec))) (set! (-> s5-0 vec quad) (-> arg0 quad)) @@ -134,7 +129,7 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" ;; definition for method 24 of type task-arrow ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-arrow task-arrow ((this task-arrow)) +(defmethod draw-arrow ((this task-arrow)) (cond ((logtest? (-> this flags) (task-arrow-flags task-arrow-flag-00)) (if (and (not (handle->process (-> this hud-dist))) *target*) diff --git a/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc index 3978b9fd93e..2a64f13851c 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc @@ -935,21 +935,18 @@ ;; definition of type game-task-event (deftype game-task-event (basic) - ((actor game-task-actor :offset-assert 4) - (action game-task-action :offset-assert 5) - (tex game-task-icon :offset-assert 6) - (icon uint16 :offset 6) - (flags game-task-flags :offset 7) - (scene basic :offset 8) - (distance meters :offset-assert 12) + ((actor game-task-actor) + (action game-task-action) + (tex game-task-icon) + (icon uint16 :overlay-at tex) + (flags game-task-flags :offset 7) + (scene basic :offset 8) + (distance meters) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type game-task-event -(defmethod inspect game-task-event ((this game-task-event)) +(defmethod inspect ((this game-task-event)) (when (not this) (set! this this) (goto cfg-4) @@ -967,42 +964,39 @@ ;; definition of type task-manager-info (deftype task-manager-info (structure) - ((mask task-manager-mask :offset-assert 0) - (level symbol :offset-assert 4) - (manager handle :offset-assert 8) - (fail-message text-id :offset-assert 16) - (retry-message text-id :offset-assert 20) - (intro-scene string :offset-assert 24) - (resolution-scene string :offset-assert 28) - (resolution-scene-continue string :offset-assert 32) - (retry-continue string :offset-assert 36) - (fail-continue string :offset-assert 40) - (init-hook (function object) :offset-assert 44) - (cleanup-hook (function object) :offset-assert 48) - (update-hook (function object) :offset-assert 52) - (code-hook (function object) :offset-assert 56) - (complete-hook (function object) :offset-assert 60) - (fail-hook (function object) :offset-assert 64) - (event-hook (function process int symbol event-message-block object) :offset-assert 68) - (hooks function 7 :offset 44) - (final-node game-task-node :offset-assert 72) - (time-limit int32 :offset-assert 76) - (sphere-count int8 :offset-assert 80) - (index int8 :offset-assert 81) - (intro-delay uint16 :offset-assert 82) - (sphere-array uint32 :offset-assert 84) - (on-complete pair :offset-assert 88) - (on-fail pair :offset-assert 92) - (begin-sphere sphere :inline :offset-assert 96) - (end-sphere sphere :inline :offset-assert 112) + ((mask task-manager-mask) + (level symbol) + (manager handle) + (fail-message text-id) + (retry-message text-id) + (intro-scene string) + (resolution-scene string) + (resolution-scene-continue string) + (retry-continue string) + (fail-continue string) + (init-hook (function object)) + (cleanup-hook (function object)) + (update-hook (function object)) + (code-hook (function object)) + (complete-hook (function object)) + (fail-hook (function object)) + (event-hook (function process int symbol event-message-block object)) + (hooks function 7 :overlay-at init-hook) + (final-node game-task-node) + (time-limit int32) + (sphere-count int8) + (index int8) + (intro-delay uint16) + (sphere-array uint32) + (on-complete pair) + (on-fail pair) + (begin-sphere sphere :inline) + (end-sphere sphere :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type task-manager-info -(defmethod inspect task-manager-info ((this task-manager-info)) +(defmethod inspect ((this task-manager-info)) (when (not this) (set! this this) (goto cfg-16) @@ -1204,40 +1198,37 @@ ;; definition of type game-task-node-info (deftype game-task-node-info (basic) - ((level symbol :offset-assert 4) - (task game-task :offset-assert 8) - (name string :offset-assert 12) - (when-open (array game-task-event) :offset-assert 16) - (flags game-task-node-flag :offset-assert 20) - (parent-node game-task-node 4 :offset-assert 24) - (task-mask task-mask :offset-assert 32) - (on-open pair :offset-assert 36) - (info task-manager-info :offset-assert 40) - (borrow pair :offset-assert 44) - (open? (function game-task-node-info symbol) :offset-assert 48) - (on-close pair :offset-assert 52) - (close-time time-frame :offset-assert 56) - (death-count uint16 :offset-assert 64) - (gem-count uint16 :offset-assert 66) - (skill-count uint16 :offset-assert 68) - (suck-death-count uint8 :offset-assert 70) - (add game-task-node-command :offset-assert 71) - (description text-id :offset-assert 72) + ((level symbol) + (task game-task) + (name string) + (when-open (array game-task-event)) + (flags game-task-node-flag) + (parent-node game-task-node 4) + (task-mask task-mask) + (on-open pair) + (info task-manager-info) + (borrow pair) + (open? (function game-task-node-info symbol)) + (on-close pair) + (close-time time-frame) + (death-count uint16) + (gem-count uint16) + (skill-count uint16) + (suck-death-count uint8) + (add game-task-node-command) + (description text-id) ) - :method-count-assert 14 - :size-assert #x4c - :flag-assert #xe0000004c (:methods - (close! (_type_ symbol) int 9) - (open! (_type_ symbol) int 10) - (open? (_type_) symbol 11) - (copy-hooks! (_type_ game-task-node-info) game-task-node-info 12) - (eval-add (_type_) int 13) + (close! (_type_ symbol) int) + (open! (_type_ symbol) int) + (open? (_type_) symbol) + (copy-hooks! (_type_ game-task-node-info) game-task-node-info) + (eval-add (_type_) int) ) ) ;; definition for method 3 of type game-task-node-info -(defmethod inspect game-task-node-info ((this game-task-node-info)) +(defmethod inspect ((this game-task-node-info)) (when (not this) (set! this this) (goto cfg-45) @@ -1333,22 +1324,19 @@ ;; definition of type game-task-info (deftype game-task-info (basic) - ((name string :offset-assert 4) - (text-name text-id :offset-assert 8) - (pre-play-node game-task-node :offset-assert 12) - (kiosk-play-node game-task-node :offset-assert 14) - (pre-play-continue string :offset-assert 16) - (play-node game-task-node :offset-assert 20) - (play-continue string :offset-assert 24) - (kiosk-play-continue string :offset-assert 28) + ((name string) + (text-name text-id) + (pre-play-node game-task-node) + (kiosk-play-node game-task-node) + (pre-play-continue string) + (play-node game-task-node) + (play-continue string) + (kiosk-play-continue string) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type game-task-info -(defmethod inspect game-task-info ((this game-task-info)) +(defmethod inspect ((this game-task-info)) (when (not this) (set! this this) (goto cfg-4) @@ -1368,22 +1356,19 @@ ;; definition of type game-task-control (deftype game-task-control (basic) - ((counter uint32 :offset-assert 4) - (actor game-task-actor :offset-assert 8) - (current-node game-task-node :offset-assert 10) - (current-event game-task-event :offset-assert 12) + ((counter uint32) + (actor game-task-actor) + (current-node game-task-node) + (current-event game-task-event) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (new (symbol type game-task-actor) _type_ 0) - (get-current-task-event (_type_) game-task-event 9) + (new (symbol type game-task-actor) _type_) + (get-current-task-event (_type_) game-task-event) ) ) ;; definition for method 3 of type game-task-control -(defmethod inspect game-task-control ((this game-task-control)) +(defmethod inspect ((this game-task-control)) (when (not this) (set! this this) (goto cfg-4) @@ -1399,57 +1384,55 @@ ;; definition of type task-manager (deftype task-manager (process) - ((node-info game-task-node-info :offset-assert 128) - (info task-manager-info :offset-assert 132) - (lev-name symbol :offset-assert 136) - (fail-on-death? symbol :offset-assert 140) - (fail-now symbol :offset-assert 144) - (retry-now symbol :offset-assert 148) - (allow-fail symbol :offset-assert 152) - (state-time time-frame :offset-assert 160) - (count int16 :offset-assert 168) - (max-count int16 :offset-assert 170) - (sub-state uint32 :offset-assert 172) - (slave handle 32 :offset-assert 176) - (arrow handle :offset-assert 432) - (link uint32 :offset-assert 440) - (start-time time-frame :offset-assert 448) - (total-time time-frame :offset-assert 456) - (beep-time time-frame :offset-assert 464) - (time-limit time-frame :offset-assert 472) - (begin-pos vector :inline :offset-assert 480) - (end-pos vector :inline :offset-assert 496) - (data-int8 int8 32 :offset-assert 512) - (data-int32 int32 32 :offset-assert 544) - (data-float float 32 :offset-assert 672) - (data-vector vector 32 :inline :offset-assert 800) - (actor-group (pointer entity-actor) 4 :offset-assert 1312) - (minimap connection-minimap 8 :offset-assert 1328) - (hud handle 4 :offset-assert 1360) - (hud-timer handle :offset 1360) - (hud-counter handle :offset 1368) - (sound-id sound-id 4 :offset-assert 1392) - (intro-time time-frame :offset-assert 1408) + ((node-info game-task-node-info) + (info task-manager-info) + (lev-name symbol) + (fail-on-death? symbol) + (fail-now symbol) + (retry-now symbol) + (allow-fail symbol) + (state-time time-frame) + (count int16) + (max-count int16) + (sub-state uint32) + (slave handle 32) + (arrow handle) + (link uint32) + (start-time time-frame) + (total-time time-frame) + (beep-time time-frame) + (time-limit time-frame) + (begin-pos vector :inline) + (end-pos vector :inline) + (data-int8 int8 32) + (data-int32 int32 32) + (data-float float 32) + (data-vector vector 32 :inline) + (actor-group (pointer entity-actor) 4) + (minimap connection-minimap 8) + (hud handle 4) + (hud-timer handle :overlay-at (-> hud 0)) + (hud-counter handle :overlay-at (-> hud 1)) + (sound-id sound-id 4) + (intro-time time-frame) ) - :heap-base #x510 - :method-count-assert 23 - :size-assert #x588 - :flag-assert #x1705100588 + (:state-methods + wait + active + complete + fail + retry + ) (:methods - (wait () _type_ :state 14) - (active () _type_ :state 15) - (complete () _type_ :state 16) - (fail () _type_ :state 17) - (retry () _type_ :state 18) - (initialize! (_type_) int 19) - (kill-all-children (_type_) int 20) - (check-time (_type_) int 21) - (task-manager-method-22 (_type_) symbol 22) + (initialize! (_type_) int) + (kill-all-children (_type_) int) + (check-time (_type_) int) + (task-manager-method-22 (_type_) symbol) ) ) ;; definition for method 3 of type task-manager -(defmethod inspect task-manager ((this task-manager)) +(defmethod inspect ((this task-manager)) (when (not this) (set! this this) (goto cfg-4) @@ -1494,22 +1477,19 @@ ;; definition of type ambient-control (deftype ambient-control (structure) - ((last-ambient-time time-frame :offset-assert 0) - (last-ambient string :offset-assert 8) - (last-ambient-id sound-id :offset-assert 12) + ((last-ambient-time time-frame) + (last-ambient string) + (last-ambient-id sound-id) ) - :method-count-assert 12 - :size-assert #x10 - :flag-assert #xc00000010 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) + (dummy-9 () none) + (dummy-10 () none) + (dummy-11 () none) ) ) ;; definition for method 3 of type ambient-control -(defmethod inspect ambient-control ((this ambient-control)) +(defmethod inspect ((this ambient-control)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc index c9a524276bd..f780f844b46 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc @@ -3,21 +3,18 @@ ;; definition of type fail-mission-params (deftype fail-mission-params (structure) - ((message fail-mission-message :offset-assert 0) - (flags fail-mission-flags :offset-assert 1) - (retry-continue string :offset-assert 4) - (fail-continue string :offset-assert 8) - (reset-delay uint32 :offset-assert 12) - (task game-task :offset-assert 16) - (fail-message text-id :offset-assert 20) + ((message fail-mission-message) + (flags fail-mission-flags) + (retry-continue string) + (fail-continue string) + (reset-delay uint32) + (task game-task) + (fail-message text-id) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type fail-mission-params -(defmethod inspect fail-mission-params ((this fail-mission-params)) +(defmethod inspect ((this fail-mission-params)) (when (not this) (set! this this) (goto cfg-4) @@ -36,22 +33,19 @@ ;; definition of type fail-mission-control (deftype fail-mission-control (basic) - ((process handle :offset-assert 8) - (handle-init-hack pointer :offset 8) + ((process handle) + (handle-init-hack pointer :overlay-at process) ) - :method-count-assert 13 - :size-assert #x10 - :flag-assert #xd00000010 (:methods - (reset? (_type_) symbol 9) - (get-proc (_type_) fail-mission 10) - (start! (_type_ fail-mission-params) symbol 11) - (reset! (_type_) object 12) + (reset? (_type_) symbol) + (get-proc (_type_) fail-mission) + (start! (_type_ fail-mission-params) symbol) + (reset! (_type_) object) ) ) ;; definition for method 3 of type fail-mission-control -(defmethod inspect fail-mission-control ((this fail-mission-control)) +(defmethod inspect ((this fail-mission-control)) (when (not this) (set! this this) (goto cfg-4) @@ -193,7 +187,7 @@ ) ;; definition for method 22 of type level -(defmethod level-method-22 level ((this level) (arg0 symbol)) +(defmethod level-method-22 ((this level) (arg0 symbol)) (if (= arg0 'none) (return 0) ) @@ -692,7 +686,7 @@ ) ;; definition for method 2 of type game-task-node-info -(defmethod print game-task-node-info ((this game-task-node-info)) +(defmethod print ((this game-task-node-info)) (format #t "#" @@ -714,7 +708,7 @@ ) ;; definition for method 9 of type game-task-node-info -(defmethod close! game-task-node-info ((this game-task-node-info) (arg0 symbol)) +(defmethod close! ((this game-task-node-info) (arg0 symbol)) (when (not (logtest? (-> this flags) (game-task-node-flag closed))) (let ((task-node-close-func (lambda ((arg0 game-task-node-info)) @@ -819,7 +813,7 @@ ) ;; definition for method 10 of type game-task-node-info -(defmethod open! game-task-node-info ((this game-task-node-info) (arg0 symbol)) +(defmethod open! ((this game-task-node-info) (arg0 symbol)) (local-vars (v1-19 symbol)) (when (logtest? (-> this flags) (game-task-node-flag closed)) (logclear! (-> this flags) (game-task-node-flag closed)) @@ -867,7 +861,7 @@ ) ;; definition for method 11 of type game-task-node-info -(defmethod open? game-task-node-info ((this game-task-node-info)) +(defmethod open? ((this game-task-node-info)) (local-vars (a1-1 symbol)) (let ((game-nodes (-> *game-info* sub-task-list)) (node-info this) @@ -910,7 +904,7 @@ ) ;; definition for method 13 of type game-task-node-info -(defmethod eval-add game-task-node-info ((this game-task-node-info)) +(defmethod eval-add ((this game-task-node-info)) (case (-> this add) (((game-task-node-command none)) ) @@ -1063,7 +1057,7 @@ ) ;; definition for method 2 of type game-task-event -(defmethod print game-task-event ((this game-task-event)) +(defmethod print ((this game-task-event)) (let* ((t9-0 format) (a0-1 #t) (a1-0 "#") @@ -1329,7 +1323,7 @@ ) ;; definition for method 9 of type game-task-control -(defmethod get-current-task-event game-task-control ((this game-task-control)) +(defmethod get-current-task-event ((this game-task-control)) (with-pp (let ((gp-0 (new 'static 'game-task-event :scene #f))) (let ((s5-0 #f)) @@ -1401,31 +1395,29 @@ ;; definition of type fail-mission (deftype fail-mission (process) - ((message fail-mission-message :offset-assert 128) - (flags fail-mission-flags :offset-assert 129) - (retry-continue string :offset-assert 132) - (fail-continue string :offset-assert 136) - (reset-delay uint32 :offset-assert 140) - (grabbed-time time-frame :offset-assert 144) - (retry symbol :offset-assert 152) - (task game-task :offset-assert 156) - (message-id sound-id :offset-assert 160) - (fail-message text-id :offset-assert 164) - (stinger sound-id :offset-assert 168) + ((message fail-mission-message) + (flags fail-mission-flags) + (retry-continue string) + (fail-continue string) + (reset-delay uint32) + (grabbed-time time-frame) + (retry symbol) + (task game-task) + (message-id sound-id) + (fail-message text-id) + (stinger sound-id) ) - :heap-base #x30 - :method-count-assert 17 - :size-assert #xac - :flag-assert #x11003000ac + (:state-methods + idle + resetting + ) (:methods - (idle () _type_ :state 14) - (resetting () _type_ :state 15) - (print-text (_type_) float 16) + (print-text (_type_) float) ) ) ;; definition for method 3 of type fail-mission -(defmethod inspect fail-mission ((this fail-mission)) +(defmethod inspect ((this fail-mission)) (when (not this) (set! this this) (goto cfg-4) @@ -1449,12 +1441,12 @@ ) ;; definition for method 12 of type fail-mission -(defmethod run-logic? fail-mission ((this fail-mission)) +(defmethod run-logic? ((this fail-mission)) #t ) ;; definition for method 16 of type fail-mission -(defmethod print-text fail-mission ((this fail-mission)) +(defmethod print-text ((this fail-mission)) (when (and (not (logtest? (-> this flags) (fail-mission-flags famflags-6))) (= (get-status *gui-control* (-> this message-id)) (gui-status active)) ) @@ -1647,7 +1639,7 @@ ) ;; definition for method 10 of type fail-mission -(defmethod deactivate fail-mission ((this fail-mission)) +(defmethod deactivate ((this fail-mission)) (set-filter-color! 1.0 1.0 1.0) (sound-group-continue (sound-group sfx music dialog sog3 ambient dialog2 sog6 sog7)) (update-rates! (-> *display* bg-clock) 1.0) @@ -1806,7 +1798,7 @@ ) ;; definition for method 11 of type fail-mission-control -(defmethod start! fail-mission-control ((this fail-mission-control) (arg0 fail-mission-params)) +(defmethod start! ((this fail-mission-control) (arg0 fail-mission-params)) (when (not (handle->process (-> this process))) (let ((v1-4 (process-spawn fail-mission arg0 :to *entity-pool*))) (when v1-4 @@ -1818,24 +1810,24 @@ ) ;; definition for method 12 of type fail-mission-control -(defmethod reset! fail-mission-control ((this fail-mission-control)) +(defmethod reset! ((this fail-mission-control)) (send-event (handle->process (-> this process)) 'reset) ) ;; definition for method 9 of type fail-mission-control ;; WARN: Return type mismatch object vs symbol. -(defmethod reset? fail-mission-control ((this fail-mission-control)) +(defmethod reset? ((this fail-mission-control)) (the-as symbol (send-event (handle->process (-> this process)) 'query 'reset)) ) ;; definition for method 10 of type fail-mission-control ;; WARN: Return type mismatch process vs fail-mission. -(defmethod get-proc fail-mission-control ((this fail-mission-control)) +(defmethod get-proc ((this fail-mission-control)) (the-as fail-mission (handle->process (-> this process))) ) ;; definition for method 12 of type game-task-node-info -(defmethod copy-hooks! game-task-node-info ((this game-task-node-info) (arg0 game-task-node-info)) +(defmethod copy-hooks! ((this game-task-node-info) (arg0 game-task-node-info)) (when (and (-> this info) (-> arg0 info)) (countdown (v1-3 7) (set! (-> this info hooks v1-3) (-> arg0 info hooks v1-3)) @@ -1846,7 +1838,7 @@ ;; definition for method 7 of type task-manager ;; WARN: Return type mismatch process vs task-manager. -(defmethod relocate task-manager ((this task-manager) (arg0 int)) +(defmethod relocate ((this task-manager) (arg0 int)) (if (nonzero? (-> this link)) (+! (-> this link) arg0) ) @@ -1880,7 +1872,7 @@ ) ;; definition for method 20 of type task-manager -(defmethod kill-all-children task-manager ((this task-manager)) +(defmethod kill-all-children ((this task-manager)) (while (-> this child) (deactivate (ppointer->process (-> this child))) ) @@ -1888,7 +1880,7 @@ ) ;; definition for method 21 of type task-manager -(defmethod check-time task-manager ((this task-manager)) +(defmethod check-time ((this task-manager)) (when (nonzero? (-> this start-time)) (let ((v1-3 (handle->process (-> this hud-timer)))) (if (and *target* (not v1-3)) @@ -1913,7 +1905,7 @@ ) ;; definition for method 19 of type task-manager -(defmethod initialize! task-manager ((this task-manager)) +(defmethod initialize! ((this task-manager)) (set! (-> this info) (-> this node-info info)) (countdown (v1-2 32) (set! (-> this slave v1-2) (the-as handle #f)) @@ -1935,7 +1927,7 @@ ) ;; definition for method 10 of type task-manager -(defmethod deactivate task-manager ((this task-manager)) +(defmethod deactivate ((this task-manager)) (with-pp (let ((s5-0 pp)) (set! pp this) @@ -2071,7 +2063,7 @@ ;; definition for method 22 of type task-manager ;; WARN: Return type mismatch object vs symbol. -(defmethod task-manager-method-22 task-manager ((this task-manager)) +(defmethod task-manager-method-22 ((this task-manager)) (the-as symbol (and (or (not (logtest? (-> this node-info flags) (game-task-node-flag city-wait))) diff --git a/test/decompiler/reference/jak2/engine/geometry/bounding-box-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/bounding-box-h_REF.gc index c9c9f24942e..17b8786f6ee 100644 --- a/test/decompiler/reference/jak2/engine/geometry/bounding-box-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/bounding-box-h_REF.gc @@ -3,30 +3,27 @@ ;; definition of type bounding-box (deftype bounding-box (structure) - ((min vector :inline :offset-assert 0) - (max vector :inline :offset-assert 16) + ((min vector :inline) + (max vector :inline) ) - :method-count-assert 21 - :size-assert #x20 - :flag-assert #x1500000020 (:methods - (add-spheres! (_type_ (inline-array sphere) int) int 9) - (add-box! (_type_ bounding-box) int 10) - (add-point! (_type_ vector) none 11) - (intersects-line-segment? (_type_ vector vector) symbol 12) - (set-from-point-offset! (_type_ vector vector) none 13) - (set-from-point-offset-pad! (_type_ vector vector float) int 14) - (set-to-point! (_type_ vector) none 15) - (set-from-sphere! (_type_ sphere) none 16) - (set-from-spheres! (_type_ (inline-array sphere) int) int 17) - (get-bounding-sphere (_type_ vector) vector 18) - (inside-xyz? (bounding-box vector) symbol 19) - (inside-xz? (bounding-box vector) symbol 20) + (add-spheres! (_type_ (inline-array sphere) int) int) + (add-box! (_type_ bounding-box) int) + (add-point! (_type_ vector) none) + (intersects-line-segment? (_type_ vector vector) symbol) + (set-from-point-offset! (_type_ vector vector) none) + (set-from-point-offset-pad! (_type_ vector vector float) int) + (set-to-point! (_type_ vector) none) + (set-from-sphere! (_type_ sphere) none) + (set-from-spheres! (_type_ (inline-array sphere) int) int) + (get-bounding-sphere (_type_ vector) vector) + (inside-xyz? (bounding-box vector) symbol) + (inside-xz? (bounding-box vector) symbol) ) ) ;; definition for method 3 of type bounding-box -(defmethod inspect bounding-box ((this bounding-box)) +(defmethod inspect ((this bounding-box)) (when (not this) (set! this this) (goto cfg-4) @@ -40,16 +37,13 @@ ;; definition of type bounding-box4w (deftype bounding-box4w (structure) - ((min vector4w :inline :offset-assert 0) - (max vector4w :inline :offset-assert 16) + ((min vector4w :inline) + (max vector4w :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type bounding-box4w -(defmethod inspect bounding-box4w ((this bounding-box4w)) +(defmethod inspect ((this bounding-box4w)) (when (not this) (set! this this) (goto cfg-4) @@ -63,16 +57,13 @@ ;; definition of type bounding-box-both (deftype bounding-box-both (structure) - ((box bounding-box :inline :offset-assert 0) - (box4w bounding-box4w :inline :offset-assert 32) + ((box bounding-box :inline) + (box4w bounding-box4w :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type bounding-box-both -(defmethod inspect bounding-box-both ((this bounding-box-both)) +(defmethod inspect ((this bounding-box-both)) (when (not this) (set! this this) (goto cfg-4) @@ -86,15 +77,12 @@ ;; definition of type bounding-box-array (deftype bounding-box-array (inline-array-class) - ((data bounding-box :inline :dynamic :offset-assert 16) + ((data bounding-box :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type bounding-box-array -(defmethod inspect bounding-box-array ((this bounding-box-array)) +(defmethod inspect ((this bounding-box-array)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc b/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc index 871ddd66c5b..b07f48c2e86 100644 --- a/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 19 of type bounding-box -(defmethod inside-xyz? bounding-box ((this bounding-box) (arg0 vector)) +(defmethod inside-xyz? ((this bounding-box) (arg0 vector)) (and (< (-> this min x) (-> arg0 x)) (< (-> this min y) (-> arg0 y)) (< (-> this min z) (-> arg0 z)) @@ -13,7 +13,7 @@ ) ;; definition for method 20 of type bounding-box -(defmethod inside-xz? bounding-box ((this bounding-box) (arg0 vector)) +(defmethod inside-xz? ((this bounding-box) (arg0 vector)) (and (< (-> this min x) (-> arg0 x)) (< (-> this min z) (-> arg0 z)) (< (-> arg0 x) (-> this max x)) @@ -45,7 +45,7 @@ ;; definition for method 13 of type bounding-box ;; WARN: Return type mismatch int vs none. -(defmethod set-from-point-offset! bounding-box ((this bounding-box) (arg0 vector) (arg1 vector)) +(defmethod set-from-point-offset! ((this bounding-box) (arg0 vector) (arg1 vector)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -70,7 +70,7 @@ ;; definition for method 11 of type bounding-box ;; WARN: Return type mismatch int vs none. -(defmethod add-point! bounding-box ((this bounding-box) (arg0 vector)) +(defmethod add-point! ((this bounding-box) (arg0 vector)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -88,7 +88,7 @@ ) ;; definition for method 10 of type bounding-box -(defmethod add-box! bounding-box ((this bounding-box) (arg0 bounding-box)) +(defmethod add-box! ((this bounding-box) (arg0 bounding-box)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -109,7 +109,7 @@ ;; definition for method 15 of type bounding-box ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-to-point! bounding-box ((this bounding-box) (arg0 vector)) +(defmethod set-to-point! ((this bounding-box) (arg0 vector)) (set! (-> this min quad) (-> arg0 quad)) (set! (-> this max quad) (-> arg0 quad)) 0 @@ -117,7 +117,7 @@ ) ;; definition for method 14 of type bounding-box -(defmethod set-from-point-offset-pad! bounding-box ((this bounding-box) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod set-from-point-offset-pad! ((this bounding-box) (arg0 vector) (arg1 vector) (arg2 float)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -145,7 +145,7 @@ ;; definition for method 16 of type bounding-box ;; WARN: Return type mismatch int vs none. -(defmethod set-from-sphere! bounding-box ((this bounding-box) (arg0 sphere)) +(defmethod set-from-sphere! ((this bounding-box) (arg0 sphere)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -171,7 +171,7 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for method 18 of type bounding-box -(defmethod get-bounding-sphere bounding-box ((this bounding-box) (arg0 vector)) +(defmethod get-bounding-sphere ((this bounding-box) (arg0 vector)) (let* ((a1-2 (vector-! (new 'stack-no-clear 'vector) (-> this max) (-> this min))) (a0-3 (vector-float*! (new 'stack-no-clear 'vector) a1-2 0.5)) ) @@ -183,16 +183,13 @@ ;; definition of type liang-barsky-line-clip-params (deftype liang-barsky-line-clip-params (structure) - ((te float :offset-assert 0) - (tl float :offset-assert 4) + ((te float) + (tl float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type liang-barsky-line-clip-params -(defmethod inspect liang-barsky-line-clip-params ((this liang-barsky-line-clip-params)) +(defmethod inspect ((this liang-barsky-line-clip-params)) (when (not this) (set! this this) (goto cfg-4) @@ -238,7 +235,7 @@ ;; definition for method 12 of type bounding-box ;; WARN: disable def twice: 23. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod intersects-line-segment? bounding-box ((this bounding-box) (arg0 vector) (arg1 vector)) +(defmethod intersects-line-segment? ((this bounding-box) (arg0 vector) (arg1 vector)) (let ((f28-0 (- (-> arg1 x) (-> arg0 x))) (f30-0 (- (-> arg1 z) (-> arg0 z))) ) diff --git a/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc b/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc index 9f665f9a104..7fa3c75722e 100644 --- a/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 10 of type cylinder -(defmethod ray-capsule-intersect cylinder ((this cylinder) (ray1 vector) (ray2 vector)) +(defmethod ray-capsule-intersect ((this cylinder) (ray1 vector) (ray2 vector)) (let ((t2-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -30,15 +30,12 @@ ;; definition of type cylinder-verts (deftype cylinder-verts (structure) - ((vert vector 24 :inline :offset-assert 0) + ((vert vector 24 :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;; definition for method 3 of type cylinder-verts -(defmethod inspect cylinder-verts ((this cylinder-verts)) +(defmethod inspect ((this cylinder-verts)) (when (not this) (set! this this) (goto cfg-4) @@ -52,7 +49,7 @@ ;; definition for method 9 of type cylinder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw cylinder ((this cylinder) (arg0 vector4w)) +(defmethod debug-draw ((this cylinder) (arg0 vector4w)) (local-vars (sv-896 matrix) (sv-912 vector) @@ -208,7 +205,7 @@ ;; definition for method 10 of type cylinder-flat ;; INFO: Used lq/sq -(defmethod ray-flat-cyl-intersect cylinder-flat ((this cylinder-flat) (arg0 vector) (arg1 vector)) +(defmethod ray-flat-cyl-intersect ((this cylinder-flat) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -238,15 +235,12 @@ ;; definition of type cylinder-flat-verts (deftype cylinder-flat-verts (structure) - ((vert vector 10 :inline :offset-assert 0) + ((vert vector 10 :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type cylinder-flat-verts -(defmethod inspect cylinder-flat-verts ((this cylinder-flat-verts)) +(defmethod inspect ((this cylinder-flat-verts)) (when (not this) (set! this this) (goto cfg-4) @@ -260,7 +254,7 @@ ;; definition for method 9 of type cylinder-flat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw cylinder-flat ((this cylinder-flat) (arg0 vector4w)) +(defmethod debug-draw ((this cylinder-flat) (arg0 vector4w)) (local-vars (sv-448 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) diff --git a/test/decompiler/reference/jak2/engine/geometry/geometry-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/geometry-h_REF.gc index e2c593b4427..6852f28449c 100644 --- a/test/decompiler/reference/jak2/engine/geometry/geometry-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/geometry-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type curve (deftype curve (structure) - ((cverts (inline-array vector) :offset-assert 0) - (num-cverts int32 :offset-assert 4) - (knots (pointer float) :offset-assert 8) - (num-knots int32 :offset-assert 12) - (length float :offset-assert 16) + ((cverts (inline-array vector)) + (num-cverts int32) + (knots (pointer float)) + (num-knots int32) + (length float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type curve -(defmethod inspect curve ((this curve)) +(defmethod inspect ((this curve)) (when (not this) (set! this this) (goto cfg-4) @@ -32,23 +29,20 @@ ;; definition of type border-plane (deftype border-plane (basic) - ((name symbol :offset-assert 4) - (action basic :offset-assert 8) - (slot int8 :offset-assert 12) - (trans vector :inline :offset-assert 16) - (normal vector :inline :offset-assert 32) + ((name symbol) + (action basic) + (slot int8) + (trans vector :inline) + (normal vector :inline) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (debug-draw (_type_) int 9) - (point-past-plane? (_type_ vector) symbol 10) + (debug-draw (_type_) int) + (point-past-plane? (_type_ vector) symbol) ) ) ;; definition for method 3 of type border-plane -(defmethod inspect border-plane ((this border-plane)) +(defmethod inspect ((this border-plane)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc index 4b61a6f7a75..bdf97d22b3e 100644 --- a/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc @@ -7,39 +7,36 @@ - debug drawing - conveniant vertex accessing - vertex finding/searching algorithms" - ((flags path-control-flag :offset-assert 4) - (name symbol :offset-assert 8) - (process process-drawable :offset-assert 12) - (curve curve :inline :offset-assert 16) + ((flags path-control-flag) + (name symbol) + (process process-drawable) + (curve curve :inline) ) - :method-count-assert 27 - :size-assert #x24 - :flag-assert #x1b00000024 (:methods - (new (symbol type process symbol float entity symbol) _type_ 0) - (debug-draw (_type_) none 9) - (get-point-in-path! (_type_ vector float symbol) vector 10) - (get-random-point (_type_ vector) vector :behavior process 11) - (displacement-between-two-points-copy! (_type_ vector float float) vector 12) - (displacement-between-two-points-normalized! (_type_ vector float) vector 13) - (get-point-at-percent-along-path! (_type_ vector float symbol) vector 14) - (displacement-between-points-at-percent-scaled! (_type_ vector float float) vector 15) - (displacement-between-points-at-percent-normalized! (_type_ vector float) vector 16) - (get-num-segments (_type_) float 17) - (total-distance (_type_) float 18) - (get-num-verts (_type_) int 19) - (path-distance-equal-spacing (_type_ float) float 20) - (average-segment-length (_type_ float) float 21) - (get-furthest-point-on-path (_type_ vector) float 22) - (get-path-percentage-at-furthest-point (_type_ vector) float 23) - (path-control-method-24 (_type_ vector) vector 24) - (should-display-marks? (_type_) symbol 25) - (displacement-between-two-points! (_type_ vector float float) vector 26) + (new (symbol type process symbol float entity symbol) _type_) + (debug-draw (_type_) none) + (get-point-in-path! (_type_ vector float symbol) vector) + (get-random-point (_type_ vector) vector :behavior process) + (displacement-between-two-points-copy! (_type_ vector float float) vector) + (displacement-between-two-points-normalized! (_type_ vector float) vector) + (get-point-at-percent-along-path! (_type_ vector float symbol) vector) + (displacement-between-points-at-percent-scaled! (_type_ vector float float) vector) + (displacement-between-points-at-percent-normalized! (_type_ vector float) vector) + (get-num-segments (_type_) float) + (total-distance (_type_) float) + (get-num-verts (_type_) int) + (path-distance-equal-spacing (_type_ float) float) + (average-segment-length (_type_ float) float) + (get-furthest-point-on-path (_type_ vector) float) + (get-path-percentage-at-furthest-point (_type_ vector) float) + (path-control-method-24 (_type_ vector) vector) + (should-display-marks? (_type_) symbol) + (displacement-between-two-points! (_type_ vector float float) vector) ) ) ;; definition for method 3 of type path-control -(defmethod inspect path-control ((this path-control)) +(defmethod inspect ((this path-control)) (when (not this) (set! this this) (goto cfg-4) @@ -62,16 +59,13 @@ (deftype curve-control (path-control) "Identical in terms of data to a [[path-control]] but has different implementation" () - :method-count-assert 27 - :size-assert #x24 - :flag-assert #x1b00000024 (:methods - (new (symbol type process symbol float) _type_ 0) + (new (symbol type process symbol float) _type_) ) ) ;; definition for method 3 of type curve-control -(defmethod inspect curve-control ((this curve-control)) +(defmethod inspect ((this curve-control)) (when (not this) (set! this this) (goto cfg-4) @@ -169,27 +163,27 @@ ) ;; definition for method 25 of type path-control -(defmethod should-display-marks? path-control ((this path-control)) +(defmethod should-display-marks? ((this path-control)) (and *display-path-marks* (logtest? (-> this flags) (path-control-flag display))) ) ;; definition for method 17 of type path-control -(defmethod get-num-segments path-control ((this path-control)) +(defmethod get-num-segments ((this path-control)) (the float (+ (-> this curve num-cverts) -1)) ) ;; definition for method 19 of type path-control -(defmethod get-num-verts path-control ((this path-control)) +(defmethod get-num-verts ((this path-control)) (-> this curve num-cverts) ) ;; definition for method 20 of type path-control -(defmethod path-distance-equal-spacing path-control ((this path-control) (arg0 float)) +(defmethod path-distance-equal-spacing ((this path-control) (arg0 float)) (* arg0 (get-num-segments this)) ) ;; definition for method 21 of type path-control -(defmethod average-segment-length path-control ((this path-control) (arg0 float)) +(defmethod average-segment-length ((this path-control) (arg0 float)) (/ arg0 (get-num-segments this)) ) diff --git a/test/decompiler/reference/jak2/engine/geometry/path_REF.gc b/test/decompiler/reference/jak2/engine/geometry/path_REF.gc index ed0ed49ce47..a44676026a9 100644 --- a/test/decompiler/reference/jak2/engine/geometry/path_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/path_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type path-control ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw path-control ((this path-control)) +(defmethod debug-draw ((this path-control)) (cond ((logtest? (-> this flags) (path-control-flag not-found)) (when (and (type? (-> this process) process-drawable) *display-entity-errors*) @@ -60,7 +60,7 @@ ) ;; definition for method 18 of type path-control -(defmethod total-distance path-control ((this path-control)) +(defmethod total-distance ((this path-control)) "Calcuate the total path length by summing the distance between each adjacent [[curve]] vertex" (let ((f30-0 0.0)) (dotimes (s5-0 (+ (-> this curve num-cverts) -1)) @@ -71,7 +71,7 @@ ) ;; definition for method 18 of type curve-control -(defmethod total-distance curve-control ((this curve-control)) +(defmethod total-distance ((this curve-control)) "Will lazily calculate and set the [[curve]]'s `length` @returns total path length of the [[curve]] @see [[curve-length]]" @@ -86,7 +86,7 @@ ;; definition for method 10 of type path-control ;; INFO: Used lq/sq -(defmethod get-point-in-path! path-control ((this path-control) (ret vector) (idx float) (search-type symbol)) +(defmethod get-point-in-path! ((this path-control) (ret vector) (idx float) (search-type symbol)) "Depending on the value of `idx`, the result can be quite different: - if `idx` is less than `0.0` - return the first vertex in the path - if `idx` is greater than the number of vertices in the path, return the last vertex @@ -126,7 +126,7 @@ using the fractional component of `idx` as the interpolant, return this result ;; definition for method 11 of type path-control ;; INFO: Used lq/sq -(defmethod get-random-point path-control ((this path-control) (arg0 vector)) +(defmethod get-random-point ((this path-control) (arg0 vector)) "Attempts to retrieve a random point along the path, returns the [[*null-vector*]] if no vertices are defined" (cond ((> (-> this curve num-cverts) 0) @@ -146,7 +146,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 14 of type path-control -(defmethod get-point-at-percent-along-path! path-control ((this path-control) (ret vector) (percent float) (search-type symbol)) +(defmethod get-point-at-percent-along-path! ((this path-control) (ret vector) (percent float) (search-type symbol)) "@param! ret The [[vector]] that is used to hold the return value @param percent The percentage along the path @param search-type The only recognized value is `exact` @@ -156,7 +156,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 14 of type curve-control -(defmethod get-point-at-percent-along-path! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod get-point-at-percent-along-path! ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) "@param! ret The [[vector]] that is used to hold the return value @param percent The percentage along the path @param search-type The only recognized value is `exact` @@ -176,7 +176,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 10 of type curve-control -(defmethod get-point-in-path! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod get-point-in-path! ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) "Depending on the value of `idx`, the result can be quite different: - if `idx` is less than `0.0` - return the first vertex in the path - if `idx` is greater than the number of vertices in the path, return the last vertex @@ -202,7 +202,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 26 of type path-control -(defmethod displacement-between-two-points! path-control ((this path-control) (ret vector) (idx float) (mag float)) +(defmethod displacement-between-two-points! ((this path-control) (ret vector) (idx float) (mag float)) "Return value can differ quite a bit: - If [[path-control-flag::4]] is set OR there are less than 2 vertices OR `idx` is less than `0.0` - return [[*null-vector*]] - Otherwise, find the scaled (by `mag`) displacement vector between two points in the path: @@ -232,14 +232,14 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 12 of type path-control -(defmethod displacement-between-two-points-copy! path-control ((this path-control) (ret vector) (idx float) (mag float)) +(defmethod displacement-between-two-points-copy! ((this path-control) (ret vector) (idx float) (mag float)) "Calls [[path-control::26]] with the provided args @see [[path-control::26]]" (displacement-between-two-points! this ret idx mag) ) ;; definition for method 15 of type path-control -(defmethod displacement-between-points-at-percent-scaled! path-control ((this path-control) (ret vector) (percent float) (mag float)) +(defmethod displacement-between-points-at-percent-scaled! ((this path-control) (ret vector) (percent float) (mag float)) "Calls [[path-control::12], with the `idx` at a given percent along the path @param ret The [[vector]] that is used to hold the return value @param percent The percentage along the path to find the first index @@ -254,7 +254,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 13 of type path-control -(defmethod displacement-between-two-points-normalized! path-control ((this path-control) (ret vector) (idx float)) +(defmethod displacement-between-two-points-normalized! ((this path-control) (ret vector) (idx float)) "Calls [[path-control::26], with the provided `idx` @param! ret The [[vector]] the result is stored within @param idx The vertex index @@ -265,7 +265,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 16 of type path-control -(defmethod displacement-between-points-at-percent-normalized! path-control ((this path-control) (ret vector) (percent float)) +(defmethod displacement-between-points-at-percent-normalized! ((this path-control) (ret vector) (percent float)) "Calls [[path-control::13], with the `idx` at a given percent along the path @param! ret The [[vector]] the result is stored within @param percent The percentage along the path @@ -280,7 +280,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 26 of type curve-control -(defmethod displacement-between-two-points! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod displacement-between-two-points! ((this curve-control) (arg0 vector) (arg1 float) (arg2 float)) "Return value can differ quite a bit: - If [[path-control-flag::4]] is set OR there are less than 2 vertices OR `idx` is less than `0.0` - return [[*null-vector*]] - Otherwise, find the scaled (by `mag`) displacement vector between two points in the path: @@ -330,13 +330,13 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 12 of type curve-control -(defmethod displacement-between-two-points-copy! curve-control ((this curve-control) (ret vector) (percent float) (mag float)) +(defmethod displacement-between-two-points-copy! ((this curve-control) (ret vector) (percent float) (mag float)) "Calls [[path-control::26]] with the `idx` at a given percent along the path @see [[path-control::26]]" (displacement-between-two-points! this ret (/ percent (the float (+ (-> this curve num-cverts) -1))) mag) ) ;; definition for method 15 of type curve-control -(defmethod displacement-between-points-at-percent-scaled! curve-control ((this curve-control) (ret vector) (idx float) (mag float)) +(defmethod displacement-between-points-at-percent-scaled! ((this curve-control) (ret vector) (idx float) (mag float)) "Calls [[path-control::12], with the `idx` at a given percent along the path @param ret The [[vector]] that is used to hold the return value @param percent The percentage along the path to find the first index @@ -346,7 +346,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 16 of type curve-control -(defmethod displacement-between-points-at-percent-normalized! curve-control ((this curve-control) (ret vector) (percent float)) +(defmethod displacement-between-points-at-percent-normalized! ((this curve-control) (ret vector) (percent float)) "Calls [[path-control::13], with the `idx` at a given percent along the path @param! ret The [[vector]] the result is stored within @param percent The percentage along the path @@ -358,7 +358,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 13 of type curve-control -(defmethod displacement-between-two-points-normalized! curve-control ((this curve-control) (ret vector) (idx float)) +(defmethod displacement-between-two-points-normalized! ((this curve-control) (ret vector) (idx float)) "@see [[curve-control::12]]" (displacement-between-points-at-percent-normalized! this @@ -369,7 +369,7 @@ using the fractional component of `idx` as the interpolant, return this result ;; definition for method 22 of type path-control ;; INFO: Used lq/sq -(defmethod get-furthest-point-on-path path-control ((this path-control) (point vector)) +(defmethod get-furthest-point-on-path ((this path-control) (point vector)) "@param point The point to calculate distance from @returns the `vertex-idx.interpolant` value to the point on the path furthest away from the `point` @see [[path-control::10]]" @@ -405,7 +405,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 23 of type path-control -(defmethod get-path-percentage-at-furthest-point path-control ((this path-control) (point vector)) +(defmethod get-path-percentage-at-furthest-point ((this path-control) (point vector)) "@param point The point to calculate distance from @returns the percentage of path completion from the point on the path furthest away from the `point` @see [[path-control::14]]" @@ -414,7 +414,7 @@ using the fractional component of `idx` as the interpolant, return this result ;; definition for method 9 of type curve-control ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw curve-control ((this curve-control)) +(defmethod debug-draw ((this curve-control)) (cond ((logtest? (-> this flags) (path-control-flag not-found)) (when (and (type? (-> this process) process-drawable) *display-entity-errors*) @@ -469,7 +469,7 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 24 of type path-control -(defmethod path-control-method-24 path-control ((this path-control) (arg0 vector)) +(defmethod path-control-method-24 ((this path-control) (arg0 vector)) "TODO" (let ((s4-0 (-> this curve num-cverts))) (let ((f30-0 (/ 1.0 (the float s4-0)))) diff --git a/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc index da1ef2d1dda..af654f7e44e 100644 --- a/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc @@ -3,27 +3,24 @@ ;; definition of type plane-volume (deftype plane-volume (structure) - ((volume-type symbol :offset-assert 0) - (point-count int16 :offset-assert 4) - (normal-count int16 :offset-assert 6) - (first-point (pointer vector) :offset-assert 8) - (first-normal (pointer vector) :offset-assert 12) - (num-planes int32 :offset-assert 16) - (plane (inline-array plane) :offset-assert 20) + ((volume-type symbol) + (point-count int16) + (normal-count int16) + (first-point (pointer vector)) + (first-normal (pointer vector)) + (num-planes int32) + (plane (inline-array plane)) ) :pack-me - :method-count-assert 12 - :size-assert #x18 - :flag-assert #xc00000018 (:methods - (plane-volume-method-9 (_type_ symbol vector-array vector-array) plane-volume 9) - (debug-draw (_type_) none 10) - (point-in-vol? (_type_ vector float) symbol 11) + (plane-volume-method-9 (_type_ symbol vector-array vector-array) plane-volume) + (debug-draw (_type_) none) + (point-in-vol? (_type_ vector float) symbol) ) ) ;; definition for method 3 of type plane-volume -(defmethod inspect plane-volume ((this plane-volume)) +(defmethod inspect ((this plane-volume)) (when (not this) (set! this this) (goto cfg-4) @@ -42,28 +39,25 @@ ;; definition of type vol-control (deftype vol-control (basic) - ((flags vol-flags :offset-assert 4) - (process process-drawable :offset-assert 8) - (pos-vol-count int32 :offset-assert 12) - (pos-vol plane-volume 32 :inline :offset-assert 16) - (neg-vol-count int32 :offset-assert 784) - (neg-vol plane-volume 32 :inline :offset-assert 788) - (debug-point vector-array :offset-assert 1556) - (debug-normal vector-array :offset-assert 1560) + ((flags vol-flags) + (process process-drawable) + (pos-vol-count int32) + (pos-vol plane-volume 32 :inline) + (neg-vol-count int32) + (neg-vol plane-volume 32 :inline) + (debug-point vector-array) + (debug-normal vector-array) ) - :method-count-assert 12 - :size-assert #x61c - :flag-assert #xc0000061c (:methods - (new (symbol type process-drawable) _type_ 0) - (debug-draw (_type_) none 9) - (vol-control-method-10 (_type_ plane) symbol 10) - (should-display? (_type_) symbol 11) + (new (symbol type process-drawable) _type_) + (debug-draw (_type_) none) + (vol-control-method-10 (_type_ plane) symbol) + (should-display? (_type_) symbol) ) ) ;; definition for method 3 of type vol-control -(defmethod inspect vol-control ((this vol-control)) +(defmethod inspect ((this vol-control)) (when (not this) (set! this this) (goto cfg-4) @@ -142,7 +136,7 @@ ) ;; definition for method 11 of type vol-control -(defmethod should-display? vol-control ((this vol-control)) +(defmethod should-display? ((this vol-control)) "Returns true/false if the volume's marks should be displayed" (and *display-vol-marks* (logtest? (-> this flags) (vol-flags display?))) ) diff --git a/test/decompiler/reference/jak2/engine/geometry/vol_REF.gc b/test/decompiler/reference/jak2/engine/geometry/vol_REF.gc index 8377f3fc8d6..b0b7f08020a 100644 --- a/test/decompiler/reference/jak2/engine/geometry/vol_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/vol_REF.gc @@ -44,7 +44,7 @@ ;; WARN: Stack slot offset 148 signed mismatch ;; WARN: Stack slot offset 148 signed mismatch ;; WARN: Stack slot offset 148 signed mismatch -(defmethod plane-volume-method-9 plane-volume ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) +(defmethod plane-volume-method-9 ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) (local-vars (sv-144 vector) (sv-148 number) @@ -187,7 +187,7 @@ ;; definition for method 10 of type plane-volume ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw plane-volume ((this plane-volume)) +(defmethod debug-draw ((this plane-volume)) (let* ((v1-0 (-> this volume-type)) (s5-0 (cond ((= v1-0 'vol) @@ -221,7 +221,7 @@ ) ;; definition for method 11 of type plane-volume -(defmethod point-in-vol? plane-volume ((this plane-volume) (arg0 vector) (arg1 float)) +(defmethod point-in-vol? ((this plane-volume) (arg0 vector) (arg1 float)) "TODO - Checks if the given [[vector]] point is inside the volume defined by 6 [[plane]]s by atleast the padding value provided" (dotimes (v1-0 (-> this num-planes)) (if (< arg1 (- (vector-dot arg0 (the-as vector (-> this plane v1-0))) (-> this plane v1-0 w))) @@ -233,7 +233,7 @@ ;; definition for method 9 of type vol-control ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw vol-control ((this vol-control)) +(defmethod debug-draw ((this vol-control)) (with-pp (let ((a0-1 this)) (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) (vol-flags display?))) @@ -277,7 +277,7 @@ ) ;; definition for method 10 of type vol-control -(defmethod vol-control-method-10 vol-control ((this vol-control) (arg0 plane)) +(defmethod vol-control-method-10 ((this vol-control) (arg0 plane)) (dotimes (s4-0 (-> this neg-vol-count)) (if (point-in-vol? (-> this neg-vol s4-0) arg0 0.0) (return #f) diff --git a/test/decompiler/reference/jak2/engine/gfx/background/background-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/background-h_REF.gc index 0e5ea64bb2a..1b1415fe003 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/background-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/background-h_REF.gc @@ -3,32 +3,29 @@ ;; definition of type background-work (deftype background-work (basic) - ((tfrag-tree-count int32 :offset-assert 4) - (tfrag-trees drawable-tree-tfrag 8 :offset-assert 8) - (tfrag-levels level 8 :offset-assert 40) - (tfrag-trans-tree-count int32 :offset-assert 72) - (tfrag-trans-trees drawable-tree-tfrag-trans 8 :offset-assert 76) - (tfrag-trans-levels level 8 :offset-assert 108) - (tfrag-water-tree-count int32 :offset-assert 140) - (tfrag-water-trees drawable-tree-tfrag-water 8 :offset-assert 144) - (tfrag-water-levels level 8 :offset-assert 176) - (shrub-tree-count int32 :offset-assert 208) - (shrub-trees drawable-tree-instance-shrub 8 :offset-assert 212) - (shrub-levels level 8 :offset-assert 244) - (tie-tree-count int32 :offset-assert 276) - (tie-trees drawable-tree-instance-tie 8 :offset-assert 280) - (tie-levels level 8 :offset-assert 312) - (tie-generic basic 8 :offset-assert 344) - (tie-generic-trans basic 8 :offset-assert 376) - (wait-to-vu0 uint32 :offset-assert 408) + ((tfrag-tree-count int32) + (tfrag-trees drawable-tree-tfrag 8) + (tfrag-levels level 8) + (tfrag-trans-tree-count int32) + (tfrag-trans-trees drawable-tree-tfrag-trans 8) + (tfrag-trans-levels level 8) + (tfrag-water-tree-count int32) + (tfrag-water-trees drawable-tree-tfrag-water 8) + (tfrag-water-levels level 8) + (shrub-tree-count int32) + (shrub-trees drawable-tree-instance-shrub 8) + (shrub-levels level 8) + (tie-tree-count int32) + (tie-trees drawable-tree-instance-tie 8) + (tie-levels level 8) + (tie-generic basic 8) + (tie-generic-trans basic 8) + (wait-to-vu0 uint32) ) - :method-count-assert 9 - :size-assert #x19c - :flag-assert #x90000019c ) ;; definition for method 3 of type background-work -(defmethod inspect background-work ((this background-work)) +(defmethod inspect ((this background-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/background/prototype-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/prototype-h_REF.gc index 32275fd645e..ca3872eca8f 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/prototype-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/prototype-h_REF.gc @@ -3,30 +3,27 @@ ;; definition of type prototype-bucket (deftype prototype-bucket (basic) - ((name string :offset-assert 4) - (flags prototype-flags :offset-assert 8) - (texture-masks-index uint16 :offset-assert 10) - (in-level uint16 :offset-assert 12) - (utextures uint16 :offset-assert 14) - (geometry drawable 4 :offset-assert 16) - (dists vector :inline :offset-assert 32) - (rdists vector :inline :offset-assert 48) - (near-plane meters :offset 32) - (near-stiff meters :offset 36) - (mid-plane meters :offset 40) - (far-plane meters :offset 44) - (rlength-near float :offset 48) - (rlength-stiff float :offset 52) - (rlength-mid float :offset 56) - (stiffness float :offset 60) + ((name string) + (flags prototype-flags) + (texture-masks-index uint16) + (in-level uint16) + (utextures uint16) + (geometry drawable 4) + (dists vector :inline) + (rdists vector :inline) + (near-plane meters :overlay-at (-> dists data 0)) + (near-stiff meters :overlay-at (-> dists data 1)) + (mid-plane meters :overlay-at (-> dists data 2)) + (far-plane meters :overlay-at (-> dists data 3)) + (rlength-near float :overlay-at (-> rdists data 0)) + (rlength-stiff float :overlay-at (-> rdists data 1)) + (rlength-mid float :overlay-at (-> rdists data 2)) + (stiffness float :overlay-at (-> rdists data 3)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type prototype-bucket -(defmethod inspect prototype-bucket ((this prototype-bucket)) +(defmethod inspect ((this prototype-bucket)) (when (not this) (set! this this) (goto cfg-4) @@ -54,23 +51,20 @@ ;; definition of type prototype-bucket-shrub (deftype prototype-bucket-shrub (prototype-bucket) - ((next uint32 4 :offset-assert 64) - (count uint16 4 :offset-assert 80) - (mod-count uint16 4 :offset-assert 88) - (last dma-packet 4 :offset-assert 96) - (next-clear uint128 :offset 64) - (count-clear uint64 :offset 80) - (count-clear-qword uint128 :offset 80) - (last-clear uint128 :offset 96) + ((next uint32 4) + (count uint16 4) + (mod-count uint16 4) + (last dma-packet 4) + (next-clear uint128 :overlay-at (-> next 0)) + (count-clear uint64 :overlay-at (-> count 0)) + (count-clear-qword uint128 :overlay-at (-> count 0)) + (last-clear uint128 :overlay-at (-> last 0)) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type prototype-bucket-shrub ;; INFO: Used lq/sq -(defmethod inspect prototype-bucket-shrub ((this prototype-bucket-shrub)) +(defmethod inspect ((this prototype-bucket-shrub)) (when (not this) (set! this this) (goto cfg-4) @@ -105,17 +99,14 @@ ;; definition of type prototype-inline-array-shrub (deftype prototype-inline-array-shrub (drawable) - ((length int16 :offset 6) - (data prototype-bucket-shrub 1 :inline :offset 32) - (_pad uint32 :offset-assert 144) + ((length int16 :offset 6) + (data prototype-bucket-shrub 1 :inline :offset 32) + (_pad uint32) ) - :method-count-assert 17 - :size-assert #x94 - :flag-assert #x1100000094 ) ;; definition for method 3 of type prototype-inline-array-shrub -(defmethod inspect prototype-inline-array-shrub ((this prototype-inline-array-shrub)) +(defmethod inspect ((this prototype-inline-array-shrub)) (when (not this) (set! this this) (goto cfg-4) @@ -131,17 +122,14 @@ ;; definition of type prototype-array-shrub-info (deftype prototype-array-shrub-info (basic) - ((prototype-inline-array-shrub prototype-inline-array-shrub :offset-assert 4) - (wind-vectors uint32 :offset-assert 8) - (wind-count int32 :offset-assert 12) + ((prototype-inline-array-shrub prototype-inline-array-shrub) + (wind-vectors uint32) + (wind-count int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type prototype-array-shrub-info -(defmethod inspect prototype-array-shrub-info ((this prototype-array-shrub-info)) +(defmethod inspect ((this prototype-array-shrub-info)) (when (not this) (set! this this) (goto cfg-4) @@ -156,94 +144,91 @@ ;; definition of type prototype-bucket-tie (deftype prototype-bucket-tie (prototype-bucket) - ((next uint32 12 :offset-assert 64) - (count uint16 12 :offset-assert 112) - (frag-count uint8 4 :offset-assert 136) - (index-start uint8 4 :offset-assert 140) - (base-qw uint16 4 :offset-assert 144) - (tie-rvanish float :offset-assert 152) - (tie-vanish-far float :offset-assert 156) - (envmap-rfade float :offset-assert 160) - (envmap-fade-far float :offset-assert 164) - (envmap-shader adgif-shader :offset-assert 168) - (tint-color uint32 :offset-assert 172) - (collide-hash-fragment-array collide-hash-fragment-array :offset-assert 176) - (tie-colors time-of-day-palette :offset-assert 180) - (data uint32 :dynamic :offset-assert 184) - (color-index-qwc uint32 :dynamic :offset-assert 184) - (scissor-frag-count uint8 :offset 136) - (near-frag-count uint8 :offset 137) - (mid-frag-count uint8 :offset 138) - (far-frag-count uint8 :offset 139) - (scissor-index-start uint8 :offset 140) - (near-index-start uint8 :offset 141) - (mid-index-start uint8 :offset 142) - (far-index-start uint8 :offset 143) - (scissor-base-qw uint16 :offset 144) - (near-base-qw uint16 :offset 146) - (mid-base-qw uint16 :offset 148) - (far-base-qw uint16 :offset 150) - (tie-next uint32 4 :offset 64) - (tie-scissor-next uint32 :offset 64) - (tie-near-next uint32 :offset 68) - (tie-mid-next uint32 :offset 72) - (tie-far-next uint32 :offset 76) - (trans-next uint32 4 :offset 64) - (trans-scissor-next uint32 4 :offset 64) - (trans-near-next uint32 :offset 68) - (trans-mid-next uint32 :offset 72) - (trans-far-next uint32 :offset 76) - (water-next uint32 4 :offset 64) - (water-scissor-next uint32 4 :offset 64) - (water-near-next uint32 :offset 68) - (water-mid-next uint32 :offset 72) - (water-far-next uint32 :offset 76) - (envmap-next uint32 4 :offset 80) - (envmap-scissor-next uint32 4 :offset 80) - (envmap-near-next uint32 :offset 84) - (envmap-mid-next uint32 :offset 88) - (envmap-far-next uint32 :offset 92) - (generic-next uint32 3 :offset 96) - (generic-near-next uint32 :offset 96) - (generic-mid-next uint32 :offset 100) - (generic-far-next uint32 :offset 104) - (vanish-next uint32 :offset 108) - (tie-count uint16 4 :offset 112) - (tie-scissor-count uint16 :offset 112) - (tie-near-count uint16 :offset 114) - (tie-mid-count uint16 :offset 116) - (tie-far-count uint16 :offset 118) - (trans-count uint16 4 :offset 112) - (trans-scissor-count uint16 :offset 112) - (trans-near-count uint16 :offset 114) - (trans-mid-count uint16 :offset 116) - (trans-far-count uint16 :offset 118) - (water-count uint16 4 :offset 112) - (water-scissor-count uint16 :offset 112) - (water-near-count uint16 :offset 114) - (water-mid-count uint16 :offset 116) - (water-far-count uint16 :offset 118) - (envmap-count uint16 4 :offset 120) - (envmap-scissor-count uint16 :offset 120) - (envmap-near-count uint16 :offset 122) - (envmap-mid-count uint16 :offset 124) - (envmap-far-count uint16 :offset 126) - (generic-count uint16 3 :offset 128) - (generic-near-count uint16 :offset 128) - (generic-mid-count uint16 :offset 130) - (generic-far-count uint16 :offset 132) - (vanish-count uint16 :offset 134) - (next-clear uint128 3 :offset 64) - (count-clear uint64 3 :offset 112) - (tie-geom prototype-tie 4 :offset 16) + ((next uint32 12) + (count uint16 12) + (frag-count uint8 4) + (index-start uint8 4) + (base-qw uint16 4) + (tie-rvanish float) + (tie-vanish-far float) + (envmap-rfade float) + (envmap-fade-far float) + (envmap-shader adgif-shader) + (tint-color uint32) + (collide-hash-fragment-array collide-hash-fragment-array) + (tie-colors time-of-day-palette) + (data uint32 :dynamic) + (color-index-qwc uint32 :dynamic) + (scissor-frag-count uint8 :overlay-at (-> frag-count 0)) + (near-frag-count uint8 :overlay-at (-> frag-count 1)) + (mid-frag-count uint8 :overlay-at (-> frag-count 2)) + (far-frag-count uint8 :overlay-at (-> frag-count 3)) + (scissor-index-start uint8 :overlay-at (-> index-start 0)) + (near-index-start uint8 :overlay-at (-> index-start 1)) + (mid-index-start uint8 :overlay-at (-> index-start 2)) + (far-index-start uint8 :overlay-at (-> index-start 3)) + (scissor-base-qw uint16 :overlay-at (-> base-qw 0)) + (near-base-qw uint16 :overlay-at (-> base-qw 1)) + (mid-base-qw uint16 :overlay-at (-> base-qw 2)) + (far-base-qw uint16 :overlay-at (-> base-qw 3)) + (tie-next uint32 4 :overlay-at (-> next 0)) + (tie-scissor-next uint32 :overlay-at (-> next 0)) + (tie-near-next uint32 :overlay-at (-> next 1)) + (tie-mid-next uint32 :overlay-at (-> next 2)) + (tie-far-next uint32 :overlay-at (-> next 3)) + (trans-next uint32 4 :overlay-at (-> next 0)) + (trans-scissor-next uint32 4 :overlay-at (-> next 0)) + (trans-near-next uint32 :overlay-at (-> next 1)) + (trans-mid-next uint32 :overlay-at (-> next 2)) + (trans-far-next uint32 :overlay-at (-> next 3)) + (water-next uint32 4 :overlay-at (-> next 0)) + (water-scissor-next uint32 4 :overlay-at (-> next 0)) + (water-near-next uint32 :overlay-at (-> next 1)) + (water-mid-next uint32 :overlay-at (-> next 2)) + (water-far-next uint32 :overlay-at (-> next 3)) + (envmap-next uint32 4 :overlay-at (-> next 4)) + (envmap-scissor-next uint32 4 :overlay-at (-> next 4)) + (envmap-near-next uint32 :overlay-at (-> next 5)) + (envmap-mid-next uint32 :overlay-at (-> next 6)) + (envmap-far-next uint32 :overlay-at (-> next 7)) + (generic-next uint32 3 :overlay-at (-> next 8)) + (generic-near-next uint32 :overlay-at (-> next 8)) + (generic-mid-next uint32 :overlay-at (-> next 9)) + (generic-far-next uint32 :overlay-at (-> next 10)) + (vanish-next uint32 :overlay-at (-> next 11)) + (tie-count uint16 4 :overlay-at (-> count 0)) + (tie-scissor-count uint16 :overlay-at (-> count 0)) + (tie-near-count uint16 :overlay-at (-> count 1)) + (tie-mid-count uint16 :overlay-at (-> count 2)) + (tie-far-count uint16 :overlay-at (-> count 3)) + (trans-count uint16 4 :overlay-at (-> count 0)) + (trans-scissor-count uint16 :overlay-at (-> count 0)) + (trans-near-count uint16 :overlay-at (-> count 1)) + (trans-mid-count uint16 :overlay-at (-> count 2)) + (trans-far-count uint16 :overlay-at (-> count 3)) + (water-count uint16 4 :overlay-at (-> count 0)) + (water-scissor-count uint16 :overlay-at (-> count 0)) + (water-near-count uint16 :overlay-at (-> count 1)) + (water-mid-count uint16 :overlay-at (-> count 2)) + (water-far-count uint16 :overlay-at (-> count 3)) + (envmap-count uint16 4 :overlay-at (-> count 4)) + (envmap-scissor-count uint16 :overlay-at (-> count 4)) + (envmap-near-count uint16 :overlay-at (-> count 5)) + (envmap-mid-count uint16 :overlay-at (-> count 6)) + (envmap-far-count uint16 :overlay-at (-> count 7)) + (generic-count uint16 3 :overlay-at (-> count 8)) + (generic-near-count uint16 :overlay-at (-> count 8)) + (generic-mid-count uint16 :overlay-at (-> count 9)) + (generic-far-count uint16 :overlay-at (-> count 10)) + (vanish-count uint16 :overlay-at (-> count 11)) + (next-clear uint128 3 :overlay-at (-> next 0)) + (count-clear uint64 3 :overlay-at (-> count 0)) + (tie-geom prototype-tie 4 :overlay-at (-> geometry 0)) ) - :method-count-assert 9 - :size-assert #xb8 - :flag-assert #x9000000b8 ) ;; definition for method 3 of type prototype-bucket-tie -(defmethod inspect prototype-bucket-tie ((this prototype-bucket-tie)) +(defmethod inspect ((this prototype-bucket-tie)) (when (not this) (set! this this) (goto cfg-4) @@ -350,18 +335,15 @@ ;; definition of type prototype-array-tie (deftype prototype-array-tie (array) - ((array-data prototype-bucket-tie :dynamic :offset 16) + ((array-data prototype-bucket-tie :dynamic :offset 16) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (login (_type_) none 9) + (login (_type_) none) ) ) ;; definition for method 3 of type prototype-array-tie -(defmethod inspect prototype-array-tie ((this prototype-array-tie)) +(defmethod inspect ((this prototype-array-tie)) (when (not this) (set! this this) (goto cfg-4) @@ -377,18 +359,15 @@ ;; definition of type proxy-prototype-array-tie (deftype proxy-prototype-array-tie (basic) - ((prototype-array-tie prototype-array-tie :offset-assert 4) - (wind-vectors uint32 :offset-assert 8) - (wind-count uint16 :offset-assert 12) - (prototype-max-qwc uint16 :offset-assert 14) + ((prototype-array-tie prototype-array-tie) + (wind-vectors uint32) + (wind-count uint16) + (prototype-max-qwc uint16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type proxy-prototype-array-tie -(defmethod inspect proxy-prototype-array-tie ((this proxy-prototype-array-tie)) +(defmethod inspect ((this proxy-prototype-array-tie)) (when (not this) (set! this this) (goto cfg-4) @@ -404,18 +383,15 @@ ;; definition of type instance (deftype instance (drawable) - ((bucket-index uint16 :offset 6) - (origin matrix4h :inline :offset-assert 32) - (flags instance-flags :offset 46) - (wind-index uint16 :offset 62) + ((bucket-index uint16 :offset 6) + (origin matrix4h :inline) + (flags instance-flags :overlay-at (-> origin data 7)) + (wind-index uint16 :overlay-at (-> origin data 15)) ) - :method-count-assert 17 - :size-assert #x40 - :flag-assert #x1100000040 ) ;; definition for method 3 of type instance -(defmethod inspect instance ((this instance)) +(defmethod inspect ((this instance)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/background/prototype_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/prototype_REF.gc index a8a5e9edc8a..92e64556911 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/prototype_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/prototype_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 9 of type prototype-inline-array-shrub -(defmethod login prototype-inline-array-shrub ((this prototype-inline-array-shrub)) +(defmethod login ((this prototype-inline-array-shrub)) (let ((bsp-header (-> *level* level *level-index* bsp))) (dotimes (shrub-idx (-> this length)) (let ((shrub (-> this data shrub-idx))) @@ -27,7 +27,7 @@ ) ;; definition for method 8 of type prototype-array-tie -(defmethod mem-usage prototype-array-tie ((this prototype-array-tie) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage ((this prototype-array-tie) (usage memory-usage-block) (arg2 int)) (set! (-> usage length) (max 1 (-> usage length))) (set! (-> usage data 0 name) (symbol->string 'drawable-group)) (+! (-> usage data 0 count) 1) @@ -42,7 +42,7 @@ ) ;; definition for method 8 of type prototype-bucket-tie -(defmethod mem-usage prototype-bucket-tie ((this prototype-bucket-tie) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage ((this prototype-bucket-tie) (usage memory-usage-block) (arg2 int)) (dotimes (idx 4) (let ((tie-geom (-> this tie-geom idx))) (if (nonzero? tie-geom) @@ -73,7 +73,7 @@ ) ;; definition for method 8 of type prototype-inline-array-shrub -(defmethod mem-usage prototype-inline-array-shrub ((this prototype-inline-array-shrub) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage ((this prototype-inline-array-shrub) (usage memory-usage-block) (arg2 int)) (set! (-> usage length) (max 1 (-> usage length))) (set! (-> usage data 0 name) (symbol->string 'drawable-group)) (+! (-> usage data 0 count) 1) @@ -88,7 +88,7 @@ ) ;; definition for method 8 of type prototype-bucket-shrub -(defmethod mem-usage prototype-bucket-shrub ((this prototype-bucket-shrub) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage ((this prototype-bucket-shrub) (usage memory-usage-block) (arg2 int)) (set! (-> usage length) (max 25 (-> usage length))) (set! (-> usage data 24 name) "prototype-bucket-shrub") (+! (-> usage data 24 count) 1) diff --git a/test/decompiler/reference/jak2/engine/gfx/background/subdivide-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/subdivide-h_REF.gc index 73a416e3c70..be36f0d8940 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/subdivide-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/subdivide-h_REF.gc @@ -3,21 +3,18 @@ ;; definition of type subdivide-settings (deftype subdivide-settings (basic) - ((dist float 5 :offset-assert 4) - (meters float 5 :offset-assert 24) - (close float 8 :offset-assert 44) - (far float 8 :offset-assert 76) + ((dist float 5) + (meters float 5) + (close float 8) + (far float 8) ) - :method-count-assert 9 - :size-assert #x6c - :flag-assert #x90000006c (:methods - (new (symbol type meters meters) _type_ 0) + (new (symbol type meters meters) _type_) ) ) ;; definition for method 3 of type subdivide-settings -(defmethod inspect subdivide-settings ((this subdivide-settings)) +(defmethod inspect ((this subdivide-settings)) (when (not this) (set! this this) (goto cfg-4) @@ -44,18 +41,15 @@ ;; definition of type subdivide-dists (deftype subdivide-dists (structure) - ((data uint32 32 :offset-assert 0) - (vector vector 8 :inline :offset 0) - (k0s uint128 4 :offset 0) - (k1s uint128 4 :offset 64) + ((data uint32 32) + (vector vector 8 :inline :overlay-at (-> data 0)) + (k0s uint128 4 :overlay-at (-> data 0)) + (k1s uint128 4 :overlay-at (-> data 16)) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type subdivide-dists -(defmethod inspect subdivide-dists ((this subdivide-dists)) +(defmethod inspect ((this subdivide-dists)) (when (not this) (set! this this) (goto cfg-4) @@ -71,44 +65,41 @@ ;; definition of type terrain-stats (deftype terrain-stats (structure) - ((pris tr-stat :inline :offset-assert 0) - (tie-generic tr-stat :inline :offset-assert 16) - (tie-vanish tr-stat :inline :offset-assert 32) - (tie tr-stat :inline :offset-assert 48) - (tie-scissor tr-stat :inline :offset-assert 64) - (tie-envmap tr-stat :inline :offset-assert 80) - (tie-envmap-scissor tr-stat :inline :offset-assert 96) - (tie-trans tr-stat :inline :offset-assert 112) - (tie-scissor-trans tr-stat :inline :offset-assert 128) - (tie-envmap-trans tr-stat :inline :offset-assert 144) - (tie-envmap-scissor-trans tr-stat :inline :offset-assert 160) - (tie-water tr-stat :inline :offset-assert 176) - (tie-scissor-water tr-stat :inline :offset-assert 192) - (tie-envmap-water tr-stat :inline :offset-assert 208) - (tie-envmap-scissor-water tr-stat :inline :offset-assert 224) - (shrub-near tr-stat :inline :offset-assert 240) - (shrub tr-stat :inline :offset-assert 256) - (tfrag-scissor tr-stat :inline :offset-assert 272) - (tfrag tr-stat :inline :offset-assert 288) - (billboard tr-stat :inline :offset-assert 304) - (tfrag-trans tr-stat :inline :offset-assert 320) - (tfrag-scissor-trans tr-stat :inline :offset-assert 336) - (tfrag-water tr-stat :inline :offset-assert 352) - (tfrag-scissor-water tr-stat :inline :offset-assert 368) - (trans-pris tr-stat :inline :offset-assert 384) - (trans-shrub tr-stat :inline :offset-assert 400) - (ocean-mid tr-stat :inline :offset-assert 416) - (ocean-near tr-stat :inline :offset-assert 432) - (shadow tr-stat :inline :offset-assert 448) - (total tr-stat :inline :offset-assert 464) + ((pris tr-stat :inline) + (tie-generic tr-stat :inline) + (tie-vanish tr-stat :inline) + (tie tr-stat :inline) + (tie-scissor tr-stat :inline) + (tie-envmap tr-stat :inline) + (tie-envmap-scissor tr-stat :inline) + (tie-trans tr-stat :inline) + (tie-scissor-trans tr-stat :inline) + (tie-envmap-trans tr-stat :inline) + (tie-envmap-scissor-trans tr-stat :inline) + (tie-water tr-stat :inline) + (tie-scissor-water tr-stat :inline) + (tie-envmap-water tr-stat :inline) + (tie-envmap-scissor-water tr-stat :inline) + (shrub-near tr-stat :inline) + (shrub tr-stat :inline) + (tfrag-scissor tr-stat :inline) + (tfrag tr-stat :inline) + (billboard tr-stat :inline) + (tfrag-trans tr-stat :inline) + (tfrag-scissor-trans tr-stat :inline) + (tfrag-water tr-stat :inline) + (tfrag-scissor-water tr-stat :inline) + (trans-pris tr-stat :inline) + (trans-shrub tr-stat :inline) + (ocean-mid tr-stat :inline) + (ocean-near tr-stat :inline) + (shadow tr-stat :inline) + (total tr-stat :inline) ) - :method-count-assert 9 - :size-assert #x1e0 - :flag-assert #x9000001e0 ) ;; definition for method 3 of type terrain-stats -(defmethod inspect terrain-stats ((this terrain-stats)) +(defmethod inspect ((this terrain-stats)) (when (not this) (set! this this) (goto cfg-4) @@ -150,23 +141,20 @@ ;; definition of type dma-area (deftype dma-area (structure) - ((instance-shrub-dma instance-shrub-dma :inline :offset 0) - (draw-node-dma draw-node-dma :inline :offset 0) - (tfrag-dma tfrag-dma :inline :offset 0) - (instance-tie-dma instance-tie-dma :inline :offset 0) - (prototype-tie-dma prototype-tie-dma :inline :offset 0) - (wind-dma wind-dma :inline :offset 0) - (time-of-day-dma time-of-day-dma :inline :offset 0) - (decomp-work decomp-work :inline :offset 0) - (ocean-vertex ocean-vertex 4 :offset 0) + ((instance-shrub-dma instance-shrub-dma :inline :offset 0) + (draw-node-dma draw-node-dma :inline :offset 0) + (tfrag-dma tfrag-dma :inline :offset 0) + (instance-tie-dma instance-tie-dma :inline :offset 0) + (prototype-tie-dma prototype-tie-dma :inline :offset 0) + (wind-dma wind-dma :inline :offset 0) + (time-of-day-dma time-of-day-dma :inline :offset 0) + (decomp-work decomp-work :inline :offset 0) + (ocean-vertex ocean-vertex 4 :offset 0) ) - :method-count-assert 9 - :size-assert #x38a0 - :flag-assert #x9000038a0 ) ;; definition for method 3 of type dma-area -(defmethod inspect dma-area ((this dma-area)) +(defmethod inspect ((this dma-area)) (when (not this) (set! this this) (goto cfg-4) @@ -187,16 +175,13 @@ ;; definition of type background-area (deftype background-area (structure) - ((dma-area dma-area :inline :offset-assert 0) - (vis-list uint8 2048 :offset-assert 14496) + ((dma-area dma-area :inline) + (vis-list uint8 2048) ) - :method-count-assert 9 - :size-assert #x40a0 - :flag-assert #x9000040a0 ) ;; definition for method 3 of type background-area -(defmethod inspect background-area ((this background-area)) +(defmethod inspect ((this background-area)) (when (not this) (set! this this) (goto cfg-4) @@ -210,19 +195,16 @@ ;; definition of type foreground-area (deftype foreground-area (structure) - ((generic-work generic-work :inline :offset-assert 0) - (foreground-work foreground-work :inline :offset 0) - (joint-work joint-work :inline :offset 0) - (bone-mem bone-memory :inline :offset 0) - (shadow-work shadow-work :inline :offset 0) + ((generic-work generic-work :inline) + (foreground-work foreground-work :inline :overlay-at (-> generic-work saves ptr-dma)) + (joint-work joint-work :inline :overlay-at (-> generic-work saves ptr-dma)) + (bone-mem bone-memory :inline :overlay-at (-> generic-work saves ptr-dma)) + (shadow-work shadow-work :inline :overlay-at (-> generic-work saves ptr-dma)) ) - :method-count-assert 9 - :size-assert #x3fe0 - :flag-assert #x900003fe0 ) ;; definition for method 3 of type foreground-area -(defmethod inspect foreground-area ((this foreground-area)) +(defmethod inspect ((this foreground-area)) (when (not this) (set! this this) (goto cfg-4) @@ -239,37 +221,34 @@ ;; definition of type region-prim-area (deftype region-prim-area (structure) - ((region-prim-list region-prim-list :inline :offset-assert 0) - (pos vector :inline :offset-assert 1296) - (unknown-vector-uiyb1 vector :inline :offset-assert 1312) - (ray vector :inline :offset 1328) - (unknown-vector-t3edh vector :inline :offset-assert 1344) - (region-enter-count int32 :offset 1360) - (region-enter-list region 320 :offset-assert 1364) - (region-enter-prim-list drawable-region-sphere 320 :offset-assert 2644) - (region-exit-count int32 :offset-assert 3924) - (region-exit-list region 320 :offset-assert 3928) - (region-exit-prim-list drawable-region-sphere 320 :offset-assert 5208) - (region-inside-count int32 :offset-assert 6488) - (region-inside-list region 320 :offset-assert 6492) - (region-inside-prim-list drawable-region-sphere 320 :offset-assert 7772) - (region-start-count int32 :offset-assert 9052) - (region-start-list region 320 :offset-assert 9056) - (region-start-prim-list drawable-region-sphere 320 :offset-assert 10336) + ((region-prim-list region-prim-list :inline) + (pos vector :inline) + (unknown-vector-uiyb1 vector :inline) + (ray vector :inline :offset 1328) + (unknown-vector-t3edh vector :inline) + (region-enter-count int32 :offset 1360) + (region-enter-list region 320) + (region-enter-prim-list drawable-region-sphere 320) + (region-exit-count int32) + (region-exit-list region 320) + (region-exit-prim-list drawable-region-sphere 320) + (region-inside-count int32) + (region-inside-list region 320) + (region-inside-prim-list drawable-region-sphere 320) + (region-start-count int32) + (region-start-list region 320) + (region-start-prim-list drawable-region-sphere 320) ) - :method-count-assert 13 - :size-assert #x2d60 - :flag-assert #xd00002d60 (:methods - (track-entered-region! (_type_ drawable-region-sphere) none 9) - (track-exited-region! (_type_ drawable-region-sphere) none 10) - (track-inside-region! (_type_ drawable-region-sphere) none 11) - (track-start-region! (_type_ drawable-region-sphere) none 12) + (track-entered-region! (_type_ drawable-region-sphere) none) + (track-exited-region! (_type_ drawable-region-sphere) none) + (track-inside-region! (_type_ drawable-region-sphere) none) + (track-start-region! (_type_ drawable-region-sphere) none) ) ) ;; definition for method 3 of type region-prim-area -(defmethod inspect region-prim-area ((this region-prim-area)) +(defmethod inspect ((this region-prim-area)) (when (not this) (set! this this) (goto cfg-4) @@ -296,16 +275,13 @@ ;; definition of type sprite-area (deftype sprite-area (structure) - ((clock-data vector 13 :inline :offset-assert 0) - (buffer uint8 :dynamic :offset-assert 208) + ((clock-data vector 13 :inline) + (buffer uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #xd0 - :flag-assert #x9000000d0 ) ;; definition for method 3 of type sprite-area -(defmethod inspect sprite-area ((this sprite-area)) +(defmethod inspect ((this sprite-area)) (when (not this) (set! this this) (goto cfg-4) @@ -319,18 +295,15 @@ ;; definition of type work-area (deftype work-area (structure) - ((background background-area :inline :offset-assert 0) - (foreground foreground-area :inline :offset 0) - (region-prim region-prim-area :inline :offset 0) - (sprite sprite-area :inline :offset 0) + ((background background-area :inline) + (foreground foreground-area :inline :overlay-at (-> background dma-area ocean-vertex 0)) + (region-prim region-prim-area :inline :overlay-at (-> background dma-area ocean-vertex 0)) + (sprite sprite-area :inline :overlay-at (-> background dma-area ocean-vertex 0)) ) - :method-count-assert 9 - :size-assert #x40a0 - :flag-assert #x9000040a0 ) ;; definition for method 3 of type work-area -(defmethod inspect work-area ((this work-area)) +(defmethod inspect ((this work-area)) (when (not this) (set! this this) (goto cfg-4) @@ -346,15 +319,12 @@ ;; definition of type terrain-context (deftype terrain-context (structure) - ((work work-area :inline :offset-assert 0) + ((work work-area :inline) ) - :method-count-assert 9 - :size-assert #x40a0 - :flag-assert #x9000040a0 ) ;; definition for method 3 of type terrain-context -(defmethod inspect terrain-context ((this terrain-context)) +(defmethod inspect ((this terrain-context)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-h_REF.gc index 2661f1ac80d..bb865e83aa9 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-h_REF.gc @@ -3,16 +3,13 @@ ;; definition of type tfragment-stats (deftype tfragment-stats (structure) - ((num-tris uint16 4 :offset-assert 0) - (num-dverts uint16 4 :offset-assert 8) + ((num-tris uint16 4) + (num-dverts uint16 4) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type tfragment-stats -(defmethod inspect tfragment-stats ((this tfragment-stats)) +(defmethod inspect ((this tfragment-stats)) (when (not this) (set! this this) (goto cfg-4) @@ -26,16 +23,13 @@ ;; definition of type tfragment-debug-data (deftype tfragment-debug-data (structure) - ((stats tfragment-stats :inline :offset-assert 0) - (debug-lines (array vector-array) :offset-assert 16) + ((stats tfragment-stats :inline) + (debug-lines (array vector-array)) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type tfragment-debug-data -(defmethod inspect tfragment-debug-data ((this tfragment-debug-data)) +(defmethod inspect ((this tfragment-debug-data)) (when (not this) (set! this this) (goto cfg-4) @@ -49,15 +43,12 @@ ;; definition of type generic-tfragment (deftype generic-tfragment (structure) - ((dummy int32 :offset-assert 0) + ((dummy int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type generic-tfragment -(defmethod inspect generic-tfragment ((this generic-tfragment)) +(defmethod inspect ((this generic-tfragment)) (when (not this) (set! this this) (goto cfg-4) @@ -70,35 +61,32 @@ ;; definition of type tfragment (deftype tfragment (drawable) - ((color-index uint16 :offset 6) - (debug-data tfragment-debug-data :offset 8) - (color-indices uint32 :offset 12) - (colors uint32 :offset 12) - (dma-chain uint32 3 :offset 32) - (dma-common uint32 :offset 32) - (dma-level-0 uint32 :offset 32) - (dma-base uint32 :offset 36) - (dma-level-1 uint32 :offset 40) - (dma-qwc uint8 4 :offset 44) - (dma-u32 uint32 :offset 44) - (shader (inline-array adgif-shader) :offset 48) - (num-shaders uint8 :offset 52) - (num-base-colors uint8 :offset 53) - (num-level0-colors uint8 :offset 54) - (num-level1-colors uint8 :offset 55) - (color-offset uint8 :offset 56) - (color-count uint8 :offset 57) - (texture-masks-index uint16 :offset 58) - (generic generic-tfragment :offset 60) - (generic-u32 uint32 :offset 60) + ((color-index uint16 :offset 6) + (debug-data tfragment-debug-data :offset 8) + (color-indices uint32 :offset 12) + (colors uint32 :overlay-at color-indices) + (dma-chain uint32 3 :offset 32) + (dma-common uint32 :overlay-at (-> dma-chain 0)) + (dma-level-0 uint32 :overlay-at dma-common) + (dma-base uint32 :overlay-at (-> dma-chain 1)) + (dma-level-1 uint32 :overlay-at (-> dma-chain 2)) + (dma-qwc uint8 4 :offset 44) + (dma-u32 uint32 :overlay-at (-> dma-qwc 0)) + (shader (inline-array adgif-shader) :offset 48) + (num-shaders uint8 :offset 52) + (num-base-colors uint8 :offset 53) + (num-level0-colors uint8 :offset 54) + (num-level1-colors uint8 :offset 55) + (color-offset uint8 :offset 56) + (color-count uint8 :offset 57) + (texture-masks-index uint16 :offset 58) + (generic generic-tfragment :offset 60) + (generic-u32 uint32 :overlay-at generic) ) - :method-count-assert 17 - :size-assert #x40 - :flag-assert #x1100000040 ) ;; definition for method 3 of type tfragment -(defmethod inspect tfragment ((this tfragment)) +(defmethod inspect ((this tfragment)) (when (not this) (set! this this) (goto cfg-4) @@ -131,74 +119,53 @@ ;; definition of type drawable-inline-array-tfrag (deftype drawable-inline-array-tfrag (drawable-inline-array) - ((data tfragment 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 96) + ((data tfragment 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x64 - :flag-assert #x1100000064 ) ;; definition of type drawable-inline-array-tfrag-trans (deftype drawable-inline-array-tfrag-trans (drawable-inline-array-tfrag) - ((data2 tfragment 1 :inline :offset-assert 112) - (pad2 uint32 :offset-assert 176) + ((data2 tfragment 1 :inline) + (pad2 uint32) ) - :method-count-assert 17 - :size-assert #xb4 - :flag-assert #x11000000b4 ) ;; definition of type drawable-inline-array-tfrag-water (deftype drawable-inline-array-tfrag-water (drawable-inline-array-tfrag) - ((data2 tfragment 1 :inline :offset-assert 112) - (pad2 uint32 :offset-assert 176) + ((data2 tfragment 1 :inline) + (pad2 uint32) ) - :method-count-assert 17 - :size-assert #xb4 - :flag-assert #x11000000b4 ) ;; definition of type drawable-tree-tfrag (deftype drawable-tree-tfrag (drawable-tree) - ((time-of-day-pal time-of-day-palette :offset 12) - (arrays drawable-inline-array :dynamic :offset 32) + ((time-of-day-pal time-of-day-palette :offset 12) + (arrays drawable-inline-array :dynamic :offset 32) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition of type drawable-tree-tfrag-trans (deftype drawable-tree-tfrag-trans (drawable-tree-tfrag) () - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition of type drawable-tree-tfrag-water (deftype drawable-tree-tfrag-water (drawable-tree-tfrag-trans) () - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition of type tfrag-dists (deftype tfrag-dists (structure) - ((data uint32 16 :offset-assert 0) - (vector vector 4 :inline :offset 0) - (k0s vector 2 :inline :offset 0) - (k1s vector 2 :inline :offset 32) + ((data uint32 16) + (vector vector 4 :inline :overlay-at (-> data 0)) + (k0s vector 2 :inline :overlay-at (-> data 0)) + (k1s vector 2 :inline :overlay-at (-> data 8)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type tfrag-dists -(defmethod inspect tfrag-dists ((this tfrag-dists)) +(defmethod inspect ((this tfrag-dists)) (when (not this) (set! this this) (goto cfg-4) @@ -214,29 +181,26 @@ ;; definition of type tfrag-data (deftype tfrag-data (structure) - ((data uint32 56 :offset 0) - (vector vector 14 :inline :offset 0) - (fog vector :inline :offset 0) - (val vector :inline :offset 16) - (strgif gs-gif-tag :inline :offset 32) - (fangif gs-gif-tag :inline :offset 48) - (adgif gs-gif-tag :inline :offset 64) - (hvdf-offset vector :inline :offset 80) - (hmge-scale vector :inline :offset 96) - (invh-scale vector :inline :offset 112) - (ambient vector :inline :offset 128) - (guard vector :inline :offset 144) - (dists tfrag-dists :inline :offset 160) - (k0s uint128 2 :offset 160) - (k1s uint128 2 :offset 192) + ((data uint32 56 :offset 0) + (vector vector 14 :inline :overlay-at (-> data 0)) + (fog vector :inline :overlay-at (-> vector 0)) + (val vector :inline :overlay-at (-> vector 1)) + (strgif gs-gif-tag :inline :overlay-at (-> data 8)) + (fangif gs-gif-tag :inline :overlay-at (-> data 12)) + (adgif gs-gif-tag :inline :overlay-at (-> data 16)) + (hvdf-offset vector :inline :overlay-at (-> vector 5)) + (hmge-scale vector :inline :overlay-at (-> vector 6)) + (invh-scale vector :inline :overlay-at (-> vector 7)) + (ambient vector :inline :overlay-at (-> vector 8)) + (guard vector :inline :overlay-at (-> vector 9)) + (dists tfrag-dists :inline :overlay-at (-> data 40)) + (k0s uint128 2 :overlay-at (-> data 40)) + (k1s uint128 2 :overlay-at (-> data 48)) ) - :method-count-assert 9 - :size-assert #xe0 - :flag-assert #x9000000e0 ) ;; definition for method 3 of type tfrag-data -(defmethod inspect tfrag-data ((this tfrag-data)) +(defmethod inspect ((this tfrag-data)) (when (not this) (set! this this) (goto cfg-4) @@ -263,34 +227,31 @@ ;; definition of type tfrag-control (deftype tfrag-control (structure) - ((num-base-points uint32 :offset-assert 0) - (num-shared-base-points uint32 :offset-assert 4) - (num-level0-points uint32 :offset-assert 8) - (num-shared-level0-points uint32 :offset-assert 12) - (num-level1-points uint32 :offset-assert 16) - (num-shared-level1-points uint32 :offset-assert 20) - (ptr-vtxdata uint32 :offset-assert 24) - (ptr-base-points uint32 :offset-assert 28) - (ptr-shared-base-points uint32 :offset-assert 32) - (ptr-level0-points uint32 :offset-assert 36) - (ptr-shared-level0-points uint32 :offset-assert 40) - (ptr-level1-points uint32 :offset-assert 44) - (ptr-shared-level1-points uint32 :offset-assert 48) - (ptr-draw-points uint32 :offset-assert 52) - (ptr-interpolated-0 uint32 :offset-assert 56) - (ptr-shared-interpolated-0 uint32 :offset-assert 60) - (ptr-interpolated1 uint32 :offset-assert 64) - (ptr-shared-interpolated1 uint32 :offset-assert 68) - (ptr-strip-data uint32 :offset-assert 72) - (ptr-texture-data uint32 :offset-assert 76) + ((num-base-points uint32) + (num-shared-base-points uint32) + (num-level0-points uint32) + (num-shared-level0-points uint32) + (num-level1-points uint32) + (num-shared-level1-points uint32) + (ptr-vtxdata uint32) + (ptr-base-points uint32) + (ptr-shared-base-points uint32) + (ptr-level0-points uint32) + (ptr-shared-level0-points uint32) + (ptr-level1-points uint32) + (ptr-shared-level1-points uint32) + (ptr-draw-points uint32) + (ptr-interpolated-0 uint32) + (ptr-shared-interpolated-0 uint32) + (ptr-interpolated1 uint32) + (ptr-shared-interpolated1 uint32) + (ptr-strip-data uint32) + (ptr-texture-data uint32) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type tfrag-control -(defmethod inspect tfrag-control ((this tfrag-control)) +(defmethod inspect ((this tfrag-control)) (when (not this) (set! this this) (goto cfg-4) @@ -322,30 +283,27 @@ ;; definition of type tfrag-stats (deftype tfrag-stats (structure) - ((from int32 :offset-assert 0) - (to int32 :offset-assert 4) - (cnt int32 :offset-assert 8) - (tris int32 :offset-assert 12) - (tfaces int32 :offset-assert 16) - (tfrags int32 :offset-assert 20) - (dtris int32 :offset-assert 24) - (base-verts int32 :offset-assert 28) - (level0-verts int32 :offset-assert 32) - (level1-verts int32 :offset-assert 36) - (dma-cnt int32 :offset-assert 40) - (dma-dta int32 :offset-assert 44) - (dma-tex int32 :offset-assert 48) - (strips int32 :offset-assert 52) - (drawpoints int32 :offset-assert 56) - (vif int32 :offset-assert 60) + ((from int32) + (to int32) + (cnt int32) + (tris int32) + (tfaces int32) + (tfrags int32) + (dtris int32) + (base-verts int32) + (level0-verts int32) + (level1-verts int32) + (dma-cnt int32) + (dma-dta int32) + (dma-tex int32) + (strips int32) + (drawpoints int32) + (vif int32) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type tfrag-stats -(defmethod inspect tfrag-stats ((this tfrag-stats)) +(defmethod inspect ((this tfrag-stats)) (when (not this) (set! this this) (goto cfg-4) @@ -373,15 +331,12 @@ ;; definition of type tfrag-packet (deftype tfrag-packet (structure) - ((tag uint128 2 :offset-assert 0) + ((tag uint128 2) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type tfrag-packet -(defmethod inspect tfrag-packet ((this tfrag-packet)) +(defmethod inspect ((this tfrag-packet)) (when (not this) (set! this this) (goto cfg-4) @@ -394,39 +349,36 @@ ;; definition of type tfrag-work (deftype tfrag-work (structure) - ((base-tmpl dma-packet :inline :offset-assert 0) - (level-0-tmpl dma-packet :inline :offset-assert 16) - (common-tmpl dma-packet :inline :offset-assert 32) - (level-1-tmpl dma-packet :inline :offset-assert 48) - (color-tmpl dma-packet :inline :offset-assert 64) - (frag-dists vector :inline :offset-assert 80) - (min-dist vector :inline :offset-assert 96) - (color-ptr vector4w :inline :offset-assert 112) - (tr-stat-tfrag tr-stat :offset-assert 128) - (tr-stat-tfrag-scissor tr-stat :offset-assert 132) - (vu1-enable-tfrag int32 :offset-assert 136) - (vu1-enable-tfrag-scissor int32 :offset-assert 140) - (cur-vis-bits uint32 :offset-assert 144) - (end-vis-bits uint32 :offset-assert 148) - (src-ptr uint32 :offset-assert 152) - (last-call uint32 :offset-assert 156) - (dma-buffer basic :offset-assert 160) - (test-id uint32 :offset-assert 164) - (wait-from-spr uint32 :offset-assert 168) - (wait-to-spr uint32 :offset-assert 172) - (near-wait-from-spr uint32 :offset-assert 176) - (near-wait-to-spr uint32 :offset-assert 180) - (max-fragment uint16 :offset-assert 184) - (min-fragment uint16 :offset-assert 186) - (texture-dists uint32 :offset-assert 188) + ((base-tmpl dma-packet :inline) + (level-0-tmpl dma-packet :inline) + (common-tmpl dma-packet :inline) + (level-1-tmpl dma-packet :inline) + (color-tmpl dma-packet :inline) + (frag-dists vector :inline) + (min-dist vector :inline) + (color-ptr vector4w :inline) + (tr-stat-tfrag tr-stat) + (tr-stat-tfrag-scissor tr-stat) + (vu1-enable-tfrag int32) + (vu1-enable-tfrag-scissor int32) + (cur-vis-bits uint32) + (end-vis-bits uint32) + (src-ptr uint32) + (last-call uint32) + (dma-buffer basic) + (test-id uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (near-wait-from-spr uint32) + (near-wait-to-spr uint32) + (max-fragment uint16) + (min-fragment uint16) + (texture-dists uint32) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) ;; definition for method 3 of type tfrag-work -(defmethod inspect tfrag-work ((this tfrag-work)) +(defmethod inspect ((this tfrag-work)) (when (not this) (set! this this) (goto cfg-4) @@ -463,19 +415,16 @@ ;; definition of type tfrag-dma (deftype tfrag-dma (structure) - ((banka tfragment 16 :inline :offset-assert 0) - (bankb tfragment 16 :inline :offset-assert 1024) - (outa uint128 128 :offset-assert 2048) - (outb uint128 128 :offset-assert 4096) - (colors rgba 2047 :offset-assert 6144) + ((banka tfragment 16 :inline) + (bankb tfragment 16 :inline) + (outa uint128 128) + (outb uint128 128) + (colors rgba 2047) ) - :method-count-assert 9 - :size-assert #x37fc - :flag-assert #x9000037fc ) ;; definition for method 3 of type tfrag-dma -(defmethod inspect tfrag-dma ((this tfrag-dma)) +(defmethod inspect ((this tfrag-dma)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-methods_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-methods_REF.gc index 08d31cfce33..d8badaff360 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-methods_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-methods_REF.gc @@ -549,20 +549,17 @@ ;; definition of type tfrag-init-data (deftype tfrag-init-data (structure) - ((tfrag-bucket bucket-id :offset-assert 0) - (tfrag-scissor-bucket bucket-id :offset-assert 4) - (tfrag-trans-bucket bucket-id :offset-assert 8) - (tfrag-scissor-trans-bucket bucket-id :offset-assert 12) - (tfrag-water-bucket bucket-id :offset-assert 16) - (tfrag-water-scissor-bucket bucket-id :offset-assert 20) + ((tfrag-bucket bucket-id) + (tfrag-scissor-bucket bucket-id) + (tfrag-trans-bucket bucket-id) + (tfrag-scissor-trans-bucket bucket-id) + (tfrag-water-bucket bucket-id) + (tfrag-water-scissor-bucket bucket-id) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type tfrag-init-data -(defmethod inspect tfrag-init-data ((this tfrag-init-data)) +(defmethod inspect ((this tfrag-init-data)) (when (not this) (set! this this) (goto cfg-4) @@ -705,7 +702,7 @@ ;; definition for method 10 of type drawable-tree-tfrag ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) (let ((v1-1 (-> *background-work* tfrag-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) @@ -719,7 +716,7 @@ ;; definition for method 10 of type drawable-tree-tfrag-trans ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-tfrag-trans ((this drawable-tree-tfrag-trans) (arg0 drawable-tree-tfrag-trans) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-tfrag-trans) (arg0 drawable-tree-tfrag-trans) (arg1 display-frame)) (let ((v1-1 (-> *background-work* tfrag-trans-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) @@ -733,7 +730,7 @@ ;; definition for method 10 of type drawable-tree-tfrag-water ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-tfrag-water ((this drawable-tree-tfrag-water) (arg0 drawable-tree-tfrag-water) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-tfrag-water) (arg0 drawable-tree-tfrag-water) (arg1 display-frame)) (let ((v1-1 (-> *background-work* tfrag-water-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) @@ -747,7 +744,7 @@ ;; definition for method 13 of type tfragment ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats tfragment ((this tfragment)) +(defmethod collect-stats ((this tfragment)) (stats-tfrag-asm this) 0 (none) @@ -756,7 +753,7 @@ ;; definition for method 13 of type drawable-tree-tfrag ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-tree-tfrag ((this drawable-tree-tfrag)) +(defmethod collect-stats ((this drawable-tree-tfrag)) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))) @@ -780,7 +777,7 @@ ;; definition for method 13 of type drawable-tree-tfrag-trans ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-tree-tfrag-trans ((this drawable-tree-tfrag-trans)) +(defmethod collect-stats ((this drawable-tree-tfrag-trans)) (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))) @@ -804,7 +801,7 @@ ;; definition for method 13 of type drawable-tree-tfrag-water ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-tree-tfrag-water ((this drawable-tree-tfrag-water)) +(defmethod collect-stats ((this drawable-tree-tfrag-water)) (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))) @@ -827,7 +824,7 @@ ;; definition for method 13 of type drawable-inline-array-tfrag ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) +(defmethod collect-stats ((this drawable-inline-array-tfrag)) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this data s5-0))) @@ -843,7 +840,7 @@ ;; definition for method 13 of type drawable-inline-array-tfrag-trans ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-inline-array-tfrag-trans ((this drawable-inline-array-tfrag-trans)) +(defmethod collect-stats ((this drawable-inline-array-tfrag-trans)) (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this data s5-0))) @@ -859,7 +856,7 @@ ;; definition for method 13 of type drawable-inline-array-tfrag-water ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-inline-array-tfrag-water ((this drawable-inline-array-tfrag-water)) +(defmethod collect-stats ((this drawable-inline-array-tfrag-water)) (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) (dotimes (s5-0 (-> this length)) (let ((s4-0 (-> this data s5-0))) @@ -875,7 +872,7 @@ ;; definition for method 14 of type drawable-tree-tfrag ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) (dotimes (s4-0 (-> this length)) (let ((a1-1 (-> this arrays s4-0))) @@ -889,7 +886,7 @@ ;; definition for method 14 of type drawable-tree-tfrag-trans ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-tree-tfrag-trans ((this drawable-tree-tfrag-trans) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-tfrag-trans) (arg0 drawable) (arg1 display-frame)) (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) (dotimes (s4-0 (-> this length)) (let ((a1-1 (-> this arrays s4-0))) @@ -903,7 +900,7 @@ ;; definition for method 14 of type drawable-tree-tfrag-water ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-tree-tfrag-water ((this drawable-tree-tfrag-water) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-tree-tfrag-water) (arg0 drawable) (arg1 display-frame)) (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) (dotimes (s4-0 (-> this length)) (let ((a1-1 (-> this arrays s4-0))) @@ -917,7 +914,7 @@ ;; definition for method 14 of type drawable-inline-array-tfrag ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-inline-array-tfrag ((this drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) (dotimes (s4-0 (-> this length)) (let ((s3-0 (-> this data s4-0))) (if (vis-cull (-> s3-0 id)) @@ -931,7 +928,7 @@ ;; definition for method 14 of type tfragment ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw tfragment ((this tfragment) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this tfragment) (arg0 drawable) (arg1 display-frame)) (-> arg1 global-buf) (edge-debug-lines (-> this debug-data debug-lines)) 0 diff --git a/test/decompiler/reference/jak2/engine/gfx/background/tie/generic-tie-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/tie/generic-tie-h_REF.gc index e1f81ce1a5c..199aa0c3a5b 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/tie/generic-tie-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/tie/generic-tie-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type generic-tie-instance (deftype generic-tie-instance (structure) - ((matrix-tag dma-packet :inline :offset-assert 0) - (matrix-data vector 6 :inline :offset-assert 16) - (index-tag dma-packet :inline :offset-assert 112) - (indices uint8 224 :offset-assert 128) - (end-tag dma-packet :inline :offset-assert 352) + ((matrix-tag dma-packet :inline) + (matrix-data vector 6 :inline) + (index-tag dma-packet :inline) + (indices uint8 224) + (end-tag dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x170 - :flag-assert #x900000170 ) ;; definition for method 3 of type generic-tie-instance -(defmethod inspect generic-tie-instance ((this generic-tie-instance)) +(defmethod inspect ((this generic-tie-instance)) (when (not this) (set! this this) (goto cfg-4) @@ -32,23 +29,20 @@ ;; definition of type generic-tie-input (deftype generic-tie-input (structure) - ((palette-tag dma-packet :inline :offset-assert 0) - (palette rgba 128 :offset-assert 16) - (model-tag dma-packet :inline :offset-assert 528) - (model vector 146 :inline :offset-assert 544) - (matrix-tag dma-packet :inline :offset-assert 2880) - (matrix-data vector 6 :inline :offset-assert 2896) - (index-tag dma-packet :inline :offset-assert 2992) - (indices uint8 224 :offset-assert 3008) - (end-tag dma-packet :inline :offset-assert 3232) + ((palette-tag dma-packet :inline) + (palette rgba 128) + (model-tag dma-packet :inline) + (model vector 146 :inline) + (matrix-tag dma-packet :inline) + (matrix-data vector 6 :inline) + (index-tag dma-packet :inline) + (indices uint8 224) + (end-tag dma-packet :inline) ) - :method-count-assert 9 - :size-assert #xcb0 - :flag-assert #x900000cb0 ) ;; definition for method 3 of type generic-tie-input -(defmethod inspect generic-tie-input ((this generic-tie-input)) +(defmethod inspect ((this generic-tie-input)) (when (not this) (set! this this) (goto cfg-4) @@ -69,26 +63,23 @@ ;; definition of type generic-tie-run-control (deftype generic-tie-run-control (structure) - ((skip-bp2 uint8 :offset-assert 0) - (skip-ips uint8 :offset-assert 1) - (gifbuf-skip uint8 :offset-assert 2) - (strips uint8 :offset-assert 3) - (target-bp1 uint8 :offset-assert 4) - (target-bp2 uint8 :offset-assert 5) - (target-ip1 uint8 :offset-assert 6) - (target-ip2 uint8 :offset-assert 7) - (target-bps uint8 :offset-assert 8) - (target-ips uint8 :offset-assert 9) - (is-generic uint8 :offset-assert 10) - (reserved uint8 :offset-assert 11) + ((skip-bp2 uint8) + (skip-ips uint8) + (gifbuf-skip uint8) + (strips uint8) + (target-bp1 uint8) + (target-bp2 uint8) + (target-ip1 uint8) + (target-ip2 uint8) + (target-bps uint8) + (target-ips uint8) + (is-generic uint8) + (reserved uint8) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type generic-tie-run-control -(defmethod inspect generic-tie-run-control ((this generic-tie-run-control)) +(defmethod inspect ((this generic-tie-run-control)) (when (not this) (set! this this) (goto cfg-4) @@ -112,27 +103,24 @@ ;; definition of type generic-tie-base-point (deftype generic-tie-base-point (structure) - ((data uint16 8 :offset-assert 0) - (quad uint128 :offset 0) - (x int16 :offset 0) - (y int16 :offset 2) - (z int16 :offset 4) - (d0 int16 :offset 6) - (vtx uint64 :offset 0) - (u int16 :offset 8) - (v int16 :offset 10) - (tex uint32 :offset 8) - (w int16 :offset 12) - (d1 int16 :offset 14) + ((data uint16 8) + (quad uint128 :overlay-at (-> data 0)) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) + (d0 int16 :overlay-at (-> data 3)) + (vtx uint64 :overlay-at (-> data 0)) + (u int16 :overlay-at (-> data 4)) + (v int16 :overlay-at (-> data 5)) + (tex uint32 :overlay-at (-> data 4)) + (w int16 :overlay-at (-> data 6)) + (d1 int16 :overlay-at (-> data 7)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type generic-tie-base-point ;; INFO: Used lq/sq -(defmethod inspect generic-tie-base-point ((this generic-tie-base-point)) +(defmethod inspect ((this generic-tie-base-point)) (when (not this) (set! this this) (goto cfg-4) @@ -156,15 +144,12 @@ ;; definition of type generic-tie-bps (deftype generic-tie-bps (structure) - ((bp generic-tie-base-point 4 :inline :offset-assert 0) + ((bp generic-tie-base-point 4 :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type generic-tie-bps -(defmethod inspect generic-tie-bps ((this generic-tie-bps)) +(defmethod inspect ((this generic-tie-bps)) (when (not this) (set! this this) (goto cfg-4) @@ -177,32 +162,29 @@ ;; definition of type generic-tie-interp-point (deftype generic-tie-interp-point (structure) - ((data uint16 12 :offset-assert 0) - (x int16 :offset 0) - (y int16 :offset 2) - (z int16 :offset 4) - (d0 int16 :offset 6) - (vtx0 uint64 :offset 0) - (dx int16 :offset 8) - (dy int16 :offset 10) - (dz int16 :offset 12) - (unused int16 :offset 14) - (vtx1 uint64 :offset 8) - (u int16 :offset 16) - (v int16 :offset 18) - (tex uint32 :offset 16) - (w int16 :offset 20) - (d1 int16 :offset 22) + ((data uint16 12) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) + (d0 int16 :overlay-at (-> data 3)) + (vtx0 uint64 :overlay-at (-> data 0)) + (dx int16 :overlay-at (-> data 4)) + (dy int16 :overlay-at (-> data 5)) + (dz int16 :overlay-at (-> data 6)) + (unused int16 :overlay-at (-> data 7)) + (vtx1 uint64 :overlay-at (-> data 4)) + (u int16 :overlay-at (-> data 8)) + (v int16 :overlay-at (-> data 9)) + (tex uint32 :overlay-at (-> data 8)) + (w int16 :overlay-at (-> data 10)) + (d1 int16 :overlay-at (-> data 11)) ) :pack-me - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type generic-tie-interp-point ;; INFO: Used lq/sq -(defmethod inspect generic-tie-interp-point ((this generic-tie-interp-point)) +(defmethod inspect ((this generic-tie-interp-point)) (when (not this) (set! this this) (goto cfg-4) @@ -231,15 +213,12 @@ ;; definition of type generic-tie-ips (deftype generic-tie-ips (structure) - ((ip generic-tie-interp-point 2 :inline :offset-assert 0) + ((ip generic-tie-interp-point 2 :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type generic-tie-ips -(defmethod inspect generic-tie-ips ((this generic-tie-ips)) +(defmethod inspect ((this generic-tie-ips)) (when (not this) (set! this this) (goto cfg-4) @@ -252,24 +231,21 @@ ;; definition of type generic-tie-header (deftype generic-tie-header (structure) - ((effect uint8 :offset-assert 0) - (interp-table-size uint8 :offset-assert 1) - (num-bps uint8 :offset-assert 2) - (num-ips uint8 :offset-assert 3) - (tint-color uint32 :offset-assert 4) - (index-table-offset uint16 :offset-assert 8) - (kick-table-offset uint16 :offset-assert 10) - (normal-table-offset uint16 :offset-assert 12) - (interp-table-offset uint16 :offset-assert 14) - (gsf-header gsf-header :inline :offset-assert 16) + ((effect uint8) + (interp-table-size uint8) + (num-bps uint8) + (num-ips uint8) + (tint-color uint32) + (index-table-offset uint16) + (kick-table-offset uint16) + (normal-table-offset uint16) + (interp-table-offset uint16) + (gsf-header gsf-header :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type generic-tie-header -(defmethod inspect generic-tie-header ((this generic-tie-header)) +(defmethod inspect ((this generic-tie-header)) (when (not this) (set! this this) (goto cfg-4) @@ -291,17 +267,14 @@ ;; definition of type generic-tie-matrix (deftype generic-tie-matrix (structure) - ((matrix matrix :inline :offset-assert 0) - (morph vector :inline :offset-assert 64) - (fog qword :inline :offset-assert 80) + ((matrix matrix :inline) + (morph vector :inline) + (fog qword :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type generic-tie-matrix -(defmethod inspect generic-tie-matrix ((this generic-tie-matrix)) +(defmethod inspect ((this generic-tie-matrix)) (when (not this) (set! this this) (goto cfg-4) @@ -316,18 +289,15 @@ ;; definition of type generic-tie-normal (deftype generic-tie-normal (structure) - ((x int8 :offset-assert 0) - (y int8 :offset-assert 1) - (z int8 :offset-assert 2) - (dummy int8 :offset-assert 3) + ((x int8) + (y int8) + (z int8) + (dummy int8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type generic-tie-normal -(defmethod inspect generic-tie-normal ((this generic-tie-normal)) +(defmethod inspect ((this generic-tie-normal)) (when (not this) (set! this this) (goto cfg-4) @@ -343,29 +313,26 @@ ;; definition of type generic-tie-control (deftype generic-tie-control (structure) - ((ptr-palette uint32 :offset-assert 0) - (ptr-shaders uint32 :offset-assert 4) - (ptr-runctrl generic-tie-run-control :offset-assert 8) - (ptr-verts uint32 :offset-assert 12) - (ptr-generic generic-tie-header :offset-assert 16) - (ptr-dps uint32 :offset-assert 20) - (ptr-kicks uint32 :offset-assert 24) - (ptr-normals uint32 :offset-assert 28) - (ptr-interp uint32 :offset-assert 32) - (ptr-mtxs generic-tie-matrix :offset-assert 36) - (ptr-cinds uint32 :offset-assert 40) - (next-instance uint32 :offset-assert 44) - (next-model uint32 :offset-assert 48) - (next-is-model uint32 :offset-assert 52) - (tie-type uint32 :offset-assert 56) + ((ptr-palette uint32) + (ptr-shaders uint32) + (ptr-runctrl generic-tie-run-control) + (ptr-verts uint32) + (ptr-generic generic-tie-header) + (ptr-dps uint32) + (ptr-kicks uint32) + (ptr-normals uint32) + (ptr-interp uint32) + (ptr-mtxs generic-tie-matrix) + (ptr-cinds uint32) + (next-instance uint32) + (next-model uint32) + (next-is-model uint32) + (tie-type uint32) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) ;; definition for method 3 of type generic-tie-control -(defmethod inspect generic-tie-control ((this generic-tie-control)) +(defmethod inspect ((this generic-tie-control)) (when (not this) (set! this this) (goto cfg-4) @@ -392,23 +359,20 @@ ;; definition of type generic-tie-stats (deftype generic-tie-stats (structure) - ((num-bps uint32 :offset-assert 0) - (num-ips uint32 :offset-assert 4) - (num-dps uint32 :offset-assert 8) - (num-shaders uint32 :offset-assert 12) - (num-models uint32 :offset-assert 16) - (num-instances uint32 :offset-assert 20) - (num-waits uint32 :offset-assert 24) - (num-qwc uint32 :offset-assert 28) - (max-qwc uint32 :offset-assert 32) + ((num-bps uint32) + (num-ips uint32) + (num-dps uint32) + (num-shaders uint32) + (num-models uint32) + (num-instances uint32) + (num-waits uint32) + (num-qwc uint32) + (max-qwc uint32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type generic-tie-stats -(defmethod inspect generic-tie-stats ((this generic-tie-stats)) +(defmethod inspect ((this generic-tie-stats)) (when (not this) (set! this this) (goto cfg-4) @@ -429,19 +393,16 @@ ;; definition of type generic-tie-calls (deftype generic-tie-calls (structure) - ((generic-prepare-dma-double basic :offset-assert 0) - (generic-envmap-dproc basic :offset-assert 4) - (generic-interp-dproc basic :offset-assert 8) - (generic-no-light-dproc basic :offset-assert 12) + ((generic-prepare-dma-double basic) + (generic-envmap-dproc basic) + (generic-interp-dproc basic) + (generic-no-light-dproc basic) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type generic-tie-calls -(defmethod inspect generic-tie-calls ((this generic-tie-calls)) +(defmethod inspect ((this generic-tie-calls)) (when (not this) (set! this this) (goto cfg-4) @@ -457,24 +418,21 @@ ;; definition of type generic-tie-shadow (deftype generic-tie-shadow (structure) - ((out-buf gsf-buffer :offset-assert 0) - (cur-buf uint32 :offset-assert 4) - (tie-type int32 :offset-assert 8) - (ptr-inst uint32 :offset-assert 12) - (ptr-buf uint32 :offset-assert 16) - (inst-xor int32 :offset-assert 20) - (end-of-chain uint32 :offset-assert 24) - (write-limit uint32 :offset-assert 28) - (calls generic-tie-calls :inline :offset-assert 32) + ((out-buf gsf-buffer) + (cur-buf uint32) + (tie-type int32) + (ptr-inst uint32) + (ptr-buf uint32) + (inst-xor int32) + (end-of-chain uint32) + (write-limit uint32) + (calls generic-tie-calls :inline) ) :pack-me - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type generic-tie-shadow -(defmethod inspect generic-tie-shadow ((this generic-tie-shadow)) +(defmethod inspect ((this generic-tie-shadow)) (when (not this) (set! this this) (goto cfg-4) @@ -495,21 +453,18 @@ ;; definition of type generic-tie-work (deftype generic-tie-work (structure) - ((control generic-tie-control :inline :offset-assert 0) - (interp-job generic-interp-job :inline :offset-assert 60) - (shadow generic-tie-shadow :inline :offset-assert 76) - (input-a generic-tie-input :inline :offset-assert 128) - (input-b generic-tie-input :inline :offset-assert 3376) - (inst-buf generic-tie-instance :inline :offset-assert 6624) - (palette-buf rgba 128 :offset-assert 6992) + ((control generic-tie-control :inline) + (interp-job generic-interp-job :inline) + (shadow generic-tie-shadow :inline) + (input-a generic-tie-input :inline) + (input-b generic-tie-input :inline) + (inst-buf generic-tie-instance :inline) + (palette-buf rgba 128) ) - :method-count-assert 9 - :size-assert #x1d50 - :flag-assert #x900001d50 ) ;; definition for method 3 of type generic-tie-work -(defmethod inspect generic-tie-work ((this generic-tie-work)) +(defmethod inspect ((this generic-tie-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/background/tie/tie-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/tie/tie-h_REF.gc index 10ad64bda9f..968fd52abd8 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/tie/tie-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/tie/tie-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type tie-fragment-debug (deftype tie-fragment-debug (structure) - ((num-tris uint16 :offset-assert 0) - (num-dverts uint16 :offset-assert 2) - (debug-lines (array vector-array) :offset-assert 4) + ((num-tris uint16) + (num-dverts uint16) + (debug-lines (array vector-array)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type tie-fragment-debug -(defmethod inspect tie-fragment-debug ((this tie-fragment-debug)) +(defmethod inspect ((this tie-fragment-debug)) (when (not this) (set! this this) (goto cfg-4) @@ -28,29 +25,26 @@ ;; definition of type tie-fragment (deftype tie-fragment (drawable) - ((gif-ref (inline-array adgif-shader) :offset 4) - (point-ref uint32 :offset 8) - (color-index uint16 :offset 12) - (base-colors uint8 :offset 14) - (tex-count uint16 :offset 32) - (gif-count uint16 :offset 34) - (vertex-count uint16 :offset 36) - (color-count uint16 :offset 38) - (dp-ref uint32 :offset 40) - (dp-qwc uint32 :offset 44) - (generic-ref uint32 :offset 48) - (generic-count uint16 :offset 52) - (normal-count uint16 :offset 54) - (normal-ref uint32 :offset 56) - (debug tie-fragment-debug :offset 60) + ((gif-ref (inline-array adgif-shader) :overlay-at id) + (point-ref uint32 :offset 8) + (color-index uint16 :offset 12) + (base-colors uint8 :offset 14) + (tex-count uint16 :offset 32) + (gif-count uint16 :offset 34) + (vertex-count uint16 :offset 36) + (color-count uint16 :offset 38) + (dp-ref uint32 :offset 40) + (dp-qwc uint32 :offset 44) + (generic-ref uint32 :offset 48) + (generic-count uint16 :offset 52) + (normal-count uint16 :offset 54) + (normal-ref uint32 :offset 56) + (debug tie-fragment-debug :offset 60) ) - :method-count-assert 17 - :size-assert #x40 - :flag-assert #x1100000040 ) ;; definition for method 3 of type tie-fragment -(defmethod inspect tie-fragment ((this tie-fragment)) +(defmethod inspect ((this tie-fragment)) (when (not this) (set! this this) (goto cfg-4) @@ -79,18 +73,15 @@ ;; definition of type instance-tie (deftype instance-tie (instance) - ((color-indices uint32 :offset 8) - (bucket-ptr prototype-bucket-tie :offset 12) - (max-scale uint16 :offset 38) - (rmin-scale uint16 :offset 54) + ((color-indices uint32 :offset 8) + (bucket-ptr prototype-bucket-tie :offset 12) + (max-scale uint16 :overlay-at (-> origin data 3)) + (rmin-scale uint16 :overlay-at (-> origin data 11)) ) - :method-count-assert 17 - :size-assert #x40 - :flag-assert #x1100000040 ) ;; definition for method 3 of type instance-tie -(defmethod inspect instance-tie ((this instance-tie)) +(defmethod inspect ((this instance-tie)) (when (not this) (set! this this) (goto cfg-4) @@ -112,25 +103,19 @@ ;; definition of type drawable-inline-array-instance-tie (deftype drawable-inline-array-instance-tie (drawable-inline-array) - ((data instance-tie 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 96) + ((data instance-tie 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x64 - :flag-assert #x1100000064 ) ;; definition of type drawable-tree-instance-tie (deftype drawable-tree-instance-tie (drawable-tree) - ((prototypes proxy-prototype-array-tie :offset 8) + ((prototypes proxy-prototype-array-tie :offset 8) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition for method 3 of type drawable-tree-instance-tie -(defmethod inspect drawable-tree-instance-tie ((this drawable-tree-instance-tie)) +(defmethod inspect ((this drawable-tree-instance-tie)) (when (not this) (set! this this) (goto cfg-7) @@ -150,32 +135,26 @@ ;; definition of type prototype-tie (deftype prototype-tie (drawable-inline-array) - ((data tie-fragment 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 96) + ((data tie-fragment 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x64 - :flag-assert #x1100000064 ) ;; definition of type tie-matrix (deftype tie-matrix (structure) - ((mat matrix :inline :offset-assert 0) - (morph qword :inline :offset-assert 64) - (fog qword :inline :offset-assert 80) - (envmap-flag uint32 :offset 80) - (guard-flag uint32 :offset 84) - (vertex-alpha float :offset 88) - (fog-value float :offset 92) - (fixed-alpha float :offset 68) + ((mat matrix :inline) + (morph qword :inline) + (fog qword :inline) + (envmap-flag uint32 :overlay-at (-> fog data 0)) + (guard-flag uint32 :overlay-at (-> fog data 1)) + (vertex-alpha float :overlay-at (-> fog data 2)) + (fog-value float :overlay-at (-> fog data 3)) + (fixed-alpha float :overlay-at (-> morph data 1)) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type tie-matrix -(defmethod inspect tie-matrix ((this tie-matrix)) +(defmethod inspect ((this tie-matrix)) (when (not this) (set! this this) (goto cfg-4) @@ -195,60 +174,57 @@ ;; definition of type instance-tie-work (deftype instance-tie-work (structure) - ((wind-const vector :inline :offset-assert 0) - (hmge-d vector :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (wind-force vector :inline :offset-assert 48) - (constant vector :inline :offset-assert 64) - (far-morph vector :inline :offset-assert 80) - (dist-test vector :inline :offset-assert 96) - (min-dist vector :inline :offset-assert 112) - (guard-plane plane 4 :inline :offset-assert 128) - (upload-color-0 dma-packet :inline :offset-assert 192) - (upload-color-1 dma-packet :inline :offset-assert 208) - (upload-color-2 dma-packet :inline :offset-assert 224) - (upload-color-ret dma-packet :inline :offset-assert 240) - (upload-color-temp dma-packet :inline :offset-assert 256) - (generic-color-0 dma-packet :inline :offset-assert 272) - (generic-color-1 dma-packet :inline :offset-assert 288) - (generic-color-end dma-packet :inline :offset-assert 304) - (envmap-color-0 dma-packet :inline :offset-assert 320) - (envmap-color-1 dma-packet :inline :offset-assert 336) - (tie-scissor-perspective-matrix matrix :inline :offset-assert 352) - (tod-env-color vector :inline :offset-assert 416) - (morph-temp vector :inline :offset-assert 432) - (fog-temp vector :inline :offset-assert 448) - (fade-temp float :offset-assert 464) - (wind-vectors uint32 :offset-assert 468) - (test-id uint32 :offset-assert 472) - (test-id2 uint32 :offset-assert 476) - (dma-buffer basic :offset-assert 480) - (to-spr uint32 :offset-assert 484) - (from-spr uint32 :offset-assert 488) - (wind-work uint32 :offset-assert 492) - (cur-vis-bits uint32 :offset-assert 496) - (end-vis-bits uint32 :offset-assert 500) - (refl-fade-fac float :offset-assert 504) - (refl-fade-end float :offset-assert 508) - (flags uint32 :offset-assert 512) - (vanish-flag uint32 :offset-assert 516) - (translucent-flag uint32 :offset-assert 520) - (wait-from-spr uint32 :offset-assert 524) - (wait-to-spr uint32 :offset-assert 528) - (use-etie symbol :offset-assert 532) - (buffer-start uint32 :offset-assert 536) - (buffer-end uint32 :offset-assert 540) - (tfrag-dists uint32 :offset-assert 544) - (alpha-dists uint32 :offset-assert 548) - (water-dists uint32 :offset-assert 552) + ((wind-const vector :inline) + (hmge-d vector :inline) + (hvdf-offset vector :inline) + (wind-force vector :inline) + (constant vector :inline) + (far-morph vector :inline) + (dist-test vector :inline) + (min-dist vector :inline) + (guard-plane plane 4 :inline) + (upload-color-0 dma-packet :inline) + (upload-color-1 dma-packet :inline) + (upload-color-2 dma-packet :inline) + (upload-color-ret dma-packet :inline) + (upload-color-temp dma-packet :inline) + (generic-color-0 dma-packet :inline) + (generic-color-1 dma-packet :inline) + (generic-color-end dma-packet :inline) + (envmap-color-0 dma-packet :inline) + (envmap-color-1 dma-packet :inline) + (tie-scissor-perspective-matrix matrix :inline) + (tod-env-color vector :inline) + (morph-temp vector :inline) + (fog-temp vector :inline) + (fade-temp float) + (wind-vectors uint32) + (test-id uint32) + (test-id2 uint32) + (dma-buffer basic) + (to-spr uint32) + (from-spr uint32) + (wind-work uint32) + (cur-vis-bits uint32) + (end-vis-bits uint32) + (refl-fade-fac float) + (refl-fade-end float) + (flags uint32) + (vanish-flag uint32) + (translucent-flag uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (use-etie symbol) + (buffer-start uint32) + (buffer-end uint32) + (tfrag-dists uint32) + (alpha-dists uint32) + (water-dists uint32) ) - :method-count-assert 9 - :size-assert #x22c - :flag-assert #x90000022c ) ;; definition for method 3 of type instance-tie-work -(defmethod inspect instance-tie-work ((this instance-tie-work)) +(defmethod inspect ((this instance-tie-work)) (when (not this) (set! this this) (goto cfg-4) @@ -306,19 +282,16 @@ ;; definition of type instance-tie-dma (deftype instance-tie-dma (structure) - ((banka instance-tie 32 :inline :offset-assert 0) - (bankb instance-tie 32 :inline :offset-assert 2048) - (outa uint128 256 :offset-assert 4096) - (outb uint128 256 :offset-assert 8192) - (work instance-tie-work :dynamic :offset-assert 12288) + ((banka instance-tie 32 :inline) + (bankb instance-tie 32 :inline) + (outa uint128 256) + (outb uint128 256) + (work instance-tie-work :dynamic) ) - :method-count-assert 9 - :size-assert #x3000 - :flag-assert #x900003000 ) ;; definition for method 3 of type instance-tie-dma -(defmethod inspect instance-tie-dma ((this instance-tie-dma)) +(defmethod inspect ((this instance-tie-dma)) (when (not this) (set! this this) (goto cfg-4) @@ -335,94 +308,91 @@ ;; definition of type prototype-tie-work (deftype prototype-tie-work (structure) - ((upload-flushe dma-packet :inline :offset-assert 0) - (upload-palette dma-packet :inline :offset-assert 16) - (upload-model-0 dma-packet :inline :offset-assert 32) - (upload-model-1 dma-packet :inline :offset-assert 48) - (upload-model-2 dma-packet :inline :offset-assert 64) - (upload-model-3 dma-packet :inline :offset-assert 80) - (upload-model-near-0 dma-packet :inline :offset-assert 96) - (upload-model-near-1 dma-packet :inline :offset-assert 112) - (upload-model-near-2 dma-packet :inline :offset-assert 128) - (upload-model-near-3 dma-packet :inline :offset-assert 144) - (upload-model-near-4 dma-packet :inline :offset-assert 160) - (envmap-palette dma-packet :inline :offset-assert 176) - (envmap-shader dma-packet :inline :offset-assert 192) - (upload-envmap-0 dma-packet :inline :offset-assert 208) - (upload-envmap-1 dma-packet :inline :offset-assert 224) - (upload-envmap-2 dma-packet :inline :offset-assert 240) - (upload-envmap-3 dma-packet :inline :offset-assert 256) - (upload-envmap-4 dma-packet :inline :offset-assert 272) - (upload-envmap-scissor-4 dma-packet :inline :offset-assert 288) - (generic-palette dma-packet :inline :offset-assert 304) - (generic-model-0 dma-packet :inline :offset-assert 320) - (generic-model-1 dma-packet :inline :offset-assert 336) - (generic-model-2 dma-packet :inline :offset-assert 352) - (model-next dma-packet :inline :offset-assert 368) - (clamp uint64 :offset-assert 384) - (prototype-array basic :offset-assert 392) - (wait-from-spr uint32 :offset-assert 396) - (wait-to-spr uint32 :offset-assert 400) - (mood mood-context :offset-assert 404) - (last uint32 16 :offset 416) - (next uint32 16 :offset-assert 480) - (count uint16 16 :offset-assert 544) - (tie-last uint32 :offset 416) - (tie-next uint32 :offset 480) - (tie-count uint16 :offset 544) - (trans-last uint32 :offset 420) - (trans-next uint32 :offset 484) - (trans-count uint16 :offset 546) - (water-last uint32 :offset 424) - (water-next uint32 :offset 488) - (water-count uint16 :offset 548) - (scissor-last uint32 :offset 428) - (scissor-next uint32 :offset 492) - (scissor-count uint16 :offset 550) - (scissor-trans-last uint32 :offset 432) - (scissor-trans-next uint32 :offset 496) - (scissor-trans-count uint16 :offset 552) - (scissor-water-last uint32 :offset 436) - (scissor-water-next uint32 :offset 500) - (scissor-water-count uint16 :offset 554) - (envmap-last uint32 :offset 440) - (envmap-next uint32 :offset 504) - (envmap-count uint16 :offset 556) - (envmap-trans-last uint32 :offset 444) - (envmap-trans-next uint32 :offset 508) - (envmap-trans-count uint16 :offset 558) - (envmap-water-last uint32 :offset 448) - (envmap-water-next uint32 :offset 512) - (envmap-water-count uint16 :offset 560) - (envmap-scissor-last uint32 :offset 452) - (envmap-scissor-next uint32 :offset 516) - (envmap-scissor-count uint16 :offset 562) - (envmap-scissor-trans-last uint32 :offset 456) - (envmap-scissor-trans-next uint32 :offset 520) - (envmap-scissor-trans-count uint16 :offset 564) - (envmap-scissor-water-last uint32 :offset 460) - (envmap-scissor-water-next uint32 :offset 524) - (envmap-scissor-water-count uint16 :offset 566) - (generic-last uint32 :offset 464) - (generic-next uint32 :offset 528) - (generic-count uint16 :offset 568) - (generic-trans-last uint32 :offset 468) - (generic-trans-next uint32 :offset 532) - (generic-trans-count uint16 :offset 570) - (generic-water-last uint32 :offset 472) - (generic-water-next uint32 :offset 536) - (generic-water-count uint16 :offset 572) - (vanish-last uint32 :offset 476) - (vanish-next uint32 :offset 540) - (vanish-count uint16 :offset 574) + ((upload-flushe dma-packet :inline) + (upload-palette dma-packet :inline) + (upload-model-0 dma-packet :inline) + (upload-model-1 dma-packet :inline) + (upload-model-2 dma-packet :inline) + (upload-model-3 dma-packet :inline) + (upload-model-near-0 dma-packet :inline) + (upload-model-near-1 dma-packet :inline) + (upload-model-near-2 dma-packet :inline) + (upload-model-near-3 dma-packet :inline) + (upload-model-near-4 dma-packet :inline) + (envmap-palette dma-packet :inline) + (envmap-shader dma-packet :inline) + (upload-envmap-0 dma-packet :inline) + (upload-envmap-1 dma-packet :inline) + (upload-envmap-2 dma-packet :inline) + (upload-envmap-3 dma-packet :inline) + (upload-envmap-4 dma-packet :inline) + (upload-envmap-scissor-4 dma-packet :inline) + (generic-palette dma-packet :inline) + (generic-model-0 dma-packet :inline) + (generic-model-1 dma-packet :inline) + (generic-model-2 dma-packet :inline) + (model-next dma-packet :inline) + (clamp uint64) + (prototype-array basic) + (wait-from-spr uint32) + (wait-to-spr uint32) + (mood mood-context) + (last uint32 16 :offset 416) + (next uint32 16) + (count uint16 16) + (tie-last uint32 :overlay-at (-> last 0)) + (tie-next uint32 :overlay-at (-> next 0)) + (tie-count uint16 :overlay-at (-> count 0)) + (trans-last uint32 :overlay-at (-> last 1)) + (trans-next uint32 :overlay-at (-> next 1)) + (trans-count uint16 :overlay-at (-> count 1)) + (water-last uint32 :overlay-at (-> last 2)) + (water-next uint32 :overlay-at (-> next 2)) + (water-count uint16 :overlay-at (-> count 2)) + (scissor-last uint32 :overlay-at (-> last 3)) + (scissor-next uint32 :overlay-at (-> next 3)) + (scissor-count uint16 :overlay-at (-> count 3)) + (scissor-trans-last uint32 :overlay-at (-> last 4)) + (scissor-trans-next uint32 :overlay-at (-> next 4)) + (scissor-trans-count uint16 :overlay-at (-> count 4)) + (scissor-water-last uint32 :overlay-at (-> last 5)) + (scissor-water-next uint32 :overlay-at (-> next 5)) + (scissor-water-count uint16 :overlay-at (-> count 5)) + (envmap-last uint32 :overlay-at (-> last 6)) + (envmap-next uint32 :overlay-at (-> next 6)) + (envmap-count uint16 :overlay-at (-> count 6)) + (envmap-trans-last uint32 :overlay-at (-> last 7)) + (envmap-trans-next uint32 :overlay-at (-> next 7)) + (envmap-trans-count uint16 :overlay-at (-> count 7)) + (envmap-water-last uint32 :overlay-at (-> last 8)) + (envmap-water-next uint32 :overlay-at (-> next 8)) + (envmap-water-count uint16 :overlay-at (-> count 8)) + (envmap-scissor-last uint32 :overlay-at (-> last 9)) + (envmap-scissor-next uint32 :overlay-at (-> next 9)) + (envmap-scissor-count uint16 :overlay-at (-> count 9)) + (envmap-scissor-trans-last uint32 :overlay-at (-> last 10)) + (envmap-scissor-trans-next uint32 :overlay-at (-> next 10)) + (envmap-scissor-trans-count uint16 :overlay-at (-> count 10)) + (envmap-scissor-water-last uint32 :overlay-at (-> last 11)) + (envmap-scissor-water-next uint32 :overlay-at (-> next 11)) + (envmap-scissor-water-count uint16 :overlay-at (-> count 11)) + (generic-last uint32 :overlay-at (-> last 12)) + (generic-next uint32 :overlay-at (-> next 12)) + (generic-count uint16 :overlay-at (-> count 12)) + (generic-trans-last uint32 :overlay-at (-> last 13)) + (generic-trans-next uint32 :overlay-at (-> next 13)) + (generic-trans-count uint16 :overlay-at (-> count 13)) + (generic-water-last uint32 :overlay-at (-> last 14)) + (generic-water-next uint32 :overlay-at (-> next 14)) + (generic-water-count uint16 :overlay-at (-> count 14)) + (vanish-last uint32 :overlay-at (-> last 15)) + (vanish-next uint32 :overlay-at (-> next 15)) + (vanish-count uint16 :overlay-at (-> count 15)) ) - :method-count-assert 9 - :size-assert #x240 - :flag-assert #x900000240 ) ;; definition for method 3 of type prototype-tie-work -(defmethod inspect prototype-tie-work ((this prototype-tie-work)) +(defmethod inspect ((this prototype-tie-work)) (when (not this) (set! this this) (goto cfg-4) @@ -514,89 +484,86 @@ ;; definition of type prototype-tie-dma (deftype prototype-tie-dma (structure) - ((colora rgba 256 :offset-assert 0) - (colorb rgba 256 :offset-assert 1024) - (outa uint128 256 :offset-assert 2048) - (outb uint128 256 :offset-assert 6144) - (geometry uint32 4 :offset-assert 10240) - (next uint32 12 :offset 10256) - (count uint16 12 :offset 10304) - (counts uint32 4 :offset 10328) - (palette-ptr uint32 :offset 10336) - (model-ptr uint32 :offset 10340) - (ret-ptr uint32 :offset 10344) - (length uint32 :offset 10348) - (flags uint32 :offset 10352) - (dma-buffer basic :offset 10356) - (this-frag-count uint32 :offset 10360) - (frag-count uint8 4 :offset 10364) - (from-spr uint32 :offset 10368) - (to-spr uint32 :offset 10372) - (spr-out uint32 :offset 10376) - (this-count uint32 :offset 10380) - (scissor-geometry uint32 :offset 10240) - (near-geometry uint32 :offset 10244) - (mid-geometry uint32 :offset 10248) - (far-geometry uint32 :offset 10252) - (scissor-frag-count uint8 :offset 10364) - (near-frag-count uint8 :offset 10365) - (mid-frag-count uint8 :offset 10366) - (far-frag-count uint8 :offset 10367) - (tie-scissor-next uint32 :offset 10256) - (tie-near-next uint32 :offset 10260) - (tie-mid-next uint32 :offset 10264) - (tie-far-next uint32 :offset 10268) - (trans-scissor-next uint32 4 :offset 10256) - (trans-near-next uint32 :offset 10260) - (trans-mid-next uint32 :offset 10264) - (trans-far-next uint32 :offset 10268) - (water-scissor-next uint32 4 :offset 10256) - (water-near-next uint32 :offset 10260) - (water-mid-next uint32 :offset 10264) - (water-far-next uint32 :offset 10268) - (envmap-scissor-next uint32 4 :offset 10272) - (envmap-near-next uint32 :offset 10276) - (envmap-mid-next uint32 :offset 10280) - (envmap-far-next uint32 :offset 10284) - (generic-near-next uint32 :offset 10288) - (generic-mid-next uint32 :offset 10292) - (generic-far-next uint32 :offset 10296) - (vanish-next uint32 :offset 10300) - (tie-count uint16 :offset 10304) - (tie-scissor-count uint16 :offset 10304) - (tie-near-count uint16 :offset 10306) - (tie-mid-count uint16 :offset 10308) - (tie-far-count uint16 :offset 10310) - (trans-count uint16 :offset 10304) - (trans-scissor-count uint16 :offset 10304) - (trans-near-count uint16 :offset 10306) - (trans-mid-count uint16 :offset 10308) - (trans-far-count uint16 :offset 10310) - (water-count uint16 :offset 10304) - (water-scissor-count uint16 :offset 10304) - (water-near-count uint16 :offset 10306) - (water-mid-count uint16 :offset 10308) - (water-far-count uint16 :offset 10310) - (envmap-count uint16 :offset 10312) - (envmap-scissor-count uint16 :offset 10312) - (envmap-near-count uint16 :offset 10314) - (envmap-mid-count uint16 :offset 10316) - (envmap-far-count uint16 :offset 10318) - (generic-count uint16 :offset 10320) - (generic-near-count uint16 :offset 10320) - (generic-mid-count uint16 :offset 10322) - (generic-far-count uint16 :offset 10324) - (vanish-count uint16 :offset 10326) - (next-clear uint32 3 :offset 10256) - (count-clear uint16 3 :offset 10304) + ((colora rgba 256) + (colorb rgba 256) + (outa uint128 256) + (outb uint128 256) + (geometry uint32 4) + (next uint32 12 :offset 10256) + (count uint16 12 :offset 10304) + (counts uint32 4 :offset 10328) + (palette-ptr uint32 :overlay-at (-> counts 2)) + (model-ptr uint32 :overlay-at (-> counts 3)) + (ret-ptr uint32 :offset 10344) + (length uint32 :offset 10348) + (flags uint32 :offset 10352) + (dma-buffer basic :offset 10356) + (this-frag-count uint32 :offset 10360) + (frag-count uint8 4 :offset 10364) + (from-spr uint32 :offset 10368) + (to-spr uint32 :offset 10372) + (spr-out uint32 :offset 10376) + (this-count uint32 :offset 10380) + (scissor-geometry uint32 :overlay-at (-> geometry 0)) + (near-geometry uint32 :overlay-at (-> geometry 1)) + (mid-geometry uint32 :overlay-at (-> geometry 2)) + (far-geometry uint32 :overlay-at (-> geometry 3)) + (scissor-frag-count uint8 :overlay-at (-> frag-count 0)) + (near-frag-count uint8 :overlay-at (-> frag-count 1)) + (mid-frag-count uint8 :overlay-at (-> frag-count 2)) + (far-frag-count uint8 :overlay-at (-> frag-count 3)) + (tie-scissor-next uint32 :overlay-at (-> next 0)) + (tie-near-next uint32 :overlay-at (-> next 1)) + (tie-mid-next uint32 :overlay-at (-> next 2)) + (tie-far-next uint32 :overlay-at (-> next 3)) + (trans-scissor-next uint32 4 :overlay-at tie-scissor-next) + (trans-near-next uint32 :overlay-at tie-near-next) + (trans-mid-next uint32 :overlay-at tie-mid-next) + (trans-far-next uint32 :overlay-at tie-far-next) + (water-scissor-next uint32 4 :overlay-at tie-scissor-next) + (water-near-next uint32 :overlay-at trans-near-next) + (water-mid-next uint32 :overlay-at trans-mid-next) + (water-far-next uint32 :overlay-at trans-far-next) + (envmap-scissor-next uint32 4 :overlay-at (-> next 4)) + (envmap-near-next uint32 :overlay-at (-> envmap-scissor-next 1)) + (envmap-mid-next uint32 :overlay-at (-> envmap-scissor-next 2)) + (envmap-far-next uint32 :overlay-at (-> envmap-scissor-next 3)) + (generic-near-next uint32 :overlay-at (-> next 8)) + (generic-mid-next uint32 :overlay-at (-> next 9)) + (generic-far-next uint32 :overlay-at (-> next 10)) + (vanish-next uint32 :overlay-at (-> next 11)) + (tie-count uint16 :overlay-at (-> count 0)) + (tie-scissor-count uint16 :overlay-at tie-count) + (tie-near-count uint16 :overlay-at (-> count 1)) + (tie-mid-count uint16 :overlay-at (-> count 2)) + (tie-far-count uint16 :overlay-at (-> count 3)) + (trans-count uint16 :overlay-at tie-scissor-count) + (trans-scissor-count uint16 :overlay-at trans-count) + (trans-near-count uint16 :overlay-at tie-near-count) + (trans-mid-count uint16 :overlay-at tie-mid-count) + (trans-far-count uint16 :overlay-at tie-far-count) + (water-count uint16 :overlay-at trans-scissor-count) + (water-scissor-count uint16 :overlay-at water-count) + (water-near-count uint16 :overlay-at trans-near-count) + (water-mid-count uint16 :overlay-at trans-mid-count) + (water-far-count uint16 :overlay-at trans-far-count) + (envmap-count uint16 :overlay-at (-> count 4)) + (envmap-scissor-count uint16 :overlay-at envmap-count) + (envmap-near-count uint16 :overlay-at (-> count 5)) + (envmap-mid-count uint16 :overlay-at (-> count 6)) + (envmap-far-count uint16 :overlay-at (-> count 7)) + (generic-count uint16 :overlay-at (-> count 8)) + (generic-near-count uint16 :overlay-at generic-count) + (generic-mid-count uint16 :overlay-at (-> count 9)) + (generic-far-count uint16 :overlay-at (-> count 10)) + (vanish-count uint16 :overlay-at (-> count 11)) + (next-clear uint32 3 :overlay-at tie-scissor-next) + (count-clear uint16 3 :overlay-at water-scissor-count) ) - :method-count-assert 9 - :size-assert #x2890 - :flag-assert #x900002890 ) ;; definition for method 3 of type prototype-tie-dma -(defmethod inspect prototype-tie-dma ((this prototype-tie-dma)) +(defmethod inspect ((this prototype-tie-dma)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/background/tie/tie_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/tie/tie_REF.gc index e77d140c896..fbfaa56a56e 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/tie/tie_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/tie/tie_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 9 of type tie-fragment -(defmethod login tie-fragment ((this tie-fragment)) +(defmethod login ((this tie-fragment)) (let ((s5-0 (the-as adgif-shader (-> this gif-ref))) (s4-0 (/ (-> this tex-count) (the-as uint 5))) ) @@ -35,7 +35,7 @@ ) ;; definition for method 3 of type drawable-inline-array-instance-tie -(defmethod inspect drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) +(defmethod inspect ((this drawable-inline-array-instance-tie)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) @@ -47,19 +47,19 @@ ;; definition for method 5 of type drawable-inline-array-instance-tie ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) +(defmethod asize-of ((this drawable-inline-array-instance-tie)) (the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> this length) -1) 64))) ) ;; definition for method 9 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files -(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) +(defmethod login ((this drawable-tree-instance-tie)) this ) ;; definition for method 9 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files -(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) +(defmethod login ((this drawable-tree-instance-tie)) (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) ) @@ -67,7 +67,7 @@ ) ;; definition for method 3 of type prototype-tie -(defmethod inspect prototype-tie ((this prototype-tie)) +(defmethod inspect ((this prototype-tie)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) @@ -78,7 +78,7 @@ ) ;; definition for method 9 of type prototype-tie -(defmethod login prototype-tie ((this prototype-tie)) +(defmethod login ((this prototype-tie)) (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) ) @@ -86,7 +86,7 @@ ) ;; definition for method 8 of type drawable-tree-instance-tie -(defmethod mem-usage drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -102,7 +102,7 @@ ) ;; definition for method 8 of type tie-fragment -(defmethod mem-usage tie-fragment ((this tie-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this tie-fragment) (arg0 memory-usage-block) (arg1 int)) (when (logtest? arg1 2) (let ((v1-3 (* (-> this color-count) 4)) (a0-2 (cond @@ -175,7 +175,7 @@ ) ;; definition for method 8 of type instance-tie -(defmethod mem-usage instance-tie ((this instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 19 (-> arg0 length))) (set! (-> arg0 data 18 name) "instance-tie") (+! (-> arg0 data 18 count) 1) @@ -229,7 +229,7 @@ ) ;; definition for method 8 of type drawable-inline-array-instance-tie -(defmethod mem-usage drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -244,7 +244,7 @@ ) ;; definition for method 8 of type prototype-tie -(defmethod mem-usage prototype-tie ((this prototype-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -260,34 +260,31 @@ ;; definition for method 5 of type prototype-tie ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of prototype-tie ((this prototype-tie)) +(defmethod asize-of ((this prototype-tie)) (the-as int (+ (-> prototype-tie size) (* (+ (-> this length) -1) 64))) ) ;; definition of type tie-consts (deftype tie-consts (structure) - ((data uint32 40 :offset 0) - (vector vector 10 :offset 0) - (quads uint128 10 :offset 0) - (adgif gs-gif-tag :inline :offset 0) - (strgif gs-gif-tag :inline :offset 16) - (extra vector :inline :offset 32) - (gifbufs vector :inline :offset 48) - (clrbufs qword :inline :offset 64) - (misc qword :inline :offset 80) - (atestgif gs-gif-tag :inline :offset 96) - (alpha gs-adcmd :inline :offset 112) - (atest gs-adcmd 2 :inline :offset 128) - (atest-tra gs-adcmd :inline :offset 128) - (atest-def gs-adcmd :inline :offset 144) + ((data uint32 40 :offset 0) + (vector vector 10 :overlay-at (-> data 0)) + (quads uint128 10 :overlay-at (-> data 0)) + (adgif gs-gif-tag :inline :overlay-at (-> vector 0)) + (strgif gs-gif-tag :inline :overlay-at (-> vector 4)) + (extra vector :inline :overlay-at (-> vector 8)) + (gifbufs vector :inline :overlay-at (-> data 12)) + (clrbufs qword :inline :overlay-at (-> data 16)) + (misc qword :inline :overlay-at (-> data 20)) + (atestgif gs-gif-tag :inline :overlay-at (-> data 24)) + (alpha gs-adcmd :inline :overlay-at (-> data 28)) + (atest gs-adcmd 2 :inline :overlay-at (-> data 32)) + (atest-tra gs-adcmd :inline :overlay-at (-> atest 0)) + (atest-def gs-adcmd :inline :overlay-at (-> atest 1)) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type tie-consts -(defmethod inspect tie-consts ((this tie-consts)) +(defmethod inspect ((this tie-consts)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/background/wind-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/wind-h_REF.gc index b097bf75ba1..95f2b2aaf76 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/wind-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/wind-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type wind-vector (deftype wind-vector (structure) - ((wind-pos vector4w :inline :offset-assert 0) - (wind-vel vector4w :inline :offset-assert 16) - (stiffness float :offset 28) + ((wind-pos vector4w :inline) + (wind-vel vector4w :inline) + (stiffness float :overlay-at (-> wind-vel data 3)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type wind-vector -(defmethod inspect wind-vector ((this wind-vector)) +(defmethod inspect ((this wind-vector)) (when (not this) (set! this this) (goto cfg-4) @@ -65,34 +62,31 @@ ;; definition of type wind-work (deftype wind-work (basic) - ((wind-array vector 64 :inline :offset-assert 16) - (wind-normal vector :inline :offset-assert 1040) - (wind-temp vector :inline :offset-assert 1056) - (wind-force float 64 :offset-assert 1072) - (wind-const vector :inline :offset-assert 1328) - (wind-time uint32 :offset-assert 1344) - (wait-to-vu0 uint32 :offset-assert 1348) - (wait-to-spr uint32 :offset-assert 1352) - (wait-from-spr uint32 :offset-assert 1356) - (spr-index uint32 :offset-assert 1360) - (count uint32 :offset-assert 1364) - (next-count uint32 :offset-assert 1368) - (last-count uint32 :offset-assert 1372) - (to-spr uint32 :offset-assert 1376) - (from-spr uint32 :offset-assert 1380) - (next-mem uint32 :offset-assert 1384) - (last-mem uint32 :offset-assert 1388) - (next-spr uint32 :offset-assert 1392) - (last-spr uint32 :offset-assert 1396) - (to-ptrs uint32 3 :offset-assert 1400) + ((wind-array vector 64 :inline) + (wind-normal vector :inline) + (wind-temp vector :inline) + (wind-force float 64) + (wind-const vector :inline) + (wind-time uint32) + (wait-to-vu0 uint32) + (wait-to-spr uint32) + (wait-from-spr uint32) + (spr-index uint32) + (count uint32) + (next-count uint32) + (last-count uint32) + (to-spr uint32) + (from-spr uint32) + (next-mem uint32) + (last-mem uint32) + (next-spr uint32) + (last-spr uint32) + (to-ptrs uint32 3) ) - :method-count-assert 9 - :size-assert #x584 - :flag-assert #x900000584 ) ;; definition for method 3 of type wind-work -(defmethod inspect wind-work ((this wind-work)) +(defmethod inspect ((this wind-work)) (when (not this) (set! this this) (goto cfg-4) @@ -124,17 +118,14 @@ ;; definition of type wind-dma (deftype wind-dma (structure) - ((buffer0 wind-vector 128 :inline :offset-assert 0) - (buffer1 wind-vector 128 :inline :offset-assert 4096) - (buffer2 wind-vector 128 :inline :offset-assert 8192) + ((buffer0 wind-vector 128 :inline) + (buffer1 wind-vector 128 :inline) + (buffer2 wind-vector 128 :inline) ) - :method-count-assert 9 - :size-assert #x3000 - :flag-assert #x900003000 ) ;; definition for method 3 of type wind-dma -(defmethod inspect wind-dma ((this wind-dma)) +(defmethod inspect ((this wind-dma)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/blit-displays-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/blit-displays-h_REF.gc index a1cc0842a42..9f2d11f89b8 100644 --- a/test/decompiler/reference/jak2/engine/gfx/blit-displays-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/blit-displays-h_REF.gc @@ -3,33 +3,30 @@ ;; definition of type blit-displays-work (deftype blit-displays-work (structure) - ((adgif-tmpl dma-gif-packet :inline :offset-assert 0) - (sprite-tmpl dma-gif-packet :inline :offset-assert 32) - (sprite-slow-tmpl dma-gif-packet :inline :offset-assert 64) - (line-tmpl dma-gif-packet :inline :offset-assert 96) - (scan-tmpl dma-gif-packet :inline :offset-assert 128) - (color vector4w :inline :offset-assert 160) - (line-color uint64 :offset-assert 176) - (scan-colors vector4w 15 :inline :offset-assert 192) - (menu-mode symbol :offset-assert 432) - (screen-copied symbol :offset-assert 436) - (vu1-enable-user-menu vu1-renderer-mask :offset-assert 440) - (texture-enable-user-menu uint32 :offset-assert 448) - (count-down uint32 :offset-assert 452) - (horizontal-flip-flag symbol :offset-assert 456) - (scan-alpha float :offset-assert 460) - (scanline uint32 :offset-assert 464) - (progress-interp float :offset-assert 468) - (progress-interp-dest float :offset-assert 472) - (progress-interp-speed float :offset-assert 476) + ((adgif-tmpl dma-gif-packet :inline) + (sprite-tmpl dma-gif-packet :inline) + (sprite-slow-tmpl dma-gif-packet :inline) + (line-tmpl dma-gif-packet :inline) + (scan-tmpl dma-gif-packet :inline) + (color vector4w :inline) + (line-color uint64) + (scan-colors vector4w 15 :inline) + (menu-mode symbol) + (screen-copied symbol) + (vu1-enable-user-menu vu1-renderer-mask) + (texture-enable-user-menu uint32) + (count-down uint32) + (horizontal-flip-flag symbol) + (scan-alpha float) + (scanline uint32) + (progress-interp float) + (progress-interp-dest float) + (progress-interp-speed float) ) - :method-count-assert 9 - :size-assert #x1e0 - :flag-assert #x9000001e0 ) ;; definition for method 3 of type blit-displays-work -(defmethod inspect blit-displays-work ((this blit-displays-work)) +(defmethod inspect ((this blit-displays-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/bones-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/bones-h_REF.gc index e664b546974..cab64a87505 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/bones-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/bones-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type bone-buffer (deftype bone-buffer (structure) - ((joint matrix 16 :inline :offset-assert 0) - (bone bone 16 :inline :offset-assert 1024) - (output pris-mtx 16 :inline :offset-assert 2304) + ((joint matrix 16 :inline) + (bone bone 16 :inline) + (output pris-mtx 16 :inline) ) - :method-count-assert 9 - :size-assert #x1100 - :flag-assert #x900001100 ) ;; definition for method 3 of type bone-buffer -(defmethod inspect bone-buffer ((this bone-buffer)) +(defmethod inspect ((this bone-buffer)) (when (not this) (set! this this) (goto cfg-4) @@ -28,19 +25,16 @@ ;; definition of type bone-layout (deftype bone-layout (structure) - ((data uint16 8 :offset-assert 0) - (joint (inline-array matrix) 2 :offset 0) - (bone (inline-array bone) 2 :offset 8) - (output (inline-array pris-mtx) 2 :offset 16) - (unused uint32 2 :offset 24) + ((data uint16 8) + (joint (inline-array matrix) 2 :overlay-at (-> data 0)) + (bone (inline-array bone) 2 :overlay-at (-> data 4)) + (output (inline-array pris-mtx) 2 :offset 16) + (unused uint32 2 :offset 24) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type bone-layout -(defmethod inspect bone-layout ((this bone-layout)) +(defmethod inspect ((this bone-layout)) (when (not this) (set! this this) (goto cfg-4) @@ -57,23 +51,20 @@ ;; definition of type bone-regs (deftype bone-regs (structure) - ((dma-buf basic :offset-assert 0) - (wait-count uint32 :offset-assert 4) - (in-count uint32 :offset-assert 8) - (sp-size uint32 :offset-assert 12) - (sp-bufnum uint32 :offset-assert 16) - (joint-ptr (inline-array joint) :offset-assert 20) - (bone-ptr (inline-array bone) :offset-assert 24) - (num-bones uint32 :offset-assert 28) - (mtxs (inline-array pris-mtx) :offset-assert 32) + ((dma-buf basic) + (wait-count uint32) + (in-count uint32) + (sp-size uint32) + (sp-bufnum uint32) + (joint-ptr (inline-array joint)) + (bone-ptr (inline-array bone)) + (num-bones uint32) + (mtxs (inline-array pris-mtx)) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type bone-regs -(defmethod inspect bone-regs ((this bone-regs)) +(defmethod inspect ((this bone-regs)) (when (not this) (set! this this) (goto cfg-4) @@ -94,16 +85,13 @@ ;; definition of type bone-work (deftype bone-work (structure) - ((layout bone-layout :inline :offset-assert 0) - (regs bone-regs :inline :offset-assert 32) + ((layout bone-layout :inline) + (regs bone-regs :inline) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) ;; definition for method 3 of type bone-work -(defmethod inspect bone-work ((this bone-work)) +(defmethod inspect ((this bone-work)) (when (not this) (set! this this) (goto cfg-4) @@ -117,16 +105,13 @@ ;; definition of type bone-debug (deftype bone-debug (structure) - ((time-ctr uint32 :offset-assert 0) - (timing uint32 360 :offset-assert 4) + ((time-ctr uint32) + (timing uint32 360) ) - :method-count-assert 9 - :size-assert #x5a4 - :flag-assert #x9000005a4 ) ;; definition for method 3 of type bone-debug -(defmethod inspect bone-debug ((this bone-debug)) +(defmethod inspect ((this bone-debug)) (when (not this) (set! this this) (goto cfg-4) @@ -140,16 +125,13 @@ ;; definition of type bone-memory (deftype bone-memory (structure) - ((work bone-work :inline :offset-assert 0) - (buffer bone-buffer 2 :inline :offset-assert 80) + ((work bone-work :inline) + (buffer bone-buffer 2 :inline) ) - :method-count-assert 9 - :size-assert #x2250 - :flag-assert #x900002250 ) ;; definition for method 3 of type bone-memory -(defmethod inspect bone-memory ((this bone-memory)) +(defmethod inspect ((this bone-memory)) (when (not this) (set! this this) (goto cfg-4) @@ -163,28 +145,25 @@ ;; definition of type bone-calculation (deftype bone-calculation (structure) - ((flags bone-calc-flags :offset-assert 0) - (num-bones uint16 :offset-assert 2) - (matrix-area (inline-array pris-mtx) :offset-assert 4) - (joints (inline-array joint) :offset-assert 8) - (bones (inline-array bone) :offset-assert 12) - (ripple-scale float :offset-assert 16) - (ripple-y-scale float :offset-assert 20) - (ripple-normal-scale float :offset-assert 24) - (ripple-area (inline-array vector) :offset-assert 28) - (ripple-vec vector :inline :offset 16) - (next bone-calculation :offset-assert 32) - (dummy-1 uint32 :offset-assert 36) - (dummy-2 uint32 :offset-assert 40) - (dummy-3 uint32 :offset-assert 44) + ((flags bone-calc-flags) + (num-bones uint16) + (matrix-area (inline-array pris-mtx)) + (joints (inline-array joint)) + (bones (inline-array bone)) + (ripple-scale float) + (ripple-y-scale float) + (ripple-normal-scale float) + (ripple-area (inline-array vector)) + (ripple-vec vector :inline :overlay-at ripple-scale) + (next bone-calculation) + (dummy-1 uint32) + (dummy-2 uint32) + (dummy-3 uint32) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type bone-calculation -(defmethod inspect bone-calculation ((this bone-calculation)) +(defmethod inspect ((this bone-calculation)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/bones_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/bones_REF.gc index 3bc9affbd25..f068948cf56 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/bones_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/bones_REF.gc @@ -3,16 +3,13 @@ ;; definition of type bone-calculation-list (deftype bone-calculation-list (structure) - ((first bone-calculation :offset-assert 0) - (next bone-calculation :offset-assert 4) + ((first bone-calculation) + (next bone-calculation) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type bone-calculation-list -(defmethod inspect bone-calculation-list ((this bone-calculation-list)) +(defmethod inspect ((this bone-calculation-list)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/eye-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/eye-h_REF.gc index 8ac4250394e..520972cd2c2 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/eye-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/eye-h_REF.gc @@ -3,21 +3,18 @@ ;; definition of type eye (deftype eye (structure) - ((data vector 2 :inline :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (lid float :offset 8) - (iris-scale float :offset 16) - (pupil-scale float :offset 20) - (lid-scale float :offset 24) + ((data vector 2 :inline) + (x float :overlay-at (-> data 0 data 0)) + (y float :overlay-at (-> data 0 data 1)) + (lid float :overlay-at (-> data 0 data 2)) + (iris-scale float :offset 16) + (pupil-scale float :offset 20) + (lid-scale float :offset 24) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type eye -(defmethod inspect eye ((this eye)) +(defmethod inspect ((this eye)) (when (not this) (set! this this) (goto cfg-4) @@ -36,23 +33,20 @@ ;; definition of type eye-control (deftype eye-control (structure) - ((process handle :offset-assert 0) - (draw-flag symbol :offset-assert 8) - (different-eyes symbol :offset-assert 12) - (random-time uint16 :offset-assert 16) - (bucket uint16 :offset-assert 18) - (blink float :offset-assert 20) - (shaders (inline-array adgif-shader) :offset-assert 24) - (left eye :inline :offset-assert 32) - (right eye :inline :offset-assert 64) + ((process handle) + (draw-flag symbol) + (different-eyes symbol) + (random-time uint16) + (bucket uint16) + (blink float) + (shaders (inline-array adgif-shader)) + (left eye :inline) + (right eye :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type eye-control -(defmethod inspect eye-control ((this eye-control)) +(defmethod inspect ((this eye-control)) (when (not this) (set! this this) (goto cfg-4) @@ -73,15 +67,12 @@ ;; definition of type eye-control-array (deftype eye-control-array (basic) - ((data eye-control 16 :inline :offset-assert 16) + ((data eye-control 16 :inline) ) - :method-count-assert 9 - :size-assert #x610 - :flag-assert #x900000610 ) ;; definition for method 3 of type eye-control-array -(defmethod inspect eye-control-array ((this eye-control-array)) +(defmethod inspect ((this eye-control-array)) (when (not this) (set! this this) (goto cfg-4) @@ -94,16 +85,13 @@ ;; definition of type eye-control-arrays (deftype eye-control-arrays (basic) - ((data eye-control-array 6 :inline :offset-assert 16) - (pad uint32 :offset-assert 9328) + ((data eye-control-array 6 :inline) + (pad uint32) ) - :method-count-assert 9 - :size-assert #x2474 - :flag-assert #x900002474 ) ;; definition for method 3 of type eye-control-arrays -(defmethod inspect eye-control-arrays ((this eye-control-arrays)) +(defmethod inspect ((this eye-control-arrays)) (when (not this) (set! this this) (goto cfg-4) @@ -116,18 +104,15 @@ ;; definition of type eye-work (deftype eye-work (structure) - ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) - (sprite-tmpl2 dma-gif-packet :inline :offset-assert 32) - (adgif-tmpl dma-gif-packet :inline :offset-assert 64) - (blink-table float 10 :offset-assert 96) + ((sprite-tmpl dma-gif-packet :inline) + (sprite-tmpl2 dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (blink-table float 10) ) - :method-count-assert 9 - :size-assert #x88 - :flag-assert #x900000088 ) ;; definition for method 3 of type eye-work -(defmethod inspect eye-work ((this eye-work)) +(defmethod inspect ((this eye-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/foreground-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/foreground-h_REF.gc index 5051925612c..4571631a966 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/foreground-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/foreground-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type mercneric-chain (deftype mercneric-chain (structure) - ((first uint32 :offset-assert 0) - (next uint32 :offset-assert 4) - (state generic-bucket-state :inline :offset-assert 8) - (vu1-bucket bucket-id :offset-assert 16) + ((first uint32) + (next uint32) + (state generic-bucket-state :inline) + (vu1-bucket bucket-id) ) :pack-me - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type mercneric-chain -(defmethod inspect mercneric-chain ((this mercneric-chain)) +(defmethod inspect ((this mercneric-chain)) (when (not this) (set! this this) (goto cfg-4) @@ -31,18 +28,15 @@ ;; definition of type merc-chain (deftype merc-chain (structure) - ((first dma-packet :offset-assert 0) - (patch dma-packet :offset-assert 4) - (vu1-bucket bucket-id :offset-assert 8) + ((first dma-packet) + (patch dma-packet) + (vu1-bucket bucket-id) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type merc-chain -(defmethod inspect merc-chain ((this merc-chain)) +(defmethod inspect ((this merc-chain)) (when (not this) (set! this this) (goto cfg-4) @@ -57,17 +51,14 @@ ;; definition of type foreground-bucket (deftype foreground-bucket (structure) - ((merc merc-chain :inline :offset-assert 0) - (emerc merc-chain :inline :offset-assert 12) - (mercneric mercneric-chain :inline :offset-assert 24) + ((merc merc-chain :inline) + (emerc merc-chain :inline) + (mercneric mercneric-chain :inline) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type foreground-bucket -(defmethod inspect foreground-bucket ((this foreground-bucket)) +(defmethod inspect ((this foreground-bucket)) (when (not this) (set! this this) (goto cfg-4) @@ -82,15 +73,12 @@ ;; definition of type foreground-level-buckets (deftype foreground-level-buckets (structure) - ((data foreground-bucket 7 :inline :offset-assert 0) + ((data foreground-bucket 7 :inline) ) - :method-count-assert 9 - :size-assert #x150 - :flag-assert #x900000150 ) ;; definition for method 3 of type foreground-level-buckets -(defmethod inspect foreground-level-buckets ((this foreground-level-buckets)) +(defmethod inspect ((this foreground-level-buckets)) (when (not this) (set! this this) (goto cfg-4) @@ -103,16 +91,13 @@ ;; definition of type foreground-bucket-grid (deftype foreground-bucket-grid (structure) - ((level-buckets foreground-level-buckets 7 :inline :offset-assert 0) - (warp-chain mercneric-chain :inline :offset-assert 2352) + ((level-buckets foreground-level-buckets 7 :inline) + (warp-chain mercneric-chain :inline) ) - :method-count-assert 9 - :size-assert #x944 - :flag-assert #x900000944 ) ;; definition for method 3 of type foreground-bucket-grid -(defmethod inspect foreground-bucket-grid ((this foreground-bucket-grid)) +(defmethod inspect ((this foreground-bucket-grid)) (when (not this) (set! this this) (goto cfg-4) @@ -126,28 +111,25 @@ ;; definition of type foreground-regs (deftype foreground-regs (structure) - ((dist float :offset-assert 0) - (merc-used uint32 :offset-assert 4) - (emerc-used uint32 :offset-assert 8) - (mercneric-used uint32 :offset-assert 12) - (use-isometric uint32 :offset-assert 16) - (base-start dma-packet :offset-assert 20) - (joint-ptr (inline-array joint) :offset-assert 24) - (bone-ptr (inline-array bone) :offset-assert 28) - (num-bones uint32 :offset-assert 32) - (mtxs (inline-array pris-mtx) :offset-assert 36) - (dma-buf dma-buffer :offset-assert 40) - (default-texture-index uint32 :offset-assert 44) - (mercneric-chain mercneric-chain :offset-assert 48) - (level-buckets foreground-level-buckets :offset-assert 52) + ((dist float) + (merc-used uint32) + (emerc-used uint32) + (mercneric-used uint32) + (use-isometric uint32) + (base-start dma-packet) + (joint-ptr (inline-array joint)) + (bone-ptr (inline-array bone)) + (num-bones uint32) + (mtxs (inline-array pris-mtx)) + (dma-buf dma-buffer) + (default-texture-index uint32) + (mercneric-chain mercneric-chain) + (level-buckets foreground-level-buckets) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) ;; definition for method 3 of type foreground-regs -(defmethod inspect foreground-regs ((this foreground-regs)) +(defmethod inspect ((this foreground-regs)) (when (not this) (set! this this) (goto cfg-4) @@ -173,21 +155,18 @@ ;; definition of type foreground-work (deftype foreground-work (structure) - ((regs foreground-regs :inline :offset-assert 0) - (draw-index-map uint8 7 :offset 64) - (grid foreground-bucket-grid :inline :offset-assert 80) - (bounds sphere :inline :offset-assert 2464) - (lights vu-lights :inline :offset-assert 2480) - (distance vector :inline :offset-assert 2592) - (next-tmpl dma-packet :inline :offset-assert 2608) + ((regs foreground-regs :inline) + (draw-index-map uint8 7 :offset 64) + (grid foreground-bucket-grid :inline) + (bounds sphere :inline) + (lights vu-lights :inline) + (distance vector :inline) + (next-tmpl dma-packet :inline) ) - :method-count-assert 9 - :size-assert #xa40 - :flag-assert #x900000a40 ) ;; definition for method 3 of type foreground-work -(defmethod inspect foreground-work ((this foreground-work)) +(defmethod inspect ((this foreground-work)) (when (not this) (set! this this) (goto cfg-4) @@ -218,16 +197,13 @@ ;; definition of type texscroll-globals (deftype texscroll-globals (structure) - ((requests int32 :offset-assert 0) - (effects merc-effect 32 :offset-assert 4) + ((requests int32) + (effects merc-effect 32) ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) ;; definition for method 3 of type texscroll-globals -(defmethod inspect texscroll-globals ((this texscroll-globals)) +(defmethod inspect ((this texscroll-globals)) (when (not this) (set! this this) (goto cfg-4) @@ -241,21 +217,18 @@ ;; definition of type merc-effect-bucket-info (deftype merc-effect-bucket-info (structure) - ((color-fade rgba :offset-assert 0) - (alpha uint8 :offset 3) - (merc-path uint8 :offset-assert 4) - (ignore-alpha uint8 :offset-assert 5) - (disable-draw uint8 :offset-assert 6) - (disable-envmap uint8 :offset-assert 7) + ((color-fade rgba) + (alpha uint8 :offset 3) + (merc-path uint8) + (ignore-alpha uint8) + (disable-draw uint8) + (disable-envmap uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type merc-effect-bucket-info -(defmethod inspect merc-effect-bucket-info ((this merc-effect-bucket-info)) +(defmethod inspect ((this merc-effect-bucket-info)) (when (not this) (set! this this) (goto cfg-4) @@ -272,19 +245,16 @@ ;; definition of type merc-bucket-info (deftype merc-bucket-info (structure) - ((light vu-lights :inline :offset-assert 0) - (needs-clip int32 :offset-assert 112) - (need-mercprime-if-merc int32 :offset-assert 116) - (must-use-mercneric-for-clip int32 :offset-assert 120) - (effect merc-effect-bucket-info 64 :inline :offset-assert 124) + ((light vu-lights :inline) + (needs-clip int32) + (need-mercprime-if-merc int32) + (must-use-mercneric-for-clip int32) + (effect merc-effect-bucket-info 64 :inline) ) - :method-count-assert 9 - :size-assert #x27c - :flag-assert #x90000027c ) ;; definition for method 3 of type merc-bucket-info -(defmethod inspect merc-bucket-info ((this merc-bucket-info)) +(defmethod inspect ((this merc-bucket-info)) (when (not this) (set! this this) (goto cfg-4) @@ -301,17 +271,14 @@ ;; definition of type foreground-globals (deftype foreground-globals (structure) - ((foreground-grid foreground-bucket-grid :inline :offset-assert 0) - (merc-bucket-info merc-bucket-info :inline :offset-assert 2384) - (texscroll texscroll-globals :inline :offset-assert 3024) + ((foreground-grid foreground-bucket-grid :inline) + (merc-bucket-info merc-bucket-info :inline) + (texscroll texscroll-globals :inline) ) - :method-count-assert 9 - :size-assert #xc54 - :flag-assert #x900000c54 ) ;; definition for method 3 of type foreground-globals -(defmethod inspect foreground-globals ((this foreground-globals)) +(defmethod inspect ((this foreground-globals)) (when (not this) (set! this this) (goto cfg-4) @@ -329,19 +296,16 @@ ;; definition of type shadow-dma-packet (deftype shadow-dma-packet (structure) - ((tag generic-merc-tag :inline :offset-assert 0) - (settings shadow-settings :inline :offset-assert 16) - (geo-ref dma-packet :inline :offset-assert 96) - (mtx-ref dma-packet :inline :offset-assert 112) - (end-tag dma-packet :inline :offset-assert 128) + ((tag generic-merc-tag :inline) + (settings shadow-settings :inline) + (geo-ref dma-packet :inline) + (mtx-ref dma-packet :inline) + (end-tag dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) ;; definition for method 3 of type shadow-dma-packet -(defmethod inspect shadow-dma-packet ((this shadow-dma-packet)) +(defmethod inspect ((this shadow-dma-packet)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/lightning-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/lightning-h_REF.gc index 52df44547c4..88e493aabbf 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/lightning-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/lightning-h_REF.gc @@ -3,35 +3,32 @@ ;; definition of type lightning-spec (deftype lightning-spec (basic) - ((name string :offset-assert 4) - (flags lightning-spec-flags :offset-assert 8) - (rand-func uint8 :offset-assert 10) - (adjust-distance uint8 :offset-assert 11) - (start-color rgba :offset-assert 12) - (end-color rgba :offset-assert 16) - (fade-to-color rgba :offset-assert 20) - (fade-start-factor float :offset-assert 24) - (fade-time float :offset-assert 28) - (texture texture-id :offset-assert 32) - (reduction float :offset-assert 36) - (num-points int32 :offset-assert 40) - (box-size float :offset-assert 44) - (merge-factor float :offset-assert 48) - (merge-count int32 :offset-assert 52) - (radius float :offset-assert 56) - (duration float :offset-assert 60) - (duration-rand float :offset-assert 64) - (sound basic :offset-assert 68) - (delay float :offset-assert 72) - (delay-rand float :offset-assert 76) + ((name string) + (flags lightning-spec-flags) + (rand-func uint8) + (adjust-distance uint8) + (start-color rgba) + (end-color rgba) + (fade-to-color rgba) + (fade-start-factor float) + (fade-time float) + (texture texture-id) + (reduction float) + (num-points int32) + (box-size float) + (merge-factor float) + (merge-count int32) + (radius float) + (duration float) + (duration-rand float) + (sound basic) + (delay float) + (delay-rand float) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type lightning-spec -(defmethod inspect lightning-spec ((this lightning-spec)) +(defmethod inspect ((this lightning-spec)) (when (not this) (set! this this) (goto cfg-4) @@ -80,24 +77,21 @@ ;; definition of type lightning-state (deftype lightning-state (structure) - ((mode lightning-mode :offset-assert 0) - (counter float :offset-assert 4) - (points-to-draw int32 :offset-assert 8) - (box-size float :offset-assert 12) - (gcf-control gcf-control :inline :offset-assert 16) - (line vector-array :offset-assert 128) - (meet vector-array :offset-assert 132) - (path vector-array :offset-assert 136) - (start-color rgba :offset-assert 140) - (end-color rgba :offset-assert 144) + ((mode lightning-mode) + (counter float) + (points-to-draw int32) + (box-size float) + (gcf-control gcf-control :inline) + (line vector-array) + (meet vector-array) + (path vector-array) + (start-color rgba) + (end-color rgba) ) - :method-count-assert 9 - :size-assert #x94 - :flag-assert #x900000094 ) ;; definition for method 3 of type lightning-state -(defmethod inspect lightning-state ((this lightning-state)) +(defmethod inspect ((this lightning-state)) (when (not this) (set! this this) (goto cfg-4) @@ -119,25 +113,22 @@ ;; definition of type lightning-control (deftype lightning-control (basic) - ((spec lightning-spec :offset-assert 4) - (process (pointer process) :offset-assert 8) - (state lightning-state :inline :offset-assert 16) + ((spec lightning-spec) + (process (pointer process)) + (state lightning-state :inline) ) - :method-count-assert 14 - :size-assert #xa4 - :flag-assert #xe000000a4 (:methods - (new (symbol type lightning-spec process float) _type_ 0) - (change-mode (_type_ lightning-mode) lightning-mode 9) - (get-mode (_type_) lightning-mode 10) - (set-point! (_type_ int vector) none 11) - (set-first-meet-point (_type_ vector) none 12) - (set-last-meet-point (_type_ vector) none 13) + (new (symbol type lightning-spec process float) _type_) + (change-mode (_type_ lightning-mode) lightning-mode) + (get-mode (_type_) lightning-mode) + (set-point! (_type_ int vector) none) + (set-first-meet-point (_type_ vector) none) + (set-last-meet-point (_type_ vector) none) ) ) ;; definition for method 3 of type lightning-control -(defmethod inspect lightning-control ((this lightning-control)) +(defmethod inspect ((this lightning-control)) (when (not this) (set! this this) (goto cfg-4) @@ -151,7 +142,7 @@ ) ;; definition for method 9 of type lightning-control -(defmethod change-mode lightning-control ((this lightning-control) (arg0 lightning-mode)) +(defmethod change-mode ((this lightning-control) (arg0 lightning-mode)) (let ((v1-1 (!= arg0 (-> this state mode)))) (case arg0 (((lightning-mode lm3)) @@ -170,14 +161,14 @@ ) ;; definition for method 10 of type lightning-control -(defmethod get-mode lightning-control ((this lightning-control)) +(defmethod get-mode ((this lightning-control)) (-> this state mode) ) ;; definition for method 11 of type lightning-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-point! lightning-control ((this lightning-control) (arg0 int) (arg1 vector)) +(defmethod set-point! ((this lightning-control) (arg0 int) (arg1 vector)) (let ((v1-0 (-> this state))) (when (and (-> v1-0 path) (>= arg0 0) (< arg0 (-> v1-0 path length))) (set! (-> v1-0 path data arg0 quad) (-> arg1 quad)) @@ -202,7 +193,7 @@ ;; definition for method 12 of type lightning-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch (inline-array vector) vs none. -(defmethod set-first-meet-point lightning-control ((this lightning-control) (arg0 vector)) +(defmethod set-first-meet-point ((this lightning-control) (arg0 vector)) (set! (-> this state meet data 0 quad) (-> arg0 quad)) (none) ) @@ -210,13 +201,13 @@ ;; definition for method 13 of type lightning-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod set-last-meet-point lightning-control ((this lightning-control) (arg0 vector)) +(defmethod set-last-meet-point ((this lightning-control) (arg0 vector)) (set! (-> this state meet data (+ (-> this state points-to-draw) -1) quad) (-> arg0 quad)) (none) ) ;; definition for method 7 of type lightning-control -(defmethod relocate lightning-control ((this lightning-control) (arg0 int)) +(defmethod relocate ((this lightning-control) (arg0 int)) (&+! (-> this state line) arg0) (&+! (-> this state meet) arg0) (if (-> this state path) @@ -278,21 +269,18 @@ ;; definition of type lightning-probe-vars (deftype lightning-probe-vars (basic) - ((src-joint-index uint32 :offset-assert 4) - (next-spawn-time time-frame :offset-assert 8) - (last-valid-time time-frame :offset-assert 16) - (point vector 2 :inline :offset-assert 32) - (start-pos vector :inline :offset 32) - (end-pos vector :inline :offset 48) - (probe-dirs (inline-array vector) :offset-assert 64) + ((src-joint-index uint32) + (next-spawn-time time-frame) + (last-valid-time time-frame) + (point vector 2 :inline) + (start-pos vector :inline :overlay-at (-> point 0)) + (end-pos vector :inline :overlay-at (-> point 1)) + (probe-dirs (inline-array vector)) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) ;; definition for method 3 of type lightning-probe-vars -(defmethod inspect lightning-probe-vars ((this lightning-probe-vars)) +(defmethod inspect ((this lightning-probe-vars)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/lightning_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/lightning_REF.gc index c3b0327bfb6..21c29b518ff 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/lightning_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/lightning_REF.gc @@ -260,16 +260,13 @@ ;; definition of type lightning-globals (deftype lightning-globals (structure) - ((gcf-buf uint16 :offset-assert 0) - (vtx-buf uint16 :offset-assert 2) + ((gcf-buf uint16) + (vtx-buf uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type lightning-globals -(defmethod inspect lightning-globals ((this lightning-globals)) +(defmethod inspect ((this lightning-globals)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/lights-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/lights-h_REF.gc index 189a98018dc..2d6b6c22c7e 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/lights-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/lights-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type vu-lights (deftype vu-lights (structure) - ((direction vector 3 :inline :offset-assert 0) - (color vector 3 :inline :offset-assert 48) - (ambient vector :inline :offset-assert 96) - (fade-int uint32 :offset 44) - (fade-flags uint32 :offset 28) + ((direction vector 3 :inline) + (color vector 3 :inline) + (ambient vector :inline) + (fade-int uint32 :offset 44) + (fade-flags uint32 :offset 28) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type vu-lights -(defmethod inspect vu-lights ((this vu-lights)) +(defmethod inspect ((this vu-lights)) (when (not this) (set! this this) (goto cfg-4) @@ -30,23 +27,20 @@ ;; definition of type light (deftype light (structure) - ((direction vector :inline :offset-assert 0) - (color rgbaf :inline :offset-assert 16) - (extra vector :inline :offset-assert 32) - (level float :offset 32) - (luminance float :offset 40) - (priority float :offset 44) - (bytes uint8 4 :offset 36) - (mask uint16 :offset 36) - (palette-index int8 :offset 39) + ((direction vector :inline) + (color rgbaf :inline) + (extra vector :inline) + (level float :overlay-at (-> extra data 0)) + (luminance float :overlay-at (-> extra data 2)) + (priority float :overlay-at (-> extra data 3)) + (bytes uint8 4 :overlay-at (-> extra data 1)) + (mask uint16 :overlay-at (-> extra data 1)) + (palette-index int8 :overlay-at (-> bytes 3)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type light -(defmethod inspect light ((this light)) +(defmethod inspect ((this light)) (when (not this) (set! this this) (goto cfg-4) @@ -67,24 +61,21 @@ ;; definition of type light-sphere (deftype light-sphere (structure) - ((name string :offset-assert 0) - (bsphere vector :inline :offset-assert 16) - (direction vector :inline :offset-assert 32) - (color vector :inline :offset-assert 48) - (decay-start float :offset 4) - (ambient-point-ratio float :offset 8) - (brightness float :offset 12) - (bytes uint8 4 :offset 60) - (mask uint16 :offset 60) - (palette-index int8 :offset 63) + ((name string) + (bsphere vector :inline) + (direction vector :inline) + (color vector :inline) + (decay-start float :offset 4) + (ambient-point-ratio float :offset 8) + (brightness float :offset 12) + (bytes uint8 4 :overlay-at (-> color data 3)) + (mask uint16 :overlay-at (-> color data 3)) + (palette-index int8 :overlay-at (-> bytes 3)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type light-sphere -(defmethod inspect light-sphere ((this light-sphere)) +(defmethod inspect ((this light-sphere)) (when (not this) (set! this this) (goto cfg-4) @@ -106,17 +97,14 @@ ;; definition of type light-hash-bucket (deftype light-hash-bucket (structure) - ((index uint16 :offset-assert 0) - (count uint16 :offset-assert 2) + ((index uint16) + (count uint16) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type light-hash-bucket -(defmethod inspect light-hash-bucket ((this light-hash-bucket)) +(defmethod inspect ((this light-hash-bucket)) (when (not this) (set! this this) (goto cfg-4) @@ -130,24 +118,21 @@ ;; definition of type light-hash (deftype light-hash (basic) - ((num-lights uint16 :offset-assert 4) - (num-indices uint16 :offset-assert 6) - (num-buckets uint16 :offset-assert 8) - (bucket-step uint8 2 :offset-assert 10) - (base-trans vector :inline :offset-assert 16) - (axis-scale vector :inline :offset-assert 32) - (dimension-array vector4w :inline :offset-assert 48) - (bucket-array (inline-array light-hash-bucket) :offset-assert 64) - (index-array pointer :offset-assert 68) - (light-sphere-array (inline-array light-sphere) :offset-assert 72) + ((num-lights uint16) + (num-indices uint16) + (num-buckets uint16) + (bucket-step uint8 2) + (base-trans vector :inline) + (axis-scale vector :inline) + (dimension-array vector4w :inline) + (bucket-array (inline-array light-hash-bucket)) + (index-array pointer) + (light-sphere-array (inline-array light-sphere)) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) ;; definition for method 3 of type light-hash -(defmethod inspect light-hash ((this light-hash)) +(defmethod inspect ((this light-hash)) (when (not this) (set! this this) (goto cfg-4) @@ -169,15 +154,12 @@ ;; definition of type light-hash-work (deftype light-hash-work (structure) - ((ones vector4w :inline :offset-assert 0) + ((ones vector4w :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type light-hash-work -(defmethod inspect light-hash-work ((this light-hash-work)) +(defmethod inspect ((this light-hash-work)) (when (not this) (set! this this) (goto cfg-4) @@ -192,7 +174,7 @@ (define *light-hash* (the-as light-hash #f)) ;; definition for method 2 of type light -(defmethod print light ((this light)) +(defmethod print ((this light)) (format #t "# quad 0)) + (tag uint64 :overlay-at (-> quad 0)) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type merc-matrix -(defmethod inspect merc-matrix ((this merc-matrix)) +(defmethod inspect ((this merc-matrix)) (when (not this) (set! this this) (goto cfg-4) @@ -28,17 +25,14 @@ ;; definition of type generic-merc-tag (deftype generic-merc-tag (dma-packet) - ((next-ptr uint32 :offset 12) - (size uint32 :offset 8) + ((next-ptr uint32 :overlay-at vif1) + (size uint32 :overlay-at vif0) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type generic-merc-tag ;; INFO: Used lq/sq -(defmethod inspect generic-merc-tag ((this generic-merc-tag)) +(defmethod inspect ((this generic-merc-tag)) (when (not this) (set! this this) (goto cfg-4) @@ -56,18 +50,15 @@ ;; definition of type generic-merc-ctrl (deftype generic-merc-ctrl (structure) - ((tag generic-merc-tag :inline :offset-assert 0) - (lights vu-lights :inline :offset-assert 16) - (header merc-ctrl-header :inline :offset-assert 128) - (effect merc-effect :inline :offset-assert 256) + ((tag generic-merc-tag :inline) + (lights vu-lights :inline) + (header merc-ctrl-header :inline) + (effect merc-effect :inline) ) - :method-count-assert 9 - :size-assert #x120 - :flag-assert #x900000120 ) ;; definition for method 3 of type generic-merc-ctrl -(defmethod inspect generic-merc-ctrl ((this generic-merc-ctrl)) +(defmethod inspect ((this generic-merc-ctrl)) (when (not this) (set! this this) (goto cfg-4) @@ -83,15 +74,12 @@ ;; definition of type generic-merc-ctrl-with-sfx (deftype generic-merc-ctrl-with-sfx (generic-merc-ctrl) - ((sfx-data uint128 11 :offset-assert 288) + ((sfx-data uint128 11) ) - :method-count-assert 9 - :size-assert #x1d0 - :flag-assert #x9000001d0 ) ;; definition for method 3 of type generic-merc-ctrl-with-sfx -(defmethod inspect generic-merc-ctrl-with-sfx ((this generic-merc-ctrl-with-sfx)) +(defmethod inspect ((this generic-merc-ctrl-with-sfx)) (when (not this) (set! this this) (goto cfg-4) @@ -108,21 +96,18 @@ ;; definition of type generic-merc-input (deftype generic-merc-input (structure) - ((geo-tag generic-merc-tag :inline :offset-assert 0) - (geo-block uint8 1296 :offset-assert 16) - (byte-header merc-byte-header :inline :offset 16) - (matrix merc-matrix 9 :inline :offset-assert 1312) - (control generic-merc-ctrl-with-sfx :inline :offset-assert 2464) - (end-tag generic-merc-tag :inline :offset-assert 2928) - (shader adgif-shader :inline :offset-assert 2944) + ((geo-tag generic-merc-tag :inline) + (geo-block uint8 1296) + (byte-header merc-byte-header :inline :overlay-at (-> geo-block 0)) + (matrix merc-matrix 9 :inline) + (control generic-merc-ctrl-with-sfx :inline) + (end-tag generic-merc-tag :inline) + (shader adgif-shader :inline) ) - :method-count-assert 9 - :size-assert #xbd0 - :flag-assert #x900000bd0 ) ;; definition for method 3 of type generic-merc-input -(defmethod inspect generic-merc-input ((this generic-merc-input)) +(defmethod inspect ((this generic-merc-input)) (when (not this) (set! this this) (goto cfg-4) @@ -141,20 +126,17 @@ ;; definition of type generic-merc-output (deftype generic-merc-output (structure) - ((info gsf-info :inline :offset-assert 0) - (header gsf-header :inline :offset-assert 16) - (index-kick-table uint16 80 :offset-assert 32) - (index-table uint8 160 :offset 32) - (inverse-table uint8 256 :offset-assert 192) - (vertex-table gsf-vertex 72 :inline :offset-assert 448) + ((info gsf-info :inline) + (header gsf-header :inline) + (index-kick-table uint16 80) + (index-table uint8 160 :overlay-at (-> index-kick-table 0)) + (inverse-table uint8 256) + (vertex-table gsf-vertex 72 :inline) ) - :method-count-assert 9 - :size-assert #xac0 - :flag-assert #x900000ac0 ) ;; definition for method 3 of type generic-merc-output -(defmethod inspect generic-merc-output ((this generic-merc-output)) +(defmethod inspect ((this generic-merc-output)) (when (not this) (set! this this) (goto cfg-4) @@ -172,20 +154,17 @@ ;; definition of type generic-merc-dcache (deftype generic-merc-dcache (structure) - ((output-a generic-merc-output :inline :offset-assert 0) - (output-b generic-merc-output :inline :offset-assert 2752) - (inv-table-1 uint8 544 :offset-assert 5504) - (inv-table-7 uint8 544 :offset-assert 6048) - (inv-safety uint8 16 :offset-assert 6592) - (effect-data uint8 1584 :offset-assert 6608) + ((output-a generic-merc-output :inline) + (output-b generic-merc-output :inline) + (inv-table-1 uint8 544) + (inv-table-7 uint8 544) + (inv-safety uint8 16) + (effect-data uint8 1584) ) - :method-count-assert 9 - :size-assert #x2000 - :flag-assert #x900002000 ) ;; definition for method 3 of type generic-merc-dcache -(defmethod inspect generic-merc-dcache ((this generic-merc-dcache)) +(defmethod inspect ((this generic-merc-dcache)) (when (not this) (set! this this) (goto cfg-4) @@ -203,41 +182,38 @@ ;; definition of type gm-shadow (deftype gm-shadow (structure) - ((perspective matrix :inline :offset-assert 0) - (isometric matrix :inline :offset-assert 64) - (inv-camera-rot matrix :inline :offset-assert 128) - (envmap-shader adgif-shader :inline :offset-assert 192) - (current-chain uint32 :offset-assert 272) - (next-chain uint32 :offset-assert 276) - (buf-index uint32 :offset-assert 280) - (fragment-count uint32 :offset-assert 284) - (write-limit int32 :offset-assert 288) - (indexed-input-base generic-merc-input :offset-assert 292) - (other-input-base generic-merc-input :offset-assert 296) - (indexed-output-base generic-merc-output :offset-assert 300) - (other-output-base generic-merc-output :offset-assert 304) - (p-input uint32 :offset-assert 308) - (gsf-buf generic-merc-dcache :offset-assert 312) - (p-fheader merc-fp-header :offset-assert 316) - (curr-chain basic :offset-assert 320) - (mercneric-convert basic :offset-assert 324) - (generic-prepare-dma-single basic :offset-assert 328) - (generic-prepare-dma-double basic :offset-assert 332) - (generic-light-proc basic :offset-assert 336) - (generic-envmap-proc basic :offset-assert 340) - (high-speed-reject basic :offset-assert 344) - (dummy-0 uint32 :offset-assert 348) - (hsr-xmult vector :inline :offset-assert 352) - (hsr-ymult vector :inline :offset-assert 368) - (warp-consts vector :inline :offset-assert 384) + ((perspective matrix :inline) + (isometric matrix :inline) + (inv-camera-rot matrix :inline) + (envmap-shader adgif-shader :inline) + (current-chain uint32) + (next-chain uint32) + (buf-index uint32) + (fragment-count uint32) + (write-limit int32) + (indexed-input-base generic-merc-input) + (other-input-base generic-merc-input) + (indexed-output-base generic-merc-output) + (other-output-base generic-merc-output) + (p-input uint32) + (gsf-buf generic-merc-dcache) + (p-fheader merc-fp-header) + (curr-chain basic) + (mercneric-convert basic) + (generic-prepare-dma-single basic) + (generic-prepare-dma-double basic) + (generic-light-proc basic) + (generic-envmap-proc basic) + (high-speed-reject basic) + (dummy-0 uint32) + (hsr-xmult vector :inline) + (hsr-ymult vector :inline) + (warp-consts vector :inline) ) - :method-count-assert 9 - :size-assert #x190 - :flag-assert #x900000190 ) ;; definition for method 3 of type gm-shadow -(defmethod inspect gm-shadow ((this gm-shadow)) +(defmethod inspect ((this gm-shadow)) (when (not this) (set! this this) (goto cfg-4) @@ -276,19 +252,16 @@ ;; definition of type generic-merc-work (deftype generic-merc-work (structure) - ((input-a generic-merc-input :inline :offset-assert 0) - (input-b generic-merc-input :inline :offset-assert 3024) - (ctrl generic-merc-ctrl-with-sfx :inline :offset-assert 6048) - (shadow gm-shadow :inline :offset-assert 6512) - (stack uint128 16 :offset-assert 6912) + ((input-a generic-merc-input :inline) + (input-b generic-merc-input :inline) + (ctrl generic-merc-ctrl-with-sfx :inline) + (shadow gm-shadow :inline) + (stack uint128 16) ) - :method-count-assert 9 - :size-assert #x1c00 - :flag-assert #x900001c00 ) ;; definition for method 3 of type generic-merc-work -(defmethod inspect generic-merc-work ((this generic-merc-work)) +(defmethod inspect ((this generic-merc-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-death_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-death_REF.gc index 5fb07ea98fc..30fe0f52fab 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-death_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-death_REF.gc @@ -6,19 +6,16 @@ ;; definition of type death-info (deftype death-info (basic) - ((vertex-skip uint16 :offset-assert 4) - (timer uint8 :offset-assert 6) - (overlap uint8 :offset-assert 7) - (effect uint32 :offset-assert 8) - (sound symbol :offset-assert 12) + ((vertex-skip uint16) + (timer uint8) + (overlap uint8) + (effect uint32) + (sound symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type death-info -(defmethod inspect death-info ((this death-info)) +(defmethod inspect ((this death-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-h_REF.gc index 29d9935f95a..24877ebe82e 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type ripple-merc-query (deftype ripple-merc-query (inline-array-class) - ((start-vertex int32 :offset-assert 16) - (vertex-skip int32 :offset-assert 20) - (vertex-count int32 :offset-assert 24) - (current-loc int32 :offset-assert 28) - (data vector :inline :dynamic :offset-assert 32) + ((start-vertex int32) + (vertex-skip int32) + (vertex-count int32) + (current-loc int32) + (data vector :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type ripple-merc-query -(defmethod inspect ripple-merc-query ((this ripple-merc-query)) +(defmethod inspect ((this ripple-merc-query)) (when (not this) (set! this this) (goto cfg-4) @@ -37,28 +34,25 @@ ;; definition of type merc-byte-header (deftype merc-byte-header (structure) - ((srcdest-off uint8 :offset-assert 0) - (rgba-off uint8 :offset-assert 1) - (lump-off uint8 :offset-assert 2) - (fp-off uint8 :offset-assert 3) - (mat1-cnt uint8 :offset-assert 4) - (mat2-cnt uint8 :offset-assert 5) - (mat3-cnt uint8 :offset-assert 6) - (samecopy-cnt uint8 :offset-assert 7) - (crosscopy-cnt uint8 :offset-assert 8) - (strip-len uint8 :offset-assert 9) - (mm-quadword-fp-off uint8 :offset-assert 10) - (mm-quadword-size uint8 :offset-assert 11) - (perc-off uint8 :offset-assert 12) - (mat-slot uint8 10 :offset-assert 13) + ((srcdest-off uint8) + (rgba-off uint8) + (lump-off uint8) + (fp-off uint8) + (mat1-cnt uint8) + (mat2-cnt uint8) + (mat3-cnt uint8) + (samecopy-cnt uint8) + (crosscopy-cnt uint8) + (strip-len uint8) + (mm-quadword-fp-off uint8) + (mm-quadword-size uint8) + (perc-off uint8) + (mat-slot uint8 10) ) - :method-count-assert 9 - :size-assert #x17 - :flag-assert #x900000017 ) ;; definition for method 3 of type merc-byte-header -(defmethod inspect merc-byte-header ((this merc-byte-header)) +(defmethod inspect ((this merc-byte-header)) (when (not this) (set! this this) (goto cfg-4) @@ -84,19 +78,16 @@ ;; definition of type merc-fragment (deftype merc-fragment (structure) - ((header merc-byte-header :inline :offset-assert 0) - (rest uint8 1 :offset-assert 23) + ((header merc-byte-header :inline) + (rest uint8 1) ) - :method-count-assert 10 - :size-assert #x18 - :flag-assert #xa00000018 (:methods - (login-adgifs (_type_) merc-fragment 9) + (login-adgifs (_type_) merc-fragment) ) ) ;; definition for method 3 of type merc-fragment -(defmethod inspect merc-fragment ((this merc-fragment)) +(defmethod inspect ((this merc-fragment)) (when (not this) (set! this this) (goto cfg-4) @@ -110,26 +101,23 @@ ;; definition of type merc-vtx (deftype merc-vtx (structure) - ((mat-0 uint8 :offset-assert 0) - (mat-1 uint8 :offset-assert 1) - (nrm-x uint8 :offset-assert 2) - (pos-x uint8 :offset-assert 3) - (dst-0 uint8 :offset-assert 4) - (dst-1 uint8 :offset-assert 5) - (nrm-y uint8 :offset-assert 6) - (pos-y uint8 :offset-assert 7) - (tex-s uint8 :offset-assert 8) - (tex-t uint8 :offset-assert 9) - (nrm-z uint8 :offset-assert 10) - (pos-z uint8 :offset-assert 11) + ((mat-0 uint8) + (mat-1 uint8) + (nrm-x uint8) + (pos-x uint8) + (dst-0 uint8) + (dst-1 uint8) + (nrm-y uint8) + (pos-y uint8) + (tex-s uint8) + (tex-t uint8) + (nrm-z uint8) + (pos-z uint8) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type merc-vtx -(defmethod inspect merc-vtx ((this merc-vtx)) +(defmethod inspect ((this merc-vtx)) (when (not this) (set! this this) (goto cfg-4) @@ -153,21 +141,18 @@ ;; definition of type merc-fp-header (deftype merc-fp-header (structure) - ((x-add float :offset-assert 0) - (y-add float :offset-assert 4) - (z-add float :offset-assert 8) - (shader-cnt uint8 :offset-assert 12) - (kick-info-offset uint8 :offset-assert 13) - (kick-info-step uint8 :offset-assert 14) - (hword-cnt uint8 :offset-assert 15) + ((x-add float) + (y-add float) + (z-add float) + (shader-cnt uint8) + (kick-info-offset uint8) + (kick-info-step uint8) + (hword-cnt uint8) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type merc-fp-header -(defmethod inspect merc-fp-header ((this merc-fp-header)) +(defmethod inspect ((this merc-fp-header)) (when (not this) (set! this this) (goto cfg-4) @@ -192,17 +177,14 @@ ;; definition of type merc-mat-dest (deftype merc-mat-dest (structure) - ((matrix-number uint8 :offset-assert 0) - (matrix-dest uint8 :offset-assert 1) + ((matrix-number uint8) + (matrix-dest uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition for method 3 of type merc-mat-dest -(defmethod inspect merc-mat-dest ((this merc-mat-dest)) +(defmethod inspect ((this merc-mat-dest)) (when (not this) (set! this this) (goto cfg-4) @@ -216,19 +198,16 @@ ;; definition of type merc-fragment-control (deftype merc-fragment-control (structure) - ((unsigned-four-count uint8 :offset-assert 0) - (lump-four-count uint8 :offset-assert 1) - (fp-qwc uint8 :offset-assert 2) - (mat-xfer-count uint8 :offset-assert 3) - (mat-dest-data merc-mat-dest :inline :dynamic :offset-assert 4) + ((unsigned-four-count uint8) + (lump-four-count uint8) + (fp-qwc uint8) + (mat-xfer-count uint8) + (mat-dest-data merc-mat-dest :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type merc-fragment-control -(defmethod inspect merc-fragment-control ((this merc-fragment-control)) +(defmethod inspect ((this merc-fragment-control)) (when (not this) (set! this this) (goto cfg-4) @@ -245,15 +224,12 @@ ;; definition of type merc-blend-data (deftype merc-blend-data (structure) - ((int8-data int8 :dynamic :offset-assert 0) + ((int8-data int8 :dynamic) ) - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) ;; definition for method 3 of type merc-blend-data -(defmethod inspect merc-blend-data ((this merc-blend-data)) +(defmethod inspect ((this merc-blend-data)) (when (not this) (set! this this) (goto cfg-4) @@ -266,17 +242,14 @@ ;; definition of type merc-blend-ctrl (deftype merc-blend-ctrl (structure) - ((blend-vtx-count uint8 :offset-assert 0) - (nonzero-index-count uint8 :offset-assert 1) - (bt-index uint8 :dynamic :offset-assert 2) + ((blend-vtx-count uint8) + (nonzero-index-count uint8) + (bt-index uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition for method 3 of type merc-blend-ctrl -(defmethod inspect merc-blend-ctrl ((this merc-blend-ctrl)) +(defmethod inspect ((this merc-blend-ctrl)) (when (not this) (set! this this) (goto cfg-4) @@ -291,18 +264,15 @@ ;; definition of type mei-envmap-tint (deftype mei-envmap-tint (structure) - ((fade0 float :offset-assert 0) - (fade1 float :offset-assert 4) - (tint rgba :offset-assert 8) - (dummy int32 :offset-assert 12) + ((fade0 float) + (fade1 float) + (tint rgba) + (dummy int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type mei-envmap-tint -(defmethod inspect mei-envmap-tint ((this mei-envmap-tint)) +(defmethod inspect ((this mei-envmap-tint)) (when (not this) (set! this this) (goto cfg-4) @@ -318,21 +288,18 @@ ;; definition of type mei-texture-scroll (deftype mei-texture-scroll (structure) - ((max-dist float :offset-assert 0) - (st-int-scale uint8 :offset-assert 4) - (time-factor uint8 :offset-assert 5) - (scroll-dir uint8 :offset-assert 6) - (cached-time uint8 :offset-assert 7) - (time-delta uint8 :offset-assert 8) - (dummy uint8 7 :offset-assert 9) + ((max-dist float) + (st-int-scale uint8) + (time-factor uint8) + (scroll-dir uint8) + (cached-time uint8) + (time-delta uint8) + (dummy uint8 7) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type mei-texture-scroll -(defmethod inspect mei-texture-scroll ((this mei-texture-scroll)) +(defmethod inspect ((this mei-texture-scroll)) (when (not this) (set! this this) (goto cfg-4) @@ -351,18 +318,15 @@ ;; definition of type mei-ripple (deftype mei-ripple (structure) - ((x-base float :offset-assert 0) - (z-base float :offset-assert 4) - (grid-size float :offset-assert 8) - (angle float :offset-assert 12) + ((x-base float) + (z-base float) + (grid-size float) + (angle float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type mei-ripple -(defmethod inspect mei-ripple ((this mei-ripple)) +(defmethod inspect ((this mei-ripple)) (when (not this) (set! this this) (goto cfg-4) @@ -378,19 +342,16 @@ ;; definition of type merc-extra-info (deftype merc-extra-info (structure) - ((envmap-tint-offset uint8 :offset-assert 0) - (shader-offset uint8 :offset-assert 1) - (texture-scroll-offset uint8 :offset-assert 2) - (ripple-offset uint8 :offset-assert 3) - (dummy uint8 12 :offset-assert 4) + ((envmap-tint-offset uint8) + (shader-offset uint8) + (texture-scroll-offset uint8) + (ripple-offset uint8) + (dummy uint8 12) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type merc-extra-info -(defmethod inspect merc-extra-info ((this merc-extra-info)) +(defmethod inspect ((this merc-extra-info)) (when (not this) (set! this this) (goto cfg-4) @@ -407,30 +368,27 @@ ;; definition of type merc-effect (deftype merc-effect (structure) - ((frag-geo merc-fragment :offset-assert 0) - (frag-ctrl merc-fragment-control :offset-assert 4) - (blend-data merc-blend-data :offset-assert 8) - (blend-ctrl merc-blend-ctrl :offset-assert 12) - (merc-effect-version uint8 :offset-assert 16) - (effect-bits effect-bits :offset-assert 17) - (frag-count uint16 :offset-assert 18) - (blend-frag-count uint16 :offset-assert 20) - (tri-count uint16 :offset-assert 22) - (dvert-count uint16 :offset-assert 24) - (texture-index uint8 :offset-assert 26) - (effect-usage uint8 :offset-assert 27) - (extra-info merc-extra-info :offset-assert 28) + ((frag-geo merc-fragment) + (frag-ctrl merc-fragment-control) + (blend-data merc-blend-data) + (blend-ctrl merc-blend-ctrl) + (merc-effect-version uint8) + (effect-bits effect-bits) + (frag-count uint16) + (blend-frag-count uint16) + (tri-count uint16) + (dvert-count uint16) + (texture-index uint8) + (effect-usage uint8) + (extra-info merc-extra-info) ) - :method-count-assert 10 - :size-assert #x20 - :flag-assert #xa00000020 (:methods - (login-adgifs (_type_) none 9) + (login-adgifs (_type_) none) ) ) ;; definition for method 3 of type merc-effect -(defmethod inspect merc-effect ((this merc-effect)) +(defmethod inspect ((this merc-effect)) (when (not this) (set! this this) (goto cfg-4) @@ -455,24 +413,21 @@ ;; definition of type merc-eye-ctrl (deftype merc-eye-ctrl (structure) - ((eye-slot int8 :offset-assert 0) - (shader-offset int8 :offset-assert 1) - (shader-count int8 :offset-assert 2) - (shader adgif-shader 6 :inline :offset-assert 16) - (left-iris-shader adgif-shader :inline :offset 16) - (left-pupil-shader adgif-shader :inline :offset 96) - (left-lid-shader adgif-shader :inline :offset 176) - (right-iris-shader adgif-shader :inline :offset 256) - (right-pupil-shader adgif-shader :inline :offset 336) - (right-lid-shader adgif-shader :inline :offset 416) + ((eye-slot int8) + (shader-offset int8) + (shader-count int8) + (shader adgif-shader 6 :inline) + (left-iris-shader adgif-shader :inline :overlay-at (-> shader 0)) + (left-pupil-shader adgif-shader :inline :overlay-at (-> shader 1)) + (left-lid-shader adgif-shader :inline :overlay-at (-> shader 2)) + (right-iris-shader adgif-shader :inline :overlay-at (-> shader 3)) + (right-pupil-shader adgif-shader :inline :overlay-at (-> shader 4)) + (right-lid-shader adgif-shader :inline :overlay-at (-> shader 5)) ) - :method-count-assert 9 - :size-assert #x1f0 - :flag-assert #x9000001f0 ) ;; definition for method 3 of type merc-eye-ctrl -(defmethod inspect merc-eye-ctrl ((this merc-eye-ctrl)) +(defmethod inspect ((this merc-eye-ctrl)) (when (not this) (set! this this) (goto cfg-4) @@ -494,22 +449,19 @@ ;; definition of type merc-eye-anim-frame (deftype merc-eye-anim-frame (structure) - ((pupil-trans-x int8 :offset-assert 0) - (pupil-trans-y int8 :offset-assert 1) - (blink int8 :offset-assert 2) - (iris-scale int8 :offset 4) - (pupil-scale int8 :offset 5) - (lid-scale int8 :offset 6) - (dword uint64 :offset 0) + ((pupil-trans-x int8) + (pupil-trans-y int8) + (blink int8) + (iris-scale int8 :offset 4) + (pupil-scale int8 :offset 5) + (lid-scale int8 :offset 6) + (dword uint64 :overlay-at pupil-trans-x) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type merc-eye-anim-frame -(defmethod inspect merc-eye-anim-frame ((this merc-eye-anim-frame)) +(defmethod inspect ((this merc-eye-anim-frame)) (when (not this) (set! this this) (goto cfg-4) @@ -528,16 +480,13 @@ ;; definition of type merc-eye-anim-block (deftype merc-eye-anim-block (structure) - ((max-frame int16 :offset-assert 0) - (data merc-eye-anim-frame :inline :dynamic :offset-assert 8) + ((max-frame int16) + (data merc-eye-anim-frame :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type merc-eye-anim-block -(defmethod inspect merc-eye-anim-block ((this merc-eye-anim-block)) +(defmethod inspect ((this merc-eye-anim-block)) (when (not this) (set! this this) (goto cfg-4) @@ -551,15 +500,12 @@ ;; definition of type texture-usage-group (deftype texture-usage-group (structure) - ((data texture-masks 7 :inline :offset-assert 0) + ((data texture-masks 7 :inline) ) - :method-count-assert 9 - :size-assert #x150 - :flag-assert #x900000150 ) ;; definition for method 3 of type texture-usage-group -(defmethod inspect texture-usage-group ((this texture-usage-group)) +(defmethod inspect ((this texture-usage-group)) (when (not this) (set! this this) (goto cfg-4) @@ -572,61 +518,58 @@ ;; definition of type merc-ctrl-header (deftype merc-ctrl-header (structure) - ((xyz-scale float :offset-assert 0) - (st-magic uint32 :offset-assert 4) - (st-out-a uint32 :offset-assert 8) - (st-out-b uint32 :offset-assert 12) - (st-vif-add uint32 :offset-assert 16) - (st-int-off uint16 :offset-assert 20) - (st-int-scale uint16 :offset-assert 22) - (effect-count uint32 :offset-assert 24) - (blend-target-count uint32 :offset-assert 28) - (fragment-count uint16 :offset-assert 32) - (tri-count uint16 :offset-assert 34) - (matrix-count uint8 :offset-assert 36) - (shader-count uint8 :offset-assert 37) - (transform-vertex-count uint16 :offset-assert 38) - (dvert-count uint16 :offset-assert 40) - (one-mat-count uint16 :offset-assert 42) - (two-mat-count uint16 :offset-assert 44) - (two-mat-reuse-count uint16 :offset-assert 46) - (three-mat-count uint16 :offset-assert 48) - (three-mat-reuse-count uint16 :offset-assert 50) - (shader-upload-count uint8 :offset-assert 52) - (matrix-upload-count uint8 :offset-assert 53) - (same-copy-count uint16 :offset-assert 54) - (cross-copy-count uint16 :offset-assert 56) - (num-verts uint16 :offset-assert 58) - (longest-edge float :offset-assert 60) - (eye-ctrl merc-eye-ctrl :offset-assert 64) - (pad uint32 3 :offset-assert 68) - (masks-padding texture-masks :inline :offset-assert 80) - (texture-usage-group texture-usage-group :offset 80) - (dummy-bytes uint8 :dynamic :offset 32) - (envmap-tint uint32 :offset 32) - (query basic :offset 36) - (needs-clip uint8 :offset 40) - (use-isometric uint8 :offset 41) - (use-attached-shader uint8 :offset 42) - (display-triangles uint8 :offset 43) - (death-vertex-skip uint16 :offset 44) - (death-start-vertex uint16 :offset 46) - (death-effect uint32 :offset 48) - (use-translucent uint8 :offset 52) - (display-this-fragment uint8 :offset 53) - (use-warp uint8 :offset 54) - (ignore-alpha uint8 :offset 55) - (force-fade uint8 :offset 56) - (disable-fog uint8 :offset 57) - (disable-envmap uint8 :offset 58) + ((xyz-scale float) + (st-magic uint32) + (st-out-a uint32) + (st-out-b uint32) + (st-vif-add uint32) + (st-int-off uint16) + (st-int-scale uint16) + (effect-count uint32) + (blend-target-count uint32) + (fragment-count uint16) + (tri-count uint16) + (matrix-count uint8) + (shader-count uint8) + (transform-vertex-count uint16) + (dvert-count uint16) + (one-mat-count uint16) + (two-mat-count uint16) + (two-mat-reuse-count uint16) + (three-mat-count uint16) + (three-mat-reuse-count uint16) + (shader-upload-count uint8) + (matrix-upload-count uint8) + (same-copy-count uint16) + (cross-copy-count uint16) + (num-verts uint16) + (longest-edge float) + (eye-ctrl merc-eye-ctrl) + (pad uint32 3) + (masks-padding texture-masks :inline) + (texture-usage-group texture-usage-group :overlay-at (-> masks-padding data 0 mask data 0)) + (dummy-bytes uint8 :dynamic :overlay-at fragment-count) + (envmap-tint uint32 :overlay-at fragment-count) + (query basic :overlay-at matrix-count) + (needs-clip uint8 :overlay-at dvert-count) + (use-isometric uint8 :offset 41) + (use-attached-shader uint8 :overlay-at one-mat-count) + (display-triangles uint8 :offset 43) + (death-vertex-skip uint16 :overlay-at two-mat-count) + (death-start-vertex uint16 :overlay-at two-mat-reuse-count) + (death-effect uint32 :overlay-at three-mat-count) + (use-translucent uint8 :overlay-at shader-upload-count) + (display-this-fragment uint8 :overlay-at matrix-upload-count) + (use-warp uint8 :overlay-at same-copy-count) + (ignore-alpha uint8 :offset 55) + (force-fade uint8 :overlay-at cross-copy-count) + (disable-fog uint8 :offset 57) + (disable-envmap uint8 :overlay-at num-verts) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type merc-ctrl-header -(defmethod inspect merc-ctrl-header ((this merc-ctrl-header)) +(defmethod inspect ((this merc-ctrl-header)) (when (not this) (set! this this) (goto cfg-4) @@ -685,18 +628,15 @@ ;; definition of type merc-ctrl (deftype merc-ctrl (art-element) - ((num-joints int32 :offset 20) - (seg-table (array uint64) :offset 24) - (header merc-ctrl-header :inline :offset-assert 32) - (effect merc-effect :inline :dynamic :offset-assert 160) + ((num-joints int32 :overlay-at (-> pad 0)) + (seg-table (array uint64) :overlay-at (-> pad 4)) + (header merc-ctrl-header :inline) + (effect merc-effect :inline :dynamic) ) - :method-count-assert 13 - :size-assert #xa0 - :flag-assert #xd000000a0 ) ;; definition for method 3 of type merc-ctrl -(defmethod inspect merc-ctrl ((this merc-ctrl)) +(defmethod inspect ((this merc-ctrl)) (when (not this) (set! this this) (goto cfg-4) @@ -715,19 +655,16 @@ ;; definition of type merc-vu1-low-mem (deftype merc-vu1-low-mem (structure) - ((tri-strip-gif gs-gif-tag :inline :offset-assert 0) - (ad-gif gs-gif-tag :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (perspective uint128 4 :offset-assert 48) - (fog vector :inline :offset-assert 112) + ((tri-strip-gif gs-gif-tag :inline) + (ad-gif gs-gif-tag :inline) + (hvdf-offset vector :inline) + (perspective uint128 4) + (fog vector :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type merc-vu1-low-mem -(defmethod inspect merc-vu1-low-mem ((this merc-vu1-low-mem)) +(defmethod inspect ((this merc-vu1-low-mem)) (when (not this) (set! this this) (goto cfg-4) @@ -744,20 +681,17 @@ ;; definition of type emerc-vu1-low-mem (deftype emerc-vu1-low-mem (structure) - ((tri-strip-gif gs-gif-tag :inline :offset-assert 0) - (ad-gif gs-gif-tag :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (perspective vector 4 :inline :offset-assert 48) - (fog vector :inline :offset-assert 112) - (unperspect vector :inline :offset-assert 128) + ((tri-strip-gif gs-gif-tag :inline) + (ad-gif gs-gif-tag :inline) + (hvdf-offset vector :inline) + (perspective vector 4 :inline) + (fog vector :inline) + (unperspect vector :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) ;; definition for method 3 of type emerc-vu1-low-mem -(defmethod inspect emerc-vu1-low-mem ((this emerc-vu1-low-mem)) +(defmethod inspect ((this emerc-vu1-low-mem)) (when (not this) (set! this this) (goto cfg-4) @@ -775,23 +709,20 @@ ;; definition of type ripple-wave (deftype ripple-wave (structure) - ((scale float :offset-assert 0) - (offs float :offset-assert 4) - (xdiv int16 :offset-assert 8) - (zdiv int16 :offset-assert 10) - (speed float :offset-assert 12) - (xmul float :offset-assert 16) - (zmul float :offset-assert 20) - (delta float :offset-assert 24) + ((scale float) + (offs float) + (xdiv int16) + (zdiv int16) + (speed float) + (xmul float) + (zmul float) + (delta float) ) :pack-me - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type ripple-wave -(defmethod inspect ripple-wave ((this ripple-wave)) +(defmethod inspect ((this ripple-wave)) (when (not this) (set! this this) (goto cfg-4) @@ -811,19 +742,16 @@ ;; definition of type ripple-wave-set (deftype ripple-wave-set (basic) - ((count int32 :offset-assert 4) - (converted basic :offset-assert 8) - (normal-scale float :offset-assert 12) - (wave ripple-wave 4 :inline :offset-assert 16) - (frame-save uint64 :offset-assert 128) + ((count int32) + (converted basic) + (normal-scale float) + (wave ripple-wave 4 :inline) + (frame-save uint64) ) - :method-count-assert 9 - :size-assert #x88 - :flag-assert #x900000088 ) ;; definition for method 3 of type ripple-wave-set -(defmethod inspect ripple-wave-set ((this ripple-wave-set)) +(defmethod inspect ((this ripple-wave-set)) (when (not this) (set! this this) (goto cfg-4) @@ -840,26 +768,23 @@ ;; definition of type ripple-control (deftype ripple-control (basic) - ((global-scale float :offset-assert 4) - (last-frame-scale float :offset-assert 8) - (close-fade-dist float :offset-assert 12) - (far-fade-dist float :offset-assert 16) - (faded-scale float :offset-assert 20) - (individual-normal-scale float :offset-assert 24) - (waveform ripple-wave-set :offset-assert 28) - (send-query symbol :offset-assert 32) - (query ripple-merc-query :offset-assert 36) + ((global-scale float) + (last-frame-scale float) + (close-fade-dist float) + (far-fade-dist float) + (faded-scale float) + (individual-normal-scale float) + (waveform ripple-wave-set) + (send-query symbol) + (query ripple-merc-query) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type ripple-control -(defmethod inspect ripple-control ((this ripple-control)) +(defmethod inspect ((this ripple-control)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc_REF.gc index b9fb5a9b446..2eb2d5463e8 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc_REF.gc @@ -3,19 +3,16 @@ ;; definition of type texture-login-data (deftype texture-login-data (structure) - ((default-texture-index int32 :offset-assert 0) - (current-texture-index int32 :offset-assert 4) - (texture-usage-group texture-usage-group :offset-assert 8) - (merc-ctrl-header merc-ctrl-header :offset-assert 12) - (name basic :offset-assert 16) + ((default-texture-index int32) + (current-texture-index int32) + (texture-usage-group texture-usage-group) + (merc-ctrl-header merc-ctrl-header) + (name basic) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type texture-login-data -(defmethod inspect texture-login-data ((this texture-login-data)) +(defmethod inspect ((this texture-login-data)) (when (not this) (set! this this) (goto cfg-4) @@ -34,7 +31,7 @@ (define *texture-login-data* (new 'global 'texture-login-data)) ;; definition for method 9 of type art-joint-geo -(defmethod login art-joint-geo ((this art-joint-geo)) +(defmethod login ((this art-joint-geo)) (let ((s5-0 *texture-login-data*)) (set! (-> s5-0 default-texture-index) (res-lump-value (-> this extra) 'texture-bucket int :default (the-as uint128 1) :time -1000000000.0) @@ -99,12 +96,12 @@ ;; definition for method 5 of type merc-fragment ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of merc-fragment ((this merc-fragment)) +(defmethod asize-of ((this merc-fragment)) (the-as int (* (-> this header mm-quadword-size) 16)) ) ;; definition for method 9 of type merc-fragment -(defmethod login-adgifs merc-fragment ((this merc-fragment)) +(defmethod login-adgifs ((this merc-fragment)) (let* ((s5-0 (merc-fragment-fp-data this)) (v1-1 (-> *texture-login-data* merc-ctrl-header)) (s4-0 (if (nonzero? (-> v1-1 eye-ctrl)) @@ -208,12 +205,12 @@ ;; definition for method 5 of type merc-fragment-control ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of merc-fragment-control ((this merc-fragment-control)) +(defmethod asize-of ((this merc-fragment-control)) (the-as int (+ (* (-> this mat-xfer-count) 2) 4)) ) ;; definition for method 3 of type merc-fragment-control -(defmethod inspect merc-fragment-control ((this merc-fragment-control)) +(defmethod inspect ((this merc-fragment-control)) (format #t "[~8x] ~A~%" this 'merc-fragment-control) (format #t "~Tunsigned-four-count: ~D~%" (-> this unsigned-four-count)) (format #t "~Tlump-four-count: ~D~%" (-> this lump-four-count)) @@ -229,7 +226,7 @@ ;; definition for method 9 of type merc-effect ;; WARN: Return type mismatch merc-effect vs none. -(defmethod login-adgifs merc-effect ((this merc-effect)) +(defmethod login-adgifs ((this merc-effect)) (let* ((data *texture-login-data*) (a0-1 (-> data default-texture-index)) ) @@ -269,7 +266,7 @@ ) ;; definition for method 3 of type merc-ctrl -(defmethod inspect merc-ctrl ((this merc-ctrl)) +(defmethod inspect ((this merc-ctrl)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -284,7 +281,7 @@ ) ;; definition for method 8 of type merc-ctrl -(defmethod mem-usage merc-ctrl ((this merc-ctrl) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this merc-ctrl) (arg0 memory-usage-block) (arg1 int)) (if (-> this extra) (mem-usage (-> this extra) arg0 arg1) ) @@ -352,7 +349,7 @@ ) ;; definition for method 9 of type merc-ctrl -(defmethod login merc-ctrl ((this merc-ctrl)) +(defmethod login ((this merc-ctrl)) (set! (-> *kernel-context* login-object) this) (texture-usage-init this) (dotimes (s5-0 (the-as int (-> this header effect-count))) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/ripple_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/ripple_REF.gc index e90579867ae..65d1958316c 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/ripple_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/ripple_REF.gc @@ -3,17 +3,14 @@ ;; definition of type ripple-request (deftype ripple-request (structure) - ((waveform ripple-wave :offset-assert 0) - (effect merc-effect :offset-assert 4) + ((waveform ripple-wave) + (effect merc-effect) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type ripple-request -(defmethod inspect ripple-request ((this ripple-request)) +(defmethod inspect ((this ripple-request)) (when (not this) (set! this this) (goto cfg-4) @@ -27,16 +24,13 @@ ;; definition of type ripple-globals (deftype ripple-globals (structure) - ((count int32 :offset-assert 0) - (requests ripple-request 16 :inline :offset-assert 4) + ((count int32) + (requests ripple-request 16 :inline) ) - :method-count-assert 9 - :size-assert #x84 - :flag-assert #x900000084 ) ;; definition for method 3 of type ripple-globals -(defmethod inspect ripple-globals ((this ripple-globals)) +(defmethod inspect ((this ripple-globals)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-cpu_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-cpu_REF.gc index b5b8374c05b..2291c691817 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-cpu_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-cpu_REF.gc @@ -3,12 +3,12 @@ ;; definition for method 5 of type shadow-geo ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of shadow-geo ((this shadow-geo)) +(defmethod asize-of ((this shadow-geo)) (the-as int (* (-> this total-qwc) 16)) ) ;; definition for method 8 of type shadow-geo -(defmethod mem-usage shadow-geo ((this shadow-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this shadow-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 111 (-> arg0 length))) (set! (-> arg0 data 110 name) "shadow-geo") (+! (-> arg0 data 110 count) 1) @@ -494,20 +494,17 @@ ;; definition of type shadow-stats (deftype shadow-stats (structure) - ((num-single-tris uint32 :offset-assert 0) - (num-double-tris uint32 :offset-assert 4) - (num-single-edges uint32 :offset-assert 8) - (num-double-edges uint32 :offset-assert 12) - (num-fragments uint16 :offset-assert 16) - (num-objects uint16 :offset-assert 18) + ((num-single-tris uint32) + (num-double-tris uint32) + (num-single-edges uint32) + (num-double-edges uint32) + (num-fragments uint16) + (num-objects uint16) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type shadow-stats -(defmethod inspect shadow-stats ((this shadow-stats)) +(defmethod inspect ((this shadow-stats)) (when (not this) (set! this this) (goto cfg-4) @@ -525,35 +522,32 @@ ;; definition of type shadow-dcache (deftype shadow-dcache (structure) - ((vtx-table uint32 :offset-assert 0) - (single-edge-table uint32 :offset-assert 4) - (double-edge-table uint32 :offset-assert 8) - (double-tri-table uint32 :offset-assert 12) - (dcache-top uint32 :offset-assert 16) - (num-facing-single-tris uint32 :offset-assert 20) - (num-single-edges uint32 :offset-assert 24) - (num-double-edges uint32 :offset-assert 28) - (single-tri-list uint32 :offset-assert 32) - (single-edge-list uint32 :offset-assert 36) - (double-edge-list uint32 :offset-assert 40) - (ptr-dual-verts uint32 :offset-assert 44) - (stats shadow-stats :inline :offset-assert 48) - (frag-qwc uint32 :offset-assert 68) - (center vector :inline :offset-assert 80) - (plane vector :inline :offset-assert 96) - (top-plane vector :inline :offset-assert 112) - (near-plane vector :inline :offset-assert 128) - (light-dir vector :inline :offset-assert 144) - (vtx-min vector :inline :offset-assert 160) - (data uint8 :dynamic :offset-assert 176) + ((vtx-table uint32) + (single-edge-table uint32) + (double-edge-table uint32) + (double-tri-table uint32) + (dcache-top uint32) + (num-facing-single-tris uint32) + (num-single-edges uint32) + (num-double-edges uint32) + (single-tri-list uint32) + (single-edge-list uint32) + (double-edge-list uint32) + (ptr-dual-verts uint32) + (stats shadow-stats :inline) + (frag-qwc uint32) + (center vector :inline) + (plane vector :inline) + (top-plane vector :inline) + (near-plane vector :inline) + (light-dir vector :inline) + (vtx-min vector :inline) + (data uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #xb0 - :flag-assert #x9000000b0 ) ;; definition for method 3 of type shadow-dcache -(defmethod inspect shadow-dcache ((this shadow-dcache)) +(defmethod inspect ((this shadow-dcache)) (when (not this) (set! this this) (goto cfg-4) @@ -649,7 +643,7 @@ ;; definition for method 14 of type shadow-control ;; WARN: Return type mismatch int vs none. -(defmethod shadow-control-method-14 shadow-control ((this shadow-control) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 float)) +(defmethod shadow-control-method-14 ((this shadow-control) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 float)) (let ((gp-0 (-> this settings))) (let ((s4-0 (-> gp-0 shadow-dir))) (vector-normalize-copy! s4-0 arg1 1.0) @@ -880,7 +874,7 @@ ;; definition for method 13 of type shadow-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod shadow-control-method-13 shadow-control ((this shadow-control) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod shadow-control-method-13 ((this shadow-control) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (with-pp (let ((s4-0 (new 'stack-no-clear 'collide-query))) (let ((v1-0 pp)) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-vu1_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-vu1_REF.gc index 00e3f535ae8..98eba96f845 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-vu1_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-vu1_REF.gc @@ -3,26 +3,23 @@ ;; definition of type shadow-vu1-constants (deftype shadow-vu1-constants (structure) - ((hmgescale vector :inline :offset-assert 0) - (invhscale vector :inline :offset-assert 16) - (texoffset vector :inline :offset-assert 32) - (texscale vector :inline :offset-assert 48) - (hvdfoff vector :inline :offset-assert 64) - (fog vector :inline :offset-assert 80) - (clrs vector 2 :inline :offset-assert 96) - (adgif gs-gif-tag :inline :offset-assert 128) - (texflush gs-adcmd :inline :offset-assert 144) - (flush gs-adcmd :inline :offset-assert 160) - (trigif gs-gif-tag :inline :offset-assert 176) - (quadgif gs-gif-tag :inline :offset-assert 192) + ((hmgescale vector :inline) + (invhscale vector :inline) + (texoffset vector :inline) + (texscale vector :inline) + (hvdfoff vector :inline) + (fog vector :inline) + (clrs vector 2 :inline) + (adgif gs-gif-tag :inline) + (texflush gs-adcmd :inline) + (flush gs-adcmd :inline) + (trigif gs-gif-tag :inline) + (quadgif gs-gif-tag :inline) ) - :method-count-assert 9 - :size-assert #xd0 - :flag-assert #x9000000d0 ) ;; definition for method 3 of type shadow-vu1-constants -(defmethod inspect shadow-vu1-constants ((this shadow-vu1-constants)) +(defmethod inspect ((this shadow-vu1-constants)) (when (not this) (set! this this) (goto cfg-4) @@ -46,22 +43,19 @@ ;; definition of type shadow-vu1-data (deftype shadow-vu1-data (structure) - ((adgif gs-gif-tag :inline :offset-assert 0) - (ad gs-adcmd :inline :offset-assert 16) - (flush gs-adcmd :inline :offset-assert 32) - (trigif gs-gif-tag :inline :offset-assert 48) - (quadgif gs-gif-tag :inline :offset-assert 64) - (texoffset vector :inline :offset-assert 80) - (texscale vector :inline :offset-assert 96) - (clrs qword 2 :inline :offset-assert 112) + ((adgif gs-gif-tag :inline) + (ad gs-adcmd :inline) + (flush gs-adcmd :inline) + (trigif gs-gif-tag :inline) + (quadgif gs-gif-tag :inline) + (texoffset vector :inline) + (texscale vector :inline) + (clrs qword 2 :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) ;; definition for method 3 of type shadow-vu1-data -(defmethod inspect shadow-vu1-data ((this shadow-vu1-data)) +(defmethod inspect ((this shadow-vu1-data)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/generic/generic-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/generic/generic-h_REF.gc index 25808f75f6c..1e2efc4c5ad 100644 --- a/test/decompiler/reference/jak2/engine/gfx/generic/generic-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/generic/generic-h_REF.gc @@ -3,26 +3,23 @@ ;; definition of type gsf-vertex (deftype gsf-vertex (structure) - ((data uint32 8 :offset-assert 0) - (byte uint8 32 :offset 0) - (quad uint128 2 :offset 0) - (vt qword :inline :offset 0) - (pos vector3s :inline :offset 0) - (tex vector2uh :inline :offset 12) - (nrm vector3s :inline :offset 16) - (nc qword :inline :offset 16) - (clr vector4ub :inline :offset 28) - (dtex vector2uh :inline :offset 16) - (dclr vector4ub :inline :offset 20) + ((data uint32 8) + (byte uint8 32 :overlay-at (-> data 0)) + (quad uint128 2 :overlay-at (-> data 0)) + (vt qword :inline :overlay-at (-> data 0)) + (pos vector3s :inline :overlay-at (-> data 0)) + (tex vector2uh :inline :overlay-at (-> data 3)) + (nrm vector3s :inline :overlay-at (-> data 4)) + (nc qword :inline :overlay-at (-> data 4)) + (clr vector4ub :inline :overlay-at (-> data 7)) + (dtex vector2uh :inline :overlay-at (-> data 4)) + (dclr vector4ub :inline :overlay-at (-> data 5)) ) :pack-me - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type gsf-vertex -(defmethod inspect gsf-vertex ((this gsf-vertex)) +(defmethod inspect ((this gsf-vertex)) (when (not this) (set! this this) (goto cfg-4) @@ -45,15 +42,12 @@ ;; definition of type gsf-vertex-array (deftype gsf-vertex-array (structure) - ((vtx gsf-vertex :dynamic :offset-assert 0) + ((vtx gsf-vertex :dynamic) ) - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) ;; definition for method 3 of type gsf-vertex-array -(defmethod inspect gsf-vertex-array ((this gsf-vertex-array)) +(defmethod inspect ((this gsf-vertex-array)) (when (not this) (set! this this) (goto cfg-4) @@ -66,16 +60,13 @@ ;; definition of type gsf-fx-vertex (deftype gsf-fx-vertex (structure) - ((clr vector4ub :inline :offset-assert 0) - (tex vector2uh :inline :offset-assert 4) + ((clr vector4ub :inline) + (tex vector2uh :inline) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type gsf-fx-vertex -(defmethod inspect gsf-fx-vertex ((this gsf-fx-vertex)) +(defmethod inspect ((this gsf-fx-vertex)) (when (not this) (set! this this) (goto cfg-4) @@ -89,15 +80,12 @@ ;; definition of type gsf-fx-vertex-array (deftype gsf-fx-vertex-array (structure) - ((data gsf-fx-vertex :dynamic :offset-assert 0) + ((data gsf-fx-vertex :dynamic) ) - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) ;; definition for method 3 of type gsf-fx-vertex-array -(defmethod inspect gsf-fx-vertex-array ((this gsf-fx-vertex-array)) +(defmethod inspect ((this gsf-fx-vertex-array)) (when (not this) (set! this this) (goto cfg-4) @@ -110,19 +98,16 @@ ;; definition of type gsf-header (deftype gsf-header (structure) - ((num-strips uint8 :offset-assert 0) - (num-new-vtxs uint8 :offset-assert 1) - (num-dps uint16 :offset-assert 2) - (num-vtxs uint16 :offset-assert 4) - (strip-table uint8 10 :offset-assert 6) + ((num-strips uint8) + (num-new-vtxs uint8) + (num-dps uint16) + (num-vtxs uint16) + (strip-table uint8 10) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gsf-header -(defmethod inspect gsf-header ((this gsf-header)) +(defmethod inspect ((this gsf-header)) (when (not this) (set! this this) (goto cfg-4) @@ -139,16 +124,13 @@ ;; definition of type gsf-ik (deftype gsf-ik (structure) - ((index uint8 :offset-assert 0) - (no-kick uint8 :offset-assert 1) + ((index uint8) + (no-kick uint8) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition for method 3 of type gsf-ik -(defmethod inspect gsf-ik ((this gsf-ik)) +(defmethod inspect ((this gsf-ik)) (when (not this) (set! this this) (goto cfg-4) @@ -162,18 +144,15 @@ ;; definition of type gsf-info (deftype gsf-info (structure) - ((ptr-iks uint32 :offset-assert 0) - (ptr-verts uint32 :offset-assert 4) - (ptr-fx uint32 :offset-assert 8) - (dummy2 uint32 :offset-assert 12) + ((ptr-iks uint32) + (ptr-verts uint32) + (ptr-fx uint32) + (dummy2 uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gsf-info -(defmethod inspect gsf-info ((this gsf-info)) +(defmethod inspect ((this gsf-info)) (when (not this) (set! this this) (goto cfg-4) @@ -189,18 +168,15 @@ ;; definition of type gsf-buffer (deftype gsf-buffer (structure) - ((data uint8 8192 :offset-assert 0) - (info gsf-info :inline :offset 0) - (header gsf-header :inline :offset 16) - (work-area uint8 :dynamic :offset 32) + ((data uint8 8192) + (info gsf-info :inline :overlay-at (-> data 0)) + (header gsf-header :inline :overlay-at (-> data 16)) + (work-area uint8 :dynamic :overlay-at (-> data 32)) ) - :method-count-assert 9 - :size-assert #x2000 - :flag-assert #x900002000 ) ;; definition for method 3 of type gsf-buffer -(defmethod inspect gsf-buffer ((this gsf-buffer)) +(defmethod inspect ((this gsf-buffer)) (when (not this) (set! this this) (goto cfg-4) @@ -216,16 +192,13 @@ ;; definition of type generic-frag (deftype generic-frag (structure) - ((start-pos uint16 :offset-assert 0) - (end-pos uint16 :offset-assert 2) + ((start-pos uint16) + (end-pos uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type generic-frag -(defmethod inspect generic-frag ((this generic-frag)) +(defmethod inspect ((this generic-frag)) (when (not this) (set! this this) (goto cfg-4) @@ -239,16 +212,13 @@ ;; definition of type generic-strip (deftype generic-strip (structure) - ((pos uint16 :offset-assert 0) - (len uint16 :offset-assert 2) + ((pos uint16) + (len uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type generic-strip -(defmethod inspect generic-strip ((this generic-strip)) +(defmethod inspect ((this generic-strip)) (when (not this) (set! this this) (goto cfg-4) @@ -262,17 +232,14 @@ ;; definition of type generic-envmap-saves (deftype generic-envmap-saves (structure) - ((index-mask vector4w :inline :offset-assert 0) - (verts uint128 12 :offset-assert 16) - (kicks uint128 4 :offset-assert 208) + ((index-mask vector4w :inline) + (verts uint128 12) + (kicks uint128 4) ) - :method-count-assert 9 - :size-assert #x110 - :flag-assert #x900000110 ) ;; definition for method 3 of type generic-envmap-saves -(defmethod inspect generic-envmap-saves ((this generic-envmap-saves)) +(defmethod inspect ((this generic-envmap-saves)) (when (not this) (set! this this) (goto cfg-4) @@ -287,22 +254,19 @@ ;; definition of type generic-interp-job (deftype generic-interp-job (structure) - ((job-type uint16 :offset-assert 0) - (num uint16 :offset-assert 2) - (first uint16 :offset-assert 4) - (pad uint16 :offset-assert 6) - (ptr-data uint32 :offset-assert 8) - (morph-z uint16 :offset-assert 12) - (morph-w uint16 :offset-assert 14) + ((job-type uint16) + (num uint16) + (first uint16) + (pad uint16) + (ptr-data uint32) + (morph-z uint16) + (morph-w uint16) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type generic-interp-job -(defmethod inspect generic-interp-job ((this generic-interp-job)) +(defmethod inspect ((this generic-interp-job)) (when (not this) (set! this this) (goto cfg-4) @@ -321,40 +285,37 @@ ;; definition of type generic-saves (deftype generic-saves (structure) - ((ptr-dma uint32 :offset-assert 0) - (ptr-vtxs uint32 :offset-assert 4) - (ptr-clrs uint32 :offset-assert 8) - (ptr-texs uint32 :offset-assert 12) - (ptr-env-clrs uint32 :offset-assert 16) - (ptr-env-texs uint32 :offset-assert 20) - (cur-outbuf uint32 :offset-assert 24) - (ptr-fx-buf uint32 :offset-assert 28) - (xor-outbufs uint32 :offset-assert 32) - (num-dps uint32 :offset-assert 36) - (qwc uint32 :offset-assert 40) - (gsf-buf gsf-buffer :offset-assert 44) - (ptr-shaders uint32 :offset-assert 48) - (ptr-env-shader uint32 :offset-assert 52) - (is-envmap uint16 :offset-assert 56) - (is-translucent uint16 :offset-assert 58) - (basep uint32 :offset-assert 60) - (ptr-interp-job generic-interp-job :offset-assert 64) - (gifbuf-adr uint32 :offset-assert 68) - (inbuf-adr uint32 :offset-assert 72) - (fade-val uint32 :offset-assert 76) - (time-of-day-color rgba :offset-assert 80) - (to-vu0-waits uint32 :offset-assert 84) - (to-spr-waits uint32 :offset-assert 88) - (from-spr-waits uint32 :offset-assert 92) - (envmap generic-envmap-saves :inline :offset-assert 96) + ((ptr-dma uint32) + (ptr-vtxs uint32) + (ptr-clrs uint32) + (ptr-texs uint32) + (ptr-env-clrs uint32) + (ptr-env-texs uint32) + (cur-outbuf uint32) + (ptr-fx-buf uint32) + (xor-outbufs uint32) + (num-dps uint32) + (qwc uint32) + (gsf-buf gsf-buffer) + (ptr-shaders uint32) + (ptr-env-shader uint32) + (is-envmap uint16) + (is-translucent uint16) + (basep uint32) + (ptr-interp-job generic-interp-job) + (gifbuf-adr uint32) + (inbuf-adr uint32) + (fade-val uint32) + (time-of-day-color rgba) + (to-vu0-waits uint32) + (to-spr-waits uint32) + (from-spr-waits uint32) + (envmap generic-envmap-saves :inline) ) - :method-count-assert 9 - :size-assert #x170 - :flag-assert #x900000170 ) ;; definition for method 3 of type generic-saves -(defmethod inspect generic-saves ((this generic-saves)) +(defmethod inspect ((this generic-saves)) (when (not this) (set! this this) (goto cfg-4) @@ -392,20 +353,17 @@ ;; definition of type generic-gif-tag (deftype generic-gif-tag (structure) - ((data uint32 4 :offset-assert 0) - (qword qword :inline :offset 0) - (fan-prim gif-tag-prim :offset 0) - (str-prim gif-tag-prim :offset 4) - (regs gif-tag-regs-32 :offset 8) - (num-strips uint32 :offset 12) + ((data uint32 4) + (qword qword :inline :overlay-at (-> data 0)) + (fan-prim gif-tag-prim :overlay-at (-> data 0)) + (str-prim gif-tag-prim :overlay-at (-> data 1)) + (regs gif-tag-regs-32 :overlay-at (-> data 2)) + (num-strips uint32 :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type generic-gif-tag -(defmethod inspect generic-gif-tag ((this generic-gif-tag)) +(defmethod inspect ((this generic-gif-tag)) (when (not this) (set! this this) (goto cfg-4) @@ -423,18 +381,15 @@ ;; definition of type generic-envmap-consts (deftype generic-envmap-consts (structure) - ((consts vector :inline :offset-assert 0) - (strgif generic-gif-tag :inline :offset-assert 16) - (colors vector4w :inline :offset-assert 32) - (shader adgif-shader :inline :offset-assert 48) + ((consts vector :inline) + (strgif generic-gif-tag :inline) + (colors vector4w :inline) + (shader adgif-shader :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type generic-envmap-consts -(defmethod inspect generic-envmap-consts ((this generic-envmap-consts)) +(defmethod inspect ((this generic-envmap-consts)) (when (not this) (set! this this) (goto cfg-4) @@ -450,37 +405,34 @@ ;; definition of type generic-consts (deftype generic-consts (structure) - ((dma-header dma-packet :inline :offset-assert 0) - (vif-header uint32 4 :offset-assert 16) - (dma-ref-vtxs dma-packet :inline :offset-assert 32) - (dma-cnt-call dma-packet :inline :offset-assert 48) - (matrix matrix :inline :offset-assert 64) - (base-strgif generic-gif-tag :inline :offset-assert 128) - (alpha-opaque gs-adcmd :inline :offset-assert 144) - (alpha-translucent gs-adcmd :inline :offset-assert 160) - (ztest-normal gs-adcmd :inline :offset-assert 176) - (ztest-opaque gs-adcmd :inline :offset-assert 192) - (adcmd-offsets uint8 16 :offset-assert 208) - (stcycle-tag uint32 :offset-assert 224) - (unpack-vtx-tag uint32 :offset-assert 228) - (unpack-clr-tag uint32 :offset-assert 232) - (unpack-tex-tag uint32 :offset-assert 236) - (mscal-tag uint32 :offset-assert 240) - (flush-tag uint32 :offset-assert 244) - (reset-cycle-tag uint32 :offset-assert 248) - (dummy0 uint32 :offset-assert 252) - (dma-tag-cnt uint64 :offset-assert 256) - (envmap generic-envmap-consts :inline :offset-assert 272) - (light-consts vector :inline :offset-assert 400) - (texture-offset uint16 8 :offset-assert 416) + ((dma-header dma-packet :inline) + (vif-header uint32 4) + (dma-ref-vtxs dma-packet :inline) + (dma-cnt-call dma-packet :inline) + (matrix matrix :inline) + (base-strgif generic-gif-tag :inline) + (alpha-opaque gs-adcmd :inline) + (alpha-translucent gs-adcmd :inline) + (ztest-normal gs-adcmd :inline) + (ztest-opaque gs-adcmd :inline) + (adcmd-offsets uint8 16) + (stcycle-tag uint32) + (unpack-vtx-tag uint32) + (unpack-clr-tag uint32) + (unpack-tex-tag uint32) + (mscal-tag uint32) + (flush-tag uint32) + (reset-cycle-tag uint32) + (dummy0 uint32) + (dma-tag-cnt uint64) + (envmap generic-envmap-consts :inline) + (light-consts vector :inline) + (texture-offset uint16 8) ) - :method-count-assert 9 - :size-assert #x1b0 - :flag-assert #x9000001b0 ) ;; definition for method 3 of type generic-consts -(defmethod inspect generic-consts ((this generic-consts)) +(defmethod inspect ((this generic-consts)) (when (not this) (set! this this) (goto cfg-4) @@ -516,15 +468,12 @@ ;; definition of type generic-storage (deftype generic-storage (structure) - ((data uint128 16 :offset-assert 0) + ((data uint128 16) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; definition for method 3 of type generic-storage -(defmethod inspect generic-storage ((this generic-storage)) +(defmethod inspect ((this generic-storage)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/generic/generic-vu1-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/generic/generic-vu1-h_REF.gc index ba78fb379fe..cc4cc06e04a 100644 --- a/test/decompiler/reference/jak2/engine/gfx/generic/generic-vu1-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/generic/generic-vu1-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type pris-mtx (deftype pris-mtx (structure) - ((data float 32 :offset-assert 0) - (vector vector 8 :offset 0) - (t-mtx matrix :inline :offset 0) - (n-mtx matrix3 :inline :offset 64) - (scale vector :inline :offset 112) + ((data float 32) + (vector vector 8 :overlay-at (-> data 0)) + (t-mtx matrix :inline :overlay-at (-> data 0)) + (n-mtx matrix3 :inline :overlay-at (-> data 16)) + (scale vector :inline :overlay-at (-> data 28)) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type pris-mtx -(defmethod inspect pris-mtx ((this pris-mtx)) +(defmethod inspect ((this pris-mtx)) (when (not this) (set! this this) (goto cfg-4) @@ -32,17 +29,14 @@ ;; definition of type generic-pris-mtx-save (deftype generic-pris-mtx-save (structure) - ((loc-mtx pris-mtx :inline :offset-assert 0) - (par-mtx pris-mtx :inline :offset-assert 128) - (dif-mtx pris-mtx :inline :offset-assert 256) + ((loc-mtx pris-mtx :inline) + (par-mtx pris-mtx :inline) + (dif-mtx pris-mtx :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;; definition for method 3 of type generic-pris-mtx-save -(defmethod inspect generic-pris-mtx-save ((this generic-pris-mtx-save)) +(defmethod inspect ((this generic-pris-mtx-save)) (when (not this) (set! this this) (goto cfg-4) @@ -57,22 +51,19 @@ ;; definition of type generic-constants (deftype generic-constants (structure) - ((fog vector :inline :offset-assert 0) - (adgif gs-gif-tag :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (hmge-scale vector :inline :offset-assert 48) - (invh-scale vector :inline :offset-assert 64) - (guard vector :inline :offset-assert 80) - (flush qword :inline :offset-assert 96) - (stores qword :inline :offset-assert 112) + ((fog vector :inline) + (adgif gs-gif-tag :inline) + (hvdf-offset vector :inline) + (hmge-scale vector :inline) + (invh-scale vector :inline) + (guard vector :inline) + (flush qword :inline) + (stores qword :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type generic-constants -(defmethod inspect generic-constants ((this generic-constants)) +(defmethod inspect ((this generic-constants)) (when (not this) (set! this this) (goto cfg-4) @@ -92,16 +83,13 @@ ;; definition of type generic-shrub-constants (deftype generic-shrub-constants (structure) - ((shrub-giftag generic-gif-tag :inline :offset-assert 0) - (shrub-adnop qword :inline :offset-assert 16) + ((shrub-giftag generic-gif-tag :inline) + (shrub-adnop qword :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type generic-shrub-constants -(defmethod inspect generic-shrub-constants ((this generic-shrub-constants)) +(defmethod inspect ((this generic-shrub-constants)) (when (not this) (set! this this) (goto cfg-4) @@ -115,18 +103,15 @@ ;; definition of type gcf-shader (deftype gcf-shader (structure) - ((adgif uint128 5 :offset-assert 0) - (shader adgif-shader :inline :offset 0) - (pos uint32 :offset 12) - (num uint32 :offset 28) + ((adgif uint128 5) + (shader adgif-shader :inline :overlay-at (-> adgif 0)) + (pos uint32 :offset 12) + (num uint32 :offset 28) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type gcf-shader -(defmethod inspect gcf-shader ((this gcf-shader)) +(defmethod inspect ((this gcf-shader)) (when (not this) (set! this this) (goto cfg-4) @@ -142,21 +127,18 @@ ;; definition of type gcf-control (deftype gcf-control (structure) - ((matrix matrix :inline :offset-assert 0) - (giftag generic-gif-tag :inline :offset-assert 64) - (adnops gs-adcmd 2 :inline :offset-assert 80) - (num-strips uint32 :offset 76) - (num-dps uint32 :offset 92) - (kick-offset uint32 :offset 108) - (shader gcf-shader :inline :dynamic :offset-assert 112) + ((matrix matrix :inline) + (giftag generic-gif-tag :inline) + (adnops gs-adcmd 2 :inline) + (num-strips uint32 :overlay-at (-> giftag data 3)) + (num-dps uint32 :overlay-at (-> adnops 0 word 3)) + (kick-offset uint32 :offset 108) + (shader gcf-shader :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type gcf-control -(defmethod inspect gcf-control ((this gcf-control)) +(defmethod inspect ((this gcf-control)) (when (not this) (set! this this) (goto cfg-4) @@ -175,17 +157,14 @@ ;; definition of type gcf-vertex (deftype gcf-vertex (structure) - ((tex vector4w :inline :offset-assert 0) - (clr gs-packed-rgba :inline :offset-assert 16) - (pos gs-packed-xyzw :inline :offset-assert 32) + ((tex vector4w :inline) + (clr gs-packed-rgba :inline) + (pos gs-packed-xyzw :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type gcf-vertex -(defmethod inspect gcf-vertex ((this gcf-vertex)) +(defmethod inspect ((this gcf-vertex)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/display-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/display-h_REF.gc index f4d9cdcd32f..3001762f813 100644 --- a/test/decompiler/reference/jak2/engine/gfx/hw/display-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/hw/display-h_REF.gc @@ -3,26 +3,23 @@ ;; definition of type display-frame (deftype display-frame (basic) - ((buffer dma-buffer 11 :offset-assert 4) - (calc-buf dma-buffer :offset 8) - (vu1-buf dma-buffer :offset 8) - (debug-buf dma-buffer :offset 36) - (global-buf dma-buffer :offset 40) - (bucket-group (inline-array dma-bucket) :offset 44) - (profile-array profile-array :inline :offset-assert 48) - (start-time int64 :offset-assert 56) - (run-time int64 :offset-assert 64) + ((buffer dma-buffer 11) + (calc-buf dma-buffer :overlay-at (-> buffer 1)) + (vu1-buf dma-buffer :overlay-at (-> buffer 1)) + (debug-buf dma-buffer :overlay-at (-> buffer 8)) + (global-buf dma-buffer :overlay-at (-> buffer 9)) + (bucket-group (inline-array dma-bucket) :overlay-at (-> buffer 10)) + (profile-array profile-array :inline) + (start-time int64) + (run-time int64) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type display-frame -(defmethod inspect display-frame ((this display-frame)) +(defmethod inspect ((this display-frame)) (when (not this) (set! this this) (goto cfg-4) @@ -57,46 +54,43 @@ ;; definition of type display (deftype display (basic) - ((on-screen int32 :offset-assert 4) - (last-screen int32 :offset-assert 8) - (frames display-frame 2 :offset-assert 12) - (bgcolor gs-bgcolor :offset-assert 24) - (pmode gs-pmode :offset-assert 32) - (clock clock 13 :offset-assert 40) - (session-clock clock :offset 40) - (game-clock clock :offset 44) - (base-clock clock :offset 48) - (real-clock clock :offset 52) - (frame-clock clock :offset 56) - (real-frame-clock clock :offset 60) - (target-clock clock :offset 64) - (entity-clock clock :offset 68) - (part-clock clock :offset 72) - (bg-clock clock :offset 76) - (camera-clock clock :offset 80) - (user0-clock clock :offset 84) - (total-game-clock clock :offset 88) - (time-factor float :offset-assert 92) - (dog-ratio float :offset-assert 96) - (vblank-start-time int64 2 :offset-assert 104) - (total-run-time int64 :offset-assert 120) - (run-half-speed basic :offset-assert 128) - (dog-count float :offset-assert 132) - (vu1-enable-user vu1-renderer-mask :offset-assert 136) - (vu1-enable-user-menu vu1-renderer-mask :offset-assert 144) - (force-sync uint32 :offset-assert 152) + ((on-screen int32) + (last-screen int32) + (frames display-frame 2) + (bgcolor gs-bgcolor) + (pmode gs-pmode) + (clock clock 13) + (session-clock clock :overlay-at (-> clock 0)) + (game-clock clock :overlay-at (-> clock 1)) + (base-clock clock :overlay-at (-> clock 2)) + (real-clock clock :overlay-at (-> clock 3)) + (frame-clock clock :overlay-at (-> clock 4)) + (real-frame-clock clock :overlay-at (-> clock 5)) + (target-clock clock :overlay-at (-> clock 6)) + (entity-clock clock :overlay-at (-> clock 7)) + (part-clock clock :overlay-at (-> clock 8)) + (bg-clock clock :overlay-at (-> clock 9)) + (camera-clock clock :overlay-at (-> clock 10)) + (user0-clock clock :overlay-at (-> clock 11)) + (total-game-clock clock :overlay-at (-> clock 12)) + (time-factor float) + (dog-ratio float) + (vblank-start-time int64 2) + (total-run-time int64) + (run-half-speed basic) + (dog-count float) + (vu1-enable-user vu1-renderer-mask) + (vu1-enable-user-menu vu1-renderer-mask) + (force-sync uint32) ) - :method-count-assert 10 - :size-assert #x9c - :flag-assert #xa0000009c (:methods - (new (symbol type int int int int int) _type_ 0) - (set-time-ratios (_type_ float) float 9) + (new (symbol type int int int int int) _type_) + (set-time-ratios (_type_ float) float) ) ) ;; definition for method 3 of type display -(defmethod inspect display ((this display)) +(defmethod inspect ((this display)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc index 4e98f86cc42..02eb314ef93 100644 --- a/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc @@ -12,7 +12,7 @@ ) ;; definition for method 9 of type display -(defmethod set-time-ratios display ((this display) (arg0 float)) +(defmethod set-time-ratios ((this display) (arg0 float)) (set! (-> this dog-ratio) (fmin 4.0 arg0)) (case (get-video-mode) (('pal) diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc index c48768e2e3c..687454421c4 100644 --- a/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc @@ -11,9 +11,6 @@ (slbg uint8 :offset 7 :size 1) (alp uint8 :offset 8 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-smode2 @@ -22,9 +19,6 @@ (ffmd uint8 :offset 1 :size 1) (dpms uint8 :offset 2 :size 2) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for function psm-size @@ -119,9 +113,6 @@ (dbx uint16 :offset 32 :size 11) (dby uint16 :offset 43 :size 11) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-display @@ -136,9 +127,6 @@ write-only" (dw uint16 :offset 32 :size 12) (dh uint16 :offset 44 :size 11) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-bgcolor @@ -149,9 +137,6 @@ write-only" (g uint8 :offset 8 :size 8) (b uint8 :offset 16 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-csr @@ -174,34 +159,28 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (rev uint8 :offset 16 :size 8) (id uint8 :offset 24 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-bank (deftype gs-bank (structure) - ((pmode gs-pmode :offset-assert 0) - (smode2 gs-smode2 :offset 32) - (dspfb1 gs-display-fb :offset 112) - (display1 gs-display :offset 128) - (dspfb2 gs-display-fb :offset 144) - (display2 gs-display :offset 160) - (extbuf uint64 :offset 176) - (extdata uint64 :offset 192) - (extwrite uint64 :offset 208) - (bgcolor gs-bgcolor :offset 224) - (csr gs-csr :offset 4096) - (imr uint64 :offset 4112) - (busdir uint64 :offset 4160) + ((pmode gs-pmode) + (smode2 gs-smode2 :offset 32) + (dspfb1 gs-display-fb :offset 112) + (display1 gs-display :offset 128) + (dspfb2 gs-display-fb :offset 144) + (display2 gs-display :offset 160) + (extbuf uint64 :offset 176) + (extdata uint64 :offset 192) + (extwrite uint64 :offset 208) + (bgcolor gs-bgcolor :offset 224) + (csr gs-csr :offset 4096) + (imr uint64 :offset 4112) + (busdir uint64 :offset 4160) ) - :method-count-assert 9 - :size-assert #x1048 - :flag-assert #x900001048 ) ;; definition for method 3 of type gs-bank -(defmethod inspect gs-bank ((this gs-bank)) +(defmethod inspect ((this gs-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -231,9 +210,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (psm gs-psm :offset 24 :size 6) (fbmsk uint32 :offset 32 :size 32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-zbuf @@ -242,9 +218,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (psm gs-psm :offset 24 :size 4) (zmsk uint8 :offset 32 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-xy-offset @@ -252,9 +225,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ((ofx uint16 :offset 0 :size 16) (ofy uint16 :offset 32 :size 16) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-scissor @@ -264,36 +234,24 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (scay0 uint16 :offset 32 :size 11) (scay1 uint16 :offset 48 :size 11) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-prmode-cont (deftype gs-prmode-cont (uint64) ((ac uint8 :offset 0 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-color-clamp (deftype gs-color-clamp (uint64) ((clamp uint8 :offset 0 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-dthe (deftype gs-dthe (uint64) ((dthe uint8 :offset 0 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-test @@ -307,9 +265,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (zte uint8 :offset 16 :size 1) (ztst gs-ztest :offset 17 :size 2) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-prim @@ -324,9 +279,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (ctxt uint8 :offset 9 :size 1) (fix uint8 :offset 10 :size 1) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-rgbaq @@ -337,9 +289,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (a uint8 :offset 24 :size 8) (q float :offset 32 :size 32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-xyz @@ -348,9 +297,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (y uint16 :offset 16 :size 16) (z uint32 :offset 32 :size 32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-uv @@ -358,9 +304,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ((u uint16 :offset 0 :size 16) (v uint16 :offset 16 :size 16) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-st @@ -368,9 +311,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ((s float :offset 0 :size 32) (t float :offset 32 :size 32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-xyzf @@ -380,31 +320,25 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (z uint32 :offset 32 :size 24) (f uint8 :offset 56 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-adcmd (deftype gs-adcmd (structure) - ((word uint32 4 :offset-assert 0) - (quad uint128 :offset 0) - (data uint64 :offset 0) - (cmds gs-reg64 :offset 8) - (cmd uint8 :offset 8) - (x uint32 :offset 0) - (y uint32 :offset 4) - (z uint32 :offset 8) - (w uint32 :offset 12) + ((word uint32 4) + (quad uint128 :overlay-at (-> word 0)) + (data uint64 :overlay-at (-> word 0)) + (cmds gs-reg64 :overlay-at (-> word 2)) + (cmd uint8 :overlay-at (-> word 2)) + (x uint32 :overlay-at (-> word 0)) + (y uint32 :overlay-at (-> word 1)) + (z uint32 :overlay-at (-> word 2)) + (w uint32 :overlay-at (-> word 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gs-adcmd ;; INFO: Used lq/sq -(defmethod inspect gs-adcmd ((this gs-adcmd)) +(defmethod inspect ((this gs-adcmd)) (when (not this) (set! this this) (goto cfg-4) @@ -431,9 +365,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (dsay uint16 :offset 48 :size 11) (dir uint8 :offset 59 :size 2) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-trxreg @@ -441,18 +372,12 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ((rrw uint16 :offset 0 :size 12) (rrh uint16 :offset 32 :size 12) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-trxdir (deftype gs-trxdir (uint64) ((xdir uint8 :offset 0 :size 2) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-bitbltbuf @@ -464,9 +389,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (dbw uint8 :offset 48 :size 6) (dpsm gs-psm :offset 56 :size 6) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-tex0 @@ -484,9 +406,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (csa uint8 :offset 56 :size 5) (cld uint8 :offset 61 :size 3) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-tex1 @@ -499,9 +418,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (l uint8 :offset 19 :size 2) (k int16 :offset 32 :size 12) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-texa @@ -510,9 +426,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (aem uint8 :offset 15 :size 1) (ta1 uint8 :offset 32 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-texclut @@ -521,9 +434,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (cou uint8 :offset 6 :size 6) (cov uint16 :offset 12 :size 10) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-miptbp @@ -535,9 +445,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (tbp3 uint16 :offset 40 :size 14) (tbw3 uint8 :offset 54 :size 6) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-alpha @@ -548,13 +455,10 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (d uint8 :offset 6 :size 2) (fix uint8 :offset 32 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type gs-alpha -(defmethod inspect gs-alpha ((this gs-alpha)) +(defmethod inspect ((this gs-alpha)) (when (not this) (set! this this) (goto cfg-4) @@ -578,22 +482,16 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (minv uint16 :offset 24 :size 10) (maxv uint16 :offset 34 :size 10) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gs-fog (deftype gs-fog (uint64) ((f uint8 :offset 56 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type gs-fog -(defmethod inspect gs-fog ((this gs-fog)) +(defmethod inspect ((this gs-fog)) (when (not this) (set! this this) (goto cfg-4) @@ -610,13 +508,10 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (fcg uint8 :offset 8 :size 8) (fcb uint8 :offset 16 :size 8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type gs-fogcol -(defmethod inspect gs-fogcol ((this gs-fogcol)) +(defmethod inspect ((this gs-fogcol)) (when (not this) (set! this this) (goto cfg-4) @@ -634,9 +529,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ((rst uint8 :offset 0 :size 1) (pse uint8 :offset 3 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-mode @@ -644,9 +536,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ((m3r uint8 :offset 0 :size 1) (imt uint8 :offset 2 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-stat @@ -664,9 +553,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (dir uint8 :offset 12 :size 1) (fqc uint8 :offset 24 :size 5) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-cnt @@ -675,18 +561,12 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (regcnt uint8 :offset 16 :size 4) (vuaddr uint16 :offset 20 :size 10) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-p3cnt (deftype gif-p3cnt (uint32) ((p3cnt uint16 :offset 0 :size 15) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-p3tag @@ -694,31 +574,25 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ((loopcnt uint16 :offset 0 :size 15) (eop uint8 :offset 15 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-bank (deftype gif-bank (structure) - ((ctrl gif-ctrl :offset 0) - (mode gif-mode :offset 16) - (stat gif-stat :offset 32) - (tag0 uint32 :offset 64) - (tag1 uint32 :offset 80) - (tag2 uint32 :offset 96) - (tag3 uint32 :offset 112) - (cnt gif-cnt :offset 128) - (p3cnt gif-p3cnt :offset 144) - (p3tag gif-p3tag :offset 160) + ((ctrl gif-ctrl :offset 0) + (mode gif-mode :offset 16) + (stat gif-stat :offset 32) + (tag0 uint32 :offset 64) + (tag1 uint32 :offset 80) + (tag2 uint32 :offset 96) + (tag3 uint32 :offset 112) + (cnt gif-cnt :offset 128) + (p3cnt gif-p3cnt :offset 144) + (p3tag gif-p3tag :offset 160) ) - :method-count-assert 9 - :size-assert #xa4 - :flag-assert #x9000000a4 ) ;; definition for method 3 of type gif-bank -(defmethod inspect gif-bank ((this gif-bank)) +(defmethod inspect ((this gif-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -746,9 +620,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (flg gif-flag :offset 26 :size 2) (nreg uint8 :offset 28 :size 4) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-tag-count @@ -756,9 +627,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ((nloop uint16 :offset 0 :size 15) (eop uint8 :offset 15 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type gif-tag64 @@ -771,9 +639,6 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (flg gif-flag :offset 58 :size 2) (nreg uint8 :offset 60 :size 4) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type gif-tag @@ -802,26 +667,20 @@ bits 5 and 6 (0x20 and 0x40) should be zero" (regs14 gif-reg-id :offset 120 :size 4) (regs15 gif-reg-id :offset 124 :size 4) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition of type gs-gif-tag (deftype gs-gif-tag (structure) - ((qword uint128 :offset-assert 0) - (tag gif-tag64 :offset 0) - (regs gif-tag-regs :offset 8) - (dword uint64 2 :offset 0) - (word uint32 4 :offset 0) + ((qword uint128) + (tag gif-tag64 :overlay-at qword) + (regs gif-tag-regs :offset 8) + (dword uint64 2 :overlay-at qword) + (word uint32 4 :overlay-at qword) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gs-gif-tag -(defmethod inspect gs-gif-tag ((this gs-gif-tag)) +(defmethod inspect ((this gs-gif-tag)) (when (not this) (set! this this) (goto cfg-4) @@ -838,7 +697,7 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition for method 3 of type gif-tag ;; WARN: Return type mismatch object vs gif-tag. -(defmethod inspect gif-tag ((this gif-tag)) +(defmethod inspect ((this gif-tag)) (format #t "[~8x] gif-tag~%" this) (format #t "~Tnloop: ~4d~%" (-> this nloop)) (format #t "~Teop : ~4d~%" (-> this eop)) @@ -870,22 +729,19 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition of type gif-packet (deftype gif-packet (basic) - ((reg-count int32 :offset-assert 4) - (gif-tag gs-gif-tag :inline :offset-assert 16) - (gif-tag0 uint128 :offset 16) - (args uint64 1 :offset-assert 32) + ((reg-count int32) + (gif-tag gs-gif-tag :inline) + (gif-tag0 uint128 :overlay-at (-> gif-tag qword)) + (args uint64 1) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) ;; definition for method 3 of type gif-packet ;; INFO: Used lq/sq -(defmethod inspect gif-packet ((this gif-packet)) +(defmethod inspect ((this gif-packet)) (when (not this) (set! this this) (goto cfg-4) @@ -931,23 +787,20 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition of type draw-context (deftype draw-context (basic) - ((orgx int32 :offset-assert 4) - (orgy int32 :offset-assert 8) - (orgz int32 :offset-assert 12) - (width int32 :offset-assert 16) - (height int32 :offset-assert 20) - (color rgba 4 :offset-assert 24) + ((orgx int32) + (orgy int32) + (orgz int32) + (width int32) + (height int32) + (color rgba 4) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 (:methods - (new (symbol type int int int int rgba) _type_ 0) + (new (symbol type int int int int rgba) _type_) ) ) ;; definition for method 3 of type draw-context -(defmethod inspect draw-context ((this draw-context)) +(defmethod inspect ((this draw-context)) (when (not this) (set! this this) (goto cfg-4) @@ -986,19 +839,16 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition of type gs-packed-rgba (deftype gs-packed-rgba (vector4w) - ((r int32 :offset 0) - (g int32 :offset 4) - (b int32 :offset 8) - (a int32 :offset 12) + ((r int32 :overlay-at (-> data 0)) + (g int32 :overlay-at (-> data 1)) + (b int32 :overlay-at (-> data 2)) + (a int32 :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gs-packed-rgba ;; INFO: Used lq/sq -(defmethod inspect gs-packed-rgba ((this gs-packed-rgba)) +(defmethod inspect ((this gs-packed-rgba)) (when (not this) (set! this this) (goto cfg-4) @@ -1021,19 +871,16 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition of type gs-packed-xyzw (deftype gs-packed-xyzw (vector) - ((ix int32 :offset 0) - (iy int32 :offset 4) - (iz int32 :offset 8) - (iw int32 :offset 12) + ((ix int32 :overlay-at (-> data 0)) + (iy int32 :overlay-at (-> data 1)) + (iz int32 :overlay-at (-> data 2)) + (iw int32 :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gs-packed-xyzw ;; INFO: Used lq/sq -(defmethod inspect gs-packed-xyzw ((this gs-packed-xyzw)) +(defmethod inspect ((this gs-packed-xyzw)) (when (not this) (set! this this) (goto cfg-4) @@ -1055,18 +902,15 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition of type gs-packed-stq (deftype gs-packed-stq (vector) - ((tex-s float :offset 0) - (tex-t float :offset 4) - (tex-q float :offset 8) + ((tex-s float :overlay-at (-> data 0)) + (tex-t float :overlay-at (-> data 1)) + (tex-q float :overlay-at (-> data 2)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gs-packed-stq ;; INFO: Used lq/sq -(defmethod inspect gs-packed-stq ((this gs-packed-stq)) +(defmethod inspect ((this gs-packed-stq)) (when (not this) (set! this this) (goto cfg-4) @@ -1088,17 +932,14 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition of type gs-packed-uv (deftype gs-packed-uv (vector) - ((u int16 :offset 0) - (v int16 :offset 4) + ((u int16 :overlay-at (-> data 0)) + (v int16 :overlay-at (-> data 1)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gs-packed-uv ;; INFO: Used lq/sq -(defmethod inspect gs-packed-uv ((this gs-packed-uv)) +(defmethod inspect ((this gs-packed-uv)) (when (not this) (set! this this) (goto cfg-4) @@ -1119,17 +960,14 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition of type gs-packed-gt (deftype gs-packed-gt (structure) - ((stq gs-packed-stq :inline :offset 0) - (rgba gs-packed-rgba :inline :offset 16) - (xyzw gs-packed-xyzw :inline :offset 32) + ((stq gs-packed-stq :inline :offset 0) + (rgba gs-packed-rgba :inline :offset 16) + (xyzw gs-packed-xyzw :inline :offset 32) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type gs-packed-gt -(defmethod inspect gs-packed-gt ((this gs-packed-gt)) +(defmethod inspect ((this gs-packed-gt)) (when (not this) (set! this this) (goto cfg-4) @@ -1144,15 +982,12 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition of type gs-packed-gt4 (deftype gs-packed-gt4 (structure) - ((data gs-packed-gt 4 :inline :offset-assert 0) + ((data gs-packed-gt 4 :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) ;; definition for method 3 of type gs-packed-gt4 -(defmethod inspect gs-packed-gt4 ((this gs-packed-gt4)) +(defmethod inspect ((this gs-packed-gt4)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/video-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/video-h_REF.gc index b41f97dd555..45995bc48c1 100644 --- a/test/decompiler/reference/jak2/engine/gfx/hw/video-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/hw/video-h_REF.gc @@ -3,23 +3,20 @@ ;; definition of type video-params (deftype video-params (structure) - ((set-video-mode symbol :offset-assert 0) - (reset-video-mode symbol :offset-assert 4) - (display-fbp int32 :offset-assert 8) - (relative-x-scale float :offset 16) - (display-dx int32 :offset-assert 20) - (display-dy int32 :offset-assert 24) - (display-sy int32 :offset-assert 28) - (relative-x-scale-reciprical float :offset-assert 32) - (screen-pages-high int32 :offset-assert 36) + ((set-video-mode symbol) + (reset-video-mode symbol) + (display-fbp int32) + (relative-x-scale float :offset 16) + (display-dx int32) + (display-dy int32) + (display-sy int32) + (relative-x-scale-reciprical float) + (screen-pages-high int32) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; definition for method 3 of type video-params -(defmethod inspect video-params ((this video-params)) +(defmethod inspect ((this video-params)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/math-camera-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/math-camera-h_REF.gc index d8959073290..3e46e4bd08b 100644 --- a/test/decompiler/reference/jak2/engine/gfx/math-camera-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/math-camera-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type vis-gif-tag (deftype vis-gif-tag (structure) - ((fog0 uint32 :offset-assert 0) - (strip uint32 :offset-assert 4) - (regs uint32 :offset-assert 8) - (fan uint32 :offset-assert 12) + ((fog0 uint32) + (strip uint32) + (regs uint32) + (fan uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vis-gif-tag -(defmethod inspect vis-gif-tag ((this vis-gif-tag)) +(defmethod inspect ((this vis-gif-tag)) (when (not this) (set! this this) (goto cfg-4) @@ -30,31 +27,28 @@ ;; definition of type cull-info (deftype cull-info (structure) - ((x-fact float :offset-assert 0) - (y-fact float :offset-assert 4) - (z-fact float :offset-assert 8) - (cam-radius float :offset-assert 12) - (cam-x float :offset-assert 16) - (cam-y float :offset-assert 20) - (xz-dir-ax float :offset-assert 24) - (xz-dir-az float :offset-assert 28) - (xz-dir-bx float :offset-assert 32) - (xz-dir-bz float :offset-assert 36) - (xz-cross-ab float :offset-assert 40) - (yz-dir-ay float :offset-assert 44) - (yz-dir-az float :offset-assert 48) - (yz-dir-by float :offset-assert 52) - (yz-dir-bz float :offset-assert 56) - (yz-cross-ab float :offset-assert 60) + ((x-fact float) + (y-fact float) + (z-fact float) + (cam-radius float) + (cam-x float) + (cam-y float) + (xz-dir-ax float) + (xz-dir-az float) + (xz-dir-bx float) + (xz-dir-bz float) + (xz-cross-ab float) + (yz-dir-ay float) + (yz-dir-az float) + (yz-dir-by float) + (yz-dir-bz float) + (yz-cross-ab float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type cull-info -(defmethod inspect cull-info ((this cull-info)) +(defmethod inspect ((this cull-info)) (when (not this) (set! this this) (goto cfg-4) @@ -82,77 +76,74 @@ ;; definition of type math-camera (deftype math-camera (basic) - ((d meters :offset-assert 4) - (f meters :offset-assert 8) - (fov degrees :offset-assert 12) - (x-ratio float :offset-assert 16) - (y-ratio float :offset-assert 20) - (x-pix float :offset-assert 24) - (x-clip float :offset-assert 28) - (x-clip-ratio-in float :offset-assert 32) - (x-clip-ratio-over float :offset-assert 36) - (y-pix float :offset-assert 40) - (y-clip float :offset-assert 44) - (y-clip-ratio-in float :offset-assert 48) - (y-clip-ratio-over float :offset-assert 52) - (cull-info cull-info :inline :offset-assert 56) - (fog-start meters :offset-assert 120) - (fog-end meters :offset-assert 124) - (fog-max float :offset-assert 128) - (fog-min float :offset-assert 132) - (reset int32 :offset-assert 136) - (smooth-step float :offset-assert 140) - (smooth-t float :offset-assert 144) - (perspective matrix :inline :offset-assert 160) - (isometric matrix :inline :offset-assert 224) - (sprite-2d matrix :inline :offset-assert 288) - (sprite-2d-hvdf vector :inline :offset-assert 352) - (camera-rot matrix :inline :offset-assert 368) - (inv-camera-rot matrix :inline :offset-assert 432) - (inv-camera-rot-smooth matrix :inline :offset-assert 496) - (inv-camera-rot-smooth-from quaternion :inline :offset-assert 560) - (camera-temp matrix :inline :offset-assert 576) - (prev-camera-temp matrix :inline :offset-assert 640) - (prev-inv-camera-rot matrix :inline :offset-assert 704) - (prev-trans vector :inline :offset-assert 768) - (hmge-scale vector :inline :offset-assert 784) - (inv-hmge-scale vector :inline :offset-assert 800) - (hvdf-off vector :inline :offset-assert 816) - (guard vector :inline :offset-assert 832) - (vis-gifs vis-gif-tag 4 :inline :offset-assert 848) - (giftex uint128 :offset 848) - (gifgr uint128 :offset 864) - (giftex-trans uint128 :offset 880) - (gifgr-trans uint128 :offset 896) - (pfog0 float :offset-assert 912) - (pfog1 float :offset-assert 916) - (trans vector :inline :offset-assert 928) - (plane plane 4 :inline :offset-assert 944) - (guard-plane plane 4 :inline :offset-assert 1008) - (shrub-mat matrix :inline :offset-assert 1072) - (quat-other quaternion :inline :offset-assert 1136) - (trans-other vector :inline :offset-assert 1152) - (shrub-mat-other matrix :inline :offset-assert 1168) - (camera-temp-other matrix :inline :offset-assert 1232) - (camera-rot-other matrix :inline :offset-assert 1296) - (inv-camera-rot-other matrix :inline :offset-assert 1360) - (plane-other plane 4 :inline :offset-assert 1424) - (guard-plane-other plane 4 :inline :offset-assert 1488) - (mirror-trans vector :inline :offset-assert 1552) - (mirror-normal vector :inline :offset-assert 1568) - (fov-correction-factor float :offset-assert 1584) + ((d meters) + (f meters) + (fov degrees) + (x-ratio float) + (y-ratio float) + (x-pix float) + (x-clip float) + (x-clip-ratio-in float) + (x-clip-ratio-over float) + (y-pix float) + (y-clip float) + (y-clip-ratio-in float) + (y-clip-ratio-over float) + (cull-info cull-info :inline) + (fog-start meters) + (fog-end meters) + (fog-max float) + (fog-min float) + (reset int32) + (smooth-step float) + (smooth-t float) + (perspective matrix :inline) + (isometric matrix :inline) + (sprite-2d matrix :inline) + (sprite-2d-hvdf vector :inline) + (camera-rot matrix :inline) + (inv-camera-rot matrix :inline) + (inv-camera-rot-smooth matrix :inline) + (inv-camera-rot-smooth-from quaternion :inline) + (camera-temp matrix :inline) + (prev-camera-temp matrix :inline) + (prev-inv-camera-rot matrix :inline) + (prev-trans vector :inline) + (hmge-scale vector :inline) + (inv-hmge-scale vector :inline) + (hvdf-off vector :inline) + (guard vector :inline) + (vis-gifs vis-gif-tag 4 :inline) + (giftex uint128 :overlay-at (-> vis-gifs 0 fog0)) + (gifgr uint128 :offset 864) + (giftex-trans uint128 :offset 880) + (gifgr-trans uint128 :offset 896) + (pfog0 float) + (pfog1 float) + (trans vector :inline) + (plane plane 4 :inline) + (guard-plane plane 4 :inline) + (shrub-mat matrix :inline) + (quat-other quaternion :inline) + (trans-other vector :inline) + (shrub-mat-other matrix :inline) + (camera-temp-other matrix :inline) + (camera-rot-other matrix :inline) + (inv-camera-rot-other matrix :inline) + (plane-other plane 4 :inline) + (guard-plane-other plane 4 :inline) + (mirror-trans vector :inline) + (mirror-normal vector :inline) + (fov-correction-factor float) ) - :method-count-assert 9 - :size-assert #x634 - :flag-assert #x900000634 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type math-camera ;; INFO: Used lq/sq -(defmethod inspect math-camera ((this math-camera)) +(defmethod inspect ((this math-camera)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc b/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc index 12339cd8a10..a88777eaf7c 100644 --- a/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc @@ -3,16 +3,13 @@ ;; definition of type fog-corrector (deftype fog-corrector (structure) - ((fog-end float :offset-assert 0) - (fog-start float :offset-assert 4) + ((fog-end float) + (fog-start float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type fog-corrector -(defmethod inspect fog-corrector ((this fog-corrector)) +(defmethod inspect ((this fog-corrector)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc index cc70ce2f7c2..6d4b9172e22 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc @@ -4,13 +4,10 @@ ;; definition of type default-interior-states (deftype default-interior-states (structure) () - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) ;; definition for method 3 of type default-interior-states -(defmethod inspect default-interior-states ((this default-interior-states)) +(defmethod inspect ((this default-interior-states)) (when (not this) (set! this this) (goto cfg-4) @@ -46,18 +43,15 @@ ;; definition of type vinroom-states (deftype vinroom-states (structure) - ((main float :offset-assert 0) - (flicker1 float :offset-assert 4) - (flicker2 float :offset-assert 8) - (warp float :offset-assert 12) + ((main float) + (flicker1 float) + (flicker2 float) + (warp float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vinroom-states -(defmethod inspect vinroom-states ((this vinroom-states)) +(defmethod inspect ((this vinroom-states)) (when (not this) (set! this this) (goto cfg-4) @@ -151,16 +145,13 @@ ;; definition of type hideout-states (deftype hideout-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) ) - :method-count-assert 9 - :size-assert #xf - :flag-assert #x90000000f ) ;; definition for method 3 of type hideout-states -(defmethod inspect hideout-states ((this hideout-states)) +(defmethod inspect ((this hideout-states)) (when (not this) (set! this this) (goto cfg-4) @@ -274,52 +265,49 @@ ;; definition of type hiphog-states (deftype hiphog-states (structure) - ((spec-m-on sp-field-init-spec :offset-assert 0) - (spec-o-on sp-field-init-spec :offset-assert 4) - (spec-r-on sp-field-init-spec :offset-assert 8) - (spec-g-on sp-field-init-spec :offset-assert 12) - (spec-a-on sp-field-init-spec :offset-assert 16) - (spec-n-on sp-field-init-spec :offset-assert 20) - (spec-m-off sp-field-init-spec :offset-assert 24) - (spec-o-off sp-field-init-spec :offset-assert 28) - (spec-r-off sp-field-init-spec :offset-assert 32) - (spec-g-off sp-field-init-spec :offset-assert 36) - (spec-a-off sp-field-init-spec :offset-assert 40) - (spec-n-off sp-field-init-spec :offset-assert 44) - (spec-hog-1-on sp-field-init-spec :offset-assert 48) - (spec-hog-2-on sp-field-init-spec :offset-assert 52) - (spec-hiphog-on sp-field-init-spec :offset-assert 56) - (spec-hiphog-off sp-field-init-spec :offset-assert 60) - (spec-hiphog-on2 sp-field-init-spec :offset-assert 64) - (spec-hiphog-off2 sp-field-init-spec :offset-assert 68) - (spec-clock-sun sp-field-init-spec :offset-assert 72) - (spec-clock-moon sp-field-init-spec :offset-assert 76) - (door entity :offset-assert 80) - (m-on uint8 :offset-assert 84) - (o-on uint8 :offset-assert 85) - (r-on uint8 :offset-assert 86) - (g-on uint8 :offset-assert 87) - (a-on uint8 :offset-assert 88) - (n-on uint8 :offset-assert 89) - (m-off uint8 :offset-assert 90) - (o-off uint8 :offset-assert 91) - (r-off uint8 :offset-assert 92) - (g-off uint8 :offset-assert 93) - (a-off uint8 :offset-assert 94) - (n-off uint8 :offset-assert 95) - (hog-on uint8 :offset-assert 96) - (hiphog-on uint8 :offset-assert 97) - (hiphog-off uint8 :offset-assert 98) - (clock-sun uint8 :offset-assert 99) - (clock-moon uint8 :offset-assert 100) + ((spec-m-on sp-field-init-spec) + (spec-o-on sp-field-init-spec) + (spec-r-on sp-field-init-spec) + (spec-g-on sp-field-init-spec) + (spec-a-on sp-field-init-spec) + (spec-n-on sp-field-init-spec) + (spec-m-off sp-field-init-spec) + (spec-o-off sp-field-init-spec) + (spec-r-off sp-field-init-spec) + (spec-g-off sp-field-init-spec) + (spec-a-off sp-field-init-spec) + (spec-n-off sp-field-init-spec) + (spec-hog-1-on sp-field-init-spec) + (spec-hog-2-on sp-field-init-spec) + (spec-hiphog-on sp-field-init-spec) + (spec-hiphog-off sp-field-init-spec) + (spec-hiphog-on2 sp-field-init-spec) + (spec-hiphog-off2 sp-field-init-spec) + (spec-clock-sun sp-field-init-spec) + (spec-clock-moon sp-field-init-spec) + (door entity) + (m-on uint8) + (o-on uint8) + (r-on uint8) + (g-on uint8) + (a-on uint8) + (n-on uint8) + (m-off uint8) + (o-off uint8) + (r-off uint8) + (g-off uint8) + (a-off uint8) + (n-off uint8) + (hog-on uint8) + (hiphog-on uint8) + (hiphog-off uint8) + (clock-sun uint8) + (clock-moon uint8) ) - :method-count-assert 9 - :size-assert #x65 - :flag-assert #x900000065 ) ;; definition for method 3 of type hiphog-states -(defmethod inspect hiphog-states ((this hiphog-states)) +(defmethod inspect ((this hiphog-states)) (when (not this) (set! this this) (goto cfg-4) @@ -844,20 +832,17 @@ ;; definition of type sewer-states (deftype sewer-states (structure) - ((light-flag symbol :offset-assert 0) - (light-count uint32 :offset-assert 4) - (turret-value float :offset-assert 8) - (spec-light-center sp-field-init-spec :offset-assert 12) - (spec-light sp-field-init-spec :offset-assert 16) - (explosion float :offset-assert 20) + ((light-flag symbol) + (light-count uint32) + (turret-value float) + (spec-light-center sp-field-init-spec) + (spec-light sp-field-init-spec) + (explosion float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type sewer-states -(defmethod inspect sewer-states ((this sewer-states)) +(defmethod inspect ((this sewer-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1103,20 +1088,17 @@ ;; definition of type onintent-states (deftype onintent-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (green-flame flames-state :inline :offset-assert 24) - (totem0 flames-state :inline :offset-assert 32) - (totem1 flames-state :inline :offset-assert 40) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (green-flame flames-state :inline) + (totem0 flames-state :inline) + (totem1 flames-state :inline) ) - :method-count-assert 9 - :size-assert #x2f - :flag-assert #x90000002f ) ;; definition for method 3 of type onintent-states -(defmethod inspect onintent-states ((this onintent-states)) +(defmethod inspect ((this onintent-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1169,24 +1151,21 @@ ;; definition of type oracle-states (deftype oracle-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (blue-flame flames-state :inline :offset-assert 24) - (door-entity entity :offset-assert 32) - (door-current float :offset-assert 36) - (door-target float :offset-assert 40) - (purple-flag symbol :offset-assert 44) - (purple float :offset-assert 48) - (purple-noise float :offset-assert 52) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (blue-flame flames-state :inline) + (door-entity entity) + (door-current float) + (door-target float) + (purple-flag symbol) + (purple float) + (purple-noise float) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) ;; definition for method 3 of type oracle-states -(defmethod inspect oracle-states ((this oracle-states)) +(defmethod inspect ((this oracle-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1278,19 +1257,16 @@ ;; definition of type tomba-states (deftype tomba-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (light light-state :inline :offset-assert 24) - (gem-light float :offset-assert 32) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (light light-state :inline) + (gem-light float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type tomba-states -(defmethod inspect tomba-states ((this tomba-states)) +(defmethod inspect ((this tomba-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1376,18 +1352,15 @@ ;; definition of type tombb-states (deftype tombb-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (light light-state :inline :offset-assert 24) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (light light-state :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type tombb-states -(defmethod inspect tombb-states ((this tombb-states)) +(defmethod inspect ((this tombb-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1461,18 +1434,15 @@ ;; definition of type tombc-states (deftype tombc-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (electricity electricity-state :inline :offset-assert 24) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (electricity electricity-state :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type tombc-states -(defmethod inspect tombc-states ((this tombc-states)) +(defmethod inspect ((this tombc-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1528,19 +1498,16 @@ ;; definition of type tombd-states (deftype tombd-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (light light-state :inline :offset-assert 24) - (gem-light float :offset-assert 32) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (light light-state :inline) + (gem-light float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type tombd-states -(defmethod inspect tombd-states ((this tombd-states)) +(defmethod inspect ((this tombd-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1619,19 +1586,16 @@ ;; definition of type tombe-states (deftype tombe-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (light light-state :inline :offset-assert 24) - (gem-light float :offset-assert 32) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (light light-state :inline) + (gem-light float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type tombe-states -(defmethod inspect tombe-states ((this tombe-states)) +(defmethod inspect ((this tombe-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1671,19 +1635,16 @@ ;; definition of type tombboss-states (deftype tombboss-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (flame2 flames-state :inline :offset-assert 16) - (light light-state :inline :offset-assert 24) - (gem-light float :offset-assert 32) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (flame2 flames-state :inline) + (light light-state :inline) + (gem-light float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type tombboss-states -(defmethod inspect tombboss-states ((this tombboss-states)) +(defmethod inspect ((this tombboss-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1849,15 +1810,12 @@ ;; definition of type fortress-states (deftype fortress-states (structure) - ((pulse pulse-state :inline :offset-assert 0) + ((pulse pulse-state :inline) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type fortress-states -(defmethod inspect fortress-states ((this fortress-states)) +(defmethod inspect ((this fortress-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1935,17 +1893,14 @@ ;; definition of type fordumpa-states (deftype fordumpa-states (structure) - ((turret-value float 4 :offset-assert 0) - (pulse pulse-state :inline :offset-assert 16) - (electricity electricity-state :inline :offset-assert 20) + ((turret-value float 4) + (pulse pulse-state :inline) + (electricity electricity-state :inline) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type fordumpa-states -(defmethod inspect fordumpa-states ((this fordumpa-states)) +(defmethod inspect ((this fordumpa-states)) (when (not this) (set! this this) (goto cfg-4) @@ -2020,18 +1975,15 @@ ;; definition of type fordumpc-states (deftype fordumpc-states (structure) - ((light-flag symbol :offset-assert 0) - (pulse0 pulse-state :inline :offset-assert 4) - (pulse1 pulse-state :inline :offset-assert 8) - (strobe strobe-state :inline :offset-assert 12) + ((light-flag symbol) + (pulse0 pulse-state :inline) + (pulse1 pulse-state :inline) + (strobe strobe-state :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type fordumpc-states -(defmethod inspect fordumpc-states ((this fordumpc-states)) +(defmethod inspect ((this fordumpc-states)) (when (not this) (set! this this) (goto cfg-4) @@ -2092,16 +2044,13 @@ ;; definition of type forresca-states (deftype forresca-states (structure) - ((pulse pulse-state :inline :offset-assert 0) - (electricity electricity-state 2 :inline :offset 4) + ((pulse pulse-state :inline) + (electricity electricity-state 2 :inline :offset 4) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type forresca-states -(defmethod inspect forresca-states ((this forresca-states)) +(defmethod inspect ((this forresca-states)) (when (not this) (set! this this) (goto cfg-4) @@ -2155,16 +2104,13 @@ ;; definition of type forrescb-states (deftype forrescb-states (structure) - ((electricity electricity-state 2 :inline :offset-assert 0) - (turret float 4 :offset-assert 32) + ((electricity electricity-state 2 :inline) + (turret float 4) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type forrescb-states -(defmethod inspect forrescb-states ((this forrescb-states)) +(defmethod inspect ((this forrescb-states)) (when (not this) (set! this this) (goto cfg-4) @@ -2239,18 +2185,15 @@ ;; definition of type prison-states (deftype prison-states (structure) - ((pulse float :offset-assert 0) - (angle float :offset-assert 4) - (torture float :offset-assert 8) - (torture-flag symbol :offset-assert 12) + ((pulse float) + (angle float) + (torture float) + (torture-flag symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type prison-states -(defmethod inspect prison-states ((this prison-states)) +(defmethod inspect ((this prison-states)) (when (not this) (set! this this) (goto cfg-4) @@ -2347,22 +2290,19 @@ ;; definition of type under-states (deftype under-states (structure) - ((flame0 flames-state :inline :offset-assert 0) - (flame1 flames-state :inline :offset-assert 8) - (rot float :offset-assert 16) - (rot2 float :offset-assert 20) - (time float :offset-assert 24) - (laser float :offset-assert 28) - (fog-interp float :offset-assert 32) - (flicker float :offset-assert 36) + ((flame0 flames-state :inline) + (flame1 flames-state :inline) + (rot float) + (rot2 float) + (time float) + (laser float) + (fog-interp float) + (flicker float) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; definition for method 3 of type under-states -(defmethod inspect under-states ((this under-states)) +(defmethod inspect ((this under-states)) (when (not this) (set! this this) (goto cfg-4) @@ -2588,15 +2528,12 @@ ;; definition of type gungame-states (deftype gungame-states (structure) - ((florescent florescent-state :inline :offset-assert 0) + ((florescent florescent-state :inline) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) ;; definition for method 3 of type gungame-states -(defmethod inspect gungame-states ((this gungame-states)) +(defmethod inspect ((this gungame-states)) (when (not this) (set! this this) (goto cfg-4) @@ -2644,18 +2581,15 @@ ;; definition of type dig1-states (deftype dig1-states (structure) - ((pulse0 pulse-state :inline :offset-assert 0) - (pulse1 pulse-state :inline :offset-assert 4) - (explosion float :offset-assert 8) - (drillbit float :offset-assert 12) + ((pulse0 pulse-state :inline) + (pulse1 pulse-state :inline) + (explosion float) + (drillbit float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type dig1-states -(defmethod inspect dig1-states ((this dig1-states)) +(defmethod inspect ((this dig1-states)) (when (not this) (set! this this) (goto cfg-4) @@ -2900,24 +2834,21 @@ ;; definition of type vortex-states (deftype vortex-states (structure) - ((time float :offset-assert 0) - (level float :offset-assert 4) - (delta float :offset-assert 8) - (scale float :offset-assert 12) - (flash float :offset-assert 16) - (num int32 :offset-assert 20) - (white symbol :offset-assert 24) - (white-count float :offset-assert 28) - (pos vector :inline :offset-assert 32) - (dir vector :inline :offset-assert 48) + ((time float) + (level float) + (delta float) + (scale float) + (flash float) + (num int32) + (white symbol) + (white-count float) + (pos vector :inline) + (dir vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type vortex-states -(defmethod inspect vortex-states ((this vortex-states)) +(defmethod inspect ((this vortex-states)) (when (not this) (set! this this) (goto cfg-4) @@ -3085,18 +3016,15 @@ ;; definition of type nestb-states (deftype nestb-states (structure) - ((pulse pulse-state :inline :offset-assert 0) - (rot float :offset-assert 4) - (purple float :offset-assert 8) - (purple-noise float :offset-assert 12) + ((pulse pulse-state :inline) + (rot float) + (purple float) + (purple-noise float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type nestb-states -(defmethod inspect nestb-states ((this nestb-states)) +(defmethod inspect ((this nestb-states)) (when (not this) (set! this this) (goto cfg-4) @@ -3181,17 +3109,14 @@ ;; definition of type consiteb-states (deftype consiteb-states (structure) - ((flicker float :offset-assert 0) - (flicker-count float :offset-assert 4) - (flicker-state int32 :offset-assert 8) + ((flicker float) + (flicker-count float) + (flicker-state int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type consiteb-states -(defmethod inspect consiteb-states ((this consiteb-states)) +(defmethod inspect ((this consiteb-states)) (when (not this) (set! this this) (goto cfg-4) @@ -3272,18 +3197,15 @@ ;; definition of type castle-states (deftype castle-states (structure) - ((electricity electricity-state :inline :offset-assert 0) - (pulse pulse-state 2 :inline :offset-assert 8) - (rot float :offset-assert 40) - (robot-rot float :offset-assert 44) + ((electricity electricity-state :inline) + (pulse pulse-state 2 :inline) + (rot float) + (robot-rot float) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type castle-states -(defmethod inspect castle-states ((this castle-states)) +(defmethod inspect ((this castle-states)) (when (not this) (set! this this) (goto cfg-4) @@ -3435,13 +3357,10 @@ ;; definition of type garage-states (deftype garage-states (structure) () - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) ;; definition for method 3 of type garage-states -(defmethod inspect garage-states ((this garage-states)) +(defmethod inspect ((this garage-states)) (when (not this) (set! this this) (goto cfg-4) @@ -3515,13 +3434,10 @@ ;; definition of type palshaft-states (deftype palshaft-states (structure) () - :method-count-assert 9 - :size-assert #x0 - :flag-assert #x900000000 ) ;; definition for method 3 of type palshaft-states -(defmethod inspect palshaft-states ((this palshaft-states)) +(defmethod inspect ((this palshaft-states)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc index 2f24f7ddaa6..f44a1902020 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc @@ -24,17 +24,14 @@ ;; definition of type ruins-states (deftype ruins-states (structure) - ((light light-state :inline :offset-assert 0) - (spec-0 sp-field-init-spec :offset-assert 8) - (spec-1 sp-field-init-spec :offset-assert 12) + ((light light-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type ruins-states -(defmethod inspect ruins-states ((this ruins-states)) +(defmethod inspect ((this ruins-states)) (when (not this) (set! this this) (goto cfg-4) @@ -96,18 +93,15 @@ ;; definition of type strip-states (deftype strip-states (structure) - ((light0 light-state :inline :offset-assert 0) - (light1 light-state :inline :offset-assert 8) - (spec-0 sp-field-init-spec :offset-assert 16) - (spec-1 sp-field-init-spec :offset-assert 20) + ((light0 light-state :inline) + (light1 light-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type strip-states -(defmethod inspect strip-states ((this strip-states)) +(defmethod inspect ((this strip-states)) (when (not this) (set! this this) (goto cfg-4) @@ -178,16 +172,13 @@ ;; definition of type ctywide-states (deftype ctywide-states (structure) - ((light light-state :inline :offset-assert 0) - (flame flames-state :inline :offset-assert 8) + ((light light-state :inline) + (flame flames-state :inline) ) - :method-count-assert 9 - :size-assert #xf - :flag-assert #x90000000f ) ;; definition for method 3 of type ctywide-states -(defmethod inspect ctywide-states ((this ctywide-states)) +(defmethod inspect ((this ctywide-states)) (when (not this) (set! this this) (goto cfg-4) @@ -236,15 +227,12 @@ ;; definition of type ctyind-states (deftype ctyind-states (structure) - ((light light-state :inline :offset-assert 0) + ((light light-state :inline) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type ctyind-states -(defmethod inspect ctyind-states ((this ctyind-states)) +(defmethod inspect ((this ctyind-states)) (when (not this) (set! this this) (goto cfg-4) @@ -288,20 +276,17 @@ ;; definition of type ctysluma-states (deftype ctysluma-states (structure) - ((light light-state :inline :offset-assert 0) - (neon light-state :inline :offset-assert 8) - (flame flames-state :inline :offset-assert 16) - (spec-0 sp-field-init-spec :offset-assert 24) - (spec-1 sp-field-init-spec :offset-assert 28) - (neon-min-bright float :offset-assert 32) + ((light light-state :inline) + (neon light-state :inline) + (flame flames-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) + (neon-min-bright float) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type ctysluma-states -(defmethod inspect ctysluma-states ((this ctysluma-states)) +(defmethod inspect ((this ctysluma-states)) (when (not this) (set! this this) (goto cfg-4) @@ -367,18 +352,15 @@ ;; definition of type ctyslumb-states (deftype ctyslumb-states (structure) - ((light light-state :inline :offset-assert 0) - (flame flames-state :inline :offset-assert 8) - (spec-0 sp-field-init-spec :offset-assert 16) - (spec-1 sp-field-init-spec :offset-assert 20) + ((light light-state :inline) + (flame flames-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type ctyslumb-states -(defmethod inspect ctyslumb-states ((this ctyslumb-states)) +(defmethod inspect ((this ctyslumb-states)) (when (not this) (set! this this) (goto cfg-4) @@ -442,17 +424,14 @@ ;; definition of type ctyslumc-states (deftype ctyslumc-states (structure) - ((light light-state :inline :offset-assert 0) - (spec-0 sp-field-init-spec :offset-assert 8) - (spec-1 sp-field-init-spec :offset-assert 12) + ((light light-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type ctyslumc-states -(defmethod inspect ctyslumc-states ((this ctyslumc-states)) +(defmethod inspect ((this ctyslumc-states)) (when (not this) (set! this this) (goto cfg-4) @@ -510,17 +489,14 @@ ;; definition of type ctyport-states (deftype ctyport-states (structure) - ((light light-state :inline :offset-assert 0) - (spec-0 sp-field-init-spec :offset-assert 8) - (neon-min-bright float :offset-assert 12) + ((light light-state :inline) + (spec-0 sp-field-init-spec) + (neon-min-bright float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type ctyport-states -(defmethod inspect ctyport-states ((this ctyport-states)) +(defmethod inspect ((this ctyport-states)) (when (not this) (set! this this) (goto cfg-4) @@ -592,16 +568,13 @@ ;; definition of type ctymarka-states (deftype ctymarka-states (structure) - ((light light-state :inline :offset-assert 0) - (blink float :offset-assert 8) + ((light light-state :inline) + (blink float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type ctymarka-states -(defmethod inspect ctymarka-states ((this ctymarka-states)) +(defmethod inspect ((this ctymarka-states)) (when (not this) (set! this this) (goto cfg-4) @@ -640,16 +613,13 @@ ;; definition of type ctymarkb-states (deftype ctymarkb-states (structure) - ((light light-state :inline :offset-assert 0) - (blink float :offset-assert 8) + ((light light-state :inline) + (blink float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type ctymarkb-states -(defmethod inspect ctymarkb-states ((this ctymarkb-states)) +(defmethod inspect ((this ctymarkb-states)) (when (not this) (set! this this) (goto cfg-4) @@ -698,17 +668,14 @@ ;; definition of type palcab-states (deftype palcab-states (structure) - ((light light-state :inline :offset-assert 0) - (turret-value float :offset-assert 8) - (electricity electricity-state :inline :offset-assert 12) + ((light light-state :inline) + (turret-value float) + (electricity electricity-state :inline) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type palcab-states -(defmethod inspect palcab-states ((this palcab-states)) +(defmethod inspect ((this palcab-states)) (when (not this) (set! this this) (goto cfg-4) @@ -775,16 +742,13 @@ ;; definition of type stadium-states (deftype stadium-states (structure) - ((light light-state :inline :offset-assert 0) - (flame flames-state :inline :offset-assert 8) + ((light light-state :inline) + (flame flames-state :inline) ) - :method-count-assert 9 - :size-assert #xf - :flag-assert #x90000000f ) ;; definition for method 3 of type stadium-states -(defmethod inspect stadium-states ((this stadium-states)) +(defmethod inspect ((this stadium-states)) (when (not this) (set! this this) (goto cfg-4) @@ -851,17 +815,14 @@ ;; definition of type stadiumb-states (deftype stadiumb-states (structure) - ((light light-state :inline :offset-assert 0) - (shield-count float :offset-assert 8) - (shield float :offset-assert 12) + ((light light-state :inline) + (shield-count float) + (shield float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type stadiumb-states -(defmethod inspect stadiumb-states ((this stadiumb-states)) +(defmethod inspect ((this stadiumb-states)) (when (not this) (set! this this) (goto cfg-4) @@ -913,16 +874,13 @@ ;; definition of type skatea-states (deftype skatea-states (structure) - ((light light-state :inline :offset-assert 0) - (flame flames-state :inline :offset-assert 8) + ((light light-state :inline) + (flame flames-state :inline) ) - :method-count-assert 9 - :size-assert #xf - :flag-assert #x90000000f ) ;; definition for method 3 of type skatea-states -(defmethod inspect skatea-states ((this skatea-states)) +(defmethod inspect ((this skatea-states)) (when (not this) (set! this this) (goto cfg-4) @@ -952,17 +910,14 @@ ;; definition of type ltentout-states (deftype ltentout-states (structure) - ((light light-state :inline :offset-assert 0) - (flame flames-state :inline :offset-assert 8) - (totem flames-state :inline :offset-assert 16) + ((light light-state :inline) + (flame flames-state :inline) + (totem flames-state :inline) ) - :method-count-assert 9 - :size-assert #x17 - :flag-assert #x900000017 ) ;; definition for method 3 of type ltentout-states -(defmethod inspect ltentout-states ((this ltentout-states)) +(defmethod inspect ((this ltentout-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1005,23 +960,20 @@ ;; definition of type mountain-states (deftype mountain-states (structure) - ((light0 light-state :inline :offset-assert 0) - (light1 light-state :inline :offset-assert 8) - (spec-0 sp-field-init-spec :offset-assert 16) - (spec-1 sp-field-init-spec :offset-assert 20) - (spec-2 sp-field-init-spec :offset-assert 24) - (spec-3 sp-field-init-spec :offset-assert 28) - (spec-4 sp-field-init-spec :offset-assert 32) - (spec-5 sp-field-init-spec :offset-assert 36) - (spec-6 sp-field-init-spec :offset-assert 40) + ((light0 light-state :inline) + (light1 light-state :inline) + (spec-0 sp-field-init-spec) + (spec-1 sp-field-init-spec) + (spec-2 sp-field-init-spec) + (spec-3 sp-field-init-spec) + (spec-4 sp-field-init-spec) + (spec-5 sp-field-init-spec) + (spec-6 sp-field-init-spec) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type mountain-states -(defmethod inspect mountain-states ((this mountain-states)) +(defmethod inspect ((this mountain-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1145,15 +1097,12 @@ ;; definition of type forest-states (deftype forest-states (structure) - ((light light-state :inline :offset-assert 0) + ((light light-state :inline) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type forest-states -(defmethod inspect forest-states ((this forest-states)) +(defmethod inspect ((this forest-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1180,16 +1129,13 @@ ;; definition of type atoll-states (deftype atoll-states (structure) - ((light light-state :inline :offset-assert 0) - (explosion float :offset-assert 8) + ((light light-state :inline) + (explosion float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type atoll-states -(defmethod inspect atoll-states ((this atoll-states)) +(defmethod inspect ((this atoll-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1259,21 +1205,18 @@ ;; definition of type drill-states (deftype drill-states (structure) - ((fire-floor float :offset-assert 0) - (fire-floor-fade float :offset-assert 4) - (fire-floor-flag symbol :offset-assert 8) - (flame flames-state :inline :offset-assert 12) - (electricity electricity-state 2 :inline :offset-assert 20) - (pulse pulse-state :inline :offset 52) - (light-flag basic :offset-assert 56) + ((fire-floor float) + (fire-floor-fade float) + (fire-floor-flag symbol) + (flame flames-state :inline) + (electricity electricity-state 2 :inline) + (pulse pulse-state :inline :offset 52) + (light-flag basic) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) ;; definition for method 3 of type drill-states -(defmethod inspect drill-states ((this drill-states)) +(defmethod inspect ((this drill-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1410,19 +1353,16 @@ ;; definition of type drillb-states (deftype drillb-states (structure) - ((fire-floor float :offset-assert 0) - (fire-floor-fade float :offset-assert 4) - (fire-floor-flag symbol :offset-assert 8) - (pulse pulse-state :inline :offset-assert 12) - (light-flag symbol :offset-assert 16) + ((fire-floor float) + (fire-floor-fade float) + (fire-floor-flag symbol) + (pulse pulse-state :inline) + (light-flag symbol) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type drillb-states -(defmethod inspect drillb-states ((this drillb-states)) +(defmethod inspect ((this drillb-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1479,16 +1419,13 @@ ;; definition of type casboss-states (deftype casboss-states (structure) - ((light light-state :inline :offset-assert 0) - (explosion float :offset-assert 8) + ((light light-state :inline) + (explosion float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type casboss-states -(defmethod inspect casboss-states ((this casboss-states)) +(defmethod inspect ((this casboss-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1574,18 +1511,15 @@ ;; definition of type caspad-states (deftype caspad-states (structure) - ((light light-state :inline :offset-assert 0) - (red float :offset-assert 8) - (white float :offset-assert 12) - (white-count int32 :offset-assert 16) + ((light light-state :inline) + (red float) + (white float) + (white-count int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type caspad-states -(defmethod inspect caspad-states ((this caspad-states)) +(defmethod inspect ((this caspad-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1631,16 +1565,13 @@ ;; definition of type palout-states (deftype palout-states (structure) - ((light light-state :inline :offset-assert 0) - (flame flames-state :inline :offset-assert 8) + ((light light-state :inline) + (flame flames-state :inline) ) - :method-count-assert 9 - :size-assert #xf - :flag-assert #x90000000f ) ;; definition for method 3 of type palout-states -(defmethod inspect palout-states ((this palout-states)) +(defmethod inspect ((this palout-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1685,15 +1616,12 @@ ;; definition of type palroof-states (deftype palroof-states (structure) - ((electricity electricity-state 2 :inline :offset-assert 0) + ((electricity electricity-state 2 :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type palroof-states -(defmethod inspect palroof-states ((this palroof-states)) +(defmethod inspect ((this palroof-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1741,16 +1669,13 @@ ;; definition of type palent-states (deftype palent-states (structure) - ((flame flames-state :inline :offset-assert 0) - (turret-value float :offset-assert 8) + ((flame flames-state :inline) + (turret-value float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type palent-states -(defmethod inspect palent-states ((this palent-states)) +(defmethod inspect ((this palent-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1795,18 +1720,15 @@ ;; definition of type nest-states (deftype nest-states (structure) - ((light light-state :inline :offset-assert 0) - (green-flag symbol :offset-assert 8) - (green float :offset-assert 12) - (green-noise float :offset-assert 16) + ((light light-state :inline) + (green-flag symbol) + (green float) + (green-noise float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type nest-states -(defmethod inspect nest-states ((this nest-states)) +(defmethod inspect ((this nest-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1876,16 +1798,13 @@ ;; definition of type village1-states (deftype village1-states (structure) - ((interp float :offset-assert 0) - (interp-flag symbol :offset-assert 4) + ((interp float) + (interp-flag symbol) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type village1-states -(defmethod inspect village1-states ((this village1-states)) +(defmethod inspect ((this village1-states)) (when (not this) (set! this this) (goto cfg-4) @@ -1984,16 +1903,13 @@ ;; definition of type consite-states (deftype consite-states (structure) - ((light light-state :inline :offset-assert 0) - (flash float :offset-assert 8) + ((light light-state :inline) + (flash float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type consite-states -(defmethod inspect consite-states ((this consite-states)) +(defmethod inspect ((this consite-states)) (when (not this) (set! this this) (goto cfg-4) @@ -2053,15 +1969,12 @@ ;; definition of type mincan-states (deftype mincan-states (structure) - ((beams float 2 :offset-assert 0) + ((beams float 2) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type mincan-states -(defmethod inspect mincan-states ((this mincan-states)) +(defmethod inspect ((this mincan-states)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc index cd67ee101ff..7e3ed72681f 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc @@ -3,16 +3,13 @@ ;; definition of type mood-channel (deftype mood-channel (structure) - ((data float 24 :offset-assert 0) - (vecs vector4 6 :inline :offset 0) + ((data float 24) + (vecs vector4 6 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type mood-channel -(defmethod inspect mood-channel ((this mood-channel)) +(defmethod inspect ((this mood-channel)) (when (not this) (set! this this) (goto cfg-4) @@ -26,15 +23,12 @@ ;; definition of type mood-channel-group (deftype mood-channel-group (structure) - ((data mood-channel 4 :inline :offset-assert 0) + ((data mood-channel 4 :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;; definition for method 3 of type mood-channel-group -(defmethod inspect mood-channel-group ((this mood-channel-group)) +(defmethod inspect ((this mood-channel-group)) (when (not this) (set! this this) (goto cfg-4) @@ -47,21 +41,18 @@ ;; definition of type mood-fog (deftype mood-fog (structure) - ((fog-color vector :inline :offset-assert 0) - (fog-dists vector :inline :offset-assert 16) - (fog-start meters :offset 16) - (fog-end meters :offset 20) - (fog-max float :offset 24) - (fog-min float :offset 28) - (erase-color vector :inline :offset-assert 32) + ((fog-color vector :inline) + (fog-dists vector :inline) + (fog-start meters :overlay-at (-> fog-dists data 0)) + (fog-end meters :overlay-at (-> fog-dists data 1)) + (fog-max float :overlay-at (-> fog-dists data 2)) + (fog-min float :overlay-at (-> fog-dists data 3)) + (erase-color vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type mood-fog -(defmethod inspect mood-fog ((this mood-fog)) +(defmethod inspect ((this mood-fog)) (when (not this) (set! this this) (goto cfg-4) @@ -80,16 +71,13 @@ ;; definition of type mood-fog-table (deftype mood-fog-table (structure) - ((data mood-fog 8 :inline :offset-assert 0) - (data-raw uint128 24 :offset 0) + ((data mood-fog 8 :inline) + (data-raw uint128 24 :overlay-at data) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;; definition for method 3 of type mood-fog-table -(defmethod inspect mood-fog-table ((this mood-fog-table)) +(defmethod inspect ((this mood-fog-table)) (when (not this) (set! this this) (goto cfg-4) @@ -102,16 +90,13 @@ ;; definition of type mood-color (deftype mood-color (structure) - ((lgt-color vector :inline :offset-assert 0) - (amb-color vector :inline :offset-assert 16) + ((lgt-color vector :inline) + (amb-color vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type mood-color -(defmethod inspect mood-color ((this mood-color)) +(defmethod inspect ((this mood-color)) (when (not this) (set! this this) (goto cfg-4) @@ -125,15 +110,12 @@ ;; definition of type mood-direction-table (deftype mood-direction-table (structure) - ((data vector 4 :inline :offset-assert 0) + ((data vector 4 :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type mood-direction-table -(defmethod inspect mood-direction-table ((this mood-direction-table)) +(defmethod inspect ((this mood-direction-table)) (when (not this) (set! this this) (goto cfg-4) @@ -146,16 +128,13 @@ ;; definition of type mood-color-table (deftype mood-color-table (structure) - ((data mood-color 8 :inline :offset-assert 0) - (data-raw uint128 16 :offset 0) + ((data mood-color 8 :inline) + (data-raw uint128 16 :overlay-at data) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; definition for method 3 of type mood-color-table -(defmethod inspect mood-color-table ((this mood-color-table)) +(defmethod inspect ((this mood-color-table)) (when (not this) (set! this this) (goto cfg-4) @@ -168,15 +147,12 @@ ;; definition of type mood-sky-table (deftype mood-sky-table (structure) - ((data vector 8 :inline :offset-assert 0) + ((data vector 8 :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type mood-sky-table -(defmethod inspect mood-sky-table ((this mood-sky-table)) +(defmethod inspect ((this mood-sky-table)) (when (not this) (set! this this) (goto cfg-4) @@ -189,16 +165,13 @@ ;; definition of type mood-clouds (deftype mood-clouds (structure) - ((cloud-min float :offset-assert 0) - (cloud-max float :offset-assert 4) + ((cloud-min float) + (cloud-max float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type mood-clouds -(defmethod inspect mood-clouds ((this mood-clouds)) +(defmethod inspect ((this mood-clouds)) (when (not this) (set! this this) (goto cfg-4) @@ -212,19 +185,16 @@ ;; definition of type mood-weather (deftype mood-weather (structure) - ((data float 2 :offset-assert 0) - (cloud float :offset 0) - (fog float :offset 4) + ((data float 2) + (cloud float :overlay-at (-> data 0)) + (fog float :overlay-at (-> data 1)) ) :pack-me :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type mood-weather -(defmethod inspect mood-weather ((this mood-weather)) +(defmethod inspect ((this mood-weather)) (when (not this) (set! this this) (goto cfg-4) @@ -239,18 +209,15 @@ ;; definition of type mood-iweather (deftype mood-iweather (structure) - ((data int32 2 :offset-assert 0) - (cloud int32 :offset 0) - (fog int32 :offset 4) + ((data int32 2) + (cloud int32 :overlay-at (-> data 0)) + (fog int32 :overlay-at (-> data 1)) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type mood-iweather -(defmethod inspect mood-iweather ((this mood-iweather)) +(defmethod inspect ((this mood-iweather)) (when (not this) (set! this this) (goto cfg-4) @@ -265,21 +232,18 @@ ;; definition of type mood-range (deftype mood-range (structure) - ((data float 4 :offset-assert 0) - (min-cloud float :offset 0) - (max-cloud float :offset 4) - (min-fog float :offset 8) - (max-fog float :offset 12) - (quad uint128 :offset 0) + ((data float 4) + (min-cloud float :overlay-at (-> data 0)) + (max-cloud float :overlay-at (-> data 1)) + (min-fog float :overlay-at (-> data 2)) + (max-fog float :overlay-at (-> data 3)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type mood-range ;; INFO: Used lq/sq -(defmethod inspect mood-range ((this mood-range)) +(defmethod inspect ((this mood-range)) (when (not this) (set! this this) (goto cfg-4) @@ -297,15 +261,12 @@ ;; definition of type mood-filters-table (deftype mood-filters-table (structure) - ((data vector 8 :inline :offset-assert 0) + ((data vector 8 :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type mood-filters-table -(defmethod inspect mood-filters-table ((this mood-filters-table)) +(defmethod inspect ((this mood-filters-table)) (when (not this) (set! this this) (goto cfg-4) @@ -318,20 +279,17 @@ ;; definition of type mood-table (deftype mood-table (basic) - ((mood-fog-table mood-fog-table :offset-assert 4) - (mood-color-table mood-color-table :offset-assert 8) - (mood-channel-group mood-channel-group :offset-assert 12) - (mood-direction-table mood-direction-table :offset-assert 16) - (mood-sky-table mood-sky-table :offset-assert 20) - (mood-interp-table sky-color-day :offset-assert 24) + ((mood-fog-table mood-fog-table) + (mood-color-table mood-color-table) + (mood-channel-group mood-channel-group) + (mood-direction-table mood-direction-table) + (mood-sky-table mood-sky-table) + (mood-interp-table sky-color-day) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type mood-table -(defmethod inspect mood-table ((this mood-table)) +(defmethod inspect ((this mood-table)) (when (not this) (set! this this) (goto cfg-4) @@ -349,19 +307,16 @@ ;; definition of type mood-context-core (deftype mood-context-core (structure) - ((current-fog mood-fog :inline :offset-assert 0) - (current-sky-color vector :inline :offset-assert 48) - (current-env-color vector :inline :offset-assert 64) - (current-prt-color vector :inline :offset-assert 80) - (current-shadow-color vector :inline :offset-assert 96) + ((current-fog mood-fog :inline) + (current-sky-color vector :inline) + (current-env-color vector :inline) + (current-prt-color vector :inline) + (current-shadow-color vector :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type mood-context-core -(defmethod inspect mood-context-core ((this mood-context-core)) +(defmethod inspect ((this mood-context-core)) (when (not this) (set! this this) (goto cfg-4) @@ -378,15 +333,12 @@ ;; definition of type mood-context-core2 (deftype mood-context-core2 (mood-context-core) - ((light-group light-group 8 :inline :offset-assert 112) + ((light-group light-group 8 :inline) ) - :method-count-assert 9 - :size-assert #x670 - :flag-assert #x900000670 ) ;; definition for method 3 of type mood-context-core2 -(defmethod inspect mood-context-core2 ((this mood-context-core2)) +(defmethod inspect ((this mood-context-core2)) (when (not this) (set! this this) (goto cfg-4) @@ -404,15 +356,12 @@ ;; definition of type mood-context-core3 (deftype mood-context-core3 (mood-context-core2) - ((times vector 8 :inline :offset-assert 1648) + ((times vector 8 :inline) ) - :method-count-assert 9 - :size-assert #x6f0 - :flag-assert #x9000006f0 ) ;; definition for method 3 of type mood-context-core3 -(defmethod inspect mood-context-core3 ((this mood-context-core3)) +(defmethod inspect ((this mood-context-core3)) (when (not this) (set! this this) (goto cfg-4) @@ -433,17 +382,14 @@ (deftype mood-context (mood-context-core3) "`state` holds an arbitrary state structure, ie `[[sewer-states]]` and is used when updating the mood. This means that an individual state structure must be less than 128 bytes" - ((itimes vector4w 4 :inline :offset-assert 1776) - (state uint32 32 :offset-assert 1840) - (data uint128 123 :offset 0) + ((itimes vector4w 4 :inline) + (state uint32 32) + (data uint128 123 :overlay-at (-> current-fog fog-color data 0)) ) - :method-count-assert 9 - :size-assert #x7b0 - :flag-assert #x9000007b0 ) ;; definition for method 3 of type mood-context -(defmethod inspect mood-context ((this mood-context)) +(defmethod inspect ((this mood-context)) (when (not this) (set! this this) (goto cfg-4) @@ -464,24 +410,21 @@ when updating the mood. This means that an individual state structure must be l ;; definition of type mood-control-work (deftype mood-control-work (structure) - ((weather mood-weather :inline :offset-assert 0) - (iweather mood-iweather :inline :offset-assert 8) - (interp mood-weather :inline :offset-assert 16) - (index int32 4 :offset-assert 24) - (color-interp float :offset-assert 40) - (color-index int32 2 :offset-assert 44) - (channel-interp float :offset-assert 52) - (channel-index int32 2 :offset-assert 56) - (cloud-interp float :offset-assert 64) - (cloud-index int32 2 :offset-assert 68) + ((weather mood-weather :inline) + (iweather mood-iweather :inline) + (interp mood-weather :inline) + (index int32 4) + (color-interp float) + (color-index int32 2) + (channel-interp float) + (channel-index int32 2) + (cloud-interp float) + (cloud-index int32 2) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) ;; definition for method 3 of type mood-control-work -(defmethod inspect mood-control-work ((this mood-control-work)) +(defmethod inspect ((this mood-control-work)) (when (not this) (set! this this) (goto cfg-4) @@ -503,52 +446,49 @@ when updating the mood. This means that an individual state structure must be l ;; definition of type mood-control (deftype mood-control (mood-table) - ((mood-clouds mood-clouds :offset-assert 28) - (current-interp mood-weather :inline :offset-assert 32) - (target-interp mood-weather :inline :offset-assert 40) - (speed-interp mood-weather :inline :offset-assert 48) - (range mood-range :inline :offset-assert 64) - (time-until-random mood-weather :inline :offset-assert 80) - (time-until-random-min mood-weather :inline :offset-assert 88) - (time-until-random-max mood-weather :inline :offset-assert 96) - (display-flag symbol :offset-assert 104) - (overide-weather-flag symbol :offset-assert 108) - (overide mood-weather :inline :offset-assert 112) - (lightning-index int32 :offset-assert 120) - (lightning-val int32 :offset-assert 124) - (lightning-time int32 :offset-assert 128) - (lightning-time2 float :offset-assert 132) - (lightning-flash float :offset-assert 136) - (lightning-id sound-id :offset-assert 140) - (lightning-count0 uint32 :offset-assert 144) - (lightning-count1 uint32 :offset-assert 148) - (lightning-count2 uint32 :offset-assert 152) - (rain-id sound-id :offset-assert 156) - (sound-pitch float :offset-assert 160) - (fogs mood-fog-table 9 :offset-assert 164) - (colors mood-color-table 3 :offset-assert 200) - (channels mood-channel-group 3 :offset-assert 212) - (clouds mood-clouds 9 :offset-assert 224) + ((mood-clouds mood-clouds) + (current-interp mood-weather :inline) + (target-interp mood-weather :inline) + (speed-interp mood-weather :inline) + (range mood-range :inline) + (time-until-random mood-weather :inline) + (time-until-random-min mood-weather :inline) + (time-until-random-max mood-weather :inline) + (display-flag symbol) + (overide-weather-flag symbol) + (overide mood-weather :inline) + (lightning-index int32) + (lightning-val int32) + (lightning-time int32) + (lightning-time2 float) + (lightning-flash float) + (lightning-id sound-id) + (lightning-count0 uint32) + (lightning-count1 uint32) + (lightning-count2 uint32) + (rain-id sound-id) + (sound-pitch float) + (fogs mood-fog-table 9) + (colors mood-color-table 3) + (channels mood-channel-group 3) + (clouds mood-clouds 9) ) - :method-count-assert 19 - :size-assert #x104 - :flag-assert #x1300000104 (:methods - (init-weather! (_type_) none :behavior process 9) - (update-mood-weather! (_type_ float float float float) none 10) - (update-mood-range! (_type_ float float float float) none 11) - (set-time-for-random-weather! (_type_ float float) none 12) - (apply-mood-clouds-and-fog (_type_ mood-control-work) none 13) - (apply-mood-color (_type_ mood-control-work) none 14) - (apply-mood-channels (_type_ mood-control-work) none 15) - (adjust-num-clouds! (_type_ mood-control-work) none 16) - (gen-lightning-and-thunder! (_type_) number 17) - (play-or-stop-lightning! (_type_ sound-spec vector) sound-id 18) + (init-weather! (_type_) none :behavior process) + (update-mood-weather! (_type_ float float float float) none) + (update-mood-range! (_type_ float float float float) none) + (set-time-for-random-weather! (_type_ float float) none) + (apply-mood-clouds-and-fog (_type_ mood-control-work) none) + (apply-mood-color (_type_ mood-control-work) none) + (apply-mood-channels (_type_ mood-control-work) none) + (adjust-num-clouds! (_type_ mood-control-work) none) + (gen-lightning-and-thunder! (_type_) number) + (play-or-stop-lightning! (_type_ sound-spec vector) sound-id) ) ) ;; definition for method 3 of type mood-control -(defmethod inspect mood-control ((this mood-control)) +(defmethod inspect ((this mood-control)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc index 6844faab5ae..542f99d5d6a 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc @@ -625,19 +625,16 @@ ;; definition of type flames-state (deftype flames-state (structure) - ((time float :offset-assert 0) - (index uint8 :offset-assert 4) - (length uint8 :offset-assert 5) - (height uint8 :offset-assert 6) + ((time float) + (index uint8) + (length uint8) + (height uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x7 - :flag-assert #x900000007 ) ;; definition for method 3 of type flames-state -(defmethod inspect flames-state ((this flames-state)) +(defmethod inspect ((this flames-state)) (when (not this) (set! this this) (goto cfg-4) @@ -754,17 +751,14 @@ ;; definition of type light-state (deftype light-state (structure) - ((time float :offset-assert 0) - (fade float :offset-assert 4) + ((time float) + (fade float) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type light-state -(defmethod inspect light-state ((this light-state)) +(defmethod inspect ((this light-state)) (when (not this) (set! this this) (goto cfg-4) @@ -845,15 +839,12 @@ ;; definition of type lava-state (deftype lava-state (structure) - ((lava float :offset-assert 0) + ((lava float) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type lava-state -(defmethod inspect lava-state ((this lava-state)) +(defmethod inspect ((this lava-state)) (when (not this) (set! this this) (goto cfg-4) @@ -880,16 +871,13 @@ ;; definition of type flicker-state (deftype flicker-state (structure) - ((flicker-off uint8 :offset-assert 0) - (flicker-on uint8 :offset-assert 1) + ((flicker-off uint8) + (flicker-on uint8) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition for method 3 of type flicker-state -(defmethod inspect flicker-state ((this flicker-state)) +(defmethod inspect ((this flicker-state)) (when (not this) (set! this this) (goto cfg-4) @@ -932,17 +920,14 @@ ;; definition of type florescent-state (deftype florescent-state (structure) - ((value float :offset-assert 0) - (delay int8 :offset-assert 4) - (delay2 int8 :offset-assert 5) + ((value float) + (delay int8) + (delay2 int8) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) ;; definition for method 3 of type florescent-state -(defmethod inspect florescent-state ((this florescent-state)) +(defmethod inspect ((this florescent-state)) (when (not this) (set! this this) (goto cfg-4) @@ -984,17 +969,14 @@ ;; definition of type electricity-state (deftype electricity-state (structure) - ((value float :offset-assert 0) - (scale float :offset-assert 4) + ((value float) + (scale float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type electricity-state -(defmethod inspect electricity-state ((this electricity-state)) +(defmethod inspect ((this electricity-state)) (when (not this) (set! this this) (goto cfg-4) @@ -1020,16 +1002,13 @@ ;; definition of type pulse-state (deftype pulse-state (structure) - ((pulse float :offset-assert 0) + ((pulse float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type pulse-state -(defmethod inspect pulse-state ((this pulse-state)) +(defmethod inspect ((this pulse-state)) (when (not this) (set! this this) (goto cfg-4) @@ -1054,16 +1033,13 @@ ;; definition of type strobe-state (deftype strobe-state (structure) - ((time float :offset-assert 0) + ((time float) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type strobe-state -(defmethod inspect strobe-state ((this strobe-state)) +(defmethod inspect ((this strobe-state)) (when (not this) (set! this this) (goto cfg-4) @@ -1101,7 +1077,7 @@ ;; definition for method 13 of type mood-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod apply-mood-clouds-and-fog mood-control ((this mood-control) (arg0 mood-control-work)) +(defmethod apply-mood-clouds-and-fog ((this mood-control) (arg0 mood-control-work)) (let ((v1-0 (-> this mood-fog-table))) (dotimes (a0-1 24) (set! (-> v1-0 data-raw a0-1) (the-as uint128 0)) @@ -1183,7 +1159,7 @@ ;; definition for method 14 of type mood-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod apply-mood-color mood-control ((this mood-control) (arg0 mood-control-work)) +(defmethod apply-mood-color ((this mood-control) (arg0 mood-control-work)) (let ((v1-0 (-> this mood-color-table))) (dotimes (a0-1 16) (set! (-> v1-0 data-raw a0-1) (the-as uint128 0)) @@ -1224,7 +1200,7 @@ ;; definition for method 15 of type mood-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod apply-mood-channels mood-control ((this mood-control) (arg0 mood-control-work)) +(defmethod apply-mood-channels ((this mood-control) (arg0 mood-control-work)) (let ((v1-0 (-> this mood-channel-group))) (dotimes (a0-1 24) (set! (-> v1-0 data 0 vecs a0-1 quad) (the-as uint128 0)) @@ -1264,7 +1240,7 @@ ;; definition for method 16 of type mood-control ;; WARN: Return type mismatch int vs none. -(defmethod adjust-num-clouds! mood-control ((this mood-control) (arg0 mood-control-work)) +(defmethod adjust-num-clouds! ((this mood-control) (arg0 mood-control-work)) (let ((v1-0 (-> this mood-clouds))) (set! (-> v1-0 cloud-min) 0.0) (set! (-> v1-0 cloud-max) 0.0) @@ -1291,7 +1267,7 @@ ;; definition for method 18 of type mood-control ;; WARN: Return type mismatch int vs sound-id. -(defmethod play-or-stop-lightning! mood-control ((this mood-control) (arg0 sound-spec) (arg1 vector)) +(defmethod play-or-stop-lightning! ((this mood-control) (arg0 sound-spec) (arg1 vector)) "Handles playing/stopping of the lightning sound - Plays the lightning sound if we are not loading and `lightning-id` is zero - Stops the lightning sound first if `lightning-id` is non-zero @@ -1324,7 +1300,7 @@ Returns the current value of `lightning-id`" ;; definition for method 17 of type mood-control ;; INFO: Used lq/sq ;; WARN: disable def twice: 141. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod gen-lightning-and-thunder! mood-control ((this mood-control)) +(defmethod gen-lightning-and-thunder! ((this mood-control)) (local-vars (a1-1 (array float))) (let ((v1-3 (-> this mood-channel-group data (-> this lightning-index) vecs)) (a1-0 (-> this lightning-val)) @@ -1459,7 +1435,7 @@ Returns the current value of `lightning-id`" ;; definition for method 9 of type mood-control ;; WARN: Return type mismatch int vs none. -(defmethod init-weather! mood-control ((this mood-control)) +(defmethod init-weather! ((this mood-control)) (local-vars (v1-39 int)) (let ((s5-0 (level-get-target-inside *level*))) (when s5-0 @@ -1706,7 +1682,7 @@ Returns the current value of `lightning-id`" ;; definition for method 10 of type mood-control ;; WARN: Return type mismatch int vs none. -(defmethod update-mood-weather! mood-control ((this mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float)) +(defmethod update-mood-weather! ((this mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float)) "Set the `target-interp` and `speed-interp` for the clouds and fog If `*-speed` is 0.0, use the `*-target` args to set `current-interp` See [[mood-weather]]" @@ -1726,7 +1702,7 @@ See [[mood-weather]]" ;; definition for method 11 of type mood-control ;; WARN: Return type mismatch int vs none. -(defmethod update-mood-range! mood-control ((this mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float)) +(defmethod update-mood-range! ((this mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float)) "Set the minimum and maximum ranges of clouds and fog See [[mood-range]]" (set! (-> this range min-cloud) min-cloud) @@ -1739,7 +1715,7 @@ See [[mood-range]]" ;; definition for method 12 of type mood-control ;; WARN: Return type mismatch int vs none. -(defmethod set-time-for-random-weather! mood-control ((this mood-control) (arg0 float) (arg1 float)) +(defmethod set-time-for-random-weather! ((this mood-control) (arg0 float) (arg1 float)) "Set the `time-until-random`'s cloud and fog values See [[mood-weather]]" (set! (-> this time-until-random cloud) arg0) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day-h_REF.gc index a54334e5cf9..03ad068c086 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type palette-fade-control (deftype palette-fade-control (structure) - ((trans vector :inline :offset-assert 0) - (fade float :offset-assert 16) - (actor-dist float :offset-assert 20) + ((trans vector :inline) + (fade float) + (actor-dist float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type palette-fade-control -(defmethod inspect palette-fade-control ((this palette-fade-control)) +(defmethod inspect ((this palette-fade-control)) (when (not this) (set! this this) (goto cfg-4) @@ -28,19 +25,16 @@ ;; definition of type palette-fade-controls (deftype palette-fade-controls (basic) - ((control palette-fade-control 8 :inline :offset-assert 16) + ((control palette-fade-control 8 :inline) ) - :method-count-assert 11 - :size-assert #x110 - :flag-assert #xb00000110 (:methods - (reset! (_type_) none 9) - (set-fade! (_type_ int float float vector) object 10) + (reset! (_type_) none) + (set-fade! (_type_ int float float vector) object) ) ) ;; definition for method 3 of type palette-fade-controls -(defmethod inspect palette-fade-controls ((this palette-fade-controls)) +(defmethod inspect ((this palette-fade-controls)) (when (not this) (set! this this) (goto cfg-4) @@ -56,34 +50,30 @@ ;; definition of type time-of-day-proc (deftype time-of-day-proc (process) - ((hours int32 :offset-assert 128) - (minutes int32 :offset-assert 132) - (seconds int32 :offset-assert 136) - (old-frame uint64 :offset-assert 144) - (current-frame uint64 :offset-assert 152) - (frames uint64 :offset-assert 160) - (time-of-day float :offset-assert 168) - (time-ratio float :offset-assert 172) - (dest-time-ratio float :offset-assert 176) - (dest-time-delta float :offset-assert 180) - (sun-count int32 :offset-assert 184) - (sun sparticle-launch-control :offset-assert 188) - (green-sun-count int32 :offset-assert 192) - (green-sun sparticle-launch-control :offset-assert 196) - (moon-count int32 :offset-assert 200) - (moon sparticle-launch-control :offset-assert 204) + ((hours int32) + (minutes int32) + (seconds int32) + (old-frame uint64) + (current-frame uint64) + (frames uint64) + (time-of-day float) + (time-ratio float) + (dest-time-ratio float) + (dest-time-delta float) + (sun-count int32) + (sun sparticle-launch-control) + (green-sun-count int32) + (green-sun sparticle-launch-control) + (moon-count int32) + (moon sparticle-launch-control) ) - :heap-base #x50 - :method-count-assert 14 - :size-assert #xd0 - :flag-assert #xe005000d0 (:states time-of-day-tick ) ) ;; definition for method 3 of type time-of-day-proc -(defmethod inspect time-of-day-proc ((this time-of-day-proc)) +(defmethod inspect ((this time-of-day-proc)) (when (not this) (set! this this) (goto cfg-4) @@ -113,18 +103,15 @@ ;; definition of type time-of-day-palette (deftype time-of-day-palette (basic) - ((width int32 :offset-assert 4) - (height int32 :offset-assert 8) - (pad int32 :offset-assert 12) - (data int32 1 :offset-assert 16) + ((width int32) + (height int32) + (pad int32) + (data int32 1) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type time-of-day-palette -(defmethod inspect time-of-day-palette ((this time-of-day-palette)) +(defmethod inspect ((this time-of-day-palette)) (when (not this) (set! this this) (goto cfg-4) @@ -140,39 +127,36 @@ ;; definition of type time-of-day-context (deftype time-of-day-context (basic) - ((interp float 6 :offset-assert 4) - (current-fog mood-fog :inline :offset-assert 32) - (current-sky-color vector :inline :offset-assert 80) - (current-env-color vector :inline :offset-assert 96) - (current-prt-color vector :inline :offset-assert 112) - (current-shadow-color vector :inline :offset-assert 128) - (light-group light-group 8 :inline :offset-assert 144) - (current-clouds mood-clouds :inline :offset-assert 1680) - (times vector 8 :inline :offset-assert 1696) - (title-light-group light-group :inline :offset-assert 1824) - (filter vector :inline :offset-assert 2016) - (filter-color vector :inline :offset-assert 2032) - (time float :offset-assert 2048) - (target-interp float :offset-assert 2052) - (erase-color rgba :offset-assert 2056) - (sky symbol :offset-assert 2060) - (use-camera-other basic :offset-assert 2064) - (title-updated symbol :offset-assert 2068) - (mode time-of-day-palette-id :offset-assert 2072) - (overide-enable symbol :offset-assert 2076) - (overide-palette time-of-day-palette-id :offset-assert 2080) - (max-rain float :offset-assert 2084) - (fog-mult float :offset-assert 2088) - (exterior-level basic :offset-assert 2092) - (ocean-alpha float :offset-assert 2096) + ((interp float 6) + (current-fog mood-fog :inline) + (current-sky-color vector :inline) + (current-env-color vector :inline) + (current-prt-color vector :inline) + (current-shadow-color vector :inline) + (light-group light-group 8 :inline) + (current-clouds mood-clouds :inline) + (times vector 8 :inline) + (title-light-group light-group :inline) + (filter vector :inline) + (filter-color vector :inline) + (time float) + (target-interp float) + (erase-color rgba) + (sky symbol) + (use-camera-other basic) + (title-updated symbol) + (mode time-of-day-palette-id) + (overide-enable symbol) + (overide-palette time-of-day-palette-id) + (max-rain float) + (fog-mult float) + (exterior-level basic) + (ocean-alpha float) ) - :method-count-assert 9 - :size-assert #x834 - :flag-assert #x900000834 ) ;; definition for method 3 of type time-of-day-context -(defmethod inspect time-of-day-context ((this time-of-day-context)) +(defmethod inspect ((this time-of-day-context)) (when (not this) (set! this this) (goto cfg-4) @@ -209,18 +193,15 @@ ;; definition of type time-of-day-dma (deftype time-of-day-dma (structure) - ((outa uint32 256 :offset-assert 0) - (outb uint32 256 :offset-assert 1024) - (banka uint32 256 :offset-assert 2048) - (bankb uint32 256 :offset-assert 3072) + ((outa uint32 256) + (outb uint32 256) + (banka uint32 256) + (bankb uint32 256) ) - :method-count-assert 9 - :size-assert #x1000 - :flag-assert #x900001000 ) ;; definition for method 3 of type time-of-day-dma -(defmethod inspect time-of-day-dma ((this time-of-day-dma)) +(defmethod inspect ((this time-of-day-dma)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc index 13056bf28b1..8add50c706e 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc @@ -3,12 +3,12 @@ ;; definition for method 5 of type time-of-day-palette ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of time-of-day-palette ((this time-of-day-palette)) +(defmethod asize-of ((this time-of-day-palette)) (the-as int (+ (-> this type size) (* (* (-> this height) (-> this width)) 4))) ) ;; definition for method 10 of type time-of-day-proc -(defmethod deactivate time-of-day-proc ((this time-of-day-proc)) +(defmethod deactivate ((this time-of-day-proc)) (if (nonzero? (-> this sun)) (kill-and-free-particles (-> this sun)) ) @@ -651,7 +651,7 @@ ;; definition for method 10 of type palette-fade-controls ;; INFO: Used lq/sq -(defmethod set-fade! palette-fade-controls ((this palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) +(defmethod set-fade! ((this palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) (cond ((and (>= arg0 0) (< arg0 8)) (let ((v1-3 (-> this control arg0))) @@ -672,7 +672,7 @@ ;; definition for method 9 of type palette-fade-controls ;; WARN: Return type mismatch int vs none. -(defmethod reset! palette-fade-controls ((this palette-fade-controls)) +(defmethod reset! ((this palette-fade-controls)) (countdown (v1-0 8) (let ((a1-2 (-> this control v1-0))) (set! (-> a1-2 fade) 0.0) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc index 689716c74c0..9331f962f41 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type ocean-corner (deftype ocean-corner (structure) - ((bsphere sphere :inline :offset-assert 0) - (start-corner vector :inline :offset-assert 16) - (y-scales vector :inline :offset-assert 32) - (alphas vector :inline :offset-assert 48) - (colors uint32 4 :offset-assert 64) + ((bsphere sphere :inline) + (start-corner vector :inline) + (y-scales vector :inline) + (alphas vector :inline) + (colors uint32 4) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type ocean-corner -(defmethod inspect ocean-corner ((this ocean-corner)) +(defmethod inspect ((this ocean-corner)) (when (not this) (set! this this) (goto cfg-4) @@ -32,22 +29,19 @@ ;; definition of type ocean-wave-info (deftype ocean-wave-info (structure) - ((frequency float :offset-assert 0) - (amplitude float :offset-assert 4) - (wave-speed float :offset-assert 8) - (angle float :offset-assert 12) - (kx float :offset-assert 16) - (ky float :offset-assert 20) - (w float :offset-assert 24) - (flags int32 :offset-assert 28) + ((frequency float) + (amplitude float) + (wave-speed float) + (angle float) + (kx float) + (ky float) + (w float) + (flags int32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type ocean-wave-info -(defmethod inspect ocean-wave-info ((this ocean-wave-info)) +(defmethod inspect ((this ocean-wave-info)) (when (not this) (set! this this) (goto cfg-4) @@ -67,17 +61,14 @@ ;; definition of type ocean-vertex (deftype ocean-vertex (structure) - ((pos vector :inline :offset-assert 0) - (stq vector :inline :offset-assert 16) - (col vector :inline :offset-assert 32) + ((pos vector :inline) + (stq vector :inline) + (col vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type ocean-vertex -(defmethod inspect ocean-vertex ((this ocean-vertex)) +(defmethod inspect ((this ocean-vertex)) (when (not this) (set! this this) (goto cfg-4) @@ -92,15 +83,12 @@ ;; definition of type ocean-spheres (deftype ocean-spheres (structure) - ((spheres sphere 36 :inline :offset-assert 0) + ((spheres sphere 36 :inline) ) - :method-count-assert 9 - :size-assert #x240 - :flag-assert #x900000240 ) ;; definition for method 3 of type ocean-spheres -(defmethod inspect ocean-spheres ((this ocean-spheres)) +(defmethod inspect ((this ocean-spheres)) (when (not this) (set! this this) (goto cfg-4) @@ -113,15 +101,12 @@ ;; definition of type ocean-colors (deftype ocean-colors (structure) - ((colors rgba 2548 :offset-assert 0) + ((colors rgba 2548) ) - :method-count-assert 9 - :size-assert #x27d0 - :flag-assert #x9000027d0 ) ;; definition for method 3 of type ocean-colors -(defmethod inspect ocean-colors ((this ocean-colors)) +(defmethod inspect ((this ocean-colors)) (when (not this) (set! this this) (goto cfg-4) @@ -134,15 +119,12 @@ ;; definition of type ocean-colors-float (deftype ocean-colors-float (structure) - ((colors vector 2548 :inline :offset-assert 0) + ((colors vector 2548 :inline) ) - :method-count-assert 9 - :size-assert #x9f40 - :flag-assert #x900009f40 ) ;; definition for method 3 of type ocean-colors-float -(defmethod inspect ocean-colors-float ((this ocean-colors-float)) +(defmethod inspect ((this ocean-colors-float)) (when (not this) (set! this this) (goto cfg-4) @@ -155,17 +137,14 @@ ;; definition of type ocean-mid-mask (deftype ocean-mid-mask (structure) - ((mask uint8 8 :offset-assert 0) - (dword uint64 :offset 0) + ((mask uint8 8) + (dword uint64 :overlay-at (-> mask 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type ocean-mid-mask -(defmethod inspect ocean-mid-mask ((this ocean-mid-mask)) +(defmethod inspect ((this ocean-mid-mask)) (when (not this) (set! this this) (goto cfg-4) @@ -179,15 +158,12 @@ ;; definition of type ocean-mid-indices (deftype ocean-mid-indices (basic) - ((data uint16 36 :offset-assert 4) + ((data uint16 36) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) ;; definition for method 3 of type ocean-mid-indices -(defmethod inspect ocean-mid-indices ((this ocean-mid-indices)) +(defmethod inspect ((this ocean-mid-indices)) (when (not this) (set! this this) (goto cfg-4) @@ -200,15 +176,12 @@ ;; definition of type ocean-mid-masks (deftype ocean-mid-masks (basic) - ((data (inline-array ocean-mid-mask) :offset-assert 4) + ((data (inline-array ocean-mid-mask)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type ocean-mid-masks -(defmethod inspect ocean-mid-masks ((this ocean-mid-masks)) +(defmethod inspect ((this ocean-mid-masks)) (when (not this) (set! this this) (goto cfg-4) @@ -221,16 +194,13 @@ ;; definition of type ocean-trans-mask (deftype ocean-trans-mask (structure) - ((mask uint8 4 :offset-assert 0) - (word int32 :offset 0) + ((mask uint8 4) + (word int32 :overlay-at (-> mask 0)) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type ocean-trans-mask -(defmethod inspect ocean-trans-mask ((this ocean-trans-mask)) +(defmethod inspect ((this ocean-trans-mask)) (when (not this) (set! this this) (goto cfg-4) @@ -244,17 +214,14 @@ ;; definition of type ocean-trans-index (deftype ocean-trans-index (structure) - ((parent int16 :offset-assert 0) - (child int16 :offset-assert 2) + ((parent int16) + (child int16) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type ocean-trans-index -(defmethod inspect ocean-trans-index ((this ocean-trans-index)) +(defmethod inspect ((this ocean-trans-index)) (when (not this) (set! this this) (goto cfg-4) @@ -268,15 +235,12 @@ ;; definition of type ocean-trans-indices (deftype ocean-trans-indices (basic) - ((data ocean-trans-index 2304 :inline :offset-assert 4) + ((data ocean-trans-index 2304 :inline) ) - :method-count-assert 9 - :size-assert #x2404 - :flag-assert #x900002404 ) ;; definition for method 3 of type ocean-trans-indices -(defmethod inspect ocean-trans-indices ((this ocean-trans-indices)) +(defmethod inspect ((this ocean-trans-indices)) (when (not this) (set! this this) (goto cfg-4) @@ -289,15 +253,12 @@ ;; definition of type ocean-near-index (deftype ocean-near-index (structure) - ((data uint16 16 :offset-assert 0) + ((data uint16 16) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type ocean-near-index -(defmethod inspect ocean-near-index ((this ocean-near-index)) +(defmethod inspect ((this ocean-near-index)) (when (not this) (set! this this) (goto cfg-4) @@ -310,15 +271,12 @@ ;; definition of type ocean-near-indices (deftype ocean-near-indices (basic) - ((data (inline-array ocean-near-index) :offset-assert 4) + ((data (inline-array ocean-near-index)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type ocean-near-indices -(defmethod inspect ocean-near-indices ((this ocean-near-indices)) +(defmethod inspect ((this ocean-near-indices)) (when (not this) (set! this this) (goto cfg-4) @@ -331,18 +289,15 @@ ;; definition of type ocean-near-colors (deftype ocean-near-colors (structure) - ((color0 vector :inline :offset-assert 0) - (color1 vector :inline :offset-assert 16) - (color2 vector :inline :offset-assert 32) - (color3 vector :inline :offset-assert 48) + ((color0 vector :inline) + (color1 vector :inline) + (color2 vector :inline) + (color3 vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type ocean-near-colors -(defmethod inspect ocean-near-colors ((this ocean-near-colors)) +(defmethod inspect ((this ocean-near-colors)) (when (not this) (set! this this) (goto cfg-4) @@ -358,15 +313,12 @@ ;; definition of type ocean-trans-strip (deftype ocean-trans-strip (structure) - ((verts uint128 10 :offset-assert 0) + ((verts uint128 10) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type ocean-trans-strip -(defmethod inspect ocean-trans-strip ((this ocean-trans-strip)) +(defmethod inspect ((this ocean-trans-strip)) (when (not this) (set! this this) (goto cfg-4) @@ -379,15 +331,12 @@ ;; definition of type ocean-trans-strip-array (deftype ocean-trans-strip-array (structure) - ((data ocean-trans-strip 4 :inline :offset-assert 0) + ((data ocean-trans-strip 4 :inline) ) - :method-count-assert 9 - :size-assert #x280 - :flag-assert #x900000280 ) ;; definition for method 3 of type ocean-trans-strip-array -(defmethod inspect ocean-trans-strip-array ((this ocean-trans-strip-array)) +(defmethod inspect ((this ocean-trans-strip-array)) (when (not this) (set! this this) (goto cfg-4) @@ -400,15 +349,12 @@ ;; definition of type ocean-wave-data (deftype ocean-wave-data (structure) - ((data uint8 1024 :offset-assert 0) + ((data uint8 1024) ) - :method-count-assert 9 - :size-assert #x400 - :flag-assert #x900000400 ) ;; definition for method 3 of type ocean-wave-data -(defmethod inspect ocean-wave-data ((this ocean-wave-data)) +(defmethod inspect ((this ocean-wave-data)) (when (not this) (set! this this) (goto cfg-4) @@ -421,15 +367,12 @@ ;; definition of type ocean-wave-frames (deftype ocean-wave-frames (structure) - ((frame ocean-wave-data 64 :inline :offset-assert 0) + ((frame ocean-wave-data 64 :inline) ) - :method-count-assert 9 - :size-assert #x10000 - :flag-assert #x900000000 ) ;; definition for method 3 of type ocean-wave-frames -(defmethod inspect ocean-wave-frames ((this ocean-wave-frames)) +(defmethod inspect ((this ocean-wave-frames)) (when (not this) (set! this this) (goto cfg-4) @@ -442,21 +385,18 @@ ;; definition of type ocean-texture-constants (deftype ocean-texture-constants (structure) - ((giftag gs-gif-tag :inline :offset-assert 0) - (buffers vector4w :inline :offset-assert 16) - (dests vector4w :inline :offset-assert 32) - (start vector :inline :offset-assert 48) - (offsets vector :inline :offset-assert 64) - (constants vector :inline :offset-assert 80) - (cam-nrm vector :inline :offset-assert 96) + ((giftag gs-gif-tag :inline) + (buffers vector4w :inline) + (dests vector4w :inline) + (start vector :inline) + (offsets vector :inline) + (constants vector :inline) + (cam-nrm vector :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type ocean-texture-constants -(defmethod inspect ocean-texture-constants ((this ocean-texture-constants)) +(defmethod inspect ((this ocean-texture-constants)) (when (not this) (set! this this) (goto cfg-4) @@ -475,17 +415,14 @@ ;; definition of type ocean-mid-vertex (deftype ocean-mid-vertex (structure) - ((stq vector :inline :offset-assert 0) - (col vector :inline :offset-assert 16) - (pos vector :inline :offset-assert 32) + ((stq vector :inline) + (col vector :inline) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type ocean-mid-vertex -(defmethod inspect ocean-mid-vertex ((this ocean-mid-vertex)) +(defmethod inspect ((this ocean-mid-vertex)) (when (not this) (set! this this) (goto cfg-4) @@ -500,35 +437,32 @@ ;; definition of type ocean-mid-constants (deftype ocean-mid-constants (structure) - ((hmge-scale vector :inline :offset-assert 0) - (inv-hmge-scale vector :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (fog vector :inline :offset-assert 48) - (constants vector :inline :offset-assert 64) - (constants2 vector :inline :offset-assert 80) - (drw-fan gs-gif-tag :inline :offset-assert 96) - (env-fan gs-gif-tag :inline :offset-assert 112) - (drw-adgif gs-gif-tag :inline :offset-assert 128) - (drw-texture adgif-shader :inline :offset-assert 144) - (drw-strip-0 gs-gif-tag :inline :offset-assert 224) - (drw-strip-1 gs-gif-tag :inline :offset-assert 240) - (env-adgif gs-gif-tag :inline :offset-assert 256) - (env-texture adgif-shader :inline :offset-assert 272) - (env-strip gs-gif-tag :inline :offset-assert 352) - (env-color vector :inline :offset-assert 368) - (index-table vector4w 8 :inline :offset-assert 384) - (pos0 vector :inline :offset-assert 512) - (pos1 vector :inline :offset-assert 528) - (pos2 vector :inline :offset-assert 544) - (pos3 vector :inline :offset-assert 560) + ((hmge-scale vector :inline) + (inv-hmge-scale vector :inline) + (hvdf-offset vector :inline) + (fog vector :inline) + (constants vector :inline) + (constants2 vector :inline) + (drw-fan gs-gif-tag :inline) + (env-fan gs-gif-tag :inline) + (drw-adgif gs-gif-tag :inline) + (drw-texture adgif-shader :inline) + (drw-strip-0 gs-gif-tag :inline) + (drw-strip-1 gs-gif-tag :inline) + (env-adgif gs-gif-tag :inline) + (env-texture adgif-shader :inline) + (env-strip gs-gif-tag :inline) + (env-color vector :inline) + (index-table vector4w 8 :inline) + (pos0 vector :inline) + (pos1 vector :inline) + (pos2 vector :inline) + (pos3 vector :inline) ) - :method-count-assert 9 - :size-assert #x240 - :flag-assert #x900000240 ) ;; definition for method 3 of type ocean-mid-constants -(defmethod inspect ocean-mid-constants ((this ocean-mid-constants)) +(defmethod inspect ((this ocean-mid-constants)) (when (not this) (set! this this) (goto cfg-4) @@ -561,18 +495,15 @@ ;; definition of type ocean-mid-upload (deftype ocean-mid-upload (structure) - ((rot matrix :inline :offset-assert 0) - (matrix matrix :inline :offset-assert 64) - (colors uint128 108 :offset-assert 128) - (masks uint128 2 :offset-assert 1856) + ((rot matrix :inline) + (matrix matrix :inline) + (colors uint128 108) + (masks uint128 2) ) - :method-count-assert 9 - :size-assert #x760 - :flag-assert #x900000760 ) ;; definition for method 3 of type ocean-mid-upload -(defmethod inspect ocean-mid-upload ((this ocean-mid-upload)) +(defmethod inspect ((this ocean-mid-upload)) (when (not this) (set! this this) (goto cfg-4) @@ -588,26 +519,23 @@ ;; definition of type ocean-mid-upload2 (deftype ocean-mid-upload2 (structure) - ((rot matrix :inline :offset-assert 0) - (matrix matrix :inline :offset-assert 64) - (count vector4w :inline :offset-assert 128) - (tex0 vector :inline :offset-assert 144) - (tex1 vector :inline :offset-assert 160) - (tex2 vector :inline :offset-assert 176) - (tex3 vector :inline :offset-assert 192) - (clr0 vector :inline :offset-assert 208) - (clr1 vector :inline :offset-assert 224) - (clr2 vector :inline :offset-assert 240) - (clr3 vector :inline :offset-assert 256) - (verts uint128 18 :offset-assert 272) + ((rot matrix :inline) + (matrix matrix :inline) + (count vector4w :inline) + (tex0 vector :inline) + (tex1 vector :inline) + (tex2 vector :inline) + (tex3 vector :inline) + (clr0 vector :inline) + (clr1 vector :inline) + (clr2 vector :inline) + (clr3 vector :inline) + (verts uint128 18) ) - :method-count-assert 9 - :size-assert #x230 - :flag-assert #x900000230 ) ;; definition for method 3 of type ocean-mid-upload2 -(defmethod inspect ocean-mid-upload2 ((this ocean-mid-upload2)) +(defmethod inspect ((this ocean-mid-upload2)) (when (not this) (set! this this) (goto cfg-4) @@ -631,21 +559,18 @@ ;; definition of type ocean-mid-work (deftype ocean-mid-work (structure) - ((env0 vector :inline :offset-assert 0) - (env1 vector :inline :offset-assert 16) - (env2 vector :inline :offset-assert 32) - (hmg0 vector :inline :offset-assert 48) - (hmg1 vector :inline :offset-assert 64) - (hmg2 vector :inline :offset-assert 80) - (indices uint128 16 :offset-assert 96) + ((env0 vector :inline) + (env1 vector :inline) + (env2 vector :inline) + (hmg0 vector :inline) + (hmg1 vector :inline) + (hmg2 vector :inline) + (indices uint128 16) ) - :method-count-assert 9 - :size-assert #x160 - :flag-assert #x900000160 ) ;; definition for method 3 of type ocean-mid-work -(defmethod inspect ocean-mid-work ((this ocean-mid-work)) +(defmethod inspect ((this ocean-mid-work)) (when (not this) (set! this this) (goto cfg-4) @@ -664,40 +589,37 @@ ;; definition of type ocean-near-constants (deftype ocean-near-constants (structure) - ((hmge-scale vector :inline :offset-assert 0) - (inv-hmge-scale vector :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (fog vector :inline :offset-assert 48) - (constants vector :inline :offset-assert 64) - (constants2 vector :inline :offset-assert 80) - (constants3 vector :inline :offset-assert 96) - (constants4 vector :inline :offset-assert 112) - (constants5 vector :inline :offset-assert 128) - (drw-fan gs-gif-tag :inline :offset-assert 144) - (drw2-fan gs-gif-tag :inline :offset-assert 160) - (env-fan gs-gif-tag :inline :offset-assert 176) - (drw-adgif gs-gif-tag :inline :offset-assert 192) - (drw-texture adgif-shader :inline :offset-assert 208) - (drw-strip gs-gif-tag :inline :offset-assert 288) - (env-adgif gs-gif-tag :inline :offset-assert 304) - (env-texture adgif-shader :inline :offset-assert 320) - (env-strip gs-gif-tag :inline :offset-assert 400) - (env-color vector :inline :offset-assert 416) - (drw2-adgif gs-gif-tag :inline :offset-assert 432) - (drw2-tex0 qword :inline :offset-assert 448) - (drw2-frame qword :inline :offset-assert 464) - (drw2-strip gs-gif-tag :inline :offset-assert 480) - (drw3-adgif gs-gif-tag :inline :offset-assert 496) - (drw3-frame gs-adcmd :inline :offset-assert 512) - (index-table vector4w 4 :inline :offset-assert 528) + ((hmge-scale vector :inline) + (inv-hmge-scale vector :inline) + (hvdf-offset vector :inline) + (fog vector :inline) + (constants vector :inline) + (constants2 vector :inline) + (constants3 vector :inline) + (constants4 vector :inline) + (constants5 vector :inline) + (drw-fan gs-gif-tag :inline) + (drw2-fan gs-gif-tag :inline) + (env-fan gs-gif-tag :inline) + (drw-adgif gs-gif-tag :inline) + (drw-texture adgif-shader :inline) + (drw-strip gs-gif-tag :inline) + (env-adgif gs-gif-tag :inline) + (env-texture adgif-shader :inline) + (env-strip gs-gif-tag :inline) + (env-color vector :inline) + (drw2-adgif gs-gif-tag :inline) + (drw2-tex0 qword :inline) + (drw2-frame qword :inline) + (drw2-strip gs-gif-tag :inline) + (drw3-adgif gs-gif-tag :inline) + (drw3-frame gs-adcmd :inline) + (index-table vector4w 4 :inline) ) - :method-count-assert 9 - :size-assert #x250 - :flag-assert #x900000250 ) ;; definition for method 3 of type ocean-near-constants -(defmethod inspect ocean-near-constants ((this ocean-near-constants)) +(defmethod inspect ((this ocean-near-constants)) (when (not this) (set! this this) (goto cfg-4) @@ -735,20 +657,17 @@ ;; definition of type ocean-near-upload (deftype ocean-near-upload (structure) - ((rot matrix :inline :offset-assert 0) - (matrix matrix :inline :offset-assert 64) - (masks uint128 2 :offset-assert 128) - (start-height vector4w :inline :offset-assert 160) - (start-st vector :inline :offset-assert 176) - (near-colors ocean-near-colors :inline :offset-assert 192) + ((rot matrix :inline) + (matrix matrix :inline) + (masks uint128 2) + (start-height vector4w :inline) + (start-st vector :inline) + (near-colors ocean-near-colors :inline) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; definition for method 3 of type ocean-near-upload -(defmethod inspect ocean-near-upload ((this ocean-near-upload)) +(defmethod inspect ((this ocean-near-upload)) (when (not this) (set! this this) (goto cfg-4) @@ -766,17 +685,14 @@ ;; definition of type ocean-near-vertex (deftype ocean-near-vertex (structure) - ((stq vector :inline :offset-assert 0) - (clr vector :inline :offset-assert 16) - (pos vector :inline :offset-assert 32) + ((stq vector :inline) + (clr vector :inline) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type ocean-near-vertex -(defmethod inspect ocean-near-vertex ((this ocean-near-vertex)) +(defmethod inspect ((this ocean-near-vertex)) (when (not this) (set! this this) (goto cfg-4) @@ -791,16 +707,13 @@ ;; definition of type ocean-near-work (deftype ocean-near-work (structure) - ((verts-ptr vector :inline :offset-assert 0) - (indices uint128 16 :offset-assert 16) + ((verts-ptr vector :inline) + (indices uint128 16) ) - :method-count-assert 9 - :size-assert #x110 - :flag-assert #x900000110 ) ;; definition for method 3 of type ocean-near-work -(defmethod inspect ocean-near-work ((this ocean-near-work)) +(defmethod inspect ((this ocean-near-work)) (when (not this) (set! this this) (goto cfg-4) @@ -814,15 +727,12 @@ ;; definition of type ocean-height-array (deftype ocean-height-array (structure) - ((data float 1024 :offset-assert 0) + ((data float 1024) ) - :method-count-assert 9 - :size-assert #x1000 - :flag-assert #x900001000 ) ;; definition for method 3 of type ocean-height-array -(defmethod inspect ocean-height-array ((this ocean-height-array)) +(defmethod inspect ((this ocean-height-array)) (when (not this) (set! this this) (goto cfg-4) @@ -835,15 +745,12 @@ ;; definition of type ocean-vert-array (deftype ocean-vert-array (structure) - ((data vector 2048 :inline :offset-assert 0) + ((data vector 2048 :inline) ) - :method-count-assert 9 - :size-assert #x8000 - :flag-assert #x900008000 ) ;; definition for method 3 of type ocean-vert-array -(defmethod inspect ocean-vert-array ((this ocean-vert-array)) +(defmethod inspect ((this ocean-vert-array)) (when (not this) (set! this this) (goto cfg-4) @@ -856,26 +763,23 @@ ;; definition of type ocean-map (deftype ocean-map (structure) - ((start-corner vector :inline :offset-assert 0) - (far-color vector :inline :offset-assert 16) - (ocean-spheres ocean-spheres :offset-assert 32) - (ocean-colors ocean-colors :offset-assert 36) - (ocean-mid-indices ocean-mid-indices :offset-assert 40) - (ocean-trans-indices ocean-trans-indices :offset-assert 44) - (ocean-near-indices ocean-near-indices :offset-assert 48) - (ocean-mid-masks ocean-mid-masks :offset-assert 52) + ((start-corner vector :inline) + (far-color vector :inline) + (ocean-spheres ocean-spheres) + (ocean-colors ocean-colors) + (ocean-mid-indices ocean-mid-indices) + (ocean-trans-indices ocean-trans-indices) + (ocean-near-indices ocean-near-indices) + (ocean-mid-masks ocean-mid-masks) ) - :method-count-assert 11 - :size-assert #x38 - :flag-assert #xb00000038 (:methods - (set-height! (_type_ float) none 9) - (get-base-height (_type_) float 10) + (set-height! (_type_ float) none) + (get-base-height (_type_) float) ) ) ;; definition for method 3 of type ocean-map -(defmethod inspect ocean-map ((this ocean-map)) +(defmethod inspect ((this ocean-map)) (when (not this) (set! this this) (goto cfg-4) @@ -895,191 +799,188 @@ ;; definition of type ocean (deftype ocean (ocean-map) - ((off symbol :offset-assert 56) - (near-off symbol :offset-assert 60) - (mid-off symbol :offset-assert 64) - (far-on symbol :offset-assert 68) - (ocean-facing uint32 :offset-assert 72) - (heights ocean-height-array :offset-assert 76) - (heights2 ocean-height-array :offset-assert 80) - (verts ocean-vert-array :offset-assert 84) - (ocean-near-translucent? symbol :offset-assert 88) - (deltas vector :inline :offset-assert 96) - (map-min vector :inline :offset-assert 112) - (map-max vector :inline :offset-assert 128) - (interp vector :inline :offset-assert 144) - (corner-array ocean-corner 25 :inline :offset-assert 160) - (corner-count int32 :offset-assert 2160) - (temp-vecs vector 4 :inline :offset-assert 2176) - (mid-mask-ptrs pointer 36 :offset-assert 2240) - (mid-camera-masks uint64 36 :offset-assert 2384) - (trans-mask-ptrs pointer 64 :offset-assert 2672) - (trans-camera-masks ocean-trans-mask 16 :offset-assert 2928) - (trans-temp-masks uint32 16 :offset-assert 2992) - (sprite-tmpl dma-gif-packet :inline :offset-assert 3056) - (sprite-tmpl2 dma-gif-packet :inline :offset-assert 3088) - (sprite-tmpl3 dma-gif-packet :inline :offset-assert 3120) - (adgif-tmpl dma-gif-packet :inline :offset-assert 3152) - (line-tmpl dma-gif-packet :inline :offset-assert 3184) - (sun-tmpl dma-gif-packet :inline :offset-assert 3216) - (erase-tmpl dma-gif-packet :inline :offset-assert 3248) - (haze-tmpl dma-gif-packet :inline :offset-assert 3280) - (cloud-tmpl dma-gif-packet :inline :offset-assert 3312) - (clut-tmpl dma-gif-packet :inline :offset-assert 3344) - (cloud-lights cloud-lights :inline :offset-assert 3376) - (haze-lights haze-lights :inline :offset-assert 3536) - (constant vector :inline :offset-assert 3664) - (sky-color vector :inline :offset-assert 3680) - (haze-verts vector4w 32 :inline :offset-assert 3696) - (cloud-verts vector4w 36 :inline :offset-assert 4208) - (cloud-nrms vector 36 :inline :offset-assert 4784) - (cloud-col0 vector 36 :inline :offset-assert 5360) - (cloud-col1 vector 36 :inline :offset-assert 5936) - (cloud-st0 vector 36 :inline :offset-assert 6512) - (cloud-st1 vector 36 :inline :offset-assert 7088) - (color80808080 vector4w :inline :offset-assert 7664) - (color80808040 vector4w :inline :offset-assert 7680) - (color80808000 vector4w :inline :offset-assert 7696) - (st0000 vector :inline :offset-assert 7712) - (st0505 vector :inline :offset-assert 7728) - (st1010 vector :inline :offset-assert 7744) - (uv00 vector4w :inline :offset-assert 7760) - (uv44 vector4w :inline :offset-assert 7776) - (uv88 vector4w :inline :offset-assert 7792) - (uv1010 vector4w :inline :offset-assert 7808) - (uv2020 vector4w :inline :offset-assert 7824) - (uv4040 vector4w :inline :offset-assert 7840) - (uv8080 vector4w :inline :offset-assert 7856) - (xy00 vector4w :inline :offset-assert 7872) - (xy88 vector4w :inline :offset-assert 7888) - (xy1010 vector4w :inline :offset-assert 7904) - (xy2020 vector4w :inline :offset-assert 7920) - (xy4040 vector4w :inline :offset-assert 7936) - (xy8080 vector4w :inline :offset-assert 7952) - (cloud-alpha uint8 36 :offset-assert 7968) - (near-mask-indices uint16 16 :offset-assert 8004) - (mid-minx uint8 :offset-assert 8036) - (mid-maxx uint8 :offset-assert 8037) - (mid-minz uint8 :offset-assert 8038) - (mid-maxz uint8 :offset-assert 8039) - (near-minx uint8 :offset-assert 8040) - (near-maxx uint8 :offset-assert 8041) - (near-minz uint8 :offset-assert 8042) - (near-maxz uint8 :offset-assert 8043) - (temp-minx uint8 :offset-assert 8044) - (temp-maxx uint8 :offset-assert 8045) - (temp-minz uint8 :offset-assert 8046) - (temp-maxz uint8 :offset-assert 8047) - (tex1 gs-tex1 :offset-assert 8048) - (tex1-near gs-tex1 :offset-assert 8056) - (corner00 float :offset-assert 8064) - (corner01 float :offset-assert 8068) - (corner10 float :offset-assert 8072) - (corner11 float :offset-assert 8076) - (frame-num float :offset-assert 8080) - (frame-speed float :offset-assert 8084) - (frame-num2 float :offset-assert 8088) - (frame-speed2 float :offset-assert 8092) - (cloud-interp float :offset 3676) - (scales vector :inline :offset-assert 8096) - (mask-hi vector4w :inline :offset-assert 8112) - (mask-lo vector4w :inline :offset-assert 8128) - (lights vu-lights :inline :offset-assert 8144) - (uv-scroll-0 vector4w :inline :offset-assert 8256) - (uv-scroll-1 vector4w :inline :offset-assert 8272) - (st-scroll vector2 :inline :offset-assert 8288) - (wait-to-vu0 uint32 :offset-assert 8296) + ((off symbol) + (near-off symbol) + (mid-off symbol) + (far-on symbol) + (ocean-facing uint32) + (heights ocean-height-array) + (heights2 ocean-height-array) + (verts ocean-vert-array) + (ocean-near-translucent? symbol) + (deltas vector :inline) + (map-min vector :inline) + (map-max vector :inline) + (interp vector :inline) + (corner-array ocean-corner 25 :inline) + (corner-count int32) + (temp-vecs vector 4 :inline) + (mid-mask-ptrs pointer 36) + (mid-camera-masks uint64 36) + (trans-mask-ptrs pointer 64) + (trans-camera-masks ocean-trans-mask 16) + (trans-temp-masks uint32 16) + (sprite-tmpl dma-gif-packet :inline) + (sprite-tmpl2 dma-gif-packet :inline) + (sprite-tmpl3 dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (line-tmpl dma-gif-packet :inline) + (sun-tmpl dma-gif-packet :inline) + (erase-tmpl dma-gif-packet :inline) + (haze-tmpl dma-gif-packet :inline) + (cloud-tmpl dma-gif-packet :inline) + (clut-tmpl dma-gif-packet :inline) + (cloud-lights cloud-lights :inline) + (haze-lights haze-lights :inline) + (constant vector :inline) + (sky-color vector :inline) + (haze-verts vector4w 32 :inline) + (cloud-verts vector4w 36 :inline) + (cloud-nrms vector 36 :inline) + (cloud-col0 vector 36 :inline) + (cloud-col1 vector 36 :inline) + (cloud-st0 vector 36 :inline) + (cloud-st1 vector 36 :inline) + (color80808080 vector4w :inline) + (color80808040 vector4w :inline) + (color80808000 vector4w :inline) + (st0000 vector :inline) + (st0505 vector :inline) + (st1010 vector :inline) + (uv00 vector4w :inline) + (uv44 vector4w :inline) + (uv88 vector4w :inline) + (uv1010 vector4w :inline) + (uv2020 vector4w :inline) + (uv4040 vector4w :inline) + (uv8080 vector4w :inline) + (xy00 vector4w :inline) + (xy88 vector4w :inline) + (xy1010 vector4w :inline) + (xy2020 vector4w :inline) + (xy4040 vector4w :inline) + (xy8080 vector4w :inline) + (cloud-alpha uint8 36) + (near-mask-indices uint16 16) + (mid-minx uint8) + (mid-maxx uint8) + (mid-minz uint8) + (mid-maxz uint8) + (near-minx uint8) + (near-maxx uint8) + (near-minz uint8) + (near-maxz uint8) + (temp-minx uint8) + (temp-maxx uint8) + (temp-minz uint8) + (temp-maxz uint8) + (tex1 gs-tex1) + (tex1-near gs-tex1) + (corner00 float) + (corner01 float) + (corner10 float) + (corner11 float) + (frame-num float) + (frame-speed float) + (frame-num2 float) + (frame-speed2 float) + (cloud-interp float :overlay-at (-> constant data 3)) + (scales vector :inline) + (mask-hi vector4w :inline) + (mask-lo vector4w :inline) + (lights vu-lights :inline) + (uv-scroll-0 vector4w :inline) + (uv-scroll-1 vector4w :inline) + (st-scroll vector2 :inline) + (wait-to-vu0 uint32) ) - :method-count-assert 92 - :size-assert #x206c - :flag-assert #x5c0000206c (:methods - (get-height (_type_ vector symbol) float 11) - (draw! (_type_) none 12) - (update-map (_type_) none 13) - (interp-wave (_type_ ocean-wave-info uint float) none 14) - (ocean-method-15 (_type_ matrix matrix) none 15) - (generate-verts (_type_ ocean-vert-array ocean-height-array) none 16) - (add-colors! (_type_ vector ocean-vertex) none 17) - (ocean-method-18 (_type_ (pointer ocean-colors) (pointer ocean-colors)) none 18) - (init-buffer! (_type_ dma-buffer) none 19) - (end-buffer! (_type_ dma-buffer) none 20) - (set-corners! (_type_ float float) float 21) - (ocean-near-add-call (_type_ dma-buffer int) none 22) - (ocean-near-add-call-flush (_type_ dma-buffer int) none 23) - (ocean-near-setup-constants (_type_ ocean-near-constants) none 24) - (ocean-near-add-constants (_type_ dma-buffer) none 25) - (ocean-near-add-heights (_type_ dma-buffer) none 26) - (ocean-near-add-matrices (_type_ dma-buffer vector) none 27) - (ocean-near-add-upload (_type_ dma-buffer uint uint) none 28) - (draw-ocean-near (_type_ dma-buffer) none 29) - (ocean-trans-camera-masks-bit? (_type_ uint uint) symbol 30) - (ocean-trans-mask-ptrs-bit? (_type_ int int) symbol 31) - (ocean-trans-mask-ptrs-set! (_type_ uint uint) symbol 32) - (ocean-trans-add-upload-table (_type_ dma-buffer uint uint int int symbol) none 33) - (ocean-trans-add-upload-strip (_type_ dma-buffer uint uint int int int) none 34) - (ocean-transition-check (_type_ ocean-trans-mask int int vector) none 35) - (ocean-make-trans-camera-masks (_type_ uint uint uint uint) none 36) - (ocean-trans-add-upload (_type_ dma-buffer uint uint) none 37) - (draw-ocean-transition-seams (_type_ dma-buffer) none 38) - (ocean-trans-add-constants (_type_ dma-buffer) none 39) - (draw-ocean-transition (_type_ dma-buffer) none 40) - (ocean-mid-add-call (_type_ dma-buffer int) none 41) - (ocean-mid-add-call-flush (_type_ dma-buffer uint) none 42) - (ocean-matrix*! (_type_ matrix matrix matrix) matrix 43) - (ocean-vector-matrix*! (_type_ vector vector matrix) vector 44) - (ocean-mid-add-matrices (_type_ dma-buffer vector) none 45) - (ocean-mid-check (_type_ pointer int int vector) symbol 46) - (ocean-mid-setup-constants (_type_ ocean-mid-constants) none 47) - (ocean-mid-add-constants (_type_ dma-buffer) none 48) - (ocean-mid-camera-masks-bit? (_type_ uint uint) symbol 49) - (ocean-mid-mask-ptrs-bit? (_type_ uint uint) symbol 50) - (ocean-mid-camera-masks-set! (_type_ uint uint) symbol 51) - (ocean-mid-add-upload (_type_ dma-buffer int int int int float) none 52) - (ocean-mid-add-upload-table (_type_ dma-buffer uint uint (pointer float) int symbol) none 53) - (ocean-mid-add-upload-top (_type_ dma-buffer uint uint) none 54) - (ocean-mid-add-upload-middle (_type_ dma-buffer uint uint) none 55) - (ocean-mid-add-upload-bottom (_type_ dma-buffer uint uint) none 56) - (ocean-seams-add-constants (_type_ dma-buffer) none 57) - (draw-ocean-mid-seams (_type_ dma-buffer) none 58) - (draw-ocean-mid (_type_ dma-buffer) none 59) - (ocean-method-60 (_type_ dma-buffer) none 60) - (ocean-method-61 (_type_ dma-buffer) none 61) - (ocean-method-62 (_type_ dma-buffer) none 62) - (ocean-method-63 (_type_ dma-buffer) none 63) - (ocean-method-64 (_type_ dma-buffer) none 64) - (ocean-method-65 (_type_ dma-buffer) none 65) - (ocean-method-66 (_type_ dma-buffer) none 66) - (ocean-method-67 (_type_ dma-buffer) none 67) - (render-ocean-far (_type_ dma-buffer int) none 68) - (draw-ocean-far (_type_ dma-buffer) none 69) - (ocean-texture-setup-constants (_type_ ocean-texture-constants) none 70) - (ocean-texture-add-constants (_type_ dma-buffer) none 71) - (ocean-texture-add-envmap (_type_ dma-buffer) none 72) - (ocean-texture-add-verts (_type_ dma-buffer int) none 73) - (ocean-texture-add-verts-last (_type_ dma-buffer int int) none 74) - (ocean-texture-add-call-start (_type_ dma-buffer) none 75) - (ocean-texture-add-call-rest (_type_ dma-buffer) none 76) - (ocean-texture-add-call-done (_type_ dma-buffer) none 77) - (draw-ocean-texture (_type_ dma-buffer int) none 78) - (ocean-method-79 (_type_ dma-buffer) none 79) - (ocean-method-80 (_type_ (pointer rgba)) none 80) - (ocean-method-81 (_type_ dma-buffer) int 81) - (draw-envmap-debug (_type_ dma-buffer) none 82) - (ocean-method-83 (_type_ dma-buffer float) none 83) - (ocean-method-84 (_type_ dma-buffer sky-upload-data vector4w float) none 84) - (ocean-method-85 (_type_ dma-buffer) none 85) - (ocean-method-86 (_type_ vector vector vector vector) none 86) - (ocean-method-87 (_type_ vector vector vector) none 87) - (ocean-method-88 (_type_ dma-buffer) none 88) - (ocean-method-89 (_type_ dma-buffer) none 89) - (rgba-to-vector! (_type_ vector (pointer rgba)) none 90) - (do-tex-scroll! (_type_) none 91) + (get-height (_type_ vector symbol) float) + (draw! (_type_) none) + (update-map (_type_) none) + (interp-wave (_type_ ocean-wave-info uint float) none) + (ocean-method-15 (_type_ matrix matrix) none) + (generate-verts (_type_ ocean-vert-array ocean-height-array) none) + (add-colors! (_type_ vector ocean-vertex) none) + (ocean-method-18 (_type_ (pointer ocean-colors) (pointer ocean-colors)) none) + (init-buffer! (_type_ dma-buffer) none) + (end-buffer! (_type_ dma-buffer) none) + (set-corners! (_type_ float float) float) + (ocean-near-add-call (_type_ dma-buffer int) none) + (ocean-near-add-call-flush (_type_ dma-buffer int) none) + (ocean-near-setup-constants (_type_ ocean-near-constants) none) + (ocean-near-add-constants (_type_ dma-buffer) none) + (ocean-near-add-heights (_type_ dma-buffer) none) + (ocean-near-add-matrices (_type_ dma-buffer vector) none) + (ocean-near-add-upload (_type_ dma-buffer uint uint) none) + (draw-ocean-near (_type_ dma-buffer) none) + (ocean-trans-camera-masks-bit? (_type_ uint uint) symbol) + (ocean-trans-mask-ptrs-bit? (_type_ int int) symbol) + (ocean-trans-mask-ptrs-set! (_type_ uint uint) symbol) + (ocean-trans-add-upload-table (_type_ dma-buffer uint uint int int symbol) none) + (ocean-trans-add-upload-strip (_type_ dma-buffer uint uint int int int) none) + (ocean-transition-check (_type_ ocean-trans-mask int int vector) none) + (ocean-make-trans-camera-masks (_type_ uint uint uint uint) none) + (ocean-trans-add-upload (_type_ dma-buffer uint uint) none) + (draw-ocean-transition-seams (_type_ dma-buffer) none) + (ocean-trans-add-constants (_type_ dma-buffer) none) + (draw-ocean-transition (_type_ dma-buffer) none) + (ocean-mid-add-call (_type_ dma-buffer int) none) + (ocean-mid-add-call-flush (_type_ dma-buffer uint) none) + (ocean-matrix*! (_type_ matrix matrix matrix) matrix) + (ocean-vector-matrix*! (_type_ vector vector matrix) vector) + (ocean-mid-add-matrices (_type_ dma-buffer vector) none) + (ocean-mid-check (_type_ pointer int int vector) symbol) + (ocean-mid-setup-constants (_type_ ocean-mid-constants) none) + (ocean-mid-add-constants (_type_ dma-buffer) none) + (ocean-mid-camera-masks-bit? (_type_ uint uint) symbol) + (ocean-mid-mask-ptrs-bit? (_type_ uint uint) symbol) + (ocean-mid-camera-masks-set! (_type_ uint uint) symbol) + (ocean-mid-add-upload (_type_ dma-buffer int int int int float) none) + (ocean-mid-add-upload-table (_type_ dma-buffer uint uint (pointer float) int symbol) none) + (ocean-mid-add-upload-top (_type_ dma-buffer uint uint) none) + (ocean-mid-add-upload-middle (_type_ dma-buffer uint uint) none) + (ocean-mid-add-upload-bottom (_type_ dma-buffer uint uint) none) + (ocean-seams-add-constants (_type_ dma-buffer) none) + (draw-ocean-mid-seams (_type_ dma-buffer) none) + (draw-ocean-mid (_type_ dma-buffer) none) + (ocean-method-60 (_type_ dma-buffer) none) + (ocean-method-61 (_type_ dma-buffer) none) + (ocean-method-62 (_type_ dma-buffer) none) + (ocean-method-63 (_type_ dma-buffer) none) + (ocean-method-64 (_type_ dma-buffer) none) + (ocean-method-65 (_type_ dma-buffer) none) + (ocean-method-66 (_type_ dma-buffer) none) + (ocean-method-67 (_type_ dma-buffer) none) + (render-ocean-far (_type_ dma-buffer int) none) + (draw-ocean-far (_type_ dma-buffer) none) + (ocean-texture-setup-constants (_type_ ocean-texture-constants) none) + (ocean-texture-add-constants (_type_ dma-buffer) none) + (ocean-texture-add-envmap (_type_ dma-buffer) none) + (ocean-texture-add-verts (_type_ dma-buffer int) none) + (ocean-texture-add-verts-last (_type_ dma-buffer int int) none) + (ocean-texture-add-call-start (_type_ dma-buffer) none) + (ocean-texture-add-call-rest (_type_ dma-buffer) none) + (ocean-texture-add-call-done (_type_ dma-buffer) none) + (draw-ocean-texture (_type_ dma-buffer int) none) + (ocean-method-79 (_type_ dma-buffer) none) + (ocean-method-80 (_type_ (pointer rgba)) none) + (ocean-method-81 (_type_ dma-buffer) int) + (draw-envmap-debug (_type_ dma-buffer) none) + (ocean-method-83 (_type_ dma-buffer float) none) + (ocean-method-84 (_type_ dma-buffer sky-upload-data vector4w float) none) + (ocean-method-85 (_type_ dma-buffer) none) + (ocean-method-86 (_type_ vector vector vector vector) none) + (ocean-method-87 (_type_ vector vector vector) none) + (ocean-method-88 (_type_ dma-buffer) none) + (ocean-method-89 (_type_ dma-buffer) none) + (rgba-to-vector! (_type_ vector (pointer rgba)) none) + (do-tex-scroll! (_type_) none) ) ) ;; definition for method 3 of type ocean -(defmethod inspect ocean ((this ocean)) +(defmethod inspect ((this ocean)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc index dfed490099f..2510cc09c32 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc @@ -7,7 +7,7 @@ ;; definition for method 47 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-setup-constants ocean ((this ocean) (arg0 ocean-mid-constants)) +(defmethod ocean-mid-setup-constants ((this ocean) (arg0 ocean-mid-constants)) (let ((v1-0 *math-camera*)) (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) @@ -290,7 +290,7 @@ ;; definition for method 48 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-constants ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-mid-add-constants ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 36) (v1-0 arg0) (a1-1 (the-as object (-> v1-0 base))) @@ -309,7 +309,7 @@ ) ;; definition for method 43 of type ocean -(defmethod ocean-matrix*! ocean ((this ocean) (arg0 matrix) (arg1 matrix) (arg2 matrix)) +(defmethod ocean-matrix*! ((this ocean) (arg0 matrix) (arg1 matrix) (arg2 matrix)) (rlet ((acc :class vf) (vf1 :class vf) (vf10 :class vf) @@ -357,7 +357,7 @@ ) ;; definition for method 44 of type ocean -(defmethod ocean-vector-matrix*! ocean ((this ocean) (arg0 vector) (arg1 vector) (arg2 matrix)) +(defmethod ocean-vector-matrix*! ((this ocean) (arg0 vector) (arg1 vector) (arg2 matrix)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -384,7 +384,7 @@ ;; definition for method 45 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-matrices ocean ((this ocean) (arg0 dma-buffer) (arg1 vector)) +(defmethod ocean-mid-add-matrices ((this ocean) (arg0 dma-buffer) (arg1 vector)) (let ((s4-0 (new-stack-vector0)) (v1-3 (if (-> *time-of-day-context* use-camera-other) (-> *math-camera* camera-rot-other) @@ -434,7 +434,7 @@ ;; definition for method 46 of type ocean ;; INFO: Used lq/sq -(defmethod ocean-mid-check ocean ((this ocean) (arg0 pointer) (arg1 int) (arg2 int) (arg3 vector)) +(defmethod ocean-mid-check ((this ocean) (arg0 pointer) (arg1 int) (arg2 int) (arg3 vector)) (local-vars (v0-0 symbol) (v1-10 float) (t0-3 float) (t0-8 float) (t0-13 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -513,7 +513,7 @@ ;; definition for method 41 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-call ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-mid-add-call ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -528,7 +528,7 @@ ;; definition for method 42 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-call-flush ocean ((this ocean) (arg0 dma-buffer) (arg1 uint)) +(defmethod ocean-mid-add-call-flush ((this ocean) (arg0 dma-buffer) (arg1 uint)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -544,7 +544,7 @@ ;; definition for method 52 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod ocean-mid-add-upload ocean ((this ocean) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 float)) +(defmethod ocean-mid-add-upload ((this ocean) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 float)) (local-vars (sv-32 int)) (set! sv-32 arg1) (let ((s0-0 arg2) @@ -621,7 +621,7 @@ ) ;; definition for method 49 of type ocean -(defmethod ocean-mid-camera-masks-bit? ocean ((this ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-mid-camera-masks-bit? ((this ocean) (arg0 uint) (arg1 uint)) (cond ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) #t @@ -640,7 +640,7 @@ ) ;; definition for method 50 of type ocean -(defmethod ocean-mid-mask-ptrs-bit? ocean ((this ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-mid-mask-ptrs-bit? ((this ocean) (arg0 uint) (arg1 uint)) (cond ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) #t @@ -662,7 +662,7 @@ ) ;; definition for method 51 of type ocean -(defmethod ocean-mid-camera-masks-set! ocean ((this ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-mid-camera-masks-set! ((this ocean) (arg0 uint) (arg1 uint)) (cond ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) #f @@ -699,7 +699,7 @@ ;; definition for method 53 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-upload-table ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 (pointer float)) (arg4 int) (arg5 symbol)) +(defmethod ocean-mid-add-upload-table ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 (pointer float)) (arg4 int) (arg5 symbol)) (local-vars (v1-13 float) (a0-20 uint128) @@ -811,7 +811,7 @@ ;; definition for method 54 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-upload-top ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) +(defmethod ocean-mid-add-upload-top ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) (let ((s0-0 (-> this mid-minx)) (s2-0 (-> this mid-maxx)) (s1-0 (ocean-mid-camera-masks-bit? this arg1 arg2)) @@ -884,7 +884,7 @@ ;; definition for method 55 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-upload-middle ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) +(defmethod ocean-mid-add-upload-middle ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) (let ((s0-0 (-> this mid-minx)) (s2-0 (-> this mid-maxx)) (s1-0 (ocean-mid-camera-masks-bit? this arg1 arg2)) @@ -924,7 +924,7 @@ ;; definition for method 56 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-upload-bottom ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) +(defmethod ocean-mid-add-upload-bottom ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) (let ((s0-0 (-> this mid-minx)) (s2-0 (-> this mid-maxx)) (s1-0 (ocean-mid-camera-masks-bit? this arg1 arg2)) @@ -997,7 +997,7 @@ ;; definition for method 57 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-seams-add-constants ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-seams-add-constants ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 4) (v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) @@ -1022,7 +1022,7 @@ ;; definition for method 58 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod draw-ocean-mid-seams ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-mid-seams ((this ocean) (arg0 dma-buffer)) (local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere)) (ocean-seams-add-constants this arg0) (set! sv-32 (-> this mid-minx)) @@ -1073,7 +1073,7 @@ ;; definition for method 59 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-ocean-mid ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-mid ((this ocean) (arg0 dma-buffer)) (local-vars (v1-8 float) (v1-9 float) (sv-32 int)) (rlet ((vf16 :class vf) (vf17 :class vf) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc index 8170acd6945..0d1f7111eca 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc @@ -6,7 +6,7 @@ ;; definition for method 22 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-near-add-call ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-near-add-call ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -21,7 +21,7 @@ ;; definition for method 23 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-near-add-call-flush ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-near-add-call-flush ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -37,7 +37,7 @@ ;; definition for method 24 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-near-setup-constants ocean ((this ocean) (arg0 ocean-near-constants)) +(defmethod ocean-near-setup-constants ((this ocean) (arg0 ocean-near-constants)) (let ((v1-0 *math-camera*)) (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) @@ -369,7 +369,7 @@ ;; definition for method 25 of type ocean ;; WARN: Return type mismatch pointer vs none. -(defmethod ocean-near-add-constants ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-near-add-constants ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 37) (v1-0 arg0) (a1-1 (the-as object (-> v1-0 base))) @@ -388,7 +388,7 @@ ;; definition for method 26 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-near-add-heights ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-near-add-heights ((this ocean) (arg0 dma-buffer)) (let ((v1-0 128) (a0-1 (-> this heights)) ) @@ -422,7 +422,7 @@ ;; definition for method 27 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-near-add-matrices ocean ((this ocean) (arg0 dma-buffer) (arg1 vector)) +(defmethod ocean-near-add-matrices ((this ocean) (arg0 dma-buffer) (arg1 vector)) (let ((s4-0 (new-stack-vector0))) (if (-> *time-of-day-context* use-camera-other) (-> *math-camera* camera-rot-other) @@ -471,7 +471,7 @@ ;; definition for method 28 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-near-add-upload ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) +(defmethod ocean-near-add-upload ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) (local-vars (v1-17 uint128) (v1-18 uint128) @@ -664,7 +664,7 @@ ;; definition for method 29 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-ocean-near ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-near ((this ocean) (arg0 dma-buffer)) (local-vars (sv-16 uint)) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc index 542e6f4f34f..486e9e918f2 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc @@ -6,7 +6,7 @@ ;; definition for method 70 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-setup-constants ocean ((this ocean) (arg0 ocean-texture-constants)) +(defmethod ocean-texture-setup-constants ((this ocean) (arg0 ocean-texture-constants)) (set! (-> arg0 giftag tag) (new 'static 'gif-tag64 :nloop #x42 @@ -34,7 +34,7 @@ ;; definition for method 71 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-constants ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-constants ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 7) (v1-0 arg0) (a1-1 (the-as object (-> v1-0 base))) @@ -55,7 +55,7 @@ ;; definition for method 72 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-envmap ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-envmap ((this ocean) (arg0 dma-buffer)) (let ((v1-0 (the-as object (-> arg0 base)))) (set! (-> (the-as (inline-array vector4w) v1-0) 0 quad) (-> this adgif-tmpl dma-vif quad)) (set! (-> (the-as (inline-array vector4w) v1-0) 1 quad) (-> this adgif-tmpl quad 1)) @@ -73,7 +73,7 @@ ;; definition for method 73 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-verts ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-texture-add-verts ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -90,7 +90,7 @@ ;; definition for method 74 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-verts-last ocean ((this ocean) (arg0 dma-buffer) (arg1 int) (arg2 int)) +(defmethod ocean-texture-add-verts-last ((this ocean) (arg0 dma-buffer) (arg1 int) (arg2 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -117,7 +117,7 @@ ;; definition for method 75 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-call-start ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-call-start ((this ocean) (arg0 dma-buffer)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -132,7 +132,7 @@ ;; definition for method 76 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-call-rest ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-call-rest ((this ocean) (arg0 dma-buffer)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -147,7 +147,7 @@ ;; definition for method 77 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-call-done ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-call-done ((this ocean) (arg0 dma-buffer)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -162,7 +162,7 @@ ;; definition for method 78 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod draw-ocean-texture ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod draw-ocean-texture ((this ocean) (arg0 dma-buffer) (arg1 int)) (set-display-gs-state arg0 21 128 128 0 0) (ocean-texture-add-envmap this arg0) (dma-buffer-add-gs-set arg0 @@ -203,7 +203,7 @@ ;; definition for method 79 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-79 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-79 ((this ocean) (arg0 dma-buffer)) (set-display-gs-state arg0 53 64 64 0 0) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) @@ -299,7 +299,7 @@ ;; definition for method 80 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-80 ocean ((this ocean) (arg0 (pointer rgba))) +(defmethod ocean-method-80 ((this ocean) (arg0 (pointer rgba))) (dotimes (v1-0 256) (let ((a0-3 (-> *clut-translate* v1-0))) (set! (-> arg0 a0-3 r) v1-0) @@ -314,7 +314,7 @@ ;; definition for method 91 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod do-tex-scroll! ocean ((this ocean)) +(defmethod do-tex-scroll! ((this ocean)) (when (not (paused?)) (+! (-> this st-scroll x) (* 8.0 (seconds-per-frame))) (set! (-> this st-scroll y) (- (-> this st-scroll y) (* 8.0 (seconds-per-frame)))) @@ -335,7 +335,7 @@ ;; definition for method 81 of type ocean ;; INFO: Used lq/sq -(defmethod ocean-method-81 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-81 ((this ocean) (arg0 dma-buffer)) (set-display-gs-state arg0 53 128 128 0 0) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) @@ -486,7 +486,7 @@ ;; definition for method 82 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-envmap-debug ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-envmap-debug ((this ocean) (arg0 dma-buffer)) (format *stdcon* "draw-envmap-debug~%") (-> arg0 base) (dma-buffer-add-gs-set arg0 @@ -541,7 +541,7 @@ ;; definition for method 83 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-83 ocean ((this ocean) (arg0 dma-buffer) (arg1 float)) +(defmethod ocean-method-83 ((this ocean) (arg0 dma-buffer) (arg1 float)) (let* ((s4-0 64) (s3-0 0) (f30-0 (/ -65536.0 (the float s4-0))) @@ -595,7 +595,7 @@ ;; definition for method 84 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-84 ocean ((this ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) +(defmethod ocean-method-84 ((this ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) (when (>= (-> arg1 sun 0 pos y) -150.0) (let* ((f2-0 (* 0.00010050251 (-> arg1 sun 0 pos x))) (f1-3 (* 0.00010050251 (-> arg1 sun 0 pos z))) @@ -633,7 +633,7 @@ ;; definition for method 85 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-85 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-85 ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 vector4w) (sv-64 vector4w)) (dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x2 :d #x1))) (let ((v1-3 (-> arg0 base))) @@ -696,7 +696,7 @@ ;; definition for method 86 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-86 ocean ((this ocean) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod ocean-method-86 ((this ocean) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (local-vars (v1-1 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -760,7 +760,7 @@ ;; definition for method 87 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-87 ocean ((this ocean) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod ocean-method-87 ((this ocean) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -786,7 +786,7 @@ ;; definition for method 88 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-88 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-88 ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 vector) (sv-64 uint) (sv-80 vector) (sv-96 vector) (sv-112 vector)) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test @@ -921,7 +921,7 @@ ;; definition for method 89 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-89 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-89 ((this ocean) (arg0 dma-buffer)) (set-display-gs-state arg0 (the-as int (+ (-> *ocean-texture-base* vram-page) 8)) 64 64 0 0) (vector-float*! (-> this sky-color) (-> *time-of-day-context* current-sky-color) 0.25) (+! (-> this sky-color x) (* 0.5 (- (-> this sky-color z) (-> this sky-color x)))) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-transition_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-transition_REF.gc index a40b21522c9..cc60723f683 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-transition_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-transition_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 30 of type ocean -(defmethod ocean-trans-camera-masks-bit? ocean ((this ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-trans-camera-masks-bit? ((this ocean) (arg0 uint) (arg1 uint)) (let ((v1-2 (- arg0 (* (-> this mid-minz) 4))) (a1-3 (- arg1 (* (-> this mid-minx) 4))) ) @@ -25,7 +25,7 @@ ) ;; definition for method 31 of type ocean -(defmethod ocean-trans-mask-ptrs-bit? ocean ((this ocean) (arg0 int) (arg1 int)) +(defmethod ocean-trans-mask-ptrs-bit? ((this ocean) (arg0 int) (arg1 int)) (let ((v1-2 (- arg0 (the-as int (* (-> this mid-minz) 4)))) (a1-3 (- arg1 (the-as int (* (-> this mid-minx) 4)))) ) @@ -55,7 +55,7 @@ ) ;; definition for method 32 of type ocean -(defmethod ocean-trans-mask-ptrs-set! ocean ((this ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-trans-mask-ptrs-set! ((this ocean) (arg0 uint) (arg1 uint)) (let ((v1-2 (- arg0 (* (-> this mid-minz) 4))) (a1-3 (- arg1 (* (-> this mid-minx) 4))) ) @@ -98,7 +98,7 @@ ;; definition for method 33 of type ocean ;; INFO: Used lq/sq -(defmethod ocean-trans-add-upload-table ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 symbol)) +(defmethod ocean-trans-add-upload-table ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 symbol)) (local-vars (v1-16 (inline-array vector4w)) (v1-18 float) @@ -292,7 +292,7 @@ ;; definition for method 34 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-trans-add-upload-strip ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 int)) +(defmethod ocean-trans-add-upload-strip ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 int)) (local-vars (v1-10 float) (a0-24 uint128) @@ -411,7 +411,7 @@ ;; definition for method 35 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-transition-check ocean ((this ocean) (arg0 ocean-trans-mask) (arg1 int) (arg2 int) (arg3 vector)) +(defmethod ocean-transition-check ((this ocean) (arg0 ocean-trans-mask) (arg1 int) (arg2 int) (arg3 vector)) (local-vars (v1-13 float) (t0-3 float) (t0-8 float) (t0-13 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -493,7 +493,7 @@ ;; definition for method 36 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-make-trans-camera-masks ocean ((this ocean) (arg0 uint) (arg1 uint) (arg2 uint) (arg3 uint)) +(defmethod ocean-make-trans-camera-masks ((this ocean) (arg0 uint) (arg1 uint) (arg2 uint) (arg3 uint)) (local-vars (sv-48 ocean-trans-mask) (sv-52 vector) (sv-56 vector) (sv-60 vector)) (set! sv-48 (the-as ocean-trans-mask (&-> this trans-camera-masks (+ (* arg2 4) arg3)))) (set! sv-52 (-> *math-camera* trans)) @@ -517,7 +517,7 @@ ;; definition for method 37 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-trans-add-upload ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) +(defmethod ocean-trans-add-upload ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) (when (not (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int arg2))) (let ((s0-0 (ocean-trans-camera-masks-bit? this (+ arg1 -1) arg2)) (s1-0 (ocean-trans-camera-masks-bit? this (+ arg1 1) arg2)) @@ -643,7 +643,7 @@ ;; definition for method 38 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod draw-ocean-transition-seams ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-transition-seams ((this ocean) (arg0 dma-buffer)) (local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere)) (set! sv-32 (-> this near-minx)) (set! sv-33 (-> this near-maxx)) @@ -695,7 +695,7 @@ ;; definition for method 39 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-trans-add-constants ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-trans-add-constants ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 4) (v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) @@ -721,7 +721,7 @@ ;; definition for method 40 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-ocean-transition ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-transition ((this ocean) (arg0 dma-buffer)) (local-vars (sv-32 uint) (sv-33 uint) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc index 37b96a8179f..8e0f351639d 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 21 of type ocean -(defmethod set-corners! ocean ((this ocean) (corner-x float) (corner-z float)) +(defmethod set-corners! ((this ocean) (corner-x float) (corner-z float)) (let* ((f2-0 (* 0.00008138021 corner-x)) (f3-0 (* 0.00008138021 corner-z)) (f0-2 f2-0) @@ -29,7 +29,7 @@ ) ;; definition for method 11 of type ocean -(defmethod get-height ocean ((this ocean) (arg0 vector) (arg1 symbol)) +(defmethod get-height ((this ocean) (arg0 vector) (arg1 symbol)) (local-vars (v1-12 int)) (cond ((and (-> this heights) *ocean-map*) @@ -112,7 +112,7 @@ ;; definition for method 17 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod add-colors! ocean ((this ocean) (arg0 vector) (arg1 ocean-vertex)) +(defmethod add-colors! ((this ocean) (arg0 vector) (arg1 ocean-vertex)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (-> this haze-lights)) ) @@ -159,7 +159,7 @@ ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-60 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-60 ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) (let ((f0-0 (-> this start-corner z))) @@ -273,7 +273,7 @@ ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-61 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-61 ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) (let* ((f0-1 (+ 18874368.0 (-> this start-corner z))) @@ -387,7 +387,7 @@ ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-62 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-62 ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) (let* ((f0-0 (-> this start-corner x)) @@ -501,7 +501,7 @@ ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-63 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-63 ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) (let ((f0-1 (+ 18874368.0 (-> this start-corner x)))) @@ -603,7 +603,7 @@ ;; definition for method 64 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-64 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-64 ((this ocean) (arg0 dma-buffer)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) (let* ((v1-1 (-> this ocean-colors)) (f30-0 (-> this start-corner x)) @@ -714,7 +714,7 @@ ;; definition for method 65 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-65 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-65 ((this ocean) (arg0 dma-buffer)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) (let* ((v1-1 (-> this ocean-colors)) (f30-0 (+ 18874368.0 (-> this start-corner x))) @@ -825,7 +825,7 @@ ;; definition for method 66 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-66 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-66 ((this ocean) (arg0 dma-buffer)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) (let* ((v1-1 (-> this ocean-colors)) (f30-0 (-> this start-corner x)) @@ -930,7 +930,7 @@ ;; definition for method 67 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-67 ocean ((this ocean) (arg0 dma-buffer)) +(defmethod ocean-method-67 ((this ocean) (arg0 dma-buffer)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) (let* ((v1-1 (-> this ocean-colors)) (f30-0 (+ 18874368.0 (-> this start-corner x))) @@ -1034,7 +1034,7 @@ ;; definition for method 68 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod render-ocean-far ocean ((this ocean) (arg1 dma-buffer) (facing int)) +(defmethod render-ocean-far ((this ocean) (arg1 dma-buffer) (facing int)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) (let ((f0-0 (-> this start-corner y))) (set! (-> vertices 0 pos y) f0-0) @@ -1085,7 +1085,7 @@ ;; definition for method 69 of type ocean ;; WARN: Return type mismatch uint vs none. -(defmethod draw-ocean-far ocean ((this ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-far ((this ocean) (arg0 dma-buffer)) (init-ocean-far-regs) (let ((gp-0 (the-as object (-> arg0 base)))) (&+! (-> arg0 base) 16) @@ -1117,7 +1117,7 @@ ;; definition for method 19 of type ocean ;; WARN: Return type mismatch pointer vs none. -(defmethod init-buffer! ocean ((this ocean) (arg0 dma-buffer)) +(defmethod init-buffer! ((this ocean) (arg0 dma-buffer)) "Initialize [[ocean]] DMA buffer." (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) @@ -1135,7 +1135,7 @@ ;; definition for method 20 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod end-buffer! ocean ((this ocean) (arg0 dma-buffer)) +(defmethod end-buffer! ((this ocean) (arg0 dma-buffer)) (dma-buffer-add-gs-set arg0 (texa (new 'static 'gs-texa :ta1 #x80))) 0 (none) @@ -1143,7 +1143,7 @@ ;; definition for method 9 of type ocean-map ;; WARN: Return type mismatch int vs none. -(defmethod set-height! ocean-map ((this ocean-map) (arg0 float)) +(defmethod set-height! ((this ocean-map) (arg0 float)) (if this (set! (-> this start-corner y) arg0) ) @@ -1152,7 +1152,7 @@ ) ;; definition for method 10 of type ocean-map -(defmethod get-base-height ocean-map ((this ocean-map)) +(defmethod get-base-height ((this ocean-map)) (if this (-> this start-corner y) 0.0 @@ -1161,7 +1161,7 @@ ;; definition for method 90 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod rgba-to-vector! ocean ((this ocean) (arg0 vector) (arg1 (pointer rgba))) +(defmethod rgba-to-vector! ((this ocean) (arg0 vector) (arg1 (pointer rgba))) "Pack an [[rgba]]'s bytes into a vector." (local-vars (v1-1 uint128) (v1-2 uint128)) (rlet ((vf1 :class vf)) @@ -1181,7 +1181,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [psrah a2, a2, 8] -(defmethod ocean-method-18 ocean ((this ocean) (arg0 (pointer ocean-colors)) (arg1 (pointer ocean-colors))) +(defmethod ocean-method-18 ((this ocean) (arg0 (pointer ocean-colors)) (arg1 (pointer ocean-colors))) "Unused" (local-vars (a1-17 (pointer ocean-colors)) @@ -1349,7 +1349,7 @@ ;; definition for method 13 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod update-map ocean ((this ocean)) +(defmethod update-map ((this ocean)) (set! (-> this heights) #f) (set! (-> this verts) #f) (let ((s5-0 *mood-control*)) @@ -1486,7 +1486,7 @@ ;; definition for method 12 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw! ocean ((this ocean)) +(defmethod draw! ((this ocean)) (do-tex-scroll! this) (set! *ocean-map* #f) (set! (-> this far-on) #f) diff --git a/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc index c5cd1b4373e..73c868dd59a 100644 --- a/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc @@ -3,15 +3,12 @@ ;; definition of type billboard (deftype billboard (drawable) - ((flat adgif-shader :inline :offset-assert 32) + ((flat adgif-shader :inline) ) - :method-count-assert 17 - :size-assert #x70 - :flag-assert #x1100000070 ) ;; definition for method 3 of type billboard -(defmethod inspect billboard ((this billboard)) +(defmethod inspect ((this billboard)) (when (not this) (set! this this) (goto cfg-4) @@ -26,26 +23,23 @@ ;; definition of type shrub-view-data (deftype shrub-view-data (structure) - ((data uint128 3 :offset-assert 0) - (texture-giftag gs-gif-tag :inline :offset 0) - (consts vector :inline :offset 16) - (fog-clamp vector :inline :offset 32) - (tex-start-ptr int32 :offset 16) - (gifbufsum float :offset 16) - (mtx-buf-ptr int32 :offset 20) - (exp23 float :offset 20) - (fog-0 float :offset 24) - (fog-1 float :offset 28) - (fog-min float :offset 32) - (fog-max float :offset 36) + ((data uint128 3) + (texture-giftag gs-gif-tag :inline :overlay-at (-> data 0)) + (consts vector :inline :overlay-at (-> data 1)) + (fog-clamp vector :inline :overlay-at (-> data 2)) + (tex-start-ptr int32 :overlay-at (-> data 1)) + (gifbufsum float :overlay-at (-> data 1)) + (mtx-buf-ptr int32 :overlay-at (-> consts y)) + (exp23 float :overlay-at mtx-buf-ptr) + (fog-0 float :overlay-at (-> consts z)) + (fog-1 float :overlay-at (-> consts w)) + (fog-min float :overlay-at (-> data 2)) + (fog-max float :overlay-at (-> fog-clamp y)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type shrub-view-data -(defmethod inspect shrub-view-data ((this shrub-view-data)) +(defmethod inspect ((this shrub-view-data)) (when (not this) (set! this this) (goto cfg-4) @@ -69,24 +63,21 @@ ;; definition of type shrubbery (deftype shrubbery (drawable) - ((textures (inline-array adgif-shader) :offset 4) - (header qword :offset 8) - (obj-qwc uint8 :offset 12) - (vtx-qwc uint8 :offset 13) - (col-qwc uint8 :offset 14) - (stq-qwc uint8 :offset 15) - (obj uint32 :offset 16) - (vtx uint32 :offset 20) - (col uint32 :offset 24) - (stq uint32 :offset 28) + ((textures (inline-array adgif-shader) :overlay-at id) + (header qword :offset 8) + (obj-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (obj uint32 :overlay-at (-> bsphere data 0)) + (vtx uint32 :overlay-at (-> bsphere data 1)) + (col uint32 :overlay-at (-> bsphere data 2)) + (stq uint32 :overlay-at (-> bsphere data 3)) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition for method 3 of type shrubbery -(defmethod inspect shrubbery ((this shrubbery)) +(defmethod inspect ((this shrubbery)) (when (not this) (set! this this) (goto cfg-4) @@ -110,17 +101,14 @@ ;; definition of type instance-shrubbery (deftype instance-shrubbery (instance) - ((flat-normal vector :inline :offset-assert 64) - (flat-hwidth float :offset 76) - (color uint32 :offset 8) + ((flat-normal vector :inline) + (flat-hwidth float :overlay-at (-> flat-normal data 3)) + (color uint32 :offset 8) ) - :method-count-assert 17 - :size-assert #x50 - :flag-assert #x1100000050 ) ;; definition for method 3 of type instance-shrubbery -(defmethod inspect instance-shrubbery ((this instance-shrubbery)) +(defmethod inspect ((this instance-shrubbery)) (when (not this) (set! this this) (goto cfg-4) @@ -141,44 +129,35 @@ ;; definition of type drawable-inline-array-instance-shrub (deftype drawable-inline-array-instance-shrub (drawable-inline-array) - ((data instance-shrubbery 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 112) + ((data instance-shrubbery 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x74 - :flag-assert #x1100000074 ) ;; definition of type drawable-tree-instance-shrub (deftype drawable-tree-instance-shrub (drawable-tree) - ((info prototype-array-shrub-info :offset 8) - (colors-added time-of-day-palette :offset 12) + ((info prototype-array-shrub-info :offset 8) + (colors-added time-of-day-palette :offset 12) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition of type generic-shrub-fragment (deftype generic-shrub-fragment (drawable) - ((textures (inline-array adgif-shader) :offset 4) - (vtx-cnt uint32 :offset 8) - (cnt-qwc uint8 :offset 12) - (vtx-qwc uint8 :offset 13) - (col-qwc uint8 :offset 14) - (stq-qwc uint8 :offset 15) - (cnt uint32 :offset 16) - (vtx uint32 :offset 20) - (col uint32 :offset 24) - (stq uint32 :offset 28) + ((textures (inline-array adgif-shader) :overlay-at id) + (vtx-cnt uint32 :offset 8) + (cnt-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (cnt uint32 :overlay-at (-> bsphere data 0)) + (vtx uint32 :overlay-at (-> bsphere data 1)) + (col uint32 :overlay-at (-> bsphere data 2)) + (stq uint32 :overlay-at (-> bsphere data 3)) ) - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition for method 3 of type generic-shrub-fragment -(defmethod inspect generic-shrub-fragment ((this generic-shrub-fragment)) +(defmethod inspect ((this generic-shrub-fragment)) (when (not this) (set! this this) (goto cfg-4) @@ -202,42 +181,30 @@ ;; definition of type prototype-shrubbery (deftype prototype-shrubbery (drawable-inline-array) - ((data shrubbery 1 :inline :offset-assert 32) - (pad uint32 :offset-assert 64) + ((data shrubbery 1 :inline) + (pad uint32) ) - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 ) ;; definition of type prototype-trans-shrubbery (deftype prototype-trans-shrubbery (prototype-shrubbery) () - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 ) ;; definition of type prototype-generic-shrub (deftype prototype-generic-shrub (drawable-group) () - :method-count-assert 17 - :size-assert #x20 - :flag-assert #x1100000020 ) ;; definition of type shrubbery-matrix (deftype shrubbery-matrix (structure) - ((mat matrix :inline :offset-assert 0) - (color qword :inline :offset-assert 64) + ((mat matrix :inline) + (color qword :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type shrubbery-matrix -(defmethod inspect shrubbery-matrix ((this shrubbery-matrix)) +(defmethod inspect ((this shrubbery-matrix)) (when (not this) (set! this this) (goto cfg-4) @@ -288,22 +255,19 @@ ;; definition of type shrub-near-packet (deftype shrub-near-packet (structure) - ((matrix-tmpl dma-packet :inline :offset-assert 0) - (header-tmpl dma-packet :inline :offset-assert 16) - (stq-tmpl dma-packet :inline :offset-assert 32) - (color-tmpl dma-packet :inline :offset-assert 48) - (vertex-tmpl dma-packet :inline :offset-assert 64) - (mscal-tmpl dma-packet :inline :offset-assert 80) - (init-tmpl dma-packet :inline :offset-assert 96) - (init-data qword 2 :inline :offset-assert 112) + ((matrix-tmpl dma-packet :inline) + (header-tmpl dma-packet :inline) + (stq-tmpl dma-packet :inline) + (color-tmpl dma-packet :inline) + (vertex-tmpl dma-packet :inline) + (mscal-tmpl dma-packet :inline) + (init-tmpl dma-packet :inline) + (init-data qword 2 :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) ;; definition for method 3 of type shrub-near-packet -(defmethod inspect shrub-near-packet ((this shrub-near-packet)) +(defmethod inspect ((this shrub-near-packet)) (when (not this) (set! this this) (goto cfg-4) @@ -323,81 +287,78 @@ ;; definition of type instance-shrub-work (deftype instance-shrub-work (structure) - ((dummy qword 3 :inline :offset-assert 0) - (chaina qword 8 :inline :offset-assert 48) - (chainb qword 8 :inline :offset-assert 176) - (colors rgba 1024 :offset-assert 304) - (matrix-tmpl qword 20 :inline :offset-assert 4400) - (count-tmpl vector4w 20 :inline :offset-assert 4720) - (mscalf-tmpl dma-packet :inline :offset-assert 5040) - (mscalf-ret-tmpl dma-packet :inline :offset-assert 5056) - (adgif-tmpl dma-gif-packet :inline :offset-assert 5072) - (billboard-tmpl dma-gif-packet :inline :offset-assert 5104) - (billboard-const vector :inline :offset-assert 5136) - (shrub-near-packets shrub-near-packet 6 :inline :offset-assert 5152) - (dma-ref dma-packet :inline :offset-assert 6016) - (dma-end dma-packet :inline :offset-assert 6032) - (wind-const vector :inline :offset-assert 6048) - (constants vector :inline :offset-assert 6064) - (color-constant vector4w :inline :offset-assert 6080) - (hmge-d vector :inline :offset-assert 6096) - (hvdf-offset vector :inline :offset-assert 6112) - (wind-force vector :inline :offset-assert 6128) - (color vector :inline :offset-assert 6144) - (bb-color vector :inline :offset-assert 6160) - (min-dist vector :inline :offset-assert 6176) - (temp-vec vector :inline :offset-assert 6192) - (guard-plane plane 4 :inline :offset-assert 6208) - (plane plane 4 :inline :offset-assert 6272) - (last uint32 4 :offset-assert 6336) - (next uint32 4 :offset-assert 6352) - (count uint16 4 :offset-assert 6368) - (mod-count uint16 4 :offset-assert 6376) - (wind-vectors uint32 :offset-assert 6384) - (instance-ptr uint32 :offset-assert 6388) - (chain-ptr uint32 :offset-assert 6392) - (chain-ptr-next uint32 :offset-assert 6396) - (stack-ptr uint32 :offset-assert 6400) - (bucket-ptr uint32 :offset-assert 6404) - (src-ptr uint32 :offset-assert 6408) - (to-spr uint32 :offset-assert 6412) - (from-spr uint32 :offset-assert 6416) - (shrub-count uint32 :offset-assert 6420) - (pad uint32 :offset-assert 6424) - (node uint32 6 :offset-assert 6428) - (length uint32 6 :offset-assert 6452) - (prototypes uint32 :offset-assert 6476) - (pad2 uint32 :offset-assert 6480) - (start-bank uint8 20 :offset-assert 6484) - (buffer-index uint32 :offset-assert 6504) - (current-spr uint32 :offset-assert 6508) - (current-mem uint32 :offset-assert 6512) - (current-shrub-near-packet uint32 :offset-assert 6516) - (current-shrub-near-trans-packet uint32 :offset-assert 6520) - (pad3 uint32 :offset-assert 6524) - (dma-buffer basic :offset-assert 6528) - (near-last uint32 :offset-assert 6532) - (near-next uint32 :offset-assert 6536) - (near-count uint32 :offset-assert 6540) - (near-trans-last uint32 :offset-assert 6544) - (near-trans-next uint32 :offset-assert 6548) - (near-trans-count uint32 :offset-assert 6552) - (last-shrubs uint32 :offset-assert 6556) - (chains uint32 :offset-assert 6560) - (flags uint32 :offset-assert 6564) - (node-count uint32 :offset-assert 6568) - (inst-count uint32 :offset-assert 6572) - (wait-from-spr uint32 :offset-assert 6576) - (wait-to-spr uint32 :offset-assert 6580) - (texture-dists uint32 :offset-assert 6584) + ((dummy qword 3 :inline) + (chaina qword 8 :inline) + (chainb qword 8 :inline) + (colors rgba 1024) + (matrix-tmpl qword 20 :inline) + (count-tmpl vector4w 20 :inline) + (mscalf-tmpl dma-packet :inline) + (mscalf-ret-tmpl dma-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (billboard-tmpl dma-gif-packet :inline) + (billboard-const vector :inline) + (shrub-near-packets shrub-near-packet 6 :inline) + (dma-ref dma-packet :inline) + (dma-end dma-packet :inline) + (wind-const vector :inline) + (constants vector :inline) + (color-constant vector4w :inline) + (hmge-d vector :inline) + (hvdf-offset vector :inline) + (wind-force vector :inline) + (color vector :inline) + (bb-color vector :inline) + (min-dist vector :inline) + (temp-vec vector :inline) + (guard-plane plane 4 :inline) + (plane plane 4 :inline) + (last uint32 4) + (next uint32 4) + (count uint16 4) + (mod-count uint16 4) + (wind-vectors uint32) + (instance-ptr uint32) + (chain-ptr uint32) + (chain-ptr-next uint32) + (stack-ptr uint32) + (bucket-ptr uint32) + (src-ptr uint32) + (to-spr uint32) + (from-spr uint32) + (shrub-count uint32) + (pad uint32) + (node uint32 6) + (length uint32 6) + (prototypes uint32) + (pad2 uint32) + (start-bank uint8 20) + (buffer-index uint32) + (current-spr uint32) + (current-mem uint32) + (current-shrub-near-packet uint32) + (current-shrub-near-trans-packet uint32) + (pad3 uint32) + (dma-buffer basic) + (near-last uint32) + (near-next uint32) + (near-count uint32) + (near-trans-last uint32) + (near-trans-next uint32) + (near-trans-count uint32) + (last-shrubs uint32) + (chains uint32) + (flags uint32) + (node-count uint32) + (inst-count uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (texture-dists uint32) ) - :method-count-assert 9 - :size-assert #x19bc - :flag-assert #x9000019bc ) ;; definition for method 3 of type instance-shrub-work -(defmethod inspect instance-shrub-work ((this instance-shrub-work)) +(defmethod inspect ((this instance-shrub-work)) (when (not this) (set! this this) (goto cfg-4) @@ -476,18 +437,15 @@ ;; definition of type instance-shrub-dma (deftype instance-shrub-dma (structure) - ((instancea uint128 325 :offset-assert 0) - (instanceb uint128 325 :offset-assert 5200) - (outa uint128 128 :offset-assert 10400) - (outb uint128 128 :offset-assert 12448) + ((instancea uint128 325) + (instanceb uint128 325) + (outa uint128 128) + (outb uint128 128) ) - :method-count-assert 9 - :size-assert #x38a0 - :flag-assert #x9000038a0 ) ;; definition for method 3 of type instance-shrub-dma -(defmethod inspect instance-shrub-dma ((this instance-shrub-dma)) +(defmethod inspect ((this instance-shrub-dma)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery_REF.gc b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery_REF.gc index 3932561d765..ad1904c030e 100644 --- a/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery_REF.gc @@ -2,13 +2,13 @@ (in-package goal) ;; definition for method 9 of type billboard -(defmethod login billboard ((this billboard)) +(defmethod login ((this billboard)) (adgif-shader-login (-> this flat)) this ) ;; definition for method 8 of type billboard -(defmethod mem-usage billboard ((this billboard) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this billboard) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 34 (-> arg0 length))) (set! (-> arg0 data 33 name) "billboard") (+! (-> arg0 data 33 count) 1) @@ -53,7 +53,7 @@ ) ;; definition for method 8 of type drawable-tree-instance-shrub -(defmethod mem-usage drawable-tree-instance-shrub ((this drawable-tree-instance-shrub) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-tree-instance-shrub) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -81,7 +81,7 @@ ) ;; definition for method 9 of type generic-shrub-fragment -(defmethod login generic-shrub-fragment ((this generic-shrub-fragment)) +(defmethod login ((this generic-shrub-fragment)) (let ((s5-0 (/ (-> this cnt-qwc) (the-as uint 5)))) (dotimes (s4-0 (the-as int s5-0)) (adgif-shader-login-no-remap (-> this textures s4-0)) @@ -91,7 +91,7 @@ ) ;; definition for method 8 of type generic-shrub-fragment -(defmethod mem-usage generic-shrub-fragment ((this generic-shrub-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this generic-shrub-fragment) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 27 (-> arg0 length))) (set! (-> arg0 data 25 name) "generic-shrub") (+! (-> arg0 data 25 count) 1) @@ -109,7 +109,7 @@ ) ;; definition for method 3 of type prototype-shrubbery -(defmethod inspect prototype-shrubbery ((this prototype-shrubbery)) +(defmethod inspect ((this prototype-shrubbery)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) @@ -120,7 +120,7 @@ ) ;; definition for method 8 of type prototype-shrubbery -(defmethod mem-usage prototype-shrubbery ((this prototype-shrubbery) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this prototype-shrubbery) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -135,7 +135,7 @@ ) ;; definition for method 9 of type prototype-shrubbery -(defmethod login prototype-shrubbery ((this prototype-shrubbery)) +(defmethod login ((this prototype-shrubbery)) (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) ) @@ -144,12 +144,12 @@ ;; definition for method 5 of type prototype-shrubbery ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of prototype-shrubbery ((this prototype-shrubbery)) +(defmethod asize-of ((this prototype-shrubbery)) (the-as int (+ (-> prototype-shrubbery size) (* (+ (-> this length) -1) 32))) ) ;; definition for method 9 of type prototype-generic-shrub -(defmethod login prototype-generic-shrub ((this prototype-generic-shrub)) +(defmethod login ((this prototype-generic-shrub)) (dotimes (s5-0 (-> this length)) (login (-> this data s5-0)) ) @@ -157,7 +157,7 @@ ) ;; definition for method 9 of type shrubbery -(defmethod login shrubbery ((this shrubbery)) +(defmethod login ((this shrubbery)) (let ((s5-0 (* (-> this header data 0) 2))) (dotimes (s4-0 (the-as int s5-0)) (let ((v1-3 (adgif-shader-login-no-remap (-> this textures s4-0)))) @@ -183,7 +183,7 @@ ) ;; definition for method 8 of type shrubbery -(defmethod mem-usage shrubbery ((this shrubbery) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this shrubbery) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 28 (-> arg0 length))) (set! (-> arg0 data 27 name) "shrubbery") (+! (-> arg0 data 27 count) 1) @@ -223,7 +223,7 @@ ) ;; definition for method 9 of type drawable-tree-instance-shrub -(defmethod login drawable-tree-instance-shrub ((this drawable-tree-instance-shrub)) +(defmethod login ((this drawable-tree-instance-shrub)) (if (nonzero? (-> this info prototype-inline-array-shrub)) (login (-> this info prototype-inline-array-shrub)) ) @@ -1070,7 +1070,7 @@ ;; definition for method 10 of type drawable-tree-instance-shrub ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-instance-shrub ((this drawable-tree-instance-shrub) (arg0 drawable-tree-instance-shrub) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-instance-shrub) (arg0 drawable-tree-instance-shrub) (arg1 display-frame)) (let ((v1-1 (-> *background-work* shrub-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) @@ -1083,13 +1083,13 @@ ) ;; definition for method 15 of type drawable-tree-instance-shrub -(defmethod unpack-vis drawable-tree-instance-shrub ((this drawable-tree-instance-shrub) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree-instance-shrub) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) ;; definition for method 13 of type drawable-tree-instance-shrub ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-tree-instance-shrub ((this drawable-tree-instance-shrub)) +(defmethod collect-stats ((this drawable-tree-instance-shrub)) (when (logtest? (vu1-renderer-mask shrubbery shrub-near billboard shrubbery-vanish) (-> *display* vu1-enable-user)) (let* ((v1-4 (-> this info prototype-inline-array-shrub)) (gp-0 (the-as object (-> v1-4 data))) @@ -1178,15 +1178,12 @@ ;; definition of type dma-test (deftype dma-test (structure) - ((data qword 101 :inline :offset-assert 0) + ((data qword 101 :inline) ) - :method-count-assert 9 - :size-assert #x650 - :flag-assert #x900000650 ) ;; definition for method 3 of type dma-test -(defmethod inspect dma-test ((this dma-test)) +(defmethod inspect ((this dma-test)) (when (not this) (set! this this) (goto cfg-4) @@ -1202,16 +1199,13 @@ ;; definition of type dma-test-work (deftype dma-test-work (structure) - ((upload dma-packet :inline :offset-assert 0) - (end dma-packet :inline :offset-assert 16) + ((upload dma-packet :inline) + (end dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type dma-test-work -(defmethod inspect dma-test-work ((this dma-test-work)) +(defmethod inspect ((this dma-test-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/sky/sky-data_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sky/sky-data_REF.gc index ca503942465..89225fee970 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sky/sky-data_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sky/sky-data_REF.gc @@ -1119,7 +1119,7 @@ ;; definition for method 9 of type sky-work ;; WARN: Return type mismatch int vs none. -(defmethod init-sun-data! sky-work ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init-sun-data! ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float)) "Sets the sun related upload data - the sun, halo and aurora" (let ((v1-0 (logand arg0 1))) (set! (-> this upload-data sun v1-0 r-sun) arg1) @@ -1132,7 +1132,7 @@ ;; definition for method 10 of type sky-work ;; WARN: Return type mismatch int vs none. -(defmethod init-orbit-settings! sky-work ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) +(defmethod init-orbit-settings! ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) (set! (-> this orbit arg0 high-noon) arg1) (set! (-> this orbit arg0 tilt) (* 0.017453292 arg2)) (set! (-> this orbit arg0 rise) (* 0.017453292 arg3)) diff --git a/test/decompiler/reference/jak2/engine/gfx/sky/sky-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sky/sky-h_REF.gc index 0ad27c3a724..9df38fe4624 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sky/sky-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sky/sky-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type sky-color-hour (deftype sky-color-hour (structure) - ((snapshot1 int32 :offset-assert 0) - (snapshot2 int32 :offset-assert 4) - (morph-start float :offset-assert 8) - (morph-end float :offset-assert 12) + ((snapshot1 int32) + (snapshot2 int32) + (morph-start float) + (morph-end float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type sky-color-hour -(defmethod inspect sky-color-hour ((this sky-color-hour)) +(defmethod inspect ((this sky-color-hour)) (when (not this) (set! this this) (goto cfg-4) @@ -30,15 +27,12 @@ ;; definition of type sky-color-day (deftype sky-color-day (structure) - ((hour sky-color-hour 24 :inline :offset-assert 0) + ((hour sky-color-hour 24 :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;; definition for method 3 of type sky-color-day -(defmethod inspect sky-color-day ((this sky-color-day)) +(defmethod inspect ((this sky-color-day)) (when (not this) (set! this this) (goto cfg-4) @@ -51,25 +45,22 @@ ;; definition of type sky-sun-data (deftype sky-sun-data (structure) - ((data uint128 4 :offset-assert 0) - (pos vector :inline :offset 0) - (r-sun float :offset 16) - (r-halo float :offset 20) - (r-aurora float :offset 24) - (c-sun-start rgba :offset 32) - (c-sun-end rgba :offset 48) - (c-halo-start rgba :offset 36) - (c-halo-end rgba :offset 52) - (c-aurora-start rgba :offset 40) - (c-aurora-end rgba :offset 56) + ((data uint128 4) + (pos vector :inline :overlay-at (-> data 0)) + (r-sun float :overlay-at (-> data 1)) + (r-halo float :offset 20) + (r-aurora float :offset 24) + (c-sun-start rgba :overlay-at (-> data 2)) + (c-sun-end rgba :overlay-at (-> data 3)) + (c-halo-start rgba :offset 36) + (c-halo-end rgba :offset 52) + (c-aurora-start rgba :offset 40) + (c-aurora-end rgba :offset 56) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type sky-sun-data -(defmethod inspect sky-sun-data ((this sky-sun-data)) +(defmethod inspect ((this sky-sun-data)) (when (not this) (set! this this) (goto cfg-4) @@ -92,17 +83,14 @@ ;; definition of type sky-moon-data (deftype sky-moon-data (structure) - ((data uint128 2 :offset-assert 0) - (pos vector :inline :offset 0) - (scale vector :inline :offset 16) + ((data uint128 2) + (pos vector :inline :overlay-at (-> data 0)) + (scale vector :inline :overlay-at (-> data 1)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sky-moon-data -(defmethod inspect sky-moon-data ((this sky-moon-data)) +(defmethod inspect ((this sky-moon-data)) (when (not this) (set! this this) (goto cfg-4) @@ -117,21 +105,18 @@ ;; definition of type sky-orbit (deftype sky-orbit (structure) - ((high-noon float :offset-assert 0) - (tilt float :offset-assert 4) - (rise float :offset-assert 8) - (dist float :offset-assert 12) - (min-halo float :offset-assert 16) - (max-halo float :offset-assert 20) + ((high-noon float) + (tilt float) + (rise float) + (dist float) + (min-halo float) + (max-halo float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type sky-orbit -(defmethod inspect sky-orbit ((this sky-orbit)) +(defmethod inspect ((this sky-orbit)) (when (not this) (set! this this) (goto cfg-4) @@ -149,17 +134,14 @@ ;; definition of type sky-upload-data (deftype sky-upload-data (structure) - ((data uint128 10 :offset-assert 0) - (sun sky-sun-data 2 :inline :offset 0) - (moon sky-moon-data :inline :offset 128) + ((data uint128 10) + (sun sky-sun-data 2 :inline :overlay-at (-> data 0)) + (moon sky-moon-data :inline :overlay-at (-> data 8)) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type sky-upload-data -(defmethod inspect sky-upload-data ((this sky-upload-data)) +(defmethod inspect ((this sky-upload-data)) (when (not this) (set! this this) (goto cfg-4) @@ -174,18 +156,15 @@ ;; definition of type sky-vertex (deftype sky-vertex (structure) - ((pos vector :inline :offset-assert 0) - (stq vector :inline :offset-assert 16) - (col vector :inline :offset-assert 32) + ((pos vector :inline) + (stq vector :inline) + (col vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type sky-vertex ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect sky-vertex ((this sky-vertex)) +(defmethod inspect ((this sky-vertex)) (when (not this) (set! this this) (goto cfg-4) @@ -200,7 +179,7 @@ ;; definition for method 3 of type sky-vertex ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect sky-vertex ((this sky-vertex)) +(defmethod inspect ((this sky-vertex)) (format #t "sky-vertex [~X]:~%" this) (format #t "~TPos: [~F ~F ~F ~F]~%" (-> this pos x) (-> this pos y) (-> this pos z) (-> this pos w)) (format #t "~TSTQ: [~F ~F ~F ~F]~%" (-> this stq x) (-> this stq y) (-> this stq z) (-> this stq w)) @@ -210,21 +189,18 @@ ;; definition of type cloud-vertex (deftype cloud-vertex (structure) - ((pos vector :inline :offset-assert 0) - (stq vector :inline :offset-assert 16) - (col vector :inline :offset-assert 32) - (nrm vector :inline :offset-assert 48) - (stq2 vector :inline :offset-assert 64) - (col2 vector :inline :offset-assert 80) - (nrm2 vector :inline :offset-assert 96) + ((pos vector :inline) + (stq vector :inline) + (col vector :inline) + (nrm vector :inline) + (stq2 vector :inline) + (col2 vector :inline) + (nrm2 vector :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type cloud-vertex -(defmethod inspect cloud-vertex ((this cloud-vertex)) +(defmethod inspect ((this cloud-vertex)) (when (not this) (set! this this) (goto cfg-4) @@ -243,15 +219,12 @@ ;; definition of type cloud-vert-array (deftype cloud-vert-array (structure) - ((data cloud-vertex 100 :inline :offset-assert 0) + ((data cloud-vertex 100 :inline) ) - :method-count-assert 9 - :size-assert #x2bc0 - :flag-assert #x900002bc0 ) ;; definition for method 3 of type cloud-vert-array -(defmethod inspect cloud-vert-array ((this cloud-vert-array)) +(defmethod inspect ((this cloud-vert-array)) (when (not this) (set! this this) (goto cfg-4) @@ -264,17 +237,14 @@ ;; definition of type haze-vertex (deftype haze-vertex (structure) - ((pos vector :inline :offset-assert 0) - (nrm vector :inline :offset-assert 16) - (col vector :inline :offset-assert 32) + ((pos vector :inline) + (nrm vector :inline) + (col vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type haze-vertex -(defmethod inspect haze-vertex ((this haze-vertex)) +(defmethod inspect ((this haze-vertex)) (when (not this) (set! this this) (goto cfg-4) @@ -289,15 +259,12 @@ ;; definition of type haze-vert-array (deftype haze-vert-array (structure) - ((data haze-vertex 36 :inline :offset-assert 0) + ((data haze-vertex 36 :inline) ) - :method-count-assert 9 - :size-assert #x6c0 - :flag-assert #x9000006c0 ) ;; definition for method 3 of type haze-vert-array -(defmethod inspect haze-vert-array ((this haze-vert-array)) +(defmethod inspect ((this haze-vert-array)) (when (not this) (set! this this) (goto cfg-4) @@ -310,26 +277,23 @@ ;; definition of type cloud-lights (deftype cloud-lights (structure) - ((sun0-normal vector :inline :offset-assert 0) - (sun1-normal vector :inline :offset-assert 16) - (moon-normal vector :inline :offset-assert 32) - (ambi-color vector :inline :offset-assert 48) - (ambi-color-lower vector :inline :offset-assert 64) - (sun0-color vector :inline :offset-assert 80) - (sun1-color vector :inline :offset-assert 96) - (moon-color vector :inline :offset-assert 112) - (sun0-color-lower vector :inline :offset-assert 128) - (sun0-scale float :offset-assert 144) - (sun1-scale float :offset-assert 148) - (moon-scale float :offset-assert 152) + ((sun0-normal vector :inline) + (sun1-normal vector :inline) + (moon-normal vector :inline) + (ambi-color vector :inline) + (ambi-color-lower vector :inline) + (sun0-color vector :inline) + (sun1-color vector :inline) + (moon-color vector :inline) + (sun0-color-lower vector :inline) + (sun0-scale float) + (sun1-scale float) + (moon-scale float) ) - :method-count-assert 9 - :size-assert #x9c - :flag-assert #x90000009c ) ;; definition for method 3 of type cloud-lights -(defmethod inspect cloud-lights ((this cloud-lights)) +(defmethod inspect ((this cloud-lights)) (when (not this) (set! this this) (goto cfg-4) @@ -353,24 +317,21 @@ ;; definition of type haze-lights (deftype haze-lights (structure) - ((sun0-normal vector :inline :offset-assert 0) - (sun1-normal vector :inline :offset-assert 16) - (moon-normal vector :inline :offset-assert 32) - (ambi-color vector :inline :offset-assert 48) - (sun0-color vector :inline :offset-assert 64) - (sun1-color vector :inline :offset-assert 80) - (moon-color vector :inline :offset-assert 96) - (sun0-scale float :offset-assert 112) - (sun1-scale float :offset-assert 116) - (moon-scale float :offset-assert 120) + ((sun0-normal vector :inline) + (sun1-normal vector :inline) + (moon-normal vector :inline) + (ambi-color vector :inline) + (sun0-color vector :inline) + (sun1-color vector :inline) + (moon-color vector :inline) + (sun0-scale float) + (sun1-scale float) + (moon-scale float) ) - :method-count-assert 9 - :size-assert #x7c - :flag-assert #x90000007c ) ;; definition for method 3 of type haze-lights -(defmethod inspect haze-lights ((this haze-lights)) +(defmethod inspect ((this haze-lights)) (when (not this) (set! this this) (goto cfg-4) @@ -392,89 +353,86 @@ ;; definition of type sky-work (deftype sky-work (structure) - ((adgif-tmpl dma-gif-packet :inline :offset-assert 0) - (draw-tmpl dma-gif-packet :inline :offset-assert 32) - (draw-tmpl2 dma-gif-packet :inline :offset-assert 64) - (fog-tmpl dma-gif-packet :inline :offset-assert 96) - (blend-tmpl dma-gif-packet :inline :offset-assert 128) - (sprite-tmpl dma-gif-packet :inline :offset-assert 160) - (sprite-tmpl2 dma-gif-packet :inline :offset-assert 192) - (sun-coords vector 2 :inline :offset-assert 224) - (green-coords vector 2 :inline :offset-assert 256) - (moon0-coords vector 2 :inline :offset-assert 288) - (moon1-coords vector 2 :inline :offset-assert 320) - (moon2-coords vector 2 :inline :offset-assert 352) - (star-coords vector 2 :inline :offset-assert 384) - (sun-colors vector4w 2 :inline :offset-assert 416) - (green-colors vector4w 2 :inline :offset-assert 448) - (moon-colors vector4w 3 :inline :offset-assert 480) - (star-colors vector4w 16 :inline :offset-assert 528) - (st-coords vector 2 :inline :offset-assert 784) - (random vector4w 8 :inline :offset-assert 816) - (giftag-base dma-gif :inline :offset-assert 944) - (giftag-haze dma-gif :inline :offset-assert 960) - (giftag-roof dma-gif :inline :offset-assert 976) - (giftag-ocean dma-gif :inline :offset-assert 992) - (fog vector :inline :offset-assert 1008) - (sky float 8 :offset-assert 1024) - (time float :offset-assert 1056) - (off-s uint16 :offset-assert 1060) - (off-t uint16 :offset-assert 1062) - (orbit sky-orbit 3 :inline :offset-assert 1064) - (upload-data sky-upload-data :inline :offset-assert 1168) - (ambi-color vector4w :inline :offset-assert 1328) - (ambi-color-lower vector4w :inline :offset-assert 1344) - (sun0-color vector4w :inline :offset-assert 1360) - (sun1-color vector4w :inline :offset-assert 1376) - (moon-color vector4w :inline :offset-assert 1392) - (sun0-color-lower vector4w :inline :offset-assert 1408) - (cam-mat matrix :inline :offset-assert 1424) - (star-mat matrix :inline :offset-assert 1488) - (vec0 vector4w :inline :offset-assert 1552) - (vec1 vector4w :inline :offset-assert 1568) - (cloud-lights cloud-lights :inline :offset-assert 1584) - (haze-lights haze-lights :inline :offset-assert 1744) - (buf dma-buffer :offset-assert 1868) - (draw-vortex basic :offset-assert 1872) - (stars vector 512 :inline :offset-assert 1888) + ((adgif-tmpl dma-gif-packet :inline) + (draw-tmpl dma-gif-packet :inline) + (draw-tmpl2 dma-gif-packet :inline) + (fog-tmpl dma-gif-packet :inline) + (blend-tmpl dma-gif-packet :inline) + (sprite-tmpl dma-gif-packet :inline) + (sprite-tmpl2 dma-gif-packet :inline) + (sun-coords vector 2 :inline) + (green-coords vector 2 :inline) + (moon0-coords vector 2 :inline) + (moon1-coords vector 2 :inline) + (moon2-coords vector 2 :inline) + (star-coords vector 2 :inline) + (sun-colors vector4w 2 :inline) + (green-colors vector4w 2 :inline) + (moon-colors vector4w 3 :inline) + (star-colors vector4w 16 :inline) + (st-coords vector 2 :inline) + (random vector4w 8 :inline) + (giftag-base dma-gif :inline) + (giftag-haze dma-gif :inline) + (giftag-roof dma-gif :inline) + (giftag-ocean dma-gif :inline) + (fog vector :inline) + (sky float 8) + (time float) + (off-s uint16) + (off-t uint16) + (orbit sky-orbit 3 :inline) + (upload-data sky-upload-data :inline) + (ambi-color vector4w :inline) + (ambi-color-lower vector4w :inline) + (sun0-color vector4w :inline) + (sun1-color vector4w :inline) + (moon-color vector4w :inline) + (sun0-color-lower vector4w :inline) + (cam-mat matrix :inline) + (star-mat matrix :inline) + (vec0 vector4w :inline) + (vec1 vector4w :inline) + (cloud-lights cloud-lights :inline) + (haze-lights haze-lights :inline) + (buf dma-buffer) + (draw-vortex basic) + (stars vector 512 :inline) ) - :method-count-assert 37 - :size-assert #x2760 - :flag-assert #x2500002760 (:methods - (init-sun-data! (_type_ int float float float) none 9) - (init-orbit-settings! (_type_ int float float float float float float) none 10) - (update-colors-for-time (_type_ float) none 11) - (update-time-and-speed (_type_ float float) none 12) - (draw (_type_) none 13) - (update-matrix (_type_ matrix) none 14) - (update-template-colors (_type_) none 15) - (init-regs-for-large-polygon-draw (_type_) none 16) - (init-regs-for-sky-asm (_type_) none 17) - (cloud-vtx-light-update (_type_ vector vector cloud-lights vector vector) none 18) - (cloud-vtx-tex-update (_type_ vector vector vector cloud-lights) none 19) - (adjust-cloud-lighting (_type_) none 20) - (cloud-vtx1-to-sky (_type_ sky-vertex cloud-vertex) none 21) - (cloud-vtx2-to-sky (_type_ sky-vertex cloud-vertex) none 22) - (draw-clouds (_type_ dma-buffer) none 23) - (apply-haze-light (_type_ vector vector haze-lights) none 24) - (adjust-haze-lighting (_type_) none 25) - (haze-vtx-to-sky (_type_ sky-vertex sky-vertex haze-vertex) none 26) - (draw-haze (_type_ dma-buffer) none 27) - (sun-dma (_type_ dma-buffer) none 28) - (green-sun-dma (_type_ dma-buffer) none 29) - (moon-dma (_type_ dma-buffer) none 30) - (setup-stars (_type_ matrix sky-upload-data) none 31) - (stars-transform-asm (_type_) none 32) - (stars-dma (_type_ dma-buffer) none 33) - (draw-roof (_type_ dma-buffer) none 34) - (draw-base (_type_ dma-buffer) none 35) - (draw-fog (_type_ dma-buffer) none 36) + (init-sun-data! (_type_ int float float float) none) + (init-orbit-settings! (_type_ int float float float float float float) none) + (update-colors-for-time (_type_ float) none) + (update-time-and-speed (_type_ float float) none) + (draw (_type_) none) + (update-matrix (_type_ matrix) none) + (update-template-colors (_type_) none) + (init-regs-for-large-polygon-draw (_type_) none) + (init-regs-for-sky-asm (_type_) none) + (cloud-vtx-light-update (_type_ vector vector cloud-lights vector vector) none) + (cloud-vtx-tex-update (_type_ vector vector vector cloud-lights) none) + (adjust-cloud-lighting (_type_) none) + (cloud-vtx1-to-sky (_type_ sky-vertex cloud-vertex) none) + (cloud-vtx2-to-sky (_type_ sky-vertex cloud-vertex) none) + (draw-clouds (_type_ dma-buffer) none) + (apply-haze-light (_type_ vector vector haze-lights) none) + (adjust-haze-lighting (_type_) none) + (haze-vtx-to-sky (_type_ sky-vertex sky-vertex haze-vertex) none) + (draw-haze (_type_ dma-buffer) none) + (sun-dma (_type_ dma-buffer) none) + (green-sun-dma (_type_ dma-buffer) none) + (moon-dma (_type_ dma-buffer) none) + (setup-stars (_type_ matrix sky-upload-data) none) + (stars-transform-asm (_type_) none) + (stars-dma (_type_ dma-buffer) none) + (draw-roof (_type_ dma-buffer) none) + (draw-base (_type_ dma-buffer) none) + (draw-fog (_type_ dma-buffer) none) ) ) ;; definition for method 3 of type sky-work -(defmethod inspect sky-work ((this sky-work)) +(defmethod inspect ((this sky-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/sky/sky-tng_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sky/sky-tng_REF.gc index f626bcfc0ab..bddea60ee61 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sky/sky-tng_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sky/sky-tng_REF.gc @@ -50,7 +50,7 @@ ;; definition for method 14 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-matrix sky-work ((this sky-work) (arg0 matrix)) +(defmethod update-matrix ((this sky-work) (arg0 matrix)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((v1-0 (-> this cam-mat))) @@ -77,7 +77,7 @@ ;; definition for method 15 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-template-colors sky-work ((this sky-work)) +(defmethod update-template-colors ((this sky-work)) (let ((v1-1 (-> *time-of-day-context* current-fog erase-color)) (a0-2 (-> *level* default-level mood-context current-sky-color)) ) @@ -92,7 +92,7 @@ ;; definition for method 12 of type sky-work ;; WARN: Return type mismatch int vs none. -(defmethod update-time-and-speed sky-work ((this sky-work) (arg0 float) (arg1 float)) +(defmethod update-time-and-speed ((this sky-work) (arg0 float) (arg1 float)) (if (and (level-get-target-inside *level*) (= (-> (level-get-target-inside *level*) info taskname) 'nest)) (set! arg1 (* 10.0 arg1)) ) @@ -117,7 +117,7 @@ ;; definition for method 11 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-colors-for-time sky-work ((this sky-work) (arg0 float)) +(defmethod update-colors-for-time ((this sky-work) (arg0 float)) 0 0 0.0 @@ -168,7 +168,7 @@ ;; definition for method 18 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod cloud-vtx-light-update sky-work ((this sky-work) (arg0 vector) (arg1 vector) (arg2 cloud-lights) (arg3 vector) (arg4 vector)) +(defmethod cloud-vtx-light-update ((this sky-work) (arg0 vector) (arg1 vector) (arg2 cloud-lights) (arg3 vector) (arg4 vector)) (let ((s5-0 (new 'stack-no-clear 'vector4))) (let* ((f0-1 (vector-dot (-> arg2 sun0-normal) arg1)) (f1-1 (vector-dot (-> arg2 sun1-normal) arg1)) @@ -194,7 +194,7 @@ ;; definition for method 19 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod cloud-vtx-tex-update sky-work ((this sky-work) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 cloud-lights)) +(defmethod cloud-vtx-tex-update ((this sky-work) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 cloud-lights)) (let ((s5-0 (new 'stack-no-clear 'vector4)) (s2-0 (new 'stack-no-clear 'vector4)) (s4-0 (new 'stack-no-clear 'vector4)) @@ -218,7 +218,7 @@ ;; definition for method 20 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod adjust-cloud-lighting sky-work ((this sky-work)) +(defmethod adjust-cloud-lighting ((this sky-work)) (let ((s5-0 *cloud-vert-array*) (s4-0 (-> this cloud-lights)) ) @@ -282,7 +282,7 @@ ;; definition for method 21 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod cloud-vtx1-to-sky sky-work ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) +(defmethod cloud-vtx1-to-sky ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) (set! (-> arg0 pos quad) (-> arg1 pos quad)) (set! (-> arg0 stq quad) (-> arg1 stq quad)) (set! (-> arg0 col quad) (-> arg1 col quad)) @@ -293,7 +293,7 @@ ;; definition for method 22 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod cloud-vtx2-to-sky sky-work ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) +(defmethod cloud-vtx2-to-sky ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) (set! (-> arg0 pos quad) (-> arg1 pos quad)) (set! (-> arg0 stq quad) (-> arg1 stq2 quad)) (set! (-> arg0 col quad) (-> arg1 col2 quad)) @@ -304,7 +304,7 @@ ;; definition for method 23 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-clouds sky-work ((this sky-work) (arg0 dma-buffer)) +(defmethod draw-clouds ((this sky-work) (arg0 dma-buffer)) (local-vars (v1-19 float) (sv-16 cloud-vert-array) (sv-20 (inline-array sky-vertex)) (sv-32 int)) (rlet ((vf23 :class vf) (vf27 :class vf) @@ -380,7 +380,7 @@ ;; definition for method 24 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod apply-haze-light sky-work ((this sky-work) (arg0 vector) (arg1 vector) (arg2 haze-lights)) +(defmethod apply-haze-light ((this sky-work) (arg0 vector) (arg1 vector) (arg2 haze-lights)) (let ((s5-0 (new 'stack-no-clear 'vector4))) (let* ((f0-1 (vector-dot (-> arg2 sun0-normal) arg1)) (f1-1 (vector-dot (-> arg2 sun1-normal) arg1)) @@ -406,7 +406,7 @@ ;; definition for method 25 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod adjust-haze-lighting sky-work ((this sky-work)) +(defmethod adjust-haze-lighting ((this sky-work)) (let ((s5-0 *haze-vert-array*) (s4-0 (-> this haze-lights)) ) @@ -454,7 +454,7 @@ ;; definition for method 26 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod haze-vtx-to-sky sky-work ((this sky-work) (arg0 sky-vertex) (arg1 sky-vertex) (arg2 haze-vertex)) +(defmethod haze-vtx-to-sky ((this sky-work) (arg0 sky-vertex) (arg1 sky-vertex) (arg2 haze-vertex)) (set! (-> arg0 pos quad) (-> arg2 pos quad)) (set! (-> arg0 col quad) (-> arg2 col quad)) (set! (-> arg0 col w) 128.0) @@ -468,7 +468,7 @@ ;; definition for method 27 of type sky-work ;; WARN: Return type mismatch int vs none. -(defmethod draw-haze sky-work ((this sky-work) (arg0 dma-buffer)) +(defmethod draw-haze ((this sky-work) (arg0 dma-buffer)) (local-vars (sv-16 haze-vert-array) (sv-20 (inline-array sky-vertex))) (rlet ((vf27 :class vf)) (dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))) @@ -514,7 +514,7 @@ ;; definition for method 31 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod setup-stars sky-work ((this sky-work) (arg0 matrix) (arg1 sky-upload-data)) +(defmethod setup-stars ((this sky-work) (arg0 matrix) (arg1 sky-upload-data)) (set! (-> arg0 vector 2 quad) (-> arg1 data 0)) (vector-normalize! (-> arg0 vector 2) 1.0) (vector-cross! (the-as vector (-> arg0 vector)) *z-vector* (-> arg0 vector 2)) @@ -546,7 +546,7 @@ ;; definition for method 34 of type sky-work ;; WARN: Return type mismatch int vs none. -(defmethod draw-roof sky-work ((this sky-work) (arg0 dma-buffer)) +(defmethod draw-roof ((this sky-work) (arg0 dma-buffer)) (rlet ((vf27 :class vf)) (dma-buffer-add-gs-set arg0 (zbuf-1 (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24))) @@ -575,7 +575,7 @@ ;; definition for method 35 of type sky-work ;; WARN: Return type mismatch int vs none. -(defmethod draw-base sky-work ((this sky-work) (arg0 dma-buffer)) +(defmethod draw-base ((this sky-work) (arg0 dma-buffer)) (rlet ((vf27 :class vf)) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) @@ -602,7 +602,7 @@ ;; definition for method 36 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-fog sky-work ((this sky-work) (arg0 dma-buffer)) +(defmethod draw-fog ((this sky-work) (arg0 dma-buffer)) (let ((s4-0 (-> *sky-texture-anim-array* array-data 8 tex))) (if s4-0 (dma-buffer-add-gs-set arg0 @@ -662,7 +662,7 @@ ;; definition for method 13 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw sky-work ((this sky-work)) +(defmethod draw ((this sky-work)) (let ((v1-0 *time-of-day-context*) (a0-1 #f) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc index f8412b13472..a7732ca6110 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc @@ -6,51 +6,48 @@ ;; definition of type sparticle-cpuinfo (deftype sparticle-cpuinfo (structure) - ((sprite sprite-vec-data-2d :offset-assert 0) - (adgif adgif-shader :offset-assert 4) - (radius float :offset-assert 8) - (omega float :offset-assert 12) - (vel-sxvel vector :inline :offset-assert 16) - (rot-syvel vector :inline :offset-assert 32) - (fade rgbaf :inline :offset-assert 48) - (acc vector :inline :offset-assert 64) - (rotvel3d quaternion :inline :offset-assert 80) - (vel vector :inline :offset 16) - (accel vector :inline :offset 64) - (scalevelx float :offset 28) - (scalevely float :offset 44) - (friction float :offset-assert 96) - (timer int32 :offset-assert 100) - (flags sp-cpuinfo-flag :offset-assert 104) - (flags-s32 sp-cpuinfo-flag-s32 :offset 104) - (user-int32 int32 :offset-assert 108) - (user-uint32 uint32 :offset 108) - (user-float float :offset 108) - (user-pntr uint32 :offset 108) - (user-object basic :offset 108) - (user-sprite sprite-vec-data-2d :offset 108) - (sp-func (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) :offset-assert 112) - (next-time uint32 :offset-assert 116) - (next-launcher basic :offset-assert 120) - (cache-alpha float :offset-assert 124) - (valid uint8 :offset-assert 128) - (clock-index uint8 :offset-assert 129) - (user1-int16 uint16 :offset-assert 130) - (key sparticle-launch-control :offset-assert 132) - (key-alt sparticle-launch-state :offset 132) - (binding sparticle-launch-state :offset-assert 136) - (data uint32 1 :offset 12) - (datab int8 4 :offset 12) - (dataf float 1 :offset 12) - (datac uint8 1 :offset 12) + ((sprite sprite-vec-data-2d) + (adgif adgif-shader) + (radius float) + (omega float) + (vel-sxvel vector :inline) + (rot-syvel vector :inline) + (fade rgbaf :inline) + (acc vector :inline) + (rotvel3d quaternion :inline) + (vel vector :inline :overlay-at vel-sxvel) + (accel vector :inline :overlay-at acc) + (scalevelx float :overlay-at (-> vel-sxvel data 3)) + (scalevely float :overlay-at (-> rot-syvel data 3)) + (friction float) + (timer int32) + (flags sp-cpuinfo-flag) + (flags-s32 sp-cpuinfo-flag-s32 :overlay-at flags) + (user-int32 int32) + (user-uint32 uint32 :overlay-at user-int32) + (user-float float :overlay-at user-int32) + (user-pntr uint32 :overlay-at user-int32) + (user-object basic :overlay-at user-int32) + (user-sprite sprite-vec-data-2d :overlay-at user-int32) + (sp-func (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none)) + (next-time uint32) + (next-launcher basic) + (cache-alpha float) + (valid uint8) + (clock-index uint8) + (user1-int16 uint16) + (key sparticle-launch-control) + (key-alt sparticle-launch-state :overlay-at key) + (binding sparticle-launch-state) + (data uint32 1 :overlay-at omega) + (datab int8 4 :overlay-at omega) + (dataf float 1 :overlay-at omega) + (datac uint8 1 :overlay-at omega) ) - :method-count-assert 9 - :size-assert #x8c - :flag-assert #x90000008c ) ;; definition for method 3 of type sparticle-cpuinfo -(defmethod inspect sparticle-cpuinfo ((this sparticle-cpuinfo)) +(defmethod inspect ((this sparticle-cpuinfo)) (when (not this) (set! this this) (goto cfg-4) @@ -97,27 +94,24 @@ ;; definition of type sparticle-launchinfo (deftype sparticle-launchinfo (structure) - ((launchrot vector :inline :offset-assert 0) - (conerot vector :inline :offset-assert 16) - (rotate-x float :offset-assert 32) - (rotate-y float :offset-assert 36) - (rotate-z float :offset-assert 40) - (coneradius float :offset-assert 44) - (rotate vector :inline :offset 32) - (scale-x float :offset 48) - (scale-y float :offset 52) - (scale-z float :offset 56) - (dummy float :offset 60) - (scale vector :inline :offset 48) - (data uint8 1 :offset 0) + ((launchrot vector :inline) + (conerot vector :inline) + (rotate-x float) + (rotate-y float) + (rotate-z float) + (coneradius float) + (rotate vector :inline :overlay-at rotate-x) + (scale-x float :offset 48) + (scale-y float :offset 52) + (scale-z float :offset 56) + (dummy float :offset 60) + (scale vector :inline :overlay-at scale-x) + (data uint8 1 :overlay-at (-> launchrot data 0)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type sparticle-launchinfo -(defmethod inspect sparticle-launchinfo ((this sparticle-launchinfo)) +(defmethod inspect ((this sparticle-launchinfo)) (when (not this) (set! this this) (goto cfg-4) @@ -142,26 +136,23 @@ ;; definition of type sparticle-system (deftype sparticle-system (basic) - ((blocks int32 2 :offset-assert 4) - (length int32 2 :offset-assert 12) - (num-alloc int32 2 :offset-assert 20) - (is-3d basic :offset-assert 28) - (flags uint32 :offset-assert 32) - (alloc-table (pointer uint64) :offset-assert 36) - (cpuinfo-table (inline-array sparticle-cpuinfo) :offset-assert 40) - (vecdata-table pointer :offset-assert 44) - (adgifdata-table (inline-array adgif-shader) :offset-assert 48) + ((blocks int32 2) + (length int32 2) + (num-alloc int32 2) + (is-3d basic) + (flags uint32) + (alloc-table (pointer uint64)) + (cpuinfo-table (inline-array sparticle-cpuinfo)) + (vecdata-table pointer) + (adgifdata-table (inline-array adgif-shader)) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 (:methods - (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_ 0) + (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_) ) ) ;; definition for method 3 of type sparticle-system -(defmethod inspect sparticle-system ((this sparticle-system)) +(defmethod inspect ((this sparticle-system)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc index 53031c30a6a..f72bec80430 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc @@ -3,23 +3,20 @@ ;; definition of type sparticle-birthinfo (deftype sparticle-birthinfo (structure) - ((sprite uint32 :offset-assert 0) - (anim int32 :offset-assert 4) - (anim-speed float :offset-assert 8) - (birth-func basic :offset-assert 12) - (joint-ppoint int32 :offset-assert 16) - (num-to-birth float :offset-assert 20) - (sound basic :offset-assert 24) - (dataf float 1 :offset 0) - (data uint32 1 :offset 0) + ((sprite uint32) + (anim int32) + (anim-speed float) + (birth-func basic) + (joint-ppoint int32) + (num-to-birth float) + (sound basic) + (dataf float 1 :overlay-at sprite) + (data uint32 1 :overlay-at sprite) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type sparticle-birthinfo -(defmethod inspect sparticle-birthinfo ((this sparticle-birthinfo)) +(defmethod inspect ((this sparticle-birthinfo)) (when (not this) (set! this this) (goto cfg-4) @@ -40,28 +37,25 @@ ;; definition of type sp-field-init-spec (deftype sp-field-init-spec (structure) - ((field sp-field-id :offset-assert 0) - (flags sp-flag :offset-assert 2) - (initial-valuef float :offset-assert 4) - (random-rangef float :offset-assert 8) - (random-multf float :offset-assert 12) - (initial-value int32 :offset 4) - (random-range int32 :offset 8) - (random-mult int32 :offset 12) - (func symbol :offset 4) - (tex texture-id :offset 4) - (pntr pointer :offset 4) - (object basic :offset 4) - (sym symbol :offset 4) - (sound sound-spec :offset 4) + ((field sp-field-id) + (flags sp-flag) + (initial-valuef float) + (random-rangef float) + (random-multf float) + (initial-value int32 :overlay-at initial-valuef) + (random-range int32 :overlay-at random-rangef) + (random-mult int32 :overlay-at random-multf) + (func symbol :overlay-at initial-valuef) + (tex texture-id :overlay-at initial-valuef) + (pntr pointer :overlay-at initial-valuef) + (object basic :overlay-at initial-valuef) + (sym symbol :overlay-at initial-valuef) + (sound sound-spec :overlay-at initial-valuef) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type sp-field-init-spec -(defmethod inspect sp-field-init-spec ((this sp-field-init-spec)) +(defmethod inspect ((this sp-field-init-spec)) (when (not this) (set! this this) (goto cfg-4) @@ -87,21 +81,18 @@ ;; definition of type sparticle-launcher (deftype sparticle-launcher (basic) - ((birthaccum float :offset-assert 4) - (soundaccum float :offset-assert 8) - (init-specs (inline-array sp-field-init-spec) :offset-assert 12) + ((birthaccum float) + (soundaccum float) + (init-specs (inline-array sp-field-init-spec)) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (get-field-spec-by-id (_type_ sp-field-id) sp-field-init-spec 9) - (setup-user-array (_type_ string) none 10) + (get-field-spec-by-id (_type_ sp-field-id) sp-field-init-spec) + (setup-user-array (_type_ string) none) ) ) ;; definition for method 3 of type sparticle-launcher -(defmethod inspect sparticle-launcher ((this sparticle-launcher)) +(defmethod inspect ((this sparticle-launcher)) (when (not this) (set! this this) (goto cfg-4) @@ -116,23 +107,20 @@ ;; definition of type sparticle-group-item (deftype sparticle-group-item (structure) - ((launcher uint32 :offset-assert 0) - (fade-after meters :offset-assert 4) - (falloff-to meters :offset-assert 8) - (flags sp-group-item-flag :offset-assert 12) - (period uint16 :offset-assert 14) - (length uint16 :offset-assert 16) - (offset int16 :offset-assert 18) - (hour-mask uint32 :offset-assert 20) - (binding uint32 :offset-assert 24) + ((launcher uint32) + (fade-after meters) + (falloff-to meters) + (flags sp-group-item-flag) + (period uint16) + (length uint16) + (offset int16) + (hour-mask uint32) + (binding uint32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type sparticle-group-item -(defmethod inspect sparticle-group-item ((this sparticle-group-item)) +(defmethod inspect ((this sparticle-group-item)) (when (not this) (set! this this) (goto cfg-4) @@ -153,29 +141,26 @@ ;; definition of type sparticle-launch-state (deftype sparticle-launch-state (structure) - ((group-item sparticle-group-item :offset-assert 0) - (flags sp-launch-state-flags :offset-assert 4) - (randomize uint16 :offset-assert 6) - (center vector :offset-assert 8) - (sprite3d sprite-vec-data-3d :offset-assert 12) - (sprite sparticle-cpuinfo :offset-assert 16) - (offset uint32 :offset-assert 20) - (accum float :offset-assert 24) - (spawn-time uint32 :offset-assert 28) - (control sparticle-launch-control :offset-assert 32) - (swarm basic :offset 20) - (seed uint32 :offset 24) - (time uint32 :offset 28) - (spec basic :offset 16) - (id uint32 :offset 12) + ((group-item sparticle-group-item) + (flags sp-launch-state-flags) + (randomize uint16) + (center vector) + (sprite3d sprite-vec-data-3d) + (sprite sparticle-cpuinfo) + (offset uint32) + (accum float) + (spawn-time uint32) + (control sparticle-launch-control) + (swarm basic :overlay-at offset) + (seed uint32 :overlay-at accum) + (time uint32 :overlay-at spawn-time) + (spec basic :overlay-at sprite) + (id uint32 :overlay-at sprite3d) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type sparticle-launch-state -(defmethod inspect sparticle-launch-state ((this sparticle-launch-state)) +(defmethod inspect ((this sparticle-launch-state)) (when (not this) (set! this this) (goto cfg-4) @@ -202,30 +187,27 @@ ;; definition of type sparticle-launch-group (deftype sparticle-launch-group (basic) - ((length int16 :offset-assert 4) - (duration uint16 :offset-assert 6) - (linger-duration uint16 :offset-assert 8) - (flags sp-group-flag :offset-assert 10) - (name string :offset-assert 12) - (launcher (inline-array sparticle-group-item) :offset-assert 16) - (rotate-x degrees :offset-assert 20) - (rotate-y degrees :offset-assert 24) - (rotate-z degrees :offset-assert 28) - (scale-x float :offset-assert 32) - (scale-y float :offset-assert 36) - (scale-z float :offset-assert 40) - (bounds sphere :inline :offset-assert 48) + ((length int16) + (duration uint16) + (linger-duration uint16) + (flags sp-group-flag) + (name string) + (launcher (inline-array sparticle-group-item)) + (rotate-x degrees) + (rotate-y degrees) + (rotate-z degrees) + (scale-x float) + (scale-y float) + (scale-z float) + (bounds sphere :inline) ) - :method-count-assert 10 - :size-assert #x40 - :flag-assert #xa00000040 (:methods - (create-launch-control (_type_ process) sparticle-launch-control 9) + (create-launch-control (_type_ process) sparticle-launch-control) ) ) ;; definition for method 3 of type sparticle-launch-group -(defmethod inspect sparticle-launch-group ((this sparticle-launch-group)) +(defmethod inspect ((this sparticle-launch-group)) (when (not this) (set! this this) (goto cfg-4) @@ -253,35 +235,32 @@ ;; definition of type sparticle-launch-control (deftype sparticle-launch-control (inline-array-class) - ((group sparticle-launch-group :offset-assert 16) - (proc process-drawable :offset-assert 20) - (local-clock int32 :offset-assert 24) - (fade float :offset-assert 28) - (matrix int8 :offset-assert 32) - (state-mode uint8 3 :offset-assert 33) - (state-counter uint32 :offset-assert 36) - (last-spawn-frame int32 :offset-assert 40) - (last-spawn-time int32 :offset-assert 44) - (origin matrix :inline :offset-assert 48) - (center vector :inline :offset 96) - (data sparticle-launch-state :inline :dynamic :offset-assert 112) + ((group sparticle-launch-group) + (proc process-drawable) + (local-clock int32) + (fade float) + (matrix int8) + (state-mode uint8 3) + (state-counter uint32) + (last-spawn-frame int32) + (last-spawn-time int32) + (origin matrix :inline) + (center vector :inline :overlay-at (-> origin data 12)) + (data sparticle-launch-state :inline :dynamic) ) - :method-count-assert 16 - :size-assert #x70 - :flag-assert #x1000000070 (:methods - (initialize (_type_ sparticle-launch-group process) none 9) - (is-visible? (_type_ vector) symbol 10) - (spawn (_type_ vector) none 11) - (spawn-with-matrix (_type_ matrix) none 12) - (spawn-with-cspace (_type_ cspace) none 13) - (kill-and-free-particles (_type_) none 14) - (kill-particles (_type_) none 15) + (initialize (_type_ sparticle-launch-group process) none) + (is-visible? (_type_ vector) symbol) + (spawn (_type_ vector) none) + (spawn-with-matrix (_type_ matrix) none) + (spawn-with-cspace (_type_ cspace) none) + (kill-and-free-particles (_type_) none) + (kill-particles (_type_) none) ) ) ;; definition for method 3 of type sparticle-launch-control -(defmethod inspect sparticle-launch-control ((this sparticle-launch-control)) +(defmethod inspect ((this sparticle-launch-control)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc index 366756f3021..da7428e883d 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 3 of type sparticle-launcher ;; WARN: Return type mismatch int vs sparticle-launcher. -(defmethod inspect sparticle-launcher ((this sparticle-launcher)) +(defmethod inspect ((this sparticle-launcher)) (format #t "~X: sparticle-launcher~%" this) (let ((s5-0 0)) (while (!= (-> this init-specs s5-0 field) (sp-field-id spt-end)) @@ -335,17 +335,14 @@ ;; definition of type sp-queued-launch-particles (deftype sp-queued-launch-particles (structure) - ((sp-system sparticle-system :offset-assert 0) - (sp-launcher sparticle-launcher :offset-assert 4) - (pos vector :inline :offset-assert 16) + ((sp-system sparticle-system) + (sp-launcher sparticle-launcher) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sp-queued-launch-particles -(defmethod inspect sp-queued-launch-particles ((this sp-queued-launch-particles)) +(defmethod inspect ((this sp-queued-launch-particles)) (when (not this) (set! this this) (goto cfg-4) @@ -360,16 +357,13 @@ ;; definition of type sp-launch-queue (deftype sp-launch-queue (basic) - ((in-use int32 :offset-assert 4) - (queue sp-queued-launch-particles 256 :inline :offset-assert 16) + ((in-use int32) + (queue sp-queued-launch-particles 256 :inline) ) - :method-count-assert 9 - :size-assert #x2010 - :flag-assert #x900002010 ) ;; definition for method 3 of type sp-launch-queue -(defmethod inspect sp-launch-queue ((this sp-launch-queue)) +(defmethod inspect ((this sp-launch-queue)) (when (not this) (set! this this) (goto cfg-4) @@ -426,19 +420,16 @@ ;; definition of type particle-adgif-cache (deftype particle-adgif-cache (basic) - ((used int32 :offset-assert 4) - (last uint16 :offset-assert 8) - (lastgif adgif-shader :offset-assert 12) - (tidhash uint16 80 :offset-assert 16) - (spadgif adgif-shader 80 :inline :offset-assert 176) + ((used int32) + (last uint16) + (lastgif adgif-shader) + (tidhash uint16 80) + (spadgif adgif-shader 80 :inline) ) - :method-count-assert 9 - :size-assert #x19b0 - :flag-assert #x9000019b0 ) ;; definition for method 3 of type particle-adgif-cache -(defmethod inspect particle-adgif-cache ((this particle-adgif-cache)) +(defmethod inspect ((this particle-adgif-cache)) (when (not this) (set! this this) (goto cfg-4) @@ -675,31 +666,28 @@ ;; definition of type sp-launch-stack (deftype sp-launch-stack (structure) - ((ra basic :offset-assert 0) - (dummy0 basic :offset-assert 4) - (dummy1 basic :offset-assert 8) - (b-spfic basic :offset-assert 12) - (r16 uint128 :offset-assert 16) - (r17 uint128 :offset-assert 32) - (r18 uint128 :offset-assert 48) - (pos uint128 :offset-assert 64) - (matrix matrix :inline :offset-assert 80) - (l-spfic basic :offset-assert 144) - (birth-info sparticle-birthinfo :inline :offset-assert 160) - (sprite sprite-vec-data-2d :inline :offset-assert 192) - (r19 uint128 :offset-assert 240) - (r20 uint128 :offset-assert 256) - (r21 uint128 :offset-assert 272) - (r22 uint128 :offset-assert 288) + ((ra basic) + (dummy0 basic) + (dummy1 basic) + (b-spfic basic) + (r16 uint128) + (r17 uint128) + (r18 uint128) + (pos uint128) + (matrix matrix :inline) + (l-spfic basic) + (birth-info sparticle-birthinfo :inline) + (sprite sprite-vec-data-2d :inline) + (r19 uint128) + (r20 uint128) + (r21 uint128) + (r22 uint128) ) - :method-count-assert 9 - :size-assert #x130 - :flag-assert #x900000130 ) ;; definition for method 3 of type sp-launch-stack ;; INFO: Used lq/sq -(defmethod inspect sp-launch-stack ((this sp-launch-stack)) +(defmethod inspect ((this sp-launch-stack)) (when (not this) (set! this this) (goto cfg-4) @@ -1031,7 +1019,7 @@ ;; definition for method 9 of type sparticle-launch-control ;; WARN: Return type mismatch int vs none. -(defmethod initialize sparticle-launch-control ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) +(defmethod initialize ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) (let ((s5-0 0)) (set! (-> this group) arg0) (set! (-> this proc) (the-as process-drawable arg1)) @@ -1115,7 +1103,7 @@ ;; definition for method 9 of type sparticle-launch-group ;; WARN: Return type mismatch object vs sparticle-launch-control. -(defmethod create-launch-control sparticle-launch-group ((this sparticle-launch-group) (arg0 process)) +(defmethod create-launch-control ((this sparticle-launch-group) (arg0 process)) (let ((gp-0 (the-as object (new 'process 'sparticle-launch-control (-> this length))))) (when (zero? (the-as sparticle-launch-control gp-0)) (go process-drawable-art-error "memory") @@ -1130,7 +1118,7 @@ ;; definition for method 14 of type sparticle-launch-control ;; WARN: Return type mismatch int vs none. -(defmethod kill-and-free-particles sparticle-launch-control ((this sparticle-launch-control)) +(defmethod kill-and-free-particles ((this sparticle-launch-control)) (countdown (v1-0 (-> this length)) (let ((a0-4 (-> this data v1-0))) (logclear! (-> a0-4 flags) (sp-launch-state-flags particles-active)) @@ -1148,14 +1136,14 @@ ;; definition for method 15 of type sparticle-launch-control ;; WARN: Return type mismatch int vs none. -(defmethod kill-particles sparticle-launch-control ((this sparticle-launch-control)) +(defmethod kill-particles ((this sparticle-launch-control)) (kill-all-particles-with-key this) 0 (none) ) ;; definition for method 10 of type sparticle-launch-control -(defmethod is-visible? sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) +(defmethod is-visible? ((this sparticle-launch-control) (arg0 vector)) (let* ((v1-0 (-> this group)) (f0-0 (-> v1-0 bounds r)) ) @@ -1191,7 +1179,7 @@ ;; definition for method 12 of type sparticle-launch-control ;; INFO: Used lq/sq -(defmethod spawn-with-matrix sparticle-launch-control ((this sparticle-launch-control) (arg0 matrix)) +(defmethod spawn-with-matrix ((this sparticle-launch-control) (arg0 matrix)) (let* ((a2-0 (-> this origin)) (a3-0 arg0) (v1-0 (-> a3-0 quad 0)) @@ -1239,7 +1227,7 @@ ;; definition for method 13 of type sparticle-launch-control ;; INFO: Used lq/sq -(defmethod spawn-with-cspace sparticle-launch-control ((this sparticle-launch-control) (arg0 cspace)) +(defmethod spawn-with-cspace ((this sparticle-launch-control) (arg0 cspace)) (let* ((v1-0 (-> this origin)) (a3-0 (-> arg0 bone transform)) (a0-2 (-> a3-0 quad 0)) @@ -1289,7 +1277,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 11 sparticle-launch-control) has a return type of none, but the expression builder found a return statement. -(defmethod spawn sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) +(defmethod spawn ((this sparticle-launch-control) (arg0 vector)) (with-pp (set! (-> this origin trans quad) (-> arg0 quad)) (if (not (or (is-visible? this arg0) (logtest? (-> this group flags) (sp-group-flag always-draw screen-space)))) @@ -2321,7 +2309,7 @@ ;; definition for method 9 of type sparticle-launcher ;; WARN: new jak 2 until loop case, check carefully -(defmethod get-field-spec-by-id sparticle-launcher ((this sparticle-launcher) (arg0 sp-field-id)) +(defmethod get-field-spec-by-id ((this sparticle-launcher) (arg0 sp-field-id)) "Returns the [[sp-field-init-spec]] that has the matching [[sp-field-id]]" (let ((v1-0 0)) (until #f @@ -2345,7 +2333,7 @@ ;; definition for method 10 of type sparticle-launcher ;; WARN: Return type mismatch int vs none. -(defmethod setup-user-array sparticle-launcher ((this sparticle-launcher) (arg0 string)) +(defmethod setup-user-array ((this sparticle-launcher) (arg0 string)) (let ((s5-0 (get-field-spec-by-id this (sp-field-id spt-texture))) (v1-1 (lookup-texture-id-by-name arg0 (the-as string #f))) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc index eee6e225a9c..e5915f6411d 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 2 of type sparticle-cpuinfo ;; WARN: Return type mismatch object vs sparticle-cpuinfo. -(defmethod print sparticle-cpuinfo ((this sparticle-cpuinfo)) +(defmethod print ((this sparticle-cpuinfo)) (format #t "~%") (dotimes (s5-0 16) (format #t "~D:~F~%" s5-0 (the-as float (-> this data s5-0))) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc index 87019083e1e..40ee92b88e2 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc @@ -3,29 +3,26 @@ ;; definition of type sprite-glow-data (deftype sprite-glow-data (structure) - ((position vector :inline :offset-assert 0) - (size-x float :offset 12) - (size-probe float :offset-assert 16) - (z-offset float :offset-assert 20) - (rot-angle float :offset-assert 24) - (size-y float :offset-assert 28) - (color rgbaf :inline :offset-assert 32) - (fade-a float :offset-assert 48) - (fade-b float :offset-assert 52) - (tex-id texture-id :offset-assert 56) - (dummy uint32 :offset-assert 60) - (quads vector 4 :inline :offset 0) + ((position vector :inline) + (size-x float :overlay-at (-> position data 3)) + (size-probe float) + (z-offset float) + (rot-angle float) + (size-y float) + (color rgbaf :inline) + (fade-a float) + (fade-b float) + (tex-id texture-id) + (dummy uint32) + (quads vector 4 :inline :overlay-at position) ) - :method-count-assert 10 - :size-assert #x40 - :flag-assert #xa00000040 (:methods - (set-trans (_type_ vector) none 9) + (set-trans (_type_ vector) none) ) ) ;; definition for method 3 of type sprite-glow-data -(defmethod inspect sprite-glow-data ((this sprite-glow-data)) +(defmethod inspect ((this sprite-glow-data)) (when (not this) (set! this this) (goto cfg-4) @@ -49,7 +46,7 @@ ;; definition for method 9 of type sprite-glow-data ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-trans sprite-glow-data ((this sprite-glow-data) (arg0 vector)) +(defmethod set-trans ((this sprite-glow-data) (arg0 vector)) (let ((f0-0 (-> this position w))) (set! (-> this position quad) (-> arg0 quad)) (set! (-> this position w) f0-0) @@ -60,22 +57,19 @@ ;; definition of type simple-sprite-system (deftype simple-sprite-system (structure) - ((count int16 :offset-assert 0) - (max-count int16 :offset-assert 2) - (data (inline-array sprite-glow-data) :offset-assert 4) + ((count int16) + (max-count int16) + (data (inline-array sprite-glow-data)) ) - :method-count-assert 12 - :size-assert #x8 - :flag-assert #xc00000008 (:methods - (add! (_type_ sprite-glow-data) none 9) - (draw-all-sprites! (_type_ dma-buffer) none 10) - (clear! (_type_) none 11) + (add! (_type_ sprite-glow-data) none) + (draw-all-sprites! (_type_ dma-buffer) none) + (clear! (_type_) none) ) ) ;; definition for method 3 of type simple-sprite-system -(defmethod inspect simple-sprite-system ((this simple-sprite-system)) +(defmethod inspect ((this simple-sprite-system)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc index 12e223f19b9..f21d1f9cb8e 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc @@ -3,20 +3,17 @@ ;; definition of type sprite-distorter-sine-tables (deftype sprite-distorter-sine-tables (basic) - ((aspx float :offset-assert 4) - (aspy float :offset-assert 8) - (entry vector 128 :inline :offset-assert 16) - (ientry qword 9 :inline :offset-assert 2064) - (giftag gs-gif-tag :inline :offset-assert 2208) - (color qword :inline :offset-assert 2224) + ((aspx float) + (aspy float) + (entry vector 128 :inline) + (ientry qword 9 :inline) + (giftag gs-gif-tag :inline) + (color qword :inline) ) - :method-count-assert 9 - :size-assert #x8c0 - :flag-assert #x9000008c0 ) ;; definition for method 3 of type sprite-distorter-sine-tables -(defmethod inspect sprite-distorter-sine-tables ((this sprite-distorter-sine-tables)) +(defmethod inspect ((this sprite-distorter-sine-tables)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-glow_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-glow_REF.gc index 48293aed62b..cd93f191569 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-glow_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-glow_REF.gc @@ -3,50 +3,47 @@ ;; definition of type sprite-glow-template (deftype sprite-glow-template (structure) - ((clear-init-giftag gs-gif-tag :inline :offset-assert 0) - (clear-init-adcmds gs-adcmd 5 :inline :offset-assert 16) - (clear-draw-giftag gs-gif-tag :inline :offset-assert 96) - (clear-draw-clr-0 gs-packed-rgba :inline :offset-assert 112) - (clear-draw-xyz-0 gs-packed-xyzw 2 :inline :offset-assert 128) - (clear-draw-clr-1 gs-packed-rgba :inline :offset-assert 160) - (clear-draw-xyz-1 vector 2 :inline :offset-assert 176) - (offscr-setup-giftag gs-gif-tag :inline :offset-assert 208) - (offscr-setup-adcmds gs-adcmd 8 :inline :offset-assert 224) - (offscr-first-giftag gs-gif-tag :inline :offset-assert 352) - (offscr-first-clr gs-packed-rgba :inline :offset-assert 368) - (offscr-first-uv-0 gs-packed-uv :inline :offset-assert 384) - (offscr-first-xyzw-0 gs-packed-xyzw :inline :offset-assert 400) - (offscr-first-uv-1 gs-packed-uv :inline :offset-assert 416) - (offscr-first-xyzw-1 gs-packed-xyzw :inline :offset-assert 432) - (repeat-draw-giftag gs-gif-tag :inline :offset-assert 448) - (repeat-draw-adcmds gs-adcmd 29 :inline :offset-assert 464) - (flare-alpha-giftag gs-gif-tag :inline :offset-assert 928) - (flare-alpha-clr gs-packed-rgba :inline :offset-assert 944) - (flare-alpha-uv gs-packed-uv :inline :offset-assert 960) - (flare-alpha-xyzw-0 gs-packed-xyzw :inline :offset-assert 976) - (flare-alpha-xyzw-1 gs-packed-xyzw :inline :offset-assert 992) - (flare-alpha-xyzw-2 gs-packed-xyzw :inline :offset-assert 1008) - (flare-alpha-xyzw-3 gs-packed-xyzw :inline :offset-assert 1024) - (flare-init-giftag gs-gif-tag :inline :offset-assert 1040) - (flare-init-adcmds gs-adcmd 8 :inline :offset-assert 1056) - (flare-draw-giftag gs-gif-tag :inline :offset-assert 1184) - (flare-draw-clr gs-packed-rgba :inline :offset-assert 1200) - (flare-draw-stq-0 gs-packed-stq :inline :offset-assert 1216) - (flare-draw-xyzw-0 gs-packed-xyzw :inline :offset-assert 1232) - (flare-draw-stq-1 gs-packed-stq :inline :offset-assert 1248) - (flare-draw-xyzw-1 gs-packed-xyzw :inline :offset-assert 1264) - (flare-draw-stq-2 gs-packed-stq :inline :offset-assert 1280) - (flare-draw-xyzw-2 gs-packed-xyzw :inline :offset-assert 1296) - (flare-draw-stq-3 gs-packed-stq :inline :offset-assert 1312) - (flare-draw-xyzw-3 gs-packed-xyzw :inline :offset-assert 1328) + ((clear-init-giftag gs-gif-tag :inline) + (clear-init-adcmds gs-adcmd 5 :inline) + (clear-draw-giftag gs-gif-tag :inline) + (clear-draw-clr-0 gs-packed-rgba :inline) + (clear-draw-xyz-0 gs-packed-xyzw 2 :inline) + (clear-draw-clr-1 gs-packed-rgba :inline) + (clear-draw-xyz-1 vector 2 :inline) + (offscr-setup-giftag gs-gif-tag :inline) + (offscr-setup-adcmds gs-adcmd 8 :inline) + (offscr-first-giftag gs-gif-tag :inline) + (offscr-first-clr gs-packed-rgba :inline) + (offscr-first-uv-0 gs-packed-uv :inline) + (offscr-first-xyzw-0 gs-packed-xyzw :inline) + (offscr-first-uv-1 gs-packed-uv :inline) + (offscr-first-xyzw-1 gs-packed-xyzw :inline) + (repeat-draw-giftag gs-gif-tag :inline) + (repeat-draw-adcmds gs-adcmd 29 :inline) + (flare-alpha-giftag gs-gif-tag :inline) + (flare-alpha-clr gs-packed-rgba :inline) + (flare-alpha-uv gs-packed-uv :inline) + (flare-alpha-xyzw-0 gs-packed-xyzw :inline) + (flare-alpha-xyzw-1 gs-packed-xyzw :inline) + (flare-alpha-xyzw-2 gs-packed-xyzw :inline) + (flare-alpha-xyzw-3 gs-packed-xyzw :inline) + (flare-init-giftag gs-gif-tag :inline) + (flare-init-adcmds gs-adcmd 8 :inline) + (flare-draw-giftag gs-gif-tag :inline) + (flare-draw-clr gs-packed-rgba :inline) + (flare-draw-stq-0 gs-packed-stq :inline) + (flare-draw-xyzw-0 gs-packed-xyzw :inline) + (flare-draw-stq-1 gs-packed-stq :inline) + (flare-draw-xyzw-1 gs-packed-xyzw :inline) + (flare-draw-stq-2 gs-packed-stq :inline) + (flare-draw-xyzw-2 gs-packed-xyzw :inline) + (flare-draw-stq-3 gs-packed-stq :inline) + (flare-draw-xyzw-3 gs-packed-xyzw :inline) ) - :method-count-assert 9 - :size-assert #x540 - :flag-assert #x900000540 ) ;; definition for method 3 of type sprite-glow-template -(defmethod inspect sprite-glow-template ((this sprite-glow-template)) +(defmethod inspect ((this sprite-glow-template)) (when (not this) (set! this this) (goto cfg-4) @@ -94,33 +91,30 @@ ;; definition of type sprite-glow-consts (deftype sprite-glow-consts (structure) - ((camera matrix :inline :offset-assert 0) - (perspective matrix :inline :offset-assert 64) - (hvdf-offset vector :inline :offset-assert 128) - (hmge-scale vector :inline :offset-assert 144) - (consts vector :inline :offset-assert 160) - (pfog0 float :offset 160) - (deg-to-rad float :offset 164) - (min-scale float :offset 168) - (inv-area float :offset 172) - (sincos-01 vector :inline :offset-assert 176) - (sincos-23 vector :inline :offset-assert 192) - (sincos-45 vector :inline :offset-assert 208) - (sincos-67 vector :inline :offset-assert 224) - (sincos-89 vector :inline :offset-assert 240) - (basis-x vector :inline :offset-assert 256) - (basis-y vector :inline :offset-assert 272) - (xy-array vector 4 :inline :offset-assert 288) - (clamp-min vector :inline :offset-assert 352) - (clamp-max vector :inline :offset-assert 368) + ((camera matrix :inline) + (perspective matrix :inline) + (hvdf-offset vector :inline) + (hmge-scale vector :inline) + (consts vector :inline) + (pfog0 float :overlay-at (-> consts data 0)) + (deg-to-rad float :overlay-at (-> consts data 1)) + (min-scale float :overlay-at (-> consts data 2)) + (inv-area float :overlay-at (-> consts data 3)) + (sincos-01 vector :inline) + (sincos-23 vector :inline) + (sincos-45 vector :inline) + (sincos-67 vector :inline) + (sincos-89 vector :inline) + (basis-x vector :inline) + (basis-y vector :inline) + (xy-array vector 4 :inline) + (clamp-min vector :inline) + (clamp-max vector :inline) ) - :method-count-assert 9 - :size-assert #x180 - :flag-assert #x900000180 ) ;; definition for method 3 of type sprite-glow-consts -(defmethod inspect sprite-glow-consts ((this sprite-glow-consts)) +(defmethod inspect ((this sprite-glow-consts)) (when (not this) (set! this this) (goto cfg-4) @@ -441,19 +435,16 @@ ;; definition of type sprite-glow-dma-packet-data (deftype sprite-glow-dma-packet-data (structure) - ((control-packet dma-packet :inline :offset-assert 0) - (vecdata-packet dma-packet :inline :offset-assert 16) - (shader-cnt-packet dma-packet :inline :offset-assert 32) - (shader-ref-packet dma-packet :inline :offset-assert 48) - (mscal-packet dma-packet :inline :offset-assert 64) + ((control-packet dma-packet :inline) + (vecdata-packet dma-packet :inline) + (shader-cnt-packet dma-packet :inline) + (shader-ref-packet dma-packet :inline) + (mscal-packet dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type sprite-glow-dma-packet-data -(defmethod inspect sprite-glow-dma-packet-data ((this sprite-glow-dma-packet-data)) +(defmethod inspect ((this sprite-glow-dma-packet-data)) (when (not this) (set! this this) (goto cfg-4) @@ -470,23 +461,20 @@ ;; definition of type sprite-glow-cnt-template (deftype sprite-glow-cnt-template (structure) - ((control-packet dma-packet :inline :offset-assert 0) - (num-sprites uint32 :offset-assert 16) - (dummys uint32 3 :offset-assert 20) - (num-sprites-quad uint128 :offset 16) - (vecdata-packet dma-packet :inline :offset-assert 32) - (vecdata sprite-glow-data :inline :offset-assert 48) - (shader-packet dma-packet :inline :offset-assert 112) - (shader adgif-shader :inline :offset-assert 128) - (mscal-packet dma-packet :inline :offset-assert 208) + ((control-packet dma-packet :inline) + (num-sprites uint32) + (dummys uint32 3) + (num-sprites-quad uint128 :overlay-at num-sprites) + (vecdata-packet dma-packet :inline) + (vecdata sprite-glow-data :inline) + (shader-packet dma-packet :inline) + (shader adgif-shader :inline) + (mscal-packet dma-packet :inline) ) - :method-count-assert 9 - :size-assert #xe0 - :flag-assert #x9000000e0 ) ;; definition for method 3 of type sprite-glow-cnt-template -(defmethod inspect sprite-glow-cnt-template ((this sprite-glow-cnt-template)) +(defmethod inspect ((this sprite-glow-cnt-template)) (when (not this) (set! this this) (goto cfg-4) @@ -506,23 +494,20 @@ ;; definition of type sprite-glow-ref-template (deftype sprite-glow-ref-template (structure) - ((control-packet dma-packet :inline :offset-assert 0) - (num-sprites uint32 :offset-assert 16) - (dummys uint32 3 :offset-assert 20) - (num-sprites-quad uint128 :offset 16) - (vecdata-packet dma-packet :inline :offset-assert 32) - (vecdata sprite-glow-data :inline :offset-assert 48) - (shader-packet dma-packet :inline :offset-assert 112) - (shader-packet-ptr pointer :offset 116) - (mscal-packet dma-packet :inline :offset-assert 128) + ((control-packet dma-packet :inline) + (num-sprites uint32) + (dummys uint32 3) + (num-sprites-quad uint128 :overlay-at num-sprites) + (vecdata-packet dma-packet :inline) + (vecdata sprite-glow-data :inline) + (shader-packet dma-packet :inline) + (shader-packet-ptr pointer :offset 116) + (mscal-packet dma-packet :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) ;; definition for method 3 of type sprite-glow-ref-template -(defmethod inspect sprite-glow-ref-template ((this sprite-glow-ref-template)) +(defmethod inspect ((this sprite-glow-ref-template)) (when (not this) (set! this this) (goto cfg-4) @@ -699,7 +684,7 @@ ;; definition for method 9 of type simple-sprite-system ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod add! simple-sprite-system ((this simple-sprite-system) (arg0 sprite-glow-data)) +(defmethod add! ((this simple-sprite-system) (arg0 sprite-glow-data)) (let ((v1-0 (-> this count))) (when (< v1-0 (-> this max-count)) (let* ((a2-3 (-> this data v1-0)) @@ -742,7 +727,7 @@ ;; definition for method 10 of type simple-sprite-system ;; WARN: Return type mismatch int vs none. -(defmethod draw-all-sprites! simple-sprite-system ((this simple-sprite-system) (arg0 dma-buffer)) +(defmethod draw-all-sprites! ((this simple-sprite-system) (arg0 dma-buffer)) (local-vars (sv-528 sprite-glow-dma-packet-data) (sv-532 (pointer texture-id)) (sv-536 pointer)) (b! (zero? (-> this count)) cfg-13 :delay (nop!)) (set! sv-528 *sprite-glow-dma-packet-data*) @@ -775,7 +760,7 @@ ;; definition for method 11 of type simple-sprite-system ;; WARN: Return type mismatch int vs none. -(defmethod clear! simple-sprite-system ((this simple-sprite-system)) +(defmethod clear! ((this simple-sprite-system)) (set! (-> this count) 0) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-h_REF.gc index 84c5f8df2df..d0fb16d91fe 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-h_REF.gc @@ -3,34 +3,31 @@ ;; definition of type sprite-vec-data-2d (deftype sprite-vec-data-2d (structure) - ((x-y-z-sx vector :inline :offset-assert 0) - (flag-rot-sy vector :inline :offset-assert 16) - (r-g-b-a vector :inline :offset-assert 32) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (sx float :offset 12) - (sy float :offset 28) - (rot float :offset 24) - (flag int32 :offset 16) - (matrix int32 :offset 20) - (warp-turns int32 :offset 16) - (r float :offset 32) - (g float :offset 36) - (b float :offset 40) - (a float :offset 44) - (trans vector3s :inline :offset 0) - (color rgbaf :inline :offset 32) - (data uint128 1 :offset 0) - (data64 uint64 6 :offset 0) + ((x-y-z-sx vector :inline) + (flag-rot-sy vector :inline) + (r-g-b-a vector :inline) + (x float :overlay-at (-> x-y-z-sx data 0)) + (y float :overlay-at (-> x-y-z-sx data 1)) + (z float :overlay-at (-> x-y-z-sx data 2)) + (sx float :overlay-at (-> x-y-z-sx data 3)) + (sy float :overlay-at (-> flag-rot-sy data 3)) + (rot float :overlay-at (-> flag-rot-sy data 2)) + (flag int32 :overlay-at (-> flag-rot-sy data 0)) + (matrix int32 :overlay-at (-> flag-rot-sy data 1)) + (warp-turns int32 :overlay-at (-> flag-rot-sy data 0)) + (r float :overlay-at (-> r-g-b-a data 0)) + (g float :overlay-at (-> r-g-b-a data 1)) + (b float :overlay-at (-> r-g-b-a data 2)) + (a float :overlay-at (-> r-g-b-a data 3)) + (trans vector3s :inline :overlay-at (-> x-y-z-sx data 0)) + (color rgbaf :inline :overlay-at (-> r-g-b-a data 0)) + (data uint128 1 :overlay-at (-> x-y-z-sx data 0)) + (data64 uint64 6 :overlay-at (-> x-y-z-sx data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type sprite-vec-data-2d -(defmethod inspect sprite-vec-data-2d ((this sprite-vec-data-2d)) +(defmethod inspect ((this sprite-vec-data-2d)) (when (not this) (set! this this) (goto cfg-4) @@ -62,23 +59,20 @@ ;; definition of type sprite-array-2d (deftype sprite-array-2d (basic) - ((num-sprites int32 2 :offset-assert 4) - (num-valid int32 2 :offset-assert 12) - (vec-data pointer :offset-assert 20) - (adgif-data (inline-array adgif-shader) :offset-assert 24) - (pad uint128 4 :offset-assert 32) - (data uint128 1 :offset-assert 96) + ((num-sprites int32 2) + (num-valid int32 2) + (vec-data pointer) + (adgif-data (inline-array adgif-shader)) + (pad uint128 4) + (data uint128 1) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 (:methods - (new (symbol type int int) _type_ 0) + (new (symbol type int int) _type_) ) ) ;; definition for method 3 of type sprite-array-2d -(defmethod inspect sprite-array-2d ((this sprite-array-2d)) +(defmethod inspect ((this sprite-array-2d)) (when (not this) (set! this this) (goto cfg-4) @@ -96,33 +90,30 @@ ;; definition of type sprite-vec-data-3d (deftype sprite-vec-data-3d (structure) - ((x-y-z-sx vector :inline :offset-assert 0) - (qx-qy-qz-sy vector :inline :offset-assert 16) - (r-g-b-a vector :inline :offset-assert 32) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (sx float :offset 12) - (sy float :offset 28) - (qx float :offset 16) - (qy float :offset 20) - (qz float :offset 24) - (r float :offset 32) - (g float :offset 36) - (b float :offset 40) - (a float :offset 44) - (trans vector3s :inline :offset 0) - (rot vector3s :inline :offset 16) - (color rgbaf :inline :offset 32) - (data uint128 1 :offset 0) + ((x-y-z-sx vector :inline) + (qx-qy-qz-sy vector :inline) + (r-g-b-a vector :inline) + (x float :overlay-at (-> x-y-z-sx data 0)) + (y float :overlay-at (-> x-y-z-sx data 1)) + (z float :overlay-at (-> x-y-z-sx data 2)) + (sx float :overlay-at (-> x-y-z-sx data 3)) + (sy float :overlay-at (-> qx-qy-qz-sy data 3)) + (qx float :overlay-at (-> qx-qy-qz-sy data 0)) + (qy float :overlay-at (-> qx-qy-qz-sy data 1)) + (qz float :overlay-at (-> qx-qy-qz-sy data 2)) + (r float :overlay-at (-> r-g-b-a data 0)) + (g float :overlay-at (-> r-g-b-a data 1)) + (b float :overlay-at (-> r-g-b-a data 2)) + (a float :overlay-at (-> r-g-b-a data 3)) + (trans vector3s :inline :overlay-at (-> x-y-z-sx data 0)) + (rot vector3s :inline :overlay-at (-> qx-qy-qz-sy data 0)) + (color rgbaf :inline :overlay-at (-> r-g-b-a data 0)) + (data uint128 1 :overlay-at (-> x-y-z-sx data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type sprite-vec-data-3d -(defmethod inspect sprite-vec-data-3d ((this sprite-vec-data-3d)) +(defmethod inspect ((this sprite-vec-data-3d)) (when (not this) (set! this this) (goto cfg-4) @@ -153,22 +144,19 @@ ;; definition of type sprite-array-3d (deftype sprite-array-3d (basic) - ((num-sprites int32 2 :offset-assert 4) - (num-valid int32 2 :offset-assert 12) - (vec-data pointer :offset-assert 20) - (adgif-data (inline-array adgif-shader) :offset-assert 24) - (data uint128 1 :offset-assert 32) + ((num-sprites int32 2) + (num-valid int32 2) + (vec-data pointer) + (adgif-data (inline-array adgif-shader)) + (data uint128 1) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 (:methods - (new (symbol type int int) _type_ 0) + (new (symbol type int int) _type_) ) ) ;; definition for method 3 of type sprite-array-3d -(defmethod inspect sprite-array-3d ((this sprite-array-3d)) +(defmethod inspect ((this sprite-array-3d)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc index 7b79ce54496..e117ff6f6c1 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc @@ -3,16 +3,13 @@ ;; definition of type sprite-header (deftype sprite-header (structure) - ((header qword 1 :inline :offset-assert 0) - (num-sprites int32 :offset 0) + ((header qword 1 :inline) + (num-sprites int32 :overlay-at (-> header 0 data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type sprite-header -(defmethod inspect sprite-header ((this sprite-header)) +(defmethod inspect ((this sprite-header)) (when (not this) (set! this this) (goto cfg-4) @@ -33,15 +30,12 @@ ;; definition of type sprite-hvdf-data (deftype sprite-hvdf-data (structure) - ((data qword 76 :inline :offset-assert 0) + ((data qword 76 :inline) ) - :method-count-assert 9 - :size-assert #x4c0 - :flag-assert #x9000004c0 ) ;; definition for method 3 of type sprite-hvdf-data -(defmethod inspect sprite-hvdf-data ((this sprite-hvdf-data)) +(defmethod inspect ((this sprite-hvdf-data)) (when (not this) (set! this this) (goto cfg-4) @@ -54,15 +48,12 @@ ;; definition of type sprite-hvdf-control (deftype sprite-hvdf-control (structure) - ((alloc int8 76 :offset-assert 0) + ((alloc int8 76) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) ;; definition for method 3 of type sprite-hvdf-control -(defmethod inspect sprite-hvdf-control ((this sprite-hvdf-control)) +(defmethod inspect ((this sprite-hvdf-control)) (when (not this) (set! this this) (goto cfg-4) @@ -75,20 +66,17 @@ ;; definition of type sprite-aux-elem (deftype sprite-aux-elem (structure) - ((aux-type sprite-aux-type :offset-assert 0) - (data vector 3 :offset-assert 4) - (vec-data sprite-vec-data-2d :offset 4) - (gif-data adgif-shader :offset 8) - (aux-data sparticle-cpuinfo :offset 12) + ((aux-type sprite-aux-type) + (data vector 3) + (vec-data sprite-vec-data-2d :overlay-at (-> data 0)) + (gif-data adgif-shader :overlay-at (-> data 1)) + (aux-data sparticle-cpuinfo :overlay-at (-> data 2)) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type sprite-aux-elem -(defmethod inspect sprite-aux-elem ((this sprite-aux-elem)) +(defmethod inspect ((this sprite-aux-elem)) (when (not this) (set! this this) (goto cfg-4) @@ -105,21 +93,18 @@ ;; definition of type sprite-aux-list (deftype sprite-aux-list (basic) - ((num-entries int32 :offset-assert 4) - (entry int32 :offset-assert 8) - (data sprite-aux-elem :inline :dynamic :offset-assert 12) + ((num-entries int32) + (entry int32) + (data sprite-aux-elem :inline :dynamic) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) ;; definition for method 3 of type sprite-aux-list ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect sprite-aux-list ((this sprite-aux-list)) +(defmethod inspect ((this sprite-aux-list)) (when (not this) (set! this this) (goto cfg-4) @@ -144,7 +129,7 @@ ;; definition for method 3 of type sprite-aux-list ;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch symbol vs sprite-aux-list. -(defmethod inspect sprite-aux-list ((this sprite-aux-list)) +(defmethod inspect ((this sprite-aux-list)) (format #t "[~X] sprite-aux-list:~%" this) (format #t "~Tnum-entries: ~D~%" (-> this num-entries)) (format #t "~Tentry: ~D~%" (-> this entry)) @@ -200,46 +185,43 @@ ;; definition of type sprite-frame-data (deftype sprite-frame-data (structure) - ((cdata vector 16 :inline :offset 0) - (xy-array vector 8 :inline :offset 0) - (st-array vector 4 :inline :offset 128) - (xyz-array vector 4 :inline :offset 192) - (hmge-scale vector :inline :offset 256) - (consts vector :inline :offset 272) - (pfog0 float :offset 272) - (deg-to-rad float :offset 276) - (min-scale float :offset 280) - (inv-area float :offset 284) - (adgif-giftag gs-gif-tag :inline :offset-assert 288) - (sprite-2d-giftag gs-gif-tag :inline :offset-assert 304) - (sprite-2d-giftag-2 gs-gif-tag :inline :offset-assert 320) - (sincos-01 vector :inline :offset-assert 336) - (sincos-23 vector :inline :offset-assert 352) - (sincos-45 vector :inline :offset-assert 368) - (sincos-67 vector :inline :offset-assert 384) - (sincos-89 vector :inline :offset-assert 400) - (basis-x vector :inline :offset-assert 416) - (basis-y vector :inline :offset-assert 432) - (sprite-3d-giftag gs-gif-tag :inline :offset-assert 448) - (sprite-3d-giftag-2 gs-gif-tag :inline :offset-assert 464) - (screen-shader adgif-shader :inline :offset-assert 480) - (inv-hmge-scale vector :inline :offset 576) - (stq-offset vector :inline :offset-assert 592) - (stq-scale vector :inline :offset-assert 608) - (rgba-plain qword :inline :offset-assert 624) - (warp-giftag gs-gif-tag :inline :offset-assert 640) - (fog-clamp vector :inline :offset-assert 656) - (fog-min float :offset 656) - (fog-max float :offset 660) - (max-scale float :offset 664) + ((cdata vector 16 :inline :offset 0) + (xy-array vector 8 :inline :overlay-at (-> cdata 0)) + (st-array vector 4 :inline :overlay-at (-> cdata 8)) + (xyz-array vector 4 :inline :overlay-at (-> cdata 12)) + (hmge-scale vector :inline :offset 256) + (consts vector :inline :offset 272) + (pfog0 float :overlay-at (-> consts x)) + (deg-to-rad float :overlay-at (-> consts y)) + (min-scale float :overlay-at (-> consts z)) + (inv-area float :overlay-at (-> consts w)) + (adgif-giftag gs-gif-tag :inline) + (sprite-2d-giftag gs-gif-tag :inline) + (sprite-2d-giftag-2 gs-gif-tag :inline) + (sincos-01 vector :inline) + (sincos-23 vector :inline) + (sincos-45 vector :inline) + (sincos-67 vector :inline) + (sincos-89 vector :inline) + (basis-x vector :inline) + (basis-y vector :inline) + (sprite-3d-giftag gs-gif-tag :inline) + (sprite-3d-giftag-2 gs-gif-tag :inline) + (screen-shader adgif-shader :inline) + (inv-hmge-scale vector :inline :offset 576) + (stq-offset vector :inline) + (stq-scale vector :inline) + (rgba-plain qword :inline) + (warp-giftag gs-gif-tag :inline) + (fog-clamp vector :inline) + (fog-min float :overlay-at (-> fog-clamp data 0)) + (fog-max float :overlay-at (-> fog-clamp data 1)) + (max-scale float :overlay-at (-> fog-clamp data 2)) ) - :method-count-assert 9 - :size-assert #x2a0 - :flag-assert #x9000002a0 ) ;; definition for method 3 of type sprite-frame-data -(defmethod inspect sprite-frame-data ((this sprite-frame-data)) +(defmethod inspect ((this sprite-frame-data)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc index c7dfa82e044..b0f9d661e92 100644 --- a/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc @@ -3,54 +3,51 @@ ;; definition of type texture-anim-layer (deftype texture-anim-layer (structure) - ((interpolated-color vector :inline :offset-assert 0) - (interpolated-scale-offset vector :inline :offset-assert 16) - (interpolated-st-scale-offset vector :inline :offset-assert 32) - (interpolated-qs vector :inline :offset-assert 48) - (interpolated-rot vector :inline :offset-assert 64) - (extra vector :inline :offset 240) - (func (function dma-buffer uint int int texture-anim-layer float int) :offset 256) - (func-id symbol :offset 256) - (init-func (function texture-anim-layer int) :offset 260) - (init-func-id symbol :offset 260) - (tex texture :offset 264) - (start-time float :offset 268) - (end-time float :offset 272) - (tex-name string :offset 276) - (test gs-test :offset 280) - (alpha gs-alpha :offset 288) - (clamp gs-clamp :offset 296) - (start-vectors vector 5 :inline :offset 80) - (start-color vector :inline :offset 80) - (start-scale vector2 :inline :offset 96) - (start-offset vector2 :inline :offset 104) - (start-st-scale vector2 :inline :offset 112) - (start-st-offset vector2 :inline :offset 120) - (start-qs vector :inline :offset 128) - (start-rot degrees :offset 144) - (start-st-rot degrees :offset 148) - (end-vectors vector 5 :inline :offset 160) - (end-color vector :inline :offset 160) - (end-scale vector2 :inline :offset 176) - (end-offset vector2 :inline :offset 184) - (end-scale-offset vector :inline :offset 176) - (end-st-scale vector2 :inline :offset 192) - (end-st-offset vector2 :inline :offset 200) - (end-qs vector :inline :offset 208) - (end-rot degrees :offset 224) - (end-st-rot degrees :offset 228) + ((interpolated-color vector :inline) + (interpolated-scale-offset vector :inline) + (interpolated-st-scale-offset vector :inline) + (interpolated-qs vector :inline) + (interpolated-rot vector :inline) + (extra vector :inline :offset 240) + (func (function dma-buffer uint int int texture-anim-layer float int) :offset 256) + (func-id symbol :overlay-at func) + (init-func (function texture-anim-layer int) :offset 260) + (init-func-id symbol :overlay-at init-func) + (tex texture :offset 264) + (start-time float :offset 268) + (end-time float :offset 272) + (tex-name string :offset 276) + (test gs-test :offset 280) + (alpha gs-alpha :offset 288) + (clamp gs-clamp :offset 296) + (start-vectors vector 5 :inline :offset 80) + (start-color vector :inline :overlay-at (-> start-vectors 0)) + (start-scale vector2 :inline :offset 96) + (start-offset vector2 :inline :offset 104) + (start-st-scale vector2 :inline :offset 112) + (start-st-offset vector2 :inline :offset 120) + (start-qs vector :inline :overlay-at (-> start-vectors 3)) + (start-rot degrees :offset 144) + (start-st-rot degrees :offset 148) + (end-vectors vector 5 :inline :offset 160) + (end-color vector :inline :overlay-at (-> end-vectors 0)) + (end-scale vector2 :inline :offset 176) + (end-offset vector2 :inline :offset 184) + (end-scale-offset vector :inline :overlay-at (-> end-vectors 1)) + (end-st-scale vector2 :inline :offset 192) + (end-st-offset vector2 :inline :offset 200) + (end-qs vector :inline :overlay-at (-> end-vectors 3)) + (end-rot degrees :offset 224) + (end-st-rot degrees :offset 228) ) - :method-count-assert 11 - :size-assert #x130 - :flag-assert #xb00000130 (:methods - (initialize-texture! (_type_) _type_ 9) - (clear-texture! (_type_) _type_ 10) + (initialize-texture! (_type_) _type_) + (clear-texture! (_type_) _type_) ) ) ;; definition for method 3 of type texture-anim-layer -(defmethod inspect texture-anim-layer ((this texture-anim-layer)) +(defmethod inspect ((this texture-anim-layer)) (when (not this) (set! this this) (goto cfg-4) @@ -90,34 +87,31 @@ ;; definition of type texture-anim (deftype texture-anim (structure) - ((num-layers uint32 :offset-assert 0) - (func (function dma-buffer texture-anim int) :offset-assert 4) - (func-id symbol :offset 4) - (init-func (function texture-anim int) :offset-assert 8) - (init-func-id symbol :offset 8) - (tex texture :offset-assert 12) - (tex-name string :offset-assert 16) - (extra vector :inline :offset-assert 32) - (color rgba :offset-assert 48) - (frame-time float :offset-assert 52) - (frame-delta float :offset-assert 56) - (frame-mod float :offset-assert 60) - (test gs-test :offset-assert 64) - (alpha gs-alpha :offset-assert 72) - (clamp gs-clamp :offset-assert 80) - (data texture-anim-layer :dynamic :offset-assert 88) + ((num-layers uint32) + (func (function dma-buffer texture-anim int)) + (func-id symbol :overlay-at func) + (init-func (function texture-anim int)) + (init-func-id symbol :overlay-at init-func) + (tex texture) + (tex-name string) + (extra vector :inline) + (color rgba) + (frame-time float) + (frame-delta float) + (frame-mod float) + (test gs-test) + (alpha gs-alpha) + (clamp gs-clamp) + (data texture-anim-layer :dynamic) ) - :method-count-assert 11 - :size-assert #x58 - :flag-assert #xb00000058 (:methods - (init-textures! (_type_) _type_ 9) - (clear-textures! (_type_) _type_ 10) + (init-textures! (_type_) _type_) + (clear-textures! (_type_) _type_) ) ) ;; definition for method 3 of type texture-anim -(defmethod inspect texture-anim ((this texture-anim)) +(defmethod inspect ((this texture-anim)) (when (not this) (set! this this) (goto cfg-4) @@ -145,19 +139,16 @@ ;; definition of type texture-anim-array (deftype texture-anim-array (array) - ((array-data texture-anim :dynamic :offset-assert 16) + ((array-data texture-anim :dynamic) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (init! (_type_) _type_ 9) - (clear! (_type_) _type_ 10) + (init! (_type_) _type_) + (clear! (_type_) _type_) ) ) ;; definition for method 3 of type texture-anim-array -(defmethod inspect texture-anim-array ((this texture-anim-array)) +(defmethod inspect ((this texture-anim-array)) (when (not this) (set! this this) (goto cfg-4) @@ -173,26 +164,23 @@ ;; definition of type texture-anim-work (deftype texture-anim-work (structure) - ((erase-tmpl dma-gif-packet :inline :offset-assert 0) - (draw-tmpl dma-gif-packet :inline :offset-assert 32) - (draw2-tmpl dma-gif-packet :inline :offset-assert 64) - (fill-tmpl dma-gif-packet :inline :offset-assert 96) - (adgif-tmpl dma-gif-packet :inline :offset-assert 128) - (corner0 vector :inline :offset-assert 160) - (corner1 vector :inline :offset-assert 176) - (corner2 vector :inline :offset-assert 192) - (corner3 vector :inline :offset-assert 208) - (const vector :inline :offset-assert 224) - (random vector4w 8 :inline :offset-assert 240) - (random-index uint8 :offset-assert 368) + ((erase-tmpl dma-gif-packet :inline) + (draw-tmpl dma-gif-packet :inline) + (draw2-tmpl dma-gif-packet :inline) + (fill-tmpl dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (corner0 vector :inline) + (corner1 vector :inline) + (corner2 vector :inline) + (corner3 vector :inline) + (const vector :inline) + (random vector4w 8 :inline) + (random-index uint8) ) - :method-count-assert 9 - :size-assert #x171 - :flag-assert #x900000171 ) ;; definition for method 3 of type texture-anim-work -(defmethod inspect texture-anim-work ((this texture-anim-work)) +(defmethod inspect ((this texture-anim-work)) (when (not this) (set! this this) (goto cfg-4) @@ -216,15 +204,12 @@ ;; definition of type clut16x16 (deftype clut16x16 (structure) - ((clut rgba 256 :offset-assert 0) + ((clut rgba 256) ) - :method-count-assert 9 - :size-assert #x400 - :flag-assert #x900000400 ) ;; definition for method 3 of type clut16x16 -(defmethod inspect clut16x16 ((this clut16x16)) +(defmethod inspect ((this clut16x16)) (when (not this) (set! this this) (goto cfg-4) @@ -237,15 +222,12 @@ ;; definition of type noise8x8 (deftype noise8x8 (structure) - ((image uint8 64 :offset-assert 0) + ((image uint8 64) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type noise8x8 -(defmethod inspect noise8x8 ((this noise8x8)) +(defmethod inspect ((this noise8x8)) (when (not this) (set! this this) (goto cfg-4) @@ -258,15 +240,12 @@ ;; definition of type noise16x16 (deftype noise16x16 (structure) - ((image uint8 256 :offset-assert 0) + ((image uint8 256) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; definition for method 3 of type noise16x16 -(defmethod inspect noise16x16 ((this noise16x16)) +(defmethod inspect ((this noise16x16)) (when (not this) (set! this this) (goto cfg-4) @@ -279,15 +258,12 @@ ;; definition of type noise32x32 (deftype noise32x32 (structure) - ((image uint8 1024 :offset-assert 0) + ((image uint8 1024) ) - :method-count-assert 9 - :size-assert #x400 - :flag-assert #x900000400 ) ;; definition for method 3 of type noise32x32 -(defmethod inspect noise32x32 ((this noise32x32)) +(defmethod inspect ((this noise32x32)) (when (not this) (set! this this) (goto cfg-4) @@ -300,15 +276,12 @@ ;; definition of type noise64x64 (deftype noise64x64 (structure) - ((image uint8 4096 :offset-assert 0) + ((image uint8 4096) ) - :method-count-assert 9 - :size-assert #x1000 - :flag-assert #x900001000 ) ;; definition for method 3 of type noise64x64 -(defmethod inspect noise64x64 ((this noise64x64)) +(defmethod inspect ((this noise64x64)) (when (not this) (set! this this) (goto cfg-4) @@ -321,15 +294,12 @@ ;; definition of type noise128x128 (deftype noise128x128 (structure) - ((image uint8 16384 :offset-assert 0) + ((image uint8 16384) ) - :method-count-assert 9 - :size-assert #x4000 - :flag-assert #x900004000 ) ;; definition for method 3 of type noise128x128 -(defmethod inspect noise128x128 ((this noise128x128)) +(defmethod inspect ((this noise128x128)) (when (not this) (set! this this) (goto cfg-4) @@ -342,15 +312,12 @@ ;; definition of type fog8x256 (deftype fog8x256 (structure) - ((image uint8 256 :offset-assert 0) + ((image uint8 256) ) - :method-count-assert 9 - :size-assert #x100 - :flag-assert #x900000100 ) ;; definition for method 3 of type fog8x256 -(defmethod inspect fog8x256 ((this fog8x256)) +(defmethod inspect ((this fog8x256)) (when (not this) (set! this this) (goto cfg-4) @@ -363,25 +330,22 @@ ;; definition of type fog-texture-work (deftype fog-texture-work (structure) - ((corner vector 4 :inline :offset-assert 0) - (const vector :inline :offset-assert 64) - (min-corner vector :inline :offset-assert 80) - (max-corner vector :inline :offset-assert 96) - (fog-near float :offset-assert 112) - (fog-far float :offset-assert 116) - (fog-delta float :offset-assert 120) - (alpha-near float :offset-assert 124) - (alpha-far float :offset-assert 128) - (alpha-delta float :offset-assert 132) - (color uint32 :offset-assert 136) + ((corner vector 4 :inline) + (const vector :inline) + (min-corner vector :inline) + (max-corner vector :inline) + (fog-near float) + (fog-far float) + (fog-delta float) + (alpha-near float) + (alpha-far float) + (alpha-delta float) + (color uint32) ) - :method-count-assert 9 - :size-assert #x8c - :flag-assert #x90000008c ) ;; definition for method 3 of type fog-texture-work -(defmethod inspect fog-texture-work ((this fog-texture-work)) +(defmethod inspect ((this fog-texture-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim_REF.gc b/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim_REF.gc index ec0a201f258..b60b577a4b0 100644 --- a/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim_REF.gc @@ -1229,7 +1229,7 @@ ) ;; definition for method 9 of type texture-anim-array -(defmethod init! texture-anim-array ((this texture-anim-array)) +(defmethod init! ((this texture-anim-array)) (dotimes (s5-0 (-> this length)) (init-textures! (-> this array-data s5-0)) ) @@ -1237,7 +1237,7 @@ ) ;; definition for method 10 of type texture-anim-array -(defmethod clear! texture-anim-array ((this texture-anim-array)) +(defmethod clear! ((this texture-anim-array)) (dotimes (s5-0 (-> this length)) (clear-textures! (-> this array-data s5-0)) ) @@ -1246,7 +1246,7 @@ ;; definition for method 9 of type texture-anim ;; INFO: Used lq/sq -(defmethod init-textures! texture-anim ((this texture-anim)) +(defmethod init-textures! ((this texture-anim)) (local-vars (a3-3 uint128) (sv-16 texture-page)) (if (logtest? (the-as int (-> this func)) 1) (set! (-> this func) @@ -1326,7 +1326,7 @@ ) ;; definition for method 10 of type texture-anim -(defmethod clear-textures! texture-anim ((this texture-anim)) +(defmethod clear-textures! ((this texture-anim)) (set! (-> this tex) #f) (dotimes (s5-0 (the-as int (-> this num-layers))) (clear-texture! (-> this data s5-0)) @@ -1335,7 +1335,7 @@ ) ;; definition for method 9 of type texture-anim-layer -(defmethod initialize-texture! texture-anim-layer ((this texture-anim-layer)) +(defmethod initialize-texture! ((this texture-anim-layer)) (if (logtest? (the-as int (-> this func)) 1) (set! (-> this func) (the-as (function dma-buffer uint int int texture-anim-layer float int) @@ -1363,7 +1363,7 @@ ) ;; definition for method 10 of type texture-anim-layer -(defmethod clear-texture! texture-anim-layer ((this texture-anim-layer)) +(defmethod clear-texture! ((this texture-anim-layer)) (set! (-> this tex) #f) this ) diff --git a/test/decompiler/reference/jak2/engine/gfx/texture/texture-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/texture/texture-h_REF.gc index 322b278177d..21cda91f0e7 100644 --- a/test/decompiler/reference/jak2/engine/gfx/texture/texture-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/texture/texture-h_REF.gc @@ -6,13 +6,10 @@ ((index uint16 :offset 8 :size 12) (page uint16 :offset 20 :size 12) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type texture-id -(defmethod inspect texture-id ((this texture-id)) +(defmethod inspect ((this texture-id)) (when (not this) (set! this this) (goto cfg-4) @@ -26,18 +23,15 @@ ;; definition of type texture-pool-segment (deftype texture-pool-segment (structure) - ((dest uint32 :offset-assert 0) - (size uint32 :offset-assert 4) + ((dest uint32) + (size uint32) ) :pack-me :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type texture-pool-segment -(defmethod inspect texture-pool-segment ((this texture-pool-segment)) +(defmethod inspect ((this texture-pool-segment)) (when (not this) (set! this this) (goto cfg-4) @@ -51,48 +45,45 @@ ;; definition of type texture-pool (deftype texture-pool (basic) - ((top int32 :offset-assert 4) - (cur int32 :offset-assert 8) - (allocate-func (function texture-pool texture-page kheap int texture-page) :offset-assert 12) - (font-palette int32 :offset-assert 16) - (segment texture-pool-segment 4 :inline :offset-assert 20) - (segment-near texture-pool-segment :inline :offset 20) - (segment-common texture-pool-segment :inline :offset 28) - (common-page texture-page 32 :offset-assert 52) - (common-page-mask int32 :offset-assert 180) - (update-sprites-flag symbol :offset-assert 184) - (update-flag symbol :offset-assert 188) - (texture-enable-user texture-enable-mask :offset-assert 192) - (texture-enable-user-menu texture-enable-mask :offset-assert 200) - (ids uint32 128 :offset-assert 208) + ((top int32) + (cur int32) + (allocate-func (function texture-pool texture-page kheap int texture-page)) + (font-palette int32) + (segment texture-pool-segment 4 :inline) + (segment-near texture-pool-segment :inline :overlay-at (-> segment 0)) + (segment-common texture-pool-segment :inline :overlay-at (-> segment 1)) + (common-page texture-page 32) + (common-page-mask int32) + (update-sprites-flag symbol) + (update-flag symbol) + (texture-enable-user texture-enable-mask) + (texture-enable-user-menu texture-enable-mask) + (ids uint32 128) ) - :method-count-assert 26 - :size-assert #x2d0 - :flag-assert #x1a000002d0 (:methods - (new (symbol type) _type_ 0) - (initialize! (_type_) _type_ 9) - (print-usage (_type_) _type_ 10) - (setup-font-texture (_type_) none 11) - (allocate-defaults (_type_) none 12) - (login-level-textures (_type_ level int (pointer texture-id)) none 13) - (add-level-tpage-dma (_type_ level tpage-category bucket-id) none 14) - (allocate-vram-words! (_type_ int) int 15) - (allocate-segment (_type_ texture-pool-segment int) texture-pool-segment 16) - (unload-page (_type_ texture-page) none 17) - (get-common-page-slot-by-id (_type_ int) int 18) - (update-warp-and-hud (_type_) none 19) - (update-sprites (_type_) none 20) - (mark-hud-warp-sprite-dirty (_type_) none 21) - (lay-out-sprite-tex (_type_) none 22) - (lay-out-hud-tex (_type_) none 23) - (lay-out-warp-tex (_type_) none 24) - (clear-ids (_type_) none 25) + (new (symbol type) _type_) + (initialize! (_type_) _type_) + (print-usage (_type_) _type_) + (setup-font-texture (_type_) none) + (allocate-defaults (_type_) none) + (login-level-textures (_type_ level int (pointer texture-id)) none) + (add-level-tpage-dma (_type_ level tpage-category bucket-id) none) + (allocate-vram-words! (_type_ int) int) + (allocate-segment (_type_ texture-pool-segment int) texture-pool-segment) + (unload-page (_type_ texture-page) none) + (get-common-page-slot-by-id (_type_ int) int) + (update-warp-and-hud (_type_) none) + (update-sprites (_type_) none) + (mark-hud-warp-sprite-dirty (_type_) none) + (lay-out-sprite-tex (_type_) none) + (lay-out-hud-tex (_type_) none) + (lay-out-warp-tex (_type_) none) + (clear-ids (_type_) none) ) ) ;; definition for method 3 of type texture-pool -(defmethod inspect texture-pool ((this texture-pool)) +(defmethod inspect ((this texture-pool)) (when (not this) (set! this this) (goto cfg-4) @@ -118,19 +109,16 @@ ;; definition of type texture-mask (deftype texture-mask (structure) - ((mask vector4w :inline :offset-assert 0) - (dist float :offset 12) - (long uint64 2 :offset 0) - (quad uint128 :offset 0) + ((mask vector4w :inline) + (dist float :overlay-at (-> mask data 3)) + (long uint64 2 :overlay-at (-> mask data 0)) + (quad uint128 :overlay-at (-> mask data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type texture-mask ;; INFO: Used lq/sq -(defmethod inspect texture-mask ((this texture-mask)) +(defmethod inspect ((this texture-mask)) (when (not this) (set! this this) (goto cfg-4) @@ -146,15 +134,12 @@ ;; definition of type texture-masks (deftype texture-masks (structure) - ((data texture-mask 3 :inline :offset-assert 0) + ((data texture-mask 3 :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type texture-masks -(defmethod inspect texture-masks ((this texture-masks)) +(defmethod inspect ((this texture-masks)) (when (not this) (set! this this) (goto cfg-4) @@ -167,15 +152,12 @@ ;; definition of type texture-masks-array (deftype texture-masks-array (inline-array-class) - ((data texture-masks :inline :dynamic :offset-assert 16) + ((data texture-masks :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type texture-masks-array -(defmethod inspect texture-masks-array ((this texture-masks-array)) +(defmethod inspect ((this texture-masks-array)) (when (not this) (set! this this) (goto cfg-4) @@ -199,29 +181,26 @@ ;; definition of type texture (deftype texture (basic) - ((w int16 :offset-assert 4) - (h int16 :offset-assert 6) - (num-mips uint8 :offset-assert 8) - (tex1-control uint8 :offset-assert 9) - (psm gs-psm :offset-assert 10) - (mip-shift uint8 :offset-assert 11) - (clutpsm uint16 :offset-assert 12) - (dest uint16 7 :offset-assert 14) - (clutdest uint16 :offset-assert 28) - (width uint8 7 :offset-assert 30) - (name string :offset-assert 40) - (size uint32 :offset-assert 44) - (uv-dist float :offset-assert 48) - (pad uint32 3 :offset-assert 52) - (masks texture-masks :inline :offset-assert 64) + ((w int16) + (h int16) + (num-mips uint8) + (tex1-control uint8) + (psm gs-psm) + (mip-shift uint8) + (clutpsm uint16) + (dest uint16 7) + (clutdest uint16) + (width uint8 7) + (name string) + (size uint32) + (uv-dist float) + (pad uint32 3) + (masks texture-masks :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type texture -(defmethod inspect texture ((this texture)) +(defmethod inspect ((this texture)) (when (not this) (set! this this) (goto cfg-4) @@ -248,19 +227,16 @@ ;; definition of type texture-page-segment (deftype texture-page-segment (structure) - ((block-data pointer :offset-assert 0) - (size uint32 :offset-assert 4) - (dest uint32 :offset-assert 8) + ((block-data pointer) + (size uint32) + (dest uint32) ) :pack-me :allow-misaligned - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type texture-page-segment -(defmethod inspect texture-page-segment ((this texture-page-segment)) +(defmethod inspect ((this texture-page-segment)) (when (not this) (set! this this) (goto cfg-4) @@ -283,32 +259,29 @@ ;; definition of type texture-page (deftype texture-page (basic) - ((info file-info :offset-assert 4) - (name string :offset-assert 8) - (id uint32 :offset-assert 12) - (length int32 :offset-assert 16) - (mip0-size uint32 :offset-assert 20) - (size uint32 :offset-assert 24) - (segment texture-page-segment 3 :inline :offset-assert 28) - (dram-size uint32 :offset-assert 64) - (pad uint32 15 :offset-assert 68) - (data texture :dynamic :offset-assert 128) + ((info file-info) + (name string) + (id uint32) + (length int32) + (mip0-size uint32) + (size uint32) + (segment texture-page-segment 3 :inline) + (dram-size uint32) + (pad uint32 15) + (data texture :dynamic) ) - :method-count-assert 14 - :size-assert #x80 - :flag-assert #xe00000080 (:methods - (relocate (_type_ kheap (pointer uint8)) texture-page :replace 7) - (remove-data-from-heap (_type_ kheap) _type_ 9) - (get-leftover-block-count (_type_ int int) int 10) - (relocate-dests! (_type_ int int) none 11) - (add-to-dma-buffer (_type_ dma-buffer tex-upload-mode) int 12) - (upload-now! (_type_ tex-upload-mode) none 13) + (relocate (_type_ kheap (pointer uint8)) texture-page :replace) + (remove-data-from-heap (_type_ kheap) _type_) + (get-leftover-block-count (_type_ int int) int) + (relocate-dests! (_type_ int int) none) + (add-to-dma-buffer (_type_ dma-buffer tex-upload-mode) int) + (upload-now! (_type_ tex-upload-mode) none) ) ) ;; definition for method 3 of type texture-page -(defmethod inspect texture-page ((this texture-page)) +(defmethod inspect ((this texture-page)) (when (not this) (set! this this) (goto cfg-4) @@ -333,22 +306,16 @@ ((first-8 uint8 :offset 0 :size 8) (shader uint32 :offset 8 :size 24) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type texture-link (deftype texture-link (structure) - ((next shader-ptr 1 :offset-assert 0) + ((next shader-ptr 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type texture-link -(defmethod inspect texture-link ((this texture-link)) +(defmethod inspect ((this texture-link)) (when (not this) (set! this this) (goto cfg-4) @@ -361,20 +328,17 @@ ;; definition of type texture-page-dir-entry (deftype texture-page-dir-entry (structure) - ((length int16 :offset-assert 0) - (status uint16 :offset-assert 2) - (page texture-page :offset-assert 4) - (link texture-link :offset-assert 8) + ((length int16) + (status uint16) + (page texture-page) + (link texture-link) ) :pack-me :allow-misaligned - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type texture-page-dir-entry -(defmethod inspect texture-page-dir-entry ((this texture-page-dir-entry)) +(defmethod inspect ((this texture-page-dir-entry)) (when (not this) (set! this this) (goto cfg-4) @@ -390,34 +354,28 @@ ;; definition of type texture-page-dir (deftype texture-page-dir (basic) - ((length int32 :offset-assert 4) - (entries texture-page-dir-entry 1 :inline :offset-assert 8) + ((length int32) + (entries texture-page-dir-entry 1 :inline) ) - :method-count-assert 10 - :size-assert #x14 - :flag-assert #xa00000014 (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) - (unlink-shaders-in-heap (_type_ kheap) int 9) + (relocate (_type_ kheap (pointer uint8)) none :replace) + (unlink-shaders-in-heap (_type_ kheap) int) ) ) ;; definition of type texture-relocate-later (deftype texture-relocate-later (basic) - ((memcpy symbol :offset-assert 4) - (dest uint32 :offset-assert 8) - (source uint32 :offset-assert 12) - (move uint32 :offset-assert 16) - (entry texture-page-dir-entry :offset-assert 20) - (page texture-page :offset-assert 24) + ((memcpy symbol) + (dest uint32) + (source uint32) + (move uint32) + (entry texture-page-dir-entry) + (page texture-page) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type texture-relocate-later -(defmethod inspect texture-relocate-later ((this texture-relocate-later)) +(defmethod inspect ((this texture-relocate-later)) (when (not this) (set! this this) (goto cfg-4) @@ -444,32 +402,29 @@ ;; definition of type adgif-shader (deftype adgif-shader (structure) - ((quad qword 5 :inline :offset-assert 0) - (prims gs-reg64 10 :offset 0) - (reg-0 uint8 :offset 8) - (reg-1 uint8 :offset 24) - (reg-2 uint8 :offset 40) - (reg-3 uint8 :offset 56) - (reg-4-u32 gs-reg32 :offset 72) - (reg-4 uint8 :offset 72) - (tex0 gs-tex0 :offset 0) - (tex1 gs-tex1 :offset 16) - (miptbp1 gs-miptbp :offset 32) - (clamp gs-clamp :offset 48) - (clamp-reg gs-reg64 :offset 56) - (alpha gs-alpha :offset 64) - (alpha-as-miptb2 gs-miptbp :offset 64) - (link-test link-test-flags :offset 8) - (texture-id texture-id :offset 24) - (next shader-ptr :offset 40) + ((quad qword 5 :inline) + (prims gs-reg64 10 :overlay-at quad) + (reg-0 uint8 :overlay-at (-> quad 0 data 2)) + (reg-1 uint8 :overlay-at (-> prims 3)) + (reg-2 uint8 :overlay-at (-> prims 5)) + (reg-3 uint8 :overlay-at (-> prims 7)) + (reg-4-u32 gs-reg32 :overlay-at (-> prims 9)) + (reg-4 uint8 :overlay-at reg-4-u32) + (tex0 gs-tex0 :overlay-at (-> quad 0 data 0)) + (tex1 gs-tex1 :overlay-at (-> prims 2)) + (miptbp1 gs-miptbp :overlay-at (-> prims 4)) + (clamp gs-clamp :overlay-at (-> prims 6)) + (clamp-reg gs-reg64 :overlay-at reg-3) + (alpha gs-alpha :overlay-at (-> prims 8)) + (alpha-as-miptb2 gs-miptbp :overlay-at alpha) + (link-test link-test-flags :overlay-at (-> quad 0 data 2)) + (texture-id texture-id :overlay-at reg-1) + (next shader-ptr :overlay-at reg-2) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type adgif-shader -(defmethod inspect adgif-shader ((this adgif-shader)) +(defmethod inspect ((this adgif-shader)) (when (not this) (set! this this) (goto cfg-4) @@ -497,15 +452,12 @@ ;; definition of type adgif-shader-array (deftype adgif-shader-array (inline-array-class) - ((data adgif-shader :inline :dynamic :offset-assert 16) + ((data adgif-shader :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type adgif-shader-array -(defmethod inspect adgif-shader-array ((this adgif-shader-array)) +(defmethod inspect ((this adgif-shader-array)) (when (not this) (set! this this) (goto cfg-4) @@ -523,17 +475,14 @@ ;; definition of type texture-base (deftype texture-base (structure) - ((vram-page uint32 :offset-assert 0) - (vram-block uint32 :offset-assert 4) - (vram-word uint32 :offset-assert 8) + ((vram-page uint32) + (vram-block uint32) + (vram-word uint32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type texture-base -(defmethod inspect texture-base ((this texture-base)) +(defmethod inspect ((this texture-base)) (when (not this) (set! this this) (goto cfg-4) @@ -844,18 +793,15 @@ ;; definition of type texture-page-translate-item (deftype texture-page-translate-item (structure) - ((bucket bucket-id :offset-assert 0) - (level-index uint32 :offset-assert 4) - (level-texture-page tpage-category-u32 :offset-assert 8) - (texture-user texture-enable-mask-u32 :offset-assert 12) + ((bucket bucket-id) + (level-index uint32) + (level-texture-page tpage-category-u32) + (texture-user texture-enable-mask-u32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type texture-page-translate-item -(defmethod inspect texture-page-translate-item ((this texture-page-translate-item)) +(defmethod inspect ((this texture-page-translate-item)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/gfx/texture/texture_REF.gc b/test/decompiler/reference/jak2/engine/gfx/texture/texture_REF.gc index e29432f546b..7f6b81cac97 100644 --- a/test/decompiler/reference/jak2/engine/gfx/texture/texture_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/texture/texture_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 2 of type texture-page -(defmethod print texture-page ((this texture-page)) +(defmethod print ((this texture-page)) (format #t "#" @@ -16,18 +16,18 @@ ) ;; definition for method 4 of type texture-page -(defmethod length texture-page ((this texture-page)) +(defmethod length ((this texture-page)) (-> this length) ) ;; definition for method 5 of type texture-page ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of texture-page ((this texture-page)) +(defmethod asize-of ((this texture-page)) (the-as int (+ (-> this type size) (* (-> this length) 4))) ) ;; definition for method 8 of type texture-page -(defmethod mem-usage texture-page ((this texture-page) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this texture-page) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 83 (-> arg0 length))) (set! (-> arg0 data 82 name) "texture") (+! (-> arg0 data 82 count) (-> this length)) @@ -126,7 +126,7 @@ ) ;; definition for method 2 of type texture -(defmethod print texture ((this texture)) +(defmethod print ((this texture)) (format #t "# this cur))) (+! (-> this cur) arg0) v0-0 @@ -310,7 +310,7 @@ ) ;; definition for method 18 of type texture-pool -(defmethod get-common-page-slot-by-id texture-pool ((this texture-pool) (tpage-id int)) +(defmethod get-common-page-slot-by-id ((this texture-pool) (tpage-id int)) (case tpage-id ((33) 1 @@ -325,7 +325,7 @@ ) ;; definition for method 9 of type texture-pool -(defmethod initialize! texture-pool ((this texture-pool)) +(defmethod initialize! ((this texture-pool)) (set! (-> this cur) 0) (set! (-> this top) (-> this cur)) (set! (-> this allocate-func) texture-page-default-allocate) @@ -348,7 +348,7 @@ ) ;; definition for method 10 of type texture-page -(defmethod get-leftover-block-count texture-page ((this texture-page) (num-segments int) (upload-offset int)) +(defmethod get-leftover-block-count ((this texture-page) (num-segments int) (upload-offset int)) (let ((offset upload-offset)) (dotimes (i num-segments) (+! offset (-> this segment i size)) @@ -358,7 +358,7 @@ ) ;; definition for method 10 of type texture-pool -(defmethod print-usage texture-pool ((this texture-pool)) +(defmethod print-usage ((this texture-pool)) (format #t "--------------------~%") (format #t @@ -373,7 +373,7 @@ ) ;; definition for method 16 of type texture-pool -(defmethod allocate-segment texture-pool ((this texture-pool) (seg texture-pool-segment) (num-words int)) +(defmethod allocate-segment ((this texture-pool) (seg texture-pool-segment) (num-words int)) (set! (-> seg size) (the-as uint num-words)) (set! (-> seg dest) (the-as uint (allocate-vram-words! this num-words))) seg @@ -381,7 +381,7 @@ ;; definition for method 12 of type texture-pool ;; WARN: Return type mismatch int vs none. -(defmethod allocate-defaults texture-pool ((this texture-pool)) +(defmethod allocate-defaults ((this texture-pool)) (format #t "texture start #x~x~%" (/ (-> this cur) 64)) (allocate-segment this (-> this segment-common) #x3e000) (format #t "texture end #x~x~%" (/ (-> this cur) 64)) @@ -409,7 +409,7 @@ ) ;; definition for method 9 of type texture-page -(defmethod remove-data-from-heap texture-page ((this texture-page) (heap kheap)) +(defmethod remove-data-from-heap ((this texture-page) (heap kheap)) (set! (-> heap current) (-> this segment 0 block-data)) this ) @@ -472,7 +472,7 @@ ;; definition for method 22 of type texture-pool ;; WARN: Return type mismatch int vs none. -(defmethod lay-out-sprite-tex texture-pool ((this texture-pool)) +(defmethod lay-out-sprite-tex ((this texture-pool)) (let ((vram-loc 0)) (countdown (level-idx 7) (let ((lev (-> *level* level level-idx))) @@ -503,7 +503,7 @@ ;; definition for method 23 of type texture-pool ;; WARN: Return type mismatch int vs none. -(defmethod lay-out-hud-tex texture-pool ((this texture-pool)) +(defmethod lay-out-hud-tex ((this texture-pool)) (let ((level-idx 0)) (countdown (vram-loc 7) (let ((lev (-> *level* level vram-loc))) @@ -534,7 +534,7 @@ ;; definition for method 24 of type texture-pool ;; WARN: Return type mismatch int vs none. -(defmethod lay-out-warp-tex texture-pool ((this texture-pool)) +(defmethod lay-out-warp-tex ((this texture-pool)) (let ((vram-loc 0)) (countdown (level-idx 7) (let ((lev (-> *level* level level-idx))) @@ -588,7 +588,7 @@ ;; definition for method 25 of type texture-pool ;; WARN: Return type mismatch int vs none. -(defmethod clear-ids texture-pool ((this texture-pool)) +(defmethod clear-ids ((this texture-pool)) (dotimes (v1-0 128) (set! (-> this ids v1-0) (the-as uint 0)) ) @@ -598,7 +598,7 @@ ;; definition for method 20 of type texture-pool ;; WARN: Return type mismatch symbol vs none. -(defmethod update-sprites texture-pool ((this texture-pool)) +(defmethod update-sprites ((this texture-pool)) (lay-out-sprite-tex this) (clear-ids this) (set! (-> this update-sprites-flag) #f) @@ -607,7 +607,7 @@ ;; definition for method 19 of type texture-pool ;; WARN: Return type mismatch symbol vs none. -(defmethod update-warp-and-hud texture-pool ((this texture-pool)) +(defmethod update-warp-and-hud ((this texture-pool)) (lay-out-hud-tex this) (lay-out-warp-tex this) (clear-ids this) @@ -617,7 +617,7 @@ ;; definition for method 21 of type texture-pool ;; WARN: Return type mismatch symbol vs none. -(defmethod mark-hud-warp-sprite-dirty texture-pool ((this texture-pool)) +(defmethod mark-hud-warp-sprite-dirty ((this texture-pool)) (set! (-> this update-sprites-flag) #t) (set! (-> this update-flag) #t) (none) @@ -1074,7 +1074,7 @@ ;; definition for method 13 of type texture-pool ;; WARN: Return type mismatch int vs none. -(defmethod login-level-textures texture-pool ((pool texture-pool) (lev level) (num-tpage-ids int) (tpage-ids (pointer texture-id))) +(defmethod login-level-textures ((pool texture-pool) (lev level) (num-tpage-ids int) (tpage-ids (pointer texture-id))) (dotimes (v1-0 18) (set! (-> lev texture-page v1-0) #f) ) @@ -1109,7 +1109,7 @@ ;; definition for method 14 of type texture-pool ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod add-level-tpage-dma texture-pool ((pool texture-pool) (lev level) (cat tpage-category) (bucket bucket-id)) +(defmethod add-level-tpage-dma ((pool texture-pool) (lev level) (cat tpage-category) (bucket bucket-id)) (with-pp (let ((tpage (-> lev texture-page cat))) (-> lev closest-object-array cat) @@ -1408,7 +1408,7 @@ ;; definition for method 13 of type texture-page ;; WARN: Return type mismatch int vs none. -(defmethod upload-now! texture-page ((this texture-page) (arg0 tex-upload-mode)) +(defmethod upload-now! ((this texture-page) (arg0 tex-upload-mode)) (let ((gp-0 *txt-dma-list*)) (let ((v1-0 gp-0)) (set! (-> v1-0 base) (-> v1-0 data)) @@ -1430,7 +1430,7 @@ ) ;; definition for method 12 of type texture-page -(defmethod add-to-dma-buffer texture-page ((this texture-page) (arg0 dma-buffer) (arg1 tex-upload-mode)) +(defmethod add-to-dma-buffer ((this texture-page) (arg0 dma-buffer) (arg1 tex-upload-mode)) (local-vars (sv-16 int)) (let ((v1-0 arg1)) (set! sv-16 (cond @@ -1548,7 +1548,7 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod setup-font-texture texture-pool ((this texture-pool)) +(defmethod setup-font-texture ((this texture-pool)) (local-vars (sv-16 int) (sv-20 int)) (let ((s3-0 (-> this font-palette))) (set! sv-16 (-> this cur)) @@ -1638,25 +1638,25 @@ ;; definition for method 5 of type texture-page-dir ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of texture-page-dir ((this texture-page-dir)) +(defmethod asize-of ((this texture-page-dir)) (the-as int (+ (-> texture-page-dir size) (* 12 (+ (-> this length) -1)))) ) ;; definition for method 4 of type texture-page-dir -(defmethod length texture-page-dir ((this texture-page-dir)) +(defmethod length ((this texture-page-dir)) (-> this length) ) ;; definition for method 7 of type texture-page-dir ;; WARN: Return type mismatch texture-page-dir vs none. -(defmethod relocate texture-page-dir ((this texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate ((this texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) (set! *texture-page-dir* this) (none) ) ;; definition for method 11 of type texture-page ;; WARN: Return type mismatch texture-page vs none. -(defmethod relocate-dests! texture-page ((this texture-page) (new-dest int) (segs int)) +(defmethod relocate-dests! ((this texture-page) (new-dest int) (segs int)) (let ((new-tbp (shr new-dest 6)) (old-tbp (shr (-> this segment segs dest) 6)) ) @@ -1692,7 +1692,7 @@ ) ;; definition for method 7 of type texture-page -(defmethod relocate texture-page ((this texture-page) (loading-heap kheap) (name (pointer uint8))) +(defmethod relocate ((this texture-page) (loading-heap kheap) (name (pointer uint8))) (cond ((or (not this) (not (file-info-correct-version? (-> this info) (file-kind tpage) 0))) (the-as texture-page #f) @@ -1869,7 +1869,7 @@ ;; definition for method 17 of type texture-pool ;; WARN: Return type mismatch int vs none. -(defmethod unload-page texture-pool ((this texture-pool) (arg0 texture-page)) +(defmethod unload-page ((this texture-pool) (arg0 texture-page)) (local-vars (a0-2 int)) (let ((v1-0 *texture-page-dir*)) (dotimes (a0-1 (-> v1-0 length)) @@ -1912,7 +1912,7 @@ ) ;; definition for method 9 of type texture-page-dir -(defmethod unlink-shaders-in-heap texture-page-dir ((this texture-page-dir) (heap kheap)) +(defmethod unlink-shaders-in-heap ((this texture-page-dir) (heap kheap)) (local-vars (dist-past-end uint)) (let ((mem-start (-> heap base)) (mem-end (-> heap top-base)) @@ -2259,7 +2259,7 @@ ) ;; definition for method 3 of type texture-page-dir -(defmethod inspect texture-page-dir ((this texture-page-dir)) +(defmethod inspect ((this texture-page-dir)) (texture-page-dir-inspect this #f) this ) diff --git a/test/decompiler/reference/jak2/engine/gfx/vu1-user-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/vu1-user-h_REF.gc index b9a09c3ceed..798a439e308 100644 --- a/test/decompiler/reference/jak2/engine/gfx/vu1-user-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/vu1-user-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type dma-foreground-sink (deftype dma-foreground-sink (basic) - ((bucket bucket-id :offset-assert 4) - (foreground-texture-page tpage-category :offset-assert 8) - (foreground-texture-level int8 :offset-assert 9) - (foreground-output-bucket int8 :offset-assert 10) + ((bucket bucket-id) + (foreground-texture-page tpage-category) + (foreground-texture-level int8) + (foreground-output-bucket int8) ) - :method-count-assert 9 - :size-assert #xb - :flag-assert #x90000000b ) ;; definition for method 3 of type dma-foreground-sink -(defmethod inspect dma-foreground-sink ((this dma-foreground-sink)) +(defmethod inspect ((this dma-foreground-sink)) (when (not this) (set! this this) (goto cfg-4) @@ -30,17 +27,14 @@ ;; definition of type generic-bucket-state (deftype generic-bucket-state (structure) - ((gifbuf-adr uint32 :offset-assert 0) - (inbuf-adr uint32 :offset-assert 4) + ((gifbuf-adr uint32) + (inbuf-adr uint32) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type generic-bucket-state -(defmethod inspect generic-bucket-state ((this generic-bucket-state)) +(defmethod inspect ((this generic-bucket-state)) (when (not this) (set! this this) (goto cfg-4) @@ -54,15 +48,12 @@ ;; definition of type generic-dma-foreground-sink (deftype generic-dma-foreground-sink (dma-foreground-sink) - ((state generic-bucket-state :inline :offset-assert 12) + ((state generic-bucket-state :inline) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type generic-dma-foreground-sink -(defmethod inspect generic-dma-foreground-sink ((this generic-dma-foreground-sink)) +(defmethod inspect ((this generic-dma-foreground-sink)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc b/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc index 2e8a5611f67..d856db8cfdb 100644 --- a/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc @@ -3,21 +3,18 @@ ;; definition of type bsp-node (deftype bsp-node (structure) - ((front int16 :offset-assert 0) - (back int16 :offset-assert 2) - (front-box-min vector4b :inline :offset-assert 4) - (front-box-max vector4b :inline :offset-assert 8) - (back-box-min vector4b :inline :offset-assert 12) - (back-box-max vector4b :inline :offset-assert 16) + ((front int16) + (back int16) + (front-box-min vector4b :inline) + (front-box-max vector4b :inline) + (back-box-min vector4b :inline) + (back-box-max vector4b :inline) ) :pack-me - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type bsp-node -(defmethod inspect bsp-node ((this bsp-node)) +(defmethod inspect ((this bsp-node)) (when (not this) (set! this this) (goto cfg-4) @@ -35,83 +32,77 @@ ;; definition of type bsp-header (deftype bsp-header (drawable) - ((info file-info :offset 4) - (all-visible-list (pointer uint16) :offset-assert 32) - (visible-list-length int16 :offset-assert 36) - (extra-vis-list-length int16 :offset-assert 38) - (drawable-trees drawable-tree-array :offset-assert 40) - (pat pointer :offset-assert 44) - (pat-length int32 :offset-assert 48) - (texture-remap-table (pointer uint64) :offset-assert 52) - (texture-remap-table-len int32 :offset-assert 56) - (texture-ids (pointer texture-id) :offset-assert 60) - (texture-page-count int32 :offset-assert 64) - (unknown-basic basic :offset-assert 68) - (name symbol :offset-assert 72) - (nickname symbol :offset-assert 76) - (vis-info level-vis-info 8 :offset-assert 80) - (actors drawable-inline-array-actor :offset-assert 112) - (cameras (array entity-camera) :offset-assert 116) - (nodes (inline-array bsp-node) :offset-assert 120) - (level level :offset-assert 124) - (current-leaf-idx uint16 :offset-assert 128) - (texture-flags texture-page-flag 10 :offset-assert 130) - (cam-outside-bsp uint8 :offset 152) - (cam-using-back uint8 :offset-assert 153) - (cam-box-idx uint16 :offset-assert 154) - (ambients symbol :offset-assert 156) - (subdivide-close float :offset-assert 160) - (subdivide-far float :offset-assert 164) - (race-meshes (array entity-race-mesh) :offset-assert 168) - (actor-birth-order (pointer uint32) :offset-assert 172) - (light-hash light-hash :offset-assert 176) - (nav-meshes (array entity-nav-mesh) :offset-assert 180) - (actor-groups (array actor-group) :offset-assert 184) - (region-trees (array drawable-tree-region-prim) :offset-assert 188) - (region-array region-array :offset-assert 192) - (collide-hash collide-hash :offset-assert 196) - (wind-array uint32 :offset 200) - (wind-array-length int32 :offset 204) - (city-level-info city-level-info :offset 208) - (vis-spheres vector-array :offset 216) - (vis-spheres-length uint32 :offset 248) - (region-tree drawable-tree-region-prim :offset 252) - (tfrag-masks texture-masks-array :offset-assert 256) - (tfrag-closest (pointer float) :offset-assert 260) - (tfrag-mask-count uint32 :offset 260) - (shrub-masks texture-masks-array :offset-assert 264) - (shrub-closest (pointer float) :offset-assert 268) - (shrub-mask-count uint32 :offset 268) - (alpha-masks texture-masks-array :offset-assert 272) - (alpha-closest (pointer float) :offset-assert 276) - (alpha-mask-count uint32 :offset 276) - (water-masks texture-masks-array :offset-assert 280) - (water-closest (pointer float) :offset-assert 284) - (water-mask-count uint32 :offset 284) - (bsp-scale vector :inline :offset-assert 288) - (bsp-offset vector :inline :offset-assert 304) - (end uint8 :offset 399) + ((info file-info :overlay-at id) + (all-visible-list (pointer uint16)) + (visible-list-length int16) + (extra-vis-list-length int16) + (drawable-trees drawable-tree-array) + (pat pointer) + (pat-length int32) + (texture-remap-table (pointer uint64)) + (texture-remap-table-len int32) + (texture-ids (pointer texture-id)) + (texture-page-count int32) + (unknown-basic basic) + (name symbol) + (nickname symbol) + (vis-info level-vis-info 8) + (actors drawable-inline-array-actor) + (cameras (array entity-camera)) + (nodes (inline-array bsp-node)) + (level level) + (current-leaf-idx uint16) + (texture-flags texture-page-flag 10) + (cam-outside-bsp uint8 :offset 152) + (cam-using-back uint8) + (cam-box-idx uint16) + (ambients symbol) + (subdivide-close float) + (subdivide-far float) + (race-meshes (array entity-race-mesh)) + (actor-birth-order (pointer uint32)) + (light-hash light-hash) + (nav-meshes (array entity-nav-mesh)) + (actor-groups (array actor-group)) + (region-trees (array drawable-tree-region-prim)) + (region-array region-array) + (collide-hash collide-hash) + (wind-array uint32 :offset 200) + (wind-array-length int32 :offset 204) + (city-level-info city-level-info :offset 208) + (vis-spheres vector-array :offset 216) + (vis-spheres-length uint32 :offset 248) + (region-tree drawable-tree-region-prim :offset 252) + (tfrag-masks texture-masks-array) + (tfrag-closest (pointer float)) + (tfrag-mask-count uint32 :overlay-at tfrag-closest) + (shrub-masks texture-masks-array) + (shrub-closest (pointer float)) + (shrub-mask-count uint32 :overlay-at shrub-closest) + (alpha-masks texture-masks-array) + (alpha-closest (pointer float)) + (alpha-mask-count uint32 :overlay-at alpha-closest) + (water-masks texture-masks-array) + (water-closest (pointer float)) + (water-mask-count uint32 :overlay-at water-closest) + (bsp-scale vector :inline) + (bsp-offset vector :inline) + (end uint8 :offset 399) ) - :method-count-assert 19 - :size-assert #x190 - :flag-assert #x1300000190 (:methods - (birth (_type_) none 17) - (deactivate-entities (_type_) none 18) + (birth (_type_) none) + (deactivate-entities (_type_) none) ) ) ;; definition of type game-level (deftype game-level (basic) - ((master-bsp basic :offset-assert 4) + ((master-bsp basic) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type game-level -(defmethod inspect game-level ((this game-level)) +(defmethod inspect ((this game-level)) (when (not this) (set! this this) (goto cfg-4) @@ -124,22 +115,19 @@ ;; definition of type view-frustum (deftype view-frustum (structure) - ((hither-top-left vector :inline :offset-assert 0) - (hither-top-right vector :inline :offset-assert 16) - (hither-bottom-left vector :inline :offset-assert 32) - (hither-bottom-right vector :inline :offset-assert 48) - (yon-top-left vector :inline :offset-assert 64) - (yon-top-right vector :inline :offset-assert 80) - (yon-bottom-left vector :inline :offset-assert 96) - (yon-bottom-right vector :inline :offset-assert 112) + ((hither-top-left vector :inline) + (hither-top-right vector :inline) + (hither-bottom-left vector :inline) + (hither-bottom-right vector :inline) + (yon-top-left vector :inline) + (yon-top-right vector :inline) + (yon-bottom-left vector :inline) + (yon-bottom-right vector :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type view-frustum -(defmethod inspect view-frustum ((this view-frustum)) +(defmethod inspect ((this view-frustum)) (when (not this) (set! this this) (goto cfg-4) @@ -158,7 +146,7 @@ ) ;; definition for method 3 of type bsp-header -(defmethod inspect bsp-header ((this bsp-header)) +(defmethod inspect ((this bsp-header)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tall-visible-list: #x~X~%" (-> this all-visible-list)) (format #t "~Tvisible-list-length: ~D~%" (-> this visible-list-length)) @@ -217,24 +205,21 @@ ;; definition of type collide-stats (deftype collide-stats (structure) - ((calls uint32 :offset-assert 0) - (spheres uint32 :offset-assert 4) - (nodes uint32 :offset-assert 8) - (frags uint32 :offset-assert 12) - (tris uint32 :offset-assert 16) - (output uint32 :offset-assert 20) - (pad0 uint32 2 :offset-assert 24) - (total-target uint32 8 :offset-assert 32) - (target-cache-fill uint32 8 :offset-assert 64) - (target-ray-poly uint32 6 :offset-assert 96) + ((calls uint32) + (spheres uint32) + (nodes uint32) + (frags uint32) + (tris uint32) + (output uint32) + (pad0 uint32 2) + (total-target uint32 8) + (target-cache-fill uint32 8) + (target-ray-poly uint32 6) ) - :method-count-assert 9 - :size-assert #x78 - :flag-assert #x900000078 ) ;; definition for method 3 of type collide-stats -(defmethod inspect collide-stats ((this collide-stats)) +(defmethod inspect ((this collide-stats)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/level/bsp_REF.gc b/test/decompiler/reference/jak2/engine/level/bsp_REF.gc index 33c7b9d770c..c791faff795 100644 --- a/test/decompiler/reference/jak2/engine/level/bsp_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/bsp_REF.gc @@ -27,7 +27,7 @@ ) ;; definition for method 8 of type bsp-header -(defmethod mem-usage bsp-header ((this bsp-header) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this bsp-header) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 work-bsp) this) (when (nonzero? (-> this info)) (set! (-> arg0 length) (max 85 (-> arg0 length))) @@ -126,7 +126,7 @@ ) ;; definition for method 9 of type bsp-header -(defmethod login bsp-header ((this bsp-header)) +(defmethod login ((this bsp-header)) (if (nonzero? (-> this drawable-trees)) (login (-> this drawable-trees)) ) @@ -151,7 +151,7 @@ ;; definition for method 10 of type bsp-header ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw bsp-header ((this bsp-header) (arg0 bsp-header) (arg1 display-frame)) +(defmethod draw ((this bsp-header) (arg0 bsp-header) (arg1 display-frame)) (local-vars (a3-4 uint128) (a3-5 uint128)) (rlet ((vf16 :class vf) (vf17 :class vf) @@ -272,7 +272,7 @@ ;; definition for method 14 of type bsp-header ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw bsp-header ((this bsp-header) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw ((this bsp-header) (arg0 drawable) (arg1 display-frame)) (rlet ((vf16 :class vf) (vf17 :class vf) (vf18 :class vf) @@ -332,7 +332,7 @@ ;; definition for method 13 of type bsp-header ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats bsp-header ((this bsp-header)) +(defmethod collect-stats ((this bsp-header)) (rlet ((vf16 :class vf) (vf17 :class vf) (vf18 :class vf) @@ -493,7 +493,7 @@ ;; definition for method 16 of type bsp-header ;; WARN: Return type mismatch int vs none. -(defmethod collect-regions bsp-header ((this bsp-header) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions ((this bsp-header) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through diff --git a/test/decompiler/reference/jak2/engine/level/level-h_REF.gc b/test/decompiler/reference/jak2/engine/level/level-h_REF.gc index a58d5993fa4..2339b56fc26 100644 --- a/test/decompiler/reference/jak2/engine/level/level-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/level-h_REF.gc @@ -3,27 +3,24 @@ ;; definition of type level-vis-info (deftype level-vis-info (basic) - ((level level :offset-assert 4) - (from-level symbol :offset-assert 8) - (from-bsp bsp-header :offset-assert 12) - (flags vis-info-flag :offset-assert 16) - (length uint32 :offset-assert 20) - (allocated-length uint32 :offset-assert 24) - (dictionary-length uint32 :offset-assert 28) - (dictionary uint32 :offset-assert 32) - (string-block uint32 :offset-assert 36) - (ramdisk uint32 :offset-assert 40) - (vis-bits uint32 :offset-assert 44) - (current-vis-string uint32 :offset-assert 48) - (vis-string uint32 :dynamic :offset-assert 52) + ((level level) + (from-level symbol) + (from-bsp bsp-header) + (flags vis-info-flag) + (length uint32) + (allocated-length uint32) + (dictionary-length uint32) + (dictionary uint32) + (string-block uint32) + (ramdisk uint32) + (vis-bits uint32) + (current-vis-string uint32) + (vis-string uint32 :dynamic) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type level-vis-info -(defmethod inspect level-vis-info ((this level-vis-info)) +(defmethod inspect ((this level-vis-info)) (when (not this) (set! this this) (goto cfg-68) @@ -147,84 +144,81 @@ ;; definition for method 5 of type level-vis-info ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of level-vis-info ((this level-vis-info)) +(defmethod asize-of ((this level-vis-info)) (the-as int (+ (-> level-vis-info size) (-> this dictionary-length))) ) ;; definition of type level-load-info (deftype level-load-info (basic) - ((name-list symbol 6 :offset-assert 4) - (index int16 :offset-assert 28) - (task-level uint8 :offset-assert 30) - (name symbol :offset 4) - (visname symbol :offset 8) - (nickname symbol :offset 12) - (dbname symbol :offset 16) - (taskname symbol :offset 20) - (other-name-1 symbol :offset 24) - (packages pair :offset-assert 32) - (memory-mode load-buffer-mode :offset-assert 36) - (music-bank symbol :offset-assert 40) - (ambient-sounds symbol :offset-assert 44) - (sound-reverb float :offset-assert 48) - (mood-func symbol :offset-assert 52) - (mood-init symbol :offset-assert 56) - (ocean symbol :offset-assert 60) - (sky symbol :offset-assert 64) - (use-camera-other symbol :offset-assert 68) - (part-engine-max int32 :offset-assert 72) - (city-map-bits uint64 :offset-assert 80) - (continues pair :offset-assert 88) - (tasks pair :offset-assert 92) - (priority int32 :offset-assert 96) - (load-commands pair :offset-assert 100) - (alt-load-commands pair :offset-assert 104) - (bsp-mask uint64 :offset-assert 112) - (buzzer int32 :offset-assert 120) - (buttom-height meters :offset-assert 124) - (run-packages pair :offset-assert 128) - (prev-level symbol :offset-assert 132) - (next-level symbol :offset-assert 136) - (wait-for-load symbol :offset-assert 140) - (login-func symbol :offset-assert 144) - (activate-func symbol :offset-assert 148) - (deactivate-func symbol :offset-assert 152) - (kill-func symbol :offset-assert 156) - (borrow-size uint16 2 :offset-assert 160) - (borrow-level symbol 2 :offset-assert 164) - (borrow-display? symbol 2 :offset-assert 172) - (base-task-mask task-mask :offset-assert 180) - (texture-anim symbol 10 :offset-assert 184) - (texture-anim-tfrag symbol :offset 184) - (texture-anim-pris symbol :offset 188) - (texture-anim-shrub symbol :offset 192) - (texture-anim-alpha symbol :offset 196) - (texture-anim-water symbol :offset 200) - (texture-anim-twarp symbol :offset 204) - (texture-anim-pris2 symbol :offset 208) - (texture-anim-sprite symbol :offset 212) - (texture-anim-map symbol :offset 216) - (texture-anim-sky symbol :offset 220) - (draw-priority float :offset-assert 224) - (level-flags uint32 :offset-assert 228) - (fog-height float :offset-assert 232) - (bigmap-id bigmap-id :offset-assert 236) - (ocean-near-translucent? symbol :offset-assert 240) - (ocean-far? symbol :offset-assert 244) - (mood-range mood-range :inline :offset-assert 256) - (max-rain float :offset-assert 272) - (fog-mult float :offset-assert 276) - (ocean-alpha float :offset-assert 280) - (extra-sound-bank pair :offset-assert 284) + ((name-list symbol 6) + (index int16) + (task-level uint8) + (name symbol :overlay-at (-> name-list 0)) + (visname symbol :overlay-at (-> name-list 1)) + (nickname symbol :overlay-at (-> name-list 2)) + (dbname symbol :overlay-at (-> name-list 3)) + (taskname symbol :overlay-at (-> name-list 4)) + (other-name-1 symbol :overlay-at (-> name-list 5)) + (packages pair) + (memory-mode load-buffer-mode) + (music-bank symbol) + (ambient-sounds symbol) + (sound-reverb float) + (mood-func symbol) + (mood-init symbol) + (ocean symbol) + (sky symbol) + (use-camera-other symbol) + (part-engine-max int32) + (city-map-bits uint64) + (continues pair) + (tasks pair) + (priority int32) + (load-commands pair) + (alt-load-commands pair) + (bsp-mask uint64) + (buzzer int32) + (buttom-height meters) + (run-packages pair) + (prev-level symbol) + (next-level symbol) + (wait-for-load symbol) + (login-func symbol) + (activate-func symbol) + (deactivate-func symbol) + (kill-func symbol) + (borrow-size uint16 2) + (borrow-level symbol 2) + (borrow-display? symbol 2) + (base-task-mask task-mask) + (texture-anim symbol 10) + (texture-anim-tfrag symbol :overlay-at (-> texture-anim 0)) + (texture-anim-pris symbol :overlay-at (-> texture-anim 1)) + (texture-anim-shrub symbol :overlay-at (-> texture-anim 2)) + (texture-anim-alpha symbol :overlay-at (-> texture-anim 3)) + (texture-anim-water symbol :overlay-at (-> texture-anim 4)) + (texture-anim-twarp symbol :overlay-at (-> texture-anim 5)) + (texture-anim-pris2 symbol :overlay-at (-> texture-anim 6)) + (texture-anim-sprite symbol :overlay-at (-> texture-anim 7)) + (texture-anim-map symbol :overlay-at (-> texture-anim 8)) + (texture-anim-sky symbol :overlay-at (-> texture-anim 9)) + (draw-priority float) + (level-flags uint32) + (fog-height float) + (bigmap-id bigmap-id) + (ocean-near-translucent? symbol) + (ocean-far? symbol) + (mood-range mood-range :inline) + (max-rain float) + (fog-mult float) + (ocean-alpha float) + (extra-sound-bank pair) ) :pack-me - :method-count-assert 9 - :size-assert #x120 - :flag-assert #x900000120 ) ;; definition for method 3 of type level-load-info -(defmethod inspect level-load-info ((this level-load-info)) +(defmethod inspect ((this level-load-info)) (when (not this) (set! this this) (goto cfg-51) @@ -367,18 +361,15 @@ ;; definition of type login-state (deftype login-state (basic) - ((state int32 :offset-assert 4) - (pos uint32 :offset-assert 8) - (elts uint32 :offset-assert 12) - (elt drawable 16 :offset-assert 16) + ((state int32) + (pos uint32) + (elts uint32) + (elt drawable 16) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type login-state -(defmethod inspect login-state ((this login-state)) +(defmethod inspect ((this login-state)) (when (not this) (set! this this) (goto cfg-4) @@ -394,110 +385,107 @@ ;; definition of type level (deftype level (basic) - ((name symbol :offset-assert 4) - (load-name symbol :offset-assert 8) - (nickname symbol :offset-assert 12) - (index int32 :offset-assert 16) - (status symbol :offset-assert 20) - (borrow-level level 2 :offset-assert 24) - (borrow-from-level level :offset-assert 32) - (heap kheap :inline :offset-assert 48) - (borrow-heap kheap 2 :inline :offset-assert 64) - (bsp bsp-header :offset-assert 96) - (art-group load-dir-art-group :offset-assert 100) - (info level-load-info :offset-assert 104) - (texture-page texture-page 18 :offset-assert 108) - (loaded-texture-page texture-page 16 :offset-assert 180) - (loaded-texture-page-count int32 :offset-assert 244) - (entity entity-links-array :offset-assert 248) - (closest-object float :offset-assert 252) - (closest-object-array float 18 :offset 252) - (upload-size int32 18 :offset 324) - (inside-boxes symbol :offset-assert 396) - (display? symbol :offset-assert 400) - (render? symbol :offset-assert 404) - (meta-inside? symbol :offset-assert 408) - (force-inside? symbol :offset-assert 412) - (mood-context mood-context :inline :offset-assert 416) - (mood-func (function mood-context float int none) :offset-assert 2384) - (mood-init (function mood-context none) :offset-assert 2388) - (vis-bits pointer :offset-assert 2392) - (all-visible? symbol :offset-assert 2396) - (force-all-visible? symbol :offset-assert 2400) - (linking symbol :offset-assert 2404) - (vis-info level-vis-info 8 :offset-assert 2408) - (vis-self-index int32 :offset-assert 2440) - (vis-adj-index int32 :offset-assert 2444) - (vis-buffer uint8 2048 :offset-assert 2448) - (mem-usage-block memory-usage-block :offset-assert 4496) - (mem-usage int32 :offset-assert 4500) - (code-memory-start pointer :offset-assert 4504) - (code-memory-end pointer :offset-assert 4508) - (load-start-time time-frame :offset-assert 4512) - (load-stop-time time-frame :offset-assert 4520) - (load-buffer uint32 2 :offset-assert 4528) - (load-buffer-size uint32 :offset-assert 4536) - (load-buffer-last uint32 :offset-assert 4540) - (load-buffer-mode load-buffer-mode :offset-assert 4544) - (display-start-time time-frame :offset-assert 4552) - (memory-mask uint32 :offset-assert 4560) - (task-mask task-mask :offset-assert 4564) - (tfrag-gs-test gs-test :offset-assert 4568) - (texture-dirty-masks texture-mask 10 :inline :offset-assert 4576) - (texture-mask texture-mask 18 :inline :offset-assert 4736) - (sky-mask texture-mask :inline :offset-assert 5024) - (tfrag-masks texture-masks-array :offset-assert 5040) - (tfrag-dists pointer :offset-assert 5044) - (shrub-masks texture-masks-array :offset-assert 5048) - (shrub-dists pointer :offset-assert 5052) - (alpha-masks texture-masks-array :offset-assert 5056) - (alpha-dists pointer :offset-assert 5060) - (water-masks texture-masks-array :offset-assert 5064) - (water-dists pointer :offset-assert 5068) - (tfrag-last-calls int32 6 :offset-assert 5072) - (tfrag-last-calls-u32 uint32 6 :offset 5072) - (texture-anim-array texture-anim-array 10 :offset-assert 5096) - (light-hash light-hash :offset-assert 5136) - (draw-priority float :offset-assert 5140) - (draw-index int32 :offset-assert 5144) - (part-engine engine :offset-assert 5148) - (user-object basic 4 :offset-assert 5152) - (loaded-text-info-count int32 :offset-assert 5168) - (loaded-text-info game-text-info 8 :offset-assert 5172) - (level-type type :offset-assert 5204) - (load-order int64 :offset-assert 5208) - (pad int8 12 :offset-assert 5216) + ((name symbol) + (load-name symbol) + (nickname symbol) + (index int32) + (status symbol) + (borrow-level level 2) + (borrow-from-level level) + (heap kheap :inline) + (borrow-heap kheap 2 :inline) + (bsp bsp-header) + (art-group load-dir-art-group) + (info level-load-info) + (texture-page texture-page 18) + (loaded-texture-page texture-page 16) + (loaded-texture-page-count int32) + (entity entity-links-array) + (closest-object float) + (closest-object-array float 18 :overlay-at closest-object) + (upload-size int32 18 :offset 324) + (inside-boxes symbol) + (display? symbol) + (render? symbol) + (meta-inside? symbol) + (force-inside? symbol) + (mood-context mood-context :inline) + (mood-func (function mood-context float int none)) + (mood-init (function mood-context none)) + (vis-bits pointer) + (all-visible? symbol) + (force-all-visible? symbol) + (linking symbol) + (vis-info level-vis-info 8) + (vis-self-index int32) + (vis-adj-index int32) + (vis-buffer uint8 2048) + (mem-usage-block memory-usage-block) + (mem-usage int32) + (code-memory-start pointer) + (code-memory-end pointer) + (load-start-time time-frame) + (load-stop-time time-frame) + (load-buffer uint32 2) + (load-buffer-size uint32) + (load-buffer-last uint32) + (load-buffer-mode load-buffer-mode) + (display-start-time time-frame) + (memory-mask uint32) + (task-mask task-mask) + (tfrag-gs-test gs-test) + (texture-dirty-masks texture-mask 10 :inline) + (texture-mask texture-mask 18 :inline) + (sky-mask texture-mask :inline) + (tfrag-masks texture-masks-array) + (tfrag-dists pointer) + (shrub-masks texture-masks-array) + (shrub-dists pointer) + (alpha-masks texture-masks-array) + (alpha-dists pointer) + (water-masks texture-masks-array) + (water-dists pointer) + (tfrag-last-calls int32 6) + (tfrag-last-calls-u32 uint32 6 :overlay-at (-> tfrag-last-calls 0)) + (texture-anim-array texture-anim-array 10) + (light-hash light-hash) + (draw-priority float) + (draw-index int32) + (part-engine engine) + (user-object basic 4) + (loaded-text-info-count int32) + (loaded-text-info game-text-info 8) + (level-type type) + (load-order int64) + (pad int8 12) ) - :method-count-assert 30 - :size-assert #x146c - :flag-assert #x1e0000146c (:methods - (deactivate (_type_) _type_ 9) - (is-object-visible? (_type_ int) symbol 10) - (level-method-11 () none 11) - (unload! (_type_) _type_ 12) - (bsp-name (_type_) symbol 13) - (compute-memory-usage! (_type_ symbol) memory-usage-block 14) - (inside-boxes-check (_type_ vector) symbol 15) - (update-vis! (_type_ level-vis-info uint (pointer uint8)) symbol 16) - (load-continue (_type_) _type_ 17) - (load-begin (_type_) _type_ 18) - (login-begin (_type_) _type_ 19) - (debug-print-region-splitbox (_type_ vector object) none 20) - (get-art-group-by-name (_type_ string) art-group 21) - (level-method-22 (_type_ symbol) int 22) - (lookup-text (_type_ text-id symbol) string 23) - (level-method-24 () none 24) - (birth (_type_) _type_ 25) - (level-status-update! (_type_ symbol) _type_ 26) - (load-required-packages (_type_) _type_ 27) - (init-vis-from-bsp (_type_) none 28) - (vis-clear (_type_) none 29) + (deactivate (_type_) _type_) + (is-object-visible? (_type_ int) symbol) + (level-method-11 () none) + (unload! (_type_) _type_) + (bsp-name (_type_) symbol) + (compute-memory-usage! (_type_ symbol) memory-usage-block) + (inside-boxes-check (_type_ vector) symbol) + (update-vis! (_type_ level-vis-info uint (pointer uint8)) symbol) + (load-continue (_type_) _type_) + (load-begin (_type_) _type_) + (login-begin (_type_) _type_) + (debug-print-region-splitbox (_type_ vector object) none) + (get-art-group-by-name (_type_ string) art-group) + (level-method-22 (_type_ symbol) int) + (lookup-text (_type_ text-id symbol) string) + (level-method-24 () none) + (birth (_type_) _type_) + (level-status-update! (_type_ symbol) _type_) + (load-required-packages (_type_) _type_) + (init-vis-from-bsp (_type_) none) + (vis-clear (_type_) none) ) ) ;; definition for method 3 of type level -(defmethod inspect level ((this level)) +(defmethod inspect ((this level)) (when (not this) (set! this this) (goto cfg-48) @@ -645,71 +633,68 @@ ;; definition of type level-group (deftype level-group (basic) - ((length int32 :offset-assert 4) - (log-in-level-bsp bsp-header :offset-assert 8) - (loading-level level :offset-assert 12) - (entity-link entity-links :offset 16) - (border? symbol :offset-assert 20) - (vis? symbol :offset-assert 24) - (want-level basic :offset-assert 28) - (receiving-level basic :offset-assert 32) - (load-commands pair :offset-assert 36) - (play? symbol :offset-assert 40) - (target-pos vector 2 :inline :offset-assert 48) - (camera-pos vector 2 :inline :offset-assert 80) - (heap kheap :inline :offset-assert 112) - (sound-bank basic 4 :offset-assert 128) - (disk-load-timing? symbol :offset-assert 144) - (load-level symbol :offset-assert 148) - (load-size uint32 :offset-assert 152) - (load-time float :offset-assert 156) - (load-login-time float :offset-assert 160) - (draw-level-count int32 :offset-assert 164) - (draw-level level 7 :offset-assert 168) - (draw-index-map uint8 7 :offset-assert 196) - (load-order uint64 :offset-assert 208) - (pad uint8 30 :offset-assert 216) - (level level 7 :inline :offset-assert 256) - (level0 level :inline :offset 256) - (level1 level :inline :offset 5488) - (level2 level :inline :offset 10720) - (level3 level :inline :offset 15952) - (level4 level :inline :offset 21184) - (level5 level :inline :offset 26416) - (default-level level :inline :offset 31648) - (pad2 uint8 4 :offset-assert 36880) + ((length int32) + (log-in-level-bsp bsp-header) + (loading-level level) + (entity-link entity-links :offset 16) + (border? symbol) + (vis? symbol) + (want-level basic) + (receiving-level basic) + (load-commands pair) + (play? symbol) + (target-pos vector 2 :inline) + (camera-pos vector 2 :inline) + (heap kheap :inline) + (sound-bank basic 4) + (disk-load-timing? symbol) + (load-level symbol) + (load-size uint32) + (load-time float) + (load-login-time float) + (draw-level-count int32) + (draw-level level 7) + (draw-index-map uint8 7) + (load-order uint64) + (pad uint8 30) + (level level 7 :inline) + (level0 level :inline :overlay-at (-> level 0)) + (level1 level :inline :offset 5488) + (level2 level :inline :offset 10720) + (level3 level :inline :offset 15952) + (level4 level :inline :offset 21184) + (level5 level :inline :offset 26416) + (default-level level :inline :offset 31648) + (pad2 uint8 4) ) - :method-count-assert 31 - :size-assert #x9014 - :flag-assert #x1f00009014 (:methods - (level-get (_type_ symbol) level 9) - (level-get-with-status (_type_ symbol) level 10) - (get-level-by-heap-ptr-and-status (_type_ pointer symbol) level 11) - (level-get-for-use (_type_ symbol symbol) level 12) - (activate-levels! (_type_) int 13) - (debug-print-entities (_type_ symbol type) none 14) - (debug-draw-actors (_type_ symbol) none 15) - (assign-draw-indices (_type_) none 16) - (actors-update (_type_) none 17) - (update-nav-meshes-method (_type_) none 18) - (level-update (_type_) none 19) - (level-get-target-inside (_type_) level 20) - (alloc-levels-if-needed (_type_ symbol) none 21) - (load-commands-set! (_type_ pair) none 22) - (art-group-get-by-name (_type_ string (pointer uint32)) art-group 23) - (alt-load-command-get-index (_type_ symbol int) pair 24) - (update-vis-volumes (_type_) none 25) - (update-vis-volumes-from-nav-mesh (_type_) none 26) - (print-volume-sizes (_type_) none 27) - (level-status (_type_ symbol) symbol 28) - (load-in-progress? (_type_) symbol 29) - (level-get-most-disposable (_type_) level 30) + (level-get (_type_ symbol) level) + (level-get-with-status (_type_ symbol) level) + (get-level-by-heap-ptr-and-status (_type_ pointer symbol) level) + (level-get-for-use (_type_ symbol symbol) level) + (activate-levels! (_type_) int) + (debug-print-entities (_type_ symbol type) none) + (debug-draw-actors (_type_ symbol) none) + (assign-draw-indices (_type_) none) + (actors-update (_type_) none) + (update-nav-meshes-method (_type_) none) + (level-update (_type_) none) + (level-get-target-inside (_type_) level) + (alloc-levels-if-needed (_type_ symbol) none) + (load-commands-set! (_type_ pair) none) + (art-group-get-by-name (_type_ string (pointer uint32)) art-group) + (alt-load-command-get-index (_type_ symbol int) pair) + (update-vis-volumes (_type_) none) + (update-vis-volumes-from-nav-mesh (_type_) none) + (print-volume-sizes (_type_) none) + (level-status (_type_ symbol) symbol) + (load-in-progress? (_type_) symbol) + (level-get-most-disposable (_type_) level) ) ) ;; definition for method 3 of type level-group -(defmethod inspect level-group ((this level-group)) +(defmethod inspect ((this level-group)) (when (not this) (set! this this) (goto cfg-13) diff --git a/test/decompiler/reference/jak2/engine/level/level_REF.gc b/test/decompiler/reference/jak2/engine/level/level_REF.gc index e52925014fd..edc54a1f383 100644 --- a/test/decompiler/reference/jak2/engine/level/level_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/level_REF.gc @@ -21,7 +21,7 @@ ;; definition for method 24 of type level-group ;; WARN: Return type mismatch object vs pair. -(defmethod alt-load-command-get-index level-group ((this level-group) (arg0 symbol) (arg1 int)) +(defmethod alt-load-command-get-index ((this level-group) (arg0 symbol) (arg1 int)) (let ((v1-1 (-> (lookup-level-info arg0) alt-load-commands))) (while (nonzero? arg1) (+! arg1 -1) @@ -35,12 +35,12 @@ ) ;; definition for method 29 of type level-group -(defmethod load-in-progress? level-group ((this level-group)) +(defmethod load-in-progress? ((this level-group)) (!= (-> *level* loading-level) (-> *level* default-level)) ) ;; definition for method 11 of type level-group -(defmethod get-level-by-heap-ptr-and-status level-group ((this level-group) (arg0 pointer) (arg1 symbol)) +(defmethod get-level-by-heap-ptr-and-status ((this level-group) (arg0 pointer) (arg1 symbol)) (case arg1 (('active) (dotimes (v1-1 (-> this length)) @@ -81,7 +81,7 @@ ) ;; definition for method 21 of type level -(defmethod get-art-group-by-name level ((this level) (arg0 string)) +(defmethod get-art-group-by-name ((this level) (arg0 string)) (countdown (s4-0 (-> this art-group art-group-array length)) (if (name= (-> this art-group art-group-array s4-0 name) arg0) (return (-> this art-group art-group-array s4-0)) @@ -91,7 +91,7 @@ ) ;; definition for method 13 of type level -(defmethod bsp-name level ((this level)) +(defmethod bsp-name ((this level)) (if (and (!= (-> this status) 'inactive) (-> this bsp) (nonzero? (-> this bsp name))) (-> this bsp name) (-> this name) @@ -108,13 +108,13 @@ ) ;; definition for method 2 of type level -(defmethod print level ((this level)) +(defmethod print ((this level)) (format #t "#<~A ~A ~S @ #x~X>" (-> this type) (-> this status) (-> this name) this) this ) ;; definition for method 7 of type bsp-header -(defmethod relocate bsp-header ((this bsp-header) (arg0 int)) +(defmethod relocate ((this bsp-header) (arg0 int)) (let ((s5-0 (-> *level* loading-level))) (when s5-0 (cond @@ -153,7 +153,7 @@ ) ;; definition for method 27 of type level -(defmethod load-required-packages level ((this level)) +(defmethod load-required-packages ((this level)) (when (not (or (not (-> this bsp)) (= *kernel-boot-mode* 'debug-boot))) (if (not (null? (-> this info packages))) (load-package "common" global) @@ -165,7 +165,7 @@ ;; definition for method 29 of type level ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vis-clear level ((this level)) +(defmethod vis-clear ((this level)) (countdown (v1-0 8) (nop!) (set! (-> this vis-info v1-0) #f) @@ -180,7 +180,7 @@ ;; definition for method 28 of type level ;; WARN: Return type mismatch int vs none. -(defmethod init-vis-from-bsp level ((this level)) +(defmethod init-vis-from-bsp ((this level)) (when (not (or (= (-> this status) 'inactive) (not (-> this bsp)))) (set! (-> this all-visible?) 'loading) (dotimes (s5-0 8) @@ -211,7 +211,7 @@ ) ;; definition for method 12 of type level-group -(defmethod level-get-for-use level-group ((this level-group) (arg0 symbol) (arg1 symbol)) +(defmethod level-get-for-use ((this level-group) (arg0 symbol) (arg1 symbol)) (local-vars (s5-1 level)) (alloc-levels-if-needed this #f) (let* ((s2-0 (lookup-level-info arg0)) @@ -259,7 +259,7 @@ ) ;; definition for method 28 of type level-group -(defmethod level-status level-group ((this level-group) (arg0 symbol)) +(defmethod level-status ((this level-group) (arg0 symbol)) (let ((v1-1 (level-get *level* arg0))) (if v1-1 (-> v1-1 status) @@ -269,7 +269,7 @@ ;; definition for method 26 of type level ;; INFO: Used lq/sq -(defmethod level-status-update! level ((this level) (arg0 symbol)) +(defmethod level-status-update! ((this level) (arg0 symbol)) (case arg0 (('inactive) (-> this status) @@ -368,7 +368,7 @@ ) ;; definition for method 17 of type level -(defmethod load-continue level ((this level)) +(defmethod load-continue ((this level)) (local-vars (sv-16 symbol)) (when (-> this linking) (when (nonzero? (link-resume)) @@ -494,7 +494,7 @@ ) ;; definition for method 18 of type level -(defmethod load-begin level ((this level)) +(defmethod load-begin ((this level)) (local-vars (bits-to-use int) (borrow-from-lev level) (found-borrow symbol)) (dotimes (v1-0 2) (set! (-> this borrow-level v1-0) #f) @@ -773,7 +773,7 @@ ) ;; definition for method 19 of type level -(defmethod login-begin level ((this level)) +(defmethod login-begin ((this level)) (set! (-> *texture-pool* allocate-func) texture-page-default-allocate) (cond ((-> this bsp) @@ -1099,7 +1099,7 @@ ;; definition for method 25 of type level ;; INFO: Used lq/sq -(defmethod birth level ((this level)) +(defmethod birth ((this level)) (local-vars (sv-96 int)) (case (-> this status) (('loaded) @@ -1173,7 +1173,7 @@ ;; definition for method 9 of type level ;; INFO: Used lq/sq -(defmethod deactivate level ((this level)) +(defmethod deactivate ((this level)) (case (-> this status) (('active 'alive) (format 0 "----------- kill ~A (status ~A)~%" this (-> this status)) @@ -1219,7 +1219,7 @@ ;; definition for method 12 of type level ;; WARN: Using new Jak 2 rtype-of -(defmethod unload! level ((this level)) +(defmethod unload! ((this level)) (deactivate this) (when (!= (-> this status) 'inactive) (dotimes (s5-0 2) @@ -1377,7 +1377,7 @@ ;; definition for method 10 of type level ;; ERROR: Unsupported inline assembly instruction kind - [addiu a0, a0, 56] -(defmethod is-object-visible? level ((this level) (arg0 int)) +(defmethod is-object-visible? ((this level) (arg0 int)) (local-vars (a0-1 int) (a0-3 int)) (let ((v1-0 (-> this vis-bits))) (shift-arith-right-32 a0-1 arg0 3) @@ -1391,7 +1391,7 @@ ) ;; definition for method 15 of type level -(defmethod inside-boxes-check level ((this level) (arg0 vector)) +(defmethod inside-boxes-check ((this level) (arg0 vector)) (cond ((not (-> this bsp)) #f @@ -1407,7 +1407,7 @@ ;; definition for method 20 of type level ;; WARN: Return type mismatch int vs none. -(defmethod debug-print-region-splitbox level ((this level) (arg0 vector) (arg1 object)) +(defmethod debug-print-region-splitbox ((this level) (arg0 vector) (arg1 object)) (cond ((or (not (-> this bsp)) (zero? (-> this bsp region-tree))) ) @@ -1420,7 +1420,7 @@ ) ;; definition for method 8 of type level -(defmethod mem-usage level ((this level) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this level) (arg0 memory-usage-block) (arg1 int)) (when (= (-> this status) 'active) (set! (-> arg0 length) (max 67 (-> arg0 length))) (set! (-> arg0 data 66 name) "entity-links") @@ -1476,7 +1476,7 @@ ;; definition for method 21 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod alloc-levels-if-needed level-group ((this level-group) (arg0 symbol)) +(defmethod alloc-levels-if-needed ((this level-group) (arg0 symbol)) (when (zero? (-> *level* heap base)) (kmemopen global "level-heaps") (when (nmember "game" *kernel-packages*) @@ -1506,7 +1506,7 @@ ) ;; definition for method 10 of type level-group -(defmethod level-get-with-status level-group ((this level-group) (arg0 symbol)) +(defmethod level-get-with-status ((this level-group) (arg0 symbol)) (dotimes (v1-0 (-> this length)) (if (= (-> this level v1-0 status) arg0) (return (-> this level v1-0)) @@ -1516,7 +1516,7 @@ ) ;; definition for method 30 of type level-group -(defmethod level-get-most-disposable level-group ((this level-group)) +(defmethod level-get-most-disposable ((this level-group)) (dotimes (v1-0 (-> this length)) (case (-> this level v1-0 status) (('inactive) @@ -1555,7 +1555,7 @@ ) ;; definition for method 9 of type level-group -(defmethod level-get level-group ((this level-group) (arg0 symbol)) +(defmethod level-get ((this level-group) (arg0 symbol)) (dotimes (v1-0 (-> this length)) (if (and (!= (-> this level v1-0 status) 'inactive) (or (= (-> this level v1-0 name) arg0) (= (-> this level v1-0 load-name) arg0)) @@ -1567,7 +1567,7 @@ ) ;; definition for method 23 of type level-group -(defmethod art-group-get-by-name level-group ((this level-group) (arg0 string) (arg1 (pointer uint32))) +(defmethod art-group-get-by-name ((this level-group) (arg0 string) (arg1 (pointer uint32))) (countdown (s4-0 7) (let ((s3-0 (-> *level* level s4-0))) (when (or (= (-> s3-0 status) 'active) (= (-> s3-0 status) 'reserved)) @@ -1586,7 +1586,7 @@ ) ;; definition for method 13 of type level-group -(defmethod activate-levels! level-group ((this level-group)) +(defmethod activate-levels! ((this level-group)) (dotimes (s5-0 (-> this length)) (level-status-update! (-> this level s5-0) 'active) ) @@ -1594,7 +1594,7 @@ ) ;; definition for method 20 of type level-group -(defmethod level-get-target-inside level-group ((this level-group)) +(defmethod level-get-target-inside ((this level-group)) (let ((s5-0 (target-pos 0))) (let ((v1-1 (-> *load-state* vis-nick))) (when v1-1 @@ -1665,14 +1665,14 @@ ;; definition for method 22 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod load-commands-set! level-group ((this level-group) (arg0 pair)) +(defmethod load-commands-set! ((this level-group) (arg0 pair)) (set! (-> this load-commands) arg0) 0 (none) ) ;; definition for method 8 of type level-group -(defmethod mem-usage level-group ((this level-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this level-group) (arg0 memory-usage-block) (arg1 int)) (dotimes (s3-0 (-> this length)) (mem-usage (-> this level s3-0) arg0 arg1) ) @@ -1971,7 +1971,7 @@ ) ;; definition for method 10 of type load-state -(defmethod update! load-state ((this load-state)) +(defmethod update! ((this load-state)) (local-vars (all-levels-inactive symbol)) (let ((discarded-level #f)) (let ((most-recent-load-order 0)) @@ -2156,7 +2156,7 @@ ;; definition for method 16 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod assign-draw-indices level-group ((this level-group)) +(defmethod assign-draw-indices ((this level-group)) (local-vars (t0-3 symbol)) (set! (-> this draw-level-count) 0) (dotimes (v1-0 7) @@ -2211,7 +2211,7 @@ ;; definition for method 19 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod level-update level-group ((this level-group)) +(defmethod level-update ((this level-group)) (local-vars (v1-101 symbol)) (camera-pos) (new 'static 'boxed-array :type symbol :length 0 :allocated-length 6) diff --git a/test/decompiler/reference/jak2/engine/level/region-h_REF.gc b/test/decompiler/reference/jak2/engine/level/region-h_REF.gc index af58b53026e..257a1751d6e 100644 --- a/test/decompiler/reference/jak2/engine/level/region-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/region-h_REF.gc @@ -3,21 +3,18 @@ ;; definition of type region (deftype region (structure) - ((id uint32 :offset-assert 0) - (on-enter pair :offset-assert 4) - (on-inside pair :offset-assert 8) - (on-exit pair :offset-assert 12) + ((id uint32) + (on-enter pair) + (on-inside pair) + (on-exit pair) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (region-method-9 (_type_ vector) symbol 9) + (region-method-9 (_type_ vector) symbol) ) ) ;; definition for method 3 of type region -(defmethod inspect region ((this region)) +(defmethod inspect ((this region)) (when (not this) (set! this this) (goto cfg-4) @@ -33,15 +30,12 @@ ;; definition of type region-array (deftype region-array (inline-array-class) - ((data region :inline :dynamic :offset-assert 16) + ((data region :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type region-array -(defmethod inspect region-array ((this region-array)) +(defmethod inspect ((this region-array)) (when (not this) (set! this this) (goto cfg-4) @@ -59,20 +53,17 @@ ;; definition of type drawable-region-prim (deftype drawable-region-prim (drawable) - ((region region :offset 8) + ((region region :offset 8) ) - :method-count-assert 20 - :size-assert #x20 - :flag-assert #x1400000020 (:methods - (debug-draw-region (_type_ int) none 17) - (track-region (_type_ region-prim-area) symbol 18) - (within-area? (_type_ region-prim-area) symbol 19) + (debug-draw-region (_type_ int) none) + (track-region (_type_ region-prim-area) symbol) + (within-area? (_type_ region-prim-area) symbol) ) ) ;; definition for method 3 of type drawable-region-prim -(defmethod inspect drawable-region-prim ((this drawable-region-prim)) +(defmethod inspect ((this drawable-region-prim)) (when (not this) (set! this this) (goto cfg-4) @@ -87,20 +78,17 @@ ;; definition of type drawable-tree-region-prim (deftype drawable-tree-region-prim (drawable-tree) - ((name basic :offset 8) - (data2 drawable-inline-array :dynamic :offset 32) + ((name basic :offset 8) + (data2 drawable-inline-array :dynamic :offset 32) ) - :method-count-assert 19 - :size-assert #x20 - :flag-assert #x1300000020 (:methods - (drawable-tree-region-prim-method-17 (_type_ vector) symbol 17) - (debug-print (_type_ vector object) none 18) + (drawable-tree-region-prim-method-17 (_type_ vector) symbol) + (debug-print (_type_ vector object) none) ) ) ;; definition for method 3 of type drawable-tree-region-prim -(defmethod inspect drawable-tree-region-prim ((this drawable-tree-region-prim)) +(defmethod inspect ((this drawable-tree-region-prim)) (when (not this) (set! this this) (goto cfg-7) @@ -120,24 +108,18 @@ ;; definition of type drawable-inline-array-region-prim (deftype drawable-inline-array-region-prim (drawable-inline-array) - ((data drawable-region-prim 1 :inline :offset-assert 32) - (pad uint8 4 :offset-assert 64) + ((data drawable-region-prim 1 :inline) + (pad uint8 4) ) - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 ) ;; definition of type drawable-region-sphere (deftype drawable-region-sphere (drawable-region-prim) () - :method-count-assert 20 - :size-assert #x20 - :flag-assert #x1400000020 ) ;; definition for method 3 of type drawable-region-sphere -(defmethod inspect drawable-region-sphere ((this drawable-region-sphere)) +(defmethod inspect ((this drawable-region-sphere)) (when (not this) (set! this this) (goto cfg-4) @@ -152,18 +134,15 @@ ;; definition of type region-face-data (deftype region-face-data (structure) - ((normal vector :inline :offset-assert 0) - (normal-offset float :offset 12) - (num-points uint32 :offset-assert 16) - (points vector :inline :dynamic :offset-assert 32) + ((normal vector :inline) + (normal-offset float :overlay-at (-> normal data 3)) + (num-points uint32) + (points vector :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type region-face-data -(defmethod inspect region-face-data ((this region-face-data)) +(defmethod inspect ((this region-face-data)) (when (not this) (set! this this) (goto cfg-4) @@ -179,15 +158,12 @@ ;; definition of type drawable-region-face (deftype drawable-region-face (drawable-region-prim) - ((data region-face-data :offset 12) + ((data region-face-data :offset 12) ) - :method-count-assert 20 - :size-assert #x20 - :flag-assert #x1400000020 ) ;; definition for method 3 of type drawable-region-face -(defmethod inspect drawable-region-face ((this drawable-region-face)) +(defmethod inspect ((this drawable-region-face)) (when (not this) (set! this this) (goto cfg-4) @@ -203,16 +179,13 @@ ;; definition of type region-face-array (deftype region-face-array (inline-array-class) - ((data drawable-region-face :inline :dynamic :offset 16) - (pad0 uint8 4 :offset-assert 16) + ((data drawable-region-face :inline :dynamic :offset 16) + (pad0 uint8 4) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type region-face-array -(defmethod inspect region-face-array ((this region-face-array)) +(defmethod inspect ((this region-face-array)) (when (not this) (set! this this) (goto cfg-4) @@ -230,15 +203,12 @@ ;; definition of type drawable-region-volume (deftype drawable-region-volume (drawable-region-prim) - ((faces region-face-array :offset 12) + ((faces region-face-array :offset 12) ) - :method-count-assert 20 - :size-assert #x20 - :flag-assert #x1400000020 ) ;; definition for method 3 of type drawable-region-volume -(defmethod inspect drawable-region-volume ((this drawable-region-volume)) +(defmethod inspect ((this drawable-region-volume)) (when (not this) (set! this this) (goto cfg-4) @@ -254,16 +224,13 @@ ;; definition of type region-prim-list (deftype region-prim-list (structure) - ((num-items int32 :offset-assert 0) - (items drawable-region-prim 320 :offset-assert 4) + ((num-items int32) + (items drawable-region-prim 320) ) - :method-count-assert 9 - :size-assert #x504 - :flag-assert #x900000504 ) ;; definition for method 3 of type region-prim-list -(defmethod inspect region-prim-list ((this region-prim-list)) +(defmethod inspect ((this region-prim-list)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/level/region_REF.gc b/test/decompiler/reference/jak2/engine/level/region_REF.gc index ca1690c5148..3cf1a0e607e 100644 --- a/test/decompiler/reference/jak2/engine/level/region_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/region_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 8 of type drawable-region-prim ;; WARN: Return type mismatch int vs drawable-region-prim. -(defmethod mem-usage drawable-region-prim ((this drawable-region-prim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-region-prim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 50 (-> arg0 length))) (set! (-> arg0 data 49 name) "region") (+! (-> arg0 data 49 count) 1) @@ -17,7 +17,7 @@ ;; definition for method 8 of type drawable-inline-array-region-prim ;; WARN: Return type mismatch int vs drawable-inline-array-region-prim. -(defmethod mem-usage drawable-inline-array-region-prim ((this drawable-inline-array-region-prim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this drawable-inline-array-region-prim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -33,19 +33,19 @@ ;; definition for method 10 of type drawable-tree-region-prim ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 drawable-tree-region-prim) (arg1 display-frame)) +(defmethod draw ((this drawable-tree-region-prim) (arg0 drawable-tree-region-prim) (arg1 display-frame)) 0 (none) ) ;; definition for method 15 of type drawable-tree-region-prim -(defmethod unpack-vis drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis ((this drawable-tree-region-prim) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) ;; definition for method 16 of type drawable-region-prim ;; WARN: Return type mismatch int vs none. -(defmethod collect-regions drawable-region-prim ((this drawable-region-prim) (area-of-interest sphere) (_count int) (region-list region-prim-list)) +(defmethod collect-regions ((this drawable-region-prim) (area-of-interest sphere) (_count int) (region-list region-prim-list)) "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @@ -64,7 +64,7 @@ ;; definition for method 16 of type drawable-inline-array-region-prim ;; WARN: Return type mismatch int vs none. -(defmethod collect-regions drawable-inline-array-region-prim ((this drawable-inline-array-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions ((this drawable-inline-array-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @@ -77,7 +77,7 @@ ;; definition for method 16 of type drawable-tree-region-prim ;; WARN: Return type mismatch int vs none. -(defmethod collect-regions drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions ((this drawable-tree-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @@ -90,7 +90,7 @@ ;; definition for method 17 of type drawable-region-prim ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-region drawable-region-prim ((this drawable-region-prim) (arg0 int)) +(defmethod debug-draw-region ((this drawable-region-prim) (arg0 int)) (local-vars (sv-32 vector2h) (sv-36 vector)) (set! sv-32 (new 'stack 'vector2h)) (set! sv-36 (-> this bsphere)) @@ -146,13 +146,13 @@ ) ;; definition for method 18 of type drawable-region-prim -(defmethod track-region drawable-region-prim ((this drawable-region-prim) (arg0 region-prim-area)) +(defmethod track-region ((this drawable-region-prim) (arg0 region-prim-area)) "TODO" #f ) ;; definition for method 19 of type drawable-region-prim -(defmethod within-area? drawable-region-prim ((this drawable-region-prim) (arg0 region-prim-area)) +(defmethod within-area? ((this drawable-region-prim) (arg0 region-prim-area)) "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" #f ) @@ -160,7 +160,7 @@ ;; definition for method 9 of type region-prim-area ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 9 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-entered-region! region-prim-area ((this region-prim-area) (region-sphere drawable-region-sphere)) +(defmethod track-entered-region! ((this region-prim-area) (region-sphere drawable-region-sphere)) "Enumerates through the objects `region-enter-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-enter-prim-list` and increment `region-enter-count` @@ -185,7 +185,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-enter-prim-list` and in ;; definition for method 10 of type region-prim-area ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 10 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-exited-region! region-prim-area ((this region-prim-area) (arg0 drawable-region-sphere)) +(defmethod track-exited-region! ((this region-prim-area) (arg0 drawable-region-sphere)) "Enumerates through the objects `region-exit-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-exit-prim-list` and increment `region-exit-count` @@ -210,7 +210,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-exit-prim-list` and inc ;; definition for method 11 of type region-prim-area ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 11 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-inside-region! region-prim-area ((this region-prim-area) (arg0 drawable-region-sphere)) +(defmethod track-inside-region! ((this region-prim-area) (arg0 drawable-region-sphere)) "Enumerates through the objects `region-inside-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-inside-prim-list` and increment `region-inside-count` @@ -235,7 +235,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-inside-prim-list` and i ;; definition for method 12 of type region-prim-area ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 12 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-start-region! region-prim-area ((this region-prim-area) (arg0 drawable-region-sphere)) +(defmethod track-start-region! ((this region-prim-area) (arg0 drawable-region-sphere)) "Enumerates through the objects `region-start-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and increment `region-start-count` @@ -259,7 +259,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ;; definition for method 17 of type drawable-region-sphere ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-region drawable-region-sphere ((this drawable-region-sphere) (arg0 int)) +(defmethod debug-draw-region ((this drawable-region-sphere) (arg0 int)) (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) (t9-0 this arg0) ) @@ -271,7 +271,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ;; definition for method 18 of type drawable-region-sphere -(defmethod track-region drawable-region-sphere ((this drawable-region-sphere) (area region-prim-area)) +(defmethod track-region ((this drawable-region-sphere) (area region-prim-area)) "TODO" (-> this region) (let ((area-of-interest (-> this bsphere))) @@ -298,14 +298,14 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ;; definition for method 19 of type drawable-region-sphere -(defmethod within-area? drawable-region-sphere ((this drawable-region-sphere) (area region-prim-area)) +(defmethod within-area? ((this drawable-region-sphere) (area region-prim-area)) "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" (spheres-overlap? (the-as sphere (-> area pos)) (the-as sphere (-> this bsphere))) ) ;; definition for method 17 of type drawable-region-face ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-region drawable-region-face ((this drawable-region-face) (arg0 int)) +(defmethod debug-draw-region ((this drawable-region-face) (arg0 int)) (when (zero? arg0) (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) (t9-0 this arg0) @@ -335,7 +335,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ;; definition for method 18 of type drawable-region-face -(defmethod track-region drawable-region-face ((this drawable-region-face) (arg0 region-prim-area)) +(defmethod track-region ((this drawable-region-face) (arg0 region-prim-area)) "TODO" (local-vars (sv-48 vector) (sv-52 vector) (sv-56 object)) (-> this region) @@ -404,7 +404,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ;; definition for method 17 of type drawable-region-volume ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-region drawable-region-volume ((this drawable-region-volume) (arg0 int)) +(defmethod debug-draw-region ((this drawable-region-volume) (arg0 int)) (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) (t9-0 this arg0) ) @@ -423,7 +423,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ;; definition for method 18 of type drawable-region-volume -(defmethod track-region drawable-region-volume ((this drawable-region-volume) (area region-prim-area)) +(defmethod track-region ((this drawable-region-volume) (area region-prim-area)) "TODO" (if (within-area? this area) (track-start-region! area (the-as drawable-region-sphere this)) @@ -445,7 +445,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ;; definition for method 19 of type drawable-region-volume -(defmethod within-area? drawable-region-volume ((this drawable-region-volume) (arg0 region-prim-area)) +(defmethod within-area? ((this drawable-region-volume) (arg0 region-prim-area)) "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" (let* ((v1-1 (-> this faces length)) (a2-0 0) @@ -465,7 +465,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ;; definition for method 17 of type drawable-tree-region-prim -(defmethod drawable-tree-region-prim-method-17 drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 vector)) +(defmethod drawable-tree-region-prim-method-17 ((this drawable-tree-region-prim) (arg0 vector)) (sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area #x70000000) pos)) arg0 0.0) (let* ((s5-0 (-> this data2 (+ (-> this length) -1) length)) (s4-0 0) @@ -485,7 +485,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ;; definition for method 9 of type region ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs symbol. -(defmethod region-method-9 region ((this region) (arg0 vector)) +(defmethod region-method-9 ((this region) (arg0 vector)) (local-vars (sv-16 int) (sv-32 int)) (sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area #x70000000) pos)) arg0 0.0) (dotimes (s5-0 (-> *level* length)) @@ -526,7 +526,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ;; definition for method 18 of type drawable-tree-region-prim ;; WARN: Return type mismatch int vs none. -(defmethod debug-print drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 vector) (arg1 object)) +(defmethod debug-print ((this drawable-tree-region-prim) (arg0 vector) (arg1 object)) (sphere<-vector+r! (the-as sphere (+ 1296 #x70000000)) arg0 0.0) (let* ((s4-0 (-> this data2 (+ (-> this length) -1) length)) (s3-0 0) diff --git a/test/decompiler/reference/jak2/engine/load/decomp-h_REF.gc b/test/decompiler/reference/jak2/engine/load/decomp-h_REF.gc index 15be59d7771..f77c19fce54 100644 --- a/test/decompiler/reference/jak2/engine/load/decomp-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/decomp-h_REF.gc @@ -3,18 +3,15 @@ ;; definition of type decomp-work (deftype decomp-work (structure) - ((buffer0 uint8 2048 :offset-assert 0) - (buffer1 uint8 2048 :offset-assert 2048) - (indices uint16 2048 :offset-assert 4096) - (temp-indices uint16 2048 :offset-assert 8192) + ((buffer0 uint8 2048) + (buffer1 uint8 2048) + (indices uint16 2048) + (temp-indices uint16 2048) ) - :method-count-assert 9 - :size-assert #x3000 - :flag-assert #x900003000 ) ;; definition for method 3 of type decomp-work -(defmethod inspect decomp-work ((this decomp-work)) +(defmethod inspect ((this decomp-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/load/decomp_REF.gc b/test/decompiler/reference/jak2/engine/load/decomp_REF.gc index e1cec1e3fe6..cff24b4c869 100644 --- a/test/decompiler/reference/jak2/engine/load/decomp_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/decomp_REF.gc @@ -40,16 +40,13 @@ ;; definition of type huf-dictionary-node (deftype huf-dictionary-node (structure) - ((zero uint16 :offset-assert 0) - (one uint16 :offset-assert 2) + ((zero uint16) + (one uint16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type huf-dictionary-node -(defmethod inspect huf-dictionary-node ((this huf-dictionary-node)) +(defmethod inspect ((this huf-dictionary-node)) (when (not this) (set! this this) (goto cfg-4) @@ -259,7 +256,7 @@ ;; definition for method 16 of type level ;; INFO: Used lq/sq -(defmethod update-vis! level ((this level) (vis-info level-vis-info) (unused uint) (in-bsp-vis-string (pointer uint8))) +(defmethod update-vis! ((this level) (vis-info level-vis-info) (unused uint) (in-bsp-vis-string (pointer uint8))) (local-vars (t0-3 uint128) (extra-vis-length int) (extra-vis-dest (pointer int8))) (let* ((cam-leaf-idx (-> vis-info from-bsp current-leaf-idx)) (curr-vis-string-offset (-> vis-info current-vis-string)) diff --git a/test/decompiler/reference/jak2/engine/load/file-io_REF.gc b/test/decompiler/reference/jak2/engine/load/file-io_REF.gc index 56aab9c94fb..92f910d4afb 100644 --- a/test/decompiler/reference/jak2/engine/load/file-io_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/file-io_REF.gc @@ -3,21 +3,18 @@ ;; definition of type file-stream (deftype file-stream (basic) - ((flags uint32 :offset-assert 4) - (mode symbol :offset-assert 8) - (name string :offset-assert 12) - (file uint32 :offset-assert 16) + ((flags uint32) + (mode symbol) + (name string) + (file uint32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 (:methods - (new (symbol type string symbol) _type_ 0) + (new (symbol type string symbol) _type_) ) ) ;; definition for method 3 of type file-stream -(defmethod inspect file-stream ((this file-stream)) +(defmethod inspect ((this file-stream)) (when (not this) (set! this this) (goto cfg-4) @@ -50,21 +47,18 @@ ;; definition of type file-info (deftype file-info (basic) - ((file-type (pointer string) :offset-assert 4) - (file-name basic :offset-assert 8) - (major-version uint32 :offset-assert 12) - (minor-version uint32 :offset-assert 16) - (maya-file-name basic :offset-assert 20) - (tool-debug basic :offset-assert 24) - (mdb-file-name basic :offset-assert 28) + ((file-type (pointer string)) + (file-name basic) + (major-version uint32) + (minor-version uint32) + (maya-file-name basic) + (tool-debug basic) + (mdb-file-name basic) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type file-info -(defmethod inspect file-info ((this file-info)) +(defmethod inspect ((this file-info)) (when (not this) (set! this this) (goto cfg-4) @@ -82,7 +76,7 @@ ) ;; definition for method 2 of type file-info -(defmethod print file-info ((this file-info)) +(defmethod print ((this file-info)) (format #t "#<~A ~A :version ~D.~D @ #x~X>" diff --git a/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc b/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc index d1c67193bf1..a66b0865d26 100644 --- a/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc @@ -3,22 +3,19 @@ ;; definition of type load-dgo-msg (deftype load-dgo-msg (structure) - ((rsvd uint16 :offset-assert 0) - (result load-msg-result :offset-assert 2) - (b1 pointer :offset-assert 4) - (b2 pointer :offset-assert 8) - (bt pointer :offset-assert 12) - (name uint128 :offset-assert 16) - (address uint32 :offset 4) + ((rsvd uint16) + (result load-msg-result) + (b1 pointer) + (b2 pointer) + (bt pointer) + (name uint128) + (address uint32 :overlay-at b1) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type load-dgo-msg ;; INFO: Used lq/sq -(defmethod inspect load-dgo-msg ((this load-dgo-msg)) +(defmethod inspect ((this load-dgo-msg)) (when (not this) (set! this this) (goto cfg-4) @@ -37,21 +34,18 @@ ;; definition of type load-chunk-msg (deftype load-chunk-msg (structure) - ((rsvd uint16 :offset-assert 0) - (result load-msg-result :offset-assert 2) - (address pointer :offset-assert 4) - (section uint32 :offset-assert 8) - (maxlen uint32 :offset-assert 12) - (dummy uint32 4 :offset-assert 16) - (basename sound-stream-name :inline :offset-assert 32) + ((rsvd uint16) + (result load-msg-result) + (address pointer) + (section uint32) + (maxlen uint32) + (dummy uint32 4) + (basename sound-stream-name :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type load-chunk-msg -(defmethod inspect load-chunk-msg ((this load-chunk-msg)) +(defmethod inspect ((this load-chunk-msg)) (when (not this) (set! this this) (goto cfg-4) @@ -70,21 +64,18 @@ ;; definition of type play-chunk-msg (deftype play-chunk-msg (structure) - ((rsvd uint16 :offset-assert 0) - (result uint16 :offset-assert 2) - (address pointer :offset-assert 4) - (section uint32 :offset-assert 8) - (maxlen uint32 :offset-assert 12) - (id uint32 4 :offset-assert 16) - (basename sound-stream-name 4 :inline :offset-assert 32) + ((rsvd uint16) + (result uint16) + (address pointer) + (section uint32) + (maxlen uint32) + (id uint32 4) + (basename sound-stream-name 4 :inline) ) - :method-count-assert 9 - :size-assert #xe0 - :flag-assert #x9000000e0 ) ;; definition for method 3 of type play-chunk-msg -(defmethod inspect play-chunk-msg ((this play-chunk-msg)) +(defmethod inspect ((this play-chunk-msg)) (when (not this) (set! this this) (goto cfg-4) @@ -103,16 +94,13 @@ ;; definition of type dgo-header (deftype dgo-header (structure) - ((length uint32 :offset-assert 0) - (rootname uint8 60 :offset-assert 4) + ((length uint32) + (rootname uint8 60) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type dgo-header -(defmethod inspect dgo-header ((this dgo-header)) +(defmethod inspect ((this dgo-header)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/load/load-state_REF.gc b/test/decompiler/reference/jak2/engine/load/load-state_REF.gc index 401f41f4406..3e70e39770e 100644 --- a/test/decompiler/reference/jak2/engine/load/load-state_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/load-state_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 2 of type level-buffer-state -(defmethod print level-buffer-state ((this level-buffer-state)) +(defmethod print ((this level-buffer-state)) (format #t "#" @@ -16,7 +16,7 @@ ) ;; definition for method 9 of type load-state -(defmethod reset! load-state ((this load-state)) +(defmethod reset! ((this load-state)) (dotimes (v1-0 6) (set! (-> this want v1-0 name) #f) (set! (-> this want v1-0 display?) #f) @@ -35,7 +35,7 @@ ) ;; definition for method 11 of type load-state -(defmethod want-levels load-state ((this load-state) (arg0 (pointer symbol))) +(defmethod want-levels ((this load-state) (arg0 (pointer symbol))) (dotimes (v1-0 6) (dotimes (a2-0 6) (when (= (-> this want v1-0 name) (-> arg0 a2-0)) @@ -66,7 +66,7 @@ ;; definition for method 12 of type load-state ;; WARN: Return type mismatch int vs none. -(defmethod want-sound-banks load-state ((this load-state) (arg0 (pointer symbol))) +(defmethod want-sound-banks ((this load-state) (arg0 (pointer symbol))) (dotimes (v1-0 3) (dotimes (a2-0 3) (when (= (-> this want-sound v1-0) (-> arg0 a2-0)) @@ -93,7 +93,7 @@ ) ;; definition for method 13 of type load-state -(defmethod want-display-level load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-display-level ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 6) (when (= (-> this want v1-0 name) arg0) (set! (-> this want v1-0 display?) arg1) @@ -109,7 +109,7 @@ ;; definition for method 14 of type load-state ;; WARN: Return type mismatch int vs none. -(defmethod want-vis-level load-state ((this load-state) (arg0 symbol)) +(defmethod want-vis-level ((this load-state) (arg0 symbol)) (let ((v1-0 (lookup-level-info arg0))) (if v1-0 (set! arg0 (-> v1-0 name)) @@ -121,7 +121,7 @@ ) ;; definition for method 15 of type load-state -(defmethod want-force-vis load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-force-vis ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 6) (when (= (-> this want v1-0 name) arg0) (set! (-> this want v1-0 force-vis?) arg1) @@ -135,7 +135,7 @@ ;; definition for method 16 of type load-state ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 16 load-state) has a return type of none, but the expression builder found a return statement. -(defmethod want-force-inside load-state ((this load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-force-inside ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 6) (when (= (-> this want v1-0 name) arg0) (set! (-> this want v1-0 force-inside?) arg1) @@ -150,7 +150,7 @@ ;; definition for method 21 of type load-state ;; WARN: Return type mismatch int vs none. ;; ERROR: Failed load: (set! a0-11 (l.wu (+ a0-10 12))) at op 138 -(defmethod add-borrow-levels load-state ((this load-state)) +(defmethod add-borrow-levels ((this load-state)) (dotimes (s5-0 6) (let ((a0-1 (-> this want s5-0 name))) (when a0-1 @@ -245,7 +245,7 @@ (define *display-load-commands* #f) ;; definition for method 18 of type load-state -(defmethod backup-load-state-and-set-cmds load-state ((this load-state) (arg0 pair)) +(defmethod backup-load-state-and-set-cmds ((this load-state) (arg0 pair)) (dotimes (s4-0 256) (when (-> this object-name s4-0) (format 0 "WARNING: load state somehow aquired object command ~A~%" (-> this object-name s4-0)) @@ -259,7 +259,7 @@ ) ;; definition for method 19 of type load-state -(defmethod restore-load-state-and-cleanup load-state ((this load-state)) +(defmethod restore-load-state-and-cleanup ((this load-state)) (with-pp (execute-commands-up-to this 100000.0) (dotimes (s5-0 256) @@ -293,7 +293,7 @@ ) ;; definition for method 20 of type load-state -(defmethod restore-load-state load-state ((this load-state)) +(defmethod restore-load-state ((this load-state)) (dotimes (v1-0 256) (if (-> this object-name v1-0) (set! (-> this object-name v1-0) #f) @@ -306,7 +306,7 @@ ;; definition for method 17 of type load-state ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 17 load-state) has a return type of none, but the expression builder found a return statement. -(defmethod execute-commands-up-to load-state ((this load-state) (arg0 float)) +(defmethod execute-commands-up-to ((this load-state) (arg0 float)) (with-pp (let ((s4-0 (new 'stack 'script-context (process->ppointer pp) pp (the-as vector #f)))) (set! (-> s4-0 load-state) this) diff --git a/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc b/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc index 46460232c77..e8364d2ac76 100644 --- a/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc @@ -3,29 +3,23 @@ ;; definition of type load-dir (deftype load-dir (basic) - ((lev level :offset-assert 4) - (string-array (array string) :offset-assert 8) - (data-array (array basic) :offset-assert 12) + ((lev level) + (string-array (array string)) + (data-array (array basic)) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (new (symbol type int level) _type_ 0) - (load-to-heap-by-name (_type_ string symbol kheap int) art-group 9) - (set-loaded-art (_type_ art-group) art-group 10) + (new (symbol type int level) _type_) + (load-to-heap-by-name (_type_ string symbol kheap int) art-group) + (set-loaded-art (_type_ art-group) art-group) ) ) ;; definition of type load-dir-art-group (deftype load-dir-art-group (load-dir) - ((art-group-array (array art-group) :offset 12) + ((art-group-array (array art-group) :overlay-at data-array) ) - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 (:methods - (new (symbol type int level) _type_ 0) + (new (symbol type int level) _type_) ) ) @@ -54,44 +48,41 @@ ;; definition of type external-art-buffer (deftype external-art-buffer (basic) - ((index int32 :offset-assert 4) - (other external-art-buffer :offset-assert 8) - (status symbol :offset-assert 12) - (locked? symbol :offset-assert 16) - (login? symbol :offset-assert 20) - (frame-lock symbol :offset-assert 24) - (init-heap (function external-art-buffer object) :offset-assert 28) - (heap kheap :inline :offset-assert 32) - (pending-load-file string :offset-assert 48) - (pending-load-file-part int32 :offset-assert 52) - (pending-load-file-owner handle :offset-assert 56) - (pending-load-file-priority float :offset-assert 64) - (load-file string :offset-assert 68) - (load-file-part int32 :offset-assert 72) - (load-file-owner handle :offset-assert 80) - (load-file-priority float :offset-assert 88) - (buf pointer :offset-assert 92) - (len int32 :offset-assert 96) - (art-group art-group :offset-assert 100) - (art-data uint32 :offset 100) + ((index int32) + (other external-art-buffer) + (status symbol) + (locked? symbol) + (login? symbol) + (frame-lock symbol) + (init-heap (function external-art-buffer object)) + (heap kheap :inline) + (pending-load-file string) + (pending-load-file-part int32) + (pending-load-file-owner handle) + (pending-load-file-priority float) + (load-file string) + (load-file-part int32) + (load-file-owner handle) + (load-file-priority float) + (buf pointer) + (len int32) + (art-group art-group) + (art-data uint32 :overlay-at art-group) ) - :method-count-assert 16 - :size-assert #x68 - :flag-assert #x1000000068 (:methods - (new (symbol type int function symbol) _type_ 0) - (set-pending-file (_type_ string int handle float) int 9) - (update (_type_) int 10) - (inactive? (_type_) symbol 11) - (file-status (_type_ string int) symbol 12) - (link-file (_type_ art-group) art-group 13) - (unlink-file (_type_ art-group) int 14) - (unlock! (_type_) int 15) + (new (symbol type int function symbol) _type_) + (set-pending-file (_type_ string int handle float) int) + (update (_type_) int) + (inactive? (_type_) symbol) + (file-status (_type_ string int) symbol) + (link-file (_type_ art-group) art-group) + (unlink-file (_type_ art-group) int) + (unlock! (_type_) int) ) ) ;; definition for method 3 of type external-art-buffer -(defmethod inspect external-art-buffer ((this external-art-buffer)) +(defmethod inspect ((this external-art-buffer)) (when (not this) (set! this this) (goto cfg-4) @@ -145,22 +136,19 @@ ;; definition of type spool-anim (deftype spool-anim (basic) - ((name string :offset 16) - (anim-name basic :offset-assert 20) - (buffer external-art-buffer :offset 20) - (parts int32 :offset-assert 24) - (hint-id int32 :offset 24) - (priority float :offset-assert 28) - (owner handle :offset-assert 32) - (command-list pair :offset-assert 40) + ((name string :offset 16) + (anim-name basic) + (buffer external-art-buffer :overlay-at anim-name) + (parts int32) + (hint-id int32 :overlay-at parts) + (priority float) + (owner handle) + (command-list pair) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type spool-anim -(defmethod inspect spool-anim ((this spool-anim)) +(defmethod inspect ((this spool-anim)) (when (not this) (set! this this) (goto cfg-4) @@ -179,34 +167,31 @@ ;; definition of type external-art-control (deftype external-art-control (basic) - ((buffer external-art-buffer 2 :offset-assert 4) - (rec spool-anim 3 :inline :offset-assert 16) - (spool-lock handle :offset-assert 160) - (reserve-buffer external-art-buffer :offset-assert 168) - (reserve-buffer-count int16 :offset-assert 172) - (dma-reserve-buffer-count int16 :offset-assert 174) - (active-stream string :offset-assert 176) - (queue-stream (array spool-anim) :offset-assert 180) - (frame-mask uint32 :offset-assert 184) - (dma-reserve-heap kheap :inline :offset-assert 192) + ((buffer external-art-buffer 2) + (rec spool-anim 3 :inline) + (spool-lock handle) + (reserve-buffer external-art-buffer) + (reserve-buffer-count int16) + (dma-reserve-buffer-count int16) + (active-stream string) + (queue-stream (array spool-anim)) + (frame-mask uint32) + (dma-reserve-heap kheap :inline) ) - :method-count-assert 16 - :size-assert #xd0 - :flag-assert #x10000000d0 (:methods - (new (symbol type) _type_ 0) - (update (_type_ symbol) int 9) - (clear-rec (_type_) int 10) - (spool-push (_type_ string int process float) int 11) - (file-status (_type_ string int) symbol 12) - (reserve-alloc (_type_) kheap 13) - (reserve-free (_type_ kheap) int 14) - (none-reserved? (_type_) symbol 15) + (new (symbol type) _type_) + (update (_type_ symbol) int) + (clear-rec (_type_) int) + (spool-push (_type_ string int process float) int) + (file-status (_type_ string int) symbol) + (reserve-alloc (_type_) kheap) + (reserve-free (_type_ kheap) int) + (none-reserved? (_type_) symbol) ) ) ;; definition for method 3 of type external-art-control -(defmethod inspect external-art-control ((this external-art-control)) +(defmethod inspect ((this external-art-control)) (when (not this) (set! this this) (goto cfg-4) @@ -255,17 +240,14 @@ ;; definition of type subtitle-range (deftype subtitle-range (basic) - ((start-frame float :offset-assert 4) - (end-frame float :offset-assert 8) - (message basic 8 :offset-assert 12) + ((start-frame float) + (end-frame float) + (message basic 8) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type subtitle-range -(defmethod inspect subtitle-range ((this subtitle-range)) +(defmethod inspect ((this subtitle-range)) (when (not this) (set! this this) (goto cfg-7) @@ -283,18 +265,15 @@ ;; definition of type subtitle-image (deftype subtitle-image (basic) - ((width uint16 :offset-assert 4) - (height uint16 :offset-assert 6) - (palette rgba 16 :offset 16) - (data uint8 :dynamic :offset-assert 80) + ((width uint16) + (height uint16) + (palette rgba 16 :offset 16) + (data uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type subtitle-image -(defmethod inspect subtitle-image ((this subtitle-image)) +(defmethod inspect ((this subtitle-image)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/load/loader_REF.gc b/test/decompiler/reference/jak2/engine/load/loader_REF.gc index d660a548875..b7e800207be 100644 --- a/test/decompiler/reference/jak2/engine/load/loader_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/loader_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 8 of type subtitle-range -(defmethod mem-usage subtitle-range ((this subtitle-range) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this subtitle-range) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 73 (-> arg0 length))) (set! (-> arg0 data 72 name) "subtitle") (+! (-> arg0 data 72 count) 1) @@ -15,7 +15,7 @@ ;; definition for method 3 of type load-dir ;; INFO: Used lq/sq -(defmethod inspect load-dir ((this load-dir)) +(defmethod inspect ((this load-dir)) (local-vars (sv-16 basic)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlevel: ~A~%" (-> this lev)) @@ -39,7 +39,7 @@ ;; definition for method 8 of type load-dir ;; WARN: Return type mismatch symbol vs load-dir. -(defmethod mem-usage load-dir ((this load-dir) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this load-dir) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 85 (-> arg0 length))) (set! (-> arg0 data 84 name) "array") (+! (-> arg0 data 84 count) 1) @@ -68,7 +68,7 @@ ) ;; definition for method 9 of type load-dir-art-group -(defmethod load-to-heap-by-name load-dir-art-group ((this load-dir-art-group) (arg0 string) (arg1 symbol) (arg2 kheap) (arg3 int)) +(defmethod load-to-heap-by-name ((this load-dir-art-group) (arg0 string) (arg1 symbol) (arg2 kheap) (arg3 int)) (let ((s5-0 (-> this string-array))) (dotimes (s3-0 (-> s5-0 length)) (when (string= arg0 (-> s5-0 s3-0)) @@ -95,7 +95,7 @@ ) ;; definition for method 10 of type load-dir-art-group -(defmethod set-loaded-art load-dir-art-group ((this load-dir-art-group) (arg0 art-group)) +(defmethod set-loaded-art ((this load-dir-art-group) (arg0 art-group)) (let ((s4-0 (-> this string-array))) (dotimes (s3-0 (-> s4-0 length)) (when (string= (-> arg0 name) (-> s4-0 s3-0)) @@ -179,7 +179,7 @@ ) ;; definition for method 2 of type external-art-buffer -(defmethod print external-art-buffer ((this external-art-buffer)) +(defmethod print ((this external-art-buffer)) (format #t "#<~A ~S ~D ~A @ #x~X>" @@ -204,7 +204,7 @@ ) ;; definition for method 9 of type external-art-buffer -(defmethod set-pending-file external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) +(defmethod set-pending-file ((this external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) (set! (-> this pending-load-file) arg0) (set! (-> this pending-load-file-part) arg1) (set! (-> this pending-load-file-owner) arg2) @@ -213,18 +213,18 @@ ) ;; definition for method 15 of type external-art-buffer -(defmethod unlock! external-art-buffer ((this external-art-buffer)) +(defmethod unlock! ((this external-art-buffer)) (set! (-> this locked?) #f) 0 ) ;; definition for method 11 of type external-art-buffer -(defmethod inactive? external-art-buffer ((this external-art-buffer)) +(defmethod inactive? ((this external-art-buffer)) (!= (-> this status) 'active) ) ;; definition for method 12 of type external-art-buffer -(defmethod file-status external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int)) +(defmethod file-status ((this external-art-buffer) (arg0 string) (arg1 int)) (when (and (name= (-> this pending-load-file) arg0) (= (-> this pending-load-file-part) arg1)) (if (and (name= (-> this load-file) arg0) (= (-> this load-file-part) arg1)) (-> this status) @@ -234,7 +234,7 @@ ) ;; definition for method 13 of type art-group -(defmethod link-art! art-group ((this art-group)) +(defmethod link-art! ((this art-group)) (when this (countdown (s5-0 (-> this length)) (let* ((s3-0 (-> this data s5-0)) @@ -287,7 +287,7 @@ ) ;; definition for method 14 of type art-group -(defmethod unlink-art! art-group ((this art-group)) +(defmethod unlink-art! ((this art-group)) (when this (countdown (s5-0 (-> this length)) (let* ((s3-0 (-> this data s5-0)) @@ -325,7 +325,7 @@ ) ;; definition for method 13 of type external-art-buffer -(defmethod link-file external-art-buffer ((this external-art-buffer) (arg0 art-group)) +(defmethod link-file ((this external-art-buffer) (arg0 art-group)) (when arg0 (link-art! arg0) (set! (-> this art-group) arg0) @@ -334,7 +334,7 @@ ) ;; definition for method 14 of type external-art-buffer -(defmethod unlink-file external-art-buffer ((this external-art-buffer) (arg0 art-group)) +(defmethod unlink-file ((this external-art-buffer) (arg0 art-group)) (when arg0 (unlink-art! arg0) (set! (-> this art-group) #f) @@ -344,7 +344,7 @@ ;; definition for method 10 of type external-art-buffer ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. -(defmethod update external-art-buffer ((this external-art-buffer)) +(defmethod update ((this external-art-buffer)) (when (or (not (name= (-> this pending-load-file) (-> this load-file))) (!= (-> this pending-load-file-part) (-> this load-file-part)) ) @@ -530,7 +530,7 @@ (define *preload-spool-anims* #t) ;; definition for method 12 of type external-art-control -(defmethod file-status external-art-control ((this external-art-control) (arg0 string) (arg1 int)) +(defmethod file-status ((this external-art-control) (arg0 string) (arg1 int)) (dotimes (s3-0 2) (let ((v1-3 (file-status (-> this buffer s3-0) arg0 arg1))) (if v1-3 @@ -542,7 +542,7 @@ ) ;; definition for method 9 of type external-art-control -(defmethod update external-art-control ((this external-art-control) (arg0 symbol)) +(defmethod update ((this external-art-control) (arg0 symbol)) (if (nonzero? (-> this reserve-buffer-count)) (spool-push this "reserved" 0 *dproc* (if (-> this reserve-buffer) -110.0 @@ -667,12 +667,12 @@ ) ;; definition for method 15 of type external-art-control -(defmethod none-reserved? external-art-control ((this external-art-control)) +(defmethod none-reserved? ((this external-art-control)) (zero? (-> this reserve-buffer-count)) ) ;; definition for method 13 of type external-art-control -(defmethod reserve-alloc external-art-control ((this external-art-control)) +(defmethod reserve-alloc ((this external-art-control)) (cond ((or (nonzero? (-> this dma-reserve-buffer-count)) (= *master-mode* 'progress)) (set! (-> this dma-reserve-buffer-count) 1) @@ -697,7 +697,7 @@ ) ;; definition for method 14 of type external-art-control -(defmethod reserve-free external-art-control ((this external-art-control) (arg0 kheap)) +(defmethod reserve-free ((this external-art-control) (arg0 kheap)) (cond ((nonzero? (-> this dma-reserve-buffer-count)) (set! (-> this dma-reserve-buffer-count) 0) @@ -726,7 +726,7 @@ ) ;; definition for method 10 of type external-art-control -(defmethod clear-rec external-art-control ((this external-art-control)) +(defmethod clear-rec ((this external-art-control)) (dotimes (v1-0 3) (set! (-> this rec v1-0 type) spool-anim) (set! (-> this rec v1-0 name) #f) @@ -738,7 +738,7 @@ ) ;; definition for method 11 of type external-art-control -(defmethod spool-push external-art-control ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) +(defmethod spool-push ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) (when (and (= arg3 -99.0) arg2) (let ((a0-2 (target-pos 0))) (set! arg3 (vector-vector-distance a0-2 (-> (the-as process-drawable arg2) root trans))) @@ -798,31 +798,28 @@ ;; definition of type spooler-block (deftype spooler-block (basic) - ((anim spool-anim :offset-assert 4) - (idle art-joint-anim :offset-assert 8) - (exit art-joint-anim :offset-assert 12) - (break-func (function process-drawable object) :offset-assert 16) - (part int32 :offset-assert 20) - (part-audio-start float :offset-assert 24) - (old-status uint16 :offset-assert 28) - (old-pos int32 :offset-assert 32) - (good-time time-frame :offset-assert 40) - (old-time time-frame :offset-assert 48) - (good-count int32 :offset-assert 56) - (sid sound-id :offset-assert 60) - (real-start-time time-frame :offset-assert 64) - (paused? symbol :offset-assert 72) + ((anim spool-anim) + (idle art-joint-anim) + (exit art-joint-anim) + (break-func (function process-drawable object)) + (part int32) + (part-audio-start float) + (old-status uint16) + (old-pos int32) + (good-time time-frame) + (old-time time-frame) + (good-count int32) + (sid sound-id) + (real-start-time time-frame) + (paused? symbol) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c (:methods - (new (symbol type art-joint-anim (function process-drawable symbol)) _type_ 0) + (new (symbol type art-joint-anim (function process-drawable symbol)) _type_) ) ) ;; definition for method 3 of type spooler-block -(defmethod inspect spooler-block ((this spooler-block)) +(defmethod inspect ((this spooler-block)) (when (not this) (set! this this) (goto cfg-4) @@ -1211,7 +1208,7 @@ ) ;; definition for method 3 of type gui-control -(defmethod inspect gui-control ((this gui-control)) +(defmethod inspect ((this gui-control)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tengine: ~A~%" (-> this engine)) (let ((a2-2 (-> this engine alive-list next0))) @@ -1229,7 +1226,7 @@ ) ;; definition for method 2 of type gui-connection -(defmethod print gui-connection ((this gui-connection)) +(defmethod print ((this gui-connection)) (let* ((t9-0 format) (a0-1 #t) (a1-0 "# this ids (-> arg0 channel)) arg1) 0 ) ;; definition for method 15 of type gui-control -(defmethod lookup-gui-connection gui-control ((this gui-control) (arg0 process) (arg1 gui-channel) (arg2 string) (arg3 sound-id)) +(defmethod lookup-gui-connection ((this gui-control) (arg0 process) (arg1 gui-channel) (arg2 string) (arg3 sound-id)) (let ((s1-0 (the-as gui-connection (-> this engine alive-list next0)))) (-> this engine) (let ((s0-0 (-> s1-0 next0))) @@ -1498,7 +1495,7 @@ ;; definition for method 14 of type gui-control ;; WARN: Return type mismatch int vs sound-id. -(defmethod lookup-gui-connection-id gui-control ((this gui-control) (arg0 string) (arg1 gui-channel) (arg2 gui-action)) +(defmethod lookup-gui-connection-id ((this gui-control) (arg0 string) (arg1 gui-channel) (arg2 gui-action)) (let ((s2-0 (the-as gui-connection (-> this engine alive-list next0)))) (-> this engine) (let ((s1-0 (-> s2-0 next0))) @@ -1530,7 +1527,7 @@ ) ;; definition for method 20 of type gui-control -(defmethod set-falloff! gui-control ((this gui-control) (arg0 sound-id) (arg1 symbol) (arg2 int) (arg3 int) (arg4 int)) +(defmethod set-falloff! ((this gui-control) (arg0 sound-id) (arg1 symbol) (arg2 int) (arg3 int) (arg4 int)) (when (nonzero? arg0) (let ((v1-2 (lookup-gui-connection *gui-control* (the-as process #f) (gui-channel none) (the-as string #f) arg0))) (when v1-2 @@ -1558,7 +1555,7 @@ ;; definition for method 18 of type gui-control ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 34. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod gui-control-method-18 gui-control ((this gui-control) (arg0 gui-channel)) +(defmethod gui-control-method-18 ((this gui-control) (arg0 gui-channel)) (let ((v1-0 arg0)) (the-as symbol @@ -1580,7 +1577,7 @@ ) ;; definition for method 23 of type gui-control -(defmethod handle-command gui-control ((this gui-control) (arg0 gui-channel) (arg1 gui-channel) (arg2 symbol) (arg3 gui-connection)) +(defmethod handle-command ((this gui-control) (arg0 gui-channel) (arg1 gui-channel) (arg2 symbol) (arg3 gui-connection)) (let ((s5-0 (-> this ids arg1))) (cond ((nonzero? s5-0) @@ -1652,7 +1649,7 @@ ;; definition for method 19 of type gui-control ;; INFO: Used lq/sq -(defmethod handle-command-list gui-control ((this gui-control) (arg0 gui-channel) (arg1 gui-connection)) +(defmethod handle-command-list ((this gui-control) (arg0 gui-channel) (arg1 gui-connection)) (local-vars (sv-16 int) (sv-32 int) (sv-48 int)) (let ((gp-0 #t)) (cond @@ -1720,7 +1717,7 @@ ;; definition for method 17 of type gui-control ;; WARN: Return type mismatch int vs gui-status. -(defmethod get-status gui-control ((this gui-control) (arg0 sound-id)) +(defmethod get-status ((this gui-control) (arg0 sound-id)) (let ((gp-0 (the-as gui-connection #f))) (if (zero? arg0) (return (gui-status unknown)) @@ -1854,15 +1851,15 @@ ) ;; definition for method 16 of type gui-control -(defmethod set-action! gui-control ((this gui-control) - (arg0 gui-action) - (arg1 sound-id) - (arg2 gui-channel) - (arg3 gui-action) - (arg4 string) - (arg5 (function gui-connection symbol)) - (arg6 process) - ) +(defmethod set-action! ((this gui-control) + (arg0 gui-action) + (arg1 sound-id) + (arg2 gui-channel) + (arg3 gui-action) + (arg4 string) + (arg5 (function gui-connection symbol)) + (arg6 process) + ) (local-vars (sv-16 gui-action) (sv-17 gui-action) (sv-20 string) (sv-24 (function gui-connection symbol))) (set! sv-16 arg0) (set! sv-17 arg3) @@ -1905,14 +1902,14 @@ ;; definition for method 9 of type gui-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs sound-id. -(defmethod add-process gui-control ((this gui-control) - (arg0 process) - (arg1 gui-channel) - (arg2 gui-action) - (arg3 string) - (arg4 float) - (arg5 time-frame) - ) +(defmethod add-process ((this gui-control) + (arg0 process) + (arg1 gui-channel) + (arg2 gui-action) + (arg3 string) + (arg4 float) + (arg5 time-frame) + ) (local-vars (sv-16 int) (sv-20 gui-connection) @@ -1979,7 +1976,7 @@ ;; definition for method 10 of type gui-control ;; WARN: Return type mismatch int vs none. -(defmethod remove-process gui-control ((this gui-control) (arg0 process) (arg1 gui-channel)) +(defmethod remove-process ((this gui-control) (arg0 process) (arg1 gui-channel)) (let ((s3-0 (the-as gui-connection (-> this engine alive-list next0)))) (-> this engine) (let ((s2-0 (-> s3-0 next0))) @@ -2000,15 +1997,15 @@ ;; definition for method 12 of type gui-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs sound-id. -(defmethod gui-control-method-12 gui-control ((this gui-control) - (arg0 process) - (arg1 gui-channel) - (arg2 gui-action) - (arg3 string) - (arg4 int) - (arg5 float) - (arg6 sound-id) - ) +(defmethod gui-control-method-12 ((this gui-control) + (arg0 process) + (arg1 gui-channel) + (arg2 gui-action) + (arg3 string) + (arg4 int) + (arg5 float) + (arg6 sound-id) + ) (local-vars (sv-16 gui-connection) (sv-20 int) @@ -2101,7 +2098,7 @@ ) ;; definition for method 21 of type gui-control -(defmethod gui-control-method-21 gui-control ((this gui-control) (arg0 gui-connection) (arg1 vector)) +(defmethod gui-control-method-21 ((this gui-control) (arg0 gui-connection) (arg1 vector)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) (let ((s5-0 (-> this spool-connections))) @@ -2173,7 +2170,7 @@ ) ;; definition for method 11 of type gui-control -(defmethod stop-str gui-control ((this gui-control) (arg0 gui-connection)) +(defmethod stop-str ((this gui-control) (arg0 gui-connection)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) (if (= (get-status this (-> arg0 id)) (gui-status active)) @@ -2189,7 +2186,7 @@ ;; definition for method 22 of type gui-control ;; WARN: Return type mismatch int vs none. -(defmethod gui-control-method-22 gui-control ((this gui-control) (arg0 gui-connection) (arg1 process) (arg2 symbol)) +(defmethod gui-control-method-22 ((this gui-control) (arg0 gui-connection) (arg1 process) (arg2 symbol)) (local-vars (v1-66 symbol) (v1-143 symbol)) (with-pp (when (and (>= (the-as uint (-> arg0 channel)) (the-as uint 16)) @@ -2408,7 +2405,7 @@ ) ;; definition for method 13 of type gui-control -(defmethod update gui-control ((this gui-control) (arg0 symbol)) +(defmethod update ((this gui-control) (arg0 symbol)) (set! (-> this ids 65) (the-as sound-id (if (and (>= (-> *display* base-clock frame-counter) (-> *game-info* blackout-time)) (= (-> *setting-control* user-current bg-a) 0.0) diff --git a/test/decompiler/reference/jak2/engine/load/ramdisk_REF.gc b/test/decompiler/reference/jak2/engine/load/ramdisk_REF.gc index 4dbecd8d794..1138d770264 100644 --- a/test/decompiler/reference/jak2/engine/load/ramdisk_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/ramdisk_REF.gc @@ -3,19 +3,16 @@ ;; definition of type ramdisk-rpc-fill (deftype ramdisk-rpc-fill (structure) - ((rsvd1 int32 :offset-assert 0) - (ee-id int32 :offset-assert 4) - (rsvd2 int32 2 :offset-assert 8) - (filename uint128 :offset-assert 16) + ((rsvd1 int32) + (ee-id int32) + (rsvd2 int32 2) + (filename uint128) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type ramdisk-rpc-fill ;; INFO: Used lq/sq -(defmethod inspect ramdisk-rpc-fill ((this ramdisk-rpc-fill)) +(defmethod inspect ((this ramdisk-rpc-fill)) (when (not this) (set! this this) (goto cfg-4) @@ -31,18 +28,15 @@ ;; definition of type ramdisk-rpc-load (deftype ramdisk-rpc-load (structure) - ((rsvd int32 :offset-assert 0) - (ee-id int32 :offset-assert 4) - (offset uint32 :offset-assert 8) - (length uint32 :offset-assert 12) + ((rsvd int32) + (ee-id int32) + (offset uint32) + (length uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type ramdisk-rpc-load -(defmethod inspect ramdisk-rpc-load ((this ramdisk-rpc-load)) +(defmethod inspect ((this ramdisk-rpc-load)) (when (not this) (set! this this) (goto cfg-4) @@ -58,20 +52,17 @@ ;; definition of type ramdisk-rpc-load-to-ee (deftype ramdisk-rpc-load-to-ee (structure) - ((rsvd int32 :offset-assert 0) - (addr int32 :offset-assert 4) - (offset int32 :offset-assert 8) - (length int32 :offset-assert 12) - (filename uint128 :offset-assert 16) + ((rsvd int32) + (addr int32) + (offset int32) + (length int32) + (filename uint128) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type ramdisk-rpc-load-to-ee ;; INFO: Used lq/sq -(defmethod inspect ramdisk-rpc-load-to-ee ((this ramdisk-rpc-load-to-ee)) +(defmethod inspect ((this ramdisk-rpc-load-to-ee)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/math/euler-h_REF.gc b/test/decompiler/reference/jak2/engine/math/euler-h_REF.gc index 9d2bce2169f..6d6d5b96ebb 100644 --- a/test/decompiler/reference/jak2/engine/math/euler-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/euler-h_REF.gc @@ -10,14 +10,11 @@ ;; definition of type euler-angles (deftype euler-angles (vector) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type euler-angles ;; INFO: Used lq/sq -(defmethod inspect euler-angles ((this euler-angles)) +(defmethod inspect ((this euler-angles)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/math/math_REF.gc b/test/decompiler/reference/jak2/engine/math/math_REF.gc index dd9cc06b2b2..74e37719ba7 100644 --- a/test/decompiler/reference/jak2/engine/math/math_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/math_REF.gc @@ -150,9 +150,6 @@ ;; definition of type float-type (deftype float-type (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for symbol exp-slead, type (pointer float) @@ -256,25 +253,16 @@ (b uint8 :offset 16 :size 8) (a uint8 :offset 24 :size 8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type xyzw (deftype xyzw (uint128) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition of type xyzwh (deftype xyzwh (uint128) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for function print-time @@ -578,15 +566,12 @@ ;; definition of type random-generator (deftype random-generator (basic) - ((seed uint32 :offset-assert 4) + ((seed uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type random-generator -(defmethod inspect random-generator ((this random-generator)) +(defmethod inspect ((this random-generator)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/math/matrix-h_REF.gc b/test/decompiler/reference/jak2/engine/math/matrix-h_REF.gc index 418c96ae338..82e20ba359c 100644 --- a/test/decompiler/reference/jak2/engine/math/matrix-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/matrix-h_REF.gc @@ -3,22 +3,19 @@ ;; definition of type matrix (deftype matrix (structure) - ((data float 16 :offset-assert 0) - (vector vector 4 :inline :offset 0) - (quad uint128 4 :offset 0) - (trans vector :inline :offset 48) + ((data float 16) + (vector vector 4 :inline :overlay-at (-> data 0)) + (quad uint128 4 :overlay-at (-> data 0)) + (trans vector :inline :overlay-at (-> data 12)) ) - :method-count-assert 10 - :size-assert #x40 - :flag-assert #xa00000040 (:methods - (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none 9) + (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none) ) ) ;; definition for method 3 of type matrix ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect matrix ((this matrix)) +(defmethod inspect ((this matrix)) (when (not this) (set! this this) (goto cfg-4) @@ -34,18 +31,15 @@ ;; definition of type matrix3 (deftype matrix3 (structure) - ((data float 12 :offset-assert 0) - (vector vector 3 :inline :offset 0) - (quad uint128 3 :offset 0) + ((data float 12) + (vector vector 3 :inline :overlay-at (-> data 0)) + (quad uint128 3 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type matrix3 ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect matrix3 ((this matrix3)) +(defmethod inspect ((this matrix3)) (when (not this) (set! this this) (goto cfg-4) @@ -60,17 +54,14 @@ ;; definition of type matrix4h (deftype matrix4h (structure) - ((data int16 16 :offset-assert 0) - (vector4h vector4h 4 :inline :offset 0) - (long int64 4 :offset 0) + ((data int16 16) + (vector4h vector4h 4 :inline :overlay-at (-> data 0)) + (long int64 4 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type matrix4h -(defmethod inspect matrix4h ((this matrix4h)) +(defmethod inspect ((this matrix4h)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/math/matrix_REF.gc b/test/decompiler/reference/jak2/engine/math/matrix_REF.gc index 5eed0c57f8e..98728c97530 100644 --- a/test/decompiler/reference/jak2/engine/math/matrix_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/matrix_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 3 of type matrix ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect matrix ((this matrix)) +(defmethod inspect ((this matrix)) (format #t "[~8x] matrix~%" this) (format #t @@ -35,7 +35,7 @@ ;; definition for method 3 of type matrix3 ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect matrix3 ((this matrix3)) +(defmethod inspect ((this matrix3)) (format #t "[~8x] matrix3~%" this) (format #t "~T[~F] [~F] [~F]~%" (-> this vector 0 x) (-> this vector 0 y) (-> this vector 0 z)) (format #t "~T[~F] [~F] [~F]~%" (-> this vector 1 x) (-> this vector 1 y) (-> this vector 1 z)) diff --git a/test/decompiler/reference/jak2/engine/math/quaternion-h_REF.gc b/test/decompiler/reference/jak2/engine/math/quaternion-h_REF.gc index 4dafd653419..9b588740c21 100644 --- a/test/decompiler/reference/jak2/engine/math/quaternion-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/quaternion-h_REF.gc @@ -3,23 +3,20 @@ ;; definition of type quaternion (deftype quaternion (structure) - ((data float 4 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (w float :offset 12) - (vec vector :inline :offset 0) - (quad uint128 :offset 0) + ((data float 4) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) + (z float :overlay-at (-> data 2)) + (w float :overlay-at (-> data 3)) + (vec vector :inline :overlay-at (-> data 0)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type quaternion ;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -(defmethod inspect quaternion ((this quaternion)) +(defmethod inspect ((this quaternion)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc b/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc index a517ee50345..a331615db29 100644 --- a/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 3 of type quaternion ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect quaternion ((this quaternion)) +(defmethod inspect ((this quaternion)) (format #t "[~8x] quaternion~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w)) (let ((f0-5 (/ 1.0 (sqrtf (+ (* (-> this x) (-> this x)) (* (-> this y) (-> this y)) (* (-> this z) (-> this z)))))) diff --git a/test/decompiler/reference/jak2/engine/math/transform-h_REF.gc b/test/decompiler/reference/jak2/engine/math/transform-h_REF.gc index c2a83443abd..3bd0410a600 100644 --- a/test/decompiler/reference/jak2/engine/math/transform-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/transform-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type transform (deftype transform (structure) - ((trans vector :inline :offset-assert 0) - (rot vector :inline :offset-assert 16) - (scale vector :inline :offset-assert 32) + ((trans vector :inline) + (rot vector :inline) + (scale vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type transform -(defmethod inspect transform ((this transform)) +(defmethod inspect ((this transform)) (when (not this) (set! this this) (goto cfg-4) @@ -28,20 +25,17 @@ ;; definition of type trs (deftype trs (basic) - ((trans vector :inline :offset-assert 16) - (rot vector :inline :offset-assert 32) - (scale vector :inline :offset-assert 48) + ((trans vector :inline) + (rot vector :inline) + (scale vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type trs -(defmethod inspect trs ((this trs)) +(defmethod inspect ((this trs)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/math/transform_REF.gc b/test/decompiler/reference/jak2/engine/math/transform_REF.gc index c8697f6ef12..75d21c76246 100644 --- a/test/decompiler/reference/jak2/engine/math/transform_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/transform_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 2 of type transform -(defmethod print transform ((this transform)) +(defmethod print ((this transform)) (format #t "# this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) (format #t "~T~Trot: ~F ~F ~F ~F ~%" (-> this rot x) (-> this rot y) (-> this rot z) (-> this rot w)) diff --git a/test/decompiler/reference/jak2/engine/math/transformq-h_REF.gc b/test/decompiler/reference/jak2/engine/math/transformq-h_REF.gc index 136eec7bf49..dc367a9fd28 100644 --- a/test/decompiler/reference/jak2/engine/math/transformq-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/transformq-h_REF.gc @@ -3,15 +3,12 @@ ;; definition of type transformq (deftype transformq (transform) - ((quat quaternion :inline :offset 16) + ((quat quaternion :inline :overlay-at (-> rot data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type transformq -(defmethod inspect transformq ((this transformq)) +(defmethod inspect ((this transformq)) (when (not this) (set! this this) (goto cfg-4) @@ -27,15 +24,12 @@ ;; definition of type trsq (deftype trsq (trs) - ((quat quaternion :inline :offset 32) + ((quat quaternion :inline :overlay-at (-> rot data 0)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type trsq -(defmethod inspect trsq ((this trsq)) +(defmethod inspect ((this trsq)) (when (not this) (set! this this) (goto cfg-4) @@ -51,43 +45,40 @@ ;; definition of type trsqv (deftype trsqv (trsq) - ((pause-adjust-distance meters :offset 4) - (nav-radius meters :offset 8) - (transv vector :inline :offset-assert 64) - (rotv vector :inline :offset-assert 80) - (scalev vector :inline :offset-assert 96) - (dir-targ quaternion :inline :offset-assert 112) - (angle-change-time time-frame :offset-assert 128) - (old-y-angle-diff float :offset-assert 136) + ((pause-adjust-distance meters :offset 4) + (nav-radius meters :offset 8) + (transv vector :inline) + (rotv vector :inline) + (scalev vector :inline) + (dir-targ quaternion :inline) + (angle-change-time time-frame) + (old-y-angle-diff float) ) - :method-count-assert 28 - :size-assert #x8c - :flag-assert #x1c0000008c (:methods - (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion 9) - (set-heading-vec! (_type_ vector) quaternion 10) - (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion 11) - (point-toward-point! (_type_ vector) quaternion 12) - (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion 13) - (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion 14) - (set-roll-to-grav! (_type_ float) quaternion 15) - (set-roll-to-grav-2! (_type_ float) quaternion 16) - (rotate-toward-orientation! (_type_ quaternion float float int int float) quaternion 17) - (set-quaternion! (_type_ quaternion) quaternion 18) - (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion 19) - (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion 20) - (rot->dir-targ! (_type_) quaternion 21) - (y-angle (_type_) float 22) - (global-y-angle-to-point (_type_ vector) float 23) - (relative-y-angle-to-point (_type_ vector) float 24) - (roll-relative-to-gravity (_type_) float 25) - (set-and-limit-velocity (_type_ int vector float) trsqv :behavior process 26) - (get-quaternion (_type_) quaternion 27) + (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion) + (set-heading-vec! (_type_ vector) quaternion) + (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion) + (point-toward-point! (_type_ vector) quaternion) + (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion) + (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion) + (set-roll-to-grav! (_type_ float) quaternion) + (set-roll-to-grav-2! (_type_ float) quaternion) + (rotate-toward-orientation! (_type_ quaternion float float int int float) quaternion) + (set-quaternion! (_type_ quaternion) quaternion) + (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion) + (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion) + (rot->dir-targ! (_type_) quaternion) + (y-angle (_type_) float) + (global-y-angle-to-point (_type_ vector) float) + (relative-y-angle-to-point (_type_ vector) float) + (roll-relative-to-gravity (_type_) float) + (set-and-limit-velocity (_type_ int vector float) trsqv :behavior process) + (get-quaternion (_type_) quaternion) ) ) ;; definition for method 3 of type trsqv -(defmethod inspect trsqv ((this trsqv)) +(defmethod inspect ((this trsqv)) (when (not this) (set! this this) (goto cfg-4) @@ -110,12 +101,12 @@ ) ;; definition for method 23 of type trsqv -(defmethod global-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) +(defmethod global-y-angle-to-point ((this trsqv) (arg0 vector)) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans))) ) ;; definition for method 24 of type trsqv -(defmethod relative-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) +(defmethod relative-y-angle-to-point ((this trsqv) (arg0 vector)) (deg-diff (y-angle this) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)))) ) diff --git a/test/decompiler/reference/jak2/engine/math/transformq_REF.gc b/test/decompiler/reference/jak2/engine/math/transformq_REF.gc index efed82fb19e..306dd404a6d 100644 --- a/test/decompiler/reference/jak2/engine/math/transformq_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/transformq_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 2 of type transformq -(defmethod print transformq ((this transformq)) +(defmethod print ((this transformq)) (format #t "# this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) (format #t "~T~Tquat: ~F ~F ~F ~F ~%" (-> this quat x) (-> this quat y) (-> this quat z) (-> this quat w)) @@ -11,27 +11,27 @@ ) ;; definition for method 27 of type trsqv -(defmethod get-quaternion trsqv ((this trsqv)) +(defmethod get-quaternion ((this trsqv)) (-> this quat) ) ;; definition for method 18 of type trsqv -(defmethod set-quaternion! trsqv ((this trsqv) (arg0 quaternion)) +(defmethod set-quaternion! ((this trsqv) (arg0 quaternion)) (quaternion-copy! (get-quaternion this) arg0) ) ;; definition for method 21 of type trsqv -(defmethod rot->dir-targ! trsqv ((this trsqv)) +(defmethod rot->dir-targ! ((this trsqv)) (quaternion-copy! (-> this dir-targ) (get-quaternion this)) ) ;; definition for method 22 of type trsqv -(defmethod y-angle trsqv ((this trsqv)) +(defmethod y-angle ((this trsqv)) (quaternion-y-angle (get-quaternion this)) ) ;; definition for method 9 of type trsqv -(defmethod seek-toward-heading-vec! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) +(defmethod seek-toward-heading-vec! ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) (let* ((f0-0 (deg-diff (quaternion-y-angle (-> this quat)) (vector-y-angle arg0))) (f1-2 (fmin (* arg1 (seconds-per-frame)) (/ (* 5.0 (fabs f0-0)) (the float arg2)))) (f30-0 (fmax (fmin f0-0 f1-2) (- f1-2))) @@ -60,7 +60,7 @@ ) ;; definition for method 10 of type trsqv -(defmethod set-heading-vec! trsqv ((this trsqv) (arg0 vector)) +(defmethod set-heading-vec! ((this trsqv) (arg0 vector)) (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion s3-0 @@ -71,12 +71,12 @@ ) ;; definition for method 11 of type trsqv -(defmethod seek-to-point-toward-point! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) +(defmethod seek-to-point-toward-point! ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) (seek-toward-heading-vec! this (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) arg1 arg2) ) ;; definition for method 12 of type trsqv -(defmethod point-toward-point! trsqv ((this trsqv) (arg0 vector)) +(defmethod point-toward-point! ((this trsqv) (arg0 vector)) (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion s3-0 @@ -87,7 +87,7 @@ ) ;; definition for method 13 of type trsqv -(defmethod seek-toward-yaw-angle! trsqv ((this trsqv) (arg0 float) (arg1 float) (arg2 time-frame)) +(defmethod seek-toward-yaw-angle! ((this trsqv) (arg0 float) (arg1 float) (arg2 time-frame)) (let ((s3-0 (method-of-object this seek-toward-heading-vec!)) (s2-0 (new 'stack-no-clear 'vector)) ) @@ -100,7 +100,7 @@ ) ;; definition for method 14 of type trsqv -(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((this trsqv) (arg0 float)) +(defmethod set-yaw-angle-clear-roll-pitch! ((this trsqv) (arg0 float)) (let ((s5-0 (method-of-object this set-heading-vec-clear-roll-pitch!)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -113,12 +113,12 @@ ) ;; definition for method 15 of type trsqv -(defmethod set-roll-to-grav! trsqv ((this trsqv) (arg0 float)) +(defmethod set-roll-to-grav! ((this trsqv) (arg0 float)) (set-roll-to-grav-2! this arg0) ) ;; definition for method 16 of type trsqv -(defmethod set-roll-to-grav-2! trsqv ((this trsqv) (arg0 float)) +(defmethod set-roll-to-grav-2! ((this trsqv) (arg0 float)) (let* ((s5-0 (get-quaternion this)) (s1-0 (-> *standard-dynamics* gravity-normal)) (s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) s5-0)) @@ -135,7 +135,7 @@ ) ;; definition for method 25 of type trsqv -(defmethod roll-relative-to-gravity trsqv ((this trsqv)) +(defmethod roll-relative-to-gravity ((this trsqv)) (let* ((s5-0 (get-quaternion this)) (gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) s5-0)) (s5-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0)) @@ -155,7 +155,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod rotate-toward-orientation! trsqv ((this trsqv) (arg0 quaternion) (arg1 float) (arg2 float) (arg3 int) (arg4 int) (arg5 float)) +(defmethod rotate-toward-orientation! ((this trsqv) (arg0 quaternion) (arg1 float) (arg2 float) (arg3 int) (arg4 int) (arg5 float)) (local-vars (f0-4 float) (sv-192 (function quaternion vector vector float int quaternion)) @@ -222,7 +222,7 @@ ) ;; definition for method 19 of type trsqv -(defmethod set-heading-vec-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) +(defmethod set-heading-vec-clear-roll-pitch! ((this trsqv) (arg0 vector)) (forward-up->quaternion (get-quaternion this) (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) @@ -231,7 +231,7 @@ ) ;; definition for method 20 of type trsqv -(defmethod point-toward-point-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) +(defmethod point-toward-point-clear-roll-pitch! ((this trsqv) (arg0 vector)) (forward-up->quaternion (get-quaternion this) (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0) diff --git a/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc b/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc index 89036e8d893..1043423021a 100644 --- a/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc @@ -3,25 +3,22 @@ ;; definition of type bit-array (deftype bit-array (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (_pad uint8 :offset-assert 12) - (bytes uint8 :dynamic :offset 12) + ((length int32) + (allocated-length int32) + (_pad uint8) + (bytes uint8 :dynamic :overlay-at _pad) ) - :method-count-assert 13 - :size-assert #xd - :flag-assert #xd0000000d (:methods - (new (symbol type int) _type_ 0) - (get-bit (_type_ int) symbol 9) - (clear-bit (_type_ int) int 10) - (set-bit (_type_ int) int 11) - (clear-all! (_type_) _type_ 12) + (new (symbol type int) _type_) + (get-bit (_type_ int) symbol) + (clear-bit (_type_ int) int) + (set-bit (_type_ int) int) + (clear-all! (_type_) _type_) ) ) ;; definition for method 3 of type bit-array -(defmethod inspect bit-array ((this bit-array)) +(defmethod inspect ((this bit-array)) (when (not this) (set! this this) (goto cfg-4) @@ -43,37 +40,37 @@ ) ;; definition for method 4 of type bit-array -(defmethod length bit-array ((this bit-array)) +(defmethod length ((this bit-array)) (-> this length) ) ;; definition for method 5 of type bit-array ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of bit-array ((this bit-array)) +(defmethod asize-of ((this bit-array)) (the-as int (+ (-> this type size) (/ (logand -8 (+ (-> this allocated-length) 7)) 8))) ) ;; definition for method 9 of type bit-array -(defmethod get-bit bit-array ((this bit-array) (arg0 int)) +(defmethod get-bit ((this bit-array) (arg0 int)) (let ((v1-2 (-> this bytes (/ arg0 8)))) (logtest? v1-2 (ash 1 (logand arg0 7))) ) ) ;; definition for method 10 of type bit-array -(defmethod clear-bit bit-array ((this bit-array) (arg0 int)) +(defmethod clear-bit ((this bit-array) (arg0 int)) (logclear! (-> this bytes (/ arg0 8)) (ash 1 (logand arg0 7))) 0 ) ;; definition for method 11 of type bit-array -(defmethod set-bit bit-array ((this bit-array) (arg0 int)) +(defmethod set-bit ((this bit-array) (arg0 int)) (logior! (-> this bytes (/ arg0 8)) (ash 1 (logand arg0 7))) 0 ) ;; definition for method 12 of type bit-array -(defmethod clear-all! bit-array ((this bit-array)) +(defmethod clear-all! ((this bit-array)) (countdown (v1-2 (/ (logand -8 (+ (-> this allocated-length) 7)) 8)) (nop!) (nop!) @@ -84,17 +81,14 @@ ;; definition of type vector16ub (deftype vector16ub (structure) - ((data uint8 16 :offset-assert 0) - (quad uint128 :offset 0) + ((data uint8 16) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vector16ub ;; INFO: Used lq/sq -(defmethod inspect vector16ub ((this vector16ub)) +(defmethod inspect ((this vector16ub)) (when (not this) (set! this this) (goto cfg-4) @@ -108,21 +102,18 @@ ;; definition of type vector4ub (deftype vector4ub (structure) - ((data uint8 4 :offset-assert 0) - (x uint8 :offset 0) - (y uint8 :offset 1) - (z uint8 :offset 2) - (w uint8 :offset 3) - (clr uint32 :offset 0) + ((data uint8 4) + (x uint8 :overlay-at (-> data 0)) + (y uint8 :overlay-at (-> data 1)) + (z uint8 :overlay-at (-> data 2)) + (w uint8 :overlay-at (-> data 3)) + (clr uint32 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type vector4ub -(defmethod inspect vector4ub ((this vector4ub)) +(defmethod inspect ((this vector4ub)) (when (not this) (set! this this) (goto cfg-4) @@ -140,21 +131,18 @@ ;; definition of type vector4b (deftype vector4b (structure) - ((data int8 4 :offset-assert 0) - (x int8 :offset 0) - (y int8 :offset 1) - (z int8 :offset 2) - (w int8 :offset 3) - (clr int32 :offset 0) + ((data int8 4) + (x int8 :overlay-at (-> data 0)) + (y int8 :overlay-at (-> data 1)) + (z int8 :overlay-at (-> data 2)) + (w int8 :overlay-at (-> data 3)) + (clr int32 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type vector4b -(defmethod inspect vector4b ((this vector4b)) +(defmethod inspect ((this vector4b)) (when (not this) (set! this this) (goto cfg-4) @@ -172,19 +160,16 @@ ;; definition of type vector2ub (deftype vector2ub (structure) - ((data uint8 2 :offset-assert 0) - (x uint8 :offset 0) - (y uint8 :offset 1) - (clr uint16 :offset 0) + ((data uint8 2) + (x uint8 :overlay-at (-> data 0)) + (y uint8 :overlay-at (-> data 1)) + (clr uint16 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition for method 3 of type vector2ub -(defmethod inspect vector2ub ((this vector2ub)) +(defmethod inspect ((this vector2ub)) (when (not this) (set! this this) (goto cfg-4) @@ -200,18 +185,15 @@ ;; definition of type vector2b (deftype vector2b (structure) - ((data int8 2 :offset-assert 0) - (x int8 :offset 0) - (y int8 :offset 1) - (clr int16 :offset 0) + ((data int8 2) + (x int8 :overlay-at (-> data 0)) + (y int8 :overlay-at (-> data 1)) + (clr int16 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x2 - :flag-assert #x900000002 ) ;; definition for method 3 of type vector2b -(defmethod inspect vector2b ((this vector2b)) +(defmethod inspect ((this vector2b)) (when (not this) (set! this this) (goto cfg-4) @@ -227,18 +209,15 @@ ;; definition of type vector2h (deftype vector2h (structure) - ((data int16 2 :offset-assert 0) - (x int16 :offset 0) - (y int16 :offset 2) + ((data int16 2) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type vector2h -(defmethod inspect vector2h ((this vector2h)) +(defmethod inspect ((this vector2h)) (when (not this) (set! this this) (goto cfg-4) @@ -253,19 +232,16 @@ ;; definition of type vector2uh (deftype vector2uh (structure) - ((data uint16 2 :offset-assert 0) - (x uint16 :offset 0) - (y uint16 :offset 2) - (val uint32 :offset 0) + ((data uint16 2) + (x uint16 :overlay-at (-> data 0)) + (y uint16 :overlay-at (-> data 1)) + (val uint32 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type vector2uh -(defmethod inspect vector2uh ((this vector2uh)) +(defmethod inspect ((this vector2uh)) (when (not this) (set! this this) (goto cfg-4) @@ -281,18 +257,15 @@ ;; definition of type vector3h (deftype vector3h (structure) - ((data int16 3 :offset-assert 0) - (x int16 :offset 0) - (y int16 :offset 2) - (z int16 :offset 4) + ((data int16 3) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) ;; definition for method 3 of type vector3h -(defmethod inspect vector3h ((this vector3h)) +(defmethod inspect ((this vector3h)) (when (not this) (set! this this) (goto cfg-4) @@ -308,18 +281,15 @@ ;; definition of type vector3uh (deftype vector3uh (structure) - ((data uint16 3 :offset-assert 0) - (x uint16 :offset 0) - (y uint16 :offset 2) - (z uint16 :offset 4) + ((data uint16 3) + (x uint16 :overlay-at (-> data 0)) + (y uint16 :overlay-at (-> data 1)) + (z uint16 :overlay-at (-> data 2)) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) ;; definition for method 3 of type vector3uh -(defmethod inspect vector3uh ((this vector3uh)) +(defmethod inspect ((this vector3uh)) (when (not this) (set! this this) (goto cfg-4) @@ -335,17 +305,14 @@ ;; definition of type vector2w (deftype vector2w (structure) - ((data int32 2 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) + ((data int32 2) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type vector2w -(defmethod inspect vector2w ((this vector2w)) +(defmethod inspect ((this vector2w)) (when (not this) (set! this this) (goto cfg-4) @@ -360,18 +327,15 @@ ;; definition of type vector3w (deftype vector3w (structure) - ((data int32 3 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) - (z int32 :offset 8) + ((data int32 3) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) + (z int32 :overlay-at (-> data 2)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type vector3w -(defmethod inspect vector3w ((this vector3w)) +(defmethod inspect ((this vector3w)) (when (not this) (set! this this) (goto cfg-4) @@ -387,22 +351,19 @@ ;; definition of type vector4w (deftype vector4w (structure) - ((data int32 4 :offset-assert 0) - (x int32 :offset 0) - (y int32 :offset 4) - (z int32 :offset 8) - (w int32 :offset 12) - (dword uint64 2 :offset 0) - (quad uint128 :offset 0) + ((data int32 4) + (x int32 :overlay-at (-> data 0)) + (y int32 :overlay-at (-> data 1)) + (z int32 :overlay-at (-> data 2)) + (w int32 :overlay-at (-> data 3)) + (dword uint64 2 :overlay-at (-> data 0)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vector4w ;; INFO: Used lq/sq -(defmethod inspect vector4w ((this vector4w)) +(defmethod inspect ((this vector4w)) (when (not this) (set! this this) (goto cfg-4) @@ -421,18 +382,15 @@ ;; definition of type vector2 (deftype vector2 (structure) - ((data float 2 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) + ((data float 2) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type vector2 -(defmethod inspect vector2 ((this vector2)) +(defmethod inspect ((this vector2)) (when (not this) (set! this this) (goto cfg-4) @@ -447,18 +405,15 @@ ;; definition of type vector3 (deftype vector3 (structure) - ((data float 3 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) + ((data float 3) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) + (z float :overlay-at (-> data 2)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type vector3 -(defmethod inspect vector3 ((this vector3)) +(defmethod inspect ((this vector3)) (when (not this) (set! this this) (goto cfg-4) @@ -474,22 +429,19 @@ ;; definition of type vector4 (deftype vector4 (structure) - ((data float 4 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (w float :offset 12) - (dword uint64 2 :offset 0) - (quad uint128 :offset 0) + ((data float 4) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) + (z float :overlay-at (-> data 2)) + (w float :overlay-at (-> data 3)) + (dword uint64 2 :overlay-at (-> data 0)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vector4 ;; INFO: Used lq/sq -(defmethod inspect vector4 ((this vector4)) +(defmethod inspect ((this vector4)) (when (not this) (set! this this) (goto cfg-4) @@ -507,24 +459,21 @@ ) ;; definition for method 2 of type vector4w -(defmethod print vector4w ((this vector4w)) +(defmethod print ((this vector4w)) (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) this ) ;; definition of type vector4w-2 (deftype vector4w-2 (structure) - ((data int32 8 :offset-assert 0) - (quad uint128 2 :offset 0) - (vector vector4w 2 :inline :offset 0) + ((data int32 8) + (quad uint128 2 :overlay-at (-> data 0)) + (vector vector4w 2 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type vector4w-2 -(defmethod inspect vector4w-2 ((this vector4w-2)) +(defmethod inspect ((this vector4w-2)) (when (not this) (set! this this) (goto cfg-4) @@ -539,17 +488,14 @@ ;; definition of type vector4w-3 (deftype vector4w-3 (structure) - ((data int32 12 :offset-assert 0) - (quad uint128 3 :offset 0) - (vector vector4w 3 :inline :offset 0) + ((data int32 12) + (quad uint128 3 :overlay-at (-> data 0)) + (vector vector4w 3 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type vector4w-3 -(defmethod inspect vector4w-3 ((this vector4w-3)) +(defmethod inspect ((this vector4w-3)) (when (not this) (set! this this) (goto cfg-4) @@ -564,17 +510,14 @@ ;; definition of type vector4w-4 (deftype vector4w-4 (structure) - ((data int32 16 :offset-assert 0) - (quad uint128 4 :offset 0) - (vector vector4w 4 :inline :offset 0) + ((data int32 16) + (quad uint128 4 :overlay-at (-> data 0)) + (vector vector4w 4 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type vector4w-4 -(defmethod inspect vector4w-4 ((this vector4w-4)) +(defmethod inspect ((this vector4w-4)) (when (not this) (set! this this) (goto cfg-4) @@ -589,21 +532,18 @@ ;; definition of type vector4h (deftype vector4h (structure) - ((data int16 4 :offset-assert 0) - (x int16 :offset 0) - (y int16 :offset 2) - (z int16 :offset 4) - (w int16 :offset 6) - (long uint64 :offset 0) + ((data int16 4) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) + (w int16 :overlay-at (-> data 3)) + (long uint64 :overlay-at (-> data 0)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type vector4h -(defmethod inspect vector4h ((this vector4h)) +(defmethod inspect ((this vector4h)) (when (not this) (set! this this) (goto cfg-4) @@ -621,17 +561,14 @@ ;; definition of type vector8h (deftype vector8h (structure) - ((data int16 8 :offset-assert 0) - (quad uint128 :offset 0) + ((data int16 8) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vector8h ;; INFO: Used lq/sq -(defmethod inspect vector8h ((this vector8h)) +(defmethod inspect ((this vector8h)) (when (not this) (set! this this) (goto cfg-4) @@ -645,17 +582,14 @@ ;; definition of type vector16b (deftype vector16b (structure) - ((data int8 16 :offset-assert 0) - (quad uint128 :offset 0) + ((data int8 16) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vector16b ;; INFO: Used lq/sq -(defmethod inspect vector16b ((this vector16b)) +(defmethod inspect ((this vector16b)) (when (not this) (set! this this) (goto cfg-4) @@ -668,14 +602,14 @@ ) ;; definition for method 3 of type vector -(defmethod inspect vector ((this vector)) +(defmethod inspect ((this vector)) (format #t "[~8x] vector~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w)) this ) ;; definition for method 2 of type vector -(defmethod print vector ((this vector)) +(defmethod print ((this vector)) (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) this ) @@ -700,17 +634,14 @@ ;; definition of type vector4s-3 (deftype vector4s-3 (structure) - ((data float 12 :offset-assert 0) - (quad uint128 3 :offset 0) - (vector vector 3 :inline :offset 0) + ((data float 12) + (quad uint128 3 :overlay-at (-> data 0)) + (vector vector 3 :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type vector4s-3 -(defmethod inspect vector4s-3 ((this vector4s-3)) +(defmethod inspect ((this vector4s-3)) (when (not this) (set! this this) (goto cfg-4) @@ -725,15 +656,12 @@ ;; definition of type vector-array (deftype vector-array (inline-array-class) - ((data vector :inline :dynamic :offset-assert 16) + ((data vector :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vector-array -(defmethod inspect vector-array ((this vector-array)) +(defmethod inspect ((this vector-array)) (when (not this) (set! this this) (goto cfg-4) @@ -751,19 +679,16 @@ ;; definition of type rgbaf (deftype rgbaf (vector) - ((r float :offset 0) - (g float :offset 4) - (b float :offset 8) - (a float :offset 12) + ((r float :overlay-at (-> data 0)) + (g float :overlay-at (-> data 1)) + (b float :overlay-at (-> data 2)) + (a float :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type rgbaf ;; INFO: Used lq/sq -(defmethod inspect rgbaf ((this rgbaf)) +(defmethod inspect ((this rgbaf)) (when (not this) (set! this this) (goto cfg-4) @@ -785,19 +710,16 @@ ;; definition of type plane (deftype plane (vector) - ((a float :offset 0) - (b float :offset 4) - (c float :offset 8) - (d float :offset 12) + ((a float :overlay-at (-> data 0)) + (b float :overlay-at (-> data 1)) + (c float :overlay-at (-> data 2)) + (d float :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type plane ;; INFO: Used lq/sq -(defmethod inspect plane ((this plane)) +(defmethod inspect ((this plane)) (when (not this) (set! this this) (goto cfg-4) @@ -819,16 +741,13 @@ ;; definition of type sphere (deftype sphere (vector) - ((r float :offset 12) + ((r float :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type sphere ;; INFO: Used lq/sq -(defmethod inspect sphere ((this sphere)) +(defmethod inspect ((this sphere)) (when (not this) (set! this this) (goto cfg-4) @@ -848,26 +767,20 @@ ;; definition of type isphere (deftype isphere (vec4s) () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition of type box8s (deftype box8s (structure) - ((data float 8 :offset-assert 0) - (quad uint128 2 :offset 0) - (vector vector 2 :offset 0) - (min vector :inline :offset 0) - (max vector :inline :offset 16) + ((data float 8) + (quad uint128 2 :overlay-at (-> data 0)) + (vector vector 2 :overlay-at (-> data 0)) + (min vector :inline :overlay-at (-> data 0)) + (max vector :inline :overlay-at (-> data 4)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type box8s -(defmethod inspect box8s ((this box8s)) +(defmethod inspect ((this box8s)) (when (not this) (set! this this) (goto cfg-4) @@ -884,15 +797,12 @@ ;; definition of type box8s-array (deftype box8s-array (inline-array-class) - ((data box8s :inline :dynamic :offset-assert 16) + ((data box8s :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type box8s-array -(defmethod inspect box8s-array ((this box8s-array)) +(defmethod inspect ((this box8s-array)) (when (not this) (set! this this) (goto cfg-4) @@ -910,22 +820,19 @@ ;; definition of type cylinder (deftype cylinder (structure) - ((origin vector :inline :offset-assert 0) - (axis vector :inline :offset-assert 16) - (radius float :offset-assert 32) - (length float :offset-assert 36) + ((origin vector :inline) + (axis vector :inline) + (radius float) + (length float) ) - :method-count-assert 11 - :size-assert #x28 - :flag-assert #xb00000028 (:methods - (debug-draw (_type_ vector4w) none 9) - (ray-capsule-intersect (_type_ vector vector) float 10) + (debug-draw (_type_ vector4w) none) + (ray-capsule-intersect (_type_ vector vector) float) ) ) ;; definition for method 3 of type cylinder -(defmethod inspect cylinder ((this cylinder)) +(defmethod inspect ((this cylinder)) (when (not this) (set! this this) (goto cfg-4) @@ -941,22 +848,19 @@ ;; definition of type cylinder-flat (deftype cylinder-flat (structure) - ((origin vector :inline :offset-assert 0) - (axis vector :inline :offset-assert 16) - (radius float :offset-assert 32) - (length float :offset-assert 36) + ((origin vector :inline) + (axis vector :inline) + (radius float) + (length float) ) - :method-count-assert 11 - :size-assert #x28 - :flag-assert #xb00000028 (:methods - (debug-draw (_type_ vector4w) none 9) - (ray-flat-cyl-intersect (_type_ vector vector) float 10) + (debug-draw (_type_ vector4w) none) + (ray-flat-cyl-intersect (_type_ vector vector) float) ) ) ;; definition for method 3 of type cylinder-flat -(defmethod inspect cylinder-flat ((this cylinder-flat)) +(defmethod inspect ((this cylinder-flat)) (when (not this) (set! this this) (goto cfg-4) @@ -972,15 +876,12 @@ ;; definition of type vertical-planes (deftype vertical-planes (structure) - ((data uint128 4 :offset-assert 0) + ((data uint128 4) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type vertical-planes -(defmethod inspect vertical-planes ((this vertical-planes)) +(defmethod inspect ((this vertical-planes)) (when (not this) (set! this this) (goto cfg-4) @@ -993,16 +894,13 @@ ;; definition of type vertical-planes-array (deftype vertical-planes-array (basic) - ((length uint32 :offset-assert 4) - (data vertical-planes :inline :dynamic :offset-assert 16) + ((length uint32) + (data vertical-planes :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vertical-planes-array -(defmethod inspect vertical-planes-array ((this vertical-planes-array)) +(defmethod inspect ((this vertical-planes-array)) (when (not this) (set! this this) (goto cfg-4) @@ -1016,23 +914,20 @@ ;; definition of type qword (deftype qword (structure) - ((data uint32 4 :offset-assert 0) - (byte uint8 16 :offset 0) - (hword uint16 8 :offset 0) - (word uint32 4 :offset 0) - (dword uint64 2 :offset 0) - (quad uint128 :offset 0) - (vector vector :inline :offset 0) - (vector4w vector4w :inline :offset 0) + ((data uint32 4) + (byte uint8 16 :overlay-at (-> data 0)) + (hword uint16 8 :overlay-at (-> data 0)) + (word uint32 4 :overlay-at (-> data 0)) + (dword uint64 2 :overlay-at (-> data 0)) + (quad uint128 :overlay-at (-> data 0)) + (vector vector :inline :overlay-at (-> data 0)) + (vector4w vector4w :inline :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type qword ;; INFO: Used lq/sq -(defmethod inspect qword ((this qword)) +(defmethod inspect ((this qword)) (when (not this) (set! this this) (goto cfg-4) @@ -1052,19 +947,16 @@ ;; definition of type vector3s (deftype vector3s (structure) - ((data float 3 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) + ((data float 3) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) + (z float :overlay-at (-> data 2)) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type vector3s -(defmethod inspect vector3s ((this vector3s)) +(defmethod inspect ((this vector3s)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/math/vector_REF.gc b/test/decompiler/reference/jak2/engine/math/vector_REF.gc index fadc37c07e5..ac35fb864bc 100644 --- a/test/decompiler/reference/jak2/engine/math/vector_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/vector_REF.gc @@ -1508,7 +1508,7 @@ ) ;; definition for method 2 of type vector2 -(defmethod print vector2 ((this vector2)) +(defmethod print ((this vector2)) (format #t "#" (-> this x) (-> this y) this) this ) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc index 48dbb9ff506..81072304800 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type check-vector-collision-with-nav-spheres-info (deftype check-vector-collision-with-nav-spheres-info (structure) - ((u float :offset-assert 0) - (intersect vector :inline :offset-assert 16) - (normal vector :inline :offset-assert 32) + ((u float) + (intersect vector :inline) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type check-vector-collision-with-nav-spheres-info -(defmethod inspect check-vector-collision-with-nav-spheres-info ((this check-vector-collision-with-nav-spheres-info)) +(defmethod inspect ((this check-vector-collision-with-nav-spheres-info)) (when (not this) (set! this this) (goto cfg-4) @@ -28,16 +25,13 @@ ;; definition of type nav-gap-info (deftype nav-gap-info (structure) - ((dest vector :inline :offset-assert 0) - (poly nav-poly :offset-assert 16) + ((dest vector :inline) + (poly nav-poly) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type nav-gap-info -(defmethod inspect nav-gap-info ((this nav-gap-info)) +(defmethod inspect ((this nav-gap-info)) (when (not this) (set! this this) (goto cfg-4) @@ -51,20 +45,17 @@ ;; definition of type nav-avoid-spheres-params (deftype nav-avoid-spheres-params (structure) - ((current-pos vector :inline :offset-assert 0) - (travel vector :inline :offset-assert 16) - (pref-dir vector :inline :offset-assert 32) - (out-travel vector 2 :inline :offset-assert 48) - (closest-sphere-dist2 float :offset-assert 80) - (avoiding-sphere? symbol :offset-assert 84) + ((current-pos vector :inline) + (travel vector :inline) + (pref-dir vector :inline) + (out-travel vector 2 :inline) + (closest-sphere-dist2 float) + (avoiding-sphere? symbol) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) ;; definition for method 3 of type nav-avoid-spheres-params -(defmethod inspect nav-avoid-spheres-params ((this nav-avoid-spheres-params)) +(defmethod inspect ((this nav-avoid-spheres-params)) (when (not this) (set! this this) (goto cfg-4) @@ -82,16 +73,13 @@ ;; definition of type nav-callback-info (deftype nav-callback-info (structure) - ((callback-count int32 :offset-assert 0) - (callback-array (function object nav-control none) 10 :offset-assert 4) + ((callback-count int32) + (callback-array (function object nav-control none) 10) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type nav-callback-info -(defmethod inspect nav-callback-info ((this nav-callback-info)) +(defmethod inspect ((this nav-callback-info)) (when (not this) (set! this this) (goto cfg-4) @@ -105,83 +93,80 @@ ;; definition of type nav-state (deftype nav-state (structure) - ((flags nav-state-flag :offset-assert 0) - (nav nav-control :offset-assert 4) - (user-poly nav-poly :offset-assert 8) - (mesh nav-mesh :offset-assert 12) - (current-poly nav-poly :offset-assert 16) - (virtual-current-poly nav-poly :offset-assert 20) - (next-poly nav-poly :offset-assert 24) - (target-poly nav-poly :offset-assert 28) - (rotation-rate float :offset-assert 32) - (speed meters :offset-assert 36) - (prev-speed meters :offset-assert 40) - (pad0 uint32 1 :offset-assert 44) - (travel vector :inline :offset-assert 48) - (target-post vector :inline :offset-assert 64) - (current-pos vector :inline :offset-assert 80) - (current-pos-local vector :inline :offset-assert 96) - (virtual-current-pos-local vector :inline :offset-assert 112) - (velocity vector :inline :offset-assert 128) - (heading vector :inline :offset-assert 144) - (target-dir vector :inline :offset-assert 160) - (accel vector :inline :offset 160) + ((flags nav-state-flag) + (nav nav-control) + (user-poly nav-poly) + (mesh nav-mesh) + (current-poly nav-poly) + (virtual-current-poly nav-poly) + (next-poly nav-poly) + (target-poly nav-poly) + (rotation-rate float) + (speed meters) + (prev-speed meters) + (pad0 uint32 1) + (travel vector :inline) + (target-post vector :inline) + (current-pos vector :inline) + (current-pos-local vector :inline) + (virtual-current-pos-local vector :inline) + (velocity vector :inline) + (heading vector :inline) + (target-dir vector :inline) + (accel vector :inline :overlay-at target-dir) ) - :method-count-assert 55 - :size-assert #xb0 - :flag-assert #x37000000b0 (:methods - (debug-draw (_type_) none 9) - (nav-state-method-10 (_type_) none 10) - (plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol 11) - (get-velocity (_type_ vector) vector 12) - (get-travel (_type_ vector) vector 13) - (get-heading (_type_ vector) vector 14) - (get-target-post (_type_ vector) vector 15) - (get-speed (_type_) meters 16) - (get-rotation-rate (_type_) float 17) - (try-projecting-to-current-poly (_type_ vector object vector) symbol 18) - (get-current-poly (_type_) nav-poly 19) - (copy-nav-state! (_type_ (pointer nav-state)) none 20) - (nav-state-method-21 () none 21) - (nav-state-method-22 () none 22) - (nav-state-method-23 () none 23) - (turn-and-navigate-to-destination (_type_) none 24) - (navigate-using-route-portals-wrapper (_type_) none 25) - (navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none 26) - (navigate-within-poly-wrapper (_type_) none 27) - (compute-travel-speed (_type_) none 28) - (nav-state-method-29 (_type_) none 29) - (nav-state-method-30 (_type_) none 30) - (navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none 31) - (update-travel-dir-from-spheres (_type_) none 32) - (compute-speed-simple (_type_) none 33) - (navigate-v1! (_type_) none 34) - (reset-target! (_type_) none 35) - (add-offset-to-target! (_type_ vector) none 36) - (navigate-v2! (_type_) none 37) - (set-current-poly! (_type_ nav-poly) none 38) - (nav-state-method-39 (_type_) symbol 39) - (do-navigation-to-destination (_type_ vector) none 40) - (clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol 41) - (set-target-post! (_type_ vector) none 42) - (set-travel! (_type_ vector) none 43) - (set-velocity! (_type_ vector) none 44) - (set-heading! (_type_ vector) none 45) - (set-speed! (_type_ meters) none 46) - (reset! (_type_ nav-control) none 47) - (nav-state-method-48 () none 48) - (navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none 49) - (nav-state-method-50 (_type_) none 50) - (navigate-using-route-portals (_type_) none 51) - (navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none 52) - (navigate-within-poly (_type_) none 53) - (clamp-travel-vector (_type_) none 54) + (debug-draw (_type_) none) + (nav-state-method-10 (_type_) none) + (plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol) + (get-velocity (_type_ vector) vector) + (get-travel (_type_ vector) vector) + (get-heading (_type_ vector) vector) + (get-target-post (_type_ vector) vector) + (get-speed (_type_) meters) + (get-rotation-rate (_type_) float) + (try-projecting-to-current-poly (_type_ vector object vector) symbol) + (get-current-poly (_type_) nav-poly) + (copy-nav-state! (_type_ (pointer nav-state)) none) + (nav-state-method-21 () none) + (nav-state-method-22 () none) + (nav-state-method-23 () none) + (turn-and-navigate-to-destination (_type_) none) + (navigate-using-route-portals-wrapper (_type_) none) + (navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none) + (navigate-within-poly-wrapper (_type_) none) + (compute-travel-speed (_type_) none) + (nav-state-method-29 (_type_) none) + (nav-state-method-30 (_type_) none) + (navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none) + (update-travel-dir-from-spheres (_type_) none) + (compute-speed-simple (_type_) none) + (navigate-v1! (_type_) none) + (reset-target! (_type_) none) + (add-offset-to-target! (_type_ vector) none) + (navigate-v2! (_type_) none) + (set-current-poly! (_type_ nav-poly) none) + (nav-state-method-39 (_type_) symbol) + (do-navigation-to-destination (_type_ vector) none) + (clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol) + (set-target-post! (_type_ vector) none) + (set-travel! (_type_ vector) none) + (set-velocity! (_type_ vector) none) + (set-heading! (_type_ vector) none) + (set-speed! (_type_ meters) none) + (reset! (_type_ nav-control) none) + (nav-state-method-48 () none) + (navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none) + (nav-state-method-50 (_type_) none) + (navigate-using-route-portals (_type_) none) + (navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none) + (navigate-within-poly (_type_) none) + (clamp-travel-vector (_type_) none) ) ) ;; definition for method 3 of type nav-state -(defmethod inspect nav-state ((this nav-state)) +(defmethod inspect ((this nav-state)) (when (not this) (set! this this) (goto cfg-34) @@ -262,76 +247,73 @@ ;; definition of type nav-control (deftype nav-control (structure) - ((flags nav-control-flag :offset-assert 0) - (callback-info nav-callback-info :offset-assert 4) - (process process :offset-assert 8) - (pad0 uint32 :offset-assert 12) - (shape collide-shape :offset-assert 16) - (nearest-y-threshold meters :offset-assert 20) - (nav-cull-radius meters :offset-assert 24) - (sec-per-frame float :offset-assert 28) - (target-speed meters :offset-assert 32) - (acceleration meters :offset-assert 36) - (turning-acceleration meters :offset-assert 40) - (max-rotation-rate float :offset-assert 44) - (speed-scale float :offset-assert 48) - (sphere-count int32 :offset-assert 52) - (sphere-array (inline-array sphere) :offset-assert 56) - (root-sphere-id uint8 :offset-assert 60) - (sphere-mask uint8 :offset-assert 61) - (pad1 uint8 2 :offset-assert 62) - (sphere-id-array uint8 16 :offset-assert 64) - (extra-nav-sphere vector :inline :offset-assert 80) - (root-nav-sphere vector :inline :offset-assert 96) - (state nav-state :inline :offset-assert 112) + ((flags nav-control-flag) + (callback-info nav-callback-info) + (process process) + (pad0 uint32) + (shape collide-shape) + (nearest-y-threshold meters) + (nav-cull-radius meters) + (sec-per-frame float) + (target-speed meters) + (acceleration meters) + (turning-acceleration meters) + (max-rotation-rate float) + (speed-scale float) + (sphere-count int32) + (sphere-array (inline-array sphere)) + (root-sphere-id uint8) + (sphere-mask uint8) + (pad1 uint8 2) + (sphere-id-array uint8 16) + (extra-nav-sphere vector :inline) + (root-nav-sphere vector :inline) + (state nav-state :inline) ) - :method-count-assert 47 - :size-assert #x120 - :flag-assert #x2f00000120 (:methods - (debug-draw (_type_) none 9) - (point-in-bsphere? (_type_ vector) symbol 10) - (find-poly-containing-point-1 (_type_ vector) nav-poly 11) - (cloest-point-on-mesh (_type_ vector vector nav-poly) nav-poly 12) - (find-nearest-poly-to-point (_type_ vector) nav-poly 13) - (project-point-onto-plane-of-poly (_type_ nav-poly vector vector vector) none 14) - (find-poly-containing-point-2 (_type_ vector) nav-poly 15) - (is-above-poly-max-height? (_type_ vector float) symbol 16) - (is-in-mesh? (_type_ vector float) symbol 17) - (avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol 18) - (avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol 19) - (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 20) - (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none 21) - (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float 22) - (set-spheres-from-nav-ids (_type_) none 23) - (add-root-sphere-to-hash! (_type_ vector int) symbol 24) - (get-max-rotation-rate (_type_) float 25) - (get-sphere-mask (_type_) uint 26) - (get-target-speed (_type_) meters 27) - (enable-extra-sphere! (_type_) none 28) - (disable-extra-sphere! (_type_) none 29) - (copy-extra-nav-sphere! (_type_ sphere) none 30) - (set-extra-nav-sphere-xyz! (_type_ sphere) none 31) - (set-extra-nav-sphere-radius! (_type_ float) none 32) - (set-nearest-y-thres! (_type_ float) none 33) - (set-nav-cull-radius! (_type_ meters) none 34) - (set-speed-scale! (_type_ float) none 35) - (set-target-speed! (_type_ meters) none 36) - (set-acceleration! (_type_ meters) none 37) - (set-turning-acceleration! (_type_ meters) none 38) - (set-max-rotation-rate! (_type_ float) none 39) - (set-sphere-mask! (_type_ uint) none 40) - (remove! (_type_) none 41) - (init! (_type_ collide-shape) none 42) - (display-marks? (_type_) symbol 43) - (nav-control-method-44 () none 44) - (find-first-sphere-intersecting-ray (_type_ vector vector vector) sphere 45) - (find-sphere-ids-from-sphere-hash (_type_ symbol) none 46) + (debug-draw (_type_) none) + (point-in-bsphere? (_type_ vector) symbol) + (find-poly-containing-point-1 (_type_ vector) nav-poly) + (cloest-point-on-mesh (_type_ vector vector nav-poly) nav-poly) + (find-nearest-poly-to-point (_type_ vector) nav-poly) + (project-point-onto-plane-of-poly (_type_ nav-poly vector vector vector) none) + (find-poly-containing-point-2 (_type_ vector) nav-poly) + (is-above-poly-max-height? (_type_ vector float) symbol) + (is-in-mesh? (_type_ vector float) symbol) + (avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol) + (avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) + (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float) + (set-spheres-from-nav-ids (_type_) none) + (add-root-sphere-to-hash! (_type_ vector int) symbol) + (get-max-rotation-rate (_type_) float) + (get-sphere-mask (_type_) uint) + (get-target-speed (_type_) meters) + (enable-extra-sphere! (_type_) none) + (disable-extra-sphere! (_type_) none) + (copy-extra-nav-sphere! (_type_ sphere) none) + (set-extra-nav-sphere-xyz! (_type_ sphere) none) + (set-extra-nav-sphere-radius! (_type_ float) none) + (set-nearest-y-thres! (_type_ float) none) + (set-nav-cull-radius! (_type_ meters) none) + (set-speed-scale! (_type_ float) none) + (set-target-speed! (_type_ meters) none) + (set-acceleration! (_type_ meters) none) + (set-turning-acceleration! (_type_ meters) none) + (set-max-rotation-rate! (_type_ float) none) + (set-sphere-mask! (_type_ uint) none) + (remove! (_type_) none) + (init! (_type_ collide-shape) none) + (display-marks? (_type_) symbol) + (nav-control-method-44 () none) + (find-first-sphere-intersecting-ray (_type_ vector vector vector) sphere) + (find-sphere-ids-from-sphere-hash (_type_ symbol) none) ) ) ;; definition for method 3 of type nav-control -(defmethod inspect nav-control ((this nav-control)) +(defmethod inspect ((this nav-control)) (when (not this) (set! this this) (goto cfg-25) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc index 94659f057d8..9fb5475eef4 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc @@ -27,7 +27,7 @@ ) ;; definition for method 7 of type nav-control -(defmethod relocate nav-control ((this nav-control) (arg0 int)) +(defmethod relocate ((this nav-control) (arg0 int)) (&+! (-> this process) arg0) (&+! (-> this shape) arg0) this @@ -35,7 +35,7 @@ ;; definition for method 41 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod remove! nav-control ((this nav-control)) +(defmethod remove! ((this nav-control)) "Remove this nav-control from the nav-mesh it belongs to." (remove-nav-control (-> this state mesh) this) 0 @@ -44,7 +44,7 @@ ;; definition for method 28 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod enable-extra-sphere! nav-control ((this nav-control)) +(defmethod enable-extra-sphere! ((this nav-control)) "Sets a flag indicating that this nav-control has an extra-nav-sphere." (logior! (-> this shape nav-flags) (nav-flags has-extra-sphere)) 0 @@ -53,7 +53,7 @@ ;; definition for method 29 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod disable-extra-sphere! nav-control ((this nav-control)) +(defmethod disable-extra-sphere! ((this nav-control)) "Clears a flag indicating that this nav-control has an extra-nav-sphere." (logclear! (-> this shape nav-flags) (nav-flags has-extra-sphere)) 0 @@ -62,7 +62,7 @@ ;; definition for method 30 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod copy-extra-nav-sphere! nav-control ((this nav-control) (arg0 sphere)) +(defmethod copy-extra-nav-sphere! ((this nav-control) (arg0 sphere)) "Copies the given [[sphere]] into `extra-nav-sphere`" (mem-copy! (the-as pointer (-> this extra-nav-sphere)) (the-as pointer arg0) 16) 0 @@ -72,7 +72,7 @@ ;; definition for method 31 of type nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-extra-nav-sphere-xyz! nav-control ((this nav-control) (arg0 sphere)) +(defmethod set-extra-nav-sphere-xyz! ((this nav-control) (arg0 sphere)) "Set the `extra-nav-sphere` with the data in the given [[sphere]]" (let ((f0-0 (-> this extra-nav-sphere w))) (set! (-> this extra-nav-sphere quad) (-> arg0 quad)) @@ -84,7 +84,7 @@ ;; definition for method 32 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-extra-nav-sphere-radius! nav-control ((this nav-control) (arg0 float)) +(defmethod set-extra-nav-sphere-radius! ((this nav-control) (arg0 float)) "Set's `extra-nav-sphere`'s radius" (set! (-> this extra-nav-sphere w) arg0) 0 @@ -93,7 +93,7 @@ ;; definition for method 33 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-nearest-y-thres! nav-control ((this nav-control) (arg0 float)) +(defmethod set-nearest-y-thres! ((this nav-control) (arg0 float)) "Set `nearest-y-threshold`" (set! (-> this nearest-y-threshold) arg0) 0 @@ -102,7 +102,7 @@ ;; definition for method 34 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-nav-cull-radius! nav-control ((this nav-control) (arg0 meters)) +(defmethod set-nav-cull-radius! ((this nav-control) (arg0 meters)) "Set `nav-cull-radius`" (set! (-> this nav-cull-radius) arg0) 0 @@ -111,7 +111,7 @@ ;; definition for method 35 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-speed-scale! nav-control ((this nav-control) (arg0 float)) +(defmethod set-speed-scale! ((this nav-control) (arg0 float)) "Set `speed-scale`" (set! (-> this speed-scale) arg0) 0 @@ -120,7 +120,7 @@ ;; definition for method 36 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-target-speed! nav-control ((this nav-control) (arg0 meters)) +(defmethod set-target-speed! ((this nav-control) (arg0 meters)) "Set `target-speed`" (set! (-> this target-speed) arg0) 0 @@ -128,13 +128,13 @@ ) ;; definition for method 27 of type nav-control -(defmethod get-target-speed nav-control ((this nav-control)) +(defmethod get-target-speed ((this nav-control)) (-> this target-speed) ) ;; definition for method 37 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-acceleration! nav-control ((this nav-control) (arg0 meters)) +(defmethod set-acceleration! ((this nav-control) (arg0 meters)) "Set `acceleration`" (set! (-> this acceleration) arg0) 0 @@ -143,7 +143,7 @@ ;; definition for method 38 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-turning-acceleration! nav-control ((this nav-control) (arg0 meters)) +(defmethod set-turning-acceleration! ((this nav-control) (arg0 meters)) "Set `turning-acceleration`" (set! (-> this turning-acceleration) arg0) 0 @@ -152,7 +152,7 @@ ;; definition for method 39 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-max-rotation-rate! nav-control ((this nav-control) (arg0 float)) +(defmethod set-max-rotation-rate! ((this nav-control) (arg0 float)) "Set `max-rotation-rate`" (set! (-> this max-rotation-rate) arg0) 0 @@ -160,13 +160,13 @@ ) ;; definition for method 25 of type nav-control -(defmethod get-max-rotation-rate nav-control ((this nav-control)) +(defmethod get-max-rotation-rate ((this nav-control)) (-> this max-rotation-rate) ) ;; definition for method 40 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-sphere-mask! nav-control ((this nav-control) (arg0 uint)) +(defmethod set-sphere-mask! ((this nav-control) (arg0 uint)) "TODO - probably an enum - Set `sphere-mask`" (set! (-> this sphere-mask) arg0) 0 @@ -174,12 +174,12 @@ ) ;; definition for method 26 of type nav-control -(defmethod get-sphere-mask nav-control ((this nav-control)) +(defmethod get-sphere-mask ((this nav-control)) (-> this sphere-mask) ) ;; definition for method 10 of type nav-control -(defmethod point-in-bsphere? nav-control ((this nav-control) (arg0 vector)) +(defmethod point-in-bsphere? ((this nav-control) (arg0 vector)) "Is the given point ([[vector]]) outside of the [[nav-mesh]]'s `bounds` [[sphere]] radius" (let ((v1-1 (-> this state mesh bounds))) (>= (-> v1-1 w) (vector-vector-distance arg0 v1-1)) @@ -187,14 +187,14 @@ ) ;; definition for method 43 of type nav-control -(defmethod display-marks? nav-control ((this nav-control)) +(defmethod display-marks? ((this nav-control)) "Returns if navigation related marks should be displayed" (and *display-nav-marks* (logtest? (-> this flags) (nav-control-flag display-marks))) ) ;; definition for method 42 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod init! nav-control ((this nav-control) (arg0 collide-shape)) +(defmethod init! ((this nav-control) (arg0 collide-shape)) "Initializes the [[nav-control]], setting `shape` with the provided [[collide-shape]]" (set! (-> this callback-info) #f) (logior! (-> this flags) (nav-control-flag update-heading-from-facing output-sphere-hash)) @@ -241,7 +241,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 13 of type nav-control -(defmethod find-nearest-poly-to-point nav-control ((this nav-control) (arg0 vector)) +(defmethod find-nearest-poly-to-point ((this nav-control) (arg0 vector)) "Find the nav-poly closest to this point in the nav-mesh." (let ((gp-0 (new 'stack 'nav-find-poly-parms))) (vector-! (-> gp-0 point) arg0 (-> this state mesh bounds)) @@ -254,7 +254,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 14 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod project-point-onto-plane-of-poly nav-control ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod project-point-onto-plane-of-poly ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) "Move a point to the be on the plane containing the given nav-poly. Return the normal too" (project-point-onto-plane-of-poly-local (-> this state mesh) @@ -269,7 +269,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 17 of type nav-control -(defmethod is-in-mesh? nav-control ((this nav-control) (arg0 vector) (arg1 float)) +(defmethod is-in-mesh? ((this nav-control) (arg0 vector) (arg1 float)) "Is this point in the mesh?" (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> this state mesh bounds)) @@ -281,7 +281,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 9 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw nav-control ((this nav-control)) +(defmethod debug-draw ((this nav-control)) (local-vars (sv-32 nav-mesh) (sv-36 vector)) (when (display-marks? this) (debug-draw (-> this state mesh)) @@ -336,7 +336,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 11 of type nav-control -(defmethod find-poly-containing-point-1 nav-control ((this nav-control) (arg0 vector)) +(defmethod find-poly-containing-point-1 ((this nav-control) (arg0 vector)) "Find nav-poly containing this point." (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) (vector-! (-> v1-0 point) arg0 (-> this state mesh bounds)) @@ -347,7 +347,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 15 of type nav-control -(defmethod find-poly-containing-point-2 nav-control ((this nav-control) (arg0 vector)) +(defmethod find-poly-containing-point-2 ((this nav-control) (arg0 vector)) "Find nav-poly containing this point - same as 1" (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) (vector-! (-> v1-0 point) arg0 (-> this state mesh bounds)) @@ -359,7 +359,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 16 of type nav-control ;; WARN: Return type mismatch object vs symbol. -(defmethod is-above-poly-max-height? nav-control ((this nav-control) (arg0 vector) (arg1 float)) +(defmethod is-above-poly-max-height? ((this nav-control) (arg0 vector) (arg1 float)) "Is the point in a poly, and lower than a max height?" (let ((a1-1 (new 'stack-no-clear 'nav-find-poly-parms))) (vector-! (-> a1-1 point) arg0 (-> this state mesh bounds)) @@ -373,7 +373,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 45 of type nav-control -(defmethod find-first-sphere-intersecting-ray nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod find-first-sphere-intersecting-ray ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) "Find the first sphere that this ray intersects" (let ((s5-0 (the-as sphere #f))) (let ((f30-0 -0.000001)) @@ -519,7 +519,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 46 of type nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod find-sphere-ids-from-sphere-hash nav-control ((this nav-control) (arg0 symbol)) +(defmethod find-sphere-ids-from-sphere-hash ((this nav-control) (arg0 symbol)) "Use sphere-hash to look up navigation sphere IDs and save them." (let ((s5-0 (new 'stack-no-clear 'find-nav-sphere-ids-params))) (set! (-> s5-0 bsphere quad) (-> this root-nav-sphere quad)) @@ -537,7 +537,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 23 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-spheres-from-nav-ids nav-control ((this nav-control)) +(defmethod set-spheres-from-nav-ids ((this nav-control)) "Set up spheres from sphere ids previously found by find-sphere-ids-from-sphere-hash" (let ((v1-2 (-> this state mesh sphere-hash sphere-array)) (a1-0 (-> this sphere-id-array)) @@ -560,33 +560,30 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition of type nav-control-cfs-work (deftype nav-control-cfs-work (structure) - ((in-dir vector :inline :offset-assert 0) - (right-dir vector :inline :offset-assert 16) - (best-dir vector 2 :inline :offset-assert 32) - (temp-dir vector 2 :inline :offset-assert 64) - (away-dir vector :inline :offset-assert 96) - (best-dir-angle degrees 2 :offset-assert 112) - (ignore-mask uint64 :offset-assert 120) - (initial-ignore-mask uint64 :offset-assert 128) - (i-sphere int32 :offset-assert 136) - (i-first-sphere int32 :offset-assert 140) - (i-inside-sphere int32 :offset-assert 144) - (inside-sphere-dist float :offset-assert 148) - (sign float :offset-assert 152) - (travel-len float :offset-assert 156) - (dist2 float :offset-assert 160) - (inside-dist float :offset-assert 164) - (rand-angle float :offset-assert 168) - (dir-update basic :offset-assert 172) - (debug-offset vector :inline :offset-assert 176) + ((in-dir vector :inline) + (right-dir vector :inline) + (best-dir vector 2 :inline) + (temp-dir vector 2 :inline) + (away-dir vector :inline) + (best-dir-angle degrees 2) + (ignore-mask uint64) + (initial-ignore-mask uint64) + (i-sphere int32) + (i-first-sphere int32) + (i-inside-sphere int32) + (inside-sphere-dist float) + (sign float) + (travel-len float) + (dist2 float) + (inside-dist float) + (rand-angle float) + (dir-update basic) + (debug-offset vector :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) ;; definition for method 3 of type nav-control-cfs-work -(defmethod inspect nav-control-cfs-work ((this nav-control-cfs-work)) +(defmethod inspect ((this nav-control-cfs-work)) (when (not this) (set! this this) (goto cfg-4) @@ -810,7 +807,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 18 of type nav-control ;; INFO: Used lq/sq -(defmethod avoid-spheres-1! nav-control ((this nav-control) (arg0 nav-avoid-spheres-params)) +(defmethod avoid-spheres-1! ((this nav-control) (arg0 nav-avoid-spheres-params)) (local-vars (v1-28 int) (a0-29 int) (a1-3 float)) (rlet ((acc :class vf) (Q :class vf) @@ -1110,7 +1107,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 19 of type nav-control ;; INFO: Used lq/sq -(defmethod avoid-spheres-2! nav-control ((this nav-control) (arg0 nav-avoid-spheres-params)) +(defmethod avoid-spheres-2! ((this nav-control) (arg0 nav-avoid-spheres-params)) (local-vars (a0-32 int) (a1-3 float)) (rlet ((acc :class vf) (Q :class vf) @@ -1243,12 +1240,12 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 21 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod clamp-vector-to-mesh-no-gaps nav-control ((this nav-control) - (arg0 vector) - (arg1 nav-poly) - (arg2 vector) - (arg3 clamp-travel-vector-to-mesh-return-info) - ) +(defmethod clamp-vector-to-mesh-no-gaps ((this nav-control) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 clamp-travel-vector-to-mesh-return-info) + ) (clamp-vector-to-mesh-no-gaps (-> this state mesh) arg0 arg1 arg2 arg3) 0 (none) @@ -1345,7 +1342,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 164 signed mismatch ;; WARN: Stack slot offset 168 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod clamp-vector-to-mesh-no-gaps nav-mesh ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) +(defmethod clamp-vector-to-mesh-no-gaps ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) (local-vars (v1-12 symbol) (sv-112 nav-ray) @@ -1567,7 +1564,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 21 of type nav-mesh ;; WARN: Return type mismatch object vs none. ;; WARN: Function (method 21 nav-mesh) has a return type of none, but the expression builder found a return statement. -(defmethod find-adjacent-bounds-one nav-mesh ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) +(defmethod find-adjacent-bounds-one ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) (local-vars (sv-16 nav-poly)) (if (zero? arg3) (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> arg1 vertex-count)))) @@ -1616,7 +1613,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 20 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod set-normals-from-adjacent-bounds nav-mesh ((this nav-mesh) (arg0 clamp-travel-vector-to-mesh-return-info)) +(defmethod set-normals-from-adjacent-bounds ((this nav-mesh) (arg0 clamp-travel-vector-to-mesh-return-info)) (find-adjacent-bounds-one this (-> arg0 vert-prev) (-> arg0 poly) (-> arg0 edge) -1) (find-adjacent-bounds-one this (-> arg0 vert-next) (-> arg0 poly) (-> arg0 edge) 0) (vector-! (-> arg0 prev-normal) (-> arg0 vert-0) (-> arg0 vert-prev)) @@ -1796,14 +1793,14 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 156 signed mismatch ;; WARN: Stack slot offset 160 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod clamp-vector-to-mesh-cross-gaps nav-mesh ((this nav-mesh) - (arg0 vector) - (arg1 nav-poly) - (arg2 vector) - (arg3 float) - (arg4 symbol) - (arg5 clamp-travel-vector-to-mesh-return-info) - ) +(defmethod clamp-vector-to-mesh-cross-gaps ((this nav-mesh) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 float) + (arg4 symbol) + (arg5 clamp-travel-vector-to-mesh-return-info) + ) (local-vars (v1-11 symbol) (v1-22 symbol) @@ -2049,7 +2046,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 22 of type nav-control -(defmethod find-first-sphere-and-update-avoid-params nav-control ((this nav-control) (arg0 vector) (arg1 nav-avoid-spheres-params)) +(defmethod find-first-sphere-and-update-avoid-params ((this nav-control) (arg0 vector) (arg1 nav-avoid-spheres-params)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -2118,7 +2115,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 24 of type nav-control -(defmethod add-root-sphere-to-hash! nav-control ((this nav-control) (arg0 vector) (arg1 int)) +(defmethod add-root-sphere-to-hash! ((this nav-control) (arg0 vector) (arg1 int)) "Add our root sphere to the hash (if enabled with output-sphere-hash flag) at the given location." (if (logtest? (-> this flags) (nav-control-flag output-sphere-hash)) (add-sphere-with-mask-and-id @@ -2132,7 +2129,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 47 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod reset! nav-state ((this nav-state) (arg0 nav-control)) +(defmethod reset! ((this nav-state) (arg0 nav-control)) (set! (-> this nav) arg0) (set! (-> this flags) (nav-state-flag)) (set! (-> this current-poly) #f) @@ -2144,7 +2141,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 7 of type nav-state -(defmethod relocate nav-state ((this nav-state) (arg0 int)) +(defmethod relocate ((this nav-state) (arg0 int)) (break!) (&+! (-> this nav) arg0) this @@ -2152,46 +2149,46 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 12 of type nav-state ;; INFO: Used lq/sq -(defmethod get-velocity nav-state ((this nav-state) (arg0 vector)) +(defmethod get-velocity ((this nav-state) (arg0 vector)) (set! (-> arg0 quad) (-> this velocity quad)) arg0 ) ;; definition for method 14 of type nav-state ;; INFO: Used lq/sq -(defmethod get-heading nav-state ((this nav-state) (arg0 vector)) +(defmethod get-heading ((this nav-state) (arg0 vector)) (set! (-> arg0 quad) (-> this heading quad)) arg0 ) ;; definition for method 15 of type nav-state ;; INFO: Used lq/sq -(defmethod get-target-post nav-state ((this nav-state) (arg0 vector)) +(defmethod get-target-post ((this nav-state) (arg0 vector)) (set! (-> arg0 quad) (-> this target-post quad)) arg0 ) ;; definition for method 19 of type nav-state -(defmethod get-current-poly nav-state ((this nav-state)) +(defmethod get-current-poly ((this nav-state)) "@returns `current-poly`" (-> this current-poly) ) ;; definition for method 16 of type nav-state -(defmethod get-speed nav-state ((this nav-state)) +(defmethod get-speed ((this nav-state)) "@returns `speed`" (-> this speed) ) ;; definition for method 17 of type nav-state -(defmethod get-rotation-rate nav-state ((this nav-state)) +(defmethod get-rotation-rate ((this nav-state)) "@returns `rotation-rate`" (-> this rotation-rate) ) ;; definition for method 13 of type nav-state ;; INFO: Used lq/sq -(defmethod get-travel nav-state ((this nav-state) (arg0 vector)) +(defmethod get-travel ((this nav-state) (arg0 vector)) (set! (-> arg0 quad) (-> this travel quad)) arg0 ) @@ -2199,7 +2196,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 44 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-velocity! nav-state ((this nav-state) (velocity vector)) +(defmethod set-velocity! ((this nav-state) (velocity vector)) (set! (-> this velocity quad) (-> velocity quad)) 0 (none) @@ -2208,7 +2205,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 45 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-heading! nav-state ((this nav-state) (arg0 vector)) +(defmethod set-heading! ((this nav-state) (arg0 vector)) (set! (-> this heading quad) (-> arg0 quad)) 0 (none) @@ -2216,7 +2213,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 46 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod set-speed! nav-state ((this nav-state) (arg0 meters)) +(defmethod set-speed! ((this nav-state) (arg0 meters)) (set! (-> this speed) arg0) 0 (none) @@ -2225,7 +2222,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 42 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-target-post! nav-state ((this nav-state) (arg0 vector)) +(defmethod set-target-post! ((this nav-state) (arg0 vector)) (logclear! (-> this flags) (nav-state-flag directional-mode)) (logior! (-> this flags) (nav-state-flag target-poly-dirty)) (set! (-> this target-post quad) (-> arg0 quad)) @@ -2236,7 +2233,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 43 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-travel! nav-state ((this nav-state) (arg0 vector)) +(defmethod set-travel! ((this nav-state) (arg0 vector)) (logior! (-> this flags) (nav-state-flag directional-mode)) (set! (-> this travel quad) (-> arg0 quad)) 0 @@ -2245,7 +2242,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 20 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod copy-nav-state! nav-state ((this nav-state) (arg0 (pointer nav-state))) +(defmethod copy-nav-state! ((this nav-state) (arg0 (pointer nav-state))) "Copies the [[nav-state]] the given pointer points to into the current object" (mem-copy! (the-as pointer this) arg0 176) 0 @@ -2254,7 +2251,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 10 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod nav-state-method-10 nav-state ((this nav-state)) +(defmethod nav-state-method-10 ((this nav-state)) 0 (none) ) @@ -2262,7 +2259,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 9 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw nav-state ((this nav-state)) +(defmethod debug-draw ((this nav-state)) (let ((s5-0 (-> this mesh))) (if (-> this next-poly) (debug-draw-poly s5-0 (-> this next-poly) *color-cyan*) @@ -2306,14 +2303,14 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 38 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod set-current-poly! nav-state ((this nav-state) (arg0 nav-poly)) +(defmethod set-current-poly! ((this nav-state) (arg0 nav-poly)) (set! (-> this current-poly) arg0) 0 (none) ) ;; definition for method 41 of type nav-state -(defmethod clamp-vector-to-mesh-cross-gaps nav-state ((this nav-state) (arg0 vector)) +(defmethod clamp-vector-to-mesh-cross-gaps ((this nav-state) (arg0 vector)) (when (-> this current-poly) (clamp-vector-to-mesh-cross-gaps (-> this nav) @@ -2331,7 +2328,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 40 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-navigation-to-destination nav-state ((this nav-state) (arg0 vector)) +(defmethod do-navigation-to-destination ((this nav-state) (arg0 vector)) (local-vars (v1-15 symbol)) (rlet ((acc :class vf) (Q :class vf) @@ -2442,7 +2439,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 18 of type nav-state -(defmethod try-projecting-to-current-poly nav-state ((this nav-state) (arg0 vector) (arg1 object) (arg2 vector)) +(defmethod try-projecting-to-current-poly ((this nav-state) (arg0 vector) (arg1 object) (arg2 vector)) (cond ((-> this current-poly) (let ((s5-0 (-> this nav)) @@ -2473,14 +2470,14 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 20 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod clamp-vector-to-mesh-cross-gaps nav-control ((this nav-control) - (arg0 vector) - (arg1 nav-poly) - (arg2 vector) - (arg3 float) - (arg4 symbol) - (arg5 clamp-travel-vector-to-mesh-return-info) - ) +(defmethod clamp-vector-to-mesh-cross-gaps ((this nav-control) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 float) + (arg4 symbol) + (arg5 clamp-travel-vector-to-mesh-return-info) + ) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> this state mesh bounds)) (clamp-vector-to-mesh-cross-gaps (-> this state mesh) v1-0 arg1 arg2 arg3 arg4 arg5) @@ -2490,7 +2487,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 12 of type nav-control -(defmethod cloest-point-on-mesh nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 nav-poly)) +(defmethod cloest-point-on-mesh ((this nav-control) (arg0 vector) (arg1 vector) (arg2 nav-poly)) (local-vars (sv-16 vector)) (set! sv-16 arg0) (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) @@ -2526,7 +2523,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 50 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod nav-state-method-50 nav-state ((this nav-state)) +(defmethod nav-state-method-50 ((this nav-state)) 0 (none) ) @@ -2594,7 +2591,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 51 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod navigate-using-route-portals nav-state ((this nav-state)) +(defmethod navigate-using-route-portals ((this nav-state)) (local-vars (v1-117 float) (sv-112 vector) @@ -2858,7 +2855,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 124 signed mismatch ;; WARN: Stack slot offset 128 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod navigate-using-best-dir-use-existing-avoid-spheres nav-state ((this nav-state) (arg0 nav-avoid-spheres-params)) +(defmethod navigate-using-best-dir-use-existing-avoid-spheres ((this nav-state) (arg0 nav-avoid-spheres-params)) (local-vars (sv-96 int) (sv-104 nav-mesh-work) @@ -3092,7 +3089,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 220 signed mismatch ;; WARN: Stack slot offset 224 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod navigate-using-best-dir-recompute-avoid-spheres-1 nav-state ((this nav-state)) +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1 ((this nav-state)) (local-vars (sv-192 int) (sv-200 nav-mesh-work) @@ -3267,7 +3264,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 53 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod navigate-within-poly nav-state ((this nav-state)) +(defmethod navigate-within-poly ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -3386,7 +3383,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 54 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod clamp-travel-vector nav-state ((this nav-state)) +(defmethod clamp-travel-vector ((this nav-state)) (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) (clamp-vector-to-mesh-cross-gaps (-> this mesh) @@ -3427,7 +3424,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Stack slot offset 56 signed mismatch -(defmethod plan-over-pat1-polys-using-route nav-state ((this nav-state) (arg0 nav-gap-info)) +(defmethod plan-over-pat1-polys-using-route ((this nav-state) (arg0 nav-gap-info)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (let ((a1-1 (-> this next-poly))) (when (logtest? (-> a1-1 pat) 1) @@ -3470,7 +3467,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 24 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod turn-and-navigate-to-destination nav-state ((this nav-state)) +(defmethod turn-and-navigate-to-destination ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -3531,7 +3528,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 25 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod navigate-using-route-portals-wrapper nav-state ((this nav-state)) +(defmethod navigate-using-route-portals-wrapper ((this nav-state)) (navigate-using-route-portals this) 0 (none) @@ -3539,7 +3536,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 26 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod navigate-using-best-dir-recompute-avoid-spheres-1-wrapper nav-state ((this nav-state)) +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1-wrapper ((this nav-state)) (navigate-using-best-dir-recompute-avoid-spheres-1 this) 0 (none) @@ -3547,7 +3544,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 27 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod navigate-within-poly-wrapper nav-state ((this nav-state)) +(defmethod navigate-within-poly-wrapper ((this nav-state)) (navigate-within-poly this) 0 (none) @@ -3581,7 +3578,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 204 signed mismatch ;; WARN: Stack slot offset 204 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod compute-travel-speed nav-state ((this nav-state)) +(defmethod compute-travel-speed ((this nav-state)) (local-vars (sv-192 float) (sv-196 float) (sv-200 float) (sv-204 float) (sv-224 vector)) (let ((s5-0 this)) (let ((s4-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) @@ -3653,7 +3650,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 34 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod navigate-v1! nav-state ((this nav-state)) +(defmethod navigate-v1! ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -3741,7 +3738,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 35 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod reset-target! nav-state ((this nav-state)) +(defmethod reset-target! ((this nav-state)) (vector-reset! (-> this target-dir)) 0 (none) @@ -3749,7 +3746,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 36 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod add-offset-to-target! nav-state ((this nav-state) (arg0 vector)) +(defmethod add-offset-to-target! ((this nav-state) (arg0 vector)) (vector+! (-> this target-dir) (-> this target-dir) arg0) 0 (none) @@ -3757,14 +3754,14 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 29 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod nav-state-method-29 nav-state ((this nav-state)) +(defmethod nav-state-method-29 ((this nav-state)) 0 (none) ) ;; definition for method 30 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod nav-state-method-30 nav-state ((this nav-state)) +(defmethod nav-state-method-30 ((this nav-state)) 0 (none) ) @@ -3844,7 +3841,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 220 signed mismatch ;; WARN: Stack slot offset 224 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod navigate-using-best-dir-recompute-avoid-spheres-2 nav-state ((this nav-state)) +(defmethod navigate-using-best-dir-recompute-avoid-spheres-2 ((this nav-state)) (local-vars (sv-192 int) (sv-200 nav-mesh-work) @@ -4024,7 +4021,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 32 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-travel-dir-from-spheres nav-state ((this nav-state)) +(defmethod update-travel-dir-from-spheres ((this nav-state)) (local-vars (v1-11 float) (v1-25 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -4089,7 +4086,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 33 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod compute-speed-simple nav-state ((this nav-state)) +(defmethod compute-speed-simple ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -4151,7 +4148,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 37 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod navigate-v2! nav-state ((this nav-state)) +(defmethod navigate-v2! ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-enemy-h_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-enemy-h_REF.gc index 95373cb0674..8394a4ff19f 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-enemy-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-enemy-h_REF.gc @@ -3,42 +3,39 @@ ;; definition of type nav-enemy-info (deftype nav-enemy-info (enemy-info) - ((callback-info nav-callback-info :offset-assert 384) - (use-momentum symbol :offset-assert 388) - (use-frustration symbol :offset-assert 392) - (use-stop-chase symbol :offset-assert 396) - (use-circling symbol :offset-assert 400) - (use-pacing symbol :offset-assert 404) - (walk-anim int32 :offset-assert 408) - (turn-anim int32 :offset-assert 412) - (run-anim int32 :offset-assert 416) - (taunt-anim int32 :offset-assert 420) - (run-travel-speed meters :offset-assert 424) - (run-acceleration meters :offset-assert 428) - (run-turning-acceleration meters :offset-assert 432) - (walk-travel-speed meters :offset-assert 436) - (walk-acceleration meters :offset-assert 440) - (walk-turning-acceleration meters :offset-assert 444) - (maximum-rotation-rate degrees :offset-assert 448) - (notice-nav-radius meters :offset-assert 452) - (frustration-distance meters :offset-assert 456) - (frustration-time time-frame :offset-assert 464) - (blocked-time time-frame :offset-assert 472) - (circle-dist-lo float :offset-assert 480) - (circle-dist-hi float :offset-assert 484) - (nav-mesh nav-mesh :offset-assert 488) + ((callback-info nav-callback-info) + (use-momentum symbol) + (use-frustration symbol) + (use-stop-chase symbol) + (use-circling symbol) + (use-pacing symbol) + (walk-anim int32) + (turn-anim int32) + (run-anim int32) + (taunt-anim int32) + (run-travel-speed meters) + (run-acceleration meters) + (run-turning-acceleration meters) + (walk-travel-speed meters) + (walk-acceleration meters) + (walk-turning-acceleration meters) + (maximum-rotation-rate degrees) + (notice-nav-radius meters) + (frustration-distance meters) + (frustration-time time-frame) + (blocked-time time-frame) + (circle-dist-lo float) + (circle-dist-hi float) + (nav-mesh nav-mesh) ) - :method-count-assert 11 - :size-assert #x1ec - :flag-assert #xb000001ec (:methods - (copy-nav-enemy-info! (_type_ nav-enemy-info) none 10) + (copy-nav-enemy-info! (_type_ nav-enemy-info) none) ) ) ;; definition for method 3 of type nav-enemy-info ;; INFO: Used lq/sq -(defmethod inspect nav-enemy-info ((this nav-enemy-info)) +(defmethod inspect ((this nav-enemy-info)) (when (not this) (set! this this) (goto cfg-4) @@ -155,67 +152,65 @@ ;; definition of type nav-enemy (deftype nav-enemy (enemy) - ((enemy-info nav-enemy-info :override) - (frustration-point vector :inline :offset-assert 544) - (move-dest vector :inline :offset-assert 560) - (frustration-time time-frame :offset-assert 576) - (blocked-start-time time-frame :offset-assert 584) - (restore-nav-radius-time time-frame :offset-assert 592) - (nav-radius-backup float :offset-assert 600) + ((enemy-info nav-enemy-info :override) + (frustration-point vector :inline) + (move-dest vector :inline) + (frustration-time time-frame) + (blocked-start-time time-frame) + (restore-nav-radius-time time-frame) + (nav-radius-backup float) ) - :heap-base #x1e0 - :method-count-assert 178 - :size-assert #x25c - :flag-assert #xb201e0025c + (:state-methods + taunt + pacing + circling + stop-chase + debug-control + ) (:methods - (set-enemy-info! (_type_ nav-enemy-info) none :replace 112) - (init-enemy-behaviour-and-stats! (_type_ nav-enemy-info) none :replace 113) - (taunt () _type_ :state 137) - (pacing () _type_ :state 138) - (circling () _type_ :state 139) - (stop-chase () _type_ :state 140) - (debug-control () _type_ :state 141) - (nav-enemy-method-142 (_type_ nav-control) none 142) - (nav-enemy-method-143 (_type_ nav-control) none 143) - (nav-enemy-method-144 (_type_) time-frame :behavior nav-enemy 144) - (nav-enemy-method-145 (_type_ nav-control) none 145) - (nav-enemy-method-146 (_type_ nav-control) none 146) - (nav-enemy-method-147 (_type_ nav-control) none 147) - (nav-enemy-method-148 (_type_ nav-control) none 148) - (nav-enemy-method-149 (_type_ nav-control) none 149) - (nav-enemy-method-150 (_type_ nav-control) none 150) - (nav-enemy-method-151 (_type_ nav-control) none 151) - (nav-enemy-method-152 (_type_ nav-control) none 152) - (nav-enemy-method-153 (_type_ nav-control) none 153) - (nav-enemy-method-154 (_type_ nav-control) none 154) - (nav-enemy-method-155 (_type_) none 155) - (nav-enemy-method-156 (_type_) none 156) - (nav-enemy-method-157 (_type_ vector) nav-poly 157) - (nav-enemy-method-158 (_type_ vector) object 158) - (nav-enemy-method-159 (_type_ vector) symbol 159) - (nav-enemy-method-160 (_type_) none 160) - (nav-enemy-method-161 (_type_) none 161) - (nav-enemy-method-162 (_type_) none 162) - (nav-enemy-method-163 (_type_) symbol 163) - (nav-enemy-method-164 (_type_) none 164) - (nav-enemy-method-165 (_type_) none 165) - (nav-enemy-method-166 (_type_) none 166) - (nav-enemy-method-167 (_type_) none 167) - (nav-enemy-method-168 (_type_) float 168) - (nav-enemy-method-169 (_type_ float symbol) float 169) - (nav-enemy-method-170 (_type_) none 170) - (nav-enemy-method-171 (_type_) none 171) - (nav-enemy-method-172 (_type_) none 172) - (nav-enemy-method-173 (_type_) none 173) - (nav-enemy-method-174 (_type_) symbol 174) - (nav-enemy-method-175 (_type_) symbol 175) - (nav-enemy-method-176 (_type_) none :behavior nav-enemy 176) - (nav-enemy-method-177 (_type_) none 177) + (set-enemy-info! (_type_ nav-enemy-info) none :replace) + (init-enemy-behaviour-and-stats! (_type_ nav-enemy-info) none :replace) + (nav-enemy-method-142 (_type_ nav-control) none) + (nav-enemy-method-143 (_type_ nav-control) none) + (nav-enemy-method-144 (_type_) time-frame :behavior nav-enemy) + (nav-enemy-method-145 (_type_ nav-control) none) + (nav-enemy-method-146 (_type_ nav-control) none) + (nav-enemy-method-147 (_type_ nav-control) none) + (nav-enemy-method-148 (_type_ nav-control) none) + (nav-enemy-method-149 (_type_ nav-control) none) + (nav-enemy-method-150 (_type_ nav-control) none) + (nav-enemy-method-151 (_type_ nav-control) none) + (nav-enemy-method-152 (_type_ nav-control) none) + (nav-enemy-method-153 (_type_ nav-control) none) + (nav-enemy-method-154 (_type_ nav-control) none) + (nav-enemy-method-155 (_type_) none) + (nav-enemy-method-156 (_type_) none) + (nav-enemy-method-157 (_type_ vector) nav-poly) + (nav-enemy-method-158 (_type_ vector) object) + (nav-enemy-method-159 (_type_ vector) symbol) + (nav-enemy-method-160 (_type_) none) + (nav-enemy-method-161 (_type_) none) + (nav-enemy-method-162 (_type_) none) + (nav-enemy-method-163 (_type_) symbol) + (nav-enemy-method-164 (_type_) none) + (nav-enemy-method-165 (_type_) none) + (nav-enemy-method-166 (_type_) none) + (nav-enemy-method-167 (_type_) none) + (nav-enemy-method-168 (_type_) float) + (nav-enemy-method-169 (_type_ float symbol) float) + (nav-enemy-method-170 (_type_) none) + (nav-enemy-method-171 (_type_) none) + (nav-enemy-method-172 (_type_) none) + (nav-enemy-method-173 (_type_) none) + (nav-enemy-method-174 (_type_) symbol) + (nav-enemy-method-175 (_type_) symbol) + (nav-enemy-method-176 (_type_) none :behavior nav-enemy) + (nav-enemy-method-177 (_type_) none) ) ) ;; definition for method 3 of type nav-enemy -(defmethod inspect nav-enemy ((this nav-enemy)) +(defmethod inspect ((this nav-enemy)) (when (not this) (set! this this) (goto cfg-4) @@ -236,17 +231,14 @@ ;; definition of type nav-enemy-debug-control-info (deftype nav-enemy-debug-control-info (basic) - ((enable basic :offset-assert 4) - (steering float :offset-assert 8) - (throttle float :offset-assert 12) + ((enable basic) + (steering float) + (throttle float) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type nav-enemy-debug-control-info -(defmethod inspect nav-enemy-debug-control-info ((this nav-enemy-debug-control-info)) +(defmethod inspect ((this nav-enemy-debug-control-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc index 0e6118c9776..e55ef036368 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 10 of type nav-enemy-info ;; WARN: Return type mismatch int vs none. -(defmethod copy-nav-enemy-info! nav-enemy-info ((this nav-enemy-info) (obj-to-copy nav-enemy-info)) +(defmethod copy-nav-enemy-info! ((this nav-enemy-info) (obj-to-copy nav-enemy-info)) "Copies the provided [[nav-enemy-info]] into the current object" (mem-copy! (&-> this type) (&-> obj-to-copy type) 492) 0 @@ -11,7 +11,7 @@ ) ;; definition for method 61 of type nav-enemy -(defmethod enemy-method-61 nav-enemy ((this nav-enemy) (arg0 int)) +(defmethod enemy-method-61 ((this nav-enemy) (arg0 int)) (let* ((t9-0 (method-of-type enemy enemy-method-61)) (s5-0 (t9-0 this arg0)) ) @@ -23,7 +23,7 @@ ) ;; definition for method 74 of type nav-enemy -(defmethod general-event-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -61,7 +61,7 @@ ;; definition for method 156 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-156 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-156 ((this nav-enemy)) (cond ((zero? (-> this path)) (go process-drawable-art-error "no path") @@ -98,7 +98,7 @@ ;; definition for method 102 of type nav-enemy ;; INFO: Used lq/sq -(defmethod enemy-method-102 nav-enemy ((this nav-enemy)) +(defmethod enemy-method-102 ((this nav-enemy)) (let ((gp-0 (-> this root)) (s3-0 (-> this nav state)) ) @@ -142,7 +142,7 @@ ;; definition for method 100 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs symbol. -(defmethod enemy-method-100 nav-enemy ((this nav-enemy)) +(defmethod enemy-method-100 ((this nav-enemy)) (local-vars (v0-1 vector)) (when (not (-> this enemy-info move-to-ground)) (enemy-method-103 this) @@ -205,7 +205,7 @@ ;; definition for method 55 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod track-target! nav-enemy ((self nav-enemy)) +(defmethod track-target! ((self nav-enemy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -293,7 +293,7 @@ ;; definition for method 177 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-177 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-177 ((this nav-enemy)) (let ((v1-2 (-> this nav state current-poly))) (when (and v1-2 (logtest? (-> v1-2 pat) 4) (!= (-> v1-2 link) 255)) (let ((v1-6 (-> this nav state mesh link-array (-> v1-2 link) dest-mesh))) @@ -309,7 +309,7 @@ ;; definition for method 176 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-176 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-176 ((this nav-enemy)) (nav-enemy-method-177 this) (cond ((nav-enemy-method-174 this) @@ -361,7 +361,7 @@ ;; definition for method 145 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-145 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-145 ((this nav-enemy) (arg0 nav-control)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -425,7 +425,7 @@ ;; definition for method 146 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-146 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-146 ((this nav-enemy) (arg0 nav-control)) (navigate-using-route-portals (-> arg0 state)) 0 0 @@ -434,7 +434,7 @@ ;; definition for method 147 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-147 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-147 ((this nav-enemy) (arg0 nav-control)) (navigate-using-best-dir-recompute-avoid-spheres-1 (-> arg0 state)) 0 0 @@ -443,7 +443,7 @@ ;; definition for method 148 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-148 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-148 ((this nav-enemy) (arg0 nav-control)) (navigate-within-poly (-> arg0 state)) 0 0 @@ -452,7 +452,7 @@ ;; definition for method 149 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-149 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-149 ((this nav-enemy) (arg0 nav-control)) (compute-travel-speed (-> arg0 state)) 0 (none) @@ -460,7 +460,7 @@ ;; definition for method 155 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-155 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-155 ((this nav-enemy)) (navigate-v1! (-> this nav state)) 0 (none) @@ -469,7 +469,7 @@ ;; definition for method 150 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-150 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-150 ((this nav-enemy) (arg0 nav-control)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -533,7 +533,7 @@ ;; definition for method 151 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-151 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-151 ((this nav-enemy) (arg0 nav-control)) (navigate-using-route-portals (-> arg0 state)) 0 0 @@ -542,7 +542,7 @@ ;; definition for method 152 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-152 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-152 ((this nav-enemy) (arg0 nav-control)) (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg0 state)) 0 (none) @@ -550,7 +550,7 @@ ;; definition for method 153 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-153 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-153 ((this nav-enemy) (arg0 nav-control)) (update-travel-dir-from-spheres (-> arg0 state)) 0 (none) @@ -558,7 +558,7 @@ ;; definition for method 154 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-154 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-154 ((this nav-enemy) (arg0 nav-control)) (compute-speed-simple (-> arg0 state)) 0 (none) @@ -567,7 +567,7 @@ ;; definition for method 142 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this nav-enemy) (arg0 nav-control)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) (set! (-> s5-0 quad) (-> a1-1 heading quad)) @@ -584,7 +584,7 @@ ;; definition for method 143 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-143 nav-enemy ((this nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-143 ((this nav-enemy) (arg0 nav-control)) (let ((v1-0 (new 'stack-no-clear 'vector))) (let ((a2-0 (-> arg0 state))) (set! (-> v1-0 quad) (-> a2-0 velocity quad)) @@ -870,7 +870,7 @@ ;; definition for method 170 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-170 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-170 ((this nav-enemy)) (if (not (logtest? (enemy-flag enemy-flag36) (-> this enemy-flags))) (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> this enemy-flags)))) ) @@ -882,7 +882,7 @@ ;; definition for method 171 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-171 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-171 ((this nav-enemy)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> this nav callback-info) *nav-enemy-null-callback-info*) 0 @@ -891,7 +891,7 @@ ;; definition for method 172 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-172 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-172 ((this nav-enemy)) (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> this enemy-flags)))) 0 (none) @@ -899,24 +899,24 @@ ;; definition for method 173 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-173 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-173 ((this nav-enemy)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag37)))) 0 (none) ) ;; definition for method 174 of type nav-enemy -(defmethod nav-enemy-method-174 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-174 ((this nav-enemy)) (logtest? (enemy-flag enemy-flag36) (-> this enemy-flags)) ) ;; definition for method 175 of type nav-enemy -(defmethod nav-enemy-method-175 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-175 ((this nav-enemy)) (logtest? (enemy-flag enemy-flag37) (-> this enemy-flags)) ) ;; definition for method 157 of type nav-enemy -(defmethod nav-enemy-method-157 nav-enemy ((this nav-enemy) (arg0 vector)) +(defmethod nav-enemy-method-157 ((this nav-enemy) (arg0 vector)) (let ((v1-0 (-> this nav)) (a0-1 arg0) (a1-1 (new 'stack-no-clear 'nav-find-poly-parms)) @@ -929,7 +929,7 @@ ) ;; definition for method 158 of type nav-enemy -(defmethod nav-enemy-method-158 nav-enemy ((this nav-enemy) (arg0 vector)) +(defmethod nav-enemy-method-158 ((this nav-enemy) (arg0 vector)) (let ((f1-0 (-> this root trans y)) (f0-0 (-> arg0 y)) (v1-1 (-> this fact)) @@ -950,7 +950,7 @@ ) ;; definition for method 159 of type nav-enemy -(defmethod nav-enemy-method-159 nav-enemy ((this nav-enemy) (arg0 vector)) +(defmethod nav-enemy-method-159 ((this nav-enemy) (arg0 vector)) (let ((f1-0 (-> this root trans y)) (f0-0 (-> arg0 y)) (v1-1 (-> this fact)) @@ -964,7 +964,7 @@ ) ;; definition for method 98 of type nav-enemy -(defmethod in-aggro-range? nav-enemy ((this nav-enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this nav-enemy) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -995,7 +995,7 @@ ;; definition for method 161 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-161 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-161 ((this nav-enemy)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag not-frustrated)))) (set-time! (-> this frustration-time)) (let ((v1-7 (handle->process (-> this focus handle)))) @@ -1009,7 +1009,7 @@ ;; definition for method 160 of type nav-enemy ;; WARN: Return type mismatch object vs none. -(defmethod nav-enemy-method-160 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-160 ((this nav-enemy)) (let ((s5-0 (handle->process (-> this focus handle)))) (cond ((or (not s5-0) @@ -1033,14 +1033,14 @@ ;; definition for method 162 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-162 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-162 ((this nav-enemy)) (set! (-> this blocked-start-time) 0) 0 (none) ) ;; definition for method 163 of type nav-enemy -(defmethod nav-enemy-method-163 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-163 ((this nav-enemy)) (let ((v1-0 (-> this blocked-start-time))) (and (nonzero? v1-0) (time-elapsed? v1-0 (-> this enemy-info blocked-time))) ) @@ -1048,7 +1048,7 @@ ;; definition for method 164 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-164 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-164 ((this nav-enemy)) (if (-> this enemy-info use-momentum) (logior! (-> this nav flags) (nav-control-flag use-momentum)) (logclear! (-> this nav flags) (nav-control-flag use-momentum)) @@ -1059,7 +1059,7 @@ ;; definition for method 167 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-167 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-167 ((this nav-enemy)) (let ((v1-0 (-> this nav))) (set! (-> v1-0 target-speed) 0.0) ) @@ -1078,7 +1078,7 @@ ;; definition for method 165 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-165 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-165 ((this nav-enemy)) (let ((v1-0 (-> this nav))) (set! (-> v1-0 target-speed) (-> this enemy-info walk-travel-speed)) ) @@ -1097,7 +1097,7 @@ ;; definition for method 166 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-166 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-166 ((this nav-enemy)) (let ((v1-0 (-> this nav))) (set! (-> v1-0 target-speed) (-> this enemy-info run-travel-speed)) ) @@ -1116,7 +1116,7 @@ ;; definition for method 112 of type nav-enemy ;; WARN: Return type mismatch float vs none. -(defmethod set-enemy-info! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) +(defmethod set-enemy-info! ((this nav-enemy) (arg0 nav-enemy-info)) "In addition to setting the `enemy-info`, also init the `neck-joint` if applicable from it @param info Set `enemy-info` accordingly" (set! (-> this enemy-info) arg0) @@ -1138,7 +1138,7 @@ ;; definition for method 113 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-behaviour-and-stats! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) +(defmethod init-enemy-behaviour-and-stats! ((this nav-enemy) (arg0 nav-enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (local-vars (sv-16 res-tag)) (when (coin-flip? this) @@ -1317,7 +1317,7 @@ ;; definition for method 11 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod init-from-entity! nav-enemy ((this nav-enemy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nav-enemy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1488,7 +1488,7 @@ This commonly includes things such as: ) ;; definition for method 169 of type nav-enemy -(defmethod nav-enemy-method-169 nav-enemy ((this nav-enemy) (arg0 float) (arg1 symbol)) +(defmethod nav-enemy-method-169 ((this nav-enemy) (arg0 float) (arg1 symbol)) (if arg1 (set! (-> this nav-radius-backup) arg0) ) @@ -1498,7 +1498,7 @@ This commonly includes things such as: ) ;; definition for method 168 of type nav-enemy -(defmethod nav-enemy-method-168 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-168 ((this nav-enemy)) (if (zero? (-> this restore-nav-radius-time)) (set! (-> this root nav-radius) (-> this nav-radius-backup)) ) @@ -1506,7 +1506,7 @@ This commonly includes things such as: ;; definition for method 144 of type nav-enemy ;; WARN: Return type mismatch int vs time-frame. -(defmethod nav-enemy-method-144 nav-enemy ((this nav-enemy)) +(defmethod nav-enemy-method-144 ((this nav-enemy)) (set! (-> this root nav-radius) 4.096) (let ((s5-1 (max (-> this restore-nav-radius-time) (+ (current-time) (get-rand-int-range this 1500 2400))))) (set! (-> this restore-nav-radius-time) (the-as time-frame s5-1)) @@ -1582,7 +1582,7 @@ This commonly includes things such as: ) ;; definition for method 68 of type nav-enemy -(defmethod go-stare2 nav-enemy ((this nav-enemy)) +(defmethod go-stare2 ((this nav-enemy)) (if (!= (-> this enemy-info taunt-anim) -1) (go (method-of-object this taunt)) ) @@ -1590,7 +1590,7 @@ This commonly includes things such as: ) ;; definition for method 67 of type nav-enemy -(defmethod go-stare nav-enemy ((this nav-enemy)) +(defmethod go-stare ((this nav-enemy)) (let ((s5-0 (-> this focus aware))) (cond ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) @@ -1612,7 +1612,7 @@ This commonly includes things such as: ) ;; definition for method 70 of type nav-enemy -(defmethod go-hostile nav-enemy ((this nav-enemy)) +(defmethod go-hostile ((this nav-enemy)) (if (or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) (nav-enemy-method-163 this) ) @@ -1622,7 +1622,7 @@ This commonly includes things such as: ) ;; definition for method 71 of type nav-enemy -(defmethod go-flee nav-enemy ((this nav-enemy)) +(defmethod go-flee ((this nav-enemy)) (go (method-of-object this flee)) ) @@ -2681,7 +2681,7 @@ This commonly includes things such as: ;; definition for method 82 of type nav-enemy ;; INFO: Used lq/sq -(defmethod enemy-method-82 nav-enemy ((this nav-enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-82 ((this nav-enemy) (arg0 enemy-jump-info)) "@abstract" (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) @@ -2692,7 +2692,7 @@ This commonly includes things such as: ;; definition for method 92 of type nav-enemy ;; WARN: Return type mismatch quaternion vs none. -(defmethod enemy-method-92 nav-enemy ((this nav-enemy) (arg0 int) (arg1 nav-poly)) +(defmethod enemy-method-92 ((this nav-enemy) (arg0 int) (arg1 nav-poly)) "TODO - nav-poly is a guess @abstract" (let ((v1-0 arg0)) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc index dc8af19a7e6..05f74a28ffa 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc @@ -3,27 +3,24 @@ ;; definition of type nav-mesh-work-debug (deftype nav-mesh-work-debug (structure) - ((debug-vec1 vector :inline :offset-assert 0) - (debug-vec2 vector :inline :offset-assert 16) - (debug-vec3 vector :inline :offset-assert 32) - (debug-vec4 vector :inline :offset-assert 48) - (debug-vec5 vector :inline :offset-assert 64) - (debug-vec6 vector :inline :offset-assert 80) - (debug-vec7 vector :inline :offset-assert 96) - (debug-vec8 vector :inline :offset-assert 112) - (debug-vec9 vector :inline :offset-assert 128) - (debug-vec10 vector :inline :offset-assert 144) - (debug-vec11 vector :inline :offset-assert 160) - (debug-vec12 vector :inline :offset-assert 176) - (sphere-array sphere 16 :inline :offset-assert 192) + ((debug-vec1 vector :inline) + (debug-vec2 vector :inline) + (debug-vec3 vector :inline) + (debug-vec4 vector :inline) + (debug-vec5 vector :inline) + (debug-vec6 vector :inline) + (debug-vec7 vector :inline) + (debug-vec8 vector :inline) + (debug-vec9 vector :inline) + (debug-vec10 vector :inline) + (debug-vec11 vector :inline) + (debug-vec12 vector :inline) + (sphere-array sphere 16 :inline) ) - :method-count-assert 9 - :size-assert #x1c0 - :flag-assert #x9000001c0 ) ;; definition for method 3 of type nav-mesh-work-debug -(defmethod inspect nav-mesh-work-debug ((this nav-mesh-work-debug)) +(defmethod inspect ((this nav-mesh-work-debug)) (when (not this) (set! this this) (goto cfg-4) @@ -48,32 +45,29 @@ ;; definition of type nav-mesh-work (deftype nav-mesh-work (structure) - ((vert0-table int8 4 :offset-assert 0) - (vert1-table int8 4 :offset-assert 4) - (edge-mask-table uint8 3 :offset-assert 8) - (pad0 uint32 :offset-assert 12) - (deg-to-rad float :offset-assert 16) - (rad-to-deg float :offset-assert 20) - (nav-poly-min-dist float :offset-assert 24) - (nav-poly-epsilon float :offset-assert 28) - (sphere-array sphere 16 :inline :offset-assert 32) - (debug nav-mesh-work-debug :offset-assert 288) - (work-struct-in-scratch int8 :offset-assert 292) - (mesh-struct-in-scratch int8 :offset-assert 293) - (polys-in-scratch int8 :offset-assert 294) - (mesh nav-mesh :offset-assert 296) - (nav basic :offset-assert 300) - (poly0 nav-poly :offset-assert 304) - (poly1 nav-poly :offset-assert 308) - (poly-id int32 :offset-assert 312) + ((vert0-table int8 4) + (vert1-table int8 4) + (edge-mask-table uint8 3) + (pad0 uint32) + (deg-to-rad float) + (rad-to-deg float) + (nav-poly-min-dist float) + (nav-poly-epsilon float) + (sphere-array sphere 16 :inline) + (debug nav-mesh-work-debug) + (work-struct-in-scratch int8) + (mesh-struct-in-scratch int8) + (polys-in-scratch int8) + (mesh nav-mesh) + (nav basic) + (poly0 nav-poly) + (poly1 nav-poly) + (poly-id int32) ) - :method-count-assert 9 - :size-assert #x13c - :flag-assert #x90000013c ) ;; definition for method 3 of type nav-mesh-work -(defmethod inspect nav-mesh-work ((this nav-mesh-work)) +(defmethod inspect ((this nav-mesh-work)) (when (not this) (set! this this) (goto cfg-4) @@ -103,21 +97,18 @@ ;; definition of type nav-mesh-link (deftype nav-mesh-link (structure) - ((id uint32 :offset-assert 0) - (dest-mesh-id uint32 :offset-assert 4) - (src-link-poly-id uint8 :offset-assert 8) - (src-switch-poly-id uint8 :offset-assert 9) - (dest-link-poly-id uint8 :offset-assert 10) - (dest-switch-poly-id uint8 :offset-assert 11) - (dest-mesh nav-mesh :offset-assert 12) + ((id uint32) + (dest-mesh-id uint32) + (src-link-poly-id uint8) + (src-switch-poly-id uint8) + (dest-link-poly-id uint8) + (dest-switch-poly-id uint8) + (dest-mesh nav-mesh) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type nav-mesh-link -(defmethod inspect nav-mesh-link ((this nav-mesh-link)) +(defmethod inspect ((this nav-mesh-link)) (when (not this) (set! this this) (goto cfg-4) @@ -136,31 +127,28 @@ ;; definition of type nav-poly (deftype nav-poly (structure) - ((data uint8 64 :offset-assert 0) - (vertex vector 4 :inline :offset 0) - (vertex0 vector :inline :offset 0) - (vertex1 vector :inline :offset 16) - (vertex2 vector :inline :offset 32) - (vertex3 vector :inline :offset 48) - (id uint8 :offset 12) - (pat uint8 :offset 13) - (vertex-count uint8 :offset 14) - (link uint8 :offset 15) - (adj-poly uint8 4 :offset 28) - (adj-poly0 uint8 :offset 28) - (adj-poly1 uint8 :offset 29) - (adj-poly2 uint8 :offset 30) - (adj-poly3 uint8 :offset 31) - (min-y float :offset 44) - (max-y float :offset 60) + ((data uint8 64) + (vertex vector 4 :inline :overlay-at (-> data 0)) + (vertex0 vector :inline :overlay-at (-> data 0)) + (vertex1 vector :inline :overlay-at (-> data 16)) + (vertex2 vector :inline :overlay-at (-> data 32)) + (vertex3 vector :inline :overlay-at (-> data 48)) + (id uint8 :overlay-at (-> data 12)) + (pat uint8 :overlay-at (-> data 13)) + (vertex-count uint8 :overlay-at (-> data 14)) + (link uint8 :overlay-at (-> data 15)) + (adj-poly uint8 4 :overlay-at (-> data 28)) + (adj-poly0 uint8 :overlay-at (-> data 28)) + (adj-poly1 uint8 :overlay-at (-> data 29)) + (adj-poly2 uint8 :overlay-at (-> data 30)) + (adj-poly3 uint8 :overlay-at (-> data 31)) + (min-y float :overlay-at (-> data 44)) + (max-y float :overlay-at (-> data 60)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type nav-poly -(defmethod inspect nav-poly ((this nav-poly)) +(defmethod inspect ((this nav-poly)) (when (not this) (set! this this) (goto cfg-4) @@ -192,14 +180,11 @@ "A typedef for `vector`, not used because our code looks nicer if everything is `vector`s anyway and declared out of order (cannot use forward declared structures in inline arrays)" () - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type nav-vertex ;; INFO: Used lq/sq -(defmethod inspect nav-vertex ((this nav-vertex)) +(defmethod inspect ((this nav-vertex)) (when (not this) (set! this this) (goto cfg-4) @@ -217,15 +202,12 @@ and declared out of order (cannot use forward declared structures in inline arra ;; definition of type nav-sphere (deftype nav-sphere (structure) - ((trans sphere :inline :offset-assert 0) + ((trans sphere :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type nav-sphere -(defmethod inspect nav-sphere ((this nav-sphere)) +(defmethod inspect ((this nav-sphere)) (when (not this) (set! this this) (goto cfg-4) @@ -238,26 +220,23 @@ and declared out of order (cannot use forward declared structures in inline arra ;; definition of type nav-ray (deftype nav-ray (structure) - ((current-pos vector :inline :offset-assert 0) - (dir vector :inline :offset-assert 16) - (dest-pos vector :inline :offset-assert 32) - (current-poly nav-poly :offset-assert 48) - (next-poly nav-poly :offset-assert 52) - (len meters :offset-assert 56) - (last-edge int8 :offset-assert 60) - (ignore uint8 :offset-assert 61) - (terminated symbol :offset-assert 64) - (reached-dest symbol :offset-assert 68) - (hit-boundary symbol :offset-assert 72) - (hit-gap symbol :offset-assert 76) + ((current-pos vector :inline) + (dir vector :inline) + (dest-pos vector :inline) + (current-poly nav-poly) + (next-poly nav-poly) + (len meters) + (last-edge int8) + (ignore uint8) + (terminated symbol) + (reached-dest symbol) + (hit-boundary symbol) + (hit-gap symbol) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type nav-ray -(defmethod inspect nav-ray ((this nav-ray)) +(defmethod inspect ((this nav-ray)) (when (not this) (set! this this) (goto cfg-4) @@ -281,17 +260,14 @@ and declared out of order (cannot use forward declared structures in inline arra ;; definition of type nav-route-portal (deftype nav-route-portal (structure) - ((vertex nav-vertex 2 :inline :offset-assert 0) - (next-poly nav-poly :offset-assert 32) - (edge-index int8 :offset-assert 36) + ((vertex nav-vertex 2 :inline) + (next-poly nav-poly) + (edge-index int8) ) - :method-count-assert 9 - :size-assert #x25 - :flag-assert #x900000025 ) ;; definition for method 3 of type nav-route-portal -(defmethod inspect nav-route-portal ((this nav-route-portal)) +(defmethod inspect ((this nav-route-portal)) (when (not this) (set! this this) (goto cfg-4) @@ -306,20 +282,17 @@ and declared out of order (cannot use forward declared structures in inline arra ;; definition of type nav-find-poly-parms (deftype nav-find-poly-parms (structure) - ((point vector :inline :offset-assert 0) - (y-threshold float :offset-assert 16) - (ignore uint8 :offset-assert 20) - (poly nav-poly :offset-assert 24) - (dist float :offset-assert 28) - (point-inside? symbol :offset-assert 32) + ((point vector :inline) + (y-threshold float) + (ignore uint8) + (poly nav-poly) + (dist float) + (point-inside? symbol) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type nav-find-poly-parms -(defmethod inspect nav-find-poly-parms ((this nav-find-poly-parms)) +(defmethod inspect ((this nav-find-poly-parms)) (when (not this) (set! this this) (goto cfg-4) @@ -337,27 +310,24 @@ and declared out of order (cannot use forward declared structures in inline arra ;; definition of type clamp-travel-vector-to-mesh-return-info (deftype clamp-travel-vector-to-mesh-return-info (structure) - ((found-boundary symbol :offset-assert 0) - (intersection vector :inline :offset-assert 16) - (boundary-normal vector :inline :offset-assert 32) - (prev-normal vector :inline :offset-assert 48) - (next-normal vector :inline :offset-assert 64) - (poly nav-poly :offset-assert 80) - (gap-poly nav-poly :offset-assert 84) - (edge int8 :offset-assert 88) - (ignore uint8 :offset-assert 89) - (vert-prev vector :inline :offset-assert 96) - (vert-0 vector :inline :offset-assert 112) - (vert-1 vector :inline :offset-assert 128) - (vert-next vector :inline :offset-assert 144) + ((found-boundary symbol) + (intersection vector :inline) + (boundary-normal vector :inline) + (prev-normal vector :inline) + (next-normal vector :inline) + (poly nav-poly) + (gap-poly nav-poly) + (edge int8) + (ignore uint8) + (vert-prev vector :inline) + (vert-0 vector :inline) + (vert-1 vector :inline) + (vert-next vector :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type clamp-travel-vector-to-mesh-return-info -(defmethod inspect clamp-travel-vector-to-mesh-return-info ((this clamp-travel-vector-to-mesh-return-info)) +(defmethod inspect ((this clamp-travel-vector-to-mesh-return-info)) (when (not this) (set! this this) (goto cfg-4) @@ -382,78 +352,75 @@ and declared out of order (cannot use forward declared structures in inline arra ;; definition of type nav-mesh (deftype nav-mesh (basic) - ((work nav-mesh-work :offset-assert 4) - (poly-array (inline-array nav-poly) :offset-assert 8) - (static-sphere-count uint8 :offset-assert 12) - (poly-count uint8 :offset-assert 13) - (nav-control-count uint8 :offset-assert 14) - (max-nav-control-count uint8 :offset-assert 15) - (route (pointer nav-poly) :offset-assert 16) - (poly-hash grid-hash :offset-assert 20) - (nav-control-array (inline-array nav-control) :offset-assert 24) - (sphere-hash sphere-hash :offset-assert 28) - (static-sphere (inline-array sphere) :offset-assert 32) - (user-list engine :offset-assert 36) - (next-nav-mesh surface :offset-assert 40) - (prev-nav-mesh surface :offset-assert 44) - (bounds vector :inline :offset-assert 48) - (origin vector :inline :offset 48) - (entity entity :offset-assert 64) - (link-array (inline-array nav-mesh-link) :offset-assert 68) - (link-count uint8 :offset-assert 72) - (flags nav-mesh-flag :offset-assert 73) - (pad1 uint8 2 :offset-assert 74) - (nearest-y-threshold meters :offset-assert 76) - (water-max-height meters :offset-assert 80) - (pad2 uint32 7 :offset-assert 84) + ((work nav-mesh-work) + (poly-array (inline-array nav-poly)) + (static-sphere-count uint8) + (poly-count uint8) + (nav-control-count uint8) + (max-nav-control-count uint8) + (route (pointer nav-poly)) + (poly-hash grid-hash) + (nav-control-array (inline-array nav-control)) + (sphere-hash sphere-hash) + (static-sphere (inline-array sphere)) + (user-list engine) + (next-nav-mesh surface) + (prev-nav-mesh surface) + (bounds vector :inline) + (origin vector :inline :overlay-at bounds) + (entity entity) + (link-array (inline-array nav-mesh-link)) + (link-count uint8) + (flags nav-mesh-flag) + (pad1 uint8 2) + (nearest-y-threshold meters) + (water-max-height meters) + (pad2 uint32 7) ) - :method-count-assert 47 - :size-assert #x70 - :flag-assert #x2f00000070 (:methods - (debug-draw (_type_) none 9) - (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly 10) - (poly-centroid (_type_ nav-poly vector) vector 11) - (poly-centroid-local (_type_ nav-poly vector) vector 12) - (lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly 13) - (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex) 14) - (initialize-mesh! (_type_) none 15) - (move-along-nav-ray! (_type_ nav-ray) none 16) - (try-move-along-ray (_type_ nav-poly vector vector float) meters 17) - (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 18) - (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none 19) - (set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none 20) - (find-adjacent-bounds-one (_type_ vector nav-poly int int) none 21) - (compute-bounding-box-from-vertices (_type_ vector vector) none 22) - (init-from-entity (_type_ entity-nav-mesh) none 23) - (handle-birth (_type_) none 24) - (handle-kill (_type_) none 25) - (update-navigation (_type_) none 26) - (new-nav-control (_type_ process-drawable) nav-control 27) - (remove-nav-control (_type_ nav-control) none 28) - (add-process-drawable-to-navmesh (_type_ process-drawable symbol) none 29) - (remove-process-drawable (_type_ process-drawable) none 30) - (change-to (_type_ process-drawable) none 31) - (link-by-id (_type_ uint) symbol 32) - (unlink-by-id (_type_ uint) symbol 33) - (nav-mesh-method-34 (_type_ vector vector float) float 34) - (nav-mesh-method-35 (_type_ vector vector float) float 35) - (debug-draw-poly (_type_ nav-poly rgba) none 36) - (point-in-poly? (_type_ nav-poly vector) symbol 37) - (nav-mesh-method-38 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector 38) - (closest-point-on-boundary (_type_ nav-poly vector vector) none 39) - (project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none 40) - (project-point-into-poly-2d (_type_ nav-poly vector vector) none 41) - (find-poly-containing-point-local (_type_ nav-find-poly-parms) nav-poly 42) - (find-nearest-poly-to-point-local (_type_ nav-find-poly-parms) nav-find-poly-parms 43) - (is-in-mesh-local? (_type_ vector float float) symbol 44) - (link-to-other-mesh (_type_ nav-mesh-link) symbol 45) - (unlink-mesh (_type_ nav-mesh-link) none 46) + (debug-draw (_type_) none) + (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly) + (poly-centroid (_type_ nav-poly vector) vector) + (poly-centroid-local (_type_ nav-poly vector) vector) + (lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly) + (get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex)) + (initialize-mesh! (_type_) none) + (move-along-nav-ray! (_type_ nav-ray) none) + (try-move-along-ray (_type_ nav-poly vector vector float) meters) + (clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none) + (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) + (set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none) + (find-adjacent-bounds-one (_type_ vector nav-poly int int) none) + (compute-bounding-box-from-vertices (_type_ vector vector) none) + (init-from-entity (_type_ entity-nav-mesh) none) + (handle-birth (_type_) none) + (handle-kill (_type_) none) + (update-navigation (_type_) none) + (new-nav-control (_type_ process-drawable) nav-control) + (remove-nav-control (_type_ nav-control) none) + (add-process-drawable-to-navmesh (_type_ process-drawable symbol) none) + (remove-process-drawable (_type_ process-drawable) none) + (change-to (_type_ process-drawable) none) + (link-by-id (_type_ uint) symbol) + (unlink-by-id (_type_ uint) symbol) + (nav-mesh-method-34 (_type_ vector vector float) float) + (nav-mesh-method-35 (_type_ vector vector float) float) + (debug-draw-poly (_type_ nav-poly rgba) none) + (point-in-poly? (_type_ nav-poly vector) symbol) + (nav-mesh-method-38 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector) + (closest-point-on-boundary (_type_ nav-poly vector vector) none) + (project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none) + (project-point-into-poly-2d (_type_ nav-poly vector vector) none) + (find-poly-containing-point-local (_type_ nav-find-poly-parms) nav-poly) + (find-nearest-poly-to-point-local (_type_ nav-find-poly-parms) nav-find-poly-parms) + (is-in-mesh-local? (_type_ vector float float) symbol) + (link-to-other-mesh (_type_ nav-mesh-link) symbol) + (unlink-mesh (_type_ nav-mesh-link) none) ) ) ;; definition for method 3 of type nav-mesh -(defmethod inspect nav-mesh ((this nav-mesh)) +(defmethod inspect ((this nav-mesh)) (when (not this) (set! this this) (goto cfg-6) @@ -635,7 +602,7 @@ and declared out of order (cannot use forward declared structures in inline arra ) ;; definition for method 37 of type nav-mesh -(defmethod point-in-poly? nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod point-in-poly? ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (let* ((a3-0 this) (v1-0 arg1) (a0-1 (-> arg0 vertex-count)) @@ -668,7 +635,7 @@ and declared out of order (cannot use forward declared structures in inline arra ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Return type mismatch vector vs none. -(defmethod closest-point-on-boundary nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod closest-point-on-boundary ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (set! sv-48 (new 'stack-no-clear 'vector)) (set! sv-52 (new 'stack-no-clear 'vector)) @@ -697,7 +664,7 @@ and declared out of order (cannot use forward declared structures in inline arra ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Return type mismatch vector vs none. -(defmethod project-point-into-poly-2d nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-poly-2d ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (cond ((point-in-poly? this arg0 arg2) @@ -779,7 +746,7 @@ and declared out of order (cannot use forward declared structures in inline arra ;; WARN: Stack slot offset 44 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod move-along-nav-ray! nav-mesh ((this nav-mesh) (ray nav-ray)) +(defmethod move-along-nav-ray! ((this nav-mesh) (ray nav-ray)) (local-vars (next-poly-idx int) (work nav-mesh-work) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc index 1ae06d8e05b..6f66c34cc26 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc @@ -354,7 +354,7 @@ ;; definition for method 27 of type entity-nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod initialize-nav-mesh! entity-nav-mesh ((this entity-nav-mesh)) +(defmethod initialize-nav-mesh! ((this entity-nav-mesh)) "Initialize the nav-mesh in this entity." (let ((v1-0 (-> this nav-mesh))) (if (nonzero? v1-0) @@ -366,7 +366,7 @@ ) ;; definition for method 22 of type entity-nav-mesh -(defmethod birth! entity-nav-mesh ((this entity-nav-mesh)) +(defmethod birth! ((this entity-nav-mesh)) (let ((a0-1 (-> this nav-mesh))) (if (nonzero? a0-1) (handle-birth a0-1) @@ -376,7 +376,7 @@ ) ;; definition for method 23 of type entity-nav-mesh -(defmethod kill! entity-nav-mesh ((this entity-nav-mesh)) +(defmethod kill! ((this entity-nav-mesh)) (if (-> this nav-mesh) (handle-kill (-> this nav-mesh)) ) @@ -386,7 +386,7 @@ ;; definition for method 28 of type entity-nav-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw entity-nav-mesh ((this entity-nav-mesh)) +(defmethod debug-draw ((this entity-nav-mesh)) (add-debug-x #t (bucket-id debug-no-zbuf1) @@ -434,7 +434,7 @@ ;; definition for method 31 of type entity-actor ;; INFO: Used lq/sq -(defmethod get-simple-travel-vector entity-actor ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 object) (arg4 float)) +(defmethod get-simple-travel-vector ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 object) (arg4 float)) (local-vars (at-0 int) (at-1 int)) (with-pp (rlet ((vf0 :class vf) @@ -504,7 +504,7 @@ ;; definition for method 32 of type entity-actor ;; INFO: Used lq/sq -(defmethod project-point-to-nav-mesh entity-actor ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 nav-poly) (arg3 float)) +(defmethod project-point-to-nav-mesh ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 nav-poly) (arg3 float)) (local-vars (sv-16 vector)) (let ((gp-0 (nav-mesh-from-res-tag this 'nav-mesh-actor 0))) (cond @@ -535,14 +535,14 @@ ;; definition for method 4 of type nav-mesh ;; WARN: Return type mismatch uint vs int. -(defmethod length nav-mesh ((this nav-mesh)) +(defmethod length ((this nav-mesh)) (the-as int (-> this poly-count)) ) ;; definition for method 36 of type nav-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-poly nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) +(defmethod debug-draw-poly ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) (set! (-> gp-0 0 quad) (-> this bounds quad)) (if (logtest? (-> arg0 pat) 7) @@ -588,7 +588,7 @@ ) ;; definition for method 27 of type nav-mesh -(defmethod new-nav-control nav-mesh ((this nav-mesh) (arg0 process-drawable)) +(defmethod new-nav-control ((this nav-mesh) (arg0 process-drawable)) (let ((gp-0 (the-as nav-control #f))) (dotimes (v1-0 (the-as int (-> this nav-control-count))) (let ((a1-2 (-> this nav-control-array v1-0))) @@ -623,7 +623,7 @@ ;; definition for method 28 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod remove-nav-control nav-mesh ((this nav-mesh) (arg0 nav-control)) +(defmethod remove-nav-control ((this nav-mesh) (arg0 nav-control)) (set! (-> arg0 process) #f) (let ((v1-1 (+ (-> this nav-control-count) -1))) (while (and (>= v1-1 0) (not (-> this nav-control-array v1-1 process))) @@ -637,7 +637,7 @@ ;; definition for method 29 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod add-process-drawable-to-navmesh nav-mesh ((this nav-mesh) (arg0 process-drawable) (arg1 symbol)) +(defmethod add-process-drawable-to-navmesh ((this nav-mesh) (arg0 process-drawable) (arg1 symbol)) (if arg1 (change-to this arg0) (add-connection (-> this user-list) arg0 nothing arg0 #f (-> arg0 root)) @@ -648,7 +648,7 @@ ;; definition for method 30 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod remove-process-drawable nav-mesh ((this nav-mesh) (arg0 process-drawable)) +(defmethod remove-process-drawable ((this nav-mesh) (arg0 process-drawable)) (remove-from-process (-> this user-list) arg0) (let ((a1-2 (-> arg0 nav))) (when (nonzero? a1-2) @@ -662,7 +662,7 @@ ;; definition for method 31 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod change-to nav-mesh ((this nav-mesh) (arg0 process-drawable)) +(defmethod change-to ((this nav-mesh) (arg0 process-drawable)) (local-vars (v1-5 symbol)) (let ((gp-0 arg0)) (b! (nonzero? (-> this user-list)) cfg-2 :delay (empty-form)) @@ -716,7 +716,7 @@ ) ;; definition for method 45 of type nav-mesh -(defmethod link-to-other-mesh nav-mesh ((this nav-mesh) (arg0 nav-mesh-link)) +(defmethod link-to-other-mesh ((this nav-mesh) (arg0 nav-mesh-link)) (when (not (-> arg0 dest-mesh)) (let* ((s4-0 (entity-nav-mesh-by-aid (the-as actor-id (-> arg0 dest-mesh-id)))) (v1-1 (if (type? s4-0 entity-nav-mesh) @@ -756,7 +756,7 @@ ;; definition for method 46 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod unlink-mesh nav-mesh ((this nav-mesh) (arg0 nav-mesh-link)) +(defmethod unlink-mesh ((this nav-mesh) (arg0 nav-mesh-link)) (let ((a0-1 (-> arg0 dest-mesh))) (when a0-1 (let ((v1-0 (the-as nav-mesh-link #f))) @@ -783,7 +783,7 @@ ) ;; definition for method 32 of type nav-mesh -(defmethod link-by-id nav-mesh ((this nav-mesh) (arg0 uint)) +(defmethod link-by-id ((this nav-mesh) (arg0 uint)) "arg1 is a [[nav-mesh-link]] `id`" (let ((v1-0 (the-as nav-mesh-link #f))) (dotimes (a2-0 (the-as int (-> this link-count))) @@ -802,7 +802,7 @@ ) ;; definition for method 33 of type nav-mesh -(defmethod unlink-by-id nav-mesh ((this nav-mesh) (arg0 uint)) +(defmethod unlink-by-id ((this nav-mesh) (arg0 uint)) "arg1 is a [[nav-mesh-link]] `id`" (let ((v1-0 (the-as nav-mesh-link #f))) (dotimes (a2-0 (the-as int (-> this link-count))) @@ -824,7 +824,7 @@ ;; definition for method 23 of type nav-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-from-entity nav-mesh ((this nav-mesh) (arg0 entity-nav-mesh)) +(defmethod init-from-entity ((this nav-mesh) (arg0 entity-nav-mesh)) "Initialize this mesh from an entity." (local-vars (sv-16 res-tag)) (set! (-> this entity) arg0) @@ -860,7 +860,7 @@ ;; definition for method 24 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod handle-birth nav-mesh ((this nav-mesh)) +(defmethod handle-birth ((this nav-mesh)) "Handle the parent nav-mesh-entity birth." (dotimes (s5-0 (the-as int (-> this link-count))) (let ((a1-0 (-> this link-array s5-0))) @@ -875,7 +875,7 @@ ;; definition for method 25 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod handle-kill nav-mesh ((this nav-mesh)) +(defmethod handle-kill ((this nav-mesh)) "Handle the parent nav-mesh-entity kill." (when (nonzero? (-> this user-list)) (countdown (s5-0 (-> this nav-control-count)) @@ -904,24 +904,21 @@ ;; definition of type nav-engine-spr-buffer (deftype nav-engine-spr-buffer (structure) - ((mem-addr (pointer nav-mesh) :offset-assert 0) - (mem-nav uint32 :offset 0) - (spr-addr (inline-array nav-control) :offset-assert 4) - (spr-nav uint32 :offset 4) - (q-size uint32 :offset-assert 8) - (i-nav uint8 :offset-assert 12) - (done int8 :offset-assert 13) - (nav-count int8 :offset-assert 14) - (i-pass int8 :offset-assert 15) + ((mem-addr (pointer nav-mesh)) + (mem-nav uint32 :overlay-at mem-addr) + (spr-addr (inline-array nav-control)) + (spr-nav uint32 :overlay-at spr-addr) + (q-size uint32) + (i-nav uint8) + (done int8) + (nav-count int8) + (i-pass int8) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type nav-engine-spr-buffer -(defmethod inspect nav-engine-spr-buffer ((this nav-engine-spr-buffer)) +(defmethod inspect ((this nav-engine-spr-buffer)) (when (not this) (set! this this) (goto cfg-4) @@ -942,49 +939,46 @@ ;; definition of type nav-engine (deftype nav-engine (structure) - ((spr-addr uint32 :offset-assert 0) - (nav-work-addr uint32 :offset-assert 4) - (nav-mesh-addr nav-mesh :offset-assert 8) - (poly-array-addr uint32 :offset-assert 12) - (hash-sphere-addr uint32 :offset-assert 16) - (hash-buckets-addr uint32 :offset-assert 20) - (buf-nav-control-count int8 :offset-assert 24) - (max-pass-count int8 :offset-assert 25) - (output-sphere-hash uint8 :offset-assert 26) - (work-buf-array nav-engine-spr-buffer 3 :inline :offset-assert 28) - (spr-work nav-mesh-work :offset 4) - (mem-work nav-mesh-work :offset-assert 76) - (spr-mesh nav-mesh :offset 8) - (mem-mesh nav-mesh :offset-assert 80) - (spr-poly-array uint32 :offset 12) - (mem-poly-array (inline-array nav-poly) :offset-assert 84) - (hash-sphere-list uint32 :offset 16) - (hash-buckets uint32 :offset 20) - (to-spr-wait uint32 :offset-assert 88) - (from-spr-wait uint32 :offset-assert 92) + ((spr-addr uint32) + (nav-work-addr uint32) + (nav-mesh-addr nav-mesh) + (poly-array-addr uint32) + (hash-sphere-addr uint32) + (hash-buckets-addr uint32) + (buf-nav-control-count int8) + (max-pass-count int8) + (output-sphere-hash uint8) + (work-buf-array nav-engine-spr-buffer 3 :inline) + (spr-work nav-mesh-work :overlay-at nav-work-addr) + (mem-work nav-mesh-work) + (spr-mesh nav-mesh :overlay-at nav-mesh-addr) + (mem-mesh nav-mesh) + (spr-poly-array uint32 :overlay-at poly-array-addr) + (mem-poly-array (inline-array nav-poly)) + (hash-sphere-list uint32 :overlay-at hash-sphere-addr) + (hash-buckets uint32 :overlay-at hash-buckets-addr) + (to-spr-wait uint32) + (from-spr-wait uint32) ) - :method-count-assert 22 - :size-assert #x60 - :flag-assert #x1600000060 (:methods - (inc-spr-addr! (_type_ uint) uint 9) - (lay-out-spad-memory (_type_ nav-mesh) none 10) - (set-up-mem-work (_type_) none 11) - (add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none 12) - (add-all-spheres (_type_) none 13) - (do-sphere-lookups (_type_) none 14) - (update-nav-controls-pipelined-in-spr (_type_) none 15) - (update-nav-controls-in-spr (_type_) none 16) - (upload-nav-to-spr (_type_ nav-engine-spr-buffer) none 17) - (download-nav-from-spr (_type_ nav-engine-spr-buffer) none 18) - (do-callbacks (_type_ nav-engine-spr-buffer) none 19) - (reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none 20) - (reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none 21) + (inc-spr-addr! (_type_ uint) uint) + (lay-out-spad-memory (_type_ nav-mesh) none) + (set-up-mem-work (_type_) none) + (add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none) + (add-all-spheres (_type_) none) + (do-sphere-lookups (_type_) none) + (update-nav-controls-pipelined-in-spr (_type_) none) + (update-nav-controls-in-spr (_type_) none) + (upload-nav-to-spr (_type_ nav-engine-spr-buffer) none) + (download-nav-from-spr (_type_ nav-engine-spr-buffer) none) + (do-callbacks (_type_ nav-engine-spr-buffer) none) + (reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none) + (reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none) ) ) ;; definition for method 3 of type nav-engine -(defmethod inspect nav-engine ((this nav-engine)) +(defmethod inspect ((this nav-engine)) (when (not this) (set! this this) (goto cfg-4) @@ -1015,7 +1009,7 @@ ) ;; definition for method 9 of type nav-engine -(defmethod inc-spr-addr! nav-engine ((this nav-engine) (arg0 uint)) +(defmethod inc-spr-addr! ((this nav-engine) (arg0 uint)) "Adds the given integer to `spr-addr` and returns it" (let ((v0-0 (-> this spr-addr))) (+! (-> this spr-addr) arg0) @@ -1025,7 +1019,7 @@ ;; definition for method 10 of type nav-engine ;; WARN: Return type mismatch int vs none. -(defmethod lay-out-spad-memory nav-engine ((this nav-engine) (arg0 nav-mesh)) +(defmethod lay-out-spad-memory ((this nav-engine) (arg0 nav-mesh)) (let ((s5-0 0)) (set! (-> this spr-addr) (the-as uint #x70000060)) (let* ((v1-1 this) @@ -1111,7 +1105,7 @@ ;; definition for method 11 of type nav-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-up-mem-work nav-engine ((this nav-engine)) +(defmethod set-up-mem-work ((this nav-engine)) (let ((v1-0 (-> this mem-mesh))) (set! (-> v1-0 poly-array) (-> this mem-poly-array)) (set! (-> v1-0 work) (-> this mem-work)) @@ -1123,7 +1117,7 @@ ;; definition for method 12 of type nav-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod add-spheres-from-mesh-user-list nav-engine ((this nav-engine) (arg0 sphere-hash) (arg1 nav-mesh)) +(defmethod add-spheres-from-mesh-user-list ((this nav-engine) (arg0 sphere-hash) (arg1 nav-mesh)) (countdown (s3-0 (-> arg1 static-sphere-count)) (add-a-sphere-with-flag arg0 (-> arg1 static-sphere s3-0) 64) ) @@ -1210,7 +1204,7 @@ ;; definition for method 13 of type nav-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod add-all-spheres nav-engine ((this nav-engine)) +(defmethod add-all-spheres ((this nav-engine)) (let ((s4-0 (-> this nav-mesh-addr)) (gp-0 (-> this nav-mesh-addr sphere-hash)) ) @@ -1247,7 +1241,7 @@ ;; definition for method 14 of type nav-engine ;; WARN: Return type mismatch int vs none. -(defmethod do-sphere-lookups nav-engine ((this nav-engine)) +(defmethod do-sphere-lookups ((this nav-engine)) (let ((s5-0 (-> this nav-mesh-addr))) (dotimes (s4-0 (the-as int (-> s5-0 nav-control-count))) (let ((a0-3 (-> s5-0 nav-control-array s4-0))) @@ -1300,7 +1294,7 @@ ;; definition for method 19 of type nav-engine ;; WARN: Return type mismatch int vs none. -(defmethod do-callbacks nav-engine ((this nav-engine) (arg0 nav-engine-spr-buffer)) +(defmethod do-callbacks ((this nav-engine) (arg0 nav-engine-spr-buffer)) (local-vars (sv-16 nav-callback-info)) (with-pp (dotimes (s4-0 (-> arg0 nav-count)) @@ -1342,7 +1336,7 @@ ;; definition for method 15 of type nav-engine ;; WARN: Return type mismatch int vs none. -(defmethod update-nav-controls-pipelined-in-spr nav-engine ((this nav-engine)) +(defmethod update-nav-controls-pipelined-in-spr ((this nav-engine)) (local-vars (v1-33 int) (v1-45 int) @@ -1441,7 +1435,7 @@ ;; definition for method 16 of type nav-engine ;; WARN: Return type mismatch int vs none. -(defmethod update-nav-controls-in-spr nav-engine ((this nav-engine)) +(defmethod update-nav-controls-in-spr ((this nav-engine)) (flush-cache 0) (set! (-> this max-pass-count) 1) (let ((gp-0 (the-as object (-> this work-buf-array)))) @@ -1494,7 +1488,7 @@ ;; definition for method 26 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod update-navigation nav-mesh ((this nav-mesh)) +(defmethod update-navigation ((this nav-mesh)) (local-vars (sp-0 int)) (when (zero? (-> this next-nav-mesh)) (set! (-> this next-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> this entity) 'next-actor 0))) @@ -1533,7 +1527,7 @@ ;; definition for method 9 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw nav-mesh ((this nav-mesh)) +(defmethod debug-draw ((this nav-mesh)) (local-vars (sv-32 vector) (sv-36 int)) (set! sv-32 (new 'stack-no-clear 'vector)) (set! sv-36 16) @@ -1614,7 +1608,7 @@ ) ;; definition for method 12 of type nav-mesh -(defmethod poly-centroid-local nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod poly-centroid-local ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((v1-0 (new 'stack-no-clear 'nav-vertex))) @@ -1628,7 +1622,7 @@ ) ;; definition for method 11 of type nav-mesh -(defmethod poly-centroid nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod poly-centroid ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (poly-centroid-local this arg0 arg1) (vector+! arg1 arg1 (-> this bounds)) ) @@ -1692,7 +1686,7 @@ ) ;; definition for method 42 of type nav-mesh -(defmethod find-poly-containing-point-local nav-mesh ((this nav-mesh) (arg0 nav-find-poly-parms)) +(defmethod find-poly-containing-point-local ((this nav-mesh) (arg0 nav-find-poly-parms)) (local-vars (v1-6 symbol) (v1-15 int) (a0-3 symbol) (sv-16 nav-poly)) (let ((s4-0 (search-for-point (-> this poly-hash) (-> arg0 point))) (s3-0 (-> this poly-hash bucket-size)) @@ -1745,7 +1739,7 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 24 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch -(defmethod is-in-mesh-local? nav-mesh ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod is-in-mesh-local? ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 float)) (local-vars (v1-3 float) (sv-16 float) (sv-20 vector) (sv-24 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1914,7 +1908,7 @@ ) ;; definition for method 17 of type nav-mesh -(defmethod try-move-along-ray nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod try-move-along-ray ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (v1-2 symbol)) (let ((gp-0 (new 'stack-no-clear 'nav-ray))) (let ((s4-0 0)) @@ -2034,7 +2028,7 @@ ;; WARN: Stack slot offset 28 signed mismatch ;; WARN: Stack slot offset 52 signed mismatch ;; WARN: Stack slot offset 28 signed mismatch -(defmethod find-nearest-poly-to-point-local nav-mesh ((this nav-mesh) (arg0 nav-find-poly-parms)) +(defmethod find-nearest-poly-to-point-local ((this nav-mesh) (arg0 nav-find-poly-parms)) (local-vars (v1-16 int) (v1-34 int) @@ -2157,7 +2151,7 @@ ;; definition for method 14 of type nav-mesh ;; INFO: Used lq/sq -(defmethod get-route-portal nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) +(defmethod get-route-portal ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) (set! (-> arg2 next-poly) #f) (cond ((and arg0 arg1 (!= arg0 arg1)) @@ -2201,7 +2195,7 @@ ) ;; definition for method 13 of type nav-mesh -(defmethod lookup-poly-on-route-to-target nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) +(defmethod lookup-poly-on-route-to-target ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) (cond ((and arg0 arg1 (!= arg0 arg1)) (let* ((a3-0 this) @@ -2234,7 +2228,7 @@ ;; definition for method 22 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod compute-bounding-box-from-vertices nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector)) +(defmethod compute-bounding-box-from-vertices ((this nav-mesh) (arg0 vector) (arg1 vector)) (let ((f0-0 10000000000000000000000000000000000000.0) (f1-0 -10000000000000000000000000000000000000.0) ) @@ -2267,7 +2261,7 @@ ;; definition for method 15 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod initialize-mesh! nav-mesh ((this nav-mesh)) +(defmethod initialize-mesh! ((this nav-mesh)) (local-vars (sv-32 vector) (sv-36 uint) @@ -2415,7 +2409,7 @@ ;; definition for method 38 of type nav-mesh ;; INFO: Used lq/sq -(defmethod nav-mesh-method-38 nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 (pointer nav-poly))) +(defmethod nav-mesh-method-38 ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 (pointer nav-poly))) (local-vars (s1-0 vector) (sv-16 int) @@ -2541,7 +2535,7 @@ ;; definition for method 40 of type nav-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod project-point-onto-plane-of-poly-local nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod project-point-onto-plane-of-poly-local ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (new 'stack-no-clear 'vector))) (cond @@ -2576,7 +2570,7 @@ ;; definition for method 8 of type nav-mesh ;; WARN: Return type mismatch int vs nav-mesh. -(defmethod mem-usage nav-mesh ((this nav-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this nav-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) @@ -2679,7 +2673,7 @@ ) ;; definition for method 10 of type nav-mesh -(defmethod nav-mesh-method-10 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 nav-poly)) +(defmethod nav-mesh-method-10 ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 nav-poly)) (local-vars (sv-16 vector)) (set! sv-16 arg0) (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) @@ -2731,7 +2725,7 @@ ;; definition for method 34 of type nav-mesh ;; INFO: Used lq/sq -(defmethod nav-mesh-method-34 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod nav-mesh-method-34 ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) (local-vars (v1-8 symbol) (v1-13 int) (a1-2 symbol) (sv-80 vector) (sv-84 (pointer uint8))) (let ((gp-0 (new 'stack-no-clear 'nav-poly))) (set! sv-80 arg0) @@ -2793,7 +2787,7 @@ ;; definition for method 35 of type nav-mesh ;; INFO: Used lq/sq ;; WARN: new jak 2 until loop case, check carefully -(defmethod nav-mesh-method-35 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod nav-mesh-method-35 ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'nav-poly 3))) (set! (-> gp-0 2 vertex3 y) arg2) (vector-! (the-as vector (-> gp-0 0)) arg0 (-> this bounds)) diff --git a/test/decompiler/reference/jak2/engine/physics/chain-physics-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/chain-physics-h_REF.gc index 75a64fb2523..4f94f7863e2 100644 --- a/test/decompiler/reference/jak2/engine/physics/chain-physics-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/chain-physics-h_REF.gc @@ -3,15 +3,12 @@ ;; definition of type chain-physics-setup (deftype chain-physics-setup (structure) - ((joint-index int32 :offset-assert 0) + ((joint-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type chain-physics-setup -(defmethod inspect chain-physics-setup ((this chain-physics-setup)) +(defmethod inspect ((this chain-physics-setup)) (when (not this) (set! this this) (goto cfg-4) @@ -24,18 +21,15 @@ ;; definition of type chain-physics-joint (deftype chain-physics-joint (structure) - ((position vector :inline :offset-assert 0) - (velocity vector :inline :offset-assert 16) - (old-x vector :inline :offset-assert 32) - (joint-mod joint-mod :offset-assert 48) + ((position vector :inline) + (velocity vector :inline) + (old-x vector :inline) + (joint-mod joint-mod) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type chain-physics-joint -(defmethod inspect chain-physics-joint ((this chain-physics-joint)) +(defmethod inspect ((this chain-physics-joint)) (when (not this) (set! this this) (goto cfg-4) @@ -51,40 +45,37 @@ ;; definition of type chain-physics (deftype chain-physics (basic) - ((chain-joints chain-physics-joint 20 :inline :offset-assert 16) - (num-joints uint8 :offset-assert 1296) - (root-joint-index uint8 :offset-assert 1297) - (joint-length float :offset-assert 1300) - (gravity vector :inline :offset-assert 1312) - (gravity-target vector :inline :offset-assert 1328) - (stretch-vel float :offset-assert 1344) - (stretch-vel-parallel float :offset-assert 1348) - (compress-vel float :offset-assert 1352) - (compress-vel-parallel float :offset-assert 1356) - (negate-y symbol :offset-assert 1360) - (axial-slop float :offset-assert 1364) - (maximum-stretch float :offset-assert 1368) - (turn-off-start time-frame :offset-assert 1376) - (turn-off-duration time-frame :offset-assert 1384) + ((chain-joints chain-physics-joint 20 :inline) + (num-joints uint8) + (root-joint-index uint8) + (joint-length float) + (gravity vector :inline) + (gravity-target vector :inline) + (stretch-vel float) + (stretch-vel-parallel float) + (compress-vel float) + (compress-vel-parallel float) + (negate-y symbol) + (axial-slop float) + (maximum-stretch float) + (turn-off-start time-frame) + (turn-off-duration time-frame) ) - :method-count-assert 18 - :size-assert #x570 - :flag-assert #x1200000570 (:methods - (initialize-chain-joints (_type_) symbol 9) - (turn-off (_type_ time-frame) none :behavior process 10) - (update (_type_ process-drawable) none :behavior process 11) - (gravity-update (_type_ process-drawable) none 12) - (apply-gravity (_type_ vector int process-drawable) none :behavior process 13) - (chain-physics-method-14 (_type_ vector int) none 14) - (clamp-length (_type_ vector vector object process-drawable) vector 15) - (chain-physics-method-16 (_type_ int) float 16) - (chain-physics-method-17 (_type_ vector int) none 17) + (initialize-chain-joints (_type_) symbol) + (turn-off (_type_ time-frame) none :behavior process) + (update (_type_ process-drawable) none :behavior process) + (gravity-update (_type_ process-drawable) none) + (apply-gravity (_type_ vector int process-drawable) none :behavior process) + (chain-physics-method-14 (_type_ vector int) none) + (clamp-length (_type_ vector vector object process-drawable) vector) + (chain-physics-method-16 (_type_ int) float) + (chain-physics-method-17 (_type_ vector int) none) ) ) ;; definition for method 3 of type chain-physics -(defmethod inspect chain-physics ((this chain-physics)) +(defmethod inspect ((this chain-physics)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/physics/chain-physics_REF.gc b/test/decompiler/reference/jak2/engine/physics/chain-physics_REF.gc index f6c560b6bf2..d27edb27f64 100644 --- a/test/decompiler/reference/jak2/engine/physics/chain-physics_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/chain-physics_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 12 of type chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod gravity-update chain-physics ((this chain-physics) (arg0 process-drawable)) +(defmethod gravity-update ((this chain-physics) (arg0 process-drawable)) (vector-seek-3d-smooth! (-> this gravity) (-> this gravity-target) 0.05 0.1) 0 (none) @@ -11,7 +11,7 @@ ;; definition for method 13 of type chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod apply-gravity chain-physics ((this chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity ((this chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (vector-float*! arg0 (-> this gravity) @@ -23,7 +23,7 @@ ;; definition for method 14 of type chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-14 chain-physics ((this chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 ((this chain-physics) (arg0 vector) (arg1 int)) (vector-float*! arg0 (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 1) 64))) @@ -34,7 +34,7 @@ ) ;; definition for method 15 of type chain-physics -(defmethod clamp-length chain-physics ((this chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) +(defmethod clamp-length ((this chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 arg0 arg1) (vector-normalize! gp-0 (-> this joint-length)) @@ -43,19 +43,19 @@ ) ;; definition for method 16 of type chain-physics -(defmethod chain-physics-method-16 chain-physics ((this chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 ((this chain-physics) (arg0 int)) (lerp-scale 5461.3335 10922.667 (the float arg0) 0.0 8.0) ) ;; definition for method 17 of type chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-17 chain-physics ((this chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-17 ((this chain-physics) (arg0 vector) (arg1 int)) 0 (none) ) ;; definition for method 9 of type chain-physics -(defmethod initialize-chain-joints chain-physics ((this chain-physics)) +(defmethod initialize-chain-joints ((this chain-physics)) (set! (-> this turn-off-start) 0) (dotimes (s5-0 (the-as int (-> this num-joints))) (let ((s4-0 (-> this chain-joints s5-0))) @@ -69,7 +69,7 @@ ;; definition for method 10 of type chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod turn-off chain-physics ((this chain-physics) (arg0 time-frame)) +(defmethod turn-off ((this chain-physics) (arg0 time-frame)) (set-time! (-> this turn-off-start)) (set! (-> this turn-off-duration) arg0) 0 @@ -79,7 +79,7 @@ ;; definition for method 11 of type chain-physics ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update chain-physics ((this chain-physics) (arg0 process-drawable)) +(defmethod update ((this chain-physics) (arg0 process-drawable)) (local-vars (v1-78 float) (f0-11 float) @@ -356,7 +356,7 @@ ) ;; definition for method 7 of type chain-physics -(defmethod relocate chain-physics ((this chain-physics) (arg0 int)) +(defmethod relocate ((this chain-physics) (arg0 int)) (dotimes (v1-0 (the-as int (-> this num-joints))) (if (nonzero? (-> this chain-joints v1-0 joint-mod)) (&+! (-> this chain-joints v1-0 joint-mod) arg0) diff --git a/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc index 7572ba0d213..b5bf70a05a3 100644 --- a/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc @@ -3,24 +3,21 @@ ;; definition of type dynamics (deftype dynamics (basic) - ((name symbol :offset-assert 4) - (gravity-max meters :offset-assert 8) - (gravity-length meters :offset-assert 12) - (gravity vector :inline :offset-assert 16) - (gravity-normal vector :inline :offset-assert 32) - (walk-distance meters :offset-assert 48) - (run-distance meters :offset-assert 52) + ((name symbol) + (gravity-max meters) + (gravity-length meters) + (gravity vector :inline) + (gravity-normal vector :inline) + (walk-distance meters) + (run-distance meters) ) - :method-count-assert 10 - :size-assert #x38 - :flag-assert #xa00000038 (:methods - (set-gravity-length (_type_ float) none 9) + (set-gravity-length (_type_ float) none) ) ) ;; definition for method 3 of type dynamics -(defmethod inspect dynamics ((this dynamics)) +(defmethod inspect ((this dynamics)) (when (not this) (set! this this) (goto cfg-4) @@ -39,7 +36,7 @@ ;; definition for method 9 of type dynamics ;; WARN: Return type mismatch int vs none. -(defmethod set-gravity-length dynamics ((this dynamics) (arg0 float)) +(defmethod set-gravity-length ((this dynamics) (arg0 float)) (set! (-> this gravity-length) arg0) (vector-float*! (-> this gravity) (-> this gravity-normal) arg0) 0 diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc index f4628b9a2da..bd4319ab459 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc @@ -3,29 +3,26 @@ ;; definition of type rigid-body-info (deftype rigid-body-info (structure) - ((mass float :offset-assert 0) - (inv-mass float :offset-assert 4) - (linear-damping float :offset-assert 8) - (angular-damping float :offset-assert 12) - (bounce-factor float :offset-assert 16) - (friction-factor float :offset-assert 20) - (bounce-mult-factor float :offset-assert 24) - (unknown-k1hbn23 float :offset-assert 28) - (cm-offset-joint vector :inline :offset-assert 32) - (inv-inertial-tensor matrix :inline :offset-assert 48) - (inertial-tensor matrix :inline :offset-assert 112) - (inertial-tensor-box meters 3 :offset-assert 176) + ((mass float) + (inv-mass float) + (linear-damping float) + (angular-damping float) + (bounce-factor float) + (friction-factor float) + (bounce-mult-factor float) + (unknown-k1hbn23 float) + (cm-offset-joint vector :inline) + (inv-inertial-tensor matrix :inline) + (inertial-tensor matrix :inline) + (inertial-tensor-box meters 3) ) - :method-count-assert 10 - :size-assert #xbc - :flag-assert #xa000000bc (:methods - (rigid-body-info-method-9 (_type_) none 9) + (rigid-body-info-method-9 (_type_) none) ) ) ;; definition for method 3 of type rigid-body-info -(defmethod inspect rigid-body-info ((this rigid-body-info)) +(defmethod inspect ((this rigid-body-info)) (when (not this) (set! this this) (goto cfg-4) @@ -48,19 +45,16 @@ ;; definition of type rigid-body-object-extra-info (deftype rigid-body-object-extra-info (structure) - ((max-time-step float :offset-assert 0) - (gravity meters :offset-assert 4) - (idle-distance meters :offset-assert 8) - (attack-force-scale float :offset-assert 12) + ((max-time-step float) + (gravity meters) + (idle-distance meters) + (attack-force-scale float) ) :pack-me - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type rigid-body-object-extra-info -(defmethod inspect rigid-body-object-extra-info ((this rigid-body-object-extra-info)) +(defmethod inspect ((this rigid-body-object-extra-info)) (when (not this) (set! this this) (goto cfg-4) @@ -76,29 +70,26 @@ ;; definition of type rigid-body-object-constants (deftype rigid-body-object-constants (structure) - ((info rigid-body-info :inline :offset-assert 0) - (cm-joint vector :inline :offset 32) - (cm-joint-x meters :offset 32) - (cm-joint-y meters :offset 36) - (cm-joint-z meters :offset 40) - (cm-joint-w meters :offset 44) - (linear-damping float :offset 8) - (angular-damping float :offset 12) - (bounce-factor float :offset 16) - (friction-factor float :offset 20) - (inertial-tensor-x meters :offset 176) - (inertial-tensor-y meters :offset 180) - (inertial-tensor-z meters :offset 184) - (extra rigid-body-object-extra-info :inline :offset-assert 188) - (name symbol :offset-assert 204) + ((info rigid-body-info :inline) + (cm-joint vector :inline :overlay-at (-> info cm-offset-joint)) + (cm-joint-x meters :overlay-at (-> info cm-offset-joint data 0)) + (cm-joint-y meters :overlay-at (-> info cm-offset-joint data 1)) + (cm-joint-z meters :overlay-at (-> info cm-offset-joint data 2)) + (cm-joint-w meters :overlay-at (-> info cm-offset-joint data 3)) + (linear-damping float :overlay-at (-> info linear-damping)) + (angular-damping float :overlay-at (-> info angular-damping)) + (bounce-factor float :overlay-at (-> info bounce-factor)) + (friction-factor float :overlay-at (-> info friction-factor)) + (inertial-tensor-x meters :overlay-at (-> info inertial-tensor-box 0)) + (inertial-tensor-y meters :overlay-at (-> info inertial-tensor-box 1)) + (inertial-tensor-z meters :overlay-at (-> info inertial-tensor-box 2)) + (extra rigid-body-object-extra-info :inline) + (name symbol) ) - :method-count-assert 9 - :size-assert #xd0 - :flag-assert #x9000000d0 ) ;; definition for method 3 of type rigid-body-object-constants -(defmethod inspect rigid-body-object-constants ((this rigid-body-object-constants)) +(defmethod inspect ((this rigid-body-object-constants)) (when (not this) (set! this this) (goto cfg-4) @@ -129,21 +120,18 @@ ;; definition of type rigid-body-impact (deftype rigid-body-impact (structure) - ((point vector :inline :offset-assert 0) - (normal vector :inline :offset-assert 16) - (velocity vector :inline :offset-assert 32) - (impulse float :offset-assert 48) - (pat pat-surface :offset-assert 52) - (rbody basic :offset-assert 56) - (prim-id uint32 :offset-assert 60) + ((point vector :inline) + (normal vector :inline) + (velocity vector :inline) + (impulse float) + (pat pat-surface) + (rbody basic) + (prim-id uint32) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type rigid-body-impact -(defmethod inspect rigid-body-impact ((this rigid-body-impact)) +(defmethod inspect ((this rigid-body-impact)) (when (not this) (set! this this) (goto cfg-4) @@ -162,57 +150,54 @@ ;; definition of type rigid-body (deftype rigid-body (structure) - ((work rigid-body-work :offset-assert 0) - (info rigid-body-info :offset-assert 4) - (flags rigid-body-flag :offset-assert 8) - (force-callback (function object float none) :offset-assert 12) - (blocked-by rigid-body-object :offset-assert 16) - (time-remaining float :offset-assert 20) - (step-count int16 :offset-assert 24) - (position vector :inline :offset-assert 32) - (rot vector :inline :offset-assert 48) - (rotation quaternion :inline :offset 48) - (lin-momentum vector :inline :offset-assert 64) - (ang-momentum vector :inline :offset-assert 80) - (force vector :inline :offset-assert 96) - (torque vector :inline :offset-assert 112) - (lin-velocity vector :inline :offset-assert 128) - (ang-velocity vector :inline :offset-assert 144) - (matrix matrix :inline :offset-assert 160) - (inv-i-world matrix :inline :offset-assert 224) + ((work rigid-body-work) + (info rigid-body-info) + (flags rigid-body-flag) + (force-callback (function object float none)) + (blocked-by rigid-body-object) + (time-remaining float) + (step-count int16) + (position vector :inline) + (rot vector :inline) + (rotation quaternion :inline :overlay-at (-> rot data 0)) + (lin-momentum vector :inline) + (ang-momentum vector :inline) + (force vector :inline) + (torque vector :inline) + (lin-velocity vector :inline) + (ang-velocity vector :inline) + (matrix matrix :inline) + (inv-i-world matrix :inline) ) - :method-count-assert 32 - :size-assert #x120 - :flag-assert #x2000000120 (:methods - (rigid-body-method-9 (_type_ collide-shape-moving float) none 9) - (rigid-body-method-10 (_type_) none 10) - (rigid-body-method-11 (_type_ collide-shape-moving) none 11) - (rigid-body-method-12 (_type_ float) none 12) - (rigid-body-method-13 (_type_) none 13) - (rigid-body-method-14 (_type_ float) none 14) - (rigid-body-method-15 (_type_ collide-shape-moving float) none 15) - (clear-force-torque! (_type_) none 16) - (clear-momentum! (_type_) none 17) - (rigid-body-method-18 (_type_ vector vector) none 18) - (rigid-body-method-19 (_type_ vector vector) none 19) - (rigid-body-method-20 (_type_ vector) none 20) - (rigid-body-method-21 (_type_ vector vector float) none 21) - (rigid-body-method-22 (_type_ vector vector) vector 22) - (rigid-body-method-23 (_type_ vector) vector 23) - (rigid-body-method-24 (_type_) none 24) - (rigid-body-method-25 (_type_ rigid-body-info vector quaternion function) none 25) - (rigid-body-method-26 (_type_ vector quaternion) none 26) - (print-physics (_type_ object) none 27) - (print-force-torque (_type_ object) none 28) - (print-position-rotation (_type_ object) none 29) - (print-momentum (_type_ object) none 30) - (print-velocity (_type_ object) none 31) + (rigid-body-method-9 (_type_ collide-shape-moving float) none) + (rigid-body-method-10 (_type_) none) + (rigid-body-method-11 (_type_ collide-shape-moving) none) + (rigid-body-method-12 (_type_ float) none) + (rigid-body-method-13 (_type_) none) + (rigid-body-method-14 (_type_ float) none) + (rigid-body-method-15 (_type_ collide-shape-moving float) none) + (clear-force-torque! (_type_) none) + (clear-momentum! (_type_) none) + (rigid-body-method-18 (_type_ vector vector) none) + (rigid-body-method-19 (_type_ vector vector) none) + (rigid-body-method-20 (_type_ vector) none) + (rigid-body-method-21 (_type_ vector vector float) none) + (rigid-body-method-22 (_type_ vector vector) vector) + (rigid-body-method-23 (_type_ vector) vector) + (rigid-body-method-24 (_type_) none) + (rigid-body-method-25 (_type_ rigid-body-info vector quaternion function) none) + (rigid-body-method-26 (_type_ vector quaternion) none) + (print-physics (_type_ object) none) + (print-force-torque (_type_ object) none) + (print-position-rotation (_type_ object) none) + (print-momentum (_type_ object) none) + (print-velocity (_type_ object) none) ) ) ;; definition for method 3 of type rigid-body -(defmethod inspect rigid-body ((this rigid-body)) +(defmethod inspect ((this rigid-body)) (when (not this) (set! this this) (goto cfg-16) @@ -263,36 +248,33 @@ ;; definition of type rigid-body-control (deftype rigid-body-control (basic) - ((process process :offset-assert 4) - (state rigid-body :inline :offset-assert 16) + ((process process) + (state rigid-body :inline) ) - :method-count-assert 26 - :size-assert #x130 - :flag-assert #x1a00000130 (:methods - (new (symbol type process) _type_ 0) - (rigid-body-control-method-9 (_type_ collide-shape-moving float) none 9) - (rigid-body-control-method-10 (_type_ rigid-body-object float float) object 10) - (rigid-body-control-method-11 (_type_ collide-shape-moving) none 11) - (rigid-body-control-method-12 (_type_ float) none 12) - (rigid-body-control-method-13 (_type_) none 13) - (rigid-body-control-method-14 (_type_ float) none 14) - (clear-force-torque! (_type_) none 15) - (clear-momentum! (_type_) none 16) - (rigid-body-control-method-17 (_type_ vector vector) none 17) - (rigid-body-control-method-18 (_type_ vector vector) none 18) - (rigid-body-control-method-19 (_type_ vector) none 19) - (rigid-body-control-method-20 (_type_ vector vector float) none 20) - (rigid-body-control-method-21 (_type_ vector vector) vector 21) - (rigid-body-control-method-22 (_type_ vector) vector 22) - (rigid-body-control-method-23 (_type_) none 23) - (rigid-body-control-method-24 (_type_ rigid-body-info vector quaternion basic) none 24) - (rigid-body-control-method-25 (_type_ vector quaternion) none 25) + (new (symbol type process) _type_) + (rigid-body-control-method-9 (_type_ collide-shape-moving float) none) + (rigid-body-control-method-10 (_type_ rigid-body-object float float) object) + (rigid-body-control-method-11 (_type_ collide-shape-moving) none) + (rigid-body-control-method-12 (_type_ float) none) + (rigid-body-control-method-13 (_type_) none) + (rigid-body-control-method-14 (_type_ float) none) + (clear-force-torque! (_type_) none) + (clear-momentum! (_type_) none) + (rigid-body-control-method-17 (_type_ vector vector) none) + (rigid-body-control-method-18 (_type_ vector vector) none) + (rigid-body-control-method-19 (_type_ vector) none) + (rigid-body-control-method-20 (_type_ vector vector float) none) + (rigid-body-control-method-21 (_type_ vector vector) vector) + (rigid-body-control-method-22 (_type_ vector) vector) + (rigid-body-control-method-23 (_type_) none) + (rigid-body-control-method-24 (_type_ rigid-body-info vector quaternion basic) none) + (rigid-body-control-method-25 (_type_ vector quaternion) none) ) ) ;; definition for method 3 of type rigid-body-control -(defmethod inspect rigid-body-control ((this rigid-body-control)) +(defmethod inspect ((this rigid-body-control)) (when (not this) (set! this this) (goto cfg-16) @@ -344,153 +326,151 @@ ) ;; definition for method 9 of type rigid-body-control -(defmethod rigid-body-control-method-9 rigid-body-control ((this rigid-body-control) (arg0 collide-shape-moving) (arg1 float)) +(defmethod rigid-body-control-method-9 ((this rigid-body-control) (arg0 collide-shape-moving) (arg1 float)) (rigid-body-method-9 (-> this state) arg0 arg1) (none) ) ;; definition for method 10 of type rigid-body-control ;; WARN: Return type mismatch none vs object. -(defmethod rigid-body-control-method-10 rigid-body-control ((this rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) +(defmethod rigid-body-control-method-10 ((this rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) (rigid-body-method-10 (-> this state)) ) ;; definition for method 11 of type rigid-body-control -(defmethod rigid-body-control-method-11 rigid-body-control ((this rigid-body-control) (arg0 collide-shape-moving)) +(defmethod rigid-body-control-method-11 ((this rigid-body-control) (arg0 collide-shape-moving)) (rigid-body-method-11 (-> this state) arg0) (none) ) ;; definition for method 12 of type rigid-body-control -(defmethod rigid-body-control-method-12 rigid-body-control ((this rigid-body-control) (arg0 float)) +(defmethod rigid-body-control-method-12 ((this rigid-body-control) (arg0 float)) (rigid-body-method-12 (-> this state) arg0) (none) ) ;; definition for method 13 of type rigid-body-control -(defmethod rigid-body-control-method-13 rigid-body-control ((this rigid-body-control)) +(defmethod rigid-body-control-method-13 ((this rigid-body-control)) (rigid-body-method-13 (-> this state)) (none) ) ;; definition for method 14 of type rigid-body-control -(defmethod rigid-body-control-method-14 rigid-body-control ((this rigid-body-control) (arg0 float)) +(defmethod rigid-body-control-method-14 ((this rigid-body-control) (arg0 float)) (rigid-body-method-14 (-> this state) arg0) (none) ) ;; definition for method 15 of type rigid-body-control -(defmethod clear-force-torque! rigid-body-control ((this rigid-body-control)) +(defmethod clear-force-torque! ((this rigid-body-control)) (clear-force-torque! (-> this state)) (none) ) ;; definition for method 16 of type rigid-body-control -(defmethod clear-momentum! rigid-body-control ((this rigid-body-control)) +(defmethod clear-momentum! ((this rigid-body-control)) (clear-momentum! (-> this state)) (none) ) ;; definition for method 17 of type rigid-body-control -(defmethod rigid-body-control-method-17 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-control-method-17 ((this rigid-body-control) (arg0 vector) (arg1 vector)) (rigid-body-method-18 (-> this state) arg0 arg1) (none) ) ;; definition for method 18 of type rigid-body-control -(defmethod rigid-body-control-method-18 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-control-method-18 ((this rigid-body-control) (arg0 vector) (arg1 vector)) (rigid-body-method-19 (-> this state) arg0 arg1) (none) ) ;; definition for method 19 of type rigid-body-control -(defmethod rigid-body-control-method-19 rigid-body-control ((this rigid-body-control) (arg0 vector)) +(defmethod rigid-body-control-method-19 ((this rigid-body-control) (arg0 vector)) (rigid-body-method-20 (-> this state) arg0) (none) ) ;; definition for method 20 of type rigid-body-control -(defmethod rigid-body-control-method-20 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod rigid-body-control-method-20 ((this rigid-body-control) (arg0 vector) (arg1 vector) (arg2 float)) (rigid-body-method-21 (-> this state) arg0 arg1 arg2) (none) ) ;; definition for method 21 of type rigid-body-control -(defmethod rigid-body-control-method-21 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-control-method-21 ((this rigid-body-control) (arg0 vector) (arg1 vector)) (rigid-body-method-22 (-> this state) arg0 arg1) ) ;; definition for method 22 of type rigid-body-control -(defmethod rigid-body-control-method-22 rigid-body-control ((this rigid-body-control) (arg0 vector)) +(defmethod rigid-body-control-method-22 ((this rigid-body-control) (arg0 vector)) (rigid-body-method-23 (-> this state) arg0) ) ;; definition for method 23 of type rigid-body-control -(defmethod rigid-body-control-method-23 rigid-body-control ((this rigid-body-control)) +(defmethod rigid-body-control-method-23 ((this rigid-body-control)) (rigid-body-method-24 (-> this state)) (none) ) ;; definition for method 24 of type rigid-body-control -(defmethod rigid-body-control-method-24 rigid-body-control ((this rigid-body-control) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 basic)) +(defmethod rigid-body-control-method-24 ((this rigid-body-control) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 basic)) (rigid-body-method-25 (-> this state) arg0 arg1 arg2 (the-as function arg3)) (none) ) ;; definition for method 25 of type rigid-body-control -(defmethod rigid-body-control-method-25 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 quaternion)) +(defmethod rigid-body-control-method-25 ((this rigid-body-control) (arg0 vector) (arg1 quaternion)) (rigid-body-method-26 (-> this state) arg0 arg1) (none) ) ;; definition of type rigid-body-object (deftype rigid-body-object (process-focusable) - ((root collide-shape-moving :override) - (info rigid-body-object-constants :offset-assert 204) - (flags rigid-body-object-flag :offset-assert 208) - (max-time-step float :offset-assert 216) - (incoming-attack-id uint32 :offset-assert 220) - (player-touch-time time-frame :offset-assert 224) - (disturbed-time time-frame :offset-assert 232) - (player-force-position vector :inline :offset-assert 240) - (player-force vector :inline :offset-assert 256) + ((root collide-shape-moving :override) + (info rigid-body-object-constants) + (flags rigid-body-object-flag) + (max-time-step float) + (incoming-attack-id uint32) + (player-touch-time time-frame) + (disturbed-time time-frame) + (player-force-position vector :inline) + (player-force vector :inline) ) - :heap-base #x90 - :method-count-assert 53 - :size-assert #x110 - :flag-assert #x3500900110 + (:state-methods + idle + active + ) (:methods - (idle () _type_ :state 27) - (active () _type_ :state 28) - (rigid-body-object-method-29 (_type_ float) none 29) - (rigid-body-object-method-30 (_type_) none 30) - (alloc-and-init-rigid-body-control (_type_ rigid-body-object-constants) none 31) - (allocate-and-init-cshape (_type_) none 32) - (init-skel-and-rigid-body (_type_) none 33) - (rigid-body-object-method-34 (_type_) none 34) - (rigid-body-object-method-35 (_type_) none 35) - (do-engine-sounds (_type_) none 36) - (rigid-body-object-method-37 (_type_) none 37) - (rigid-body-object-method-38 (_type_) none 38) - (rigid-body-object-method-39 (_type_) none 39) - (rigid-body-object-method-40 (_type_) none 40) - (rigid-body-object-method-41 (_type_) none 41) - (rigid-body-object-method-42 (_type_) none :behavior rigid-body-object 42) - (rigid-body-object-method-43 (_type_) none 43) - (apply-damage (_type_ float rigid-body-impact) none 44) - (rigid-body-object-method-45 (_type_ rigid-body-impact) none 45) - (rigid-body-object-method-46 (_type_ process-drawable int symbol event-message-block) object :behavior rigid-body-object 46) - (rigid-body-object-method-47 (_type_ process-drawable attack-info touching-shapes-entry penetrate) symbol 47) - (rigid-body-object-method-48 (_type_ process-focusable touching-shapes-entry) symbol 48) - (rigid-body-object-method-49 (_type_ rigid-body-impact touching-shapes-entry) none 49) - (rigid-body-object-method-50 (_type_ float) none 50) - (rigid-body-object-method-51 (_type_) none 51) - (rigid-body-object-method-52 (_type_) none 52) + (rigid-body-object-method-29 (_type_ float) none) + (rigid-body-object-method-30 (_type_) none) + (alloc-and-init-rigid-body-control (_type_ rigid-body-object-constants) none) + (allocate-and-init-cshape (_type_) none) + (init-skel-and-rigid-body (_type_) none) + (rigid-body-object-method-34 (_type_) none) + (rigid-body-object-method-35 (_type_) none) + (do-engine-sounds (_type_) none) + (rigid-body-object-method-37 (_type_) none) + (rigid-body-object-method-38 (_type_) none) + (rigid-body-object-method-39 (_type_) none) + (rigid-body-object-method-40 (_type_) none) + (rigid-body-object-method-41 (_type_) none) + (rigid-body-object-method-42 (_type_) none :behavior rigid-body-object) + (rigid-body-object-method-43 (_type_) none) + (apply-damage (_type_ float rigid-body-impact) none) + (rigid-body-object-method-45 (_type_ rigid-body-impact) none) + (rigid-body-object-method-46 (_type_ process-drawable int symbol event-message-block) object :behavior rigid-body-object) + (rigid-body-object-method-47 (_type_ process-drawable attack-info touching-shapes-entry penetrate) symbol) + (rigid-body-object-method-48 (_type_ process-focusable touching-shapes-entry) symbol) + (rigid-body-object-method-49 (_type_ rigid-body-impact touching-shapes-entry) none) + (rigid-body-object-method-50 (_type_ float) none) + (rigid-body-object-method-51 (_type_) none) + (rigid-body-object-method-52 (_type_) none) ) ) ;; definition for method 3 of type rigid-body-object -(defmethod inspect rigid-body-object ((this rigid-body-object)) +(defmethod inspect ((this rigid-body-object)) (when (not this) (set! this this) (goto cfg-22) @@ -542,26 +522,23 @@ ;; definition of type rigid-body-queue (deftype rigid-body-queue (structure) - ((count int8 :offset-assert 0) - (array handle 128 :offset 8) + ((count int8) + (array handle 128 :offset 8) ) - :method-count-assert 17 - :size-assert #x408 - :flag-assert #x1100000408 (:methods - (rigid-body-queue-method-9 (_type_) none 9) - (rigid-body-queue-method-10 (_type_) none 10) - (rigid-body-queue-method-11 (_type_ rigid-body-object) none 11) - (rigid-body-queue-method-12 (_type_ int int) none 12) - (rigid-body-queue-method-13 (_type_ int rigid-body-object) none 13) - (rigid-body-queue-method-14 (_type_ int) none 14) - (rigid-body-queue-method-15 (_type_ rigid-body-object) none 15) - (validate (_type_) symbol 16) + (rigid-body-queue-method-9 (_type_) none) + (rigid-body-queue-method-10 (_type_) none) + (rigid-body-queue-method-11 (_type_ rigid-body-object) none) + (rigid-body-queue-method-12 (_type_ int int) none) + (rigid-body-queue-method-13 (_type_ int rigid-body-object) none) + (rigid-body-queue-method-14 (_type_ int) none) + (rigid-body-queue-method-15 (_type_ rigid-body-object) none) + (validate (_type_) symbol) ) ) ;; definition for method 3 of type rigid-body-queue -(defmethod inspect rigid-body-queue ((this rigid-body-queue)) +(defmethod inspect ((this rigid-body-queue)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc index c8643974a76..0dc084d105c 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-9 rigid-body-queue ((this rigid-body-queue)) +(defmethod rigid-body-queue-method-9 ((this rigid-body-queue)) (set! (-> this count) 0) (dotimes (v1-0 128) (set! (-> this array v1-0) (the-as handle #f)) @@ -13,7 +13,7 @@ ) ;; definition for method 16 of type rigid-body-queue -(defmethod validate rigid-body-queue ((this rigid-body-queue)) +(defmethod validate ((this rigid-body-queue)) (let ((gp-0 0)) (dotimes (v1-0 (-> this count)) (let ((a1-2 (-> this array v1-0)) @@ -36,7 +36,7 @@ ;; definition for method 10 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-10 rigid-body-queue ((this rigid-body-queue)) +(defmethod rigid-body-queue-method-10 ((this rigid-body-queue)) (local-vars (s4-0 process)) (with-pp (let ((f0-0 (seconds-per-frame)) @@ -117,7 +117,7 @@ ;; definition for method 11 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-11 rigid-body-queue ((this rigid-body-queue) (arg0 rigid-body-object)) +(defmethod rigid-body-queue-method-11 ((this rigid-body-queue) (arg0 rigid-body-object)) (let ((v1-0 -1)) (let ((a2-0 0)) (b! #t cfg-9 :delay (nop!)) @@ -147,7 +147,7 @@ ;; definition for method 12 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-12 rigid-body-queue ((this rigid-body-queue) (arg0 int) (arg1 int)) +(defmethod rigid-body-queue-method-12 ((this rigid-body-queue) (arg0 int) (arg1 int)) (when (< arg0 arg1) (let ((v1-1 arg1) (a3-0 (+ arg1 -1)) @@ -167,7 +167,7 @@ ;; definition for method 13 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-13 rigid-body-queue ((this rigid-body-queue) (arg0 int) (arg1 rigid-body-object)) +(defmethod rigid-body-queue-method-13 ((this rigid-body-queue) (arg0 int) (arg1 rigid-body-object)) (let ((v1-2 (process->handle arg1)) (a2-4 (+ arg0 1)) ) @@ -189,7 +189,7 @@ ;; definition for method 14 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-14 rigid-body-queue ((this rigid-body-queue) (arg0 int)) +(defmethod rigid-body-queue-method-14 ((this rigid-body-queue) (arg0 int)) (let ((v1-0 arg0) (a1-1 (+ arg0 1)) ) @@ -206,7 +206,7 @@ ;; definition for method 15 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-15 rigid-body-queue ((this rigid-body-queue) (arg0 rigid-body-object)) +(defmethod rigid-body-queue-method-15 ((this rigid-body-queue) (arg0 rigid-body-object)) (let ((v1-2 (process->handle arg0)) (a1-4 0) ) @@ -228,19 +228,15 @@ ;; definition of type rigid-body-queue-manager (deftype rigid-body-queue-manager (process) - ((queue rigid-body-queue :offset-assert 128) + ((queue rigid-body-queue) ) - :heap-base #x10 - :method-count-assert 15 - :size-assert #x84 - :flag-assert #xf00100084 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) ;; definition for method 3 of type rigid-body-queue-manager -(defmethod inspect rigid-body-queue-manager ((this rigid-body-queue-manager)) +(defmethod inspect ((this rigid-body-queue-manager)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc index d91c53b95c3..84ad827d118 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc @@ -3,16 +3,13 @@ ;; definition of type rigid-body-work (deftype rigid-body-work (structure) - ((max-ang-momentum float :offset-assert 0) - (max-ang-velocity float :offset-assert 4) + ((max-ang-momentum float) + (max-ang-velocity float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type rigid-body-work -(defmethod inspect rigid-body-work ((this rigid-body-work)) +(defmethod inspect ((this rigid-body-work)) (when (not this) (set! this this) (goto cfg-4) @@ -36,14 +33,14 @@ ) ;; definition for method 7 of type rigid-body-control -(defmethod relocate rigid-body-control ((this rigid-body-control) (arg0 int)) +(defmethod relocate ((this rigid-body-control) (arg0 int)) (&+! (-> this process) arg0) this ) ;; definition for method 9 of type rigid-body-info ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-info-method-9 rigid-body-info ((this rigid-body-info)) +(defmethod rigid-body-info-method-9 ((this rigid-body-info)) (let ((f24-0 (-> this mass)) (f28-0 (-> this inertial-tensor-box 0)) (f30-0 (-> this inertial-tensor-box 1)) @@ -83,7 +80,7 @@ ;; definition for method 16 of type rigid-body ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod clear-force-torque! rigid-body ((this rigid-body)) +(defmethod clear-force-torque! ((this rigid-body)) (set! (-> this force quad) (the-as uint128 0)) (set! (-> this torque quad) (the-as uint128 0)) 0 @@ -93,7 +90,7 @@ ;; definition for method 17 of type rigid-body ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod clear-momentum! rigid-body ((this rigid-body)) +(defmethod clear-momentum! ((this rigid-body)) (set! (-> this lin-momentum quad) (the-as uint128 0)) (set! (-> this ang-momentum quad) (the-as uint128 0)) 0 @@ -102,7 +99,7 @@ ;; definition for method 24 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-24 rigid-body ((this rigid-body)) +(defmethod rigid-body-method-24 ((this rigid-body)) (when #t (quaternion->matrix (-> this matrix) (-> this rotation)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -116,7 +113,7 @@ ;; definition for method 26 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-26 rigid-body ((this rigid-body) (arg0 vector) (arg1 quaternion)) +(defmethod rigid-body-method-26 ((this rigid-body) (arg0 vector) (arg1 quaternion)) (let ((s3-0 (new 'stack-no-clear 'inline-array 'vector 8))) (quaternion->matrix (the-as matrix (-> s3-0 1)) arg1) (vector-rotate*! (-> s3-0 0) (-> this info cm-offset-joint) (the-as matrix (-> s3-0 1))) @@ -132,7 +129,7 @@ ;; definition for method 25 of type rigid-body ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-25 rigid-body ((this rigid-body) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 function)) +(defmethod rigid-body-method-25 ((this rigid-body) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 function)) (set! (-> this work) *rigid-body-work*) (set! (-> this info) arg0) (set! (-> this force-callback) (the-as (function object float none) arg3)) @@ -150,7 +147,7 @@ ) ;; definition for method 22 of type rigid-body -(defmethod rigid-body-method-22 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-22 ((this rigid-body) (arg0 vector) (arg1 vector)) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position)))) (vector-cross! arg1 (-> this ang-velocity) v1-1) ) @@ -185,7 +182,7 @@ ;; definition for method 12 of type rigid-body ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-12 rigid-body ((this rigid-body) (arg0 float)) +(defmethod rigid-body-method-12 ((this rigid-body) (arg0 float)) (local-vars (v1-6 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -252,7 +249,7 @@ ;; definition for method 13 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-13 rigid-body ((this rigid-body)) +(defmethod rigid-body-method-13 ((this rigid-body)) (let ((v1-0 (-> this info))) (vector-float*! (-> this lin-velocity) (-> this lin-momentum) (-> v1-0 inv-mass)) (matrix-3x3-triple-transpose-product (-> this inv-i-world) (-> this matrix) (-> v1-0 inv-inertial-tensor)) @@ -265,7 +262,7 @@ ;; definition for method 14 of type rigid-body ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-14 rigid-body ((this rigid-body) (arg0 float)) +(defmethod rigid-body-method-14 ((this rigid-body) (arg0 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -319,7 +316,7 @@ ;; definition for method 9 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-9 rigid-body ((this rigid-body) (arg0 collide-shape-moving) (arg1 float)) +(defmethod rigid-body-method-9 ((this rigid-body) (arg0 collide-shape-moving) (arg1 float)) (rigid-body-method-12 this arg1) (let ((v1-2 (-> this info))) (let* ((a0-2 (-> this lin-momentum)) @@ -356,7 +353,7 @@ ;; definition for method 67 of type collide-shape-moving ;; WARN: Return type mismatch int vs none. -(defmethod collide-with-all-collide-cache-prims collide-shape-moving ((this collide-shape-moving) (arg0 matrix) (arg1 collide-query)) +(defmethod collide-with-all-collide-cache-prims ((this collide-shape-moving) (arg0 matrix) (arg1 collide-query)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -460,7 +457,7 @@ ;; definition for method 63 of type collide-shape-moving ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod collide-shape-moving-method-63 collide-shape-moving ((this collide-shape-moving) (arg0 rigid-body) (arg1 float)) +(defmethod collide-shape-moving-method-63 ((this collide-shape-moving) (arg0 rigid-body) (arg1 float)) (local-vars (s3-0 rigid-body)) (with-pp (rlet ((acc :class vf) @@ -665,7 +662,7 @@ ;; WARN: Stack slot offset 632 signed mismatch ;; WARN: Stack slot offset 632 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-15 rigid-body ((this rigid-body) (arg0 collide-shape-moving) (arg1 float)) +(defmethod rigid-body-method-15 ((this rigid-body) (arg0 collide-shape-moving) (arg1 float)) (local-vars (sv-576 vector) (sv-624 vector) @@ -763,7 +760,7 @@ ;; definition for method 18 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-18 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-18 ((this rigid-body) (arg0 vector) (arg1 vector)) (vector+! (-> this force) (-> this force) arg1) (let ((a3-1 (new 'stack-no-clear 'vector)) (v1-1 (new 'stack-no-clear 'vector)) @@ -778,7 +775,7 @@ ;; definition for method 21 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-21 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod rigid-body-method-21 ((this rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) (vector+! (-> this force) (-> this force) arg1) (let* ((t0-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position))) (v1-3 (vector-cross! (new 'stack-no-clear 'vector) t0-2 arg1)) @@ -796,7 +793,7 @@ ;; definition for method 19 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-19 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-19 ((this rigid-body) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -812,14 +809,14 @@ ;; definition for method 20 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-20 rigid-body ((this rigid-body) (arg0 vector)) +(defmethod rigid-body-method-20 ((this rigid-body) (arg0 vector)) (vector+! (-> this force) (-> this force) arg0) 0 (none) ) ;; definition for method 23 of type rigid-body -(defmethod rigid-body-method-23 rigid-body ((this rigid-body) (arg0 vector)) +(defmethod rigid-body-method-23 ((this rigid-body) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-rotate*! gp-0 (-> this info cm-offset-joint) (-> this matrix)) (vector-! arg0 (-> this position) gp-0) @@ -829,7 +826,7 @@ ;; definition for method 28 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod print-force-torque rigid-body ((this rigid-body) (arg0 object)) +(defmethod print-force-torque ((this rigid-body) (arg0 object)) (format arg0 " force ~M ~M ~M" (-> this force x) (-> this force y) (-> this force z)) (format arg0 " torque ~M ~M ~M~%" (-> this torque x) (-> this torque y) (-> this torque z)) 0 @@ -838,7 +835,7 @@ ;; definition for method 30 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod print-momentum rigid-body ((this rigid-body) (arg0 object)) +(defmethod print-momentum ((this rigid-body) (arg0 object)) (format arg0 " lin-mom ~M ~M ~M" (-> this lin-momentum x) (-> this lin-momentum y) (-> this lin-momentum z)) (format arg0 @@ -853,7 +850,7 @@ ;; definition for method 31 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod print-velocity rigid-body ((this rigid-body) (arg0 object)) +(defmethod print-velocity ((this rigid-body) (arg0 object)) (format arg0 " lin-vel ~M ~M ~M" (-> this lin-velocity x) (-> this lin-velocity y) (-> this lin-velocity z)) (format arg0 @@ -868,7 +865,7 @@ ;; definition for method 29 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod print-position-rotation rigid-body ((this rigid-body) (arg0 object)) +(defmethod print-position-rotation ((this rigid-body) (arg0 object)) (format arg0 " position ~M ~M ~M" (-> this position x) (-> this position y) (-> this position z)) (format arg0 @@ -884,7 +881,7 @@ ;; definition for method 27 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod print-physics rigid-body ((this rigid-body) (arg0 object)) +(defmethod print-physics ((this rigid-body) (arg0 object)) (print-force-torque this arg0) (print-position-rotation this arg0) (print-momentum this arg0) @@ -895,7 +892,7 @@ ;; definition for method 10 of type rigid-body-control ;; WARN: Return type mismatch int vs object. -(defmethod rigid-body-control-method-10 rigid-body-control ((this rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) +(defmethod rigid-body-control-method-10 ((this rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) (let* ((s4-1 (max 1 (min 4 (+ (the int (* 0.9999 (/ arg1 arg2))) 1)))) (f30-0 (/ arg1 (the float s4-1))) (s3-0 (-> this state force-callback)) @@ -917,7 +914,7 @@ ;; definition for method 11 of type rigid-body ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-11 rigid-body ((this rigid-body) (arg0 collide-shape-moving)) +(defmethod rigid-body-method-11 ((this rigid-body) (arg0 collide-shape-moving)) (quaternion-copy! (-> arg0 quat) (-> this rotation)) (rigid-body-method-23 this (-> arg0 trans)) (set! (-> arg0 transv quad) (-> this lin-velocity quad)) @@ -926,13 +923,13 @@ ) ;; definition for method 26 of type rigid-body-object -(defmethod get-inv-mass rigid-body-object ((this rigid-body-object)) +(defmethod get-inv-mass ((this rigid-body-object)) (-> this info info inv-mass) ) ;; definition for method 35 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-35 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-35 ((this rigid-body-object)) (let ((a0-1 (-> this info name))) (when (nonzero? a0-1) (set! (-> this info) (the-as rigid-body-object-constants (-> a0-1 value))) @@ -947,7 +944,7 @@ ;; definition for method 50 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-50 rigid-body-object ((this rigid-body-object) (arg0 float)) +(defmethod rigid-body-object-method-50 ((this rigid-body-object) (arg0 float)) (when (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) (when (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)) (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force)) @@ -966,7 +963,7 @@ ;; definition for method 29 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 rigid-body-object ((this rigid-body-object) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this rigid-body-object) (arg0 float)) (let ((a1-1 (new 'stack-no-clear 'vector))) (vector-reset! a1-1) (set! (-> a1-1 y) (* -1.0 (-> this info extra gravity) (-> this rbody state info mass))) @@ -978,7 +975,7 @@ ;; definition for method 30 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-30 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-30 ((this rigid-body-object)) (rigid-body-control-method-10 (-> this rbody) this (seconds-per-frame) (-> this max-time-step)) (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) 0 @@ -987,7 +984,7 @@ ;; definition for method 51 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-51 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-51 ((this rigid-body-object)) (rigid-body-control-method-10 (-> this rbody) this @@ -1000,7 +997,7 @@ ;; definition for method 52 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-52 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-52 ((this rigid-body-object)) (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) 0 (none) @@ -1008,7 +1005,7 @@ ;; definition for method 34 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-34 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-34 ((this rigid-body-object)) (go (method-of-object this idle)) 0 (none) @@ -1016,7 +1013,7 @@ ;; definition for method 31 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod alloc-and-init-rigid-body-control rigid-body-object ((this rigid-body-object) (arg0 rigid-body-object-constants)) +(defmethod alloc-and-init-rigid-body-control ((this rigid-body-object) (arg0 rigid-body-object-constants)) (set! (-> this info) arg0) (set! (-> this rbody) (new 'process 'rigid-body-control this)) (update-transforms (-> this root)) @@ -1040,7 +1037,7 @@ ;; definition for method 32 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape rigid-body-object ((this rigid-body-object)) +(defmethod allocate-and-init-cshape ((this rigid-body-object)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1092,7 +1089,7 @@ ;; definition for method 33 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body rigid-body-object ((this rigid-body-object)) +(defmethod init-skel-and-rigid-body ((this rigid-body-object)) (alloc-and-init-rigid-body-control this *rigid-body-object-constants*) 0 (none) @@ -1100,7 +1097,7 @@ ;; definition for method 11 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod init-from-entity! rigid-body-object ((this rigid-body-object) (arg0 entity-actor)) +(defmethod init-from-entity! ((this rigid-body-object) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1117,14 +1114,14 @@ This commonly includes things such as: ;; definition for method 36 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod do-engine-sounds rigid-body-object ((this rigid-body-object)) +(defmethod do-engine-sounds ((this rigid-body-object)) 0 (none) ) ;; definition for method 37 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-37 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-37 ((this rigid-body-object)) (rigid-body-object-method-30 this) (do-engine-sounds this) (let ((v1-4 (-> this rbody)) @@ -1139,7 +1136,7 @@ This commonly includes things such as: ;; definition for method 40 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-40 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-40 ((this rigid-body-object)) (logior! (-> this flags) (rigid-body-object-flag enable-collision)) (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (-> this root backup-collide-as)) @@ -1151,7 +1148,7 @@ This commonly includes things such as: ;; definition for method 41 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-41 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-41 ((this rigid-body-object)) (logclear! (-> this flags) (rigid-body-object-flag enable-collision)) (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) @@ -1164,7 +1161,7 @@ This commonly includes things such as: ;; definition for method 38 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-38 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-38 ((this rigid-body-object)) (when (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) (logior! (-> this rbody state flags) (rigid-body-flag enable-physics)) (rigid-body-method-26 (-> this rbody state) (-> this root trans) (-> this root quat)) @@ -1177,7 +1174,7 @@ This commonly includes things such as: ;; definition for method 39 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-39 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-39 ((this rigid-body-object)) (logclear! (-> this rbody state flags) (rigid-body-flag enable-physics)) 0 (none) @@ -1185,7 +1182,7 @@ This commonly includes things such as: ;; definition for method 42 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-42 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-42 ((this rigid-body-object)) (logior! (-> this flags) (rigid-body-object-flag disturbed)) (set-time! (-> this disturbed-time)) (if (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) @@ -1197,7 +1194,7 @@ This commonly includes things such as: ;; definition for method 43 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-43 rigid-body-object ((this rigid-body-object)) +(defmethod rigid-body-object-method-43 ((this rigid-body-object)) (go (method-of-object this active)) 0 (none) @@ -1205,14 +1202,14 @@ This commonly includes things such as: ;; definition for method 44 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod apply-damage rigid-body-object ((this rigid-body-object) (arg0 float) (arg1 rigid-body-impact)) +(defmethod apply-damage ((this rigid-body-object) (arg0 float) (arg1 rigid-body-impact)) 0 (none) ) ;; definition for method 45 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-45 rigid-body-object ((this rigid-body-object) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 ((this rigid-body-object) (arg0 rigid-body-impact)) 0 (none) ) @@ -1220,7 +1217,7 @@ This commonly includes things such as: ;; definition for method 49 of type rigid-body-object ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-49 rigid-body-object ((this rigid-body-object) (arg0 rigid-body-impact) (arg1 touching-shapes-entry)) +(defmethod rigid-body-object-method-49 ((this rigid-body-object) (arg0 rigid-body-impact) (arg1 touching-shapes-entry)) (set! (-> arg0 rbody) #f) (set! (-> arg0 prim-id) (the-as uint 0)) (vector-reset! (-> arg0 normal)) @@ -1252,12 +1249,12 @@ This commonly includes things such as: ;; definition for method 47 of type rigid-body-object ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-47 rigid-body-object ((this rigid-body-object) - (arg0 process-drawable) - (arg1 attack-info) - (arg2 touching-shapes-entry) - (arg3 penetrate) - ) +(defmethod rigid-body-object-method-47 ((this rigid-body-object) + (arg0 process-drawable) + (arg1 attack-info) + (arg2 touching-shapes-entry) + (arg3 penetrate) + ) (local-vars (f0-2 float)) (when arg2 (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact))) @@ -1336,7 +1333,7 @@ This commonly includes things such as: ;; definition for method 48 of type rigid-body-object ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-48 rigid-body-object ((this rigid-body-object) (arg0 process-focusable) (arg1 touching-shapes-entry)) +(defmethod rigid-body-object-method-48 ((this rigid-body-object) (arg0 process-focusable) (arg1 touching-shapes-entry)) (local-vars (v1-2 symbol)) (b! (not (logtest? (process-mask target crate enemy) (-> arg0 mask))) cfg-5 :likely-delay (set! v1-2 #t)) (b! (not (logtest? (-> arg0 mask) (process-mask target))) cfg-5 :likely-delay (set! v1-2 #f)) @@ -1409,7 +1406,7 @@ This commonly includes things such as: ;; definition for method 46 of type rigid-body-object ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-46 rigid-body-object ((this rigid-body-object) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 ((this rigid-body-object) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('impact-impulse) (let ((s5-1 (-> arg3 param 0))) diff --git a/test/decompiler/reference/jak2/engine/physics/trajectory-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/trajectory-h_REF.gc index 03c9da3bbe6..090dd202362 100644 --- a/test/decompiler/reference/jak2/engine/physics/trajectory-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/trajectory-h_REF.gc @@ -3,29 +3,26 @@ ;; definition of type trajectory (deftype trajectory (structure) - ((initial-position vector :inline :offset-assert 0) - (initial-velocity vector :inline :offset-assert 16) - (time float :offset-assert 32) - (gravity meters :offset-assert 36) + ((initial-position vector :inline) + (initial-velocity vector :inline) + (time float) + (gravity meters) ) - :method-count-assert 18 - :size-assert #x28 - :flag-assert #x1200000028 (:methods - (compute-trans-at-time (_type_ float vector) vector 9) - (compute-transv-at-time (_type_ float vector) vector 10) - (compute-time-until-apex (_type_) float 11) - (setup-from-to-duration! (_type_ vector vector float float) none 12) - (setup-from-to-xz-vel! (_type_ vector vector float float) none 13) - (setup-from-to-y-vel! (_type_ vector vector float float) none 14) - (setup-from-to-height! (_type_ vector vector float float) none 15) - (setup-from-to-duration-and-height! (_type_ vector vector float float) none 16) - (debug-draw (_type_) none 17) + (compute-trans-at-time (_type_ float vector) vector) + (compute-transv-at-time (_type_ float vector) vector) + (compute-time-until-apex (_type_) float) + (setup-from-to-duration! (_type_ vector vector float float) none) + (setup-from-to-xz-vel! (_type_ vector vector float float) none) + (setup-from-to-y-vel! (_type_ vector vector float float) none) + (setup-from-to-height! (_type_ vector vector float float) none) + (setup-from-to-duration-and-height! (_type_ vector vector float float) none) + (debug-draw (_type_) none) ) ) ;; definition for method 3 of type trajectory -(defmethod inspect trajectory ((this trajectory)) +(defmethod inspect ((this trajectory)) (when (not this) (set! this this) (goto cfg-4) @@ -41,27 +38,24 @@ ;; definition of type impact-control (deftype impact-control (structure) - ((process (pointer process-drawable) :offset-assert 0) - (radius float :offset-assert 4) - (joint int32 :offset-assert 8) - (collide-with collide-spec :offset-assert 12) - (start-time time-frame :offset-assert 16) - (trans vector 2 :inline :offset-assert 32) - (dir vector :inline :offset-assert 64) + ((process (pointer process-drawable)) + (radius float) + (joint int32) + (collide-with collide-spec) + (start-time time-frame) + (trans vector 2 :inline) + (dir vector :inline) ) - :method-count-assert 12 - :size-assert #x50 - :flag-assert #xc00000050 (:methods - (new (symbol type process-drawable int float collide-spec) _type_ 0) - (initialize (_type_ process-drawable int float collide-spec) impact-control :behavior process 9) - (update-from-cspace (_type_) none 10) - (impact-control-method-11 (_type_ collide-query process pat-surface) float 11) + (new (symbol type process-drawable int float collide-spec) _type_) + (initialize (_type_ process-drawable int float collide-spec) impact-control :behavior process) + (update-from-cspace (_type_) none) + (impact-control-method-11 (_type_ collide-query process pat-surface) float) ) ) ;; definition for method 3 of type impact-control -(defmethod inspect impact-control ((this impact-control)) +(defmethod inspect ((this impact-control)) (when (not this) (set! this this) (goto cfg-7) @@ -99,21 +93,18 @@ ;; definition of type point-tracker (deftype point-tracker (structure) - ((trans vector 2 :inline :offset-assert 0) + ((trans vector 2 :inline) ) - :method-count-assert 12 - :size-assert #x20 - :flag-assert #xc00000020 (:methods - (new (symbol type vector vector) _type_ 0) - (initialize (_type_ vector vector) point-tracker 9) - (point-tracker-method-10 (_type_ vector vector vector float) vector 10) - (point-tracker-method-11 (_type_ vector vector vector float) vector 11) + (new (symbol type vector vector) _type_) + (initialize (_type_ vector vector) point-tracker) + (point-tracker-method-10 (_type_ vector vector vector float) vector) + (point-tracker-method-11 (_type_ vector vector vector float) vector) ) ) ;; definition for method 3 of type point-tracker -(defmethod inspect point-tracker ((this point-tracker)) +(defmethod inspect ((this point-tracker)) (when (not this) (set! this this) (goto cfg-7) @@ -139,20 +130,17 @@ ;; definition of type combo-tracker (deftype combo-tracker (point-tracker) - ((target handle :offset-assert 32) - (move-start-time time-frame :offset-assert 40) + ((target handle) + (move-start-time time-frame) ) - :method-count-assert 14 - :size-assert #x30 - :flag-assert #xe00000030 (:methods - (combo-tracker-method-12 (_type_ vector vector process time-frame) combo-tracker 12) - (combo-tracker-method-13 (_type_ handle vector float vector float) basic 13) + (combo-tracker-method-12 (_type_ vector vector process time-frame) combo-tracker) + (combo-tracker-method-13 (_type_ handle vector float vector float) basic) ) ) ;; definition for method 3 of type combo-tracker -(defmethod inspect combo-tracker ((this combo-tracker)) +(defmethod inspect ((this combo-tracker)) (when (not this) (set! this this) (goto cfg-7) @@ -170,20 +158,17 @@ ;; definition of type traj2d-params (deftype traj2d-params (structure) - ((x float :offset-assert 0) - (y float :offset-assert 4) - (gravity float :offset-assert 8) - (initial-tilt float :offset-assert 12) - (initial-speed float :offset-assert 16) - (time float :offset-assert 20) + ((x float) + (y float) + (gravity float) + (initial-tilt float) + (initial-speed float) + (time float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type traj2d-params -(defmethod inspect traj2d-params ((this traj2d-params)) +(defmethod inspect ((this traj2d-params)) (when (not this) (set! this this) (goto cfg-4) @@ -201,22 +186,19 @@ ;; definition of type traj3d-params (deftype traj3d-params (structure) - ((gravity float :offset-assert 0) - (initial-tilt float :offset-assert 4) - (initial-speed float :offset-assert 8) - (time float :offset-assert 12) - (src vector :inline :offset-assert 16) - (dest vector :inline :offset-assert 32) - (diff vector :inline :offset-assert 48) - (initial-velocity vector :inline :offset-assert 64) + ((gravity float) + (initial-tilt float) + (initial-speed float) + (time float) + (src vector :inline) + (dest vector :inline) + (diff vector :inline) + (initial-velocity vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type traj3d-params -(defmethod inspect traj3d-params ((this traj3d-params)) +(defmethod inspect ((this traj3d-params)) (when (not this) (set! this this) (goto cfg-4) @@ -236,22 +218,19 @@ ;; definition of type cubic-curve (deftype cubic-curve (structure) - ((mat matrix :inline :offset-assert 0) + ((mat matrix :inline) ) - :method-count-assert 14 - :size-assert #x40 - :flag-assert #xe00000040 (:methods - (cubic-curve-method-9 (_type_ vector vector vector vector) none 9) - (cubic-curve-method-10 (_type_ vector float) vector 10) - (cubic-curve-method-11 (_type_ vector float) vector 11) - (cubic-curve-method-12 (_type_ vector float) vector 12) - (debug-draw-curve (_type_) none 13) + (cubic-curve-method-9 (_type_ vector vector vector vector) none) + (cubic-curve-method-10 (_type_ vector float) vector) + (cubic-curve-method-11 (_type_ vector float) vector) + (cubic-curve-method-12 (_type_ vector float) vector) + (debug-draw-curve (_type_) none) ) ) ;; definition for method 3 of type cubic-curve -(defmethod inspect cubic-curve ((this cubic-curve)) +(defmethod inspect ((this cubic-curve)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc b/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc index 8b1e0a943aa..92d6de9b3e0 100644 --- a/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 9 of type trajectory -(defmethod compute-trans-at-time trajectory ((this trajectory) (arg0 float) (arg1 vector)) +(defmethod compute-trans-at-time ((this trajectory) (arg0 float) (arg1 vector)) (vector+float*! arg1 (-> this initial-position) (-> this initial-velocity) arg0) (+! (-> arg1 y) (* 0.5 arg0 arg0 (-> this gravity))) arg1 @@ -10,21 +10,21 @@ ;; definition for method 10 of type trajectory ;; INFO: Used lq/sq -(defmethod compute-transv-at-time trajectory ((this trajectory) (arg0 float) (arg1 vector)) +(defmethod compute-transv-at-time ((this trajectory) (arg0 float) (arg1 vector)) (set! (-> arg1 quad) (-> this initial-velocity quad)) (+! (-> arg1 y) (* arg0 (-> this gravity))) arg1 ) ;; definition for method 11 of type trajectory -(defmethod compute-time-until-apex trajectory ((this trajectory)) +(defmethod compute-time-until-apex ((this trajectory)) (/ (- (-> this initial-velocity y)) (-> this gravity)) ) ;; definition for method 12 of type trajectory ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod setup-from-to-duration! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-duration! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (set! (-> this initial-position quad) (-> arg0 quad)) (set! (-> this gravity) arg3) (set! (-> this time) arg2) @@ -39,7 +39,7 @@ ;; definition for method 13 of type trajectory ;; WARN: Return type mismatch int vs none. -(defmethod setup-from-to-xz-vel! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-xz-vel! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let ((f0-1 (/ (vector-vector-xz-distance arg1 arg0) arg2))) (setup-from-to-duration! this arg0 arg1 f0-1 arg3) ) @@ -49,7 +49,7 @@ ;; definition for method 14 of type trajectory ;; WARN: Return type mismatch int vs none. -(defmethod setup-from-to-y-vel! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-y-vel! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let* ((f0-0 arg2) (f1-3 (- (* f0-0 f0-0) (* 2.0 (- (-> arg0 y) (-> arg1 y)) arg3))) (f0-3 900.0) @@ -67,7 +67,7 @@ ;; definition for method 15 of type trajectory ;; WARN: Return type mismatch int vs none. -(defmethod setup-from-to-height! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-height! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let* ((f0-1 (+ arg2 (fmax (-> arg0 y) (-> arg1 y)))) (f1-4 (* 2.0 (- (-> arg0 y) f0-1) arg3)) (f0-4 4096.0) @@ -84,7 +84,7 @@ ;; definition for method 16 of type trajectory ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 16 trajectory) has a return type of none, but the expression builder found a return statement. -(defmethod setup-from-to-duration-and-height! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-duration-and-height! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let ((f0-1 (- (-> arg1 y) (-> arg0 y)))) (cond ((= f0-1 0.0) @@ -119,7 +119,7 @@ ;; definition for method 17 of type trajectory ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw trajectory ((this trajectory)) +(defmethod debug-draw ((this trajectory)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 10) @@ -147,7 +147,7 @@ ;; definition for method 9 of type impact-control ;; INFO: Used lq/sq -(defmethod initialize impact-control ((this impact-control) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) +(defmethod initialize ((this impact-control) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) (set-time! (-> this start-time)) (set! (-> this process) (the-as (pointer process-drawable) (process->ppointer arg0))) (set! (-> this joint) arg1) @@ -161,7 +161,7 @@ ;; definition for method 10 of type impact-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-from-cspace impact-control ((this impact-control)) +(defmethod update-from-cspace ((this impact-control)) (when (>= (-> this joint) 0) (set! (-> this trans 1 quad) (-> this trans 0 quad)) (vector<-cspace! (the-as vector (-> this trans)) (-> this process 0 node-list data (-> this joint))) @@ -173,7 +173,7 @@ ;; definition for method 11 of type impact-control ;; INFO: Used lq/sq -(defmethod impact-control-method-11 impact-control ((this impact-control) (arg0 collide-query) (arg1 process) (arg2 pat-surface)) +(defmethod impact-control-method-11 ((this impact-control) (arg0 collide-query) (arg1 process) (arg2 pat-surface)) (set! (-> arg0 start-pos quad) (-> this trans 1 quad)) (set! (-> arg0 move-dist quad) (-> this dir quad)) (let ((v1-2 (ppointer->process (-> this process))) @@ -222,7 +222,7 @@ ;; definition for method 9 of type point-tracker ;; INFO: Used lq/sq -(defmethod initialize point-tracker ((this point-tracker) (arg0 vector) (arg1 vector)) +(defmethod initialize ((this point-tracker) (arg0 vector) (arg1 vector)) (set! (-> this trans 0 quad) (-> arg0 quad)) (set! (-> this trans 1 quad) (-> arg1 quad)) this @@ -230,7 +230,7 @@ ;; definition for method 10 of type point-tracker ;; INFO: Used lq/sq -(defmethod point-tracker-method-10 point-tracker ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod point-tracker-method-10 ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (cond ((>= 0.0 arg3) (set! (-> arg0 quad) (-> arg1 quad)) @@ -248,7 +248,7 @@ ) ;; definition for method 11 of type point-tracker -(defmethod point-tracker-method-11 point-tracker ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod point-tracker-method-11 ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (with-pp (let ((v1-1 (point-tracker-method-10 this (new 'stack-no-clear 'vector) arg1 arg2 arg3))) (vector-! arg0 v1-1 arg1) @@ -259,7 +259,7 @@ ) ;; definition for method 13 of type combo-tracker -(defmethod combo-tracker-method-13 combo-tracker ((this combo-tracker) (arg0 handle) (arg1 vector) (arg2 float) (arg3 vector) (arg4 float)) +(defmethod combo-tracker-method-13 ((this combo-tracker) (arg0 handle) (arg1 vector) (arg2 float) (arg3 vector) (arg4 float)) (cond ((send-event (handle->process arg0) 'combo) (let ((gp-1 (handle->process arg0))) @@ -311,7 +311,7 @@ ) ;; definition for method 12 of type combo-tracker -(defmethod combo-tracker-method-12 combo-tracker ((this combo-tracker) (arg0 vector) (arg1 vector) (arg2 process) (arg3 time-frame)) +(defmethod combo-tracker-method-12 ((this combo-tracker) (arg0 vector) (arg1 vector) (arg2 process) (arg3 time-frame)) (initialize this arg0 arg1) (set! (-> this target) (process->handle arg2)) (set! (-> this move-start-time) arg3) @@ -320,7 +320,7 @@ ;; definition for method 11 of type combo-tracker ;; INFO: Used lq/sq -(defmethod point-tracker-method-11 combo-tracker ((this combo-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod point-tracker-method-11 ((this combo-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -431,7 +431,7 @@ ;; definition for method 9 of type cubic-curve ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod cubic-curve-method-9 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod cubic-curve-method-9 ((this cubic-curve) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -476,7 +476,7 @@ ) ;; definition for method 10 of type cubic-curve -(defmethod cubic-curve-method-10 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 float)) +(defmethod cubic-curve-method-10 ((this cubic-curve) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'trajectory))) (let ((f0-1 (* arg1 arg1))) (set-vector! (-> v1-0 initial-position) 1.0 arg1 f0-1 (* f0-1 arg1)) @@ -488,7 +488,7 @@ ) ;; definition for method 11 of type cubic-curve -(defmethod cubic-curve-method-11 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 float)) +(defmethod cubic-curve-method-11 ((this cubic-curve) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'trajectory))) (set-vector! (-> v1-0 initial-position) 0.0 1.0 (* 2.0 arg1) (* 3.0 arg1 arg1)) (vector-matrix*! arg0 (-> v1-0 initial-position) (-> this mat)) @@ -498,7 +498,7 @@ ) ;; definition for method 12 of type cubic-curve -(defmethod cubic-curve-method-12 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 float)) +(defmethod cubic-curve-method-12 ((this cubic-curve) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'trajectory))) (set-vector! (-> v1-0 initial-position) 0.0 0.0 2.0 (* 6.0 arg1)) (vector-matrix*! arg0 (-> v1-0 initial-position) (-> this mat)) @@ -510,7 +510,7 @@ ;; definition for method 13 of type cubic-curve ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-curve cubic-curve ((this cubic-curve)) +(defmethod debug-draw-curve ((this cubic-curve)) (let ((s5-0 (new 'stack-no-clear 'trajectory)) (s4-0 10) ) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/focus_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/focus_REF.gc index f042fa06911..547bffcb3df 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/focus_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/focus_REF.gc @@ -3,22 +3,19 @@ ;; definition of type focus (deftype focus (structure) - ((handle handle :offset-assert 0) - (collide-with collide-spec :offset-assert 8) + ((handle handle) + (collide-with collide-spec) ) - :method-count-assert 13 - :size-assert #xc - :flag-assert #xd0000000c (:methods - (clear-focused (_type_) none 9) - (collide-check? (_type_ process-focusable) object 10) - (reset-to-collide-spec (_type_ collide-spec) none 11) - (try-update-focus (_type_ process-focusable) symbol 12) + (clear-focused (_type_) none) + (collide-check? (_type_ process-focusable) object) + (reset-to-collide-spec (_type_ collide-spec) none) + (try-update-focus (_type_ process-focusable) symbol) ) ) ;; definition for method 3 of type focus -(defmethod inspect focus ((this focus)) +(defmethod inspect ((this focus)) (when (not this) (set! this this) (goto cfg-4) @@ -32,7 +29,7 @@ ;; definition for method 11 of type focus ;; WARN: Return type mismatch int vs none. -(defmethod reset-to-collide-spec focus ((this focus) (arg0 collide-spec)) +(defmethod reset-to-collide-spec ((this focus) (arg0 collide-spec)) (set! (-> this collide-with) arg0) (set! (-> this handle) (the-as handle #f)) 0 @@ -40,7 +37,7 @@ ) ;; definition for method 10 of type focus -(defmethod collide-check? focus ((this focus) (arg0 process-focusable)) +(defmethod collide-check? ((this focus) (arg0 process-focusable)) (when (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead)))) (let* ((s5-0 (-> arg0 root)) (v1-2 (if (type? s5-0 collide-shape) @@ -54,7 +51,7 @@ ) ;; definition for method 12 of type focus -(defmethod try-update-focus focus ((this focus) (arg0 process-focusable)) +(defmethod try-update-focus ((this focus) (arg0 process-focusable)) (when (!= (handle->process (-> this handle)) arg0) (set! (-> this handle) (process->handle arg0)) #t @@ -63,7 +60,7 @@ ;; definition for method 9 of type focus ;; WARN: Return type mismatch int vs none. -(defmethod clear-focused focus ((this focus)) +(defmethod clear-focused ((this focus)) (set! (-> this handle) (the-as handle #f)) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc index 292742fd4d0..aa32ec6b440 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 15 of type skeleton-group -(defmethod add-to-loading-level skeleton-group ((this skeleton-group)) +(defmethod add-to-loading-level ((this skeleton-group)) (let ((v1-1 (-> *level* loading-level))) (if v1-1 (set-loaded-art (-> v1-1 art-group) this) @@ -195,7 +195,7 @@ ;; definition for method 10 of type draw-control ;; WARN: Return type mismatch int vs none. -(defmethod lod-set! draw-control ((this draw-control) (arg0 int)) +(defmethod lod-set! ((this draw-control) (arg0 int)) (let ((v1-1 (max 0 (min arg0 (-> this lod-set max-lod))))) (set! (-> this desired-lod) v1-1) (when (!= (-> this cur-lod) v1-1) @@ -212,7 +212,7 @@ ;; definition for method 11 of type draw-control ;; WARN: Return type mismatch int vs none. -(defmethod lods-assign! draw-control ((this draw-control) (arg0 lod-set)) +(defmethod lods-assign! ((this draw-control) (arg0 lod-set)) (mem-copy! (the-as pointer (-> this lod-set)) (the-as pointer arg0) 49) (let ((a1-2 (min (-> this cur-lod) (-> this lod-set max-lod)))) (set! (-> this cur-lod) -1) @@ -224,7 +224,7 @@ ;; definition for method 12 of type draw-control ;; WARN: Return type mismatch int vs none. -(defmethod setup-masks draw-control ((this draw-control) (arg0 int) (arg1 int)) +(defmethod setup-masks ((this draw-control) (arg0 int) (arg1 int)) "TODO - use the enum types" (local-vars (v1-4 int) (a2-1 (array uint64))) (let ((a1-2 (logior (logclear (-> this seg-mask) arg0) arg1))) @@ -254,7 +254,7 @@ ;; definition for method 9 of type lod-set ;; INFO: Used lq/sq -(defmethod setup-lods! lod-set ((this lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity)) +(defmethod setup-lods! ((this lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity)) (local-vars (sv-16 res-tag)) (let ((v1-0 (-> arg1 length)) (s3-0 (-> arg0 max-lod)) @@ -293,7 +293,7 @@ ) ;; definition for method 13 of type draw-control -(defmethod setup-cspace-and-add draw-control ((this draw-control) (arg0 art-joint-geo) (arg1 symbol)) +(defmethod setup-cspace-and-add ((this draw-control) (arg0 art-joint-geo) (arg1 symbol)) (let ((s5-0 ((method-of-type cspace-array new) arg1 cspace-array (+ (-> arg0 length) 1)))) (let ((v0-1 ((method-of-type skeleton new) arg1 skeleton (+ (-> arg0 length) 1)))) (set! (-> this skeleton) v0-1) @@ -368,7 +368,7 @@ ;; definition for method 14 of type draw-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-joint-math draw-control ((this draw-control) (arg0 cspace-array) (arg1 joint-control)) +(defmethod do-joint-math ((this draw-control) (arg0 cspace-array) (arg1 joint-control)) (with-pp (cond ((logtest? (-> this status) (draw-control-status no-draw no-draw-temp)) @@ -448,7 +448,7 @@ ;; definition for method 17 of type process-drawable ;; WARN: Return type mismatch int vs none. -(defmethod cleanup-for-death process-drawable ((this process-drawable)) +(defmethod cleanup-for-death ((this process-drawable)) (when (type? (-> this root) collide-shape) (let ((v1-2 (-> (the-as collide-shape (-> this root)) root-prim))) (set! (-> v1-2 prim-core collide-as) (collide-spec)) @@ -466,7 +466,7 @@ ;; definition for method 18 of type process-drawable ;; WARN: Return type mismatch int vs none. -(defmethod relocate-nav process-drawable ((this process-drawable) (arg0 int)) +(defmethod relocate-nav ((this process-drawable) (arg0 int)) (set! (-> this nav) (the-as nav-control (&+ (the-as pointer (-> this nav)) arg0))) 0 (none) @@ -525,7 +525,7 @@ ) ;; definition for method 10 of type process-drawable -(defmethod deactivate process-drawable ((this process-drawable)) +(defmethod deactivate ((this process-drawable)) (if (nonzero? (-> this part)) (kill-and-free-particles (-> this part)) ) @@ -733,7 +733,7 @@ ;; definition for method 14 of type process-drawable ;; INFO: Used lq/sq -(defmethod initialize-skeleton process-drawable ((this process-drawable) (arg0 skeleton-group) (arg1 pair)) +(defmethod initialize-skeleton ((this process-drawable) (arg0 skeleton-group) (arg1 pair)) (local-vars (v1-14 art-element)) (if (not arg0) (go process-drawable-art-error "skel-group") @@ -805,7 +805,7 @@ ) ;; definition for method 15 of type process-drawable -(defmethod initialize-skeleton-by-name process-drawable ((this process-drawable) (arg0 string)) +(defmethod initialize-skeleton-by-name ((this process-drawable) (arg0 string)) (let* ((s4-0 *level*) (s3-0 (method-of-object s4-0 art-group-get-by-name)) ) @@ -821,7 +821,7 @@ ) ;; definition for method 16 of type process-drawable -(defmethod apply-alignment process-drawable ((this process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment ((this process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (with-pp (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) (let* ((s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) @@ -1194,7 +1194,7 @@ ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod update-anim-data joint-control ((this joint-control)) +(defmethod update-anim-data ((this joint-control)) (local-vars (s7-0 none) (ra-0 int)) (let ((s5-0 (+ (-> this active-channels) (-> this float-channels)))) (dotimes (s4-0 (the-as int s5-0)) @@ -1238,7 +1238,7 @@ ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod evaluate-joint-control process-drawable ((this process-drawable)) +(defmethod evaluate-joint-control ((this process-drawable)) (local-vars (s1-0 joint-control-channel) (s2-0 int) (s4-0 uint) (s7-0 none) (ra-0 int)) (let ((gp-0 (-> this skel))) (let ((a0-1 (-> gp-0 top-anim))) @@ -1354,7 +1354,7 @@ ) ;; definition for method 9 of type joint-control -(defmethod current-cycle-distance joint-control ((this joint-control)) +(defmethod current-cycle-distance ((this joint-control)) (cond ((< (the-as int (-> this root-channel)) (the-as int (-> this channel (-> this active-channels)))) (let ((s4-0 (-> this root-channel (-> this root-channel 0 group-size))) @@ -1402,7 +1402,7 @@ ;; definition for method 9 of type top-anim-joint-control ;; WARN: Return type mismatch top-anim-joint-control vs none. -(defmethod reset top-anim-joint-control ((this top-anim-joint-control)) +(defmethod reset ((this top-anim-joint-control)) (let ((v0-0 this)) (set! (-> v0-0 interp) 0.0) (set! (-> v0-0 frame-targ) #f) @@ -1421,7 +1421,7 @@ ) ;; definition for method 11 of type top-anim-joint-control -(defmethod get-channel top-anim-joint-control ((this top-anim-joint-control) (arg0 int)) +(defmethod get-channel ((this top-anim-joint-control) (arg0 int)) (case arg0 ((1) (case (-> this process 0 skel float-channels) @@ -1451,15 +1451,15 @@ ;; definition for method 12 of type top-anim-joint-control ;; WARN: Return type mismatch int vs none. -(defmethod push-anim-to-targ top-anim-joint-control ((this top-anim-joint-control) - (arg0 art-joint-anim) - (arg1 float) - (arg2 int) - (arg3 int) - (arg4 float) - (arg5 float) - (arg6 symbol) - ) +(defmethod push-anim-to-targ ((this top-anim-joint-control) + (arg0 art-joint-anim) + (arg1 float) + (arg2 int) + (arg3 int) + (arg4 float) + (arg5 float) + (arg6 symbol) + ) (when (!= (-> this interp) 0.0) (let ((v1-1 this)) (set! (-> v1-1 frame-targ) arg0) @@ -1489,7 +1489,7 @@ ;; definition for method 10 of type top-anim-joint-control ;; WARN: Return type mismatch int vs none. -(defmethod update top-anim-joint-control ((this top-anim-joint-control)) +(defmethod update ((this top-anim-joint-control)) (with-pp (let* ((v1-0 (-> this process)) (pp (if v1-0 diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc index b08d58ace58..3ba33d2539c 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc @@ -3,26 +3,22 @@ ;; definition of type process-focusable (deftype process-focusable (process-drawable) - ((root collide-shape :override) - (focus-status focus-status :offset-assert 200) + ((root collide-shape :override) + (focus-status focus-status) ) - :heap-base #x50 - :method-count-assert 27 - :size-assert #xcc - :flag-assert #x1b005000cc (:methods - (get-trans (_type_ int) vector 20) - (get-quat (_type_ int) quaternion 21) - (get-transv (_type_) vector 22) - (time-to-apex-or-ground (_type_ int) int 23) - (get-water-height (_type_) meters 24) - (get-notice-time (_type_) time-frame 25) - (get-inv-mass (_type_) float 26) + (get-trans (_type_ int) vector) + (get-quat (_type_ int) quaternion) + (get-transv (_type_) vector) + (time-to-apex-or-ground (_type_ int) int) + (get-water-height (_type_) meters) + (get-notice-time (_type_) time-frame) + (get-inv-mass (_type_) float) ) ) ;; definition for method 3 of type process-focusable -(defmethod inspect process-focusable ((this process-focusable)) +(defmethod inspect ((this process-focusable)) (when (not this) (set! this this) (goto cfg-4) @@ -37,7 +33,7 @@ ;; definition for method 20 of type process-focusable ;; WARN: Return type mismatch structure vs vector. -(defmethod get-trans process-focusable ((this process-focusable) (arg0 int)) +(defmethod get-trans ((this process-focusable) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (let ((gp-0 (-> this root))) (the-as vector (cond @@ -59,34 +55,34 @@ ) ;; definition for method 22 of type process-focusable -(defmethod get-transv process-focusable ((this process-focusable)) +(defmethod get-transv ((this process-focusable)) (-> this root transv) ) ;; definition for method 21 of type process-focusable -(defmethod get-quat process-focusable ((this process-focusable) (arg0 int)) +(defmethod get-quat ((this process-focusable) (arg0 int)) (-> this root quat) ) ;; definition for method 23 of type process-focusable -(defmethod time-to-apex-or-ground process-focusable ((this process-focusable) (arg0 int)) +(defmethod time-to-apex-or-ground ((this process-focusable) (arg0 int)) 0 ) ;; definition for method 24 of type process-focusable ;; WARN: Return type mismatch int vs meters. -(defmethod get-water-height process-focusable ((this process-focusable)) +(defmethod get-water-height ((this process-focusable)) (the-as meters 0) ) ;; definition for method 26 of type process-focusable -(defmethod get-inv-mass process-focusable ((this process-focusable)) +(defmethod get-inv-mass ((this process-focusable)) 0.0 ) ;; definition for method 25 of type process-focusable ;; WARN: Return type mismatch int vs time-frame. -(defmethod get-notice-time process-focusable ((this process-focusable)) +(defmethod get-notice-time ((this process-focusable)) (the-as time-frame 0) ) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable-h_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable-h_REF.gc index 2b6317d1d72..d8f27624f9e 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable-h_REF.gc @@ -3,42 +3,40 @@ ;; definition of type process-taskable (deftype process-taskable (process-focusable) - ((task game-task-control :offset-assert 204) - (ambient ambient-control :inline :offset-assert 208) - (neck-joint-index int32 :offset-assert 224) - (talk-message text-id :offset-assert 228) - (bounce-away symbol :offset-assert 232) - (will-talk symbol :offset-assert 236) - (look-at-me symbol :offset-assert 240) - (hide-during-movie symbol :offset-assert 244) - (talk-distance meters :offset-assert 248) - (talk-height meters :offset-assert 252) - (last-talk time-frame :offset-assert 256) - (want-to-say time-frame :offset-assert 264) - (birth-time time-frame :offset-assert 272) - (slave handle :offset-assert 280) + ((task game-task-control) + (ambient ambient-control :inline) + (neck-joint-index int32) + (talk-message text-id) + (bounce-away symbol) + (will-talk symbol) + (look-at-me symbol) + (hide-during-movie symbol) + (talk-distance meters) + (talk-height meters) + (last-talk time-frame) + (want-to-say time-frame) + (birth-time time-frame) + (slave handle) ) - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 + (:state-methods + hide + idle + (active game-task-event) + (play-game game-task-event) + ) (:methods - (hide () _type_ :state 27) - (idle () _type_ :state 28) - (active (game-task-event) _type_ :state 29) - (play-game (game-task-event) _type_ :state 30) - (process-taskable-method-31 (_type_) none 31) - (process-taskable-method-32 (_type_) none 32) - (init-art! (_type_) none 33) - (process-taskable-method-34 (_type_) symbol 34) - (get-art-elem (_type_) art-element 35) - (process-taskable-method-36 (_type_) none 36) - (process-taskable-method-37 (_type_) none 37) + (process-taskable-method-31 (_type_) none) + (process-taskable-method-32 (_type_) none) + (init-art! (_type_) none) + (process-taskable-method-34 (_type_) symbol) + (get-art-elem (_type_) art-element) + (process-taskable-method-36 (_type_) none) + (process-taskable-method-37 (_type_) none) ) ) ;; definition for method 3 of type process-taskable -(defmethod inspect process-taskable ((this process-taskable)) +(defmethod inspect ((this process-taskable)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc index 419a3b677a5..2930f597dab 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 7 of type process-taskable ;; WARN: Return type mismatch process-focusable vs process-taskable. -(defmethod relocate process-taskable ((this process-taskable) (arg0 int)) +(defmethod relocate ((this process-taskable) (arg0 int)) (if (nonzero? (-> this task)) (&+! (-> this task) arg0) ) @@ -34,13 +34,13 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ;; definition for method 34 of type process-taskable -(defmethod process-taskable-method-34 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-34 ((this process-taskable)) #t ) ;; definition for method 35 of type process-taskable ;; WARN: Return type mismatch art-joint-anim vs art-element. -(defmethod get-art-elem process-taskable ((this process-taskable)) +(defmethod get-art-elem ((this process-taskable)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (the-as art-element (if (> (-> this skel active-channels) 0) @@ -51,14 +51,14 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ;; definition for method 36 of type process-taskable ;; WARN: Return type mismatch int vs none. -(defmethod process-taskable-method-36 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-36 ((this process-taskable)) 0 (none) ) ;; definition for method 37 of type process-taskable ;; WARN: Return type mismatch object vs none. -(defmethod process-taskable-method-37 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-37 ((this process-taskable)) (let ((v1-1 (-> this draw shadow-ctrl))) (cond ((and (-> this draw shadow) @@ -346,7 +346,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ;; definition for method 31 of type process-taskable ;; WARN: Return type mismatch int vs none. -(defmethod process-taskable-method-31 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-31 ((this process-taskable)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) (set! (-> s5-0 total-prims) (the-as uint 4)) @@ -387,7 +387,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ;; definition for method 32 of type process-taskable ;; WARN: Return type mismatch int vs none. -(defmethod process-taskable-method-32 process-taskable ((this process-taskable)) +(defmethod process-taskable-method-32 ((this process-taskable)) (logior! (-> this skel status) (joint-control-status eye-anim)) (set! (-> this talk-message) (text-id press-triangle-to-talk)) (set! (-> this bounce-away) #t) @@ -420,7 +420,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ;; definition for method 33 of type process-taskable ;; WARN: Return type mismatch int vs none. -(defmethod init-art! process-taskable ((this process-taskable)) +(defmethod init-art! ((this process-taskable)) "@see [[initialize-skeleton]]" 0 (none) @@ -428,7 +428,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ;; definition for method 11 of type process-taskable ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! process-taskable ((this process-taskable) (arg0 entity-actor)) +(defmethod init-from-entity! ((this process-taskable) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/engine/process-drawable/simple-focus_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/simple-focus_REF.gc index 9e7c5abf2ab..0b77d8bf304 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/simple-focus_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/simple-focus_REF.gc @@ -3,19 +3,15 @@ ;; definition of type simple-focus (deftype simple-focus (process-focusable) - ((first-time? symbol :offset-assert 204) + ((first-time? symbol) ) - :heap-base #x50 - :method-count-assert 28 - :size-assert #xd0 - :flag-assert #x1c005000d0 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) ;; definition for method 3 of type simple-focus -(defmethod inspect simple-focus ((this simple-focus)) +(defmethod inspect ((this simple-focus)) (when (not this) (set! this this) (goto cfg-4) @@ -29,13 +25,13 @@ ) ;; definition for method 20 of type simple-focus -(defmethod get-trans simple-focus ((this simple-focus) (arg0 int)) +(defmethod get-trans ((this simple-focus) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (-> this root trans) ) ;; definition for method 12 of type simple-focus -(defmethod run-logic? simple-focus ((this simple-focus)) +(defmethod run-logic? ((this simple-focus)) (when (-> this first-time?) (set! (-> this first-time?) #f) #t diff --git a/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc index 5af839f378f..e544215702c 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc @@ -3,22 +3,18 @@ ;; definition of type simple-nav-sphere (deftype simple-nav-sphere (process-drawable) - ((root collide-shape :override) - (first-time? symbol :offset-assert 200) - (track-joint int32 :offset-assert 204) + ((root collide-shape :override) + (first-time? symbol) + (track-joint int32) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) + (:state-methods + idle + active ) ) ;; definition for method 3 of type simple-nav-sphere -(defmethod inspect simple-nav-sphere ((this simple-nav-sphere)) +(defmethod inspect ((this simple-nav-sphere)) (when (not this) (set! this this) (goto cfg-4) @@ -56,7 +52,7 @@ ) ;; definition for method 12 of type simple-nav-sphere -(defmethod run-logic? simple-nav-sphere ((this simple-nav-sphere)) +(defmethod run-logic? ((this simple-nav-sphere)) (cond (*display-nav-marks* #t diff --git a/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc index febced8fc26..46af633b70d 100644 --- a/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc @@ -4,39 +4,33 @@ ;; definition of type mc-handle (deftype mc-handle (int32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type mc-file-info (deftype mc-file-info (structure) - ((present int32 :offset-assert 0) - (blind-data float 16 :offset 4) - (blind-data-int8 int8 64 :offset 4) - (level-index int32 :offset 4) - (gem-count float :offset 8) - (skill-count float :offset 12) - (completion-percentage float :offset 16) - (minute uint8 :offset 24) - (hour uint8 :offset 25) - (week uint8 :offset 26) - (day uint8 :offset 27) - (month uint8 :offset 28) - (year uint8 :offset 29) - (game-time0 uint32 :offset 36) - (game-time1 uint32 :offset 40) - (secrets uint32 :offset 44) - (features uint32 :offset 48) + ((present int32) + (blind-data float 16 :offset 4) + (blind-data-int8 int8 64 :overlay-at (-> blind-data 0)) + (level-index int32 :overlay-at (-> blind-data 0)) + (gem-count float :overlay-at (-> blind-data 1)) + (skill-count float :overlay-at (-> blind-data 2)) + (completion-percentage float :overlay-at (-> blind-data 3)) + (minute uint8 :overlay-at (-> blind-data-int8 20)) + (hour uint8 :overlay-at (-> blind-data-int8 21)) + (week uint8 :overlay-at (-> blind-data-int8 22)) + (day uint8 :overlay-at (-> blind-data-int8 23)) + (month uint8 :overlay-at (-> blind-data-int8 24)) + (year uint8 :overlay-at (-> blind-data-int8 25)) + (game-time0 uint32 :overlay-at (-> blind-data 8)) + (game-time1 uint32 :overlay-at (-> blind-data 9)) + (secrets uint32 :overlay-at (-> blind-data 10)) + (features uint32 :overlay-at (-> blind-data 11)) ) :pack-me - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) ;; definition for method 3 of type mc-file-info -(defmethod inspect mc-file-info ((this mc-file-info)) +(defmethod inspect ((this mc-file-info)) (when (not this) (set! this this) (goto cfg-4) @@ -65,23 +59,20 @@ ;; definition of type mc-slot-info (deftype mc-slot-info (structure) - ((handle int32 :offset-assert 0) - (known int32 :offset-assert 4) - (formatted int32 :offset-assert 8) - (inited int32 :offset-assert 12) - (last-file int32 :offset-assert 16) - (mem-required int32 :offset-assert 20) - (mem-actual int32 :offset-assert 24) - (file mc-file-info 4 :inline :offset-assert 28) + ((handle int32) + (known int32) + (formatted int32) + (inited int32) + (last-file int32) + (mem-required int32) + (mem-actual int32) + (file mc-file-info 4 :inline) ) :pack-me - :method-count-assert 9 - :size-assert #x12c - :flag-assert #x90000012c ) ;; definition for method 3 of type mc-slot-info -(defmethod inspect mc-slot-info ((this mc-slot-info)) +(defmethod inspect ((this mc-slot-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc b/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc index fed5ae7ed59..f36c9a57228 100644 --- a/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc @@ -3,22 +3,19 @@ ;; definition of type scf-time (deftype scf-time (structure) - ((stat uint8 :offset-assert 0) - (second uint8 :offset-assert 1) - (minute uint8 :offset-assert 2) - (hour uint8 :offset-assert 3) - (week uint8 :offset-assert 4) - (day uint8 :offset-assert 5) - (month uint8 :offset-assert 6) - (year uint8 :offset-assert 7) + ((stat uint8) + (second uint8) + (minute uint8) + (hour uint8) + (week uint8) + (day uint8) + (month uint8) + (year uint8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type scf-time -(defmethod inspect scf-time ((this scf-time)) +(defmethod inspect ((this scf-time)) (when (not this) (set! this this) (goto cfg-4) @@ -41,23 +38,20 @@ ;; definition of type hw-cpad (deftype hw-cpad (basic) - ((valid uint8 :offset-assert 4) - (status uint8 :offset-assert 5) - (button0 uint16 :offset-assert 6) - (rightx uint8 :offset-assert 8) - (righty uint8 :offset-assert 9) - (leftx uint8 :offset-assert 10) - (lefty uint8 :offset-assert 11) - (abutton uint8 12 :offset-assert 12) - (dummy uint8 12 :offset-assert 24) + ((valid uint8) + (status uint8) + (button0 uint16) + (rightx uint8) + (righty uint8) + (leftx uint8) + (lefty uint8) + (abutton uint8 12) + (dummy uint8 12) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type hw-cpad -(defmethod inspect hw-cpad ((this hw-cpad)) +(defmethod inspect ((this hw-cpad)) (when (not this) (set! this this) (goto cfg-4) @@ -78,40 +72,37 @@ ;; definition of type cpad-info (deftype cpad-info (hw-cpad) - ((number int32 :offset-assert 36) - (cpad-file int32 :offset-assert 40) - (button0-abs pad-buttons 3 :offset-assert 44) - (button0-shadow-abs pad-buttons 1 :offset-assert 56) - (button0-rel pad-buttons 3 :offset-assert 60) - (stick0-dir float :offset-assert 72) - (stick0-speed float :offset-assert 76) - (new-pad int32 :offset-assert 80) - (state int32 :offset-assert 84) - (align uint8 6 :offset-assert 88) - (direct uint8 6 :offset-assert 94) - (buzz-val uint8 2 :offset-assert 100) - (buzz-pause-val uint8 1 :offset-assert 102) - (buzz-pause-time uint8 :offset-assert 103) - (buzz-time time-frame 2 :offset-assert 104) - (buzz basic :offset-assert 120) - (buzz-act int32 :offset-assert 124) - (change-time time-frame :offset-assert 128) - (old-rightx uint8 2 :offset-assert 136) - (old-righty uint8 2 :offset-assert 138) - (old-leftx uint8 2 :offset-assert 140) - (old-lefty uint8 2 :offset-assert 142) + ((number int32) + (cpad-file int32) + (button0-abs pad-buttons 3) + (button0-shadow-abs pad-buttons 1) + (button0-rel pad-buttons 3) + (stick0-dir float) + (stick0-speed float) + (new-pad int32) + (state int32) + (align uint8 6) + (direct uint8 6) + (buzz-val uint8 2) + (buzz-pause-val uint8 1) + (buzz-pause-time uint8) + (buzz-time time-frame 2) + (buzz basic) + (buzz-act int32) + (change-time time-frame) + (old-rightx uint8 2) + (old-righty uint8 2) + (old-leftx uint8 2) + (old-lefty uint8 2) ) - :method-count-assert 10 - :size-assert #x90 - :flag-assert #xa00000090 (:methods - (new (symbol type int) _type_ 0) - (adjust-to-screen-flip (_type_) int 9) + (new (symbol type int) _type_) + (adjust-to-screen-flip (_type_) int) ) ) ;; definition for method 3 of type cpad-info -(defmethod inspect cpad-info ((this cpad-info)) +(defmethod inspect ((this cpad-info)) (when (not this) (set! this this) (goto cfg-4) @@ -201,19 +192,16 @@ ;; definition of type cpad-list (deftype cpad-list (basic) - ((num-cpads int32 :offset-assert 4) - (cpads cpad-info 2 :offset-assert 8) + ((num-cpads int32) + (cpads cpad-info 2) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type cpad-list -(defmethod inspect cpad-list ((this cpad-list)) +(defmethod inspect ((this cpad-list)) (when (not this) (set! this this) (goto cfg-4) @@ -535,37 +523,34 @@ ;; definition of type mouse-info (deftype mouse-info (basic) - ((active symbol :offset-assert 4) - (cursor basic :offset-assert 8) - (valid symbol :offset-assert 12) - (id uint8 :offset-assert 16) - (status uint16 :offset-assert 18) - (button0 uint16 :offset-assert 20) - (deltax int8 :offset-assert 22) - (deltay int8 :offset-assert 23) - (wheel uint8 :offset-assert 24) - (change-time time-frame :offset-assert 32) - (button0-abs mouse-buttons 3 :offset-assert 40) - (button0-shadow-abs mouse-buttons 1 :offset-assert 52) - (button0-rel mouse-buttons 3 :offset-assert 56) - (pos vector 2 :inline :offset-assert 80) - (posx float :offset 80) - (posy float :offset 84) - (oldposx float :offset 96) - (oldposy float :offset 100) - (speedx float :offset 92) - (speedy float :offset 108) + ((active symbol) + (cursor basic) + (valid symbol) + (id uint8) + (status uint16) + (button0 uint16) + (deltax int8) + (deltay int8) + (wheel uint8) + (change-time time-frame) + (button0-abs mouse-buttons 3) + (button0-shadow-abs mouse-buttons 1) + (button0-rel mouse-buttons 3) + (pos vector 2 :inline) + (posx float :overlay-at (-> pos 0 data 0)) + (posy float :overlay-at (-> pos 0 data 1)) + (oldposx float :offset 96) + (oldposy float :offset 100) + (speedx float :overlay-at (-> pos 0 data 3)) + (speedy float :offset 108) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type mouse-info -(defmethod inspect mouse-info ((this mouse-info)) +(defmethod inspect ((this mouse-info)) (when (not this) (set! this this) (goto cfg-7) diff --git a/test/decompiler/reference/jak2/engine/ps2/rpc-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/rpc-h_REF.gc index 1b00f6f4779..d971599f2af 100644 --- a/test/decompiler/reference/jak2/engine/ps2/rpc-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/rpc-h_REF.gc @@ -3,23 +3,20 @@ ;; definition of type rpc-buffer (deftype rpc-buffer (basic) - ((elt-size uint32 :offset-assert 4) - (elt-count uint32 :offset-assert 8) - (elt-used uint32 :offset-assert 12) - (busy basic :offset-assert 16) - (base pointer :offset-assert 20) - (data uint8 :dynamic :offset 32) + ((elt-size uint32) + (elt-count uint32) + (elt-used uint32) + (busy basic) + (base pointer) + (data uint8 :dynamic :offset 32) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 (:methods - (new (symbol type uint uint) rpc-buffer 0) + (new (symbol type uint uint) rpc-buffer) ) ) ;; definition for method 3 of type rpc-buffer -(defmethod inspect rpc-buffer ((this rpc-buffer)) +(defmethod inspect ((this rpc-buffer)) (when (not this) (set! this this) (goto cfg-4) @@ -51,27 +48,24 @@ ;; definition of type rpc-buffer-pair (deftype rpc-buffer-pair (basic) - ((buffer rpc-buffer 2 :offset-assert 4) - (current rpc-buffer :offset-assert 12) - (last-recv-buffer pointer :offset-assert 16) - (rpc-port int32 :offset-assert 20) + ((buffer rpc-buffer 2) + (current rpc-buffer) + (last-recv-buffer pointer) + (rpc-port int32) ) - :method-count-assert 15 - :size-assert #x18 - :flag-assert #xf00000018 (:methods - (new (symbol type uint uint int) rpc-buffer-pair 0) - (call (rpc-buffer-pair uint pointer uint) int 9) - (add-element (rpc-buffer-pair) pointer 10) - (decrement-elt-used (rpc-buffer-pair) int 11) - (sync (rpc-buffer-pair symbol) int 12) - (check-busy (rpc-buffer-pair) symbol 13) - (pop-last-received (rpc-buffer-pair) pointer 14) + (new (symbol type uint uint int) rpc-buffer-pair) + (call (rpc-buffer-pair uint pointer uint) int) + (add-element (rpc-buffer-pair) pointer) + (decrement-elt-used (rpc-buffer-pair) int) + (sync (rpc-buffer-pair symbol) int) + (check-busy (rpc-buffer-pair) symbol) + (pop-last-received (rpc-buffer-pair) pointer) ) ) ;; definition for method 3 of type rpc-buffer-pair -(defmethod inspect rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod inspect ((this rpc-buffer-pair)) (when (not this) (set! this this) (goto cfg-4) @@ -98,7 +92,7 @@ ) ;; definition for method 12 of type rpc-buffer-pair -(defmethod sync rpc-buffer-pair ((this rpc-buffer-pair) (arg0 symbol)) +(defmethod sync ((this rpc-buffer-pair) (arg0 symbol)) (let ((s5-0 (if (= (-> this current) (-> this buffer 0)) (-> this buffer 1) (-> this buffer 0) @@ -130,7 +124,7 @@ ) ;; definition for method 13 of type rpc-buffer-pair -(defmethod check-busy rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod check-busy ((this rpc-buffer-pair)) (let ((gp-0 (if (= (-> this current) (-> this buffer 0)) (-> this buffer 1) (-> this buffer 0) @@ -150,7 +144,7 @@ ) ;; definition for method 9 of type rpc-buffer-pair -(defmethod call rpc-buffer-pair ((this rpc-buffer-pair) (arg0 uint) (arg1 pointer) (arg2 uint)) +(defmethod call ((this rpc-buffer-pair) (arg0 uint) (arg1 pointer) (arg2 uint)) (when (nonzero? (-> this current elt-used)) (let ((s2-0 (if (= (-> this current) (-> this buffer 0)) (-> this buffer 1) @@ -196,7 +190,7 @@ ) ;; definition for method 14 of type rpc-buffer-pair -(defmethod pop-last-received rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod pop-last-received ((this rpc-buffer-pair)) (let ((v0-0 (-> this last-recv-buffer))) (set! (-> this last-recv-buffer) (the-as pointer #f)) v0-0 @@ -204,7 +198,7 @@ ) ;; definition for method 10 of type rpc-buffer-pair -(defmethod add-element rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod add-element ((this rpc-buffer-pair)) (let ((v1-0 (-> this current))) (when (= (-> v1-0 elt-used) (-> v1-0 elt-count)) (if (zero? (-> this rpc-port)) @@ -221,7 +215,7 @@ ) ;; definition for method 11 of type rpc-buffer-pair -(defmethod decrement-elt-used rpc-buffer-pair ((this rpc-buffer-pair)) +(defmethod decrement-elt-used ((this rpc-buffer-pair)) (if (> (-> this current elt-used) 0) (+! (-> this current elt-used) -1) ) diff --git a/test/decompiler/reference/jak2/engine/ps2/timer-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/timer-h_REF.gc index 1718242b98a..dbfd4c0308c 100644 --- a/test/decompiler/reference/jak2/engine/ps2/timer-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/timer-h_REF.gc @@ -14,24 +14,18 @@ (equf uint8 :offset 10 :size 1) (ovff uint8 :offset 11 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type timer-bank (deftype timer-bank (structure) - ((count uint32 :offset-assert 0) - (mode timer-mode :offset 16) - (comp uint32 :offset 32) + ((count uint32) + (mode timer-mode :offset 16) + (comp uint32 :offset 32) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type timer-bank -(defmethod inspect timer-bank ((this timer-bank)) +(defmethod inspect ((this timer-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -46,15 +40,12 @@ ;; definition of type timer-hold-bank (deftype timer-hold-bank (timer-bank) - ((hold uint32 :offset 48) + ((hold uint32 :offset 48) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type timer-hold-bank -(defmethod inspect timer-hold-bank ((this timer-hold-bank)) +(defmethod inspect ((this timer-hold-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -70,17 +61,14 @@ ;; definition of type stopwatch (deftype stopwatch (basic) - ((prev-time-elapsed time-frame :offset-assert 8) - (start-time time-frame :offset-assert 16) - (begin-level int32 :offset-assert 24) + ((prev-time-elapsed time-frame) + (start-time time-frame) + (begin-level int32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type stopwatch -(defmethod inspect stopwatch ((this stopwatch)) +(defmethod inspect ((this stopwatch)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc b/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc index 01a8d285c7f..b2b82b16d8e 100644 --- a/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc @@ -138,7 +138,7 @@ ) ;; definition for method 9 of type clock -(defmethod update-rates! clock ((this clock) (arg0 float)) +(defmethod update-rates! ((this clock) (arg0 float)) (set! (-> this clock-ratio) arg0) (let ((f0-6 (if (nonzero? *display*) (* (-> *display* time-factor) (-> *display* dog-ratio) arg0) @@ -164,7 +164,7 @@ ) ;; definition for method 10 of type clock -(defmethod advance-by! clock ((this clock) (arg0 float)) +(defmethod advance-by! ((this clock) (arg0 float)) (the int (+ arg0 (-> this accum))) (+! (-> this integral-accum) arg0) (set! (-> this old-integral-frame-counter) (-> this integral-frame-counter)) @@ -182,7 +182,7 @@ ) ;; definition for method 11 of type clock -(defmethod tick! clock ((this clock)) +(defmethod tick! ((this clock)) (if (not (logtest? (-> this mask) (-> *kernel-context* prevent-from-run))) (advance-by! this (* (-> *display* time-factor) (-> *display* dog-ratio) (-> this clock-ratio))) (set! (-> this sparticle-data x) 0.0) @@ -192,7 +192,7 @@ ;; definition for method 14 of type clock ;; WARN: Return type mismatch int vs none. -(defmethod reset! clock ((this clock)) +(defmethod reset! ((this clock)) (set! (-> this frame-counter) (seconds 1000)) (set! (-> this integral-frame-counter) (the-as uint #x493e0)) (set! (-> this accum) 0.0) @@ -204,14 +204,14 @@ ) ;; definition for method 12 of type clock -(defmethod save! clock ((this clock) (arg0 (pointer uint64))) +(defmethod save! ((this clock) (arg0 (pointer uint64))) (set! (-> arg0 0) (the-as uint (-> this frame-counter))) (set! (-> arg0 1) (-> this integral-frame-counter)) 16 ) ;; definition for method 13 of type clock -(defmethod load! clock ((this clock) (arg0 (pointer uint64))) +(defmethod load! ((this clock) (arg0 (pointer uint64))) (set! (-> this frame-counter) (the-as time-frame (-> arg0 0))) (set! (-> this integral-frame-counter) (-> arg0 1)) (set! (-> this accum) 0.0) diff --git a/test/decompiler/reference/jak2/engine/ps2/vif-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/vif-h_REF.gc index edb6cacc8e3..e9f5f5d8623 100644 --- a/test/decompiler/reference/jak2/engine/ps2/vif-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/vif-h_REF.gc @@ -14,13 +14,10 @@ (er1 uint8 :offset 13 :size 1) (fqc uint8 :offset 24 :size 4) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type vif-stat -(defmethod inspect vif-stat ((this vif-stat)) +(defmethod inspect ((this vif-stat)) (when (not this) (set! this this) (goto cfg-4) @@ -47,9 +44,6 @@ (stp uint8 :offset 2 :size 1) (stc uint8 :offset 3 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type vif-err @@ -58,44 +52,38 @@ (me0 uint8 :offset 1 :size 1) (me1 uint8 :offset 2 :size 1) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type vif-bank (deftype vif-bank (structure) - ((stat uint32 :offset-assert 0) - (fbrst uint32 :offset 16) - (err vif-err :offset 32) - (mark uint32 :offset 48) - (cycle uint32 :offset 64) - (mode uint32 :offset 80) - (num uint32 :offset 96) - (mask uint32 :offset 112) - (code uint32 :offset 128) - (itops uint32 :offset 144) - (base uint32 :offset 160) - (offset uint32 :offset 176) - (tops uint32 :offset 192) - (itop uint32 :offset 208) - (top uint32 :offset 224) - (r0 uint32 :offset 256) - (r1 uint32 :offset 272) - (r2 uint32 :offset 288) - (r3 uint32 :offset 304) - (c0 uint32 :offset 320) - (c1 uint32 :offset 336) - (c2 uint32 :offset 352) - (c3 uint32 :offset 368) + ((stat uint32) + (fbrst uint32 :offset 16) + (err vif-err :offset 32) + (mark uint32 :offset 48) + (cycle uint32 :offset 64) + (mode uint32 :offset 80) + (num uint32 :offset 96) + (mask uint32 :offset 112) + (code uint32 :offset 128) + (itops uint32 :offset 144) + (base uint32 :offset 160) + (offset uint32 :offset 176) + (tops uint32 :offset 192) + (itop uint32 :offset 208) + (top uint32 :offset 224) + (r0 uint32 :offset 256) + (r1 uint32 :offset 272) + (r2 uint32 :offset 288) + (r3 uint32 :offset 304) + (c0 uint32 :offset 320) + (c1 uint32 :offset 336) + (c2 uint32 :offset 352) + (c3 uint32 :offset 368) ) - :method-count-assert 9 - :size-assert #x174 - :flag-assert #x900000174 ) ;; definition for method 3 of type vif-bank -(defmethod inspect vif-bank ((this vif-bank)) +(defmethod inspect ((this vif-bank)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/scene/scene-h_REF.gc b/test/decompiler/reference/jak2/engine/scene/scene-h_REF.gc index b8fe0f37fa6..b4ce22b33c4 100644 --- a/test/decompiler/reference/jak2/engine/scene/scene-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/scene/scene-h_REF.gc @@ -3,34 +3,31 @@ ;; definition of type scene-actor (deftype scene-actor (basic) - ((name string :offset-assert 4) - (level symbol :offset-assert 8) - (art-group string :offset-assert 12) - (prefix string :offset-assert 16) - (draw-frames pair :offset-assert 20) - (scissor-frames pair :offset-assert 24) - (camera int16 :offset-assert 28) - (light-index uint8 :offset-assert 30) - (shadow-mask uint8 :offset-assert 31) - (shadow-values uint32 :offset-assert 32) - (flags uint32 :offset-assert 36) - (command-list basic :offset-assert 40) - (shadow-flags int32 :offset-assert 44) - (shadow-volume-joint basic :offset-assert 48) - (draw-seg uint64 :offset-assert 56) - (no-draw-seg uint64 :offset-assert 64) - (process handle :offset-assert 72) + ((name string) + (level symbol) + (art-group string) + (prefix string) + (draw-frames pair) + (scissor-frames pair) + (camera int16) + (light-index uint8) + (shadow-mask uint8) + (shadow-values uint32) + (flags uint32) + (command-list basic) + (shadow-flags int32) + (shadow-volume-joint basic) + (draw-seg uint64) + (no-draw-seg uint64) + (process handle) ) - :method-count-assert 10 - :size-assert #x50 - :flag-assert #xa00000050 (:methods - (scene-actor-method-9 (_type_ scene-player) (pointer process) 9) + (scene-actor-method-9 (_type_ scene-player) (pointer process)) ) ) ;; definition for method 3 of type scene-actor -(defmethod inspect scene-actor ((this scene-actor)) +(defmethod inspect ((this scene-actor)) (when (not this) (set! this this) (goto cfg-4) @@ -59,46 +56,43 @@ ;; definition of type scene (deftype scene (art-group) - ((mask-to-clear process-mask :offset-assert 32) - (entity string :offset-assert 36) - (art-group string :offset-assert 40) - (anim string :offset-assert 44) - (parts int32 :offset-assert 48) - (command-list pair :offset-assert 52) - (cut-list pair :offset-assert 56) - (wait-max-time time-frame :offset-assert 64) - (wait-air-time time-frame :offset-assert 72) - (wait-ground-time time-frame :offset-assert 80) - (draw-target symbol :offset-assert 88) - (abort symbol :offset-assert 92) - (actor (array scene-actor) :offset-assert 96) - (load-point-obj object :offset-assert 100) - (load-point continue-point :offset 100) - (load-point-name string :offset 100) - (end-point-obj object :offset-assert 104) - (end-point continue-point :offset 104) - (end-point-name string :offset 104) - (borrow pair :offset-assert 108) - (sfx-volume float :offset-assert 112) - (ambient-volume float :offset-assert 116) - (music-volume float :offset-assert 120) - (blackout-end symbol :offset-assert 124) - (peaceful symbol :offset-assert 128) - (music-delay float :offset-assert 132) - (save symbol :offset-assert 136) - (scene-task uint16 :offset-assert 140) + ((mask-to-clear process-mask) + (entity string) + (art-group string) + (anim string) + (parts int32) + (command-list pair) + (cut-list pair) + (wait-max-time time-frame) + (wait-air-time time-frame) + (wait-ground-time time-frame) + (draw-target symbol) + (abort symbol) + (actor (array scene-actor)) + (load-point-obj object) + (load-point continue-point :overlay-at load-point-obj) + (load-point-name string :overlay-at load-point-obj) + (end-point-obj object) + (end-point continue-point :overlay-at end-point-obj) + (end-point-name string :overlay-at end-point-obj) + (borrow pair) + (sfx-volume float) + (ambient-volume float) + (music-volume float) + (blackout-end symbol) + (peaceful symbol) + (music-delay float) + (save symbol) + (scene-task uint16) ) - :method-count-assert 17 - :size-assert #x8e - :flag-assert #x110000008e (:methods - (scene-method-15 (_type_ spool-anim) none 15) - (scene-method-16 (_type_) _type_ 16) + (scene-method-15 (_type_ spool-anim) none) + (scene-method-16 (_type_) _type_) ) ) ;; definition for method 3 of type scene -(defmethod inspect scene ((this scene)) +(defmethod inspect ((this scene)) (when (not this) (set! this this) (goto cfg-4) @@ -139,46 +133,44 @@ ;; definition of type scene-player (deftype scene-player (process-drawable) - ((scene-list (array scene) :offset-assert 200) - (scene scene :offset-assert 204) - (scene-index int32 :offset-assert 208) - (anim spool-anim :offset-assert 212) - (next-anim spool-anim :offset-assert 216) - (camera handle :offset-assert 224) - (main-entity entity-actor :offset-assert 232) - (wait symbol :offset-assert 236) - (old-target-pos transformq :inline :offset-assert 240) - (pre-cut-frame basic :offset-assert 288) - (preload-continue string :offset-assert 292) - (dma-max uint32 :offset-assert 296) - (gui-id sound-id :offset-assert 300) - (aborted? symbol :offset-assert 304) - (scene-start-time time-frame :offset-assert 312) - (targ-speed float :offset-assert 320) - (cur-speed float :offset-assert 324) - (speed-change-time time-frame :offset-assert 328) - (speed-press-time time-frame :offset-assert 336) - (speed-change-speed float :offset-assert 344) - (unknown-time time-frame :offset 344) - (subtitle-change-time time-frame :offset-assert 352) - (user-sound sound-id 4 :offset-assert 360) + ((scene-list (array scene)) + (scene scene) + (scene-index int32) + (anim spool-anim) + (next-anim spool-anim) + (camera handle) + (main-entity entity-actor) + (wait symbol) + (old-target-pos transformq :inline) + (pre-cut-frame basic) + (preload-continue string) + (dma-max uint32) + (gui-id sound-id) + (aborted? symbol) + (scene-start-time time-frame) + (targ-speed float) + (cur-speed float) + (speed-change-time time-frame) + (speed-press-time time-frame) + (speed-change-speed float) + (unknown-time time-frame :overlay-at speed-change-speed) + (subtitle-change-time time-frame) + (user-sound sound-id 4) ) - :heap-base #x100 - :method-count-assert 26 - :size-assert #x178 - :flag-assert #x1a01000178 + (:state-methods + (wait symbol) + release + play-anim + ) (:methods - (wait (symbol) _type_ :state 20) - (release () _type_ :state 21) - (play-anim () _type_ :state 22) - (scene-player-method-23 (_type_ string symbol) none 23) - (scene-player-method-24 (_type_ basic symbol) scene 24) - (scene-player-method-25 (_type_ float) none 25) + (scene-player-method-23 (_type_ string symbol) none) + (scene-player-method-24 (_type_ basic symbol) scene) + (scene-player-method-25 (_type_ float) none) ) ) ;; definition for method 3 of type scene-player -(defmethod inspect scene-player ((this scene-player)) +(defmethod inspect ((this scene-player)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc index 7bcd3a656f0..8e7cac5aed8 100644 --- a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc +++ b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc @@ -4,13 +4,10 @@ ;; definition of type scene-stage (deftype scene-stage (process-hidden) () - :method-count-assert 15 - :size-assert #x80 - :flag-assert #xf00000080 ) ;; definition for method 3 of type scene-stage -(defmethod inspect scene-stage ((this scene-stage)) +(defmethod inspect ((this scene-stage)) (when (not this) (set! this this) (goto cfg-68) @@ -148,14 +145,14 @@ ) ;; definition for method 2 of type scene -(defmethod print scene ((this scene)) +(defmethod print ((this scene)) (format #t "#" (-> this art-group) (-> this anim) this) this ) ;; definition for method 15 of type scene ;; WARN: Return type mismatch spool-anim vs none. -(defmethod scene-method-15 scene ((this scene) (arg0 spool-anim)) +(defmethod scene-method-15 ((this scene) (arg0 spool-anim)) (set! (-> arg0 name) (-> this anim)) (set! (-> arg0 anim-name) (-> this anim)) (set! (-> arg0 parts) (-> this parts)) @@ -185,7 +182,7 @@ ;; definition for method 9 of type scene-actor ;; INFO: Used lq/sq -(defmethod scene-actor-method-9 scene-actor ((this scene-actor) (arg0 scene-player)) +(defmethod scene-actor-method-9 ((this scene-actor) (arg0 scene-player)) (local-vars (s4-0 (pointer process)) (sv-96 process) (sv-112 process)) (let ((s1-0 (if (-> this level) (level-get *level* (-> this level)) @@ -374,7 +371,7 @@ ) ;; definition for method 10 of type scene-player -(defmethod deactivate scene-player ((this scene-player)) +(defmethod deactivate ((this scene-player)) (set! *scene-player* (the-as (pointer scene-player) #f)) (kill-persister *setting-control* (the-as engine-pers 'blackout) 'bg-a-force) ((method-of-type process-drawable deactivate) this) @@ -383,7 +380,7 @@ ;; definition for method 7 of type scene-player ;; WARN: Return type mismatch process-drawable vs scene-player. -(defmethod relocate scene-player ((this scene-player) (arg0 int)) +(defmethod relocate ((this scene-player) (arg0 int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) @@ -404,7 +401,7 @@ ;; definition for method 25 of type scene-player ;; WARN: Return type mismatch int vs none. -(defmethod scene-player-method-25 scene-player ((this scene-player) (arg0 float)) +(defmethod scene-player-method-25 ((this scene-player) (arg0 float)) (local-vars (v1-11 symbol) (v1-40 symbol) (s0-0 object) (s0-1 object)) (dotimes (s4-0 (-> this scene actor length)) (let ((s3-0 (-> this scene actor s4-0))) @@ -516,7 +513,7 @@ ;; definition for method 24 of type scene-player ;; WARN: Return type mismatch basic vs scene. -(defmethod scene-player-method-24 scene-player ((this scene-player) (arg0 basic) (arg1 symbol)) +(defmethod scene-player-method-24 ((this scene-player) (arg0 basic) (arg1 symbol)) "TODO - arg1 can be string/scene" (when (= (-> arg0 type) string) (let ((v1-2 (scene-lookup arg0))) @@ -541,7 +538,7 @@ ;; definition for method 23 of type scene-player ;; WARN: Return type mismatch int vs none. -(defmethod scene-player-method-23 scene-player ((this scene-player) (arg0 string) (arg1 symbol)) +(defmethod scene-player-method-23 ((this scene-player) (arg0 string) (arg1 symbol)) (let ((gp-0 (scene-player-method-24 this arg0 #t))) (when (-> gp-0 peaceful) (let ((s3-0 *traffic-manager*)) @@ -693,17 +690,14 @@ ;; definition of type subtitle-work (deftype subtitle-work (structure) - ((draw-tmpl dma-gif-packet :inline :offset-assert 0) - (color0 vector4w :inline :offset-assert 32) - (color1 vector4w :inline :offset-assert 48) + ((draw-tmpl dma-gif-packet :inline) + (color0 vector4w :inline) + (color1 vector4w :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type subtitle-work -(defmethod inspect subtitle-work ((this subtitle-work)) +(defmethod inspect ((this subtitle-work)) (when (not this) (set! this this) (goto cfg-4) @@ -1730,7 +1724,7 @@ ) ;; definition for method 16 of type scene -(defmethod scene-method-16 scene ((this scene)) +(defmethod scene-method-16 ((this scene)) (let ((v1-1 (-> *level* loading-level))) (if v1-1 (set-loaded-art (-> v1-1 art-group) this) diff --git a/test/decompiler/reference/jak2/engine/sound/gsound-h_REF.gc b/test/decompiler/reference/jak2/engine/sound/gsound-h_REF.gc index 0ca74f35a49..48d705deea4 100644 --- a/test/decompiler/reference/jak2/engine/sound/gsound-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/gsound-h_REF.gc @@ -3,16 +3,13 @@ ;; definition of type sound-stream-name (deftype sound-stream-name (structure) - ((name uint8 48 :offset-assert 0) + ((name uint8 48) ) :pack-me - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type sound-stream-name -(defmethod inspect sound-stream-name ((this sound-stream-name)) +(defmethod inspect ((this sound-stream-name)) (when (not this) (set! this this) (goto cfg-4) @@ -26,20 +23,14 @@ ;; definition of type sound-id (deftype sound-id (uint32) () - :method-count-assert 10 - :size-assert #x4 - :flag-assert #xa00000004 (:methods - (unused-9 () none 9) + (unused-9 () none) ) ) ;; definition of type sound-bank-id (deftype sound-bank-id (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition of type sound-name @@ -47,23 +38,17 @@ ((lo uint64 :offset 0 :size 64) (hi uint64 :offset 64 :size 64) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition of type sound-rpc-cmd (deftype sound-rpc-cmd (structure) - ((rsvd1 uint16 :offset-assert 0) - (command sound-command :offset-assert 2) + ((rsvd1 uint16) + (command sound-command) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type sound-rpc-cmd -(defmethod inspect sound-rpc-cmd ((this sound-rpc-cmd)) +(defmethod inspect ((this sound-rpc-cmd)) (when (not this) (set! this this) (goto cfg-4) @@ -77,27 +62,24 @@ ;; definition of type sound-play-params (deftype sound-play-params (structure) - ((mask uint16 :offset-assert 0) - (pitch-mod int16 :offset-assert 2) - (bend int16 :offset-assert 4) - (fo-min int16 :offset-assert 6) - (fo-max int16 :offset-assert 8) - (fo-curve int8 :offset-assert 10) - (priority int8 :offset-assert 11) - (volume int32 :offset-assert 12) - (trans int32 3 :offset-assert 16) - (group uint8 :offset-assert 28) - (reg uint8 3 :offset-assert 29) - (group-and-regs uint32 :offset 28) + ((mask uint16) + (pitch-mod int16) + (bend int16) + (fo-min int16) + (fo-max int16) + (fo-curve int8) + (priority int8) + (volume int32) + (trans int32 3) + (group uint8) + (reg uint8 3) + (group-and-regs uint32 :overlay-at group) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sound-play-params -(defmethod inspect sound-play-params ((this sound-play-params)) +(defmethod inspect ((this sound-play-params)) (when (not this) (set! this this) (goto cfg-4) @@ -120,16 +102,13 @@ ;; definition of type sound-rpc-bank-cmd (deftype sound-rpc-bank-cmd (sound-rpc-cmd) - ((bank-name sound-name :offset-assert 16) + ((bank-name sound-name) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sound-rpc-bank-cmd ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-bank-cmd ((this sound-rpc-bank-cmd)) +(defmethod inspect ((this sound-rpc-bank-cmd)) (when (not this) (set! this this) (goto cfg-4) @@ -144,16 +123,13 @@ ;; definition of type sound-rpc-test-cmd (deftype sound-rpc-test-cmd (sound-rpc-cmd) - ((ee-addr pointer :offset-assert 4) - (param0 uint16 :offset-assert 8) + ((ee-addr pointer) + (param0 uint16) ) - :method-count-assert 9 - :size-assert #xa - :flag-assert #x90000000a ) ;; definition for method 3 of type sound-rpc-test-cmd -(defmethod inspect sound-rpc-test-cmd ((this sound-rpc-test-cmd)) +(defmethod inspect ((this sound-rpc-test-cmd)) (when (not this) (set! this this) (goto cfg-4) @@ -169,15 +145,12 @@ ;; definition of type sound-rpc-sound-cmd (deftype sound-rpc-sound-cmd (sound-rpc-cmd) - ((id sound-id :offset-assert 4) + ((id sound-id) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type sound-rpc-sound-cmd -(defmethod inspect sound-rpc-sound-cmd ((this sound-rpc-sound-cmd)) +(defmethod inspect ((this sound-rpc-sound-cmd)) (when (not this) (set! this this) (goto cfg-4) @@ -192,15 +165,12 @@ ;; definition of type sound-rpc-group-cmd (deftype sound-rpc-group-cmd (sound-rpc-cmd) - ((group sound-group :offset-assert 4) + ((group sound-group) ) - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type sound-rpc-group-cmd -(defmethod inspect sound-rpc-group-cmd ((this sound-rpc-group-cmd)) +(defmethod inspect ((this sound-rpc-group-cmd)) (when (not this) (set! this this) (goto cfg-4) @@ -215,16 +185,13 @@ ;; definition of type sound-rpc-load-bank (deftype sound-rpc-load-bank (sound-rpc-bank-cmd) - ((ee-addr pointer :offset-assert 32) + ((ee-addr pointer) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type sound-rpc-load-bank ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-load-bank ((this sound-rpc-load-bank)) +(defmethod inspect ((this sound-rpc-load-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -241,14 +208,11 @@ ;; definition of type sound-rpc-load-music (deftype sound-rpc-load-music (sound-rpc-bank-cmd) () - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sound-rpc-load-music ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-load-music ((this sound-rpc-load-music)) +(defmethod inspect ((this sound-rpc-load-music)) (when (not this) (set! this this) (goto cfg-4) @@ -264,14 +228,11 @@ ;; definition of type sound-rpc-unload-bank (deftype sound-rpc-unload-bank (sound-rpc-bank-cmd) () - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type sound-rpc-unload-bank ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-unload-bank ((this sound-rpc-unload-bank)) +(defmethod inspect ((this sound-rpc-unload-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -286,17 +247,14 @@ ;; definition of type sound-rpc-play (deftype sound-rpc-play (sound-rpc-sound-cmd) - ((name sound-name :offset-assert 16) - (params sound-play-params :inline :offset-assert 32) + ((name sound-name) + (params sound-play-params :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type sound-rpc-play ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-play ((this sound-rpc-play)) +(defmethod inspect ((this sound-rpc-play)) (when (not this) (set! this this) (goto cfg-4) @@ -314,13 +272,10 @@ ;; definition of type sound-rpc-pause-sound (deftype sound-rpc-pause-sound (sound-rpc-sound-cmd) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type sound-rpc-pause-sound -(defmethod inspect sound-rpc-pause-sound ((this sound-rpc-pause-sound)) +(defmethod inspect ((this sound-rpc-pause-sound)) (when (not this) (set! this this) (goto cfg-4) @@ -336,13 +291,10 @@ ;; definition of type sound-rpc-stop-sound (deftype sound-rpc-stop-sound (sound-rpc-sound-cmd) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type sound-rpc-stop-sound -(defmethod inspect sound-rpc-stop-sound ((this sound-rpc-stop-sound)) +(defmethod inspect ((this sound-rpc-stop-sound)) (when (not this) (set! this this) (goto cfg-4) @@ -358,13 +310,10 @@ ;; definition of type sound-rpc-continue-sound (deftype sound-rpc-continue-sound (sound-rpc-sound-cmd) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type sound-rpc-continue-sound -(defmethod inspect sound-rpc-continue-sound ((this sound-rpc-continue-sound)) +(defmethod inspect ((this sound-rpc-continue-sound)) (when (not this) (set! this this) (goto cfg-4) @@ -379,17 +328,14 @@ ;; definition of type sound-rpc-set-param (deftype sound-rpc-set-param (sound-rpc-sound-cmd) - ((params sound-play-params :inline :offset-assert 8) - (auto-time int32 :offset-assert 40) - (auto-from int32 :offset-assert 44) + ((params sound-play-params :inline) + (auto-time int32) + (auto-from int32) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type sound-rpc-set-param -(defmethod inspect sound-rpc-set-param ((this sound-rpc-set-param)) +(defmethod inspect ((this sound-rpc-set-param)) (when (not this) (set! this this) (goto cfg-4) @@ -407,15 +353,12 @@ ;; definition of type sound-rpc-set-master-volume (deftype sound-rpc-set-master-volume (sound-rpc-group-cmd) - ((volume int32 :offset-assert 8) + ((volume int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type sound-rpc-set-master-volume -(defmethod inspect sound-rpc-set-master-volume ((this sound-rpc-set-master-volume)) +(defmethod inspect ((this sound-rpc-set-master-volume)) (when (not this) (set! this this) (goto cfg-4) @@ -432,13 +375,10 @@ ;; definition of type sound-rpc-pause-group (deftype sound-rpc-pause-group (sound-rpc-group-cmd) () - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type sound-rpc-pause-group -(defmethod inspect sound-rpc-pause-group ((this sound-rpc-pause-group)) +(defmethod inspect ((this sound-rpc-pause-group)) (when (not this) (set! this this) (goto cfg-4) @@ -454,13 +394,10 @@ ;; definition of type sound-rpc-stop-group (deftype sound-rpc-stop-group (sound-rpc-group-cmd) () - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type sound-rpc-stop-group -(defmethod inspect sound-rpc-stop-group ((this sound-rpc-stop-group)) +(defmethod inspect ((this sound-rpc-stop-group)) (when (not this) (set! this this) (goto cfg-4) @@ -476,13 +413,10 @@ ;; definition of type sound-rpc-continue-group (deftype sound-rpc-continue-group (sound-rpc-group-cmd) () - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type sound-rpc-continue-group -(defmethod inspect sound-rpc-continue-group ((this sound-rpc-continue-group)) +(defmethod inspect ((this sound-rpc-continue-group)) (when (not this) (set! this this) (goto cfg-4) @@ -497,17 +431,14 @@ ;; definition of type sound-rpc-get-irx-version (deftype sound-rpc-get-irx-version (sound-rpc-cmd) - ((major uint32 :offset-assert 4) - (minor uint32 :offset-assert 8) - (ee-addr pointer :offset-assert 12) + ((major uint32) + (minor uint32) + (ee-addr pointer) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type sound-rpc-get-irx-version -(defmethod inspect sound-rpc-get-irx-version ((this sound-rpc-get-irx-version)) +(defmethod inspect ((this sound-rpc-get-irx-version)) (when (not this) (set! this this) (goto cfg-4) @@ -524,15 +455,12 @@ ;; definition of type sound-rpc-set-language (deftype sound-rpc-set-language (sound-rpc-cmd) - ((lang uint32 :offset-assert 4) + ((lang uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type sound-rpc-set-language -(defmethod inspect sound-rpc-set-language ((this sound-rpc-set-language)) +(defmethod inspect ((this sound-rpc-set-language)) (when (not this) (set! this this) (goto cfg-4) @@ -547,15 +475,12 @@ ;; definition of type sound-rpc-set-stereo-mode (deftype sound-rpc-set-stereo-mode (sound-rpc-cmd) - ((mode int32 :offset-assert 4) + ((mode int32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type sound-rpc-set-stereo-mode -(defmethod inspect sound-rpc-set-stereo-mode ((this sound-rpc-set-stereo-mode)) +(defmethod inspect ((this sound-rpc-set-stereo-mode)) (when (not this) (set! this this) (goto cfg-4) @@ -570,18 +495,15 @@ ;; definition of type sound-rpc-set-reverb (deftype sound-rpc-set-reverb (sound-rpc-cmd) - ((core uint8 :offset-assert 4) - (reverb int32 :offset-assert 8) - (left uint32 :offset-assert 12) - (right uint32 :offset-assert 16) + ((core uint8) + (reverb int32) + (left uint32) + (right uint32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type sound-rpc-set-reverb -(defmethod inspect sound-rpc-set-reverb ((this sound-rpc-set-reverb)) +(defmethod inspect ((this sound-rpc-set-reverb)) (when (not this) (set! this this) (goto cfg-4) @@ -599,18 +521,15 @@ ;; definition of type sound-rpc-set-ear-trans (deftype sound-rpc-set-ear-trans (sound-rpc-cmd) - ((ear-trans1 int32 3 :offset-assert 4) - (ear-trans0 int32 3 :offset-assert 16) - (cam-trans int32 3 :offset-assert 28) - (cam-angle int32 :offset-assert 40) + ((ear-trans1 int32 3) + (ear-trans0 int32 3) + (cam-trans int32 3) + (cam-angle int32) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type sound-rpc-set-ear-trans -(defmethod inspect sound-rpc-set-ear-trans ((this sound-rpc-set-ear-trans)) +(defmethod inspect ((this sound-rpc-set-ear-trans)) (when (not this) (set! this this) (goto cfg-4) @@ -628,16 +547,13 @@ ;; definition of type sound-rpc-set-flava (deftype sound-rpc-set-flava (sound-rpc-cmd) - ((flava uint8 :offset-assert 4) - (excitement uint8 :offset-assert 5) + ((flava uint8) + (excitement uint8) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) ;; definition for method 3 of type sound-rpc-set-flava -(defmethod inspect sound-rpc-set-flava ((this sound-rpc-set-flava)) +(defmethod inspect ((this sound-rpc-set-flava)) (when (not this) (set! this this) (goto cfg-4) @@ -653,16 +569,13 @@ ;; definition of type sound-rpc-set-midi-reg (deftype sound-rpc-set-midi-reg (sound-rpc-cmd) - ((reg int32 :offset-assert 4) - (value int16 :offset-assert 8) + ((reg int32) + (value int16) ) - :method-count-assert 9 - :size-assert #xa - :flag-assert #x90000000a ) ;; definition for method 3 of type sound-rpc-set-midi-reg -(defmethod inspect sound-rpc-set-midi-reg ((this sound-rpc-set-midi-reg)) +(defmethod inspect ((this sound-rpc-set-midi-reg)) (when (not this) (set! this this) (goto cfg-4) @@ -679,13 +592,10 @@ ;; definition of type sound-rpc-shutdown (deftype sound-rpc-shutdown (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type sound-rpc-shutdown -(defmethod inspect sound-rpc-shutdown ((this sound-rpc-shutdown)) +(defmethod inspect ((this sound-rpc-shutdown)) (when (not this) (set! this this) (goto cfg-4) @@ -699,15 +609,12 @@ ;; definition of type sound-rpc-set-fps (deftype sound-rpc-set-fps (sound-rpc-cmd) - ((fps uint8 :offset-assert 4) + ((fps uint8) ) - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type sound-rpc-set-fps -(defmethod inspect sound-rpc-set-fps ((this sound-rpc-set-fps)) +(defmethod inspect ((this sound-rpc-set-fps)) (when (not this) (set! this this) (goto cfg-4) @@ -723,13 +630,10 @@ ;; definition of type sound-rpc-list-sounds (deftype sound-rpc-list-sounds (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type sound-rpc-list-sounds -(defmethod inspect sound-rpc-list-sounds ((this sound-rpc-list-sounds)) +(defmethod inspect ((this sound-rpc-list-sounds)) (when (not this) (set! this this) (goto cfg-4) @@ -744,13 +648,10 @@ ;; definition of type sound-rpc-unload-music (deftype sound-rpc-unload-music (sound-rpc-cmd) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type sound-rpc-unload-music -(defmethod inspect sound-rpc-unload-music ((this sound-rpc-unload-music)) +(defmethod inspect ((this sound-rpc-unload-music)) (when (not this) (set! this this) (goto cfg-4) @@ -764,36 +665,33 @@ ;; definition of type sound-rpc-union (deftype sound-rpc-union (structure) - ((data uint32 20 :offset-assert 0) - (load-bank sound-rpc-load-bank :offset 0) - (unload-bank sound-rpc-unload-bank :offset 0) - (play sound-rpc-play :offset 0) - (pause-sound sound-rpc-pause-sound :offset 0) - (stop-sound sound-rpc-stop-sound :offset 0) - (continue-sound sound-rpc-continue-sound :offset 0) - (set-param sound-rpc-set-param :offset 0) - (set-master-volume sound-rpc-set-master-volume :offset 0) - (pause-group sound-rpc-pause-group :offset 0) - (stop-group sound-rpc-stop-group :offset 0) - (continue-group sound-rpc-continue-group :offset 0) - (get-irx-version sound-rpc-get-irx-version :offset 0) - (set-language sound-rpc-set-language :offset 0) - (set-reverb sound-rpc-set-reverb :offset 0) - (set-ear-trans sound-rpc-set-ear-trans :offset 0) - (set-flava sound-rpc-set-flava :offset 0) - (set-midi-reg sound-rpc-set-midi-reg :offset 0) - (set-fps sound-rpc-set-fps :offset 0) - (shutdown sound-rpc-shutdown :offset 0) - (list-sounds sound-rpc-list-sounds :offset 0) - (unload-music sound-rpc-unload-music :offset 0) + ((data uint32 20) + (load-bank sound-rpc-load-bank :overlay-at (-> data 0)) + (unload-bank sound-rpc-unload-bank :overlay-at (-> data 0)) + (play sound-rpc-play :overlay-at (-> data 0)) + (pause-sound sound-rpc-pause-sound :overlay-at (-> data 0)) + (stop-sound sound-rpc-stop-sound :overlay-at (-> data 0)) + (continue-sound sound-rpc-continue-sound :overlay-at (-> data 0)) + (set-param sound-rpc-set-param :overlay-at (-> data 0)) + (set-master-volume sound-rpc-set-master-volume :overlay-at (-> data 0)) + (pause-group sound-rpc-pause-group :overlay-at (-> data 0)) + (stop-group sound-rpc-stop-group :overlay-at (-> data 0)) + (continue-group sound-rpc-continue-group :overlay-at (-> data 0)) + (get-irx-version sound-rpc-get-irx-version :overlay-at (-> data 0)) + (set-language sound-rpc-set-language :overlay-at (-> data 0)) + (set-reverb sound-rpc-set-reverb :overlay-at (-> data 0)) + (set-ear-trans sound-rpc-set-ear-trans :overlay-at (-> data 0)) + (set-flava sound-rpc-set-flava :overlay-at (-> data 0)) + (set-midi-reg sound-rpc-set-midi-reg :overlay-at (-> data 0)) + (set-fps sound-rpc-set-fps :overlay-at (-> data 0)) + (shutdown sound-rpc-shutdown :overlay-at (-> data 0)) + (list-sounds sound-rpc-list-sounds :overlay-at (-> data 0)) + (unload-music sound-rpc-unload-music :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type sound-rpc-union -(defmethod inspect sound-rpc-union ((this sound-rpc-union)) +(defmethod inspect ((this sound-rpc-union)) (when (not this) (set! this this) (goto cfg-4) @@ -827,32 +725,29 @@ ;; definition of type sound-spec (deftype sound-spec (basic) - ((mask sound-mask :offset-assert 4) - (num float :offset-assert 8) - (group sound-group :offset-assert 12) - (reg uint8 3 :offset-assert 13) - (group-and-regs uint32 :offset 12) - (sound-name-char uint8 16 :offset-assert 16) - (sound-name sound-name :offset 16) - (trans int32 4 :offset-assert 32) - (volume int32 :offset-assert 48) - (pitch-mod int32 :offset-assert 52) - (bend int32 :offset-assert 56) - (fo-min int16 :offset-assert 60) - (fo-max int16 :offset-assert 62) - (fo-curve int8 :offset-assert 64) - (priority int8 :offset-assert 65) - (auto-time int32 :offset-assert 68) - (auto-from int32 :offset-assert 72) + ((mask sound-mask) + (num float) + (group sound-group) + (reg uint8 3) + (group-and-regs uint32 :overlay-at group) + (sound-name-char uint8 16) + (sound-name sound-name :overlay-at (-> sound-name-char 0)) + (trans int32 4) + (volume int32) + (pitch-mod int32) + (bend int32) + (fo-min int16) + (fo-max int16) + (fo-curve int8) + (priority int8) + (auto-time int32) + (auto-from int32) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) ;; definition for method 3 of type sound-spec ;; INFO: Used lq/sq -(defmethod inspect sound-spec ((this sound-spec)) +(defmethod inspect ((this sound-spec)) (when (not this) (set! this this) (goto cfg-4) @@ -883,41 +778,38 @@ ;; definition of type ambient-sound (deftype ambient-sound (basic) - ((spec sound-spec :offset-assert 4) - (playing-id sound-id :offset-assert 8) - (trans vector :inline :offset-assert 16) - (name sound-name :offset-assert 32) - (play-time time-frame :offset-assert 48) - (time-base time-frame :offset-assert 56) - (time-random time-frame :offset-assert 64) - (volume int32 :offset-assert 72) - (pitch int32 :offset-assert 76) - (falloff-near int32 :offset-assert 80) - (falloff-far int32 :offset-assert 84) - (falloff-mode int32 :offset-assert 88) - (params (pointer float) :offset-assert 92) - (param-count int32 :offset-assert 96) - (entity entity :offset-assert 100) - (sound-count int32 :offset-assert 104) + ((spec sound-spec) + (playing-id sound-id) + (trans vector :inline) + (name sound-name) + (play-time time-frame) + (time-base time-frame) + (time-random time-frame) + (volume int32) + (pitch int32) + (falloff-near int32) + (falloff-far int32) + (falloff-mode int32) + (params (pointer float)) + (param-count int32) + (entity entity) + (sound-count int32) ) - :method-count-assert 16 - :size-assert #x6c - :flag-assert #x100000006c (:methods - (new (symbol type basic vector) _type_ 0) - (update! (_type_) int 9) - (change-sound! (_type_ sound-name) int 10) - (update-trans! (_type_ vector) int 11) - (update-vol! (_type_ float) int 12) - (update-pitch-mod! (_type_ float) none 13) - (set-falloff-far! (_type_ float) none 14) - (stop! (_type_) int 15) + (new (symbol type basic vector) _type_) + (update! (_type_) int) + (change-sound! (_type_ sound-name) int) + (update-trans! (_type_ vector) int) + (update-vol! (_type_ float) int) + (update-pitch-mod! (_type_ float) none) + (set-falloff-far! (_type_ float) none) + (stop! (_type_) int) ) ) ;; definition for method 3 of type ambient-sound ;; INFO: Used lq/sq -(defmethod inspect ambient-sound ((this ambient-sound)) +(defmethod inspect ((this ambient-sound)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc index 9157fdbb779..45b5b8cf24f 100644 --- a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc @@ -4,13 +4,10 @@ ;; definition of type engine-sound-pers (deftype engine-sound-pers (engine-pers) () - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 ) ;; definition for method 3 of type engine-sound-pers -(defmethod inspect engine-sound-pers ((this engine-sound-pers)) +(defmethod inspect ((this engine-sound-pers)) (when (not this) (set! this this) (goto cfg-4) @@ -30,7 +27,7 @@ ;; definition for method 10 of type engine-sound-pers ;; WARN: Return type mismatch int vs none. -(defmethod kill-callback engine-sound-pers ((this engine-sound-pers) (arg0 connection-pers)) +(defmethod kill-callback ((this engine-sound-pers) (arg0 connection-pers)) (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-param)) (set! (-> v1-0 id) (the-as sound-id (-> arg0 param-int64 0))) @@ -72,37 +69,34 @@ ;; definition of type sound-iop-info (deftype sound-iop-info (structure) - ((frame uint32 :offset-assert 0) - (strpos int32 :offset-assert 4) - (str-id uint32 :offset-assert 8) - (str-id-sign int32 :offset 8) - (freemem uint32 :offset-assert 12) - (chinfo uint8 48 :offset-assert 16) - (freemem2 uint32 :offset-assert 64) - (nocd uint32 :offset-assert 68) - (dirtycd uint32 :offset-assert 72) - (diskspeed uint32 2 :offset-assert 76) - (lastspeed uint32 :offset-assert 84) - (dupseg int32 :offset-assert 88) - (times int32 41 :offset-assert 92) - (times-seq uint32 :offset-assert 256) - (iop-ticks uint32 :offset-assert 260) - (stream-position uint32 4 :offset 272) - (stream-status stream-status 4 :offset-assert 288) - (stream-name sound-stream-name 4 :inline :offset-assert 304) - (stream-id sound-id 4 :offset-assert 496) - (stream-id-int32 int32 4 :offset 496) - (music-register uint8 17 :offset-assert 512) - (music-excite int8 :offset 528) - (ramdisk-name uint8 48 :offset-assert 529) + ((frame uint32) + (strpos int32) + (str-id uint32) + (str-id-sign int32 :overlay-at str-id) + (freemem uint32) + (chinfo uint8 48) + (freemem2 uint32) + (nocd uint32) + (dirtycd uint32) + (diskspeed uint32 2) + (lastspeed uint32) + (dupseg int32) + (times int32 41) + (times-seq uint32) + (iop-ticks uint32) + (stream-position uint32 4 :offset 272) + (stream-status stream-status 4) + (stream-name sound-stream-name 4 :inline) + (stream-id sound-id 4) + (stream-id-int32 int32 4 :overlay-at (-> stream-id 0)) + (music-register uint8 17) + (music-excite int8 :overlay-at (-> music-register 16)) + (ramdisk-name uint8 48) ) - :method-count-assert 9 - :size-assert #x241 - :flag-assert #x900000241 ) ;; definition for method 3 of type sound-iop-info -(defmethod inspect sound-iop-info ((this sound-iop-info)) +(defmethod inspect ((this sound-iop-info)) (when (not this) (set! this this) (goto cfg-16) @@ -959,7 +953,7 @@ otherwise, an explicit [[vector]] can be provided" ;; definition for method 9 of type ambient-sound ;; INFO: Used lq/sq -(defmethod update! ambient-sound ((this ambient-sound)) +(defmethod update! ((this ambient-sound)) (with-pp (if (not *ambient-sound-class*) (return (the-as int #f)) @@ -1048,14 +1042,14 @@ otherwise, an explicit [[vector]] can be provided" ) ;; definition for method 15 of type ambient-sound -(defmethod stop! ambient-sound ((this ambient-sound)) +(defmethod stop! ((this ambient-sound)) (sound-stop (-> this playing-id)) 0 ) ;; definition for method 11 of type ambient-sound ;; INFO: Used lq/sq -(defmethod update-trans! ambient-sound ((this ambient-sound) (arg0 vector)) +(defmethod update-trans! ((this ambient-sound) (arg0 vector)) (with-pp (set! (-> this trans quad) (-> arg0 quad)) (when (nonzero? (-> this playing-id)) @@ -1082,7 +1076,7 @@ otherwise, an explicit [[vector]] can be provided" ) ;; definition for method 12 of type ambient-sound -(defmethod update-vol! ambient-sound ((this ambient-sound) (arg0 float)) +(defmethod update-vol! ((this ambient-sound) (arg0 float)) (when (nonzero? (-> this playing-id)) (when *sound-player-enable* (let ((v1-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -1100,7 +1094,7 @@ otherwise, an explicit [[vector]] can be provided" ;; definition for method 13 of type ambient-sound ;; WARN: Return type mismatch int vs none. -(defmethod update-pitch-mod! ambient-sound ((this ambient-sound) (arg0 float)) +(defmethod update-pitch-mod! ((this ambient-sound) (arg0 float)) (when (nonzero? (-> this playing-id)) (when *sound-player-enable* (let ((v1-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -1119,7 +1113,7 @@ otherwise, an explicit [[vector]] can be provided" ;; definition for method 14 of type ambient-sound ;; WARN: Return type mismatch int vs none. -(defmethod set-falloff-far! ambient-sound ((this ambient-sound) (arg0 float)) +(defmethod set-falloff-far! ((this ambient-sound) (arg0 float)) (set! (-> this falloff-far) (the int (* 0.00024414062 arg0))) 0 (none) @@ -1127,7 +1121,7 @@ otherwise, an explicit [[vector]] can be provided" ;; definition for method 10 of type ambient-sound ;; INFO: Used lq/sq -(defmethod change-sound! ambient-sound ((this ambient-sound) (arg0 sound-name)) +(defmethod change-sound! ((this ambient-sound) (arg0 sound-name)) (when (not (and (= (the-as uint (-> this name)) (the-as uint arg0)) (= (-> arg0 hi) (-> this name hi)))) (stop! this) (set! (-> this playing-id) (new-sound-id)) diff --git a/test/decompiler/reference/jak2/engine/sound/speech-h_REF.gc b/test/decompiler/reference/jak2/engine/sound/speech-h_REF.gc index 749db969907..4cad337150e 100644 --- a/test/decompiler/reference/jak2/engine/sound/speech-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/speech-h_REF.gc @@ -3,23 +3,20 @@ ;; definition of type speech-type-info (deftype speech-type-info (structure) - ((channel uint8 :offset-assert 0) - (flags speech-type-flag :offset-assert 1) - (priority int8 :offset-assert 2) - (request-timeout uint16 :offset-assert 4) - (min-delay uint16 :offset-assert 6) - (max-delay uint16 :offset-assert 8) - (delay uint16 :offset-assert 10) - (play-index int16 :offset-assert 12) - (list (array string) :offset-assert 16) + ((channel uint8) + (flags speech-type-flag) + (priority int8) + (request-timeout uint16) + (min-delay uint16) + (max-delay uint16) + (delay uint16) + (play-index int16) + (list (array string)) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type speech-type-info -(defmethod inspect speech-type-info ((this speech-type-info)) +(defmethod inspect ((this speech-type-info)) (when (not this) (set! this this) (goto cfg-6) @@ -46,19 +43,16 @@ ;; definition of type speech-request (deftype speech-request (structure) - ((handle handle :offset-assert 0) - (time time-frame :offset-assert 8) - (priority float :offset-assert 16) - (speech-type speech-type :offset-assert 20) + ((handle handle) + (time time-frame) + (priority float) + (speech-type speech-type) ) :pack-me - :method-count-assert 9 - :size-assert #x15 - :flag-assert #x900000015 ) ;; definition for method 3 of type speech-request -(defmethod inspect speech-request ((this speech-request)) +(defmethod inspect ((this speech-request)) (when (not this) (set! this this) (goto cfg-4) @@ -74,32 +68,29 @@ ;; definition of type speech-channel (deftype speech-channel (structure) - ((flags speech-channel-flag :offset-assert 0) - (gui-channel gui-channel :offset-assert 1) - (delay uint16 :offset-assert 2) - (id sound-id :offset-assert 4) - (update-time time-frame :offset-assert 8) - (start-time time-frame :offset-assert 16) - (end-time time-frame :offset-assert 24) - (request speech-request :inline :offset-assert 32) - (last-request speech-request :inline :offset-assert 56) - (target-pos vector :inline :offset-assert 80) - (speech-table (pointer speech-type-info) :offset-assert 96) + ((flags speech-channel-flag) + (gui-channel gui-channel) + (delay uint16) + (id sound-id) + (update-time time-frame) + (start-time time-frame) + (end-time time-frame) + (request speech-request :inline) + (last-request speech-request :inline) + (target-pos vector :inline) + (speech-table (pointer speech-type-info)) ) - :method-count-assert 14 - :size-assert #x64 - :flag-assert #xe00000064 (:methods - (speech-channel-method-9 (_type_ process-drawable speech-type) none 9) - (speech-channel-method-10 (_type_ handle) none 10) - (speech-channel-method-11 (_type_) none 11) - (speech-channel-method-12 (_type_) none 12) - (speech-channel-method-13 (_type_) none 13) + (speech-channel-method-9 (_type_ process-drawable speech-type) none) + (speech-channel-method-10 (_type_ handle) none) + (speech-channel-method-11 (_type_) none) + (speech-channel-method-12 (_type_) none) + (speech-channel-method-13 (_type_) none) ) ) ;; definition for method 3 of type speech-channel -(defmethod inspect speech-channel ((this speech-channel)) +(defmethod inspect ((this speech-channel)) (when (not this) (set! this this) (goto cfg-6) @@ -128,26 +119,23 @@ ;; definition of type speech-control (deftype speech-control (structure) - ((channel-array speech-channel 2 :inline :offset-assert 0) - (speech-table speech-type-info 57 :offset-assert 224) + ((channel-array speech-channel 2 :inline) + (speech-table speech-type-info 57) ) - :method-count-assert 17 - :size-assert #x1c4 - :flag-assert #x11000001c4 (:methods - (speech-control-method-9 (_type_) none 9) - (speech-table-set! (_type_ speech-type speech-type-info) none 10) - (speech-control-method-11 (_type_) none 11) - (speech-control-method-12 (_type_ process-drawable speech-type) none 12) - (speech-control-method-13 (_type_ handle) none 13) - (speech-control-method-14 (_type_) none 14) - (speech-control-method-15 (_type_ process-drawable) none 15) - (speech-control-method-16 (_type_) none 16) + (speech-control-method-9 (_type_) none) + (speech-table-set! (_type_ speech-type speech-type-info) none) + (speech-control-method-11 (_type_) none) + (speech-control-method-12 (_type_ process-drawable speech-type) none) + (speech-control-method-13 (_type_ handle) none) + (speech-control-method-14 (_type_) none) + (speech-control-method-15 (_type_ process-drawable) none) + (speech-control-method-16 (_type_) none) ) ) ;; definition for method 3 of type speech-control -(defmethod inspect speech-control ((this speech-control)) +(defmethod inspect ((this speech-control)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/sound/speech_REF.gc b/test/decompiler/reference/jak2/engine/sound/speech_REF.gc index 3f3f7bf2499..c896f6f5f76 100644 --- a/test/decompiler/reference/jak2/engine/sound/speech_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/speech_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 12 of type speech-channel ;; WARN: Return type mismatch int vs none. -(defmethod speech-channel-method-12 speech-channel ((this speech-channel)) +(defmethod speech-channel-method-12 ((this speech-channel)) (set! (-> this request handle) (the-as handle #f)) (set! (-> this request priority) -10000000000000000000000000000000000000.0) 0 @@ -12,7 +12,7 @@ ;; definition for method 13 of type speech-channel ;; WARN: Return type mismatch int vs none. -(defmethod speech-channel-method-13 speech-channel ((this speech-channel)) +(defmethod speech-channel-method-13 ((this speech-channel)) (set! (-> this id) (new 'static 'sound-id)) (set! (-> this last-request handle) (the-as handle #f)) (set! (-> this last-request priority) -10000000000000000000000000000000000000.0) @@ -23,7 +23,7 @@ ;; definition for method 11 of type speech-channel ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod speech-channel-method-11 speech-channel ((this speech-channel)) +(defmethod speech-channel-method-11 ((this speech-channel)) (local-vars (v1-44 int)) (with-pp (logclear! (-> this flags) (speech-channel-flag disable)) @@ -182,7 +182,7 @@ ;; definition for method 9 of type speech-channel ;; WARN: Return type mismatch int vs none. -(defmethod speech-channel-method-9 speech-channel ((this speech-channel) (arg0 process-drawable) (arg1 speech-type)) +(defmethod speech-channel-method-9 ((this speech-channel) (arg0 process-drawable) (arg1 speech-type)) (let ((f0-0 (vector-vector-distance-squared (-> arg0 root trans) (-> this target-pos))) (f1-0 245760.0) ) @@ -206,7 +206,7 @@ ;; definition for method 10 of type speech-channel ;; WARN: Return type mismatch int vs none. -(defmethod speech-channel-method-10 speech-channel ((this speech-channel) (arg0 handle)) +(defmethod speech-channel-method-10 ((this speech-channel) (arg0 handle)) (when (= arg0 (handle->process (-> this last-request handle))) (set-action! *gui-control* @@ -227,7 +227,7 @@ ;; definition for method 12 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-12 speech-control ((this speech-control) (arg0 process-drawable) (arg1 speech-type)) +(defmethod speech-control-method-12 ((this speech-control) (arg0 process-drawable) (arg1 speech-type)) (let ((v1-2 (-> this speech-table arg1))) (when v1-2 (let ((a0-1 (-> this channel-array (-> v1-2 channel)))) @@ -243,7 +243,7 @@ ;; definition for method 11 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-11 speech-control ((this speech-control)) +(defmethod speech-control-method-11 ((this speech-control)) (dotimes (s5-0 2) (speech-channel-method-11 (-> this channel-array s5-0)) ) @@ -253,7 +253,7 @@ ;; definition for method 10 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-table-set! speech-control ((this speech-control) (arg0 speech-type) (arg1 speech-type-info)) +(defmethod speech-table-set! ((this speech-control) (arg0 speech-type) (arg1 speech-type-info)) (set! (-> this speech-table arg0) arg1) 0 (none) @@ -261,7 +261,7 @@ ;; definition for method 13 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-13 speech-control ((this speech-control) (arg0 handle)) +(defmethod speech-control-method-13 ((this speech-control) (arg0 handle)) (dotimes (s4-0 2) (speech-channel-method-10 (-> this channel-array s4-0) arg0) ) @@ -271,7 +271,7 @@ ;; definition for method 14 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-14 speech-control ((this speech-control)) +(defmethod speech-control-method-14 ((this speech-control)) (speech-control-method-9 this) (let ((s5-0 (-> this channel-array))) ((method-of-type speech-channel speech-channel-method-13) (the-as speech-channel s5-0)) @@ -289,7 +289,7 @@ ;; definition for method 15 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-15 speech-control ((this speech-control) (arg0 process-drawable)) +(defmethod speech-control-method-15 ((this speech-control) (arg0 process-drawable)) (when (not (logtest? (-> this channel-array 0 flags) (speech-channel-flag disable))) (let ((v1-3 *target*)) (when v1-3 @@ -313,7 +313,7 @@ ;; definition for method 16 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-16 speech-control ((this speech-control)) +(defmethod speech-control-method-16 ((this speech-control)) (set-action! *gui-control* (gui-action stop) @@ -343,7 +343,7 @@ ;; definition for method 9 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-9 speech-control ((this speech-control)) +(defmethod speech-control-method-9 ((this speech-control)) (dotimes (v1-0 57) (set! (-> this speech-table v1-0) #f) ) diff --git a/test/decompiler/reference/jak2/engine/spatial-hash/actor-hash_REF.gc b/test/decompiler/reference/jak2/engine/spatial-hash/actor-hash_REF.gc index 21f3a2c3574..bd535f26ca3 100644 --- a/test/decompiler/reference/jak2/engine/spatial-hash/actor-hash_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial-hash/actor-hash_REF.gc @@ -12,15 +12,12 @@ ;; definition of type actor-cshape-ptr (deftype actor-cshape-ptr (structure) - ((cshape collide-shape :offset-assert 0) + ((cshape collide-shape) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type actor-cshape-ptr -(defmethod inspect actor-cshape-ptr ((this actor-cshape-ptr)) +(defmethod inspect ((this actor-cshape-ptr)) (when (not this) (set! this this) (goto cfg-4) @@ -33,21 +30,18 @@ ;; definition of type actor-hash-bucket (deftype actor-hash-bucket (structure) - ((length int16 :offset-assert 0) - (max-length int16 :offset-assert 2) - (data (inline-array actor-cshape-ptr) :offset-assert 4) + ((length int16) + (max-length int16) + (data (inline-array actor-cshape-ptr)) ) :allow-misaligned - :method-count-assert 10 - :size-assert #x8 - :flag-assert #xa00000008 (:methods - (add-actor-cshape (_type_ collide-shape) none 9) + (add-actor-cshape (_type_ collide-shape) none) ) ) ;; definition for method 3 of type actor-hash-bucket -(defmethod inspect actor-hash-bucket ((this actor-hash-bucket)) +(defmethod inspect ((this actor-hash-bucket)) (when (not this) (set! this this) (goto cfg-4) @@ -62,7 +56,7 @@ ;; definition for method 9 of type actor-hash-bucket ;; WARN: Return type mismatch int vs none. -(defmethod add-actor-cshape actor-hash-bucket ((this actor-hash-bucket) (arg0 collide-shape)) +(defmethod add-actor-cshape ((this actor-hash-bucket) (arg0 collide-shape)) (let ((v1-0 (-> this length))) (when (< v1-0 (-> this max-length)) (set! (-> this data v1-0 cshape) arg0) @@ -75,21 +69,18 @@ ;; definition of type actor-hash-buckets (deftype actor-hash-buckets (structure) - ((hash spatial-hash :offset-assert 0) - (list engine :offset-assert 4) - (data actor-hash-bucket 4 :inline :offset-assert 8) - (tpos vector :inline :offset-assert 80) + ((hash spatial-hash) + (list engine) + (data actor-hash-bucket 4 :inline) + (tpos vector :inline) ) - :method-count-assert 10 - :size-assert #x60 - :flag-assert #xa00000060 (:methods - (hash-actors (_type_) none 9) + (hash-actors (_type_) none) ) ) ;; definition for method 3 of type actor-hash-buckets -(defmethod inspect actor-hash-buckets ((this actor-hash-buckets)) +(defmethod inspect ((this actor-hash-buckets)) (when (not this) (set! this this) (goto cfg-4) @@ -106,7 +97,7 @@ ;; definition for method 9 of type actor-hash-buckets ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hash-actors actor-hash-buckets ((this actor-hash-buckets)) +(defmethod hash-actors ((this actor-hash-buckets)) (local-vars (sv-16 hash-object-info) (sv-32 collide-prim-core) (sv-48 collide-shape) (sv-64 hash-object-info)) (set! (-> this hash) *actor-hash*) (set! (-> this list) *collide-hit-by-others-list*) diff --git a/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash-h_REF.gc b/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash-h_REF.gc index c449dbd8010..807b7c91632 100644 --- a/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash-h_REF.gc @@ -18,18 +18,15 @@ ;; definition of type collide-hash-scratch (deftype collide-hash-scratch (structure) - ((collidable-bits uint128 128 :offset-assert 0) - (poly-bits uint64 2 :offset 0) - (id-bits uint32 512 :offset 0) - (tris uint32 :offset-assert 2048) + ((collidable-bits uint128 128) + (poly-bits uint64 2 :overlay-at (-> collidable-bits 0)) + (id-bits uint32 512 :overlay-at (-> collidable-bits 0)) + (tris uint32) ) - :method-count-assert 9 - :size-assert #x804 - :flag-assert #x900000804 ) ;; definition for method 3 of type collide-hash-scratch -(defmethod inspect collide-hash-scratch ((this collide-hash-scratch)) +(defmethod inspect ((this collide-hash-scratch)) (when (not this) (set! this this) (goto cfg-4) @@ -45,16 +42,13 @@ ;; definition of type collide-hash-bucket (deftype collide-hash-bucket (structure) - ((index int16 :offset-assert 0) - (count int16 :offset-assert 2) + ((index int16) + (count int16) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type collide-hash-bucket -(defmethod inspect collide-hash-bucket ((this collide-hash-bucket)) +(defmethod inspect ((this collide-hash-bucket)) (when (not this) (set! this this) (goto cfg-4) @@ -68,17 +62,14 @@ ;; definition of type collide-hash-item (deftype collide-hash-item (structure) - ((id uint32 :offset-assert 0) - (collidable basic :offset-assert 4) + ((id uint32) + (collidable basic) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type collide-hash-item -(defmethod inspect collide-hash-item ((this collide-hash-item)) +(defmethod inspect ((this collide-hash-item)) (when (not this) (set! this this) (goto cfg-4) @@ -92,20 +83,17 @@ ;; definition of type collide-hash-poly (deftype collide-hash-poly (structure) - ((data uint8 4 :offset-assert 0) - (vert-index0 uint8 :offset 0) - (vert-index1 uint8 :offset 1) - (vert-index2 uint8 :offset 2) - (pat-index uint8 :offset 3) - (word uint32 :offset 0) + ((data uint8 4) + (vert-index0 uint8 :overlay-at (-> data 0)) + (vert-index1 uint8 :overlay-at (-> data 1)) + (vert-index2 uint8 :overlay-at (-> data 2)) + (pat-index uint8 :overlay-at (-> data 3)) + (word uint32 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type collide-hash-poly -(defmethod inspect collide-hash-poly ((this collide-hash-poly)) +(defmethod inspect ((this collide-hash-poly)) (when (not this) (set! this this) (goto cfg-4) @@ -123,18 +111,15 @@ ;; definition of type collide-hash-fragment-stats (deftype collide-hash-fragment-stats (structure) - ((num-verts uint16 :offset-assert 0) - (num-polys uint8 :offset-assert 2) - (poly-count uint8 :offset-assert 3) + ((num-verts uint16) + (num-polys uint8) + (poly-count uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type collide-hash-fragment-stats -(defmethod inspect collide-hash-fragment-stats ((this collide-hash-fragment-stats)) +(defmethod inspect ((this collide-hash-fragment-stats)) (when (not this) (set! this this) (goto cfg-4) @@ -149,31 +134,28 @@ ;; definition of type collide-hash-fragment (deftype collide-hash-fragment (drawable) - ((num-buckets uint16 :offset 4) - (num-indices uint16 :offset 6) - (pat-array uint32 :offset 8) - (bucket-array uint32 :offset 12) - (grid-step vector :inline :offset-assert 32) - (bbox bounding-box :inline :offset-assert 48) - (bbox4w bounding-box4w :inline :offset-assert 80) - (axis-scale vector :inline :offset 64) - (avg-extents vector :inline :offset 80) - (dimension-array uint32 4 :offset 44) - (stats collide-hash-fragment-stats :inline :offset 60) - (num-verts uint16 :offset 60) - (num-polys uint8 :offset 62) - (poly-count uint8 :offset 63) - (poly-array uint32 :offset 76) - (vert-array uint32 :offset 92) - (index-array uint32 :offset 108) + ((num-buckets uint16 :overlay-at id) + (num-indices uint16 :offset 6) + (pat-array uint32 :offset 8) + (bucket-array uint32 :offset 12) + (grid-step vector :inline) + (bbox bounding-box :inline) + (bbox4w bounding-box4w :inline) + (axis-scale vector :inline :overlay-at (-> bbox max)) + (avg-extents vector :inline :overlay-at (-> bbox4w min data 0)) + (dimension-array uint32 4 :overlay-at (-> grid-step data 3)) + (stats collide-hash-fragment-stats :inline :overlay-at (-> bbox min data 3)) + (num-verts uint16 :overlay-at (-> bbox min data 3)) + (num-polys uint8 :offset 62) + (poly-count uint8 :offset 63) + (poly-array uint32 :overlay-at (-> bbox max data 3)) + (vert-array uint32 :overlay-at (-> bbox4w min data 3)) + (index-array uint32 :overlay-at (-> bbox4w max data 3)) ) - :method-count-assert 17 - :size-assert #x70 - :flag-assert #x1100000070 ) ;; definition for method 3 of type collide-hash-fragment -(defmethod inspect collide-hash-fragment ((this collide-hash-fragment)) +(defmethod inspect ((this collide-hash-fragment)) (when (not this) (set! this this) (goto cfg-4) @@ -204,15 +186,12 @@ ;; definition of type collide-hash-fragment-array (deftype collide-hash-fragment-array (array) - ((fragments collide-hash-fragment :dynamic :offset 16) + ((fragments collide-hash-fragment :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type collide-hash-fragment-array -(defmethod inspect collide-hash-fragment-array ((this collide-hash-fragment-array)) +(defmethod inspect ((this collide-hash-fragment-array)) (when (not this) (set! this this) (goto cfg-4) @@ -228,27 +207,24 @@ ;; definition of type collide-hash (deftype collide-hash (drawable) - ((num-ids uint16 :offset 4) - (id-count uint16 :offset 6) - (num-buckets uint32 :offset 8) - (qwc-id-bits uint32 :offset 12) - (grid-step vector :inline :offset 16) - (bbox bounding-box :inline :offset-assert 32) - (bbox4w bounding-box4w :inline :offset-assert 64) - (axis-scale vector :inline :offset 48) - (avg-extents vector :inline :offset 64) - (bucket-array uint32 :offset 44) - (item-array (inline-array collide-hash-item) :offset 60) - (dimension-array uint32 3 :offset 76) - (num-items uint32 :offset 92) + ((num-ids uint16 :overlay-at id) + (id-count uint16 :offset 6) + (num-buckets uint32 :offset 8) + (qwc-id-bits uint32 :offset 12) + (grid-step vector :inline :overlay-at bsphere) + (bbox bounding-box :inline) + (bbox4w bounding-box4w :inline) + (axis-scale vector :inline :overlay-at (-> bbox max)) + (avg-extents vector :inline :overlay-at (-> bbox4w min data 0)) + (bucket-array uint32 :overlay-at (-> bbox min data 3)) + (item-array (inline-array collide-hash-item) :overlay-at (-> bbox max data 3)) + (dimension-array uint32 3 :overlay-at (-> bbox4w min data 3)) + (num-items uint32 :overlay-at (-> bbox4w max data 3)) ) - :method-count-assert 17 - :size-assert #x60 - :flag-assert #x1100000060 ) ;; definition for method 3 of type collide-hash -(defmethod inspect collide-hash ((this collide-hash)) +(defmethod inspect ((this collide-hash)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash_REF.gc b/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash_REF.gc index 7eb7386987a..a8cad4d1497 100644 --- a/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash_REF.gc @@ -614,7 +614,7 @@ ;; definition for method 8 of type collide-hash ;; INFO: Used lq/sq -(defmethod mem-usage collide-hash ((this collide-hash) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-hash) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 51 (-> arg0 length))) (set! (-> arg0 data 50 name) (symbol->string 'collision)) (+! (-> arg0 data 50 count) 1) @@ -641,7 +641,7 @@ ) ;; definition for method 8 of type collide-hash-fragment -(defmethod mem-usage collide-hash-fragment ((this collide-hash-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-hash-fragment) (arg0 memory-usage-block) (arg1 int)) (cond ((logtest? arg1 1) (set! (-> arg0 length) (max 58 (-> arg0 length))) @@ -688,7 +688,7 @@ ) ;; definition for method 8 of type collide-hash-fragment-array -(defmethod mem-usage collide-hash-fragment-array ((this collide-hash-fragment-array) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this collide-hash-fragment-array) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 55 (-> arg0 length))) (set! (-> arg0 data 54 name) (symbol->string 'prototype-collision)) (+! (-> arg0 data 54 count) 1) diff --git a/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash-h_REF.gc b/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash-h_REF.gc index ec49d3a33c3..967e09fa6e0 100644 --- a/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash-h_REF.gc @@ -4,24 +4,18 @@ ;; definition of type grid-hash-word (deftype grid-hash-word (uint8) () - :method-count-assert 9 - :size-assert #x1 - :flag-assert #x900000001 ) ;; definition of type grid-hash-box (deftype grid-hash-box (structure) - ((min int8 3 :offset-assert 0) - (max int8 3 :offset-assert 3) + ((min int8 3) + (max int8 3) ) :pack-me - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) ;; definition for method 3 of type grid-hash-box -(defmethod inspect grid-hash-box ((this grid-hash-box)) +(defmethod inspect ((this grid-hash-box)) (when (not this) (set! this this) (goto cfg-4) @@ -35,50 +29,47 @@ ;; definition of type grid-hash (deftype grid-hash (basic) - ((work grid-hash-work :offset-assert 4) - (search-box grid-hash-box :inline :offset-assert 8) - (bucket-size int16 :offset-assert 14) - (axis-scale float 3 :offset-assert 16) - (dimension-array int8 3 :offset-assert 28) - (vertical-cell-count int8 :offset-assert 31) - (bucket-array (pointer grid-hash-word) :offset-assert 32) - (box-min float 3 :offset-assert 36) - (box-max float 3 :offset-assert 48) - (object-count int16 :offset-assert 60) - (bucket-count int16 :offset-assert 62) - (min-cell-size float :offset-assert 64) - (bucket-memory-size int32 :offset-assert 68) - (mem-bucket-array (pointer grid-hash-word) :offset-assert 72) - (spr-bucket-array (pointer grid-hash-word) :offset-assert 76) - (debug-draw symbol :offset-assert 80) - (use-scratch-ram symbol :offset-assert 84) + ((work grid-hash-work) + (search-box grid-hash-box :inline) + (bucket-size int16) + (axis-scale float 3) + (dimension-array int8 3) + (vertical-cell-count int8) + (bucket-array (pointer grid-hash-word)) + (box-min float 3) + (box-max float 3) + (object-count int16) + (bucket-count int16) + (min-cell-size float) + (bucket-memory-size int32) + (mem-bucket-array (pointer grid-hash-word)) + (spr-bucket-array (pointer grid-hash-word)) + (debug-draw symbol) + (use-scratch-ram symbol) ) - :method-count-assert 25 - :size-assert #x58 - :flag-assert #x1900000058 (:methods - (new (symbol type int) _type_ 0) - (update-grid-for-objects-in-box (_type_ int vector vector) none 9) - (clear-bucket-array (_type_) none 10) - (setup-search-box (_type_ int vector vector vector) none 11) - (search-for-point (_type_ vector) (pointer uint8) 12) - (search-for-sphere (_type_ vector float) (pointer uint8) 13) - (draw (_type_ rgba) none 14) - (dump-grid-info (_type_) none 15) - (verify-bits-in-bucket (_type_ grid-hash-box grid-hash-box) none 16) - (box-of-everything (_type_ object grid-hash-box) none 17) - (grid-hash-method-18 (_type_ grid-hash-box int) none 18) - (grid-hash-method-19 (_type_ grid-hash-box int) none 19) - (do-search! (_type_ grid-hash-box (pointer uint8)) none 20) - (set-up-box (_type_ grid-hash-box vector vector) none 21) - (sphere-to-grid-box (_type_ grid-hash-box sphere) none 22) - (line-sphere-to-grid-box (_type_ grid-hash-box vector vector float) none 23) - (update-grid (_type_) none 24) + (new (symbol type int) _type_) + (update-grid-for-objects-in-box (_type_ int vector vector) none) + (clear-bucket-array (_type_) none) + (setup-search-box (_type_ int vector vector vector) none) + (search-for-point (_type_ vector) (pointer uint8)) + (search-for-sphere (_type_ vector float) (pointer uint8)) + (draw (_type_ rgba) none) + (dump-grid-info (_type_) none) + (verify-bits-in-bucket (_type_ grid-hash-box grid-hash-box) none) + (box-of-everything (_type_ object grid-hash-box) none) + (grid-hash-method-18 (_type_ grid-hash-box int) none) + (grid-hash-method-19 (_type_ grid-hash-box int) none) + (do-search! (_type_ grid-hash-box (pointer uint8)) none) + (set-up-box (_type_ grid-hash-box vector vector) none) + (sphere-to-grid-box (_type_ grid-hash-box sphere) none) + (line-sphere-to-grid-box (_type_ grid-hash-box vector vector float) none) + (update-grid (_type_) none) ) ) ;; definition for method 3 of type grid-hash -(defmethod inspect grid-hash ((this grid-hash)) +(defmethod inspect ((this grid-hash)) (when (not this) (set! this this) (goto cfg-4) @@ -107,20 +98,17 @@ ;; definition of type find-nav-sphere-ids-params (deftype find-nav-sphere-ids-params (structure) - ((bsphere sphere :inline :offset-assert 0) - (y-threshold float :offset-assert 16) - (len int16 :offset-assert 20) - (max-len int16 :offset-assert 22) - (mask uint8 :offset-assert 24) - (array (pointer uint8) :offset-assert 28) + ((bsphere sphere :inline) + (y-threshold float) + (len int16) + (max-len int16) + (mask uint8) + (array (pointer uint8)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type find-nav-sphere-ids-params -(defmethod inspect find-nav-sphere-ids-params ((this find-nav-sphere-ids-params)) +(defmethod inspect ((this find-nav-sphere-ids-params)) (when (not this) (set! this this) (goto cfg-4) @@ -138,31 +126,28 @@ ;; definition of type sphere-hash (deftype sphere-hash (grid-hash) - ((sphere-array (inline-array sphere) :offset-assert 88) - (max-object-count int16 :offset-assert 92) - (pad int16 :offset-assert 94) - (mem-sphere-array uint32 :offset-assert 96) - (spr-sphere-array uint32 :offset-assert 100) + ((sphere-array (inline-array sphere)) + (max-object-count int16) + (pad int16) + (mem-sphere-array uint32) + (spr-sphere-array uint32) ) - :method-count-assert 34 - :size-assert #x68 - :flag-assert #x2200000068 (:methods - (new (symbol type int int) _type_ 0) - (clear-objects! (_type_) none 25) - (add-a-sphere (_type_ vector) int 26) - (add-a-sphere-with-flag (_type_ vector int) int 27) - (update-from-spheres (_type_) none 28) - (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none 29) - (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none 30) - (add-sphere-with-mask-and-id (_type_ vector int int) symbol 31) - (sphere-hash-method-32 (_type_ vector vector float int) symbol 32) - (remove-by-id (_type_ sphere int) none 33) + (new (symbol type int int) _type_) + (clear-objects! (_type_) none) + (add-a-sphere (_type_ vector) int) + (add-a-sphere-with-flag (_type_ vector int) int) + (update-from-spheres (_type_) none) + (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none) + (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none) + (add-sphere-with-mask-and-id (_type_ vector int int) symbol) + (sphere-hash-method-32 (_type_ vector vector float int) symbol) + (remove-by-id (_type_ sphere int) none) ) ) ;; definition for method 3 of type sphere-hash -(defmethod inspect sphere-hash ((this sphere-hash)) +(defmethod inspect ((this sphere-hash)) (when (not this) (set! this this) (goto cfg-4) @@ -196,15 +181,12 @@ ;; definition of type hash-object-info (deftype hash-object-info (structure) - ((object basic :offset-assert 0) + ((object basic) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type hash-object-info -(defmethod inspect hash-object-info ((this hash-object-info)) +(defmethod inspect ((this hash-object-info)) (when (not this) (set! this this) (goto cfg-4) @@ -217,27 +199,24 @@ ;; definition of type spatial-hash (deftype spatial-hash (sphere-hash) - ((object-array (inline-array hash-object-info) :offset-assert 104) - (mem-object-array (inline-array hash-object-info) :offset-assert 108) - (spr-object-array (inline-array hash-object-info) :offset-assert 112) + ((object-array (inline-array hash-object-info)) + (mem-object-array (inline-array hash-object-info)) + (spr-object-array (inline-array hash-object-info)) ) - :method-count-assert 41 - :size-assert #x74 - :flag-assert #x2900000074 (:methods - (new (symbol type int int) _type_ 0) - (add-an-object (_type_ vector hash-object-info) int 34) - (fill-actor-list-for-box (_type_ bounding-box (pointer collide-shape) int) int 35) - (fill-actor-list-for-sphere (_type_ sphere (pointer collide-shape) int) int 36) - (fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int 37) - (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int 38) - (spatial-hash-method-39 (_type_ object hash-object-info) int 39) - (validate-objects (_type_) none 40) + (new (symbol type int int) _type_) + (add-an-object (_type_ vector hash-object-info) int) + (fill-actor-list-for-box (_type_ bounding-box (pointer collide-shape) int) int) + (fill-actor-list-for-sphere (_type_ sphere (pointer collide-shape) int) int) + (fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int) + (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int) + (spatial-hash-method-39 (_type_ object hash-object-info) int) + (validate-objects (_type_) none) ) ) ;; definition for method 3 of type spatial-hash -(defmethod inspect spatial-hash ((this spatial-hash)) +(defmethod inspect ((this spatial-hash)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash_REF.gc b/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash_REF.gc index 4e276f2979e..49533997d88 100644 --- a/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash_REF.gc @@ -3,25 +3,22 @@ ;; definition of type grid-hash-work (deftype grid-hash-work (basic) - ((result-words uint8 32 :offset 16) - (result-bits uint8 32 :offset 16) - (object-id int32 :offset-assert 48) - (temp-box-min vector :inline :offset-assert 64) - (temp-box-max vector :inline :offset-assert 80) - (visit-count int32 :offset-assert 96) - (temp-time uint32 :offset-assert 100) - (queue-object-time uint32 :offset-assert 104) - (make-hash-time uint32 :offset-assert 108) - (search-time uint32 :offset-assert 112) - (add-object-time uint32 :offset-assert 116) + ((result-words uint8 32 :offset 16) + (result-bits uint8 32 :overlay-at (-> result-words 0)) + (object-id int32) + (temp-box-min vector :inline) + (temp-box-max vector :inline) + (visit-count int32) + (temp-time uint32) + (queue-object-time uint32) + (make-hash-time uint32) + (search-time uint32) + (add-object-time uint32) ) - :method-count-assert 9 - :size-assert #x78 - :flag-assert #x900000078 ) ;; definition for method 3 of type grid-hash-work -(defmethod inspect grid-hash-work ((this grid-hash-work)) +(defmethod inspect ((this grid-hash-work)) (when (not this) (set! this this) (goto cfg-4) @@ -72,7 +69,7 @@ ;; definition for method 16 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod verify-bits-in-bucket grid-hash ((this grid-hash) (arg0 grid-hash-box) (arg1 grid-hash-box)) +(defmethod verify-bits-in-bucket ((this grid-hash) (arg0 grid-hash-box) (arg1 grid-hash-box)) (let ((s5-0 0)) 0 (let ((v1-1 8) @@ -102,7 +99,7 @@ ;; definition for method 17 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod box-of-everything grid-hash ((this grid-hash) (arg0 object) (arg1 grid-hash-box)) +(defmethod box-of-everything ((this grid-hash) (arg0 object) (arg1 grid-hash-box)) (dotimes (v1-0 3) (set! (-> arg1 min v1-0) (-> this dimension-array v1-0)) (set! (-> arg1 max v1-0) -1) @@ -186,7 +183,7 @@ ;; definition for method 21 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod set-up-box grid-hash ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector)) +(defmethod set-up-box ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector)) (dotimes (v1-0 3) (set! (-> arg0 min v1-0) (the int @@ -219,7 +216,7 @@ ;; definition for method 23 of type grid-hash ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod line-sphere-to-grid-box grid-hash ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod line-sphere-to-grid-box ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector) (arg3 float)) (let ((s4-0 (new 'stack-no-clear 'grid-hash-box)) (s5-0 (new 'stack-no-clear 'grid-hash-box)) ) @@ -247,7 +244,7 @@ ;; definition for method 10 of type grid-hash ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod clear-bucket-array grid-hash ((this grid-hash)) +(defmethod clear-bucket-array ((this grid-hash)) (let ((v1-5 (/ (+ (* (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (-> this dimension-array 2)) (-> this bucket-size) ) @@ -271,7 +268,7 @@ ;; definition for method 24 of type grid-hash ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-grid grid-hash ((this grid-hash)) +(defmethod update-grid ((this grid-hash)) (let ((v1-0 (new 'stack-no-clear 'vector))) (dotimes (a1-0 3) (set! (-> v1-0 data a1-0) (fmax (-> this min-cell-size) (- (-> this box-max a1-0) (-> this box-min a1-0)))) @@ -401,7 +398,7 @@ ;; definition for method 9 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod update-grid-for-objects-in-box grid-hash ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector)) +(defmethod update-grid-for-objects-in-box ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector)) (set! (-> this object-count) arg0) (dotimes (v1-0 3) (set! (-> this box-min v1-0) (-> arg1 data v1-0)) @@ -414,7 +411,7 @@ ;; definition for method 11 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod setup-search-box grid-hash ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod setup-search-box ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((v1-0 (new 'stack-no-clear 'vector)) (t1-0 (new 'stack-no-clear 'vector)) ) @@ -502,7 +499,7 @@ ) ;; definition for method 12 of type grid-hash -(defmethod search-for-point grid-hash ((this grid-hash) (arg0 vector)) +(defmethod search-for-point ((this grid-hash) (arg0 vector)) (let ((v1-0 this) (a0-1 (-> this search-box)) (a2-0 arg0) @@ -537,7 +534,7 @@ ;; definition for method 13 of type grid-hash ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. ;; INFO: Used lq/sq -(defmethod search-for-sphere grid-hash ((this grid-hash) (arg0 vector) (arg1 float)) +(defmethod search-for-sphere ((this grid-hash) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'sphere))) (set! (-> v1-0 quad) (-> arg0 quad)) (set! (-> v1-0 r) arg1) @@ -617,7 +614,7 @@ ;; definition for method 14 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod draw grid-hash ((this grid-hash) (arg0 rgba)) +(defmethod draw ((this grid-hash) (arg0 rgba)) "Draws the grid-hash" (let ((v1-0 (new 'stack-no-clear 'vector)) (t0-0 (new 'stack-no-clear 'vector)) @@ -634,7 +631,7 @@ ;; definition for method 15 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod dump-grid-info grid-hash ((this grid-hash)) +(defmethod dump-grid-info ((this grid-hash)) "Prints out info about the grid-hash, also draws via [[grid-hash::draw-grid]] if `debug-draw` is `#t`" (if (-> this debug-draw) (draw this *color-light-blue*) @@ -719,7 +716,7 @@ ;; definition for method 25 of type sphere-hash ;; WARN: Return type mismatch int vs none. -(defmethod clear-objects! sphere-hash ((this sphere-hash)) +(defmethod clear-objects! ((this sphere-hash)) (set! (-> this object-count) 0) (dotimes (v1-0 3) (set! (-> this box-min v1-0) 10000000000000000000000000000000000000.0) @@ -744,7 +741,7 @@ (defmethod-mips2c "(method 28 sphere-hash)" 28 sphere-hash) ;; definition for method 26 of type sphere-hash -(defmethod add-a-sphere sphere-hash ((this sphere-hash) (arg0 vector)) +(defmethod add-a-sphere ((this sphere-hash) (arg0 vector)) (let ((gp-0 (-> this object-count))) (cond ((< gp-0 (-> this max-object-count)) @@ -766,7 +763,7 @@ ) ;; definition for method 27 of type sphere-hash -(defmethod add-a-sphere-with-flag sphere-hash ((this sphere-hash) (arg0 vector) (arg1 int)) +(defmethod add-a-sphere-with-flag ((this sphere-hash) (arg0 vector) (arg1 int)) (let ((gp-0 (-> this object-count))) (cond ((< gp-0 (-> this max-object-count)) @@ -811,7 +808,7 @@ ;; definition for method 15 of type sphere-hash ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod dump-grid-info sphere-hash ((this sphere-hash)) +(defmethod dump-grid-info ((this sphere-hash)) "Prints out info about the grid-hash, also draws via [[grid-hash::draw-grid]] if `debug-draw` is `#t`" (call-parent-method this) (new 'stack-no-clear 'vector) @@ -867,7 +864,7 @@ ;; definition for method 25 of type spatial-hash ;; WARN: Return type mismatch int vs none. -(defmethod clear-objects! spatial-hash ((this spatial-hash)) +(defmethod clear-objects! ((this spatial-hash)) (set! (-> this object-count) 0) (dotimes (v1-0 3) (set! (-> this box-min v1-0) 10000000000000000000000000000000000000.0) @@ -894,7 +891,7 @@ (defmethod-mips2c "(method 33 spatial-hash)" 33 spatial-hash) ;; definition for method 34 of type spatial-hash -(defmethod add-an-object spatial-hash ((this spatial-hash) (arg0 vector) (arg1 hash-object-info)) +(defmethod add-an-object ((this spatial-hash) (arg0 vector) (arg1 hash-object-info)) (let ((gp-0 (-> this object-count))) (cond ((< gp-0 (-> this max-object-count)) @@ -936,7 +933,7 @@ ;; definition for method 38 of type spatial-hash ;; INFO: Used lq/sq -(defmethod fill-actor-list-for-vec+r spatial-hash ((this spatial-hash) (arg0 vector) (arg1 (pointer collide-shape)) (arg2 int)) +(defmethod fill-actor-list-for-vec+r ((this spatial-hash) (arg0 vector) (arg1 (pointer collide-shape)) (arg2 int)) (let ((v1-0 (new 'stack-no-clear 'sphere))) (set! (-> v1-0 quad) (-> arg0 quad)) (set! (-> v1-0 r) 0.0) @@ -946,7 +943,7 @@ ;; definition for method 40 of type spatial-hash ;; WARN: Return type mismatch int vs none. -(defmethod validate-objects spatial-hash ((this spatial-hash)) +(defmethod validate-objects ((this spatial-hash)) (dotimes (s5-0 (-> this object-count)) (let ((a0-2 (-> this object-array s5-0 object))) (when (not (valid? a0-2 basic "" #t 0)) diff --git a/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc index 74d200d3e84..3f333bc14cb 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc @@ -3,23 +3,19 @@ ;; definition of type board (deftype board (process-drawable) - ((control control-info :offset 128) - (shadow-backup shadow-geo :offset 208) - (main joint-mod :offset 212) + ((control control-info :overlay-at root) + (shadow-backup shadow-geo :offset 208) + (main joint-mod :offset 212) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xd8 - :flag-assert #x17006000d8 - (:methods - (idle (symbol) _type_ :state 20) - (use () _type_ :state 21) - (hidden () _type_ :state 22) + (:state-methods + (idle symbol) + use + hidden ) ) ;; definition for method 3 of type board -(defmethod inspect board ((this board)) +(defmethod inspect ((this board)) (when (not this) (set! this this) (goto cfg-4) @@ -37,165 +33,162 @@ ;; definition of type board-info (deftype board-info (basic) - ((board (pointer board) :offset-assert 4) - (camera-interp float :offset-assert 8) - (process (pointer target) :offset-assert 12) - (board-trans vector :inline :offset-assert 16) - (board-quat vector :inline :offset-assert 32) - (board-scale vector :inline :offset-assert 48) - (main joint-mod :offset-assert 64) - (upper-body joint-mod :offset-assert 68) - (sound-bank-knob float :offset-assert 72) - (sound-air-knob float :offset-assert 76) - (wind-sound-id sound-id :offset-assert 80) - (wind-sound-pitch float :offset-assert 84) - (wind-sound-volume float :offset-assert 88) - (engine-sound-id sound-id :offset-assert 92) - (engine-sound-pitch float :offset-assert 96) - (engine-sound-volume float :offset-assert 100) - (bank-sound-id sound-id :offset-assert 104) - (bank-sound-pitch float :offset-assert 108) - (bank-sound-volume float :offset-assert 112) - (ride-sound-id sound-id :offset-assert 116) - (spin-sound-id sound-id :offset-assert 120) - (spin-sound-volume float :offset-assert 124) - (spin-sound-pitch float :offset-assert 128) - (unknown-sound-id00 sound-id :offset-assert 132) - (unknown-sound-id01 sound-id :offset-assert 136) - (unknown-sound-id02 sound-id :offset-assert 140) - (up-vector vector 2 :inline :offset-assert 144) - (slow-transv vector :inline :offset-assert 176) - (board-time time-frame :offset-assert 192) - (board-get-on-time time-frame :offset-assert 200) - (in-air-time time-frame :offset-assert 208) - (unknown-time-frame00 time-frame :offset-assert 216) - (unknown-time-frame01 time-frame :offset 224) - (unknown-time-frame02 time-frame :offset 232) - (stick-lock symbol :offset 240) - (stick-off symbol :offset-assert 244) - (stance-info ground-tween-info :inline :offset-assert 248) - (mods-backup basic :offset-assert 284) - (attack-id uint32 :offset-assert 288) - (latch? symbol :offset-assert 292) - (unknown-vector00 vector :inline :offset 304) - (unknown-vector01 vector :inline :offset 320) - (unknown-int00 uint32 :offset 336) - (unknown-symbol00 symbol :offset 340) - (unstuck-time time-frame :offset 344) - (stuck-count int32 :offset-assert 352) - (thrust-scale float :offset-assert 356) - (flip-time time-frame :offset-assert 360) - (transv-max meters :offset-assert 368) - (turn-anim-tilt? symbol :offset-assert 372) - (turn-anim-mag float :offset-assert 376) - (turn-anim-targ float :offset-assert 380) - (turn-anim-frame float :offset-assert 384) - (turn-anim-vel float :offset-assert 388) - (turn-anim-duck float :offset-assert 392) - (turn-anim-duck-vel float :offset-assert 396) - (tilt-anim-frame vector :inline :offset-assert 400) - (tilt-anim-target vector :inline :offset-assert 416) - (smack-surface-time time-frame :offset-assert 432) - (smack-speed meters :offset-assert 440) - (smack-normal vector :inline :offset-assert 448) - (glance-time time-frame :offset-assert 464) - (glance-speed meters :offset-assert 472) - (glance-in-transv vector :inline :offset-assert 480) - (glance-out-transv vector :inline :offset-assert 496) - (glance-normal vector :inline :offset-assert 512) - (on-flat-time time-frame :offset-assert 528) - (jump-land-time time-frame :offset-assert 536) - (slip-factor float :offset-assert 544) - (ground-on-dir vector :inline :offset-assert 560) - (ride-time time-frame :offset-assert 576) - (ride-start-time time-frame :offset-assert 584) - (ride-button-time time-frame :offset-assert 592) - (ride-lean-targ float :offset-assert 600) - (ride-lean float :offset-assert 604) - (ride-leanv float :offset-assert 608) - (ride-lean-mag float :offset-assert 612) - (ride-tilt-targ float :offset-assert 616) - (ride-tilt float :offset-assert 620) - (ride-tiltv float :offset-assert 624) - (ride-tilt-mag float :offset-assert 628) - (ride-lock symbol :offset-assert 632) - (ride-lock-on symbol :offset-assert 636) - (ride-speed meters :offset-assert 640) - (ride-mode uint32 :offset-assert 644) - (ride-rot degrees :offset-assert 648) - (ride-rot-old degrees :offset-assert 652) - (ride-rot-abs degrees 2 :offset-assert 656) - (ride-rtv-abs degrees :offset-assert 664) - (ride-touch-segment vector 2 :inline :offset-assert 672) - (ride-dir vector :inline :offset-assert 704) - (ride-vertex-length int16 :offset-assert 720) - (ride-vertex-length-old int16 :offset-assert 722) - (ride-vertex-base int16 :offset-assert 724) - (ride-vertex-base2 int16 :offset-assert 726) - (ride-vertex-index float :offset-assert 728) - (ride-vertex-index2 float :offset-assert 732) - (ride-vertex-index-old float :offset-assert 736) - (ride-vertex vector 3 :inline :offset-assert 752) - (ride-segment vector :inline :offset-assert 800) - (ride-dir-lean vector :inline :offset-assert 816) - (ride-pad-vector vector 1 :inline :offset-assert 832) - (ride-vertex-old vector 3 :inline :offset-assert 848) - (ride-segment-old vector :inline :offset-assert 896) - (ride-vertex-trail vector 128 :inline :offset-assert 912) - (halfpipe-side-time time-frame :offset-assert 2960) - (halfpipe-jump-time time-frame :offset-assert 2968) - (halfpipe-lip-time time-frame :offset-assert 2976) - (halfpipe-time time-frame :offset-assert 2984) - (halfpipe-gspot-time time-frame :offset-assert 2992) - (halfpipe-lip-event symbol :offset-assert 3000) - (spin-check-time time-frame :offset-assert 3008) - (spin-time time-frame :offset-assert 3016) - (spin-start-time time-frame :offset-assert 3024) - (spin-start-dir vector :inline :offset-assert 3040) - (spin-control float :offset-assert 3056) - (spin-ground-start-time time-frame :offset-assert 3064) - (spin-ground-time time-frame :offset-assert 3072) - (spin-ground-press-time time-frame :offset-assert 3080) - (flip-control float :offset-assert 3088) - (flip-count int32 :offset-assert 3092) - (unknown-time-frame03 time-frame :offset 3104) - (unknown-time-frame04 time-frame :offset 3112) - (unknown-time-frame05 time-frame :offset 3120) - (unknown-time-frame06 time-frame :offset 3128) - (unknown-float00 float :offset 3136) - (unknown-float01 float :offset 3140) - (trickx-count int32 :offset 3144) - (trotyv-max degrees :offset-assert 3148) - (trotyv degrees :offset-assert 3152) - (troty degrees :offset-assert 3156) - (troty-cum degrees :offset-assert 3160) - (unknown-deg00 degrees :offset 3164) - (upper-body-rotyv-max degrees :offset 3168) - (upper-body-rotyv degrees :offset-assert 3172) - (upper-body-roty degrees :offset-assert 3176) - (cushion-base meters :offset-assert 3180) - (cushion-offset meters :offset-assert 3184) - (shock-offset meters :offset-assert 3188) - (shock-offsetv meters :offset-assert 3192) - (shock-rotx meters :offset-assert 3196) - (part-control sparticle-launch-control :offset-assert 3200) - (trick-count int32 :offset-assert 3204) - (trick-array board-tricks 16 :offset-assert 3208) - (trick-points-array float 16 :offset 3272) - (trick-list board-tricks 16 :offset 3336) - (pad uint8 :offset 3399) + ((board (pointer board)) + (camera-interp float) + (process (pointer target)) + (board-trans vector :inline) + (board-quat vector :inline) + (board-scale vector :inline) + (main joint-mod) + (upper-body joint-mod) + (sound-bank-knob float) + (sound-air-knob float) + (wind-sound-id sound-id) + (wind-sound-pitch float) + (wind-sound-volume float) + (engine-sound-id sound-id) + (engine-sound-pitch float) + (engine-sound-volume float) + (bank-sound-id sound-id) + (bank-sound-pitch float) + (bank-sound-volume float) + (ride-sound-id sound-id) + (spin-sound-id sound-id) + (spin-sound-volume float) + (spin-sound-pitch float) + (unknown-sound-id00 sound-id) + (unknown-sound-id01 sound-id) + (unknown-sound-id02 sound-id) + (up-vector vector 2 :inline) + (slow-transv vector :inline) + (board-time time-frame) + (board-get-on-time time-frame) + (in-air-time time-frame) + (unknown-time-frame00 time-frame) + (unknown-time-frame01 time-frame :offset 224) + (unknown-time-frame02 time-frame :offset 232) + (stick-lock symbol :offset 240) + (stick-off symbol) + (stance-info ground-tween-info :inline) + (mods-backup basic) + (attack-id uint32) + (latch? symbol) + (unknown-vector00 vector :inline :offset 304) + (unknown-vector01 vector :inline :offset 320) + (unknown-int00 uint32 :offset 336) + (unknown-symbol00 symbol :offset 340) + (unstuck-time time-frame :offset 344) + (stuck-count int32) + (thrust-scale float) + (flip-time time-frame) + (transv-max meters) + (turn-anim-tilt? symbol) + (turn-anim-mag float) + (turn-anim-targ float) + (turn-anim-frame float) + (turn-anim-vel float) + (turn-anim-duck float) + (turn-anim-duck-vel float) + (tilt-anim-frame vector :inline) + (tilt-anim-target vector :inline) + (smack-surface-time time-frame) + (smack-speed meters) + (smack-normal vector :inline) + (glance-time time-frame) + (glance-speed meters) + (glance-in-transv vector :inline) + (glance-out-transv vector :inline) + (glance-normal vector :inline) + (on-flat-time time-frame) + (jump-land-time time-frame) + (slip-factor float) + (ground-on-dir vector :inline) + (ride-time time-frame) + (ride-start-time time-frame) + (ride-button-time time-frame) + (ride-lean-targ float) + (ride-lean float) + (ride-leanv float) + (ride-lean-mag float) + (ride-tilt-targ float) + (ride-tilt float) + (ride-tiltv float) + (ride-tilt-mag float) + (ride-lock symbol) + (ride-lock-on symbol) + (ride-speed meters) + (ride-mode uint32) + (ride-rot degrees) + (ride-rot-old degrees) + (ride-rot-abs degrees 2) + (ride-rtv-abs degrees) + (ride-touch-segment vector 2 :inline) + (ride-dir vector :inline) + (ride-vertex-length int16) + (ride-vertex-length-old int16) + (ride-vertex-base int16) + (ride-vertex-base2 int16) + (ride-vertex-index float) + (ride-vertex-index2 float) + (ride-vertex-index-old float) + (ride-vertex vector 3 :inline) + (ride-segment vector :inline) + (ride-dir-lean vector :inline) + (ride-pad-vector vector 1 :inline) + (ride-vertex-old vector 3 :inline) + (ride-segment-old vector :inline) + (ride-vertex-trail vector 128 :inline) + (halfpipe-side-time time-frame) + (halfpipe-jump-time time-frame) + (halfpipe-lip-time time-frame) + (halfpipe-time time-frame) + (halfpipe-gspot-time time-frame) + (halfpipe-lip-event symbol) + (spin-check-time time-frame) + (spin-time time-frame) + (spin-start-time time-frame) + (spin-start-dir vector :inline) + (spin-control float) + (spin-ground-start-time time-frame) + (spin-ground-time time-frame) + (spin-ground-press-time time-frame) + (flip-control float) + (flip-count int32) + (unknown-time-frame03 time-frame :offset 3104) + (unknown-time-frame04 time-frame :offset 3112) + (unknown-time-frame05 time-frame :offset 3120) + (unknown-time-frame06 time-frame :offset 3128) + (unknown-float00 float :offset 3136) + (unknown-float01 float :offset 3140) + (trickx-count int32 :offset 3144) + (trotyv-max degrees) + (trotyv degrees) + (troty degrees) + (troty-cum degrees) + (unknown-deg00 degrees :offset 3164) + (upper-body-rotyv-max degrees :offset 3168) + (upper-body-rotyv degrees) + (upper-body-roty degrees) + (cushion-base meters) + (cushion-offset meters) + (shock-offset meters) + (shock-offsetv meters) + (shock-rotx meters) + (part-control sparticle-launch-control) + (trick-count int32) + (trick-array board-tricks 16) + (trick-points-array float 16 :offset 3272) + (trick-list board-tricks 16 :offset 3336) + (pad uint8 :offset 3399) ) - :method-count-assert 11 - :size-assert #xd48 - :flag-assert #xb00000d48 (:methods - (add-to-trick-list (_type_ board-tricks float) none 9) - (flush-trick-list (_type_) none 10) + (add-to-trick-list (_type_ board-tricks float) none) + (flush-trick-list (_type_) none) ) ) ;; definition for method 3 of type board-info -(defmethod inspect board-info ((this board-info)) +(defmethod inspect ((this board-info)) (when (not this) (set! this this) (goto cfg-19) @@ -347,25 +340,22 @@ ;; definition of type target-board-bank (deftype target-board-bank (basic) - ((jump-height-min meters :offset-assert 4) - (jump-height-max meters :offset-assert 8) - (duck-jump-height-min meters :offset-assert 12) - (duck-jump-height-max meters :offset-assert 16) - (turn-frames float :offset-assert 20) - (wall-kick-window seconds :offset-assert 24) - (cushion meters :offset-assert 32) - (trickx-jump-height-min meters :offset-assert 36) - (trickx-jump-height-max meters :offset-assert 40) - (tricky-jump-height-min meters :offset-assert 44) - (tricky-jump-height-max meters :offset-assert 48) + ((jump-height-min meters) + (jump-height-max meters) + (duck-jump-height-min meters) + (duck-jump-height-max meters) + (turn-frames float) + (wall-kick-window seconds) + (cushion meters) + (trickx-jump-height-min meters) + (trickx-jump-height-max meters) + (tricky-jump-height-min meters) + (tricky-jump-height-max meters) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type target-board-bank -(defmethod inspect target-board-bank ((this target-board-bank)) +(defmethod inspect ((this target-board-bank)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc index e2119833557..053fdc3ec1d 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 7 of type board ;; WARN: Return type mismatch process-drawable vs board. -(defmethod relocate board ((this board) (arg0 int)) +(defmethod relocate ((this board) (arg0 int)) (if (nonzero? (-> this main)) (&+! (-> this main) arg0) ) diff --git a/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc index 3a18298d35c..3f33ba8c026 100644 --- a/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc @@ -2799,7 +2799,7 @@ ;; definition for method 9 of type board-info ;; WARN: Return type mismatch int vs none. -(defmethod add-to-trick-list board-info ((this board-info) (arg0 board-tricks) (arg1 float)) +(defmethod add-to-trick-list ((this board-info) (arg0 board-tricks) (arg1 float)) "Add specified trick and point amount to trick list." (send-event (handle->process (-> this process 0 notify)) 'notify 'trick-point arg0) (when (and (< (-> this trick-count) 16) @@ -2919,7 +2919,7 @@ ;; definition for method 10 of type board-info ;; WARN: Return type mismatch int vs none. -(defmethod flush-trick-list board-info ((this board-info)) +(defmethod flush-trick-list ((this board-info)) "Flush trick list and give out points." (let ((f30-0 0.0)) (dotimes (v1-0 (-> this trick-count)) diff --git a/test/decompiler/reference/jak2/engine/target/darkjak-h_REF.gc b/test/decompiler/reference/jak2/engine/target/darkjak-h_REF.gc index 73707072081..400281bc56a 100644 --- a/test/decompiler/reference/jak2/engine/target/darkjak-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/darkjak-h_REF.gc @@ -3,30 +3,27 @@ ;; definition of type darkjak-info (deftype darkjak-info (basic) - ((process (pointer target) :offset-assert 4) - (attack-id uint32 :offset-assert 8) - (start-time time-frame :offset-assert 16) - (attack-time time-frame :offset-assert 24) - (attack-count uint64 :offset-assert 32) - (stage darkjak-stage :offset-assert 40) - (want-stage darkjak-stage :offset-assert 44) - (clock-pos float :offset-assert 48) - (clock-vel float :offset-assert 52) - (clock-on symbol :offset-assert 56) - (hud handle 1 :offset 64) - (tone sound-id :offset 72) - (bomb uint32 :offset 76) + ((process (pointer target)) + (attack-id uint32) + (start-time time-frame) + (attack-time time-frame) + (attack-count uint64) + (stage darkjak-stage) + (want-stage darkjak-stage) + (clock-pos float) + (clock-vel float) + (clock-on symbol) + (hud handle 1 :offset 64) + (tone sound-id :offset 72) + (bomb uint32 :offset 76) ) - :method-count-assert 10 - :size-assert #x50 - :flag-assert #xa00000050 (:methods - (update-clock! (_type_ int) none :behavior target 9) + (update-clock! (_type_ int) none :behavior target) ) ) ;; definition for method 3 of type darkjak-info -(defmethod inspect darkjak-info ((this darkjak-info)) +(defmethod inspect ((this darkjak-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-blue-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-blue-shot_REF.gc index 9589e9794c9..32a1b0595e3 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-blue-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-blue-shot_REF.gc @@ -36,18 +36,14 @@ ;; definition of type gun-blue-shot (deftype gun-blue-shot (projectile) - ((init-pos vector :inline :offset-assert 480) - (init-dir vector :inline :offset-assert 496) - (collide-normal vector :inline :offset-assert 512) + ((init-pos vector :inline) + (init-dir vector :inline) + (collide-normal vector :inline) ) - :heap-base #x190 - :method-count-assert 40 - :size-assert #x210 - :flag-assert #x2801900210 ) ;; definition for method 3 of type gun-blue-shot -(defmethod inspect gun-blue-shot ((this gun-blue-shot)) +(defmethod inspect ((this gun-blue-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -65,7 +61,7 @@ ;; definition for method 24 of type gun-blue-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight gun-blue-shot ((this gun-blue-shot)) +(defmethod draw-laser-sight ((this gun-blue-shot)) "TODO - confirm If applicable, draw the laser sight particles" (let* ((s5-0 (ppointer->process (-> this parent))) (s4-0 (-> *part-id-table* 196)) @@ -116,7 +112,7 @@ ;; definition for method 26 of type gun-blue-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles gun-blue-shot ((this gun-blue-shot)) +(defmethod spawn-shell-particles ((this gun-blue-shot)) "TODO - confirm" (rlet ((vf0 :class vf) (vf4 :class vf) @@ -204,7 +200,7 @@ ;; definition for method 27 of type gun-blue-shot ;; WARN: Return type mismatch int vs none. -(defmethod unknown-particles gun-blue-shot ((this gun-blue-shot)) +(defmethod unknown-particles ((this gun-blue-shot)) "TODO - confirm" (draw-beam (-> *part-id-table* 191) (-> this init-pos) (-> this init-dir) #f #t) (draw-beam (-> *part-id-table* 194) (-> this init-pos) (-> this starting-dir) #f #t) @@ -214,7 +210,7 @@ ;; definition for method 28 of type gun-blue-shot ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound gun-blue-shot ((this gun-blue-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this gun-blue-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -229,7 +225,7 @@ ) ;; definition for method 38 of type gun-blue-shot -(defmethod made-impact? gun-blue-shot ((this gun-blue-shot)) +(defmethod made-impact? ((this gun-blue-shot)) "TODO - queries the collision cache, return true/false" (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) @@ -275,7 +271,7 @@ ;; definition for method 30 of type gun-blue-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! gun-blue-shot ((this gun-blue-shot)) +(defmethod init-proj-collision! ((this gun-blue-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -327,7 +323,7 @@ ;; definition for method 31 of type gun-blue-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-blue-shot ((this gun-blue-shot)) +(defmethod init-proj-settings! ((this gun-blue-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (with-pp (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc index 9423e2ec839..9f62be6dd02 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc @@ -84,31 +84,27 @@ ;; definition of type gun-dark-shot (deftype gun-dark-shot (projectile) - ((blast-radius float :offset-assert 472) - (core-position vector :inline :offset-assert 480) - (core-velocity vector :inline :offset-assert 496) - (spin-vector vector :inline :offset-assert 512) - (track-target handle :offset-assert 528) - (size-t float :offset-assert 536) - (result-array handle 16 :offset-assert 544) - (charge-sound sound-id :offset-assert 672) - (fire-sound sound-id :offset-assert 676) - (trail-sound sound-id :offset-assert 680) - (explode-sound sound-id :offset-assert 684) - (start-pilot? basic :offset-assert 688) + ((blast-radius float) + (core-position vector :inline) + (core-velocity vector :inline) + (spin-vector vector :inline) + (track-target handle) + (size-t float) + (result-array handle 16) + (charge-sound sound-id) + (fire-sound sound-id) + (trail-sound sound-id) + (explode-sound sound-id) + (start-pilot? basic) ) - :heap-base #x240 - :method-count-assert 42 - :size-assert #x2b4 - :flag-assert #x2a024002b4 - (:methods - (startup () _type_ :state 40) - (fizzle () _type_ :state 41) + (:state-methods + startup + fizzle ) ) ;; definition for method 3 of type gun-dark-shot -(defmethod inspect gun-dark-shot ((this gun-dark-shot)) +(defmethod inspect ((this gun-dark-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -165,7 +161,7 @@ ;; definition for method 31 of type gun-dark-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-dark-shot ((this gun-dark-shot)) +(defmethod init-proj-settings! ((this gun-dark-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this attack-mode) 'eco-dark) (vector-normalize! (-> this root transv) (+ 225280.0 (* 225280.0 (-> this charge-level)))) @@ -186,7 +182,7 @@ ) ;; definition for method 25 of type gun-dark-shot -(defmethod spawn-impact-particles gun-dark-shot ((this gun-dark-shot)) +(defmethod spawn-impact-particles ((this gun-dark-shot)) "Spawns associated particles with the projectile if applicable" (cond ((and (and (-> this next-state) (= (-> this next-state name) 'startup)) @@ -211,7 +207,7 @@ ;; definition for method 32 of type gun-dark-shot ;; WARN: Return type mismatch int vs none. -(defmethod go-moving! gun-dark-shot ((this gun-dark-shot)) +(defmethod go-moving! ((this gun-dark-shot)) (go (method-of-object this startup)) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc index 6d4cecaefee..8049cf324fe 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc @@ -3,28 +3,24 @@ ;; definition of type gun (deftype gun (process-drawable) - ((control control-info :offset 128) - (shadow-backup shadow-geo :offset 208) - (read-scale basic :offset-assert 212) - (gun-type pickup-type :offset-assert 216) - (barrel joint-mod :offset-assert 220) - (mag joint-mod 4 :offset-assert 224) - (mag-scale float 4 :offset-assert 240) + ((control control-info :overlay-at root) + (shadow-backup shadow-geo :offset 208) + (read-scale basic) + (gun-type pickup-type) + (barrel joint-mod) + (mag joint-mod 4) + (mag-scale float 4) ) - :heap-base #x80 - :method-count-assert 24 - :size-assert #x100 - :flag-assert #x1800800100 - (:methods - (idle () _type_ :state 20) - (use (symbol) _type_ :state 21) - (hidden () _type_ :state 22) - (die () _type_ :state 23) + (:state-methods + idle + (use symbol) + hidden + die ) ) ;; definition for method 3 of type gun -(defmethod inspect gun ((this gun)) +(defmethod inspect ((this gun)) (when (not this) (set! this this) (goto cfg-4) @@ -46,99 +42,96 @@ ;; definition of type gun-info (deftype gun-info (basic) - ((process (pointer target) :offset-assert 4) - (gun (pointer gun) :offset-assert 8) - (gun-pos transformq :inline :offset-assert 16) - (gun-trans vector :inline :offset 16) - (gun-quat quaternion :inline :offset 32) - (gun-scale vector :inline :offset 48) - (gun-type pickup-type :offset-assert 64) - (using-gun-type pickup-type :offset-assert 68) - (active? symbol :offset-assert 72) - (latch? symbol :offset-assert 76) - (put-away? symbol :offset-assert 80) - (surpress-time time-frame :offset-assert 88) - (fire-time time-frame :offset-assert 96) - (gun-time time-frame :offset-assert 104) - (gun-get-on-time time-frame :offset-assert 112) - (active-time time-frame :offset-assert 120) - (fire-delay uint32 :offset-assert 128) - (gun-control uint32 :offset-assert 132) - (gun-target uint32 :offset-assert 136) - (gun-daxter float :offset-assert 140) - (gun-roty-rel degrees :offset-assert 144) - (gun-roty degrees :offset-assert 148) - (gun-roty-targ degrees :offset-assert 152) - (hips joint-mod :offset-assert 156) - (upper-body joint-mod :offset-assert 160) - (chest joint-mod :offset-assert 164) - (fire-dir-rot degrees :offset-assert 168) - (fire-dir vector 2 :inline :offset-assert 176) - (fire-point vector :inline :offset-assert 208) - (fire-dir-backup vector :inline :offset-assert 224) - (fire-dir-out vector :inline :offset-assert 240) - (fire-pending int32 :offset-assert 256) - (fire-pending-time time-frame :offset-assert 264) - (fire-start-time time-frame :offset-assert 272) - (fire-charge float :offset-assert 280) - (fire-spin degrees :offset-assert 284) - (fire-spinv degrees :offset-assert 288) - (fire-chamber int32 :offset-assert 292) - (fire-range meters :offset-assert 296) - (laser-active? symbol :offset-assert 300) - (laser-point vector :inline :offset-assert 304) - (laser-dir vector 2 :inline :offset-assert 320) - (laser-hit-point vector :inline :offset-assert 352) - (track? gun-track-flags :offset-assert 368) - (track-tilt degrees :offset-assert 372) - (track-turn degrees :offset-assert 376) - (track-find-range meters :offset-assert 380) - (track-turnv-range meters :offset-assert 384) - (track-tilt-range meters :offset-assert 388) - (track-turn-range meters :offset-assert 392) - (track-tilt-max degrees :offset-assert 396) - (track-turn-max degrees :offset-assert 400) - (track-angle-mult float :offset-assert 404) - (track-beam-size float :offset-assert 408) - (track-auto-fire symbol :offset-assert 412) - (track-require uint32 :offset-assert 416) - (track-target-hold-time time-frame :offset-assert 424) - (track-start-time time-frame :offset-assert 432) - (track-press-start-time time-frame :offset-assert 440) - (track-target focus 2 :inline :offset-assert 448) - (track-trans vector :inline :offset-assert 480) - (track-dir vector :inline :offset-assert 496) - (turn-fast-hold-time time-frame :offset-assert 512) - (blue-whine-sound-id sound-id :offset-assert 520) - (blue-whine-volume float :offset-assert 524) - (top-anim-twist vector :inline :offset-assert 528) - (top-anim-twist-targ vector :inline :offset-assert 544) - (top-anim-look-at vector :inline :offset-assert 560) - (top-anim-twist-reset uint64 :offset-assert 576) - (top-anim-gun-height meters :offset-assert 584) - (top-anim-blue-cycle float :offset-assert 588) - (top-anim-low-high float :offset-assert 592) - (top-anim-extra-twistv degrees :offset-assert 596) - (top-anim-tilt-up degrees :offset-assert 600) - (attack-combo combo-tracker :inline :offset-assert 608) - (combo-window-start time-frame :offset-assert 656) - (combo-window-state symbol :offset-assert 664) - (combo-fire-delay uint32 :offset-assert 668) - (charge-ammo float :offset-assert 672) - (charge-start-time time-frame :offset-assert 680) - (charge-inc-time time-frame :offset-assert 688) - (charge-active? handle :offset-assert 696) + ((process (pointer target)) + (gun (pointer gun)) + (gun-pos transformq :inline) + (gun-trans vector :inline :overlay-at (-> gun-pos trans)) + (gun-quat quaternion :inline :overlay-at (-> gun-pos rot data 0)) + (gun-scale vector :inline :overlay-at (-> gun-pos scale)) + (gun-type pickup-type) + (using-gun-type pickup-type) + (active? symbol) + (latch? symbol) + (put-away? symbol) + (surpress-time time-frame) + (fire-time time-frame) + (gun-time time-frame) + (gun-get-on-time time-frame) + (active-time time-frame) + (fire-delay uint32) + (gun-control uint32) + (gun-target uint32) + (gun-daxter float) + (gun-roty-rel degrees) + (gun-roty degrees) + (gun-roty-targ degrees) + (hips joint-mod) + (upper-body joint-mod) + (chest joint-mod) + (fire-dir-rot degrees) + (fire-dir vector 2 :inline) + (fire-point vector :inline) + (fire-dir-backup vector :inline) + (fire-dir-out vector :inline) + (fire-pending int32) + (fire-pending-time time-frame) + (fire-start-time time-frame) + (fire-charge float) + (fire-spin degrees) + (fire-spinv degrees) + (fire-chamber int32) + (fire-range meters) + (laser-active? symbol) + (laser-point vector :inline) + (laser-dir vector 2 :inline) + (laser-hit-point vector :inline) + (track? gun-track-flags) + (track-tilt degrees) + (track-turn degrees) + (track-find-range meters) + (track-turnv-range meters) + (track-tilt-range meters) + (track-turn-range meters) + (track-tilt-max degrees) + (track-turn-max degrees) + (track-angle-mult float) + (track-beam-size float) + (track-auto-fire symbol) + (track-require uint32) + (track-target-hold-time time-frame) + (track-start-time time-frame) + (track-press-start-time time-frame) + (track-target focus 2 :inline) + (track-trans vector :inline) + (track-dir vector :inline) + (turn-fast-hold-time time-frame) + (blue-whine-sound-id sound-id) + (blue-whine-volume float) + (top-anim-twist vector :inline) + (top-anim-twist-targ vector :inline) + (top-anim-look-at vector :inline) + (top-anim-twist-reset uint64) + (top-anim-gun-height meters) + (top-anim-blue-cycle float) + (top-anim-low-high float) + (top-anim-extra-twistv degrees) + (top-anim-tilt-up degrees) + (attack-combo combo-tracker :inline) + (combo-window-start time-frame) + (combo-window-state symbol) + (combo-fire-delay uint32) + (charge-ammo float) + (charge-start-time time-frame) + (charge-inc-time time-frame) + (charge-active? handle) ) - :method-count-assert 10 - :size-assert #x2c0 - :flag-assert #xa000002c0 (:methods - (gun-info-method-9 (_type_) (inline-array vector) 9) + (gun-info-method-9 (_type_) (inline-array vector)) ) ) ;; definition for method 3 of type gun-info -(defmethod inspect gun-info ((this gun-info)) +(defmethod inspect ((this gun-info)) (when (not this) (set! this this) (goto cfg-145) @@ -523,7 +516,7 @@ ) ;; definition for method 12 of type fact-info-target -(defmethod get-gun-ammo fact-info-target ((this fact-info-target)) +(defmethod get-gun-ammo ((this fact-info-target)) (let ((current-gun (gun->ammo (-> (the-as target (-> this process)) gun gun-type)))) (if (zero? current-gun) 0.0 diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-red-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-red-shot_REF.gc index f0570f2ea20..e3c71eed91c 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-red-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-red-shot_REF.gc @@ -3,36 +3,34 @@ ;; definition of type gun-red-shot (deftype gun-red-shot (process-drawable) - ((root collide-shape-moving :override) - (probe-count int32 :offset-assert 200) - (probe-mask uint32 :offset-assert 204) - (actor-count int32 :offset-assert 208) - (attack-id uint32 :offset-assert 212) - (start-pos vector :inline :offset-assert 224) - (start-dir vector :inline :offset-assert 240) - (start-rot vector :inline :offset-assert 256) - (probe-dir vector 19 :inline :offset-assert 272) + ((root collide-shape-moving :override) + (probe-count int32) + (probe-mask uint32) + (actor-count int32) + (attack-id uint32) + (start-pos vector :inline) + (start-dir vector :inline) + (start-rot vector :inline) + (probe-dir vector 19 :inline) ) - :heap-base #x1c0 - :method-count-assert 30 - :size-assert #x240 - :flag-assert #x1e01c00240 + (:state-methods + blocked + debug-idle + idle + ) (:methods - (blocked () _type_ :state 20) - (debug-idle () _type_ :state 21) - (idle () _type_ :state 22) - (init-probes! (_type_ collide-shape) none 23) - (gun-red-shot-method-24 (_type_) symbol 24) - (noop (_type_) none 25) - (gun-red-shot-method-26 (_type_) none 26) - (gun-red-shot-method-27 (_type_) none 27) - (gun-red-shot-method-28 (_type_ vector) sound-id 28) - (fire! (_type_ process-drawable int) object :behavior gun-red-shot 29) + (init-probes! (_type_ collide-shape) none) + (gun-red-shot-method-24 (_type_) symbol) + (noop (_type_) none) + (gun-red-shot-method-26 (_type_) none) + (gun-red-shot-method-27 (_type_) none) + (gun-red-shot-method-28 (_type_ vector) sound-id) + (fire! (_type_ process-drawable int) object :behavior gun-red-shot) ) ) ;; definition for method 3 of type gun-red-shot -(defmethod inspect gun-red-shot ((this gun-red-shot)) +(defmethod inspect ((this gun-red-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -148,7 +146,7 @@ ;; definition for method 29 of type gun-red-shot ;; INFO: Used lq/sq -(defmethod fire! gun-red-shot ((this gun-red-shot) (arg0 process-drawable) (arg1 int)) +(defmethod fire! ((this gun-red-shot) (arg0 process-drawable) (arg1 int)) (let* ((s5-0 arg0) (v1-0 (if (type? s5-0 process-drawable) s5-0 @@ -199,7 +197,7 @@ ;; definition for method 25 of type gun-red-shot ;; WARN: Return type mismatch int vs none. -(defmethod noop gun-red-shot ((this gun-red-shot)) +(defmethod noop ((this gun-red-shot)) "Does nothing" 0 (none) @@ -208,7 +206,7 @@ ;; definition for method 23 of type gun-red-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-probes! gun-red-shot ((this gun-red-shot) (arg0 collide-shape)) +(defmethod init-probes! ((this gun-red-shot) (arg0 collide-shape)) "Create all 19 probe vectors" (let ((s5-0 (-> this probe-count))) (when (< s5-0 19) @@ -254,7 +252,7 @@ ;; definition for method 26 of type gun-red-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod gun-red-shot-method-26 gun-red-shot ((this gun-red-shot)) +(defmethod gun-red-shot-method-26 ((this gun-red-shot)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -369,7 +367,7 @@ ;; definition for method 27 of type gun-red-shot ;; WARN: Return type mismatch int vs none. -(defmethod gun-red-shot-method-27 gun-red-shot ((this gun-red-shot)) +(defmethod gun-red-shot-method-27 ((this gun-red-shot)) (gun-red-shot-method-26 this) (let ((s5-0 (-> this probe-count))) (while (< s5-0 19) @@ -391,7 +389,7 @@ ;; definition for method 28 of type gun-red-shot ;; INFO: Used lq/sq -(defmethod gun-red-shot-method-28 gun-red-shot ((this gun-red-shot) (arg0 vector)) +(defmethod gun-red-shot-method-28 ((this gun-red-shot) (arg0 vector)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -435,7 +433,7 @@ ) ;; definition for method 24 of type gun-red-shot -(defmethod gun-red-shot-method-24 gun-red-shot ((this gun-red-shot)) +(defmethod gun-red-shot-method-24 ((this gun-red-shot)) (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc index cb960ce6906..7f2389c2450 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc @@ -4,14 +4,10 @@ ;; definition of type gun-eject (deftype gun-eject (projectile-bounce) () - :heap-base #x170 - :method-count-assert 42 - :size-assert #x1f0 - :flag-assert #x2a017001f0 ) ;; definition for method 3 of type gun-eject -(defmethod inspect gun-eject ((this gun-eject)) +(defmethod inspect ((this gun-eject)) (when (not this) (set! this this) (goto cfg-4) @@ -25,7 +21,7 @@ ;; definition for method 31 of type gun-eject ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-eject ((this gun-eject)) +(defmethod init-proj-settings! ((this gun-eject)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton this @@ -50,14 +46,10 @@ ;; definition of type gun-mag-yellow (deftype gun-mag-yellow (projectile-bounce) () - :heap-base #x170 - :method-count-assert 42 - :size-assert #x1f0 - :flag-assert #x2a017001f0 ) ;; definition for method 3 of type gun-mag-yellow -(defmethod inspect gun-mag-yellow ((this gun-mag-yellow)) +(defmethod inspect ((this gun-mag-yellow)) (when (not this) (set! this this) (goto cfg-4) @@ -71,7 +63,7 @@ ;; definition for method 31 of type gun-mag-yellow ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-mag-yellow ((this gun-mag-yellow)) +(defmethod init-proj-settings! ((this gun-mag-yellow)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton this @@ -90,14 +82,10 @@ ;; definition of type gun-mag-red (deftype gun-mag-red (projectile-bounce) () - :heap-base #x170 - :method-count-assert 42 - :size-assert #x1f0 - :flag-assert #x2a017001f0 ) ;; definition for method 3 of type gun-mag-red -(defmethod inspect gun-mag-red ((this gun-mag-red)) +(defmethod inspect ((this gun-mag-red)) (when (not this) (set! this this) (goto cfg-4) @@ -111,7 +99,7 @@ ;; definition for method 31 of type gun-mag-red ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-mag-red ((this gun-mag-red)) +(defmethod init-proj-settings! ((this gun-mag-red)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton this @@ -130,14 +118,10 @@ ;; definition of type gun-mag-blue (deftype gun-mag-blue (projectile-bounce) () - :heap-base #x170 - :method-count-assert 42 - :size-assert #x1f0 - :flag-assert #x2a017001f0 ) ;; definition for method 3 of type gun-mag-blue -(defmethod inspect gun-mag-blue ((this gun-mag-blue)) +(defmethod inspect ((this gun-mag-blue)) (when (not this) (set! this this) (goto cfg-4) @@ -151,7 +135,7 @@ ;; definition for method 31 of type gun-mag-blue ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-mag-blue ((this gun-mag-blue)) +(defmethod init-proj-settings! ((this gun-mag-blue)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton this @@ -170,14 +154,10 @@ ;; definition of type gun-mag-dark (deftype gun-mag-dark (projectile-bounce) () - :heap-base #x170 - :method-count-assert 42 - :size-assert #x1f0 - :flag-assert #x2a017001f0 ) ;; definition for method 3 of type gun-mag-dark -(defmethod inspect gun-mag-dark ((this gun-mag-dark)) +(defmethod inspect ((this gun-mag-dark)) (when (not this) (set! this this) (goto cfg-4) @@ -191,7 +171,7 @@ ;; definition for method 31 of type gun-mag-dark ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-mag-dark ((this gun-mag-dark)) +(defmethod init-proj-settings! ((this gun-mag-dark)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton this @@ -209,15 +189,12 @@ ;; definition of type beam-info (deftype beam-info (structure) - ((y-scale float :offset-assert 0) + ((y-scale float) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type beam-info -(defmethod inspect beam-info ((this beam-info)) +(defmethod inspect ((this beam-info)) (when (not this) (set! this this) (goto cfg-4) @@ -354,7 +331,7 @@ ;; definition for method 7 of type gun ;; WARN: Return type mismatch process-drawable vs gun. -(defmethod relocate gun ((this gun) (arg0 int)) +(defmethod relocate ((this gun) (arg0 int)) (if (nonzero? (-> this barrel)) (&+! (-> this barrel) arg0) ) @@ -986,7 +963,7 @@ ;; definition for method 9 of type gun-info ;; INFO: Used lq/sq -(defmethod gun-info-method-9 gun-info ((this gun-info)) +(defmethod gun-info-method-9 ((this gun-info)) (when (and (-> this laser-active?) (-> this active?) (not (logtest? (-> this gun 0 draw status) (draw-control-status no-draw))) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-yellow-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-yellow-shot_REF.gc index 83a321b3923..bb49ba5a7ab 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-yellow-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-yellow-shot_REF.gc @@ -51,18 +51,14 @@ ;; definition of type gun-yellow-shot (deftype gun-yellow-shot (projectile) - ((hit-actor? symbol :offset-assert 472) - (tail-pos vector :inline :offset-assert 480) - (hit-pos vector :inline :offset-assert 496) + ((hit-actor? symbol) + (tail-pos vector :inline) + (hit-pos vector :inline) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x200 - :flag-assert #x2801800200 ) ;; definition for method 3 of type gun-yellow-shot -(defmethod inspect gun-yellow-shot ((this gun-yellow-shot)) +(defmethod inspect ((this gun-yellow-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -79,7 +75,7 @@ ;; definition for method 24 of type gun-yellow-shot ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight gun-yellow-shot ((this gun-yellow-shot)) +(defmethod draw-laser-sight ((this gun-yellow-shot)) "TODO - confirm If applicable, draw the laser sight particles" (draw-beam (-> *part-id-table* 227) (-> this tail-pos) (-> this starting-dir) #f #t) 0 @@ -89,7 +85,7 @@ ;; definition for method 25 of type gun-yellow-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles gun-yellow-shot ((this gun-yellow-shot)) +(defmethod spawn-impact-particles ((this gun-yellow-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -156,7 +152,7 @@ ) ;; definition for method 37 of type gun-yellow-shot -(defmethod deal-damage! gun-yellow-shot ((this gun-yellow-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! ((this gun-yellow-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((t9-0 (method-of-type projectile deal-damage!))) (when (t9-0 this arg0 arg1) @@ -169,7 +165,7 @@ ;; definition for method 26 of type gun-yellow-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles gun-yellow-shot ((this gun-yellow-shot)) +(defmethod spawn-shell-particles ((this gun-yellow-shot)) "TODO - confirm" (cond ((-> this hit-actor?) @@ -253,7 +249,7 @@ ;; definition for method 28 of type gun-yellow-shot ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound gun-yellow-shot ((this gun-yellow-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this gun-yellow-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -274,7 +270,7 @@ ) ;; definition for method 38 of type gun-yellow-shot -(defmethod made-impact? gun-yellow-shot ((this gun-yellow-shot)) +(defmethod made-impact? ((this gun-yellow-shot)) "TODO - queries the collision cache, return true/false" (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) @@ -331,7 +327,7 @@ ;; definition for method 30 of type gun-yellow-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! gun-yellow-shot ((this gun-yellow-shot)) +(defmethod init-proj-collision! ((this gun-yellow-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -386,7 +382,7 @@ ;; definition for method 31 of type gun-yellow-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-yellow-shot ((this gun-yellow-shot)) +(defmethod init-proj-settings! ((this gun-yellow-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this hit-actor?) #f) (set! (-> this tail-pos quad) (-> this root trans quad)) diff --git a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc index 071009e6c51..4cc3a2b7c38 100644 --- a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc @@ -3101,7 +3101,7 @@ ;; definition for method 28 of type target ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-target target ((this target) (arg0 continue-point) (arg1 symbol)) +(defmethod init-target ((this target) (arg0 continue-point) (arg1 symbol)) (local-vars (s1-0 int) (s2-0 int) (s3-0 int) (s4-0 int) (sv-16 collide-shape-prim-group)) (set! (-> this tobot?) arg1) (set! (-> this tobot-recorder) #f) @@ -3359,7 +3359,7 @@ ) ;; definition for method 10 of type target -(defmethod deactivate target ((this target)) +(defmethod deactivate ((this target)) (kill-persister *setting-control* (the-as engine-pers 'bg-a-speed) 'bg-a-speed) (if (nonzero? (-> this darkjak)) (sound-stop (-> this darkjak tone)) diff --git a/test/decompiler/reference/jak2/engine/target/mech/carry-h_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/carry-h_REF.gc index 6c77efcfacd..a8e0b010646 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/carry-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/carry-h_REF.gc @@ -3,46 +3,43 @@ ;; definition of type carry-info (deftype carry-info (basic) - ((process (pointer target) :offset-assert 4) - (pickup-time time-frame :offset-assert 8) - (other-value float :offset-assert 16) - (other handle :offset-assert 24) - (point vector :inline :offset-assert 32) - (normal vector :inline :offset-assert 48) - (max-angle degrees :offset-assert 64) - (max-distance meters :offset-assert 68) - (max-pull meters :offset-assert 72) - (min-pull meters :offset-assert 76) - (grab-trans-blend float :offset-assert 80) - (carry-radius meters :offset-assert 84) - (backup-radius meters :offset-assert 88) - (joint int8 :offset-assert 92) - (mode carry-mode :offset-assert 93) - (face-dir int8 :offset-assert 94) - (local-point vector :inline :offset-assert 96) - (local-normal vector :inline :offset-assert 112) - (grab-quat quaternion :inline :offset-assert 128) - (grab-trans vector :inline :offset-assert 144) - (hold-trans vector :inline :offset-assert 160) + ((process (pointer target)) + (pickup-time time-frame) + (other-value float) + (other handle) + (point vector :inline) + (normal vector :inline) + (max-angle degrees) + (max-distance meters) + (max-pull meters) + (min-pull meters) + (grab-trans-blend float) + (carry-radius meters) + (backup-radius meters) + (joint int8) + (mode carry-mode) + (face-dir int8) + (local-point vector :inline) + (local-normal vector :inline) + (grab-quat quaternion :inline) + (grab-trans vector :inline) + (hold-trans vector :inline) ) - :method-count-assert 17 - :size-assert #xb0 - :flag-assert #x11000000b0 (:methods - (new (symbol type process-drawable int vector vector float) _type_ 0) - (carry-info-method-9 (_type_) none 9) - (distance-from-destination (_type_ carry-info) float 10) - (drag! (_type_ carry-info) none 11) - (drop-impl! (_type_ carry-info) none 12) - (carry-info-method-13 (_type_) symbol :behavior process-drawable 13) - (carry! (_type_ carry-info vector vector) none 14) - (drop! (_type_ carry-info) none 15) - (translate! (_type_) symbol :behavior process-drawable 16) + (new (symbol type process-drawable int vector vector float) _type_) + (carry-info-method-9 (_type_) none) + (distance-from-destination (_type_ carry-info) float) + (drag! (_type_ carry-info) none) + (drop-impl! (_type_ carry-info) none) + (carry-info-method-13 (_type_) symbol :behavior process-drawable) + (carry! (_type_ carry-info vector vector) none) + (drop! (_type_ carry-info) none) + (translate! (_type_) symbol :behavior process-drawable) ) ) ;; definition for method 3 of type carry-info -(defmethod inspect carry-info ((this carry-info)) +(defmethod inspect ((this carry-info)) (when (not this) (set! this this) (goto cfg-10) @@ -131,7 +128,7 @@ ;; definition for method 9 of type carry-info ;; WARN: Return type mismatch int vs none. -(defmethod carry-info-method-9 carry-info ((this carry-info)) +(defmethod carry-info-method-9 ((this carry-info)) (let ((s5-0 (-> this process 0 node-list data (-> this joint) bone transform))) (vector-rotate*! (-> this normal) (-> this local-normal) s5-0) (vector-matrix*! (-> this point) (-> this local-point) s5-0) @@ -141,7 +138,7 @@ ) ;; definition for method 10 of type carry-info -(defmethod distance-from-destination carry-info ((this carry-info) (arg0 carry-info)) +(defmethod distance-from-destination ((this carry-info) (arg0 carry-info)) "Returns the distance from the current `point` and the provided [[carry-info]]'s `point`. Returns `-1.0` if it exceeds the maximum allowed" (let* ((f28-0 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) (-> arg0 point) (-> this point)))) @@ -217,7 +214,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ;; definition for method 11 of type carry-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod drag! carry-info ((this carry-info) (arg0 carry-info)) +(defmethod drag! ((this carry-info) (arg0 carry-info)) (let ((v1-0 (-> arg0 process))) (set! (-> this other) (the-as handle (logior (if v1-0 (new 'static 'handle :pid (-> v1-0 0 pid)) @@ -318,7 +315,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ;; definition for method 12 of type carry-info ;; WARN: Return type mismatch int vs none. -(defmethod drop-impl! carry-info ((this carry-info) (arg0 carry-info)) +(defmethod drop-impl! ((this carry-info) (arg0 carry-info)) (let ((a1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 process 0 control quat)))) (set! (-> a1-2 y) 0.0) (set-heading-vec-clear-roll-pitch! (-> arg0 process 0 control) a1-2) @@ -359,7 +356,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ;; definition for method 13 of type carry-info ;; INFO: Used lq/sq -(defmethod carry-info-method-13 carry-info ((this carry-info)) +(defmethod carry-info-method-13 ((this carry-info)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer self)) (set! (-> a1-0 num-params) 0) @@ -432,7 +429,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ;; definition for method 14 of type carry-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod carry! carry-info ((this carry-info) (arg0 carry-info) (arg1 vector) (arg2 vector)) +(defmethod carry! ((this carry-info) (arg0 carry-info) (arg1 vector) (arg2 vector)) (let ((v1-0 (-> arg0 process))) (set! (-> this other) (the-as handle (logior (if v1-0 (new 'static 'handle :pid (-> v1-0 0 pid)) @@ -512,7 +509,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ;; definition for method 16 of type carry-info -(defmethod translate! carry-info ((this carry-info)) +(defmethod translate! ((this carry-info)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer self)) (set! (-> a1-0 num-params) 0) @@ -529,7 +526,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ;; definition for method 15 of type carry-info -(defmethod drop! carry-info ((this carry-info) (arg0 carry-info)) +(defmethod drop! ((this carry-info) (arg0 carry-info)) (drop-impl! this arg0) (none) ) diff --git a/test/decompiler/reference/jak2/engine/target/mech/grunt-mech_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/grunt-mech_REF.gc index ebdc81ec3cb..abc65713e98 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/grunt-mech_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/grunt-mech_REF.gc @@ -3,22 +3,19 @@ ;; definition of type grunt-mech-hold (deftype grunt-mech-hold (structure) - ((reserve-mask uint8 :offset-assert 0) - (lower-hold int8 :offset-assert 1) - (grunt-handle handle :offset-assert 8) - (timeout uint64 :offset-assert 16) - (local-pos vector :inline :offset-assert 32) - (local-rot vector :inline :offset-assert 48) - (local-mat matrix :inline :offset-assert 64) - (world-mat matrix :inline :offset-assert 128) + ((reserve-mask uint8) + (lower-hold int8) + (grunt-handle handle) + (timeout uint64) + (local-pos vector :inline) + (local-rot vector :inline) + (local-mat matrix :inline) + (world-mat matrix :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) ;; definition for method 3 of type grunt-mech-hold -(defmethod inspect grunt-mech-hold ((this grunt-mech-hold)) +(defmethod inspect ((this grunt-mech-hold)) (when (not this) (set! this this) (goto cfg-4) @@ -38,21 +35,18 @@ ;; definition of type grunt-mech-info (deftype grunt-mech-info (basic) - ((reserved-mask uint8 :offset-assert 4) - (last-update-time time-frame :offset-assert 8) - (holds grunt-mech-hold 6 :inline :offset-assert 16) + ((reserved-mask uint8) + (last-update-time time-frame) + (holds grunt-mech-hold 6 :inline) ) - :method-count-assert 11 - :size-assert #x490 - :flag-assert #xb00000490 (:methods - (grunt-mech-info-method-9 (_type_ int process symbol) symbol 9) - (grunt-mech-info-method-10 (_type_) none 10) + (grunt-mech-info-method-9 (_type_ int process symbol) symbol) + (grunt-mech-info-method-10 (_type_) none) ) ) ;; definition for method 3 of type grunt-mech-info -(defmethod inspect grunt-mech-info ((this grunt-mech-info)) +(defmethod inspect ((this grunt-mech-info)) (when (not this) (set! this this) (goto cfg-4) @@ -124,7 +118,7 @@ ;; definition for method 10 of type grunt-mech-info ;; WARN: Return type mismatch int vs none. -(defmethod grunt-mech-info-method-10 grunt-mech-info ((this grunt-mech-info)) +(defmethod grunt-mech-info-method-10 ((this grunt-mech-info)) (let ((s5-0 (current-time))) (when (!= (-> this last-update-time) s5-0) (when (< s5-0 (-> this last-update-time)) @@ -174,7 +168,7 @@ ) ;; definition for method 9 of type grunt-mech-info -(defmethod grunt-mech-info-method-9 grunt-mech-info ((this grunt-mech-info) (arg0 int) (arg1 process) (arg2 symbol)) +(defmethod grunt-mech-info-method-9 ((this grunt-mech-info) (arg0 int) (arg1 process) (arg2 symbol)) (grunt-mech-info-method-10 this) (let ((v1-2 *target*)) (when (and v1-2 (focus-test? v1-2 mech) (not (logtest? (-> v1-2 focus-status) (focus-status dead ignore)))) @@ -198,29 +192,27 @@ ;; definition of type grunt-mech (deftype grunt-mech (grunt) - ((hold-id int8 :offset-assert 692) - (dismount-dest vector :inline :offset-assert 704) + ((hold-id int8) + (dismount-dest vector :inline) ) - :heap-base #x250 - :method-count-assert 196 - :size-assert #x2d0 - :flag-assert #xc4025002d0 + (:state-methods + mech-lunge + mech-hold + mech-dismount + mech-post-circling + mech-pre-circling + ) (:methods - (mech-lunge () _type_ :state 186) - (mech-hold () _type_ :state 187) - (mech-dismount () _type_ :state 188) - (mech-post-circling () _type_ :state 189) - (mech-pre-circling () _type_ :state 190) - (grunt-mech-method-191 (_type_) none 191) - (grunt-mech-method-192 (_type_) symbol 192) - (grunt-mech-method-193 (_type_) int 193) - (grunt-mech-method-194 (_type_) none 194) - (grunt-mech-method-195 (_type_ vector vector vector) symbol 195) + (grunt-mech-method-191 (_type_) none) + (grunt-mech-method-192 (_type_) symbol) + (grunt-mech-method-193 (_type_) int) + (grunt-mech-method-194 (_type_) none) + (grunt-mech-method-195 (_type_ vector vector vector) symbol) ) ) ;; definition for method 3 of type grunt-mech -(defmethod inspect grunt-mech ((this grunt-mech)) +(defmethod inspect ((this grunt-mech)) (when (not this) (set! this this) (goto cfg-4) @@ -236,7 +228,7 @@ ;; definition for method 55 of type grunt-mech ;; WARN: Return type mismatch int vs none. -(defmethod track-target! grunt-mech ((this grunt-mech)) +(defmethod track-target! ((this grunt-mech)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -251,7 +243,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod grunt-mech-method-193 grunt-mech ((this grunt-mech)) +(defmethod grunt-mech-method-193 ((this grunt-mech)) (local-vars (f0-3 float) (sv-592 vector)) (let ((s4-0 *grunt-mech-info*)) (grunt-mech-info-method-10 s4-0) @@ -333,7 +325,7 @@ ) ;; definition for method 184 of type grunt-mech -(defmethod grunt-method-184 grunt-mech ((this grunt-mech) (arg0 float)) +(defmethod grunt-method-184 ((this grunt-mech) (arg0 float)) (local-vars (v1-5 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -461,7 +453,7 @@ ;; definition for method 195 of type grunt-mech ;; INFO: Used lq/sq -(defmethod grunt-mech-method-195 grunt-mech ((this grunt-mech) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod grunt-mech-method-195 ((this grunt-mech) (arg0 vector) (arg1 vector) (arg2 vector)) (local-vars (v1-13 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -519,7 +511,7 @@ ) ;; definition for method 192 of type grunt-mech -(defmethod grunt-mech-method-192 grunt-mech ((this grunt-mech)) +(defmethod grunt-mech-method-192 ((this grunt-mech)) (do-navigation-to-destination (-> this nav state) (-> this root trans)) (let ((a1-1 *target*)) (if (or (not a1-1) (not (logtest? (focus-status mech) (-> a1-1 focus-status)))) @@ -579,14 +571,14 @@ ;; definition for method 194 of type grunt-mech ;; WARN: Return type mismatch object vs none. -(defmethod grunt-mech-method-194 grunt-mech ((this grunt-mech)) +(defmethod grunt-mech-method-194 ((this grunt-mech)) (send-event *target* 'attack #f (static-attack-info ((id (new-attack-id)) (mode 'grunt)))) (none) ) ;; definition for method 191 of type grunt-mech ;; WARN: Return type mismatch object vs none. -(defmethod grunt-mech-method-191 grunt-mech ((this grunt-mech)) +(defmethod grunt-mech-method-191 ((this grunt-mech)) (if (>= (current-time) (-> this state-timeout)) (go (method-of-object this mech-dismount)) ) diff --git a/test/decompiler/reference/jak2/engine/target/mech/mech-h_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/mech-h_REF.gc index 2a41348be26..72b5de6bf76 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/mech-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/mech-h_REF.gc @@ -3,58 +3,55 @@ ;; definition of type mech-info (deftype mech-info (basic) - ((entity basic :offset-assert 4) - (hud handle 1 :offset-assert 8) - (mech-trans vector :inline :offset-assert 16) - (mech-quat vector :inline :offset-assert 32) - (mech-scale vector :inline :offset-assert 48) - (engine-sound-id sound-id :offset-assert 64) - (engine-sound-volume float :offset-assert 68) - (engine-sound-pitch float :offset-assert 72) - (thrust-sound-id sound-id :offset-assert 76) - (drag-sound-id sound-id :offset-assert 80) - (whine-sound-id sound-id :offset-assert 84) - (mech-start-time time-frame :offset-assert 88) - (mech-time time-frame :offset-assert 96) - (no-get-off-time time-frame :offset-assert 104) - (stick-lock basic :offset-assert 112) - (stick-off basic :offset-assert 116) - (forward-vel meters :offset-assert 120) - (jump-thrust meters :offset-assert 124) - (jump-thrust-fuel float :offset-assert 128) - (unstuck-time time-frame :offset-assert 136) - (stuck-count int32 :offset-assert 144) - (back-touch-point vector :inline :offset-assert 160) - (back-touch-trans vector :inline :offset-assert 176) - (back-touch-time time-frame :offset-assert 192) - (attack-id uint32 :offset-assert 200) - (shield-value float :offset-assert 204) - (shield-max float :offset-assert 208) - (walk-anim-leg int32 :offset-assert 212) - (state-impact? symbol 1 :offset-assert 216) - (state-impact impact-control 1 :inline :offset-assert 224) - (thruster-flame-width meters :offset-assert 304) - (thruster-flame-length meters :offset-assert 308) - (thruster-local-pos vector 2 :inline :offset-assert 320) - (exhaust-local-pos vector 2 :inline :offset-assert 352) - (exhaust-local-dir vector 2 :inline :offset-assert 384) - (smoke-local-pos vector 2 :inline :offset-assert 416) - (smoke-local-vel vector 2 :inline :offset-assert 448) - (particle-system-2d basic :offset-assert 480) - (particle-system-3d basic :offset-assert 484) - (part-thruster basic :offset-assert 488) - (part-thruster-scale-x sp-field-init-spec :offset-assert 492) - (part-thruster-scale-y sp-field-init-spec :offset-assert 496) - (part-quat quaternion :offset-assert 500) - (part-vel vector :offset-assert 504) + ((entity basic) + (hud handle 1) + (mech-trans vector :inline) + (mech-quat vector :inline) + (mech-scale vector :inline) + (engine-sound-id sound-id) + (engine-sound-volume float) + (engine-sound-pitch float) + (thrust-sound-id sound-id) + (drag-sound-id sound-id) + (whine-sound-id sound-id) + (mech-start-time time-frame) + (mech-time time-frame) + (no-get-off-time time-frame) + (stick-lock basic) + (stick-off basic) + (forward-vel meters) + (jump-thrust meters) + (jump-thrust-fuel float) + (unstuck-time time-frame) + (stuck-count int32) + (back-touch-point vector :inline) + (back-touch-trans vector :inline) + (back-touch-time time-frame) + (attack-id uint32) + (shield-value float) + (shield-max float) + (walk-anim-leg int32) + (state-impact? symbol 1) + (state-impact impact-control 1 :inline) + (thruster-flame-width meters) + (thruster-flame-length meters) + (thruster-local-pos vector 2 :inline) + (exhaust-local-pos vector 2 :inline) + (exhaust-local-dir vector 2 :inline) + (smoke-local-pos vector 2 :inline) + (smoke-local-vel vector 2 :inline) + (particle-system-2d basic) + (particle-system-3d basic) + (part-thruster basic) + (part-thruster-scale-x sp-field-init-spec) + (part-thruster-scale-y sp-field-init-spec) + (part-quat quaternion) + (part-vel vector) ) - :method-count-assert 9 - :size-assert #x1fc - :flag-assert #x9000001fc ) ;; definition for method 3 of type mech-info -(defmethod inspect mech-info ((this mech-info)) +(defmethod inspect ((this mech-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc index c7d9ea1aac4..edc2dc450fd 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc @@ -8,30 +8,28 @@ ;; definition of type mech (deftype mech (process-drawable) - ((root collide-shape-moving :override) - (extra-trans vector :inline :offset-assert 208) - (condition int32 :offset-assert 224) - (shadow-backup basic :offset-assert 228) - (rider uint64 :offset-assert 232) - (shield-value float :offset-assert 240) - (nav-sphere-handle uint64 :offset-assert 248) - (probe-time time-frame :offset-assert 256) + ((root collide-shape-moving :override) + (extra-trans vector :inline) + (condition int32) + (shadow-backup basic) + (rider uint64) + (shield-value float) + (nav-sphere-handle uint64) + (probe-time time-frame) ) - :heap-base #x90 - :method-count-assert 25 - :size-assert #x108 - :flag-assert #x1900900108 + (:state-methods + wait-for-start + idle + (pickup (state mech)) + wait-for-return + ) (:methods - (wait-for-start () _type_ :state 20) - (idle () _type_ :state 21) - (pickup ((state mech)) _type_ :state 22) - (wait-for-return () _type_ :state 23) - (mech-method-24 (_type_) none 24) + (mech-method-24 (_type_) none) ) ) ;; definition for method 3 of type mech -(defmethod inspect mech ((this mech)) +(defmethod inspect ((this mech)) (when (not this) (set! this this) (goto cfg-4) @@ -52,7 +50,7 @@ ;; definition for method 24 of type mech ;; WARN: Return type mismatch int vs none. -(defmethod mech-method-24 mech ((this mech)) +(defmethod mech-method-24 ((this mech)) (if (nonzero? (-> this part)) (spawn (-> this part) (-> this root trans)) ) @@ -382,7 +380,7 @@ ) ;; definition for method 11 of type mech -(defmethod init-from-entity! mech ((this mech) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mech) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -396,18 +394,14 @@ This commonly includes things such as: ;; definition of type mech-target (deftype mech-target (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) + (:state-methods + idle + active ) ) ;; definition for method 3 of type mech-target -(defmethod inspect mech-target ((this mech-target)) +(defmethod inspect ((this mech-target)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc b/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc index 6fe60e45f59..bfedc93a077 100644 --- a/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc @@ -3,53 +3,50 @@ ;; definition of type surface (deftype surface (basic) - ((name symbol :offset-assert 4) - (turnv float :offset-assert 8) - (turnvv float :offset-assert 12) - (tiltv float :offset-assert 16) - (tiltvv float :offset-assert 20) - (transv-max float :offset-assert 24) - (target-speed float :offset-assert 28) - (seek0 float :offset-assert 32) - (seek90 float :offset-assert 36) - (seek180 float :offset-assert 40) - (fric float :offset-assert 44) - (nonlin-fric-dist float :offset-assert 48) - (slip-factor float :offset-assert 52) - (slide-factor float :offset-assert 56) - (slope-up-factor float :offset-assert 60) - (slope-down-factor float :offset-assert 64) - (slope-slip-angle float :offset-assert 68) - (impact-fric float :offset-assert 72) - (bend-factor float :offset-assert 76) - (bend-speed float :offset-assert 80) - (alignv float :offset-assert 84) - (slope-up-traction float :offset-assert 88) - (align-speed float :offset-assert 92) - (slope-change-preserve float :offset-assert 96) - (turnvf float :offset-assert 100) - (turnvvf float :offset-assert 104) - (tiltvf float :offset-assert 108) - (tiltvvf float :offset-assert 112) - (vel-turn float :offset-assert 116) - (active-hook (function none) :offset 128) - (touch-hook (function none) :offset 132) - (impact-hook (function control-info (pointer float) vector none) :offset 136) - (mult-hook (function surface surface surface int none) :offset-assert 140) - (exit-hook function :offset-assert 144) - (mode symbol :offset-assert 148) - (flags surface-flag :offset-assert 152) - (data float 30 :offset 8) - (hook function 4 :offset 128) - (dataw uint32 2 :offset 148) + ((name symbol) + (turnv float) + (turnvv float) + (tiltv float) + (tiltvv float) + (transv-max float) + (target-speed float) + (seek0 float) + (seek90 float) + (seek180 float) + (fric float) + (nonlin-fric-dist float) + (slip-factor float) + (slide-factor float) + (slope-up-factor float) + (slope-down-factor float) + (slope-slip-angle float) + (impact-fric float) + (bend-factor float) + (bend-speed float) + (alignv float) + (slope-up-traction float) + (align-speed float) + (slope-change-preserve float) + (turnvf float) + (turnvvf float) + (tiltvf float) + (tiltvvf float) + (vel-turn float) + (active-hook (function none) :offset 128) + (touch-hook (function none) :offset 132) + (impact-hook (function control-info (pointer float) vector none) :offset 136) + (mult-hook (function surface surface surface int none)) + (exit-hook function) + (mode symbol) + (flags surface-flag) + (data float 30 :overlay-at turnv) + (hook function 4 :overlay-at active-hook) + (dataw uint32 2 :overlay-at mode) ) - :method-count-assert 9 - :size-assert #x9c - :flag-assert #x90000009c ) ;; definition for method 3 of type surface -(defmethod inspect surface ((this surface)) +(defmethod inspect ((this surface)) (when (not this) (set! this this) (goto cfg-62) @@ -209,7 +206,7 @@ ;; definition for method 2 of type surface ;; ERROR: Function may read a register that is not set: t3 -(defmethod print surface ((this surface)) +(defmethod print ((this surface)) (local-vars (t3-0 none)) (format #t diff --git a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc index dcdb17c7f2e..7e21394c460 100644 --- a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc @@ -958,7 +958,7 @@ ;; definition for method 9 of type darkjak-info ;; WARN: Return type mismatch int vs none. -(defmethod update-clock! darkjak-info ((this darkjak-info) (arg0 int)) +(defmethod update-clock! ((this darkjak-info) (arg0 int)) (when (-> this clock-on) (+! (-> this clock-pos) (* (-> this clock-vel) (seconds-per-frame))) (+! (-> this clock-vel) (* 4.0 (seconds-per-frame))) diff --git a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc index b72394f6d77..75d9a8e44c9 100644 --- a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc @@ -1277,16 +1277,13 @@ ;; definition of type kill-nearby-enemies-info (deftype kill-nearby-enemies-info (basic) - ((dist float :offset-assert 4) - (pos vector :inline :offset-assert 16) + ((dist float) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type kill-nearby-enemies-info -(defmethod inspect kill-nearby-enemies-info ((this kill-nearby-enemies-info)) +(defmethod inspect ((this kill-nearby-enemies-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/target/target-h_REF.gc b/test/decompiler/reference/jak2/engine/target/target-h_REF.gc index fd686f76e4b..9d1217ec2c9 100644 --- a/test/decompiler/reference/jak2/engine/target/target-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-h_REF.gc @@ -3,81 +3,77 @@ ;; definition of type target (deftype target (process-focusable) - ((self target :override) - (fact fact-info-target :override) - (control control-info :offset 128) - (skel2 joint-control :offset-assert 204) - (shadow-backup shadow-geo :offset-assert 208) - (target-flags uint32 :offset 188) - (game game-info :offset-assert 212) - (neck joint-mod :offset-assert 216) - (head joint-mod :offset-assert 220) - (upper-body joint-mod :offset-assert 224) - (horns joint-mod :offset-assert 228) - (hair joint-mod 2 :offset-assert 232) - (darkjak-interp float :offset-assert 240) - (darkjak-giant-interp float :offset-assert 244) - (arm-ik joint-mod-ik 2 :offset-assert 248) - (leg-ik joint-mod-ik 2 :offset-assert 256) - (foot joint-mod 2 :offset-assert 264) - (mech-ik joint-mod-ik 2 :offset-assert 272) - (init-time time-frame :offset 272) - (teleport-time time-frame :offset-assert 280) - (state-hook-time time-frame :offset-assert 288) - (state-hook (function none :behavior target) :offset-assert 296) - (cam-user-mode symbol :offset-assert 300) - (sidekick (pointer sidekick) :offset-assert 304) - (manipy (pointer manipy) :offset-assert 308) - (mirror (pointer process-drawable) :offset-assert 312) - (attack-info attack-info :inline :offset-assert 320) - (attack-info-rec attack-info :inline :offset-assert 480) - (attack-info-old attack-info 8 :inline :offset-assert 640) - (anim-seed uint64 :offset-assert 1920) - (alt-cam-pos vector :inline :offset-assert 1936) - (current-level level :offset-assert 1952) - (saved-pos transformq :inline :offset-assert 1968) - (saved-owner uint64 :offset-assert 2016) - (alt-neck-pos vector :inline :offset-assert 2032) - (focus-search (array collide-shape) :offset-assert 2048) - (excitement float :offset-assert 2052) - (shock-effect-time time-frame :offset-assert 2056) - (beard? symbol :offset-assert 2064) - (spool-anim spool-anim :offset-assert 2068) - (ambient-time time-frame :offset-assert 2072) - (fp-hud handle :offset-assert 2080) - (no-load-wait uint64 :offset-assert 2088) - (no-look-around-wait uint64 :offset-assert 2096) - (burn-proc handle :offset-assert 2104) - (pre-joint-hook (function none :behavior target) :offset-assert 2112) - (notify handle :offset-assert 2120) - (mode-cache basic :offset-assert 2128) - (mode-param1 handle :offset-assert 2136) - (mode-param2 uint64 :offset-assert 2144) - (mode-param3 uint64 :offset-assert 2152) - (tobot-state state :offset-assert 2160) - (tobot? symbol :offset-assert 2164) - (tobot-recorder basic :offset-assert 2168) - (color-effect basic :offset-assert 2172) - (color-effect-start-time time-frame :offset-assert 2176) - (color-effect-duration uint64 :offset-assert 2184) - (racer racer-info :offset-assert 2192) - (tube tube-info :offset-assert 2196) - (flut flut-info :offset-assert 2200) - (board board-info :offset-assert 2204) - (pilot pilot-info :offset-assert 2208) - (gun gun-info :offset-assert 2212) - (mech mech-info :offset-assert 2216) - (turret turret-info :offset-assert 2220) - (darkjak darkjak-info :offset-assert 2224) - (indax indax-info :offset-assert 2228) + ((self target :override) + (fact fact-info-target :override) + (control control-info :overlay-at root) + (skel2 joint-control) + (shadow-backup shadow-geo) + (target-flags uint32 :overlay-at state-flags) + (game game-info) + (neck joint-mod) + (head joint-mod) + (upper-body joint-mod) + (horns joint-mod) + (hair joint-mod 2) + (darkjak-interp float) + (darkjak-giant-interp float) + (arm-ik joint-mod-ik 2) + (leg-ik joint-mod-ik 2) + (foot joint-mod 2) + (mech-ik joint-mod-ik 2) + (init-time time-frame :overlay-at (-> mech-ik 0)) + (teleport-time time-frame) + (state-hook-time time-frame) + (state-hook (function none :behavior target)) + (cam-user-mode symbol) + (sidekick (pointer sidekick)) + (manipy (pointer manipy)) + (mirror (pointer process-drawable)) + (attack-info attack-info :inline) + (attack-info-rec attack-info :inline) + (attack-info-old attack-info 8 :inline) + (anim-seed uint64) + (alt-cam-pos vector :inline) + (current-level level) + (saved-pos transformq :inline) + (saved-owner uint64) + (alt-neck-pos vector :inline) + (focus-search (array collide-shape)) + (excitement float) + (shock-effect-time time-frame) + (beard? symbol) + (spool-anim spool-anim) + (ambient-time time-frame) + (fp-hud handle) + (no-load-wait uint64) + (no-look-around-wait uint64) + (burn-proc handle) + (pre-joint-hook (function none :behavior target)) + (notify handle) + (mode-cache basic) + (mode-param1 handle) + (mode-param2 uint64) + (mode-param3 uint64) + (tobot-state state) + (tobot? symbol) + (tobot-recorder basic) + (color-effect basic) + (color-effect-start-time time-frame) + (color-effect-duration uint64) + (racer racer-info) + (tube tube-info) + (flut flut-info) + (board board-info) + (pilot pilot-info) + (gun gun-info) + (mech mech-info) + (turret turret-info) + (darkjak darkjak-info) + (indax indax-info) ) - :heap-base #x840 - :method-count-assert 29 - :size-assert #x8b8 - :flag-assert #x1d084008b8 (:methods - (do-edge-grabs (_type_ collide-cache collide-edge-spec) none 27) - (init-target (_type_ continue-point symbol) none :behavior target 28) + (do-edge-grabs (_type_ collide-cache collide-edge-spec) none) + (init-target (_type_ continue-point symbol) none :behavior target) ) (:states target-attack @@ -238,7 +234,7 @@ ) ;; definition for method 3 of type target -(defmethod inspect target ((this target)) +(defmethod inspect ((this target)) (when (not this) (set! this this) (goto cfg-4) @@ -319,27 +315,23 @@ ;; definition of type sidekick (deftype sidekick (process-drawable) - ((parent (pointer target) :override) - (control control-info :offset 128) - (anim-seed uint64 :offset 208) - (shadow-in-movie? symbol :offset-assert 216) - (special-anim-time time-frame :offset-assert 224) - (special-anim-interp float :offset-assert 232) - (special-anim-frame float :offset-assert 236) - (offset transformq :inline :offset-assert 240) - (mirror (pointer process-drawable) :offset-assert 288) + ((parent (pointer target) :override) + (control control-info :overlay-at root) + (anim-seed uint64 :offset 208) + (shadow-in-movie? symbol) + (special-anim-time time-frame) + (special-anim-interp float) + (special-anim-frame float) + (offset transformq :inline) + (mirror (pointer process-drawable)) ) - :heap-base #xb0 - :method-count-assert 20 - :size-assert #x124 - :flag-assert #x1400b00124 (:states sidekick-clone ) ) ;; definition for method 3 of type sidekick -(defmethod inspect sidekick ((this sidekick)) +(defmethod inspect ((this sidekick)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc b/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc index da5a251aef5..7ebbf315cec 100644 --- a/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc @@ -117,31 +117,28 @@ ;; definition of type tube-info (deftype tube-info (basic) - ((entity basic :offset-assert 4) - (tube handle :offset-assert 8) - (downhill vector :inline :offset-assert 16) - (centertube vector :inline :offset-assert 32) - (downtube vector :inline :offset-assert 48) - (sidetube vector :inline :offset-assert 64) - (foretube vector :inline :offset-assert 80) - (old-transv vector :inline :offset-assert 96) - (mod-x float :offset-assert 112) - (mod-y float :offset-assert 116) - (start-time time-frame :offset-assert 120) - (turn-anim-targ float :offset-assert 128) - (turn-anim-frame float :offset-assert 132) - (turn-anim-vel float :offset-assert 136) - (tube-sound-id sound-id :offset-assert 140) - (tube-sound-vol float :offset-assert 144) - (tube-sound-pitch float :offset-assert 148) + ((entity basic) + (tube handle) + (downhill vector :inline) + (centertube vector :inline) + (downtube vector :inline) + (sidetube vector :inline) + (foretube vector :inline) + (old-transv vector :inline) + (mod-x float) + (mod-y float) + (start-time time-frame) + (turn-anim-targ float) + (turn-anim-frame float) + (turn-anim-vel float) + (tube-sound-id sound-id) + (tube-sound-vol float) + (tube-sound-pitch float) ) - :method-count-assert 9 - :size-assert #x98 - :flag-assert #x900000098 ) ;; definition for method 3 of type tube-info -(defmethod inspect tube-info ((this tube-info)) +(defmethod inspect ((this tube-info)) (when (not this) (set! this this) (goto cfg-4) @@ -171,13 +168,10 @@ ;; definition of type tube-bank (deftype tube-bank (basic) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type tube-bank -(defmethod inspect tube-bank ((this tube-bank)) +(defmethod inspect ((this tube-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -996,24 +990,20 @@ ;; definition of type slide-control (deftype slide-control (process-drawable) - ((target handle :offset-assert 200) - (pos float :offset-assert 208) - (trans vector :inline :offset-assert 224) - (rot vector :inline :offset-assert 240) - (side vector :inline :offset-assert 256) + ((target handle) + (pos float) + (trans vector :inline) + (rot vector :inline) + (side vector :inline) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x110 - :flag-assert #x1600900110 - (:methods - (slide-control-watch () _type_ :state 20) - (slide-control-ride () _type_ :state 21) + (:state-methods + slide-control-watch + slide-control-ride ) ) ;; definition for method 3 of type slide-control -(defmethod inspect slide-control ((this slide-control)) +(defmethod inspect ((this slide-control)) (when (not this) (set! this this) (goto cfg-4) @@ -1169,7 +1159,7 @@ ;; definition for method 11 of type slide-control ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! slide-control ((this slide-control) (arg0 entity-actor)) +(defmethod init-from-entity! ((this slide-control) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc index 7fbc8be0a60..8921893d4c2 100644 --- a/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc @@ -190,16 +190,12 @@ ;; definition of type turret-shot (deftype turret-shot (guard-shot) - ((hit-pos vector :inline :offset-assert 496) + ((hit-pos vector :inline) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x200 - :flag-assert #x2801800200 ) ;; definition for method 3 of type turret-shot -(defmethod inspect turret-shot ((this turret-shot)) +(defmethod inspect ((this turret-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -258,7 +254,7 @@ ;; definition for method 25 of type turret-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles turret-shot ((this turret-shot)) +(defmethod spawn-impact-particles ((this turret-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -318,7 +314,7 @@ ;; definition for method 26 of type turret-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles turret-shot ((this turret-shot)) +(defmethod spawn-shell-particles ((this turret-shot)) "TODO - confirm" (let* ((root (-> this root)) (v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> root trans)) 2048.0)) @@ -368,7 +364,7 @@ ;; definition for method 28 of type turret-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound turret-shot ((this turret-shot) (proj-options projectile-options)) +(defmethod play-impact-sound ((this turret-shot) (proj-options projectile-options)) (let ((options proj-options)) (cond ((zero? options) @@ -386,7 +382,7 @@ ;; definition for method 31 of type turret-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch projectile-options vs none. -(defmethod init-proj-settings! turret-shot ((this turret-shot)) +(defmethod init-proj-settings! ((this turret-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) @@ -400,7 +396,7 @@ ;; definition for method 30 of type turret-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! turret-shot ((this turret-shot)) +(defmethod init-proj-collision! ((this turret-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) diff --git a/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc b/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc index 3c9482121dd..984fa2aaffc 100644 --- a/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc @@ -266,16 +266,12 @@ ;; definition of type hud-turret-health (deftype hud-turret-health (hud) - ((fade-interp float :offset-assert 2980) + ((fade-interp float) ) - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba8 - :flag-assert #x1b0b300ba8 ) ;; definition for method 3 of type hud-turret-health -(defmethod inspect hud-turret-health ((this hud-turret-health)) +(defmethod inspect ((this hud-turret-health)) (when (not this) (set! this this) (goto cfg-4) @@ -290,7 +286,7 @@ ;; definition for method 15 of type hud-turret-health ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-turret-health ((this hud-turret-health)) +(defmethod draw ((this hud-turret-health)) (with-pp (seek! (-> this fade-interp) @@ -430,7 +426,7 @@ ;; definition for method 16 of type hud-turret-health ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-turret-health ((this hud-turret-health)) +(defmethod update-values ((this hud-turret-health)) (set! (-> this values 0 target) (the int (-> *game-info* score))) ((method-of-type hud update-values) this) 0 @@ -438,7 +434,7 @@ ) ;; definition for method 18 of type hud-turret-health -(defmethod event-callback hud-turret-health ((this hud-turret-health) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod event-callback ((this hud-turret-health) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('set-heat) (set! (-> this values 1 target) (the int (* 100.0 (the-as float (-> arg3 param 0))))) @@ -582,14 +578,10 @@ ;; definition of type hud-drill-turret-health (deftype hud-drill-turret-health (hud-turret-health) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba8 - :flag-assert #x1b0b300ba8 ) ;; definition for method 3 of type hud-drill-turret-health -(defmethod inspect hud-drill-turret-health ((this hud-drill-turret-health)) +(defmethod inspect ((this hud-drill-turret-health)) (when (not this) (set! this this) (goto cfg-4) @@ -603,7 +595,7 @@ ;; definition for method 17 of type hud-drill-turret-health ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-drill-turret-health ((this hud-drill-turret-health)) +(defmethod init-callback ((this hud-drill-turret-health)) (set! (-> this level) (level-get *level* 'drillmid)) (init-turret-hud this "drillmid-minimap") ((method-of-type hud init-callback) this) @@ -614,14 +606,10 @@ ;; definition of type hud-port-turret-health (deftype hud-port-turret-health (hud-turret-health) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba8 - :flag-assert #x1b0b300ba8 ) ;; definition for method 3 of type hud-port-turret-health -(defmethod inspect hud-port-turret-health ((this hud-port-turret-health)) +(defmethod inspect ((this hud-port-turret-health)) (when (not this) (set! this this) (goto cfg-4) @@ -635,7 +623,7 @@ ;; definition for method 17 of type hud-port-turret-health ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-port-turret-health ((this hud-port-turret-health)) +(defmethod init-callback ((this hud-port-turret-health)) (set! (-> this level) (level-get *level* 'portblmp)) (init-turret-hud this "portblmp-minimap") ((method-of-type hud init-callback) this) @@ -645,20 +633,17 @@ ;; definition of type turret-info (deftype turret-info (basic) - ((process (pointer process) :offset-assert 4) - (handle handle :offset-assert 8) - (turret (pointer base-turret) :offset-assert 16) - (grabbed? symbol :offset-assert 20) - (quat quaternion :inline :offset-assert 32) - (trans vector :inline :offset-assert 48) + ((process (pointer process)) + (handle handle) + (turret (pointer base-turret)) + (grabbed? symbol) + (quat quaternion :inline) + (trans vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type turret-info -(defmethod inspect turret-info ((this turret-info)) +(defmethod inspect ((this turret-info)) (when (not this) (set! this this) (goto cfg-4) @@ -714,17 +699,14 @@ ;; definition of type turret-path-event (deftype turret-path-event (structure) - ((pos float :offset-assert 0) - (event-type symbol :offset-assert 4) - (param object :offset-assert 8) + ((pos float) + (event-type symbol) + (param object) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type turret-path-event -(defmethod inspect turret-path-event ((this turret-path-event)) +(defmethod inspect ((this turret-path-event)) (when (not this) (set! this this) (goto cfg-4) @@ -739,16 +721,13 @@ ;; definition of type turret-path (deftype turret-path (structure) - ((event-count int32 :offset-assert 0) - (event-tbl (inline-array turret-path-event) :offset-assert 4) + ((event-count int32) + (event-tbl (inline-array turret-path-event)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type turret-path -(defmethod inspect turret-path ((this turret-path)) +(defmethod inspect ((this turret-path)) (when (not this) (set! this this) (goto cfg-4) @@ -762,88 +741,86 @@ ;; definition of type base-turret (deftype base-turret (process-focusable) - ((hud handle :offset-assert 208) - (condition int32 :offset-assert 216) - (shadow-backup symbol :offset-assert 220) - (rider handle :offset-assert 224) - (actor-group (pointer actor-group) :offset-assert 232) - (actor-group-count int32 :offset-assert 236) - (alt-actor symbol :offset-assert 240) - (smush-control smush-control :inline :offset-assert 248) - (sound-id sound-id 3 :offset-assert 280) - (sound-playing symbol 3 :offset-assert 292) - (cam-string-vector vector :inline :offset-assert 304) - (path-event turret-path :offset-assert 320) - (path-u float :offset-assert 324) - (path-u-prev float :offset-assert 328) - (path-mode uint16 :offset-assert 332) - (path-speed float :offset-assert 336) - (path-speed-mult float :offset-assert 340) - (path-speed-mult-final float :offset-assert 344) - (path-old-pos vector :inline :offset-assert 352) - (path-direction symbol :offset-assert 368) - (pause-proc (function base-turret symbol) :offset-assert 372) - (gun-recoil-jmod joint-mod-add-local 4 :offset-assert 376) - (gun-index int32 :offset-assert 392) - (shot-timeout time-frame :offset-assert 400) - (fire-time time-frame :offset-assert 408) - (fire-time-interval time-frame :offset-assert 416) - (enable-controls symbol :offset-assert 424) - (available-for-pickup symbol :offset-assert 428) - (roty degrees :offset-assert 432) - (rotyv degrees :offset-assert 436) - (rotyvv degrees :offset-assert 440) - (roty-min degrees :offset-assert 444) - (roty-max degrees :offset-assert 448) - (rotx degrees :offset-assert 452) - (rotxv degrees :offset-assert 456) - (rotxvv degrees :offset-assert 460) - (rotx-min degrees :offset-assert 464) - (rotx-max degrees :offset-assert 468) - (target-quat quaternion :inline :offset-assert 480) - (init-quat quaternion :inline :offset-assert 496) - (health float :offset-assert 512) - (track-handle handle :offset-assert 520) - (heat float :offset-assert 528) - (heat-target float :offset-assert 532) - (arrow-angle degrees :offset-assert 536) - (arrow-alpha float :offset-assert 540) - (arrow-red float :offset-assert 544) - (red-filter-timer time-frame :offset-assert 552) - (ride-height float :offset-assert 560) + ((hud handle) + (condition int32) + (shadow-backup symbol) + (rider handle) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (alt-actor symbol) + (smush-control smush-control :inline) + (sound-id sound-id 3) + (sound-playing symbol 3) + (cam-string-vector vector :inline) + (path-event turret-path) + (path-u float) + (path-u-prev float) + (path-mode uint16) + (path-speed float) + (path-speed-mult float) + (path-speed-mult-final float) + (path-old-pos vector :inline) + (path-direction symbol) + (pause-proc (function base-turret symbol)) + (gun-recoil-jmod joint-mod-add-local 4) + (gun-index int32) + (shot-timeout time-frame) + (fire-time time-frame) + (fire-time-interval time-frame) + (enable-controls symbol) + (available-for-pickup symbol) + (roty degrees) + (rotyv degrees) + (rotyvv degrees) + (roty-min degrees) + (roty-max degrees) + (rotx degrees) + (rotxv degrees) + (rotxvv degrees) + (rotx-min degrees) + (rotx-max degrees) + (target-quat quaternion :inline) + (init-quat quaternion :inline) + (health float) + (track-handle handle) + (heat float) + (heat-target float) + (arrow-angle degrees) + (arrow-alpha float) + (arrow-red float) + (red-filter-timer time-frame) + (ride-height float) ) - :heap-base #x1c0 - :method-count-assert 49 - :size-assert #x234 - :flag-assert #x3101c00234 + (:state-methods + idle + setup + active + shutdown + dormant + die + ) (:methods - (idle () _type_ :state 27) - (setup () _type_ :state 28) - (active () _type_ :state 29) - (shutdown () _type_ :state 30) - (dormant () _type_ :state 31) - (die () _type_ :state 32) - (turret-init! (_type_ entity-actor matrix) none 33) - (base-turret-method-34 (_type_ process) none 34) - (base-turret-method-35 (_type_) none 35) - (base-turret-method-36 (_type_) none 36) - (base-turret-method-37 (_type_) none 37) - (base-turret-method-38 (_type_) none 38) - (base-turret-method-39 (_type_ turret-path-event) none 39) - (base-turret-method-40 (_type_) none 40) - (base-turret-method-41 (_type_ vector) symbol 41) - (base-turret-method-42 (_type_ vector vector float) float 42) - (base-turret-method-43 (_type_) none 43) - (base-turret-method-44 (_type_ vector vector) none 44) - (base-turret-method-45 (_type_ object symbol) none 45) - (base-turret-method-46 (_type_ process) process 46) - (base-turret-method-47 (_type_) none 47) - (turret-event-handler (_type_ process int symbol event-message-block) object 48) + (turret-init! (_type_ entity-actor matrix) none) + (base-turret-method-34 (_type_ process) none) + (base-turret-method-35 (_type_) none) + (base-turret-method-36 (_type_) none) + (base-turret-method-37 (_type_) none) + (base-turret-method-38 (_type_) none) + (base-turret-method-39 (_type_ turret-path-event) none) + (base-turret-method-40 (_type_) none) + (base-turret-method-41 (_type_ vector) symbol) + (base-turret-method-42 (_type_ vector vector float) float) + (base-turret-method-43 (_type_) none) + (base-turret-method-44 (_type_ vector vector) none) + (base-turret-method-45 (_type_ object symbol) none) + (base-turret-method-46 (_type_ process) process) + (base-turret-method-47 (_type_) none) + (turret-event-handler (_type_ process int symbol event-message-block) object) ) ) ;; definition for method 3 of type base-turret -(defmethod inspect base-turret ((this base-turret)) +(defmethod inspect ((this base-turret)) (when (not this) (set! this this) (goto cfg-7) @@ -909,7 +886,7 @@ ;; definition for method 7 of type base-turret ;; WARN: Return type mismatch process-drawable vs base-turret. -(defmethod relocate base-turret ((this base-turret) (arg0 int)) +(defmethod relocate ((this base-turret) (arg0 int)) (countdown (v1-0 4) (if (-> this gun-recoil-jmod v1-0) (&+! (-> this gun-recoil-jmod v1-0) arg0) @@ -920,14 +897,14 @@ ;; definition for method 34 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-34 base-turret ((this base-turret) (arg0 process)) +(defmethod base-turret-method-34 ((this base-turret) (arg0 process)) 0 (none) ) ;; definition for method 35 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-35 base-turret ((this base-turret)) +(defmethod base-turret-method-35 ((this base-turret)) (send-event (handle->process (-> this hud)) 'force-show) 0 (none) @@ -935,7 +912,7 @@ ;; definition for method 36 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-36 base-turret ((this base-turret)) +(defmethod base-turret-method-36 ((this base-turret)) (if (nonzero? (-> this part)) (spawn (-> this part) (-> this root trans)) ) @@ -945,7 +922,7 @@ ;; definition for method 40 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-40 base-turret ((this base-turret)) +(defmethod base-turret-method-40 ((this base-turret)) (let ((s3-0 (new 'stack-no-clear 'matrix)) (s4-0 (new 'stack-no-clear 'matrix)) (gp-0 (new 'stack-no-clear 'quaternion)) @@ -965,7 +942,7 @@ ;; definition for method 37 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-37 base-turret ((this base-turret)) +(defmethod base-turret-method-37 ((this base-turret)) (let ((f30-0 (fabs (* 0.00006866455 (-> this rotyv)))) (f28-0 (fabs (* 0.00010986328 (-> this rotxv)))) (f26-0 0.33333334) @@ -1023,7 +1000,7 @@ ;; definition for method 48 of type base-turret ;; INFO: Used lq/sq -(defmethod turret-event-handler base-turret ((this base-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod turret-event-handler ((this base-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('trans) @@ -1062,7 +1039,7 @@ ) ;; definition for method 20 of type base-turret -(defmethod get-trans base-turret ((this base-turret) (arg0 int)) +(defmethod get-trans ((this base-turret) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (if (= arg0 1) (-> this root trans) @@ -1763,14 +1740,14 @@ ;; definition for method 46 of type base-turret ;; WARN: Return type mismatch symbol vs process. -(defmethod base-turret-method-46 base-turret ((this base-turret) (arg0 process)) +(defmethod base-turret-method-46 ((this base-turret) (arg0 process)) (the-as process #t) ) ;; definition for method 47 of type base-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-47 base-turret ((this base-turret)) +(defmethod base-turret-method-47 ((this base-turret)) (let ((a0-1 (-> this root trans)) (f30-0 0.0) (s4-0 (the-as process-drawable #f)) @@ -1868,7 +1845,7 @@ ;; definition for method 43 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-43 base-turret ((this base-turret)) +(defmethod base-turret-method-43 ((this base-turret)) (set! (-> this roty) (y-angle (-> this root))) (set! (-> this rotyv) 0.0) (set! (-> this rotyvv) 0.0) @@ -1882,7 +1859,7 @@ ;; definition for method 33 of type base-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod turret-init! base-turret ((this base-turret) (arg0 entity-actor) (arg1 matrix)) +(defmethod turret-init! ((this base-turret) (arg0 entity-actor) (arg1 matrix)) (local-vars (sv-16 res-tag)) (stack-size-set! (-> this main-thread) 512) (let ((s3-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) @@ -2015,7 +1992,7 @@ ;; definition for method 41 of type base-turret ;; INFO: Used lq/sq -(defmethod base-turret-method-41 base-turret ((this base-turret) (arg0 vector)) +(defmethod base-turret-method-41 ((this base-turret) (arg0 vector)) (local-vars (sv-592 int)) (let* ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this init-quat))) (s1-0 (-> this root trans)) @@ -2055,7 +2032,7 @@ ;; definition for method 44 of type base-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-44 base-turret ((this base-turret) (arg0 vector) (arg1 vector)) +(defmethod base-turret-method-44 ((this base-turret) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (set! (-> gp-0 ent) (-> this entity)) (set! (-> gp-0 charge) 1.0) @@ -2080,7 +2057,7 @@ ;; definition for method 42 of type base-turret ;; INFO: Used lq/sq -(defmethod base-turret-method-42 base-turret ((this base-turret) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod base-turret-method-42 ((this base-turret) (arg0 vector) (arg1 vector) (arg2 float)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (set! (-> s5-0 start-pos quad) (-> arg0 quad)) (vector-normalize-copy! (-> s5-0 move-dist) arg1 819200.0) @@ -2109,7 +2086,7 @@ ;; definition for method 45 of type base-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-45 base-turret ((this base-turret) (arg0 object) (arg1 symbol)) +(defmethod base-turret-method-45 ((this base-turret) (arg0 object) (arg1 symbol)) (local-vars (sv-112 vector) (sv-128 vector) (sv-144 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2166,7 +2143,7 @@ ;; definition for method 39 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-39 base-turret ((this base-turret) (arg0 turret-path-event)) +(defmethod base-turret-method-39 ((this base-turret) (arg0 turret-path-event)) (case (-> arg0 event-type) (('script) (script-eval (the-as pair (-> arg0 param))) @@ -2213,7 +2190,7 @@ ;; definition for method 38 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-38 base-turret ((this base-turret)) +(defmethod base-turret-method-38 ((this base-turret)) (when (nonzero? (-> this path-event)) (let* ((s5-0 (-> this path-event)) (f0-0 (get-num-segments (-> this path))) @@ -2234,7 +2211,7 @@ ) ;; definition for method 10 of type base-turret -(defmethod deactivate base-turret ((this base-turret)) +(defmethod deactivate ((this base-turret)) (if (valid? (-> this hud) (the-as type #f) "" #t 0) (send-event (handle->process (-> this hud)) 'hide-and-die) ) @@ -2247,7 +2224,7 @@ ;; definition for method 11 of type base-turret ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! base-turret ((this base-turret) (arg0 entity-actor)) +(defmethod init-from-entity! ((this base-turret) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/engine/target/target-util_REF.gc b/test/decompiler/reference/jak2/engine/target/target-util_REF.gc index 00b2bf7ad2a..ba5246a15c6 100644 --- a/test/decompiler/reference/jak2/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-util_REF.gc @@ -61,117 +61,114 @@ ;; definition of type target-bank (deftype target-bank (basic) - ((jump-collide-offset meters :offset-assert 4) - (jump-height-min meters :offset-assert 8) - (jump-height-max meters :offset-assert 12) - (double-jump-height-min meters :offset-assert 16) - (double-jump-height-max meters :offset-assert 20) - (flip-jump-height-min meters :offset-assert 24) - (flip-jump-height-max meters :offset-assert 28) - (duck-jump-height-min meters :offset-assert 32) - (duck-jump-height-max meters :offset-assert 36) - (flop-jump-height-min meters :offset-assert 40) - (flop-jump-height-max meters :offset-assert 44) - (attack-jump-height-min meters :offset-assert 48) - (attack-jump-height-max meters :offset-assert 52) - (edge-grab-jump-height-min meters :offset-assert 56) - (edge-grab-jump-height-max meters :offset-assert 60) - (swim-jump-height-min meters :offset-assert 64) - (swim-jump-height-max meters :offset-assert 68) - (tube-jump-height-min meters :offset-assert 72) - (tube-jump-height-max meters :offset-assert 76) - (carry-jump-height-min meters :offset-assert 80) - (carry-jump-height-max meters :offset-assert 84) - (mech-jump-height-min meters :offset-assert 88) - (mech-jump-height-max meters :offset-assert 92) - (mech-carry-jump-height-min meters :offset-assert 96) - (mech-carry-jump-height-max meters :offset-assert 100) - (indax-jump-height-min meters :offset-assert 104) - (indax-jump-height-max meters :offset-assert 108) - (indax-double-jump-height-min meters :offset-assert 112) - (indax-double-jump-height-max meters :offset-assert 116) - (roll-duration uint64 :offset-assert 120) - (roll-jump-pre-window uint64 :offset-assert 128) - (roll-jump-post-window uint64 :offset-assert 136) - (roll-timeout uint64 :offset-assert 144) - (roll-speed-min meters :offset-assert 152) - (roll-speed-inc meters :offset-assert 156) - (roll-flip-duration uint64 :offset-assert 160) - (roll-flip-height meters :offset-assert 168) - (roll-flip-dist meters :offset-assert 172) - (roll-flip-art-height meters :offset-assert 176) - (roll-flip-art-dist meters :offset-assert 180) - (duck-slide-distance meters :offset-assert 184) - (fall-far meters :offset-assert 188) - (fall-far-inc meters :offset-assert 192) - (attack-timeout uint64 :offset-assert 200) - (ground-timeout uint64 :offset-assert 208) - (slide-down-timeout uint64 :offset-assert 216) - (fall-timeout uint64 :offset-assert 224) - (fall-stumble-threshold meters :offset-assert 232) - (yellow-projectile-speed meters :offset-assert 236) - (hit-invulnerable-timeout uint64 :offset-assert 240) - (same-attack-invulnerable-timeout uint64 :offset-assert 248) - (run-cycle-length float :offset-assert 256) - (walk-cycle-dist meters :offset-assert 260) - (walk-up-cycle-dist meters :offset-assert 264) - (walk-down-cycle-dist meters :offset-assert 268) - (walk-side-cycle-dist meters :offset-assert 272) - (run-cycle-dist meters :offset-assert 276) - (run-up-cycle-dist meters :offset-assert 280) - (run-down-cycle-dist meters :offset-assert 284) - (run-side-cycle-dist meters :offset-assert 288) - (run-wall-cycle-dist meters :offset-assert 292) - (duck-walk-cycle-dist meters :offset-assert 296) - (wade-shallow-walk-cycle-dist meters :offset-assert 300) - (wade-deep-walk-cycle-dist meters :offset-assert 304) - (mech-walk-cycle-dist meters :offset-assert 308) - (mech-run-cycle-dist meters :offset-assert 312) - (smack-surface-dist meters :offset-assert 316) - (smack-surface-height meters :offset-assert 320) - (min-dive-depth meters :offset-assert 324) - (root-radius meters :offset-assert 328) - (root-offset vector :inline :offset-assert 336) - (body-radius meters :offset-assert 352) - (edge-radius meters :offset-assert 356) - (edge-offset vector :inline :offset-assert 368) - (edge-grab-height-off-ground meters :offset-assert 384) - (head-radius meters :offset-assert 388) - (head-height meters :offset-assert 392) - (head-offset vector :inline :offset-assert 400) - (spin-radius meters :offset-assert 416) - (spin-offset vector :inline :offset-assert 432) - (duck-spin-radius meters :offset-assert 448) - (duck-spin-offset vector :inline :offset-assert 464) - (punch-radius meters :offset-assert 480) - (punch-offset vector :inline :offset-assert 496) - (uppercut-radius meters :offset-assert 512) - (uppercut0-offset vector :inline :offset-assert 528) - (uppercut1-offset vector :inline :offset-assert 544) - (flop-radius meters :offset-assert 560) - (flop0-offset vector :inline :offset-assert 576) - (flop1-offset vector :inline :offset-assert 592) - (stuck-time seconds :offset-assert 608) - (stuck-timeout seconds :offset-assert 616) - (stuck-distance meters :offset-assert 624) - (tongue-pull-speed-min float :offset-assert 628) - (tongue-pull-speed-max float :offset-assert 632) - (yellow-attack-timeout uint64 :offset-assert 640) - (fall-height meters :offset-assert 648) - (mech-jump-thrust-fuel float :offset-assert 652) - (strafe-jump-pre-window uint64 :offset-assert 656) - (strafe-jump basic :offset-assert 664) - (strafe-duck-jump basic :offset-assert 668) - (dark-jump-height-min meters :offset-assert 672) - (dark-jump-height-max meters :offset-assert 676) + ((jump-collide-offset meters) + (jump-height-min meters) + (jump-height-max meters) + (double-jump-height-min meters) + (double-jump-height-max meters) + (flip-jump-height-min meters) + (flip-jump-height-max meters) + (duck-jump-height-min meters) + (duck-jump-height-max meters) + (flop-jump-height-min meters) + (flop-jump-height-max meters) + (attack-jump-height-min meters) + (attack-jump-height-max meters) + (edge-grab-jump-height-min meters) + (edge-grab-jump-height-max meters) + (swim-jump-height-min meters) + (swim-jump-height-max meters) + (tube-jump-height-min meters) + (tube-jump-height-max meters) + (carry-jump-height-min meters) + (carry-jump-height-max meters) + (mech-jump-height-min meters) + (mech-jump-height-max meters) + (mech-carry-jump-height-min meters) + (mech-carry-jump-height-max meters) + (indax-jump-height-min meters) + (indax-jump-height-max meters) + (indax-double-jump-height-min meters) + (indax-double-jump-height-max meters) + (roll-duration uint64) + (roll-jump-pre-window uint64) + (roll-jump-post-window uint64) + (roll-timeout uint64) + (roll-speed-min meters) + (roll-speed-inc meters) + (roll-flip-duration uint64) + (roll-flip-height meters) + (roll-flip-dist meters) + (roll-flip-art-height meters) + (roll-flip-art-dist meters) + (duck-slide-distance meters) + (fall-far meters) + (fall-far-inc meters) + (attack-timeout uint64) + (ground-timeout uint64) + (slide-down-timeout uint64) + (fall-timeout uint64) + (fall-stumble-threshold meters) + (yellow-projectile-speed meters) + (hit-invulnerable-timeout uint64) + (same-attack-invulnerable-timeout uint64) + (run-cycle-length float) + (walk-cycle-dist meters) + (walk-up-cycle-dist meters) + (walk-down-cycle-dist meters) + (walk-side-cycle-dist meters) + (run-cycle-dist meters) + (run-up-cycle-dist meters) + (run-down-cycle-dist meters) + (run-side-cycle-dist meters) + (run-wall-cycle-dist meters) + (duck-walk-cycle-dist meters) + (wade-shallow-walk-cycle-dist meters) + (wade-deep-walk-cycle-dist meters) + (mech-walk-cycle-dist meters) + (mech-run-cycle-dist meters) + (smack-surface-dist meters) + (smack-surface-height meters) + (min-dive-depth meters) + (root-radius meters) + (root-offset vector :inline) + (body-radius meters) + (edge-radius meters) + (edge-offset vector :inline) + (edge-grab-height-off-ground meters) + (head-radius meters) + (head-height meters) + (head-offset vector :inline) + (spin-radius meters) + (spin-offset vector :inline) + (duck-spin-radius meters) + (duck-spin-offset vector :inline) + (punch-radius meters) + (punch-offset vector :inline) + (uppercut-radius meters) + (uppercut0-offset vector :inline) + (uppercut1-offset vector :inline) + (flop-radius meters) + (flop0-offset vector :inline) + (flop1-offset vector :inline) + (stuck-time seconds) + (stuck-timeout seconds) + (stuck-distance meters) + (tongue-pull-speed-min float) + (tongue-pull-speed-max float) + (yellow-attack-timeout uint64) + (fall-height meters) + (mech-jump-thrust-fuel float) + (strafe-jump-pre-window uint64) + (strafe-jump basic) + (strafe-duck-jump basic) + (dark-jump-height-min meters) + (dark-jump-height-max meters) ) - :method-count-assert 9 - :size-assert #x2a8 - :flag-assert #x9000002a8 ) ;; definition for method 3 of type target-bank -(defmethod inspect target-bank ((this target-bank)) +(defmethod inspect ((this target-bank)) (when (not this) (set! this this) (goto cfg-4) @@ -1112,7 +1109,7 @@ ) ;; definition for method 27 of type control-info -(defmethod get-quaternion control-info ((this control-info)) +(defmethod get-quaternion ((this control-info)) (-> this quat-for-control) ) @@ -1136,7 +1133,7 @@ ) ;; definition for method 26 of type target -(defmethod get-inv-mass target ((this target)) +(defmethod get-inv-mass ((this target)) (if (or (and (focus-test? this dark) (nonzero? (-> this darkjak)) (logtest? (-> this darkjak stage) (darkjak-stage giant)) @@ -1151,7 +1148,7 @@ ;; definition for method 16 of type target ;; INFO: Used lq/sq ;; WARN: Return type mismatch control-info vs trsqv. -(defmethod apply-alignment target ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (with-pp (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg2 quad)) @@ -1652,7 +1649,7 @@ ;; definition for method 9 of type attack-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod attack-info-method-9 attack-info ((this attack-info) (arg0 attack-info) (arg1 process-drawable) (arg2 process-drawable)) +(defmethod attack-info-method-9 ((this attack-info) (arg0 attack-info) (arg1 process-drawable) (arg2 process-drawable)) (local-vars (v1-14 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1724,7 +1721,7 @@ ) ;; definition for method 10 of type attack-info -(defmethod compute-intersect-info attack-info ((this attack-info) (arg0 object) (arg1 process-drawable) (arg2 process) (arg3 touching-shapes-entry)) +(defmethod compute-intersect-info ((this attack-info) (arg0 object) (arg1 process-drawable) (arg2 process) (arg3 touching-shapes-entry)) (when (and arg3 arg1) (let ((a1-2 (prims-touching? arg3 (the-as collide-shape (-> arg1 root)) (the-as uint -1)))) (when a1-2 @@ -1753,7 +1750,7 @@ ;; definition for method 11 of type attack-info ;; INFO: Used lq/sq -(defmethod combine! attack-info ((this attack-info) (arg0 attack-info) (arg1 process-drawable)) +(defmethod combine! ((this attack-info) (arg0 attack-info) (arg1 process-drawable)) (let ((s4-0 (-> arg0 mask))) (set! (-> this mask) (-> arg0 mask)) (if (logtest? s4-0 (attack-mask attacker)) @@ -2028,7 +2025,7 @@ ;; definition for method 20 of type target ;; INFO: Used lq/sq -(defmethod get-trans target ((this target) (arg0 int)) +(defmethod get-trans ((this target) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (local-vars (v0-0 vector)) (let ((v1-0 (-> this control))) @@ -2102,7 +2099,7 @@ ) ;; definition for method 23 of type target -(defmethod time-to-apex-or-ground target ((this target) (arg0 int)) +(defmethod time-to-apex-or-ground ((this target) (arg0 int)) (let ((v1-0 (-> this control))) (cond ((zero? arg0) @@ -2127,7 +2124,7 @@ ) ;; definition for method 21 of type target -(defmethod get-quat target ((this target) (arg0 int)) +(defmethod get-quat ((this target) (arg0 int)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -2157,11 +2154,11 @@ ) ;; definition for method 24 of type target -(defmethod get-water-height target ((this target)) +(defmethod get-water-height ((this target)) (-> this water surface-height) ) ;; definition for method 25 of type target -(defmethod get-notice-time target ((this target)) +(defmethod get-notice-time ((this target)) (-> this neck notice-time) ) diff --git a/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc index 3f349acd2f8..b8c4944cad9 100644 --- a/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc @@ -3,15 +3,12 @@ ;; definition of type bigmap-bit-mask (deftype bigmap-bit-mask (structure) - ((data uint8 6656 :offset-assert 0) + ((data uint8 6656) ) - :method-count-assert 9 - :size-assert #x1a00 - :flag-assert #x900001a00 ) ;; definition for method 3 of type bigmap-bit-mask -(defmethod inspect bigmap-bit-mask ((this bigmap-bit-mask)) +(defmethod inspect ((this bigmap-bit-mask)) (when (not this) (set! this this) (goto cfg-4) @@ -24,15 +21,12 @@ ;; definition of type bigmap-layer-mask (deftype bigmap-layer-mask (structure) - ((data uint8 26624 :offset-assert 0) + ((data uint8 26624) ) - :method-count-assert 9 - :size-assert #x6800 - :flag-assert #x900006800 ) ;; definition for method 3 of type bigmap-layer-mask -(defmethod inspect bigmap-layer-mask ((this bigmap-layer-mask)) +(defmethod inspect ((this bigmap-layer-mask)) (when (not this) (set! this this) (goto cfg-4) @@ -45,18 +39,15 @@ ;; definition of type bigmap-image (deftype bigmap-image (structure) - ((clut-offset uint32 :offset-assert 0) - (image-offset uint32 :offset-assert 4) - (pad uint32 2 :offset-assert 8) - (data uint8 1 :offset-assert 16) + ((clut-offset uint32) + (image-offset uint32) + (pad uint32 2) + (data uint8 1) ) - :method-count-assert 9 - :size-assert #x11 - :flag-assert #x900000011 ) ;; definition for method 3 of type bigmap-image -(defmethod inspect bigmap-image ((this bigmap-image)) +(defmethod inspect ((this bigmap-image)) (when (not this) (set! this this) (goto cfg-4) @@ -72,17 +63,14 @@ ;; definition of type bigmap-info (deftype bigmap-info (vector) - ((scale float :offset 8) - (inv-scale float :offset 12) + ((scale float :overlay-at (-> data 2)) + (inv-scale float :overlay-at (-> data 3)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type bigmap-info ;; INFO: Used lq/sq -(defmethod inspect bigmap-info ((this bigmap-info)) +(defmethod inspect ((this bigmap-info)) (when (not this) (set! this this) (goto cfg-4) @@ -102,15 +90,12 @@ ;; definition of type bigmap-info-array (deftype bigmap-info-array (structure) - ((data bigmap-info 21 :inline :offset-assert 0) + ((data bigmap-info 21 :inline) ) - :method-count-assert 9 - :size-assert #x150 - :flag-assert #x900000150 ) ;; definition for method 3 of type bigmap-info-array -(defmethod inspect bigmap-info-array ((this bigmap-info-array)) +(defmethod inspect ((this bigmap-info-array)) (when (not this) (set! this this) (goto cfg-4) @@ -123,35 +108,32 @@ ;; definition of type bigmap-compressed-layers (deftype bigmap-compressed-layers (structure) - ((data (pointer uint32) 20 :offset-assert 0) - (layer0 (pointer uint32) :offset 0) - (layer1 (pointer uint32) :offset 4) - (layer2 (pointer uint32) :offset 8) - (layer3 (pointer uint32) :offset 12) - (layer4 (pointer uint32) :offset 16) - (layer5 (pointer uint32) :offset 20) - (layer6 (pointer uint32) :offset 24) - (layer7 (pointer uint32) :offset 28) - (layer8 (pointer uint32) :offset 32) - (layer9 (pointer uint32) :offset 36) - (layer10 (pointer uint32) :offset 40) - (layer11 (pointer uint32) :offset 44) - (layer12 (pointer uint32) :offset 48) - (layer13 (pointer uint32) :offset 52) - (layer14 (pointer uint32) :offset 56) - (layer15 (pointer uint32) :offset 60) - (layer16 (pointer uint32) :offset 64) - (layer17 (pointer uint32) :offset 68) - (layer18 (pointer uint32) :offset 72) - (layer19 (pointer uint32) :offset 76) + ((data (pointer uint32) 20) + (layer0 (pointer uint32) :overlay-at (-> data 0)) + (layer1 (pointer uint32) :overlay-at (-> data 1)) + (layer2 (pointer uint32) :overlay-at (-> data 2)) + (layer3 (pointer uint32) :overlay-at (-> data 3)) + (layer4 (pointer uint32) :overlay-at (-> data 4)) + (layer5 (pointer uint32) :overlay-at (-> data 5)) + (layer6 (pointer uint32) :overlay-at (-> data 6)) + (layer7 (pointer uint32) :overlay-at (-> data 7)) + (layer8 (pointer uint32) :overlay-at (-> data 8)) + (layer9 (pointer uint32) :overlay-at (-> data 9)) + (layer10 (pointer uint32) :overlay-at (-> data 10)) + (layer11 (pointer uint32) :overlay-at (-> data 11)) + (layer12 (pointer uint32) :overlay-at (-> data 12)) + (layer13 (pointer uint32) :overlay-at (-> data 13)) + (layer14 (pointer uint32) :overlay-at (-> data 14)) + (layer15 (pointer uint32) :overlay-at (-> data 15)) + (layer16 (pointer uint32) :overlay-at (-> data 16)) + (layer17 (pointer uint32) :overlay-at (-> data 17)) + (layer18 (pointer uint32) :overlay-at (-> data 18)) + (layer19 (pointer uint32) :overlay-at (-> data 19)) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type bigmap-compressed-layers -(defmethod inspect bigmap-compressed-layers ((this bigmap-compressed-layers)) +(defmethod inspect ((this bigmap-compressed-layers)) (when (not this) (set! this this) (goto cfg-4) @@ -184,75 +166,72 @@ ;; definition of type bigmap (deftype bigmap (basic) - ((drawing-flag symbol :offset-assert 4) - (loading-flag symbol :offset-assert 8) - (recording-flag symbol :offset-assert 12) - (fill-flag symbol :offset-assert 16) - (bigmap-index uint32 :offset-assert 20) - (bigmap-image external-art-buffer :offset-assert 24) - (tpage external-art-buffer :offset-assert 28) - (progress-minimap texture-page :offset-assert 32) - (mask-index uint32 :offset-assert 36) - (bit-mask bigmap-bit-mask :offset-assert 40) - (compressed-next-index uint32 :offset-assert 44) - (max-next-index uint32 :offset-assert 48) - (compressed-masks (pointer int8) 20 :offset-assert 52) - (compressed-data uint32 :offset-assert 132) - (layer-index uint32 :offset-assert 136) - (layer-mask bigmap-layer-mask :offset-assert 140) - (compressed-layers bigmap-compressed-layers :offset-assert 144) - (layer-mask-enable uint32 :offset-assert 148) - (load-index uint32 :offset-assert 152) - (x0 int32 :offset-assert 156) - (y0 int32 :offset-assert 160) - (x1 int32 :offset-assert 164) - (y1 int32 :offset-assert 168) - (y2 int32 :offset-assert 172) - (goal-time float :offset-assert 176) - (sprite-tmpl dma-gif-packet :inline :offset-assert 192) - (draw-tmpl dma-gif-packet :inline :offset-assert 224) - (adgif-tmpl dma-gif-packet :inline :offset-assert 256) - (offset vector :inline :offset-assert 288) - (size float :offset 296) - (scale float :offset 300) - (draw-offset vector :inline :offset-assert 304) - (draw-size float :offset 312) - (draw-scale float :offset 316) - (scroll vector :inline :offset-assert 320) - (pos vector4w :inline :offset-assert 336) - (color vector4w :inline :offset-assert 352) - (corner vector 4 :inline :offset-assert 368) - (auto-save-icon-flag symbol :offset-assert 432) + ((drawing-flag symbol) + (loading-flag symbol) + (recording-flag symbol) + (fill-flag symbol) + (bigmap-index uint32) + (bigmap-image external-art-buffer) + (tpage external-art-buffer) + (progress-minimap texture-page) + (mask-index uint32) + (bit-mask bigmap-bit-mask) + (compressed-next-index uint32) + (max-next-index uint32) + (compressed-masks (pointer int8) 20) + (compressed-data uint32) + (layer-index uint32) + (layer-mask bigmap-layer-mask) + (compressed-layers bigmap-compressed-layers) + (layer-mask-enable uint32) + (load-index uint32) + (x0 int32) + (y0 int32) + (x1 int32) + (y1 int32) + (y2 int32) + (goal-time float) + (sprite-tmpl dma-gif-packet :inline) + (draw-tmpl dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (offset vector :inline) + (size float :overlay-at (-> offset data 2)) + (scale float :overlay-at (-> offset data 3)) + (draw-offset vector :inline) + (draw-size float :overlay-at (-> draw-offset data 2)) + (draw-scale float :overlay-at (-> draw-offset data 3)) + (scroll vector :inline) + (pos vector4w :inline) + (color vector4w :inline) + (corner vector 4 :inline) + (auto-save-icon-flag symbol) ) - :method-count-assert 28 - :size-assert #x1b4 - :flag-assert #x1c000001b4 (:methods - (new (symbol type) _type_ 0) - (initialize (_type_) none 9) - (update (_type_) none 10) - (draw (_type_ int int int int) int 11) - (handle-cpad-inputs (_type_) int 12) - (compress-all (_type_) int 13) - (enable-drawing (_type_) none 14) - (disable-drawing (_type_) int 15) - (dump-to-file (_type_) file-stream 16) - (set-pos! (_type_ vector) int 17) - (decompress-current-masks! (_type_) int 18) - (compress-current-masks! (_type_) int 19) - (set-enable-from-position! (_type_) int 20) - (maybe-fill-for-position (_type_ int int) int 21) - (texture-upload-dma (_type_ dma-buffer (pointer uint32) int int int gs-psm) none 22) - (mask-image-from-bit-mask (_type_) none 23) - (draw-non-city-map (_type_ dma-buffer) none 24) - (draw-city-map (_type_ dma-buffer) none 25) - (sprite-dma (_type_ dma-buffer int int int int) none 26) - (draw-from-minimap (_type_ dma-buffer connection-minimap) int 27) + (new (symbol type) _type_) + (initialize (_type_) none) + (update (_type_) none) + (draw (_type_ int int int int) int) + (handle-cpad-inputs (_type_) int) + (compress-all (_type_) int) + (enable-drawing (_type_) none) + (disable-drawing (_type_) int) + (dump-to-file (_type_) file-stream) + (set-pos! (_type_ vector) int) + (decompress-current-masks! (_type_) int) + (compress-current-masks! (_type_) int) + (set-enable-from-position! (_type_) int) + (maybe-fill-for-position (_type_ int int) int) + (texture-upload-dma (_type_ dma-buffer (pointer uint32) int int int gs-psm) none) + (mask-image-from-bit-mask (_type_) none) + (draw-non-city-map (_type_ dma-buffer) none) + (draw-city-map (_type_ dma-buffer) none) + (sprite-dma (_type_ dma-buffer int int int int) none) + (draw-from-minimap (_type_ dma-buffer connection-minimap) int) ) ) ;; definition for method 3 of type bigmap -(defmethod inspect bigmap ((this bigmap)) +(defmethod inspect ((this bigmap)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/ui/bigmap_REF.gc b/test/decompiler/reference/jak2/engine/ui/bigmap_REF.gc index 326b7188ae9..f6e5f005ffd 100644 --- a/test/decompiler/reference/jak2/engine/ui/bigmap_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/bigmap_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 17 of type bigmap -(defmethod set-pos! bigmap ((this bigmap) (arg0 vector)) +(defmethod set-pos! ((this bigmap) (arg0 vector)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -21,7 +21,7 @@ ;; definition for method 18 of type bigmap ;; INFO: Used lq/sq -(defmethod decompress-current-masks! bigmap ((this bigmap)) +(defmethod decompress-current-masks! ((this bigmap)) (let ((compressed-mask-data (-> this compressed-masks (-> this mask-index)))) (set! (-> this compressed-masks (-> this mask-index)) (the-as (pointer int8) #f)) (cond @@ -62,7 +62,7 @@ ) ;; definition for method 19 of type bigmap -(defmethod compress-current-masks! bigmap ((this bigmap)) +(defmethod compress-current-masks! ((this bigmap)) (let* ((compressed-data-dest (+ (-> this compressed-next-index) 0 (-> this compressed-data))) (compressed-data-size (pack-comp-rle @@ -143,7 +143,7 @@ ) ;; definition for method 20 of type bigmap -(defmethod set-enable-from-position! bigmap ((this bigmap)) +(defmethod set-enable-from-position! ((this bigmap)) (let ((v1-4 (-> this layer-mask data (+ (* (-> this pos y) 128) (/ (-> this pos x) 2))))) (if (not (logtest? (-> this pos x) 1)) (set! (-> this layer-mask-enable) (shr v1-4 4)) @@ -154,7 +154,7 @@ ) ;; definition for method 21 of type bigmap -(defmethod maybe-fill-for-position bigmap ((this bigmap) (arg0 int) (arg1 int)) +(defmethod maybe-fill-for-position ((this bigmap) (arg0 int) (arg1 int)) (local-vars (v1-3 uint)) (let* ((v1-1 (+ (* arg1 128) (/ arg0 2))) (a3-3 (-> this layer-mask data v1-1)) @@ -198,7 +198,7 @@ ;; definition for method 23 of type bigmap ;; WARN: Return type mismatch int vs none. -(defmethod mask-image-from-bit-mask bigmap ((this bigmap)) +(defmethod mask-image-from-bit-mask ((this bigmap)) (let* ((v1-0 (the-as object (-> this bit-mask))) (a1-0 *image-mask-table*) (a0-2 (the-as object (-> this bigmap-image art-group))) @@ -233,7 +233,7 @@ ;; definition for method 22 of type bigmap ;; WARN: Return type mismatch int vs none. -(defmethod texture-upload-dma bigmap ((this bigmap) (arg0 dma-buffer) (arg1 (pointer uint32)) (arg2 int) (arg3 int) (arg4 int) (arg5 gs-psm)) +(defmethod texture-upload-dma ((this bigmap) (arg0 dma-buffer) (arg1 (pointer uint32)) (arg2 int) (arg3 int) (arg4 int) (arg5 gs-psm)) (local-vars (sv-16 int)) (set! sv-16 arg2) (dma-buffer-add-gs-set arg0 @@ -250,7 +250,7 @@ ;; definition for method 26 of type bigmap ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs none. -(defmethod sprite-dma bigmap ((this bigmap) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int)) +(defmethod sprite-dma ((this bigmap) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int)) (let ((v1-0 (-> arg0 base))) (set! (-> (the-as (pointer uint128) v1-0) 0) (-> this sprite-tmpl dma-vif quad)) (set! (-> (the-as (pointer uint128) v1-0) 1) (-> this sprite-tmpl quad 1)) @@ -265,7 +265,7 @@ ) ;; definition for method 24 of type bigmap -(defmethod draw-non-city-map bigmap ((this bigmap) (arg0 dma-buffer)) +(defmethod draw-non-city-map ((this bigmap) (arg0 dma-buffer)) (let ((s4-0 (the-as (pointer uint32) (-> this bigmap-image art-group)))) (let ((v1-1 (-> s4-0 0)) (s3-0 (-> s4-0 1)) @@ -307,7 +307,7 @@ ) ;; definition for method 25 of type bigmap -(defmethod draw-city-map bigmap ((this bigmap) (arg0 dma-buffer)) +(defmethod draw-city-map ((this bigmap) (arg0 dma-buffer)) (let ((s4-0 (the-as (pointer uint32) (-> this bigmap-image art-group)))) (texture-upload-dma this arg0 (+ (+ (-> s4-0 0) 16) (the-as uint s4-0)) 0 16 16 (gs-psm ct32)) (dma-buffer-add-gs-set arg0 (texflush 0)) @@ -331,7 +331,7 @@ ;; definition for method 27 of type bigmap ;; INFO: Used lq/sq -(defmethod draw-from-minimap bigmap ((this bigmap) (arg0 dma-buffer) (arg1 connection-minimap)) +(defmethod draw-from-minimap ((this bigmap) (arg0 dma-buffer) (arg1 connection-minimap)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -446,7 +446,7 @@ ;; definition for method 9 of type bigmap ;; WARN: Return type mismatch int vs none. -(defmethod initialize bigmap ((this bigmap)) +(defmethod initialize ((this bigmap)) (set! (-> this bigmap-index) (the-as uint 20)) (set-pending-file (-> this bigmap-image) (the-as string #f) 0 (process->handle *dproc*) 0.0) (set! (-> this compressed-next-index) (the-as uint 0)) @@ -464,7 +464,7 @@ ;; definition for method 10 of type bigmap ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update bigmap ((this bigmap)) +(defmethod update ((this bigmap)) (let ((v1-1 (level-get-target-inside *level*))) (if v1-1 (set! (-> this bigmap-index) (the-as uint (-> v1-1 info bigmap-id))) @@ -585,7 +585,7 @@ ;; definition for method 11 of type bigmap ;; INFO: Used lq/sq -(defmethod draw bigmap ((this bigmap) (arg0 int) (arg1 int) (arg2 int) (arg3 int)) +(defmethod draw ((this bigmap) (arg0 int) (arg1 int) (arg2 int) (arg3 int)) (local-vars (sv-96 pointer) (sv-100 texture) (sv-104 matrix) (sv-112 int)) (when (and (= (file-status (-> this bigmap-image) "world-map" (the-as int (-> this load-index))) 'active) (not (-> this loading-flag)) @@ -747,7 +747,7 @@ ;; definition for method 12 of type bigmap ;; INFO: Used lq/sq -(defmethod handle-cpad-inputs bigmap ((this bigmap)) +(defmethod handle-cpad-inputs ((this bigmap)) (cond ((= (-> this bigmap-index) 20) (let* ((v1-2 (-> *cpad-list* cpads 0)) @@ -765,7 +765,7 @@ ) ;; definition for method 13 of type bigmap -(defmethod compress-all bigmap ((this bigmap)) +(defmethod compress-all ((this bigmap)) (when (!= (-> this mask-index) 20) (compress-current-masks! this) (set! (-> this mask-index) (the-as uint 20)) @@ -776,7 +776,7 @@ ;; definition for method 14 of type bigmap ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod enable-drawing bigmap ((this bigmap)) +(defmethod enable-drawing ((this bigmap)) (set! (-> this bigmap-index) (the-as uint (-> (level-get-target-inside *level*) info bigmap-id))) (cond ((= (-> this bigmap-index) 20) @@ -818,7 +818,7 @@ ) ;; definition for method 15 of type bigmap -(defmethod disable-drawing bigmap ((this bigmap)) +(defmethod disable-drawing ((this bigmap)) (set-pending-file (-> this bigmap-image) (the-as string #f) @@ -848,7 +848,7 @@ (define *map-save-ptr* (the-as (pointer uint64) #f)) ;; definition for method 16 of type bigmap -(defmethod dump-to-file bigmap ((this bigmap)) +(defmethod dump-to-file ((this bigmap)) (if (not *map-save-ptr*) (set! *map-save-ptr* (the-as (pointer uint64) (malloc 'debug #xd0000))) ) diff --git a/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc index 04e8d38e4fe..b4b20570b43 100644 --- a/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc @@ -3,29 +3,26 @@ ;; definition of type gui-connection (deftype gui-connection (connection) - ((priority float :offset 16) - (action gui-action :offset 20) - (channel gui-channel :offset 21) - (anim-part uint8 :offset 22) - (flags gui-connection-flags :offset 23) - (name string :offset 24) - (id sound-id :offset 28) - (handle handle :offset 0) - (time-stamp time-frame :offset 8) - (hold-time time-frame :offset-assert 32) - (fo-min int16 :offset-assert 40) - (fo-max int16 :offset-assert 42) - (fo-curve int8 :offset-assert 44) - (fade uint8 :offset-assert 45) - (pad uint8 2 :offset-assert 46) + ((priority float :overlay-at param0) + (action gui-action :overlay-at param1) + (channel gui-channel :offset 21) + (anim-part uint8 :offset 22) + (flags gui-connection-flags :offset 23) + (name string :overlay-at param2) + (id sound-id :overlay-at param3) + (handle handle :overlay-at next0) + (time-stamp time-frame :overlay-at next1) + (hold-time time-frame) + (fo-min int16) + (fo-max int16) + (fo-curve int8) + (fade uint8) + (pad uint8 2) ) - :method-count-assert 14 - :size-assert #x30 - :flag-assert #xe00000030 ) ;; definition for method 3 of type gui-connection -(defmethod inspect gui-connection ((this gui-connection)) +(defmethod inspect ((this gui-connection)) (when (not this) (set! this this) (goto cfg-116) @@ -249,35 +246,32 @@ ;; definition of type gui-control (deftype gui-control (basic) - ((engine engine :offset-assert 4) - (update-time time-frame :offset-assert 8) - (connections gui-connection 32 :inline :offset-assert 16) - (spool-connections gui-connection 4 :inline :offset-assert 1552) - (ids sound-id 96 :offset-assert 1744) - (times time-frame 96 :offset-assert 2128) - (cmd pair 96 :offset-assert 2896) + ((engine engine) + (update-time time-frame) + (connections gui-connection 32 :inline) + (spool-connections gui-connection 4 :inline) + (ids sound-id 96) + (times time-frame 96) + (cmd pair 96) ) - :method-count-assert 25 - :size-assert #xcd0 - :flag-assert #x1900000cd0 (:methods - (new (symbol type int) _type_ 0) - (add-process (_type_ process gui-channel gui-action string float time-frame) sound-id 9) - (remove-process (_type_ process gui-channel) none 10) - (stop-str (_type_ gui-connection) int 11) - (gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id 12) - (update (_type_ symbol) int 13) - (lookup-gui-connection-id (_type_ string gui-channel gui-action) sound-id 14) - (lookup-gui-connection (_type_ process gui-channel string sound-id) gui-connection 15) - (set-action! (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int 16) - (get-status (_type_ sound-id) gui-status 17) - (gui-control-method-18 (_type_ gui-channel) symbol 18) - (handle-command-list (_type_ gui-channel gui-connection) symbol 19) - (set-falloff! (_type_ sound-id symbol int int int) gui-connection 20) - (gui-control-method-21 (_type_ gui-connection vector) int 21) - (gui-control-method-22 (_type_ gui-connection process symbol) none 22) - (handle-command (_type_ gui-channel gui-channel symbol gui-connection) symbol 23) - (channel-id-set! (_type_ gui-connection sound-id) int 24) + (new (symbol type int) _type_) + (add-process (_type_ process gui-channel gui-action string float time-frame) sound-id) + (remove-process (_type_ process gui-channel) none) + (stop-str (_type_ gui-connection) int) + (gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id) + (update (_type_ symbol) int) + (lookup-gui-connection-id (_type_ string gui-channel gui-action) sound-id) + (lookup-gui-connection (_type_ process gui-channel string sound-id) gui-connection) + (set-action! (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int) + (get-status (_type_ sound-id) gui-status) + (gui-control-method-18 (_type_ gui-channel) symbol) + (handle-command-list (_type_ gui-channel gui-connection) symbol) + (set-falloff! (_type_ sound-id symbol int int int) gui-connection) + (gui-control-method-21 (_type_ gui-connection vector) int) + (gui-control-method-22 (_type_ gui-connection process symbol) none) + (handle-command (_type_ gui-channel gui-channel symbol gui-connection) symbol) + (channel-id-set! (_type_ gui-connection sound-id) int) ) ) diff --git a/test/decompiler/reference/jak2/engine/ui/hud-classes_REF.gc b/test/decompiler/reference/jak2/engine/ui/hud-classes_REF.gc index 125a3ec5842..3353aa50672 100644 --- a/test/decompiler/reference/jak2/engine/ui/hud-classes_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/hud-classes_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 15 of type hud-map ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-map ((this hud-map)) +(defmethod draw ((this hud-map)) (set-hud-piece-position! (-> this sprites 1) (the int (+ 492.0 (* 140.0 (-> this offset)))) @@ -106,7 +106,7 @@ ;; definition for method 16 of type hud-map ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-map ((this hud-map)) +(defmethod update-values ((this hud-map)) (cond ((update! *minimap*) (logior! (-> this flags) (hud-flags show)) @@ -134,7 +134,7 @@ ;; definition for method 17 of type hud-map ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-map ((this hud-map)) +(defmethod init-callback ((this hud-map)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-lower-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -156,7 +156,7 @@ ;; definition for method 15 of type hud-health ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-health ((this hud-health)) +(defmethod draw ((this hud-health)) (set-hud-piece-position! (-> this sprites 8) (the int (+ (* -130.0 (-> this offset)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) @@ -256,7 +256,7 @@ ;; definition for method 16 of type hud-health ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-health ((this hud-health)) +(defmethod update-values ((this hud-health)) (set! (-> this values 0 target) (the int (* 10.0 (-> *target* fact health)))) (set! (-> this values 1 target) (the-as int (-> *target* fact health-pickup-time))) (set! (-> this values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) @@ -271,7 +271,7 @@ ;; definition for method 17 of type hud-health ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-health ((this hud-health)) +(defmethod init-callback ((this hud-health)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-lower-left-1) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -344,7 +344,7 @@ ;; definition for method 15 of type hud-dark-eco-symbol ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-dark-eco-symbol ((this hud-dark-eco-symbol)) +(defmethod draw ((this hud-dark-eco-symbol)) (let ((v1-0 (process-by-name "hud-health" *active-pool*)) (f30-0 (-> this offset)) ) @@ -406,7 +406,7 @@ ;; definition for method 16 of type hud-dark-eco-symbol ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-dark-eco-symbol ((this hud-dark-eco-symbol)) +(defmethod update-values ((this hud-dark-eco-symbol)) (set! (-> this values 0 target) (the int (* 10.0 (-> *target* fact health)))) (set! (-> this values 1 target) (the-as int (-> *target* fact health-pickup-time))) (set! (-> this values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) @@ -428,7 +428,7 @@ ;; definition for method 17 of type hud-dark-eco-symbol ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-dark-eco-symbol ((this hud-dark-eco-symbol)) +(defmethod init-callback ((this hud-dark-eco-symbol)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-lower-left-2) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -444,7 +444,7 @@ ;; definition for method 15 of type hud-skullgem ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-skullgem ((this hud-skullgem)) +(defmethod draw ((this hud-skullgem)) (set-hud-piece-position! (the-as hud-sprite (-> this icons 0 pos)) (the int (+ 60.0 (* -130.0 (-> this offset)))) @@ -473,7 +473,7 @@ ;; definition for method 16 of type hud-skullgem ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-skullgem ((this hud-skullgem)) +(defmethod update-values ((this hud-skullgem)) (set! (-> this values 0 target) (the int (-> *target* game gem))) ((method-of-type hud update-values) this) 0 @@ -482,7 +482,7 @@ ;; definition for method 17 of type hud-skullgem ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-skullgem ((this hud-skullgem)) +(defmethod init-callback ((this hud-skullgem)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-center-left) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -502,7 +502,7 @@ ;; definition for method 15 of type hud-skill ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-skill ((this hud-skill)) +(defmethod draw ((this hud-skill)) (set-hud-piece-position! (the-as hud-sprite (-> this icons 0 pos)) (the int (+ 60.0 (* -130.0 (-> this offset)))) @@ -537,7 +537,7 @@ ;; definition for method 16 of type hud-skill ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-skill ((this hud-skill)) +(defmethod update-values ((this hud-skill)) (set! (-> this values 0 target) (the int (-> *target* game skill))) ((method-of-type hud update-values) this) 0 @@ -546,7 +546,7 @@ ;; definition for method 17 of type hud-skill ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-skill ((this hud-skill)) +(defmethod init-callback ((this hud-skill)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-left) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -571,7 +571,7 @@ ;; definition for method 25 of type hud-skill ;; WARN: Return type mismatch int vs none. -(defmethod update-value-callback hud-skill ((this hud-skill) (arg0 int) (arg1 int)) +(defmethod update-value-callback ((this hud-skill) (arg0 int) (arg1 int)) (if (> arg1 0) (sound-play "skill-pickup" :pitch 0.5) ) @@ -581,7 +581,7 @@ ;; definition for method 15 of type hud-score ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-score ((this hud-score)) +(defmethod draw ((this hud-score)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 480.0 (* 130.0 (-> this offset)))) @@ -596,7 +596,7 @@ ;; definition for method 16 of type hud-score ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-score ((this hud-score)) +(defmethod update-values ((this hud-score)) (set! (-> this values 0 target) (the int (-> *game-info* score))) ((method-of-type hud update-values) this) 0 @@ -605,7 +605,7 @@ ;; definition for method 17 of type hud-score ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-score ((this hud-score)) +(defmethod init-callback ((this hud-score)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-center-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -623,7 +623,7 @@ ;; definition for method 15 of type hud-timer ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-timer ((this hud-timer)) +(defmethod draw ((this hud-timer)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 264 @@ -663,7 +663,7 @@ ;; definition for method 16 of type hud-timer ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-timer ((this hud-timer)) +(defmethod update-values ((this hud-timer)) (set! (-> this values 0 target) (/ (-> *game-info* timer) #x4650)) (set! (-> this values 1 target) (/ (mod (-> *game-info* timer) #x4650) 300)) (let ((v1-8 (abs (- (-> this values 1 target) (-> this values 2 target))))) @@ -683,7 +683,7 @@ ;; definition for method 17 of type hud-timer ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-timer ((this hud-timer)) +(defmethod init-callback ((this hud-timer)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -705,7 +705,7 @@ ;; definition for method 15 of type hud-big-score ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-big-score ((this hud-big-score)) +(defmethod draw ((this hud-big-score)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 264 @@ -720,7 +720,7 @@ ;; definition for method 16 of type hud-big-score ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-big-score ((this hud-big-score)) +(defmethod update-values ((this hud-big-score)) (set! (-> this values 0 target) (the int (-> *game-info* score))) ((method-of-type hud update-values) this) 0 @@ -729,7 +729,7 @@ ;; definition for method 17 of type hud-big-score ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-big-score ((this hud-big-score)) +(defmethod init-callback ((this hud-big-score)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -748,7 +748,7 @@ ;; definition for method 15 of type hud-goal ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-goal ((this hud-goal)) +(defmethod draw ((this hud-goal)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 65.0 (* -130.0 (-> this offset)))) @@ -764,7 +764,7 @@ ;; definition for method 16 of type hud-goal ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-goal ((this hud-goal)) +(defmethod update-values ((this hud-goal)) (set! (-> this values 0 target) (the int (-> *game-info* goal))) ((method-of-type hud update-values) this) 0 @@ -773,7 +773,7 @@ ;; definition for method 17 of type hud-goal ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-goal ((this hud-goal)) +(defmethod init-callback ((this hud-goal)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -802,7 +802,7 @@ ;; definition for method 15 of type hud-miss ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-miss ((this hud-miss)) +(defmethod draw ((this hud-miss)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 448.0 (* 130.0 (-> this offset)))) @@ -825,7 +825,7 @@ ;; definition for method 16 of type hud-miss ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-miss ((this hud-miss)) +(defmethod update-values ((this hud-miss)) (set! (-> this values 0 target) (the int (-> *game-info* miss))) (set! (-> this values 1 target) (the int (-> *game-info* miss-max))) ((method-of-type hud update-values) this) @@ -835,7 +835,7 @@ ;; definition for method 17 of type hud-miss ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-miss ((this hud-miss)) +(defmethod init-callback ((this hud-miss)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -857,7 +857,7 @@ ;; definition for method 15 of type hud-progress ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-progress ((this hud-progress)) +(defmethod draw ((this hud-progress)) (with-pp (let ((f0-0 (if (process-by-name "hud-timer" *active-pool*) 65.0 @@ -886,7 +886,7 @@ ;; definition for method 16 of type hud-progress ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-progress ((this hud-progress)) +(defmethod update-values ((this hud-progress)) (set! (-> this values 0 target) (the int (* 1000.0 (-> *game-info* distance)))) (logclear! (-> this flags) (hud-flags disable)) ((method-of-type hud update-values) this) @@ -896,7 +896,7 @@ ;; definition for method 17 of type hud-progress ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-progress ((this hud-progress)) +(defmethod init-callback ((this hud-progress)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-center-2) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -921,7 +921,7 @@ ;; definition for method 15 of type hud-gun ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-gun ((this hud-gun)) +(defmethod draw ((this hud-gun)) (local-vars (s3-0 int) (sv-16 int) (sv-32 dma-buffer)) (let ((s4-0 0) (s5-0 0) @@ -1108,7 +1108,7 @@ ;; definition for method 16 of type hud-gun ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-gun ((this hud-gun)) +(defmethod update-values ((this hud-gun)) (cond ((focus-test? *target* gun) (set! (-> this values 0 target) (the-as int (-> *target* gun gun-type))) @@ -1129,7 +1129,7 @@ ;; definition for method 17 of type hud-gun ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-gun ((this hud-gun)) +(defmethod init-callback ((this hud-gun)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -1148,7 +1148,7 @@ ;; definition for method 15 of type hud-samos-young ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-samos-young ((this hud-samos-young)) +(defmethod draw ((this hud-samos-young)) (set-hud-piece-position! (-> this sprites 2) (the int (+ 30.0 (* -130.0 (-> this offset)))) @@ -1165,7 +1165,7 @@ ;; definition for method 16 of type hud-samos-young ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-samos-young ((this hud-samos-young)) +(defmethod update-values ((this hud-samos-young)) (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) ((method-of-type hud update-values) this) 0 @@ -1174,7 +1174,7 @@ ;; definition for method 17 of type hud-samos-young ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-samos-young ((this hud-samos-young)) +(defmethod init-callback ((this hud-samos-young)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc index 28cc8c8e1f8..45246ae1746 100644 --- a/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc @@ -3,20 +3,17 @@ ;; definition of type hud-string (deftype hud-string (basic) - ((text string :offset-assert 4) - (scale float :offset-assert 8) - (color font-color :offset-assert 12) - (flags font-flags :offset-assert 16) - (pos int32 4 :offset 32) + ((text string) + (scale float) + (color font-color) + (flags font-flags) + (pos int32 4 :offset 32) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type hud-string -(defmethod inspect hud-string ((this hud-string)) +(defmethod inspect ((this hud-string)) (when (not this) (set! this this) (goto cfg-4) @@ -33,26 +30,23 @@ ;; definition of type hud-sprite (deftype hud-sprite (structure) - ((pos vector4w :inline :offset-assert 0) - (color vector4w :inline :offset-assert 16) - (color2 int32 4 :offset 16) - (flags uint32 :offset-assert 32) - (scale-x float :offset-assert 36) - (scale-y float :offset-assert 40) - (angle float :offset-assert 44) - (tex texture :offset-assert 48) + ((pos vector4w :inline) + (color vector4w :inline) + (color2 int32 4 :overlay-at (-> color data 0)) + (flags uint32) + (scale-x float) + (scale-y float) + (angle float) + (tex texture) ) - :method-count-assert 11 - :size-assert #x34 - :flag-assert #xb00000034 (:methods - (draw (_type_ dma-buffer level) none 9) - (hud-sprite-method-10 (_type_ dma-buffer level int int int int) object 10) + (draw (_type_ dma-buffer level) none) + (hud-sprite-method-10 (_type_ dma-buffer level int int int int) object) ) ) ;; definition for method 3 of type hud-sprite -(defmethod inspect hud-sprite ((this hud-sprite)) +(defmethod inspect ((this hud-sprite)) (when (not this) (set! this this) (goto cfg-4) @@ -71,26 +65,23 @@ ;; definition of type hud-box (deftype hud-box (structure) - ((min vector2 :inline :offset-assert 0) - (max vector2 :inline :offset-assert 8) - (color vector4w :inline :offset-assert 16) + ((min vector2 :inline) + (max vector2 :inline) + (color vector4w :inline) ) - :method-count-assert 16 - :size-assert #x20 - :flag-assert #x1000000020 (:methods - (draw-box-prim-only (_type_ dma-buffer) none 9) - (draw-box-alpha-1 (_type_ dma-buffer) none 10) - (draw-box-alpha-2 (_type_ dma-buffer) none 11) - (draw-box-alpha-3 (_type_ dma-buffer) none 12) - (draw-scan-and-line (_type_ dma-buffer float) int 13) - (setup-scissor (_type_ dma-buffer) none 14) - (restore-scissor (_type_ dma-buffer) none 15) + (draw-box-prim-only (_type_ dma-buffer) none) + (draw-box-alpha-1 (_type_ dma-buffer) none) + (draw-box-alpha-2 (_type_ dma-buffer) none) + (draw-box-alpha-3 (_type_ dma-buffer) none) + (draw-scan-and-line (_type_ dma-buffer float) int) + (setup-scissor (_type_ dma-buffer) none) + (restore-scissor (_type_ dma-buffer) none) ) ) ;; definition for method 3 of type hud-box -(defmethod inspect hud-box ((this hud-box)) +(defmethod inspect ((this hud-box)) (when (not this) (set! this this) (goto cfg-4) @@ -105,19 +96,16 @@ ;; definition of type hud-icon (deftype hud-icon (basic) - ((icon (pointer manipy) :offset-assert 4) - (pos int32 4 :offset 16) - (scale-x float :offset-assert 32) - (scale-y float :offset-assert 36) + ((icon (pointer manipy)) + (pos int32 4 :offset 16) + (scale-x float) + (scale-y float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; definition for method 3 of type hud-icon -(defmethod inspect hud-icon ((this hud-icon)) +(defmethod inspect ((this hud-icon)) (when (not this) (set! this this) (goto cfg-4) @@ -133,19 +121,16 @@ ;; definition of type hud-value (deftype hud-value (basic) - ((current int32 :offset-assert 4) - (target int32 :offset-assert 8) - (flags uint16 :offset-assert 12) - (counter uint16 :offset-assert 14) + ((current int32) + (target int32) + (flags uint16) + (counter uint16) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type hud-value -(defmethod inspect hud-value ((this hud-value)) +(defmethod inspect ((this hud-value)) (when (not this) (set! this this) (goto cfg-4) @@ -161,34 +146,30 @@ ;; definition of type hud (deftype hud (process) - ((trigger-time time-frame :offset-assert 128) - (last-hide-time time-frame :offset-assert 136) - (offset float :offset-assert 144) - (flags hud-flags :offset-assert 148) - (values hud-value 8 :inline :offset 148) - (strings hud-string 14 :inline :offset 284) - (sprites hud-sprite 30 :inline :offset 960) - (icons hud-icon 2 :inline :offset 2876) - (gui-id sound-id :offset 2976) + ((trigger-time time-frame) + (last-hide-time time-frame) + (offset float) + (flags hud-flags) + (values hud-value 8 :inline :overlay-at flags) + (strings hud-string 14 :inline :offset 284) + (sprites hud-sprite 30 :inline :offset 960) + (icons hud-icon 2 :inline :offset 2876) + (gui-id sound-id :offset 2976) ) - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 (:methods - (hidden? (_type_) symbol 14) - (draw (_type_) none 15) - (update-values (_type_) none 16) - (init-callback (_type_) none 17) - (event-callback (_type_ process int symbol event-message-block) symbol 18) - (hud-method-19 (_type_) none 19) - (hud-method-20 (_type_) none 20) - (hud-method-21 (_type_) none 21) - (hud-method-22 (_type_) none 22) - (hud-method-23 (_type_) none 23) - (check-ready-and-maybe-show (_type_ symbol) symbol 24) - (update-value-callback (_type_ int int) none 25) - (alloc-string-if-needed (_type_ int) none 26) + (hidden? (_type_) symbol) + (draw (_type_) none) + (update-values (_type_) none) + (init-callback (_type_) none) + (event-callback (_type_ process int symbol event-message-block) symbol) + (hud-method-19 (_type_) none) + (hud-method-20 (_type_) none) + (hud-method-21 (_type_) none) + (hud-method-22 (_type_) none) + (hud-method-23 (_type_) none) + (check-ready-and-maybe-show (_type_ symbol) symbol) + (update-value-callback (_type_ int int) none) + (alloc-string-if-needed (_type_ int) none) ) (:states hud-arriving @@ -199,7 +180,7 @@ ) ;; definition for method 3 of type hud -(defmethod inspect hud ((this hud)) +(defmethod inspect ((this hud)) (when (not this) (set! this this) (goto cfg-4) @@ -223,14 +204,10 @@ ;; definition of type hud-ashelin (deftype hud-ashelin (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-ashelin -(defmethod inspect hud-ashelin ((this hud-ashelin)) +(defmethod inspect ((this hud-ashelin)) (when (not this) (set! this this) (goto cfg-4) @@ -245,14 +222,10 @@ ;; definition of type hud-cargo (deftype hud-cargo (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-cargo -(defmethod inspect hud-cargo ((this hud-cargo)) +(defmethod inspect ((this hud-cargo)) (when (not this) (set! this this) (goto cfg-4) @@ -267,14 +240,10 @@ ;; definition of type hud-citizen (deftype hud-citizen (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-citizen -(defmethod inspect hud-citizen ((this hud-citizen)) +(defmethod inspect ((this hud-citizen)) (when (not this) (set! this this) (goto cfg-4) @@ -289,14 +258,10 @@ ;; definition of type hud-cpanel (deftype hud-cpanel (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-cpanel -(defmethod inspect hud-cpanel ((this hud-cpanel)) +(defmethod inspect ((this hud-cpanel)) (when (not this) (set! this this) (goto cfg-4) @@ -311,14 +276,10 @@ ;; definition of type hud-dig-clasp (deftype hud-dig-clasp (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-dig-clasp -(defmethod inspect hud-dig-clasp ((this hud-dig-clasp)) +(defmethod inspect ((this hud-dig-clasp)) (when (not this) (set! this this) (goto cfg-4) @@ -333,14 +294,10 @@ ;; definition of type hud-gun (deftype hud-gun (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-gun -(defmethod inspect hud-gun ((this hud-gun)) +(defmethod inspect ((this hud-gun)) (when (not this) (set! this this) (goto cfg-4) @@ -355,14 +312,10 @@ ;; definition of type hud-health (deftype hud-health (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-health -(defmethod inspect hud-health ((this hud-health)) +(defmethod inspect ((this hud-health)) (when (not this) (set! this this) (goto cfg-4) @@ -377,14 +330,10 @@ ;; definition of type hud-dark-eco-symbol (deftype hud-dark-eco-symbol (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-dark-eco-symbol -(defmethod inspect hud-dark-eco-symbol ((this hud-dark-eco-symbol)) +(defmethod inspect ((this hud-dark-eco-symbol)) (when (not this) (set! this this) (goto cfg-4) @@ -399,14 +348,10 @@ ;; definition of type hud-helldog (deftype hud-helldog (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-helldog -(defmethod inspect hud-helldog ((this hud-helldog)) +(defmethod inspect ((this hud-helldog)) (when (not this) (set! this this) (goto cfg-4) @@ -421,14 +366,10 @@ ;; definition of type hud-lurker (deftype hud-lurker (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-lurker -(defmethod inspect hud-lurker ((this hud-lurker)) +(defmethod inspect ((this hud-lurker)) (when (not this) (set! this this) (goto cfg-4) @@ -443,14 +384,10 @@ ;; definition of type hud-map (deftype hud-map (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-map -(defmethod inspect hud-map ((this hud-map)) +(defmethod inspect ((this hud-map)) (when (not this) (set! this this) (goto cfg-4) @@ -465,14 +402,10 @@ ;; definition of type hud-moneybag (deftype hud-moneybag (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-moneybag -(defmethod inspect hud-moneybag ((this hud-moneybag)) +(defmethod inspect ((this hud-moneybag)) (when (not this) (set! this this) (goto cfg-4) @@ -487,14 +420,10 @@ ;; definition of type hud-pegasus (deftype hud-pegasus (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-pegasus -(defmethod inspect hud-pegasus ((this hud-pegasus)) +(defmethod inspect ((this hud-pegasus)) (when (not this) (set! this this) (goto cfg-4) @@ -509,14 +438,10 @@ ;; definition of type hud-plasmite (deftype hud-plasmite (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-plasmite -(defmethod inspect hud-plasmite ((this hud-plasmite)) +(defmethod inspect ((this hud-plasmite)) (when (not this) (set! this this) (goto cfg-4) @@ -531,14 +456,10 @@ ;; definition of type hud-dig-button (deftype hud-dig-button (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-dig-button -(defmethod inspect hud-dig-button ((this hud-dig-button)) +(defmethod inspect ((this hud-dig-button)) (when (not this) (set! this this) (goto cfg-4) @@ -553,14 +474,10 @@ ;; definition of type hud-predator (deftype hud-predator (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-predator -(defmethod inspect hud-predator ((this hud-predator)) +(defmethod inspect ((this hud-predator)) (when (not this) (set! this this) (goto cfg-4) @@ -575,14 +492,10 @@ ;; definition of type hud-heatmeter (deftype hud-heatmeter (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-heatmeter -(defmethod inspect hud-heatmeter ((this hud-heatmeter)) +(defmethod inspect ((this hud-heatmeter)) (when (not this) (set! this this) (goto cfg-4) @@ -597,14 +510,10 @@ ;; definition of type hud-progress (deftype hud-progress (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-progress -(defmethod inspect hud-progress ((this hud-progress)) +(defmethod inspect ((this hud-progress)) (when (not this) (set! this this) (goto cfg-4) @@ -619,14 +528,10 @@ ;; definition of type hud-rocketsensor (deftype hud-rocketsensor (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-rocketsensor -(defmethod inspect hud-rocketsensor ((this hud-rocketsensor)) +(defmethod inspect ((this hud-rocketsensor)) (when (not this) (set! this this) (goto cfg-4) @@ -641,14 +546,10 @@ ;; definition of type hud-ruffians (deftype hud-ruffians (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-ruffians -(defmethod inspect hud-ruffians ((this hud-ruffians)) +(defmethod inspect ((this hud-ruffians)) (when (not this) (set! this this) (goto cfg-4) @@ -663,14 +564,10 @@ ;; definition of type hud-score (deftype hud-score (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-score -(defmethod inspect hud-score ((this hud-score)) +(defmethod inspect ((this hud-score)) (when (not this) (set! this this) (goto cfg-4) @@ -685,14 +582,10 @@ ;; definition of type hud-sig (deftype hud-sig (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-sig -(defmethod inspect hud-sig ((this hud-sig)) +(defmethod inspect ((this hud-sig)) (when (not this) (set! this this) (goto cfg-4) @@ -707,14 +600,10 @@ ;; definition of type hud-skill (deftype hud-skill (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-skill -(defmethod inspect hud-skill ((this hud-skill)) +(defmethod inspect ((this hud-skill)) (when (not this) (set! this this) (goto cfg-4) @@ -729,14 +618,10 @@ ;; definition of type hud-skullgem (deftype hud-skullgem (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-skullgem -(defmethod inspect hud-skullgem ((this hud-skullgem)) +(defmethod inspect ((this hud-skullgem)) (when (not this) (set! this this) (goto cfg-4) @@ -751,14 +636,10 @@ ;; definition of type hud-timer (deftype hud-timer (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-timer -(defmethod inspect hud-timer ((this hud-timer)) +(defmethod inspect ((this hud-timer)) (when (not this) (set! this this) (goto cfg-4) @@ -773,14 +654,10 @@ ;; definition of type hud-turret (deftype hud-turret (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-turret -(defmethod inspect hud-turret ((this hud-turret)) +(defmethod inspect ((this hud-turret)) (when (not this) (set! this this) (goto cfg-4) @@ -795,14 +672,10 @@ ;; definition of type hud-squid (deftype hud-squid (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-squid -(defmethod inspect hud-squid ((this hud-squid)) +(defmethod inspect ((this hud-squid)) (when (not this) (set! this this) (goto cfg-4) @@ -817,14 +690,10 @@ ;; definition of type hud-gunturret (deftype hud-gunturret (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-gunturret -(defmethod inspect hud-gunturret ((this hud-gunturret)) +(defmethod inspect ((this hud-gunturret)) (when (not this) (set! this this) (goto cfg-4) @@ -839,14 +708,10 @@ ;; definition of type hud-gruntegg (deftype hud-gruntegg (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-gruntegg -(defmethod inspect hud-gruntegg ((this hud-gruntegg)) +(defmethod inspect ((this hud-gruntegg)) (when (not this) (set! this this) (goto cfg-4) @@ -861,14 +726,10 @@ ;; definition of type hud-crimsonhover (deftype hud-crimsonhover (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-crimsonhover -(defmethod inspect hud-crimsonhover ((this hud-crimsonhover)) +(defmethod inspect ((this hud-crimsonhover)) (when (not this) (set! this this) (goto cfg-4) @@ -883,14 +744,10 @@ ;; definition of type hud-metalkor (deftype hud-metalkor (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-metalkor -(defmethod inspect hud-metalkor ((this hud-metalkor)) +(defmethod inspect ((this hud-metalkor)) (when (not this) (set! this this) (goto cfg-4) @@ -905,14 +762,10 @@ ;; definition of type hud-big-score (deftype hud-big-score (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-big-score -(defmethod inspect hud-big-score ((this hud-big-score)) +(defmethod inspect ((this hud-big-score)) (when (not this) (set! this this) (goto cfg-4) @@ -927,14 +780,10 @@ ;; definition of type hud-goal (deftype hud-goal (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-goal -(defmethod inspect hud-goal ((this hud-goal)) +(defmethod inspect ((this hud-goal)) (when (not this) (set! this this) (goto cfg-4) @@ -949,14 +798,10 @@ ;; definition of type hud-miss (deftype hud-miss (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-miss -(defmethod inspect hud-miss ((this hud-miss)) +(defmethod inspect ((this hud-miss)) (when (not this) (set! this this) (goto cfg-4) @@ -971,14 +816,10 @@ ;; definition of type hud-race-timer (deftype hud-race-timer (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-race-timer -(defmethod inspect hud-race-timer ((this hud-race-timer)) +(defmethod inspect ((this hud-race-timer)) (when (not this) (set! this this) (goto cfg-4) @@ -993,14 +834,10 @@ ;; definition of type hud-race-lap-counter (deftype hud-race-lap-counter (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-race-lap-counter -(defmethod inspect hud-race-lap-counter ((this hud-race-lap-counter)) +(defmethod inspect ((this hud-race-lap-counter)) (when (not this) (set! this this) (goto cfg-4) @@ -1015,14 +852,10 @@ ;; definition of type hud-race-turbo-counter (deftype hud-race-turbo-counter (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-race-turbo-counter -(defmethod inspect hud-race-turbo-counter ((this hud-race-turbo-counter)) +(defmethod inspect ((this hud-race-turbo-counter)) (when (not this) (set! this this) (goto cfg-4) @@ -1037,14 +870,10 @@ ;; definition of type hud-race-position (deftype hud-race-position (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-race-position -(defmethod inspect hud-race-position ((this hud-race-position)) +(defmethod inspect ((this hud-race-position)) (when (not this) (set! this this) (goto cfg-4) @@ -1059,14 +888,10 @@ ;; definition of type hud-race-map (deftype hud-race-map (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-race-map -(defmethod inspect hud-race-map ((this hud-race-map)) +(defmethod inspect ((this hud-race-map)) (when (not this) (set! this this) (goto cfg-4) @@ -1081,14 +906,10 @@ ;; definition of type hud-samos-old (deftype hud-samos-old (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-samos-old -(defmethod inspect hud-samos-old ((this hud-samos-old)) +(defmethod inspect ((this hud-samos-old)) (when (not this) (set! this this) (goto cfg-4) @@ -1103,14 +924,10 @@ ;; definition of type hud-samos-young (deftype hud-samos-young (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-samos-young -(defmethod inspect hud-samos-young ((this hud-samos-young)) +(defmethod inspect ((this hud-samos-young)) (when (not this) (set! this this) (goto cfg-4) @@ -1125,14 +942,10 @@ ;; definition of type hud-lurker-button (deftype hud-lurker-button (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-lurker-button -(defmethod inspect hud-lurker-button ((this hud-lurker-button)) +(defmethod inspect ((this hud-lurker-button)) (when (not this) (set! this this) (goto cfg-4) @@ -1147,14 +960,10 @@ ;; definition of type hud-widow (deftype hud-widow (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-widow -(defmethod inspect hud-widow ((this hud-widow)) +(defmethod inspect ((this hud-widow)) (when (not this) (set! this this) (goto cfg-4) @@ -1169,14 +978,10 @@ ;; definition of type hud-race-final-stats (deftype hud-race-final-stats (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-race-final-stats -(defmethod inspect hud-race-final-stats ((this hud-race-final-stats)) +(defmethod inspect ((this hud-race-final-stats)) (when (not this) (set! this this) (goto cfg-4) @@ -1191,14 +996,10 @@ ;; definition of type hud-mech-air-tank (deftype hud-mech-air-tank (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-mech-air-tank -(defmethod inspect hud-mech-air-tank ((this hud-mech-air-tank)) +(defmethod inspect ((this hud-mech-air-tank)) (when (not this) (set! this this) (goto cfg-4) @@ -1213,14 +1014,10 @@ ;; definition of type hud-homing-beacon (deftype hud-homing-beacon (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-homing-beacon -(defmethod inspect hud-homing-beacon ((this hud-homing-beacon)) +(defmethod inspect ((this hud-homing-beacon)) (when (not this) (set! this this) (goto cfg-4) @@ -1235,14 +1032,10 @@ ;; definition of type hud-dark-eco-pickup (deftype hud-dark-eco-pickup (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-dark-eco-pickup -(defmethod inspect hud-dark-eco-pickup ((this hud-dark-eco-pickup)) +(defmethod inspect ((this hud-dark-eco-pickup)) (when (not this) (set! this this) (goto cfg-4) @@ -1257,14 +1050,10 @@ ;; definition of type hud-green-eco-pickup (deftype hud-green-eco-pickup (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-green-eco-pickup -(defmethod inspect hud-green-eco-pickup ((this hud-green-eco-pickup)) +(defmethod inspect ((this hud-green-eco-pickup)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc index c0362a953e8..5bb1102c1c0 100644 --- a/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc @@ -3,22 +3,19 @@ ;; definition of type minimap-class-node (deftype minimap-class-node (structure) - ((default-position vector :inline :offset-assert 0) - (flags minimap-flag :offset-assert 16) - (class minimap-class :offset-assert 18) - (name basic :offset-assert 20) - (icon-xy vector2ub :inline :offset-assert 24) - (scale float :offset-assert 28) - (color rgba :offset-assert 32) + ((default-position vector :inline) + (flags minimap-flag) + (class minimap-class) + (name basic) + (icon-xy vector2ub :inline) + (scale float) + (color rgba) ) :pack-me - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type minimap-class-node -(defmethod inspect minimap-class-node ((this minimap-class-node)) +(defmethod inspect ((this minimap-class-node)) (when (not this) (set! this this) (goto cfg-179) @@ -313,24 +310,21 @@ ;; definition of type connection-minimap (deftype connection-minimap (connection-pers) - ((handle handle :offset 8) - (position object :offset 16) - (alpha float :offset 20) - (class minimap-class-node :offset 24) - (flags minimap-flag :offset 28) - (node uint16 :offset 30) - (edge-ry float :offset-assert 32) - (last-world-pos vector :inline :offset-assert 48) - (last-relative-pos vector :inline :offset-assert 64) + ((handle handle :overlay-at update-time) + (position object :overlay-at param-quat) + (alpha float :overlay-at (-> param-float 1)) + (class minimap-class-node :overlay-at (-> param-float 2)) + (flags minimap-flag :overlay-at (-> param 3)) + (node uint16 :offset 30) + (edge-ry float) + (last-world-pos vector :inline) + (last-relative-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type connection-minimap ;; INFO: Used lq/sq -(defmethod inspect connection-minimap ((this connection-minimap)) +(defmethod inspect ((this connection-minimap)) (when (not this) (set! this this) (goto cfg-48) @@ -422,16 +416,13 @@ ;; definition of type engine-minimap (deftype engine-minimap (engine-pers) - ((alive-list connection-minimap :override) - (dead-list connection-minimap :override) + ((alive-list connection-minimap :override) + (dead-list connection-minimap :override) ) - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 ) ;; definition for method 3 of type engine-minimap -(defmethod inspect engine-minimap ((this engine-minimap)) +(defmethod inspect ((this engine-minimap)) (when (not this) (set! this this) (goto cfg-4) @@ -451,26 +442,23 @@ ;; definition of type minimap-trail (deftype minimap-trail (structure) - ((used-by connection-minimap :offset-assert 0) - (search-id uint32 :offset-assert 4) - (node-count int16 :offset-assert 8) - (goal-node-id int32 :offset-assert 12) - (node-path-dist float :offset-assert 16) - (last-updated uint64 :offset-assert 24) - (cached-info trail-cached-search-info :inline :offset-assert 32) - (node-id uint16 64 :offset-assert 80) + ((used-by connection-minimap) + (search-id uint32) + (node-count int16) + (goal-node-id int32) + (node-path-dist float) + (last-updated uint64) + (cached-info trail-cached-search-info :inline) + (node-id uint16 64) ) - :method-count-assert 11 - :size-assert #xd0 - :flag-assert #xb000000d0 (:methods - (get-distance-with-path (_type_ vector vector) float 9) - (reset (_type_) none 10) + (get-distance-with-path (_type_ vector vector) float) + (reset (_type_) none) ) ) ;; definition for method 3 of type minimap-trail -(defmethod inspect minimap-trail ((this minimap-trail)) +(defmethod inspect ((this minimap-trail)) (when (not this) (set! this this) (goto cfg-4) @@ -490,19 +478,16 @@ ;; definition of type minimap-draw-work (deftype minimap-draw-work (structure) - ((buf dma-buffer :offset-assert 0) - (justify-right symbol :offset-assert 4) - (draw-pos vector4w :inline :offset-assert 16) - (mat matrix :inline :offset-assert 32) - (corner vector 4 :inline :offset-assert 96) + ((buf dma-buffer) + (justify-right symbol) + (draw-pos vector4w :inline) + (mat matrix :inline) + (corner vector 4 :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type minimap-draw-work -(defmethod inspect minimap-draw-work ((this minimap-draw-work)) +(defmethod inspect ((this minimap-draw-work)) (when (not this) (set! this this) (goto cfg-4) @@ -519,62 +504,59 @@ ;; definition of type minimap (deftype minimap (structure) - ((draw-tmpl dma-gif-packet :inline :offset-assert 0) - (draw2-tmpl dma-gif-packet :inline :offset-assert 32) - (draw3-tmpl dma-gif-packet :inline :offset-assert 64) - (draw4-tmpl dma-gif-packet :inline :offset-assert 96) - (sprite-tmpl dma-gif-packet :inline :offset-assert 128) - (adgif-tmpl dma-gif-packet :inline :offset-assert 160) - (color vector4w :inline :offset-assert 192) - (offset vector :inline :offset-assert 208) - (minimap-corner vector :inline :offset-assert 224) - (last-name string :offset-assert 240) - (last-tex basic :offset-assert 244) - (target-inv-scale float :offset-assert 248) - (map-bits uint64 :offset-assert 256) - (level level :offset-assert 264) - (ctywide level :offset-assert 268) - (inv-scale float :offset 212) - (fade float :offset 220) - (engine engine-minimap :offset-assert 272) - (engine-key uint32 :offset-assert 276) - (trail minimap-trail 6 :inline :offset-assert 288) - (race-tex texture :offset-assert 1536) - (race-scale float :offset-assert 1540) - (race-level level :offset-assert 1544) - (sprite2-tmpl dma-gif-packet :inline :offset-assert 1552) - (race-corner vector :inline :offset-assert 1584) - (goal-time float :offset-assert 1600) - (frustum-alpha float :offset-assert 1604) + ((draw-tmpl dma-gif-packet :inline) + (draw2-tmpl dma-gif-packet :inline) + (draw3-tmpl dma-gif-packet :inline) + (draw4-tmpl dma-gif-packet :inline) + (sprite-tmpl dma-gif-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (color vector4w :inline) + (offset vector :inline) + (minimap-corner vector :inline) + (last-name string) + (last-tex basic) + (target-inv-scale float) + (map-bits uint64) + (level level) + (ctywide level) + (inv-scale float :overlay-at (-> offset data 1)) + (fade float :overlay-at (-> offset data 3)) + (engine engine-minimap) + (engine-key uint32) + (trail minimap-trail 6 :inline) + (race-tex texture) + (race-scale float) + (race-level level) + (sprite2-tmpl dma-gif-packet :inline) + (race-corner vector :inline) + (goal-time float) + (frustum-alpha float) ) - :method-count-assert 28 - :size-assert #x648 - :flag-assert #x1c00000648 (:methods - (debug-draw (_type_) none 9) - (get-trail-for-connection (_type_ connection-minimap symbol) minimap-trail 10) - (get-icon-draw-pos (_type_ connection-minimap minimap-trail vector float vector) symbol 11) - (add-icon! (_type_ process uint int vector int) connection-minimap 12) - (free-trail-by-connection (_type_ connection-minimap) none 13) - (update-trails (_type_) none 14) - (draw-1 (_type_ dma-buffer vector4w symbol) none 15) - (draw-connection (_type_ minimap-draw-work connection-minimap) none 16) - (draw-frustum-1 (_type_ minimap-draw-work connection-minimap) none 17) - (draw-frustum-2 (_type_ minimap-draw-work connection-minimap) none 18) - (sub-draw-1-2 (_type_ minimap-draw-work) none 19) - (update! (_type_) symbol 20) - (sub-draw-1-1 (_type_ minimap-draw-work) none 21) - (set-color (_type_ vector) none 22) - (draw-racer-2 (_type_ minimap-draw-work connection-minimap) none 23) - (draw-sprite2 (_type_ dma-buffer vector4w symbol) none 24) - (set-race-texture (_type_ texture float level) none 25) - (draw-racer-1 (_type_ minimap-draw-work connection-minimap float float float) none 26) - (set-race-corner (_type_ float float) none 27) + (debug-draw (_type_) none) + (get-trail-for-connection (_type_ connection-minimap symbol) minimap-trail) + (get-icon-draw-pos (_type_ connection-minimap minimap-trail vector float vector) symbol) + (add-icon! (_type_ process uint int vector int) connection-minimap) + (free-trail-by-connection (_type_ connection-minimap) none) + (update-trails (_type_) none) + (draw-1 (_type_ dma-buffer vector4w symbol) none) + (draw-connection (_type_ minimap-draw-work connection-minimap) none) + (draw-frustum-1 (_type_ minimap-draw-work connection-minimap) none) + (draw-frustum-2 (_type_ minimap-draw-work connection-minimap) none) + (sub-draw-1-2 (_type_ minimap-draw-work) none) + (update! (_type_) symbol) + (sub-draw-1-1 (_type_ minimap-draw-work) none) + (set-color (_type_ vector) none) + (draw-racer-2 (_type_ minimap-draw-work connection-minimap) none) + (draw-sprite2 (_type_ dma-buffer vector4w symbol) none) + (set-race-texture (_type_ texture float level) none) + (draw-racer-1 (_type_ minimap-draw-work connection-minimap float float float) none) + (set-race-corner (_type_ float float) none) ) ) ;; definition for method 3 of type minimap -(defmethod inspect minimap ((this minimap)) +(defmethod inspect ((this minimap)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc b/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc index 292585d4b16..da9aabcc73d 100644 --- a/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc @@ -3,15 +3,12 @@ ;; definition of type minimap-texture-name-array (deftype minimap-texture-name-array (structure) - ((data string 35 :offset-assert 0) + ((data string 35) ) - :method-count-assert 9 - :size-assert #x8c - :flag-assert #x90000008c ) ;; definition for method 3 of type minimap-texture-name-array -(defmethod inspect minimap-texture-name-array ((this minimap-texture-name-array)) +(defmethod inspect ((this minimap-texture-name-array)) (when (not this) (set! this this) (goto cfg-4) @@ -24,15 +21,12 @@ ;; definition of type minimap-corner-array (deftype minimap-corner-array (structure) - ((data vector 35 :inline :offset-assert 0) + ((data vector 35 :inline) ) - :method-count-assert 9 - :size-assert #x230 - :flag-assert #x900000230 ) ;; definition for method 3 of type minimap-corner-array -(defmethod inspect minimap-corner-array ((this minimap-corner-array)) +(defmethod inspect ((this minimap-corner-array)) (when (not this) (set! this this) (goto cfg-4) @@ -862,7 +856,7 @@ ;; definition for method 9 of type minimap ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw minimap ((this minimap)) +(defmethod debug-draw ((this minimap)) (when *trail-graph* (dotimes (s5-0 6) (let ((s4-0 (-> this trail s5-0))) @@ -912,7 +906,7 @@ ;; definition for method 14 of type minimap ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod update-trails minimap ((this minimap)) +(defmethod update-trails ((this minimap)) "Main function to do trail search per-frame" (let ((s5-0 *trail-graph*)) (when s5-0 @@ -1023,7 +1017,7 @@ ) ;; definition for method 10 of type minimap -(defmethod get-trail-for-connection minimap ((this minimap) (arg0 connection-minimap) (arg1 symbol)) +(defmethod get-trail-for-connection ((this minimap) (arg0 connection-minimap) (arg1 symbol)) "Get a trail for connection. If arg1 is set, allow allocating a new one." (local-vars (gp-0 minimap-trail)) (countdown (v1-0 6) @@ -1056,7 +1050,7 @@ ;; definition for method 13 of type minimap ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 13 minimap) has a return type of none, but the expression builder found a return statement. -(defmethod free-trail-by-connection minimap ((this minimap) (arg0 connection-minimap)) +(defmethod free-trail-by-connection ((this minimap) (arg0 connection-minimap)) "Free the trail associated with this connection." (countdown (v1-0 6) (let ((a2-3 (-> this trail v1-0))) @@ -1073,7 +1067,7 @@ ;; definition for method 10 of type minimap-trail ;; WARN: Return type mismatch int vs none. -(defmethod reset minimap-trail ((this minimap-trail)) +(defmethod reset ((this minimap-trail)) (set! (-> this node-count) -1) (set! (-> this search-id) (the-as uint 0)) (set! (-> this last-updated) (the-as uint 0)) @@ -1083,7 +1077,7 @@ ;; definition for method 11 of type minimap ;; INFO: Used lq/sq -(defmethod get-icon-draw-pos minimap ((this minimap) (arg0 connection-minimap) (arg1 minimap-trail) (arg2 vector) (arg3 float) (arg4 vector)) +(defmethod get-icon-draw-pos ((this minimap) (arg0 connection-minimap) (arg1 minimap-trail) (arg2 vector) (arg3 float) (arg4 vector)) "Follow the path from the start until it reaches the border of the map, then get this position." (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 4))) (vector-reset! (-> s5-0 2)) @@ -1126,7 +1120,7 @@ ) ;; definition for method 9 of type minimap-trail -(defmethod get-distance-with-path minimap-trail ((this minimap-trail) (arg0 vector) (arg1 vector)) +(defmethod get-distance-with-path ((this minimap-trail) (arg0 vector) (arg1 vector)) "Assuming we go from a to b, using this path in the middle, how long is it?" 0.0 (let ((s4-0 *trail-graph*)) @@ -1150,7 +1144,7 @@ ) ;; definition for method 2 of type connection-minimap -(defmethod print connection-minimap ((this connection-minimap)) +(defmethod print ((this connection-minimap)) (format #t "#" @@ -1163,7 +1157,7 @@ ) ;; definition for method 3 of type engine-minimap -(defmethod inspect engine-minimap ((this engine-minimap)) +(defmethod inspect ((this engine-minimap)) (call-parent-method this) (let ((s5-0 0) (s4-0 (the-as connection-pers (-> *minimap* engine alive-list))) @@ -1181,7 +1175,7 @@ ;; definition for method 14 of type engine-minimap ;; WARN: Return type mismatch int vs none. -(defmethod run-pending-updates! engine-minimap ((this engine-minimap) (arg0 time-frame)) +(defmethod run-pending-updates! ((this engine-minimap) (arg0 time-frame)) (let ((s2-0 (the-as (pointer connection-pers) (&-> this alive-list))) (s3-0 (-> this alive-list)) ) @@ -1253,7 +1247,7 @@ ;; definition for method 12 of type minimap ;; INFO: Used lq/sq -(defmethod add-icon! minimap ((this minimap) (arg0 process) (arg1 uint) (arg2 int) (arg3 vector) (arg4 int)) +(defmethod add-icon! ((this minimap) (arg0 process) (arg1 uint) (arg2 int) (arg3 vector) (arg4 int)) "Add an icon to the map!" (when (not arg2) (let ((v1-3 (+ (-> *minimap* engine-key) 1))) @@ -1292,7 +1286,7 @@ ;; definition for method 10 of type engine-minimap ;; WARN: Function (method 10 engine-minimap) has a return type of none, but the expression builder found a return statement. -(defmethod kill-callback engine-minimap ((this engine-minimap) (arg0 connection-pers)) +(defmethod kill-callback ((this engine-minimap) (arg0 connection-pers)) (if (not arg0) (return #f) ) @@ -1333,7 +1327,7 @@ ;; definition for method 20 of type minimap ;; INFO: Used lq/sq -(defmethod update! minimap ((this minimap)) +(defmethod update! ((this minimap)) (set! (-> this ctywide) (level-get *level* 'ctywide)) (set! (-> this map-bits) (the-as uint 0)) (dotimes (v1-2 (-> *level* length)) @@ -1415,7 +1409,7 @@ ;; definition for method 23 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-racer-2 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-racer-2 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (local-vars (sv-16 process) (sv-20 dma-buffer) @@ -1542,7 +1536,7 @@ ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-racer-1 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap) (arg2 float) (arg3 float) (arg4 float)) +(defmethod draw-racer-1 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap) (arg2 float) (arg3 float) (arg4 float)) (local-vars (sv-16 process) (sv-20 float) @@ -1667,7 +1661,7 @@ ;; definition for method 17 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-frustum-1 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-frustum-1 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (local-vars (sv-16 process) (sv-20 dma-buffer) @@ -1824,7 +1818,7 @@ ;; definition for method 18 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-frustum-2 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-frustum-2 ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (local-vars (sv-16 process) (sv-20 dma-buffer) @@ -1955,7 +1949,7 @@ ;; definition for method 21 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod sub-draw-1-1 minimap ((this minimap) (arg0 minimap-draw-work)) +(defmethod sub-draw-1-1 ((this minimap) (arg0 minimap-draw-work)) (let ((s5-0 (-> arg0 buf))) (set-display-gs-state s5-0 (the-as int (-> *map-texture-base* vram-page)) 128 128 0 0) (let ((s3-0 (-> s5-0 base))) @@ -2120,7 +2114,7 @@ ;; definition for method 19 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod sub-draw-1-2 minimap ((this minimap) (arg0 minimap-draw-work)) +(defmethod sub-draw-1-2 ((this minimap) (arg0 minimap-draw-work)) (local-vars (a3-4 int) (t0-4 int) (sv-48 vector) (sv-52 matrix) (sv-56 vector)) (let ((s5-0 (-> arg0 buf))) (reset-display-gs-state *display* s5-0) @@ -2310,7 +2304,7 @@ ;; definition for method 16 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-connection minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-connection ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (let ((s1-0 (target-pos 0))) (cond ((= (-> arg1 position) #t) @@ -2565,7 +2559,7 @@ ;; definition for method 15 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-1 minimap ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) +(defmethod draw-1 ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) (local-vars (v1-19 uint128)) (when (= (level-status *level* 'ctywide) 'active) (let ((s5-1 (new 'stack-no-clear 'minimap-draw-work))) @@ -2617,7 +2611,7 @@ ;; definition for method 24 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-sprite2 minimap ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) +(defmethod draw-sprite2 ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) (local-vars (v1-24 uint128) (a0-8 uint128) (a3-5 int) (t0-4 int)) (when (-> this race-tex) (let ((s5-0 (new 'stack-no-clear 'minimap-draw-work))) @@ -2731,7 +2725,7 @@ ;; definition for method 25 of type minimap ;; WARN: Return type mismatch int vs none. -(defmethod set-race-texture minimap ((this minimap) (arg0 texture) (arg1 float) (arg2 level)) +(defmethod set-race-texture ((this minimap) (arg0 texture) (arg1 float) (arg2 level)) (set! (-> this race-tex) arg0) (set! (-> this race-scale) arg1) (set! (-> this race-level) arg2) @@ -2741,7 +2735,7 @@ ;; definition for method 27 of type minimap ;; WARN: Return type mismatch int vs none. -(defmethod set-race-corner minimap ((this minimap) (arg0 float) (arg1 float)) +(defmethod set-race-corner ((this minimap) (arg0 float) (arg1 float)) (set! (-> this race-corner x) arg0) (set! (-> this race-corner z) arg1) 0 @@ -2751,7 +2745,7 @@ ;; definition for method 22 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-color minimap ((this minimap) (arg0 vector)) +(defmethod set-color ((this minimap) (arg0 vector)) (set! (-> this color quad) (-> arg0 quad)) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc index 9c491d6b524..b6b52d658db 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc @@ -633,7 +633,7 @@ ;; definition for method 10 of type menu-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-option ((this menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) 0 (none) ) @@ -641,7 +641,7 @@ ;; definition for method 10 of type menu-on-off-option ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-on-off-option ((this menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-8 string) (sv-16 string)) (let ((s3-0 (if arg3 (&-> *progress-state* on-off-choice) @@ -707,7 +707,7 @@ ;; definition for method 10 of type menu-yes-no-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-yes-no-option ((this menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-8 string)) (let ((s3-0 (&-> *progress-state* yes-no-choice))) (set! a0-8 @@ -755,7 +755,7 @@ ;; definition for method 10 of type menu-video-mode-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-video-mode-option ((this menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((s3-0 (&-> *progress-state* video-mode-choice)) (f28-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) (f30-0 (-> arg1 origin y)) @@ -867,7 +867,7 @@ ;; definition for method 10 of type menu-unlocked-menu-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-unlocked-menu-option ((this menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((s5-0 (memcard-unlocked-secrets? #t)) (f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) ) @@ -1050,7 +1050,7 @@ ;; definition for method 10 of type menu-main-menu-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-main-menu-option ((this menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (-> arg1 flags) (when (and (= (-> arg0 menu-transition) 0.0) (and (= (-> arg0 ring-angle) (-> arg0 ring-want-angle)) (nonzero? (-> this name)) @@ -2121,7 +2121,7 @@ ;; WARN: Stack slot offset 36 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-memcard-slot-option ((this menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (v0-74 pointer) (sv-16 float) @@ -2559,7 +2559,7 @@ ;; definition for method 10 of type menu-loading-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-loading-option ((this menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-3 arg1)) @@ -2616,7 +2616,7 @@ ;; definition for method 10 of type menu-insufficient-space-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-insufficient-space-option ((this menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (when (!= (-> arg0 current) 'none) (let ((v1-3 arg1)) @@ -2709,7 +2709,7 @@ ;; definition for method 10 of type menu-secrets-insufficient-space-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-secrets-insufficient-space-option ((this menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2756,7 +2756,7 @@ ;; definition for method 10 of type menu-insert-card-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-insert-card-option ((this menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2804,7 +2804,7 @@ ;; definition for method 10 of type menu-error-loading-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-error-loading-option ((this menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2873,7 +2873,7 @@ ;; definition for method 10 of type menu-error-auto-saving-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-error-auto-saving-option ((this menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2950,7 +2950,7 @@ ;; definition for method 10 of type menu-card-removed-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-card-removed-option ((this menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -3013,7 +3013,7 @@ ;; definition for method 10 of type menu-error-disc-removed-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-error-disc-removed-option ((this menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3073,7 +3073,7 @@ ;; definition for method 10 of type menu-error-reading-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-error-reading-option ((this menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3131,7 +3131,7 @@ ;; definition for method 10 of type menu-icon-info-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-icon-info-option ((this menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3207,7 +3207,7 @@ ;; definition for method 10 of type menu-format-card-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-format-card-option ((this menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3261,7 +3261,7 @@ ;; definition for method 10 of type menu-already-exists-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-already-exists-option ((this menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3307,7 +3307,7 @@ ;; definition for method 10 of type menu-create-game-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-create-game-option ((this menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3350,7 +3350,7 @@ ;; definition for method 10 of type menu-video-mode-warning-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-video-mode-warning-option ((this menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3418,7 +3418,7 @@ ;; definition for method 10 of type menu-video-mode-ok-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-video-mode-ok-option ((this menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3464,7 +3464,7 @@ ;; definition for method 10 of type menu-progressive-mode-warning-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-progressive-mode-warning-option ((this menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3532,7 +3532,7 @@ ;; definition for method 10 of type menu-progressive-mode-ok-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-progressive-mode-ok-option ((this menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3578,7 +3578,7 @@ ;; definition for method 10 of type menu-quit-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-quit-option ((this menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3615,7 +3615,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: disable def twice: 147. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod draw-option menu-select-start-option ((this menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-48 int) (sv-64 int) @@ -3786,7 +3786,7 @@ ;; definition for method 10 of type menu-select-scene-option ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-select-scene-option ((this menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-48 int) (sv-64 (function string font-context symbol int bucket-id float)) @@ -3964,7 +3964,7 @@ ;; definition for method 10 of type menu-bigmap-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-bigmap-option ((this menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) 0 (none) ) @@ -4184,7 +4184,7 @@ ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-missions-option ((this menu-missions-option) (progress progress) (font-ctx font-context) (arg3 int) (arg4 symbol)) +(defmethod draw-option ((this menu-missions-option) (progress progress) (font-ctx font-context) (arg3 int) (arg4 symbol)) (local-vars (f0-50 float) (font-alpha float) @@ -4888,7 +4888,7 @@ ;; WARN: Stack slot offset 112 signed mismatch ;; WARN: Stack slot offset 108 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-secret-option ((this menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-16 float) (sv-20 symbol) @@ -5100,23 +5100,20 @@ ;; definition of type print-highscore-obj (deftype print-highscore-obj (basic) - ((self menu-highscores-option :offset-assert 4) - (index int32 :offset-assert 8) - (previous symbol :offset-assert 12) - (place int32 :offset-assert 16) - (score float :offset-assert 20) - (game-score symbol :offset-assert 24) - (context font-context :offset-assert 28) - (local-scale float :offset-assert 32) - (interp float :offset-assert 36) + ((self menu-highscores-option) + (index int32) + (previous symbol) + (place int32) + (score float) + (game-score symbol) + (context font-context) + (local-scale float) + (interp float) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; definition for method 3 of type print-highscore-obj -(defmethod inspect print-highscore-obj ((this print-highscore-obj)) +(defmethod inspect ((this print-highscore-obj)) (when (not this) (set! this this) (goto cfg-4) @@ -6072,12 +6069,12 @@ ;; WARN: Stack slot offset 120 signed mismatch ;; WARN: Stack slot offset 108 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-highscores-option ((this menu-highscores-option) - (progress progress) - (font-ctx font-context) - (option-index int) - (selected? symbol) - ) +(defmethod draw-option ((this menu-highscores-option) + (progress progress) + (font-ctx font-context) + (option-index int) + (selected? symbol) + ) (local-vars (sv-96 float) (sv-100 float) @@ -6382,7 +6379,7 @@ ;; definition for method 10 of type menu-on-off-game-vibrations-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-on-off-game-vibrations-option ((this menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-10 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -6472,7 +6469,7 @@ ;; definition for method 10 of type menu-on-off-game-subtitles-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-on-off-game-subtitles-option ((this menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-11 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -6562,7 +6559,7 @@ ;; definition for method 10 of type menu-subtitle-language-game-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-subtitle-language-game-option ((this menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (with-pp (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (let ((v1-2 arg1)) @@ -6697,12 +6694,12 @@ ;; definition for method 10 of type menu-language-game-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-language-game-option ((this menu-language-game-option) - (progress progress) - (font-ctx font-context) - (option-index int) - (selected symbol) - ) +(defmethod draw-option ((this menu-language-game-option) + (progress progress) + (font-ctx font-context) + (option-index int) + (selected symbol) + ) (with-pp (let ((alpha (* 2.0 (- 0.5 (-> progress menu-transition))))) (let ((font-ctx-1 font-ctx)) @@ -6851,7 +6848,7 @@ ;; definition for method 10 of type menu-sub-menu-game-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-sub-menu-game-option ((this menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) 395.0 (-> arg1 origin y) @@ -6874,7 +6871,7 @@ ;; definition for method 10 of type menu-aspect-ratio-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-aspect-ratio-option ((this menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-12 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -6981,12 +6978,12 @@ ;; definition for method 10 of type menu-on-off-progressive-scan-graphic-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-on-off-progressive-scan-graphic-option ((this menu-on-off-progressive-scan-graphic-option) - (arg0 progress) - (arg1 font-context) - (arg2 int) - (arg3 symbol) - ) +(defmethod draw-option ((this menu-on-off-progressive-scan-graphic-option) + (arg0 progress) + (arg1 font-context) + (arg2 int) + (arg3 symbol) + ) (local-vars (a0-11 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -7089,7 +7086,7 @@ ;; definition for method 10 of type menu-center-screen-graphic-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-center-screen-graphic-option ((this menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) (set! f30-0 0.0) @@ -7196,7 +7193,7 @@ ;; definition for method 10 of type menu-restart-mission-qr-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-restart-mission-qr-option ((this menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-11 string)) (let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f0-1 0.0) @@ -7261,7 +7258,7 @@ ;; definition for method 10 of type menu-quit-qr-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-quit-qr-option ((this menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-12 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -7338,7 +7335,7 @@ ;; definition for method 10 of type menu-slider-option ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-slider-option ((this menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (v0-42 pointer) (sv-16 progress) @@ -7711,7 +7708,7 @@ ;; definition for method 10 of type menu-stereo-mode-sound-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-stereo-mode-sound-option ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (s5-0 int)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (let ((v1-2 arg1)) @@ -7819,7 +7816,7 @@ ;; definition for method 10 of type menu-sub-menu-option ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-sub-menu-option ((this menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option ((this menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-16 dma-buffer)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) (s2-0 (the int (+ -1.0 (-> arg1 origin y)))) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc index c0487a02a69..d1a7b67c5b8 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc @@ -3,55 +3,53 @@ ;; definition of type progress (deftype progress (process-drawable) - ((current-options menu-option-list :offset-assert 200) - (menu-transition float :offset-assert 204) - (option-index int32 :offset-assert 208) - (want-option-index int32 :offset-assert 212) - (next-option-index int32 :offset-assert 216) - (graphic-index int32 :offset-assert 220) - (selected-option symbol :offset-assert 224) - (current symbol :offset-assert 228) - (next symbol :offset-assert 232) - (ring-angle float :offset-assert 236) - (ring-want-angle float :offset-assert 240) - (init-quat quaternion :inline :offset-assert 256) - (pos-transition float :offset-assert 272) - (anim-frame float :offset-assert 276) - (swing float :offset-assert 280) - (main-menu symbol :offset-assert 284) - (state-stack symbol 5 :offset-assert 288) - (option-index-stack int32 5 :offset-assert 308) - (state-pos int32 :offset-assert 328) - (secret-buying basic :offset-assert 332) - (secret-buy-choice basic :offset-assert 336) - (sliding float :offset-assert 340) - (sliding-off float :offset-assert 344) - (scanlines-alpha float :offset-assert 348) - (sliding-height float :offset-assert 352) + ((current-options menu-option-list) + (menu-transition float) + (option-index int32) + (want-option-index int32) + (next-option-index int32) + (graphic-index int32) + (selected-option symbol) + (current symbol) + (next symbol) + (ring-angle float) + (ring-want-angle float) + (init-quat quaternion :inline) + (pos-transition float) + (anim-frame float) + (swing float) + (main-menu symbol) + (state-stack symbol 5) + (option-index-stack int32 5) + (state-pos int32) + (secret-buying basic) + (secret-buy-choice basic) + (sliding float) + (sliding-off float) + (scanlines-alpha float) + (sliding-height float) ) - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x164 - :flag-assert #x2100f00164 + (:state-methods + come-in + idle + go-away + gone + ) (:methods - (come-in () _type_ :state 20) - (idle () _type_ :state 21) - (go-away () _type_ :state 22) - (gone () _type_ :state 23) - (init-defaults (_type_) object 24) - (respond-to-cpad (_type_) none 25) - (gone? (_type_) object 26) - (can-go-back? (_type_) symbol 27) - (get-state-check-card (_type_ symbol) symbol 28) - (push-state (_type_) int 29) - (pop-state (_type_) int 30) - (set-next-state (_type_ symbol int) int 31) - (set-menu-options (_type_ symbol) int 32) + (init-defaults (_type_) object) + (respond-to-cpad (_type_) none) + (gone? (_type_) object) + (can-go-back? (_type_) symbol) + (get-state-check-card (_type_ symbol) symbol) + (push-state (_type_) int) + (pop-state (_type_) int) + (set-next-state (_type_ symbol int) int) + (set-menu-options (_type_ symbol) int) ) ) ;; definition for method 3 of type progress -(defmethod inspect progress ((this progress)) +(defmethod inspect ((this progress)) (when (not this) (set! this this) (goto cfg-4) @@ -90,24 +88,21 @@ ;; definition of type menu-option (deftype menu-option (basic) - ((name text-id :offset-assert 4) - (scale symbol :offset-assert 8) - (unknown function :offset-assert 12) - (box hud-box 1 :inline :offset-assert 16) - (options menu-option 8 :offset 16) + ((name text-id) + (scale symbol) + (unknown function) + (box hud-box 1 :inline) + (options menu-option 8 :overlay-at box) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 (:methods - (respond-progress (_type_ progress symbol) int :behavior progress 9) - (draw-option (_type_ progress font-context int symbol) none 10) - (menu-option-method-11 () none 11) + (respond-progress (_type_ progress symbol) int :behavior progress) + (draw-option (_type_ progress font-context int symbol) none) + (menu-option-method-11 () none) ) ) ;; definition for method 3 of type menu-option -(defmethod inspect menu-option ((this menu-option)) +(defmethod inspect ((this menu-option)) (when (not this) (set! this this) (goto cfg-4) @@ -122,15 +117,12 @@ ;; definition of type menu-on-off-option (deftype menu-on-off-option (menu-option) - ((value-to-modify (pointer symbol) :offset-assert 48) + ((value-to-modify (pointer symbol)) ) - :method-count-assert 12 - :size-assert #x34 - :flag-assert #xc00000034 ) ;; definition for method 3 of type menu-on-off-option -(defmethod inspect menu-on-off-option ((this menu-on-off-option)) +(defmethod inspect ((this menu-on-off-option)) (when (not this) (set! this this) (goto cfg-4) @@ -146,15 +138,12 @@ ;; definition of type menu-yes-no-option (deftype menu-yes-no-option (menu-option) - ((value-to-modify pointer :offset-assert 48) + ((value-to-modify pointer) ) - :method-count-assert 12 - :size-assert #x34 - :flag-assert #xc00000034 ) ;; definition for method 3 of type menu-yes-no-option -(defmethod inspect menu-yes-no-option ((this menu-yes-no-option)) +(defmethod inspect ((this menu-yes-no-option)) (when (not this) (set! this this) (goto cfg-4) @@ -170,18 +159,15 @@ ;; definition of type menu-language-option (deftype menu-language-option (menu-option) - ((language-selection language-enum :offset-assert 48) - (language-direction symbol :offset-assert 56) - (language-transition basic :offset-assert 60) - (language-x-offset int32 :offset-assert 64) + ((language-selection language-enum) + (language-direction symbol) + (language-transition basic) + (language-x-offset int32) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 ) ;; definition for method 3 of type menu-language-option -(defmethod inspect menu-language-option ((this menu-language-option)) +(defmethod inspect ((this menu-language-option)) (when (not this) (set! this this) (goto cfg-4) @@ -201,13 +187,10 @@ ;; definition of type menu-quit-option (deftype menu-quit-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-quit-option -(defmethod inspect menu-quit-option ((this menu-quit-option)) +(defmethod inspect ((this menu-quit-option)) (when (not this) (set! this this) (goto cfg-4) @@ -222,16 +205,13 @@ ;; definition of type menu-slider-option (deftype menu-slider-option (menu-option) - ((value-to-modify pointer :offset-assert 48) - (sprites hud-sprite 5 :inline :offset 64) + ((value-to-modify pointer) + (sprites hud-sprite 5 :inline :offset 64) ) - :method-count-assert 12 - :size-assert #x180 - :flag-assert #xc00000180 ) ;; definition for method 3 of type menu-slider-option -(defmethod inspect menu-slider-option ((this menu-slider-option)) +(defmethod inspect ((this menu-slider-option)) (when (not this) (set! this this) (goto cfg-4) @@ -248,16 +228,13 @@ ;; definition of type menu-sub-menu-option (deftype menu-sub-menu-option (menu-option) - ((next-state symbol :offset-assert 48) - (pad uint8 44 :offset-assert 52) + ((next-state symbol) + (pad uint8 44) ) - :method-count-assert 12 - :size-assert #x60 - :flag-assert #xc00000060 ) ;; definition for method 3 of type menu-sub-menu-option -(defmethod inspect menu-sub-menu-option ((this menu-sub-menu-option)) +(defmethod inspect ((this menu-sub-menu-option)) (when (not this) (set! this this) (goto cfg-4) @@ -274,15 +251,12 @@ ;; definition of type menu-sub-menu-sound-option (deftype menu-sub-menu-sound-option (menu-option) - ((next-state symbol :offset-assert 48) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x34 - :flag-assert #xc00000034 ) ;; definition for method 3 of type menu-sub-menu-sound-option -(defmethod inspect menu-sub-menu-sound-option ((this menu-sub-menu-sound-option)) +(defmethod inspect ((this menu-sub-menu-sound-option)) (when (not this) (set! this this) (goto cfg-4) @@ -299,13 +273,10 @@ ;; definition of type menu-stereo-mode-sound-option (deftype menu-stereo-mode-sound-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-stereo-mode-sound-option -(defmethod inspect menu-stereo-mode-sound-option ((this menu-stereo-mode-sound-option)) +(defmethod inspect ((this menu-stereo-mode-sound-option)) (when (not this) (set! this this) (goto cfg-4) @@ -320,15 +291,12 @@ ;; definition of type menu-sub-menu-graphic-option (deftype menu-sub-menu-graphic-option (menu-option) - ((next-state symbol :offset-assert 48) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x34 - :flag-assert #xc00000034 ) ;; definition for method 3 of type menu-sub-menu-graphic-option -(defmethod inspect menu-sub-menu-graphic-option ((this menu-sub-menu-graphic-option)) +(defmethod inspect ((this menu-sub-menu-graphic-option)) (when (not this) (set! this this) (goto cfg-4) @@ -345,13 +313,10 @@ ;; definition of type menu-unlocked-menu-option (deftype menu-unlocked-menu-option (menu-sub-menu-option) () - :method-count-assert 12 - :size-assert #x60 - :flag-assert #xc00000060 ) ;; definition for method 3 of type menu-unlocked-menu-option -(defmethod inspect menu-unlocked-menu-option ((this menu-unlocked-menu-option)) +(defmethod inspect ((this menu-unlocked-menu-option)) (when (not this) (set! this this) (goto cfg-4) @@ -368,15 +333,12 @@ ;; definition of type menu-main-menu-option (deftype menu-main-menu-option (menu-option) - ((next-state symbol :offset-assert 48) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x34 - :flag-assert #xc00000034 ) ;; definition for method 3 of type menu-main-menu-option -(defmethod inspect menu-main-menu-option ((this menu-main-menu-option)) +(defmethod inspect ((this menu-main-menu-option)) (when (not this) (set! this this) (goto cfg-4) @@ -392,16 +354,13 @@ ;; definition of type menu-memcard-slot-option (deftype menu-memcard-slot-option (menu-option) - ((sprites hud-sprite 5 :inline :offset 48) - (pad uint8 32 :offset-assert 368) + ((sprites hud-sprite 5 :inline :offset 48) + (pad uint8 32) ) - :method-count-assert 12 - :size-assert #x190 - :flag-assert #xc00000190 ) ;; definition for method 3 of type menu-memcard-slot-option -(defmethod inspect menu-memcard-slot-option ((this menu-memcard-slot-option)) +(defmethod inspect ((this menu-memcard-slot-option)) (when (not this) (set! this this) (goto cfg-4) @@ -419,13 +378,10 @@ ;; definition of type menu-loading-option (deftype menu-loading-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-loading-option -(defmethod inspect menu-loading-option ((this menu-loading-option)) +(defmethod inspect ((this menu-loading-option)) (when (not this) (set! this this) (goto cfg-4) @@ -440,15 +396,12 @@ ;; definition of type menu-insufficient-space-option (deftype menu-insufficient-space-option (menu-option) - ((last-move time-frame :offset-assert 48) + ((last-move time-frame) ) - :method-count-assert 12 - :size-assert #x38 - :flag-assert #xc00000038 ) ;; definition for method 3 of type menu-insufficient-space-option -(defmethod inspect menu-insufficient-space-option ((this menu-insufficient-space-option)) +(defmethod inspect ((this menu-insufficient-space-option)) (when (not this) (set! this this) (goto cfg-4) @@ -465,13 +418,10 @@ ;; definition of type menu-secrets-insufficient-space-option (deftype menu-secrets-insufficient-space-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-secrets-insufficient-space-option -(defmethod inspect menu-secrets-insufficient-space-option ((this menu-secrets-insufficient-space-option)) +(defmethod inspect ((this menu-secrets-insufficient-space-option)) (when (not this) (set! this this) (goto cfg-4) @@ -487,13 +437,10 @@ ;; definition of type menu-insert-card-option (deftype menu-insert-card-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-insert-card-option -(defmethod inspect menu-insert-card-option ((this menu-insert-card-option)) +(defmethod inspect ((this menu-insert-card-option)) (when (not this) (set! this this) (goto cfg-4) @@ -509,13 +456,10 @@ ;; definition of type menu-error-loading-option (deftype menu-error-loading-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-error-loading-option -(defmethod inspect menu-error-loading-option ((this menu-error-loading-option)) +(defmethod inspect ((this menu-error-loading-option)) (when (not this) (set! this this) (goto cfg-4) @@ -531,13 +475,10 @@ ;; definition of type menu-error-auto-saving-option (deftype menu-error-auto-saving-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-error-auto-saving-option -(defmethod inspect menu-error-auto-saving-option ((this menu-error-auto-saving-option)) +(defmethod inspect ((this menu-error-auto-saving-option)) (when (not this) (set! this this) (goto cfg-4) @@ -553,13 +494,10 @@ ;; definition of type menu-card-removed-option (deftype menu-card-removed-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-card-removed-option -(defmethod inspect menu-card-removed-option ((this menu-card-removed-option)) +(defmethod inspect ((this menu-card-removed-option)) (when (not this) (set! this this) (goto cfg-4) @@ -575,13 +513,10 @@ ;; definition of type menu-error-disc-removed-option (deftype menu-error-disc-removed-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-error-disc-removed-option -(defmethod inspect menu-error-disc-removed-option ((this menu-error-disc-removed-option)) +(defmethod inspect ((this menu-error-disc-removed-option)) (when (not this) (set! this this) (goto cfg-4) @@ -597,13 +532,10 @@ ;; definition of type menu-error-reading-option (deftype menu-error-reading-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-error-reading-option -(defmethod inspect menu-error-reading-option ((this menu-error-reading-option)) +(defmethod inspect ((this menu-error-reading-option)) (when (not this) (set! this this) (goto cfg-4) @@ -618,15 +550,12 @@ ;; definition of type menu-icon-info-option (deftype menu-icon-info-option (menu-option) - ((sprites hud-sprite 2 :inline :offset 48) + ((sprites hud-sprite 2 :inline :offset 48) ) - :method-count-assert 12 - :size-assert #xb0 - :flag-assert #xc000000b0 ) ;; definition for method 3 of type menu-icon-info-option -(defmethod inspect menu-icon-info-option ((this menu-icon-info-option)) +(defmethod inspect ((this menu-icon-info-option)) (when (not this) (set! this this) (goto cfg-4) @@ -643,13 +572,10 @@ ;; definition of type menu-format-card-option (deftype menu-format-card-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-format-card-option -(defmethod inspect menu-format-card-option ((this menu-format-card-option)) +(defmethod inspect ((this menu-format-card-option)) (when (not this) (set! this this) (goto cfg-4) @@ -665,13 +591,10 @@ ;; definition of type menu-already-exists-option (deftype menu-already-exists-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-already-exists-option -(defmethod inspect menu-already-exists-option ((this menu-already-exists-option)) +(defmethod inspect ((this menu-already-exists-option)) (when (not this) (set! this this) (goto cfg-4) @@ -687,13 +610,10 @@ ;; definition of type menu-create-game-option (deftype menu-create-game-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-create-game-option -(defmethod inspect menu-create-game-option ((this menu-create-game-option)) +(defmethod inspect ((this menu-create-game-option)) (when (not this) (set! this this) (goto cfg-4) @@ -709,13 +629,10 @@ ;; definition of type menu-video-mode-warning-option (deftype menu-video-mode-warning-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-video-mode-warning-option -(defmethod inspect menu-video-mode-warning-option ((this menu-video-mode-warning-option)) +(defmethod inspect ((this menu-video-mode-warning-option)) (when (not this) (set! this this) (goto cfg-4) @@ -731,13 +648,10 @@ ;; definition of type menu-video-mode-ok-option (deftype menu-video-mode-ok-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-video-mode-ok-option -(defmethod inspect menu-video-mode-ok-option ((this menu-video-mode-ok-option)) +(defmethod inspect ((this menu-video-mode-ok-option)) (when (not this) (set! this this) (goto cfg-4) @@ -753,13 +667,10 @@ ;; definition of type menu-progressive-mode-warning-option (deftype menu-progressive-mode-warning-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-progressive-mode-warning-option -(defmethod inspect menu-progressive-mode-warning-option ((this menu-progressive-mode-warning-option)) +(defmethod inspect ((this menu-progressive-mode-warning-option)) (when (not this) (set! this this) (goto cfg-4) @@ -775,13 +686,10 @@ ;; definition of type menu-progressive-mode-ok-option (deftype menu-progressive-mode-ok-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-progressive-mode-ok-option -(defmethod inspect menu-progressive-mode-ok-option ((this menu-progressive-mode-ok-option)) +(defmethod inspect ((this menu-progressive-mode-ok-option)) (when (not this) (set! this this) (goto cfg-4) @@ -796,17 +704,14 @@ ;; definition of type menu-select-start-option (deftype menu-select-start-option (menu-option) - ((task-index int32 :offset-assert 48) - (real-task-index int32 :offset-assert 52) - (last-move time-frame :offset-assert 56) + ((task-index int32) + (real-task-index int32) + (last-move time-frame) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) ;; definition for method 3 of type menu-select-start-option -(defmethod inspect menu-select-start-option ((this menu-select-start-option)) +(defmethod inspect ((this menu-select-start-option)) (when (not this) (set! this this) (goto cfg-4) @@ -824,16 +729,13 @@ ;; definition of type menu-select-scene-option (deftype menu-select-scene-option (menu-option) - ((task-index int32 :offset-assert 48) - (last-move time-frame :offset-assert 56) + ((task-index int32) + (last-move time-frame) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) ;; definition for method 3 of type menu-select-scene-option -(defmethod inspect menu-select-scene-option ((this menu-select-scene-option)) +(defmethod inspect ((this menu-select-scene-option)) (when (not this) (set! this this) (goto cfg-4) @@ -851,13 +753,10 @@ ;; definition of type menu-bigmap-option (deftype menu-bigmap-option (menu-option) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type menu-bigmap-option -(defmethod inspect menu-bigmap-option ((this menu-bigmap-option)) +(defmethod inspect ((this menu-bigmap-option)) (when (not this) (set! this this) (goto cfg-4) @@ -872,18 +771,15 @@ ;; definition of type paged-menu-option (deftype paged-menu-option (menu-option) - ((page-index int32 :offset-assert 48) - (prev-page-index int32 :offset-assert 52) - (num-pages int32 :offset-assert 56) - (slide-dir float :offset-assert 60) + ((page-index int32) + (prev-page-index int32) + (num-pages int32) + (slide-dir float) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) ;; definition for method 3 of type paged-menu-option -(defmethod inspect paged-menu-option ((this paged-menu-option)) +(defmethod inspect ((this paged-menu-option)) (when (not this) (set! this this) (goto cfg-4) @@ -902,16 +798,13 @@ ;; definition of type menu-missions-option (deftype menu-missions-option (paged-menu-option) - ((task-line-index int32 :offset-assert 64) - (last-move time-frame :offset-assert 72) + ((task-line-index int32) + (last-move time-frame) ) - :method-count-assert 12 - :size-assert #x50 - :flag-assert #xc00000050 ) ;; definition for method 3 of type menu-missions-option -(defmethod inspect menu-missions-option ((this menu-missions-option)) +(defmethod inspect ((this menu-missions-option)) (when (not this) (set! this this) (goto cfg-4) @@ -932,16 +825,13 @@ ;; definition of type menu-highscores-option (deftype menu-highscores-option (paged-menu-option) - ((last-move time-frame :offset-assert 64) - (sprites hud-sprite 2 :inline :offset 80) + ((last-move time-frame) + (sprites hud-sprite 2 :inline :offset 80) ) - :method-count-assert 12 - :size-assert #xd0 - :flag-assert #xc000000d0 ) ;; definition for method 3 of type menu-highscores-option -(defmethod inspect menu-highscores-option ((this menu-highscores-option)) +(defmethod inspect ((this menu-highscores-option)) (when (not this) (set! this this) (goto cfg-4) @@ -962,18 +852,15 @@ ;; definition of type secret-item-option (deftype secret-item-option (menu-option) - ((cost int32 :offset-assert 48) - (can-toggle symbol :offset-assert 52) - (flag game-secrets :offset-assert 56) - (avail-after game-task-node :offset-assert 60) + ((cost int32) + (can-toggle symbol) + (flag game-secrets) + (avail-after game-task-node) ) - :method-count-assert 12 - :size-assert #x3e - :flag-assert #xc0000003e ) ;; definition for method 3 of type secret-item-option -(defmethod inspect secret-item-option ((this secret-item-option)) +(defmethod inspect ((this secret-item-option)) (when (not this) (set! this this) (goto cfg-4) @@ -992,21 +879,18 @@ ;; definition of type menu-secret-option (deftype menu-secret-option (menu-option) - ((item-index int32 :offset-assert 48) - (prev-item-index int32 :offset-assert 52) - (num-items int32 :offset-assert 56) - (num-hero-items int32 :offset-assert 60) - (secret-items (array secret-item-option) :offset-assert 64) - (last-move time-frame :offset-assert 72) - (sprites hud-sprite 2 :inline :offset 80) + ((item-index int32) + (prev-item-index int32) + (num-items int32) + (num-hero-items int32) + (secret-items (array secret-item-option)) + (last-move time-frame) + (sprites hud-sprite 2 :inline :offset 80) ) - :method-count-assert 12 - :size-assert #xd0 - :flag-assert #xc000000d0 ) ;; definition for method 3 of type menu-secret-option -(defmethod inspect menu-secret-option ((this menu-secret-option)) +(defmethod inspect ((this menu-secret-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1028,18 +912,15 @@ ;; definition of type menu-option-list (deftype menu-option-list (basic) - ((y-center int32 :offset-assert 4) - (y-space int32 :offset-assert 8) - (scale float :offset-assert 12) - (options (array menu-option) :offset-assert 16) + ((y-center int32) + (y-space int32) + (scale float) + (options (array menu-option)) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type menu-option-list -(defmethod inspect menu-option-list ((this menu-option-list)) +(defmethod inspect ((this menu-option-list)) (when (not this) (set! this this) (goto cfg-4) @@ -1055,16 +936,13 @@ ;; definition of type menu-qr-option (deftype menu-qr-option (menu-option) - ((last-move time-frame :offset-assert 48) - (value-to-modify function :offset 60) + ((last-move time-frame) + (value-to-modify function :offset 60) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) ;; definition for method 3 of type menu-qr-option -(defmethod inspect menu-qr-option ((this menu-qr-option)) +(defmethod inspect ((this menu-qr-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1082,15 +960,12 @@ ;; definition of type menu-restart-mission-qr-option (deftype menu-restart-mission-qr-option (menu-qr-option) - ((next-state symbol :offset-assert 64) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 ) ;; definition for method 3 of type menu-restart-mission-qr-option -(defmethod inspect menu-restart-mission-qr-option ((this menu-restart-mission-qr-option)) +(defmethod inspect ((this menu-restart-mission-qr-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1109,15 +984,12 @@ ;; definition of type menu-quit-qr-option (deftype menu-quit-qr-option (menu-qr-option) - ((next-state symbol :offset-assert 64) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 ) ;; definition for method 3 of type menu-quit-qr-option -(defmethod inspect menu-quit-qr-option ((this menu-quit-qr-option)) +(defmethod inspect ((this menu-quit-qr-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1136,15 +1008,12 @@ ;; definition of type menu-sub-menu-qr-option (deftype menu-sub-menu-qr-option (menu-qr-option) - ((next-state symbol :offset-assert 64) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 ) ;; definition for method 3 of type menu-sub-menu-qr-option -(defmethod inspect menu-sub-menu-qr-option ((this menu-sub-menu-qr-option)) +(defmethod inspect ((this menu-sub-menu-qr-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1163,16 +1032,13 @@ ;; definition of type menu-graphic-option (deftype menu-graphic-option (menu-option) - ((last-move time-frame :offset-assert 48) - (value-to-modify pointer :offset 60) + ((last-move time-frame) + (value-to-modify pointer :offset 60) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) ;; definition for method 3 of type menu-graphic-option -(defmethod inspect menu-graphic-option ((this menu-graphic-option)) +(defmethod inspect ((this menu-graphic-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1191,13 +1057,10 @@ ;; definition of type menu-on-off-progressive-scan-graphic-option (deftype menu-on-off-progressive-scan-graphic-option (menu-graphic-option) () - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) ;; definition for method 3 of type menu-on-off-progressive-scan-graphic-option -(defmethod inspect menu-on-off-progressive-scan-graphic-option ((this menu-on-off-progressive-scan-graphic-option)) +(defmethod inspect ((this menu-on-off-progressive-scan-graphic-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1216,13 +1079,10 @@ ;; definition of type menu-aspect-ratio-option (deftype menu-aspect-ratio-option (menu-graphic-option) () - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) ;; definition for method 3 of type menu-aspect-ratio-option -(defmethod inspect menu-aspect-ratio-option ((this menu-aspect-ratio-option)) +(defmethod inspect ((this menu-aspect-ratio-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1240,15 +1100,12 @@ ;; definition of type menu-center-screen-graphic-option (deftype menu-center-screen-graphic-option (menu-graphic-option) - ((next-state symbol :offset-assert 64) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 ) ;; definition for method 3 of type menu-center-screen-graphic-option -(defmethod inspect menu-center-screen-graphic-option ((this menu-center-screen-graphic-option)) +(defmethod inspect ((this menu-center-screen-graphic-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1268,13 +1125,10 @@ ;; definition of type menu-video-mode-option (deftype menu-video-mode-option (menu-graphic-option) () - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) ;; definition for method 3 of type menu-video-mode-option -(defmethod inspect menu-video-mode-option ((this menu-video-mode-option)) +(defmethod inspect ((this menu-video-mode-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1292,16 +1146,13 @@ ;; definition of type menu-game-option (deftype menu-game-option (menu-option) - ((last-move time-frame :offset-assert 48) - (value-to-modify pointer :offset 60) + ((last-move time-frame) + (value-to-modify pointer :offset 60) ) - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) ;; definition for method 3 of type menu-game-option -(defmethod inspect menu-game-option ((this menu-game-option)) +(defmethod inspect ((this menu-game-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1320,13 +1171,10 @@ ;; definition of type menu-on-off-game-vibrations-option (deftype menu-on-off-game-vibrations-option (menu-game-option) () - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) ;; definition for method 3 of type menu-on-off-game-vibrations-option -(defmethod inspect menu-on-off-game-vibrations-option ((this menu-on-off-game-vibrations-option)) +(defmethod inspect ((this menu-on-off-game-vibrations-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1345,13 +1193,10 @@ ;; definition of type menu-on-off-game-subtitles-option (deftype menu-on-off-game-subtitles-option (menu-game-option) () - :method-count-assert 12 - :size-assert #x40 - :flag-assert #xc00000040 ) ;; definition for method 3 of type menu-on-off-game-subtitles-option -(defmethod inspect menu-on-off-game-subtitles-option ((this menu-on-off-game-subtitles-option)) +(defmethod inspect ((this menu-on-off-game-subtitles-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1369,15 +1214,12 @@ ;; definition of type menu-sub-menu-game-option (deftype menu-sub-menu-game-option (menu-game-option) - ((next-state symbol :offset-assert 64) + ((next-state symbol) ) - :method-count-assert 12 - :size-assert #x44 - :flag-assert #xc00000044 ) ;; definition for method 3 of type menu-sub-menu-game-option -(defmethod inspect menu-sub-menu-game-option ((this menu-sub-menu-game-option)) +(defmethod inspect ((this menu-sub-menu-game-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1396,18 +1238,15 @@ ;; definition of type menu-language-game-option (deftype menu-language-game-option (menu-game-option) - ((language-selection uint64 :offset-assert 64) - (language-direction basic :offset-assert 72) - (language-transition basic :offset-assert 76) - (language-x-offset int32 :offset-assert 80) + ((language-selection uint64) + (language-direction basic) + (language-transition basic) + (language-x-offset int32) ) - :method-count-assert 12 - :size-assert #x54 - :flag-assert #xc00000054 ) ;; definition for method 3 of type menu-language-game-option -(defmethod inspect menu-language-game-option ((this menu-language-game-option)) +(defmethod inspect ((this menu-language-game-option)) (when (not this) (set! this this) (goto cfg-4) @@ -1429,18 +1268,15 @@ ;; definition of type menu-subtitle-language-game-option (deftype menu-subtitle-language-game-option (menu-game-option) - ((language-selection uint64 :offset-assert 64) - (language-direction basic :offset-assert 72) - (language-transition basic :offset-assert 76) - (language-x-offset int32 :offset-assert 80) + ((language-selection uint64) + (language-direction basic) + (language-transition basic) + (language-x-offset int32) ) - :method-count-assert 12 - :size-assert #x54 - :flag-assert #xc00000054 ) ;; definition for method 3 of type menu-subtitle-language-game-option -(defmethod inspect menu-subtitle-language-game-option ((this menu-subtitle-language-game-option)) +(defmethod inspect ((this menu-subtitle-language-game-option)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-static_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-static_REF.gc index 2deb294df5c..eecc5676587 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress-static_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-static_REF.gc @@ -880,20 +880,17 @@ ;; definition of type hud-scene-info (deftype hud-scene-info (basic) - ((name string :offset-assert 4) - (continue string :offset-assert 8) - (info object :offset-assert 12) - (info-str string :offset 12) - (info-list pair :offset 12) - (text text-id :offset-assert 16) + ((name string) + (continue string) + (info object) + (info-str string :overlay-at info) + (info-list pair :overlay-at info) + (text text-id) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type hud-scene-info -(defmethod inspect hud-scene-info ((this hud-scene-info)) +(defmethod inspect ((this hud-scene-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc index 63128bcfa01..0c036f97959 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc @@ -3,61 +3,58 @@ ;; definition of type progress-global-state (deftype progress-global-state (basic) - ((aspect-ratio-choice symbol :offset-assert 4) - (video-mode-choice symbol :offset-assert 8) - (yes-no-choice symbol :offset-assert 12) - (on-off-choice symbol :offset-assert 16) - (which-slot int32 :offset-assert 20) - (starting-state symbol :offset-assert 24) - (last-slot-saved int32 :offset-assert 28) - (slider-backup float :offset-assert 32) - (language-backup language-enum :offset-assert 40) - (center-x-backup int32 :offset-assert 48) - (center-y-backup int32 :offset-assert 52) - (aspect-ratio-backup symbol :offset-assert 56) - (last-slider-sound time-frame :offset-assert 64) - (video-mode-timeout time-frame :offset-assert 72) - (progressive-mode-timeout time-frame :offset-assert 80) - (current-task-index int32 :offset-assert 88) - (current-line-index int32 :offset-assert 92) - (first-closed-line-index int32 :offset-assert 96) - (extra-text-state int32 :offset-assert 100) - (current-task uint8 :offset-assert 104) - (num-open-tasks-found int32 :offset-assert 108) - (num-closed-tasks-found int32 :offset-assert 112) - (color-flash-counter int32 :offset-assert 116) - (num-unlocked-secrets int32 :offset-assert 120) - (game-options-item-selected int32 :offset-assert 124) - (game-options-item-picked basic :offset-assert 128) - (game-options-last-move time-frame :offset-assert 136) - (game-options-vibrations symbol :offset-assert 144) - (game-options-subtitles symbol :offset-assert 148) - (game-options-language-index int32 :offset-assert 152) - (game-options-subtitle-language-index int32 :offset-assert 156) - (graphic-options-item-selected int32 :offset-assert 160) - (graphic-options-item-picked symbol :offset-assert 164) - (graphic-options-last-move time-frame :offset-assert 168) - (graphic-options-aspect-ratio symbol :offset-assert 176) - (graphic-options-progressive-scan symbol :offset-assert 180) - (qr-options-item-selected int32 :offset-assert 184) - (qr-options-item-picked basic :offset-assert 188) - (qr-options-last-move time-frame :offset-assert 192) - (qr-options-restart basic :offset-assert 200) - (qr-options-quit basic :offset-assert 204) - (total-num-tasks int32 :offset-assert 208) - (scene-player-act int32 :offset-assert 212) - (stereo-mode-backup int32 :offset-assert 216) - (secrets-unlocked symbol :offset-assert 220) - (missions-total-spacing float :offset-assert 224) - (clear-screen symbol :offset-assert 228) + ((aspect-ratio-choice symbol) + (video-mode-choice symbol) + (yes-no-choice symbol) + (on-off-choice symbol) + (which-slot int32) + (starting-state symbol) + (last-slot-saved int32) + (slider-backup float) + (language-backup language-enum) + (center-x-backup int32) + (center-y-backup int32) + (aspect-ratio-backup symbol) + (last-slider-sound time-frame) + (video-mode-timeout time-frame) + (progressive-mode-timeout time-frame) + (current-task-index int32) + (current-line-index int32) + (first-closed-line-index int32) + (extra-text-state int32) + (current-task uint8) + (num-open-tasks-found int32) + (num-closed-tasks-found int32) + (color-flash-counter int32) + (num-unlocked-secrets int32) + (game-options-item-selected int32) + (game-options-item-picked basic) + (game-options-last-move time-frame) + (game-options-vibrations symbol) + (game-options-subtitles symbol) + (game-options-language-index int32) + (game-options-subtitle-language-index int32) + (graphic-options-item-selected int32) + (graphic-options-item-picked symbol) + (graphic-options-last-move time-frame) + (graphic-options-aspect-ratio symbol) + (graphic-options-progressive-scan symbol) + (qr-options-item-selected int32) + (qr-options-item-picked basic) + (qr-options-last-move time-frame) + (qr-options-restart basic) + (qr-options-quit basic) + (total-num-tasks int32) + (scene-player-act int32) + (stereo-mode-backup int32) + (secrets-unlocked symbol) + (missions-total-spacing float) + (clear-screen symbol) ) - :method-count-assert 9 - :size-assert #xe8 - :flag-assert #x9000000e8 ) ;; definition for method 3 of type progress-global-state -(defmethod inspect progress-global-state ((this progress-global-state)) +(defmethod inspect ((this progress-global-state)) (when (not this) (set! this this) (goto cfg-4) @@ -158,7 +155,7 @@ ;; definition for method 24 of type progress ;; WARN: Return type mismatch connection vs object. -(defmethod init-defaults progress ((this progress)) +(defmethod init-defaults ((this progress)) "Initialize default menu settings." (set! (-> *progress-state* aspect-ratio-choice) (get-aspect-ratio)) (set! (-> *progress-state* video-mode-choice) (get-video-mode)) @@ -229,22 +226,18 @@ ;; definition of type hud-ring-cell (deftype hud-ring-cell (process-drawable) - ((parent (pointer progress) :override) - (joint-idx int32 :offset-assert 200) - (init-angle degrees :offset-assert 204) - (graphic-index int32 :offset-assert 208) + ((parent (pointer progress) :override) + (joint-idx int32) + (init-angle degrees) + (graphic-index int32) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd4 - :flag-assert #x15006000d4 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type hud-ring-cell -(defmethod inspect hud-ring-cell ((this hud-ring-cell)) +(defmethod inspect ((this hud-ring-cell)) (when (not this) (set! this this) (goto cfg-4) @@ -542,7 +535,7 @@ ) ;; definition for method 10 of type progress -(defmethod deactivate progress ((this progress)) +(defmethod deactivate ((this progress)) (remove-setting-by-arg0 *setting-control* 'extra-bank) (disable-drawing *bigmap*) (set! (-> *blit-displays-work* menu-mode) #f) @@ -575,7 +568,7 @@ ) ;; definition for method 26 of type progress -(defmethod gone? progress ((this progress)) +(defmethod gone? ((this progress)) (and *progress-process* (-> *progress-process* 0 next-state) (= (-> *progress-process* 0 next-state name) 'gone) @@ -609,7 +602,7 @@ ) ;; definition for method 27 of type progress -(defmethod can-go-back? progress ((this progress)) +(defmethod can-go-back? ((this progress)) (and (= (-> this menu-transition) 0.0) (not (-> this selected-option)) (!= (-> this current) 'loading) @@ -669,7 +662,7 @@ ) ;; definition for method 28 of type progress -(defmethod get-state-check-card progress ((this progress) (arg0 symbol)) +(defmethod get-state-check-card ((this progress) (arg0 symbol)) (let ((v1-0 *progress-save-info*) (v0-0 arg0) ) @@ -767,7 +760,7 @@ ) ;; definition for method 29 of type progress -(defmethod push-state progress ((this progress)) +(defmethod push-state ((this progress)) (let ((v1-0 (-> this state-pos))) (cond ((< v1-0 5) @@ -784,7 +777,7 @@ ) ;; definition for method 30 of type progress -(defmethod pop-state progress ((this progress)) +(defmethod pop-state ((this progress)) (let ((v1-0 (-> this state-pos))) (cond ((> v1-0 0) @@ -808,7 +801,7 @@ ) ;; definition for method 31 of type progress -(defmethod set-next-state progress ((this progress) (arg0 symbol) (arg1 int)) +(defmethod set-next-state ((this progress) (arg0 symbol) (arg1 int)) "Set the next menu state specified by arg0 at the index specified by arg1." (set! (-> *progress-state* clear-screen) #f) (when (!= arg0 (-> this current)) @@ -855,7 +848,7 @@ ) ;; definition for method 32 of type progress -(defmethod set-menu-options progress ((this progress) (arg0 symbol)) +(defmethod set-menu-options ((this progress) (arg0 symbol)) "Set the menu options for the menu state specified by arg0." (set! (-> this current-options) #f) (case arg0 @@ -1064,7 +1057,7 @@ ;; definition for method 25 of type progress ;; WARN: Return type mismatch int vs none. -(defmethod respond-to-cpad progress ((this progress)) +(defmethod respond-to-cpad ((this progress)) (mc-get-slot-info 0 *progress-save-info*) (when (-> this current-options) (let ((option-array (-> this current-options options))) @@ -1823,13 +1816,13 @@ ) ;; definition for method 9 of type menu-option -(defmethod respond-progress menu-option ((this menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." 0 ) ;; definition for method 9 of type menu-on-off-option -(defmethod respond-progress menu-on-off-option ((this menu-on-off-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-on-off-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* on-off-choice)) (gp-0 #f) @@ -1880,7 +1873,7 @@ ) ;; definition for method 9 of type menu-yes-no-option -(defmethod respond-progress menu-yes-no-option ((this menu-yes-no-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-yes-no-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -1922,7 +1915,7 @@ ) ;; definition for method 9 of type menu-slider-option -(defmethod respond-progress menu-slider-option ((this menu-slider-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-slider-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (-> *bigmap* progress-minimap) (let ((gp-0 (-> this value-to-modify)) @@ -2005,7 +1998,7 @@ ) ;; definition for method 9 of type menu-stereo-mode-sound-option -(defmethod respond-progress menu-stereo-mode-sound-option ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (-> *bigmap* progress-minimap) (let ((a0-1 (-> *setting-control* user-default stereo-mode)) @@ -2044,7 +2037,7 @@ ) ;; definition for method 9 of type menu-main-menu-option -(defmethod respond-progress menu-main-menu-option ((this menu-main-menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-main-menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (cond ((cpad-pressed? 0 start) @@ -2140,7 +2133,7 @@ ) ;; definition for method 9 of type menu-sub-menu-option -(defmethod respond-progress menu-sub-menu-option ((this menu-sub-menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-sub-menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (and (-> *progress-state* secrets-unlocked) (not (memcard-unlocked-secrets? #f)) @@ -2201,7 +2194,7 @@ ) ;; definition for method 9 of type menu-unlocked-menu-option -(defmethod respond-progress menu-unlocked-menu-option ((this menu-unlocked-menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-unlocked-menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (memcard-unlocked-secrets? #t))) (logclear! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) @@ -2339,7 +2332,7 @@ ) ;; definition for method 9 of type menu-memcard-slot-option -(defmethod respond-progress menu-memcard-slot-option ((this menu-memcard-slot-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-memcard-slot-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (memcard-unlocked-secrets? #t) (let ((a1-2 (get-state-check-card arg0 (-> arg0 current)))) @@ -2385,7 +2378,7 @@ ) ;; definition for method 9 of type menu-already-exists-option -(defmethod respond-progress menu-already-exists-option ((this menu-already-exists-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-already-exists-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (&-> *progress-state* yes-no-choice)) (a1-2 (get-state-check-card arg0 'select-save)) @@ -2428,7 +2421,7 @@ ) ;; definition for method 9 of type menu-create-game-option -(defmethod respond-progress menu-create-game-option ((this menu-create-game-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-create-game-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2474,7 +2467,7 @@ ) ;; definition for method 9 of type menu-insufficient-space-option -(defmethod respond-progress menu-insufficient-space-option ((this menu-insufficient-space-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-insufficient-space-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s5-0 (&-> *progress-state* yes-no-choice)) (s3-0 (get-state-check-card arg0 'select-save)) @@ -2570,7 +2563,7 @@ ) ;; definition for method 9 of type menu-secrets-insufficient-space-option -(defmethod respond-progress menu-secrets-insufficient-space-option ((this menu-secrets-insufficient-space-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-secrets-insufficient-space-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (&-> *progress-state* yes-no-choice) (cond @@ -2589,7 +2582,7 @@ ) ;; definition for method 9 of type menu-video-mode-warning-option -(defmethod respond-progress menu-video-mode-warning-option ((this menu-video-mode-warning-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-video-mode-warning-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2628,7 +2621,7 @@ ) ;; definition for method 9 of type menu-video-mode-ok-option -(defmethod respond-progress menu-video-mode-ok-option ((this menu-video-mode-ok-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-video-mode-ok-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (s5-0 #f) @@ -2675,7 +2668,7 @@ ) ;; definition for method 9 of type menu-progressive-mode-warning-option -(defmethod respond-progress menu-progressive-mode-warning-option ((this menu-progressive-mode-warning-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-progressive-mode-warning-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2721,7 +2714,7 @@ ) ;; definition for method 9 of type menu-progressive-mode-ok-option -(defmethod respond-progress menu-progressive-mode-ok-option ((this menu-progressive-mode-ok-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-progressive-mode-ok-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (s5-0 #f) @@ -2770,7 +2763,7 @@ ) ;; definition for method 9 of type menu-card-removed-option -(defmethod respond-progress menu-card-removed-option ((this menu-card-removed-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-card-removed-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2782,7 +2775,7 @@ ) ;; definition for method 9 of type menu-insert-card-option -(defmethod respond-progress menu-insert-card-option ((this menu-insert-card-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-insert-card-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." *progress-save-info* (cond @@ -2800,7 +2793,7 @@ ) ;; definition for method 9 of type menu-error-loading-option -(defmethod respond-progress menu-error-loading-option ((this menu-error-loading-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-error-loading-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2812,7 +2805,7 @@ ) ;; definition for method 9 of type menu-error-auto-saving-option -(defmethod respond-progress menu-error-auto-saving-option ((this menu-error-auto-saving-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-error-auto-saving-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2824,7 +2817,7 @@ ) ;; definition for method 9 of type menu-error-disc-removed-option -(defmethod respond-progress menu-error-disc-removed-option ((this menu-error-disc-removed-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-error-disc-removed-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2838,7 +2831,7 @@ ) ;; definition for method 9 of type menu-error-reading-option -(defmethod respond-progress menu-error-reading-option ((this menu-error-reading-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-error-reading-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2850,7 +2843,7 @@ ) ;; definition for method 9 of type menu-icon-info-option -(defmethod respond-progress menu-icon-info-option ((this menu-icon-info-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-icon-info-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2862,7 +2855,7 @@ ) ;; definition for method 9 of type menu-quit-option -(defmethod respond-progress menu-quit-option ((this menu-quit-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-quit-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2907,7 +2900,7 @@ ) ;; definition for method 9 of type menu-format-card-option -(defmethod respond-progress menu-format-card-option ((this menu-format-card-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-format-card-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2953,7 +2946,7 @@ ;; definition for method 9 of type menu-select-start-option ;; WARN: disable def twice: 110. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod respond-progress menu-select-start-option ((this menu-select-start-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-select-start-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) @@ -3049,7 +3042,7 @@ ) ;; definition for method 9 of type menu-select-scene-option -(defmethod respond-progress menu-select-scene-option ((this menu-select-scene-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-select-scene-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) @@ -3125,7 +3118,7 @@ ) ;; definition for method 9 of type menu-bigmap-option -(defmethod respond-progress menu-bigmap-option ((this menu-bigmap-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-bigmap-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (handle-cpad-inputs *bigmap*) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -3134,7 +3127,7 @@ ) ;; definition for method 9 of type menu-missions-option -(defmethod respond-progress menu-missions-option ((this menu-missions-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-missions-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) @@ -3184,7 +3177,7 @@ ) ;; definition for method 9 of type menu-highscores-option -(defmethod respond-progress menu-highscores-option ((this menu-highscores-option) (progress progress) (selected? symbol)) +(defmethod respond-progress ((this menu-highscores-option) (progress progress) (selected? symbol)) "Handle progress menu navigation logic." (set! (-> progress sliding) (seek-ease (-> progress sliding) @@ -3252,7 +3245,7 @@ ) ;; definition for method 9 of type menu-secret-option -(defmethod respond-progress menu-secret-option ((this menu-secret-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-secret-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let* ((s5-1 (logtest? (-> *game-info* secrets) (game-secrets hero-mode))) (s3-0 (if (not s5-1) @@ -3371,7 +3364,7 @@ ) ;; definition for method 9 of type menu-game-option -(defmethod respond-progress menu-game-option ((this menu-game-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-game-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (-> *progress-state* game-options-vibrations) (-> *progress-state* game-options-subtitles) @@ -3592,7 +3585,7 @@ ) ;; definition for method 9 of type menu-graphic-option -(defmethod respond-progress menu-graphic-option ((this menu-graphic-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-graphic-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (-> *progress-state* graphic-options-aspect-ratio) (-> *progress-state* graphic-options-progressive-scan) @@ -3806,7 +3799,7 @@ ) ;; definition for method 9 of type menu-qr-option -(defmethod respond-progress menu-qr-option ((this menu-qr-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress ((this menu-qr-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (-> *progress-state* qr-options-restart) (-> *progress-state* qr-options-quit) diff --git a/test/decompiler/reference/jak2/engine/ui/text-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/text-h_REF.gc index 28687948ba7..6f017de002b 100644 --- a/test/decompiler/reference/jak2/engine/ui/text-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/text-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type game-text (deftype game-text (structure) - ((id text-id :offset-assert 0) - (text string :offset-assert 4) + ((id text-id) + (text string) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type game-text -(defmethod inspect game-text ((this game-text)) +(defmethod inspect ((this game-text)) (when (not this) (set! this this) (goto cfg-4) @@ -27,21 +24,18 @@ ;; definition of type game-text-info (deftype game-text-info (basic) - ((length int32 :offset-assert 4) - (language-id int32 :offset-assert 8) - (group-name string :offset-assert 12) - (data game-text :inline :dynamic :offset-assert 16) + ((length int32) + (language-id int32) + (group-name string) + (data game-text :inline :dynamic) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (lookup-text! (_type_ text-id symbol) string 9) + (lookup-text! (_type_ text-id symbol) string) ) ) ;; definition for method 3 of type game-text-info -(defmethod inspect game-text-info ((this game-text-info)) +(defmethod inspect ((this game-text-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/ui/text_REF.gc b/test/decompiler/reference/jak2/engine/ui/text_REF.gc index f153a205988..2fa21304fba 100644 --- a/test/decompiler/reference/jak2/engine/ui/text_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/text_REF.gc @@ -36,7 +36,7 @@ (kmemclose) ;; definition for method 7 of type game-text-info -(defmethod relocate game-text-info ((this game-text-info) (arg0 int)) +(defmethod relocate ((this game-text-info) (arg0 int)) (let ((v1-1 (-> *level* loading-level))) (when v1-1 (set! (-> v1-1 loaded-text-info (-> v1-1 loaded-text-info-count)) this) @@ -47,18 +47,18 @@ ) ;; definition for method 4 of type game-text-info -(defmethod length game-text-info ((this game-text-info)) +(defmethod length ((this game-text-info)) (-> this length) ) ;; definition for method 5 of type game-text-info ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of game-text-info ((this game-text-info)) +(defmethod asize-of ((this game-text-info)) (the-as int (+ (-> this type size) (* (-> this length) 8))) ) ;; definition for method 3 of type game-text-info -(defmethod inspect game-text-info ((this game-text-info)) +(defmethod inspect ((this game-text-info)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Tlanguage-id: ~D~%" (-> this language-id)) @@ -71,7 +71,7 @@ ) ;; definition for method 8 of type game-text-info -(defmethod mem-usage game-text-info ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 84 (-> arg0 length))) (set! (-> arg0 data 83 name) "string") (+! (-> arg0 data 83 count) 1) @@ -181,7 +181,7 @@ ) ;; definition for method 9 of type game-text-info -(defmethod lookup-text! game-text-info ((this game-text-info) (arg0 text-id) (arg1 symbol)) +(defmethod lookup-text! ((this game-text-info) (arg0 text-id) (arg1 symbol)) (cond ((= this #f) (cond @@ -234,7 +234,7 @@ ) ;; definition for method 23 of type level -(defmethod lookup-text level ((this level) (arg0 text-id) (arg1 symbol)) +(defmethod lookup-text ((this level) (arg0 text-id) (arg1 symbol)) (let ((v1-0 *common-text*)) (dotimes (a3-0 (-> this loaded-text-info-count)) (if (= (-> this loaded-text-info a3-0 language-id) (-> *setting-control* user-current language)) diff --git a/test/decompiler/reference/jak2/engine/util/capture-h_REF.gc b/test/decompiler/reference/jak2/engine/util/capture-h_REF.gc index 177129ceac1..e0b97a4e88c 100644 --- a/test/decompiler/reference/jak2/engine/util/capture-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/capture-h_REF.gc @@ -6,27 +6,24 @@ ;; definition of type gs-store-image-packet (deftype gs-store-image-packet (structure) - ((vifcode vif-tag 4 :offset-assert 0) - (giftag gif-tag :offset-assert 16) - (bitbltbuf gs-bitbltbuf :offset-assert 32) - (bitbltbuf-addr gs-reg64 :offset-assert 40) - (trxpos gs-trxpos :offset-assert 48) - (trxpos-addr gs-reg64 :offset-assert 56) - (trxreg gs-trxreg :offset-assert 64) - (trxreg-addr gs-reg64 :offset-assert 72) - (finish int64 :offset-assert 80) - (finish-addr gs-reg64 :offset-assert 88) - (trxdir gs-trxdir :offset-assert 96) - (trxdir-addr gs-reg64 :offset-assert 104) + ((vifcode vif-tag 4) + (giftag gif-tag) + (bitbltbuf gs-bitbltbuf) + (bitbltbuf-addr gs-reg64) + (trxpos gs-trxpos) + (trxpos-addr gs-reg64) + (trxreg gs-trxreg) + (trxreg-addr gs-reg64) + (finish int64) + (finish-addr gs-reg64) + (trxdir gs-trxdir) + (trxdir-addr gs-reg64) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type gs-store-image-packet ;; INFO: Used lq/sq -(defmethod inspect gs-store-image-packet ((this gs-store-image-packet)) +(defmethod inspect ((this gs-store-image-packet)) (when (not this) (set! this this) (goto cfg-4) @@ -50,19 +47,16 @@ ;; definition of type screen-shot-work (deftype screen-shot-work (structure) - ((count int16 :offset-assert 0) - (size int16 :offset-assert 2) - (name string :offset-assert 4) - (highres-enable symbol :offset-assert 8) - (hud-enable symbol :offset-assert 12) + ((count int16) + (size int16) + (name string) + (highres-enable symbol) + (hud-enable symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type screen-shot-work -(defmethod inspect screen-shot-work ((this screen-shot-work)) +(defmethod inspect ((this screen-shot-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/util/glist-h_REF.gc b/test/decompiler/reference/jak2/engine/util/glist-h_REF.gc index 223c4e992c8..2db419f5d16 100644 --- a/test/decompiler/reference/jak2/engine/util/glist-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/glist-h_REF.gc @@ -6,16 +6,13 @@ ;; definition of type glst-node (deftype glst-node (structure) - ((next glst-node :offset-assert 0) - (prev glst-node :offset-assert 4) + ((next glst-node) + (prev glst-node) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type glst-node -(defmethod inspect glst-node ((this glst-node)) +(defmethod inspect ((this glst-node)) (when (not this) (set! this this) (goto cfg-4) @@ -29,15 +26,12 @@ ;; definition of type glst-named-node (deftype glst-named-node (glst-node) - ((privname string :offset-assert 8) + ((privname string) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type glst-named-node -(defmethod inspect glst-named-node ((this glst-named-node)) +(defmethod inspect ((this glst-named-node)) (when (not this) (set! this this) (goto cfg-4) @@ -52,18 +46,15 @@ ;; definition of type glst-list (deftype glst-list (structure) - ((head glst-node :offset-assert 0) - (tail glst-node :offset-assert 4) - (tailpred glst-node :offset-assert 8) - (numelem int32 :offset-assert 12) + ((head glst-node) + (tail glst-node) + (tailpred glst-node) + (numelem int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type glst-list -(defmethod inspect glst-list ((this glst-list)) +(defmethod inspect ((this glst-list)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/util/profile-h_REF.gc b/test/decompiler/reference/jak2/engine/util/profile-h_REF.gc index bf2ff76feec..72973f0b1fe 100644 --- a/test/decompiler/reference/jak2/engine/util/profile-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/profile-h_REF.gc @@ -3,24 +3,21 @@ ;; definition of type profile-segment (deftype profile-segment (structure) - ((name symbol :offset-assert 0) - (start-time int16 :offset-assert 4) - (end-time int16 :offset-assert 6) - (count uint8 :offset-assert 8) - (vu-count uint8 :offset-assert 9) - (depth uint16 :offset-assert 10) - (color rgba :offset-assert 12) - (code-time uint16 :offset 4) - (vu-time uint16 :offset 6) + ((name symbol) + (start-time int16) + (end-time int16) + (count uint8) + (vu-count uint8) + (depth uint16) + (color rgba) + (code-time uint16 :overlay-at start-time) + (vu-time uint16 :overlay-at end-time) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type profile-segment -(defmethod inspect profile-segment ((this profile-segment)) +(defmethod inspect ((this profile-segment)) (when (not this) (set! this this) (goto cfg-4) @@ -41,16 +38,13 @@ ;; definition of type profile-collapse (deftype profile-collapse (structure) - ((count int32 :offset-assert 0) - (data profile-segment 48 :inline :offset-assert 4) + ((count int32) + (data profile-segment 48 :inline) ) - :method-count-assert 9 - :size-assert #x304 - :flag-assert #x900000304 ) ;; definition for method 3 of type profile-collapse -(defmethod inspect profile-collapse ((this profile-collapse)) +(defmethod inspect ((this profile-collapse)) (when (not this) (set! this this) (goto cfg-4) @@ -64,26 +58,23 @@ ;; definition of type profile-segment-array (deftype profile-segment-array (basic) - ((count int16 :offset-assert 4) - (depth int8 :offset-assert 6) - (max-depth int8 :offset-assert 7) - (base-time int16 :offset-assert 8) - (segment profile-segment 9 :offset-assert 12) - (data profile-segment 512 :inline :offset-assert 48) + ((count int16) + (depth int8) + (max-depth int8) + (base-time int16) + (segment profile-segment 9) + (data profile-segment 512 :inline) ) - :method-count-assert 13 - :size-assert #x2030 - :flag-assert #xd00002030 (:methods - (get-total-time (_type_) int 9) - (start-frame! (_type_) none 10) - (start-segment! (_type_ symbol rgba) none 11) - (end-segment! (_type_) none 12) + (get-total-time (_type_) int) + (start-frame! (_type_) none) + (start-segment! (_type_ symbol rgba) none) + (end-segment! (_type_) none) ) ) ;; definition for method 3 of type profile-segment-array -(defmethod inspect profile-segment-array ((this profile-segment-array)) +(defmethod inspect ((this profile-segment-array)) (when (not this) (set! this this) (goto cfg-4) @@ -101,20 +92,17 @@ ;; definition of type profile-array (deftype profile-array (structure) - ((data profile-segment-array 2 :offset-assert 0) + ((data profile-segment-array 2) ) - :method-count-assert 12 - :size-assert #x8 - :flag-assert #xc00000008 (:methods - (setup-categories! (_type_) none 9) - (draw-bars! (_type_ dma-buffer int) none 10) - (draw-text! (_type_) none 11) + (setup-categories! (_type_) none) + (draw-bars! (_type_ dma-buffer int) none) + (draw-text! (_type_) none) ) ) ;; definition for method 3 of type profile-array -(defmethod inspect profile-array ((this profile-array)) +(defmethod inspect ((this profile-array)) (when (not this) (set! this this) (goto cfg-4) @@ -126,7 +114,7 @@ ) ;; definition for method 9 of type profile-segment-array -(defmethod get-total-time profile-segment-array ((this profile-segment-array)) +(defmethod get-total-time ((this profile-segment-array)) (- (-> this data 0 end-time) (-> this data 0 start-time)) ) diff --git a/test/decompiler/reference/jak2/engine/util/profile_REF.gc b/test/decompiler/reference/jak2/engine/util/profile_REF.gc index 038928763c6..a777f3c3985 100644 --- a/test/decompiler/reference/jak2/engine/util/profile_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/profile_REF.gc @@ -3,17 +3,14 @@ ;; definition of type profile-work (deftype profile-work (structure) - ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) - (line-tmpl dma-gif-packet :inline :offset-assert 32) - (last-index int32 :offset-assert 64) + ((sprite-tmpl dma-gif-packet :inline) + (line-tmpl dma-gif-packet :inline) + (last-index int32) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) ;; definition for method 3 of type profile-work -(defmethod inspect profile-work ((this profile-work)) +(defmethod inspect ((this profile-work)) (when (not this) (set! this this) (goto cfg-4) @@ -77,7 +74,7 @@ ;; definition for method 10 of type profile-segment-array ;; WARN: Return type mismatch int vs none. -(defmethod start-frame! profile-segment-array ((this profile-segment-array)) +(defmethod start-frame! ((this profile-segment-array)) (set! (-> this count) 0) (set! (-> this depth) 0) (set! (-> this max-depth) 0) @@ -89,7 +86,7 @@ ;; definition for method 11 of type profile-segment-array ;; WARN: Return type mismatch int vs none. -(defmethod start-segment! profile-segment-array ((this profile-segment-array) (arg0 symbol) (arg1 rgba)) +(defmethod start-segment! ((this profile-segment-array) (arg0 symbol) (arg1 rgba)) (when (and *dproc* *debug-segment*) (let ((s4-0 (-> this data (-> this count)))) (let ((s3-0 (-> this base-time))) @@ -110,7 +107,7 @@ ;; definition for method 12 of type profile-segment-array ;; WARN: Return type mismatch int vs none. -(defmethod end-segment! profile-segment-array ((this profile-segment-array)) +(defmethod end-segment! ((this profile-segment-array)) (when (and *dproc* *debug-segment*) (let* ((v1-4 (+ (-> this depth) -1)) (s5-0 (-> this segment v1-4)) @@ -402,7 +399,7 @@ ;; definition for method 9 of type profile-array ;; WARN: Return type mismatch int vs none. -(defmethod setup-categories! profile-array ((this profile-array)) +(defmethod setup-categories! ((this profile-array)) (dotimes (s5-0 2) (let ((s3-0 (-> *profile-array* data s5-0)) (s4-0 *profile-collapse*) @@ -561,7 +558,7 @@ ;; definition for method 10 of type profile-array ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-bars! profile-array ((this profile-array) (arg0 dma-buffer) (arg1 int)) +(defmethod draw-bars! ((this profile-array) (arg0 dma-buffer) (arg1 int)) (local-vars (sv-16 (function _varargs_ object)) (sv-32 (function _varargs_ object))) (dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) @@ -739,7 +736,7 @@ ;; definition for method 11 of type profile-array ;; WARN: Return type mismatch int vs none. -(defmethod draw-text! profile-array ((this profile-array)) +(defmethod draw-text! ((this profile-array)) (let ((gp-0 *profile-collapse*)) (dotimes (s5-0 (-> gp-0 count)) (when (or (nonzero? (-> gp-0 data s5-0 count)) (nonzero? (-> gp-0 data s5-0 vu-count))) diff --git a/test/decompiler/reference/jak2/engine/util/script-h_REF.gc b/test/decompiler/reference/jak2/engine/util/script-h_REF.gc index 9c2cb11fd9a..33372fbe5e4 100644 --- a/test/decompiler/reference/jak2/engine/util/script-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/script-h_REF.gc @@ -3,21 +3,18 @@ ;; definition of type script-form (deftype script-form (structure) - ((name symbol :offset-assert 0) - (spec pair :offset-assert 4) - (func (function script-context object) :offset-assert 8) + ((name symbol) + (spec pair) + (func (function script-context object)) ) :pack-me - :method-count-assert 10 - :size-assert #xc - :flag-assert #xa0000000c (:methods - (script-form-method-9 () none 9) + (script-form-method-9 () none) ) ) ;; definition for method 3 of type script-form -(defmethod inspect script-form ((this script-form)) +(defmethod inspect ((this script-form)) (when (not this) (set! this this) (goto cfg-4) @@ -32,30 +29,27 @@ ;; definition of type script-context (deftype script-context (structure) - ((load-state load-state :offset-assert 0) - (key object :offset-assert 4) - (process process :offset-assert 8) - (trans vector :offset-assert 12) - (side-effect? symbol :offset-assert 16) - (got-error? symbol :offset-assert 20) - (expr pair :offset-assert 24) - (param-count int32 :offset-assert 28) - (param object 16 :offset-assert 32) - (param-type object 16 :offset-assert 96) + ((load-state load-state) + (key object) + (process process) + (trans vector) + (side-effect? symbol) + (got-error? symbol) + (expr pair) + (param-count int32) + (param object 16) + (param-type object 16) ) - :method-count-assert 12 - :size-assert #xa0 - :flag-assert #xc000000a0 (:methods - (new (symbol type object process vector) _type_ 0) - (eval! (_type_ pair) object 9) - (script-context-method-10 (_type_ object pair) object 10) - (script-context-method-11 (_type_ pair pair symbol) symbol 11) + (new (symbol type object process vector) _type_) + (eval! (_type_ pair) object) + (script-context-method-10 (_type_ object pair) object) + (script-context-method-11 (_type_ pair pair symbol) symbol) ) ) ;; definition for method 3 of type script-context -(defmethod inspect script-context ((this script-context)) +(defmethod inspect ((this script-context)) (when (not this) (set! this this) (goto cfg-10) diff --git a/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc b/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc index 5d05ecdf060..661de6399ed 100644 --- a/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc @@ -3,30 +3,27 @@ ;; definition of type smush-control (deftype smush-control (structure) - ((start-time time-frame :offset-assert 0) - (period float :offset-assert 8) - (duration float :offset-assert 12) - (amp float :offset-assert 16) - (damp-amp float :offset-assert 20) - (damp-period float :offset-assert 24) - (ticks float :offset-assert 28) + ((start-time time-frame) + (period float) + (duration float) + (amp float) + (damp-amp float) + (damp-period float) + (ticks float) ) :pack-me - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 (:methods - (set-zero! (_type_) _type_ 9) - (update! (_type_) float 10) - (get-no-update (_type_) float 11) - (activate! (_type_ float int int float float clock) _type_ 12) - (nonzero-amplitude? (_type_) symbol 13) - (die-on-next-update! (_type_) _type_ 14) + (set-zero! (_type_) _type_) + (update! (_type_) float) + (get-no-update (_type_) float) + (activate! (_type_ float int int float float clock) _type_) + (nonzero-amplitude? (_type_) symbol) + (die-on-next-update! (_type_) _type_) ) ) ;; definition for method 3 of type smush-control -(defmethod inspect smush-control ((this smush-control)) +(defmethod inspect ((this smush-control)) (when (not this) (set! this this) (goto cfg-4) @@ -44,12 +41,12 @@ ) ;; definition for method 13 of type smush-control -(defmethod nonzero-amplitude? smush-control ((this smush-control)) +(defmethod nonzero-amplitude? ((this smush-control)) (!= (-> this amp) 0.0) ) ;; definition for method 9 of type smush-control -(defmethod set-zero! smush-control ((this smush-control)) +(defmethod set-zero! ((this smush-control)) (set! (-> this period) 0.0) (set! (-> this duration) 0.0) (set! (-> this amp) 0.0) @@ -60,7 +57,7 @@ ) ;; definition for method 10 of type smush-control -(defmethod update! smush-control ((this smush-control)) +(defmethod update! ((this smush-control)) (cond ((!= (-> this amp) 0.0) (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) @@ -90,7 +87,7 @@ ) ;; definition for method 11 of type smush-control -(defmethod get-no-update smush-control ((this smush-control)) +(defmethod get-no-update ((this smush-control)) (cond ((!= (-> this amp) 0.0) (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) @@ -109,7 +106,7 @@ ) ;; definition for method 14 of type smush-control -(defmethod die-on-next-update! smush-control ((this smush-control)) +(defmethod die-on-next-update! ((this smush-control)) (if (!= (-> this amp) 0.0) (set! (-> this damp-period) -1.0) ) @@ -117,7 +114,7 @@ ) ;; definition for method 12 of type smush-control -(defmethod activate! smush-control ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock)) +(defmethod activate! ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock)) (when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this))) (set! (-> this amp) arg0) (set! (-> this period) (the float arg1)) diff --git a/test/decompiler/reference/jak2/engine/util/sync-info-h_REF.gc b/test/decompiler/reference/jak2/engine/util/sync-info-h_REF.gc index 8c6ebf70835..cfa5db033ac 100644 --- a/test/decompiler/reference/jak2/engine/util/sync-info-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/sync-info-h_REF.gc @@ -3,23 +3,20 @@ ;; definition of type sync-info-params (deftype sync-info-params (structure) - ((sync-type symbol :offset-assert 0) - (sync-flags sync-flags :offset-assert 8) - (entity basic :offset-assert 16) - (period uint32 :offset-assert 20) - (percent float :offset-assert 24) - (ease-in float :offset-assert 28) - (ease-out float :offset-assert 32) - (pause-in float :offset-assert 36) - (pause-out float :offset-assert 40) + ((sync-type symbol) + (sync-flags sync-flags) + (entity basic) + (period uint32) + (percent float) + (ease-in float) + (ease-out float) + (pause-in float) + (pause-out float) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type sync-info-params -(defmethod inspect sync-info-params ((this sync-info-params)) +(defmethod inspect ((this sync-info-params)) (when (not this) (set! this this) (goto cfg-4) @@ -40,26 +37,23 @@ ;; definition of type sync-info (deftype sync-info (structure) - ((sync-flags sync-flags :offset-assert 0) - (offset float :offset-assert 8) - (period uint32 :offset-assert 12) + ((sync-flags sync-flags) + (offset float) + (period uint32) ) - :method-count-assert 16 - :size-assert #x10 - :flag-assert #x1000000010 (:methods - (get-current-phase-no-mod (_type_) float 9) - (get-phase-offset (_type_) float 10) - (get-norm! (_type_ int) float 11) - (get-scaled-val! (_type_ float int) float 12) - (initialize! (_type_ sync-info-params) none 13) - (get-timeframe-offset! (_type_ time-frame) time-frame 14) - (sync-now! (_type_ float) none 15) + (get-current-phase-no-mod (_type_) float) + (get-phase-offset (_type_) float) + (get-norm! (_type_ int) float) + (get-scaled-val! (_type_ float int) float) + (initialize! (_type_ sync-info-params) none) + (get-timeframe-offset! (_type_ time-frame) time-frame) + (sync-now! (_type_ float) none) ) ) ;; definition for method 3 of type sync-info -(defmethod inspect sync-info ((this sync-info)) +(defmethod inspect ((this sync-info)) (when (not this) (set! this this) (goto cfg-4) @@ -76,13 +70,10 @@ (deftype sync-linear (sync-info) () :pack-me - :method-count-assert 16 - :size-assert #x10 - :flag-assert #x1000000010 ) ;; definition for method 3 of type sync-linear -(defmethod inspect sync-linear ((this sync-linear)) +(defmethod inspect ((this sync-linear)) (when (not this) (set! this this) (goto cfg-4) @@ -97,22 +88,19 @@ ;; definition of type sync-eased (deftype sync-eased (sync-info) - ((tlo float :offset-assert 16) - (thi float :offset-assert 20) - (ylo float :offset-assert 24) - (m2 float :offset-assert 28) - (yend float :offset-assert 32) - (pause-in float :offset-assert 36) - (pause-out float :offset-assert 40) + ((tlo float) + (thi float) + (ylo float) + (m2 float) + (yend float) + (pause-in float) + (pause-out float) ) :pack-me - :method-count-assert 16 - :size-assert #x2c - :flag-assert #x100000002c ) ;; definition for method 3 of type sync-eased -(defmethod inspect sync-eased ((this sync-eased)) +(defmethod inspect ((this sync-eased)) (when (not this) (set! this this) (goto cfg-4) @@ -134,16 +122,13 @@ ;; definition of type sync-paused (deftype sync-paused (sync-info) - ((pause-in float :offset-assert 16) - (pause-out float :offset-assert 20) + ((pause-in float) + (pause-out float) ) - :method-count-assert 16 - :size-assert #x18 - :flag-assert #x1000000018 ) ;; definition for method 3 of type sync-paused -(defmethod inspect sync-paused ((this sync-paused)) +(defmethod inspect ((this sync-paused)) (when (not this) (set! this this) (goto cfg-4) @@ -160,27 +145,24 @@ ;; definition of type delayed-rand-float (deftype delayed-rand-float (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (max-val float :offset-assert 8) - (timer int32 :offset-assert 12) - (start-time time-frame :offset-assert 16) - (value float :offset-assert 24) + ((min-time int32) + (max-time int32) + (max-val float) + (timer int32) + (start-time time-frame) + (value float) ) :pack-me - :method-count-assert 13 - :size-assert #x1c - :flag-assert #xd0000001c (:methods - (set-params! (_type_ int int float) float 9) - (reset! (_type_) float 10) - (update! (_type_) float 11) - (update-and-clear! (_type_) none 12) + (set-params! (_type_ int int float) float) + (reset! (_type_) float) + (update! (_type_) float) + (update-and-clear! (_type_) none) ) ) ;; definition for method 3 of type delayed-rand-float -(defmethod inspect delayed-rand-float ((this delayed-rand-float)) +(defmethod inspect ((this delayed-rand-float)) (when (not this) (set! this this) (goto cfg-4) @@ -198,25 +180,22 @@ ;; definition of type oscillating-float (deftype oscillating-float (structure) - ((value float :offset-assert 0) - (target float :offset-assert 4) - (vel float :offset-assert 8) - (max-vel float :offset-assert 12) - (damping float :offset-assert 16) - (accel float :offset-assert 20) + ((value float) + (target float) + (vel float) + (max-vel float) + (damping float) + (accel float) ) :allow-misaligned - :method-count-assert 11 - :size-assert #x18 - :flag-assert #xb00000018 (:methods - (set-params! (_type_ float float float float) float 9) - (update! (_type_ float) float 10) + (set-params! (_type_ float float float float) float) + (update! (_type_ float) float) ) ) ;; definition for method 3 of type oscillating-float -(defmethod inspect oscillating-float ((this oscillating-float)) +(defmethod inspect ((this oscillating-float)) (when (not this) (set! this this) (goto cfg-4) @@ -234,26 +213,23 @@ ;; definition of type bouncing-float (deftype bouncing-float (structure) - ((osc oscillating-float :inline :offset-assert 0) - (max-value float :offset-assert 24) - (min-value float :offset-assert 28) - (elasticity float :offset-assert 32) - (state int32 :offset-assert 36) + ((osc oscillating-float :inline) + (max-value float) + (min-value float) + (elasticity float) + (state int32) ) :allow-misaligned - :method-count-assert 13 - :size-assert #x28 - :flag-assert #xd00000028 (:methods - (set-params! (_type_ float float float float float float float) float 9) - (update! (_type_ float) float 10) - (at-min? (_type_) symbol 11) - (at-max? (_type_) symbol 12) + (set-params! (_type_ float float float float float float float) float) + (update! (_type_ float) float) + (at-min? (_type_) symbol) + (at-max? (_type_) symbol) ) ) ;; definition for method 3 of type bouncing-float -(defmethod inspect bouncing-float ((this bouncing-float)) +(defmethod inspect ((this bouncing-float)) (when (not this) (set! this this) (goto cfg-4) @@ -270,27 +246,24 @@ ;; definition of type delayed-rand-vector (deftype delayed-rand-vector (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (xz-max float :offset-assert 8) - (y-max float :offset-assert 12) - (timer int32 :offset-assert 16) - (start-time time-frame :offset-assert 24) - (value vector :inline :offset-assert 32) + ((min-time int32) + (max-time int32) + (xz-max float) + (y-max float) + (timer int32) + (start-time time-frame) + (value vector :inline) ) - :method-count-assert 13 - :size-assert #x30 - :flag-assert #xd00000030 (:methods - (set-params! (_type_ int int float float) vector 9) - (update-now! (_type_) vector 10) - (update-with-delay! (_type_) vector 11) - (update-with-delay-or-reset! (_type_) vector 12) + (set-params! (_type_ int int float float) vector) + (update-now! (_type_) vector) + (update-with-delay! (_type_) vector) + (update-with-delay-or-reset! (_type_) vector) ) ) ;; definition for method 3 of type delayed-rand-vector -(defmethod inspect delayed-rand-vector ((this delayed-rand-vector)) +(defmethod inspect ((this delayed-rand-vector)) (when (not this) (set! this this) (goto cfg-4) @@ -309,24 +282,21 @@ ;; definition of type oscillating-vector (deftype oscillating-vector (structure) - ((value vector :inline :offset-assert 0) - (target vector :inline :offset-assert 16) - (vel vector :inline :offset-assert 32) - (max-vel float :offset-assert 48) - (damping float :offset-assert 52) - (accel float :offset-assert 56) + ((value vector :inline) + (target vector :inline) + (vel vector :inline) + (max-vel float) + (damping float) + (accel float) ) - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (set-params! (_type_ vector float float float) vector 9) - (update! (_type_ vector) vector 10) + (set-params! (_type_ vector float float float) vector) + (update! (_type_ vector) vector) ) ) ;; definition for method 3 of type oscillating-vector -(defmethod inspect oscillating-vector ((this oscillating-vector)) +(defmethod inspect ((this oscillating-vector)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/engine/util/sync-info_REF.gc b/test/decompiler/reference/jak2/engine/util/sync-info_REF.gc index f92182b7bf2..7aa6430bfe1 100644 --- a/test/decompiler/reference/jak2/engine/util/sync-info_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/sync-info_REF.gc @@ -3,14 +3,14 @@ ;; definition for method 13 of type sync-info ;; WARN: Return type mismatch object vs none. -(defmethod initialize! sync-info ((this sync-info) (arg0 sync-info-params)) +(defmethod initialize! ((this sync-info) (arg0 sync-info-params)) "Set up a sync-info from params." (format 0 "ERROR: Invalid call to sync-info::initialize!~%") (none) ) ;; definition for method 9 of type sync-info -(defmethod get-current-phase-no-mod sync-info ((this sync-info)) +(defmethod get-current-phase-no-mod ((this sync-info)) "Get the current value, with no fancy modifications." (let* ((v1-0 (-> this period)) (f0-1 (the float v1-0)) @@ -21,14 +21,14 @@ ) ;; definition for method 10 of type sync-info -(defmethod get-phase-offset sync-info ((this sync-info)) +(defmethod get-phase-offset ((this sync-info)) "Get the offset, as a fraction of period" (/ (-> this offset) (the float (-> this period))) ) ;; definition for method 15 of type sync-info ;; WARN: Return type mismatch int vs none. -(defmethod sync-now! sync-info ((this sync-info) (arg0 float)) +(defmethod sync-now! ((this sync-info) (arg0 float)) "Adjust our offset so our current phase is the given phase." (let* ((a2-0 (-> this period)) (f0-1 (the float a2-0)) @@ -44,20 +44,20 @@ ) ;; definition for method 11 of type sync-info -(defmethod get-norm! sync-info ((this sync-info) (arg0 int)) +(defmethod get-norm! ((this sync-info) (arg0 int)) "Get the current value, from 0 to 1." (format 0 "ERROR: Unsupported sync-info::get-norm!~%") 0.0 ) ;; definition for method 12 of type sync-info -(defmethod get-scaled-val! sync-info ((this sync-info) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! ((this sync-info) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" (* (get-norm! this arg1) arg0) ) ;; definition for method 14 of type sync-info -(defmethod get-timeframe-offset! sync-info ((this sync-info) (arg0 time-frame)) +(defmethod get-timeframe-offset! ((this sync-info) (arg0 time-frame)) "Get the difference between the given time-frame and when this sync-info is at 0." (if (zero? arg0) (set! arg0 (current-time)) @@ -73,7 +73,7 @@ ;; definition for method 13 of type sync-linear ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod initialize! sync-linear ((this sync-linear) (arg0 sync-info-params)) +(defmethod initialize! ((this sync-linear) (arg0 sync-info-params)) "Set up a sync-info from params." (local-vars (sv-16 res-tag)) (if (!= (-> arg0 sync-type) 'sync-linear) @@ -109,7 +109,7 @@ ) ;; definition for method 11 of type sync-linear -(defmethod get-norm! sync-linear ((this sync-linear) (arg0 int)) +(defmethod get-norm! ((this sync-linear) (arg0 int)) "Get the current value, from 0 to 1." (if (zero? arg0) (set! arg0 (the-as int (current-time))) @@ -139,7 +139,7 @@ ) ;; definition for method 12 of type sync-linear -(defmethod get-scaled-val! sync-linear ((this sync-linear) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! ((this sync-linear) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" (* (get-norm! this arg1) arg0) ) @@ -147,7 +147,7 @@ ;; definition for method 13 of type sync-eased ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod initialize! sync-eased ((this sync-eased) (arg0 sync-info-params)) +(defmethod initialize! ((this sync-eased) (arg0 sync-info-params)) "Set up a sync-info from params." (local-vars (sv-16 res-tag)) (if (!= (-> arg0 sync-type) 'sync-eased) @@ -247,7 +247,7 @@ ) ;; definition for method 11 of type sync-eased -(defmethod get-norm! sync-eased ((this sync-eased) (arg0 int)) +(defmethod get-norm! ((this sync-eased) (arg0 int)) "Get the current value, from 0 to 1." (if (zero? arg0) (set! arg0 (the-as int (current-time))) @@ -314,7 +314,7 @@ ) ;; definition for method 12 of type sync-eased -(defmethod get-scaled-val! sync-eased ((this sync-eased) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! ((this sync-eased) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" (* (get-norm! this arg1) arg0) ) @@ -322,7 +322,7 @@ ;; definition for method 13 of type sync-paused ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod initialize! sync-paused ((this sync-paused) (arg0 sync-info-params)) +(defmethod initialize! ((this sync-paused) (arg0 sync-info-params)) "Set up a sync-info from params." (local-vars (sv-16 res-tag)) (if (!= (-> arg0 sync-type) 'sync-paused) @@ -384,7 +384,7 @@ ) ;; definition for method 11 of type sync-paused -(defmethod get-norm! sync-paused ((this sync-paused) (arg0 int)) +(defmethod get-norm! ((this sync-paused) (arg0 int)) "Get the current value, from 0 to 1." (if (zero? arg0) (set! arg0 (the-as int (current-time))) @@ -431,13 +431,13 @@ ) ;; definition for method 12 of type sync-paused -(defmethod get-scaled-val! sync-paused ((this sync-paused) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! ((this sync-paused) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" (* (get-norm! this arg1) arg0) ) ;; definition for method 9 of type delayed-rand-float -(defmethod set-params! delayed-rand-float ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) +(defmethod set-params! ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) (set! (-> this max-val) (* 0.5 arg2)) @@ -448,14 +448,14 @@ ) ;; definition for method 10 of type delayed-rand-float -(defmethod reset! delayed-rand-float ((this delayed-rand-float)) +(defmethod reset! ((this delayed-rand-float)) (set-time! (-> this start-time)) (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) (set! (-> this value) (rand-vu-float-range (- (-> this max-val)) (-> this max-val))) ) ;; definition for method 11 of type delayed-rand-float -(defmethod update! delayed-rand-float ((this delayed-rand-float)) +(defmethod update! ((this delayed-rand-float)) (if (time-elapsed? (-> this start-time) (-> this timer)) (reset! this) ) @@ -464,7 +464,7 @@ ;; definition for method 12 of type delayed-rand-float ;; WARN: Return type mismatch float vs none. -(defmethod update-and-clear! delayed-rand-float ((this delayed-rand-float)) +(defmethod update-and-clear! ((this delayed-rand-float)) (if (time-elapsed? (-> this start-time) (-> this timer)) (reset! this) (set! (-> this value) 0.0) @@ -474,7 +474,7 @@ ) ;; definition for method 9 of type oscillating-float -(defmethod set-params! oscillating-float ((this oscillating-float) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) +(defmethod set-params! ((this oscillating-float) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) (set! (-> this value) arg0) (set! (-> this target) arg0) (set! (-> this vel) 0.0) @@ -485,7 +485,7 @@ ) ;; definition for method 10 of type oscillating-float -(defmethod update! oscillating-float ((this oscillating-float) (arg0 float)) +(defmethod update! ((this oscillating-float) (arg0 float)) (with-pp (let ((f0-3 (* (- (+ (-> this target) arg0) (-> this value)) (* (-> this accel) (-> pp clock time-adjust-ratio))))) (+! (-> this vel) f0-3) @@ -498,15 +498,15 @@ ) ;; definition for method 9 of type bouncing-float -(defmethod set-params! bouncing-float ((this bouncing-float) - (arg0 float) - (arg1 float) - (arg2 float) - (arg3 float) - (arg4 float) - (arg5 float) - (arg6 float) - ) +(defmethod set-params! ((this bouncing-float) + (arg0 float) + (arg1 float) + (arg2 float) + (arg3 float) + (arg4 float) + (arg5 float) + (arg6 float) + ) (set-params! (-> this osc) arg0 arg4 arg5 arg6) (set! (-> this max-value) arg1) (set! (-> this min-value) arg2) @@ -516,7 +516,7 @@ ) ;; definition for method 10 of type bouncing-float -(defmethod update! bouncing-float ((this bouncing-float) (arg0 float)) +(defmethod update! ((this bouncing-float) (arg0 float)) (update! (-> this osc) arg0) (set! (-> this state) 0) (when (>= (-> this osc value) (-> this max-value)) @@ -537,17 +537,17 @@ ) ;; definition for method 11 of type bouncing-float -(defmethod at-min? bouncing-float ((this bouncing-float)) +(defmethod at-min? ((this bouncing-float)) (= (-> this state) -1) ) ;; definition for method 12 of type bouncing-float -(defmethod at-max? bouncing-float ((this bouncing-float)) +(defmethod at-max? ((this bouncing-float)) (= (-> this state) 1) ) ;; definition for method 9 of type delayed-rand-vector -(defmethod set-params! delayed-rand-vector ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) +(defmethod set-params! ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) (set! (-> this xz-max) (* 0.5 arg2)) @@ -559,7 +559,7 @@ ) ;; definition for method 10 of type delayed-rand-vector -(defmethod update-now! delayed-rand-vector ((this delayed-rand-vector)) +(defmethod update-now! ((this delayed-rand-vector)) (set-time! (-> this start-time)) (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) (set! (-> this value x) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) @@ -569,7 +569,7 @@ ) ;; definition for method 11 of type delayed-rand-vector -(defmethod update-with-delay! delayed-rand-vector ((this delayed-rand-vector)) +(defmethod update-with-delay! ((this delayed-rand-vector)) (if (time-elapsed? (-> this start-time) (-> this timer)) (update-now! this) ) @@ -577,7 +577,7 @@ ) ;; definition for method 12 of type delayed-rand-vector -(defmethod update-with-delay-or-reset! delayed-rand-vector ((this delayed-rand-vector)) +(defmethod update-with-delay-or-reset! ((this delayed-rand-vector)) (if (time-elapsed? (-> this start-time) (-> this timer)) (update-now! this) (vector-reset! (-> this value)) @@ -587,7 +587,7 @@ ;; definition for method 9 of type oscillating-vector ;; INFO: Used lq/sq -(defmethod set-params! oscillating-vector ((this oscillating-vector) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod set-params! ((this oscillating-vector) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 (set! (-> this value quad) (-> arg0 quad)) @@ -606,7 +606,7 @@ ) ;; definition for method 10 of type oscillating-vector -(defmethod update! oscillating-vector ((this oscillating-vector) (arg0 vector)) +(defmethod update! ((this oscillating-vector) (arg0 vector)) (with-pp (let ((v1-0 (new 'stack-no-clear 'vector))) (cond diff --git a/test/decompiler/reference/jak2/engine/util/types-h_REF.gc b/test/decompiler/reference/jak2/engine/util/types-h_REF.gc index 79e969d46dc..bc21be9522d 100644 --- a/test/decompiler/reference/jak2/engine/util/types-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/types-h_REF.gc @@ -4,11 +4,7 @@ ;; definition of type part-id (deftype part-id (uint32) () - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; failed to figure out what this is: 0 - diff --git a/test/decompiler/reference/jak2/kernel/dgo-h_REF.gc b/test/decompiler/reference/jak2/kernel/dgo-h_REF.gc index 7fc9c204484..742b75d970c 100644 --- a/test/decompiler/reference/jak2/kernel/dgo-h_REF.gc +++ b/test/decompiler/reference/jak2/kernel/dgo-h_REF.gc @@ -3,16 +3,13 @@ ;; definition of type dgo-entry (deftype dgo-entry (structure) - ((offset uint32 :offset-assert 0) - (length uint32 :offset-assert 4) + ((offset uint32) + (length uint32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type dgo-entry -(defmethod inspect dgo-entry ((this dgo-entry)) +(defmethod inspect ((this dgo-entry)) (when (not this) (set! this this) (goto cfg-4) @@ -26,18 +23,15 @@ ;; definition of type dgo-file (deftype dgo-file (basic) - ((num-go-files uint32 :offset-assert 4) - (total-length uint32 :offset-assert 8) - (rsvd uint32 :offset-assert 12) - (data uint8 :dynamic :offset-assert 16) + ((num-go-files uint32) + (total-length uint32) + (rsvd uint32) + (data uint8 :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type dgo-file -(defmethod inspect dgo-file ((this dgo-file)) +(defmethod inspect ((this dgo-file)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/kernel/gcommon_REF.gc b/test/decompiler/reference/jak2/kernel/gcommon_REF.gc index b422e5a1f0c..584e8966d06 100644 --- a/test/decompiler/reference/jak2/kernel/gcommon_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gcommon_REF.gc @@ -106,13 +106,10 @@ (z float :offset 64 :size 32) (w float :offset 96 :size 32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vec4s -(defmethod inspect vec4s ((this vec4s)) +(defmethod inspect ((this vec4s)) (when (not this) (set! this this) (goto cfg-4) @@ -127,28 +124,25 @@ ) ;; definition for method 2 of type vec4s -(defmethod print vec4s ((this vec4s)) +(defmethod print ((this vec4s)) (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) this ) ;; definition of type vector (deftype vector (structure) - ((data float 4 :offset-assert 0) - (x float :offset 0) - (y float :offset 4) - (z float :offset 8) - (w float :offset 12) - (quad uint128 :offset 0) + ((data float 4) + (x float :overlay-at (-> data 0)) + (y float :overlay-at (-> data 1)) + (z float :overlay-at (-> data 2)) + (w float :overlay-at (-> data 3)) + (quad uint128 :overlay-at (-> data 0)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vector ;; INFO: Used lq/sq -(defmethod inspect vector ((this vector)) +(defmethod inspect ((this vector)) (when (not this) (set! this this) (goto cfg-4) @@ -166,15 +160,12 @@ ;; definition of type bfloat (deftype bfloat (basic) - ((data float :offset-assert 4) + ((data float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type bfloat -(defmethod inspect bfloat ((this bfloat)) +(defmethod inspect ((this bfloat)) (when (not this) (set! this this) (goto cfg-4) @@ -186,14 +177,14 @@ ) ;; definition for method 2 of type bfloat -(defmethod print bfloat ((this bfloat)) +(defmethod print ((this bfloat)) (format #t "~f" (-> this data)) this ) ;; definition for method 5 of type type ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of type ((this type)) +(defmethod asize-of ((this type)) (the-as int (logand (the-as uint #xfffffff0) (+ (* (-> this allocated-length) 4) 43))) ) @@ -276,7 +267,7 @@ ) ;; definition for method 4 of type pair -(defmethod length pair ((this pair)) +(defmethod length ((this pair)) (local-vars (v0-0 int)) (cond ((null? this) @@ -297,7 +288,7 @@ ;; definition for method 5 of type pair ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of pair ((this pair)) +(defmethod asize-of ((this pair)) (the-as int (-> pair size)) ) @@ -497,20 +488,17 @@ ;; definition of type inline-array-class (deftype inline-array-class (basic) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (_data uint8 :dynamic :offset 16) + ((length int32) + (allocated-length int32) + (_data uint8 :dynamic :offset 16) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) ;; definition for method 3 of type inline-array-class -(defmethod inspect inline-array-class ((this inline-array-class)) +(defmethod inspect ((this inline-array-class)) (when (not this) (set! this this) (goto cfg-4) @@ -540,13 +528,13 @@ ) ;; definition for method 4 of type inline-array-class -(defmethod length inline-array-class ((this inline-array-class)) +(defmethod length ((this inline-array-class)) (-> this length) ) ;; definition for method 5 of type inline-array-class ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of inline-array-class ((this inline-array-class)) +(defmethod asize-of ((this inline-array-class)) (the-as int (+ (-> this type size) (* (-> this allocated-length) (the-as int (-> this type heap-base))))) ) @@ -574,7 +562,7 @@ ;; definition for method 2 of type array ;; INFO: Used lq/sq -(defmethod print array ((this array)) +(defmethod print ((this array)) (format #t "#(") (cond ((type-type? (-> this content-type) integer) @@ -724,7 +712,7 @@ ;; definition for method 3 of type array ;; INFO: Used lq/sq -(defmethod inspect array ((this array)) +(defmethod inspect ((this array)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) (format #t "~Tlength: ~D~%" (-> this length)) @@ -800,13 +788,13 @@ ) ;; definition for method 4 of type array -(defmethod length array ((this array)) +(defmethod length ((this array)) (-> this length) ) ;; definition for method 5 of type array ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of array ((this array)) +(defmethod asize-of ((this array)) (the-as int (+ (-> this type size) (* (-> this allocated-length) (if (type-type? (-> this content-type) number) diff --git a/test/decompiler/reference/jak2/kernel/gkernel-h_REF.gc b/test/decompiler/reference/jak2/kernel/gkernel-h_REF.gc index 15ac4db2889..5d4cc4385ff 100644 --- a/test/decompiler/reference/jak2/kernel/gkernel-h_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gkernel-h_REF.gc @@ -3,27 +3,24 @@ ;; definition of type kernel-context (deftype kernel-context (basic) - ((prevent-from-run process-mask :offset-assert 4) - (require-for-run process-mask :offset-assert 8) - (allow-to-run process-mask :offset-assert 12) - (next-pid int32 :offset-assert 16) - (fast-stack-top pointer :offset-assert 20) - (current-process process :offset-assert 24) - (relocating-process basic :offset-assert 28) - (relocating-min int32 :offset-assert 32) - (relocating-max int32 :offset-assert 36) - (relocating-offset int32 :offset-assert 40) - (relocating-level level :offset-assert 44) - (low-memory-message symbol :offset-assert 48) - (login-object basic :offset-assert 52) + ((prevent-from-run process-mask) + (require-for-run process-mask) + (allow-to-run process-mask) + (next-pid int32) + (fast-stack-top pointer) + (current-process process) + (relocating-process basic) + (relocating-min int32) + (relocating-max int32) + (relocating-offset int32) + (relocating-level level) + (low-memory-message symbol) + (login-object basic) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) ;; definition for method 3 of type kernel-context -(defmethod inspect kernel-context ((this kernel-context)) +(defmethod inspect ((this kernel-context)) (when (not this) (set! this this) (goto cfg-4) @@ -49,43 +46,37 @@ ;; definition of type time-frame (deftype time-frame (int64) () - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition of type clock (deftype clock (basic) - ((index int32 :offset-assert 4) - (mask process-mask :offset-assert 8) - (clock-ratio float :offset-assert 12) - (accum float :offset-assert 16) - (integral-accum float :offset-assert 20) - (frame-counter time-frame :offset-assert 24) - (old-frame-counter time-frame :offset-assert 32) - (integral-frame-counter uint64 :offset-assert 40) - (old-integral-frame-counter uint64 :offset-assert 48) - (sparticle-data vector :inline :offset-assert 64) - (seconds-per-frame float :offset-assert 80) - (frames-per-second float :offset-assert 84) - (time-adjust-ratio float :offset-assert 88) + ((index int32) + (mask process-mask) + (clock-ratio float) + (accum float) + (integral-accum float) + (frame-counter time-frame) + (old-frame-counter time-frame) + (integral-frame-counter uint64) + (old-integral-frame-counter uint64) + (sparticle-data vector :inline) + (seconds-per-frame float) + (frames-per-second float) + (time-adjust-ratio float) ) - :method-count-assert 15 - :size-assert #x5c - :flag-assert #xf0000005c (:methods - (new (symbol type int) _type_ 0) - (update-rates! (_type_ float) float 9) - (advance-by! (_type_ float) clock 10) - (tick! (_type_) clock 11) - (save! (_type_ (pointer uint64)) int 12) - (load! (_type_ (pointer uint64)) int 13) - (reset! (_type_) none 14) + (new (symbol type int) _type_) + (update-rates! (_type_ float) float) + (advance-by! (_type_ float) clock) + (tick! (_type_) clock) + (save! (_type_ (pointer uint64)) int) + (load! (_type_ (pointer uint64)) int) + (reset! (_type_) none) ) ) ;; definition for method 3 of type clock -(defmethod inspect clock ((this clock)) +(defmethod inspect ((this clock)) (when (not this) (set! this this) (goto cfg-4) @@ -123,28 +114,25 @@ ;; definition of type thread (deftype thread (basic) - ((name symbol :offset-assert 4) - (process process :offset-assert 8) - (previous thread :offset-assert 12) - (suspend-hook (function cpu-thread none) :offset-assert 16) - (resume-hook (function cpu-thread none) :offset-assert 20) - (pc pointer :offset-assert 24) - (sp pointer :offset-assert 28) - (stack-top pointer :offset-assert 32) - (stack-size int32 :offset-assert 36) + ((name symbol) + (process process) + (previous thread) + (suspend-hook (function cpu-thread none)) + (resume-hook (function cpu-thread none)) + (pc pointer) + (sp pointer) + (stack-top pointer) + (stack-size int32) ) - :method-count-assert 12 - :size-assert #x28 - :flag-assert #xc00000028 (:methods - (stack-size-set! (_type_ int) none 9) - (thread-suspend (_type_) none 10) - (thread-resume (_type_) none 11) + (stack-size-set! (_type_ int) none) + (thread-suspend (_type_) none) + (thread-resume (_type_) none) ) ) ;; definition for method 3 of type thread -(defmethod inspect thread ((this thread)) +(defmethod inspect ((this thread)) (when (not this) (set! this this) (goto cfg-4) @@ -165,20 +153,17 @@ ;; definition of type cpu-thread (deftype cpu-thread (thread) - ((rreg uint64 7 :offset-assert 40) - (freg float 8 :offset-assert 96) - (stack uint8 :dynamic :offset-assert 128) + ((rreg uint64 7) + (freg float 8) + (stack uint8 :dynamic) ) - :method-count-assert 12 - :size-assert #x80 - :flag-assert #xc00000080 (:methods - (new (symbol type process symbol int pointer) _type_ 0) + (new (symbol type process symbol int pointer) _type_) ) ) ;; definition for method 3 of type cpu-thread -(defmethod inspect cpu-thread ((this cpu-thread)) +(defmethod inspect ((this cpu-thread)) (when (not this) (set! this this) (goto cfg-4) @@ -203,18 +188,15 @@ ;; definition of type dead-pool (deftype dead-pool (process-tree) () - :method-count-assert 16 - :size-assert #x24 - :flag-assert #x1000000024 (:methods - (new (symbol type int int string) _type_ 0) - (get-process (_type_ type int) process 14) - (return-process (_type_ process) none 15) + (new (symbol type int int string) _type_) + (get-process (_type_ type int) process) + (return-process (_type_ process) none) ) ) ;; definition for method 3 of type dead-pool -(defmethod inspect dead-pool ((this dead-pool)) +(defmethod inspect ((this dead-pool)) (when (not this) (set! this this) (goto cfg-68) @@ -333,18 +315,15 @@ ;; definition of type dead-pool-heap-rec (deftype dead-pool-heap-rec (structure) - ((process process :offset-assert 0) - (prev dead-pool-heap-rec :offset-assert 4) - (next dead-pool-heap-rec :offset-assert 8) + ((process process) + (prev dead-pool-heap-rec) + (next dead-pool-heap-rec) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type dead-pool-heap-rec -(defmethod inspect dead-pool-heap-rec ((this dead-pool-heap-rec)) +(defmethod inspect ((this dead-pool-heap-rec)) (when (not this) (set! this this) (goto cfg-4) @@ -359,42 +338,39 @@ ;; definition of type dead-pool-heap (deftype dead-pool-heap (dead-pool) - ((allocated-length int32 :offset-assert 36) - (compact-time uint32 :offset-assert 40) - (compact-count-targ uint32 :offset-assert 44) - (compact-count uint32 :offset-assert 48) - (fill-percent float :offset-assert 52) - (first-gap dead-pool-heap-rec :offset-assert 56) - (first-shrink dead-pool-heap-rec :offset-assert 60) - (heap kheap :inline :offset-assert 64) - (alive-list dead-pool-heap-rec :inline :offset-assert 80) - (last dead-pool-heap-rec :offset 84) - (dead-list dead-pool-heap-rec :inline :offset-assert 92) - (process-list dead-pool-heap-rec :inline :dynamic :offset-assert 104) + ((allocated-length int32) + (compact-time uint32) + (compact-count-targ uint32) + (compact-count uint32) + (fill-percent float) + (first-gap dead-pool-heap-rec) + (first-shrink dead-pool-heap-rec) + (heap kheap :inline) + (alive-list dead-pool-heap-rec :inline) + (last dead-pool-heap-rec :overlay-at (-> alive-list prev)) + (dead-list dead-pool-heap-rec :inline) + (process-list dead-pool-heap-rec :inline :dynamic) ) - :method-count-assert 28 - :size-assert #x68 - :flag-assert #x1c00000068 (:methods - (new (symbol type string int int) _type_ 0) - (init (_type_ symbol int) none 16) - (compact (dead-pool-heap int) none 17) - (shrink-heap (dead-pool-heap process) dead-pool-heap 18) - (churn (dead-pool-heap int) none 19) - (memory-used (_type_) int 20) - (memory-total (_type_) int 21) - (memory-free (dead-pool-heap) int 22) - (compact-time (dead-pool-heap) uint 23) - (gap-size (dead-pool-heap dead-pool-heap-rec) int 24) - (gap-location (dead-pool-heap dead-pool-heap-rec) pointer 25) - (find-gap (dead-pool-heap dead-pool-heap-rec) dead-pool-heap-rec 26) - (find-gap-by-size (dead-pool-heap int) dead-pool-heap-rec 27) + (new (symbol type string int int) _type_) + (init (_type_ symbol int) none) + (compact (dead-pool-heap int) none) + (shrink-heap (dead-pool-heap process) dead-pool-heap) + (churn (dead-pool-heap int) none) + (memory-used (_type_) int) + (memory-total (_type_) int) + (memory-free (dead-pool-heap) int) + (compact-time (dead-pool-heap) uint) + (gap-size (dead-pool-heap dead-pool-heap-rec) int) + (gap-location (dead-pool-heap dead-pool-heap-rec) pointer) + (find-gap (dead-pool-heap dead-pool-heap-rec) dead-pool-heap-rec) + (find-gap-by-size (dead-pool-heap int) dead-pool-heap-rec) ) ) ;; definition for method 3 of type dead-pool-heap ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect dead-pool-heap ((this dead-pool-heap)) +(defmethod inspect ((this dead-pool-heap)) (when (not this) (set! this this) (goto cfg-68) @@ -525,21 +501,18 @@ ;; definition of type catch-frame (deftype catch-frame (stack-frame) - ((sp int32 :offset-assert 12) - (ra int32 :offset-assert 16) - (freg float 10 :offset-assert 20) - (rreg uint128 7 :offset-assert 64) + ((sp int32) + (ra int32) + (freg float 10) + (rreg uint128 7) ) - :method-count-assert 9 - :size-assert #xb0 - :flag-assert #x9000000b0 (:methods - (new (symbol type symbol function (pointer uint64)) object 0) + (new (symbol type symbol function (pointer uint64)) object) ) ) ;; definition for method 3 of type catch-frame -(defmethod inspect catch-frame ((this catch-frame)) +(defmethod inspect ((this catch-frame)) (when (not this) (set! this this) (goto cfg-4) @@ -557,18 +530,15 @@ ;; definition of type protect-frame (deftype protect-frame (stack-frame) - ((exit (function object) :offset-assert 12) + ((exit (function object)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type (function object)) protect-frame 0) + (new (symbol type (function object)) protect-frame) ) ) ;; definition for method 3 of type protect-frame -(defmethod inspect protect-frame ((this protect-frame)) +(defmethod inspect ((this protect-frame)) (when (not this) (set! this this) (goto cfg-4) @@ -587,13 +557,10 @@ (pid int32 :offset 32 :size 32) (u64 uint64 :offset 0 :size 64) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type handle -(defmethod inspect handle ((this handle)) +(defmethod inspect ((this handle)) (when (not this) (set! this this) (goto cfg-4) @@ -606,7 +573,7 @@ ) ;; definition for method 2 of type handle -(defmethod print handle ((this handle)) +(defmethod print ((this handle)) (if (nonzero? this) (format #t "#" (handle->process this) (-> this pid)) (format #t "#") @@ -616,22 +583,19 @@ ;; definition of type state (deftype state (protect-frame) - ((code function :offset-assert 16) - (trans (function object) :offset-assert 20) - (post function :offset-assert 24) - (enter function :offset-assert 28) - (event (function process int symbol event-message-block object) :offset-assert 32) + ((code function) + (trans (function object)) + (post function) + (enter function) + (event (function process int symbol event-message-block object)) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 (:methods - (new (symbol type symbol function (function object) function (function object) (function process int symbol event-message-block object)) _type_ 0) + (new (symbol type symbol function (function object) function (function object) (function process int symbol event-message-block object)) _type_) ) ) ;; definition for method 3 of type state -(defmethod inspect state ((this state)) +(defmethod inspect ((this state)) (when (not this) (set! this this) (goto cfg-4) @@ -651,21 +615,18 @@ ;; definition of type event-message-block (deftype event-message-block (structure) - ((to-handle handle :offset-assert 0) - (to (pointer process) :offset 0) - (form-handle handle :offset-assert 8) - (from (pointer process) :offset 8) - (param uint64 6 :offset-assert 16) - (message symbol :offset-assert 64) - (num-params int32 :offset-assert 68) + ((to-handle handle) + (to (pointer process) :overlay-at to-handle) + (form-handle handle) + (from (pointer process) :overlay-at form-handle) + (param uint64 6) + (message symbol) + (num-params int32) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) ;; definition for method 3 of type event-message-block -(defmethod inspect event-message-block ((this event-message-block)) +(defmethod inspect ((this event-message-block)) (when (not this) (set! this this) (goto cfg-8) @@ -684,18 +645,15 @@ ;; definition of type event-message-block-array (deftype event-message-block-array (inline-array-class) - ((data event-message-block :inline :dynamic :offset-assert 16) + ((data event-message-block :inline :dynamic) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (send-all! (_type_) none 9) + (send-all! (_type_) none) ) ) ;; definition for method 3 of type event-message-block-array -(defmethod inspect event-message-block-array ((this event-message-block-array)) +(defmethod inspect ((this event-message-block-array)) (when (not this) (set! this this) (goto cfg-4) @@ -713,16 +671,13 @@ ;; definition of type sql-result (deftype sql-result (basic) - ((len int32 :offset-assert 4) - (allocated-length uint32 :offset-assert 8) - (error symbol :offset-assert 12) - (data string :dynamic :offset-assert 16) + ((len int32) + (allocated-length uint32) + (error symbol) + (data string :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 (:methods - (new (symbol type uint) _type_ 0) + (new (symbol type uint) _type_) ) ) @@ -736,7 +691,7 @@ ) ;; definition for method 2 of type sql-result -(defmethod print sql-result ((this sql-result)) +(defmethod print ((this sql-result)) (format #t "#(~A" (-> this error)) (dotimes (s5-0 (-> this len)) (format #t " ~A" (-> this data s5-0)) diff --git a/test/decompiler/reference/jak2/kernel/gkernel_REF.gc b/test/decompiler/reference/jak2/kernel/gkernel_REF.gc index 54926fae533..6581ce1c3dc 100644 --- a/test/decompiler/reference/jak2/kernel/gkernel_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gkernel_REF.gc @@ -26,7 +26,7 @@ (define *last-loado-debug-usage* 0) ;; definition for method 7 of type object -(defmethod relocate object ((this object) (arg0 int)) +(defmethod relocate ((this object) (arg0 int)) this ) @@ -75,7 +75,7 @@ ;; definition for method 1 of type thread ;; WARN: Return type mismatch int vs none. -(defmethod delete thread ((this thread)) +(defmethod delete ((this thread)) (when (= this (-> this process main-thread)) (break!) 0 @@ -86,7 +86,7 @@ ) ;; definition for method 2 of type thread -(defmethod print thread ((this thread)) +(defmethod print ((this thread)) (format #t "#<~A ~S of ~S pc: #x~X @ #x~X>" @@ -101,7 +101,7 @@ ;; definition for method 9 of type thread ;; WARN: Return type mismatch int vs none. -(defmethod stack-size-set! thread ((this thread) (arg0 int)) +(defmethod stack-size-set! ((this thread) (arg0 int)) (let ((a2-0 (-> this process))) (cond ((!= this (-> a2-0 main-thread)) @@ -154,7 +154,7 @@ ;; definition for method 5 of type cpu-thread ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of cpu-thread ((this cpu-thread)) +(defmethod asize-of ((this cpu-thread)) (the-as int (+ (-> this type size) (-> this stack-size))) ) @@ -278,7 +278,7 @@ (define *pause-lock* #f) ;; definition for method 2 of type process-tree -(defmethod print process-tree ((this process-tree)) +(defmethod print ((this process-tree)) (format #t "#<~A ~S @ #x~X>" (-> this type) (-> this name) this) this ) @@ -299,7 +299,7 @@ ) ;; definition for method 3 of type process-tree -(defmethod inspect process-tree ((this process-tree)) +(defmethod inspect ((this process-tree)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~S~%" (-> this name)) (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) @@ -366,7 +366,7 @@ ) ;; definition for method 3 of type process -(defmethod inspect process ((this process)) +(defmethod inspect ((this process)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~S~%" (-> this name)) (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) @@ -405,13 +405,12 @@ ;; definition for method 5 of type process ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of process ((this process)) +(defmethod asize-of ((this process)) (the-as int (+ (-> process size) (-> this allocated-length))) ) ;; definition for method 2 of type process -;; INFO: this function exists in multiple non-identical object files -(defmethod print process ((this process)) +(defmethod print ((this process)) (cond ((and (-> this top-thread) (!= (-> this status) 'dead)) (format #t "#<~A ~S ~A :state ~S " (-> this type) (-> this name) (-> this status) (if (-> this state) @@ -485,7 +484,7 @@ ) ;; definition for method 14 of type dead-pool -(defmethod get-process dead-pool ((this dead-pool) (arg0 type) (arg1 int)) +(defmethod get-process ((this dead-pool) (arg0 type) (arg1 int)) (let ((s4-0 (the-as object (-> this child)))) (when (and (not (the-as (pointer process-tree) s4-0)) *debug-segment* (!= this *debug-dead-pool*)) (set! s4-0 (get-process *debug-dead-pool* arg0 arg1)) @@ -520,7 +519,7 @@ ;; definition for method 15 of type dead-pool ;; WARN: Return type mismatch int vs none. -(defmethod return-process dead-pool ((this dead-pool) (arg0 process)) +(defmethod return-process ((this dead-pool) (arg0 process)) (change-parent arg0 this) 0 (none) @@ -544,7 +543,7 @@ ;; definition for method 16 of type dead-pool-heap ;; WARN: Return type mismatch dead-pool-heap vs none. -(defmethod init dead-pool-heap ((this dead-pool-heap) (arg0 symbol) (arg1 int)) +(defmethod init ((this dead-pool-heap) (arg0 symbol) (arg1 int)) (countdown (v1-0 (-> this allocated-length)) (let ((a0-4 (-> this process-list v1-0))) (set! (-> a0-4 process) *null-process*) @@ -579,7 +578,7 @@ ;; definition for method 25 of type dead-pool-heap ;; WARN: Return type mismatch object vs pointer. -(defmethod gap-location dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod gap-location ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) (the-as pointer (if (-> arg0 process) @@ -590,7 +589,7 @@ ) ;; definition for method 24 of type dead-pool-heap -(defmethod gap-size dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod gap-size ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) (cond ((-> arg0 process) (let ((v1-3 (&+ (&+ (the-as pointer (-> arg0 process)) (-> process size)) (-> arg0 process allocated-length)))) @@ -610,7 +609,7 @@ ) ;; definition for method 26 of type dead-pool-heap -(defmethod find-gap dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod find-gap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) (while (and (-> arg0 next) (zero? (gap-size this arg0))) (set! arg0 (-> arg0 next)) ) @@ -619,7 +618,7 @@ ;; definition for method 3 of type dead-pool-heap ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect dead-pool-heap ((this dead-pool-heap)) +(defmethod inspect ((this dead-pool-heap)) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~Tname: ~A~%" (-> this name)) (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) @@ -667,12 +666,12 @@ ;; definition for method 5 of type dead-pool-heap ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of dead-pool-heap ((this dead-pool-heap)) +(defmethod asize-of ((this dead-pool-heap)) (the-as int (+ (-> this type size) (* 12 (-> this allocated-length)))) ) ;; definition for method 20 of type dead-pool-heap -(defmethod memory-used dead-pool-heap ((this dead-pool-heap)) +(defmethod memory-used ((this dead-pool-heap)) (if (-> this alive-list prev) (- (memory-total this) (gap-size this (-> this alive-list prev))) 0 @@ -680,12 +679,12 @@ ) ;; definition for method 21 of type dead-pool-heap -(defmethod memory-total dead-pool-heap ((this dead-pool-heap)) +(defmethod memory-total ((this dead-pool-heap)) (&- (-> this heap top) (the-as uint (-> this heap base))) ) ;; definition for method 22 of type dead-pool-heap -(defmethod memory-free dead-pool-heap ((this dead-pool-heap)) +(defmethod memory-free ((this dead-pool-heap)) (let ((v1-0 (-> this heap top))) (if (-> this alive-list prev) (gap-size this (-> this alive-list prev)) @@ -695,12 +694,12 @@ ) ;; definition for method 23 of type dead-pool-heap -(defmethod compact-time dead-pool-heap ((this dead-pool-heap)) +(defmethod compact-time ((this dead-pool-heap)) (-> this compact-time) ) ;; definition for method 27 of type dead-pool-heap -(defmethod find-gap-by-size dead-pool-heap ((this dead-pool-heap) (arg0 int)) +(defmethod find-gap-by-size ((this dead-pool-heap) (arg0 int)) (let ((gp-0 (-> this first-gap))) (while (and gp-0 (< (gap-size this gp-0) arg0)) (set! gp-0 (-> gp-0 next)) @@ -710,7 +709,7 @@ ) ;; definition for method 14 of type dead-pool-heap -(defmethod get-process dead-pool-heap ((this dead-pool-heap) (arg0 type) (arg1 int)) +(defmethod get-process ((this dead-pool-heap) (arg0 type) (arg1 int)) (let ((s4-0 (-> this dead-list next)) (s3-0 (the-as process #f)) ) @@ -770,7 +769,7 @@ ;; definition for method 15 of type dead-pool-heap ;; WARN: Return type mismatch int vs none. -(defmethod return-process dead-pool-heap ((this dead-pool-heap) (arg0 process)) +(defmethod return-process ((this dead-pool-heap) (arg0 process)) (if (!= this (-> arg0 pool)) (format 0 "ERROR: process ~A does not belong to dead-pool-heap ~A.~%" arg0 this) ) @@ -803,7 +802,7 @@ ) ;; definition for method 18 of type dead-pool-heap -(defmethod shrink-heap dead-pool-heap ((this dead-pool-heap) (arg0 process)) +(defmethod shrink-heap ((this dead-pool-heap) (arg0 process)) (when arg0 (let ((s5-0 (-> arg0 ppointer))) (when (not (or (logtest? (-> arg0 mask) (process-mask heap-shrunk)) @@ -828,7 +827,7 @@ ;; definition for method 17 of type dead-pool-heap ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 17 dead-pool-heap) has a return type of none, but the expression builder found a return statement. -(defmethod compact dead-pool-heap ((this dead-pool-heap) (arg0 int)) +(defmethod compact ((this dead-pool-heap) (arg0 int)) (if (zero? (-> this heap base)) (return 0) ) @@ -889,7 +888,7 @@ ;; definition for method 19 of type dead-pool-heap ;; WARN: Return type mismatch int vs none. -(defmethod churn dead-pool-heap ((this dead-pool-heap) (arg0 int)) +(defmethod churn ((this dead-pool-heap) (arg0 int)) (while (nonzero? arg0) (+! arg0 -1) (let ((s4-0 (-> this alive-list next))) @@ -1027,7 +1026,7 @@ ) ;; definition for method 12 of type process -(defmethod run-logic? process ((this process)) +(defmethod run-logic? ((this process)) #t ) @@ -1399,7 +1398,7 @@ ) ;; definition for method 9 of type process -(defmethod activate process ((this process) (arg0 process-tree) (arg1 basic) (arg2 pointer)) +(defmethod activate ((this process) (arg0 process-tree) (arg1 basic) (arg2 pointer)) (set! (-> this mask) (logclear (-> arg0 mask) (process-mask sleep sleep-code process-tree heap-shrunk))) (set! (-> this clock) (-> arg0 clock)) (set! (-> this status) 'ready) @@ -1472,7 +1471,7 @@ ;; definition for method 10 of type process-tree ;; WARN: Return type mismatch int vs none. -(defmethod deactivate process-tree ((this process-tree)) +(defmethod deactivate ((this process-tree)) 0 (none) ) @@ -1489,7 +1488,7 @@ ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod deactivate process ((this process)) +(defmethod deactivate ((this process)) (local-vars (s7-0 none) (ra-0 int)) (with-pp (when (!= (-> this status) 'dead) diff --git a/test/decompiler/reference/jak2/kernel/gstate_REF.gc b/test/decompiler/reference/jak2/kernel/gstate_REF.gc index 99cca00cd86..6b014a09dca 100644 --- a/test/decompiler/reference/jak2/kernel/gstate_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gstate_REF.gc @@ -36,7 +36,7 @@ ) ;; definition for method 2 of type state -(defmethod print state ((this state)) +(defmethod print ((this state)) (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) this ) @@ -151,7 +151,7 @@ ;; definition for method 9 of type event-message-block-array ;; WARN: Return type mismatch int vs none. -(defmethod send-all! event-message-block-array ((this event-message-block-array)) +(defmethod send-all! ((this event-message-block-array)) (dotimes (s5-0 (-> this length)) (let* ((a1-0 (-> this data s5-0)) (a0-2 (handle->process (-> a1-0 to-handle))) diff --git a/test/decompiler/reference/jak2/kernel/gstring_REF.gc b/test/decompiler/reference/jak2/kernel/gstring_REF.gc index e3328eb139c..fb26ab2c615 100644 --- a/test/decompiler/reference/jak2/kernel/gstring_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gstring_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 4 of type string -(defmethod length string ((this string)) +(defmethod length ((this string)) (let ((v1-0 (-> this data))) (while (nonzero? (-> v1-0 0)) (nop!) @@ -15,7 +15,7 @@ ) ;; definition for method 5 of type string -(defmethod asize-of string ((this string)) +(defmethod asize-of ((this string)) (+ (-> this allocated-length) 1 (-> string size)) ) diff --git a/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc b/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc index 6b263726c34..65020f2c6ec 100644 --- a/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc @@ -3,19 +3,15 @@ ;; definition of type ashelin-battle (deftype ashelin-battle (ashelin) - ((player-in-bounds-time time-frame :offset-assert 1040) + ((player-in-bounds-time time-frame) ) - :heap-base #x3a0 - :method-count-assert 252 - :size-assert #x418 - :flag-assert #xfc03a00418 (:methods - (set-frontline-dist! (_type_) none 251) + (set-frontline-dist! (_type_) none) ) ) ;; definition for method 3 of type ashelin-battle -(defmethod inspect ashelin-battle ((this ashelin-battle)) +(defmethod inspect ((this ashelin-battle)) (when (not this) (set! this this) (goto cfg-4) @@ -30,7 +26,7 @@ ;; definition for method 251 of type ashelin-battle ;; WARN: Return type mismatch int vs none. -(defmethod set-frontline-dist! ashelin-battle ((this ashelin-battle)) +(defmethod set-frontline-dist! ((this ashelin-battle)) (let ((a0-1 *target*)) (when a0-1 (set! (-> this frontline w) diff --git a/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc b/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc index 562e30d681d..bfe6dce510f 100644 --- a/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc @@ -3,29 +3,25 @@ ;; definition of type piston (deftype piston (process-focusable) - ((sound-trans vector :inline :offset-assert 208) - (init-height float :offset-assert 224) - (range-top float :offset-assert 228) - (range-bottom float :offset-assert 232) - (sound-time time-frame 2 :offset-assert 240) - (sync sync-eased :inline :offset-assert 256) - (piston-id int32 :offset-assert 300) - (looping-id sound-id :offset-assert 304) + ((sound-trans vector :inline) + (init-height float) + (range-top float) + (range-bottom float) + (sound-time time-frame 2) + (sync sync-eased :inline) + (piston-id int32) + (looping-id sound-id) ) - :heap-base #xc0 - :method-count-assert 31 - :size-assert #x134 - :flag-assert #x1f00c00134 - (:methods - (idle () _type_ :state 27) - (dormant-down () _type_ :state 28) - (dormant-up () _type_ :state 29) - (running () _type_ :state 30) + (:state-methods + idle + dormant-down + dormant-up + running ) ) ;; definition for method 3 of type piston -(defmethod inspect piston ((this piston)) +(defmethod inspect ((this piston)) (when (not this) (set! this this) (goto cfg-4) @@ -136,7 +132,7 @@ ) ;; definition for method 10 of type piston -(defmethod deactivate piston ((this piston)) +(defmethod deactivate ((this piston)) (sound-stop (-> this looping-id)) ((method-of-type process-focusable deactivate) this) (none) @@ -145,7 +141,7 @@ ;; definition for method 11 of type piston ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! piston ((this piston) (arg0 entity-actor)) +(defmethod init-from-entity! ((this piston) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -242,23 +238,19 @@ This commonly includes things such as: ;; definition of type turbine (deftype turbine (process-drawable) - ((dest-height float :offset-assert 200) - (rise-height float :offset-assert 204) - (rotspeed float :offset-assert 208) - (risen symbol :offset-assert 212) + ((dest-height float) + (rise-height float) + (rotspeed float) + (risen symbol) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xd8 - :flag-assert #x16006000d8 - (:methods - (idle () _type_ :state 20) - (risen () _type_ :state 21) + (:state-methods + idle + risen ) ) ;; definition for method 3 of type turbine -(defmethod inspect turbine ((this turbine)) +(defmethod inspect ((this turbine)) (when (not this) (set! this this) (goto cfg-4) @@ -332,7 +324,7 @@ This commonly includes things such as: ;; definition for method 11 of type turbine ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! turbine ((this turbine) (arg0 entity-actor)) +(defmethod init-from-entity! ((this turbine) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -403,22 +395,18 @@ This commonly includes things such as: ;; definition of type liftcat (deftype liftcat (process-drawable) - ((up-y float :offset-assert 200) - (down-y float :offset-assert 204) + ((up-y float) + (down-y float) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xd0 - :flag-assert #x17005000d0 - (:methods - (idle-up () _type_ :state 20) - (going-down () _type_ :state 21) - (idle-down () _type_ :state 22) + (:state-methods + idle-up + going-down + idle-down ) ) ;; definition for method 3 of type liftcat -(defmethod inspect liftcat ((this liftcat)) +(defmethod inspect ((this liftcat)) (when (not this) (set! this this) (goto cfg-4) @@ -509,7 +497,7 @@ This commonly includes things such as: ;; definition for method 11 of type liftcat ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! liftcat ((this liftcat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this liftcat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -595,25 +583,21 @@ This commonly includes things such as: ;; definition of type atollrotpipe (deftype atollrotpipe (process-drawable) - ((root collide-shape-moving :override) - (smush smush-control :inline :offset 200) - (init-quat quaternion :inline :offset 240) - (rot-angle float :offset 256) - (shudder-angle float :offset 260) - (cycle-time float :offset 264) - (cycle-offset float :offset 268) + ((root collide-shape-moving :override) + (smush smush-control :inline :offset 200) + (init-quat quaternion :inline :offset 240) + (rot-angle float :offset 256) + (shudder-angle float :offset 260) + (cycle-time float :offset 264) + (cycle-offset float :offset 268) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x110 - :flag-assert #x1500900110 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type atollrotpipe -(defmethod inspect atollrotpipe ((this atollrotpipe)) +(defmethod inspect ((this atollrotpipe)) (when (not this) (set! this this) (goto cfg-4) @@ -718,7 +702,7 @@ This commonly includes things such as: ;; definition for method 11 of type atollrotpipe ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atollrotpipe ((this atollrotpipe) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atollrotpipe) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -784,26 +768,22 @@ This commonly includes things such as: ;; definition of type slider (deftype slider (process-drawable) - ((root collide-shape-moving :override) - (path-pos float :offset-assert 200) - (sync sync-eased :inline :offset-assert 208) - (attack-id uint32 :offset-assert 252) - (sound-id uint32 :offset-assert 256) - (collide-off-timer uint64 :offset-assert 264) - (l-points vector 6 :inline :offset-assert 272) - (l-bolts lightning-control 4 :offset-assert 368) + ((root collide-shape-moving :override) + (path-pos float) + (sync sync-eased :inline) + (attack-id uint32) + (sound-id uint32) + (collide-off-timer uint64) + (l-points vector 6 :inline) + (l-bolts lightning-control 4) ) - :heap-base #x100 - :method-count-assert 21 - :size-assert #x180 - :flag-assert #x1501000180 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type slider -(defmethod inspect slider ((this slider)) +(defmethod inspect ((this slider)) (when (not this) (set! this this) (goto cfg-4) @@ -911,19 +891,19 @@ This commonly includes things such as: ) ;; definition for method 12 of type slider -(defmethod run-logic? slider ((this slider)) +(defmethod run-logic? ((this slider)) #t ) ;; definition for method 10 of type slider -(defmethod deactivate slider ((this slider)) +(defmethod deactivate ((this slider)) (sound-stop (the-as sound-id (-> this sound-id))) (call-parent-method this) (none) ) ;; definition for method 7 of type slider -(defmethod relocate slider ((this slider) (arg0 int)) +(defmethod relocate ((this slider) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this l-bolts v1-0)) (&+! (-> this l-bolts v1-0) arg0) @@ -935,7 +915,7 @@ This commonly includes things such as: ;; definition for method 11 of type slider ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! slider ((this slider) (arg0 entity-actor)) +(defmethod init-from-entity! ((this slider) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1058,21 +1038,17 @@ This commonly includes things such as: ;; definition of type atoll-windmill (deftype atoll-windmill (process-drawable) - ((sync sync-linear :inline :offset-assert 200) - (blade-normal vector :inline :offset-assert 224) - (orig-quat quaternion :inline :offset-assert 240) + ((sync sync-linear :inline) + (blade-normal vector :inline) + (orig-quat quaternion :inline) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #x100 - :flag-assert #x1500800100 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type atoll-windmill -(defmethod inspect atoll-windmill ((this atoll-windmill)) +(defmethod inspect ((this atoll-windmill)) (when (not this) (set! this this) (goto cfg-4) @@ -1120,7 +1096,7 @@ This commonly includes things such as: ;; definition for method 11 of type atoll-windmill ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-windmill ((this atoll-windmill) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atoll-windmill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1172,17 +1148,13 @@ This commonly includes things such as: ;; definition of type atoll-valve (deftype atoll-valve (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type atoll-valve -(defmethod inspect atoll-valve ((this atoll-valve)) +(defmethod inspect ((this atoll-valve)) (when (not this) (set! this this) (goto cfg-4) @@ -1209,7 +1181,7 @@ This commonly includes things such as: ;; definition for method 11 of type atoll-valve ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-valve ((this atoll-valve) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atoll-valve) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1233,17 +1205,13 @@ This commonly includes things such as: ;; definition of type atoll-hatch (deftype atoll-hatch (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type atoll-hatch -(defmethod inspect atoll-hatch ((this atoll-hatch)) +(defmethod inspect ((this atoll-hatch)) (when (not this) (set! this this) (goto cfg-4) @@ -1270,7 +1238,7 @@ This commonly includes things such as: ;; definition for method 11 of type atoll-hatch ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-hatch ((this atoll-hatch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atoll-hatch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1318,18 +1286,14 @@ This commonly includes things such as: ;; definition of type atoll-hellcat (deftype atoll-hellcat (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (die-fast () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + die-fast + idle ) ) ;; definition for method 3 of type atoll-hellcat -(defmethod inspect atoll-hellcat ((this atoll-hellcat)) +(defmethod inspect ((this atoll-hellcat)) (when (not this) (set! this this) (goto cfg-4) @@ -1357,7 +1321,7 @@ This commonly includes things such as: ;; definition for method 11 of type atoll-hellcat ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-hellcat ((this atoll-hellcat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atoll-hellcat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1408,17 +1372,13 @@ This commonly includes things such as: ;; definition of type atoll-mar-symbol (deftype atoll-mar-symbol (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type atoll-mar-symbol -(defmethod inspect atoll-mar-symbol ((this atoll-mar-symbol)) +(defmethod inspect ((this atoll-mar-symbol)) (when (not this) (set! this this) (goto cfg-4) @@ -1438,7 +1398,7 @@ This commonly includes things such as: ;; definition for method 11 of type atoll-mar-symbol ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-mar-symbol ((this atoll-mar-symbol) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atoll-mar-symbol) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/atoll/atoll-part_REF.gc b/test/decompiler/reference/jak2/levels/atoll/atoll-part_REF.gc index f934211259d..4fea99578a3 100644 --- a/test/decompiler/reference/jak2/levels/atoll/atoll-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/atoll-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type atoll-part (deftype atoll-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type atoll-part -(defmethod inspect atoll-part ((this atoll-part)) +(defmethod inspect ((this atoll-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/atoll/atoll-tank_REF.gc b/test/decompiler/reference/jak2/levels/atoll/atoll-tank_REF.gc index e6bc06625d9..084d42f2e86 100644 --- a/test/decompiler/reference/jak2/levels/atoll/atoll-tank_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/atoll-tank_REF.gc @@ -1650,21 +1650,17 @@ ;; definition of type atoll-tank (deftype atoll-tank (process-focusable) - ((is-master? symbol :offset-assert 204) - (aftermath-part sparticle-launch-control :offset-assert 208) + ((is-master? symbol) + (aftermath-part sparticle-launch-control) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd4 - :flag-assert #x1d006000d4 - (:methods - (dormant () _type_ :state 27) - (idle () _type_ :state 28) + (:state-methods + dormant + idle ) ) ;; definition for method 3 of type atoll-tank -(defmethod inspect atoll-tank ((this atoll-tank)) +(defmethod inspect ((this atoll-tank)) (when (not this) (set! this this) (goto cfg-4) @@ -1679,7 +1675,7 @@ ) ;; definition for method 10 of type atoll-tank -(defmethod deactivate atoll-tank ((this atoll-tank)) +(defmethod deactivate ((this atoll-tank)) (if (nonzero? (-> this aftermath-part)) (kill-and-free-particles (-> this aftermath-part)) ) @@ -1689,7 +1685,7 @@ ;; definition for method 7 of type atoll-tank ;; WARN: Return type mismatch process-focusable vs atoll-tank. -(defmethod relocate atoll-tank ((this atoll-tank) (arg0 int)) +(defmethod relocate ((this atoll-tank) (arg0 int)) (if (nonzero? (-> this aftermath-part)) (&+! (-> this aftermath-part) arg0) ) @@ -1697,13 +1693,13 @@ ) ;; definition for method 12 of type atoll-tank -(defmethod run-logic? atoll-tank ((this atoll-tank)) +(defmethod run-logic? ((this atoll-tank)) #t ) ;; definition for method 20 of type atoll-tank ;; INFO: Used lq/sq -(defmethod get-trans atoll-tank ((this atoll-tank) (arg0 int)) +(defmethod get-trans ((this atoll-tank) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (let ((v1-0 (-> this root))) (case arg0 @@ -1791,7 +1787,7 @@ ;; definition for method 11 of type atoll-tank ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-tank ((this atoll-tank) (arg0 entity-actor)) +(defmethod init-from-entity! ((this atoll-tank) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc b/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc index a3625b5ee66..7068e1d272b 100644 --- a/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc @@ -107,17 +107,13 @@ ;; definition of type juicer-shot (deftype juicer-shot (projectile) - ((lightning lightning-control 5 :offset-assert 472) - (victim handle :offset-assert 496) + ((lightning lightning-control 5) + (victim handle) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x1f8 - :flag-assert #x28018001f8 ) ;; definition for method 3 of type juicer-shot -(defmethod inspect juicer-shot ((this juicer-shot)) +(defmethod inspect ((this juicer-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -133,7 +129,7 @@ ;; definition for method 35 of type juicer-shot ;; INFO: Used lq/sq -(defmethod event-handler! juicer-shot ((this juicer-shot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod event-handler! ((this juicer-shot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Multiplex the projectile's event processing, called by [[projectile-event-handler]]" (case arg2 (('reset) @@ -166,7 +162,7 @@ ) ;; definition for method 37 of type juicer-shot -(defmethod deal-damage! juicer-shot ((this juicer-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! ((this juicer-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((a0-2 (if (type? arg0 process-focusable) arg0 @@ -183,7 +179,7 @@ ;; definition for method 25 of type juicer-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles juicer-shot ((this juicer-shot)) +(defmethod spawn-impact-particles ((this juicer-shot)) "Spawns associated particles with the projectile if applicable" (let ((s5-0 (-> this starting-pos)) (s4-0 (-> this root trans)) @@ -229,7 +225,7 @@ ;; definition for method 26 of type juicer-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles juicer-shot ((this juicer-shot)) +(defmethod spawn-shell-particles ((this juicer-shot)) "TODO - confirm" (spawn-impact-particles this) (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) @@ -272,7 +268,7 @@ ) ;; definition for method 38 of type juicer-shot -(defmethod made-impact? juicer-shot ((this juicer-shot)) +(defmethod made-impact? ((this juicer-shot)) "TODO - queries the collision cache, return true/false" (let ((gp-0 (-> this root)) (s5-0 (new 'stack-no-clear 'collide-query)) @@ -321,7 +317,7 @@ ;; definition for method 30 of type juicer-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! juicer-shot ((this juicer-shot)) +(defmethod init-proj-collision! ((this juicer-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -368,7 +364,7 @@ ;; definition for method 7 of type juicer-shot ;; WARN: Return type mismatch projectile vs juicer-shot. -(defmethod relocate juicer-shot ((this juicer-shot) (arg0 int)) +(defmethod relocate ((this juicer-shot) (arg0 int)) (dotimes (v1-0 5) (if (nonzero? (-> this lightning v1-0)) (&+! (-> this lightning v1-0) arg0) @@ -379,7 +375,7 @@ ;; definition for method 31 of type juicer-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! juicer-shot ((this juicer-shot)) +(defmethod init-proj-settings! ((this juicer-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (logior! (-> this options) (projectile-options proj-options-8000)) (set! (-> this attack-mode) 'eco-yellow) @@ -430,15 +426,12 @@ ;; definition of type juicer-anim-info (deftype juicer-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type juicer-anim-info -(defmethod inspect juicer-anim-info ((this juicer-anim-info)) +(defmethod inspect ((this juicer-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -451,24 +444,21 @@ ;; definition of type juicer-global-info (deftype juicer-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (idle-anim int32 3 :offset-assert 8) - (patrol-anim int32 2 :offset-assert 20) - (notice-anim int32 2 :offset-assert 28) - (charge-anim int32 2 :offset-assert 36) - (knocked-anim int32 2 :offset-assert 44) - (celebrate-anim int32 2 :offset-assert 52) - (yellow-hit-anim int32 4 :offset-assert 60) - (blue-hit-anim int32 6 :offset-assert 76) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (idle-anim int32 3) + (patrol-anim int32 2) + (notice-anim int32 2) + (charge-anim int32 2) + (knocked-anim int32 2) + (celebrate-anim int32 2) + (yellow-hit-anim int32 4) + (blue-hit-anim int32 6) ) - :method-count-assert 9 - :size-assert #x64 - :flag-assert #x900000064 ) ;; definition for method 3 of type juicer-global-info -(defmethod inspect juicer-global-info ((this juicer-global-info)) +(defmethod inspect ((this juicer-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -490,41 +480,39 @@ ;; definition of type juicer (deftype juicer (nav-enemy) - ((los los-control :inline :offset-assert 608) - (intro-path path-control :offset-assert 756) - (joint joint-mod :offset-assert 760) - (joint-enable symbol :offset-assert 764) - (joint-blend float :offset-assert 768) - (last-fire-time time-frame :offset-assert 776) - (heading basic :offset-assert 784) - (move-angle float :offset-assert 788) - (torso-track-player basic :offset-assert 792) - (circle-backward? symbol :offset 800) - (using-turn-anim symbol :offset-assert 804) - (hit-focus enemy-focus :offset-assert 808) - (ambush-path-pt int8 :offset-assert 812) - (charge-index int8 :offset-assert 813) - (hostile-dest vector :inline :offset-assert 816) - (focus-is-up symbol :offset-assert 832) - (current-projectile handle :offset-assert 840) + ((los los-control :inline) + (intro-path path-control) + (joint joint-mod) + (joint-enable symbol) + (joint-blend float) + (last-fire-time time-frame) + (heading basic) + (move-angle float) + (torso-track-player basic) + (circle-backward? symbol :offset 800) + (using-turn-anim symbol) + (hit-focus enemy-focus) + (ambush-path-pt int8) + (charge-index int8) + (hostile-dest vector :inline) + (focus-is-up symbol) + (current-projectile handle) ) - :heap-base #x2d0 - :method-count-assert 185 - :size-assert #x350 - :flag-assert #xb902d00350 + (:state-methods + ambush-cont + attack + ) (:methods - (ambush-cont () _type_ :state 178) - (attack () _type_ :state 179) - (juicer-method-180 (_type_) none 180) - (fire-projectile (_type_ process-focusable uint) none 181) - (juicer-method-182 (_type_) none 182) - (juicer-method-183 (_type_) none 183) - (juicer-method-184 (_type_ symbol) none 184) + (juicer-method-180 (_type_) none) + (fire-projectile (_type_ process-focusable uint) none) + (juicer-method-182 (_type_) none) + (juicer-method-183 (_type_) none) + (juicer-method-184 (_type_ symbol) none) ) ) ;; definition for method 3 of type juicer -(defmethod inspect juicer ((this juicer)) +(defmethod inspect ((this juicer)) (when (not this) (set! this this) (goto cfg-4) @@ -751,7 +739,7 @@ ;; definition for method 182 of type juicer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod juicer-method-182 juicer ((this juicer)) +(defmethod juicer-method-182 ((this juicer)) (let ((s3-0 (handle->process (-> this focus handle)))) (when s3-0 (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4))) @@ -775,7 +763,7 @@ ;; definition for method 183 of type juicer ;; WARN: Return type mismatch int vs none. -(defmethod juicer-method-183 juicer ((this juicer)) +(defmethod juicer-method-183 ((this juicer)) (cond ((-> this torso-track-player) (set! (-> this joint-enable) #t) @@ -795,7 +783,7 @@ ) ;; definition for method 55 of type juicer -(defmethod track-target! juicer ((this juicer)) +(defmethod track-target! ((this juicer)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -810,7 +798,7 @@ ;; definition for method 180 of type juicer ;; WARN: Return type mismatch object vs none. -(defmethod juicer-method-180 juicer ((this juicer)) +(defmethod juicer-method-180 ((this juicer)) (if (and (= (-> this incoming knocked-type) (knocked-type knocked-type-4)) (not (and (-> this next-state) (let ((v1-6 (-> this next-state name))) (or (= v1-6 'knocked) (= v1-6 'jump) (= v1-6 'jump-land)) @@ -831,7 +819,7 @@ ) ;; definition for method 74 of type juicer -(defmethod general-event-handler juicer ((this juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -997,7 +985,7 @@ ) ;; definition for method 84 of type juicer -(defmethod enemy-method-84 juicer ((this juicer) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 ((this juicer) (arg0 enemy-jump-info)) (cond ((logtest? (-> this fact enemy-options) (enemy-option user8)) (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos)) @@ -1014,7 +1002,7 @@ ;; definition for method 93 of type juicer ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 juicer ((this juicer)) +(defmethod enemy-method-93 ((this juicer)) (case (-> this jump-why) ((2) (go (method-of-object this ambush-cont)) @@ -1317,7 +1305,7 @@ ;; definition for method 181 of type juicer ;; WARN: Return type mismatch object vs none. -(defmethod fire-projectile juicer ((this juicer) (arg0 process-focusable) (arg1 uint)) +(defmethod fire-projectile ((this juicer) (arg0 process-focusable) (arg1 uint)) (with-pp (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 20))) (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) @@ -1639,7 +1627,7 @@ ) ;; definition for method 77 of type juicer -(defmethod enemy-method-77 juicer ((this juicer) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this juicer) (arg0 (pointer float))) (local-vars (a2-2 int)) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) @@ -1705,7 +1693,7 @@ ) ;; definition for method 78 of type juicer -(defmethod enemy-method-78 juicer ((this juicer) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this juicer) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -1749,7 +1737,7 @@ ;; definition for method 184 of type juicer ;; WARN: Return type mismatch symbol vs none. -(defmethod juicer-method-184 juicer ((this juicer) (arg0 symbol)) +(defmethod juicer-method-184 ((this juicer) (arg0 symbol)) (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) @@ -1765,7 +1753,7 @@ ;; definition for method 63 of type juicer ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 juicer ((this juicer) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this juicer) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) (the-as symbol (if (t9-0 this arg0 arg1) (set-dst-proc! (-> this los) (-> this focus handle)) @@ -1776,7 +1764,7 @@ ;; definition for method 114 of type juicer ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! juicer ((this juicer)) +(defmethod init-enemy-collision! ((this juicer)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1869,7 +1857,7 @@ ) ;; definition for method 7 of type juicer -(defmethod relocate juicer ((this juicer) (arg0 int)) +(defmethod relocate ((this juicer) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) ) @@ -1881,7 +1869,7 @@ ;; definition for method 115 of type juicer ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! juicer ((this juicer)) +(defmethod init-enemy! ((this juicer)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc b/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc index 17a7606e397..826f370c00c 100644 --- a/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc @@ -3,19 +3,15 @@ ;; definition of type sig-atoll (deftype sig-atoll (sig) - ((sig-course sig0-course :offset 652) + ((sig-course sig0-course :overlay-at course) ) - :heap-base #x3b0 - :method-count-assert 260 - :size-assert #x430 - :flag-assert #x10403b00430 (:methods - (sig-atoll-method-259 (_type_) symbol 259) + (sig-atoll-method-259 (_type_) symbol) ) ) ;; definition for method 3 of type sig-atoll -(defmethod inspect sig-atoll ((this sig-atoll)) +(defmethod inspect ((this sig-atoll)) (when (not this) (set! this this) (goto cfg-4) @@ -29,17 +25,14 @@ ;; definition of type sig0-course (deftype sig0-course (bot-course) - ((liftcat-speech-index int8 :offset-assert 48) - (first-liftcat-speeches (array int16) :offset-assert 52) - (second-liftcat-speeches (array int16) :offset-assert 56) + ((liftcat-speech-index int8) + (first-liftcat-speeches (array int16)) + (second-liftcat-speeches (array int16)) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) ;; definition for method 3 of type sig0-course -(defmethod inspect sig0-course ((this sig0-course)) +(defmethod inspect ((this sig0-course)) (when (not this) (set! this this) (goto cfg-4) @@ -67,7 +60,7 @@ ;; definition for method 183 of type sig-atoll ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? sig-atoll ((this sig-atoll)) +(defmethod alive? ((this sig-atoll)) (let ((t9-0 (method-of-type bot alive?))) (the-as symbol (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'waiting-far) @@ -84,7 +77,7 @@ ;; definition for method 116 of type sig-atoll ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sig-atoll ((this sig-atoll)) +(defmethod go-idle ((this sig-atoll)) (cond ((task-node-closed? (game-task-node atoll-sig-resolution)) (cleanup-for-death this) @@ -99,7 +92,7 @@ ;; definition for method 259 of type sig-atoll ;; WARN: Return type mismatch object vs symbol. -(defmethod sig-atoll-method-259 sig-atoll ((this sig-atoll)) +(defmethod sig-atoll-method-259 ((this sig-atoll)) (let ((v1-0 *target*)) (the-as symbol (and v1-0 (not (focus-test? v1-0 edge-grab)) diff --git a/test/decompiler/reference/jak2/levels/atoll/sniper_REF.gc b/test/decompiler/reference/jak2/levels/atoll/sniper_REF.gc index b94230ed547..7dac08e3fc1 100644 --- a/test/decompiler/reference/jak2/levels/atoll/sniper_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/sniper_REF.gc @@ -3,16 +3,12 @@ ;; definition of type sniper (deftype sniper (spyder) - ((next-pick-time time-frame :offset-assert 944) + ((next-pick-time time-frame) ) - :heap-base #x340 - :method-count-assert 186 - :size-assert #x3b8 - :flag-assert #xba034003b8 ) ;; definition for method 3 of type sniper -(defmethod inspect sniper ((this sniper)) +(defmethod inspect ((this sniper)) (when (not this) (set! this this) (goto cfg-4) @@ -203,7 +199,7 @@ (set! (-> *sniper-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 12 of type sniper -(defmethod run-logic? sniper ((this sniper)) +(defmethod run-logic? ((this sniper)) (let ((f0-0 573440.0)) (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> this root trans) (camera-pos))) ) @@ -211,7 +207,7 @@ ;; definition for method 129 of type sniper ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-129 sniper ((this sniper)) +(defmethod enemy-method-129 ((this sniper)) (let ((a0-1 *target*)) (if a0-1 (set! (-> this focus handle) (process->handle a0-1)) @@ -230,7 +226,7 @@ ;; definition for method 156 of type sniper ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-156 sniper ((this sniper)) +(defmethod nav-enemy-method-156 ((this sniper)) (let ((s4-0 (-> this path curve num-cverts))) (if (<= s4-0 0) (go process-drawable-art-error "no path") @@ -300,7 +296,7 @@ ;; definition for method 115 of type sniper ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! sniper ((this sniper)) +(defmethod init-enemy! ((this sniper)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type spyder init-enemy!))) (t9-0 this) @@ -315,7 +311,7 @@ ;; definition for method 114 of type sniper ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! sniper ((this sniper)) +(defmethod init-enemy-collision! ((this sniper)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((t9-0 (method-of-type spyder init-enemy-collision!))) (t9-0 this) @@ -333,7 +329,7 @@ ;; definition for method 116 of type sniper ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sniper ((this sniper)) +(defmethod go-idle ((this sniper)) (cond ((script-eval (res-lump-struct (-> this entity) 'on-activate pair)) (cleanup-for-death this) diff --git a/test/decompiler/reference/jak2/levels/castle/boss/casboss-part_REF.gc b/test/decompiler/reference/jak2/levels/castle/boss/casboss-part_REF.gc index 75c1b53619e..c9249741b38 100644 --- a/test/decompiler/reference/jak2/levels/castle/boss/casboss-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/boss/casboss-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type casboss-part (deftype casboss-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type casboss-part -(defmethod inspect casboss-part ((this casboss-part)) +(defmethod inspect ((this casboss-part)) (when (not this) (set! this this) (goto cfg-4) @@ -26,14 +22,10 @@ ;; definition of type cascity-part (deftype cascity-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type cascity-part -(defmethod inspect cascity-part ((this cascity-part)) +(defmethod inspect ((this cascity-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc b/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc index 832c36a8d15..78922920251 100644 --- a/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc @@ -4,17 +4,13 @@ ;; definition of type cboss-tractor (deftype cboss-tractor (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type cboss-tractor -(defmethod inspect cboss-tractor ((this cboss-tractor)) +(defmethod inspect ((this cboss-tractor)) (when (not this) (set! this this) (goto cfg-4) @@ -50,7 +46,7 @@ ;; definition for method 11 of type cboss-tractor ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cboss-tractor ((this cboss-tractor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cboss-tractor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -76,16 +72,12 @@ This commonly includes things such as: ;; definition of type cboss-elevator (deftype cboss-elevator (elevator) - ((sound-id sound-id :offset-assert 368) + ((sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 49 - :size-assert #x174 - :flag-assert #x3101000174 ) ;; definition for method 3 of type cboss-elevator -(defmethod inspect cboss-elevator ((this cboss-elevator)) +(defmethod inspect ((this cboss-elevator)) (when (not this) (set! this this) (goto cfg-4) @@ -130,13 +122,13 @@ This commonly includes things such as: ) ;; definition for method 30 of type cboss-elevator -(defmethod get-art-group cboss-elevator ((this cboss-elevator)) +(defmethod get-art-group ((this cboss-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-cboss-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 10 of type cboss-elevator -(defmethod deactivate cboss-elevator ((this cboss-elevator)) +(defmethod deactivate ((this cboss-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -144,7 +136,7 @@ This commonly includes things such as: ;; definition for method 33 of type cboss-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! cboss-elevator ((this cboss-elevator)) +(defmethod init-plat! ((this cboss-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this sound-id) (new-sound-id)) @@ -153,7 +145,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 43 of type cboss-elevator -(defmethod move-between-points cboss-elevator ((this cboss-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this cboss-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -173,7 +165,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 45 of type cboss-elevator -(defmethod commited-to-ride? cboss-elevator ((this cboss-elevator)) +(defmethod commited-to-ride? ((this cboss-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) @@ -194,7 +186,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 31 of type cboss-elevator ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-plat-collision! cboss-elevator ((this cboss-elevator)) +(defmethod init-plat-collision! ((this cboss-elevator)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -231,29 +223,27 @@ For example for an elevator pre-compute the distance between the first and last ;; definition of type krew-boss-clone (deftype krew-boss-clone (nav-enemy) - ((old-y-deg float :offset-assert 604) - (diff-angle degrees :offset-assert 608) - (hit-target symbol :offset-assert 612) - (lightning lightning-control 4 :offset-assert 616) - (wiggle-time time-frame :offset-assert 632) - (wiggle-angle degrees :offset-assert 640) - (delta-wiggle-angle degrees :offset-assert 644) - (wiggle-factor float :offset-assert 648) - (id sound-id :offset-assert 652) + ((old-y-deg float) + (diff-angle degrees) + (hit-target symbol) + (lightning lightning-control 4) + (wiggle-time time-frame) + (wiggle-angle degrees) + (delta-wiggle-angle degrees) + (wiggle-factor float) + (id sound-id) ) - :heap-base #x210 - :method-count-assert 181 - :size-assert #x290 - :flag-assert #xb502100290 + (:state-methods + spawning + ) (:methods - (spawning () _type_ :state 178) - (krew-boss-clone-method-179 (_type_ vector) none 179) - (krew-boss-clone-method-180 (_type_) none 180) + (krew-boss-clone-method-179 (_type_ vector) none) + (krew-boss-clone-method-180 (_type_) none) ) ) ;; definition for method 3 of type krew-boss-clone -(defmethod inspect krew-boss-clone ((this krew-boss-clone)) +(defmethod inspect ((this krew-boss-clone)) (when (not this) (set! this this) (goto cfg-4) @@ -276,38 +266,34 @@ For example for an elevator pre-compute the distance between the first and last ;; definition of type krew-boss (deftype krew-boss (nav-enemy) - ((task-timeout time-frame :offset-assert 608) - (movie-handle handle :offset-assert 616) - (clones handle 8 :offset-assert 624) - (last-closest-spawn int32 :offset-assert 688) - (next-clone-side int32 :offset-assert 692) - (next-shooting-frame int32 :offset-assert 696) - (old-y-deg float :offset-assert 700) - (diff-angle degrees :offset-assert 704) - (hit-target symbol :offset-assert 708) - (floating symbol :offset-assert 712) - (next-path-point int32 :offset-assert 716) - (num-clones-to-spawn int32 :offset-assert 720) - (gameplay-pass int32 :offset-assert 724) - (hud-handle handle :offset-assert 728) - (channel uint8 :offset-assert 736) - (id sound-id :offset-assert 740) - (play-clone-wave-speech symbol :offset-assert 744) - (last-damage-time time-frame :offset-assert 752) - (spawn-charge symbol :offset-assert 760) + ((task-timeout time-frame) + (movie-handle handle) + (clones handle 8) + (last-closest-spawn int32) + (next-clone-side int32) + (next-shooting-frame int32) + (old-y-deg float) + (diff-angle degrees) + (hit-target symbol) + (floating symbol) + (next-path-point int32) + (num-clones-to-spawn int32) + (gameplay-pass int32) + (hud-handle handle) + (channel uint8) + (id sound-id) + (play-clone-wave-speech symbol) + (last-damage-time time-frame) + (spawn-charge symbol) ) - :heap-base #x280 - :method-count-assert 180 - :size-assert #x2fc - :flag-assert #xb4028002fc - (:methods - (hidden () _type_ :state 178) - (play-intro () _type_ :state 179) + (:state-methods + hidden + play-intro ) ) ;; definition for method 3 of type krew-boss -(defmethod inspect krew-boss ((this krew-boss)) +(defmethod inspect ((this krew-boss)) (when (not this) (set! this this) (goto cfg-4) @@ -817,7 +803,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 55 of type krew-boss-clone ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! krew-boss-clone ((this krew-boss-clone)) +(defmethod track-target! ((this krew-boss-clone)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -894,7 +880,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 74 of type krew-boss-clone -(defmethod general-event-handler krew-boss-clone ((this krew-boss-clone) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this krew-boss-clone) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (with-pp @@ -1023,7 +1009,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 77 of type krew-boss-clone -(defmethod enemy-method-77 krew-boss-clone ((this krew-boss-clone) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this krew-boss-clone) (arg0 (pointer float))) (with-pp (ja-channel-push! 1 0) (cond @@ -1075,7 +1061,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 78 of type krew-boss-clone -(defmethod enemy-method-78 krew-boss-clone ((this krew-boss-clone) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this krew-boss-clone) (arg0 (pointer float))) (when (> (-> this hit-points) 0) (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) @@ -1105,7 +1091,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 79 of type krew-boss-clone -(defmethod enemy-method-79 krew-boss-clone ((this krew-boss-clone) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this krew-boss-clone) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond @@ -1141,7 +1127,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 180 of type krew-boss-clone ;; WARN: Return type mismatch int vs none. -(defmethod krew-boss-clone-method-180 krew-boss-clone ((this krew-boss-clone)) +(defmethod krew-boss-clone-method-180 ((this krew-boss-clone)) (let* ((f0-0 (rand-vu-float-range 0.0 1.0)) (f1-1 (+ 1.0 (* 2.0 f0-0))) (f2-2 f1-1) @@ -1158,7 +1144,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 179 of type krew-boss-clone ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod krew-boss-clone-method-179 krew-boss-clone ((this krew-boss-clone) (arg0 vector)) +(defmethod krew-boss-clone-method-179 ((this krew-boss-clone) (arg0 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1198,7 +1184,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 68 of type krew-boss-clone -(defmethod go-stare2 krew-boss-clone ((this krew-boss-clone)) +(defmethod go-stare2 ((this krew-boss-clone)) (go (method-of-object this hostile)) ) @@ -1293,7 +1279,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 114 of type krew-boss-clone ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! krew-boss-clone ((this krew-boss-clone)) +(defmethod init-enemy-collision! ((this krew-boss-clone)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1359,14 +1345,14 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 60 of type krew-boss-clone -(defmethod coin-flip? krew-boss-clone ((this krew-boss-clone)) +(defmethod coin-flip? ((this krew-boss-clone)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 7 of type krew-boss-clone ;; WARN: Return type mismatch nav-enemy vs krew-boss-clone. -(defmethod relocate krew-boss-clone ((this krew-boss-clone) (arg0 int)) +(defmethod relocate ((this krew-boss-clone) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this lightning v1-0)) (&+! (-> this lightning v1-0) arg0) @@ -1377,7 +1363,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 115 of type krew-boss-clone ;; WARN: Return type mismatch object vs none. -(defmethod init-enemy! krew-boss-clone ((this krew-boss-clone)) +(defmethod init-enemy! ((this krew-boss-clone)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1462,14 +1448,10 @@ For example for an elevator pre-compute the distance between the first and last ;; definition of type krew-boss-shot (deftype krew-boss-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type krew-boss-shot -(defmethod inspect krew-boss-shot ((this krew-boss-shot)) +(defmethod inspect ((this krew-boss-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -1491,7 +1473,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 31 of type krew-boss-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! krew-boss-shot ((this krew-boss-shot)) +(defmethod init-proj-settings! ((this krew-boss-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (call-parent-method this) (set! (-> this move) krew-boss-shot-move) @@ -1502,7 +1484,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 28 of type krew-boss-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound krew-boss-shot ((this krew-boss-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this krew-boss-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -1520,14 +1502,10 @@ For example for an elevator pre-compute the distance between the first and last ;; definition of type hud-krew-boss (deftype hud-krew-boss (hud) () - :heap-base #xb30 - :method-count-assert 27 - :size-assert #xba4 - :flag-assert #x1b0b300ba4 ) ;; definition for method 3 of type hud-krew-boss -(defmethod inspect hud-krew-boss ((this hud-krew-boss)) +(defmethod inspect ((this hud-krew-boss)) (when (not this) (set! this this) (goto cfg-4) @@ -1541,7 +1519,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 15 of type hud-krew-boss ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-krew-boss ((this hud-krew-boss)) +(defmethod draw ((this hud-krew-boss)) (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) -96 0) @@ -1590,7 +1568,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 16 of type hud-krew-boss ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-krew-boss ((this hud-krew-boss)) +(defmethod update-values ((this hud-krew-boss)) (set! (-> this values 0 target) (+ (-> (the-as krew-boss (-> this parent 0)) gameplay-pass) -1)) (let ((v1-7 (/ (-> (the-as krew-boss (-> this parent 0)) hit-points) (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) @@ -1623,7 +1601,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 17 of type hud-krew-boss ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-krew-boss ((this hud-krew-boss)) +(defmethod init-callback ((this hud-krew-boss)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -2011,7 +1989,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 115 of type krew-boss ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! krew-boss ((this krew-boss)) +(defmethod init-enemy! ((this krew-boss)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -2066,7 +2044,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 116 of type krew-boss ;; WARN: Return type mismatch object vs none. -(defmethod go-idle krew-boss ((this krew-boss)) +(defmethod go-idle ((this krew-boss)) (cond ((task-node-closed? (game-task-node castle-boss-resolution)) (cleanup-for-death this) @@ -2134,7 +2112,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 74 of type krew-boss ;; WARN: disable def twice: 22. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler krew-boss ((this krew-boss) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this krew-boss) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -2171,12 +2149,12 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 102 of type krew-boss -(defmethod enemy-method-102 krew-boss ((this krew-boss)) +(defmethod enemy-method-102 ((this krew-boss)) #f ) ;; definition for method 77 of type krew-boss -(defmethod enemy-method-77 krew-boss ((this krew-boss) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this krew-boss) (arg0 (pointer float))) (with-pp (ja-channel-push! 1 0) (cond @@ -2215,7 +2193,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 78 of type krew-boss -(defmethod enemy-method-78 krew-boss ((this krew-boss) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this krew-boss) (arg0 (pointer float))) (cond ((<= (-> this hit-points) 0) #f @@ -2250,7 +2228,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 81 of type krew-boss -(defmethod enemy-method-81 krew-boss ((this krew-boss)) +(defmethod enemy-method-81 ((this krew-boss)) #f ) @@ -2322,7 +2300,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 114 of type krew-boss ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! krew-boss ((this krew-boss)) +(defmethod init-enemy-collision! ((this krew-boss)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -2381,7 +2359,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 60 of type krew-boss -(defmethod coin-flip? krew-boss ((this krew-boss)) +(defmethod coin-flip? ((this krew-boss)) "@returns The result of a 50/50 RNG roll" #f ) @@ -2466,7 +2444,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 56 of type krew-boss -(defmethod damage-amount-from-attack krew-boss ((this krew-boss) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this krew-boss) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let ((v1-0 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg1))) (cond @@ -2494,7 +2472,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 142 of type krew-boss ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 krew-boss ((this krew-boss) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this krew-boss) (arg0 nav-control)) (with-pp (cond ((not (logtest? (-> this nav flags) (nav-control-flag update-heading-from-facing))) @@ -2842,7 +2820,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 73 of type krew-boss -(defmethod kill-prefer-falling krew-boss ((this krew-boss)) +(defmethod kill-prefer-falling ((this krew-boss)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (when (handle->process (-> this hud-handle)) (send-event (-> this hud-handle process 0) 'hide-and-die) diff --git a/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc b/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc index c3cbbd58689..f40619a59b3 100644 --- a/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc @@ -6,21 +6,17 @@ ;; definition of type cas-conveyor (deftype cas-conveyor (conveyor) - ((actor-group (pointer actor-group) :offset-assert 256) - (actor-group-count int32 :offset-assert 260) - (texture-anim-index uint32 :offset-assert 264) - (my-id int32 :offset-assert 268) - (sound-id sound-id :offset-assert 272) - (target-speed float :offset-assert 276) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (texture-anim-index uint32) + (my-id int32) + (sound-id sound-id) + (target-speed float) ) - :heap-base #xa0 - :method-count-assert 28 - :size-assert #x118 - :flag-assert #x1c00a00118 ) ;; definition for method 3 of type cas-conveyor -(defmethod inspect cas-conveyor ((this cas-conveyor)) +(defmethod inspect ((this cas-conveyor)) (when (not this) (set! this this) (goto cfg-7) @@ -43,7 +39,7 @@ ;; definition for method 24 of type cas-conveyor ;; WARN: Return type mismatch int vs none. -(defmethod init! cas-conveyor ((this cas-conveyor)) +(defmethod init! ((this cas-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (let ((t9-0 (method-of-type conveyor init!))) (t9-0 this) @@ -62,7 +58,7 @@ ;; definition for method 11 of type cas-conveyor ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-conveyor ((this cas-conveyor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-conveyor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -99,7 +95,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type cas-conveyor -(defmethod deactivate cas-conveyor ((this cas-conveyor)) +(defmethod deactivate ((this cas-conveyor)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -172,29 +168,25 @@ This commonly includes things such as: ;; definition of type cas-conveyor-switch (deftype cas-conveyor-switch (process-focusable) - ((actor-group (pointer actor-group) :offset-assert 204) - (actor-group-count int32 :offset-assert 208) - (incoming-attack-id uint32 :offset-assert 212) - (quat0 quaternion :inline :offset-assert 224) - (quat180 quaternion :inline :offset-assert 240) - (red-pos vector :inline :offset-assert 256) - (blue-pos vector :inline :offset-assert 272) - (track-flag symbol :offset-assert 288) - (lightning-timer time-frame :offset-assert 296) - (speed float :offset-assert 304) - (target-speed float :offset-assert 308) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (incoming-attack-id uint32) + (quat0 quaternion :inline) + (quat180 quaternion :inline) + (red-pos vector :inline) + (blue-pos vector :inline) + (track-flag symbol) + (lightning-timer time-frame) + (speed float) + (target-speed float) ) - :heap-base #xc0 - :method-count-assert 28 - :size-assert #x138 - :flag-assert #x1c00c00138 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) ;; definition for method 3 of type cas-conveyor-switch -(defmethod inspect cas-conveyor-switch ((this cas-conveyor-switch)) +(defmethod inspect ((this cas-conveyor-switch)) (when (not this) (set! this this) (goto cfg-7) @@ -406,7 +398,7 @@ This commonly includes things such as: ;; definition for method 11 of type cas-conveyor-switch ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-conveyor-switch ((this cas-conveyor-switch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-conveyor-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -476,21 +468,17 @@ This commonly includes things such as: ;; definition of type cas-electric-fence (deftype cas-electric-fence (process-focusable) - ((next-spawn-time time-frame :offset-assert 208) - (stop symbol :offset-assert 216) + ((next-spawn-time time-frame) + (stop symbol) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xdc - :flag-assert #x1d006000dc - (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) + (:state-methods + idle + die ) ) ;; definition for method 3 of type cas-electric-fence -(defmethod inspect cas-electric-fence ((this cas-electric-fence)) +(defmethod inspect ((this cas-electric-fence)) (when (not this) (set! this this) (goto cfg-4) @@ -711,7 +699,7 @@ This commonly includes things such as: ;; definition for method 11 of type cas-electric-fence ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-electric-fence ((this cas-electric-fence) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-electric-fence) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -758,17 +746,13 @@ This commonly includes things such as: ;; definition of type cas-button (deftype cas-button (basebutton) () - :heap-base #xa0 - :method-count-assert 40 - :size-assert #x120 - :flag-assert #x2800a00120 (:methods - (cas-button-method-39 (_type_) none 39) + (cas-button-method-39 (_type_) none) ) ) ;; definition for method 3 of type cas-button -(defmethod inspect cas-button ((this cas-button)) +(defmethod inspect ((this cas-button)) (when (not this) (set! this this) (goto cfg-4) @@ -788,7 +772,7 @@ This commonly includes things such as: ;; definition for method 34 of type cas-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-34 cas-button ((this cas-button)) +(defmethod basebutton-method-34 ((this cas-button)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -814,7 +798,7 @@ This commonly includes things such as: ;; definition for method 35 of type cas-button ;; WARN: Return type mismatch int vs none. -(defmethod prepare-trigger-event! cas-button ((this cas-button)) +(defmethod prepare-trigger-event! ((this cas-button)) "Sets `event-going-down` to `'trigger`" (set! (-> this event-down) 'shutdown) 0 @@ -847,7 +831,7 @@ This commonly includes things such as: ;; definition for method 33 of type cas-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 cas-button ((this cas-button)) +(defmethod basebutton-method-33 ((this cas-button)) "TODO - joint stuff" (initialize-skeleton this @@ -886,19 +870,15 @@ This commonly includes things such as: ;; definition of type cas-elevator (deftype cas-elevator (elevator) - ((sound-id sound-id :offset-assert 368) + ((sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 50 - :size-assert #x174 - :flag-assert #x3201000174 (:methods - (cas-elevator-method-49 (_type_) none 49) + (cas-elevator-method-49 (_type_) none) ) ) ;; definition for method 3 of type cas-elevator -(defmethod inspect cas-elevator ((this cas-elevator)) +(defmethod inspect ((this cas-elevator)) (when (not this) (set! this this) (goto cfg-4) @@ -918,14 +898,14 @@ This commonly includes things such as: ) ;; definition for method 30 of type cas-elevator -(defmethod get-art-group cas-elevator ((this cas-elevator)) +(defmethod get-art-group ((this cas-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-cas-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 49 of type cas-elevator ;; WARN: Return type mismatch float vs none. -(defmethod cas-elevator-method-49 cas-elevator ((this cas-elevator)) +(defmethod cas-elevator-method-49 ((this cas-elevator)) (let* ((f0-1 (fmax 0.0 (- (-> this root trans y) (-> this bottom-top 0)))) (f0-3 (* 0.001171875 (- f0-1 (* (the float (the int (/ f0-1 30720.0))) 30720.0)))) (v1-6 (-> this skel root-channel 0)) @@ -937,7 +917,7 @@ This commonly includes things such as: ) ;; definition for method 43 of type cas-elevator -(defmethod move-between-points cas-elevator ((this cas-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this cas-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -956,7 +936,7 @@ This commonly includes things such as: ) ;; definition for method 45 of type cas-elevator -(defmethod commited-to-ride? cas-elevator ((this cas-elevator)) +(defmethod commited-to-ride? ((this cas-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) @@ -1054,14 +1034,14 @@ This commonly includes things such as: ) ;; definition for method 10 of type cas-elevator -(defmethod deactivate cas-elevator ((this cas-elevator)) +(defmethod deactivate ((this cas-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) ) ;; definition for method 33 of type cas-elevator -(defmethod init-plat! cas-elevator ((this cas-elevator)) +(defmethod init-plat! ((this cas-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this sound-id) (new-sound-id)) @@ -1071,7 +1051,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 31 of type cas-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! cas-elevator ((this cas-elevator)) +(defmethod init-plat-collision! ((this cas-elevator)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1102,25 +1082,21 @@ For example for an elevator pre-compute the distance between the first and last ;; definition of type cas-rot-bridge (deftype cas-rot-bridge (process-drawable) - ((index uint32 :offset-assert 200) - (anim-index uint32 :offset-assert 204) - (test-index uint32 :offset-assert 208) - (pos float :offset-assert 212) - (pos-old float :offset-assert 216) - (sound-id sound-id :offset-assert 220) - (sound-flag symbol :offset-assert 224) + ((index uint32) + (anim-index uint32) + (test-index uint32) + (pos float) + (pos-old float) + (sound-id sound-id) + (sound-flag symbol) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xe4 - :flag-assert #x15007000e4 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type cas-rot-bridge -(defmethod inspect cas-rot-bridge ((this cas-rot-bridge)) +(defmethod inspect ((this cas-rot-bridge)) (when (not this) (set! this this) (goto cfg-4) @@ -1398,7 +1374,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 11 of type cas-rot-bridge ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-rot-bridge ((this cas-rot-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-rot-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1493,28 +1469,24 @@ This commonly includes things such as: ;; definition of type cas-switch (deftype cas-switch (process-drawable) - ((actor-group (pointer actor-group) :offset-assert 200) - (actor-group-count int32 :offset-assert 204) - (incoming-attack-id uint32 :offset-assert 208) - (anim-index uint32 :offset-assert 212) - (direction uint32 :offset-assert 216) - (pos-old float :offset-assert 220) - (y-start float :offset-assert 224) - (y-delta float :offset-assert 228) - (sound-id sound-id :offset-assert 232) - (sound-flag symbol :offset-assert 236) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (incoming-attack-id uint32) + (anim-index uint32) + (direction uint32) + (pos-old float) + (y-start float) + (y-delta float) + (sound-id sound-id) + (sound-flag symbol) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xf0 - :flag-assert #x15007000f0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type cas-switch -(defmethod inspect cas-switch ((this cas-switch)) +(defmethod inspect ((this cas-switch)) (when (not this) (set! this this) (goto cfg-7) @@ -1659,7 +1631,7 @@ This commonly includes things such as: ;; definition for method 11 of type cas-switch ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-switch ((this cas-switch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1753,20 +1725,16 @@ This commonly includes things such as: ;; definition of type cas-trapdoor (deftype cas-trapdoor (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) ;; definition for method 3 of type cas-trapdoor -(defmethod inspect cas-trapdoor ((this cas-trapdoor)) +(defmethod inspect ((this cas-trapdoor)) (when (not this) (set! this this) (goto cfg-4) @@ -1892,7 +1860,7 @@ This commonly includes things such as: ;; definition for method 11 of type cas-trapdoor ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-trapdoor ((this cas-trapdoor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-trapdoor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1938,19 +1906,15 @@ This commonly includes things such as: ;; definition of type cas-chain-plat (deftype cas-chain-plat (process-focusable) () - :heap-base #x50 - :method-count-assert 30 - :size-assert #xcc - :flag-assert #x1e005000cc - (:methods - (idle () _type_ :state 27) - (drop () _type_ :state 28) - (down () _type_ :state 29) + (:state-methods + idle + drop + down ) ) ;; definition for method 3 of type cas-chain-plat -(defmethod inspect cas-chain-plat ((this cas-chain-plat)) +(defmethod inspect ((this cas-chain-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -2009,7 +1973,7 @@ This commonly includes things such as: ;; definition for method 11 of type cas-chain-plat ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-chain-plat ((this cas-chain-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-chain-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2046,22 +2010,18 @@ This commonly includes things such as: ;; definition of type cas-rot-blade (deftype cas-rot-blade (process-drawable) - ((sync sync-eased :inline :offset-assert 200) - (rot float :offset-assert 244) - (attack-id uint32 :offset-assert 248) - (sound-id sound-id :offset-assert 252) + ((sync sync-eased :inline) + (rot float) + (attack-id uint32) + (sound-id sound-id) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #x100 - :flag-assert #x1500800100 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type cas-rot-blade -(defmethod inspect cas-rot-blade ((this cas-rot-blade)) +(defmethod inspect ((this cas-rot-blade)) (when (not this) (set! this this) (goto cfg-4) @@ -2150,7 +2110,7 @@ This commonly includes things such as: ;; definition for method 11 of type cas-rot-blade ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-rot-blade ((this cas-rot-blade) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-rot-blade) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2223,7 +2183,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type cas-rot-blade -(defmethod deactivate cas-rot-blade ((this cas-rot-blade)) +(defmethod deactivate ((this cas-rot-blade)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -2232,17 +2192,13 @@ This commonly includes things such as: ;; definition of type cas-flag-a (deftype cas-flag-a (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type cas-flag-a -(defmethod inspect cas-flag-a ((this cas-flag-a)) +(defmethod inspect ((this cas-flag-a)) (when (not this) (set! this this) (goto cfg-4) @@ -2278,7 +2234,7 @@ This commonly includes things such as: ;; definition for method 11 of type cas-flag-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-flag-a ((this cas-flag-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-flag-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2299,17 +2255,13 @@ This commonly includes things such as: ;; definition of type cas-flag-b (deftype cas-flag-b (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type cas-flag-b -(defmethod inspect cas-flag-b ((this cas-flag-b)) +(defmethod inspect ((this cas-flag-b)) (when (not this) (set! this this) (goto cfg-4) @@ -2345,7 +2297,7 @@ This commonly includes things such as: ;; definition for method 11 of type cas-flag-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-flag-b ((this cas-flag-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-flag-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2365,32 +2317,28 @@ This commonly includes things such as: ;; definition of type cas-robot-door (deftype cas-robot-door (process-drawable) - ((spawner-actor symbol :offset-assert 200) - (door-actor entity-actor 2 :offset-assert 204) - (spawn-count int32 :offset-assert 212) - (spawn-count-total int32 :offset-assert 216) - (spawn-max int32 :offset-assert 220) - (spawn-total int32 :offset-assert 224) - (notice-dist float :offset-assert 228) - (player-dist float :offset-assert 232) - (anim-index int32 :offset-assert 236) - (last-guard handle :offset-assert 240) - (actor-group (pointer actor-group) :offset-assert 248) - (actor-group-count int32 :offset-assert 252) + ((spawner-actor symbol) + (door-actor entity-actor 2) + (spawn-count int32) + (spawn-count-total int32) + (spawn-max int32) + (spawn-total int32) + (notice-dist float) + (player-dist float) + (anim-index int32) + (last-guard handle) + (actor-group (pointer actor-group)) + (actor-group-count int32) ) - :heap-base #x80 - :method-count-assert 23 - :size-assert #x100 - :flag-assert #x1700800100 - (:methods - (idle () _type_ :state 20) - (spawning () _type_ :state 21) - (castle-wait-end () _type_ :state 22) + (:state-methods + idle + spawning + castle-wait-end ) ) ;; definition for method 3 of type cas-robot-door -(defmethod inspect cas-robot-door ((this cas-robot-door)) +(defmethod inspect ((this cas-robot-door)) (when (not this) (set! this this) (goto cfg-7) @@ -2737,7 +2685,7 @@ This commonly includes things such as: ;; definition for method 11 of type cas-robot-door ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-robot-door ((this cas-robot-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cas-robot-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2813,20 +2761,16 @@ This commonly includes things such as: ;; definition of type lightning-ball (deftype lightning-ball (process-drawable) - ((root collide-shape :override) - (timer time-frame :offset-assert 200) + ((root collide-shape :override) + (timer time-frame) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type lightning-ball -(defmethod inspect lightning-ball ((this lightning-ball)) +(defmethod inspect ((this lightning-ball)) (when (not this) (set! this this) (goto cfg-4) @@ -2908,7 +2852,7 @@ This commonly includes things such as: ;; definition for method 11 of type lightning-ball ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! lightning-ball ((this lightning-ball) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lightning-ball) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/castle/castle-part_REF.gc b/test/decompiler/reference/jak2/levels/castle/castle-part_REF.gc index 52588343af2..0a6eb6917e6 100644 --- a/test/decompiler/reference/jak2/levels/castle/castle-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/castle-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type castle-part (deftype castle-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type castle-part -(defmethod inspect castle-part ((this castle-part)) +(defmethod inspect ((this castle-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/castle/pad/caspad-obs_REF.gc b/test/decompiler/reference/jak2/levels/castle/pad/caspad-obs_REF.gc index c117b5f3b69..e783add2ac0 100644 --- a/test/decompiler/reference/jak2/levels/castle/pad/caspad-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/pad/caspad-obs_REF.gc @@ -3,19 +3,15 @@ ;; definition of type cpad-elevator (deftype cpad-elevator (elevator) - ((sound-id sound-id :offset-assert 368) + ((sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 50 - :size-assert #x174 - :flag-assert #x3201000174 (:methods - (configure-collision (_type_ symbol) none 49) + (configure-collision (_type_ symbol) none) ) ) ;; definition for method 3 of type cpad-elevator -(defmethod inspect cpad-elevator ((this cpad-elevator)) +(defmethod inspect ((this cpad-elevator)) (when (not this) (set! this this) (goto cfg-4) @@ -35,13 +31,13 @@ ) ;; definition for method 30 of type cpad-elevator -(defmethod get-art-group cpad-elevator ((this cpad-elevator)) +(defmethod get-art-group ((this cpad-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-cpad-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 43 of type cpad-elevator -(defmethod move-between-points cpad-elevator ((this cpad-elevator) (vec vector) (point-a float) (point-b float)) +(defmethod move-between-points ((this cpad-elevator) (vec vector) (point-a float) (point-b float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -61,7 +57,7 @@ ) ;; definition for method 45 of type cpad-elevator -(defmethod commited-to-ride? cpad-elevator ((this cpad-elevator)) +(defmethod commited-to-ride? ((this cpad-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((target *target*) (target-proc (if (type? target process-focusable) @@ -82,7 +78,7 @@ ;; definition for method 49 of type cpad-elevator ;; WARN: Return type mismatch int vs none. -(defmethod configure-collision cpad-elevator ((this cpad-elevator) (collide-with-jak? symbol)) +(defmethod configure-collision ((this cpad-elevator) (collide-with-jak? symbol)) "Appropriately sets the collision on the elevator @param collide-with-jak? If set, the elevator will collide with Jak" (let ((prim (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) @@ -159,7 +155,7 @@ ) ;; definition for method 40 of type cpad-elevator -(defmethod activate-elevator cpad-elevator ((this cpad-elevator)) +(defmethod activate-elevator ((this cpad-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (if (task-node-closed? (game-task-node dig-knock-down-introduction)) (go (method-of-object this arrived)) @@ -168,7 +164,7 @@ ) ;; definition for method 10 of type cpad-elevator -(defmethod deactivate cpad-elevator ((this cpad-elevator)) +(defmethod deactivate ((this cpad-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -176,7 +172,7 @@ ;; definition for method 42 of type cpad-elevator ;; WARN: Return type mismatch ambient-sound vs none. -(defmethod set-ambient-sound! cpad-elevator ((this cpad-elevator)) +(defmethod set-ambient-sound! ((this cpad-elevator)) "Sets the elevator's [[ambient-sound]] up" (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "cpad-elevator-l" :fo-max 70) (-> this root trans)) @@ -186,7 +182,7 @@ ;; definition for method 33 of type cpad-elevator ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! cpad-elevator ((this cpad-elevator)) +(defmethod init-plat! ((this cpad-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (let ((last-path-index (+ (-> this path curve num-cverts) -1))) @@ -199,7 +195,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 31 of type cpad-elevator ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-plat-collision! cpad-elevator ((this cpad-elevator)) +(defmethod init-plat-collision! ((this cpad-elevator)) "TODO - collision stuff for setting up the platform" (let ((cshape-moving (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape-moving dynam) (copy *standard-dynamics* 'process)) diff --git a/test/decompiler/reference/jak2/levels/castle/pad/caspad-part_REF.gc b/test/decompiler/reference/jak2/levels/castle/pad/caspad-part_REF.gc index 33b03cbc959..2e8c1c1c46b 100644 --- a/test/decompiler/reference/jak2/levels/castle/pad/caspad-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/pad/caspad-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type caspad-part (deftype caspad-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type caspad-part -(defmethod inspect caspad-part ((this caspad-part)) +(defmethod inspect ((this caspad-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc b/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc index 3e45272ffd8..95bef519b6c 100644 --- a/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc @@ -3,37 +3,35 @@ ;; definition of type roboguard-level (deftype roboguard-level (nav-enemy) - ((unknown-n12kjh3n123 int32 5 :offset-assert 604) - (flags uint16 :offset-assert 624) - (roll-timer time-frame :offset-assert 632) - (roll-dir vector :inline :offset-assert 640) - (incoming-attack-id uint32 :offset-assert 656) - (turning-acc float :offset-assert 660) - (speed float :offset-assert 664) - (roll-attack-count uint32 :offset-assert 668) - (roll-sound sound-id :offset-assert 672) + ((unknown-n12kjh3n123 int32 5) + (flags uint16) + (roll-timer time-frame) + (roll-dir vector :inline) + (incoming-attack-id uint32) + (turning-acc float) + (speed float) + (roll-attack-count uint32) + (roll-sound sound-id) ) - :heap-base #x230 - :method-count-assert 189 - :size-assert #x2a4 - :flag-assert #xbd023002a4 + (:state-methods + roboguard-level-state-178 + roboguard-level-state-179 + roll-enter + roll-hostile + roll-to-walk + idle-dizzy + explode + ) (:methods - (roboguard-level-method-178 (_type_) none 178) - (roboguard-level-method-179 (_type_) none 179) - (roll-enter () _type_ :state 180) - (roll-hostile () _type_ :state 181) - (roll-to-walk () _type_ :state 182) - (idle-dizzy () _type_ :state 183) - (explode () _type_ :state 184) - (roboguard-level-method-185 (_type_ symbol) none 185) - (roboguard-level-method-186 (_type_) none 186) - (roboguard-level-method-187 (_type_) none 187) - (roboguard-level-method-188 (_type_) none 188) + (roboguard-level-method-185 (_type_ symbol) none) + (roboguard-level-method-186 (_type_) none) + (roboguard-level-method-187 (_type_) none) + (roboguard-level-method-188 (_type_) none) ) ) ;; definition for method 3 of type roboguard-level -(defmethod inspect roboguard-level ((this roboguard-level)) +(defmethod inspect ((this roboguard-level)) (when (not this) (set! this this) (goto cfg-4) @@ -763,7 +761,7 @@ ) ;; definition for method 70 of type roboguard-level -(defmethod go-hostile roboguard-level ((this roboguard-level)) +(defmethod go-hostile ((this roboguard-level)) (go (method-of-object this roll-enter)) ) @@ -845,7 +843,7 @@ ;; definition for method 185 of type roboguard-level ;; WARN: Return type mismatch int vs none. -(defmethod roboguard-level-method-185 roboguard-level ((this roboguard-level) (arg0 symbol)) +(defmethod roboguard-level-method-185 ((this roboguard-level) (arg0 symbol)) (let ((v1-1 (-> this root root-prim)) (a0-1 arg0) ) @@ -912,7 +910,7 @@ ) ;; definition for method 77 of type roboguard-level -(defmethod enemy-method-77 roboguard-level ((this roboguard-level) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this roboguard-level) (arg0 (pointer float))) (ja-channel-push! 1 0) (case (-> this incoming knocked-type) (((knocked-type knocked-type-0) @@ -946,7 +944,7 @@ ) ;; definition for method 78 of type roboguard-level -(defmethod enemy-method-78 roboguard-level ((this roboguard-level) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this roboguard-level) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-0) (knocked-type knocked-type-1) @@ -980,7 +978,7 @@ ;; definition for method 74 of type roboguard-level ;; INFO: Used lq/sq -(defmethod general-event-handler roboguard-level ((this roboguard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this roboguard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -1064,7 +1062,7 @@ ;; definition for method 76 of type roboguard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 roboguard-level ((this roboguard-level) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 ((this roboguard-level) (arg0 process) (arg1 event-message-block)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1159,7 +1157,7 @@ ;; definition for method 142 of type roboguard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 roboguard-level ((this roboguard-level) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this roboguard-level) (arg0 nav-control)) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) (set! (-> s3-0 quad) (-> a1-1 heading quad)) @@ -1186,7 +1184,7 @@ ;; definition for method 176 of type roboguard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-176 roboguard-level ((this roboguard-level)) +(defmethod nav-enemy-method-176 ((this roboguard-level)) (nav-enemy-method-177 this) (let ((a0-2 this)) (when (logtest? (enemy-flag enemy-flag36) (-> a0-2 enemy-flags)) @@ -1209,7 +1207,7 @@ ) ;; definition for method 132 of type roboguard-level -(defmethod dispose! roboguard-level ((this roboguard-level)) +(defmethod dispose! ((this roboguard-level)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) (send-event (ppointer->process (-> this parent)) 'roboguard-die) @@ -1219,20 +1217,20 @@ ) ;; definition for method 10 of type roboguard-level -(defmethod deactivate roboguard-level ((this roboguard-level)) +(defmethod deactivate ((this roboguard-level)) (sound-stop (-> this roll-sound)) (call-parent-method this) (none) ) ;; definition for method 7 of type roboguard-level -(defmethod relocate roboguard-level ((this roboguard-level) (arg0 int)) +(defmethod relocate ((this roboguard-level) (arg0 int)) (call-parent-method this arg0) ) ;; definition for method 114 of type roboguard-level ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! roboguard-level ((this roboguard-level)) +(defmethod init-enemy-collision! ((this roboguard-level)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1292,7 +1290,7 @@ ;; definition for method 115 of type roboguard-level ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! roboguard-level ((this roboguard-level)) +(defmethod init-enemy! ((this roboguard-level)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/city/bombbot/bombbot-h_REF.gc b/test/decompiler/reference/jak2/levels/city/bombbot/bombbot-h_REF.gc index d75df104579..0210a8547aa 100644 --- a/test/decompiler/reference/jak2/levels/city/bombbot/bombbot-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/bombbot/bombbot-h_REF.gc @@ -3,19 +3,16 @@ ;; definition of type bombbot-node (deftype bombbot-node (structure) - ((position vector :inline :offset-assert 0) - (nav-mesh-id uint32 :offset-assert 16) - (pos-x float :offset 0) - (pos-y float :offset 4) - (pos-z float :offset 8) + ((position vector :inline) + (nav-mesh-id uint32) + (pos-x float :overlay-at (-> position data 0)) + (pos-y float :overlay-at (-> position data 1)) + (pos-z float :overlay-at (-> position data 2)) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type bombbot-node -(defmethod inspect bombbot-node ((this bombbot-node)) +(defmethod inspect ((this bombbot-node)) (when (not this) (set! this this) (goto cfg-4) @@ -32,16 +29,13 @@ ;; definition of type bombbot-path (deftype bombbot-path (structure) - ((node-count uint16 :offset-assert 0) - (node (inline-array bombbot-node) :offset-assert 4) + ((node-count uint16) + (node (inline-array bombbot-node)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type bombbot-path -(defmethod inspect bombbot-path ((this bombbot-path)) +(defmethod inspect ((this bombbot-path)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc b/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc index 758978be7b7..610df8ee79e 100644 --- a/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc @@ -514,25 +514,22 @@ ;; definition of type bombbot-foot (deftype bombbot-foot (structure) - ((pos-offset vector :inline :offset-assert 0) - (joint-index uint32 :offset-assert 16) - (offset float :offset-assert 20) - (position vector :inline :offset-assert 32) - (next-position vector :inline :offset-assert 48) - (real-position vector :inline :offset-assert 64) - (speed vector :inline :offset-assert 80) - (moving symbol :offset-assert 96) - (main-y float :offset-assert 100) - (delta-y float :offset-assert 104) + ((pos-offset vector :inline) + (joint-index uint32) + (offset float) + (position vector :inline) + (next-position vector :inline) + (real-position vector :inline) + (speed vector :inline) + (moving symbol) + (main-y float) + (delta-y float) ) :pack-me - :method-count-assert 9 - :size-assert #x6c - :flag-assert #x90000006c ) ;; definition for method 3 of type bombbot-foot -(defmethod inspect bombbot-foot ((this bombbot-foot)) +(defmethod inspect ((this bombbot-foot)) (when (not this) (set! this this) (goto cfg-4) @@ -554,65 +551,63 @@ ;; definition of type bombbot (deftype bombbot (nav-enemy) - ((joint-ik joint-mod-ik 4 :offset-assert 604) - (feet bombbot-foot 4 :inline :offset-assert 624) - (legs-strength float 4 :offset-assert 1072) - (last-trans vector :inline :offset-assert 1088) - (linear-speed vector :inline :offset-assert 1104) - (last-quat quaternion :inline :offset-assert 1120) - (y-angular-velocity float :offset-assert 1136) - (main-quat quaternion :inline :offset-assert 1152) - (main-spd-y float :offset-assert 1168) - (main-pos-y float :offset-assert 1172) - (main-pos vector :inline :offset-assert 1184) - (city-path bombbot-path :offset-assert 1200) - (current-node uint32 :offset-assert 1204) - (shot-count uint32 :offset-assert 1208) - (next-shoot uint64 :offset-assert 1216) - (stop-shoot uint64 :offset-assert 1224) - (next-target uint64 :offset-assert 1232) - (start-target uint64 :offset-assert 1240) - (beep-time time-frame :offset-assert 1248) - (target-pos vector :inline :offset-assert 1264) - (start-target-pos vector :inline :offset-assert 1280) - (start-target-vel vector :inline :offset-assert 1296) - (top-quat quaternion :inline :offset-assert 1312) - (gun-swivel-quat quaternion :inline :offset-assert 1328) - (gun-quat quaternion :inline :offset-assert 1344) - (angle-turret float :offset-assert 1360) - (angle-gun float :offset-assert 1364) - (high float :offset-assert 1368) - (shield-hit-points float :offset-assert 1372) - (hit-axis vector :inline :offset-assert 1376) - (rigidbody rigid-body-control :offset-assert 1392) - (info rigid-body-object-constants :offset-assert 1396) - (explosing symbol :offset-assert 1400) - (minimap connection-minimap :offset-assert 1404) - (lazer-sound sound-id :offset-assert 1408) - (head-sound sound-id :offset-assert 1412) - (cannon-sound sound-id :offset-assert 1416) - (last-head-roty-speed float :offset-assert 1420) - (head-roty-speed float :offset-assert 1424) - (last-cannon-roty-speed float :offset-assert 1428) - (cannon-roty-speed float :offset-assert 1432) + ((joint-ik joint-mod-ik 4) + (feet bombbot-foot 4 :inline) + (legs-strength float 4) + (last-trans vector :inline) + (linear-speed vector :inline) + (last-quat quaternion :inline) + (y-angular-velocity float) + (main-quat quaternion :inline) + (main-spd-y float) + (main-pos-y float) + (main-pos vector :inline) + (city-path bombbot-path) + (current-node uint32) + (shot-count uint32) + (next-shoot uint64) + (stop-shoot uint64) + (next-target uint64) + (start-target uint64) + (beep-time time-frame) + (target-pos vector :inline) + (start-target-pos vector :inline) + (start-target-vel vector :inline) + (top-quat quaternion :inline) + (gun-swivel-quat quaternion :inline) + (gun-quat quaternion :inline) + (angle-turret float) + (angle-gun float) + (high float) + (shield-hit-points float) + (hit-axis vector :inline) + (rigidbody rigid-body-control) + (info rigid-body-object-constants) + (explosing symbol) + (minimap connection-minimap) + (lazer-sound sound-id) + (head-sound sound-id) + (cannon-sound sound-id) + (last-head-roty-speed float) + (head-roty-speed float) + (last-cannon-roty-speed float) + (cannon-roty-speed float) ) - :heap-base #x520 - :method-count-assert 185 - :size-assert #x59c - :flag-assert #xb90520059c + (:state-methods + explode + ) (:methods - (explode () _type_ :state 178) - (bombbot-method-179 (_type_) none 179) - (bombbot-method-180 (_type_) none 180) - (bombbot-method-181 (_type_ vector) none 181) - (bombbot-method-182 (_type_) none 182) - (bombbot-method-183 (_type_) none 183) - (bombbot-method-184 (_type_) none 184) + (bombbot-method-179 (_type_) none) + (bombbot-method-180 (_type_) none) + (bombbot-method-181 (_type_ vector) none) + (bombbot-method-182 (_type_) none) + (bombbot-method-183 (_type_) none) + (bombbot-method-184 (_type_) none) ) ) ;; definition for method 3 of type bombbot -(defmethod inspect bombbot ((this bombbot)) +(defmethod inspect ((this bombbot)) (when (not this) (set! this this) (goto cfg-4) @@ -779,16 +774,13 @@ ;; definition of type ik-setup (deftype ik-setup (structure) - ((elbow-index int32 :offset-assert 0) - (hand-dist float :offset-assert 4) + ((elbow-index int32) + (hand-dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type ik-setup -(defmethod inspect ik-setup ((this ik-setup)) +(defmethod inspect ((this ik-setup)) (when (not this) (set! this this) (goto cfg-4) @@ -880,7 +872,7 @@ ;; definition for method 180 of type bombbot ;; INFO: Used lq/sq -(defmethod bombbot-method-180 bombbot ((this bombbot)) +(defmethod bombbot-method-180 ((this bombbot)) (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) @@ -917,7 +909,7 @@ ;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 ;; WARN: Return type mismatch int vs none. -(defmethod bombbot-method-179 bombbot ((this bombbot)) +(defmethod bombbot-method-179 ((this bombbot)) (local-vars (at-0 int) (sv-864 vector) @@ -1273,7 +1265,7 @@ ;; definition for method 55 of type bombbot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! bombbot ((this bombbot)) +(defmethod track-target! ((this bombbot)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1364,18 +1356,18 @@ ) ;; definition for method 12 of type bombbot -(defmethod run-logic? bombbot ((this bombbot)) +(defmethod run-logic? ((this bombbot)) #t ) ;; definition for method 58 of type bombbot -(defmethod enemy-method-58 bombbot ((this bombbot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 ((this bombbot) (arg0 process) (arg1 event-message-block)) ((method-of-type nav-enemy enemy-method-58) this arg0 arg1) 'hit-flinch ) ;; definition for method 56 of type bombbot -(defmethod damage-amount-from-attack bombbot ((this bombbot) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this bombbot) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (-> arg1 param 1) (let ((f0-1 (the float (penetrate-using->damage (the-as penetrate (-> this incoming penetrate-using)))))) @@ -1400,7 +1392,7 @@ ;; definition for method 74 of type bombbot ;; INFO: Used lq/sq -(defmethod general-event-handler bombbot ((this bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -1482,7 +1474,7 @@ ;; definition for method 181 of type bombbot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod bombbot-method-181 bombbot ((this bombbot) (arg0 vector)) +(defmethod bombbot-method-181 ((this bombbot) (arg0 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1725,7 +1717,7 @@ ;; definition for method 182 of type bombbot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod bombbot-method-182 bombbot ((this bombbot)) +(defmethod bombbot-method-182 ((this bombbot)) (local-vars (v1-28 symbol) (sv-880 matrix) @@ -2305,7 +2297,7 @@ ) ;; definition for method 7 of type bombbot -(defmethod relocate bombbot ((this bombbot) (arg0 int)) +(defmethod relocate ((this bombbot) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this joint-ik v1-0)) (&+! (-> this joint-ik v1-0) arg0) @@ -2319,7 +2311,7 @@ ;; definition for method 114 of type bombbot ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! bombbot ((this bombbot)) +(defmethod init-enemy-collision! ((this bombbot)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -2579,7 +2571,7 @@ ) ;; definition for method 60 of type bombbot -(defmethod coin-flip? bombbot ((this bombbot)) +(defmethod coin-flip? ((this bombbot)) "@returns The result of a 50/50 RNG roll" #f ) @@ -2825,16 +2817,13 @@ ;; definition of type spring-setup (deftype spring-setup (structure) - ((bpos1 vector :offset-assert 0) - (wpos2 vector :offset-assert 4) + ((bpos1 vector) + (wpos2 vector) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type spring-setup -(defmethod inspect spring-setup ((this spring-setup)) +(defmethod inspect ((this spring-setup)) (when (not this) (set! this this) (goto cfg-4) @@ -2870,7 +2859,7 @@ ;; definition for method 183 of type bombbot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod bombbot-method-183 bombbot ((this bombbot)) +(defmethod bombbot-method-183 ((this bombbot)) (local-vars (at-0 int) (sv-160 vector) (sv-176 vector)) (with-pp (rlet ((vf0 :class vf) @@ -2959,7 +2948,7 @@ ;; definition for method 184 of type bombbot ;; WARN: Return type mismatch int vs none. -(defmethod bombbot-method-184 bombbot ((this bombbot)) +(defmethod bombbot-method-184 ((this bombbot)) (rigid-body-control-method-10 (-> this rigidbody) (the-as rigid-body-object this) @@ -2973,7 +2962,7 @@ ;; definition for method 115 of type bombbot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! bombbot ((this bombbot)) +(defmethod init-enemy! ((this bombbot)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -3096,18 +3085,15 @@ ;; definition of type bombbot-spawn-params (deftype bombbot-spawn-params (structure) - ((position vector :inline :offset-assert 0) - (quat quaternion :inline :offset-assert 16) - (nav-mesh basic :offset-assert 32) - (path bombbot-path :offset-assert 36) + ((position vector :inline) + (quat quaternion :inline) + (nav-mesh basic) + (path bombbot-path) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; definition for method 3 of type bombbot-spawn-params -(defmethod inspect bombbot-spawn-params ((this bombbot-spawn-params)) +(defmethod inspect ((this bombbot-spawn-params)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/burning-bush/ctywide-bbush_REF.gc b/test/decompiler/reference/jak2/levels/city/burning-bush/ctywide-bbush_REF.gc index 186c0d8e624..c47af4d38c2 100644 --- a/test/decompiler/reference/jak2/levels/city/burning-bush/ctywide-bbush_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/burning-bush/ctywide-bbush_REF.gc @@ -259,26 +259,24 @@ ;; definition of type race-ring (deftype race-ring (process-drawable) - ((last-target-pos vector :inline :offset-assert 208) - (keep-part-track-alive symbol :offset-assert 224) - (part-track handle :offset-assert 232) - (rot-y float :offset-assert 240) - (cyl cylinder-flat :inline :offset-assert 256) + ((last-target-pos vector :inline) + (keep-part-track-alive symbol) + (part-track handle) + (rot-y float) + (cyl cylinder-flat :inline) ) - :heap-base #xb0 - :method-count-assert 24 - :size-assert #x128 - :flag-assert #x1800b00128 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (race-ring-method-22 (_type_) none 22) - (race-ring-method-23 (_type_) none 23) + (race-ring-method-22 (_type_) none) + (race-ring-method-23 (_type_) none) ) ) ;; definition for method 3 of type race-ring -(defmethod inspect race-ring ((this race-ring)) +(defmethod inspect ((this race-ring)) (when (not this) (set! this this) (goto cfg-4) @@ -486,7 +484,7 @@ ;; definition for method 22 of type race-ring ;; WARN: Return type mismatch int vs none. -(defmethod race-ring-method-22 race-ring ((this race-ring)) +(defmethod race-ring-method-22 ((this race-ring)) (set! (-> this root) (new 'process 'trsqv)) 0 (none) @@ -495,7 +493,7 @@ ;; definition for method 23 of type race-ring ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod race-ring-method-23 race-ring ((this race-ring)) +(defmethod race-ring-method-23 ((this race-ring)) (add-icon! *minimap* this (the-as uint 15) (the-as int #f) (the-as vector #t) 0) (set! (-> this keep-part-track-alive) #f) (set! (-> this part-track) (the-as handle #f)) @@ -537,18 +535,15 @@ ;; definition of type bb-ring-info (deftype bb-ring-info (structure) - ((time time-frame :offset-assert 0) - (start-pos vector :inline :offset-assert 16) - (rotation float :offset-assert 32) - (rings (array city-race-ring-info) :offset-assert 36) + ((time time-frame) + (start-pos vector :inline) + (rotation float) + (rings (array city-race-ring-info)) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; definition for method 3 of type bb-ring-info -(defmethod inspect bb-ring-info ((this bb-ring-info)) +(defmethod inspect ((this bb-ring-info)) (when (not this) (set! this this) (goto cfg-4) @@ -1698,24 +1693,22 @@ ;; definition of type bush-collect (deftype bush-collect (process-drawable) - ((minimap connection-minimap :offset-assert 200) - (trans-y float :offset-assert 204) - (beep-time float :offset-assert 208) + ((minimap connection-minimap) + (trans-y float) + (beep-time float) ) - :heap-base #x60 - :method-count-assert 24 - :size-assert #xd4 - :flag-assert #x18006000d4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (bush-collect-method-22 (_type_) none 22) - (bush-collect-method-23 (_type_) none 23) + (bush-collect-method-22 (_type_) none) + (bush-collect-method-23 (_type_) none) ) ) ;; definition for method 3 of type bush-collect -(defmethod inspect bush-collect ((this bush-collect)) +(defmethod inspect ((this bush-collect)) (when (not this) (set! this this) (goto cfg-4) @@ -1732,7 +1725,7 @@ ;; definition for method 22 of type bush-collect ;; WARN: Return type mismatch int vs none. -(defmethod bush-collect-method-22 bush-collect ((this bush-collect)) +(defmethod bush-collect-method-22 ((this bush-collect)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1761,7 +1754,7 @@ ;; definition for method 23 of type bush-collect ;; WARN: Return type mismatch int vs none. -(defmethod bush-collect-method-23 bush-collect ((this bush-collect)) +(defmethod bush-collect-method-23 ((this bush-collect)) 0 (none) ) @@ -1834,7 +1827,7 @@ ;; definition for method 11 of type bush-collect ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! bush-collect ((this bush-collect) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bush-collect) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1918,20 +1911,17 @@ This commonly includes things such as: ;; definition of type burning-bush-collection-info (deftype burning-bush-collection-info (structure) - ((pos vector :inline :offset-assert 0) - (handle handle :offset-assert 16) - (minimap connection-minimap :offset-assert 24) + ((pos vector :inline) + (handle handle) + (minimap connection-minimap) ) - :method-count-assert 10 - :size-assert #x1c - :flag-assert #xa0000001c (:methods - (burning-bush-collection-info-method-9 (_type_ object) none 9) + (burning-bush-collection-info-method-9 (_type_ object) none) ) ) ;; definition for method 3 of type burning-bush-collection-info -(defmethod inspect burning-bush-collection-info ((this burning-bush-collection-info)) +(defmethod inspect ((this burning-bush-collection-info)) (when (not this) (set! this this) (goto cfg-4) @@ -1946,7 +1936,7 @@ This commonly includes things such as: ;; definition for method 9 of type burning-bush-collection-info ;; WARN: Return type mismatch int vs none. -(defmethod burning-bush-collection-info-method-9 burning-bush-collection-info ((this burning-bush-collection-info) (arg0 object)) +(defmethod burning-bush-collection-info-method-9 ((this burning-bush-collection-info) (arg0 object)) (format arg0 "(static-burning-bush-collection-info~%") (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%)~%" (-> this pos x) (-> this pos y) (-> this pos z)) 0 @@ -1955,17 +1945,14 @@ This commonly includes things such as: ;; definition of type bb-collection-info (deftype bb-collection-info (structure) - ((user-data uint32 :offset-assert 0) - (time time-frame :offset-assert 8) - (colls (array burning-bush-collection-info) :offset-assert 16) + ((user-data uint32) + (time time-frame) + (colls (array burning-bush-collection-info)) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type bb-collection-info -(defmethod inspect bb-collection-info ((this bb-collection-info)) +(defmethod inspect ((this bb-collection-info)) (when (not this) (set! this this) (goto cfg-4) @@ -2810,19 +2797,16 @@ This commonly includes things such as: ;; definition of type burning-bush-get-on-info (deftype burning-bush-get-on-info (structure) - ((trans vector :inline :offset-assert 0) - (quat quaternion :inline :offset-assert 16) - (camera-trans vector :inline :offset-assert 32) - (camera-rot float 9 :offset-assert 48) - (time float :offset-assert 84) + ((trans vector :inline) + (quat quaternion :inline) + (camera-trans vector :inline) + (camera-rot float 9) + (time float) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) ;; definition for method 3 of type burning-bush-get-on-info -(defmethod inspect burning-bush-get-on-info ((this burning-bush-get-on-info)) +(defmethod inspect ((this burning-bush-get-on-info)) (when (not this) (set! this this) (goto cfg-4) @@ -3199,7 +3183,7 @@ This commonly includes things such as: ;; definition for method 15 of type hud-homing-beacon ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-homing-beacon ((this hud-homing-beacon)) +(defmethod draw ((this hud-homing-beacon)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -3219,7 +3203,7 @@ This commonly includes things such as: ;; definition for method 16 of type hud-homing-beacon ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-homing-beacon ((this hud-homing-beacon)) +(defmethod update-values ((this hud-homing-beacon)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -3228,7 +3212,7 @@ This commonly includes things such as: ;; definition for method 17 of type hud-homing-beacon ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-homing-beacon ((this hud-homing-beacon)) +(defmethod init-callback ((this hud-homing-beacon)) (set! (-> this level) (level-get *level* 'lbbush)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -3242,7 +3226,7 @@ This commonly includes things such as: ;; definition for method 15 of type hud-dark-eco-pickup ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-dark-eco-pickup ((this hud-dark-eco-pickup)) +(defmethod draw ((this hud-dark-eco-pickup)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -3262,7 +3246,7 @@ This commonly includes things such as: ;; definition for method 16 of type hud-dark-eco-pickup ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-dark-eco-pickup ((this hud-dark-eco-pickup)) +(defmethod update-values ((this hud-dark-eco-pickup)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -3271,7 +3255,7 @@ This commonly includes things such as: ;; definition for method 17 of type hud-dark-eco-pickup ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-dark-eco-pickup ((this hud-dark-eco-pickup)) +(defmethod init-callback ((this hud-dark-eco-pickup)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -3284,7 +3268,7 @@ This commonly includes things such as: ;; definition for method 15 of type hud-green-eco-pickup ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-green-eco-pickup ((this hud-green-eco-pickup)) +(defmethod draw ((this hud-green-eco-pickup)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -3304,7 +3288,7 @@ This commonly includes things such as: ;; definition for method 16 of type hud-green-eco-pickup ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-green-eco-pickup ((this hud-green-eco-pickup)) +(defmethod update-values ((this hud-green-eco-pickup)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -3313,7 +3297,7 @@ This commonly includes things such as: ;; definition for method 17 of type hud-green-eco-pickup ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-green-eco-pickup ((this hud-green-eco-pickup)) +(defmethod init-callback ((this hud-green-eco-pickup)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/test/decompiler/reference/jak2/levels/city/common/height-map-h_REF.gc b/test/decompiler/reference/jak2/levels/city/common/height-map-h_REF.gc index 9d7f8073a4c..965ce01936b 100644 --- a/test/decompiler/reference/jak2/levels/city/common/height-map-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/height-map-h_REF.gc @@ -6,33 +6,30 @@ "TODO - not terribly well understood yet, but this is used for the traffic height map this is primarily used to store a massive amount of bytes in the `data` field all initialized from static data." - ((offset float 3 :offset-assert 0) - (x-offset float :offset 0) - (y-offset float :offset 4) - (z-offset float :offset 8) - (x-inv-spacing float :offset-assert 12) - (z-inv-spacing float :offset-assert 16) - (y-scale float :offset-assert 20) - (dim int16 2 :offset-assert 24) - (x-dim int16 :offset 24) - (z-dim int16 :offset 26) - (data (pointer int8) :offset-assert 28) + ((offset float 3) + (x-offset float :overlay-at (-> offset 0)) + (y-offset float :overlay-at (-> offset 1)) + (z-offset float :overlay-at (-> offset 2)) + (x-inv-spacing float) + (z-inv-spacing float) + (y-scale float) + (dim int16 2) + (x-dim int16 :overlay-at (-> dim 0)) + (z-dim int16 :overlay-at (-> dim 1)) + (data (pointer int8)) ) - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 (:methods - (get-height-at-point (_type_ vector) float 9) - (debug-draw-mesh (_type_ vector) none 10) - (debug-print (_type_) none 11) - (debug-draw-at-point (_type_ vector) none 12) - (debug-draw (_type_ vector) none 13) - (debug-add-offset (_type_ vector int) none 14) + (get-height-at-point (_type_ vector) float) + (debug-draw-mesh (_type_ vector) none) + (debug-print (_type_) none) + (debug-draw-at-point (_type_ vector) none) + (debug-draw (_type_ vector) none) + (debug-add-offset (_type_ vector int) none) ) ) ;; definition for method 3 of type xz-height-map -(defmethod inspect xz-height-map ((this xz-height-map)) +(defmethod inspect ((this xz-height-map)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/common/height-map_REF.gc b/test/decompiler/reference/jak2/levels/city/common/height-map_REF.gc index 53973282db4..e9cacd1b76d 100644 --- a/test/decompiler/reference/jak2/levels/city/common/height-map_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/height-map_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 11 of type xz-height-map ;; WARN: Return type mismatch int vs none. -(defmethod debug-print xz-height-map ((this xz-height-map)) +(defmethod debug-print ((this xz-height-map)) (format #t "(define *traffic-height-map*~%") (format #t " (static-height-map~%") (format @@ -38,7 +38,7 @@ ;; definition for method 14 of type xz-height-map ;; WARN: Return type mismatch int vs none. -(defmethod debug-add-offset xz-height-map ((this xz-height-map) (arg0 vector) (arg1 int)) +(defmethod debug-add-offset ((this xz-height-map) (arg0 vector) (arg1 int)) "Add an offset to the given point, likely for debugging purposes." (let ((v1-1 (the int (+ 0.5 (* (- (-> arg0 x) (-> this x-offset)) (-> this x-inv-spacing))))) (a1-1 (the int (+ 0.5 (* (- (-> arg0 z) (-> this z-offset)) (-> this z-inv-spacing))))) @@ -55,7 +55,7 @@ ;; definition for method 12 of type xz-height-map ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-at-point xz-height-map ((this xz-height-map) (arg0 vector)) +(defmethod debug-draw-at-point ((this xz-height-map) (arg0 vector)) (let ((v1-1 (the int (+ 0.5 (* (- (-> arg0 x) (-> this x-offset)) (-> this x-inv-spacing))))) (a1-1 (the int (+ 0.5 (* (- (-> arg0 z) (-> this z-offset)) (-> this z-inv-spacing))))) (a2-1 (-> this x-dim)) @@ -92,7 +92,7 @@ ) ;; definition for method 9 of type xz-height-map -(defmethod get-height-at-point xz-height-map ((this xz-height-map) (arg0 vector)) +(defmethod get-height-at-point ((this xz-height-map) (arg0 vector)) (let* ((f0-1 (fmax 0.0 (* (-> this x-inv-spacing) (- (-> arg0 x) (-> this x-offset))))) (f2-4 (fmax 0.0 (* (-> this z-inv-spacing) (- (-> arg0 z) (-> this z-offset))))) (a2-0 (the int f0-1)) @@ -132,7 +132,7 @@ ;; definition for method 10 of type xz-height-map ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-mesh xz-height-map ((this xz-height-map) (arg0 vector)) +(defmethod debug-draw-mesh ((this xz-height-map) (arg0 vector)) (local-vars (sv-80 int) (sv-96 int)) (rlet ((vf0 :class vf)) (init-vf0-vector) @@ -221,7 +221,7 @@ ;; definition for method 13 of type xz-height-map ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw xz-height-map ((this xz-height-map) (arg0 vector)) +(defmethod debug-draw ((this xz-height-map) (arg0 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) diff --git a/test/decompiler/reference/jak2/levels/city/common/nav-graph-h_REF.gc b/test/decompiler/reference/jak2/levels/city/common/nav-graph-h_REF.gc index b0d06af982d..3313161d302 100644 --- a/test/decompiler/reference/jak2/levels/city/common/nav-graph-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/nav-graph-h_REF.gc @@ -3,40 +3,37 @@ ;; definition of type nav-branch (deftype nav-branch (structure) - ((node nav-node 2 :offset-assert 0) - (src-node nav-node :offset 0) - (dest-node nav-node :offset 4) - (temp-dest-node-id int32 :offset 4) - (speed-limit uint8 :offset-assert 8) - (density uint8 :offset-assert 9) - (clock-type nav-branch-clock-type :offset-assert 10) - (clock-mask nav-branch-clock-mask :offset-assert 11) - (max-user-count uint8 :offset-assert 12) - (user-count uint8 :offset-assert 13) - (width uint8 :offset-assert 14) - (flags nav-branch-flags :offset-assert 15) + ((node nav-node 2) + (src-node nav-node :overlay-at (-> node 0)) + (dest-node nav-node :overlay-at (-> node 1)) + (temp-dest-node-id int32 :overlay-at (-> node 1)) + (speed-limit uint8) + (density uint8) + (clock-type nav-branch-clock-type) + (clock-mask nav-branch-clock-mask) + (max-user-count uint8) + (user-count uint8) + (width uint8) + (flags nav-branch-flags) ) - :method-count-assert 21 - :size-assert #x10 - :flag-assert #x1500000010 (:methods - (set-default-density-speed-and-width (_type_) none 9) - (debug-print (_type_ object int) none 10) - (get-density (_type_) float 11) - (get-speed-limit (_type_) float 12) - (get-width (_type_) float 13) - (user-limit-reached? (_type_) symbol 14) - (dest-node-id-at-max? (_type_) symbol 15) - (set-density (_type_ float) none 16) - (set-speed-limit (_type_ float) none 17) - (set-width (_type_ float) none 18) - (set-src-node (_type_ nav-node) none 19) - (set-dst-node (_type_ nav-node) none 20) + (set-default-density-speed-and-width (_type_) none) + (debug-print (_type_ object int) none) + (get-density (_type_) float) + (get-speed-limit (_type_) float) + (get-width (_type_) float) + (user-limit-reached? (_type_) symbol) + (dest-node-id-at-max? (_type_) symbol) + (set-density (_type_ float) none) + (set-speed-limit (_type_ float) none) + (set-width (_type_ float) none) + (set-src-node (_type_ nav-node) none) + (set-dst-node (_type_ nav-node) none) ) ) ;; definition for method 3 of type nav-branch -(defmethod inspect nav-branch ((this nav-branch)) +(defmethod inspect ((this nav-branch)) (when (not this) (set! this this) (goto cfg-4) @@ -60,43 +57,40 @@ ;; definition of type nav-node (deftype nav-node (structure) - ((data uint32 8 :offset-assert 0) - (position vector :inline :offset 0) - (pos-x float :offset 0) - (pos-y float :offset 4) - (pos-z float :offset 8) - (angle uint16 :offset 12) - (id uint16 :offset 14) - (radius uint8 :offset 16) - (branch-count int8 :offset 17) - (flags nav-node-flag-byte :offset 18) - (pad0 int8 1 :offset 19) - (branch-array (inline-array nav-branch) :offset 20) - (nav-mesh-id uint32 :offset 24) - (level symbol :offset 28) + ((data uint32 8) + (position vector :inline :overlay-at (-> data 0)) + (pos-x float :overlay-at (-> data 0)) + (pos-y float :overlay-at (-> data 1)) + (pos-z float :overlay-at (-> data 2)) + (angle uint16 :overlay-at (-> data 3)) + (id uint16 :offset 14) + (radius uint8 :overlay-at (-> data 4)) + (branch-count int8 :offset 17) + (flags nav-node-flag-byte :offset 18) + (pad0 int8 1 :offset 19) + (branch-array (inline-array nav-branch) :overlay-at (-> data 5)) + (nav-mesh-id uint32 :overlay-at (-> data 6)) + (level symbol :overlay-at (-> data 7)) ) - :method-count-assert 22 - :size-assert #x20 - :flag-assert #x1600000020 (:methods - (debug-draw (_type_) none 9) - (debug-print (_type_ symbol string) none 10) - (remove-branch-by-idx (_type_ int) none 11) - (init-from-pt-and-heading (_type_ vector vector) none 12) - (set-pos-xyz (_type_ vector) none 13) - (set-angle-from-heading (_type_ vector) none 14) - (set-id-and-link-branches-back (_type_ uint) none 15) - (set-radius (_type_ float) none 16) - (set-angle (_type_ float) none 17) - (get-position (_type_ vector) vector 18) - (calc-sine-and-cosine! (_type_ vector) vector 19) - (get-angle (_type_) float 20) - (get-radius (_type_) float 21) + (debug-draw (_type_) none) + (debug-print (_type_ symbol string) none) + (remove-branch-by-idx (_type_ int) none) + (init-from-pt-and-heading (_type_ vector vector) none) + (set-pos-xyz (_type_ vector) none) + (set-angle-from-heading (_type_ vector) none) + (set-id-and-link-branches-back (_type_ uint) none) + (set-radius (_type_ float) none) + (set-angle (_type_ float) none) + (get-position (_type_ vector) vector) + (calc-sine-and-cosine! (_type_ vector) vector) + (get-angle (_type_) float) + (get-radius (_type_) float) ) ) ;; definition for method 3 of type nav-node -(defmethod inspect nav-node ((this nav-node)) +(defmethod inspect ((this nav-node)) (when (not this) (set! this this) (goto cfg-14) @@ -139,52 +133,52 @@ ) ;; definition for method 11 of type nav-branch -(defmethod get-density nav-branch ((this nav-branch)) +(defmethod get-density ((this nav-branch)) "TODO @returns `density * 0.0078125` - is this some kind of trick?" (* 0.0078125 (the float (-> this density))) ) ;; definition for method 12 of type nav-branch -(defmethod get-speed-limit nav-branch ((this nav-branch)) +(defmethod get-speed-limit ((this nav-branch)) "TODO @returns `speed-limit * 1024.0`" (* 1024.0 (the float (-> this speed-limit))) ) ;; definition for method 13 of type nav-branch -(defmethod get-width nav-branch ((this nav-branch)) +(defmethod get-width ((this nav-branch)) "TODO @returns `width * 256.0`" (* 256.0 (the float (-> this width))) ) ;; definition for method 14 of type nav-branch -(defmethod user-limit-reached? nav-branch ((this nav-branch)) +(defmethod user-limit-reached? ((this nav-branch)) (>= (-> this user-count) (-> this max-user-count)) ) ;; definition for method 15 of type nav-branch -(defmethod dest-node-id-at-max? nav-branch ((this nav-branch)) +(defmethod dest-node-id-at-max? ((this nav-branch)) "@returns if `dest-node`'s `id` is equal to `#FFFF` @see [[nav-node]]" (!= (-> this dest-node id) #xffff) ) ;; definition for method 21 of type nav-node -(defmethod get-radius nav-node ((this nav-node)) +(defmethod get-radius ((this nav-node)) "TODO @returns `radius * 1024.0" (* 1024.0 (the float (-> this radius))) ) ;; definition for method 20 of type nav-node -(defmethod get-angle nav-node ((this nav-node)) +(defmethod get-angle ((this nav-node)) (the float (-> this angle)) ) ;; definition for method 19 of type nav-node -(defmethod calc-sine-and-cosine! nav-node ((this nav-node) (ret vector)) +(defmethod calc-sine-and-cosine! ((this nav-node) (ret vector)) "Computes the sine and cosine of the `angle`. @param! ret The result @returns Nothing, the result will be in `ret`" @@ -202,7 +196,7 @@ ;; definition for method 18 of type nav-node ;; INFO: Used lq/sq -(defmethod get-position nav-node ((this nav-node) (ret vector)) +(defmethod get-position ((this nav-node) (ret vector)) "@param! ret The [[vector]] that is modified to hold the result @returns the `position` [[vector]] with a `w` component of `1.0`" (set! (-> ret quad) (-> this position quad)) @@ -212,20 +206,17 @@ ;; definition of type nav-graph-link (deftype nav-graph-link (structure) - ((id uint32 :offset-assert 0) - (dest-graph-id uint32 :offset-assert 4) - (src-branch-id uint16 :offset-assert 8) - (dest-node-id uint16 :offset-assert 10) - (dest-graph basic :offset-assert 12) - (dummy-node nav-node :inline :offset-assert 16) + ((id uint32) + (dest-graph-id uint32) + (src-branch-id uint16) + (dest-node-id uint16) + (dest-graph basic) + (dummy-node nav-node :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type nav-graph-link -(defmethod inspect nav-graph-link ((this nav-graph-link)) +(defmethod inspect ((this nav-graph-link)) (when (not this) (set! this this) (goto cfg-4) @@ -243,65 +234,62 @@ ;; definition of type nav-graph (deftype nav-graph (basic) - ((node-count int16 :offset-assert 4) - (branch-count int16 :offset-assert 6) - (node-array (inline-array nav-node) :offset-assert 8) - (branch-array (inline-array nav-branch) :offset-assert 12) - (link-count int16 :offset-assert 16) - (pad2 uint16 :offset-assert 18) - (link-array (inline-array nav-graph-link) :offset-assert 20) - (first-node int16 :offset-assert 24) - (pad0 uint16 :offset-assert 26) - (patched symbol :offset-assert 28) - (id uint32 :offset-assert 32) - (pad1 uint32 6 :offset-assert 36) + ((node-count int16) + (branch-count int16) + (node-array (inline-array nav-node)) + (branch-array (inline-array nav-branch)) + (link-count int16) + (pad2 uint16) + (link-array (inline-array nav-graph-link)) + (first-node int16) + (pad0 uint16) + (patched symbol) + (id uint32) + (pad1 uint32 6) ) - :method-count-assert 45 - :size-assert #x3c - :flag-assert #x2d0000003c (:methods - (new (symbol type int int int uint) _type_ 0) - (debug-draw-nodes (_type_) none 9) - (nav-graph-method-10 (_type_ vector int) none 10) - (nav-graph-method-11 (_type_) none 11) - (nav-graph-method-12 (_type_) none 12) - (nav-graph-method-13 (_type_ int int) none 13) - (nav-graph-method-14 (_type_ int int) none 14) - (debug-reset (_type_) none 15) - (debug-add-node (_type_ int) nav-node 16) - (debug-link-node-to-graph (_type_ nav-node) none 17) - (debug-reset-branch-array (_type_ nav-node int) none 18) - (nav-graph-method-19 (_type_ int int int int int int) none 19) - (nav-graph-method-20 (_type_ int int) none 20) - (move-selected-to-height-map-height (_type_) none 21) - (select-nodes-in-range (_type_ int int) none 22) - (deselect-nodes-in-range (_type_ int int) none 23) - (toggle-select-nodes-in-range (_type_ int int) none 24) - (select-nodes-in-level (_type_ symbol symbol) none 25) - (select-nodes-by-nav-mesh-id (_type_ int symbol) none 26) - (select-nodes-by-flags (_type_ nav-node-flag-byte nav-node-flag-byte symbol) none 27) - (print-selected-nodes (_type_) none 28) - (assign-selected-nodes-to-level (_type_ symbol) none 29) - (assign-selected-nodes-to-nav-mesh (_type_ uint) none 30) - (set-radius-of-selected-nodes (_type_ float) none 31) - (set-speed-limit-of-selected (_type_ float) none 32) - (set-density-of-selected (_type_ float) none 33) - (set-width-of-selected (_type_ float) none 34) - (or-flags-of-selected-nodes (_type_ nav-node-flag-byte) none 35) - (and-flags-of-selected-nodes (_type_ nav-node-flag-byte) none 36) - (offset-pos-of-selected (_type_ vector) none 37) - (nav-graph-method-38 (_type_) none 38) - (nav-graph-method-39 (_type_) none 39) - (nav-graph-method-40 (_type_ int) int 40) - (node-at-idx (_type_ int) nav-node 41) - (patch-nodes (_type_) none 42) - (copy-to-mysql-graph (_type_ mysql-nav-graph string) none 43) - (from-editor (_type_ mysql-nav-graph symbol) none 44) + (new (symbol type int int int uint) _type_) + (debug-draw-nodes (_type_) none) + (nav-graph-method-10 (_type_ vector int) none) + (nav-graph-method-11 (_type_) none) + (nav-graph-method-12 (_type_) none) + (nav-graph-method-13 (_type_ int int) none) + (nav-graph-method-14 (_type_ int int) none) + (debug-reset (_type_) none) + (debug-add-node (_type_ int) nav-node) + (debug-link-node-to-graph (_type_ nav-node) none) + (debug-reset-branch-array (_type_ nav-node int) none) + (nav-graph-method-19 (_type_ int int int int int int) none) + (nav-graph-method-20 (_type_ int int) none) + (move-selected-to-height-map-height (_type_) none) + (select-nodes-in-range (_type_ int int) none) + (deselect-nodes-in-range (_type_ int int) none) + (toggle-select-nodes-in-range (_type_ int int) none) + (select-nodes-in-level (_type_ symbol symbol) none) + (select-nodes-by-nav-mesh-id (_type_ int symbol) none) + (select-nodes-by-flags (_type_ nav-node-flag-byte nav-node-flag-byte symbol) none) + (print-selected-nodes (_type_) none) + (assign-selected-nodes-to-level (_type_ symbol) none) + (assign-selected-nodes-to-nav-mesh (_type_ uint) none) + (set-radius-of-selected-nodes (_type_ float) none) + (set-speed-limit-of-selected (_type_ float) none) + (set-density-of-selected (_type_ float) none) + (set-width-of-selected (_type_ float) none) + (or-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) + (and-flags-of-selected-nodes (_type_ nav-node-flag-byte) none) + (offset-pos-of-selected (_type_ vector) none) + (nav-graph-method-38 (_type_) none) + (nav-graph-method-39 (_type_) none) + (nav-graph-method-40 (_type_ int) int) + (node-at-idx (_type_ int) nav-node) + (patch-nodes (_type_) none) + (copy-to-mysql-graph (_type_ mysql-nav-graph string) none) + (from-editor (_type_ mysql-nav-graph symbol) none) ) ) ;; definition for method 3 of type nav-graph -(defmethod inspect nav-graph ((this nav-graph)) +(defmethod inspect ((this nav-graph)) (when (not this) (set! this this) (goto cfg-4) @@ -324,7 +312,7 @@ ) ;; definition for method 41 of type nav-graph -(defmethod node-at-idx nav-graph ((this nav-graph) (idx int)) +(defmethod node-at-idx ((this nav-graph) (idx int)) "Get the `nav-node` at a given position. @param idx The position in the `node-array` to return @returns the [[nav-node]] if it can be found, otherwise return [[#f]]" diff --git a/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc b/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc index f51121ff5b4..44da09ae9c3 100644 --- a/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 16 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod set-density nav-branch ((this nav-branch) (arg0 float)) +(defmethod set-density ((this nav-branch) (arg0 float)) (set! (-> this density) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 128.0 arg0))))))) 0 (none) @@ -11,7 +11,7 @@ ;; definition for method 17 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod set-speed-limit nav-branch ((this nav-branch) (arg0 float)) +(defmethod set-speed-limit ((this nav-branch) (arg0 float)) (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) 0 (none) @@ -19,7 +19,7 @@ ;; definition for method 18 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod set-width nav-branch ((this nav-branch) (arg0 float)) +(defmethod set-width ((this nav-branch) (arg0 float)) (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0))))))) 0 (none) @@ -27,7 +27,7 @@ ;; definition for method 19 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod set-src-node nav-branch ((this nav-branch) (arg0 nav-node)) +(defmethod set-src-node ((this nav-branch) (arg0 nav-node)) (set! (-> this src-node) arg0) 0 (none) @@ -35,7 +35,7 @@ ;; definition for method 20 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod set-dst-node nav-branch ((this nav-branch) (arg0 nav-node)) +(defmethod set-dst-node ((this nav-branch) (arg0 nav-node)) (set! (-> this dest-node) arg0) 0 (none) @@ -43,7 +43,7 @@ ;; definition for method 9 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod set-default-density-speed-and-width nav-branch ((this nav-branch)) +(defmethod set-default-density-speed-and-width ((this nav-branch)) (set-density this 0.25) (set-speed-limit this 61440.0) (set-width this 16384.0) @@ -54,7 +54,7 @@ ;; definition for method 9 of type nav-node ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw nav-node ((this nav-node)) +(defmethod debug-draw ((this nav-node)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) @@ -157,7 +157,7 @@ ;; definition for method 10 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod debug-print nav-branch ((this nav-branch) (arg0 object) (arg1 int)) +(defmethod debug-print ((this nav-branch) (arg0 object) (arg1 int)) (format arg0 "~S~T~T~T (new-nav-branch :dest-node-id ~d~%" arg1 (-> this dest-node id)) (let ((t9-1 format) (a0-2 arg0) @@ -246,7 +246,7 @@ ;; definition for method 10 of type nav-node ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-print nav-node ((this nav-node) (arg0 symbol) (arg1 string)) +(defmethod debug-print ((this nav-node) (arg0 symbol) (arg1 string)) (format arg0 "~S (new-nav-node :id ~d~%" arg1 (-> this id)) (format arg0 "~S~T :branch-list (~%" arg1) (dotimes (s3-0 (-> this branch-count)) @@ -308,7 +308,7 @@ ;; definition for method 13 of type nav-node ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-pos-xyz nav-node ((this nav-node) (arg0 vector)) +(defmethod set-pos-xyz ((this nav-node) (arg0 vector)) (let ((f0-0 (-> this position w))) (set! (-> this position quad) (-> arg0 quad)) (set! (-> this position w) f0-0) @@ -319,7 +319,7 @@ ;; definition for method 14 of type nav-node ;; WARN: Return type mismatch int vs none. -(defmethod set-angle-from-heading nav-node ((this nav-node) (arg0 vector)) +(defmethod set-angle-from-heading ((this nav-node) (arg0 vector)) (set! (-> this angle) (the-as uint (the int (atan (- (-> arg0 z)) (-> arg0 x))))) 0 (none) @@ -327,7 +327,7 @@ ;; definition for method 16 of type nav-node ;; WARN: Return type mismatch int vs none. -(defmethod set-radius nav-node ((this nav-node) (arg0 float)) +(defmethod set-radius ((this nav-node) (arg0 float)) (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) 0 (none) @@ -335,7 +335,7 @@ ;; definition for method 17 of type nav-node ;; WARN: Return type mismatch int vs none. -(defmethod set-angle nav-node ((this nav-node) (arg0 float)) +(defmethod set-angle ((this nav-node) (arg0 float)) (set! (-> this angle) (the-as uint (the int (+ 0.5 arg0)))) 0 (none) @@ -343,7 +343,7 @@ ;; definition for method 15 of type nav-node ;; WARN: Return type mismatch int vs none. -(defmethod set-id-and-link-branches-back nav-node ((this nav-node) (arg0 uint)) +(defmethod set-id-and-link-branches-back ((this nav-node) (arg0 uint)) (set! (-> this id) arg0) (dotimes (v1-0 (-> this branch-count)) (set! (-> this branch-array v1-0 src-node) this) @@ -354,7 +354,7 @@ ;; definition for method 12 of type nav-node ;; WARN: Return type mismatch int vs none. -(defmethod init-from-pt-and-heading nav-node ((this nav-node) (arg0 vector) (arg1 vector)) +(defmethod init-from-pt-and-heading ((this nav-node) (arg0 vector) (arg1 vector)) (set-pos-xyz this arg0) (set-angle-from-heading this arg1) (set! (-> this flags) (nav-node-flag-byte pedestrian selected)) @@ -370,7 +370,7 @@ ;; definition for method 11 of type nav-node ;; WARN: Return type mismatch int vs none. -(defmethod remove-branch-by-idx nav-node ((this nav-node) (arg0 int)) +(defmethod remove-branch-by-idx ((this nav-node) (arg0 int)) (when (and (>= arg0 0) (< arg0 (-> this branch-count))) (let ((s5-0 (+ arg0 1)) (s4-0 arg0) @@ -389,7 +389,7 @@ ;; definition for method 18 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod debug-reset-branch-array nav-graph ((this nav-graph) (arg0 nav-node) (arg1 int)) +(defmethod debug-reset-branch-array ((this nav-graph) (arg0 nav-node) (arg1 int)) "kinda dangerous" (set! (-> arg0 branch-array) (the-as (inline-array nav-branch) (-> this branch-array (-> this branch-count)))) (set! (-> arg0 branch-count) arg1) @@ -406,7 +406,7 @@ ) ;; definition for method 16 of type nav-graph -(defmethod debug-add-node nav-graph ((this nav-graph) (arg0 int)) +(defmethod debug-add-node ((this nav-graph) (arg0 int)) (let ((s4-0 (the-as nav-node #f))) (let ((s5-0 (-> this node-count)) (v1-1 (+ arg0 -1 (-> this branch-count))) @@ -424,7 +424,7 @@ ;; definition for method 17 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod debug-link-node-to-graph nav-graph ((this nav-graph) (arg0 nav-node)) +(defmethod debug-link-node-to-graph ((this nav-graph) (arg0 nav-node)) (when (> (-> arg0 branch-count) 0) (let ((a0-1 (-> arg0 branch-array 0)) (t9-0 (method-of-type nav-branch set-dst-node)) @@ -452,7 +452,7 @@ ;; definition for method 13 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-method-13 nav-graph ((this nav-graph) (arg0 int) (arg1 int)) +(defmethod nav-graph-method-13 ((this nav-graph) (arg0 int) (arg1 int)) (when (and (< arg0 (-> this node-count)) (> arg1 0)) (let ((s4-1 (min arg1 (- (-> this node-count) arg0)))) (dotimes (s3-0 (-> this node-count)) @@ -515,7 +515,7 @@ ;; definition for method 14 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-method-14 nav-graph ((this nav-graph) (arg0 int) (arg1 int)) +(defmethod nav-graph-method-14 ((this nav-graph) (arg0 int) (arg1 int)) (when (and (< arg0 (-> this node-count)) (> arg1 0)) (dotimes (s3-0 (-> this node-count)) (let ((s2-0 (-> this node-array s3-0))) @@ -562,7 +562,7 @@ ;; definition for method 15 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod debug-reset nav-graph ((this nav-graph)) +(defmethod debug-reset ((this nav-graph)) (set! (-> this node-count) 0) (set! (-> this branch-count) 0) (set! (-> this first-node) 0) @@ -573,7 +573,7 @@ ;; definition for method 12 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-method-12 nav-graph ((this nav-graph)) +(defmethod nav-graph-method-12 ((this nav-graph)) (set! (-> this first-node) (-> this node-count)) 0 (none) @@ -581,7 +581,7 @@ ;; definition for method 28 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod print-selected-nodes nav-graph ((this nav-graph)) +(defmethod print-selected-nodes ((this nav-graph)) (let ((s4-0 0) (s1-0 0) (v1-0 #f) @@ -622,7 +622,7 @@ ;; definition for method 22 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod select-nodes-in-range nav-graph ((this nav-graph) (arg0 int) (arg1 int)) +(defmethod select-nodes-in-range ((this nav-graph) (arg0 int) (arg1 int)) (when (< arg0 (-> this node-count)) (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) (a2-3 arg0) @@ -643,7 +643,7 @@ ;; definition for method 23 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod deselect-nodes-in-range nav-graph ((this nav-graph) (arg0 int) (arg1 int)) +(defmethod deselect-nodes-in-range ((this nav-graph) (arg0 int) (arg1 int)) (when (< arg0 (-> this node-count)) (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) (a2-3 arg0) @@ -664,7 +664,7 @@ ;; definition for method 24 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod toggle-select-nodes-in-range nav-graph ((this nav-graph) (arg0 int) (arg1 int)) +(defmethod toggle-select-nodes-in-range ((this nav-graph) (arg0 int) (arg1 int)) (when (< arg0 (-> this node-count)) (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) (a2-3 arg0) @@ -685,7 +685,7 @@ ;; definition for method 25 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod select-nodes-in-level nav-graph ((this nav-graph) (arg0 symbol) (arg1 symbol)) +(defmethod select-nodes-in-level ((this nav-graph) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 (-> this node-count)) (let* ((a3-1 (-> this node-array v1-0)) (t0-2 (= (-> a3-1 level) arg0)) @@ -717,7 +717,7 @@ ;; definition for method 26 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod select-nodes-by-nav-mesh-id nav-graph ((this nav-graph) (arg0 int) (arg1 symbol)) +(defmethod select-nodes-by-nav-mesh-id ((this nav-graph) (arg0 int) (arg1 symbol)) (dotimes (v1-0 (-> this node-count)) (let* ((a3-1 (-> this node-array v1-0)) (t0-2 (= (-> a3-1 nav-mesh-id) arg0)) @@ -749,7 +749,7 @@ ;; definition for method 27 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod select-nodes-by-flags nav-graph ((this nav-graph) (arg0 nav-node-flag-byte) (arg1 nav-node-flag-byte) (arg2 symbol)) +(defmethod select-nodes-by-flags ((this nav-graph) (arg0 nav-node-flag-byte) (arg1 nav-node-flag-byte) (arg2 symbol)) (dotimes (v1-0 (-> this node-count)) (let* ((t0-1 (-> this node-array v1-0)) (t1-3 (= (logand (-> t0-1 flags) arg1) arg0)) @@ -781,7 +781,7 @@ ;; definition for method 29 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod assign-selected-nodes-to-level nav-graph ((this nav-graph) (arg0 symbol)) +(defmethod assign-selected-nodes-to-level ((this nav-graph) (arg0 symbol)) (dotimes (v1-0 (-> this node-count)) (let ((a2-1 (-> this node-array v1-0))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) @@ -795,7 +795,7 @@ ;; definition for method 30 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod assign-selected-nodes-to-nav-mesh nav-graph ((this nav-graph) (arg0 uint)) +(defmethod assign-selected-nodes-to-nav-mesh ((this nav-graph) (arg0 uint)) (dotimes (v1-0 (-> this node-count)) (let ((a2-1 (-> this node-array v1-0))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) @@ -809,7 +809,7 @@ ;; definition for method 31 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod set-radius-of-selected-nodes nav-graph ((this nav-graph) (arg0 float)) +(defmethod set-radius-of-selected-nodes ((this nav-graph) (arg0 float)) (dotimes (s4-0 (-> this node-count)) (let ((a0-2 (-> this node-array s4-0))) (if (logtest? (-> a0-2 flags) (nav-node-flag-byte selected)) @@ -823,7 +823,7 @@ ;; definition for method 35 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod or-flags-of-selected-nodes nav-graph ((this nav-graph) (arg0 nav-node-flag-byte)) +(defmethod or-flags-of-selected-nodes ((this nav-graph) (arg0 nav-node-flag-byte)) (dotimes (v1-0 (-> this node-count)) (let ((a2-1 (-> this node-array v1-0))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) @@ -837,7 +837,7 @@ ;; definition for method 36 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod and-flags-of-selected-nodes nav-graph ((this nav-graph) (arg0 nav-node-flag-byte)) +(defmethod and-flags-of-selected-nodes ((this nav-graph) (arg0 nav-node-flag-byte)) (let ((v1-0 (lognot arg0))) (dotimes (a1-1 (-> this node-count)) (let ((a2-1 (-> this node-array a1-1))) @@ -853,7 +853,7 @@ ;; definition for method 32 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod set-speed-limit-of-selected nav-graph ((this nav-graph) (arg0 float)) +(defmethod set-speed-limit-of-selected ((this nav-graph) (arg0 float)) (dotimes (s4-0 (-> this node-count)) (let ((s3-0 (-> this node-array s4-0))) (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) @@ -869,7 +869,7 @@ ;; definition for method 33 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod set-density-of-selected nav-graph ((this nav-graph) (arg0 float)) +(defmethod set-density-of-selected ((this nav-graph) (arg0 float)) (dotimes (s4-0 (-> this node-count)) (let ((s3-0 (-> this node-array s4-0))) (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) @@ -885,7 +885,7 @@ ;; definition for method 34 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod set-width-of-selected nav-graph ((this nav-graph) (arg0 float)) +(defmethod set-width-of-selected ((this nav-graph) (arg0 float)) (dotimes (s4-0 (-> this node-count)) (let ((s3-0 (-> this node-array s4-0))) (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) @@ -902,7 +902,7 @@ ;; definition for method 37 of type nav-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod offset-pos-of-selected nav-graph ((this nav-graph) (arg0 vector)) +(defmethod offset-pos-of-selected ((this nav-graph) (arg0 vector)) (let ((s4-0 (new 'stack-no-clear 'vector))) (dotimes (s3-0 (-> this node-count)) (let ((a0-2 (-> this node-array s3-0))) @@ -925,7 +925,7 @@ ;; definition for method 38 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-method-38 nav-graph ((this nav-graph)) +(defmethod nav-graph-method-38 ((this nav-graph)) (let ((s5-0 (new 'stack-no-clear 'vehicle-controller)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -952,7 +952,7 @@ ;; definition for method 9 of type nav-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-nodes nav-graph ((this nav-graph)) +(defmethod debug-draw-nodes ((this nav-graph)) (let ((s5-0 (new 'stack-no-clear 'matrix))) (dotimes (s4-0 (-> this node-count)) (let ((s3-0 (-> this node-array s4-0))) @@ -1013,7 +1013,7 @@ ;; definition for method 10 of type nav-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch nav-node vs none. -(defmethod nav-graph-method-10 nav-graph ((this nav-graph) (arg0 vector) (arg1 int)) +(defmethod nav-graph-method-10 ((this nav-graph) (arg0 vector) (arg1 int)) (let* ((gp-0 (the-as nav-node #f)) (f0-0 409600000.0) (f30-0 (* f0-0 f0-0)) @@ -1047,7 +1047,7 @@ ;; definition for method 21 of type nav-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-selected-to-height-map-height nav-graph ((this nav-graph)) +(defmethod move-selected-to-height-map-height ((this nav-graph)) (dotimes (s5-0 (-> this node-count)) (let ((s4-0 (-> this node-array s5-0)) (s3-0 (new 'stack-no-clear 'vector)) @@ -1076,7 +1076,7 @@ ;; definition for method 39 of type nav-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-method-39 nav-graph ((this nav-graph)) +(defmethod nav-graph-method-39 ((this nav-graph)) (local-vars (sv-80 entity-nav-mesh) (sv-96 entity-nav-mesh)) (dotimes (s5-0 (-> this node-count)) (let ((s4-0 (-> this node-array s5-0)) @@ -1130,7 +1130,7 @@ ) ;; definition for method 19 of type nav-graph -(defmethod nav-graph-method-19 nav-graph ((this nav-graph) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) +(defmethod nav-graph-method-19 ((this nav-graph) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) (let ((gp-0 (-> this node-array arg0)) (s0-0 (-> this node-array arg1)) (s4-0 (-> this node-array arg2)) @@ -1152,13 +1152,13 @@ ) ;; definition for method 40 of type nav-graph -(defmethod nav-graph-method-40 nav-graph ((this nav-graph) (arg0 int)) +(defmethod nav-graph-method-40 ((this nav-graph) (arg0 int)) -1 (shr (- arg0 (the-as int (-> this node-array 0))) 5) ) ;; definition for method 20 of type nav-graph -(defmethod nav-graph-method-20 nav-graph ((this nav-graph) (arg0 int) (arg1 int)) +(defmethod nav-graph-method-20 ((this nav-graph) (arg0 int) (arg1 int)) (let ((gp-0 (-> this node-array arg0)) (s5-0 (-> this node-array arg1)) ) @@ -1170,7 +1170,7 @@ ;; definition for method 11 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-method-11 nav-graph ((this nav-graph)) +(defmethod nav-graph-method-11 ((this nav-graph)) (format #t "(define *traffic-nav-graph*~%") (format #t " (new-nav-graph~%") (format #t " :node-list (~%") @@ -1189,7 +1189,7 @@ ;; definition for method 42 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod patch-nodes nav-graph ((this nav-graph)) +(defmethod patch-nodes ((this nav-graph)) "Patch nodes. Node pointers are stored as indices into arrays to be allocated on the level heap and patched at runtime after loading." (when (not (-> this patched)) @@ -1218,7 +1218,7 @@ and patched at runtime after loading." ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 43 nav-graph) has a return type of none, but the expression builder found a return statement. -(defmethod copy-to-mysql-graph nav-graph ((this nav-graph) (arg0 mysql-nav-graph) (arg1 string)) +(defmethod copy-to-mysql-graph ((this nav-graph) (arg0 mysql-nav-graph) (arg1 string)) (set! (-> arg0 node-array length) 0) (set! (-> arg0 edge-array length) 0) (set! (-> arg0 visnode-array length) 0) @@ -1312,7 +1312,7 @@ and patched at runtime after loading." ;; definition for method 44 of type nav-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod from-editor nav-graph ((this nav-graph) (arg0 mysql-nav-graph) (arg1 symbol)) +(defmethod from-editor ((this nav-graph) (arg0 mysql-nav-graph) (arg1 symbol)) (local-vars (v1-4 symbol) (v1-6 symbol) diff --git a/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc b/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc index 07b563cd4ac..5367d35504f 100644 --- a/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc @@ -3,19 +3,15 @@ ;; definition of type searchlight (deftype searchlight (process-drawable) - ((sync sync-eased :inline :offset-assert 200) + ((sync sync-eased :inline) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #xf4 - :flag-assert #x15008000f4 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type searchlight -(defmethod inspect searchlight ((this searchlight)) +(defmethod inspect ((this searchlight)) (when (not this) (set! this this) (goto cfg-4) @@ -82,7 +78,7 @@ ;; definition for method 11 of type searchlight ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! searchlight ((this searchlight) (arg0 entity-actor)) +(defmethod init-from-entity! ((this searchlight) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/city/common/trail-h_REF.gc b/test/decompiler/reference/jak2/levels/city/common/trail-h_REF.gc index 79989168f14..d12f82f05b0 100644 --- a/test/decompiler/reference/jak2/levels/city/common/trail-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/trail-h_REF.gc @@ -3,30 +3,27 @@ ;; definition of type trail-node (deftype trail-node (structure) - ((next-id int16 :offset-assert 0) - (prev-id int16 :offset-assert 2) - (parent-id int16 :offset-assert 4) - (x int16 :offset-assert 6) - (z int16 :offset-assert 8) - (first-conn uint16 :offset-assert 10) - (cost-from-start uint16 :offset-assert 12) - (cost-to-goal uint16 :offset-assert 14) - (flags trail-node-flag :offset-assert 16) - (conn-count uint8 :offset-assert 17) + ((next-id int16) + (prev-id int16) + (parent-id int16) + (x int16) + (z int16) + (first-conn uint16) + (cost-from-start uint16) + (cost-to-goal uint16) + (flags trail-node-flag) + (conn-count uint8) ) :pack-me - :method-count-assert 12 - :size-assert #x12 - :flag-assert #xc00000012 (:methods - (get-dist-score (_type_ vector) uint 9) - (debug-draw (_type_ int) none 10) - (get-position (_type_ vector) vector 11) + (get-dist-score (_type_ vector) uint) + (debug-draw (_type_ int) none) + (get-position (_type_ vector) vector) ) ) ;; definition for method 3 of type trail-node -(defmethod inspect trail-node ((this trail-node)) +(defmethod inspect ((this trail-node)) (when (not this) (set! this this) (goto cfg-4) @@ -48,17 +45,14 @@ ;; definition of type trail-visgroup (deftype trail-visgroup (structure) - ((first-node uint16 :offset-assert 0) - (node-count uint8 :offset-assert 2) - (pad uint8 :offset-assert 3) + ((first-node uint16) + (node-count uint8) + (pad uint8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type trail-visgroup -(defmethod inspect trail-visgroup ((this trail-visgroup)) +(defmethod inspect ((this trail-visgroup)) (when (not this) (set! this this) (goto cfg-4) @@ -73,23 +67,20 @@ ;; definition of type trail-conn (deftype trail-conn (structure) - ((head-id uint16 :offset-assert 0) - (tail-id uint16 :offset-assert 2) - (flags conn-flag :offset-assert 4) - (visgroup-id uint8 :offset-assert 5) - (cost uint16 :offset-assert 6) + ((head-id uint16) + (tail-id uint16) + (flags conn-flag) + (visgroup-id uint8) + (cost uint16) ) :pack-me - :method-count-assert 10 - :size-assert #x8 - :flag-assert #xa00000008 (:methods - (debug-draw (_type_ trail-graph int) none 9) + (debug-draw (_type_ trail-graph int) none) ) ) ;; definition for method 3 of type trail-conn -(defmethod inspect trail-conn ((this trail-conn)) +(defmethod inspect ((this trail-conn)) (when (not this) (set! this this) (goto cfg-4) @@ -106,18 +97,15 @@ ;; definition of type trail-conn-hash-cell (deftype trail-conn-hash-cell (structure) - ((first-conn uint16 :offset-assert 0) - (conn-count uint8 :offset-assert 2) - (pad uint8 :offset-assert 3) + ((first-conn uint16) + (conn-count uint8) + (pad uint8) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type trail-conn-hash-cell -(defmethod inspect trail-conn-hash-cell ((this trail-conn-hash-cell)) +(defmethod inspect ((this trail-conn-hash-cell)) (when (not this) (set! this this) (goto cfg-4) @@ -132,24 +120,21 @@ ;; definition of type trail-conn-search (deftype trail-conn-search (structure) - ((best-conn-id int32 :offset-assert 0) - (best-dist float :offset-assert 4) - (src-pos vector :offset-assert 8) - (conn-pos vector :offset-assert 12) - (debug-cells-searched int32 :offset-assert 16) - (debug-conns-searched int32 :offset-assert 20) - (bounds bounding-box4w :inline :offset-assert 32) - (cell-quads qword 2 :inline :offset-assert 64) - (conn-quads qword 7 :inline :offset-assert 96) - (cell-bits vector16ub 2 :inline :offset 64) + ((best-conn-id int32) + (best-dist float) + (src-pos vector) + (conn-pos vector) + (debug-cells-searched int32) + (debug-conns-searched int32) + (bounds bounding-box4w :inline) + (cell-quads qword 2 :inline) + (conn-quads qword 7 :inline) + (cell-bits vector16ub 2 :inline :overlay-at cell-quads) ) - :method-count-assert 9 - :size-assert #xd0 - :flag-assert #x9000000d0 ) ;; definition for method 3 of type trail-conn-search -(defmethod inspect trail-conn-search ((this trail-conn-search)) +(defmethod inspect ((this trail-conn-search)) (when (not this) (set! this this) (goto cfg-4) @@ -172,18 +157,15 @@ ;; definition of type trail-conn-hash (deftype trail-conn-hash (basic) - ((cell-width meters :offset-assert 4) - (origin vector :inline :offset-assert 16) - (cell (inline-array trail-conn-hash-cell) :offset-assert 32) - (conn-ids (pointer uint16) :offset-assert 36) + ((cell-width meters) + (origin vector :inline) + (cell (inline-array trail-conn-hash-cell)) + (conn-ids (pointer uint16)) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; definition for method 3 of type trail-conn-hash -(defmethod inspect trail-conn-hash ((this trail-conn-hash)) +(defmethod inspect ((this trail-conn-hash)) (when (not this) (set! this this) (goto cfg-4) @@ -199,17 +181,14 @@ ;; definition of type trail-cached-search-info (deftype trail-cached-search-info (structure) - ((goal-conn-id int16 :offset-assert 0) - (orig-goal-pos vector :inline :offset-assert 16) - (conn-goal-pos vector :inline :offset-assert 32) + ((goal-conn-id int16) + (orig-goal-pos vector :inline) + (conn-goal-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type trail-cached-search-info -(defmethod inspect trail-cached-search-info ((this trail-cached-search-info)) +(defmethod inspect ((this trail-cached-search-info)) (when (not this) (set! this this) (goto cfg-4) @@ -224,56 +203,53 @@ ;; definition of type trail-graph (deftype trail-graph (basic) - ((mode uint8 :offset-assert 4) - (search-id uint32 :offset-assert 8) - (open-head-id int16 :offset-assert 12) - (goal-conn-id int16 :offset-assert 14) - (goal-node-id int16 :offset-assert 16) - (node-count uint16 :offset-assert 18) - (conn-count uint16 :offset-assert 20) - (conn-mask uint8 :offset-assert 22) - (node (inline-array trail-node) :offset-assert 24) - (conn (inline-array trail-conn) :offset-assert 28) - (conn-ids (pointer uint16) :offset-assert 32) - (visgroup (inline-array trail-conn-hash-cell) :offset-assert 36) - (visnode-ids (pointer uint16) :offset-assert 40) - (conn-hash trail-conn-hash :offset-assert 44) - (orig-start-pos vector :inline :offset-assert 48) - (orig-goal-pos vector :inline :offset-assert 64) - (conn-start-pos vector :inline :offset-assert 80) - (conn-goal-pos vector :inline :offset-assert 96) - (open-quads qword 6 :inline :offset-assert 112) - (closed-quads qword 6 :inline :offset-assert 208) + ((mode uint8) + (search-id uint32) + (open-head-id int16) + (goal-conn-id int16) + (goal-node-id int16) + (node-count uint16) + (conn-count uint16) + (conn-mask uint8) + (node (inline-array trail-node)) + (conn (inline-array trail-conn)) + (conn-ids (pointer uint16)) + (visgroup (inline-array trail-conn-hash-cell)) + (visnode-ids (pointer uint16)) + (conn-hash trail-conn-hash) + (orig-start-pos vector :inline) + (orig-goal-pos vector :inline) + (conn-start-pos vector :inline) + (conn-goal-pos vector :inline) + (open-quads qword 6 :inline) + (closed-quads qword 6 :inline) ) - :method-count-assert 29 - :size-assert #x130 - :flag-assert #x1d00000130 (:methods - (trail-graph-method-9 (_type_ int) none 9) - (trail-graph-method-10 (_type_ int) none 10) - (trail-graph-method-11 (_type_ int int) trail-node 11) - (debug-draw (_type_) none 12) - (debug-draw-cell (_type_ int) none 13) - (debug-draw-path (_type_ int (pointer uint16) vector vector rgba float) symbol 14) - (do-path (_type_ vector vector) int 15) - (trail-graph-method-16 () none 16) - (get-node-location-by-id (_type_ uint vector) vector 17) - (get-path-to-root (_type_ (pointer uint16) int (pointer int32) (pointer float)) int 18) - (trail-graph-method-19 (_type_ int int) symbol 19) - (try-initialize (_type_) symbol 20) - (update-node-flags-for-conn (_type_ int trail-node-flag trail-node-flag) none 21) - (trail-graph-method-22 (_type_ int) none 22) - (reset-search-state (_type_) none 23) - (get-next-to-explore (_type_) int 24) - (trail-graph-method-25 (_type_ trail-conn-search int int) none 25) - (do-search! (_type_ vector vector trail-cached-search-info) none 26) - (do-some-work (_type_) int 27) - (run-until-done-or-timeout (_type_ int) none 28) + (trail-graph-method-9 (_type_ int) none) + (trail-graph-method-10 (_type_ int) none) + (trail-graph-method-11 (_type_ int int) trail-node) + (debug-draw (_type_) none) + (debug-draw-cell (_type_ int) none) + (debug-draw-path (_type_ int (pointer uint16) vector vector rgba float) symbol) + (do-path (_type_ vector vector) int) + (trail-graph-method-16 () none) + (get-node-location-by-id (_type_ uint vector) vector) + (get-path-to-root (_type_ (pointer uint16) int (pointer int32) (pointer float)) int) + (trail-graph-method-19 (_type_ int int) symbol) + (try-initialize (_type_) symbol) + (update-node-flags-for-conn (_type_ int trail-node-flag trail-node-flag) none) + (trail-graph-method-22 (_type_ int) none) + (reset-search-state (_type_) none) + (get-next-to-explore (_type_) int) + (trail-graph-method-25 (_type_ trail-conn-search int int) none) + (do-search! (_type_ vector vector trail-cached-search-info) none) + (do-some-work (_type_) int) + (run-until-done-or-timeout (_type_ int) none) ) ) ;; definition for method 3 of type trail-graph -(defmethod inspect trail-graph ((this trail-graph)) +(defmethod inspect ((this trail-graph)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/common/trail_REF.gc b/test/decompiler/reference/jak2/levels/city/common/trail_REF.gc index 766aa2e86b4..7a19f69c895 100644 --- a/test/decompiler/reference/jak2/levels/city/common/trail_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/trail_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type trail-conn ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw trail-conn ((this trail-conn) (arg0 trail-graph) (arg1 int)) +(defmethod debug-draw ((this trail-conn) (arg0 trail-graph) (arg1 int)) (let ((a2-3 (-> arg0 node (-> this head-id))) (v1-2 (-> arg0 node (-> this tail-id))) (s4-0 (new 'stack-no-clear 'vector)) @@ -46,7 +46,7 @@ ;; definition for method 10 of type trail-node ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw trail-node ((this trail-node) (arg0 int)) +(defmethod debug-draw ((this trail-node) (arg0 int)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'sphere)) ) @@ -74,7 +74,7 @@ ;; definition for method 13 of type trail-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw-cell trail-graph ((this trail-graph) (arg0 int)) +(defmethod debug-draw-cell ((this trail-graph) (arg0 int)) (local-vars (sv-80 int) (sv-96 (function _varargs_ object))) (let* ((s5-0 (-> this conn-hash)) (s4-0 (-> s5-0 cell arg0)) @@ -145,7 +145,7 @@ ;; definition for method 14 of type trail-graph ;; INFO: Used lq/sq ;; WARN: new jak 2 until loop case, check carefully -(defmethod debug-draw-path trail-graph ((this trail-graph) (arg0 int) (arg1 (pointer uint16)) (arg2 vector) (arg3 vector) (arg4 rgba) (arg5 float)) +(defmethod debug-draw-path ((this trail-graph) (arg0 int) (arg1 (pointer uint16)) (arg2 vector) (arg3 vector) (arg4 rgba) (arg5 float)) (local-vars (sv-48 int)) (let ((s0-0 (new 'stack-no-clear 'inline-array 'vector 2))) (set-vector! (-> s0-0 1) (+ (-> arg2 x) arg5) 53248.0 (+ (-> arg2 z) arg5) 1.0) @@ -182,7 +182,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: new jak 2 until loop case, check carefully -(defmethod debug-draw trail-graph ((this trail-graph)) +(defmethod debug-draw ((this trail-graph)) (when (= (-> this mode) 3) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 2))) (set! (-> s5-0 1 quad) (-> this orig-goal-pos quad)) @@ -254,7 +254,7 @@ ) ;; definition for method 11 of type trail-node -(defmethod get-position trail-node ((this trail-node) (arg0 vector)) +(defmethod get-position ((this trail-node) (arg0 vector)) "Unpack the position to a vector" (let ((v0-0 arg0)) (set! (-> v0-0 x) (* 4096.0 (the float (-> this x)))) @@ -266,13 +266,13 @@ ) ;; definition for method 17 of type trail-graph -(defmethod get-node-location-by-id trail-graph ((this trail-graph) (arg0 uint) (arg1 vector)) +(defmethod get-node-location-by-id ((this trail-graph) (arg0 uint) (arg1 vector)) "Get the location of the node with the given ID" (get-position (-> this node (the-as int arg0)) arg1) ) ;; definition for method 18 of type trail-graph -(defmethod get-path-to-root trail-graph ((this trail-graph) (arg0 (pointer uint16)) (arg1 int) (arg2 (pointer int32)) (arg3 (pointer float))) +(defmethod get-path-to-root ((this trail-graph) (arg0 (pointer uint16)) (arg1 int) (arg2 (pointer int32)) (arg3 (pointer float))) "Get the path from goal to root, following parent-id" (set! (-> arg3 0) 0.0) (set! (-> arg2 0) (-> this goal-node-id)) @@ -323,7 +323,7 @@ ) ;; definition for method 20 of type trail-graph -(defmethod try-initialize trail-graph ((this trail-graph)) +(defmethod try-initialize ((this trail-graph)) "Init and verify that constants are good." (let ((a3-0 (shr (+ (-> this node-count) 127) 7))) (when (!= a3-0 6) @@ -347,7 +347,7 @@ ;; definition for method 23 of type trail-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod reset-search-state trail-graph ((this trail-graph)) +(defmethod reset-search-state ((this trail-graph)) "Reset the search/goal." (when (nonzero? (-> this mode)) (set! (-> this goal-node-id) -1) @@ -384,7 +384,7 @@ ;; definition for method 21 of type trail-graph ;; WARN: Return type mismatch trail-node-flag vs none. -(defmethod update-node-flags-for-conn trail-graph ((this trail-graph) (arg0 int) (arg1 trail-node-flag) (arg2 trail-node-flag)) +(defmethod update-node-flags-for-conn ((this trail-graph) (arg0 int) (arg1 trail-node-flag) (arg2 trail-node-flag)) "Set arg1, clear arg2" (let* ((v1-0 (lognot arg2)) (a3-2 (-> this conn arg0)) @@ -420,7 +420,7 @@ ;; definition for method 25 of type trail-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod trail-graph-method-25 trail-graph ((this trail-graph) (arg0 trail-conn-search) (arg1 int) (arg2 int)) +(defmethod trail-graph-method-25 ((this trail-graph) (arg0 trail-conn-search) (arg1 int) (arg2 int)) (let* ((v1-1 (+ (* arg2 16) arg1)) (a0-1 (/ v1-1 8)) (a1-2 (ash 1 (logand v1-1 7))) @@ -485,7 +485,7 @@ ;; definition for method 15 of type trail-graph ;; INFO: Used lq/sq -(defmethod do-path trail-graph ((this trail-graph) (arg0 vector) (arg1 vector)) +(defmethod do-path ((this trail-graph) (arg0 vector) (arg1 vector)) (let ((v1-0 (-> this conn-hash)) (s5-0 (new 'stack-no-clear 'trail-conn-search)) ) @@ -563,7 +563,7 @@ ;; definition for method 9 of type trail-graph ;; WARN: Return type mismatch int vs none. -(defmethod trail-graph-method-9 trail-graph ((this trail-graph) (arg0 int)) +(defmethod trail-graph-method-9 ((this trail-graph) (arg0 int)) (let ((s4-0 (-> this node arg0))) (set! (-> s4-0 cost-from-start) (get-dist-score s4-0 (-> this orig-start-pos))) (set! (-> s4-0 cost-to-goal) (get-dist-score s4-0 (-> this orig-goal-pos))) @@ -574,7 +574,7 @@ ) ;; definition for method 10 of type trail-graph -(defmethod trail-graph-method-10 trail-graph ((this trail-graph) (arg0 int)) +(defmethod trail-graph-method-10 ((this trail-graph) (arg0 int)) (let* ((s5-0 (-> this conn arg0)) (v1-1 (-> s5-0 visgroup-id)) ) @@ -603,7 +603,7 @@ ;; definition for method 11 of type trail-graph ;; WARN: new jak 2 until loop case, check carefully -(defmethod trail-graph-method-11 trail-graph ((this trail-graph) (arg0 int) (arg1 int)) +(defmethod trail-graph-method-11 ((this trail-graph) (arg0 int) (arg1 int)) (let ((v1-0 (/ arg0 8)) (a3-1 (ash 1 (logand arg0 7))) ) @@ -650,7 +650,7 @@ ;; definition for method 22 of type trail-graph ;; WARN: Return type mismatch int vs none. -(defmethod trail-graph-method-22 trail-graph ((this trail-graph) (arg0 int)) +(defmethod trail-graph-method-22 ((this trail-graph) (arg0 int)) (let ((v1-0 (/ arg0 8)) (a2-1 (ash 1 (logand arg0 7))) ) @@ -680,7 +680,7 @@ ) ;; definition for method 24 of type trail-graph -(defmethod get-next-to-explore trail-graph ((this trail-graph)) +(defmethod get-next-to-explore ((this trail-graph)) (let ((v0-0 (-> this open-head-id))) (when (>= v0-0 0) (let* ((v1-1 (-> this node)) @@ -704,7 +704,7 @@ ;; definition for method 9 of type trail-node ;; WARN: Return type mismatch int vs uint. -(defmethod get-dist-score trail-node ((this trail-node) (arg0 vector)) +(defmethod get-dist-score ((this trail-node) (arg0 vector)) (let* ((f0-1 (- (-> arg0 x) (* 4096.0 (the float (-> this x))))) (f1-3 (- (-> arg0 z) (* 4096.0 (the float (-> this z))))) (f0-4 (sqrtf (+ (* f0-1 f0-1) (* f1-3 f1-3)))) @@ -714,7 +714,7 @@ ) ;; definition for method 27 of type trail-graph -(defmethod do-some-work trail-graph ((this trail-graph)) +(defmethod do-some-work ((this trail-graph)) (let ((s5-0 (get-next-to-explore this))) (if (< s5-0 0) (return 2) @@ -773,7 +773,7 @@ ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod run-until-done-or-timeout trail-graph ((this trail-graph) (arg0 int)) +(defmethod run-until-done-or-timeout ((this trail-graph) (arg0 int)) (local-vars (v1-1 int)) (let ((v0-0 (the-as int (-> this mode)))) 0 @@ -789,20 +789,17 @@ ;; definition of type trail-vis-work (deftype trail-vis-work (structure) - ((best-count uint32 :offset-assert 0) - (best-dist float :offset-assert 4) - (start-conn-id uint32 :offset-assert 8) - (p0 vector :inline :offset-assert 16) - (p1 vector :inline :offset-assert 32) - (best-node-id uint16 64 :offset-assert 48) + ((best-count uint32) + (best-dist float) + (start-conn-id uint32) + (p0 vector :inline) + (p1 vector :inline) + (best-node-id uint16 64) ) - :method-count-assert 9 - :size-assert #xb0 - :flag-assert #x9000000b0 ) ;; definition for method 3 of type trail-vis-work -(defmethod inspect trail-vis-work ((this trail-vis-work)) +(defmethod inspect ((this trail-vis-work)) (when (not this) (set! this this) (goto cfg-4) @@ -820,7 +817,7 @@ ;; definition for method 19 of type trail-graph ;; INFO: Used lq/sq -(defmethod trail-graph-method-19 trail-graph ((this trail-graph) (arg0 int) (arg1 int)) +(defmethod trail-graph-method-19 ((this trail-graph) (arg0 int) (arg1 int)) (local-vars (s4-1 symbol)) (let* ((s4-0 (-> this node)) (v1-2 (-> s4-0 arg1)) @@ -901,7 +898,7 @@ ;; definition for method 26 of type trail-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-search! trail-graph ((this trail-graph) (arg0 vector) (arg1 vector) (arg2 trail-cached-search-info)) +(defmethod do-search! ((this trail-graph) (arg0 vector) (arg1 vector) (arg2 trail-cached-search-info)) (reset-search-state this) (+! (-> this search-id) 1) (set! (-> this orig-start-pos quad) (-> arg0 quad)) diff --git a/test/decompiler/reference/jak2/levels/city/ctyport-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/ctyport-obs_REF.gc index 6bb7f570388..0a8c8f87ead 100644 --- a/test/decompiler/reference/jak2/levels/city/ctyport-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctyport-obs_REF.gc @@ -3,21 +3,19 @@ ;; definition of type boat-manager (deftype boat-manager (process) - ((mesh basic :offset-assert 128) - (paths path-control 4 :offset-assert 132) + ((mesh basic) + (paths path-control 4) ) - :heap-base #x20 - :method-count-assert 16 - :size-assert #x94 - :flag-assert #x1000200094 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (boat-manager-method-15 (_type_) none 15) + (boat-manager-method-15 (_type_) none) ) ) ;; definition for method 3 of type boat-manager -(defmethod inspect boat-manager ((this boat-manager)) +(defmethod inspect ((this boat-manager)) (when (not this) (set! this this) (goto cfg-4) @@ -132,26 +130,22 @@ ;; definition of type boat-base (deftype boat-base (vehicle) - ((angle float :offset-assert 880) - (y-rot float :offset-assert 884) - (path-num uint32 :offset-assert 888) - (path-index float :offset-assert 892) + ((angle float) + (y-rot float) + (path-num uint32) + (path-index float) ) - :heap-base #x300 - :method-count-assert 149 - :size-assert #x380 - :flag-assert #x9503000380 (:methods - (boat-base-method-144 (_type_ nav-control) none 144) - (boat-base-method-145 (_type_ nav-control) none 145) - (boat-base-method-146 (_type_ nav-control) none 146) - (boat-base-method-147 (_type_ nav-control) none 147) - (boat-base-method-148 (_type_ nav-control) none 148) + (boat-base-method-144 (_type_ nav-control) none) + (boat-base-method-145 (_type_ nav-control) none) + (boat-base-method-146 (_type_ nav-control) none) + (boat-base-method-147 (_type_ nav-control) none) + (boat-base-method-148 (_type_ nav-control) none) ) ) ;; definition for method 3 of type boat-base -(defmethod inspect boat-base ((this boat-base)) +(defmethod inspect ((this boat-base)) (when (not this) (set! this this) (goto cfg-4) @@ -170,7 +164,7 @@ ;; definition for method 144 of type boat-base ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod boat-base-method-144 boat-base ((this boat-base) (arg0 nav-control)) +(defmethod boat-base-method-144 ((this boat-base) (arg0 nav-control)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -234,7 +228,7 @@ ;; definition for method 145 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod boat-base-method-145 boat-base ((this boat-base) (arg0 nav-control)) +(defmethod boat-base-method-145 ((this boat-base) (arg0 nav-control)) (navigate-using-route-portals (-> arg0 state)) 0 0 @@ -243,7 +237,7 @@ ;; definition for method 146 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod boat-base-method-146 boat-base ((this boat-base) (arg0 nav-control)) +(defmethod boat-base-method-146 ((this boat-base) (arg0 nav-control)) (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg0 state)) 0 (none) @@ -251,7 +245,7 @@ ;; definition for method 147 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod boat-base-method-147 boat-base ((this boat-base) (arg0 nav-control)) +(defmethod boat-base-method-147 ((this boat-base) (arg0 nav-control)) (update-travel-dir-from-spheres (-> arg0 state)) 0 (none) @@ -259,7 +253,7 @@ ;; definition for method 148 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod boat-base-method-148 boat-base ((this boat-base) (arg0 nav-control)) +(defmethod boat-base-method-148 ((this boat-base) (arg0 nav-control)) (compute-speed-simple (-> arg0 state)) 0 (none) @@ -386,20 +380,20 @@ ;; definition for method 44 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod apply-damage boat-base ((this boat-base) (arg0 float) (arg1 rigid-body-impact)) +(defmethod apply-damage ((this boat-base) (arg0 float) (arg1 rigid-body-impact)) 0 (none) ) ;; definition for method 47 of type boat-base -(defmethod rigid-body-object-method-47 boat-base ((this boat-base) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) +(defmethod rigid-body-object-method-47 ((this boat-base) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) ((method-of-type vehicle rigid-body-object-method-47) this arg0 arg1 arg2 arg3) #f ) ;; definition for method 120 of type boat-base ;; INFO: Used lq/sq -(defmethod vehicle-method-120 boat-base ((this boat-base)) +(defmethod vehicle-method-120 ((this boat-base)) (let ((t9-0 (method-of-type vehicle vehicle-method-120))) (t9-0 this) ) @@ -492,7 +486,7 @@ ;; definition for method 29 of type boat-base ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-29 boat-base ((this boat-base) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this boat-base) (arg0 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -560,21 +554,21 @@ ;; definition for method 96 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-96 boat-base ((this boat-base)) +(defmethod vehicle-method-96 ((this boat-base)) 0 (none) ) ;; definition for method 36 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod do-engine-sounds boat-base ((this boat-base)) +(defmethod do-engine-sounds ((this boat-base)) 0 (none) ) ;; definition for method 135 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-135 boat-base ((this boat-base) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-135 ((this boat-base) (arg0 traffic-object-spawn-params)) (get-nav-control this (-> arg0 nav-mesh)) (set! (-> this nav callback-info) *boat-nav-callback-info*) (logior! (-> this nav flags) (nav-control-flag display-marks limit-rotation-rate update-heading-from-facing)) @@ -615,7 +609,7 @@ ;; definition for method 31 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod alloc-and-init-rigid-body-control boat-base ((this boat-base) (arg0 rigid-body-vehicle-constants)) +(defmethod alloc-and-init-rigid-body-control ((this boat-base) (arg0 rigid-body-vehicle-constants)) ((method-of-type vehicle alloc-and-init-rigid-body-control) this arg0) 0 (none) @@ -623,7 +617,7 @@ ;; definition for method 113 of type boat-base ;; WARN: Return type mismatch object vs none. -(defmethod vehicle-method-113 boat-base ((this boat-base)) +(defmethod vehicle-method-113 ((this boat-base)) (go (method-of-object this idle)) (none) ) @@ -678,17 +672,13 @@ ;; definition of type barge (deftype barge (boat-base) - ((engine sound-id :offset-assert 896) - (bow-wash sound-id :offset-assert 900) + ((engine sound-id) + (bow-wash sound-id) ) - :heap-base #x310 - :method-count-assert 149 - :size-assert #x388 - :flag-assert #x9503100388 ) ;; definition for method 3 of type barge -(defmethod inspect barge ((this barge)) +(defmethod inspect ((this barge)) (when (not this) (set! this this) (goto cfg-4) @@ -704,7 +694,7 @@ ;; definition for method 120 of type barge ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-120 barge ((this barge)) +(defmethod vehicle-method-120 ((this barge)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -772,7 +762,7 @@ ;; definition for method 32 of type barge ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape barge ((this barge)) +(defmethod allocate-and-init-cshape ((this barge)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -894,7 +884,7 @@ ;; definition for method 33 of type barge ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body barge ((this barge)) +(defmethod init-skel-and-rigid-body ((this barge)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-barge" (the-as (pointer uint32) #f))) @@ -959,7 +949,7 @@ ;; definition for method 7 of type boat-manager ;; WARN: Return type mismatch process vs boat-manager. -(defmethod relocate boat-manager ((this boat-manager) (arg0 int)) +(defmethod relocate ((this boat-manager) (arg0 int)) (dotimes (v1-0 4) (if (-> this paths v1-0) (&+! (-> this paths v1-0) arg0) @@ -992,7 +982,7 @@ ;; definition for method 11 of type boat-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! boat-manager ((this boat-manager) (arg0 entity-actor)) +(defmethod init-from-entity! ((this boat-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/city/ctywide-obs-h_REF.gc b/test/decompiler/reference/jak2/levels/city/ctywide-obs-h_REF.gc index 4b7ebfa249a..5493fd08e5c 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-obs-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-obs-h_REF.gc @@ -3,21 +3,18 @@ ;; definition of type city-race-ring-info (deftype city-race-ring-info (structure) - ((pos vector :inline :offset-assert 0) - (angle float :offset 12) - (boost float :offset-assert 16) - (dist float :offset-assert 20) + ((pos vector :inline) + (angle float :overlay-at (-> pos data 3)) + (boost float) + (dist float) ) - :method-count-assert 10 - :size-assert #x18 - :flag-assert #xa00000018 (:methods - (city-race-ring-info-method-9 (_type_ symbol) none 9) + (city-race-ring-info-method-9 (_type_ symbol) none) ) ) ;; definition for method 3 of type city-race-ring-info -(defmethod inspect city-race-ring-info ((this city-race-ring-info)) +(defmethod inspect ((this city-race-ring-info)) (when (not this) (set! this this) (goto cfg-4) @@ -33,16 +30,13 @@ ;; definition of type city-ambush-spot (deftype city-ambush-spot (structure) - ((pos vector :inline :offset-assert 0) - (obj-type uint8 :offset-assert 16) + ((pos vector :inline) + (obj-type uint8) ) - :method-count-assert 9 - :size-assert #x11 - :flag-assert #x900000011 ) ;; definition for method 3 of type city-ambush-spot -(defmethod inspect city-ambush-spot ((this city-ambush-spot)) +(defmethod inspect ((this city-ambush-spot)) (when (not this) (set! this this) (goto cfg-4) @@ -56,19 +50,16 @@ ;; definition of type city-ambush-info (deftype city-ambush-info (structure) - ((count int16 :offset-assert 0) - (array (inline-array city-ambush-spot) :offset-assert 4) + ((count int16) + (array (inline-array city-ambush-spot)) ) - :method-count-assert 10 - :size-assert #x8 - :flag-assert #xa00000008 (:methods - (city-ambush-info-method-9 (_type_ traffic-object-spawn-params) none 9) + (city-ambush-info-method-9 (_type_ traffic-object-spawn-params) none) ) ) ;; definition for method 3 of type city-ambush-info -(defmethod inspect city-ambush-info ((this city-ambush-info)) +(defmethod inspect ((this city-ambush-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc index c2c7e089a7f..8d3416fefee 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc @@ -3,33 +3,31 @@ ;; definition of type security-wall (deftype security-wall (process-drawable) - ((root collide-shape :override) - (pass int32 :offset-assert 200) - (incoming-attack-id uint32 :offset-assert 204) - (next-message-time int64 :offset-assert 208) - (message int32 :offset-assert 216) - (plane plane :inline :offset-assert 224) - (color vector :inline :offset-assert 240) - (target-pos vector :inline :offset-assert 256) - (flash float :offset-assert 272) - (touch-count int32 :offset-assert 276) - (breach symbol :offset-assert 280) + ((root collide-shape :override) + (pass int32) + (incoming-attack-id uint32) + (next-message-time int64) + (message int32) + (plane plane :inline) + (color vector :inline) + (target-pos vector :inline) + (flash float) + (touch-count int32) + (breach symbol) ) - :heap-base #xa0 - :method-count-assert 25 - :size-assert #x11c - :flag-assert #x1900a0011c + (:state-methods + idle-open + idle-close + ) (:methods - (idle-open () _type_ :state 20) - (idle-close () _type_ :state 21) - (security-wall-method-22 (_type_ path-control float) vector 22) - (security-wall-method-23 (_type_) none 23) - (security-wall-method-24 (_type_) none 24) + (security-wall-method-22 (_type_ path-control float) vector) + (security-wall-method-23 (_type_) none) + (security-wall-method-24 (_type_) none) ) ) ;; definition for method 3 of type security-wall -(defmethod inspect security-wall ((this security-wall)) +(defmethod inspect ((this security-wall)) (when (not this) (set! this this) (goto cfg-4) @@ -59,7 +57,7 @@ ;; definition for method 23 of type security-wall ;; WARN: Return type mismatch int vs none. -(defmethod security-wall-method-23 security-wall ((this security-wall)) +(defmethod security-wall-method-23 ((this security-wall)) (when (< (-> this next-message-time) (current-time)) (set! (-> this next-message-time) (the-as int (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) @@ -212,7 +210,7 @@ ;; definition for method 24 of type security-wall ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod security-wall-method-24 security-wall ((this security-wall)) +(defmethod security-wall-method-24 ((this security-wall)) (let ((s4-0 *target*)) (when s4-0 (let* ((f0-0 (vector-vector-distance-squared (-> this root trans) (-> s4-0 control trans))) @@ -468,7 +466,7 @@ ;; definition for method 22 of type security-wall ;; INFO: Used lq/sq -(defmethod security-wall-method-22 security-wall ((this security-wall) (arg0 path-control) (arg1 float)) +(defmethod security-wall-method-22 ((this security-wall) (arg0 path-control) (arg1 float)) (let ((s4-0 (new 'static 'vector)) (s3-0 (new 'static 'vector)) ) @@ -528,7 +526,7 @@ ;; definition for method 11 of type security-wall ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! security-wall ((this security-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this security-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -586,27 +584,25 @@ This commonly includes things such as: ;; definition of type fruit-stand (deftype fruit-stand (process-focusable) - ((incoming-attack-id uint32 :offset-assert 204) - (hack-counter uint32 :offset-assert 208) - (count-sparts uint32 :offset-assert 212) - (first-sparts uint32 :offset-assert 216) - (num-sparts uint32 :offset-assert 220) - (sparts-index uint32 4 :offset-assert 224) - (sparts-pos vector 4 :inline :offset-assert 240) + ((incoming-attack-id uint32) + (hack-counter uint32) + (count-sparts uint32) + (first-sparts uint32) + (num-sparts uint32) + (sparts-index uint32 4) + (sparts-pos vector 4 :inline) ) - :heap-base #xb0 - :method-count-assert 30 - :size-assert #x130 - :flag-assert #x1e00b00130 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (fruit-stand-method-28 (_type_) none 28) - (fruit-stand-method-29 (_type_) none 29) + (fruit-stand-method-28 (_type_) none) + (fruit-stand-method-29 (_type_) none) ) ) ;; definition for method 3 of type fruit-stand -(defmethod inspect fruit-stand ((this fruit-stand)) +(defmethod inspect ((this fruit-stand)) (when (not this) (set! this this) (goto cfg-4) @@ -989,7 +985,7 @@ This commonly includes things such as: ;; definition for method 28 of type fruit-stand ;; WARN: Return type mismatch int vs none. -(defmethod fruit-stand-method-28 fruit-stand ((this fruit-stand)) +(defmethod fruit-stand-method-28 ((this fruit-stand)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1018,7 +1014,7 @@ This commonly includes things such as: ;; definition for method 29 of type fruit-stand ;; WARN: Return type mismatch int vs none. -(defmethod fruit-stand-method-29 fruit-stand ((this fruit-stand)) +(defmethod fruit-stand-method-29 ((this fruit-stand)) (logior! (-> this mask) (process-mask crate)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 185) this)) 0 @@ -1027,7 +1023,7 @@ This commonly includes things such as: ;; definition for method 11 of type fruit-stand ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fruit-stand ((this fruit-stand) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fruit-stand) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1049,14 +1045,10 @@ This commonly includes things such as: ;; definition of type cty-fruit-stand (deftype cty-fruit-stand (fruit-stand) () - :heap-base #xb0 - :method-count-assert 30 - :size-assert #x130 - :flag-assert #x1e00b00130 ) ;; definition for method 3 of type cty-fruit-stand -(defmethod inspect cty-fruit-stand ((this cty-fruit-stand)) +(defmethod inspect ((this cty-fruit-stand)) (when (not this) (set! this this) (goto cfg-4) @@ -1333,40 +1325,38 @@ This commonly includes things such as: ;; definition of type cty-guard-turret (deftype cty-guard-turret (process-focusable) - ((incoming-attack-id uint32 :offset-assert 204) - (jm-turret joint-mod :offset-assert 208) - (jm-gunsL joint-mod :offset-assert 212) - (jm-gunsR joint-mod :offset-assert 216) - (angle-turret degrees :offset-assert 220) - (angle-guns degrees :offset-assert 224) - (last-no-zero int64 :offset-assert 232) - (next-time-shot time-frame :offset-assert 240) - (num-shots uint32 :offset-assert 248) - (focus focus :inline :offset-assert 256) - (id int32 :offset-assert 268) - (destroyed symbol :offset-assert 272) - (button-down? symbol :offset-assert 276) - (hit-points int32 :offset-assert 280) + ((incoming-attack-id uint32) + (jm-turret joint-mod) + (jm-gunsL joint-mod) + (jm-gunsR joint-mod) + (angle-turret degrees) + (angle-guns degrees) + (last-no-zero int64) + (next-time-shot time-frame) + (num-shots uint32) + (focus focus :inline) + (id int32) + (destroyed symbol) + (button-down? symbol) + (hit-points int32) ) - :heap-base #xa0 - :method-count-assert 36 - :size-assert #x11c - :flag-assert #x2400a0011c + (:state-methods + idle + hostile + explode + wait-for-pushing + pushed + ) (:methods - (idle () _type_ :state 27) - (hostile () _type_ :state 28) - (explode () _type_ :state 29) - (wait-for-pushing () _type_ :state 30) - (pushed () _type_ :state 31) - (cty-guard-turret-method-32 (_type_) none 32) - (cty-guard-turret-method-33 (_type_) none 33) - (cty-guard-turret-method-34 (_type_) none 34) - (cty-guard-turret-method-35 (_type_) quaternion 35) + (cty-guard-turret-method-32 (_type_) none) + (cty-guard-turret-method-33 (_type_) none) + (cty-guard-turret-method-34 (_type_) none) + (cty-guard-turret-method-35 (_type_) quaternion) ) ) ;; definition for method 3 of type cty-guard-turret -(defmethod inspect cty-guard-turret ((this cty-guard-turret)) +(defmethod inspect ((this cty-guard-turret)) (when (not this) (set! this this) (goto cfg-4) @@ -1475,7 +1465,7 @@ This commonly includes things such as: ) ;; definition for method 20 of type cty-guard-turret -(defmethod get-trans cty-guard-turret ((this cty-guard-turret) (arg0 int)) +(defmethod get-trans ((this cty-guard-turret) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (let ((v1-0 (-> this root))) (cond @@ -1493,7 +1483,7 @@ This commonly includes things such as: ) ;; definition for method 26 of type cty-guard-turret -(defmethod get-inv-mass cty-guard-turret ((this cty-guard-turret)) +(defmethod get-inv-mass ((this cty-guard-turret)) 0.01 ) @@ -1773,7 +1763,7 @@ This commonly includes things such as: ;; definition for method 34 of type cty-guard-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod cty-guard-turret-method-34 cty-guard-turret ((this cty-guard-turret)) +(defmethod cty-guard-turret-method-34 ((this cty-guard-turret)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1850,7 +1840,7 @@ This commonly includes things such as: ;; definition for method 35 of type cty-guard-turret ;; INFO: Used lq/sq -(defmethod cty-guard-turret-method-35 cty-guard-turret ((this cty-guard-turret)) +(defmethod cty-guard-turret-method-35 ((this cty-guard-turret)) (local-vars (sv-192 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2056,7 +2046,7 @@ This commonly includes things such as: ) ;; definition for method 7 of type cty-guard-turret -(defmethod relocate cty-guard-turret ((this cty-guard-turret) (arg0 int)) +(defmethod relocate ((this cty-guard-turret) (arg0 int)) (if (nonzero? (-> this jm-turret)) (&+! (-> this jm-turret) arg0) ) @@ -2071,7 +2061,7 @@ This commonly includes things such as: ;; definition for method 32 of type cty-guard-turret ;; WARN: Return type mismatch int vs none. -(defmethod cty-guard-turret-method-32 cty-guard-turret ((this cty-guard-turret)) +(defmethod cty-guard-turret-method-32 ((this cty-guard-turret)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2145,7 +2135,7 @@ This commonly includes things such as: ;; definition for method 33 of type cty-guard-turret ;; WARN: Return type mismatch int vs none. -(defmethod cty-guard-turret-method-33 cty-guard-turret ((this cty-guard-turret)) +(defmethod cty-guard-turret-method-33 ((this cty-guard-turret)) (logior! (-> this mask) (process-mask enemy)) 0 (none) @@ -2153,7 +2143,7 @@ This commonly includes things such as: ;; definition for method 11 of type cty-guard-turret ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cty-guard-turret ((this cty-guard-turret) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cty-guard-turret) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2243,26 +2233,24 @@ This commonly includes things such as: ;; definition of type parking-spot (deftype parking-spot (process-drawable) - ((vehicle handle :offset-assert 200) - (spawned symbol :offset-assert 208) - (minimap connection-minimap :offset-assert 212) - (test-sphere sphere :inline :offset-assert 224) + ((vehicle handle) + (spawned symbol) + (minimap connection-minimap) + (test-sphere sphere :inline) ) - :heap-base #x70 - :method-count-assert 25 - :size-assert #xf0 - :flag-assert #x19007000f0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (parking-spot-method-21 (_type_) none 21) - (parking-spot-method-22 (_type_) none 22) - (parking-spot-method-23 (_type_ uint) none 23) - (parking-spot-method-24 (_type_) none 24) + (parking-spot-method-21 (_type_) none) + (parking-spot-method-22 (_type_) none) + (parking-spot-method-23 (_type_ uint) none) + (parking-spot-method-24 (_type_) none) ) ) ;; definition for method 3 of type parking-spot -(defmethod inspect parking-spot ((this parking-spot)) +(defmethod inspect ((this parking-spot)) (when (not this) (set! this this) (goto cfg-4) @@ -2281,7 +2269,7 @@ This commonly includes things such as: ;; definition for method 24 of type parking-spot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod parking-spot-method-24 parking-spot ((this parking-spot)) +(defmethod parking-spot-method-24 ((this parking-spot)) (let ((gp-0 (new 'stack-no-clear 'collide-query-with-2vec))) (set! (-> gp-0 vec quad) (-> this root trans quad)) (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec quad)) @@ -2316,7 +2304,7 @@ This commonly includes things such as: ;; definition for method 21 of type parking-spot ;; WARN: Return type mismatch int vs none. -(defmethod parking-spot-method-21 parking-spot ((this parking-spot)) +(defmethod parking-spot-method-21 ((this parking-spot)) (let ((s5-0 (handle->process (-> this vehicle)))) (cond (s5-0 @@ -2352,7 +2340,7 @@ This commonly includes things such as: ;; definition for method 23 of type parking-spot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod parking-spot-method-23 parking-spot ((this parking-spot) (arg0 uint)) +(defmethod parking-spot-method-23 ((this parking-spot) (arg0 uint)) (let ((v1-0 (new 'stack-no-clear 'inline-array 'collide-query 1))) (let* ((a0-1 (new 'stack-no-clear 'inline-array 'vector 1)) (a1-1 #x813f9) @@ -2394,7 +2382,7 @@ This commonly includes things such as: ;; definition for method 11 of type parking-spot ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! parking-spot ((this parking-spot) (arg0 entity-actor)) +(defmethod init-from-entity! ((this parking-spot) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2461,28 +2449,26 @@ This commonly includes things such as: ;; definition of type propa (deftype propa (process-focusable) - ((sound-id sound-id :offset-assert 204) - (sound-index uint32 :offset-assert 208) - (handle handle :offset-assert 216) - (y-rot float :offset-assert 224) - (hit-points int32 :offset-assert 228) - (incoming-attack-id uint32 :offset-assert 232) + ((sound-id sound-id) + (sound-index uint32) + (handle handle) + (y-rot float) + (hit-points int32) + (incoming-attack-id uint32) ) - :heap-base #x70 - :method-count-assert 32 - :size-assert #xec - :flag-assert #x20007000ec + (:state-methods + idle + broken + ) (:methods - (idle () _type_ :state 27) - (broken () _type_ :state 28) - (propa-method-29 (_type_) none 29) - (propa-method-30 (_type_) none 30) - (propa-method-31 (_type_ vector) none 31) + (propa-method-29 (_type_) none) + (propa-method-30 (_type_) none) + (propa-method-31 (_type_ vector) none) ) ) ;; definition for method 3 of type propa -(defmethod inspect propa ((this propa)) +(defmethod inspect ((this propa)) (when (not this) (set! this this) (goto cfg-4) @@ -2849,7 +2835,7 @@ This commonly includes things such as: ;; definition for method 31 of type propa ;; WARN: Return type mismatch int vs none. -(defmethod propa-method-31 propa ((this propa) (arg0 vector)) +(defmethod propa-method-31 ((this propa) (arg0 vector)) (let ((s5-0 (the-as process-focusable #f))) (let ((f30-0 (the-as float #x7f800000)) (s3-0 (new 'stack-no-clear 'array 'collide-shape 64)) @@ -2903,7 +2889,7 @@ This commonly includes things such as: ;; definition for method 29 of type propa ;; WARN: Return type mismatch int vs none. -(defmethod propa-method-29 propa ((this propa)) +(defmethod propa-method-29 ((this propa)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2943,7 +2929,7 @@ This commonly includes things such as: ;; definition for method 30 of type propa ;; WARN: Return type mismatch int vs none. -(defmethod propa-method-30 propa ((this propa)) +(defmethod propa-method-30 ((this propa)) (logior! (-> this mask) (process-mask crate)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 170) this)) 0 @@ -2952,7 +2938,7 @@ This commonly includes things such as: ;; definition for method 11 of type propa ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! propa ((this propa) (arg0 entity-actor)) +(defmethod init-from-entity! ((this propa) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2980,17 +2966,13 @@ This commonly includes things such as: ;; definition of type baron-statue (deftype baron-statue (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type baron-statue -(defmethod inspect baron-statue ((this baron-statue)) +(defmethod inspect ((this baron-statue)) (when (not this) (set! this this) (goto cfg-4) @@ -3009,7 +2991,7 @@ This commonly includes things such as: ) ;; definition for method 12 of type baron-statue -(defmethod run-logic? baron-statue ((this baron-statue)) +(defmethod run-logic? ((this baron-statue)) #t ) @@ -3021,7 +3003,7 @@ This commonly includes things such as: ;; definition for method 11 of type baron-statue ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! baron-statue ((this baron-statue) (arg0 entity-actor)) +(defmethod init-from-entity! ((this baron-statue) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3046,28 +3028,26 @@ This commonly includes things such as: ;; definition of type burning-bush (deftype burning-bush (process-focusable) - ((task game-task-control :offset-assert 204) - (part-off sparticle-launch-control :offset-assert 208) - (part-alert sparticle-launch-control :offset-assert 212) - (angle degrees :offset-assert 216) - (time float :offset-assert 220) + ((task game-task-control) + (part-off sparticle-launch-control) + (part-alert sparticle-launch-control) + (angle degrees) + (time float) ) - :heap-base #x60 - :method-count-assert 33 - :size-assert #xe0 - :flag-assert #x21006000e0 + (:state-methods + idle + talking + menu + ) (:methods - (idle () _type_ :state 27) - (talking () _type_ :state 28) - (menu () _type_ :state 29) - (burning-bush-method-30 (_type_) none 30) - (burning-bush-method-31 (_type_) none 31) - (burning-bush-method-32 (_type_) object 32) + (burning-bush-method-30 (_type_) none) + (burning-bush-method-31 (_type_) none) + (burning-bush-method-32 (_type_) object) ) ) ;; definition for method 3 of type burning-bush -(defmethod inspect burning-bush ((this burning-bush)) +(defmethod inspect ((this burning-bush)) (when (not this) (set! this this) (goto cfg-4) @@ -3886,7 +3866,7 @@ This commonly includes things such as: ) ;; definition for method 32 of type burning-bush -(defmethod burning-bush-method-32 burning-bush ((this burning-bush)) +(defmethod burning-bush-method-32 ((this burning-bush)) (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) @@ -3902,7 +3882,7 @@ This commonly includes things such as: ;; definition for method 30 of type burning-bush ;; WARN: Return type mismatch int vs none. -(defmethod burning-bush-method-30 burning-bush ((this burning-bush)) +(defmethod burning-bush-method-30 ((this burning-bush)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -3931,7 +3911,7 @@ This commonly includes things such as: ;; definition for method 31 of type burning-bush ;; WARN: Return type mismatch int vs none. -(defmethod burning-bush-method-31 burning-bush ((this burning-bush)) +(defmethod burning-bush-method-31 ((this burning-bush)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 173) this)) (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 171) this)) (set! (-> this part-alert) (create-launch-control (-> *part-group-id-table* 172) this)) @@ -3941,7 +3921,7 @@ This commonly includes things such as: ;; definition for method 7 of type burning-bush ;; WARN: Return type mismatch process-focusable vs burning-bush. -(defmethod relocate burning-bush ((this burning-bush) (arg0 int)) +(defmethod relocate ((this burning-bush) (arg0 int)) (if (nonzero? (-> this task)) (&+! (-> this task) arg0) ) @@ -3955,7 +3935,7 @@ This commonly includes things such as: ) ;; definition for method 12 of type burning-bush -(defmethod run-logic? burning-bush ((this burning-bush)) +(defmethod run-logic? ((this burning-bush)) (or (not (logtest? (-> this mask) (process-mask actor-pause))) (or (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen)) @@ -3971,7 +3951,7 @@ This commonly includes things such as: ;; definition for method 11 of type burning-bush ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! burning-bush ((this burning-bush) (arg0 entity-actor)) +(defmethod init-from-entity! ((this burning-bush) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -4010,22 +3990,18 @@ This commonly includes things such as: ;; definition of type barons-ship-lores (deftype barons-ship-lores (process-drawable) - ((paths path-control 3 :offset-assert 200) - (sync sync-eased :inline :offset-assert 216) - (current-path int32 :offset-assert 260) - (forward-backward symbol :offset-assert 264) + ((paths path-control 3) + (sync sync-eased :inline) + (current-path int32) + (forward-backward symbol) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x10c - :flag-assert #x150090010c - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type barons-ship-lores -(defmethod inspect barons-ship-lores ((this barons-ship-lores)) +(defmethod inspect ((this barons-ship-lores)) (when (not this) (set! this this) (goto cfg-4) @@ -4043,7 +4019,7 @@ This commonly includes things such as: ;; definition for method 11 of type barons-ship-lores ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! barons-ship-lores ((this barons-ship-lores) (arg0 entity-actor)) +(defmethod init-from-entity! ((this barons-ship-lores) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -4093,7 +4069,7 @@ This commonly includes things such as: ) ;; definition for method 7 of type barons-ship-lores -(defmethod relocate barons-ship-lores ((this barons-ship-lores) (arg0 int)) +(defmethod relocate ((this barons-ship-lores) (arg0 int)) (if (nonzero? (-> this paths 0)) (&+! (-> this paths 0) arg0) ) @@ -4174,7 +4150,7 @@ This commonly includes things such as: ;; definition for method 9 of type city-race-ring-info ;; WARN: Return type mismatch int vs none. -(defmethod city-race-ring-info-method-9 city-race-ring-info ((this city-race-ring-info) (arg0 symbol)) +(defmethod city-race-ring-info-method-9 ((this city-race-ring-info) (arg0 symbol)) (format arg0 "(static-race-ring-info~%") (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%" (-> this pos x) (-> this pos y) (-> this pos z)) (let ((f0-3 (-> this pos w))) @@ -4192,7 +4168,7 @@ This commonly includes things such as: ;; definition for method 9 of type city-ambush-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod city-ambush-info-method-9 city-ambush-info ((this city-ambush-info) (arg0 traffic-object-spawn-params)) +(defmethod city-ambush-info-method-9 ((this city-ambush-info) (arg0 traffic-object-spawn-params)) (set! (-> arg0 position quad) (-> this array 0 pos quad)) (set! (-> arg0 nav-mesh) (find-nearest-nav-mesh (-> arg0 position) (the-as float #x7f800000))) (vector-reset! (-> arg0 velocity)) @@ -4216,23 +4192,21 @@ This commonly includes things such as: ;; definition of type lurker-pipe-lid (deftype lurker-pipe-lid (process-focusable) - ((angle degrees :offset-assert 204) - (rot float :offset-assert 208) + ((angle degrees) + (rot float) ) - :heap-base #x60 - :method-count-assert 31 - :size-assert #xd4 - :flag-assert #x1f006000d4 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (lurker-pipe-lid-method-28 (_type_) none 28) - (lurker-pipe-lid-method-29 (_type_) none 29) - (lurker-pipe-lid-method-30 (_type_) none 30) + (lurker-pipe-lid-method-28 (_type_) none) + (lurker-pipe-lid-method-29 (_type_) none) + (lurker-pipe-lid-method-30 (_type_) none) ) ) ;; definition for method 3 of type lurker-pipe-lid -(defmethod inspect lurker-pipe-lid ((this lurker-pipe-lid)) +(defmethod inspect ((this lurker-pipe-lid)) (when (not this) (set! this this) (goto cfg-4) @@ -4281,7 +4255,7 @@ This commonly includes things such as: ;; definition for method 28 of type lurker-pipe-lid ;; WARN: Return type mismatch int vs none. -(defmethod lurker-pipe-lid-method-28 lurker-pipe-lid ((this lurker-pipe-lid)) +(defmethod lurker-pipe-lid-method-28 ((this lurker-pipe-lid)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -4310,7 +4284,7 @@ This commonly includes things such as: ;; definition for method 29 of type lurker-pipe-lid ;; WARN: Return type mismatch int vs none. -(defmethod lurker-pipe-lid-method-29 lurker-pipe-lid ((this lurker-pipe-lid)) +(defmethod lurker-pipe-lid-method-29 ((this lurker-pipe-lid)) (logior! (-> this mask) (process-mask crate)) 0 (none) @@ -4318,7 +4292,7 @@ This commonly includes things such as: ;; definition for method 11 of type lurker-pipe-lid ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! lurker-pipe-lid ((this lurker-pipe-lid) (arg0 entity-actor)) +(defmethod init-from-entity! ((this lurker-pipe-lid) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -4343,20 +4317,18 @@ This commonly includes things such as: ;; definition of type ctyn-lamp (deftype ctyn-lamp (process-focusable) () - :heap-base #x50 - :method-count-assert 31 - :size-assert #xcc - :flag-assert #x1f005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (ctyn-lamp-method-29 (_type_) none 29) - (ctyn-lamp-method-30 (_type_) none 30) + (ctyn-lamp-method-29 (_type_) none) + (ctyn-lamp-method-30 (_type_) none) ) ) ;; definition for method 3 of type ctyn-lamp -(defmethod inspect ctyn-lamp ((this ctyn-lamp)) +(defmethod inspect ((this ctyn-lamp)) (when (not this) (set! this this) (goto cfg-4) @@ -4446,7 +4418,7 @@ This commonly includes things such as: ;; definition for method 29 of type ctyn-lamp ;; WARN: Return type mismatch int vs none. -(defmethod ctyn-lamp-method-29 ctyn-lamp ((this ctyn-lamp)) +(defmethod ctyn-lamp-method-29 ((this ctyn-lamp)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -4493,7 +4465,7 @@ This commonly includes things such as: ;; definition for method 30 of type ctyn-lamp ;; WARN: Return type mismatch int vs none. -(defmethod ctyn-lamp-method-30 ctyn-lamp ((this ctyn-lamp)) +(defmethod ctyn-lamp-method-30 ((this ctyn-lamp)) (logior! (-> this mask) (process-mask crate)) 0 (none) @@ -4501,7 +4473,7 @@ This commonly includes things such as: ;; definition for method 11 of type ctyn-lamp ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ctyn-lamp ((this ctyn-lamp) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ctyn-lamp) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/city/ctywide-part_REF.gc b/test/decompiler/reference/jak2/levels/city/ctywide-part_REF.gc index 940732d342e..ac52d1bbe2d 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctywide-part (deftype ctywide-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctywide-part -(defmethod inspect ctywide-part ((this ctywide-part)) +(defmethod inspect ((this ctywide-part)) (when (not this) (set! this this) (goto cfg-4) @@ -26,14 +22,10 @@ ;; definition of type citywide-part (deftype citywide-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type citywide-part -(defmethod inspect citywide-part ((this citywide-part)) +(defmethod inspect ((this citywide-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/ctywide-tasks_REF.gc b/test/decompiler/reference/jak2/levels/city/ctywide-tasks_REF.gc index 8098587cd26..59c95c89f04 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-tasks_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-tasks_REF.gc @@ -701,19 +701,16 @@ ;; definition of type city-bb-racepoint-info (deftype city-bb-racepoint-info (structure) - ((bike-pos vector :inline :offset-assert 0) - (end-pos vector :inline :offset-assert 16) - (bike-angle float :offset-assert 32) - (map symbol :offset-assert 36) - (time float :offset-assert 40) + ((bike-pos vector :inline) + (end-pos vector :inline) + (bike-angle float) + (map symbol) + (time float) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type city-bb-racepoint-info -(defmethod inspect city-bb-racepoint-info ((this city-bb-racepoint-info)) +(defmethod inspect ((this city-bb-racepoint-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc index cefd3147f79..676c8df4271 100644 --- a/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc @@ -910,27 +910,24 @@ ;; definition of type shaker (deftype shaker (structure) - ((axis vector :inline :offset-assert 0) - (start-time time-frame :offset-assert 16) - (decay-time float :offset-assert 24) - (amplitude float :offset-assert 28) - (freq float :offset-assert 32) - (y-decay-time float :offset-assert 36) - (y-amplitude float :offset-assert 40) - (y-freq float :offset-assert 44) - (shake float :offset-assert 48) - (y-shake float :offset-assert 52) + ((axis vector :inline) + (start-time time-frame) + (decay-time float) + (amplitude float) + (freq float) + (y-decay-time float) + (y-amplitude float) + (y-freq float) + (shake float) + (y-shake float) ) - :method-count-assert 10 - :size-assert #x38 - :flag-assert #xa00000038 (:methods - (shaker-method-9 (_type_) none 9) + (shaker-method-9 (_type_) none) ) ) ;; definition for method 3 of type shaker -(defmethod inspect shaker ((this shaker)) +(defmethod inspect ((this shaker)) (when (not this) (set! this this) (goto cfg-4) @@ -952,7 +949,7 @@ ;; definition for method 9 of type shaker ;; WARN: Return type mismatch float vs none. -(defmethod shaker-method-9 shaker ((this shaker)) +(defmethod shaker-method-9 ((this shaker)) (let ((s5-0 (- (current-time) (-> this start-time)))) (set! (-> this shake) (* (-> this amplitude) (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this decay-time)) @@ -1033,23 +1030,21 @@ ;; definition of type farm-marrow (deftype farm-marrow (process-focusable) - ((shakers shaker 5 :inline :offset-assert 208) - (incoming-attack-id uint32 :offset-assert 528) + ((shakers shaker 5 :inline) + (incoming-attack-id uint32) ) - :heap-base #x1a0 - :method-count-assert 31 - :size-assert #x214 - :flag-assert #x1f01a00214 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-marrow-method-29 (_type_) none 29) - (farm-marrow-method-30 (_type_) none 30) + (farm-marrow-method-29 (_type_) none) + (farm-marrow-method-30 (_type_) none) ) ) ;; definition for method 3 of type farm-marrow -(defmethod inspect farm-marrow ((this farm-marrow)) +(defmethod inspect ((this farm-marrow)) (when (not this) (set! this this) (goto cfg-4) @@ -1256,7 +1251,7 @@ ;; definition for method 29 of type farm-marrow ;; WARN: Return type mismatch int vs none. -(defmethod farm-marrow-method-29 farm-marrow ((this farm-marrow)) +(defmethod farm-marrow-method-29 ((this farm-marrow)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1285,7 +1280,7 @@ ;; definition for method 30 of type farm-marrow ;; WARN: Return type mismatch int vs none. -(defmethod farm-marrow-method-30 farm-marrow ((this farm-marrow)) +(defmethod farm-marrow-method-30 ((this farm-marrow)) (logior! (-> this mask) (process-mask crate)) 0 (none) @@ -1293,7 +1288,7 @@ ;; definition for method 11 of type farm-marrow ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-marrow ((this farm-marrow) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farm-marrow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1350,23 +1345,21 @@ This commonly includes things such as: ;; definition of type farm-beetree (deftype farm-beetree (process-focusable) - ((shakers shaker 2 :inline :offset-assert 208) - (incoming-attack-id uint32 :offset-assert 336) + ((shakers shaker 2 :inline) + (incoming-attack-id uint32) ) - :heap-base #xe0 - :method-count-assert 31 - :size-assert #x154 - :flag-assert #x1f00e00154 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-beetree-method-29 (_type_) none 29) - (farm-beetree-method-30 (_type_) none 30) + (farm-beetree-method-29 (_type_) none) + (farm-beetree-method-30 (_type_) none) ) ) ;; definition for method 3 of type farm-beetree -(defmethod inspect farm-beetree ((this farm-beetree)) +(defmethod inspect ((this farm-beetree)) (when (not this) (set! this this) (goto cfg-4) @@ -1532,7 +1525,7 @@ This commonly includes things such as: ;; definition for method 29 of type farm-beetree ;; WARN: Return type mismatch int vs none. -(defmethod farm-beetree-method-29 farm-beetree ((this farm-beetree)) +(defmethod farm-beetree-method-29 ((this farm-beetree)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1561,7 +1554,7 @@ This commonly includes things such as: ;; definition for method 30 of type farm-beetree ;; WARN: Return type mismatch int vs none. -(defmethod farm-beetree-method-30 farm-beetree ((this farm-beetree)) +(defmethod farm-beetree-method-30 ((this farm-beetree)) (logior! (-> this mask) (process-mask crate)) 0 (none) @@ -1569,7 +1562,7 @@ This commonly includes things such as: ;; definition for method 11 of type farm-beetree ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-beetree ((this farm-beetree) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farm-beetree) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1622,23 +1615,21 @@ This commonly includes things such as: ;; definition of type farm-cabbage (deftype farm-cabbage (process-focusable) - ((shakers shaker 2 :inline :offset-assert 208) - (incoming-attack-id uint32 :offset-assert 336) + ((shakers shaker 2 :inline) + (incoming-attack-id uint32) ) - :heap-base #xe0 - :method-count-assert 31 - :size-assert #x154 - :flag-assert #x1f00e00154 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-cabbage-method-29 (_type_) none 29) - (farm-cabbage-method-30 (_type_) none 30) + (farm-cabbage-method-29 (_type_) none) + (farm-cabbage-method-30 (_type_) none) ) ) ;; definition for method 3 of type farm-cabbage -(defmethod inspect farm-cabbage ((this farm-cabbage)) +(defmethod inspect ((this farm-cabbage)) (when (not this) (set! this this) (goto cfg-4) @@ -1804,7 +1795,7 @@ This commonly includes things such as: ;; definition for method 29 of type farm-cabbage ;; WARN: Return type mismatch int vs none. -(defmethod farm-cabbage-method-29 farm-cabbage ((this farm-cabbage)) +(defmethod farm-cabbage-method-29 ((this farm-cabbage)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1833,7 +1824,7 @@ This commonly includes things such as: ;; definition for method 30 of type farm-cabbage ;; WARN: Return type mismatch int vs none. -(defmethod farm-cabbage-method-30 farm-cabbage ((this farm-cabbage)) +(defmethod farm-cabbage-method-30 ((this farm-cabbage)) (logior! (-> this mask) (process-mask crate)) 0 (none) @@ -1841,7 +1832,7 @@ This commonly includes things such as: ;; definition for method 11 of type farm-cabbage ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-cabbage ((this farm-cabbage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farm-cabbage) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1896,23 +1887,21 @@ This commonly includes things such as: ;; definition of type farm-small-cabbage (deftype farm-small-cabbage (process-focusable) - ((shakers shaker 1 :inline :offset-assert 208) - (incoming-attack-id uint32 :offset-assert 272) + ((shakers shaker 1 :inline) + (incoming-attack-id uint32) ) - :heap-base #xa0 - :method-count-assert 31 - :size-assert #x114 - :flag-assert #x1f00a00114 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-small-cabbage-method-29 (_type_) none 29) - (farm-small-cabbage-method-30 (_type_) none 30) + (farm-small-cabbage-method-29 (_type_) none) + (farm-small-cabbage-method-30 (_type_) none) ) ) ;; definition for method 3 of type farm-small-cabbage -(defmethod inspect farm-small-cabbage ((this farm-small-cabbage)) +(defmethod inspect ((this farm-small-cabbage)) (when (not this) (set! this this) (goto cfg-4) @@ -2063,7 +2052,7 @@ This commonly includes things such as: ;; definition for method 29 of type farm-small-cabbage ;; WARN: Return type mismatch int vs none. -(defmethod farm-small-cabbage-method-29 farm-small-cabbage ((this farm-small-cabbage)) +(defmethod farm-small-cabbage-method-29 ((this farm-small-cabbage)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2092,7 +2081,7 @@ This commonly includes things such as: ;; definition for method 30 of type farm-small-cabbage ;; WARN: Return type mismatch int vs none. -(defmethod farm-small-cabbage-method-30 farm-small-cabbage ((this farm-small-cabbage)) +(defmethod farm-small-cabbage-method-30 ((this farm-small-cabbage)) (logior! (-> this mask) (process-mask crate)) 0 (none) @@ -2100,7 +2089,7 @@ This commonly includes things such as: ;; definition for method 11 of type farm-small-cabbage ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-small-cabbage ((this farm-small-cabbage) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farm-small-cabbage) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2155,23 +2144,21 @@ This commonly includes things such as: ;; definition of type farm-chilirots (deftype farm-chilirots (process-focusable) - ((shakers shaker 4 :inline :offset-assert 208) - (incoming-attack-id uint32 :offset-assert 464) + ((shakers shaker 4 :inline) + (incoming-attack-id uint32) ) - :heap-base #x160 - :method-count-assert 31 - :size-assert #x1d4 - :flag-assert #x1f016001d4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (farm-chilirots-method-29 (_type_) none 29) - (farm-chilirots-method-30 (_type_) none 30) + (farm-chilirots-method-29 (_type_) none) + (farm-chilirots-method-30 (_type_) none) ) ) ;; definition for method 3 of type farm-chilirots -(defmethod inspect farm-chilirots ((this farm-chilirots)) +(defmethod inspect ((this farm-chilirots)) (when (not this) (set! this this) (goto cfg-4) @@ -2366,7 +2353,7 @@ This commonly includes things such as: ;; definition for method 29 of type farm-chilirots ;; WARN: Return type mismatch int vs none. -(defmethod farm-chilirots-method-29 farm-chilirots ((this farm-chilirots)) +(defmethod farm-chilirots-method-29 ((this farm-chilirots)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2395,7 +2382,7 @@ This commonly includes things such as: ;; definition for method 30 of type farm-chilirots ;; WARN: Return type mismatch int vs none. -(defmethod farm-chilirots-method-30 farm-chilirots ((this farm-chilirots)) +(defmethod farm-chilirots-method-30 ((this farm-chilirots)) (logior! (-> this mask) (process-mask crate)) 0 (none) @@ -2403,7 +2390,7 @@ This commonly includes things such as: ;; definition for method 11 of type farm-chilirots ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-chilirots ((this farm-chilirots) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farm-chilirots) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2436,19 +2423,17 @@ This commonly includes things such as: ;; definition of type farm-sprinkler-barrels (deftype farm-sprinkler-barrels (process-focusable) () - :heap-base #x50 - :method-count-assert 30 - :size-assert #xcc - :flag-assert #x1e005000cc + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (farm-sprinkler-barrels-method-28 (_type_) none 28) - (farm-sprinkler-barrels-method-29 (_type_) none 29) + (farm-sprinkler-barrels-method-28 (_type_) none) + (farm-sprinkler-barrels-method-29 (_type_) none) ) ) ;; definition for method 3 of type farm-sprinkler-barrels -(defmethod inspect farm-sprinkler-barrels ((this farm-sprinkler-barrels)) +(defmethod inspect ((this farm-sprinkler-barrels)) (when (not this) (set! this this) (goto cfg-4) @@ -2480,7 +2465,7 @@ This commonly includes things such as: ;; definition for method 28 of type farm-sprinkler-barrels ;; WARN: Return type mismatch int vs none. -(defmethod farm-sprinkler-barrels-method-28 farm-sprinkler-barrels ((this farm-sprinkler-barrels)) +(defmethod farm-sprinkler-barrels-method-28 ((this farm-sprinkler-barrels)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2522,7 +2507,7 @@ This commonly includes things such as: ;; definition for method 29 of type farm-sprinkler-barrels ;; WARN: Return type mismatch int vs none. -(defmethod farm-sprinkler-barrels-method-29 farm-sprinkler-barrels ((this farm-sprinkler-barrels)) +(defmethod farm-sprinkler-barrels-method-29 ((this farm-sprinkler-barrels)) (logior! (-> this mask) (process-mask crate)) 0 (none) @@ -2530,7 +2515,7 @@ This commonly includes things such as: ;; definition for method 11 of type farm-sprinkler-barrels ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-sprinkler-barrels ((this farm-sprinkler-barrels) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farm-sprinkler-barrels) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/city/farm/ctyfarma-part_REF.gc b/test/decompiler/reference/jak2/levels/city/farm/ctyfarma-part_REF.gc index 74f1c9761e7..e1c75ea7543 100644 --- a/test/decompiler/reference/jak2/levels/city/farm/ctyfarma-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/farm/ctyfarma-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctyfarma-part (deftype ctyfarma-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctyfarma-part -(defmethod inspect ctyfarma-part ((this ctyfarma-part)) +(defmethod inspect ((this ctyfarma-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/farm/ctyfarmb-part_REF.gc b/test/decompiler/reference/jak2/levels/city/farm/ctyfarmb-part_REF.gc index 565e0b12857..0162042a791 100644 --- a/test/decompiler/reference/jak2/levels/city/farm/ctyfarmb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/farm/ctyfarmb-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctyfarmb-part (deftype ctyfarmb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctyfarmb-part -(defmethod inspect ctyfarmb-part ((this ctyfarmb-part)) +(defmethod inspect ((this ctyfarmb-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/farm/yakow_REF.gc b/test/decompiler/reference/jak2/levels/city/farm/yakow_REF.gc index 9dc36e95823..93e89f8d39e 100644 --- a/test/decompiler/reference/jak2/levels/city/farm/yakow_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/farm/yakow_REF.gc @@ -9,20 +9,16 @@ ;; definition of type yakow (deftype yakow (nav-enemy) - ((incoming-attack-id uint32 :offset-assert 604) - (grazing basic :offset-assert 608) + ((incoming-attack-id uint32) + (grazing basic) ) - :heap-base #x1f0 - :method-count-assert 179 - :size-assert #x264 - :flag-assert #xb301f00264 - (:methods - (kicked () _type_ :state 178) + (:state-methods + kicked ) ) ;; definition for method 3 of type yakow -(defmethod inspect yakow ((this yakow)) +(defmethod inspect ((this yakow)) (when (not this) (set! this this) (goto cfg-4) @@ -215,13 +211,13 @@ (set! (-> *yakow-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 56 of type yakow -(defmethod damage-amount-from-attack yakow ((this yakow) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this yakow) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) ;; definition for method 74 of type yakow -(defmethod general-event-handler yakow ((this yakow) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this yakow) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -240,7 +236,7 @@ ) ;; definition for method 123 of type yakow -(defmethod enemy-method-123 yakow ((this yakow) (arg0 float)) +(defmethod enemy-method-123 ((this yakow) (arg0 float)) "TODO" (>= arg0 (rand-vu)) ) @@ -249,7 +245,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 156 yakow) has a return type of none, but the expression builder found a return statement. -(defmethod nav-enemy-method-156 yakow ((this yakow)) +(defmethod nav-enemy-method-156 ((this yakow)) (dotimes (s5-0 16) (let ((f30-1 (* 4096.0 (get-rand-float-range this -10.0 10.0))) (f0-2 (* 4096.0 (get-rand-float-range this -10.0 10.0))) @@ -438,7 +434,7 @@ ;; definition for method 114 of type yakow ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! yakow ((this yakow)) +(defmethod init-enemy-collision! ((this yakow)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -486,7 +482,7 @@ ;; definition for method 115 of type yakow ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! yakow ((this yakow)) +(defmethod init-enemy! ((this yakow)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/city/generic/ctygena-part_REF.gc b/test/decompiler/reference/jak2/levels/city/generic/ctygena-part_REF.gc index f1c326fbf57..c7a7c49d9a1 100644 --- a/test/decompiler/reference/jak2/levels/city/generic/ctygena-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/generic/ctygena-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctygena-part (deftype ctygena-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctygena-part -(defmethod inspect ctygena-part ((this ctygena-part)) +(defmethod inspect ((this ctygena-part)) (when (not this) (set! this this) (goto cfg-4) @@ -26,14 +22,10 @@ ;; definition of type citytest-part (deftype citytest-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type citytest-part -(defmethod inspect citytest-part ((this citytest-part)) +(defmethod inspect ((this citytest-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/generic/ctygenb-part_REF.gc b/test/decompiler/reference/jak2/levels/city/generic/ctygenb-part_REF.gc index 949a12eea74..17aa85c5150 100644 --- a/test/decompiler/reference/jak2/levels/city/generic/ctygenb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/generic/ctygenb-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctygenb-part (deftype ctygenb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctygenb-part -(defmethod inspect ctygenb-part ((this ctygenb-part)) +(defmethod inspect ((this ctygenb-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/generic/ctygenc-part_REF.gc b/test/decompiler/reference/jak2/levels/city/generic/ctygenc-part_REF.gc index b76bc969a07..07333ec45fe 100644 --- a/test/decompiler/reference/jak2/levels/city/generic/ctygenc-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/generic/ctygenc-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctygenc-part (deftype ctygenc-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctygenc-part -(defmethod inspect ctygenc-part ((this ctygenc-part)) +(defmethod inspect ((this ctygenc-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/generic/neon-praxis-part_REF.gc b/test/decompiler/reference/jak2/levels/city/generic/neon-praxis-part_REF.gc index 255d19a7a9c..bc9244f8431 100644 --- a/test/decompiler/reference/jak2/levels/city/generic/neon-praxis-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/generic/neon-praxis-part_REF.gc @@ -1058,27 +1058,25 @@ ;; definition of type city-neon-praxis (deftype city-neon-praxis (process-drawable) - ((rot vector :inline :offset-assert 208) - (master-enable uint32 :offset-assert 224) - (unknown-k1jn23j1n23 uint32 3 :offset-assert 228) - (praxis-mode uint32 :offset-assert 240) - (back-mode uint32 :offset-assert 244) - (praxis-counter int32 :offset-assert 248) - (back-counter int32 :offset-assert 252) - (parts sparticle-launch-control 2 :offset-assert 256) + ((rot vector :inline) + (master-enable uint32) + (unknown-k1jn23j1n23 uint32 3) + (praxis-mode uint32) + (back-mode uint32) + (praxis-counter int32) + (back-counter int32) + (parts sparticle-launch-control 2) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x108 - :flag-assert #x1600900108 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (city-neon-praxis-method-21 (_type_) none 21) + (city-neon-praxis-method-21 (_type_) none) ) ) ;; definition for method 3 of type city-neon-praxis -(defmethod inspect city-neon-praxis ((this city-neon-praxis)) +(defmethod inspect ((this city-neon-praxis)) (when (not this) (set! this this) (goto cfg-4) @@ -1099,7 +1097,7 @@ ) ;; definition for method 10 of type city-neon-praxis -(defmethod deactivate city-neon-praxis ((this city-neon-praxis)) +(defmethod deactivate ((this city-neon-praxis)) (dotimes (s5-0 2) (let ((a0-1 (-> this parts s5-0))) (if (nonzero? a0-1) @@ -1113,7 +1111,7 @@ ;; definition for method 7 of type city-neon-praxis ;; WARN: Return type mismatch process-drawable vs city-neon-praxis. -(defmethod relocate city-neon-praxis ((this city-neon-praxis) (arg0 int)) +(defmethod relocate ((this city-neon-praxis) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this parts v1-0)) (&+! (-> this parts v1-0) arg0) @@ -1124,7 +1122,7 @@ ;; definition for method 21 of type city-neon-praxis ;; WARN: Return type mismatch symbol vs none. -(defmethod city-neon-praxis-method-21 city-neon-praxis ((this city-neon-praxis)) +(defmethod city-neon-praxis-method-21 ((this city-neon-praxis)) (+! (-> this parts 1 state-counter) 1) (when (!= (-> this parts 1 state-mode 0) (-> this praxis-mode)) (set! (-> this parts 1 state-mode 0) (-> this praxis-mode)) @@ -1209,7 +1207,7 @@ ;; definition for method 11 of type city-neon-praxis ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! city-neon-praxis ((this city-neon-praxis) (arg0 entity-actor)) +(defmethod init-from-entity! ((this city-neon-praxis) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/city/industrial/ctyinda-part_REF.gc b/test/decompiler/reference/jak2/levels/city/industrial/ctyinda-part_REF.gc index a3895da405c..bf96705622f 100644 --- a/test/decompiler/reference/jak2/levels/city/industrial/ctyinda-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/industrial/ctyinda-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctyinda-part (deftype ctyinda-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctyinda-part -(defmethod inspect ctyinda-part ((this ctyinda-part)) +(defmethod inspect ((this ctyinda-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/industrial/ctyindb-part_REF.gc b/test/decompiler/reference/jak2/levels/city/industrial/ctyindb-part_REF.gc index 6594e2f3037..10610a09a22 100644 --- a/test/decompiler/reference/jak2/levels/city/industrial/ctyindb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/industrial/ctyindb-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctyindb-part (deftype ctyindb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctyindb-part -(defmethod inspect ctyindb-part ((this ctyindb-part)) +(defmethod inspect ((this ctyindb-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-h_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-h_REF.gc index fc2847ed8bd..e252e3d9e6c 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-h_REF.gc @@ -3,37 +3,35 @@ ;; definition of type crocadog-escort (deftype crocadog-escort (bot) - ((travel-anim-interp float :offset-assert 992) - (anim-speed float :offset-assert 996) - (kid-handle handle :offset-assert 1000) - (pad-ki1jn23ikuj1n2 uint32 4 :offset-assert 1008) - (local-seat-pos vector :inline :offset-assert 1024) - (exit-vehicle-dest vector :inline :offset 368) + ((travel-anim-interp float) + (anim-speed float) + (kid-handle handle) + (pad-ki1jn23ikuj1n2 uint32 4) + (local-seat-pos vector :inline) + (exit-vehicle-dest vector :inline :overlay-at event-param-point) ) - :heap-base #x390 - :method-count-assert 239 - :size-assert #x410 - :flag-assert #xef03900410 + (:state-methods + traveling + traveling-blocked + waiting-idle + waiting-turn + move-to-vehicle + board-vehicle + ride-vehicle + exit-vehicle + knocked-off-vehicle + ) (:methods - (traveling () _type_ :state 225) - (traveling-blocked () _type_ :state 226) - (waiting-idle () _type_ :state 227) - (waiting-turn () _type_ :state 228) - (move-to-vehicle () _type_ :state 229) - (board-vehicle () _type_ :state 230) - (ride-vehicle () _type_ :state 231) - (exit-vehicle () _type_ :state 232) - (knocked-off-vehicle () _type_ :state 233) - (want-exit-vehicle? (_type_ vector) symbol 234) - (go-idle-or-move (_type_) none 235) - (go-waiting-turn (_type_) none 236) - (check-vehicle-exit (_type_) none 237) - (play-walk-anim (_type_) none 238) + (want-exit-vehicle? (_type_ vector) symbol) + (go-idle-or-move (_type_) none) + (go-waiting-turn (_type_) none) + (check-vehicle-exit (_type_) none) + (play-walk-anim (_type_) none) ) ) ;; definition for method 3 of type crocadog-escort -(defmethod inspect crocadog-escort ((this crocadog-escort)) +(defmethod inspect ((this crocadog-escort)) (when (not this) (set! this this) (goto cfg-4) @@ -61,18 +59,15 @@ ;; definition of type crocesct-wait-spot (deftype crocesct-wait-spot (ai-task) - ((check-done (function crocesct-wait-spot crocadog-escort symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function crocesct-wait-spot crocadog-escort symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type crocesct-wait-spot -(defmethod inspect crocesct-wait-spot ((this crocesct-wait-spot)) +(defmethod inspect ((this crocesct-wait-spot)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-task_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-task_REF.gc index 3ea25b54977..584987deaa1 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-task_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type crocesct-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! crocesct-wait-spot ((this crocesct-wait-spot)) +(defmethod reset-task! ((this crocesct-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -13,7 +13,7 @@ ;; definition for method 11 of type crocesct-wait-spot ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 crocesct-wait-spot ((this crocesct-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this crocesct-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc_REF.gc index 1a76b7adac6..35bd122cb87 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc_REF.gc @@ -177,7 +177,7 @@ (set! (-> *crocadog-escort-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type crocadog-escort -(defmethod general-event-handler crocadog-escort ((this crocadog-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this crocadog-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -196,7 +196,7 @@ ) ;; definition for method 59 of type crocadog-escort -(defmethod get-penetrate-info crocadog-escort ((this crocadog-escort)) +(defmethod get-penetrate-info ((this crocadog-escort)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (let ((v1-1 ((method-of-type bot get-penetrate-info) this))) @@ -205,7 +205,7 @@ ) ;; definition for method 193 of type crocadog-escort -(defmethod bot-method-193 crocadog-escort ((this crocadog-escort)) +(defmethod bot-method-193 ((this crocadog-escort)) (let* ((t9-0 (method-of-type bot bot-method-193)) (v0-0 (t9-0 this)) ) @@ -217,7 +217,7 @@ ) ;; definition for method 79 of type crocadog-escort -(defmethod enemy-method-79 crocadog-escort ((this crocadog-escort) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this crocadog-escort) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (gp-0 symbol)) (case arg0 ((3) @@ -242,7 +242,7 @@ ;; definition for method 234 of type crocadog-escort ;; INFO: Used lq/sq -(defmethod want-exit-vehicle? crocadog-escort ((this crocadog-escort) (arg0 vector)) +(defmethod want-exit-vehicle? ((this crocadog-escort) (arg0 vector)) (let ((s3-0 (handle->process (-> this vehicle-handle)))) (if (or (not s3-0) (not (-> this nav))) (return #f) @@ -274,14 +274,14 @@ ) ;; definition for method 12 of type crocadog-escort -(defmethod run-logic? crocadog-escort ((this crocadog-escort)) +(defmethod run-logic? ((this crocadog-escort)) (or (not (logtest? (process-mask enemy) (-> *setting-control* user-current process-mask))) (logtest? (-> this bot-flags) (bot-flags bf09)) ) ) ;; definition for method 97 of type crocadog-escort -(defmethod enemy-method-97 crocadog-escort ((this crocadog-escort)) +(defmethod enemy-method-97 ((this crocadog-escort)) (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -357,7 +357,7 @@ ;; definition for method 183 of type crocadog-escort ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? crocadog-escort ((this crocadog-escort)) +(defmethod alive? ((this crocadog-escort)) (let ((t9-0 (method-of-type bot alive?))) (the-as symbol (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'waiting-idle) (= v1-3 'waiting-turn)) @@ -368,7 +368,7 @@ ) ;; definition for method 11 of type crocadog-escort -(defmethod init-from-entity! crocadog-escort ((this crocadog-escort) (arg0 entity-actor)) +(defmethod init-from-entity! ((this crocadog-escort) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -382,7 +382,7 @@ This commonly includes things such as: ;; definition for method 114 of type crocadog-escort ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! crocadog-escort ((this crocadog-escort)) +(defmethod init-enemy-collision! ((this crocadog-escort)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -441,7 +441,7 @@ This commonly includes things such as: ;; definition for method 210 of type crocadog-escort ;; WARN: Return type mismatch int vs none. -(defmethod init! crocadog-escort ((this crocadog-escort)) +(defmethod init! ((this crocadog-escort)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) (t9-0 this) @@ -463,7 +463,7 @@ This commonly includes things such as: ;; definition for method 115 of type crocadog-escort ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! crocadog-escort ((this crocadog-escort)) +(defmethod init-enemy! ((this crocadog-escort)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (initialize-skeleton @@ -493,14 +493,14 @@ This commonly includes things such as: ) ;; definition for method 214 of type crocadog-escort -(defmethod bot-method-214 crocadog-escort ((this crocadog-escort)) +(defmethod bot-method-214 ((this crocadog-escort)) #f ) ;; definition for method 237 of type crocadog-escort ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod check-vehicle-exit crocadog-escort ((this crocadog-escort)) +(defmethod check-vehicle-exit ((this crocadog-escort)) (local-vars (v1-22 enemy-flag)) (when (focus-test? this pilot) (let ((v1-4 (handle->process (-> this vehicle-handle)))) @@ -544,7 +544,7 @@ This commonly includes things such as: ) ;; definition for method 70 of type crocadog-escort -(defmethod go-hostile crocadog-escort ((this crocadog-escort)) +(defmethod go-hostile ((this crocadog-escort)) (cond ((logtest? (bot-flags bf17) (-> this bot-flags)) (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) @@ -565,21 +565,21 @@ This commonly includes things such as: ;; definition for method 72 of type crocadog-escort ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus crocadog-escort ((this crocadog-escort)) +(defmethod react-to-focus ((this crocadog-escort)) "@TODO - flesh out docs" (go-idle-or-move this) ) ;; definition for method 236 of type crocadog-escort ;; WARN: Return type mismatch object vs none. -(defmethod go-waiting-turn crocadog-escort ((this crocadog-escort)) +(defmethod go-waiting-turn ((this crocadog-escort)) (go (method-of-object this waiting-turn)) (none) ) ;; definition for method 235 of type crocadog-escort ;; WARN: Return type mismatch object vs none. -(defmethod go-idle-or-move crocadog-escort ((this crocadog-escort)) +(defmethod go-idle-or-move ((this crocadog-escort)) (if (logtest? (-> this bot-flags) (bot-flags bf15)) (go (method-of-object this move-to-vehicle)) (go (method-of-object this waiting-idle)) @@ -589,7 +589,7 @@ This commonly includes things such as: ;; definition for method 238 of type crocadog-escort ;; WARN: Return type mismatch int vs none. -(defmethod play-walk-anim crocadog-escort ((this crocadog-escort)) +(defmethod play-walk-anim ((this crocadog-escort)) (with-pp (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 9011.2 28672.0))) @@ -647,18 +647,18 @@ This commonly includes things such as: ) ;; definition for method 56 of type crocadog-escort -(defmethod damage-amount-from-attack crocadog-escort ((this crocadog-escort) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this crocadog-escort) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) ;; definition for method 190 of type crocadog-escort -(defmethod bot-method-190 crocadog-escort ((this crocadog-escort)) +(defmethod bot-method-190 ((this crocadog-escort)) #t ) ;; definition for method 78 of type crocadog-escort -(defmethod enemy-method-78 crocadog-escort ((this crocadog-escort) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this crocadog-escort) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -674,7 +674,7 @@ This commonly includes things such as: ;; definition for method 116 of type crocadog-escort ;; WARN: Return type mismatch object vs none. -(defmethod go-idle crocadog-escort ((this crocadog-escort)) +(defmethod go-idle ((this crocadog-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) (cleanup-for-death this) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/hal4-course_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/hal4-course_REF.gc index 4455e5c87d6..e70db9386f2 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/hal4-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/hal4-course_REF.gc @@ -3,15 +3,12 @@ ;; definition of type hal4-course (deftype hal4-course (bot-course) - ((defend-speeches bot-speech-list-shuffle :offset-assert 48) + ((defend-speeches bot-speech-list-shuffle) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type hal4-course -(defmethod inspect hal4-course ((this hal4-course)) +(defmethod inspect ((this hal4-course)) (when (not this) (set! this this) (goto cfg-4) @@ -37,36 +34,32 @@ ;; definition of type hal-escort (deftype hal-escort (hal) - ((hal4-course hal4-course :offset 652) - (arrow-handle handle :offset 1032) - (arrestor-handle handle :offset-assert 1040) - (arrestor-time time-frame :offset-assert 1048) - (locked-player-time time-frame :offset-assert 1056) - (dont-fail-until time-frame :offset-assert 1064) - (played-defend-time time-frame :offset-assert 1072) - (played-get-in-time time-frame :offset-assert 1080) - (notice-plane plane :inline :offset-assert 1088) + ((hal4-course hal4-course :overlay-at course) + (arrow-handle handle :offset 1032) + (arrestor-handle handle) + (arrestor-time time-frame) + (locked-player-time time-frame) + (dont-fail-until time-frame) + (played-defend-time time-frame) + (played-get-in-time time-frame) + (notice-plane plane :inline) ) - :heap-base #x3d0 - :method-count-assert 237 - :size-assert #x450 - :flag-assert #xed03d00450 (:methods - (hal-escort-method-227 (_type_) symbol 227) - (hal-escort-method-228 (_type_) symbol 228) - (try-enter-vehicle (_type_) int 229) - (hal-escort-method-230 (_type_) symbol 230) - (init-traffic-params! (_type_ symbol) none 231) - (hal-escort-method-232 (_type_) none 232) - (set-traffic-danger! (_type_) none 233) - (hal-escort-method-234 (_type_ nav-mesh) process 234) - (hal-escort-method-235 (_type_) none 235) - (vehicle-destroyed? (_type_) symbol 236) + (hal-escort-method-227 (_type_) symbol) + (hal-escort-method-228 (_type_) symbol) + (try-enter-vehicle (_type_) int) + (hal-escort-method-230 (_type_) symbol) + (init-traffic-params! (_type_ symbol) none) + (hal-escort-method-232 (_type_) none) + (set-traffic-danger! (_type_) none) + (hal-escort-method-234 (_type_ nav-mesh) process) + (hal-escort-method-235 (_type_) none) + (vehicle-destroyed? (_type_) symbol) ) ) ;; definition for method 3 of type hal-escort -(defmethod inspect hal-escort ((this hal-escort)) +(defmethod inspect ((this hal-escort)) (when (not this) (set! this this) (goto cfg-4) @@ -89,7 +82,7 @@ ;; definition for method 116 of type hal-escort ;; WARN: Return type mismatch object vs none. -(defmethod go-idle hal-escort ((this hal-escort)) +(defmethod go-idle ((this hal-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) (cleanup-for-death this) @@ -104,7 +97,7 @@ ;; definition for method 210 of type hal-escort ;; WARN: Return type mismatch int vs none. -(defmethod init! hal-escort ((this hal-escort)) +(defmethod init! ((this hal-escort)) "Set defaults for various fields." (let ((t9-0 (method-of-type hal init!))) (t9-0 this) @@ -122,7 +115,7 @@ ) ;; definition for method 74 of type hal-escort -(defmethod general-event-handler hal-escort ((this hal-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this hal-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -148,7 +141,7 @@ ;; definition for method 115 of type hal-escort ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! hal-escort ((this hal-escort)) +(defmethod init-enemy! ((this hal-escort)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type hal init-enemy!))) (t9-0 this) @@ -159,7 +152,7 @@ ) ;; definition for method 235 of type hal-escort -(defmethod hal-escort-method-235 hal-escort ((this hal-escort)) +(defmethod hal-escort-method-235 ((this hal-escort)) (let* ((s5-0 (handle->process (-> this arrestor-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 @@ -203,14 +196,14 @@ ) ;; definition for method 236 of type hal-escort -(defmethod vehicle-destroyed? hal-escort ((this hal-escort)) +(defmethod vehicle-destroyed? ((this hal-escort)) (let ((v1-1 (handle->process (-> this vehicle-handle)))) (or (not v1-1) (logtest? (-> (the-as vehicle v1-1) flags) (rigid-body-object-flag dead))) ) ) ;; definition for method 227 of type hal-escort -(defmethod hal-escort-method-227 hal-escort ((this hal-escort)) +(defmethod hal-escort-method-227 ((this hal-escort)) (let ((s5-0 *target*)) (when (focus-test? s5-0 pilot-riding pilot) (let* ((a0-2 (-> this actor-group 0 data 1 actor)) @@ -252,7 +245,7 @@ ;; definition for method 228 of type hal-escort ;; WARN: Return type mismatch object vs symbol. -(defmethod hal-escort-method-228 hal-escort ((this hal-escort)) +(defmethod hal-escort-method-228 ((this hal-escort)) (let* ((v1-3 (-> this actor-group 0 data 1 actor)) (a0-1 (when v1-3 (let ((s5-0 (-> v1-3 extra process))) @@ -283,7 +276,7 @@ ;; definition for method 234 of type hal-escort ;; INFO: Used lq/sq -(defmethod hal-escort-method-234 hal-escort ((this hal-escort) (arg0 nav-mesh)) +(defmethod hal-escort-method-234 ((this hal-escort) (arg0 nav-mesh)) (let ((s2-0 (the-as process #f))) (let* ((v1-3 (-> this actor-group 0 data 1 actor)) (gp-0 (when v1-3 @@ -352,7 +345,7 @@ ) ;; definition for method 229 of type hal-escort -(defmethod try-enter-vehicle hal-escort ((this hal-escort)) +(defmethod try-enter-vehicle ((this hal-escort)) "Returns seat index" (let* ((gp-0 (handle->process (-> this vehicle-handle))) (v1-6 (-> this actor-group 0 data 1 actor)) @@ -385,7 +378,7 @@ ;; definition for method 232 of type hal-escort ;; WARN: Return type mismatch int vs none. -(defmethod hal-escort-method-232 hal-escort ((this hal-escort)) +(defmethod hal-escort-method-232 ((this hal-escort)) (let* ((target *target*) (v1-3 (-> this actor-group 0 data 1 actor)) (s5-0 (when v1-3 @@ -443,7 +436,7 @@ ;; definition for method 231 of type hal-escort ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-traffic-params! hal-escort ((this hal-escort) (arg0 symbol)) +(defmethod init-traffic-params! ((this hal-escort) (arg0 symbol)) (let ((gp-0 *traffic-manager*)) (send-event gp-0 'deactivate-all) (send-event gp-0 'set-guard-multi-focus #t) @@ -482,7 +475,7 @@ ;; definition for method 233 of type hal-escort ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-traffic-danger! hal-escort ((this hal-escort)) +(defmethod set-traffic-danger! ((this hal-escort)) (let ((a0-1 *target*)) (when a0-1 (let ((gp-0 (new 'stack-no-clear 'traffic-danger-info))) @@ -504,7 +497,7 @@ ;; definition for method 230 of type hal-escort ;; INFO: Used lq/sq -(defmethod hal-escort-method-230 hal-escort ((this hal-escort)) +(defmethod hal-escort-method-230 ((this hal-escort)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -633,7 +626,7 @@ ) ;; definition for method 204 of type hal-escort -(defmethod play-too-far-warn-speech hal-escort ((this hal-escort)) +(defmethod play-too-far-warn-speech ((this hal-escort)) (when (not (channel-active? this (the-as uint 0))) (let ((s5-0 0)) (let* ((v1-5 (-> this actor-group 0 data 1 actor)) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-h_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-h_REF.gc index e24409f97e4..ea383e8a440 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-h_REF.gc @@ -3,37 +3,35 @@ ;; definition of type kid-escort (deftype kid-escort (bot) - ((travel-anim-interp float :offset-assert 992) - (arrest-attempt-time time-frame :offset-assert 1000) - (arrestor-handle handle :offset-assert 1008) - (crocadog-handle handle :offset-assert 1016) - (exit-vehicle-dest vector :inline :offset 368) + ((travel-anim-interp float) + (arrest-attempt-time time-frame) + (arrestor-handle handle) + (crocadog-handle handle) + (exit-vehicle-dest vector :inline :overlay-at event-param-point) ) - :heap-base #x380 - :method-count-assert 240 - :size-assert #x400 - :flag-assert #xf003800400 + (:state-methods + traveling + traveling-blocked + waiting-idle + waiting-turn + move-to-vehicle + board-vehicle + ride-vehicle + exit-vehicle + knocked-off-vehicle + arrested + ) (:methods - (traveling () _type_ :state 225) - (traveling-blocked () _type_ :state 226) - (waiting-idle () _type_ :state 227) - (waiting-turn () _type_ :state 228) - (move-to-vehicle () _type_ :state 229) - (board-vehicle () _type_ :state 230) - (ride-vehicle () _type_ :state 231) - (exit-vehicle () _type_ :state 232) - (knocked-off-vehicle () _type_ :state 233) - (arrested () _type_ :state 234) - (want-exit-vehicle? (_type_ vector) symbol 235) - (check-arrest (_type_) none 236) - (go-waiting-turn (_type_) none 237) - (check-vehicle-exit (_type_) none 238) - (play-walk-anim (_type_) none 239) + (want-exit-vehicle? (_type_ vector) symbol) + (check-arrest (_type_) none) + (go-waiting-turn (_type_) none) + (check-vehicle-exit (_type_) none) + (play-walk-anim (_type_) none) ) ) ;; definition for method 3 of type kid-escort -(defmethod inspect kid-escort ((this kid-escort)) +(defmethod inspect ((this kid-escort)) (when (not this) (set! this this) (goto cfg-4) @@ -60,18 +58,15 @@ ;; definition of type kidesct-wait-spot (deftype kidesct-wait-spot (ai-task) - ((check-done (function kidesct-wait-spot kid-escort symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function kidesct-wait-spot kid-escort symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type kidesct-wait-spot -(defmethod inspect kidesct-wait-spot ((this kidesct-wait-spot)) +(defmethod inspect ((this kidesct-wait-spot)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-task_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-task_REF.gc index 315a7006a1c..0a6f858d282 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-task_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type kidesct-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! kidesct-wait-spot ((this kidesct-wait-spot)) +(defmethod reset-task! ((this kidesct-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -13,7 +13,7 @@ ;; definition for method 11 of type kidesct-wait-spot ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 kidesct-wait-spot ((this kidesct-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this kidesct-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc_REF.gc index d6e0af6ce1c..a9e61c279ef 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc_REF.gc @@ -177,7 +177,7 @@ (set! (-> *kid-escort-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type kid-escort -(defmethod general-event-handler kid-escort ((this kid-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this kid-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -232,14 +232,14 @@ ) ;; definition for method 12 of type kid-escort -(defmethod run-logic? kid-escort ((this kid-escort)) +(defmethod run-logic? ((this kid-escort)) (or (not (logtest? (process-mask enemy) (-> *setting-control* user-current process-mask))) (logtest? (-> this bot-flags) (bot-flags bf09)) ) ) ;; definition for method 97 of type kid-escort -(defmethod enemy-method-97 kid-escort ((this kid-escort)) +(defmethod enemy-method-97 ((this kid-escort)) (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -358,7 +358,7 @@ ;; definition for method 183 of type kid-escort ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? kid-escort ((this kid-escort)) +(defmethod alive? ((this kid-escort)) (let ((t9-0 (method-of-type bot alive?))) (the-as symbol (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'waiting-idle) (= v1-3 'waiting-turn)) @@ -369,7 +369,7 @@ ) ;; definition for method 11 of type kid-escort -(defmethod init-from-entity! kid-escort ((this kid-escort) (arg0 entity-actor)) +(defmethod init-from-entity! ((this kid-escort) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -383,7 +383,7 @@ This commonly includes things such as: ;; definition for method 114 of type kid-escort ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! kid-escort ((this kid-escort)) +(defmethod init-enemy-collision! ((this kid-escort)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -458,7 +458,7 @@ This commonly includes things such as: ;; definition for method 210 of type kid-escort ;; WARN: Return type mismatch int vs none. -(defmethod init! kid-escort ((this kid-escort)) +(defmethod init! ((this kid-escort)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) (t9-0 this) @@ -479,7 +479,7 @@ This commonly includes things such as: ;; definition for method 115 of type kid-escort ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! kid-escort ((this kid-escort)) +(defmethod init-enemy! ((this kid-escort)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (initialize-skeleton @@ -509,27 +509,27 @@ This commonly includes things such as: ) ;; definition for method 214 of type kid-escort -(defmethod bot-method-214 kid-escort ((this kid-escort)) +(defmethod bot-method-214 ((this kid-escort)) #f ) ;; definition for method 72 of type kid-escort ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus kid-escort ((this kid-escort)) +(defmethod react-to-focus ((this kid-escort)) "@TODO - flesh out docs" (check-arrest this) ) ;; definition for method 237 of type kid-escort ;; WARN: Return type mismatch object vs none. -(defmethod go-waiting-turn kid-escort ((this kid-escort)) +(defmethod go-waiting-turn ((this kid-escort)) (go (method-of-object this waiting-turn)) (none) ) ;; definition for method 236 of type kid-escort ;; WARN: Return type mismatch object vs none. -(defmethod check-arrest kid-escort ((this kid-escort)) +(defmethod check-arrest ((this kid-escort)) (let ((s5-0 (handle->process (-> this arrestor-handle)))) (cond ((if (type? s5-0 process-focusable) @@ -550,7 +550,7 @@ This commonly includes things such as: ;; definition for method 239 of type kid-escort ;; WARN: Return type mismatch int vs none. -(defmethod play-walk-anim kid-escort ((this kid-escort)) +(defmethod play-walk-anim ((this kid-escort)) (with-pp (let ((f30-0 (-> this nav state speed)) (v1-5 (if (> (-> this skel active-channels) 0) @@ -587,18 +587,18 @@ This commonly includes things such as: ) ;; definition for method 56 of type kid-escort -(defmethod damage-amount-from-attack kid-escort ((this kid-escort) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this kid-escort) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) ;; definition for method 190 of type kid-escort -(defmethod bot-method-190 kid-escort ((this kid-escort)) +(defmethod bot-method-190 ((this kid-escort)) #t ) ;; definition for method 78 of type kid-escort -(defmethod enemy-method-78 kid-escort ((this kid-escort) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this kid-escort) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -614,7 +614,7 @@ This commonly includes things such as: ;; definition for method 198 of type kid-escort ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! kid-escort ((this kid-escort) (arg0 vector)) +(defmethod set-cam-height! ((this kid-escort) (arg0 vector)) (the-as meters (cond @@ -633,7 +633,7 @@ This commonly includes things such as: ) ;; definition for method 59 of type kid-escort -(defmethod get-penetrate-info kid-escort ((this kid-escort)) +(defmethod get-penetrate-info ((this kid-escort)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (let ((v1-1 ((method-of-type bot get-penetrate-info) this))) @@ -642,7 +642,7 @@ This commonly includes things such as: ) ;; definition for method 193 of type kid-escort -(defmethod bot-method-193 kid-escort ((this kid-escort)) +(defmethod bot-method-193 ((this kid-escort)) (let* ((t9-0 (method-of-type bot bot-method-193)) (v0-0 (t9-0 this)) ) @@ -654,7 +654,7 @@ This commonly includes things such as: ) ;; definition for method 79 of type kid-escort -(defmethod enemy-method-79 kid-escort ((this kid-escort) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this kid-escort) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (gp-0 symbol)) (case arg0 ((3) @@ -679,7 +679,7 @@ This commonly includes things such as: ;; definition for method 235 of type kid-escort ;; INFO: Used lq/sq -(defmethod want-exit-vehicle? kid-escort ((this kid-escort) (arg0 vector)) +(defmethod want-exit-vehicle? ((this kid-escort) (arg0 vector)) (let ((s3-0 (handle->process (-> this vehicle-handle)))) (if (or (not s3-0) (not (-> this nav))) (return #f) @@ -713,7 +713,7 @@ This commonly includes things such as: ;; definition for method 238 of type kid-escort ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod check-vehicle-exit kid-escort ((this kid-escort)) +(defmethod check-vehicle-exit ((this kid-escort)) (local-vars (v1-25 enemy-flag)) (when (focus-test? this pilot) (let ((s5-0 (handle->process (-> this vehicle-handle)))) @@ -757,7 +757,7 @@ This commonly includes things such as: ) ;; definition for method 70 of type kid-escort -(defmethod go-hostile kid-escort ((this kid-escort)) +(defmethod go-hostile ((this kid-escort)) (cond ((logtest? (bot-flags bf17) (-> this bot-flags)) (logior! (-> this bot-flags) (bot-flags bf09)) @@ -778,7 +778,7 @@ This commonly includes things such as: ) ;; definition for method 102 of type kid-escort -(defmethod enemy-method-102 kid-escort ((this kid-escort)) +(defmethod enemy-method-102 ((this kid-escort)) (if (logtest? (bot-flags bf19) (-> this bot-flags)) #f ((method-of-type bot enemy-method-102) this) @@ -787,7 +787,7 @@ This commonly includes things such as: ;; definition for method 116 of type kid-escort ;; WARN: Return type mismatch object vs none. -(defmethod go-idle kid-escort ((this kid-escort)) +(defmethod go-idle ((this kid-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) (cleanup-for-death this) diff --git a/test/decompiler/reference/jak2/levels/city/kiosk/kiosk-part_REF.gc b/test/decompiler/reference/jak2/levels/city/kiosk/kiosk-part_REF.gc index 2c045973efd..a22a759cfb5 100644 --- a/test/decompiler/reference/jak2/levels/city/kiosk/kiosk-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiosk/kiosk-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type kiosk-part (deftype kiosk-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type kiosk-part -(defmethod inspect kiosk-part ((this kiosk-part)) +(defmethod inspect ((this kiosk-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/market/ashelin/ash4-course_REF.gc b/test/decompiler/reference/jak2/levels/city/market/ashelin/ash4-course_REF.gc index 7f1424344e0..6aa6386289c 100644 --- a/test/decompiler/reference/jak2/levels/city/market/ashelin/ash4-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/ashelin/ash4-course_REF.gc @@ -3,19 +3,15 @@ ;; definition of type ashelin-tanker (deftype ashelin-tanker (ashelin) - ((suppress traffic-suppression-params :inline :offset-assert 1040) + ((suppress traffic-suppression-params :inline) ) - :heap-base #x3c0 - :method-count-assert 252 - :size-assert #x439 - :flag-assert #xfc03c00439 (:methods - (suppress-traffic (_type_) none 251) + (suppress-traffic (_type_) none) ) ) ;; definition for method 3 of type ashelin-tanker -(defmethod inspect ashelin-tanker ((this ashelin-tanker)) +(defmethod inspect ((this ashelin-tanker)) (when (not this) (set! this this) (goto cfg-4) @@ -30,7 +26,7 @@ ;; definition for method 116 of type ashelin-tanker ;; WARN: Return type mismatch object vs none. -(defmethod go-idle ashelin-tanker ((this ashelin-tanker)) +(defmethod go-idle ((this ashelin-tanker)) (cond ((task-node-closed? (game-task-node city-intercept-tanker-resolution)) (cleanup-for-death this) @@ -45,7 +41,7 @@ ;; definition for method 210 of type ashelin-tanker ;; WARN: Return type mismatch vector vs none. -(defmethod init! ashelin-tanker ((this ashelin-tanker)) +(defmethod init! ((this ashelin-tanker)) "Set defaults for various fields." (let ((t9-0 (method-of-type ashelin init!))) (t9-0 this) @@ -66,7 +62,7 @@ ;; definition for method 251 of type ashelin-tanker ;; INFO: Used lq/sq -(defmethod suppress-traffic ashelin-tanker ((this ashelin-tanker)) +(defmethod suppress-traffic ((this ashelin-tanker)) (when *traffic-manager* (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> (new 'static 'vector :x 1837465.6 :y 34406.4 :z 1868103.6 :w 225280.0) quad)) diff --git a/test/decompiler/reference/jak2/levels/city/market/ashelin/ctyasha-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/market/ashelin/ctyasha-obs_REF.gc index f2ef1e1cd10..1641bfa08fe 100644 --- a/test/decompiler/reference/jak2/levels/city/market/ashelin/ctyasha-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/ashelin/ctyasha-obs_REF.gc @@ -900,16 +900,12 @@ ;; definition of type tanker-grunt (deftype tanker-grunt (grunt) - ((expensive-gnd-collide? symbol :offset 692) + ((expensive-gnd-collide? symbol :offset 692) ) - :heap-base #x240 - :method-count-assert 186 - :size-assert #x2b8 - :flag-assert #xba024002b8 ) ;; definition for method 3 of type tanker-grunt -(defmethod inspect tanker-grunt ((this tanker-grunt)) +(defmethod inspect ((this tanker-grunt)) (when (not this) (set! this this) (goto cfg-4) @@ -923,7 +919,7 @@ ) ;; definition for method 74 of type tanker-grunt -(defmethod general-event-handler tanker-grunt ((this tanker-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this tanker-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -961,7 +957,7 @@ ;; definition for method 115 of type tanker-grunt ;; WARN: Return type mismatch vector vs none. -(defmethod init-enemy! tanker-grunt ((this tanker-grunt)) +(defmethod init-enemy! ((this tanker-grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (set! (-> this expensive-gnd-collide?) #t) (let ((t9-0 (method-of-type grunt init-enemy!))) @@ -973,7 +969,7 @@ ;; definition for method 124 of type tanker-grunt ;; WARN: Return type mismatch uint vs collide-spec. -(defmethod enemy-method-124 tanker-grunt ((this tanker-grunt)) +(defmethod enemy-method-124 ((this tanker-grunt)) "TODO" (let ((t9-0 (method-of-type grunt enemy-method-124))) (t9-0 this) @@ -988,7 +984,7 @@ ) ;; definition for method 70 of type tanker-grunt -(defmethod go-hostile tanker-grunt ((this tanker-grunt)) +(defmethod go-hostile ((this tanker-grunt)) (set! (-> this expensive-gnd-collide?) #f) (enemy-method-124 this) ((method-of-type grunt go-hostile) this) @@ -1022,16 +1018,12 @@ ;; definition of type tanker-juicer (deftype tanker-juicer (juicer) - ((expensive-gnd-collide? symbol :offset-assert 848) + ((expensive-gnd-collide? symbol) ) - :heap-base #x2e0 - :method-count-assert 185 - :size-assert #x354 - :flag-assert #xb902e00354 ) ;; definition for method 3 of type tanker-juicer -(defmethod inspect tanker-juicer ((this tanker-juicer)) +(defmethod inspect ((this tanker-juicer)) (when (not this) (set! this this) (goto cfg-4) @@ -1045,7 +1037,7 @@ ) ;; definition for method 74 of type tanker-juicer -(defmethod general-event-handler tanker-juicer ((this tanker-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this tanker-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -1082,7 +1074,7 @@ ;; definition for method 115 of type tanker-juicer ;; WARN: Return type mismatch vector vs none. -(defmethod init-enemy! tanker-juicer ((this tanker-juicer)) +(defmethod init-enemy! ((this tanker-juicer)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (set! (-> this expensive-gnd-collide?) #t) (let ((t9-0 (method-of-type juicer init-enemy!))) @@ -1094,7 +1086,7 @@ ;; definition for method 124 of type tanker-juicer ;; WARN: Return type mismatch uint vs collide-spec. -(defmethod enemy-method-124 tanker-juicer ((this tanker-juicer)) +(defmethod enemy-method-124 ((this tanker-juicer)) "TODO" (let ((t9-0 (method-of-type juicer enemy-method-124))) (t9-0 this) @@ -1109,7 +1101,7 @@ ) ;; definition for method 70 of type tanker-juicer -(defmethod go-hostile tanker-juicer ((this tanker-juicer)) +(defmethod go-hostile ((this tanker-juicer)) (set! (-> this expensive-gnd-collide?) #f) (enemy-method-124 this) ((method-of-type juicer go-hostile) this) @@ -1143,21 +1135,19 @@ ;; definition of type tanker-container (deftype tanker-container (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc8 - :flag-assert #x17005000c8 + (:state-methods + dormant + idle + ) (:methods - (dormant () _type_ :state 20) - (idle () _type_ :state 21) - (tanker-container-method-22 (_type_) none 22) + (tanker-container-method-22 (_type_) none) ) ) ;; definition for method 3 of type tanker-container -(defmethod inspect tanker-container ((this tanker-container)) +(defmethod inspect ((this tanker-container)) (when (not this) (set! this this) (goto cfg-4) @@ -1171,7 +1161,7 @@ ;; definition for method 22 of type tanker-container ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod tanker-container-method-22 tanker-container ((this tanker-container)) +(defmethod tanker-container-method-22 ((this tanker-container)) (process-spawn simple-nav-sphere #x46733333 @@ -1342,7 +1332,7 @@ ;; definition for method 11 of type tanker-container ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tanker-container ((this tanker-container) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tanker-container) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1421,20 +1411,16 @@ This commonly includes things such as: ;; definition of type tanker-crash (deftype tanker-crash (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (dormant () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + dormant + idle ) ) ;; definition for method 3 of type tanker-crash -(defmethod inspect tanker-crash ((this tanker-crash)) +(defmethod inspect ((this tanker-crash)) (when (not this) (set! this this) (goto cfg-4) @@ -1480,7 +1466,7 @@ This commonly includes things such as: ;; definition for method 11 of type tanker-crash ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tanker-crash ((this tanker-crash) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tanker-crash) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1552,24 +1538,20 @@ This commonly includes things such as: ;; definition of type tanker-deadly (deftype tanker-deadly (process-drawable) - ((root collide-shape :override) - (track-joint int32 :offset-assert 200) - (attack-id uint32 :offset-assert 204) - (die-time time-frame :offset-assert 208) - (prev-pos vector :inline :offset-assert 224) + ((root collide-shape :override) + (track-joint int32) + (attack-id uint32) + (die-time time-frame) + (prev-pos vector :inline) ) - :heap-base #x70 - :method-count-assert 22 - :size-assert #xf0 - :flag-assert #x16007000f0 - (:methods - (active () _type_ :state 20) - (die-fast () _type_ :state 21) + (:state-methods + active + die-fast ) ) ;; definition for method 3 of type tanker-deadly -(defmethod inspect tanker-deadly ((this tanker-deadly)) +(defmethod inspect ((this tanker-deadly)) (when (not this) (set! this this) (goto cfg-4) @@ -1586,7 +1568,7 @@ This commonly includes things such as: ) ;; definition for method 12 of type tanker-deadly -(defmethod run-logic? tanker-deadly ((this tanker-deadly)) +(defmethod run-logic? ((this tanker-deadly)) #t ) diff --git a/test/decompiler/reference/jak2/levels/city/market/ctymark-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/market/ctymark-obs_REF.gc index 3967bd28597..77757f313b4 100644 --- a/test/decompiler/reference/jak2/levels/city/market/ctymark-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/ctymark-obs_REF.gc @@ -1017,21 +1017,17 @@ ;; definition of type market-object (deftype market-object (process-focusable) - ((part-explode basic :offset-assert 204) - (explode-matrix matrix :inline :offset-assert 208) + ((part-explode basic) + (explode-matrix matrix :inline) ) - :heap-base #x90 - :method-count-assert 29 - :size-assert #x110 - :flag-assert #x1d00900110 - (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) + (:state-methods + idle + die ) ) ;; definition for method 3 of type market-object -(defmethod inspect market-object ((this market-object)) +(defmethod inspect ((this market-object)) (when (not this) (set! this this) (goto cfg-4) @@ -1116,14 +1112,10 @@ ;; definition of type market-basket-a (deftype market-basket-a (market-object) () - :heap-base #x90 - :method-count-assert 29 - :size-assert #x110 - :flag-assert #x1d00900110 ) ;; definition for method 3 of type market-basket-a -(defmethod inspect market-basket-a ((this market-basket-a)) +(defmethod inspect ((this market-basket-a)) (when (not this) (set! this this) (goto cfg-4) @@ -1145,7 +1137,7 @@ ;; definition for method 11 of type market-basket-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-basket-a ((this market-basket-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this market-basket-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1212,14 +1204,10 @@ This commonly includes things such as: ;; definition of type market-basket-b (deftype market-basket-b (market-object) () - :heap-base #x90 - :method-count-assert 29 - :size-assert #x110 - :flag-assert #x1d00900110 ) ;; definition for method 3 of type market-basket-b -(defmethod inspect market-basket-b ((this market-basket-b)) +(defmethod inspect ((this market-basket-b)) (when (not this) (set! this this) (goto cfg-4) @@ -1241,7 +1229,7 @@ This commonly includes things such as: ;; definition for method 11 of type market-basket-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-basket-b ((this market-basket-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this market-basket-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1308,14 +1296,10 @@ This commonly includes things such as: ;; definition of type market-crate (deftype market-crate (market-object) () - :heap-base #x90 - :method-count-assert 29 - :size-assert #x110 - :flag-assert #x1d00900110 ) ;; definition for method 3 of type market-crate -(defmethod inspect market-crate ((this market-crate)) +(defmethod inspect ((this market-crate)) (when (not this) (set! this this) (goto cfg-4) @@ -1337,7 +1321,7 @@ This commonly includes things such as: ;; definition for method 11 of type market-crate ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-crate ((this market-crate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this market-crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1404,14 +1388,10 @@ This commonly includes things such as: ;; definition of type market-sack-a (deftype market-sack-a (market-object) () - :heap-base #x90 - :method-count-assert 29 - :size-assert #x110 - :flag-assert #x1d00900110 ) ;; definition for method 3 of type market-sack-a -(defmethod inspect market-sack-a ((this market-sack-a)) +(defmethod inspect ((this market-sack-a)) (when (not this) (set! this this) (goto cfg-4) @@ -1433,7 +1413,7 @@ This commonly includes things such as: ;; definition for method 11 of type market-sack-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-sack-a ((this market-sack-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this market-sack-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1500,14 +1480,10 @@ This commonly includes things such as: ;; definition of type market-sack-b (deftype market-sack-b (market-object) () - :heap-base #x90 - :method-count-assert 29 - :size-assert #x110 - :flag-assert #x1d00900110 ) ;; definition for method 3 of type market-sack-b -(defmethod inspect market-sack-b ((this market-sack-b)) +(defmethod inspect ((this market-sack-b)) (when (not this) (set! this this) (goto cfg-4) @@ -1529,7 +1505,7 @@ This commonly includes things such as: ;; definition for method 11 of type market-sack-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-sack-b ((this market-sack-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this market-sack-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/city/market/ctymarka-part_REF.gc b/test/decompiler/reference/jak2/levels/city/market/ctymarka-part_REF.gc index c439bd7fc80..093861d70a3 100644 --- a/test/decompiler/reference/jak2/levels/city/market/ctymarka-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/ctymarka-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctymarka-part (deftype ctymarka-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctymarka-part -(defmethod inspect ctymarka-part ((this ctymarka-part)) +(defmethod inspect ((this ctymarka-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/market/ctymarkb-part_REF.gc b/test/decompiler/reference/jak2/levels/city/market/ctymarkb-part_REF.gc index b0ac34cb2e8..0ea58270eec 100644 --- a/test/decompiler/reference/jak2/levels/city/market/ctymarkb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/ctymarkb-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctymarkb-part (deftype ctymarkb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctymarkb-part -(defmethod inspect ctymarkb-part ((this ctymarkb-part)) +(defmethod inspect ((this ctymarkb-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/meet-brutter/meet-brutter_REF.gc b/test/decompiler/reference/jak2/levels/city/meet-brutter/meet-brutter_REF.gc index c0db6604516..877425e9e12 100644 --- a/test/decompiler/reference/jak2/levels/city/meet-brutter/meet-brutter_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/meet-brutter/meet-brutter_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 15 of type hud-lurker ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-lurker ((this hud-lurker)) +(defmethod draw ((this hud-lurker)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -18,7 +18,7 @@ ;; definition for method 16 of type hud-lurker ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-lurker ((this hud-lurker)) +(defmethod update-values ((this hud-lurker)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -27,7 +27,7 @@ ;; definition for method 17 of type hud-lurker ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-lurker ((this hud-lurker)) +(defmethod init-callback ((this hud-lurker)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -240,16 +240,12 @@ ;; definition of type paddywagon (deftype paddywagon (vehicle-guard) - ((current-level symbol :offset-assert 1076) + ((current-level symbol) ) - :heap-base #x3c0 - :method-count-assert 159 - :size-assert #x438 - :flag-assert #x9f03c00438 ) ;; definition for method 3 of type paddywagon -(defmethod inspect paddywagon ((this paddywagon)) +(defmethod inspect ((this paddywagon)) (when (not this) (set! this this) (goto cfg-4) @@ -264,7 +260,7 @@ ;; definition for method 32 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape paddywagon ((this paddywagon)) +(defmethod allocate-and-init-cshape ((this paddywagon)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -321,19 +317,16 @@ ;; definition of type pw-iter-seg (deftype pw-iter-seg (structure) - ((self paddywagon :offset-assert 0) - (desired-dir vector :inline :offset-assert 16) - (score float :offset-assert 32) - (seg nav-segment :offset-assert 36) - (level symbol :offset-assert 40) + ((self paddywagon) + (desired-dir vector :inline) + (score float) + (seg nav-segment) + (level symbol) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type pw-iter-seg -(defmethod inspect pw-iter-seg ((this pw-iter-seg)) +(defmethod inspect ((this pw-iter-seg)) (when (not this) (set! this this) (goto cfg-4) @@ -471,7 +464,7 @@ ;; definition for method 33 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body paddywagon ((this paddywagon)) +(defmethod init-skel-and-rigid-body ((this paddywagon)) (with-pp (set! (-> pp level) (level-get *level* 'lmeetbrt)) (initialize-skeleton @@ -492,7 +485,7 @@ ;; definition for method 120 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-120 paddywagon ((this paddywagon)) +(defmethod vehicle-method-120 ((this paddywagon)) (let ((t9-0 (method-of-type vehicle-guard vehicle-method-120))) (t9-0 this) ) @@ -507,7 +500,7 @@ ;; definition for method 128 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-128 paddywagon ((this paddywagon)) +(defmethod vehicle-method-128 ((this paddywagon)) (let ((t9-0 (method-of-type vehicle vehicle-method-128))) (t9-0 this) ) @@ -518,7 +511,7 @@ ;; definition for method 127 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-127 paddywagon ((this paddywagon)) +(defmethod vehicle-method-127 ((this paddywagon)) ((method-of-type vehicle vehicle-method-127) this) 0 (none) @@ -526,7 +519,7 @@ ;; definition for method 129 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-129 paddywagon ((this paddywagon)) +(defmethod vehicle-method-129 ((this paddywagon)) ((method-of-type vehicle vehicle-method-129) this) 0 (none) @@ -534,7 +527,7 @@ ;; definition for method 134 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-134 paddywagon ((this paddywagon) (arg0 process)) +(defmethod vehicle-method-134 ((this paddywagon) (arg0 process)) "Stubbed" (logior! (-> this controller flags) (vehicle-controller-flag ignore-others)) (set! (-> this controller target-speed-offset) 81920.0) @@ -551,7 +544,7 @@ ;; definition for method 108 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-108 paddywagon ((this paddywagon)) +(defmethod vehicle-method-108 ((this paddywagon)) (set! (-> this flags) (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> this flags))) ) @@ -800,31 +793,27 @@ ;; definition of type city-lurker (deftype city-lurker (civilian) - ((nav-mesh-aid uint32 :offset-assert 1060) - (index uint32 :offset-assert 1064) - (left-right-interp float :offset-assert 1068) - (front-back-interp float :offset-assert 1072) - (v-speed vector :inline :offset-assert 1088) - (end-pos vector :inline :offset-assert 1104) - (task-done? symbol :offset-assert 1120) - (task-node game-task-node :offset-assert 1124) - (jump-in-pipe? symbol :offset-assert 1128) - (pipe-name string :offset-assert 1132) - (coming-from-pw symbol :offset-assert 1136) + ((nav-mesh-aid uint32) + (index uint32) + (left-right-interp float) + (front-back-interp float) + (v-speed vector :inline) + (end-pos vector :inline) + (task-done? symbol) + (task-node game-task-node) + (jump-in-pipe? symbol) + (pipe-name string) + (coming-from-pw symbol) ) - :heap-base #x400 - :method-count-assert 221 - :size-assert #x474 - :flag-assert #xdd04000474 - (:methods - (go-at-end () _type_ :state 218) - (go-at-pipe () _type_ :state 219) - (wait-at-end () _type_ :state 220) + (:state-methods + go-at-end + go-at-pipe + wait-at-end ) ) ;; definition for method 3 of type city-lurker -(defmethod inspect city-lurker ((this city-lurker)) +(defmethod inspect ((this city-lurker)) (when (not this) (set! this this) (goto cfg-4) @@ -1054,7 +1043,7 @@ ) ;; definition for method 26 of type city-lurker -(defmethod get-inv-mass city-lurker ((this city-lurker)) +(defmethod get-inv-mass ((this city-lurker)) 0.25 ) @@ -1693,7 +1682,7 @@ ) ;; definition for method 86 of type city-lurker -(defmethod enemy-method-86 city-lurker ((this city-lurker)) +(defmethod enemy-method-86 ((this city-lurker)) (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) (when (and (< (-> gp-0 trans y) (+ 8192.0 (-> this end-pos y))) (-> this jump-in-pipe?)) @@ -1707,18 +1696,18 @@ ;; definition for method 93 of type city-lurker ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 city-lurker ((this city-lurker)) +(defmethod enemy-method-93 ((this city-lurker)) (go (method-of-object this inactive)) (none) ) ;; definition for method 89 of type city-lurker -(defmethod enemy-method-89 city-lurker ((this city-lurker) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this city-lurker) (arg0 enemy-jump-info)) #f ) ;; definition for method 87 of type city-lurker -(defmethod enemy-method-87 city-lurker ((this city-lurker) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this city-lurker) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -1735,7 +1724,7 @@ ) ;; definition for method 88 of type city-lurker -(defmethod enemy-method-88 city-lurker ((this city-lurker) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this city-lurker) (arg0 enemy-jump-info)) #f ) @@ -1799,13 +1788,13 @@ ) ;; definition for method 60 of type city-lurker -(defmethod coin-flip? city-lurker ((this city-lurker)) +(defmethod coin-flip? ((this city-lurker)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 56 of type city-lurker -(defmethod damage-amount-from-attack city-lurker ((this city-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this city-lurker) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) @@ -1987,7 +1976,7 @@ ;; definition for method 199 of type city-lurker ;; WARN: Return type mismatch int vs none. -(defmethod set-behavior! city-lurker ((this city-lurker) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! ((this city-lurker) (arg0 traffic-object-spawn-params)) (format #t "go-traffic-startup ~D~%" (-> arg0 behavior)) (let ((v1-0 (-> arg0 behavior))) (cond @@ -2019,7 +2008,7 @@ ;; definition for method 181 of type city-lurker ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! city-lurker ((this city-lurker)) +(defmethod citizen-init! ((this city-lurker)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) (t9-0 this) @@ -2033,7 +2022,7 @@ ;; definition for method 114 of type city-lurker ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! city-lurker ((this city-lurker)) +(defmethod init-enemy-collision! ((this city-lurker)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -2099,7 +2088,7 @@ ;; definition for method 115 of type city-lurker ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! city-lurker ((this city-lurker)) +(defmethod init-enemy! ((this city-lurker)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -2126,7 +2115,7 @@ ;; definition for method 74 of type city-lurker ;; INFO: Used lq/sq -(defmethod general-event-handler city-lurker ((this city-lurker) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this city-lurker) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -2193,18 +2182,15 @@ ;; definition of type city-meet-brutter-info (deftype city-meet-brutter-info (structure) - ((pos vector :inline :offset-assert 0) - (level symbol :offset-assert 16) - (nav-mesh-id uint32 :offset-assert 20) - (end-pos vector :inline :offset-assert 32) + ((pos vector :inline) + (level symbol) + (nav-mesh-id uint32) + (end-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type city-meet-brutter-info -(defmethod inspect city-meet-brutter-info ((this city-meet-brutter-info)) +(defmethod inspect ((this city-meet-brutter-info)) (when (not this) (set! this this) (goto cfg-4) @@ -2755,19 +2741,16 @@ ;; definition of type city-save-lurkers-info (deftype city-save-lurkers-info (structure) - ((pos vector :inline :offset-assert 0) - (level symbol :offset-assert 16) - (nav-mesh-id uint32 :offset-assert 20) - (end-pos vector :inline :offset-assert 32) - (pipe-name string :offset-assert 48) + ((pos vector :inline) + (level symbol) + (nav-mesh-id uint32) + (end-pos vector :inline) + (pipe-name string) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type city-save-lurkers-info -(defmethod inspect city-save-lurkers-info ((this city-save-lurkers-info)) +(defmethod inspect ((this city-save-lurkers-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc b/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc index eed73ac8229..e7d07943d4c 100644 --- a/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc @@ -3,23 +3,20 @@ ;; definition of type onin-game-event (deftype onin-game-event (structure) - ((min-count uint16 :offset-assert 0) - (max-count uint16 :offset-assert 2) - (min-event uint16 :offset-assert 4) - (max-event uint16 :offset-assert 6) - (wave-delay uint16 :offset-assert 8) - (min-wave uint16 :offset-assert 10) - (max-wave uint16 :offset-assert 12) - (gravity meters :offset-assert 16) + ((min-count uint16) + (max-count uint16) + (min-event uint16) + (max-event uint16) + (wave-delay uint16) + (min-wave uint16) + (max-wave uint16) + (gravity meters) ) :pack-me - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type onin-game-event -(defmethod inspect onin-game-event ((this onin-game-event)) +(defmethod inspect ((this onin-game-event)) (when (not this) (set! this this) (goto cfg-4) @@ -1860,25 +1857,21 @@ ;; definition of type onin-game-bubble (deftype onin-game-bubble (process-drawable) - ((bubble-type int32 :offset-assert 200) - (bubble-start-time time-frame :offset-assert 208) - (gravity meters :offset-assert 216) - (dead? symbol :offset-assert 220) - (angle float :offset-assert 224) - (height float :offset-assert 228) + ((bubble-type int32) + (bubble-start-time time-frame) + (gravity meters) + (dead? symbol) + (angle float) + (height float) ) - :heap-base #x70 - :method-count-assert 22 - :size-assert #xe8 - :flag-assert #x16007000e8 - (:methods - (idle () _type_ :state 20) - (fall () _type_ :state 21) + (:state-methods + idle + fall ) ) ;; definition for method 3 of type onin-game-bubble -(defmethod inspect onin-game-bubble ((this onin-game-bubble)) +(defmethod inspect ((this onin-game-bubble)) (when (not this) (set! this this) (goto cfg-4) @@ -2156,46 +2149,44 @@ ;; definition of type onin-game (deftype onin-game (process-drawable) - ((wave int32 :offset-assert 200) - (event int32 :offset-assert 204) - (wave-time time-frame :offset-assert 208) - (wave-delay-time time-frame :offset-assert 216) - (wave-length uint64 :offset-assert 224) - (event-time time-frame :offset-assert 232) - (event-length uint64 :offset-assert 240) - (hud-score handle :offset-assert 248) - (hud-goal handle :offset-assert 256) - (hud-miss handle :offset-assert 264) - (score float :offset-assert 272) - (score-time time-frame :offset-assert 280) - (game (inline-array onin-game-event) :offset-assert 288) - (miss-max int32 :offset-assert 292) - (miss-count int32 :offset-assert 296) - (point-win float :offset-assert 300) - (game-start-time time-frame :offset-assert 304) - (last-type int32 :offset-assert 312) - (current-bonus float :offset-assert 316) - (last-angle float :offset-assert 320) - (wave-start-miss int32 :offset-assert 324) + ((wave int32) + (event int32) + (wave-time time-frame) + (wave-delay-time time-frame) + (wave-length uint64) + (event-time time-frame) + (event-length uint64) + (hud-score handle) + (hud-goal handle) + (hud-miss handle) + (score float) + (score-time time-frame) + (game (inline-array onin-game-event)) + (miss-max int32) + (miss-count int32) + (point-win float) + (game-start-time time-frame) + (last-type int32) + (current-bonus float) + (last-angle float) + (wave-start-miss int32) ) - :heap-base #xd0 - :method-count-assert 28 - :size-assert #x148 - :flag-assert #x1c00d00148 + (:state-methods + hide + wait-for-start + (active symbol) + (lose symbol) + win + ) (:methods - (hide () _type_ :state 20) - (wait-for-start () _type_ :state 21) - (active (symbol) _type_ :state 22) - (lose (symbol) _type_ :state 23) - (win () _type_ :state 24) - (onin-game-method-25 (_type_) none 25) - (onin-game-method-26 (_type_) none 26) - (onin-game-method-27 (_type_ int) none 27) + (onin-game-method-25 (_type_) none) + (onin-game-method-26 (_type_) none) + (onin-game-method-27 (_type_ int) none) ) ) ;; definition for method 3 of type onin-game -(defmethod inspect onin-game ((this onin-game)) +(defmethod inspect ((this onin-game)) (when (not this) (set! this this) (goto cfg-4) @@ -2239,7 +2230,7 @@ ;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 112 mismatch: defined as size 4, got size 16 ;; WARN: Return type mismatch int vs none. -(defmethod onin-game-method-25 onin-game ((this onin-game)) +(defmethod onin-game-method-25 ((this onin-game)) (local-vars (v0-18 int) (sv-32 process) @@ -2394,7 +2385,7 @@ ;; definition for method 26 of type onin-game ;; WARN: Return type mismatch int vs none. -(defmethod onin-game-method-26 onin-game ((this onin-game)) +(defmethod onin-game-method-26 ((this onin-game)) (cond ((>= (-> *game-info* score) (-> this score)) (set! (-> *game-info* score) (-> this score)) @@ -2412,7 +2403,7 @@ ;; definition for method 27 of type onin-game ;; WARN: Return type mismatch number vs none. -(defmethod onin-game-method-27 onin-game ((this onin-game) (arg0 int)) +(defmethod onin-game-method-27 ((this onin-game) (arg0 int)) "TODO - bubble type" (let ((s4-0 (the-as onin-game-bubble #f))) (let ((s3-0 0) diff --git a/test/decompiler/reference/jak2/levels/city/onintent/onintent-part_REF.gc b/test/decompiler/reference/jak2/levels/city/onintent/onintent-part_REF.gc index dfae82bf6e3..10c693e12c8 100644 --- a/test/decompiler/reference/jak2/levels/city/onintent/onintent-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/onintent/onintent-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type onintent-part (deftype onintent-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type onintent-part -(defmethod inspect onintent-part ((this onintent-part)) +(defmethod inspect ((this onintent-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/oracle/oracle-part_REF.gc b/test/decompiler/reference/jak2/levels/city/oracle/oracle-part_REF.gc index 01594f3085e..c505013910c 100644 --- a/test/decompiler/reference/jak2/levels/city/oracle/oracle-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/oracle/oracle-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type oracle-part (deftype oracle-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type oracle-part -(defmethod inspect oracle-part ((this oracle-part)) +(defmethod inspect ((this oracle-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/oracle/oracle-scenes_REF.gc b/test/decompiler/reference/jak2/levels/city/oracle/oracle-scenes_REF.gc index 64985ec6936..d764ebf2c3c 100644 --- a/test/decompiler/reference/jak2/levels/city/oracle/oracle-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/oracle/oracle-scenes_REF.gc @@ -824,14 +824,10 @@ ;; definition of type oracle-npc (deftype oracle-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type oracle-npc -(defmethod inspect oracle-npc ((this oracle-npc)) +(defmethod inspect ((this oracle-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -845,7 +841,7 @@ ;; definition for method 33 of type oracle-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! oracle-npc ((this oracle-npc)) +(defmethod init-art! ((this oracle-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -857,7 +853,7 @@ ) ;; definition for method 35 of type oracle-npc -(defmethod get-art-elem oracle-npc ((this oracle-npc)) +(defmethod get-art-elem ((this oracle-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (logior! (-> this draw status) (draw-control-status no-draw-bounds)) diff --git a/test/decompiler/reference/jak2/levels/city/package/delivery-task_REF.gc b/test/decompiler/reference/jak2/levels/city/package/delivery-task_REF.gc index 68d205f26bb..ecb2a981ee6 100644 --- a/test/decompiler/reference/jak2/levels/city/package/delivery-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/package/delivery-task_REF.gc @@ -9,23 +9,21 @@ ;; definition of type krew-package (deftype krew-package (process-drawable) - ((attach-object handle :offset-assert 200) - (scale float :offset-assert 208) + ((attach-object handle) + (scale float) ) - :heap-base #x60 - :method-count-assert 24 - :size-assert #xd4 - :flag-assert #x18006000d4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (krew-package-method-22 (_type_) none 22) - (krew-package-method-23 (_type_) none 23) + (krew-package-method-22 (_type_) none) + (krew-package-method-23 (_type_) none) ) ) ;; definition for method 3 of type krew-package -(defmethod inspect krew-package ((this krew-package)) +(defmethod inspect ((this krew-package)) (when (not this) (set! this this) (goto cfg-4) @@ -41,7 +39,7 @@ ;; definition for method 22 of type krew-package ;; WARN: Return type mismatch int vs none. -(defmethod krew-package-method-22 krew-package ((this krew-package)) +(defmethod krew-package-method-22 ((this krew-package)) (set! (-> this root) (new 'process 'trsqv)) 0 (none) @@ -49,7 +47,7 @@ ;; definition for method 23 of type krew-package ;; WARN: Return type mismatch int vs none. -(defmethod krew-package-method-23 krew-package ((this krew-package)) +(defmethod krew-package-method-23 ((this krew-package)) (with-pp (set! (-> pp level) (level-get *level* 'lpackage)) (initialize-skeleton @@ -106,7 +104,7 @@ ;; definition for method 11 of type krew-package ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! krew-package ((this krew-package) (arg0 entity-actor)) +(defmethod init-from-entity! ((this krew-package) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc index 262f1048e53..38dddc95ba3 100644 --- a/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc @@ -4,14 +4,10 @@ ;; definition of type water-anim-ctypal (deftype water-anim-ctypal (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) ;; definition for method 3 of type water-anim-ctypal -(defmethod inspect water-anim-ctypal ((this water-anim-ctypal)) +(defmethod inspect ((this water-anim-ctypal)) (when (not this) (set! this this) (goto cfg-4) @@ -53,7 +49,7 @@ ;; definition for method 24 of type water-anim-ctypal ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-ctypal ((this water-anim-ctypal)) +(defmethod init-water! ((this water-anim-ctypal)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) (t9-0 this) @@ -83,14 +79,10 @@ ;; definition of type palace-door (deftype palace-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type palace-door -(defmethod inspect palace-door ((this palace-door)) +(defmethod inspect ((this palace-door)) (when (not this) (set! this this) (goto cfg-4) @@ -104,7 +96,7 @@ ;; definition for method 11 of type palace-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! palace-door ((this palace-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this palace-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -160,20 +152,16 @@ This commonly includes things such as: ;; definition of type ctypal-broke-wall (deftype ctypal-broke-wall (process-drawable) - ((ent basic :offset-assert 200) + ((ent basic) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16005000cc - (:methods - (idle () _type_ :state 20) - (done () _type_ :state 21) + (:state-methods + idle + done ) ) ;; definition for method 3 of type ctypal-broke-wall -(defmethod inspect ctypal-broke-wall ((this ctypal-broke-wall)) +(defmethod inspect ((this ctypal-broke-wall)) (when (not this) (set! this this) (goto cfg-4) @@ -219,7 +207,7 @@ This commonly includes things such as: ;; definition for method 11 of type ctypal-broke-wall ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ctypal-broke-wall ((this ctypal-broke-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ctypal-broke-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -266,17 +254,13 @@ This commonly includes things such as: ;; definition of type ctypal-baron-statue-broken (deftype ctypal-baron-statue-broken (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type ctypal-baron-statue-broken -(defmethod inspect ctypal-baron-statue-broken ((this ctypal-baron-statue-broken)) +(defmethod inspect ((this ctypal-baron-statue-broken)) (when (not this) (set! this this) (goto cfg-4) @@ -295,7 +279,7 @@ This commonly includes things such as: ) ;; definition for method 12 of type ctypal-baron-statue-broken -(defmethod run-logic? ctypal-baron-statue-broken ((this ctypal-baron-statue-broken)) +(defmethod run-logic? ((this ctypal-baron-statue-broken)) #t ) @@ -307,7 +291,7 @@ This commonly includes things such as: ;; definition for method 11 of type ctypal-baron-statue-broken ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ctypal-baron-statue-broken ((this ctypal-baron-statue-broken) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ctypal-baron-statue-broken) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/city/palace/ctypal-part_REF.gc b/test/decompiler/reference/jak2/levels/city/palace/ctypal-part_REF.gc index a31945093a1..51727322c58 100644 --- a/test/decompiler/reference/jak2/levels/city/palace/ctypal-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/palace/ctypal-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctypal-part (deftype ctypal-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctypal-part -(defmethod inspect ctypal-part ((this ctypal-part)) +(defmethod inspect ((this ctypal-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/port/ctyport-part_REF.gc b/test/decompiler/reference/jak2/levels/city/port/ctyport-part_REF.gc index 89e89e77cff..4b1fdc7a272 100644 --- a/test/decompiler/reference/jak2/levels/city/port/ctyport-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/port/ctyport-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctyport-part (deftype ctyport-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctyport-part -(defmethod inspect ctyport-part ((this ctyport-part)) +(defmethod inspect ((this ctyport-part)) (when (not this) (set! this this) (goto cfg-4) @@ -3538,25 +3534,23 @@ ;; definition of type hiphog-exterior-marquee (deftype hiphog-exterior-marquee (process-drawable) - ((rot vector :inline :offset-assert 208) - (master-enable uint32 :offset-assert 224) - (pad-ih12nb312 uint32 3 :offset-assert 228) - (mode uint32 :offset-assert 240) - (counter int32 :offset-assert 244) - (parts sparticle-launch-control 1 :offset-assert 248) + ((rot vector :inline) + (master-enable uint32) + (pad-ih12nb312 uint32 3) + (mode uint32) + (counter int32) + (parts sparticle-launch-control 1) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xfc - :flag-assert #x16008000fc + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (hiphog-exterior-marquee-method-21 (_type_) none 21) + (hiphog-exterior-marquee-method-21 (_type_) none) ) ) ;; definition for method 3 of type hiphog-exterior-marquee -(defmethod inspect hiphog-exterior-marquee ((this hiphog-exterior-marquee)) +(defmethod inspect ((this hiphog-exterior-marquee)) (when (not this) (set! this this) (goto cfg-4) @@ -3575,7 +3569,7 @@ ) ;; definition for method 10 of type hiphog-exterior-marquee -(defmethod deactivate hiphog-exterior-marquee ((this hiphog-exterior-marquee)) +(defmethod deactivate ((this hiphog-exterior-marquee)) (dotimes (s5-0 1) (let ((a0-1 (-> this parts s5-0))) (if (nonzero? a0-1) @@ -3589,7 +3583,7 @@ ;; definition for method 7 of type hiphog-exterior-marquee ;; WARN: Return type mismatch process-drawable vs hiphog-exterior-marquee. -(defmethod relocate hiphog-exterior-marquee ((this hiphog-exterior-marquee) (arg0 int)) +(defmethod relocate ((this hiphog-exterior-marquee) (arg0 int)) (dotimes (v1-0 1) (if (nonzero? (-> this parts v1-0)) (&+! (-> this parts v1-0) arg0) @@ -3600,7 +3594,7 @@ ;; definition for method 21 of type hiphog-exterior-marquee ;; WARN: Return type mismatch symbol vs none. -(defmethod hiphog-exterior-marquee-method-21 hiphog-exterior-marquee ((this hiphog-exterior-marquee)) +(defmethod hiphog-exterior-marquee-method-21 ((this hiphog-exterior-marquee)) (+! (-> this parts 0 state-counter) 1) (when (!= (-> this parts 0 state-mode 0) (-> this mode)) (set! (-> this parts 0 state-mode 0) (-> this mode)) @@ -3649,7 +3643,7 @@ ;; definition for method 11 of type hiphog-exterior-marquee ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hiphog-exterior-marquee ((this hiphog-exterior-marquee) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hiphog-exterior-marquee) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3728,17 +3722,13 @@ This commonly includes things such as: ;; definition of type farthy (deftype farthy (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type farthy -(defmethod inspect farthy ((this farthy)) +(defmethod inspect ((this farthy)) (when (not this) (set! this this) (goto cfg-4) @@ -3786,7 +3776,7 @@ This commonly includes things such as: ;; definition for method 11 of type farthy ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farthy ((this farthy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this farthy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/city/port/portrun/portrun_REF.gc b/test/decompiler/reference/jak2/levels/city/port/portrun/portrun_REF.gc index 27fe8ee259d..66e82a03bf9 100644 --- a/test/decompiler/reference/jak2/levels/city/port/portrun/portrun_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/port/portrun/portrun_REF.gc @@ -191,7 +191,7 @@ ;; definition for method 15 of type hud-cargo ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-cargo ((this hud-cargo)) +(defmethod draw ((this hud-cargo)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -206,7 +206,7 @@ ;; definition for method 16 of type hud-cargo ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-cargo ((this hud-cargo)) +(defmethod update-values ((this hud-cargo)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -215,7 +215,7 @@ ;; definition for method 17 of type hud-cargo ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-cargo ((this hud-cargo)) +(defmethod init-callback ((this hud-cargo)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -258,28 +258,25 @@ ;; definition of type city-port-run-mine-info (deftype city-port-run-mine-info (structure) - ((handle handle :offset-assert 0) - (pos1-x float :offset-assert 8) - (pos1-y float :offset-assert 12) - (pos1-z float :offset-assert 16) - (type uint32 :offset-assert 20) - (pos2-x float :offset-assert 24) - (pos2-y float :offset-assert 28) - (pos2-z float :offset-assert 32) - (speed float :offset-assert 36) - (offset float :offset-assert 40) - (center-x float :offset 8) - (center-y float :offset 12) - (center-z float :offset 16) - (radius float :offset 24) + ((handle handle) + (pos1-x float) + (pos1-y float) + (pos1-z float) + (type uint32) + (pos2-x float) + (pos2-y float) + (pos2-z float) + (speed float) + (offset float) + (center-x float :overlay-at pos1-x) + (center-y float :overlay-at pos1-y) + (center-z float :overlay-at pos1-z) + (radius float :overlay-at pos2-x) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type city-port-run-mine-info -(defmethod inspect city-port-run-mine-info ((this city-port-run-mine-info)) +(defmethod inspect ((this city-port-run-mine-info)) (when (not this) (set! this this) (goto cfg-4) @@ -877,33 +874,31 @@ ;; definition of type ctyport-mine (deftype ctyport-mine (process-drawable) - ((root collide-shape-moving :override) - (info city-port-run-mine-info :offset-assert 200) - (base-height float :offset-assert 204) - (center vector :inline :offset-assert 208) - (time-skew uint64 :offset-assert 224) - (period float :offset-assert 232) - (trans-y float :offset-assert 236) - (speed-y float :offset-assert 240) - (acc-y float :offset-assert 244) - (beep basic :offset-assert 248) - (beep-time time-frame :offset-assert 256) - (beep-color vector :inline :offset-assert 272) + ((root collide-shape-moving :override) + (info city-port-run-mine-info) + (base-height float) + (center vector :inline) + (time-skew uint64) + (period float) + (trans-y float) + (speed-y float) + (acc-y float) + (beep basic) + (beep-time time-frame) + (beep-color vector :inline) ) - :heap-base #xa0 - :method-count-assert 24 - :size-assert #x120 - :flag-assert #x1800a00120 + (:state-methods + idle + die + fall + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (fall () _type_ :state 22) - (ctyport-mine-method-23 (_type_) none 23) + (ctyport-mine-method-23 (_type_) none) ) ) ;; definition for method 3 of type ctyport-mine -(defmethod inspect ctyport-mine ((this ctyport-mine)) +(defmethod inspect ((this ctyport-mine)) (when (not this) (set! this this) (goto cfg-4) @@ -928,7 +923,7 @@ ;; definition for method 23 of type ctyport-mine ;; WARN: Return type mismatch float vs none. -(defmethod ctyport-mine-method-23 ctyport-mine ((this ctyport-mine)) +(defmethod ctyport-mine-method-23 ((this ctyport-mine)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1245,19 +1240,15 @@ ;; definition of type ctyport-spy (deftype ctyport-spy (process-drawable) - ((trans-y float :offset-assert 200) + ((trans-y float) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xcc - :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type ctyport-spy -(defmethod inspect ctyport-spy ((this ctyport-spy)) +(defmethod inspect ((this ctyport-spy)) (when (not this) (set! this this) (goto cfg-4) @@ -1358,24 +1349,22 @@ ;; definition of type ctyport-cargo (deftype ctyport-cargo (process-focusable) - ((minimap connection-minimap :offset-assert 204) - (trans-y float :offset-assert 208) - (speed-y float :offset-assert 212) + ((minimap connection-minimap) + (trans-y float) + (speed-y float) ) - :heap-base #x60 - :method-count-assert 31 - :size-assert #xd8 - :flag-assert #x1f006000d8 + (:state-methods + idle + focus-camera + die + ) (:methods - (idle () _type_ :state 27) - (focus-camera () _type_ :state 28) - (die () _type_ :state 29) - (ctyport-cargo-method-30 (_type_) none 30) + (ctyport-cargo-method-30 (_type_) none) ) ) ;; definition for method 3 of type ctyport-cargo -(defmethod inspect ctyport-cargo ((this ctyport-cargo)) +(defmethod inspect ((this ctyport-cargo)) (when (not this) (set! this this) (goto cfg-4) @@ -1548,7 +1537,7 @@ ;; definition for method 30 of type ctyport-cargo ;; WARN: Return type mismatch int vs none. -(defmethod ctyport-cargo-method-30 ctyport-cargo ((this ctyport-cargo)) +(defmethod ctyport-cargo-method-30 ((this ctyport-cargo)) (send-event *camera* 'change-target this) (let ((gp-0 (new 'stack 'transformq))) (vector+! (-> gp-0 trans) (-> this root trans) (new 'static 'vector :y 16384.0 :z 28672.0 :w 1.0)) @@ -1685,15 +1674,12 @@ ;; definition of type city-port-run-cargo-info (deftype city-port-run-cargo-info (structure) - ((pos vector :inline :offset-assert 0) + ((pos vector :inline) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type city-port-run-cargo-info -(defmethod inspect city-port-run-cargo-info ((this city-port-run-cargo-info)) +(defmethod inspect ((this city-port-run-cargo-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc b/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc index dd8c64bc984..62774c59e49 100644 --- a/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc @@ -389,16 +389,12 @@ ;; definition of type errol-racer (deftype errol-racer (vehicle-rider) - ((minimap connection-minimap :offset-assert 224) + ((minimap connection-minimap) ) - :heap-base #x70 - :method-count-assert 36 - :size-assert #xe4 - :flag-assert #x24007000e4 ) ;; definition for method 3 of type errol-racer -(defmethod inspect errol-racer ((this errol-racer)) +(defmethod inspect ((this errol-racer)) (when (not this) (set! this this) (goto cfg-4) @@ -419,7 +415,7 @@ ;; definition for method 31 of type errol-racer ;; WARN: Return type mismatch int vs none. -(defmethod initialize-collision errol-racer ((this errol-racer)) +(defmethod initialize-collision ((this errol-racer)) (set! (-> this level) (level-get *level* 'lerlchal)) (stack-size-set! (-> this main-thread) 256) (when (not (-> this level)) @@ -433,7 +429,7 @@ ;; definition for method 32 of type errol-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-32 errol-racer ((this errol-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 ((this errol-racer) (arg0 traffic-object-spawn-params)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-errol-racer" (the-as (pointer uint32) #f))) @@ -499,14 +495,10 @@ ;; definition of type vehicle-city-racer (deftype vehicle-city-racer (vehicle-racer) () - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3f8 - :flag-assert #x9c038003f8 ) ;; definition for method 3 of type vehicle-city-racer -(defmethod inspect vehicle-city-racer ((this vehicle-city-racer)) +(defmethod inspect ((this vehicle-city-racer)) (when (not this) (set! this this) (goto cfg-4) @@ -520,7 +512,7 @@ ;; definition for method 117 of type vehicle-city-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-117 vehicle-city-racer ((this vehicle-city-racer) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 ((this vehicle-city-racer) (arg0 vector) (arg1 int) (arg2 int)) ((method-of-type vehicle vehicle-method-117) this arg0 arg1 arg2) 0 (none) @@ -528,7 +520,7 @@ ;; definition for method 137 of type vehicle-city-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-137 vehicle-city-racer ((this vehicle-city-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-137 ((this vehicle-city-racer) (arg0 traffic-object-spawn-params)) (let ((t9-0 vehicle-rider-spawn) (v1-0 (-> arg0 user-data)) ) @@ -547,7 +539,7 @@ ;; definition for method 154 of type vehicle-city-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-racer-method-154 vehicle-city-racer ((this vehicle-city-racer)) +(defmethod vehicle-racer-method-154 ((this vehicle-city-racer)) (cond ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) (let ((f0-0 368640.0)) @@ -585,14 +577,10 @@ ;; definition of type race-bike-a (deftype race-bike-a (vehicle-city-racer) () - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3f8 - :flag-assert #x9c038003f8 ) ;; definition for method 3 of type race-bike-a -(defmethod inspect race-bike-a ((this race-bike-a)) +(defmethod inspect ((this race-bike-a)) (when (not this) (set! this this) (goto cfg-4) @@ -606,13 +594,13 @@ ;; definition for method 7 of type race-bike-a ;; WARN: Return type mismatch vehicle-city-racer vs race-bike-a. -(defmethod relocate race-bike-a ((this race-bike-a) (arg0 int)) +(defmethod relocate ((this race-bike-a) (arg0 int)) (the-as race-bike-a ((method-of-type vehicle-city-racer relocate) this arg0)) ) ;; definition for method 32 of type race-bike-a ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape race-bike-a ((this race-bike-a)) +(defmethod allocate-and-init-cshape ((this race-bike-a)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -667,7 +655,7 @@ ;; definition for method 33 of type race-bike-a ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body race-bike-a ((this race-bike-a)) +(defmethod init-skel-and-rigid-body ((this race-bike-a)) (lwide-entity-hack) (initialize-skeleton this @@ -683,14 +671,10 @@ ;; definition of type race-bike-b (deftype race-bike-b (vehicle-city-racer) () - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3f8 - :flag-assert #x9c038003f8 ) ;; definition for method 3 of type race-bike-b -(defmethod inspect race-bike-b ((this race-bike-b)) +(defmethod inspect ((this race-bike-b)) (when (not this) (set! this this) (goto cfg-4) @@ -704,13 +688,13 @@ ;; definition for method 7 of type race-bike-b ;; WARN: Return type mismatch vehicle-racer vs race-bike-b. -(defmethod relocate race-bike-b ((this race-bike-b) (arg0 int)) +(defmethod relocate ((this race-bike-b) (arg0 int)) (the-as race-bike-b ((method-of-type vehicle-racer relocate) this arg0)) ) ;; definition for method 32 of type race-bike-b ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape race-bike-b ((this race-bike-b)) +(defmethod allocate-and-init-cshape ((this race-bike-b)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -765,7 +749,7 @@ ;; definition for method 33 of type race-bike-b ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body race-bike-b ((this race-bike-b)) +(defmethod init-skel-and-rigid-body ((this race-bike-b)) (lwide-entity-hack) (initialize-skeleton this @@ -780,32 +764,30 @@ ;; definition of type turbo-ring (deftype turbo-ring (process-drawable) - ((root collide-shape :override) - (touch-time time-frame :offset-assert 200) - (minimap connection-minimap :offset-assert 208) - (player-got symbol :offset-assert 212) - (persistent symbol :offset-assert 216) - (id int8 :offset-assert 220) - (boost float :offset-assert 224) - (plane vector :inline :offset-assert 240) - (part-track handle :offset-assert 256) - (mat matrix :inline :offset-assert 272) + ((root collide-shape :override) + (touch-time time-frame) + (minimap connection-minimap) + (player-got symbol) + (persistent symbol) + (id int8) + (boost float) + (plane vector :inline) + (part-track handle) + (mat matrix :inline) ) - :heap-base #xd0 - :method-count-assert 25 - :size-assert #x150 - :flag-assert #x1900d00150 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (turbo-ring-method-22 (_type_) none 22) - (turbo-ring-method-23 (_type_) none 23) - (turbo-ring-method-24 (_type_) none 24) + (turbo-ring-method-22 (_type_) none) + (turbo-ring-method-23 (_type_) none) + (turbo-ring-method-24 (_type_) none) ) ) ;; definition for method 3 of type turbo-ring -(defmethod inspect turbo-ring ((this turbo-ring)) +(defmethod inspect ((this turbo-ring)) (when (not this) (set! this this) (goto cfg-4) @@ -919,7 +901,7 @@ ;; definition for method 22 of type turbo-ring ;; WARN: Return type mismatch int vs none. -(defmethod turbo-ring-method-22 turbo-ring ((this turbo-ring)) +(defmethod turbo-ring-method-22 ((this turbo-ring)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrate-using) (the-as penetrate -1)) (set! (-> s5-0 penetrated-by) (the-as penetrate -1)) @@ -944,7 +926,7 @@ ;; definition for method 23 of type turbo-ring ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod turbo-ring-method-23 turbo-ring ((this turbo-ring)) +(defmethod turbo-ring-method-23 ((this turbo-ring)) (let ((s5-0 (-> this mat))) (let ((s4-0 (new 'stack-no-clear 'quaternion))) (quaternion-rotate-local-y! s4-0 (-> this root quat) 16384.0) diff --git a/test/decompiler/reference/jak2/levels/city/power/ctypower_REF.gc b/test/decompiler/reference/jak2/levels/city/power/ctypower_REF.gc index cfced2d22db..d44edbc3030 100644 --- a/test/decompiler/reference/jak2/levels/city/power/ctypower_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/power/ctypower_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 15 of type hud-turret ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-turret ((this hud-turret)) +(defmethod draw ((this hud-turret)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -18,7 +18,7 @@ ;; definition for method 16 of type hud-turret ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-turret ((this hud-turret)) +(defmethod update-values ((this hud-turret)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -27,7 +27,7 @@ ;; definition for method 17 of type hud-turret ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-turret ((this hud-turret)) +(defmethod init-callback ((this hud-turret)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) diff --git a/test/decompiler/reference/jak2/levels/city/protect/protect_REF.gc b/test/decompiler/reference/jak2/levels/city/protect/protect_REF.gc index f86fc3706eb..adf1deeecb5 100644 --- a/test/decompiler/reference/jak2/levels/city/protect/protect_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/protect/protect_REF.gc @@ -9,24 +9,22 @@ ;; definition of type seal-of-mar (deftype seal-of-mar (process-drawable) - ((attach-object uint64 :offset-assert 200) - (scale float :offset-assert 208) - (trans-y float :offset-assert 212) + ((attach-object uint64) + (scale float) + (trans-y float) ) - :heap-base #x60 - :method-count-assert 24 - :size-assert #xd8 - :flag-assert #x18006000d8 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (seal-of-mar-method-22 (_type_) none 22) - (seal-of-mar-method-23 (_type_) none 23) + (seal-of-mar-method-22 (_type_) none) + (seal-of-mar-method-23 (_type_) none) ) ) ;; definition for method 3 of type seal-of-mar -(defmethod inspect seal-of-mar ((this seal-of-mar)) +(defmethod inspect ((this seal-of-mar)) (when (not this) (set! this this) (goto cfg-4) @@ -43,7 +41,7 @@ ;; definition for method 22 of type seal-of-mar ;; WARN: Return type mismatch int vs none. -(defmethod seal-of-mar-method-22 seal-of-mar ((this seal-of-mar)) +(defmethod seal-of-mar-method-22 ((this seal-of-mar)) (set! (-> this root) (new 'process 'trsqv)) 0 (none) @@ -51,7 +49,7 @@ ;; definition for method 23 of type seal-of-mar ;; WARN: Return type mismatch int vs none. -(defmethod seal-of-mar-method-23 seal-of-mar ((this seal-of-mar)) +(defmethod seal-of-mar-method-23 ((this seal-of-mar)) (with-pp (set! (-> pp level) (level-get *level* 'lprotect)) (initialize-skeleton @@ -87,7 +85,7 @@ ;; definition for method 11 of type seal-of-mar ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! seal-of-mar ((this seal-of-mar) (arg0 entity-actor)) +(defmethod init-from-entity! ((this seal-of-mar) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -124,21 +122,18 @@ This commonly includes things such as: ;; definition of type city-slums-transport-info (deftype city-slums-transport-info (structure) - ((id uint32 :offset-assert 0) - (spawned basic :offset-assert 4) - (plane-pos vector :inline :offset-assert 16) - (plane-quat quaternion :inline :offset-assert 32) - (t-pos vector :inline :offset-assert 48) - (t-quat quaternion :inline :offset-assert 64) - (num-guard uint32 :offset-assert 80) + ((id uint32) + (spawned basic) + (plane-pos vector :inline) + (plane-quat quaternion :inline) + (t-pos vector :inline) + (t-quat quaternion :inline) + (num-guard uint32) ) - :method-count-assert 9 - :size-assert #x54 - :flag-assert #x900000054 ) ;; definition for method 3 of type city-slums-transport-info -(defmethod inspect city-slums-transport-info ((this city-slums-transport-info)) +(defmethod inspect ((this city-slums-transport-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/sack/collection-task_REF.gc b/test/decompiler/reference/jak2/levels/city/sack/collection-task_REF.gc index ec52aea57f0..bce235f630a 100644 --- a/test/decompiler/reference/jak2/levels/city/sack/collection-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/sack/collection-task_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 15 of type hud-moneybag ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-moneybag ((this hud-moneybag)) +(defmethod draw ((this hud-moneybag)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 462.0 (* 130.0 (-> this offset)))) @@ -18,7 +18,7 @@ ;; definition for method 16 of type hud-moneybag ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-moneybag ((this hud-moneybag)) +(defmethod update-values ((this hud-moneybag)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -27,7 +27,7 @@ ;; definition for method 17 of type hud-moneybag ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-moneybag ((this hud-moneybag)) +(defmethod init-callback ((this hud-moneybag)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -54,19 +54,17 @@ ;; definition of type krew-collection-item (deftype krew-collection-item (process-drawable) () - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc8 - :flag-assert #x17005000c8 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (find-ground (_type_) symbol 22) + (find-ground (_type_) symbol) ) ) ;; definition for method 3 of type krew-collection-item -(defmethod inspect krew-collection-item ((this krew-collection-item)) +(defmethod inspect ((this krew-collection-item)) (when (not this) (set! this this) (goto cfg-4) @@ -80,7 +78,7 @@ ;; definition for method 22 of type krew-collection-item ;; INFO: Used lq/sq -(defmethod find-ground krew-collection-item ((this krew-collection-item)) +(defmethod find-ground ((this krew-collection-item)) "TODO - understand the collision query stuff more @returns whether or not the [[self]] is above the ground" (let ((on-ground? #f)) diff --git a/test/decompiler/reference/jak2/levels/city/shuttle/shuttle_REF.gc b/test/decompiler/reference/jak2/levels/city/shuttle/shuttle_REF.gc index 1e0e04962f8..6412913df89 100644 --- a/test/decompiler/reference/jak2/levels/city/shuttle/shuttle_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/shuttle/shuttle_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 15 of type hud-citizen ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-citizen ((this hud-citizen)) +(defmethod draw ((this hud-citizen)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 452.0 (* 130.0 (-> this offset)))) @@ -18,7 +18,7 @@ ;; definition for method 16 of type hud-citizen ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-citizen ((this hud-citizen)) +(defmethod update-values ((this hud-citizen)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -27,7 +27,7 @@ ;; definition for method 17 of type hud-citizen ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-citizen ((this hud-citizen)) +(defmethod init-callback ((this hud-citizen)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -252,21 +252,17 @@ ;; definition of type citizen-rebel (deftype citizen-rebel (citizen-norm) - ((nav-mesh-aid actor-id :offset-assert 1060) - (done? symbol :offset-assert 1064) - (task-node uint16 :offset-assert 1068) - (end-pos vector :inline :offset-assert 1072) - (index uint32 :offset-assert 1088) - (gui-id sound-id :offset-assert 1092) + ((nav-mesh-aid actor-id) + (done? symbol) + (task-node uint16) + (end-pos vector :inline) + (index uint32) + (gui-id sound-id) ) - :heap-base #x3d0 - :method-count-assert 219 - :size-assert #x448 - :flag-assert #xdb03d00448 ) ;; definition for method 3 of type citizen-rebel -(defmethod inspect citizen-rebel ((this citizen-rebel)) +(defmethod inspect ((this citizen-rebel)) (when (not this) (set! this this) (goto cfg-4) @@ -285,7 +281,7 @@ ) ;; definition for method 17 of type citizen-rebel -(defmethod cleanup-for-death citizen-rebel ((this citizen-rebel)) +(defmethod cleanup-for-death ((this citizen-rebel)) (with-pp (when (and (zero? (-> this hit-points)) (not (-> this done?))) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -674,7 +670,7 @@ ;; definition for method 74 of type citizen-rebel ;; WARN: disable def twice: 51. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler citizen-rebel ((this citizen-rebel) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this citizen-rebel) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -723,7 +719,7 @@ ) ;; definition for method 58 of type citizen-rebel -(defmethod enemy-method-58 citizen-rebel ((this citizen-rebel) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 ((this citizen-rebel) (arg0 process) (arg1 event-message-block)) (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) (v0-0 (t9-0 this arg0 arg1)) ) @@ -735,7 +731,7 @@ ) ;; definition for method 59 of type citizen-rebel -(defmethod get-penetrate-info citizen-rebel ((this citizen-rebel)) +(defmethod get-penetrate-info ((this citizen-rebel)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (let ((v1-1 ((method-of-type nav-enemy get-penetrate-info) this))) @@ -800,7 +796,7 @@ ;; definition for method 115 of type citizen-rebel ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! citizen-rebel ((this citizen-rebel)) +(defmethod init-enemy! ((this citizen-rebel)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -887,7 +883,7 @@ ;; definition for method 114 of type citizen-rebel ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! citizen-rebel ((this citizen-rebel)) +(defmethod init-enemy-collision! ((this citizen-rebel)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -953,7 +949,7 @@ ;; definition for method 181 of type citizen-rebel ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! citizen-rebel ((this citizen-rebel)) +(defmethod citizen-init! ((this citizen-rebel)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) (t9-0 this) @@ -997,18 +993,15 @@ ;; definition of type city-shuttle-info (deftype city-shuttle-info (structure) - ((pos vector :inline :offset-assert 0) - (level symbol :offset-assert 16) - (nav-mesh-id uint32 :offset-assert 20) - (time time-frame :offset-assert 24) + ((pos vector :inline) + (level symbol) + (nav-mesh-id uint32) + (time time-frame) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type city-shuttle-info -(defmethod inspect city-shuttle-info ((this city-shuttle-info)) +(defmethod inspect ((this city-shuttle-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/slums/ctysluma-part_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/ctysluma-part_REF.gc index eea8331b0e2..f83a42da1ee 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/ctysluma-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/ctysluma-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctysluma-part (deftype ctysluma-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctysluma-part -(defmethod inspect ctysluma-part ((this ctysluma-part)) +(defmethod inspect ((this ctysluma-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/slums/ctyslumb-part_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/ctyslumb-part_REF.gc index 5fb05dd4d3a..9618bf009e2 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/ctyslumb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/ctyslumb-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctyslumb-part (deftype ctyslumb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctyslumb-part -(defmethod inspect ctyslumb-part ((this ctyslumb-part)) +(defmethod inspect ((this ctyslumb-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/slums/ctyslumc-part_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/ctyslumc-part_REF.gc index be094d02cd0..aac239a2863 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/ctyslumc-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/ctyslumc-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ctyslumc-part (deftype ctyslumc-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ctyslumc-part -(defmethod inspect ctyslumc-part ((this ctyslumc-part)) +(defmethod inspect ((this ctyslumc-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-h_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-h_REF.gc index a941cb0f846..e1b09e69751 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-h_REF.gc @@ -3,30 +3,28 @@ ;; definition of type kid (deftype kid (bot) - ((travel-anim-interp float :offset-assert 992) - (arrest-attempt-time time-frame :offset-assert 1000) - (arrestor-handle handle :offset-assert 1008) + ((travel-anim-interp float) + (arrest-attempt-time time-frame) + (arrestor-handle handle) ) - :heap-base #x380 - :method-count-assert 235 - :size-assert #x3f8 - :flag-assert #xeb038003f8 + (:state-methods + traveling + traveling-blocked + waiting-with-kor + waiting-idle + waiting-turn + scared-idle + arrested + ) (:methods - (traveling () _type_ :state 225) - (traveling-blocked () _type_ :state 226) - (waiting-with-kor () _type_ :state 227) - (waiting-idle () _type_ :state 228) - (waiting-turn () _type_ :state 229) - (scared-idle () _type_ :state 230) - (arrested () _type_ :state 231) - (kid-method-232 (_type_) none 232) - (kid-method-233 (_type_) none 233) - (kid-method-234 (_type_) none 234) + (kid-method-232 (_type_) none) + (kid-method-233 (_type_) none) + (kid-method-234 (_type_) none) ) ) ;; definition for method 3 of type kid -(defmethod inspect kid ((this kid)) +(defmethod inspect ((this kid)) (when (not this) (set! this this) (goto cfg-4) @@ -51,18 +49,15 @@ ;; definition of type kidt-wait-spot (deftype kidt-wait-spot (ai-task) - ((check-done (function kidt-wait-spot kid symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function kidt-wait-spot kid symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type kidt-wait-spot -(defmethod inspect kidt-wait-spot ((this kidt-wait-spot)) +(defmethod inspect ((this kidt-wait-spot)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-task_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-task_REF.gc index d22fc2b4f22..b367075a86a 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-task_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type kidt-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! kidt-wait-spot ((this kidt-wait-spot)) +(defmethod reset-task! ((this kidt-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -13,7 +13,7 @@ ;; definition for method 11 of type kidt-wait-spot ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 kidt-wait-spot ((this kidt-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this kidt-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc index 5ce9edd4c79..582243cfe6b 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc @@ -177,7 +177,7 @@ (set! (-> *kid-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type kid -(defmethod general-event-handler kid ((this kid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this kid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -226,7 +226,7 @@ ) ;; definition for method 97 of type kid -(defmethod enemy-method-97 kid ((this kid)) +(defmethod enemy-method-97 ((this kid)) (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -344,7 +344,7 @@ ) ;; definition for method 183 of type kid -(defmethod alive? kid ((this kid)) +(defmethod alive? ((this kid)) (let ((t9-0 (method-of-type bot alive?))) (and (t9-0 this) (not (and (-> this next-state) (let ((v1-4 (-> this next-state name))) @@ -359,7 +359,7 @@ ;; definition for method 114 of type kid ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! kid ((this kid)) +(defmethod init-enemy-collision! ((this kid)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -434,7 +434,7 @@ ;; definition for method 210 of type kid ;; WARN: Return type mismatch int vs none. -(defmethod init! kid ((this kid)) +(defmethod init! ((this kid)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) (t9-0 this) @@ -454,7 +454,7 @@ ;; definition for method 115 of type kid ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! kid ((this kid)) +(defmethod init-enemy! ((this kid)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (initialize-skeleton @@ -479,33 +479,33 @@ ) ;; definition for method 214 of type kid -(defmethod bot-method-214 kid ((this kid)) +(defmethod bot-method-214 ((this kid)) #f ) ;; definition for method 70 of type kid ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile kid ((this kid)) +(defmethod go-hostile ((this kid)) (kid-method-232 this) ) ;; definition for method 72 of type kid ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus kid ((this kid)) +(defmethod react-to-focus ((this kid)) "@TODO - flesh out docs" (kid-method-232 this) ) ;; definition for method 233 of type kid ;; WARN: Return type mismatch object vs none. -(defmethod kid-method-233 kid ((this kid)) +(defmethod kid-method-233 ((this kid)) (go (method-of-object this waiting-turn)) (none) ) ;; definition for method 232 of type kid ;; WARN: Return type mismatch object vs none. -(defmethod kid-method-232 kid ((this kid)) +(defmethod kid-method-232 ((this kid)) (let ((s5-0 (handle->process (-> this arrestor-handle)))) (cond ((if (type? s5-0 process-focusable) @@ -526,7 +526,7 @@ ;; definition for method 234 of type kid ;; WARN: Return type mismatch int vs none. -(defmethod kid-method-234 kid ((this kid)) +(defmethod kid-method-234 ((this kid)) (with-pp (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 6144.0 22528.0))) @@ -584,7 +584,7 @@ ) ;; definition for method 56 of type kid -(defmethod damage-amount-from-attack kid ((this kid) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this kid) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (if (= (-> this course course-id) 7) 0 @@ -593,12 +593,12 @@ ) ;; definition for method 190 of type kid -(defmethod bot-method-190 kid ((this kid)) +(defmethod bot-method-190 ((this kid)) #t ) ;; definition for method 78 of type kid -(defmethod enemy-method-78 kid ((this kid) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this kid) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -614,7 +614,7 @@ ;; definition for method 198 of type kid ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! kid ((this kid) (arg0 vector)) +(defmethod set-cam-height! ((this kid) (arg0 vector)) (the-as meters (cond @@ -633,7 +633,7 @@ ) ;; definition for method 102 of type kid -(defmethod enemy-method-102 kid ((this kid)) +(defmethod enemy-method-102 ((this kid)) (if (logtest? (bot-flags bf20) (-> this bot-flags)) #f ((method-of-type bot enemy-method-102) this) @@ -642,7 +642,7 @@ ;; definition for method 116 of type kid ;; WARN: Return type mismatch object vs none. -(defmethod go-idle kid ((this kid)) +(defmethod go-idle ((this kid)) (cond ((= (-> this course course-id) 7) (cond diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-h_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-h_REF.gc index c2504945451..41d2b755195 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-h_REF.gc @@ -3,30 +3,28 @@ ;; definition of type kor (deftype kor (bot) - ((travel-anim-interp float :offset-assert 992) - (arrest-attempt-time time-frame :offset-assert 1000) - (arrestor-handle handle :offset-assert 1008) + ((travel-anim-interp float) + (arrest-attempt-time time-frame) + (arrestor-handle handle) ) - :heap-base #x380 - :method-count-assert 235 - :size-assert #x3f8 - :flag-assert #xeb038003f8 + (:state-methods + traveling + traveling-blocked + waiting-with-kid + waiting-idle + waiting-turn + scared-idle + arrested + ) (:methods - (traveling () _type_ :state 225) - (traveling-blocked () _type_ :state 226) - (waiting-with-kid () _type_ :state 227) - (waiting-idle () _type_ :state 228) - (waiting-turn () _type_ :state 229) - (scared-idle () _type_ :state 230) - (arrested () _type_ :state 231) - (kor-method-232 (_type_) none 232) - (kor-method-233 (_type_) none 233) - (kor-method-234 (_type_) none 234) + (kor-method-232 (_type_) none) + (kor-method-233 (_type_) none) + (kor-method-234 (_type_) none) ) ) ;; definition for method 3 of type kor -(defmethod inspect kor ((this kor)) +(defmethod inspect ((this kor)) (when (not this) (set! this this) (goto cfg-4) @@ -51,18 +49,15 @@ ;; definition of type kort-wait-spot (deftype kort-wait-spot (ai-task) - ((check-done (function kort-wait-spot kor symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function kort-wait-spot kor symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type kort-wait-spot -(defmethod inspect kort-wait-spot ((this kort-wait-spot)) +(defmethod inspect ((this kort-wait-spot)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-task_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-task_REF.gc index a9b6f2631aa..3f5a36ebaa5 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-task_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type kort-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! kort-wait-spot ((this kort-wait-spot)) +(defmethod reset-task! ((this kort-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -13,7 +13,7 @@ ;; definition for method 11 of type kort-wait-spot ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 kort-wait-spot ((this kort-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this kort-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc index 7f578334347..3d1ce7f5a76 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc @@ -3,15 +3,12 @@ ;; definition of type kor-anim-info (deftype kor-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type kor-anim-info -(defmethod inspect kor-anim-info ((this kor-anim-info)) +(defmethod inspect ((this kor-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -198,7 +195,7 @@ (set! (-> *kor-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type kor -(defmethod general-event-handler kor ((this kor) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this kor) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -242,7 +239,7 @@ ) ;; definition for method 97 of type kor -(defmethod enemy-method-97 kor ((this kor)) +(defmethod enemy-method-97 ((this kor)) (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -360,7 +357,7 @@ ) ;; definition for method 183 of type kor -(defmethod alive? kor ((this kor)) +(defmethod alive? ((this kor)) (let ((t9-0 (method-of-type bot alive?))) (and (t9-0 this) (not (and (-> this next-state) (let ((v1-4 (-> this next-state name))) @@ -375,7 +372,7 @@ ;; definition for method 114 of type kor ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! kor ((this kor)) +(defmethod init-enemy-collision! ((this kor)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -450,7 +447,7 @@ ;; definition for method 210 of type kor ;; WARN: Return type mismatch int vs none. -(defmethod init! kor ((this kor)) +(defmethod init! ((this kor)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) (t9-0 this) @@ -470,7 +467,7 @@ ;; definition for method 115 of type kor ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! kor ((this kor)) +(defmethod init-enemy! ((this kor)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (initialize-skeleton @@ -495,33 +492,33 @@ ) ;; definition for method 214 of type kor -(defmethod bot-method-214 kor ((this kor)) +(defmethod bot-method-214 ((this kor)) #f ) ;; definition for method 70 of type kor ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile kor ((this kor)) +(defmethod go-hostile ((this kor)) (kor-method-232 this) ) ;; definition for method 72 of type kor ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus kor ((this kor)) +(defmethod react-to-focus ((this kor)) "@TODO - flesh out docs" (kor-method-232 this) ) ;; definition for method 233 of type kor ;; WARN: Return type mismatch object vs none. -(defmethod kor-method-233 kor ((this kor)) +(defmethod kor-method-233 ((this kor)) (go (method-of-object this waiting-turn)) (none) ) ;; definition for method 232 of type kor ;; WARN: Return type mismatch object vs none. -(defmethod kor-method-232 kor ((this kor)) +(defmethod kor-method-232 ((this kor)) (let ((s5-0 (handle->process (-> this arrestor-handle)))) (cond ((if (type? s5-0 process-focusable) @@ -542,7 +539,7 @@ ;; definition for method 234 of type kor ;; WARN: Return type mismatch int vs none. -(defmethod kor-method-234 kor ((this kor)) +(defmethod kor-method-234 ((this kor)) (with-pp (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 6144.0 20889.6))) @@ -600,18 +597,18 @@ ) ;; definition for method 56 of type kor -(defmethod damage-amount-from-attack kor ((this kor) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this kor) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) ;; definition for method 190 of type kor -(defmethod bot-method-190 kor ((this kor)) +(defmethod bot-method-190 ((this kor)) #t ) ;; definition for method 78 of type kor -(defmethod enemy-method-78 kor ((this kor) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this kor) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -627,7 +624,7 @@ ;; definition for method 198 of type kor ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! kor ((this kor) (arg0 vector)) +(defmethod set-cam-height! ((this kor) (arg0 vector)) (the-as meters (cond @@ -646,7 +643,7 @@ ) ;; definition for method 102 of type kor -(defmethod enemy-method-102 kor ((this kor)) +(defmethod enemy-method-102 ((this kor)) (if (logtest? (bot-flags bf20) (-> this bot-flags)) #f ((method-of-type bot enemy-method-102) this) @@ -655,7 +652,7 @@ ;; definition for method 116 of type kor ;; WARN: Return type mismatch object vs none. -(defmethod go-idle kor ((this kor)) +(defmethod go-idle ((this kor)) (cond ((= (-> this course course-id) 8) (cond diff --git a/test/decompiler/reference/jak2/levels/city/slums/neon-baron-part_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/neon-baron-part_REF.gc index f1b19e64da8..9c273ba9d55 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/neon-baron-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/neon-baron-part_REF.gc @@ -3256,27 +3256,25 @@ ;; definition of type neon-baron (deftype neon-baron (process) - ((flags int64 :offset-assert 128) - (master-enable int64 :offset-assert 136) - (mode int64 :offset-assert 144) - (sign (array object) :offset-assert 152) - (parts sparticle-launch-control 1 :offset-assert 156) - (state-time time-frame :offset-assert 160) - (mat matrix :inline :offset-assert 176) + ((flags int64) + (master-enable int64) + (mode int64) + (sign (array object)) + (parts sparticle-launch-control 1) + (state-time time-frame) + (mat matrix :inline) ) - :heap-base #x70 - :method-count-assert 17 - :size-assert #xf0 - :flag-assert #x11007000f0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (spawn-parts (_type_) none 15) - (update-mode (_type_) none 16) + (spawn-parts (_type_) none) + (update-mode (_type_) none) ) ) ;; definition for method 3 of type neon-baron -(defmethod inspect neon-baron ((this neon-baron)) +(defmethod inspect ((this neon-baron)) (when (not this) (set! this this) (goto cfg-4) @@ -3296,7 +3294,7 @@ ) ;; definition for method 10 of type neon-baron -(defmethod deactivate neon-baron ((this neon-baron)) +(defmethod deactivate ((this neon-baron)) (dotimes (s5-0 1) (let ((a0-1 (-> this parts s5-0))) (if (nonzero? a0-1) @@ -3310,7 +3308,7 @@ ;; definition for method 7 of type neon-baron ;; WARN: Return type mismatch process vs neon-baron. -(defmethod relocate neon-baron ((this neon-baron) (arg0 int)) +(defmethod relocate ((this neon-baron) (arg0 int)) (dotimes (v1-0 1) (if (nonzero? (-> this parts v1-0)) (&+! (-> this parts v1-0) arg0) @@ -3321,7 +3319,7 @@ ;; definition for method 15 of type neon-baron ;; WARN: Return type mismatch symbol vs none. -(defmethod spawn-parts neon-baron ((this neon-baron)) +(defmethod spawn-parts ((this neon-baron)) (+! (-> this parts 0 state-counter) 1) (when (!= (-> this parts 0 state-mode 0) (-> this flags)) (set! (-> this parts 0 state-mode 0) (the-as uint (-> this flags))) @@ -3341,7 +3339,7 @@ ;; definition for method 16 of type neon-baron ;; WARN: Return type mismatch int vs none. -(defmethod update-mode neon-baron ((this neon-baron)) +(defmethod update-mode ((this neon-baron)) (set! (-> this mode) (rand-vu-int-count-excluding 12 (ash 1 (-> this mode)))) (none) ) @@ -3592,7 +3590,7 @@ ;; definition for method 11 of type neon-baron ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! neon-baron ((this neon-baron) (arg0 entity-actor)) +(defmethod init-from-entity! ((this neon-baron) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3624,14 +3622,10 @@ This commonly includes things such as: ;; definition of type hide-door-a (deftype hide-door-a (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type hide-door-a -(defmethod inspect hide-door-a ((this hide-door-a)) +(defmethod inspect ((this hide-door-a)) (when (not this) (set! this this) (goto cfg-4) @@ -3645,7 +3639,7 @@ This commonly includes things such as: ;; definition for method 11 of type hide-door-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hide-door-a ((this hide-door-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hide-door-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-chick_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-chick_REF.gc index 701adeb6fa2..a01ea154308 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-chick_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-chick_REF.gc @@ -37,14 +37,10 @@ ;; definition of type citizen-chick (deftype citizen-chick (civilian) () - :heap-base #x3b0 - :method-count-assert 218 - :size-assert #x424 - :flag-assert #xda03b00424 ) ;; definition for method 3 of type citizen-chick -(defmethod inspect citizen-chick ((this citizen-chick)) +(defmethod inspect ((this citizen-chick)) (when (not this) (set! this this) (goto cfg-4) @@ -231,13 +227,13 @@ (set! (-> *citizen-chick-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 26 of type citizen-chick -(defmethod get-inv-mass citizen-chick ((this citizen-chick)) +(defmethod get-inv-mass ((this citizen-chick)) 0.5 ) ;; definition for method 51 of type citizen-chick ;; INFO: Used lq/sq -(defmethod enemy-method-51 citizen-chick ((this citizen-chick)) +(defmethod enemy-method-51 ((this citizen-chick)) (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) @@ -298,7 +294,7 @@ ) ;; definition for method 79 of type citizen-chick -(defmethod enemy-method-79 citizen-chick ((this citizen-chick) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this citizen-chick) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((1) (case (-> this incoming knocked-type) @@ -349,7 +345,7 @@ ) ;; definition for method 77 of type citizen-chick -(defmethod enemy-method-77 citizen-chick ((this citizen-chick) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this citizen-chick) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.01)) @@ -427,7 +423,7 @@ ) ;; definition for method 78 of type citizen-chick -(defmethod enemy-method-78 citizen-chick ((this citizen-chick) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this citizen-chick) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) @@ -533,7 +529,7 @@ ;; definition for method 114 of type citizen-chick ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! citizen-chick ((this citizen-chick)) +(defmethod init-enemy-collision! ((this citizen-chick)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -593,7 +589,7 @@ ;; definition for method 115 of type citizen-chick ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! citizen-chick ((this citizen-chick)) +(defmethod init-enemy! ((this citizen-chick)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -680,7 +676,7 @@ ;; definition for method 181 of type citizen-chick ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! citizen-chick ((this citizen-chick)) +(defmethod citizen-init! ((this citizen-chick)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) (t9-0 this) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-enemy_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-enemy_REF.gc index 0898097ae1b..b7f8707f895 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-enemy_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-enemy_REF.gc @@ -3,21 +3,17 @@ ;; definition of type citizen-enemy (deftype citizen-enemy (citizen) - ((next-update-target time-frame :offset-assert 968) - (minimap connection-minimap :offset-assert 976) + ((next-update-target time-frame) + (minimap connection-minimap) ) - :heap-base #x360 - :method-count-assert 203 - :size-assert #x3d4 - :flag-assert #xcb036003d4 (:methods - (traffic-danger-init! (_type_) none 201) - (citizen-enemy-method-202 (_type_) none 202) + (traffic-danger-init! (_type_) none) + (citizen-enemy-method-202 (_type_) none) ) ) ;; definition for method 3 of type citizen-enemy -(defmethod inspect citizen-enemy ((this citizen-enemy)) +(defmethod inspect ((this citizen-enemy)) (when (not this) (set! this this) (goto cfg-4) @@ -32,7 +28,7 @@ ) ;; definition for method 55 of type citizen-enemy -(defmethod track-target! citizen-enemy ((this citizen-enemy)) +(defmethod track-target! ((this citizen-enemy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -59,7 +55,7 @@ ;; definition for method 76 of type citizen-enemy ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 citizen-enemy ((this citizen-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 ((this citizen-enemy) (arg0 process) (arg1 event-message-block)) (the-as symbol (cond @@ -117,7 +113,7 @@ ) ;; definition for method 74 of type citizen-enemy -(defmethod general-event-handler citizen-enemy ((this citizen-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this citizen-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -161,7 +157,7 @@ ;; definition for method 201 of type citizen-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod traffic-danger-init! citizen-enemy ((this citizen-enemy)) +(defmethod traffic-danger-init! ((this citizen-enemy)) (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) @@ -181,7 +177,7 @@ ;; definition for method 202 of type citizen-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod citizen-enemy-method-202 citizen-enemy ((this citizen-enemy)) +(defmethod citizen-enemy-method-202 ((this citizen-enemy)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> this root trans quad)) (set! (-> s5-0 w) 122880.0) @@ -277,7 +273,7 @@ ;; definition for method 181 of type citizen-enemy ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! citizen-enemy ((this citizen-enemy)) +(defmethod citizen-init! ((this citizen-enemy)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen citizen-init!))) (t9-0 this) @@ -315,19 +311,19 @@ ) ;; definition for method 73 of type citizen-enemy -(defmethod kill-prefer-falling citizen-enemy ((this citizen-enemy)) +(defmethod kill-prefer-falling ((this citizen-enemy)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" ((method-of-type nav-enemy kill-prefer-falling) this) ) ;; definition for method 70 of type citizen-enemy -(defmethod go-hostile citizen-enemy ((this citizen-enemy)) +(defmethod go-hostile ((this citizen-enemy)) (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) (go (method-of-object this hostile)) ) ) ;; definition for method 67 of type citizen-enemy -(defmethod go-stare citizen-enemy ((this citizen-enemy)) +(defmethod go-stare ((this citizen-enemy)) (go (method-of-object this active)) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-fat_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-fat_REF.gc index 4828bd60fc7..bc2552dabd7 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-fat_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-fat_REF.gc @@ -37,14 +37,10 @@ ;; definition of type citizen-fat (deftype citizen-fat (civilian) () - :heap-base #x3b0 - :method-count-assert 218 - :size-assert #x424 - :flag-assert #xda03b00424 ) ;; definition for method 3 of type citizen-fat -(defmethod inspect citizen-fat ((this citizen-fat)) +(defmethod inspect ((this citizen-fat)) (when (not this) (set! this this) (goto cfg-4) @@ -231,13 +227,13 @@ (set! (-> *citizen-fat-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 26 of type citizen-fat -(defmethod get-inv-mass citizen-fat ((this citizen-fat)) +(defmethod get-inv-mass ((this citizen-fat)) 0.5 ) ;; definition for method 51 of type citizen-fat ;; INFO: Used lq/sq -(defmethod enemy-method-51 citizen-fat ((this citizen-fat)) +(defmethod enemy-method-51 ((this citizen-fat)) (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) @@ -298,7 +294,7 @@ ) ;; definition for method 79 of type citizen-fat -(defmethod enemy-method-79 citizen-fat ((this citizen-fat) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this citizen-fat) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((1) (case (-> this incoming knocked-type) @@ -349,7 +345,7 @@ ) ;; definition for method 77 of type citizen-fat -(defmethod enemy-method-77 citizen-fat ((this citizen-fat) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this citizen-fat) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.01)) @@ -427,7 +423,7 @@ ) ;; definition for method 78 of type citizen-fat -(defmethod enemy-method-78 citizen-fat ((this citizen-fat) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this citizen-fat) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) @@ -570,7 +566,7 @@ ;; definition for method 114 of type citizen-fat ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! citizen-fat ((this citizen-fat)) +(defmethod init-enemy-collision! ((this citizen-fat)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -630,7 +626,7 @@ ;; definition for method 115 of type citizen-fat ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! citizen-fat ((this citizen-fat)) +(defmethod init-enemy! ((this citizen-fat)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -714,7 +710,7 @@ ;; definition for method 181 of type citizen-fat ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! citizen-fat ((this citizen-fat)) +(defmethod citizen-init! ((this citizen-fat)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) (t9-0 this) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-h_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-h_REF.gc index 02bb3df96ab..032c0f14d7e 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-h_REF.gc @@ -3,70 +3,68 @@ ;; definition of type citizen (deftype citizen (nav-enemy) - ((flags citizen-flag :offset-assert 604) - (traffic-id int8 :offset-assert 606) - (hit-by-player-count int8 :offset-assert 607) - (gnd-height float :offset-assert 608) - (speed-scale float :offset-assert 612) - (controller vehicle-controller :inline :offset-assert 624) - (danger-pos sphere :inline :offset-assert 768) - (vehicle handle :offset-assert 784) - (anim-shuffle int32 :offset-assert 792) - (dist-walk-anim float :offset-assert 796) - (speed-walk float :offset-assert 800) - (anim-walk int32 :offset-assert 804) - (dist-run-anim float :offset-assert 808) - (speed-run float :offset-assert 812) - (anim-run int32 :offset-assert 816) - (water-anim int32 :offset-assert 820) - (interp float :offset-assert 824) - (last-danger-time time-frame :offset-assert 832) - (next-time-look-at time-frame :offset-assert 840) - (stop-time-look-at time-frame :offset-assert 848) - (wait-return-state (state citizen) :offset-assert 856) - (wait-time time-frame :offset-assert 864) - (cp-valid? symbol :offset-assert 872) - (cp-sphere sphere :inline :offset-assert 880) - (cp-vec vector :inline :offset-assert 896) - (cp-next-time time-frame :offset-assert 912) - (cp-exit-time time-frame :offset-assert 920) - (cp-force vector :inline :offset-assert 928) - (cp-plane plane :inline :offset-assert 944) - (cp-factor float :offset-assert 960) + ((flags citizen-flag) + (traffic-id int8) + (hit-by-player-count int8) + (gnd-height float) + (speed-scale float) + (controller vehicle-controller :inline) + (danger-pos sphere :inline) + (vehicle handle) + (anim-shuffle int32) + (dist-walk-anim float) + (speed-walk float) + (anim-walk int32) + (dist-run-anim float) + (speed-run float) + (anim-run int32) + (water-anim int32) + (interp float) + (last-danger-time time-frame) + (next-time-look-at time-frame) + (stop-time-look-at time-frame) + (wait-return-state (state citizen)) + (wait-time time-frame) + (cp-valid? symbol) + (cp-sphere sphere :inline) + (cp-vec vector :inline) + (cp-next-time time-frame) + (cp-exit-time time-frame) + (cp-force vector :inline) + (cp-plane plane :inline) + (cp-factor float) ) - :heap-base #x350 - :method-count-assert 201 - :size-assert #x3c4 - :flag-assert #xc9035003c4 + (:state-methods + wait + inactive + in-ditch + ) (:methods - (wait () _type_ :state 178) - (inactive () _type_ :state 179) - (in-ditch () _type_ :state 180) - (citizen-init! (_type_) none 181) - (citizen-nav-init! (_type_) none 182) - (go-inactive (_type_) none 183) - (find-segment (_type_ vector vector) nav-segment 184) - (nav-segment-callback (_type_ vector traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none 185) - (citizen-method-186 (_type_ nav-segment) none 186) - (citizen-method-187 (_type_) symbol 187) - (citizen-method-188 (_type_ vector) none 188) - (calc-danger-vec (_type_ vector vector) none 189) - (citizen-method-190 (_type_ vector) none 190) - (gen-clear-path (_type_) nav-segment 191) - (citizen-method-192 (_type_) none 192) - (throw-off-vehicle (_type_) none 193) - (gen-new-dir (_type_ vector float) nav-segment 194) - (citizen-method-195 (_type_ vector) symbol 195) - (get-run-anim (_type_) int 196) - (trigger-alert (_type_ int target) none 197) - (decrease-alert (_type_ object) none 198) - (set-behavior! (_type_ traffic-object-spawn-params) none 199) - (citizen-method-200 (_type_) none 200) + (citizen-init! (_type_) none) + (citizen-nav-init! (_type_) none) + (go-inactive (_type_) none) + (find-segment (_type_ vector vector) nav-segment) + (nav-segment-callback (_type_ vector traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) + (citizen-method-186 (_type_ nav-segment) none) + (citizen-method-187 (_type_) symbol) + (citizen-method-188 (_type_ vector) none) + (calc-danger-vec (_type_ vector vector) none) + (citizen-method-190 (_type_ vector) none) + (gen-clear-path (_type_) nav-segment) + (citizen-method-192 (_type_) none) + (throw-off-vehicle (_type_) none) + (gen-new-dir (_type_ vector float) nav-segment) + (citizen-method-195 (_type_ vector) symbol) + (get-run-anim (_type_) int) + (trigger-alert (_type_ int target) none) + (decrease-alert (_type_ object) none) + (set-behavior! (_type_ traffic-object-spawn-params) none) + (citizen-method-200 (_type_) none) ) ) ;; definition for method 3 of type citizen -(defmethod inspect citizen ((this citizen)) +(defmethod inspect ((this citizen)) (when (not this) (set! this this) (goto cfg-26) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc index 9060bd4a37f..48848043163 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc @@ -41,17 +41,13 @@ ;; definition of type citizen-norm (deftype citizen-norm (civilian) () - :heap-base #x3b0 - :method-count-assert 219 - :size-assert #x424 - :flag-assert #xdb03b00424 - (:methods - (knocked-off-vehicle () _type_ :state 218) + (:state-methods + knocked-off-vehicle ) ) ;; definition for method 3 of type citizen-norm -(defmethod inspect citizen-norm ((this citizen-norm)) +(defmethod inspect ((this citizen-norm)) (when (not this) (set! this this) (goto cfg-4) @@ -241,7 +237,7 @@ ;; definition for method 51 of type citizen-norm ;; INFO: Used lq/sq -(defmethod enemy-method-51 citizen-norm ((this citizen-norm)) +(defmethod enemy-method-51 ((this citizen-norm)) (cond ((logtest? (-> this flags) (citizen-flag knocked-out-car knocked-out-bike)) ((method-of-type nav-enemy enemy-method-51) this) @@ -309,7 +305,7 @@ ) ;; definition for method 79 of type citizen-norm -(defmethod enemy-method-79 citizen-norm ((this citizen-norm) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this citizen-norm) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((1) (case (-> this incoming knocked-type) @@ -360,7 +356,7 @@ ) ;; definition for method 77 of type citizen-norm -(defmethod enemy-method-77 citizen-norm ((this citizen-norm) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this citizen-norm) (arg0 (pointer float))) (local-vars (v1-36 knocked-type)) (cond ((logtest? (-> this flags) (citizen-flag knocked-out-car)) @@ -470,7 +466,7 @@ ) ;; definition for method 78 of type citizen-norm -(defmethod enemy-method-78 citizen-norm ((this citizen-norm) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this citizen-norm) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (set! (-> arg0 0) 1.0) (let ((a0-2 (-> this skel root-channel 0))) @@ -615,7 +611,7 @@ ;; definition for method 199 of type citizen-norm ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-behavior! citizen-norm ((this citizen-norm) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! ((this citizen-norm) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((11) (speech-control-method-12 *speech-control* this (speech-type speech-type-22)) @@ -712,7 +708,7 @@ ;; definition for method 114 of type citizen-norm ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! citizen-norm ((this citizen-norm)) +(defmethod init-enemy-collision! ((this citizen-norm)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -778,7 +774,7 @@ ;; definition for method 115 of type citizen-norm ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! citizen-norm ((this citizen-norm)) +(defmethod init-enemy! ((this citizen-norm)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -862,7 +858,7 @@ ;; definition for method 181 of type citizen-norm ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! citizen-norm ((this citizen-norm)) +(defmethod citizen-init! ((this citizen-norm)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) (t9-0 this) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc index b164d0ec068..9ec1565958b 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc @@ -6,7 +6,7 @@ ;; definition for method 182 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod citizen-nav-init! citizen ((this citizen)) +(defmethod citizen-nav-init! ((this citizen)) "Initialize nav related fields." (let ((v1-0 (-> this nav))) (logclear! (-> v1-0 flags) (nav-control-flag limit-rotation-rate output-sphere-hash)) @@ -37,7 +37,7 @@ ;; definition for method 181 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! citizen ((this citizen)) +(defmethod citizen-init! ((this citizen)) "Initialize [[citizen]] defaults." (logior! (-> this fact enemy-options) (enemy-option knocked-into-water)) (if (-> this skel effect) @@ -95,7 +95,7 @@ ;; definition for method 57 of type citizen ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! citizen ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod update-target-awareness! ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! @TODO - flesh out docs @returns the value that sets `aware`" @@ -112,35 +112,35 @@ ) ;; definition for method 61 of type citizen -(defmethod enemy-method-61 citizen ((this citizen) (arg0 int)) +(defmethod enemy-method-61 ((this citizen) (arg0 int)) 3 ) ;; definition for method 67 of type citizen -(defmethod go-stare citizen ((this citizen)) +(defmethod go-stare ((this citizen)) (go (method-of-object this flee)) ) ;; definition for method 70 of type citizen ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile citizen ((this citizen)) +(defmethod go-hostile ((this citizen)) (go-inactive this) ) ;; definition for method 71 of type citizen -(defmethod go-flee citizen ((this citizen)) +(defmethod go-flee ((this citizen)) (go (method-of-object this flee)) ) ;; definition for method 72 of type citizen -(defmethod react-to-focus citizen ((this citizen)) +(defmethod react-to-focus ((this citizen)) "@TODO - flesh out docs" (go (method-of-object this active)) ) ;; definition for method 73 of type citizen ;; WARN: Return type mismatch none vs object. -(defmethod kill-prefer-falling citizen ((this citizen)) +(defmethod kill-prefer-falling ((this citizen)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (logclear! (-> this flags) (citizen-flag persistent)) (send-event (ppointer->process (-> this parent)) 'child-killed) @@ -148,7 +148,7 @@ ) ;; definition for method 17 of type citizen -(defmethod cleanup-for-death citizen ((this citizen)) +(defmethod cleanup-for-death ((this citizen)) (logclear! (-> this flags) (citizen-flag persistent)) (send-event (ppointer->process (-> this parent)) 'child-killed) (go-inactive this) @@ -157,7 +157,7 @@ ;; definition for method 183 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod go-inactive citizen ((this citizen)) +(defmethod go-inactive ((this citizen)) (vehicle-controller-method-11 (-> this controller)) (logior! (-> this focus-status) (focus-status inactive)) (set! (-> this event-hook) (-> (method-of-object this inactive) event)) @@ -168,7 +168,7 @@ ;; definition for method 197 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod trigger-alert citizen ((this citizen) (arg0 int) (arg1 target)) +(defmethod trigger-alert ((this citizen) (arg0 int) (arg1 target)) (let ((a0-1 (-> this controller traffic))) (when (and (nonzero? a0-1) arg1) (if #t @@ -182,7 +182,7 @@ ;; definition for method 198 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod decrease-alert citizen ((this citizen) (arg0 object)) +(defmethod decrease-alert ((this citizen) (arg0 object)) (let ((a0-1 (-> this controller traffic))) (if (nonzero? a0-1) (decrease-alert-level a0-1 (the-as int arg0)) @@ -193,22 +193,22 @@ ) ;; definition for method 26 of type citizen -(defmethod get-inv-mass citizen ((this citizen)) +(defmethod get-inv-mass ((this citizen)) 1.0 ) ;; definition for method 184 of type citizen -(defmethod find-segment citizen ((this citizen) (arg0 vector) (arg1 vector)) +(defmethod find-segment ((this citizen) (arg0 vector) (arg1 vector)) (find-best-segment (-> this controller traffic) arg0 arg1 1) ) ;; definition for method 185 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod nav-segment-callback citizen ((this citizen) - (arg0 vector) - (arg1 traffic-find-segment-struct) - (arg2 (function traffic-find-segment-struct nav-segment none)) - ) +(defmethod nav-segment-callback ((this citizen) + (arg0 vector) + (arg1 traffic-find-segment-struct) + (arg2 (function traffic-find-segment-struct nav-segment none)) + ) (callback-on-nav-segments-in-sphere (-> this controller traffic) arg0 1 arg1 arg2) 0 (none) @@ -216,7 +216,7 @@ ;; definition for method 186 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod citizen-method-186 citizen ((this citizen) (arg0 nav-segment)) +(defmethod citizen-method-186 ((this citizen) (arg0 nav-segment)) (vehicle-controller-method-11 (-> this controller)) (vehicle-controller-method-13 (-> this controller) (-> arg0 branch) (the-as vector (-> arg0 vertex))) 0 @@ -224,7 +224,7 @@ ) ;; definition for method 187 of type citizen -(defmethod citizen-method-187 citizen ((this citizen)) +(defmethod citizen-method-187 ((this citizen)) (let* ((v1-0 (-> this controller)) (gp-1 (vector-! (new 'stack-no-clear 'vector) (-> v1-0 turn-exit-point) (-> v1-0 path-prev-point))) (s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> v1-0 turn-exit-point))) @@ -238,7 +238,7 @@ ;; definition for method 199 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod set-behavior! citizen ((this citizen) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! ((this citizen) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) @@ -261,7 +261,7 @@ ;; definition for method 74 of type citizen ;; INFO: Used lq/sq -(defmethod general-event-handler citizen ((this citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -355,7 +355,7 @@ ;; definition for method 200 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod citizen-method-200 citizen ((this citizen)) +(defmethod citizen-method-200 ((this citizen)) (set! (-> this root transv x) 0.0) (set! (-> this root transv z) 0.0) (when (-> this enemy-info move-to-ground) @@ -384,7 +384,7 @@ ;; definition for method 55 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! citizen ((this citizen)) +(defmethod track-target! ((this citizen)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -471,7 +471,7 @@ ;; definition for method 128 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-128 citizen ((this citizen) (arg0 vector) (arg1 move-above-ground-params)) +(defmethod enemy-method-128 ((this citizen) (arg0 vector) (arg1 move-above-ground-params)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -602,7 +602,7 @@ ;; definition for method 142 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 citizen ((this citizen) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this citizen) (arg0 nav-control)) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) (set! (-> s3-0 quad) (-> a1-1 heading quad)) @@ -629,7 +629,7 @@ ;; definition for method 176 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-176 citizen ((this citizen)) +(defmethod nav-enemy-method-176 ((this citizen)) (nav-enemy-method-177 this) (let ((a0-2 this)) (when (logtest? (enemy-flag enemy-flag36) (-> a0-2 enemy-flags)) @@ -654,7 +654,7 @@ ;; definition for method 116 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod go-idle citizen ((this citizen)) +(defmethod go-idle ((this citizen)) (go (method-of-object this active)) 0 (none) @@ -662,7 +662,7 @@ ;; definition for method 113 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-behaviour-and-stats! citizen ((this citizen) (arg0 nav-enemy-info)) +(defmethod init-enemy-behaviour-and-stats! ((this citizen) (arg0 nav-enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-behaviour-and-stats!))) @@ -682,7 +682,7 @@ ;; definition for method 11 of type citizen ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! citizen ((this citizen) (arg0 entity-actor)) +(defmethod init-from-entity! ((this citizen) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -718,7 +718,7 @@ This commonly includes things such as: ) ;; definition for method 196 of type citizen -(defmethod get-run-anim citizen ((this citizen)) +(defmethod get-run-anim ((this citizen)) (-> this anim-run) ) @@ -827,7 +827,7 @@ This commonly includes things such as: ;; definition for method 188 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod citizen-method-188 citizen ((this citizen) (arg0 vector)) +(defmethod citizen-method-188 ((this citizen) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) @@ -874,7 +874,7 @@ This commonly includes things such as: ;; definition for method 189 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod calc-danger-vec citizen ((this citizen) (arg0 vector) (arg1 vector)) +(defmethod calc-danger-vec ((this citizen) (arg0 vector) (arg1 vector)) (let ((s2-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -939,7 +939,7 @@ This commonly includes things such as: ;; definition for method 190 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod citizen-method-190 citizen ((this citizen) (arg0 vector)) +(defmethod citizen-method-190 ((this citizen) (arg0 vector)) (local-vars (sv-288 nav-poly) (sv-304 clamp-travel-vector-to-mesh-return-info) (sv-320 vector)) (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (the-as vector (-> this cp-sphere)))) (s4-0 (new 'stack-no-clear 'vector)) @@ -1018,19 +1018,16 @@ This commonly includes things such as: ;; definition of type iter-seg (deftype iter-seg (structure) - ((self citizen :offset-assert 0) - (score float :offset-assert 4) - (seg nav-segment :offset-assert 8) - (cp-plane plane :inline :offset-assert 16) - (desired-dir vector :inline :offset-assert 32) + ((self citizen) + (score float) + (seg nav-segment) + (cp-plane plane :inline) + (desired-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type iter-seg -(defmethod inspect iter-seg ((this iter-seg)) +(defmethod inspect ((this iter-seg)) (when (not this) (set! this this) (goto cfg-4) @@ -1137,7 +1134,7 @@ This commonly includes things such as: ;; definition for method 191 of type citizen ;; INFO: Used lq/sq -(defmethod gen-clear-path citizen ((this citizen)) +(defmethod gen-clear-path ((this citizen)) (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'iter-seg)) ) @@ -1186,7 +1183,7 @@ This commonly includes things such as: ;; definition for method 192 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod citizen-method-192 citizen ((this citizen)) +(defmethod citizen-method-192 ((this citizen)) (when (-> this cp-valid?) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> this cp-force quad)) @@ -1248,7 +1245,7 @@ This commonly includes things such as: ;; definition for method 194 of type citizen ;; INFO: Used lq/sq -(defmethod gen-new-dir citizen ((this citizen) (arg0 vector) (arg1 float)) +(defmethod gen-new-dir ((this citizen) (arg0 vector) (arg1 float)) (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'iter-seg)) ) @@ -1285,7 +1282,7 @@ This commonly includes things such as: ;; definition for method 195 of type citizen ;; WARN: Return type mismatch int vs symbol. -(defmethod citizen-method-195 citizen ((this citizen) (arg0 vector)) +(defmethod citizen-method-195 ((this citizen) (arg0 vector)) (dotimes (s4-0 6) (let ((a1-2 (gen-new-dir this arg0 (* 81920.0 (the float (+ s4-0 1)))))) (when a1-2 @@ -1300,7 +1297,7 @@ This commonly includes things such as: ;; definition for method 193 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod throw-off-vehicle citizen ((this citizen)) +(defmethod throw-off-vehicle ((this citizen)) (let ((s4-0 (handle->process (-> this vehicle)))) (let ((v1-4 (-> this root root-prim))) (set! (-> v1-4 prim-core collide-as) (-> this root backup-collide-as)) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc index 4374879d424..4089c9dea35 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc @@ -3,18 +3,15 @@ ;; definition of type civilian-anim-info (deftype civilian-anim-info (structure) - ((anim-index int32 2 :offset-assert 0) - (anim-index-front int32 :offset 0) - (anim-index-back int32 :offset 4) + ((anim-index int32 2) + (anim-index-front int32 :overlay-at (-> anim-index 0)) + (anim-index-back int32 :overlay-at (-> anim-index 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type civilian-anim-info -(defmethod inspect civilian-anim-info ((this civilian-anim-info)) +(defmethod inspect ((this civilian-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -29,40 +26,37 @@ ;; definition of type civilian-global-info (deftype civilian-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (knocked int32 2 :offset-assert 8) - (anim-knocked-front int32 :offset 8) - (anim-knocked-back int32 :offset 12) - (knocked-land int32 2 :offset-assert 16) - (anim-knocked-front-land int32 :offset 16) - (anim-knocked-back-land int32 :offset 20) - (yellow-hit-anim civilian-anim-info 1 :inline :offset-assert 24) - (blue-hit-anim civilian-anim-info 3 :inline :offset-assert 32) - (anim-cover-head-start int32 :offset-assert 56) - (anim-cover-head-loop int32 :offset-assert 60) - (anim-cover-head-end int32 :offset-assert 64) - (car-stance-anim int32 :offset-assert 68) - (bike-stance-anim int32 :offset-assert 72) - (get-in-car-anim int32 :offset-assert 76) - (get-on-bike-anim int32 :offset-assert 80) - (seat-flag uint8 :offset-assert 84) - (speech-ambient int8 :offset-assert 85) - (speech-alert int8 :offset-assert 86) - (speech-cower int8 :offset-assert 87) - (speech-touched-by-player int8 :offset-assert 88) - (speech-shot-by-player int8 :offset-assert 89) - (speech-avoiding-player-vehicle int8 :offset-assert 90) - (speech-hit-by-player-vehicle int8 :offset-assert 91) - (speech-player-stealing-vehicle int8 :offset-assert 92) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (knocked int32 2) + (anim-knocked-front int32 :overlay-at (-> knocked 0)) + (anim-knocked-back int32 :overlay-at (-> knocked 1)) + (knocked-land int32 2) + (anim-knocked-front-land int32 :overlay-at (-> knocked-land 0)) + (anim-knocked-back-land int32 :overlay-at (-> knocked-land 1)) + (yellow-hit-anim civilian-anim-info 1 :inline) + (blue-hit-anim civilian-anim-info 3 :inline) + (anim-cover-head-start int32) + (anim-cover-head-loop int32) + (anim-cover-head-end int32) + (car-stance-anim int32) + (bike-stance-anim int32) + (get-in-car-anim int32) + (get-on-bike-anim int32) + (seat-flag uint8) + (speech-ambient int8) + (speech-alert int8) + (speech-cower int8) + (speech-touched-by-player int8) + (speech-shot-by-player int8) + (speech-avoiding-player-vehicle int8) + (speech-hit-by-player-vehicle int8) + (speech-player-stealing-vehicle int8) ) - :method-count-assert 9 - :size-assert #x5d - :flag-assert #x90000005d ) ;; definition for method 3 of type civilian-global-info -(defmethod inspect civilian-global-info ((this civilian-global-info)) +(defmethod inspect ((this civilian-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -100,49 +94,47 @@ ;; definition of type civilian (deftype civilian (citizen) - ((info civilian-global-info :offset-assert 964) - (anim-panic-run int32 :offset-assert 968) - (anim-on-ground int32 :offset-assert 972) - (anim-dive int32 :offset-assert 976) - (anim-get-up-front int32 :offset-assert 980) - (anim-get-up-back int32 :offset-assert 984) - (last-second-pos vector :inline :offset-assert 992) - (last-distance float :offset-assert 1008) - (next-time time-frame :offset-assert 1016) - (dive-target-point vector :inline :offset-assert 1024) - (dive-reaction float :offset-assert 1040) - (allow-dive symbol :offset-assert 1044) - (dive-finished? symbol :offset-assert 1048) - (hit-face uint32 :offset-assert 1052) - (seat int32 :offset-assert 1056) + ((info civilian-global-info) + (anim-panic-run int32) + (anim-on-ground int32) + (anim-dive int32) + (anim-get-up-front int32) + (anim-get-up-back int32) + (last-second-pos vector :inline) + (last-distance float) + (next-time time-frame) + (dive-target-point vector :inline) + (dive-reaction float) + (allow-dive symbol) + (dive-finished? symbol) + (hit-face uint32) + (seat int32) ) - :heap-base #x3b0 - :method-count-assert 218 - :size-assert #x424 - :flag-assert #xda03b00424 + (:state-methods + avoid-danger + clear-path + on-ground + dive + get-up-front + get-up-back + cower-ground + wait-for-ride + move-to-vehicle + board-vehicle + ride + exit-vehicle + wait-at-dest + ) (:methods - (avoid-danger () _type_ :state 201) - (clear-path () _type_ :state 202) - (on-ground () _type_ :state 203) - (dive () _type_ :state 204) - (get-up-front () _type_ :state 205) - (get-up-back () _type_ :state 206) - (cower-ground () _type_ :state 207) - (wait-for-ride () _type_ :state 208) - (move-to-vehicle () _type_ :state 209) - (board-vehicle () _type_ :state 210) - (ride () _type_ :state 211) - (exit-vehicle () _type_ :state 212) - (wait-at-dest () _type_ :state 213) - (civilian-method-214 (_type_ nav-branch int vector float) float 214) - (civilian-method-215 (_type_ vector) none 215) - (go-dive (_type_) none 216) - (civilian-method-217 (_type_ vector) symbol 217) + (civilian-method-214 (_type_ nav-branch int vector float) float) + (civilian-method-215 (_type_ vector) none) + (go-dive (_type_) none) + (civilian-method-217 (_type_ vector) symbol) ) ) ;; definition for method 3 of type civilian -(defmethod inspect civilian ((this civilian)) +(defmethod inspect ((this civilian)) (when (not this) (set! this this) (goto cfg-4) @@ -170,7 +162,7 @@ ) ;; definition for method 196 of type civilian -(defmethod get-run-anim civilian ((this civilian)) +(defmethod get-run-anim ((this civilian)) (if (and (-> this next-state) (= (-> this next-state name) 'flee)) (-> this anim-panic-run) (-> this anim-run) @@ -178,14 +170,14 @@ ) ;; definition for method 81 of type civilian -(defmethod enemy-method-81 civilian ((this civilian)) +(defmethod enemy-method-81 ((this civilian)) #f ) ;; definition for method 17 of type civilian ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod cleanup-for-death civilian ((this civilian)) +(defmethod cleanup-for-death ((this civilian)) (cond ((zero? (-> this hit-points)) (logclear! (-> this flags) (citizen-flag persistent)) @@ -226,7 +218,7 @@ ) ;; definition for method 56 of type civilian -(defmethod damage-amount-from-attack civilian ((this civilian) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this civilian) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (cond ((= (scf-get-territory) 2) @@ -269,26 +261,26 @@ ) ;; definition for method 108 of type civilian -(defmethod enemy-method-108 civilian ((this civilian) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 ((this civilian) (arg0 enemy) (arg1 event-message-block)) 0 ) ;; definition for method 70 of type civilian ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile civilian ((this civilian)) +(defmethod go-hostile ((this civilian)) (cleanup-for-death this) ) ;; definition for method 73 of type civilian ;; WARN: Return type mismatch none vs object. -(defmethod kill-prefer-falling civilian ((this civilian)) +(defmethod kill-prefer-falling ((this civilian)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cleanup-for-death this) ) ;; definition for method 199 of type civilian ;; WARN: Return type mismatch int vs none. -(defmethod set-behavior! civilian ((this civilian) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! ((this civilian) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) @@ -315,7 +307,7 @@ ;; definition for method 181 of type civilian ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! civilian ((this civilian)) +(defmethod citizen-init! ((this civilian)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen citizen-init!))) (t9-0 this) @@ -333,7 +325,7 @@ ;; definition for method 215 of type civilian ;; INFO: Used lq/sq ;; WARN: Return type mismatch nav-segment vs none. -(defmethod civilian-method-215 civilian ((this civilian) (arg0 vector)) +(defmethod civilian-method-215 ((this civilian) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> this root trans quad)) (set! (-> v1-0 w) 81920.0) @@ -348,7 +340,7 @@ ;; definition for method 74 of type civilian ;; INFO: Used lq/sq -(defmethod general-event-handler civilian ((this civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -463,7 +455,7 @@ ;; definition for method 214 of type civilian ;; INFO: Used lq/sq -(defmethod civilian-method-214 civilian ((this civilian) (arg0 nav-branch) (arg1 int) (arg2 vector) (arg3 float)) +(defmethod civilian-method-214 ((this civilian) (arg0 nav-branch) (arg1 int) (arg2 vector) (arg3 float)) (when (nonzero? arg1) (-> arg0 src-node) (let* ((s3-0 (-> arg0 dest-node)) @@ -1080,7 +1072,7 @@ ;; definition for method 216 of type civilian ;; WARN: Return type mismatch object vs none. -(defmethod go-dive civilian ((this civilian)) +(defmethod go-dive ((this civilian)) (if (< (-> this nav state speed) 8192.0) (go (method-of-object this on-ground)) (go (method-of-object this dive)) @@ -1592,7 +1584,7 @@ ) ;; definition for method 217 of type civilian -(defmethod civilian-method-217 civilian ((this civilian) (arg0 vector)) +(defmethod civilian-method-217 ((this civilian) (arg0 vector)) (let ((s3-0 (handle->process (-> this vehicle))) (s4-0 (new 'stack 'collide-query)) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc index bccaee56e20..e6f84452826 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc @@ -11,18 +11,15 @@ ;; definition of type guard-anim-info (deftype guard-anim-info (structure) - ((anim-index int32 2 :offset-assert 0) - (anim-index-front int32 :offset 0) - (anim-index-back int32 :offset 4) + ((anim-index int32 2) + (anim-index-front int32 :overlay-at (-> anim-index 0)) + (anim-index-back int32 :overlay-at (-> anim-index 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type guard-anim-info -(defmethod inspect guard-anim-info ((this guard-anim-info)) +(defmethod inspect ((this guard-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -37,25 +34,22 @@ ;; definition of type guard-global-info (deftype guard-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (knocked int32 2 :offset-assert 8) - (knocked-land int32 2 :offset-assert 16) - (anim-knocked-front int32 :offset 8) - (anim-knocked-back int32 :offset 12) - (anim-knocked-front-land int32 :offset 16) - (anim-knocked-back-land int32 :offset 20) - (yellow-hit-anim guard-anim-info 2 :inline :offset-assert 24) - (yellow-land-anim guard-anim-info 2 :inline :offset-assert 40) - (blue-hit-anim int32 :offset-assert 56) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (knocked int32 2) + (knocked-land int32 2) + (anim-knocked-front int32 :overlay-at (-> knocked 0)) + (anim-knocked-back int32 :overlay-at (-> knocked 1)) + (anim-knocked-front-land int32 :overlay-at (-> knocked-land 0)) + (anim-knocked-back-land int32 :overlay-at (-> knocked-land 1)) + (yellow-hit-anim guard-anim-info 2 :inline) + (yellow-land-anim guard-anim-info 2 :inline) + (blue-hit-anim int32) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) ;; definition for method 3 of type guard-global-info -(defmethod inspect guard-global-info ((this guard-global-info)) +(defmethod inspect ((this guard-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -78,18 +72,15 @@ ;; definition of type guard-shoot-info (deftype guard-shoot-info (structure) - ((anim-index int32 :offset-assert 0) - (start float :offset-assert 4) - (end float :offset-assert 8) + ((anim-index int32) + (start float) + (end float) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type guard-shoot-info -(defmethod inspect guard-shoot-info ((this guard-shoot-info)) +(defmethod inspect ((this guard-shoot-info)) (when (not this) (set! this this) (goto cfg-4) @@ -300,80 +291,78 @@ ;; definition of type crimson-guard (deftype crimson-guard (citizen) - ((info guard-global-info :offset-assert 964) - (hit-face uint32 :offset-assert 968) - (anim-get-up-front int32 :offset-assert 972) - (anim-get-up-back int32 :offset-assert 976) - (small-hit int32 :offset-assert 980) - (yellow-anim uint32 :offset-assert 984) - (guard-type uint8 :offset-assert 988) - (settings traffic-guard-type-settings :offset-assert 992) - (next-time time-frame :offset-assert 1000) - (last-time-see-target time-frame :offset-assert 1008) - (joint joint-mod :offset-assert 1016) - (joint-enable symbol :offset-assert 1020) - (already-shot symbol :offset-assert 1024) - (miss-amount float :offset-assert 1028) - (l-control lightning-control :offset-assert 1032) - (next-shot int64 :offset-assert 1040) - (anim-shoot guard-shoot-info 3 :inline :offset-assert 1048) - (transport handle :offset-assert 1088) - (transport-side uint32 :offset-assert 1096) - (target-flags uint8 :offset-assert 1100) - (target-pos vector :inline :offset-assert 1104) - (target-pos-predict vector :inline :offset-assert 1120) - (target-pos-predict-miss vector :inline :offset-assert 1136) - (target-vel-vec vector :inline :offset-assert 1152) - (target-vel float :offset-assert 1168) - (target-self vector :inline :offset-assert 1184) - (target-self-xz vector :inline :offset-assert 1200) - (target-self-dist float :offset-assert 1216) - (target-self-xz-dist float :offset-assert 1220) - (target-y-angle degrees :offset-assert 1224) - (last-visible-target-pos vector :inline :offset-assert 1232) - (lazer-sound sound-id :offset-assert 1248) - (move-position vector :inline :offset-assert 1264) - (move-index int32 :offset-assert 1280) - (traffic-target-status traffic-target-status :inline :offset-assert 1296) - (minimap connection-minimap :offset-assert 1376) - (other-side symbol :offset-assert 1380) + ((info guard-global-info) + (hit-face uint32) + (anim-get-up-front int32) + (anim-get-up-back int32) + (small-hit int32) + (yellow-anim uint32) + (guard-type uint8) + (settings traffic-guard-type-settings) + (next-time time-frame) + (last-time-see-target time-frame) + (joint joint-mod) + (joint-enable symbol) + (already-shot symbol) + (miss-amount float) + (l-control lightning-control) + (next-shot int64) + (anim-shoot guard-shoot-info 3 :inline) + (transport handle) + (transport-side uint32) + (target-flags uint8) + (target-pos vector :inline) + (target-pos-predict vector :inline) + (target-pos-predict-miss vector :inline) + (target-vel-vec vector :inline) + (target-vel float) + (target-self vector :inline) + (target-self-xz vector :inline) + (target-self-dist float) + (target-self-xz-dist float) + (target-y-angle degrees) + (last-visible-target-pos vector :inline) + (lazer-sound sound-id) + (move-position vector :inline) + (move-index int32) + (traffic-target-status traffic-target-status :inline) + (minimap connection-minimap) + (other-side symbol) ) - :heap-base #x4f0 - :method-count-assert 227 - :size-assert #x568 - :flag-assert #xe304f00568 + (:state-methods + get-up-front + get-up-back + search + attack + arrest + gun-shoot + exit-transport + waiting-ambush + close-attack + knocked-off-vehicle + roll-right + roll-left + close-attack-active + ) (:methods - (get-up-front () _type_ :state 201) - (get-up-back () _type_ :state 202) - (search () _type_ :state 203) - (attack () _type_ :state 204) - (arrest () _type_ :state 205) - (gun-shoot () _type_ :state 206) - (exit-transport () _type_ :state 207) - (waiting-ambush () _type_ :state 208) - (close-attack () _type_ :state 209) - (knocked-off-vehicle () _type_ :state 210) - (roll-right () _type_ :state 211) - (roll-left () _type_ :state 212) - (close-attack-active () _type_ :state 213) - (crimson-guard-method-214 (_type_) none 214) - (crimson-guard-method-215 (_type_) symbol 215) - (crimson-guard-method-216 (_type_) symbol 216) - (crimson-guard-method-217 (_type_ vector vector vector) int 217) - (crimson-guard-method-218 (_type_ vector) none 218) - (crimson-guard-method-219 (_type_) none 219) - (crimson-guard-method-220 (_type_) none 220) - (crimson-guard-method-221 (_type_) none 221) - (crimson-guard-method-222 (_type_) none 222) - (crimson-guard-method-223 (_type_ float) none 223) - (crimson-guard-method-224 (_type_ vector) float 224) - (crimson-guard-method-225 (_type_ uint symbol) none 225) - (crimson-guard-method-226 (_type_) none 226) + (crimson-guard-method-214 (_type_) none) + (crimson-guard-method-215 (_type_) symbol) + (crimson-guard-method-216 (_type_) symbol) + (crimson-guard-method-217 (_type_ vector vector vector) int) + (crimson-guard-method-218 (_type_ vector) none) + (crimson-guard-method-219 (_type_) none) + (crimson-guard-method-220 (_type_) none) + (crimson-guard-method-221 (_type_) none) + (crimson-guard-method-222 (_type_) none) + (crimson-guard-method-223 (_type_ float) none) + (crimson-guard-method-224 (_type_ vector) float) + (crimson-guard-method-225 (_type_ uint symbol) none) + (crimson-guard-method-226 (_type_) none) ) ) ;; definition for method 3 of type crimson-guard -(defmethod inspect crimson-guard ((this crimson-guard)) +(defmethod inspect ((this crimson-guard)) (when (not this) (set! this this) (goto cfg-4) @@ -425,7 +414,7 @@ ;; definition for method 218 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-method-218 crimson-guard ((this crimson-guard) (arg0 vector)) +(defmethod crimson-guard-method-218 ((this crimson-guard) (arg0 vector)) (local-vars (sv-240 vector) (sv-256 (function vector vector vector)) @@ -557,7 +546,7 @@ ;; definition for method 219 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-method-219 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-219 ((this crimson-guard)) (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) *unity-quaternion* (seconds-per-frame)) 0 (none) @@ -567,7 +556,7 @@ (define *guard-min-id-hack* 255) ;; definition for method 55 of type crimson-guard -(defmethod track-target! crimson-guard ((this crimson-guard)) +(defmethod track-target! ((this crimson-guard)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -587,13 +576,13 @@ ) ;; definition for method 73 of type crimson-guard -(defmethod kill-prefer-falling crimson-guard ((this crimson-guard)) +(defmethod kill-prefer-falling ((this crimson-guard)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" ((method-of-type nav-enemy kill-prefer-falling) this) ) ;; definition for method 72 of type crimson-guard -(defmethod react-to-focus crimson-guard ((this crimson-guard)) +(defmethod react-to-focus ((this crimson-guard)) "@TODO - flesh out docs" (if (not (logtest? (-> this flags) (citizen-flag hostile))) (go (method-of-object this active)) @@ -602,7 +591,7 @@ ) ;; definition for method 56 of type crimson-guard -(defmethod damage-amount-from-attack crimson-guard ((this crimson-guard) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this crimson-guard) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let ((v0-0 ((method-of-type nav-enemy damage-amount-from-attack) this arg0 arg1))) (-> arg1 param 1) @@ -613,7 +602,7 @@ ;; definition for method 74 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: disable def twice: 122. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler crimson-guard ((this crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -802,7 +791,7 @@ ) ;; definition for method 26 of type crimson-guard -(defmethod get-inv-mass crimson-guard ((this crimson-guard)) +(defmethod get-inv-mass ((this crimson-guard)) 0.6666667 ) @@ -983,7 +972,7 @@ ) ;; definition for method 77 of type crimson-guard -(defmethod enemy-method-77 crimson-guard ((this crimson-guard) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this crimson-guard) (arg0 (pointer float))) (cond ((logtest? (-> this flags) (citizen-flag knocked-out-car)) (ja-channel-push! 1 (seconds 0.1)) @@ -1123,7 +1112,7 @@ ) ;; definition for method 78 of type crimson-guard -(defmethod enemy-method-78 crimson-guard ((this crimson-guard) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this crimson-guard) (arg0 (pointer float))) (cond ((<= (-> this hit-points) 0) (ja-channel-push! 1 (seconds 0.1)) @@ -1220,7 +1209,7 @@ ;; definition for method 199 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-behavior! crimson-guard ((this crimson-guard) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! ((this crimson-guard) (arg0 traffic-object-spawn-params)) (let ((a1-1 (-> arg0 guard-type))) (if (or (and (!= a1-1 7) (!= a1-1 (-> this guard-type))) (= (-> arg0 behavior) 11)) (crimson-guard-method-225 this a1-1 (= (-> arg0 behavior) 11)) @@ -1315,7 +1304,7 @@ ;; definition for method 70 of type crimson-guard ;; WARN: Return type mismatch int vs object. -(defmethod go-hostile crimson-guard ((this crimson-guard)) +(defmethod go-hostile ((this crimson-guard)) (cond ((handle->process (-> this focus handle)) (logior! (-> this flags) (citizen-flag hostile)) @@ -1343,7 +1332,7 @@ ;; definition for method 214 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-method-214 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-214 ((this crimson-guard)) (let* ((s4-0 (-> this target-pos-predict-miss)) (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) @@ -1489,7 +1478,7 @@ ;; definition for method 217 of type crimson-guard ;; INFO: Used lq/sq -(defmethod crimson-guard-method-217 crimson-guard ((this crimson-guard) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod crimson-guard-method-217 ((this crimson-guard) (arg0 vector) (arg1 vector) (arg2 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1601,7 +1590,7 @@ ;; definition for method 220 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-method-220 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-220 ((this crimson-guard)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1730,7 +1719,7 @@ ;; definition for method 221 of type crimson-guard ;; INFO: Used lq/sq -(defmethod crimson-guard-method-221 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-221 ((this crimson-guard)) (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) @@ -1747,7 +1736,7 @@ ;; definition for method 215 of type crimson-guard ;; INFO: Used lq/sq -(defmethod crimson-guard-method-215 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-215 ((this crimson-guard)) (let ((s5-0 (get-trans this 3)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -1761,7 +1750,7 @@ ;; definition for method 216 of type crimson-guard ;; INFO: Used lq/sq -(defmethod crimson-guard-method-216 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-216 ((this crimson-guard)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> this target-pos-predict-miss quad)) (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) @@ -2356,7 +2345,7 @@ ;; definition for method 226 of type crimson-guard ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-method-226 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-226 ((this crimson-guard)) (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (-> this root)) (s3-0 (lambda ((arg0 crimson-guard) (arg1 collide-shape-moving) (arg2 vector)) @@ -2897,7 +2886,7 @@ ;; definition for method 222 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-method-222 crimson-guard ((this crimson-guard)) +(defmethod crimson-guard-method-222 ((this crimson-guard)) (local-vars (sv-800 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -3393,7 +3382,7 @@ ;; definition for method 223 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-method-223 crimson-guard ((this crimson-guard) (arg0 float)) +(defmethod crimson-guard-method-223 ((this crimson-guard) (arg0 float)) (let* ((s3-0 (handle->process (-> this transport))) (s4-0 (if (type? s3-0 process-focusable) (the-as process-focusable s3-0) @@ -3429,7 +3418,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod crimson-guard-method-224 crimson-guard ((this crimson-guard) (arg0 vector)) +(defmethod crimson-guard-method-224 ((this crimson-guard) (arg0 vector)) (local-vars (f0-8 float) (sv-768 vector) @@ -3549,7 +3538,7 @@ ;; definition for method 93 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 crimson-guard ((this crimson-guard)) +(defmethod enemy-method-93 ((this crimson-guard)) (let ((s5-0 (-> this nav state)) (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) @@ -3576,12 +3565,12 @@ ) ;; definition for method 89 of type crimson-guard -(defmethod enemy-method-89 crimson-guard ((this crimson-guard) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this crimson-guard) (arg0 enemy-jump-info)) #f ) ;; definition for method 87 of type crimson-guard -(defmethod enemy-method-87 crimson-guard ((this crimson-guard) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this crimson-guard) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -3598,7 +3587,7 @@ ) ;; definition for method 88 of type crimson-guard -(defmethod enemy-method-88 crimson-guard ((this crimson-guard) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this crimson-guard) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -3615,7 +3604,7 @@ ) ;; definition for method 90 of type crimson-guard -(defmethod enemy-method-90 crimson-guard ((this crimson-guard) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 ((this crimson-guard) (arg0 int) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond @@ -3773,7 +3762,7 @@ ;; definition for method 114 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! crimson-guard ((this crimson-guard)) +(defmethod init-enemy-collision! ((this crimson-guard)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -3846,7 +3835,7 @@ ) ;; definition for method 7 of type crimson-guard -(defmethod relocate crimson-guard ((this crimson-guard) (arg0 int)) +(defmethod relocate ((this crimson-guard) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -3858,7 +3847,7 @@ ;; definition for method 115 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! crimson-guard ((this crimson-guard)) +(defmethod init-enemy! ((this crimson-guard)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -3893,7 +3882,7 @@ ;; definition for method 225 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-method-225 crimson-guard ((this crimson-guard) (arg0 uint) (arg1 symbol)) +(defmethod crimson-guard-method-225 ((this crimson-guard) (arg0 uint) (arg1 symbol)) (set! (-> this guard-type) arg0) (set! (-> this settings) (get-traffic-guard-type-settings (-> this controller traffic) (the-as int (-> this guard-type))) @@ -3955,7 +3944,7 @@ ;; definition for method 181 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! crimson-guard ((this crimson-guard)) +(defmethod citizen-init! ((this crimson-guard)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen citizen-init!))) (t9-0 this) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc index c1c3e1bda1f..5745c216e57 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc @@ -3,34 +3,32 @@ ;; definition of type metalhead-flitter (deftype metalhead-flitter (citizen-enemy) - ((move-angle float :offset-assert 980) - (heading symbol :offset-assert 984) - (change-dir-time time-frame :offset-assert 992) - (last-change-dir uint64 :offset-assert 1000) - (off-screen-timer uint64 :offset-assert 1008) - (amb-sound-timer uint64 :offset-assert 1016) - (attack-time time-frame :offset-assert 1024) - (target-pos vector :inline :offset-assert 1040) - (attack-pos vector :inline :offset-assert 1056) - (base-height float :offset-assert 1072) + ((move-angle float) + (heading symbol) + (change-dir-time time-frame) + (last-change-dir uint64) + (off-screen-timer uint64) + (amb-sound-timer uint64) + (attack-time time-frame) + (target-pos vector :inline) + (attack-pos vector :inline) + (base-height float) ) - :heap-base #x3c0 - :method-count-assert 210 - :size-assert #x434 - :flag-assert #xd203c00434 + (:state-methods + attack + ambush-jumping + ) (:methods - (attack () _type_ :state 203) - (ambush-jumping () _type_ :state 204) - (metalhead-flitter-method-205 (_type_) none 205) - (metalhead-flitter-method-206 (_type_) none 206) - (metalhead-flitter-method-207 (_type_ process-focusable) symbol 207) - (metalhead-flitter-method-208 (_type_ symbol) none 208) - (metalhead-flitter-method-209 (_type_) float 209) + (metalhead-flitter-method-205 (_type_) none) + (metalhead-flitter-method-206 (_type_) none) + (metalhead-flitter-method-207 (_type_ process-focusable) symbol) + (metalhead-flitter-method-208 (_type_ symbol) none) + (metalhead-flitter-method-209 (_type_) float) ) ) ;; definition for method 3 of type metalhead-flitter -(defmethod inspect metalhead-flitter ((this metalhead-flitter)) +(defmethod inspect ((this metalhead-flitter)) (when (not this) (set! this this) (goto cfg-4) @@ -209,7 +207,7 @@ (set! (-> *metalhead-flitter-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 207 of type metalhead-flitter -(defmethod metalhead-flitter-method-207 metalhead-flitter ((this metalhead-flitter) (arg0 process-focusable)) +(defmethod metalhead-flitter-method-207 ((this metalhead-flitter) (arg0 process-focusable)) (and (logtest? (-> this draw status) (draw-control-status on-screen)) (let ((s4-0 (camera-matrix))) (camera-pos) @@ -224,7 +222,7 @@ ) ;; definition for method 77 of type metalhead-flitter -(defmethod enemy-method-77 metalhead-flitter ((this metalhead-flitter) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this metalhead-flitter) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (let ((a0-2 (-> this skel root-channel 0))) @@ -267,7 +265,7 @@ ) ;; definition for method 78 of type metalhead-flitter -(defmethod enemy-method-78 metalhead-flitter ((this metalhead-flitter) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this metalhead-flitter) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -290,7 +288,7 @@ ) ;; definition for method 68 of type metalhead-flitter -(defmethod go-stare2 metalhead-flitter ((this metalhead-flitter)) +(defmethod go-stare2 ((this metalhead-flitter)) (if (and (= (-> this focus aware) (enemy-aware enemy-aware-2)) (not (nav-enemy-method-163 this))) (go (method-of-object this pacing)) (go (method-of-object this stare)) @@ -541,14 +539,14 @@ ) ;; definition for method 99 of type metalhead-flitter -(defmethod enemy-method-99 metalhead-flitter ((this metalhead-flitter) (arg0 process-focusable)) +(defmethod enemy-method-99 ((this metalhead-flitter) (arg0 process-focusable)) (focus-test? arg0 mech) ) ;; definition for method 205 of type metalhead-flitter ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod metalhead-flitter-method-205 metalhead-flitter ((this metalhead-flitter)) +(defmethod metalhead-flitter-method-205 ((this metalhead-flitter)) (let* ((s5-0 (handle->process (-> this focus handle))) (s3-0 (if (type? s5-0 process-focusable) s5-0 @@ -619,7 +617,7 @@ ;; definition for method 206 of type metalhead-flitter ;; WARN: Return type mismatch time-frame vs none. -(defmethod metalhead-flitter-method-206 metalhead-flitter ((this metalhead-flitter)) +(defmethod metalhead-flitter-method-206 ((this metalhead-flitter)) (when (time-elapsed? (the-as int (-> this amb-sound-timer)) (the int (* 300.0 (rand-vu-float-range 1.5 3.0)))) (sound-play "flitter-amb" :position (-> this root trans)) (set! (-> this amb-sound-timer) (the-as uint (current-time))) @@ -786,7 +784,7 @@ ) ;; definition for method 209 of type metalhead-flitter -(defmethod metalhead-flitter-method-209 metalhead-flitter ((this metalhead-flitter)) +(defmethod metalhead-flitter-method-209 ((this metalhead-flitter)) (lerp-scale 0.0 1.0 (- (-> this attack-pos y) (-> this root trans y)) 13926.4 25600.0) ) @@ -1041,7 +1039,7 @@ ;; definition for method 208 of type metalhead-flitter ;; WARN: Return type mismatch int vs none. -(defmethod metalhead-flitter-method-208 metalhead-flitter ((this metalhead-flitter) (arg0 symbol)) +(defmethod metalhead-flitter-method-208 ((this metalhead-flitter) (arg0 symbol)) (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) @@ -1058,7 +1056,7 @@ ;; definition for method 114 of type metalhead-flitter ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! metalhead-flitter ((this metalhead-flitter)) +(defmethod init-enemy-collision! ((this metalhead-flitter)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1113,7 +1111,7 @@ ;; definition for method 115 of type metalhead-flitter ;; WARN: Return type mismatch symbol vs none. -(defmethod init-enemy! metalhead-flitter ((this metalhead-flitter)) +(defmethod init-enemy! ((this metalhead-flitter)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1153,7 +1151,7 @@ ;; definition for method 181 of type metalhead-flitter ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! metalhead-flitter ((this metalhead-flitter)) +(defmethod citizen-init! ((this metalhead-flitter)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen-enemy citizen-init!))) (t9-0 this) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-grunt_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-grunt_REF.gc index e49855e89b8..5e82390a66f 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-grunt_REF.gc @@ -216,42 +216,40 @@ ;; definition of type metalhead-grunt (deftype metalhead-grunt (citizen-enemy) - ((patrol-anim grunt-anim-info :offset-assert 980) - (charge-anim grunt-anim-info :offset-assert 984) - (attack-anim grunt-anim-info :offset-assert 988) - (knocked-anim grunt-anim-info :offset-assert 992) - (yellow-hit-anim grunt-anim-info :offset-assert 996) - (blue-hit-anim grunt-anim-info :offset-assert 1000) - (intro-path path-control :offset-assert 1004) - (pad-jh1b23jhb13 uint32 :offset-assert 1008) - (use-charge-anim-index int8 :offset-assert 1012) - (knocked-anim-index int8 :offset-assert 1013) - (jumping-ambush-path-pt int8 :offset-assert 1014) - (grunt-flags uint8 :offset-assert 1015) - (state-timeout2 uint64 :offset-assert 1016) - (next-warn-time time-frame :offset-assert 1024) - (dest vector :inline :offset-assert 1040) - (pad-kj1n23kj1n23 uint32 4 :offset-assert 1056) + ((patrol-anim grunt-anim-info) + (charge-anim grunt-anim-info) + (attack-anim grunt-anim-info) + (knocked-anim grunt-anim-info) + (yellow-hit-anim grunt-anim-info) + (blue-hit-anim grunt-anim-info) + (intro-path path-control) + (pad-jh1b23jhb13 uint32) + (use-charge-anim-index int8) + (knocked-anim-index int8) + (jumping-ambush-path-pt int8) + (grunt-flags uint8) + (state-timeout2 uint64) + (next-warn-time time-frame) + (dest vector :inline) + (pad-kj1n23kj1n23 uint32 4) ) - :heap-base #x3b0 - :method-count-assert 212 - :size-assert #x430 - :flag-assert #xd403b00430 + (:state-methods + attack + falling-ambush + jumping-ambush + jumping-ambush-cont + wait-for-focus + spin-attack + ) (:methods - (attack () _type_ :state 203) - (falling-ambush () _type_ :state 204) - (jumping-ambush () _type_ :state 205) - (jumping-ambush-cont () _type_ :state 206) - (wait-for-focus () _type_ :state 207) - (spin-attack () _type_ :state 208) - (metalhead-grunt-method-209 (_type_ float) process-focusable 209) - (get-nav-info (_type_) nav-enemy-info 210) - (metalhead-grunt-method-211 (_type_) none 211) + (metalhead-grunt-method-209 (_type_ float) process-focusable) + (get-nav-info (_type_) nav-enemy-info) + (metalhead-grunt-method-211 (_type_) none) ) ) ;; definition for method 3 of type metalhead-grunt -(defmethod inspect metalhead-grunt ((this metalhead-grunt)) +(defmethod inspect ((this metalhead-grunt)) (when (not this) (set! this this) (goto cfg-4) @@ -280,7 +278,7 @@ ) ;; definition for method 74 of type metalhead-grunt -(defmethod general-event-handler metalhead-grunt ((this metalhead-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this metalhead-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -340,7 +338,7 @@ ) ;; definition for method 66 of type metalhead-grunt -(defmethod go-ambush metalhead-grunt ((this metalhead-grunt)) +(defmethod go-ambush ((this metalhead-grunt)) (cond ((logtest? (-> this fact enemy-options) (enemy-option user10)) (go (method-of-object this falling-ambush)) @@ -408,7 +406,7 @@ ;; definition for method 93 of type metalhead-grunt ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 metalhead-grunt ((this metalhead-grunt)) +(defmethod enemy-method-93 ((this metalhead-grunt)) (case (-> this jump-why) ((2) (go (method-of-object this jumping-ambush-cont)) @@ -601,7 +599,7 @@ ) ;; definition for method 209 of type metalhead-grunt -(defmethod metalhead-grunt-method-209 metalhead-grunt ((this metalhead-grunt) (arg0 float)) +(defmethod metalhead-grunt-method-209 ((this metalhead-grunt) (arg0 float)) (local-vars (v1-5 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -956,7 +954,7 @@ ) ;; definition for method 77 of type metalhead-grunt -(defmethod enemy-method-77 metalhead-grunt ((this metalhead-grunt) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this metalhead-grunt) (arg0 (pointer float))) (local-vars (v1-72 int) (a2-3 int) (a2-5 int)) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) @@ -1101,7 +1099,7 @@ ) ;; definition for method 78 of type metalhead-grunt -(defmethod enemy-method-78 metalhead-grunt ((this metalhead-grunt) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this metalhead-grunt) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (or (logtest? (-> this grunt-flags) 2) (let ((v1-7 (if (> (-> this skel active-channels) 0) @@ -1203,14 +1201,14 @@ ;; definition for method 211 of type metalhead-grunt ;; WARN: Return type mismatch int vs none. -(defmethod metalhead-grunt-method-211 metalhead-grunt ((this metalhead-grunt)) +(defmethod metalhead-grunt-method-211 ((this metalhead-grunt)) 0 (none) ) ;; definition for method 7 of type metalhead-grunt ;; WARN: Return type mismatch citizen-enemy vs metalhead-grunt. -(defmethod relocate metalhead-grunt ((this metalhead-grunt) (arg0 int)) +(defmethod relocate ((this metalhead-grunt) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) ) @@ -1219,7 +1217,7 @@ ;; definition for method 114 of type metalhead-grunt ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! metalhead-grunt ((this metalhead-grunt)) +(defmethod init-enemy-collision! ((this metalhead-grunt)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1315,13 +1313,13 @@ ) ;; definition for method 210 of type metalhead-grunt -(defmethod get-nav-info metalhead-grunt ((this metalhead-grunt)) +(defmethod get-nav-info ((this metalhead-grunt)) *metalhead-grunt-nav-enemy-info* ) ;; definition for method 115 of type metalhead-grunt ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! metalhead-grunt ((this metalhead-grunt)) +(defmethod init-enemy! ((this metalhead-grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc index 70385e18aab..f93b70f77e6 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc @@ -4,14 +4,10 @@ ;; definition of type metalhead-predator-shot (deftype metalhead-predator-shot (metalhead-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type metalhead-predator-shot -(defmethod inspect metalhead-predator-shot ((this metalhead-predator-shot)) +(defmethod inspect ((this metalhead-predator-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -25,7 +21,7 @@ ;; definition for method 28 of type metalhead-predator-shot ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound metalhead-predator-shot ((this metalhead-predator-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this metalhead-predator-shot) (arg0 projectile-options)) (case arg0 (((projectile-options lose-altitude)) (sound-play "pred-shot-hit") @@ -45,7 +41,7 @@ ;; definition for method 30 of type metalhead-predator-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! metalhead-predator-shot ((this metalhead-predator-shot)) +(defmethod init-proj-collision! ((this metalhead-predator-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -99,7 +95,7 @@ ;; definition for method 31 of type metalhead-predator-shot ;; INFO: Used lq/sq -(defmethod init-proj-settings! metalhead-predator-shot ((this metalhead-predator-shot)) +(defmethod init-proj-settings! ((this metalhead-predator-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'predator-shot) @@ -296,36 +292,34 @@ ;; definition of type metalhead-predator (deftype metalhead-predator (citizen-enemy) - ((los los-control :inline :offset-assert 992) - (want-stop symbol :offset-assert 1140) - (target-pos vector :inline :offset-assert 1152) - (curr-node int32 :offset-assert 1168) - (hide-pos vector :inline :offset-assert 1184) - (next-change int64 :offset-assert 1200) - (shoot-angle degrees :offset-assert 1208) - (miss-amount float :offset-assert 1212) - (ambient-sound-id sound-id :offset-assert 1216) - (shock-effect-time time-frame :offset-assert 1224) - (shock-effect-end int64 :offset-assert 1232) - (fade float :offset-assert 1240) - (dest-fade float :offset-assert 1244) + ((los los-control :inline) + (want-stop symbol) + (target-pos vector :inline) + (curr-node int32) + (hide-pos vector :inline) + (next-change int64) + (shoot-angle degrees) + (miss-amount float) + (ambient-sound-id sound-id) + (shock-effect-time time-frame) + (shock-effect-end int64) + (fade float) + (dest-fade float) ) - :heap-base #x460 - :method-count-assert 209 - :size-assert #x4e0 - :flag-assert #xd1046004e0 + (:state-methods + fire + close-attack + ) (:methods - (fire () _type_ :state 203) - (close-attack () _type_ :state 204) - (metalhead-predator-method-205 (_type_ symbol) none 205) - (metalhead-predator-method-206 (_type_ int float) none 206) - (metalhead-predator-method-207 (_type_ vector vector vector) symbol 207) - (metalhead-predator-method-208 (_type_) none 208) + (metalhead-predator-method-205 (_type_ symbol) none) + (metalhead-predator-method-206 (_type_ int float) none) + (metalhead-predator-method-207 (_type_ vector vector vector) symbol) + (metalhead-predator-method-208 (_type_) none) ) ) ;; definition for method 3 of type metalhead-predator -(defmethod inspect metalhead-predator ((this metalhead-predator)) +(defmethod inspect ((this metalhead-predator)) (when (not this) (set! this this) (goto cfg-4) @@ -374,7 +368,7 @@ ;; definition for method 208 of type metalhead-predator ;; WARN: Return type mismatch int vs none. -(defmethod metalhead-predator-method-208 metalhead-predator ((this metalhead-predator)) +(defmethod metalhead-predator-method-208 ((this metalhead-predator)) (cond ((< (-> this hit-points) 2) (when (!= (-> this dest-fade) 128.0) @@ -429,7 +423,7 @@ ) ;; definition for method 55 of type metalhead-predator -(defmethod track-target! metalhead-predator ((this metalhead-predator)) +(defmethod track-target! ((this metalhead-predator)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -445,7 +439,7 @@ ;; definition for method 74 of type metalhead-predator ;; WARN: disable def twice: 21. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler metalhead-predator ((this metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -465,7 +459,7 @@ ) ;; definition for method 77 of type metalhead-predator -(defmethod enemy-method-77 metalhead-predator ((this metalhead-predator) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this metalhead-predator) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (case (-> this incoming knocked-type) @@ -558,7 +552,7 @@ ) ;; definition for method 78 of type metalhead-predator -(defmethod enemy-method-78 metalhead-predator ((this metalhead-predator) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this metalhead-predator) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (case (-> this incoming knocked-type) @@ -634,13 +628,13 @@ ) ;; definition for method 26 of type metalhead-predator -(defmethod get-inv-mass metalhead-predator ((this metalhead-predator)) +(defmethod get-inv-mass ((this metalhead-predator)) 0.5 ) ;; definition for method 207 of type metalhead-predator ;; INFO: Used lq/sq -(defmethod metalhead-predator-method-207 metalhead-predator ((this metalhead-predator) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod metalhead-predator-method-207 ((this metalhead-predator) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f0-0 1228.8) (f30-0 6144.0) @@ -713,7 +707,7 @@ ;; definition for method 206 of type metalhead-predator ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod metalhead-predator-method-206 metalhead-predator ((this metalhead-predator) (arg0 int) (arg1 float)) +(defmethod metalhead-predator-method-206 ((this metalhead-predator) (arg0 int) (arg1 float)) (local-vars (sv-240 vector) (sv-256 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1061,7 +1055,7 @@ ;; definition for method 205 of type metalhead-predator ;; WARN: Return type mismatch int vs none. -(defmethod metalhead-predator-method-205 metalhead-predator ((this metalhead-predator) (arg0 symbol)) +(defmethod metalhead-predator-method-205 ((this metalhead-predator) (arg0 symbol)) (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (+ (-> v1-1 specific 0) -2))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child (+ a0-1 2)))) @@ -1078,7 +1072,7 @@ ;; definition for method 114 of type metalhead-predator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! metalhead-predator ((this metalhead-predator)) +(defmethod init-enemy-collision! ((this metalhead-predator)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1159,13 +1153,13 @@ ) ;; definition for method 7 of type metalhead-predator -(defmethod relocate metalhead-predator ((this metalhead-predator) (arg0 int)) +(defmethod relocate ((this metalhead-predator) (arg0 int)) (call-parent-method this arg0) ) ;; definition for method 115 of type metalhead-predator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! metalhead-predator ((this metalhead-predator)) +(defmethod init-enemy! ((this metalhead-predator)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1204,7 +1198,7 @@ ;; definition for method 181 of type metalhead-predator ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! metalhead-predator ((this metalhead-predator)) +(defmethod citizen-init! ((this metalhead-predator)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen-enemy citizen-init!))) (t9-0 this) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine-h_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine-h_REF.gc index 6d465ec3eeb..21412ba293c 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine-h_REF.gc @@ -3,24 +3,21 @@ ;; definition of type nav-segment (deftype nav-segment (structure) - ((vertex vector 2 :inline :offset-assert 0) - (length float :offset 12) - (spawn-spacing float :offset 28) - (branch nav-branch :offset-assert 32) - (nav-mesh-id uint32 :offset-assert 36) - (id uint16 :offset-assert 40) - (cell-id uint16 :offset-assert 42) - (from-cell-id uint16 :offset-assert 44) - (tracker-id int8 :offset-assert 46) - (pad0 int8 :offset-assert 47) + ((vertex vector 2 :inline) + (length float :overlay-at (-> vertex 0 data 3)) + (spawn-spacing float :offset 28) + (branch nav-branch) + (nav-mesh-id uint32) + (id uint16) + (cell-id uint16) + (from-cell-id uint16) + (tracker-id int8) + (pad0 int8) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type nav-segment -(defmethod inspect nav-segment ((this nav-segment)) +(defmethod inspect ((this nav-segment)) (when (not this) (set! this this) (goto cfg-4) @@ -42,28 +39,25 @@ ;; definition of type vis-cell (deftype vis-cell (structure) - ((sphere sphere :inline :offset-assert 0) - (segment-array (inline-array nav-segment) :offset-assert 16) - (vis-id uint16 :offset-assert 20) - (id uint16 :offset-assert 22) - (incoming-segment-count int8 :offset-assert 24) - (segment-count int8 :offset-assert 25) - (flags vis-cell-flag :offset-assert 26) - (alloc-segment-count int8 :offset 26) - (prev-flags vis-cell-flag :offset-assert 27) - (pad0 uint32 :offset 28) + ((sphere sphere :inline) + (segment-array (inline-array nav-segment)) + (vis-id uint16) + (id uint16) + (incoming-segment-count int8) + (segment-count int8) + (flags vis-cell-flag) + (alloc-segment-count int8 :overlay-at flags) + (prev-flags vis-cell-flag) + (pad0 uint32 :offset 28) ) - :method-count-assert 11 - :size-assert #x20 - :flag-assert #xb00000020 (:methods - (reset-segment-counts (_type_) none 9) - (debug-draw (_type_) none 10) + (reset-segment-counts (_type_) none) + (debug-draw (_type_) none) ) ) ;; definition for method 3 of type vis-cell -(defmethod inspect vis-cell ((this vis-cell)) +(defmethod inspect ((this vis-cell)) (when (not this) (set! this this) (goto cfg-16) @@ -109,19 +103,16 @@ ;; definition of type vis-grid-pos (deftype vis-grid-pos (structure) - ((data int8 3 :offset-assert 0) - (x int8 :offset 0) - (y int8 :offset 1) - (z int8 :offset 2) + ((data int8 3) + (x int8 :overlay-at (-> data 0)) + (y int8 :overlay-at (-> data 1)) + (z int8 :overlay-at (-> data 2)) ) :pack-me - :method-count-assert 9 - :size-assert #x3 - :flag-assert #x900000003 ) ;; definition for method 3 of type vis-grid-pos -(defmethod inspect vis-grid-pos ((this vis-grid-pos)) +(defmethod inspect ((this vis-grid-pos)) (when (not this) (set! this this) (goto cfg-4) @@ -137,16 +128,13 @@ ;; definition of type vis-grid-box (deftype vis-grid-box (structure) - ((min vis-grid-pos :inline :offset-assert 0) - (max vis-grid-pos :inline :offset-assert 3) + ((min vis-grid-pos :inline) + (max vis-grid-pos :inline) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) ;; definition for method 3 of type vis-grid-box -(defmethod inspect vis-grid-box ((this vis-grid-box)) +(defmethod inspect ((this vis-grid-box)) (when (not this) (set! this this) (goto cfg-4) @@ -160,21 +148,18 @@ ;; definition of type vis-ray (deftype vis-ray (structure) - ((pos vector :inline :offset-assert 0) - (dir vector :inline :offset-assert 16) - (dest-pos vector :inline :offset-assert 32) - (plane plane :inline :offset-assert 48) - (grid-pos vis-grid-pos :inline :offset-assert 64) - (len float :offset-assert 68) - (cell vis-cell :offset-assert 72) + ((pos vector :inline) + (dir vector :inline) + (dest-pos vector :inline) + (plane plane :inline) + (grid-pos vis-grid-pos :inline) + (len float) + (cell vis-cell) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) ;; definition for method 3 of type vis-ray -(defmethod inspect vis-ray ((this vis-ray)) +(defmethod inspect ((this vis-ray)) (when (not this) (set! this this) (goto cfg-4) @@ -193,26 +178,23 @@ ;; definition of type grid-info (deftype grid-info (structure) - ((axis-scale float 3 :offset-assert 0) - (dimension-array int8 3 :offset-assert 12) - (pad0 uint8 1 :offset-assert 15) - (box bounding-box :inline :offset-assert 16) - (cell-size vector :inline :offset-assert 48) + ((axis-scale float 3) + (dimension-array int8 3) + (pad0 uint8 1) + (box bounding-box :inline) + (cell-size vector :inline) ) - :method-count-assert 14 - :size-assert #x40 - :flag-assert #xe00000040 (:methods - (setup-grid-from-bounding-box (_type_ (pointer bounding-box) int int) none 9) - (lookup-cell-for-point (_type_ vis-grid-pos vector) none 10) - (lookup-box-for-sphere (_type_ vis-grid-box vector) none 11) - (debug-draw-grid (_type_ rgba) none 12) - (debug-draw-cell (_type_ vis-grid-pos rgba) none 13) + (setup-grid-from-bounding-box (_type_ (pointer bounding-box) int int) none) + (lookup-cell-for-point (_type_ vis-grid-pos vector) none) + (lookup-box-for-sphere (_type_ vis-grid-box vector) none) + (debug-draw-grid (_type_ rgba) none) + (debug-draw-cell (_type_ vis-grid-pos rgba) none) ) ) ;; definition for method 3 of type grid-info -(defmethod inspect grid-info ((this grid-info)) +(defmethod inspect ((this grid-info)) (when (not this) (set! this this) (goto cfg-4) @@ -229,34 +211,31 @@ ;; definition of type city-level-info (deftype city-level-info (structure) - ((grid-info grid-info :inline :offset-assert 0) - (cell-array (inline-array vis-cell) :offset-assert 64) - (segment-count int16 :offset-assert 68) - (cell-count uint16 :offset-assert 70) - (segment-array (inline-array nav-segment) :offset-assert 72) - (nav-graph nav-graph :offset-assert 76) - (camera-ceiling meters :offset-assert 80) - (pad-array int8 56 :offset-assert 84) + ((grid-info grid-info :inline) + (cell-array (inline-array vis-cell)) + (segment-count int16) + (cell-count uint16) + (segment-array (inline-array nav-segment)) + (nav-graph nav-graph) + (camera-ceiling meters) + (pad-array int8 56) ) - :method-count-assert 19 - :size-assert #x8c - :flag-assert #x130000008c (:methods - (city-level-info-method-9 (_type_) symbol 9) - (init-vis-ray (_type_ vis-ray vector vector) none 10) - (city-level-info-method-11 (_type_ vis-ray) none 11) - (city-level-info-method-12 (_type_ vector nav-branch vector) vector 12) - (lookup-cell-by-position (_type_ vector) vis-cell 13) - (get-first-cell-in-box (_type_ vis-grid-box) vis-cell 14) - (sphere-in-grid? (_type_ vector int) symbol 15) - (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none 16) - (update-suppressions-from-traffic-engine (_type_ traffic-engine) none 17) - (city-level-info-method-18 (_type_) none 18) + (city-level-info-method-9 (_type_) symbol) + (init-vis-ray (_type_ vis-ray vector vector) none) + (city-level-info-method-11 (_type_ vis-ray) none) + (city-level-info-method-12 (_type_ vector nav-branch vector) vector) + (lookup-cell-by-position (_type_ vector) vis-cell) + (get-first-cell-in-box (_type_ vis-grid-box) vis-cell) + (sphere-in-grid? (_type_ vector int) symbol) + (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) + (update-suppressions-from-traffic-engine (_type_ traffic-engine) none) + (city-level-info-method-18 (_type_) none) ) ) ;; definition for method 3 of type city-level-info -(defmethod inspect city-level-info ((this city-level-info)) +(defmethod inspect ((this city-level-info)) (when (not this) (set! this this) (goto cfg-4) @@ -276,28 +255,25 @@ ;; definition of type traffic-level-data (deftype traffic-level-data (structure) - ((city-info city-level-info :offset-assert 0) - (active-cell-count uint8 :offset-assert 4) - (newly-active-cell-count uint8 :offset-assert 5) - (active-cell-list vis-cell 255 :offset-assert 8) - (newly-active-cell-list vis-cell 255 :offset-assert 1028) - (active-cell-box bounding-box :inline :offset-assert 2048) + ((city-info city-level-info) + (active-cell-count uint8) + (newly-active-cell-count uint8) + (active-cell-list vis-cell 255) + (newly-active-cell-list vis-cell 255) + (active-cell-box bounding-box :inline) ) - :method-count-assert 15 - :size-assert #x820 - :flag-assert #xf00000820 (:methods - (reset (_type_) none 9) - (add-active-cell (_type_ vis-cell) none 10) - (remove-active-cell (_type_ int) none 11) - (add-newly-active-cell (_type_ vis-cell) none 12) - (per-frame-cell-update (_type_) none 13) - (debug-draw (_type_) none 14) + (reset (_type_) none) + (add-active-cell (_type_ vis-cell) none) + (remove-active-cell (_type_ int) none) + (add-newly-active-cell (_type_ vis-cell) none) + (per-frame-cell-update (_type_) none) + (debug-draw (_type_) none) ) ) ;; definition for method 3 of type traffic-level-data -(defmethod inspect traffic-level-data ((this traffic-level-data)) +(defmethod inspect ((this traffic-level-data)) (when (not this) (set! this this) (goto cfg-4) @@ -315,18 +291,15 @@ ;; definition of type traffic-suppression-box (deftype traffic-suppression-box (structure) - ((data uint8 32 :offset-assert 0) - (bbox bounding-box :inline :offset 0) - (flags traffic-suppression-box-flags :offset 12) - (duration uint32 :offset 28) + ((data uint8 32) + (bbox bounding-box :inline :overlay-at (-> data 0)) + (flags traffic-suppression-box-flags :overlay-at (-> data 12)) + (duration uint32 :overlay-at (-> data 28)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type traffic-suppression-box -(defmethod inspect traffic-suppression-box ((this traffic-suppression-box)) +(defmethod inspect ((this traffic-suppression-box)) (when (not this) (set! this this) (goto cfg-4) @@ -342,20 +315,17 @@ ;; definition of type traffic-guard-type-info (deftype traffic-guard-type-info (structure) - ((object-type traffic-type :offset-assert 0) - (max-target-count int8 :offset-assert 1) - (min-target-count int8 :offset-assert 2) - (target-count int8 :offset-assert 3) - (count int8 :offset-assert 4) - (change-to-type uint8 :offset-assert 5) + ((object-type traffic-type) + (max-target-count int8) + (min-target-count int8) + (target-count int8) + (count int8) + (change-to-type uint8) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) ;; definition for method 3 of type traffic-guard-type-info -(defmethod inspect traffic-guard-type-info ((this traffic-guard-type-info)) +(defmethod inspect ((this traffic-guard-type-info)) (when (not this) (set! this this) (goto cfg-4) @@ -373,21 +343,18 @@ ;; definition of type traffic-guard-type-settings (deftype traffic-guard-type-settings (structure) - ((target-count int8 :offset-assert 0) - (inaccuracy float :offset-assert 4) - (acquire-delay uint16 :offset-assert 8) - (shot-delay uint16 :offset-assert 10) - (burst-delay uint16 :offset-assert 12) - (shot-count int8 :offset-assert 14) - (rand-shot-count int8 :offset-assert 15) + ((target-count int8) + (inaccuracy float) + (acquire-delay uint16) + (shot-delay uint16) + (burst-delay uint16) + (shot-count int8) + (rand-shot-count int8) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type traffic-guard-type-settings -(defmethod inspect traffic-guard-type-settings ((this traffic-guard-type-settings)) +(defmethod inspect ((this traffic-guard-type-settings)) (when (not this) (set! this this) (goto cfg-4) @@ -406,21 +373,18 @@ ;; definition of type traffic-alert-state-settings (deftype traffic-alert-state-settings (structure) - ((guard-settings-array traffic-guard-type-settings 6 :inline :offset-assert 0) - (ped-tazer traffic-guard-type-settings :inline :offset 0) - (ped-rifle traffic-guard-type-settings :inline :offset 16) - (ped-grenade traffic-guard-type-settings :inline :offset 32) - (ped-roboguard traffic-guard-type-settings :inline :offset 48) - (bike-turret traffic-guard-type-settings :inline :offset 64) - (hellcat-turret traffic-guard-type-settings :inline :offset 80) + ((guard-settings-array traffic-guard-type-settings 6 :inline) + (ped-tazer traffic-guard-type-settings :inline :overlay-at (-> guard-settings-array 0)) + (ped-rifle traffic-guard-type-settings :inline :overlay-at (-> guard-settings-array 1)) + (ped-grenade traffic-guard-type-settings :inline :overlay-at (-> guard-settings-array 2)) + (ped-roboguard traffic-guard-type-settings :inline :overlay-at (-> guard-settings-array 3)) + (bike-turret traffic-guard-type-settings :inline :overlay-at (-> guard-settings-array 4)) + (hellcat-turret traffic-guard-type-settings :inline :overlay-at (-> guard-settings-array 5)) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type traffic-alert-state-settings -(defmethod inspect traffic-alert-state-settings ((this traffic-alert-state-settings)) +(defmethod inspect ((this traffic-alert-state-settings)) (when (not this) (set! this this) (goto cfg-4) @@ -439,20 +403,17 @@ ;; definition of type traffic-target-status (deftype traffic-target-status (structure) - ((flags traffic-target-flag :offset-assert 0) - (handle handle :offset-assert 8) - (last-seen-time time-frame :offset-assert 16) - (position vector :inline :offset-assert 32) - (velocity vector :inline :offset-assert 48) - (move-position vector :inline :offset-assert 64) + ((flags traffic-target-flag) + (handle handle) + (last-seen-time time-frame) + (position vector :inline) + (velocity vector :inline) + (move-position vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type traffic-target-status -(defmethod inspect traffic-target-status ((this traffic-target-status)) +(defmethod inspect ((this traffic-target-status)) (when (not this) (set! this this) (goto cfg-14) @@ -488,32 +449,29 @@ ;; definition of type traffic-alert-state (deftype traffic-alert-state (structure) - ((flags traffic-alert-flag :offset-assert 0) - (level uint8 :offset-assert 1) - (max-level uint8 :offset-assert 2) - (guards-in-sight-of-target int8 :offset-assert 3) - (guard-aim-count int8 :offset-assert 4) - (guard-inaccuracy-factor float :offset-assert 8) - (guard-target-level float :offset-assert 12) - (duration uint32 :offset-assert 16) - (start-time time-frame :offset-assert 24) - (notify-time time-frame :offset-assert 32) - (alarm-sound-id sound-id :offset-assert 40) - (target-status-array traffic-target-status 3 :inline :offset-assert 48) - (settings traffic-alert-state-settings :inline :offset-assert 288) - (guard-type-info-array traffic-guard-type-info 6 :inline :offset-assert 384) - (guard-type-mask-from-object-type uint32 126 :offset-assert 480) + ((flags traffic-alert-flag) + (level uint8) + (max-level uint8) + (guards-in-sight-of-target int8) + (guard-aim-count int8) + (guard-inaccuracy-factor float) + (guard-target-level float) + (duration uint32) + (start-time time-frame) + (notify-time time-frame) + (alarm-sound-id sound-id) + (target-status-array traffic-target-status 3 :inline) + (settings traffic-alert-state-settings :inline) + (guard-type-info-array traffic-guard-type-info 6 :inline) + (guard-type-mask-from-object-type uint32 126) ) - :method-count-assert 10 - :size-assert #x3d8 - :flag-assert #xa000003d8 (:methods - (reset (_type_) none 9) + (reset (_type_) none) ) ) ;; definition for method 3 of type traffic-alert-state -(defmethod inspect traffic-alert-state ((this traffic-alert-state)) +(defmethod inspect ((this traffic-alert-state)) (when (not this) (set! this this) (goto cfg-16) @@ -561,26 +519,23 @@ ;; definition of type traffic-object-type-info (deftype traffic-object-type-info (structure) - ((flags traffic-type-flags :offset-assert 0) - (target-count int8 :offset-assert 1) - (active-count int8 :offset-assert 2) - (inactive-count int8 :offset-assert 3) - (reserve-count uint16 :offset-assert 4) - (killed-count uint16 :offset-assert 6) - (want-count int8 :offset-assert 8) - (tracker-index uint8 :offset-assert 9) - (parking-spot-prob uint8 :offset-assert 10) - (guard-type uint8 :offset-assert 11) - (array (pointer handle) :offset-assert 12) - (level symbol :offset-assert 16) + ((flags traffic-type-flags) + (target-count int8) + (active-count int8) + (inactive-count int8) + (reserve-count uint16) + (killed-count uint16) + (want-count int8) + (tracker-index uint8) + (parking-spot-prob uint8) + (guard-type uint8) + (array (pointer handle)) + (level symbol) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type traffic-object-type-info -(defmethod inspect traffic-object-type-info ((this traffic-object-type-info)) +(defmethod inspect ((this traffic-object-type-info)) (when (not this) (set! this this) (goto cfg-4) @@ -604,24 +559,21 @@ ;; definition of type traffic-suppressor (deftype traffic-suppressor (structure) - ((flags traffic-suppression-flags :offset-assert 0) - (bbox bounding-box :inline :offset-assert 16) - (array traffic-suppression-box 16 :inline :offset-assert 48) + ((flags traffic-suppression-flags) + (bbox bounding-box :inline) + (array traffic-suppression-box 16 :inline) ) - :method-count-assert 14 - :size-assert #x230 - :flag-assert #xe00000230 (:methods - (reset-boxes (_type_) none 9) - (add-new-supression-box (_type_ traffic-suppression-params) none 10) - (remove-box-by-id (_type_ int) none 11) - (update-box-from-params (_type_ traffic-suppression-params) none 12) - (debug-draw (_type_) none 13) + (reset-boxes (_type_) none) + (add-new-supression-box (_type_ traffic-suppression-params) none) + (remove-box-by-id (_type_ int) none) + (update-box-from-params (_type_ traffic-suppression-params) none) + (debug-draw (_type_) none) ) ) ;; definition for method 3 of type traffic-suppressor -(defmethod inspect traffic-suppressor ((this traffic-suppressor)) +(defmethod inspect ((this traffic-suppressor)) (when (not this) (set! this this) (goto cfg-4) @@ -636,42 +588,39 @@ ;; definition of type traffic-tracker (deftype traffic-tracker (structure) - ((traffic traffic-engine :offset-assert 0) - (object-hash spatial-hash :offset-assert 4) - (rand float :offset-assert 8) - (id uint8 :offset-assert 12) - (active-object-count uint8 :offset-assert 13) - (inactive-object-count int8 :offset-assert 14) - (active-object-list handle 126 :offset-assert 16) - (active-object-type-list traffic-type 126 :offset-assert 1024) + ((traffic traffic-engine) + (object-hash spatial-hash) + (rand float) + (id uint8) + (active-object-count uint8) + (inactive-object-count int8) + (active-object-list handle 126) + (active-object-type-list traffic-type 126) ) - :method-count-assert 27 - :size-assert #x47e - :flag-assert #x1b0000047e (:methods - (traffic-tracker-method-9 (_type_) none 9) - (traffic-tracker-method-10 (_type_) none 10) - (traffic-tracker-method-11 (_type_) none 11) - (add-active-process (_type_ traffic-type handle) none 12) - (remove-active-process (_type_ int) handle 13) - (add-reserved-process (_type_ traffic-type handle) none 14) - (get-from-inactive-by-type (_type_ traffic-type) handle 15) - (get-from-inactive-by-handle (_type_ traffic-type handle) handle 16) - (deactivate-object (_type_ int symbol) none 17) - (set-process-to-killed (_type_ process) none 18) - (deactivate-all (_type_ symbol) none 19) - (deactivate-all-of-type (_type_ traffic-type symbol) none 20) - (activate-from-params (_type_ traffic-object-spawn-params) none 21) - (activate-by-type (_type_ traffic-type nav-segment float) none 22) - (activate-by-handle (_type_ traffic-object-spawn-params) none 23) - (reset (_type_ uint traffic-engine) none 24) - (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none 25) - (for-all-active-processes-of-type (_type_ traffic-type (function process-focusable traffic-object-type-info none)) none 26) + (traffic-tracker-method-9 (_type_) none) + (traffic-tracker-method-10 (_type_) none) + (traffic-tracker-method-11 (_type_) none) + (add-active-process (_type_ traffic-type handle) none) + (remove-active-process (_type_ int) handle) + (add-reserved-process (_type_ traffic-type handle) none) + (get-from-inactive-by-type (_type_ traffic-type) handle) + (get-from-inactive-by-handle (_type_ traffic-type handle) handle) + (deactivate-object (_type_ int symbol) none) + (set-process-to-killed (_type_ process) none) + (deactivate-all (_type_ symbol) none) + (deactivate-all-of-type (_type_ traffic-type symbol) none) + (activate-from-params (_type_ traffic-object-spawn-params) none) + (activate-by-type (_type_ traffic-type nav-segment float) none) + (activate-by-handle (_type_ traffic-object-spawn-params) none) + (reset (_type_ uint traffic-engine) none) + (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none) + (for-all-active-processes-of-type (_type_ traffic-type (function process-focusable traffic-object-type-info none)) none) ) ) ;; definition for method 3 of type traffic-tracker -(defmethod inspect traffic-tracker ((this traffic-tracker)) +(defmethod inspect ((this traffic-tracker)) (when (not this) (set! this this) (goto cfg-4) @@ -691,102 +640,99 @@ ;; definition of type traffic-engine (deftype traffic-engine (basic) - ((object-hash spatial-hash :offset-assert 4) - (manager handle :offset-assert 8) - (inv-density-factor float :offset-assert 16) - (sync-clock uint8 :offset-assert 20) - (sync-mask-8 uint8 :offset-assert 21) - (sync-mask-16 uint16 :offset-assert 22) - (sync-mask-32 uint32 :offset-assert 24) - (sync-array uint8 4 :offset-assert 28) - (flags uint8 :offset-assert 32) - (alert-state traffic-alert-state :inline :offset-assert 48) - (level-data-array traffic-level-data 2 :inline :offset-assert 1040) - (object-type-info-array traffic-object-type-info 21 :inline :offset-assert 5200) - (tracker-array traffic-tracker 2 :inline :offset-assert 5872) - (citizen-tracker-array traffic-tracker :inline :offset 5872) - (vehicle-tracker-array traffic-tracker :inline :offset 7024) - (inactive-object-array handle 420 :offset-assert 8176) - (suppressor traffic-suppressor :inline :offset-assert 11536) - (danger-sphere-count int8 :offset-assert 12096) - (pad int8 15 :offset-assert 12097) - (danger-sphere-array traffic-danger-info 4 :inline :offset-assert 12112) + ((object-hash spatial-hash) + (manager handle) + (inv-density-factor float) + (sync-clock uint8) + (sync-mask-8 uint8) + (sync-mask-16 uint16) + (sync-mask-32 uint32) + (sync-array uint8 4) + (flags uint8) + (alert-state traffic-alert-state :inline) + (level-data-array traffic-level-data 2 :inline) + (object-type-info-array traffic-object-type-info 21 :inline) + (tracker-array traffic-tracker 2 :inline) + (citizen-tracker-array traffic-tracker :inline :overlay-at (-> tracker-array 0)) + (vehicle-tracker-array traffic-tracker :inline :offset 7024) + (inactive-object-array handle 420) + (suppressor traffic-suppressor :inline) + (danger-sphere-count int8) + (pad int8 15) + (danger-sphere-array traffic-danger-info 4 :inline) ) - :method-count-assert 74 - :size-assert #x3050 - :flag-assert #x4a00003050 (:methods - (new (symbol type) _type_ 0) - (update-traffic (_type_) none 9) - (reset-and-init-from-manager (_type_ process) none 10) - (stop-alarm-sound (_type_) none 11) - (debug-unused (_type_) none 12) - (add-object (_type_ traffic-type process) none 13) - (sphere-in-loaded-city-infos? (_type_ vector int) symbol 14) - (activate-one-citizen (_type_ nav-segment float) none 15) - (activate-one-vehicle (_type_ nav-segment float) none 16) - (can-dest-be-used? (_type_ nav-branch) symbol 17) - (child-killed (_type_ process) none 18) - (deactivate-all-from-level (_type_ symbol) none 19) - (find-best-segment (_type_ vector vector int) nav-segment 20) - (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none 21) - (add-danger (_type_ traffic-danger-info) none 22) - (guard-count (_type_) int 23) - (set-target-level (_type_ float) none 24) - (set-guard-target-level (_type_ float) none 25) - (deactivate-all (_type_) none 26) - (deactivate-by-type (_type_ traffic-type) none 27) - (maybe-increase-guard-aim-count (_type_) symbol 28) - (restore-default-settings (_type_) none 29) - (increase-alert-level (_type_ int target) none 30) - (decrease-alert-level (_type_ int) none 31) - (set-alert-level (_type_ int) none 32) - (set-max-alert-level (_type_ int) none 33) - (set-alert-duration (_type_ time-frame) none 34) - (get-alert-level (_type_) int 35) - (get-target (_type_) target 36) - (set-object-target-level (_type_ int float) none 37) - (set-object-target-count (_type_ int int) none 38) - (set-object-reserve-count (_type_ int uint) none 39) - (get-object-reserve-count (_type_ int) int 40) - (get-object-remaining-count (_type_ int) int 41) - (activate-object (_type_ traffic-object-spawn-params) none 42) - (activate-by-handle (_type_ traffic-object-spawn-params) none 43) - (set-parking-spot-prob (_type_ int float) none 44) - (get-random-parking-spot-type (_type_) traffic-type 45) - (new-suppression-box (_type_ traffic-suppression-params) none 46) - (remove-suppression-box (_type_ traffic-suppression-params) none 47) - (update-suppression-box (_type_ traffic-suppression-params) none 48) - (traffic-engine-method-49 (_type_ vector int traffic-target-status) traffic-target-status 49) - (find-closest-to-with-collide-lists (_type_ process-drawable collide-spec) process-focusable 50) - (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none 51) - (send-alert-events (_type_) none 52) - (end-pursuit-by-type (_type_ traffic-type) none 53) - (get-traffic-guard-type-settings (_type_ int) traffic-guard-type-settings 54) - (get-guard-type-for-traffic-obj (_type_ int) uint 55) - (get-traffic-guard-change-to-type (_type_ int) uint 56) - (set-guard-target-count-range (_type_ int int int) none 57) - (set-object-auto-activate (_type_ int object) none 58) - (debug-check-proc-in-tracker (_type_ process int) none 59) - (kill-traffic-sphere (_type_ sphere) none 60) - (level-link (_type_ level) none 61) - (level-unlink (_type_ level) none 62) - (traffic-engine-method-63 (_type_) none 63) - (traffic-engine-method-64 (_type_) none 64) - (handle-new-vis-cell (_type_ vis-cell) none 65) - (update-sync-from-frame-counter (_type_) none 66) - (update-guards (_type_) none 67) - (update-traffic-amount (_type_) none 68) - (update-danger (_type_) none 69) - (update-danger-from-target (_type_) none 70) - (update-alert-state (_type_) none 71) - (update-suppressor (_type_) none 72) - (recompute-supressions (_type_) none 73) + (new (symbol type) _type_) + (update-traffic (_type_) none) + (reset-and-init-from-manager (_type_ process) none) + (stop-alarm-sound (_type_) none) + (debug-unused (_type_) none) + (add-object (_type_ traffic-type process) none) + (sphere-in-loaded-city-infos? (_type_ vector int) symbol) + (activate-one-citizen (_type_ nav-segment float) none) + (activate-one-vehicle (_type_ nav-segment float) none) + (can-dest-be-used? (_type_ nav-branch) symbol) + (child-killed (_type_ process) none) + (deactivate-all-from-level (_type_ symbol) none) + (find-best-segment (_type_ vector vector int) nav-segment) + (callback-on-nav-segments-in-sphere (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct nav-segment none)) none) + (add-danger (_type_ traffic-danger-info) none) + (guard-count (_type_) int) + (set-target-level (_type_ float) none) + (set-guard-target-level (_type_ float) none) + (deactivate-all (_type_) none) + (deactivate-by-type (_type_ traffic-type) none) + (maybe-increase-guard-aim-count (_type_) symbol) + (restore-default-settings (_type_) none) + (increase-alert-level (_type_ int target) none) + (decrease-alert-level (_type_ int) none) + (set-alert-level (_type_ int) none) + (set-max-alert-level (_type_ int) none) + (set-alert-duration (_type_ time-frame) none) + (get-alert-level (_type_) int) + (get-target (_type_) target) + (set-object-target-level (_type_ int float) none) + (set-object-target-count (_type_ int int) none) + (set-object-reserve-count (_type_ int uint) none) + (get-object-reserve-count (_type_ int) int) + (get-object-remaining-count (_type_ int) int) + (activate-object (_type_ traffic-object-spawn-params) none) + (activate-by-handle (_type_ traffic-object-spawn-params) none) + (set-parking-spot-prob (_type_ int float) none) + (get-random-parking-spot-type (_type_) traffic-type) + (new-suppression-box (_type_ traffic-suppression-params) none) + (remove-suppression-box (_type_ traffic-suppression-params) none) + (update-suppression-box (_type_ traffic-suppression-params) none) + (traffic-engine-method-49 (_type_ vector int traffic-target-status) traffic-target-status) + (find-closest-to-with-collide-lists (_type_ process-drawable collide-spec) process-focusable) + (for-all-active-processes (_type_ (function process-focusable traffic-object-type-info none)) none) + (send-alert-events (_type_) none) + (end-pursuit-by-type (_type_ traffic-type) none) + (get-traffic-guard-type-settings (_type_ int) traffic-guard-type-settings) + (get-guard-type-for-traffic-obj (_type_ int) uint) + (get-traffic-guard-change-to-type (_type_ int) uint) + (set-guard-target-count-range (_type_ int int int) none) + (set-object-auto-activate (_type_ int object) none) + (debug-check-proc-in-tracker (_type_ process int) none) + (kill-traffic-sphere (_type_ sphere) none) + (level-link (_type_ level) none) + (level-unlink (_type_ level) none) + (traffic-engine-method-63 (_type_) none) + (traffic-engine-method-64 (_type_) none) + (handle-new-vis-cell (_type_ vis-cell) none) + (update-sync-from-frame-counter (_type_) none) + (update-guards (_type_) none) + (update-traffic-amount (_type_) none) + (update-danger (_type_) none) + (update-danger-from-target (_type_) none) + (update-alert-state (_type_) none) + (update-suppressor (_type_) none) + (recompute-supressions (_type_) none) ) ) ;; definition for method 3 of type traffic-engine -(defmethod inspect traffic-engine ((this traffic-engine)) +(defmethod inspect ((this traffic-engine)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine_REF.gc index 30ca88c4097..7aacbea4670 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine_REF.gc @@ -39,7 +39,7 @@ ;; definition for method 10 of type vis-cell ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw vis-cell ((this vis-cell)) +(defmethod debug-draw ((this vis-cell)) (dotimes (s5-0 (-> this segment-count)) (let ((s4-0 (-> this segment-array s5-0))) (add-debug-line @@ -60,7 +60,7 @@ ;; definition for method 9 of type vis-cell ;; WARN: Return type mismatch int vs none. -(defmethod reset-segment-counts vis-cell ((this vis-cell)) +(defmethod reset-segment-counts ((this vis-cell)) (set! (-> this incoming-segment-count) 0) (set! (-> this segment-count) 0) 0 @@ -69,7 +69,7 @@ ;; definition for method 9 of type grid-info ;; WARN: Return type mismatch int vs none. -(defmethod setup-grid-from-bounding-box grid-info ((this grid-info) (arg0 (pointer bounding-box)) (arg1 int) (arg2 int)) +(defmethod setup-grid-from-bounding-box ((this grid-info) (arg0 (pointer bounding-box)) (arg1 int) (arg2 int)) "Set up a grid which fills the given bounding box" (mem-copy! (the-as pointer (-> this box)) arg0 32) (let ((v1-0 (new 'stack-no-clear 'vector))) @@ -111,7 +111,7 @@ ;; definition for method 10 of type grid-info ;; WARN: Return type mismatch int vs none. -(defmethod lookup-cell-for-point grid-info ((this grid-info) (arg0 vis-grid-pos) (arg1 vector)) +(defmethod lookup-cell-for-point ((this grid-info) (arg0 vis-grid-pos) (arg1 vector)) "Get the grid cell containing the point (or closest, if outside the grid)" (set! (-> arg0 x) (max 0 (min (the int (* (- (-> arg1 x) (-> this box min x)) (-> this axis-scale 0))) @@ -137,7 +137,7 @@ ;; definition for method 11 of type grid-info ;; WARN: Return type mismatch int vs none. -(defmethod lookup-box-for-sphere grid-info ((this grid-info) (arg0 vis-grid-box) (arg1 vector)) +(defmethod lookup-box-for-sphere ((this grid-info) (arg0 vis-grid-box) (arg1 vector)) "Get the box of cells containing the given sphere" (rlet ((vf0 :class vf) (vf4 :class vf) @@ -178,7 +178,7 @@ ;; definition for method 13 of type grid-info ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-cell grid-info ((this grid-info) (arg0 vis-grid-pos) (arg1 rgba)) +(defmethod debug-draw-cell ((this grid-info) (arg0 vis-grid-pos) (arg1 rgba)) (let ((v1-0 (new 'stack-no-clear 'bounding-box))) (dotimes (a3-0 3) (set! (-> v1-0 min data a3-0) @@ -194,14 +194,14 @@ ;; definition for method 12 of type grid-info ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-grid grid-info ((this grid-info) (arg0 rgba)) +(defmethod debug-draw-grid ((this grid-info) (arg0 rgba)) (draw-grid (the-as vector (-> this box)) (-> this box max) (-> this dimension-array) arg0) 0 (none) ) ;; definition for method 9 of type traffic-suppression-params -(defmethod try-creating-new-suppression-box traffic-suppression-params ((this traffic-suppression-params)) +(defmethod try-creating-new-suppression-box ((this traffic-suppression-params)) "Try getting new suppression box, return if it succeeded. ID is stored in the params." (cond ((= (-> this id) -1) @@ -215,7 +215,7 @@ ) ;; definition for method 10 of type traffic-suppression-params -(defmethod create-or-update-suppression-box traffic-suppression-params ((this traffic-suppression-params)) +(defmethod create-or-update-suppression-box ((this traffic-suppression-params)) "If the params are already associated with a box, update. Otherwise, attempt to create a new one." (cond ((= (-> this id) -1) @@ -231,7 +231,7 @@ ;; definition for method 12 of type traffic-suppression-params ;; WARN: Return type mismatch int vs none. -(defmethod kill-suppression-box traffic-suppression-params ((this traffic-suppression-params)) +(defmethod kill-suppression-box ((this traffic-suppression-params)) "Kill a suppression box, and inform the traffic manager by setting duration to 0." (when (!= (-> this id) -1) (let ((s5-0 (-> this duration))) @@ -246,7 +246,7 @@ ;; definition for method 9 of type traffic-suppressor ;; WARN: Return type mismatch int vs none. -(defmethod reset-boxes traffic-suppressor ((this traffic-suppressor)) +(defmethod reset-boxes ((this traffic-suppressor)) "Clears some flags, mark all boxes as disabled." (logclear! (-> this flags) (traffic-suppression-flags tfs0 needs-update)) (dotimes (v1-2 16) @@ -260,7 +260,7 @@ ;; definition for method 10 of type traffic-suppressor ;; WARN: Return type mismatch int vs none. -(defmethod add-new-supression-box traffic-suppressor ((this traffic-suppressor) (arg0 traffic-suppression-params)) +(defmethod add-new-supression-box ((this traffic-suppressor) (arg0 traffic-suppression-params)) "Create a suppression box for these params. The param object is updated with the ID of the box and can be later used with update-box-from-params." (set! (-> arg0 id) -1) @@ -286,7 +286,7 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 11 of type traffic-suppressor ;; WARN: Return type mismatch int vs none. -(defmethod remove-box-by-id traffic-suppressor ((this traffic-suppressor) (arg0 int)) +(defmethod remove-box-by-id ((this traffic-suppressor) (arg0 int)) "Remove a box that was previously added, by its ID." (when (!= arg0 -1) (logior! (-> this flags) (traffic-suppression-flags needs-update)) @@ -300,7 +300,7 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 12 of type traffic-suppressor ;; WARN: Return type mismatch int vs none. -(defmethod update-box-from-params traffic-suppressor ((this traffic-suppressor) (arg0 traffic-suppression-params)) +(defmethod update-box-from-params ((this traffic-suppressor) (arg0 traffic-suppression-params)) "Update a box that was previously added" (let ((v1-0 (-> arg0 id))) (when (!= v1-0 -1) @@ -321,7 +321,7 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 13 of type traffic-suppressor ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw traffic-suppressor ((this traffic-suppressor)) +(defmethod debug-draw ((this traffic-suppressor)) (let ((s5-0 (new 'stack-no-clear 'bounding-box))) (new 'stack-no-clear 'vector4w) (let ((s4-0 *color-red*)) @@ -344,7 +344,7 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 25 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod for-all-active-processes traffic-tracker ((this traffic-tracker) (arg0 (function process-focusable traffic-object-type-info none))) +(defmethod for-all-active-processes ((this traffic-tracker) (arg0 (function process-focusable traffic-object-type-info none))) "Call the given function on all active processes." (let ((s4-0 (-> this traffic))) (countdown (s3-0 (-> this active-object-count)) @@ -363,7 +363,7 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 26 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod for-all-active-processes-of-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 (function process-focusable traffic-object-type-info none))) +(defmethod for-all-active-processes-of-type ((this traffic-tracker) (arg0 traffic-type) (arg1 (function process-focusable traffic-object-type-info none))) "Call the given function on all active processes matching the given type." (let ((s3-0 (-> this traffic))) (countdown (s2-0 (-> this active-object-count)) @@ -386,7 +386,7 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 12 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod add-active-process traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) +(defmethod add-active-process ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) "Add a process as active." (let ((v1-0 (-> this active-object-count))) (when (< v1-0 (the-as uint 126)) @@ -403,7 +403,7 @@ The param object is updated with the ID of the box and can be later used with up ) ;; definition for method 13 of type traffic-tracker -(defmethod remove-active-process traffic-tracker ((this traffic-tracker) (arg0 int)) +(defmethod remove-active-process ((this traffic-tracker) (arg0 int)) "Remove a process from the tracking list." (let ((v0-0 (-> this active-object-list arg0))) (let ((v1-3 (-> this active-object-type-list arg0)) @@ -424,7 +424,7 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 14 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod add-reserved-process traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) +(defmethod add-reserved-process ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) "Add a process to the reserve list for a type. This process is allocated, but not yet activated." (let* ((v1-2 (-> this traffic object-type-info-array arg0)) (a1-2 (-> v1-2 inactive-count)) @@ -441,7 +441,7 @@ The param object is updated with the ID of the box and can be later used with up ) ;; definition for method 15 of type traffic-tracker -(defmethod get-from-inactive-by-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type)) +(defmethod get-from-inactive-by-type ((this traffic-tracker) (arg0 traffic-type)) "Get any handle from the inactive list of this type, and remove it from the list." (let ((v1-2 (-> this traffic object-type-info-array arg0)) (a1-2 0) @@ -461,7 +461,7 @@ The param object is updated with the ID of the box and can be later used with up ) ;; definition for method 16 of type traffic-tracker -(defmethod get-from-inactive-by-handle traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) +(defmethod get-from-inactive-by-handle ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) "Remove the given handle from the inactive list of the given type." (let ((v1-2 (-> this traffic object-type-info-array arg0)) (v0-0 (the-as handle #f)) @@ -485,7 +485,7 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 17 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod deactivate-object traffic-tracker ((this traffic-tracker) (arg0 int) (arg1 symbol)) +(defmethod deactivate-object ((this traffic-tracker) (arg0 int) (arg1 symbol)) "Send a traffic-off event (or traffic-off-force) to deactivate an object, specified by index in active object array. Process is recycled and moved to reserved, if it deactivates." (with-pp @@ -530,7 +530,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 18 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod set-process-to-killed traffic-tracker ((this traffic-tracker) (arg0 process)) +(defmethod set-process-to-killed ((this traffic-tracker) (arg0 process)) "Move from active to killed. Separate from reserve." (let ((v1-0 -1)) (let ((a0-1 (process->ppointer arg0))) @@ -574,7 +574,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 20 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod deactivate-all-of-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 symbol)) +(defmethod deactivate-all-of-type ((this traffic-tracker) (arg0 traffic-type) (arg1 symbol)) "Deactivate all processes of given type" (countdown (s3-0 (-> this active-object-count)) (if (= (-> this active-object-type-list s3-0) arg0) @@ -587,7 +587,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 19 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod deactivate-all traffic-tracker ((this traffic-tracker) (arg0 symbol)) +(defmethod deactivate-all ((this traffic-tracker) (arg0 symbol)) "Deactivate all processes that are tracked" (countdown (s4-0 (-> this active-object-count)) (deactivate-object this (the-as int s4-0) arg0) @@ -598,7 +598,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 21 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod activate-from-params traffic-tracker ((this traffic-tracker) (arg0 traffic-object-spawn-params)) +(defmethod activate-from-params ((this traffic-tracker) (arg0 traffic-object-spawn-params)) "Get a reserved process, and activate with the given params." (local-vars (sv-16 handle)) (let ((gp-0 (-> arg0 object-type))) @@ -630,7 +630,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 22 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod activate-by-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 nav-segment) (arg2 float)) +(defmethod activate-by-type ((this traffic-tracker) (arg0 traffic-type) (arg1 nav-segment) (arg2 float)) "If possible, activate a process of the given type." (let ((v1-2 (-> this traffic object-type-info-array arg0))) (when (and (> (-> v1-2 inactive-count) 0) @@ -693,7 +693,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 23 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod activate-by-handle traffic-tracker ((this traffic-tracker) (arg0 traffic-object-spawn-params)) +(defmethod activate-by-handle ((this traffic-tracker) (arg0 traffic-object-spawn-params)) "Activate, using the handle in the params." (local-vars (sv-16 handle)) (let ((gp-0 (-> arg0 object-type))) @@ -723,7 +723,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 9 of type traffic-level-data ;; WARN: Return type mismatch int vs none. -(defmethod reset traffic-level-data ((this traffic-level-data)) +(defmethod reset ((this traffic-level-data)) (set! (-> this city-info) (the-as city-level-info 0)) (set! (-> this active-cell-count) (the-as uint 0)) (set! (-> this newly-active-cell-count) (the-as uint 0)) @@ -733,7 +733,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 24 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod reset traffic-tracker ((this traffic-tracker) (arg0 uint) (arg1 traffic-engine)) +(defmethod reset ((this traffic-tracker) (arg0 uint) (arg1 traffic-engine)) (set! (-> this traffic) arg1) (set! (-> this object-hash) (-> arg1 object-hash)) (set! (-> this rand) 0.5) @@ -746,7 +746,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 9 of type traffic-alert-state ;; WARN: Return type mismatch int vs none. -(defmethod reset traffic-alert-state ((this traffic-alert-state)) +(defmethod reset ((this traffic-alert-state)) (set! (-> this flags) (traffic-alert-flag)) (set! (-> this level) (the-as uint 0)) (set! (-> this duration) (the-as uint 9000)) @@ -781,7 +781,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 10 of type traffic-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod reset-and-init-from-manager traffic-engine ((this traffic-engine) (arg0 process)) +(defmethod reset-and-init-from-manager ((this traffic-engine) (arg0 process)) "Reset the traffic engine" (set! (-> this manager) (process->handle arg0)) (set! (-> this flags) (the-as uint 0)) @@ -857,7 +857,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 11 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod stop-alarm-sound traffic-engine ((this traffic-engine)) +(defmethod stop-alarm-sound ((this traffic-engine)) (sound-stop (-> this alert-state alarm-sound-id)) 0 (none) @@ -865,7 +865,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 61 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod level-link traffic-engine ((this traffic-engine) (arg0 level)) +(defmethod level-link ((this traffic-engine) (arg0 level)) "Call after loading a level to patch the data in the bsp" (format #t "traffic-engine: level birth ~S~%" (-> arg0 nickname)) (cond @@ -999,7 +999,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 62 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod level-unlink traffic-engine ((this traffic-engine) (arg0 level)) +(defmethod level-unlink ((this traffic-engine) (arg0 level)) "Call after removing a level. Kills processes and unlinks nav" (let ((s4-0 (-> arg0 bsp city-level-info nav-graph))) (dotimes (v1-2 2) @@ -1051,7 +1051,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 51 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod for-all-active-processes traffic-engine ((this traffic-engine) (arg0 (function process-focusable traffic-object-type-info none))) +(defmethod for-all-active-processes ((this traffic-engine) (arg0 (function process-focusable traffic-object-type-info none))) (dotimes (s4-0 2) (for-all-active-processes (-> this tracker-array s4-0) arg0) ) @@ -1061,7 +1061,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 13 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod add-object traffic-engine ((this traffic-engine) (arg0 traffic-type) (arg1 process)) +(defmethod add-object ((this traffic-engine) (arg0 traffic-type) (arg1 process)) (add-reserved-process (-> this tracker-array (-> this object-type-info-array arg0 tracker-index)) arg0 @@ -1073,7 +1073,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 18 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod child-killed traffic-engine ((this traffic-engine) (arg0 process)) +(defmethod child-killed ((this traffic-engine) (arg0 process)) "handle killing a child process" (cond ((type? arg0 citizen) @@ -1092,7 +1092,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 15 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod activate-one-citizen traffic-engine ((this traffic-engine) (arg0 nav-segment) (arg1 float)) +(defmethod activate-one-citizen ((this traffic-engine) (arg0 nav-segment) (arg1 float)) (let ((a1-1 (+ (rand-vu-int-count 10) 11))) (activate-by-type (-> this citizen-tracker-array) (the-as traffic-type a1-1) arg0 arg1) ) @@ -1102,7 +1102,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 16 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod activate-one-vehicle traffic-engine ((this traffic-engine) (arg0 nav-segment) (arg1 float)) +(defmethod activate-one-vehicle ((this traffic-engine) (arg0 nav-segment) (arg1 float)) (let ((a1-1 0)) (dotimes (v1-0 11) (if (zero? (-> this object-type-info-array v1-0 inactive-count)) @@ -1119,7 +1119,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 65 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod handle-new-vis-cell traffic-engine ((this traffic-engine) (arg0 vis-cell)) +(defmethod handle-new-vis-cell ((this traffic-engine) (arg0 vis-cell)) (dotimes (s4-0 (-> arg0 segment-count)) (let* ((s3-0 (-> arg0 segment-array s4-0)) (s1-0 (-> s3-0 tracker-id)) @@ -1168,7 +1168,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 14 of type traffic-level-data ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw traffic-level-data ((this traffic-level-data)) +(defmethod debug-draw ((this traffic-level-data)) (local-vars (sv-16 nav-node) (sv-20 nav-branch) (sv-80 nav-node) (sv-84 vector) (sv-88 vector) (sv-92 vector)) (when (and (nonzero? (-> this city-info)) (nonzero? (-> this city-info nav-graph))) (let ((s5-0 (-> this city-info nav-graph))) @@ -1242,7 +1242,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 12 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod debug-unused traffic-engine ((this traffic-engine)) +(defmethod debug-unused ((this traffic-engine)) (dotimes (v1-0 (-> *level* length)) (let ((a0-4 (-> *level* level v1-0))) (when (= (-> a0-4 status) 'active) @@ -1258,7 +1258,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 14 of type traffic-engine -(defmethod sphere-in-loaded-city-infos? traffic-engine ((this traffic-engine) (arg0 vector) (arg1 int)) +(defmethod sphere-in-loaded-city-infos? ((this traffic-engine) (arg0 vector) (arg1 int)) (dotimes (s3-0 2) (let ((v1-3 (-> this level-data-array s3-0))) (when (nonzero? (-> v1-3 city-info)) @@ -1272,7 +1272,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 17 of type traffic-engine -(defmethod can-dest-be-used? traffic-engine ((this traffic-engine) (arg0 nav-branch)) +(defmethod can-dest-be-used? ((this traffic-engine) (arg0 nav-branch)) (let ((v1-0 (-> arg0 src-node))) (or (logtest? (-> arg0 flags) (nav-branch-flags nabflags-0)) (logtest? (-> v1-0 flags) (nav-node-flag-byte blocked)) @@ -1284,7 +1284,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 66 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod update-sync-from-frame-counter traffic-engine ((this traffic-engine)) +(defmethod update-sync-from-frame-counter ((this traffic-engine)) (+! (-> this sync-clock) 1) (set! (-> this sync-mask-8) (the-as uint (ash 1 (logand (-> this sync-clock) 7)))) (set! (-> this sync-mask-16) (the-as uint (ash 1 (logand (-> this sync-clock) 15)))) @@ -1371,7 +1371,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 70 of type traffic-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-danger-from-target traffic-engine ((this traffic-engine)) +(defmethod update-danger-from-target ((this traffic-engine)) "make people run away from jak when he is dangerous." (local-vars (v1-20 float) (v1-32 float)) (rlet ((acc :class vf) @@ -1549,7 +1549,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 69 of type traffic-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-danger traffic-engine ((this traffic-engine)) +(defmethod update-danger ((this traffic-engine)) "see what's dangerous and make people avoid it." (update-danger-from-target this) (dotimes (s5-0 (-> this danger-sphere-count)) @@ -1592,7 +1592,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 22 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod add-danger traffic-engine ((this traffic-engine) (arg0 traffic-danger-info)) +(defmethod add-danger ((this traffic-engine) (arg0 traffic-danger-info)) "Add a danger sphere and suppression box." (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1641,7 +1641,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 60 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod kill-traffic-sphere traffic-engine ((this traffic-engine) (arg0 sphere)) +(defmethod kill-traffic-sphere ((this traffic-engine) (arg0 sphere)) "Kill everything in the sphere with a traffic-off-force." (let ((gp-0 (new 'stack-no-clear 'array 'collide-shape 64))) (countdown (s5-0 (fill-actor-list-for-sphere *actor-hash* arg0 gp-0 64)) @@ -1664,7 +1664,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 68 of type traffic-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-traffic-amount traffic-engine ((this traffic-engine)) +(defmethod update-traffic-amount ((this traffic-engine)) "kills inactive traffic and spawns more if needed." (local-vars (sv-48 int) (sv-64 nav-segment)) (set! (-> this object-hash object-count) 0) @@ -1830,7 +1830,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 9 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod update-traffic traffic-engine ((this traffic-engine)) +(defmethod update-traffic ((this traffic-engine)) (update-sync-from-frame-counter this) (update-suppressor this) (let ((s5-0 (new 'stack-no-clear 'bounding-box))) @@ -1870,12 +1870,12 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 21 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod callback-on-nav-segments-in-sphere traffic-engine ((this traffic-engine) - (arg0 vector) - (arg1 int) - (arg2 traffic-find-segment-struct) - (arg3 (function traffic-find-segment-struct nav-segment none)) - ) +(defmethod callback-on-nav-segments-in-sphere ((this traffic-engine) + (arg0 vector) + (arg1 int) + (arg2 traffic-find-segment-struct) + (arg3 (function traffic-find-segment-struct nav-segment none)) + ) (dotimes (s1-0 2) (let ((v1-3 (-> this level-data-array s1-0))) (if (nonzero? (-> v1-3 city-info)) @@ -1889,17 +1889,14 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition of type traffic-find-segment-struct (deftype traffic-find-segment-struct (structure) - ((best-seg nav-segment :offset-assert 0) - (best-rating float :offset-assert 4) - (dir vector :inline :offset-assert 16) + ((best-seg nav-segment) + (best-rating float) + (dir vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type traffic-find-segment-struct -(defmethod inspect traffic-find-segment-struct ((this traffic-find-segment-struct)) +(defmethod inspect ((this traffic-find-segment-struct)) (when (not this) (set! this this) (goto cfg-4) @@ -1914,7 +1911,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 20 of type traffic-engine ;; INFO: Used lq/sq -(defmethod find-best-segment traffic-engine ((this traffic-engine) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod find-best-segment ((this traffic-engine) (arg0 vector) (arg1 vector) (arg2 int)) (let ((gp-0 (new 'stack-no-clear 'traffic-find-segment-struct))) (set! (-> gp-0 dir quad) (-> arg1 quad)) (set! (-> gp-0 best-rating) -10000000000000000000000000000000000000.0) @@ -1948,7 +1945,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 28 of type traffic-engine -(defmethod maybe-increase-guard-aim-count traffic-engine ((this traffic-engine)) +(defmethod maybe-increase-guard-aim-count ((this traffic-engine)) (when (< (-> this alert-state guard-aim-count) 2) (+! (-> this alert-state guard-aim-count) 1) #t @@ -1957,7 +1954,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 30 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod increase-alert-level traffic-engine ((this traffic-engine) (arg0 int) (arg1 target)) +(defmethod increase-alert-level ((this traffic-engine) (arg0 int) (arg1 target)) (when (and (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) (logtest? (-> arg1 mask) (process-mask target)) ) @@ -1975,7 +1972,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 31 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod decrease-alert-level traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod decrease-alert-level ((this traffic-engine) (arg0 int)) (if (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) (set! (-> this alert-state level) (the-as uint (min (the-as int (-> this alert-state level)) arg0))) ) @@ -1985,7 +1982,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 32 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-alert-level traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod set-alert-level ((this traffic-engine) (arg0 int)) (set! (-> this alert-state level) (the-as uint arg0)) (set-time! (-> this alert-state start-time)) (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) @@ -1995,7 +1992,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 33 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-max-alert-level traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod set-max-alert-level ((this traffic-engine) (arg0 int)) (set! (-> this alert-state max-level) (the-as uint arg0)) (set! (-> this alert-state level) (the-as uint (min (the-as int (-> this alert-state level)) arg0))) 0 @@ -2004,12 +2001,12 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 35 of type traffic-engine ;; WARN: Return type mismatch uint vs int. -(defmethod get-alert-level traffic-engine ((this traffic-engine)) +(defmethod get-alert-level ((this traffic-engine)) (the-as int (-> this alert-state level)) ) ;; definition for method 36 of type traffic-engine -(defmethod get-target traffic-engine ((this traffic-engine)) +(defmethod get-target ((this traffic-engine)) "@returns [[*target*]]" *target* ) @@ -2170,7 +2167,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 50 of type traffic-engine -(defmethod find-closest-to-with-collide-lists traffic-engine ((this traffic-engine) (arg0 process-drawable) (arg1 collide-spec)) +(defmethod find-closest-to-with-collide-lists ((this traffic-engine) (arg0 process-drawable) (arg1 collide-spec)) "Iterate through collide lists, find the closest thing to the given process." (let ((gp-0 (the-as process-focusable #f))) (let ((f30-0 (the-as float #x7f800000))) @@ -2283,7 +2280,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; WARN: Stack slot offset 216 signed mismatch ;; WARN: Stack slot offset 216 signed mismatch ;; WARN: Stack slot offset 216 signed mismatch -(defmethod traffic-engine-method-49 traffic-engine ((this traffic-engine) (los vector) (arg2 int) (target-status traffic-target-status)) +(defmethod traffic-engine-method-49 ((this traffic-engine) (los vector) (arg2 int) (target-status traffic-target-status)) (local-vars (guards (array crimson-guard)) (guard-target-dists (array float)) @@ -2429,14 +2426,14 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 34 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-alert-duration traffic-engine ((this traffic-engine) (arg0 time-frame)) +(defmethod set-alert-duration ((this traffic-engine) (arg0 time-frame)) (set! (-> this alert-state duration) (the-as uint arg0)) 0 (none) ) ;; definition for method 23 of type traffic-engine -(defmethod guard-count traffic-engine ((this traffic-engine)) +(defmethod guard-count ((this traffic-engine)) (let ((v0-0 0)) (dotimes (v1-0 6) (+! v0-0 (-> this alert-state guard-type-info-array v1-0 count)) @@ -2447,7 +2444,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 53 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod end-pursuit-by-type traffic-engine ((this traffic-engine) (arg0 traffic-type)) +(defmethod end-pursuit-by-type ((this traffic-engine) (arg0 traffic-type)) (for-all-active-processes-of-type (-> this tracker-array (-> this object-type-info-array arg0 tracker-index)) arg0 @@ -2462,7 +2459,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 24 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-target-level traffic-engine ((this traffic-engine) (arg0 float)) +(defmethod set-target-level ((this traffic-engine) (arg0 float)) (set! (-> this alert-state guard-target-level) arg0) (dotimes (v1-0 21) (let ((a2-2 (-> this object-type-info-array v1-0))) @@ -2475,7 +2472,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 25 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-guard-target-level traffic-engine ((this traffic-engine) (arg0 float)) +(defmethod set-guard-target-level ((this traffic-engine) (arg0 float)) (set! (-> this alert-state guard-target-level) arg0) 0 (none) @@ -2737,26 +2734,26 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 54 of type traffic-engine -(defmethod get-traffic-guard-type-settings traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod get-traffic-guard-type-settings ((this traffic-engine) (arg0 int)) "TODO - guard-type should be an enum" (-> this alert-state settings guard-settings-array arg0) ) ;; definition for method 55 of type traffic-engine -(defmethod get-guard-type-for-traffic-obj traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod get-guard-type-for-traffic-obj ((this traffic-engine) (arg0 int)) "TODO - guard-type should be an enum" (-> this object-type-info-array arg0 guard-type) ) ;; definition for method 56 of type traffic-engine -(defmethod get-traffic-guard-change-to-type traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod get-traffic-guard-change-to-type ((this traffic-engine) (arg0 int)) "TODO - guard-type should be an enum" (-> this alert-state guard-type-info-array arg0 change-to-type) ) ;; definition for method 67 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod update-guards traffic-engine ((this traffic-engine)) +(defmethod update-guards ((this traffic-engine)) (dotimes (v1-0 6) (set! (-> this alert-state guard-type-info-array v1-0 count) 0) ) @@ -2890,7 +2887,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 71 of type traffic-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-alert-state traffic-engine ((this traffic-engine)) +(defmethod update-alert-state ((this traffic-engine)) (if (and (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) *target*) (set! (-> this alert-state target-status-array 0 handle) (process->handle *target*)) ) @@ -3042,7 +3039,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 52 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod send-alert-events traffic-engine ((this traffic-engine)) +(defmethod send-alert-events ((this traffic-engine)) (set-time! (-> this alert-state notify-time)) (cond ((> (-> this alert-state level) 0) @@ -3075,7 +3072,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 29 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod restore-default-settings traffic-engine ((this traffic-engine)) +(defmethod restore-default-settings ((this traffic-engine)) (restore-city-speeches) (logclear! (-> this alert-state flags) @@ -3152,7 +3149,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 26 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod deactivate-all traffic-engine ((this traffic-engine)) +(defmethod deactivate-all ((this traffic-engine)) (deactivate-all (-> this citizen-tracker-array) #t) (deactivate-all (-> this vehicle-tracker-array) #t) 0 @@ -3161,7 +3158,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 27 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod deactivate-by-type traffic-engine ((this traffic-engine) (arg0 traffic-type)) +(defmethod deactivate-by-type ((this traffic-engine) (arg0 traffic-type)) (let ((a2-0 (-> this object-type-info-array arg0))) (deactivate-all-of-type (-> this tracker-array (-> a2-0 tracker-index)) arg0 #t) ) @@ -3171,7 +3168,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 19 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod deactivate-all-from-level traffic-engine ((this traffic-engine) (arg0 symbol)) +(defmethod deactivate-all-from-level ((this traffic-engine) (arg0 symbol)) (local-vars (v1-6 nav-branch)) (countdown (s4-0 (-> this citizen-tracker-array active-object-count)) (let ((v1-3 (handle->process (-> this citizen-tracker-array active-object-list s4-0)))) @@ -3207,7 +3204,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 58 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-object-auto-activate traffic-engine ((this traffic-engine) (arg0 int) (arg1 object)) +(defmethod set-object-auto-activate ((this traffic-engine) (arg0 int) (arg1 object)) (let ((v1-2 (-> this object-type-info-array arg0))) (if arg1 (logior! (-> v1-2 flags) (traffic-type-flags trtflags-2)) @@ -3220,7 +3217,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 37 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-object-target-level traffic-engine ((this traffic-engine) (arg0 int) (arg1 float)) +(defmethod set-object-target-level ((this traffic-engine) (arg0 int) (arg1 float)) (let ((v1-2 (-> this object-type-info-array arg0))) (set! (-> v1-2 target-count) (the int (* arg1 (the float (max 0 (+ (-> v1-2 want-count) -1)))))) ) @@ -3230,7 +3227,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 38 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-object-target-count traffic-engine ((this traffic-engine) (arg0 int) (arg1 int)) +(defmethod set-object-target-count ((this traffic-engine) (arg0 int) (arg1 int)) (set! (-> this object-type-info-array arg0 target-count) arg1) 0 (none) @@ -3238,7 +3235,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 57 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-guard-target-count-range traffic-engine ((this traffic-engine) (arg0 int) (arg1 int) (arg2 int)) +(defmethod set-guard-target-count-range ((this traffic-engine) (arg0 int) (arg1 int) (arg2 int)) (let ((v1-2 (-> this alert-state guard-type-info-array arg0))) (set! (-> v1-2 min-target-count) (max 0 (min 127 arg1))) (set! (-> v1-2 max-target-count) (max 0 (min 127 arg2))) @@ -3249,7 +3246,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 39 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-object-reserve-count traffic-engine ((this traffic-engine) (arg0 int) (arg1 uint)) +(defmethod set-object-reserve-count ((this traffic-engine) (arg0 int) (arg1 uint)) (set! (-> this object-type-info-array arg0 reserve-count) arg1) 0 (none) @@ -3257,12 +3254,12 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 40 of type traffic-engine ;; WARN: Return type mismatch uint vs int. -(defmethod get-object-reserve-count traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod get-object-reserve-count ((this traffic-engine) (arg0 int)) (the-as int (-> this object-type-info-array arg0 reserve-count)) ) ;; definition for method 41 of type traffic-engine -(defmethod get-object-remaining-count traffic-engine ((this traffic-engine) (arg0 int)) +(defmethod get-object-remaining-count ((this traffic-engine) (arg0 int)) (let ((a0-1 (-> this object-type-info-array arg0))) (+ (-> a0-1 active-count) (-> a0-1 reserve-count)) ) @@ -3270,7 +3267,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 44 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-parking-spot-prob traffic-engine ((this traffic-engine) (arg0 int) (arg1 float)) +(defmethod set-parking-spot-prob ((this traffic-engine) (arg0 int) (arg1 float)) (let ((v1-2 (-> this object-type-info-array arg0))) (set! (-> v1-2 parking-spot-prob) (the-as uint (min 255 (the int (* 256.0 arg1))))) ) @@ -3280,7 +3277,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 45 of type traffic-engine ;; WARN: Return type mismatch int vs traffic-type. -(defmethod get-random-parking-spot-type traffic-engine ((this traffic-engine)) +(defmethod get-random-parking-spot-type ((this traffic-engine)) (let ((s5-0 11)) (let ((s4-0 (the int (* 256.0 (rand-vu)))) (s3-0 0) @@ -3305,7 +3302,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 42 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod activate-object traffic-engine ((this traffic-engine) (arg0 traffic-object-spawn-params)) +(defmethod activate-object ((this traffic-engine) (arg0 traffic-object-spawn-params)) (let ((a2-0 (-> this object-type-info-array (-> arg0 object-type)))) (activate-from-params (-> this tracker-array (-> a2-0 tracker-index)) arg0) ) @@ -3315,7 +3312,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 43 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod activate-by-handle traffic-engine ((this traffic-engine) (arg0 traffic-object-spawn-params)) +(defmethod activate-by-handle ((this traffic-engine) (arg0 traffic-object-spawn-params)) (let ((a2-0 (-> this object-type-info-array (-> arg0 object-type)))) (activate-by-handle (-> this tracker-array (-> a2-0 tracker-index)) arg0) ) @@ -3324,26 +3321,26 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 46 of type traffic-engine -(defmethod new-suppression-box traffic-engine ((this traffic-engine) (arg0 traffic-suppression-params)) +(defmethod new-suppression-box ((this traffic-engine) (arg0 traffic-suppression-params)) (add-new-supression-box (-> this suppressor) arg0) (none) ) ;; definition for method 47 of type traffic-engine -(defmethod remove-suppression-box traffic-engine ((this traffic-engine) (arg0 traffic-suppression-params)) +(defmethod remove-suppression-box ((this traffic-engine) (arg0 traffic-suppression-params)) (remove-box-by-id (-> this suppressor) (the-as int arg0)) (none) ) ;; definition for method 48 of type traffic-engine -(defmethod update-suppression-box traffic-engine ((this traffic-engine) (arg0 traffic-suppression-params)) +(defmethod update-suppression-box ((this traffic-engine) (arg0 traffic-suppression-params)) (update-box-from-params (-> this suppressor) arg0) (none) ) ;; definition for method 72 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod update-suppressor traffic-engine ((this traffic-engine)) +(defmethod update-suppressor ((this traffic-engine)) (let ((v1-3 (- (-> *display* game-clock frame-counter) (-> *display* game-clock old-frame-counter)))) (dotimes (a1-3 16) (let ((a2-2 (-> this suppressor array a1-3))) @@ -3373,7 +3370,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 73 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod recompute-supressions traffic-engine ((this traffic-engine)) +(defmethod recompute-supressions ((this traffic-engine)) (dotimes (s5-0 2) (let ((v1-3 (-> this level-data-array s5-0))) (if (nonzero? (-> v1-3 city-info)) @@ -3394,7 +3391,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 14 of type city-level-info -(defmethod get-first-cell-in-box city-level-info ((this city-level-info) (arg0 vis-grid-box)) +(defmethod get-first-cell-in-box ((this city-level-info) (arg0 vis-grid-box)) (-> this cell-array (+ (-> arg0 min x) @@ -3405,7 +3402,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 15 of type city-level-info -(defmethod sphere-in-grid? city-level-info ((this city-level-info) (arg0 vector) (arg1 int)) +(defmethod sphere-in-grid? ((this city-level-info) (arg0 vector) (arg1 int)) (let ((gp-0 #f)) (let ((s3-0 (new 'stack-no-clear 'vis-grid-box)) (s2-0 (new 'stack-no-clear 'vis-grid-box)) @@ -3478,12 +3475,12 @@ Process is recycled and moved to reserved, if it deactivates." ;; WARN: Stack slot offset 28 signed mismatch ;; WARN: Stack slot offset 24 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod callback-on-nav-segments-in-sphere city-level-info ((this city-level-info) - (arg0 vector) - (arg1 int) - (arg2 traffic-find-segment-struct) - (arg3 (function traffic-find-segment-struct nav-segment none)) - ) +(defmethod callback-on-nav-segments-in-sphere ((this city-level-info) + (arg0 vector) + (arg1 int) + (arg2 traffic-find-segment-struct) + (arg3 (function traffic-find-segment-struct nav-segment none)) + ) (local-vars (sv-16 city-level-info) (sv-20 vector) @@ -3541,7 +3538,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 17 of type city-level-info ;; WARN: Return type mismatch int vs none. -(defmethod update-suppressions-from-traffic-engine city-level-info ((this city-level-info) (arg0 traffic-engine)) +(defmethod update-suppressions-from-traffic-engine ((this city-level-info) (arg0 traffic-engine)) (let ((v1-0 (-> this cell-count))) (dotimes (a0-1 (the-as int v1-0)) (let ((a1-2 (-> this cell-array a0-1))) @@ -3590,7 +3587,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 10 of type traffic-level-data ;; WARN: Return type mismatch int vs none. -(defmethod add-active-cell traffic-level-data ((this traffic-level-data) (arg0 vis-cell)) +(defmethod add-active-cell ((this traffic-level-data) (arg0 vis-cell)) (let ((v1-0 (-> this active-cell-count))) (when (< v1-0 (the-as uint 255)) (set! (-> this active-cell-list v1-0) arg0) @@ -3603,7 +3600,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 11 of type traffic-level-data ;; WARN: Return type mismatch int vs none. -(defmethod remove-active-cell traffic-level-data ((this traffic-level-data) (arg0 int)) +(defmethod remove-active-cell ((this traffic-level-data) (arg0 int)) (let ((v1-1 (+ (-> this active-cell-count) -1))) (when (>= v1-1 0) (set! (-> this active-cell-list arg0) (-> this active-cell-list v1-1)) @@ -3616,7 +3613,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 12 of type traffic-level-data ;; WARN: Return type mismatch int vs none. -(defmethod add-newly-active-cell traffic-level-data ((this traffic-level-data) (arg0 vis-cell)) +(defmethod add-newly-active-cell ((this traffic-level-data) (arg0 vis-cell)) (let ((v1-0 (-> this newly-active-cell-count))) (when (< v1-0 (the-as uint 255)) (set! (-> this newly-active-cell-list v1-0) arg0) @@ -3629,7 +3626,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 13 of type traffic-level-data ;; WARN: Return type mismatch int vs none. -(defmethod per-frame-cell-update traffic-level-data ((this traffic-level-data)) +(defmethod per-frame-cell-update ((this traffic-level-data)) (set! (-> this newly-active-cell-count) (the-as uint 0)) (dotimes (v1-0 (the-as int (-> this active-cell-count))) (let ((a0-3 (-> this active-cell-list v1-0))) @@ -3717,7 +3714,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 13 of type city-level-info -(defmethod lookup-cell-by-position city-level-info ((this city-level-info) (arg0 vector)) +(defmethod lookup-cell-by-position ((this city-level-info) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'vis-grid-pos))) (lookup-cell-for-point (-> this grid-info) s5-0 arg0) (-> this @@ -3733,7 +3730,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 10 of type city-level-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-vis-ray city-level-info ((this city-level-info) (arg0 vis-ray) (arg1 vector) (arg2 vector)) +(defmethod init-vis-ray ((this city-level-info) (arg0 vis-ray) (arg1 vector) (arg2 vector)) (set! (-> arg0 pos quad) (-> arg1 quad)) (set! (-> arg0 dest-pos quad) (-> arg2 quad)) (let ((v1-2 (new 'stack-no-clear 'vector))) @@ -3754,7 +3751,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 11 of type city-level-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod city-level-info-method-11 city-level-info ((this city-level-info) (arg0 vis-ray)) +(defmethod city-level-info-method-11 ((this city-level-info) (arg0 vis-ray)) (local-vars (a3-3 int)) (let ((f0-0 (-> arg0 len)) (s4-0 -1) @@ -3823,7 +3820,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 12 of type city-level-info ;; INFO: Used lq/sq -(defmethod city-level-info-method-12 city-level-info ((this city-level-info) (arg0 vector) (arg1 nav-branch) (arg2 vector)) +(defmethod city-level-info-method-12 ((this city-level-info) (arg0 vector) (arg1 nav-branch) (arg2 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -3951,7 +3948,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod city-level-info-method-18 city-level-info ((this city-level-info)) +(defmethod city-level-info-method-18 ((this city-level-info)) (local-vars (sv-48 int)) (let ((gp-0 (new 'stack-no-clear 'bounding-box)) (s5-0 (-> this nav-graph)) @@ -4013,7 +4010,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; WARN: Stack slot offset 100 signed mismatch ;; WARN: Stack slot offset 100 signed mismatch ;; WARN: Return type mismatch object vs symbol. -(defmethod city-level-info-method-9 city-level-info ((this city-level-info)) +(defmethod city-level-info-method-9 ((this city-level-info)) (local-vars (sv-96 (inline-array nav-node)) (sv-100 int) @@ -4225,7 +4222,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 59 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod debug-check-proc-in-tracker traffic-engine ((this traffic-engine) (arg0 process) (arg1 int)) +(defmethod debug-check-proc-in-tracker ((this traffic-engine) (arg0 process) (arg1 int)) (let ((v1-3 (-> this tracker-array arg1)) (a0-3 (process->handle arg0)) (a3-4 0) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/traffic-manager_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/traffic-manager_REF.gc index 583f3407eae..91b086f7510 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/traffic-manager_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/traffic-manager_REF.gc @@ -9,29 +9,27 @@ ;; definition of type traffic-manager (deftype traffic-manager (process) - ((traffic-engine traffic-engine :offset-assert 128) - (fast-spawn symbol :offset-assert 132) - (dark-guard-ratio int32 :offset-assert 136) - (spawn-params traffic-object-spawn-params :inline :offset-assert 144) + ((traffic-engine traffic-engine) + (fast-spawn symbol) + (dark-guard-ratio int32) + (spawn-params traffic-object-spawn-params :inline) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf8 - :flag-assert #x16008000f8 + (:state-methods + idle + active + ) (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (update (_type_) none 16) - (spawn-all (_type_) none 17) - (kill-excess-once (_type_) none 18) - (kill-all-inactive (_type_) none 19) - (reset-and-init (_type_) none 20) - (init-params (_type_) none 21) + (update (_type_) none) + (spawn-all (_type_) none) + (kill-excess-once (_type_) none) + (kill-all-inactive (_type_) none) + (reset-and-init (_type_) none) + (init-params (_type_) none) ) ) ;; definition for method 3 of type traffic-manager -(defmethod inspect traffic-manager ((this traffic-manager)) +(defmethod inspect ((this traffic-manager)) (when (not this) (set! this this) (goto cfg-4) @@ -71,7 +69,7 @@ ;; definition for method 16 of type traffic-manager ;; WARN: Return type mismatch int vs none. -(defmethod update traffic-manager ((this traffic-manager)) +(defmethod update ((this traffic-manager)) (update-traffic (-> this traffic-engine)) (kill-excess-once this) (spawn-all this) @@ -94,7 +92,7 @@ ;; definition for method 18 of type traffic-manager ;; WARN: Return type mismatch int vs none. -(defmethod kill-excess-once traffic-manager ((this traffic-manager)) +(defmethod kill-excess-once ((this traffic-manager)) (let ((type-i 0)) (while (< (the-as uint type-i) (the-as uint 21)) (let ((traffic (-> this traffic-engine object-type-info-array type-i))) @@ -125,7 +123,7 @@ ;; definition for method 19 of type traffic-manager ;; WARN: Return type mismatch int vs none. -(defmethod kill-all-inactive traffic-manager ((this traffic-manager)) +(defmethod kill-all-inactive ((this traffic-manager)) (let ((s5-0 0)) (while (< (the-as uint s5-0) (the-as uint 21)) (let ((s4-0 (-> this traffic-engine object-type-info-array s5-0))) @@ -152,7 +150,7 @@ ;; definition for method 17 of type traffic-manager ;; WARN: Return type mismatch int vs none. -(defmethod spawn-all traffic-manager ((this traffic-manager)) +(defmethod spawn-all ((this traffic-manager)) (let ((s5-0 0)) (b! #t cfg-4 :delay (nop!)) (label cfg-1) @@ -389,7 +387,7 @@ ;; definition for method 20 of type traffic-manager ;; WARN: Return type mismatch int vs none. -(defmethod reset-and-init traffic-manager ((this traffic-manager)) +(defmethod reset-and-init ((this traffic-manager)) (set! (-> this traffic-engine) *traffic-engine*) (reset-and-init-from-manager (-> this traffic-engine) this) (restore-city-speeches) @@ -399,7 +397,7 @@ ;; definition for method 7 of type traffic-manager ;; WARN: Return type mismatch process vs traffic-manager. -(defmethod relocate traffic-manager ((this traffic-manager) (arg0 int)) +(defmethod relocate ((this traffic-manager) (arg0 int)) (set! *traffic-manager* this) (if *traffic-manager* (set! *traffic-manager* (&+ *traffic-manager* arg0)) @@ -408,7 +406,7 @@ ) ;; definition for method 10 of type traffic-manager -(defmethod deactivate traffic-manager ((this traffic-manager)) +(defmethod deactivate ((this traffic-manager)) (stop-alarm-sound (-> this traffic-engine)) (set! *traffic-manager* #f) (remove-setting *setting-control* this 'task-mask) @@ -420,7 +418,7 @@ ;; definition for method 21 of type traffic-manager ;; WARN: Return type mismatch int vs none. -(defmethod init-params traffic-manager ((this traffic-manager)) +(defmethod init-params ((this traffic-manager)) (let ((traffic-want-counts (new 'stack-no-clear 'array 'int8 21))) (set! (-> traffic-want-counts 11) 8) (set! (-> traffic-want-counts 12) 8) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/bike_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/bike_REF.gc index 76639dab178..287a1aae431 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/bike_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/bike_REF.gc @@ -920,14 +920,10 @@ ;; definition of type bike-base (deftype bike-base (vehicle) () - :heap-base #x2f0 - :method-count-assert 144 - :size-assert #x370 - :flag-assert #x9002f00370 ) ;; definition for method 3 of type bike-base -(defmethod inspect bike-base ((this bike-base)) +(defmethod inspect ((this bike-base)) (when (not this) (set! this this) (goto cfg-4) @@ -941,7 +937,7 @@ ;; definition for method 36 of type bike-base ;; WARN: Return type mismatch int vs none. -(defmethod do-engine-sounds bike-base ((this bike-base)) +(defmethod do-engine-sounds ((this bike-base)) (call-parent-method this) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (if (zero? (-> this roll-sound-id)) @@ -976,7 +972,7 @@ ;; definition for method 85 of type bike-base ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-thrusters bike-base ((this bike-base)) +(defmethod draw-thrusters ((this bike-base)) (call-parent-method this) (when (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'matrix 3))) @@ -1036,22 +1032,18 @@ ;; definition of type bikea (deftype bikea (bike-base) - ((fin-fl joint-mod-rotate-local :offset-assert 880) - (fin-fr joint-mod-rotate-local :offset-assert 884) - (fin-rl joint-mod-rotate-local :offset-assert 888) - (fin-rr joint-mod-rotate-local :offset-assert 892) - (rudder joint-mod-rotate-local :offset-assert 896) - (brake-l joint-mod-rotate-local :offset-assert 900) - (brake-r joint-mod-rotate-local :offset-assert 904) + ((fin-fl joint-mod-rotate-local) + (fin-fr joint-mod-rotate-local) + (fin-rl joint-mod-rotate-local) + (fin-rr joint-mod-rotate-local) + (rudder joint-mod-rotate-local) + (brake-l joint-mod-rotate-local) + (brake-r joint-mod-rotate-local) ) - :heap-base #x310 - :method-count-assert 144 - :size-assert #x38c - :flag-assert #x900310038c ) ;; definition for method 3 of type bikea -(defmethod inspect bikea ((this bikea)) +(defmethod inspect ((this bikea)) (when (not this) (set! this this) (goto cfg-4) @@ -1071,7 +1063,7 @@ ) ;; definition for method 7 of type bikea -(defmethod relocate bikea ((this bikea) (arg0 int)) +(defmethod relocate ((this bikea) (arg0 int)) (if (nonzero? (-> this fin-fl)) (&+! (-> this fin-fl) arg0) ) @@ -1098,7 +1090,7 @@ ;; definition for method 32 of type bikea ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape bikea ((this bikea)) +(defmethod allocate-and-init-cshape ((this bikea)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1153,7 +1145,7 @@ ;; definition for method 86 of type bikea ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods bikea ((this bikea)) +(defmethod update-joint-mods ((this bikea)) (let ((f30-0 (* 5461.3335 (-> this controls steering))) (f26-0 (* -5461.3335 (-> this controls lean-z))) (f28-0 (* -13653.333 (-> this controls brake))) @@ -1173,7 +1165,7 @@ ;; definition for method 33 of type bikea ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body bikea ((this bikea)) +(defmethod init-skel-and-rigid-body ((this bikea)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikea" (the-as (pointer uint32) #f))) @@ -1193,23 +1185,19 @@ ;; definition of type bikeb (deftype bikeb (bike-base) - ((fin-rl joint-mod-rotate-local :offset-assert 880) - (fin-rr joint-mod-rotate-local :offset-assert 884) - (rudder joint-mod-rotate-local :offset-assert 888) - (rudder-f joint-mod-rotate-local :offset-assert 892) - (brake-l joint-mod-rotate-local :offset-assert 896) - (brake-r joint-mod-rotate-local :offset-assert 900) - (flap-l joint-mod-rotate-local :offset-assert 904) - (flap-r joint-mod-rotate-local :offset-assert 908) + ((fin-rl joint-mod-rotate-local) + (fin-rr joint-mod-rotate-local) + (rudder joint-mod-rotate-local) + (rudder-f joint-mod-rotate-local) + (brake-l joint-mod-rotate-local) + (brake-r joint-mod-rotate-local) + (flap-l joint-mod-rotate-local) + (flap-r joint-mod-rotate-local) ) - :heap-base #x310 - :method-count-assert 144 - :size-assert #x390 - :flag-assert #x9003100390 ) ;; definition for method 3 of type bikeb -(defmethod inspect bikeb ((this bikeb)) +(defmethod inspect ((this bikeb)) (when (not this) (set! this this) (goto cfg-4) @@ -1230,7 +1218,7 @@ ) ;; definition for method 7 of type bikeb -(defmethod relocate bikeb ((this bikeb) (arg0 int)) +(defmethod relocate ((this bikeb) (arg0 int)) (if (nonzero? (-> this fin-rl)) (&+! (-> this fin-rl) arg0) ) @@ -1260,7 +1248,7 @@ ;; definition for method 32 of type bikeb ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape bikeb ((this bikeb)) +(defmethod allocate-and-init-cshape ((this bikeb)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1315,7 +1303,7 @@ ;; definition for method 86 of type bikeb ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods bikeb ((this bikeb)) +(defmethod update-joint-mods ((this bikeb)) (let ((f30-0 (* 5461.3335 (-> this controls steering))) (f26-0 (* -5461.3335 (-> this controls lean-z))) (f28-0 (* 13653.333 (-> this controls brake))) @@ -1336,7 +1324,7 @@ ;; definition for method 33 of type bikeb ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body bikeb ((this bikeb)) +(defmethod init-skel-and-rigid-body ((this bikeb)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikeb" (the-as (pointer uint32) #f))) @@ -1357,26 +1345,22 @@ ;; definition of type bikec (deftype bikec (bike-base) - ((fin-fl joint-mod-rotate-local :offset-assert 880) - (fin-fr joint-mod-rotate-local :offset-assert 884) - (fin-rl joint-mod-rotate-local :offset-assert 888) - (fin-rr joint-mod-rotate-local :offset-assert 892) - (fin2-fl joint-mod-rotate-local :offset-assert 896) - (fin2-fr joint-mod-rotate-local :offset-assert 900) - (rudder joint-mod-rotate-local :offset-assert 904) - (brake-l joint-mod-rotate-local :offset-assert 908) - (brake-r joint-mod-rotate-local :offset-assert 912) - (spoiler-l joint-mod-rotate-local :offset-assert 916) - (spoiler-r joint-mod-rotate-local :offset-assert 920) + ((fin-fl joint-mod-rotate-local) + (fin-fr joint-mod-rotate-local) + (fin-rl joint-mod-rotate-local) + (fin-rr joint-mod-rotate-local) + (fin2-fl joint-mod-rotate-local) + (fin2-fr joint-mod-rotate-local) + (rudder joint-mod-rotate-local) + (brake-l joint-mod-rotate-local) + (brake-r joint-mod-rotate-local) + (spoiler-l joint-mod-rotate-local) + (spoiler-r joint-mod-rotate-local) ) - :heap-base #x320 - :method-count-assert 144 - :size-assert #x39c - :flag-assert #x900320039c ) ;; definition for method 3 of type bikec -(defmethod inspect bikec ((this bikec)) +(defmethod inspect ((this bikec)) (when (not this) (set! this this) (goto cfg-4) @@ -1400,7 +1384,7 @@ ) ;; definition for method 7 of type bikec -(defmethod relocate bikec ((this bikec) (arg0 int)) +(defmethod relocate ((this bikec) (arg0 int)) (if (nonzero? (-> this fin-fl)) (&+! (-> this fin-fl) arg0) ) @@ -1439,7 +1423,7 @@ ;; definition for method 32 of type bikec ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape bikec ((this bikec)) +(defmethod allocate-and-init-cshape ((this bikec)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1494,7 +1478,7 @@ ;; definition for method 86 of type bikec ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods bikec ((this bikec)) +(defmethod update-joint-mods ((this bikec)) (let ((f30-0 (* 5461.3335 (-> this controls steering))) (f26-0 (* -5461.3335 (-> this controls lean-z))) (f28-0 (* 13653.333 (-> this controls brake))) @@ -1518,7 +1502,7 @@ ;; definition for method 33 of type bikec ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body bikec ((this bikec)) +(defmethod init-skel-and-rigid-body ((this bikec)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikec" (the-as (pointer uint32) #f))) @@ -1564,16 +1548,12 @@ ;; definition of type guard-bike (deftype guard-bike (vehicle-guard) - ((turret-jm joint-mod-rotate-local :offset-assert 1076) + ((turret-jm joint-mod-rotate-local) ) - :heap-base #x3c0 - :method-count-assert 159 - :size-assert #x438 - :flag-assert #x9f03c00438 ) ;; definition for method 3 of type guard-bike -(defmethod inspect guard-bike ((this guard-bike)) +(defmethod inspect ((this guard-bike)) (when (not this) (set! this this) (goto cfg-4) @@ -1587,7 +1567,7 @@ ) ;; definition for method 7 of type guard-bike -(defmethod relocate guard-bike ((this guard-bike) (arg0 int)) +(defmethod relocate ((this guard-bike) (arg0 int)) (if (nonzero? (-> this turret-jm)) (&+! (-> this turret-jm) arg0) ) @@ -1596,7 +1576,7 @@ ;; definition for method 65 of type guard-bike ;; WARN: Return type mismatch int vs none. -(defmethod start-jump guard-bike ((this guard-bike)) +(defmethod start-jump ((this guard-bike)) (when (not (logtest? (rigid-body-object-flag jump-sound) (-> this flags))) (logior! (-> this flags) (rigid-body-object-flag jump-sound)) (sound-play "bike-hop") @@ -1608,7 +1588,7 @@ ;; definition for method 32 of type guard-bike ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape guard-bike ((this guard-bike)) +(defmethod allocate-and-init-cshape ((this guard-bike)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1663,7 +1643,7 @@ ;; definition for method 86 of type guard-bike ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods guard-bike ((this guard-bike)) +(defmethod update-joint-mods ((this guard-bike)) (update-joint-mod (-> this turret) (-> this turret-jm)) 0 (none) @@ -1671,7 +1651,7 @@ ;; definition for method 33 of type guard-bike ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body guard-bike ((this guard-bike)) +(defmethod init-skel-and-rigid-body ((this guard-bike)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-guard-bike" (the-as (pointer uint32) #f))) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/car_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/car_REF.gc index 70823a0893d..910af2b12a4 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/car_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/car_REF.gc @@ -1113,16 +1113,12 @@ ;; definition of type car-base (deftype car-base (vehicle) - ((rider-hand-joint-array int8 2 :offset-assert 880) + ((rider-hand-joint-array int8 2) ) - :heap-base #x300 - :method-count-assert 144 - :size-assert #x372 - :flag-assert #x9003000372 ) ;; definition for method 3 of type car-base -(defmethod inspect car-base ((this car-base)) +(defmethod inspect ((this car-base)) (when (not this) (set! this this) (goto cfg-4) @@ -1137,7 +1133,7 @@ ;; definition for method 117 of type car-base ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-117 car-base ((this car-base) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 ((this car-base) (arg0 vector) (arg1 int) (arg2 int)) (vector-matrix*! arg0 (-> this info rider-hand-offset arg2) @@ -1149,24 +1145,20 @@ ;; definition of type cara (deftype cara (car-base) - ((steering-wheel-l joint-mod-rotate-local :offset-assert 884) - (steering-wheel-r joint-mod-rotate-local :offset-assert 888) - (fin-fl joint-mod-rotate-local :offset-assert 892) - (fin-fr joint-mod-rotate-local :offset-assert 896) - (fin-rl joint-mod-rotate-local :offset-assert 900) - (fin-rr joint-mod-rotate-local :offset-assert 904) - (rudder-l joint-mod-rotate-local :offset-assert 908) - (rudder-r joint-mod-rotate-local :offset-assert 912) - (rudder joint-mod-rotate-local :offset-assert 916) + ((steering-wheel-l joint-mod-rotate-local) + (steering-wheel-r joint-mod-rotate-local) + (fin-fl joint-mod-rotate-local) + (fin-fr joint-mod-rotate-local) + (fin-rl joint-mod-rotate-local) + (fin-rr joint-mod-rotate-local) + (rudder-l joint-mod-rotate-local) + (rudder-r joint-mod-rotate-local) + (rudder joint-mod-rotate-local) ) - :heap-base #x320 - :method-count-assert 144 - :size-assert #x398 - :flag-assert #x9003200398 ) ;; definition for method 3 of type cara -(defmethod inspect cara ((this cara)) +(defmethod inspect ((this cara)) (when (not this) (set! this this) (goto cfg-4) @@ -1188,7 +1180,7 @@ ) ;; definition for method 7 of type cara -(defmethod relocate cara ((this cara) (arg0 int)) +(defmethod relocate ((this cara) (arg0 int)) (if (nonzero? (-> this steering-wheel-l)) (&+! (-> this steering-wheel-l) arg0) ) @@ -1221,7 +1213,7 @@ ;; definition for method 32 of type cara ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape cara ((this cara)) +(defmethod allocate-and-init-cshape ((this cara)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1286,7 +1278,7 @@ ;; definition for method 86 of type cara ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods cara ((this cara)) +(defmethod update-joint-mods ((this cara)) (let ((f30-0 (* 3640.889 (-> this controls steering))) (f26-0 (* 9102.223 (-> this controls steering))) (f28-0 (* -3640.889 (-> this controls lean-z))) @@ -1306,7 +1298,7 @@ ;; definition for method 33 of type cara ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body cara ((this cara)) +(defmethod init-skel-and-rigid-body ((this cara)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-cara" (the-as (pointer uint32) #f))) @@ -1330,21 +1322,17 @@ ;; definition of type carb (deftype carb (car-base) - ((steering-wheel-l joint-mod-rotate-local :offset-assert 884) - (steering-wheel-r joint-mod-rotate-local :offset-assert 888) - (fin-fl joint-mod-rotate-local :offset-assert 892) - (fin-fr joint-mod-rotate-local :offset-assert 896) - (fin-rl joint-mod-rotate-local :offset-assert 900) - (fin-rr joint-mod-rotate-local :offset-assert 904) + ((steering-wheel-l joint-mod-rotate-local) + (steering-wheel-r joint-mod-rotate-local) + (fin-fl joint-mod-rotate-local) + (fin-fr joint-mod-rotate-local) + (fin-rl joint-mod-rotate-local) + (fin-rr joint-mod-rotate-local) ) - :heap-base #x310 - :method-count-assert 144 - :size-assert #x38c - :flag-assert #x900310038c ) ;; definition for method 3 of type carb -(defmethod inspect carb ((this carb)) +(defmethod inspect ((this carb)) (when (not this) (set! this this) (goto cfg-4) @@ -1363,7 +1351,7 @@ ) ;; definition for method 7 of type carb -(defmethod relocate carb ((this carb) (arg0 int)) +(defmethod relocate ((this carb) (arg0 int)) (if (nonzero? (-> this steering-wheel-l)) (&+! (-> this steering-wheel-l) arg0) ) @@ -1387,7 +1375,7 @@ ;; definition for method 32 of type carb ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape carb ((this carb)) +(defmethod allocate-and-init-cshape ((this carb)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1452,7 +1440,7 @@ ;; definition for method 86 of type carb ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods carb ((this carb)) +(defmethod update-joint-mods ((this carb)) (let ((f30-0 (* -5461.3335 (-> this controls lean-z))) (f28-0 (* 9102.223 (-> this controls steering))) (gp-0 (new 'static 'vector :x 1.0 :w 1.0)) @@ -1470,7 +1458,7 @@ ;; definition for method 33 of type carb ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body carb ((this carb)) +(defmethod init-skel-and-rigid-body ((this carb)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-carb" (the-as (pointer uint32) #f))) @@ -1491,22 +1479,18 @@ ;; definition of type carc (deftype carc (car-base) - ((steering-wheel joint-mod-rotate-local :offset-assert 884) - (fin-fl joint-mod-rotate-local :offset-assert 888) - (fin-fr joint-mod-rotate-local :offset-assert 892) - (fin-rl joint-mod-rotate-local :offset-assert 896) - (fin-rr joint-mod-rotate-local :offset-assert 900) - (fin2-rl joint-mod-rotate-local :offset-assert 904) - (fin2-rr joint-mod-rotate-local :offset-assert 908) + ((steering-wheel joint-mod-rotate-local) + (fin-fl joint-mod-rotate-local) + (fin-fr joint-mod-rotate-local) + (fin-rl joint-mod-rotate-local) + (fin-rr joint-mod-rotate-local) + (fin2-rl joint-mod-rotate-local) + (fin2-rr joint-mod-rotate-local) ) - :heap-base #x310 - :method-count-assert 144 - :size-assert #x390 - :flag-assert #x9003100390 ) ;; definition for method 3 of type carc -(defmethod inspect carc ((this carc)) +(defmethod inspect ((this carc)) (when (not this) (set! this this) (goto cfg-4) @@ -1526,7 +1510,7 @@ ) ;; definition for method 7 of type carc -(defmethod relocate carc ((this carc) (arg0 int)) +(defmethod relocate ((this carc) (arg0 int)) (if (nonzero? (-> this steering-wheel)) (&+! (-> this steering-wheel) arg0) ) @@ -1553,7 +1537,7 @@ ;; definition for method 32 of type carc ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape carc ((this carc)) +(defmethod allocate-and-init-cshape ((this carc)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1613,7 +1597,7 @@ ;; definition for method 86 of type carc ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods carc ((this carc)) +(defmethod update-joint-mods ((this carc)) (let ((f30-0 (* -5461.3335 (-> this controls steering))) (f28-0 (* -5461.3335 (-> this controls lean-z))) (f0-3 (* 9102.223 (-> this controls steering))) @@ -1633,7 +1617,7 @@ ;; definition for method 33 of type carc ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body carc ((this carc)) +(defmethod init-skel-and-rigid-body ((this carc)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-carc" (the-as (pointer uint32) #f))) @@ -1676,16 +1660,12 @@ ;; definition of type hellcat (deftype hellcat (vehicle-guard) - ((turret-jm joint-mod-rotate-local :offset-assert 1076) + ((turret-jm joint-mod-rotate-local) ) - :heap-base #x3c0 - :method-count-assert 159 - :size-assert #x438 - :flag-assert #x9f03c00438 ) ;; definition for method 3 of type hellcat -(defmethod inspect hellcat ((this hellcat)) +(defmethod inspect ((this hellcat)) (when (not this) (set! this this) (goto cfg-4) @@ -1699,7 +1679,7 @@ ) ;; definition for method 7 of type hellcat -(defmethod relocate hellcat ((this hellcat) (arg0 int)) +(defmethod relocate ((this hellcat) (arg0 int)) (if (nonzero? (-> this turret-jm)) (&+! (-> this turret-jm) arg0) ) @@ -1708,7 +1688,7 @@ ;; definition for method 32 of type hellcat ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape hellcat ((this hellcat)) +(defmethod allocate-and-init-cshape ((this hellcat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1772,7 +1752,7 @@ ;; definition for method 86 of type hellcat ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods hellcat ((this hellcat)) +(defmethod update-joint-mods ((this hellcat)) (update-joint-mod (-> this turret) (-> this turret-jm)) 0 (none) @@ -1780,7 +1760,7 @@ ;; definition for method 33 of type hellcat ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body hellcat ((this hellcat)) +(defmethod init-skel-and-rigid-body ((this hellcat)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-hellcat" (the-as (pointer uint32) #f))) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-bike_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-bike_REF.gc index bd450310982..0d9a4cadd53 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-bike_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-bike_REF.gc @@ -4,14 +4,10 @@ ;; definition of type test-bike (deftype test-bike (bikec) () - :heap-base #x320 - :method-count-assert 144 - :size-assert #x39c - :flag-assert #x900320039c ) ;; definition for method 3 of type test-bike -(defmethod inspect test-bike ((this test-bike)) +(defmethod inspect ((this test-bike)) (when (not this) (set! this this) (goto cfg-4) @@ -233,7 +229,7 @@ ;; definition for method 33 of type test-bike ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body test-bike ((this test-bike)) +(defmethod init-skel-and-rigid-body ((this test-bike)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikec" (the-as (pointer uint32) #f))) @@ -258,14 +254,10 @@ ;; definition of type evan-test-bike (deftype evan-test-bike (bikea) () - :heap-base #x310 - :method-count-assert 144 - :size-assert #x38c - :flag-assert #x900310038c ) ;; definition for method 3 of type evan-test-bike -(defmethod inspect evan-test-bike ((this evan-test-bike)) +(defmethod inspect ((this evan-test-bike)) (when (not this) (set! this this) (goto cfg-4) @@ -485,7 +477,7 @@ ;; definition for method 33 of type evan-test-bike ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body evan-test-bike ((this evan-test-bike)) +(defmethod init-skel-and-rigid-body ((this evan-test-bike)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikea" (the-as (pointer uint32) #f))) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-car_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-car_REF.gc index 75f185c0758..2b7c932396a 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-car_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-car_REF.gc @@ -4,14 +4,10 @@ ;; definition of type test-car (deftype test-car (cara) () - :heap-base #x320 - :method-count-assert 144 - :size-assert #x398 - :flag-assert #x9003200398 ) ;; definition for method 3 of type test-car -(defmethod inspect test-car ((this test-car)) +(defmethod inspect ((this test-car)) (when (not this) (set! this this) (goto cfg-4) @@ -277,7 +273,7 @@ ;; definition for method 33 of type test-car ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body test-car ((this test-car)) +(defmethod init-skel-and-rigid-body ((this test-car)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-cara" (the-as (pointer uint32) #f))) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/transport_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/transport_REF.gc index 4cc96521ffb..dcb4c110d53 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/transport_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/transport_REF.gc @@ -22,24 +22,22 @@ ;; definition of type vehicle-turret (deftype vehicle-turret (process-focusable) - ((turret-jm joint-mod :offset-assert 204) - (turret turret-control :inline :offset-assert 208) - (target handle :offset-assert 288) + ((turret-jm joint-mod) + (turret turret-control :inline) + (target handle) ) - :heap-base #xb0 - :method-count-assert 31 - :size-assert #x128 - :flag-assert #x1f00b00128 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (vehicle-turret-method-28 (_type_) none 28) - (vehicle-turret-method-29 (_type_) none 29) - (vehicle-turret-method-30 (_type_) none 30) + (vehicle-turret-method-28 (_type_) none) + (vehicle-turret-method-29 (_type_) none) + (vehicle-turret-method-30 (_type_) none) ) ) ;; definition for method 3 of type vehicle-turret -(defmethod inspect vehicle-turret ((this vehicle-turret)) +(defmethod inspect ((this vehicle-turret)) (when (not this) (set! this this) (goto cfg-4) @@ -56,7 +54,7 @@ ;; definition for method 29 of type vehicle-turret ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-turret-method-29 vehicle-turret ((this vehicle-turret)) +(defmethod vehicle-turret-method-29 ((this vehicle-turret)) (let* ((s4-0 (ppointer->process (-> this parent))) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -104,7 +102,7 @@ ;; definition for method 28 of type vehicle-turret ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-turret-method-28 vehicle-turret ((this vehicle-turret)) +(defmethod vehicle-turret-method-28 ((this vehicle-turret)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -133,7 +131,7 @@ ) ;; definition for method 7 of type vehicle-turret -(defmethod relocate vehicle-turret ((this vehicle-turret) (arg0 int)) +(defmethod relocate ((this vehicle-turret) (arg0 int)) (if (nonzero? (-> this turret-jm)) (&+! (-> this turret-jm) arg0) ) @@ -142,7 +140,7 @@ ;; definition for method 30 of type vehicle-turret ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-turret-method-30 vehicle-turret ((this vehicle-turret)) +(defmethod vehicle-turret-method-30 ((this vehicle-turret)) (set! (-> this turret-jm) (the-as joint-mod (new 'process 'joint-mod-rotate-local this (-> this turret info joint-index) #t)) ) @@ -195,21 +193,18 @@ ;; definition of type transport-params (deftype transport-params (structure) - ((spawn-pos vector :inline :offset-assert 0) - (quat quaternion :inline :offset-assert 16) - (nav-mesh nav-mesh :offset-assert 32) - (max-guard uint32 :offset-assert 36) - (max-time float :offset-assert 40) - (turret? symbol :offset-assert 44) - (speeches? symbol :offset-assert 48) + ((spawn-pos vector :inline) + (quat quaternion :inline) + (nav-mesh nav-mesh) + (max-guard uint32) + (max-time float) + (turret? symbol) + (speeches? symbol) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type transport-params -(defmethod inspect transport-params ((this transport-params)) +(defmethod inspect ((this transport-params)) (when (not this) (set! this this) (goto cfg-4) @@ -228,37 +223,35 @@ ;; definition of type transport (deftype transport (process-focusable) - ((y-dest float :offset-assert 204) - (last-guard-spawn-time time-frame :offset-assert 208) - (nav-mesh nav-mesh :offset-assert 216) - (spawn-side uint32 :offset-assert 220) - (spawn? symbol :offset-assert 224) - (leave-time time-frame :offset-assert 232) - (max-guard uint32 :offset-assert 240) - (count-guard uint32 :offset-assert 244) - (max-time float :offset-assert 248) - (ambient-sound-id sound-id :offset-assert 252) - (turret handle :offset-assert 256) + ((y-dest float) + (last-guard-spawn-time time-frame) + (nav-mesh nav-mesh) + (spawn-side uint32) + (spawn? symbol) + (leave-time time-frame) + (max-guard uint32) + (count-guard uint32) + (max-time float) + (ambient-sound-id sound-id) + (turret handle) ) - :heap-base #x90 - :method-count-assert 36 - :size-assert #x108 - :flag-assert #x2400900108 + (:state-methods + come-down + idle + leave + die-fast + ) (:methods - (come-down () _type_ :state 27) - (idle () _type_ :state 28) - (leave () _type_ :state 29) - (die-fast () _type_ :state 30) - (transport-method-31 (_type_) none 31) - (transport-method-32 (_type_) none 32) - (transport-method-33 (_type_) none 33) - (transport-method-34 (_type_ process) none 34) - (transport-method-35 (_type_) none 35) + (transport-method-31 (_type_) none) + (transport-method-32 (_type_) none) + (transport-method-33 (_type_) none) + (transport-method-34 (_type_ process) none) + (transport-method-35 (_type_) none) ) ) ;; definition for method 3 of type transport -(defmethod inspect transport ((this transport)) +(defmethod inspect ((this transport)) (when (not this) (set! this this) (goto cfg-4) @@ -313,13 +306,13 @@ ) ;; definition for method 12 of type transport -(defmethod run-logic? transport ((this transport)) +(defmethod run-logic? ((this transport)) #t ) ;; definition for method 35 of type transport ;; WARN: Return type mismatch int vs none. -(defmethod transport-method-35 transport ((this transport)) +(defmethod transport-method-35 ((this transport)) (let ((f30-0 (lerp-scale 0.0 2.0 (fabs (-> this root transv y)) 0.0 122880.0)) (f0-4 (lerp-scale 0.0 1.0 (- (-> this root trans y) (-> this y-dest)) 143360.0 20480.0)) (a0-3 (static-sound-spec "transport" :volume 0.0 :mask (pitch reg0))) @@ -333,7 +326,7 @@ ) ;; definition for method 10 of type transport -(defmethod deactivate transport ((this transport)) +(defmethod deactivate ((this transport)) (sound-stop (-> this ambient-sound-id)) (call-parent-method this) (none) @@ -475,7 +468,7 @@ ;; definition for method 33 of type transport ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod transport-method-33 transport ((this transport)) +(defmethod transport-method-33 ((this transport)) (when (>= (- (current-time) (-> this last-guard-spawn-time)) 0) (let ((s5-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> s5-0 object-type) (traffic-type crimson-guard-1)) @@ -514,7 +507,7 @@ ;; definition for method 34 of type transport ;; WARN: Return type mismatch int vs none. -(defmethod transport-method-34 transport ((this transport) (arg0 process)) +(defmethod transport-method-34 ((this transport) (arg0 process)) (let ((v1-1 (handle->process (-> this turret)))) (if v1-1 (set! (-> (the-as vehicle-turret v1-1) target) (process->handle arg0)) @@ -526,7 +519,7 @@ ;; definition for method 31 of type transport ;; WARN: Return type mismatch int vs none. -(defmethod transport-method-31 transport ((this transport)) +(defmethod transport-method-31 ((this transport)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -569,7 +562,7 @@ ;; definition for method 32 of type transport ;; WARN: Return type mismatch int vs none. -(defmethod transport-method-32 transport ((this transport)) +(defmethod transport-method-32 ((this transport)) (set! (-> this spawn-side) (the-as uint 0)) 0 (none) @@ -610,7 +603,7 @@ ;; definition for method 11 of type transport ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! transport ((this transport) (arg0 entity-actor)) +(defmethod init-from-entity! ((this transport) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-control_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-control_REF.gc index d03d1c0ab4f..2bc1d253ca7 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-control_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-control_REF.gc @@ -6,7 +6,7 @@ ;; definition for method 21 of type vehicle-controller ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-21 vehicle-controller ((this vehicle-controller)) +(defmethod vehicle-controller-method-21 ((this vehicle-controller)) (when (logtest? (-> this flags) (vehicle-controller-flag attached)) (let ((v1-3 (-> this branch))) (when (or (not v1-3) (zero? v1-3)) @@ -36,7 +36,7 @@ ;; definition for method 20 of type vehicle-controller ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-20 vehicle-controller ((this vehicle-controller) (arg0 object) (arg1 float)) +(defmethod vehicle-controller-method-20 ((this vehicle-controller) (arg0 object) (arg1 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -97,7 +97,7 @@ ;; definition for method 19 of type vehicle-controller ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-19 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 object) (arg2 vector) (arg3 vector)) +(defmethod vehicle-controller-method-19 ((this vehicle-controller) (arg0 vector) (arg1 object) (arg2 vector) (arg3 vector)) (set! (-> this path-prev-point quad) (-> arg0 quad)) (vector-vector-distance arg0 arg2) (set! (-> this target-speed) (vector-length arg3)) @@ -114,7 +114,7 @@ ;; definition for method 13 of type vehicle-controller ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-13 vehicle-controller ((this vehicle-controller) (arg0 nav-branch) (arg1 vector)) +(defmethod vehicle-controller-method-13 ((this vehicle-controller) (arg0 nav-branch) (arg1 vector)) (vehicle-controller-method-10 this (the-as traffic-tracker arg0)) (set! (-> this path-prev-point quad) (-> arg1 quad)) (set! (-> this branch) arg0) @@ -149,7 +149,7 @@ ) ;; definition for method 15 of type vehicle-controller -(defmethod vehicle-controller-method-15 vehicle-controller ((this vehicle-controller)) +(defmethod vehicle-controller-method-15 ((this vehicle-controller)) (let ((gp-0 (the-as nav-branch #f))) (let* ((s5-0 (-> this branch dest-node)) (s4-0 (-> s5-0 branch-count)) @@ -191,7 +191,7 @@ ;; definition for method 14 of type vehicle-controller ;; INFO: Used lq/sq -(defmethod vehicle-controller-method-14 vehicle-controller ((this vehicle-controller) (arg0 vehicle)) +(defmethod vehicle-controller-method-14 ((this vehicle-controller) (arg0 vehicle)) (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-0 ((-> this choose-branch-callback) this arg0)) ) @@ -207,7 +207,7 @@ ;; definition for method 16 of type vehicle-controller ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-16 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 vector)) +(defmethod vehicle-controller-method-16 ((this vehicle-controller) (arg0 vector) (arg1 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -317,7 +317,7 @@ ;; WARN: Stack slot offset 24 signed mismatch ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-18 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 vector) (arg2 vehicle) (arg3 float)) +(defmethod vehicle-controller-method-18 ((this vehicle-controller) (arg0 vector) (arg1 vector) (arg2 vehicle) (arg3 float)) (local-vars (v1-24 float) (v1-88 float) @@ -593,7 +593,7 @@ ;; definition for method 10 of type vehicle-controller ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-10 vehicle-controller ((this vehicle-controller) (arg0 traffic-tracker)) +(defmethod vehicle-controller-method-10 ((this vehicle-controller) (arg0 traffic-tracker)) (when (not (logtest? (-> this flags) (vehicle-controller-flag attached))) (logior! (-> this flags) (vehicle-controller-flag attached)) (+! (-> arg0 active-object-count) 1) @@ -604,7 +604,7 @@ ;; definition for method 11 of type vehicle-controller ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-11 vehicle-controller ((this vehicle-controller)) +(defmethod vehicle-controller-method-11 ((this vehicle-controller)) (when (logtest? (-> this flags) (vehicle-controller-flag attached)) (logclear! (-> this flags) (vehicle-controller-flag attached)) (let ((v1-5 (-> this branch))) @@ -628,13 +628,13 @@ ;; definition for method 12 of type vehicle-controller ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-12 vehicle-controller ((this vehicle-controller) - (arg0 rigid-body-vehicle-constants) - (arg1 vector) - (arg2 float) - (arg3 int) - (arg4 float) - ) +(defmethod vehicle-controller-method-12 ((this vehicle-controller) + (arg0 rigid-body-vehicle-constants) + (arg1 vector) + (arg2 float) + (arg3 int) + (arg4 float) + ) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 quad) (-> arg1 quad)) (set! (-> s3-0 y) 0.0) @@ -664,7 +664,7 @@ ;; definition for method 17 of type vehicle-controller ;; WARN: Return type mismatch int vs none. -(defmethod draw-debug-info vehicle-controller ((this vehicle-controller)) +(defmethod draw-debug-info ((this vehicle-controller)) (add-debug-sphere #t (bucket-id debug2) (-> this dest-circle) (-> this dest-circle w) *color-green*) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this target-point) *color-white*) (add-debug-vector @@ -703,7 +703,7 @@ ;; definition for method 9 of type vehicle-controller ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-9 vehicle-controller ((this vehicle-controller)) +(defmethod vehicle-controller-method-9 ((this vehicle-controller)) (set! (-> this traffic) *traffic-engine*) (set! (-> this choose-branch-callback) (the-as (function vehicle-controller vehicle nav-branch) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-effects_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-effects_REF.gc index c0e73b176b1..be455e5dca6 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-effects_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-effects_REF.gc @@ -4,7 +4,7 @@ ;; definition for method 36 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-engine-sounds vehicle ((this vehicle)) +(defmethod do-engine-sounds ((this vehicle)) (local-vars (v1-36 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -223,7 +223,7 @@ ;; definition for method 84 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-thruster vehicle ((this vehicle) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod draw-thruster ((this vehicle) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -315,7 +315,7 @@ ;; definition for method 85 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-thrusters vehicle ((this vehicle)) +(defmethod draw-thrusters ((this vehicle)) (local-vars (sv-272 sparticle-launcher) (sv-276 sparticle-launcher)) (when (= (-> this controller traffic sync-mask-32) (ash 1 (logand (-> this traffic-priority-id) 31))) (let ((f0-1 diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc index 13e43585510..c46a0e5a2cb 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc @@ -3,16 +3,13 @@ ;; definition of type turret-barrel-info (deftype turret-barrel-info (structure) - ((local-pos vector :inline :offset-assert 0) - (local-dir vector :inline :offset-assert 16) + ((local-pos vector :inline) + (local-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type turret-barrel-info -(defmethod inspect turret-barrel-info ((this turret-barrel-info)) +(defmethod inspect ((this turret-barrel-info)) (when (not this) (set! this this) (goto cfg-4) @@ -26,27 +23,24 @@ ;; definition of type turret-control-info (deftype turret-control-info (structure) - ((joint-index int8 :offset-assert 0) - (barrel-count int8 :offset-assert 1) - (shot-speed float :offset-assert 4) - (attack-range float :offset-assert 8) - (rot-min float 2 :offset-assert 12) - (rot-max float 2 :offset-assert 20) - (rot-x-min float :offset 12) - (rot-x-max float :offset 20) - (rot-y-min float :offset 16) - (rot-y-max float :offset 24) - (local-pos vector :inline :offset-assert 32) - (local-dir vector :inline :offset-assert 48) - (barrel-array turret-barrel-info 4 :inline :offset-assert 64) + ((joint-index int8) + (barrel-count int8) + (shot-speed float) + (attack-range float) + (rot-min float 2) + (rot-max float 2) + (rot-x-min float :overlay-at (-> rot-min 0)) + (rot-x-max float :overlay-at (-> rot-max 0)) + (rot-y-min float :overlay-at (-> rot-min 1)) + (rot-y-max float :overlay-at (-> rot-max 1)) + (local-pos vector :inline) + (local-dir vector :inline) + (barrel-array turret-barrel-info 4 :inline) ) - :method-count-assert 9 - :size-assert #xc0 - :flag-assert #x9000000c0 ) ;; definition for method 3 of type turret-control-info -(defmethod inspect turret-control-info ((this turret-control-info)) +(defmethod inspect ((this turret-control-info)) (when (not this) (set! this this) (goto cfg-4) @@ -71,45 +65,42 @@ ;; definition of type turret-control (deftype turret-control (structure) - ((info turret-control-info :offset-assert 0) - (guard-settings traffic-guard-type-settings :offset-assert 4) - (flags turret-flag :offset-assert 8) - (shot-count int8 :offset-assert 9) - (burst-count int16 :offset-assert 10) - (target-dist float :offset-assert 12) - (inaccuracy float :offset-assert 16) - (aim-offset-angle degrees :offset-assert 20) - (aim-rot float 2 :offset-assert 24) - (aim-rot-vel float 2 :offset-assert 32) - (aim-rot-offset float 2 :offset-assert 40) - (aim-rot-x float :offset 24) - (aim-rot-y float :offset 28) - (aim-rot-vel-x float :offset 32) - (aim-rot-vel-y float :offset 36) - (target-in-sight-time time-frame :offset-assert 48) - (aim-acquire-time time-frame :offset-assert 56) - (shoot-time time-frame :offset-assert 64) - (owner-handle handle :offset-assert 72) + ((info turret-control-info) + (guard-settings traffic-guard-type-settings) + (flags turret-flag) + (shot-count int8) + (burst-count int16) + (target-dist float) + (inaccuracy float) + (aim-offset-angle degrees) + (aim-rot float 2) + (aim-rot-vel float 2) + (aim-rot-offset float 2) + (aim-rot-x float :overlay-at (-> aim-rot 0)) + (aim-rot-y float :overlay-at (-> aim-rot 1)) + (aim-rot-vel-x float :overlay-at (-> aim-rot-vel 0)) + (aim-rot-vel-y float :overlay-at (-> aim-rot-vel 1)) + (target-in-sight-time time-frame) + (aim-acquire-time time-frame) + (shoot-time time-frame) + (owner-handle handle) ) :pack-me - :method-count-assert 18 - :size-assert #x50 - :flag-assert #x1200000050 (:methods - (turret-control-method-9 (_type_ vehicle vector vector) none 9) - (turret-control-method-10 (_type_ vehicle) none 10) - (turret-control-method-11 (_type_ object object vector) none 11) - (update-joint-mod (_type_ joint-mod-rotate-local) none 12) - (turret-control-method-13 (_type_) none 13) - (turret-control-method-14 (_type_) none 14) - (set-info (_type_ turret-control-info) none 15) - (turret-control-method-16 (_type_ float float) none 16) - (turret-control-method-17 (_type_ vehicle) none 17) + (turret-control-method-9 (_type_ vehicle vector vector) none) + (turret-control-method-10 (_type_ vehicle) none) + (turret-control-method-11 (_type_ object object vector) none) + (update-joint-mod (_type_ joint-mod-rotate-local) none) + (turret-control-method-13 (_type_) none) + (turret-control-method-14 (_type_) none) + (set-info (_type_ turret-control-info) none) + (turret-control-method-16 (_type_ float float) none) + (turret-control-method-17 (_type_ vehicle) none) ) ) ;; definition for method 3 of type turret-control -(defmethod inspect turret-control ((this turret-control)) +(defmethod inspect ((this turret-control)) (when (not this) (set! this this) (goto cfg-16) @@ -161,7 +152,7 @@ ;; definition for method 15 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod set-info turret-control ((this turret-control) (arg0 turret-control-info)) +(defmethod set-info ((this turret-control) (arg0 turret-control-info)) (set! (-> this info) arg0) (set! (-> this owner-handle) (the-as handle #f)) 0 @@ -170,7 +161,7 @@ ;; definition for method 12 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mod turret-control ((this turret-control) (arg0 joint-mod-rotate-local)) +(defmethod update-joint-mod ((this turret-control) (arg0 joint-mod-rotate-local)) (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 x) (- (-> this aim-rot-x))) (set! (-> v1-0 y) (-> this aim-rot-y)) @@ -183,7 +174,7 @@ ;; definition for method 13 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-13 turret-control ((this turret-control)) +(defmethod turret-control-method-13 ((this turret-control)) (let ((f30-0 (/ (* 298261630.0 (-> this inaccuracy) (-> this guard-settings inaccuracy)) (fmax 40960.0 (-> this target-dist)) ) @@ -199,7 +190,7 @@ ;; definition for method 14 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-14 turret-control ((this turret-control)) +(defmethod turret-control-method-14 ((this turret-control)) (logclear! (-> this flags) (turret-flag firing aiming)) (set! (-> this burst-count) 0) (set! (-> this aim-offset-angle) (* 65536.0 (rand-vu))) @@ -337,7 +328,7 @@ ;; definition for method 9 of type turret-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-9 turret-control ((this turret-control) (arg0 vehicle) (arg1 vector) (arg2 vector)) +(defmethod turret-control-method-9 ((this turret-control) (arg0 vehicle) (arg1 vector) (arg2 vector)) (let ((gp-0 (new 'stack-no-clear 'turret-unknown-stack-structure))) (set! (-> gp-0 vec-12 x) (seconds-per-frame)) (let* ((v1-1 (-> gp-0 mat-1)) @@ -489,7 +480,7 @@ ;; definition for method 10 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-10 turret-control ((this turret-control) (arg0 vehicle)) +(defmethod turret-control-method-10 ((this turret-control) (arg0 vehicle)) (cond ((logtest? (-> this flags) (turret-flag should-shoot)) (cond @@ -530,7 +521,7 @@ ;; definition for method 11 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-11 turret-control ((this turret-control) (arg0 object) (arg1 object) (arg2 vector)) +(defmethod turret-control-method-11 ((this turret-control) (arg0 object) (arg1 object) (arg2 vector)) (when (nonzero? (-> this info)) (set! (-> this inaccuracy) (* 0.000012207031 (+ 20480.0 (vector-length arg2)))) (turret-control-method-9 this (the-as vehicle arg0) (the-as vector arg1) arg2) @@ -543,7 +534,7 @@ ;; definition for method 17 of type turret-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-17 turret-control ((this turret-control) (arg0 vehicle)) +(defmethod turret-control-method-17 ((this turret-control) (arg0 vehicle)) (let ((s4-0 (new 'stack-no-clear 'turret-unknown-stack-structure2))) (set! (-> s4-0 proj-params ent) (-> arg0 entity)) (set! (-> s4-0 proj-params charge) 1.0) @@ -586,7 +577,7 @@ ;; definition for method 16 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-16 turret-control ((this turret-control) (arg0 float) (arg1 float)) +(defmethod turret-control-method-16 ((this turret-control) (arg0 float) (arg1 float)) (let ((f0-0 (seconds-per-frame))) (set! (-> this aim-rot-vel-x) arg1) (set! (-> this aim-rot-vel-y) arg0) @@ -612,27 +603,24 @@ ;; definition of type vehicle-guard-target-data (deftype vehicle-guard-target-data (structure) - ((tpos vector :inline :offset-assert 0) - (spos vector :inline :offset-assert 16) - (tvel vector :inline :offset-assert 32) - (svel vector :inline :offset-assert 48) - (tdir vector :inline :offset-assert 64) - (sdir vector :inline :offset-assert 80) - (to-target vector :inline :offset-assert 96) - (to-target-dir vector :inline :offset-assert 112) - (temp vector :inline :offset-assert 128) - (target target :offset-assert 144) - (dist float :offset-assert 148) - (inv-dist float :offset-assert 152) - (attack-range float :offset-assert 156) + ((tpos vector :inline) + (spos vector :inline) + (tvel vector :inline) + (svel vector :inline) + (tdir vector :inline) + (sdir vector :inline) + (to-target vector :inline) + (to-target-dir vector :inline) + (temp vector :inline) + (target target) + (dist float) + (inv-dist float) + (attack-range float) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type vehicle-guard-target-data -(defmethod inspect vehicle-guard-target-data ((this vehicle-guard-target-data)) +(defmethod inspect ((this vehicle-guard-target-data)) (when (not this) (set! this this) (goto cfg-4) @@ -657,42 +645,40 @@ ;; definition of type vehicle-guard (deftype vehicle-guard (vehicle) - ((ai-hook (function vehicle-guard none) :offset-assert 880) - (turret turret-control :inline :offset-assert 888) - (target-flags turret-flag :offset-assert 968) - (target-in-sight-time time-frame :offset-assert 976) - (minimap connection-minimap :offset-assert 984) - (vehicle-guard-pad-k1jn23k1 uint32 :offset-assert 988) - (traffic-target-status traffic-target-status :offset-assert 992) - (pursuit-target handle :offset-assert 1000) - (vehicle-guard-pad-1kjh2nb3k1 uint32 16 :offset-assert 1008) - (lod2 symbol :offset-assert 1072) + ((ai-hook (function vehicle-guard none)) + (turret turret-control :inline) + (target-flags turret-flag) + (target-in-sight-time time-frame) + (minimap connection-minimap) + (vehicle-guard-pad-k1jn23k1 uint32) + (traffic-target-status traffic-target-status) + (pursuit-target handle) + (vehicle-guard-pad-1kjh2nb3k1 uint32 16) + (lod2 symbol) ) - :heap-base #x3c0 - :method-count-assert 159 - :size-assert #x434 - :flag-assert #x9f03c00434 + (:state-methods + hostile + stop-and-shoot + slow-pursuit + vehicle-guard-state-147 + vehicle-guard-state-148 + waiting-ambush + ) (:methods - (hostile () _type_ :state 144) - (stop-and-shoot () _type_ :state 145) - (slow-pursuit () _type_ :state 146) - (vehicle-guard-method-147 () none 147) - (vehicle-guard-method-148 () none 148) - (waiting-ambush () _type_ :state 149) - (vehicle-guard-method-150 (_type_) none 150) - (vehicle-guard-method-151 (_type_ vehicle-guard-target-data) none 151) - (vehicle-guard-method-152 (_type_ vehicle-guard-target-data) none 152) - (vehicle-guard-method-153 (_type_ target) none 153) - (vehicle-guard-method-154 (_type_) none 154) - (vehicle-guard-method-155 (_type_ vector vector) none 155) - (vehicle-guard-method-156 (_type_) none 156) - (vehicle-guard-method-157 (_type_ vehicle-guard-target-data) symbol 157) - (vehicle-guard-method-158 (_type_) none 158) + (vehicle-guard-method-150 (_type_) none) + (vehicle-guard-method-151 (_type_ vehicle-guard-target-data) none) + (vehicle-guard-method-152 (_type_ vehicle-guard-target-data) none) + (vehicle-guard-method-153 (_type_ target) none) + (vehicle-guard-method-154 (_type_) none) + (vehicle-guard-method-155 (_type_ vector vector) none) + (vehicle-guard-method-156 (_type_) none) + (vehicle-guard-method-157 (_type_ vehicle-guard-target-data) symbol) + (vehicle-guard-method-158 (_type_) none) ) ) ;; definition for method 3 of type vehicle-guard -(defmethod inspect vehicle-guard ((this vehicle-guard)) +(defmethod inspect ((this vehicle-guard)) (when (not this) (set! this this) (goto cfg-14) @@ -733,7 +719,7 @@ ;; definition for method 153 of type vehicle-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-153 vehicle-guard ((this vehicle-guard) (arg0 target)) +(defmethod vehicle-guard-method-153 ((this vehicle-guard) (arg0 target)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> (get-trans arg0 3) quad)) (turret-control-method-11 (-> this turret) this s5-0 (-> arg0 control transv)) @@ -745,7 +731,7 @@ ;; definition for method 151 of type vehicle-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-151 vehicle-guard ((this vehicle-guard) (arg0 vehicle-guard-target-data)) +(defmethod vehicle-guard-method-151 ((this vehicle-guard) (arg0 vehicle-guard-target-data)) (let ((s5-0 (handle->process (-> this pursuit-target)))) (set! (-> arg0 target) (the-as target s5-0)) (when s5-0 @@ -779,7 +765,7 @@ ;; definition for method 152 of type vehicle-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-152 vehicle-guard ((this vehicle-guard) (arg0 vehicle-guard-target-data)) +(defmethod vehicle-guard-method-152 ((this vehicle-guard) (arg0 vehicle-guard-target-data)) (let ((s4-0 (handle->process (-> this pursuit-target)))) (cond ((logtest? (rigid-body-object-flag target-in-sight) (-> this flags)) @@ -835,7 +821,7 @@ ;; definition for method 150 of type vehicle-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-150 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-guard-method-150 ((this vehicle-guard)) (cond ((handle->process (-> this pursuit-target)) (let ((v1-3 (new 'stack-no-clear 'vehicle-control-point))) @@ -891,7 +877,7 @@ ;; definition for method 155 of type vehicle-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-155 vehicle-guard ((this vehicle-guard) (arg0 vector) (arg1 vector)) +(defmethod vehicle-guard-method-155 ((this vehicle-guard) (arg0 vector) (arg1 vector)) (cond (#f (let ((s5-0 (new 'stack-no-clear 'traj3d-params))) @@ -965,7 +951,7 @@ ;; definition for method 134 of type vehicle-guard ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-134 vehicle-guard ((this vehicle-guard) (arg0 process)) +(defmethod vehicle-method-134 ((this vehicle-guard) (arg0 process)) "Stubbed" (set! (-> this pursuit-target) (process->handle arg0)) (logior! (-> this flags) (rigid-body-object-flag alert)) @@ -976,7 +962,7 @@ ;; definition for method 46 of type vehicle-guard ;; WARN: disable def twice: 112. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod rigid-body-object-method-46 vehicle-guard ((this vehicle-guard) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 ((this vehicle-guard) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('impact-impulse) (let ((s5-1 (the-as matrix (-> arg3 param 0)))) @@ -1058,7 +1044,7 @@ ;; definition for method 137 of type vehicle-guard ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-137 vehicle-guard ((this vehicle-guard) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-137 ((this vehicle-guard) (arg0 traffic-object-spawn-params)) (vehicle-rider-spawn this crimson-guard-rider arg0) 0 (none) @@ -1109,7 +1095,7 @@ ;; definition for method 31 of type vehicle-guard ;; WARN: Return type mismatch int vs none. -(defmethod alloc-and-init-rigid-body-control vehicle-guard ((this vehicle-guard) (arg0 rigid-body-vehicle-constants)) +(defmethod alloc-and-init-rigid-body-control ((this vehicle-guard) (arg0 rigid-body-vehicle-constants)) (let ((t9-0 (method-of-type vehicle alloc-and-init-rigid-body-control))) (t9-0 this arg0) ) @@ -1124,7 +1110,7 @@ ;; definition for method 82 of type vehicle-guard ;; WARN: Return type mismatch traffic-guard-type-settings vs none. -(defmethod vehicle-method-82 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-method-82 ((this vehicle-guard)) (let ((t9-0 (method-of-type vehicle vehicle-method-82))) (t9-0 this) ) @@ -1135,7 +1121,7 @@ ) ;; definition for method 128 of type vehicle-guard -(defmethod vehicle-method-128 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-method-128 ((this vehicle-guard)) (if (not (-> this minimap)) (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 14) (the-as int #f) (the-as vector #t) 0)) ) @@ -1144,7 +1130,7 @@ ) ;; definition for method 127 of type vehicle-guard -(defmethod vehicle-method-127 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-method-127 ((this vehicle-guard)) (when (-> this minimap) (logior! (-> this minimap flags) (minimap-flag fade-out)) (set! (-> this minimap) #f) @@ -1154,7 +1140,7 @@ ) ;; definition for method 129 of type vehicle-guard -(defmethod vehicle-method-129 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-method-129 ((this vehicle-guard)) (when (-> this minimap) (logior! (-> this minimap flags) (minimap-flag fade-out)) (set! (-> this minimap) #f) @@ -1165,7 +1151,7 @@ ;; definition for method 130 of type vehicle-guard ;; WARN: Return type mismatch object vs none. -(defmethod vehicle-method-130 vehicle-guard ((this vehicle-guard) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-130 ((this vehicle-guard) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((9) (vehicle-method-128 this) @@ -1181,7 +1167,7 @@ ) ;; definition for method 157 of type vehicle-guard -(defmethod vehicle-guard-method-157 vehicle-guard ((this vehicle-guard) (arg0 vehicle-guard-target-data)) +(defmethod vehicle-guard-method-157 ((this vehicle-guard) (arg0 vehicle-guard-target-data)) (local-vars (v1-11 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1215,7 +1201,7 @@ ;; definition for method 156 of type vehicle-guard ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-156 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-guard-method-156 ((this vehicle-guard)) (let ((f30-0 (seconds-per-frame))) (seek! (-> this controls throttle) 0.0 (* 4.0 f30-0)) (+! (-> this controls brake) (* (- 1.0 (-> this controls brake)) (fmin 1.0 (* 8.0 f30-0)))) @@ -1250,7 +1236,7 @@ ;; definition for method 154 of type vehicle-guard ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-154 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-guard-method-154 ((this vehicle-guard)) (if (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) (rigid-body-object-method-38 this) ) @@ -1278,7 +1264,7 @@ ;; definition for method 158 of type vehicle-guard ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-158 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-guard-method-158 ((this vehicle-guard)) (vehicle-guard-method-150 this) (let ((s5-0 (new 'stack-no-clear 'vehicle-guard-target-data))) (vehicle-guard-method-151 this s5-0) @@ -1310,7 +1296,7 @@ ;; definition for method 94 of type vehicle-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-94 vehicle-guard ((this vehicle-guard)) +(defmethod vehicle-method-94 ((this vehicle-guard)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-h_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-h_REF.gc index 787fdd08104..4a6ea851d36 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-h_REF.gc @@ -3,17 +3,14 @@ ;; definition of type vehicle-lookup-info (deftype vehicle-lookup-info (structure) - ((turn-radius meters :offset-assert 0) - (throttle-turning float :offset-assert 4) - (throttle-straight float :offset-assert 8) + ((turn-radius meters) + (throttle-turning float) + (throttle-straight float) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type vehicle-lookup-info -(defmethod inspect vehicle-lookup-info ((this vehicle-lookup-info)) +(defmethod inspect ((this vehicle-lookup-info)) (when (not this) (set! this this) (goto cfg-4) @@ -28,16 +25,13 @@ ;; definition of type vehicle-control-point (deftype vehicle-control-point (structure) - ((local-pos vector :inline :offset-assert 0) - (normal vector :inline :offset-assert 16) + ((local-pos vector :inline) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type vehicle-control-point -(defmethod inspect vehicle-control-point ((this vehicle-control-point)) +(defmethod inspect ((this vehicle-control-point)) (when (not this) (set! this this) (goto cfg-4) @@ -51,16 +45,13 @@ ;; definition of type vehicle-section-info (deftype vehicle-section-info (structure) - ((damage-seg-array uint64 3 :offset-assert 0) - (damage-seg-count int8 :offset-assert 24) + ((damage-seg-array uint64 3) + (damage-seg-count int8) ) - :method-count-assert 9 - :size-assert #x19 - :flag-assert #x900000019 ) ;; definition for method 3 of type vehicle-section-info -(defmethod inspect vehicle-section-info ((this vehicle-section-info)) +(defmethod inspect ((this vehicle-section-info)) (when (not this) (set! this this) (goto cfg-4) @@ -74,21 +65,18 @@ ;; definition of type vehicle-seat-info (deftype vehicle-seat-info (structure) - ((data uint8 16 :offset-assert 0) - (position vector :inline :offset 0) - (pos-x float :offset 0) - (pos-y float :offset 4) - (pos-z float :offset 8) - (angle int16 :offset 12) - (flags uint8 :offset 14) + ((data uint8 16) + (position vector :inline :overlay-at (-> data 0)) + (pos-x float :overlay-at (-> data 0)) + (pos-y float :overlay-at (-> data 4)) + (pos-z float :overlay-at (-> data 8)) + (angle int16 :overlay-at (-> data 12)) + (flags uint8 :overlay-at (-> data 14)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type vehicle-seat-info -(defmethod inspect vehicle-seat-info ((this vehicle-seat-info)) +(defmethod inspect ((this vehicle-seat-info)) (when (not this) (set! this this) (goto cfg-4) @@ -107,17 +95,14 @@ ;; definition of type vehicle-explosion-info (deftype vehicle-explosion-info (joint-exploder-static-params) - ((skel skeleton-group :offset-assert 16) - (skel-name string :offset-assert 20) - (anim int32 :offset-assert 24) + ((skel skeleton-group) + (skel-name string) + (anim int32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type vehicle-explosion-info -(defmethod inspect vehicle-explosion-info ((this vehicle-explosion-info)) +(defmethod inspect ((this vehicle-explosion-info)) (when (not this) (set! this this) (goto cfg-4) @@ -135,16 +120,13 @@ ;; definition of type vehicle-grab-rail-info (deftype vehicle-grab-rail-info (structure) - ((local-pos vector 2 :inline :offset-assert 0) - (normal vector :inline :offset-assert 32) + ((local-pos vector 2 :inline) + (normal vector :inline) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type vehicle-grab-rail-info -(defmethod inspect vehicle-grab-rail-info ((this vehicle-grab-rail-info)) +(defmethod inspect ((this vehicle-grab-rail-info)) (when (not this) (set! this this) (goto cfg-4) @@ -158,135 +140,132 @@ ;; definition of type rigid-body-vehicle-constants (deftype rigid-body-vehicle-constants (rigid-body-object-constants) - ((flags uint32 :offset-assert 208) - (object-type uint8 :offset-assert 212) - (guard-type uint8 :offset-assert 213) - (max-engine-thrust meters :offset-assert 216) - (inv-max-engine-thrust float :offset-assert 220) - (engine-response-rate float :offset-assert 224) - (engine-intake-factor float :offset-assert 228) - (brake-factor float :offset-assert 232) - (turbo-boost-factor float :offset-assert 236) - (max-xz-speed meters :offset-assert 240) - (ground-probe-distance meters :offset-assert 244) - (ground-probe-offset meters :offset-assert 248) - (cos-ground-effect-angle float :offset-assert 252) - (spring-lift-factor float :offset-assert 256) - (air-steering-factor float :offset-assert 260) - (air-drag-factor float :offset-assert 264) - (steering-fin-angle float :offset-assert 268) - (steering-thruster-factor float :offset-assert 272) - (steering-thruster-max-gain float :offset-assert 276) - (steering-thruster-half-gain-speed meters :offset-assert 280) - (tire-steering-angle float :offset-assert 284) - (tire-friction-factor float :offset-assert 288) - (tire-static-friction float :offset-assert 292) - (tire-static-friction-speed meters :offset-assert 296) - (tire-dynamic-friction float :offset-assert 300) - (tire-dynamic-friction-speed meters :offset-assert 304) - (tire-inv-max-friction-speed float :offset-assert 308) - (airfoil-factor float :offset-assert 312) - (drag-force-factor float :offset-assert 316) - (speed-scrubbing-drag float :offset-assert 320) - (speed-limiting-drag float :offset-assert 324) - (pitch-control-factor float :offset-assert 328) - (roll-control-factor float :offset-assert 332) - (roll-angle float :offset-assert 336) - (jump-thrust-factor float :offset-assert 340) - (buoyancy-factor float :offset-assert 344) - (player-weight float :offset-assert 348) - (player-shift-x meters :offset-assert 352) - (player-shift-z meters :offset-assert 356) - (target-speed-offset meters :offset-assert 360) - (turning-accel meters :offset-assert 364) - (toughness-factor float :offset-assert 368) - (damage-factor float :offset-assert 372) - (camera-string-min-height meters :offset-assert 376) - (camera-string-max-height meters :offset-assert 380) - (camera-string-min-length meters :offset-assert 384) - (camera-string-max-length meters :offset-assert 388) - (camera-min-fov float :offset-assert 392) - (camera-max-fov float :offset-assert 396) - (camera-head-offset float :offset-assert 400) - (camera-foot-offset float :offset-assert 404) - (camera-normal-max-angle-offset float :offset-assert 408) - (camera-air-max-angle-offset float :offset-assert 412) - (camera-max-lookaround-speed float :offset-assert 416) - (seat-count int8 :offset-assert 420) - (section-count int8 :offset-assert 421) - (rider-stance uint8 :offset-assert 422) - (grab-rail-count int8 :offset-assert 423) - (grab-rail-array (inline-array vehicle-grab-rail-info) :offset-assert 424) - (seat-array vehicle-seat-info 4 :inline :offset-assert 432) - (rider-hand-offset vector 2 :inline :offset-assert 496) - (section-array vehicle-section-info 4 :inline :offset-assert 528) - (section-bike-front vehicle-section-info :inline :offset 528) - (section-bike-rear vehicle-section-info :inline :offset 560) - (section-car-front-left vehicle-section-info :inline :offset 528) - (section-car-rear-left vehicle-section-info :inline :offset 560) - (section-car-front-right vehicle-section-info :inline :offset 592) - (section-car-rear-right vehicle-section-info :inline :offset 624) - (explosion vehicle-explosion-info :offset-assert 656) - (engine-pitch-scale float :offset-assert 660) - (engine-pitch-offset float :offset-assert 664) - (engine-pitch-mod-amp float :offset-assert 668) - (engine-sound-select int8 :offset-assert 672) - (engine-sound sound-name :offset-assert 688) - (thrust-sound sound-name :offset-assert 704) - (scrape-sound sound-name :offset-assert 720) - (glance-sound sound-name :offset-assert 736) - (impact-sound sound-name :offset-assert 752) - (extra-sound sound-name :offset-assert 768) - (explosion-part int32 :offset-assert 784) - (headlight-count int8 :offset-assert 788) - (taillight-count int8 :offset-assert 789) - (thruster-flame-width meters :offset-assert 792) - (thruster-flame-length meters :offset-assert 796) - (thruster-local-pos vector 2 :inline :offset-assert 800) - (exhaust-local-pos vector 2 :inline :offset-assert 832) - (exhaust-local-dir vector 2 :inline :offset-assert 864) - (smoke-local-pos vector 2 :inline :offset-assert 896) - (smoke-local-vel vector 2 :inline :offset-assert 928) - (headlight-local-pos vector 3 :inline :offset-assert 960) - (taillight-local-pos vector 2 :inline :offset-assert 1008) - (lift-thruster-count int8 :offset-assert 1040) - (roll-thruster-count int8 :offset-assert 1041) - (steering-thruster-count int8 :offset-assert 1042) - (stabilizer-count int8 :offset-assert 1043) - (inv-lift-thruster-count float :offset-assert 1044) - (pad int8 8 :offset-assert 1048) - (lift-thruster-array vehicle-control-point 2 :inline :offset-assert 1056) - (roll-thruster-array vehicle-control-point 2 :inline :offset-assert 1120) - (steering-thruster-array vehicle-control-point 2 :inline :offset-assert 1184) - (stabilizer-array vehicle-control-point 6 :inline :offset-assert 1248) - (engine-thrust-local-pos vector :inline :offset-assert 1440) - (brake-local-pos vector :inline :offset-assert 1456) - (particle-system-2d basic :offset-assert 1472) - (particle-system-3d basic :offset-assert 1476) - (part-thruster basic :offset-assert 1480) - (part-thruster-scale-x sp-field-init-spec :offset-assert 1484) - (part-thruster-scale-y sp-field-init-spec :offset-assert 1488) - (part-quat quaternion :offset-assert 1492) - (part-vel vector :offset-assert 1496) - (color-option-count int8 :offset-assert 1500) - (color-option-select int8 :offset-assert 1501) - (color-option-array (inline-array vector) :offset-assert 1504) - (sample-dir vector :inline :offset-assert 1520) - (sample-time time-frame :offset-assert 1536) - (sample-index int32 :offset-assert 1544) + ((flags uint32) + (object-type uint8) + (guard-type uint8) + (max-engine-thrust meters) + (inv-max-engine-thrust float) + (engine-response-rate float) + (engine-intake-factor float) + (brake-factor float) + (turbo-boost-factor float) + (max-xz-speed meters) + (ground-probe-distance meters) + (ground-probe-offset meters) + (cos-ground-effect-angle float) + (spring-lift-factor float) + (air-steering-factor float) + (air-drag-factor float) + (steering-fin-angle float) + (steering-thruster-factor float) + (steering-thruster-max-gain float) + (steering-thruster-half-gain-speed meters) + (tire-steering-angle float) + (tire-friction-factor float) + (tire-static-friction float) + (tire-static-friction-speed meters) + (tire-dynamic-friction float) + (tire-dynamic-friction-speed meters) + (tire-inv-max-friction-speed float) + (airfoil-factor float) + (drag-force-factor float) + (speed-scrubbing-drag float) + (speed-limiting-drag float) + (pitch-control-factor float) + (roll-control-factor float) + (roll-angle float) + (jump-thrust-factor float) + (buoyancy-factor float) + (player-weight float) + (player-shift-x meters) + (player-shift-z meters) + (target-speed-offset meters) + (turning-accel meters) + (toughness-factor float) + (damage-factor float) + (camera-string-min-height meters) + (camera-string-max-height meters) + (camera-string-min-length meters) + (camera-string-max-length meters) + (camera-min-fov float) + (camera-max-fov float) + (camera-head-offset float) + (camera-foot-offset float) + (camera-normal-max-angle-offset float) + (camera-air-max-angle-offset float) + (camera-max-lookaround-speed float) + (seat-count int8) + (section-count int8) + (rider-stance uint8) + (grab-rail-count int8) + (grab-rail-array (inline-array vehicle-grab-rail-info)) + (seat-array vehicle-seat-info 4 :inline) + (rider-hand-offset vector 2 :inline) + (section-array vehicle-section-info 4 :inline) + (section-bike-front vehicle-section-info :inline :overlay-at (-> section-array 0)) + (section-bike-rear vehicle-section-info :inline :offset 560) + (section-car-front-left vehicle-section-info :inline :overlay-at (-> section-array 0)) + (section-car-rear-left vehicle-section-info :inline :overlay-at section-bike-rear) + (section-car-front-right vehicle-section-info :inline :offset 592) + (section-car-rear-right vehicle-section-info :inline :offset 624) + (explosion vehicle-explosion-info) + (engine-pitch-scale float) + (engine-pitch-offset float) + (engine-pitch-mod-amp float) + (engine-sound-select int8) + (engine-sound sound-name) + (thrust-sound sound-name) + (scrape-sound sound-name) + (glance-sound sound-name) + (impact-sound sound-name) + (extra-sound sound-name) + (explosion-part int32) + (headlight-count int8) + (taillight-count int8) + (thruster-flame-width meters) + (thruster-flame-length meters) + (thruster-local-pos vector 2 :inline) + (exhaust-local-pos vector 2 :inline) + (exhaust-local-dir vector 2 :inline) + (smoke-local-pos vector 2 :inline) + (smoke-local-vel vector 2 :inline) + (headlight-local-pos vector 3 :inline) + (taillight-local-pos vector 2 :inline) + (lift-thruster-count int8) + (roll-thruster-count int8) + (steering-thruster-count int8) + (stabilizer-count int8) + (inv-lift-thruster-count float) + (pad int8 8) + (lift-thruster-array vehicle-control-point 2 :inline) + (roll-thruster-array vehicle-control-point 2 :inline) + (steering-thruster-array vehicle-control-point 2 :inline) + (stabilizer-array vehicle-control-point 6 :inline) + (engine-thrust-local-pos vector :inline) + (brake-local-pos vector :inline) + (particle-system-2d basic) + (particle-system-3d basic) + (part-thruster basic) + (part-thruster-scale-x sp-field-init-spec) + (part-thruster-scale-y sp-field-init-spec) + (part-quat quaternion) + (part-vel vector) + (color-option-count int8) + (color-option-select int8) + (color-option-array (inline-array vector)) + (sample-dir vector :inline) + (sample-time time-frame) + (sample-index int32) ) - :method-count-assert 11 - :size-assert #x60c - :flag-assert #xb0000060c (:methods - (rigid-body-vehicle-constants-method-9 (_type_) none 9) - (rigid-body-vehicle-constants-method-10 () none 10) + (rigid-body-vehicle-constants-method-9 (_type_) none) + (rigid-body-vehicle-constants-method-10 (_type_) none) ) ) ;; definition for method 3 of type rigid-body-vehicle-constants ;; INFO: Used lq/sq -(defmethod inspect rigid-body-vehicle-constants ((this rigid-body-vehicle-constants)) +(defmethod inspect ((this rigid-body-vehicle-constants)) (when (not this) (set! this this) (goto cfg-4) @@ -432,45 +411,42 @@ ;; definition of type vehicle-controller (deftype vehicle-controller (structure) - ((flags vehicle-controller-flag :offset-assert 0) - (traffic traffic-engine :offset-assert 4) - (branch nav-branch :offset-assert 8) - (target-speed-offset meters :offset-assert 12) - (target-speed meters :offset-assert 16) - (choose-branch-callback (function vehicle-controller vehicle nav-branch) :offset-assert 20) - (turn-accel meters :offset-assert 24) - (max-turn-speed meters :offset-assert 28) - (path-prev-point vector :inline :offset-assert 32) - (turn-enter-point vector :inline :offset-assert 48) - (turn-exit-point vector :inline :offset-assert 64) - (path-dest-point vector :inline :offset 64) - (turn-enter-dir vector :inline :offset-assert 80) - (turn-exit-dir vector :inline :offset-assert 96) - (dest-circle vector :inline :offset-assert 112) - (target-point vector :inline :offset-assert 128) + ((flags vehicle-controller-flag) + (traffic traffic-engine) + (branch nav-branch) + (target-speed-offset meters) + (target-speed meters) + (choose-branch-callback (function vehicle-controller vehicle nav-branch)) + (turn-accel meters) + (max-turn-speed meters) + (path-prev-point vector :inline) + (turn-enter-point vector :inline) + (turn-exit-point vector :inline) + (path-dest-point vector :inline :overlay-at turn-exit-point) + (turn-enter-dir vector :inline) + (turn-exit-dir vector :inline) + (dest-circle vector :inline) + (target-point vector :inline) ) - :method-count-assert 22 - :size-assert #x90 - :flag-assert #x1600000090 (:methods - (vehicle-controller-method-9 (_type_) none 9) - (vehicle-controller-method-10 (_type_ traffic-tracker) none 10) - (vehicle-controller-method-11 (_type_) none 11) - (vehicle-controller-method-12 (_type_ rigid-body-vehicle-constants vector float int float) none :behavior vehicle 12) - (vehicle-controller-method-13 (_type_ nav-branch vector) none 13) - (vehicle-controller-method-14 (_type_ vehicle) nav-branch 14) - (vehicle-controller-method-15 (_type_) nav-branch 15) - (vehicle-controller-method-16 (_type_ vector vector) none 16) - (draw-debug-info (_type_) none 17) - (vehicle-controller-method-18 (_type_ vector vector vehicle float) none 18) - (vehicle-controller-method-19 (_type_ vector object vector vector) none 19) - (vehicle-controller-method-20 (_type_ object float) none 20) - (vehicle-controller-method-21 (_type_) none 21) + (vehicle-controller-method-9 (_type_) none) + (vehicle-controller-method-10 (_type_ traffic-tracker) none) + (vehicle-controller-method-11 (_type_) none) + (vehicle-controller-method-12 (_type_ rigid-body-vehicle-constants vector float int float) none :behavior vehicle) + (vehicle-controller-method-13 (_type_ nav-branch vector) none) + (vehicle-controller-method-14 (_type_ vehicle) nav-branch) + (vehicle-controller-method-15 (_type_) nav-branch) + (vehicle-controller-method-16 (_type_ vector vector) none) + (draw-debug-info (_type_) none) + (vehicle-controller-method-18 (_type_ vector vector vehicle float) none) + (vehicle-controller-method-19 (_type_ vector object vector vector) none) + (vehicle-controller-method-20 (_type_ object float) none) + (vehicle-controller-method-21 (_type_) none) ) ) ;; definition for method 3 of type vehicle-controller -(defmethod inspect vehicle-controller ((this vehicle-controller)) +(defmethod inspect ((this vehicle-controller)) (when (not this) (set! this this) (goto cfg-28) @@ -539,15 +515,12 @@ ;; definition of type vehicle-section (deftype vehicle-section (structure) - ((damage float :offset-assert 0) + ((damage float) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type vehicle-section -(defmethod inspect vehicle-section ((this vehicle-section)) +(defmethod inspect ((this vehicle-section)) (when (not this) (set! this this) (goto cfg-4) @@ -560,179 +533,177 @@ ;; definition of type vehicle (deftype vehicle (rigid-body-object) - ((self vehicle :override) - (info rigid-body-vehicle-constants :override) - (pad uint32 2 :offset-assert 272) - (vehicle-jkhn1b23jn1 int64 :offset-assert 280) - (controls vehicle-controls :inline :offset-assert 288) - (prev-controls vehicle-controls :inline :offset-assert 304) - (up-dir vector :inline :offset-assert 320) - (jump-time float :offset-assert 336) - (jump-thrust float :offset-assert 340) - (engine-thrust float :offset-assert 344) - (engine-power-factor float :offset-assert 348) - (force-scale float :offset-assert 352) - (target-distance2 meters :offset-assert 356) - (pad0 uint32 :offset-assert 360) - (target-acceleration vector :inline :offset-assert 368) - (impact-pos vector :inline :offset-assert 384) - (lin-acceleration vector :inline :offset-assert 400) - (hit-points float :offset-assert 416) - (damage-factor float :offset-assert 420) - (crash-level int8 :offset-assert 424) - (force-level int8 :offset-assert 425) - (traffic-hash-id int8 :offset-assert 426) - (traffic-priority-id int8 :offset-assert 427) - (power-fluctuation-factor float :offset-assert 428) - (power-level float :offset-assert 432) - (flight-level-index int8 :offset-assert 436) - (flight-level-index-prev int8 :offset-assert 437) - (overlap-player-counter uint8 :offset-assert 438) - (physics-counter uint8 :offset-assert 439) - (flight-level float :offset-assert 440) - (brake-factor float :offset-assert 444) - (cam-speed-interp float :offset-assert 448) - (camera-dist2 float :offset-assert 452) - (player-dist2 float :offset-assert 456) - (bound-radius float :offset-assert 460) - (rider-array handle 4 :offset-assert 464) - (lift-thrust float 2 :offset-assert 496) - (roll-thrust float 2 :offset-assert 504) - (sent-attack-time time-frame :offset-assert 512) - (air-time time-frame :offset-assert 520) - (turn-time time-frame :offset-assert 528) - (crash-time time-frame :offset-assert 536) - (transition-time time-frame :offset-assert 544) - (transition-end-time time-frame :offset-assert 552) - (turbo-boost-time time-frame :offset-assert 560) - (crash-duration uint16 :offset-assert 568) - (turbo-boost-duration uint16 :offset-assert 570) - (turbo-boost-factor float :offset-assert 572) - (crash-impulse float :offset-assert 576) - (water-height float :offset-assert 580) - (lights-factor float :offset-assert 584) - (outgoing-attack-id uint32 :offset-assert 588) - (scrape-sound-id sound-id :offset-assert 592) - (engine-sound-id sound-id :offset-assert 596) - (thrust-sound-id sound-id :offset-assert 600) - (roll-sound-id sound-id :offset-assert 604) - (damage-pop-sound-id sound-id :offset-assert 608) - (damage-zap-sound-id sound-id :offset-assert 612) - (extra-sound-id sound-id :offset-assert 616) - (fog-fade float :offset-assert 620) - (scrape-sound-envelope float :offset-assert 624) - (engine-sound-envelope float :offset-assert 628) - (engine-sound-factor float :offset-assert 632) - (sputter-sound-envelope float :offset-assert 636) - (rudder-sound-envelope float :offset-assert 640) - (fins-sound-envelope float :offset-assert 644) - (exhaust-part-accum basic 2 :offset-assert 648) - (smoke-part-accum basic 2 :offset-assert 656) - (controller vehicle-controller :inline :offset-assert 672) - (section-array vehicle-section 4 :inline :offset-assert 816) + ((self vehicle :override) + (info rigid-body-vehicle-constants :override) + (pad uint32 2) + (vehicle-jkhn1b23jn1 int64) + (controls vehicle-controls :inline) + (prev-controls vehicle-controls :inline) + (up-dir vector :inline) + (jump-time float) + (jump-thrust float) + (engine-thrust float) + (engine-power-factor float) + (force-scale float) + (target-distance2 meters) + (pad0 uint32) + (target-acceleration vector :inline) + (impact-pos vector :inline) + (lin-acceleration vector :inline) + (hit-points float) + (damage-factor float) + (crash-level int8) + (force-level int8) + (traffic-hash-id int8) + (traffic-priority-id int8) + (power-fluctuation-factor float) + (power-level float) + (flight-level-index int8) + (flight-level-index-prev int8) + (overlap-player-counter uint8) + (physics-counter uint8) + (flight-level float) + (brake-factor float) + (cam-speed-interp float) + (camera-dist2 float) + (player-dist2 float) + (bound-radius float) + (rider-array handle 4) + (lift-thrust float 2) + (roll-thrust float 2) + (sent-attack-time time-frame) + (air-time time-frame) + (turn-time time-frame) + (crash-time time-frame) + (transition-time time-frame) + (transition-end-time time-frame) + (turbo-boost-time time-frame) + (crash-duration uint16) + (turbo-boost-duration uint16) + (turbo-boost-factor float) + (crash-impulse float) + (water-height float) + (lights-factor float) + (outgoing-attack-id uint32) + (scrape-sound-id sound-id) + (engine-sound-id sound-id) + (thrust-sound-id sound-id) + (roll-sound-id sound-id) + (damage-pop-sound-id sound-id) + (damage-zap-sound-id sound-id) + (extra-sound-id sound-id) + (fog-fade float) + (scrape-sound-envelope float) + (engine-sound-envelope float) + (engine-sound-factor float) + (sputter-sound-envelope float) + (rudder-sound-envelope float) + (fins-sound-envelope float) + (exhaust-part-accum basic 2) + (smoke-part-accum basic 2) + (controller vehicle-controller :inline) + (section-array vehicle-section 4 :inline) ) - :heap-base #x2f0 - :method-count-assert 144 - :size-assert #x370 - :flag-assert #x9002f00370 + (:state-methods + inactive + waiting + vehicle-state-55 + vehicle-state-56 + player-control + crash + explode + die + measure-control-parameters + ) (:methods - (alloc-and-init-rigid-body-control (_type_ rigid-body-vehicle-constants) none :replace 31) - (inactive () _type_ :state 53) - (waiting () _type_ :state 54) - (vehicle-method-55 () _type_ :state 55) - (vehicle-method-56 () _type_ :state 56) - (player-control () _type_ :state 57) - (crash () _type_ :state 58) - (explode () _type_ :state 59) - (die () _type_ :state 60) - (measure-control-parameters () _type_ :state 61) - (vehicle-method-62 (_type_ float) none 62) - (vehicle-method-63 (_type_ float) none 63) - (vehicle-method-64 () none 64) - (start-jump (_type_) none 65) - (vehicle-method-66 (_type_) none 66) - (get-seat-count (_type_) int 67) - (compute-seat-position (_type_ vector int) none 68) - (get-rider-in-seat (_type_ int) process 69) - (vehicle-method-70 (_type_) process 70) - (put-rider-in-seat (_type_ int process-focusable) none 71) - (vehicle-method-72 (_type_) uint 72) - (get-best-seat-for-vehicle (_type_ vector int int) int 73) - (remove-rider (_type_ process) none 74) - (vehicle-method-75 (_type_) float 75) - (vehicle-method-76 (_type_ int uint) none 76) - (vehicle-method-77 (_type_) none 77) - (vehicle-method-78 (_type_ int) none 78) - (vehicle-method-79 (_type_) none 79) - (vehicle-method-80 (_type_) none 80) - (vehicle-method-81 (_type_) none 81) - (vehicle-method-82 (_type_) none 82) - (vehicle-method-83 (_type_) none 83) - (draw-thruster (_type_ vector vector float float) none 84) - (draw-thrusters (_type_) none 85) - (update-joint-mods (_type_) none 86) - (vehicle-method-87 (_type_) none 87) - (vehicle-method-88 (_type_) none 88) - (vehicle-method-89 (_type_) none 89) - (vehicle-method-90 (_type_) none 90) - (vehicle-method-91 (_type_) none 91) - (vehicle-method-92 (_type_) none 92) - (vehicle-method-93 (_type_) none 93) - (vehicle-method-94 (_type_) none 94) - (vehicle-method-95 (_type_ vector) none 95) - (vehicle-method-96 (_type_) none 96) - (vehicle-method-97 (_type_) none 97) - (vehicle-method-98 (_type_ float) none 98) - (vehicle-method-99 (_type_ float) none 99) - (vehicle-method-100 (_type_ float vehicle-physics-work) none 100) - (vehicle-method-101 (_type_) none 101) - (vehicle-method-102 (_type_) none 102) - (vehicle-method-103 (_type_) none 103) - (vehicle-method-104 (_type_) none 104) - (vehicle-method-105 (_type_) symbol 105) - (vehicle-method-106 (_type_) none 106) - (vehicle-method-107 (_type_) none 107) - (vehicle-method-108 (_type_) none 108) - (vehicle-method-109 (_type_) none 109) - (vehicle-method-110 (_type_) none 110) - (vehicle-method-111 (_type_ object target) none 111) - (decrease-traffic-alert-level (_type_ int) int 112) - (vehicle-method-113 (_type_) none 113) - (vehicle-method-114 (_type_) none 114) - (vehicle-method-115 (_type_ vector) none 115) - (vehicle-method-116 (_type_ (pointer vehicle-controls)) none 116) - (vehicle-method-117 (_type_ vector int int) none 117) - (vehicle-method-118 (_type_ int) none 118) - (vehicle-method-119 (_type_) none 119) - (vehicle-method-120 (_type_) none 120) - (vehicle-method-121 (_type_) none 121) - (vehicle-method-122 (_type_) none 122) - (vehicle-method-123 (_type_) none 123) - (vehicle-method-124 (_type_) none 124) - (vehicle-method-125 (_type_ float) none 125) - (vehicle-method-126 (_type_ float) none 126) - (vehicle-method-127 (_type_) none 127) - (vehicle-method-128 (_type_) none 128) - (vehicle-method-129 (_type_) none 129) - (vehicle-method-130 (_type_ traffic-object-spawn-params) none 130) - (vehicle-method-131 (_type_) none 131) - (vehicle-method-132 (_type_) none 132) - (check-player-get-on (_type_) none 133) - (vehicle-method-134 (_type_ process) none 134) - (vehicle-method-135 (_type_ traffic-object-spawn-params) none 135) - (vehicle-method-136 (_type_ traffic-object-spawn-params) none 136) - (vehicle-method-137 (_type_ traffic-object-spawn-params) none 137) - (vehicle-method-138 (_type_) none 138) - (vehicle-method-139 (_type_) none 139) - (vehicle-method-140 (_type_) none 140) - (vehicle-method-141 (_type_) none 141) - (vehicle-method-142 (_type_) none 142) - (vehicle-method-143 (_type_) none 143) + (alloc-and-init-rigid-body-control (_type_ rigid-body-vehicle-constants) none :replace) + (vehicle-method-62 (_type_ float) none) + (vehicle-method-63 (_type_ float) none) + (vehicle-method-64 () none) + (start-jump (_type_) none) + (vehicle-method-66 (_type_) none) + (get-seat-count (_type_) int) + (compute-seat-position (_type_ vector int) none) + (get-rider-in-seat (_type_ int) process) + (vehicle-method-70 (_type_) process) + (put-rider-in-seat (_type_ int process-focusable) none) + (vehicle-method-72 (_type_) uint) + (get-best-seat-for-vehicle (_type_ vector int int) int) + (remove-rider (_type_ process) none) + (vehicle-method-75 (_type_) float) + (vehicle-method-76 (_type_ int uint) none) + (vehicle-method-77 (_type_) none) + (vehicle-method-78 (_type_ int) none) + (vehicle-method-79 (_type_) none) + (vehicle-method-80 (_type_) none) + (vehicle-method-81 (_type_) none) + (vehicle-method-82 (_type_) none) + (vehicle-method-83 (_type_) none) + (draw-thruster (_type_ vector vector float float) none) + (draw-thrusters (_type_) none) + (update-joint-mods (_type_) none) + (vehicle-method-87 (_type_) none) + (vehicle-method-88 (_type_) none) + (vehicle-method-89 (_type_) none) + (vehicle-method-90 (_type_) none) + (vehicle-method-91 (_type_) none) + (vehicle-method-92 (_type_) none) + (vehicle-method-93 (_type_) none) + (vehicle-method-94 (_type_) none) + (vehicle-method-95 (_type_ vector) none) + (vehicle-method-96 (_type_) none) + (vehicle-method-97 (_type_) none) + (vehicle-method-98 (_type_ float) none) + (vehicle-method-99 (_type_ float) none) + (vehicle-method-100 (_type_ float vehicle-physics-work) none) + (vehicle-method-101 (_type_) none) + (vehicle-method-102 (_type_) none) + (vehicle-method-103 (_type_) none) + (vehicle-method-104 (_type_) none) + (vehicle-method-105 (_type_) symbol) + (vehicle-method-106 (_type_) none) + (vehicle-method-107 (_type_) none) + (vehicle-method-108 (_type_) none) + (vehicle-method-109 (_type_) none) + (vehicle-method-110 (_type_) none) + (vehicle-method-111 (_type_ object target) none) + (decrease-traffic-alert-level (_type_ int) int) + (vehicle-method-113 (_type_) none) + (vehicle-method-114 (_type_) none) + (vehicle-method-115 (_type_ vector) none) + (vehicle-method-116 (_type_ (pointer vehicle-controls)) none) + (vehicle-method-117 (_type_ vector int int) none) + (vehicle-method-118 (_type_ int) none) + (vehicle-method-119 (_type_) none) + (vehicle-method-120 (_type_) none) + (vehicle-method-121 (_type_) none) + (vehicle-method-122 (_type_) none) + (vehicle-method-123 (_type_) none) + (vehicle-method-124 (_type_) none) + (vehicle-method-125 (_type_ float) none) + (vehicle-method-126 (_type_ float) none) + (vehicle-method-127 (_type_) none) + (vehicle-method-128 (_type_) none) + (vehicle-method-129 (_type_) none) + (vehicle-method-130 (_type_ traffic-object-spawn-params) none) + (vehicle-method-131 (_type_) none) + (vehicle-method-132 (_type_) none) + (check-player-get-on (_type_) none) + (vehicle-method-134 (_type_ process) none) + (vehicle-method-135 (_type_ traffic-object-spawn-params) none) + (vehicle-method-136 (_type_ traffic-object-spawn-params) none) + (vehicle-method-137 (_type_ traffic-object-spawn-params) none) + (vehicle-method-138 (_type_) none) + (vehicle-method-139 (_type_) none) + (vehicle-method-140 (_type_) none) + (vehicle-method-141 (_type_) none) + (vehicle-method-142 (_type_) none) + (vehicle-method-143 (_type_) none) ) ) ;; definition for method 3 of type vehicle -(defmethod inspect vehicle ((this vehicle)) +(defmethod inspect ((this vehicle)) (when (not this) (set! this this) (goto cfg-92) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-physics_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-physics_REF.gc index 739142f89ee..14cf49cf222 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-physics_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-physics_REF.gc @@ -4,7 +4,7 @@ ;; definition for method 99 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-99 vehicle ((this vehicle) (arg0 float)) +(defmethod vehicle-method-99 ((this vehicle) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'vehicle-grab-rail-info)) (s3-0 (-> this root root-prim)) (s2-0 1) @@ -81,24 +81,21 @@ ;; definition of type vehicle-probe-work (deftype vehicle-probe-work (structure) - ((local-pos vector :inline :offset-assert 0) - (local-normal vector :inline :offset-assert 16) - (world-pos vector :inline :offset-assert 32) - (world-normal vector :inline :offset-assert 48) - (probe-pos vector :inline :offset-assert 64) - (ground-pos vector :inline :offset-assert 80) - (ground-normal vector :inline :offset-assert 96) - (velocity vector :inline :offset-assert 112) - (tire-force vector :inline :offset-assert 128) - (wheel-axis vector :inline :offset-assert 144) + ((local-pos vector :inline) + (local-normal vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (probe-pos vector :inline) + (ground-pos vector :inline) + (ground-normal vector :inline) + (velocity vector :inline) + (tire-force vector :inline) + (wheel-axis vector :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type vehicle-probe-work -(defmethod inspect vehicle-probe-work ((this vehicle-probe-work)) +(defmethod inspect ((this vehicle-probe-work)) (when (not this) (set! this this) (goto cfg-4) @@ -120,33 +117,30 @@ ;; definition of type vehicle-physics-work (deftype vehicle-physics-work (structure) - ((mat matrix :inline :offset-assert 0) - (force vector :inline :offset-assert 64) - (velocity vector :inline :offset-assert 80) - (world-pos vector :inline :offset-assert 96) - (world-normal vector :inline :offset-assert 112) - (local-pos vector :inline :offset-assert 128) - (steering-axis vector :inline :offset-assert 144) - (lift-dir vector :inline :offset-assert 160) - (normal vector :inline :offset-assert 176) - (tmp vector :inline :offset-assert 192) - (p-body vector :inline :offset-assert 208) - (axis vector :inline :offset-assert 224) - (dir vector :inline :offset-assert 240) - (ground-normal vector :inline :offset-assert 256) - (impulse float :offset-assert 272) - (vel-dot-norm float :offset-assert 276) - (friction-coef float :offset-assert 280) - (speed-factor float :offset-assert 284) - (probe-work-array vehicle-probe-work 2 :inline :offset-assert 288) + ((mat matrix :inline) + (force vector :inline) + (velocity vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (local-pos vector :inline) + (steering-axis vector :inline) + (lift-dir vector :inline) + (normal vector :inline) + (tmp vector :inline) + (p-body vector :inline) + (axis vector :inline) + (dir vector :inline) + (ground-normal vector :inline) + (impulse float) + (vel-dot-norm float) + (friction-coef float) + (speed-factor float) + (probe-work-array vehicle-probe-work 2 :inline) ) - :method-count-assert 9 - :size-assert #x260 - :flag-assert #x900000260 ) ;; definition for method 3 of type vehicle-physics-work -(defmethod inspect vehicle-physics-work ((this vehicle-physics-work)) +(defmethod inspect ((this vehicle-physics-work)) (when (not this) (set! this this) (goto cfg-4) @@ -178,7 +172,7 @@ ;; definition for method 100 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-100 vehicle ((this vehicle) (arg0 float) (arg1 vehicle-physics-work)) +(defmethod vehicle-method-100 ((this vehicle) (arg0 float) (arg1 vehicle-physics-work)) (local-vars (v1-81 float) (v1-184 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -542,7 +536,7 @@ ;; WARN: Stack slot offset 724 signed mismatch ;; WARN: Stack slot offset 720 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 vehicle ((this vehicle) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this vehicle) (arg0 float)) (local-vars (sv-624 float) (sv-720 float) (sv-724 float)) (rlet ((vf0 :class vf)) (init-vf0-vector) @@ -873,13 +867,13 @@ ) ;; definition for method 125 of type vehicle -(defmethod vehicle-method-125 vehicle ((this vehicle) (arg0 float)) +(defmethod vehicle-method-125 ((this vehicle) (arg0 float)) (rigid-body-object-method-29 this arg0) (none) ) ;; definition for method 126 of type vehicle -(defmethod vehicle-method-126 vehicle ((this vehicle) (arg0 float)) +(defmethod vehicle-method-126 ((this vehicle) (arg0 float)) (rigid-body-object-method-29 this arg0) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-rider_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-rider_REF.gc index 3aa0e5de6a2..88c0ae1ec5e 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-rider_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-rider_REF.gc @@ -3,32 +3,30 @@ ;; definition of type vehicle-rider (deftype vehicle-rider (process-focusable) - ((parent (pointer vehicle) :override) - (flags uint8 :offset-assert 204) - (riding-anim int32 :offset-assert 208) - (anim-t float :offset-assert 212) - (anim-speed float :offset-assert 216) - (seat-index int8 :offset-assert 220) + ((parent (pointer vehicle) :override) + (flags uint8) + (riding-anim int32) + (anim-t float) + (anim-speed float) + (seat-index int8) ) - :heap-base #x60 - :method-count-assert 36 - :size-assert #xdd - :flag-assert #x24006000dd + (:state-methods + inactive + active + taunt + got-passed + ) (:methods - (inactive () _type_ :state 27) - (active () _type_ :state 28) - (taunt () _type_ :state 29) - (got-passed () _type_ :state 30) - (initialize-collision (_type_) none 31) - (vehicle-rider-method-32 (_type_ traffic-object-spawn-params) none 32) - (vehicle-rider-method-33 (_type_) none 33) - (vehicle-rider-method-34 (_type_) none 34) - (vehicle-rider-method-35 (_type_) none 35) + (initialize-collision (_type_) none) + (vehicle-rider-method-32 (_type_ traffic-object-spawn-params) none) + (vehicle-rider-method-33 (_type_) none) + (vehicle-rider-method-34 (_type_) none) + (vehicle-rider-method-35 (_type_) none) ) ) ;; definition for method 3 of type vehicle-rider -(defmethod inspect vehicle-rider ((this vehicle-rider)) +(defmethod inspect ((this vehicle-rider)) (when (not this) (set! this this) (goto cfg-4) @@ -46,14 +44,14 @@ ) ;; definition for method 20 of type vehicle-rider -(defmethod get-trans vehicle-rider ((this vehicle-rider) (arg0 int)) +(defmethod get-trans ((this vehicle-rider) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (-> this root trans) ) ;; definition for method 33 of type vehicle-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-33 vehicle-rider ((this vehicle-rider)) +(defmethod vehicle-rider-method-33 ((this vehicle-rider)) (let* ((s4-0 (ppointer->process (-> this parent))) (s5-0 (if (type? s4-0 vehicle) s4-0 @@ -73,7 +71,7 @@ ;; definition for method 35 of type vehicle-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-35 vehicle-rider ((this vehicle-rider)) +(defmethod vehicle-rider-method-35 ((this vehicle-rider)) (logior! (-> this draw status) (draw-control-status no-draw)) (put-rider-in-seat (the-as vehicle (ppointer->process (-> this parent))) @@ -87,7 +85,7 @@ ;; definition for method 31 of type vehicle-rider ;; WARN: Return type mismatch int vs none. -(defmethod initialize-collision vehicle-rider ((this vehicle-rider)) +(defmethod initialize-collision ((this vehicle-rider)) (stack-size-set! (-> this main-thread) 16) (lwide-entity-hack) (when (not (-> this entity)) @@ -102,7 +100,7 @@ ;; definition for method 32 of type vehicle-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-32 vehicle-rider ((this vehicle-rider) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 ((this vehicle-rider) (arg0 traffic-object-spawn-params)) (logior! (-> this flags) 1) (set! (-> this draw lod-set lod 0 dist) 40960.0) (set! (-> this draw lod-set lod 1 dist) 122880.0) @@ -117,7 +115,7 @@ ;; definition for method 34 of type vehicle-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-34 vehicle-rider ((this vehicle-rider)) +(defmethod vehicle-rider-method-34 ((this vehicle-rider)) (let ((a0-1 (ppointer->process (-> this parent)))) (when a0-1 (+! (-> this anim-t) (* 41870.223 (-> this anim-speed) (seconds-per-frame))) @@ -260,7 +258,7 @@ ;; definition for method 11 of type vehicle-rider ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! vehicle-rider ((this vehicle-rider) (arg0 entity-actor)) +(defmethod init-from-entity! ((this vehicle-rider) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -316,14 +314,10 @@ This commonly includes things such as: ;; definition of type citizen-norm-rider (deftype citizen-norm-rider (vehicle-rider) () - :heap-base #x60 - :method-count-assert 36 - :size-assert #xdd - :flag-assert #x24006000dd ) ;; definition for method 3 of type citizen-norm-rider -(defmethod inspect citizen-norm-rider ((this citizen-norm-rider)) +(defmethod inspect ((this citizen-norm-rider)) (when (not this) (set! this this) (goto cfg-4) @@ -343,7 +337,7 @@ This commonly includes things such as: ;; definition for method 33 of type citizen-norm-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-33 citizen-norm-rider ((this citizen-norm-rider)) +(defmethod vehicle-rider-method-33 ((this citizen-norm-rider)) (call-parent-method this) (setup-masks (-> this draw) 0 -1) (setup-masks (-> this draw) 32 0) @@ -416,7 +410,7 @@ This commonly includes things such as: ;; definition for method 32 of type citizen-norm-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-32 citizen-norm-rider ((this citizen-norm-rider) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 ((this citizen-norm-rider) (arg0 traffic-object-spawn-params)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-norm-rider" (the-as (pointer uint32) #f))) @@ -433,14 +427,10 @@ This commonly includes things such as: ;; definition of type crimson-guard-rider (deftype crimson-guard-rider (vehicle-rider) () - :heap-base #x60 - :method-count-assert 36 - :size-assert #xdd - :flag-assert #x24006000dd ) ;; definition for method 3 of type crimson-guard-rider -(defmethod inspect crimson-guard-rider ((this crimson-guard-rider)) +(defmethod inspect ((this crimson-guard-rider)) (when (not this) (set! this this) (goto cfg-4) @@ -460,7 +450,7 @@ This commonly includes things such as: ;; definition for method 33 of type crimson-guard-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-33 crimson-guard-rider ((this crimson-guard-rider)) +(defmethod vehicle-rider-method-33 ((this crimson-guard-rider)) (call-parent-method this) (setup-masks (-> this draw) 0 28) (setup-masks (-> this draw) 3 0) @@ -474,7 +464,7 @@ This commonly includes things such as: ;; definition for method 32 of type crimson-guard-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-32 crimson-guard-rider ((this crimson-guard-rider) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 ((this crimson-guard-rider) (arg0 traffic-object-spawn-params)) (initialize-skeleton this (the-as diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc index f2da4eb1ec2..6b3dd234878 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type rigid-body-vehicle-constants ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-vehicle-constants-method-9 rigid-body-vehicle-constants ((this rigid-body-vehicle-constants)) +(defmethod rigid-body-vehicle-constants-method-9 ((this rigid-body-vehicle-constants)) (set! (-> this particle-system-2d) *sp-particle-system-2d*) (set! (-> this particle-system-3d) *sp-particle-system-3d*) (set! (-> this part-quat) *particle-quat*) @@ -17,25 +17,22 @@ ;; definition for method 10 of type rigid-body-vehicle-constants ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-vehicle-constants-method-10 rigid-body-vehicle-constants () +(defmethod rigid-body-vehicle-constants-method-10 ((this rigid-body-vehicle-constants)) 0 (none) ) ;; definition of type vehicle-hud-request (deftype vehicle-hud-request (structure) - ((handle handle :offset-assert 0) - (hack-handle-init basic :offset 0) - (priority float :offset-assert 8) + ((handle handle) + (hack-handle-init basic :overlay-at handle) + (priority float) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type vehicle-hud-request -(defmethod inspect vehicle-hud-request ((this vehicle-hud-request)) +(defmethod inspect ((this vehicle-hud-request)) (when (not this) (set! this this) (goto cfg-4) @@ -50,22 +47,19 @@ ;; definition of type vehicle-hud-requests (deftype vehicle-hud-requests (structure) - ((time time-frame :offset-assert 0) - (requests vehicle-hud-request 4 :inline :offset-assert 8) + ((time time-frame) + (requests vehicle-hud-request 4 :inline) ) :pack-me - :method-count-assert 12 - :size-assert #x48 - :flag-assert #xc00000048 (:methods - (vehicle-hud-requests-method-9 (_type_) none 9) - (vehicle-hud-requests-method-10 (_type_) vehicle-hud-request 10) - (vehicle-hud-requests-method-11 (_type_) vehicle-hud-request 11) + (vehicle-hud-requests-method-9 (_type_) none) + (vehicle-hud-requests-method-10 (_type_) vehicle-hud-request) + (vehicle-hud-requests-method-11 (_type_) vehicle-hud-request) ) ) ;; definition for method 3 of type vehicle-hud-requests -(defmethod inspect vehicle-hud-requests ((this vehicle-hud-requests)) +(defmethod inspect ((this vehicle-hud-requests)) (when (not this) (set! this this) (goto cfg-4) @@ -79,7 +73,7 @@ ;; definition for method 9 of type vehicle-hud-requests ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-hud-requests-method-9 vehicle-hud-requests ((this vehicle-hud-requests)) +(defmethod vehicle-hud-requests-method-9 ((this vehicle-hud-requests)) (dotimes (v1-0 4) (let ((a1-2 (-> this requests v1-0))) (set! (-> a1-2 handle) (the-as handle #f)) @@ -91,7 +85,7 @@ ) ;; definition for method 10 of type vehicle-hud-requests -(defmethod vehicle-hud-requests-method-10 vehicle-hud-requests ((this vehicle-hud-requests)) +(defmethod vehicle-hud-requests-method-10 ((this vehicle-hud-requests)) (let ((v1-0 0)) (let ((f0-0 0.0)) (countdown (a1-0 4) @@ -108,7 +102,7 @@ ) ;; definition for method 11 of type vehicle-hud-requests -(defmethod vehicle-hud-requests-method-11 vehicle-hud-requests ((this vehicle-hud-requests)) +(defmethod vehicle-hud-requests-method-11 ((this vehicle-hud-requests)) (let ((v1-0 0)) (let ((f0-0 (the-as float #x7f800000)) (a1-1 4) @@ -137,19 +131,16 @@ ;; definition of type vehicle-hud-chooser (deftype vehicle-hud-chooser (structure) - ((cur vehicle-hud-requests :inline :offset-assert 0) - (last vehicle-hud-requests :inline :offset-assert 72) + ((cur vehicle-hud-requests :inline) + (last vehicle-hud-requests :inline) ) - :method-count-assert 10 - :size-assert #x90 - :flag-assert #xa00000090 (:methods - (vehicle-hud-chooser-method-9 (_type_ handle float) symbol 9) + (vehicle-hud-chooser-method-9 (_type_ handle float) symbol) ) ) ;; definition for method 3 of type vehicle-hud-chooser -(defmethod inspect vehicle-hud-chooser ((this vehicle-hud-chooser)) +(defmethod inspect ((this vehicle-hud-chooser)) (when (not this) (set! this this) (goto cfg-4) @@ -162,7 +153,7 @@ ) ;; definition for method 9 of type vehicle-hud-chooser -(defmethod vehicle-hud-chooser-method-9 vehicle-hud-chooser ((this vehicle-hud-chooser) (arg0 handle) (arg1 float)) +(defmethod vehicle-hud-chooser-method-9 ((this vehicle-hud-chooser) (arg0 handle) (arg1 float)) (let ((s3-0 (current-time))) (when (!= s3-0 (-> this cur time)) (if (zero? (-> this cur time)) @@ -196,7 +187,7 @@ (define *pilot-edge-grab-info* (new 'static 'pilot-edge-grab-info)) ;; definition for method 10 of type vehicle -(defmethod deactivate vehicle ((this vehicle)) +(defmethod deactivate ((this vehicle)) (vehicle-method-110 this) (call-parent-method this) (none) @@ -204,7 +195,7 @@ ;; definition for method 11 of type vehicle ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! vehicle ((this vehicle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this vehicle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -216,7 +207,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type vehicle -(defmethod rigid-body-object-method-35 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-35 ((this vehicle)) (let ((t9-0 (method-of-type rigid-body-object rigid-body-object-method-35))) (t9-0 this) ) @@ -235,7 +226,7 @@ This commonly includes things such as: ;; definition for method 133 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod check-player-get-on vehicle ((this vehicle)) +(defmethod check-player-get-on ((this vehicle)) (with-pp (let ((f0-0 (-> this player-dist2)) (f1-0 102400.0) @@ -450,7 +441,7 @@ This commonly includes things such as: ;; definition for method 110 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-110 vehicle ((this vehicle)) +(defmethod vehicle-method-110 ((this vehicle)) (sound-stop (-> this scrape-sound-id)) (sound-stop (-> this engine-sound-id)) (sound-stop (-> this thrust-sound-id)) @@ -462,7 +453,7 @@ This commonly includes things such as: ;; definition for method 62 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-62 vehicle ((this vehicle) (arg0 float)) +(defmethod vehicle-method-62 ((this vehicle) (arg0 float)) (if (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> this flags))) (set! (-> this controls steering) (fmax -1.0 (fmin 1.0 arg0))) ) @@ -472,7 +463,7 @@ This commonly includes things such as: ;; definition for method 63 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-63 vehicle ((this vehicle) (arg0 float)) +(defmethod vehicle-method-63 ((this vehicle) (arg0 float)) (if (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> this flags))) (set! (-> this controls throttle) (fmax -0.5 (fmin 1.0 arg0))) ) @@ -482,7 +473,7 @@ This commonly includes things such as: ;; definition for method 98 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-98 vehicle ((this vehicle) (arg0 float)) +(defmethod vehicle-method-98 ((this vehicle) (arg0 float)) (let* ((v1-1 (-> this rbody state lin-velocity)) (f0-4 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) (f0-6 (/ (- arg0 f0-4) arg0)) @@ -496,7 +487,7 @@ This commonly includes things such as: ;; definition for method 65 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod start-jump vehicle ((this vehicle)) +(defmethod start-jump ((this vehicle)) (when (logtest? (-> this info flags) 16) (when (not (logtest? (rigid-body-object-flag jump-sound) (-> this flags))) (logior! (-> this flags) (rigid-body-object-flag jump-sound)) @@ -510,20 +501,20 @@ This commonly includes things such as: ;; definition for method 66 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-66 vehicle ((this vehicle)) +(defmethod vehicle-method-66 ((this vehicle)) 0 (none) ) ;; definition for method 67 of type vehicle -(defmethod get-seat-count vehicle ((this vehicle)) +(defmethod get-seat-count ((this vehicle)) (-> this info seat-count) ) ;; definition for method 68 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod compute-seat-position vehicle ((this vehicle) (arg0 vector) (arg1 int)) +(defmethod compute-seat-position ((this vehicle) (arg0 vector) (arg1 int)) (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> this info seat-array arg1 position quad)) (set! (-> v1-0 w) 1.0) @@ -534,7 +525,7 @@ This commonly includes things such as: ) ;; definition for method 69 of type vehicle -(defmethod get-rider-in-seat vehicle ((this vehicle) (arg0 int)) +(defmethod get-rider-in-seat ((this vehicle) (arg0 int)) (let ((v0-0 (the-as process #f))) (if (< arg0 (-> this info seat-count)) (set! v0-0 (handle->process (-> this rider-array arg0))) @@ -544,7 +535,7 @@ This commonly includes things such as: ) ;; definition for method 70 of type vehicle -(defmethod vehicle-method-70 vehicle ((this vehicle)) +(defmethod vehicle-method-70 ((this vehicle)) (let ((gp-0 (the-as process #f))) (countdown (s4-0 (-> this info seat-count)) (when (logtest? (-> this info seat-array s4-0 flags) 1) @@ -560,7 +551,7 @@ This commonly includes things such as: ) ;; definition for method 73 of type vehicle -(defmethod get-best-seat-for-vehicle vehicle ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod get-best-seat-for-vehicle ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) (let ((gp-0 -1)) (let ((f30-0 (the-as float #x7f800000)) (s1-0 (new 'stack-no-clear 'vector)) @@ -600,7 +591,7 @@ This commonly includes things such as: ;; definition for method 74 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod remove-rider vehicle ((this vehicle) (arg0 process)) +(defmethod remove-rider ((this vehicle) (arg0 process)) (let ((v1-1 (-> this info seat-count))) (dotimes (a2-0 v1-1) (if (= arg0 (handle->process (-> this rider-array a2-0))) @@ -614,7 +605,7 @@ This commonly includes things such as: ;; definition for method 71 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod put-rider-in-seat vehicle ((this vehicle) (arg0 int) (arg1 process-focusable)) +(defmethod put-rider-in-seat ((this vehicle) (arg0 int) (arg1 process-focusable)) (if (< arg0 (-> this info seat-count)) (set! (-> this rider-array arg0) (process->handle arg1)) ) @@ -624,7 +615,7 @@ This commonly includes things such as: ;; definition for method 117 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-117 vehicle ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector+! v1-0 (-> this info seat-array arg1 position) (-> this info rider-hand-offset arg2)) (vector-matrix*! arg0 v1-0 (-> this node-list data 0 bone transform)) @@ -634,19 +625,19 @@ This commonly includes things such as: ) ;; definition for method 72 of type vehicle -(defmethod vehicle-method-72 vehicle ((this vehicle)) +(defmethod vehicle-method-72 ((this vehicle)) (-> this info rider-stance) ) ;; definition for method 75 of type vehicle -(defmethod vehicle-method-75 vehicle ((this vehicle)) +(defmethod vehicle-method-75 ((this vehicle)) (-> this controls steering) ) ;; definition for method 115 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-115 vehicle ((this vehicle) (arg0 vector)) +(defmethod vehicle-method-115 ((this vehicle) (arg0 vector)) (set! (-> arg0 quad) (-> this lin-acceleration quad)) 0 (none) @@ -654,7 +645,7 @@ This commonly includes things such as: ;; definition for method 116 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-116 vehicle ((this vehicle) (arg0 (pointer vehicle-controls))) +(defmethod vehicle-method-116 ((this vehicle) (arg0 (pointer vehicle-controls))) (mem-copy! arg0 (the-as pointer (-> this controls)) 16) 0 (none) @@ -662,7 +653,7 @@ This commonly includes things such as: ;; definition for method 44 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod apply-damage vehicle ((this vehicle) (arg0 float) (arg1 rigid-body-impact)) +(defmethod apply-damage ((this vehicle) (arg0 float) (arg1 rigid-body-impact)) (cond (#f ) @@ -696,7 +687,7 @@ This commonly includes things such as: ;; definition for method 118 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-118 vehicle ((this vehicle) (arg0 int)) +(defmethod vehicle-method-118 ((this vehicle) (arg0 int)) (let* ((v1-2 (-> this section-array arg0)) (s4-0 (-> this info section-array arg0)) (s5-1 @@ -732,7 +723,7 @@ This commonly includes things such as: ;; definition for method 82 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-82 vehicle ((this vehicle)) +(defmethod vehicle-method-82 ((this vehicle)) (set! (-> this flags) (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag disturbed damaged @@ -800,7 +791,7 @@ This commonly includes things such as: ;; definition for method 101 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-101 vehicle ((this vehicle)) +(defmethod vehicle-method-101 ((this vehicle)) (set! (-> this hit-points) 1.0) 0 (none) @@ -808,7 +799,7 @@ This commonly includes things such as: ;; definition for method 134 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-134 vehicle ((this vehicle) (arg0 process)) +(defmethod vehicle-method-134 ((this vehicle) (arg0 process)) "Stubbed" 0 (none) @@ -816,7 +807,7 @@ This commonly includes things such as: ;; definition for method 76 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-76 vehicle ((this vehicle) (arg0 int) (arg1 uint)) +(defmethod vehicle-method-76 ((this vehicle) (arg0 int) (arg1 uint)) (when (< (-> this crash-level) arg0) (set! (-> this crash-level) arg0) (set! (-> this crash-duration) arg1) @@ -839,7 +830,7 @@ This commonly includes things such as: ;; definition for method 77 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-77 vehicle ((this vehicle)) +(defmethod vehicle-method-77 ((this vehicle)) (set! (-> this crash-level) 0) 0 (none) @@ -847,7 +838,7 @@ This commonly includes things such as: ;; definition for method 78 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-78 vehicle ((this vehicle) (arg0 int)) +(defmethod vehicle-method-78 ((this vehicle) (arg0 int)) (set! (-> this flight-level-index-prev) (-> this flight-level-index)) (set! (-> this flight-level-index) arg0) (logior! (-> this flags) (rigid-body-object-flag flight-level-transition camera-rapid-track-mode)) @@ -860,7 +851,7 @@ This commonly includes things such as: ;; definition for method 79 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-79 vehicle ((this vehicle)) +(defmethod vehicle-method-79 ((this vehicle)) (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition)) (logior! (-> this flags) (rigid-body-object-flag flight-level-transition-ending)) (set-time! (-> this transition-end-time)) @@ -870,7 +861,7 @@ This commonly includes things such as: ;; definition for method 131 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-131 vehicle ((this vehicle)) +(defmethod vehicle-method-131 ((this vehicle)) (if (not (logtest? (rigid-body-object-flag lights-dead) (-> this flags))) (set! (-> this flags) (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-on lights-update) (-> this flags))) @@ -882,7 +873,7 @@ This commonly includes things such as: ;; definition for method 132 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-132 vehicle ((this vehicle)) +(defmethod vehicle-method-132 ((this vehicle)) (set! (-> this flags) (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag lights-on))) ) @@ -896,7 +887,7 @@ This commonly includes things such as: ;; definition for method 139 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-139 vehicle ((this vehicle)) +(defmethod vehicle-method-139 ((this vehicle)) (when (not (logtest? (rigid-body-object-flag ignition) (-> this flags))) (logior! (-> this flags) (rigid-body-object-flag ignition)) (sound-play "vehicl-ignition") @@ -935,7 +926,7 @@ This commonly includes things such as: ;; definition for method 140 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-140 vehicle ((this vehicle)) +(defmethod vehicle-method-140 ((this vehicle)) (if (logtest? (rigid-body-object-flag ignition) (-> this flags)) (logclear! (-> this flags) (rigid-body-object-flag ignition)) ) @@ -945,7 +936,7 @@ This commonly includes things such as: ;; definition for method 141 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-141 vehicle ((this vehicle)) +(defmethod vehicle-method-141 ((this vehicle)) (let ((a0-2 (find-nearest-nav-mesh (-> this root trans) (the-as float #x7f800000)))) (when a0-2 (add-process-drawable-to-navmesh a0-2 this #t) @@ -958,7 +949,7 @@ This commonly includes things such as: ;; definition for method 142 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-142 vehicle ((this vehicle)) +(defmethod vehicle-method-142 ((this vehicle)) (let ((v1-0 (-> this nav))) (when v1-0 (remove-process-drawable (-> v1-0 state mesh) this) @@ -971,7 +962,7 @@ This commonly includes things such as: ;; definition for method 143 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-143 vehicle ((this vehicle)) +(defmethod vehicle-method-143 ((this vehicle)) (let ((v1-2 (or (logtest? (-> this flags) (rigid-body-object-flag dead waiting-for-player)) (and (logtest? (rigid-body-object-flag player-driving ai-driving) (-> this flags)) (not (logtest? (-> this flags) (rigid-body-object-flag on-flight-level))) @@ -1012,7 +1003,7 @@ This commonly includes things such as: ;; definition for method 87 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-87 vehicle ((this vehicle)) +(defmethod vehicle-method-87 ((this vehicle)) (when (not (logtest? (rigid-body-object-flag camera) (-> this flags))) (logior! (-> this flags) (rigid-body-object-flag camera)) (set! (-> this cam-speed-interp) 0.0) @@ -1043,7 +1034,7 @@ This commonly includes things such as: ;; definition for method 88 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-88 vehicle ((this vehicle)) +(defmethod vehicle-method-88 ((this vehicle)) (when (logtest? (rigid-body-object-flag camera) (-> this flags)) (vehicle-method-92 this) (vehicle-method-90 this) @@ -1080,7 +1071,7 @@ This commonly includes things such as: ;; definition for method 89 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-89 vehicle ((this vehicle)) +(defmethod vehicle-method-89 ((this vehicle)) (when (not (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags))) (logior! (-> this flags) (rigid-body-object-flag camera-bike-mode)) (set-setting! 'bike-mode #f 0.0 0) @@ -1091,7 +1082,7 @@ This commonly includes things such as: ;; definition for method 90 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-90 vehicle ((this vehicle)) +(defmethod vehicle-method-90 ((this vehicle)) (when (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags)) (logclear! (-> this flags) (rigid-body-object-flag camera-bike-mode)) (remove-setting! 'bike-mode) @@ -1102,7 +1093,7 @@ This commonly includes things such as: ;; definition for method 91 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-91 vehicle ((this vehicle)) +(defmethod vehicle-method-91 ((this vehicle)) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (logior! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode)) (set-setting! 'rapid-tracking #f 0.0 0) @@ -1113,7 +1104,7 @@ This commonly includes things such as: ;; definition for method 92 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-92 vehicle ((this vehicle)) +(defmethod vehicle-method-92 ((this vehicle)) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (logclear! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode)) (remove-setting! 'rapid-tracking) @@ -1124,7 +1115,7 @@ This commonly includes things such as: ;; definition for method 40 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-40 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-40 ((this vehicle)) (logior! (-> this flags) (rigid-body-object-flag enable-collision)) (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (-> this root backup-collide-as)) @@ -1136,7 +1127,7 @@ This commonly includes things such as: ;; definition for method 41 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-41 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-41 ((this vehicle)) (logclear! (-> this flags) (rigid-body-object-flag enable-collision)) (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) @@ -1149,7 +1140,7 @@ This commonly includes things such as: ;; definition for method 102 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-102 vehicle ((this vehicle)) +(defmethod vehicle-method-102 ((this vehicle)) (let ((v1-1 (-> this draw shadow-ctrl))) (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) @@ -1160,7 +1151,7 @@ This commonly includes things such as: ;; definition for method 103 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-103 vehicle ((this vehicle)) +(defmethod vehicle-method-103 ((this vehicle)) (let ((v1-1 (-> this draw shadow-ctrl))) (logior! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) @@ -1171,7 +1162,7 @@ This commonly includes things such as: ;; definition for method 38 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-38 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-38 ((this vehicle)) (when (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) (logior! (-> this rbody state flags) (rigid-body-flag enable-physics)) (rigid-body-method-26 (-> this rbody state) (-> this root trans) (-> this root quat)) @@ -1185,7 +1176,7 @@ This commonly includes things such as: ;; definition for method 39 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-39 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-39 ((this vehicle)) (set! (-> this force-scale) 1.0) (logclear! (-> this rbody state flags) (rigid-body-flag enable-physics)) (vehicle-method-110 this) @@ -1195,7 +1186,7 @@ This commonly includes things such as: ;; definition for method 111 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-111 vehicle ((this vehicle) (arg0 object) (arg1 target)) +(defmethod vehicle-method-111 ((this vehicle) (arg0 object) (arg1 target)) (let ((a0-1 (-> this controller traffic))) (when (and (nonzero? a0-1) arg1) (if #t @@ -1208,14 +1199,14 @@ This commonly includes things such as: ) ;; definition for method 112 of type vehicle -(defmethod decrease-traffic-alert-level vehicle ((this vehicle) (arg0 int)) +(defmethod decrease-traffic-alert-level ((this vehicle) (arg0 int)) (decrease-alert-level (-> this controller traffic) arg0) 0 ) ;; definition for method 80 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-80 vehicle ((this vehicle)) +(defmethod vehicle-method-80 ((this vehicle)) (when (and (logtest? (-> this info flags) 64) (< (-> this flight-level-index) 1)) 1 (cond @@ -1234,7 +1225,7 @@ This commonly includes things such as: ;; definition for method 81 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-81 vehicle ((this vehicle)) +(defmethod vehicle-method-81 ((this vehicle)) (when (and (logtest? (-> this info flags) 64) (> (-> this flight-level-index) 0)) (sound-play "bike-down") (vehicle-method-78 this 0) @@ -1245,7 +1236,7 @@ This commonly includes things such as: ;; definition for method 83 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-83 vehicle ((this vehicle)) +(defmethod vehicle-method-83 ((this vehicle)) (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition)) (vehicle-method-92 this) (set! (-> this flight-level-index) 0) @@ -1255,7 +1246,7 @@ This commonly includes things such as: ;; definition for method 108 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-108 vehicle ((this vehicle)) +(defmethod vehicle-method-108 ((this vehicle)) (vehicle-controller-method-11 (-> this controller)) (set! (-> this flags) (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> this flags))) @@ -1267,7 +1258,7 @@ This commonly includes things such as: ;; definition for method 109 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-109 vehicle ((this vehicle)) +(defmethod vehicle-method-109 ((this vehicle)) (set! (-> this flags) (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag in-pursuit))) ) @@ -1279,7 +1270,7 @@ This commonly includes things such as: ;; definition for method 42 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-42 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-42 ((this vehicle)) (if (and (not (focus-test? this inactive)) (not (and (-> this next-state) (= (-> this next-state name) 'explode))) ) @@ -1291,7 +1282,7 @@ This commonly includes things such as: ;; definition for method 113 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-113 vehicle ((this vehicle)) +(defmethod vehicle-method-113 ((this vehicle)) (vehicle-method-127 this) (logior! (-> this focus-status) (focus-status inactive)) (set! (-> this event-hook) (-> (method-of-object this inactive) event)) @@ -1302,7 +1293,7 @@ This commonly includes things such as: ;; definition for method 114 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-114 vehicle ((this vehicle)) +(defmethod vehicle-method-114 ((this vehicle)) (if (focus-test? this inactive) (vehicle-method-128 this) ) @@ -1313,7 +1304,7 @@ This commonly includes things such as: ;; definition for method 43 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-43 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-43 ((this vehicle)) (go (method-of-object this waiting)) 0 (none) @@ -1321,7 +1312,7 @@ This commonly includes things such as: ;; definition for method 138 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-138 vehicle ((this vehicle)) +(defmethod vehicle-method-138 ((this vehicle)) (go (method-of-object this player-control)) 0 (none) @@ -1329,7 +1320,7 @@ This commonly includes things such as: ;; definition for method 130 of type vehicle ;; WARN: Return type mismatch object vs none. -(defmethod vehicle-method-130 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-130 ((this vehicle) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) @@ -1361,7 +1352,7 @@ This commonly includes things such as: ;; definition for method 136 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-136 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-136 ((this vehicle) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((= v1-0 1) @@ -1385,7 +1376,7 @@ This commonly includes things such as: ;; definition for method 127 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-127 vehicle ((this vehicle)) +(defmethod vehicle-method-127 ((this vehicle)) (let ((s5-0 (-> this child))) (while s5-0 (send-event (ppointer->process s5-0) 'traffic-off) @@ -1404,7 +1395,7 @@ This commonly includes things such as: ;; definition for method 128 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-128 vehicle ((this vehicle)) +(defmethod vehicle-method-128 ((this vehicle)) (vehicle-method-82 this) (set! (-> this root trans y) (-> this flight-level)) (logior! (-> this flags) (rigid-body-object-flag ignition ai-driving)) @@ -1420,7 +1411,7 @@ This commonly includes things such as: ;; definition for method 129 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-129 vehicle ((this vehicle)) +(defmethod vehicle-method-129 ((this vehicle)) (if (= this *debug-actor*) (format #t "hook-dead~%") ) @@ -1442,20 +1433,20 @@ This commonly includes things such as: ;; definition for method 137 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-137 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-137 ((this vehicle) (arg0 traffic-object-spawn-params)) (vehicle-rider-spawn this citizen-norm-rider arg0) 0 (none) ) ;; definition for method 105 of type vehicle -(defmethod vehicle-method-105 vehicle ((this vehicle)) +(defmethod vehicle-method-105 ((this vehicle)) (logtest? (rigid-body-object-flag disturbed player-touching player-driving in-pursuit) (-> this flags)) ) ;; definition for method 106 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-106 vehicle ((this vehicle)) +(defmethod vehicle-method-106 ((this vehicle)) (local-vars (v1-13 float) (v1-25 float) (v1-30 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1528,7 +1519,7 @@ This commonly includes things such as: ;; definition for method 86 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods vehicle ((this vehicle)) +(defmethod update-joint-mods ((this vehicle)) 0 (none) ) @@ -1537,7 +1528,7 @@ This commonly includes things such as: ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-107 vehicle ((this vehicle)) +(defmethod vehicle-method-107 ((this vehicle)) (logclear! (-> this controller flags) (vehicle-controller-flag ignore-others direct-mode)) (let ((s5-0 (new 'stack-no-clear 'vehicle-control-point))) (set! (-> s5-0 local-pos quad) (-> this root trans quad)) @@ -1565,7 +1556,7 @@ This commonly includes things such as: ;; definition for method 119 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-119 vehicle ((this vehicle)) +(defmethod vehicle-method-119 ((this vehicle)) (dotimes (s5-0 (-> this info seat-count)) (let ((s4-0 (handle->process (-> this rider-array s5-0)))) (when (and s4-0 (focus-test? (the-as vehicle-rider s4-0) pilot-riding)) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc index af3d9d49a0f..68ce3affc1d 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc @@ -33,18 +33,15 @@ ;; definition of type debug-vehicle-work (deftype debug-vehicle-work (basic) - ((impact-time time-frame :offset-assert 8) - (impact rigid-body-impact :inline :offset-assert 16) - (prim-sphere1 sphere :inline :offset-assert 80) - (prim-sphere2 sphere :inline :offset-assert 96) + ((impact-time time-frame) + (impact rigid-body-impact :inline) + (prim-sphere1 sphere :inline) + (prim-sphere2 sphere :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type debug-vehicle-work -(defmethod inspect debug-vehicle-work ((this debug-vehicle-work)) +(defmethod inspect ((this debug-vehicle-work)) (when (not this) (set! this this) (goto cfg-4) @@ -92,7 +89,7 @@ ;; definition for method 45 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-45 vehicle ((this vehicle) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 ((this vehicle) (arg0 rigid-body-impact)) (local-vars (v1-63 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -204,7 +201,7 @@ ;; definition for method 104 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-104 vehicle ((this vehicle)) +(defmethod vehicle-method-104 ((this vehicle)) (when (= (-> this controller traffic sync-mask-8) (ash 1 (logand (-> this traffic-priority-id) 7))) (let ((a1-0 (-> this root trans))) (set! (-> this flight-level) (get-height-at-point *traffic-height-map* a1-0)) @@ -249,7 +246,7 @@ ;; definition for method 93 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-93 vehicle ((this vehicle)) +(defmethod vehicle-method-93 ((this vehicle)) (let ((s5-0 (new 'stack-no-clear 'matrix))) (set! (-> s5-0 vector 2 quad) (-> this rbody state matrix quad 0)) (set! (-> s5-0 trans quad) (-> this rbody state matrix vector 2 quad)) @@ -307,7 +304,7 @@ ;; definition for method 95 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-95 vehicle ((this vehicle) (arg0 vector)) +(defmethod vehicle-method-95 ((this vehicle) (arg0 vector)) (seek! (-> this controls steering) (-> arg0 x) (* 8.0 (seconds-per-frame))) (seek! (-> this controls lean-z) (-> arg0 w) (* 8.0 (seconds-per-frame))) (logclear! (-> this flags) (rigid-body-object-flag slide)) @@ -374,7 +371,7 @@ ;; definition for method 94 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-94 vehicle ((this vehicle)) +(defmethod vehicle-method-94 ((this vehicle)) (cond ((or (logtest? (rigid-body-object-flag player-grabbed) (-> this flags)) (and *target* (focus-test? *target* dead grabbed)) @@ -422,7 +419,7 @@ ;; definition for method 96 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-96 vehicle ((this vehicle)) +(defmethod vehicle-method-96 ((this vehicle)) (when (and *target* (logtest? (rigid-body-object-flag ignition) (-> this flags))) (when (and (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (zero? (-> this root num-riders)) @@ -585,7 +582,7 @@ ;; definition for method 97 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-97 vehicle ((this vehicle)) +(defmethod vehicle-method-97 ((this vehicle)) (local-vars (v1-88 float) (v1-98 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -736,7 +733,7 @@ ;; definition for method 120 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-120 vehicle ((this vehicle)) +(defmethod vehicle-method-120 ((this vehicle)) (let ((s5-0 (-> this draw shadow-ctrl))) (when (!= *vehicle-shadow-control-disabled* s5-0) (let ((f30-0 (vector-vector-xz-distance (camera-pos) (-> this root trans)))) @@ -814,7 +811,7 @@ ;; definition for method 51 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-51 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-51 ((this vehicle)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f30-0 -4096000.0)) (set! (-> s5-0 start-pos quad) (-> this rbody state position quad)) @@ -884,7 +881,7 @@ ;; definition for method 52 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-52 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-52 ((this vehicle)) (with-pp (let ((v1-0 (new 'stack-no-clear 'vehicle-control-point))) (set! (-> v1-0 local-pos quad) (-> this root transv quad)) @@ -977,7 +974,7 @@ ;; definition for method 121 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-121 vehicle ((this vehicle)) +(defmethod vehicle-method-121 ((this vehicle)) (if (time-elapsed? (-> this player-touch-time) (seconds 0.1)) (logclear! (-> this flags) (rigid-body-object-flag player-touching player-edge-grabbing player-standing-on)) ) @@ -999,7 +996,7 @@ ;; definition for method 37 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-37 vehicle ((this vehicle)) +(defmethod rigid-body-object-method-37 ((this vehicle)) (local-vars (a0-14 int) (a0-16 int) (a0-19 int) (a0-21 int)) (let* ((v1-1 (-> *perf-stats* data 37)) (a0-1 (-> v1-1 ctrl)) @@ -1090,7 +1087,7 @@ ;; definition for method 123 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-123 vehicle ((this vehicle)) +(defmethod vehicle-method-123 ((this vehicle)) (local-vars (v1-4 symbol) (a0-21 int) (a0-23 int)) (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) @@ -1195,7 +1192,7 @@ ;; definition for method 122 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-122 vehicle ((this vehicle)) +(defmethod vehicle-method-122 ((this vehicle)) (local-vars (a0-23 int) (a0-25 int) (a0-35 int) (a0-37 int) (a0-40 int) (a0-42 int)) (let* ((v1-1 (-> *perf-stats* data 37)) (a0-1 (-> v1-1 ctrl)) @@ -1352,7 +1349,7 @@ ;; definition for method 124 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-124 vehicle ((this vehicle)) +(defmethod vehicle-method-124 ((this vehicle)) (vehicle-method-94 this) (vehicle-method-121 this) (vehicle-method-97 this) @@ -1362,7 +1359,7 @@ ;; definition for method 31 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod alloc-and-init-rigid-body-control vehicle ((this vehicle) (arg0 rigid-body-vehicle-constants)) +(defmethod alloc-and-init-rigid-body-control ((this vehicle) (arg0 rigid-body-vehicle-constants)) (if (logtest? (-> arg0 flags) 8) (iterate-prims (-> this root) @@ -1497,7 +1494,7 @@ ;; definition for method 47 of type vehicle ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-47 vehicle ((this vehicle) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) +(defmethod rigid-body-object-method-47 ((this vehicle) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) (local-vars (f0-2 float) (sv-96 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1650,7 +1647,7 @@ ;; definition for method 48 of type vehicle ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-48 vehicle ((this vehicle) (arg0 process-focusable) (arg1 touching-shapes-entry)) +(defmethod rigid-body-object-method-48 ((this vehicle) (arg0 process-focusable) (arg1 touching-shapes-entry)) (local-vars (v1-2 symbol) (v1-30 symbol) (a0-19 object)) (with-pp (b! @@ -1773,7 +1770,7 @@ ;; definition for method 46 of type vehicle ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-46 vehicle ((this vehicle) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 ((this vehicle) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (and (= arg2 'touched) arg0 (logtest? (process-mask bit18) (-> arg0 mask))) (dotimes (s1-0 4) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -1895,7 +1892,7 @@ ;; definition for method 135 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-135 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-135 ((this vehicle) (arg0 traffic-object-spawn-params)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-obs_REF.gc index e1b2e25f603..22034ee8790 100644 --- a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-obs_REF.gc @@ -3,23 +3,19 @@ ;; definition of type vin-turbine (deftype vin-turbine (process-drawable) - ((dont-draw-outside? symbol :offset-assert 200) - (lightning-timer uint64 :offset-assert 208) - (outside-plane plane :inline :offset-assert 224) - (lightning-plane plane :inline :offset-assert 240) + ((dont-draw-outside? symbol) + (lightning-timer uint64) + (outside-plane plane :inline) + (lightning-plane plane :inline) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #x100 - :flag-assert #x1600800100 - (:methods - (idle () _type_ :state 20) - (dormant () _type_ :state 21) + (:state-methods + idle + dormant ) ) ;; definition for method 3 of type vin-turbine -(defmethod inspect vin-turbine ((this vin-turbine)) +(defmethod inspect ((this vin-turbine)) (when (not this) (set! this this) (goto cfg-4) @@ -211,7 +207,7 @@ ;; definition for method 11 of type vin-turbine ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vin-turbine ((this vin-turbine) (arg0 entity-actor)) +(defmethod init-from-entity! ((this vin-turbine) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -250,14 +246,10 @@ This commonly includes things such as: ;; definition of type vin-door (deftype vin-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type vin-door -(defmethod inspect vin-door ((this vin-door)) +(defmethod inspect ((this vin-door)) (when (not this) (set! this this) (goto cfg-4) @@ -271,7 +263,7 @@ This commonly includes things such as: ;; definition for method 11 of type vin-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vin-door ((this vin-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this vin-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-part_REF.gc b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-part_REF.gc index 5e089f3c7da..cf4e4b55f48 100644 --- a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type vinroom-part (deftype vinroom-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type vinroom-part -(defmethod inspect vinroom-part ((this vinroom-part)) +(defmethod inspect ((this vinroom-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-scenes_REF.gc b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-scenes_REF.gc index d7a47f23486..b44b1c0a12d 100644 --- a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-scenes_REF.gc @@ -4,14 +4,10 @@ ;; definition of type vin-npc (deftype vin-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type vin-npc -(defmethod inspect vin-npc ((this vin-npc)) +(defmethod inspect ((this vin-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -33,7 +29,7 @@ ;; definition for method 33 of type vin-npc ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-art! vin-npc ((this vin-npc)) +(defmethod init-art! ((this vin-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/common/ai/ai-task-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ai-task-h_REF.gc index e261ca74d7d..ee8170c6878 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ai-task-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ai-task-h_REF.gc @@ -3,24 +3,21 @@ ;; definition of type ai-task (deftype ai-task (basic) - ((next ai-task :offset-assert 4) - (prev ai-task :offset-assert 8) - (pool ai-task-pool :offset-assert 12) - (unique-id uint32 :offset-assert 16) - (bytes int8 16 :offset 32) + ((next ai-task) + (prev ai-task) + (pool ai-task-pool) + (unique-id uint32) + (bytes int8 16 :offset 32) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 (:methods - (reset-task! (_type_) none 9) - (ai-task-method-10 (_type_ bot) none 10) - (ai-task-method-11 (_type_ bot) none 11) + (reset-task! (_type_) none) + (ai-task-method-10 (_type_ bot) none) + (ai-task-method-11 (_type_ bot) none) ) ) ;; definition for method 3 of type ai-task -(defmethod inspect ai-task ((this ai-task)) +(defmethod inspect ((this ai-task)) (when (not this) (set! this this) (goto cfg-4) @@ -37,23 +34,20 @@ ;; definition of type ai-task-pool (deftype ai-task-pool (basic) - ((anchor ai-task :offset-assert 4) - (tasks (pointer uint32) :offset-assert 8) - (tasks-length uint32 :offset-assert 12) - (unique-id uint32 :offset-assert 16) + ((anchor ai-task) + (tasks (pointer uint32)) + (tasks-length uint32) + (unique-id uint32) ) - :method-count-assert 12 - :size-assert #x14 - :flag-assert #xc00000014 (:methods - (assign-ids! (_type_ type) ai-task 9) - (set-next-task! (_type_ ai-task) none 10) - (ai-task-pool-method-11 (_type_) ai-task 11) + (assign-ids! (_type_ type) ai-task) + (set-next-task! (_type_ ai-task) none) + (ai-task-pool-method-11 (_type_) ai-task) ) ) ;; definition for method 3 of type ai-task-pool -(defmethod inspect ai-task-pool ((this ai-task-pool)) +(defmethod inspect ((this ai-task-pool)) (when (not this) (set! this this) (goto cfg-4) @@ -69,28 +63,25 @@ ;; definition of type ai-task-control (deftype ai-task-control (basic) - ((anchor ai-task :offset-assert 4) - (pool ai-task-pool :offset-assert 8) + ((anchor ai-task) + (pool ai-task-pool) ) - :method-count-assert 18 - :size-assert #xc - :flag-assert #x120000000c (:methods - (new (symbol type ai-task-pool) _type_ 0) - (ai-task-control-method-9 (_type_) none 9) - (ai-task-control-method-10 (_type_ bot) none 10) - (get-task-by-type (_type_ type bot) ai-task 11) - (ai-task-control-method-12 (_type_ bot) symbol 12) - (ai-task-control-method-13 (_type_ ai-task bot) ai-task 13) - (ai-task-control-method-14 (_type_ ai-task bot) none 14) - (init-task! (_type_ type bot) ai-task 15) - (set-next-task-for-pool! (_type_ ai-task) none 16) - (set-next-task! (_type_ ai-task) none 17) + (new (symbol type ai-task-pool) _type_) + (ai-task-control-method-9 (_type_) none) + (ai-task-control-method-10 (_type_ bot) none) + (get-task-by-type (_type_ type bot) ai-task) + (ai-task-control-method-12 (_type_ bot) symbol) + (ai-task-control-method-13 (_type_ ai-task bot) ai-task) + (ai-task-control-method-14 (_type_ ai-task bot) none) + (init-task! (_type_ type bot) ai-task) + (set-next-task-for-pool! (_type_ ai-task) none) + (set-next-task! (_type_ ai-task) none) ) ) ;; definition for method 3 of type ai-task-control -(defmethod inspect ai-task-control ((this ai-task-control)) +(defmethod inspect ((this ai-task-control)) (when (not this) (set! this this) (goto cfg-4) @@ -104,28 +95,28 @@ ;; definition for method 11 of type ai-task ;; WARN: Return type mismatch int vs none. -(defmethod ai-task-method-11 ai-task ((this ai-task) (arg0 bot)) +(defmethod ai-task-method-11 ((this ai-task) (arg0 bot)) 0 (none) ) ;; definition for method 10 of type ai-task ;; WARN: Return type mismatch int vs none. -(defmethod ai-task-method-10 ai-task ((this ai-task) (arg0 bot)) +(defmethod ai-task-method-10 ((this ai-task) (arg0 bot)) 0 (none) ) ;; definition for method 9 of type ai-task ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! ai-task ((this ai-task)) +(defmethod reset-task! ((this ai-task)) 0 (none) ) ;; definition for method 11 of type ai-task-pool ;; WARN: Return type mismatch (pointer uint32) vs ai-task. -(defmethod ai-task-pool-method-11 ai-task-pool ((this ai-task-pool)) +(defmethod ai-task-pool-method-11 ((this ai-task-pool)) (set! (-> this unique-id) (the-as uint 0)) (let ((t0-0 (the-as (pointer uint32) #f)) (a1-0 (the-as (pointer uint32) #f)) @@ -152,7 +143,7 @@ ) ;; definition for method 9 of type ai-task-pool -(defmethod assign-ids! ai-task-pool ((this ai-task-pool) (arg0 type)) +(defmethod assign-ids! ((this ai-task-pool) (arg0 type)) "Assign unique IDs to the [[ai-task-pool]] and its `anchor`s `next`" (let ((v1-1 (-> this anchor next))) (when v1-1 @@ -181,7 +172,7 @@ ;; definition for method 10 of type ai-task-pool ;; WARN: Return type mismatch ai-task vs none. -(defmethod set-next-task! ai-task-pool ((this ai-task-pool) (arg0 ai-task)) +(defmethod set-next-task! ((this ai-task-pool) (arg0 ai-task)) "Set the next task in the [[ai-task-pool]] to the specified [[ai-task]]." (let* ((v1-0 (-> this anchor)) (v0-0 (-> v1-0 next)) @@ -203,7 +194,7 @@ ) ;; definition for method 12 of type ai-task-control -(defmethod ai-task-control-method-12 ai-task-control ((this ai-task-control) (arg0 bot)) +(defmethod ai-task-control-method-12 ((this ai-task-control) (arg0 bot)) (let ((gp-0 (-> this anchor))) (let ((s3-0 (-> this anchor next))) (while s3-0 @@ -224,7 +215,7 @@ ;; definition for method 9 of type ai-task-control ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-control-method-9 ai-task-control ((this ai-task-control)) +(defmethod ai-task-control-method-9 ((this ai-task-control)) (ai-task-control-method-12 this (the-as bot #f)) (let ((a1-1 (-> this anchor))) (when a1-1 @@ -236,7 +227,7 @@ ) ;; definition for method 15 of type ai-task-control -(defmethod init-task! ai-task-control ((this ai-task-control) (arg0 type) (arg1 bot)) +(defmethod init-task! ((this ai-task-control) (arg0 type) (arg1 bot)) "Initialize a task of the given type in the [[ai-task-control]]'s pool." (let ((s5-0 (assign-ids! (-> this pool) arg0))) (if s5-0 @@ -248,7 +239,7 @@ ;; definition for method 17 of type ai-task-control ;; WARN: Return type mismatch ai-task vs none. -(defmethod set-next-task! ai-task-control ((this ai-task-control) (arg0 ai-task)) +(defmethod set-next-task! ((this ai-task-control) (arg0 ai-task)) "Set `next` of this [[ai-task-control]]'s `anchor` to the given [[ai-task]]." (let* ((v1-0 (-> this anchor)) (a0-1 (-> v1-0 next)) @@ -261,13 +252,13 @@ ) ;; definition for method 16 of type ai-task-control -(defmethod set-next-task-for-pool! ai-task-control ((this ai-task-control) (arg0 ai-task)) +(defmethod set-next-task-for-pool! ((this ai-task-control) (arg0 ai-task)) (set-next-task! (-> this pool) arg0) (none) ) ;; definition for method 11 of type ai-task-control -(defmethod get-task-by-type ai-task-control ((this ai-task-control) (arg0 type) (arg1 bot)) +(defmethod get-task-by-type ((this ai-task-control) (arg0 type) (arg1 bot)) (let ((s5-0 (init-task! this arg0 arg1))) (if s5-0 (set-next-task! this s5-0) @@ -277,7 +268,7 @@ ) ;; definition for method 13 of type ai-task-control -(defmethod ai-task-control-method-13 ai-task-control ((this ai-task-control) (arg0 ai-task) (arg1 bot)) +(defmethod ai-task-control-method-13 ((this ai-task-control) (arg0 ai-task) (arg1 bot)) (let ((gp-0 (-> arg0 prev)) (s5-0 (-> arg0 next)) ) @@ -296,7 +287,7 @@ ) ;; definition for method 10 of type ai-task-control -(defmethod ai-task-control-method-10 ai-task-control ((this ai-task-control) (arg0 bot)) +(defmethod ai-task-control-method-10 ((this ai-task-control) (arg0 bot)) (let ((a0-1 (-> this anchor next))) (if a0-1 (ai-task-method-11 a0-1 arg0) @@ -306,7 +297,7 @@ ) ;; definition for method 14 of type ai-task-control -(defmethod ai-task-control-method-14 ai-task-control ((this ai-task-control) (arg0 ai-task) (arg1 bot)) +(defmethod ai-task-control-method-14 ((this ai-task-control) (arg0 ai-task) (arg1 bot)) (let ((a0-1 (ai-task-control-method-13 this arg0 arg1))) (if a0-1 (ai-task-method-11 a0-1 arg1) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-h_REF.gc index 4273ffc5bd4..46536945d1d 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-h_REF.gc @@ -3,16 +3,13 @@ ;; definition of type ashelin-course (deftype ashelin-course (bot-course) - ((ouch-speeches bot-speech-list-shuffle :offset-assert 48) - (victory-speeches bot-speech-list-shuffle :offset-assert 52) + ((ouch-speeches bot-speech-list-shuffle) + (victory-speeches bot-speech-list-shuffle) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) ;; definition for method 3 of type ashelin-course -(defmethod inspect ashelin-course ((this ashelin-course)) +(defmethod inspect ((this ashelin-course)) (when (not this) (set! this this) (goto cfg-4) @@ -39,50 +36,48 @@ ;; definition of type ashelin (deftype ashelin (bot) - ((ash-course ashelin-course :offset 652) - (knocked-anim art-joint-anim :offset-assert 992) - (travel-anim-interp float :offset-assert 996) - (fired-gun-count uint32 :offset-assert 1000) - (last-fire-time time-frame :offset-assert 1008) - (victory-speech-time time-frame :offset-assert 1016) - (frontline plane :inline :offset-assert 1024) + ((ash-course ashelin-course :overlay-at course) + (knocked-anim art-joint-anim) + (travel-anim-interp float) + (fired-gun-count uint32) + (last-fire-time time-frame) + (victory-speech-time time-frame) + (frontline plane :inline) ) - :heap-base #x390 - :method-count-assert 251 - :size-assert #x410 - :flag-assert #xfb03900410 + (:state-methods + back-spring + cartwheel-left + tumble-right + chase + traveling + traveling-blocked + waiting-idle + standing-idle + standing-turn + standing-blast + ) (:methods - (back-spring () _type_ :state 225) - (cartwheel-left () _type_ :state 226) - (tumble-right () _type_ :state 227) - (chase () _type_ :state 228) - (traveling () _type_ :state 229) - (traveling-blocked () _type_ :state 230) - (waiting-idle () _type_ :state 231) - (standing-idle () _type_ :state 232) - (standing-turn () _type_ :state 233) - (standing-blast () _type_ :state 234) - (ashelin-method-235 (_type_ symbol) symbol 235) - (ashelin-method-236 (_type_ vector float float float float) symbol 236) - (fire-projectile (_type_ vector) none 237) - (ashelin-method-238 (_type_ symbol symbol) symbol 238) - (ashelin-method-239 (_type_) none 239) - (ashelin-method-240 (_type_ int) none 240) - (ashelin-method-241 (_type_) int 241) - (ashelin-method-242 (_type_) int 242) - (ashelin-method-243 (_type_ float) int 243) - (ashelin-method-244 (_type_) none 244) - (ashelin-method-245 (_type_) none 245) - (ashelin-method-246 (_type_) int 246) - (ashelin-method-247 (_type_) symbol 247) - (ashelin-method-248 (_type_) symbol 248) - (ashelin-method-249 (_type_) none 249) - (ashelin-method-250 (_type_ symbol) none 250) + (ashelin-method-235 (_type_ symbol) symbol) + (ashelin-method-236 (_type_ vector float float float float) symbol) + (fire-projectile (_type_ vector) none) + (ashelin-method-238 (_type_ symbol symbol) symbol) + (ashelin-method-239 (_type_) none) + (ashelin-method-240 (_type_ int) none) + (ashelin-method-241 (_type_) int) + (ashelin-method-242 (_type_) int) + (ashelin-method-243 (_type_ float) int) + (ashelin-method-244 (_type_) none) + (ashelin-method-245 (_type_) none) + (ashelin-method-246 (_type_) int) + (ashelin-method-247 (_type_) symbol) + (ashelin-method-248 (_type_) symbol) + (ashelin-method-249 (_type_) none) + (ashelin-method-250 (_type_ symbol) none) ) ) ;; definition for method 3 of type ashelin -(defmethod inspect ashelin ((this ashelin)) +(defmethod inspect ((this ashelin)) (when (not this) (set! this this) (goto cfg-4) @@ -110,18 +105,15 @@ ;; definition of type asht-wait-spot (deftype asht-wait-spot (ai-task) - ((check-done (function asht-wait-spot ashelin symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function asht-wait-spot ashelin symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type asht-wait-spot -(defmethod inspect asht-wait-spot ((this asht-wait-spot)) +(defmethod inspect ((this asht-wait-spot)) (when (not this) (set! this this) (goto cfg-4) @@ -143,13 +135,10 @@ ;; definition of type asht-fight-focus (deftype asht-fight-focus (ai-task) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type asht-fight-focus -(defmethod inspect asht-fight-focus ((this asht-fight-focus)) +(defmethod inspect ((this asht-fight-focus)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-shot_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-shot_REF.gc index c1bb3644350..35956c70829 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-shot_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-shot_REF.gc @@ -254,17 +254,13 @@ ;; definition of type ashelin-shot (deftype ashelin-shot (projectile) - ((tail-pos vector :inline :offset-assert 480) - (hit-pos vector :inline :offset-assert 496) + ((tail-pos vector :inline) + (hit-pos vector :inline) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x200 - :flag-assert #x2801800200 ) ;; definition for method 3 of type ashelin-shot -(defmethod inspect ashelin-shot ((this ashelin-shot)) +(defmethod inspect ((this ashelin-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -280,7 +276,7 @@ ;; definition for method 24 of type ashelin-shot ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight ashelin-shot ((this ashelin-shot)) +(defmethod draw-laser-sight ((this ashelin-shot)) "TODO - confirm If applicable, draw the laser sight particles" (draw-beam (-> *part-id-table* 675) (-> this tail-pos) (-> this starting-dir) #f #t) 0 @@ -290,7 +286,7 @@ ;; definition for method 25 of type ashelin-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles ashelin-shot ((this ashelin-shot)) +(defmethod spawn-impact-particles ((this ashelin-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -348,7 +344,7 @@ ;; definition for method 26 of type ashelin-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles ashelin-shot ((this ashelin-shot)) +(defmethod spawn-shell-particles ((this ashelin-shot)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -391,7 +387,7 @@ ;; definition for method 28 of type ashelin-shot ;; WARN: Return type mismatch object vs none. -(defmethod play-impact-sound ashelin-shot ((this ashelin-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this ashelin-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -409,7 +405,7 @@ ) ;; definition for method 38 of type ashelin-shot -(defmethod made-impact? ashelin-shot ((this ashelin-shot)) +(defmethod made-impact? ((this ashelin-shot)) "TODO - queries the collision cache, return true/false" (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) @@ -458,7 +454,7 @@ ;; definition for method 30 of type ashelin-shot ;; WARN: Return type mismatch symbol vs none. -(defmethod init-proj-collision! ashelin-shot ((this ashelin-shot)) +(defmethod init-proj-collision! ((this ashelin-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -532,7 +528,7 @@ ;; definition for method 31 of type ashelin-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! ashelin-shot ((this ashelin-shot)) +(defmethod init-proj-settings! ((this ashelin-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'eco-yellow) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash_REF.gc index 6a00a1f993b..bb200445644 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash_REF.gc @@ -3,16 +3,13 @@ ;; definition of type ashelin-anim-info (deftype ashelin-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type ashelin-anim-info -(defmethod inspect ashelin-anim-info ((this ashelin-anim-info)) +(defmethod inspect ((this ashelin-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -25,17 +22,14 @@ ;; definition of type ashelin-global-info (deftype ashelin-global-info (basic) - ((prev-blue-hit int8 :offset-assert 4) - (blue-hit-anim int32 6 :offset-assert 8) - (blue-hit-land-anim int32 6 :offset-assert 32) + ((prev-blue-hit int8) + (blue-hit-anim int32 6) + (blue-hit-land-anim int32 6) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) ;; definition for method 3 of type ashelin-global-info -(defmethod inspect ashelin-global-info ((this ashelin-global-info)) +(defmethod inspect ((this ashelin-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -233,7 +227,7 @@ (set! (-> *ashelin-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 59 of type ashelin -(defmethod get-penetrate-info ashelin ((this ashelin)) +(defmethod get-penetrate-info ((this ashelin)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (let* ((t9-0 (method-of-type bot get-penetrate-info)) @@ -248,7 +242,7 @@ ;; definition for method 250 of type ashelin ;; WARN: Return type mismatch penetrate vs none. -(defmethod ashelin-method-250 ashelin ((this ashelin) (arg0 symbol)) +(defmethod ashelin-method-250 ((this ashelin) (arg0 symbol)) (if arg0 (logior! (-> this bot-flags) (bot-flags bf22)) (logclear! (-> this bot-flags) (bot-flags bf22)) @@ -258,7 +252,7 @@ ) ;; definition for method 193 of type ashelin -(defmethod bot-method-193 ashelin ((this ashelin)) +(defmethod bot-method-193 ((this ashelin)) (let* ((t9-0 (method-of-type bot bot-method-193)) (v0-0 (t9-0 this)) ) @@ -274,7 +268,7 @@ ;; definition for method 106 of type ashelin ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-106 ashelin ((this ashelin) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 ((this ashelin) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type bot enemy-method-106))) (t9-0 this arg0 arg1 arg2 arg3) ) @@ -285,7 +279,7 @@ ) ;; definition for method 104 of type ashelin -(defmethod enemy-method-104 ashelin ((this ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ((this ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (if (and (= (-> arg0 type) target) (-> this next-state) (let ((v1-4 (-> this next-state name))) @@ -298,7 +292,7 @@ ) ;; definition for method 97 of type ashelin -(defmethod enemy-method-97 ashelin ((this ashelin)) +(defmethod enemy-method-97 ((this ashelin)) (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 @@ -398,7 +392,7 @@ ;; definition for method 183 of type ashelin ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? ashelin ((this ashelin)) +(defmethod alive? ((this ashelin)) (let ((t9-0 (method-of-type bot alive?))) (the-as symbol @@ -412,7 +406,7 @@ ;; definition for method 114 of type ashelin ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! ashelin ((this ashelin)) +(defmethod init-enemy-collision! ((this ashelin)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -469,7 +463,7 @@ ;; definition for method 115 of type ashelin ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! ashelin ((this ashelin)) +(defmethod init-enemy! ((this ashelin)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (set! (-> this channel) (the-as uint 22)) @@ -500,7 +494,7 @@ ;; definition for method 238 of type ashelin ;; WARN: disable def twice: 25. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod ashelin-method-238 ashelin ((this ashelin) (arg0 symbol) (arg1 symbol)) +(defmethod ashelin-method-238 ((this ashelin) (arg0 symbol) (arg1 symbol)) (cond ((and (logtest? (-> this bot-flags) (bot-flags attacked)) (= (-> this focus-info fproc type) target)) #t @@ -524,14 +518,14 @@ ) ;; definition for method 235 of type ashelin -(defmethod ashelin-method-235 ashelin ((this ashelin) (arg0 symbol)) +(defmethod ashelin-method-235 ((this ashelin) (arg0 symbol)) (and (time-elapsed? (-> this last-fire-time) (seconds 1)) (and (>= 8556.089 (fabs (-> this focus-info ry-diff))) (ashelin-method-238 this arg0 #t)) ) ) ;; definition for method 243 of type ashelin -(defmethod ashelin-method-243 ashelin ((this ashelin) (arg0 float)) +(defmethod ashelin-method-243 ((this ashelin) (arg0 float)) (let ((f30-0 (deg- arg0 (-> this focus-info my-facing-ry)))) (when (>= 16384.0 (fabs f30-0)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -560,7 +554,7 @@ ) ;; definition for method 246 of type ashelin -(defmethod ashelin-method-246 ashelin ((this ashelin)) +(defmethod ashelin-method-246 ((this ashelin)) (when (>= 32768.0 (-> this focus-info bullseye-xz-dist)) (let ((f0-1 (-> this focus-info bullseye-ry))) (return (ashelin-method-243 this f0-1)) @@ -578,7 +572,7 @@ ) ;; definition for method 241 of type ashelin -(defmethod ashelin-method-241 ashelin ((this ashelin)) +(defmethod ashelin-method-241 ((this ashelin)) (let* ((v1-0 (target-pos 0)) (a1-0 (-> this root trans)) (f30-0 (atan (- (-> a1-0 x) (-> v1-0 x)) (- (-> a1-0 z) (-> v1-0 z)))) @@ -626,7 +620,7 @@ ) ;; definition for method 242 of type ashelin -(defmethod ashelin-method-242 ashelin ((this ashelin)) +(defmethod ashelin-method-242 ((this ashelin)) (let ((s5-0 0)) (cond ((zero? (get-rand-int this 2)) @@ -656,7 +650,7 @@ ;; definition for method 240 of type ashelin ;; WARN: Return type mismatch object vs none. -(defmethod ashelin-method-240 ashelin ((this ashelin) (arg0 int)) +(defmethod ashelin-method-240 ((this ashelin) (arg0 int)) (case arg0 ((3) (go (method-of-object this cartwheel-left)) @@ -673,7 +667,7 @@ ;; definition for method 247 of type ashelin ;; INFO: Used lq/sq -(defmethod ashelin-method-247 ashelin ((this ashelin)) +(defmethod ashelin-method-247 ((this ashelin)) (cond ((logtest? (bot-flags bf20) (-> this bot-flags)) (set! (-> this root trans w) 1.0) @@ -712,7 +706,7 @@ ) ;; definition for method 248 of type ashelin -(defmethod ashelin-method-248 ashelin ((this ashelin)) +(defmethod ashelin-method-248 ((this ashelin)) (when (logtest? (bot-flags bf20) (-> this bot-flags)) (set! (-> this root trans w) 1.0) (set! (-> this focus-info bullseye w) 1.0) @@ -732,7 +726,7 @@ ) ;; definition for method 70 of type ashelin -(defmethod go-hostile ashelin ((this ashelin)) +(defmethod go-hostile ((this ashelin)) (bot-method-223 this #t) (cond ((not (bot-method-214 this)) @@ -751,7 +745,7 @@ ) ;; definition for method 72 of type ashelin -(defmethod react-to-focus ashelin ((this ashelin)) +(defmethod react-to-focus ((this ashelin)) "@TODO - flesh out docs" (if (bot-method-214 this) (go-hostile this) @@ -761,7 +755,7 @@ ;; definition for method 239 of type ashelin ;; WARN: Return type mismatch object vs none. -(defmethod ashelin-method-239 ashelin ((this ashelin)) +(defmethod ashelin-method-239 ((this ashelin)) (if (bot-method-214 this) (go (method-of-object this standing-idle)) (go (method-of-object this waiting-idle)) @@ -771,7 +765,7 @@ ;; definition for method 116 of type ashelin ;; WARN: Return type mismatch object vs none. -(defmethod go-idle ashelin ((this ashelin)) +(defmethod go-idle ((this ashelin)) (go (method-of-object this hidden)) (none) ) @@ -779,7 +773,7 @@ ;; definition for method 237 of type ashelin ;; INFO: Used lq/sq ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod fire-projectile ashelin ((this ashelin) (arg0 vector)) +(defmethod fire-projectile ((this ashelin) (arg0 vector)) (set-time! (-> this last-fire-time)) (+! (-> this fired-gun-count) 1) (let ((s4-0 (new 'stack-no-clear 'projectile-init-by-other-params))) @@ -807,7 +801,7 @@ ;; definition for method 249 of type ashelin ;; WARN: Return type mismatch int vs none. -(defmethod ashelin-method-249 ashelin ((this ashelin)) +(defmethod ashelin-method-249 ((this ashelin)) (with-pp (let* ((f30-0 (-> this nav state speed)) (f0-1 (lerp-scale 0.0 2.0 f30-0 12288.0 40960.0)) @@ -935,7 +929,7 @@ ;; definition for method 51 of type ashelin ;; INFO: Used lq/sq -(defmethod enemy-method-51 ashelin ((this ashelin)) +(defmethod enemy-method-51 ((this ashelin)) (local-vars (v1-36 art-element)) (let ((f28-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) @@ -997,7 +991,7 @@ ) ;; definition for method 77 of type ashelin -(defmethod enemy-method-77 ashelin ((this ashelin) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this ashelin) (arg0 (pointer float))) (local-vars (a2-0 int)) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) @@ -1065,7 +1059,7 @@ ) ;; definition for method 78 of type ashelin -(defmethod enemy-method-78 ashelin ((this ashelin) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this ashelin) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((v1-1 *ashelin-global-info*) @@ -1152,7 +1146,7 @@ ) ;; definition for method 79 of type ashelin -(defmethod enemy-method-79 ashelin ((this ashelin) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this ashelin) (arg0 int) (arg1 enemy-knocked-info)) (cond ((= arg0 3) (let ((s5-0 (ja-done? 0))) @@ -1267,7 +1261,7 @@ ;; definition for method 236 of type ashelin ;; INFO: Used lq/sq -(defmethod ashelin-method-236 ashelin ((this ashelin) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) +(defmethod ashelin-method-236 ((this ashelin) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) (local-vars (v1-23 float) (sv-272 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1326,7 +1320,7 @@ ) ;; definition for method 142 of type ashelin -(defmethod nav-enemy-method-142 ashelin ((this ashelin) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this ashelin) (arg0 nav-control)) (if (not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'back-spring) (= v1-3 'cartwheel-left) (= v1-3 'tumble-right)) ) @@ -1339,14 +1333,14 @@ ;; definition for method 216 of type ashelin ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-216 ashelin ((this ashelin)) +(defmethod bot-method-216 ((this ashelin)) (set! (-> this health-handle) (ppointer->handle (process-spawn hud-ashelin :init hud-init-by-other :to this))) 0 (none) ) ;; definition for method 203 of type ashelin -(defmethod play-attacked-speech ashelin ((this ashelin)) +(defmethod play-attacked-speech ((this ashelin)) (local-vars (v1-3 int) (a3-0 int)) (when (not (channel-active? this (the-as uint 0))) (let ((v1-2 0)) @@ -1376,7 +1370,7 @@ ) ;; definition for method 244 of type ashelin -(defmethod ashelin-method-244 ashelin ((this ashelin)) +(defmethod ashelin-method-244 ((this ashelin)) (when (not (channel-active? this (the-as uint 0))) (let ((a1-2 (bot-speech-list-method-9 (-> this ash-course ouch-speeches) @@ -1395,7 +1389,7 @@ ) ;; definition for method 245 of type ashelin -(defmethod ashelin-method-245 ashelin ((this ashelin)) +(defmethod ashelin-method-245 ((this ashelin)) (when (and (not (channel-active? this (the-as uint 0))) (>= (current-time) (-> this victory-speech-time))) (let ((s5-0 (bot-speech-list-method-9 (-> this ash-course victory-speeches) @@ -1417,7 +1411,7 @@ ) ;; definition for method 136 of type ashelin -(defmethod enemy-method-136 ashelin ((this ashelin)) +(defmethod enemy-method-136 ((this ashelin)) (when (time-elapsed? (-> this hit-focus-time) (seconds 2)) (let ((v0-0 (logclear (-> this enemy-flags) (enemy-flag look-at-focus)))) (set! (-> this enemy-flags) v0-0) @@ -1428,7 +1422,7 @@ ;; definition for method 206 of type ashelin ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod play-speech ashelin ((this ashelin) (arg0 int)) +(defmethod play-speech ((this ashelin) (arg0 int)) (let ((t9-0 (method-of-type bot play-speech))) (t9-0 this arg0) ) @@ -1438,7 +1432,7 @@ ;; definition for method 15 of type hud-ashelin ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-ashelin ((this hud-ashelin)) +(defmethod draw ((this hud-ashelin)) (set-hud-piece-position! (-> this sprites 2) (the int (+ 30.0 (* -130.0 (-> this offset)))) @@ -1455,7 +1449,7 @@ ;; definition for method 16 of type hud-ashelin ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-ashelin ((this hud-ashelin)) +(defmethod update-values ((this hud-ashelin)) (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) ((method-of-type hud update-values) this) 0 @@ -1464,7 +1458,7 @@ ;; definition for method 17 of type hud-ashelin ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-ashelin ((this hud-ashelin)) +(defmethod init-callback ((this hud-ashelin)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc index 41e145f24f4..ece4c67884d 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc @@ -3,26 +3,23 @@ ;; definition of type bot-focus-info (deftype bot-focus-info (structure) - ((max-los-dist float :offset-assert 0) - (fproc process-focusable :offset-assert 4) - (bullseye-xz-dist float :offset-assert 8) - (ry-diff float :offset-assert 12) - (my-facing-ry float :offset-assert 16) - (bullseye-ry float :offset-assert 20) - (los int8 :offset-assert 24) - (update-time time-frame :offset-assert 32) - (bullseye vector :inline :offset-assert 48) - (pos vector :inline :offset-assert 64) - (my-facing-xz-dir vector :inline :offset-assert 80) - (bullseye-xz-dir vector :inline :offset-assert 96) + ((max-los-dist float) + (fproc process-focusable) + (bullseye-xz-dist float) + (ry-diff float) + (my-facing-ry float) + (bullseye-ry float) + (los int8) + (update-time time-frame) + (bullseye vector :inline) + (pos vector :inline) + (my-facing-xz-dir vector :inline) + (bullseye-xz-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type bot-focus-info -(defmethod inspect bot-focus-info ((this bot-focus-info)) +(defmethod inspect ((this bot-focus-info)) (when (not this) (set! this this) (goto cfg-4) @@ -46,23 +43,20 @@ ;; definition of type bot-turn-info (deftype bot-turn-info (structure) - ((facing-ry float :offset-assert 0) - (targ-ry float :offset-assert 4) - (ry-diff float :offset-assert 8) - (predicted-ry-diff float :offset-assert 12) - (predicted-targ-ry float :offset-assert 16) - (facing-dir vector :inline :offset-assert 32) - (targ-pos vector :inline :offset-assert 48) - (predicted-targ-pos vector :inline :offset-assert 64) - (src-quat quaternion :inline :offset-assert 80) + ((facing-ry float) + (targ-ry float) + (ry-diff float) + (predicted-ry-diff float) + (predicted-targ-ry float) + (facing-dir vector :inline) + (targ-pos vector :inline) + (predicted-targ-pos vector :inline) + (src-quat quaternion :inline) ) - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type bot-turn-info -(defmethod inspect bot-turn-info ((this bot-turn-info)) +(defmethod inspect ((this bot-turn-info)) (when (not this) (set! this this) (goto cfg-4) @@ -83,18 +77,15 @@ ;; definition of type bot-speech-tuning (deftype bot-speech-tuning (structure) - ((fo-min int32 :offset-assert 0) - (fo-max int32 :offset-assert 4) - (fo-curve int8 :offset-assert 8) - (trans? symbol :offset-assert 12) + ((fo-min int32) + (fo-max int32) + (fo-curve int8) + (trans? symbol) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type bot-speech-tuning -(defmethod inspect bot-speech-tuning ((this bot-speech-tuning)) +(defmethod inspect ((this bot-speech-tuning)) (when (not this) (set! this this) (goto cfg-4) @@ -110,19 +101,16 @@ ;; definition of type bot-speech-info (deftype bot-speech-info (structure) - ((flags speech-flags :offset-assert 0) - (hold-time uint16 :offset-assert 2) - (slave-id int8 :offset-assert 4) - (tuning-id int8 :offset-assert 5) - (name string :offset-assert 8) + ((flags speech-flags) + (hold-time uint16) + (slave-id int8) + (tuning-id int8) + (name string) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type bot-speech-info -(defmethod inspect bot-speech-info ((this bot-speech-info)) +(defmethod inspect ((this bot-speech-info)) (when (not this) (set! this this) (goto cfg-4) @@ -139,20 +127,17 @@ ;; definition of type bot-spot (deftype bot-spot (structure) - ((center vector :inline :offset-assert 0) - (center-x float :offset 0) - (center-y float :offset 4) - (center-z float :offset 8) - (inside-xz-dist float :offset 12) - (blocked-xz-dist float :offset-assert 16) + ((center vector :inline) + (center-x float :overlay-at (-> center data 0)) + (center-y float :overlay-at (-> center data 1)) + (center-z float :overlay-at (-> center data 2)) + (inside-xz-dist float :overlay-at (-> center data 3)) + (blocked-xz-dist float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type bot-spot -(defmethod inspect bot-spot ((this bot-spot)) +(defmethod inspect ((this bot-spot)) (when (not this) (set! this this) (goto cfg-4) @@ -170,23 +155,20 @@ ;; definition of type bot-waypoint (deftype bot-waypoint (basic) - ((waypoint-id int16 :offset-assert 4) - (nav-mesh-index int8 :offset-assert 6) - (skip-to int8 :offset-assert 7) - (on-set (function bot none) :offset-assert 8) - (on-update (function bot none) :offset-assert 12) - (on-skipping-here (function bot none) :offset-assert 16) - (check-too-far symbol :offset-assert 20) - (warn-dist float :offset-assert 24) - (fail-dist-delta float :offset-assert 28) + ((waypoint-id int16) + (nav-mesh-index int8) + (skip-to int8) + (on-set (function bot none)) + (on-update (function bot none)) + (on-skipping-here (function bot none)) + (check-too-far symbol) + (warn-dist float) + (fail-dist-delta float) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type bot-waypoint -(defmethod inspect bot-waypoint ((this bot-waypoint)) +(defmethod inspect ((this bot-waypoint)) (when (not this) (set! this this) (goto cfg-4) @@ -207,27 +189,24 @@ ;; definition of type bot-course (deftype bot-course (basic) - ((course-id uint8 :offset-assert 4) - (speech-count uint16 :offset-assert 6) - (spot-count uint16 :offset-assert 8) - (retry-cookie uint8 :offset-assert 10) - (too-far-warn-speeches bot-speech-list-shuffle :offset-assert 12) - (too-far-fail-speeches bot-speech-list :offset-assert 16) - (attack-player-speeches bot-speech-list :offset-assert 20) - (default-check-too-far symbol :offset-assert 24) - (waypoints (array bot-waypoint) :offset-assert 28) - (speeches (inline-array bot-speech-info) :offset-assert 32) - (speech-tunings (inline-array bot-speech-tuning) :offset-assert 36) - (dirs (inline-array vector) :offset-assert 40) - (spots (inline-array bot-spot) :offset-assert 44) + ((course-id uint8) + (speech-count uint16) + (spot-count uint16) + (retry-cookie uint8) + (too-far-warn-speeches bot-speech-list-shuffle) + (too-far-fail-speeches bot-speech-list) + (attack-player-speeches bot-speech-list) + (default-check-too-far symbol) + (waypoints (array bot-waypoint)) + (speeches (inline-array bot-speech-info)) + (speech-tunings (inline-array bot-speech-tuning)) + (dirs (inline-array vector)) + (spots (inline-array bot-spot)) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type bot-course -(defmethod inspect bot-course ((this bot-course)) +(defmethod inspect ((this bot-course)) (when (not this) (set! this this) (goto cfg-4) @@ -252,116 +231,114 @@ ;; definition of type bot (deftype bot (nav-enemy) - ((bot-flags bot-flags :offset-assert 604) - (min-speed float :offset-assert 608) - (max-speed float :offset-assert 612) - (follow-offset float :offset-assert 616) - (too-far-warn-dist float :offset-assert 620) - (too-far-fail-dist-delta float :offset-assert 624) - (too-far-warn-dist-default float :offset-assert 628) - (too-far-fail-dist-delta-default float :offset-assert 632) - (travel-prev-ry float :offset-assert 636) - (travel-prev-ry1 float :offset-assert 640) - (player-blocking float :offset-assert 644) - (ai-ctrl ai-task-control :offset-assert 648) - (course bot-course :offset-assert 652) - (waypoint bot-waypoint :offset-assert 656) - (waypoint-bits waypoint-bits :offset-assert 660) - (waypoint-int32a int32 :offset-assert 664) - (bot-task-bits bot-task-bits :offset-assert 668) - (hit-invuln-ignore-me-delay uint32 :offset-assert 672) - (hit-invuln-focus-disable-delay uint32 :offset-assert 676) - (warn-to-fail-timeout uint32 :offset-assert 680) - (warn-min-delay uint32 :offset-assert 684) - (warn-max-delay uint32 :offset-assert 688) - (spot-color uint32 :offset-assert 692) - (waypoint-request int16 :offset-assert 696) - (hit-by-enemy-count uint16 :offset-assert 698) - (hit-by-player-count uint16 :offset-assert 700) - (notice-enemy-dist float :offset-assert 704) - (channel uint8 :offset-assert 708) - (focus-mode int8 :offset-assert 709) - (nav-mesh-index int8 :offset-assert 710) - (delay-too-far-check int8 :offset-assert 711) - (slave-id int8 :offset-assert 712) - (vehicle-seat-index int8 :offset-assert 713) - (bot-health-index int8 :offset-assert 714) - (task game-task-control :offset-assert 716) - (swivel-joint-mod joint-mod :offset-assert 720) - (health-handle handle :offset-assert 728) - (poi-handle handle :offset-assert 736) - (my-simple-focus (pointer simple-focus) :offset-assert 744) - (attacker-handle handle :offset-assert 752) - (scene-player-handle handle :offset-assert 760) - (master-handle handle :offset-assert 768) - (vehicle-handle handle :offset-assert 776) - (hit-invuln-starting-time time-frame :offset-assert 784) - (danger-time time-frame :offset-assert 792) - (attacker-time time-frame :offset-assert 800) - (started-warning-time time-frame :offset-assert 808) - (waypoint-time0 time-frame :offset-assert 816) - (next-too-far-warn-time time-frame :offset-assert 824) - (spot bot-spot :inline :offset-assert 832) - (follow-dir vector :inline :offset-assert 864) - (focus-info bot-focus-info :inline :offset-assert 880) + ((bot-flags bot-flags) + (min-speed float) + (max-speed float) + (follow-offset float) + (too-far-warn-dist float) + (too-far-fail-dist-delta float) + (too-far-warn-dist-default float) + (too-far-fail-dist-delta-default float) + (travel-prev-ry float) + (travel-prev-ry1 float) + (player-blocking float) + (ai-ctrl ai-task-control) + (course bot-course) + (waypoint bot-waypoint) + (waypoint-bits waypoint-bits) + (waypoint-int32a int32) + (bot-task-bits bot-task-bits) + (hit-invuln-ignore-me-delay uint32) + (hit-invuln-focus-disable-delay uint32) + (warn-to-fail-timeout uint32) + (warn-min-delay uint32) + (warn-max-delay uint32) + (spot-color uint32) + (waypoint-request int16) + (hit-by-enemy-count uint16) + (hit-by-player-count uint16) + (notice-enemy-dist float) + (channel uint8) + (focus-mode int8) + (nav-mesh-index int8) + (delay-too-far-check int8) + (slave-id int8) + (vehicle-seat-index int8) + (bot-health-index int8) + (task game-task-control) + (swivel-joint-mod joint-mod) + (health-handle handle) + (poi-handle handle) + (my-simple-focus (pointer simple-focus)) + (attacker-handle handle) + (scene-player-handle handle) + (master-handle handle) + (vehicle-handle handle) + (hit-invuln-starting-time time-frame) + (danger-time time-frame) + (attacker-time time-frame) + (started-warning-time time-frame) + (waypoint-time0 time-frame) + (next-too-far-warn-time time-frame) + (spot bot-spot :inline) + (follow-dir vector :inline) + (focus-info bot-focus-info :inline) ) - :heap-base #x360 - :method-count-assert 225 - :size-assert #x3e0 - :flag-assert #xe1036003e0 + (:state-methods + failed + hidden + ) (:methods - (failed () _type_ :state 178) - (hidden () _type_ :state 179) - (clear-poi-and-focus! (_type_) none 180) - (bot-method-181 (_type_ vector vector vector vector vector float) none 181) - (turn-to-target (_type_ bot-turn-info process-focusable float) none 182) - (alive? (_type_) symbol 183) - (bot-debug-draw-spot-id (_type_) none 184) - (bot-debug-draw-sphere (_type_ vector rgba) none 185) - (bot-debug-draw-spot-sphere (_type_ int (pointer uint) int) none 186) - (reset-attacker! (_type_) none 187) - (scene-release? (_type_) symbol 188) - (select-focus! (_type_) process 189) - (bot-method-190 (_type_) symbol 190) - (bot-method-191 (_type_) none 191) - (bot-method-192 (_type_) none 192) - (bot-method-193 (_type_) symbol 193) - (outside-spot-radius? (_type_ bot-spot vector symbol) symbol 194) - (attacked-by-player? (_type_ process-focusable) symbol 195) - (bot-method-196 (_type_) none 196) - (fail-mission! (_type_) none 197) - (set-cam-height! (_type_ vector) meters 198) - (cam-move-to-bot (_type_) none 199) - (fail-falling (_type_) none 200) - (set-next-focus! (_type_ enemy enemy-best-focus) none 201) - (choose-spot (_type_ int (pointer uint)) int 202) - (play-attacked-speech (_type_) none 203) - (play-too-far-warn-speech (_type_) symbol 204) - (scene-play (_type_ string symbol) symbol 205) - (play-speech (_type_ int) none 206) - (play-death-sound (_type_ string) none 207) - (bot-method-208 (_type_) symbol 208) - (channel-active? (_type_ uint) symbol 209) - (init! (_type_) none 210) - (clear-speech-flags! (_type_) none 211) - (reset-warn-time! (_type_) none 212) - (go-to-waypoint! (_type_ int symbol) object 213) - (bot-method-214 (_type_) symbol 214) - (skip-waypoint (_type_) none 215) - (bot-method-216 (_type_) none 216) - (speech-ended? (_type_ int) symbol 217) - (speech-playing? (_type_ int) symbol 218) - (player-blocking-spot? (_type_ bot-spot) symbol 219) - (stop-speech (_type_ uint symbol) none 220) - (bot-method-221 (_type_) quaternion 221) - (bot-method-222 (_type_ vector) none 222) - (bot-method-223 (_type_ symbol) none 223) - (bot-check-too-far (_type_) symbol 224) + (clear-poi-and-focus! (_type_) none) + (bot-method-181 (_type_ vector vector vector vector vector float) none) + (turn-to-target (_type_ bot-turn-info process-focusable float) none) + (alive? (_type_) symbol) + (bot-debug-draw-spot-id (_type_) none) + (bot-debug-draw-sphere (_type_ vector rgba) none) + (bot-debug-draw-spot-sphere (_type_ int (pointer uint) int) none) + (reset-attacker! (_type_) none) + (scene-release? (_type_) symbol) + (select-focus! (_type_) process) + (bot-method-190 (_type_) symbol) + (bot-method-191 (_type_) none) + (bot-method-192 (_type_) none) + (bot-method-193 (_type_) symbol) + (outside-spot-radius? (_type_ bot-spot vector symbol) symbol) + (attacked-by-player? (_type_ process-focusable) symbol) + (bot-method-196 (_type_) none) + (fail-mission! (_type_) none) + (set-cam-height! (_type_ vector) meters) + (cam-move-to-bot (_type_) none) + (fail-falling (_type_) none) + (set-next-focus! (_type_ enemy enemy-best-focus) none) + (choose-spot (_type_ int (pointer uint)) int) + (play-attacked-speech (_type_) none) + (play-too-far-warn-speech (_type_) symbol) + (scene-play (_type_ string symbol) symbol) + (play-speech (_type_ int) none) + (play-death-sound (_type_ string) none) + (bot-method-208 (_type_) symbol) + (channel-active? (_type_ uint) symbol) + (init! (_type_) none) + (clear-speech-flags! (_type_) none) + (reset-warn-time! (_type_) none) + (go-to-waypoint! (_type_ int symbol) object) + (bot-method-214 (_type_) symbol) + (skip-waypoint (_type_) none) + (bot-method-216 (_type_) none) + (speech-ended? (_type_ int) symbol) + (speech-playing? (_type_ int) symbol) + (player-blocking-spot? (_type_ bot-spot) symbol) + (stop-speech (_type_ uint symbol) none) + (bot-method-221 (_type_) quaternion) + (bot-method-222 (_type_ vector) none) + (bot-method-223 (_type_ symbol) none) + (bot-check-too-far (_type_) symbol) ) ) ;; definition for method 3 of type bot -(defmethod inspect bot ((this bot)) +(defmethod inspect ((this bot)) (when (not this) (set! this this) (goto cfg-4) @@ -679,22 +656,19 @@ ;; definition of type bot-speech-list (deftype bot-speech-list (basic) - ((flags uint8 :offset-assert 4) - (retry-cookie uint8 :offset-assert 5) - (last-local-index int16 :offset-assert 6) - (speech-indexes (array int16) :offset-assert 8) + ((flags uint8) + (retry-cookie uint8) + (last-local-index int16) + (speech-indexes (array int16)) ) - :method-count-assert 11 - :size-assert #xc - :flag-assert #xb0000000c (:methods - (bot-speech-list-method-9 (_type_ bot (inline-array bot-speech-info) speech-flags) int 9) - (reset-index (_type_ symbol) none 10) + (bot-speech-list-method-9 (_type_ bot (inline-array bot-speech-info) speech-flags) int) + (reset-index (_type_ symbol) none) ) ) ;; definition for method 3 of type bot-speech-list -(defmethod inspect bot-speech-list ((this bot-speech-list)) +(defmethod inspect ((this bot-speech-list)) (when (not this) (set! this this) (goto cfg-4) @@ -710,7 +684,7 @@ ;; definition for method 10 of type bot-speech-list ;; WARN: Return type mismatch int vs none. -(defmethod reset-index bot-speech-list ((this bot-speech-list) (arg0 symbol)) +(defmethod reset-index ((this bot-speech-list) (arg0 symbol)) (if arg0 (logand! (-> this flags) -2) ) @@ -720,7 +694,7 @@ ;; definition for method 9 of type bot-speech-list ;; WARN: new jak 2 until loop case, check carefully -(defmethod bot-speech-list-method-9 bot-speech-list ((sp-list bot-speech-list) (bot bot) (sp-info (inline-array bot-speech-info)) (arg3 speech-flags)) +(defmethod bot-speech-list-method-9 ((sp-list bot-speech-list) (bot bot) (sp-info (inline-array bot-speech-info)) (arg3 speech-flags)) (let ((v1-1 (-> bot course retry-cookie))) (when (!= v1-1 (-> sp-list retry-cookie)) (set! (-> sp-list retry-cookie) (-> bot course retry-cookie)) @@ -769,16 +743,13 @@ ;; definition of type bot-speech-list-shuffle (deftype bot-speech-list-shuffle (bot-speech-list) - ((history-mask uint64 :offset-assert 16) - (history-mask-full uint64 :offset-assert 24) + ((history-mask uint64) + (history-mask-full uint64) ) - :method-count-assert 11 - :size-assert #x20 - :flag-assert #xb00000020 ) ;; definition for method 3 of type bot-speech-list-shuffle -(defmethod inspect bot-speech-list-shuffle ((this bot-speech-list-shuffle)) +(defmethod inspect ((this bot-speech-list-shuffle)) (when (not this) (set! this this) (goto cfg-4) @@ -796,7 +767,7 @@ ;; definition for method 10 of type bot-speech-list-shuffle ;; WARN: Return type mismatch int vs none. -(defmethod reset-index bot-speech-list-shuffle ((this bot-speech-list-shuffle) (arg0 symbol)) +(defmethod reset-index ((this bot-speech-list-shuffle) (arg0 symbol)) (let ((t9-0 (method-of-type bot-speech-list reset-index))) (t9-0 this arg0) ) @@ -834,7 +805,7 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: new jak 2 until loop case, check carefully -(defmethod bot-speech-list-method-9 bot-speech-list-shuffle ((this bot-speech-list-shuffle) (bot bot) (sp-info (inline-array bot-speech-info)) (sp-flags speech-flags)) +(defmethod bot-speech-list-method-9 ((this bot-speech-list-shuffle) (bot bot) (sp-info (inline-array bot-speech-info)) (sp-flags speech-flags)) (local-vars (sv-16 int)) (let ((course-cookie (-> bot course retry-cookie))) (when (!= course-cookie (-> this retry-cookie)) @@ -889,15 +860,12 @@ ;; definition of type bot-course-table (deftype bot-course-table (basic) - ((course bot-course 18 :offset-assert 4) + ((course bot-course 18) ) - :method-count-assert 9 - :size-assert #x4c - :flag-assert #x90000004c ) ;; definition for method 3 of type bot-course-table -(defmethod inspect bot-course-table ((this bot-course-table)) +(defmethod inspect ((this bot-course-table)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc index f6dc0427b7b..1431b334542 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc @@ -2,20 +2,20 @@ (in-package goal) ;; definition for method 12 of type bot -(defmethod run-logic? bot ((this bot)) +(defmethod run-logic? ((this bot)) #t ) ;; definition for method 185 of type bot ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-debug-draw-sphere bot ((this bot) (arg0 vector) (arg1 rgba)) +(defmethod bot-debug-draw-sphere ((this bot) (arg0 vector) (arg1 rgba)) (add-debug-sphere #t (bucket-id debug2) (the-as vector (&-> arg0 x)) (-> arg0 w) arg1) (none) ) ;; definition for method 186 of type bot ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-debug-draw-spot-sphere bot ((this bot) (arg0 int) (arg1 (pointer uint)) (arg2 int)) +(defmethod bot-debug-draw-spot-sphere ((this bot) (arg0 int) (arg1 (pointer uint)) (arg2 int)) (let* ((s2-0 (-> this spot-color)) (s1-0 s2-0) ) @@ -42,7 +42,7 @@ ;; definition for method 184 of type bot ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-debug-draw-spot-id bot ((this bot)) +(defmethod bot-debug-draw-spot-id ((this bot)) (let ((course (-> this course))) (countdown (i (-> course spot-count)) (let ((spot (-> course spots i))) @@ -65,7 +65,7 @@ ) ;; definition for method 194 of type bot -(defmethod outside-spot-radius? bot ((this bot) (spot bot-spot) (bot-trans vector) (arg3 symbol)) +(defmethod outside-spot-radius? ((this bot) (spot bot-spot) (bot-trans vector) (arg3 symbol)) "Are we outside of the given [[bot-spot]] radius?" (if (not spot) (set! spot (-> this spot)) @@ -82,14 +82,14 @@ ) ;; definition for method 219 of type bot -(defmethod player-blocking-spot? bot ((this bot) (spot bot-spot)) +(defmethod player-blocking-spot? ((this bot) (spot bot-spot)) (let ((f0-0 (-> spot blocked-xz-dist))) (and (!= f0-0 0.0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> spot center)))) ) ) ;; definition for method 202 of type bot -(defmethod choose-spot bot ((this bot) (num-spots int) (spot-indices (pointer uint))) +(defmethod choose-spot ((this bot) (num-spots int) (spot-indices (pointer uint))) "Choose the closest [[bot-spot]] that is not blocked by the player." (let ((spot-idx 0)) (let ((f30-0 -1.0) @@ -113,13 +113,13 @@ ) ;; definition for method 108 of type bot -(defmethod enemy-method-108 bot ((this bot) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 ((this bot) (arg0 enemy) (arg1 event-message-block)) 0 ) ;; definition for method 187 of type bot ;; WARN: Return type mismatch symbol vs none. -(defmethod reset-attacker! bot ((this bot)) +(defmethod reset-attacker! ((this bot)) (logclear! (-> this bot-flags) (bot-flags attacked)) (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-5 (if (type? s5-0 process-focusable) @@ -135,7 +135,7 @@ ) ;; definition for method 193 of type bot -(defmethod bot-method-193 bot ((this bot)) +(defmethod bot-method-193 ((this bot)) (let ((gp-0 #f)) (let ((v1-0 (-> this incoming penetrate-using))) (cond @@ -168,7 +168,7 @@ ;; definition for method 190 of type bot ;; INFO: Used lq/sq -(defmethod bot-method-190 bot ((this bot)) +(defmethod bot-method-190 ((this bot)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -303,7 +303,7 @@ ;; definition for method 106 of type bot ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-106 bot ((this bot) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 ((this bot) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) (t9-0 this arg0 arg1 arg2 arg3) ) @@ -356,7 +356,7 @@ ) ;; definition for method 56 of type bot -(defmethod damage-amount-from-attack bot ((this bot) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this bot) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let* ((t9-0 (method-of-type nav-enemy damage-amount-from-attack)) (v0-0 (t9-0 this arg0 arg1)) @@ -383,7 +383,7 @@ ) ;; definition for method 58 of type bot -(defmethod enemy-method-58 bot ((this bot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 ((this bot) (arg0 process) (arg1 event-message-block)) (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) (v0-0 (t9-0 this arg0 arg1)) ) @@ -395,7 +395,7 @@ ) ;; definition for method 180 of type bot -(defmethod clear-poi-and-focus! bot ((this bot)) +(defmethod clear-poi-and-focus! ((this bot)) "Clear our point of interest and focus handles." (let* ((s4-0 (handle->process (-> this poi-handle))) (s5-0 (if (type? s4-0 process-focusable) @@ -421,7 +421,7 @@ ;; definition for method 195 of type bot ;; WARN: Return type mismatch object vs symbol. -(defmethod attacked-by-player? bot ((this bot) (fproc process-focusable)) +(defmethod attacked-by-player? ((this bot) (fproc process-focusable)) "Were we attacked by the player?" (the-as symbol @@ -435,7 +435,7 @@ ;; definition for method 57 of type bot ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! bot ((this bot) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod update-target-awareness! ((this bot) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! @TODO - flesh out docs @returns the value that sets `aware`" @@ -443,13 +443,13 @@ ) ;; definition for method 61 of type bot -(defmethod enemy-method-61 bot ((this bot) (arg0 int)) +(defmethod enemy-method-61 ((this bot) (arg0 int)) 3 ) ;; definition for method 129 of type bot ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-129 bot ((this bot)) +(defmethod enemy-method-129 ((this bot)) (local-vars (s5-1 process)) (let ((s5-0 (-> this focus))) (cond @@ -480,7 +480,7 @@ ) ;; definition for method 97 of type bot -(defmethod enemy-method-97 bot ((this bot)) +(defmethod enemy-method-97 ((this bot)) (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 @@ -582,7 +582,7 @@ ;; definition for method 189 of type bot ;; INFO: Used lq/sq -(defmethod select-focus! bot ((this bot)) +(defmethod select-focus! ((this bot)) "Find enemies around our `notice-enemy-dist` and choose a target." (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) @@ -715,7 +715,7 @@ ;; definition for method 201 of type bot ;; WARN: Return type mismatch enemy vs none. -(defmethod set-next-focus! bot ((this bot) (enemy enemy) (arg2 enemy-best-focus)) +(defmethod set-next-focus! ((this bot) (enemy enemy) (arg2 enemy-best-focus)) (let ((enemy-dist (new 'stack-no-clear 'vector))) (vector-! enemy-dist (-> enemy root trans) (-> this root trans)) (let ((rating (vector-length enemy-dist))) @@ -732,14 +732,14 @@ ) ;; definition for method 183 of type bot -(defmethod alive? bot ((this bot)) +(defmethod alive? ((this bot)) (and (not (focus-test? this dead grabbed)) (nonzero? (-> this hit-points)) (zero? (-> this fated-time))) ) ;; definition for method 74 of type bot ;; INFO: Used lq/sq ;; WARN: disable def twice: 280. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler bot ((this bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v0-0 object)) @@ -942,7 +942,7 @@ ) ;; definition for method 104 of type bot -(defmethod enemy-method-104 bot ((this bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ((this bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (cond ((and (= (-> arg0 type) target) (not (logtest? (-> this bot-flags) (bot-flags attacked)))) (when (send-event @@ -973,7 +973,7 @@ ;; definition for method 76 of type bot ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 bot ((this bot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 ((this bot) (arg0 process) (arg1 event-message-block)) (the-as symbol (cond @@ -1048,7 +1048,7 @@ ) ;; definition for method 204 of type bot -(defmethod play-too-far-warn-speech bot ((this bot)) +(defmethod play-too-far-warn-speech ((this bot)) (when (not (channel-active? this (the-as uint 0))) (let ((idx (bot-speech-list-method-9 (-> this course too-far-warn-speeches) @@ -1075,7 +1075,7 @@ ;; definition for method 224 of type bot ;; WARN: Using new Jak 2 rtype-of -(defmethod bot-check-too-far bot ((this bot)) +(defmethod bot-check-too-far ((this bot)) "Call the current [[bot-waypoint]]'s `check-too-far` function if available, otherwise use the default `course` one. If the player is too far, play a warning speech." (let ((result 0)) @@ -1133,7 +1133,7 @@ If the player is too far, play a warning speech." ;; definition for method 212 of type bot ;; WARN: Return type mismatch time-frame vs none. -(defmethod reset-warn-time! bot ((this bot)) +(defmethod reset-warn-time! ((this bot)) (set! (-> this started-warning-time) 0) (set! (-> this next-too-far-warn-time) (+ (current-time) @@ -1144,7 +1144,7 @@ If the player is too far, play a warning speech." ) ;; definition for method 55 of type bot -(defmethod track-target! bot ((this bot)) +(defmethod track-target! ((this bot)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1203,7 +1203,7 @@ If the player is too far, play a warning speech." ) ;; definition for method 205 of type bot -(defmethod scene-play bot ((this bot) (scene string) (grab? symbol)) +(defmethod scene-play ((this bot) (scene string) (grab? symbol)) "Spawn a [[scene-player]] process for the given scene." (when (and (process-grab? this #t) (or grab? (process-grab? *target* #t))) (process-grab? this #f) @@ -1218,7 +1218,7 @@ If the player is too far, play a warning speech." ) ;; definition for method 188 of type bot -(defmethod scene-release? bot ((this bot)) +(defmethod scene-release? ((this bot)) (when (not (handle->process (-> this scene-player-handle))) (process-release? this) #t @@ -1227,7 +1227,7 @@ If the player is too far, play a warning speech." ;; definition for method 211 of type bot ;; WARN: Return type mismatch symbol vs none. -(defmethod clear-speech-flags! bot ((this bot)) +(defmethod clear-speech-flags! ((this bot)) "Clear the `playing` flag for all of our speeches." (let ((speeches (-> this course speeches))) (countdown (i (-> this course speech-count)) @@ -1241,7 +1241,7 @@ If the player is too far, play a warning speech." ;; definition for method 206 of type bot ;; WARN: Return type mismatch gui-connection vs none. -(defmethod play-speech bot ((this bot) (idx int)) +(defmethod play-speech ((this bot) (idx int)) (let* ((course (-> this course)) (speech (-> course speeches idx)) ) @@ -1275,7 +1275,7 @@ If the player is too far, play a warning speech." ;; definition for method 207 of type bot ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-death-sound bot ((this bot) (sound string)) +(defmethod play-death-sound ((this bot) (sound string)) "Play one of our death sounds." (add-process *gui-control* @@ -1290,7 +1290,7 @@ If the player is too far, play a warning speech." ) ;; definition for method 217 of type bot -(defmethod speech-ended? bot ((this bot) (idx int)) +(defmethod speech-ended? ((this bot) (idx int)) "Is the given speech active?" (let ((speech (-> this course speeches idx))) (= (get-status @@ -1303,7 +1303,7 @@ If the player is too far, play a warning speech." ) ;; definition for method 218 of type bot -(defmethod speech-playing? bot ((this bot) (idx int)) +(defmethod speech-playing? ((this bot) (idx int)) "Is the given speech playing?" (let ((v1-2 (-> this course speeches idx))) (logtest? (-> v1-2 flags) (speech-flags playing)) @@ -1311,7 +1311,7 @@ If the player is too far, play a warning speech." ) ;; definition for method 209 of type bot -(defmethod channel-active? bot ((this bot) (channel uint)) +(defmethod channel-active? ((this bot) (channel uint)) "Is the given [[gui-channel]] active?" (if (zero? channel) (set! channel (-> this channel)) @@ -1325,7 +1325,7 @@ If the player is too far, play a warning speech." ;; definition for method 220 of type bot ;; WARN: Return type mismatch int vs none. -(defmethod stop-speech bot ((this bot) (channel uint) (arg1 symbol)) +(defmethod stop-speech ((this bot) (channel uint) (arg1 symbol)) (if (zero? channel) (set! channel (-> this channel)) ) @@ -1369,7 +1369,7 @@ If the player is too far, play a warning speech." ) ;; definition for method 213 of type bot -(defmethod go-to-waypoint! bot ((this bot) (id int) (skipped? symbol)) +(defmethod go-to-waypoint! ((this bot) (id int) (skipped? symbol)) "Start moving to the given [[bot-waypoint]]." (let* ((course (-> this course)) (waypoint-count (-> course waypoints length)) @@ -1411,7 +1411,7 @@ If the player is too far, play a warning speech." ;; definition for method 215 of type bot ;; WARN: Return type mismatch object vs none. -(defmethod skip-waypoint bot ((this bot)) +(defmethod skip-waypoint ((this bot)) (let ((skip-id (-> this waypoint skip-to))) (when (>= skip-id 0) (stop-speech this (the-as uint 0) #f) @@ -1424,7 +1424,7 @@ If the player is too far, play a warning speech." ;; definition for method 7 of type bot ;; WARN: Return type mismatch nav-enemy vs bot. -(defmethod relocate bot ((this bot) (arg0 int)) +(defmethod relocate ((this bot) (arg0 int)) (if (nonzero? (-> this ai-ctrl)) (&+! (-> this ai-ctrl) arg0) ) @@ -1438,7 +1438,7 @@ If the player is too far, play a warning speech." ) ;; definition for method 10 of type bot -(defmethod deactivate bot ((this bot)) +(defmethod deactivate ((this bot)) (send-event (handle->process (-> this health-handle)) 'hide-and-die) (if (nonzero? (-> this ai-ctrl)) (ai-task-control-method-9 (-> this ai-ctrl)) @@ -1449,7 +1449,7 @@ If the player is too far, play a warning speech." ;; definition for method 210 of type bot ;; WARN: Return type mismatch int vs none. -(defmethod init! bot ((this bot)) +(defmethod init! ((this bot)) "Set defaults for various fields." (set! (-> this master-handle) (the-as handle #f)) (set! (-> this health-handle) (the-as handle #f)) @@ -1477,7 +1477,7 @@ If the player is too far, play a warning speech." ;; definition for method 115 of type bot ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! bot ((this bot)) +(defmethod init-enemy! ((this bot)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (process-entity-status! this (entity-perm-status bit-4) #t) (set! (-> this ai-ctrl) (new 'process 'ai-task-control *bot-task-pool*)) @@ -1523,7 +1523,7 @@ If the player is too far, play a warning speech." ;; definition for method 214 of type bot ;; WARN: Return type mismatch object vs symbol. -(defmethod bot-method-214 bot ((this bot)) +(defmethod bot-method-214 ((this bot)) (the-as symbol (when (logtest? (-> this bot-flags) (bot-flags bf00)) (let ((fproc (handle->process (-> this focus handle)))) (and fproc @@ -1539,7 +1539,7 @@ If the player is too far, play a warning speech." ;; definition for method 223 of type bot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-223 bot ((this bot) (arg0 symbol)) +(defmethod bot-method-223 ((this bot) (arg0 symbol)) (let ((focus (-> this focus-info)) (timer (current-time)) (focus-proc (handle->process (-> this focus handle))) @@ -1625,7 +1625,7 @@ If the player is too far, play a warning speech." ;; definition for method 182 of type bot ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod turn-to-target bot ((this bot) (turn-info bot-turn-info) (proc process-focusable) (arg3 float)) +(defmethod turn-to-target ((this bot) (turn-info bot-turn-info) (proc process-focusable) (arg3 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1670,7 +1670,7 @@ If the player is too far, play a warning speech." ) ;; definition for method 208 of type bot -(defmethod bot-method-208 bot ((this bot)) +(defmethod bot-method-208 ((this bot)) (let ((s5-0 #f)) (when *target* (let ((target-trans (-> *target* control trans)) @@ -1703,7 +1703,7 @@ If the player is too far, play a warning speech." ;; definition for method 82 of type bot ;; INFO: Used lq/sq -(defmethod enemy-method-82 bot ((this bot) (arg0 enemy-jump-info)) +(defmethod enemy-method-82 ((this bot) (arg0 enemy-jump-info)) "@abstract" (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) @@ -1715,7 +1715,7 @@ If the player is too far, play a warning speech." ;; definition for method 222 of type bot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-222 bot ((this bot) (arg0 vector)) +(defmethod bot-method-222 ((this bot) (arg0 vector)) (let ((s1-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) (v1-0 (new 'stack-no-clear 'vector)) @@ -1748,7 +1748,7 @@ If the player is too far, play a warning speech." ) ;; definition for method 221 of type bot -(defmethod bot-method-221 bot ((this bot)) +(defmethod bot-method-221 ((this bot)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-identity! gp-0) (quaternion-pseudo-seek @@ -1761,7 +1761,7 @@ If the player is too far, play a warning speech." ) ;; definition for method 203 of type bot -(defmethod play-attacked-speech bot ((this bot)) +(defmethod play-attacked-speech ((this bot)) (when (not (channel-active? this (the-as uint 0))) (let ((idx (bot-speech-list-method-9 (-> this course attack-player-speeches) @@ -1781,14 +1781,14 @@ If the player is too far, play a warning speech." ;; definition for method 196 of type bot ;; WARN: Return type mismatch bot-flags vs none. -(defmethod bot-method-196 bot ((this bot)) +(defmethod bot-method-196 ((this bot)) (logior! (-> this bot-flags) (bot-flags too-far-fail)) (none) ) ;; definition for method 197 of type bot ;; WARN: Return type mismatch bot-flags vs none. -(defmethod fail-mission! bot ((this bot)) +(defmethod fail-mission! ((this bot)) (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) (logclear! (-> this mask) (process-mask collectable)) (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) @@ -1827,7 +1827,7 @@ If the player is too far, play a warning speech." ) ;; definition for method 200 of type bot -(defmethod fail-falling bot ((this bot)) +(defmethod fail-falling ((this bot)) (if (logtest? (-> this bot-flags) (bot-flags failed)) (cam-move-to-bot this) ) @@ -1836,7 +1836,7 @@ If the player is too far, play a warning speech." ;; definition for method 199 of type bot ;; WARN: Return type mismatch object vs none. -(defmethod cam-move-to-bot bot ((this bot)) +(defmethod cam-move-to-bot ((this bot)) (cond ((logtest? (-> this bot-flags) (bot-flags bf13)) (logclear! (-> this bot-flags) (bot-flags bf13)) @@ -1867,7 +1867,7 @@ If the player is too far, play a warning speech." ;; definition for method 198 of type bot ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! bot ((this bot) (arg0 vector)) +(defmethod set-cam-height! ((this bot) (arg0 vector)) (set-vector! arg0 0.0 12288.0 28672.0 1.0) (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) (the-as @@ -1880,7 +1880,7 @@ If the player is too far, play a warning speech." ;; definition for method 191 of type bot ;; WARN: Return type mismatch focus-status vs none. -(defmethod bot-method-191 bot ((this bot)) +(defmethod bot-method-191 ((this bot)) (logior! (-> this bot-flags) (bot-flags bf02)) (set-time! (-> this hit-invuln-starting-time)) (logclear! (-> this enemy-flags) (enemy-flag enable-on-active)) @@ -1895,7 +1895,7 @@ If the player is too far, play a warning speech." ;; definition for method 192 of type bot ;; WARN: Return type mismatch bot-flags vs none. -(defmethod bot-method-192 bot ((this bot)) +(defmethod bot-method-192 ((this bot)) (local-vars (a2-7 enemy-flag)) (let ((a1-0 (-> this hit-invuln-starting-time)) (v1-0 #t) @@ -1951,20 +1951,20 @@ If the player is too far, play a warning speech." ;; definition for method 216 of type bot ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-216 bot ((this bot)) +(defmethod bot-method-216 ((this bot)) 0 (none) ) ;; definition for method 60 of type bot -(defmethod coin-flip? bot ((this bot)) +(defmethod coin-flip? ((this bot)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 181 of type bot ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-181 bot ((this bot) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) +(defmethod bot-method-181 ((this bot) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) diff --git a/test/decompiler/reference/jak2/levels/common/ai/halt/hal-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/halt/hal-h_REF.gc index bcd55007954..d42f92f3cfb 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/halt/hal-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/halt/hal-h_REF.gc @@ -3,21 +3,17 @@ ;; definition of type hal (deftype hal (bot) - ((handle-failed-slave-id int8 :offset-assert 992) - (slave-handle handle 3 :offset-assert 1000) + ((handle-failed-slave-id int8) + (slave-handle handle 3) ) - :heap-base #x380 - :method-count-assert 227 - :size-assert #x400 - :flag-assert #xe303800400 (:methods - (hal-method-225 (_type_) symbol 225) - (hal-method-226 (_type_) symbol 226) + (hal-method-225 (_type_) symbol) + (hal-method-226 (_type_) symbol) ) ) ;; definition for method 3 of type hal -(defmethod inspect hal ((this hal)) +(defmethod inspect ((this hal)) (when (not this) (set! this this) (goto cfg-4) @@ -33,18 +29,15 @@ ;; definition of type halt-wait-spot (deftype halt-wait-spot (ai-task) - ((check-done (function halt-wait-spot hal symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function halt-wait-spot hal symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type halt-wait-spot -(defmethod inspect halt-wait-spot ((this halt-wait-spot)) +(defmethod inspect ((this halt-wait-spot)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/common/ai/halt/hal-task_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/halt/hal-task_REF.gc index c35ac014bd1..d86f24c8bd2 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/halt/hal-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/halt/hal-task_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type halt-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! halt-wait-spot ((this halt-wait-spot)) +(defmethod reset-task! ((this halt-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) 0) (set! (-> this num-spots) (the-as uint 1)) @@ -13,7 +13,7 @@ ;; definition for method 11 of type halt-wait-spot ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 halt-wait-spot ((this halt-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this halt-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere diff --git a/test/decompiler/reference/jak2/levels/common/ai/halt/hal_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/halt/hal_REF.gc index 8f01ec40cff..1903d6a7b7f 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/halt/hal_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/halt/hal_REF.gc @@ -134,7 +134,7 @@ ) ;; definition for method 220 of type hal -(defmethod stop-speech hal ((this hal) (arg0 uint) (arg1 symbol)) +(defmethod stop-speech ((this hal) (arg0 uint) (arg1 symbol)) (cond ((zero? arg0) (let ((t9-0 (method-of-type bot stop-speech))) @@ -159,7 +159,7 @@ ;; definition for method 206 of type hal ;; WARN: Return type mismatch gui-connection vs none. -(defmethod play-speech hal ((this hal) (arg0 int)) +(defmethod play-speech ((this hal) (arg0 int)) (let ((v1-2 (-> this course speeches arg0))) (logior! (-> v1-2 flags) (speech-flags playing)) (let ((a1-4 (-> v1-2 slave-id)) @@ -205,7 +205,7 @@ ) ;; definition for method 209 of type hal -(defmethod channel-active? hal ((this hal) (arg0 uint)) +(defmethod channel-active? ((this hal) (arg0 uint)) "Is the given [[gui-channel]] active?" (cond ((zero? arg0) @@ -234,7 +234,7 @@ ) ;; definition for method 226 of type hal -(defmethod hal-method-226 hal ((this hal)) +(defmethod hal-method-226 ((this hal)) (countdown (s5-0 3) (let ((a0-2 (handle->process (-> this slave-handle s5-0)))) (when a0-2 @@ -248,7 +248,7 @@ ) ;; definition for method 225 of type hal -(defmethod hal-method-225 hal ((this hal)) +(defmethod hal-method-225 ((this hal)) (countdown (v1-0 3) (if (handle->process (-> this slave-handle v1-0)) (return #f) @@ -259,7 +259,7 @@ ;; definition for method 196 of type hal ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-method-196 hal ((this hal)) +(defmethod bot-method-196 ((this hal)) (when (not (logtest? (-> this bot-flags) (bot-flags too-far-fail))) (let ((t9-0 (method-of-type bot bot-method-196))) (t9-0 this) @@ -277,7 +277,7 @@ ;; definition for method 114 of type hal ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! hal ((this hal)) +(defmethod init-enemy-collision! ((this hal)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -304,7 +304,7 @@ ;; definition for method 210 of type hal ;; WARN: Return type mismatch int vs none. -(defmethod init! hal ((this hal)) +(defmethod init! ((this hal)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) (t9-0 this) @@ -320,7 +320,7 @@ ;; definition for method 115 of type hal ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! hal ((this hal)) +(defmethod init-enemy! ((this hal)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (initialize-skeleton @@ -352,7 +352,7 @@ ) ;; definition for method 205 of type hal -(defmethod scene-play hal ((this hal) (arg0 string) (arg1 symbol)) +(defmethod scene-play ((this hal) (arg0 string) (arg1 symbol)) "Spawn a [[scene-player]] process for the given scene." (when (and (process-grab? this #t) (or arg1 (process-grab? *target* #t))) (countdown (s3-0 3) @@ -381,7 +381,7 @@ ) ;; definition for method 188 of type hal -(defmethod scene-release? hal ((this hal)) +(defmethod scene-release? ((this hal)) (when (not (handle->process (-> this scene-player-handle))) (process-release? this) (countdown (s5-0 3) @@ -397,7 +397,7 @@ ;; definition for method 74 of type hal ;; INFO: Used lq/sq -(defmethod general-event-handler hal ((this hal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this hal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 diff --git a/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-h_REF.gc index 2f4651051ae..4b227fa057a 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-h_REF.gc @@ -3,15 +3,12 @@ ;; definition of type ruffian-course (deftype ruffian-course (bot-course) - ((ouch-speeches bot-speech-list-shuffle :offset-assert 48) + ((ouch-speeches bot-speech-list-shuffle) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type ruffian-course -(defmethod inspect ruffian-course ((this ruffian-course)) +(defmethod inspect ((this ruffian-course)) (when (not this) (set! this this) (goto cfg-4) @@ -37,42 +34,40 @@ ;; definition of type ruffian (deftype ruffian (bot) - ((ruf-course ruffian-course :offset 652) - (travel-anim-interp float :offset-assert 992) - (fired-gun-count uint32 :offset-assert 996) - (next-fire-time time-frame :offset-assert 1000) + ((ruf-course ruffian-course :overlay-at course) + (travel-anim-interp float) + (fired-gun-count uint32) + (next-fire-time time-frame) ) - :heap-base #x370 - :method-count-assert 246 - :size-assert #x3f0 - :flag-assert #xf6037003f0 + (:state-methods + kick + blast + alert-idle + alert-turn + traveling + traveling-blocked + waiting-idle + waiting-turn + scared-idle + scared-turn + plant-bomb + bomb-recoil + ) (:methods - (kick () _type_ :state 225) - (blast () _type_ :state 226) - (alert-idle () _type_ :state 227) - (alert-turn () _type_ :state 228) - (traveling () _type_ :state 229) - (traveling-blocked () _type_ :state 230) - (waiting-idle () _type_ :state 231) - (waiting-turn () _type_ :state 232) - (scared-idle () _type_ :state 233) - (scared-turn () _type_ :state 234) - (plant-bomb () _type_ :state 235) - (bomb-recoil () _type_ :state 236) - (ruffian-method-237 (_type_) symbol 237) - (ruffian-method-238 (_type_) symbol 238) - (fire-gun (_type_ vector) none 239) - (ruffian-method-240 (_type_) none 240) - (ruffian-method-241 (_type_) none 241) - (ruffian-method-242 (_type_) none 242) - (ruffian-method-243 (_type_) symbol 243) - (ruffian-method-244 (_type_) none 244) - (ruffian-method-245 (_type_) none 245) + (ruffian-method-237 (_type_) symbol) + (ruffian-method-238 (_type_) symbol) + (fire-gun (_type_ vector) none) + (ruffian-method-240 (_type_) none) + (ruffian-method-241 (_type_) none) + (ruffian-method-242 (_type_) none) + (ruffian-method-243 (_type_) symbol) + (ruffian-method-244 (_type_) none) + (ruffian-method-245 (_type_) none) ) ) ;; definition for method 3 of type ruffian -(defmethod inspect ruffian ((this ruffian)) +(defmethod inspect ((this ruffian)) (when (not this) (set! this this) (goto cfg-4) @@ -89,18 +84,15 @@ ;; definition of type ruft-wait-spot (deftype ruft-wait-spot (ai-task) - ((check-done (function ruft-wait-spot ruffian symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function ruft-wait-spot ruffian symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type ruft-wait-spot -(defmethod inspect ruft-wait-spot ((this ruft-wait-spot)) +(defmethod inspect ((this ruft-wait-spot)) (when (not this) (set! this this) (goto cfg-4) @@ -121,23 +113,20 @@ ;; definition of type ruft-choose-jump (deftype ruft-choose-jump (ai-task) - ((check-done (function ruft-choose-jump ruffian symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (src-spot-indexes uint8 4 :offset 38) - (dest-spot-indexes uint8 4 :offset 42) + ((check-done (function ruft-choose-jump ruffian symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (src-spot-indexes uint8 4 :overlay-at (-> bytes 6)) + (dest-spot-indexes uint8 4 :overlay-at (-> bytes 10)) ) - :method-count-assert 14 - :size-assert #x30 - :flag-assert #xe00000030 (:methods - (ruft-choose-jump-method-12 (_type_ ruffian) symbol 12) - (ruft-choose-jump-method-13 (_type_ ruffian) int 13) + (ruft-choose-jump-method-12 (_type_ ruffian) symbol) + (ruft-choose-jump-method-13 (_type_ ruffian) int) ) ) ;; definition for method 3 of type ruft-choose-jump -(defmethod inspect ruft-choose-jump ((this ruft-choose-jump)) +(defmethod inspect ((this ruft-choose-jump)) (when (not this) (set! this this) (goto cfg-4) @@ -160,13 +149,10 @@ ;; definition of type ruft-fight-focus (deftype ruft-fight-focus (ai-task) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type ruft-fight-focus -(defmethod inspect ruft-fight-focus ((this ruft-fight-focus)) +(defmethod inspect ((this ruft-fight-focus)) (when (not this) (set! this this) (goto cfg-4) @@ -183,19 +169,16 @@ ;; definition of type ruft-plant-bomb (deftype ruft-plant-bomb (ai-task) - ((check-done (function ruft-plant-bomb ruffian symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (stand-spot-indexes uint8 2 :offset 38) - (face-spot-indexes uint8 2 :offset 40) + ((check-done (function ruft-plant-bomb ruffian symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (stand-spot-indexes uint8 2 :overlay-at (-> bytes 6)) + (face-spot-indexes uint8 2 :overlay-at (-> bytes 8)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type ruft-plant-bomb -(defmethod inspect ruft-plant-bomb ((this ruft-plant-bomb)) +(defmethod inspect ((this ruft-plant-bomb)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-task_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-task_REF.gc index 8aa20ed160c..64eb0cde99b 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-task_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type ruft-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! ruft-wait-spot ((this ruft-wait-spot)) +(defmethod reset-task! ((this ruft-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -12,7 +12,7 @@ ) ;; definition for method 11 of type ruft-wait-spot -(defmethod ai-task-method-11 ruft-wait-spot ((this ruft-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this ruft-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) @@ -56,7 +56,7 @@ ;; definition for method 11 of type ruft-fight-focus ;; WARN: Return type mismatch object vs none. -(defmethod ai-task-method-11 ruft-fight-focus ((this ruft-fight-focus) (arg0 bot)) +(defmethod ai-task-method-11 ((this ruft-fight-focus) (arg0 bot)) (let ((a1-1 (handle->process (-> arg0 focus handle)))) (if (and a1-1 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) @@ -72,13 +72,13 @@ ;; definition for method 10 of type ruft-fight-focus ;; WARN: Return type mismatch bot-flags vs none. -(defmethod ai-task-method-10 ruft-fight-focus ((this ruft-fight-focus) (arg0 bot)) +(defmethod ai-task-method-10 ((this ruft-fight-focus) (arg0 bot)) (logclear! (-> arg0 bot-flags) (bot-flags bf00)) (none) ) ;; definition for method 13 of type ruft-choose-jump -(defmethod ruft-choose-jump-method-13 ruft-choose-jump ((this ruft-choose-jump) (arg0 ruffian)) +(defmethod ruft-choose-jump-method-13 ((this ruft-choose-jump) (arg0 ruffian)) (let ((gp-0 0)) (let ((f30-0 -1.0) (s3-0 (-> arg0 root trans)) @@ -103,7 +103,7 @@ ) ;; definition for method 12 of type ruft-choose-jump -(defmethod ruft-choose-jump-method-12 ruft-choose-jump ((this ruft-choose-jump) (arg0 ruffian)) +(defmethod ruft-choose-jump-method-12 ((this ruft-choose-jump) (arg0 ruffian)) (let ((a1-5 (-> arg0 ruf-course spots (-> this src-spot-indexes (-> this which-spot)))) (s5-0 (-> arg0 ruf-course spots (-> this dest-spot-indexes (-> this which-spot)))) ) @@ -123,7 +123,7 @@ ;; definition for method 9 of type ruft-choose-jump ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! ruft-choose-jump ((this ruft-choose-jump)) +(defmethod reset-task! ((this ruft-choose-jump)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -133,7 +133,7 @@ ;; definition for method 11 of type ruft-choose-jump ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 ruft-choose-jump ((this ruft-choose-jump) (arg0 bot)) +(defmethod ai-task-method-11 ((this ruft-choose-jump) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (or (< s4-0 0) (player-blocking-spot? arg0 (-> arg0 course spots (-> this src-spot-indexes s4-0))) @@ -173,14 +173,14 @@ ) ;; definition for method 10 of type ruft-choose-jump -(defmethod ai-task-method-10 ruft-choose-jump ((this ruft-choose-jump) (arg0 bot)) +(defmethod ai-task-method-10 ((this ruft-choose-jump) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) ;; definition for method 9 of type ruft-plant-bomb ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! ruft-plant-bomb ((this ruft-plant-bomb)) +(defmethod reset-task! ((this ruft-plant-bomb)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -189,7 +189,7 @@ ) ;; definition for method 11 of type ruft-plant-bomb -(defmethod ai-task-method-11 ruft-plant-bomb ((this ruft-plant-bomb) (arg0 bot)) +(defmethod ai-task-method-11 ((this ruft-plant-bomb) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this stand-spot-indexes s4-0)))) @@ -254,7 +254,7 @@ ) ;; definition for method 10 of type ruft-plant-bomb -(defmethod ai-task-method-10 ruft-plant-bomb ((this ruft-plant-bomb) (arg0 bot)) +(defmethod ai-task-method-10 ((this ruft-plant-bomb) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-h_REF.gc index ec8771da417..befdf71f9ec 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-h_REF.gc @@ -3,29 +3,26 @@ ;; definition of type sig-plasma (deftype sig-plasma (structure) - ((flags plasma-flags :offset-assert 0) - (level float :offset-assert 4) - (min-level float :offset-assert 8) - (charge-speed float :offset-assert 12) - (powerup-sound-id sound-id :offset-assert 16) - (plasma-sound-id sound-id :offset-assert 20) + ((flags plasma-flags) + (level float) + (min-level float) + (charge-speed float) + (powerup-sound-id sound-id) + (plasma-sound-id sound-id) ) :pack-me - :method-count-assert 15 - :size-assert #x18 - :flag-assert #xf00000018 (:methods - (sig-plasma-method-9 (_type_) none 9) - (sig-plasma-method-10 (_type_) symbol 10) - (sig-plasma-method-11 (_type_ symbol) none 11) - (sig-plasma-method-12 (_type_) none 12) - (sig-plasma-method-13 (_type_) symbol 13) - (sig-plasma-method-14 (_type_ process-focusable) none 14) + (sig-plasma-method-9 (_type_) none) + (sig-plasma-method-10 (_type_) symbol) + (sig-plasma-method-11 (_type_ symbol) none) + (sig-plasma-method-12 (_type_) none) + (sig-plasma-method-13 (_type_) symbol) + (sig-plasma-method-14 (_type_ process-focusable) none) ) ) ;; definition for method 3 of type sig-plasma -(defmethod inspect sig-plasma ((this sig-plasma)) +(defmethod inspect ((this sig-plasma)) (when (not this) (set! this this) (goto cfg-4) @@ -43,27 +40,24 @@ ;; definition of type sig-path-sample (deftype sig-path-sample (structure) - ((bytes uint8 32 :offset-assert 0) - (pos vector :inline :offset-assert 32) - (quat quaternion :inline :offset-assert 48) - (flags uint8 :offset 12) - (pos-x float :offset 32) - (pos-y float :offset 36) - (pos-z float :offset 40) - (quat-x float :offset 48) - (quat-y float :offset 52) - (quat-z float :offset 56) - (quat-w float :offset 60) + ((bytes uint8 32) + (pos vector :inline) + (quat quaternion :inline) + (flags uint8 :overlay-at (-> bytes 12)) + (pos-x float :overlay-at (-> pos data 0)) + (pos-y float :overlay-at (-> pos data 1)) + (pos-z float :overlay-at (-> pos data 2)) + (quat-x float :overlay-at (-> quat data 0)) + (quat-y float :overlay-at (-> quat data 1)) + (quat-z float :overlay-at (-> quat data 2)) + (quat-w float :overlay-at (-> quat data 3)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type sig-path-sample ;; ERROR: failed type prop at 14: add failed: sig-path-sample -(defmethod inspect sig-path-sample ((a0-0 sig-path-sample)) +(defmethod inspect ((a0-0 sig-path-sample)) (local-vars (v0-0 object) (v0-1 none) @@ -206,16 +200,13 @@ ;; definition of type sig-path (deftype sig-path (basic) - ((sample-count int32 :offset-assert 4) - (samples (inline-array sig-path-sample) :offset-assert 8) + ((sample-count int32) + (samples (inline-array sig-path-sample)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type sig-path -(defmethod inspect sig-path ((this sig-path)) +(defmethod inspect ((this sig-path)) (when (not this) (set! this this) (goto cfg-4) @@ -229,62 +220,60 @@ ;; definition of type sig (deftype sig (bot) - ((fired-gun-count uint32 :offset-assert 992) - (sig-path sig-path :offset-assert 996) - (sig-path-clock clock :offset-assert 1000) - (travel-anim-interp float :offset-assert 1004) - (platform-index uint8 :offset-assert 1008) - (played-unjam-time time-frame :offset-assert 1016) - (sig-path-start-time time-frame :offset-assert 1024) - (sig-path-cur-time time-frame :offset-assert 1032) - (sig-path-prev-time time-frame :offset-assert 1040) - (plasma sig-plasma :inline :offset 1048) - (sig-path-prev-pos vector :inline :offset 368) + ((fired-gun-count uint32) + (sig-path sig-path) + (sig-path-clock clock) + (travel-anim-interp float) + (platform-index uint8) + (played-unjam-time time-frame) + (sig-path-start-time time-frame) + (sig-path-cur-time time-frame) + (sig-path-prev-time time-frame) + (plasma sig-plasma :inline :offset 1048) + (sig-path-prev-pos vector :inline :overlay-at event-param-point) ) - :heap-base #x3b0 - :method-count-assert 259 - :size-assert #x430 - :flag-assert #x10303b00430 + (:state-methods + whip + blast + chase + chase-attack + traveling + traveling-blocked + waiting-far + waiting-close + waiting-turn + waiting-crouched + charge-plasma + gun-jam + repair-gun + clean-gun + sig-path-run + sig-path-jump + sig-path-jump-land + sig-path-shoot-jump + sig-path-shoot-jump-land + sig-path-idle + ) (:methods - (whip () _type_ :state 225) - (blast () _type_ :state 226) - (chase () _type_ :state 227) - (chase-attack () _type_ :state 228) - (traveling () _type_ :state 229) - (traveling-blocked () _type_ :state 230) - (waiting-far () _type_ :state 231) - (waiting-close () _type_ :state 232) - (waiting-turn () _type_ :state 233) - (waiting-crouched () _type_ :state 234) - (charge-plasma () _type_ :state 235) - (gun-jam () _type_ :state 236) - (repair-gun () _type_ :state 237) - (clean-gun () _type_ :state 238) - (sig-path-run () _type_ :state 239) - (sig-path-jump () _type_ :state 240) - (sig-path-jump-land () _type_ :state 241) - (sig-path-shoot-jump () _type_ :state 242) - (sig-path-shoot-jump-land () _type_ :state 243) - (sig-path-idle () _type_ :state 244) - (sig-method-245 (_type_) symbol 245) - (sig-method-246 (_type_) symbol 246) - (fire-gun (_type_ vector) (pointer process) 247) - (sig-method-248 (_type_ sig-path-sample) none 248) - (sig-method-249 (_type_ sig-path) none 249) - (sig-method-250 (_type_) symbol 250) - (sig-method-251 (_type_) symbol 251) - (sig-method-252 (_type_) symbol 252) - (sig-method-253 (_type_) none 253) - (sig-method-254 (_type_) symbol 254) - (sig-method-255 (_type_) symbol 255) - (sig-method-256 (_type_) none 256) - (sig-method-257 (_type_) symbol 257) - (sig-method-258 (_type_) none 258) + (sig-method-245 (_type_) symbol) + (sig-method-246 (_type_) symbol) + (fire-gun (_type_ vector) (pointer process)) + (sig-method-248 (_type_ sig-path-sample) none) + (sig-method-249 (_type_ sig-path) none) + (sig-method-250 (_type_) symbol) + (sig-method-251 (_type_) symbol) + (sig-method-252 (_type_) symbol) + (sig-method-253 (_type_) none) + (sig-method-254 (_type_) symbol) + (sig-method-255 (_type_) symbol) + (sig-method-256 (_type_) none) + (sig-method-257 (_type_) symbol) + (sig-method-258 (_type_) none) ) ) ;; definition for method 3 of type sig -(defmethod inspect sig ((this sig)) +(defmethod inspect ((this sig)) (when (not this) (set! this this) (goto cfg-4) @@ -317,18 +306,15 @@ ;; definition of type sigt-wait-spot (deftype sigt-wait-spot (ai-task) - ((check-done (function sigt-wait-spot sig symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 6 :offset 38) + ((check-done (function sigt-wait-spot sig symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type sigt-wait-spot -(defmethod inspect sigt-wait-spot ((this sigt-wait-spot)) +(defmethod inspect ((this sigt-wait-spot)) (when (not this) (set! this this) (goto cfg-4) @@ -349,24 +335,21 @@ ;; definition of type sigt-choose-piston (deftype sigt-choose-piston (ai-task) - ((check-done (function sigt-choose-piston sig symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 4 :offset 38) - (actor-indexes uint8 4 :offset 42) + ((check-done (function sigt-choose-piston sig symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 4 :overlay-at (-> bytes 6)) + (actor-indexes uint8 4 :overlay-at (-> bytes 10)) ) - :method-count-assert 15 - :size-assert #x30 - :flag-assert #xf00000030 (:methods - (sigt-choose-piston-method-12 (_type_ sig) symbol 12) - (sigt-choose-piston-method-13 (_type_ sig) none 13) - (sigt-choose-piston-method-14 (_type_ sig int) symbol 14) + (sigt-choose-piston-method-12 (_type_ sig) symbol) + (sigt-choose-piston-method-13 (_type_ sig) none) + (sigt-choose-piston-method-14 (_type_ sig int) symbol) ) ) ;; definition for method 3 of type sigt-choose-piston -(defmethod inspect sigt-choose-piston ((this sigt-choose-piston)) +(defmethod inspect ((this sigt-choose-piston)) (when (not this) (set! this this) (goto cfg-4) @@ -388,21 +371,18 @@ ;; definition of type sigt-riding-piston (deftype sigt-riding-piston (ai-task) - ((check-done (function sigt-riding-piston sig symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 4 :offset 38) + ((check-done (function sigt-riding-piston sig symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 4 :overlay-at (-> bytes 6)) ) - :method-count-assert 13 - :size-assert #x30 - :flag-assert #xd00000030 (:methods - (sigt-riding-piston-method-12 (_type_ sig) symbol 12) + (sigt-riding-piston-method-12 (_type_ sig) symbol) ) ) ;; definition for method 3 of type sigt-riding-piston -(defmethod inspect sigt-riding-piston ((this sigt-riding-piston)) +(defmethod inspect ((this sigt-riding-piston)) (when (not this) (set! this this) (goto cfg-4) @@ -423,19 +403,16 @@ ;; definition of type sigt-charge-plasma (deftype sigt-charge-plasma (ai-task) - ((check-done (function sigt-charge-plasma sig symbol) :offset 32) - (which-spot int8 :offset 36) - (num-spots uint8 :offset 37) - (spot-indexes uint8 4 :offset 38) - (actor-index uint8 :offset 42) + ((check-done (function sigt-charge-plasma sig symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 4 :overlay-at (-> bytes 6)) + (actor-index uint8 :overlay-at (-> bytes 10)) ) - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type sigt-charge-plasma -(defmethod inspect sigt-charge-plasma ((this sigt-charge-plasma)) +(defmethod inspect ((this sigt-charge-plasma)) (when (not this) (set! this this) (goto cfg-4) @@ -458,13 +435,10 @@ ;; definition of type sigt-fight-focus (deftype sigt-fight-focus (ai-task) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type sigt-fight-focus -(defmethod inspect sigt-fight-focus ((this sigt-fight-focus)) +(defmethod inspect ((this sigt-fight-focus)) (when (not this) (set! this this) (goto cfg-4) @@ -482,13 +456,10 @@ ;; definition of type sigt-repair-gun (deftype sigt-repair-gun (ai-task) () - :method-count-assert 12 - :size-assert #x30 - :flag-assert #xc00000030 ) ;; definition for method 3 of type sigt-repair-gun -(defmethod inspect sigt-repair-gun ((this sigt-repair-gun)) +(defmethod inspect ((this sigt-repair-gun)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-plasma_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-plasma_REF.gc index 81f8b33e5fe..ab0a165de79 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-plasma_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-plasma_REF.gc @@ -143,7 +143,7 @@ ;; definition for method 14 of type sig-plasma ;; WARN: Return type mismatch object vs none. -(defmethod sig-plasma-method-14 sig-plasma ((this sig-plasma) (arg0 process-focusable)) +(defmethod sig-plasma-method-14 ((this sig-plasma) (arg0 process-focusable)) (let* ((f0-0 (-> this level)) (f30-0 (cond ((logtest? (-> this flags) (plasma-flags pf01)) @@ -229,7 +229,7 @@ ;; definition for method 12 of type sig-plasma ;; WARN: Return type mismatch plasma-flags vs none. -(defmethod sig-plasma-method-12 sig-plasma ((this sig-plasma)) +(defmethod sig-plasma-method-12 ((this sig-plasma)) (let ((f0-0 (-> this level))) (-> this min-level) (when (>= f0-0 1.0) @@ -244,7 +244,7 @@ ;; definition for method 11 of type sig-plasma ;; WARN: Return type mismatch plasma-flags vs none. -(defmethod sig-plasma-method-11 sig-plasma ((this sig-plasma) (arg0 symbol)) +(defmethod sig-plasma-method-11 ((this sig-plasma) (arg0 symbol)) (set! (-> this min-level) 0.0) (cond (arg0 @@ -262,17 +262,17 @@ ;; definition for method 9 of type sig-plasma ;; WARN: Return type mismatch plasma-flags vs none. -(defmethod sig-plasma-method-9 sig-plasma ((this sig-plasma)) +(defmethod sig-plasma-method-9 ((this sig-plasma)) (logior! (-> this flags) (plasma-flags pf03)) (none) ) ;; definition for method 10 of type sig-plasma -(defmethod sig-plasma-method-10 sig-plasma ((this sig-plasma)) +(defmethod sig-plasma-method-10 ((this sig-plasma)) (logtest? (-> this flags) (plasma-flags pf02)) ) ;; definition for method 13 of type sig-plasma -(defmethod sig-plasma-method-13 sig-plasma ((this sig-plasma)) +(defmethod sig-plasma-method-13 ((this sig-plasma)) (and (logtest? (-> this flags) (plasma-flags pf03)) (logtest? (-> this flags) (plasma-flags pf04))) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-shot_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-shot_REF.gc index 42d86a3fa2f..d0acb564518 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-shot_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-shot_REF.gc @@ -254,17 +254,13 @@ ;; definition of type sig-shot (deftype sig-shot (projectile) - ((tail-pos vector :inline :offset-assert 480) - (hit-pos vector :inline :offset-assert 496) + ((tail-pos vector :inline) + (hit-pos vector :inline) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x200 - :flag-assert #x2801800200 ) ;; definition for method 3 of type sig-shot -(defmethod inspect sig-shot ((this sig-shot)) +(defmethod inspect ((this sig-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -280,7 +276,7 @@ ;; definition for method 24 of type sig-shot ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight sig-shot ((this sig-shot)) +(defmethod draw-laser-sight ((this sig-shot)) "TODO - confirm If applicable, draw the laser sight particles" (draw-beam (-> *part-id-table* 655) (-> this tail-pos) (-> this starting-dir) #f #t) 0 @@ -290,7 +286,7 @@ ;; definition for method 25 of type sig-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles sig-shot ((this sig-shot)) +(defmethod spawn-impact-particles ((this sig-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -348,7 +344,7 @@ ;; definition for method 26 of type sig-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles sig-shot ((this sig-shot)) +(defmethod spawn-shell-particles ((this sig-shot)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -391,7 +387,7 @@ ;; definition for method 28 of type sig-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound sig-shot ((this sig-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this sig-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -407,7 +403,7 @@ ) ;; definition for method 38 of type sig-shot -(defmethod made-impact? sig-shot ((this sig-shot)) +(defmethod made-impact? ((this sig-shot)) "TODO - queries the collision cache, return true/false" (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) @@ -456,7 +452,7 @@ ;; definition for method 30 of type sig-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! sig-shot ((this sig-shot)) +(defmethod init-proj-collision! ((this sig-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -530,7 +526,7 @@ ;; definition for method 31 of type sig-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! sig-shot ((this sig-shot)) +(defmethod init-proj-settings! ((this sig-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'eco-yellow) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-task_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-task_REF.gc index 4d6951daedd..dc74566662b 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-task_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 9 of type sigt-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! sigt-wait-spot ((this sigt-wait-spot)) +(defmethod reset-task! ((this sigt-wait-spot)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -12,7 +12,7 @@ ) ;; definition for method 11 of type sigt-wait-spot -(defmethod ai-task-method-11 sigt-wait-spot ((this sigt-wait-spot) (arg0 bot)) +(defmethod ai-task-method-11 ((this sigt-wait-spot) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) @@ -61,7 +61,7 @@ ;; definition for method 11 of type sigt-fight-focus ;; WARN: Return type mismatch object vs none. -(defmethod ai-task-method-11 sigt-fight-focus ((this sigt-fight-focus) (arg0 bot)) +(defmethod ai-task-method-11 ((this sigt-fight-focus) (arg0 bot)) (let ((a1-1 (handle->process (-> arg0 focus handle)))) (if (and a1-1 (attacked-by-player? arg0 (the-as process-focusable a1-1)) @@ -76,13 +76,13 @@ ;; definition for method 10 of type sigt-fight-focus ;; WARN: Return type mismatch bot-flags vs none. -(defmethod ai-task-method-10 sigt-fight-focus ((this sigt-fight-focus) (arg0 bot)) +(defmethod ai-task-method-10 ((this sigt-fight-focus) (arg0 bot)) (logclear! (-> arg0 bot-flags) (bot-flags bf00)) (none) ) ;; definition for method 11 of type sigt-repair-gun -(defmethod ai-task-method-11 sigt-repair-gun ((this sigt-repair-gun) (arg0 bot)) +(defmethod ai-task-method-11 ((this sigt-repair-gun) (arg0 bot)) (cond ((not (logtest? (bot-flags bf19) (-> arg0 bot-flags))) (ai-task-control-method-14 (-> arg0 ai-ctrl) this arg0) @@ -103,7 +103,7 @@ ) ;; definition for method 14 of type sigt-choose-piston -(defmethod sigt-choose-piston-method-14 sigt-choose-piston ((this sigt-choose-piston) (arg0 sig) (arg1 int)) +(defmethod sigt-choose-piston-method-14 ((this sigt-choose-piston) (arg0 sig) (arg1 int)) (let* ((v1-2 (-> arg0 course spots (-> this spot-indexes arg1))) (a0-6 (-> arg0 actor-group 0 data (-> this actor-indexes arg1) actor)) (gp-0 (if a0-6 @@ -121,7 +121,7 @@ ;; definition for method 13 of type sigt-choose-piston ;; WARN: Return type mismatch int vs none. -(defmethod sigt-choose-piston-method-13 sigt-choose-piston ((this sigt-choose-piston) (arg0 sig)) +(defmethod sigt-choose-piston-method-13 ((this sigt-choose-piston) (arg0 sig)) (let ((s4-0 0)) (let ((f30-0 -1.0) (s3-0 (-> arg0 root trans)) @@ -159,7 +159,7 @@ ;; definition for method 12 of type sigt-choose-piston ;; INFO: Used lq/sq -(defmethod sigt-choose-piston-method-12 sigt-choose-piston ((this sigt-choose-piston) (arg0 sig)) +(defmethod sigt-choose-piston-method-12 ((this sigt-choose-piston) (arg0 sig)) (with-pp (when (and (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) (not (sigt-choose-piston-method-14 this arg0 (-> this which-spot))) @@ -212,7 +212,7 @@ ;; definition for method 9 of type sigt-choose-piston ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! sigt-choose-piston ((this sigt-choose-piston)) +(defmethod reset-task! ((this sigt-choose-piston)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -221,7 +221,7 @@ ) ;; definition for method 11 of type sigt-choose-piston -(defmethod ai-task-method-11 sigt-choose-piston ((this sigt-choose-piston) (arg0 bot)) +(defmethod ai-task-method-11 ((this sigt-choose-piston) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (cond ((< s4-0 0) @@ -255,13 +255,13 @@ ) ;; definition for method 10 of type sigt-choose-piston -(defmethod ai-task-method-10 sigt-choose-piston ((this sigt-choose-piston) (arg0 bot)) +(defmethod ai-task-method-10 ((this sigt-choose-piston) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) ;; definition for method 12 of type sigt-riding-piston -(defmethod sigt-riding-piston-method-12 sigt-riding-piston ((this sigt-riding-piston) (arg0 sig)) +(defmethod sigt-riding-piston-method-12 ((this sigt-riding-piston) (arg0 sig)) (with-pp (when (not (player-blocking-spot? arg0 (-> arg0 course spots (-> this spot-indexes (-> this which-spot))))) (let* ((v1-9 (-> arg0 actor-group 0 data (-> arg0 platform-index) actor)) @@ -305,7 +305,7 @@ ;; definition for method 9 of type sigt-riding-piston ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! sigt-riding-piston ((this sigt-riding-piston)) +(defmethod reset-task! ((this sigt-riding-piston)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -315,7 +315,7 @@ ;; definition for method 11 of type sigt-riding-piston ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 sigt-riding-piston ((this sigt-riding-piston) (arg0 bot)) +(defmethod ai-task-method-11 ((this sigt-riding-piston) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (or (< s4-0 0) (player-blocking-spot? arg0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) @@ -341,14 +341,14 @@ ) ;; definition for method 10 of type sigt-riding-piston -(defmethod ai-task-method-10 sigt-riding-piston ((this sigt-riding-piston) (arg0 bot)) +(defmethod ai-task-method-10 ((this sigt-riding-piston) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) ;; definition for method 9 of type sigt-charge-plasma ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! sigt-charge-plasma ((this sigt-charge-plasma)) +(defmethod reset-task! ((this sigt-charge-plasma)) (set! (-> this check-done) #f) (set! (-> this which-spot) -1) (set! (-> this num-spots) (the-as uint 0)) @@ -357,7 +357,7 @@ ) ;; definition for method 11 of type sigt-charge-plasma -(defmethod ai-task-method-11 sigt-charge-plasma ((this sigt-charge-plasma) (arg0 bot)) +(defmethod ai-task-method-11 ((this sigt-charge-plasma) (arg0 bot)) (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) (let ((s3-0 (-> (the-as sig arg0) course spots (-> this spot-indexes s4-0)))) @@ -439,7 +439,7 @@ ;; definition for method 10 of type sigt-charge-plasma ;; WARN: Return type mismatch int vs none. -(defmethod ai-task-method-10 sigt-charge-plasma ((this sigt-charge-plasma) (arg0 bot)) +(defmethod ai-task-method-10 ((this sigt-charge-plasma) (arg0 bot)) (clear-poi-and-focus! (the-as sig arg0)) (logclear! (-> (the-as sig arg0) plasma flags) (plasma-flags pf00)) (set! (-> (the-as sig arg0) focus-mode) 0) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc index 8dc1e7888ba..950c5f3809c 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc @@ -3,16 +3,13 @@ ;; definition of type sig-anim-info (deftype sig-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type sig-anim-info -(defmethod inspect sig-anim-info ((this sig-anim-info)) +(defmethod inspect ((this sig-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -25,16 +22,13 @@ ;; definition of type sig-global-info (deftype sig-global-info (basic) - ((prev-blue-hit int8 :offset-assert 4) - (blue-hit-anim sig-anim-info 3 :inline :offset-assert 8) + ((prev-blue-hit int8) + (blue-hit-anim sig-anim-info 3 :inline) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type sig-global-info -(defmethod inspect sig-global-info ((this sig-global-info)) +(defmethod inspect ((this sig-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -259,7 +253,7 @@ ) ;; definition for method 97 of type sig -(defmethod enemy-method-97 sig ((this sig)) +(defmethod enemy-method-97 ((this sig)) (let* ((s5-0 (handle->process (-> this attacker-handle))) (s4-0 (if (type? s5-0 process-focusable) s5-0 @@ -377,7 +371,7 @@ ) ;; definition for method 74 of type sig -(defmethod general-event-handler sig ((this sig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this sig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -399,7 +393,7 @@ ) ;; definition for method 55 of type sig -(defmethod track-target! sig ((this sig)) +(defmethod track-target! ((this sig)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -465,14 +459,14 @@ ) ;; definition for method 213 of type sig -(defmethod go-to-waypoint! sig ((this sig) (arg0 int) (arg1 symbol)) +(defmethod go-to-waypoint! ((this sig) (arg0 int) (arg1 symbol)) "Start moving to the given [[bot-waypoint]]." (set! (-> this plasma charge-speed) 0.125) ((method-of-type bot go-to-waypoint!) this arg0 arg1) ) ;; definition for method 10 of type sig -(defmethod deactivate sig ((this sig)) +(defmethod deactivate ((this sig)) (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-param)) (set! (-> v1-0 id) (-> this plasma powerup-sound-id)) @@ -497,7 +491,7 @@ ;; definition for method 46 of type sig ;; WARN: Return type mismatch vector vs none. -(defmethod enemy-method-46 sig ((this sig) (arg0 int)) +(defmethod enemy-method-46 ((this sig) (arg0 int)) "@abstract" (let ((v1-0 arg0)) (cond @@ -555,7 +549,7 @@ ;; definition for method 114 of type sig ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! sig ((this sig)) +(defmethod init-enemy-collision! ((this sig)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -647,7 +641,7 @@ ;; definition for method 115 of type sig ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! sig ((this sig)) +(defmethod init-enemy! ((this sig)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (set! (-> this channel) (the-as uint 21)) @@ -690,7 +684,7 @@ ;; definition for method 105 of type sig ;; WARN: Return type mismatch sound-id vs enemy-flag. -(defmethod enemy-method-105 sig ((this sig) (arg0 process)) +(defmethod enemy-method-105 ((this sig) (arg0 process)) (let ((t9-0 (method-of-type bot enemy-method-105))) (t9-0 this arg0) ) @@ -701,32 +695,32 @@ ) ;; definition for method 251 of type sig -(defmethod sig-method-251 sig ((this sig)) +(defmethod sig-method-251 ((this sig)) (logtest? (-> this plasma flags) (plasma-flags pf00)) ) ;; definition for method 254 of type sig -(defmethod sig-method-254 sig ((this sig)) +(defmethod sig-method-254 ((this sig)) (logtest? (bot-flags bf22) (-> this bot-flags)) ) ;; definition for method 252 of type sig -(defmethod sig-method-252 sig ((this sig)) +(defmethod sig-method-252 ((this sig)) (logtest? (bot-flags bf20) (-> this bot-flags)) ) ;; definition for method 255 of type sig -(defmethod sig-method-255 sig ((this sig)) +(defmethod sig-method-255 ((this sig)) (logtest? (bot-flags bf19) (-> this bot-flags)) ) ;; definition for method 246 of type sig -(defmethod sig-method-246 sig ((this sig)) +(defmethod sig-method-246 ((this sig)) (>= 16384.0 (-> this focus-info bullseye-xz-dist)) ) ;; definition for method 245 of type sig -(defmethod sig-method-245 sig ((this sig)) +(defmethod sig-method-245 ((this sig)) (and (or (and (logtest? (-> this bot-flags) (bot-flags attacked)) (= (-> this focus-info fproc type) target)) (and (>= 40960.0 (-> this focus-info bullseye-xz-dist)) (= (-> this focus-info los) 1)) ) @@ -735,7 +729,7 @@ ) ;; definition for method 70 of type sig -(defmethod go-hostile sig ((this sig)) +(defmethod go-hostile ((this sig)) (bot-method-223 this #t) (cond ((not (bot-method-214 this)) @@ -754,7 +748,7 @@ ) ;; definition for method 72 of type sig -(defmethod react-to-focus sig ((this sig)) +(defmethod react-to-focus ((this sig)) "@TODO - flesh out docs" (cond ((bot-method-214 this) @@ -786,14 +780,14 @@ ;; definition for method 116 of type sig ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sig ((this sig)) +(defmethod go-idle ((this sig)) (go (method-of-object this waiting-far)) (none) ) ;; definition for method 247 of type sig ;; INFO: Used lq/sq -(defmethod fire-gun sig ((this sig) (arg0 vector)) +(defmethod fire-gun ((this sig) (arg0 vector)) "Increase gun fired counter and spawn projectile." (+! (-> this fired-gun-count) 1) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) @@ -820,7 +814,7 @@ ;; definition for method 258 of type sig ;; WARN: Return type mismatch int vs none. -(defmethod sig-method-258 sig ((this sig)) +(defmethod sig-method-258 ((this sig)) (with-pp (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 16384.0 28672.0))) @@ -878,7 +872,7 @@ ) ;; definition for method 77 of type sig -(defmethod enemy-method-77 sig ((this sig) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this sig) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((v1-3 (enemy-method-120 this 3 (ash 1 (-> *sig-global-info* prev-blue-hit)))) @@ -961,7 +955,7 @@ ) ;; definition for method 78 of type sig -(defmethod enemy-method-78 sig ((this sig) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this sig) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -999,7 +993,7 @@ ) ;; definition for method 84 of type sig -(defmethod enemy-method-84 sig ((this sig) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 ((this sig) (arg0 enemy-jump-info)) (logclear! (-> this bot-flags) (bot-flags bf23)) (let ((f1-0 (vector-vector-xz-distance (-> arg0 dest-pos) (-> arg0 start-pos))) (f2-1 (- (-> arg0 dest-pos y) (-> arg0 start-pos y))) @@ -1033,7 +1027,7 @@ ) ;; definition for method 86 of type sig -(defmethod enemy-method-86 sig ((this sig)) +(defmethod enemy-method-86 ((this sig)) (let* ((t9-0 (method-of-type bot enemy-method-86)) (v0-0 (t9-0 this)) ) @@ -1077,7 +1071,7 @@ ;; definition for method 85 of type sig ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs float. -(defmethod enemy-method-85 sig ((this sig)) +(defmethod enemy-method-85 ((this sig)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((t9-0 (method-of-type bot enemy-method-85))) @@ -1131,7 +1125,7 @@ ;; definition for method 89 of type sig ;; WARN: Return type mismatch int vs symbol. -(defmethod enemy-method-89 sig ((this sig) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this sig) (arg0 enemy-jump-info)) (the-as symbol (when (logtest? (bot-flags bf23) (-> this bot-flags)) @@ -1155,7 +1149,7 @@ ;; definition for method 88 of type sig ;; WARN: Return type mismatch int vs symbol. -(defmethod enemy-method-88 sig ((this sig) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this sig) (arg0 enemy-jump-info)) (the-as symbol (when (logtest? (bot-flags bf23) (-> this bot-flags)) @@ -1179,7 +1173,7 @@ ;; definition for method 198 of type sig ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! sig ((this sig) (arg0 vector)) +(defmethod set-cam-height! ((this sig) (arg0 vector)) (cond ((and (-> this next-state) (= (-> this next-state name) 'failed)) (set-vector! arg0 0.0 4096.0 28672.0 1.0) @@ -1202,7 +1196,7 @@ ;; definition for method 216 of type sig ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-216 sig ((this sig)) +(defmethod bot-method-216 ((this sig)) (set! (-> this health-handle) (ppointer->handle (process-spawn hud-sig :init hud-init-by-other :to this))) 0 (none) @@ -1210,7 +1204,7 @@ ;; definition for method 249 of type sig ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod sig-method-249 sig ((this sig) (arg0 sig-path)) +(defmethod sig-method-249 ((this sig) (arg0 sig-path)) (set! (-> this sig-path) arg0) (set! (-> this sig-path-clock) (-> *display* user0-clock)) (set! (-> this sig-path-start-time) (-> this sig-path-clock frame-counter)) @@ -1223,7 +1217,7 @@ ;; definition for method 248 of type sig ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod sig-method-248 sig ((this sig) (arg0 sig-path-sample)) +(defmethod sig-method-248 ((this sig) (arg0 sig-path-sample)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -1295,7 +1289,7 @@ ;; definition for method 256 of type sig ;; WARN: Return type mismatch int vs none. -(defmethod sig-method-256 sig ((this sig)) +(defmethod sig-method-256 ((this sig)) (let* ((v1-3 (the int (* 0.05 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time)))))) (v1-4 (- (+ (-> this sig-path sample-count) -1) v1-3)) ) @@ -1308,7 +1302,7 @@ ) ;; definition for method 257 of type sig -(defmethod sig-method-257 sig ((this sig)) +(defmethod sig-method-257 ((this sig)) (>= (the int (* 0.05 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time))))) (+ (-> this sig-path sample-count) -1) ) @@ -1316,7 +1310,7 @@ ;; definition for method 250 of type sig ;; INFO: Used lq/sq -(defmethod sig-method-250 sig ((this sig)) +(defmethod sig-method-250 ((this sig)) (local-vars (a2-7 float) (a2-14 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -1468,7 +1462,7 @@ ;; definition for method 15 of type hud-sig ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-sig ((this hud-sig)) +(defmethod draw ((this hud-sig)) (set-hud-piece-position! (-> this sprites 2) (the int (+ 30.0 (* -130.0 (-> this offset)))) @@ -1485,7 +1479,7 @@ ;; definition for method 16 of type hud-sig ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-sig ((this hud-sig)) +(defmethod update-values ((this hud-sig)) (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) ((method-of-type hud update-values) this) 0 @@ -1494,7 +1488,7 @@ ;; definition for method 17 of type hud-sig ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-sig ((this hud-sig)) +(defmethod init-callback ((this hud-sig)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/test/decompiler/reference/jak2/levels/common/airlock_REF.gc b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc index 3b681812819..e2e08f40e70 100644 --- a/test/decompiler/reference/jak2/levels/common/airlock_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc @@ -3,63 +3,61 @@ ;; definition of type com-airlock (deftype com-airlock (process-drawable) - ((root collide-shape :override) - (level-name pair :offset-assert 200) - (open-test pair :offset-assert 204) - (were-behind? symbol :offset-assert 208) - (inner? symbol :offset-assert 212) - (sound-behind? symbol :offset-assert 216) - (visible-move? symbol :offset-assert 220) - (saw-pilot? handle :offset-assert 224) - (last-distance meters :offset-assert 232) - (y-height vector :offset-assert 236) - (pre-open-speed float :offset-assert 240) - (latch-closed-time time-frame :offset-assert 248) - (latch-open-time time-frame :offset-assert 256) - (gear joint-mod :offset-assert 264) - (gear-rot degrees :offset-assert 268) - (gear-rotv degrees :offset-assert 272) - (open-frame float :offset-assert 276) - (pre-open-frame float :offset-assert 280) - (lock-frame float :offset-assert 284) - (open-distance meters :offset-assert 288) - (active-distance meters :offset-assert 292) - (sound-id sound-id :offset-assert 296) - (gear-sound-id sound-id :offset-assert 300) - (sound-gear sound-spec :offset-assert 304) - (sound-pre-open sound-spec :offset-assert 308) - (sound-pre-open-stop sound-spec :offset-assert 312) - (sound-lock-loop sound-spec :offset-assert 316) - (sound-lock-stop sound-spec :offset-assert 320) - (sound-open sound-spec :offset-assert 324) - (sound-open-loop sound-spec :offset-assert 328) - (sound-open-stop sound-spec :offset-assert 332) - (sound-close sound-spec :offset-assert 336) - (sound-close-loop sound-spec :offset-assert 340) - (sound-close-stop sound-spec :offset-assert 344) - (sound-post-close sound-spec :offset-assert 348) - (sound-post-close-stop sound-spec :offset-assert 352) - (spool-sound-time time-frame :offset-assert 360) - (door-radius meters :offset-assert 368) + ((root collide-shape :override) + (level-name pair) + (open-test pair) + (were-behind? symbol) + (inner? symbol) + (sound-behind? symbol) + (visible-move? symbol) + (saw-pilot? handle) + (last-distance meters) + (y-height vector) + (pre-open-speed float) + (latch-closed-time time-frame) + (latch-open-time time-frame) + (gear joint-mod) + (gear-rot degrees) + (gear-rotv degrees) + (open-frame float) + (pre-open-frame float) + (lock-frame float) + (open-distance meters) + (active-distance meters) + (sound-id sound-id) + (gear-sound-id sound-id) + (sound-gear sound-spec) + (sound-pre-open sound-spec) + (sound-pre-open-stop sound-spec) + (sound-lock-loop sound-spec) + (sound-lock-stop sound-spec) + (sound-open sound-spec) + (sound-open-loop sound-spec) + (sound-open-stop sound-spec) + (sound-close sound-spec) + (sound-close-loop sound-spec) + (sound-close-stop sound-spec) + (sound-post-close sound-spec) + (sound-post-close-stop sound-spec) + (spool-sound-time time-frame) + (door-radius meters) ) - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 + (:state-methods + (open symbol) + (close symbol) + ) (:methods - (open (symbol) _type_ :state 20) - (close (symbol) _type_ :state 21) - (init-airlock! (_type_) _type_ 22) - (want-cross-airlock? (_type_) symbol :behavior com-airlock 23) - (destination-loaded? (_type_ symbol) symbol 24) - (check-crossing-distance (_type_ vector symbol) float :behavior com-airlock 25) - (rotate-gear! (_type_ float) degrees :behavior com-airlock 26) - (play-city-voice-sound (_type_ symbol) none :behavior com-airlock 27) + (init-airlock! (_type_) _type_) + (want-cross-airlock? (_type_) symbol :behavior com-airlock) + (destination-loaded? (_type_ symbol) symbol) + (check-crossing-distance (_type_ vector symbol) float :behavior com-airlock) + (rotate-gear! (_type_ float) degrees :behavior com-airlock) + (play-city-voice-sound (_type_ symbol) none :behavior com-airlock) ) ) ;; definition for method 3 of type com-airlock -(defmethod inspect com-airlock ((this com-airlock)) +(defmethod inspect ((this com-airlock)) (when (not this) (set! this this) (goto cfg-4) @@ -109,7 +107,7 @@ ) ;; definition for method 10 of type com-airlock -(defmethod deactivate com-airlock ((this com-airlock)) +(defmethod deactivate ((this com-airlock)) (process-entity-status! this (entity-perm-status subtask-complete) #f) (if (nonzero? (-> this sound-id)) (sound-stop (-> this sound-id)) @@ -123,7 +121,7 @@ ;; definition for method 7 of type com-airlock ;; WARN: Return type mismatch process-drawable vs com-airlock. -(defmethod relocate com-airlock ((this com-airlock) (arg0 int)) +(defmethod relocate ((this com-airlock) (arg0 int)) (if (nonzero? (-> this gear)) (&+! (-> this gear) arg0) ) @@ -131,7 +129,7 @@ ) ;; definition for method 22 of type com-airlock -(defmethod init-airlock! com-airlock ((this com-airlock)) +(defmethod init-airlock! ((this com-airlock)) (process-entity-status! this (entity-perm-status subtask-complete) #f) (process-drawable-from-entity! this (-> this entity)) (logclear! (-> this mask) (process-mask actor-pause)) @@ -181,7 +179,7 @@ ) ;; definition for method 25 of type com-airlock -(defmethod check-crossing-distance com-airlock ((this com-airlock) (arg0 vector) (arg1 symbol)) +(defmethod check-crossing-distance ((this com-airlock) (arg0 vector) (arg1 symbol)) (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans))) ) @@ -216,7 +214,7 @@ ;; definition for method 23 of type com-airlock ;; WARN: Return type mismatch object vs symbol. -(defmethod want-cross-airlock? com-airlock ((this com-airlock)) +(defmethod want-cross-airlock? ((this com-airlock)) (local-vars (a0-12 entity-actor)) (let* ((tgt (target-pos 0)) (f30-0 (check-crossing-distance this tgt #t)) @@ -268,7 +266,7 @@ ) ;; definition for method 24 of type com-airlock -(defmethod destination-loaded? com-airlock ((this com-airlock) (display? symbol)) +(defmethod destination-loaded? ((this com-airlock) (display? symbol)) (let ((level-list (the-as pair (script-eval (-> this level-name)))) (borrow-lev-name #f) ) @@ -343,7 +341,7 @@ ) ;; definition for method 26 of type com-airlock -(defmethod rotate-gear! com-airlock ((this com-airlock) (arg0 float)) +(defmethod rotate-gear! ((this com-airlock) (arg0 float)) (when (nonzero? (-> this gear)) (if (and (zero? (-> this gear-sound-id)) (-> this sound-gear) @@ -361,7 +359,7 @@ ;; definition for method 27 of type com-airlock ;; WARN: Return type mismatch int vs none. -(defmethod play-city-voice-sound com-airlock ((this com-airlock) (arg0 symbol)) +(defmethod play-city-voice-sound ((this com-airlock) (arg0 symbol)) (let ((gp-0 (the-as (array string) #f))) (case arg0 (('enter) @@ -823,14 +821,10 @@ ;; definition of type com-airlock-outer (deftype com-airlock-outer (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type com-airlock-outer -(defmethod inspect com-airlock-outer ((this com-airlock-outer)) +(defmethod inspect ((this com-airlock-outer)) (when (not this) (set! this this) (goto cfg-4) @@ -844,7 +838,7 @@ ;; definition for method 11 of type com-airlock-outer ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! com-airlock-outer ((this com-airlock-outer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this com-airlock-outer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -907,14 +901,10 @@ This commonly includes things such as: ;; definition of type com-airlock-inner (deftype com-airlock-inner (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type com-airlock-inner -(defmethod inspect com-airlock-inner ((this com-airlock-inner)) +(defmethod inspect ((this com-airlock-inner)) (when (not this) (set! this this) (goto cfg-4) @@ -928,7 +918,7 @@ This commonly includes things such as: ;; definition for method 11 of type com-airlock-inner ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! com-airlock-inner ((this com-airlock-inner) (arg0 entity-actor)) +(defmethod init-from-entity! ((this com-airlock-inner) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1008,14 +998,10 @@ This commonly includes things such as: ;; definition of type fort-entry-gate (deftype fort-entry-gate (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type fort-entry-gate -(defmethod inspect fort-entry-gate ((this fort-entry-gate)) +(defmethod inspect ((this fort-entry-gate)) (when (not this) (set! this this) (goto cfg-4) @@ -1029,7 +1015,7 @@ This commonly includes things such as: ;; definition for method 11 of type fort-entry-gate ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-entry-gate ((this fort-entry-gate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-entry-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1090,14 +1076,10 @@ This commonly includes things such as: ;; definition of type hip-door-a (deftype hip-door-a (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type hip-door-a -(defmethod inspect hip-door-a ((this hip-door-a)) +(defmethod inspect ((this hip-door-a)) (when (not this) (set! this this) (goto cfg-4) @@ -1111,7 +1093,7 @@ This commonly includes things such as: ;; definition for method 11 of type hip-door-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-door-a ((this hip-door-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-door-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1174,14 +1156,10 @@ This commonly includes things such as: ;; definition of type tomb-mar-door (deftype tomb-mar-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type tomb-mar-door -(defmethod inspect tomb-mar-door ((this tomb-mar-door)) +(defmethod inspect ((this tomb-mar-door)) (when (not this) (set! this this) (goto cfg-4) @@ -1195,7 +1173,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-mar-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-mar-door ((this tomb-mar-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-mar-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1237,14 +1215,10 @@ This commonly includes things such as: ;; definition of type cas-front-door (deftype cas-front-door (com-airlock-outer) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type cas-front-door -(defmethod inspect cas-front-door ((this cas-front-door)) +(defmethod inspect ((this cas-front-door)) (when (not this) (set! this this) (goto cfg-4) @@ -1266,14 +1240,10 @@ This commonly includes things such as: ;; definition of type pal-throne-door (deftype pal-throne-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type pal-throne-door -(defmethod inspect pal-throne-door ((this pal-throne-door)) +(defmethod inspect ((this pal-throne-door)) (when (not this) (set! this this) (goto cfg-4) @@ -1287,7 +1257,7 @@ This commonly includes things such as: ;; definition for method 11 of type pal-throne-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-throne-door ((this pal-throne-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-throne-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1349,14 +1319,10 @@ This commonly includes things such as: ;; definition of type vin-door-ctyinda (deftype vin-door-ctyinda (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type vin-door-ctyinda -(defmethod inspect vin-door-ctyinda ((this vin-door-ctyinda)) +(defmethod inspect ((this vin-door-ctyinda)) (when (not this) (set! this this) (goto cfg-4) @@ -1370,7 +1336,7 @@ This commonly includes things such as: ;; definition for method 11 of type vin-door-ctyinda ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vin-door-ctyinda ((this vin-door-ctyinda) (arg0 entity-actor)) +(defmethod init-from-entity! ((this vin-door-ctyinda) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1432,14 +1398,10 @@ This commonly includes things such as: ;; definition of type under-door (deftype under-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type under-door -(defmethod inspect under-door ((this under-door)) +(defmethod inspect ((this under-door)) (when (not this) (set! this this) (goto cfg-4) @@ -1453,7 +1415,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-door ((this under-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1515,14 +1477,10 @@ This commonly includes things such as: ;; definition of type oracle-door (deftype oracle-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type oracle-door -(defmethod inspect oracle-door ((this oracle-door)) +(defmethod inspect ((this oracle-door)) (when (not this) (set! this this) (goto cfg-4) @@ -1536,7 +1494,7 @@ This commonly includes things such as: ;; definition for method 11 of type oracle-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! oracle-door ((this oracle-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this oracle-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/common/battle_REF.gc b/test/decompiler/reference/jak2/levels/common/battle_REF.gc index 2f06eefc7ae..bc09d124abc 100644 --- a/test/decompiler/reference/jak2/levels/common/battle_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/battle_REF.gc @@ -3,30 +3,27 @@ ;; definition of type battle-info (deftype battle-info (basic) - ((id int8 :offset-assert 4) - (notice-spec uint64 :offset-assert 8) - (pick-logic int8 :offset-assert 16) - (notice-distance float :offset-assert 20) - (dont-spawn-initial-until-notice? symbol :offset-assert 24) - (play-battle-music symbol :offset-assert 28) - (min-battle-spawn-delay uint32 :offset-assert 32) - (max-battle-spawn-delay uint32 :offset-assert 36) - (min-spawner-notice-attack-delay uint32 :offset-assert 40) - (max-spawner-notice-attack-delay uint32 :offset-assert 44) - (spawner-blocked-by-player-xz float :offset-assert 48) - (spawner-blocked-by-collide-radius float :offset-assert 52) - (pick-spawner-max-dist float :offset-assert 56) - (max-count uint32 :offset-assert 60) - (desired-alive-count uint8 :offset-assert 64) - (spawner-collide-with collide-spec :offset-assert 68) + ((id int8) + (notice-spec uint64) + (pick-logic int8) + (notice-distance float) + (dont-spawn-initial-until-notice? symbol) + (play-battle-music symbol) + (min-battle-spawn-delay uint32) + (max-battle-spawn-delay uint32) + (min-spawner-notice-attack-delay uint32) + (max-spawner-notice-attack-delay uint32) + (spawner-blocked-by-player-xz float) + (spawner-blocked-by-collide-radius float) + (pick-spawner-max-dist float) + (max-count uint32) + (desired-alive-count uint8) + (spawner-collide-with collide-spec) ) - :method-count-assert 9 - :size-assert #x48 - :flag-assert #x900000048 ) ;; definition for method 3 of type battle-info -(defmethod inspect battle-info ((this battle-info)) +(defmethod inspect ((this battle-info)) (when (not this) (set! this this) (goto cfg-4) @@ -54,15 +51,12 @@ ;; definition of type battle-ally (deftype battle-ally (structure) - ((entity entity-actor :offset-assert 0) + ((entity entity-actor) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type battle-ally -(defmethod inspect battle-ally ((this battle-ally)) +(defmethod inspect ((this battle-ally)) (when (not this) (set! this this) (goto cfg-4) @@ -75,15 +69,12 @@ ;; definition of type battle-ally-array (deftype battle-ally-array (inline-array-class) - ((data battle-ally :inline :dynamic :offset-assert 16) + ((data battle-ally :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type battle-ally-array -(defmethod inspect battle-ally-array ((this battle-ally-array)) +(defmethod inspect ((this battle-ally-array)) (when (not this) (set! this this) (goto cfg-4) @@ -101,16 +92,13 @@ ;; definition of type battle-breed (deftype battle-breed (structure) - ((breed-type type :offset-assert 0) - (percent float :offset-assert 4) + ((breed-type type) + (percent float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type battle-breed -(defmethod inspect battle-breed ((this battle-breed)) +(defmethod inspect ((this battle-breed)) (when (not this) (set! this this) (goto cfg-4) @@ -124,15 +112,12 @@ ;; definition of type battle-breed-array (deftype battle-breed-array (inline-array-class) - ((data battle-breed :inline :dynamic :offset-assert 16) + ((data battle-breed :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type battle-breed-array -(defmethod inspect battle-breed-array ((this battle-breed-array)) +(defmethod inspect ((this battle-breed-array)) (when (not this) (set! this this) (goto cfg-4) @@ -150,27 +135,24 @@ ;; definition of type battle-spawner (deftype battle-spawner (structure) - ((flags battle-spawner-flags :offset-assert 0) - (entity entity-actor :offset-assert 8) - (breeds battle-breed-array :offset-assert 12) - (creature-index int8 :offset-assert 16) - (ready-index int8 :offset-assert 17) - (attack-index int8 :offset-assert 18) - (mode uint8 :offset-assert 19) - (intro-path path-control :offset-assert 20) - (notice-attack-delay uint32 :offset-assert 24) - (creature handle :offset-assert 32) - (last-spawn-time time-frame :offset-assert 40) - (noticed-attack-time time-frame :offset-assert 48) - (attack-pos vector :inline :offset-assert 64) + ((flags battle-spawner-flags) + (entity entity-actor) + (breeds battle-breed-array) + (creature-index int8) + (ready-index int8) + (attack-index int8) + (mode uint8) + (intro-path path-control) + (notice-attack-delay uint32) + (creature handle) + (last-spawn-time time-frame) + (noticed-attack-time time-frame) + (attack-pos vector :inline) ) - :method-count-assert 9 - :size-assert #x50 - :flag-assert #x900000050 ) ;; definition for method 3 of type battle-spawner -(defmethod inspect battle-spawner ((this battle-spawner)) +(defmethod inspect ((this battle-spawner)) (when (not this) (set! this this) (goto cfg-4) @@ -195,15 +177,12 @@ ;; definition of type battle-spawner-array (deftype battle-spawner-array (inline-array-class) - ((data battle-spawner :inline :dynamic :offset-assert 16) + ((data battle-spawner :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type battle-spawner-array -(defmethod inspect battle-spawner-array ((this battle-spawner-array)) +(defmethod inspect ((this battle-spawner-array)) (when (not this) (set! this this) (goto cfg-4) @@ -221,65 +200,63 @@ ;; definition of type battle (deftype battle (process-drawable) - ((info battle-info :offset-assert 200) - (flags battle-flags :offset-assert 204) - (spawn-initial-creatures? symbol :offset-assert 208) - (next-spawn-delay uint32 :offset-assert 212) - (on-notice basic :offset-assert 216) - (on-hostile basic :offset-assert 220) - (on-beaten basic :offset-assert 224) - (max-count uint32 :offset-assert 228) - (count uint32 :offset-assert 232) - (die-count uint32 :offset-assert 236) - (stat-child-count uint16 :offset-assert 240) - (cant-spawn-time time-frame :offset-assert 248) - (jammed-starting-time time-frame :offset-assert 256) - (spawners battle-spawner-array :offset-assert 264) - (allies battle-ally-array :offset-assert 268) + ((info battle-info) + (flags battle-flags) + (spawn-initial-creatures? symbol) + (next-spawn-delay uint32) + (on-notice basic) + (on-hostile basic) + (on-beaten basic) + (max-count uint32) + (count uint32) + (die-count uint32) + (stat-child-count uint16) + (cant-spawn-time time-frame) + (jammed-starting-time time-frame) + (spawners battle-spawner-array) + (allies battle-ally-array) ) - :heap-base #x90 - :method-count-assert 53 - :size-assert #x110 - :flag-assert #x3500900110 + (:state-methods + idle + battle-state-21 + notice + hostile + beaten + ) (:methods - (idle () _type_ :state 20) - (battle-method-21 () none 21) - (notice () _type_ :state 22) - (hostile () _type_ :state 23) - (beaten () _type_ :state 24) - (spawner-blocked? (_type_ battle-spawner) symbol 25) - (spawner-blocked-by-collide? (_type_ battle-spawner) symbol 26) - (draw-battle-marks (_type_) none 27) - (initialize-enemy-lists (_type_) none 28) - (initialize-spawner-breeds (_type_ battle-spawner entity-actor) none 29) - (get-spawner-for-enemy (_type_ process) battle-spawner 30) - (initialize-ally (_type_ battle-ally entity-actor) none 31) - (initialize-spawner (_type_ battle-spawner entity-actor) none 32) - (initialize-battle (_type_) none 33) - (init-go (_type_) int 34) - (get-spawn-delay (_type_) int 35) - (get-best-spawner (_type_) battle-spawner 36) - (spawner-free? (_type_ battle-spawner) symbol 37) - (spawn-from-breed (_type_ battle-breed enemy-init-by-other-params) handle 38) - (spawn-from-spawner (_type_ battle-spawner symbol) none 39) - (spawn-initial-creatures (_type_) none 40) - (get-random-breed (_type_ battle-spawner) battle-breed 41) - (spawner-hit (_type_ battle-spawner process) symbol 42) - (spawner-try-jump (_type_ battle-spawner enemy) symbol 43) - (spawner-do-jump (_type_ battle-spawner) int 44) - (spawner-hittable? (_type_ battle-spawner) symbol 45) - (spawner-in-intro? (_type_ battle-spawner) symbol 46) - (set-battle-music (_type_) none 47) - (unset-battle-music (_type_) none 48) - (update-allies-list (_type_) int :behavior battle 49) - (beaten? (_type_) symbol 50) - (spawner-active? (_type_ battle-spawner symbol) symbol :behavior battle 51) - (spawner-active-count (_type_) int 52) + (spawner-blocked? (_type_ battle-spawner) symbol) + (spawner-blocked-by-collide? (_type_ battle-spawner) symbol) + (draw-battle-marks (_type_) none) + (initialize-enemy-lists (_type_) none) + (initialize-spawner-breeds (_type_ battle-spawner entity-actor) none) + (get-spawner-for-enemy (_type_ process) battle-spawner) + (initialize-ally (_type_ battle-ally entity-actor) none) + (initialize-spawner (_type_ battle-spawner entity-actor) none) + (initialize-battle (_type_) none) + (init-go (_type_) int) + (get-spawn-delay (_type_) int) + (get-best-spawner (_type_) battle-spawner) + (spawner-free? (_type_ battle-spawner) symbol) + (spawn-from-breed (_type_ battle-breed enemy-init-by-other-params) handle) + (spawn-from-spawner (_type_ battle-spawner symbol) none) + (spawn-initial-creatures (_type_) none) + (get-random-breed (_type_ battle-spawner) battle-breed) + (spawner-hit (_type_ battle-spawner process) symbol) + (spawner-try-jump (_type_ battle-spawner enemy) symbol) + (spawner-do-jump (_type_ battle-spawner) int) + (spawner-hittable? (_type_ battle-spawner) symbol) + (spawner-in-intro? (_type_ battle-spawner) symbol) + (set-battle-music (_type_) none) + (unset-battle-music (_type_) none) + (update-allies-list (_type_) int :behavior battle) + (beaten? (_type_) symbol) + (spawner-active? (_type_ battle-spawner symbol) symbol :behavior battle) + (spawner-active-count (_type_) int) ) ) ;; definition for method 3 of type battle -(defmethod inspect battle ((this battle)) +(defmethod inspect ((this battle)) (when (not this) (set! this this) (goto cfg-4) @@ -944,7 +921,7 @@ ;; definition for method 27 of type battle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-battle-marks battle ((this battle)) +(defmethod draw-battle-marks ((this battle)) (local-vars (sv-16 string) (sv-32 string)) (let ((s4-0 (-> this root trans)) (s5-0 (the-as int (-> this max-count))) @@ -1011,7 +988,7 @@ ;; definition for method 26 of type battle ;; INFO: Used lq/sq -(defmethod spawner-blocked-by-collide? battle ((this battle) (arg0 battle-spawner)) +(defmethod spawner-blocked-by-collide? ((this battle) (arg0 battle-spawner)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -1127,7 +1104,7 @@ ) ;; definition for method 25 of type battle -(defmethod spawner-blocked? battle ((this battle) (arg0 battle-spawner)) +(defmethod spawner-blocked? ((this battle) (arg0 battle-spawner)) (when (not (logtest? (-> this flags) (battle-flags no-spawner-block))) (let ((f0-0 (-> this info spawner-blocked-by-player-xz))) (if (and (< 0.0 f0-0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 attack-pos)))) @@ -1144,14 +1121,14 @@ ) ;; definition for method 37 of type battle -(defmethod spawner-free? battle ((this battle) (arg0 battle-spawner)) +(defmethod spawner-free? ((this battle) (arg0 battle-spawner)) (and (not (handle->process (-> arg0 creature))) (or (>= (-> arg0 ready-index) 0) (not (spawner-blocked? this arg0))) ) ) ;; definition for method 36 of type battle -(defmethod get-best-spawner battle ((this battle)) +(defmethod get-best-spawner ((this battle)) (let ((s5-0 (-> this spawners length)) (v1-2 (-> this info pick-logic)) ) @@ -1199,7 +1176,7 @@ ) ;; definition for method 41 of type battle -(defmethod get-random-breed battle ((this battle) (arg0 battle-spawner)) +(defmethod get-random-breed ((this battle) (arg0 battle-spawner)) (let ((f0-0 (rand-vu)) (v1-0 0) ) @@ -1219,7 +1196,7 @@ ;; definition for method 38 of type battle ;; WARN: Return type mismatch int vs handle. -(defmethod spawn-from-breed battle ((this battle) (arg0 battle-breed) (arg1 enemy-init-by-other-params)) +(defmethod spawn-from-breed ((this battle) (arg0 battle-breed) (arg1 enemy-init-by-other-params)) (let* ((s3-0 (-> arg0 breed-type)) (s4-0 (get-process *default-dead-pool* s3-0 #x4000)) (v1-1 (when s4-0 @@ -1242,7 +1219,7 @@ ;; definition for method 39 of type battle ;; INFO: Used lq/sq ;; WARN: Return type mismatch handle vs none. -(defmethod spawn-from-spawner battle ((this battle) (arg0 battle-spawner) (arg1 symbol)) +(defmethod spawn-from-spawner ((this battle) (arg0 battle-spawner) (arg1 symbol)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'quaternion)) (s2-0 (-> arg0 intro-path)) @@ -1303,7 +1280,7 @@ ) ;; definition for method 30 of type battle -(defmethod get-spawner-for-enemy battle ((this battle) (arg0 process)) +(defmethod get-spawner-for-enemy ((this battle) (arg0 process)) (let ((v1-0 (if (type? arg0 nav-enemy) (the-as nav-enemy arg0) ) @@ -1329,7 +1306,7 @@ ) ;; definition for method 51 of type battle -(defmethod spawner-active? battle ((this battle) (arg0 battle-spawner) (arg1 symbol)) +(defmethod spawner-active? ((this battle) (arg0 battle-spawner) (arg1 symbol)) (when (and (logtest? (-> this flags) (battle-flags active)) (not (logtest? (-> this flags) (battle-flags beaten)))) (let ((v1-5 (-> arg0 noticed-attack-time))) (cond @@ -1378,7 +1355,7 @@ ) ;; definition for method 46 of type battle -(defmethod spawner-in-intro? battle ((this battle) (arg0 battle-spawner)) +(defmethod spawner-in-intro? ((this battle) (arg0 battle-spawner)) (when (-> arg0 intro-path) (let ((v1-1 (-> arg0 creature-index)) (a0-1 (-> arg0 attack-index)) @@ -1389,7 +1366,7 @@ ) ;; definition for method 43 of type battle -(defmethod spawner-try-jump battle ((this battle) (arg0 battle-spawner) (arg1 enemy)) +(defmethod spawner-try-jump ((this battle) (arg0 battle-spawner) (arg1 enemy)) (let ((s3-0 (+ (-> arg0 creature-index) 1)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -1414,7 +1391,7 @@ ) ;; definition for method 45 of type battle -(defmethod spawner-hittable? battle ((this battle) (arg0 battle-spawner)) +(defmethod spawner-hittable? ((this battle) (arg0 battle-spawner)) (when (logtest? (-> arg0 flags) (battle-spawner-flags hit)) (if (-> arg0 intro-path) (>= (-> arg0 creature-index) (-> arg0 attack-index)) @@ -1424,7 +1401,7 @@ ) ;; definition for method 42 of type battle -(defmethod spawner-hit battle ((this battle) (arg0 battle-spawner) (arg1 process)) +(defmethod spawner-hit ((this battle) (arg0 battle-spawner) (arg1 process)) (let ((s5-0 (-> arg0 creature))) (set! (-> arg0 creature) (the-as handle #f)) (cond @@ -1440,7 +1417,7 @@ ) ;; definition for method 44 of type battle -(defmethod spawner-do-jump battle ((this battle) (arg0 battle-spawner)) +(defmethod spawner-do-jump ((this battle) (arg0 battle-spawner)) (when (= (-> arg0 mode) 2) (+! (-> arg0 creature-index) 1) (set! (-> arg0 mode) (the-as uint 0)) @@ -1450,7 +1427,7 @@ ) ;; definition for method 52 of type battle -(defmethod spawner-active-count battle ((this battle)) +(defmethod spawner-active-count ((this battle)) (let ((gp-0 0)) (dotimes (s4-0 (-> this spawners length)) (if (spawner-active? this (-> this spawners data s4-0) #t) @@ -1463,7 +1440,7 @@ ;; definition for method 40 of type battle ;; WARN: Return type mismatch int vs none. -(defmethod spawn-initial-creatures battle ((this battle)) +(defmethod spawn-initial-creatures ((this battle)) (set! (-> this spawn-initial-creatures?) #f) (let ((s5-0 (-> this spawners))) (dotimes (s4-0 (-> s5-0 length)) @@ -1484,7 +1461,7 @@ ) ;; definition for method 35 of type battle -(defmethod get-spawn-delay battle ((this battle)) +(defmethod get-spawn-delay ((this battle)) (let ((v1-0 (-> this info))) (rand-vu-int-range (the-as int (-> v1-0 min-battle-spawn-delay)) @@ -1561,7 +1538,7 @@ ) ;; definition for method 49 of type battle -(defmethod update-allies-list battle ((this battle)) +(defmethod update-allies-list ((this battle)) (let ((v1-0 (-> this allies)) (gp-0 (-> this allies length)) ) @@ -1584,7 +1561,7 @@ ) ;; definition for method 50 of type battle -(defmethod beaten? battle ((this battle)) +(defmethod beaten? ((this battle)) (let ((s5-0 (spawner-active-count this)) (v1-2 (update-allies-list this)) (a1-0 (-> this child)) @@ -1703,7 +1680,7 @@ ;; definition for method 47 of type battle ;; WARN: Return type mismatch battle-flags vs none. -(defmethod set-battle-music battle ((this battle)) +(defmethod set-battle-music ((this battle)) (let ((a3-0 (-> this info play-battle-music))) (when (and a3-0 (not (logtest? (-> this flags) (battle-flags battle-music-set)))) (case a3-0 @@ -1722,7 +1699,7 @@ ;; definition for method 48 of type battle ;; WARN: Return type mismatch int vs none. -(defmethod unset-battle-music battle ((this battle)) +(defmethod unset-battle-music ((this battle)) (when (logtest? (-> this flags) (battle-flags battle-music-set)) (remove-setting! 'sound-mode) (remove-setting! 'music) @@ -1732,7 +1709,7 @@ ) ;; definition for method 7 of type battle-spawner-array -(defmethod relocate battle-spawner-array ((this battle-spawner-array) (arg0 int)) +(defmethod relocate ((this battle-spawner-array) (arg0 int)) (dotimes (v1-0 (-> this length)) (let ((a2-3 (-> this data v1-0))) (&+! (-> a2-3 breeds) arg0) @@ -1745,7 +1722,7 @@ ) ;; definition for method 7 of type battle -(defmethod relocate battle ((this battle) (arg0 int)) +(defmethod relocate ((this battle) (arg0 int)) (&+! (-> this spawners) arg0) (&+! (-> this allies) arg0) (call-parent-method this arg0) @@ -1754,7 +1731,7 @@ ;; definition for method 29 of type battle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod initialize-spawner-breeds battle ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) +(defmethod initialize-spawner-breeds ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) (let ((s2-0 0) (s5-0 0) @@ -1841,7 +1818,7 @@ ;; definition for method 32 of type battle ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod initialize-spawner battle ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) +(defmethod initialize-spawner ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) (set! (-> arg0 flags) (battle-spawner-flags)) (set! (-> arg0 entity) arg1) (set! (-> arg0 creature-index) 0) @@ -1887,7 +1864,7 @@ ;; definition for method 31 of type battle ;; WARN: Return type mismatch int vs none. -(defmethod initialize-ally battle ((this battle) (arg0 battle-ally) (arg1 entity-actor)) +(defmethod initialize-ally ((this battle) (arg0 battle-ally) (arg1 entity-actor)) (set! (-> arg0 entity) arg1) 0 (none) @@ -1896,7 +1873,7 @@ ;; definition for method 28 of type battle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod initialize-enemy-lists battle ((this battle)) +(defmethod initialize-enemy-lists ((this battle)) (local-vars (v0-4 battle-ally-array) (sv-16 res-tag) (sv-32 entity)) (set! sv-16 (new 'static 'res-tag)) (let ((v0-0 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) @@ -1963,7 +1940,7 @@ ;; definition for method 33 of type battle ;; WARN: Return type mismatch int vs none. -(defmethod initialize-battle battle ((this battle)) +(defmethod initialize-battle ((this battle)) (set! (-> this spawn-initial-creatures?) #t) (set! (-> this count) (the-as uint 0)) (set! (-> this die-count) (the-as uint 0)) @@ -2003,7 +1980,7 @@ ) ;; definition for method 34 of type battle -(defmethod init-go battle ((this battle)) +(defmethod init-go ((this battle)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) (go (method-of-object this beaten)) (go (method-of-object this idle)) @@ -2014,7 +1991,7 @@ ;; definition for method 11 of type battle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-from-entity! battle ((this battle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this battle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc b/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc index 9757a8916da..2e80e6f661f 100644 --- a/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc @@ -3,19 +3,16 @@ ;; definition of type elec-gate-params (deftype elec-gate-params (structure) - ((bolt-spec lightning-spec :offset-assert 0) - (ring-spec lightning-spec :offset-assert 4) - (ring-radius-min float :offset-assert 8) - (ring-radius-max float :offset-assert 12) - (speed-mult float :offset-assert 16) + ((bolt-spec lightning-spec) + (ring-spec lightning-spec) + (ring-radius-min float) + (ring-radius-max float) + (speed-mult float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type elec-gate-params -(defmethod inspect elec-gate-params ((this elec-gate-params)) +(defmethod inspect ((this elec-gate-params)) (when (not this) (set! this this) (goto cfg-4) @@ -32,18 +29,15 @@ ;; definition of type elec-gate-bolt (deftype elec-gate-bolt (structure) - ((ring lightning-control 2 :offset-assert 0) - (bolt lightning-control :offset-assert 8) - (ring-radius float :offset-assert 12) - (pos float :offset-assert 16) + ((ring lightning-control 2) + (bolt lightning-control) + (ring-radius float) + (pos float) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type elec-gate-bolt -(defmethod inspect elec-gate-bolt ((this elec-gate-bolt)) +(defmethod inspect ((this elec-gate-bolt)) (when (not this) (set! this this) (goto cfg-4) @@ -59,16 +53,13 @@ ;; definition of type elec-wall (deftype elec-wall (structure) - ((pos vector :inline :offset-assert 0) - (dir vector :inline :offset-assert 16) + ((pos vector :inline) + (dir vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type elec-wall -(defmethod inspect elec-wall ((this elec-wall)) +(defmethod inspect ((this elec-wall)) (when (not this) (set! this this) (goto cfg-4) @@ -82,43 +73,41 @@ ;; definition of type elec-gate (deftype elec-gate (process-drawable) - ((params elec-gate-params :offset-assert 200) - (path-l path-control :offset 152) - (path-r path-control :offset-assert 204) - (l-bolt elec-gate-bolt 5 :inline :offset-assert 208) - (part-on sparticle-launch-control :offset 168) - (part-off sparticle-launch-control :offset-assert 368) - (part-spawner-left part-spawner :offset-assert 372) - (part-spawner-right part-spawner :offset-assert 376) - (on-start pair :offset-assert 380) - (on-stop pair :offset-assert 384) - (dividing-wall elec-wall :inline :offset-assert 400) - (plane elec-wall 2 :inline :offset-assert 432) - (wall-y float :offset-assert 496) - (wall-xz float :offset-assert 500) - (lightning-quality float :offset-assert 504) - (quality-enabled? symbol :offset-assert 508) + ((params elec-gate-params) + (path-l path-control :overlay-at path) + (path-r path-control) + (l-bolt elec-gate-bolt 5 :inline) + (part-on sparticle-launch-control :overlay-at part) + (part-off sparticle-launch-control) + (part-spawner-left part-spawner) + (part-spawner-right part-spawner) + (on-start pair) + (on-stop pair) + (dividing-wall elec-wall :inline) + (plane elec-wall 2 :inline) + (wall-y float) + (wall-xz float) + (lightning-quality float) + (quality-enabled? symbol) ) - :heap-base #x180 - :method-count-assert 30 - :size-assert #x200 - :flag-assert #x1e01800200 + (:state-methods + idle + active + shutdown + ) (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (shutdown () _type_ :state 22) - (get-params (_type_) elec-gate-params 23) - (elec-gate-method-24 (_type_) none 24) - (set-palette! (_type_) none 25) - (set-state! (_type_) none 26) - (spawn-particles (_type_ sparticle-launch-control) none 27) - (set-elec-scale-if-close! (_type_ float) none 28) - (set-elec-scale! (_type_ float) none 29) + (get-params (_type_) elec-gate-params) + (elec-gate-method-24 (_type_) none) + (set-palette! (_type_) none) + (set-state! (_type_) none) + (spawn-particles (_type_ sparticle-launch-control) none) + (set-elec-scale-if-close! (_type_ float) none) + (set-elec-scale! (_type_ float) none) ) ) ;; definition for method 3 of type elec-gate -(defmethod inspect elec-gate ((this elec-gate)) +(defmethod inspect ((this elec-gate)) (when (not this) (set! this this) (goto cfg-4) @@ -782,7 +771,7 @@ ;; definition for method 28 of type elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-elec-scale-if-close! elec-gate ((this elec-gate) (arg0 float)) +(defmethod set-elec-scale-if-close! ((this elec-gate) (arg0 float)) "If [[target]]'s position is within `80` [[meters]], set the scale to the value provided @see [[elec-gate::29]]" (if (< (vector-vector-distance (-> this root trans) (target-pos 0)) 327680.0) @@ -794,7 +783,7 @@ ;; definition for method 27 of type elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod spawn-particles elec-gate ((this elec-gate) (sparticle-lc sparticle-launch-control)) +(defmethod spawn-particles ((this elec-gate) (sparticle-lc sparticle-launch-control)) "TODO - Calls [[sparticle-launch-control::11]] on `part-spawner-left` and `part-spawner-right` if they are defined" (if (-> this part-spawner-left) (spawn sparticle-lc (the-as vector (&-> (-> this part-spawner-left child) 8))) @@ -808,7 +797,7 @@ ;; definition for method 7 of type elec-gate ;; WARN: Return type mismatch process-drawable vs elec-gate. -(defmethod relocate elec-gate ((this elec-gate) (new-addr int)) +(defmethod relocate ((this elec-gate) (new-addr int)) (dotimes (bolt-idx 5) (let ((left-bolt (-> this l-bolt bolt-idx))) (if (nonzero? (-> left-bolt bolt)) @@ -834,28 +823,28 @@ ) ;; definition for method 10 of type elec-gate -(defmethod deactivate elec-gate ((this elec-gate)) +(defmethod deactivate ((this elec-gate)) (set-elec-scale-if-close! this 0.0) (call-parent-method this) (none) ) ;; definition for method 23 of type elec-gate -(defmethod get-params elec-gate ((this elec-gate)) +(defmethod get-params ((this elec-gate)) "@returns [[*default-elec-gate-params*]] by default" *default-elec-gate-params* ) ;; definition for method 24 of type elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod elec-gate-method-24 elec-gate ((this elec-gate)) +(defmethod elec-gate-method-24 ((this elec-gate)) 0 (none) ) ;; definition for method 25 of type elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-palette! elec-gate ((this elec-gate)) +(defmethod set-palette! ((this elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" 0 (none) @@ -863,7 +852,7 @@ ;; definition for method 26 of type elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-state! elec-gate ((this elec-gate)) +(defmethod set-state! ((this elec-gate)) "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed make the gate `idle`. @@ -880,7 +869,7 @@ Otherwise, the gate will be `active`." ;; definition for method 11 of type elec-gate ;; INFO: Used lq/sq -(defmethod init-from-entity! elec-gate ((this elec-gate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this elec-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -962,16 +951,12 @@ This commonly includes things such as: ;; definition of type fort-elec-gate (deftype fort-elec-gate (elec-gate) - ((palette-id int32 :offset-assert 512) + ((palette-id int32) ) - :heap-base #x190 - :method-count-assert 30 - :size-assert #x204 - :flag-assert #x1e01900204 ) ;; definition for method 3 of type fort-elec-gate -(defmethod inspect fort-elec-gate ((this fort-elec-gate)) +(defmethod inspect ((this fort-elec-gate)) (when (not this) (set! this this) (goto cfg-4) @@ -986,7 +971,7 @@ This commonly includes things such as: ;; definition for method 29 of type fort-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-elec-scale! fort-elec-gate ((this fort-elec-gate) (scale float)) +(defmethod set-elec-scale! ((this fort-elec-gate) (scale float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" @@ -999,7 +984,7 @@ This commonly includes things such as: ;; definition for method 25 of type fort-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-palette! fort-elec-gate ((this fort-elec-gate)) +(defmethod set-palette! ((this fort-elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 @@ -1008,16 +993,12 @@ This commonly includes things such as: ;; definition of type drill-elec-gate (deftype drill-elec-gate (elec-gate) - ((palette-id int32 :offset-assert 512) + ((palette-id int32) ) - :heap-base #x190 - :method-count-assert 30 - :size-assert #x204 - :flag-assert #x1e01900204 ) ;; definition for method 3 of type drill-elec-gate -(defmethod inspect drill-elec-gate ((this drill-elec-gate)) +(defmethod inspect ((this drill-elec-gate)) (when (not this) (set! this this) (goto cfg-4) @@ -1032,7 +1013,7 @@ This commonly includes things such as: ;; definition for method 29 of type drill-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-elec-scale! drill-elec-gate ((this drill-elec-gate) (arg0 float)) +(defmethod set-elec-scale! ((this drill-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" @@ -1043,7 +1024,7 @@ This commonly includes things such as: ;; definition for method 25 of type drill-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-palette! drill-elec-gate ((this drill-elec-gate)) +(defmethod set-palette! ((this drill-elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 @@ -1053,14 +1034,10 @@ This commonly includes things such as: ;; definition of type caspad-elec-gate (deftype caspad-elec-gate (elec-gate) () - :heap-base #x180 - :method-count-assert 30 - :size-assert #x200 - :flag-assert #x1e01800200 ) ;; definition for method 3 of type caspad-elec-gate -(defmethod inspect caspad-elec-gate ((this caspad-elec-gate)) +(defmethod inspect ((this caspad-elec-gate)) (when (not this) (set! this this) (goto cfg-4) @@ -1075,14 +1052,10 @@ This commonly includes things such as: ;; definition of type castle-elec-gate (deftype castle-elec-gate (elec-gate) () - :heap-base #x180 - :method-count-assert 30 - :size-assert #x200 - :flag-assert #x1e01800200 ) ;; definition for method 3 of type castle-elec-gate -(defmethod inspect castle-elec-gate ((this castle-elec-gate)) +(defmethod inspect ((this castle-elec-gate)) (when (not this) (set! this this) (goto cfg-4) @@ -1096,7 +1069,7 @@ This commonly includes things such as: ;; definition for method 29 of type castle-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-elec-scale! castle-elec-gate ((this castle-elec-gate) (arg0 float)) +(defmethod set-elec-scale! ((this castle-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" @@ -1151,23 +1124,19 @@ This commonly includes things such as: ) ;; definition for method 23 of type caspad-elec-gate -(defmethod get-params caspad-elec-gate ((this caspad-elec-gate)) +(defmethod get-params ((this caspad-elec-gate)) "@returns [[*default-elec-gate-params*]] by default" *caspad-elec-gate-params* ) ;; definition of type palroof-elec-gate (deftype palroof-elec-gate (elec-gate) - ((palette-id int32 :offset-assert 512) + ((palette-id int32) ) - :heap-base #x190 - :method-count-assert 30 - :size-assert #x204 - :flag-assert #x1e01900204 ) ;; definition for method 3 of type palroof-elec-gate -(defmethod inspect palroof-elec-gate ((this palroof-elec-gate)) +(defmethod inspect ((this palroof-elec-gate)) (when (not this) (set! this this) (goto cfg-4) @@ -1182,7 +1151,7 @@ This commonly includes things such as: ;; definition for method 29 of type palroof-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-elec-scale! palroof-elec-gate ((this palroof-elec-gate) (arg0 float)) +(defmethod set-elec-scale! ((this palroof-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" @@ -1193,7 +1162,7 @@ This commonly includes things such as: ;; definition for method 25 of type palroof-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-palette! palroof-elec-gate ((this palroof-elec-gate)) +(defmethod set-palette! ((this palroof-elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 diff --git a/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc index 83477c7d55d..0d06657b43c 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc @@ -3,25 +3,22 @@ ;; definition of type amphibian-tongue-attack-info (deftype amphibian-tongue-attack-info (structure) - ((targ-dist float :offset-assert 0) - (max-length float :offset-assert 4) - (start-pos vector :inline :offset-assert 16) - (base-dir vector :inline :offset-assert 32) - (base-rot vector :inline :offset-assert 48) - (targ-pos vector :inline :offset-assert 64) - (targ-dir vector :inline :offset-assert 80) - (targ-rot vector :inline :offset-assert 96) - (clamped-pos vector :inline :offset-assert 112) - (clamped-dir vector :inline :offset-assert 128) - (clamped-rot vector :inline :offset-assert 144) + ((targ-dist float) + (max-length float) + (start-pos vector :inline) + (base-dir vector :inline) + (base-rot vector :inline) + (targ-pos vector :inline) + (targ-dir vector :inline) + (targ-rot vector :inline) + (clamped-pos vector :inline) + (clamped-dir vector :inline) + (clamped-rot vector :inline) ) - :method-count-assert 9 - :size-assert #xa0 - :flag-assert #x9000000a0 ) ;; definition for method 3 of type amphibian-tongue-attack-info -(defmethod inspect amphibian-tongue-attack-info ((this amphibian-tongue-attack-info)) +(defmethod inspect ((this amphibian-tongue-attack-info)) (when (not this) (set! this this) (goto cfg-4) @@ -44,22 +41,19 @@ ;; definition of type amphibian-joint-mod (deftype amphibian-joint-mod (basic) - ((joint-index int32 :offset-assert 4) - (proc process-drawable :offset-assert 8) - (max-length float :offset-assert 12) - (target vector :inline :offset-assert 16) + ((joint-index int32) + (proc process-drawable) + (max-length float) + (target vector :inline) ) - :method-count-assert 10 - :size-assert #x20 - :flag-assert #xa00000020 (:methods - (new (symbol type process-drawable int) _type_ 0) - (amphibian-joint-mod-method-9 (_type_) none 9) + (new (symbol type process-drawable int) _type_) + (amphibian-joint-mod-method-9 (_type_) none) ) ) ;; definition for method 3 of type amphibian-joint-mod -(defmethod inspect amphibian-joint-mod ((this amphibian-joint-mod)) +(defmethod inspect ((this amphibian-joint-mod)) (when (not this) (set! this this) (goto cfg-4) @@ -82,15 +76,12 @@ ;; definition of type amphibian-anim-info (deftype amphibian-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type amphibian-anim-info -(defmethod inspect amphibian-anim-info ((this amphibian-anim-info)) +(defmethod inspect ((this amphibian-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -103,24 +94,21 @@ ;; definition of type amphibian-global-info (deftype amphibian-global-info (basic) - ((prev-blue-hit int8 :offset-assert 4) - (prev-knocked int8 :offset-assert 5) - (notice-anim int32 2 :offset-assert 8) - (run-anim int32 2 :offset-assert 16) - (knocked-anim int32 3 :offset-assert 24) - (knocked-land-anim int32 3 :offset-assert 36) - (blue-hit-anim int32 3 :offset-assert 48) - (jump-wind-up-anim int32 2 :offset-assert 60) - (jump-in-air-anim int32 2 :offset-assert 68) - (jump-land-anim int32 2 :offset-assert 76) + ((prev-blue-hit int8) + (prev-knocked int8) + (notice-anim int32 2) + (run-anim int32 2) + (knocked-anim int32 3) + (knocked-land-anim int32 3) + (blue-hit-anim int32 3) + (jump-wind-up-anim int32 2) + (jump-in-air-anim int32 2) + (jump-land-anim int32 2) ) - :method-count-assert 9 - :size-assert #x54 - :flag-assert #x900000054 ) ;; definition for method 3 of type amphibian-global-info -(defmethod inspect amphibian-global-info ((this amphibian-global-info)) +(defmethod inspect ((this amphibian-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -142,36 +130,34 @@ ;; definition of type amphibian (deftype amphibian (nav-enemy) - ((tongue-scale float :offset-assert 604) - (flags amphibian-flags :offset-assert 608) - (knocked-anim-index int8 :offset-assert 609) - (jump-anim-index int8 :offset-assert 610) - (tongue-mode uint64 :offset-assert 616) - (tongue-mod amphibian-joint-mod :offset-assert 624) - (attacker-handle handle :offset-assert 632) - (prev-ry float :offset-assert 640) - (prev-ry1 float :offset-assert 644) + ((tongue-scale float) + (flags amphibian-flags) + (knocked-anim-index int8) + (jump-anim-index int8) + (tongue-mode uint64) + (tongue-mod amphibian-joint-mod) + (attacker-handle handle) + (prev-ry float) + (prev-ry1 float) ) - :heap-base #x210 - :method-count-assert 188 - :size-assert #x288 - :flag-assert #xbc02100288 + (:state-methods + attack-forward + attack-forward-lunge + attack-forward-end + attack-spin + stare-idle + tongue-attack + ) (:methods - (attack-forward () _type_ :state 178) - (attack-forward-lunge () _type_ :state 179) - (attack-forward-end () _type_ :state 180) - (attack-spin () _type_ :state 181) - (stare-idle () _type_ :state 182) - (tongue-attack () _type_ :state 183) - (amphibian-method-184 (_type_ vector vector) vector 184) - (amphibian-method-185 (_type_ amphibian-tongue-attack-info) none 185) - (amphibian-method-186 (_type_ vector vector) symbol 186) - (amphibian-method-187 (_type_) none 187) + (amphibian-method-184 (_type_ vector vector) vector) + (amphibian-method-185 (_type_ amphibian-tongue-attack-info) none) + (amphibian-method-186 (_type_ vector vector) symbol) + (amphibian-method-187 (_type_) none) ) ) ;; definition for method 3 of type amphibian -(defmethod inspect amphibian ((this amphibian)) +(defmethod inspect ((this amphibian)) (when (not this) (set! this this) (goto cfg-4) @@ -348,13 +334,13 @@ (set! (-> *amphibian-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 7 of type amphibian-joint-mod -(defmethod relocate amphibian-joint-mod ((this amphibian-joint-mod) (arg0 int)) +(defmethod relocate ((this amphibian-joint-mod) (arg0 int)) (&+! (-> this proc) arg0) this ) ;; definition for method 74 of type amphibian -(defmethod general-event-handler amphibian ((this amphibian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this amphibian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -433,7 +419,7 @@ ;; definition for method 9 of type amphibian-joint-mod ;; WARN: Return type mismatch amphibian-joint-mod vs none. -(defmethod amphibian-joint-mod-method-9 amphibian-joint-mod ((this amphibian-joint-mod)) +(defmethod amphibian-joint-mod-method-9 ((this amphibian-joint-mod)) (let ((v1-3 (-> this proc node-list data (-> this joint-index)))) (set! (-> v1-3 param0) amphibian-joint-mod-callback) (set! (-> v1-3 param1) this) @@ -452,7 +438,7 @@ ;; definition for method 106 of type amphibian ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-106 amphibian ((this amphibian) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 ((this amphibian) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) (t9-0 this arg0 arg1 arg2 arg3) ) @@ -467,7 +453,7 @@ ) ;; definition for method 56 of type amphibian -(defmethod damage-amount-from-attack amphibian ((this amphibian) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this amphibian) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let* ((t9-0 (method-of-type nav-enemy damage-amount-from-attack)) (v0-0 (t9-0 this arg0 arg1)) @@ -482,7 +468,7 @@ ) ;; definition for method 51 of type amphibian -(defmethod enemy-method-51 amphibian ((this amphibian)) +(defmethod enemy-method-51 ((this amphibian)) (local-vars (f0-1 float)) 0.0 (set! f0-1 @@ -508,7 +494,7 @@ ;; definition for method 52 of type amphibian ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 amphibian ((this amphibian) (arg0 vector)) +(defmethod enemy-method-52 ((this amphibian) (arg0 vector)) (cond ((and (nonzero? (-> this hit-points)) (zero? (-> this fated-time)) (!= (-> this incoming knocked-type) 6)) (enemy-method-50 this arg0) @@ -525,7 +511,7 @@ ) ;; definition for method 77 of type amphibian -(defmethod enemy-method-77 amphibian ((this amphibian) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this amphibian) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((v1-3 (enemy-method-120 this 3 (ash 1 (-> *amphibian-global-info* prev-blue-hit)))) @@ -568,7 +554,7 @@ ) ;; definition for method 78 of type amphibian -(defmethod enemy-method-78 amphibian ((this amphibian) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this amphibian) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -608,7 +594,7 @@ ) ;; definition for method 89 of type amphibian -(defmethod enemy-method-89 amphibian ((this amphibian) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this amphibian) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -630,7 +616,7 @@ ) ;; definition for method 87 of type amphibian -(defmethod enemy-method-87 amphibian ((this amphibian) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this amphibian) (arg0 enemy-jump-info)) (let ((s4-0 (-> this draw art-group data (-> *amphibian-global-info* jump-in-air-anim (-> this jump-anim-index))))) (ja-channel-push! 1 (seconds 0.07)) (let ((a0-6 (-> this skel root-channel 0))) @@ -645,7 +631,7 @@ ) ;; definition for method 88 of type amphibian -(defmethod enemy-method-88 amphibian ((this amphibian) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this amphibian) (arg0 enemy-jump-info)) (let ((s4-0 (-> this draw art-group data (-> *amphibian-global-info* jump-land-anim (-> this jump-anim-index))))) (if (zero? (-> this jump-anim-index)) (ja-channel-push! 1 (seconds 0.07)) @@ -665,7 +651,7 @@ ;; definition for method 90 of type amphibian ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-90 amphibian ((this amphibian) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 ((this amphibian) (arg0 int) (arg1 enemy-jump-info)) (when (or (= (-> this jump-why) 3) (= (-> this jump-why) 2)) (cond ((zero? arg0) @@ -789,7 +775,7 @@ ) ;; definition for method 184 of type amphibian -(defmethod amphibian-method-184 amphibian ((this amphibian) (arg0 vector) (arg1 vector)) +(defmethod amphibian-method-184 ((this amphibian) (arg0 vector) (arg1 vector)) (vector<-cspace! arg0 (-> this node-list data 13)) (vector-! arg1 (-> this tongue-mod target) arg0) (vector-normalize! @@ -802,7 +788,7 @@ ;; definition for method 185 of type amphibian ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod amphibian-method-185 amphibian ((this amphibian) (arg0 amphibian-tongue-attack-info)) +(defmethod amphibian-method-185 ((this amphibian) (arg0 amphibian-tongue-attack-info)) (let ((a0-1 (-> this node-list data 11 bone transform))) (set! (-> arg0 base-dir quad) (-> a0-1 vector 2 quad)) ) @@ -866,7 +852,7 @@ ;; definition for method 186 of type amphibian ;; INFO: Used lq/sq -(defmethod amphibian-method-186 amphibian ((this amphibian) (arg0 vector) (arg1 vector)) +(defmethod amphibian-method-186 ((this amphibian) (arg0 vector) (arg1 vector)) (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -912,7 +898,7 @@ ;; definition for method 76 of type amphibian ;; WARN: Return type mismatch int vs symbol. -(defmethod enemy-method-76 amphibian ((this amphibian) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 ((this amphibian) (arg0 process) (arg1 event-message-block)) (let ((t9-0 (method-of-type nav-enemy enemy-method-76))) (t9-0 this (the-as process-focusable arg0) arg1) ) @@ -931,7 +917,7 @@ ) ;; definition for method 67 of type amphibian -(defmethod go-stare amphibian ((this amphibian)) +(defmethod go-stare ((this amphibian)) (let ((s5-0 (-> this focus aware))) (cond ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) @@ -956,7 +942,7 @@ ) ;; definition for method 70 of type amphibian -(defmethod go-hostile amphibian ((this amphibian)) +(defmethod go-hostile ((this amphibian)) (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -975,7 +961,7 @@ ) ;; definition for method 55 of type amphibian -(defmethod track-target! amphibian ((this amphibian)) +(defmethod track-target! ((this amphibian)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -988,7 +974,7 @@ ;; definition for method 187 of type amphibian ;; WARN: Return type mismatch int vs none. -(defmethod amphibian-method-187 amphibian ((this amphibian)) +(defmethod amphibian-method-187 ((this amphibian)) (with-pp (let* ((f30-0 (-> this nav state speed)) (f26-0 0.0) @@ -1798,7 +1784,7 @@ ;; definition for method 7 of type amphibian ;; WARN: Return type mismatch nav-enemy vs amphibian. -(defmethod relocate amphibian ((this amphibian) (arg0 int)) +(defmethod relocate ((this amphibian) (arg0 int)) (if (nonzero? (-> this tongue-mod)) (&+! (-> this tongue-mod) arg0) ) @@ -1807,7 +1793,7 @@ ;; definition for method 114 of type amphibian ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! amphibian ((this amphibian)) +(defmethod init-enemy-collision! ((this amphibian)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1887,7 +1873,7 @@ ;; definition for method 115 of type amphibian ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! amphibian ((this amphibian)) +(defmethod init-enemy! ((this amphibian)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (set! (-> this attacker-handle) (the-as handle #f)) (initialize-skeleton diff --git a/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc index 3af7e4a3175..85d81da7487 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc @@ -3,25 +3,23 @@ ;; definition of type bouncer (deftype bouncer (process-drawable) - ((spring-height meters :offset-assert 200) - (smush float :offset-assert 204) - (mods basic :offset-assert 208) + ((spring-height meters) + (smush float) + (mods basic) ) - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd4 - :flag-assert #x19006000d4 + (:state-methods + idle + fire + smush + ) (:methods - (idle () _type_ :state 20) - (fire () _type_ :state 21) - (smush () _type_ :state 22) - (init-skeleton! (_type_) none 23) - (bouncer-method-24 (_type_) none 24) + (init-skeleton! (_type_) none) + (bouncer-method-24 (_type_) none) ) ) ;; definition for method 3 of type bouncer -(defmethod inspect bouncer ((this bouncer)) +(defmethod inspect ((this bouncer)) (when (not this) (set! this this) (goto cfg-4) @@ -203,7 +201,7 @@ ;; definition for method 23 of type bouncer ;; WARN: Return type mismatch int vs none. -(defmethod init-skeleton! bouncer ((this bouncer)) +(defmethod init-skeleton! ((this bouncer)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bouncer" (the-as (pointer uint32) #f))) @@ -215,7 +213,7 @@ ;; definition for method 24 of type bouncer ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 bouncer ((this bouncer)) +(defmethod bouncer-method-24 ((this bouncer)) "TODO - collision stuff" (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) @@ -240,7 +238,7 @@ ;; definition for method 11 of type bouncer ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! bouncer ((this bouncer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bouncer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc index 75b988f6a6a..b24a5259696 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc @@ -155,14 +155,10 @@ ;; definition of type centurion-shot (deftype centurion-shot (metalhead-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type centurion-shot -(defmethod inspect centurion-shot ((this centurion-shot)) +(defmethod inspect ((this centurion-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -176,7 +172,7 @@ ;; definition for method 28 of type centurion-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound centurion-shot ((this centurion-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this centurion-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -196,7 +192,7 @@ ;; definition for method 31 of type centurion-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! centurion-shot ((this centurion-shot)) +(defmethod init-proj-settings! ((this centurion-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (call-parent-method this) (set! (-> this max-speed) 327680.0) @@ -206,34 +202,32 @@ ;; definition of type centurion (deftype centurion (nav-enemy) - ((los los-control :inline :offset-assert 608) - (target-pos vector :inline :offset-assert 768) - (can-shoot? basic :offset-assert 784) - (incoming-attack-id uint32 :offset-assert 788) - (can-take-damage? symbol :offset-assert 792) - (first-shoot? symbol :offset-assert 796) - (shoot-dir vector :inline :offset-assert 800) - (tar-pos vector :inline :offset-assert 816) - (joint joint-mod :offset-assert 832) - (joint-enable symbol :offset-assert 836) - (victory-sound sound-id :offset-assert 840) - (shield-shot uint32 :offset-assert 844) + ((los los-control :inline) + (target-pos vector :inline) + (can-shoot? basic) + (incoming-attack-id uint32) + (can-take-damage? symbol) + (first-shoot? symbol) + (shoot-dir vector :inline) + (tar-pos vector :inline) + (joint joint-mod) + (joint-enable symbol) + (victory-sound sound-id) + (shield-shot uint32) ) - :heap-base #x2d0 - :method-count-assert 183 - :size-assert #x350 - :flag-assert #xb702d00350 + (:state-methods + attack + fire + ) (:methods - (attack () _type_ :state 178) - (fire () _type_ :state 179) - (centurion-method-180 (_type_) none 180) - (centurion-method-181 (_type_ vector) int 181) - (centurion-method-182 (_type_ vector) symbol 182) + (centurion-method-180 (_type_) none) + (centurion-method-181 (_type_ vector) int) + (centurion-method-182 (_type_ vector) symbol) ) ) ;; definition for method 3 of type centurion -(defmethod inspect centurion ((this centurion)) +(defmethod inspect ((this centurion)) (when (not this) (set! this this) (goto cfg-4) @@ -266,15 +260,12 @@ ;; definition of type centurion-anim-info (deftype centurion-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type centurion-anim-info -(defmethod inspect centurion-anim-info ((this centurion-anim-info)) +(defmethod inspect ((this centurion-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -287,19 +278,16 @@ ;; definition of type centurion-global-info (deftype centurion-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (yellow-hit-anim int32 1 :offset-assert 8) - (blue-hit-anim int32 3 :offset-assert 12) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (yellow-hit-anim int32 1) + (blue-hit-anim int32 3) ) :pack-me - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type centurion-global-info -(defmethod inspect centurion-global-info ((this centurion-global-info)) +(defmethod inspect ((this centurion-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -502,7 +490,7 @@ (set! (-> *centurion-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type centurion -(defmethod general-event-handler centurion ((this centurion) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this centurion) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -614,7 +602,7 @@ ;; definition for method 181 of type centurion ;; INFO: Used lq/sq -(defmethod centurion-method-181 centurion ((this centurion) (arg0 vector)) +(defmethod centurion-method-181 ((this centurion) (arg0 vector)) (local-vars (sv-224 vector) (sv-240 vector) (sv-256 vector)) (if (not (-> this joint-enable)) (return (the-as int #f)) @@ -721,7 +709,7 @@ ) ;; definition for method 67 of type centurion -(defmethod go-stare centurion ((this centurion)) +(defmethod go-stare ((this centurion)) (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) (go (method-of-object this hostile)) ) @@ -756,7 +744,7 @@ ;; definition for method 180 of type centurion ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod centurion-method-180 centurion ((this centurion)) +(defmethod centurion-method-180 ((this centurion)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -980,7 +968,7 @@ ) ;; definition for method 132 of type centurion -(defmethod dispose! centurion ((this centurion)) +(defmethod dispose! ((this centurion)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (play-communicator-speech! (-> *talker-speech* 58)) (call-parent-method this) @@ -989,7 +977,7 @@ ;; definition for method 55 of type centurion ;; INFO: Used lq/sq -(defmethod track-target! centurion ((this centurion)) +(defmethod track-target! ((this centurion)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1143,14 +1131,14 @@ ;; definition for method 142 of type centurion ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 centurion ((this centurion) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this centurion) (arg0 nav-control)) 0 (none) ) ;; definition for method 182 of type centurion ;; INFO: Used lq/sq -(defmethod centurion-method-182 centurion ((this centurion) (arg0 vector)) +(defmethod centurion-method-182 ((this centurion) (arg0 vector)) (local-vars (sv-96 int) (sv-112 int)) (when (nonzero? (-> this path)) (let ((s5-0 (-> this path)) @@ -1379,7 +1367,7 @@ ) ;; definition for method 77 of type centurion -(defmethod enemy-method-77 centurion ((this centurion) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this centurion) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) @@ -1451,7 +1439,7 @@ ) ;; definition for method 78 of type centurion -(defmethod enemy-method-78 centurion ((this centurion) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this centurion) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) @@ -1501,14 +1489,14 @@ ) ;; definition for method 60 of type centurion -(defmethod coin-flip? centurion ((this centurion)) +(defmethod coin-flip? ((this centurion)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 63 of type centurion ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 centurion ((this centurion) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this centurion) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) (the-as symbol (if (t9-0 this arg0 arg1) (set-dst-proc! (-> this los) (-> this focus handle)) @@ -1519,7 +1507,7 @@ ;; definition for method 114 of type centurion ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! centurion ((this centurion)) +(defmethod init-enemy-collision! ((this centurion)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1596,7 +1584,7 @@ ) ;; definition for method 7 of type centurion -(defmethod relocate centurion ((this centurion) (arg0 int)) +(defmethod relocate ((this centurion) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -1606,7 +1594,7 @@ ;; definition for method 115 of type centurion ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! centurion ((this centurion)) +(defmethod init-enemy! ((this centurion)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (stack-size-set! (-> this main-thread) 256) (initialize-skeleton diff --git a/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc index 7b39f359ca8..6801215fb4c 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc @@ -352,34 +352,32 @@ ;; definition of type flitter (deftype flitter (nav-enemy) - ((move-angle float :offset-assert 604) - (heading basic :offset-assert 608) - (change-dir-time time-frame :offset-assert 616) - (last-change-dir uint64 :offset-assert 624) - (off-screen-timer uint64 :offset-assert 632) - (amb-sound-timer uint64 :offset-assert 640) - (attack-time time-frame :offset-assert 648) - (target-pos vector :inline :offset-assert 656) - (attack-pos vector :inline :offset-assert 672) - (base-height float :offset-assert 688) - (minimap connection-minimap :offset-assert 692) + ((move-angle float) + (heading basic) + (change-dir-time time-frame) + (last-change-dir uint64) + (off-screen-timer uint64) + (amb-sound-timer uint64) + (attack-time time-frame) + (target-pos vector :inline) + (attack-pos vector :inline) + (base-height float) + (minimap connection-minimap) ) - :heap-base #x240 - :method-count-assert 184 - :size-assert #x2b8 - :flag-assert #xb8024002b8 + (:state-methods + attack + ambush-jumping + ) (:methods - (attack () _type_ :state 178) - (ambush-jumping () _type_ :state 179) - (flitter-method-180 (_type_) none 180) - (flitter-method-181 (_type_) none 181) - (flitter-method-182 (_type_ process-focusable) symbol 182) - (flitter-method-183 (_type_) float 183) + (flitter-method-180 (_type_) none) + (flitter-method-181 (_type_) none) + (flitter-method-182 (_type_ process-focusable) symbol) + (flitter-method-183 (_type_) float) ) ) ;; definition for method 3 of type flitter -(defmethod inspect flitter ((this flitter)) +(defmethod inspect ((this flitter)) (when (not this) (set! this this) (goto cfg-4) @@ -567,7 +565,7 @@ (set! (-> *flitter-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 182 of type flitter -(defmethod flitter-method-182 flitter ((this flitter) (arg0 process-focusable)) +(defmethod flitter-method-182 ((this flitter) (arg0 process-focusable)) (and (logtest? (-> this draw status) (draw-control-status on-screen)) (let ((s4-0 (camera-matrix))) (camera-pos) @@ -582,7 +580,7 @@ ) ;; definition for method 77 of type flitter -(defmethod enemy-method-77 flitter ((this flitter) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this flitter) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (let ((a0-2 (-> this skel root-channel 0))) @@ -625,7 +623,7 @@ ) ;; definition for method 78 of type flitter -(defmethod enemy-method-78 flitter ((this flitter) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this flitter) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -648,7 +646,7 @@ ) ;; definition for method 68 of type flitter -(defmethod go-stare2 flitter ((this flitter)) +(defmethod go-stare2 ((this flitter)) (if (and (= (-> this focus aware) (enemy-aware enemy-aware-2)) (not (nav-enemy-method-163 this)) (not (and (-> this next-state) (= (-> this next-state name) 'pacing))) @@ -862,14 +860,14 @@ ) ;; definition for method 99 of type flitter -(defmethod enemy-method-99 flitter ((this flitter) (arg0 process-focusable)) +(defmethod enemy-method-99 ((this flitter) (arg0 process-focusable)) (focus-test? arg0 mech) ) ;; definition for method 180 of type flitter ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod flitter-method-180 flitter ((this flitter)) +(defmethod flitter-method-180 ((this flitter)) (let* ((s5-0 (handle->process (-> this focus handle))) (s3-0 (if (type? s5-0 process-focusable) (the-as process-focusable s5-0) @@ -940,7 +938,7 @@ ;; definition for method 181 of type flitter ;; WARN: Return type mismatch time-frame vs none. -(defmethod flitter-method-181 flitter ((this flitter)) +(defmethod flitter-method-181 ((this flitter)) (when (time-elapsed? (the-as int (-> this amb-sound-timer)) (the int (* 300.0 (rand-vu-float-range 1.5 3.0)))) (sound-play "flitter-amb" :position (-> this root trans)) (set! (-> this amb-sound-timer) (the-as uint (current-time))) @@ -1176,7 +1174,7 @@ ) ;; definition for method 183 of type flitter -(defmethod flitter-method-183 flitter ((this flitter)) +(defmethod flitter-method-183 ((this flitter)) (lerp-scale 0.0 1.0 (- (-> this attack-pos y) (-> this root trans y)) 13926.4 25600.0) ) @@ -1299,7 +1297,7 @@ ) ;; definition for method 132 of type flitter -(defmethod dispose! flitter ((this flitter)) +(defmethod dispose! ((this flitter)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (when (-> this minimap) (logior! (-> this minimap flags) (minimap-flag fade-out)) @@ -1311,7 +1309,7 @@ ;; definition for method 114 of type flitter ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! flitter ((this flitter)) +(defmethod init-enemy-collision! ((this flitter)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1365,7 +1363,7 @@ ;; definition for method 115 of type flitter ;; WARN: Return type mismatch connection-minimap vs none. -(defmethod init-enemy! flitter ((this flitter)) +(defmethod init-enemy! ((this flitter)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc index 44de7ee7196..d62f3b55ed0 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc @@ -11,16 +11,13 @@ ;; definition of type fodder-anim-info (deftype fodder-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type fodder-anim-info -(defmethod inspect fodder-anim-info ((this fodder-anim-info)) +(defmethod inspect ((this fodder-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -33,16 +30,13 @@ ;; definition of type fodder-global-info (deftype fodder-global-info (basic) - ((prev-blue-hit int8 :offset-assert 4) - (blue-hit-anim fodder-anim-info 3 :inline :offset-assert 8) + ((prev-blue-hit int8) + (blue-hit-anim fodder-anim-info 3 :inline) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type fodder-global-info -(defmethod inspect fodder-global-info ((this fodder-global-info)) +(defmethod inspect ((this fodder-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -56,32 +50,28 @@ ;; definition of type fodder (deftype fodder (nav-enemy) - ((left-eye joint-mod :offset-assert 604) - (right-eye joint-mod :offset-assert 608) - (look-at-other handle :offset-assert 616) - (neck-away-from symbol :offset-assert 624) - (look-at-other-time time-frame :offset-assert 632) - (pad-iuj1n23i1 uint32 3 :offset-assert 640) - (slow-timer time-frame :offset-assert 656) - (fast-timer time-frame :offset-assert 664) - (attack-type uint64 :offset-assert 672) - (test-vec vector :inline :offset-assert 688) + ((left-eye joint-mod) + (right-eye joint-mod) + (look-at-other handle) + (neck-away-from symbol) + (look-at-other-time time-frame) + (pad-iuj1n23i1 uint32 3) + (slow-timer time-frame) + (fast-timer time-frame) + (attack-type uint64) + (test-vec vector :inline) ) - :heap-base #x240 - :method-count-assert 183 - :size-assert #x2c0 - :flag-assert #xb7024002c0 (:methods - (fodder-method-178 (_type_) none 178) - (look-at-position! (_type_ vector) float 179) - (fodder-method-180 (_type_) symbol 180) - (fodder-method-181 (_type_ symbol) none 181) - (fodder-method-182 (_type_) float 182) + (fodder-method-178 (_type_) none) + (look-at-position! (_type_ vector) float) + (fodder-method-180 (_type_) symbol) + (fodder-method-181 (_type_ symbol) none) + (fodder-method-182 (_type_) float) ) ) ;; definition for method 3 of type fodder -(defmethod inspect fodder ((this fodder)) +(defmethod inspect ((this fodder)) (when (not this) (set! this this) (goto cfg-4) @@ -257,7 +247,7 @@ ;; definition for method 109 of type fodder ;; WARN: Return type mismatch int vs none. -(defmethod look-at-target! fodder ((this fodder) (arg0 enemy-flag)) +(defmethod look-at-target! ((this fodder) (arg0 enemy-flag)) "Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available @param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details" (let ((parent-method (method-of-type nav-enemy look-at-target!))) @@ -275,7 +265,7 @@ ;; definition for method 110 of type fodder ;; WARN: Return type mismatch int vs none. -(defmethod stop-looking-at-target! fodder ((this fodder)) +(defmethod stop-looking-at-target! ((this fodder)) "Will unset [[enemy-flag::death-start]] and [[enemy-flag::lock-focus]] and call [[joint-mod::shut-down]] if applicable" (let ((parent-method (method-of-type nav-enemy stop-looking-at-target!))) (parent-method this) @@ -291,7 +281,7 @@ ) ;; definition for method 179 of type fodder -(defmethod look-at-position! fodder ((this fodder) (position vector)) +(defmethod look-at-position! ((this fodder) (position vector)) "Adjusts the eyes to look at particular position, or the focused target @param position If this is provided, it will be used with [[joint-mod::target-set!]] to adjust the eyes, otherwise the `focus` position is used @return TODO - unsure what the return value is, but it seems to make the eyes more lazy" @@ -320,7 +310,7 @@ ) ;; definition for method 180 of type fodder -(defmethod fodder-method-180 fodder ((this fodder)) +(defmethod fodder-method-180 ((this fodder)) "@TODO no idea, never seems to do anything because the actor-group-count is always 0" (when (time-elapsed? (-> this look-at-other-time) (seconds 0.25)) (dotimes (group-idx (-> this actor-group-count)) @@ -378,7 +368,7 @@ ;; definition for method 55 of type fodder ;; WARN: Return type mismatch object vs none. -(defmethod track-target! fodder ((this fodder)) +(defmethod track-target! ((this fodder)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -606,7 +596,7 @@ ) ;; definition for method 182 of type fodder -(defmethod fodder-method-182 fodder ((this fodder)) +(defmethod fodder-method-182 ((this fodder)) (ja-channel-push! 2 (seconds 0.2)) (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! @@ -944,7 +934,7 @@ ) ;; definition for method 77 of type fodder -(defmethod enemy-method-77 fodder ((this fodder) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this fodder) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((a2-0 (ash 1 (-> *fodder-global-info* prev-blue-hit))) @@ -988,7 +978,7 @@ ) ;; definition for method 78 of type fodder -(defmethod enemy-method-78 fodder ((this fodder) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this fodder) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) #f @@ -1010,7 +1000,7 @@ ;; definition for method 181 of type fodder ;; WARN: Return type mismatch int vs none. -(defmethod fodder-method-181 fodder ((this fodder) (arg0 symbol)) +(defmethod fodder-method-181 ((this fodder) (arg0 symbol)) (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 @@ -1028,14 +1018,14 @@ ) ;; definition for method 60 of type fodder -(defmethod coin-flip? fodder ((this fodder)) +(defmethod coin-flip? ((this fodder)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 114 of type fodder ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! fodder ((this fodder)) +(defmethod init-enemy-collision! ((this fodder)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1100,7 +1090,7 @@ ) ;; definition for method 7 of type fodder -(defmethod relocate fodder ((this fodder) (arg0 int)) +(defmethod relocate ((this fodder) (arg0 int)) (if (nonzero? (-> this left-eye)) (&+! (-> this left-eye) arg0) ) @@ -1126,7 +1116,7 @@ ;; definition for method 115 of type fodder ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! fodder ((this fodder)) +(defmethod init-enemy! ((this fodder)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (stack-size-set! (-> this main-thread) 256) (initialize-skeleton @@ -1165,6 +1155,6 @@ ) ;; definition for method 99 of type fodder -(defmethod enemy-method-99 fodder ((this fodder) (arg0 process-focusable)) +(defmethod enemy-method-99 ((this fodder) (arg0 process-focusable)) (focus-test? arg0 mech) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc index 982af0a3840..232a5f483f9 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc @@ -46,18 +46,15 @@ ;; definition of type bank-info (deftype bank-info (structure) - ((circle sphere :inline :offset-assert 0) - (tangent-pos vector :inline :offset-assert 16) - (final-pos vector :inline :offset-assert 32) - (final-dir vector :inline :offset-assert 48) + ((circle sphere :inline) + (tangent-pos vector :inline) + (final-pos vector :inline) + (final-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type bank-info -(defmethod inspect bank-info ((this bank-info)) +(defmethod inspect ((this bank-info)) (when (not this) (set! this this) (goto cfg-4) @@ -73,32 +70,30 @@ ;; definition of type grenadier (deftype grenadier (nav-enemy) - ((shot-trajectory trajectory :inline :offset-assert 608) - (hostile-path path-control :offset-assert 648) - (bank bank-info :inline :offset-assert 656) - (joint joint-mod-blend-world :offset-assert 720) - (heading symbol :offset-assert 724) - (move-pos vector :inline :offset-assert 736) - (move-angle float :offset-assert 752) - (status-flags grenadier-flags :offset-assert 760) - (suppress-knockaside-timer time-frame :offset-assert 768) + ((shot-trajectory trajectory :inline) + (hostile-path path-control) + (bank bank-info :inline) + (joint joint-mod-blend-world) + (heading symbol) + (move-pos vector :inline) + (move-angle float) + (status-flags grenadier-flags) + (suppress-knockaside-timer time-frame) ) - :heap-base #x290 - :method-count-assert 184 - :size-assert #x308 - :flag-assert #xb802900308 + (:state-methods + attack + backup + spin-kick + ) (:methods - (attack () _type_ :state 178) - (backup () _type_ :state 179) - (spin-kick () _type_ :state 180) - (grenadier-method-181 (_type_) none 181) - (grenadier-method-182 (_type_ vector) none 182) - (grenadier-method-183 (_type_) none 183) + (grenadier-method-181 (_type_) none) + (grenadier-method-182 (_type_ vector) none) + (grenadier-method-183 (_type_) none) ) ) ;; definition for method 3 of type grenadier -(defmethod inspect grenadier ((this grenadier)) +(defmethod inspect ((this grenadier)) (when (not this) (set! this this) (goto cfg-4) @@ -317,7 +312,7 @@ (set! (-> *grenadier-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type grenadier -(defmethod general-event-handler grenadier ((this grenadier) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this grenadier) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -374,7 +369,7 @@ ;; definition for method 182 of type grenadier ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod grenadier-method-182 grenadier ((this grenadier) (arg0 vector)) +(defmethod grenadier-method-182 ((this grenadier) (arg0 vector)) (cloest-point-on-mesh (-> this nav) arg0 arg0 (the-as nav-poly #f)) (set! (-> this bank final-pos quad) (-> arg0 quad)) (set! (-> this bank tangent-pos quad) (-> arg0 quad)) @@ -384,7 +379,7 @@ ;; definition for method 181 of type grenadier ;; WARN: Return type mismatch int vs none. -(defmethod grenadier-method-181 grenadier ((this grenadier)) +(defmethod grenadier-method-181 ((this grenadier)) (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 (cond @@ -744,7 +739,7 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for method 78 of type grenadier -(defmethod enemy-method-78 grenadier ((this grenadier) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this grenadier) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -1095,7 +1090,7 @@ ) ;; definition for method 70 of type grenadier -(defmethod go-hostile grenadier ((this grenadier)) +(defmethod go-hostile ((this grenadier)) (if (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) (and (logtest? (-> this status-flags) (grenadier-flags grflags-0)) (handle->process (-> this focus handle)) @@ -1140,7 +1135,7 @@ ;; definition for method 142 of type grenadier ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 grenadier ((this grenadier) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this grenadier) (arg0 nav-control)) (local-vars (a0-4 int) (a0-6 int)) (b! (logtest? (-> this status-flags) (grenadier-flags grflags-1)) cfg-6 :delay (empty-form)) (let ((v1-3 (new 'stack-no-clear 'vector)) @@ -1189,7 +1184,7 @@ ) ;; definition for method 55 of type grenadier -(defmethod track-target! grenadier ((this grenadier)) +(defmethod track-target! ((this grenadier)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1205,7 +1200,7 @@ ;; definition for method 114 of type grenadier ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! grenadier ((this grenadier)) +(defmethod init-enemy-collision! ((this grenadier)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1293,7 +1288,7 @@ ) ;; definition for method 7 of type grenadier -(defmethod relocate grenadier ((this grenadier) (arg0 int)) +(defmethod relocate ((this grenadier) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -1307,7 +1302,7 @@ ;; definition for method 115 of type grenadier ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! grenadier ((this grenadier)) +(defmethod init-enemy! ((this grenadier)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc index 2d9c992ef29..2fbfef68507 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc @@ -11,17 +11,14 @@ ;; definition of type grunt-anim-info (deftype grunt-anim-info (structure) - ((anim-index int32 :offset-assert 0) - (travel-speed meters :offset-assert 4) + ((anim-index int32) + (travel-speed meters) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type grunt-anim-info -(defmethod inspect grunt-anim-info ((this grunt-anim-info)) +(defmethod inspect ((this grunt-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -35,24 +32,21 @@ ;; definition of type grunt-global-info (deftype grunt-global-info (basic) - ((prev-knocked-anim-index int32 :offset-assert 4) - (prev-yellow-hit-anim-index int32 :offset-assert 8) - (prev-blue-hit-anim-index int32 :offset-assert 12) - (patrol-anim grunt-anim-info 4 :inline :offset-assert 16) - (charge-anim grunt-anim-info 3 :inline :offset-assert 48) - (attack-anim grunt-anim-info 2 :inline :offset-assert 72) - (knocked-anim grunt-anim-info 4 :inline :offset-assert 88) - (knocked-land-anim grunt-anim-info 4 :inline :offset-assert 120) - (yellow-hit-anim grunt-anim-info 4 :inline :offset-assert 152) - (blue-hit-anim grunt-anim-info 6 :inline :offset-assert 184) + ((prev-knocked-anim-index int32) + (prev-yellow-hit-anim-index int32) + (prev-blue-hit-anim-index int32) + (patrol-anim grunt-anim-info 4 :inline) + (charge-anim grunt-anim-info 3 :inline) + (attack-anim grunt-anim-info 2 :inline) + (knocked-anim grunt-anim-info 4 :inline) + (knocked-land-anim grunt-anim-info 4 :inline) + (yellow-hit-anim grunt-anim-info 4 :inline) + (blue-hit-anim grunt-anim-info 6 :inline) ) - :method-count-assert 9 - :size-assert #xe8 - :flag-assert #x9000000e8 ) ;; definition for method 3 of type grunt-global-info -(defmethod inspect grunt-global-info ((this grunt-global-info)) +(defmethod inspect ((this grunt-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -74,44 +68,42 @@ ;; definition of type grunt (deftype grunt (nav-enemy) - ((patrol-anim grunt-anim-info :offset-assert 604) - (charge-anim grunt-anim-info :offset-assert 608) - (attack-anim grunt-anim-info :offset-assert 612) - (knocked-anim grunt-anim-info :offset-assert 616) - (yellow-hit-anim grunt-anim-info :offset-assert 620) - (blue-hit-anim grunt-anim-info :offset-assert 624) - (intro-path path-control :offset-assert 628) - (use-charge-anim-index int8 :offset-assert 632) - (knocked-anim-index int8 :offset-assert 633) - (jumping-ambush-path-pt int8 :offset-assert 634) - (grunt-flags uint8 :offset-assert 635) - (unknown-byte-n1k2n3 int8 :offset 636) - (unknown-byte-m2j342 int8 :offset 637) - (unknown-byte-1ji2n3 int8 :offset 638) - (unknown-byte-n123n int8 :offset 639) - (state-timeout2 uint64 :offset-assert 640) - (next-warn-time time-frame :offset-assert 648) - (dest vector :inline :offset-assert 656) - (minimap connection-minimap :offset 688) + ((patrol-anim grunt-anim-info) + (charge-anim grunt-anim-info) + (attack-anim grunt-anim-info) + (knocked-anim grunt-anim-info) + (yellow-hit-anim grunt-anim-info) + (blue-hit-anim grunt-anim-info) + (intro-path path-control) + (use-charge-anim-index int8) + (knocked-anim-index int8) + (jumping-ambush-path-pt int8) + (grunt-flags uint8) + (unknown-byte-n1k2n3 int8 :offset 636) + (unknown-byte-m2j342 int8 :offset 637) + (unknown-byte-1ji2n3 int8 :offset 638) + (unknown-byte-n123n int8 :offset 639) + (state-timeout2 uint64) + (next-warn-time time-frame) + (dest vector :inline) + (minimap connection-minimap :offset 688) ) - :heap-base #x240 - :method-count-assert 186 - :size-assert #x2b4 - :flag-assert #xba024002b4 + (:state-methods + attack + falling-ambush + jumping-ambush + jumping-ambush-cont + wait-for-focus + spin-attack + ) (:methods - (attack () _type_ :state 178) - (falling-ambush () _type_ :state 179) - (jumping-ambush () _type_ :state 180) - (jumping-ambush-cont () _type_ :state 181) - (wait-for-focus () _type_ :state 182) - (spin-attack () _type_ :state 183) - (grunt-method-184 (_type_ float) process-focusable 184) - (get-enemy-info (_type_) nav-enemy-info 185) + (grunt-method-184 (_type_ float) process-focusable) + (get-enemy-info (_type_) nav-enemy-info) ) ) ;; definition for method 3 of type grunt -(defmethod inspect grunt ((this grunt)) +(defmethod inspect ((this grunt)) (when (not this) (set! this this) (goto cfg-4) @@ -400,7 +392,7 @@ (set! (-> *grunt-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type grunt -(defmethod general-event-handler grunt ((this grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -460,7 +452,7 @@ ) ;; definition for method 66 of type grunt -(defmethod go-ambush grunt ((this grunt)) +(defmethod go-ambush ((this grunt)) (cond ((logtest? (-> this fact enemy-options) (enemy-option user10)) (go (method-of-object this falling-ambush)) @@ -552,7 +544,7 @@ ;; definition for method 93 of type grunt ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 grunt ((this grunt)) +(defmethod enemy-method-93 ((this grunt)) (case (-> this jump-why) ((2) (go (method-of-object this jumping-ambush-cont)) @@ -745,7 +737,7 @@ ) ;; definition for method 184 of type grunt -(defmethod grunt-method-184 grunt ((this grunt) (arg0 float)) +(defmethod grunt-method-184 ((this grunt) (arg0 float)) (local-vars (v1-5 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1237,7 +1229,7 @@ ) ;; definition for method 77 of type grunt -(defmethod enemy-method-77 grunt ((this grunt) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this grunt) (arg0 (pointer float))) (local-vars (v1-72 int) (a2-3 int) (a2-5 int)) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) @@ -1382,7 +1374,7 @@ ) ;; definition for method 78 of type grunt -(defmethod enemy-method-78 grunt ((this grunt) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this grunt) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (or (logtest? (-> this stack 511) 2) (let ((v1-7 (if (> (-> this skel active-channels) 0) @@ -1483,7 +1475,7 @@ ) ;; definition for method 132 of type grunt -(defmethod dispose! grunt ((this grunt)) +(defmethod dispose! ((this grunt)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (when (-> this minimap) (logior! (-> this minimap flags) (minimap-flag fade-out)) @@ -1495,7 +1487,7 @@ ;; definition for method 7 of type grunt ;; WARN: Return type mismatch nav-enemy vs grunt. -(defmethod relocate grunt ((this grunt) (arg0 int)) +(defmethod relocate ((this grunt) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) ) @@ -1504,7 +1496,7 @@ ;; definition for method 114 of type grunt ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! grunt ((this grunt)) +(defmethod init-enemy-collision! ((this grunt)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1601,14 +1593,14 @@ ) ;; definition for method 185 of type grunt -(defmethod get-enemy-info grunt ((this grunt)) +(defmethod get-enemy-info ((this grunt)) "@returns the [[nav-enemy-info]] associated with this type of grunt" *grunt-nav-enemy-info* ) ;; definition for method 115 of type grunt ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! grunt ((this grunt)) +(defmethod init-enemy! ((this grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1664,7 +1656,7 @@ ;; definition for method 116 of type grunt ;; WARN: Return type mismatch int vs none. -(defmethod go-idle grunt ((this grunt)) +(defmethod go-idle ((this grunt)) (if (logtest? (-> this fact enemy-options) (enemy-option user9)) (go (method-of-object this wait-for-focus)) (go (method-of-object this idle)) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc index 1ced26191cb..0aeda8c5fbe 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc @@ -14,20 +14,17 @@ ;; definition of type guard-level-anim-info (deftype guard-level-anim-info (structure) - ((anim-index int32 2 :offset-assert 0) - (anim-index-front int32 :offset 0) - (anim-index-back int32 :offset 4) - (unsigned-anim-index-front uint32 :offset 0) - (unsigned-anim-index-back uint32 :offset 4) + ((anim-index int32 2) + (anim-index-front int32 :overlay-at (-> anim-index 0)) + (anim-index-back int32 :overlay-at (-> anim-index 1)) + (unsigned-anim-index-front uint32 :overlay-at (-> anim-index 0)) + (unsigned-anim-index-back uint32 :overlay-at (-> anim-index 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type guard-level-anim-info -(defmethod inspect guard-level-anim-info ((this guard-level-anim-info)) +(defmethod inspect ((this guard-level-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -42,25 +39,22 @@ ;; definition of type guard-level-global-info (deftype guard-level-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (knocked guard-level-anim-info :inline :offset-assert 8) - (anim-knocked-front int32 :offset 8) - (anim-knocked-back int32 :offset 12) - (knocked-land guard-level-anim-info :inline :offset-assert 16) - (anim-knocked-front-land int32 :offset 16) - (anim-knocked-back-land int32 :offset 20) - (yellow-hit-anim guard-level-anim-info 2 :inline :offset-assert 24) - (yellow-land-anim guard-level-anim-info 2 :inline :offset-assert 40) - (blue-hit-anim guard-level-anim-info 1 :inline :offset-assert 56) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (knocked guard-level-anim-info :inline) + (anim-knocked-front int32 :overlay-at (-> knocked anim-index 0)) + (anim-knocked-back int32 :overlay-at (-> knocked anim-index 1)) + (knocked-land guard-level-anim-info :inline) + (anim-knocked-front-land int32 :overlay-at (-> knocked-land anim-index 0)) + (anim-knocked-back-land int32 :overlay-at (-> knocked-land anim-index 1)) + (yellow-hit-anim guard-level-anim-info 2 :inline) + (yellow-land-anim guard-level-anim-info 2 :inline) + (blue-hit-anim guard-level-anim-info 1 :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type guard-level-global-info -(defmethod inspect guard-level-global-info ((this guard-level-global-info)) +(defmethod inspect ((this guard-level-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -83,18 +77,15 @@ ;; definition of type guard-level-shoot-info (deftype guard-level-shoot-info (structure) - ((anim-index int32 :offset-assert 0) - (start float :offset-assert 4) - (end float :offset-assert 8) + ((anim-index int32) + (start float) + (end float) ) :pack-me - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type guard-level-shoot-info -(defmethod inspect guard-level-shoot-info ((this guard-level-shoot-info)) +(defmethod inspect ((this guard-level-shoot-info)) (when (not this) (set! this this) (goto cfg-4) @@ -1023,80 +1014,78 @@ ;; definition of type crimson-guard-level (deftype crimson-guard-level (nav-enemy) - ((info guard-level-global-info :offset-assert 604) - (hit-face uint32 :offset-assert 608) - (anim-get-up-front int32 :offset-assert 612) - (anim-get-up-back int32 :offset-assert 616) - (small-hit int32 :offset-assert 620) - (yellow-anim guard-level-anim-info :inline :offset-assert 624) - (flags int64 :offset-assert 632) - (weapon int32 :offset-assert 640) - (pad-kjh1n23 int32 :offset-assert 644) - (last-time-see-target int64 :offset-assert 648) - (joint joint-mod :offset-assert 656) - (joint-enable symbol :offset-assert 660) - (l-control lightning-control :offset-assert 664) - (already-shot uint32 :offset-assert 668) - (miss-amount float :offset-assert 672) - (pad-k1jh2n3 int32 :offset-assert 676) - (next-shot int64 :offset-assert 680) - (anim-shoot guard-level-shoot-info 3 :inline :offset-assert 688) - (target-pos vector :inline :offset-assert 736) - (target-pos-predict vector :inline :offset-assert 752) - (target-pos-predict-miss vector :inline :offset-assert 768) - (target-vel-vec vector :inline :offset-assert 784) - (target-vel float :offset-assert 800) - (target-self vector :inline :offset-assert 816) - (target-self-xz vector :inline :offset-assert 832) - (target-self-dist float :offset-assert 848) - (target-self-xz-dist float :offset-assert 852) - (target-y-angle float :offset-assert 856) - (lazer-sound sound-id :offset-assert 860) - (transport handle :offset-assert 864) - (transport-side uint32 :offset-assert 872) - (other-side uint32 :offset-assert 876) - (start-target-pos vector :inline :offset-assert 880) - (start-target-vel vector :inline :offset-assert 896) - (trigger symbol :offset-assert 912) - (reachable-target-pos vector :inline :offset-assert 928) + ((info guard-level-global-info) + (hit-face uint32) + (anim-get-up-front int32) + (anim-get-up-back int32) + (small-hit int32) + (yellow-anim guard-level-anim-info :inline) + (flags int64) + (weapon int32) + (pad-kjh1n23 int32) + (last-time-see-target int64) + (joint joint-mod) + (joint-enable symbol) + (l-control lightning-control) + (already-shot uint32) + (miss-amount float) + (pad-k1jh2n3 int32) + (next-shot int64) + (anim-shoot guard-level-shoot-info 3 :inline) + (target-pos vector :inline) + (target-pos-predict vector :inline) + (target-pos-predict-miss vector :inline) + (target-vel-vec vector :inline) + (target-vel float) + (target-self vector :inline) + (target-self-xz vector :inline) + (target-self-dist float) + (target-self-xz-dist float) + (target-y-angle float) + (lazer-sound sound-id) + (transport handle) + (transport-side uint32) + (other-side uint32) + (start-target-pos vector :inline) + (start-target-vel vector :inline) + (trigger symbol) + (reachable-target-pos vector :inline) ) - :heap-base #x330 - :method-count-assert 205 - :size-assert #x3b0 - :flag-assert #xcd033003b0 + (:state-methods + gun-shoot + attack + get-up-front + get-up-back + close-attack + grenade-attack + exit-transport + blast-hostile + grenade-hostile + tazer-hostile + roll-right + roll-left + arrest + ) (:methods - (gun-shoot () _type_ :state 178) - (attack () _type_ :state 179) - (get-up-front () _type_ :state 180) - (get-up-back () _type_ :state 181) - (close-attack () _type_ :state 182) - (grenade-attack () _type_ :state 183) - (exit-transport () _type_ :state 184) - (blast-hostile () _type_ :state 185) - (grenade-hostile () _type_ :state 186) - (tazer-hostile () _type_ :state 187) - (roll-right () _type_ :state 188) - (roll-left () _type_ :state 189) - (arrest () _type_ :state 190) - (crimson-guard-level-method-191 (_type_) (pointer process) 191) - (crimson-guard-level-method-192 (_type_) none 192) - (crimson-guard-level-method-193 (_type_) symbol 193) - (crimson-guard-level-method-194 (_type_) symbol 194) - (crimson-guard-level-method-195 (_type_ vector vector vector) int 195) - (crimson-guard-level-method-196 (_type_ vector) none 196) - (crimson-guard-level-method-197 (_type_) quaternion 197) - (crimson-guard-level-method-198 (_type_) none 198) - (crimson-guard-level-method-199 (_type_ vector vector vector float) symbol 199) - (crimson-guard-level-method-200 (_type_) float 200) - (crimson-guard-level-method-201 (_type_ float) none 201) - (crimson-guard-level-method-202 (_type_ vector) float 202) - (crimson-guard-level-method-203 (_type_ int) none 203) - (crimson-guard-level-method-204 (_type_) none 204) + (crimson-guard-level-method-191 (_type_) (pointer process)) + (crimson-guard-level-method-192 (_type_) none) + (crimson-guard-level-method-193 (_type_) symbol) + (crimson-guard-level-method-194 (_type_) symbol) + (crimson-guard-level-method-195 (_type_ vector vector vector) int) + (crimson-guard-level-method-196 (_type_ vector) none) + (crimson-guard-level-method-197 (_type_) quaternion) + (crimson-guard-level-method-198 (_type_) none) + (crimson-guard-level-method-199 (_type_ vector vector vector float) symbol) + (crimson-guard-level-method-200 (_type_) float) + (crimson-guard-level-method-201 (_type_ float) none) + (crimson-guard-level-method-202 (_type_ vector) float) + (crimson-guard-level-method-203 (_type_ int) none) + (crimson-guard-level-method-204 (_type_) none) ) ) ;; definition for method 3 of type crimson-guard-level -(defmethod inspect crimson-guard-level ((this crimson-guard-level)) +(defmethod inspect ((this crimson-guard-level)) (when (not this) (set! this this) (goto cfg-4) @@ -1143,7 +1132,7 @@ ) ;; definition for method 72 of type crimson-guard-level -(defmethod react-to-focus crimson-guard-level ((this crimson-guard-level)) +(defmethod react-to-focus ((this crimson-guard-level)) "@TODO - flesh out docs" (let ((s5-0 (-> this focus aware))) (cond @@ -1222,7 +1211,7 @@ ) ;; definition for method 74 of type crimson-guard-level -(defmethod general-event-handler crimson-guard-level ((this crimson-guard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this crimson-guard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -1278,7 +1267,7 @@ ;; definition for method 191 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod crimson-guard-level-method-191 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-191 ((this crimson-guard-level)) (let* ((s4-0 (-> this target-pos-predict-miss)) (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) @@ -1307,7 +1296,7 @@ ;; definition for method 195 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod crimson-guard-level-method-195 crimson-guard-level ((this crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod crimson-guard-level-method-195 ((this crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1420,7 +1409,7 @@ ;; definition for method 193 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod crimson-guard-level-method-193 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-193 ((this crimson-guard-level)) (let ((s5-0 (get-trans this 3)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -1434,7 +1423,7 @@ ;; definition for method 194 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod crimson-guard-level-method-194 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-194 ((this crimson-guard-level)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> this target-pos-predict-miss quad)) (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) @@ -1452,7 +1441,7 @@ ;; definition for method 196 of type crimson-guard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-level-method-196 crimson-guard-level ((this crimson-guard-level) (arg0 vector)) +(defmethod crimson-guard-level-method-196 ((this crimson-guard-level) (arg0 vector)) (local-vars (sv-240 vector) (sv-256 (function vector vector vector)) @@ -1583,13 +1572,13 @@ ) ;; definition for method 197 of type crimson-guard-level -(defmethod crimson-guard-level-method-197 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-197 ((this crimson-guard-level)) (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) *unity-quaternion* (seconds-per-frame)) ) ;; definition for method 55 of type crimson-guard-level ;; WARN: Return type mismatch object vs none. -(defmethod track-target! crimson-guard-level ((this crimson-guard-level)) +(defmethod track-target! ((this crimson-guard-level)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1613,7 +1602,7 @@ ;; definition for method 200 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod crimson-guard-level-method-200 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-200 ((this crimson-guard-level)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -2314,7 +2303,7 @@ ;; definition for method 199 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod crimson-guard-level-method-199 crimson-guard-level ((this crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod crimson-guard-level-method-199 ((this crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (sv-672 vector) (sv-688 vector) (sv-704 vector) (sv-720 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2478,7 +2467,7 @@ ;; definition for method 198 of type crimson-guard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-level-method-198 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-198 ((this crimson-guard-level)) (local-vars (sv-784 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2762,7 +2751,7 @@ ;; definition for method 192 of type crimson-guard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-level-method-192 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-192 ((this crimson-guard-level)) (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14)))) (new 'stack-no-clear 'vector) (let ((s5-0 (new 'stack-no-clear 'traj3d-params))) @@ -3231,7 +3220,7 @@ ;; definition for method 204 of type crimson-guard-level ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-level-method-204 crimson-guard-level ((this crimson-guard-level)) +(defmethod crimson-guard-level-method-204 ((this crimson-guard-level)) (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (-> this root)) (s3-0 (lambda ((arg0 crimson-guard-level) (arg1 collide-shape-moving) (arg2 vector)) @@ -3507,7 +3496,7 @@ ) ;; definition for method 77 of type crimson-guard-level -(defmethod enemy-method-77 crimson-guard-level ((this crimson-guard-level) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this crimson-guard-level) (arg0 (pointer float))) (let ((v1-1 (-> this root transv))) (cond ((< (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 57344.0) @@ -3605,7 +3594,7 @@ ) ;; definition for method 70 of type crimson-guard-level -(defmethod go-hostile crimson-guard-level ((this crimson-guard-level)) +(defmethod go-hostile ((this crimson-guard-level)) (let ((v1-0 (-> this hit-face))) (cond ((zero? v1-0) @@ -3631,7 +3620,7 @@ ) ;; definition for method 78 of type crimson-guard-level -(defmethod enemy-method-78 crimson-guard-level ((this crimson-guard-level) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this crimson-guard-level) (arg0 (pointer float))) (cond ((<= (-> this hit-points) 0) (let ((a1-1 (-> this draw art-group data (-> this info knocked-land anim-index (-> this hit-face)))) @@ -3835,7 +3824,7 @@ ;; definition for method 201 of type crimson-guard-level ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-level-method-201 crimson-guard-level ((this crimson-guard-level) (arg0 float)) +(defmethod crimson-guard-level-method-201 ((this crimson-guard-level) (arg0 float)) (let* ((s3-0 (handle->process (-> this transport))) (s4-0 (if (type? s3-0 process-focusable) (the-as process-focusable s3-0) @@ -3871,7 +3860,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod crimson-guard-level-method-202 crimson-guard-level ((this crimson-guard-level) (arg0 vector)) +(defmethod crimson-guard-level-method-202 ((this crimson-guard-level) (arg0 vector)) (local-vars (f0-8 float) (sv-768 vector) @@ -3991,7 +3980,7 @@ ;; definition for method 93 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod enemy-method-93 crimson-guard-level ((this crimson-guard-level)) +(defmethod enemy-method-93 ((this crimson-guard-level)) (let ((s5-0 (-> this nav state)) (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) @@ -4014,12 +4003,12 @@ ) ;; definition for method 89 of type crimson-guard-level -(defmethod enemy-method-89 crimson-guard-level ((this crimson-guard-level) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this crimson-guard-level) (arg0 enemy-jump-info)) #f ) ;; definition for method 87 of type crimson-guard-level -(defmethod enemy-method-87 crimson-guard-level ((this crimson-guard-level) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this crimson-guard-level) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -4036,7 +4025,7 @@ ) ;; definition for method 88 of type crimson-guard-level -(defmethod enemy-method-88 crimson-guard-level ((this crimson-guard-level) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this crimson-guard-level) (arg0 enemy-jump-info)) (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -4053,7 +4042,7 @@ ) ;; definition for method 90 of type crimson-guard-level -(defmethod enemy-method-90 crimson-guard-level ((this crimson-guard-level) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 ((this crimson-guard-level) (arg0 int) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond @@ -4210,7 +4199,7 @@ ;; definition for method 114 of type crimson-guard-level ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! crimson-guard-level ((this crimson-guard-level)) +(defmethod init-enemy-collision! ((this crimson-guard-level)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -4289,7 +4278,7 @@ ) ;; definition for method 7 of type crimson-guard-level -(defmethod relocate crimson-guard-level ((this crimson-guard-level) (arg0 int)) +(defmethod relocate ((this crimson-guard-level) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -4301,7 +4290,7 @@ ;; definition for method 203 of type crimson-guard-level ;; WARN: Return type mismatch float vs none. -(defmethod crimson-guard-level-method-203 crimson-guard-level ((this crimson-guard-level) (arg0 int)) +(defmethod crimson-guard-level-method-203 ((this crimson-guard-level) (arg0 int)) "TODO - probably a flag" (cond ((= arg0 1) @@ -4326,7 +4315,7 @@ ;; definition for method 156 of type crimson-guard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod nav-enemy-method-156 crimson-guard-level ((this crimson-guard-level)) +(defmethod nav-enemy-method-156 ((this crimson-guard-level)) (cond ((logtest? (-> this flags) 36) (let ((v1-3 (-> this nav state)) @@ -4348,7 +4337,7 @@ ;; definition for method 115 of type crimson-guard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! crimson-guard-level ((this crimson-guard-level)) +(defmethod init-enemy! ((this crimson-guard-level)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 int)) (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) @@ -4504,21 +4493,18 @@ ;; definition of type crimson-guard-level-params (deftype crimson-guard-level-params (structure) - ((pos vector :inline :offset-assert 0) - (quat quaternion :inline :offset-assert 16) - (nav-mesh nav-mesh :offset-assert 32) - (handle uint64 :offset-assert 40) - (transport-side uint32 :offset-assert 48) - (weapon int32 :offset-assert 52) - (proc process :offset-assert 56) + ((pos vector :inline) + (quat quaternion :inline) + (nav-mesh nav-mesh) + (handle uint64) + (transport-side uint32) + (weapon int32) + (proc process) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) ;; definition for method 3 of type crimson-guard-level-params -(defmethod inspect crimson-guard-level-params ((this crimson-guard-level-params)) +(defmethod inspect ((this crimson-guard-level-params)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc index 87bfd5e7e69..9a3dcb1a51f 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc @@ -3,17 +3,14 @@ ;; definition of type gconv-speech (deftype gconv-speech (basic) - ((name0 basic :offset-assert 4) - (name1 basic :offset-assert 8) - (hold-time uint32 :offset-assert 12) + ((name0 basic) + (name1 basic) + (hold-time uint32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type gconv-speech -(defmethod inspect gconv-speech ((this gconv-speech)) +(defmethod inspect ((this gconv-speech)) (when (not this) (set! this this) (goto cfg-4) @@ -28,15 +25,12 @@ ;; definition of type gconv-dialogue (deftype gconv-dialogue (basic) - ((speeches (array gconv-speech) :offset-assert 4) + ((speeches (array gconv-speech)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type gconv-dialogue -(defmethod inspect gconv-dialogue ((this gconv-dialogue)) +(defmethod inspect ((this gconv-dialogue)) (when (not this) (set! this this) (goto cfg-4) @@ -49,15 +43,12 @@ ;; definition of type gconv-dialogues (deftype gconv-dialogues (basic) - ((dialogues (array gconv-dialogue) :offset-assert 4) + ((dialogues (array gconv-dialogue)) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type gconv-dialogues -(defmethod inspect gconv-dialogues ((this gconv-dialogues)) +(defmethod inspect ((this gconv-dialogues)) (when (not this) (set! this this) (goto cfg-4) @@ -214,28 +205,26 @@ ;; definition of type guard-conversation (deftype guard-conversation (process-drawable) - ((triggered? symbol :offset-assert 200) - (actor-group actor-group :offset-assert 204) - (actor-count int8 :offset-assert 208) - (remaining int8 :offset-assert 209) - (skip-mask uint32 :offset-assert 212) - (last-playing-time time-frame :offset-assert 216) + ((triggered? symbol) + (actor-group actor-group) + (actor-count int8) + (remaining int8) + (skip-mask uint32) + (last-playing-time time-frame) ) - :heap-base #x60 - :method-count-assert 25 - :size-assert #xe0 - :flag-assert #x19006000e0 + (:state-methods + dormant + active + notice + die + ) (:methods - (dormant () _type_ :state 20) - (active () _type_ :state 21) - (notice () _type_ :state 22) - (die () _type_ :state 23) - (guard-conversation-method-24 (_type_) symbol 24) + (guard-conversation-method-24 (_type_) symbol) ) ) ;; definition for method 3 of type guard-conversation -(defmethod inspect guard-conversation ((this guard-conversation)) +(defmethod inspect ((this guard-conversation)) (when (not this) (set! this this) (goto cfg-4) @@ -254,7 +243,7 @@ ) ;; definition for method 24 of type guard-conversation -(defmethod guard-conversation-method-24 guard-conversation ((this guard-conversation)) +(defmethod guard-conversation-method-24 ((this guard-conversation)) (let ((v1-0 (-> this remaining))) (when (> v1-0 0) (set! (-> this remaining) (+ v1-0 -1)) @@ -423,7 +412,7 @@ ;; definition for method 11 of type guard-conversation ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! guard-conversation ((this guard-conversation) (arg0 entity-actor)) +(defmethod init-from-entity! ((this guard-conversation) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/common/enemy/guards/transport-level_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/guards/transport-level_REF.gc index a8b83871c24..badca6564d9 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/guards/transport-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/guards/transport-level_REF.gc @@ -3,38 +3,36 @@ ;; definition of type transport-level (deftype transport-level (process-focusable) - ((y-dest float :offset-assert 204) - (last-guard-spawn-time time-frame :offset-assert 208) - (nav-mesh nav-mesh :offset-assert 216) - (spawn-side uint32 :offset-assert 220) - (spawn? symbol :offset-assert 224) - (leave-time time-frame :offset-assert 232) - (max-guard uint32 :offset-assert 240) - (count-guard uint32 :offset-assert 244) - (max-time float :offset-assert 248) - (spawn-time time-frame :offset-assert 256) - (ambient-sound-id sound-id :offset-assert 264) - (num-wanted-guards uint32 :offset-assert 268) - (guards handle 8 :offset-assert 272) + ((y-dest float) + (last-guard-spawn-time time-frame) + (nav-mesh nav-mesh) + (spawn-side uint32) + (spawn? symbol) + (leave-time time-frame) + (max-guard uint32) + (count-guard uint32) + (max-time float) + (spawn-time time-frame) + (ambient-sound-id sound-id) + (num-wanted-guards uint32) + (guards handle 8) ) - :heap-base #xd0 - :method-count-assert 35 - :size-assert #x150 - :flag-assert #x2300d00150 + (:state-methods + come-down + idle + leave + die-fast + ) (:methods - (come-down () _type_ :state 27) - (idle () _type_ :state 28) - (leave () _type_ :state 29) - (die-fast () _type_ :state 30) - (transport-level-method-31 (_type_) none 31) - (transport-level-method-32 (_type_) none 32) - (transport-level-method-33 (_type_) uint 33) - (transport-level-method-34 (_type_) none 34) + (transport-level-method-31 (_type_) none) + (transport-level-method-32 (_type_) none) + (transport-level-method-33 (_type_) uint) + (transport-level-method-34 (_type_) none) ) ) ;; definition for method 3 of type transport-level -(defmethod inspect transport-level ((this transport-level)) +(defmethod inspect ((this transport-level)) (when (not this) (set! this this) (goto cfg-4) @@ -114,7 +112,7 @@ ;; definition for method 34 of type transport-level ;; WARN: Return type mismatch int vs none. -(defmethod transport-level-method-34 transport-level ((this transport-level)) +(defmethod transport-level-method-34 ((this transport-level)) (let ((f30-0 (lerp-scale 0.0 2.0 (fabs (-> this root transv y)) 0.0 122880.0)) (f0-4 (lerp-scale 0.0 1.0 (- (-> this root trans y) (-> this y-dest)) 143360.0 20480.0)) (a0-3 (static-sound-spec "transport" :volume 0.0 :mask (pitch reg0))) @@ -261,7 +259,7 @@ ;; definition for method 33 of type transport-level ;; INFO: Used lq/sq -(defmethod transport-level-method-33 transport-level ((this transport-level)) +(defmethod transport-level-method-33 ((this transport-level)) (let ((v1-0 0)) (dotimes (a0-1 8) (if (handle->process (-> this guards a0-1)) @@ -306,7 +304,7 @@ ;; definition for method 31 of type transport-level ;; WARN: Return type mismatch int vs none. -(defmethod transport-level-method-31 transport-level ((this transport-level)) +(defmethod transport-level-method-31 ((this transport-level)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -349,7 +347,7 @@ ;; definition for method 32 of type transport-level ;; WARN: Return type mismatch int vs none. -(defmethod transport-level-method-32 transport-level ((this transport-level)) +(defmethod transport-level-method-32 ((this transport-level)) (set! (-> this spawn-side) (the-as uint 0)) 0 (none) @@ -357,7 +355,7 @@ ;; definition for method 11 of type transport-level ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! transport-level ((this transport-level) (arg0 entity-actor)) +(defmethod init-from-entity! ((this transport-level) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc index 6c7db238f87..c405efa4430 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc @@ -3,38 +3,34 @@ ;; definition of type hopper (deftype hopper (nav-enemy) - ((speed-y float :offset-assert 604) - (accel-y float :offset-assert 608) - (next-jump-time int32 :offset-assert 612) - (path-intro path-control :offset-assert 616) - (can-go-knocked? symbol :offset-assert 620) - (land-anim-index int32 :offset-assert 624) - (step-num int32 :offset-assert 628) - (best-point vector :inline :offset-assert 640) - (best-score float :offset-assert 656) - (origin vector :inline :offset-assert 672) - (direction vector :inline :offset-assert 688) - (jump-dist float :offset-assert 704) - (side float :offset-assert 708) - (jump-start-anim uint32 :offset-assert 712) - (jump-air-anim uint32 :offset-assert 716) - (jump-land-anim uint32 :offset-assert 720) - (jump-height-min float :offset-assert 724) - (jump-anim-start-frame float :offset-assert 728) - (minimap connection-minimap :offset-assert 732) + ((speed-y float) + (accel-y float) + (next-jump-time int32) + (path-intro path-control) + (can-go-knocked? symbol) + (land-anim-index int32) + (step-num int32) + (best-point vector :inline) + (best-score float) + (origin vector :inline) + (direction vector :inline) + (jump-dist float) + (side float) + (jump-start-anim uint32) + (jump-air-anim uint32) + (jump-land-anim uint32) + (jump-height-min float) + (jump-anim-start-frame float) + (minimap connection-minimap) ) - :heap-base #x260 - :method-count-assert 180 - :size-assert #x2e0 - :flag-assert #xb4026002e0 (:methods - (hopper-method-178 (_type_) symbol 178) - (hopper-method-179 (_type_) none 179) + (hopper-method-178 (_type_) symbol) + (hopper-method-179 (_type_) none) ) ) ;; definition for method 3 of type hopper -(defmethod inspect hopper ((this hopper)) +(defmethod inspect ((this hopper)) (when (not this) (set! this this) (goto cfg-4) @@ -74,17 +70,14 @@ ;; definition of type hopper-anim-info (deftype hopper-anim-info (structure) - ((hit-anim-index int32 :offset-assert 0) - (land-anim-index int32 :offset-assert 4) + ((hit-anim-index int32) + (land-anim-index int32) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type hopper-anim-info -(defmethod inspect hopper-anim-info ((this hopper-anim-info)) +(defmethod inspect ((this hopper-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -98,18 +91,15 @@ ;; definition of type hopper-global-info (deftype hopper-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (yellow-hit-anim hopper-anim-info 3 :inline :offset-assert 8) - (blue-hit-anim hopper-anim-info 3 :inline :offset-assert 32) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (yellow-hit-anim hopper-anim-info 3 :inline) + (blue-hit-anim hopper-anim-info 3 :inline) ) - :method-count-assert 9 - :size-assert #x38 - :flag-assert #x900000038 ) ;; definition for method 3 of type hopper-global-info -(defmethod inspect hopper-global-info ((this hopper-global-info)) +(defmethod inspect ((this hopper-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -139,7 +129,7 @@ ) ;; definition for method 77 of type hopper -(defmethod enemy-method-77 hopper ((this hopper) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this hopper) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((a2-0 (ash 1 (-> *hopper-global-info* prev-blue-hit))) @@ -178,7 +168,7 @@ ) ;; definition for method 78 of type hopper -(defmethod enemy-method-78 hopper ((this hopper) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this hopper) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -404,7 +394,7 @@ (set! (-> *hopper-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 73 of type hopper -(defmethod kill-prefer-falling hopper ((this hopper)) +(defmethod kill-prefer-falling ((this hopper)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cond ((-> this can-go-knocked?) @@ -419,7 +409,7 @@ ;; definition for method 90 of type hopper ;; INFO: Used lq/sq -(defmethod enemy-method-90 hopper ((this hopper) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 ((this hopper) (arg0 int) (arg1 enemy-jump-info)) (when (= (-> this jump-why) 2) (cond ((zero? arg0) @@ -500,7 +490,7 @@ ) ;; definition for method 89 of type hopper -(defmethod enemy-method-89 hopper ((this hopper) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this hopper) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump-start-anim))) (a0-4 (-> this skel root-channel 0)) @@ -515,7 +505,7 @@ ) ;; definition for method 87 of type hopper -(defmethod enemy-method-87 hopper ((this hopper) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this hopper) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump-air-anim))) (a0-4 (-> this skel root-channel 0)) @@ -530,7 +520,7 @@ ) ;; definition for method 88 of type hopper -(defmethod enemy-method-88 hopper ((this hopper) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this hopper) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.075)) (let ((a1-2 (-> this draw art-group data (-> this jump-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -590,7 +580,7 @@ ;; definition for method 178 of type hopper ;; INFO: Used lq/sq -(defmethod hopper-method-178 hopper ((this hopper)) +(defmethod hopper-method-178 ((this hopper)) (local-vars (sv-752 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -858,7 +848,7 @@ ) ;; definition for method 132 of type hopper -(defmethod dispose! hopper ((this hopper)) +(defmethod dispose! ((this hopper)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (when (-> this minimap) (logior! (-> this minimap flags) (minimap-flag fade-out)) @@ -869,7 +859,7 @@ ) ;; definition for method 7 of type hopper -(defmethod relocate hopper ((this hopper) (arg0 int)) +(defmethod relocate ((this hopper) (arg0 int)) (if (nonzero? (-> this path-intro)) (&+! (-> this path-intro) arg0) ) @@ -878,7 +868,7 @@ ;; definition for method 114 of type hopper ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! hopper ((this hopper)) +(defmethod init-enemy-collision! ((this hopper)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -944,7 +934,7 @@ ;; definition for method 115 of type hopper ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! hopper ((this hopper)) +(defmethod init-enemy! ((this hopper)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (stack-size-set! (-> this main-thread) 256) (initialize-skeleton diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc index a1e61ae4755..c15ad141abe 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc @@ -443,14 +443,10 @@ ;; definition of type crimson-guard-hover-shot (deftype crimson-guard-hover-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type crimson-guard-hover-shot -(defmethod inspect crimson-guard-hover-shot ((this crimson-guard-hover-shot)) +(defmethod inspect ((this crimson-guard-hover-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -464,7 +460,7 @@ ;; definition for method 28 of type crimson-guard-hover-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound crimson-guard-hover-shot ((this crimson-guard-hover-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this crimson-guard-hover-shot) (arg0 projectile-options)) (cond ((zero? arg0) ) @@ -478,45 +474,43 @@ ;; definition of type crimson-guard-hover (deftype crimson-guard-hover (hover-enemy) - ((gun-jmod joint-mod :offset-assert 784) - (hips-jmod joint-mod :offset-assert 788) - (entity-group actor-group :offset-assert 792) - (los los-control :inline :offset-assert 800) - (smoke-part sparticle-launch-control :offset-assert 948) - (engine-part sparticle-launch-control :offset-assert 952) - (last-fire-time time-frame :offset-assert 960) - (gun-x-angle float :offset-assert 968) - (gun-x-angle-final float :offset-assert 972) - (path-u float :offset-assert 976) - (path-du float :offset-assert 980) - (path-du-final float :offset-assert 984) - (path-dest float :offset-assert 988) - (sound-id sound-id :offset-assert 992) - (knocked-recover-anim int32 :offset-assert 996) - (attack-wait-min float :offset-assert 1000) - (attack-wait-max float :offset-assert 1004) - (attack-miss-dist-min float :offset-assert 1008) - (attack-miss-dist-max float :offset-assert 1012) - (attack-miss-dist-curr float :offset-assert 1016) - (shots-fired int32 :offset-assert 1020) + ((gun-jmod joint-mod) + (hips-jmod joint-mod) + (entity-group actor-group) + (los los-control :inline) + (smoke-part sparticle-launch-control) + (engine-part sparticle-launch-control) + (last-fire-time time-frame) + (gun-x-angle float) + (gun-x-angle-final float) + (path-u float) + (path-du float) + (path-du-final float) + (path-dest float) + (sound-id sound-id) + (knocked-recover-anim int32) + (attack-wait-min float) + (attack-wait-max float) + (attack-miss-dist-min float) + (attack-miss-dist-max float) + (attack-miss-dist-curr float) + (shots-fired int32) ) - :heap-base #x380 - :method-count-assert 163 - :size-assert #x400 - :flag-assert #xa303800400 + (:state-methods + ambush-fly + ambush-attack + kick-attack + attack + die-now + ) (:methods - (ambush-fly () _type_ :state 156) - (ambush-attack () _type_ :state 157) - (kick-attack () _type_ :state 158) - (attack () _type_ :state 159) - (die-now () _type_ :state 160) - (shoot (_type_ vector projectile-init-by-other-params int int float) none 161) - (crimson-guard-hover-method-162 (_type_ process-focusable) symbol 162) + (shoot (_type_ vector projectile-init-by-other-params int int float) none) + (crimson-guard-hover-method-162 (_type_ process-focusable) symbol) ) ) ;; definition for method 3 of type crimson-guard-hover -(defmethod inspect crimson-guard-hover ((this crimson-guard-hover)) +(defmethod inspect ((this crimson-guard-hover)) (when (not this) (set! this this) (goto cfg-4) @@ -664,7 +658,7 @@ ;; definition for method 135 of type crimson-guard-hover ;; WARN: Return type mismatch int vs sound-id. -(defmethod enemy-method-135 crimson-guard-hover ((this crimson-guard-hover) (arg0 int)) +(defmethod enemy-method-135 ((this crimson-guard-hover) (arg0 int)) (if (and (zero? arg0) (logtest? #x4000000 (-> this incoming penetrate-using))) (sound-play "hover-take-hit") (call-parent-method this arg0) @@ -1185,7 +1179,7 @@ ) ;; definition for method 74 of type crimson-guard-hover -(defmethod general-event-handler crimson-guard-hover ((this crimson-guard-hover) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this crimson-guard-hover) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-15 enemy-flag)) @@ -1261,7 +1255,7 @@ ;; definition for method 162 of type crimson-guard-hover ;; WARN: Return type mismatch object vs symbol. -(defmethod crimson-guard-hover-method-162 crimson-guard-hover ((this crimson-guard-hover) (arg0 process-focusable)) +(defmethod crimson-guard-hover-method-162 ((this crimson-guard-hover) (arg0 process-focusable)) (let* ((v1-1 (vector+! (new 'stack-no-clear 'vector) (-> this root trans) (-> this root transv))) (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this focus-pos))) (f30-0 (vector-length s5-1)) @@ -1298,7 +1292,7 @@ ;; definition for method 145 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-145 crimson-guard-hover ((this crimson-guard-hover) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod hover-enemy-method-145 ((this crimson-guard-hover) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) @@ -1323,7 +1317,7 @@ ;; definition for method 52 of type crimson-guard-hover ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 crimson-guard-hover ((this crimson-guard-hover) (arg0 vector)) +(defmethod enemy-method-52 ((this crimson-guard-hover) (arg0 vector)) (let ((s4-0 (-> this root))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-2)) @@ -1361,7 +1355,7 @@ ) ;; definition for method 77 of type crimson-guard-hover -(defmethod enemy-method-77 crimson-guard-hover ((this crimson-guard-hover) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this crimson-guard-hover) (arg0 (pointer float))) (ja-channel-push! 1 0) (case (-> this incoming knocked-type) (((knocked-type knocked-type-5)) @@ -1393,7 +1387,7 @@ ) ;; definition for method 78 of type crimson-guard-hover -(defmethod enemy-method-78 crimson-guard-hover ((this crimson-guard-hover) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this crimson-guard-hover) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.4)) @@ -1416,7 +1410,7 @@ ;; definition for method 55 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod track-target! crimson-guard-hover ((this crimson-guard-hover)) +(defmethod track-target! ((this crimson-guard-hover)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1457,7 +1451,7 @@ ;; definition for method 142 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-142 crimson-guard-hover ((this crimson-guard-hover)) +(defmethod hover-enemy-method-142 ((this crimson-guard-hover)) (let ((s5-0 (-> this main-joint-acc)) (s4-0 (-> this main-joint-vel)) (gp-0 @@ -1566,7 +1560,7 @@ ;; definition for method 143 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-143 crimson-guard-hover ((this crimson-guard-hover) (arg0 int) (arg1 float)) +(defmethod hover-enemy-method-143 ((this crimson-guard-hover) (arg0 int) (arg1 float)) (let* ((s2-0 (-> this node-list data arg0)) (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) s2-0)) (s5-0 (new 'stack-no-clear 'matrix)) @@ -1606,13 +1600,13 @@ ;; definition for method 161 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod shoot crimson-guard-hover ((this crimson-guard-hover) - (arg0 vector) - (arg1 projectile-init-by-other-params) - (arg2 int) - (arg3 int) - (arg4 float) - ) +(defmethod shoot ((this crimson-guard-hover) + (arg0 vector) + (arg1 projectile-init-by-other-params) + (arg2 int) + (arg3 int) + (arg4 float) + ) (vector<-cspace! (-> arg1 pos) (-> this node-list data arg2)) (let ((s2-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) @@ -1640,7 +1634,7 @@ ) ;; definition for method 73 of type crimson-guard-hover -(defmethod kill-prefer-falling crimson-guard-hover ((this crimson-guard-hover)) +(defmethod kill-prefer-falling ((this crimson-guard-hover)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cond ((and (-> this next-state) (= (-> this next-state name) 'knocked)) @@ -1657,7 +1651,7 @@ ;; definition for method 63 of type crimson-guard-hover ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 crimson-guard-hover ((this crimson-guard-hover) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this crimson-guard-hover) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) (the-as symbol (if (t9-0 (the-as nav-enemy this) arg0 arg1) (set-dst-proc! (-> this los) (-> this focus handle)) @@ -1668,7 +1662,7 @@ ;; definition for method 149 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-149 crimson-guard-hover ((this crimson-guard-hover)) +(defmethod hover-enemy-method-149 ((this crimson-guard-hover)) (initialize-skeleton this (the-as @@ -1683,7 +1677,7 @@ ;; definition for method 114 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! crimson-guard-hover ((this crimson-guard-hover)) +(defmethod init-enemy-collision! ((this crimson-guard-hover)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1782,12 +1776,12 @@ ) ;; definition for method 150 of type crimson-guard-hover -(defmethod hover-enemy-method-150 crimson-guard-hover ((this crimson-guard-hover)) +(defmethod hover-enemy-method-150 ((this crimson-guard-hover)) *crimson-guard-hover-enemy-info* ) ;; definition for method 151 of type crimson-guard-hover -(defmethod hover-enemy-method-151 crimson-guard-hover ((this crimson-guard-hover)) +(defmethod hover-enemy-method-151 ((this crimson-guard-hover)) (new 'static 'hover-enemy-info :fly-forward-anim 7 :fly-backward-anim 8 @@ -1804,13 +1798,13 @@ ) ;; definition for method 152 of type crimson-guard-hover -(defmethod hover-enemy-method-152 crimson-guard-hover ((this crimson-guard-hover)) +(defmethod hover-enemy-method-152 ((this crimson-guard-hover)) (new 'static 'hover-nav-params :max-speed 102400.0 :max-acceleration 143360.0 :friction 0.05) ) ;; definition for method 7 of type crimson-guard-hover ;; WARN: Return type mismatch hover-enemy vs crimson-guard-hover. -(defmethod relocate crimson-guard-hover ((this crimson-guard-hover) (arg0 int)) +(defmethod relocate ((this crimson-guard-hover) (arg0 int)) (if (nonzero? (-> this gun-jmod)) (&+! (-> this gun-jmod) arg0) ) @@ -1827,7 +1821,7 @@ ) ;; definition for method 10 of type crimson-guard-hover -(defmethod deactivate crimson-guard-hover ((this crimson-guard-hover)) +(defmethod deactivate ((this crimson-guard-hover)) (if (nonzero? (-> this smoke-part)) (kill-and-free-particles (-> this smoke-part)) ) @@ -1842,7 +1836,7 @@ ;; definition for method 115 of type crimson-guard-hover ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! crimson-guard-hover ((this crimson-guard-hover)) +(defmethod init-enemy! ((this crimson-guard-hover)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) (hover-enemy-method-149 this) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/flamer_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/flamer_REF.gc index 531d4353454..3d38f184269 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/flamer_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/flamer_REF.gc @@ -4,14 +4,10 @@ ;; definition of type flying-formation (deftype flying-formation (hover-formation) () - :heap-base #x10 - :method-count-assert 16 - :size-assert #x90 - :flag-assert #x1000100090 ) ;; definition for method 3 of type flying-formation -(defmethod inspect flying-formation ((this flying-formation)) +(defmethod inspect ((this flying-formation)) (when (not this) (set! this this) (goto cfg-4) @@ -25,56 +21,54 @@ ;; definition of type flamer (deftype flamer (nav-enemy) - ((shot-trajectory trajectory :inline :offset-assert 608) - (last-fire-time time-frame :offset-assert 648) - (sync-off uint32 :offset-assert 656) - (base-pos vector :inline :offset-assert 672) - (idle-pos vector :inline :offset-assert 688) - (offset vector :inline :offset-assert 704) - (dest-pos vector :inline :offset-assert 720) - (zone-to-world matrix :inline :offset-assert 736) - (world-to-zone matrix :inline :offset-assert 800) - (formation-entity entity-actor :offset-assert 864) - (flit-joint joint-mod :offset-assert 868) - (flit-angle float :offset-assert 872) - (flit-timer time-frame :offset-assert 880) - (path-pos float :offset-assert 888) - (sound-volume float :offset-assert 892) - (scale float :offset-assert 896) - (hit-surface? symbol :offset-assert 900) - (ground-mode int8 :offset-assert 904) - (init-quat quaternion :inline :offset-assert 912) - (surface-normal vector :inline :offset-assert 928) - (main-joint-pos vector :inline :offset-assert 944) - (main-joint-vel vector :inline :offset-assert 960) - (main-joint-acc vector :inline :offset-assert 976) - (main-acceleration float :offset-assert 992) - (fly-dir vector :inline :offset-assert 1008) + ((shot-trajectory trajectory :inline) + (last-fire-time time-frame) + (sync-off uint32) + (base-pos vector :inline) + (idle-pos vector :inline) + (offset vector :inline) + (dest-pos vector :inline) + (zone-to-world matrix :inline) + (world-to-zone matrix :inline) + (formation-entity entity-actor) + (flit-joint joint-mod) + (flit-angle float) + (flit-timer time-frame) + (path-pos float) + (sound-volume float) + (scale float) + (hit-surface? symbol) + (ground-mode int8) + (init-quat quaternion :inline) + (surface-normal vector :inline) + (main-joint-pos vector :inline) + (main-joint-vel vector :inline) + (main-joint-acc vector :inline) + (main-acceleration float) + (fly-dir vector :inline) ) - :heap-base #x380 - :method-count-assert 192 - :size-assert #x400 - :flag-assert #xc003800400 + (:state-methods + attack + wait-for-formation + exit-ambush + exit-ambush-path + ) (:methods - (attack () _type_ :state 178) - (wait-for-formation () _type_ :state 179) - (exit-ambush () _type_ :state 180) - (exit-ambush-path () _type_ :state 181) - (flamer-method-182 (_type_ vector process-focusable) none 182) - (flamer-method-183 (_type_) symbol 183) - (flamer-method-184 (_type_) none 184) - (flamer-method-185 (_type_) none 185) - (flamer-method-186 (_type_ float) vector 186) - (flamer-method-187 (_type_) none 187) - (flamer-method-188 (_type_ int float int int) none 188) - (flamer-method-189 (_type_) none 189) - (flamer-method-190 (_type_) none 190) - (flamer-method-191 (_type_) none 191) + (flamer-method-182 (_type_ vector process-focusable) none) + (flamer-method-183 (_type_) symbol) + (flamer-method-184 (_type_) none) + (flamer-method-185 (_type_) none) + (flamer-method-186 (_type_ float) vector) + (flamer-method-187 (_type_) none) + (flamer-method-188 (_type_ int float int int) none) + (flamer-method-189 (_type_) none) + (flamer-method-190 (_type_) none) + (flamer-method-191 (_type_) none) ) ) ;; definition for method 3 of type flamer -(defmethod inspect flamer ((this flamer)) +(defmethod inspect ((this flamer)) (when (not this) (set! this this) (goto cfg-4) @@ -269,7 +263,7 @@ ;; definition for method 74 of type flamer ;; INFO: Used lq/sq -(defmethod general-event-handler flamer ((this flamer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this flamer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -303,7 +297,7 @@ ;; definition for method 189 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod flamer-method-189 flamer ((this flamer)) +(defmethod flamer-method-189 ((this flamer)) (with-pp (let ((v1-0 (-> this formation-entity))) (when (if v1-0 @@ -333,7 +327,7 @@ ;; definition for method 190 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod flamer-method-190 flamer ((this flamer)) +(defmethod flamer-method-190 ((this flamer)) (with-pp (let ((v1-0 (-> this formation-entity))) (when (if v1-0 @@ -363,7 +357,7 @@ ;; definition for method 142 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 flamer ((this flamer) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this flamer) (arg0 nav-control)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 (target-pos 0) (-> this root trans)) (seek-toward-heading-vec! (-> this root) gp-0 131072.0 (seconds 0.5)) @@ -375,7 +369,7 @@ ;; definition for method 182 of type flamer ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod flamer-method-182 flamer ((this flamer) (arg0 vector) (arg1 process-focusable)) +(defmethod flamer-method-182 ((this flamer) (arg0 vector) (arg1 process-focusable)) (with-pp (set! arg0 (cond ((and *target* (-> this next-state) (let ((v1-4 (-> this next-state name))) @@ -504,7 +498,7 @@ ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 22. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. ;; WARN: disable def twice: 45. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod flamer-method-183 flamer ((this flamer)) +(defmethod flamer-method-183 ((this flamer)) (with-pp (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) @@ -548,7 +542,7 @@ ;; definition for method 188 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod flamer-method-188 flamer ((this flamer) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod flamer-method-188 ((this flamer) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) @@ -571,7 +565,7 @@ ;; definition for method 187 of type flamer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod flamer-method-187 flamer ((this flamer)) +(defmethod flamer-method-187 ((this flamer)) (local-vars (at-0 int) (at-1 int)) (with-pp (rlet ((vf0 :class vf) @@ -625,7 +619,7 @@ ) ;; definition for method 55 of type flamer -(defmethod track-target! flamer ((this flamer)) +(defmethod track-target! ((this flamer)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -639,7 +633,7 @@ ;; definition for method 191 of type flamer ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod flamer-method-191 flamer ((this flamer)) +(defmethod flamer-method-191 ((this flamer)) (cond ((and (-> this draw shadow) (zero? (-> this draw cur-lod)) @@ -752,7 +746,7 @@ ;; definition for method 184 of type flamer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod flamer-method-184 flamer ((this flamer)) +(defmethod flamer-method-184 ((this flamer)) (let ((v1-0 (-> this ground-mode))) (cond ((= v1-0 1) @@ -805,7 +799,7 @@ ) ;; definition for method 67 of type flamer -(defmethod go-stare flamer ((this flamer)) +(defmethod go-stare ((this flamer)) (go-hostile this) ) @@ -1217,7 +1211,7 @@ ;; definition for method 46 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-46 flamer ((this flamer) (arg0 int)) +(defmethod enemy-method-46 ((this flamer) (arg0 int)) "@abstract" (let ((v1-0 arg0)) (cond @@ -1254,7 +1248,7 @@ ;; definition for method 77 of type flamer ;; WARN: Return type mismatch object vs symbol. ;; WARN: Using new Jak 2 rtype-of -(defmethod enemy-method-77 flamer ((this flamer) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this flamer) (arg0 (pointer float))) (let ((v1-0 (-> this incoming knocked-type))) (the-as symbol @@ -1386,7 +1380,7 @@ ) ;; definition for method 132 of type flamer -(defmethod dispose! flamer ((this flamer)) +(defmethod dispose! ((this flamer)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (let ((s5-1 (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags)))) (let ((t9-0 (method-of-type nav-enemy dispose!))) @@ -1400,7 +1394,7 @@ ) ;; definition for method 186 of type flamer -(defmethod flamer-method-186 flamer ((this flamer) (arg0 float)) +(defmethod flamer-method-186 ((this flamer) (arg0 float)) (let ((f0-1 (* (-> this scale) arg0)) (v0-0 (-> this root scale)) ) @@ -1413,14 +1407,14 @@ ) ;; definition for method 60 of type flamer -(defmethod coin-flip? flamer ((this flamer)) +(defmethod coin-flip? ((this flamer)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 114 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! flamer ((this flamer)) +(defmethod init-enemy-collision! ((this flamer)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1496,7 +1490,7 @@ ) ;; definition for method 7 of type flamer -(defmethod relocate flamer ((this flamer) (arg0 int)) +(defmethod relocate ((this flamer) (arg0 int)) (if (nonzero? (-> this flit-joint)) (&+! (-> this flit-joint) arg0) ) @@ -1506,7 +1500,7 @@ ;; definition for method 115 of type flamer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! flamer ((this flamer)) +(defmethod init-enemy! ((this flamer)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1584,7 +1578,7 @@ ;; definition for method 116 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod go-idle flamer ((this flamer)) +(defmethod go-idle ((this flamer)) (if (-> this formation-entity) (go (method-of-object this wait-for-formation)) (go (method-of-object this idle)) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-battle_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-battle_REF.gc index 47e8f18bfd3..3ec15bf735b 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-battle_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-battle_REF.gc @@ -3,18 +3,15 @@ ;; definition of type hover-enemy-battle-command (deftype hover-enemy-battle-command (structure) - ((command symbol :offset-assert 0) - (wave uint16 :offset-assert 4) - (time time-frame :offset-assert 8) - (alive-count int32 :offset-assert 16) + ((command symbol) + (wave uint16) + (time time-frame) + (alive-count int32) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type hover-enemy-battle-command -(defmethod inspect hover-enemy-battle-command ((this hover-enemy-battle-command)) +(defmethod inspect ((this hover-enemy-battle-command)) (when (not this) (set! this this) (goto cfg-4) @@ -30,31 +27,29 @@ ;; definition of type hover-enemy-manager (deftype hover-enemy-manager (process) - ((command-table (array hover-enemy-battle-command) :offset-assert 128) - (path path-control :offset-assert 132) - (formation hover-formation-control :offset-assert 136) - (actor-group (pointer actor-group) :offset-assert 140) - (actor-group-count int32 :offset-assert 144) - (total-to-spawn int32 :offset-assert 148) - (num-spawned int32 :offset-assert 152) - (alive-count int32 :offset-assert 156) - (formation-timer time-frame :offset-assert 160) + ((command-table (array hover-enemy-battle-command)) + (path path-control) + (formation hover-formation-control) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (total-to-spawn int32) + (num-spawned int32) + (alive-count int32) + (formation-timer time-frame) ) - :heap-base #x30 - :method-count-assert 19 - :size-assert #xa8 - :flag-assert #x13003000a8 + (:state-methods + idle + spawning + die + ) (:methods - (idle () _type_ :state 14) - (spawning () _type_ :state 15) - (die () _type_ :state 16) - (hover-enemy-manager-init! (_type_ (array hover-enemy-battle-command)) none 17) - (spawn-enemy (_type_ uint) none 18) + (hover-enemy-manager-init! (_type_ (array hover-enemy-battle-command)) none) + (spawn-enemy (_type_ uint) none) ) ) ;; definition for method 3 of type hover-enemy-manager -(defmethod inspect hover-enemy-manager ((this hover-enemy-manager)) +(defmethod inspect ((this hover-enemy-manager)) (when (not this) (set! this this) (goto cfg-7) @@ -255,7 +250,7 @@ ;; definition for method 18 of type hover-enemy-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-enemy hover-enemy-manager ((this hover-enemy-manager) (arg0 uint)) +(defmethod spawn-enemy ((this hover-enemy-manager) (arg0 uint)) (when (< arg0 (the-as uint (-> this actor-group-count))) (dotimes (s4-0 (-> this actor-group arg0 length)) (let* ((s1-0 (-> this actor-group arg0 data s4-0 actor)) @@ -287,7 +282,7 @@ ) ;; definition for method 7 of type hover-enemy-manager -(defmethod relocate hover-enemy-manager ((this hover-enemy-manager) (arg0 int)) +(defmethod relocate ((this hover-enemy-manager) (arg0 int)) (when (-> this formation) (if (nonzero? (-> this formation)) (&+! (-> this formation) arg0) @@ -302,7 +297,7 @@ ;; definition for method 17 of type hover-enemy-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-manager-init! hover-enemy-manager ((this hover-enemy-manager) (arg0 (array hover-enemy-battle-command))) +(defmethod hover-enemy-manager-init! ((this hover-enemy-manager) (arg0 (array hover-enemy-battle-command))) "Initialize this [[hover-enemy-manager]]." (local-vars (sv-16 res-tag)) (set! (-> this command-table) arg0) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-h_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-h_REF.gc index f93c7ce82bf..5b57ea491f7 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-h_REF.gc @@ -3,25 +3,22 @@ ;; definition of type hover-enemy-info (deftype hover-enemy-info (structure) - ((fly-forward-anim int32 :offset-assert 0) - (fly-backward-anim int32 :offset-assert 4) - (fly-left-anim int32 :offset-assert 8) - (fly-right-anim int32 :offset-assert 12) - (shoot-anim int32 :offset-assert 16) - (main-joint int32 :offset-assert 20) - (gun-base int32 :offset-assert 24) - (engine-left int32 :offset-assert 28) - (engine-right int32 :offset-assert 32) - (thrust-rotate-left float :offset-assert 36) - (thrust-rotate-right float :offset-assert 40) + ((fly-forward-anim int32) + (fly-backward-anim int32) + (fly-left-anim int32) + (fly-right-anim int32) + (shoot-anim int32) + (main-joint int32) + (gun-base int32) + (engine-left int32) + (engine-right int32) + (thrust-rotate-left float) + (thrust-rotate-right float) ) - :method-count-assert 9 - :size-assert #x2c - :flag-assert #x90000002c ) ;; definition for method 3 of type hover-enemy-info -(defmethod inspect hover-enemy-info ((this hover-enemy-info)) +(defmethod inspect ((this hover-enemy-info)) (when (not this) (set! this this) (goto cfg-4) @@ -44,62 +41,60 @@ ;; definition of type hover-enemy (deftype hover-enemy (enemy) - ((hover hover-nav-control :offset-assert 532) - (hover-info hover-enemy-info :offset-assert 536) - (formation-entity entity :offset-assert 540) - (fly-anim-speed float :offset-assert 544) - (restart-fly-anims symbol :offset-assert 548) - (main-joint-acc vector :inline :offset-assert 560) - (main-joint-vel vector :inline :offset-assert 576) - (main-joint-pos vector :inline :offset-assert 592) - (thrust float 2 :offset-assert 608) - (rotation-vec vector :inline :offset-assert 624) - (dest-pos vector :inline :offset-assert 640) - (offset vector :inline :offset-assert 656) - (surface-normal vector :inline :offset-assert 672) - (local-dir vector :inline :offset-assert 688) - (scale float :offset-assert 704) - (scale-timer uint64 :offset-assert 712) - (hit-surface? symbol :offset-assert 720) - (knocked-start-level float :offset-assert 724) - (knocked-fall-dist float :offset-assert 728) - (flying-death-anim int32 :offset-assert 732) - (flying-death-transv vector :inline :offset-assert 736) - (flying-death-engine int32 :offset-assert 752) - (flying-death-thrust-rotate float :offset-assert 756) - (flying-death-spin float :offset-assert 760) - (flying-death-spin-dest float :offset-assert 764) - (flying-death-spin-axis vector :inline :offset-assert 768) + ((hover hover-nav-control) + (hover-info hover-enemy-info) + (formation-entity entity) + (fly-anim-speed float) + (restart-fly-anims symbol) + (main-joint-acc vector :inline) + (main-joint-vel vector :inline) + (main-joint-pos vector :inline) + (thrust float 2) + (rotation-vec vector :inline) + (dest-pos vector :inline) + (offset vector :inline) + (surface-normal vector :inline) + (local-dir vector :inline) + (scale float) + (scale-timer uint64) + (hit-surface? symbol) + (knocked-start-level float) + (knocked-fall-dist float) + (flying-death-anim int32) + (flying-death-transv vector :inline) + (flying-death-engine int32) + (flying-death-thrust-rotate float) + (flying-death-spin float) + (flying-death-spin-dest float) + (flying-death-spin-axis vector :inline) ) - :heap-base #x290 - :method-count-assert 156 - :size-assert #x310 - :flag-assert #x9c02900310 + (:state-methods + knocked-recover + flying-death + flying-death-explode + ) (:methods - (knocked-recover () _type_ :state 137) - (flying-death () _type_ :state 138) - (flying-death-explode () _type_ :state 139) - (hover-enemy-method-140 (_type_ symbol) none 140) - (hover-enemy-method-141 (_type_ float) none 141) - (hover-enemy-method-142 (_type_) none 142) - (hover-enemy-method-143 (_type_ int float) none 143) - (hover-enemy-method-144 (_type_) none 144) - (hover-enemy-method-145 (_type_ int float int int) none 145) - (hover-enemy-method-146 (_type_) none 146) - (hover-enemy-method-147 (_type_) none 147) - (hover-enemy-method-148 (_type_) none 148) - (hover-enemy-method-149 (_type_) none 149) - (hover-enemy-method-150 (_type_) enemy-info 150) - (hover-enemy-method-151 (_type_) hover-enemy-info 151) - (hover-enemy-method-152 (_type_) hover-nav-params 152) - (hover-enemy-method-153 (_type_) none 153) - (hover-enemy-method-154 (_type_) none 154) - (hover-enemy-method-155 (_type_) none 155) + (hover-enemy-method-140 (_type_ symbol) none) + (hover-enemy-method-141 (_type_ float) none) + (hover-enemy-method-142 (_type_) none) + (hover-enemy-method-143 (_type_ int float) none) + (hover-enemy-method-144 (_type_) none) + (hover-enemy-method-145 (_type_ int float int int) none) + (hover-enemy-method-146 (_type_) none) + (hover-enemy-method-147 (_type_) none) + (hover-enemy-method-148 (_type_) none) + (hover-enemy-method-149 (_type_) none) + (hover-enemy-method-150 (_type_) enemy-info) + (hover-enemy-method-151 (_type_) hover-enemy-info) + (hover-enemy-method-152 (_type_) hover-nav-params) + (hover-enemy-method-153 (_type_) none) + (hover-enemy-method-154 (_type_) none) + (hover-enemy-method-155 (_type_) none) ) ) ;; definition for method 3 of type hover-enemy -(defmethod inspect hover-enemy ((this hover-enemy)) +(defmethod inspect ((this hover-enemy)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy_REF.gc index a4fbbbeec47..68684c4d6ee 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 74 of type hover-enemy ;; INFO: Used lq/sq -(defmethod general-event-handler hover-enemy ((this hover-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this hover-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-41 float)) @@ -206,14 +206,14 @@ ;; definition for method 142 of type hover-enemy ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-142 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-142 ((this hover-enemy)) 0 (none) ) ;; definition for method 153 of type hover-enemy ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-153 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-153 ((this hover-enemy)) (let* ((v1-0 (-> this formation-entity)) (a0-1 (if v1-0 (-> v1-0 extra process) @@ -230,7 +230,7 @@ ;; definition for method 154 of type hover-enemy ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-154 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-154 ((this hover-enemy)) (let* ((v1-0 (-> this formation-entity)) (a0-1 (if v1-0 (-> v1-0 extra process) @@ -246,7 +246,7 @@ ) ;; definition for method 60 of type hover-enemy -(defmethod coin-flip? hover-enemy ((this hover-enemy)) +(defmethod coin-flip? ((this hover-enemy)) "@returns The result of a 50/50 RNG roll" #f ) @@ -254,7 +254,7 @@ ;; definition for method 144 of type hover-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-144 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-144 ((this hover-enemy)) (set! (-> this main-joint-pos quad) (-> this root trans quad)) (set! (-> this main-joint-vel quad) (the-as uint128 0)) (set! (-> this main-joint-acc quad) (the-as uint128 0)) @@ -266,7 +266,7 @@ ;; definition for method 145 of type hover-enemy ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-145 hover-enemy ((this hover-enemy) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod hover-enemy-method-145 ((this hover-enemy) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) @@ -289,7 +289,7 @@ ;; definition for method 129 of type hover-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod enemy-method-129 hover-enemy ((this hover-enemy)) +(defmethod enemy-method-129 ((this hover-enemy)) (local-vars (s5-0 vector)) (let ((t9-0 (method-of-type enemy enemy-method-129))) (t9-0 this) @@ -306,7 +306,7 @@ ) ;; definition for method 55 of type hover-enemy -(defmethod track-target! hover-enemy ((this hover-enemy)) +(defmethod track-target! ((this hover-enemy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -323,7 +323,7 @@ ;; definition for method 148 of type hover-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-148 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-148 ((this hover-enemy)) (cond ((and (-> this draw shadow) (logtest? (-> this draw status) (draw-control-status on-screen))) (new 'stack-no-clear 'vector) @@ -857,18 +857,18 @@ ) ;; definition for method 67 of type hover-enemy -(defmethod go-stare hover-enemy ((this hover-enemy)) +(defmethod go-stare ((this hover-enemy)) (go-hostile this) ) ;; definition for method 68 of type hover-enemy -(defmethod go-stare2 hover-enemy ((this hover-enemy)) +(defmethod go-stare2 ((this hover-enemy)) (go-hostile this) ) ;; definition for method 146 of type hover-enemy ;; WARN: Return type mismatch quaternion vs none. -(defmethod hover-enemy-method-146 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-146 ((this hover-enemy)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (matrix-rotate-zxy! gp-0 (-> this rotation-vec)) (matrix->quaternion (-> this root quat) gp-0) @@ -878,7 +878,7 @@ ;; definition for method 147 of type hover-enemy ;; WARN: Return type mismatch float vs none. -(defmethod hover-enemy-method-147 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-147 ((this hover-enemy)) (let ((s5-0 (-> this root quat)) (gp-0 (-> this rotation-vec)) ) @@ -891,7 +891,7 @@ ;; definition for method 140 of type hover-enemy ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-140 hover-enemy ((this hover-enemy) (arg0 symbol)) +(defmethod hover-enemy-method-140 ((this hover-enemy) (arg0 symbol)) (let ((v1-0 0) (a0-2 (-> this root root-prim)) ) @@ -908,7 +908,7 @@ ;; definition for method 141 of type hover-enemy ;; WARN: Return type mismatch vector vs none. -(defmethod hover-enemy-method-141 hover-enemy ((this hover-enemy) (arg0 float)) +(defmethod hover-enemy-method-141 ((this hover-enemy) (arg0 float)) (let ((f0-1 (* (-> this scale) arg0))) (set-vector! (-> this root scale) (* 1.2 f0-1) (* 0.9 f0-1) f0-1 1.0) ) @@ -916,7 +916,7 @@ ) ;; definition for method 132 of type hover-enemy -(defmethod dispose! hover-enemy ((this hover-enemy)) +(defmethod dispose! ((this hover-enemy)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) (process-entity-status! this (entity-perm-status subtask-complete) #t) @@ -928,7 +928,7 @@ ) ;; definition for method 10 of type hover-enemy -(defmethod deactivate hover-enemy ((this hover-enemy)) +(defmethod deactivate ((this hover-enemy)) (hover-nav-control-method-9 (-> this hover)) ((method-of-type enemy deactivate) this) (none) @@ -936,7 +936,7 @@ ;; definition for method 7 of type hover-enemy ;; WARN: Return type mismatch enemy vs hover-enemy. -(defmethod relocate hover-enemy ((this hover-enemy) (arg0 int)) +(defmethod relocate ((this hover-enemy) (arg0 int)) (if (nonzero? (-> this hover)) (&+! (-> this hover) arg0) ) @@ -946,7 +946,7 @@ ;; definition for method 155 of type hover-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-155 hover-enemy ((this hover-enemy)) +(defmethod hover-enemy-method-155 ((this hover-enemy)) (set! (-> this hover-info) (hover-enemy-method-151 this)) (set! (-> this fly-anim-speed) (get-rand-float-range this 0.8 1.2)) (vector-reset! (-> this rotation-vec)) @@ -983,49 +983,47 @@ ;; definition of type wasp (deftype wasp (hover-enemy) - ((gun-jmod joint-mod :offset-assert 784) - (entity-group actor-group :offset-assert 788) - (smoke-part sparticle-launch-control :offset-assert 792) - (engine-part sparticle-launch-control :offset-assert 796) - (old-gravity float :offset 804) - (knocked-anim int32 :offset-assert 808) - (knocked-recover-anim int32 :offset-assert 812) - (last-fire-time time-frame :offset-assert 816) - (bridge-index int32 :offset-assert 824) - (gun-x-angle float :offset-assert 828) - (gun-x-angle-final float :offset-assert 832) - (path-u float :offset-assert 836) - (path-du float :offset-assert 840) - (path-du-final float :offset-assert 844) - (path-dest float :offset-assert 848) - (plat-pos vector :inline :offset-assert 864) - (sound-id sound-id :offset-assert 880) - (attack-wait-min float :offset-assert 884) - (attack-wait-max float :offset-assert 888) - (attack-miss-dist-min float :offset-assert 892) - (attack-miss-dist-max float :offset-assert 896) - (attack-miss-dist-curr float :offset-assert 900) + ((gun-jmod joint-mod) + (entity-group actor-group) + (smoke-part sparticle-launch-control) + (engine-part sparticle-launch-control) + (old-gravity float :offset 804) + (knocked-anim int32) + (knocked-recover-anim int32) + (last-fire-time time-frame) + (bridge-index int32) + (gun-x-angle float) + (gun-x-angle-final float) + (path-u float) + (path-du float) + (path-du-final float) + (path-dest float) + (plat-pos vector :inline) + (sound-id sound-id) + (attack-wait-min float) + (attack-wait-max float) + (attack-miss-dist-min float) + (attack-miss-dist-max float) + (attack-miss-dist-curr float) ) - :heap-base #x310 - :method-count-assert 166 - :size-assert #x388 - :flag-assert #xa603100388 + (:state-methods + shoot-bridge-wait + shoot-bridge-intro + shoot-bridge-hold + shoot-bridge-hostile + shoot-bridge-attack + shoot-bridge-outro + attack + die-now + die-explode + ) (:methods - (shoot-bridge-wait () _type_ :state 156) - (shoot-bridge-intro () _type_ :state 157) - (shoot-bridge-hold () _type_ :state 158) - (shoot-bridge-hostile () _type_ :state 159) - (shoot-bridge-attack () _type_ :state 160) - (shoot-bridge-outro () _type_ :state 161) - (attack () _type_ :state 162) - (die-now () _type_ :state 163) - (die-explode () _type_ :state 164) - (spawn-wasp-shot (_type_ projectile-init-by-other-params int float float) none 165) + (spawn-wasp-shot (_type_ projectile-init-by-other-params int float float) none) ) ) ;; definition for method 3 of type wasp -(defmethod inspect wasp ((this wasp)) +(defmethod inspect ((this wasp)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation-h_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation-h_REF.gc index a818fe9b666..ceb9c6fb232 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation-h_REF.gc @@ -3,23 +3,20 @@ ;; definition of type form-search-info (deftype form-search-info (structure) - ((form uint32 :offset-assert 0) - (count int32 :offset-assert 4) - (pos-table (inline-array vector) :offset-assert 8) - (actor-position vector 16 :inline :offset-assert 16) - (actor-valid? symbol 16 :offset-assert 272) - (index-table uint32 16 :offset-assert 336) - (dest-pos-table vector 16 :inline :offset-assert 400) - (best-mapping uint32 16 :offset-assert 656) - (best-cost float :offset-assert 720) + ((form uint32) + (count int32) + (pos-table (inline-array vector)) + (actor-position vector 16 :inline) + (actor-valid? symbol 16) + (index-table uint32 16) + (dest-pos-table vector 16 :inline) + (best-mapping uint32 16) + (best-cost float) ) - :method-count-assert 9 - :size-assert #x2d4 - :flag-assert #x9000002d4 ) ;; definition for method 3 of type form-search-info -(defmethod inspect form-search-info ((this form-search-info)) +(defmethod inspect ((this form-search-info)) (when (not this) (set! this this) (goto cfg-4) @@ -40,16 +37,13 @@ ;; definition of type hover-actor (deftype hover-actor (structure) - ((handle handle :offset-assert 0) - (offset vector :inline :offset-assert 16) + ((handle handle) + (offset vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type hover-actor -(defmethod inspect hover-actor ((this hover-actor)) +(defmethod inspect ((this hover-actor)) (when (not this) (set! this this) (goto cfg-4) @@ -63,42 +57,39 @@ ;; definition of type hover-formation-control (deftype hover-formation-control (basic) - ((search-info form-search-info :inline :offset-assert 16) - (entity entity :offset-assert 740) - (anchor-proc handle :offset-assert 744) - (actor-table handle 16 :offset-assert 752) - (flags uint16 :offset-assert 880) - (formation-type formation-type :offset-assert 888) - (center vector :inline :offset-assert 896) - (zone-to-world matrix :inline :offset-assert 912) - (world-to-zone matrix :inline :offset-assert 976) - (offset vector :inline :offset-assert 1040) - (focus-quat quaternion :inline :offset-assert 1056) - (notice-dist meters :offset-assert 1072) - (rotation-inc float :offset-assert 1076) + ((search-info form-search-info :inline) + (entity entity) + (anchor-proc handle) + (actor-table handle 16) + (flags uint16) + (formation-type formation-type) + (center vector :inline) + (zone-to-world matrix :inline) + (world-to-zone matrix :inline) + (offset vector :inline) + (focus-quat quaternion :inline) + (notice-dist meters) + (rotation-inc float) ) - :method-count-assert 21 - :size-assert #x438 - :flag-assert #x1500000438 (:methods - (new (symbol type object entity float vector float handle) _type_ 0) - (set-anchor-proc (_type_ handle) int 9) - (hover-formation-control-method-10 (_type_ vector vector float) symbol 10) - (hover-formation-control-method-11 (_type_) int 11) - (is-formation-type-in-range (_type_) symbol 12) - (hover-formation-control-method-13 (_type_ vector) vector 13) - (hover-formation-control-method-14 (_type_) none 14) - (hover-formation-control-method-15 (_type_ vector vector) vector 15) - (hover-formation-control-method-16 (_type_) object 16) - (hover-formation-control-method-17 (_type_ process) int 17) - (hover-formation-control-method-18 (_type_ process) int 18) - (try-update-formation-type (_type_ formation-type) int 19) - (hover-formation-control-method-20 (_type_ object object) none 20) + (new (symbol type object entity float vector float handle) _type_) + (set-anchor-proc (_type_ handle) int) + (hover-formation-control-method-10 (_type_ vector vector float) symbol) + (hover-formation-control-method-11 (_type_) int) + (is-formation-type-in-range (_type_) symbol) + (hover-formation-control-method-13 (_type_ vector) vector) + (hover-formation-control-method-14 (_type_) none) + (hover-formation-control-method-15 (_type_ vector vector) vector) + (hover-formation-control-method-16 (_type_) object) + (hover-formation-control-method-17 (_type_ process) int) + (hover-formation-control-method-18 (_type_ process) int) + (try-update-formation-type (_type_ formation-type) int) + (hover-formation-control-method-20 (_type_ object object) none) ) ) ;; definition for method 3 of type hover-formation-control -(defmethod inspect hover-formation-control ((this hover-formation-control)) +(defmethod inspect ((this hover-formation-control)) (when (not this) (set! this this) (goto cfg-4) @@ -123,22 +114,20 @@ ;; definition of type hover-formation (deftype hover-formation (process) - ((formation hover-formation-control :offset-assert 128) - (path path-control :offset-assert 132) - (formation-timer uint64 :offset-assert 136) + ((formation hover-formation-control) + (path path-control) + (formation-timer uint64) ) - :heap-base #x10 - :method-count-assert 16 - :size-assert #x90 - :flag-assert #x1000100090 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (hover-formation-method-15 (_type_ vector vector) int 15) + (hover-formation-method-15 (_type_ vector vector) int) ) ) ;; definition for method 3 of type hover-formation -(defmethod inspect hover-formation ((this hover-formation)) +(defmethod inspect ((this hover-formation)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation_REF.gc index b5e4749eac8..ca29087bba3 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 12 of type hover-formation-control -(defmethod is-formation-type-in-range hover-formation-control ((this hover-formation-control)) +(defmethod is-formation-type-in-range ((this hover-formation-control)) (case (-> this formation-type) (((formation-type unknown-2) (formation-type unknown-3) (formation-type unknown-0)) #f @@ -14,7 +14,7 @@ ) ;; definition for method 16 of type hover-formation-control -(defmethod hover-formation-control-method-16 hover-formation-control ((this hover-formation-control)) +(defmethod hover-formation-control-method-16 ((this hover-formation-control)) (let ((gp-0 (hover-formation-control-method-13 this (new 'stack-no-clear 'vector))) (s4-0 (cond ((-> this anchor-proc) @@ -38,14 +38,14 @@ ) ;; definition for method 9 of type hover-formation-control -(defmethod set-anchor-proc hover-formation-control ((this hover-formation-control) (arg0 handle)) +(defmethod set-anchor-proc ((this hover-formation-control) (arg0 handle)) (set! (-> this anchor-proc) arg0) 0 ) ;; definition for method 13 of type hover-formation-control ;; INFO: Used lq/sq -(defmethod hover-formation-control-method-13 hover-formation-control ((this hover-formation-control) (arg0 vector)) +(defmethod hover-formation-control-method-13 ((this hover-formation-control) (arg0 vector)) (with-pp (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) @@ -99,7 +99,7 @@ ;; definition for method 14 of type hover-formation-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-formation-control-method-14 hover-formation-control ((this hover-formation-control)) +(defmethod hover-formation-control-method-14 ((this hover-formation-control)) (with-pp (when (not (logtest? (-> this flags) 4)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -177,7 +177,7 @@ ) ;; definition for method 15 of type hover-formation-control -(defmethod hover-formation-control-method-15 hover-formation-control ((this hover-formation-control) (arg0 vector) (arg1 vector)) +(defmethod hover-formation-control-method-15 ((this hover-formation-control) (arg0 vector) (arg1 vector)) (vector-matrix*! arg0 (hover-formation-control-method-13 this (new 'stack-no-clear 'vector)) @@ -199,17 +199,14 @@ ;; definition of type gen-perms-context (deftype gen-perms-context (structure) - ((num int32 :offset-assert 0) - (table uint32 :offset-assert 4) - (iterate-count int32 :offset-assert 8) + ((num int32) + (table uint32) + (iterate-count int32) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type gen-perms-context -(defmethod inspect gen-perms-context ((this gen-perms-context)) +(defmethod inspect ((this gen-perms-context)) (when (not this) (set! this this) (goto cfg-4) @@ -311,7 +308,7 @@ ;; definition for method 10 of type hover-formation-control ;; INFO: Used lq/sq ;; WARN: disable def twice: 148. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod hover-formation-control-method-10 hover-formation-control ((this hover-formation-control) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod hover-formation-control-method-10 ((this hover-formation-control) (arg0 vector) (arg1 vector) (arg2 float)) (vector-rotate-y! arg0 arg1 arg2) (cond ((logtest? (-> this flags) 2) @@ -393,7 +390,7 @@ ;; definition for method 11 of type hover-formation-control ;; INFO: Used lq/sq -(defmethod hover-formation-control-method-11 hover-formation-control ((this hover-formation-control)) +(defmethod hover-formation-control-method-11 ((this hover-formation-control)) (let ((s5-0 (-> this search-info))) (set! (-> s5-0 form) (the-as uint this)) (let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 16))) @@ -512,7 +509,7 @@ ) ;; definition for method 17 of type hover-formation-control -(defmethod hover-formation-control-method-17 hover-formation-control ((this hover-formation-control) (arg0 process)) +(defmethod hover-formation-control-method-17 ((this hover-formation-control) (arg0 process)) (let ((v1-2 (process->handle arg0)) (a2-0 -1) (a1-4 -1) @@ -545,7 +542,7 @@ ) ;; definition for method 18 of type hover-formation-control -(defmethod hover-formation-control-method-18 hover-formation-control ((this hover-formation-control) (arg0 process)) +(defmethod hover-formation-control-method-18 ((this hover-formation-control) (arg0 process)) (let ((v1-2 (process->handle arg0))) (dotimes (a1-4 16) (when (= v1-2 (-> this actor-table a1-4)) @@ -561,7 +558,7 @@ ) ;; definition for method 19 of type hover-formation-control -(defmethod try-update-formation-type hover-formation-control ((this hover-formation-control) (arg0 formation-type)) +(defmethod try-update-formation-type ((this hover-formation-control) (arg0 formation-type)) (when (!= (-> this formation-type) arg0) (set! (-> this formation-type) arg0) (hover-formation-control-method-11 this) @@ -681,7 +678,7 @@ ) ;; definition for method 7 of type hover-formation -(defmethod relocate hover-formation ((this hover-formation) (arg0 int)) +(defmethod relocate ((this hover-formation) (arg0 int)) (if (nonzero? (-> this formation)) (&+! (-> this formation) arg0) ) @@ -692,14 +689,14 @@ ) ;; definition for method 15 of type hover-formation -(defmethod hover-formation-method-15 hover-formation ((this hover-formation) (arg0 vector) (arg1 vector)) +(defmethod hover-formation-method-15 ((this hover-formation) (arg0 vector) (arg1 vector)) 0 ) ;; definition for method 11 of type hover-formation ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hover-formation ((this hover-formation) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hover-formation) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc index 3bac7318c85..c6f7190479a 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc @@ -3,16 +3,13 @@ ;; definition of type nav-network-adjacency (deftype nav-network-adjacency (structure) - ((index int32 :offset-assert 0) - (dist float :offset-assert 4) + ((index int32) + (dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type nav-network-adjacency -(defmethod inspect nav-network-adjacency ((this nav-network-adjacency)) +(defmethod inspect ((this nav-network-adjacency)) (when (not this) (set! this this) (goto cfg-4) @@ -26,15 +23,12 @@ ;; definition of type nav-network-adjacency-array (deftype nav-network-adjacency-array (inline-array-class) - ((data nav-network-adjacency :inline :dynamic :offset-assert 16) + ((data nav-network-adjacency :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type nav-network-adjacency-array -(defmethod inspect nav-network-adjacency-array ((this nav-network-adjacency-array)) +(defmethod inspect ((this nav-network-adjacency-array)) (when (not this) (set! this this) (goto cfg-4) @@ -52,16 +46,13 @@ ;; definition of type list-node (deftype list-node (structure) - ((next list-node :offset-assert 0) - (prev list-node :offset-assert 4) + ((next list-node) + (prev list-node) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type list-node -(defmethod inspect list-node ((this list-node)) +(defmethod inspect ((this list-node)) (when (not this) (set! this this) (goto cfg-4) @@ -75,19 +66,16 @@ ;; definition of type nav-network-path-node (deftype nav-network-path-node (list-node) - ((row-index int32 :offset-assert 8) - (status net-path-node-status :offset-assert 12) - (parent nav-network-path-node :offset-assert 16) - (cost-to-start float :offset-assert 20) - (cost-to-end float :offset-assert 24) + ((row-index int32) + (status net-path-node-status) + (parent nav-network-path-node) + (cost-to-start float) + (cost-to-end float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type nav-network-path-node -(defmethod inspect nav-network-path-node ((this nav-network-path-node)) +(defmethod inspect ((this nav-network-path-node)) (when (not this) (set! this this) (goto cfg-8) @@ -115,19 +103,16 @@ ;; definition of type nav-network-info (deftype nav-network-info (structure) - ((index int32 :offset-assert 0) - (pos vector :inline :offset-assert 16) - (path-node nav-network-path-node :inline :offset-assert 32) - (count int32 :offset-assert 60) - (adjacency (inline-array nav-network-adjacency) :offset-assert 64) + ((index int32) + (pos vector :inline) + (path-node nav-network-path-node :inline) + (count int32) + (adjacency (inline-array nav-network-adjacency)) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) ;; definition for method 3 of type nav-network-info -(defmethod inspect nav-network-info ((this nav-network-info)) +(defmethod inspect ((this nav-network-info)) (when (not this) (set! this this) (goto cfg-4) @@ -144,15 +129,12 @@ ;; definition of type nav-network-info-array (deftype nav-network-info-array (inline-array-class) - ((data nav-network-info :inline :dynamic :offset-assert 16) + ((data nav-network-info :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type nav-network-info-array -(defmethod inspect nav-network-info-array ((this nav-network-info-array)) +(defmethod inspect ((this nav-network-info-array)) (when (not this) (set! this this) (goto cfg-4) @@ -170,17 +152,14 @@ ;; definition of type hover-nav-sphere (deftype hover-nav-sphere (list-node) - ((sphere sphere :inline :offset-assert 16) - (handle handle :offset-assert 32) - (timer time-frame :offset-assert 40) + ((sphere sphere :inline) + (handle handle) + (timer time-frame) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type hover-nav-sphere -(defmethod inspect hover-nav-sphere ((this hover-nav-sphere)) +(defmethod inspect ((this hover-nav-sphere)) (when (not this) (set! this this) (goto cfg-4) @@ -197,21 +176,18 @@ ;; definition of type hover-nav-path-segment (deftype hover-nav-path-segment (list-node) - ((curve-matrix matrix :inline :offset-assert 16) - (pos-index float 2 :offset-assert 80) - (dist float :offset-assert 88) - (du float :offset-assert 92) + ((curve-matrix matrix :inline) + (pos-index float 2) + (dist float) + (du float) ) - :method-count-assert 10 - :size-assert #x60 - :flag-assert #xa00000060 (:methods - (hover-nav-path-segment-method-9 (_type_ float) none 9) + (hover-nav-path-segment-method-9 (_type_ float) none) ) ) ;; definition for method 3 of type hover-nav-path-segment -(defmethod inspect hover-nav-path-segment ((this hover-nav-path-segment)) +(defmethod inspect ((this hover-nav-path-segment)) (when (not this) (set! this this) (goto cfg-4) @@ -229,7 +205,7 @@ ;; definition for method 9 of type hover-nav-path-segment ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-path-segment-method-9 hover-nav-path-segment ((this hover-nav-path-segment) (arg0 float)) +(defmethod hover-nav-path-segment-method-9 ((this hover-nav-path-segment) (arg0 float)) (set! (-> this du) (/ arg0 (-> this dist))) 0 (none) @@ -237,21 +213,18 @@ ;; definition of type hover-nav-path-info (deftype hover-nav-path-info (structure) - ((segment-list hover-nav-path-segment :offset-assert 0) - (tail-segment hover-nav-path-segment :offset-assert 4) - (curr-segment hover-nav-path-segment :offset-assert 8) - (curr-u float :offset-assert 12) + ((segment-list hover-nav-path-segment) + (tail-segment hover-nav-path-segment) + (curr-segment hover-nav-path-segment) + (curr-u float) ) - :method-count-assert 10 - :size-assert #x10 - :flag-assert #xa00000010 (:methods - (hover-nav-path-info-method-9 (_type_) none 9) + (hover-nav-path-info-method-9 (_type_) none) ) ) ;; definition for method 3 of type hover-nav-path-info -(defmethod inspect hover-nav-path-info ((this hover-nav-path-info)) +(defmethod inspect ((this hover-nav-path-info)) (when (not this) (set! this this) (goto cfg-4) @@ -267,15 +240,12 @@ ;; definition of type path-index-array (deftype path-index-array (inline-array-class) - ((data hover-nav-path-info :inline :dynamic :offset-assert 16) + ((data hover-nav-path-info :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type path-index-array -(defmethod inspect path-index-array ((this path-index-array)) +(defmethod inspect ((this path-index-array)) (when (not this) (set! this this) (goto cfg-4) @@ -293,52 +263,49 @@ ;; definition of type nav-network (deftype nav-network (basic) - ((network (array nav-network-info) :offset-assert 4) - (dummy nav-network-info :inline :offset-assert 16) - (control-handle handle :offset-assert 88) - (list-table list-node 5 :offset-assert 96) - (open-list nav-network-path-node :offset 96) - (closed-list nav-network-path-node :offset 100) - (sphere-list hover-nav-sphere :offset 108) - (free-segment-list hover-nav-path-segment :offset 104) - (free-sphere-list hover-nav-sphere :offset 112) - (segment-pool (pointer hover-nav-path-segment) :offset-assert 116) - (sphere-pool (pointer hover-nav-sphere) :offset-assert 120) + ((network (array nav-network-info)) + (dummy nav-network-info :inline) + (control-handle handle) + (list-table list-node 5) + (open-list nav-network-path-node :overlay-at (-> list-table 0)) + (closed-list nav-network-path-node :overlay-at (-> list-table 1)) + (sphere-list hover-nav-sphere :overlay-at (-> list-table 3)) + (free-segment-list hover-nav-path-segment :overlay-at (-> list-table 2)) + (free-sphere-list hover-nav-sphere :overlay-at (-> list-table 4)) + (segment-pool (pointer hover-nav-path-segment)) + (sphere-pool (pointer hover-nav-sphere)) ) - :method-count-assert 33 - :size-assert #x7c - :flag-assert #x210000007c (:methods - (new (symbol type) _type_ 0) - (nav-network-method-9 (_type_) none 9) - (nav-network-method-10 (_type_ level (array nav-network-info)) none 10) - (nav-network-method-11 (_type_) none 11) - (nav-network-method-12 (_type_) none 12) - (nav-network-method-13 (_type_ int nav-network-path-node) none 13) - (nav-network-method-14 (_type_ int nav-network-path-node) object 14) - (nav-network-method-15 (_type_ nav-network-path-node) object 15) - (nav-network-method-16 (_type_ nav-network-path-node) none 16) - (nav-network-method-17 (_type_) nav-network-path-node 17) - (nav-network-method-18 (_type_ nav-network-path-node) none 18) - (nav-network-method-19 (_type_ nav-network-path-node) none 19) - (nav-network-method-20 (_type_ nav-network-path-node vector) none 20) - (nav-network-method-21 (_type_ object int int) none 21) - (nav-network-method-22 (_type_ hover-nav-path-info vector vector int int) hover-nav-path-segment 22) - (nav-network-method-23 (_type_ hover-nav-path-info) none 23) - (nav-network-method-24 (_type_ hover-nav-path-info int int int) symbol 24) - (nav-network-method-25 (_type_ process collide-prim-core) none 25) - (nav-network-method-26 (_type_ vector process vector vector float) vector 26) - (nav-network-method-27 (_type_) none 27) - (nav-network-method-28 (_type_) none 28) - (nav-network-method-29 (_type_) symbol 29) - (get-network (_type_) (array nav-network-info) 30) - (nav-network-method-31 (_type_ bounding-box) none 31) - (nav-network-method-32 (_type_ string) none 32) + (new (symbol type) _type_) + (nav-network-method-9 (_type_) none) + (nav-network-method-10 (_type_ level (array nav-network-info)) none) + (nav-network-method-11 (_type_) none) + (nav-network-method-12 (_type_) none) + (nav-network-method-13 (_type_ int nav-network-path-node) none) + (nav-network-method-14 (_type_ int nav-network-path-node) object) + (nav-network-method-15 (_type_ nav-network-path-node) object) + (nav-network-method-16 (_type_ nav-network-path-node) none) + (nav-network-method-17 (_type_) nav-network-path-node) + (nav-network-method-18 (_type_ nav-network-path-node) none) + (nav-network-method-19 (_type_ nav-network-path-node) none) + (nav-network-method-20 (_type_ nav-network-path-node vector) none) + (nav-network-method-21 (_type_ object int int) none) + (nav-network-method-22 (_type_ hover-nav-path-info vector vector int int) hover-nav-path-segment) + (nav-network-method-23 (_type_ hover-nav-path-info) none) + (nav-network-method-24 (_type_ hover-nav-path-info int int int) symbol) + (nav-network-method-25 (_type_ process collide-prim-core) none) + (nav-network-method-26 (_type_ vector process vector vector float) vector) + (nav-network-method-27 (_type_) none) + (nav-network-method-28 (_type_) none) + (nav-network-method-29 (_type_) symbol) + (get-network (_type_) (array nav-network-info)) + (nav-network-method-31 (_type_ bounding-box) none) + (nav-network-method-32 (_type_ string) none) ) ) ;; definition for method 3 of type nav-network -(defmethod inspect nav-network ((this nav-network)) +(defmethod inspect ((this nav-network)) (when (not this) (set! this this) (goto cfg-4) @@ -360,24 +327,21 @@ ) ;; definition for method 30 of type nav-network -(defmethod get-network nav-network ((this nav-network)) +(defmethod get-network ((this nav-network)) (-> this network) ) ;; definition of type hover-nav-params (deftype hover-nav-params (structure) - ((max-speed float :offset-assert 0) - (max-acceleration float :offset-assert 4) - (friction float :offset-assert 8) - (nav-collide-prim-index int32 :offset-assert 12) + ((max-speed float) + (max-acceleration float) + (friction float) + (nav-collide-prim-index int32) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type hover-nav-params -(defmethod inspect hover-nav-params ((this hover-nav-params)) +(defmethod inspect ((this hover-nav-params)) (when (not this) (set! this this) (goto cfg-4) @@ -393,66 +357,63 @@ ;; definition of type hover-nav-control (deftype hover-nav-control (basic) - ((root collide-shape-moving :offset-assert 4) - (nav nav-network :offset-assert 8) - (flags hover-nav-flags :offset-assert 12) - (params hover-nav-params :offset-assert 16) - (path-timer time-frame :offset-assert 24) - (transvv vector :inline :offset-assert 32) - (dest-pos vector :inline :offset-assert 48) - (dest-vel vector :inline :offset-assert 64) - (dest-move-dir vector :inline :offset-assert 80) - (dest-offset vector :inline :offset-assert 96) - (move-dir vector :inline :offset-assert 112) - (nav-collide-impulse vector :inline :offset-assert 128) - (nav-collide-impulse-len float :offset-assert 144) - (dest-speed float :offset-assert 148) - (local-dist float :offset-assert 152) - (speed float :offset-assert 156) - (max-los-speed float :offset-assert 160) - (target-speed float :offset-assert 164) - (target-acceleration float :offset-assert 168) - (speed-dest float :offset-assert 172) - (path-info hover-nav-path-info :inline :offset-assert 176) - (curr-dest-pt int32 :offset-assert 192) - (los-obstruction-distance float :offset-assert 196) - (los-last-clear-time time-frame :offset-assert 200) - (max-speed-multiplier float :offset-assert 208) - (max-acceleration-multiplier float :offset-assert 212) + ((root collide-shape-moving) + (nav nav-network) + (flags hover-nav-flags) + (params hover-nav-params) + (path-timer time-frame) + (transvv vector :inline) + (dest-pos vector :inline) + (dest-vel vector :inline) + (dest-move-dir vector :inline) + (dest-offset vector :inline) + (move-dir vector :inline) + (nav-collide-impulse vector :inline) + (nav-collide-impulse-len float) + (dest-speed float) + (local-dist float) + (speed float) + (max-los-speed float) + (target-speed float) + (target-acceleration float) + (speed-dest float) + (path-info hover-nav-path-info :inline) + (curr-dest-pt int32) + (los-obstruction-distance float) + (los-last-clear-time time-frame) + (max-speed-multiplier float) + (max-acceleration-multiplier float) ) - :method-count-assert 32 - :size-assert #xd8 - :flag-assert #x20000000d8 (:methods - (new (symbol type process collide-shape-moving hover-nav-params) _type_ 0) - (hover-nav-control-method-9 (_type_) none 9) - (hover-nav-control-method-10 (_type_ vector vector vector) none 10) - (hover-nav-control-method-11 (_type_ vector) none 11) - (hover-nav-control-method-12 (_type_) none 12) - (hover-nav-control-method-13 (_type_) none 13) - (hover-nav-control-method-14 (_type_ float float) none 14) - (hover-nav-control-method-15 (_type_ vector) none 15) - (hover-nav-control-method-16 (_type_ vector) vector 16) - (hover-nav-control-method-17 (_type_) collide-prim-core 17) - (hover-nav-control-method-18 (_type_ path-control int int) none 18) - (hover-nav-control-method-19 (_type_ (inline-array vector) int) none 19) - (hover-nav-control-method-20 (_type_) none 20) - (hover-nav-control-method-21 (_type_) none 21) - (hover-nav-control-method-22 (_type_) hover-nav-path-segment 22) - (hover-nav-control-method-23 (_type_) object 23) - (hover-nav-control-method-24 (_type_) none 24) - (hover-nav-control-method-25 (_type_) none 25) - (hover-nav-control-method-26 (_type_ vector vector float) symbol 26) - (hover-nav-control-method-27 (_type_ vector vector) int 27) - (hover-nav-control-method-28 (_type_ vector vector) none 28) - (hover-nav-control-method-29 (_type_ vector) none 29) - (hover-nav-control-method-30 (_type_) float 30) - (hover-nav-control-method-31 (_type_) float 31) + (new (symbol type process collide-shape-moving hover-nav-params) _type_) + (hover-nav-control-method-9 (_type_) none) + (hover-nav-control-method-10 (_type_ vector vector vector) none) + (hover-nav-control-method-11 (_type_ vector) none) + (hover-nav-control-method-12 (_type_) none) + (hover-nav-control-method-13 (_type_) none) + (hover-nav-control-method-14 (_type_ float float) none) + (hover-nav-control-method-15 (_type_ vector) none) + (hover-nav-control-method-16 (_type_ vector) vector) + (hover-nav-control-method-17 (_type_) collide-prim-core) + (hover-nav-control-method-18 (_type_ path-control int int) none) + (hover-nav-control-method-19 (_type_ (inline-array vector) int) none) + (hover-nav-control-method-20 (_type_) none) + (hover-nav-control-method-21 (_type_) none) + (hover-nav-control-method-22 (_type_) hover-nav-path-segment) + (hover-nav-control-method-23 (_type_) object) + (hover-nav-control-method-24 (_type_) none) + (hover-nav-control-method-25 (_type_) none) + (hover-nav-control-method-26 (_type_ vector vector float) symbol) + (hover-nav-control-method-27 (_type_ vector vector) int) + (hover-nav-control-method-28 (_type_ vector vector) none) + (hover-nav-control-method-29 (_type_ vector) none) + (hover-nav-control-method-30 (_type_) float) + (hover-nav-control-method-31 (_type_) float) ) ) ;; definition for method 3 of type hover-nav-control -(defmethod inspect hover-nav-control ((this hover-nav-control)) +(defmethod inspect ((this hover-nav-control)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc index 23a8ea09173..c5090cffd7c 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc @@ -6,19 +6,15 @@ ;; definition of type nav-network-control (deftype nav-network-control (process) - ((nav-network nav-network :offset-assert 128) + ((nav-network nav-network) ) - :heap-base #x10 - :method-count-assert 15 - :size-assert #x84 - :flag-assert #xf00100084 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) ;; definition for method 3 of type nav-network-control -(defmethod inspect nav-network-control ((this nav-network-control)) +(defmethod inspect ((this nav-network-control)) (when (not this) (set! this this) (goto cfg-4) @@ -75,7 +71,7 @@ ;; definition for method 9 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-9 nav-network ((this nav-network)) +(defmethod nav-network-method-9 ((this nav-network)) (set! (-> this segment-pool) (the-as (pointer hover-nav-path-segment) (malloc 'loading-level #x6000))) (set! (-> this free-segment-list) #f) (dotimes (v1-0 256) @@ -156,7 +152,7 @@ ;; definition for method 10 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-10 nav-network ((this nav-network) (arg0 level) (arg1 (array nav-network-info))) +(defmethod nav-network-method-10 ((this nav-network) (arg0 level) (arg1 (array nav-network-info))) (set! (-> this network) arg1) (while (-> this sphere-list) (let ((v1-0 (-> this sphere-list))) @@ -217,7 +213,7 @@ ;; definition for method 12 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-12 nav-network ((this nav-network)) +(defmethod nav-network-method-12 ((this nav-network)) (set! (-> this open-list) #f) (set! (-> this closed-list) #f) (let ((v1-0 (-> this network))) @@ -238,7 +234,7 @@ ;; definition for method 28 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-28 nav-network ((this nav-network)) +(defmethod nav-network-method-28 ((this nav-network)) (dotimes (s5-0 2) (format #t "list ~d: ~%" s5-0) (let ((a0-2 (-> this list-table s5-0))) @@ -256,7 +252,7 @@ ;; definition for method 29 of type nav-network ;; INFO: Used lq/sq -(defmethod nav-network-method-29 nav-network ((this nav-network)) +(defmethod nav-network-method-29 ((this nav-network)) (when *display-nav-network* (let ((gp-0 (-> this network))) (when gp-0 @@ -293,7 +289,7 @@ ) ;; definition for method 15 of type nav-network -(defmethod nav-network-method-15 nav-network ((this nav-network) (arg0 nav-network-path-node)) +(defmethod nav-network-method-15 ((this nav-network) (arg0 nav-network-path-node)) (local-vars (a2-4 list-node)) (when (nonzero? (-> arg0 status)) (break!) @@ -418,7 +414,7 @@ ;; definition for method 13 of type nav-network ;; WARN: Return type mismatch nav-network-path-node vs none. -(defmethod nav-network-method-13 nav-network ((this nav-network) (arg0 int) (arg1 nav-network-path-node)) +(defmethod nav-network-method-13 ((this nav-network) (arg0 int) (arg1 nav-network-path-node)) (when (nonzero? (-> arg1 status)) (break!) 0 @@ -457,7 +453,7 @@ ) ;; definition for method 14 of type nav-network -(defmethod nav-network-method-14 nav-network ((this nav-network) (arg0 int) (arg1 nav-network-path-node)) +(defmethod nav-network-method-14 ((this nav-network) (arg0 int) (arg1 nav-network-path-node)) (let ((v1-0 arg1)) (let ((a3-1 (the-as list-node (&+ (-> this list-table) (* arg0 4))))) (if (= (-> a3-1 next) v1-0) @@ -497,13 +493,13 @@ ;; definition for method 16 of type nav-network ;; WARN: Return type mismatch object vs none. -(defmethod nav-network-method-16 nav-network ((this nav-network) (arg0 nav-network-path-node)) +(defmethod nav-network-method-16 ((this nav-network) (arg0 nav-network-path-node)) (nav-network-method-14 this 0 arg0) (none) ) ;; definition for method 17 of type nav-network -(defmethod nav-network-method-17 nav-network ((this nav-network)) +(defmethod nav-network-method-17 ((this nav-network)) (let ((gp-0 (-> this open-list))) (if gp-0 (nav-network-method-16 this gp-0) @@ -515,7 +511,7 @@ ;; definition for method 18 of type nav-network ;; WARN: Return type mismatch net-path-node-status vs none. -(defmethod nav-network-method-18 nav-network ((this nav-network) (arg0 nav-network-path-node)) +(defmethod nav-network-method-18 ((this nav-network) (arg0 nav-network-path-node)) (nav-network-method-13 this 1 arg0) (logior! (-> arg0 status) (net-path-node-status closed)) (none) @@ -523,14 +519,14 @@ ;; definition for method 19 of type nav-network ;; WARN: Return type mismatch object vs none. -(defmethod nav-network-method-19 nav-network ((this nav-network) (arg0 nav-network-path-node)) +(defmethod nav-network-method-19 ((this nav-network) (arg0 nav-network-path-node)) (nav-network-method-14 this 1 arg0) (none) ) ;; definition for method 20 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-20 nav-network ((this nav-network) (arg0 nav-network-path-node) (arg1 vector)) +(defmethod nav-network-method-20 ((this nav-network) (arg0 nav-network-path-node) (arg1 vector)) (let* ((s3-0 (-> this network)) (s2-0 (-> s3-0 (-> arg0 row-index))) ) @@ -572,7 +568,7 @@ ;; definition for method 22 of type nav-network ;; INFO: Used lq/sq -(defmethod nav-network-method-22 nav-network ((this nav-network) (arg0 hover-nav-path-info) (arg1 vector) (arg2 vector) (arg3 int) (arg4 int)) +(defmethod nav-network-method-22 ((this nav-network) (arg0 hover-nav-path-info) (arg1 vector) (arg2 vector) (arg3 int) (arg4 int)) (-> this network) (let ((gp-0 (-> this free-segment-list))) (cond @@ -644,7 +640,7 @@ ;; definition for method 21 of type nav-network ;; WARN: Return type mismatch hover-nav-path-segment vs none. -(defmethod nav-network-method-21 nav-network ((this nav-network) (arg0 object) (arg1 int) (arg2 int)) +(defmethod nav-network-method-21 ((this nav-network) (arg0 object) (arg1 int) (arg2 int)) (let ((t0-0 (-> this network))) (nav-network-method-22 this (the-as hover-nav-path-info arg0) (-> t0-0 arg1 pos) (-> t0-0 arg2 pos) arg1 arg2) ) @@ -653,7 +649,7 @@ ;; definition for method 23 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-23 nav-network ((this nav-network) (arg0 hover-nav-path-info)) +(defmethod nav-network-method-23 ((this nav-network) (arg0 hover-nav-path-info)) (while (-> arg0 segment-list) (let ((v1-0 (-> arg0 segment-list))) (let ((a2-0 v1-0)) @@ -710,7 +706,7 @@ ;; definition for method 24 of type nav-network ;; WARN: new jak 2 until loop case, check carefully -(defmethod nav-network-method-24 nav-network ((this nav-network) (arg0 hover-nav-path-info) (arg1 int) (arg2 int) (arg3 int)) +(defmethod nav-network-method-24 ((this nav-network) (arg0 hover-nav-path-info) (arg1 int) (arg2 int) (arg3 int)) (local-vars (s3-1 nav-network-path-node)) (nav-network-method-12 this) (let ((s4-0 (-> this network))) @@ -752,7 +748,7 @@ ;; definition for method 25 of type nav-network ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-25 nav-network ((this nav-network) (arg0 process) (arg1 collide-prim-core)) +(defmethod nav-network-method-25 ((this nav-network) (arg0 process) (arg1 collide-prim-core)) (local-vars (a3-2 hover-nav-sphere)) (let ((a1-4 (process->handle arg0))) (let ((v1-2 (-> this sphere-list))) @@ -835,7 +831,7 @@ ;; definition for method 26 of type nav-network ;; INFO: Used lq/sq -(defmethod nav-network-method-26 nav-network ((this nav-network) (arg0 vector) (arg1 process) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-network-method-26 ((this nav-network) (arg0 vector) (arg1 process) (arg2 vector) (arg3 vector) (arg4 float)) (local-vars (sv-48 vector) (sv-64 sphere)) (vector-reset! arg0) (let ((s1-0 (process->handle arg1)) @@ -868,7 +864,7 @@ ;; definition for method 27 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-27 nav-network ((this nav-network)) +(defmethod nav-network-method-27 ((this nav-network)) (with-pp (let ((v1-0 (the-as list-node (-> this sphere-list)))) (while v1-0 @@ -959,7 +955,7 @@ ;; definition for method 31 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-31 nav-network ((this nav-network) (arg0 bounding-box)) +(defmethod nav-network-method-31 ((this nav-network) (arg0 bounding-box)) (set-to-point! arg0 (-> this network 0 pos)) (let* ((s4-0 (-> this network length)) (s3-0 0) @@ -977,7 +973,7 @@ ;; definition for method 32 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-32 nav-network ((this nav-network) (arg0 string)) +(defmethod nav-network-method-32 ((this nav-network) (arg0 string)) (let ((gp-0 (new 'stack-no-clear 'bounding-box)) (s5-0 (entity-by-name arg0)) ) @@ -1007,7 +1003,7 @@ ;; definition for method 26 of type hover-nav-control ;; INFO: Used lq/sq -(defmethod hover-nav-control-method-26 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod hover-nav-control-method-26 ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) (set! (-> gp-0 start-pos quad) (-> arg0 quad)) @@ -1028,7 +1024,7 @@ ) ;; definition for method 27 of type hover-nav-control -(defmethod hover-nav-control-method-27 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector)) +(defmethod hover-nav-control-method-27 ((this hover-nav-control) (arg0 vector) (arg1 vector)) (let ((s2-0 (-> this nav network)) (gp-0 (the-as int #f)) ) @@ -1055,18 +1051,18 @@ ) ;; definition for method 22 of type hover-nav-control -(defmethod hover-nav-control-method-22 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-22 ((this hover-nav-control)) (-> this path-info curr-segment) ) ;; definition for method 23 of type hover-nav-control -(defmethod hover-nav-control-method-23 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-23 ((this hover-nav-control)) (and (-> this path-info curr-segment) (>= (-> this path-info curr-u) 1.0)) ) ;; definition for method 21 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-21 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-21 ((this hover-nav-control)) (nav-network-method-23 (-> this nav) (-> this path-info)) (set! (-> this curr-dest-pt) -1) 0 @@ -1096,7 +1092,7 @@ ;; WARN: Stack slot offset 32 signed mismatch ;; WARN: Stack slot offset 32 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-28 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector)) +(defmethod hover-nav-control-method-28 ((this hover-nav-control) (arg0 vector) (arg1 vector)) (local-vars (v0-15 symbol) (sv-32 int) (sv-48 (function hover-nav-control vector vector int))) (let ((s4-0 (-> this nav network)) (s5-0 (-> this path-info)) @@ -1178,7 +1174,7 @@ ;; definition for method 29 of type hover-nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-29 hover-nav-control ((this hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-29 ((this hover-nav-control) (arg0 vector)) (let ((a0-1 (the-as list-node #f)) (s4-0 (the-as list-node (-> this path-info segment-list))) ) @@ -1231,18 +1227,18 @@ ) ;; definition for method 30 of type hover-nav-control -(defmethod hover-nav-control-method-30 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-30 ((this hover-nav-control)) (* (-> this max-speed-multiplier) (-> this params max-speed)) ) ;; definition for method 31 of type hover-nav-control -(defmethod hover-nav-control-method-31 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-31 ((this hover-nav-control)) (* (-> this max-acceleration-multiplier) (-> this params max-acceleration)) ) ;; definition for method 14 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-14 hover-nav-control ((this hover-nav-control) (arg0 float) (arg1 float)) +(defmethod hover-nav-control-method-14 ((this hover-nav-control) (arg0 float) (arg1 float)) (set! (-> this max-speed-multiplier) arg0) (set! (-> this max-acceleration-multiplier) arg1) 0 @@ -1251,7 +1247,7 @@ ;; definition for method 18 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-18 hover-nav-control ((this hover-nav-control) (arg0 path-control) (arg1 int) (arg2 int)) +(defmethod hover-nav-control-method-18 ((this hover-nav-control) (arg0 path-control) (arg1 int) (arg2 int)) (hover-nav-control-method-21 this) (set! arg2 (cond ((= arg2 -1) @@ -1287,7 +1283,7 @@ ;; definition for method 19 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-19 hover-nav-control ((this hover-nav-control) (arg0 (inline-array vector)) (arg1 int)) +(defmethod hover-nav-control-method-19 ((this hover-nav-control) (arg0 (inline-array vector)) (arg1 int)) (hover-nav-control-method-21 this) (let ((s4-1 (+ arg1 -2))) (while (>= s4-1 0) @@ -1307,7 +1303,7 @@ ;; definition for method 20 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-20 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-20 ((this hover-nav-control)) (hover-nav-control-method-21 this) (logclear! (-> this flags) (hover-nav-flags honflags-0)) 0 @@ -1315,7 +1311,7 @@ ) ;; definition for method 17 of type hover-nav-control -(defmethod hover-nav-control-method-17 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-17 ((this hover-nav-control)) (-> (the-as collide-shape-prim-group (-> this root root-prim)) child (-> this params nav-collide-prim-index) @@ -1325,7 +1321,7 @@ ;; definition for method 15 of type hover-nav-control ;; WARN: Return type mismatch vector vs none. -(defmethod hover-nav-control-method-15 hover-nav-control ((this hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-15 ((this hover-nav-control) (arg0 vector)) (local-vars (sv-32 vector) (sv-36 collide-shape-moving)) (set! sv-32 (new 'stack-no-clear 'vector)) (set! sv-36 (-> this root)) @@ -1335,7 +1331,7 @@ ) ;; definition for method 16 of type hover-nav-control -(defmethod hover-nav-control-method-16 hover-nav-control ((this hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-16 ((this hover-nav-control) (arg0 vector)) (local-vars (sv-32 vector)) (set! sv-32 (new 'stack-no-clear 'vector)) (vector-inv-orient-by-quat! sv-32 (-> this transvv) (-> this root quat)) @@ -1345,7 +1341,7 @@ ;; definition for method 10 of type hover-nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-10 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod hover-nav-control-method-10 ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) (set! (-> this dest-pos quad) (-> arg0 quad)) (cond (arg2 @@ -1365,7 +1361,7 @@ ;; definition for method 24 of type hover-nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-24 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-24 ((this hover-nav-control)) (when (not (logtest? (-> this flags) (hover-nav-flags honflags-0))) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (-> this params) @@ -1411,7 +1407,7 @@ ;; definition for method 11 of type hover-nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-11 hover-nav-control ((this hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-11 ((this hover-nav-control) (arg0 vector)) (local-vars (sv-288 vector) (sv-304 vector) (sv-320 vector) (sv-336 vector) (sv-352 int)) (with-pp (when *debug-hover* @@ -1554,7 +1550,7 @@ ;; definition for method 25 of type hover-nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-25 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-25 ((this hover-nav-control)) (let ((s5-0 (new 'stack-no-clear 'hover-nav-path-segment)) (f28-0 (hover-nav-control-method-31 this)) (f30-0 (hover-nav-control-method-30 this)) @@ -1634,7 +1630,7 @@ ;; definition for method 12 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-12 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-12 ((this hover-nav-control)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -1689,7 +1685,7 @@ ;; ERROR: Stack slot load at 144 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-13 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-13 ((this hover-nav-control)) (local-vars (sv-112 float) (sv-128 float) (sv-144 float) (sv-160 float)) (let* ((s5-0 (-> this root)) (s3-0 (hover-nav-control-method-17 this)) @@ -1788,14 +1784,14 @@ ;; definition for method 9 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-9 hover-nav-control ((this hover-nav-control)) +(defmethod hover-nav-control-method-9 ((this hover-nav-control)) (hover-nav-control-method-21 this) 0 (none) ) ;; definition for method 7 of type hover-nav-control -(defmethod relocate hover-nav-control ((this hover-nav-control) (arg0 int)) +(defmethod relocate ((this hover-nav-control) (arg0 int)) (if (nonzero? (-> this root)) (&+! (-> this root) arg0) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-edit_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-edit_REF.gc index 32f2c9ff993..80f6dd81de9 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-edit_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-edit_REF.gc @@ -196,19 +196,16 @@ ;; definition of type hover-nav-bsp-point (deftype hover-nav-bsp-point (list-node) - ((index int32 :offset-assert 8) - (pos vector :inline :offset-assert 16) + ((index int32) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 (:methods - (new (symbol type) _type_ 0) + (new (symbol type) _type_) ) ) ;; definition for method 3 of type hover-nav-bsp-point -(defmethod inspect hover-nav-bsp-point ((this hover-nav-bsp-point)) +(defmethod inspect ((this hover-nav-bsp-point)) (when (not this) (set! this this) (goto cfg-4) @@ -239,23 +236,20 @@ ;; definition of type hover-nav-bsp-node (deftype hover-nav-bsp-node (structure) - ((split-plane vector :inline :offset-assert 0) - (point-list hover-nav-bsp-point :offset-assert 16) - (left hover-nav-bsp-node :offset-assert 20) - (right hover-nav-bsp-node :offset-assert 24) + ((split-plane vector :inline) + (point-list hover-nav-bsp-point) + (left hover-nav-bsp-node) + (right hover-nav-bsp-node) ) - :method-count-assert 11 - :size-assert #x1c - :flag-assert #xb0000001c (:methods - (new (symbol type) _type_ 0) - (hover-nav-bsp-node-method-9 (_type_) none 9) - (hover-nav-bsp-node-method-10 (_type_ int) none 10) + (new (symbol type) _type_) + (hover-nav-bsp-node-method-9 (_type_) none) + (hover-nav-bsp-node-method-10 (_type_ int) none) ) ) ;; definition for method 3 of type hover-nav-bsp-node -(defmethod inspect hover-nav-bsp-node ((this hover-nav-bsp-node)) +(defmethod inspect ((this hover-nav-bsp-node)) (when (not this) (set! this this) (goto cfg-4) @@ -287,15 +281,12 @@ ;; definition of type hover-nav-bsp (deftype hover-nav-bsp (structure) - ((root hover-nav-bsp-node :offset-assert 0) + ((root hover-nav-bsp-node) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type hover-nav-bsp -(defmethod inspect hover-nav-bsp ((this hover-nav-bsp)) +(defmethod inspect ((this hover-nav-bsp)) (when (not this) (set! this this) (goto cfg-4) @@ -308,7 +299,7 @@ ;; definition for method 9 of type hover-nav-bsp-node ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-bsp-node-method-9 hover-nav-bsp-node ((this hover-nav-bsp-node)) +(defmethod hover-nav-bsp-node-method-9 ((this hover-nav-bsp-node)) (let ((v1-0 (-> this split-plane))) (format #t "((~,,1f ~,,1f ~,,1f ~m)~% " (-> v1-0 x) (-> v1-0 y) (-> v1-0 z) (-> v1-0 w)) ) @@ -341,7 +332,7 @@ ;; definition for method 10 of type hover-nav-bsp-node ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-bsp-node-method-10 hover-nav-bsp-node ((this hover-nav-bsp-node) (arg0 int)) +(defmethod hover-nav-bsp-node-method-10 ((this hover-nav-bsp-node) (arg0 int)) (when (-> this point-list) (format 0 "build-bsp: ") (let ((s4-0 (new 'stack-no-clear 'vector)) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc index fc71d3c3a9d..c0c6c5b5095 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc @@ -310,14 +310,10 @@ ;; definition of type wasp-shot (deftype wasp-shot (metalhead-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type wasp-shot -(defmethod inspect wasp-shot ((this wasp-shot)) +(defmethod inspect ((this wasp-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -331,7 +327,7 @@ ;; definition for method 28 of type wasp-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound wasp-shot ((this wasp-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this wasp-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -349,7 +345,7 @@ ;; definition for method 31 of type wasp-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! wasp-shot ((this wasp-shot)) +(defmethod init-proj-settings! ((this wasp-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'wasp-shot) @@ -476,7 +472,7 @@ (set! (-> *wasp-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type wasp -(defmethod general-event-handler wasp ((this wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -507,7 +503,7 @@ ;; definition for method 52 of type wasp ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 wasp ((this wasp) (arg0 vector)) +(defmethod enemy-method-52 ((this wasp) (arg0 vector)) (let ((s4-0 (-> this root))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-2)) @@ -546,7 +542,7 @@ ;; definition for method 116 of type wasp ;; WARN: Return type mismatch object vs none. -(defmethod go-idle wasp ((this wasp)) +(defmethod go-idle ((this wasp)) (cond ((logtest? (-> this fact enemy-options) (enemy-option user0)) (go (method-of-object this shoot-bridge-wait)) @@ -562,12 +558,12 @@ ) ;; definition for method 70 of type wasp -(defmethod go-hostile wasp ((this wasp)) +(defmethod go-hostile ((this wasp)) (go (method-of-object this hostile)) ) ;; definition for method 72 of type wasp -(defmethod react-to-focus wasp ((this wasp)) +(defmethod react-to-focus ((this wasp)) "@TODO - flesh out docs" (go-hostile this) ) @@ -575,7 +571,7 @@ ;; definition for method 129 of type wasp ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-129 wasp ((this wasp)) +(defmethod enemy-method-129 ((this wasp)) (if (logtest? (-> this fact enemy-options) (enemy-option user0)) (set! (-> this focus-pos quad) (-> this plat-pos quad)) ((method-of-type hover-enemy enemy-method-129) this) @@ -584,7 +580,7 @@ ) ;; definition for method 55 of type wasp -(defmethod track-target! wasp ((this wasp)) +(defmethod track-target! ((this wasp)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1128,7 +1124,7 @@ ;; definition for method 107 of type wasp ;; WARN: Return type mismatch process vs process-focusable. -(defmethod get-enemy-target wasp ((this wasp)) +(defmethod get-enemy-target ((this wasp)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" (let ((s5-0 (handle->process (-> this focus handle)))) (the-as @@ -1156,7 +1152,7 @@ ) ;; definition for method 77 of type wasp -(defmethod enemy-method-77 wasp ((this wasp) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this wasp) (arg0 (pointer float))) (cond ((rng-hit? this 0.5) (set! (-> this knocked-anim) 10) @@ -1181,7 +1177,7 @@ ) ;; definition for method 78 of type wasp -(defmethod enemy-method-78 wasp ((this wasp) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this wasp) (arg0 (pointer float))) (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-3 (-> this skel root-channel 0)) ) @@ -1195,18 +1191,18 @@ ) ;; definition for method 80 of type wasp -(defmethod enemy-method-80 wasp ((this wasp) (arg0 enemy-knocked-info)) +(defmethod enemy-method-80 ((this wasp) (arg0 enemy-knocked-info)) (-> this root) (>= (-> arg0 on-surface-count) 1) ) ;; definition for method 81 of type wasp -(defmethod enemy-method-81 wasp ((this wasp)) +(defmethod enemy-method-81 ((this wasp)) #f ) ;; definition for method 73 of type wasp -(defmethod kill-prefer-falling wasp ((this wasp)) +(defmethod kill-prefer-falling ((this wasp)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cond ((and (-> this next-state) (= (-> this next-state name) 'knocked)) @@ -1223,7 +1219,7 @@ ;; definition for method 165 of type wasp ;; WARN: Return type mismatch int vs none. -(defmethod spawn-wasp-shot wasp ((this wasp) (arg0 projectile-init-by-other-params) (arg1 int) (arg2 float) (arg3 float)) +(defmethod spawn-wasp-shot ((this wasp) (arg0 projectile-init-by-other-params) (arg1 int) (arg2 float) (arg3 float)) (vector<-cspace! (-> arg0 pos) (-> this node-list data arg1)) (let ((s3-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) @@ -1252,7 +1248,7 @@ ;; definition for method 142 of type wasp ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-142 wasp ((this wasp)) +(defmethod hover-enemy-method-142 ((this wasp)) (let ((s5-0 (-> this main-joint-acc)) (s4-0 (-> this main-joint-vel)) (gp-0 @@ -1364,7 +1360,7 @@ ;; definition for method 114 of type wasp ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! wasp ((this wasp)) +(defmethod init-enemy-collision! ((this wasp)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1475,7 +1471,7 @@ ) ;; definition for method 10 of type wasp -(defmethod deactivate wasp ((this wasp)) +(defmethod deactivate ((this wasp)) (if (nonzero? (-> this smoke-part)) (kill-and-free-particles (-> this smoke-part)) ) @@ -1489,7 +1485,7 @@ ;; definition for method 7 of type wasp ;; WARN: Return type mismatch hover-enemy vs wasp. -(defmethod relocate wasp ((this wasp) (arg0 int)) +(defmethod relocate ((this wasp) (arg0 int)) (if (nonzero? (-> this gun-jmod)) (&+! (-> this gun-jmod) arg0) ) @@ -1504,7 +1500,7 @@ ;; definition for method 149 of type wasp ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-149 wasp ((this wasp)) +(defmethod hover-enemy-method-149 ((this wasp)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-wasp" (the-as (pointer uint32) #f))) @@ -1515,12 +1511,12 @@ ) ;; definition for method 150 of type wasp -(defmethod hover-enemy-method-150 wasp ((this wasp)) +(defmethod hover-enemy-method-150 ((this wasp)) *wasp-enemy-info* ) ;; definition for method 151 of type wasp -(defmethod hover-enemy-method-151 wasp ((this wasp)) +(defmethod hover-enemy-method-151 ((this wasp)) (new 'static 'hover-enemy-info :fly-forward-anim 7 :fly-backward-anim 8 @@ -1537,14 +1533,14 @@ ) ;; definition for method 152 of type wasp -(defmethod hover-enemy-method-152 wasp ((this wasp)) +(defmethod hover-enemy-method-152 ((this wasp)) (new 'static 'hover-nav-params :max-speed 73728.0 :max-acceleration 122880.0 :friction 0.05) ) ;; definition for method 115 of type wasp ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! wasp ((this wasp)) +(defmethod init-enemy! ((this wasp)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) (hover-enemy-method-149 this) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc index 871886d00f8..ad4289577f6 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc @@ -11,15 +11,12 @@ ;; definition of type metalmonk-anim-info (deftype metalmonk-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type metalmonk-anim-info -(defmethod inspect metalmonk-anim-info ((this metalmonk-anim-info)) +(defmethod inspect ((this metalmonk-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -32,26 +29,23 @@ ;; definition of type metalmonk-global-info (deftype metalmonk-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (idle-anim int32 3 :offset-assert 8) - (patrol-anim int32 2 :offset-assert 20) - (notice-anim int32 2 :offset-assert 28) - (charge-anim int32 2 :offset-assert 36) - (attack-anim int32 2 :offset-assert 44) - (knocked-anim int32 2 :offset-assert 52) - (celebrate-anim int32 2 :offset-assert 60) - (yellow-hit-anim int32 4 :offset-assert 68) - (blue-hit-anim int32 3 :offset-assert 84) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (idle-anim int32 3) + (patrol-anim int32 2) + (notice-anim int32 2) + (charge-anim int32 2) + (attack-anim int32 2) + (knocked-anim int32 2) + (celebrate-anim int32 2) + (yellow-hit-anim int32 4) + (blue-hit-anim int32 3) ) :pack-me - :method-count-assert 9 - :size-assert #x60 - :flag-assert #x900000060 ) ;; definition for method 3 of type metalmonk-global-info -(defmethod inspect metalmonk-global-info ((this metalmonk-global-info)) +(defmethod inspect ((this metalmonk-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -74,26 +68,24 @@ ;; definition of type metalmonk (deftype metalmonk (nav-enemy) - ((new-facing vector :inline :offset 624) - (old-facing vector :inline :offset 640) - (high-time time-frame :offset 656) - (intro-path path-control :offset-assert 664) + ((new-facing vector :inline :offset 624) + (old-facing vector :inline :offset 640) + (high-time time-frame :offset 656) + (intro-path path-control) ) - :heap-base #x220 - :method-count-assert 183 - :size-assert #x29c - :flag-assert #xb70220029c + (:state-methods + attack + ) (:methods - (attack () _type_ :state 178) - (metalmonk-method-179 (_type_ vector) none 179) - (metalmonk-method-180 (_type_ symbol) none 180) - (metalmonk-method-181 (_type_ float float) none 181) - (metalmonk-method-182 (_type_ float float) none 182) + (metalmonk-method-179 (_type_ vector) none) + (metalmonk-method-180 (_type_ symbol) none) + (metalmonk-method-181 (_type_ float float) none) + (metalmonk-method-182 (_type_ float float) none) ) ) ;; definition for method 3 of type metalmonk -(defmethod inspect metalmonk ((this metalmonk)) +(defmethod inspect ((this metalmonk)) (when (not this) (set! this this) (goto cfg-4) @@ -306,7 +298,7 @@ ;; definition for method 179 of type metalmonk ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod metalmonk-method-179 metalmonk ((this metalmonk) (arg0 vector)) +(defmethod metalmonk-method-179 ((this metalmonk) (arg0 vector)) (set! (-> arg0 quad) (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)) vector 2 quad) ) @@ -315,7 +307,7 @@ ;; definition for method 181 of type metalmonk ;; WARN: Return type mismatch int vs none. -(defmethod metalmonk-method-181 metalmonk ((this metalmonk) (arg0 float) (arg1 float)) +(defmethod metalmonk-method-181 ((this metalmonk) (arg0 float) (arg1 float)) (let ((f28-0 (vector-dot (-> this new-facing) (-> this old-facing))) (f30-1 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) ) @@ -371,7 +363,7 @@ ;; definition for method 182 of type metalmonk ;; WARN: Return type mismatch int vs none. -(defmethod metalmonk-method-182 metalmonk ((this metalmonk) (arg0 float) (arg1 float)) +(defmethod metalmonk-method-182 ((this metalmonk) (arg0 float) (arg1 float)) (let ((f28-0 (vector-dot (-> this new-facing) (-> this old-facing))) (f30-1 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) ) @@ -427,7 +419,7 @@ ;; definition for method 55 of type metalmonk ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! metalmonk ((this metalmonk)) +(defmethod track-target! ((this metalmonk)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -442,7 +434,7 @@ ) ;; definition for method 74 of type metalmonk -(defmethod general-event-handler metalmonk ((this metalmonk) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this metalmonk) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -503,7 +495,7 @@ ;; definition for method 104 of type metalmonk ;; INFO: Used lq/sq -(defmethod enemy-method-104 metalmonk ((this metalmonk) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ((this metalmonk) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (let* ((s3-0 arg0) (a0-2 (if (type? s3-0 process-focusable) s3-0 @@ -546,7 +538,7 @@ ) ;; definition for method 84 of type metalmonk -(defmethod enemy-method-84 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 ((this metalmonk) (arg0 enemy-jump-info)) (let* ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos))) (f1-1 (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0))) (f0-3 (fmax (-> arg0 start-pos y) (-> arg0 dest-pos y))) @@ -558,12 +550,12 @@ ) ;; definition for method 89 of type metalmonk -(defmethod enemy-method-89 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this metalmonk) (arg0 enemy-jump-info)) #f ) ;; definition for method 87 of type metalmonk -(defmethod enemy-method-87 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this metalmonk) (arg0 enemy-jump-info)) (let ((s5-0 (-> this draw art-group data (-> this enemy-info run-anim))) (v1-6 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) @@ -585,12 +577,12 @@ ) ;; definition for method 88 of type metalmonk -(defmethod enemy-method-88 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this metalmonk) (arg0 enemy-jump-info)) #f ) ;; definition for method 90 of type metalmonk -(defmethod enemy-method-90 metalmonk ((this metalmonk) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 ((this metalmonk) (arg0 int) (arg1 enemy-jump-info)) (case arg0 ((3) (let ((a0-1 (-> this skel root-channel 0))) @@ -975,7 +967,7 @@ ) ;; definition for method 77 of type metalmonk -(defmethod enemy-method-77 metalmonk ((this metalmonk) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this metalmonk) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 0) @@ -1043,7 +1035,7 @@ ) ;; definition for method 78 of type metalmonk -(defmethod enemy-method-78 metalmonk ((this metalmonk) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this metalmonk) (arg0 (pointer float))) (cond ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -1100,7 +1092,7 @@ ;; definition for method 180 of type metalmonk ;; WARN: Return type mismatch int vs none. -(defmethod metalmonk-method-180 metalmonk ((this metalmonk) (arg0 symbol)) +(defmethod metalmonk-method-180 ((this metalmonk) (arg0 symbol)) (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 1) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) @@ -1117,7 +1109,7 @@ ;; definition for method 114 of type metalmonk ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! metalmonk ((this metalmonk)) +(defmethod init-enemy-collision! ((this metalmonk)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1227,13 +1219,13 @@ ) ;; definition for method 60 of type metalmonk -(defmethod coin-flip? metalmonk ((this metalmonk)) +(defmethod coin-flip? ((this metalmonk)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 7 of type metalmonk -(defmethod relocate metalmonk ((this metalmonk) (arg0 int)) +(defmethod relocate ((this metalmonk) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) ) @@ -1242,7 +1234,7 @@ ;; definition for method 115 of type metalmonk ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! metalmonk ((this metalmonk)) +(defmethod init-enemy! ((this metalmonk)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (stack-size-set! (-> this main-thread) 256) (initialize-skeleton diff --git a/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc index 4a02ae9d105..cfbf130c230 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc @@ -4,14 +4,10 @@ ;; definition of type spyder-shot (deftype spyder-shot (metalhead-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type spyder-shot -(defmethod inspect spyder-shot ((this spyder-shot)) +(defmethod inspect ((this spyder-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -25,7 +21,7 @@ ;; definition for method 28 of type spyder-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound spyder-shot ((this spyder-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this spyder-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -42,7 +38,7 @@ ;; definition for method 31 of type spyder-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! spyder-shot ((this spyder-shot)) +(defmethod init-proj-settings! ((this spyder-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (call-parent-method this) (set! (-> this max-speed) 307200.0) @@ -60,40 +56,38 @@ ;; definition of type spyder (deftype spyder (nav-enemy) - ((los los-control :inline :offset-assert 608) - (joint joint-mod :offset-assert 756) - (start-pos vector :inline :offset-assert 768) - (face-pos vector :inline :offset 800) - (my-up-vector vector :inline :offset-assert 816) - (status-flags spyder-flags :offset-assert 832) - (change-dir-timer time-frame :offset-assert 840) - (fire-info vector 2 :inline :offset-assert 848) - (joint-ik joint-mod-ik 4 :offset 880) - (delta-y-ik float 4 :offset-assert 896) - (predator-effect? symbol :offset-assert 912) - (shock-effect-time time-frame :offset-assert 920) - (shock-effect-end time-frame :offset-assert 928) - (fade float :offset-assert 936) - (dest-fade float :offset-assert 940) + ((los los-control :inline) + (joint joint-mod) + (start-pos vector :inline) + (face-pos vector :inline :offset 800) + (my-up-vector vector :inline) + (status-flags spyder-flags) + (change-dir-timer time-frame) + (fire-info vector 2 :inline) + (joint-ik joint-mod-ik 4 :offset 880) + (delta-y-ik float 4) + (predator-effect? symbol) + (shock-effect-time time-frame) + (shock-effect-end time-frame) + (fade float) + (dest-fade float) ) - :heap-base #x330 - :method-count-assert 186 - :size-assert #x3b0 - :flag-assert #xba033003b0 + (:state-methods + attack + backup + ) (:methods - (attack () _type_ :state 178) - (backup () _type_ :state 179) - (spyder-method-180 (_type_) none 180) - (spyder-method-181 (_type_) none 181) - (spyder-method-182 (_type_) none 182) - (spyder-method-183 (_type_ matrix float) none 183) - (spyder-method-184 (_type_ vector) none 184) - (spyder-method-185 (_type_) none 185) + (spyder-method-180 (_type_) none) + (spyder-method-181 (_type_) none) + (spyder-method-182 (_type_) none) + (spyder-method-183 (_type_ matrix float) none) + (spyder-method-184 (_type_ vector) none) + (spyder-method-185 (_type_) none) ) ) ;; definition for method 3 of type spyder -(defmethod inspect spyder ((this spyder)) +(defmethod inspect ((this spyder)) (when (not this) (set! this this) (goto cfg-4) @@ -303,7 +297,7 @@ (set! (-> *spyder-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type spyder -(defmethod general-event-handler spyder ((this spyder) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this spyder) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -382,7 +376,7 @@ ;; definition for method 180 of type spyder ;; WARN: Return type mismatch int vs none. -(defmethod spyder-method-180 spyder ((this spyder)) +(defmethod spyder-method-180 ((this spyder)) (seek! (-> this fade) (-> this dest-fade) (* 500.0 (seconds-per-frame))) (set! (-> this draw force-fade) (the-as uint (the int (-> this fade)))) (cond @@ -426,7 +420,7 @@ ;; definition for method 181 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spyder-method-181 spyder ((this spyder)) +(defmethod spyder-method-181 ((this spyder)) (let ((a0-2 (handle->process (-> this focus handle)))) (when a0-2 (let* ((s5-0 (-> this root trans)) @@ -471,7 +465,7 @@ ;; definition for method 77 of type spyder ;; WARN: Using new Jak 2 rtype-of -(defmethod enemy-method-77 spyder ((this spyder) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this spyder) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (let ((a0-2 (-> this skel root-channel 0))) @@ -541,7 +535,7 @@ ) ;; definition for method 78 of type spyder -(defmethod enemy-method-78 spyder ((this spyder) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this spyder) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (cond @@ -575,7 +569,7 @@ ) ;; definition for method 87 of type spyder -(defmethod enemy-method-87 spyder ((this spyder) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this spyder) (arg0 enemy-jump-info)) (let ((s5-0 (-> this draw art-group data (-> this enemy-info jump-in-air-anim)))) (let ((v1-6 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) @@ -647,7 +641,7 @@ ;; definition for method 182 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spyder-method-182 spyder ((this spyder)) +(defmethod spyder-method-182 ((this spyder)) (cond ((and (logtest? (-> this status-flags) (spyder-flags spflags-2)) (!= (-> this joint scale z) 1.0)) (seek! (-> this joint scale z) 1.0 (* 0.8 (seconds-per-frame))) @@ -697,7 +691,7 @@ ;; definition for method 184 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spyder-method-184 spyder ((this spyder) (arg0 vector)) +(defmethod spyder-method-184 ((this spyder) (arg0 vector)) (when (not (logtest? (-> this status-flags) (spyder-flags spflags-0))) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> *up-vector* quad)) @@ -718,7 +712,7 @@ ) ;; definition for method 55 of type spyder -(defmethod track-target! spyder ((this spyder)) +(defmethod track-target! ((this spyder)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -743,16 +737,13 @@ ;; definition of type ik-setup (deftype ik-setup (structure) - ((elbow-index int32 :offset-assert 0) - (hand-dist float :offset-assert 4) + ((elbow-index int32) + (hand-dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type ik-setup -(defmethod inspect ik-setup ((this ik-setup)) +(defmethod inspect ((this ik-setup)) (when (not this) (set! this this) (goto cfg-4) @@ -807,7 +798,7 @@ ;; definition for method 185 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spyder-method-185 spyder ((this spyder)) +(defmethod spyder-method-185 ((this spyder)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1037,7 +1028,7 @@ ;; definition for method 183 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod spyder-method-183 spyder ((this spyder) (arg0 matrix) (arg1 float)) +(defmethod spyder-method-183 ((this spyder) (arg0 matrix) (arg1 float)) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((v1-0 (-> arg0 vector)) (a1-1 (-> arg0 vector 1)) @@ -1205,7 +1196,7 @@ ) ;; definition for method 70 of type spyder -(defmethod go-hostile spyder ((this spyder)) +(defmethod go-hostile ((this spyder)) (if (and (not (logtest? (-> this status-flags) (spyder-flags spflags-1))) (-> this next-state) (let ((v1-5 (-> this next-state name))) @@ -1260,7 +1251,7 @@ ;; definition for method 142 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 spyder ((this spyder) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this spyder) (arg0 nav-control)) (let ((t9-0 (method-of-object this spyder-method-184)) (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) @@ -1273,14 +1264,14 @@ ) ;; definition for method 60 of type spyder -(defmethod coin-flip? spyder ((this spyder)) +(defmethod coin-flip? ((this spyder)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 63 of type spyder ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 spyder ((this spyder) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this spyder) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) (the-as symbol (if (t9-0 this arg0 arg1) (set-dst-proc! (-> this los) (-> this focus handle)) @@ -1291,7 +1282,7 @@ ;; definition for method 114 of type spyder ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! spyder ((this spyder)) +(defmethod init-enemy-collision! ((this spyder)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1392,7 +1383,7 @@ ) ;; definition for method 7 of type spyder -(defmethod relocate spyder ((this spyder) (arg0 int)) +(defmethod relocate ((this spyder) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -1407,7 +1398,7 @@ ;; definition for method 115 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! spyder ((this spyder)) +(defmethod init-enemy! ((this spyder)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc index 2b2c7d912da..2a5b6a5f8cc 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc @@ -3,21 +3,17 @@ ;; definition of type com-elevator (deftype com-elevator (elevator) - ((camera-startup vector 2 :inline :offset-assert 368) - (use-camera-startup? symbol 2 :offset-assert 400) - (sound-id sound-id :offset-assert 408) + ((camera-startup vector 2 :inline) + (use-camera-startup? symbol 2) + (sound-id sound-id) ) - :heap-base #x120 - :method-count-assert 50 - :size-assert #x19c - :flag-assert #x320120019c (:methods - (com-elevator-method-49 (_type_ symbol) none 49) + (com-elevator-method-49 (_type_ symbol) none) ) ) ;; definition for method 3 of type com-elevator -(defmethod inspect com-elevator ((this com-elevator)) +(defmethod inspect ((this com-elevator)) (when (not this) (set! this this) (goto cfg-4) @@ -39,13 +35,13 @@ ) ;; definition for method 30 of type com-elevator -(defmethod get-art-group com-elevator ((this com-elevator)) +(defmethod get-art-group ((this com-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-com-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 43 of type com-elevator -(defmethod move-between-points com-elevator ((this com-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this com-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -65,7 +61,7 @@ ) ;; definition for method 45 of type com-elevator -(defmethod commited-to-ride? com-elevator ((this com-elevator)) +(defmethod commited-to-ride? ((this com-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) @@ -93,7 +89,7 @@ ;; definition for method 49 of type com-elevator ;; WARN: Return type mismatch int vs none. -(defmethod com-elevator-method-49 com-elevator ((this com-elevator) (arg0 symbol)) +(defmethod com-elevator-method-49 ((this com-elevator) (arg0 symbol)) (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 @@ -181,7 +177,7 @@ ) ;; definition for method 40 of type com-elevator -(defmethod activate-elevator com-elevator ((this com-elevator)) +(defmethod activate-elevator ((this com-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (cond ((logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) @@ -197,7 +193,7 @@ ) ;; definition for method 10 of type com-elevator -(defmethod deactivate com-elevator ((this com-elevator)) +(defmethod deactivate ((this com-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -205,7 +201,7 @@ ;; definition for method 33 of type com-elevator ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! com-elevator ((this com-elevator)) +(defmethod init-plat! ((this com-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (dotimes (s5-0 (-> this path curve num-cverts)) @@ -226,7 +222,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 31 of type com-elevator -(defmethod init-plat-collision! com-elevator ((this com-elevator)) +(defmethod init-plat-collision! ((this com-elevator)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -269,16 +265,12 @@ For example for an elevator pre-compute the distance between the first and last ;; definition of type tomb-trans-elevator (deftype tomb-trans-elevator (com-elevator) - ((unknown-gijh1bn2i3hb1 int32 :offset-assert 412) + ((unknown-gijh1bn2i3hb1 int32) ) - :heap-base #x120 - :method-count-assert 50 - :size-assert #x1a0 - :flag-assert #x32012001a0 ) ;; definition for method 3 of type tomb-trans-elevator -(defmethod inspect tomb-trans-elevator ((this tomb-trans-elevator)) +(defmethod inspect ((this tomb-trans-elevator)) (when (not this) (set! this this) (goto cfg-4) @@ -348,7 +340,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 10 of type tomb-trans-elevator -(defmethod deactivate tomb-trans-elevator ((this tomb-trans-elevator)) +(defmethod deactivate ((this tomb-trans-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -356,7 +348,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 33 of type tomb-trans-elevator ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! tomb-trans-elevator ((this tomb-trans-elevator)) +(defmethod init-plat! ((this tomb-trans-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (call-parent-method this) diff --git a/test/decompiler/reference/jak2/levels/common/entities/cty-guard-turret-button_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/cty-guard-turret-button_REF.gc index 957b0a5f21a..66a31d2b50d 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/cty-guard-turret-button_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/cty-guard-turret-button_REF.gc @@ -10,17 +10,13 @@ ;; definition of type cty-guard-turret-button (deftype cty-guard-turret-button (basebutton) () - :heap-base #xa0 - :method-count-assert 40 - :size-assert #x120 - :flag-assert #x2800a00120 - (:methods - (pop-up () _type_ :state 39) + (:state-methods + pop-up ) ) ;; definition for method 3 of type cty-guard-turret-button -(defmethod inspect cty-guard-turret-button ((this cty-guard-turret-button)) +(defmethod inspect ((this cty-guard-turret-button)) (when (not this) (set! this this) (goto cfg-4) @@ -34,7 +30,7 @@ ;; definition for method 33 of type cty-guard-turret-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 cty-guard-turret-button ((this cty-guard-turret-button)) +(defmethod basebutton-method-33 ((this cty-guard-turret-button)) "TODO - joint stuff" (initialize-skeleton this @@ -75,7 +71,7 @@ ;; definition for method 34 of type cty-guard-turret-button ;; WARN: Return type mismatch collide-shape vs none. -(defmethod basebutton-method-34 cty-guard-turret-button ((this cty-guard-turret-button)) +(defmethod basebutton-method-34 ((this cty-guard-turret-button)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -113,7 +109,7 @@ ;; definition for method 35 of type cty-guard-turret-button ;; WARN: Return type mismatch symbol vs none. -(defmethod prepare-trigger-event! cty-guard-turret-button ((this cty-guard-turret-button)) +(defmethod prepare-trigger-event! ((this cty-guard-turret-button)) "Sets `event-going-down` to `'trigger`" (logior! (-> this button-status) (button-status button-status-4)) (set! (-> this event-going-down) 'trigger) @@ -138,7 +134,7 @@ ) ;; definition for method 32 of type cty-guard-turret-button -(defmethod idle-state-transition cty-guard-turret-button ((this cty-guard-turret-button)) +(defmethod idle-state-transition ((this cty-guard-turret-button)) "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" (setup-masks (-> this draw) 0 -1) (cond diff --git a/test/decompiler/reference/jak2/levels/common/entities/fort-floor-spike_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/fort-floor-spike_REF.gc index 700ce91237c..bd3855eed9a 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/fort-floor-spike_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/fort-floor-spike_REF.gc @@ -3,18 +3,15 @@ ;; definition of type spike-row-info (deftype spike-row-info (structure) - ((sync sync-linear :inline :offset-assert 0) - (table-ptr (inline-array vector) :offset-assert 16) - (on-ratio float :offset-assert 20) - (state int32 :offset-assert 24) + ((sync sync-linear :inline) + (table-ptr (inline-array vector)) + (on-ratio float) + (state int32) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type spike-row-info -(defmethod inspect spike-row-info ((this spike-row-info)) +(defmethod inspect ((this spike-row-info)) (when (not this) (set! this this) (goto cfg-4) @@ -30,15 +27,12 @@ ;; definition of type spike-row-info-array (deftype spike-row-info-array (inline-array-class) - ((data spike-row-info :inline :dynamic :offset-assert 16) + ((data spike-row-info :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type spike-row-info-array -(defmethod inspect spike-row-info-array ((this spike-row-info-array)) +(defmethod inspect ((this spike-row-info-array)) (when (not this) (set! this this) (goto cfg-4) @@ -56,26 +50,24 @@ ;; definition of type fort-floor-spike (deftype fort-floor-spike (process-drawable) - ((pos-table (inline-array vector) :offset-assert 200) - (spike-row spike-row-info-array :offset-assert 204) - (spike-dim int32 2 :offset-assert 208) - (attack-id int32 :offset-assert 216) - (no-overlap-timer uint64 :offset-assert 224) + ((pos-table (inline-array vector)) + (spike-row spike-row-info-array) + (spike-dim int32 2) + (attack-id int32) + (no-overlap-timer uint64) ) - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe8 - :flag-assert #x18007000e8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (init-spike-joints! (_type_) none 21) - (init-spike-collision! (_type_) collide-shape-moving 22) - (init-periodic-animation! (_type_) symbol 23) + (init-spike-joints! (_type_) none) + (init-spike-collision! (_type_) collide-shape-moving) + (init-periodic-animation! (_type_) symbol) ) ) ;; definition for method 3 of type fort-floor-spike -(defmethod inspect fort-floor-spike ((this fort-floor-spike)) +(defmethod inspect ((this fort-floor-spike)) (when (not this) (set! this this) (goto cfg-4) @@ -111,7 +103,7 @@ ;; definition for method 21 of type fort-floor-spike ;; WARN: Return type mismatch int vs none. -(defmethod init-spike-joints! fort-floor-spike ((this fort-floor-spike)) +(defmethod init-spike-joints! ((this fort-floor-spike)) "Initializes the skeleton and joints for the spike" 0 (none) @@ -119,14 +111,14 @@ ;; definition for method 22 of type fort-floor-spike ;; WARN: Return type mismatch int vs collide-shape-moving. -(defmethod init-spike-collision! fort-floor-spike ((this fort-floor-spike)) +(defmethod init-spike-collision! ((this fort-floor-spike)) "Initializes the collision for the particular spike" (the-as collide-shape-moving 0) ) ;; definition for method 23 of type fort-floor-spike ;; WARN: Return type mismatch int vs symbol. -(defmethod init-periodic-animation! fort-floor-spike ((this fort-floor-spike)) +(defmethod init-periodic-animation! ((this fort-floor-spike)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (the-as symbol 0) ) @@ -218,7 +210,7 @@ ;; definition for method 7 of type fort-floor-spike ;; WARN: Return type mismatch process-drawable vs fort-floor-spike. -(defmethod relocate fort-floor-spike ((this fort-floor-spike) (arg0 int)) +(defmethod relocate ((this fort-floor-spike) (arg0 int)) (if (nonzero? (-> this spike-row)) (&+! (-> this spike-row) arg0) ) @@ -227,7 +219,7 @@ ;; definition for method 11 of type fort-floor-spike ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-floor-spike ((this fort-floor-spike) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-floor-spike) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -275,14 +267,10 @@ This commonly includes things such as: ;; definition of type fort-floor-spike-a (deftype fort-floor-spike-a (fort-floor-spike) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe8 - :flag-assert #x18007000e8 ) ;; definition for method 3 of type fort-floor-spike-a -(defmethod inspect fort-floor-spike-a ((this fort-floor-spike-a)) +(defmethod inspect ((this fort-floor-spike-a)) (when (not this) (set! this this) (goto cfg-4) @@ -296,7 +284,7 @@ This commonly includes things such as: ;; definition for method 21 of type fort-floor-spike-a ;; WARN: Return type mismatch int vs none. -(defmethod init-spike-joints! fort-floor-spike-a ((this fort-floor-spike-a)) +(defmethod init-spike-joints! ((this fort-floor-spike-a)) "Initializes the skeleton and joints for the spike" (initialize-skeleton this @@ -318,7 +306,7 @@ This commonly includes things such as: ;; definition for method 22 of type fort-floor-spike-a ;; INFO: Used lq/sq -(defmethod init-spike-collision! fort-floor-spike-a ((this fort-floor-spike-a)) +(defmethod init-spike-collision! ((this fort-floor-spike-a)) "Initializes the collision for the particular spike" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape-moving)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -374,7 +362,7 @@ This commonly includes things such as: ;; definition for method 23 of type fort-floor-spike-a ;; INFO: Used lq/sq -(defmethod init-periodic-animation! fort-floor-spike-a ((this fort-floor-spike-a)) +(defmethod init-periodic-animation! ((this fort-floor-spike-a)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (local-vars (sv-64 cspace)) (let ((s5-0 2) @@ -436,14 +424,10 @@ This commonly includes things such as: ;; definition of type fort-floor-spike-b (deftype fort-floor-spike-b (fort-floor-spike) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe8 - :flag-assert #x18007000e8 ) ;; definition for method 3 of type fort-floor-spike-b -(defmethod inspect fort-floor-spike-b ((this fort-floor-spike-b)) +(defmethod inspect ((this fort-floor-spike-b)) (when (not this) (set! this this) (goto cfg-4) @@ -457,7 +441,7 @@ This commonly includes things such as: ;; definition for method 21 of type fort-floor-spike-b ;; WARN: Return type mismatch int vs none. -(defmethod init-spike-joints! fort-floor-spike-b ((this fort-floor-spike-b)) +(defmethod init-spike-joints! ((this fort-floor-spike-b)) "Initializes the skeleton and joints for the spike" (initialize-skeleton this @@ -479,7 +463,7 @@ This commonly includes things such as: ;; definition for method 22 of type fort-floor-spike-b ;; INFO: Used lq/sq -(defmethod init-spike-collision! fort-floor-spike-b ((this fort-floor-spike-b)) +(defmethod init-spike-collision! ((this fort-floor-spike-b)) "Initializes the collision for the particular spike" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape-moving)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -546,7 +530,7 @@ This commonly includes things such as: ;; definition for method 23 of type fort-floor-spike-b ;; INFO: Used lq/sq -(defmethod init-periodic-animation! fort-floor-spike-b ((this fort-floor-spike-b)) +(defmethod init-periodic-animation! ((this fort-floor-spike-b)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (local-vars (sv-64 cspace)) (let ((s5-0 2) @@ -610,14 +594,10 @@ This commonly includes things such as: ;; definition of type fort-floor-spike-c (deftype fort-floor-spike-c (fort-floor-spike) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe8 - :flag-assert #x18007000e8 ) ;; definition for method 3 of type fort-floor-spike-c -(defmethod inspect fort-floor-spike-c ((this fort-floor-spike-c)) +(defmethod inspect ((this fort-floor-spike-c)) (when (not this) (set! this this) (goto cfg-4) @@ -631,7 +611,7 @@ This commonly includes things such as: ;; definition for method 21 of type fort-floor-spike-c ;; WARN: Return type mismatch int vs none. -(defmethod init-spike-joints! fort-floor-spike-c ((this fort-floor-spike-c)) +(defmethod init-spike-joints! ((this fort-floor-spike-c)) "Initializes the skeleton and joints for the spike" (initialize-skeleton this @@ -653,7 +633,7 @@ This commonly includes things such as: ;; definition for method 22 of type fort-floor-spike-c ;; INFO: Used lq/sq -(defmethod init-spike-collision! fort-floor-spike-c ((this fort-floor-spike-c)) +(defmethod init-spike-collision! ((this fort-floor-spike-c)) "Initializes the collision for the particular spike" (local-vars (prim-mesh collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape-moving)) (let ((cshape-moving (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -725,7 +705,7 @@ This commonly includes things such as: ;; definition for method 23 of type fort-floor-spike-c ;; INFO: Used lq/sq -(defmethod init-periodic-animation! fort-floor-spike-c ((this fort-floor-spike-c)) +(defmethod init-periodic-animation! ((this fort-floor-spike-c)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (local-vars (sv-64 cspace)) (let ((s5-0 3) diff --git a/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc index 3a2f0d1e018..1622a7a7110 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc @@ -10,14 +10,10 @@ ;; definition of type gun-buoy-shot (deftype gun-buoy-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type gun-buoy-shot -(defmethod inspect gun-buoy-shot ((this gun-buoy-shot)) +(defmethod inspect ((this gun-buoy-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -32,7 +28,7 @@ ;; definition for method 28 of type gun-buoy-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound gun-buoy-shot ((this gun-buoy-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this gun-buoy-shot) (arg0 projectile-options)) (if (zero? arg0) (sound-play "buoy-shot") ) @@ -119,7 +115,7 @@ ;; definition for method 30 of type gun-buoy-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! gun-buoy-shot ((this gun-buoy-shot)) +(defmethod init-proj-collision! ((this gun-buoy-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -168,7 +164,7 @@ ;; definition for method 31 of type gun-buoy-shot ;; INFO: Used lq/sq -(defmethod init-proj-settings! gun-buoy-shot ((this gun-buoy-shot)) +(defmethod init-proj-settings! ((this gun-buoy-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this hit-actor?) #f) (set! (-> this tail-pos quad) (-> this root trans quad)) @@ -293,41 +289,39 @@ ;; definition of type gun-buoy (deftype gun-buoy (nav-enemy) - ((gun-elev-jmod joint-mod :offset-assert 604) - (start-pos vector :inline :offset-assert 608) - (aim-dir vector :inline :offset-assert 624) - (banking-quat quaternion :inline :offset 656) - (offset-from-player vector :inline :offset-assert 672) - (offset-y-angular float :offset-assert 688) - (elev-angle float :offset-assert 692) - (y-final float :offset-assert 696) - (y-offset float :offset-assert 700) - (y-bob float :offset-assert 704) - (y-speed float :offset-assert 708) - (warning-interval time-frame :offset-assert 712) - (warning-timer time-frame :offset-assert 720) - (splash-timer time-frame :offset-assert 728) - (stare-down-timer time-frame :offset-assert 736) - (warning-id sound-id :offset-assert 744) - (voice-id sound-id :offset-assert 748) - (flags gun-buoy-flags :offset-assert 752) + ((gun-elev-jmod joint-mod) + (start-pos vector :inline) + (aim-dir vector :inline) + (banking-quat quaternion :inline :offset 656) + (offset-from-player vector :inline) + (offset-y-angular float) + (elev-angle float) + (y-final float) + (y-offset float) + (y-bob float) + (y-speed float) + (warning-interval time-frame) + (warning-timer time-frame) + (splash-timer time-frame) + (stare-down-timer time-frame) + (warning-id sound-id) + (voice-id sound-id) + (flags gun-buoy-flags) ) - :heap-base #x280 - :method-count-assert 184 - :size-assert #x2f2 - :flag-assert #xb8028002f2 + (:state-methods + attack + exit-ambush + warning + stare-down + open-guns + ) (:methods - (attack () _type_ :state 178) - (exit-ambush () _type_ :state 179) - (warning () _type_ :state 180) - (stare-down () _type_ :state 181) - (open-guns () _type_ :state 182) - (gun-buoy-method-183 (_type_ process-focusable) none 183) + (gun-buoy-method-183 (_type_ process-focusable) none) ) ) ;; definition for method 3 of type gun-buoy -(defmethod inspect gun-buoy ((this gun-buoy)) +(defmethod inspect ((this gun-buoy)) (when (not this) (set! this this) (goto cfg-4) @@ -936,7 +930,7 @@ ) ;; definition for method 74 of type gun-buoy -(defmethod general-event-handler gun-buoy ((this gun-buoy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this gun-buoy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -952,7 +946,7 @@ ;; definition for method 55 of type gun-buoy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! gun-buoy ((this gun-buoy)) +(defmethod track-target! ((this gun-buoy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1025,7 +1019,7 @@ ) ;; definition for method 70 of type gun-buoy -(defmethod go-hostile gun-buoy ((this gun-buoy)) +(defmethod go-hostile ((this gun-buoy)) (if (logtest? (-> this flags) (gun-buoy-flags gubflags-1)) (go (method-of-object this hostile)) (go (method-of-object this warning)) @@ -1033,14 +1027,14 @@ ) ;; definition for method 61 of type gun-buoy -(defmethod enemy-method-61 gun-buoy ((this gun-buoy) (arg0 int)) +(defmethod enemy-method-61 ((this gun-buoy) (arg0 int)) arg0 ) ;; definition for method 98 of type gun-buoy ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 40. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod in-aggro-range? gun-buoy ((this gun-buoy) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this gun-buoy) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -1111,7 +1105,7 @@ ;; definition for method 183 of type gun-buoy ;; INFO: Used lq/sq ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod gun-buoy-method-183 gun-buoy ((this gun-buoy) (arg0 process-focusable)) +(defmethod gun-buoy-method-183 ((this gun-buoy) (arg0 process-focusable)) (let ((s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8))) (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 10))) (s4-0 (new 'stack-no-clear 'projectile-init-by-other-params)) @@ -1147,7 +1141,7 @@ ;; definition for method 142 of type gun-buoy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 gun-buoy ((this gun-buoy) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this gun-buoy) (arg0 nav-control)) (local-vars (a0-19 int) (a0-21 int)) (let* ((v1-1 (-> *perf-stats* data 33)) (a0-1 (-> v1-1 ctrl)) @@ -1216,7 +1210,7 @@ ;; definition for method 7 of type gun-buoy ;; WARN: Return type mismatch nav-enemy vs gun-buoy. -(defmethod relocate gun-buoy ((this gun-buoy) (arg0 int)) +(defmethod relocate ((this gun-buoy) (arg0 int)) (if (nonzero? (-> this gun-elev-jmod)) (&+! (-> this gun-elev-jmod) arg0) ) @@ -1225,7 +1219,7 @@ ;; definition for method 114 of type gun-buoy ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! gun-buoy ((this gun-buoy)) +(defmethod init-enemy-collision! ((this gun-buoy)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1282,7 +1276,7 @@ ;; definition for method 115 of type gun-buoy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! gun-buoy ((this gun-buoy)) +(defmethod init-enemy! ((this gun-buoy)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc index a8f64425078..920c65d5407 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc @@ -520,25 +520,21 @@ ;; definition of type spydroid (deftype spydroid (nav-enemy) - ((old-y-deg float :offset-assert 604) - (diff-angle float :offset-assert 608) - (desire-turn symbol :offset-assert 612) - (hit-target basic :offset-assert 616) - (lightning lightning-control 4 :offset-assert 620) - (floor float :offset-assert 636) - (explode-part sparticle-launch-control :offset-assert 640) + ((old-y-deg float) + (diff-angle float) + (desire-turn symbol) + (hit-target basic) + (lightning lightning-control 4) + (floor float) + (explode-part sparticle-launch-control) ) - :heap-base #x210 - :method-count-assert 179 - :size-assert #x284 - :flag-assert #xb302100284 - (:methods - (attack () _type_ :state 178) + (:state-methods + attack ) ) ;; definition for method 3 of type spydroid -(defmethod inspect spydroid ((this spydroid)) +(defmethod inspect ((this spydroid)) (when (not this) (set! this this) (goto cfg-4) @@ -673,7 +669,7 @@ ;; definition for method 55 of type spydroid ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! spydroid ((this spydroid)) +(defmethod track-target! ((this spydroid)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -773,7 +769,7 @@ ;; definition for method 74 of type spydroid ;; INFO: Used lq/sq -(defmethod general-event-handler spydroid ((this spydroid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this spydroid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-6 vector) (sv-144 vector)) @@ -1309,7 +1305,7 @@ ;; definition for method 114 of type spydroid ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! spydroid ((this spydroid)) +(defmethod init-enemy-collision! ((this spydroid)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1356,13 +1352,13 @@ ) ;; definition for method 60 of type spydroid -(defmethod coin-flip? spydroid ((this spydroid)) +(defmethod coin-flip? ((this spydroid)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 10 of type spydroid -(defmethod deactivate spydroid ((this spydroid)) +(defmethod deactivate ((this spydroid)) (if (nonzero? (-> this explode-part)) (kill-and-free-particles (-> this explode-part)) ) @@ -1372,7 +1368,7 @@ ;; definition for method 7 of type spydroid ;; WARN: Return type mismatch nav-enemy vs spydroid. -(defmethod relocate spydroid ((this spydroid) (arg0 int)) +(defmethod relocate ((this spydroid) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this lightning v1-0)) (&+! (-> this lightning v1-0) arg0) @@ -1388,7 +1384,7 @@ ;; definition for method 115 of type spydroid ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! spydroid ((this spydroid)) +(defmethod init-enemy! ((this spydroid)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc b/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc index bf8b5a61eb2..d6399f07681 100644 --- a/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc @@ -324,17 +324,13 @@ ;; definition of type guard-shot (deftype guard-shot (projectile) - ((hit-actor? symbol :offset-assert 472) - (tail-pos vector :inline :offset-assert 480) + ((hit-actor? symbol) + (tail-pos vector :inline) ) - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type guard-shot -(defmethod inspect guard-shot ((this guard-shot)) +(defmethod inspect ((this guard-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -349,7 +345,7 @@ ) ;; definition for method 37 of type guard-shot -(defmethod deal-damage! guard-shot ((this guard-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! ((this guard-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((t9-0 (method-of-type projectile deal-damage!))) (when (t9-0 this arg0 arg1) @@ -362,7 +358,7 @@ ;; definition for method 24 of type guard-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight guard-shot ((this guard-shot)) +(defmethod draw-laser-sight ((this guard-shot)) "TODO - confirm If applicable, draw the laser sight particles" (draw-beam (-> *part-id-table* 610) (-> this tail-pos) (-> this starting-dir) #f #t) (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) @@ -382,7 +378,7 @@ ;; definition for method 25 of type guard-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles guard-shot ((this guard-shot)) +(defmethod spawn-impact-particles ((this guard-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -442,7 +438,7 @@ ;; definition for method 26 of type guard-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles guard-shot ((this guard-shot)) +(defmethod spawn-shell-particles ((this guard-shot)) "TODO - confirm" (let* ((s4-0 (-> this root)) (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) @@ -533,7 +529,7 @@ ;; definition for method 28 of type guard-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound guard-shot ((this guard-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this guard-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -600,7 +596,7 @@ ) ;; definition for method 38 of type guard-shot -(defmethod made-impact? guard-shot ((this guard-shot)) +(defmethod made-impact? ((this guard-shot)) "TODO - queries the collision cache, return true/false" (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) @@ -624,7 +620,7 @@ ;; definition for method 30 of type guard-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! guard-shot ((this guard-shot)) +(defmethod init-proj-collision! ((this guard-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -679,7 +675,7 @@ ;; definition for method 31 of type guard-shot ;; INFO: Used lq/sq -(defmethod init-proj-settings! guard-shot ((this guard-shot)) +(defmethod init-proj-settings! ((this guard-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this hit-actor?) #f) (set! (-> this tail-pos quad) (-> this root trans quad)) @@ -695,16 +691,12 @@ ;; definition of type vehicle-grenade (deftype vehicle-grenade (projectile-bounce) - ((blast-radius float :offset-assert 496) + ((blast-radius float) ) - :heap-base #x180 - :method-count-assert 42 - :size-assert #x1f4 - :flag-assert #x2a018001f4 ) ;; definition for method 3 of type vehicle-grenade -(defmethod inspect vehicle-grenade ((this vehicle-grenade)) +(defmethod inspect ((this vehicle-grenade)) (when (not this) (set! this this) (goto cfg-4) @@ -726,7 +718,7 @@ ;; definition for method 28 of type vehicle-grenade ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound vehicle-grenade ((this vehicle-grenade) (arg0 projectile-options)) +(defmethod play-impact-sound ((this vehicle-grenade) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -743,7 +735,7 @@ ;; definition for method 30 of type vehicle-grenade ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! vehicle-grenade ((this vehicle-grenade)) +(defmethod init-proj-collision! ((this vehicle-grenade)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -780,7 +772,7 @@ ;; definition for method 31 of type vehicle-grenade ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! vehicle-grenade ((this vehicle-grenade)) +(defmethod init-proj-settings! ((this vehicle-grenade)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this attack-mode) 'eco-dark) (initialize-skeleton @@ -801,7 +793,7 @@ ;; definition for method 25 of type vehicle-grenade ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles vehicle-grenade ((this vehicle-grenade)) +(defmethod spawn-impact-particles ((this vehicle-grenade)) "Spawns associated particles with the projectile if applicable" (spawn (-> this part) (-> this root trans)) (ja-post) @@ -811,7 +803,7 @@ ;; definition for method 41 of type vehicle-grenade ;; WARN: Return type mismatch int vs none. -(defmethod noop vehicle-grenade ((this vehicle-grenade)) +(defmethod noop ((this vehicle-grenade)) "Does nothing" (spawn (-> this part) (-> this root trans)) 0 @@ -820,7 +812,7 @@ ;; definition for method 39 of type vehicle-grenade ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound! vehicle-grenade ((this vehicle-grenade)) +(defmethod play-impact-sound! ((this vehicle-grenade)) "Plays impact sound" (let* ((a2-0 (-> this root)) (v1-0 (-> a2-0 status)) @@ -966,14 +958,10 @@ ;; definition of type guard-lazer-shot (deftype guard-lazer-shot (projectile) () - :heap-base #x160 - :method-count-assert 40 - :size-assert #x1d8 - :flag-assert #x28016001d8 ) ;; definition for method 3 of type guard-lazer-shot -(defmethod inspect guard-lazer-shot ((this guard-lazer-shot)) +(defmethod inspect ((this guard-lazer-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -994,7 +982,7 @@ ) ;; definition for method 38 of type guard-lazer-shot -(defmethod made-impact? guard-lazer-shot ((this guard-lazer-shot)) +(defmethod made-impact? ((this guard-lazer-shot)) "TODO - queries the collision cache, return true/false" (let ((gp-0 (-> this root)) (s5-0 (new 'stack-no-clear 'collide-query)) @@ -1032,7 +1020,7 @@ ;; definition for method 30 of type guard-lazer-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! guard-lazer-shot ((this guard-lazer-shot)) +(defmethod init-proj-collision! ((this guard-lazer-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1081,7 +1069,7 @@ ;; definition for method 31 of type guard-lazer-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! guard-lazer-shot ((this guard-lazer-shot)) +(defmethod init-proj-settings! ((this guard-lazer-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this attack-mode) 'shock) (set! (-> this max-speed) 131072.0) diff --git a/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc b/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc index aa302e86350..5acb0948fb9 100644 --- a/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc @@ -322,16 +322,12 @@ ;; definition of type metalhead-shot (deftype metalhead-shot (projectile) - ((tail-pos vector :inline :offset-assert 480) + ((tail-pos vector :inline) ) - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type metalhead-shot -(defmethod inspect metalhead-shot ((this metalhead-shot)) +(defmethod inspect ((this metalhead-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -347,7 +343,7 @@ ;; definition for method 24 of type metalhead-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight metalhead-shot ((this metalhead-shot)) +(defmethod draw-laser-sight ((this metalhead-shot)) "TODO - confirm If applicable, draw the laser sight particles" (draw-beam (-> *part-id-table* 624) (-> this tail-pos) (-> this starting-dir) #f #t) (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) @@ -367,7 +363,7 @@ ;; definition for method 25 of type metalhead-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles metalhead-shot ((this metalhead-shot)) +(defmethod spawn-impact-particles ((this metalhead-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -426,7 +422,7 @@ ;; definition for method 26 of type metalhead-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles metalhead-shot ((this metalhead-shot)) +(defmethod spawn-shell-particles ((this metalhead-shot)) "TODO - confirm" (let* ((s5-0 (-> this root)) (v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s5-0 trans)) 2048.0)) @@ -476,7 +472,7 @@ ;; definition for method 28 of type metalhead-shot ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound metalhead-shot ((this metalhead-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this metalhead-shot) (arg0 projectile-options)) (with-pp (case arg0 (((projectile-options lose-altitude proj-options-2)) @@ -531,7 +527,7 @@ ;; definition for method 30 of type metalhead-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! metalhead-shot ((this metalhead-shot)) +(defmethod init-proj-collision! ((this metalhead-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -585,7 +581,7 @@ ;; definition for method 31 of type metalhead-shot ;; INFO: Used lq/sq -(defmethod init-proj-settings! metalhead-shot ((this metalhead-shot)) +(defmethod init-proj-settings! ((this metalhead-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'metalhead-shot) @@ -711,17 +707,13 @@ ;; definition of type metalhead-grenade-shot (deftype metalhead-grenade-shot (projectile) - ((tumble-quat quaternion :inline :offset-assert 480) - (blast-radius float :offset-assert 496) + ((tumble-quat quaternion :inline) + (blast-radius float) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x1f4 - :flag-assert #x28018001f4 ) ;; definition for method 3 of type metalhead-grenade-shot -(defmethod inspect metalhead-grenade-shot ((this metalhead-grenade-shot)) +(defmethod inspect ((this metalhead-grenade-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -738,7 +730,7 @@ ;; definition for method 26 of type metalhead-grenade-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles metalhead-grenade-shot ((this metalhead-grenade-shot)) +(defmethod spawn-shell-particles ((this metalhead-grenade-shot)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -776,7 +768,7 @@ ;; definition for method 28 of type metalhead-grenade-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound metalhead-grenade-shot ((this metalhead-grenade-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this metalhead-grenade-shot) (arg0 projectile-options)) (case arg0 (((projectile-options lose-altitude)) (sound-play "gren-shot-hit") @@ -873,7 +865,7 @@ ;; definition for method 25 of type metalhead-grenade-shot ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles metalhead-grenade-shot ((this metalhead-grenade-shot)) +(defmethod spawn-impact-particles ((this metalhead-grenade-shot)) "Spawns associated particles with the projectile if applicable" (spawn (-> this part) (-> this root trans)) 0 @@ -922,7 +914,7 @@ ;; definition for method 30 of type metalhead-grenade-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! metalhead-grenade-shot ((this metalhead-grenade-shot)) +(defmethod init-proj-collision! ((this metalhead-grenade-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -960,7 +952,7 @@ ;; definition for method 31 of type metalhead-grenade-shot ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-proj-settings! metalhead-grenade-shot ((this metalhead-grenade-shot)) +(defmethod init-proj-settings! ((this metalhead-grenade-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this attack-mode) 'eco-yellow) (set! (-> this blast-radius) 4096.0) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-h_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-h_REF.gc index c926d7b3431..dd9a31d4e03 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-h_REF.gc @@ -3,16 +3,13 @@ ;; definition of type race-turbo-pad (deftype race-turbo-pad (structure) - ((position vector :inline :offset-assert 0) - (handle handle :offset-assert 16) + ((position vector :inline) + (handle handle) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type race-turbo-pad -(defmethod inspect race-turbo-pad ((this race-turbo-pad)) +(defmethod inspect ((this race-turbo-pad)) (when (not this) (set! this this) (goto cfg-4) @@ -26,18 +23,15 @@ ;; definition of type race-decision-point (deftype race-decision-point (structure) - ((pos float :offset-assert 0) - (decision-type uint8 :offset-assert 4) - (shortcuts uint8 :offset-assert 5) - (safe-paths uint8 :offset-assert 6) + ((pos float) + (decision-type uint8) + (shortcuts uint8) + (safe-paths uint8) ) - :method-count-assert 9 - :size-assert #x7 - :flag-assert #x900000007 ) ;; definition for method 3 of type race-decision-point -(defmethod inspect race-decision-point ((this race-decision-point)) +(defmethod inspect ((this race-decision-point)) (when (not this) (set! this this) (goto cfg-4) @@ -53,18 +47,15 @@ ;; definition of type race-racer-info (deftype race-racer-info (structure) - ((rider uint8 :offset-assert 0) - (vehicle uint8 :offset-assert 1) - (flags racer-info-flags :offset-assert 2) - (seek-offset int8 :offset-assert 3) + ((rider uint8) + (vehicle uint8) + (flags racer-info-flags) + (seek-offset int8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type race-racer-info -(defmethod inspect race-racer-info ((this race-racer-info)) +(defmethod inspect ((this race-racer-info)) (when (not this) (set! this this) (goto cfg-4) @@ -80,50 +71,47 @@ ;; definition of type race-info (deftype race-info (basic) - ((race-mesh-name string :offset-assert 4) - (path-group-name string :offset-assert 8) - (task-node game-task-node :offset-assert 12) - (mesh race-mesh :offset-assert 16) - (ai-min-speed-factor float :offset-assert 20) - (ai-max-speed-factor float :offset-assert 24) - (ai-spread-factor float :offset-assert 28) - (start-sphere sphere :inline :offset-assert 32) - (start-dir vector :inline :offset-assert 48) - (finish-sphere sphere :inline :offset-assert 64) - (finish-dir vector :inline :offset-assert 80) - (player-intro-pos vector :inline :offset-assert 96) - (flags race-info-flags :offset-assert 112) - (score uint8 :offset-assert 113) - (lap-count int8 :offset-assert 114) - (racer-count int8 :offset-assert 115) - (turbo-pad-count int8 :offset-assert 116) - (map-index int8 :offset-assert 117) - (decision-point-count int8 :offset-assert 118) - (safe-paths uint8 :offset-assert 119) - (turbo-pad-array (inline-array race-turbo-pad) :offset-assert 120) - (racer-array (inline-array race-racer-info) :offset-assert 124) - (decision-point-array (inline-array race-decision-point) :offset-assert 128) - (level symbol :offset-assert 132) - (borrow-level symbol :offset-assert 136) - (borrow pair :offset-assert 140) - (manager handle :offset-assert 144) - (manager-handle-init-hack basic :offset 144) - (hatch-actor-name string :offset-assert 152) - (countdown-scene string :offset-assert 156) - (complete-continue string :offset-assert 160) - (start-camera string :offset-assert 164) - (go-speech uint16 :offset-assert 168) + ((race-mesh-name string) + (path-group-name string) + (task-node game-task-node) + (mesh race-mesh) + (ai-min-speed-factor float) + (ai-max-speed-factor float) + (ai-spread-factor float) + (start-sphere sphere :inline) + (start-dir vector :inline) + (finish-sphere sphere :inline) + (finish-dir vector :inline) + (player-intro-pos vector :inline) + (flags race-info-flags) + (score uint8) + (lap-count int8) + (racer-count int8) + (turbo-pad-count int8) + (map-index int8) + (decision-point-count int8) + (safe-paths uint8) + (turbo-pad-array (inline-array race-turbo-pad)) + (racer-array (inline-array race-racer-info)) + (decision-point-array (inline-array race-decision-point)) + (level symbol) + (borrow-level symbol) + (borrow pair) + (manager handle) + (manager-handle-init-hack basic :overlay-at manager) + (hatch-actor-name string) + (countdown-scene string) + (complete-continue string) + (start-camera string) + (go-speech uint16) ) - :method-count-assert 10 - :size-assert #xaa - :flag-assert #xa000000aa (:methods - (initialize-mesh (_type_) none 9) + (initialize-mesh (_type_) none) ) ) ;; definition for method 3 of type race-info -(defmethod inspect race-info ((this race-info)) +(defmethod inspect ((this race-info)) (when (not this) (set! this this) (goto cfg-4) @@ -168,39 +156,36 @@ ;; definition of type racer-state (deftype racer-state (structure) - ((position vector :inline :offset-assert 0) - (racer handle :offset-assert 16) - (flags racer-flags :offset-assert 24) - (rank int8 :offset-assert 25) - (finish-count int8 :offset-assert 26) - (lap-count int8 :offset-assert 27) - (lap-quadrant int8 :offset-assert 28) - (rider uint8 :offset-assert 29) - (lap-distance float :offset-assert 32) - (lap-distance-prev float :offset-assert 36) - (pos float :offset-assert 40) - (target-pos-offset float :offset-assert 44) - (speed-factor float :offset-assert 48) - (finish-time uint32 :offset-assert 52) - (lap-start uint32 :offset-assert 56) - (best-lap-time uint32 :offset-assert 60) - (lap-time-array float 5 :offset-assert 64) - (start-position vector :inline :offset-assert 96) + ((position vector :inline) + (racer handle) + (flags racer-flags) + (rank int8) + (finish-count int8) + (lap-count int8) + (lap-quadrant int8) + (rider uint8) + (lap-distance float) + (lap-distance-prev float) + (pos float) + (target-pos-offset float) + (speed-factor float) + (finish-time uint32) + (lap-start uint32) + (best-lap-time uint32) + (lap-time-array float 5) + (start-position vector :inline) ) - :method-count-assert 14 - :size-assert #x70 - :flag-assert #xe00000070 (:methods - (update-lap-distance (_type_ race-state) none 9) - (begin-lap (_type_ race-state) none 10) - (end-lap (_type_ race-state) none 11) - (print-laps (_type_ race-state string) none 12) - (init-racer! (_type_ process-drawable) none 13) + (update-lap-distance (_type_ race-state) none) + (begin-lap (_type_ race-state) none) + (end-lap (_type_ race-state) none) + (print-laps (_type_ race-state string) none) + (init-racer! (_type_ process-drawable) none) ) ) ;; definition for method 3 of type racer-state -(defmethod inspect racer-state ((this racer-state)) +(defmethod inspect ((this racer-state)) (when (not this) (set! this this) (goto cfg-4) @@ -230,49 +215,46 @@ ;; definition of type race-state (deftype race-state (structure) - ((info race-info :offset-assert 0) - (flags race-flags :offset-assert 4) - (state race-state-enum :offset-assert 5) - (racer-count int8 :offset-assert 6) - (finished-count int8 :offset-assert 7) - (i-player int8 :offset-assert 8) - (i-countdown int8 :offset-assert 9) - (manager handle :offset-assert 16) - (scene-player handle :offset-assert 24) - (race-signal handle :offset-assert 32) - (arrow handle :offset-assert 40) - (hud-timer handle :offset-assert 48) - (hud-lap-counter handle :offset-assert 56) - (hud-turbo-counter handle :offset-assert 64) - (hud-position handle :offset-assert 72) - (current-time uint32 :offset-assert 80) - (countdown-start-time uint32 :offset-assert 84) - (race-start-time uint32 :offset-assert 88) - (rankings int8 10 :offset-assert 92) - (target-pos float :offset-assert 104) - (suck-factor float :offset-assert 108) - (racer-array racer-state 10 :inline :offset-assert 112) - (player-intro-curve cubic-curve :inline :offset-assert 1232) + ((info race-info) + (flags race-flags) + (state race-state-enum) + (racer-count int8) + (finished-count int8) + (i-player int8) + (i-countdown int8) + (manager handle) + (scene-player handle) + (race-signal handle) + (arrow handle) + (hud-timer handle) + (hud-lap-counter handle) + (hud-turbo-counter handle) + (hud-position handle) + (current-time uint32) + (countdown-start-time uint32) + (race-start-time uint32) + (rankings int8 10) + (target-pos float) + (suck-factor float) + (racer-array racer-state 10 :inline) + (player-intro-curve cubic-curve :inline) ) - :method-count-assert 19 - :size-assert #x510 - :flag-assert #x1300000510 (:methods - (init-racers! (_type_ process-drawable) none 9) - (begin-race (_type_) none 10) - (update (_type_) none 11) - (update-rankings (_type_) none 12) - (debug-print-rankings (_type_) none 13) - (update-racers (_type_) none 14) - (spawn-race-signal (_type_) none 15) - (initialize (_type_ process race-info) none 16) - (set-speech-tables! (_type_) none 17) - (setup-race (_type_) none 18) + (init-racers! (_type_ process-drawable) none) + (begin-race (_type_) none) + (update (_type_) none) + (update-rankings (_type_) none) + (debug-print-rankings (_type_) none) + (update-racers (_type_) none) + (spawn-race-signal (_type_) none) + (initialize (_type_ process race-info) none) + (set-speech-tables! (_type_) none) + (setup-race (_type_) none) ) ) ;; definition for method 3 of type race-state -(defmethod inspect race-state ((this race-state)) +(defmethod inspect ((this race-state)) (when (not this) (set! this this) (goto cfg-4) @@ -307,36 +289,34 @@ ;; definition of type race-manager (deftype race-manager (process) - ((race-state race-state :offset-assert 128) - (state-time time-frame :offset-assert 136) - (player-on-track-time time-frame :offset-assert 144) - (message-id sound-id :offset-assert 152) - (finish-sound-id sound-id :offset-assert 156) + ((race-state race-state) + (state-time time-frame) + (player-on-track-time time-frame) + (message-id sound-id) + (finish-sound-id sound-id) ) - :heap-base #x20 - :method-count-assert 28 - :size-assert #xa0 - :flag-assert #x1c002000a0 + (:state-methods + idle + active + fail + win + lose + die + ) (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (fail () _type_ :state 16) - (win () _type_ :state 17) - (lose () _type_ :state 18) - (die () _type_ :state 19) - (update (_type_) int 20) - (initialize-state (_type_) none 21) - (race-manager-method-22 (_type_) none 22) - (initialize-race-state (_type_) none 23) - (draw-message-continue (_type_) none 24) - (draw-message-retry (_type_) none 25) - (save-score (_type_ float) none 26) - (stop-speech (_type_) none 27) + (update (_type_) int) + (initialize-state (_type_) none) + (race-manager-method-22 (_type_) none) + (initialize-race-state (_type_) none) + (draw-message-continue (_type_) none) + (draw-message-retry (_type_) none) + (save-score (_type_ float) none) + (stop-speech (_type_) none) ) ) ;; definition for method 3 of type race-manager -(defmethod inspect race-manager ((this race-manager)) +(defmethod inspect ((this race-manager)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-hud_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-hud_REF.gc index 39cf9290b3a..5310e962264 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-hud_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-hud_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 15 of type hud-race-timer ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-race-timer ((this hud-race-timer)) +(defmethod draw ((this hud-race-timer)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 0 @@ -33,7 +33,7 @@ ;; definition for method 16 of type hud-race-timer ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-race-timer ((this hud-race-timer)) +(defmethod update-values ((this hud-race-timer)) (set! (-> this values 0 target) (/ (the-as int (-> *game-info* race-timer)) #x4650)) (set! (-> this values 1 target) (/ (mod (the-as int (-> *game-info* race-timer)) #x4650) 300)) (set! (-> this values 2 target) (/ (mod (mod (the-as int (-> *game-info* race-timer)) #x4650) 300) 5)) @@ -45,7 +45,7 @@ ;; definition for method 17 of type hud-race-timer ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-race-timer ((this hud-race-timer)) +(defmethod init-callback ((this hud-race-timer)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) @@ -71,7 +71,7 @@ ;; definition for method 15 of type hud-race-lap-counter ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-race-lap-counter ((this hud-race-lap-counter)) +(defmethod draw ((this hud-race-lap-counter)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 504 @@ -89,7 +89,7 @@ ;; definition for method 16 of type hud-race-lap-counter ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-race-lap-counter ((this hud-race-lap-counter)) +(defmethod update-values ((this hud-race-lap-counter)) (set! (-> this values 0 target) (-> *game-info* race-current-lap-count)) (set! (-> this values 1 target) (-> *game-info* race-total-lap-count)) (logclear! (-> this flags) (hud-flags disable)) @@ -100,7 +100,7 @@ ;; definition for method 17 of type hud-race-lap-counter ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-race-lap-counter ((this hud-race-lap-counter)) +(defmethod init-callback ((this hud-race-lap-counter)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -118,7 +118,7 @@ ;; definition for method 15 of type hud-race-turbo-counter ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-race-turbo-counter ((this hud-race-turbo-counter)) +(defmethod draw ((this hud-race-turbo-counter)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 224 @@ -160,7 +160,7 @@ ;; definition for method 16 of type hud-race-turbo-counter ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-race-turbo-counter ((this hud-race-turbo-counter)) +(defmethod update-values ((this hud-race-turbo-counter)) (set! (-> this values 0 target) (-> *game-info* race-number-turbos)) (logclear! (-> this flags) (hud-flags disable)) ((method-of-type hud update-values) this) @@ -170,7 +170,7 @@ ;; definition for method 17 of type hud-race-turbo-counter ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-race-turbo-counter ((this hud-race-turbo-counter)) +(defmethod init-callback ((this hud-race-turbo-counter)) (set! (-> this level) (level-get *level* 'stadium)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) @@ -188,7 +188,7 @@ ;; definition for method 15 of type hud-race-position ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-race-position ((this hud-race-position)) +(defmethod draw ((this hud-race-position)) (local-vars (s5-0 int)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) @@ -252,7 +252,7 @@ ;; definition for method 16 of type hud-race-position ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-race-position ((this hud-race-position)) +(defmethod update-values ((this hud-race-position)) (set! (-> this values 0 target) (-> *game-info* race-position)) (logclear! (-> this flags) (hud-flags disable)) ((method-of-type hud update-values) this) @@ -262,7 +262,7 @@ ;; definition for method 17 of type hud-race-position ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-race-position ((this hud-race-position)) +(defmethod init-callback ((this hud-race-position)) (set! (-> this level) (level-get *level* 'ctywide)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-lower-left) (gui-action hidden) (-> this name) 81920.0 0) @@ -306,7 +306,7 @@ ;; definition for method 15 of type hud-race-final-stats ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-race-final-stats ((this hud-race-final-stats)) +(defmethod draw ((this hud-race-final-stats)) (local-vars (s0-0 int) (sv-112 (function string font-context symbol int bucket-id float)) @@ -462,7 +462,7 @@ ;; definition for method 16 of type hud-race-final-stats ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-race-final-stats ((this hud-race-final-stats)) +(defmethod update-values ((this hud-race-final-stats)) (logclear! (-> this flags) (hud-flags disable)) ((method-of-type hud update-values) this) 0 @@ -471,7 +471,7 @@ ;; definition for method 17 of type hud-race-final-stats ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-race-final-stats ((this hud-race-final-stats)) +(defmethod init-callback ((this hud-race-final-stats)) (set! (-> this level) (level-get *level* 'stadium)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-info_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-info_REF.gc index af4296daab8..9eacef53438 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-info_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-info_REF.gc @@ -650,7 +650,7 @@ ;; definition for method 17 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod set-speech-tables! race-state ((this race-state)) +(defmethod set-speech-tables! ((this race-state)) (speech-table-set! *speech-control* (speech-type speech-type-30) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc index cb4fba747c8..57d14b665c9 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc @@ -48,7 +48,7 @@ ;; definition for method 9 of type race-info ;; WARN: Return type mismatch int vs none. -(defmethod initialize-mesh race-info ((this race-info)) +(defmethod initialize-mesh ((this race-info)) (let ((v1-0 (entity-by-name (-> this race-mesh-name)))) (cond (v1-0 @@ -99,7 +99,7 @@ ;; definition for method 10 of type racer-state ;; WARN: Return type mismatch int vs none. -(defmethod begin-lap racer-state ((this racer-state) (arg0 race-state)) +(defmethod begin-lap ((this racer-state) (arg0 race-state)) (format #t "begin-lap racer ~d~%" (-> this rank)) (set! (-> this lap-start) (-> arg0 current-time)) (logior! (-> this flags) (racer-flags in-race)) @@ -109,7 +109,7 @@ ;; definition for method 11 of type racer-state ;; WARN: Return type mismatch int vs none. -(defmethod end-lap racer-state ((this racer-state) (arg0 race-state)) +(defmethod end-lap ((this racer-state) (arg0 race-state)) (+! (-> this lap-count) 1) (format #t "end-lap ~d racer ~d~%" (-> this lap-count) (-> this rank)) (let ((v1-2 4) @@ -189,7 +189,7 @@ ;; definition for method 9 of type racer-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-lap-distance racer-state ((this racer-state) (arg0 race-state)) +(defmethod update-lap-distance ((this racer-state) (arg0 race-state)) (local-vars (a0-29 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -306,7 +306,7 @@ ;; definition for method 12 of type racer-state ;; WARN: Return type mismatch int vs none. -(defmethod print-laps racer-state ((this racer-state) (arg0 race-state) (arg1 string)) +(defmethod print-laps ((this racer-state) (arg0 race-state) (arg1 string)) (let ((s4-0 (- (-> arg0 current-time) (-> this lap-start)))) (format arg1 "lap count ~d~%" (-> this lap-count)) (format arg1 "best lap ") @@ -332,7 +332,7 @@ ;; definition for method 13 of type racer-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-racer! racer-state ((this racer-state) (arg0 process-drawable)) +(defmethod init-racer! ((this racer-state) (arg0 process-drawable)) (set! (-> this racer) (process->handle arg0)) (set! (-> this position quad) (-> arg0 root trans quad)) (set! (-> this flags) (racer-flags unknown)) @@ -351,7 +351,7 @@ ;; definition for method 9 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod init-racers! race-state ((this race-state) (arg0 process-drawable)) +(defmethod init-racers! ((this race-state) (arg0 process-drawable)) (let ((v1-0 (-> this racer-count))) (when (< v1-0 10) (+! (-> this racer-count) 1) @@ -364,7 +364,7 @@ ;; definition for method 10 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod begin-race race-state ((this race-state)) +(defmethod begin-race ((this race-state)) (format #t "begin-race~%") (when (not (logtest? (-> this flags) (race-flags begun))) (logior! (-> this flags) (race-flags begun)) @@ -412,7 +412,7 @@ ;; definition for method 12 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod update-rankings race-state ((this race-state)) +(defmethod update-rankings ((this race-state)) (let ((v1-0 (new 'stack-no-clear 'array 'float 10))) (dotimes (a0-1 (-> this racer-count)) (let ((a1-3 (-> this racer-array a0-1))) @@ -465,7 +465,7 @@ ;; definition for method 13 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod debug-print-rankings race-state ((this race-state)) +(defmethod debug-print-rankings ((this race-state)) (dotimes (s5-0 (-> this racer-count)) (let* ((s4-0 (-> this rankings s5-0)) (s3-0 (-> this racer-array s4-0)) @@ -510,7 +510,7 @@ ;; definition for method 14 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod update-racers race-state ((this race-state)) +(defmethod update-racers ((this race-state)) (let ((s5-0 0)) (dotimes (s4-0 (-> this racer-count)) (let ((s3-0 (-> this racer-array s4-0))) @@ -532,7 +532,7 @@ ;; definition for method 18 of type race-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod setup-race race-state ((this race-state)) +(defmethod setup-race ((this race-state)) (set-setting! 'allow-progress #f 0.0 0) (send-event (handle->process (-> this arrow)) 'leave) (when (logtest? (-> this info flags) (race-info-flags borrow)) @@ -573,7 +573,7 @@ ;; definition for method 11 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod update race-state ((this race-state)) +(defmethod update ((this race-state)) (set! (-> this current-time) (the-as uint (current-time))) (case (-> this state) (((race-state-enum idle)) @@ -757,7 +757,7 @@ ;; definition for method 15 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod spawn-race-signal race-state ((this race-state)) +(defmethod spawn-race-signal ((this race-state)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -808,7 +808,7 @@ ;; definition for method 16 of type race-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod initialize race-state ((this race-state) (arg0 process) (arg1 race-info)) +(defmethod initialize ((this race-state) (arg0 process) (arg1 race-info)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -917,7 +917,7 @@ ;; definition for method 20 of type race-manager ;; INFO: Used lq/sq -(defmethod update race-manager ((this race-manager)) +(defmethod update ((this race-manager)) (let ((s5-0 *display-race-marks*)) (when (logtest? s5-0 (race-marks-controls rmc2040)) (let ((a0-3 (entity-by-name (-> *race-info-array* *select-race* race-mesh-name)))) @@ -957,14 +957,14 @@ ;; definition for method 22 of type race-manager ;; WARN: Return type mismatch int vs none. -(defmethod race-manager-method-22 race-manager ((this race-manager)) +(defmethod race-manager-method-22 ((this race-manager)) 0 (none) ) ;; definition for method 23 of type race-manager ;; WARN: Return type mismatch int vs none. -(defmethod initialize-race-state race-manager ((this race-manager)) +(defmethod initialize-race-state ((this race-manager)) (let ((s5-0 (-> this race-state info))) (initialize-mesh s5-0) (initialize (-> this race-state) this s5-0) @@ -985,7 +985,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod initialize-state race-manager ((this race-manager)) +(defmethod initialize-state ((this race-manager)) (local-vars (v1-0 int) (sv-352 task-arrow-params) @@ -1161,7 +1161,7 @@ ;; definition for method 26 of type race-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod save-score race-manager ((this race-manager) (arg0 float)) +(defmethod save-score ((this race-manager) (arg0 float)) (local-vars (sv-32 int)) (let* ((s5-0 (-> this race-state info score)) (s3-0 0) @@ -1224,7 +1224,7 @@ ;; definition for method 27 of type race-manager ;; WARN: Return type mismatch int vs none. -(defmethod stop-speech race-manager ((this race-manager)) +(defmethod stop-speech ((this race-manager)) (set-action! *gui-control* (gui-action stop) @@ -1251,7 +1251,7 @@ ;; definition for method 24 of type race-manager ;; WARN: Return type mismatch int vs none. -(defmethod draw-message-continue race-manager ((this race-manager)) +(defmethod draw-message-continue ((this race-manager)) (when (= (get-status *gui-control* (-> this message-id)) (gui-status active)) (let ((gp-1 (new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning)) @@ -1281,7 +1281,7 @@ ;; definition for method 25 of type race-manager ;; WARN: Return type mismatch int vs none. -(defmethod draw-message-retry race-manager ((this race-manager)) +(defmethod draw-message-retry ((this race-manager)) (when (= (get-status *gui-control* (-> this message-id)) (gui-status active)) (let ((gp-1 (new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning)) @@ -1602,7 +1602,7 @@ (define *race-manager* (the-as (pointer race-manager) #f)) ;; definition for method 10 of type race-manager -(defmethod deactivate race-manager ((this race-manager)) +(defmethod deactivate ((this race-manager)) (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.0 0) (send-event *traffic-manager* 'restore-default-settings) (call-parent-method this) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-mesh_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-mesh_REF.gc index 2fd87165b47..7cc15f6d505 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-mesh_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-mesh_REF.gc @@ -3,22 +3,19 @@ ;; definition of type race-mesh-hash-search (deftype race-mesh-hash-search (structure) - ((best-dist float :offset-assert 0) - (debug-cells-searched int32 :offset-assert 4) - (debug-slices-searched int32 :offset-assert 8) - (bounds bounding-box4w :inline :offset-assert 16) - (cell-quads vector 2 :inline :offset-assert 48) - (slice-quads vector 4 :inline :offset-assert 80) - (cell-bits vector16ub 2 :inline :offset 48) - (slice-bits vector16ub 4 :inline :offset 80) + ((best-dist float) + (debug-cells-searched int32) + (debug-slices-searched int32) + (bounds bounding-box4w :inline) + (cell-quads vector 2 :inline) + (slice-quads vector 4 :inline) + (cell-bits vector16ub 2 :inline :overlay-at cell-quads) + (slice-bits vector16ub 4 :inline :overlay-at slice-quads) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) ;; definition for method 3 of type race-mesh-hash-search -(defmethod inspect race-mesh-hash-search ((this race-mesh-hash-search)) +(defmethod inspect ((this race-mesh-hash-search)) (when (not this) (set! this this) (goto cfg-4) @@ -38,19 +35,16 @@ ;; definition of type race-mesh-slice-query (deftype race-mesh-slice-query (structure) - ((slice-id int16 :offset-assert 0) - (lap-dist float :offset-assert 4) - (pt-on-slice vector :inline :offset-assert 16) - (slice-corners vector 4 :inline :offset-assert 32) - (search-sphere sphere :inline :offset-assert 96) + ((slice-id int16) + (lap-dist float) + (pt-on-slice vector :inline) + (slice-corners vector 4 :inline) + (search-sphere sphere :inline) ) - :method-count-assert 9 - :size-assert #x70 - :flag-assert #x900000070 ) ;; definition for method 3 of type race-mesh-slice-query -(defmethod inspect race-mesh-slice-query ((this race-mesh-slice-query)) +(defmethod inspect ((this race-mesh-slice-query)) (when (not this) (set! this this) (goto cfg-4) @@ -67,15 +61,12 @@ ;; definition of type race-path-edge-info (deftype race-path-edge-info (structure) - ((sample-t float :offset-assert 0) + ((sample-t float) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type race-path-edge-info -(defmethod inspect race-path-edge-info ((this race-path-edge-info)) +(defmethod inspect ((this race-path-edge-info)) (when (not this) (set! this this) (goto cfg-4) @@ -88,21 +79,18 @@ ;; definition of type race-path-sample (deftype race-path-sample (structure) - ((bytes uint8 32 :offset-assert 0) - (pos vector :inline :offset 0) - (quat quaternion :inline :offset 16) - (stick-x int8 :offset 12) - (stick-y int8 :offset 13) - (throttle uint8 :offset 14) - (flags uint8 :offset 15) + ((bytes uint8 32) + (pos vector :inline :overlay-at (-> bytes 0)) + (quat quaternion :inline :overlay-at (-> bytes 16)) + (stick-x int8 :overlay-at (-> bytes 12)) + (stick-y int8 :overlay-at (-> bytes 13)) + (throttle uint8 :overlay-at (-> bytes 14)) + (flags uint8 :overlay-at (-> bytes 15)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type race-path-sample -(defmethod inspect race-path-sample ((this race-path-sample)) +(defmethod inspect ((this race-path-sample)) (when (not this) (set! this this) (goto cfg-4) @@ -121,25 +109,22 @@ ;; definition of type race-path (deftype race-path (structure) - ((sample-count uint16 :offset-assert 0) - (record-id int8 :offset-assert 2) - (pad uint8 :offset-assert 3) - (samples (inline-array race-path-sample) :offset-assert 4) - (edge-infos (inline-array race-path-edge-info) :offset-assert 8) + ((sample-count uint16) + (record-id int8) + (pad uint8) + (samples (inline-array race-path-sample)) + (edge-infos (inline-array race-path-edge-info)) ) - :method-count-assert 13 - :size-assert #xc - :flag-assert #xd0000000c (:methods - (draw-path-debug (_type_ rgba rgba) none 9) - (race-path-method-10 (_type_ vector float float) none 10) - (race-path-method-11 (_type_ race-path-sample vector float) none 11) - (race-path-method-12 (_type_ vector float float) float 12) + (draw-path-debug (_type_ rgba rgba) none) + (race-path-method-10 (_type_ vector float float) none) + (race-path-method-11 (_type_ race-path-sample vector float) none) + (race-path-method-12 (_type_ vector float float) float) ) ) ;; definition for method 3 of type race-path -(defmethod inspect race-path ((this race-path)) +(defmethod inspect ((this race-path)) (when (not this) (set! this this) (goto cfg-4) @@ -156,18 +141,15 @@ ;; definition of type race-path-group (deftype race-path-group (structure) - ((name string :offset-assert 0) - (path-count int8 :offset-assert 4) - (pad uint8 3 :offset-assert 5) - (paths (inline-array race-path) :offset-assert 8) + ((name string) + (path-count int8) + (pad uint8 3) + (paths (inline-array race-path)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type race-path-group -(defmethod inspect race-path-group ((this race-path-group)) +(defmethod inspect ((this race-path-group)) (when (not this) (set! this this) (goto cfg-4) @@ -183,17 +165,14 @@ ;; definition of type race-mesh-edge (deftype race-mesh-edge (structure) - ((left vector :inline :offset-assert 0) - (right vector :inline :offset-assert 16) - (lap-dist float :offset 12) + ((left vector :inline) + (right vector :inline) + (lap-dist float :overlay-at (-> left data 3)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type race-mesh-edge -(defmethod inspect race-mesh-edge ((this race-mesh-edge)) +(defmethod inspect ((this race-mesh-edge)) (when (not this) (set! this this) (goto cfg-4) @@ -208,18 +187,15 @@ ;; definition of type race-mesh-slice (deftype race-mesh-slice (structure) - ((edge-index-array uint16 2 :offset-assert 0) - (start-edge int16 :offset 0) - (end-edge int16 :offset 2) + ((edge-index-array uint16 2) + (start-edge int16 :overlay-at (-> edge-index-array 0)) + (end-edge int16 :overlay-at (-> edge-index-array 1)) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type race-mesh-slice -(defmethod inspect race-mesh-slice ((this race-mesh-slice)) +(defmethod inspect ((this race-mesh-slice)) (when (not this) (set! this this) (goto cfg-4) @@ -234,17 +210,14 @@ ;; definition of type race-mesh-hash-cell (deftype race-mesh-hash-cell (structure) - ((first-slice int16 :offset-assert 0) - (slice-count uint8 :offset-assert 2) - (pad uint8 :offset-assert 3) + ((first-slice int16) + (slice-count uint8) + (pad uint8) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type race-mesh-hash-cell -(defmethod inspect race-mesh-hash-cell ((this race-mesh-hash-cell)) +(defmethod inspect ((this race-mesh-hash-cell)) (when (not this) (set! this this) (goto cfg-4) @@ -259,20 +232,17 @@ ;; definition of type race-mesh-hash (deftype race-mesh-hash (structure) - ((cells-wide int8 :offset-assert 0) - (cells-tall int8 :offset-assert 1) - (cell-length float :offset-assert 4) - (cells (inline-array race-mesh-hash-cell) :offset-assert 8) - (slice-table (inline-array race-mesh-slice) :offset-assert 12) - (origin vector :inline :offset-assert 16) + ((cells-wide int8) + (cells-tall int8) + (cell-length float) + (cells (inline-array race-mesh-hash-cell)) + (slice-table (inline-array race-mesh-slice)) + (origin vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type race-mesh-hash -(defmethod inspect race-mesh-hash ((this race-mesh-hash)) +(defmethod inspect ((this race-mesh-hash)) (when (not this) (set! this this) (goto cfg-4) @@ -290,37 +260,34 @@ ;; definition of type race-mesh (deftype race-mesh (basic) - ((version uint8 :offset-assert 4) - (path-group-count uint8 :offset-assert 5) - (flags race-mesh-flags :offset-assert 6) - (pad uint8 1 :offset-assert 7) - (slice-count int16 :offset-assert 8) - (edge-count int16 :offset-assert 10) - (slices (inline-array race-mesh-slice) :offset-assert 12) - (edges (inline-array race-mesh-edge) :offset-assert 16) - (hash race-mesh-hash :offset-assert 20) - (path-groups (inline-array race-path-group) :offset-assert 24) + ((version uint8) + (path-group-count uint8) + (flags race-mesh-flags) + (pad uint8 1) + (slice-count int16) + (edge-count int16) + (slices (inline-array race-mesh-slice)) + (edges (inline-array race-mesh-edge)) + (hash race-mesh-hash) + (path-groups (inline-array race-path-group)) ) - :method-count-assert 20 - :size-assert #x1c - :flag-assert #x140000001c (:methods - (debug-draw-path (_type_ int int rgba rgba) none 9) - (debug-draw-path-from-history (_type_ int int) symbol 10) - (debug-draw-slice (_type_ int) none 11) - (debug-draw-edges (_type_) none 12) - (race-mesh-method-13 (_type_ race-mesh-slice-query) none 13) - (race-mesh-method-14 (_type_ race-mesh-slice-query) none 14) - (race-mesh-method-15 (_type_ int race-mesh-slice-query) none 15) - (race-mesh-method-16 (_type_ race-mesh-slice-query) none 16) - (race-mesh-method-17 (_type_ race-mesh-slice-query) symbol 17) - (race-mesh-method-18 (_type_ race-mesh-hash-search int int race-mesh-slice-query) none 18) - (race-mesh-method-19 (_type_ int race-mesh-slice-query) symbol 19) + (debug-draw-path (_type_ int int rgba rgba) none) + (debug-draw-path-from-history (_type_ int int) symbol) + (debug-draw-slice (_type_ int) none) + (debug-draw-edges (_type_) none) + (race-mesh-method-13 (_type_ race-mesh-slice-query) none) + (race-mesh-method-14 (_type_ race-mesh-slice-query) none) + (race-mesh-method-15 (_type_ int race-mesh-slice-query) none) + (race-mesh-method-16 (_type_ race-mesh-slice-query) none) + (race-mesh-method-17 (_type_ race-mesh-slice-query) symbol) + (race-mesh-method-18 (_type_ race-mesh-hash-search int int race-mesh-slice-query) none) + (race-mesh-method-19 (_type_ int race-mesh-slice-query) symbol) ) ) ;; definition for method 3 of type race-mesh -(defmethod inspect race-mesh ((this race-mesh)) +(defmethod inspect ((this race-mesh)) (when (not this) (set! this this) (goto cfg-4) @@ -343,7 +310,7 @@ ;; definition for method 10 of type race-path ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod race-path-method-10 race-path ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod race-path-method-10 ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) (let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 4)) (a3-1 (the int arg1)) ) @@ -359,7 +326,7 @@ ;; definition for method 11 of type race-path ;; WARN: Return type mismatch int vs none. -(defmethod race-path-method-11 race-path ((this race-path) (arg0 race-path-sample) (arg1 vector) (arg2 float)) +(defmethod race-path-method-11 ((this race-path) (arg0 race-path-sample) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'race-path-sample 6))) (let ((f0-1 (the float (-> this sample-count)))) (if (< f0-1 arg2) @@ -408,7 +375,7 @@ ) ;; definition for method 12 of type race-path -(defmethod race-path-method-12 race-path ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod race-path-method-12 ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) (local-vars (v1-15 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -463,7 +430,7 @@ ;; definition for method 9 of type race-path ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-path-debug race-path ((this race-path) (arg0 rgba) (arg1 rgba)) +(defmethod draw-path-debug ((this race-path) (arg0 rgba) (arg1 rgba)) (let ((s1-0 0) (s3-0 1) (s2-0 (+ (-> this sample-count) -1)) @@ -492,7 +459,7 @@ ) ;; definition for method 9 of type race-mesh -(defmethod debug-draw-path race-mesh ((this race-mesh) (arg0 int) (arg1 int) (arg2 rgba) (arg3 rgba)) +(defmethod debug-draw-path ((this race-mesh) (arg0 int) (arg1 int) (arg2 rgba) (arg3 rgba)) (when (< arg1 (the-as int (-> this path-group-count))) (let ((v1-2 (-> this path-groups arg1))) (if (< arg0 (-> v1-2 path-count)) @@ -504,7 +471,7 @@ ) ;; definition for method 10 of type race-mesh -(defmethod debug-draw-path-from-history race-mesh ((this race-mesh) (arg0 int) (arg1 int)) +(defmethod debug-draw-path-from-history ((this race-mesh) (arg0 int) (arg1 int)) (when (< arg1 (the-as int (-> this path-group-count))) (let ((v1-2 (-> this path-groups arg1))) (countdown (a2-1 (-> v1-2 path-count)) @@ -544,7 +511,7 @@ ;; definition for method 11 of type race-mesh ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw-slice race-mesh ((this race-mesh) (arg0 int)) +(defmethod debug-draw-slice ((this race-mesh) (arg0 int)) (let* ((v1-1 (-> this slices arg0)) (s3-0 (-> this edges (-> v1-1 start-edge))) (s4-0 (-> this edges (-> v1-1 end-edge))) @@ -604,7 +571,7 @@ ;; definition for method 12 of type race-mesh ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-edges race-mesh ((this race-mesh)) +(defmethod debug-draw-edges ((this race-mesh)) (let ((idx 0) (slice-cnt (+ (-> this slice-count) -1)) ) @@ -659,7 +626,7 @@ ;; definition for method 19 of type race-mesh ;; INFO: Used lq/sq -(defmethod race-mesh-method-19 race-mesh ((this race-mesh) (arg0 int) (arg1 race-mesh-slice-query)) +(defmethod race-mesh-method-19 ((this race-mesh) (arg0 int) (arg1 race-mesh-slice-query)) (set! (-> arg1 slice-id) -1) (let* ((v1-2 (-> this slices arg0)) (a1-3 (-> this edges (-> v1-2 start-edge))) @@ -715,7 +682,7 @@ ) ;; definition for method 17 of type race-mesh -(defmethod race-mesh-method-17 race-mesh ((this race-mesh) (slice-query race-mesh-slice-query)) +(defmethod race-mesh-method-17 ((this race-mesh) (slice-query race-mesh-slice-query)) (set! (-> slice-query slice-id) -1) (let* ((race-hash (-> this hash)) (v1-2 @@ -768,7 +735,7 @@ ;; definition for method 15 of type race-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod race-mesh-method-15 race-mesh ((this race-mesh) (id int) (slice-query race-mesh-slice-query)) +(defmethod race-mesh-method-15 ((this race-mesh) (id int) (slice-query race-mesh-slice-query)) (local-vars (v1-8 symbol)) (set! (-> slice-query slice-id) id) (let* ((v1-1 (-> this slices id)) @@ -853,7 +820,7 @@ ;; definition for method 18 of type race-mesh ;; WARN: Return type mismatch symbol vs none. -(defmethod race-mesh-method-18 race-mesh ((this race-mesh) (arg0 race-mesh-hash-search) (arg1 int) (arg2 int) (arg3 race-mesh-slice-query)) +(defmethod race-mesh-method-18 ((this race-mesh) (arg0 race-mesh-hash-search) (arg1 int) (arg2 int) (arg3 race-mesh-slice-query)) (let* ((v1-3 (+ (* arg2 (-> this hash cells-wide)) arg1)) (a0-1 (/ v1-3 8)) (a1-2 (ash 1 (logand v1-3 7))) @@ -899,7 +866,7 @@ ;; definition for method 16 of type race-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod race-mesh-method-16 race-mesh ((this race-mesh) (arg0 race-mesh-slice-query)) +(defmethod race-mesh-method-16 ((this race-mesh) (arg0 race-mesh-slice-query)) (set! (-> arg0 slice-id) -1) (let ((s4-0 (-> this hash)) (s3-0 (new 'stack-no-clear 'race-mesh-hash-search)) @@ -980,7 +947,7 @@ ;; definition for method 14 of type race-mesh ;; WARN: Return type mismatch float vs none. -(defmethod race-mesh-method-14 race-mesh ((this race-mesh) (arg0 race-mesh-slice-query)) +(defmethod race-mesh-method-14 ((this race-mesh) (arg0 race-mesh-slice-query)) (let* ((f30-0 (vector-line-distance-point! (-> arg0 pt-on-slice) (the-as vector (-> arg0 slice-corners)) @@ -1007,7 +974,7 @@ ;; definition for method 13 of type race-mesh ;; WARN: Return type mismatch int vs none. -(defmethod race-mesh-method-13 race-mesh ((this race-mesh) (arg0 race-mesh-slice-query)) +(defmethod race-mesh-method-13 ((this race-mesh) (arg0 race-mesh-slice-query)) (race-mesh-method-17 this arg0) (if (and (= (-> arg0 slice-id) -1) (< 0.0 (-> arg0 search-sphere r))) (race-mesh-method-16 this arg0) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-obs_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-obs_REF.gc index aab555cab9f..20a6fdf7a16 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-obs_REF.gc @@ -16,17 +16,13 @@ ;; definition of type race-signal-banner (deftype race-signal-banner (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type race-signal-banner -(defmethod inspect race-signal-banner ((this race-signal-banner)) +(defmethod inspect ((this race-signal-banner)) (when (not this) (set! this this) (goto cfg-4) @@ -89,34 +85,32 @@ ;; definition of type race-signal (deftype race-signal (process-drawable) - ((pos vector :inline :offset-assert 208) - (y-offset float :offset-assert 224) - (dest-y-offset float :offset-assert 228) - (bob-time time-frame :offset-assert 232) - (start-time time-frame :offset-assert 240) - (banner handle :offset-assert 248) - (curve cubic-curve :inline :offset-assert 256) + ((pos vector :inline) + (y-offset float) + (dest-y-offset float) + (bob-time time-frame) + (start-time time-frame) + (banner handle) + (curve cubic-curve :inline) ) - :heap-base #xc0 - :method-count-assert 30 - :size-assert #x140 - :flag-assert #x1e00c00140 + (:state-methods + spawn-banner + idle + count-3 + count-2 + count-1 + count-go + die + test + ) (:methods - (spawn-banner () _type_ :state 20) - (idle () _type_ :state 21) - (count-3 () _type_ :state 22) - (count-2 () _type_ :state 23) - (count-1 () _type_ :state 24) - (count-go () _type_ :state 25) - (die () _type_ :state 26) - (test () _type_ :state 27) - (race-signal-method-28 (_type_) none 28) - (race-signal-method-29 (_type_) none 29) + (race-signal-method-28 (_type_) none) + (race-signal-method-29 (_type_) none) ) ) ;; definition for method 3 of type race-signal -(defmethod inspect race-signal ((this race-signal)) +(defmethod inspect ((this race-signal)) (when (not this) (set! this this) (goto cfg-4) @@ -138,7 +132,7 @@ ;; definition for method 29 of type race-signal ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod race-signal-method-29 race-signal ((this race-signal)) +(defmethod race-signal-method-29 ((this race-signal)) (+! (-> this y-offset) (* (- (-> this dest-y-offset) (-> this y-offset)) (fmin 1.0 (* 2.0 (seconds-per-frame)))) ) @@ -426,16 +420,12 @@ ;; definition of type stadium-racer (deftype stadium-racer (vehicle-rider) - ((rider-type uint8 :offset-assert 221) + ((rider-type uint8) ) - :heap-base #x60 - :method-count-assert 36 - :size-assert #xde - :flag-assert #x24006000de ) ;; definition for method 3 of type stadium-racer -(defmethod inspect stadium-racer ((this stadium-racer)) +(defmethod inspect ((this stadium-racer)) (when (not this) (set! this this) (goto cfg-4) @@ -456,7 +446,7 @@ ;; definition for method 33 of type stadium-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-33 stadium-racer ((this stadium-racer)) +(defmethod vehicle-rider-method-33 ((this stadium-racer)) (let ((t9-0 (method-of-type vehicle-rider vehicle-rider-method-33))) (t9-0 this) ) @@ -585,7 +575,7 @@ ;; definition for method 31 of type stadium-racer ;; WARN: Return type mismatch int vs none. -(defmethod initialize-collision stadium-racer ((this stadium-racer)) +(defmethod initialize-collision ((this stadium-racer)) (set! (-> this level) (level-get *level* 'lracelit)) (stack-size-set! (-> this main-thread) 256) (when (not (-> this level)) @@ -599,7 +589,7 @@ ;; definition for method 32 of type stadium-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-32 stadium-racer ((this stadium-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 ((this stadium-racer) (arg0 traffic-object-spawn-params)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-stadium-racer" (the-as (pointer uint32) #f))) @@ -649,14 +639,10 @@ ;; definition of type errol-rider (deftype errol-rider (stadium-racer) () - :heap-base #x60 - :method-count-assert 36 - :size-assert #xde - :flag-assert #x24006000de ) ;; definition for method 3 of type errol-rider -(defmethod inspect errol-rider ((this errol-rider)) +(defmethod inspect ((this errol-rider)) (when (not this) (set! this this) (goto cfg-4) @@ -688,7 +674,7 @@ ;; definition for method 33 of type errol-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-33 errol-rider ((this errol-rider)) +(defmethod vehicle-rider-method-33 ((this errol-rider)) (let ((t9-0 (method-of-type vehicle-rider vehicle-rider-method-33))) (t9-0 this) ) @@ -703,22 +689,20 @@ ;; definition of type turbo-pickup (deftype turbo-pickup (process-drawable) - ((root collide-shape-moving :override) - (available symbol :offset-assert 200) + ((root collide-shape-moving :override) + (available symbol) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xcc - :flag-assert #x17005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (find-ground (_type_) symbol 22) + (find-ground (_type_) symbol) ) ) ;; definition for method 3 of type turbo-pickup -(defmethod inspect turbo-pickup ((this turbo-pickup)) +(defmethod inspect ((this turbo-pickup)) (when (not this) (set! this this) (goto cfg-4) @@ -733,7 +717,7 @@ ;; definition for method 22 of type turbo-pickup ;; INFO: Used lq/sq -(defmethod find-ground turbo-pickup ((this turbo-pickup)) +(defmethod find-ground ((this turbo-pickup)) (let ((s4-0 #f)) (let ((gp-0 (new 'stack-no-clear 'do-push-aways-work))) (set! (-> gp-0 push-vel quad) (-> this root trans quad)) diff --git a/test/decompiler/reference/jak2/levels/common/race/vehicle-racer_REF.gc b/test/decompiler/reference/jak2/levels/common/race/vehicle-racer_REF.gc index 7c6c863dfe4..b92ccbf0631 100644 --- a/test/decompiler/reference/jak2/levels/common/race/vehicle-racer_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/vehicle-racer_REF.gc @@ -3,30 +3,27 @@ ;; definition of type race-control (deftype race-control (structure) - ((state race-state :offset-assert 0) - (mesh race-mesh :offset-assert 4) - (path-select int8 :offset-assert 8) - (path-group race-path-group :offset-assert 12) - (path race-path :offset-assert 16) - (path-t float :offset-assert 20) - (racer-state racer-state :offset-assert 24) - (path-sample race-path-sample :inline :offset-assert 32) - (lin-velocity vector :inline :offset-assert 64) - (ang-velocity vector :inline :offset-assert 80) + ((state race-state) + (mesh race-mesh) + (path-select int8) + (path-group race-path-group) + (path race-path) + (path-t float) + (racer-state racer-state) + (path-sample race-path-sample :inline) + (lin-velocity vector :inline) + (ang-velocity vector :inline) ) - :method-count-assert 13 - :size-assert #x60 - :flag-assert #xd00000060 (:methods - (race-control-method-9 (_type_ int vector) none 9) - (race-control-method-10 (_type_ race-state racer-state) none 10) - (race-control-method-11 (_type_ float) none 11) - (race-control-method-12 (_type_ vector) none 12) + (race-control-method-9 (_type_ int vector) none) + (race-control-method-10 (_type_ race-state racer-state) none) + (race-control-method-11 (_type_ float) none) + (race-control-method-12 (_type_ vector) none) ) ) ;; definition for method 3 of type race-control -(defmethod inspect race-control ((this race-control)) +(defmethod inspect ((this race-control)) (when (not this) (set! this this) (goto cfg-4) @@ -48,7 +45,7 @@ ;; definition for method 12 of type race-control ;; WARN: Return type mismatch int vs none. -(defmethod race-control-method-12 race-control ((this race-control) (arg0 vector)) +(defmethod race-control-method-12 ((this race-control) (arg0 vector)) (let* ((f0-0 (-> this path-t)) (f0-2 (race-path-method-12 (-> this path) arg0 (+ -1.0 f0-0) (+ 1.0 f0-0))) ) @@ -61,7 +58,7 @@ ;; definition for method 11 of type race-control ;; WARN: Return type mismatch int vs none. -(defmethod race-control-method-11 race-control ((this race-control) (arg0 float)) +(defmethod race-control-method-11 ((this race-control) (arg0 float)) (let ((f0-1 (+ (-> this path-t) (* 15.0 arg0)))) (set! f0-1 (cond ((logtest? (-> this mesh flags) (race-mesh-flags racemeshflag-0)) @@ -88,7 +85,7 @@ ;; definition for method 9 of type race-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod race-control-method-9 race-control ((this race-control) (arg0 int) (arg1 vector)) +(defmethod race-control-method-9 ((this race-control) (arg0 int) (arg1 vector)) (let ((v1-1 (-> this path-group path-count))) (if (>= arg0 v1-1) (set! arg0 0) @@ -131,7 +128,7 @@ ;; definition for method 10 of type race-control ;; WARN: Return type mismatch int vs none. -(defmethod race-control-method-10 race-control ((this race-control) (arg0 race-state) (arg1 racer-state)) +(defmethod race-control-method-10 ((this race-control) (arg0 race-state) (arg1 racer-state)) (set! (-> this state) arg0) (set! (-> this mesh) (-> arg0 info mesh)) (if (-> this mesh) @@ -144,37 +141,35 @@ ;; definition of type vehicle-racer (deftype vehicle-racer (vehicle) - ((race race-control :inline :offset-assert 880) - (ai-controls vehicle-controls :inline :offset-assert 976) - (rider-hand-joint int8 :offset-assert 992) - (turbo-pickup-count int8 :offset-assert 993) - (minimap connection-minimap :offset-assert 996) - (shortcut-speed-factor float :offset-assert 1000) - (path-deviation float :offset-assert 1004) - (shortcut-time time-frame :offset-assert 1008) + ((race race-control :inline) + (ai-controls vehicle-controls :inline) + (rider-hand-joint int8) + (turbo-pickup-count int8) + (minimap connection-minimap) + (shortcut-speed-factor float) + (path-deviation float) + (shortcut-time time-frame) ) - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3f8 - :flag-assert #x9c038003f8 + (:state-methods + waiting-race + waiting-for-start + racing + race-finished + ) (:methods - (waiting-race () _type_ :state 144) - (waiting-for-start () _type_ :state 145) - (racing () _type_ :state 146) - (race-finished () _type_ :state 147) - (vehicle-racer-method-148 (_type_ race-path race-mesh-slice) none 148) - (vehicle-racer-method-149 (_type_) none 149) - (select-path-randomly-from-mask (_type_ uint) none 150) - (vehicle-racer-method-151 (_type_) none 151) - (vehicle-racer-method-152 (_type_) none 152) - (physics-post (_type_) none 153) - (vehicle-racer-method-154 (_type_) none 154) - (vehicle-racer-method-155 (_type_) none 155) + (vehicle-racer-method-148 (_type_ race-path race-mesh-slice) none) + (vehicle-racer-method-149 (_type_) none) + (select-path-randomly-from-mask (_type_ uint) none) + (vehicle-racer-method-151 (_type_) none) + (vehicle-racer-method-152 (_type_) none) + (physics-post (_type_) none) + (vehicle-racer-method-154 (_type_) none) + (vehicle-racer-method-155 (_type_) none) ) ) ;; definition for method 3 of type vehicle-racer -(defmethod inspect vehicle-racer ((this vehicle-racer)) +(defmethod inspect ((this vehicle-racer)) (when (not this) (set! this this) (goto cfg-4) @@ -196,7 +191,7 @@ ;; definition for method 117 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-117 vehicle-racer ((this vehicle-racer) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 ((this vehicle-racer) (arg0 vector) (arg1 int) (arg2 int)) (vector-matrix*! arg0 (-> this info rider-hand-offset arg2) @@ -208,7 +203,7 @@ ;; definition for method 137 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-137 vehicle-racer ((this vehicle-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-137 ((this vehicle-racer) (arg0 traffic-object-spawn-params)) (let ((t9-0 vehicle-rider-spawn) (v1-0 (-> arg0 user-data)) ) @@ -228,7 +223,7 @@ ;; definition for method 148 of type vehicle-racer ;; INFO: Used lq/sq ;; WARN: Return type mismatch number vs none. -(defmethod vehicle-racer-method-148 vehicle-racer ((this vehicle-racer) (arg0 race-path) (arg1 race-mesh-slice)) +(defmethod vehicle-racer-method-148 ((this vehicle-racer) (arg0 race-path) (arg1 race-mesh-slice)) (let ((f26-0 (the-as number 0.0)) (gp-0 (new 'stack-no-clear 'vehicle-physics-work)) (f30-0 (-> (the-as (pointer float) (+ (* (-> arg1 start-edge) 4) (the-as int (-> arg0 edge-infos)))))) @@ -292,7 +287,7 @@ ;; definition for method 120 of type vehicle-racer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-120 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-method-120 ((this vehicle-racer)) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (set! (-> *game-info* race-number-turbos) (-> this turbo-pickup-count)) 0 @@ -316,7 +311,7 @@ ;; definition for method 66 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-66 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-method-66 ((this vehicle-racer)) (when (and (not (logtest? (rigid-body-object-flag turbo-boost) (-> this flags))) (> (-> this turbo-pickup-count) 0)) (+! (-> this turbo-pickup-count) -1) (set-time! (-> this turbo-boost-time)) @@ -333,7 +328,7 @@ ;; definition for method 136 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-136 vehicle-racer ((this vehicle-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-136 ((this vehicle-racer) (arg0 traffic-object-spawn-params)) (set! (-> this draw lod-set lod 1 dist) 819200.0) (set! (-> this draw lod-set lod 2 dist) 1228800.0) (let* ((a1-1 *race-state*) @@ -381,7 +376,7 @@ ;; definition for method 138 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-138 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-method-138 ((this vehicle-racer)) (if (focus-test? this grabbed) (go (method-of-object this waiting-for-start)) (go (method-of-object this player-control)) @@ -392,7 +387,7 @@ ;; definition for method 45 of type vehicle-racer ;; WARN: Return type mismatch symbol vs none. -(defmethod rigid-body-object-method-45 vehicle-racer ((this vehicle-racer) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 ((this vehicle-racer) (arg0 rigid-body-impact)) (let ((t9-0 (method-of-type vehicle rigid-body-object-method-45))) (t9-0 this arg0) ) @@ -418,7 +413,7 @@ ;; definition for method 46 of type vehicle-racer ;; WARN: disable def twice: 12. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod rigid-body-object-method-46 vehicle-racer ((this vehicle-racer) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 ((this vehicle-racer) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('test-ready) (and (and (-> this next-state) (= (-> this next-state name) 'waiting-for-start)) @@ -541,7 +536,7 @@ ;; definition for method 150 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod select-path-randomly-from-mask vehicle-racer ((this vehicle-racer) (arg0 uint)) +(defmethod select-path-randomly-from-mask ((this vehicle-racer) (arg0 uint)) (let ((a0-1 0) (v1-0 0) (s5-0 (new 'stack-no-clear 'array 'int8 12)) @@ -568,7 +563,7 @@ ;; definition for method 151 of type vehicle-racer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-racer-method-151 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-racer-method-151 ((this vehicle-racer)) (local-vars (v1-18 float) (v1-28 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -727,7 +722,7 @@ ;; definition for method 153 of type vehicle-racer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod physics-post vehicle-racer ((this vehicle-racer)) +(defmethod physics-post ((this vehicle-racer)) (local-vars (v1-35 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -863,7 +858,7 @@ ;; definition for method 154 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-racer-method-154 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-racer-method-154 ((this vehicle-racer)) (cond ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) (if (and (logtest? (-> this flags) (rigid-body-object-flag on-ground)) @@ -906,7 +901,7 @@ ;; definition for method 152 of type vehicle-racer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-racer-method-152 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-racer-method-152 ((this vehicle-racer)) (let ((s5-0 (new 'stack-no-clear 'matrix3))) (set! (-> s5-0 vector 0 quad) (-> this rbody state position quad)) (set! (-> this camera-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (camera-pos))) @@ -927,7 +922,7 @@ ;; definition for method 155 of type vehicle-racer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-racer-method-155 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-racer-method-155 ((this vehicle-racer)) (let ((s5-0 (new 'stack-no-clear 'matrix3))) (set! (-> s5-0 vector 0 quad) (-> this rbody state position quad)) (set! (-> this camera-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (camera-pos))) @@ -950,7 +945,7 @@ ;; definition for method 124 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-124 vehicle-racer ((this vehicle-racer)) +(defmethod vehicle-method-124 ((this vehicle-racer)) (cond ((and (logtest? (rigid-body-object-flag player-grabbed) (-> this flags)) (-> this race path)) (vehicle-racer-method-155 this) diff --git a/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc b/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc index 1a5c181dd36..46fc80f3c2b 100644 --- a/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc @@ -304,14 +304,10 @@ ;; definition of type kor-npc (deftype kor-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type kor-npc -(defmethod inspect kor-npc ((this kor-npc)) +(defmethod inspect ((this kor-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -324,7 +320,7 @@ ) ;; definition for method 35 of type kor-npc -(defmethod get-art-elem kor-npc ((this kor-npc)) +(defmethod get-art-elem ((this kor-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -339,7 +335,7 @@ ;; definition for method 33 of type kor-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! kor-npc ((this kor-npc)) +(defmethod init-art! ((this kor-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -354,17 +350,13 @@ ;; definition of type metalkor-highres (deftype metalkor-highres (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type metalkor-highres -(defmethod inspect metalkor-highres ((this metalkor-highres)) +(defmethod inspect ((this metalkor-highres)) (when (not this) (set! this this) (goto cfg-4) @@ -394,7 +386,7 @@ ;; definition for method 11 of type metalkor-highres ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! metalkor-highres ((this metalkor-highres) (arg0 entity-actor)) +(defmethod init-from-entity! ((this metalkor-highres) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -461,14 +453,10 @@ This commonly includes things such as: ;; definition of type tess-npc (deftype tess-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type tess-npc -(defmethod inspect tess-npc ((this tess-npc)) +(defmethod inspect ((this tess-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -481,7 +469,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type tess-npc -(defmethod get-art-elem tess-npc ((this tess-npc)) +(defmethod get-art-elem ((this tess-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -520,7 +508,7 @@ This commonly includes things such as: ;; definition for method 33 of type tess-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! tess-npc ((this tess-npc)) +(defmethod init-art! ((this tess-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -535,14 +523,10 @@ This commonly includes things such as: ;; definition of type keira-npc (deftype keira-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type keira-npc -(defmethod inspect keira-npc ((this keira-npc)) +(defmethod inspect ((this keira-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -555,7 +539,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type keira-npc -(defmethod get-art-elem keira-npc ((this keira-npc)) +(defmethod get-art-elem ((this keira-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -570,7 +554,7 @@ This commonly includes things such as: ;; definition for method 33 of type keira-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! keira-npc ((this keira-npc)) +(defmethod init-art! ((this keira-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -585,14 +569,10 @@ This commonly includes things such as: ;; definition of type krew-npc (deftype krew-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type krew-npc -(defmethod inspect krew-npc ((this krew-npc)) +(defmethod inspect ((this krew-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -605,7 +585,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type krew-npc -(defmethod get-art-elem krew-npc ((this krew-npc)) +(defmethod get-art-elem ((this krew-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (-> this draw art-group data 4) @@ -613,7 +593,7 @@ This commonly includes things such as: ;; definition for method 33 of type krew-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! krew-npc ((this krew-npc)) +(defmethod init-art! ((this krew-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -628,14 +608,10 @@ This commonly includes things such as: ;; definition of type kid-npc (deftype kid-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type kid-npc -(defmethod inspect kid-npc ((this kid-npc)) +(defmethod inspect ((this kid-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -649,7 +625,7 @@ This commonly includes things such as: ;; definition for method 33 of type kid-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! kid-npc ((this kid-npc)) +(defmethod init-art! ((this kid-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -662,7 +638,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type kid-npc -(defmethod get-art-elem kid-npc ((this kid-npc)) +(defmethod get-art-elem ((this kid-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -684,14 +660,10 @@ This commonly includes things such as: ;; definition of type crocadog-npc (deftype crocadog-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type crocadog-npc -(defmethod inspect crocadog-npc ((this crocadog-npc)) +(defmethod inspect ((this crocadog-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -704,7 +676,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type crocadog-npc -(defmethod get-art-elem crocadog-npc ((this crocadog-npc)) +(defmethod get-art-elem ((this crocadog-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -722,7 +694,7 @@ This commonly includes things such as: ;; definition for method 33 of type crocadog-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! crocadog-npc ((this crocadog-npc)) +(defmethod init-art! ((this crocadog-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -737,14 +709,10 @@ This commonly includes things such as: ;; definition of type torn-npc (deftype torn-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type torn-npc -(defmethod inspect torn-npc ((this torn-npc)) +(defmethod inspect ((this torn-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -758,7 +726,7 @@ This commonly includes things such as: ;; definition for method 33 of type torn-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! torn-npc ((this torn-npc)) +(defmethod init-art! ((this torn-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -771,7 +739,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type torn-npc -(defmethod get-art-elem torn-npc ((this torn-npc)) +(defmethod get-art-elem ((this torn-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (cond @@ -788,7 +756,7 @@ This commonly includes things such as: ) ;; definition for method 20 of type torn-npc -(defmethod get-trans torn-npc ((this torn-npc) (arg0 int)) +(defmethod get-trans ((this torn-npc) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (let ((v1-0 (-> this root))) (if (= arg0 2) @@ -801,14 +769,10 @@ This commonly includes things such as: ;; definition of type youngsamos-npc (deftype youngsamos-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type youngsamos-npc -(defmethod inspect youngsamos-npc ((this youngsamos-npc)) +(defmethod inspect ((this youngsamos-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -822,7 +786,7 @@ This commonly includes things such as: ;; definition for method 33 of type youngsamos-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! youngsamos-npc ((this youngsamos-npc)) +(defmethod init-art! ((this youngsamos-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -838,7 +802,7 @@ This commonly includes things such as: ;; definition for method 32 of type youngsamos-npc ;; INFO: Used lq/sq -(defmethod process-taskable-method-32 youngsamos-npc ((this youngsamos-npc)) +(defmethod process-taskable-method-32 ((this youngsamos-npc)) (case (-> this task actor) (((game-task-actor youngsamos-forest)) (when (not (task-node-closed? (game-task-node forest-protect-resolution))) @@ -866,7 +830,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type youngsamos-npc -(defmethod get-art-elem youngsamos-npc ((this youngsamos-npc)) +(defmethod get-art-elem ((this youngsamos-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -897,14 +861,10 @@ This commonly includes things such as: ;; definition of type samos-npc (deftype samos-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type samos-npc -(defmethod inspect samos-npc ((this samos-npc)) +(defmethod inspect ((this samos-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -918,7 +878,7 @@ This commonly includes things such as: ;; definition for method 33 of type samos-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! samos-npc ((this samos-npc)) +(defmethod init-art! ((this samos-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -931,7 +891,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type samos-npc -(defmethod get-art-elem samos-npc ((this samos-npc)) +(defmethod get-art-elem ((this samos-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -950,14 +910,10 @@ This commonly includes things such as: ;; definition of type onin-npc (deftype onin-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type onin-npc -(defmethod inspect onin-npc ((this onin-npc)) +(defmethod inspect ((this onin-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -971,7 +927,7 @@ This commonly includes things such as: ;; definition for method 33 of type onin-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! onin-npc ((this onin-npc)) +(defmethod init-art! ((this onin-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -984,7 +940,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type onin-npc -(defmethod get-art-elem onin-npc ((this onin-npc)) +(defmethod get-art-elem ((this onin-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (let ((v1-1 (get-current-task-event (-> this task)))) @@ -1037,14 +993,10 @@ This commonly includes things such as: ;; definition of type pecker-npc (deftype pecker-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type pecker-npc -(defmethod inspect pecker-npc ((this pecker-npc)) +(defmethod inspect ((this pecker-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -1058,7 +1010,7 @@ This commonly includes things such as: ;; definition for method 33 of type pecker-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! pecker-npc ((this pecker-npc)) +(defmethod init-art! ((this pecker-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -1071,7 +1023,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type pecker-npc -(defmethod get-art-elem pecker-npc ((this pecker-npc)) +(defmethod get-art-elem ((this pecker-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (local-vars (s5-0 art-joint-anim) (f30-0 float)) @@ -1120,14 +1072,10 @@ This commonly includes things such as: ;; definition of type brutter-npc (deftype brutter-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type brutter-npc -(defmethod inspect brutter-npc ((this brutter-npc)) +(defmethod inspect ((this brutter-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -1141,7 +1089,7 @@ This commonly includes things such as: ;; definition for method 33 of type brutter-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! brutter-npc ((this brutter-npc)) +(defmethod init-art! ((this brutter-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -1156,14 +1104,10 @@ This commonly includes things such as: ;; definition of type ashelin-npc (deftype ashelin-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type ashelin-npc -(defmethod inspect ashelin-npc ((this ashelin-npc)) +(defmethod inspect ((this ashelin-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -1177,7 +1121,7 @@ This commonly includes things such as: ;; definition for method 33 of type ashelin-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! ashelin-npc ((this ashelin-npc)) +(defmethod init-art! ((this ashelin-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -1190,7 +1134,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type ashelin-npc -(defmethod get-art-elem ashelin-npc ((this ashelin-npc)) +(defmethod get-art-elem ((this ashelin-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -1209,14 +1153,10 @@ This commonly includes things such as: ;; definition of type daxter-npc (deftype daxter-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type daxter-npc -(defmethod inspect daxter-npc ((this daxter-npc)) +(defmethod inspect ((this daxter-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -1230,7 +1170,7 @@ This commonly includes things such as: ;; definition for method 33 of type daxter-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! daxter-npc ((this daxter-npc)) +(defmethod init-art! ((this daxter-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -1243,7 +1183,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type daxter-npc -(defmethod get-art-elem daxter-npc ((this daxter-npc)) +(defmethod get-art-elem ((this daxter-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (-> this draw art-group data 3) diff --git a/test/decompiler/reference/jak2/levels/common/scene-looper_REF.gc b/test/decompiler/reference/jak2/levels/common/scene-looper_REF.gc index 4ef4a36770d..eebe2c02347 100644 --- a/test/decompiler/reference/jak2/levels/common/scene-looper_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/scene-looper_REF.gc @@ -6,19 +6,15 @@ ;; definition of type scene-looper (deftype scene-looper (process) - ((scene-name symbol :offset-assert 128) + ((scene-name symbol) ) - :heap-base #x10 - :method-count-assert 15 - :size-assert #x84 - :flag-assert #xf00100084 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) ;; definition for method 3 of type scene-looper -(defmethod inspect scene-looper ((this scene-looper)) +(defmethod inspect ((this scene-looper)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc index 2f7d024a4e1..6804d2cc958 100644 --- a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc @@ -472,34 +472,32 @@ ;; definition of type warp-gate (deftype warp-gate (process-drawable) - ((root collide-shape :override) - (level-name uint32 :offset-assert 200) - (on-notice pair :offset-assert 204) - (on-activate pair :offset-assert 208) - (on-close pair :offset-assert 212) - (wait-for pair :offset-assert 216) - (continue continue-point :offset-assert 220) - (distance meters :offset-assert 224) - (anim-speed float :offset-assert 228) - (test-time time-frame :offset-assert 232) - (center vector :inline :offset-assert 240) + ((root collide-shape :override) + (level-name uint32) + (on-notice pair) + (on-activate pair) + (on-close pair) + (wait-for pair) + (continue continue-point) + (distance meters) + (anim-speed float) + (test-time time-frame) + (center vector :inline) ) - :heap-base #x80 - :method-count-assert 26 - :size-assert #x100 - :flag-assert #x1a00800100 + (:state-methods + idle + (use continue-point) + hidden + ) (:methods - (idle () _type_ :state 20) - (use (continue-point) _type_ :state 21) - (hidden () _type_ :state 22) - (init-skel-and-collide (_type_) none 23) - (setup-fields (_type_) none 24) - (handle-notice (_type_) continue-point 25) + (init-skel-and-collide (_type_) none) + (setup-fields (_type_) none) + (handle-notice (_type_) continue-point) ) ) ;; definition for method 3 of type warp-gate -(defmethod inspect warp-gate ((this warp-gate)) +(defmethod inspect ((this warp-gate)) (when (not this) (set! this this) (goto cfg-4) @@ -522,7 +520,7 @@ ) ;; definition for method 25 of type warp-gate -(defmethod handle-notice warp-gate ((this warp-gate)) +(defmethod handle-notice ((this warp-gate)) (let ((s5-0 (script-eval (-> this on-notice)))) (cond ((= s5-0 'hide) @@ -758,7 +756,7 @@ ;; definition for method 23 of type warp-gate ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-skel-and-collide warp-gate ((this warp-gate)) +(defmethod init-skel-and-collide ((this warp-gate)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -787,7 +785,7 @@ ;; definition for method 24 of type warp-gate ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod setup-fields warp-gate ((this warp-gate)) +(defmethod setup-fields ((this warp-gate)) (set! (-> this level-name) (the-as uint (-> this level name))) (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice pair)) (set! (-> this on-activate) #f) @@ -823,7 +821,7 @@ ) ;; definition for method 11 of type warp-gate -(defmethod init-from-entity! warp-gate ((this warp-gate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this warp-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1134,21 +1132,17 @@ This commonly includes things such as: ;; definition of type air-train (deftype air-train (warp-gate) "NOTE - I guess this is why sometimes the air-train makes the warp-gate sound" - ((part-exhaust-left sparticle-launch-control :offset-assert 256) - (part-exhaust-right sparticle-launch-control :offset-assert 260) - (part-dust sparticle-launch-control :offset-assert 264) - (dust-y float :offset-assert 268) - (hover-sound sound-id :offset-assert 272) - (base-pos vector :inline :offset-assert 288) + ((part-exhaust-left sparticle-launch-control) + (part-exhaust-right sparticle-launch-control) + (part-dust sparticle-launch-control) + (dust-y float) + (hover-sound sound-id) + (base-pos vector :inline) ) - :heap-base #xb0 - :method-count-assert 26 - :size-assert #x130 - :flag-assert #x1a00b00130 ) ;; definition for method 3 of type air-train -(defmethod inspect air-train ((this air-train)) +(defmethod inspect ((this air-train)) (when (not this) (set! this this) (goto cfg-4) @@ -1168,7 +1162,7 @@ This commonly includes things such as: ;; definition for method 7 of type air-train ;; WARN: Return type mismatch warp-gate vs air-train. -(defmethod relocate air-train ((this air-train) (arg0 int)) +(defmethod relocate ((this air-train) (arg0 int)) (if (nonzero? (-> this part-exhaust-left)) (&+! (-> this part-exhaust-left) arg0) ) @@ -1182,7 +1176,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type air-train -(defmethod deactivate air-train ((this air-train)) +(defmethod deactivate ((this air-train)) (sound-stop (-> this hover-sound)) (if (nonzero? (-> this part-exhaust-left)) (kill-and-free-particles (-> this part-exhaust-left)) @@ -1199,7 +1193,7 @@ This commonly includes things such as: ;; definition for method 23 of type air-train ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-skel-and-collide air-train ((this air-train)) +(defmethod init-skel-and-collide ((this air-train)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1248,7 +1242,7 @@ This commonly includes things such as: ;; definition for method 24 of type air-train ;; INFO: Used lq/sq ;; WARN: Return type mismatch sound-id vs none. -(defmethod setup-fields air-train ((this air-train)) +(defmethod setup-fields ((this air-train)) (let ((t9-0 (method-of-type warp-gate setup-fields))) (t9-0 this) ) diff --git a/test/decompiler/reference/jak2/levels/consite/consite-obs_REF.gc b/test/decompiler/reference/jak2/levels/consite/consite-obs_REF.gc index 9d041e06c58..a1ad3ec70e1 100644 --- a/test/decompiler/reference/jak2/levels/consite/consite-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/consite/consite-obs_REF.gc @@ -10,17 +10,13 @@ ;; definition of type consite-break-scaffold (deftype consite-break-scaffold (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type consite-break-scaffold -(defmethod inspect consite-break-scaffold ((this consite-break-scaffold)) +(defmethod inspect ((this consite-break-scaffold)) (when (not this) (set! this this) (goto cfg-4) @@ -40,7 +36,7 @@ ;; definition for method 11 of type consite-break-scaffold ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-break-scaffold ((this consite-break-scaffold) (arg0 entity-actor)) +(defmethod init-from-entity! ((this consite-break-scaffold) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -74,17 +70,13 @@ This commonly includes things such as: ;; definition of type consite-bomb-elevator-hinges (deftype consite-bomb-elevator-hinges (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type consite-bomb-elevator-hinges -(defmethod inspect consite-bomb-elevator-hinges ((this consite-bomb-elevator-hinges)) +(defmethod inspect ((this consite-bomb-elevator-hinges)) (when (not this) (set! this this) (goto cfg-4) @@ -121,7 +113,7 @@ This commonly includes things such as: ;; definition for method 11 of type consite-bomb-elevator-hinges ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-bomb-elevator-hinges ((this consite-bomb-elevator-hinges) (arg0 entity-actor)) +(defmethod init-from-entity! ((this consite-bomb-elevator-hinges) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -162,17 +154,13 @@ This commonly includes things such as: ;; definition of type consite-bomb-elevator (deftype consite-bomb-elevator (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type consite-bomb-elevator -(defmethod inspect consite-bomb-elevator ((this consite-bomb-elevator)) +(defmethod inspect ((this consite-bomb-elevator)) (when (not this) (set! this this) (goto cfg-4) @@ -209,7 +197,7 @@ This commonly includes things such as: ;; definition for method 11 of type consite-bomb-elevator ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-bomb-elevator ((this consite-bomb-elevator) (arg0 entity-actor)) +(defmethod init-from-entity! ((this consite-bomb-elevator) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -256,17 +244,13 @@ This commonly includes things such as: ;; definition of type consite-silo-doors (deftype consite-silo-doors (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type consite-silo-doors -(defmethod inspect consite-silo-doors ((this consite-silo-doors)) +(defmethod inspect ((this consite-silo-doors)) (when (not this) (set! this this) (goto cfg-4) @@ -303,7 +287,7 @@ This commonly includes things such as: ;; definition for method 11 of type consite-silo-doors ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-silo-doors ((this consite-silo-doors) (arg0 entity-actor)) +(defmethod init-from-entity! ((this consite-silo-doors) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -361,14 +345,10 @@ This commonly includes things such as: ;; definition of type baron-npc (deftype baron-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type baron-npc -(defmethod inspect baron-npc ((this baron-npc)) +(defmethod inspect ((this baron-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -381,7 +361,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type baron-npc -(defmethod get-art-elem baron-npc ((this baron-npc)) +(defmethod get-art-elem ((this baron-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) @@ -396,7 +376,7 @@ This commonly includes things such as: ;; definition for method 33 of type baron-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! baron-npc ((this baron-npc)) +(defmethod init-art! ((this baron-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/consite/consite-part_REF.gc b/test/decompiler/reference/jak2/levels/consite/consite-part_REF.gc index 9428b5fee08..212250bebf8 100644 --- a/test/decompiler/reference/jak2/levels/consite/consite-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/consite/consite-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type consite-part (deftype consite-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type consite-part -(defmethod inspect consite-part ((this consite-part)) +(defmethod inspect ((this consite-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/consite/consiteb-part_REF.gc b/test/decompiler/reference/jak2/levels/consite/consiteb-part_REF.gc index ce4d39cc431..b0e2ee01d27 100644 --- a/test/decompiler/reference/jak2/levels/consite/consiteb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/consite/consiteb-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type consiteb-part (deftype consiteb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type consiteb-part -(defmethod inspect consiteb-part ((this consiteb-part)) +(defmethod inspect ((this consiteb-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc b/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc index 2ed7bb1ee25..3c318cd0b23 100644 --- a/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc @@ -3,29 +3,25 @@ ;; definition of type demo-control (deftype demo-control (process) - ((selected int32 :offset-assert 128) - (sprites hud-sprite 2 :inline :offset-assert 144) - (sprite-pos vector :inline :offset-assert 272) - (sprite-draw uint32 :offset-assert 288) - (buffer external-art-buffer 2 :offset-assert 292) - (want int32 2 :offset-assert 300) - (have int32 2 :offset-assert 308) - (draw int32 :offset-assert 316) - (active symbol :offset-assert 320) - (spark-time time-frame :offset-assert 328) - (gui-id sound-id :offset-assert 336) + ((selected int32) + (sprites hud-sprite 2 :inline) + (sprite-pos vector :inline) + (sprite-draw uint32) + (buffer external-art-buffer 2) + (want int32 2) + (have int32 2) + (draw int32) + (active symbol) + (spark-time time-frame) + (gui-id sound-id) ) - :heap-base #xe0 - :method-count-assert 15 - :size-assert #x154 - :flag-assert #xf00e00154 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) ;; definition for method 3 of type demo-control -(defmethod inspect demo-control ((this demo-control)) +(defmethod inspect ((this demo-control)) (when (not this) (set! this this) (goto cfg-7) @@ -53,7 +49,7 @@ ;; definition for method 7 of type demo-control ;; WARN: Return type mismatch process vs demo-control. -(defmethod relocate demo-control ((this demo-control) (arg0 int)) +(defmethod relocate ((this demo-control) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this buffer v1-0)) (&+! (-> this buffer v1-0) arg0) @@ -63,7 +59,7 @@ ) ;; definition for method 10 of type demo-control -(defmethod deactivate demo-control ((this demo-control)) +(defmethod deactivate ((this demo-control)) (dotimes (s5-0 2) (set-pending-file (-> this buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) diff --git a/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc index 1d865e617ff..fd8e72e6328 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc @@ -505,7 +505,7 @@ ;; definition for method 15 of type hud-dig-clasp ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-dig-clasp ((this hud-dig-clasp)) +(defmethod draw ((this hud-dig-clasp)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -520,7 +520,7 @@ ;; definition for method 16 of type hud-dig-clasp ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-dig-clasp ((this hud-dig-clasp)) +(defmethod update-values ((this hud-dig-clasp)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -529,7 +529,7 @@ ;; definition for method 17 of type hud-dig-clasp ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-dig-clasp ((this hud-dig-clasp)) +(defmethod init-callback ((this hud-dig-clasp)) (set! (-> this level) (level-get *level* 'dig1)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -548,23 +548,21 @@ ;; definition of type dig-clasp (deftype dig-clasp (process-drawable) - ((b basic :offset-assert 200) - (conn connection-minimap :offset-assert 204) + ((b basic) + (conn connection-minimap) ) - :heap-base #x50 - :method-count-assert 24 - :size-assert #xd0 - :flag-assert #x18005000d0 + (:state-methods + broken + break-it + idle + ) (:methods - (broken () _type_ :state 20) - (break-it () _type_ :state 21) - (idle () _type_ :state 22) - (dig-clasp-method-23 (_type_ vector) vector 23) + (dig-clasp-method-23 (_type_ vector) vector) ) ) ;; definition for method 3 of type dig-clasp -(defmethod inspect dig-clasp ((this dig-clasp)) +(defmethod inspect ((this dig-clasp)) (when (not this) (set! this this) (goto cfg-4) @@ -611,7 +609,7 @@ ) ;; definition for method 23 of type dig-clasp -(defmethod dig-clasp-method-23 dig-clasp ((this dig-clasp) (arg0 vector)) +(defmethod dig-clasp-method-23 ((this dig-clasp) (arg0 vector)) (if (-> this b) (vector<-cspace! arg0 (-> this node-list data 3)) (vector<-cspace! arg0 (-> this node-list data 6)) @@ -726,7 +724,7 @@ ;; definition for method 11 of type dig-clasp ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-clasp ((this dig-clasp) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-clasp) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -769,14 +767,10 @@ This commonly includes things such as: ;; definition of type dig-clasp-b (deftype dig-clasp-b (dig-clasp) () - :heap-base #x50 - :method-count-assert 24 - :size-assert #xd0 - :flag-assert #x18005000d0 ) ;; definition for method 3 of type dig-clasp-b -(defmethod inspect dig-clasp-b ((this dig-clasp-b)) +(defmethod inspect ((this dig-clasp-b)) (when (not this) (set! this this) (goto cfg-4) @@ -790,7 +784,7 @@ This commonly includes things such as: ;; definition for method 11 of type dig-clasp-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-clasp-b ((this dig-clasp-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-clasp-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -834,17 +828,14 @@ This commonly includes things such as: ;; definition of type dig-tether-chain (deftype dig-tether-chain (structure) - ((position vector :inline :offset-assert 0) - (velocity vector :inline :offset-assert 16) - (joint-mod joint-mod :offset-assert 32) + ((position vector :inline) + (velocity vector :inline) + (joint-mod joint-mod) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type dig-tether-chain -(defmethod inspect dig-tether-chain ((this dig-tether-chain)) +(defmethod inspect ((this dig-tether-chain)) (when (not this) (set! this this) (goto cfg-4) @@ -859,35 +850,33 @@ This commonly includes things such as: ;; definition of type dig-tether (deftype dig-tether (process-drawable) - ((clasp entity-actor :offset-assert 200) - (clasp-info-ok symbol :offset-assert 204) - (clasp-pos vector :inline :offset-assert 208) - (digger-pos vector :inline :offset-assert 224) - (digger-vertical vector :inline :offset-assert 240) - (frame oscillating-float :inline :offset-assert 256) - (frame-kicker delayed-rand-float :inline :offset-assert 280) - (old-dist float :offset-assert 308) - (chain-joints dig-tether-chain 8 :inline :offset-assert 320) - (chain-offset-rand delayed-rand-vector :inline :offset-assert 704) - (chain-offset oscillating-vector :inline :offset-assert 752) - (joint-one joint-mod :offset-assert 812) - (snapped-look lod-set :inline :offset-assert 816) + ((clasp entity-actor) + (clasp-info-ok symbol) + (clasp-pos vector :inline) + (digger-pos vector :inline) + (digger-vertical vector :inline) + (frame oscillating-float :inline) + (frame-kicker delayed-rand-float :inline) + (old-dist float) + (chain-joints dig-tether-chain 8 :inline) + (chain-offset-rand delayed-rand-vector :inline) + (chain-offset oscillating-vector :inline) + (joint-one joint-mod) + (snapped-look lod-set :inline) ) - :heap-base #x2f0 - :method-count-assert 25 - :size-assert #x361 - :flag-assert #x1902f00361 + (:state-methods + broken + idle + ) (:methods - (broken () _type_ :state 20) - (idle () _type_ :state 21) - (dig-tether-method-22 (_type_) none 22) - (dig-tether-method-23 (_type_) none 23) - (dig-tether-method-24 (_type_) none 24) + (dig-tether-method-22 (_type_) none) + (dig-tether-method-23 (_type_) none) + (dig-tether-method-24 (_type_) none) ) ) ;; definition for method 3 of type dig-tether -(defmethod inspect dig-tether ((this dig-tether)) +(defmethod inspect ((this dig-tether)) (when (not this) (set! this this) (goto cfg-4) @@ -926,7 +915,7 @@ This commonly includes things such as: ;; definition for method 22 of type dig-tether ;; WARN: Return type mismatch int vs none. -(defmethod dig-tether-method-22 dig-tether ((this dig-tether)) +(defmethod dig-tether-method-22 ((this dig-tether)) (with-pp (when (-> this clasp) (let* ((s4-0 (-> this clasp extra process)) @@ -959,7 +948,7 @@ This commonly includes things such as: ;; definition for method 23 of type dig-tether ;; INFO: Used lq/sq -(defmethod dig-tether-method-23 dig-tether ((this dig-tether)) +(defmethod dig-tether-method-23 ((this dig-tether)) (set-params! (-> this chain-offset-rand) 75 150 2048.0 204.8) (set-params! (-> this chain-offset) (the-as vector #f) 4.096 20.48 0.9) (mode-set! (-> this joint-one) (joint-mod-mode joint-set-world)) @@ -987,7 +976,7 @@ This commonly includes things such as: ;; definition for method 24 of type dig-tether ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod dig-tether-method-24 dig-tether ((this dig-tether)) +(defmethod dig-tether-method-24 ((this dig-tether)) (local-vars (sv-144 dig-tether-chain) (sv-160 vector)) (update-with-delay! (-> this chain-offset-rand)) (update! (-> this chain-offset) (-> this chain-offset-rand value)) @@ -1152,7 +1141,7 @@ This commonly includes things such as: ;; definition for method 7 of type dig-tether ;; WARN: Return type mismatch process-drawable vs dig-tether. -(defmethod relocate dig-tether ((this dig-tether) (arg0 int)) +(defmethod relocate ((this dig-tether) (arg0 int)) (if (nonzero? (-> this joint-one)) (&+! (-> this joint-one) arg0) ) @@ -1199,18 +1188,15 @@ This commonly includes things such as: ;; definition of type dig-digger-tether-info (deftype dig-digger-tether-info (structure) - ((rp int32 :offset-assert 0) - (handle handle :offset-assert 8) - (broken-x float :offset-assert 16) - (broken-z float :offset-assert 20) + ((rp int32) + (handle handle) + (broken-x float) + (broken-z float) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type dig-digger-tether-info -(defmethod inspect dig-digger-tether-info ((this dig-digger-tether-info)) +(defmethod inspect ((this dig-digger-tether-info)) (when (not this) (set! this this) (goto cfg-4) @@ -1226,39 +1212,37 @@ This commonly includes things such as: ;; definition of type dig-digger (deftype dig-digger (process-drawable) - ((actor-group (pointer actor-group) :offset-assert 200) - (actor-group-count int32 :offset-assert 204) - (tethers dig-digger-tether-info 24 :inline :offset-assert 208) - (vertical oscillating-vector :inline :offset-assert 976) - (vertical-rand delayed-rand-vector :inline :offset-assert 1040) - (start-y float :offset-assert 1088) - (y-offset bouncing-float :inline :offset-assert 1092) - (y-offset-kicker delayed-rand-float :inline :offset-assert 1136) - (twist oscillating-float :inline :offset-assert 1164) - (twist-kicker delayed-rand-float :inline :offset-assert 1192) - (smoke-part sparticle-launch-control :offset-assert 1220) - (motor-sound sound-id :offset-assert 1224) - (bit-sound sound-id :offset-assert 1228) - (movie-handle handle :offset-assert 1232) - (hud-counter handle :offset-assert 1240) - (speech-time time-frame :offset-assert 1248) - (speech-count int32 :offset-assert 1256) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (tethers dig-digger-tether-info 24 :inline) + (vertical oscillating-vector :inline) + (vertical-rand delayed-rand-vector :inline) + (start-y float) + (y-offset bouncing-float :inline) + (y-offset-kicker delayed-rand-float :inline) + (twist oscillating-float :inline) + (twist-kicker delayed-rand-float :inline) + (smoke-part sparticle-launch-control) + (motor-sound sound-id) + (bit-sound sound-id) + (movie-handle handle) + (hud-counter handle) + (speech-time time-frame) + (speech-count int32) ) - :heap-base #x470 - :method-count-assert 25 - :size-assert #x4ec - :flag-assert #x19047004ec + (:state-methods + idle + hidden + ) (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) - (dig-digger-method-22 (_type_ int) entity 22) - (dig-digger-method-23 (_type_) none 23) - (dig-digger-method-24 (_type_) none 24) + (dig-digger-method-22 (_type_ int) entity) + (dig-digger-method-23 (_type_) none) + (dig-digger-method-24 (_type_) none) ) ) ;; definition for method 3 of type dig-digger -(defmethod inspect dig-digger ((this dig-digger)) +(defmethod inspect ((this dig-digger)) (when (not this) (set! this this) (goto cfg-7) @@ -1298,7 +1282,7 @@ This commonly includes things such as: ) ;; definition for method 22 of type dig-digger -(defmethod dig-digger-method-22 dig-digger ((this dig-digger) (arg0 int)) +(defmethod dig-digger-method-22 ((this dig-digger) (arg0 int)) (if (and (> (-> this actor-group-count) 0) (< arg0 (-> this actor-group 0 length))) (-> this actor-group 0 data arg0 actor) (the-as entity #f) @@ -1307,7 +1291,7 @@ This commonly includes things such as: ;; definition for method 23 of type dig-digger ;; WARN: Return type mismatch int vs none. -(defmethod dig-digger-method-23 dig-digger ((this dig-digger)) +(defmethod dig-digger-method-23 ((this dig-digger)) (dotimes (s5-0 24) (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this tethers s5-0 rp)))) (s3-0 (dig-digger-method-22 this s5-0)) @@ -1323,7 +1307,7 @@ This commonly includes things such as: ;; definition for method 24 of type dig-digger ;; WARN: Return type mismatch int vs none. -(defmethod dig-digger-method-24 dig-digger ((this dig-digger)) +(defmethod dig-digger-method-24 ((this dig-digger)) (set! (-> this vertical target x) 0.0) (set! (-> this vertical target z) 0.0) (let ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> this vertical)) 1.0)) @@ -1528,7 +1512,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type dig-digger -(defmethod deactivate dig-digger ((this dig-digger)) +(defmethod deactivate ((this dig-digger)) (if (nonzero? (-> this smoke-part)) (kill-and-free-particles (-> this smoke-part)) ) @@ -1538,7 +1522,7 @@ This commonly includes things such as: ;; definition for method 7 of type dig-digger ;; WARN: Return type mismatch process-drawable vs dig-digger. -(defmethod relocate dig-digger ((this dig-digger) (arg0 int)) +(defmethod relocate ((this dig-digger) (arg0 int)) (when (nonzero? (-> this smoke-part)) (if (nonzero? (-> this smoke-part)) (&+! (-> this smoke-part) arg0) @@ -1550,7 +1534,7 @@ This commonly includes things such as: ;; definition for method 11 of type dig-digger ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-digger ((this dig-digger) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-digger) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc index 09de1ca28eb..58b4359c3f0 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc @@ -3,23 +3,19 @@ ;; definition of type dig-sinking-plat (deftype dig-sinking-plat (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 384) - (sync sync-linear :inline :offset-assert 400) - (last-ridden-time time-frame :offset-assert 416) - (prev-pos float :offset-assert 424) - (path-pos float :offset-assert 428) - (surface-height float :offset-assert 432) - (once basic :offset-assert 436) - (bubbling-sound-id sound-id :offset-assert 440) + ((anchor-point vector :inline) + (sync sync-linear :inline) + (last-ridden-time time-frame) + (prev-pos float) + (path-pos float) + (surface-height float) + (once basic) + (bubbling-sound-id sound-id) ) - :heap-base #x140 - :method-count-assert 57 - :size-assert #x1bc - :flag-assert #x39014001bc ) ;; definition for method 3 of type dig-sinking-plat -(defmethod inspect dig-sinking-plat ((this dig-sinking-plat)) +(defmethod inspect ((this dig-sinking-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -47,7 +43,7 @@ ;; definition for method 29 of type dig-sinking-plat ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 dig-sinking-plat ((this dig-sinking-plat) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this dig-sinking-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this anchor-point)) 0 @@ -56,7 +52,7 @@ ;; definition for method 32 of type dig-sinking-plat ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape dig-sinking-plat ((this dig-sinking-plat)) +(defmethod allocate-and-init-cshape ((this dig-sinking-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -120,12 +116,12 @@ ) ;; definition for method 53 of type dig-sinking-plat -(defmethod rigid-body-platform-method-53 dig-sinking-plat ((this dig-sinking-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-53 ((this dig-sinking-plat) (arg0 vector)) (-> this surface-height) ) ;; definition for method 37 of type dig-sinking-plat -(defmethod rigid-body-object-method-37 dig-sinking-plat ((this dig-sinking-plat)) +(defmethod rigid-body-object-method-37 ((this dig-sinking-plat)) (when (not (logtest? (-> this path flags) (path-control-flag not-found))) (set! (-> this prev-pos) (-> this path-pos)) (set! (-> this path-pos) (get-norm! (-> this sync) 0)) @@ -221,7 +217,7 @@ ;; definition for method 56 of type dig-sinking-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-56 dig-sinking-plat ((this dig-sinking-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-56 ((this dig-sinking-plat) (arg0 vector)) (when (not (logtest? (-> this path flags) (path-control-flag not-found))) (let ((v1-4 (new 'stack-no-clear 'vector))) (cond @@ -278,7 +274,7 @@ ;; definition for method 33 of type dig-sinking-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body dig-sinking-plat ((this dig-sinking-plat)) +(defmethod init-skel-and-rigid-body ((this dig-sinking-plat)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-sinking-plat" (the-as (pointer uint32) #f))) @@ -460,16 +456,13 @@ ;; definition of type dig-log-button-info (deftype dig-log-button-info (basic) - ((cam-ret-mode symbol :offset-assert 4) - (cam-ret-dir vector :inline :offset-assert 16) + ((cam-ret-mode symbol) + (cam-ret-dir vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type dig-log-button-info -(defmethod inspect dig-log-button-info ((this dig-log-button-info)) +(defmethod inspect ((this dig-log-button-info)) (when (not this) (set! this this) (goto cfg-4) @@ -515,26 +508,24 @@ ;; definition of type dig-log (deftype dig-log (process-drawable) - ((pressed-count int8 :offset-assert 200) - (total-buttons int8 :offset-assert 201) - (last-button-id int8 :offset-assert 202) - (base-y float :offset-assert 204) - (hud-handle handle :offset-assert 208) - (pad-ihj1bn234i1b int32 2 :offset-assert 216) + ((pressed-count int8) + (total-buttons int8) + (last-button-id int8) + (base-y float) + (hud-handle handle) + (pad-ihj1bn234i1b int32 2) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xe0 - :flag-assert #x17006000e0 + (:state-methods + idle + moving + ) (:methods - (idle () _type_ :state 20) - (moving () _type_ :state 21) - (dig-log-method-22 (_type_ symbol) symbol 22) + (dig-log-method-22 (_type_ symbol) symbol) ) ) ;; definition for method 3 of type dig-log -(defmethod inspect dig-log ((this dig-log)) +(defmethod inspect ((this dig-log)) (when (not this) (set! this this) (goto cfg-4) @@ -584,14 +575,14 @@ ) ;; definition for method 12 of type dig-log -(defmethod run-logic? dig-log ((this dig-log)) +(defmethod run-logic? ((this dig-log)) #t ) ;; definition for method 22 of type dig-log ;; WARN: Return type mismatch int vs symbol. ;; WARN: disable def twice: 16. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod dig-log-method-22 dig-log ((this dig-log) (arg0 symbol)) +(defmethod dig-log-method-22 ((this dig-log) (arg0 symbol)) (the-as symbol (cond @@ -736,7 +727,7 @@ ;; definition for method 11 of type dig-log ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-log ((this dig-log) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-log) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -811,21 +802,17 @@ This commonly includes things such as: ;; definition of type dig-button (deftype dig-button (process-drawable) - ((down-y float :offset-assert 200) + ((down-y float) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xcc - :flag-assert #x17005000cc - (:methods - (idle-up () _type_ :state 20) - (going-down () _type_ :state 21) - (idle-down () _type_ :state 22) + (:state-methods + idle-up + going-down + idle-down ) ) ;; definition for method 3 of type dig-button -(defmethod inspect dig-button ((this dig-button)) +(defmethod inspect ((this dig-button)) (when (not this) (set! this this) (goto cfg-4) @@ -845,7 +832,7 @@ This commonly includes things such as: ) ;; definition for method 12 of type dig-button -(defmethod run-logic? dig-button ((this dig-button)) +(defmethod run-logic? ((this dig-button)) #t ) @@ -906,7 +893,7 @@ This commonly includes things such as: ;; definition for method 11 of type dig-button ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-button ((this dig-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -949,7 +936,7 @@ This commonly includes things such as: ;; definition for method 15 of type hud-dig-button ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-dig-button ((this hud-dig-button)) +(defmethod draw ((this hud-dig-button)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 487.0 (* 130.0 (-> this offset)))) @@ -964,7 +951,7 @@ This commonly includes things such as: ;; definition for method 16 of type hud-dig-button ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-dig-button ((this hud-dig-button)) +(defmethod update-values ((this hud-dig-button)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -973,7 +960,7 @@ This commonly includes things such as: ;; definition for method 17 of type hud-dig-button ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-dig-button ((this hud-dig-button)) +(defmethod init-callback ((this hud-dig-button)) (set! (-> this level) (level-get *level* 'dig3a)) (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd21))) (set! (-> this gui-id) diff --git a/test/decompiler/reference/jak2/levels/dig/dig-part_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig-part_REF.gc index 0eafdbe8460..a703207dc3f 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type dig-part (deftype dig-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type dig-part -(defmethod inspect dig-part ((this dig-part)) +(defmethod inspect ((this dig-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc index 0af86d530e6..4867a36063d 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc @@ -4,14 +4,10 @@ ;; definition of type dig-conveyor (deftype dig-conveyor (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) ;; definition for method 3 of type dig-conveyor -(defmethod inspect dig-conveyor ((this dig-conveyor)) +(defmethod inspect ((this dig-conveyor)) (when (not this) (set! this this) (goto cfg-4) @@ -33,7 +29,7 @@ ;; definition for method 24 of type dig-conveyor ;; WARN: Return type mismatch int vs none. -(defmethod init! dig-conveyor ((this dig-conveyor)) +(defmethod init! ((this dig-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (set! (-> this speed) 30720.0) (set! (-> this belt-radius) 15974.4) @@ -43,7 +39,7 @@ ) ;; definition for method 22 of type dig-conveyor -(defmethod get-art-group dig-conveyor ((this dig-conveyor)) +(defmethod get-art-group ((this dig-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-dig-conveyor" (the-as (pointer uint32) #f)) ) @@ -364,21 +360,17 @@ ;; definition of type dig-bomb-crate-cylinder (deftype dig-bomb-crate-cylinder (rigid-body-object) - ((flash-counter int8 :offset-assert 272) - (attack-id uint32 :offset-assert 276) - (wait-time time-frame :offset-assert 280) + ((flash-counter int8) + (attack-id uint32) + (wait-time time-frame) ) - :heap-base #xa0 - :method-count-assert 54 - :size-assert #x120 - :flag-assert #x3600a00120 - (:methods - (die () _type_ :state 53) + (:state-methods + die ) ) ;; definition for method 3 of type dig-bomb-crate-cylinder -(defmethod inspect dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) +(defmethod inspect ((this dig-bomb-crate-cylinder)) (when (not this) (set! this this) (goto cfg-4) @@ -395,18 +387,15 @@ ;; definition of type dig-bomb-crate-cylinder-spawn-params (deftype dig-bomb-crate-cylinder-spawn-params (structure) - ((pos vector :inline :offset-assert 0) - (vel vector :inline :offset-assert 16) - (avel vector :inline :offset-assert 32) - (quat quaternion :inline :offset-assert 48) + ((pos vector :inline) + (vel vector :inline) + (avel vector :inline) + (quat quaternion :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type dig-bomb-crate-cylinder-spawn-params -(defmethod inspect dig-bomb-crate-cylinder-spawn-params ((this dig-bomb-crate-cylinder-spawn-params)) +(defmethod inspect ((this dig-bomb-crate-cylinder-spawn-params)) (when (not this) (set! this this) (goto cfg-4) @@ -616,7 +605,7 @@ ) ;; definition for method 46 of type dig-bomb-crate-cylinder -(defmethod rigid-body-object-method-46 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 ((this dig-bomb-crate-cylinder) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('track) #t @@ -629,12 +618,12 @@ ;; definition for method 47 of type dig-bomb-crate-cylinder ;; WARN: Return type mismatch object vs symbol. -(defmethod rigid-body-object-method-47 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder) - (arg0 process-drawable) - (arg1 attack-info) - (arg2 touching-shapes-entry) - (arg3 penetrate) - ) +(defmethod rigid-body-object-method-47 ((this dig-bomb-crate-cylinder) + (arg0 process-drawable) + (arg1 attack-info) + (arg2 touching-shapes-entry) + (arg3 penetrate) + ) (the-as symbol (cond @@ -655,7 +644,7 @@ ;; definition for method 45 of type dig-bomb-crate-cylinder ;; WARN: Return type mismatch sound-id vs none. -(defmethod rigid-body-object-method-45 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 ((this dig-bomb-crate-cylinder) (arg0 rigid-body-impact)) (let* ((f0-0 (-> arg0 impulse)) (f1-0 28672.0) (f30-0 (* f0-0 (/ 1.0 f1-0) (-> this info info inv-mass))) @@ -678,7 +667,7 @@ ;; definition for method 37 of type dig-bomb-crate-cylinder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-37 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) +(defmethod rigid-body-object-method-37 ((this dig-bomb-crate-cylinder)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) (set! (-> a1-0 start-pos quad) (-> this rbody state position quad)) (vector-float*! (-> a1-0 move-dist) (-> this rbody state lin-velocity) (seconds-per-frame)) @@ -712,7 +701,7 @@ ;; definition for method 32 of type dig-bomb-crate-cylinder ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) +(defmethod allocate-and-init-cshape ((this dig-bomb-crate-cylinder)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -763,7 +752,7 @@ ;; definition for method 33 of type dig-bomb-crate-cylinder ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) +(defmethod init-skel-and-rigid-body ((this dig-bomb-crate-cylinder)) (initialize-skeleton this (the-as @@ -805,19 +794,17 @@ ;; definition of type dig-bomb-crate (deftype dig-bomb-crate (process-focusable) () - :heap-base #x50 - :method-count-assert 30 - :size-assert #xcc - :flag-assert #x1e005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (dig-bomb-crate-method-29 (_type_ vector) none 29) + (dig-bomb-crate-method-29 (_type_ vector) none) ) ) ;; definition for method 3 of type dig-bomb-crate -(defmethod inspect dig-bomb-crate ((this dig-bomb-crate)) +(defmethod inspect ((this dig-bomb-crate)) (when (not this) (set! this this) (goto cfg-4) @@ -877,7 +864,7 @@ ;; definition for method 29 of type dig-bomb-crate ;; WARN: Return type mismatch int vs none. -(defmethod dig-bomb-crate-method-29 dig-bomb-crate ((this dig-bomb-crate) (arg0 vector)) +(defmethod dig-bomb-crate-method-29 ((this dig-bomb-crate) (arg0 vector)) (let ((s4-0 (-> this root trans))) (dotimes (s3-0 8) (let ((a0-2 (-> *dig-bomb-crate-array* s3-0)) @@ -904,7 +891,7 @@ ) ;; definition for method 20 of type dig-bomb-crate -(defmethod get-trans dig-bomb-crate ((this dig-bomb-crate) (arg0 int)) +(defmethod get-trans ((this dig-bomb-crate) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (local-vars (v0-0 vector)) (let ((v1-0 (-> this root))) @@ -1001,7 +988,7 @@ ;; definition for method 11 of type dig-bomb-crate ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-bomb-crate ((this dig-bomb-crate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-bomb-crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1065,14 +1052,10 @@ This commonly includes things such as: ;; definition of type dig-jump-pad (deftype dig-jump-pad (bouncer) () - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd4 - :flag-assert #x19006000d4 ) ;; definition for method 3 of type dig-jump-pad -(defmethod inspect dig-jump-pad ((this dig-jump-pad)) +(defmethod inspect ((this dig-jump-pad)) (when (not this) (set! this this) (goto cfg-4) @@ -1086,7 +1069,7 @@ This commonly includes things such as: ;; definition for method 23 of type dig-jump-pad ;; WARN: Return type mismatch int vs none. -(defmethod init-skeleton! dig-jump-pad ((this dig-jump-pad)) +(defmethod init-skeleton! ((this dig-jump-pad)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-jump-pad" (the-as (pointer uint32) #f))) @@ -1098,7 +1081,7 @@ This commonly includes things such as: ;; definition for method 24 of type dig-jump-pad ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 dig-jump-pad ((this dig-jump-pad)) +(defmethod bouncer-method-24 ((this dig-jump-pad)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) diff --git a/test/decompiler/reference/jak2/levels/dig/dig2-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig2-obs_REF.gc index 9764868826b..0acc4b29110 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig2-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig2-obs_REF.gc @@ -3,21 +3,17 @@ ;; definition of type dig-breakable-door (deftype dig-breakable-door (process-focusable) - ((anim basic :offset-assert 204) - (art-name basic :offset-assert 208) - (collide-mesh int32 :offset-assert 212) + ((anim basic) + (art-name basic) + (collide-mesh int32) ) - :heap-base #x60 - :method-count-assert 28 - :size-assert #xd8 - :flag-assert #x1c006000d8 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) ;; definition for method 3 of type dig-breakable-door -(defmethod inspect dig-breakable-door ((this dig-breakable-door)) +(defmethod inspect ((this dig-breakable-door)) (when (not this) (set! this this) (goto cfg-4) @@ -54,7 +50,7 @@ ;; definition for method 11 of type dig-breakable-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-breakable-door ((this dig-breakable-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-breakable-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc index 039a21ce0a6..c8327f5032a 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc @@ -243,24 +243,20 @@ ;; definition of type dig-spikey-step (deftype dig-spikey-step (process-drawable) - ((smush smush-control :inline :offset-assert 200) - (init-quat quaternion :inline :offset-assert 240) - (shudder-angle float :offset-assert 256) - (rot-angle float :offset-assert 260) - (cycle-time float :offset-assert 264) - (cycle-offset float :offset-assert 268) + ((smush smush-control :inline) + (init-quat quaternion :inline) + (shudder-angle float) + (rot-angle float) + (cycle-time float) + (cycle-offset float) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x110 - :flag-assert #x1500900110 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type dig-spikey-step -(defmethod inspect dig-spikey-step ((this dig-spikey-step)) +(defmethod inspect ((this dig-spikey-step)) (when (not this) (set! this this) (goto cfg-4) @@ -357,7 +353,7 @@ ;; definition for method 11 of type dig-spikey-step ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-spikey-step ((this dig-spikey-step) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-spikey-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -409,17 +405,13 @@ This commonly includes things such as: ;; definition of type dig-spikey-sphere (deftype dig-spikey-sphere (projectile-bounce) - ((death-height float :offset-assert 496) - (pad-i1hb23h1b float :offset-assert 500) + ((death-height float) + (pad-i1hb23h1b float) ) - :heap-base #x180 - :method-count-assert 42 - :size-assert #x1f8 - :flag-assert #x2a018001f8 ) ;; definition for method 3 of type dig-spikey-sphere -(defmethod inspect dig-spikey-sphere ((this dig-spikey-sphere)) +(defmethod inspect ((this dig-spikey-sphere)) (when (not this) (set! this this) (goto cfg-4) @@ -527,7 +519,7 @@ This commonly includes things such as: ;; definition for method 30 of type dig-spikey-sphere ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! dig-spikey-sphere ((this dig-spikey-sphere)) +(defmethod init-proj-collision! ((this dig-spikey-sphere)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -568,7 +560,7 @@ This commonly includes things such as: ;; definition for method 39 of type dig-spikey-sphere ;; INFO: Used lq/sq ;; WARN: Return type mismatch time-frame vs none. -(defmethod play-impact-sound! dig-spikey-sphere ((this dig-spikey-sphere)) +(defmethod play-impact-sound! ((this dig-spikey-sphere)) "Plays impact sound" (let* ((a0-1 (-> this root)) (s5-0 (-> a0-1 status)) @@ -664,7 +656,7 @@ This commonly includes things such as: ;; definition for method 31 of type dig-spikey-sphere ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! dig-spikey-sphere ((this dig-spikey-sphere)) +(defmethod init-proj-settings! ((this dig-spikey-sphere)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this attack-mode) 'eco-dark) (initialize-skeleton @@ -701,21 +693,17 @@ This commonly includes things such as: ;; definition of type dig-spikey-sphere-door (deftype dig-spikey-sphere-door (process-drawable) - ((sync sync-linear :inline :offset-assert 200) - (prev-sync float :offset-assert 216) + ((sync sync-linear :inline) + (prev-sync float) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xdc - :flag-assert #x16006000dc - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) + (:state-methods + idle + active ) ) ;; definition for method 3 of type dig-spikey-sphere-door -(defmethod inspect dig-spikey-sphere-door ((this dig-spikey-sphere-door)) +(defmethod inspect ((this dig-spikey-sphere-door)) (when (not this) (set! this this) (goto cfg-4) @@ -802,7 +790,7 @@ This commonly includes things such as: ;; definition for method 11 of type dig-spikey-sphere-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-spikey-sphere-door ((this dig-spikey-sphere-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-spikey-sphere-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -854,33 +842,29 @@ This commonly includes things such as: ;; definition of type dig-balloon-lurker (deftype dig-balloon-lurker (process-drawable) - ((init-quat quaternion :inline :offset-assert 208) - (sync sync-eased :inline :offset-assert 224) - (swing-sync sync-linear :inline :offset-assert 272) - (smush smush-control :inline :offset-assert 288) - (pov-cam-offset vector :inline :offset-assert 320) - (options int32 :offset-assert 336) - (bouncing basic :offset-assert 340) - (bounce-scale meters :offset-assert 344) - (bob-counter float :offset-assert 348) - (forward-backward basic :offset-assert 352) - (grabbed basic :offset-assert 356) - (trapeze-grabbed basic :offset-assert 360) - (pedal-anim-frame float :offset-assert 364) - (pedal-anim-speed float :offset-assert 368) - (pedal-sound-id sound-id :offset-assert 372) + ((init-quat quaternion :inline) + (sync sync-eased :inline) + (swing-sync sync-linear :inline) + (smush smush-control :inline) + (pov-cam-offset vector :inline) + (options int32) + (bouncing basic) + (bounce-scale meters) + (bob-counter float) + (forward-backward basic) + (grabbed basic) + (trapeze-grabbed basic) + (pedal-anim-frame float) + (pedal-anim-speed float) + (pedal-sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 21 - :size-assert #x178 - :flag-assert #x1501000178 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type dig-balloon-lurker -(defmethod inspect dig-balloon-lurker ((this dig-balloon-lurker)) +(defmethod inspect ((this dig-balloon-lurker)) (when (not this) (set! this this) (goto cfg-4) @@ -909,23 +893,21 @@ This commonly includes things such as: ;; definition of type dig-balloon-lurker-trapeze (deftype dig-balloon-lurker-trapeze (process-drawable) - ((parent-ptr (pointer dig-balloon-lurker) :offset 16) - (swing-type float :offset-assert 200) - (swing-pole (pointer swingpole) :offset-assert 204) - (swing-anim-frame float :offset-assert 208) + ((parent-ptr (pointer dig-balloon-lurker) :overlay-at parent) + (swing-type float) + (swing-pole (pointer swingpole)) + (swing-anim-frame float) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xd4 - :flag-assert #x16006000d4 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (dig-balloon-lurker-trapeze-method-21 (_type_) none 21) + (dig-balloon-lurker-trapeze-method-21 (_type_) none) ) ) ;; definition for method 3 of type dig-balloon-lurker-trapeze -(defmethod inspect dig-balloon-lurker-trapeze ((this dig-balloon-lurker-trapeze)) +(defmethod inspect ((this dig-balloon-lurker-trapeze)) (when (not this) (set! this this) (goto cfg-4) @@ -1022,7 +1004,7 @@ This commonly includes things such as: ;; definition for method 21 of type dig-balloon-lurker-trapeze ;; WARN: Return type mismatch int vs none. -(defmethod dig-balloon-lurker-trapeze-method-21 dig-balloon-lurker-trapeze ((this dig-balloon-lurker-trapeze)) +(defmethod dig-balloon-lurker-trapeze-method-21 ((this dig-balloon-lurker-trapeze)) (cond ((and (-> this draw shadow) (zero? (-> this draw cur-lod)) @@ -1083,7 +1065,7 @@ This commonly includes things such as: ;; definition for method 11 of type dig-balloon-lurker ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-balloon-lurker ((this dig-balloon-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-balloon-lurker) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1189,7 +1171,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type dig-balloon-lurker -(defmethod deactivate dig-balloon-lurker ((this dig-balloon-lurker)) +(defmethod deactivate ((this dig-balloon-lurker)) (sound-stop (-> this pedal-sound-id)) ((method-of-type process-drawable deactivate) this) (none) @@ -1310,20 +1292,16 @@ This commonly includes things such as: ;; definition of type dig-wheel-step (deftype dig-wheel-step (process-drawable) - ((anim-speed float :offset-assert 200) - (wheel-sound-id sound-id :offset-assert 204) + ((anim-speed float) + (wheel-sound-id sound-id) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type dig-wheel-step -(defmethod inspect dig-wheel-step ((this dig-wheel-step)) +(defmethod inspect ((this dig-wheel-step)) (when (not this) (set! this this) (goto cfg-4) @@ -1364,7 +1342,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type dig-wheel-step -(defmethod deactivate dig-wheel-step ((this dig-wheel-step)) +(defmethod deactivate ((this dig-wheel-step)) (sound-stop (-> this wheel-sound-id)) ((method-of-type process-drawable deactivate) this) (none) @@ -1372,7 +1350,7 @@ This commonly includes things such as: ;; definition for method 11 of type dig-wheel-step ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-wheel-step ((this dig-wheel-step) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-wheel-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1447,19 +1425,15 @@ This commonly includes things such as: ;; definition of type dig-tipping-rock (deftype dig-tipping-rock (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 384) - (last-ridden-time time-frame :offset-assert 400) - (surface-height float :offset-assert 408) - (bubbling-sound-id sound-id :offset-assert 412) + ((anchor-point vector :inline) + (last-ridden-time time-frame) + (surface-height float) + (bubbling-sound-id sound-id) ) - :heap-base #x120 - :method-count-assert 57 - :size-assert #x1a0 - :flag-assert #x39012001a0 ) ;; definition for method 3 of type dig-tipping-rock -(defmethod inspect dig-tipping-rock ((this dig-tipping-rock)) +(defmethod inspect ((this dig-tipping-rock)) (when (not this) (set! this this) (goto cfg-4) @@ -1518,7 +1492,7 @@ This commonly includes things such as: ;; definition for method 37 of type dig-tipping-rock ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-37 dig-tipping-rock ((this dig-tipping-rock)) +(defmethod rigid-body-object-method-37 ((this dig-tipping-rock)) (let ((t9-0 (method-of-type rigid-body-platform rigid-body-object-method-37))) (t9-0 this) ) @@ -1573,7 +1547,7 @@ This commonly includes things such as: ;; definition for method 29 of type dig-tipping-rock ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 dig-tipping-rock ((this dig-tipping-rock) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this dig-tipping-rock) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this anchor-point)) 0 @@ -1582,7 +1556,7 @@ This commonly includes things such as: ;; definition for method 32 of type dig-tipping-rock ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape dig-tipping-rock ((this dig-tipping-rock)) +(defmethod allocate-and-init-cshape ((this dig-tipping-rock)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1611,14 +1585,14 @@ This commonly includes things such as: ) ;; definition for method 53 of type dig-tipping-rock -(defmethod rigid-body-platform-method-53 dig-tipping-rock ((this dig-tipping-rock) (arg0 vector)) +(defmethod rigid-body-platform-method-53 ((this dig-tipping-rock) (arg0 vector)) (-> this surface-height) ) ;; definition for method 33 of type dig-tipping-rock ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body dig-tipping-rock ((this dig-tipping-rock)) +(defmethod init-skel-and-rigid-body ((this dig-tipping-rock)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-tipping-rock" (the-as (pointer uint32) #f))) @@ -1668,14 +1642,10 @@ This commonly includes things such as: ;; definition of type dig-wall-bouncer (deftype dig-wall-bouncer (bouncer) () - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd4 - :flag-assert #x19006000d4 ) ;; definition for method 3 of type dig-wall-bouncer -(defmethod inspect dig-wall-bouncer ((this dig-wall-bouncer)) +(defmethod inspect ((this dig-wall-bouncer)) (when (not this) (set! this this) (goto cfg-4) @@ -1689,7 +1659,7 @@ This commonly includes things such as: ;; definition for method 23 of type dig-wall-bouncer ;; WARN: Return type mismatch int vs none. -(defmethod init-skeleton! dig-wall-bouncer ((this dig-wall-bouncer)) +(defmethod init-skeleton! ((this dig-wall-bouncer)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-wall-bouncer" (the-as (pointer uint32) #f))) @@ -1701,7 +1671,7 @@ This commonly includes things such as: ;; definition for method 24 of type dig-wall-bouncer ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 dig-wall-bouncer ((this dig-wall-bouncer)) +(defmethod bouncer-method-24 ((this dig-wall-bouncer)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) @@ -1761,21 +1731,17 @@ This commonly includes things such as: ;; definition of type dig-stomp-block (deftype dig-stomp-block (rigid-body-object) - ((desty float :offset-assert 272) - (flag basic :offset-assert 276) + ((desty float) + (flag basic) ) - :heap-base #xa0 - :method-count-assert 55 - :size-assert #x118 - :flag-assert #x3700a00118 - (:methods - (waiting () _type_ :state 53) - (hit () _type_ :state 54) + (:state-methods + waiting + hit ) ) ;; definition for method 3 of type dig-stomp-block -(defmethod inspect dig-stomp-block ((this dig-stomp-block)) +(defmethod inspect ((this dig-stomp-block)) (when (not this) (set! this this) (goto cfg-4) @@ -1901,7 +1867,7 @@ This commonly includes things such as: ;; definition for method 37 of type dig-stomp-block ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-37 dig-stomp-block ((this dig-stomp-block)) +(defmethod rigid-body-object-method-37 ((this dig-stomp-block)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) (set! (-> a1-0 start-pos quad) (-> this rbody state position quad)) (vector-float*! (-> a1-0 move-dist) (-> this rbody state lin-velocity) (seconds-per-frame)) @@ -1947,7 +1913,7 @@ This commonly includes things such as: ;; definition for method 32 of type dig-stomp-block ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape dig-stomp-block ((this dig-stomp-block)) +(defmethod allocate-and-init-cshape ((this dig-stomp-block)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2044,7 +2010,7 @@ This commonly includes things such as: ;; definition for method 33 of type dig-stomp-block ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body dig-stomp-block ((this dig-stomp-block)) +(defmethod init-skel-and-rigid-body ((this dig-stomp-block)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-stomp-block" (the-as (pointer uint32) #f))) @@ -2075,20 +2041,16 @@ This commonly includes things such as: ;; definition of type dig-stomp-block-controller (deftype dig-stomp-block-controller (process-drawable) - ((stomp-blocks (pointer dig-stomp-block) 4 :offset-assert 200) - (played-fall? symbol :offset-assert 216) + ((stomp-blocks (pointer dig-stomp-block) 4) + (played-fall? symbol) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xdc - :flag-assert #x15006000dc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type dig-stomp-block-controller -(defmethod inspect dig-stomp-block-controller ((this dig-stomp-block-controller)) +(defmethod inspect ((this dig-stomp-block-controller)) (when (not this) (set! this this) (goto cfg-4) @@ -2173,7 +2135,7 @@ This commonly includes things such as: ;; definition for method 11 of type dig-stomp-block-controller ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-stomp-block-controller ((this dig-stomp-block-controller) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-stomp-block-controller) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2190,17 +2152,13 @@ This commonly includes things such as: ;; definition of type dig-totem (deftype dig-totem (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type dig-totem -(defmethod inspect dig-totem ((this dig-totem)) +(defmethod inspect ((this dig-totem)) (when (not this) (set! this this) (goto cfg-4) @@ -2219,7 +2177,7 @@ This commonly includes things such as: ) ;; definition for method 12 of type dig-totem -(defmethod run-logic? dig-totem ((this dig-totem)) +(defmethod run-logic? ((this dig-totem)) #t ) @@ -2231,7 +2189,7 @@ This commonly includes things such as: ;; definition for method 11 of type dig-totem ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-totem ((this dig-totem) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dig-totem) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc index 1921b4086b0..82d0156010d 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc @@ -687,32 +687,30 @@ ;; definition of type drill-barons-ship (deftype drill-barons-ship (process-drawable) - ((root collide-shape-moving :override) - (init-quat quaternion :inline :offset-assert 208) - (next-to-shoot-idx int32 :offset-assert 224) - (current-y-position float :offset-assert 228) - (from-y float :offset-assert 232) - (inc-y float :offset-assert 236) - (ease-y float :offset-assert 240) - (x-offset-angle float :offset-assert 244) - (pass int32 :offset-assert 248) - (end-of-pass symbol :offset-assert 252) - (rock-angle float :offset-assert 256) - (soundid uint32 :offset-assert 260) + ((root collide-shape-moving :override) + (init-quat quaternion :inline) + (next-to-shoot-idx int32) + (current-y-position float) + (from-y float) + (inc-y float) + (ease-y float) + (x-offset-angle float) + (pass int32) + (end-of-pass symbol) + (rock-angle float) + (soundid uint32) ) - :heap-base #x90 - :method-count-assert 23 - :size-assert #x108 - :flag-assert #x1700900108 + (:state-methods + idle + hidden + ) (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) - (drill-barons-ship-method-22 (_type_) none 22) + (drill-barons-ship-method-22 (_type_) none) ) ) ;; definition for method 3 of type drill-barons-ship -(defmethod inspect drill-barons-ship ((this drill-barons-ship)) +(defmethod inspect ((this drill-barons-ship)) (when (not this) (set! this this) (goto cfg-4) @@ -738,17 +736,13 @@ ;; definition of type drill-barons-ship-explode (deftype drill-barons-ship-explode (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type drill-barons-ship-explode -(defmethod inspect drill-barons-ship-explode ((this drill-barons-ship-explode)) +(defmethod inspect ((this drill-barons-ship-explode)) (when (not this) (set! this this) (goto cfg-4) @@ -762,21 +756,18 @@ ;; definition of type barons-ship-turret-info (deftype barons-ship-turret-info (structure) - ((init-y-angle float :offset-assert 0) - (twist-y-max float :offset-assert 4) - (joint-idx int32 :offset-assert 8) - (mesh int32 :offset-assert 12) - (ship-y-offset float :offset-assert 16) - (alive symbol :offset-assert 20) - (next-to-shoot basic :offset-assert 24) + ((init-y-angle float) + (twist-y-max float) + (joint-idx int32) + (mesh int32) + (ship-y-offset float) + (alive symbol) + (next-to-shoot basic) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type barons-ship-turret-info -(defmethod inspect barons-ship-turret-info ((this barons-ship-turret-info)) +(defmethod inspect ((this barons-ship-turret-info)) (when (not this) (set! this this) (goto cfg-4) @@ -795,34 +786,32 @@ ;; definition of type drill-barons-ship-turret (deftype drill-barons-ship-turret (process-drawable) - ((root collide-shape-moving :override) - (info barons-ship-turret-info :offset-assert 200) - (shot-timer time-frame :offset-assert 208) - (shot-counter int32 :offset-assert 216) - (jmod joint-mod :offset-assert 220) - (jmod-left joint-mod :offset-assert 224) - (jmod-right joint-mod :offset-assert 228) - (anim-frame float :offset-assert 232) - (error-y-angle float :offset-assert 236) - (error-y-angle-dest float :offset-assert 240) - (hit-count int32 :offset-assert 244) - (soundid sound-id :offset-assert 248) + ((root collide-shape-moving :override) + (info barons-ship-turret-info) + (shot-timer time-frame) + (shot-counter int32) + (jmod joint-mod) + (jmod-left joint-mod) + (jmod-right joint-mod) + (anim-frame float) + (error-y-angle float) + (error-y-angle-dest float) + (hit-count int32) + (soundid sound-id) ) - :heap-base #x80 - :method-count-assert 25 - :size-assert #xfc - :flag-assert #x19008000fc + (:state-methods + idle + attack + dead + going-down + ) (:methods - (idle () _type_ :state 20) - (attack () _type_ :state 21) - (dead () _type_ :state 22) - (going-down () _type_ :state 23) - (drill-barons-ship-turret-method-24 (_type_) none 24) + (drill-barons-ship-turret-method-24 (_type_) none) ) ) ;; definition for method 3 of type drill-barons-ship-turret -(defmethod inspect drill-barons-ship-turret ((this drill-barons-ship-turret)) +(defmethod inspect ((this drill-barons-ship-turret)) (when (not this) (set! this this) (goto cfg-4) @@ -1105,7 +1094,7 @@ ) ;; definition for method 7 of type drill-barons-ship-turret -(defmethod relocate drill-barons-ship-turret ((this drill-barons-ship-turret) (arg0 int)) +(defmethod relocate ((this drill-barons-ship-turret) (arg0 int)) (when (-> this jmod) (if (nonzero? (-> this jmod)) (&+! (-> this jmod) arg0) @@ -1126,7 +1115,7 @@ ;; definition for method 11 of type drill-barons-ship ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-barons-ship ((this drill-barons-ship) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-barons-ship) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1221,14 +1210,10 @@ This commonly includes things such as: ;; definition of type drill-ship-shot (deftype drill-ship-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type drill-ship-shot -(defmethod inspect drill-ship-shot ((this drill-ship-shot)) +(defmethod inspect ((this drill-ship-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -1241,7 +1226,7 @@ This commonly includes things such as: ) ;; definition for method 37 of type drill-ship-shot -(defmethod deal-damage! drill-ship-shot ((this drill-ship-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! ((this drill-ship-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (if (not (and (-> (the-as drill-barons-ship (-> this parent 0)) next-state) (= (-> (the-as drill-barons-ship (-> this parent 0)) next-state name) 'hidden) @@ -1262,7 +1247,7 @@ This commonly includes things such as: ;; definition for method 31 of type drill-ship-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! drill-ship-shot ((this drill-ship-shot)) +(defmethod init-proj-settings! ((this drill-ship-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (call-parent-method this) (set! (-> this attack-mode) 'drill-ship-shot) @@ -1508,7 +1493,7 @@ This commonly includes things such as: ;; definition for method 22 of type drill-barons-ship ;; WARN: Return type mismatch int vs none. -(defmethod drill-barons-ship-method-22 drill-barons-ship ((this drill-barons-ship)) +(defmethod drill-barons-ship-method-22 ((this drill-barons-ship)) (with-pp (quaternion-rotate-local-x! (-> this root quat) @@ -1565,7 +1550,7 @@ This commonly includes things such as: ;; definition for method 24 of type drill-barons-ship-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod drill-barons-ship-turret-method-24 drill-barons-ship-turret ((this drill-barons-ship-turret)) +(defmethod drill-barons-ship-turret-method-24 ((this drill-barons-ship-turret)) (vector<-cspace! (-> this root trans) (-> (the-as drill-barons-ship (-> this parent 0)) node-list data (-> this info joint-idx)) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-mech-master_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-mech-master_REF.gc index 7eddddaffba..00029099e08 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-mech-master_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-mech-master_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 15 of type hud-cpanel ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-cpanel ((this hud-cpanel)) +(defmethod draw ((this hud-cpanel)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 502.0 (* 130.0 (-> this offset)))) @@ -18,7 +18,7 @@ ;; definition for method 16 of type hud-cpanel ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-cpanel ((this hud-cpanel)) +(defmethod update-values ((this hud-cpanel)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -27,7 +27,7 @@ ;; definition for method 17 of type hud-cpanel ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-cpanel ((this hud-cpanel)) +(defmethod init-callback ((this hud-cpanel)) (set! (-> this level) (level-get *level* 'drillmid)) (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #xb1e))) (set! (-> this gui-id) @@ -46,36 +46,34 @@ ;; definition of type drill-mech-master (deftype drill-mech-master (process) - ((cpanel-count int8 :offset-assert 128) - (alarm-sound-id sound-id :offset-assert 132) - (explosion-sound-id sound-id :offset-assert 136) - (exited? symbol :offset-assert 140) - (killed-jak? symbol :offset-assert 144) - (part-doom sparticle-launch-control :offset-assert 148) - (hud-cpanel handle :offset-assert 152) - (hud-timer handle :offset-assert 160) - (scene-player-handle handle :offset-assert 168) - (state-time time-frame :offset-assert 176) - (next-warn-time time-frame :offset-assert 184) - (total-countdown-time time-frame :offset-assert 192) - (started-timer-time time-frame :offset-assert 200) + ((cpanel-count int8) + (alarm-sound-id sound-id) + (explosion-sound-id sound-id) + (exited? symbol) + (killed-jak? symbol) + (part-doom sparticle-launch-control) + (hud-cpanel handle) + (hud-timer handle) + (scene-player-handle handle) + (state-time time-frame) + (next-warn-time time-frame) + (total-countdown-time time-frame) + (started-timer-time time-frame) ) - :heap-base #x50 - :method-count-assert 20 - :size-assert #xd0 - :flag-assert #x14005000d0 + (:state-methods + idle + active + hostile + failed + victory + ) (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (hostile () _type_ :state 16) - (failed () _type_ :state 17) - (victory () _type_ :state 18) - (spawn-hud-panel (_type_ symbol) none 19) + (spawn-hud-panel (_type_ symbol) none) ) ) ;; definition for method 3 of type drill-mech-master -(defmethod inspect drill-mech-master ((this drill-mech-master)) +(defmethod inspect ((this drill-mech-master)) (when (not this) (set! this this) (goto cfg-4) @@ -104,7 +102,7 @@ (define *drill-mech-master* (the-as (pointer drill-mech-master) #f)) ;; definition for method 10 of type drill-mech-master -(defmethod deactivate drill-mech-master ((this drill-mech-master)) +(defmethod deactivate ((this drill-mech-master)) (set! *drill-mech-master* (the-as (pointer drill-mech-master) #f)) (if (nonzero? (-> this alarm-sound-id)) (sound-stop (-> this alarm-sound-id)) @@ -118,7 +116,7 @@ ;; definition for method 7 of type drill-mech-master ;; WARN: Return type mismatch process vs drill-mech-master. -(defmethod relocate drill-mech-master ((this drill-mech-master) (arg0 int)) +(defmethod relocate ((this drill-mech-master) (arg0 int)) (if (nonzero? (-> this part-doom)) (&+! (-> this part-doom) arg0) ) @@ -156,7 +154,7 @@ ;; definition for method 19 of type drill-mech-master ;; WARN: Return type mismatch int vs none. -(defmethod spawn-hud-panel drill-mech-master ((this drill-mech-master) (arg0 symbol)) +(defmethod spawn-hud-panel ((this drill-mech-master) (arg0 symbol)) "Spawn the hud panel for the drill-mech mission." (cond ((and arg0 (nonzero? (-> this cpanel-count))) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc index 53f0fc07a78..c316d8a67bb 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc @@ -4,22 +4,20 @@ ;; definition of type drill-flip-step (deftype drill-flip-step (base-plat) () - :heap-base #x90 - :method-count-assert 40 - :size-assert #x110 - :flag-assert #x2800900110 + (:state-methods + down + up + swing-down + swing-up + ) (:methods - (down () _type_ :state 34) - (up () _type_ :state 35) - (swing-down () _type_ :state 36) - (swing-up () _type_ :state 37) - (get-skel (_type_) art-group 38) - (set-flipped-state (_type_) none 39) + (get-skel (_type_) art-group) + (set-flipped-state (_type_) none) ) ) ;; definition for method 3 of type drill-flip-step -(defmethod inspect drill-flip-step ((this drill-flip-step)) +(defmethod inspect ((this drill-flip-step)) (when (not this) (set! this this) (goto cfg-4) @@ -141,7 +139,7 @@ ;; definition for method 31 of type drill-flip-step ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! drill-flip-step ((this drill-flip-step)) +(defmethod init-plat-collision! ((this drill-flip-step)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) @@ -188,13 +186,13 @@ ) ;; definition for method 38 of type drill-flip-step -(defmethod get-skel drill-flip-step ((this drill-flip-step)) +(defmethod get-skel ((this drill-flip-step)) (art-group-get-by-name *level* "skel-drill-flip-step" (the-as (pointer uint32) #f)) ) ;; definition for method 39 of type drill-flip-step ;; WARN: Return type mismatch int vs none. -(defmethod set-flipped-state drill-flip-step ((this drill-flip-step)) +(defmethod set-flipped-state ((this drill-flip-step)) "Set the state of the platform based on the completion of the drill-mech task." (if (and (= (-> this entity extra perm task) (game-task drill-mech)) (task-node-closed? (game-task-node drill-mech-smash-consoles)) @@ -210,7 +208,7 @@ ) ;; definition for method 11 of type drill-flip-step -(defmethod init-from-entity! drill-flip-step ((this drill-flip-step) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-flip-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -231,23 +229,19 @@ This commonly includes things such as: ;; definition of type drill-falling-door (deftype drill-falling-door (process-drawable) - ((root collide-shape-moving :override) - (hit-state int32 :offset-assert 200) - (next-hit-state int32 :offset-assert 204) + ((root collide-shape-moving :override) + (hit-state int32) + (next-hit-state int32) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xd0 - :flag-assert #x17005000d0 - (:methods - (idle () _type_ :state 20) - (hit () _type_ :state 21) - (fall (symbol) _type_ :state 22) + (:state-methods + idle + hit + (fall symbol) ) ) ;; definition for method 3 of type drill-falling-door -(defmethod inspect drill-falling-door ((this drill-falling-door)) +(defmethod inspect ((this drill-falling-door)) (when (not this) (set! this this) (goto cfg-4) @@ -389,7 +383,7 @@ This commonly includes things such as: ;; definition for method 11 of type drill-falling-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-falling-door ((this drill-falling-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-falling-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -451,18 +445,14 @@ This commonly includes things such as: ;; definition of type drill-sliding-door (deftype drill-sliding-door (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) + (:state-methods + idle + open ) ) ;; definition for method 3 of type drill-sliding-door -(defmethod inspect drill-sliding-door ((this drill-sliding-door)) +(defmethod inspect ((this drill-sliding-door)) (when (not this) (set! this this) (goto cfg-4) @@ -514,7 +504,7 @@ This commonly includes things such as: ;; definition for method 11 of type drill-sliding-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-sliding-door ((this drill-sliding-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-sliding-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -573,14 +563,10 @@ This commonly includes things such as: ;; definition of type drill-accelerator-floor (deftype drill-accelerator-floor (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) ;; definition for method 3 of type drill-accelerator-floor -(defmethod inspect drill-accelerator-floor ((this drill-accelerator-floor)) +(defmethod inspect ((this drill-accelerator-floor)) (when (not this) (set! this this) (goto cfg-4) @@ -599,14 +585,14 @@ This commonly includes things such as: ) ;; definition for method 22 of type drill-accelerator-floor -(defmethod get-art-group drill-accelerator-floor ((this drill-accelerator-floor)) +(defmethod get-art-group ((this drill-accelerator-floor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-drill-accelerator-floor" (the-as (pointer uint32) #f)) ) ;; definition for method 24 of type drill-accelerator-floor ;; WARN: Return type mismatch int vs none. -(defmethod init! drill-accelerator-floor ((this drill-accelerator-floor)) +(defmethod init! ((this drill-accelerator-floor)) "Initializes defaults for things like the `speed` and `belt-radius`" (set! (-> this speed) 7372.8) (set! (-> this belt-radius) 11878.4) @@ -617,7 +603,7 @@ This commonly includes things such as: ;; definition for method 23 of type drill-accelerator-floor ;; WARN: Return type mismatch int vs none. -(defmethod reset-root! drill-accelerator-floor ((this drill-accelerator-floor)) +(defmethod reset-root! ((this drill-accelerator-floor)) "Re-initializes the `root` [[trsqv]]" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -667,17 +653,13 @@ This commonly includes things such as: ;; definition of type drill-breakable-barrel (deftype drill-breakable-barrel (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type drill-breakable-barrel -(defmethod inspect drill-breakable-barrel ((this drill-breakable-barrel)) +(defmethod inspect ((this drill-breakable-barrel)) (when (not this) (set! this this) (goto cfg-4) @@ -713,7 +695,7 @@ This commonly includes things such as: ;; definition for method 11 of type drill-breakable-barrel ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-breakable-barrel ((this drill-breakable-barrel) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-breakable-barrel) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -752,25 +734,23 @@ This commonly includes things such as: ;; definition of type drill-metalhead-eggs (deftype drill-metalhead-eggs (process-drawable) - ((root collide-shape-moving :override) - (actor-group actor-group :offset-assert 200) - (notify-actor entity-actor :offset-assert 204) + ((root collide-shape-moving :override) + (actor-group actor-group) + (notify-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 25 - :size-assert #xd0 - :flag-assert #x19005000d0 + (:state-methods + idle + die + die-fast + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (die-fast () _type_ :state 22) - (skel-init! (_type_) none 23) - (init-collision! (_type_) none 24) + (skel-init! (_type_) none) + (init-collision! (_type_) none) ) ) ;; definition for method 3 of type drill-metalhead-eggs -(defmethod inspect drill-metalhead-eggs ((this drill-metalhead-eggs)) +(defmethod inspect ((this drill-metalhead-eggs)) (when (not this) (set! this this) (goto cfg-4) @@ -949,7 +929,7 @@ This commonly includes things such as: ;; definition for method 11 of type drill-metalhead-eggs ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-metalhead-eggs ((this drill-metalhead-eggs) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-metalhead-eggs) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -993,14 +973,10 @@ This commonly includes things such as: ;; definition of type drill-metalhead-eggs-a (deftype drill-metalhead-eggs-a (drill-metalhead-eggs) () - :heap-base #x50 - :method-count-assert 25 - :size-assert #xd0 - :flag-assert #x19005000d0 ) ;; definition for method 3 of type drill-metalhead-eggs-a -(defmethod inspect drill-metalhead-eggs-a ((this drill-metalhead-eggs-a)) +(defmethod inspect ((this drill-metalhead-eggs-a)) (when (not this) (set! this this) (goto cfg-4) @@ -1015,14 +991,10 @@ This commonly includes things such as: ;; definition of type drill-metalhead-eggs-b (deftype drill-metalhead-eggs-b (drill-metalhead-eggs) () - :heap-base #x50 - :method-count-assert 25 - :size-assert #xd0 - :flag-assert #x19005000d0 ) ;; definition for method 3 of type drill-metalhead-eggs-b -(defmethod inspect drill-metalhead-eggs-b ((this drill-metalhead-eggs-b)) +(defmethod inspect ((this drill-metalhead-eggs-b)) (when (not this) (set! this this) (goto cfg-4) @@ -1037,14 +1009,10 @@ This commonly includes things such as: ;; definition of type drill-metalhead-eggs-c (deftype drill-metalhead-eggs-c (drill-metalhead-eggs) () - :heap-base #x50 - :method-count-assert 25 - :size-assert #xd0 - :flag-assert #x19005000d0 ) ;; definition for method 3 of type drill-metalhead-eggs-c -(defmethod inspect drill-metalhead-eggs-c ((this drill-metalhead-eggs-c)) +(defmethod inspect ((this drill-metalhead-eggs-c)) (when (not this) (set! this this) (goto cfg-4) @@ -1076,7 +1044,7 @@ This commonly includes things such as: ;; definition for method 23 of type drill-metalhead-eggs-a ;; WARN: Return type mismatch int vs none. -(defmethod skel-init! drill-metalhead-eggs-a ((this drill-metalhead-eggs-a)) +(defmethod skel-init! ((this drill-metalhead-eggs-a)) "Initialize the skeleton and animations for this object." (initialize-skeleton this @@ -1097,7 +1065,7 @@ This commonly includes things such as: ;; definition for method 24 of type drill-metalhead-eggs-a ;; WARN: Return type mismatch int vs none. -(defmethod init-collision! drill-metalhead-eggs-a ((this drill-metalhead-eggs-a)) +(defmethod init-collision! ((this drill-metalhead-eggs-a)) "Define the collision for this object." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1122,7 +1090,7 @@ This commonly includes things such as: ;; definition for method 23 of type drill-metalhead-eggs-b ;; WARN: Return type mismatch int vs none. -(defmethod skel-init! drill-metalhead-eggs-b ((this drill-metalhead-eggs-b)) +(defmethod skel-init! ((this drill-metalhead-eggs-b)) "Initialize the skeleton and animations for this object." (initialize-skeleton this @@ -1143,7 +1111,7 @@ This commonly includes things such as: ;; definition for method 24 of type drill-metalhead-eggs-b ;; WARN: Return type mismatch int vs none. -(defmethod init-collision! drill-metalhead-eggs-b ((this drill-metalhead-eggs-b)) +(defmethod init-collision! ((this drill-metalhead-eggs-b)) "Define the collision for this object." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1168,7 +1136,7 @@ This commonly includes things such as: ;; definition for method 23 of type drill-metalhead-eggs-c ;; WARN: Return type mismatch int vs none. -(defmethod skel-init! drill-metalhead-eggs-c ((this drill-metalhead-eggs-c)) +(defmethod skel-init! ((this drill-metalhead-eggs-c)) "Initialize the skeleton and animations for this object." (initialize-skeleton this @@ -1189,7 +1157,7 @@ This commonly includes things such as: ;; definition for method 24 of type drill-metalhead-eggs-c ;; WARN: Return type mismatch int vs none. -(defmethod init-collision! drill-metalhead-eggs-c ((this drill-metalhead-eggs-c)) +(defmethod init-collision! ((this drill-metalhead-eggs-c)) "Define the collision for this object." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1214,22 +1182,18 @@ This commonly includes things such as: ;; definition of type drill-bridge-shot (deftype drill-bridge-shot (process-drawable) - ((root collide-shape-moving :override) - (anim art-joint-anim :offset-assert 200) - (art-name string :offset-assert 204) + ((root collide-shape-moving :override) + (anim art-joint-anim) + (art-name string) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (die (symbol) _type_ :state 21) + (:state-methods + idle + (die symbol) ) ) ;; definition for method 3 of type drill-bridge-shot -(defmethod inspect drill-bridge-shot ((this drill-bridge-shot)) +(defmethod inspect ((this drill-bridge-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -1365,7 +1329,7 @@ This commonly includes things such as: ;; definition for method 11 of type drill-bridge-shot ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-bridge-shot ((this drill-bridge-shot) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-bridge-shot) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1427,17 +1391,13 @@ This commonly includes things such as: ;; definition of type drill-drill (deftype drill-drill (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type drill-drill -(defmethod inspect drill-drill ((this drill-drill)) +(defmethod inspect ((this drill-drill)) (when (not this) (set! this this) (goto cfg-4) @@ -1473,7 +1433,7 @@ This commonly includes things such as: ;; definition for method 11 of type drill-drill ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-drill ((this drill-drill) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-drill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1494,17 +1454,13 @@ This commonly includes things such as: ;; definition of type drill-drop-plat (deftype drill-drop-plat (drill-flip-step) - ((ridden? symbol :offset-assert 272) - (not-ridden-timer time-frame :offset-assert 280) + ((ridden? symbol) + (not-ridden-timer time-frame) ) - :heap-base #xa0 - :method-count-assert 40 - :size-assert #x120 - :flag-assert #x2800a00120 ) ;; definition for method 3 of type drill-drop-plat -(defmethod inspect drill-drop-plat ((this drill-drop-plat)) +(defmethod inspect ((this drill-drop-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -1579,13 +1535,13 @@ This commonly includes things such as: ) ;; definition for method 38 of type drill-drop-plat -(defmethod get-skel drill-drop-plat ((this drill-drop-plat)) +(defmethod get-skel ((this drill-drop-plat)) (art-group-get-by-name *level* "skel-drill-drop-plat" (the-as (pointer uint32) #f)) ) ;; definition for method 39 of type drill-drop-plat ;; WARN: Return type mismatch int vs none. -(defmethod set-flipped-state drill-drop-plat ((this drill-drop-plat)) +(defmethod set-flipped-state ((this drill-drop-plat)) "Set the state of the platform." (set-time! (-> this not-ridden-timer)) (go (method-of-object this up)) @@ -1595,7 +1551,7 @@ This commonly includes things such as: ;; definition for method 31 of type drill-drop-plat ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! drill-drop-plat ((this drill-drop-plat)) +(defmethod init-plat-collision! ((this drill-drop-plat)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc index a1026762c76..ff93b64fc11 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 15 of type hud-gruntegg ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-gruntegg ((this hud-gruntegg)) +(defmethod draw ((this hud-gruntegg)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 462.0 (* 130.0 (-> this offset)))) @@ -18,7 +18,7 @@ ;; definition for method 16 of type hud-gruntegg ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-gruntegg ((this hud-gruntegg)) +(defmethod update-values ((this hud-gruntegg)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -27,7 +27,7 @@ ;; definition for method 17 of type hud-gruntegg ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-gruntegg ((this hud-gruntegg)) +(defmethod init-callback ((this hud-gruntegg)) (set! (-> this level) (level-get *level* 'drillmid)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-lower-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -46,7 +46,7 @@ ;; definition for method 15 of type hud-crimsonhover ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-crimsonhover ((this hud-crimsonhover)) +(defmethod draw ((this hud-crimsonhover)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 462.0 (* 130.0 (-> this offset)))) @@ -61,7 +61,7 @@ ;; definition for method 16 of type hud-crimsonhover ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-crimsonhover ((this hud-crimsonhover)) +(defmethod update-values ((this hud-crimsonhover)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -70,7 +70,7 @@ ;; definition for method 17 of type hud-crimsonhover ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-crimsonhover ((this hud-crimsonhover)) +(defmethod init-callback ((this hud-crimsonhover)) (set! (-> this level) (level-get *level* 'drillmid)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-lower-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -89,20 +89,16 @@ ;; definition of type drill-plat-falling (deftype drill-plat-falling (base-plat) - ((init-quat quaternion :inline :offset-assert 272) + ((init-quat quaternion :inline) ) - :heap-base #xa0 - :method-count-assert 36 - :size-assert #x120 - :flag-assert #x2400a00120 - (:methods - (idle () _type_ :state 34) - (falling () _type_ :state 35) + (:state-methods + idle + falling ) ) ;; definition for method 3 of type drill-plat-falling -(defmethod inspect drill-plat-falling ((this drill-plat-falling)) +(defmethod inspect ((this drill-plat-falling)) (when (not this) (set! this this) (goto cfg-4) @@ -124,7 +120,7 @@ ;; definition for method 29 of type drill-plat-falling ;; WARN: Return type mismatch int vs none. -(defmethod start-bouncing! drill-plat-falling ((this drill-plat-falling)) +(defmethod start-bouncing! ((this drill-plat-falling)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" @@ -197,7 +193,7 @@ and translate the platform via the `smush` ;; definition for method 11 of type drill-plat-falling ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-plat-falling ((this drill-plat-falling) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-plat-falling) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -238,21 +234,19 @@ This commonly includes things such as: ;; definition of type drill-elevator-shaft (deftype drill-elevator-shaft (process-drawable) - ((extent vector 2 :inline :offset-assert 208) - (length float :offset-assert 240) + ((extent vector 2 :inline) + (length float) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf4 - :flag-assert #x16008000f4 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (set-extent! (_type_ vector) none 21) + (set-extent! (_type_ vector) none) ) ) ;; definition for method 3 of type drill-elevator-shaft -(defmethod inspect drill-elevator-shaft ((this drill-elevator-shaft)) +(defmethod inspect ((this drill-elevator-shaft)) (when (not this) (set! this this) (goto cfg-4) @@ -268,17 +262,13 @@ This commonly includes things such as: ;; definition of type drill-elevator (deftype drill-elevator (elevator) - ((shaft (pointer drill-elevator-shaft) :offset-assert 368) - (sound-id sound-id :offset-assert 372) + ((shaft (pointer drill-elevator-shaft)) + (sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 49 - :size-assert #x178 - :flag-assert #x3101000178 ) ;; definition for method 3 of type drill-elevator -(defmethod inspect drill-elevator ((this drill-elevator)) +(defmethod inspect ((this drill-elevator)) (when (not this) (set! this this) (goto cfg-4) @@ -299,14 +289,14 @@ This commonly includes things such as: ) ;; definition for method 30 of type drill-elevator -(defmethod get-art-group drill-elevator ((this drill-elevator)) +(defmethod get-art-group ((this drill-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-drill-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 31 of type drill-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! drill-elevator ((this drill-elevator)) +(defmethod init-plat-collision! ((this drill-elevator)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -436,7 +426,7 @@ This commonly includes things such as: ;; definition for method 21 of type drill-elevator-shaft ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod set-extent! drill-elevator-shaft ((this drill-elevator-shaft) (arg0 vector)) +(defmethod set-extent! ((this drill-elevator-shaft) (arg0 vector)) (set! (-> this extent 1 quad) (-> arg0 quad)) (none) ) @@ -509,7 +499,7 @@ This commonly includes things such as: ) ;; definition for method 43 of type drill-elevator -(defmethod move-between-points drill-elevator ((this drill-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this drill-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -529,7 +519,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type drill-elevator -(defmethod deactivate drill-elevator ((this drill-elevator)) +(defmethod deactivate ((this drill-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -537,14 +527,14 @@ This commonly includes things such as: ;; definition for method 42 of type drill-elevator ;; WARN: Return type mismatch sound-id vs none. -(defmethod set-ambient-sound! drill-elevator ((this drill-elevator)) +(defmethod set-ambient-sound! ((this drill-elevator)) "Sets the elevator's [[ambient-sound]] up" (set! (-> this sound-id) (new-sound-id)) (none) ) ;; definition for method 40 of type drill-elevator -(defmethod activate-elevator drill-elevator ((this drill-elevator)) +(defmethod activate-elevator ((this drill-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (if (or (not (task-node-closed? (game-task-node drill-ship-introduction))) (task-node-closed? (game-task-node nest-boss-resolution)) @@ -556,7 +546,7 @@ This commonly includes things such as: ;; definition for method 33 of type drill-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! drill-elevator ((this drill-elevator)) +(defmethod init-plat! ((this drill-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this shaft) @@ -568,16 +558,12 @@ For example for an elevator pre-compute the distance between the first and last ;; definition of type drill-mech-elevator (deftype drill-mech-elevator (drill-elevator) - ((running-sound-id sound-id :offset-assert 376) + ((running-sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 49 - :size-assert #x17c - :flag-assert #x310100017c ) ;; definition for method 3 of type drill-mech-elevator -(defmethod inspect drill-mech-elevator ((this drill-mech-elevator)) +(defmethod inspect ((this drill-mech-elevator)) (when (not this) (set! this this) (goto cfg-4) @@ -642,7 +628,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 45 of type drill-mech-elevator -(defmethod commited-to-ride? drill-mech-elevator ((this drill-mech-elevator)) +(defmethod commited-to-ride? ((this drill-mech-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (when (= (-> this move-pos 1) (-> this bottom-top 0)) (let* ((s5-0 *target*) @@ -673,7 +659,7 @@ For example for an elevator pre-compute the distance between the first and last ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod move-to-next-point! drill-mech-elevator ((this drill-mech-elevator)) +(defmethod move-to-next-point! ((this drill-mech-elevator)) "If the [[*target*]] is in a valid state and there is a point to transition to in the elevator's path do so. @see [[elevator::47]]" @@ -702,7 +688,7 @@ do so. ) ;; definition for method 10 of type drill-mech-elevator -(defmethod deactivate drill-mech-elevator ((this drill-mech-elevator)) +(defmethod deactivate ((this drill-mech-elevator)) (if (nonzero? (-> this running-sound-id)) (sound-stop (-> this running-sound-id)) ) @@ -711,7 +697,7 @@ do so. ) ;; definition for method 33 of type drill-mech-elevator -(defmethod init-plat! drill-mech-elevator ((this drill-mech-elevator)) +(defmethod init-plat! ((this drill-mech-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this running-sound-id) (new 'static 'sound-id)) @@ -720,40 +706,38 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 40 of type drill-mech-elevator -(defmethod activate-elevator drill-mech-elevator ((this drill-mech-elevator)) +(defmethod activate-elevator ((this drill-mech-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (go (method-of-object this waiting)) ) ;; definition of type fire-floor (deftype fire-floor (process-drawable) - ((root collide-shape-moving :override) - (part-off sparticle-launch-control :offset-assert 200) - (size float 2 :offset-assert 204) - (attack-id uint32 :offset-assert 212) - (sound-id sound-id :offset-assert 216) - (sound-playing symbol :offset-assert 220) - (deadly-width float :offset-assert 224) - (deadly-length float :offset-assert 228) - (flames-end-tt float :offset-assert 232) - (generous float :offset-assert 236) - (no-collision-timer time-frame :offset-assert 240) - (local-to-world matrix :inline :offset-assert 256) - (world-to-local matrix :inline :offset-assert 320) - (sync sync-linear :inline :offset-assert 384) + ((root collide-shape-moving :override) + (part-off sparticle-launch-control) + (size float 2) + (attack-id uint32) + (sound-id sound-id) + (sound-playing symbol) + (deadly-width float) + (deadly-length float) + (flames-end-tt float) + (generous float) + (no-collision-timer time-frame) + (local-to-world matrix :inline) + (world-to-local matrix :inline) + (sync sync-linear :inline) ) - :heap-base #x110 - :method-count-assert 22 - :size-assert #x190 - :flag-assert #x1601100190 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (set-part (_type_) none 21) + (set-part (_type_) none) ) ) ;; definition for method 3 of type fire-floor -(defmethod inspect fire-floor ((this fire-floor)) +(defmethod inspect ((this fire-floor)) (when (not this) (set! this this) (goto cfg-4) @@ -935,7 +919,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 21 of type fire-floor ;; WARN: Return type mismatch int vs none. -(defmethod set-part fire-floor ((this fire-floor)) +(defmethod set-part ((this fire-floor)) "Set the particle launch controls for the on/off states." (set! (-> this part) (create-launch-control (-> *part-group-id-table* 399) this)) (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 398) this)) @@ -944,7 +928,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 7 of type fire-floor -(defmethod relocate fire-floor ((this fire-floor) (arg0 int)) +(defmethod relocate ((this fire-floor) (arg0 int)) (if (nonzero? (-> this part-off)) (&+! (-> this part-off) arg0) ) @@ -952,7 +936,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 10 of type fire-floor -(defmethod deactivate fire-floor ((this fire-floor)) +(defmethod deactivate ((this fire-floor)) (sound-stop (-> this sound-id)) (if (nonzero? (-> this part-off)) (kill-and-free-particles (-> this part-off)) @@ -964,7 +948,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 11 of type fire-floor ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fire-floor ((this fire-floor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fire-floor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1067,14 +1051,10 @@ This commonly includes things such as: ;; definition of type fire-floor-a (deftype fire-floor-a (fire-floor) () - :heap-base #x110 - :method-count-assert 22 - :size-assert #x190 - :flag-assert #x1601100190 ) ;; definition for method 3 of type fire-floor-a -(defmethod inspect fire-floor-a ((this fire-floor-a)) +(defmethod inspect ((this fire-floor-a)) (when (not this) (set! this this) (goto cfg-4) @@ -1088,7 +1068,7 @@ This commonly includes things such as: ;; definition for method 21 of type fire-floor-a ;; WARN: Return type mismatch int vs none. -(defmethod set-part fire-floor-a ((this fire-floor-a)) +(defmethod set-part ((this fire-floor-a)) "Set the particle launch controls for the on/off states." (set! (-> this part) (create-launch-control (-> *part-group-id-table* 401) this)) (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 400) this)) @@ -1152,21 +1132,17 @@ This commonly includes things such as: ;; definition of type drill-switch (deftype drill-switch (basebutton) - ((green-part sparticle-launch-control :offset-assert 288) - (down-frame float :offset-assert 292) + ((green-part sparticle-launch-control) + (down-frame float) ) - :heap-base #xb0 - :method-count-assert 41 - :size-assert #x128 - :flag-assert #x2900b00128 (:methods - (drill-switch-method-39 (_type_) none 39) - (set-switch-color (_type_ symbol) none 40) + (drill-switch-method-39 (_type_) none) + (set-switch-color (_type_ symbol) none) ) ) ;; definition for method 3 of type drill-switch -(defmethod inspect drill-switch ((this drill-switch)) +(defmethod inspect ((this drill-switch)) (when (not this) (set! this this) (goto cfg-4) @@ -1188,7 +1164,7 @@ This commonly includes things such as: ;; definition for method 7 of type drill-switch ;; WARN: Return type mismatch basebutton vs drill-switch. -(defmethod relocate drill-switch ((this drill-switch) (arg0 int)) +(defmethod relocate ((this drill-switch) (arg0 int)) (if (nonzero? (-> this green-part)) (&+! (-> this green-part) arg0) ) @@ -1196,7 +1172,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type drill-switch -(defmethod deactivate drill-switch ((this drill-switch)) +(defmethod deactivate ((this drill-switch)) (if (nonzero? (-> this green-part)) (kill-and-free-particles (-> this green-part)) ) @@ -1205,7 +1181,7 @@ This commonly includes things such as: ) ;; definition for method 40 of type drill-switch -(defmethod set-switch-color drill-switch ((this drill-switch) (arg0 symbol)) +(defmethod set-switch-color ((this drill-switch) (arg0 symbol)) "Set the switch color based on its state." (when (or arg0 (not (logtest? (current-time) 64))) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -1224,7 +1200,7 @@ This commonly includes things such as: ;; definition for method 34 of type drill-switch ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-34 drill-switch ((this drill-switch)) +(defmethod basebutton-method-34 ((this drill-switch)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1432,7 +1408,7 @@ This commonly includes things such as: ) ;; definition for method 38 of type drill-switch -(defmethod press! drill-switch ((this drill-switch) (arg0 symbol)) +(defmethod press! ((this drill-switch) (arg0 symbol)) (if arg0 (logior! (-> this button-status) (button-status pressed)) (logclear! (-> this button-status) (button-status pressed)) @@ -1447,7 +1423,7 @@ This commonly includes things such as: ;; definition for method 33 of type drill-switch ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 drill-switch ((this drill-switch)) +(defmethod basebutton-method-33 ((this drill-switch)) "TODO - joint stuff" (initialize-skeleton this @@ -1470,7 +1446,7 @@ This commonly includes things such as: ;; definition for method 35 of type drill-switch ;; WARN: Return type mismatch int vs none. -(defmethod prepare-trigger-event! drill-switch ((this drill-switch)) +(defmethod prepare-trigger-event! ((this drill-switch)) "Sets `event-going-down` to `'trigger`" (set! (-> this down-frame) 2.0) (logior! (-> this button-status) (button-status button-status-3)) @@ -1550,23 +1526,19 @@ This commonly includes things such as: ;; definition of type drill-laser (deftype drill-laser (process-drawable) - ((speed float :offset-assert 200) - (offset float :offset-assert 204) - (pause float :offset-assert 208) - (firing? symbol :offset-assert 212) - (hit-sound-id sound-id :offset-assert 216) + ((speed float) + (offset float) + (pause float) + (firing? symbol) + (hit-sound-id sound-id) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xdc - :flag-assert #x15006000dc - (:methods - (drill-laser-idle () _type_ :state 20) + (:state-methods + drill-laser-idle ) ) ;; definition for method 3 of type drill-laser -(defmethod inspect drill-laser ((this drill-laser)) +(defmethod inspect ((this drill-laser)) (when (not this) (set! this this) (goto cfg-4) @@ -1585,7 +1557,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type drill-laser -(defmethod deactivate drill-laser ((this drill-laser)) +(defmethod deactivate ((this drill-laser)) (sound-stop (-> this hit-sound-id)) ((method-of-type process-drawable deactivate) this) (none) @@ -1694,7 +1666,7 @@ This commonly includes things such as: ;; definition for method 11 of type drill-laser ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-laser ((this drill-laser) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-laser) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/drill/drill-panel_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-panel_REF.gc index 7244d816251..4adc05e3794 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-panel_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-panel_REF.gc @@ -17,27 +17,25 @@ ;; definition of type drill-control-panel (deftype drill-control-panel (process-focusable) - ((id int8 :offset-assert 204) - (idle-sound-id sound-id :offset-assert 208) - (debris-part sparticle-launch-control :offset-assert 212) - (next-warn-time time-frame :offset 224) + ((id int8) + (idle-sound-id sound-id) + (debris-part sparticle-launch-control) + (next-warn-time time-frame :offset 224) ) - :heap-base #x70 - :method-count-assert 33 - :size-assert #xe8 - :flag-assert #x21007000e8 + (:state-methods + idle + (hit symbol) + ) (:methods - (idle () _type_ :state 27) - (hit (symbol) _type_ :state 28) - (init-collision! (_type_) none 29) - (init-panel (_type_) none 30) - (spawn-shock-part (_type_) none 31) - (spawn-explode-part (_type_) none 32) + (init-collision! (_type_) none) + (init-panel (_type_) none) + (spawn-shock-part (_type_) none) + (spawn-explode-part (_type_) none) ) ) ;; definition for method 3 of type drill-control-panel -(defmethod inspect drill-control-panel ((this drill-control-panel)) +(defmethod inspect ((this drill-control-panel)) (when (not this) (set! this this) (goto cfg-4) @@ -56,7 +54,7 @@ ;; definition for method 7 of type drill-control-panel ;; WARN: Return type mismatch process-drawable vs drill-control-panel. -(defmethod relocate drill-control-panel ((this drill-control-panel) (arg0 int)) +(defmethod relocate ((this drill-control-panel) (arg0 int)) (if (nonzero? (-> this debris-part)) (&+! (-> this debris-part) arg0) ) @@ -64,7 +62,7 @@ ) ;; definition for method 10 of type drill-control-panel -(defmethod deactivate drill-control-panel ((this drill-control-panel)) +(defmethod deactivate ((this drill-control-panel)) (sound-stop (-> this idle-sound-id)) (if (nonzero? (-> this debris-part)) (kill-and-free-particles (-> this debris-part)) @@ -517,7 +515,7 @@ ) ;; definition for method 32 of type drill-control-panel -(defmethod spawn-explode-part drill-control-panel ((this drill-control-panel)) +(defmethod spawn-explode-part ((this drill-control-panel)) "Spawn explosion particles." (let ((v1-0 (-> this id))) (if (or (zero? v1-0) (= v1-0 1)) @@ -529,7 +527,7 @@ ) ;; definition for method 31 of type drill-control-panel -(defmethod spawn-shock-part drill-control-panel ((this drill-control-panel)) +(defmethod spawn-shock-part ((this drill-control-panel)) "Spawn shock particles." (let ((v1-0 (-> this id))) (cond @@ -698,7 +696,7 @@ ;; definition for method 29 of type drill-control-panel ;; WARN: Return type mismatch int vs none. -(defmethod init-collision! drill-control-panel ((this drill-control-panel)) +(defmethod init-collision! ((this drill-control-panel)) "Define the collision for the panel." (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -728,7 +726,7 @@ ;; definition for method 30 of type drill-control-panel ;; WARN: Return type mismatch int vs none. -(defmethod init-panel drill-control-panel ((this drill-control-panel)) +(defmethod init-panel ((this drill-control-panel)) "Init some parameters for the panel." (set! (-> this idle-sound-id) (new-sound-id)) (logior! (-> this mask) (process-mask crate)) @@ -739,7 +737,7 @@ ;; definition for method 11 of type drill-control-panel ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-control-panel ((this drill-control-panel) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-control-panel) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -776,14 +774,10 @@ This commonly includes things such as: ;; definition of type drill-control-panel-a (deftype drill-control-panel-a (drill-control-panel) () - :heap-base #x70 - :method-count-assert 33 - :size-assert #xe8 - :flag-assert #x21007000e8 ) ;; definition for method 3 of type drill-control-panel-a -(defmethod inspect drill-control-panel-a ((this drill-control-panel-a)) +(defmethod inspect ((this drill-control-panel-a)) (when (not this) (set! this this) (goto cfg-4) @@ -797,7 +791,7 @@ This commonly includes things such as: ;; definition for method 11 of type drill-control-panel-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-control-panel-a ((this drill-control-panel-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-control-panel-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -865,14 +859,10 @@ This commonly includes things such as: ;; definition of type drill-control-panel-b (deftype drill-control-panel-b (drill-control-panel-a) () - :heap-base #x70 - :method-count-assert 33 - :size-assert #xe8 - :flag-assert #x21007000e8 ) ;; definition for method 3 of type drill-control-panel-b -(defmethod inspect drill-control-panel-b ((this drill-control-panel-b)) +(defmethod inspect ((this drill-control-panel-b)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-part_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-part_REF.gc index d2b7a80ab38..8fce03e6c2b 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type drill-part (deftype drill-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type drill-part -(defmethod inspect drill-part ((this drill-part)) +(defmethod inspect ((this drill-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-spool_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-spool_REF.gc index 336282ad3d4..646971dd752 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-spool_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-spool_REF.gc @@ -763,22 +763,18 @@ ;; definition of type drill-wall (deftype drill-wall (process-focusable) - ((anim spool-anim :offset-assert 204) - (art-name string :offset-assert 208) - (egg-group actor-group :offset-assert 212) + ((anim spool-anim) + (art-name string) + (egg-group actor-group) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd8 - :flag-assert #x1d006000d8 - (:methods - (idle () _type_ :state 27) - (hit (symbol) _type_ :state 28) + (:state-methods + idle + (hit symbol) ) ) ;; definition for method 3 of type drill-wall -(defmethod inspect drill-wall ((this drill-wall)) +(defmethod inspect ((this drill-wall)) (when (not this) (set! this this) (goto cfg-4) @@ -856,7 +852,7 @@ ;; definition for method 11 of type drill-wall ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-wall ((this drill-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -943,22 +939,18 @@ This commonly includes things such as: ;; definition of type drill-crane (deftype drill-crane (process-focusable) - ((anim spool-anim :offset-assert 204) - (art-name string :offset-assert 208) - (egg-group actor-group :offset-assert 212) + ((anim spool-anim) + (art-name string) + (egg-group actor-group) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd8 - :flag-assert #x1d006000d8 - (:methods - (idle () _type_ :state 27) - (hit (symbol) _type_ :state 28) + (:state-methods + idle + (hit symbol) ) ) ;; definition for method 3 of type drill-crane -(defmethod inspect drill-crane ((this drill-crane)) +(defmethod inspect ((this drill-crane)) (when (not this) (set! this this) (goto cfg-4) @@ -1063,7 +1055,7 @@ This commonly includes things such as: ;; definition for method 11 of type drill-crane ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-crane ((this drill-crane) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-crane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc b/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc index 01b78ce553e..e11727c252f 100644 --- a/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc @@ -10,14 +10,10 @@ ;; definition of type drill-elevator-doors (deftype drill-elevator-doors (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type drill-elevator-doors -(defmethod inspect drill-elevator-doors ((this drill-elevator-doors)) +(defmethod inspect ((this drill-elevator-doors)) (when (not this) (set! this this) (goto cfg-4) @@ -31,7 +27,7 @@ ;; definition for method 11 of type drill-elevator-doors ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-elevator-doors ((this drill-elevator-doors) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-elevator-doors) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -90,19 +86,15 @@ This commonly includes things such as: ;; definition of type drill-lift (deftype drill-lift (elevator) - ((sound-id sound-id :offset-assert 368) + ((sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 50 - :size-assert #x174 - :flag-assert #x3201000174 (:methods - (set-collide-spec! (_type_ symbol) none 49) + (set-collide-spec! (_type_ symbol) none) ) ) ;; definition for method 3 of type drill-lift -(defmethod inspect drill-lift ((this drill-lift)) +(defmethod inspect ((this drill-lift)) (when (not this) (set! this this) (goto cfg-4) @@ -122,13 +114,13 @@ This commonly includes things such as: ) ;; definition for method 30 of type drill-lift -(defmethod get-art-group drill-lift ((this drill-lift)) +(defmethod get-art-group ((this drill-lift)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-drill-lift" (the-as (pointer uint32) #f)) ) ;; definition for method 43 of type drill-lift -(defmethod move-between-points drill-lift ((this drill-lift) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this drill-lift) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -148,7 +140,7 @@ This commonly includes things such as: ) ;; definition for method 45 of type drill-lift -(defmethod commited-to-ride? drill-lift ((this drill-lift)) +(defmethod commited-to-ride? ((this drill-lift)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) @@ -169,7 +161,7 @@ This commonly includes things such as: ;; definition for method 49 of type drill-lift ;; WARN: Return type mismatch int vs none. -(defmethod set-collide-spec! drill-lift ((this drill-lift) (arg0 symbol)) +(defmethod set-collide-spec! ((this drill-lift) (arg0 symbol)) (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 @@ -237,7 +229,7 @@ This commonly includes things such as: ) ;; definition for method 31 of type drill-lift -(defmethod init-plat-collision! drill-lift ((this drill-lift)) +(defmethod init-plat-collision! ((this drill-lift)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -281,14 +273,10 @@ This commonly includes things such as: ;; definition of type drill-moving-staircase (deftype drill-moving-staircase (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) ;; definition for method 3 of type drill-moving-staircase -(defmethod inspect drill-moving-staircase ((this drill-moving-staircase)) +(defmethod inspect ((this drill-moving-staircase)) (when (not this) (set! this this) (goto cfg-4) @@ -307,14 +295,14 @@ This commonly includes things such as: ) ;; definition for method 22 of type drill-moving-staircase -(defmethod get-art-group drill-moving-staircase ((this drill-moving-staircase)) +(defmethod get-art-group ((this drill-moving-staircase)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-drill-moving-staircase" (the-as (pointer uint32) #f)) ) ;; definition for method 24 of type drill-moving-staircase ;; WARN: Return type mismatch float vs none. -(defmethod init! drill-moving-staircase ((this drill-moving-staircase)) +(defmethod init! ((this drill-moving-staircase)) "Initializes defaults for things like the `speed` and `belt-radius`" (set! (-> this speed) 38912.0) (set! (-> this belt-radius) 11878.4) @@ -324,7 +312,7 @@ This commonly includes things such as: ;; definition for method 23 of type drill-moving-staircase ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod reset-root! drill-moving-staircase ((this drill-moving-staircase)) +(defmethod reset-root! ((this drill-moving-staircase)) "Re-initializes the `root` [[trsqv]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) diff --git a/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc b/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc index 5f3c9b64b6c..ba22ed63525 100644 --- a/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc @@ -117,15 +117,12 @@ ;; definition of type ginsu-anim-info (deftype ginsu-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type ginsu-anim-info -(defmethod inspect ginsu-anim-info ((this ginsu-anim-info)) +(defmethod inspect ((this ginsu-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -138,16 +135,13 @@ ;; definition of type ginsu-global-info (deftype ginsu-global-info (basic) - ((prev-blue-hit int8 :offset-assert 4) - (blue-hit-anim int32 3 :offset-assert 8) + ((prev-blue-hit int8) + (blue-hit-anim int32 3) ) - :method-count-assert 9 - :size-assert #x14 - :flag-assert #x900000014 ) ;; definition for method 3 of type ginsu-global-info -(defmethod inspect ginsu-global-info ((this ginsu-global-info)) +(defmethod inspect ((this ginsu-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -161,37 +155,35 @@ ;; definition of type ginsu (deftype ginsu (nav-enemy) - ((blade-jm joint-mod :offset-assert 604) - (blade-speed cam-float-seeker :inline :offset-assert 608) - (blade-angle float :offset-assert 632) - (desired-distance float :offset-assert 636) - (spiral-time time-frame :offset-assert 640) - (blade-part sparticle-launch-control :offset-assert 648) - (ambush-path path-control :offset-assert 652) - (path-pos float :offset-assert 656) - (ambush-started symbol :offset-assert 660) - (blade-sound sound-id :offset-assert 664) - (blade-sound-playing symbol :offset-assert 668) - (grind-sound sound-id :offset-assert 672) - (grind-sound-playing symbol :offset-assert 676) - (grind-timer time-frame :offset-assert 680) + ((blade-jm joint-mod) + (blade-speed cam-float-seeker :inline) + (blade-angle float) + (desired-distance float) + (spiral-time time-frame) + (blade-part sparticle-launch-control) + (ambush-path path-control) + (path-pos float) + (ambush-started symbol) + (blade-sound sound-id) + (blade-sound-playing symbol) + (grind-sound sound-id) + (grind-sound-playing symbol) + (grind-timer time-frame) ) - :heap-base #x230 - :method-count-assert 184 - :size-assert #x2b0 - :flag-assert #xb8023002b0 + (:state-methods + anticipate-attack + attack + ) (:methods - (anticipate-attack () _type_ :state 178) - (attack () _type_ :state 179) - (ginsu-method-180 (_type_) none 180) - (ginsu-method-181 (_type_ vector) vector 181) - (ginsu-method-182 (_type_) none 182) - (ginsu-method-183 (_type_ symbol) none 183) + (ginsu-method-180 (_type_) none) + (ginsu-method-181 (_type_ vector) vector) + (ginsu-method-182 (_type_) none) + (ginsu-method-183 (_type_ symbol) none) ) ) ;; definition for method 3 of type ginsu -(defmethod inspect ginsu ((this ginsu)) +(defmethod inspect ((this ginsu)) (when (not this) (set! this this) (goto cfg-4) @@ -366,7 +358,7 @@ ;; definition for method 180 of type ginsu ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ginsu-method-180 ginsu ((this ginsu)) +(defmethod ginsu-method-180 ((this ginsu)) (let ((v1-2 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) ) @@ -403,7 +395,7 @@ ) ;; definition for method 181 of type ginsu -(defmethod ginsu-method-181 ginsu ((this ginsu) (arg0 vector)) +(defmethod ginsu-method-181 ((this ginsu) (arg0 vector)) (vector-reset! arg0) (let ((a0-2 (handle->process (-> this focus handle)))) (if a0-2 @@ -415,7 +407,7 @@ ;; definition for method 55 of type ginsu ;; WARN: Return type mismatch symbol vs none. -(defmethod track-target! ginsu ((this ginsu)) +(defmethod track-target! ((this ginsu)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -478,7 +470,7 @@ ;; definition for method 182 of type ginsu ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ginsu-method-182 ginsu ((this ginsu)) +(defmethod ginsu-method-182 ((this ginsu)) (local-vars (s5-1 art-element)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'matrix)) @@ -549,7 +541,7 @@ ;; definition for method 142 of type ginsu ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 ginsu ((this ginsu) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this ginsu) (arg0 nav-control)) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((a0-2 (handle->process (-> this focus handle)))) (cond @@ -586,7 +578,7 @@ ;; definition for method 74 of type ginsu ;; WARN: disable def twice: 11. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler ginsu ((this ginsu) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this ginsu) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v0-1 object)) @@ -960,7 +952,7 @@ ) ;; definition for method 70 of type ginsu -(defmethod go-hostile ginsu ((this ginsu)) +(defmethod go-hostile ((this ginsu)) (cond ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) (nav-enemy-method-163 this) @@ -982,7 +974,7 @@ ;; definition for method 116 of type ginsu ;; WARN: Return type mismatch object vs none. -(defmethod go-idle ginsu ((this ginsu)) +(defmethod go-idle ((this ginsu)) (if (not (logtest? (-> this ambush-path flags) (path-control-flag not-found))) (go (method-of-object this ambush)) (go (method-of-object this idle)) @@ -991,7 +983,7 @@ ) ;; definition for method 10 of type ginsu -(defmethod deactivate ginsu ((this ginsu)) +(defmethod deactivate ((this ginsu)) (if (nonzero? (-> this blade-part)) (kill-and-free-particles (-> this blade-part)) ) @@ -1007,7 +999,7 @@ ;; definition for method 7 of type ginsu ;; WARN: Return type mismatch nav-enemy vs ginsu. -(defmethod relocate ginsu ((this ginsu) (arg0 int)) +(defmethod relocate ((this ginsu) (arg0 int)) (if (nonzero? (-> this blade-jm)) (&+! (-> this blade-jm) arg0) ) @@ -1022,7 +1014,7 @@ ;; definition for method 183 of type ginsu ;; WARN: Return type mismatch int vs none. -(defmethod ginsu-method-183 ginsu ((this ginsu) (arg0 symbol)) +(defmethod ginsu-method-183 ((this ginsu) (arg0 symbol)) (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 @@ -1041,7 +1033,7 @@ ;; definition for method 46 of type ginsu ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-46 ginsu ((this ginsu) (arg0 int)) +(defmethod enemy-method-46 ((this ginsu) (arg0 int)) "@abstract" (case arg0 ((1) @@ -1059,7 +1051,7 @@ ;; definition for method 114 of type ginsu ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! ginsu ((this ginsu)) +(defmethod init-enemy-collision! ((this ginsu)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1127,7 +1119,7 @@ ;; definition for method 115 of type ginsu ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! ginsu ((this ginsu)) +(defmethod init-enemy! ((this ginsu)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (stack-size-set! (-> this main-thread) 256) (initialize-skeleton diff --git a/test/decompiler/reference/jak2/levels/forest/fish_REF.gc b/test/decompiler/reference/jak2/levels/forest/fish_REF.gc index 573fff4d41b..c00f29eb6bc 100644 --- a/test/decompiler/reference/jak2/levels/forest/fish_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/fish_REF.gc @@ -10,17 +10,13 @@ ;; definition of type minnow (deftype minnow (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type minnow -(defmethod inspect minnow ((this minnow)) +(defmethod inspect ((this minnow)) (when (not this) (set! this this) (goto cfg-4) @@ -83,22 +79,19 @@ ;; definition of type fish (deftype fish (structure) - ((pos vector :inline :offset-assert 0) - (vel vector :inline :offset-assert 16) - (border-f vector :inline :offset-assert 32) - (avoid-d vector :inline :offset-assert 48) - (wander float :offset-assert 64) - (max-speed float :offset-assert 68) - (speed float :offset-assert 72) - (handle handle :offset-assert 80) + ((pos vector :inline) + (vel vector :inline) + (border-f vector :inline) + (avoid-d vector :inline) + (wander float) + (max-speed float) + (speed float) + (handle handle) ) - :method-count-assert 9 - :size-assert #x58 - :flag-assert #x900000058 ) ;; definition for method 3 of type fish -(defmethod inspect fish ((this fish)) +(defmethod inspect ((this fish)) (when (not this) (set! this this) (goto cfg-4) @@ -118,19 +111,15 @@ ;; definition of type fish-manager (deftype fish-manager (process-drawable) - ((fishes fish 12 :inline :offset-assert 208) + ((fishes fish 12 :inline) ) - :heap-base #x4d0 - :method-count-assert 21 - :size-assert #x550 - :flag-assert #x1504d00550 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type fish-manager -(defmethod inspect fish-manager ((this fish-manager)) +(defmethod inspect ((this fish-manager)) (when (not this) (set! this this) (goto cfg-4) @@ -495,7 +484,7 @@ ;; definition for method 11 of type fish-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fish-manager ((this fish-manager) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fish-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc b/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc index ddcb89dcaa7..4cb0b71b913 100644 --- a/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc @@ -14,16 +14,12 @@ ;; definition of type forest-hover-manager (deftype forest-hover-manager (hover-enemy-manager) - ((transport-actor entity-actor 2 :offset-assert 168) + ((transport-actor entity-actor 2) ) - :heap-base #x30 - :method-count-assert 19 - :size-assert #xb0 - :flag-assert #x13003000b0 ) ;; definition for method 3 of type forest-hover-manager -(defmethod inspect forest-hover-manager ((this forest-hover-manager)) +(defmethod inspect ((this forest-hover-manager)) (when (not this) (set! this this) (goto cfg-4) @@ -38,7 +34,7 @@ ;; definition for method 11 of type forest-hover-manager ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! forest-hover-manager ((this forest-hover-manager) (arg0 entity-actor)) +(defmethod init-from-entity! ((this forest-hover-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -69,31 +65,27 @@ This commonly includes things such as: ;; definition of type forest-youngsamos (deftype forest-youngsamos (process-focusable) - ((root collide-shape-moving :override) - (init-quat quaternion :inline :offset-assert 208) - (desired-pos vector :inline :offset-assert 224) - (hit-dir vector :inline :offset-assert 240) - (hit-points float :offset-assert 256) - (incoming-attack-id uint32 :offset-assert 260) - (falling? basic :offset-assert 264) - (focus-disable-timer uint64 :offset-assert 272) - (hud handle :offset-assert 280) - (sound-id sound-id :offset-assert 288) + ((root collide-shape-moving :override) + (init-quat quaternion :inline) + (desired-pos vector :inline) + (hit-dir vector :inline) + (hit-points float) + (incoming-attack-id uint32) + (falling? basic) + (focus-disable-timer uint64) + (hud handle) + (sound-id sound-id) ) - :heap-base #xb0 - :method-count-assert 31 - :size-assert #x124 - :flag-assert #x1f00b00124 - (:methods - (idle () _type_ :state 27) - (hit () _type_ :state 28) - (die () _type_ :state 29) - (dormant () _type_ :state 30) + (:state-methods + idle + hit + die + dormant ) ) ;; definition for method 3 of type forest-youngsamos -(defmethod inspect forest-youngsamos ((this forest-youngsamos)) +(defmethod inspect ((this forest-youngsamos)) (when (not this) (set! this this) (goto cfg-4) @@ -436,7 +428,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type forest-youngsamos -(defmethod deactivate forest-youngsamos ((this forest-youngsamos)) +(defmethod deactivate ((this forest-youngsamos)) (if (valid? (-> this hud) (the-as type #f) "" #t 0) (send-event (handle->process (-> this hud)) 'hide-and-die) ) @@ -448,7 +440,7 @@ This commonly includes things such as: ;; definition for method 11 of type forest-youngsamos ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! forest-youngsamos ((this forest-youngsamos) (arg0 entity-actor)) +(defmethod init-from-entity! ((this forest-youngsamos) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/forest/forest-part_REF.gc b/test/decompiler/reference/jak2/levels/forest/forest-part_REF.gc index 8645797cb91..4823f03bd36 100644 --- a/test/decompiler/reference/jak2/levels/forest/forest-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/forest-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type forest-part (deftype forest-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type forest-part -(defmethod inspect forest-part ((this forest-part)) +(defmethod inspect ((this forest-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc index 449fb06290a..4a982db0603 100644 --- a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc @@ -3,18 +3,15 @@ ;; definition of type pegasus-path-info (deftype pegasus-path-info (structure) - ((num-data int32 :offset-assert 0) - (path-data curve-control :offset-assert 4) - (control-data (pointer float) :offset-assert 8) + ((num-data int32) + (path-data curve-control) + (control-data (pointer float)) ) :allow-misaligned - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type pegasus-path-info -(defmethod inspect pegasus-path-info ((this pegasus-path-info)) +(defmethod inspect ((this pegasus-path-info)) (when (not this) (set! this this) (goto cfg-4) @@ -29,40 +26,36 @@ ;; definition of type pegasus (deftype pegasus (enemy) - ((curve-position float :offset-assert 532) - (speed float :offset-assert 536) - (facing vector :inline :offset-assert 544) - (tangent vector :inline :offset-assert 560) - (run-blend-interp float :offset-assert 576) - (near-timer int32 :offset-assert 580) - (far-time time-frame :offset-assert 584) - (y-offset float :offset-assert 592) - (y-offset-desired float :offset-assert 596) - (y-vel float :offset-assert 600) - (water-height float :offset-assert 604) - (timeout uint64 :offset-assert 608) - (ambient-possible uint64 :offset-assert 616) - (ambient-expire uint64 :offset-assert 624) - (can-run symbol :offset-assert 632) - (on-ground symbol :offset-assert 636) - (over-ground symbol :offset-assert 640) - (allow-idle symbol :offset-assert 644) - (path-info pegasus-path-info 20 :inline :offset-assert 648) - (previous-path int32 :offset 968) - (current-path int32 :offset 972) - (num-paths int32 :offset 976) - (display-path int32 :offset 980) - (targetted-timer time-frame :offset 984) + ((curve-position float) + (speed float) + (facing vector :inline) + (tangent vector :inline) + (run-blend-interp float) + (near-timer int32) + (far-time time-frame) + (y-offset float) + (y-offset-desired float) + (y-vel float) + (water-height float) + (timeout uint64) + (ambient-possible uint64) + (ambient-expire uint64) + (can-run symbol) + (on-ground symbol) + (over-ground symbol) + (allow-idle symbol) + (path-info pegasus-path-info 20 :inline) + (previous-path int32 :offset 968) + (current-path int32 :offset 972) + (num-paths int32 :offset 976) + (display-path int32 :offset 980) + (targetted-timer time-frame :offset 984) ) - :heap-base #x360 - :method-count-assert 138 - :size-assert #x3e0 - :flag-assert #x8a036003e0 (:methods - (run-logic? (_type_) symbol :replace 12) - (damage-amount-from-attack (_type_ process event-message-block) int :replace 56) - (update-target-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware :replace 57) - (track-how-long-aimed-at! (_type_) none 137) + (run-logic? (_type_) symbol :replace) + (damage-amount-from-attack (_type_ process event-message-block) int :replace) + (update-target-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware :replace) + (track-how-long-aimed-at! (_type_) none) ) (:states pegasus-debug @@ -71,7 +64,7 @@ ) ;; definition for method 3 of type pegasus -(defmethod inspect pegasus ((this pegasus)) +(defmethod inspect ((this pegasus)) (when (not this) (set! this this) (goto cfg-4) @@ -202,7 +195,7 @@ (set! (-> *pegasus-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 12 of type pegasus -(defmethod run-logic? pegasus ((this pegasus)) +(defmethod run-logic? ((this pegasus)) "Calls [[process-tree::12]] if we are considered in-range of the [[pegasus]], otherwise returns [[#t]]" (let ((min-distance 491520.0)) (if (< (* min-distance min-distance) (vector-vector-distance-squared (-> this root trans) (camera-pos))) @@ -214,7 +207,7 @@ ;; definition for method 137 of type pegasus ;; WARN: Return type mismatch int vs none. -(defmethod track-how-long-aimed-at! pegasus ((this pegasus)) +(defmethod track-how-long-aimed-at! ((this pegasus)) "Updates `targetted-timer` with the `frame-counter` while Jak is aiming at the [[pegasus]]" (let ((target *target*)) (when (and target (-> target gun active?)) @@ -244,7 +237,7 @@ ;; definition for method 57 of type pegasus ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! pegasus ((this pegasus) (proc process-focusable) (focus enemy-best-focus)) +(defmethod update-target-awareness! ((this pegasus) (proc process-focusable) (focus enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targetted for more than 5 [[seconds]] @returns the value from [[enemy::57]], otherwise [[enemy-aware::4]]" @@ -256,7 +249,7 @@ For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targett ) ;; definition for method 74 of type pegasus -(defmethod general-event-handler pegasus ((this pegasus) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) +(defmethod general-event-handler ((this pegasus) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case event-type @@ -296,7 +289,7 @@ For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targett ) ;; definition for method 56 of type pegasus -(defmethod damage-amount-from-attack pegasus ((this pegasus) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this pegasus) (arg0 process) (arg1 event-message-block)) "Only attacks from the jetboard will deal max damage (6), but by default it will return `1`. This is why the scouts are technically killable by other means @returns the amount of damage taken from an attack. Also updates the `targetted-timer`. @@ -761,7 +754,7 @@ The faster it's moving the fast it flaps it's wings, etc ) ;; definition for method 55 of type pegasus -(defmethod track-target! pegasus ((this pegasus)) +(defmethod track-target! ((this pegasus)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -773,7 +766,7 @@ The faster it's moving the fast it flaps it's wings, etc ) ;; definition for method 99 of type pegasus -(defmethod enemy-method-99 pegasus ((this pegasus) (arg0 process-focusable)) +(defmethod enemy-method-99 ((this pegasus) (arg0 process-focusable)) #t ) @@ -1273,7 +1266,7 @@ The faster it's moving the fast it flaps it's wings, etc ;; definition for method 114 of type pegasus ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! pegasus ((this pegasus)) +(defmethod init-enemy-collision! ((this pegasus)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) @@ -1327,19 +1320,19 @@ The faster it's moving the fast it flaps it's wings, etc ) ;; definition for method 60 of type pegasus -(defmethod coin-flip? pegasus ((this pegasus)) +(defmethod coin-flip? ((this pegasus)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 108 of type pegasus -(defmethod enemy-method-108 pegasus ((this pegasus) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 ((this pegasus) (arg0 enemy) (arg1 event-message-block)) 0 ) ;; definition for method 7 of type pegasus ;; WARN: Return type mismatch enemy vs pegasus. -(defmethod relocate pegasus ((this pegasus) (arg0 int)) +(defmethod relocate ((this pegasus) (arg0 int)) (countdown (v1-0 20) (if (-> this path-info v1-0 path-data) (&+! (-> this path-info v1-0 path-data) arg0) @@ -1351,7 +1344,7 @@ The faster it's moving the fast it flaps it's wings, etc ;; definition for method 115 of type pegasus ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! pegasus ((this pegasus)) +(defmethod init-enemy! ((this pegasus)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (tag res-tag)) (initialize-skeleton diff --git a/test/decompiler/reference/jak2/levels/forest/predator-h_REF.gc b/test/decompiler/reference/jak2/levels/forest/predator-h_REF.gc index c3ad317d51d..6f92db9737e 100644 --- a/test/decompiler/reference/jak2/levels/forest/predator-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/predator-h_REF.gc @@ -3,24 +3,21 @@ ;; definition of type predator-node (deftype predator-node (structure) - ((position vector :inline :offset-assert 0) - (nav-mesh-id uint32 :offset-assert 16) - (edge-index int16 :offset-assert 20) - (edge-count int16 :offset-assert 22) - (radius float :offset-assert 24) - (flags predator-node-flag :offset-assert 28) - (points uint32 :offset-assert 32) - (pos-x float :offset 0) - (pos-y float :offset 4) - (pos-z float :offset 8) + ((position vector :inline) + (nav-mesh-id uint32) + (edge-index int16) + (edge-count int16) + (radius float) + (flags predator-node-flag) + (points uint32) + (pos-x float :overlay-at (-> position data 0)) + (pos-y float :overlay-at (-> position data 1)) + (pos-z float :overlay-at (-> position data 2)) ) - :method-count-assert 9 - :size-assert #x24 - :flag-assert #x900000024 ) ;; definition for method 3 of type predator-node -(defmethod inspect predator-node ((this predator-node)) +(defmethod inspect ((this predator-node)) (when (not this) (set! this this) (goto cfg-8) @@ -51,17 +48,14 @@ ;; definition of type predator-edge (deftype predator-edge (structure) - ((dest-node-id uint16 :offset-assert 0) - (flags predator-edge-flag :offset-assert 2) + ((dest-node-id uint16) + (flags predator-edge-flag) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type predator-edge -(defmethod inspect predator-edge ((this predator-edge)) +(defmethod inspect ((this predator-edge)) (when (not this) (set! this this) (goto cfg-4) @@ -77,18 +71,15 @@ ;; definition of type predator-graph (deftype predator-graph (structure) - ((node-count uint16 :offset-assert 0) - (edge-count uint16 :offset-assert 2) - (node (inline-array predator-node) :offset-assert 4) - (edge (inline-array predator-edge) :offset-assert 8) + ((node-count uint16) + (edge-count uint16) + (node (inline-array predator-node)) + (edge (inline-array predator-edge)) ) - :method-count-assert 9 - :size-assert #xc - :flag-assert #x90000000c ) ;; definition for method 3 of type predator-graph -(defmethod inspect predator-graph ((this predator-graph)) +(defmethod inspect ((this predator-graph)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc index 869b481ce21..e7b4a1f3aa6 100644 --- a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 15 of type hud-predator ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-predator ((this hud-predator)) +(defmethod draw ((this hud-predator)) (set-hud-piece-position! (-> this sprites 1) (the int (+ 480.0 (* 130.0 (-> this offset)))) 205) (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -44 0) (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) @@ -15,7 +15,7 @@ ;; definition for method 16 of type hud-predator ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-predator ((this hud-predator)) +(defmethod update-values ((this hud-predator)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -24,7 +24,7 @@ ;; definition for method 17 of type hud-predator ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-predator ((this hud-predator)) +(defmethod init-callback ((this hud-predator)) (set! (-> this level) (level-get *level* 'forest)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -47,7 +47,7 @@ ;; definition for method 15 of type hud-pegasus ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-pegasus ((this hud-pegasus)) +(defmethod draw ((this hud-pegasus)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 472.0 (* 130.0 (-> this offset)))) @@ -63,7 +63,7 @@ ;; definition for method 16 of type hud-pegasus ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-pegasus ((this hud-pegasus)) +(defmethod update-values ((this hud-pegasus)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -72,7 +72,7 @@ ;; definition for method 17 of type hud-pegasus ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-pegasus ((this hud-pegasus)) +(defmethod init-callback ((this hud-pegasus)) (set! (-> this level) (level-get *level* 'forest)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -110,14 +110,10 @@ ;; definition of type predator-shot (deftype predator-shot (metalhead-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type predator-shot -(defmethod inspect predator-shot ((this predator-shot)) +(defmethod inspect ((this predator-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -131,7 +127,7 @@ ;; definition for method 28 of type predator-shot ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound predator-shot ((this predator-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this predator-shot) (arg0 projectile-options)) (case arg0 (((projectile-options lose-altitude)) (sound-play "pred-shot-hit") @@ -151,7 +147,7 @@ ;; definition for method 30 of type predator-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! predator-shot ((this predator-shot)) +(defmethod init-proj-collision! ((this predator-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -205,7 +201,7 @@ ;; definition for method 31 of type predator-shot ;; INFO: Used lq/sq -(defmethod init-proj-settings! predator-shot ((this predator-shot)) +(defmethod init-proj-settings! ((this predator-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'predator-shot) @@ -226,41 +222,39 @@ ;; definition of type predator (deftype predator (nav-enemy) - ((los los-control :inline :offset-assert 608) - (want-stop symbol :offset-assert 756) - (target-pos vector :inline :offset-assert 768) - (curr-node int32 :offset-assert 784) - (hide-pos vector :inline :offset-assert 800) - (next-change uint64 :offset-assert 816) - (shoot-angle float :offset-assert 824) - (miss-amount float :offset-assert 828) - (ambient-sound-id sound-id :offset-assert 832) - (shock-effect-time time-frame :offset-assert 840) - (shock-effect-end uint64 :offset-assert 848) - (fade float :offset-assert 856) - (dest-fade float :offset-assert 860) + ((los los-control :inline) + (want-stop symbol) + (target-pos vector :inline) + (curr-node int32) + (hide-pos vector :inline) + (next-change uint64) + (shoot-angle float) + (miss-amount float) + (ambient-sound-id sound-id) + (shock-effect-time time-frame) + (shock-effect-end uint64) + (fade float) + (dest-fade float) ) - :heap-base #x2e0 - :method-count-assert 189 - :size-assert #x360 - :flag-assert #xbd02e00360 + (:state-methods + close-attack + fire + hide + hidden + ) (:methods - (close-attack () _type_ :state 178) - (fire () _type_ :state 179) - (hide () _type_ :state 180) - (hidden () _type_ :state 181) - (set-dangerous! (_type_ symbol) symbol 182) - (predator-method-183 (_type_) none 183) - (predator-method-184 (_type_ int float) none 184) - (predator-method-185 (_type_) none 185) - (predator-method-186 (_type_) none 186) - (predator-method-187 (_type_) symbol 187) - (predator-method-188 (_type_ vector vector vector) none 188) + (set-dangerous! (_type_ symbol) symbol) + (predator-method-183 (_type_) none) + (predator-method-184 (_type_ int float) none) + (predator-method-185 (_type_) none) + (predator-method-186 (_type_) none) + (predator-method-187 (_type_) symbol) + (predator-method-188 (_type_ vector vector vector) none) ) ) ;; definition for method 3 of type predator -(defmethod inspect predator ((this predator)) +(defmethod inspect ((this predator)) (when (not this) (set! this this) (goto cfg-4) @@ -465,7 +459,7 @@ (set! (-> *predator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type predator -(defmethod general-event-handler predator ((this predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -488,7 +482,7 @@ ) ;; definition for method 77 of type predator -(defmethod enemy-method-77 predator ((this predator) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this predator) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (case (-> this incoming knocked-type) @@ -581,7 +575,7 @@ ) ;; definition for method 78 of type predator -(defmethod enemy-method-78 predator ((this predator) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this predator) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (case (-> this incoming knocked-type) @@ -659,7 +653,7 @@ ;; definition for method 188 of type predator ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod predator-method-188 predator ((this predator) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod predator-method-188 ((this predator) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f0-0 1228.8) (f30-0 6144.0) @@ -732,7 +726,7 @@ ;; definition for method 184 of type predator ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod predator-method-184 predator ((this predator) (arg0 int) (arg1 float)) +(defmethod predator-method-184 ((this predator) (arg0 int) (arg1 float)) (local-vars (sv-224 vector) (sv-240 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -874,7 +868,7 @@ ;; definition for method 183 of type predator ;; WARN: Return type mismatch int vs none. -(defmethod predator-method-183 predator ((this predator)) +(defmethod predator-method-183 ((this predator)) (cond ((< (-> this hit-points) 2) (when (!= (-> this dest-fade) 128.0) @@ -1293,7 +1287,7 @@ ;; definition for method 186 of type predator ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod predator-method-186 predator ((this predator)) +(defmethod predator-method-186 ((this predator)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1341,7 +1335,7 @@ ) ;; definition for method 185 of type predator -(defmethod predator-method-185 predator ((this predator)) +(defmethod predator-method-185 ((this predator)) (let ((f30-0 0.0) (s5-0 -1) ) @@ -1364,7 +1358,7 @@ ) ;; definition for method 187 of type predator -(defmethod predator-method-187 predator ((this predator)) +(defmethod predator-method-187 ((this predator)) (let* ((s5-0 (-> *predator-graph* node (-> this curr-node))) (s4-0 (rand-vu-int-count (-> s5-0 edge-count))) ) @@ -1394,7 +1388,7 @@ ;; definition for method 55 of type predator ;; WARN: Return type mismatch int vs none. -(defmethod track-target! predator ((this predator)) +(defmethod track-target! ((this predator)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1412,7 +1406,7 @@ ) ;; definition for method 182 of type predator -(defmethod set-dangerous! predator ((this predator) (arg0 symbol)) +(defmethod set-dangerous! ((this predator) (arg0 symbol)) (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) @@ -1428,7 +1422,7 @@ ;; definition for method 114 of type predator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! predator ((this predator)) +(defmethod init-enemy-collision! ((this predator)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1506,13 +1500,13 @@ ) ;; definition for method 7 of type predator -(defmethod relocate predator ((this predator) (arg0 int)) +(defmethod relocate ((this predator) (arg0 int)) (call-parent-method this arg0) ) ;; definition for method 167 of type predator ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-167 predator ((this predator)) +(defmethod nav-enemy-method-167 ((this predator)) (let ((v1-0 (-> this nav))) (set! (-> v1-0 target-speed) 0.0) ) @@ -1526,13 +1520,13 @@ ) ;; definition for method 12 of type predator -(defmethod run-logic? predator ((this predator)) +(defmethod run-logic? ((this predator)) #t ) ;; definition for method 63 of type predator ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 predator ((this predator) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this predator) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) (the-as symbol (if (t9-0 this arg0 arg1) (set-dst-proc! (-> this los) (-> this focus handle)) @@ -1543,7 +1537,7 @@ ;; definition for method 11 of type predator ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! predator ((this predator) (arg0 entity-actor)) +(defmethod init-from-entity! ((this predator) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1556,7 +1550,7 @@ This commonly includes things such as: ;; definition for method 113 of type predator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-behaviour-and-stats! predator ((this predator) (arg0 nav-enemy-info)) +(defmethod init-enemy-behaviour-and-stats! ((this predator) (arg0 nav-enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-behaviour-and-stats!))) @@ -1570,7 +1564,7 @@ This commonly includes things such as: ;; definition for method 115 of type predator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! predator ((this predator)) +(defmethod init-enemy! ((this predator)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1615,25 +1609,23 @@ This commonly includes things such as: ;; definition of type predator-manager (deftype predator-manager (process) - ((predator-count uint32 :offset-assert 128) - (predator-h handle 32 :offset-assert 136) - (hud-counter handle :offset-assert 392) - (actor-group (pointer actor-group) :offset-assert 400) - (actor-group-count int32 :offset-assert 404) + ((predator-count uint32) + (predator-h handle 32) + (hud-counter handle) + (actor-group (pointer actor-group)) + (actor-group-count int32) ) - :heap-base #x120 - :method-count-assert 17 - :size-assert #x198 - :flag-assert #x1101200198 + (:state-methods + idle + closed + ) (:methods - (idle () _type_ :state 14) - (closed () _type_ :state 15) - (predator-manager-method-16 (_type_) none 16) + (predator-manager-method-16 (_type_) none) ) ) ;; definition for method 3 of type predator-manager -(defmethod inspect predator-manager ((this predator-manager)) +(defmethod inspect ((this predator-manager)) (when (not this) (set! this this) (goto cfg-7) @@ -1658,7 +1650,7 @@ This commonly includes things such as: ;; definition for method 7 of type predator-manager ;; WARN: Return type mismatch process vs predator-manager. -(defmethod relocate predator-manager ((this predator-manager) (arg0 int)) +(defmethod relocate ((this predator-manager) (arg0 int)) (set! *predator-manager* this) (if *predator-manager* (set! *predator-manager* (&+ *predator-manager* arg0)) @@ -1668,7 +1660,7 @@ This commonly includes things such as: ;; definition for method 16 of type predator-manager ;; WARN: Return type mismatch int vs none. -(defmethod predator-manager-method-16 predator-manager ((this predator-manager)) +(defmethod predator-manager-method-16 ((this predator-manager)) 0 (none) ) @@ -1722,7 +1714,7 @@ This commonly includes things such as: ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. ;; WARN: new jak 2 until loop case, check carefully -(defmethod init-from-entity! predator-manager ((this predator-manager) (arg0 entity-actor)) +(defmethod init-from-entity! ((this predator-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/forest/wren_REF.gc b/test/decompiler/reference/jak2/levels/forest/wren_REF.gc index 2a9e55164fa..6e178edb2d3 100644 --- a/test/decompiler/reference/jak2/levels/forest/wren_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/wren_REF.gc @@ -3,39 +3,37 @@ ;; definition of type wren (deftype wren (process-drawable) - ((move-dest vector :inline :offset-assert 208) - (fly-curve curve-control 2 :offset-assert 224) - (fly-index uint32 :offset-assert 232) - (fly-speed float :offset-assert 236) - (fly-y-rate float :offset-assert 240) - (fly-interp float :offset-assert 244) - (path-u float :offset-assert 248) - (path-du float :offset-assert 252) - (path-du-mod float :offset-assert 256) - (bob-level float :offset-assert 260) - (bob-level-seek float :offset-assert 264) - (bank-angle float :offset-assert 268) - (peck-timer uint64 :offset-assert 272) - (flags wren-flags :offset-assert 280) + ((move-dest vector :inline) + (fly-curve curve-control 2) + (fly-index uint32) + (fly-speed float) + (fly-y-rate float) + (fly-interp float) + (path-u float) + (path-du float) + (path-du-mod float) + (bob-level float) + (bob-level-seek float) + (bank-angle float) + (peck-timer uint64) + (flags wren-flags) ) - :heap-base #xa0 - :method-count-assert 28 - :size-assert #x11a - :flag-assert #x1c00a0011a + (:state-methods + hunt + peck + fly + land + on-branch + die + ) (:methods - (hunt () _type_ :state 20) - (peck () _type_ :state 21) - (fly () _type_ :state 22) - (land () _type_ :state 23) - (on-branch () _type_ :state 24) - (die () _type_ :state 25) - (spooked? (_type_) symbol 26) - (debug-draw-path (_type_) symbol 27) + (spooked? (_type_) symbol) + (debug-draw-path (_type_) symbol) ) ) ;; definition for method 3 of type wren -(defmethod inspect wren ((this wren)) +(defmethod inspect ((this wren)) (when (not this) (set! this this) (goto cfg-4) @@ -68,7 +66,7 @@ ) ;; definition for method 27 of type wren -(defmethod debug-draw-path wren ((this wren)) +(defmethod debug-draw-path ((this wren)) "Draws the associated [[curve-control]]s associated with this wren" (dotimes (s5-0 2) (if (-> this fly-curve s5-0) @@ -138,7 +136,7 @@ ;; definition for method 26 of type wren ;; WARN: Return type mismatch object vs symbol. -(defmethod spooked? wren ((this wren)) +(defmethod spooked? ((this wren)) "@returns a [[symbol]] indicating if Jak is considered close enough to the wren to spook it. If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (let* ((gp-0 *target*) @@ -448,7 +446,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ;; definition for method 7 of type wren -(defmethod relocate wren ((this wren) (arg0 int)) +(defmethod relocate ((this wren) (arg0 int)) (dotimes (v1-0 2) (when (-> this fly-curve v1-0) (if (nonzero? (-> this fly-curve v1-0)) @@ -461,7 +459,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ;; definition for method 11 of type wren ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! wren ((this wren) (arg0 entity-actor)) +(defmethod init-from-entity! ((this wren) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-obs_REF.gc index 505bc751ed8..fee740cecb4 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-obs_REF.gc @@ -3,26 +3,22 @@ ;; definition of type fort-elec-switch (deftype fort-elec-switch (process-drawable) - ((root collide-shape :override) - (l-bolt lightning-control :offset-assert 200) - (notify-actor entity-actor :offset-assert 204) - (tank-actor entity-actor :offset-assert 208) - (switch-group (pointer actor-group) :offset-assert 212) - (switch-group-count int32 :offset-assert 216) + ((root collide-shape :override) + (l-bolt lightning-control) + (notify-actor entity-actor) + (tank-actor entity-actor) + (switch-group (pointer actor-group)) + (switch-group-count int32) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17006000dc - (:methods - (idle () _type_ :state 20) - (play-hint () _type_ :state 21) - (die () _type_ :state 22) + (:state-methods + idle + play-hint + die ) ) ;; definition for method 3 of type fort-elec-switch -(defmethod inspect fort-elec-switch ((this fort-elec-switch)) +(defmethod inspect ((this fort-elec-switch)) (when (not this) (set! this this) (goto cfg-7) @@ -247,7 +243,7 @@ ;; definition for method 7 of type fort-elec-switch ;; WARN: Return type mismatch process-drawable vs fort-elec-switch. -(defmethod relocate fort-elec-switch ((this fort-elec-switch) (arg0 int)) +(defmethod relocate ((this fort-elec-switch) (arg0 int)) (if (nonzero? (-> this l-bolt)) (&+! (-> this l-bolt) arg0) ) @@ -257,7 +253,7 @@ ;; definition for method 11 of type fort-elec-switch ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-elec-switch ((this fort-elec-switch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-elec-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -350,26 +346,24 @@ This commonly includes things such as: ;; definition of type fort-fence (deftype fort-fence (process-drawable) - ((root collide-shape :override) - (anim spool-anim :offset-assert 200) - (exit-anim basic :offset-assert 204) - (loading? symbol :offset-assert 208) - (tank handle :offset-assert 216) + ((root collide-shape :override) + (anim spool-anim) + (exit-anim basic) + (loading? symbol) + (tank handle) ) - :heap-base #x60 - :method-count-assert 24 - :size-assert #xe0 - :flag-assert #x18006000e0 + (:state-methods + idle + breaking + ) (:methods - (idle () _type_ :state 20) - (breaking () _type_ :state 21) - (fort-fence-method-22 (_type_) none 22) - (fort-fence-method-23 (_type_) none 23) + (fort-fence-method-22 (_type_) none) + (fort-fence-method-23 (_type_) none) ) ) ;; definition for method 3 of type fort-fence -(defmethod inspect fort-fence ((this fort-fence)) +(defmethod inspect ((this fort-fence)) (when (not this) (set! this this) (goto cfg-4) @@ -399,14 +393,14 @@ This commonly includes things such as: ;; definition for method 22 of type fort-fence ;; WARN: Return type mismatch int vs none. -(defmethod fort-fence-method-22 fort-fence ((this fort-fence)) +(defmethod fort-fence-method-22 ((this fort-fence)) 0 (none) ) ;; definition for method 23 of type fort-fence ;; WARN: Return type mismatch int vs none. -(defmethod fort-fence-method-23 fort-fence ((this fort-fence)) +(defmethod fort-fence-method-23 ((this fort-fence)) 0 (none) ) @@ -497,7 +491,7 @@ This commonly includes things such as: ;; definition for method 11 of type fort-fence ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-fence ((this fort-fence) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-fence) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -532,14 +526,10 @@ This commonly includes things such as: ;; definition of type fort-fence-a (deftype fort-fence-a (fort-fence) () - :heap-base #x60 - :method-count-assert 24 - :size-assert #xe0 - :flag-assert #x18006000e0 ) ;; definition for method 3 of type fort-fence-a -(defmethod inspect fort-fence-a ((this fort-fence-a)) +(defmethod inspect ((this fort-fence-a)) (when (not this) (set! this this) (goto cfg-4) @@ -554,14 +544,10 @@ This commonly includes things such as: ;; definition of type fort-fence-b (deftype fort-fence-b (fort-fence) () - :heap-base #x60 - :method-count-assert 24 - :size-assert #xe0 - :flag-assert #x18006000e0 ) ;; definition for method 3 of type fort-fence-b -(defmethod inspect fort-fence-b ((this fort-fence-b)) +(defmethod inspect ((this fort-fence-b)) (when (not this) (set! this this) (goto cfg-4) @@ -575,7 +561,7 @@ This commonly includes things such as: ;; definition for method 22 of type fort-fence-a ;; WARN: Return type mismatch int vs none. -(defmethod fort-fence-method-22 fort-fence-a ((this fort-fence-a)) +(defmethod fort-fence-method-22 ((this fort-fence-a)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-fence-a" (the-as (pointer uint32) #f))) @@ -591,7 +577,7 @@ This commonly includes things such as: ;; definition for method 22 of type fort-fence-b ;; WARN: Return type mismatch int vs none. -(defmethod fort-fence-method-22 fort-fence-b ((this fort-fence-b)) +(defmethod fort-fence-method-22 ((this fort-fence-b)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-fence-b" (the-as (pointer uint32) #f))) @@ -607,7 +593,7 @@ This commonly includes things such as: ;; definition for method 23 of type fort-fence-a ;; WARN: Return type mismatch int vs none. -(defmethod fort-fence-method-23 fort-fence-a ((this fort-fence-a)) +(defmethod fort-fence-method-23 ((this fort-fence-a)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -641,7 +627,7 @@ This commonly includes things such as: ;; definition for method 23 of type fort-fence-b ;; WARN: Return type mismatch int vs none. -(defmethod fort-fence-method-23 fort-fence-b ((this fort-fence-b)) +(defmethod fort-fence-method-23 ((this fort-fence-b)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-part_REF.gc index 0990051bc40..f9975dae875 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type fordumpa-part (deftype fordumpa-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type fordumpa-part -(defmethod inspect fordumpa-part ((this fordumpa-part)) +(defmethod inspect ((this fordumpa-part)) (when (not this) (set! this this) (goto cfg-4) @@ -1524,7 +1520,7 @@ ;; definition for method 24 of type fort-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod elec-gate-method-24 fort-elec-gate ((this fort-elec-gate)) +(defmethod elec-gate-method-24 ((this fort-elec-gate)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 551) this)) (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 552) this)) 0 diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-obs_REF.gc index 850117dd789..d06db952f41 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-obs_REF.gc @@ -3,19 +3,15 @@ ;; definition of type fort-plat-orbit (deftype fort-plat-orbit (process-drawable) - ((sync sync-linear :inline :offset-assert 200) + ((sync sync-linear :inline) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15006000d8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type fort-plat-orbit -(defmethod inspect fort-plat-orbit ((this fort-plat-orbit)) +(defmethod inspect ((this fort-plat-orbit)) (when (not this) (set! this this) (goto cfg-4) @@ -65,7 +61,7 @@ ;; definition for method 11 of type fort-plat-orbit ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-plat-orbit ((this fort-plat-orbit) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-plat-orbit) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -167,20 +163,16 @@ This commonly includes things such as: ;; definition of type fort-plat-shuttle-plat (deftype fort-plat-shuttle-plat (process-drawable) - ((path-pos float :offset-assert 200) - (path-speed float :offset-assert 204) + ((path-pos float) + (path-speed float) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type fort-plat-shuttle-plat -(defmethod inspect fort-plat-shuttle-plat ((this fort-plat-shuttle-plat)) +(defmethod inspect ((this fort-plat-shuttle-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -281,22 +273,20 @@ This commonly includes things such as: ;; definition of type fort-plat-shuttle (deftype fort-plat-shuttle (process-drawable) - ((next-spawn-time time-frame :offset-assert 200) - (sync sync-linear :inline :offset-assert 208) + ((next-spawn-time time-frame) + (sync sync-linear :inline) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xe0 - :flag-assert #x17006000e0 + (:state-methods + dormant + idle + ) (:methods - (dormant () _type_ :state 20) - (idle () _type_ :state 21) - (fort-plat-shuttle-method-22 (_type_) symbol 22) + (fort-plat-shuttle-method-22 (_type_) symbol) ) ) ;; definition for method 3 of type fort-plat-shuttle -(defmethod inspect fort-plat-shuttle ((this fort-plat-shuttle)) +(defmethod inspect ((this fort-plat-shuttle)) (when (not this) (set! this this) (goto cfg-4) @@ -340,7 +330,7 @@ This commonly includes things such as: ) ;; definition for method 22 of type fort-plat-shuttle -(defmethod fort-plat-shuttle-method-22 fort-plat-shuttle ((this fort-plat-shuttle)) +(defmethod fort-plat-shuttle-method-22 ((this fort-plat-shuttle)) (let* ((f28-0 (total-distance (-> this path))) (s5-0 (-> this sync)) (f26-0 81.92) @@ -362,7 +352,7 @@ This commonly includes things such as: ;; definition for method 11 of type fort-plat-shuttle ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-plat-shuttle ((this fort-plat-shuttle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-plat-shuttle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -416,14 +406,10 @@ This commonly includes things such as: ;; definition of type fort-conveyor (deftype fort-conveyor (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) ;; definition for method 3 of type fort-conveyor -(defmethod inspect fort-conveyor ((this fort-conveyor)) +(defmethod inspect ((this fort-conveyor)) (when (not this) (set! this this) (goto cfg-4) @@ -442,14 +428,14 @@ This commonly includes things such as: ) ;; definition for method 22 of type fort-conveyor -(defmethod get-art-group fort-conveyor ((this fort-conveyor)) +(defmethod get-art-group ((this fort-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-fort-conveyor" (the-as (pointer uint32) #f)) ) ;; definition for method 23 of type fort-conveyor ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod reset-root! fort-conveyor ((this fort-conveyor)) +(defmethod reset-root! ((this fort-conveyor)) "Re-initializes the `root` [[trsqv]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -480,7 +466,7 @@ This commonly includes things such as: ;; definition for method 24 of type fort-conveyor ;; WARN: Return type mismatch vector vs none. -(defmethod init! fort-conveyor ((this fort-conveyor)) +(defmethod init! ((this fort-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (set! (-> this belt-radius) 24576.0) (set! (-> this pull-y-threshold) 16384.0) @@ -498,7 +484,7 @@ This commonly includes things such as: ) ;; definition for method 25 of type fort-conveyor -(defmethod set-and-get-ambient-sound! fort-conveyor ((this fort-conveyor)) +(defmethod set-and-get-ambient-sound! ((this fort-conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" (let* ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-part_REF.gc index 38da8d57dfd..5babb38e94e 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type fordumpb-part (deftype fordumpb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type fordumpb-part -(defmethod inspect fordumpb-part ((this fordumpb-part)) +(defmethod inspect ((this fordumpb-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-obs_REF.gc index 2cf98c8a57d..f7a65184825 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-obs_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 15 of type hud-rocketsensor ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-rocketsensor ((this hud-rocketsensor)) +(defmethod draw ((this hud-rocketsensor)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -18,7 +18,7 @@ ;; definition for method 16 of type hud-rocketsensor ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-rocketsensor ((this hud-rocketsensor)) +(defmethod update-values ((this hud-rocketsensor)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -27,7 +27,7 @@ ;; definition for method 17 of type hud-rocketsensor ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-rocketsensor ((this hud-rocketsensor)) +(defmethod init-callback ((this hud-rocketsensor)) (set! (-> this level) (level-get *level* 'fordumpc)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -46,20 +46,16 @@ ;; definition of type fort-dump-bomb-a (deftype fort-dump-bomb-a (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) ;; definition for method 3 of type fort-dump-bomb-a -(defmethod inspect fort-dump-bomb-a ((this fort-dump-bomb-a)) +(defmethod inspect ((this fort-dump-bomb-a)) (when (not this) (set! this this) (goto cfg-4) @@ -165,7 +161,7 @@ ;; definition for method 11 of type fort-dump-bomb-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-dump-bomb-a ((this fort-dump-bomb-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-dump-bomb-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -208,22 +204,18 @@ This commonly includes things such as: ;; definition of type fort-missile-target (deftype fort-missile-target (process-drawable) - ((root collide-shape-moving :override) - (part-mat matrix 2 :inline :offset-assert 208) - (sound-id uint32 :offset-assert 336) + ((root collide-shape-moving :override) + (part-mat matrix 2 :inline) + (sound-id uint32) ) - :heap-base #xe0 - :method-count-assert 22 - :size-assert #x154 - :flag-assert #x1600e00154 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) ;; definition for method 3 of type fort-missile-target -(defmethod inspect fort-missile-target ((this fort-missile-target)) +(defmethod inspect ((this fort-missile-target)) (when (not this) (set! this this) (goto cfg-4) @@ -416,7 +408,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type fort-missile-target -(defmethod deactivate fort-missile-target ((this fort-missile-target)) +(defmethod deactivate ((this fort-missile-target)) (sound-stop (the-as sound-id (-> this sound-id))) (call-parent-method this) (none) @@ -493,32 +485,28 @@ This commonly includes things such as: ;; definition of type fort-missile (deftype fort-missile (process-drawable) - ((root collide-shape :override) - (part-doom sparticle-launch-control :offset-assert 200) - (hud handle :offset-assert 208) - (door-actor entity-actor 2 :offset-assert 216) - (tank-actor entity-actor :offset-assert 224) - (bomb handle 4 :offset-assert 232) - (bomb-count uint32 :offset-assert 264) - (attack-id uint32 :offset-assert 268) - (explosion-sound-id sound-id :offset-assert 272) - (alarm-sound-id sound-id :offset-assert 276) + ((root collide-shape :override) + (part-doom sparticle-launch-control) + (hud handle) + (door-actor entity-actor 2) + (tank-actor entity-actor) + (bomb handle 4) + (bomb-count uint32) + (attack-id uint32) + (explosion-sound-id sound-id) + (alarm-sound-id sound-id) ) - :heap-base #xa0 - :method-count-assert 25 - :size-assert #x118 - :flag-assert #x1900a00118 - (:methods - (idle () _type_ :state 20) - (targets-active () _type_ :state 21) - (missile-countdown () _type_ :state 22) - (die () _type_ :state 23) - (dormant () _type_ :state 24) + (:state-methods + idle + targets-active + missile-countdown + die + dormant ) ) ;; definition for method 3 of type fort-missile -(defmethod inspect fort-missile ((this fort-missile)) +(defmethod inspect ((this fort-missile)) (when (not this) (set! this this) (goto cfg-4) @@ -979,7 +967,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type fort-missile -(defmethod deactivate fort-missile ((this fort-missile)) +(defmethod deactivate ((this fort-missile)) (set-fordumpc-light-flag! #f) (send-event (handle->process (-> this hud)) 'hide-and-die) (if (nonzero? (-> this part-doom)) @@ -991,7 +979,7 @@ This commonly includes things such as: ) ;; definition for method 7 of type fort-missile -(defmethod relocate fort-missile ((this fort-missile) (arg0 int)) +(defmethod relocate ((this fort-missile) (arg0 int)) (if (nonzero? (-> this part-doom)) (&+! (-> this part-doom) arg0) ) @@ -1000,7 +988,7 @@ This commonly includes things such as: ;; definition for method 11 of type fort-missile ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-missile ((this fort-missile) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-missile) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-part_REF.gc index a87ef3de384..ac11c6b711c 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type fordumpc-part (deftype fordumpc-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type fordumpc-part -(defmethod inspect fordumpc-part ((this fordumpc-part)) +(defmethod inspect ((this fordumpc-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc index cf7b051be1c..e502700c117 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc @@ -3,51 +3,49 @@ ;; definition of type fort-robotank-turret (deftype fort-robotank-turret (process-focusable) - ((los los-control :inline :offset-assert 208) - (reticle handle :offset-assert 360) - (screen handle :offset-assert 368) - (tank-quat quaternion :inline :offset-assert 384) - (tank-quat-vibe-only quaternion :inline :offset-assert 400) - (rotate-quat quaternion :inline :offset-assert 416) - (rotate-rate float :offset-assert 432) - (rotate-mult float :offset-assert 436) - (shot-range float :offset-assert 440) - (fov-mult float :offset-assert 444) - (offset vector :inline :offset-assert 448) - (sight-pos vector :inline :offset-assert 464) - (firing-sight-pos vector :inline :offset-assert 480) - (aim-pos vector 3 :inline :offset-assert 496) - (aim-pos-2 vector :inline :offset 512) - (aim-pos-1 vector :inline :offset 528) - (gun-timer time-frame :offset-assert 544) - (gun-elev-jmod joint-mod-set-local :offset-assert 552) - (gun-elev float :offset-assert 556) - (gun-elev-cam float :offset-assert 560) - (gun-joint-l int32 2 :offset-assert 564) - (gun-joint-r int32 2 :offset-assert 572) - (gun-spread float :offset-assert 580) - (gun-index int32 :offset-assert 584) - (flags robotank-turret-flags :offset-assert 588) - (turn-sound-id sound-id :offset-assert 592) + ((los los-control :inline) + (reticle handle) + (screen handle) + (tank-quat quaternion :inline) + (tank-quat-vibe-only quaternion :inline) + (rotate-quat quaternion :inline) + (rotate-rate float) + (rotate-mult float) + (shot-range float) + (fov-mult float) + (offset vector :inline) + (sight-pos vector :inline) + (firing-sight-pos vector :inline) + (aim-pos vector 3 :inline) + (aim-pos-2 vector :inline :overlay-at (-> aim-pos 1)) + (aim-pos-1 vector :inline :overlay-at (-> aim-pos 2)) + (gun-timer time-frame) + (gun-elev-jmod joint-mod-set-local) + (gun-elev float) + (gun-elev-cam float) + (gun-joint-l int32 2) + (gun-joint-r int32 2) + (gun-spread float) + (gun-index int32) + (flags robotank-turret-flags) + (turn-sound-id sound-id) ) - :heap-base #x1e0 - :method-count-assert 35 - :size-assert #x254 - :flag-assert #x2301e00254 + (:state-methods + idle + ready + fire + die + ) (:methods - (idle () _type_ :state 27) - (ready () _type_ :state 28) - (fire () _type_ :state 29) - (die () _type_ :state 30) - (fort-robotank-turret-method-31 (_type_ vector vector) none 31) - (fort-robotank-turret-method-32 (_type_ (inline-array vector)) (pointer process) 32) - (fort-robotank-turret-method-33 (_type_) none 33) - (fort-robotank-turret-method-34 (_type_ vector float) symbol 34) + (fort-robotank-turret-method-31 (_type_ vector vector) none) + (fort-robotank-turret-method-32 (_type_ (inline-array vector)) (pointer process)) + (fort-robotank-turret-method-33 (_type_) none) + (fort-robotank-turret-method-34 (_type_ vector float) symbol) ) ) ;; definition for method 3 of type fort-robotank-turret -(defmethod inspect fort-robotank-turret ((this fort-robotank-turret)) +(defmethod inspect ((this fort-robotank-turret)) (when (not this) (set! this this) (goto cfg-4) @@ -85,25 +83,21 @@ ;; definition of type fort-robotank-reticle (deftype fort-robotank-reticle (process-drawable) - ((shadow-jmod joint-mod :offset-assert 200) - (sight-jmod joint-mod :offset-assert 204) - (ring-jmod joint-mod 3 :offset-assert 208) - (ring-timer time-frame :offset-assert 224) - (sight-scale vector :inline :offset-assert 240) - (collide-dist float :offset-assert 256) + ((shadow-jmod joint-mod) + (sight-jmod joint-mod) + (ring-jmod joint-mod 3) + (ring-timer time-frame) + (sight-scale vector :inline) + (collide-dist float) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x104 - :flag-assert #x1600900104 - (:methods - (idle () _type_ :state 20) - (lock () _type_ :state 21) + (:state-methods + idle + lock ) ) ;; definition for method 3 of type fort-robotank-reticle -(defmethod inspect fort-robotank-reticle ((this fort-robotank-reticle)) +(defmethod inspect ((this fort-robotank-reticle)) (when (not this) (set! this this) (goto cfg-4) @@ -123,26 +117,24 @@ ;; definition of type fort-roboscreen (deftype fort-roboscreen (process-drawable) - ((anim-frame float :offset-assert 200) - (transition float :offset-assert 204) - (gui-id-1 sound-id :offset-assert 208) - (gui-id-2 sound-id :offset-assert 212) + ((anim-frame float) + (transition float) + (gui-id-1 sound-id) + (gui-id-2 sound-id) ) - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd8 - :flag-assert #x19006000d8 + (:state-methods + idle + active + deactive + die + ) (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (deactive () _type_ :state 22) - (die () _type_ :state 23) - (fort-roboscreen-method-24 (_type_) none 24) + (fort-roboscreen-method-24 (_type_) none) ) ) ;; definition for method 3 of type fort-roboscreen -(defmethod inspect fort-roboscreen ((this fort-roboscreen)) +(defmethod inspect ((this fort-roboscreen)) (when (not this) (set! this this) (goto cfg-4) @@ -310,7 +302,7 @@ ;; definition for method 24 of type fort-roboscreen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod fort-roboscreen-method-24 fort-roboscreen ((this fort-roboscreen)) +(defmethod fort-roboscreen-method-24 ((this fort-roboscreen)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -377,7 +369,7 @@ ) ;; definition for method 10 of type fort-roboscreen -(defmethod deactivate fort-roboscreen ((this fort-roboscreen)) +(defmethod deactivate ((this fort-roboscreen)) (disable *screen-filter*) (set-roboscreen-alpha! 0.0) (call-parent-method this) @@ -610,7 +602,7 @@ ;; definition for method 7 of type fort-robotank-reticle ;; WARN: Return type mismatch process-drawable vs fort-robotank-reticle. -(defmethod relocate fort-robotank-reticle ((this fort-robotank-reticle) (arg0 int)) +(defmethod relocate ((this fort-robotank-reticle) (arg0 int)) (if (nonzero? (-> this shadow-jmod)) (&+! (-> this shadow-jmod) arg0) ) @@ -673,14 +665,10 @@ ;; definition of type fort-robotank-shot (deftype fort-robotank-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type fort-robotank-shot -(defmethod inspect fort-robotank-shot ((this fort-robotank-shot)) +(defmethod inspect ((this fort-robotank-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -694,7 +682,7 @@ ;; definition for method 28 of type fort-robotank-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound fort-robotank-shot ((this fort-robotank-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this fort-robotank-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -711,7 +699,7 @@ ;; definition for method 30 of type fort-robotank-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! fort-robotank-shot ((this fort-robotank-shot)) +(defmethod init-proj-collision! ((this fort-robotank-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -765,7 +753,7 @@ ;; definition for method 31 of type fort-robotank-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! fort-robotank-shot ((this fort-robotank-shot)) +(defmethod init-proj-settings! ((this fort-robotank-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'fort-robotank-shot) @@ -973,7 +961,7 @@ ;; definition for method 32 of type fort-robotank-turret ;; INFO: Used lq/sq -(defmethod fort-robotank-turret-method-32 fort-robotank-turret ((this fort-robotank-turret) (arg0 (inline-array vector))) +(defmethod fort-robotank-turret-method-32 ((this fort-robotank-turret) (arg0 (inline-array vector))) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((v1-0 (-> arg0 0)) (a0-1 (-> arg0 1)) @@ -1002,7 +990,7 @@ ;; definition for method 33 of type fort-robotank-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod fort-robotank-turret-method-33 fort-robotank-turret ((this fort-robotank-turret)) +(defmethod fort-robotank-turret-method-33 ((this fort-robotank-turret)) (local-vars (sv-144 vector) (sv-160 vector)) (let ((s3-0 (new 'stack-no-clear 'inline-array 'vector 2)) (s5-0 (new 'stack-no-clear 'inline-array 'vector 4)) @@ -1048,7 +1036,7 @@ ;; definition for method 31 of type fort-robotank-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod fort-robotank-turret-method-31 fort-robotank-turret ((this fort-robotank-turret) (arg0 vector) (arg1 vector)) +(defmethod fort-robotank-turret-method-31 ((this fort-robotank-turret) (arg0 vector) (arg1 vector)) (let ((s3-0 (new 'stack-no-clear 'collide-query)) (f30-0 307200.0) ) @@ -1107,7 +1095,7 @@ ;; definition for method 20 of type fort-robotank-turret ;; WARN: Return type mismatch collide-prim-core vs vector. -(defmethod get-trans fort-robotank-turret ((this fort-robotank-turret) (arg0 int)) +(defmethod get-trans ((this fort-robotank-turret) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (the-as vector (-> this root root-prim prim-core)) ) @@ -1363,7 +1351,7 @@ ;; definition for method 34 of type fort-robotank-turret ;; INFO: Used lq/sq -(defmethod fort-robotank-turret-method-34 fort-robotank-turret ((this fort-robotank-turret) (arg0 vector) (arg1 float)) +(defmethod fort-robotank-turret-method-34 ((this fort-robotank-turret) (arg0 vector) (arg1 float)) (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans))) (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) @@ -1547,7 +1535,7 @@ ) ;; definition for method 10 of type fort-robotank-turret -(defmethod deactivate fort-robotank-turret ((this fort-robotank-turret)) +(defmethod deactivate ((this fort-robotank-turret)) (logclear! (-> this flags) (robotank-turret-flags rotflags-6)) (sound-stop (-> this turn-sound-id)) (let ((a0-4 (handle->process (-> this screen)))) @@ -1561,7 +1549,7 @@ ;; definition for method 7 of type fort-robotank-turret ;; WARN: Return type mismatch process-focusable vs fort-robotank-turret. -(defmethod relocate fort-robotank-turret ((this fort-robotank-turret) (arg0 int)) +(defmethod relocate ((this fort-robotank-turret) (arg0 int)) (if (nonzero? (-> this gun-elev-jmod)) (&+! (-> this gun-elev-jmod) arg0) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc index d2b76a31b11..97ff2a2ae66 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc @@ -46,21 +46,18 @@ ;; definition of type fort-robotank-segment-event (deftype fort-robotank-segment-event (structure) - ((source handle :offset-assert 0) - (event-type symbol :offset-assert 8) - (actor string :offset-assert 12) - (pos-norm float :offset-assert 16) - (param-obj object :offset-assert 20) - (param-func (function fort-robotank none) :offset 20) - (param-sym symbol :offset 20) + ((source handle) + (event-type symbol) + (actor string) + (pos-norm float) + (param-obj object) + (param-func (function fort-robotank none) :overlay-at param-obj) + (param-sym symbol :overlay-at param-obj) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type fort-robotank-segment-event -(defmethod inspect fort-robotank-segment-event ((this fort-robotank-segment-event)) +(defmethod inspect ((this fort-robotank-segment-event)) (when (not this) (set! this this) (goto cfg-4) @@ -77,20 +74,17 @@ ;; definition of type fort-robotank-segment (deftype fort-robotank-segment (structure) - ((flags uint16 :offset-assert 0) - (max-speed float :offset-assert 4) - (next-segment int32 :offset-assert 8) - (next-segment-start float :offset-assert 12) - (event-count int32 :offset-assert 16) - (event-tbl (inline-array fort-robotank-segment-event) :offset-assert 20) + ((flags uint16) + (max-speed float) + (next-segment int32) + (next-segment-start float) + (event-count int32) + (event-tbl (inline-array fort-robotank-segment-event)) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type fort-robotank-segment -(defmethod inspect fort-robotank-segment ((this fort-robotank-segment)) +(defmethod inspect ((this fort-robotank-segment)) (when (not this) (set! this this) (goto cfg-4) @@ -108,24 +102,21 @@ ;; definition of type fort-robotank-path-info (deftype fort-robotank-path-info (structure) - ((path path-control :offset-assert 0) - (dir vector :inline :offset-assert 16) - (u float :offset-assert 32) - (du float :offset-assert 36) - (du-final float :offset-assert 40) - (prev-u float :offset-assert 44) - (max-speed float :offset-assert 48) - (dist float :offset-assert 52) - (dir-y-angle float :offset-assert 56) - (start-y-angle float :offset-assert 60) + ((path path-control) + (dir vector :inline) + (u float) + (du float) + (du-final float) + (prev-u float) + (max-speed float) + (dist float) + (dir-y-angle float) + (start-y-angle float) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type fort-robotank-path-info -(defmethod inspect fort-robotank-path-info ((this fort-robotank-path-info)) +(defmethod inspect ((this fort-robotank-path-info)) (when (not this) (set! this this) (goto cfg-4) @@ -147,15 +138,12 @@ ;; definition of type fort-robotank-path-info-array (deftype fort-robotank-path-info-array (inline-array-class) - ((data fort-robotank-path-info :inline :dynamic :offset-assert 16) + ((data fort-robotank-path-info :inline :dynamic) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type fort-robotank-path-info-array -(defmethod inspect fort-robotank-path-info-array ((this fort-robotank-path-info-array)) +(defmethod inspect ((this fort-robotank-path-info-array)) (when (not this) (set! this this) (goto cfg-4) @@ -173,16 +161,13 @@ ;; definition of type fort-robotank-wheel-info (deftype fort-robotank-wheel-info (structure) - ((jmod joint-mod-spinner :offset-assert 0) - (radius float :offset-assert 4) + ((jmod joint-mod-spinner) + (radius float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type fort-robotank-wheel-info -(defmethod inspect fort-robotank-wheel-info ((this fort-robotank-wheel-info)) +(defmethod inspect ((this fort-robotank-wheel-info)) (when (not this) (set! this this) (goto cfg-4) @@ -196,18 +181,15 @@ ;; definition of type fort-robotank-tread-info (deftype fort-robotank-tread-info (structure) - ((wheel fort-robotank-wheel-info 7 :inline :offset-assert 0) - (texture texture-anim :offset-assert 112) - (locator-joint int32 :offset-assert 116) - (pos vector :inline :offset-assert 128) + ((wheel fort-robotank-wheel-info 7 :inline) + (texture texture-anim) + (locator-joint int32) + (pos vector :inline) ) - :method-count-assert 9 - :size-assert #x90 - :flag-assert #x900000090 ) ;; definition for method 3 of type fort-robotank-tread-info -(defmethod inspect fort-robotank-tread-info ((this fort-robotank-tread-info)) +(defmethod inspect ((this fort-robotank-tread-info)) (when (not this) (set! this this) (goto cfg-4) @@ -223,48 +205,46 @@ ;; definition of type fort-robotank (deftype fort-robotank (process-drawable) - ((root collide-shape-moving :override) - (barrel-part sparticle-launch-control :offset-assert 200) - (roller-jmod joint-mod :offset-assert 204) - (vibe-jmod joint-mod :offset-assert 208) - (tread fort-robotank-tread-info 2 :inline :offset-assert 224) - (path-info fort-robotank-path-info-array :offset-assert 512) - (segment-table (inline-array fort-robotank-segment) :offset-assert 516) - (flags robotank-flags :offset-assert 520) - (pov-cam-offset vector 2 :inline :offset-assert 528) - (turret handle :offset-assert 560) - (no-collision-timer time-frame :offset-assert 568) - (buzz-timer time-frame :offset-assert 576) - (player-u float :offset-assert 584) - (player-prev-u float :offset-assert 588) - (roller-spin-rate float :offset-assert 592) - (engine-vibe-rate float :offset-assert 596) - (engine-vibe-amp float :offset-assert 600) - (attack-id uint32 :offset-assert 604) - (path-index int32 :offset-assert 608) - (path-count int32 :offset-assert 612) - (continue-index int32 :offset-assert 616) - (idle-sound ambient-sound :offset-assert 620) - (barrel-sound ambient-sound :offset-assert 624) + ((root collide-shape-moving :override) + (barrel-part sparticle-launch-control) + (roller-jmod joint-mod) + (vibe-jmod joint-mod) + (tread fort-robotank-tread-info 2 :inline) + (path-info fort-robotank-path-info-array) + (segment-table (inline-array fort-robotank-segment)) + (flags robotank-flags) + (pov-cam-offset vector 2 :inline) + (turret handle) + (no-collision-timer time-frame) + (buzz-timer time-frame) + (player-u float) + (player-prev-u float) + (roller-spin-rate float) + (engine-vibe-rate float) + (engine-vibe-amp float) + (attack-id uint32) + (path-index int32) + (path-count int32) + (continue-index int32) + (idle-sound ambient-sound) + (barrel-sound ambient-sound) ) - :heap-base #x200 - :method-count-assert 28 - :size-assert #x274 - :flag-assert #x1c02000274 + (:state-methods + idle + turning + moving + pause + die + ) (:methods - (idle () _type_ :state 20) - (turning () _type_ :state 21) - (moving () _type_ :state 22) - (pause () _type_ :state 23) - (die () _type_ :state 24) - (fort-robotank-method-25 (_type_) event-message-block 25) - (fort-robotank-method-26 (_type_ int float float) symbol 26) - (fort-robotank-method-27 (_type_) none 27) + (fort-robotank-method-25 (_type_) event-message-block) + (fort-robotank-method-26 (_type_ int float float) symbol) + (fort-robotank-method-27 (_type_) none) ) ) ;; definition for method 3 of type fort-robotank -(defmethod inspect fort-robotank ((this fort-robotank)) +(defmethod inspect ((this fort-robotank)) (when (not this) (set! this this) (goto cfg-4) @@ -398,7 +378,7 @@ ) ;; definition for method 25 of type fort-robotank -(defmethod fort-robotank-method-25 fort-robotank ((this fort-robotank)) +(defmethod fort-robotank-method-25 ((this fort-robotank)) (with-pp (let ((v1-0 (-> this root))) (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) @@ -671,7 +651,7 @@ ;; definition for method 26 of type fort-robotank ;; INFO: Used lq/sq -(defmethod fort-robotank-method-26 fort-robotank ((this fort-robotank) (arg0 int) (arg1 float) (arg2 float)) +(defmethod fort-robotank-method-26 ((this fort-robotank) (arg0 int) (arg1 float) (arg2 float)) (local-vars (sv-96 fort-robotank-segment-event) (sv-112 (function process-tree event-message-block object)) @@ -760,7 +740,7 @@ ;; definition for method 27 of type fort-robotank ;; WARN: Return type mismatch object vs none. -(defmethod fort-robotank-method-27 fort-robotank ((this fort-robotank)) +(defmethod fort-robotank-method-27 ((this fort-robotank)) (let ((s5-0 (-> this segment-table (-> this path-index) flags))) (send-event (handle->process (-> this turret)) 'use-los (if (logtest? s5-0 16) #t @@ -1056,7 +1036,7 @@ ) ;; definition for method 10 of type fort-robotank -(defmethod deactivate fort-robotank ((this fort-robotank)) +(defmethod deactivate ((this fort-robotank)) (stop! (-> this idle-sound)) (stop! (-> this barrel-sound)) ((method-of-type process-drawable deactivate) this) @@ -1064,7 +1044,7 @@ ) ;; definition for method 7 of type fort-robotank -(defmethod relocate fort-robotank ((this fort-robotank) (arg0 int)) +(defmethod relocate ((this fort-robotank) (arg0 int)) (if (nonzero? (-> this barrel-part)) (&+! (-> this barrel-part) arg0) ) @@ -1117,7 +1097,7 @@ ;; definition for method 11 of type fort-robotank ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-robotank ((this fort-robotank) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-robotank) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/fortress/exit/forexita-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/exit/forexita-obs_REF.gc index a0290cdd8ad..09e22b6a1f3 100644 --- a/test/decompiler/reference/jak2/levels/fortress/exit/forexita-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/exit/forexita-obs_REF.gc @@ -3,20 +3,16 @@ ;; definition of type fort-lift-plat (deftype fort-lift-plat (plat) - ((sound-time time-frame :offset-assert 328) - (last-val float :offset-assert 336) + ((sound-time time-frame) + (last-val float) ) - :heap-base #xe0 - :method-count-assert 38 - :size-assert #x154 - :flag-assert #x2600e00154 - (:methods - (plat-anim-active () _type_ :state 37) + (:state-methods + plat-anim-active ) ) ;; definition for method 3 of type fort-lift-plat -(defmethod inspect fort-lift-plat ((this fort-lift-plat)) +(defmethod inspect ((this fort-lift-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -37,7 +33,7 @@ ) ;; definition for method 30 of type fort-lift-plat -(defmethod get-art-group fort-lift-plat ((this fort-lift-plat)) +(defmethod get-art-group ((this fort-lift-plat)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-fort-lift-plat" (the-as (pointer uint32) #f)) ) @@ -45,7 +41,7 @@ ;; definition for method 32 of type fort-lift-plat ;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 fort-lift-plat ((this fort-lift-plat)) +(defmethod base-plat-method-32 ((this fort-lift-plat)) 0 (none) ) @@ -129,7 +125,7 @@ ;; definition for method 27 of type fort-lift-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod execute-effects fort-lift-plat ((this fort-lift-plat)) +(defmethod execute-effects ((this fort-lift-plat)) "Executes various ancillary tasks with the platform, such as spawning particles or playing the associated sound" (if (nonzero? (-> this part)) (spawn-with-cspace (-> this part) (-> this node-list data 6)) @@ -143,7 +139,7 @@ ;; definition for method 31 of type fort-lift-plat ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-plat-collision! fort-lift-plat ((this fort-lift-plat)) +(defmethod init-plat-collision! ((this fort-lift-plat)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -209,14 +205,14 @@ ;; definition for method 32 of type fort-lift-plat ;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch sparticle-launch-control vs none. -(defmethod base-plat-method-32 fort-lift-plat ((this fort-lift-plat)) +(defmethod base-plat-method-32 ((this fort-lift-plat)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 618) this)) (none) ) ;; definition for method 33 of type fort-lift-plat ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! fort-lift-plat ((this fort-lift-plat)) +(defmethod init-plat! ((this fort-lift-plat)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this root pause-adjust-distance) 327680.0) @@ -225,14 +221,14 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 10 of type fort-lift-plat -(defmethod deactivate fort-lift-plat ((this fort-lift-plat)) +(defmethod deactivate ((this fort-lift-plat)) (sound-stop (-> this sound-id)) ((method-of-type plat deactivate) this) (none) ) ;; definition for method 36 of type fort-lift-plat -(defmethod plat-path-sync fort-lift-plat ((this fort-lift-plat)) +(defmethod plat-path-sync ((this fort-lift-plat)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @@ -262,21 +258,17 @@ otherwise, [[plat::34]] ;; definition of type fort-claw (deftype fort-claw (process-drawable) - ((path-u float :offset-assert 200) - (path-dest float :offset-assert 204) + ((path-u float) + (path-dest float) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (pause () _type_ :state 21) + (:state-methods + idle + pause ) ) ;; definition for method 3 of type fort-claw -(defmethod inspect fort-claw ((this fort-claw)) +(defmethod inspect ((this fort-claw)) (when (not this) (set! this this) (goto cfg-4) @@ -331,7 +323,7 @@ otherwise, [[plat::34]] ;; definition for method 11 of type fort-claw ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-claw ((this fort-claw) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-claw) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/fortress/exit/forexita-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/exit/forexita-part_REF.gc index d380834f5de..20b5bf6329c 100644 --- a/test/decompiler/reference/jak2/levels/fortress/exit/forexita-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/exit/forexita-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type forexita-part (deftype forexita-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type forexita-part -(defmethod inspect forexita-part ((this forexita-part)) +(defmethod inspect ((this forexita-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/fortress/exit/forexitb-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/exit/forexitb-part_REF.gc index 4217f0004e0..e2ddc8c4f03 100644 --- a/test/decompiler/reference/jak2/levels/fortress/exit/forexitb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/exit/forexitb-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type forexitb-part (deftype forexitb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type forexitb-part -(defmethod inspect forexitb-part ((this forexitb-part)) +(defmethod inspect ((this forexitb-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc b/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc index 7caf0e8f3b2..c60b5019e1e 100644 --- a/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc @@ -411,41 +411,39 @@ ;; definition of type fort-turret (deftype fort-turret (enemy) - ((gun-tilt-jm joint-mod :offset-assert 532) - (gun-shadow-jm joint-mod :offset-assert 536) - (aim-pos vector :inline :offset-assert 544) - (target-bullseye vector :inline :offset-assert 560) - (gun-twist float :offset-assert 576) - (gun-tilt float :offset-assert 580) - (desired-twist float :offset-assert 584) - (desired-tilt float :offset-assert 588) - (los-clear symbol :offset-assert 592) - (flash-state basic :offset-assert 596) - (flash-index uint32 :offset-assert 600) - (can-shoot symbol :offset-assert 604) - (last-hit-time time-frame :offset-assert 608) - (init-mat matrix :inline :offset-assert 624) - (target-timeout uint64 :offset-assert 688) - (beam-intersect basic :offset-assert 696) - (sync sync-linear :inline :offset-assert 704) - (invincible symbol :offset-assert 720) + ((gun-tilt-jm joint-mod) + (gun-shadow-jm joint-mod) + (aim-pos vector :inline) + (target-bullseye vector :inline) + (gun-twist float) + (gun-tilt float) + (desired-twist float) + (desired-tilt float) + (los-clear symbol) + (flash-state basic) + (flash-index uint32) + (can-shoot symbol) + (last-hit-time time-frame) + (init-mat matrix :inline) + (target-timeout uint64) + (beam-intersect basic) + (sync sync-linear :inline) + (invincible symbol) ) - :heap-base #x260 - :method-count-assert 143 - :size-assert #x2d4 - :flag-assert #x8f026002d4 + (:state-methods + attack + sweep + ) (:methods - (attack () _type_ :state 137) - (sweep () _type_ :state 138) - (fort-turret-method-139 (_type_) none 139) - (fort-turret-method-140 (_type_ float float) quaternion 140) - (fort-turret-method-141 (_type_) vector 141) - (fort-turret-method-142 (_type_ symbol int) symbol 142) + (fort-turret-method-139 (_type_) none) + (fort-turret-method-140 (_type_ float float) quaternion) + (fort-turret-method-141 (_type_) vector) + (fort-turret-method-142 (_type_ symbol int) symbol) ) ) ;; definition for method 3 of type fort-turret -(defmethod inspect fort-turret ((this fort-turret)) +(defmethod inspect ((this fort-turret)) (when (not this) (set! this this) (goto cfg-4) @@ -560,7 +558,7 @@ (set! (-> *fort-turret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 55 of type fort-turret -(defmethod track-target! fort-turret ((this fort-turret)) +(defmethod track-target! ((this fort-turret)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -592,7 +590,7 @@ ;; definition for method 139 of type fort-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch quaternion vs none. -(defmethod fort-turret-method-139 fort-turret ((this fort-turret)) +(defmethod fort-turret-method-139 ((this fort-turret)) (let ((a0-2 (handle->process (-> this focus handle)))) (if a0-2 (set! (-> this aim-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) @@ -643,7 +641,7 @@ ) ;; definition for method 140 of type fort-turret -(defmethod fort-turret-method-140 fort-turret ((this fort-turret) (arg0 float) (arg1 float)) +(defmethod fort-turret-method-140 ((this fort-turret) (arg0 float) (arg1 float)) (rider-trans) (let ((s3-0 (new 'stack-no-clear 'matrix))) (+! (-> this gun-twist) (fmax (- arg1) (fmin arg1 (* arg0 (- (-> this desired-twist) (-> this gun-twist)))))) @@ -657,7 +655,7 @@ ;; definition for method 141 of type fort-turret ;; INFO: Used lq/sq -(defmethod fort-turret-method-141 fort-turret ((this fort-turret)) +(defmethod fort-turret-method-141 ((this fort-turret)) (let* ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 12))) (v1-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 12 bone transform vector 2) 1.0) @@ -721,7 +719,7 @@ ;; definition for method 142 of type fort-turret ;; INFO: Used lq/sq -(defmethod fort-turret-method-142 fort-turret ((this fort-turret) (arg0 symbol) (arg1 int)) +(defmethod fort-turret-method-142 ((this fort-turret) (arg0 symbol) (arg1 int)) (let ((v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg1))) (s4-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) @@ -921,7 +919,7 @@ ) ;; definition for method 74 of type fort-turret -(defmethod general-event-handler fort-turret ((this fort-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this fort-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (if (and (= arg2 'notify) (< 1 arg1) (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) *target*)) @@ -1011,14 +1009,14 @@ ;; definition for method 60 of type fort-turret ;; INFO: this function exists in multiple non-identical object files -(defmethod coin-flip? fort-turret ((this fort-turret)) +(defmethod coin-flip? ((this fort-turret)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 59 of type fort-turret ;; WARN: Return type mismatch int vs penetrate. -(defmethod get-penetrate-info fort-turret ((this fort-turret)) +(defmethod get-penetrate-info ((this fort-turret)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (the-as penetrate 0) @@ -1026,7 +1024,7 @@ ;; definition for method 114 of type fort-turret ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! fort-turret ((this fort-turret)) +(defmethod init-enemy-collision! ((this fort-turret)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (stack-size-set! (-> this main-thread) 512) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -1080,14 +1078,14 @@ ;; definition for method 60 of type fort-turret ;; INFO: this function exists in multiple non-identical object files -(defmethod coin-flip? fort-turret ((this fort-turret)) +(defmethod coin-flip? ((this fort-turret)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 7 of type fort-turret ;; WARN: Return type mismatch enemy vs fort-turret. -(defmethod relocate fort-turret ((this fort-turret) (arg0 int)) +(defmethod relocate ((this fort-turret) (arg0 int)) (if (nonzero? (-> this gun-tilt-jm)) (&+! (-> this gun-tilt-jm) arg0) ) @@ -1099,7 +1097,7 @@ ;; definition for method 115 of type fort-turret ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! fort-turret ((this fort-turret)) +(defmethod init-enemy! ((this fort-turret)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc index a84ef425645..ad12a98a3c9 100644 --- a/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc @@ -3,21 +3,17 @@ ;; definition of type fort-trap-door (deftype fort-trap-door (process-drawable) - ((root collide-shape-moving :override) - (notify-actor entity-actor :offset-assert 200) + ((root collide-shape-moving :override) + (notify-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16005000cc - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) ;; definition for method 3 of type fort-trap-door -(defmethod inspect fort-trap-door ((this fort-trap-door)) +(defmethod inspect ((this fort-trap-door)) (when (not this) (set! this this) (goto cfg-4) @@ -160,7 +156,7 @@ ;; definition for method 11 of type fort-trap-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-trap-door ((this fort-trap-door) (entity entity-actor)) +(defmethod init-from-entity! ((this fort-trap-door) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -209,14 +205,10 @@ This commonly includes things such as: ;; definition of type water-anim-fortress (deftype water-anim-fortress (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) ;; definition for method 3 of type water-anim-fortress -(defmethod inspect water-anim-fortress ((this water-anim-fortress)) +(defmethod inspect ((this water-anim-fortress)) (when (not this) (set! this this) (goto cfg-4) @@ -244,7 +236,7 @@ This commonly includes things such as: ;; definition for method 24 of type water-anim-fortress ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-fortress ((this water-anim-fortress)) +(defmethod init-water! ((this water-anim-fortress)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((parent-method (method-of-type water-anim init-water!))) (parent-method this) diff --git a/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc index 526fa5cc2d5..de56156cd21 100644 --- a/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc @@ -205,20 +205,16 @@ ;; definition of type prsn-hang-cell (deftype prsn-hang-cell (process-drawable) - ((path-u float :offset-assert 200) - (path-du float :offset-assert 204) + ((path-u float) + (path-du float) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type prsn-hang-cell -(defmethod inspect prsn-hang-cell ((this prsn-hang-cell)) +(defmethod inspect ((this prsn-hang-cell)) (when (not this) (set! this this) (goto cfg-4) @@ -267,7 +263,7 @@ ;; definition for method 11 of type prsn-hang-cell ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-hang-cell ((this prsn-hang-cell) (arg0 entity-actor)) +(defmethod init-from-entity! ((this prsn-hang-cell) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -339,14 +335,10 @@ This commonly includes things such as: ;; definition of type warp-gate-b (deftype warp-gate-b (warp-gate) () - :heap-base #x80 - :method-count-assert 26 - :size-assert #x100 - :flag-assert #x1a00800100 ) ;; definition for method 3 of type warp-gate-b -(defmethod inspect warp-gate-b ((this warp-gate-b)) +(defmethod inspect ((this warp-gate-b)) (when (not this) (set! this this) (goto cfg-4) @@ -360,7 +352,7 @@ This commonly includes things such as: ;; definition for method 23 of type warp-gate-b ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-skel-and-collide warp-gate-b ((this warp-gate-b)) +(defmethod init-skel-and-collide ((this warp-gate-b)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -388,20 +380,16 @@ This commonly includes things such as: ;; definition of type prsn-cell-door (deftype prsn-cell-door (process-drawable) - ((frame float :offset-assert 200) - (desired float :offset-assert 204) + ((frame float) + (desired float) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type prsn-cell-door -(defmethod inspect prsn-cell-door ((this prsn-cell-door)) +(defmethod inspect ((this prsn-cell-door)) (when (not this) (set! this this) (goto cfg-4) @@ -458,7 +446,7 @@ This commonly includes things such as: ;; definition for method 11 of type prsn-cell-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-cell-door ((this prsn-cell-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this prsn-cell-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -498,17 +486,13 @@ This commonly includes things such as: ;; definition of type prsn-vent-fan (deftype prsn-vent-fan (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type prsn-vent-fan -(defmethod inspect prsn-vent-fan ((this prsn-vent-fan)) +(defmethod inspect ((this prsn-vent-fan)) (when (not this) (set! this this) (goto cfg-4) @@ -545,7 +529,7 @@ This commonly includes things such as: ;; definition for method 11 of type prsn-vent-fan ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-vent-fan ((this prsn-vent-fan) (arg0 entity-actor)) +(defmethod init-from-entity! ((this prsn-vent-fan) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -567,17 +551,13 @@ This commonly includes things such as: ;; definition of type prsn-torture (deftype prsn-torture (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type prsn-torture -(defmethod inspect prsn-torture ((this prsn-torture)) +(defmethod inspect ((this prsn-torture)) (when (not this) (set! this this) (goto cfg-4) @@ -610,7 +590,7 @@ This commonly includes things such as: ;; definition for method 11 of type prsn-torture ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-torture ((this prsn-torture) (arg0 entity-actor)) +(defmethod init-from-entity! ((this prsn-torture) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/fortress/prison/prison-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/prison/prison-part_REF.gc index e138fafedd9..b3ec07138a9 100644 --- a/test/decompiler/reference/jak2/levels/fortress/prison/prison-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/prison/prison-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type prison-part (deftype prison-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type prison-part -(defmethod inspect prison-part ((this prison-part)) +(defmethod inspect ((this prison-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc index 75426b5a104..68cb26f2abb 100644 --- a/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc @@ -26,19 +26,15 @@ ;; definition of type fort-elec-button (deftype fort-elec-button (cty-guard-turret-button) - ((start-up? symbol :offset-assert 288) + ((start-up? symbol) ) - :heap-base #xb0 - :method-count-assert 41 - :size-assert #x124 - :flag-assert #x2900b00124 - (:methods - (waiting () _type_ :state 40) + (:state-methods + waiting ) ) ;; definition for method 3 of type fort-elec-button -(defmethod inspect fort-elec-button ((this fort-elec-button)) +(defmethod inspect ((this fort-elec-button)) (when (not this) (set! this this) (goto cfg-4) @@ -72,7 +68,7 @@ ;; definition for method 33 of type fort-elec-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 fort-elec-button ((this fort-elec-button)) +(defmethod basebutton-method-33 ((this fort-elec-button)) "TODO - joint stuff" (initialize-skeleton this @@ -104,7 +100,7 @@ ;; definition for method 35 of type fort-elec-button ;; WARN: Return type mismatch process-mask vs none. -(defmethod prepare-trigger-event! fort-elec-button ((this fort-elec-button)) +(defmethod prepare-trigger-event! ((this fort-elec-button)) "Sets `event-going-down` to `'trigger`" (set! (-> this start-up?) (= 1 (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0))) (set! (-> this event-going-down) 'trigger) @@ -114,7 +110,7 @@ ) ;; definition for method 32 of type fort-elec-button -(defmethod idle-state-transition fort-elec-button ((this fort-elec-button)) +(defmethod idle-state-transition ((this fort-elec-button)) "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" (cond ((-> this start-up?) @@ -136,20 +132,16 @@ ;; definition of type fort-led (deftype fort-led (process-drawable) - ((button-actor entity-actor :offset-assert 200) + ((button-actor entity-actor) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16005000cc - (:methods - (red () _type_ :state 20) - (green () _type_ :state 21) + (:state-methods + red + green ) ) ;; definition for method 3 of type fort-led -(defmethod inspect fort-led ((this fort-led)) +(defmethod inspect ((this fort-led)) (when (not this) (set! this this) (goto cfg-4) @@ -204,7 +196,7 @@ ;; definition for method 11 of type fort-led ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-led ((this fort-led) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-led) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -230,22 +222,20 @@ This commonly includes things such as: ;; definition of type elec-lock-gate (deftype elec-lock-gate (fort-elec-gate) - ((actor-group (pointer actor-group) :offset-assert 516) - (actor-group-count int32 :offset-assert 520) - (all-gone? symbol :offset-assert 524) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (all-gone? symbol) ) - :heap-base #x190 - :method-count-assert 32 - :size-assert #x210 - :flag-assert #x2001900210 + (:state-methods + pre-shutdown + ) (:methods - (pre-shutdown () _type_ :state 30) - (elec-lock-gate-method-31 (_type_ symbol) symbol 31) + (elec-lock-gate-method-31 (_type_ symbol) symbol) ) ) ;; definition for method 3 of type elec-lock-gate -(defmethod inspect elec-lock-gate ((this elec-lock-gate)) +(defmethod inspect ((this elec-lock-gate)) (when (not this) (set! this this) (goto cfg-7) @@ -414,7 +404,7 @@ This commonly includes things such as: ) ;; definition for method 31 of type elec-lock-gate -(defmethod elec-lock-gate-method-31 elec-lock-gate ((this elec-lock-gate) (arg0 symbol)) +(defmethod elec-lock-gate-method-31 ((this elec-lock-gate) (arg0 symbol)) (dotimes (v1-0 (-> this actor-group-count)) (dotimes (a2-0 (-> this actor-group v1-0 length)) (when (or (not arg0) (let ((a3-5 (-> this actor-group v1-0 data a2-0 actor))) @@ -437,7 +427,7 @@ This commonly includes things such as: ;; definition for method 26 of type elec-lock-gate ;; WARN: Return type mismatch object vs none. -(defmethod set-state! elec-lock-gate ((this elec-lock-gate)) +(defmethod set-state! ((this elec-lock-gate)) "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed make the gate `idle`. @@ -452,7 +442,7 @@ Otherwise, the gate will be `active`." ;; definition for method 25 of type elec-lock-gate ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-palette! elec-lock-gate ((this elec-lock-gate)) +(defmethod set-palette! ((this elec-lock-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" (local-vars (sv-16 res-tag)) (let ((t9-0 (method-of-type fort-elec-gate set-palette!))) diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-part_REF.gc index db16483e2c2..05cadb0319a 100644 --- a/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type forresca-part (deftype forresca-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type forresca-part -(defmethod inspect forresca-part ((this forresca-part)) +(defmethod inspect ((this forresca-part)) (when (not this) (set! this this) (goto cfg-4) @@ -1559,7 +1555,7 @@ ;; definition for method 24 of type fort-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod elec-gate-method-24 fort-elec-gate ((this fort-elec-gate)) +(defmethod elec-gate-method-24 ((this fort-elec-gate)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 653) this)) (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 654) this)) 0 diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc index f6b8cf0aee3..f08786ad252 100644 --- a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc @@ -3,20 +3,16 @@ ;; definition of type fort-twist-rail (deftype fort-twist-rail (process-drawable) - ((sync sync-eased :inline :offset-assert 200) - (init-quat quaternion :inline :offset-assert 256) + ((sync sync-eased :inline) + (init-quat quaternion :inline) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x110 - :flag-assert #x1500900110 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type fort-twist-rail -(defmethod inspect fort-twist-rail ((this fort-twist-rail)) +(defmethod inspect ((this fort-twist-rail)) (when (not this) (set! this this) (goto cfg-4) @@ -51,7 +47,7 @@ ;; definition for method 11 of type fort-twist-rail ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-twist-rail ((this fort-twist-rail) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-twist-rail) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -131,27 +127,23 @@ This commonly includes things such as: ;; definition of type fort-elec-belt-inst (deftype fort-elec-belt-inst (process-drawable) - ((l-spec lightning-spec :offset-assert 200) - (l-bolt lightning-control :offset-assert 204) - (points vector 17 :inline :offset-assert 208) - (path-u float :offset-assert 480) - (path-du float :offset-assert 484) - (attack-id uint32 :offset-assert 488) - (sound-id sound-id :offset-assert 492) + ((l-spec lightning-spec) + (l-bolt lightning-control) + (points vector 17 :inline) + (path-u float) + (path-du float) + (attack-id uint32) + (sound-id sound-id) ) - :heap-base #x170 - :method-count-assert 23 - :size-assert #x1f0 - :flag-assert #x17017001f0 - (:methods - (idle () _type_ :state 20) - (running () _type_ :state 21) - (die () _type_ :state 22) + (:state-methods + idle + running + die ) ) ;; definition for method 3 of type fort-elec-belt-inst -(defmethod inspect fort-elec-belt-inst ((this fort-elec-belt-inst)) +(defmethod inspect ((this fort-elec-belt-inst)) (when (not this) (set! this this) (goto cfg-4) @@ -419,7 +411,7 @@ This commonly includes things such as: ;; definition for method 7 of type fort-elec-belt-inst ;; WARN: Return type mismatch process-drawable vs fort-elec-belt-inst. -(defmethod relocate fort-elec-belt-inst ((this fort-elec-belt-inst) (arg0 int)) +(defmethod relocate ((this fort-elec-belt-inst) (arg0 int)) (if (nonzero? (-> this l-bolt)) (&+! (-> this l-bolt) arg0) ) @@ -427,7 +419,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type fort-elec-belt-inst -(defmethod deactivate fort-elec-belt-inst ((this fort-elec-belt-inst)) +(defmethod deactivate ((this fort-elec-belt-inst)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -479,26 +471,24 @@ This commonly includes things such as: ;; definition of type fort-elec-belt (deftype fort-elec-belt (process) - ((l-spec lightning-spec :offset-assert 128) - (next-spawn-time time-frame :offset-assert 136) - (path path-control :offset-assert 144) - (init-quat quaternion :inline :offset-assert 160) - (sync sync-linear :inline :offset-assert 176) - (attack-id uint32 :offset-assert 192) - (path-du float :offset-assert 196) + ((l-spec lightning-spec) + (next-spawn-time time-frame) + (path path-control) + (init-quat quaternion :inline) + (sync sync-linear :inline) + (attack-id uint32) + (path-du float) ) - :heap-base #x50 - :method-count-assert 16 - :size-assert #xc8 - :flag-assert #x10005000c8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (fort-elec-belt-method-15 (_type_) none 15) + (fort-elec-belt-method-15 (_type_) none) ) ) ;; definition for method 3 of type fort-elec-belt -(defmethod inspect fort-elec-belt ((this fort-elec-belt)) +(defmethod inspect ((this fort-elec-belt)) (when (not this) (set! this this) (goto cfg-4) @@ -552,7 +542,7 @@ This commonly includes things such as: ;; definition for method 15 of type fort-elec-belt ;; WARN: Return type mismatch symbol vs none. -(defmethod fort-elec-belt-method-15 fort-elec-belt ((this fort-elec-belt)) +(defmethod fort-elec-belt-method-15 ((this fort-elec-belt)) (let* ((f28-0 (total-distance (-> this path))) (s5-0 (-> this sync)) (f26-0 81.92) @@ -581,7 +571,7 @@ This commonly includes things such as: ;; definition for method 7 of type fort-elec-belt ;; WARN: Return type mismatch process vs fort-elec-belt. -(defmethod relocate fort-elec-belt ((this fort-elec-belt) (arg0 int)) +(defmethod relocate ((this fort-elec-belt) (arg0 int)) (if (nonzero? (-> this path)) (&+! (-> this path) arg0) ) @@ -591,7 +581,7 @@ This commonly includes things such as: ;; definition for method 11 of type fort-elec-belt ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-elec-belt ((this fort-elec-belt) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fort-elec-belt) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -662,14 +652,10 @@ This commonly includes things such as: ;; definition of type fort-conveyor (deftype fort-conveyor (conveyor) () - :heap-base #x80 - :method-count-assert 28 - :size-assert #x100 - :flag-assert #x1c00800100 ) ;; definition for method 3 of type fort-conveyor -(defmethod inspect fort-conveyor ((this fort-conveyor)) +(defmethod inspect ((this fort-conveyor)) (when (not this) (set! this this) (goto cfg-4) @@ -688,14 +674,14 @@ This commonly includes things such as: ) ;; definition for method 22 of type fort-conveyor -(defmethod get-art-group fort-conveyor ((this fort-conveyor)) +(defmethod get-art-group ((this fort-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-fort-conveyor" (the-as (pointer uint32) #f)) ) ;; definition for method 23 of type fort-conveyor ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod reset-root! fort-conveyor ((this fort-conveyor)) +(defmethod reset-root! ((this fort-conveyor)) "Re-initializes the `root` [[trsqv]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -725,7 +711,7 @@ This commonly includes things such as: ;; definition for method 24 of type fort-conveyor ;; WARN: Return type mismatch vector vs none. -(defmethod init! fort-conveyor ((this fort-conveyor)) +(defmethod init! ((this fort-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (set! (-> this speed) -47104.0) (set! (-> this belt-radius) 24576.0) @@ -737,7 +723,7 @@ This commonly includes things such as: ) ;; definition for method 25 of type fort-conveyor -(defmethod set-and-get-ambient-sound! fort-conveyor ((this fort-conveyor)) +(defmethod set-and-get-ambient-sound! ((this fort-conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" (let* ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-part_REF.gc index b1161b83791..df6bc448854 100644 --- a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type forrescb-part (deftype forrescb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type forrescb-part -(defmethod inspect forrescb-part ((this forrescb-part)) +(defmethod inspect ((this forrescb-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/gungame/gun-dummy_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gun-dummy_REF.gc index 6372f66ad96..c82a29f22f9 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gun-dummy_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gun-dummy_REF.gc @@ -1511,19 +1511,16 @@ ;; definition of type tpath-control-frame (deftype tpath-control-frame (structure) - ((time float :offset-assert 0) - (path-pos uint8 :offset-assert 4) - (command tpath-command :offset-assert 5) - (move-type uint8 :offset-assert 6) - (path-num uint8 :offset-assert 7) + ((time float) + (path-pos uint8) + (command tpath-command) + (move-type uint8) + (path-num uint8) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type tpath-control-frame -(defmethod inspect tpath-control-frame ((this tpath-control-frame)) +(defmethod inspect ((this tpath-control-frame)) (when (not this) (set! this this) (goto cfg-4) @@ -1540,26 +1537,23 @@ ;; definition of type tpath-info (deftype tpath-info (structure) - ((s-time float :offset-assert 0) - (num uint16 :offset-assert 4) - (ref-time-num int16 :offset-assert 6) - (score int16 :offset-assert 8) - (flags tpath-flags :offset-assert 10) - (num-anims uint8 :offset-assert 11) - (bonus-time float :offset-assert 12) - (list (array int32) :offset-assert 16) - (anims (inline-array tpath-control-frame) 3 :offset-assert 20) - (anim1 (inline-array tpath-control-frame) :offset 20) - (anim2 (inline-array tpath-control-frame) :offset 24) - (anim3 (inline-array tpath-control-frame) :offset 28) + ((s-time float) + (num uint16) + (ref-time-num int16) + (score int16) + (flags tpath-flags) + (num-anims uint8) + (bonus-time float) + (list (array int32)) + (anims (inline-array tpath-control-frame) 3) + (anim1 (inline-array tpath-control-frame) :overlay-at (-> anims 0)) + (anim2 (inline-array tpath-control-frame) :overlay-at (-> anims 1)) + (anim3 (inline-array tpath-control-frame) :overlay-at (-> anims 2)) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type tpath-info -(defmethod inspect tpath-info ((this tpath-info)) +(defmethod inspect ((this tpath-info)) (when (not this) (set! this this) (goto cfg-4) @@ -1583,45 +1577,43 @@ ;; definition of type gun-dummy (deftype gun-dummy (process-focusable) - ((incoming-attack-id uint32 :offset-assert 204) - (train-man handle :offset-assert 208) - (info tpath-info :offset-assert 216) - (y-offset float :offset-assert 220) - (rot-y-offset float :offset-assert 224) - (quat quaternion :inline :offset-assert 240) - (hit-points int32 :offset-assert 256) - (score float :offset-assert 260) - (path-num uint32 :offset-assert 264) - (next-spark int64 :offset-assert 272) - (inout-percent float :offset-assert 280) - (quat-ground quaternion :inline :offset-assert 288) - (path-pos float :offset-assert 304) - (score-speed float :offset-assert 308) - (first-time-command symbol :offset-assert 312) - (current (inline-array tpath-control-frame) :offset-assert 316) - (impact vector :inline :offset-assert 320) - (done? symbol :inline :offset-assert 336) - (move-sound sound-id :offset-assert 340) - (turn-sound sound-id :offset-assert 344) - (spin-sound sound-id :offset-assert 348) - (last-combo-time time-frame :offset-assert 352) + ((incoming-attack-id uint32) + (train-man handle) + (info tpath-info) + (y-offset float) + (rot-y-offset float) + (quat quaternion :inline) + (hit-points int32) + (score float) + (path-num uint32) + (next-spark int64) + (inout-percent float) + (quat-ground quaternion :inline) + (path-pos float) + (score-speed float) + (first-time-command symbol) + (current (inline-array tpath-control-frame)) + (impact vector :inline) + (done? symbol :inline) + (move-sound sound-id) + (turn-sound sound-id) + (spin-sound sound-id) + (last-combo-time time-frame) ) - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (init-dummy-collison! (_type_) none 28) - (path-playing? (_type_) symbol 29) - (path-time-elapsed (_type_) float 30) - (init-tpath-info! (_type_ tpath-info) none 31) - (break-dummy (_type_) none 32) + (init-dummy-collison! (_type_) none) + (path-playing? (_type_) symbol) + (path-time-elapsed (_type_) float) + (init-tpath-info! (_type_ tpath-info) none) + (break-dummy (_type_) none) ) ) ;; definition for method 3 of type gun-dummy -(defmethod inspect gun-dummy ((this gun-dummy)) +(defmethod inspect ((this gun-dummy)) (when (not this) (set! this this) (goto cfg-4) @@ -2008,14 +2000,14 @@ ;; definition for method 32 of type gun-dummy ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy ((this gun-dummy)) +(defmethod break-dummy ((this gun-dummy)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" 0 (none) ) ;; definition for method 30 of type gun-dummy -(defmethod path-time-elapsed gun-dummy ((this gun-dummy)) +(defmethod path-time-elapsed ((this gun-dummy)) "@returns Calculates the combined total time across all control frames in the path" (let ((total-time 0.0)) (let ((curr-frame (the-as tpath-control-frame (-> this current)))) @@ -2056,7 +2048,7 @@ ;; definition for method 29 of type gun-dummy ;; INFO: Used lq/sq -(defmethod path-playing? gun-dummy ((this gun-dummy)) +(defmethod path-playing? ((this gun-dummy)) "Core functionality for playing back the dummy's path. Does things like: - calculates the score in case the dummy is hit based on the time elapsed - moves around the dummy @@ -2282,7 +2274,7 @@ ;; definition for method 20 of type gun-dummy ;; INFO: Used lq/sq -(defmethod get-trans gun-dummy ((this gun-dummy) (arg0 int)) +(defmethod get-trans ((this gun-dummy) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (let ((root (-> this root))) (case arg0 @@ -2439,7 +2431,7 @@ ;; definition for method 28 of type gun-dummy ;; WARN: Return type mismatch int vs none. -(defmethod init-dummy-collison! gun-dummy ((this gun-dummy)) +(defmethod init-dummy-collison! ((this gun-dummy)) "Initializes the collision related stuff for the dummy" (let ((cshape-moving (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape-moving dynam) (copy *standard-dynamics* 'process)) @@ -2469,13 +2461,13 @@ ;; definition for method 7 of type gun-dummy ;; WARN: Return type mismatch process-focusable vs gun-dummy. -(defmethod relocate gun-dummy ((this gun-dummy) (arg0 int)) +(defmethod relocate ((this gun-dummy) (arg0 int)) (the-as gun-dummy ((method-of-type process-focusable relocate) this arg0)) ) ;; definition for method 11 of type gun-dummy ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gun-dummy ((this gun-dummy) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gun-dummy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2497,7 +2489,7 @@ This commonly includes things such as: ;; definition for method 31 of type gun-dummy ;; WARN: Return type mismatch int vs none. -(defmethod init-tpath-info! gun-dummy ((this gun-dummy) (arg0 tpath-info)) +(defmethod init-tpath-info! ((this gun-dummy) (arg0 tpath-info)) "Given a [[tpath-info]] use it to initialize the dummy with any relevant data or flags" (logior! (-> this mask) (process-mask enemy)) (logior! (-> this mask) (process-mask collectable)) @@ -2539,14 +2531,10 @@ This commonly includes things such as: ;; definition of type gun-dummy-a (deftype gun-dummy-a (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) ;; definition for method 3 of type gun-dummy-a -(defmethod inspect gun-dummy-a ((this gun-dummy-a)) +(defmethod inspect ((this gun-dummy-a)) (when (not this) (set! this this) (goto cfg-4) @@ -2561,14 +2549,10 @@ This commonly includes things such as: ;; definition of type gun-dummy-b (deftype gun-dummy-b (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) ;; definition for method 3 of type gun-dummy-b -(defmethod inspect gun-dummy-b ((this gun-dummy-b)) +(defmethod inspect ((this gun-dummy-b)) (when (not this) (set! this this) (goto cfg-4) @@ -2583,14 +2567,10 @@ This commonly includes things such as: ;; definition of type gun-dummy-c (deftype gun-dummy-c (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) ;; definition for method 3 of type gun-dummy-c -(defmethod inspect gun-dummy-c ((this gun-dummy-c)) +(defmethod inspect ((this gun-dummy-c)) (when (not this) (set! this this) (goto cfg-4) @@ -2605,14 +2585,10 @@ This commonly includes things such as: ;; definition of type gun-dummy-big (deftype gun-dummy-big (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) ;; definition for method 3 of type gun-dummy-big -(defmethod inspect gun-dummy-big ((this gun-dummy-big)) +(defmethod inspect ((this gun-dummy-big)) (when (not this) (set! this this) (goto cfg-4) @@ -2627,14 +2603,10 @@ This commonly includes things such as: ;; definition of type gun-dummy-gold (deftype gun-dummy-gold (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) ;; definition for method 3 of type gun-dummy-gold -(defmethod inspect gun-dummy-gold ((this gun-dummy-gold)) +(defmethod inspect ((this gun-dummy-gold)) (when (not this) (set! this this) (goto cfg-4) @@ -2649,14 +2621,10 @@ This commonly includes things such as: ;; definition of type gun-dummy-peace (deftype gun-dummy-peace (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) ;; definition for method 3 of type gun-dummy-peace -(defmethod inspect gun-dummy-peace ((this gun-dummy-peace)) +(defmethod inspect ((this gun-dummy-peace)) (when (not this) (set! this this) (goto cfg-4) @@ -2671,14 +2639,10 @@ This commonly includes things such as: ;; definition of type gun-cit-a (deftype gun-cit-a (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) ;; definition for method 3 of type gun-cit-a -(defmethod inspect gun-cit-a ((this gun-cit-a)) +(defmethod inspect ((this gun-cit-a)) (when (not this) (set! this this) (goto cfg-4) @@ -2693,14 +2657,10 @@ This commonly includes things such as: ;; definition of type gun-cit-b (deftype gun-cit-b (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) ;; definition for method 3 of type gun-cit-b -(defmethod inspect gun-cit-b ((this gun-cit-b)) +(defmethod inspect ((this gun-cit-b)) (when (not this) (set! this this) (goto cfg-4) @@ -2715,14 +2675,10 @@ This commonly includes things such as: ;; definition of type gun-cit-c (deftype gun-cit-c (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) ;; definition for method 3 of type gun-cit-c -(defmethod inspect gun-cit-c ((this gun-cit-c)) +(defmethod inspect ((this gun-cit-c)) (when (not this) (set! this this) (goto cfg-4) @@ -2737,14 +2693,10 @@ This commonly includes things such as: ;; definition of type gun-cit-d (deftype gun-cit-d (gun-dummy) () - :heap-base #xf0 - :method-count-assert 33 - :size-assert #x168 - :flag-assert #x2100f00168 ) ;; definition for method 3 of type gun-cit-d -(defmethod inspect gun-cit-d ((this gun-cit-d)) +(defmethod inspect ((this gun-cit-d)) (when (not this) (set! this this) (goto cfg-4) @@ -2759,7 +2711,7 @@ This commonly includes things such as: ;; definition for method 32 of type gun-dummy-a ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy-a ((this gun-dummy-a)) +(defmethod break-dummy ((this gun-dummy-a)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2800,7 +2752,7 @@ This commonly includes things such as: ;; definition for method 32 of type gun-dummy-b ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy-b ((this gun-dummy-b)) +(defmethod break-dummy ((this gun-dummy-b)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2839,7 +2791,7 @@ This commonly includes things such as: ;; definition for method 32 of type gun-dummy-c ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy-c ((this gun-dummy-c)) +(defmethod break-dummy ((this gun-dummy-c)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2878,7 +2830,7 @@ This commonly includes things such as: ;; definition for method 32 of type gun-dummy-big ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy-big ((this gun-dummy-big)) +(defmethod break-dummy ((this gun-dummy-big)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2917,7 +2869,7 @@ This commonly includes things such as: ;; definition for method 32 of type gun-dummy-gold ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy-gold ((this gun-dummy-gold)) +(defmethod break-dummy ((this gun-dummy-gold)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2956,7 +2908,7 @@ This commonly includes things such as: ;; definition for method 32 of type gun-dummy-peace ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy-peace ((this gun-dummy-peace)) +(defmethod break-dummy ((this gun-dummy-peace)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -2995,7 +2947,7 @@ This commonly includes things such as: ;; definition for method 32 of type gun-cit-a ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-cit-a ((this gun-cit-a)) +(defmethod break-dummy ((this gun-cit-a)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -3036,7 +2988,7 @@ This commonly includes things such as: ;; definition for method 32 of type gun-cit-b ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-cit-b ((this gun-cit-b)) +(defmethod break-dummy ((this gun-cit-b)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -3077,7 +3029,7 @@ This commonly includes things such as: ;; definition for method 32 of type gun-cit-c ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-cit-c ((this gun-cit-c)) +(defmethod break-dummy ((this gun-cit-c)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) @@ -3118,7 +3070,7 @@ This commonly includes things such as: ;; definition for method 32 of type gun-cit-d ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-cit-d ((this gun-cit-d)) +(defmethod break-dummy ((this gun-cit-d)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) diff --git a/test/decompiler/reference/jak2/levels/gungame/gungame-data_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gungame-data_REF.gc index 40eb25fc563..b16398b3706 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gungame-data_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gungame-data_REF.gc @@ -6,21 +6,18 @@ "Describes the contents and position of the crates in the gungame `num` is the amount of TOTAL ammo to spawn (not pickups) For example `20` would mean 4 red gun pickups, or 2 yellow gun pickups" - ((pos vector :inline :offset-assert 0) - (pos-x float :offset 0) - (pos-y float :offset 4) - (pos-z float :offset 8) - (angle float :offset 12) - (ammo pickup-type :offset-assert 16) - (num uint32 :offset-assert 20) + ((pos vector :inline) + (pos-x float :overlay-at (-> pos data 0)) + (pos-y float :overlay-at (-> pos data 1)) + (pos-z float :overlay-at (-> pos data 2)) + (angle float :overlay-at (-> pos data 3)) + (ammo pickup-type) + (num uint32) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type gungame-crate -(defmethod inspect gungame-crate ((this gungame-crate)) +(defmethod inspect ((this gungame-crate)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc index d82aac78f67..647d94cc69c 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc @@ -3,19 +3,15 @@ ;; definition of type training-path (deftype training-path (process-drawable) - ((num uint32 :offset-assert 200) + ((num uint32) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xcc - :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type training-path -(defmethod inspect training-path ((this training-path)) +(defmethod inspect ((this training-path)) (when (not this) (set! this this) (goto cfg-4) @@ -30,63 +26,61 @@ ;; definition of type training-manager (deftype training-manager (process) - ((actor-group (pointer actor-group) :offset-assert 128) - (actor-group-count int32 :offset-assert 132) - (start-time time-frame :offset-assert 136) - (score int32 :offset-assert 144) - (first-enemy-shown? symbol :offset-assert 148) - (first-citizen-shown? symbol :offset-assert 152) - (open-end? symbol :offset-assert 156) - (entrance-crates handle 32 :offset-assert 160) - (course-crates handle 32 :offset-assert 416) - (course (array tpath-info) :offset-assert 672) - (end-door uint32 :offset-assert 676) - (total-target uint32 :offset-assert 680) - (total-target-destroyed uint32 :offset-assert 684) - (total-bonus uint32 :offset-assert 688) - (total-bonus-destroyed uint32 :offset-assert 692) - (total-civilian uint32 :offset-assert 696) - (hud-score handle :offset-assert 704) - (hud-goal handle :offset-assert 712) - (in-out uint32 :offset-assert 720) - (combo-done? symbol :offset-assert 724) - (voicebox handle :offset-assert 728) - (last-sound-id sound-id :offset-assert 736) - (dummies handle 2 :offset-assert 744) - (task-gold uint16 :offset-assert 760) - (task-silver uint16 :offset-assert 762) - (task-bronze uint16 :offset-assert 764) - (game-score uint8 :offset-assert 766) - (training-goal float :offset-assert 768) - (training? symbol :offset-assert 772) - (egg-count int32 :offset-assert 776) - (medal int32 :offset-assert 780) - (gui-id sound-id :offset-assert 784) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (start-time time-frame) + (score int32) + (first-enemy-shown? symbol) + (first-citizen-shown? symbol) + (open-end? symbol) + (entrance-crates handle 32) + (course-crates handle 32) + (course (array tpath-info)) + (end-door uint32) + (total-target uint32) + (total-target-destroyed uint32) + (total-bonus uint32) + (total-bonus-destroyed uint32) + (total-civilian uint32) + (hud-score handle) + (hud-goal handle) + (in-out uint32) + (combo-done? symbol) + (voicebox handle) + (last-sound-id sound-id) + (dummies handle 2) + (task-gold uint16) + (task-silver uint16) + (task-bronze uint16) + (game-score uint8) + (training-goal float) + (training? symbol) + (egg-count int32) + (medal int32) + (gui-id sound-id) ) - :heap-base #x2a0 - :method-count-assert 33 - :size-assert #x314 - :flag-assert #x2102a00314 + (:state-methods + wait + course + end-course + red-training-intro + red-training + red-yellow-training + yellow-training-intro + ) (:methods - (wait () _type_ :state 14) - (course () _type_ :state 15) - (end-course () _type_ :state 16) - (red-training-intro () _type_ :state 17) - (red-training () _type_ :state 18) - (red-yellow-training () _type_ :state 19) - (yellow-training-intro () _type_ :state 20) - (training-manager-method-21 (_type_ handle) entity 21) - (training-manager-method-22 (_type_ symbol) symbol 22) - (training-manager-method-23 (_type_ (array gungame-crate)) symbol 23) - (training-manager-method-24 (_type_) symbol 24) - (training-manager-method-25 (_type_) symbol 25) - (training-manager-method-26 (_type_) int 26) - (training-manager-method-27 (_type_ (array tpath-info)) symbol 27) - (training-manager-method-28 (_type_) none 28) - (training-manager-method-29 (_type_ vector) vector 29) - (render-text (_type_ text-id) float 30) - (training-manager-method-31 (_type_) none 31) - (training-manager-method-32 (_type_) none 32) + (training-manager-method-21 (_type_ handle) entity) + (training-manager-method-22 (_type_ symbol) symbol) + (training-manager-method-23 (_type_ (array gungame-crate)) symbol) + (training-manager-method-24 (_type_) symbol) + (training-manager-method-25 (_type_) symbol) + (training-manager-method-26 (_type_) int) + (training-manager-method-27 (_type_ (array tpath-info)) symbol) + (training-manager-method-28 (_type_) none) + (training-manager-method-29 (_type_ vector) vector) + (render-text (_type_ text-id) float) + (training-manager-method-31 (_type_) none) + (training-manager-method-32 (_type_) none) ) (:states yellow-training @@ -94,7 +88,7 @@ ) ;; definition for method 3 of type training-manager -(defmethod inspect training-manager ((this training-manager)) +(defmethod inspect ((this training-manager)) (when (not this) (set! this this) (goto cfg-7) @@ -143,7 +137,7 @@ ;; definition for method 32 of type training-manager ;; WARN: Return type mismatch int vs none. -(defmethod training-manager-method-32 training-manager ((this training-manager)) +(defmethod training-manager-method-32 ((this training-manager)) (when (handle->process (-> this voicebox)) (if (= (get-status *gui-control* (-> this last-sound-id)) (gui-status unknown)) (send-event (handle->process (-> this voicebox)) 'speak-effect #f) @@ -203,7 +197,7 @@ ) ;; definition for method 10 of type training-manager -(defmethod deactivate training-manager ((this training-manager)) +(defmethod deactivate ((this training-manager)) (if (handle->process (-> this voicebox)) (send-event (handle->process (-> this voicebox)) 'die) ) @@ -215,7 +209,7 @@ ;; definition for method 11 of type training-path ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! training-path ((this training-path) (arg0 entity-actor)) +(defmethod init-from-entity! ((this training-path) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -260,7 +254,7 @@ This commonly includes things such as: ;; definition for method 31 of type training-manager ;; WARN: Return type mismatch int vs none. -(defmethod training-manager-method-31 training-manager ((this training-manager)) +(defmethod training-manager-method-31 ((this training-manager)) (cond ((= (-> (level-get-target-inside *level*) name) 'gungame) (when (or (zero? (-> this in-out)) (= (-> this in-out) 1)) @@ -283,7 +277,7 @@ This commonly includes things such as: ) ;; definition for method 30 of type training-manager -(defmethod render-text training-manager ((this training-manager) (arg0 text-id)) +(defmethod render-text ((this training-manager) (arg0 text-id)) (when (= (get-status *gui-control* (-> this gui-id)) (gui-status active)) (let ((s5-1 (new 'stack 'font-context *font-default-matrix* 32 290 0.0 (font-color default) (font-flags shadow kerning)) @@ -1929,7 +1923,7 @@ This commonly includes things such as: ) ;; definition for method 21 of type training-manager -(defmethod training-manager-method-21 training-manager ((this training-manager) (arg0 handle)) +(defmethod training-manager-method-21 ((this training-manager) (arg0 handle)) (let ((s4-0 0) (v1-3 (+ (length (-> this actor-group 0)) -1)) ) @@ -1960,7 +1954,7 @@ This commonly includes things such as: ) ;; definition for method 26 of type training-manager -(defmethod training-manager-method-26 training-manager ((this training-manager)) +(defmethod training-manager-method-26 ((this training-manager)) (local-vars (s3-0 object)) (let ((gp-0 0)) (dotimes (s4-0 (-> *entrance-gungame-crates-pos* length)) @@ -1992,7 +1986,7 @@ This commonly includes things such as: ;; definition for method 29 of type training-manager ;; INFO: Used lq/sq -(defmethod training-manager-method-29 training-manager ((this training-manager) (arg0 vector)) +(defmethod training-manager-method-29 ((this training-manager) (arg0 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -2036,7 +2030,7 @@ This commonly includes things such as: ;; definition for method 22 of type training-manager ;; INFO: Used lq/sq -(defmethod training-manager-method-22 training-manager ((this training-manager) (arg0 symbol)) +(defmethod training-manager-method-22 ((this training-manager) (arg0 symbol)) (local-vars (v1-28 symbol) (a0-18 symbol) (sv-48 process) (sv-64 process) (sv-80 process)) (let ((s4-0 (new 'static 'fact-info :pickup-type (pickup-type ammo-red) :pickup-spawn-amount 20.0)) (s3-0 (new 'stack-no-clear 'vector)) @@ -2101,7 +2095,7 @@ This commonly includes things such as: ) ;; definition for method 25 of type training-manager -(defmethod training-manager-method-25 training-manager ((this training-manager)) +(defmethod training-manager-method-25 ((this training-manager)) (dotimes (s5-0 (-> *entrance-gungame-crates-pos* length)) (when (handle->process (-> this entrance-crates s5-0)) (deactivate (-> this entrance-crates s5-0 process 0)) @@ -2112,7 +2106,7 @@ This commonly includes things such as: ) ;; definition for method 24 of type training-manager -(defmethod training-manager-method-24 training-manager ((this training-manager)) +(defmethod training-manager-method-24 ((this training-manager)) (dotimes (s5-0 32) (when (handle->process (-> this course-crates s5-0)) (deactivate (-> this course-crates s5-0 process 0)) @@ -2124,7 +2118,7 @@ This commonly includes things such as: ;; definition for method 23 of type training-manager ;; INFO: Used lq/sq -(defmethod training-manager-method-23 training-manager ((this training-manager) (arg0 (array gungame-crate))) +(defmethod training-manager-method-23 ((this training-manager) (arg0 (array gungame-crate))) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'static 'fact-info)) ) @@ -2155,7 +2149,7 @@ This commonly includes things such as: ) ;; definition for method 27 of type training-manager -(defmethod training-manager-method-27 training-manager ((this training-manager) (arg0 (array tpath-info))) +(defmethod training-manager-method-27 ((this training-manager) (arg0 (array tpath-info))) (dotimes (s5-0 (length arg0)) (let ((v1-2 (-> arg0 s5-0))) 0 @@ -2201,7 +2195,7 @@ This commonly includes things such as: ;; definition for method 28 of type training-manager ;; WARN: Return type mismatch object vs none. -(defmethod training-manager-method-28 training-manager ((this training-manager)) +(defmethod training-manager-method-28 ((this training-manager)) (cond ((task-node-open? (game-task-node city-red-gun-training-introduction)) (go (method-of-object this red-training-intro)) @@ -2227,7 +2221,7 @@ This commonly includes things such as: ;; definition for method 11 of type training-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! training-manager ((this training-manager) (arg0 entity-actor)) +(defmethod init-from-entity! ((this training-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2274,28 +2268,26 @@ This commonly includes things such as: ;; definition of type gungame-door (deftype gungame-door (process-drawable) - ((open-side symbol :offset-assert 200) - (close-sound sound-id :offset-assert 204) - (train handle :offset-assert 208) - (last-player-dist float :offset-assert 216) - (last-camera-dist float :offset-assert 220) - (close-state uint32 :offset-assert 224) + ((open-side symbol) + (close-sound sound-id) + (train handle) + (last-player-dist float) + (last-camera-dist float) + (close-state uint32) ) - :heap-base #x70 - :method-count-assert 25 - :size-assert #xe4 - :flag-assert #x19007000e4 + (:state-methods + idle + open + close + ) (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) - (close () _type_ :state 22) - (gungame-door-method-23 (_type_) symbol 23) - (gungame-door-method-24 (_type_) symbol 24) + (gungame-door-method-23 (_type_) symbol) + (gungame-door-method-24 (_type_) symbol) ) ) ;; definition for method 3 of type gungame-door -(defmethod inspect gungame-door ((this gungame-door)) +(defmethod inspect ((this gungame-door)) (when (not this) (set! this this) (goto cfg-4) @@ -2399,7 +2391,7 @@ This commonly includes things such as: ) ;; definition for method 23 of type gungame-door -(defmethod gungame-door-method-23 gungame-door ((this gungame-door)) +(defmethod gungame-door-method-23 ((this gungame-door)) (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) (f26-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) (f30-0 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) @@ -2460,7 +2452,7 @@ This commonly includes things such as: ;; definition for method 24 of type gungame-door ;; WARN: disable def twice: 41. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod gungame-door-method-24 gungame-door ((this gungame-door)) +(defmethod gungame-door-method-24 ((this gungame-door)) (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) @@ -2525,7 +2517,7 @@ This commonly includes things such as: ;; definition for method 11 of type gungame-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gungame-door ((this gungame-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gungame-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/gungame/gungame-part_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gungame-part_REF.gc index 7d5d8fa1174..66104938a14 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gungame-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gungame-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type gungame-part (deftype gungame-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type gungame-part -(defmethod inspect gungame-part ((this gungame-part)) +(defmethod inspect ((this gungame-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc b/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc index e8555f707a5..8e8a56e3f9c 100644 --- a/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc @@ -11,14 +11,10 @@ ;; definition of type hide-door-b (deftype hide-door-b (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type hide-door-b -(defmethod inspect hide-door-b ((this hide-door-b)) +(defmethod inspect ((this hide-door-b)) (when (not this) (set! this this) (goto cfg-4) @@ -32,7 +28,7 @@ ;; definition for method 11 of type hide-door-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hide-door-b ((this hide-door-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hide-door-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -89,17 +85,13 @@ This commonly includes things such as: ;; definition of type hide-light (deftype hide-light (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type hide-light -(defmethod inspect hide-light ((this hide-light)) +(defmethod inspect ((this hide-light)) (when (not this) (set! this this) (goto cfg-4) @@ -179,7 +171,7 @@ This commonly includes things such as: ;; definition for method 11 of type hide-light ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hide-light ((this hide-light) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hide-light) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/hideout/hideout-part_REF.gc b/test/decompiler/reference/jak2/levels/hideout/hideout-part_REF.gc index ed63b8127a5..b456a4d5aa3 100644 --- a/test/decompiler/reference/jak2/levels/hideout/hideout-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/hideout/hideout-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type hide-part (deftype hide-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type hide-part -(defmethod inspect hide-part ((this hide-part)) +(defmethod inspect ((this hide-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc index 921c3a4ae7f..045e8460c79 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc @@ -4,17 +4,13 @@ ;; definition of type hip-trophy-a (deftype hip-trophy-a (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type hip-trophy-a -(defmethod inspect hip-trophy-a ((this hip-trophy-a)) +(defmethod inspect ((this hip-trophy-a)) (when (not this) (set! this this) (goto cfg-4) @@ -41,7 +37,7 @@ ;; definition for method 11 of type hip-trophy-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-a ((this hip-trophy-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -67,17 +63,13 @@ This commonly includes things such as: ;; definition of type hip-trophy-d (deftype hip-trophy-d (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type hip-trophy-d -(defmethod inspect hip-trophy-d ((this hip-trophy-d)) +(defmethod inspect ((this hip-trophy-d)) (when (not this) (set! this this) (goto cfg-4) @@ -104,7 +96,7 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-d ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-d ((this hip-trophy-d) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-d) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -130,17 +122,13 @@ This commonly includes things such as: ;; definition of type hip-trophy-f (deftype hip-trophy-f (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type hip-trophy-f -(defmethod inspect hip-trophy-f ((this hip-trophy-f)) +(defmethod inspect ((this hip-trophy-f)) (when (not this) (set! this this) (goto cfg-4) @@ -167,7 +155,7 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-f ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-f ((this hip-trophy-f) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-f) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -193,17 +181,13 @@ This commonly includes things such as: ;; definition of type hip-trophy-g (deftype hip-trophy-g (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type hip-trophy-g -(defmethod inspect hip-trophy-g ((this hip-trophy-g)) +(defmethod inspect ((this hip-trophy-g)) (when (not this) (set! this this) (goto cfg-4) @@ -230,7 +214,7 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-g ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-g ((this hip-trophy-g) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-g) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -256,17 +240,13 @@ This commonly includes things such as: ;; definition of type hip-trophy-i (deftype hip-trophy-i (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type hip-trophy-i -(defmethod inspect hip-trophy-i ((this hip-trophy-i)) +(defmethod inspect ((this hip-trophy-i)) (when (not this) (set! this this) (goto cfg-4) @@ -293,7 +273,7 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-i ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-i ((this hip-trophy-i) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-i) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -319,17 +299,13 @@ This commonly includes things such as: ;; definition of type hip-trophy-j (deftype hip-trophy-j (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type hip-trophy-j -(defmethod inspect hip-trophy-j ((this hip-trophy-j)) +(defmethod inspect ((this hip-trophy-j)) (when (not this) (set! this this) (goto cfg-4) @@ -356,7 +332,7 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-j ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-j ((this hip-trophy-j) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-j) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -382,17 +358,13 @@ This commonly includes things such as: ;; definition of type hip-trophy-n (deftype hip-trophy-n (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type hip-trophy-n -(defmethod inspect hip-trophy-n ((this hip-trophy-n)) +(defmethod inspect ((this hip-trophy-n)) (when (not this) (set! this this) (goto cfg-4) @@ -419,7 +391,7 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-n ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-n ((this hip-trophy-n) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-n) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -445,17 +417,13 @@ This commonly includes things such as: ;; definition of type hip-trophy-m (deftype hip-trophy-m (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type hip-trophy-m -(defmethod inspect hip-trophy-m ((this hip-trophy-m)) +(defmethod inspect ((this hip-trophy-m)) (when (not this) (set! this this) (goto cfg-4) @@ -482,7 +450,7 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-m ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-m ((this hip-trophy-m) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hip-trophy-m) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/hiphog/hiphog-part_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/hiphog-part_REF.gc index b130e03cb7f..909632625a1 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/hiphog-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/hiphog-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type hiphog-part (deftype hiphog-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type hiphog-part -(defmethod inspect hiphog-part ((this hiphog-part)) +(defmethod inspect ((this hiphog-part)) (when (not this) (set! this this) (goto cfg-4) @@ -1579,16 +1575,13 @@ Every real second is 1/60th of a second in Jak's time of day" ;; definition of type hiphog-mirror-wf-pt (deftype hiphog-mirror-wf-pt (structure) "@unused seemingly not used, but probably stood for hiphog-mirror-waveform-point" - ((x float :offset-assert 0) - (y float :offset-assert 4) + ((x float) + (y float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type hiphog-mirror-wf-pt -(defmethod inspect hiphog-mirror-wf-pt ((this hiphog-mirror-wf-pt)) +(defmethod inspect ((this hiphog-mirror-wf-pt)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc index 6c036336df8..2a022e2f486 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc @@ -10,14 +10,10 @@ ;; definition of type hip-door-b (deftype hip-door-b (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type hip-door-b -(defmethod inspect hip-door-b ((this hip-door-b)) +(defmethod inspect ((this hip-door-b)) (when (not this) (set! this this) (goto cfg-4) @@ -31,7 +27,7 @@ ;; definition for method 11 of type hip-door-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-door-b ((this hip-door-b) (entiy entity-actor)) +(defmethod init-from-entity! ((this hip-door-b) (entiy entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -94,14 +90,10 @@ This commonly includes things such as: ;; definition of type hip-whack-a-metal (deftype hip-whack-a-metal (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type hip-whack-a-metal -(defmethod inspect hip-whack-a-metal ((this hip-whack-a-metal)) +(defmethod inspect ((this hip-whack-a-metal)) (when (not this) (set! this this) (goto cfg-4) @@ -126,7 +118,7 @@ This commonly includes things such as: ;; definition for method 33 of type hip-whack-a-metal ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-art! hip-whack-a-metal ((this hip-whack-a-metal)) +(defmethod init-art! ((this hip-whack-a-metal)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -137,7 +129,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type hip-whack-a-metal -(defmethod get-art-elem hip-whack-a-metal ((this hip-whack-a-metal)) +(defmethod get-art-elem ((this hip-whack-a-metal)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> (get-current-task-event (-> this task)) action) @@ -180,17 +172,13 @@ This commonly includes things such as: ;; definition of type hip-mirror (deftype hip-mirror (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type hip-mirror -(defmethod inspect hip-mirror ((this hip-mirror)) +(defmethod inspect ((this hip-mirror)) (when (not this) (set! this this) (goto cfg-4) @@ -224,7 +212,7 @@ This commonly includes things such as: ;; definition for method 11 of type hip-mirror ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-mirror ((this hip-mirror) (entity entity-actor)) +(defmethod init-from-entity! ((this hip-mirror) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -413,14 +401,10 @@ This commonly includes things such as: ;; definition of type sig-npc (deftype sig-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type sig-npc -(defmethod inspect sig-npc ((this sig-npc)) +(defmethod inspect ((this sig-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -433,7 +417,7 @@ This commonly includes things such as: ) ;; definition for method 35 of type sig-npc -(defmethod get-art-elem sig-npc ((this sig-npc)) +(defmethod get-art-elem ((this sig-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (if (task-node-open? (game-task-node forest-hunt-introduction)) @@ -444,7 +428,7 @@ This commonly includes things such as: ;; definition for method 33 of type sig-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! sig-npc ((this sig-npc)) +(defmethod init-art! ((this sig-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc index 40823acf4b6..7620acb3dda 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc @@ -725,17 +725,14 @@ ;; definition of type hip-mole-event (deftype hip-mole-event (structure) - ((min-time uint16 :offset 0) - (max-time uint16 :offset 2) - (mode uint8 :offset 4) + ((min-time uint16 :offset 0) + (max-time uint16 :offset 2) + (mode uint8 :offset 4) ) - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type hip-mole-event -(defmethod inspect hip-mole-event ((this hip-mole-event)) +(defmethod inspect ((this hip-mole-event)) (when (not this) (set! this this) (goto cfg-4) @@ -1472,24 +1469,20 @@ ;; definition of type hip-mole (deftype hip-mole (process-drawable) - ((cabinet handle :offset-assert 200) - (index int32 :offset-assert 208) - (mode uint8 :offset-assert 212) - (sound-id sound-id :offset-assert 216) - (abort? symbol :offset-assert 220) + ((cabinet handle) + (index int32) + (mode uint8) + (sound-id sound-id) + (abort? symbol) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xe0 - :flag-assert #x16006000e0 - (:methods - (idle () _type_ :state 20) - (active (time-frame uint) _type_ :state 21) + (:state-methods + idle + (active time-frame uint) ) ) ;; definition for method 3 of type hip-mole -(defmethod inspect hip-mole ((this hip-mole)) +(defmethod inspect ((this hip-mole)) (when (not this) (set! this this) (goto cfg-4) @@ -1719,46 +1712,44 @@ ;; definition of type whack-a-metal (deftype whack-a-metal (process-drawable) - ((cabinet handle :offset-assert 200) - (bopper (pointer process) :offset-assert 208) - (mole (pointer hip-mole) 8 :offset-assert 212) - (score-part sparticle-launch-control 2 :offset-assert 244) - (wave int32 :offset-assert 252) - (event int32 :offset-assert 256) - (event-time time-frame :offset-assert 264) - (event-length time-frame :offset-assert 272) - (hud-score handle :offset-assert 280) - (hud-goal handle :offset-assert 288) - (score float :offset-assert 296) - (score-time time-frame :offset-assert 304) - (dizzy? symbol :offset-assert 312) - (miss-count int32 :offset-assert 316) - (air-attack-count int32 :offset-assert 320) - (slot-buffer int32 4 :offset-assert 324) - (speech-time time-frame :offset-assert 344) - (speech-count int32 :offset-assert 352) - (speech-last int32 4 :offset-assert 356) + ((cabinet handle) + (bopper (pointer process)) + (mole (pointer hip-mole) 8) + (score-part sparticle-launch-control 2) + (wave int32) + (event int32) + (event-time time-frame) + (event-length time-frame) + (hud-score handle) + (hud-goal handle) + (score float) + (score-time time-frame) + (dizzy? symbol) + (miss-count int32) + (air-attack-count int32) + (slot-buffer int32 4) + (speech-time time-frame) + (speech-count int32) + (speech-last int32 4) ) - :heap-base #x100 - :method-count-assert 30 - :size-assert #x174 - :flag-assert #x1e01000174 + (:state-methods + hide + wait-for-start + (active symbol) + (attack int) + lose + win + ) (:methods - (hide () _type_ :state 20) - (wait-for-start () _type_ :state 21) - (active (symbol int) _type_ :state 22) - (attack (int) _type_ :state 23) - (lose () _type_ :state 24) - (win () _type_ :state 25) - (whack-a-metal-method-26 (_type_) integer 26) - (whack-a-metal-method-27 (_type_) none 27) - (whack-a-metal-method-28 (_type_) none 28) - (whack-a-metal-method-29 (_type_ int int) int 29) + (whack-a-metal-method-26 (_type_) integer) + (whack-a-metal-method-27 (_type_) none) + (whack-a-metal-method-28 (_type_) none) + (whack-a-metal-method-29 (_type_ int int) int) ) ) ;; definition for method 3 of type whack-a-metal -(defmethod inspect whack-a-metal ((this whack-a-metal)) +(defmethod inspect ((this whack-a-metal)) (when (not this) (set! this this) (goto cfg-4) @@ -1790,7 +1781,7 @@ ) ;; definition for method 10 of type whack-a-metal -(defmethod deactivate whack-a-metal ((this whack-a-metal)) +(defmethod deactivate ((this whack-a-metal)) (dotimes (s5-0 2) (if (nonzero? (-> this score-part s5-0)) (kill-and-free-particles (-> this score-part s5-0)) @@ -1801,7 +1792,7 @@ ) ;; definition for method 7 of type whack-a-metal -(defmethod relocate whack-a-metal ((this whack-a-metal) (arg0 int)) +(defmethod relocate ((this whack-a-metal) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this score-part v1-0)) (&+! (-> this score-part v1-0) arg0) @@ -1811,7 +1802,7 @@ ) ;; definition for method 29 of type whack-a-metal -(defmethod whack-a-metal-method-29 whack-a-metal ((this whack-a-metal) (arg0 int) (arg1 int)) +(defmethod whack-a-metal-method-29 ((this whack-a-metal) (arg0 int) (arg1 int)) (let ((v0-1 (mod (+ (-> this speech-last arg0) (rand-vu-int-range 1 2)) arg1))) (set! (-> this speech-last arg0) v0-1) v0-1 @@ -1820,7 +1811,7 @@ ;; definition for method 26 of type whack-a-metal ;; WARN: Return type mismatch int vs integer. -(defmethod whack-a-metal-method-26 whack-a-metal ((this whack-a-metal)) +(defmethod whack-a-metal-method-26 ((this whack-a-metal)) (if (or (-> this dizzy?) (>= (-> this miss-count) 20)) (return (the-as integer -1)) ) @@ -1906,7 +1897,7 @@ ;; definition for method 27 of type whack-a-metal ;; WARN: Return type mismatch int vs none. -(defmethod whack-a-metal-method-27 whack-a-metal ((this whack-a-metal)) +(defmethod whack-a-metal-method-27 ((this whack-a-metal)) (let ((s4-0 (-> *mole-data* (-> this wave) (-> this event))) (s5-0 #t) ) @@ -2102,7 +2093,7 @@ ;; definition for method 28 of type whack-a-metal ;; WARN: Return type mismatch int vs none. -(defmethod whack-a-metal-method-28 whack-a-metal ((this whack-a-metal)) +(defmethod whack-a-metal-method-28 ((this whack-a-metal)) (cond ((>= (-> *game-info* score) (-> this score)) (set! (-> *game-info* score) (-> this score)) @@ -2158,14 +2149,8 @@ (while (or (not *target*) (not (process-grab? *target* #f))) (suspend) ) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) (process->ppointer self)) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'draw) - (set! (-> a1-1 param 0) (the-as uint #f)) - (send-event-function *target* a1-1) - (go-virtual active #t (the-as int a1-1)) - ) + (send-event *target* 'draw #f) + (go-virtual active #t) ) ) @@ -2182,7 +2167,7 @@ ) ) ) - :enter (behavior ((arg0 symbol) (arg1 int)) + :enter (behavior ((arg0 symbol)) (when arg0 (set! (-> *game-info* score) 0.0) (sound-play "whack-start") @@ -2266,7 +2251,7 @@ (pad-buttons up right down left l1 r1 triangle circle x square) ) ) - :code (behavior ((arg0 symbol) (arg1 int)) + :code (behavior ((arg0 symbol)) (local-vars (sv-48 whack-a-metal) (sv-64 (function vector cspace vector)) @@ -2316,13 +2301,13 @@ (set! sv-48 self) (set! sv-64 vector<-cspace!) (set! sv-80 (new 'stack-no-clear 'vector)) - (let ((a1-9 (-> self node-list data (rand-vu-int-range 3 (+ (-> self node-list length) -1))))) - (set! sv-96 (sv-64 sv-80 a1-9)) + (let ((a1-8 (-> self node-list data (rand-vu-int-range 3 (+ (-> self node-list length) -1))))) + (set! sv-96 (sv-64 sv-80 a1-8)) ) (set! sv-112 vector<-cspace!) (set! sv-128 (new 'stack-no-clear 'vector)) - (let* ((a1-11 (-> self node-list data (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) - (t3-0 (sv-112 sv-128 a1-11)) + (let* ((a1-10 (-> self node-list data (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) + (t3-0 (sv-112 sv-128 a1-10)) ) ((the-as (function object object object object object object object object none) s5-1) s4-0 @@ -2489,119 +2474,50 @@ ) (set! (-> self dizzy?) #t) (+! (-> self miss-count) 2) - (let* ((a0-18 self) - (t9-7 (method-of-object a0-18 whack-a-metal-method-29)) - (a1-9 (the-as object 2)) - ) - (let ((v1-22 (t9-7 a0-18 (the-as int a1-9) 12))) - (cond - ((zero? v1-22) - (let ((gp-1 talker-spawn-func) - (s5-2 (-> *talker-speech* 418)) - ) - (set! a1-9 *entity-pool*) - (gp-1 s5-2 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 1) - (let ((gp-2 talker-spawn-func) - (s5-3 (-> *talker-speech* 419)) - ) - (set! a1-9 *entity-pool*) - (gp-2 s5-3 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 2) - (let ((gp-3 talker-spawn-func) - (s5-4 (-> *talker-speech* 420)) - ) - (set! a1-9 *entity-pool*) - (gp-3 s5-4 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 3) - (let ((gp-4 talker-spawn-func) - (s5-5 (-> *talker-speech* 421)) - ) - (set! a1-9 *entity-pool*) - (gp-4 s5-5 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 4) - (let ((gp-5 talker-spawn-func) - (s5-6 (-> *talker-speech* 422)) - ) - (set! a1-9 *entity-pool*) - (gp-5 s5-6 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 5) - (let ((gp-6 talker-spawn-func) - (s5-7 (-> *talker-speech* 423)) - ) - (set! a1-9 *entity-pool*) - (gp-6 s5-7 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 6) - (let ((gp-7 talker-spawn-func) - (s5-8 (-> *talker-speech* 424)) - ) - (set! a1-9 *entity-pool*) - (gp-7 s5-8 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 7) - (let ((gp-8 talker-spawn-func) - (s5-9 (-> *talker-speech* 425)) - ) - (set! a1-9 *entity-pool*) - (gp-8 s5-9 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 8) - (let ((gp-9 talker-spawn-func) - (s5-10 (-> *talker-speech* 426)) - ) - (set! a1-9 *entity-pool*) - (gp-9 s5-10 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 9) - (let ((gp-10 talker-spawn-func) - (s5-11 (-> *talker-speech* 427)) - ) - (set! a1-9 *entity-pool*) - (gp-10 s5-11 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 10) - (let ((gp-11 talker-spawn-func) - (s5-12 (-> *talker-speech* 428)) - ) - (set! a1-9 *entity-pool*) - (gp-11 s5-12 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ((= v1-22 11) - (let ((gp-12 talker-spawn-func) - (s5-13 (-> *talker-speech* 429)) - ) - (set! a1-9 *entity-pool*) - (gp-12 s5-13 (the-as process-tree a1-9) (target-pos 0) (the-as region #f)) - ) - ) - ) - ) - (dotimes (gp-13 8) - (set! a1-9 (new 'stack-no-clear 'event-message-block)) - (set! (-> (the-as event-message-block a1-9) from) (process->ppointer self)) - (set! (-> (the-as event-message-block a1-9) num-params) 0) - (set! (-> (the-as event-message-block a1-9) message) 'abort) - (send-event-function (ppointer->process (-> self mole gp-13)) (the-as event-message-block a1-9)) + (let ((v1-22 (whack-a-metal-method-29 self 2 12))) + (cond + ((zero? v1-22) + (talker-spawn-func (-> *talker-speech* 418) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 1) + (talker-spawn-func (-> *talker-speech* 419) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 2) + (talker-spawn-func (-> *talker-speech* 420) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 3) + (talker-spawn-func (-> *talker-speech* 421) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 4) + (talker-spawn-func (-> *talker-speech* 422) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 5) + (talker-spawn-func (-> *talker-speech* 423) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 6) + (talker-spawn-func (-> *talker-speech* 424) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 7) + (talker-spawn-func (-> *talker-speech* 425) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 8) + (talker-spawn-func (-> *talker-speech* 426) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 9) + (talker-spawn-func (-> *talker-speech* 427) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 10) + (talker-spawn-func (-> *talker-speech* 428) *entity-pool* (target-pos 0) (the-as region #f)) + ) + ((= v1-22 11) + (talker-spawn-func (-> *talker-speech* 429) *entity-pool* (target-pos 0) (the-as region #f)) + ) ) - (go-virtual active #f (the-as int a1-9)) ) + (dotimes (gp-13 8) + (send-event (ppointer->process (-> self mole gp-13)) 'abort) + ) + (go-virtual active #f) ) ((#f) (sound-play "whack-miss") @@ -2671,27 +2587,19 @@ ) arg0 ) - (let ((a0-28 (-> self skel root-channel 0))) - (set! (-> a0-28 param 0) (the float (+ (-> a0-28 frame-group frames num-frames) -1))) - (set! (-> a0-28 param 1) 1.0) - (let ((t9-13 joint-control-channel-group!) - (a1-9 #f) - ) - (t9-13 a0-28 (the-as art-joint-anim a1-9) num-func-seek!) - (while (not (ja-done? 0)) - (let ((gp-1 (whack-a-metal-method-26 self))) - (when (>= (the-as int gp-1) 0) - (if (>= (ja-aframe-num 0) 12.0) - (go-virtual attack (the-as int gp-1)) - ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (let ((gp-1 (whack-a-metal-method-26 self))) + (when (>= (the-as int gp-1) 0) + (if (>= (ja-aframe-num 0) 12.0) + (go-virtual attack (the-as int gp-1)) ) - ) - (suspend) - (ja-eval) ) - (go-virtual active #f (the-as int a1-9)) ) + (suspend) + (ja-eval) ) + (go-virtual active #f) ) :post (-> (method-of-type whack-a-metal active) post) ) @@ -2890,3 +2798,7 @@ ) ) ) + + + + diff --git a/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc b/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc index e3739609040..e1f69109e43 100644 --- a/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc @@ -3,31 +3,29 @@ ;; definition of type intro-flamer (deftype intro-flamer (process-drawable) - ((up-dir vector :inline :offset-assert 208) - (average-dir vector :inline :offset-assert 224) - (id int32 :offset-assert 240) - (path-u float :offset-assert 244) - (path-du float :offset-assert 248) - (z-rot float :offset-assert 252) - (flit-prev-offset vector :inline :offset-assert 256) - (flit-next-offset vector :inline :offset-assert 272) - (flit-factor float :offset-assert 288) - (flit-timer uint64 :offset-assert 296) - (flit-interval uint64 :offset-assert 304) + ((up-dir vector :inline) + (average-dir vector :inline) + (id int32) + (path-u float) + (path-du float) + (z-rot float) + (flit-prev-offset vector :inline) + (flit-next-offset vector :inline) + (flit-factor float) + (flit-timer uint64) + (flit-interval uint64) ) - :heap-base #xc0 - :method-count-assert 23 - :size-assert #x138 - :flag-assert #x1700c00138 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (intro-flamer-method-22 (_type_) path-control 22) + (intro-flamer-method-22 (_type_) path-control) ) ) ;; definition for method 3 of type intro-flamer -(defmethod inspect intro-flamer ((this intro-flamer)) +(defmethod inspect ((this intro-flamer)) (when (not this) (set! this this) (goto cfg-4) @@ -218,13 +216,13 @@ ;; definition for method 22 of type intro-flamer ;; WARN: Return type mismatch object vs path-control. -(defmethod intro-flamer-method-22 intro-flamer ((this intro-flamer)) +(defmethod intro-flamer-method-22 ((this intro-flamer)) (the-as path-control (send-event (ppointer->process (-> this parent)) 'path (-> this id))) ) ;; definition for method 11 of type intro-flamer ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! intro-flamer ((this intro-flamer) (arg0 entity-actor)) +(defmethod init-from-entity! ((this intro-flamer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -278,23 +276,19 @@ This commonly includes things such as: ;; definition of type metalhead-spawner (deftype metalhead-spawner (process) - ((path-tbl path-control 19 :offset-assert 128) - (init-pos vector :inline :offset-assert 208) - (average-dir vector :inline :offset-assert 224) + ((path-tbl path-control 19) + (init-pos vector :inline) + (average-dir vector :inline) ) - :heap-base #x70 - :method-count-assert 17 - :size-assert #xf0 - :flag-assert #x11007000f0 - (:methods - (idle () _type_ :state 14) - (active () _type_ :state 15) - (die () _type_ :state 16) + (:state-methods + idle + active + die ) ) ;; definition for method 3 of type metalhead-spawner -(defmethod inspect metalhead-spawner ((this metalhead-spawner)) +(defmethod inspect ((this metalhead-spawner)) (when (not this) (set! this this) (goto cfg-4) @@ -390,7 +384,7 @@ This commonly includes things such as: ) ;; definition for method 7 of type metalhead-spawner -(defmethod relocate metalhead-spawner ((this metalhead-spawner) (arg0 int)) +(defmethod relocate ((this metalhead-spawner) (arg0 int)) (dotimes (v1-0 19) (if (nonzero? (-> this path-tbl v1-0)) (&+! (-> this path-tbl v1-0) arg0) @@ -402,7 +396,7 @@ This commonly includes things such as: ;; definition for method 11 of type metalhead-spawner ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! metalhead-spawner ((this metalhead-spawner) (arg0 entity-actor)) +(defmethod init-from-entity! ((this metalhead-spawner) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -432,17 +426,13 @@ This commonly includes things such as: ;; definition of type vil-windmill-sail (deftype vil-windmill-sail (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type vil-windmill-sail -(defmethod inspect vil-windmill-sail ((this vil-windmill-sail)) +(defmethod inspect ((this vil-windmill-sail)) (when (not this) (set! this this) (goto cfg-4) @@ -478,7 +468,7 @@ This commonly includes things such as: ;; definition for method 11 of type vil-windmill-sail ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vil-windmill-sail ((this vil-windmill-sail) (arg0 entity-actor)) +(defmethod init-from-entity! ((this vil-windmill-sail) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/intro/vortex-data_REF.gc b/test/decompiler/reference/jak2/levels/intro/vortex-data_REF.gc index edb7ca31248..797c6b79536 100644 --- a/test/decompiler/reference/jak2/levels/intro/vortex-data_REF.gc +++ b/test/decompiler/reference/jak2/levels/intro/vortex-data_REF.gc @@ -3,16 +3,13 @@ ;; definition of type vortex-vertex (deftype vortex-vertex (structure) - ((pos vector :inline :offset-assert 0) - (stq vector :inline :offset-assert 16) + ((pos vector :inline) + (stq vector :inline) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type vortex-vertex -(defmethod inspect vortex-vertex ((this vortex-vertex)) +(defmethod inspect ((this vortex-vertex)) (when (not this) (set! this this) (goto cfg-4) @@ -26,15 +23,12 @@ ;; definition of type vortex-vert-array (deftype vortex-vert-array (structure) - ((data vortex-vertex 306 :inline :offset-assert 0) + ((data vortex-vertex 306 :inline) ) - :method-count-assert 9 - :size-assert #x2640 - :flag-assert #x900002640 ) ;; definition for method 3 of type vortex-vert-array -(defmethod inspect vortex-vert-array ((this vortex-vert-array)) +(defmethod inspect ((this vortex-vert-array)) (when (not this) (set! this this) (goto cfg-4) @@ -47,23 +41,20 @@ ;; definition of type vortex-work (deftype vortex-work (basic) - ((giftag dma-gif :inline :offset-assert 16) - (off-s-0 uint16 :offset-assert 32) - (off-t-0 uint16 :offset-assert 34) - (off-s-1 uint16 :offset-assert 36) - (off-t-1 uint16 :offset-assert 38) - (off-s-2 uint16 :offset-assert 40) - (off-t-2 uint16 :offset-assert 42) - (off-s-3 uint16 :offset-assert 44) - (off-t-3 uint16 :offset-assert 46) + ((giftag dma-gif :inline) + (off-s-0 uint16) + (off-t-0 uint16) + (off-s-1 uint16) + (off-t-1 uint16) + (off-s-2 uint16) + (off-t-2 uint16) + (off-s-3 uint16) + (off-t-3 uint16) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type vortex-work -(defmethod inspect vortex-work ((this vortex-work)) +(defmethod inspect ((this vortex-work)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/mountain/canyon/mincan-obs_REF.gc b/test/decompiler/reference/jak2/levels/mountain/canyon/mincan-obs_REF.gc index 500d74f8e74..3bfe0115426 100644 --- a/test/decompiler/reference/jak2/levels/mountain/canyon/mincan-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/canyon/mincan-obs_REF.gc @@ -4,14 +4,10 @@ ;; definition of type water-anim-mincan (deftype water-anim-mincan (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) ;; definition for method 3 of type water-anim-mincan -(defmethod inspect water-anim-mincan ((this water-anim-mincan)) +(defmethod inspect ((this water-anim-mincan)) (when (not this) (set! this this) (goto cfg-4) @@ -39,7 +35,7 @@ ;; definition for method 24 of type water-anim-mincan ;; WARN: Return type mismatch int vs none. -(defmethod init-water! water-anim-mincan ((this water-anim-mincan)) +(defmethod init-water! ((this water-anim-mincan)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((func (method-of-type water-anim init-water!))) (func this) @@ -59,18 +55,14 @@ ;; definition of type mincan-lighthouse-lens (deftype mincan-lighthouse-lens (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (erect () _type_ :state 21) + (:state-methods + idle + erect ) ) ;; definition for method 3 of type mincan-lighthouse-lens -(defmethod inspect mincan-lighthouse-lens ((this mincan-lighthouse-lens)) +(defmethod inspect ((this mincan-lighthouse-lens)) (when (not this) (set! this this) (goto cfg-4) @@ -129,7 +121,7 @@ ;; definition for method 11 of type mincan-lighthouse-lens ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-lighthouse-lens ((this mincan-lighthouse-lens) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mincan-lighthouse-lens) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -171,18 +163,14 @@ This commonly includes things such as: ;; definition of type mincan-lighthouse (deftype mincan-lighthouse (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (erect () _type_ :state 21) + (:state-methods + idle + erect ) ) ;; definition for method 3 of type mincan-lighthouse -(defmethod inspect mincan-lighthouse ((this mincan-lighthouse)) +(defmethod inspect ((this mincan-lighthouse)) (when (not this) (set! this this) (goto cfg-4) @@ -242,7 +230,7 @@ This commonly includes things such as: ;; definition for method 11 of type mincan-lighthouse ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-lighthouse ((this mincan-lighthouse) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mincan-lighthouse) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -264,18 +252,14 @@ This commonly includes things such as: ;; definition of type mincan-lens (deftype mincan-lens (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (closed () _type_ :state 20) - (open () _type_ :state 21) + (:state-methods + closed + open ) ) ;; definition for method 3 of type mincan-lens -(defmethod inspect mincan-lens ((this mincan-lens)) +(defmethod inspect ((this mincan-lens)) (when (not this) (set! this this) (goto cfg-4) @@ -335,7 +319,7 @@ This commonly includes things such as: ;; definition for method 11 of type mincan-lens ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-lens ((this mincan-lens) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mincan-lens) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -420,17 +404,13 @@ This commonly includes things such as: ;; definition of type mincan-cogs (deftype mincan-cogs (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type mincan-cogs -(defmethod inspect mincan-cogs ((this mincan-cogs)) +(defmethod inspect ((this mincan-cogs)) (when (not this) (set! this this) (goto cfg-4) @@ -467,7 +447,7 @@ This commonly includes things such as: ;; definition for method 11 of type mincan-cogs ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-cogs ((this mincan-cogs) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mincan-cogs) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/mountain/mountain-obs2_REF.gc b/test/decompiler/reference/jak2/levels/mountain/mountain-obs2_REF.gc index 1c5585a2582..04034715c41 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-obs2_REF.gc @@ -3,20 +3,16 @@ ;; definition of type mtn-iris-door (deftype mtn-iris-door (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (open () _type_ :state 20) - (close () _type_ :state 21) + (:state-methods + open + close ) ) ;; definition for method 3 of type mtn-iris-door -(defmethod inspect mtn-iris-door ((this mtn-iris-door)) +(defmethod inspect ((this mtn-iris-door)) (when (not this) (set! this this) (goto cfg-4) @@ -76,7 +72,7 @@ ;; definition for method 11 of type mtn-iris-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-iris-door ((this mtn-iris-door) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-iris-door) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -112,26 +108,22 @@ This commonly includes things such as: ;; definition of type mtn-plat-shoot (deftype mtn-plat-shoot (plat) - ((incoming-attack-id uint32 :offset-assert 324) - (angle-flip float :offset-assert 328) - (angle-flip-vel float :offset-assert 332) - (axe-flip vector :inline :offset-assert 336) - (state-flip uint32 :offset-assert 352) - (hit-time time-frame :offset-assert 360) - (time-flip float :offset-assert 368) - (disable-track-under basic :offset-assert 372) - (dest-angle float :offset-assert 376) - (on-shake symbol :offset-assert 380) - (hint-count float :offset-assert 384) + ((incoming-attack-id uint32) + (angle-flip float) + (angle-flip-vel float) + (axe-flip vector :inline) + (state-flip uint32) + (hit-time time-frame) + (time-flip float) + (disable-track-under basic) + (dest-angle float) + (on-shake symbol) + (hint-count float) ) - :heap-base #x110 - :method-count-assert 37 - :size-assert #x184 - :flag-assert #x2501100184 ) ;; definition for method 3 of type mtn-plat-shoot -(defmethod inspect mtn-plat-shoot ((this mtn-plat-shoot)) +(defmethod inspect ((this mtn-plat-shoot)) (when (not this) (set! this this) (goto cfg-4) @@ -161,14 +153,14 @@ This commonly includes things such as: ) ;; definition for method 30 of type mtn-plat-shoot -(defmethod get-art-group mtn-plat-shoot ((this mtn-plat-shoot)) +(defmethod get-art-group ((this mtn-plat-shoot)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-mtn-plat-shoot" (the-as (pointer uint32) #f)) ) ;; definition for method 31 of type mtn-plat-shoot ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! mtn-plat-shoot ((this mtn-plat-shoot)) +(defmethod init-plat-collision! ((this mtn-plat-shoot)) "TODO - collision stuff for setting up the platform" (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) @@ -194,14 +186,14 @@ This commonly includes things such as: ;; definition for method 32 of type mtn-plat-shoot ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 mtn-plat-shoot ((this mtn-plat-shoot)) +(defmethod base-plat-method-32 ((this mtn-plat-shoot)) 0 (none) ) ;; definition for method 33 of type mtn-plat-shoot ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! mtn-plat-shoot ((this mtn-plat-shoot)) +(defmethod init-plat! ((this mtn-plat-shoot)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc b/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc index 2433c7ff9dd..58aa17526d5 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc @@ -48,14 +48,10 @@ ;; definition of type mtn-dice-button (deftype mtn-dice-button (basebutton) () - :heap-base #xa0 - :method-count-assert 39 - :size-assert #x120 - :flag-assert #x2700a00120 ) ;; definition for method 3 of type mtn-dice-button -(defmethod inspect mtn-dice-button ((this mtn-dice-button)) +(defmethod inspect ((this mtn-dice-button)) (when (not this) (set! this this) (goto cfg-4) @@ -69,7 +65,7 @@ ;; definition for method 33 of type mtn-dice-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 mtn-dice-button ((this mtn-dice-button)) +(defmethod basebutton-method-33 ((this mtn-dice-button)) "TODO - joint stuff" (initialize-skeleton this @@ -107,7 +103,7 @@ ;; definition for method 34 of type mtn-dice-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-34 mtn-dice-button ((this mtn-dice-button)) +(defmethod basebutton-method-34 ((this mtn-dice-button)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -133,7 +129,7 @@ ;; definition for method 35 of type mtn-dice-button ;; WARN: Return type mismatch int vs none. -(defmethod prepare-trigger-event! mtn-dice-button ((this mtn-dice-button)) +(defmethod prepare-trigger-event! ((this mtn-dice-button)) "Sets `event-going-down` to `'trigger`" (logior! (-> this button-status) (button-status button-status-4)) (logior! (-> this button-status) (button-status pressed)) @@ -298,43 +294,41 @@ ;; definition of type mtn-dice (deftype mtn-dice (process-drawable) - ((root collide-shape-moving :override) - (incoming-attack-id uint32 :offset-assert 200) - (watervol entity-actor :offset-assert 204) - (face-matrix matrix 6 :inline :offset-assert 208) - (face-matrix-back matrix 6 :inline :offset-assert 592) - (face-status int32 6 :offset-assert 976) - (time-anim float :offset-assert 1000) - (speed-anim float :offset-assert 1004) - (rot-axis vector :inline :offset-assert 1008) - (rot-org vector :inline :offset-assert 1024) - (first uint32 :offset-assert 1040) - (active uint32 :offset-assert 1044) - (free-face uint32 :offset-assert 1048) - (color vector :inline :offset-assert 1056) - (punch-anim symbol :offset-assert 1072) - (first-touch-time time-frame :offset-assert 1080) - (curtime time-frame :offset-assert 1088) - (hint-count float :offset-assert 1096) + ((root collide-shape-moving :override) + (incoming-attack-id uint32) + (watervol entity-actor) + (face-matrix matrix 6 :inline) + (face-matrix-back matrix 6 :inline) + (face-status int32 6) + (time-anim float) + (speed-anim float) + (rot-axis vector :inline) + (rot-org vector :inline) + (first uint32) + (active uint32) + (free-face uint32) + (color vector :inline) + (punch-anim symbol) + (first-touch-time time-frame) + (curtime time-frame) + (hint-count float) ) - :heap-base #x3d0 - :method-count-assert 28 - :size-assert #x44c - :flag-assert #x1c03d0044c + (:state-methods + idle + idle-done + animate + fall + restart + ) (:methods - (idle () _type_ :state 20) - (idle-done () _type_ :state 21) - (animate () _type_ :state 22) - (fall () _type_ :state 23) - (restart () _type_ :state 24) - (mtn-dice-method-25 (_type_ int) none 25) - (mtn-dice-method-26 (_type_ process-focusable touching-shapes-entry) touching-prims-entry 26) - (mtn-dice-method-27 (_type_ collide-shape process-focusable touching-shapes-entry) none 27) + (mtn-dice-method-25 (_type_ int) none) + (mtn-dice-method-26 (_type_ process-focusable touching-shapes-entry) touching-prims-entry) + (mtn-dice-method-27 (_type_ collide-shape process-focusable touching-shapes-entry) none) ) ) ;; definition for method 3 of type mtn-dice -(defmethod inspect mtn-dice ((this mtn-dice)) +(defmethod inspect ((this mtn-dice)) (when (not this) (set! this this) (goto cfg-4) @@ -371,7 +365,7 @@ ;; definition for method 25 of type mtn-dice ;; WARN: Return type mismatch int vs none. -(defmethod mtn-dice-method-25 mtn-dice ((this mtn-dice) (arg0 int)) +(defmethod mtn-dice-method-25 ((this mtn-dice) (arg0 int)) (let ((s4-0 (-> this face-matrix arg0))) (dotimes (s3-0 6) (let* ((v1-4 (-> this face-matrix s3-0)) @@ -469,7 +463,7 @@ ;; definition for method 26 of type mtn-dice ;; INFO: Used lq/sq -(defmethod mtn-dice-method-26 mtn-dice ((this mtn-dice) (arg0 process-focusable) (arg1 touching-shapes-entry)) +(defmethod mtn-dice-method-26 ((this mtn-dice) (arg0 process-focusable) (arg1 touching-shapes-entry)) (local-vars (sv-96 vector) (sv-112 vector) (sv-128 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -595,7 +589,7 @@ ;; definition for method 27 of type mtn-dice ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod mtn-dice-method-27 mtn-dice ((this mtn-dice) (arg0 collide-shape) (arg1 process-focusable) (arg2 touching-shapes-entry)) +(defmethod mtn-dice-method-27 ((this mtn-dice) (arg0 collide-shape) (arg1 process-focusable) (arg2 touching-shapes-entry)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -666,15 +660,12 @@ ;; definition of type mtn-dice-info (deftype mtn-dice-info (structure) - ((mat float 12 :offset-assert 0) + ((mat float 12) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type mtn-dice-info -(defmethod inspect mtn-dice-info ((this mtn-dice-info)) +(defmethod inspect ((this mtn-dice-info)) (when (not this) (set! this this) (goto cfg-4) @@ -1374,7 +1365,7 @@ ;; definition for method 11 of type mtn-dice ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-dice ((this mtn-dice) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-dice) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1523,14 +1514,10 @@ This commonly includes things such as: ;; definition of type mtn-plat-elevator (deftype mtn-plat-elevator (elevator) () - :heap-base #xf0 - :method-count-assert 49 - :size-assert #x170 - :flag-assert #x3100f00170 ) ;; definition for method 3 of type mtn-plat-elevator -(defmethod inspect mtn-plat-elevator ((this mtn-plat-elevator)) +(defmethod inspect ((this mtn-plat-elevator)) (when (not this) (set! this this) (goto cfg-4) @@ -1549,14 +1536,14 @@ This commonly includes things such as: ) ;; definition for method 30 of type mtn-plat-elevator -(defmethod get-art-group mtn-plat-elevator ((this mtn-plat-elevator)) +(defmethod get-art-group ((this mtn-plat-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-mtn-plat-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 42 of type mtn-plat-elevator ;; WARN: Return type mismatch int vs none. -(defmethod set-ambient-sound! mtn-plat-elevator ((this mtn-plat-elevator)) +(defmethod set-ambient-sound! ((this mtn-plat-elevator)) "Sets the elevator's [[ambient-sound]] up" (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "mtn-elevator-lp" :fo-max 70) (-> this root trans)) @@ -1566,7 +1553,7 @@ This commonly includes things such as: ) ;; definition for method 43 of type mtn-plat-elevator -(defmethod move-between-points mtn-plat-elevator ((this mtn-plat-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this mtn-plat-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -1584,7 +1571,7 @@ This commonly includes things such as: ;; definition for method 31 of type mtn-plat-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! mtn-plat-elevator ((this mtn-plat-elevator)) +(defmethod init-plat-collision! ((this mtn-plat-elevator)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1610,21 +1597,17 @@ This commonly includes things such as: ;; definition of type mtn-plat-updown (deftype mtn-plat-updown (base-plat) - ((sync sync-eased :inline :offset-assert 272) - (path-pos float :offset-assert 316) + ((sync sync-eased :inline) + (path-pos float) ) - :heap-base #xc0 - :method-count-assert 36 - :size-assert #x140 - :flag-assert #x2400c00140 - (:methods - (idle () _type_ :state 34) - (active () _type_ :state 35) + (:state-methods + idle + active ) ) ;; definition for method 3 of type mtn-plat-updown -(defmethod inspect mtn-plat-updown ((this mtn-plat-updown)) +(defmethod inspect ((this mtn-plat-updown)) (when (not this) (set! this this) (goto cfg-4) @@ -1675,7 +1658,7 @@ This commonly includes things such as: ;; definition for method 31 of type mtn-plat-updown ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! mtn-plat-updown ((this mtn-plat-updown)) +(defmethod init-plat-collision! ((this mtn-plat-updown)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1701,7 +1684,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-plat-updown ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-updown ((this mtn-plat-updown) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-plat-updown) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1769,21 +1752,19 @@ This commonly includes things such as: ;; definition of type mtn-plat-eject (deftype mtn-plat-eject (process-drawable) - ((dest-pos vector :inline :offset-assert 208) + ((dest-pos vector :inline) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xe0 - :flag-assert #x17006000e0 + (:state-methods + wait + eject + ) (:methods - (wait () _type_ :state 20) - (eject () _type_ :state 21) - (mtn-plat-eject-method-22 (_type_) none 22) + (mtn-plat-eject-method-22 (_type_) none) ) ) ;; definition for method 3 of type mtn-plat-eject -(defmethod inspect mtn-plat-eject ((this mtn-plat-eject)) +(defmethod inspect ((this mtn-plat-eject)) (when (not this) (set! this this) (goto cfg-4) @@ -1835,7 +1816,7 @@ This commonly includes things such as: ;; definition for method 22 of type mtn-plat-eject ;; WARN: Return type mismatch int vs none. -(defmethod mtn-plat-eject-method-22 mtn-plat-eject ((this mtn-plat-eject)) +(defmethod mtn-plat-eject-method-22 ((this mtn-plat-eject)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -1860,7 +1841,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-plat-eject ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-eject ((this mtn-plat-eject) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-plat-eject) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1892,19 +1873,15 @@ This commonly includes things such as: ;; definition of type mtn-plat-long (deftype mtn-plat-long (base-plat) - ((sync sync-linear :inline :offset-assert 272) + ((sync sync-linear :inline) ) - :heap-base #xa0 - :method-count-assert 35 - :size-assert #x120 - :flag-assert #x2300a00120 - (:methods - (idle () _type_ :state 34) + (:state-methods + idle ) ) ;; definition for method 3 of type mtn-plat-long -(defmethod inspect mtn-plat-long ((this mtn-plat-long)) +(defmethod inspect ((this mtn-plat-long)) (when (not this) (set! this this) (goto cfg-4) @@ -1949,7 +1926,7 @@ This commonly includes things such as: ;; definition for method 31 of type mtn-plat-long ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! mtn-plat-long ((this mtn-plat-long)) +(defmethod init-plat-collision! ((this mtn-plat-long)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1975,7 +1952,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-plat-long ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-long ((this mtn-plat-long) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-plat-long) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2015,18 +1992,14 @@ This commonly includes things such as: ;; definition of type mtn-gate (deftype mtn-gate (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) + (:state-methods + idle + open ) ) ;; definition for method 3 of type mtn-gate -(defmethod inspect mtn-gate ((this mtn-gate)) +(defmethod inspect ((this mtn-gate)) (when (not this) (set! this this) (goto cfg-4) @@ -2090,7 +2063,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-gate ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-gate ((this mtn-gate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2148,24 +2121,20 @@ This commonly includes things such as: ;; definition of type mtn-aval-rocks (deftype mtn-aval-rocks (process-drawable) - ((art-name symbol :offset-assert 200) - (anim spool-anim :offset-assert 204) - (rock-data vector-array :offset-assert 208) - (loop-id sound-id :offset-assert 212) - (volume float :offset-assert 216) + ((art-name symbol) + (anim spool-anim) + (rock-data vector-array) + (loop-id sound-id) + (volume float) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xdc - :flag-assert #x16006000dc - (:methods - (fall () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + fall + idle ) ) ;; definition for method 3 of type mtn-aval-rocks -(defmethod inspect mtn-aval-rocks ((this mtn-aval-rocks)) +(defmethod inspect ((this mtn-aval-rocks)) (when (not this) (set! this this) (goto cfg-4) @@ -2184,7 +2153,7 @@ This commonly includes things such as: ;; definition for method 7 of type mtn-aval-rocks ;; WARN: Return type mismatch process-drawable vs mtn-aval-rocks. -(defmethod relocate mtn-aval-rocks ((this mtn-aval-rocks) (arg0 int)) +(defmethod relocate ((this mtn-aval-rocks) (arg0 int)) (if (nonzero? (-> this rock-data)) (&+! (-> this rock-data) arg0) ) @@ -2193,21 +2162,17 @@ This commonly includes things such as: ;; definition of type mtn-aval-rocks-shadow (deftype mtn-aval-rocks-shadow (process-drawable) - ((parent-ptr (pointer mtn-aval-rocks) :offset 16) - (parent-joint int32 :offset-assert 200) - (update-time time-frame :offset-assert 208) + ((parent-ptr (pointer mtn-aval-rocks) :overlay-at parent) + (parent-joint int32) + (update-time time-frame) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd8 - :flag-assert #x15006000d8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type mtn-aval-rocks-shadow -(defmethod inspect mtn-aval-rocks-shadow ((this mtn-aval-rocks-shadow)) +(defmethod inspect ((this mtn-aval-rocks-shadow)) (when (not this) (set! this this) (goto cfg-4) @@ -2594,7 +2559,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-aval-rocks ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-aval-rocks ((this mtn-aval-rocks) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-aval-rocks) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2734,26 +2699,24 @@ This commonly includes things such as: ;; definition of type mtn-plat-return (deftype mtn-plat-return (base-plat) - ((ride-timer time-frame :offset-assert 272) - (flags mtn-plat-flags :offset-assert 280) - (path-pos float :offset-assert 284) - (dest-pos float :offset-assert 288) - (path-speed float :offset-assert 292) + ((ride-timer time-frame) + (flags mtn-plat-flags) + (path-pos float) + (dest-pos float) + (path-speed float) ) - :heap-base #xb0 - :method-count-assert 38 - :size-assert #x128 - :flag-assert #x2600b00128 + (:state-methods + waiting + running + waiting-for-no-player + ) (:methods - (waiting () _type_ :state 34) - (running () _type_ :state 35) - (waiting-for-no-player () _type_ :state 36) - (mtn-plat-return-method-37 (_type_) none 37) + (mtn-plat-return-method-37 (_type_) none) ) ) ;; definition for method 3 of type mtn-plat-return -(defmethod inspect mtn-plat-return ((this mtn-plat-return)) +(defmethod inspect ((this mtn-plat-return)) (when (not this) (set! this this) (goto cfg-4) @@ -2895,14 +2858,14 @@ This commonly includes things such as: ;; definition for method 37 of type mtn-plat-return ;; WARN: Return type mismatch object vs none. -(defmethod mtn-plat-return-method-37 mtn-plat-return ((this mtn-plat-return)) +(defmethod mtn-plat-return-method-37 ((this mtn-plat-return)) (go (method-of-object this waiting)) (none) ) ;; definition for method 31 of type mtn-plat-return ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! mtn-plat-return ((this mtn-plat-return)) +(defmethod init-plat-collision! ((this mtn-plat-return)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -2927,7 +2890,7 @@ This commonly includes things such as: ) ;; definition for method 11 of type mtn-plat-return -(defmethod init-from-entity! mtn-plat-return ((this mtn-plat-return) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-plat-return) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2964,14 +2927,10 @@ This commonly includes things such as: ;; definition of type mtn-plat-gap (deftype mtn-plat-gap (mtn-plat-return) () - :heap-base #xb0 - :method-count-assert 38 - :size-assert #x128 - :flag-assert #x2600b00128 ) ;; definition for method 3 of type mtn-plat-gap -(defmethod inspect mtn-plat-gap ((this mtn-plat-gap)) +(defmethod inspect ((this mtn-plat-gap)) (when (not this) (set! this this) (goto cfg-4) @@ -3032,22 +2991,18 @@ This commonly includes things such as: ;; definition of type mtn-button (deftype mtn-button (process-drawable) - ((on-activate symbol :offset-assert 200) + ((on-activate symbol) ) - :heap-base #x50 - :method-count-assert 24 - :size-assert #xcc - :flag-assert #x18005000cc - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) - (waiting () _type_ :state 22) - (pressed (symbol) _type_ :state 23) + (:state-methods + idle + open + waiting + (pressed symbol) ) ) ;; definition for method 3 of type mtn-button -(defmethod inspect mtn-button ((this mtn-button)) +(defmethod inspect ((this mtn-button)) (when (not this) (set! this this) (goto cfg-4) @@ -3137,7 +3092,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-button ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-button ((this mtn-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3199,18 +3154,14 @@ This commonly includes things such as: ;; definition of type mtn-gear-device (deftype mtn-gear-device (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (idle-collapsed () _type_ :state 21) + (:state-methods + idle + idle-collapsed ) ) ;; definition for method 3 of type mtn-gear-device -(defmethod inspect mtn-gear-device ((this mtn-gear-device)) +(defmethod inspect ((this mtn-gear-device)) (when (not this) (set! this this) (goto cfg-4) @@ -3262,7 +3213,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-gear-device ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-gear-device ((this mtn-gear-device) (arg0 entity-actor)) +(defmethod init-from-entity! ((this mtn-gear-device) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3409,14 +3360,10 @@ This commonly includes things such as: ;; definition of type water-anim-mountain (deftype water-anim-mountain (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) ;; definition for method 3 of type water-anim-mountain -(defmethod inspect water-anim-mountain ((this water-anim-mountain)) +(defmethod inspect ((this water-anim-mountain)) (when (not this) (set! this this) (goto cfg-4) @@ -3444,7 +3391,7 @@ This commonly includes things such as: ;; definition for method 24 of type water-anim-mountain ;; WARN: Return type mismatch int vs none. -(defmethod init-water! water-anim-mountain ((this water-anim-mountain)) +(defmethod init-water! ((this water-anim-mountain)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) (t9-0 this) @@ -3464,17 +3411,13 @@ This commonly includes things such as: ;; definition of type trans-plat (deftype trans-plat (mtn-plat-return) () - :heap-base #xb0 - :method-count-assert 39 - :size-assert #x128 - :flag-assert #x2700b00128 - (:methods - (rising () _type_ :state 38) + (:state-methods + rising ) ) ;; definition for method 3 of type trans-plat -(defmethod inspect trans-plat ((this trans-plat)) +(defmethod inspect ((this trans-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -3594,14 +3537,14 @@ This commonly includes things such as: ;; definition for method 37 of type trans-plat ;; WARN: Return type mismatch object vs none. -(defmethod mtn-plat-return-method-37 trans-plat ((this trans-plat)) +(defmethod mtn-plat-return-method-37 ((this trans-plat)) (go (method-of-object this rising)) (none) ) ;; definition for method 33 of type trans-plat ;; WARN: Return type mismatch float vs none. -(defmethod init-plat! trans-plat ((this trans-plat)) +(defmethod init-plat! ((this trans-plat)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (logior! (-> this flags) (mtn-plat-flags mtpflags-1)) diff --git a/test/decompiler/reference/jak2/levels/mountain/mountain-part_REF.gc b/test/decompiler/reference/jak2/levels/mountain/mountain-part_REF.gc index 2655f8aaa77..d8f4b80dc7e 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type mountain-part (deftype mountain-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type mountain-part -(defmethod inspect mountain-part ((this mountain-part)) +(defmethod inspect ((this mountain-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/mountain/mountain-scenes_REF.gc b/test/decompiler/reference/jak2/levels/mountain/mountain-scenes_REF.gc index 5954e8beadc..0362b90a002 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-scenes_REF.gc @@ -1677,20 +1677,16 @@ ;; definition of type mtn-plat-buried-rocks (deftype mtn-plat-buried-rocks (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (done (symbol) _type_ :state 21) + (:state-methods + idle + (done symbol) ) ) ;; definition for method 3 of type mtn-plat-buried-rocks -(defmethod inspect mtn-plat-buried-rocks ((this mtn-plat-buried-rocks)) +(defmethod inspect ((this mtn-plat-buried-rocks)) (when (not this) (set! this this) (goto cfg-4) @@ -1756,7 +1752,7 @@ ;; definition for method 11 of type mtn-plat-buried-rocks ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-buried-rocks ((this mtn-plat-buried-rocks) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-plat-buried-rocks) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1804,18 +1800,14 @@ This commonly includes things such as: ;; definition of type mtn-plat-buried (deftype mtn-plat-buried (plat) - ((incoming-attack-id uint32 :offset-assert 324) - (offset float :offset-assert 328) - (options actor-option :offset-assert 336) + ((incoming-attack-id uint32) + (offset float) + (options actor-option) ) - :heap-base #xe0 - :method-count-assert 37 - :size-assert #x158 - :flag-assert #x2500e00158 ) ;; definition for method 3 of type mtn-plat-buried -(defmethod inspect mtn-plat-buried ((this mtn-plat-buried)) +(defmethod inspect ((this mtn-plat-buried)) (when (not this) (set! this this) (goto cfg-60) @@ -1924,14 +1916,14 @@ This commonly includes things such as: ) ;; definition for method 30 of type mtn-plat-buried -(defmethod get-art-group mtn-plat-buried ((this mtn-plat-buried)) +(defmethod get-art-group ((this mtn-plat-buried)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-mtn-plat-buried" (the-as (pointer uint32) #f)) ) ;; definition for method 31 of type mtn-plat-buried ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! mtn-plat-buried ((this mtn-plat-buried)) +(defmethod init-plat-collision! ((this mtn-plat-buried)) "TODO - collision stuff for setting up the platform" (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) @@ -1965,7 +1957,7 @@ This commonly includes things such as: ) ;; definition for method 36 of type mtn-plat-buried -(defmethod plat-path-sync mtn-plat-buried ((this mtn-plat-buried)) +(defmethod plat-path-sync ((this mtn-plat-buried)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @@ -3082,17 +3074,13 @@ otherwise, [[plat::34]] ;; definition of type mtn-lens (deftype mtn-lens (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type mtn-lens -(defmethod inspect mtn-lens ((this mtn-lens)) +(defmethod inspect ((this mtn-lens)) (when (not this) (set! this this) (goto cfg-4) @@ -3113,7 +3101,7 @@ otherwise, [[plat::34]] ;; definition for method 11 of type mtn-lens ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-lens ((this mtn-lens) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-lens) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3135,17 +3123,13 @@ This commonly includes things such as: ;; definition of type mtn-lens-base (deftype mtn-lens-base (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type mtn-lens-base -(defmethod inspect mtn-lens-base ((this mtn-lens-base)) +(defmethod inspect ((this mtn-lens-base)) (when (not this) (set! this this) (goto cfg-4) @@ -3166,7 +3150,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-lens-base ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-lens-base ((this mtn-lens-base) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-lens-base) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3190,18 +3174,14 @@ This commonly includes things such as: ;; definition of type mtn-lens-floor (deftype mtn-lens-floor (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (idle-no-beam () _type_ :state 21) + (:state-methods + idle + idle-no-beam ) ) ;; definition for method 3 of type mtn-lens-floor -(defmethod inspect mtn-lens-floor ((this mtn-lens-floor)) +(defmethod inspect ((this mtn-lens-floor)) (when (not this) (set! this this) (goto cfg-4) @@ -3230,7 +3210,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-lens-floor ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-lens-floor ((this mtn-lens-floor) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-lens-floor) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3272,17 +3252,13 @@ This commonly includes things such as: ;; definition of type mtn-shard (deftype mtn-shard (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type mtn-shard -(defmethod inspect mtn-shard ((this mtn-shard)) +(defmethod inspect ((this mtn-shard)) (when (not this) (set! this this) (goto cfg-4) @@ -3303,7 +3279,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-shard ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-shard ((this mtn-shard) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-shard) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3325,14 +3301,10 @@ This commonly includes things such as: ;; definition of type mtn-step-plat-rocks-a (deftype mtn-step-plat-rocks-a (mtn-plat-buried-rocks) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 ) ;; definition for method 3 of type mtn-step-plat-rocks-a -(defmethod inspect mtn-step-plat-rocks-a ((this mtn-step-plat-rocks-a)) +(defmethod inspect ((this mtn-step-plat-rocks-a)) (when (not this) (set! this this) (goto cfg-4) @@ -3347,7 +3319,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-step-plat-rocks-a ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-step-plat-rocks-a ((this mtn-step-plat-rocks-a) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-step-plat-rocks-a) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3424,14 +3396,10 @@ This commonly includes things such as: ;; definition of type mtn-step-plat-rocks-b (deftype mtn-step-plat-rocks-b (mtn-plat-buried-rocks) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 ) ;; definition for method 3 of type mtn-step-plat-rocks-b -(defmethod inspect mtn-step-plat-rocks-b ((this mtn-step-plat-rocks-b)) +(defmethod inspect ((this mtn-step-plat-rocks-b)) (when (not this) (set! this this) (goto cfg-4) @@ -3446,7 +3414,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-step-plat-rocks-b ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-step-plat-rocks-b ((this mtn-step-plat-rocks-b) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-step-plat-rocks-b) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3541,14 +3509,10 @@ This commonly includes things such as: ;; definition of type mtn-step-plat-rocks-c (deftype mtn-step-plat-rocks-c (mtn-plat-buried-rocks) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 ) ;; definition for method 3 of type mtn-step-plat-rocks-c -(defmethod inspect mtn-step-plat-rocks-c ((this mtn-step-plat-rocks-c)) +(defmethod inspect ((this mtn-step-plat-rocks-c)) (when (not this) (set! this this) (goto cfg-4) @@ -3563,7 +3527,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-step-plat-rocks-c ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-step-plat-rocks-c ((this mtn-step-plat-rocks-c) (entity entity-actor)) +(defmethod init-from-entity! ((this mtn-step-plat-rocks-c) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/mountain/rhino-wall_REF.gc b/test/decompiler/reference/jak2/levels/mountain/rhino-wall_REF.gc index ab9fa2ed958..4b4d7c901ba 100644 --- a/test/decompiler/reference/jak2/levels/mountain/rhino-wall_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/rhino-wall_REF.gc @@ -3,24 +3,22 @@ ;; definition of type rhino-wall (deftype rhino-wall (process-focusable) - ((anim spool-anim :offset-assert 204) - (art-name string :offset-assert 208) - (id int8 :offset-assert 212) + ((anim spool-anim) + (art-name string) + (id int8) ) - :heap-base #x60 - :method-count-assert 31 - :size-assert #xd5 - :flag-assert #x1f006000d5 + (:state-methods + unbroken + hit + broken + ) (:methods - (unbroken () _type_ :state 27) - (hit () _type_ :state 28) - (broken () _type_ :state 29) - (rhino-wall-method-30 (_type_) none 30) + (rhino-wall-method-30 (_type_) none) ) ) ;; definition for method 3 of type rhino-wall -(defmethod inspect rhino-wall ((this rhino-wall)) +(defmethod inspect ((this rhino-wall)) (when (not this) (set! this this) (goto cfg-4) @@ -49,7 +47,7 @@ ;; definition for method 30 of type rhino-wall ;; WARN: Return type mismatch vector vs none. -(defmethod rhino-wall-method-30 rhino-wall ((this rhino-wall)) +(defmethod rhino-wall-method-30 ((this rhino-wall)) (let ((v1-1 (-> this root root-prim))) (countdown (a1-0 (-> v1-1 specific 0)) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a1-0))) @@ -114,7 +112,7 @@ ;; definition for method 11 of type rhino-wall ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! rhino-wall ((this rhino-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this rhino-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc b/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc index 171c7ffc3a2..a44712db907 100644 --- a/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc @@ -104,44 +104,42 @@ ;; definition of type rhino (deftype rhino (nav-enemy) - ((wall rhino-wall :offset-assert 604) - (path-intro path-control :offset-assert 608) - (charge-aware uint64 :offset-assert 616) - (anim-skid-left int32 :offset-assert 624) - (anim-skid-right int32 :offset-assert 628) - (anim-victory-hit int32 :offset-assert 632) - (circle-backward? symbol :offset-assert 636) - (skid-speed float :offset 672) - (angle float :offset-assert 676) - (angle-speed float :offset-assert 680) - (dest vector :inline :offset-assert 688) - (charge-straight symbol :offset-assert 704) - (in-stop-run symbol :offset-assert 708) - (smush-target smush-control :offset-assert 712) - (num-hit-flinch int32 :offset-assert 716) - (frame-die-smush float :offset-assert 720) - (quat quaternion :inline :offset-assert 736) - (can-hit? symbol :offset-assert 752) - (interest int32 :offset-assert 756) - (victory-count uint32 :offset-assert 760) - (stomach-touched-once? symbol :offset-assert 764) + ((wall rhino-wall) + (path-intro path-control) + (charge-aware uint64) + (anim-skid-left int32) + (anim-skid-right int32) + (anim-victory-hit int32) + (circle-backward? symbol) + (skid-speed float :offset 672) + (angle float) + (angle-speed float) + (dest vector :inline) + (charge-straight symbol) + (in-stop-run symbol) + (smush-target smush-control) + (num-hit-flinch int32) + (frame-die-smush float) + (quat quaternion :inline) + (can-hit? symbol) + (interest int32) + (victory-count uint32) + (stomach-touched-once? symbol) ) - :heap-base #x280 - :method-count-assert 183 - :size-assert #x300 - :flag-assert #xb702800300 + (:state-methods + attack + stop-run + run-away + charge + ) (:methods - (attack () _type_ :state 178) - (stop-run () _type_ :state 179) - (run-away () _type_ :state 180) - (charge () _type_ :state 181) - (rhino-method-182 (_type_ process event-message-block) symbol 182) + (rhino-method-182 (_type_ process event-message-block) symbol) ) ) ;; definition for method 3 of type rhino ;; ERROR: failed type prop at 48: Could not figure out load: (set! a2 (l.wu (+ gp 636))) -(defmethod inspect rhino ((a0-0 rhino)) +(defmethod inspect ((a0-0 rhino)) (local-vars (v0-0 nav-enemy) (v0-1 object) @@ -580,7 +578,7 @@ (set! (-> *rhino-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 182 of type rhino -(defmethod rhino-method-182 rhino ((this rhino) (arg0 process) (arg1 event-message-block)) +(defmethod rhino-method-182 ((this rhino) (arg0 process) (arg1 event-message-block)) (let* ((gp-0 (-> arg1 param 0)) (s5-0 arg0) (s2-0 (if (type? s5-0 process-drawable) @@ -616,7 +614,7 @@ ) ;; definition for method 58 of type rhino -(defmethod enemy-method-58 rhino ((this rhino) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 ((this rhino) (arg0 process) (arg1 event-message-block)) (let ((t9-0 (method-of-type nav-enemy enemy-method-58))) (t9-0 this arg0 arg1) ) @@ -628,7 +626,7 @@ ;; definition for method 74 of type rhino ;; INFO: Used lq/sq -(defmethod general-event-handler rhino ((this rhino) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this rhino) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars @@ -972,7 +970,7 @@ ) ;; definition for method 56 of type rhino -(defmethod damage-amount-from-attack rhino ((this rhino) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this rhino) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (-> arg1 param 1) (let ((f30-0 (the float (penetrate-using->damage (the-as penetrate (-> this incoming penetrate-using)))))) @@ -1001,7 +999,7 @@ ;; definition for method 75 of type rhino ;; WARN: Return type mismatch symbol vs object. -(defmethod enemy-method-75 rhino ((this rhino) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-75 ((this rhino) (arg0 process) (arg1 event-message-block)) (let* ((touch-entry (the-as touching-shapes-entry (-> arg1 param 0))) (s3-0 arg0) (v1-0 (if (type? s3-0 process-focusable) @@ -1047,7 +1045,7 @@ ;; definition for method 104 of type rhino ;; INFO: Used lq/sq -(defmethod enemy-method-104 rhino ((this rhino) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ((this rhino) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (if (and (-> this next-state) (= (-> this next-state name) 'victory)) 'attack-or-shove 'attack @@ -1497,7 +1495,7 @@ ;; definition for method 142 of type rhino ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 rhino ((this rhino) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this rhino) (arg0 nav-control)) (if (-> this in-stop-run) (quaternion*! (-> this root quat) @@ -1831,7 +1829,7 @@ ;; definition for method 114 of type rhino ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! rhino ((this rhino)) +(defmethod init-enemy-collision! ((this rhino)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1904,7 +1902,7 @@ ) ;; definition for method 7 of type rhino -(defmethod relocate rhino ((this rhino) (arg0 int)) +(defmethod relocate ((this rhino) (arg0 int)) (if (nonzero? (-> this path-intro)) (&+! (-> this path-intro) arg0) ) @@ -1913,7 +1911,7 @@ ;; definition for method 115 of type rhino ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! rhino ((this rhino)) +(defmethod init-enemy! ((this rhino)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (stack-size-set! (-> this main-thread) 256) (initialize-skeleton diff --git a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc index af146752457..9c574dc51e3 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc @@ -279,7 +279,7 @@ ;; definition for method 31 of type metalkor-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod init-proj-settings! metalkor-shot ((this metalkor-shot)) +(defmethod init-proj-settings! ((this metalkor-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'metalhead-shot) @@ -294,7 +294,7 @@ ;; definition for method 26 of type metalkor-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles metalkor-shot ((this metalkor-shot)) +(defmethod spawn-shell-particles ((this metalkor-shot)) "TODO - confirm" (local-vars (sv-224 (function vector entity-actor skeleton-group vector object none :behavior manipy)) @@ -465,7 +465,7 @@ ;; definition for method 20 of type metalkor-legs ;; INFO: Used lq/sq -(defmethod get-trans metalkor-legs ((this metalkor-legs) (arg0 int)) +(defmethod get-trans ((this metalkor-legs) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (cond ((or (= arg0 2) (= arg0 3)) @@ -485,7 +485,7 @@ ;; definition for method 7 of type metalkor-legs ;; WARN: Return type mismatch process-focusable vs metalkor-legs. -(defmethod relocate metalkor-legs ((this metalkor-legs) (arg0 int)) +(defmethod relocate ((this metalkor-legs) (arg0 int)) (dotimes (v1-0 6) (if (nonzero? (-> this joint-ik v1-0)) (&+! (-> this joint-ik v1-0) arg0) @@ -804,7 +804,7 @@ ;; definition for method 13 of type metalkor-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod apply-gravity metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity ((this metalkor-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (local-vars (f0-16 float) (f0-31 float)) (cond ((zero? arg1) @@ -1138,20 +1138,20 @@ ) ;; definition for method 16 of type metalkor-chain-physics -(defmethod chain-physics-method-16 metalkor-chain-physics ((this metalkor-chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 ((this metalkor-chain-physics) (arg0 int)) 10922.667 ) ;; definition for method 14 of type metalkor-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-14 metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 ((this metalkor-chain-physics) (arg0 vector) (arg1 int)) (vector-reset! arg0) 0 (none) ) ;; definition for method 15 of type metalkor-chain-physics -(defmethod clamp-length metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) +(defmethod clamp-length ((this metalkor-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) ((method-of-type chain-physics clamp-length) this arg0 arg1 arg2 arg3) (when (< 5 (the-as int arg2)) (let ((a0-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg3 node-list data 3))) @@ -1169,7 +1169,7 @@ ;; definition for method 12 of type metalkor-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod gravity-update metalkor-chain-physics ((this metalkor-chain-physics) (arg0 process-drawable)) +(defmethod gravity-update ((this metalkor-chain-physics) (arg0 process-drawable)) (let ((t9-0 (method-of-type chain-physics gravity-update))) (t9-0 this arg0) ) @@ -1200,7 +1200,7 @@ ;; definition for method 17 of type metalkor-chain-physics ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-17 metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-17 ((this metalkor-chain-physics) (arg0 vector) (arg1 int)) (local-vars (v1-26 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1268,7 +1268,7 @@ ;; definition for method 7 of type metalkor-lowtorso ;; WARN: Return type mismatch process-focusable vs metalkor-lowtorso. -(defmethod relocate metalkor-lowtorso ((this metalkor-lowtorso) (arg0 int)) +(defmethod relocate ((this metalkor-lowtorso) (arg0 int)) (if (nonzero? (-> this tail)) (&+! (-> this tail) arg0) ) @@ -1483,14 +1483,10 @@ ;; definition of type nestb-formation (deftype nestb-formation (hover-formation) () - :heap-base #x10 - :method-count-assert 16 - :size-assert #x90 - :flag-assert #x1000100090 ) ;; definition for method 3 of type nestb-formation -(defmethod inspect nestb-formation ((this nestb-formation)) +(defmethod inspect ((this nestb-formation)) (when (not this) (set! this this) (goto cfg-4) @@ -1503,14 +1499,14 @@ ) ;; definition for method 15 of type nestb-formation -(defmethod hover-formation-method-15 nestb-formation ((this nestb-formation) (arg0 vector) (arg1 vector)) +(defmethod hover-formation-method-15 ((this nestb-formation) (arg0 vector) (arg1 vector)) (logior! (-> this formation flags) 2) 0 ) ;; definition for method 115 of type metalkor-flitter ;; WARN: Return type mismatch symbol vs none. -(defmethod init-enemy! metalkor-flitter ((this metalkor-flitter)) +(defmethod init-enemy! ((this metalkor-flitter)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -1550,7 +1546,7 @@ ) ;; definition for method 132 of type metalkor-flitter -(defmethod dispose! metalkor-flitter ((this metalkor-flitter)) +(defmethod dispose! ((this metalkor-flitter)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (with-pp (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) @@ -1596,7 +1592,7 @@ ) ;; definition for method 132 of type metalkor-wasp -(defmethod dispose! metalkor-wasp ((this metalkor-wasp)) +(defmethod dispose! ((this metalkor-wasp)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (with-pp (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) @@ -1649,22 +1645,18 @@ ;; definition of type rift-ring-ingame (deftype rift-ring-ingame (process-drawable) - ((anim-speed delayed-rand-float :inline :offset-assert 200) - (stutter symbol :offset-assert 228) - (spin-sound sound-id :offset-assert 232) - (spin-sound-playing symbol :offset-assert 236) + ((anim-speed delayed-rand-float :inline) + (stutter symbol) + (spin-sound sound-id) + (spin-sound-playing symbol) ) - :heap-base #x70 - :method-count-assert 21 - :size-assert #xf0 - :flag-assert #x15007000f0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type rift-ring-ingame -(defmethod inspect rift-ring-ingame ((this rift-ring-ingame)) +(defmethod inspect ((this rift-ring-ingame)) (when (not this) (set! this this) (goto cfg-4) @@ -1714,7 +1706,7 @@ ) ;; definition for method 10 of type rift-ring-ingame -(defmethod deactivate rift-ring-ingame ((this rift-ring-ingame)) +(defmethod deactivate ((this rift-ring-ingame)) (if (-> this spin-sound-playing) (sound-stop (-> this spin-sound)) ) @@ -1724,7 +1716,7 @@ ;; definition for method 11 of type rift-ring-ingame ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! rift-ring-ingame ((this rift-ring-ingame) (arg0 entity-actor)) +(defmethod init-from-entity! ((this rift-ring-ingame) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1749,7 +1741,7 @@ This commonly includes things such as: ;; definition for method 13 of type metalkor-spinner-chain-physics ;; WARN: Return type mismatch vector vs none. -(defmethod apply-gravity metalkor-spinner-chain-physics ((this metalkor-spinner-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity ((this metalkor-spinner-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (vector-float*! arg0 (-> this gravity) (-> this gravity-mult)) (vector+float*! arg0 @@ -1762,7 +1754,7 @@ This commonly includes things such as: ;; definition for method 14 of type metalkor-spinner-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-14 metalkor-spinner-chain-physics ((this metalkor-spinner-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 ((this metalkor-spinner-chain-physics) (arg0 vector) (arg1 int)) (vector-reset! arg0) 0 (none) @@ -1770,7 +1762,7 @@ This commonly includes things such as: ;; definition for method 7 of type metalkor-spinner ;; WARN: Return type mismatch process-drawable vs metalkor-spinner. -(defmethod relocate metalkor-spinner ((this metalkor-spinner) (arg0 int)) +(defmethod relocate ((this metalkor-spinner) (arg0 int)) (if (nonzero? (-> this chain)) (&+! (-> this chain) arg0) ) @@ -1949,18 +1941,14 @@ This commonly includes things such as: ;; definition of type nest-break-precipice (deftype nest-break-precipice (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) ;; definition for method 3 of type nest-break-precipice -(defmethod inspect nest-break-precipice ((this nest-break-precipice)) +(defmethod inspect ((this nest-break-precipice)) (when (not this) (set! this this) (goto cfg-4) @@ -1993,7 +1981,7 @@ This commonly includes things such as: ;; definition for method 11 of type nest-break-precipice ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-break-precipice ((this nest-break-precipice) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nest-break-precipice) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2020,7 +2008,7 @@ This commonly includes things such as: ;; definition for method 15 of type hud-metalkor ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-metalkor ((this hud-metalkor)) +(defmethod draw ((this hud-metalkor)) (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 1)) -62 14) @@ -2058,7 +2046,7 @@ This commonly includes things such as: ;; definition for method 17 of type hud-metalkor ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-metalkor ((this hud-metalkor)) +(defmethod init-callback ((this hud-metalkor)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) @@ -2173,17 +2161,13 @@ This commonly includes things such as: ;; definition of type metalkor-rays (deftype metalkor-rays (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type metalkor-rays -(defmethod inspect metalkor-rays ((this metalkor-rays)) +(defmethod inspect ((this metalkor-rays)) (when (not this) (set! this this) (goto cfg-4) @@ -2454,7 +2438,7 @@ This commonly includes things such as: ;; definition for method 7 of type metalkor-bomb ;; WARN: Return type mismatch process-drawable vs metalkor-bomb. -(defmethod relocate metalkor-bomb ((this metalkor-bomb) (arg0 int)) +(defmethod relocate ((this metalkor-bomb) (arg0 int)) (dotimes (v1-0 (min 49 (-> *metalkor-bomb-probe-joints* length))) (when (nonzero? (-> this joint-mods v1-0)) (if (nonzero? (-> this joint-mods v1-0)) diff --git a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-setup_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-setup_REF.gc index 65bb9534652..5172c66e10f 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-setup_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-setup_REF.gc @@ -87,20 +87,16 @@ ;; definition of type metalkor-bomb (deftype metalkor-bomb (process-drawable) - ((root collide-shape-moving :override) - (joint-mods joint-mod 49 :offset-assert 200) + ((root collide-shape-moving :override) + (joint-mods joint-mod 49) ) - :heap-base #x110 - :method-count-assert 21 - :size-assert #x18c - :flag-assert #x150110018c - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type metalkor-bomb -(defmethod inspect metalkor-bomb ((this metalkor-bomb)) +(defmethod inspect ((this metalkor-bomb)) (when (not this) (set! this this) (goto cfg-4) @@ -115,21 +111,17 @@ ;; definition of type gem-tracker (deftype gem-tracker (process) - ((gems handle 10 :offset-assert 128) - (gems-collected int8 :offset-assert 208) - (perm-byte-index int8 :offset-assert 209) + ((gems handle 10) + (gems-collected int8) + (perm-byte-index int8) ) - :heap-base #x60 - :method-count-assert 15 - :size-assert #xd2 - :flag-assert #xf006000d2 - (:methods - (idle () _type_ :state 14) + (:state-methods + idle ) ) ;; definition for method 3 of type gem-tracker -(defmethod inspect gem-tracker ((this gem-tracker)) +(defmethod inspect ((this gem-tracker)) (when (not this) (set! this this) (goto cfg-4) @@ -219,14 +211,10 @@ ;; definition of type flitter-gem-tracker (deftype flitter-gem-tracker (gem-tracker) () - :heap-base #x60 - :method-count-assert 15 - :size-assert #xd2 - :flag-assert #xf006000d2 ) ;; definition for method 3 of type flitter-gem-tracker -(defmethod inspect flitter-gem-tracker ((this flitter-gem-tracker)) +(defmethod inspect ((this flitter-gem-tracker)) (when (not this) (set! this this) (goto cfg-4) @@ -241,14 +229,10 @@ ;; definition of type wasp-gem-tracker (deftype wasp-gem-tracker (gem-tracker) () - :heap-base #x60 - :method-count-assert 15 - :size-assert #xd2 - :flag-assert #xf006000d2 ) ;; definition for method 3 of type wasp-gem-tracker -(defmethod inspect wasp-gem-tracker ((this wasp-gem-tracker)) +(defmethod inspect ((this wasp-gem-tracker)) (when (not this) (set! this this) (goto cfg-4) @@ -262,19 +246,15 @@ ;; definition of type rift-occlude (deftype rift-occlude (process-drawable) - ((original-trans vector :inline :offset-assert 208) + ((original-trans vector :inline) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xe0 - :flag-assert #x15006000e0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type rift-occlude -(defmethod inspect rift-occlude ((this rift-occlude)) +(defmethod inspect ((this rift-occlude)) (when (not this) (set! this this) (goto cfg-4) @@ -289,19 +269,15 @@ ;; definition of type metalkor-distort (deftype metalkor-distort (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type metalkor-distort -(defmethod inspect metalkor-distort ((this metalkor-distort)) +(defmethod inspect ((this metalkor-distort)) (when (not this) (set! this this) (goto cfg-4) @@ -315,19 +291,15 @@ ;; definition of type metalkor-explode (deftype metalkor-explode (process-drawable) - ((ring handle :offset-assert 200) + ((ring handle) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type metalkor-explode -(defmethod inspect metalkor-explode ((this metalkor-explode)) +(defmethod inspect ((this metalkor-explode)) (when (not this) (set! this this) (goto cfg-4) @@ -343,17 +315,13 @@ ;; definition of type metalkor-kid (deftype metalkor-kid (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type metalkor-kid -(defmethod inspect metalkor-kid ((this metalkor-kid)) +(defmethod inspect ((this metalkor-kid)) (when (not this) (set! this this) (goto cfg-4) @@ -368,17 +336,13 @@ ;; definition of type nestb-tail-bound (deftype nestb-tail-bound (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type nestb-tail-bound -(defmethod inspect nestb-tail-bound ((this nestb-tail-bound)) +(defmethod inspect ((this nestb-tail-bound)) (when (not this) (set! this this) (goto cfg-4) @@ -392,17 +356,14 @@ ;; definition of type metalkor-ja-float-info (deftype metalkor-ja-float-info (structure) - ((float-anim art-joint-anim :offset-assert 0) - (channel-index int8 :offset-assert 4) + ((float-anim art-joint-anim) + (channel-index int8) ) :pack-me - :method-count-assert 9 - :size-assert #x5 - :flag-assert #x900000005 ) ;; definition for method 3 of type metalkor-ja-float-info -(defmethod inspect metalkor-ja-float-info ((this metalkor-ja-float-info)) +(defmethod inspect ((this metalkor-ja-float-info)) (when (not this) (set! this this) (goto cfg-4) @@ -416,17 +377,14 @@ ;; definition of type metalkor-spinner-info (deftype metalkor-spinner-info (structure) - ((joint-index int8 :offset-assert 0) - (launch-angle float :offset-assert 4) + ((joint-index int8) + (launch-angle float) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type metalkor-spinner-info -(defmethod inspect metalkor-spinner-info ((this metalkor-spinner-info)) +(defmethod inspect ((this metalkor-spinner-info)) (when (not this) (set! this this) (goto cfg-4) @@ -440,16 +398,12 @@ ;; definition of type metalkor-shot (deftype metalkor-shot (metalhead-shot) - ((old-transv vector :inline :offset-assert 496) + ((old-transv vector :inline) ) - :heap-base #x180 - :method-count-assert 40 - :size-assert #x200 - :flag-assert #x2801800200 ) ;; definition for method 3 of type metalkor-shot -(defmethod inspect metalkor-shot ((this metalkor-shot)) +(defmethod inspect ((this metalkor-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -568,14 +522,10 @@ ;; definition of type metalkor-flitter (deftype metalkor-flitter (flitter) () - :heap-base #x240 - :method-count-assert 184 - :size-assert #x2b8 - :flag-assert #xb8024002b8 ) ;; definition for method 3 of type metalkor-flitter -(defmethod inspect metalkor-flitter ((this metalkor-flitter)) +(defmethod inspect ((this metalkor-flitter)) (when (not this) (set! this this) (goto cfg-4) @@ -590,14 +540,10 @@ ;; definition of type metalkor-wasp (deftype metalkor-wasp (wasp) () - :heap-base #x310 - :method-count-assert 166 - :size-assert #x388 - :flag-assert #xa603100388 ) ;; definition for method 3 of type metalkor-wasp -(defmethod inspect metalkor-wasp ((this metalkor-wasp)) +(defmethod inspect ((this metalkor-wasp)) (when (not this) (set! this this) (goto cfg-4) @@ -611,16 +557,13 @@ ;; definition of type metalkor-spinner-chain-physics (deftype metalkor-spinner-chain-physics (chain-physics) - ((gravity-mult float :offset-assert 1392) - (velocity-mult float :offset-assert 1396) + ((gravity-mult float) + (velocity-mult float) ) - :method-count-assert 18 - :size-assert #x578 - :flag-assert #x1200000578 ) ;; definition for method 3 of type metalkor-spinner-chain-physics -(defmethod inspect metalkor-spinner-chain-physics ((this metalkor-spinner-chain-physics)) +(defmethod inspect ((this metalkor-spinner-chain-physics)) (when (not this) (set! this this) (goto cfg-4) @@ -649,24 +592,20 @@ ;; definition of type metalkor-spinner (deftype metalkor-spinner (process-drawable) - ((parent-joint-index int8 :offset-assert 200) - (target-pos vector :inline :offset-assert 208) - (chain metalkor-spinner-chain-physics :offset-assert 224) - (anim-speed float :offset-assert 228) + ((parent-joint-index int8) + (target-pos vector :inline) + (chain metalkor-spinner-chain-physics) + (anim-speed float) ) - :heap-base #x70 - :method-count-assert 23 - :size-assert #xe8 - :flag-assert #x17007000e8 - (:methods - (break-it () _type_ :state 20) - (idle () _type_ :state 21) - (shoot-out () _type_ :state 22) + (:state-methods + break-it + idle + shoot-out ) ) ;; definition for method 3 of type metalkor-spinner -(defmethod inspect metalkor-spinner ((this metalkor-spinner)) +(defmethod inspect ((this metalkor-spinner)) (when (not this) (set! this this) (goto cfg-4) @@ -684,24 +623,20 @@ ;; definition of type metalkor-egg (deftype metalkor-egg (process-focusable) - ((last-hit-normal vector :inline :offset-assert 208) - (sticky-time time-frame :offset-assert 224) - (flitter-slot int8 :offset-assert 232) + ((last-hit-normal vector :inline) + (sticky-time time-frame) + (flitter-slot int8) ) - :heap-base #x70 - :method-count-assert 31 - :size-assert #xe9 - :flag-assert #x1f007000e9 - (:methods - (egg-pop () _type_ :state 27) - (fall () _type_ :state 28) - (hatch () _type_ :state 29) - (idle () _type_ :state 30) + (:state-methods + egg-pop + fall + hatch + idle ) ) ;; definition for method 3 of type metalkor-egg -(defmethod inspect metalkor-egg ((this metalkor-egg)) +(defmethod inspect ((this metalkor-egg)) (when (not this) (set! this this) (goto cfg-4) @@ -718,19 +653,15 @@ ;; definition of type metalkor-wings (deftype metalkor-wings (process-drawable) - ((prefix string :offset-assert 200) + ((prefix string) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xcc - :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type metalkor-wings -(defmethod inspect metalkor-wings ((this metalkor-wings)) +(defmethod inspect ((this metalkor-wings)) (when (not this) (set! this this) (goto cfg-4) @@ -745,17 +676,14 @@ ;; definition of type metalkor-foot-lock (deftype metalkor-foot-lock (structure) - ((lock cam-float-seeker :inline :offset-assert 0) - (old-position vector :inline :offset-assert 32) - (initialized symbol :offset-assert 48) + ((lock cam-float-seeker :inline) + (old-position vector :inline) + (initialized symbol) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type metalkor-foot-lock -(defmethod inspect metalkor-foot-lock ((this metalkor-foot-lock)) +(defmethod inspect ((this metalkor-foot-lock)) (when (not this) (set! this this) (goto cfg-4) @@ -770,23 +698,19 @@ ;; definition of type metalkor-legs (deftype metalkor-legs (process-focusable) - ((prefix string :offset-assert 204) - (trackable symbol :offset-assert 208) - (joint-ik joint-mod-ik 6 :offset-assert 212) - (ja-float-info metalkor-ja-float-info 3 :inline :offset-assert 236) - (foot-locks metalkor-foot-lock 6 :inline :offset 288) + ((prefix string) + (trackable symbol) + (joint-ik joint-mod-ik 6) + (ja-float-info metalkor-ja-float-info 3 :inline) + (foot-locks metalkor-foot-lock 6 :inline :offset 288) ) - :heap-base #x220 - :method-count-assert 28 - :size-assert #x2a0 - :flag-assert #x1c022002a0 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) ;; definition for method 3 of type metalkor-legs -(defmethod inspect metalkor-legs ((this metalkor-legs)) +(defmethod inspect ((this metalkor-legs)) (when (not this) (set! this this) (goto cfg-4) @@ -805,21 +729,18 @@ ;; definition of type metalkor-chain-physics (deftype metalkor-chain-physics (chain-physics) - ((prev-rotation float :offset-assert 1392) - (prev-y-rotation float :offset-assert 1396) - (osc-z oscillating-float :inline :offset-assert 1400) - (osc-y oscillating-float :inline :offset-assert 1424) - (rand-z delayed-rand-float :inline :offset-assert 1448) - (rand-y delayed-rand-float :inline :offset-assert 1480) - (move-with-parent symbol :offset-assert 1508) + ((prev-rotation float) + (prev-y-rotation float) + (osc-z oscillating-float :inline) + (osc-y oscillating-float :inline) + (rand-z delayed-rand-float :inline) + (rand-y delayed-rand-float :inline) + (move-with-parent symbol) ) - :method-count-assert 18 - :size-assert #x5e8 - :flag-assert #x12000005e8 ) ;; definition for method 3 of type metalkor-chain-physics -(defmethod inspect metalkor-chain-physics ((this metalkor-chain-physics)) +(defmethod inspect ((this metalkor-chain-physics)) (when (not this) (set! this this) (goto cfg-4) @@ -853,28 +774,24 @@ ;; definition of type metalkor-lowtorso (deftype metalkor-lowtorso (process-focusable) - ((prefix string :offset-assert 204) - (tail metalkor-chain-physics :offset-assert 208) - (tail-initialized symbol :offset-assert 212) - (spinners handle 4 :offset-assert 216) - (ja-float-info metalkor-ja-float-info 3 :inline :offset-assert 248) - (no-collision-timer time-frame :offset 296) - (egg-toss-joint-1 joint-mod :offset-assert 304) - (egg-toss-joint-2 joint-mod :offset-assert 308) - (egg-toss-joint-3 joint-mod :offset-assert 312) - (egg-toss-joint-angle oscillating-float :inline :offset-assert 316) + ((prefix string) + (tail metalkor-chain-physics) + (tail-initialized symbol) + (spinners handle 4) + (ja-float-info metalkor-ja-float-info 3 :inline) + (no-collision-timer time-frame :offset 296) + (egg-toss-joint-1 joint-mod) + (egg-toss-joint-2 joint-mod) + (egg-toss-joint-3 joint-mod) + (egg-toss-joint-angle oscillating-float :inline) ) - :heap-base #xe0 - :method-count-assert 28 - :size-assert #x154 - :flag-assert #x1c00e00154 - (:methods - (idle () _type_ :state 27) + (:state-methods + idle ) ) ;; definition for method 3 of type metalkor-lowtorso -(defmethod inspect metalkor-lowtorso ((this metalkor-lowtorso)) +(defmethod inspect ((this metalkor-lowtorso)) (when (not this) (set! this this) (goto cfg-4) @@ -898,97 +815,93 @@ ;; definition of type metalkor (deftype metalkor (process-focusable) - ((trackable symbol :offset-assert 204) - (flitters handle 10 :offset-assert 208) - (flitter-gem-tracker handle :offset-assert 288) - (wasps handle 3 :offset-assert 296) - (wasp-gem-tracker handle :offset-assert 320) - (last-flitter-launched int8 :offset-assert 328) - (last-wasp-launched int8 :offset-assert 329) - (live-flitters int8 :offset-assert 330) - (live-wasps int8 :offset-assert 331) - (shoot-timer time-frame :offset-assert 336) - (target-angle float :offset-assert 344) - (wave-timer time-frame :offset-assert 352) - (in-wave symbol :offset-assert 360) - (flitter-timer time-frame :offset-assert 368) - (wasp-timer time-frame :offset-assert 376) - (launching-flitters symbol :offset-assert 384) - (launching-wasps symbol :offset-assert 388) - (egg-timer time-frame :offset-assert 392) - (last-close-attack int8 :offset-assert 400) - (last-standing-attack int8 :offset-assert 401) - (stage int8 :offset-assert 402) - (next-stage-timer time-frame :offset-assert 408) - (initial-y float :offset-assert 416) - (shots-fired int16 :offset-assert 420) - (stage-hit-points float :offset-assert 424) - (hud handle :offset-assert 432) - (lowtorso handle :offset-assert 440) - (legs handle :offset-assert 448) - (wings handle :offset-assert 456) - (kid handle :offset-assert 464) - (explode handle :offset-assert 472) - (rift-occlude handle :offset-assert 480) - (last-attack-id uint32 :offset-assert 488) - (current-nav-poly nav-poly :offset-assert 492) - (shot-anticipate sparticle-launch-control :offset-assert 496) - (spinners handle 4 :offset-assert 504) - (neck joint-mod :offset-assert 536) - (previous-flat-travel vector :inline :offset-assert 544) - (previous-flat-travel-timer time-frame :offset-assert 560) - (previous-flat-travel-long-timer time-frame :offset-assert 568) - (min-state-hit-points float :offset-assert 576) - (countdown-to-roar int8 :offset-assert 580) - (for-back-interp cam-float-seeker :inline :offset-assert 584) - (run-walk-interp cam-float-seeker :inline :offset-assert 608) - (left-right-interp cam-float-seeker :inline :offset-assert 632) - (walk-turn-interp cam-float-seeker :inline :offset-assert 656) - (idle-interp cam-float-seeker :inline :offset-assert 680) - (tmp-hit-points float :offset-assert 704) - (reps-till-idle-alt int8 :offset-assert 708) - (last-rotation float :offset-assert 712) - (no-collision-timer time-frame :offset-assert 720) - (egg-angle float :offset 736) - (arm-frame float :offset-assert 740) - (been-to-entity symbol :offset-assert 744) - (flying-speed cam-float-seeker :inline :offset-assert 748) - (wing-sound sound-id :offset-assert 772) - (wing-sound-playing symbol :offset-assert 776) - (explode-sound sound-id :offset-assert 780) - (bomb-sound sound-id :offset-assert 784) - (stop-bomb-sound symbol :offset-assert 788) - (hit-ring-trans vector :inline :offset-assert 800) - (hit-ring-offset vector :inline :offset-assert 816) - (ring-cam-pos cam-float-seeker :inline :offset-assert 832) - (need-teleport symbol :offset-assert 856) + ((trackable symbol) + (flitters handle 10) + (flitter-gem-tracker handle) + (wasps handle 3) + (wasp-gem-tracker handle) + (last-flitter-launched int8) + (last-wasp-launched int8) + (live-flitters int8) + (live-wasps int8) + (shoot-timer time-frame) + (target-angle float) + (wave-timer time-frame) + (in-wave symbol) + (flitter-timer time-frame) + (wasp-timer time-frame) + (launching-flitters symbol) + (launching-wasps symbol) + (egg-timer time-frame) + (last-close-attack int8) + (last-standing-attack int8) + (stage int8) + (next-stage-timer time-frame) + (initial-y float) + (shots-fired int16) + (stage-hit-points float) + (hud handle) + (lowtorso handle) + (legs handle) + (wings handle) + (kid handle) + (explode handle) + (rift-occlude handle) + (last-attack-id uint32) + (current-nav-poly nav-poly) + (shot-anticipate sparticle-launch-control) + (spinners handle 4) + (neck joint-mod) + (previous-flat-travel vector :inline) + (previous-flat-travel-timer time-frame) + (previous-flat-travel-long-timer time-frame) + (min-state-hit-points float) + (countdown-to-roar int8) + (for-back-interp cam-float-seeker :inline) + (run-walk-interp cam-float-seeker :inline) + (left-right-interp cam-float-seeker :inline) + (walk-turn-interp cam-float-seeker :inline) + (idle-interp cam-float-seeker :inline) + (tmp-hit-points float) + (reps-till-idle-alt int8) + (last-rotation float) + (no-collision-timer time-frame) + (egg-angle float :offset 736) + (arm-frame float) + (been-to-entity symbol) + (flying-speed cam-float-seeker :inline) + (wing-sound sound-id) + (wing-sound-playing symbol) + (explode-sound sound-id) + (bomb-sound sound-id) + (stop-bomb-sound symbol) + (hit-ring-trans vector :inline) + (hit-ring-offset vector :inline) + (ring-cam-pos cam-float-seeker :inline) + (need-teleport symbol) ) - :heap-base #x2e0 - :method-count-assert 43 - :size-assert #x35c - :flag-assert #x2b02e0035c - (:methods - (beaten (symbol) _type_ :state 27) - (explode () _type_ :state 28) - (fly-to-ring () _type_ :state 29) - (last-gasp () _type_ :state 30) - (overload-recover () _type_ :state 31) - (fall-down () _type_ :state 32) - (tail-attack () _type_ :state 33) - (foot-attack () _type_ :state 34) - (get-close () _type_ :state 35) - (standing-shot () _type_ :state 36) - (chase-target () _type_ :state 37) - (play-drop-movie () _type_ :state 38) - (start-second-stage () _type_ :state 39) - (hang-shoot-n-launch () _type_ :state 40) - (hidden () _type_ :state 41) - (test () _type_ :state 42) + (:state-methods + (beaten symbol) + explode + fly-to-ring + last-gasp + overload-recover + fall-down + tail-attack + foot-attack + get-close + standing-shot + chase-target + play-drop-movie + start-second-stage + hang-shoot-n-launch + hidden + test ) ) ;; definition for method 3 of type metalkor -(defmethod inspect metalkor ((this metalkor)) +(defmethod inspect ((this metalkor)) (when (not this) (set! this this) (goto cfg-4) @@ -1152,7 +1065,7 @@ ;; definition for method 11 of type nestb-tail-bound ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nestb-tail-bound ((this nestb-tail-bound) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nestb-tail-bound) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1548,16 +1461,13 @@ This commonly includes things such as: ;; definition of type metalkor-ik-setup (deftype metalkor-ik-setup (structure) - ((elbow-index int32 :offset-assert 0) - (hand-dist float :offset-assert 4) + ((elbow-index int32) + (hand-dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type metalkor-ik-setup -(defmethod inspect metalkor-ik-setup ((this metalkor-ik-setup)) +(defmethod inspect ((this metalkor-ik-setup)) (when (not this) (set! this this) (goto cfg-4) @@ -2028,7 +1938,7 @@ This commonly includes things such as: ;; definition for method 11 of type metalkor ;; INFO: Used lq/sq -(defmethod init-from-entity! metalkor ((this metalkor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this metalkor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc index 7f4925a790d..a5121be4e68 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc @@ -306,7 +306,7 @@ ) ;; definition for method 10 of type metalkor -(defmethod deactivate metalkor ((this metalkor)) +(defmethod deactivate ((this metalkor)) (if (-> this wing-sound-playing) (sound-stop (-> this wing-sound)) ) @@ -316,7 +316,7 @@ ;; definition for method 7 of type metalkor ;; WARN: Return type mismatch process-focusable vs metalkor. -(defmethod relocate metalkor ((this metalkor) (arg0 int)) +(defmethod relocate ((this metalkor) (arg0 int)) (if (nonzero? (-> this shot-anticipate)) (&+! (-> this shot-anticipate) arg0) ) @@ -328,7 +328,7 @@ ;; definition for method 20 of type metalkor ;; INFO: Used lq/sq -(defmethod get-trans metalkor ((this metalkor) (arg0 int)) +(defmethod get-trans ((this metalkor) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (local-vars (s5-0 vector)) (cond diff --git a/test/decompiler/reference/jak2/levels/nest/boss/nestb-part_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/nestb-part_REF.gc index 8f13facf286..3b06ab7d451 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/nestb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/nestb-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type nestb-part (deftype nestb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type nestb-part -(defmethod inspect nestb-part ((this nestb-part)) +(defmethod inspect ((this nestb-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc index 1d3c2563563..bbafd37138b 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc @@ -1637,17 +1637,13 @@ ;; definition of type nest-gun-parts (deftype nest-gun-parts (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type nest-gun-parts -(defmethod inspect nest-gun-parts ((this nest-gun-parts)) +(defmethod inspect ((this nest-gun-parts)) (when (not this) (set! this this) (goto cfg-4) @@ -1684,7 +1680,7 @@ ;; definition for method 11 of type nest-gun-parts ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-gun-parts ((this nest-gun-parts) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nest-gun-parts) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1706,17 +1702,13 @@ This commonly includes things such as: ;; definition of type nest-unbroken-rocks (deftype nest-unbroken-rocks (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type nest-unbroken-rocks -(defmethod inspect nest-unbroken-rocks ((this nest-unbroken-rocks)) +(defmethod inspect ((this nest-unbroken-rocks)) (when (not this) (set! this this) (goto cfg-4) @@ -1753,7 +1745,7 @@ This commonly includes things such as: ;; definition for method 11 of type nest-unbroken-rocks ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-unbroken-rocks ((this nest-unbroken-rocks) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nest-unbroken-rocks) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc b/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc index 31742b2d0d0..45c0f10a8d2 100644 --- a/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc @@ -4,14 +4,10 @@ ;; definition of type flying-spider-shot (deftype flying-spider-shot (metalhead-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type flying-spider-shot -(defmethod inspect flying-spider-shot ((this flying-spider-shot)) +(defmethod inspect ((this flying-spider-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -25,7 +21,7 @@ ;; definition for method 28 of type flying-spider-shot ;; WARN: Return type mismatch object vs none. -(defmethod play-impact-sound flying-spider-shot ((this flying-spider-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this flying-spider-shot) (arg0 projectile-options)) (if (zero? arg0) (sound-play "fly-spider-shot") (call-parent-method this arg0) @@ -60,28 +56,26 @@ ;; definition of type flying-spider (deftype flying-spider (nav-enemy) - ((my-up-vector vector :inline :offset-assert 608) - (gspot-normal vector :inline :offset-assert 624) - (gspot-timer time-frame :offset-assert 640) - (focus-dir uint16 :offset-assert 648) - (path-u float :offset-assert 652) - (path-du float :offset-assert 656) + ((my-up-vector vector :inline) + (gspot-normal vector :inline) + (gspot-timer time-frame) + (focus-dir uint16) + (path-u float) + (path-du float) ) - :heap-base #x220 - :method-count-assert 183 - :size-assert #x294 - :flag-assert #xb702200294 + (:state-methods + ambush-falling + attack + attack-fire + turn-to-focus + ) (:methods - (ambush-falling () _type_ :state 178) - (attack () _type_ :state 179) - (attack-fire () _type_ :state 180) - (turn-to-focus () _type_ :state 181) - (flying-spider-method-182 (_type_ vector) none 182) + (flying-spider-method-182 (_type_ vector) none) ) ) ;; definition for method 3 of type flying-spider -(defmethod inspect flying-spider ((this flying-spider)) +(defmethod inspect ((this flying-spider)) (when (not this) (set! this this) (goto cfg-4) @@ -574,7 +568,7 @@ ) ;; definition for method 74 of type flying-spider -(defmethod general-event-handler flying-spider ((this flying-spider) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this flying-spider) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -642,7 +636,7 @@ ) ;; definition for method 55 of type flying-spider -(defmethod track-target! flying-spider ((this flying-spider)) +(defmethod track-target! ((this flying-spider)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -654,7 +648,7 @@ ;; definition for method 125 of type flying-spider ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod enemy-method-125 flying-spider ((this flying-spider) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 ((this flying-spider) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (the-as pat-surface (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) @@ -702,7 +696,7 @@ ;; definition for method 182 of type flying-spider ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod flying-spider-method-182 flying-spider ((this flying-spider) (arg0 vector)) +(defmethod flying-spider-method-182 ((this flying-spider) (arg0 vector)) (cond ((= (-> this root gspot-pos y) -40959590.0) (set! (-> arg0 y) 0.0) @@ -735,7 +729,7 @@ ;; definition for method 142 of type flying-spider ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 flying-spider ((this flying-spider) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this flying-spider) (arg0 nav-control)) (let ((t9-0 (method-of-object this flying-spider-method-182)) (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) @@ -749,7 +743,7 @@ ;; definition for method 109 of type flying-spider ;; WARN: Return type mismatch int vs none. -(defmethod look-at-target! flying-spider ((this flying-spider) (arg0 enemy-flag)) +(defmethod look-at-target! ((this flying-spider) (arg0 enemy-flag)) "Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available @param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details" 0 @@ -758,26 +752,26 @@ ;; definition for method 59 of type flying-spider ;; WARN: Return type mismatch int vs penetrate. -(defmethod get-penetrate-info flying-spider ((this flying-spider)) +(defmethod get-penetrate-info ((this flying-spider)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (the-as penetrate 0) ) ;; definition for method 51 of type flying-spider -(defmethod enemy-method-51 flying-spider ((this flying-spider)) +(defmethod enemy-method-51 ((this flying-spider)) (quaternion-y-angle (-> this root quat)) ) ;; definition for method 60 of type flying-spider -(defmethod coin-flip? flying-spider ((this flying-spider)) +(defmethod coin-flip? ((this flying-spider)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 114 of type flying-spider ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! flying-spider ((this flying-spider)) +(defmethod init-enemy-collision! ((this flying-spider)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -843,7 +837,7 @@ ;; definition for method 115 of type flying-spider ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! flying-spider ((this flying-spider)) +(defmethod init-enemy! ((this flying-spider)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc b/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc index 2d66ed83f3f..d6569393bee 100644 --- a/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc @@ -3,54 +3,52 @@ ;; definition of type mammoth (deftype mammoth (nav-enemy) - ((joint-ik joint-mod-ik 4 :offset-assert 604) - (ik-handle-pos vector 4 :inline :offset-assert 624) - (ik-handle-y float 4 :offset-assert 688) - (heel-lerp float 4 :offset-assert 704) - (foot-flags uint16 :offset-assert 720) - (old-foot-flags uint16 :offset-assert 722) - (y-level float :offset-assert 724) - (foot-pos vector 4 :inline :offset-assert 736) - (my-up-vector vector :inline :offset-assert 800) - (my-up-quat quaternion :inline :offset-assert 816) - (move-pos vector 2 :inline :offset-assert 832) - (travel-dest vector :inline :offset-assert 864) - (tilt-quat quaternion :inline :offset-assert 880) - (path-index int32 :offset-assert 896) - (path-index-dir int32 :offset-assert 900) - (path-pos float :offset-assert 904) - (turn-angle float :offset-assert 908) - (gspot-timer time-frame :offset-assert 912) - (gspot-normal vector :inline :offset-assert 928) - (attack-timer time-frame :offset-assert 944) - (lightning-timer time-frame :offset-assert 952) - (lightning-attack-timer time-frame :offset-assert 960) - (spawn-timer time-frame :offset-assert 968) - (turn-anim-start int32 :offset-assert 976) - (turn-anim int32 :offset-assert 980) - (turn-anim-end int32 :offset-assert 984) - (turn-move-start float :offset-assert 988) - (turn-move-end float :offset-assert 992) - (feet-ik-init-timer time-frame :offset-assert 1000) + ((joint-ik joint-mod-ik 4) + (ik-handle-pos vector 4 :inline) + (ik-handle-y float 4) + (heel-lerp float 4) + (foot-flags uint16) + (old-foot-flags uint16) + (y-level float) + (foot-pos vector 4 :inline) + (my-up-vector vector :inline) + (my-up-quat quaternion :inline) + (move-pos vector 2 :inline) + (travel-dest vector :inline) + (tilt-quat quaternion :inline) + (path-index int32) + (path-index-dir int32) + (path-pos float) + (turn-angle float) + (gspot-timer time-frame) + (gspot-normal vector :inline) + (attack-timer time-frame) + (lightning-timer time-frame) + (lightning-attack-timer time-frame) + (spawn-timer time-frame) + (turn-anim-start int32) + (turn-anim int32) + (turn-anim-end int32) + (turn-move-start float) + (turn-move-end float) + (feet-ik-init-timer time-frame) ) - :heap-base #x370 - :method-count-assert 186 - :size-assert #x3f0 - :flag-assert #xba037003f0 + (:state-methods + waiting + wait-to-walk + walking + walking-attack + turning + ) (:methods - (waiting () _type_ :state 178) - (wait-to-walk () _type_ :state 179) - (walking () _type_ :state 180) - (walking-attack () _type_ :state 181) - (turning () _type_ :state 182) - (mammoth-method-183 (_type_) none 183) - (mammoth-method-184 (_type_) none 184) - (mammoth-method-185 (_type_ vector int) none 185) + (mammoth-method-183 (_type_) none) + (mammoth-method-184 (_type_) none) + (mammoth-method-185 (_type_ vector int) none) ) ) ;; definition for method 3 of type mammoth -(defmethod inspect mammoth ((this mammoth)) +(defmethod inspect ((this mammoth)) (when (not this) (set! this this) (goto cfg-4) @@ -213,18 +211,15 @@ ;; definition of type mammoth-ik-setup (deftype mammoth-ik-setup (structure) - ((elbow-index int32 :offset-assert 0) - (hand-dist float :offset-assert 4) - (ground-dist float :offset-assert 8) - (foot-flag uint16 :offset-assert 12) + ((elbow-index int32) + (hand-dist float) + (ground-dist float) + (foot-flag uint16) ) - :method-count-assert 9 - :size-assert #xe - :flag-assert #x90000000e ) ;; definition for method 3 of type mammoth-ik-setup -(defmethod inspect mammoth-ik-setup ((this mammoth-ik-setup)) +(defmethod inspect ((this mammoth-ik-setup)) (when (not this) (set! this this) (goto cfg-4) @@ -758,7 +753,7 @@ ) ;; definition for method 74 of type mammoth -(defmethod general-event-handler mammoth ((this mammoth) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this mammoth) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -786,7 +781,7 @@ ;; definition for method 185 of type mammoth ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod mammoth-method-185 mammoth ((this mammoth) (arg0 vector) (arg1 int)) +(defmethod mammoth-method-185 ((this mammoth) (arg0 vector) (arg1 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -857,25 +852,25 @@ ) ;; definition for method 67 of type mammoth -(defmethod go-stare mammoth ((this mammoth)) +(defmethod go-stare ((this mammoth)) (go (method-of-object this walking)) ) ;; definition for method 70 of type mammoth -(defmethod go-hostile mammoth ((this mammoth)) +(defmethod go-hostile ((this mammoth)) (go (method-of-object this walking)) ) ;; definition for method 116 of type mammoth ;; WARN: Return type mismatch object vs none. -(defmethod go-idle mammoth ((this mammoth)) +(defmethod go-idle ((this mammoth)) (go (method-of-object this waiting)) (none) ) ;; definition for method 125 of type mammoth ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod enemy-method-125 mammoth ((this mammoth) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 ((this mammoth) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (the-as pat-surface (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) @@ -930,7 +925,7 @@ ;; definition for method 183 of type mammoth ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod mammoth-method-183 mammoth ((this mammoth)) +(defmethod mammoth-method-183 ((this mammoth)) (cond ((= (-> this root gspot-pos y) -40959590.0) (quaternion-copy! (-> this tilt-quat) *unity-quaternion*) @@ -1308,7 +1303,7 @@ ;; definition for method 184 of type mammoth ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod mammoth-method-184 mammoth ((this mammoth)) +(defmethod mammoth-method-184 ((this mammoth)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1432,7 +1427,7 @@ ;; definition for method 55 of type mammoth ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! mammoth ((this mammoth)) +(defmethod track-target! ((this mammoth)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1582,13 +1577,13 @@ ) ;; definition for method 60 of type mammoth -(defmethod coin-flip? mammoth ((this mammoth)) +(defmethod coin-flip? ((this mammoth)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 7 of type mammoth -(defmethod relocate mammoth ((this mammoth) (arg0 int)) +(defmethod relocate ((this mammoth) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this joint-ik v1-0)) (&+! (-> this joint-ik v1-0) arg0) @@ -1599,7 +1594,7 @@ ;; definition for method 114 of type mammoth ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! mammoth ((this mammoth)) +(defmethod init-enemy-collision! ((this mammoth)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1697,7 +1692,7 @@ ;; definition for method 115 of type mammoth ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! mammoth ((this mammoth)) +(defmethod init-enemy! ((this mammoth)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc b/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc index 72f8124a11e..25582bc84b2 100644 --- a/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc @@ -223,21 +223,18 @@ ;; definition of type mantis-jump-info (deftype mantis-jump-info (structure) - ((distance float :offset-assert 0) - (search-step uint32 :offset-assert 4) - (destination vector :inline :offset-assert 16) - (direction uint16 :offset-assert 32) - (start-anim uint32 :offset-assert 36) - (air-anim uint32 :offset-assert 40) - (land-anim uint32 :offset-assert 44) + ((distance float) + (search-step uint32) + (destination vector :inline) + (direction uint16) + (start-anim uint32) + (air-anim uint32) + (land-anim uint32) ) - :method-count-assert 9 - :size-assert #x30 - :flag-assert #x900000030 ) ;; definition for method 3 of type mantis-jump-info -(defmethod inspect mantis-jump-info ((this mantis-jump-info)) +(defmethod inspect ((this mantis-jump-info)) (when (not this) (set! this this) (goto cfg-4) @@ -256,42 +253,40 @@ ;; definition of type mantis (deftype mantis (nav-enemy) - ((base-height float :offset-assert 604) - (flags mantis-flag :offset-assert 608) - (attack-timer time-frame :offset-assert 616) - (track-timer time-frame :offset-assert 624) - (gspot-timer time-frame :offset-assert 632) - (gspot-normal vector :inline :offset-assert 640) - (my-up-vector vector :inline :offset-assert 656) - (jump mantis-jump-info :inline :offset-assert 672) + ((base-height float) + (flags mantis-flag) + (attack-timer time-frame) + (track-timer time-frame) + (gspot-timer time-frame) + (gspot-normal vector :inline) + (my-up-vector vector :inline) + (jump mantis-jump-info :inline) ) - :heap-base #x250 - :method-count-assert 195 - :size-assert #x2d0 - :flag-assert #xc3025002d0 + (:state-methods + crawl + attack0 + attack1 + ambush-crawling + ambush-jumping + mantis-state-183 + roll-right + roll-left + hop-away + ) (:methods - (crawl () _type_ :state 178) - (attack0 () _type_ :state 179) - (attack1 () _type_ :state 180) - (ambush-crawling () _type_ :state 181) - (ambush-jumping () _type_ :state 182) - (mantis-method-183 () none 183) - (roll-right () _type_ :state 184) - (roll-left () _type_ :state 185) - (hop-away () _type_ :state 186) - (mantis-method-187 (_type_) none 187) - (mantis-method-188 (_type_) none 188) - (mantis-method-189 (_type_ vector vector) symbol 189) - (mantis-method-190 (_type_ vector vector) none 190) - (mantis-method-191 (_type_ vector vector) int 191) - (mantis-method-192 (_type_ vector vector) none 192) - (mantis-method-193 (_type_ vector) none 193) - (mantis-method-194 (_type_) symbol 194) + (mantis-method-187 (_type_) none) + (mantis-method-188 (_type_) none) + (mantis-method-189 (_type_ vector vector) symbol) + (mantis-method-190 (_type_ vector vector) none) + (mantis-method-191 (_type_ vector vector) int) + (mantis-method-192 (_type_ vector vector) none) + (mantis-method-193 (_type_ vector) none) + (mantis-method-194 (_type_) symbol) ) ) ;; definition for method 3 of type mantis -(defmethod inspect mantis ((this mantis)) +(defmethod inspect ((this mantis)) (when (not this) (set! this this) (goto cfg-8) @@ -1244,7 +1239,7 @@ ) ;; definition for method 74 of type mantis -(defmethod general-event-handler mantis ((this mantis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this mantis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -1317,7 +1312,7 @@ ) ;; definition for method 77 of type mantis -(defmethod enemy-method-77 mantis ((this mantis) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this mantis) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.02)) @@ -1349,7 +1344,7 @@ ) ;; definition for method 78 of type mantis -(defmethod enemy-method-78 mantis ((this mantis) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this mantis) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.1)) @@ -1397,7 +1392,7 @@ ;; definition for method 125 of type mantis ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod enemy-method-125 mantis ((this mantis) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 ((this mantis) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (the-as pat-surface (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) @@ -1444,7 +1439,7 @@ ;; definition for method 194 of type mantis ;; WARN: Return type mismatch object vs symbol. -(defmethod mantis-method-194 mantis ((this mantis)) +(defmethod mantis-method-194 ((this mantis)) (let ((a0-2 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 1)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -1459,7 +1454,7 @@ ;; definition for method 193 of type mantis ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod mantis-method-193 mantis ((this mantis) (arg0 vector)) +(defmethod mantis-method-193 ((this mantis) (arg0 vector)) (cond ((= (-> this root gspot-pos y) -40959590.0) (set! (-> arg0 y) 0.0) @@ -1491,7 +1486,7 @@ ;; definition for method 142 of type mantis ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 mantis ((this mantis) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this mantis) (arg0 nav-control)) (let ((t9-0 (method-of-object this mantis-method-193)) (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) @@ -1506,7 +1501,7 @@ ;; definition for method 55 of type mantis ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod track-target! mantis ((this mantis)) +(defmethod track-target! ((this mantis)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1529,7 +1524,7 @@ ;; definition for method 187 of type mantis ;; WARN: Return type mismatch object vs none. -(defmethod mantis-method-187 mantis ((this mantis)) +(defmethod mantis-method-187 ((this mantis)) (let ((s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s4-0 (-> this root)) (s5-0 (lambda ((arg0 mantis) (arg1 collide-shape-moving) (arg2 vector)) @@ -1594,7 +1589,7 @@ ;; definition for method 188 of type mantis ;; WARN: Return type mismatch int vs none. -(defmethod mantis-method-188 mantis ((this mantis)) +(defmethod mantis-method-188 ((this mantis)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1632,7 +1627,7 @@ ) ;; definition for method 67 of type mantis -(defmethod go-stare mantis ((this mantis)) +(defmethod go-stare ((this mantis)) (let ((a0-2 (handle->process (-> this focus handle)))) (if (and a0-2 (and (< 81920.0 (vector-vector-xz-distance (-> this root trans) (get-trans (the-as process-focusable a0-2) 0))) @@ -1647,7 +1642,7 @@ ;; definition for method 190 of type mantis ;; WARN: Return type mismatch int vs none. -(defmethod mantis-method-190 mantis ((this mantis) (arg0 vector) (arg1 vector)) +(defmethod mantis-method-190 ((this mantis) (arg0 vector) (arg1 vector)) (let ((s5-0 (-> this jump))) (let* ((f0-0 (vector-length arg1)) (f0-1 (if (< 102400.0 f0-0) @@ -1672,7 +1667,7 @@ ) ;; definition for method 191 of type mantis -(defmethod mantis-method-191 mantis ((this mantis) (arg0 vector) (arg1 vector)) +(defmethod mantis-method-191 ((this mantis) (arg0 vector) (arg1 vector)) (let ((s5-0 (-> this jump))) (vector-length arg1) (vector-normalize! arg1 1.0) @@ -1696,7 +1691,7 @@ ;; definition for method 192 of type mantis ;; WARN: Return type mismatch int vs none. -(defmethod mantis-method-192 mantis ((this mantis) (arg0 vector) (arg1 vector)) +(defmethod mantis-method-192 ((this mantis) (arg0 vector) (arg1 vector)) (let ((s5-0 (-> this jump))) (vector-length arg1) (vector-normalize! arg1 1.0) @@ -1720,7 +1715,7 @@ ) ;; definition for method 189 of type mantis -(defmethod mantis-method-189 mantis ((this mantis) (arg0 vector) (arg1 vector)) +(defmethod mantis-method-189 ((this mantis) (arg0 vector) (arg1 vector)) (let* ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0)) (f30-0 (vector-length arg1)) (f28-0 3640.889) @@ -1790,7 +1785,7 @@ ) ;; definition for method 89 of type mantis -(defmethod enemy-method-89 mantis ((this mantis) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 ((this mantis) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump start-anim))) (a0-4 (-> this skel root-channel 0)) @@ -1805,7 +1800,7 @@ ) ;; definition for method 87 of type mantis -(defmethod enemy-method-87 mantis ((this mantis) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 ((this mantis) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump air-anim))) (a0-4 (-> this skel root-channel 0)) @@ -1821,7 +1816,7 @@ ;; definition for method 92 of type mantis ;; WARN: Return type mismatch quaternion vs none. -(defmethod enemy-method-92 mantis ((this mantis) (arg0 int) (arg1 nav-poly)) +(defmethod enemy-method-92 ((this mantis) (arg0 int) (arg1 nav-poly)) "TODO - nav-poly is a guess @abstract" (let ((v1-0 arg0)) @@ -1855,7 +1850,7 @@ ) ;; definition for method 88 of type mantis -(defmethod enemy-method-88 mantis ((this mantis) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this mantis) (arg0 enemy-jump-info)) (cond ((zero? (-> this jump land-anim)) #f @@ -1877,14 +1872,14 @@ ) ;; definition for method 60 of type mantis -(defmethod coin-flip? mantis ((this mantis)) +(defmethod coin-flip? ((this mantis)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 114 of type mantis ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! mantis ((this mantis)) +(defmethod init-enemy-collision! ((this mantis)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1990,7 +1985,7 @@ ;; definition for method 115 of type mantis ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! mantis ((this mantis)) +(defmethod init-enemy! ((this mantis)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc b/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc index 00c848b30e7..82c9f30f403 100644 --- a/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc @@ -3,24 +3,20 @@ ;; definition of type nest-switch (deftype nest-switch (process-drawable) - ((set-camera symbol :offset-assert 200) - (notify-actor entity-actor :offset-assert 204) - (y-start float :offset-assert 208) - (y-delta float :offset-assert 212) - (y-rot-rate float :offset-assert 216) + ((set-camera symbol) + (notify-actor entity-actor) + (y-start float) + (y-delta float) + (y-rot-rate float) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xdc - :flag-assert #x16006000dc - (:methods - (up () _type_ :state 20) - (down () _type_ :state 21) + (:state-methods + up + down ) ) ;; definition for method 3 of type nest-switch -(defmethod inspect nest-switch ((this nest-switch)) +(defmethod inspect ((this nest-switch)) (when (not this) (set! this this) (goto cfg-4) @@ -136,7 +132,7 @@ ;; definition for method 11 of type nest-switch ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-switch ((this nest-switch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nest-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -194,21 +190,17 @@ This commonly includes things such as: ;; definition of type nest-piston (deftype nest-piston (process-drawable) - ((y-level float :offset-assert 200) - (y-offset float :offset-assert 204) + ((y-level float) + (y-offset float) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (up () _type_ :state 21) + (:state-methods + idle + up ) ) ;; definition for method 3 of type nest-piston -(defmethod inspect nest-piston ((this nest-piston)) +(defmethod inspect ((this nest-piston)) (when (not this) (set! this this) (goto cfg-4) @@ -264,7 +256,7 @@ This commonly includes things such as: ;; definition for method 11 of type nest-piston ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-piston ((this nest-piston) (arg0 entity-actor)) +(defmethod init-from-entity! ((this nest-piston) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/nest/nest-part_REF.gc b/test/decompiler/reference/jak2/levels/nest/nest-part_REF.gc index e00d9117645..65581ca8c7c 100644 --- a/test/decompiler/reference/jak2/levels/nest/nest-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/nest-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type nest-part (deftype nest-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type nest-part -(defmethod inspect nest-part ((this nest-part)) +(defmethod inspect ((this nest-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/nest/nest-scenes_REF.gc b/test/decompiler/reference/jak2/levels/nest/nest-scenes_REF.gc index fe8359e2e1e..56cc97ab243 100644 --- a/test/decompiler/reference/jak2/levels/nest/nest-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/nest-scenes_REF.gc @@ -64,19 +64,15 @@ ;; definition of type canyon-lightning-thingy (deftype canyon-lightning-thingy (process-drawable) - ((lightning lightning-control 5 :offset-assert 200) + ((lightning lightning-control 5) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xdc - :flag-assert #x15006000dc - (:methods - (zap () _type_ :state 20) + (:state-methods + zap ) ) ;; definition for method 3 of type canyon-lightning-thingy -(defmethod inspect canyon-lightning-thingy ((this canyon-lightning-thingy)) +(defmethod inspect ((this canyon-lightning-thingy)) (when (not this) (set! this this) (goto cfg-4) @@ -185,7 +181,7 @@ ;; definition for method 7 of type canyon-lightning-thingy ;; WARN: Return type mismatch process-drawable vs canyon-lightning-thingy. -(defmethod relocate canyon-lightning-thingy ((this canyon-lightning-thingy) (arg0 int)) +(defmethod relocate ((this canyon-lightning-thingy) (arg0 int)) (dotimes (index 5) (if (nonzero? (-> this lightning index)) (&+! (-> this lightning index) arg0) diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc index 7159603a0c1..a963e7247f5 100644 --- a/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc @@ -214,7 +214,7 @@ ;; definition for method 39 of type squid-grenade ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound! squid-grenade ((this squid-grenade)) +(defmethod play-impact-sound! ((this squid-grenade)) "Plays impact sound" (ja-post) 0 @@ -223,7 +223,7 @@ ;; definition for method 30 of type squid-grenade ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! squid-grenade ((this squid-grenade)) +(defmethod init-proj-collision! ((this squid-grenade)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -294,7 +294,7 @@ ) ;; definition for method 31 of type squid-grenade -(defmethod init-proj-settings! squid-grenade ((this squid-grenade)) +(defmethod init-proj-settings! ((this squid-grenade)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1120) this)) (set! (-> this attack-mode) 'squid-grenade) @@ -428,7 +428,7 @@ ) ;; definition for method 10 of type squid-whirlwind -(defmethod deactivate squid-whirlwind ((this squid-whirlwind)) +(defmethod deactivate ((this squid-whirlwind)) (if (-> this whirl-sound-playing) (sound-stop (-> this whirl-sound)) ) @@ -471,7 +471,7 @@ ;; definition for method 15 of type hud-squid ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-squid ((this hud-squid)) +(defmethod draw ((this hud-squid)) (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) -96 0) @@ -520,7 +520,7 @@ ;; definition for method 17 of type hud-squid ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-squid ((this hud-squid)) +(defmethod init-callback ((this hud-squid)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc index e7f0761efc3..062cf1a145a 100644 --- a/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc @@ -3,24 +3,20 @@ ;; definition of type squid-whirlwind (deftype squid-whirlwind (process-drawable) - ((center vector :inline :offset-assert 208) - (center-vel vector :inline :offset-assert 224) - (current-nav-poly nav-poly :offset-assert 240) - (duration time-frame :offset-assert 248) - (whirl-sound sound-id :offset-assert 256) - (whirl-sound-playing symbol :offset-assert 260) + ((center vector :inline) + (center-vel vector :inline) + (current-nav-poly nav-poly) + (duration time-frame) + (whirl-sound sound-id) + (whirl-sound-playing symbol) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x108 - :flag-assert #x1500900108 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type squid-whirlwind -(defmethod inspect squid-whirlwind ((this squid-whirlwind)) +(defmethod inspect ((this squid-whirlwind)) (when (not this) (set! this this) (goto cfg-4) @@ -41,17 +37,13 @@ ;; definition of type squid-collision (deftype squid-collision (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type squid-collision -(defmethod inspect squid-collision ((this squid-collision)) +(defmethod inspect ((this squid-collision)) (when (not this) (set! this this) (goto cfg-4) @@ -65,20 +57,16 @@ ;; definition of type squid-driver (deftype squid-driver (process-drawable) - ((prefix string :offset-assert 200) - (run-free symbol :offset-assert 204) + ((prefix string) + (run-free symbol) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xd0 - :flag-assert #x15005000d0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type squid-driver -(defmethod inspect squid-driver ((this squid-driver)) +(defmethod inspect ((this squid-driver)) (when (not this) (set! this this) (goto cfg-4) @@ -95,17 +83,13 @@ ;; definition of type squid-baron (deftype squid-baron (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type squid-baron -(defmethod inspect squid-baron ((this squid-baron)) +(defmethod inspect ((this squid-baron)) (when (not this) (set! this this) (goto cfg-4) @@ -119,18 +103,15 @@ ;; definition of type squid-tentacle-chain (deftype squid-tentacle-chain (structure) - ((position vector :inline :offset-assert 0) - (velocity vector :inline :offset-assert 16) - (old-x vector :inline :offset-assert 32) - (joint-mod joint-mod :offset-assert 48) + ((position vector :inline) + (velocity vector :inline) + (old-x vector :inline) + (joint-mod joint-mod) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type squid-tentacle-chain -(defmethod inspect squid-tentacle-chain ((this squid-tentacle-chain)) +(defmethod inspect ((this squid-tentacle-chain)) (when (not this) (set! this this) (goto cfg-4) @@ -146,31 +127,29 @@ ;; definition of type squid-tentacle (deftype squid-tentacle (process-drawable) - ((root collide-shape-moving :override) - (chain-joints squid-tentacle-chain 11 :inline :offset-assert 208) - (gravity vector :inline :offset-assert 912) - (gravity-target vector :inline :offset-assert 928) - (stretch-vel float :offset-assert 944) - (center vector :inline :offset-assert 960) - (avoid-center symbol :offset-assert 976) - (wrap symbol :offset-assert 980) - (num-bg-collisions int32 :offset-assert 984) - (max-movement float :offset-assert 988) + ((root collide-shape-moving :override) + (chain-joints squid-tentacle-chain 11 :inline) + (gravity vector :inline) + (gravity-target vector :inline) + (stretch-vel float) + (center vector :inline) + (avoid-center symbol) + (wrap symbol) + (num-bg-collisions int32) + (max-movement float) ) - :heap-base #x360 - :method-count-assert 24 - :size-assert #x3e0 - :flag-assert #x18036003e0 + (:state-methods + test + idle + ) (:methods - (test () _type_ :state 20) - (idle () _type_ :state 21) - (joint-setup (_type_) none 22) - (squid-tentacle-method-23 (_type_) none 23) + (joint-setup (_type_) none) + (squid-tentacle-method-23 (_type_) none) ) ) ;; definition for method 3 of type squid-tentacle -(defmethod inspect squid-tentacle ((this squid-tentacle)) +(defmethod inspect ((this squid-tentacle)) (when (not this) (set! this this) (goto cfg-4) @@ -193,18 +172,15 @@ ;; definition of type squid-grenade-holder (deftype squid-grenade-holder (structure) - ((target-position vector :inline :offset-assert 0) - (show-it symbol :offset-assert 16) - (grenade handle :offset-assert 24) - (marker handle :offset-assert 32) + ((target-position vector :inline) + (show-it symbol) + (grenade handle) + (marker handle) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; definition for method 3 of type squid-grenade-holder -(defmethod inspect squid-grenade-holder ((this squid-grenade-holder)) +(defmethod inspect ((this squid-grenade-holder)) (when (not this) (set! this this) (goto cfg-4) @@ -220,20 +196,16 @@ ;; definition of type squid-grenade (deftype squid-grenade (projectile) - ((traj trajectory :inline :offset-assert 480) - (traj-dest vector :inline :offset-assert 528) - (traj-timer time-frame :offset-assert 544) - (traj-duration float :offset-assert 552) - (fly-sound sound-id :offset-assert 556) + ((traj trajectory :inline) + (traj-dest vector :inline) + (traj-timer time-frame) + (traj-duration float) + (fly-sound sound-id) ) - :heap-base #x1b0 - :method-count-assert 40 - :size-assert #x230 - :flag-assert #x2801b00230 ) ;; definition for method 3 of type squid-grenade -(defmethod inspect squid-grenade ((this squid-grenade)) +(defmethod inspect ((this squid-grenade)) (when (not this) (set! this this) (goto cfg-4) @@ -252,119 +224,117 @@ ;; definition of type squid (deftype squid (process-focusable) - ((quat quaternion :inline :offset-assert 208) - (trans vector :inline :offset-assert 224) - (residual-velocity vector :inline :offset-assert 240) - (residual-accumulator-1 float :offset-assert 256) - (residual-accumulator-2 float :offset-assert 260) - (force-onto-mesh symbol :offset-assert 264) - (mesh-forced symbol :offset-assert 268) - (hit-reaction oscillating-vector :inline :offset-assert 272) - (traj trajectory :inline :offset-assert 336) - (traj-src vector :inline :offset-assert 384) - (traj-dest vector :inline :offset-assert 400) - (traj-timer time-frame :offset-assert 416) - (traj-duration float :offset-assert 424) - (current-nav-poly nav-poly :offset-assert 428) - (tentacles handle 6 :offset-assert 432) - (baron squid-baron :offset-assert 480) - (driver (pointer squid-driver) :offset-assert 484) - (driver-blend cam-float-seeker :inline :offset-assert 488) - (blink-time time-frame :offset-assert 512) - (blink-mask int32 :offset-assert 520) - (thruster-part sparticle-launch-control :offset-assert 524) - (gun-tilt-left-jm joint-mod :offset-assert 528) - (gun-tilt-right-jm joint-mod :offset-assert 532) - (gun-tilt float :offset-assert 536) - (next-gun int8 :offset-assert 540) - (fire-aft symbol :offset-assert 544) - (gun-high-to-low symbol :offset-assert 548) - (grenade squid-grenade-holder 10 :inline :offset-assert 560) - (first-path path-control :offset-assert 1040) - (second-path path-control :offset-assert 1044) - (third-path path-control :offset-assert 1048) - (shield-timer time-frame :offset-assert 1056) - (shield-color vector :inline :offset-assert 1072) - (shield-shattered symbol :offset-assert 1088) - (shield-hit-points float :offset-assert 1092) - (hit-points int32 :offset-assert 1096) - (invincible-timer time-frame :offset-assert 1104) - (stage int32 :offset-assert 1112) - (collision-actor (pointer squid-collision) :offset-assert 1116) - (tentacle-base-jm joint-mod :offset-assert 1120) - (tentacle-base-rotation float :offset-assert 1124) - (tentacle-base-rotation-speed cam-float-seeker :inline :offset-assert 1128) - (stage-2-go-status int32 :offset-assert 1152) - (gate-intact symbol :offset-assert 1156) - (hud handle :offset-assert 1160) - (desired-rotate-to-vector-angle degrees :offset-assert 1168) - (allowed-rotate-to-vector-angle degrees :offset-assert 1172) - (stop-shooting symbol :offset-assert 1176) - (attack-id uint32 :offset-assert 1180) - (rush-sound sound-id :offset-assert 1184) - (rush-sound-playing symbol :offset-assert 1188) - (rush-end-time time-frame :offset-assert 1192) - (jet-sound sound-id :offset-assert 1200) - (jet-sound-playing symbol :offset-assert 1204) - (jet-pitch int64 :offset-assert 1208) - (negate-jet-pitch symbol :offset-assert 1216) - (jet-volume int64 :offset-assert 1224) - (can-play-squid-boost symbol :offset-assert 1232) - (tentacle-sound sound-id :offset-assert 1236) - (tentacle-sound-playing symbol :offset-assert 1240) - (spin-sound sound-id :offset-assert 1244) - (spin-sound-playing symbol :offset-assert 1248) - (reload-played symbol :offset-assert 1252) - (max-plane int32 :offset-assert 1256) - (debug-timer time-frame :offset-assert 1264) - (debug-on symbol :offset-assert 1272) - (last-damaged-talker int8 :offset-assert 1276) - (last-shield-hit-talker int8 :offset-assert 1277) - (last-no-energy-talker int8 :offset-assert 1278) - (last-shooting-talker int8 :offset-assert 1279) - (last-headbutting-talker int8 :offset-assert 1280) - (last-general-talker int8 :offset-assert 1281) - (last-start-recharging-talker int8 :offset-assert 1282) - (last-done-recharging-talker int8 :offset-assert 1283) - (suck float :offset-assert 1284) + ((quat quaternion :inline) + (trans vector :inline) + (residual-velocity vector :inline) + (residual-accumulator-1 float) + (residual-accumulator-2 float) + (force-onto-mesh symbol) + (mesh-forced symbol) + (hit-reaction oscillating-vector :inline) + (traj trajectory :inline) + (traj-src vector :inline) + (traj-dest vector :inline) + (traj-timer time-frame) + (traj-duration float) + (current-nav-poly nav-poly) + (tentacles handle 6) + (baron squid-baron) + (driver (pointer squid-driver)) + (driver-blend cam-float-seeker :inline) + (blink-time time-frame) + (blink-mask int32) + (thruster-part sparticle-launch-control) + (gun-tilt-left-jm joint-mod) + (gun-tilt-right-jm joint-mod) + (gun-tilt float) + (next-gun int8) + (fire-aft symbol) + (gun-high-to-low symbol) + (grenade squid-grenade-holder 10 :inline) + (first-path path-control) + (second-path path-control) + (third-path path-control) + (shield-timer time-frame) + (shield-color vector :inline) + (shield-shattered symbol) + (shield-hit-points float) + (hit-points int32) + (invincible-timer time-frame) + (stage int32) + (collision-actor (pointer squid-collision)) + (tentacle-base-jm joint-mod) + (tentacle-base-rotation float) + (tentacle-base-rotation-speed cam-float-seeker :inline) + (stage-2-go-status int32) + (gate-intact symbol) + (hud handle) + (desired-rotate-to-vector-angle degrees) + (allowed-rotate-to-vector-angle degrees) + (stop-shooting symbol) + (attack-id uint32) + (rush-sound sound-id) + (rush-sound-playing symbol) + (rush-end-time time-frame) + (jet-sound sound-id) + (jet-sound-playing symbol) + (jet-pitch int64) + (negate-jet-pitch symbol) + (jet-volume int64) + (can-play-squid-boost symbol) + (tentacle-sound sound-id) + (tentacle-sound-playing symbol) + (spin-sound sound-id) + (spin-sound-playing symbol) + (reload-played symbol) + (max-plane int32) + (debug-timer time-frame) + (debug-on symbol) + (last-damaged-talker int8) + (last-shield-hit-talker int8) + (last-no-energy-talker int8) + (last-shooting-talker int8) + (last-headbutting-talker int8) + (last-general-talker int8) + (last-start-recharging-talker int8) + (last-done-recharging-talker int8) + (suck float) ) - :heap-base #x490 - :method-count-assert 54 - :size-assert #x508 - :flag-assert #x3604900508 + (:state-methods + test + beaten + wait-around-corner + wait-beside-building + flee + pre-flee + recharge + fly-to-post + headbut + fire-whirlwind + fire-grenades + fire + fly-to-shoot-spot + idle + hidden + ) (:methods - (test () _type_ :state 27) - (beaten () _type_ :state 28) - (wait-around-corner () _type_ :state 29) - (wait-beside-building () _type_ :state 30) - (flee () _type_ :state 31) - (pre-flee () _type_ :state 32) - (recharge () _type_ :state 33) - (fly-to-post () _type_ :state 34) - (headbut () _type_ :state 35) - (fire-whirlwind () _type_ :state 36) - (fire-grenades () _type_ :state 37) - (fire () _type_ :state 38) - (fly-to-shoot-spot () _type_ :state 39) - (idle () _type_ :state 40) - (hidden () _type_ :state 41) - (squid-method-42 (_type_ vector) vector 42) - (squid-method-43 (_type_ vector float float) none 43) - (squid-method-44 (_type_ vector vector) symbol 44) - (move-to-spot (_type_ vector symbol) none 45) - (set-traj-towards-vec (_type_ vector vector vector) none 46) - (float-sin-clamp (_type_ float) float 47) - (squid-method-48 (_type_) float 48) - (setup-part-engine (_type_ symbol) none 49) - (squid-post (_type_) none 50) - (spawn-whirlwind (_type_) (pointer squid-whirlwind) 51) - (spawn-grenade (_type_ int squid-grenade-holder float) none 52) - (squid-method-53 (_type_ int) none 53) + (squid-method-42 (_type_ vector) vector) + (squid-method-43 (_type_ vector float float) none) + (squid-method-44 (_type_ vector vector) symbol) + (move-to-spot (_type_ vector symbol) none) + (set-traj-towards-vec (_type_ vector vector vector) none) + (float-sin-clamp (_type_ float) float) + (squid-method-48 (_type_) float) + (setup-part-engine (_type_ symbol) none) + (squid-post (_type_) none) + (spawn-whirlwind (_type_) (pointer squid-whirlwind)) + (spawn-grenade (_type_ int squid-grenade-holder float) none) + (squid-method-53 (_type_ int) none) ) ) ;; definition for method 3 of type squid -(defmethod inspect squid ((this squid)) +(defmethod inspect ((this squid)) (when (not this) (set! this this) (goto cfg-4) @@ -866,7 +836,7 @@ ;; definition for method 22 of type squid-tentacle ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod joint-setup squid-tentacle ((this squid-tentacle)) +(defmethod joint-setup ((this squid-tentacle)) (dotimes (s5-0 11) (let ((s4-0 (-> this chain-joints s5-0))) (vector<-cspace! (-> s4-0 position) (-> s4-0 joint-mod joint)) @@ -881,7 +851,7 @@ ;; definition for method 23 of type squid-tentacle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod squid-tentacle-method-23 squid-tentacle ((this squid-tentacle)) +(defmethod squid-tentacle-method-23 ((this squid-tentacle)) (local-vars (v1-134 float) (v1-162 float) @@ -1332,7 +1302,7 @@ ;; definition for method 7 of type squid-tentacle ;; WARN: Return type mismatch process-drawable vs squid-tentacle. -(defmethod relocate squid-tentacle ((this squid-tentacle) (arg0 int)) +(defmethod relocate ((this squid-tentacle) (arg0 int)) (dotimes (v1-0 11) (if (nonzero? (-> this chain-joints v1-0 joint-mod)) (&+! (-> this chain-joints v1-0 joint-mod) arg0) @@ -1777,7 +1747,7 @@ ) ;; definition for method 10 of type squid -(defmethod deactivate squid ((this squid)) +(defmethod deactivate ((this squid)) (if (nonzero? (-> this thruster-part)) (kill-and-free-particles (-> this thruster-part)) ) @@ -1799,7 +1769,7 @@ ;; definition for method 7 of type squid ;; WARN: Return type mismatch process-drawable vs squid. -(defmethod relocate squid ((this squid) (arg0 int)) +(defmethod relocate ((this squid) (arg0 int)) (if (nonzero? (-> this thruster-part)) (&+! (-> this thruster-part) arg0) ) @@ -1827,7 +1797,7 @@ ;; definition for method 11 of type squid ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! squid ((this squid) (arg0 entity-actor)) +(defmethod init-from-entity! ((this squid) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2138,7 +2108,7 @@ This commonly includes things such as: ;; definition for method 42 of type squid ;; INFO: Used lq/sq -(defmethod squid-method-42 squid ((this squid) (arg0 vector)) +(defmethod squid-method-42 ((this squid) (arg0 vector)) (set! (-> arg0 quad) (-> (if *target* (get-trans *target* 3) (-> this nav state mesh bounds) @@ -2151,7 +2121,7 @@ This commonly includes things such as: ;; definition for method 43 of type squid ;; WARN: Return type mismatch int vs none. -(defmethod squid-method-43 squid ((this squid) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod squid-method-43 ((this squid) (arg0 vector) (arg1 float) (arg2 float)) (let ((s4-0 (new 'stack-no-clear 'matrix)) (s5-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this quat))) ) @@ -2186,7 +2156,7 @@ This commonly includes things such as: ;; definition for method 44 of type squid ;; INFO: Used lq/sq -(defmethod squid-method-44 squid ((this squid) (arg0 vector) (arg1 vector)) +(defmethod squid-method-44 ((this squid) (arg0 vector) (arg1 vector)) (let ((v1-0 (new 'stack-no-clear 'collide-query))) (set! (-> v1-0 start-pos quad) (-> arg0 quad)) (vector-! (-> v1-0 move-dist) arg1 arg0) @@ -2205,7 +2175,7 @@ This commonly includes things such as: ;; definition for method 45 of type squid ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-to-spot squid ((this squid) (arg0 vector) (arg1 symbol)) +(defmethod move-to-spot ((this squid) (arg0 vector) (arg1 symbol)) (local-vars (sv-656 vector) (sv-672 vector) @@ -2381,7 +2351,7 @@ This commonly includes things such as: ;; definition for method 46 of type squid ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-traj-towards-vec squid ((this squid) (src vector) (arg2 vector) (dest vector)) +(defmethod set-traj-towards-vec ((this squid) (src vector) (arg2 vector) (dest vector)) "Set up the [[trajectory]] towards `dest`." (set-time! (-> this traj-timer)) (set! (-> this traj-src quad) (-> src quad)) @@ -2401,13 +2371,13 @@ This commonly includes things such as: ) ;; definition for method 47 of type squid -(defmethod float-sin-clamp squid ((this squid) (arg0 float)) +(defmethod float-sin-clamp ((this squid) (arg0 float)) (parameter-ease-sin-clamp (* 0.6366198 arg0)) ) ;; definition for method 48 of type squid ;; INFO: Used lq/sq -(defmethod squid-method-48 squid ((this squid)) +(defmethod squid-method-48 ((this squid)) (when (< 0.00001 (-> this residual-accumulator-1)) (set! (-> this residual-accumulator-1) (* 0.95 (-> this residual-accumulator-1))) (+! (-> this residual-accumulator-2) (-> this residual-accumulator-1)) @@ -2466,7 +2436,7 @@ This commonly includes things such as: ;; definition for method 49 of type squid ;; WARN: Return type mismatch int vs none. -(defmethod setup-part-engine squid ((this squid) (arg0 symbol)) +(defmethod setup-part-engine ((this squid) (arg0 symbol)) (when (>= (- (current-time) (-> this blink-time)) 0) (set! (-> this blink-mask) 0) (dotimes (s5-0 10) @@ -2628,7 +2598,7 @@ This commonly includes things such as: ;; definition for method 50 of type squid ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod squid-post squid ((this squid)) +(defmethod squid-post ((this squid)) (local-vars (v0-33 object) (s5-9 int) @@ -2982,7 +2952,7 @@ This commonly includes things such as: ;; definition for method 51 of type squid ;; WARN: Return type mismatch (pointer process) vs (pointer squid-whirlwind). -(defmethod spawn-whirlwind squid ((this squid)) +(defmethod spawn-whirlwind ((this squid)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s4-0 (squid-method-42 this (new 'stack-no-clear 'vector))) ) @@ -3015,7 +2985,7 @@ This commonly includes things such as: ;; definition for method 52 of type squid ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod spawn-grenade squid ((this squid) (arg0 int) (arg1 squid-grenade-holder) (arg2 float)) +(defmethod spawn-grenade ((this squid) (arg0 int) (arg1 squid-grenade-holder) (arg2 float)) (squid-increment-shield (+ -0.001 (/ -1.0 (* 2.0 (the float (* (squid-num-grenades-to-shoot) 2)))))) (let ((s4-1 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0))) @@ -3046,14 +3016,10 @@ This commonly includes things such as: ;; definition of type squid-shot (deftype squid-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type squid-shot -(defmethod inspect squid-shot ((this squid-shot)) +(defmethod inspect ((this squid-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -3067,7 +3033,7 @@ This commonly includes things such as: ;; definition for method 28 of type squid-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound squid-shot ((this squid-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this squid-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -3110,7 +3076,7 @@ This commonly includes things such as: ;; definition for method 31 of type squid-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! squid-shot ((this squid-shot)) +(defmethod init-proj-settings! ((this squid-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this hit-actor?) #f) (set! (-> this tail-pos quad) (-> this root trans quad)) @@ -3129,7 +3095,7 @@ This commonly includes things such as: ;; definition for method 24 of type squid-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight squid-shot ((this squid-shot)) +(defmethod draw-laser-sight ((this squid-shot)) "TODO - confirm If applicable, draw the laser sight particles" (draw-beam (-> *part-id-table* 4861) (-> this tail-pos) (-> this starting-dir) #f #t) (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) @@ -3149,7 +3115,7 @@ This commonly includes things such as: ;; definition for method 25 of type squid-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles squid-shot ((this squid-shot)) +(defmethod spawn-impact-particles ((this squid-shot)) "Spawns associated particles with the projectile if applicable" (let* ((gp-0 (-> this root trans)) (a1-0 (-> this tail-pos)) @@ -3186,7 +3152,7 @@ This commonly includes things such as: ;; definition for method 26 of type squid-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles squid-shot ((this squid-shot)) +(defmethod spawn-shell-particles ((this squid-shot)) "TODO - confirm" (let* ((s3-0 (-> this root)) (s4-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s3-0 trans)) 2048.0)) diff --git a/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc b/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc index fee3714ac6e..9fbdbea1c22 100644 --- a/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc @@ -3,19 +3,16 @@ ;; definition of type pal-fan-ring (deftype pal-fan-ring (structure) - ((lightning lightning-control :offset-assert 0) - (radius float :offset-assert 4) - (dist float :offset-assert 8) - (local-z-rotate float :offset-assert 12) + ((lightning lightning-control) + (radius float) + (dist float) + (local-z-rotate float) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type pal-fan-ring -(defmethod inspect pal-fan-ring ((this pal-fan-ring)) +(defmethod inspect ((this pal-fan-ring)) (when (not this) (set! this this) (goto cfg-4) @@ -31,17 +28,14 @@ ;; definition of type pal-fan-pole (deftype pal-fan-pole (structure) - ((rings pal-fan-ring 6 :inline :offset-assert 0) - (z-rotate float :offset 96) + ((rings pal-fan-ring 6 :inline) + (z-rotate float :offset 96) ) :allow-misaligned - :method-count-assert 9 - :size-assert #x64 - :flag-assert #x900000064 ) ;; definition for method 3 of type pal-fan-pole -(defmethod inspect pal-fan-pole ((this pal-fan-pole)) +(defmethod inspect ((this pal-fan-pole)) (when (not this) (set! this this) (goto cfg-4) @@ -55,25 +49,21 @@ ;; definition of type pal-electric-fan (deftype pal-electric-fan (process-drawable) - ((root collide-shape-moving :override) - (poles pal-fan-pole 3 :inline :offset-assert 200) - (no-collision-timer time-frame :offset 536) - (sound-timer time-frame :offset-assert 544) - (rotate-speed float :offset-assert 552) - (attack-id uint32 :offset-assert 556) - (sound-id sound-id :offset-assert 560) + ((root collide-shape-moving :override) + (poles pal-fan-pole 3 :inline) + (no-collision-timer time-frame :offset 536) + (sound-timer time-frame) + (rotate-speed float) + (attack-id uint32) + (sound-id sound-id) ) - :heap-base #x1c0 - :method-count-assert 21 - :size-assert #x234 - :flag-assert #x1501c00234 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type pal-electric-fan -(defmethod inspect pal-electric-fan ((this pal-electric-fan)) +(defmethod inspect ((this pal-electric-fan)) (when (not this) (set! this this) (goto cfg-4) @@ -243,7 +233,7 @@ ;; definition for method 7 of type pal-electric-fan ;; WARN: Return type mismatch process-drawable vs pal-electric-fan. -(defmethod relocate pal-electric-fan ((this pal-electric-fan) (arg0 int)) +(defmethod relocate ((this pal-electric-fan) (arg0 int)) (dotimes (v1-0 3) (dotimes (a2-0 6) (if (nonzero? (-> (the-as pal-electric-fan (&+ this (* 112 v1-0))) poles 0 rings a2-0 lightning)) @@ -256,7 +246,7 @@ ;; definition for method 11 of type pal-electric-fan ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-electric-fan ((this pal-electric-fan) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-electric-fan) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -416,24 +406,20 @@ This commonly includes things such as: ;; definition of type pal-cable-nut (deftype pal-cable-nut (process-drawable) - ((root collide-shape-moving :override) - (sync sync-linear :inline :offset-assert 200) - (init-quat quaternion :inline :offset-assert 224) - (sound-played? symbol 2 :offset-assert 240) - (hold-percentage float :offset-assert 248) - (wiggle-percentage float :offset-assert 252) + ((root collide-shape-moving :override) + (sync sync-linear :inline) + (init-quat quaternion :inline) + (sound-played? symbol 2) + (hold-percentage float) + (wiggle-percentage float) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #x100 - :flag-assert #x1500800100 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type pal-cable-nut -(defmethod inspect pal-cable-nut ((this pal-cable-nut)) +(defmethod inspect ((this pal-cable-nut)) (when (not this) (set! this this) (goto cfg-4) @@ -509,7 +495,7 @@ This commonly includes things such as: ;; definition for method 11 of type pal-cable-nut ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-cable-nut ((this pal-cable-nut) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-cable-nut) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -598,14 +584,10 @@ This commonly includes things such as: ;; definition of type pal-rot-gun-shot (deftype pal-rot-gun-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type pal-rot-gun-shot -(defmethod inspect pal-rot-gun-shot ((this pal-rot-gun-shot)) +(defmethod inspect ((this pal-rot-gun-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -620,7 +602,7 @@ This commonly includes things such as: ;; definition for method 25 of type pal-rot-gun-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles pal-rot-gun-shot ((this pal-rot-gun-shot)) +(defmethod spawn-impact-particles ((this pal-rot-gun-shot)) "Spawns associated particles with the projectile if applicable" (let* ((gp-0 (-> this root trans)) (a1-0 (-> this tail-pos)) @@ -671,7 +653,7 @@ This commonly includes things such as: ;; definition for method 26 of type pal-rot-gun-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles pal-rot-gun-shot ((this pal-rot-gun-shot)) +(defmethod spawn-shell-particles ((this pal-rot-gun-shot)) "TODO - confirm" (let* ((s3-0 (-> this root)) (s5-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s3-0 trans)) 2048.0)) @@ -734,7 +716,7 @@ This commonly includes things such as: ;; definition for method 28 of type pal-rot-gun-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound pal-rot-gun-shot ((this pal-rot-gun-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this pal-rot-gun-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -781,7 +763,7 @@ This commonly includes things such as: ;; definition for method 30 of type pal-rot-gun-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! pal-rot-gun-shot ((this pal-rot-gun-shot)) +(defmethod init-proj-collision! ((this pal-rot-gun-shot)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -818,7 +800,7 @@ This commonly includes things such as: ;; definition for method 31 of type pal-rot-gun-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! pal-rot-gun-shot ((this pal-rot-gun-shot)) +(defmethod init-proj-settings! ((this pal-rot-gun-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (set! (-> this tail-pos quad) (-> this root trans quad)) (set! (-> this attack-mode) 'pal-rot-gun-shot) @@ -831,29 +813,27 @@ This commonly includes things such as: ;; definition of type pal-rot-gun (deftype pal-rot-gun (process-drawable) - ((init-quat quaternion :inline :offset-assert 208) - (fire-timer time-frame :offset-assert 224) - (gun-index int32 :offset-assert 232) - (spin-rate float :offset-assert 236) - (spin-rate-final float :offset-assert 240) - (sound-id sound-id :offset-assert 244) - (shot-sound-id sound-id :offset-assert 248) - (prev-z-rot float :offset-assert 252) + ((init-quat quaternion :inline) + (fire-timer time-frame) + (gun-index int32) + (spin-rate float) + (spin-rate-final float) + (sound-id sound-id) + (shot-sound-id sound-id) + (prev-z-rot float) ) - :heap-base #x80 - :method-count-assert 24 - :size-assert #x100 - :flag-assert #x1800800100 + (:state-methods + idle + spin + spin-down + ) (:methods - (idle () _type_ :state 20) - (spin () _type_ :state 21) - (spin-down () _type_ :state 22) - (pal-rot-gun-method-23 (_type_ matrix) none 23) + (pal-rot-gun-method-23 (_type_ matrix) none) ) ) ;; definition for method 3 of type pal-rot-gun -(defmethod inspect pal-rot-gun ((this pal-rot-gun)) +(defmethod inspect ((this pal-rot-gun)) (when (not this) (set! this this) (goto cfg-4) @@ -1007,7 +987,7 @@ This commonly includes things such as: ;; definition for method 23 of type pal-rot-gun ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod pal-rot-gun-method-23 pal-rot-gun ((this pal-rot-gun) (arg0 matrix)) +(defmethod pal-rot-gun-method-23 ((this pal-rot-gun) (arg0 matrix)) (let ((v1-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((a2-0 (-> arg0 vector)) (a1-1 (-> arg0 vector 1)) @@ -1034,7 +1014,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type pal-rot-gun -(defmethod deactivate pal-rot-gun ((this pal-rot-gun)) +(defmethod deactivate ((this pal-rot-gun)) (sound-stop (-> this sound-id)) (sound-stop (-> this shot-sound-id)) (call-parent-method this) @@ -1043,7 +1023,7 @@ This commonly includes things such as: ;; definition for method 11 of type pal-rot-gun ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-rot-gun ((this pal-rot-gun) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-rot-gun) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1081,17 +1061,13 @@ This commonly includes things such as: ;; definition of type pal-windmill (deftype pal-windmill (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type pal-windmill -(defmethod inspect pal-windmill ((this pal-windmill)) +(defmethod inspect ((this pal-windmill)) (when (not this) (set! this this) (goto cfg-4) @@ -1128,7 +1104,7 @@ This commonly includes things such as: ;; definition for method 11 of type pal-windmill ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-windmill ((this pal-windmill) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-windmill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1150,21 +1126,17 @@ This commonly includes things such as: ;; definition of type pal-flip-step (deftype pal-flip-step (process-drawable) - ((task-node game-task-node-info :offset-assert 200) + ((task-node game-task-node-info) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xcc - :flag-assert #x17005000cc - (:methods - (idle () _type_ :state 20) - (fall () _type_ :state 21) - (fallen () _type_ :state 22) + (:state-methods + idle + fall + fallen ) ) ;; definition for method 3 of type pal-flip-step -(defmethod inspect pal-flip-step ((this pal-flip-step)) +(defmethod inspect ((this pal-flip-step)) (when (not this) (set! this this) (goto cfg-4) @@ -1226,7 +1198,7 @@ This commonly includes things such as: ;; definition for method 11 of type pal-flip-step ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-flip-step ((this pal-flip-step) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-flip-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/palace/cable/palcab-part_REF.gc b/test/decompiler/reference/jak2/levels/palace/cable/palcab-part_REF.gc index 112cfdc5a0f..78c46087dee 100644 --- a/test/decompiler/reference/jak2/levels/palace/cable/palcab-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/cable/palcab-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type palcab-part (deftype palcab-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type palcab-part -(defmethod inspect palcab-part ((this palcab-part)) +(defmethod inspect ((this palcab-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc b/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc index 24e5a7dd653..f328d85b7a8 100644 --- a/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc @@ -3,20 +3,16 @@ ;; definition of type pal-falling-plat (deftype pal-falling-plat (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (fall () _type_ :state 21) + (:state-methods + idle + fall ) ) ;; definition for method 3 of type pal-falling-plat -(defmethod inspect pal-falling-plat ((this pal-falling-plat)) +(defmethod inspect ((this pal-falling-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -100,7 +96,7 @@ ;; definition for method 11 of type pal-falling-plat ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-falling-plat ((this pal-falling-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-falling-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -177,14 +173,10 @@ This commonly includes things such as: ;; definition of type pal-ent-door (deftype pal-ent-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type pal-ent-door -(defmethod inspect pal-ent-door ((this pal-ent-door)) +(defmethod inspect ((this pal-ent-door)) (when (not this) (set! this this) (goto cfg-4) @@ -198,7 +190,7 @@ This commonly includes things such as: ;; definition for method 11 of type pal-ent-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-ent-door ((this pal-ent-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-ent-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -240,22 +232,20 @@ This commonly includes things such as: ;; definition of type pal-grind-ring-center (deftype pal-grind-ring-center (process-focusable) - ((speed-y float :offset-assert 204) - (hit-sound-played? basic :offset-assert 208) + ((speed-y float) + (hit-sound-played? basic) ) - :heap-base #x60 - :method-count-assert 30 - :size-assert #xd4 - :flag-assert #x1e006000d4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (pal-grind-ring-center-method-29 (_type_) none 29) + (pal-grind-ring-center-method-29 (_type_) none) ) ) ;; definition for method 3 of type pal-grind-ring-center -(defmethod inspect pal-grind-ring-center ((this pal-grind-ring-center)) +(defmethod inspect ((this pal-grind-ring-center)) (when (not this) (set! this this) (goto cfg-4) @@ -371,7 +361,7 @@ This commonly includes things such as: ;; definition for method 29 of type pal-grind-ring-center ;; WARN: Return type mismatch int vs none. -(defmethod pal-grind-ring-center-method-29 pal-grind-ring-center ((this pal-grind-ring-center)) +(defmethod pal-grind-ring-center-method-29 ((this pal-grind-ring-center)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -400,7 +390,7 @@ This commonly includes things such as: ;; definition for method 11 of type pal-grind-ring-center ;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-grind-ring-center ((this pal-grind-ring-center) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-grind-ring-center) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -426,7 +416,7 @@ This commonly includes things such as: ;; definition for method 11 of type pal-grind-ring-center ;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-grind-ring-center ((this pal-grind-ring-center) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-grind-ring-center) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -457,22 +447,20 @@ This commonly includes things such as: ;; definition of type pal-grind-ring (deftype pal-grind-ring (process-focusable) - ((speed-y float :offset-assert 204) - (hit-sound-played? basic :offset-assert 208) + ((speed-y float) + (hit-sound-played? basic) ) - :heap-base #x60 - :method-count-assert 30 - :size-assert #xd4 - :flag-assert #x1e006000d4 + (:state-methods + idle + fall + ) (:methods - (idle () _type_ :state 27) - (fall () _type_ :state 28) - (pal-grind-ring-method-29 (_type_) none 29) + (pal-grind-ring-method-29 (_type_) none) ) ) ;; definition for method 3 of type pal-grind-ring -(defmethod inspect pal-grind-ring ((this pal-grind-ring)) +(defmethod inspect ((this pal-grind-ring)) (when (not this) (set! this this) (goto cfg-4) @@ -591,7 +579,7 @@ This commonly includes things such as: ;; definition for method 29 of type pal-grind-ring ;; WARN: Return type mismatch int vs none. -(defmethod pal-grind-ring-method-29 pal-grind-ring ((this pal-grind-ring)) +(defmethod pal-grind-ring-method-29 ((this pal-grind-ring)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -620,7 +608,7 @@ This commonly includes things such as: ;; definition for method 11 of type pal-grind-ring ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-grind-ring ((this pal-grind-ring) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-grind-ring) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -686,20 +674,18 @@ This commonly includes things such as: ;; definition of type pal-ent-glass (deftype pal-ent-glass (process-focusable) () - :heap-base #x50 - :method-count-assert 31 - :size-assert #xcc - :flag-assert #x1f005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (pal-ent-glass-method-29 (_type_) none 29) - (pal-ent-glass-method-30 (_type_) none 30) + (pal-ent-glass-method-29 (_type_) none) + (pal-ent-glass-method-30 (_type_) none) ) ) ;; definition for method 3 of type pal-ent-glass -(defmethod inspect pal-ent-glass ((this pal-ent-glass)) +(defmethod inspect ((this pal-ent-glass)) (when (not this) (set! this this) (goto cfg-4) @@ -771,7 +757,7 @@ This commonly includes things such as: ;; definition for method 29 of type pal-ent-glass ;; WARN: Return type mismatch int vs none. -(defmethod pal-ent-glass-method-29 pal-ent-glass ((this pal-ent-glass)) +(defmethod pal-ent-glass-method-29 ((this pal-ent-glass)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -800,7 +786,7 @@ This commonly includes things such as: ;; definition for method 30 of type pal-ent-glass ;; WARN: Return type mismatch int vs none. -(defmethod pal-ent-glass-method-30 pal-ent-glass ((this pal-ent-glass)) +(defmethod pal-ent-glass-method-30 ((this pal-ent-glass)) (logior! (-> this mask) (process-mask crate)) 0 (none) @@ -808,7 +794,7 @@ This commonly includes things such as: ;; definition for method 11 of type pal-ent-glass ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-ent-glass ((this pal-ent-glass) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-ent-glass) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -831,14 +817,10 @@ This commonly includes things such as: ;; definition of type palent-turret-shot (deftype palent-turret-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type palent-turret-shot -(defmethod inspect palent-turret-shot ((this palent-turret-shot)) +(defmethod inspect ((this palent-turret-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -852,7 +834,7 @@ This commonly includes things such as: ;; definition for method 28 of type palent-turret-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound palent-turret-shot ((this palent-turret-shot) (arg0 projectile-options)) +(defmethod play-impact-sound ((this palent-turret-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -875,20 +857,18 @@ This commonly includes things such as: ;; definition of type palent-turret (deftype palent-turret (process-focusable) - ((next-shoot uint64 :offset-assert 208) + ((next-shoot uint64) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd8 - :flag-assert #x1d006000d8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (palent-turret-method-28 (_type_) none 28) + (palent-turret-method-28 (_type_) none) ) ) ;; definition for method 3 of type palent-turret -(defmethod inspect palent-turret ((this palent-turret)) +(defmethod inspect ((this palent-turret)) (when (not this) (set! this this) (goto cfg-4) @@ -973,7 +953,7 @@ This commonly includes things such as: ;; definition for method 28 of type palent-turret ;; WARN: Return type mismatch int vs none. -(defmethod palent-turret-method-28 palent-turret ((this palent-turret)) +(defmethod palent-turret-method-28 ((this palent-turret)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1022,7 +1002,7 @@ This commonly includes things such as: ;; definition for method 11 of type palent-turret ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! palent-turret ((this palent-turret) (arg0 entity-actor)) +(defmethod init-from-entity! ((this palent-turret) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1100,20 +1080,18 @@ This commonly includes things such as: ;; definition of type pal-breakable-window (deftype pal-breakable-window (process-focusable) () - :heap-base #x50 - :method-count-assert 31 - :size-assert #xcc - :flag-assert #x1f005000cc + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 27) - (die () _type_ :state 28) - (pal-breakable-window-method-29 (_type_) none 29) - (pal-breakable-window-method-30 (_type_) none 30) + (pal-breakable-window-method-29 (_type_) none) + (pal-breakable-window-method-30 (_type_) none) ) ) ;; definition for method 3 of type pal-breakable-window -(defmethod inspect pal-breakable-window ((this pal-breakable-window)) +(defmethod inspect ((this pal-breakable-window)) (when (not this) (set! this this) (goto cfg-4) @@ -1183,7 +1161,7 @@ This commonly includes things such as: ;; definition for method 29 of type pal-breakable-window ;; WARN: Return type mismatch int vs none. -(defmethod pal-breakable-window-method-29 pal-breakable-window ((this pal-breakable-window)) +(defmethod pal-breakable-window-method-29 ((this pal-breakable-window)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1212,7 +1190,7 @@ This commonly includes things such as: ;; definition for method 30 of type pal-breakable-window ;; WARN: Return type mismatch int vs none. -(defmethod pal-breakable-window-method-30 pal-breakable-window ((this pal-breakable-window)) +(defmethod pal-breakable-window-method-30 ((this pal-breakable-window)) (logior! (-> this mask) (process-mask crate)) 0 (none) @@ -1220,7 +1198,7 @@ This commonly includes things such as: ;; definition for method 11 of type pal-breakable-window ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-breakable-window ((this pal-breakable-window) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-breakable-window) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/palace/palent-part_REF.gc b/test/decompiler/reference/jak2/levels/palace/palent-part_REF.gc index 844575a501f..59a2db93b12 100644 --- a/test/decompiler/reference/jak2/levels/palace/palent-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/palent-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type palent-part (deftype palent-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type palent-part -(defmethod inspect palent-part ((this palent-part)) +(defmethod inspect ((this palent-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc b/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc index 628a2b8dad9..e5e7c64d920 100644 --- a/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc @@ -4,14 +4,10 @@ ;; definition of type pal-lowrez-throne (deftype pal-lowrez-throne (med-res-level) () - :heap-base #x60 - :method-count-assert 21 - :size-assert #xd4 - :flag-assert #x15006000d4 ) ;; definition for method 3 of type pal-lowrez-throne -(defmethod inspect pal-lowrez-throne ((this pal-lowrez-throne)) +(defmethod inspect ((this pal-lowrez-throne)) (when (not this) (set! this this) (goto cfg-4) @@ -91,21 +87,17 @@ ;; definition of type pal-prong (deftype pal-prong (process-drawable) - ((root collide-shape :override) + ((root collide-shape :override) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc8 - :flag-assert #x17005000c8 - (:methods - (idle () _type_ :state 20) - (break-it () _type_ :state 21) - (broken () _type_ :state 22) + (:state-methods + idle + break-it + broken ) ) ;; definition for method 3 of type pal-prong -(defmethod inspect pal-prong ((this pal-prong)) +(defmethod inspect ((this pal-prong)) (when (not this) (set! this this) (goto cfg-4) @@ -150,7 +142,7 @@ ;; definition for method 11 of type pal-prong ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-prong ((this pal-prong) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pal-prong) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/palace/roof/palroof-part_REF.gc b/test/decompiler/reference/jak2/levels/palace/roof/palroof-part_REF.gc index 71ac76e8ebc..9e6f5942448 100644 --- a/test/decompiler/reference/jak2/levels/palace/roof/palroof-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/roof/palroof-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type palroof-part (deftype palroof-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type palroof-part -(defmethod inspect palroof-part ((this palroof-part)) +(defmethod inspect ((this palroof-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/palace/shaft/palshaft-part_REF.gc b/test/decompiler/reference/jak2/levels/palace/shaft/palshaft-part_REF.gc index c470e897711..3291ddb8231 100644 --- a/test/decompiler/reference/jak2/levels/palace/shaft/palshaft-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/shaft/palshaft-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type palshaft-part (deftype palshaft-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type palshaft-part -(defmethod inspect palshaft-part ((this palshaft-part)) +(defmethod inspect ((this palshaft-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/palace/throne/palace-scenes_REF.gc b/test/decompiler/reference/jak2/levels/palace/throne/palace-scenes_REF.gc index f3c992c5d88..47fc40da575 100644 --- a/test/decompiler/reference/jak2/levels/palace/throne/palace-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/throne/palace-scenes_REF.gc @@ -4,17 +4,13 @@ ;; definition of type throne-throne (deftype throne-throne (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type throne-throne -(defmethod inspect throne-throne ((this throne-throne)) +(defmethod inspect ((this throne-throne)) (when (not this) (set! this this) (goto cfg-4) @@ -50,7 +46,7 @@ ;; definition for method 11 of type throne-throne ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! throne-throne ((this throne-throne) (entity entity-actor)) +(defmethod init-from-entity! ((this throne-throne) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/palace/throne/throne-part_REF.gc b/test/decompiler/reference/jak2/levels/palace/throne/throne-part_REF.gc index d143366fe16..28a82a66303 100644 --- a/test/decompiler/reference/jak2/levels/palace/throne/throne-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/throne/throne-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type throne-part (deftype throne-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type throne-part -(defmethod inspect throne-part ((this throne-part)) +(defmethod inspect ((this throne-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc b/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc index a620587b6d4..8c983241702 100644 --- a/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc @@ -57,21 +57,18 @@ ;; definition of type rbw-side (deftype rbw-side (basic) - ((break-anim string :offset-assert 4) - (end-anim string :offset-assert 8) - (break-prim-mask uint8 :offset-assert 12) - (break-root-prim-joint int16 :offset-assert 14) - (break-bounds-joint int16 :offset-assert 16) - (break-root-prim-sphere sphere :inline :offset-assert 32) - (break-bounds-sphere sphere :inline :offset-assert 48) + ((break-anim string) + (end-anim string) + (break-prim-mask uint8) + (break-root-prim-joint int16) + (break-bounds-joint int16) + (break-root-prim-sphere sphere :inline) + (break-bounds-sphere sphere :inline) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type rbw-side -(defmethod inspect rbw-side ((this rbw-side)) +(defmethod inspect ((this rbw-side)) (when (not this) (set! this this) (goto cfg-4) @@ -90,17 +87,14 @@ ;; definition of type rbw-info (deftype rbw-info (basic) - ((skel-group string :offset-assert 4) - (anim spool-anim :offset-assert 8) - (sides (array rbw-side) :offset-assert 12) + ((skel-group string) + (anim spool-anim) + (sides (array rbw-side)) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type rbw-info -(defmethod inspect rbw-info ((this rbw-info)) +(defmethod inspect ((this rbw-info)) (when (not this) (set! this this) (goto cfg-4) @@ -237,24 +231,22 @@ ;; definition of type ruins-breakable-wall (deftype ruins-breakable-wall (process-focusable) - ((info rbw-info :offset-assert 204) - (side rbw-side :offset-assert 208) - (nav-mesh nav-mesh :offset-assert 212) + ((info rbw-info) + (side rbw-side) + (nav-mesh nav-mesh) ) - :heap-base #x60 - :method-count-assert 31 - :size-assert #xd8 - :flag-assert #x1f006000d8 + (:state-methods + unbroken + hit + broken + ) (:methods - (unbroken () _type_ :state 27) - (hit () _type_ :state 28) - (broken () _type_ :state 29) - (ruins-breakable-wall-method-30 (_type_ symbol) none 30) + (ruins-breakable-wall-method-30 (_type_ symbol) none) ) ) ;; definition for method 3 of type ruins-breakable-wall -(defmethod inspect ruins-breakable-wall ((this ruins-breakable-wall)) +(defmethod inspect ((this ruins-breakable-wall)) (when (not this) (set! this this) (goto cfg-4) @@ -272,7 +264,7 @@ ;; definition for method 30 of type ruins-breakable-wall ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod ruins-breakable-wall-method-30 ruins-breakable-wall ((this ruins-breakable-wall) (arg0 symbol)) +(defmethod ruins-breakable-wall-method-30 ((this ruins-breakable-wall) (arg0 symbol)) (case arg0 (('hit) (-> this draw bounds w) @@ -470,7 +462,7 @@ ;; definition for method 11 of type ruins-breakable-wall ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-breakable-wall ((this ruins-breakable-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ruins-breakable-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc b/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc index 2d85fd12d3e..bb7348026b6 100644 --- a/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc @@ -3,30 +3,26 @@ ;; definition of type mechblock (deftype mechblock (process-drawable) - ((root collide-shape-moving :override) - (origin vector :inline :offset-assert 208) - (drop-point vector :inline :offset 256) - (allow-drag? symbol :offset-assert 272) - (reset-on-land? symbol :offset-assert 276) - (hit-something? symbol :offset-assert 280) - (attack-id uint32 :offset-assert 284) - (next-entity entity :offset-assert 288) + ((root collide-shape-moving :override) + (origin vector :inline) + (drop-point vector :inline :offset 256) + (allow-drag? symbol) + (reset-on-land? symbol) + (hit-something? symbol) + (attack-id uint32) + (next-entity entity) ) - :heap-base #xb0 - :method-count-assert 25 - :size-assert #x124 - :flag-assert #x1900b00124 - (:methods - (idle () _type_ :state 20) - (carry () _type_ :state 21) - (drag () _type_ :state 22) - (fall () _type_ :state 23) - (wait () _type_ :state 24) + (:state-methods + idle + carry + drag + fall + wait ) ) ;; definition for method 3 of type mechblock -(defmethod inspect mechblock ((this mechblock)) +(defmethod inspect ((this mechblock)) (when (not this) (set! this this) (goto cfg-4) @@ -447,14 +443,10 @@ ;; definition of type throwblock (deftype throwblock (mechblock) () - :heap-base #xb0 - :method-count-assert 25 - :size-assert #x124 - :flag-assert #x1900b00124 ) ;; definition for method 3 of type throwblock -(defmethod inspect throwblock ((this throwblock)) +(defmethod inspect ((this throwblock)) (when (not this) (set! this this) (goto cfg-4) @@ -474,7 +466,7 @@ ;; definition for method 11 of type throwblock ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! throwblock ((this throwblock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this throwblock) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -541,14 +533,10 @@ This commonly includes things such as: ;; definition of type pushblock (deftype pushblock (mechblock) () - :heap-base #xb0 - :method-count-assert 25 - :size-assert #x124 - :flag-assert #x1900b00124 ) ;; definition for method 3 of type pushblock -(defmethod inspect pushblock ((this pushblock)) +(defmethod inspect ((this pushblock)) (when (not this) (set! this this) (goto cfg-4) @@ -568,7 +556,7 @@ This commonly includes things such as: ;; definition for method 11 of type pushblock ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pushblock ((this pushblock) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pushblock) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc b/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc index 226bab0fa21..8918980d61b 100644 --- a/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc @@ -3,30 +3,26 @@ ;; definition of type ruins-pillar-collapse (deftype ruins-pillar-collapse (process-drawable) - ((root collide-shape-moving :override) - (player-attack-id int32 :offset-assert 200) - (fall-anim-index int32 :offset-assert 204) - (hit-points int8 :offset-assert 208) - (mesh-trans uint8 3 :offset-assert 209) - (mesh-joint joint 2 :offset-assert 212) - (deadly? symbol :offset 216) - (art-name string :offset 220) - (anim spool-anim :offset 224) + ((root collide-shape-moving :override) + (player-attack-id int32) + (fall-anim-index int32) + (hit-points int8) + (mesh-trans uint8 3) + (mesh-joint joint 2) + (deadly? symbol :overlay-at (-> mesh-joint 1)) + (art-name string :offset 220) + (anim spool-anim :offset 224) ) - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe4 - :flag-assert #x18007000e4 - (:methods - (idle () _type_ :state 20) - (bump () _type_ :state 21) - (hit () _type_ :state 22) - (fall (symbol) _type_ :state 23) + (:state-methods + idle + bump + hit + (fall symbol) ) ) ;; definition for method 3 of type ruins-pillar-collapse -(defmethod inspect ruins-pillar-collapse ((this ruins-pillar-collapse)) +(defmethod inspect ((this ruins-pillar-collapse)) (when (not this) (set! this this) (goto cfg-4) @@ -224,7 +220,7 @@ ;; definition for method 11 of type ruins-pillar-collapse ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-pillar-collapse ((this ruins-pillar-collapse) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ruins-pillar-collapse) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc index b05f1e2073e..30456c557fd 100644 --- a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc @@ -3,45 +3,43 @@ ;; definition of type rapid-gunner (deftype rapid-gunner (nav-enemy) - ((los los-control :inline :offset-assert 608) - (joint joint-mod :offset-assert 756) - (joint-blend float :offset-assert 760) - (joint-enable symbol :offset-assert 764) - (shot-timer uint64 :offset-assert 768) - (predict-timer uint64 :offset-assert 776) - (target-prev-pos vector :inline :offset-assert 784) - (target-next-pos vector :inline :offset-assert 800) - (focus-dir vector :inline :offset-assert 816) - (y-diff float :offset-assert 832) - (shots-fired uint32 :offset-assert 836) - (spin-up-angle float :offset-assert 840) - (spin-up-timer time-frame :offset-assert 848) - (shoot-anim-index int32 :offset-assert 856) - (status-flags rapid-gunner-flags :offset-assert 864) - (start-pos vector :inline :offset-assert 880) - (dest-pos vector :inline :offset-assert 896) - (hop-dir vector :inline :offset-assert 912) - (roam-radius float :offset-assert 928) + ((los los-control :inline) + (joint joint-mod) + (joint-blend float) + (joint-enable symbol) + (shot-timer uint64) + (predict-timer uint64) + (target-prev-pos vector :inline) + (target-next-pos vector :inline) + (focus-dir vector :inline) + (y-diff float) + (shots-fired uint32) + (spin-up-angle float) + (spin-up-timer time-frame) + (shoot-anim-index int32) + (status-flags rapid-gunner-flags) + (start-pos vector :inline) + (dest-pos vector :inline) + (hop-dir vector :inline) + (roam-radius float) ) - :heap-base #x330 - :method-count-assert 187 - :size-assert #x3a4 - :flag-assert #xbb033003a4 + (:state-methods + attack + spin-attack + hop + hop-turn + cool-down + reload + ) (:methods - (attack () _type_ :state 178) - (spin-attack () _type_ :state 179) - (hop () _type_ :state 180) - (hop-turn () _type_ :state 181) - (cool-down () _type_ :state 182) - (reload () _type_ :state 183) - (rapid-gunner-method-184 (_type_ float) symbol 184) - (rapid-gunner-method-185 (_type_ vector float) none 185) - (rapid-gunner-method-186 (_type_ int float int int) none 186) + (rapid-gunner-method-184 (_type_ float) symbol) + (rapid-gunner-method-185 (_type_ vector float) none) + (rapid-gunner-method-186 (_type_ int float int int) none) ) ) ;; definition for method 3 of type rapid-gunner -(defmethod inspect rapid-gunner ((this rapid-gunner)) +(defmethod inspect ((this rapid-gunner)) (when (not this) (set! this this) (goto cfg-4) @@ -260,7 +258,7 @@ (set! (-> *rapid-gunner-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type rapid-gunner -(defmethod general-event-handler rapid-gunner ((this rapid-gunner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this rapid-gunner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -295,7 +293,7 @@ ;; WARN: Return type mismatch object vs symbol. ;; WARN: Using new Jak 2 rtype-of ;; WARN: Using new Jak 2 rtype-of -(defmethod enemy-method-77 rapid-gunner ((this rapid-gunner) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this rapid-gunner) (arg0 (pointer float))) (let ((v1-0 (-> this incoming knocked-type))) (the-as symbol @@ -417,7 +415,7 @@ ;; definition for method 52 of type rapid-gunner ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 rapid-gunner ((this rapid-gunner) (arg0 vector)) +(defmethod enemy-method-52 ((this rapid-gunner) (arg0 vector)) (cond ((> (-> this hit-points) 0) (-> this enemy-info) @@ -438,7 +436,7 @@ ) ;; definition for method 78 of type rapid-gunner -(defmethod enemy-method-78 rapid-gunner ((this rapid-gunner) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this rapid-gunner) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -489,7 +487,7 @@ ) ;; definition for method 98 of type rapid-gunner -(defmethod in-aggro-range? rapid-gunner ((this rapid-gunner) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this rapid-gunner) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -508,7 +506,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 185 rapid-gunner) has a return type of none, but the expression builder found a return statement. -(defmethod rapid-gunner-method-185 rapid-gunner ((this rapid-gunner) (arg0 vector) (arg1 float)) +(defmethod rapid-gunner-method-185 ((this rapid-gunner) (arg0 vector) (arg1 float)) (if (not (-> this joint-enable)) (return #f) ) @@ -601,7 +599,7 @@ ;; definition for method 55 of type rapid-gunner ;; WARN: Return type mismatch int vs none. -(defmethod track-target! rapid-gunner ((this rapid-gunner)) +(defmethod track-target! ((this rapid-gunner)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -615,12 +613,12 @@ ) ;; definition for method 96 of type rapid-gunner -(defmethod enemy-method-96 rapid-gunner ((this rapid-gunner) (arg0 float) (arg1 symbol)) +(defmethod enemy-method-96 ((this rapid-gunner) (arg0 float) (arg1 symbol)) (enemy-method-95 this (-> this target-next-pos) arg0) ) ;; definition for method 184 of type rapid-gunner -(defmethod rapid-gunner-method-184 rapid-gunner ((this rapid-gunner) (arg0 float)) +(defmethod rapid-gunner-method-184 ((this rapid-gunner) (arg0 float)) (let* ((s4-0 (-> this node-list data 18)) (v1-1 (vector<-cspace! (new 'stack-no-clear 'vector) s4-0)) (s5-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this target-next-pos) v1-1) 1.0)) @@ -635,7 +633,7 @@ ) ;; definition for method 67 of type rapid-gunner -(defmethod go-stare rapid-gunner ((this rapid-gunner)) +(defmethod go-stare ((this rapid-gunner)) (go (method-of-object this hostile)) ) @@ -876,7 +874,7 @@ ;; definition for method 186 of type rapid-gunner ;; WARN: Return type mismatch art-element vs none. -(defmethod rapid-gunner-method-186 rapid-gunner ((this rapid-gunner) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod rapid-gunner-method-186 ((this rapid-gunner) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) @@ -1368,14 +1366,14 @@ ;; definition for method 142 of type rapid-gunner ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 rapid-gunner ((this rapid-gunner) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this rapid-gunner) (arg0 nav-control)) 0 (none) ) ;; definition for method 63 of type rapid-gunner ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 rapid-gunner ((this rapid-gunner) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 ((this rapid-gunner) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) (the-as symbol (if (t9-0 this arg0 arg1) (set-dst-proc! (-> this los) (-> this focus handle)) @@ -1386,7 +1384,7 @@ ;; definition for method 114 of type rapid-gunner ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! rapid-gunner ((this rapid-gunner)) +(defmethod init-enemy-collision! ((this rapid-gunner)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1466,7 +1464,7 @@ ) ;; definition for method 7 of type rapid-gunner -(defmethod relocate rapid-gunner ((this rapid-gunner) (arg0 int)) +(defmethod relocate ((this rapid-gunner) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -1476,7 +1474,7 @@ ;; definition for method 115 of type rapid-gunner ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! rapid-gunner ((this rapid-gunner)) +(defmethod init-enemy! ((this rapid-gunner)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-48 int)) (rlet ((acc :class vf) @@ -1564,14 +1562,10 @@ ;; definition of type shield-gunner (deftype shield-gunner (rapid-gunner) () - :heap-base #x330 - :method-count-assert 187 - :size-assert #x3a4 - :flag-assert #xbb033003a4 ) ;; definition for method 3 of type shield-gunner -(defmethod inspect shield-gunner ((this shield-gunner)) +(defmethod inspect ((this shield-gunner)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc index cb7cd79eb60..113012932bd 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc @@ -3,16 +3,12 @@ ;; definition of type sinking-plat (deftype sinking-plat (rigid-body-platform) - ((anchor-point vector :inline :offset-assert 384) + ((anchor-point vector :inline) ) - :heap-base #x110 - :method-count-assert 57 - :size-assert #x190 - :flag-assert #x3901100190 ) ;; definition for method 3 of type sinking-plat -(defmethod inspect sinking-plat ((this sinking-plat)) +(defmethod inspect ((this sinking-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -33,7 +29,7 @@ ;; definition for method 29 of type sinking-plat ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 sinking-plat ((this sinking-plat) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this sinking-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this anchor-point)) 0 @@ -42,7 +38,7 @@ ;; definition for method 32 of type sinking-plat ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape sinking-plat ((this sinking-plat)) +(defmethod allocate-and-init-cshape ((this sinking-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -107,7 +103,7 @@ ;; definition for method 33 of type sinking-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body sinking-plat ((this sinking-plat)) +(defmethod init-skel-and-rigid-body ((this sinking-plat)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-sinking-plat" (the-as (pointer uint32) #f))) @@ -156,18 +152,14 @@ ;; definition of type beam (deftype beam (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (collapse () _type_ :state 21) + (:state-methods + idle + collapse ) ) ;; definition for method 3 of type beam -(defmethod inspect beam ((this beam)) +(defmethod inspect ((this beam)) (when (not this) (set! this this) (goto cfg-4) @@ -219,7 +211,7 @@ ;; definition for method 11 of type beam ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! beam ((this beam) (arg0 entity-actor)) +(defmethod init-from-entity! ((this beam) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -250,14 +242,10 @@ This commonly includes things such as: ;; definition of type ruins-bridge (deftype ruins-bridge (drop-plat) () - :heap-base #xc0 - :method-count-assert 36 - :size-assert #x140 - :flag-assert #x2400c00140 ) ;; definition for method 3 of type ruins-bridge -(defmethod inspect ruins-bridge ((this ruins-bridge)) +(defmethod inspect ((this ruins-bridge)) (when (not this) (set! this this) (goto cfg-4) @@ -277,7 +265,7 @@ This commonly includes things such as: ;; definition for method 29 of type ruins-bridge ;; WARN: Return type mismatch int vs none. -(defmethod start-bouncing! ruins-bridge ((this ruins-bridge)) +(defmethod start-bouncing! ((this ruins-bridge)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" @@ -296,7 +284,7 @@ and translate the platform via the `smush` ;; definition for method 11 of type ruins-bridge ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-bridge ((this ruins-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ruins-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -375,14 +363,10 @@ This commonly includes things such as: ;; definition of type ruins-drop-plat (deftype ruins-drop-plat (drop-plat) () - :heap-base #xc0 - :method-count-assert 36 - :size-assert #x140 - :flag-assert #x2400c00140 ) ;; definition for method 3 of type ruins-drop-plat -(defmethod inspect ruins-drop-plat ((this ruins-drop-plat)) +(defmethod inspect ((this ruins-drop-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -452,7 +436,7 @@ This commonly includes things such as: ;; definition for method 29 of type ruins-drop-plat ;; WARN: Return type mismatch int vs none. -(defmethod start-bouncing! ruins-drop-plat ((this ruins-drop-plat)) +(defmethod start-bouncing! ((this ruins-drop-plat)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" @@ -508,7 +492,7 @@ and translate the platform via the `smush` ;; definition for method 11 of type ruins-drop-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-drop-plat ((this ruins-drop-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ruins-drop-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-part_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-part_REF.gc index 08a614e29d2..506b1933e29 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type ruins-part (deftype ruins-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type ruins-part -(defmethod inspect ruins-part ((this ruins-part)) +(defmethod inspect ((this ruins-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc index 170dd6161a8..a1014479263 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc @@ -1330,17 +1330,13 @@ TODO - first arg type?" "The flag in the ruins mission. The scale will be linearly-interpolated based on the distance from the camera" () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type flag -(defmethod inspect flag ((this flag)) +(defmethod inspect ((this flag)) (when (not this) (set! this this) (goto cfg-4) @@ -1376,7 +1372,7 @@ The scale will be linearly-interpolated based on the distance from the camera" ;; definition for method 11 of type flag ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! flag ((this flag) (arg0 entity-actor)) +(defmethod init-from-entity! ((this flag) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1401,19 +1397,15 @@ This commonly includes things such as: (deftype ruins-precipice (process-drawable) "The edge of the ruins tower that the flag stands on Touching it flips the `play?` field which will trigger the cutscene" - ((play? symbol :offset-assert 200) + ((play? symbol) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xcc - :flag-assert #x15005000cc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type ruins-precipice -(defmethod inspect ruins-precipice ((this ruins-precipice)) +(defmethod inspect ((this ruins-precipice)) (when (not this) (set! this this) (goto cfg-4) @@ -1485,7 +1477,7 @@ Touching it flips the `play?` field which will trigger the cutscene" ;; definition for method 11 of type ruins-precipice ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-precipice ((this ruins-precipice) (arg0 entity-actor)) +(defmethod init-from-entity! ((this ruins-precipice) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/grim-h_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/grim-h_REF.gc index 769a59dd790..b637289e5ad 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/grim-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/grim-h_REF.gc @@ -4,14 +4,10 @@ ;; definition of type grim (deftype grim (jinx) () - :heap-base #x380 - :method-count-assert 246 - :size-assert #x400 - :flag-assert #xf603800400 ) ;; definition for method 3 of type grim -(defmethod inspect grim ((this grim)) +(defmethod inspect ((this grim)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/grim_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/grim_REF.gc index d1671075fca..9d877e37ee9 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/grim_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/grim_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 114 of type grim ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! grim ((this grim)) +(defmethod init-enemy-collision! ((this grim)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -77,7 +77,7 @@ ) ;; definition for method 115 of type grim -(defmethod init-enemy! grim ((this grim)) +(defmethod init-enemy! ((this grim)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type jinx init-enemy!))) (t9-0 this) @@ -94,7 +94,7 @@ ;; definition for method 244 of type grim ;; WARN: Return type mismatch int vs none. -(defmethod ruffian-method-244 grim ((this grim)) +(defmethod ruffian-method-244 ((this grim)) (with-pp (ruffian-method-245 this) (let ((f30-0 (-> this nav state speed))) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-bomb_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-bomb_REF.gc index 0c43629e338..4e9ce43a75f 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-bomb_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-bomb_REF.gc @@ -3,23 +3,19 @@ ;; definition of type jinx-bomb (deftype jinx-bomb (process-focusable) - ((fuse-delay uint32 :offset-assert 204) - (attack-id uint32 :offset-assert 208) - (shake-screen? symbol :offset-assert 212) - (explode-func (function jinx-bomb none) :offset-assert 216) + ((fuse-delay uint32) + (attack-id uint32) + (shake-screen? symbol) + (explode-func (function jinx-bomb none)) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xdc - :flag-assert #x1d006000dc - (:methods - (idle () _type_ :state 27) - (explode () _type_ :state 28) + (:state-methods + idle + explode ) ) ;; definition for method 3 of type jinx-bomb -(defmethod inspect jinx-bomb ((this jinx-bomb)) +(defmethod inspect ((this jinx-bomb)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-h_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-h_REF.gc index ec3a953e0b4..3b21ed64e3d 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-h_REF.gc @@ -3,18 +3,14 @@ ;; definition of type jinx (deftype jinx (ruffian) - ((bomb-handle handle :offset-assert 1008) - (bomb-func function :offset-assert 1016) - (bomb-fuse-delay uint32 :offset-assert 1020) + ((bomb-handle handle) + (bomb-func function) + (bomb-fuse-delay uint32) ) - :heap-base #x380 - :method-count-assert 246 - :size-assert #x400 - :flag-assert #xf603800400 ) ;; definition for method 3 of type jinx -(defmethod inspect jinx ((this jinx)) +(defmethod inspect ((this jinx)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/jinx_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/jinx_REF.gc index 8c4b5c2260c..28dc2dc9706 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/jinx_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/jinx_REF.gc @@ -3,16 +3,13 @@ ;; definition of type jinx-anim-info (deftype jinx-anim-info (structure) - ((anim-index int32 :offset-assert 0) + ((anim-index int32) ) :pack-me - :method-count-assert 9 - :size-assert #x4 - :flag-assert #x900000004 ) ;; definition for method 3 of type jinx-anim-info -(defmethod inspect jinx-anim-info ((this jinx-anim-info)) +(defmethod inspect ((this jinx-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -25,21 +22,18 @@ ;; definition of type jinx-global-info (deftype jinx-global-info (basic) - ((prev-blue-hit-front int8 :offset-assert 4) - (prev-blue-hit-back int8 :offset-assert 5) - (blue-hit-front-anim int32 3 :offset-assert 8) - (blue-hit-back-anim int32 3 :offset-assert 20) - (kick-anim int32 2 :offset-assert 32) - (scared-idle-anim int32 5 :offset-assert 40) - (bomb-recoil-anim int32 2 :offset-assert 60) + ((prev-blue-hit-front int8) + (prev-blue-hit-back int8) + (blue-hit-front-anim int32 3) + (blue-hit-back-anim int32 3) + (kick-anim int32 2) + (scared-idle-anim int32 5) + (bomb-recoil-anim int32 2) ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 ) ;; definition for method 3 of type jinx-global-info -(defmethod inspect jinx-global-info ((this jinx-global-info)) +(defmethod inspect ((this jinx-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -243,7 +237,7 @@ (set! (-> *jinx-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type jinx -(defmethod general-event-handler jinx ((this jinx) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this jinx) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -272,7 +266,7 @@ ;; definition for method 114 of type jinx ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! jinx ((this jinx)) +(defmethod init-enemy-collision! ((this jinx)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -347,7 +341,7 @@ ;; definition for method 115 of type jinx ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! jinx ((this jinx)) +(defmethod init-enemy! ((this jinx)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init! this) (set! (-> this min-speed) 24576.0) @@ -386,7 +380,7 @@ ;; definition for method 239 of type jinx ;; INFO: Used lq/sq ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod fire-gun jinx ((this jinx) (arg0 vector)) +(defmethod fire-gun ((this jinx) (arg0 vector)) (set! (-> this next-fire-time) (+ (current-time) (get-rand-int-range this 150 600))) (+! (-> this fired-gun-count) 1) (let ((s4-1 (new 'stack-no-clear 'projectile-init-by-other-params))) @@ -414,7 +408,7 @@ ;; definition for method 244 of type jinx ;; WARN: Return type mismatch int vs none. -(defmethod ruffian-method-244 jinx ((this jinx)) +(defmethod ruffian-method-244 ((this jinx)) (with-pp (ruffian-method-245 this) (let ((f30-0 (-> this nav state speed))) @@ -473,7 +467,7 @@ ) ;; definition for method 77 of type jinx -(defmethod enemy-method-77 jinx ((this jinx) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this jinx) (arg0 (pointer float))) (let ((v1-0 (-> this incoming knocked-type))) (cond ((= v1-0 (knocked-type knocked-type-6)) @@ -590,7 +584,7 @@ ) ;; definition for method 78 of type jinx -(defmethod enemy-method-78 jinx ((this jinx) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this jinx) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -682,7 +676,7 @@ ) ;; definition for method 79 of type jinx -(defmethod enemy-method-79 jinx ((this jinx) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this jinx) (arg0 int) (arg1 enemy-knocked-info)) (let ((f30-0 -1.0)) (when (and (= arg0 3) (logtest? (-> this bot-flags) (bot-flags attacked))) (let ((v1-7 (if (> (-> this skel active-channels) 0) @@ -741,7 +735,7 @@ ) ;; definition for method 84 of type jinx -(defmethod enemy-method-84 jinx ((this jinx) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 ((this jinx) (arg0 enemy-jump-info)) (let ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos)))) (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0)) ) @@ -753,7 +747,7 @@ ;; definition for method 216 of type jinx ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-216 jinx ((this jinx)) +(defmethod bot-method-216 ((this jinx)) (set! (-> this health-handle) (ppointer->handle (process-spawn hud-ruffians :init hud-init-by-other :to this)) ) @@ -763,7 +757,7 @@ ;; definition for method 15 of type hud-ruffians ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-ruffians ((this hud-ruffians)) +(defmethod draw ((this hud-ruffians)) (set-hud-piece-position! (-> this sprites 2) (the int (+ 20.0 (* -130.0 (-> this offset)))) @@ -798,7 +792,7 @@ ;; definition for method 16 of type hud-ruffians ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-ruffians ((this hud-ruffians)) +(defmethod update-values ((this hud-ruffians)) (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) (set! (-> this values 1 target) (the int (* 100.0 (-> *game-info* bot-health 1)))) (set! (-> this values 2 target) (the int (* 100.0 (-> *game-info* bot-health 2)))) @@ -809,7 +803,7 @@ ;; definition for method 17 of type hud-ruffians ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-ruffians ((this hud-ruffians)) +(defmethod init-callback ((this hud-ruffians)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/mog-h_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/mog-h_REF.gc index 5647aedcacf..ea1c09e7904 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/mog-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/mog-h_REF.gc @@ -4,14 +4,10 @@ ;; definition of type mog (deftype mog (jinx) () - :heap-base #x380 - :method-count-assert 246 - :size-assert #x400 - :flag-assert #xf603800400 ) ;; definition for method 3 of type mog -(defmethod inspect mog ((this mog)) +(defmethod inspect ((this mog)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/mog_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/mog_REF.gc index 81c1c013044..aa2b7d0c032 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/mog_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/mog_REF.gc @@ -196,7 +196,7 @@ ;; definition for method 114 of type mog ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! mog ((this mog)) +(defmethod init-enemy-collision! ((this mog)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -270,7 +270,7 @@ ) ;; definition for method 115 of type mog -(defmethod init-enemy! mog ((this mog)) +(defmethod init-enemy! ((this mog)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type jinx init-enemy!))) (t9-0 this) @@ -290,7 +290,7 @@ ;; definition for method 244 of type mog ;; WARN: Return type mismatch int vs none. -(defmethod ruffian-method-244 mog ((this mog)) +(defmethod ruffian-method-244 ((this mog)) (with-pp (ruffian-method-245 this) (let ((f30-0 (-> this nav state speed))) diff --git a/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc b/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc index 20657e57f10..b54d327b1ae 100644 --- a/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc @@ -10,26 +10,24 @@ ;; definition of type gator (deftype gator (nav-enemy) "Cannot take damage due to it overriding [[enemy::56]]" - ((ocean-y float :offset-assert 604) - (lock-nav-target symbol :offset-assert 608) - (new-facing vector :inline :offset-assert 624) - (old-facing vector :inline :offset-assert 640) - (turn-time time-frame :offset-assert 656) + ((ocean-y float) + (lock-nav-target symbol) + (new-facing vector :inline) + (old-facing vector :inline) + (turn-time time-frame) ) - :heap-base #x220 - :method-count-assert 182 - :size-assert #x298 - :flag-assert #xb602200298 + (:state-methods + attack-forward + ) (:methods - (attack-forward () _type_ :state 178) - (adjust-depth! (_type_) float 179) - (update-facing! (_type_ vector) vector 180) - (encircle-target! (_type_ float float symbol) time-frame 181) + (adjust-depth! (_type_) float) + (update-facing! (_type_ vector) vector) + (encircle-target! (_type_ float float symbol) time-frame) ) ) ;; definition for method 3 of type gator -(defmethod inspect gator ((this gator)) +(defmethod inspect ((this gator)) (when (not this) (set! this this) (goto cfg-4) @@ -160,7 +158,7 @@ (set! (-> *gator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type gator -(defmethod general-event-handler gator ((this gator) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) +(defmethod general-event-handler ((this gator) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case event-type @@ -181,7 +179,7 @@ ) ;; definition for method 179 of type gator -(defmethod adjust-depth! gator ((this gator)) +(defmethod adjust-depth! ((this gator)) "Changes the height based on the ocean depth @see [[get-height]]" (set! (-> this ocean-y) (get-height *ocean* (-> this root trans) #t)) @@ -190,7 +188,7 @@ ;; definition for method 180 of type gator ;; INFO: Used lq/sq -(defmethod update-facing! gator ((this gator) (arg0 vector)) +(defmethod update-facing! ((this gator) (arg0 vector)) "Updates the `new-facing` vector" (let ((matrix (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)))) (set! (-> arg0 quad) (-> matrix vector 2 quad)) @@ -199,7 +197,7 @@ ) ;; definition for method 181 of type gator -(defmethod encircle-target! gator ((this gator) (arg0 float) (arg1 float) (arg2 symbol)) +(defmethod encircle-target! ((this gator) (arg0 float) (arg1 float) (arg2 symbol)) "Core movement for the [[gator]], circles the target, charges at the target, etc @params TODO - not sure, they all dont seem to do very much and this method is a mess" (local-vars (v1-17 object) (a0-5 object)) @@ -298,7 +296,7 @@ ;; definition for method 55 of type gator ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod track-target! gator ((this gator)) +(defmethod track-target! ((this gator)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -313,18 +311,18 @@ ) ;; definition for method 56 of type gator -(defmethod damage-amount-from-attack gator ((this gator) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this gator) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) ;; definition for method 70 of type gator -(defmethod go-hostile gator ((this gator)) +(defmethod go-hostile ((this gator)) (go (method-of-object this hostile)) ) ;; definition for method 107 of type gator -(defmethod get-enemy-target gator ((this gator)) +(defmethod get-enemy-target ((this gator)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" (let ((enemy-target ((method-of-type nav-enemy get-enemy-target) this))) (if (and enemy-target @@ -338,7 +336,7 @@ ;; definition for method 98 of type gator ;; INFO: Used lq/sq -(defmethod in-aggro-range? gator ((this gator) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this gator) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -543,14 +541,14 @@ ) ;; definition for method 60 of type gator -(defmethod coin-flip? gator ((this gator)) +(defmethod coin-flip? ((this gator)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 114 of type gator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! gator ((this gator)) +(defmethod init-enemy-collision! ((this gator)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) @@ -625,7 +623,7 @@ ;; definition for method 115 of type gator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! gator ((this gator)) +(defmethod init-enemy! ((this gator)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/sewer/grim2-course_REF.gc b/test/decompiler/reference/jak2/levels/sewer/grim2-course_REF.gc index 55867cc8121..9af03501116 100644 --- a/test/decompiler/reference/jak2/levels/sewer/grim2-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/grim2-course_REF.gc @@ -4,14 +4,10 @@ ;; definition of type grim-sewer (deftype grim-sewer (grim) () - :heap-base #x380 - :method-count-assert 246 - :size-assert #x400 - :flag-assert #xf603800400 ) ;; definition for method 3 of type grim-sewer -(defmethod inspect grim-sewer ((this grim-sewer)) +(defmethod inspect ((this grim-sewer)) (when (not this) (set! this this) (goto cfg-4) @@ -25,7 +21,7 @@ ;; definition for method 116 of type grim-sewer ;; WARN: Return type mismatch object vs none. -(defmethod go-idle grim-sewer ((this grim-sewer)) +(defmethod go-idle ((this grim-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) (cleanup-for-death this) diff --git a/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc b/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc index 0dfb4ea9175..2f71f8ffd28 100644 --- a/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc @@ -3,17 +3,14 @@ ;; definition of type hal2-course (deftype hal2-course (bot-course) - ((sentries1-reminders (array int16) :offset-assert 48) - (sentries2-reminders (array int16) :offset-assert 52) - (bomb2-reminders bot-speech-list :offset-assert 56) + ((sentries1-reminders (array int16)) + (sentries2-reminders (array int16)) + (bomb2-reminders bot-speech-list) ) - :method-count-assert 9 - :size-assert #x3c - :flag-assert #x90000003c ) ;; definition for method 3 of type hal2-course -(defmethod inspect hal2-course ((this hal2-course)) +(defmethod inspect ((this hal2-course)) (when (not this) (set! this this) (goto cfg-4) @@ -41,26 +38,22 @@ ;; definition of type hal-sewer (deftype hal-sewer (hal) - ((hal2-course hal2-course :offset 652) - (sentries1-reminder-index int8 :offset-assert 1024) - (sentries2-reminder-index int8 :offset-assert 1025) - (test-plane plane :inline :offset 1040) + ((hal2-course hal2-course :overlay-at course) + (sentries1-reminder-index int8) + (sentries2-reminder-index int8) + (test-plane plane :inline :offset 1040) ) - :heap-base #x3a0 - :method-count-assert 232 - :size-assert #x420 - :flag-assert #xe803a00420 (:methods - (hal-sewer-method-227 (_type_) symbol 227) - (hal-sewer-method-228 (_type_) none 228) - (hal-sewer-method-229 (_type_) symbol 229) - (hal-sewer-method-230 (_type_ process-focusable process-focusable) symbol 230) - (hal-sewer-method-231 (_type_ int) symbol 231) + (hal-sewer-method-227 (_type_) symbol) + (hal-sewer-method-228 (_type_) none) + (hal-sewer-method-229 (_type_) symbol) + (hal-sewer-method-230 (_type_ process-focusable process-focusable) symbol) + (hal-sewer-method-231 (_type_ int) symbol) ) ) ;; definition for method 3 of type hal-sewer -(defmethod inspect hal-sewer ((this hal-sewer)) +(defmethod inspect ((this hal-sewer)) (when (not this) (set! this this) (goto cfg-4) @@ -77,7 +70,7 @@ ;; definition for method 116 of type hal-sewer ;; WARN: Return type mismatch object vs none. -(defmethod go-idle hal-sewer ((this hal-sewer)) +(defmethod go-idle ((this hal-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) (cleanup-for-death this) @@ -92,7 +85,7 @@ ;; definition for method 210 of type hal-sewer ;; WARN: Return type mismatch float vs none. -(defmethod init! hal-sewer ((this hal-sewer)) +(defmethod init! ((this hal-sewer)) "Set defaults for various fields." (let ((t9-0 (method-of-type hal init!))) (t9-0 this) @@ -103,7 +96,7 @@ ) ;; definition for method 74 of type hal-sewer -(defmethod general-event-handler hal-sewer ((this hal-sewer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this hal-sewer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -219,7 +212,7 @@ ) ;; definition for method 229 of type hal-sewer -(defmethod hal-sewer-method-229 hal-sewer ((this hal-sewer)) +(defmethod hal-sewer-method-229 ((this hal-sewer)) (let ((a0-1 *target*)) (when a0-1 (let ((v1-1 (get-trans a0-1 0))) @@ -234,7 +227,7 @@ ) ;; definition for method 231 of type hal-sewer -(defmethod hal-sewer-method-231 hal-sewer ((this hal-sewer) (arg0 int)) +(defmethod hal-sewer-method-231 ((this hal-sewer) (arg0 int)) (countdown (v1-0 3) (let* ((a2-4 (-> this actor-group 0 data (+ arg0 v1-0) actor)) (a3-2 (if a2-4 @@ -252,7 +245,7 @@ ;; definition for method 230 of type hal-sewer ;; INFO: Used lq/sq -(defmethod hal-sewer-method-230 hal-sewer ((this hal-sewer) (arg0 process-focusable) (arg1 process-focusable)) +(defmethod hal-sewer-method-230 ((this hal-sewer) (arg0 process-focusable) (arg1 process-focusable)) (when (and arg0 arg1) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set! (-> gp-0 start-pos quad) (-> arg0 root trans quad)) @@ -272,7 +265,7 @@ ) ;; definition for method 227 of type hal-sewer -(defmethod hal-sewer-method-227 hal-sewer ((this hal-sewer)) +(defmethod hal-sewer-method-227 ((this hal-sewer)) (let* ((a0-1 (-> this actor-group 0 data 1 actor)) (v1-3 (if a0-1 (-> a0-1 extra process) @@ -324,7 +317,7 @@ ;; definition for method 228 of type hal-sewer ;; WARN: Return type mismatch bot-flags vs none. -(defmethod hal-sewer-method-228 hal-sewer ((this hal-sewer)) +(defmethod hal-sewer-method-228 ((this hal-sewer)) (with-pp (let ((s5-0 (-> this actor-group 0 data 18))) (cond diff --git a/test/decompiler/reference/jak2/levels/sewer/hosehead-fake_REF.gc b/test/decompiler/reference/jak2/levels/sewer/hosehead-fake_REF.gc index d67fac63bd8..a755d5b97f9 100644 --- a/test/decompiler/reference/jak2/levels/sewer/hosehead-fake_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/hosehead-fake_REF.gc @@ -3,27 +3,24 @@ ;; definition of type hosehead-fake-spawn-info (deftype hosehead-fake-spawn-info (basic) - ((id int32 :offset-assert 4) - (walk-dist float :offset-assert 8) - (handle handle :offset-assert 16) - (trans vector :inline :offset-assert 32) - (quat quaternion :inline :offset-assert 48) - (trans-x float :offset 32) - (trans-y float :offset 36) - (trans-z float :offset 40) - (trans-w float :offset 44) - (quat-x float :offset 48) - (quat-y float :offset 52) - (quat-z float :offset 56) - (quat-w float :offset 60) + ((id int32) + (walk-dist float) + (handle handle) + (trans vector :inline) + (quat quaternion :inline) + (trans-x float :overlay-at (-> trans data 0)) + (trans-y float :overlay-at (-> trans data 1)) + (trans-z float :overlay-at (-> trans data 2)) + (trans-w float :overlay-at (-> trans data 3)) + (quat-x float :overlay-at (-> quat data 0)) + (quat-y float :overlay-at (-> quat data 1)) + (quat-z float :overlay-at (-> quat data 2)) + (quat-w float :overlay-at (-> quat data 3)) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type hosehead-fake-spawn-info -(defmethod inspect hosehead-fake-spawn-info ((this hosehead-fake-spawn-info)) +(defmethod inspect ((this hosehead-fake-spawn-info)) (when (not this) (set! this this) (goto cfg-4) @@ -48,25 +45,23 @@ ;; definition of type hosehead-fake (deftype hosehead-fake (process-drawable) - ((info hosehead-fake-spawn-info :offset-assert 200) - (id int32 :offset-assert 204) - (walk-dest vector :inline :offset-assert 208) + ((info hosehead-fake-spawn-info) + (id int32) + (walk-dest vector :inline) ) - :heap-base #x60 - :method-count-assert 25 - :size-assert #xe0 - :flag-assert #x19006000e0 + (:state-methods + die-fast + idle + walk + ) (:methods - (die-fast () _type_ :state 20) - (idle () _type_ :state 21) - (walk () _type_ :state 22) - (debug-draw (_type_) none 23) - (print-def (_type_) none 24) + (debug-draw (_type_) none) + (print-def (_type_) none) ) ) ;; definition for method 3 of type hosehead-fake -(defmethod inspect hosehead-fake ((this hosehead-fake)) +(defmethod inspect ((this hosehead-fake)) (when (not this) (set! this this) (goto cfg-4) @@ -83,7 +78,7 @@ ;; definition for method 24 of type hosehead-fake ;; WARN: Return type mismatch int vs none. -(defmethod print-def hosehead-fake ((this hosehead-fake)) +(defmethod print-def ((this hosehead-fake)) (let ((s5-0 (-> this root))) (format #t "~%") (format #t "(def-hosehead-fake~%") @@ -112,7 +107,7 @@ ;; definition for method 23 of type hosehead-fake ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw hosehead-fake ((this hosehead-fake)) +(defmethod debug-draw ((this hosehead-fake)) (let ((a2-0 (-> this info))) (when a2-0 (if (!= (-> a2-0 walk-dist) 0.0) diff --git a/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc b/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc index a45cf0bbc95..73b70ffa2f3 100644 --- a/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc @@ -57,60 +57,58 @@ ;; definition of type hosehead (deftype hosehead (nav-enemy) - ((on-wall? symbol :offset-assert 604) - (sentry? symbol :offset-assert 608) - (shot-by-ruffian? symbol :offset-assert 612) - (on-stop-sentry function :offset-assert 616) - (jump-point vector :inline :offset-assert 624) - (last-time-dist-changed time-frame :offset-assert 640) - (next-lazer-time time-frame :offset-assert 648) - (fire-beam? symbol :offset-assert 656) - (head-angle degrees :offset-assert 660) - (head-angle-inc degrees :offset-assert 664) - (target-pos vector :inline :offset-assert 672) - (come-from-notice symbol :offset-assert 688) - (allow-head symbol :offset-assert 692) - (head-joint-mod joint-mod :offset-assert 696) - (joint-ik joint-mod-ik 4 :offset-assert 700) - (delta-y-ik float 4 :offset-assert 716) - (lazer-dist float :offset 740) - (lazer-pos-sound vector :inline :offset-assert 752) - (lazer-sound sound-id :offset-assert 768) - (lazer-sound2 sound-id :offset-assert 772) - (sync sync-eased :inline :offset-assert 776) - (angle-sentry degrees :offset-assert 820) - (lazer-length float :offset-assert 824) + ((on-wall? symbol) + (sentry? symbol) + (shot-by-ruffian? symbol) + (on-stop-sentry function) + (jump-point vector :inline) + (last-time-dist-changed time-frame) + (next-lazer-time time-frame) + (fire-beam? symbol) + (head-angle degrees) + (head-angle-inc degrees) + (target-pos vector :inline) + (come-from-notice symbol) + (allow-head symbol) + (head-joint-mod joint-mod) + (joint-ik joint-mod-ik 4) + (delta-y-ik float 4) + (lazer-dist float :offset 740) + (lazer-pos-sound vector :inline) + (lazer-sound sound-id) + (lazer-sound2 sound-id) + (sync sync-eased :inline) + (angle-sentry degrees) + (lazer-length float) ) - :heap-base #x2c0 - :method-count-assert 198 - :size-assert #x33c - :flag-assert #xc602c0033c + (:state-methods + ambush-land + idle-sentry + active-wall + notice-wall + hostile-sentry + fire + attack + ) (:methods - (ambush-land () _type_ :state 178) - (idle-sentry () _type_ :state 179) - (active-wall () _type_ :state 180) - (notice-wall () _type_ :state 181) - (hostile-sentry () _type_ :state 182) - (fire () _type_ :state 183) - (attack () _type_ :state 184) - (hosehead-method-185 (_type_) none 185) - (hosehead-method-186 (_type_) none 186) - (hosehead-method-187 (_type_ vector) none 187) - (hosehead-method-188 (_type_) none 188) - (hosehead-method-189 (_type_) none 189) - (hosehead-method-190 (_type_) symbol 190) - (hosehead-method-191 (_type_ vector vector) none 191) - (hosehead-method-192 (_type_ vector) symbol 192) - (hosehead-method-193 (_type_) none 193) - (hosehead-method-194 (_type_) none 194) - (hosehead-method-195 (_type_) symbol 195) - (hosehead-method-196 (_type_) none 196) - (hosehead-method-197 (_type_) none 197) + (hosehead-method-185 (_type_) none) + (hosehead-method-186 (_type_) none) + (hosehead-method-187 (_type_ vector) none) + (hosehead-method-188 (_type_) none) + (hosehead-method-189 (_type_) none) + (hosehead-method-190 (_type_) symbol) + (hosehead-method-191 (_type_ vector vector) none) + (hosehead-method-192 (_type_ vector) symbol) + (hosehead-method-193 (_type_) none) + (hosehead-method-194 (_type_) none) + (hosehead-method-195 (_type_) symbol) + (hosehead-method-196 (_type_) none) + (hosehead-method-197 (_type_) none) ) ) ;; definition for method 3 of type hosehead -(defmethod inspect hosehead ((this hosehead)) +(defmethod inspect ((this hosehead)) (when (not this) (set! this this) (goto cfg-7) @@ -354,7 +352,7 @@ ;; definition for method 114 of type hosehead ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! hosehead ((this hosehead)) +(defmethod init-enemy-collision! ((this hosehead)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -427,16 +425,13 @@ ;; definition of type ik-setup (deftype ik-setup (structure) - ((elbow-index int32 :offset-assert 0) - (hand-dist float :offset-assert 4) + ((elbow-index int32) + (hand-dist float) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type ik-setup -(defmethod inspect ik-setup ((this ik-setup)) +(defmethod inspect ((this ik-setup)) (when (not this) (set! this this) (goto cfg-4) @@ -459,17 +454,14 @@ ;; definition of type hosehead-anim-info (deftype hosehead-anim-info (structure) - ((hit-index int32 :offset-assert 0) - (land-index int32 :offset-assert 4) + ((hit-index int32) + (land-index int32) ) :pack-me - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type hosehead-anim-info -(defmethod inspect hosehead-anim-info ((this hosehead-anim-info)) +(defmethod inspect ((this hosehead-anim-info)) (when (not this) (set! this this) (goto cfg-4) @@ -483,20 +475,17 @@ ;; definition of type hosehead-global-info (deftype hosehead-global-info (basic) - ((prev-yellow-hit int8 :offset-assert 4) - (prev-blue-hit int8 :offset-assert 5) - (prev-knocked int8 :offset-assert 6) - (yellow-hit-anim hosehead-anim-info 2 :inline :offset-assert 8) - (blue-hit-anim hosehead-anim-info 3 :inline :offset 24) - (knocked-anim hosehead-anim-info 2 :inline :offset 48) + ((prev-yellow-hit int8) + (prev-blue-hit int8) + (prev-knocked int8) + (yellow-hit-anim hosehead-anim-info 2 :inline) + (blue-hit-anim hosehead-anim-info 3 :inline :offset 24) + (knocked-anim hosehead-anim-info 2 :inline :offset 48) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type hosehead-global-info -(defmethod inspect hosehead-global-info ((this hosehead-global-info)) +(defmethod inspect ((this hosehead-global-info)) (when (not this) (set! this this) (goto cfg-4) @@ -531,7 +520,7 @@ ) ;; definition for method 77 of type hosehead -(defmethod enemy-method-77 hosehead ((this hosehead) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this hosehead) (arg0 (pointer float))) (cond ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) @@ -602,7 +591,7 @@ ) ;; definition for method 78 of type hosehead -(defmethod enemy-method-78 hosehead ((this hosehead) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this hosehead) (arg0 (pointer float))) (local-vars (v1-15 knocked-type)) (cond ((zero? (-> this hit-points)) @@ -655,7 +644,7 @@ ;; definition for method 189 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hosehead-method-189 hosehead ((this hosehead)) +(defmethod hosehead-method-189 ((this hosehead)) (let ((a0-2 (handle->process (-> this focus handle)))) (when a0-2 (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -670,7 +659,7 @@ ) ;; definition for method 190 of type hosehead -(defmethod hosehead-method-190 hosehead ((this hosehead)) +(defmethod hosehead-method-190 ((this hosehead)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -765,7 +754,7 @@ ;; definition for method 197 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hosehead-method-197 hosehead ((this hosehead)) +(defmethod hosehead-method-197 ((this hosehead)) (let ((s2-0 (new 'stack-no-clear 'matrix))) (let* ((a2-0 (-> this node-list data 12 bone transform)) (v1-2 (-> a2-0 quad 0)) @@ -857,7 +846,7 @@ ) ;; definition for method 88 of type hosehead -(defmethod enemy-method-88 hosehead ((this hosehead) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 ((this hosehead) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.075)) (let ((a1-2 (-> this draw art-group data (-> this enemy-info jump-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -872,7 +861,7 @@ ) ;; definition for method 74 of type hosehead -(defmethod general-event-handler hosehead ((this hosehead) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this hosehead) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -910,7 +899,7 @@ ;; definition for method 186 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod hosehead-method-186 hosehead ((this hosehead)) +(defmethod hosehead-method-186 ((this hosehead)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1028,7 +1017,7 @@ ;; definition for method 185 of type hosehead ;; WARN: Return type mismatch int vs none. -(defmethod hosehead-method-185 hosehead ((this hosehead)) +(defmethod hosehead-method-185 ((this hosehead)) (countdown (s5-0 (length (-> this actor-group 1))) (let* ((v1-5 (-> this actor-group 1 data s5-0 actor)) (a0-4 (if v1-5 @@ -1200,7 +1189,7 @@ ;; definition for method 192 of type hosehead ;; INFO: Used lq/sq -(defmethod hosehead-method-192 hosehead ((this hosehead) (arg0 vector)) +(defmethod hosehead-method-192 ((this hosehead) (arg0 vector)) (local-vars (a2-7 float) (a2-14 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -1324,7 +1313,7 @@ ;; definition for method 191 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod hosehead-method-191 hosehead ((this hosehead) (arg0 vector) (arg1 vector)) +(defmethod hosehead-method-191 ((this hosehead) (arg0 vector) (arg1 vector)) (cond ((logtest? (-> this fact enemy-options) (enemy-option user10)) (countdown (s3-0 8) @@ -1522,7 +1511,7 @@ ;; definition for method 196 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod hosehead-method-196 hosehead ((this hosehead)) +(defmethod hosehead-method-196 ((this hosehead)) (local-vars (sv-768 nav-control) (sv-784 vector) (sv-800 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1785,7 +1774,7 @@ ) ;; definition for method 195 of type hosehead -(defmethod hosehead-method-195 hosehead ((this hosehead)) +(defmethod hosehead-method-195 ((this hosehead)) (= *target* (handle->process (-> this focus handle))) ) @@ -2090,7 +2079,7 @@ ;; definition for method 187 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hosehead-method-187 hosehead ((this hosehead) (arg0 vector)) +(defmethod hosehead-method-187 ((this hosehead) (arg0 vector)) (local-vars (sv-128 vector)) (set! sv-128 (new 'stack-no-clear 'vector)) (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -2125,7 +2114,7 @@ ;; definition for method 188 of type hosehead ;; WARN: Return type mismatch quaternion vs none. -(defmethod hosehead-method-188 hosehead ((this hosehead)) +(defmethod hosehead-method-188 ((this hosehead)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-identity! gp-0) (quaternion-pseudo-seek (-> this head-joint-mod quat) (-> this head-joint-mod quat) gp-0 (seconds-per-frame)) @@ -2134,7 +2123,7 @@ ) ;; definition for method 55 of type hosehead -(defmethod track-target! hosehead ((this hosehead)) +(defmethod track-target! ((this hosehead)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -2158,7 +2147,7 @@ ;; definition for method 194 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hosehead-method-194 hosehead ((this hosehead)) +(defmethod hosehead-method-194 ((this hosehead)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -2293,7 +2282,7 @@ ;; definition for method 106 of type hosehead ;; WARN: Return type mismatch symbol vs none. -(defmethod enemy-method-106 hosehead ((this hosehead) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 ((this hosehead) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) (t9-0 this arg0 arg1 arg2 arg3) ) @@ -2307,7 +2296,7 @@ ) ;; definition for method 56 of type hosehead -(defmethod damage-amount-from-attack hosehead ((this hosehead) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack ((this hosehead) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let* ((t9-0 (method-of-type nav-enemy damage-amount-from-attack)) (v0-0 (t9-0 this arg0 arg1)) @@ -2320,7 +2309,7 @@ ) ;; definition for method 58 of type hosehead -(defmethod enemy-method-58 hosehead ((this hosehead) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 ((this hosehead) (arg0 process) (arg1 event-message-block)) (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) (v0-0 (t9-0 this arg0 arg1)) ) @@ -2332,7 +2321,7 @@ ) ;; definition for method 7 of type hosehead -(defmethod relocate hosehead ((this hosehead) (arg0 int)) +(defmethod relocate ((this hosehead) (arg0 int)) (if (nonzero? (-> this head-joint-mod)) (&+! (-> this head-joint-mod) arg0) ) @@ -2347,7 +2336,7 @@ ;; definition for method 115 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! hosehead ((this hosehead)) +(defmethod init-enemy! ((this hosehead)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 res-tag) (sv-32 res-tag)) (stack-size-set! (-> this main-thread) 256) @@ -2465,12 +2454,12 @@ ) ;; definition for method 66 of type hosehead -(defmethod go-ambush hosehead ((this hosehead)) +(defmethod go-ambush ((this hosehead)) (go (method-of-object this ambush)) ) ;; definition for method 70 of type hosehead -(defmethod go-hostile hosehead ((this hosehead)) +(defmethod go-hostile ((this hosehead)) (if (-> this sentry?) (go (method-of-object this hostile-sentry)) (go (method-of-object this hostile)) @@ -2479,7 +2468,7 @@ ;; definition for method 116 of type hosehead ;; WARN: Return type mismatch object vs none. -(defmethod go-idle hosehead ((this hosehead)) +(defmethod go-idle ((this hosehead)) (if (-> this sentry?) (go (method-of-object this idle-sentry)) (go (method-of-object this idle)) diff --git a/test/decompiler/reference/jak2/levels/sewer/jinx2-course_REF.gc b/test/decompiler/reference/jak2/levels/sewer/jinx2-course_REF.gc index 8aa1d2ecaaf..8f3e0225b82 100644 --- a/test/decompiler/reference/jak2/levels/sewer/jinx2-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/jinx2-course_REF.gc @@ -4,14 +4,10 @@ ;; definition of type jinx-sewer (deftype jinx-sewer (jinx) () - :heap-base #x380 - :method-count-assert 246 - :size-assert #x400 - :flag-assert #xf603800400 ) ;; definition for method 3 of type jinx-sewer -(defmethod inspect jinx-sewer ((this jinx-sewer)) +(defmethod inspect ((this jinx-sewer)) (when (not this) (set! this this) (goto cfg-4) @@ -25,7 +21,7 @@ ;; definition for method 116 of type jinx-sewer ;; WARN: Return type mismatch object vs none. -(defmethod go-idle jinx-sewer ((this jinx-sewer)) +(defmethod go-idle ((this jinx-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) (cleanup-for-death this) diff --git a/test/decompiler/reference/jak2/levels/sewer/mog2-course_REF.gc b/test/decompiler/reference/jak2/levels/sewer/mog2-course_REF.gc index 508071ecb17..7be5f4abeaa 100644 --- a/test/decompiler/reference/jak2/levels/sewer/mog2-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/mog2-course_REF.gc @@ -4,14 +4,10 @@ ;; definition of type mog-sewer (deftype mog-sewer (mog) () - :heap-base #x380 - :method-count-assert 246 - :size-assert #x400 - :flag-assert #xf603800400 ) ;; definition for method 3 of type mog-sewer -(defmethod inspect mog-sewer ((this mog-sewer)) +(defmethod inspect ((this mog-sewer)) (when (not this) (set! this this) (goto cfg-4) @@ -25,7 +21,7 @@ ;; definition for method 116 of type mog-sewer ;; WARN: Return type mismatch object vs none. -(defmethod go-idle mog-sewer ((this mog-sewer)) +(defmethod go-idle ((this mog-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) (cleanup-for-death this) diff --git a/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc index 5fad71b21a3..42520960acc 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc @@ -417,23 +417,20 @@ ;; definition of type gun-turret-params (deftype gun-turret-params (structure) - ((normal-sg skeleton-group :offset-assert 0) - (explode-sg skeleton-group :offset-assert 4) - (enemy-info enemy-info :offset-assert 8) - (idle-anim int32 :offset-assert 12) - (shoot-anim int32 :offset-assert 16) - (track-joint int32 :offset-assert 20) - (barrel-joint int32 :offset-assert 24) - (gun-joint int32 :offset-assert 28) - (hole-joints int32 8 :offset-assert 32) + ((normal-sg skeleton-group) + (explode-sg skeleton-group) + (enemy-info enemy-info) + (idle-anim int32) + (shoot-anim int32) + (track-joint int32) + (barrel-joint int32) + (gun-joint int32) + (hole-joints int32 8) ) - :method-count-assert 9 - :size-assert #x40 - :flag-assert #x900000040 ) ;; definition for method 3 of type gun-turret-params -(defmethod inspect gun-turret-params ((this gun-turret-params)) +(defmethod inspect ((this gun-turret-params)) (when (not this) (set! this this) (goto cfg-4) @@ -454,37 +451,33 @@ ;; definition of type sew-gunturret (deftype sew-gunturret (enemy) - ((gun-tilt-jm joint-mod :offset-assert 532) - (params gun-turret-params :offset-assert 536) - (aim-pos vector :inline :offset-assert 544) - (gun-twist float :offset-assert 560) - (gun-tilt float :offset-assert 564) - (desired-twist float :offset-assert 568) - (desired-tilt float :offset-assert 572) - (los-clear symbol :offset-assert 576) - (smoke-part sparticle-launch-control :offset-assert 580) - (casing-part sparticle-launch-control :offset-assert 584) - (flash-state symbol :offset-assert 588) - (can-shoot symbol :offset-assert 592) - (last-hit-time time-frame :offset-assert 600) - (init-mat matrix :inline :offset-assert 608) - (activate-distance float :offset-assert 672) + ((gun-tilt-jm joint-mod) + (params gun-turret-params) + (aim-pos vector :inline) + (gun-twist float) + (gun-tilt float) + (desired-twist float) + (desired-tilt float) + (los-clear symbol) + (smoke-part sparticle-launch-control) + (casing-part sparticle-launch-control) + (flash-state symbol) + (can-shoot symbol) + (last-hit-time time-frame) + (init-mat matrix :inline) + (activate-distance float) ) - :heap-base #x230 - :method-count-assert 142 - :size-assert #x2a4 - :flag-assert #x8e023002a4 (:methods - (aim-turret! (_type_ symbol) none 137) - (update-collision! (_type_) none 138) - (set-aim-at-default! (_type_) none 139) - (fire-turret! (_type_ symbol) none 140) - (init-turret-params! (_type_) none 141) + (aim-turret! (_type_ symbol) none) + (update-collision! (_type_) none) + (set-aim-at-default! (_type_) none) + (fire-turret! (_type_ symbol) none) + (init-turret-params! (_type_) none) ) ) ;; definition for method 3 of type sew-gunturret -(defmethod inspect sew-gunturret ((this sew-gunturret)) +(defmethod inspect ((this sew-gunturret)) (when (not this) (set! this this) (goto cfg-4) @@ -598,7 +591,7 @@ ;; definition for method 137 of type sew-gunturret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod aim-turret! sew-gunturret ((this sew-gunturret) (aim-at-target? symbol)) +(defmethod aim-turret! ((this sew-gunturret) (aim-at-target? symbol)) "Calculates the angle and tilt for the turret to either aim at the target, or it's default direction @param aim-at-target? Whether or not the turret should aim at the target, will ignore the target if #f" (cond @@ -677,7 +670,7 @@ ;; definition for method 138 of type sew-gunturret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-collision! sew-gunturret ((this sew-gunturret)) +(defmethod update-collision! ((this sew-gunturret)) "Updates the collision for the turret based on it's aiming direction" (let ((target-proc (handle->process (-> this focus handle)))) (if target-proc @@ -718,7 +711,7 @@ ;; definition for method 139 of type sew-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod set-aim-at-default! sew-gunturret ((this sew-gunturret)) +(defmethod set-aim-at-default! ((this sew-gunturret)) "Aims the turret at it's default direction. Sets `aim-pos` accordingly" (vector+float*! (-> this aim-pos) (-> this root trans) (-> this init-mat vector 2) 163840.0) 0 @@ -727,7 +720,7 @@ ;; definition for method 140 of type sew-gunturret ;; INFO: Used lq/sq -(defmethod fire-turret! sew-gunturret ((this sew-gunturret) (fire-sound? symbol)) +(defmethod fire-turret! ((this sew-gunturret) (fire-sound? symbol)) "Actually fires the turret, sets `flash-state` to [[#t]] @param fire-sound? Whether to play the fire sound effect or not" (let ((v1-4 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params gun-joint)))) @@ -877,7 +870,7 @@ ) ;; definition for method 74 of type sew-gunturret -(defmethod general-event-handler sew-gunturret ((this sew-gunturret) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) +(defmethod general-event-handler ((this sew-gunturret) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (if (and (= event-type 'notify) (< 1 arg2) (= (-> event param 0) 'attack) (= (-> event param 1) *target*)) @@ -969,7 +962,7 @@ ;; definition for method 114 of type sew-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! sew-gunturret ((this sew-gunturret)) +(defmethod init-enemy-collision! ((this sew-gunturret)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) @@ -1030,7 +1023,7 @@ ) ;; definition for method 98 of type sew-gunturret -(defmethod in-aggro-range? sew-gunturret ((this sew-gunturret) (proc process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this sew-gunturret) (proc process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -1055,7 +1048,7 @@ ) ;; definition for method 10 of type sew-gunturret -(defmethod deactivate sew-gunturret ((this sew-gunturret)) +(defmethod deactivate ((this sew-gunturret)) (if (nonzero? (-> this smoke-part)) (kill-and-free-particles (-> this smoke-part)) ) @@ -1067,14 +1060,14 @@ ) ;; definition for method 60 of type sew-gunturret -(defmethod coin-flip? sew-gunturret ((this sew-gunturret)) +(defmethod coin-flip? ((this sew-gunturret)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 7 of type sew-gunturret ;; WARN: Return type mismatch enemy vs sew-gunturret. -(defmethod relocate sew-gunturret ((this sew-gunturret) (arg0 int)) +(defmethod relocate ((this sew-gunturret) (arg0 int)) (if (nonzero? (-> this gun-tilt-jm)) (&+! (-> this gun-tilt-jm) arg0) ) @@ -1089,7 +1082,7 @@ ;; definition for method 141 of type sew-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod init-turret-params! sew-gunturret ((this sew-gunturret)) +(defmethod init-turret-params! ((this sew-gunturret)) (let ((turret-params (new 'static 'gun-turret-params :idle-anim 2 @@ -1119,7 +1112,7 @@ ;; definition for method 115 of type sew-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! sew-gunturret ((this sew-gunturret)) +(defmethod init-enemy! ((this sew-gunturret)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (init-turret-params! this) (initialize-skeleton this (-> this params normal-sg) (the-as pair 0)) @@ -1148,7 +1141,7 @@ ;; definition for method 116 of type sew-gunturret ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sew-gunturret ((this sew-gunturret)) +(defmethod go-idle ((this sew-gunturret)) (cond ((task-node-closed? (game-task-node sewer-enemy-blow-up-turrets)) (cleanup-for-death this) @@ -1260,17 +1253,13 @@ ;; definition of type pal-gun-turret (deftype pal-gun-turret (sew-gunturret) () - :heap-base #x230 - :method-count-assert 142 - :size-assert #x2a4 - :flag-assert #x8e023002a4 (:methods - (fire-turret! (_type_ symbol) float :replace 140) + (fire-turret! (_type_ symbol) float :replace) ) ) ;; definition for method 3 of type pal-gun-turret -(defmethod inspect pal-gun-turret ((this pal-gun-turret)) +(defmethod inspect ((this pal-gun-turret)) (when (not this) (set! this this) (goto cfg-4) @@ -1283,7 +1272,7 @@ ) ;; definition for method 140 of type pal-gun-turret -(defmethod fire-turret! pal-gun-turret ((this pal-gun-turret) (arg0 symbol)) +(defmethod fire-turret! ((this pal-gun-turret) (arg0 symbol)) "@overrides Calls [[sew-gunturret::140]] but also customizes the turret flash via [[set-palcab-turret-flash!]]" (call-parent-method this arg0) (set-palcab-turret-flash! 1.0) @@ -1291,14 +1280,14 @@ ;; definition for method 116 of type pal-gun-turret ;; WARN: Return type mismatch object vs none. -(defmethod go-idle pal-gun-turret ((this pal-gun-turret)) +(defmethod go-idle ((this pal-gun-turret)) (go (method-of-object this idle)) (none) ) ;; definition for method 141 of type pal-gun-turret ;; WARN: Return type mismatch int vs none. -(defmethod init-turret-params! pal-gun-turret ((this pal-gun-turret)) +(defmethod init-turret-params! ((this pal-gun-turret)) (let ((turret-params (new 'static 'gun-turret-params :idle-anim 2 diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc index cd352297fab..9f52a43ac92 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc @@ -3,19 +3,15 @@ ;; definition of type sew-elevator (deftype sew-elevator (elevator) - ((sound-id sound-id :offset-assert 368) + ((sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 50 - :size-assert #x174 - :flag-assert #x3201000174 (:methods - (configure-collision (_type_ symbol) none 49) + (configure-collision (_type_ symbol) none) ) ) ;; definition for method 3 of type sew-elevator -(defmethod inspect sew-elevator ((this sew-elevator)) +(defmethod inspect ((this sew-elevator)) (when (not this) (set! this this) (goto cfg-4) @@ -35,13 +31,13 @@ ) ;; definition for method 30 of type sew-elevator -(defmethod get-art-group sew-elevator ((this sew-elevator)) +(defmethod get-art-group ((this sew-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-sew-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 43 of type sew-elevator -(defmethod move-between-points sew-elevator ((this sew-elevator) (arg1 vector) (point-a float) (point-b float)) +(defmethod move-between-points ((this sew-elevator) (arg1 vector) (point-a float) (point-b float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -61,7 +57,7 @@ ) ;; definition for method 45 of type sew-elevator -(defmethod commited-to-ride? sew-elevator ((this sew-elevator)) +(defmethod commited-to-ride? ((this sew-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((target *target*) (target-proc (if (type? target process-focusable) @@ -85,7 +81,7 @@ ;; definition for method 49 of type sew-elevator ;; WARN: Return type mismatch int vs none. -(defmethod configure-collision sew-elevator ((this sew-elevator) (collide-with-jak? symbol)) +(defmethod configure-collision ((this sew-elevator) (collide-with-jak? symbol)) "Appropriately sets the collision on the elevator @param collide-with-jak? If set, the elevator will collide with Jak" (let ((prim-group (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) @@ -151,7 +147,7 @@ ) ;; definition for method 10 of type sew-elevator -(defmethod deactivate sew-elevator ((this sew-elevator)) +(defmethod deactivate ((this sew-elevator)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -159,7 +155,7 @@ ;; definition for method 33 of type sew-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! sew-elevator ((this sew-elevator)) +(defmethod init-plat! ((this sew-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this sound-id) (new-sound-id)) @@ -169,7 +165,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 41 of type sew-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-defaults! sew-elevator ((this sew-elevator)) +(defmethod init-defaults! ((this sew-elevator)) "Initializes default settings related to the [[elevator]]: - `elevator-xz-threshold` - `elevator-y-threshold` @@ -196,7 +192,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 31 of type sew-elevator -(defmethod init-plat-collision! sew-elevator ((this sew-elevator)) +(defmethod init-plat-collision! ((this sew-elevator)) "TODO - collision stuff for setting up the platform" (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) @@ -239,25 +235,21 @@ For example for an elevator pre-compute the distance between the first and last ;; definition of type sew-valve (deftype sew-valve (process-drawable) - ((joint joint-mod-rotate-local :offset-assert 200) - (actor-group (pointer actor-group) :offset-assert 204) - (actor-group-count int32 :offset-assert 208) - (water-height float :offset-assert 212) - (spin float :offset-assert 216) - (spin-rate float :offset-assert 220) + ((joint joint-mod-rotate-local) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (water-height float) + (spin float) + (spin-rate float) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xe0 - :flag-assert #x16006000e0 - (:methods - (idle () _type_ :state 20) - (turn () _type_ :state 21) + (:state-methods + idle + turn ) ) ;; definition for method 3 of type sew-valve -(defmethod inspect sew-valve ((this sew-valve)) +(defmethod inspect ((this sew-valve)) (when (not this) (set! this this) (goto cfg-7) @@ -361,7 +353,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 7 of type sew-valve -(defmethod relocate sew-valve ((this sew-valve) (arg0 int)) +(defmethod relocate ((this sew-valve) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) @@ -371,7 +363,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 11 of type sew-valve ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-valve ((this sew-valve) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-valve) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -431,17 +423,13 @@ This commonly includes things such as: ;; definition of type sew-mar-statue-debris (deftype sew-mar-statue-debris (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type sew-mar-statue-debris -(defmethod inspect sew-mar-statue-debris ((this sew-mar-statue-debris)) +(defmethod inspect ((this sew-mar-statue-debris)) (when (not this) (set! this this) (goto cfg-4) @@ -456,17 +444,13 @@ This commonly includes things such as: ;; definition of type sew-mar-statue-debris-b (deftype sew-mar-statue-debris-b (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type sew-mar-statue-debris-b -(defmethod inspect sew-mar-statue-debris-b ((this sew-mar-statue-debris-b)) +(defmethod inspect ((this sew-mar-statue-debris-b)) (when (not this) (set! this this) (goto cfg-4) @@ -480,21 +464,17 @@ This commonly includes things such as: ;; definition of type sew-mar-statue (deftype sew-mar-statue (process-drawable) - ((root collide-shape :override) - (spawned-debris? symbol :offset-assert 200) + ((root collide-shape :override) + (spawned-debris? symbol) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xcc - :flag-assert #x16005000cc - (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) + (:state-methods + idle + hidden ) ) ;; definition for method 3 of type sew-mar-statue -(defmethod inspect sew-mar-statue ((this sew-mar-statue)) +(defmethod inspect ((this sew-mar-statue)) (when (not this) (set! this this) (goto cfg-4) @@ -646,7 +626,7 @@ This commonly includes things such as: ) ;; definition for method 12 of type sew-mar-statue -(defmethod run-logic? sew-mar-statue ((this sew-mar-statue)) +(defmethod run-logic? ((this sew-mar-statue)) #t ) @@ -680,7 +660,7 @@ This commonly includes things such as: ;; definition for method 11 of type sew-mar-statue ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-mar-statue ((this sew-mar-statue) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-mar-statue) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -730,14 +710,10 @@ This commonly includes things such as: ;; definition of type sew-catwalk (deftype sew-catwalk (drop-plat) () - :heap-base #xc0 - :method-count-assert 36 - :size-assert #x140 - :flag-assert #x2400c00140 ) ;; definition for method 3 of type sew-catwalk -(defmethod inspect sew-catwalk ((this sew-catwalk)) +(defmethod inspect ((this sew-catwalk)) (when (not this) (set! this this) (goto cfg-4) @@ -758,7 +734,7 @@ This commonly includes things such as: ;; definition for method 29 of type sew-catwalk ;; WARN: Return type mismatch int vs none. -(defmethod start-bouncing! sew-catwalk ((this sew-catwalk)) +(defmethod start-bouncing! ((this sew-catwalk)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" @@ -805,7 +781,7 @@ and translate the platform via the `smush` ;; definition for method 11 of type sew-catwalk ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-catwalk ((this sew-catwalk) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-catwalk) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -898,22 +874,20 @@ This commonly includes things such as: ;; definition of type sew-mine (deftype sew-mine (process-drawable) - ((root collide-shape-moving :override) - (last-time time-frame :offset-assert 200) + ((root collide-shape-moving :override) + (last-time time-frame) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xd0 - :flag-assert #x17005000d0 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (init-mine! (_type_) none 22) + (init-mine! (_type_) none) ) ) ;; definition for method 3 of type sew-mine -(defmethod inspect sew-mine ((this sew-mine)) +(defmethod inspect ((this sew-mine)) (when (not this) (set! this this) (goto cfg-4) @@ -1034,7 +1008,7 @@ This commonly includes things such as: ;; definition for method 22 of type sew-mine ;; WARN: Return type mismatch int vs none. -(defmethod init-mine! sew-mine ((this sew-mine)) +(defmethod init-mine! ((this sew-mine)) "Initializes the mine's particles and sets `last-time` to `0`" (set! (-> this part) (create-launch-control (-> *part-group-id-table* 345) this)) (set! (-> this last-time) 0) @@ -1045,14 +1019,10 @@ This commonly includes things such as: ;; definition of type sew-mine-a (deftype sew-mine-a (sew-mine) () - :heap-base #x50 - :method-count-assert 23 - :size-assert #xd0 - :flag-assert #x17005000d0 ) ;; definition for method 3 of type sew-mine-a -(defmethod inspect sew-mine-a ((this sew-mine-a)) +(defmethod inspect ((this sew-mine-a)) (when (not this) (set! this this) (goto cfg-4) @@ -1072,7 +1042,7 @@ This commonly includes things such as: ;; definition for method 11 of type sew-mine-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-mine-a ((this sew-mine-a) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-mine-a) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1110,19 +1080,15 @@ This commonly includes things such as: ;; definition of type sew-mine-b (deftype sew-mine-b (sew-mine) - ((base-height float :offset-assert 208) - (center vector :inline :offset-assert 224) - (time-skew uint64 :offset-assert 240) - (period float :offset-assert 248) + ((base-height float) + (center vector :inline) + (time-skew uint64) + (period float) ) - :heap-base #x80 - :method-count-assert 23 - :size-assert #xfc - :flag-assert #x17008000fc ) ;; definition for method 3 of type sew-mine-b -(defmethod inspect sew-mine-b ((this sew-mine-b)) +(defmethod inspect ((this sew-mine-b)) (when (not this) (set! this this) (goto cfg-4) @@ -1177,7 +1143,7 @@ This commonly includes things such as: ;; definition for method 11 of type sew-mine-b ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-mine-b ((this sew-mine-b) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-mine-b) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1232,26 +1198,24 @@ This commonly includes things such as: ;; definition of type sew-wall (deftype sew-wall (process-focusable) - ((deadly-radius float :offset-assert 204) - (prev-deadly-radius float :offset-assert 208) - (attack-id uint32 :offset-assert 212) - (first-wall? symbol :offset-assert 216) - (anim spool-anim :offset-assert 220) - (art-name string :offset-assert 224) + ((deadly-radius float) + (prev-deadly-radius float) + (attack-id uint32) + (first-wall? symbol) + (anim spool-anim) + (art-name string) ) - :heap-base #x70 - :method-count-assert 30 - :size-assert #xe4 - :flag-assert #x1e007000e4 + (:state-methods + idle + (hit symbol) + ) (:methods - (idle () _type_ :state 27) - (hit (symbol) _type_ :state 28) - (attack-target! (_type_) none 29) + (attack-target! (_type_) none) ) ) ;; definition for method 3 of type sew-wall -(defmethod inspect sew-wall ((this sew-wall)) +(defmethod inspect ((this sew-wall)) (when (not this) (set! this this) (goto cfg-4) @@ -1279,7 +1243,7 @@ This commonly includes things such as: ;; definition for method 29 of type sew-wall ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod attack-target! sew-wall ((this sew-wall)) +(defmethod attack-target! ((this sew-wall)) "If the target is close enough to the wall, hit it!" (let ((target *target*)) (when target @@ -1428,7 +1392,7 @@ This commonly includes things such as: ;; definition for method 11 of type sew-wall ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-wall ((this sew-wall) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-wall) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1546,17 +1510,13 @@ This commonly includes things such as: ;; definition of type sew-grill (deftype sew-grill (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type sew-grill -(defmethod inspect sew-grill ((this sew-grill)) +(defmethod inspect ((this sew-grill)) (when (not this) (set! this this) (goto cfg-4) @@ -1592,7 +1552,7 @@ This commonly includes things such as: ;; definition for method 11 of type sew-grill ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-grill ((this sew-grill) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-grill) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1612,23 +1572,19 @@ This commonly includes things such as: ;; definition of type sew-scare-grunt (deftype sew-scare-grunt (grunt) - ((anim spool-anim :offset-assert 692) - (manipy (pointer manipy) :offset-assert 696) - (spooled-sound-id sound-id :offset-assert 700) - (grill-actor entity-actor :offset-assert 704) + ((anim spool-anim) + (manipy (pointer manipy)) + (spooled-sound-id sound-id) + (grill-actor entity-actor) ) - :heap-base #x250 - :method-count-assert 188 - :size-assert #x2c4 - :flag-assert #xbc025002c4 - (:methods - (waiting () _type_ :state 186) - (scare () _type_ :state 187) + (:state-methods + waiting + scare ) ) ;; definition for method 3 of type sew-scare-grunt -(defmethod inspect sew-scare-grunt ((this sew-scare-grunt)) +(defmethod inspect ((this sew-scare-grunt)) (when (not this) (set! this this) (goto cfg-4) @@ -1918,14 +1874,14 @@ This commonly includes things such as: ;; definition for method 116 of type sew-scare-grunt ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sew-scare-grunt ((this sew-scare-grunt)) +(defmethod go-idle ((this sew-scare-grunt)) (go (method-of-object this waiting)) (none) ) ;; definition for method 114 of type sew-scare-grunt ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! sew-scare-grunt ((this sew-scare-grunt)) +(defmethod init-enemy-collision! ((this sew-scare-grunt)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (stack-size-set! (-> this main-thread) 512) (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -2014,14 +1970,14 @@ This commonly includes things such as: ) ;; definition for method 185 of type sew-scare-grunt -(defmethod get-enemy-info sew-scare-grunt ((this sew-scare-grunt)) +(defmethod get-enemy-info ((this sew-scare-grunt)) "@returns the [[nav-enemy-info]] associated with this type of grunt" *sew-scare-grunt-nav-enemy-info* ) ;; definition for method 115 of type sew-scare-grunt ;; WARN: Return type mismatch float vs none. -(defmethod init-enemy! sew-scare-grunt ((this sew-scare-grunt)) +(defmethod init-enemy! ((this sew-scare-grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (set! (-> this anim) (new 'static 'spool-anim :name "sew-scare-grunt" :anim-name "sew-scare-grunt" :parts 2 :command-list '()) diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-obs_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-obs_REF.gc index 47cce8adc43..a186fd96885 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-obs_REF.gc @@ -3,25 +3,21 @@ ;; definition of type sew-blade (deftype sew-blade (process-drawable) - ((y-min float :offset-assert 200) - (y-max float :offset-assert 204) - (snd-water sound-name :offset-assert 208) - (snd-no-water sound-name :offset-assert 224) - (last-sound int32 :offset-assert 240) - (attack-id uint32 :offset-assert 244) + ((y-min float) + (y-max float) + (snd-water sound-name) + (snd-no-water sound-name) + (last-sound int32) + (attack-id uint32) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #xf8 - :flag-assert #x15008000f8 (:methods - (update-sound! (_type_) none 20) + (update-sound! (_type_) none) ) ) ;; definition for method 3 of type sew-blade ;; INFO: Used lq/sq -(defmethod inspect sew-blade ((this sew-blade)) +(defmethod inspect ((this sew-blade)) (when (not this) (set! this this) (goto cfg-4) @@ -42,7 +38,7 @@ ;; definition for method 20 of type sew-blade ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-sound! sew-blade ((this sew-blade)) +(defmethod update-sound! ((this sew-blade)) "Updates the sound of the [[sew-blade]] based on if it's under or above the water" (when (nonzero? (-> this sound)) (let ((f30-0 (+ (-> this root trans y) (-> this y-max))) @@ -76,19 +72,15 @@ ;; definition of type sew-single-blade (deftype sew-single-blade (sew-blade) - ((quat quaternion :inline :offset-assert 256) + ((quat quaternion :inline) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x110 - :flag-assert #x1600900110 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) ;; definition for method 3 of type sew-single-blade -(defmethod inspect sew-single-blade ((this sew-single-blade)) +(defmethod inspect ((this sew-single-blade)) (when (not this) (set! this this) (goto cfg-4) @@ -157,7 +149,7 @@ ;; definition for method 11 of type sew-single-blade ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-single-blade ((this sew-single-blade) (arg0 entity-actor)) +(defmethod init-from-entity! ((this sew-single-blade) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -215,21 +207,17 @@ This commonly includes things such as: ;; definition of type sew-tri-blade (deftype sew-tri-blade (sew-blade) - ((anim-time float :offset-assert 248) - (anim-offset float :offset-assert 252) - (switch-state int32 :offset-assert 256) + ((anim-time float) + (anim-offset float) + (switch-state int32) ) - :heap-base #x90 - :method-count-assert 22 - :size-assert #x104 - :flag-assert #x1600900104 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) ;; definition for method 3 of type sew-tri-blade -(defmethod inspect sew-tri-blade ((this sew-tri-blade)) +(defmethod inspect ((this sew-tri-blade)) (when (not this) (set! this this) (goto cfg-4) @@ -367,7 +355,7 @@ This commonly includes things such as: ;; definition for method 11 of type sew-tri-blade ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-tri-blade ((this sew-tri-blade) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-tri-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -452,17 +440,13 @@ This commonly includes things such as: ;; definition of type sew-arm-blade (deftype sew-arm-blade (sew-blade) () - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf8 - :flag-assert #x16008000f8 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) ;; definition for method 3 of type sew-arm-blade -(defmethod inspect sew-arm-blade ((this sew-arm-blade)) +(defmethod inspect ((this sew-arm-blade)) (when (not this) (set! this this) (goto cfg-4) @@ -523,7 +507,7 @@ This commonly includes things such as: ;; definition for method 11 of type sew-arm-blade ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-arm-blade ((this sew-arm-blade) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-arm-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -581,17 +565,13 @@ This commonly includes things such as: ;; definition of type sew-multi-blade (deftype sew-multi-blade (sew-blade) () - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf8 - :flag-assert #x16008000f8 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) ;; definition for method 3 of type sew-multi-blade -(defmethod inspect sew-multi-blade ((this sew-multi-blade)) +(defmethod inspect ((this sew-multi-blade)) (when (not this) (set! this this) (goto cfg-4) @@ -659,7 +639,7 @@ This commonly includes things such as: ;; definition for method 11 of type sew-multi-blade ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-multi-blade ((this sew-multi-blade) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-multi-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -716,20 +696,16 @@ This commonly includes things such as: ;; definition of type sew-twist-blade (deftype sew-twist-blade (sew-blade) - ((root-overide collide-shape-moving :offset 128) - (no-collision-timer uint64 :offset-assert 248) + ((root-overide collide-shape-moving :overlay-at root) + (no-collision-timer uint64) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #x100 - :flag-assert #x1600800100 - (:methods - (idle () _type_ :state 21) + (:state-methods + idle ) ) ;; definition for method 3 of type sew-twist-blade -(defmethod inspect sew-twist-blade ((this sew-twist-blade)) +(defmethod inspect ((this sew-twist-blade)) (when (not this) (set! this this) (goto cfg-4) @@ -825,7 +801,7 @@ This commonly includes things such as: ;; definition for method 11 of type sew-twist-blade ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-twist-blade ((this sew-twist-blade) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-twist-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -882,24 +858,22 @@ This commonly includes things such as: ;; definition of type sew-light-switch (deftype sew-light-switch (process-drawable) - ((light-state symbol :offset-assert 200) - (actor-group (pointer actor-group) :offset-assert 204) - (actor-group-count int32 :offset-assert 208) + ((light-state symbol) + (actor-group (pointer actor-group)) + (actor-group-count int32) ) - :heap-base #x60 - :method-count-assert 24 - :size-assert #xd4 - :flag-assert #x18006000d4 + (:state-methods + idle + pressed + ) (:methods - (idle () _type_ :state 20) - (pressed () _type_ :state 21) - (init-switch-collision! (_type_) none 22) - (broadcast-to-actors (_type_ symbol) none 23) + (init-switch-collision! (_type_) none) + (broadcast-to-actors (_type_ symbol) none) ) ) ;; definition for method 3 of type sew-light-switch -(defmethod inspect sew-light-switch ((this sew-light-switch)) +(defmethod inspect ((this sew-light-switch)) (when (not this) (set! this this) (goto cfg-7) @@ -919,24 +893,22 @@ This commonly includes things such as: ;; definition of type sew-light-control (deftype sew-light-control (process) - ((search-switches basic :offset-assert 128) - (search-turrets basic :offset-assert 132) - (switch-ent entity-actor :offset-assert 136) - (turret-ent entity-actor :offset-assert 140) + ((search-switches basic) + (search-turrets basic) + (switch-ent entity-actor) + (turret-ent entity-actor) ) - :heap-base #x10 - :method-count-assert 17 - :size-assert #x90 - :flag-assert #x1100100090 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 14) - (press! (_type_ symbol symbol) float 15) - (sew-light-control-method-16 (_type_ object vector float) symbol 16) + (press! (_type_ symbol symbol) float) + (sew-light-control-method-16 (_type_ object vector float) symbol) ) ) ;; definition for method 3 of type sew-light-control -(defmethod inspect sew-light-control ((this sew-light-control)) +(defmethod inspect ((this sew-light-control)) (when (not this) (set! this this) (goto cfg-4) @@ -1025,7 +997,7 @@ This commonly includes things such as: ;; definition for method 22 of type sew-light-switch ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-switch-collision! sew-light-switch ((this sew-light-switch)) +(defmethod init-switch-collision! ((this sew-light-switch)) "Initializes the collision on the switch" (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) @@ -1054,7 +1026,7 @@ This commonly includes things such as: ;; definition for method 23 of type sew-light-switch ;; WARN: Return type mismatch object vs none. -(defmethod broadcast-to-actors sew-light-switch ((this sew-light-switch) (event-type symbol)) +(defmethod broadcast-to-actors ((this sew-light-switch) (event-type symbol)) "Broadcast event to all associated [[entity]]s via the `actor-group`s @param `event-type` the symbol to broadcast" (with-pp @@ -1089,7 +1061,7 @@ This commonly includes things such as: ;; definition for method 11 of type sew-light-switch ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-light-switch ((this sew-light-switch) (entity entity-actor)) +(defmethod init-from-entity! ((this sew-light-switch) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1126,7 +1098,7 @@ This commonly includes things such as: ;; definition for method 16 of type sew-light-control ;; ERROR: failed type prop at 53: Could not figure out load: (set! v1 (l.w s4)) -(defmethod sew-light-control-method-16 sew-light-control ((a0-0 sew-light-control) (a1-0 object) (a2-0 vector) (a3-0 float)) +(defmethod sew-light-control-method-16 ((a0-0 sew-light-control) (a1-0 object) (a2-0 vector) (a3-0 float)) "@unused @TODO - not done yet, no callers?" (local-vars @@ -1307,7 +1279,7 @@ This commonly includes things such as: ) ;; definition for method 15 of type sew-light-control -(defmethod press! sew-light-control ((this sew-light-control) (switched-on? symbol) (should-turret-flash? symbol)) +(defmethod press! ((this sew-light-control) (switched-on? symbol) (should-turret-flash? symbol)) "Turns the lights on (or off) @param switched-on? Should the sewer lights be turned on or off? @param should-turret-flash? Should the turret have it's `flash` set as well" diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-part_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-part_REF.gc index 4b0b118dcf5..0b17f4ab8ab 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type sewer-part (deftype sewer-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type sewer-part -(defmethod inspect sewer-part ((this sewer-part)) +(defmethod inspect ((this sewer-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-scenes_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-scenes_REF.gc index eaf9bf65e55..e3617d61475 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-scenes_REF.gc @@ -970,15 +970,12 @@ ;; definition of type fake-jinx-bomb-info (deftype fake-jinx-bomb-info (basic) - ((handle handle :offset-assert 8) + ((handle handle) ) - :method-count-assert 9 - :size-assert #x10 - :flag-assert #x900000010 ) ;; definition for method 3 of type fake-jinx-bomb-info -(defmethod inspect fake-jinx-bomb-info ((this fake-jinx-bomb-info)) +(defmethod inspect ((this fake-jinx-bomb-info)) (when (not this) (set! this this) (goto cfg-4) @@ -1254,7 +1251,7 @@ ;; definition for method 15 of type hud-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-gunturret ((this hud-gunturret)) +(defmethod draw ((this hud-gunturret)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -1269,7 +1266,7 @@ ;; definition for method 16 of type hud-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-gunturret ((this hud-gunturret)) +(defmethod update-values ((this hud-gunturret)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -1278,7 +1275,7 @@ ;; definition for method 17 of type hud-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-gunturret ((this hud-gunturret)) +(defmethod init-callback ((this hud-gunturret)) (set! (-> this level) (level-get *level* 'sewerb)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) diff --git a/test/decompiler/reference/jak2/levels/stadium/racebike_REF.gc b/test/decompiler/reference/jak2/levels/stadium/racebike_REF.gc index 4c0eda29692..b42b135b117 100644 --- a/test/decompiler/reference/jak2/levels/stadium/racebike_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/racebike_REF.gc @@ -782,16 +782,12 @@ ;; definition of type vehicle-race-bike (deftype vehicle-race-bike (vehicle-racer) - ((steering-wheel joint-mod :offset-assert 1016) + ((steering-wheel joint-mod) ) - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3fc - :flag-assert #x9c038003fc ) ;; definition for method 3 of type vehicle-race-bike -(defmethod inspect vehicle-race-bike ((this vehicle-race-bike)) +(defmethod inspect ((this vehicle-race-bike)) (when (not this) (set! this this) (goto cfg-4) @@ -805,7 +801,7 @@ ) ;; definition for method 7 of type vehicle-race-bike -(defmethod relocate vehicle-race-bike ((this vehicle-race-bike) (arg0 int)) +(defmethod relocate ((this vehicle-race-bike) (arg0 int)) (if (nonzero? (-> this steering-wheel)) (&+! (-> this steering-wheel) arg0) ) @@ -814,7 +810,7 @@ ;; definition for method 86 of type vehicle-race-bike ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods vehicle-race-bike ((this vehicle-race-bike)) +(defmethod update-joint-mods ((this vehicle-race-bike)) (let ((f0-1 (* -5461.3335 (-> this controls steering))) (a1-0 (new 'static 'vector :z 1.0 :w 1.0)) ) @@ -827,14 +823,10 @@ ;; definition of type race-bike-d (deftype race-bike-d (vehicle-race-bike) () - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3fc - :flag-assert #x9c038003fc ) ;; definition for method 3 of type race-bike-d -(defmethod inspect race-bike-d ((this race-bike-d)) +(defmethod inspect ((this race-bike-d)) (when (not this) (set! this this) (goto cfg-4) @@ -848,7 +840,7 @@ ;; definition for method 32 of type race-bike-d ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape race-bike-d ((this race-bike-d)) +(defmethod allocate-and-init-cshape ((this race-bike-d)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -895,7 +887,7 @@ ;; definition for method 33 of type race-bike-d ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body race-bike-d ((this race-bike-d)) +(defmethod init-skel-and-rigid-body ((this race-bike-d)) (race-vehicle-entity-hack) (initialize-skeleton this @@ -915,14 +907,10 @@ ;; definition of type race-bike-e (deftype race-bike-e (vehicle-race-bike) () - :heap-base #x380 - :method-count-assert 156 - :size-assert #x3fc - :flag-assert #x9c038003fc ) ;; definition for method 3 of type race-bike-e -(defmethod inspect race-bike-e ((this race-bike-e)) +(defmethod inspect ((this race-bike-e)) (when (not this) (set! this this) (goto cfg-4) @@ -936,7 +924,7 @@ ;; definition for method 32 of type race-bike-e ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape race-bike-e ((this race-bike-e)) +(defmethod allocate-and-init-cshape ((this race-bike-e)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -983,7 +971,7 @@ ;; definition for method 33 of type race-bike-e ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body race-bike-e ((this race-bike-e)) +(defmethod init-skel-and-rigid-body ((this race-bike-e)) (race-vehicle-entity-hack) (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/stadium/skate/skatea-obs_REF.gc b/test/decompiler/reference/jak2/levels/stadium/skate/skatea-obs_REF.gc index 401f8156b43..a9d6db488d1 100644 --- a/test/decompiler/reference/jak2/levels/stadium/skate/skatea-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/skate/skatea-obs_REF.gc @@ -3,60 +3,58 @@ ;; definition of type hoverboard-training-manager (deftype hoverboard-training-manager (process) - ((actor-group (pointer actor-group) :offset-assert 128) - (actor-group-count int32 :offset-assert 132) - (trick-type board-tricks :offset-assert 136) - (board-picked-up symbol :offset-assert 140) - (boost symbol :offset-assert 144) - (grind symbol :offset-assert 148) - (text symbol :offset-assert 152) - (score float :offset-assert 156) - (challenge-done symbol :offset-assert 160) - (arrow handle :offset-assert 168) - (minimap connection-minimap :offset-assert 176) - (hud-score handle :offset-assert 184) - (hud-goal handle :offset-assert 192) - (voicebox handle :offset-assert 200) - (last-sound-id sound-id :offset-assert 208) - (combo-done? symbol :offset-assert 212) - (task-gold uint16 :offset-assert 216) - (task-silver uint16 :offset-assert 218) - (task-bronze uint16 :offset-assert 220) - (game-score uint8 :offset-assert 222) - (training? symbol :offset-assert 224) - (training-goal float :offset-assert 228) - (egg-count int32 :offset-assert 232) - (medal int32 :offset-assert 236) - (gui-id sound-id :offset-assert 240) - (hint-time time-frame :offset-assert 248) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (trick-type board-tricks) + (board-picked-up symbol) + (boost symbol) + (grind symbol) + (text symbol) + (score float) + (challenge-done symbol) + (arrow handle) + (minimap connection-minimap) + (hud-score handle) + (hud-goal handle) + (voicebox handle) + (last-sound-id sound-id) + (combo-done? symbol) + (task-gold uint16) + (task-silver uint16) + (task-bronze uint16) + (game-score uint8) + (training? symbol) + (training-goal float) + (egg-count int32) + (medal int32) + (gui-id sound-id) + (hint-time time-frame) ) - :heap-base #x80 - :method-count-assert 31 - :size-assert #x100 - :flag-assert #x1f00800100 + (:state-methods + wait-for-pickup + wait-for-pickup-training + wait-for-board + wait + jump + duck-jump + boost-jump + grind + spin + flip + trick + game + idle + idle-training + ) (:methods - (wait-for-pickup () _type_ :state 14) - (wait-for-pickup-training () _type_ :state 15) - (wait-for-board () _type_ :state 16) - (wait () _type_ :state 17) - (jump () _type_ :state 18) - (duck-jump () _type_ :state 19) - (boost-jump () _type_ :state 20) - (grind () _type_ :state 21) - (spin () _type_ :state 22) - (flip () _type_ :state 23) - (trick () _type_ :state 24) - (game () _type_ :state 25) - (idle () _type_ :state 26) - (idle-training () _type_ :state 27) - (render-text (_type_ text-id) float 28) - (hoverboard-training-manager-method-29 (_type_) none 29) - (hoverboard-training-manager-method-30 (_type_) none 30) + (render-text (_type_ text-id) float) + (hoverboard-training-manager-method-29 (_type_) none) + (hoverboard-training-manager-method-30 (_type_) none) ) ) ;; definition for method 3 of type hoverboard-training-manager -(defmethod inspect hoverboard-training-manager ((this hoverboard-training-manager)) +(defmethod inspect ((this hoverboard-training-manager)) (when (not this) (set! this this) (goto cfg-7) @@ -98,7 +96,7 @@ ) ;; definition for method 28 of type hoverboard-training-manager -(defmethod render-text hoverboard-training-manager ((this hoverboard-training-manager) (arg0 text-id)) +(defmethod render-text ((this hoverboard-training-manager) (arg0 text-id)) (when (= (get-status *gui-control* (-> this gui-id)) (gui-status active)) (let ((s5-1 (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) @@ -714,7 +712,7 @@ ;; definition for method 29 of type hoverboard-training-manager ;; WARN: Return type mismatch int vs none. -(defmethod hoverboard-training-manager-method-29 hoverboard-training-manager ((this hoverboard-training-manager)) +(defmethod hoverboard-training-manager-method-29 ((this hoverboard-training-manager)) (let ((s5-0 (get-game-score-ref *game-info* (the-as int (-> this game-score)))) (gp-0 (handle->process (-> this hud-goal))) ) @@ -885,7 +883,7 @@ ;; definition for method 30 of type hoverboard-training-manager ;; WARN: Return type mismatch int vs none. -(defmethod hoverboard-training-manager-method-30 hoverboard-training-manager ((this hoverboard-training-manager)) +(defmethod hoverboard-training-manager-method-30 ((this hoverboard-training-manager)) (set! (-> this egg-count) 0) (set! (-> this medal) 0) (let ((s5-0 (get-game-score-ref *game-info* (the-as int (-> this game-score))))) @@ -1360,7 +1358,7 @@ ) ;; definition for method 10 of type hoverboard-training-manager -(defmethod deactivate hoverboard-training-manager ((this hoverboard-training-manager)) +(defmethod deactivate ((this hoverboard-training-manager)) (send-event *traffic-manager* 'restore-default-settings) (call-parent-method this) (none) @@ -1369,7 +1367,7 @@ ;; definition for method 11 of type hoverboard-training-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hoverboard-training-manager ((this hoverboard-training-manager) (arg0 entity-actor)) +(defmethod init-from-entity! ((this hoverboard-training-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1448,20 +1446,18 @@ This commonly includes things such as: ;; definition of type skate-training-ramp (deftype skate-training-ramp (process-focusable) - ((onoff symbol :offset-assert 204) + ((onoff symbol) ) - :heap-base #x50 - :method-count-assert 29 - :size-assert #xd0 - :flag-assert #x1d005000d0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (skate-training-ramp-method-28 (_type_) collide-shape-moving 28) + (skate-training-ramp-method-28 (_type_) collide-shape-moving) ) ) ;; definition for method 3 of type skate-training-ramp -(defmethod inspect skate-training-ramp ((this skate-training-ramp)) +(defmethod inspect ((this skate-training-ramp)) (when (not this) (set! this this) (goto cfg-4) @@ -1516,7 +1512,7 @@ This commonly includes things such as: ) ;; definition for method 28 of type skate-training-ramp -(defmethod skate-training-ramp-method-28 skate-training-ramp ((this skate-training-ramp)) +(defmethod skate-training-ramp-method-28 ((this skate-training-ramp)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1559,7 +1555,7 @@ This commonly includes things such as: ;; definition for method 11 of type skate-training-ramp ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! skate-training-ramp ((this skate-training-ramp) (arg0 entity-actor)) +(defmethod init-from-entity! ((this skate-training-ramp) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1591,21 +1587,19 @@ This commonly includes things such as: ;; definition of type skate-gate (deftype skate-gate (process-focusable) - ((onoff symbol :offset-assert 204) + ((onoff symbol) ) - :heap-base #x50 - :method-count-assert 30 - :size-assert #xd0 - :flag-assert #x1e005000d0 + (:state-methods + idle + open + ) (:methods - (idle () _type_ :state 27) - (open () _type_ :state 28) - (skate-gate-method-29 (_type_) collide-shape-moving 29) + (skate-gate-method-29 (_type_) collide-shape-moving) ) ) ;; definition for method 3 of type skate-gate -(defmethod inspect skate-gate ((this skate-gate)) +(defmethod inspect ((this skate-gate)) (when (not this) (set! this this) (goto cfg-4) @@ -1672,7 +1666,7 @@ This commonly includes things such as: ) ;; definition for method 29 of type skate-gate -(defmethod skate-gate-method-29 skate-gate ((this skate-gate)) +(defmethod skate-gate-method-29 ((this skate-gate)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1701,7 +1695,7 @@ This commonly includes things such as: ;; definition for method 11 of type skate-gate ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! skate-gate ((this skate-gate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this skate-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1754,14 +1748,10 @@ This commonly includes things such as: ;; definition of type skatea-jump-pad (deftype skatea-jump-pad (bouncer) () - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd4 - :flag-assert #x19006000d4 ) ;; definition for method 3 of type skatea-jump-pad -(defmethod inspect skatea-jump-pad ((this skatea-jump-pad)) +(defmethod inspect ((this skatea-jump-pad)) (when (not this) (set! this this) (goto cfg-4) @@ -1775,7 +1765,7 @@ This commonly includes things such as: ;; definition for method 23 of type skatea-jump-pad ;; WARN: Return type mismatch int vs none. -(defmethod init-skeleton! skatea-jump-pad ((this skatea-jump-pad)) +(defmethod init-skeleton! ((this skatea-jump-pad)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-skatea-jump-pad" (the-as (pointer uint32) #f))) @@ -1787,7 +1777,7 @@ This commonly includes things such as: ;; definition for method 24 of type skatea-jump-pad ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 skatea-jump-pad ((this skatea-jump-pad)) +(defmethod bouncer-method-24 ((this skatea-jump-pad)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1881,21 +1871,19 @@ This commonly includes things such as: ;; definition of type skatea-floating-ring (deftype skatea-floating-ring (process-focusable) - ((pos-y float :offset-assert 204) - (offset float :offset-assert 208) + ((pos-y float) + (offset float) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd4 - :flag-assert #x1d006000d4 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (skatea-floating-ring-method-28 (_type_) none 28) + (skatea-floating-ring-method-28 (_type_) none) ) ) ;; definition for method 3 of type skatea-floating-ring -(defmethod inspect skatea-floating-ring ((this skatea-floating-ring)) +(defmethod inspect ((this skatea-floating-ring)) (when (not this) (set! this this) (goto cfg-4) @@ -1959,7 +1947,7 @@ This commonly includes things such as: ;; definition for method 28 of type skatea-floating-ring ;; WARN: Return type mismatch int vs none. -(defmethod skatea-floating-ring-method-28 skatea-floating-ring ((this skatea-floating-ring)) +(defmethod skatea-floating-ring-method-28 ((this skatea-floating-ring)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1988,7 +1976,7 @@ This commonly includes things such as: ;; definition for method 11 of type skatea-floating-ring ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! skatea-floating-ring ((this skatea-floating-ring) (arg0 entity-actor)) +(defmethod init-from-entity! ((this skatea-floating-ring) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/stadium/skate/skatea-part_REF.gc b/test/decompiler/reference/jak2/levels/stadium/skate/skatea-part_REF.gc index df511da48ed..8d4f5228dd0 100644 --- a/test/decompiler/reference/jak2/levels/stadium/skate/skatea-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/skate/skatea-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type skatea-part (deftype skatea-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type skatea-part -(defmethod inspect skatea-part ((this skatea-part)) +(defmethod inspect ((this skatea-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc index 37f6dedcca1..3a517bf8f3c 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc @@ -4,14 +4,10 @@ ;; definition of type water-anim-stadium (deftype water-anim-stadium (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) ;; definition for method 3 of type water-anim-stadium -(defmethod inspect water-anim-stadium ((this water-anim-stadium)) +(defmethod inspect ((this water-anim-stadium)) (when (not this) (set! this this) (goto cfg-4) @@ -39,7 +35,7 @@ ;; definition for method 24 of type water-anim-stadium ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-stadium ((this water-anim-stadium)) +(defmethod init-water! ((this water-anim-stadium)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) (t9-0 this) @@ -58,17 +54,13 @@ ;; definition of type dummy-vehicle (deftype dummy-vehicle (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type dummy-vehicle -(defmethod inspect dummy-vehicle ((this dummy-vehicle)) +(defmethod inspect ((this dummy-vehicle)) (when (not this) (set! this this) (goto cfg-4) @@ -94,7 +86,7 @@ ;; definition for method 11 of type dummy-vehicle ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dummy-vehicle ((this dummy-vehicle) (arg0 entity-actor)) +(defmethod init-from-entity! ((this dummy-vehicle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -184,17 +176,13 @@ This commonly includes things such as: ;; definition of type gar-curtain (deftype gar-curtain (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type gar-curtain -(defmethod inspect gar-curtain ((this gar-curtain)) +(defmethod inspect ((this gar-curtain)) (when (not this) (set! this this) (goto cfg-4) @@ -225,7 +213,7 @@ This commonly includes things such as: ;; definition for method 11 of type gar-curtain ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gar-curtain ((this gar-curtain) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gar-curtain) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -294,29 +282,25 @@ This commonly includes things such as: ;; definition of type rift-rider (deftype rift-rider (rigid-body-object) - ((escort-actor entity-actor 2 :offset-assert 272) - (escort-force vector 2 :inline :offset-assert 288) - (brutter-balloon-actor entity-actor :offset-assert 320) - (path-pos float :offset-assert 324) - (dest-pos vector :inline :offset-assert 336) - (speed float :offset-assert 352) - (height float :offset-assert 356) - (init-height float :offset-assert 360) - (battle-entity-triggered int32 :offset-assert 364) - (battle-info-index int32 :offset-assert 368) - (sound-id sound-id :offset-assert 372) - (hover-volume float :offset-assert 376) + ((escort-actor entity-actor 2) + (escort-force vector 2 :inline) + (brutter-balloon-actor entity-actor) + (path-pos float) + (dest-pos vector :inline) + (speed float) + (height float) + (init-height float) + (battle-entity-triggered int32) + (battle-info-index int32) + (sound-id sound-id) + (hover-volume float) ) - :heap-base #x100 - :method-count-assert 58 - :size-assert #x17c - :flag-assert #x3a0100017c - (:methods - (defend-stadium-move () _type_ :state 53) - (defend-stadium-die () _type_ :state 54) - (defend-stadium-explode () _type_ :state 55) - (defend-stadium-land () _type_ :state 56) - (defend-stadium-complete () _type_ :state 57) + (:state-methods + defend-stadium-move + defend-stadium-die + defend-stadium-explode + defend-stadium-land + defend-stadium-complete ) (:states defend-stadium-wait @@ -324,7 +308,7 @@ This commonly includes things such as: ) ;; definition for method 3 of type rift-rider -(defmethod inspect rift-rider ((this rift-rider)) +(defmethod inspect ((this rift-rider)) (when (not this) (set! this this) (goto cfg-4) @@ -391,16 +375,13 @@ This commonly includes things such as: ;; definition of type rift-rider-battle-info (deftype rift-rider-battle-info (structure) - ((path-pos float :offset-assert 0) - (entity-index int32 :offset-assert 4) + ((path-pos float) + (entity-index int32) ) - :method-count-assert 9 - :size-assert #x8 - :flag-assert #x900000008 ) ;; definition for method 3 of type rift-rider-battle-info -(defmethod inspect rift-rider-battle-info ((this rift-rider-battle-info)) +(defmethod inspect ((this rift-rider-battle-info)) (when (not this) (set! this this) (goto cfg-4) @@ -660,7 +641,7 @@ This commonly includes things such as: ;; definition for method 29 of type rift-rider ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 rift-rider ((this rift-rider) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this rift-rider) (arg0 float)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -1041,7 +1022,7 @@ This commonly includes things such as: ) ;; definition for method 45 of type rift-rider -(defmethod rigid-body-object-method-45 rift-rider ((this rift-rider) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 ((this rift-rider) (arg0 rigid-body-impact)) (if (< 40960.0 (-> arg0 impulse)) (sound-play "rift-fall") ) @@ -1051,7 +1032,7 @@ This commonly includes things such as: ;; definition for method 34 of type rift-rider ;; WARN: Return type mismatch object vs none. -(defmethod rigid-body-object-method-34 rift-rider ((this rift-rider)) +(defmethod rigid-body-object-method-34 ((this rift-rider)) (cond ((nonzero? (-> this path)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 902) this)) @@ -1067,7 +1048,7 @@ This commonly includes things such as: ;; definition for method 32 of type rift-rider ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape rift-rider ((this rift-rider)) +(defmethod allocate-and-init-cshape ((this rift-rider)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1114,7 +1095,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type rift-rider -(defmethod deactivate rift-rider ((this rift-rider)) +(defmethod deactivate ((this rift-rider)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -1122,7 +1103,7 @@ This commonly includes things such as: ;; definition for method 33 of type rift-rider ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body rift-rider ((this rift-rider)) +(defmethod init-skel-and-rigid-body ((this rift-rider)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-rift-rider-no-lift" (the-as (pointer uint32) #f))) @@ -1163,17 +1144,13 @@ This commonly includes things such as: ;; definition of type spotlight (deftype spotlight (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type spotlight -(defmethod inspect spotlight ((this spotlight)) +(defmethod inspect ((this spotlight)) (when (not this) (set! this this) (goto cfg-4) @@ -1203,7 +1180,7 @@ This commonly includes things such as: ;; definition for method 11 of type spotlight ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! spotlight ((this spotlight) (arg0 entity-actor)) +(defmethod init-from-entity! ((this spotlight) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1231,14 +1208,10 @@ This commonly includes things such as: ;; definition of type gar-door (deftype gar-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type gar-door -(defmethod inspect gar-door ((this gar-door)) +(defmethod inspect ((this gar-door)) (when (not this) (set! this this) (goto cfg-4) @@ -1252,7 +1225,7 @@ This commonly includes things such as: ;; definition for method 11 of type gar-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gar-door ((this gar-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this gar-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1423,55 +1396,53 @@ This commonly includes things such as: ;; definition of type stad-samos (deftype stad-samos (process-focusable) - ((root collide-shape-moving :override) - (rift-rider-actor entity-actor :offset-assert 204) - (lightning handle 4 :offset-assert 208) - (speed float :offset-assert 240) - (observed-speed float :offset-assert 244) - (cquery-timer time-frame :offset-assert 248) - (hit-dir vector :inline :offset-assert 256) - (hit-points float :offset-assert 272) - (max-hit-points float :offset-assert 276) - (incoming-attack-id uint32 :offset-assert 280) - (falling? symbol :offset-assert 284) - (lightning-on? symbol :offset-assert 288) - (enable-move? symbol :offset-assert 292) - (focus-disable-timer time-frame :offset-assert 296) - (stand-anim int32 :offset-assert 304) - (walk-anim int32 :offset-assert 308) - (raise-ship-anim int32 :offset-assert 312) - (knocked-back-anim int32 :offset-assert 316) - (knocked-back-land-anim int32 :offset-assert 320) - (knocked-forward-anim int32 :offset-assert 324) - (knocked-forward-land-anim int32 :offset-assert 328) - (death-anim int32 :offset-assert 332) - (death-end-anim int32 :offset-assert 336) - (knocked-anim int32 :offset-assert 340) - (knocked-land-anim int32 :offset-assert 344) - (hud handle :offset-assert 352) - (hud-bot-index int32 :offset-assert 360) - (rift-rider-joint-offset int32 :offset-assert 364) - (hand-joint int32 :offset-assert 368) + ((root collide-shape-moving :override) + (rift-rider-actor entity-actor) + (lightning handle 4) + (speed float) + (observed-speed float) + (cquery-timer time-frame) + (hit-dir vector :inline) + (hit-points float) + (max-hit-points float) + (incoming-attack-id uint32) + (falling? symbol) + (lightning-on? symbol) + (enable-move? symbol) + (focus-disable-timer time-frame) + (stand-anim int32) + (walk-anim int32) + (raise-ship-anim int32) + (knocked-back-anim int32) + (knocked-back-land-anim int32) + (knocked-forward-anim int32) + (knocked-forward-land-anim int32) + (death-anim int32) + (death-end-anim int32) + (knocked-anim int32) + (knocked-land-anim int32) + (hud handle) + (hud-bot-index int32) + (rift-rider-joint-offset int32) + (hand-joint int32) ) - :heap-base #x100 - :method-count-assert 36 - :size-assert #x174 - :flag-assert #x2401000174 + (:state-methods + idle + raise-rift-rider + move-rift-rider + hit + die + ) (:methods - (idle () _type_ :state 27) - (raise-rift-rider () _type_ :state 28) - (move-rift-rider () _type_ :state 29) - (hit () _type_ :state 30) - (die () _type_ :state 31) - (init! (_type_) none 32) - (get-position (_type_) symbol 33) - (spawn-lightning (_type_) none 34) - (kill-lightning (_type_) none 35) + (init! (_type_) none) + (get-position (_type_) symbol) + (spawn-lightning (_type_) none) + (kill-lightning (_type_) none) ) ) ;; definition for method 3 of type stad-samos -(defmethod inspect stad-samos ((this stad-samos)) +(defmethod inspect ((this stad-samos)) (when (not this) (set! this this) (goto cfg-4) @@ -2107,13 +2078,13 @@ This commonly includes things such as: ) ;; definition for method 33 of type stad-samos -(defmethod get-position stad-samos ((this stad-samos)) +(defmethod get-position ((this stad-samos)) 'right ) ;; definition for method 34 of type stad-samos ;; WARN: Return type mismatch symbol vs none. -(defmethod spawn-lightning stad-samos ((this stad-samos)) +(defmethod spawn-lightning ((this stad-samos)) (let* ((v1-0 (-> this rift-rider-actor)) (s5-0 (if v1-0 (-> v1-0 extra process) @@ -2147,7 +2118,7 @@ This commonly includes things such as: ;; definition for method 35 of type stad-samos ;; WARN: Return type mismatch symbol vs none. -(defmethod kill-lightning stad-samos ((this stad-samos)) +(defmethod kill-lightning ((this stad-samos)) (dotimes (s5-0 4) (send-event (handle->process (-> this lightning s5-0)) 'die) ) @@ -2156,7 +2127,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type stad-samos -(defmethod deactivate stad-samos ((this stad-samos)) +(defmethod deactivate ((this stad-samos)) (if (valid? (-> this hud) (the-as type #f) "" #t 0) (send-event (handle->process (-> this hud)) 'hide-and-die) ) @@ -2167,7 +2138,7 @@ This commonly includes things such as: ;; definition for method 11 of type stad-samos ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-samos ((this stad-samos) (arg0 entity-actor)) +(defmethod init-from-entity! ((this stad-samos) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2262,7 +2233,7 @@ This commonly includes things such as: ;; definition for method 32 of type stad-samos ;; WARN: Return type mismatch int vs none. -(defmethod init! stad-samos ((this stad-samos)) +(defmethod init! ((this stad-samos)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-samos" (the-as (pointer uint32) #f))) @@ -2288,14 +2259,10 @@ This commonly includes things such as: ;; definition of type stad-youngsamos (deftype stad-youngsamos (stad-samos) () - :heap-base #x100 - :method-count-assert 36 - :size-assert #x174 - :flag-assert #x2401000174 ) ;; definition for method 3 of type stad-youngsamos -(defmethod inspect stad-youngsamos ((this stad-youngsamos)) +(defmethod inspect ((this stad-youngsamos)) (when (not this) (set! this this) (goto cfg-4) @@ -2380,7 +2347,7 @@ This commonly includes things such as: ;; definition for method 32 of type stad-youngsamos ;; WARN: Return type mismatch int vs none. -(defmethod init! stad-youngsamos ((this stad-youngsamos)) +(defmethod init! ((this stad-youngsamos)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-youngsamos" (the-as (pointer uint32) #f))) @@ -2403,7 +2370,7 @@ This commonly includes things such as: ) ;; definition for method 33 of type stad-youngsamos -(defmethod get-position stad-youngsamos ((this stad-youngsamos)) +(defmethod get-position ((this stad-youngsamos)) 'left ) @@ -2415,25 +2382,23 @@ This commonly includes things such as: ;; definition of type stadium-barrier (deftype stadium-barrier (process-drawable) - ((color vector :inline :offset-assert 208) - (flash vector :inline :offset-assert 224) - (flashf float :offset-assert 240) - (colorf float :offset-assert 244) + ((color vector :inline) + (flash vector :inline) + (flashf float) + (colorf float) ) - :heap-base #x80 - :method-count-assert 24 - :size-assert #xf8 - :flag-assert #x18008000f8 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (stadium-barrier-method-22 (_type_) none 22) - (stadium-barrier-method-23 (_type_) none 23) + (stadium-barrier-method-22 (_type_) none) + (stadium-barrier-method-23 (_type_) none) ) ) ;; definition for method 3 of type stadium-barrier -(defmethod inspect stadium-barrier ((this stadium-barrier)) +(defmethod inspect ((this stadium-barrier)) (when (not this) (set! this this) (goto cfg-4) @@ -2451,7 +2416,7 @@ This commonly includes things such as: ;; definition for method 22 of type stadium-barrier ;; WARN: Return type mismatch int vs none. -(defmethod stadium-barrier-method-22 stadium-barrier ((this stadium-barrier)) +(defmethod stadium-barrier-method-22 ((this stadium-barrier)) (set! (-> this root) (new 'process 'trsqv)) 0 (none) @@ -2459,7 +2424,7 @@ This commonly includes things such as: ;; definition for method 23 of type stadium-barrier ;; WARN: Return type mismatch int vs none. -(defmethod stadium-barrier-method-23 stadium-barrier ((this stadium-barrier)) +(defmethod stadium-barrier-method-23 ((this stadium-barrier)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-stadium-barrier" (the-as (pointer uint32) #f))) @@ -2506,7 +2471,7 @@ This commonly includes things such as: ;; definition for method 11 of type stadium-barrier ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! stadium-barrier ((this stadium-barrier) (arg0 entity-actor)) +(defmethod init-from-entity! ((this stadium-barrier) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2556,25 +2521,23 @@ This commonly includes things such as: ;; definition of type stad-force-field (deftype stad-force-field (process-focusable) - ((incoming-attack-id uint32 :offset-assert 204) - (plane plane :inline :offset-assert 208) - (field handle :offset-assert 224) - (ripple handle :offset-assert 232) - (next-message-time time-frame :offset-assert 240) + ((incoming-attack-id uint32) + (plane plane :inline) + (field handle) + (ripple handle) + (next-message-time time-frame) ) - :heap-base #x80 - :method-count-assert 30 - :size-assert #xf8 - :flag-assert #x1e008000f8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 27) - (stad-force-field-method-28 (_type_) none 28) - (stad-force-field-method-29 (_type_ touching-shapes-entry) int 29) + (stad-force-field-method-28 (_type_) none) + (stad-force-field-method-29 (_type_ touching-shapes-entry) int) ) ) ;; definition for method 3 of type stad-force-field -(defmethod inspect stad-force-field ((this stad-force-field)) +(defmethod inspect ((this stad-force-field)) (when (not this) (set! this this) (goto cfg-4) @@ -2593,7 +2556,7 @@ This commonly includes things such as: ;; definition for method 29 of type stad-force-field ;; INFO: Used lq/sq -(defmethod stad-force-field-method-29 stad-force-field ((this stad-force-field) (arg0 touching-shapes-entry)) +(defmethod stad-force-field-method-29 ((this stad-force-field) (arg0 touching-shapes-entry)) (local-vars (sv-256 entity-actor) (sv-272 collide-tri-result) @@ -2822,13 +2785,13 @@ This commonly includes things such as: ) ;; definition for method 12 of type stad-force-field -(defmethod run-logic? stad-force-field ((this stad-force-field)) +(defmethod run-logic? ((this stad-force-field)) #t ) ;; definition for method 28 of type stad-force-field ;; WARN: Return type mismatch int vs none. -(defmethod stad-force-field-method-28 stad-force-field ((this stad-force-field)) +(defmethod stad-force-field-method-28 ((this stad-force-field)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2872,7 +2835,7 @@ This commonly includes things such as: ;; definition for method 11 of type stad-force-field ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-force-field ((this stad-force-field) (arg0 entity-actor)) +(defmethod init-from-entity! ((this stad-force-field) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2903,14 +2866,10 @@ This commonly includes things such as: ;; definition of type stad-c-force-field (deftype stad-c-force-field (stad-force-field) () - :heap-base #x80 - :method-count-assert 30 - :size-assert #xf8 - :flag-assert #x1e008000f8 ) ;; definition for method 3 of type stad-c-force-field -(defmethod inspect stad-c-force-field ((this stad-c-force-field)) +(defmethod inspect ((this stad-c-force-field)) (when (not this) (set! this this) (goto cfg-4) @@ -2924,7 +2883,7 @@ This commonly includes things such as: ;; definition for method 11 of type stad-c-force-field ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-c-force-field ((this stad-c-force-field) (arg0 entity-actor)) +(defmethod init-from-entity! ((this stad-c-force-field) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2955,14 +2914,10 @@ This commonly includes things such as: ;; definition of type stad-d-force-field (deftype stad-d-force-field (stad-force-field) () - :heap-base #x80 - :method-count-assert 30 - :size-assert #xf8 - :flag-assert #x1e008000f8 ) ;; definition for method 3 of type stad-d-force-field -(defmethod inspect stad-d-force-field ((this stad-d-force-field)) +(defmethod inspect ((this stad-d-force-field)) (when (not this) (set! this this) (goto cfg-4) @@ -2976,7 +2931,7 @@ This commonly includes things such as: ;; definition for method 11 of type stad-d-force-field ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-d-force-field ((this stad-d-force-field) (arg0 entity-actor)) +(defmethod init-from-entity! ((this stad-d-force-field) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3001,17 +2956,13 @@ This commonly includes things such as: ;; definition of type stad-keira (deftype stad-keira (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type stad-keira -(defmethod inspect stad-keira ((this stad-keira)) +(defmethod inspect ((this stad-keira)) (when (not this) (set! this this) (goto cfg-4) @@ -3114,17 +3065,13 @@ This commonly includes things such as: ;; definition of type stad-brutter (deftype stad-brutter (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type stad-brutter -(defmethod inspect stad-brutter ((this stad-brutter)) +(defmethod inspect ((this stad-brutter)) (when (not this) (set! this this) (goto cfg-4) @@ -3225,17 +3172,13 @@ This commonly includes things such as: ;; definition of type brutter-balloon (deftype brutter-balloon (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type brutter-balloon -(defmethod inspect brutter-balloon ((this brutter-balloon)) +(defmethod inspect ((this brutter-balloon)) (when (not this) (set! this this) (goto cfg-4) @@ -3262,7 +3205,7 @@ This commonly includes things such as: ;; definition for method 11 of type brutter-balloon ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! brutter-balloon ((this brutter-balloon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this brutter-balloon) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3485,7 +3428,7 @@ This commonly includes things such as: ;; definition for method 15 of type hud-samos-old ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-samos-old ((this hud-samos-old)) +(defmethod draw ((this hud-samos-old)) (set-hud-piece-position! (-> this sprites 2) (the int (+ 30.0 (* -130.0 (-> this offset)))) @@ -3502,7 +3445,7 @@ This commonly includes things such as: ;; definition for method 16 of type hud-samos-old ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-samos-old ((this hud-samos-old)) +(defmethod update-values ((this hud-samos-old)) (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 1)))) ((method-of-type hud update-values) this) 0 @@ -3511,7 +3454,7 @@ This commonly includes things such as: ;; definition for method 17 of type hud-samos-old ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-samos-old ((this hud-samos-old)) +(defmethod init-callback ((this hud-samos-old)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-center-left) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-part_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-part_REF.gc index 318e0f5fad4..79decd507fa 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type stadium-part (deftype stadium-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type stadium-part -(defmethod inspect stadium-part ((this stadium-part)) +(defmethod inspect ((this stadium-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-race-obs_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-race-obs_REF.gc index 0b03fd96ad7..689db1b25ba 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-race-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-race-obs_REF.gc @@ -3,22 +3,20 @@ ;; definition of type stdmb-race-hatch (deftype stdmb-race-hatch (process-drawable) - ((tt float :offset-assert 200) - (tt-target float :offset-assert 204) + ((tt float) + (tt-target float) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xd0 - :flag-assert #x17005000d0 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (stdmb-race-hatch-method-21 (_type_) none 21) - (stdmb-race-hatch-method-22 (_type_) none 22) + (stdmb-race-hatch-method-21 (_type_) none) + (stdmb-race-hatch-method-22 (_type_) none) ) ) ;; definition for method 3 of type stdmb-race-hatch -(defmethod inspect stdmb-race-hatch ((this stdmb-race-hatch)) +(defmethod inspect ((this stdmb-race-hatch)) (when (not this) (set! this this) (goto cfg-4) @@ -68,7 +66,7 @@ ;; definition for method 21 of type stdmb-race-hatch ;; WARN: Return type mismatch int vs none. -(defmethod stdmb-race-hatch-method-21 stdmb-race-hatch ((this stdmb-race-hatch)) +(defmethod stdmb-race-hatch-method-21 ((this stdmb-race-hatch)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -111,7 +109,7 @@ ;; definition for method 22 of type stdmb-race-hatch ;; WARN: Return type mismatch int vs none. -(defmethod stdmb-race-hatch-method-22 stdmb-race-hatch ((this stdmb-race-hatch)) +(defmethod stdmb-race-hatch-method-22 ((this stdmb-race-hatch)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-stdmb-race-hatch" (the-as (pointer uint32) #f))) @@ -132,7 +130,7 @@ ) ;; definition for method 11 of type stdmb-race-hatch -(defmethod init-from-entity! stdmb-race-hatch ((this stdmb-race-hatch) (arg0 entity-actor)) +(defmethod init-from-entity! ((this stdmb-race-hatch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -158,14 +156,10 @@ This commonly includes things such as: ;; definition of type stdmb-platform (deftype stdmb-platform (stdmb-race-hatch) () - :heap-base #x50 - :method-count-assert 23 - :size-assert #xd0 - :flag-assert #x17005000d0 ) ;; definition for method 3 of type stdmb-platform -(defmethod inspect stdmb-platform ((this stdmb-platform)) +(defmethod inspect ((this stdmb-platform)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc index f62bfe2862a..3193b5166ee 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc @@ -3214,14 +3214,10 @@ ;; definition of type keira-npc (deftype keira-npc (process-taskable) () - :heap-base #xa0 - :method-count-assert 38 - :size-assert #x120 - :flag-assert #x2600a00120 ) ;; definition for method 3 of type keira-npc -(defmethod inspect keira-npc ((this keira-npc)) +(defmethod inspect ((this keira-npc)) (when (not this) (set! this this) (goto cfg-4) @@ -3235,7 +3231,7 @@ ;; definition for method 33 of type keira-npc ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-art! keira-npc ((this keira-npc)) +(defmethod init-art! ((this keira-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton this @@ -3246,7 +3242,7 @@ ) ;; definition for method 35 of type keira-npc -(defmethod get-art-elem keira-npc ((this keira-npc)) +(defmethod get-art-elem ((this keira-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (case (-> this task actor) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadiumb-part_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadiumb-part_REF.gc index 609b0d3b638..35a3a3f7a9f 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadiumb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadiumb-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type stadiumb-part (deftype stadiumb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type stadiumb-part -(defmethod inspect stadiumb-part ((this stadiumb-part)) +(defmethod inspect ((this stadiumb-part)) (when (not this) (set! this this) (goto cfg-4) @@ -26,14 +22,10 @@ ;; definition of type stadiumc-part (deftype stadiumc-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type stadiumc-part -(defmethod inspect stadiumc-part ((this stadiumc-part)) +(defmethod inspect ((this stadiumc-part)) (when (not this) (set! this this) (goto cfg-4) @@ -48,14 +40,10 @@ ;; definition of type stadiumd-part (deftype stadiumd-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type stadiumd-part -(defmethod inspect stadiumd-part ((this stadiumd-part)) +(defmethod inspect ((this stadiumd-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/strip/chaincrate_REF.gc b/test/decompiler/reference/jak2/levels/strip/chaincrate_REF.gc index d6879d49315..3decb30a6c9 100644 --- a/test/decompiler/reference/jak2/levels/strip/chaincrate_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/chaincrate_REF.gc @@ -77,25 +77,23 @@ ;; definition of type strip-chain-crate-slave (deftype strip-chain-crate-slave (process-drawable) - ((part2 sparticle-launch-control :offset-assert 200) - (path-u float :offset-assert 204) - (path-speed float :offset-assert 208) - (guide-sound-mask uint32 :offset-assert 212) - (guide-num int8 :offset-assert 216) + ((part2 sparticle-launch-control) + (path-u float) + (path-speed float) + (guide-sound-mask uint32) + (guide-num int8) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xd9 - :flag-assert #x17006000d9 + (:state-methods + die-fast + moving + ) (:methods - (die-fast () _type_ :state 20) - (moving () _type_ :state 21) - (strip-chain-crate-slave-method-22 (_type_) none 22) + (strip-chain-crate-slave-method-22 (_type_) none) ) ) ;; definition for method 3 of type strip-chain-crate-slave -(defmethod inspect strip-chain-crate-slave ((this strip-chain-crate-slave)) +(defmethod inspect ((this strip-chain-crate-slave)) (when (not this) (set! this this) (goto cfg-4) @@ -132,7 +130,7 @@ ;; definition for method 22 of type strip-chain-crate-slave ;; WARN: Return type mismatch rgbaf vs none. -(defmethod strip-chain-crate-slave-method-22 strip-chain-crate-slave ((this strip-chain-crate-slave)) +(defmethod strip-chain-crate-slave-method-22 ((this strip-chain-crate-slave)) (let ((f0-0 (-> this path-u))) (cond ((>= 0.09 f0-0) @@ -268,7 +266,7 @@ ) ;; definition for method 10 of type strip-chain-crate-slave -(defmethod deactivate strip-chain-crate-slave ((this strip-chain-crate-slave)) +(defmethod deactivate ((this strip-chain-crate-slave)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -278,7 +276,7 @@ ;; definition for method 7 of type strip-chain-crate-slave ;; WARN: Return type mismatch process-drawable vs strip-chain-crate-slave. -(defmethod relocate strip-chain-crate-slave ((this strip-chain-crate-slave) (arg0 int)) +(defmethod relocate ((this strip-chain-crate-slave) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -287,25 +285,23 @@ ;; definition of type strip-chain-crate (deftype strip-chain-crate (process-drawable) - ((spawn-pos vector :inline :offset-assert 208) - (next-spawn-time time-frame :offset-assert 224) - (spawn-delay uint32 :offset-assert 232) - (spawn-offset uint32 :offset-assert 236) - (dist-apart float :offset-assert 240) - (crate-speed float :offset-assert 244) + ((spawn-pos vector :inline) + (next-spawn-time time-frame) + (spawn-delay uint32) + (spawn-offset uint32) + (dist-apart float) + (crate-speed float) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf8 - :flag-assert #x16008000f8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (strip-chain-crate-method-21 (_type_) none 21) + (strip-chain-crate-method-21 (_type_) none) ) ) ;; definition for method 3 of type strip-chain-crate -(defmethod inspect strip-chain-crate ((this strip-chain-crate)) +(defmethod inspect ((this strip-chain-crate)) (when (not this) (set! this this) (goto cfg-4) @@ -325,7 +321,7 @@ ;; definition for method 21 of type strip-chain-crate ;; WARN: Return type mismatch symbol vs none. -(defmethod strip-chain-crate-method-21 strip-chain-crate ((this strip-chain-crate)) +(defmethod strip-chain-crate-method-21 ((this strip-chain-crate)) (let ((f30-0 (total-distance (-> this path))) (f28-0 (* (/ (the float @@ -365,7 +361,7 @@ ;; definition for method 11 of type strip-chain-crate ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! strip-chain-crate ((this strip-chain-crate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this strip-chain-crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc index 0cbffdc0f7b..49ee364a6fc 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc @@ -205,22 +205,20 @@ ;; definition of type strip-game-crate (deftype strip-game-crate (process-drawable) - ((local-offset vector :inline :offset-assert 208) - (swing-angle vector :inline :offset-assert 224) + ((local-offset vector :inline) + (swing-angle vector :inline) ) - :heap-base #x70 - :method-count-assert 23 - :size-assert #xf0 - :flag-assert #x17007000f0 + (:state-methods + idle + final-position + ) (:methods - (idle () _type_ :state 20) - (final-position () _type_ :state 21) - (strip-game-crate-method-22 (_type_ vector quaternion) none 22) + (strip-game-crate-method-22 (_type_ vector quaternion) none) ) ) ;; definition for method 3 of type strip-game-crate -(defmethod inspect strip-game-crate ((this strip-game-crate)) +(defmethod inspect ((this strip-game-crate)) (when (not this) (set! this this) (goto cfg-4) @@ -282,7 +280,7 @@ ;; definition for method 22 of type strip-game-crate ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod strip-game-crate-method-22 strip-game-crate ((this strip-game-crate) (arg0 vector) (arg1 quaternion)) +(defmethod strip-game-crate-method-22 ((this strip-game-crate) (arg0 vector) (arg1 quaternion)) (set! (-> this root trans quad) (-> arg0 quad)) (let ((s4-0 (new 'stack-no-clear 'quaternion))) (quaternion-rotate-z! s4-0 arg1 (-> this swing-angle z)) @@ -337,25 +335,21 @@ ;; definition of type crane (deftype crane (process-drawable) - ((angle-vel float :offset-assert 200) - (angle float :offset-assert 204) - (init-quat quaternion :inline :offset-assert 208) - (final-quat quaternion :inline :offset-assert 224) - (crate (pointer strip-game-crate) :offset-assert 240) + ((angle-vel float) + (angle float) + (init-quat quaternion :inline) + (final-quat quaternion :inline) + (crate (pointer strip-game-crate)) ) - :heap-base #x80 - :method-count-assert 23 - :size-assert #xf4 - :flag-assert #x17008000f4 - (:methods - (idle () _type_ :state 20) - (swinging () _type_ :state 21) - (final-position () _type_ :state 22) + (:state-methods + idle + swinging + final-position ) ) ;; definition for method 3 of type crane -(defmethod inspect crane ((this crane)) +(defmethod inspect ((this crane)) (when (not this) (set! this this) (goto cfg-4) @@ -373,7 +367,7 @@ ) ;; definition for method 10 of type crane -(defmethod deactivate crane ((this crane)) +(defmethod deactivate ((this crane)) (if (-> this crate) (deactivate (-> this crate 0)) ) @@ -468,7 +462,7 @@ ;; definition for method 11 of type crane ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! crane ((this crane) (arg0 entity-actor)) +(defmethod init-from-entity! ((this crane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -499,21 +493,17 @@ This commonly includes things such as: ;; definition of type cranecrate (deftype cranecrate (process-drawable) - ((root collide-shape :override) - (unknown-pad-n12jn3123123 int32 52 :offset-assert 200) + ((root collide-shape :override) + (unknown-pad-n12jn3123123 int32 52) ) - :heap-base #x120 - :method-count-assert 22 - :size-assert #x198 - :flag-assert #x1601200198 - (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) + (:state-methods + idle + hidden ) ) ;; definition for method 3 of type cranecrate -(defmethod inspect cranecrate ((this cranecrate)) +(defmethod inspect ((this cranecrate)) (when (not this) (set! this this) (goto cfg-4) @@ -563,7 +553,7 @@ This commonly includes things such as: ;; definition for method 11 of type cranecrate ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cranecrate ((this cranecrate) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cranecrate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -615,23 +605,21 @@ This commonly includes things such as: ;; definition of type grunt-egg (deftype grunt-egg (process-drawable) - ((idle-anim-player idle-control :inline :offset-assert 208) - (attack-id uint32 :offset-assert 224) + ((idle-anim-player idle-control :inline) + (attack-id uint32) ) - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe4 - :flag-assert #x18007000e4 + (:state-methods + idle + die + ) (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (grunt-egg-method-22 (_type_) none 22) - (grunt-egg-method-23 (_type_) vector4w-2 23) + (grunt-egg-method-22 (_type_) none) + (grunt-egg-method-23 (_type_) vector4w-2) ) ) ;; definition for method 3 of type grunt-egg -(defmethod inspect grunt-egg ((this grunt-egg)) +(defmethod inspect ((this grunt-egg)) (when (not this) (set! this this) (goto cfg-4) @@ -759,7 +747,7 @@ This commonly includes things such as: ;; definition for method 11 of type grunt-egg ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! grunt-egg ((this grunt-egg) (arg0 entity-actor)) +(defmethod init-from-entity! ((this grunt-egg) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -818,14 +806,10 @@ This commonly includes things such as: ;; definition of type grunt-egg-a (deftype grunt-egg-a (grunt-egg) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe4 - :flag-assert #x18007000e4 ) ;; definition for method 3 of type grunt-egg-a -(defmethod inspect grunt-egg-a ((this grunt-egg-a)) +(defmethod inspect ((this grunt-egg-a)) (when (not this) (set! this this) (goto cfg-4) @@ -840,14 +824,10 @@ This commonly includes things such as: ;; definition of type grunt-egg-b (deftype grunt-egg-b (grunt-egg) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe4 - :flag-assert #x18007000e4 ) ;; definition for method 3 of type grunt-egg-b -(defmethod inspect grunt-egg-b ((this grunt-egg-b)) +(defmethod inspect ((this grunt-egg-b)) (when (not this) (set! this this) (goto cfg-4) @@ -862,14 +842,10 @@ This commonly includes things such as: ;; definition of type grunt-egg-c (deftype grunt-egg-c (grunt-egg) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe4 - :flag-assert #x18007000e4 ) ;; definition for method 3 of type grunt-egg-c -(defmethod inspect grunt-egg-c ((this grunt-egg-c)) +(defmethod inspect ((this grunt-egg-c)) (when (not this) (set! this this) (goto cfg-4) @@ -884,14 +860,10 @@ This commonly includes things such as: ;; definition of type grunt-egg-d (deftype grunt-egg-d (grunt-egg) () - :heap-base #x70 - :method-count-assert 24 - :size-assert #xe4 - :flag-assert #x18007000e4 ) ;; definition for method 3 of type grunt-egg-d -(defmethod inspect grunt-egg-d ((this grunt-egg-d)) +(defmethod inspect ((this grunt-egg-d)) (when (not this) (set! this this) (goto cfg-4) @@ -905,7 +877,7 @@ This commonly includes things such as: ;; definition for method 22 of type grunt-egg-a ;; WARN: Return type mismatch draw-control vs none. -(defmethod grunt-egg-method-22 grunt-egg-a ((this grunt-egg-a)) +(defmethod grunt-egg-method-22 ((this grunt-egg-a)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-a" (the-as (pointer uint32) #f))) @@ -915,13 +887,13 @@ This commonly includes things such as: ) ;; definition for method 23 of type grunt-egg-a -(defmethod grunt-egg-method-23 grunt-egg-a ((this grunt-egg-a)) +(defmethod grunt-egg-method-23 ((this grunt-egg-a)) *grunt-egg-a-script* ) ;; definition for method 22 of type grunt-egg-b ;; WARN: Return type mismatch connection vs none. -(defmethod grunt-egg-method-22 grunt-egg-b ((this grunt-egg-b)) +(defmethod grunt-egg-method-22 ((this grunt-egg-b)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-b" (the-as (pointer uint32) #f))) @@ -933,13 +905,13 @@ This commonly includes things such as: ) ;; definition for method 23 of type grunt-egg-b -(defmethod grunt-egg-method-23 grunt-egg-b ((this grunt-egg-b)) +(defmethod grunt-egg-method-23 ((this grunt-egg-b)) *grunt-egg-b-script* ) ;; definition for method 22 of type grunt-egg-c ;; WARN: Return type mismatch connection vs none. -(defmethod grunt-egg-method-22 grunt-egg-c ((this grunt-egg-c)) +(defmethod grunt-egg-method-22 ((this grunt-egg-c)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-c" (the-as (pointer uint32) #f))) @@ -950,13 +922,13 @@ This commonly includes things such as: ) ;; definition for method 23 of type grunt-egg-c -(defmethod grunt-egg-method-23 grunt-egg-c ((this grunt-egg-c)) +(defmethod grunt-egg-method-23 ((this grunt-egg-c)) *grunt-egg-c-script* ) ;; definition for method 22 of type grunt-egg-d ;; WARN: Return type mismatch connection vs none. -(defmethod grunt-egg-method-22 grunt-egg-d ((this grunt-egg-d)) +(defmethod grunt-egg-method-22 ((this grunt-egg-d)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-d" (the-as (pointer uint32) #f))) @@ -967,6 +939,6 @@ This commonly includes things such as: ) ;; definition for method 23 of type grunt-egg-d -(defmethod grunt-egg-method-23 grunt-egg-d ((this grunt-egg-d)) +(defmethod grunt-egg-method-23 ((this grunt-egg-d)) *grunt-egg-d-script* ) diff --git a/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc index bfffc3cd25b..cfb92f3b286 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc @@ -3,7 +3,7 @@ ;; definition for method 15 of type hud-plasmite ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-plasmite ((this hud-plasmite)) +(defmethod draw ((this hud-plasmite)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 457.0 (* 130.0 (-> this offset)))) @@ -18,7 +18,7 @@ ;; definition for method 16 of type hud-plasmite ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-plasmite ((this hud-plasmite)) +(defmethod update-values ((this hud-plasmite)) (set! (-> this values 0 target) (the int (-> *game-info* counter))) ((method-of-type hud update-values) this) 0 @@ -27,7 +27,7 @@ ;; definition for method 17 of type hud-plasmite ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-plasmite ((this hud-plasmite)) +(defmethod init-callback ((this hud-plasmite)) (set! (-> this level) (level-get *level* 'strip)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) @@ -46,23 +46,19 @@ ;; definition of type strip-hazard (deftype strip-hazard (process-drawable) - ((root collide-shape-moving :override) - (sync sync-linear :inline :offset-assert 200) - (shove-vec vector :inline :offset-assert 224) - (no-collision-timer uint64 :offset-assert 240) - (attack-id uint32 :offset-assert 248) + ((root collide-shape-moving :override) + (sync sync-linear :inline) + (shove-vec vector :inline) + (no-collision-timer uint64) + (attack-id uint32) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #xfc - :flag-assert #x15008000fc - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type strip-hazard -(defmethod inspect strip-hazard ((this strip-hazard)) +(defmethod inspect ((this strip-hazard)) (when (not this) (set! this this) (goto cfg-4) @@ -173,7 +169,7 @@ ;; definition for method 11 of type strip-hazard ;; INFO: Used lq/sq -(defmethod init-from-entity! strip-hazard ((this strip-hazard) (arg0 entity-actor)) +(defmethod init-from-entity! ((this strip-hazard) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -218,19 +214,15 @@ This commonly includes things such as: ;; definition of type fencespikes (deftype fencespikes (strip-hazard) - ((start-quat quaternion :inline :offset-assert 256) - (spin float :offset-assert 272) - (offset float :offset-assert 276) - (sparks-group uint32 :offset-assert 280) + ((start-quat quaternion :inline) + (spin float) + (offset float) + (sparks-group uint32) ) - :heap-base #xa0 - :method-count-assert 21 - :size-assert #x11c - :flag-assert #x1500a0011c ) ;; definition for method 3 of type fencespikes -(defmethod inspect fencespikes ((this fencespikes)) +(defmethod inspect ((this fencespikes)) (when (not this) (set! this this) (goto cfg-4) @@ -281,7 +273,7 @@ This commonly includes things such as: ;; definition for method 11 of type fencespikes ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fencespikes ((this fencespikes) (arg0 entity-actor)) +(defmethod init-from-entity! ((this fencespikes) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -350,16 +342,12 @@ This commonly includes things such as: ;; definition of type pitspikes (deftype pitspikes (strip-hazard) - ((spinner basic :offset-assert 252) + ((spinner basic) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #x100 - :flag-assert #x1500800100 ) ;; definition for method 3 of type pitspikes -(defmethod inspect pitspikes ((this pitspikes)) +(defmethod inspect ((this pitspikes)) (when (not this) (set! this this) (goto cfg-4) @@ -433,7 +421,7 @@ This commonly includes things such as: ) ;; definition for method 7 of type pitspikes -(defmethod relocate pitspikes ((this pitspikes) (arg0 int)) +(defmethod relocate ((this pitspikes) (arg0 int)) (if (nonzero? (-> this spinner)) (&+! (-> this spinner) arg0) ) @@ -442,7 +430,7 @@ This commonly includes things such as: ;; definition for method 11 of type pitspikes ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pitspikes ((this pitspikes) (arg0 entity-actor)) +(defmethod init-from-entity! ((this pitspikes) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -496,14 +484,10 @@ This commonly includes things such as: ;; definition of type curtainsaw (deftype curtainsaw (strip-hazard) () - :heap-base #x80 - :method-count-assert 21 - :size-assert #xfc - :flag-assert #x15008000fc ) ;; definition for method 3 of type curtainsaw -(defmethod inspect curtainsaw ((this curtainsaw)) +(defmethod inspect ((this curtainsaw)) (when (not this) (set! this this) (goto cfg-4) @@ -559,7 +543,7 @@ This commonly includes things such as: ;; definition for method 11 of type curtainsaw ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! curtainsaw ((this curtainsaw) (arg0 entity-actor)) +(defmethod init-from-entity! ((this curtainsaw) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -611,31 +595,27 @@ This commonly includes things such as: ;; definition of type grenade-point (deftype grenade-point (process-drawable) - ((root collide-shape :override) - (camera-name string :offset-assert 200) - (parented? symbol :offset-assert 204) - (lightning-time time-frame :offset-assert 208) - (strike-table (array vector) :offset-assert 216) - (last-strike-index int32 :offset-assert 220) - (speed meters :offset-assert 224) - (part2 sparticle-launch-control :offset-assert 228) - (part3 sparticle-launch-control :offset-assert 232) - (part-lightning-hit sparticle-launch-control :offset-assert 236) - (enter-time time-frame :offset-assert 240) - (minimap connection-minimap :offset-assert 248) + ((root collide-shape :override) + (camera-name string) + (parented? symbol) + (lightning-time time-frame) + (strike-table (array vector)) + (last-strike-index int32) + (speed meters) + (part2 sparticle-launch-control) + (part3 sparticle-launch-control) + (part-lightning-hit sparticle-launch-control) + (enter-time time-frame) + (minimap connection-minimap) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xfc - :flag-assert #x16008000fc - (:methods - (idle () _type_ :state 20) - (die (symbol) _type_ :state 21) + (:state-methods + idle + (die symbol) ) ) ;; definition for method 3 of type grenade-point -(defmethod inspect grenade-point ((this grenade-point)) +(defmethod inspect ((this grenade-point)) (when (not this) (set! this this) (goto cfg-4) @@ -660,7 +640,7 @@ This commonly includes things such as: ;; definition for method 7 of type grenade-point ;; WARN: Return type mismatch process-drawable vs grenade-point. -(defmethod relocate grenade-point ((this grenade-point) (arg0 int)) +(defmethod relocate ((this grenade-point) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) @@ -674,7 +654,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type grenade-point -(defmethod deactivate grenade-point ((this grenade-point)) +(defmethod deactivate ((this grenade-point)) (if (nonzero? (-> this part2)) (kill-and-free-particles (-> this part2)) ) @@ -974,7 +954,7 @@ This commonly includes things such as: ;; definition for method 11 of type grenade-point ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! grenade-point ((this grenade-point) (arg0 entity-actor)) +(defmethod init-from-entity! ((this grenade-point) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1034,22 +1014,18 @@ This commonly includes things such as: ;; definition of type grenade (deftype grenade (projectile) - ((tumble-quat quaternion :inline :offset-assert 480) - (blast-radius float :offset-assert 496) - (end-target handle :offset-assert 504) + ((tumble-quat quaternion :inline) + (blast-radius float) + (end-target handle) ) - :heap-base #x180 - :method-count-assert 42 - :size-assert #x200 - :flag-assert #x2a01800200 (:methods - (grenade-method-40 (_type_) none 40) - (grenade-method-41 (_type_) none 41) + (grenade-method-40 (_type_) none) + (grenade-method-41 (_type_) none) ) ) ;; definition for method 3 of type grenade -(defmethod inspect grenade ((this grenade)) +(defmethod inspect ((this grenade)) (when (not this) (set! this this) (goto cfg-4) @@ -1250,7 +1226,7 @@ This commonly includes things such as: ;; definition for method 24 of type grenade ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight grenade ((this grenade)) +(defmethod draw-laser-sight ((this grenade)) "TODO - confirm If applicable, draw the laser sight particles" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -1293,7 +1269,7 @@ This commonly includes things such as: ;; definition for method 25 of type grenade ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles grenade ((this grenade)) +(defmethod spawn-impact-particles ((this grenade)) "Spawns associated particles with the projectile if applicable" ((method-of-type projectile spawn-impact-particles) this) (ja-post) @@ -1304,7 +1280,7 @@ This commonly includes things such as: ;; definition for method 26 of type grenade ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles grenade ((this grenade)) +(defmethod spawn-shell-particles ((this grenade)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -1347,7 +1323,7 @@ This commonly includes things such as: ;; definition for method 28 of type grenade ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound grenade ((this grenade) (arg0 projectile-options)) +(defmethod play-impact-sound ((this grenade) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -1450,7 +1426,7 @@ This commonly includes things such as: ;; definition for method 40 of type grenade ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod grenade-method-40 grenade ((this grenade)) +(defmethod grenade-method-40 ((this grenade)) (let ((s5-0 (the-as process-drawable (-> this end-target process 0)))) (when s5-0 (set! (-> this root transv x) (* 4.0 (- (-> s5-0 root trans x) (-> this root trans x)))) @@ -1474,7 +1450,7 @@ This commonly includes things such as: ;; definition for method 41 of type grenade ;; WARN: Return type mismatch int vs none. -(defmethod grenade-method-41 grenade ((this grenade)) +(defmethod grenade-method-41 ((this grenade)) (quaternion*! (-> this root quat) (-> this root quat) (-> this tumble-quat)) (projectile-move-fill-all-dirs this) (set-setting! 'point-of-interest 'abs (-> this root trans) 0) @@ -1484,7 +1460,7 @@ This commonly includes things such as: ;; definition for method 30 of type grenade ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-proj-collision! grenade ((this grenade)) +(defmethod init-proj-collision! ((this grenade)) "Init the [[projectile]]'s [[collide-shape]]" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1516,7 +1492,7 @@ This commonly includes things such as: ) ;; definition for method 31 of type grenade -(defmethod init-proj-settings! grenade ((this grenade)) +(defmethod init-proj-settings! ((this grenade)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (with-pp (initialize-skeleton @@ -1719,16 +1695,12 @@ This commonly includes things such as: ;; definition of type drill-plat (deftype drill-plat (strip-hazard) - ((plat-sound ambient-sound :offset-assert 252) + ((plat-sound ambient-sound) ) - :heap-base #x80 - :method-count-assert 21 - :size-assert #x100 - :flag-assert #x1500800100 ) ;; definition for method 3 of type drill-plat -(defmethod inspect drill-plat ((this drill-plat)) +(defmethod inspect ((this drill-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -1743,7 +1715,7 @@ This commonly includes things such as: ;; definition for method 7 of type drill-plat ;; WARN: Return type mismatch process-drawable vs drill-plat. -(defmethod relocate drill-plat ((this drill-plat) (arg0 int)) +(defmethod relocate ((this drill-plat) (arg0 int)) (if (nonzero? (-> this plat-sound)) (&+! (-> this plat-sound) arg0) ) @@ -1751,7 +1723,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type drill-plat -(defmethod deactivate drill-plat ((this drill-plat)) +(defmethod deactivate ((this drill-plat)) (if (nonzero? (-> this plat-sound)) (stop! (-> this plat-sound)) ) @@ -1824,7 +1796,7 @@ This commonly includes things such as: ;; definition for method 11 of type drill-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-plat ((this drill-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this drill-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/strip/strip-part_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-part_REF.gc index 40aeae604b2..bf7785105f4 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type strip-part (deftype strip-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type strip-part -(defmethod inspect strip-part ((this strip-part)) +(defmethod inspect ((this strip-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/strip/strip-rescue_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-rescue_REF.gc index 758a89f1f74..f8f10f095e2 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-rescue_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-rescue_REF.gc @@ -9,21 +9,17 @@ ;; definition of type cntrlrm-door (deftype cntrlrm-door (process-drawable) - ((root collide-shape :override) - (unknown-pad-k1jhb2n3k1j int32 52 :offset-assert 200) + ((root collide-shape :override) + (unknown-pad-k1jhb2n3k1j int32 52) ) - :heap-base #x120 - :method-count-assert 22 - :size-assert #x198 - :flag-assert #x1601200198 - (:methods - (idle () _type_ :state 20) - (opened () _type_ :state 21) + (:state-methods + idle + opened ) ) ;; definition for method 3 of type cntrlrm-door -(defmethod inspect cntrlrm-door ((this cntrlrm-door)) +(defmethod inspect ((this cntrlrm-door)) (when (not this) (set! this this) (goto cfg-4) @@ -63,7 +59,7 @@ ;; definition for method 11 of type cntrlrm-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cntrlrm-door ((this cntrlrm-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cntrlrm-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -129,20 +125,16 @@ This commonly includes things such as: ;; definition of type cntrlrm-button (deftype cntrlrm-button (process-drawable) - ((root collide-shape :override) - (unknown-pad-n12jn3123123 int32 52 :offset-assert 200) + ((root collide-shape :override) + (unknown-pad-n12jn3123123 int32 52) ) - :heap-base #x120 - :method-count-assert 21 - :size-assert #x198 - :flag-assert #x1501200198 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type cntrlrm-button -(defmethod inspect cntrlrm-button ((this cntrlrm-button)) +(defmethod inspect ((this cntrlrm-button)) (when (not this) (set! this this) (goto cfg-4) @@ -169,7 +161,7 @@ This commonly includes things such as: ;; definition for method 11 of type cntrlrm-button ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cntrlrm-button ((this cntrlrm-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cntrlrm-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc b/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc index 179481488c2..2ea5a61382c 100644 --- a/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc @@ -3,34 +3,30 @@ ;; definition of type title-control (deftype title-control (process) - ((selected int32 :offset-assert 128) - (sprites hud-sprite 2 :inline :offset-assert 144) - (sprite-pos vector :inline :offset-assert 272) - (sprite-draw uint32 :offset-assert 288) - (buffer external-art-buffer 2 :offset-assert 292) - (want int32 2 :offset-assert 300) - (want-name string 2 :offset-assert 308) - (have int32 2 :offset-assert 316) - (draw int32 :offset-assert 324) - (draw-name string :offset-assert 328) - (active symbol :offset-assert 332) - (spark-time time-frame :offset-assert 336) - (gui-id sound-id :offset-assert 344) + ((selected int32) + (sprites hud-sprite 2 :inline) + (sprite-pos vector :inline) + (sprite-draw uint32) + (buffer external-art-buffer 2) + (want int32 2) + (want-name string 2) + (have int32 2) + (draw int32) + (draw-name string) + (active symbol) + (spark-time time-frame) + (gui-id sound-id) ) - :heap-base #xe0 - :method-count-assert 18 - :size-assert #x15c - :flag-assert #x1200e0015c - (:methods - (startup () _type_ :state 14) - (wait () _type_ :state 15) - (idle () _type_ :state 16) - (scrap-book (int) _type_ :state 17) + (:state-methods + startup + wait + idle + (scrap-book int) ) ) ;; definition for method 3 of type title-control -(defmethod inspect title-control ((this title-control)) +(defmethod inspect ((this title-control)) (when (not this) (set! this this) (goto cfg-7) @@ -60,7 +56,7 @@ ;; definition for method 7 of type title-control ;; WARN: Return type mismatch process vs title-control. -(defmethod relocate title-control ((this title-control) (arg0 int)) +(defmethod relocate ((this title-control) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this buffer v1-0)) (&+! (-> this buffer v1-0) arg0) @@ -70,7 +66,7 @@ ) ;; definition for method 10 of type title-control -(defmethod deactivate title-control ((this title-control)) +(defmethod deactivate ((this title-control)) (dotimes (s5-0 2) (set-pending-file (-> this buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/monster-frog_REF.gc b/test/decompiler/reference/jak2/levels/tomb/monster-frog_REF.gc index 08bfdf97acd..fa1bacdc1ed 100644 --- a/test/decompiler/reference/jak2/levels/tomb/monster-frog_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/monster-frog_REF.gc @@ -12,19 +12,15 @@ ;; definition of type monster-frog (deftype monster-frog (nav-enemy) () - :heap-base #x1e0 - :method-count-assert 181 - :size-assert #x25c - :flag-assert #xb501e0025c - (:methods - (attack (vector) _type_ :state 178) - (attack-recover () _type_ :state 179) - (turn () _type_ :state 180) + (:state-methods + (attack vector) + attack-recover + turn ) ) ;; definition for method 3 of type monster-frog -(defmethod inspect monster-frog ((this monster-frog)) +(defmethod inspect ((this monster-frog)) (when (not this) (set! this this) (goto cfg-4) @@ -771,7 +767,7 @@ ) ;; definition for method 77 of type monster-frog -(defmethod enemy-method-77 monster-frog ((this monster-frog) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this monster-frog) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 0) @@ -832,7 +828,7 @@ ) ;; definition for method 78 of type monster-frog -(defmethod enemy-method-78 monster-frog ((this monster-frog) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this monster-frog) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.17)) @@ -893,7 +889,7 @@ ) ;; definition for method 55 of type monster-frog -(defmethod track-target! monster-frog ((this monster-frog)) +(defmethod track-target! ((this monster-frog)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -905,7 +901,7 @@ ;; definition for method 114 of type monster-frog ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! monster-frog ((this monster-frog)) +(defmethod init-enemy-collision! ((this monster-frog)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -970,7 +966,7 @@ ;; definition for method 115 of type monster-frog ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! monster-frog ((this monster-frog)) +(defmethod init-enemy! ((this monster-frog)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc b/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc index 6b948dfbe44..a5a57a79204 100644 --- a/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc @@ -3,17 +3,14 @@ ;; definition of type indax-info (deftype indax-info (basic) - ((indax-start-time time-frame :offset-assert 8) - (indax-time time-frame :offset-assert 16) - (art-group-backup art-group :offset-assert 24) + ((indax-start-time time-frame) + (indax-time time-frame) + (art-group-backup art-group) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type indax-info -(defmethod inspect indax-info ((this indax-info)) +(defmethod inspect ((this indax-info)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-baby-spider_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-baby-spider_REF.gc index 248abaf000b..3da84c96525 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-baby-spider_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-baby-spider_REF.gc @@ -4,18 +4,14 @@ ;; definition of type tomb-baby-spider (deftype tomb-baby-spider (nav-enemy) () - :heap-base #x1e0 - :method-count-assert 180 - :size-assert #x25c - :flag-assert #xb401e0025c - (:methods - (attack () _type_ :state 178) - (attack-stop () _type_ :state 179) + (:state-methods + attack + attack-stop ) ) ;; definition for method 3 of type tomb-baby-spider -(defmethod inspect tomb-baby-spider ((this tomb-baby-spider)) +(defmethod inspect ((this tomb-baby-spider)) (when (not this) (set! this this) (goto cfg-4) @@ -447,7 +443,7 @@ ) ;; definition for method 77 of type tomb-baby-spider -(defmethod enemy-method-77 tomb-baby-spider ((this tomb-baby-spider) (arg0 (pointer float))) +(defmethod enemy-method-77 ((this tomb-baby-spider) (arg0 (pointer float))) (let* ((a2-0 (the-as collide-shape-prim-group (-> this root root-prim))) (v1-2 (-> a2-0 child 3)) ) @@ -492,7 +488,7 @@ ) ;; definition for method 78 of type tomb-baby-spider -(defmethod enemy-method-78 tomb-baby-spider ((this tomb-baby-spider) (arg0 (pointer float))) +(defmethod enemy-method-78 ((this tomb-baby-spider) (arg0 (pointer float))) (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let ((v1-3 (-> this skel root-channel 0))) @@ -525,7 +521,7 @@ ) ;; definition for method 79 of type tomb-baby-spider -(defmethod enemy-method-79 tomb-baby-spider ((this tomb-baby-spider) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ((this tomb-baby-spider) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((3) (let ((s4-0 (ja-done? 0))) @@ -593,7 +589,7 @@ ) ;; definition for method 104 of type tomb-baby-spider -(defmethod enemy-method-104 tomb-baby-spider ((this tomb-baby-spider) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ((this tomb-baby-spider) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (let* ((s1-0 arg0) (s2-0 (if (type? s1-0 process-focusable) s1-0 @@ -630,7 +626,7 @@ ;; definition for method 114 of type tomb-baby-spider ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! tomb-baby-spider ((this tomb-baby-spider)) +(defmethod init-enemy-collision! ((this tomb-baby-spider)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -705,7 +701,7 @@ ) ;; definition for method 115 of type tomb-baby-spider -(defmethod init-enemy! tomb-baby-spider ((this tomb-baby-spider)) +(defmethod init-enemy! ((this tomb-baby-spider)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this @@ -719,14 +715,10 @@ ;; definition of type dig-spider (deftype dig-spider (tomb-baby-spider) () - :heap-base #x1e0 - :method-count-assert 180 - :size-assert #x25c - :flag-assert #xb401e0025c ) ;; definition for method 3 of type dig-spider -(defmethod inspect dig-spider ((this dig-spider)) +(defmethod inspect ((this dig-spider)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc index 0e06130a28b..c5730d18d23 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc @@ -10,18 +10,15 @@ ;; definition of type tomb-beetle-fly-info (deftype tomb-beetle-fly-info (structure) - ((dst vector :inline :offset-assert 0) - (dst-quat quaternion :inline :offset-assert 16) - (dist meters :offset-assert 32) - (threshold meters :offset-assert 36) + ((dst vector :inline) + (dst-quat quaternion :inline) + (dist meters) + (threshold meters) ) - :method-count-assert 9 - :size-assert #x28 - :flag-assert #x900000028 ) ;; definition for method 3 of type tomb-beetle-fly-info -(defmethod inspect tomb-beetle-fly-info ((this tomb-beetle-fly-info)) +(defmethod inspect ((this tomb-beetle-fly-info)) (when (not this) (set! this this) (goto cfg-4) @@ -37,38 +34,36 @@ ;; definition of type tomb-beetle (deftype tomb-beetle (nav-enemy) - ((src-quat quaternion :inline :offset-assert 608) - (fly-info tomb-beetle-fly-info 2 :inline :offset-assert 624) - (speed meters :offset-assert 720) - (init-height meters :offset-assert 724) - (flags uint16 :offset-assert 728) - (dest-index int32 :offset-assert 732) - (round uint32 :offset-assert 736) - (flying? symbol :offset-assert 740) - (fly-away-radius float :offset-assert 744) - (fly-away-ry float :offset-assert 748) - (fly-away-ry-speed float :offset-assert 752) - (fly-away-acc float :offset-assert 756) - (fly-away-dir vector :inline :offset-assert 768) + ((src-quat quaternion :inline) + (fly-info tomb-beetle-fly-info 2 :inline) + (speed meters) + (init-height meters) + (flags uint16) + (dest-index int32) + (round uint32) + (flying? symbol) + (fly-away-radius float) + (fly-away-ry float) + (fly-away-ry-speed float) + (fly-away-acc float) + (fly-away-dir vector :inline) ) - :heap-base #x290 - :method-count-assert 186 - :size-assert #x310 - :flag-assert #xba02900310 + (:state-methods + tomb-beetle-state-178 + explode + fly-away + go-to-door + key + land + stand + ) (:methods - (tomb-beetle-method-178 (_type_) none 178) - (explode () _type_ :state 179) - (fly-away () _type_ :state 180) - (go-to-door () _type_ :state 181) - (key () _type_ :state 182) - (land () _type_ :state 183) - (stand () _type_ :state 184) - (tomb-beetle-method-185 (_type_) none 185) + (tomb-beetle-method-185 (_type_) none) ) ) ;; definition for method 3 of type tomb-beetle -(defmethod inspect tomb-beetle ((this tomb-beetle)) +(defmethod inspect ((this tomb-beetle)) (when (not this) (set! this this) (goto cfg-4) @@ -229,7 +224,7 @@ (set! (-> *tomb-beetle-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type tomb-beetle -(defmethod general-event-handler tomb-beetle ((this tomb-beetle) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this tomb-beetle) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (let ((v1-0 (new 'static 'array int64 2 -1 0))) @@ -276,7 +271,7 @@ ;; definition for method 185 of type tomb-beetle ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod tomb-beetle-method-185 tomb-beetle ((this tomb-beetle)) +(defmethod tomb-beetle-method-185 ((this tomb-beetle)) (cond ((-> this draw shadow) (new 'stack-no-clear 'vector) @@ -989,7 +984,7 @@ ;; definition for method 114 of type tomb-beetle ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! tomb-beetle ((this tomb-beetle)) +(defmethod init-enemy-collision! ((this tomb-beetle)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1039,7 +1034,7 @@ ;; definition for method 115 of type tomb-beetle ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! tomb-beetle ((this tomb-beetle)) +(defmethod init-enemy! ((this tomb-beetle)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton this diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc index a1e28cfb998..4bdd979889c 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc @@ -3,17 +3,13 @@ ;; definition of type tomb-plat-wall (deftype tomb-plat-wall (plat) - ((position vector :inline :offset-assert 336) - (last-pos float :offset-assert 352) + ((position vector :inline) + (last-pos float) ) - :heap-base #xf0 - :method-count-assert 37 - :size-assert #x164 - :flag-assert #x2500f00164 ) ;; definition for method 3 of type tomb-plat-wall -(defmethod inspect tomb-plat-wall ((this tomb-plat-wall)) +(defmethod inspect ((this tomb-plat-wall)) (when (not this) (set! this this) (goto cfg-4) @@ -35,7 +31,7 @@ ) ;; definition for method 30 of type tomb-plat-wall -(defmethod get-art-group tomb-plat-wall ((this tomb-plat-wall)) +(defmethod get-art-group ((this tomb-plat-wall)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-plat-wall" (the-as (pointer uint32) #f)) ) @@ -113,14 +109,14 @@ ;; definition for method 32 of type tomb-plat-wall ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 tomb-plat-wall ((this tomb-plat-wall)) +(defmethod base-plat-method-32 ((this tomb-plat-wall)) 0 (none) ) ;; definition for method 31 of type tomb-plat-wall ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! tomb-plat-wall ((this tomb-plat-wall)) +(defmethod init-plat-collision! ((this tomb-plat-wall)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -147,7 +143,7 @@ ;; definition for method 11 of type tomb-plat-wall ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-plat-wall ((this tomb-plat-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-plat-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -191,19 +187,15 @@ This commonly includes things such as: ;; definition of type tomb-stair-block-spikes (deftype tomb-stair-block-spikes (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type tomb-stair-block-spikes -(defmethod inspect tomb-stair-block-spikes ((this tomb-stair-block-spikes)) +(defmethod inspect ((this tomb-stair-block-spikes)) (when (not this) (set! this this) (goto cfg-4) @@ -348,19 +340,16 @@ This commonly includes things such as: ;; definition of type tomb-stair-block-spike-info (deftype tomb-stair-block-spike-info (structure) - ((spike handle :offset-assert 0) - (joint int32 :offset-assert 8) - (y-offset float :offset-assert 12) - (up basic :offset-assert 16) - (sounded basic :offset-assert 20) + ((spike handle) + (joint int32) + (y-offset float) + (up basic) + (sounded basic) ) - :method-count-assert 9 - :size-assert #x18 - :flag-assert #x900000018 ) ;; definition for method 3 of type tomb-stair-block-spike-info -(defmethod inspect tomb-stair-block-spike-info ((this tomb-stair-block-spike-info)) +(defmethod inspect ((this tomb-stair-block-spike-info)) (when (not this) (set! this this) (goto cfg-4) @@ -377,28 +366,24 @@ This commonly includes things such as: ;; definition of type tomb-stair-block (deftype tomb-stair-block (process-drawable) - ((root collide-shape-moving :override) - (initial-y float :offset-assert 200) - (spike-info tomb-stair-block-spike-info 4 :inline :offset 208) - (camera-state int32 :offset 336) - (sink-sound sound-id :offset 340) - (rise-sound sound-id :offset 344) + ((root collide-shape-moving :override) + (initial-y float) + (spike-info tomb-stair-block-spike-info 4 :inline :offset 208) + (camera-state int32 :offset 336) + (sink-sound sound-id :offset 340) + (rise-sound sound-id :offset 344) ) - :heap-base #xe0 - :method-count-assert 25 - :size-assert #x15c - :flag-assert #x1900e0015c - (:methods - (wait-for-pools () _type_ :state 20) - (idle () _type_ :state 21) - (moving () _type_ :state 22) - (sink () _type_ :state 23) - (sunk () _type_ :state 24) + (:state-methods + wait-for-pools + idle + moving + sink + sunk ) ) ;; definition for method 3 of type tomb-stair-block -(defmethod inspect tomb-stair-block ((this tomb-stair-block)) +(defmethod inspect ((this tomb-stair-block)) (when (not this) (set! this this) (goto cfg-4) @@ -826,7 +811,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-stair-block ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-stair-block ((this tomb-stair-block) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-stair-block) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -956,14 +941,10 @@ This commonly includes things such as: ;; definition of type tomb-bounce-web (deftype tomb-bounce-web (bouncer) () - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd4 - :flag-assert #x19006000d4 ) ;; definition for method 3 of type tomb-bounce-web -(defmethod inspect tomb-bounce-web ((this tomb-bounce-web)) +(defmethod inspect ((this tomb-bounce-web)) (when (not this) (set! this this) (goto cfg-4) @@ -977,7 +958,7 @@ This commonly includes things such as: ;; definition for method 23 of type tomb-bounce-web ;; WARN: Return type mismatch int vs none. -(defmethod init-skeleton! tomb-bounce-web ((this tomb-bounce-web)) +(defmethod init-skeleton! ((this tomb-bounce-web)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-bounce-web" (the-as (pointer uint32) #f))) @@ -990,7 +971,7 @@ This commonly includes things such as: ;; definition for method 24 of type tomb-bounce-web ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 tomb-bounce-web ((this tomb-bounce-web)) +(defmethod bouncer-method-24 ((this tomb-bounce-web)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) @@ -1044,14 +1025,10 @@ This commonly includes things such as: ;; definition of type tomb-plat-pillar (deftype tomb-plat-pillar (plat) () - :heap-base #xd0 - :method-count-assert 37 - :size-assert #x144 - :flag-assert #x2500d00144 ) ;; definition for method 3 of type tomb-plat-pillar -(defmethod inspect tomb-plat-pillar ((this tomb-plat-pillar)) +(defmethod inspect ((this tomb-plat-pillar)) (when (not this) (set! this this) (goto cfg-4) @@ -1070,21 +1047,21 @@ This commonly includes things such as: ) ;; definition for method 30 of type tomb-plat-pillar -(defmethod get-art-group tomb-plat-pillar ((this tomb-plat-pillar)) +(defmethod get-art-group ((this tomb-plat-pillar)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-plat-pillar" (the-as (pointer uint32) #f)) ) ;; definition for method 32 of type tomb-plat-pillar ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 tomb-plat-pillar ((this tomb-plat-pillar)) +(defmethod base-plat-method-32 ((this tomb-plat-pillar)) 0 (none) ) ;; definition for method 31 of type tomb-plat-pillar ;; WARN: Return type mismatch collide-shape vs none. -(defmethod init-plat-collision! tomb-plat-pillar ((this tomb-plat-pillar)) +(defmethod init-plat-collision! ((this tomb-plat-pillar)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1109,17 +1086,13 @@ This commonly includes things such as: ;; definition of type tomb-elevator (deftype tomb-elevator (elevator) - ((last-pos vector :inline :offset-assert 368) - (speed float :offset-assert 384) + ((last-pos vector :inline) + (speed float) ) - :heap-base #x110 - :method-count-assert 49 - :size-assert #x184 - :flag-assert #x3101100184 ) ;; definition for method 3 of type tomb-elevator -(defmethod inspect tomb-elevator ((this tomb-elevator)) +(defmethod inspect ((this tomb-elevator)) (when (not this) (set! this this) (goto cfg-4) @@ -1176,7 +1149,7 @@ This commonly includes things such as: ;; definition for method 41 of type tomb-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-defaults! tomb-elevator ((this tomb-elevator)) +(defmethod init-defaults! ((this tomb-elevator)) "Initializes default settings related to the [[elevator]]: - `elevator-xz-threshold` - `elevator-y-threshold` @@ -1192,14 +1165,14 @@ This commonly includes things such as: ) ;; definition for method 30 of type tomb-elevator -(defmethod get-art-group tomb-elevator ((this tomb-elevator)) +(defmethod get-art-group ((this tomb-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 31 of type tomb-elevator ;; WARN: Return type mismatch collide-shape vs none. -(defmethod init-plat-collision! tomb-elevator ((this tomb-elevator)) +(defmethod init-plat-collision! ((this tomb-elevator)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) @@ -1224,7 +1197,7 @@ This commonly includes things such as: ;; definition for method 42 of type tomb-elevator ;; WARN: Return type mismatch int vs none. -(defmethod set-ambient-sound! tomb-elevator ((this tomb-elevator)) +(defmethod set-ambient-sound! ((this tomb-elevator)) "Sets the elevator's [[ambient-sound]] up" (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "tomb-elevator" :fo-max 70) (-> this root trans)) @@ -1243,14 +1216,10 @@ This commonly includes things such as: ;; definition of type tomb-boss-door (deftype tomb-boss-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type tomb-boss-door -(defmethod inspect tomb-boss-door ((this tomb-boss-door)) +(defmethod inspect ((this tomb-boss-door)) (when (not this) (set! this this) (goto cfg-4) @@ -1264,7 +1233,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-boss-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-door ((this tomb-boss-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-boss-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1316,14 +1285,10 @@ This commonly includes things such as: ;; definition of type water-anim-tomb (deftype water-anim-tomb (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) ;; definition for method 3 of type water-anim-tomb -(defmethod inspect water-anim-tomb ((this water-anim-tomb)) +(defmethod inspect ((this water-anim-tomb)) (when (not this) (set! this this) (goto cfg-4) @@ -1351,7 +1316,7 @@ This commonly includes things such as: ;; definition for method 24 of type water-anim-tomb ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-tomb ((this water-anim-tomb)) +(defmethod init-water! ((this water-anim-tomb)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) (t9-0 this) @@ -1376,14 +1341,10 @@ This commonly includes things such as: ;; definition of type tomb-wing-door (deftype tomb-wing-door (com-airlock) () - :heap-base #x100 - :method-count-assert 28 - :size-assert #x174 - :flag-assert #x1c01000174 ) ;; definition for method 3 of type tomb-wing-door -(defmethod inspect tomb-wing-door ((this tomb-wing-door)) +(defmethod inspect ((this tomb-wing-door)) (when (not this) (set! this this) (goto cfg-4) @@ -1397,7 +1358,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-wing-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-wing-door ((this tomb-wing-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-wing-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1465,20 +1426,16 @@ This commonly includes things such as: ;; definition of type tomb-boulder-door (deftype tomb-boulder-door (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (open () _type_ :state 20) - (close () _type_ :state 21) + (:state-methods + open + close ) ) ;; definition for method 3 of type tomb-boulder-door -(defmethod inspect tomb-boulder-door ((this tomb-boulder-door)) +(defmethod inspect ((this tomb-boulder-door)) (when (not this) (set! this this) (goto cfg-4) @@ -1529,7 +1486,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-boulder-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boulder-door ((this tomb-boulder-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-boulder-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1568,29 +1525,25 @@ This commonly includes things such as: ;; definition of type tomb-plat-return (deftype tomb-plat-return (base-plat) - ((intro-path path-control :offset-assert 272) - (ride-timer time-frame :offset-assert 280) - (flags tomb-plat-flags :offset-assert 288) - (path-pos float :offset-assert 292) - (dest-pos float :offset-assert 296) - (path-speed float :offset-assert 300) - (sound-id sound-id :offset-assert 304) + ((intro-path path-control) + (ride-timer time-frame) + (flags tomb-plat-flags) + (path-pos float) + (dest-pos float) + (path-speed float) + (sound-id sound-id) ) - :heap-base #xc0 - :method-count-assert 39 - :size-assert #x134 - :flag-assert #x2700c00134 - (:methods - (hidden () _type_ :state 34) - (run-intro () _type_ :state 35) - (waiting () _type_ :state 36) - (running () _type_ :state 37) - (waiting-for-no-player () _type_ :state 38) + (:state-methods + hidden + run-intro + waiting + running + waiting-for-no-player ) ) ;; definition for method 3 of type tomb-plat-return -(defmethod inspect tomb-plat-return ((this tomb-plat-return)) +(defmethod inspect ((this tomb-plat-return)) (when (not this) (set! this this) (goto cfg-4) @@ -1783,7 +1736,7 @@ This commonly includes things such as: ;; definition for method 7 of type tomb-plat-return ;; WARN: Return type mismatch process-drawable vs tomb-plat-return. -(defmethod relocate tomb-plat-return ((this tomb-plat-return) (arg0 int)) +(defmethod relocate ((this tomb-plat-return) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) ) @@ -1791,7 +1744,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type tomb-plat-return -(defmethod deactivate tomb-plat-return ((this tomb-plat-return)) +(defmethod deactivate ((this tomb-plat-return)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -1799,7 +1752,7 @@ This commonly includes things such as: ;; definition for method 31 of type tomb-plat-return ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! tomb-plat-return ((this tomb-plat-return)) +(defmethod init-plat-collision! ((this tomb-plat-return)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1825,7 +1778,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-plat-return ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-plat-return ((this tomb-plat-return) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-plat-return) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1951,24 +1904,20 @@ This commonly includes things such as: ;; definition of type tomb-sphinx (deftype tomb-sphinx (process-drawable) - ((root collide-shape-moving :override) - (target-actor entity-actor :offset-assert 200) - (sound-id sound-id :offset-assert 204) - (move-dir float :offset 216) + ((root collide-shape-moving :override) + (target-actor entity-actor) + (sound-id sound-id) + (move-dir float :offset 216) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xdc - :flag-assert #x17006000dc - (:methods - (idle () _type_ :state 20) - (active () _type_ :state 21) - (doors-open () _type_ :state 22) + (:state-methods + idle + active + doors-open ) ) ;; definition for method 3 of type tomb-sphinx -(defmethod inspect tomb-sphinx ((this tomb-sphinx)) +(defmethod inspect ((this tomb-sphinx)) (when (not this) (set! this this) (goto cfg-4) @@ -2153,12 +2102,12 @@ This commonly includes things such as: ;; definition for method 7 of type tomb-sphinx ;; WARN: Return type mismatch process-drawable vs tomb-sphinx. -(defmethod relocate tomb-sphinx ((this tomb-sphinx) (arg0 int)) +(defmethod relocate ((this tomb-sphinx) (arg0 int)) (the-as tomb-sphinx ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type tomb-sphinx -(defmethod deactivate tomb-sphinx ((this tomb-sphinx)) +(defmethod deactivate ((this tomb-sphinx)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -2166,7 +2115,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-sphinx ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-sphinx ((this tomb-sphinx) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-sphinx) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-part_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-part_REF.gc index 5523560e8d4..cbee3993882 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type tomb-part (deftype tomb-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type tomb-part -(defmethod inspect tomb-part ((this tomb-part)) +(defmethod inspect ((this tomb-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc index 969c9e5fc98..6ded42750c5 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc @@ -3,21 +3,17 @@ ;; definition of type tomb-door (deftype tomb-door (process-drawable) - ((notify-actor entity :offset-assert 200) - (round uint32 :offset-assert 204) + ((notify-actor entity) + (round uint32) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (open (time-frame) _type_ :state 21) + (:state-methods + idle + (open time-frame) ) ) ;; definition for method 3 of type tomb-door -(defmethod inspect tomb-door ((this tomb-door)) +(defmethod inspect ((this tomb-door)) (when (not this) (set! this this) (goto cfg-4) @@ -132,7 +128,7 @@ ;; definition for method 11 of type tomb-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-door ((this tomb-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -195,25 +191,21 @@ This commonly includes things such as: ;; definition of type tomb-beetle-door (deftype tomb-beetle-door (process-drawable) - ((offset vector 3 :inline :offset-assert 208) - (offset-index int32 :offset-assert 256) - (key-index int32 :offset-assert 260) - (beetle handle 3 :offset-assert 264) - (actor-group (pointer actor-group) :offset-assert 288) - (actor-group-count int32 :offset-assert 292) + ((offset vector 3 :inline) + (offset-index int32) + (key-index int32) + (beetle handle 3) + (actor-group (pointer actor-group)) + (actor-group-count int32) ) - :heap-base #xb0 - :method-count-assert 22 - :size-assert #x128 - :flag-assert #x1600b00128 - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) + (:state-methods + idle + open ) ) ;; definition for method 3 of type tomb-beetle-door -(defmethod inspect tomb-beetle-door ((this tomb-beetle-door)) +(defmethod inspect ((this tomb-beetle-door)) (when (not this) (set! this this) (goto cfg-7) @@ -333,7 +325,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-beetle-door ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-beetle-door ((this tomb-beetle-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-beetle-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -420,14 +412,10 @@ This commonly includes things such as: ;; definition of type tomb-button (deftype tomb-button (basebutton) () - :heap-base #xa0 - :method-count-assert 39 - :size-assert #x120 - :flag-assert #x2700a00120 ) ;; definition for method 3 of type tomb-button -(defmethod inspect tomb-button ((this tomb-button)) +(defmethod inspect ((this tomb-button)) (when (not this) (set! this this) (goto cfg-4) @@ -441,7 +429,7 @@ This commonly includes things such as: ;; definition for method 33 of type tomb-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 tomb-button ((this tomb-button)) +(defmethod basebutton-method-33 ((this tomb-button)) "TODO - joint stuff" (initialize-skeleton this @@ -479,7 +467,7 @@ This commonly includes things such as: ;; definition for method 34 of type tomb-button ;; WARN: Return type mismatch collide-shape vs none. -(defmethod basebutton-method-34 tomb-button ((this tomb-button)) +(defmethod basebutton-method-34 ((this tomb-button)) "TODO - collision stuff" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -504,7 +492,7 @@ This commonly includes things such as: ;; definition for method 35 of type tomb-button ;; WARN: Return type mismatch float vs none. -(defmethod prepare-trigger-event! tomb-button ((this tomb-button)) +(defmethod prepare-trigger-event! ((this tomb-button)) "Sets `event-going-down` to `'trigger`" (logior! (-> this button-status) (button-status button-status-4)) (set! (-> this event-going-down) 'cue-chase) @@ -514,21 +502,17 @@ This commonly includes things such as: ;; definition of type tomb-beetle-button (deftype tomb-beetle-button (tomb-button) - ((round uint32 :offset-assert 288) - (speech-mask uint32 :offset-assert 292) - (speech-timer time-frame :offset-assert 296) + ((round uint32) + (speech-mask uint32) + (speech-timer time-frame) ) - :heap-base #xb0 - :method-count-assert 40 - :size-assert #x130 - :flag-assert #x2800b00130 (:methods - (tomb-beetle-button-method-39 (_type_) none 39) + (tomb-beetle-button-method-39 (_type_) none) ) ) ;; definition for method 3 of type tomb-beetle-button -(defmethod inspect tomb-beetle-button ((this tomb-beetle-button)) +(defmethod inspect ((this tomb-beetle-button)) (when (not this) (set! this this) (goto cfg-4) @@ -545,7 +529,7 @@ This commonly includes things such as: ;; definition for method 39 of type tomb-beetle-button ;; WARN: Return type mismatch int vs none. -(defmethod tomb-beetle-button-method-39 tomb-beetle-button ((this tomb-beetle-button)) +(defmethod tomb-beetle-button-method-39 ((this tomb-beetle-button)) (when (time-elapsed? (-> this speech-timer) (seconds 6)) (let ((s5-0 (rand-vu-int-count-excluding 4 (the-as int (-> this speech-mask))))) (let* ((v1-4 s5-0) @@ -711,7 +695,7 @@ This commonly includes things such as: ;; definition for method 36 of type tomb-beetle-button ;; WARN: Return type mismatch symbol vs none. -(defmethod send-event! tomb-beetle-button ((this tomb-beetle-button) (arg0 symbol)) +(defmethod send-event! ((this tomb-beetle-button) (arg0 symbol)) "Prepares an [[event-message-block]] using the provided type to send an event to: - the `notify-actor` - every [[entity-actor]] in the `actor-group` array @@ -758,7 +742,7 @@ This commonly includes things such as: ;; definition for method 35 of type tomb-beetle-button ;; WARN: Return type mismatch int vs none. -(defmethod prepare-trigger-event! tomb-beetle-button ((this tomb-beetle-button)) +(defmethod prepare-trigger-event! ((this tomb-beetle-button)) "Sets `event-going-down` to `'trigger`" (let ((t9-0 (method-of-type tomb-button prepare-trigger-event!))) (t9-0 this) @@ -778,36 +762,34 @@ This commonly includes things such as: ;; definition of type tomb-simon-block (deftype tomb-simon-block (base-plat) - ((sound-show sound-name :offset-assert 272) - (color vector :inline :offset-assert 288) - (my-idx int32 :offset-assert 304) - (next-idx int32 :offset-assert 308) - (flags simon-block-flags :offset-assert 312) - (blink-timer time-frame 2 :offset-assert 320) - (ride-timer time-frame :offset-assert 336) - (order int32 :offset-assert 344) - (base-height float :offset-assert 348) - (move-rate float :offset-assert 352) + ((sound-show sound-name) + (color vector :inline) + (my-idx int32) + (next-idx int32) + (flags simon-block-flags) + (blink-timer time-frame 2) + (ride-timer time-frame) + (order int32) + (base-height float) + (move-rate float) ) - :heap-base #xf0 - :method-count-assert 42 - :size-assert #x164 - :flag-assert #x2a00f00164 + (:state-methods + idle + ready + ridden + temporary + dangerous + wobble-die + die + ) (:methods - (idle () _type_ :state 34) - (ready () _type_ :state 35) - (ridden () _type_ :state 36) - (temporary () _type_ :state 37) - (dangerous () _type_ :state 38) - (wobble-die () _type_ :state 39) - (die () _type_ :state 40) - (set-blink-timers! (_type_) none 41) + (set-blink-timers! (_type_) none) ) ) ;; definition for method 3 of type tomb-simon-block ;; INFO: Used lq/sq -(defmethod inspect tomb-simon-block ((this tomb-simon-block)) +(defmethod inspect ((this tomb-simon-block)) (when (not this) (set! this this) (goto cfg-4) @@ -831,30 +813,28 @@ This commonly includes things such as: ;; definition of type tomb-plat-simon (deftype tomb-plat-simon (process-drawable) - ((plat (array handle) :offset-assert 200) - (plat-seq (pointer uint32) :offset-assert 204) - (plat-count int32 :offset-assert 208) - (plat-seq-count int32 :offset-assert 212) - (plat-idx int32 :offset-assert 216) - (button-handle handle :offset-assert 224) - (notify-actor entity :offset-assert 232) - (flags uint16 :offset-assert 236) + ((plat (array handle)) + (plat-seq (pointer uint32)) + (plat-count int32) + (plat-seq-count int32) + (plat-idx int32) + (button-handle handle) + (notify-actor entity) + (flags uint16) ) - :heap-base #x70 - :method-count-assert 25 - :size-assert #xee - :flag-assert #x19007000ee + (:state-methods + dormant + appear + show-sequence + idle + ) (:methods - (dormant () _type_ :state 20) - (appear () _type_ :state 21) - (show-sequence () _type_ :state 22) - (idle () _type_ :state 23) - (tomb-plat-simon-method-24 (_type_ int) none 24) + (tomb-plat-simon-method-24 (_type_ int) none) ) ) ;; definition for method 3 of type tomb-plat-simon -(defmethod inspect tomb-plat-simon ((this tomb-plat-simon)) +(defmethod inspect ((this tomb-plat-simon)) (when (not this) (set! this this) (goto cfg-4) @@ -1136,7 +1116,7 @@ This commonly includes things such as: ;; definition for method 24 of type tomb-plat-simon ;; WARN: Return type mismatch object vs none. -(defmethod tomb-plat-simon-method-24 tomb-plat-simon ((this tomb-plat-simon) (arg0 int)) +(defmethod tomb-plat-simon-method-24 ((this tomb-plat-simon) (arg0 int)) (let ((a0-3 (handle->process (-> this plat arg0)))) (send-event a0-3 'ready) ) @@ -1145,7 +1125,7 @@ This commonly includes things such as: ;; definition for method 7 of type tomb-plat-simon ;; WARN: Return type mismatch process-drawable vs tomb-plat-simon. -(defmethod relocate tomb-plat-simon ((this tomb-plat-simon) (arg0 int)) +(defmethod relocate ((this tomb-plat-simon) (arg0 int)) (if (nonzero? (-> this plat)) (&+! (-> this plat) arg0) ) @@ -1155,7 +1135,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-plat-simon ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-plat-simon ((this tomb-plat-simon) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-plat-simon) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1559,7 +1539,7 @@ This commonly includes things such as: ;; definition for method 41 of type tomb-simon-block ;; WARN: Return type mismatch time-frame vs none. -(defmethod set-blink-timers! tomb-simon-block ((this tomb-simon-block)) +(defmethod set-blink-timers! ((this tomb-simon-block)) (logior! (-> this flags) (simon-block-flags blink blink-on)) (set-time! (-> this blink-timer 0)) (set-time! (-> this blink-timer 1)) @@ -1567,14 +1547,14 @@ This commonly includes things such as: ) ;; definition for method 30 of type tomb-simon-block -(defmethod get-art-group tomb-simon-block ((this tomb-simon-block)) +(defmethod get-art-group ((this tomb-simon-block)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-simon-block" (the-as (pointer uint32) #f)) ) ;; definition for method 31 of type tomb-simon-block ;; WARN: Return type mismatch collide-shape vs none. -(defmethod init-plat-collision! tomb-simon-block ((this tomb-simon-block)) +(defmethod init-plat-collision! ((this tomb-simon-block)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) @@ -1626,25 +1606,21 @@ This commonly includes things such as: ;; definition of type tomb-simon-button (deftype tomb-simon-button (process-drawable) - ((notify-actor entity :offset-assert 200) - (on-notice (function none) :offset-assert 204) - (on-activate (function none) :offset-assert 208) + ((notify-actor entity) + (on-notice (function none)) + (on-activate (function none)) ) - :heap-base #x60 - :method-count-assert 25 - :size-assert #xd4 - :flag-assert #x19006000d4 - (:methods - (idle () _type_ :state 20) - (open (symbol) _type_ :state 21) - (waiting () _type_ :state 22) - (pressed (symbol) _type_ :state 23) - (unpress () _type_ :state 24) + (:state-methods + idle + (open symbol) + waiting + (pressed symbol) + unpress ) ) ;; definition for method 3 of type tomb-simon-button -(defmethod inspect tomb-simon-button ((this tomb-simon-button)) +(defmethod inspect ((this tomb-simon-button)) (when (not this) (set! this this) (goto cfg-4) @@ -1808,7 +1784,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-simon-button ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-simon-button ((this tomb-simon-button) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-simon-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1908,32 +1884,28 @@ This commonly includes things such as: ;; definition of type tomb-vibe (deftype tomb-vibe (process-drawable) - ((spawn-pos vector :inline :offset-assert 208) - (pat-tbl (pointer int32) :offset-assert 224) - (pat-count int32 :offset-assert 228) - (pat-index int32 :offset-assert 232) - (pat-entry-index int32 :offset-assert 236) - (pat-timer time-frame :offset-assert 240) - (pat-duration time-frame :offset-assert 248) - (actor-group (pointer actor-group) :offset-assert 256) - (actor-group-count int32 :offset-assert 260) - (flags tomb-vibe-flags :offset-assert 264) - (on-activate basic :offset-assert 268) + ((spawn-pos vector :inline) + (pat-tbl (pointer int32)) + (pat-count int32) + (pat-index int32) + (pat-entry-index int32) + (pat-timer time-frame) + (pat-duration time-frame) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (flags tomb-vibe-flags) + (on-activate basic) ) - :heap-base #x90 - :method-count-assert 24 - :size-assert #x110 - :flag-assert #x1800900110 - (:methods - (get-pattern () _type_ :state 20) - (idle () _type_ :state 21) - (vibrate () _type_ :state 22) - (die (symbol) _type_ :state 23) + (:state-methods + get-pattern + idle + vibrate + (die symbol) ) ) ;; definition for method 3 of type tomb-vibe -(defmethod inspect tomb-vibe ((this tomb-vibe)) +(defmethod inspect ((this tomb-vibe)) (when (not this) (set! this this) (goto cfg-7) @@ -2254,7 +2226,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-vibe ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-vibe ((this tomb-vibe) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-vibe) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2380,33 +2352,31 @@ This commonly includes things such as: ;; definition of type tomb-water-trap (deftype tomb-water-trap (process-drawable) - ((bbox bounding-box :inline :offset-assert 208) - (run-bbox bounding-box :inline :offset-assert 240) - (sync sync-linear :inline :offset-assert 272) - (on-duration time-frame :offset-assert 288) - (harmless-time time-frame :offset-assert 296) - (l-spec lightning-spec :offset-assert 304) - (l-count uint32 :offset-assert 308) - (l-index (array uint32) :offset-assert 312) - (attack-id uint32 :offset-assert 316) - (volume float :offset-assert 320) - (can-exit-running? symbol :offset-assert 324) + ((bbox bounding-box :inline) + (run-bbox bounding-box :inline) + (sync sync-linear :inline) + (on-duration time-frame) + (harmless-time time-frame) + (l-spec lightning-spec) + (l-count uint32) + (l-index (array uint32)) + (attack-id uint32) + (volume float) + (can-exit-running? symbol) ) - :heap-base #xd0 - :method-count-assert 25 - :size-assert #x148 - :flag-assert #x1900d00148 + (:state-methods + idle + running + ) (:methods - (idle () _type_ :state 20) - (running () _type_ :state 21) - (tomb-water-trap-method-22 (_type_) none 22) - (tomb-water-trap-method-23 (_type_ vector vector) none 23) - (tomb-water-trap-method-24 (_type_ vector vector int) none 24) + (tomb-water-trap-method-22 (_type_) none) + (tomb-water-trap-method-23 (_type_ vector vector) none) + (tomb-water-trap-method-24 (_type_ vector vector int) none) ) ) ;; definition for method 3 of type tomb-water-trap -(defmethod inspect tomb-water-trap ((this tomb-water-trap)) +(defmethod inspect ((this tomb-water-trap)) (when (not this) (set! this this) (goto cfg-4) @@ -2563,7 +2533,7 @@ This commonly includes things such as: ) ;; definition for method 22 of type tomb-water-trap -(defmethod tomb-water-trap-method-22 tomb-water-trap ((this tomb-water-trap)) +(defmethod tomb-water-trap-method-22 ((this tomb-water-trap)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set! (-> gp-0 collide-with) (collide-spec jak bot player-list)) (set! (-> gp-0 ignore-process0) this) @@ -2579,7 +2549,7 @@ This commonly includes things such as: ;; definition for method 23 of type tomb-water-trap ;; INFO: Used lq/sq ;; WARN: Return type mismatch time-frame vs none. -(defmethod tomb-water-trap-method-23 tomb-water-trap ((this tomb-water-trap) (arg0 vector) (arg1 vector)) +(defmethod tomb-water-trap-method-23 ((this tomb-water-trap) (arg0 vector) (arg1 vector)) (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) ) @@ -2627,7 +2597,7 @@ This commonly includes things such as: ;; definition for method 24 of type tomb-water-trap ;; INFO: Used lq/sq -(defmethod tomb-water-trap-method-24 tomb-water-trap ((this tomb-water-trap) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod tomb-water-trap-method-24 ((this tomb-water-trap) (arg0 vector) (arg1 vector) (arg2 int)) (let ((v1-1 (process-spawn lightning-tracker :init lightning-tracker-init @@ -2662,7 +2632,7 @@ This commonly includes things such as: ;; definition for method 7 of type tomb-water-trap ;; WARN: Return type mismatch process-drawable vs tomb-water-trap. -(defmethod relocate tomb-water-trap ((this tomb-water-trap) (arg0 int)) +(defmethod relocate ((this tomb-water-trap) (arg0 int)) (if (nonzero? (-> this l-index)) (&+! (-> this l-index) arg0) ) @@ -2671,7 +2641,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-water-trap ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-water-trap ((this tomb-water-trap) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-water-trap) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2764,22 +2734,18 @@ This commonly includes things such as: ;; definition of type tomb-smash-door (deftype tomb-smash-door (process-drawable) - ((timeout time-frame :offset-assert 200) - (button handle :offset-assert 208) + ((timeout time-frame) + (button handle) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xd8 - :flag-assert #x17006000d8 - (:methods - (idle () _type_ :state 20) - (open () _type_ :state 21) - (close () _type_ :state 22) + (:state-methods + idle + open + close ) ) ;; definition for method 3 of type tomb-smash-door -(defmethod inspect tomb-smash-door ((this tomb-smash-door)) +(defmethod inspect ((this tomb-smash-door)) (when (not this) (set! this this) (goto cfg-4) @@ -2878,7 +2844,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-smash-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-smash-door ((this tomb-smash-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-smash-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc b/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc index 83cbb3b714d..546e929431b 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc @@ -3,28 +3,25 @@ ;; definition of type widow-float-seeker (deftype widow-float-seeker (structure) - ((target float :offset-assert 0) - (value float :offset-assert 4) - (vel float :offset-assert 8) - (accel float :offset-assert 12) - (max-vel float :offset-assert 16) - (max-partial float :offset-assert 20) - (bounce-high float :offset-assert 24) + ((target float) + (value float) + (vel float) + (accel float) + (max-vel float) + (max-partial float) + (bounce-high float) ) :allow-misaligned - :method-count-assert 13 - :size-assert #x1c - :flag-assert #xd0000001c (:methods - (widow-float-seeker-method-9 (_type_ float float float float float) none 9) - (widow-float-seeker-method-10 (_type_ (pointer float)) none 10) - (widow-float-seeker-method-11 (_type_ float) none 11) - (widow-float-seeker-method-12 (_type_ float) none 12) + (widow-float-seeker-method-9 (_type_ float float float float float) none) + (widow-float-seeker-method-10 (_type_ (pointer float)) none) + (widow-float-seeker-method-11 (_type_ float) none) + (widow-float-seeker-method-12 (_type_ float) none) ) ) ;; definition for method 3 of type widow-float-seeker -(defmethod inspect widow-float-seeker ((this widow-float-seeker)) +(defmethod inspect ((this widow-float-seeker)) (when (not this) (set! this this) (goto cfg-4) @@ -43,7 +40,7 @@ ;; definition for method 9 of type widow-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod widow-float-seeker-method-9 widow-float-seeker ((this widow-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) +(defmethod widow-float-seeker-method-9 ((this widow-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) (set! (-> this target) arg0) (set! (-> this value) arg0) (set! (-> this vel) 0.0) @@ -57,7 +54,7 @@ ;; definition for method 10 of type widow-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod widow-float-seeker-method-10 widow-float-seeker ((this widow-float-seeker) (arg0 (pointer float))) +(defmethod widow-float-seeker-method-10 ((this widow-float-seeker) (arg0 (pointer float))) (set! (-> this target) (-> arg0 0)) (set! (-> this value) (-> arg0 1)) (set! (-> this vel) (-> arg0 2)) @@ -71,7 +68,7 @@ ;; definition for method 11 of type widow-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod widow-float-seeker-method-11 widow-float-seeker ((this widow-float-seeker) (arg0 float)) +(defmethod widow-float-seeker-method-11 ((this widow-float-seeker) (arg0 float)) (with-pp 0.0 0.0 @@ -107,7 +104,7 @@ ;; definition for method 12 of type widow-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod widow-float-seeker-method-12 widow-float-seeker ((this widow-float-seeker) (arg0 float)) +(defmethod widow-float-seeker-method-12 ((this widow-float-seeker) (arg0 float)) (set! (-> this value) (+ (-> this target) arg0)) (set! (-> this vel) 0.0) 0 @@ -116,24 +113,21 @@ ;; definition of type widow-rand-vector (deftype widow-rand-vector (structure) - ((min-time int32 :offset-assert 0) - (max-time int32 :offset-assert 4) - (xz-max float :offset-assert 8) - (y-max float :offset-assert 12) - (timer int32 :offset-assert 16) - (value vector :inline :offset-assert 32) + ((min-time int32) + (max-time int32) + (xz-max float) + (y-max float) + (timer int32) + (value vector :inline) ) - :method-count-assert 11 - :size-assert #x30 - :flag-assert #xb00000030 (:methods - (init (_type_ int int float float) none 9) - (widow-rand-vector-method-10 (_type_) none 10) + (init (_type_ int int float float) none) + (widow-rand-vector-method-10 (_type_) none) ) ) ;; definition for method 3 of type widow-rand-vector -(defmethod inspect widow-rand-vector ((this widow-rand-vector)) +(defmethod inspect ((this widow-rand-vector)) (when (not this) (set! this this) (goto cfg-4) @@ -151,7 +145,7 @@ ;; definition for method 9 of type widow-rand-vector ;; WARN: Return type mismatch int vs none. -(defmethod init widow-rand-vector ((this widow-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) +(defmethod init ((this widow-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) (set! (-> this min-time) arg0) (set! (-> this max-time) arg1) (set! (-> this xz-max) (* 0.5 arg2)) @@ -164,7 +158,7 @@ ;; definition for method 10 of type widow-rand-vector ;; WARN: Return type mismatch int vs none. -(defmethod widow-rand-vector-method-10 widow-rand-vector ((this widow-rand-vector)) +(defmethod widow-rand-vector-method-10 ((this widow-rand-vector)) (with-pp (set! (-> this timer) (- (the-as time-frame (-> this timer)) (- (current-time) (-> pp clock old-frame-counter))) @@ -182,24 +176,21 @@ ;; definition of type widow-oscillator (deftype widow-oscillator (structure) - ((target vector :inline :offset-assert 0) - (value vector :inline :offset-assert 16) - (vel vector :inline :offset-assert 32) - (accel float :offset-assert 48) - (max-vel float :offset-assert 52) - (damping float :offset-assert 56) + ((target vector :inline) + (value vector :inline) + (vel vector :inline) + (accel float) + (max-vel float) + (damping float) ) - :method-count-assert 11 - :size-assert #x3c - :flag-assert #xb0000003c (:methods - (widow-oscillator-method-9 (_type_ vector float float float) none 9) - (widow-oscillator-method-10 (_type_ vector) none 10) + (widow-oscillator-method-9 (_type_ vector float float float) none) + (widow-oscillator-method-10 (_type_ vector) none) ) ) ;; definition for method 3 of type widow-oscillator -(defmethod inspect widow-oscillator ((this widow-oscillator)) +(defmethod inspect ((this widow-oscillator)) (when (not this) (set! this this) (goto cfg-4) @@ -218,7 +209,7 @@ ;; definition for method 9 of type widow-oscillator ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod widow-oscillator-method-9 widow-oscillator ((this widow-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod widow-oscillator-method-9 ((this widow-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 (set! (-> this target quad) (-> arg0 quad)) @@ -239,7 +230,7 @@ ;; definition for method 10 of type widow-oscillator ;; WARN: Return type mismatch int vs none. -(defmethod widow-oscillator-method-10 widow-oscillator ((this widow-oscillator) (arg0 vector)) +(defmethod widow-oscillator-method-10 ((this widow-oscillator) (arg0 vector)) (with-pp (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((f30-0 (fmax (-> this max-vel) (vector-length (-> this vel))))) @@ -280,14 +271,10 @@ ;; definition of type widow-shot (deftype widow-shot (guard-shot) () - :heap-base #x170 - :method-count-assert 40 - :size-assert #x1f0 - :flag-assert #x28017001f0 ) ;; definition for method 3 of type widow-shot -(defmethod inspect widow-shot ((this widow-shot)) +(defmethod inspect ((this widow-shot)) (when (not this) (set! this this) (goto cfg-4) @@ -301,115 +288,113 @@ ;; definition of type widow (deftype widow (process-drawable) - ((bomb handle 8 :offset-assert 200) - (next-launch int32 :offset-assert 264) - (launch-dest vector :inline :offset-assert 272) - (next-jumper int32 :offset-assert 288) - (ammos handle 2 :offset-assert 296) - (ammo-timers time-frame 2 :offset-assert 312) - (bomb-hits int32 :offset-assert 328) - (circle-center vector :inline :offset-assert 336) - (theta cam-float-seeker :inline :offset-assert 352) - (traj trajectory :inline :offset-assert 384) - (osc widow-oscillator :inline :offset-assert 432) - (noise-osc widow-oscillator :inline :offset-assert 496) - (rand-vec widow-rand-vector :inline :offset-assert 560) - (attack-from-high-deg symbol :offset-assert 608) - (which-gun int32 :offset-assert 612) - (which-pod int32 :offset-assert 616) - (left-cover-angle widow-float-seeker :inline :offset 620) - (right-cover-angle widow-float-seeker :inline :offset 648) - (left-cover-jm joint-mod :offset-assert 676) - (right-cover-jm joint-mod :offset-assert 680) - (drill-speed cam-float-seeker :inline :offset-assert 684) - (drill-angle float :offset-assert 708) - (left-drill-jm joint-mod :offset-assert 712) - (right-drill-jm joint-mod :offset-assert 716) - (flying symbol :offset-assert 720) - (previous-anim int32 :offset-assert 724) - (launched-a-bomb symbol :offset-assert 728) - (old-bomb-hits int32 :offset-assert 732) - (catwalk handle 8 :offset-assert 736) - (heart handle :offset-assert 800) - (pod handle :offset-assert 808) - (baron (pointer manipy) :offset-assert 816) - (drill-spark-part sparticle-launch-control :offset-assert 820) - (drill-spark-part-alt sparticle-launch-control :offset-assert 824) - (extract-stone-time time-frame :offset-assert 832) - (extract-stone-part sparticle-launch-control :offset-assert 840) - (insert-stone-time time-frame :offset-assert 848) - (insert-stone-part sparticle-launch-control :offset-assert 856) - (land-part sparticle-launch-control :offset-assert 860) - (green-charge-part sparticle-launch-control :offset-assert 864) - (green-fire-part sparticle-launch-control :offset-assert 868) - (lightning lightning-control 5 :offset-assert 872) - (stop-catwalk-sound symbol :offset-assert 892) - (catwalk-sound sound-id :offset-assert 896) - (drill-sound sound-id :offset-assert 900) - (drill-sound-playing symbol :offset-assert 904) - (drill-sweeten-sound sound-id :offset-assert 908) - (drill-sweeten-sound-playing symbol :offset-assert 912) - (movie-handle handle :offset-assert 920) - (tilt cam-float-seeker :inline :offset-assert 928) - (targetted-catwalk int32 :offset-assert 952) - (hover-sound sound-id :offset-assert 956) - (hover-sound-playing symbol :offset-assert 960) - (shake-sound sound-id :offset-assert 964) - (shake-sound-playing symbol :offset-assert 968) - (hud handle :offset-assert 976) - (last-want-stone-talker int8 :offset-assert 984) - (last-general-flying-talker int8 :offset-assert 985) - (last-launch-droids-talker int8 :offset-assert 986) - (last-launch-bombs-talker int8 :offset-assert 987) - (last-shoot-gun-talker int8 :offset-assert 988) - (last-stone-charge-up-talker int8 :offset-assert 989) - (last-after-stone-shot-talker int8 :offset-assert 990) - (last-leave-perch-talker int8 :offset-assert 991) - (last-damaged-talker int8 :offset-assert 992) - (kicked-bombs int8 :offset-assert 993) - (launch-stages-completed int8 :offset-assert 994) - (current-shoot-stage int16 :offset-assert 996) - (last-gun-hit-stage int16 :offset-assert 998) - (gun-hits int16 :offset-assert 1000) - (last-attack-id uint32 :offset-assert 1004) + ((bomb handle 8) + (next-launch int32) + (launch-dest vector :inline) + (next-jumper int32) + (ammos handle 2) + (ammo-timers time-frame 2) + (bomb-hits int32) + (circle-center vector :inline) + (theta cam-float-seeker :inline) + (traj trajectory :inline) + (osc widow-oscillator :inline) + (noise-osc widow-oscillator :inline) + (rand-vec widow-rand-vector :inline) + (attack-from-high-deg symbol) + (which-gun int32) + (which-pod int32) + (left-cover-angle widow-float-seeker :inline :offset 620) + (right-cover-angle widow-float-seeker :inline :offset 648) + (left-cover-jm joint-mod) + (right-cover-jm joint-mod) + (drill-speed cam-float-seeker :inline) + (drill-angle float) + (left-drill-jm joint-mod) + (right-drill-jm joint-mod) + (flying symbol) + (previous-anim int32) + (launched-a-bomb symbol) + (old-bomb-hits int32) + (catwalk handle 8) + (heart handle) + (pod handle) + (baron (pointer manipy)) + (drill-spark-part sparticle-launch-control) + (drill-spark-part-alt sparticle-launch-control) + (extract-stone-time time-frame) + (extract-stone-part sparticle-launch-control) + (insert-stone-time time-frame) + (insert-stone-part sparticle-launch-control) + (land-part sparticle-launch-control) + (green-charge-part sparticle-launch-control) + (green-fire-part sparticle-launch-control) + (lightning lightning-control 5) + (stop-catwalk-sound symbol) + (catwalk-sound sound-id) + (drill-sound sound-id) + (drill-sound-playing symbol) + (drill-sweeten-sound sound-id) + (drill-sweeten-sound-playing symbol) + (movie-handle handle) + (tilt cam-float-seeker :inline) + (targetted-catwalk int32) + (hover-sound sound-id) + (hover-sound-playing symbol) + (shake-sound sound-id) + (shake-sound-playing symbol) + (hud handle) + (last-want-stone-talker int8) + (last-general-flying-talker int8) + (last-launch-droids-talker int8) + (last-launch-bombs-talker int8) + (last-shoot-gun-talker int8) + (last-stone-charge-up-talker int8) + (last-after-stone-shot-talker int8) + (last-leave-perch-talker int8) + (last-damaged-talker int8) + (kicked-bombs int8) + (launch-stages-completed int8) + (current-shoot-stage int16) + (last-gun-hit-stage int16) + (gun-hits int16) + (last-attack-id uint32) ) - :heap-base #x370 - :method-count-assert 47 - :size-assert #x3f0 - :flag-assert #x2f037003f0 + (:state-methods + beaten + kaboom + hover-low-stage-3 + hover-shooting-stage-3 + hover-launch-bombs-stage-3 + hover-big-blast-stage-3 + hover-rise-stage-3 + hover-jump-down-stage-3 + big-reaction-stage-2 + watch-bombs-stage-2 + launch-bombs-stage-2 + back-to-perch-stage-2 + hover-low-stage-2 + hover-shooting-stage-2 + hover-rise-stage-2 + hover-seek-under-stage-2 + hover-jump-down-stage-2 + launch-droids-stage-2 + big-reaction-stage-1 + watch-bombs-stage-1 + launch-bombs-stage-1 + watch-droids-stage-1 + launch-droids-stage-1 + hidden + ) (:methods - (beaten () _type_ :state 20) - (kaboom () _type_ :state 21) - (hover-low-stage-3 () _type_ :state 22) - (hover-shooting-stage-3 () _type_ :state 23) - (hover-launch-bombs-stage-3 () _type_ :state 24) - (hover-big-blast-stage-3 () _type_ :state 25) - (hover-rise-stage-3 () _type_ :state 26) - (hover-jump-down-stage-3 () _type_ :state 27) - (big-reaction-stage-2 () _type_ :state 28) - (watch-bombs-stage-2 () _type_ :state 29) - (launch-bombs-stage-2 () _type_ :state 30) - (back-to-perch-stage-2 () _type_ :state 31) - (hover-low-stage-2 () _type_ :state 32) - (hover-shooting-stage-2 () _type_ :state 33) - (hover-rise-stage-2 () _type_ :state 34) - (hover-seek-under-stage-2 () _type_ :state 35) - (hover-jump-down-stage-2 () _type_ :state 36) - (launch-droids-stage-2 () _type_ :state 37) - (big-reaction-stage-1 () _type_ :state 38) - (watch-bombs-stage-1 () _type_ :state 39) - (launch-bombs-stage-1 () _type_ :state 40) - (watch-droids-stage-1 () _type_ :state 41) - (launch-droids-stage-1 () _type_ :state 42) - (hidden () _type_ :state 43) - (widow-method-44 (_type_ vector vector) symbol 44) - (widow-method-45 (_type_ vector vector vector) none 45) - (widow-method-46 (_type_ vector int) none 46) + (widow-method-44 (_type_ vector vector) symbol) + (widow-method-45 (_type_ vector vector vector) none) + (widow-method-46 (_type_ vector int) none) ) ) ;; definition for method 3 of type widow -(defmethod inspect widow ((this widow)) +(defmethod inspect ((this widow)) (when (not this) (set! this this) (goto cfg-4) @@ -494,24 +479,22 @@ ;; definition of type baron-pod (deftype baron-pod (process-drawable) - ((red-tip-change-time time-frame :offset-assert 200) - (alt-red-tip-on symbol :offset-assert 208) - (blink-time time-frame :offset-assert 216) - (blink-mask int32 :offset-assert 224) - (has-stone symbol :offset-assert 228) + ((red-tip-change-time time-frame) + (alt-red-tip-on symbol) + (blink-time time-frame) + (blink-mask int32) + (has-stone symbol) ) - :heap-base #x70 - :method-count-assert 22 - :size-assert #xe8 - :flag-assert #x16007000e8 + (:state-methods + idle + ) (:methods - (idle () _type_ :state 20) - (baron-pod-method-21 (_type_ symbol) none 21) + (baron-pod-method-21 (_type_ symbol) none) ) ) ;; definition for method 3 of type baron-pod -(defmethod inspect baron-pod ((this baron-pod)) +(defmethod inspect ((this baron-pod)) (when (not this) (set! this this) (goto cfg-4) @@ -538,7 +521,7 @@ ;; definition for method 21 of type baron-pod ;; WARN: Return type mismatch int vs none. -(defmethod baron-pod-method-21 baron-pod ((this baron-pod) (arg0 symbol)) +(defmethod baron-pod-method-21 ((this baron-pod) (arg0 symbol)) (when (>= (- (current-time) (-> this red-tip-change-time)) 0) (set! (-> this alt-red-tip-on) (not (-> this alt-red-tip-on))) (set! (-> this red-tip-change-time) (+ (current-time) (seconds 0.5))) @@ -696,17 +679,13 @@ ;; definition of type tomb-boss-bridge (deftype tomb-boss-bridge (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type tomb-boss-bridge -(defmethod inspect tomb-boss-bridge ((this tomb-boss-bridge)) +(defmethod inspect ((this tomb-boss-bridge)) (when (not this) (set! this this) (goto cfg-4) @@ -732,7 +711,7 @@ ;; definition for method 11 of type tomb-boss-bridge ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-bridge ((this tomb-boss-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-boss-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc b/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc index 4b38e6d3d58..0525713753a 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc @@ -3,22 +3,20 @@ ;; definition of type tomb-boss-catwalk (deftype tomb-boss-catwalk (process-drawable) - ((root collide-shape-moving :override) - (which-look int32 :offset-assert 200) + ((root collide-shape-moving :override) + (which-look int32) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xcc - :flag-assert #x17005000cc + (:state-methods + shatter + idle + ) (:methods - (shatter () _type_ :state 20) - (idle () _type_ :state 21) - (tomb-boss-catwalk-method-22 (_type_ vector int) none 22) + (tomb-boss-catwalk-method-22 (_type_ vector int) none) ) ) ;; definition for method 3 of type tomb-boss-catwalk -(defmethod inspect tomb-boss-catwalk ((this tomb-boss-catwalk)) +(defmethod inspect ((this tomb-boss-catwalk)) (when (not this) (set! this this) (goto cfg-4) @@ -222,7 +220,7 @@ ;; definition for method 22 of type tomb-boss-catwalk ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod tomb-boss-catwalk-method-22 tomb-boss-catwalk ((this tomb-boss-catwalk) (arg0 vector) (arg1 int)) +(defmethod tomb-boss-catwalk-method-22 ((this tomb-boss-catwalk) (arg0 vector) (arg1 int)) (case arg1 ((1) (let ((s3-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -533,7 +531,7 @@ ;; definition for method 11 of type tomb-boss-catwalk ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-catwalk ((this tomb-boss-catwalk) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-boss-catwalk) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -562,14 +560,10 @@ This commonly includes things such as: ;; definition of type tomb-boss-catwalk-main (deftype tomb-boss-catwalk-main (tomb-boss-catwalk) () - :heap-base #x50 - :method-count-assert 23 - :size-assert #xcc - :flag-assert #x17005000cc ) ;; definition for method 3 of type tomb-boss-catwalk-main -(defmethod inspect tomb-boss-catwalk-main ((this tomb-boss-catwalk-main)) +(defmethod inspect ((this tomb-boss-catwalk-main)) (when (not this) (set! this this) (goto cfg-4) @@ -583,42 +577,40 @@ This commonly includes things such as: ;; definition of type widow-bomb (deftype widow-bomb (process-focusable) - ((traj trajectory :inline :offset-assert 208) - (explode-part sparticle-launch-control :offset-assert 248) - (trail-part sparticle-launch-control :offset-assert 252) - (warning-glow-part sparticle-launch-control :offset-assert 256) - (warning-spark-part sparticle-launch-control :offset-assert 260) - (impact impact-control :inline :offset-assert 272) - (which-trajectory int32 :offset-assert 352) - (next-countdown-tick time-frame :offset-assert 360) - (skid-part sparticle-launch-control :offset-assert 368) - (x-rotate float :offset-assert 372) - (y-rotate float :offset-assert 376) - (spin-jm joint-mod :offset-assert 380) - (firework-sound-played symbol :offset-assert 384) - (steam-sound sound-id :offset-assert 388) - (launch vector :inline :offset-assert 400) - (launch-pos vector :inline :offset-assert 416) - (fizzle-timer time-frame :offset-assert 432) + ((traj trajectory :inline) + (explode-part sparticle-launch-control) + (trail-part sparticle-launch-control) + (warning-glow-part sparticle-launch-control) + (warning-spark-part sparticle-launch-control) + (impact impact-control :inline) + (which-trajectory int32) + (next-countdown-tick time-frame) + (skid-part sparticle-launch-control) + (x-rotate float) + (y-rotate float) + (spin-jm joint-mod) + (firework-sound-played symbol) + (steam-sound sound-id) + (launch vector :inline) + (launch-pos vector :inline) + (fizzle-timer time-frame) ) - :heap-base #x140 - :method-count-assert 35 - :size-assert #x1b8 - :flag-assert #x23014001b8 + (:state-methods + freefall + back-atcha + explode + smoke + idle + ) (:methods - (freefall () _type_ :state 27) - (back-atcha () _type_ :state 28) - (explode () _type_ :state 29) - (smoke () _type_ :state 30) - (idle () _type_ :state 31) - (widow-bomb-method-32 (_type_) none 32) - (widow-bomb-method-33 (_type_) none 33) - (widow-bomb-method-34 (_type_) none 34) + (widow-bomb-method-32 (_type_) none) + (widow-bomb-method-33 (_type_) none) + (widow-bomb-method-34 (_type_) none) ) ) ;; definition for method 3 of type widow-bomb -(defmethod inspect widow-bomb ((this widow-bomb)) +(defmethod inspect ((this widow-bomb)) (when (not this) (set! this this) (goto cfg-4) @@ -662,7 +654,7 @@ This commonly includes things such as: ;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 ;; WARN: Return type mismatch int vs none. -(defmethod widow-bomb-method-34 widow-bomb ((this widow-bomb)) +(defmethod widow-bomb-method-34 ((this widow-bomb)) (local-vars (sv-48 float) (sv-64 float)) (let ((s5-0 (new 'stack-no-clear 'quaternion)) (gp-0 (new 'stack-no-clear 'quaternion)) @@ -982,7 +974,7 @@ This commonly includes things such as: ;; definition for method 32 of type widow-bomb ;; WARN: Return type mismatch int vs none. -(defmethod widow-bomb-method-32 widow-bomb ((this widow-bomb)) +(defmethod widow-bomb-method-32 ((this widow-bomb)) (spawn-with-cspace (-> this part) (-> this node-list data 3)) (sound-play "w-bomb-steam" :id (-> this steam-sound) :position (-> this root trans)) (let ((s5-0 (the-as int (- (current-time) (-> this state-time))))) @@ -1053,7 +1045,7 @@ This commonly includes things such as: ) ;; definition for method 33 of type widow-bomb -(defmethod widow-bomb-method-33 widow-bomb ((this widow-bomb)) +(defmethod widow-bomb-method-33 ((this widow-bomb)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (set-vector! (-> gp-0 vector 1) 0.0 1.0 0.0 1.0) (vector-! (-> gp-0 vector 2) (the-as vector (-> this impact trans)) (-> this impact trans 1)) @@ -1258,7 +1250,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type widow-bomb -(defmethod deactivate widow-bomb ((this widow-bomb)) +(defmethod deactivate ((this widow-bomb)) (if (nonzero? (-> this explode-part)) (kill-and-free-particles (-> this explode-part)) ) @@ -1279,7 +1271,7 @@ This commonly includes things such as: ) ;; definition for method 7 of type widow-bomb -(defmethod relocate widow-bomb ((this widow-bomb) (arg0 int)) +(defmethod relocate ((this widow-bomb) (arg0 int)) (if (nonzero? (-> this explode-part)) (&+! (-> this explode-part) arg0) ) @@ -1383,19 +1375,15 @@ This commonly includes things such as: ;; definition of type heart-mar (deftype heart-mar (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type heart-mar -(defmethod inspect heart-mar ((this heart-mar)) +(defmethod inspect ((this heart-mar)) (when (not this) (set! this this) (goto cfg-4) @@ -1479,24 +1467,20 @@ This commonly includes things such as: ;; definition of type tomb-boss-pillar (deftype tomb-boss-pillar (process-drawable) - ((root collide-shape-moving :override) - (explode-part sparticle-launch-control :offset-assert 200) - (segs-shot int32 :offset-assert 204) - (last-pillar-hit time-frame :offset-assert 208) + ((root collide-shape-moving :override) + (explode-part sparticle-launch-control) + (segs-shot int32) + (last-pillar-hit time-frame) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xd8 - :flag-assert #x17006000d8 - (:methods - (idle () _type_ :state 20) - (break-it () _type_ :state 21) - (broken () _type_ :state 22) + (:state-methods + idle + break-it + broken ) ) ;; definition for method 3 of type tomb-boss-pillar -(defmethod inspect tomb-boss-pillar ((this tomb-boss-pillar)) +(defmethod inspect ((this tomb-boss-pillar)) (when (not this) (set! this this) (goto cfg-4) @@ -1686,7 +1670,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type tomb-boss-pillar -(defmethod deactivate tomb-boss-pillar ((this tomb-boss-pillar)) +(defmethod deactivate ((this tomb-boss-pillar)) (if (nonzero? (-> this explode-part)) (kill-and-free-particles (-> this explode-part)) ) @@ -1695,7 +1679,7 @@ This commonly includes things such as: ) ;; definition for method 7 of type tomb-boss-pillar -(defmethod relocate tomb-boss-pillar ((this tomb-boss-pillar) (arg0 int)) +(defmethod relocate ((this tomb-boss-pillar) (arg0 int)) (if (nonzero? (-> this explode-part)) (&+! (-> this explode-part) arg0) ) @@ -1704,7 +1688,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-boss-pillar ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-pillar ((this tomb-boss-pillar) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-boss-pillar) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1765,21 +1749,17 @@ This commonly includes things such as: ;; definition of type tomb-boss-firepot (deftype tomb-boss-firepot (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc8 - :flag-assert #x17005000c8 - (:methods - (idle () _type_ :state 20) - (break-it () _type_ :state 21) - (broken () _type_ :state 22) + (:state-methods + idle + break-it + broken ) ) ;; definition for method 3 of type tomb-boss-firepot -(defmethod inspect tomb-boss-firepot ((this tomb-boss-firepot)) +(defmethod inspect ((this tomb-boss-firepot)) (when (not this) (set! this this) (goto cfg-4) @@ -1933,7 +1913,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-boss-firepot ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-firepot ((this tomb-boss-firepot) (arg0 entity-actor)) +(defmethod init-from-entity! ((this tomb-boss-firepot) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1988,7 +1968,7 @@ This commonly includes things such as: ;; definition for method 15 of type hud-widow ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-widow ((this hud-widow)) +(defmethod draw ((this hud-widow)) (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 1)) -62 14) @@ -2040,7 +2020,7 @@ This commonly includes things such as: ;; definition for method 17 of type hud-widow ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-widow ((this hud-widow)) +(defmethod init-callback ((this hud-widow)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/widow-more-extras_REF.gc b/test/decompiler/reference/jak2/levels/tomb/widow-more-extras_REF.gc index 29a36318f39..75767694c81 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow-more-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow-more-extras_REF.gc @@ -3,25 +3,21 @@ ;; definition of type tomb-boss-debris (deftype tomb-boss-debris (process-drawable) - ((root collide-shape-moving :override) - (y-velocity float :offset-assert 200) - (floor float :offset-assert 204) - (sound-floor float :offset-assert 208) - (rot quaternion :inline :offset-assert 224) - (look int32 :offset-assert 240) + ((root collide-shape-moving :override) + (y-velocity float) + (floor float) + (sound-floor float) + (rot quaternion :inline) + (look int32) ) - :heap-base #x80 - :method-count-assert 22 - :size-assert #xf4 - :flag-assert #x16008000f4 - (:methods - (die () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + die + idle ) ) ;; definition for method 3 of type tomb-boss-debris -(defmethod inspect tomb-boss-debris ((this tomb-boss-debris)) +(defmethod inspect ((this tomb-boss-debris)) (when (not this) (set! this this) (goto cfg-4) @@ -444,20 +440,16 @@ ;; definition of type cave-in-master (deftype cave-in-master (process-drawable) - ((prev-points int32 100 :offset-assert 200) + ((prev-points int32 100) ) - :heap-base #x1e0 - :method-count-assert 22 - :size-assert #x258 - :flag-assert #x1601e00258 - (:methods - (idle () _type_ :state 20) - (wait () _type_ :state 21) + (:state-methods + idle + wait ) ) ;; definition for method 3 of type cave-in-master -(defmethod inspect cave-in-master ((this cave-in-master)) +(defmethod inspect ((this cave-in-master)) (when (not this) (set! this this) (goto cfg-4) @@ -526,7 +518,7 @@ ;; definition for method 11 of type cave-in-master ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cave-in-master ((this cave-in-master) (arg0 entity-actor)) +(defmethod init-from-entity! ((this cave-in-master) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/tomb/widow2_REF.gc b/test/decompiler/reference/jak2/levels/tomb/widow2_REF.gc index 32096e49629..1f7c79d3ff8 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow2_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow2_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 37 of type widow-shot -(defmethod deal-damage! widow-shot ((this widow-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! ((this widow-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((t9-0 (method-of-type projectile deal-damage!))) (when (t9-0 this arg0 arg1) @@ -17,7 +17,7 @@ ;; definition for method 44 of type widow ;; INFO: Used lq/sq -(defmethod widow-method-44 widow ((this widow) (arg0 vector) (arg1 vector)) +(defmethod widow-method-44 ((this widow) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set! (-> gp-0 start-pos quad) (-> arg0 quad)) (vector-normalize-copy! (-> gp-0 move-dist) arg1 81920.0) @@ -39,7 +39,7 @@ ;; definition for method 45 of type widow ;; INFO: Used lq/sq ;; WARN: Return type mismatch sound-id vs none. -(defmethod widow-method-45 widow ((this widow) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod widow-method-45 ((this widow) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((f30-0 (/ 2013265900.0 (vector-length arg2))) (s3-0 (new 'stack-no-clear 'vector)) @@ -79,7 +79,7 @@ ;; definition for method 46 of type widow ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod widow-method-46 widow ((this widow) (arg0 vector) (arg1 int)) +(defmethod widow-method-46 ((this widow) (arg0 vector) (arg1 int)) (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg1))) (s3-0 (new 'stack-no-clear 'vector)) ) @@ -93,7 +93,7 @@ ) ;; definition for method 10 of type widow -(defmethod deactivate widow ((this widow)) +(defmethod deactivate ((this widow)) (if (nonzero? (-> this drill-spark-part)) (kill-and-free-particles (-> this drill-spark-part)) ) @@ -133,7 +133,7 @@ ;; definition for method 7 of type widow ;; WARN: Return type mismatch process-drawable vs widow. -(defmethod relocate widow ((this widow) (arg0 int)) +(defmethod relocate ((this widow) (arg0 int)) (if (nonzero? (-> this left-cover-jm)) (&+! (-> this left-cover-jm) arg0) ) @@ -178,7 +178,7 @@ ;; definition for method 11 of type widow ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! widow ((this widow) (arg0 entity-actor)) +(defmethod init-from-entity! ((this widow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/under/centipede_REF.gc b/test/decompiler/reference/jak2/levels/under/centipede_REF.gc index 82ff442fd8f..1148f0b5574 100644 --- a/test/decompiler/reference/jak2/levels/under/centipede_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/centipede_REF.gc @@ -3,18 +3,15 @@ ;; definition of type centipede-cam (deftype centipede-cam (structure) - ((init? symbol :offset-assert 0) - (trans vector :inline :offset-assert 16) - (dir vector :inline :offset-assert 32) - (track-focus-tilt float :offset-assert 48) + ((init? symbol) + (trans vector :inline) + (dir vector :inline) + (track-focus-tilt float) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type centipede-cam -(defmethod inspect centipede-cam ((this centipede-cam)) +(defmethod inspect ((this centipede-cam)) (when (not this) (set! this this) (goto cfg-4) @@ -30,46 +27,44 @@ ;; definition of type centipede (deftype centipede (nav-enemy) - ((id int8 :offset-assert 604) - (anim-ctr int8 :offset-assert 605) - (focus-pos-hist-count int8 :offset-assert 606) - (legs-sound ambient-sound :offset-assert 608) - (grabbed-focus? symbol :offset-assert 612) - (using-chan1-effects? symbol :offset-assert 616) - (set-camera-mode? symbol :offset-assert 620) - (talking-volume float :offset-assert 624) - (desired-talking-volume float :offset-assert 628) - (legs-volume float :offset-assert 632) - (focus-gnd-height float :offset-assert 636) - (track-focus-tilt float :offset-assert 640) - (bobbing-intensity float :offset-assert 644) - (bobbing trsqv :offset-assert 648) - (src-quat quaternion :inline :offset-assert 656) - (dest-quat quaternion :inline :offset-assert 672) - (cam centipede-cam :inline :offset-assert 688) - (focus-pos-hist vector 15 :inline :offset-assert 752) + ((id int8) + (anim-ctr int8) + (focus-pos-hist-count int8) + (legs-sound ambient-sound) + (grabbed-focus? symbol) + (using-chan1-effects? symbol) + (set-camera-mode? symbol) + (talking-volume float) + (desired-talking-volume float) + (legs-volume float) + (focus-gnd-height float) + (track-focus-tilt float) + (bobbing-intensity float) + (bobbing trsqv) + (src-quat quaternion :inline) + (dest-quat quaternion :inline) + (cam centipede-cam :inline) + (focus-pos-hist vector 15 :inline) ) - :heap-base #x360 - :method-count-assert 189 - :size-assert #x3e0 - :flag-assert #xbd036003e0 + (:state-methods + attack + attack-failed + hidden + grab-cam + thru-grating + ) (:methods - (attack () _type_ :state 178) - (attack-failed () _type_ :state 179) - (hidden () _type_ :state 180) - (grab-cam () _type_ :state 181) - (thru-grating () _type_ :state 182) - (centipede-method-183 (_type_) none 183) - (set-chan1-effects (_type_) none 184) - (target-close? (_type_) symbol 185) - (centipede-method-186 (_type_) none 186) - (centipede-method-187 (_type_) none 187) - (centipede-method-188 (_type_) none 188) + (centipede-method-183 (_type_) none) + (set-chan1-effects (_type_) none) + (target-close? (_type_) symbol) + (centipede-method-186 (_type_) none) + (centipede-method-187 (_type_) none) + (centipede-method-188 (_type_) none) ) ) ;; definition for method 3 of type centipede -(defmethod inspect centipede ((this centipede)) +(defmethod inspect ((this centipede)) (when (not this) (set! this this) (goto cfg-4) @@ -220,7 +215,7 @@ (set! (-> *centipede-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type centipede -(defmethod general-event-handler centipede ((this centipede) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this centipede) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -235,7 +230,7 @@ ;; definition for method 7 of type centipede ;; WARN: Return type mismatch nav-enemy vs centipede. -(defmethod relocate centipede ((this centipede) (arg0 int)) +(defmethod relocate ((this centipede) (arg0 int)) (if (nonzero? (-> this bobbing)) (&+! (-> this bobbing) arg0) ) @@ -246,7 +241,7 @@ ) ;; definition for method 10 of type centipede -(defmethod deactivate centipede ((this centipede)) +(defmethod deactivate ((this centipede)) (when (-> this set-camera-mode?) (set! (-> this set-camera-mode?) #f) (remove-setting-by-arg0 *setting-control* 'mode-name) @@ -261,7 +256,7 @@ ;; definition for method 187 of type centipede ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod centipede-method-187 centipede ((this centipede)) +(defmethod centipede-method-187 ((this centipede)) (let ((centipede-cam (-> this cam))) (let ((cam-dir (new 'stack-no-clear 'vector))) (set! (-> cam-dir quad) (-> centipede-cam dir quad)) @@ -363,7 +358,7 @@ ;; definition for method 188 of type centipede ;; WARN: Return type mismatch int vs none. -(defmethod centipede-method-188 centipede ((this centipede)) +(defmethod centipede-method-188 ((this centipede)) (local-vars (s5-0 art-element)) (let ((janim (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) @@ -483,7 +478,7 @@ ;; definition for method 184 of type centipede ;; WARN: Return type mismatch int vs none. -(defmethod set-chan1-effects centipede ((this centipede)) +(defmethod set-chan1-effects ((this centipede)) (when (-> this using-chan1-effects?) (set! (-> this using-chan1-effects?) #f) (let ((v1-2 (-> this skel effect))) @@ -497,7 +492,7 @@ ;; definition for method 142 of type centipede ;; INFO: Used lq/sq ;; WARN: Return type mismatch quaternion vs none. -(defmethod nav-enemy-method-142 centipede ((this centipede) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ((this centipede) (arg0 nav-control)) (let ((t9-0 (method-of-type nav-enemy nav-enemy-method-142))) (t9-0 this arg0) ) @@ -562,13 +557,13 @@ ) ;; definition for method 60 of type centipede -(defmethod coin-flip? centipede ((this centipede)) +(defmethod coin-flip? ((this centipede)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 98 of type centipede -(defmethod in-aggro-range? centipede ((this centipede) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? ((this centipede) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -600,7 +595,7 @@ ;; definition for method 107 of type centipede ;; WARN: Return type mismatch process vs process-focusable. -(defmethod get-enemy-target centipede ((this centipede)) +(defmethod get-enemy-target ((this centipede)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" (let ((v0-0 (handle->process (-> this focus handle)))) (if (and v0-0 (focus-test? (the-as process-focusable v0-0) disable dead grabbed)) @@ -611,7 +606,7 @@ ) ;; definition for method 185 of type centipede -(defmethod target-close? centipede ((this centipede)) +(defmethod target-close? ((this centipede)) "Is the target close enough to attack?" (let ((targ (get-enemy-target this))) (when targ @@ -630,7 +625,7 @@ ;; definition for method 183 of type centipede ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod centipede-method-183 centipede ((this centipede)) +(defmethod centipede-method-183 ((this centipede)) (when (not (and (-> this next-state) (= (-> this next-state name) 'thru-grating))) (centipede-method-187 this) (when (= (-> this id) 2) @@ -677,7 +672,7 @@ ;; definition for method 55 of type centipede ;; INFO: Used lq/sq -(defmethod track-target! centipede ((this centipede)) +(defmethod track-target! ((this centipede)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -758,7 +753,7 @@ ;; definition for method 116 of type centipede ;; WARN: Return type mismatch object vs none. -(defmethod go-idle centipede ((this centipede)) +(defmethod go-idle ((this centipede)) (case (-> this id) ((1) (cond @@ -1055,7 +1050,7 @@ ;; definition for method 186 of type centipede ;; INFO: Used lq/sq ;; WARN: Return type mismatch quaternion vs none. -(defmethod centipede-method-186 centipede ((this centipede)) +(defmethod centipede-method-186 ((this centipede)) (let ((proc (handle->process (-> this focus handle)))) (when proc (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable proc) 0) quad)) @@ -1248,7 +1243,7 @@ ;; definition for method 114 of type centipede ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! centipede ((this centipede)) +(defmethod init-enemy-collision! ((this centipede)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1341,7 +1336,7 @@ ;; definition for method 115 of type centipede ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! centipede ((this centipede)) +(defmethod init-enemy! ((this centipede)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (set! (-> this id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) (set! (-> this cam init?) #t) diff --git a/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc b/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc index 8b0f2d2b543..6e91e6aded4 100644 --- a/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc @@ -4,14 +4,10 @@ ;; definition of type jellyfish-formation (deftype jellyfish-formation (hover-formation) () - :heap-base #x10 - :method-count-assert 16 - :size-assert #x90 - :flag-assert #x1000100090 ) ;; definition for method 3 of type jellyfish-formation -(defmethod inspect jellyfish-formation ((this jellyfish-formation)) +(defmethod inspect ((this jellyfish-formation)) (when (not this) (set! this this) (goto cfg-4) @@ -24,7 +20,7 @@ ) ;; definition for method 15 of type jellyfish-formation -(defmethod hover-formation-method-15 jellyfish-formation ((this jellyfish-formation) (arg0 vector) (arg1 vector)) +(defmethod hover-formation-method-15 ((this jellyfish-formation) (arg0 vector) (arg1 vector)) (logior! (-> this formation flags) 2) 0 ) @@ -32,13 +28,10 @@ ;; definition of type jellyfish-chain-physics (deftype jellyfish-chain-physics (chain-physics) () - :method-count-assert 18 - :size-assert #x570 - :flag-assert #x1200000570 ) ;; definition for method 3 of type jellyfish-chain-physics -(defmethod inspect jellyfish-chain-physics ((this jellyfish-chain-physics)) +(defmethod inspect ((this jellyfish-chain-physics)) (when (not this) (set! this this) (goto cfg-4) @@ -65,7 +58,7 @@ ;; definition for method 13 of type jellyfish-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod apply-gravity jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity ((this jellyfish-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (vector-float*! arg0 (-> this gravity) @@ -78,7 +71,7 @@ ;; definition for method 14 of type jellyfish-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-14 jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 ((this jellyfish-chain-physics) (arg0 vector) (arg1 int)) (vector-float*! arg0 (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 1) 64))) @@ -89,7 +82,7 @@ ) ;; definition for method 16 of type jellyfish-chain-physics -(defmethod chain-physics-method-16 jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 ((this jellyfish-chain-physics) (arg0 int)) (if (zero? arg0) 0.0 5461.3335 @@ -99,7 +92,7 @@ ;; definition for method 12 of type jellyfish-chain-physics ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod gravity-update jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 process-drawable)) +(defmethod gravity-update ((this jellyfish-chain-physics) (arg0 process-drawable)) ((method-of-type chain-physics gravity-update) this arg0) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((s5-0 (new 'stack-no-clear 'bounding-box))) @@ -130,7 +123,7 @@ ;; definition for method 17 of type jellyfish-chain-physics ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-17 jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-17 ((this jellyfish-chain-physics) (arg0 vector) (arg1 int)) (local-vars (v1-26 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -198,48 +191,46 @@ ;; definition of type jellyfish (deftype jellyfish (hover-enemy) - ((los los-control :inline :offset-assert 784) - (sync sync-eased :inline :offset-assert 936) - (sound-id sound-id :offset-assert 980) - (path-player-u float :offset-assert 984) - (path-my-u float :offset-assert 988) - (path-y-offset float :offset-assert 992) - (path-stare-u float :offset-assert 996) - (tentacle-clock float :offset-assert 1000) - (tentacle-blend float :offset-assert 1004) - (last-attack-time time-frame :offset-assert 1008) - (last-fire-time time-frame :offset-assert 1016) - (charge-path-timer time-frame :offset-assert 1024) - (tentacles jellyfish-chain-physics 5 :offset-assert 1032) - (tentacles-initialized symbol :offset-assert 1052) - (stare-pos vector :inline :offset-assert 1056) - (charge-pos vector :inline :offset-assert 1072) - (grab-front symbol :offset-assert 1088) - (grab-offset vector :inline :offset-assert 1104) - (grab-start-pos vector :inline :offset-assert 1120) - (grab-start-quat quaternion :inline :offset-assert 1136) - (focus-rot quaternion :inline :offset-assert 1152) - (attach-lerp float :offset-assert 1168) + ((los los-control :inline) + (sync sync-eased :inline) + (sound-id sound-id) + (path-player-u float) + (path-my-u float) + (path-y-offset float) + (path-stare-u float) + (tentacle-clock float) + (tentacle-blend float) + (last-attack-time time-frame) + (last-fire-time time-frame) + (charge-path-timer time-frame) + (tentacles jellyfish-chain-physics 5) + (tentacles-initialized symbol) + (stare-pos vector :inline) + (charge-pos vector :inline) + (grab-front symbol) + (grab-offset vector :inline) + (grab-start-pos vector :inline) + (grab-start-quat quaternion :inline) + (focus-rot quaternion :inline) + (attach-lerp float) ) - :heap-base #x420 - :method-count-assert 165 - :size-assert #x494 - :flag-assert #xa504200494 + (:state-methods + jellyfish-state-156 + threaten + charge-attack + grab-mech + die-now + ) (:methods - (jellyfish-method-156 () none 156) - (threaten () _type_ :state 157) - (charge-attack () _type_ :state 158) - (grab-mech () _type_ :state 159) - (die-now () _type_ :state 160) - (jellyfish-method-161 (_type_ vector float) vector 161) - (jellyfish-method-162 (_type_) symbol 162) - (jellyfish-method-163 (_type_ process-focusable) symbol 163) - (jellyfish-method-164 (_type_ process-focusable) symbol 164) + (jellyfish-method-161 (_type_ vector float) vector) + (jellyfish-method-162 (_type_) symbol) + (jellyfish-method-163 (_type_ process-focusable) symbol) + (jellyfish-method-164 (_type_ process-focusable) symbol) ) ) ;; definition for method 3 of type jellyfish -(defmethod inspect jellyfish ((this jellyfish)) +(defmethod inspect ((this jellyfish)) (when (not this) (set! this this) (goto cfg-4) @@ -278,18 +269,15 @@ ;; definition of type jellyfish-joint-mod-tentacle-info (deftype jellyfish-joint-mod-tentacle-info (structure) - ((axis vector :inline :offset-assert 0) - (angle float :offset-assert 16) - (period float :offset-assert 20) - (offset float :offset-assert 24) + ((axis vector :inline) + (angle float) + (period float) + (offset float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type jellyfish-joint-mod-tentacle-info -(defmethod inspect jellyfish-joint-mod-tentacle-info ((this jellyfish-joint-mod-tentacle-info)) +(defmethod inspect ((this jellyfish-joint-mod-tentacle-info)) (when (not this) (set! this this) (goto cfg-4) @@ -440,7 +428,7 @@ (set! (-> *jellyfish-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 151 of type jellyfish -(defmethod hover-enemy-method-151 jellyfish ((this jellyfish)) +(defmethod hover-enemy-method-151 ((this jellyfish)) (new 'static 'hover-enemy-info :fly-forward-anim 2 :fly-backward-anim 2 @@ -455,7 +443,7 @@ ) ;; definition for method 152 of type jellyfish -(defmethod hover-enemy-method-152 jellyfish ((this jellyfish)) +(defmethod hover-enemy-method-152 ((this jellyfish)) (new 'static 'hover-nav-params :max-speed 32768.0 :max-acceleration 24576.0 :friction 0.8) ) @@ -911,7 +899,7 @@ ) ;; definition for method 74 of type jellyfish -(defmethod general-event-handler jellyfish ((this jellyfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this jellyfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -939,7 +927,7 @@ ) ;; definition for method 161 of type jellyfish -(defmethod jellyfish-method-161 jellyfish ((this jellyfish) (arg0 vector) (arg1 float)) +(defmethod jellyfish-method-161 ((this jellyfish) (arg0 vector) (arg1 float)) (get-point-in-path! (-> this path) arg0 arg1 'interp) (+! (-> arg0 y) (-> this path-y-offset)) arg0 @@ -947,7 +935,7 @@ ;; definition for method 164 of type jellyfish ;; WARN: Return type mismatch object vs symbol. -(defmethod jellyfish-method-164 jellyfish ((this jellyfish) (arg0 process-focusable)) +(defmethod jellyfish-method-164 ((this jellyfish) (arg0 process-focusable)) (local-vars (v1-10 object)) (jellyfish-method-161 this (new 'stack-no-clear 'vector) (get-norm! (-> this sync) 0)) (let ((s5-1 (jellyfish-method-161 this (new 'stack-no-clear 'vector) (-> this path-player-u))) @@ -996,7 +984,7 @@ ;; definition for method 163 of type jellyfish ;; WARN: Return type mismatch object vs symbol. -(defmethod jellyfish-method-163 jellyfish ((this jellyfish) (arg0 process-focusable)) +(defmethod jellyfish-method-163 ((this jellyfish) (arg0 process-focusable)) (local-vars (v1-8 object)) (jellyfish-method-161 this (new 'stack-no-clear 'vector) (-> this path-stare-u)) (let ((s5-0 (-> this focus-pos))) @@ -1043,7 +1031,7 @@ ;; definition for method 162 of type jellyfish ;; INFO: Used lq/sq -(defmethod jellyfish-method-162 jellyfish ((this jellyfish)) +(defmethod jellyfish-method-162 ((this jellyfish)) (local-vars (sv-624 int)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1147,7 +1135,7 @@ ;; definition for method 55 of type jellyfish ;; INFO: Used lq/sq -(defmethod track-target! jellyfish ((this jellyfish)) +(defmethod track-target! ((this jellyfish)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1190,14 +1178,14 @@ ;; definition for method 116 of type jellyfish ;; WARN: Return type mismatch object vs none. -(defmethod go-idle jellyfish ((this jellyfish)) +(defmethod go-idle ((this jellyfish)) (go (method-of-object this active)) (none) ) ;; definition for method 149 of type jellyfish ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-149 jellyfish ((this jellyfish)) +(defmethod hover-enemy-method-149 ((this jellyfish)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-jellyfish" (the-as (pointer uint32) #f))) @@ -1208,13 +1196,13 @@ ) ;; definition for method 150 of type jellyfish -(defmethod hover-enemy-method-150 jellyfish ((this jellyfish)) +(defmethod hover-enemy-method-150 ((this jellyfish)) *jellyfish-enemy-info* ) ;; definition for method 114 of type jellyfish ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! jellyfish ((this jellyfish)) +(defmethod init-enemy-collision! ((this jellyfish)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1287,7 +1275,7 @@ ;; definition for method 7 of type jellyfish ;; WARN: Return type mismatch hover-enemy vs jellyfish. -(defmethod relocate jellyfish ((this jellyfish) (arg0 int)) +(defmethod relocate ((this jellyfish) (arg0 int)) (dotimes (v1-0 5) (if (nonzero? (-> this tentacles v1-0)) (&+! (-> this tentacles v1-0) arg0) @@ -1297,7 +1285,7 @@ ) ;; definition for method 10 of type jellyfish -(defmethod deactivate jellyfish ((this jellyfish)) +(defmethod deactivate ((this jellyfish)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -1305,7 +1293,7 @@ ;; definition for method 115 of type jellyfish ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! jellyfish ((this jellyfish)) +(defmethod init-enemy! ((this jellyfish)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (hover-enemy-method-149 this) (init-enemy-behaviour-and-stats! this (hover-enemy-method-150 this)) diff --git a/test/decompiler/reference/jak2/levels/under/pipe-grunt_REF.gc b/test/decompiler/reference/jak2/levels/under/pipe-grunt_REF.gc index 9611d8363a7..d46f1e3db9b 100644 --- a/test/decompiler/reference/jak2/levels/under/pipe-grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/pipe-grunt_REF.gc @@ -3,20 +3,16 @@ ;; definition of type pipe-grunt (deftype pipe-grunt (grunt) - ((pipe-front vector :inline :offset-assert 704) - (pipe-dir vector :inline :offset-assert 720) + ((pipe-front vector :inline) + (pipe-dir vector :inline) ) - :heap-base #x260 - :method-count-assert 187 - :size-assert #x2e0 - :flag-assert #xbb026002e0 (:methods - (pipe-grunt-method-186 (_type_) vector 186) + (pipe-grunt-method-186 (_type_) vector) ) ) ;; definition for method 3 of type pipe-grunt -(defmethod inspect pipe-grunt ((this pipe-grunt)) +(defmethod inspect ((this pipe-grunt)) (when (not this) (set! this this) (goto cfg-4) @@ -31,12 +27,12 @@ ) ;; definition for method 66 of type pipe-grunt -(defmethod go-ambush pipe-grunt ((this pipe-grunt)) +(defmethod go-ambush ((this pipe-grunt)) (go (method-of-object this ambush)) ) ;; definition for method 186 of type pipe-grunt -(defmethod pipe-grunt-method-186 pipe-grunt ((this pipe-grunt)) +(defmethod pipe-grunt-method-186 ((this pipe-grunt)) (let ((gp-0 (new 'static 'vector :x -1187061.8 :y -278487.03 :z 8090870.0 :w 1.0))) (let ((v1-0 (new 'static 'vector :x -1148026.9 :y -278487.03 :z 8112414.5 :w 1.0)) (s3-0 (new 'stack-no-clear 'vector)) diff --git a/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc b/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc index a78b66fe14e..ff1c35386d4 100644 --- a/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc @@ -3,15 +3,12 @@ ;; definition of type sig5-course (deftype sig5-course (bot-course) - ((chase-speeches bot-speech-list-shuffle :offset-assert 48) + ((chase-speeches bot-speech-list-shuffle) ) - :method-count-assert 9 - :size-assert #x34 - :flag-assert #x900000034 ) ;; definition for method 3 of type sig5-course -(defmethod inspect sig5-course ((this sig5-course)) +(defmethod inspect ((this sig5-course)) (when (not this) (set! this this) (goto cfg-4) @@ -37,29 +34,27 @@ ;; definition of type sig-under (deftype sig-under (sig) - ((sig5-course sig5-course :offset 652) - (shot-at-growls-index int8 :offset-assert 1072) - (growls handle 2 :offset-assert 1080) - (next-chase-play-time time-frame :offset 1096) - (grating-broken-time time-frame :offset 1096) - (test-plane plane :inline :offset-assert 1104) + ((sig5-course sig5-course :overlay-at course) + (shot-at-growls-index int8) + (growls handle 2) + (next-chase-play-time time-frame :offset 1096) + (grating-broken-time time-frame :overlay-at next-chase-play-time) + (test-plane plane :inline) ) - :heap-base #x3e0 - :method-count-assert 265 - :size-assert #x460 - :flag-assert #x10903e00460 + (:state-methods + intro-shooting + ) (:methods - (intro-shooting () _type_ :state 259) - (sig-under-method-260 (_type_) symbol 260) - (sig-under-method-261 (_type_ vector vector symbol) symbol 261) - (sig-under-method-262 (_type_ symbol) symbol 262) - (sig-under-method-263 (_type_) none 263) - (sig-under-method-264 (_type_) symbol 264) + (sig-under-method-260 (_type_) symbol) + (sig-under-method-261 (_type_ vector vector symbol) symbol) + (sig-under-method-262 (_type_ symbol) symbol) + (sig-under-method-263 (_type_) none) + (sig-under-method-264 (_type_) symbol) ) ) ;; definition for method 3 of type sig-under -(defmethod inspect sig-under ((this sig-under)) +(defmethod inspect ((this sig-under)) (when (not this) (set! this this) (goto cfg-4) @@ -78,7 +73,7 @@ ;; definition for method 263 of type sig-under ;; WARN: Return type mismatch time-frame vs none. -(defmethod sig-under-method-263 sig-under ((this sig-under)) +(defmethod sig-under-method-263 ((this sig-under)) (let ((s5-0 (current-time))) (when (and (>= s5-0 (-> this next-chase-play-time)) (not (channel-active? this (the-as uint 0))) @@ -104,7 +99,7 @@ ;; definition for method 195 of type sig-under ;; WARN: Return type mismatch object vs symbol. -(defmethod attacked-by-player? sig-under ((this sig-under) (arg0 process-focusable)) +(defmethod attacked-by-player? ((this sig-under) (arg0 process-focusable)) "Were we attacked by the player?" (the-as symbol @@ -117,7 +112,7 @@ ) ;; definition for method 86 of type sig-under -(defmethod enemy-method-86 sig-under ((this sig-under)) +(defmethod enemy-method-86 ((this sig-under)) (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) (let ((a1-0 (new 'stack-no-clear 'collide-query))) @@ -130,7 +125,7 @@ ;; definition for method 76 of type sig-under ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 sig-under ((this sig-under) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 ((this sig-under) (arg0 process) (arg1 event-message-block)) (the-as symbol (cond @@ -147,7 +142,7 @@ ) ;; definition for method 74 of type sig-under -(defmethod general-event-handler sig-under ((this sig-under) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ((this sig-under) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (with-pp @@ -204,7 +199,7 @@ ;; definition for method 262 of type sig-under ;; WARN: disable def twice: 39. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod sig-under-method-262 sig-under ((this sig-under) (arg0 symbol)) +(defmethod sig-under-method-262 ((this sig-under) (arg0 symbol)) (when (or (logtest? (-> this bot-task-bits) (bot-task-bits botbits-1)) (and arg0 (let ((f0-0 81920.0)) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans))) @@ -225,7 +220,7 @@ ) ;; definition for method 264 of type sig-under -(defmethod sig-under-method-264 sig-under ((this sig-under)) +(defmethod sig-under-method-264 ((this sig-under)) (and (logtest? (-> this bot-task-bits) (bot-task-bits botbits-3)) (not (channel-active? this (the-as uint 0))) (scene-play this "under-get-sig-out-res" #f) @@ -234,7 +229,7 @@ ;; definition for method 260 of type sig-under ;; INFO: Used lq/sq -(defmethod sig-under-method-260 sig-under ((this sig-under)) +(defmethod sig-under-method-260 ((this sig-under)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -347,7 +342,7 @@ ;; definition for method 261 of type sig-under ;; INFO: Used lq/sq -(defmethod sig-under-method-261 sig-under ((this sig-under) (arg0 vector) (arg1 vector) (arg2 symbol)) +(defmethod sig-under-method-261 ((this sig-under) (arg0 vector) (arg1 vector) (arg2 symbol)) (set! (-> arg0 w) (- (+ (* (-> arg0 x) (-> this root trans x)) (* (-> arg0 z) (-> this root trans z))))) (let ((v1-2 (new 'stack-no-clear 'vector))) (set! (-> v1-2 quad) (-> arg1 quad)) @@ -470,13 +465,13 @@ ) ;; definition for method 183 of type sig-under -(defmethod alive? sig-under ((this sig-under)) +(defmethod alive? ((this sig-under)) ((method-of-type bot alive?) this) ) ;; definition for method 210 of type sig-under ;; WARN: Return type mismatch symbol vs none. -(defmethod init! sig-under ((this sig-under)) +(defmethod init! ((this sig-under)) "Set defaults for various fields." (let ((t9-0 (method-of-type sig init!))) (t9-0 this) @@ -491,7 +486,7 @@ ;; definition for method 116 of type sig-under ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sig-under ((this sig-under)) +(defmethod go-idle ((this sig-under)) (cond ((task-node-closed? (game-task-node under-sig-resolution)) (cleanup-for-death this) diff --git a/test/decompiler/reference/jak2/levels/under/under-laser_REF.gc b/test/decompiler/reference/jak2/levels/under/under-laser_REF.gc index 957e46645b5..3779da91f5d 100644 --- a/test/decompiler/reference/jak2/levels/under/under-laser_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-laser_REF.gc @@ -3,20 +3,17 @@ ;; definition of type under-laser-info (deftype under-laser-info (basic) - ((options uint8 :offset-assert 4) - (laser-radius float :offset-assert 8) - (laser-move-dist float :offset-assert 12) - (shadow-top-y float :offset-assert 16) - (shadow-height float :offset-assert 20) - (shadow-radius-adjust float :offset-assert 24) + ((options uint8) + (laser-radius float) + (laser-move-dist float) + (shadow-top-y float) + (shadow-height float) + (shadow-radius-adjust float) ) - :method-count-assert 9 - :size-assert #x1c - :flag-assert #x90000001c ) ;; definition for method 3 of type under-laser-info -(defmethod inspect under-laser-info ((this under-laser-info)) +(defmethod inspect ((this under-laser-info)) (when (not this) (set! this this) (goto cfg-4) @@ -83,21 +80,17 @@ ;; definition of type under-laser-shadow (deftype under-laser-shadow (process-drawable) - ((root collide-shape-moving :override) - (info under-laser-info :offset-assert 200) - (trans-xz-offset vector :inline :offset-assert 208) + ((root collide-shape-moving :override) + (info under-laser-info) + (trans-xz-offset vector :inline) ) - :heap-base #x60 - :method-count-assert 21 - :size-assert #xe0 - :flag-assert #x15006000e0 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type under-laser-shadow -(defmethod inspect under-laser-shadow ((this under-laser-shadow)) +(defmethod inspect ((this under-laser-shadow)) (when (not this) (set! this this) (goto cfg-4) @@ -113,19 +106,15 @@ ;; definition of type under-laser-slave (deftype under-laser-slave (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type under-laser-slave -(defmethod inspect under-laser-slave ((this under-laser-slave)) +(defmethod inspect ((this under-laser-slave)) (when (not this) (set! this this) (goto cfg-4) @@ -139,30 +128,28 @@ ;; definition of type under-laser (deftype under-laser (process-drawable) - ((root collide-shape-moving :override) - (info under-laser-info :offset-assert 200) - (id int8 :offset-assert 204) - (lightning lightning-control :offset-assert 208) - (draw-test-script script-context :offset-assert 212) - (sync sync-eased :inline :offset-assert 216) - (laser-dir vector :inline :offset-assert 272) - (slave-trans-offset vector :inline :offset-assert 288) - (zero-pos vector :inline :offset-assert 304) - (one-pos vector :inline :offset-assert 320) + ((root collide-shape-moving :override) + (info under-laser-info) + (id int8) + (lightning lightning-control) + (draw-test-script script-context) + (sync sync-eased :inline) + (laser-dir vector :inline) + (slave-trans-offset vector :inline) + (zero-pos vector :inline) + (one-pos vector :inline) ) - :heap-base #xd0 - :method-count-assert 23 - :size-assert #x150 - :flag-assert #x1700d00150 + (:state-methods + dormant + idle + ) (:methods - (dormant () _type_ :state 20) - (idle () _type_ :state 21) - (under-laser-method-22 (_type_) none 22) + (under-laser-method-22 (_type_) none) ) ) ;; definition for method 3 of type under-laser -(defmethod inspect under-laser ((this under-laser)) +(defmethod inspect ((this under-laser)) (when (not this) (set! this this) (goto cfg-4) @@ -310,7 +297,7 @@ ;; definition for method 22 of type under-laser ;; INFO: Used lq/sq ;; WARN: Return type mismatch sound-id vs none. -(defmethod under-laser-method-22 under-laser ((this under-laser)) +(defmethod under-laser-method-22 ((this under-laser)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (set! (-> s5-0 start-pos quad) (-> this root trans quad)) (set! (-> s5-0 move-dist quad) (-> this slave-trans-offset quad)) @@ -438,7 +425,7 @@ ;; definition for method 7 of type under-laser ;; WARN: Return type mismatch process-drawable vs under-laser. -(defmethod relocate under-laser ((this under-laser) (arg0 int)) +(defmethod relocate ((this under-laser) (arg0 int)) (if (nonzero? (-> this lightning)) (&+! (-> this lightning) arg0) ) @@ -448,7 +435,7 @@ ;; definition for method 11 of type under-laser ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-laser ((this under-laser) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-laser) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc b/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc index 22ed37b4c07..3a55d798e86 100644 --- a/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc @@ -295,22 +295,18 @@ ;; definition of type bubbler (deftype bubbler (process-drawable) - ((rod-of-god-scale float :offset-assert 200) - (ambient-id sound-id :offset-assert 204) - (last-recharge-time time-frame :offset-assert 208) + ((rod-of-god-scale float) + (ambient-id sound-id) + (last-recharge-time time-frame) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xd8 - :flag-assert #x16006000d8 - (:methods - (idle () _type_ :state 20) - (hidden () _type_ :state 21) + (:state-methods + idle + hidden ) ) ;; definition for method 3 of type bubbler -(defmethod inspect bubbler ((this bubbler)) +(defmethod inspect ((this bubbler)) (when (not this) (set! this this) (goto cfg-4) @@ -387,7 +383,7 @@ ) ;; definition for method 10 of type bubbler -(defmethod deactivate bubbler ((this bubbler)) +(defmethod deactivate ((this bubbler)) (sound-stop (-> this ambient-id)) ((method-of-type process-drawable deactivate) this) (none) @@ -395,7 +391,7 @@ ;; definition for method 11 of type bubbler ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! bubbler ((this bubbler) (arg0 entity-actor)) +(defmethod init-from-entity! ((this bubbler) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -413,32 +409,28 @@ This commonly includes things such as: ;; definition of type under-rise-plat (deftype under-rise-plat (process-drawable) - ((up-y float :offset-assert 200) - (down-y float :offset-assert 204) - (delta-y float :offset-assert 208) - (up-threshold float :offset-assert 212) - (down-threshold float :offset-assert 216) - (last-ridden time-frame :offset-assert 224) - (ridden symbol :offset-assert 232) - (rider-started basic :offset-assert 236) - (extra-id int32 :offset-assert 240) + ((up-y float) + (down-y float) + (delta-y float) + (up-threshold float) + (down-threshold float) + (last-ridden time-frame) + (ridden symbol) + (rider-started basic) + (extra-id int32) ) - :heap-base #x80 - :method-count-assert 26 - :size-assert #xf4 - :flag-assert #x1a008000f4 - (:methods - (idle-up () _type_ :state 20) - (wait-up () _type_ :state 21) - (going-down () _type_ :state 22) - (idle-down () _type_ :state 23) - (wait-down () _type_ :state 24) - (going-up () _type_ :state 25) + (:state-methods + idle-up + wait-up + going-down + idle-down + wait-down + going-up ) ) ;; definition for method 3 of type under-rise-plat -(defmethod inspect under-rise-plat ((this under-rise-plat)) +(defmethod inspect ((this under-rise-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -652,7 +644,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-rise-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-rise-plat ((this under-rise-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-rise-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -712,21 +704,17 @@ This commonly includes things such as: ;; definition of type under-buoy-base (deftype under-buoy-base (process-drawable) - ((release symbol :offset-assert 200) - (open-anim-frame float :offset-assert 204) + ((release symbol) + (open-anim-frame float) ) - :heap-base #x50 - :method-count-assert 22 - :size-assert #xd0 - :flag-assert #x16005000d0 - (:methods - (idle () _type_ :state 20) - (opened () _type_ :state 21) + (:state-methods + idle + opened ) ) ;; definition for method 3 of type under-buoy-base -(defmethod inspect under-buoy-base ((this under-buoy-base)) +(defmethod inspect ((this under-buoy-base)) (when (not this) (set! this this) (goto cfg-4) @@ -859,17 +847,13 @@ This commonly includes things such as: ;; definition of type under-buoy-chain (deftype under-buoy-chain (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type under-buoy-chain -(defmethod inspect under-buoy-chain ((this under-buoy-chain)) +(defmethod inspect ((this under-buoy-chain)) (when (not this) (set! this this) (goto cfg-4) @@ -942,23 +926,19 @@ This commonly includes things such as: ;; definition of type under-buoy-plat (deftype under-buoy-plat (rigid-body-platform) - ((orig-trans vector :inline :offset-assert 384) - (surface-height float :offset-assert 400) - (anchor-point vector :inline :offset-assert 416) - (base (pointer under-buoy-base) :offset-assert 432) + ((orig-trans vector :inline) + (surface-height float) + (anchor-point vector :inline) + (base (pointer under-buoy-base)) ) - :heap-base #x140 - :method-count-assert 59 - :size-assert #x1b4 - :flag-assert #x3b014001b4 - (:methods - (waiting () _type_ :state 57) - (running () _type_ :state 58) + (:state-methods + waiting + running ) ) ;; definition for method 3 of type under-buoy-plat -(defmethod inspect under-buoy-plat ((this under-buoy-plat)) +(defmethod inspect ((this under-buoy-plat)) (when (not this) (set! this this) (goto cfg-4) @@ -982,7 +962,7 @@ This commonly includes things such as: ;; definition for method 29 of type under-buoy-plat ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 under-buoy-plat ((this under-buoy-plat) (arg0 float)) +(defmethod rigid-body-object-method-29 ((this under-buoy-plat) (arg0 float)) (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this orig-trans)) 0 @@ -991,7 +971,7 @@ This commonly includes things such as: ;; definition for method 32 of type under-buoy-plat ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape under-buoy-plat ((this under-buoy-plat)) +(defmethod allocate-and-init-cshape ((this under-buoy-plat)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1056,13 +1036,13 @@ This commonly includes things such as: ) ;; definition for method 53 of type under-buoy-plat -(defmethod rigid-body-platform-method-53 under-buoy-plat ((this under-buoy-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-53 ((this under-buoy-plat) (arg0 vector)) -220341.05 ) ;; definition for method 56 of type under-buoy-plat ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-56 under-buoy-plat ((this under-buoy-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-56 ((this under-buoy-plat) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> this rbody state position)) (set! (-> v1-0 y) 0.0) @@ -1082,7 +1062,7 @@ This commonly includes things such as: ;; definition for method 33 of type under-buoy-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body under-buoy-plat ((this under-buoy-plat)) +(defmethod init-skel-and-rigid-body ((this under-buoy-plat)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-buoy-plat" (the-as (pointer uint32) #f))) @@ -1114,7 +1094,7 @@ This commonly includes things such as: ;; definition for method 34 of type under-buoy-plat ;; WARN: Return type mismatch object vs none. -(defmethod rigid-body-object-method-34 under-buoy-plat ((this under-buoy-plat)) +(defmethod rigid-body-object-method-34 ((this under-buoy-plat)) (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) (go (method-of-object this running)) (go (method-of-object this waiting)) @@ -1188,13 +1168,10 @@ This commonly includes things such as: ;; definition of type under-mine-chain-physics (deftype under-mine-chain-physics (chain-physics) () - :method-count-assert 18 - :size-assert #x570 - :flag-assert #x1200000570 ) ;; definition for method 3 of type under-mine-chain-physics -(defmethod inspect under-mine-chain-physics ((this under-mine-chain-physics)) +(defmethod inspect ((this under-mine-chain-physics)) (when (not this) (set! this this) (goto cfg-4) @@ -1222,7 +1199,7 @@ This commonly includes things such as: ;; definition for method 13 of type under-mine-chain-physics ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod apply-gravity under-mine-chain-physics ((this under-mine-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity ((this under-mine-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (local-vars (v1-7 vector) (v1-11 vector) (a0-17 float) (a0-26 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1294,7 +1271,7 @@ This commonly includes things such as: ;; definition for method 14 of type under-mine-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-14 under-mine-chain-physics ((this under-mine-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 ((this under-mine-chain-physics) (arg0 vector) (arg1 int)) (vector-reset! arg0) 0 (none) @@ -1303,7 +1280,7 @@ This commonly includes things such as: ;; definition for method 15 of type under-mine-chain-physics ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs vector. -(defmethod clamp-length under-mine-chain-physics ((this under-mine-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) +(defmethod clamp-length ((this under-mine-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> arg3 entity trans quad)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -1320,30 +1297,26 @@ This commonly includes things such as: ) ;; definition for method 16 of type under-mine-chain-physics -(defmethod chain-physics-method-16 under-mine-chain-physics ((this under-mine-chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 ((this under-mine-chain-physics) (arg0 int)) 21845.334 ) ;; definition of type under-mine (deftype under-mine (process-drawable) - ((root collide-shape-moving :override) - (chain under-mine-chain-physics :offset-assert 200) - (chain-initialized symbol :offset-assert 204) - (main-mod joint-mod :offset-assert 208) - (head-mod joint-mod :offset-assert 212) + ((root collide-shape-moving :override) + (chain under-mine-chain-physics) + (chain-initialized symbol) + (main-mod joint-mod) + (head-mod joint-mod) ) - :heap-base #x60 - :method-count-assert 22 - :size-assert #xd8 - :flag-assert #x16006000d8 - (:methods - (explode () _type_ :state 20) - (idle () _type_ :state 21) + (:state-methods + explode + idle ) ) ;; definition for method 3 of type under-mine -(defmethod inspect under-mine ((this under-mine)) +(defmethod inspect ((this under-mine)) (when (not this) (set! this this) (goto cfg-4) @@ -1558,7 +1531,7 @@ This commonly includes things such as: ;; definition for method 7 of type under-mine ;; WARN: Return type mismatch process-drawable vs under-mine. -(defmethod relocate under-mine ((this under-mine) (arg0 int)) +(defmethod relocate ((this under-mine) (arg0 int)) (if (nonzero? (-> this main-mod)) (&+! (-> this main-mod) arg0) ) @@ -1574,7 +1547,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-mine ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-mine ((this under-mine) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-mine) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1630,19 +1603,15 @@ This commonly includes things such as: ;; definition of type under-lift (deftype under-lift (elevator) - ((sound-id sound-id :offset-assert 368) + ((sound-id sound-id) ) - :heap-base #x100 - :method-count-assert 50 - :size-assert #x174 - :flag-assert #x3201000174 (:methods - (under-lift-method-49 (_type_ symbol) none 49) + (under-lift-method-49 (_type_ symbol) none) ) ) ;; definition for method 3 of type under-lift -(defmethod inspect under-lift ((this under-lift)) +(defmethod inspect ((this under-lift)) (when (not this) (set! this this) (goto cfg-4) @@ -1662,13 +1631,13 @@ This commonly includes things such as: ) ;; definition for method 30 of type under-lift -(defmethod get-art-group under-lift ((this under-lift)) +(defmethod get-art-group ((this under-lift)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-under-lift" (the-as (pointer uint32) #f)) ) ;; definition for method 43 of type under-lift -(defmethod move-between-points under-lift ((this under-lift) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points ((this under-lift) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -1688,7 +1657,7 @@ This commonly includes things such as: ) ;; definition for method 45 of type under-lift -(defmethod commited-to-ride? under-lift ((this under-lift)) +(defmethod commited-to-ride? ((this under-lift)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) @@ -1709,7 +1678,7 @@ This commonly includes things such as: ;; definition for method 49 of type under-lift ;; WARN: Return type mismatch int vs none. -(defmethod under-lift-method-49 under-lift ((this under-lift) (arg0 symbol)) +(defmethod under-lift-method-49 ((this under-lift) (arg0 symbol)) (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 @@ -1773,7 +1742,7 @@ This commonly includes things such as: ) ;; definition for method 10 of type under-lift -(defmethod deactivate under-lift ((this under-lift)) +(defmethod deactivate ((this under-lift)) (sound-stop (-> this sound-id)) (call-parent-method this) (none) @@ -1781,7 +1750,7 @@ This commonly includes things such as: ;; definition for method 33 of type under-lift ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! under-lift ((this under-lift)) +(defmethod init-plat! ((this under-lift)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (set! (-> this sound-id) (new-sound-id)) @@ -1791,7 +1760,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 31 of type under-lift -(defmethod init-plat-collision! under-lift ((this under-lift)) +(defmethod init-plat-collision! ((this under-lift)) "TODO - collision stuff for setting up the platform" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -1834,22 +1803,18 @@ For example for an elevator pre-compute the distance between the first and last ;; definition of type under-break-door (deftype under-break-door (process-focusable) - ((anim art-joint-anim :offset-assert 204) - (art-name string :offset-assert 208) - (collide-mesh int32 :offset-assert 212) + ((anim art-joint-anim) + (art-name string) + (collide-mesh int32) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd8 - :flag-assert #x1d006000d8 - (:methods - (hit (symbol) _type_ :state 27) - (idle () _type_ :state 28) + (:state-methods + (hit symbol) + idle ) ) ;; definition for method 3 of type under-break-door -(defmethod inspect under-break-door ((this under-break-door)) +(defmethod inspect ((this under-break-door)) (when (not this) (set! this this) (goto cfg-4) @@ -1921,7 +1886,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 11 of type under-break-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-door ((this under-break-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-break-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2019,17 +1984,13 @@ This commonly includes things such as: ;; definition of type under-seaweed-a (deftype under-seaweed-a (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type under-seaweed-a -(defmethod inspect under-seaweed-a ((this under-seaweed-a)) +(defmethod inspect ((this under-seaweed-a)) (when (not this) (set! this this) (goto cfg-4) @@ -2068,7 +2029,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-seaweed-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-a ((this under-seaweed-a) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-seaweed-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2135,17 +2096,13 @@ This commonly includes things such as: ;; definition of type under-seaweed-b (deftype under-seaweed-b (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type under-seaweed-b -(defmethod inspect under-seaweed-b ((this under-seaweed-b)) +(defmethod inspect ((this under-seaweed-b)) (when (not this) (set! this this) (goto cfg-4) @@ -2184,7 +2141,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-seaweed-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-b ((this under-seaweed-b) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-seaweed-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2205,17 +2162,13 @@ This commonly includes things such as: ;; definition of type under-seaweed-c (deftype under-seaweed-c (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type under-seaweed-c -(defmethod inspect under-seaweed-c ((this under-seaweed-c)) +(defmethod inspect ((this under-seaweed-c)) (when (not this) (set! this this) (goto cfg-4) @@ -2254,7 +2207,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-seaweed-c ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-c ((this under-seaweed-c) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-seaweed-c) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2275,17 +2228,13 @@ This commonly includes things such as: ;; definition of type under-seaweed-d (deftype under-seaweed-d (process-drawable) () - :heap-base #x50 - :method-count-assert 21 - :size-assert #xc8 - :flag-assert #x15005000c8 - (:methods - (idle () _type_ :state 20) + (:state-methods + idle ) ) ;; definition for method 3 of type under-seaweed-d -(defmethod inspect under-seaweed-d ((this under-seaweed-d)) +(defmethod inspect ((this under-seaweed-d)) (when (not this) (set! this this) (goto cfg-4) @@ -2324,7 +2273,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-seaweed-d ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-d ((this under-seaweed-d) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-seaweed-d) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2344,7 +2293,7 @@ This commonly includes things such as: ;; definition for method 15 of type hud-mech-air-tank ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-mech-air-tank ((this hud-mech-air-tank)) +(defmethod draw ((this hud-mech-air-tank)) (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) (the int (+ 472.0 (* 100.0 (-> this offset)))) @@ -2368,7 +2317,7 @@ This commonly includes things such as: ;; definition for method 16 of type hud-mech-air-tank ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-mech-air-tank ((this hud-mech-air-tank)) +(defmethod update-values ((this hud-mech-air-tank)) (set! (-> this values 0 target) (the int (-> *game-info* air-supply))) (logclear! (-> this flags) (hud-flags disable)) ((method-of-type hud update-values) this) @@ -2378,7 +2327,7 @@ This commonly includes things such as: ;; definition for method 17 of type hud-mech-air-tank ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-mech-air-tank ((this hud-mech-air-tank)) +(defmethod init-callback ((this hud-mech-air-tank)) (set! (-> this gui-id) (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) diff --git a/test/decompiler/reference/jak2/levels/under/under-part_REF.gc b/test/decompiler/reference/jak2/levels/under/under-part_REF.gc index 2d33da61477..dc5da97d9c7 100644 --- a/test/decompiler/reference/jak2/levels/under/under-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-part_REF.gc @@ -4,14 +4,10 @@ ;; definition of type under-part (deftype under-part (part-spawner) () - :heap-base #x30 - :method-count-assert 16 - :size-assert #xb0 - :flag-assert #x10003000b0 ) ;; definition for method 3 of type under-part -(defmethod inspect under-part ((this under-part)) +(defmethod inspect ((this under-part)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc b/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc index d69be6f55ef..fcddc5ad814 100644 --- a/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc @@ -3,19 +3,16 @@ ;; definition of type under-block-spawner (deftype under-block-spawner (basic) - ((col int8 :offset-assert 4) - (row int8 :offset-assert 5) - (active-handle handle :offset-assert 8) - (waiting-handle handle :offset-assert 16) - (exploded-time time-frame :offset-assert 24) + ((col int8) + (row int8) + (active-handle handle) + (waiting-handle handle) + (exploded-time time-frame) ) - :method-count-assert 9 - :size-assert #x20 - :flag-assert #x900000020 ) ;; definition for method 3 of type under-block-spawner -(defmethod inspect under-block-spawner ((this under-block-spawner)) +(defmethod inspect ((this under-block-spawner)) (when (not this) (set! this this) (goto cfg-4) @@ -32,16 +29,13 @@ ;; definition of type under-block-slot (deftype under-block-slot (basic) - ((col int8 :offset-assert 4) - (row int8 :offset-assert 5) + ((col int8) + (row int8) ) - :method-count-assert 9 - :size-assert #x6 - :flag-assert #x900000006 ) ;; definition for method 3 of type under-block-slot -(defmethod inspect under-block-slot ((this under-block-slot)) +(defmethod inspect ((this under-block-slot)) (when (not this) (set! this this) (goto cfg-4) @@ -55,28 +49,25 @@ ;; definition of type under-block-puzzle (deftype under-block-puzzle (basic) - ((auto-unlock? symbol :offset-assert 4) - (cells-wide int8 :offset-assert 8) - (cells-tall int8 :offset-assert 9) - (last-block-id int8 :offset-assert 10) - (slot-mask uint8 :offset-assert 11) - (slot-mask-full uint8 :offset-assert 12) - (prev-special-attack-id uint32 :offset-assert 16) - (orient-ry float :offset-assert 20) - (spawners (array under-block-spawner) :offset-assert 24) - (slots (array under-block-slot) :offset-assert 28) - (cells (pointer int32) :offset-assert 32) - (pulse-ops (pointer int8) :offset-assert 36) - (origin vector :inline :offset-assert 48) - (local-to-world matrix :inline :offset-assert 64) + ((auto-unlock? symbol) + (cells-wide int8) + (cells-tall int8) + (last-block-id int8) + (slot-mask uint8) + (slot-mask-full uint8) + (prev-special-attack-id uint32) + (orient-ry float) + (spawners (array under-block-spawner)) + (slots (array under-block-slot)) + (cells (pointer int32)) + (pulse-ops (pointer int8)) + (origin vector :inline) + (local-to-world matrix :inline) ) - :method-count-assert 9 - :size-assert #x80 - :flag-assert #x900000080 ) ;; definition for method 3 of type under-block-puzzle -(defmethod inspect under-block-puzzle ((this under-block-puzzle)) +(defmethod inspect ((this under-block-puzzle)) (when (not this) (set! this this) (goto cfg-4) @@ -668,59 +659,57 @@ ;; definition of type under-block (deftype under-block (process-focusable) - ((puzzle under-block-puzzle :offset-assert 204) - (my-parent (pointer process) :offset-assert 208) - (prev-attack-id uint32 :offset-assert 212) - (spawner-id int8 :offset-assert 216) - (my-id int8 :offset-assert 217) - (col int8 :offset-assert 218) - (row int8 :offset-assert 219) - (prev-col int8 :offset-assert 220) - (prev-row int8 :offset-assert 221) - (move-dir-x int8 :offset-assert 222) - (move-dir-z int8 :offset-assert 223) - (pulse-op int8 :offset-assert 224) - (pulse-pc int8 :offset-assert 225) - (pulse-ctr int8 :offset-assert 226) - (flags under-block-flags :offset-assert 232) - (activated-time time-frame :offset-assert 240) - (rot-axis vector :inline :offset-assert 256) - (away-from-focal-pt vector :inline :offset-assert 272) + ((puzzle under-block-puzzle) + (my-parent (pointer process)) + (prev-attack-id uint32) + (spawner-id int8) + (my-id int8) + (col int8) + (row int8) + (prev-col int8) + (prev-row int8) + (move-dir-x int8) + (move-dir-z int8) + (pulse-op int8) + (pulse-pc int8) + (pulse-ctr int8) + (flags under-block-flags) + (activated-time time-frame) + (rot-axis vector :inline) + (away-from-focal-pt vector :inline) ) - :heap-base #xa0 - :method-count-assert 51 - :size-assert #x120 - :flag-assert #x3300a00120 + (:state-methods + waiting + rise-up + follow + idle + active + flip + rock + sink-partially + sunk-partially + victory + beaten + fall + explode + die-fast + ) (:methods - (waiting () _type_ :state 27) - (rise-up () _type_ :state 28) - (follow () _type_ :state 29) - (idle () _type_ :state 30) - (active () _type_ :state 31) - (flip () _type_ :state 32) - (rock () _type_ :state 33) - (sink-partially () _type_ :state 34) - (sunk-partially () _type_ :state 35) - (victory () _type_ :state 36) - (beaten () _type_ :state 37) - (fall () _type_ :state 38) - (explode () _type_ :state 39) - (die-fast () _type_ :state 40) - (under-block-method-41 (_type_ symbol) none 41) - (under-block-method-42 (_type_) none 42) - (under-block-method-43 (_type_ int int) symbol 43) - (under-block-method-44 (_type_) symbol 44) - (under-block-method-45 (_type_) none 45) - (under-block-method-46 (_type_ int int) none 46) - (under-block-method-47 (_type_ int int) int 47) - (under-block-method-48 (_type_ int int) symbol 48) - (under-block-method-49 (_type_ int int) symbol 49) - (under-block-method-50 (_type_) none 50) + (under-block-method-41 (_type_ symbol) none) + (under-block-method-42 (_type_) none) + (under-block-method-43 (_type_ int int) symbol) + (under-block-method-44 (_type_) symbol) + (under-block-method-45 (_type_) none) + (under-block-method-46 (_type_ int int) none) + (under-block-method-47 (_type_ int int) int) + (under-block-method-48 (_type_ int int) symbol) + (under-block-method-49 (_type_ int int) symbol) + (under-block-method-50 (_type_) none) ) ) ;; definition for method 3 of type under-block -(defmethod inspect under-block ((this under-block)) +(defmethod inspect ((this under-block)) (when (not this) (set! this this) (goto cfg-4) @@ -752,29 +741,27 @@ ;; definition of type under-shoot-block (deftype under-shoot-block (process-drawable) - ((puzzle under-block-puzzle :offset-assert 200) - (actor-group (pointer actor-group) :offset-assert 204) - (allow-unlock? symbol :offset-assert 208) + ((puzzle under-block-puzzle) + (actor-group (pointer actor-group)) + (allow-unlock? symbol) ) - :heap-base #x60 - :method-count-assert 29 - :size-assert #xd4 - :flag-assert #x1d006000d4 + (:state-methods + idle + victory-locked + victory + beaten + ) (:methods - (idle () _type_ :state 20) - (victory-locked () _type_ :state 21) - (victory () _type_ :state 22) - (beaten () _type_ :state 23) - (under-shoot-block-method-24 (_type_ int int) none 24) - (under-shoot-block-method-25 (_type_ int int float int) none 25) - (under-shoot-block-method-26 (_type_) none 26) - (under-shoot-block-method-27 (_type_ symbol) none 27) - (under-shoot-block-method-28 (_type_) int 28) + (under-shoot-block-method-24 (_type_ int int) none) + (under-shoot-block-method-25 (_type_ int int float int) none) + (under-shoot-block-method-26 (_type_) none) + (under-shoot-block-method-27 (_type_ symbol) none) + (under-shoot-block-method-28 (_type_) int) ) ) ;; definition for method 3 of type under-shoot-block -(defmethod inspect under-shoot-block ((this under-shoot-block)) +(defmethod inspect ((this under-shoot-block)) (when (not this) (set! this this) (goto cfg-4) @@ -890,7 +877,7 @@ ) ;; definition for method 48 of type under-block -(defmethod under-block-method-48 under-block ((this under-block) (arg0 int) (arg1 int)) +(defmethod under-block-method-48 ((this under-block) (arg0 int) (arg1 int)) (let ((v1-0 (-> this puzzle))) (when (and (>= arg0 0) (< arg0 (-> v1-0 cells-wide)) (>= arg1 0) (< arg1 (-> v1-0 cells-tall))) (let* ((a1-1 (+ (* arg1 (-> v1-0 cells-wide)) arg0)) @@ -908,7 +895,7 @@ ;; definition for method 46 of type under-block ;; WARN: Return type mismatch int vs none. -(defmethod under-block-method-46 under-block ((this under-block) (arg0 int) (arg1 int)) +(defmethod under-block-method-46 ((this under-block) (arg0 int) (arg1 int)) (let ((v1-0 (-> this puzzle))) (when (and (>= arg0 0) (< arg0 (-> v1-0 cells-wide)) (>= arg1 0) (< arg1 (-> v1-0 cells-tall))) (let ((a1-1 (+ (* arg1 (-> v1-0 cells-wide)) arg0))) @@ -923,7 +910,7 @@ ) ;; definition for method 47 of type under-block -(defmethod under-block-method-47 under-block ((this under-block) (arg0 int) (arg1 int)) +(defmethod under-block-method-47 ((this under-block) (arg0 int) (arg1 int)) (let ((v1-0 (-> this puzzle)) (v0-0 -1) ) @@ -937,19 +924,19 @@ ) ;; definition for method 43 of type under-block -(defmethod under-block-method-43 under-block ((this under-block) (arg0 int) (arg1 int)) +(defmethod under-block-method-43 ((this under-block) (arg0 int) (arg1 int)) (let ((v1-3 (under-block-method-47 this (+ (-> this col) arg0) (+ (-> this row) arg1)))) (or (zero? v1-3) (= v1-3 -2) (= v1-3 (-> this my-id))) ) ) ;; definition for method 49 of type under-block -(defmethod under-block-method-49 under-block ((this under-block) (arg0 int) (arg1 int)) +(defmethod under-block-method-49 ((this under-block) (arg0 int) (arg1 int)) (= (under-block-method-47 this (+ (-> this col) arg0) (+ (-> this row) arg1)) -1) ) ;; definition for method 44 of type under-block -(defmethod under-block-method-44 under-block ((this under-block)) +(defmethod under-block-method-44 ((this under-block)) (let ((v1-0 (-> this puzzle)) (a2-0 (-> this puzzle slots)) ) @@ -967,7 +954,7 @@ ;; definition for method 42 of type under-block ;; WARN: Return type mismatch int vs none. -(defmethod under-block-method-42 under-block ((this under-block)) +(defmethod under-block-method-42 ((this under-block)) (set-time! (-> this activated-time)) (logior! (-> this flags) (under-block-flags unbflags-1)) (set! (-> this pulse-pc) 0) @@ -979,7 +966,7 @@ ;; definition for method 45 of type under-block ;; WARN: Return type mismatch object vs none. ;; WARN: Function (method 45 under-block) has a return type of none, but the expression builder found a return statement. -(defmethod under-block-method-45 under-block ((this under-block)) +(defmethod under-block-method-45 ((this under-block)) (let ((v1-0 (-> this puzzle))) (when (logtest? (-> this flags) (under-block-flags unbflags-1)) (cond @@ -1043,7 +1030,7 @@ ;; definition for method 41 of type under-block ;; WARN: Return type mismatch int vs none. -(defmethod under-block-method-41 under-block ((this under-block) (arg0 symbol)) +(defmethod under-block-method-41 ((this under-block) (arg0 symbol)) (let ((v1-1 (-> this root root-prim))) (case arg0 (('active) @@ -1314,7 +1301,7 @@ ;; definition for method 50 of type under-block ;; INFO: Used lq/sq -(defmethod under-block-method-50 under-block ((this under-block)) +(defmethod under-block-method-50 ((this under-block)) (with-pp (let ((s5-0 (new @@ -1936,7 +1923,7 @@ ;; definition for method 25 of type under-shoot-block ;; WARN: Return type mismatch symbol vs none. -(defmethod under-shoot-block-method-25 under-shoot-block ((this under-shoot-block) (arg0 int) (arg1 int) (arg2 float) (arg3 int)) +(defmethod under-shoot-block-method-25 ((this under-shoot-block) (arg0 int) (arg1 int) (arg2 float) (arg3 int)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (set-vector! (-> gp-0 vector 0) -8192.0 0.0 -8192.0 1.0) (set-vector! (-> gp-0 vector 1) -8192.0 0.0 8192.0 1.0) @@ -2003,7 +1990,7 @@ ) ;; definition for method 24 of type under-shoot-block -(defmethod under-shoot-block-method-24 under-shoot-block ((this under-shoot-block) (arg0 int) (arg1 int)) +(defmethod under-shoot-block-method-24 ((this under-shoot-block) (arg0 int) (arg1 int)) (local-vars (v1-11 symbol) (v1-20 symbol)) (let ((a0-1 (-> this puzzle))) (if (>= (-> (the-as (pointer int8) (&+ (-> a0-1 cells) (+ (* arg1 (-> a0-1 cells-wide)) arg0)))) 0) @@ -2046,7 +2033,7 @@ ;; definition for method 26 of type under-shoot-block ;; WARN: Return type mismatch symbol vs none. -(defmethod under-shoot-block-method-26 under-shoot-block ((this under-shoot-block)) +(defmethod under-shoot-block-method-26 ((this under-shoot-block)) (countdown (s5-0 (-> this puzzle cells-tall)) (countdown (s4-0 (-> this puzzle cells-wide)) (under-shoot-block-method-24 this s4-0 s5-0) @@ -2056,7 +2043,7 @@ ) ;; definition for method 28 of type under-shoot-block -(defmethod under-shoot-block-method-28 under-shoot-block ((this under-shoot-block)) +(defmethod under-shoot-block-method-28 ((this under-shoot-block)) (let* ((v1-0 (-> this puzzle)) (v0-0 (+ (-> v1-0 last-block-id) 1)) ) @@ -2071,7 +2058,7 @@ ;; definition for method 27 of type under-shoot-block ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod under-shoot-block-method-27 under-shoot-block ((this under-shoot-block) (arg0 symbol)) +(defmethod under-shoot-block-method-27 ((this under-shoot-block) (arg0 symbol)) (local-vars (sv-16 process) (sv-32 (function int int symbol (pointer process) none :behavior under-block)) @@ -2347,7 +2334,7 @@ ) ;; definition for method 10 of type under-shoot-block -(defmethod deactivate under-shoot-block ((this under-shoot-block)) +(defmethod deactivate ((this under-shoot-block)) (let ((s5-0 (-> this puzzle spawners))) (countdown (s4-0 (-> s5-0 length)) (let ((s3-0 (-> s5-0 s4-0))) @@ -2363,7 +2350,7 @@ ;; definition for method 11 of type under-shoot-block ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-shoot-block ((this under-shoot-block) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-shoot-block) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size diff --git a/test/decompiler/reference/jak2/levels/under/under-sig-obs_REF.gc b/test/decompiler/reference/jak2/levels/under/under-sig-obs_REF.gc index b59a315a2e8..cc1292957f7 100644 --- a/test/decompiler/reference/jak2/levels/under/under-sig-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-sig-obs_REF.gc @@ -3,32 +3,28 @@ ;; definition of type under-plat-shoot (deftype under-plat-shoot (plat) - ((draw-test-script script-context :offset-assert 324) - (incoming-attack-id uint32 :offset-assert 328) - (angle-flip float :offset-assert 332) - (angle-flip-vel float :offset-assert 336) - (state-flip uint32 :offset-assert 340) - (time-flip uint32 :offset-assert 344) - (disable-track-under basic :offset-assert 348) - (dest-angle float :offset-assert 352) - (on-shake basic :offset-assert 356) - (hint-count float :offset-assert 360) - (hit-time time-frame :offset-assert 368) - (knocked-sound-time time-frame :offset-assert 376) - (axe-flip vector :inline :offset-assert 384) + ((draw-test-script script-context) + (incoming-attack-id uint32) + (angle-flip float) + (angle-flip-vel float) + (state-flip uint32) + (time-flip uint32) + (disable-track-under basic) + (dest-angle float) + (on-shake basic) + (hint-count float) + (hit-time time-frame) + (knocked-sound-time time-frame) + (axe-flip vector :inline) ) - :heap-base #x110 - :method-count-assert 39 - :size-assert #x190 - :flag-assert #x2701100190 - (:methods - (die-falling () _type_ :state 37) - (dormant () _type_ :state 38) + (:state-methods + die-falling + dormant ) ) ;; definition for method 3 of type under-plat-shoot -(defmethod inspect under-plat-shoot ((this under-plat-shoot)) +(defmethod inspect ((this under-plat-shoot)) (when (not this) (set! this this) (goto cfg-4) @@ -60,7 +56,7 @@ ) ;; definition for method 30 of type under-plat-shoot -(defmethod get-art-group under-plat-shoot ((this under-plat-shoot)) +(defmethod get-art-group ((this under-plat-shoot)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-under-plat-shoot" (the-as (pointer uint32) #f)) ) @@ -82,7 +78,7 @@ ;; definition for method 31 of type under-plat-shoot ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! under-plat-shoot ((this under-plat-shoot)) +(defmethod init-plat-collision! ((this under-plat-shoot)) "TODO - collision stuff for setting up the platform" (set! (-> this clock) (-> *display* user0-clock)) (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -131,14 +127,14 @@ ;; definition for method 32 of type under-plat-shoot ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 under-plat-shoot ((this under-plat-shoot)) +(defmethod base-plat-method-32 ((this under-plat-shoot)) 0 (none) ) ;; definition for method 33 of type under-plat-shoot ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! under-plat-shoot ((this under-plat-shoot)) +(defmethod init-plat! ((this under-plat-shoot)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." (logclear! (-> this mask) (process-mask actor-pause)) @@ -438,7 +434,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 36 of type under-plat-shoot -(defmethod plat-path-sync under-plat-shoot ((this under-plat-shoot)) +(defmethod plat-path-sync ((this under-plat-shoot)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @@ -457,21 +453,17 @@ otherwise, [[plat::34]] ;; definition of type under-break-floor (deftype under-break-floor (process-drawable) - ((root collide-shape-moving :override) + ((root collide-shape-moving :override) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc8 - :flag-assert #x17005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) - (die-fast () _type_ :state 22) + (:state-methods + idle + die + die-fast ) ) ;; definition for method 3 of type under-break-floor -(defmethod inspect under-break-floor ((this under-break-floor)) +(defmethod inspect ((this under-break-floor)) (when (not this) (set! this this) (goto cfg-4) @@ -588,7 +580,7 @@ otherwise, [[plat::34]] ;; definition for method 11 of type under-break-floor ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-floor ((this under-break-floor) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-break-floor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -650,18 +642,14 @@ This commonly includes things such as: ;; definition of type under-break-wall (deftype under-break-wall (process-drawable) () - :heap-base #x50 - :method-count-assert 22 - :size-assert #xc8 - :flag-assert #x16005000c8 - (:methods - (idle () _type_ :state 20) - (die () _type_ :state 21) + (:state-methods + idle + die ) ) ;; definition for method 3 of type under-break-wall -(defmethod inspect under-break-wall ((this under-break-wall)) +(defmethod inspect ((this under-break-wall)) (when (not this) (set! this this) (goto cfg-4) @@ -702,7 +690,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-break-wall ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-wall ((this under-break-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-break-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -764,22 +752,18 @@ This commonly includes things such as: ;; definition of type under-break-bridge (deftype under-break-bridge (process-drawable) - ((root collide-shape-moving :override) - (bridge-id int8 :offset-assert 200) + ((root collide-shape-moving :override) + (bridge-id int8) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc9 - :flag-assert #x17005000c9 - (:methods - (idle () _type_ :state 20) - (broken () _type_ :state 21) - (die () _type_ :state 22) + (:state-methods + idle + broken + die ) ) ;; definition for method 3 of type under-break-bridge -(defmethod inspect under-break-bridge ((this under-break-bridge)) +(defmethod inspect ((this under-break-bridge)) (when (not this) (set! this this) (goto cfg-4) @@ -845,7 +829,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-break-bridge ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-bridge ((this under-break-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-break-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -927,19 +911,15 @@ This commonly includes things such as: ;; definition of type under-int-door (deftype under-int-door (process-drawable) () - :heap-base #x50 - :method-count-assert 23 - :size-assert #xc8 - :flag-assert #x17005000c8 - (:methods - (idle-closed () _type_ :state 20) - (open () _type_ :state 21) - (idle-open () _type_ :state 22) + (:state-methods + idle-closed + open + idle-open ) ) ;; definition for method 3 of type under-int-door -(defmethod inspect under-int-door ((this under-int-door)) +(defmethod inspect ((this under-int-door)) (when (not this) (set! this this) (goto cfg-4) @@ -997,7 +977,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-int-door ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-int-door ((this under-int-door) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-int-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1092,21 +1072,17 @@ This commonly includes things such as: ;; definition of type under-plat-long (deftype under-plat-long (base-plat) - ((sync sync-eased :inline :offset-assert 272) - (move-start vector :inline :offset-assert 320) - (move-end vector :inline :offset-assert 336) + ((sync sync-eased :inline) + (move-start vector :inline) + (move-end vector :inline) ) - :heap-base #xe0 - :method-count-assert 35 - :size-assert #x160 - :flag-assert #x2300e00160 - (:methods - (idle () _type_ :state 34) + (:state-methods + idle ) ) ;; definition for method 3 of type under-plat-long -(defmethod inspect under-plat-long ((this under-plat-long)) +(defmethod inspect ((this under-plat-long)) (when (not this) (set! this this) (goto cfg-4) @@ -1142,7 +1118,7 @@ This commonly includes things such as: ;; definition for method 31 of type under-plat-long ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! under-plat-long ((this under-plat-long)) +(defmethod init-plat-collision! ((this under-plat-long)) "TODO - collision stuff for setting up the platform" (set! (-> this clock) (-> *display* user0-clock)) (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -1170,7 +1146,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-plat-long ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-plat-long ((this under-plat-long) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-plat-long) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1241,23 +1217,19 @@ This commonly includes things such as: ;; definition of type under-plat-wall (deftype under-plat-wall (process-drawable) - ((root collide-shape-moving :override) - (extended-amount float :offset-assert 200) - (in-trans vector :inline :offset-assert 208) - (out-trans vector :inline :offset-assert 224) - (sync sync-paused :inline :offset-assert 240) + ((root collide-shape-moving :override) + (extended-amount float) + (in-trans vector :inline) + (out-trans vector :inline) + (sync sync-paused :inline) ) - :heap-base #x90 - :method-count-assert 21 - :size-assert #x108 - :flag-assert #x1500900108 - (:methods - (active () _type_ :state 20) + (:state-methods + active ) ) ;; definition for method 3 of type under-plat-wall -(defmethod inspect under-plat-wall ((this under-plat-wall)) +(defmethod inspect ((this under-plat-wall)) (when (not this) (set! this this) (goto cfg-4) @@ -1330,7 +1302,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-plat-wall ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-plat-wall ((this under-plat-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-plat-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1408,25 +1380,21 @@ This commonly includes things such as: ;; definition of type under-pipe-growls (deftype under-pipe-growls (process-drawable) - ((volume float :offset-assert 200) - (desired-volume float :offset-assert 204) - (volume-seek-speed float :offset-assert 208) - (approach-sound-id sound-id :offset-assert 212) - (approach-play-time time-frame :offset-assert 216) + ((volume float) + (desired-volume float) + (volume-seek-speed float) + (approach-sound-id sound-id) + (approach-play-time time-frame) ) - :heap-base #x60 - :method-count-assert 23 - :size-assert #xe0 - :flag-assert #x17006000e0 - (:methods - (block-puzzle () _type_ :state 20) - (block-puzzle-fade () _type_ :state 21) - (intro-shooting () _type_ :state 22) + (:state-methods + block-puzzle + block-puzzle-fade + intro-shooting ) ) ;; definition for method 3 of type under-pipe-growls -(defmethod inspect under-pipe-growls ((this under-pipe-growls)) +(defmethod inspect ((this under-pipe-growls)) (when (not this) (set! this this) (goto cfg-4) diff --git a/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc b/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc index 2d149af40d2..2b38bbafc0f 100644 --- a/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc @@ -3,21 +3,19 @@ ;; definition of type under-warp (deftype under-warp (process-drawable) - ((interp float :offset-assert 200) + ((interp float) ) - :heap-base #x50 - :method-count-assert 23 - :size-assert #xcc - :flag-assert #x17005000cc + (:state-methods + idle + die-fast + ) (:methods - (idle () _type_ :state 20) - (die-fast () _type_ :state 21) - (under-warp-method-22 (_type_) none 22) + (under-warp-method-22 (_type_) none) ) ) ;; definition for method 3 of type under-warp -(defmethod inspect under-warp ((this under-warp)) +(defmethod inspect ((this under-warp)) (when (not this) (set! this this) (goto cfg-4) @@ -80,7 +78,7 @@ ;; definition for method 22 of type under-warp ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod under-warp-method-22 under-warp ((this under-warp)) +(defmethod under-warp-method-22 ((this under-warp)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -148,39 +146,37 @@ ;; definition of type underb-master (deftype underb-master (process) - ((warp-handle handle :offset-assert 128) - (tank-handle handle :offset-assert 136) - (underwater-time time-frame :offset-assert 144) - (last-air-beep-time time-frame :offset-assert 152) - (ambient-sound-id sound-id :offset-assert 160) - (air-supply float :offset-assert 164) - (air-charge-up? symbol :offset-assert 168) - (under-water-pitch-mod float :offset-assert 172) - (big-room-entered symbol :offset-assert 176) - (big-room-timer time-frame :offset-assert 184) - (under-plat-player-on symbol :offset-assert 192) - (under-plat-is-up symbol :offset-assert 196) + ((warp-handle handle) + (tank-handle handle) + (underwater-time time-frame) + (last-air-beep-time time-frame) + (ambient-sound-id sound-id) + (air-supply float) + (air-charge-up? symbol) + (under-water-pitch-mod float) + (big-room-entered symbol) + (big-room-timer time-frame) + (under-plat-player-on symbol) + (under-plat-is-up symbol) ) - :heap-base #x50 - :method-count-assert 24 - :size-assert #xc8 - :flag-assert #x18005000c8 + (:state-methods + idle + big-room-player-under + big-room-player-plat + underb-master-state-17 + big-room-player-above + big-room-player-falling + big-room-player-exiting + big-room-player-done + ) (:methods - (idle () _type_ :state 14) - (big-room-player-under () _type_ :state 15) - (big-room-player-plat () _type_ :state 16) - (underb-master-method-17 () none 17) - (big-room-player-above () _type_ :state 18) - (big-room-player-falling () _type_ :state 19) - (big-room-player-exiting () _type_ :state 20) - (big-room-player-done () _type_ :state 21) - (under-warp-check (_type_) symbol 22) - (spawn-air-tank-hud (_type_ symbol) none 23) + (under-warp-check (_type_) symbol) + (spawn-air-tank-hud (_type_ symbol) none) ) ) ;; definition for method 3 of type underb-master -(defmethod inspect underb-master ((this underb-master)) +(defmethod inspect ((this underb-master)) (when (not this) (set! this this) (goto cfg-4) @@ -208,7 +204,7 @@ (define *underb-master* (the-as (pointer underb-master) #f)) ;; definition for method 10 of type underb-master -(defmethod deactivate underb-master ((this underb-master)) +(defmethod deactivate ((this underb-master)) (sound-stop (-> this ambient-sound-id)) (send-event (handle->process (-> this warp-handle)) 'die-fast) (set! *underb-master* (the-as (pointer underb-master) #f)) @@ -358,7 +354,7 @@ ) ;; definition for method 22 of type underb-master -(defmethod under-warp-check underb-master ((this underb-master)) +(defmethod under-warp-check ((this underb-master)) "Used to check whether the underwater warp effect should be drawn." (let ((target-pos (target-pos 0)) (tpos-offset (new 'stack-no-clear 'vector)) @@ -378,7 +374,7 @@ ;; definition for method 23 of type underb-master ;; WARN: Return type mismatch int vs none. -(defmethod spawn-air-tank-hud underb-master ((this underb-master) (arg0 symbol)) +(defmethod spawn-air-tank-hud ((this underb-master) (arg0 symbol)) "Spawns or hides the air tank HUD bar." (cond (arg0 @@ -656,31 +652,27 @@ ;; definition of type under-locking (deftype under-locking (process-drawable) - ((id int8 :offset-assert 200) - (up-y float :offset-assert 204) - (down-y float :offset-assert 208) - (mode under-locking-mode :offset-assert 216) - (which-reminder? symbol :offset-assert 224) - (spooled-sound-id sound-id :offset-assert 228) - (draining-part sparticle-launch-control :offset-assert 232) - (actor-group (pointer actor-group) :offset-assert 236) - (spooled-sound-delay int32 :offset-assert 240) - (last-reminder-time time-frame :offset 256) + ((id int8) + (up-y float) + (down-y float) + (mode under-locking-mode) + (which-reminder? symbol) + (spooled-sound-id sound-id) + (draining-part sparticle-launch-control) + (actor-group (pointer actor-group)) + (spooled-sound-delay int32) + (last-reminder-time time-frame :offset 256) ) - :heap-base #x90 - :method-count-assert 24 - :size-assert #x108 - :flag-assert #x1800900108 - (:methods - (startup () _type_ :state 20) - (active () _type_ :state 21) - (filling () _type_ :state 22) - (draining () _type_ :state 23) + (:state-methods + startup + active + filling + draining ) ) ;; definition for method 3 of type under-locking -(defmethod inspect under-locking ((this under-locking)) +(defmethod inspect ((this under-locking)) (when (not this) (set! this this) (goto cfg-4) @@ -705,7 +697,7 @@ ;; definition for method 7 of type under-locking ;; WARN: Return type mismatch process-drawable vs under-locking. -(defmethod relocate under-locking ((this under-locking) (arg0 int)) +(defmethod relocate ((this under-locking) (arg0 int)) (if (nonzero? (-> this draining-part)) (&+! (-> this draining-part) arg0) ) @@ -713,7 +705,7 @@ ) ;; definition for method 10 of type under-locking -(defmethod deactivate under-locking ((this under-locking)) +(defmethod deactivate ((this under-locking)) (if (nonzero? (-> this draining-part)) (kill-and-free-particles (-> this draining-part)) ) @@ -1129,7 +1121,7 @@ ;; definition for method 11 of type under-locking ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-locking ((this under-locking) (arg0 entity-actor)) +(defmethod init-from-entity! ((this under-locking) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1167,14 +1159,10 @@ This commonly includes things such as: ;; definition of type water-anim-under (deftype water-anim-under (water-anim) () - :heap-base #x80 - :method-count-assert 29 - :size-assert #x100 - :flag-assert #x1d00800100 ) ;; definition for method 3 of type water-anim-under -(defmethod inspect water-anim-under ((this water-anim-under)) +(defmethod inspect ((this water-anim-under)) (when (not this) (set! this this) (goto cfg-4) @@ -1202,7 +1190,7 @@ This commonly includes things such as: ;; definition for method 24 of type water-anim-under ;; WARN: Return type mismatch int vs none. -(defmethod init-water! water-anim-under ((this water-anim-under)) +(defmethod init-water! ((this water-anim-under)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) (t9-0 this) diff --git a/test/goalc/source_templates/variables/stack-structure-align.gc b/test/goalc/source_templates/variables/stack-structure-align.gc index c790fdf796b..762ddb8803e 100644 --- a/test/goalc/source_templates/variables/stack-structure-align.gc +++ b/test/goalc/source_templates/variables/stack-structure-align.gc @@ -3,7 +3,7 @@ (count uint32) (pad uint8 12)) (:methods - (new (symbol type int) _type_ 0) + (new (symbol type int) _type_) ) ) diff --git a/test/goalc/source_templates/with_game/inlined-packed-basics.gc b/test/goalc/source_templates/with_game/inlined-packed-basics.gc index 2e73c71a99a..c6e1a68b259 100644 --- a/test/goalc/source_templates/with_game/inlined-packed-basics.gc +++ b/test/goalc/source_templates/with_game/inlined-packed-basics.gc @@ -27,14 +27,14 @@ :size-assert #x118 :flag-assert #x1100000118 (:methods - (dummy-9 () none 9) - (dummy-10 () none 10) - (dummy-11 () none 11) - (dummy-12 () none 12) - (dummy-13 () none 13) - (dummy-14 () none 14) - (dummy-15 () none 15) - (dummy-16 () none 16) + (dummy-9 () none) + (dummy-10 () none) + (dummy-11 () none) + (dummy-12 () none) + (dummy-13 () none) + (dummy-14 () none) + (dummy-15 () none) + (dummy-16 () none) ) ) diff --git a/test/goalc/source_templates/with_game/test-method-replace.gc b/test/goalc/source_templates/with_game/test-method-replace.gc index d4062b698dc..39ede9fb73e 100644 --- a/test/goalc/source_templates/with_game/test-method-replace.gc +++ b/test/goalc/source_templates/with_game/test-method-replace.gc @@ -1,7 +1,7 @@ (deftype type-with-weird-relocate (basic) ((foo int)) (:methods - (relocate (_type_ kheap (pointer uint8)) none :replace 7) + (relocate (_type_ kheap (pointer uint8)) none :replace) ) )